From dd7dafe82db68391746a2ad1cd79c5f9f2ae0c4c Mon Sep 17 00:00:00 2001 From: Jonathan Lui Date: Mon, 5 Nov 2018 19:23:35 -0800 Subject: [PATCH 001/342] initial commit --- .../.circleci/config.yml | 179 ++ .../.circleci/npm-install-retry.js | 60 + .../google-cloud-securitycenter/.eslintignore | 4 + .../google-cloud-securitycenter/.eslintrc.yml | 15 + .../google-cloud-securitycenter/.gitignore | 10 + .../google-cloud-securitycenter/.jsdoc.js | 45 + packages/google-cloud-securitycenter/.nycrc | 26 + .../CODE_OF_CONDUCT.md | 43 + .../google-cloud-securitycenter/codecov.yaml | 4 + .../google-cloud-securitycenter/package.json | 66 + .../cloud/securitycenter/v1beta1/asset.proto | 85 + .../securitycenter/v1beta1/finding.proto | 96 + .../v1beta1/organization_settings.proto | 72 + .../v1beta1/security_marks.proto | 44 + .../v1beta1/securitycenter_service.proto | 755 +++++ .../cloud/securitycenter/v1beta1/source.proto | 52 + .../google-cloud-securitycenter/src/index.js | 79 + .../cloud/securitycenter/v1beta1/doc_asset.js | 99 + .../securitycenter/v1beta1/doc_finding.js | 114 + .../v1beta1/doc_organization_settings.js | 97 + .../v1beta1/doc_security_marks.js | 45 + .../v1beta1/doc_securitycenter_service.js | 824 ++++++ .../securitycenter/v1beta1/doc_source.js | 53 + .../doc/google/iam/v1/doc_iam_policy.js | 93 + .../v1beta1/doc/google/iam/v1/doc_policy.js | 162 ++ .../doc/google/longrunning/doc_operations.js | 147 + .../v1beta1/doc/google/protobuf/doc_any.js | 136 + .../doc/google/protobuf/doc_duration.js | 97 + .../doc/google/protobuf/doc_field_mask.js | 236 ++ .../v1beta1/doc/google/protobuf/doc_struct.js | 112 + .../doc/google/protobuf/doc_timestamp.js | 115 + .../src/v1beta1/doc/google/rpc/doc_status.js | 92 + .../src/v1beta1/index.js | 19 + .../src/v1beta1/security_center_client.js | 2523 +++++++++++++++++ .../security_center_client_config.json | 116 + packages/google-cloud-securitycenter/synth.py | 41 + .../test/gapic-v1beta1.js | 1284 +++++++++ 37 files changed, 8040 insertions(+) create mode 100644 packages/google-cloud-securitycenter/.circleci/config.yml create mode 100755 packages/google-cloud-securitycenter/.circleci/npm-install-retry.js create mode 100644 packages/google-cloud-securitycenter/.eslintignore create mode 100644 packages/google-cloud-securitycenter/.eslintrc.yml create mode 100644 packages/google-cloud-securitycenter/.gitignore create mode 100644 packages/google-cloud-securitycenter/.jsdoc.js create mode 100644 packages/google-cloud-securitycenter/.nycrc create mode 100644 packages/google-cloud-securitycenter/CODE_OF_CONDUCT.md create mode 100644 packages/google-cloud-securitycenter/codecov.yaml create mode 100644 packages/google-cloud-securitycenter/package.json create mode 100644 packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/asset.proto create mode 100644 packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/finding.proto create mode 100644 packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/organization_settings.proto create mode 100644 packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/security_marks.proto create mode 100644 packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/securitycenter_service.proto create mode 100644 packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/source.proto create mode 100644 packages/google-cloud-securitycenter/src/index.js create mode 100644 packages/google-cloud-securitycenter/src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_asset.js create mode 100644 packages/google-cloud-securitycenter/src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_finding.js create mode 100644 packages/google-cloud-securitycenter/src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_organization_settings.js create mode 100644 packages/google-cloud-securitycenter/src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_security_marks.js create mode 100644 packages/google-cloud-securitycenter/src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_securitycenter_service.js create mode 100644 packages/google-cloud-securitycenter/src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_source.js create mode 100644 packages/google-cloud-securitycenter/src/v1beta1/doc/google/iam/v1/doc_iam_policy.js create mode 100644 packages/google-cloud-securitycenter/src/v1beta1/doc/google/iam/v1/doc_policy.js create mode 100644 packages/google-cloud-securitycenter/src/v1beta1/doc/google/longrunning/doc_operations.js create mode 100644 packages/google-cloud-securitycenter/src/v1beta1/doc/google/protobuf/doc_any.js create mode 100644 packages/google-cloud-securitycenter/src/v1beta1/doc/google/protobuf/doc_duration.js create mode 100644 packages/google-cloud-securitycenter/src/v1beta1/doc/google/protobuf/doc_field_mask.js create mode 100644 packages/google-cloud-securitycenter/src/v1beta1/doc/google/protobuf/doc_struct.js create mode 100644 packages/google-cloud-securitycenter/src/v1beta1/doc/google/protobuf/doc_timestamp.js create mode 100644 packages/google-cloud-securitycenter/src/v1beta1/doc/google/rpc/doc_status.js create mode 100644 packages/google-cloud-securitycenter/src/v1beta1/index.js create mode 100644 packages/google-cloud-securitycenter/src/v1beta1/security_center_client.js create mode 100644 packages/google-cloud-securitycenter/src/v1beta1/security_center_client_config.json create mode 100644 packages/google-cloud-securitycenter/synth.py create mode 100644 packages/google-cloud-securitycenter/test/gapic-v1beta1.js diff --git a/packages/google-cloud-securitycenter/.circleci/config.yml b/packages/google-cloud-securitycenter/.circleci/config.yml new file mode 100644 index 00000000000..6735ebdaaa1 --- /dev/null +++ b/packages/google-cloud-securitycenter/.circleci/config.yml @@ -0,0 +1,179 @@ +version: 2 +workflows: + version: 2 + tests: + jobs: &workflow_jobs + - node6: + filters: &all_commits + tags: + only: /.*/ + - node8: + filters: *all_commits + - node10: + filters: *all_commits + - lint: + requires: + - node6 + - node8 + - node10 + filters: *all_commits + - docs: + requires: + - node6 + - node8 + - node10 + filters: *all_commits + - system_tests: + requires: + - lint + - docs + filters: &master_and_releases + branches: + only: master + tags: &releases + only: '/^v[\d.]+$/' + - sample_tests: + requires: + - lint + - docs + filters: *master_and_releases + - publish_npm: + requires: + - system_tests + - sample_tests + filters: + branches: + ignore: /.*/ + tags: *releases + nightly: + triggers: + - schedule: + cron: 0 7 * * * + filters: + branches: + only: master + jobs: *workflow_jobs +jobs: + node6: + docker: + - image: 'node:6' + user: node + steps: &unit_tests_steps + - checkout + - run: &npm_install_and_link + name: Install and link the module + command: |- + mkdir -p /home/node/.npm-global + ./.circleci/npm-install-retry.js + environment: + NPM_CONFIG_PREFIX: /home/node/.npm-global + - run: npm test + node8: + docker: + - image: 'node:8' + user: node + steps: *unit_tests_steps + node10: + docker: + - image: 'node:10' + user: node + steps: *unit_tests_steps + lint: + docker: + - image: 'node:8' + user: node + steps: + - checkout + - run: *npm_install_and_link + - run: &samples_npm_install_and_link + name: Link the module being tested to the samples. + command: | + cd samples/ + npm link ../ + ./../.circleci/npm-install-retry.js + environment: + NPM_CONFIG_PREFIX: /home/node/.npm-global + - run: + name: Run linting. + command: npm run lint + environment: + NPM_CONFIG_PREFIX: /home/node/.npm-global + docs: + docker: + - image: 'node:8' + user: node + steps: + - checkout + - run: *npm_install_and_link + - run: npm run docs + sample_tests: + docker: + - image: 'node:8' + user: node + steps: + - checkout + - run: + name: Decrypt credentials. + command: | + if ! [[ -z "${SYSTEM_TESTS_ENCRYPTION_KEY}" ]]; then + openssl aes-256-cbc -d -in .circleci/key.json.enc \ + -out .circleci/key.json \ + -k "${SYSTEM_TESTS_ENCRYPTION_KEY}" + fi + - run: *npm_install_and_link + - run: *samples_npm_install_and_link + - run: + name: Run sample tests. + command: npm run samples-test + environment: + GCLOUD_PROJECT: long-door-651 + GOOGLE_APPLICATION_CREDENTIALS: /home/node/samples/.circleci/key.json + NPM_CONFIG_PREFIX: /home/node/.npm-global + - run: + name: Remove unencrypted key. + command: | + if ! [[ -z "${SYSTEM_TESTS_ENCRYPTION_KEY}" ]]; then + rm .circleci/key.json + fi + when: always + working_directory: /home/node/samples/ + system_tests: + docker: + - image: 'node:8' + user: node + steps: + - checkout + - run: + name: Decrypt credentials. + command: | + if ! [[ -z "${SYSTEM_TESTS_ENCRYPTION_KEY}" ]]; then + for encrypted_key in .circleci/*.json.enc; do + openssl aes-256-cbc -d -in $encrypted_key \ + -out $(echo $encrypted_key | sed 's/\.enc//') \ + -k "${SYSTEM_TESTS_ENCRYPTION_KEY}" + done + fi + - run: *npm_install_and_link + - run: + name: Run system tests. + command: npm run system-test + environment: + GCLOUD_PROJECT: long-door-651 + GOOGLE_APPLICATION_CREDENTIALS: /home/node/project/.circleci/key.json + NPM_CONFIG_PREFIX: /home/node/.npm-global + - run: + name: Remove unencrypted key. + command: | + if ! [[ -z "${SYSTEM_TESTS_ENCRYPTION_KEY}" ]]; then + rm .circleci/*.json + fi + when: always + publish_npm: + docker: + - image: 'node:8' + user: node + steps: + - checkout + - run: ./.circleci/npm-install-retry.js + - run: echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc + - run: npm publish --access=public diff --git a/packages/google-cloud-securitycenter/.circleci/npm-install-retry.js b/packages/google-cloud-securitycenter/.circleci/npm-install-retry.js new file mode 100755 index 00000000000..3240aa2cbf2 --- /dev/null +++ b/packages/google-cloud-securitycenter/.circleci/npm-install-retry.js @@ -0,0 +1,60 @@ +#!/usr/bin/env node + +let spawn = require('child_process').spawn; + +// +//USE: ./index.js [... NPM ARGS] +// + +let timeout = process.argv[2] || process.env.NPM_INSTALL_TIMEOUT || 60000; +let attempts = process.argv[3] || 3; +let args = process.argv.slice(4); +if (args.length === 0) { + args = ['install']; +} + +(function npm() { + let timer; + args.push('--verbose'); + let proc = spawn('npm', args); + proc.stdout.pipe(process.stdout); + proc.stderr.pipe(process.stderr); + proc.stdin.end(); + proc.stdout.on('data', () => { + setTimer(); + }); + proc.stderr.on('data', () => { + setTimer(); + }); + + // side effect: this also restarts when npm exits with a bad code even if it + // didnt timeout + proc.on('close', (code, signal) => { + clearTimeout(timer); + if (code || signal) { + console.log('[npm-are-you-sleeping] npm exited with code ' + code + ''); + + if (--attempts) { + console.log('[npm-are-you-sleeping] restarting'); + npm(); + } else { + console.log('[npm-are-you-sleeping] i tried lots of times. giving up.'); + throw new Error("npm install fails"); + } + } + }); + + function setTimer() { + clearTimeout(timer); + timer = setTimeout(() => { + console.log('[npm-are-you-sleeping] killing npm with SIGTERM'); + proc.kill('SIGTERM'); + // wait a couple seconds + timer = setTimeout(() => { + // its it's still not closed sigkill + console.log('[npm-are-you-sleeping] killing npm with SIGKILL'); + proc.kill('SIGKILL'); + }, 2000); + }, timeout); + } +})(); diff --git a/packages/google-cloud-securitycenter/.eslintignore b/packages/google-cloud-securitycenter/.eslintignore new file mode 100644 index 00000000000..f08b0fd1c65 --- /dev/null +++ b/packages/google-cloud-securitycenter/.eslintignore @@ -0,0 +1,4 @@ +node_modules/* +samples/node_modules/* +src/**/doc/* +build/ diff --git a/packages/google-cloud-securitycenter/.eslintrc.yml b/packages/google-cloud-securitycenter/.eslintrc.yml new file mode 100644 index 00000000000..73eeec27612 --- /dev/null +++ b/packages/google-cloud-securitycenter/.eslintrc.yml @@ -0,0 +1,15 @@ +--- +extends: + - 'eslint:recommended' + - 'plugin:node/recommended' + - prettier +plugins: + - node + - prettier +rules: + prettier/prettier: error + block-scoped-var: error + eqeqeq: error + no-warning-comments: warn + no-var: error + prefer-const: error diff --git a/packages/google-cloud-securitycenter/.gitignore b/packages/google-cloud-securitycenter/.gitignore new file mode 100644 index 00000000000..6b002b948bd --- /dev/null +++ b/packages/google-cloud-securitycenter/.gitignore @@ -0,0 +1,10 @@ +**/*.log +**/node_modules +.coverage +.nyc_output +docs/ +out/ +system-test/secrets.js +system-test/*key.json +*.lock +package-lock.json diff --git a/packages/google-cloud-securitycenter/.jsdoc.js b/packages/google-cloud-securitycenter/.jsdoc.js new file mode 100644 index 00000000000..bf57e3f53da --- /dev/null +++ b/packages/google-cloud-securitycenter/.jsdoc.js @@ -0,0 +1,45 @@ +/*! + * Copyright 2018 Google LLC. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.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'; + +module.exports = { + opts: { + readme: './README.md', + package: './package.json', + template: './node_modules/ink-docstrap/template', + recurse: true, + verbose: true, + destination: './docs/' + }, + plugins: [ + 'plugins/markdown' + ], + source: { + excludePattern: '(^|\\/|\\\\)[._]', + include: [ + 'src' + ], + includePattern: '\\.js$' + }, + templates: { + copyright: 'Copyright 2018 Google, LLC.', + includeDate: false, + sourceFiles: false, + systemName: '@google-cloud/security-center', + theme: 'lumen' + } +}; diff --git a/packages/google-cloud-securitycenter/.nycrc b/packages/google-cloud-securitycenter/.nycrc new file mode 100644 index 00000000000..a1a8e6920ce --- /dev/null +++ b/packages/google-cloud-securitycenter/.nycrc @@ -0,0 +1,26 @@ +{ + "report-dir": "./.coverage", + "exclude": [ + "src/*{/*,/**/*}.js", + "src/*/v*/*.js", + "test/**/*.js" + ], + "watermarks": { + "branches": [ + 95, + 100 + ], + "functions": [ + 95, + 100 + ], + "lines": [ + 95, + 100 + ], + "statements": [ + 95, + 100 + ] + } +} diff --git a/packages/google-cloud-securitycenter/CODE_OF_CONDUCT.md b/packages/google-cloud-securitycenter/CODE_OF_CONDUCT.md new file mode 100644 index 00000000000..46b2a08ea6d --- /dev/null +++ b/packages/google-cloud-securitycenter/CODE_OF_CONDUCT.md @@ -0,0 +1,43 @@ +# Contributor Code of Conduct + +As contributors and maintainers of this project, +and in the interest of fostering an open and welcoming community, +we pledge to respect all people who contribute through reporting issues, +posting feature requests, updating documentation, +submitting pull requests or patches, and other activities. + +We are committed to making participation in this project +a harassment-free experience for everyone, +regardless of level of experience, gender, gender identity and expression, +sexual orientation, disability, personal appearance, +body size, race, ethnicity, age, religion, or nationality. + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery +* Personal attacks +* Trolling or insulting/derogatory comments +* Public or private harassment +* Publishing other's private information, +such as physical or electronic +addresses, without explicit permission +* Other unethical or unprofessional conduct. + +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. +By adopting this Code of Conduct, +project maintainers commit themselves to fairly and consistently +applying these principles to every aspect of managing this project. +Project maintainers who do not follow or enforce the Code of Conduct +may be permanently removed from the project team. + +This code of conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. + +Instances of abusive, harassing, or otherwise unacceptable behavior +may be reported by opening an issue +or contacting one or more of the project maintainers. + +This Code of Conduct is adapted from the [Contributor Covenant](http://contributor-covenant.org), version 1.2.0, +available at [http://contributor-covenant.org/version/1/2/0/](http://contributor-covenant.org/version/1/2/0/) diff --git a/packages/google-cloud-securitycenter/codecov.yaml b/packages/google-cloud-securitycenter/codecov.yaml new file mode 100644 index 00000000000..5724ea9478d --- /dev/null +++ b/packages/google-cloud-securitycenter/codecov.yaml @@ -0,0 +1,4 @@ +--- +codecov: + ci: + - source.cloud.google.com diff --git a/packages/google-cloud-securitycenter/package.json b/packages/google-cloud-securitycenter/package.json new file mode 100644 index 00000000000..5e6ade3a013 --- /dev/null +++ b/packages/google-cloud-securitycenter/package.json @@ -0,0 +1,66 @@ +{ + "name": "@google-cloud/security-center", + "description": "Cloud Security Command Center API client for Node.js", + "version": "0.1.0", + "license": "Apache-2.0", + "author": "Google LLC", + "engines": { + "node": ">=6.0.0" + }, + "repository": "googleapis/nodejs-security-center", + "main": "src/index.js", + "files": [ + "protos", + "src", + "AUTHORS", + "COPYING" + ], + "keywords": [ + "google apis client", + "google api client", + "google apis", + "google api", + "google", + "google cloud platform", + "google cloud", + "cloud", + "google security center", + "Security Center", + "Security Command Center API" + ], + "contributors": [ + "Jonathan Lui " + ], + "scripts": { + "cover": "nyc --reporter=lcov mocha test/*.js && nyc report", + "docs": "jsdoc -c .jsdoc.js", + "generate-scaffolding": "repo-tools generate all && repo-tools generate lib_samples_readme -l samples/ --config ../.cloud-repo-tools.json", + "lint": "eslint src/ samples/ system-test/ test/", + "prettier": "prettier --write src/*.js src/*/*.js samples/*.js samples/*/*.js test/*.js test/*/*.js system-test/*.js system-test/*/*.js", + "samples-test": "cd samples/ && npm link ../ && npm test && cd ../", + "system-test": "mocha system-test/*.js --timeout 600000", + "test-no-cover": "mocha test/*.js", + "test": "npm run cover", + "fix": "eslint --fix '**/*.js' && npm run prettier" + }, + "dependencies": { + "google-gax": "^0.20.0", + "lodash.merge": "^4.6.0", + "protobufjs": "^6.8.0" + }, + "devDependencies": { + "@google-cloud/nodejs-repo-tools": "^2.3.5", + "codecov": "^3.0.0", + "eslint": "^5.0.0", + "eslint-config-prettier": "^3.0.0", + "eslint-plugin-node": "^8.0.0", + "eslint-plugin-prettier": "^3.0.0", + "ink-docstrap": "^1.3.0", + "intelli-espower-loader": "^1.0.1", + "jsdoc": "^3.5.5", + "mocha": "^5.0.0", + "nyc": "^13.0.0", + "power-assert": "^1.4.4", + "prettier": "^1.7.4" + } +} diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/asset.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/asset.proto new file mode 100644 index 00000000000..87e16aa55fc --- /dev/null +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/asset.proto @@ -0,0 +1,85 @@ +// Copyright 2018 Google LLC. +// +// Licensed under the Apache License, Version 2.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.cloud.securitycenter.v1beta1; + +import "google/api/annotations.proto"; +import "google/cloud/securitycenter/v1beta1/security_marks.proto"; +import "google/protobuf/struct.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1beta1;securitycenter"; +option java_package = "com.google.cloud.securitycenter.v1beta1"; + +// Security Center's representation of a Google Cloud Platform resource. +// +// The Asset is a resource of Security Center that is meant to capture +// information regarding a single Google Cloud Platform resource. All +// modifications to an Asset are only within the context of Security Center and +// do not effect the referenced Google Cloud Platform resource. +message Asset { + // Security Center managed properties. These properties are managed by + // Security Center and cannot be modified by the user. + message SecurityCenterProperties { + // The full resource name of the Google Cloud Platform resource this asset + // represents. This field is immutable after create time. See: + // https://cloud.google.com/apis/design/resource_names#full_resource_name + string resource_name = 1; + + // The type of the Google Cloud resource. Examples include: APPLICATION, + // PROJECT, and ORGANIZATION. This is a case insensitive field defined by + // Security Center and/or the producer of the resource and is immutable + // after create time. + string resource_type = 2; + + // The full resource name of the immediate parent of the resource. See: + // https://cloud.google.com/apis/design/resource_names#full_resource_name + string resource_parent = 3; + + // The full resource name of the project the resource belongs to. See: + // https://cloud.google.com/apis/design/resource_names#full_resource_name + string resource_project = 4; + + // Owners of the Google Cloud resource. + repeated string resource_owners = 5; + } + + // The relative resource name of this asset. See: + // https://cloud.google.com/apis/design/resource_names#relative_resource_name + // Example: + // "organizations/123/assets/456". + string name = 1; + + // Security Center managed properties. These properties are managed by + // Security Center and cannot be modified by the user. + SecurityCenterProperties security_center_properties = 2; + + // Resource managed properties. These properties are managed and defined by + // the Google Cloud Platform resource and cannot be modified by the user. + map resource_properties = 7; + + // User specified security marks. These marks are entirely managed by the user + // and come from the SecurityMarks resource belonging to the asset. + SecurityMarks security_marks = 8; + + // The time at which the asset was created in Security Center. + google.protobuf.Timestamp create_time = 9; + + // The time at which the asset was last updated, added, or deleted in Security + // Center. + google.protobuf.Timestamp update_time = 10; +} diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/finding.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/finding.proto new file mode 100644 index 00000000000..7d9016e0f81 --- /dev/null +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/finding.proto @@ -0,0 +1,96 @@ +// Copyright 2018 Google LLC. +// +// Licensed under the Apache License, Version 2.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.cloud.securitycenter.v1beta1; + +import "google/api/annotations.proto"; +import "google/cloud/securitycenter/v1beta1/security_marks.proto"; +import "google/protobuf/struct.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1beta1;securitycenter"; +option java_package = "com.google.cloud.securitycenter.v1beta1"; + +// Security Center's finding. +// +// A finding is a record of assessment data (security, risk, health or privacy) +// ingested into Security Center for presentation, notification, analysis, +// policy testing and enforcement. For example, an XSS vulnerability in an +// AppEngine application is a finding. +message Finding { + // The state of the finding. + enum State { + // Unspecified state. + STATE_UNSPECIFIED = 0; + + // The finding requires attention and has not been addressed yet. + ACTIVE = 1; + + // The finding has been fixed, triaged as a non-issue or otherwise addressed + // and is no longer active. + INACTIVE = 2; + } + + // The relative resource name of this finding. See: + // https://cloud.google.com/apis/design/resource_names#relative_resource_name + // Example: + // "organizations/123/sources/456/findings/789" + string name = 1; + + // The relative resource name of the source the finding belongs to. See: + // https://cloud.google.com/apis/design/resource_names#relative_resource_name + // This field is immutable after creation time. + // For example: + // "organizations/123/sources/456" + string parent = 2; + + // The full resource name of the Google Cloud Platform resource this finding + // is for. See: + // https://cloud.google.com/apis/design/resource_names#full_resource_name + // This field is immutable after creation time. + string resource_name = 3; + + // The state of the finding. + State state = 4; + + // The additional taxonomy group within findings from a give source. + // This field is immutable after creation time. + // Example: "XSS_FLASH_INJECTION" + string category = 5; + + // The URI that, if available, points to a web page outside of Security Center + // where additional information about the finding can be found. This field is + // guaranteed to be either empty or a well formed url. + string external_uri = 6; + + // Source specific properties. These properties are managed by the source + // writing the finding. + map source_properties = 7; + + // Output only. User specified security marks. These marks are entirely + // managed by the user and come from the SecurityMarks resource belonging to + // the finding. + SecurityMarks security_marks = 8; + + // The time at which the event took place. For example, if the finding + // represents an open firewall it would capture the time the open firewall was + // detected. + google.protobuf.Timestamp event_time = 9; + + // The time at which the finding was created in Security Center. + google.protobuf.Timestamp create_time = 10; +} diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/organization_settings.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/organization_settings.proto new file mode 100644 index 00000000000..80fafe5b5b2 --- /dev/null +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/organization_settings.proto @@ -0,0 +1,72 @@ +// Copyright 2018 Google LLC. +// +// Licensed under the Apache License, Version 2.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.cloud.securitycenter.v1beta1; + +import "google/api/annotations.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1beta1;securitycenter"; +option java_package = "com.google.cloud.securitycenter.v1beta1"; + +// User specified settings that are attached to the Security Center +// organization. +message OrganizationSettings { + // The configuration used for Asset Discovery runs. + message AssetDiscoveryConfig { + // The mode of inclusion when running Asset Discovery. + // Asset discovery can be limited by explicitly identifying projects to be + // included or excluded. If INCLUDE_ONLY is set then only those projects + // (within the organization) and their children are discovered during asset + // discovery. If EXCLUDE is set then projects not matching those projects + // are discovered during asset discovery. If neither are set then all + // projects within the organization are discovered during asset discovery. + enum InclusionMode { + // Unspecified. Setting the mode with this value will disable + // inclusion/exclusion filtering for Asset Discovery. + INCLUSION_MODE_UNSPECIFIED = 0; + + // Asset Discovery will capture only the resources within the projects + // specified. All other resources will be ignored. + INCLUDE_ONLY = 1; + + // Asset Discovery will ignore all resources under the projects specified. + // All other resources will be retrieved. + EXCLUDE = 2; + } + + // The project ids to use for filtering asset discovery. + repeated string project_ids = 1; + + // The mode to use for filtering asset discovery. + InclusionMode inclusion_mode = 2; + } + + // The relative resource name of the settings. See: + // https://cloud.google.com/apis/design/resource_names#relative_resource_name + // Example: + // "organizations/123/organizationSettings". + string name = 1; + + // A flag indicating whether Asset Discovery should be enabled. If the flag is + // set to true then discovery of assets will occur. If it is set to false all + // historical assets will remain but discovery of future assets will not + // occur. + bool enable_asset_discovery = 2; + + // The configuration used for Asset Discovery runs. + AssetDiscoveryConfig asset_discovery_config = 3; +} diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/security_marks.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/security_marks.proto new file mode 100644 index 00000000000..1d011dc2d67 --- /dev/null +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/security_marks.proto @@ -0,0 +1,44 @@ +// Copyright 2018 Google LLC. +// +// Licensed under the Apache License, Version 2.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.cloud.securitycenter.v1beta1; + +import "google/api/annotations.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1beta1;securitycenter"; +option java_package = "com.google.cloud.securitycenter.v1beta1"; + +// User specified security marks that are attached to the parent Security Center +// resource. Security marks are scoped within a Security Center organization -- +// they are modifiable and viewable by all with proper permissions on the +// organization. +message SecurityMarks { + // The relative resource name of the SecurityMarks. See: + // https://cloud.google.com/apis/design/resource_names#relative_resource_name + // Examples: + // "organizations/123/assets/456/securityMarks" + // "organizations/123/sources/456/findings/789/securityMarks". + string name = 1; + + // Mutable user specified security marks belonging to the parent resource. + // Constraints are as follows: + // - Keys and values are treated as case insensitive + // - Keys must be alphanumeric and between 1 - 256 characters (inclusive) + // - Values have leading and trailing whitespace trimmed, remaining + // characters must be between 1 - 4096 characters (inclusive) + map marks = 2; +} diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/securitycenter_service.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/securitycenter_service.proto new file mode 100644 index 00000000000..dd710207b0f --- /dev/null +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/securitycenter_service.proto @@ -0,0 +1,755 @@ +// Copyright 2018 Google LLC. +// +// Licensed under the Apache License, Version 2.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.cloud.securitycenter.v1beta1; + +import "google/api/annotations.proto"; +import "google/cloud/securitycenter/v1beta1/asset.proto"; +import "google/cloud/securitycenter/v1beta1/finding.proto"; +import "google/cloud/securitycenter/v1beta1/organization_settings.proto"; +import "google/cloud/securitycenter/v1beta1/security_marks.proto"; +import "google/cloud/securitycenter/v1beta1/source.proto"; +import "google/iam/v1/iam_policy.proto"; +import "google/iam/v1/policy.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/struct.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1beta1;securitycenter"; +option java_package = "com.google.cloud.securitycenter.v1beta1"; + +// V1 Beta APIs for Security Center service. +service SecurityCenter { + // Creates a source. + rpc CreateSource(CreateSourceRequest) returns (Source) { + option (google.api.http) = { + post: "/v1beta1/{parent=organizations/*}/sources" + body: "source" + }; + } + + // Creates a finding. The corresponding source must exist for finding creation + // to succeed. + rpc CreateFinding(CreateFindingRequest) returns (Finding) { + option (google.api.http) = { + post: "/v1beta1/{parent=organizations/*/sources/*}/findings" + body: "finding" + }; + } + + // Gets the access control policy on the specified Source. + rpc GetIamPolicy(google.iam.v1.GetIamPolicyRequest) + returns (google.iam.v1.Policy) { + option (google.api.http) = { + post: "/v1beta1/{resource=organizations/*/sources/*}:getIamPolicy" + body: "*" + }; + } + + // Gets the settings for an organization. + rpc GetOrganizationSettings(GetOrganizationSettingsRequest) + returns (OrganizationSettings) { + option (google.api.http) = { + get: "/v1beta1/{name=organizations/*/organizationSettings}" + }; + } + + // Gets a source. + rpc GetSource(GetSourceRequest) returns (Source) { + option (google.api.http) = { + get: "/v1beta1/{name=organizations/*/sources/*}" + }; + } + + // Filters an organization's assets and groups them by their specified + // properties. + rpc GroupAssets(GroupAssetsRequest) returns (GroupAssetsResponse) { + option (google.api.http) = { + post: "/v1beta1/{parent=organizations/*}/assets:group" + body: "*" + }; + } + + // Filters an organization or source's findings and groups them by their + // specified properties. + // + // To group across all sources provide a `-` as the source id. + // Example: /v1beta1/organizations/123/sources/-/findings + rpc GroupFindings(GroupFindingsRequest) returns (GroupFindingsResponse) { + option (google.api.http) = { + post: "/v1beta1/{parent=organizations/*/sources/*}/findings:group" + body: "*" + }; + } + + // Lists an organization's assets. + rpc ListAssets(ListAssetsRequest) returns (ListAssetsResponse) { + option (google.api.http) = { + get: "/v1beta1/{parent=organizations/*}/assets" + }; + } + + // Lists an organization or source's assets. + // + // To list across all sources provide a `-` as the source id. + // Example: /v1beta1/organizations/123/sources/-/findings + rpc ListFindings(ListFindingsRequest) returns (ListFindingsResponse) { + option (google.api.http) = { + get: "/v1beta1/{parent=organizations/*/sources/*}/findings" + }; + } + + // Lists all sources belonging to an organization. + rpc ListSources(ListSourcesRequest) returns (ListSourcesResponse) { + option (google.api.http) = { + get: "/v1beta1/{parent=organizations/*}/sources" + }; + } + + // Runs asset discovery. The discovery is tracked with a long-running + // operation. + // + // This API can only be called with limited frequency for an organization. If + // it is called too frequently the caller will receive a TOO_MANY_REQUESTS + // error. + rpc RunAssetDiscovery(RunAssetDiscoveryRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta1/{parent=organizations/*}/assets:runDiscovery" + body: "*" + }; + } + + // Updates the state of a finding. + rpc SetFindingState(SetFindingStateRequest) returns (Finding) { + option (google.api.http) = { + post: "/v1beta1/{name=organizations/*/sources/*/findings/*}:setState" + body: "*" + }; + } + + // Sets the access control policy on the specified Source. + rpc SetIamPolicy(google.iam.v1.SetIamPolicyRequest) + returns (google.iam.v1.Policy) { + option (google.api.http) = { + post: "/v1beta1/{resource=organizations/*/sources/*}:setIamPolicy" + body: "*" + }; + } + + // Returns the permissions that a caller has on the specified source. + rpc TestIamPermissions(google.iam.v1.TestIamPermissionsRequest) + returns (google.iam.v1.TestIamPermissionsResponse) { + option (google.api.http) = { + post: "/v1beta1/{resource=organizations/*/sources/*}:testIamPermissions" + body: "*" + }; + } + + // Creates or updates a finding. The corresponding source must exist for a + // finding creation to succeed. + rpc UpdateFinding(UpdateFindingRequest) returns (Finding) { + option (google.api.http) = { + patch: "/v1beta1/{finding.name=organizations/*/sources/*/findings/*}" + body: "finding" + }; + } + + // Updates an organization's settings. + rpc UpdateOrganizationSettings(UpdateOrganizationSettingsRequest) + returns (OrganizationSettings) { + option (google.api.http) = { + patch: "/v1beta1/{organization_settings.name=organizations/*/organizationSettings}" + body: "organization_settings" + }; + } + + // Updates a source. + rpc UpdateSource(UpdateSourceRequest) returns (Source) { + option (google.api.http) = { + patch: "/v1beta1/{source.name=organizations/*/sources/*}" + body: "source" + }; + } + + // Updates security marks. + rpc UpdateSecurityMarks(UpdateSecurityMarksRequest) returns (SecurityMarks) { + option (google.api.http) = { + patch: "/v1beta1/{security_marks.name=organizations/*/assets/*/securityMarks}" + body: "security_marks" + additional_bindings { + patch: "/v1beta1/{security_marks.name=organizations/*/sources/*/findings/*/securityMarks}" + body: "security_marks" + } + }; + } +} + +// Request message for creating a finding. +message CreateFindingRequest { + // Resource name of the new finding's parent. Its format should be + // "organizations/[organization_id]/sources/[source_id]". + string parent = 1; + + // Unique identifier provided by the client within the parent scope. + // It must be alphanumeric and less than or equal to 32 characters and + // greater than 0 characters in length. + string finding_id = 2; + + // The Finding being created. The name and security_marks will be ignored as + // they are both output only fields on this resource. + Finding finding = 3; +} + +// Request message for creating a source. +message CreateSourceRequest { + // Resource name of the new source's parent. Its format should be + // "organizations/[organization_id]". + string parent = 1; + + // The Source being created, only the display_name and description will be + // used. All other fields will be ignored. + Source source = 2; +} + +// Request message for getting organization settings. +message GetOrganizationSettingsRequest { + // Name of the organization to get organization settings for. Its format is + // "organizations/[organization_id]/organizationSettings". + string name = 1; +} + +// Request message for getting a source. +message GetSourceRequest { + // Relative resource name of the source. Its format is + // "organizations/[organization_id]/source/[source_id]". + string name = 1; +} + +// Request message for grouping by assets. +message GroupAssetsRequest { + // Name of the organization to groupBy. Its format is + // "organizations/[organization_id]". + string parent = 1; + + // Expression that defines the filter to apply across assets. + // The expression is a list of zero or more restrictions combined via logical + // operators `AND` and `OR`. + // Parentheses are not supported, and `OR` has higher precedence than `AND`. + // + // Restrictions have the form ` ` and may have a `-` + // character in front of them to indicate negation. The fields map to those + // defined in the Asset resource. Examples include: + // + // * name + // * security_center_properties.resource_name + // * resource_properties.a_property + // * security_marks.marks.marka + // + // The supported operators are: + // + // * `=` for all value types. + // * `>`, `<`, `>=`, `<=` for integer values. + // * `:`, meaning substring matching, for strings. + // + // The supported value types are: + // + // * string literals in quotes. + // * integer literals without quotes. + // * boolean literals `true` and `false` without quotes. + // + // For example, `resource_properties.size = 100` is a valid filter string. + string filter = 2; + + // Expression that defines what assets fields to use for grouping. The string + // value should follow SQL syntax: comma separated list of fields. For + // example: + // "security_center_properties.resource_project,security_center_properties.project". + // + // The following fields are supported when compare_duration is not set: + // + // * security_center_properties.resource_name + // * security_center_properties.resource_project + // * security_center_properties.resource_type + // * security_center_properties.resource_parent + // + // The following fields are supported when compare_duration is set: + // + // * security_center_properties.resource_type + string group_by = 3; + + // When compare_duration is set, the Asset's "state" property is updated to + // indicate whether the asset was added, removed, or remained present during + // the compare_duration period of time that precedes the read_time. This is + // the time between (read_time - compare_duration) and read_time. + // + // The state value is derived based on the presence of the asset at the two + // points in time. Intermediate state changes between the two times don't + // affect the result. For example, the results aren't affected if the asset is + // removed and re-created again. + // + // Possible "state" values when compare_duration is specified: + // + // * "ADDED": indicates that the asset was not present before + // compare_duration, but present at reference_time. + // * "REMOVED": indicates that the asset was present at the start of + // compare_duration, but not present at reference_time. + // * "ACTIVE_AT_BOTH": indicates that the asset was present at both the + // start and the end of the time period defined by + // compare_duration and reference_time. + // + // This field is ignored if `state` is not a field in `group_by`. + google.protobuf.Duration compare_duration = 4; + + // Time used as a reference point when filtering assets. The filter is limited + // to assets existing at the supplied time and their values are those at that + // specific time. Absence of this field will default to the API's version of + // NOW. + google.protobuf.Timestamp read_time = 5; + + // The value returned by the last `GroupAssetsResponse`; indicates + // that this is a continuation of a prior `GroupAssets` call, and that the + // system should return the next page of data. + string page_token = 7; + + // The maximum number of results to return in a single response. Default is + // 10, minimum is 1, maximum is 1000. + int32 page_size = 8; +} + +// Response message for grouping by assets. +message GroupAssetsResponse { + // Group results. There exists an element for each existing unique + // combination of property/values. The element contains a count for the number + // of times those specific property/values appear. + repeated GroupResult group_by_results = 1; + + // Time used for executing the groupBy request. + google.protobuf.Timestamp read_time = 2; + + // Token to retrieve the next page of results, or empty if there are no more + // results. + string next_page_token = 3; +} + +// Request message for grouping by findings. +message GroupFindingsRequest { + // Name of the source to groupBy. Its format is + // "organizations/[organization_id]/sources/[source_id]". To groupBy across + // all sources provide a source_id of `-`. For example: + // organizations/123/sources/- + string parent = 1; + + // Expression that defines the filter to apply across findings. + // The expression is a list of one or more restrictions combined via logical + // operators `AND` and `OR`. + // Parentheses are not supported, and `OR` has higher precedence than `AND`. + // + // Restrictions have the form ` ` and may have a `-` + // character in front of them to indicate negation. Examples include: + // + // * name + // * source_properties.a_property + // * security_marks.marks.marka + // + // The supported operators are: + // + // * `=` for all value types. + // * `>`, `<`, `>=`, `<=` for integer values. + // * `:`, meaning substring matching, for strings. + // + // The supported value types are: + // + // * string literals in quotes. + // * integer literals without quotes. + // * boolean literals `true` and `false` without quotes. + // + // For example, `source_properties.size = 100` is a valid filter string. + string filter = 2; + + // Expression that defines what assets fields to use for grouping (including + // `state`). The string value should follow SQL syntax: comma separated list + // of fields. For example: + // "parent,resource_name". + // + // The following fields are supported: + // + // * resource_name + // * category + // * state + // * parent + string group_by = 3; + + // Time used as a reference point when filtering findings. The filter is + // limited to findings existing at the supplied time and their values are + // those at that specific time. Absence of this field will default to the + // API's version of NOW. + google.protobuf.Timestamp read_time = 4; + + // The value returned by the last `GroupFindingsResponse`; indicates + // that this is a continuation of a prior `GroupFindings` call, and + // that the system should return the next page of data. + string page_token = 5; + + // The maximum number of results to return in a single response. Default is + // 10, minimum is 1, maximum is 1000. + int32 page_size = 6; +} + +// Response message for group by findings. +message GroupFindingsResponse { + // Group results. There exists an element for each existing unique + // combination of property/values. The element contains a count for the number + // of times those specific property/values appear. + repeated GroupResult group_by_results = 1; + + // Time used for executing the groupBy request. + google.protobuf.Timestamp read_time = 2; + + // Token to retrieve the next page of results, or empty if there are no more + // results. + string next_page_token = 3; +} + +// Result containing the properties and count of a groupBy request. +message GroupResult { + // Properties matching the groupBy fields in the request. + map properties = 1; + + // Total count of resources for the given properties. + int64 count = 2; +} + +// Request message for listing sources. +message ListSourcesRequest { + // Resource name of the parent of sources to list. Its format should be + // "organizations/[organization_id]". + string parent = 1; + + // The value returned by the last `ListSourcesResponse`; indicates + // that this is a continuation of a prior `ListSources` call, and + // that the system should return the next page of data. + string page_token = 2; + + // The maximum number of results to return in a single response. Default is + // 10, minimum is 1, maximum is 1000. + int32 page_size = 7; +} + +// Response message for listing sources. +message ListSourcesResponse { + // Sources belonging to the requested parent. + repeated Source sources = 1; + + // Token to retrieve the next page of results, or empty if there are no more + // results. + string next_page_token = 2; +} + +// Request message for listing assets. +message ListAssetsRequest { + // Name of the organization assets should belong to. Its format is + // "organizations/[organization_id]". + string parent = 1; + + // Expression that defines the filter to apply across assets. + // The expression is a list of zero or more restrictions combined via logical + // operators `AND` and `OR`. + // Parentheses are not supported, and `OR` has higher precedence than `AND`. + // + // Restrictions have the form ` ` and may have a `-` + // character in front of them to indicate negation. The fields map to those + // defined in the Asset resource. Examples include: + // + // * name + // * security_center_properties.resource_name + // * resource_properties.a_property + // * security_marks.marks.marka + // + // The supported operators are: + // + // * `=` for all value types. + // * `>`, `<`, `>=`, `<=` for integer values. + // * `:`, meaning substring matching, for strings. + // + // The supported value types are: + // + // * string literals in quotes. + // * integer literals without quotes. + // * boolean literals `true` and `false` without quotes. + // + // For example, `resource_properties.size = 100` is a valid filter string. + string filter = 2; + + // Expression that defines what fields and order to use for sorting. The + // string value should follow SQL syntax: comma separated list of fields. For + // example: "name,resource_properties.a_property". The default sorting order + // is ascending. To specify descending order for a field, a suffix " desc" + // should be appended to the field name. For example: "name + // desc,resource_properties.a_property". Redundant space characters in the + // syntax are insignificant. "name desc,resource_properties.a_property" and " + // name desc , resource_properties.a_property " are equivalent. + string order_by = 3; + + // Time used as a reference point when filtering assets. The filter is limited + // to assets existing at the supplied time and their values are those at that + // specific time. Absence of this field will default to the API's version of + // NOW. + google.protobuf.Timestamp read_time = 4; + + // When compare_duration is set, the ListAssetResult's "state" attribute is + // updated to indicate whether the asset was added, removed, or remained + // present during the compare_duration period of time that precedes the + // read_time. This is the time between (read_time - + // compare_duration) and read_time. + // + // The state value is derived based on the presence of the asset at the two + // points in time. Intermediate state changes between the two times don't + // affect the result. For example, the results aren't affected if the asset is + // removed and re-created again. + // + // Possible "state" values when compare_duration is specified: + // + // * "ADDED": indicates that the asset was not present before + // compare_duration, but present at read_time. + // * "REMOVED": indicates that the asset was present at the start of + // compare_duration, but not present at read_time. + // * "ACTIVE": indicates that the asset was present at both the + // start and the end of the time period defined by + // compare_duration and read_time. + // + // If compare_duration is not specified, then the only possible state is + // "UNUSED", which indicates that the asset is present at read_time. + google.protobuf.Duration compare_duration = 5; + + // Optional. + // + // A field mask to specify the ListAssetsResult fields to be listed in the + // response. + // An empty field mask will list all fields. + google.protobuf.FieldMask field_mask = 7; + + // The value returned by the last `ListAssetsResponse`; indicates + // that this is a continuation of a prior `ListAssets` call, and + // that the system should return the next page of data. + string page_token = 8; + + // The maximum number of results to return in a single response. Default is + // 10, minimum is 1, maximum is 1000. + int32 page_size = 9; +} + +// Response message for listing assets. +message ListAssetsResponse { + // Result containing the Asset and its State. + message ListAssetsResult { + // State of the asset. + // + // When querying across two points in time this describes + // the change between the two points: ADDED, REMOVED, or ACTIVE. + // If there was no compare_duration supplied in the request the state should + // be: UNUSED + enum State { + // Unspecified state. + STATE_UNSPECIFIED = 0; + + // Request did not specify use of this field in the result. + UNUSED = 1; + + // Asset was added between the points in time. + ADDED = 2; + + // Asset was removed between the points in time. + REMOVED = 3; + + // Asset was active at both point(s) in time. + ACTIVE = 4; + } + + // Asset matching the search request. + Asset asset = 1; + + // State of the asset. + State state = 2; + } + + // Assets matching the list request. + repeated ListAssetsResult list_assets_results = 1; + + // Time used for executing the list request. + google.protobuf.Timestamp read_time = 2; + + // Token to retrieve the next page of results, or empty if there are no more + // results. + string next_page_token = 3; + + // The total number of assets matching the query. + int32 total_size = 4; +} + +// Request message for listing findings. +message ListFindingsRequest { + // Name of the source the findings belong to. Its format is + // "organizations/[organization_id]/sources/[source_id]". To list across all + // sources provide a source_id of `-`. For example: + // organizations/123/sources/- + string parent = 1; + + // Expression that defines the filter to apply across findings. + // The expression is a list of one or more restrictions combined via logical + // operators `AND` and `OR`. + // Parentheses are not supported, and `OR` has higher precedence than `AND`. + // + // Restrictions have the form ` ` and may have a `-` + // character in front of them to indicate negation. Examples include: + // + // * name + // * source_properties.a_property + // * security_marks.marks.marka + // + // The supported operators are: + // + // * `=` for all value types. + // * `>`, `<`, `>=`, `<=` for integer values. + // * `:`, meaning substring matching, for strings. + // + // The supported value types are: + // + // * string literals in quotes. + // * integer literals without quotes. + // * boolean literals `true` and `false` without quotes. + // + // For example, `source_properties.size = 100` is a valid filter string. + string filter = 2; + + // Expression that defines what fields and order to use for sorting. The + // string value should follow SQL syntax: comma separated list of fields. For + // example: "name,resource_properties.a_property". The default sorting order + // is ascending. To specify descending order for a field, a suffix " desc" + // should be appended to the field name. For example: "name + // desc,source_properties.a_property". Redundant space characters in the + // syntax are insignificant. "name desc,source_properties.a_property" and " + // name desc , source_properties.a_property " are equivalent. + string order_by = 3; + + // Time used as a reference point when filtering findings. The filter is + // limited to findings existing at the supplied time and their values are + // those at that specific time. Absence of this field will default to the + // API's version of NOW. + google.protobuf.Timestamp read_time = 4; + + // Optional. + // + // A field mask to specify the Finding fields to be listed in the response. + // An empty field mask will list all fields. + google.protobuf.FieldMask field_mask = 5; + + // The value returned by the last `ListFindingsResponse`; indicates + // that this is a continuation of a prior `ListFindings` call, and + // that the system should return the next page of data. + string page_token = 6; + + // The maximum number of results to return in a single response. Default is + // 10, minimum is 1, maximum is 1000. + int32 page_size = 7; +} + +// Response message for listing findings. +message ListFindingsResponse { + // Findings matching the list request. + repeated Finding findings = 1; + + // Time used for executing the list request. + google.protobuf.Timestamp read_time = 2; + + // Token to retrieve the next page of results, or empty if there are no more + // results. + string next_page_token = 3; + + // The total number of findings matching the query. + int32 total_size = 4; +} + +// Request message for updating a finding's state. +message SetFindingStateRequest { + // The relative resource name of the finding. See: + // https://cloud.google.com/apis/design/resource_names#relative_resource_name + // Example: + // "organizations/123/sources/456/finding/789". + string name = 1; + + // The desired State of the finding. + Finding.State state = 2; + + // The time at which the updated state takes effect. + google.protobuf.Timestamp start_time = 3; +} + +// Request message for running asset discovery for an organization. +message RunAssetDiscoveryRequest { + // Name of the organization to run asset discovery for. Its format is + // "organizations/[organization_id]". + string parent = 1; +} + +// Request message for updating or creating a finding. +message UpdateFindingRequest { + // The finding resource to update or create if it does not already exist. + // parent, security_marks, and update_time will be ignored. + // + // In the case of creation, the finding id portion of the name must + // alphanumeric and less than or equal to 32 characters and greater than 0 + // characters in length. + Finding finding = 1; + + // The FieldMask to use when updating the finding resource. This field is + // ignored if the finding does not already exist and the finding is created. + google.protobuf.FieldMask update_mask = 2; +} + +// Request message for updating an organization's settings. +message UpdateOrganizationSettingsRequest { + // The organization settings resource to update. + OrganizationSettings organization_settings = 1; + + // The FieldMask to use when updating the settings resource. + google.protobuf.FieldMask update_mask = 2; +} + +// Request message for updating a source. +message UpdateSourceRequest { + // The source resource to update. + Source source = 1; + + // The FieldMask to use when updating the source resource. + google.protobuf.FieldMask update_mask = 2; +} + +// Request message for updating a SecurityMarks resource. +message UpdateSecurityMarksRequest { + // The security marks resource to update. + SecurityMarks security_marks = 1; + + // The FieldMask to use when updating the security marks resource. + google.protobuf.FieldMask update_mask = 2; + + // The time at which the updated SecurityMarks take effect. + google.protobuf.Timestamp start_time = 3; +} diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/source.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/source.proto new file mode 100644 index 00000000000..c732ff08cb2 --- /dev/null +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/source.proto @@ -0,0 +1,52 @@ +// Copyright 2018 Google LLC. +// +// Licensed under the Apache License, Version 2.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.cloud.securitycenter.v1beta1; + +import "google/api/annotations.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1beta1;securitycenter"; +option java_package = "com.google.cloud.securitycenter.v1beta1"; + +// Security Center's finding source. A finding source is an entity or a +// mechanism that can produce a finding. A source can also be thought of as a +// container of findings that come from the same scanner, logger, monitor, etc. +message Source { + // The relative resource name of this source. See: + // https://cloud.google.com/apis/design/resource_names#relative_resource_name + // Example: + // "organizations/123/sources/456" + string name = 1; + + // The source’s display name. + // A source’s display name must be unique amongst its siblings, e.g. + // no two sources with the same parent can share the same display name. + // The display name must start and end with a letter or digit, may contain + // letters, digits, spaces, hyphens and underscores and can be no longer + // than 30 characters. This is captured by the regular expression: + // [\p{L}\p{N}]({\p{L}\p{N}_- ]{0,28}[\p{L}\p{N}])?. + string display_name = 2; + + // The description of the source (max of 1024 characters). + // Example: + // "Cloud Security Scanner is a web security scanner for common + // vulnerabilities in Google App Engine applications. It can automatically + // scan and detect four common vulnerabilities, including cross-site-scripting + // (XSS), Flash injection, mixed content (HTTP in HTTPS), and + // outdated/insecure libraries." + string description = 3; +} diff --git a/packages/google-cloud-securitycenter/src/index.js b/packages/google-cloud-securitycenter/src/index.js new file mode 100644 index 00000000000..d921fe2c193 --- /dev/null +++ b/packages/google-cloud-securitycenter/src/index.js @@ -0,0 +1,79 @@ +// Copyright 2018 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/** + * @namespace google + */ +/** + * @namespace google.cloud + */ +/** + * @namespace google.cloud.securitycenter + */ +/** + * @namespace google.cloud.securitycenter.v1beta1 + */ + +"use strict"; + +// Import the clients for each version supported by this package. +const gapic = Object.freeze({ + v1beta1: require("./v1beta1") +}); + +/** + * The `securitycenter` package has the following named exports: + * + * - `SecurityCenterClient` - Reference to + * {@link v1beta1.SecurityCenterClient} + * - `v1beta1` - This is used for selecting or pinning a + * particular backend service version. It exports: + * - `SecurityCenterClient` - Reference to + * {@link v1beta1.SecurityCenterClient} + * + * @module {object} securitycenter + * @alias nodejs-securitycenter + * + * @example Install the client library with npm: + * npm install --save securitycenter + * + * @example Import the client library: + * const securitycenter = require('securitycenter'); + * + * @example Create a client that uses Application Default Credentials (ADC): + * const client = new securitycenter.SecurityCenterClient(); + * + * @example Create a client with explicit credentials: + * const client = new securitycenter.SecurityCenterClient({ + * projectId: 'your-project-id', + * keyFilename: '/path/to/keyfile.json', + * }); + */ + +/** + * @type {object} + * @property {constructor} SecurityCenterClient + * Reference to {@link v1beta1.SecurityCenterClient} + */ +module.exports = gapic.v1beta1; + +/** + * @type {object} + * @property {constructor} SecurityCenterClient + * Reference to {@link v1beta1.SecurityCenterClient} + */ +module.exports.v1beta1 = gapic.v1beta1; + +// Alias `module.exports` as `module.exports.default`, for future-proofing. +module.exports.default = Object.assign({}, module.exports); diff --git a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_asset.js b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_asset.js new file mode 100644 index 00000000000..df79bb7a501 --- /dev/null +++ b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_asset.js @@ -0,0 +1,99 @@ +// Copyright 2018 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Note: this file is purely for documentation. Any contents are not expected +// to be loaded as the JS file. + +/** + * Security Center's representation of a Google Cloud Platform resource. + * + * The Asset is a resource of Security Center that is meant to capture + * information regarding a single Google Cloud Platform resource. All + * modifications to an Asset are only within the context of Security Center and + * do not effect the referenced Google Cloud Platform resource. + * + * @property {string} name + * The relative resource name of this asset. See: + * https://cloud.google.com/apis/design/resource_names#relative_resource_name + * Example: + * "organizations/123/assets/456". + * + * @property {Object} securityCenterProperties + * Security Center managed properties. These properties are managed by + * Security Center and cannot be modified by the user. + * + * This object should have the same structure as [SecurityCenterProperties]{@link google.cloud.securitycenter.v1beta1.SecurityCenterProperties} + * + * @property {Object.} resourceProperties + * Resource managed properties. These properties are managed and defined by + * the Google Cloud Platform resource and cannot be modified by the user. + * + * @property {Object} securityMarks + * User specified security marks. These marks are entirely managed by the user + * and come from the SecurityMarks resource belonging to the asset. + * + * This object should have the same structure as [SecurityMarks]{@link google.cloud.securitycenter.v1beta1.SecurityMarks} + * + * @property {Object} createTime + * The time at which the asset was created in Security Center. + * + * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} + * + * @property {Object} updateTime + * The time at which the asset was last updated, added, or deleted in Security + * Center. + * + * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} + * + * @typedef Asset + * @memberof google.cloud.securitycenter.v1beta1 + * @see [google.cloud.securitycenter.v1beta1.Asset definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/securitycenter/v1beta1/asset.proto} + */ +const Asset = { + // This is for documentation. Actual contents will be loaded by gRPC. + + /** + * Security Center managed properties. These properties are managed by + * Security Center and cannot be modified by the user. + * + * @property {string} resourceName + * The full resource name of the Google Cloud Platform resource this asset + * represents. This field is immutable after create time. See: + * https://cloud.google.com/apis/design/resource_names#full_resource_name + * + * @property {string} resourceType + * The type of the Google Cloud resource. Examples include: APPLICATION, + * PROJECT, and ORGANIZATION. This is a case insensitive field defined by + * Security Center and/or the producer of the resource and is immutable + * after create time. + * + * @property {string} resourceParent + * The full resource name of the immediate parent of the resource. See: + * https://cloud.google.com/apis/design/resource_names#full_resource_name + * + * @property {string} resourceProject + * The full resource name of the project the resource belongs to. See: + * https://cloud.google.com/apis/design/resource_names#full_resource_name + * + * @property {string[]} resourceOwners + * Owners of the Google Cloud resource. + * + * @typedef SecurityCenterProperties + * @memberof google.cloud.securitycenter.v1beta1 + * @see [google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/securitycenter/v1beta1/asset.proto} + */ + SecurityCenterProperties: { + // This is for documentation. Actual contents will be loaded by gRPC. + } +}; \ No newline at end of file diff --git a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_finding.js b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_finding.js new file mode 100644 index 00000000000..f6b6c6157e2 --- /dev/null +++ b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_finding.js @@ -0,0 +1,114 @@ +// Copyright 2018 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Note: this file is purely for documentation. Any contents are not expected +// to be loaded as the JS file. + +/** + * Security Center's finding. + * + * A finding is a record of assessment data (security, risk, health or privacy) + * ingested into Security Center for presentation, notification, analysis, + * policy testing and enforcement. For example, an XSS vulnerability in an + * AppEngine application is a finding. + * + * @property {string} name + * The relative resource name of this finding. See: + * https://cloud.google.com/apis/design/resource_names#relative_resource_name + * Example: + * "organizations/123/sources/456/findings/789" + * + * @property {string} parent + * The relative resource name of the source the finding belongs to. See: + * https://cloud.google.com/apis/design/resource_names#relative_resource_name + * This field is immutable after creation time. + * For example: + * "organizations/123/sources/456" + * + * @property {string} resourceName + * The full resource name of the Google Cloud Platform resource this finding + * is for. See: + * https://cloud.google.com/apis/design/resource_names#full_resource_name + * This field is immutable after creation time. + * + * @property {number} state + * The state of the finding. + * + * The number should be among the values of [State]{@link google.cloud.securitycenter.v1beta1.State} + * + * @property {string} category + * The additional taxonomy group within findings from a give source. + * This field is immutable after creation time. + * Example: "XSS_FLASH_INJECTION" + * + * @property {string} externalUri + * The URI that, if available, points to a web page outside of Security Center + * where additional information about the finding can be found. This field is + * guaranteed to be either empty or a well formed url. + * + * @property {Object.} sourceProperties + * Source specific properties. These properties are managed by the source + * writing the finding. + * + * @property {Object} securityMarks + * Output only. User specified security marks. These marks are entirely + * managed by the user and come from the SecurityMarks resource belonging to + * the finding. + * + * This object should have the same structure as [SecurityMarks]{@link google.cloud.securitycenter.v1beta1.SecurityMarks} + * + * @property {Object} eventTime + * The time at which the event took place. For example, if the finding + * represents an open firewall it would capture the time the open firewall was + * detected. + * + * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} + * + * @property {Object} createTime + * The time at which the finding was created in Security Center. + * + * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} + * + * @typedef Finding + * @memberof google.cloud.securitycenter.v1beta1 + * @see [google.cloud.securitycenter.v1beta1.Finding definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/securitycenter/v1beta1/finding.proto} + */ +const Finding = { + // This is for documentation. Actual contents will be loaded by gRPC. + + /** + * The state of the finding. + * + * @enum {number} + * @memberof google.cloud.securitycenter.v1beta1 + */ + State: { + + /** + * Unspecified state. + */ + STATE_UNSPECIFIED: 0, + + /** + * The finding requires attention and has not been addressed yet. + */ + ACTIVE: 1, + + /** + * The finding has been fixed, triaged as a non-issue or otherwise addressed + * and is no longer active. + */ + INACTIVE: 2 + } +}; \ No newline at end of file diff --git a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_organization_settings.js b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_organization_settings.js new file mode 100644 index 00000000000..f71c58c650b --- /dev/null +++ b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_organization_settings.js @@ -0,0 +1,97 @@ +// Copyright 2018 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Note: this file is purely for documentation. Any contents are not expected +// to be loaded as the JS file. + +/** + * User specified settings that are attached to the Security Center + * organization. + * + * @property {string} name + * The relative resource name of the settings. See: + * https://cloud.google.com/apis/design/resource_names#relative_resource_name + * Example: + * "organizations/123/organizationSettings". + * + * @property {boolean} enableAssetDiscovery + * A flag indicating whether Asset Discovery should be enabled. If the flag is + * set to true then discovery of assets will occur. If it is set to false all + * historical assets will remain but discovery of future assets will not + * occur. + * + * @property {Object} assetDiscoveryConfig + * The configuration used for Asset Discovery runs. + * + * This object should have the same structure as [AssetDiscoveryConfig]{@link google.cloud.securitycenter.v1beta1.AssetDiscoveryConfig} + * + * @typedef OrganizationSettings + * @memberof google.cloud.securitycenter.v1beta1 + * @see [google.cloud.securitycenter.v1beta1.OrganizationSettings definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/securitycenter/v1beta1/organization_settings.proto} + */ +const OrganizationSettings = { + // This is for documentation. Actual contents will be loaded by gRPC. + + /** + * The configuration used for Asset Discovery runs. + * + * @property {string[]} projectIds + * The project ids to use for filtering asset discovery. + * + * @property {number} inclusionMode + * The mode to use for filtering asset discovery. + * + * The number should be among the values of [InclusionMode]{@link google.cloud.securitycenter.v1beta1.InclusionMode} + * + * @typedef AssetDiscoveryConfig + * @memberof google.cloud.securitycenter.v1beta1 + * @see [google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/securitycenter/v1beta1/organization_settings.proto} + */ + AssetDiscoveryConfig: { + // This is for documentation. Actual contents will be loaded by gRPC. + + /** + * The mode of inclusion when running Asset Discovery. + * Asset discovery can be limited by explicitly identifying projects to be + * included or excluded. If INCLUDE_ONLY is set then only those projects + * (within the organization) and their children are discovered during asset + * discovery. If EXCLUDE is set then projects not matching those projects + * are discovered during asset discovery. If neither are set then all + * projects within the organization are discovered during asset discovery. + * + * @enum {number} + * @memberof google.cloud.securitycenter.v1beta1 + */ + InclusionMode: { + + /** + * Unspecified. Setting the mode with this value will disable + * inclusion/exclusion filtering for Asset Discovery. + */ + INCLUSION_MODE_UNSPECIFIED: 0, + + /** + * Asset Discovery will capture only the resources within the projects + * specified. All other resources will be ignored. + */ + INCLUDE_ONLY: 1, + + /** + * Asset Discovery will ignore all resources under the projects specified. + * All other resources will be retrieved. + */ + EXCLUDE: 2 + } + } +}; \ No newline at end of file diff --git a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_security_marks.js b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_security_marks.js new file mode 100644 index 00000000000..78b29bdf3e1 --- /dev/null +++ b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_security_marks.js @@ -0,0 +1,45 @@ +// Copyright 2018 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Note: this file is purely for documentation. Any contents are not expected +// to be loaded as the JS file. + +/** + * User specified security marks that are attached to the parent Security Center + * resource. Security marks are scoped within a Security Center organization -- + * they are modifiable and viewable by all with proper permissions on the + * organization. + * + * @property {string} name + * The relative resource name of the SecurityMarks. See: + * https://cloud.google.com/apis/design/resource_names#relative_resource_name + * Examples: + * "organizations/123/assets/456/securityMarks" + * "organizations/123/sources/456/findings/789/securityMarks". + * + * @property {Object.} marks + * Mutable user specified security marks belonging to the parent resource. + * Constraints are as follows: + * - Keys and values are treated as case insensitive + * - Keys must be alphanumeric and between 1 - 256 characters (inclusive) + * - Values have leading and trailing whitespace trimmed, remaining + * characters must be between 1 - 4096 characters (inclusive) + * + * @typedef SecurityMarks + * @memberof google.cloud.securitycenter.v1beta1 + * @see [google.cloud.securitycenter.v1beta1.SecurityMarks definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/securitycenter/v1beta1/security_marks.proto} + */ +const SecurityMarks = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; \ No newline at end of file diff --git a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_securitycenter_service.js b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_securitycenter_service.js new file mode 100644 index 00000000000..7b8a3360a34 --- /dev/null +++ b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_securitycenter_service.js @@ -0,0 +1,824 @@ +// Copyright 2018 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Note: this file is purely for documentation. Any contents are not expected +// to be loaded as the JS file. + +/** + * Request message for creating a finding. + * + * @property {string} parent + * Resource name of the new finding's parent. Its format should be + * "organizations/[organization_id]/sources/[source_id]". + * + * @property {string} findingId + * Unique identifier provided by the client within the parent scope. + * It must be alphanumeric and less than or equal to 32 characters and + * greater than 0 characters in length. + * + * @property {Object} finding + * The Finding being created. The name and security_marks will be ignored as + * they are both output only fields on this resource. + * + * This object should have the same structure as [Finding]{@link google.cloud.securitycenter.v1beta1.Finding} + * + * @typedef CreateFindingRequest + * @memberof google.cloud.securitycenter.v1beta1 + * @see [google.cloud.securitycenter.v1beta1.CreateFindingRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/securitycenter/v1beta1/securitycenter_service.proto} + */ +const CreateFindingRequest = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * Request message for creating a source. + * + * @property {string} parent + * Resource name of the new source's parent. Its format should be + * "organizations/[organization_id]". + * + * @property {Object} source + * The Source being created, only the display_name and description will be + * used. All other fields will be ignored. + * + * This object should have the same structure as [Source]{@link google.cloud.securitycenter.v1beta1.Source} + * + * @typedef CreateSourceRequest + * @memberof google.cloud.securitycenter.v1beta1 + * @see [google.cloud.securitycenter.v1beta1.CreateSourceRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/securitycenter/v1beta1/securitycenter_service.proto} + */ +const CreateSourceRequest = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * Request message for getting organization settings. + * + * @property {string} name + * Name of the organization to get organization settings for. Its format is + * "organizations/[organization_id]/organizationSettings". + * + * @typedef GetOrganizationSettingsRequest + * @memberof google.cloud.securitycenter.v1beta1 + * @see [google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/securitycenter/v1beta1/securitycenter_service.proto} + */ +const GetOrganizationSettingsRequest = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * Request message for getting a source. + * + * @property {string} name + * Relative resource name of the source. Its format is + * "organizations/[organization_id]/source/[source_id]". + * + * @typedef GetSourceRequest + * @memberof google.cloud.securitycenter.v1beta1 + * @see [google.cloud.securitycenter.v1beta1.GetSourceRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/securitycenter/v1beta1/securitycenter_service.proto} + */ +const GetSourceRequest = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * Request message for grouping by assets. + * + * @property {string} parent + * Name of the organization to groupBy. Its format is + * "organizations/[organization_id]". + * + * @property {string} filter + * Expression that defines the filter to apply across assets. + * The expression is a list of zero or more restrictions combined via logical + * operators `AND` and `OR`. + * Parentheses are not supported, and `OR` has higher precedence than `AND`. + * + * Restrictions have the form ` ` and may have a `-` + * character in front of them to indicate negation. The fields map to those + * defined in the Asset resource. Examples include: + * + * * name + * * security_center_properties.resource_name + * * resource_properties.a_property + * * security_marks.marks.marka + * + * The supported operators are: + * + * * `=` for all value types. + * * `>`, `<`, `>=`, `<=` for integer values. + * * `:`, meaning substring matching, for strings. + * + * The supported value types are: + * + * * string literals in quotes. + * * integer literals without quotes. + * * boolean literals `true` and `false` without quotes. + * + * For example, `resource_properties.size = 100` is a valid filter string. + * + * @property {string} groupBy + * Expression that defines what assets fields to use for grouping. The string + * value should follow SQL syntax: comma separated list of fields. For + * example: + * "security_center_properties.resource_project,security_center_properties.project". + * + * The following fields are supported when compare_duration is not set: + * + * * security_center_properties.resource_name + * * security_center_properties.resource_project + * * security_center_properties.resource_type + * * security_center_properties.resource_parent + * + * The following fields are supported when compare_duration is set: + * + * * security_center_properties.resource_type + * + * @property {Object} compareDuration + * When compare_duration is set, the Asset's "state" property is updated to + * indicate whether the asset was added, removed, or remained present during + * the compare_duration period of time that precedes the read_time. This is + * the time between (read_time - compare_duration) and read_time. + * + * The state value is derived based on the presence of the asset at the two + * points in time. Intermediate state changes between the two times don't + * affect the result. For example, the results aren't affected if the asset is + * removed and re-created again. + * + * Possible "state" values when compare_duration is specified: + * + * * "ADDED": indicates that the asset was not present before + * compare_duration, but present at reference_time. + * * "REMOVED": indicates that the asset was present at the start of + * compare_duration, but not present at reference_time. + * * "ACTIVE_AT_BOTH": indicates that the asset was present at both the + * start and the end of the time period defined by + * compare_duration and reference_time. + * + * This field is ignored if `state` is not a field in `group_by`. + * + * This object should have the same structure as [Duration]{@link google.protobuf.Duration} + * + * @property {Object} readTime + * Time used as a reference point when filtering assets. The filter is limited + * to assets existing at the supplied time and their values are those at that + * specific time. Absence of this field will default to the API's version of + * NOW. + * + * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} + * + * @property {string} pageToken + * The value returned by the last `GroupAssetsResponse`; indicates + * that this is a continuation of a prior `GroupAssets` call, and that the + * system should return the next page of data. + * + * @property {number} pageSize + * The maximum number of results to return in a single response. Default is + * 10, minimum is 1, maximum is 1000. + * + * @typedef GroupAssetsRequest + * @memberof google.cloud.securitycenter.v1beta1 + * @see [google.cloud.securitycenter.v1beta1.GroupAssetsRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/securitycenter/v1beta1/securitycenter_service.proto} + */ +const GroupAssetsRequest = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * Response message for grouping by assets. + * + * @property {Object[]} groupByResults + * Group results. There exists an element for each existing unique + * combination of property/values. The element contains a count for the number + * of times those specific property/values appear. + * + * This object should have the same structure as [GroupResult]{@link google.cloud.securitycenter.v1beta1.GroupResult} + * + * @property {Object} readTime + * Time used for executing the groupBy request. + * + * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} + * + * @property {string} nextPageToken + * Token to retrieve the next page of results, or empty if there are no more + * results. + * + * @typedef GroupAssetsResponse + * @memberof google.cloud.securitycenter.v1beta1 + * @see [google.cloud.securitycenter.v1beta1.GroupAssetsResponse definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/securitycenter/v1beta1/securitycenter_service.proto} + */ +const GroupAssetsResponse = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * Request message for grouping by findings. + * + * @property {string} parent + * Name of the source to groupBy. Its format is + * "organizations/[organization_id]/sources/[source_id]". To groupBy across + * all sources provide a source_id of `-`. For example: + * organizations/123/sources/- + * + * @property {string} filter + * Expression that defines the filter to apply across findings. + * The expression is a list of one or more restrictions combined via logical + * operators `AND` and `OR`. + * Parentheses are not supported, and `OR` has higher precedence than `AND`. + * + * Restrictions have the form ` ` and may have a `-` + * character in front of them to indicate negation. Examples include: + * + * * name + * * source_properties.a_property + * * security_marks.marks.marka + * + * The supported operators are: + * + * * `=` for all value types. + * * `>`, `<`, `>=`, `<=` for integer values. + * * `:`, meaning substring matching, for strings. + * + * The supported value types are: + * + * * string literals in quotes. + * * integer literals without quotes. + * * boolean literals `true` and `false` without quotes. + * + * For example, `source_properties.size = 100` is a valid filter string. + * + * @property {string} groupBy + * Expression that defines what assets fields to use for grouping (including + * `state`). The string value should follow SQL syntax: comma separated list + * of fields. For example: + * "parent,resource_name". + * + * The following fields are supported: + * + * * resource_name + * * category + * * state + * * parent + * + * @property {Object} readTime + * Time used as a reference point when filtering findings. The filter is + * limited to findings existing at the supplied time and their values are + * those at that specific time. Absence of this field will default to the + * API's version of NOW. + * + * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} + * + * @property {string} pageToken + * The value returned by the last `GroupFindingsResponse`; indicates + * that this is a continuation of a prior `GroupFindings` call, and + * that the system should return the next page of data. + * + * @property {number} pageSize + * The maximum number of results to return in a single response. Default is + * 10, minimum is 1, maximum is 1000. + * + * @typedef GroupFindingsRequest + * @memberof google.cloud.securitycenter.v1beta1 + * @see [google.cloud.securitycenter.v1beta1.GroupFindingsRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/securitycenter/v1beta1/securitycenter_service.proto} + */ +const GroupFindingsRequest = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * Response message for group by findings. + * + * @property {Object[]} groupByResults + * Group results. There exists an element for each existing unique + * combination of property/values. The element contains a count for the number + * of times those specific property/values appear. + * + * This object should have the same structure as [GroupResult]{@link google.cloud.securitycenter.v1beta1.GroupResult} + * + * @property {Object} readTime + * Time used for executing the groupBy request. + * + * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} + * + * @property {string} nextPageToken + * Token to retrieve the next page of results, or empty if there are no more + * results. + * + * @typedef GroupFindingsResponse + * @memberof google.cloud.securitycenter.v1beta1 + * @see [google.cloud.securitycenter.v1beta1.GroupFindingsResponse definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/securitycenter/v1beta1/securitycenter_service.proto} + */ +const GroupFindingsResponse = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * Result containing the properties and count of a groupBy request. + * + * @property {Object.} properties + * Properties matching the groupBy fields in the request. + * + * @property {number} count + * Total count of resources for the given properties. + * + * @typedef GroupResult + * @memberof google.cloud.securitycenter.v1beta1 + * @see [google.cloud.securitycenter.v1beta1.GroupResult definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/securitycenter/v1beta1/securitycenter_service.proto} + */ +const GroupResult = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * Request message for listing sources. + * + * @property {string} parent + * Resource name of the parent of sources to list. Its format should be + * "organizations/[organization_id]". + * + * @property {string} pageToken + * The value returned by the last `ListSourcesResponse`; indicates + * that this is a continuation of a prior `ListSources` call, and + * that the system should return the next page of data. + * + * @property {number} pageSize + * The maximum number of results to return in a single response. Default is + * 10, minimum is 1, maximum is 1000. + * + * @typedef ListSourcesRequest + * @memberof google.cloud.securitycenter.v1beta1 + * @see [google.cloud.securitycenter.v1beta1.ListSourcesRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/securitycenter/v1beta1/securitycenter_service.proto} + */ +const ListSourcesRequest = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * Response message for listing sources. + * + * @property {Object[]} sources + * Sources belonging to the requested parent. + * + * This object should have the same structure as [Source]{@link google.cloud.securitycenter.v1beta1.Source} + * + * @property {string} nextPageToken + * Token to retrieve the next page of results, or empty if there are no more + * results. + * + * @typedef ListSourcesResponse + * @memberof google.cloud.securitycenter.v1beta1 + * @see [google.cloud.securitycenter.v1beta1.ListSourcesResponse definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/securitycenter/v1beta1/securitycenter_service.proto} + */ +const ListSourcesResponse = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * Request message for listing assets. + * + * @property {string} parent + * Name of the organization assets should belong to. Its format is + * "organizations/[organization_id]". + * + * @property {string} filter + * Expression that defines the filter to apply across assets. + * The expression is a list of zero or more restrictions combined via logical + * operators `AND` and `OR`. + * Parentheses are not supported, and `OR` has higher precedence than `AND`. + * + * Restrictions have the form ` ` and may have a `-` + * character in front of them to indicate negation. The fields map to those + * defined in the Asset resource. Examples include: + * + * * name + * * security_center_properties.resource_name + * * resource_properties.a_property + * * security_marks.marks.marka + * + * The supported operators are: + * + * * `=` for all value types. + * * `>`, `<`, `>=`, `<=` for integer values. + * * `:`, meaning substring matching, for strings. + * + * The supported value types are: + * + * * string literals in quotes. + * * integer literals without quotes. + * * boolean literals `true` and `false` without quotes. + * + * For example, `resource_properties.size = 100` is a valid filter string. + * + * @property {string} orderBy + * Expression that defines what fields and order to use for sorting. The + * string value should follow SQL syntax: comma separated list of fields. For + * example: "name,resource_properties.a_property". The default sorting order + * is ascending. To specify descending order for a field, a suffix " desc" + * should be appended to the field name. For example: "name + * desc,resource_properties.a_property". Redundant space characters in the + * syntax are insignificant. "name desc,resource_properties.a_property" and " + * name desc , resource_properties.a_property " are equivalent. + * + * @property {Object} readTime + * Time used as a reference point when filtering assets. The filter is limited + * to assets existing at the supplied time and their values are those at that + * specific time. Absence of this field will default to the API's version of + * NOW. + * + * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} + * + * @property {Object} compareDuration + * When compare_duration is set, the ListAssetResult's "state" attribute is + * updated to indicate whether the asset was added, removed, or remained + * present during the compare_duration period of time that precedes the + * read_time. This is the time between (read_time - + * compare_duration) and read_time. + * + * The state value is derived based on the presence of the asset at the two + * points in time. Intermediate state changes between the two times don't + * affect the result. For example, the results aren't affected if the asset is + * removed and re-created again. + * + * Possible "state" values when compare_duration is specified: + * + * * "ADDED": indicates that the asset was not present before + * compare_duration, but present at read_time. + * * "REMOVED": indicates that the asset was present at the start of + * compare_duration, but not present at read_time. + * * "ACTIVE": indicates that the asset was present at both the + * start and the end of the time period defined by + * compare_duration and read_time. + * + * If compare_duration is not specified, then the only possible state is + * "UNUSED", which indicates that the asset is present at read_time. + * + * This object should have the same structure as [Duration]{@link google.protobuf.Duration} + * + * @property {Object} fieldMask + * Optional. + * + * A field mask to specify the ListAssetsResult fields to be listed in the + * response. + * An empty field mask will list all fields. + * + * This object should have the same structure as [FieldMask]{@link google.protobuf.FieldMask} + * + * @property {string} pageToken + * The value returned by the last `ListAssetsResponse`; indicates + * that this is a continuation of a prior `ListAssets` call, and + * that the system should return the next page of data. + * + * @property {number} pageSize + * The maximum number of results to return in a single response. Default is + * 10, minimum is 1, maximum is 1000. + * + * @typedef ListAssetsRequest + * @memberof google.cloud.securitycenter.v1beta1 + * @see [google.cloud.securitycenter.v1beta1.ListAssetsRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/securitycenter/v1beta1/securitycenter_service.proto} + */ +const ListAssetsRequest = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * Response message for listing assets. + * + * @property {Object[]} listAssetsResults + * Assets matching the list request. + * + * This object should have the same structure as [ListAssetsResult]{@link google.cloud.securitycenter.v1beta1.ListAssetsResult} + * + * @property {Object} readTime + * Time used for executing the list request. + * + * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} + * + * @property {string} nextPageToken + * Token to retrieve the next page of results, or empty if there are no more + * results. + * + * @property {number} totalSize + * The total number of assets matching the query. + * + * @typedef ListAssetsResponse + * @memberof google.cloud.securitycenter.v1beta1 + * @see [google.cloud.securitycenter.v1beta1.ListAssetsResponse definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/securitycenter/v1beta1/securitycenter_service.proto} + */ +const ListAssetsResponse = { + // This is for documentation. Actual contents will be loaded by gRPC. + + /** + * Result containing the Asset and its State. + * + * @property {Object} asset + * Asset matching the search request. + * + * This object should have the same structure as [Asset]{@link google.cloud.securitycenter.v1beta1.Asset} + * + * @property {number} state + * State of the asset. + * + * The number should be among the values of [State]{@link google.cloud.securitycenter.v1beta1.State} + * + * @typedef ListAssetsResult + * @memberof google.cloud.securitycenter.v1beta1 + * @see [google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/securitycenter/v1beta1/securitycenter_service.proto} + */ + ListAssetsResult: { + // This is for documentation. Actual contents will be loaded by gRPC. + + /** + * State of the asset. + * + * When querying across two points in time this describes + * the change between the two points: ADDED, REMOVED, or ACTIVE. + * If there was no compare_duration supplied in the request the state should + * be: UNUSED + * + * @enum {number} + * @memberof google.cloud.securitycenter.v1beta1 + */ + State: { + + /** + * Unspecified state. + */ + STATE_UNSPECIFIED: 0, + + /** + * Request did not specify use of this field in the result. + */ + UNUSED: 1, + + /** + * Asset was added between the points in time. + */ + ADDED: 2, + + /** + * Asset was removed between the points in time. + */ + REMOVED: 3, + + /** + * Asset was active at both point(s) in time. + */ + ACTIVE: 4 + } + } +}; + +/** + * Request message for listing findings. + * + * @property {string} parent + * Name of the source the findings belong to. Its format is + * "organizations/[organization_id]/sources/[source_id]". To list across all + * sources provide a source_id of `-`. For example: + * organizations/123/sources/- + * + * @property {string} filter + * Expression that defines the filter to apply across findings. + * The expression is a list of one or more restrictions combined via logical + * operators `AND` and `OR`. + * Parentheses are not supported, and `OR` has higher precedence than `AND`. + * + * Restrictions have the form ` ` and may have a `-` + * character in front of them to indicate negation. Examples include: + * + * * name + * * source_properties.a_property + * * security_marks.marks.marka + * + * The supported operators are: + * + * * `=` for all value types. + * * `>`, `<`, `>=`, `<=` for integer values. + * * `:`, meaning substring matching, for strings. + * + * The supported value types are: + * + * * string literals in quotes. + * * integer literals without quotes. + * * boolean literals `true` and `false` without quotes. + * + * For example, `source_properties.size = 100` is a valid filter string. + * + * @property {string} orderBy + * Expression that defines what fields and order to use for sorting. The + * string value should follow SQL syntax: comma separated list of fields. For + * example: "name,resource_properties.a_property". The default sorting order + * is ascending. To specify descending order for a field, a suffix " desc" + * should be appended to the field name. For example: "name + * desc,source_properties.a_property". Redundant space characters in the + * syntax are insignificant. "name desc,source_properties.a_property" and " + * name desc , source_properties.a_property " are equivalent. + * + * @property {Object} readTime + * Time used as a reference point when filtering findings. The filter is + * limited to findings existing at the supplied time and their values are + * those at that specific time. Absence of this field will default to the + * API's version of NOW. + * + * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} + * + * @property {Object} fieldMask + * Optional. + * + * A field mask to specify the Finding fields to be listed in the response. + * An empty field mask will list all fields. + * + * This object should have the same structure as [FieldMask]{@link google.protobuf.FieldMask} + * + * @property {string} pageToken + * The value returned by the last `ListFindingsResponse`; indicates + * that this is a continuation of a prior `ListFindings` call, and + * that the system should return the next page of data. + * + * @property {number} pageSize + * The maximum number of results to return in a single response. Default is + * 10, minimum is 1, maximum is 1000. + * + * @typedef ListFindingsRequest + * @memberof google.cloud.securitycenter.v1beta1 + * @see [google.cloud.securitycenter.v1beta1.ListFindingsRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/securitycenter/v1beta1/securitycenter_service.proto} + */ +const ListFindingsRequest = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * Response message for listing findings. + * + * @property {Object[]} findings + * Findings matching the list request. + * + * This object should have the same structure as [Finding]{@link google.cloud.securitycenter.v1beta1.Finding} + * + * @property {Object} readTime + * Time used for executing the list request. + * + * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} + * + * @property {string} nextPageToken + * Token to retrieve the next page of results, or empty if there are no more + * results. + * + * @property {number} totalSize + * The total number of findings matching the query. + * + * @typedef ListFindingsResponse + * @memberof google.cloud.securitycenter.v1beta1 + * @see [google.cloud.securitycenter.v1beta1.ListFindingsResponse definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/securitycenter/v1beta1/securitycenter_service.proto} + */ +const ListFindingsResponse = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * Request message for updating a finding's state. + * + * @property {string} name + * The relative resource name of the finding. See: + * https://cloud.google.com/apis/design/resource_names#relative_resource_name + * Example: + * "organizations/123/sources/456/finding/789". + * + * @property {number} state + * The desired State of the finding. + * + * The number should be among the values of [State]{@link google.cloud.securitycenter.v1beta1.State} + * + * @property {Object} startTime + * The time at which the updated state takes effect. + * + * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} + * + * @typedef SetFindingStateRequest + * @memberof google.cloud.securitycenter.v1beta1 + * @see [google.cloud.securitycenter.v1beta1.SetFindingStateRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/securitycenter/v1beta1/securitycenter_service.proto} + */ +const SetFindingStateRequest = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * Request message for running asset discovery for an organization. + * + * @property {string} parent + * Name of the organization to run asset discovery for. Its format is + * "organizations/[organization_id]". + * + * @typedef RunAssetDiscoveryRequest + * @memberof google.cloud.securitycenter.v1beta1 + * @see [google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/securitycenter/v1beta1/securitycenter_service.proto} + */ +const RunAssetDiscoveryRequest = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * Request message for updating or creating a finding. + * + * @property {Object} finding + * The finding resource to update or create if it does not already exist. + * parent, security_marks, and update_time will be ignored. + * + * In the case of creation, the finding id portion of the name must + * alphanumeric and less than or equal to 32 characters and greater than 0 + * characters in length. + * + * This object should have the same structure as [Finding]{@link google.cloud.securitycenter.v1beta1.Finding} + * + * @property {Object} updateMask + * The FieldMask to use when updating the finding resource. This field is + * ignored if the finding does not already exist and the finding is created. + * + * This object should have the same structure as [FieldMask]{@link google.protobuf.FieldMask} + * + * @typedef UpdateFindingRequest + * @memberof google.cloud.securitycenter.v1beta1 + * @see [google.cloud.securitycenter.v1beta1.UpdateFindingRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/securitycenter/v1beta1/securitycenter_service.proto} + */ +const UpdateFindingRequest = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * Request message for updating an organization's settings. + * + * @property {Object} organizationSettings + * The organization settings resource to update. + * + * This object should have the same structure as [OrganizationSettings]{@link google.cloud.securitycenter.v1beta1.OrganizationSettings} + * + * @property {Object} updateMask + * The FieldMask to use when updating the settings resource. + * + * This object should have the same structure as [FieldMask]{@link google.protobuf.FieldMask} + * + * @typedef UpdateOrganizationSettingsRequest + * @memberof google.cloud.securitycenter.v1beta1 + * @see [google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/securitycenter/v1beta1/securitycenter_service.proto} + */ +const UpdateOrganizationSettingsRequest = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * Request message for updating a source. + * + * @property {Object} source + * The source resource to update. + * + * This object should have the same structure as [Source]{@link google.cloud.securitycenter.v1beta1.Source} + * + * @property {Object} updateMask + * The FieldMask to use when updating the source resource. + * + * This object should have the same structure as [FieldMask]{@link google.protobuf.FieldMask} + * + * @typedef UpdateSourceRequest + * @memberof google.cloud.securitycenter.v1beta1 + * @see [google.cloud.securitycenter.v1beta1.UpdateSourceRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/securitycenter/v1beta1/securitycenter_service.proto} + */ +const UpdateSourceRequest = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * Request message for updating a SecurityMarks resource. + * + * @property {Object} securityMarks + * The security marks resource to update. + * + * This object should have the same structure as [SecurityMarks]{@link google.cloud.securitycenter.v1beta1.SecurityMarks} + * + * @property {Object} updateMask + * The FieldMask to use when updating the security marks resource. + * + * This object should have the same structure as [FieldMask]{@link google.protobuf.FieldMask} + * + * @property {Object} startTime + * The time at which the updated SecurityMarks take effect. + * + * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} + * + * @typedef UpdateSecurityMarksRequest + * @memberof google.cloud.securitycenter.v1beta1 + * @see [google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/securitycenter/v1beta1/securitycenter_service.proto} + */ +const UpdateSecurityMarksRequest = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; \ No newline at end of file diff --git a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_source.js b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_source.js new file mode 100644 index 00000000000..5f9957de073 --- /dev/null +++ b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_source.js @@ -0,0 +1,53 @@ +// Copyright 2018 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Note: this file is purely for documentation. Any contents are not expected +// to be loaded as the JS file. + +/** + * Security Center's finding source. A finding source is an entity or a + * mechanism that can produce a finding. A source can also be thought of as a + * container of findings that come from the same scanner, logger, monitor, etc. + * + * @property {string} name + * The relative resource name of this source. See: + * https://cloud.google.com/apis/design/resource_names#relative_resource_name + * Example: + * "organizations/123/sources/456" + * + * @property {string} displayName + * The source’s display name. + * A source’s display name must be unique amongst its siblings, e.g. + * no two sources with the same parent can share the same display name. + * The display name must start and end with a letter or digit, may contain + * letters, digits, spaces, hyphens and underscores and can be no longer + * than 30 characters. This is captured by the regular expression: + * [\p{L}\p{N}](https://cloud.google.com{\p{L}\p{N}_- ]{0,28}[\p{L}\p{N}])?. + * + * @property {string} description + * The description of the source (max of 1024 characters). + * Example: + * "Cloud Security Scanner is a web security scanner for common + * vulnerabilities in Google App Engine applications. It can automatically + * scan and detect four common vulnerabilities, including cross-site-scripting + * (XSS), Flash injection, mixed content (HTTP in HTTPS), and + * outdated/insecure libraries." + * + * @typedef Source + * @memberof google.cloud.securitycenter.v1beta1 + * @see [google.cloud.securitycenter.v1beta1.Source definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/securitycenter/v1beta1/source.proto} + */ +const Source = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; \ No newline at end of file diff --git a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/iam/v1/doc_iam_policy.js b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/iam/v1/doc_iam_policy.js new file mode 100644 index 00000000000..e952d5d1f02 --- /dev/null +++ b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/iam/v1/doc_iam_policy.js @@ -0,0 +1,93 @@ +// Copyright 2018 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Note: this file is purely for documentation. Any contents are not expected +// to be loaded as the JS file. + +/** + * Request message for `SetIamPolicy` method. + * + * @property {string} resource + * REQUIRED: The resource for which the policy is being specified. + * `resource` is usually specified as a path. For example, a Project + * resource is specified as `projects/{project}`. + * + * @property {Object} policy + * REQUIRED: The complete policy to be applied to the `resource`. The size of + * the policy is limited to a few 10s of KB. An empty policy is a + * valid policy but certain Cloud Platform services (such as Projects) + * might reject them. + * + * This object should have the same structure as [Policy]{@link google.iam.v1.Policy} + * + * @typedef SetIamPolicyRequest + * @memberof google.iam.v1 + * @see [google.iam.v1.SetIamPolicyRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/iam/v1/iam_policy.proto} + */ +const SetIamPolicyRequest = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * Request message for `GetIamPolicy` method. + * + * @property {string} resource + * REQUIRED: The resource for which the policy is being requested. + * `resource` is usually specified as a path. For example, a Project + * resource is specified as `projects/{project}`. + * + * @typedef GetIamPolicyRequest + * @memberof google.iam.v1 + * @see [google.iam.v1.GetIamPolicyRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/iam/v1/iam_policy.proto} + */ +const GetIamPolicyRequest = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * Request message for `TestIamPermissions` method. + * + * @property {string} resource + * REQUIRED: The resource for which the policy detail is being requested. + * `resource` is usually specified as a path. For example, a Project + * resource is specified as `projects/{project}`. + * + * @property {string[]} permissions + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see + * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + * + * @typedef TestIamPermissionsRequest + * @memberof google.iam.v1 + * @see [google.iam.v1.TestIamPermissionsRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/iam/v1/iam_policy.proto} + */ +const TestIamPermissionsRequest = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * Response message for `TestIamPermissions` method. + * + * @property {string[]} permissions + * A subset of `TestPermissionsRequest.permissions` that the caller is + * allowed. + * + * @typedef TestIamPermissionsResponse + * @memberof google.iam.v1 + * @see [google.iam.v1.TestIamPermissionsResponse definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/iam/v1/iam_policy.proto} + */ +const TestIamPermissionsResponse = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; \ No newline at end of file diff --git a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/iam/v1/doc_policy.js b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/iam/v1/doc_policy.js new file mode 100644 index 00000000000..59fca18810c --- /dev/null +++ b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/iam/v1/doc_policy.js @@ -0,0 +1,162 @@ +// Copyright 2018 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Note: this file is purely for documentation. Any contents are not expected +// to be loaded as the JS file. + +/** + * Defines an Identity and Access Management (IAM) policy. It is used to + * specify access control policies for Cloud Platform resources. + * + * + * A `Policy` consists of a list of `bindings`. A `Binding` binds a list of + * `members` to a `role`, where the members can be user accounts, Google groups, + * Google domains, and service accounts. A `role` is a named list of permissions + * defined by IAM. + * + * **Example** + * + * { + * "bindings": [ + * { + * "role": "roles/owner", + * "members": [ + * "user:mike@example.com", + * "group:admins@example.com", + * "domain:google.com", + * "serviceAccount:my-other-app@appspot.gserviceaccount.com", + * ] + * }, + * { + * "role": "roles/viewer", + * "members": ["user:sean@example.com"] + * } + * ] + * } + * + * For a description of IAM and its features, see the + * [IAM developer's guide](https://cloud.google.com/iam). + * + * @property {number} version + * Version of the `Policy`. The default version is 0. + * + * @property {Object[]} bindings + * Associates a list of `members` to a `role`. + * Multiple `bindings` must not be specified for the same `role`. + * `bindings` with no members will result in an error. + * + * This object should have the same structure as [Binding]{@link google.iam.v1.Binding} + * + * @property {string} etag + * `etag` is used for optimistic concurrency control as a way to help + * prevent simultaneous updates of a policy from overwriting each other. + * It is strongly suggested that systems make use of the `etag` in the + * read-modify-write cycle to perform policy updates in order to avoid race + * conditions: An `etag` is returned in the response to `getIamPolicy`, and + * systems are expected to put that etag in the request to `setIamPolicy` to + * ensure that their change will be applied to the same version of the policy. + * + * If no `etag` is provided in the call to `setIamPolicy`, then the existing + * policy is overwritten blindly. + * + * @typedef Policy + * @memberof google.iam.v1 + * @see [google.iam.v1.Policy definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/iam/v1/policy.proto} + */ +const Policy = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * Associates `members` with a `role`. + * + * @property {string} role + * Role that is assigned to `members`. + * For example, `roles/viewer`, `roles/editor`, or `roles/owner`. + * Required + * + * @property {string[]} members + * Specifies the identities requesting access for a Cloud Platform resource. + * `members` can have the following values: + * + * * `allUsers`: A special identifier that represents anyone who is + * on the internet; with or without a Google account. + * + * * `allAuthenticatedUsers`: A special identifier that represents anyone + * who is authenticated with a Google account or a service account. + * + * * `user:{emailid}`: An email address that represents a specific Google + * account. For example, `alice@gmail.com` or `joe@example.com`. + * + * + * * `serviceAccount:{emailid}`: An email address that represents a service + * account. For example, `my-other-app@appspot.gserviceaccount.com`. + * + * * `group:{emailid}`: An email address that represents a Google group. + * For example, `admins@example.com`. + * + * * `domain:{domain}`: A Google Apps domain name that represents all the + * users of that domain. For example, `google.com` or `example.com`. + * + * @typedef Binding + * @memberof google.iam.v1 + * @see [google.iam.v1.Binding definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/iam/v1/policy.proto} + */ +const Binding = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * The difference delta between two policies. + * + * @property {Object[]} bindingDeltas + * The delta for Bindings between two policies. + * + * This object should have the same structure as [BindingDelta]{@link google.iam.v1.BindingDelta} + * + * @typedef PolicyDelta + * @memberof google.iam.v1 + * @see [google.iam.v1.PolicyDelta definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/iam/v1/policy.proto} + */ +const PolicyDelta = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * One delta entry for Binding. Each individual change (only one member in each + * entry) to a binding will be a separate entry. + * + * @property {number} action + * The action that was performed on a Binding. + * Required + * + * The number should be among the values of [Action]{@link google.iam.v1.Action} + * + * @property {string} role + * Role that is assigned to `members`. + * For example, `roles/viewer`, `roles/editor`, or `roles/owner`. + * Required + * + * @property {string} member + * A single identity requesting access for a Cloud Platform resource. + * Follows the same format of Binding.members. + * Required + * + * @typedef BindingDelta + * @memberof google.iam.v1 + * @see [google.iam.v1.BindingDelta definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/iam/v1/policy.proto} + */ +const BindingDelta = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; \ No newline at end of file diff --git a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/longrunning/doc_operations.js b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/longrunning/doc_operations.js new file mode 100644 index 00000000000..4af5d7d3574 --- /dev/null +++ b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/longrunning/doc_operations.js @@ -0,0 +1,147 @@ +// Copyright 2018 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Note: this file is purely for documentation. Any contents are not expected +// to be loaded as the JS file. + +/** + * This resource represents a long-running operation that is the result of a + * network API call. + * + * @property {string} name + * The server-assigned name, which is only unique within the same service that + * originally returns it. If you use the default HTTP mapping, the + * `name` should have the format of `operations/some/unique/name`. + * + * @property {Object} metadata + * Service-specific metadata associated with the operation. It typically + * contains progress information and common metadata such as create time. + * Some services might not provide such metadata. Any method that returns a + * long-running operation should document the metadata type, if any. + * + * This object should have the same structure as [Any]{@link google.protobuf.Any} + * + * @property {boolean} done + * If the value is `false`, it means the operation is still in progress. + * If true, the operation is completed, and either `error` or `response` is + * available. + * + * @property {Object} error + * The error result of the operation in case of failure or cancellation. + * + * This object should have the same structure as [Status]{@link google.rpc.Status} + * + * @property {Object} response + * The normal response of the operation in case of success. If the original + * method returns no data on success, such as `Delete`, the response is + * `google.protobuf.Empty`. If the original method is standard + * `Get`/`Create`/`Update`, the response should be the resource. For other + * methods, the response should have the type `XxxResponse`, where `Xxx` + * is the original method name. For example, if the original method name + * is `TakeSnapshot()`, the inferred response type is + * `TakeSnapshotResponse`. + * + * This object should have the same structure as [Any]{@link google.protobuf.Any} + * + * @typedef Operation + * @memberof google.longrunning + * @see [google.longrunning.Operation definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/longrunning/operations.proto} + */ +const Operation = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * The request message for Operations.GetOperation. + * + * @property {string} name + * The name of the operation resource. + * + * @typedef GetOperationRequest + * @memberof google.longrunning + * @see [google.longrunning.GetOperationRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/longrunning/operations.proto} + */ +const GetOperationRequest = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * The request message for Operations.ListOperations. + * + * @property {string} name + * The name of the operation collection. + * + * @property {string} filter + * The standard list filter. + * + * @property {number} pageSize + * The standard list page size. + * + * @property {string} pageToken + * The standard list page token. + * + * @typedef ListOperationsRequest + * @memberof google.longrunning + * @see [google.longrunning.ListOperationsRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/longrunning/operations.proto} + */ +const ListOperationsRequest = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * The response message for Operations.ListOperations. + * + * @property {Object[]} operations + * A list of operations that matches the specified filter in the request. + * + * This object should have the same structure as [Operation]{@link google.longrunning.Operation} + * + * @property {string} nextPageToken + * The standard List next-page token. + * + * @typedef ListOperationsResponse + * @memberof google.longrunning + * @see [google.longrunning.ListOperationsResponse definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/longrunning/operations.proto} + */ +const ListOperationsResponse = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * The request message for Operations.CancelOperation. + * + * @property {string} name + * The name of the operation resource to be cancelled. + * + * @typedef CancelOperationRequest + * @memberof google.longrunning + * @see [google.longrunning.CancelOperationRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/longrunning/operations.proto} + */ +const CancelOperationRequest = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * The request message for Operations.DeleteOperation. + * + * @property {string} name + * The name of the operation resource to be deleted. + * + * @typedef DeleteOperationRequest + * @memberof google.longrunning + * @see [google.longrunning.DeleteOperationRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/longrunning/operations.proto} + */ +const DeleteOperationRequest = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; \ No newline at end of file diff --git a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/protobuf/doc_any.js b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/protobuf/doc_any.js new file mode 100644 index 00000000000..3accb1fc0d8 --- /dev/null +++ b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/protobuf/doc_any.js @@ -0,0 +1,136 @@ +// Copyright 2018 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Note: this file is purely for documentation. Any contents are not expected +// to be loaded as the JS file. + +/** + * `Any` contains an arbitrary serialized protocol buffer message along with a + * URL that describes the type of the serialized message. + * + * Protobuf library provides support to pack/unpack Any values in the form + * of utility functions or additional generated methods of the Any type. + * + * Example 1: Pack and unpack a message in C++. + * + * Foo foo = ...; + * Any any; + * any.PackFrom(foo); + * ... + * if (any.UnpackTo(&foo)) { + * ... + * } + * + * Example 2: Pack and unpack a message in Java. + * + * Foo foo = ...; + * Any any = Any.pack(foo); + * ... + * if (any.is(Foo.class)) { + * foo = any.unpack(Foo.class); + * } + * + * Example 3: Pack and unpack a message in Python. + * + * foo = Foo(...) + * any = Any() + * any.Pack(foo) + * ... + * if any.Is(Foo.DESCRIPTOR): + * any.Unpack(foo) + * ... + * + * Example 4: Pack and unpack a message in Go + * + * foo := &pb.Foo{...} + * any, err := ptypes.MarshalAny(foo) + * ... + * foo := &pb.Foo{} + * if err := ptypes.UnmarshalAny(any, foo); err != nil { + * ... + * } + * + * The pack methods provided by protobuf library will by default use + * 'type.googleapis.com/full.type.name' as the type URL and the unpack + * methods only use the fully qualified type name after the last '/' + * in the type URL, for example "foo.bar.com/x/y.z" will yield type + * name "y.z". + * + * + * # JSON + * + * The JSON representation of an `Any` value uses the regular + * representation of the deserialized, embedded message, with an + * additional field `@type` which contains the type URL. Example: + * + * package google.profile; + * message Person { + * string first_name = 1; + * string last_name = 2; + * } + * + * { + * "@type": "type.googleapis.com/google.profile.Person", + * "firstName": , + * "lastName": + * } + * + * If the embedded message type is well-known and has a custom JSON + * representation, that representation will be embedded adding a field + * `value` which holds the custom JSON in addition to the `@type` + * field. Example (for message google.protobuf.Duration): + * + * { + * "@type": "type.googleapis.com/google.protobuf.Duration", + * "value": "1.212s" + * } + * + * @property {string} typeUrl + * A URL/resource name that uniquely identifies the type of the serialized + * protocol buffer message. The last segment of the URL's path must represent + * the fully qualified name of the type (as in + * `path/google.protobuf.Duration`). The name should be in a canonical form + * (e.g., leading "." is not accepted). + * + * In practice, teams usually precompile into the binary all types that they + * expect it to use in the context of Any. However, for URLs which use the + * scheme `http`, `https`, or no scheme, one can optionally set up a type + * server that maps type URLs to message definitions as follows: + * + * * If no scheme is provided, `https` is assumed. + * * An HTTP GET on the URL must yield a google.protobuf.Type + * value in binary format, or produce an error. + * * Applications are allowed to cache lookup results based on the + * URL, or have them precompiled into a binary to avoid any + * lookup. Therefore, binary compatibility needs to be preserved + * on changes to types. (Use versioned type names to manage + * breaking changes.) + * + * Note: this functionality is not currently available in the official + * protobuf release, and it is not used for type URLs beginning with + * type.googleapis.com. + * + * Schemes other than `http`, `https` (or the empty scheme) might be + * used with implementation specific semantics. + * + * @property {string} value + * Must be a valid serialized protocol buffer of the above specified type. + * + * @typedef Any + * @memberof google.protobuf + * @see [google.protobuf.Any definition in proto format]{@link https://github.com/google/protobuf/blob/master/src/google/protobuf/any.proto} + */ +const Any = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; \ No newline at end of file diff --git a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/protobuf/doc_duration.js b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/protobuf/doc_duration.js new file mode 100644 index 00000000000..c03ce2fb3df --- /dev/null +++ b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/protobuf/doc_duration.js @@ -0,0 +1,97 @@ +// Copyright 2018 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Note: this file is purely for documentation. Any contents are not expected +// to be loaded as the JS file. + +/** + * A Duration represents a signed, fixed-length span of time represented + * as a count of seconds and fractions of seconds at nanosecond + * resolution. It is independent of any calendar and concepts like "day" + * or "month". It is related to Timestamp in that the difference between + * two Timestamp values is a Duration and it can be added or subtracted + * from a Timestamp. Range is approximately +-10,000 years. + * + * # Examples + * + * Example 1: Compute Duration from two Timestamps in pseudo code. + * + * Timestamp start = ...; + * Timestamp end = ...; + * Duration duration = ...; + * + * duration.seconds = end.seconds - start.seconds; + * duration.nanos = end.nanos - start.nanos; + * + * if (duration.seconds < 0 && duration.nanos > 0) { + * duration.seconds += 1; + * duration.nanos -= 1000000000; + * } else if (durations.seconds > 0 && duration.nanos < 0) { + * duration.seconds -= 1; + * duration.nanos += 1000000000; + * } + * + * Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. + * + * Timestamp start = ...; + * Duration duration = ...; + * Timestamp end = ...; + * + * end.seconds = start.seconds + duration.seconds; + * end.nanos = start.nanos + duration.nanos; + * + * if (end.nanos < 0) { + * end.seconds -= 1; + * end.nanos += 1000000000; + * } else if (end.nanos >= 1000000000) { + * end.seconds += 1; + * end.nanos -= 1000000000; + * } + * + * Example 3: Compute Duration from datetime.timedelta in Python. + * + * td = datetime.timedelta(days=3, minutes=10) + * duration = Duration() + * duration.FromTimedelta(td) + * + * # JSON Mapping + * + * In JSON format, the Duration type is encoded as a string rather than an + * object, where the string ends in the suffix "s" (indicating seconds) and + * is preceded by the number of seconds, with nanoseconds expressed as + * fractional seconds. For example, 3 seconds with 0 nanoseconds should be + * encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should + * be expressed in JSON format as "3.000000001s", and 3 seconds and 1 + * microsecond should be expressed in JSON format as "3.000001s". + * + * @property {number} seconds + * Signed seconds of the span of time. Must be from -315,576,000,000 + * to +315,576,000,000 inclusive. Note: these bounds are computed from: + * 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years + * + * @property {number} nanos + * Signed fractions of a second at nanosecond resolution of the span + * of time. Durations less than one second are represented with a 0 + * `seconds` field and a positive or negative `nanos` field. For durations + * of one second or more, a non-zero value for the `nanos` field must be + * of the same sign as the `seconds` field. Must be from -999,999,999 + * to +999,999,999 inclusive. + * + * @typedef Duration + * @memberof google.protobuf + * @see [google.protobuf.Duration definition in proto format]{@link https://github.com/google/protobuf/blob/master/src/google/protobuf/duration.proto} + */ +const Duration = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; \ No newline at end of file diff --git a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/protobuf/doc_field_mask.js b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/protobuf/doc_field_mask.js new file mode 100644 index 00000000000..0cb35328962 --- /dev/null +++ b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/protobuf/doc_field_mask.js @@ -0,0 +1,236 @@ +// Copyright 2018 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Note: this file is purely for documentation. Any contents are not expected +// to be loaded as the JS file. + +/** + * `FieldMask` represents a set of symbolic field paths, for example: + * + * paths: "f.a" + * paths: "f.b.d" + * + * Here `f` represents a field in some root message, `a` and `b` + * fields in the message found in `f`, and `d` a field found in the + * message in `f.b`. + * + * Field masks are used to specify a subset of fields that should be + * returned by a get operation or modified by an update operation. + * Field masks also have a custom JSON encoding (see below). + * + * # Field Masks in Projections + * + * When used in the context of a projection, a response message or + * sub-message is filtered by the API to only contain those fields as + * specified in the mask. For example, if the mask in the previous + * example is applied to a response message as follows: + * + * f { + * a : 22 + * b { + * d : 1 + * x : 2 + * } + * y : 13 + * } + * z: 8 + * + * The result will not contain specific values for fields x,y and z + * (their value will be set to the default, and omitted in proto text + * output): + * + * + * f { + * a : 22 + * b { + * d : 1 + * } + * } + * + * A repeated field is not allowed except at the last position of a + * paths string. + * + * If a FieldMask object is not present in a get operation, the + * operation applies to all fields (as if a FieldMask of all fields + * had been specified). + * + * Note that a field mask does not necessarily apply to the + * top-level response message. In case of a REST get operation, the + * field mask applies directly to the response, but in case of a REST + * list operation, the mask instead applies to each individual message + * in the returned resource list. In case of a REST custom method, + * other definitions may be used. Where the mask applies will be + * clearly documented together with its declaration in the API. In + * any case, the effect on the returned resource/resources is required + * behavior for APIs. + * + * # Field Masks in Update Operations + * + * A field mask in update operations specifies which fields of the + * targeted resource are going to be updated. The API is required + * to only change the values of the fields as specified in the mask + * and leave the others untouched. If a resource is passed in to + * describe the updated values, the API ignores the values of all + * fields not covered by the mask. + * + * If a repeated field is specified for an update operation, the existing + * repeated values in the target resource will be overwritten by the new values. + * Note that a repeated field is only allowed in the last position of a `paths` + * string. + * + * If a sub-message is specified in the last position of the field mask for an + * update operation, then the existing sub-message in the target resource is + * overwritten. Given the target message: + * + * f { + * b { + * d : 1 + * x : 2 + * } + * c : 1 + * } + * + * And an update message: + * + * f { + * b { + * d : 10 + * } + * } + * + * then if the field mask is: + * + * paths: "f.b" + * + * then the result will be: + * + * f { + * b { + * d : 10 + * } + * c : 1 + * } + * + * However, if the update mask was: + * + * paths: "f.b.d" + * + * then the result would be: + * + * f { + * b { + * d : 10 + * x : 2 + * } + * c : 1 + * } + * + * In order to reset a field's value to the default, the field must + * be in the mask and set to the default value in the provided resource. + * Hence, in order to reset all fields of a resource, provide a default + * instance of the resource and set all fields in the mask, or do + * not provide a mask as described below. + * + * If a field mask is not present on update, the operation applies to + * all fields (as if a field mask of all fields has been specified). + * Note that in the presence of schema evolution, this may mean that + * fields the client does not know and has therefore not filled into + * the request will be reset to their default. If this is unwanted + * behavior, a specific service may require a client to always specify + * a field mask, producing an error if not. + * + * As with get operations, the location of the resource which + * describes the updated values in the request message depends on the + * operation kind. In any case, the effect of the field mask is + * required to be honored by the API. + * + * ## Considerations for HTTP REST + * + * The HTTP kind of an update operation which uses a field mask must + * be set to PATCH instead of PUT in order to satisfy HTTP semantics + * (PUT must only be used for full updates). + * + * # JSON Encoding of Field Masks + * + * In JSON, a field mask is encoded as a single string where paths are + * separated by a comma. Fields name in each path are converted + * to/from lower-camel naming conventions. + * + * As an example, consider the following message declarations: + * + * message Profile { + * User user = 1; + * Photo photo = 2; + * } + * message User { + * string display_name = 1; + * string address = 2; + * } + * + * In proto a field mask for `Profile` may look as such: + * + * mask { + * paths: "user.display_name" + * paths: "photo" + * } + * + * In JSON, the same mask is represented as below: + * + * { + * mask: "user.displayName,photo" + * } + * + * # Field Masks and Oneof Fields + * + * Field masks treat fields in oneofs just as regular fields. Consider the + * following message: + * + * message SampleMessage { + * oneof test_oneof { + * string name = 4; + * SubMessage sub_message = 9; + * } + * } + * + * The field mask can be: + * + * mask { + * paths: "name" + * } + * + * Or: + * + * mask { + * paths: "sub_message" + * } + * + * Note that oneof type names ("test_oneof" in this case) cannot be used in + * paths. + * + * ## Field Mask Verification + * + * The implementation of any API method which has a FieldMask type field in the + * request should verify the included field paths, and return an + * `INVALID_ARGUMENT` error if any path is duplicated or unmappable. + * + * @property {string[]} paths + * The set of field mask paths. + * + * @typedef FieldMask + * @memberof google.protobuf + * @see [google.protobuf.FieldMask definition in proto format]{@link https://github.com/google/protobuf/blob/master/src/google/protobuf/field_mask.proto} + */ +const FieldMask = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; \ No newline at end of file diff --git a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/protobuf/doc_struct.js b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/protobuf/doc_struct.js new file mode 100644 index 00000000000..ddf7e5c95dc --- /dev/null +++ b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/protobuf/doc_struct.js @@ -0,0 +1,112 @@ +// Copyright 2018 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Note: this file is purely for documentation. Any contents are not expected +// to be loaded as the JS file. + +/** + * `Struct` represents a structured data value, consisting of fields + * which map to dynamically typed values. In some languages, `Struct` + * might be supported by a native representation. For example, in + * scripting languages like JS a struct is represented as an + * object. The details of that representation are described together + * with the proto support for the language. + * + * The JSON representation for `Struct` is JSON object. + * + * @property {Object.} fields + * Unordered map of dynamically typed values. + * + * @typedef Struct + * @memberof google.protobuf + * @see [google.protobuf.Struct definition in proto format]{@link https://github.com/google/protobuf/blob/master/src/google/protobuf/struct.proto} + */ +const Struct = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * `Value` represents a dynamically typed value which can be either + * null, a number, a string, a boolean, a recursive struct value, or a + * list of values. A producer of value is expected to set one of that + * variants, absence of any variant indicates an error. + * + * The JSON representation for `Value` is JSON value. + * + * @property {number} nullValue + * Represents a null value. + * + * The number should be among the values of [NullValue]{@link google.protobuf.NullValue} + * + * @property {number} numberValue + * Represents a double value. + * + * @property {string} stringValue + * Represents a string value. + * + * @property {boolean} boolValue + * Represents a boolean value. + * + * @property {Object} structValue + * Represents a structured value. + * + * This object should have the same structure as [Struct]{@link google.protobuf.Struct} + * + * @property {Object} listValue + * Represents a repeated `Value`. + * + * This object should have the same structure as [ListValue]{@link google.protobuf.ListValue} + * + * @typedef Value + * @memberof google.protobuf + * @see [google.protobuf.Value definition in proto format]{@link https://github.com/google/protobuf/blob/master/src/google/protobuf/struct.proto} + */ +const Value = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * `ListValue` is a wrapper around a repeated field of values. + * + * The JSON representation for `ListValue` is JSON array. + * + * @property {Object[]} values + * Repeated field of dynamically typed values. + * + * This object should have the same structure as [Value]{@link google.protobuf.Value} + * + * @typedef ListValue + * @memberof google.protobuf + * @see [google.protobuf.ListValue definition in proto format]{@link https://github.com/google/protobuf/blob/master/src/google/protobuf/struct.proto} + */ +const ListValue = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * `NullValue` is a singleton enumeration to represent the null value for the + * `Value` type union. + * + * The JSON representation for `NullValue` is JSON `null`. + * + * @enum {number} + * @memberof google.protobuf + */ +const NullValue = { + + /** + * Null value. + */ + NULL_VALUE: 0 +}; \ No newline at end of file diff --git a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/protobuf/doc_timestamp.js b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/protobuf/doc_timestamp.js new file mode 100644 index 00000000000..1ebe2e6e1a5 --- /dev/null +++ b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/protobuf/doc_timestamp.js @@ -0,0 +1,115 @@ +// Copyright 2018 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Note: this file is purely for documentation. Any contents are not expected +// to be loaded as the JS file. + +/** + * A Timestamp represents a point in time independent of any time zone + * or calendar, represented as seconds and fractions of seconds at + * nanosecond resolution in UTC Epoch time. It is encoded using the + * Proleptic Gregorian Calendar which extends the Gregorian calendar + * backwards to year one. It is encoded assuming all minutes are 60 + * seconds long, i.e. leap seconds are "smeared" so that no leap second + * table is needed for interpretation. Range is from + * 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. + * By restricting to that range, we ensure that we can convert to + * and from RFC 3339 date strings. + * See [https://www.ietf.org/rfc/rfc3339.txt](https://www.ietf.org/rfc/rfc3339.txt). + * + * # Examples + * + * Example 1: Compute Timestamp from POSIX `time()`. + * + * Timestamp timestamp; + * timestamp.set_seconds(time(NULL)); + * timestamp.set_nanos(0); + * + * Example 2: Compute Timestamp from POSIX `gettimeofday()`. + * + * struct timeval tv; + * gettimeofday(&tv, NULL); + * + * Timestamp timestamp; + * timestamp.set_seconds(tv.tv_sec); + * timestamp.set_nanos(tv.tv_usec * 1000); + * + * Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + * + * FILETIME ft; + * GetSystemTimeAsFileTime(&ft); + * UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + * + * // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + * // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + * Timestamp timestamp; + * timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + * timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + * + * Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + * + * long millis = System.currentTimeMillis(); + * + * Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + * .setNanos((int) ((millis % 1000) * 1000000)).build(); + * + * + * Example 5: Compute Timestamp from current time in Python. + * + * timestamp = Timestamp() + * timestamp.GetCurrentTime() + * + * # JSON Mapping + * + * In JSON format, the Timestamp type is encoded as a string in the + * [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the + * format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" + * where {year} is always expressed using four digits while {month}, {day}, + * {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional + * seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), + * are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone + * is required. A proto3 JSON serializer should always use UTC (as indicated by + * "Z") when printing the Timestamp type and a proto3 JSON parser should be + * able to accept both UTC and other timezones (as indicated by an offset). + * + * For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past + * 01:30 UTC on January 15, 2017. + * + * In JavaScript, one can convert a Date object to this format using the + * standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString] + * method. In Python, a standard `datetime.datetime` object can be converted + * to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) + * with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one + * can use the Joda Time's [`ISODateTimeFormat.dateTime()`](https://cloud.google.com + * http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime-- + * ) to obtain a formatter capable of generating timestamps in this format. + * + * @property {number} seconds + * Represents seconds of UTC time since Unix epoch + * 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to + * 9999-12-31T23:59:59Z inclusive. + * + * @property {number} nanos + * Non-negative fractions of a second at nanosecond resolution. Negative + * second values with fractions must still have non-negative nanos values + * that count forward in time. Must be from 0 to 999,999,999 + * inclusive. + * + * @typedef Timestamp + * @memberof google.protobuf + * @see [google.protobuf.Timestamp definition in proto format]{@link https://github.com/google/protobuf/blob/master/src/google/protobuf/timestamp.proto} + */ +const Timestamp = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; \ No newline at end of file diff --git a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/rpc/doc_status.js b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/rpc/doc_status.js new file mode 100644 index 00000000000..13cfcab1021 --- /dev/null +++ b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/rpc/doc_status.js @@ -0,0 +1,92 @@ +// Copyright 2018 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Note: this file is purely for documentation. Any contents are not expected +// to be loaded as the JS file. + +/** + * The `Status` type defines a logical error model that is suitable for different + * programming environments, including REST APIs and RPC APIs. It is used by + * [gRPC](https://github.com/grpc). The error model is designed to be: + * + * - Simple to use and understand for most users + * - Flexible enough to meet unexpected needs + * + * # Overview + * + * The `Status` message contains three pieces of data: error code, error message, + * and error details. The error code should be an enum value of + * google.rpc.Code, but it may accept additional error codes if needed. The + * error message should be a developer-facing English message that helps + * developers *understand* and *resolve* the error. If a localized user-facing + * error message is needed, put the localized message in the error details or + * localize it in the client. The optional error details may contain arbitrary + * information about the error. There is a predefined set of error detail types + * in the package `google.rpc` that can be used for common error conditions. + * + * # Language mapping + * + * The `Status` message is the logical representation of the error model, but it + * is not necessarily the actual wire format. When the `Status` message is + * exposed in different client libraries and different wire protocols, it can be + * mapped differently. For example, it will likely be mapped to some exceptions + * in Java, but more likely mapped to some error codes in C. + * + * # Other uses + * + * The error model and the `Status` message can be used in a variety of + * environments, either with or without APIs, to provide a + * consistent developer experience across different environments. + * + * Example uses of this error model include: + * + * - Partial errors. If a service needs to return partial errors to the client, + * it may embed the `Status` in the normal response to indicate the partial + * errors. + * + * - Workflow errors. A typical workflow has multiple steps. Each step may + * have a `Status` message for error reporting. + * + * - Batch operations. If a client uses batch request and batch response, the + * `Status` message should be used directly inside batch response, one for + * each error sub-response. + * + * - Asynchronous operations. If an API call embeds asynchronous operation + * results in its response, the status of those operations should be + * represented directly using the `Status` message. + * + * - Logging. If some API errors are stored in logs, the message `Status` could + * be used directly after any stripping needed for security/privacy reasons. + * + * @property {number} code + * The status code, which should be an enum value of google.rpc.Code. + * + * @property {string} message + * A developer-facing error message, which should be in English. Any + * user-facing error message should be localized and sent in the + * google.rpc.Status.details field, or localized by the client. + * + * @property {Object[]} details + * A list of messages that carry the error details. There is a common set of + * message types for APIs to use. + * + * This object should have the same structure as [Any]{@link google.protobuf.Any} + * + * @typedef Status + * @memberof google.rpc + * @see [google.rpc.Status definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/rpc/status.proto} + */ +const Status = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; \ No newline at end of file diff --git a/packages/google-cloud-securitycenter/src/v1beta1/index.js b/packages/google-cloud-securitycenter/src/v1beta1/index.js new file mode 100644 index 00000000000..2577d795a82 --- /dev/null +++ b/packages/google-cloud-securitycenter/src/v1beta1/index.js @@ -0,0 +1,19 @@ +// Copyright 2018 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT 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"; + +const SecurityCenterClient = require("./security_center_client"); + +module.exports.SecurityCenterClient = SecurityCenterClient; diff --git a/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.js b/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.js new file mode 100644 index 00000000000..ac54f838c13 --- /dev/null +++ b/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.js @@ -0,0 +1,2523 @@ +// Copyright 2018 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT 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"; + +const gapicConfig = require("./security_center_client_config"); +const gax = require("google-gax"); +const merge = require("lodash.merge"); +const path = require("path"); +const protobuf = require("protobufjs"); + +const VERSION = require("../../package.json").version; + +/** + * V1 Beta APIs for Security Center service. + * + * @class + * @memberof v1beta1 + */ +class SecurityCenterClient { + /** + * Construct an instance of SecurityCenterClient. + * + * @param {object} [options] - The configuration object. See the subsequent + * parameters for more details. + * @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 {function} [options.promise] - Custom promise module to use instead + * of native Promises. + * @param {string} [options.servicePath] - The domain name of the + * API remote host. + */ + constructor(opts) { + this._descriptors = {}; + + // Ensure that options include the service address and port. + opts = Object.assign( + { + clientConfig: {}, + port: this.constructor.port, + servicePath: this.constructor.servicePath + }, + opts + ); + + // Create a `gaxGrpc` object, with any grpc-specific options + // sent to the client. + opts.scopes = this.constructor.scopes; + const gaxGrpc = new gax.GrpcClient(opts); + + // Save the auth object to the client, for use by other methods. + this.auth = gaxGrpc.auth; + + // Determine the client header string. + const clientHeader = [ + `gl-node/${process.version}`, + `grpc/${gaxGrpc.grpcVersion}`, + `gax/${gax.version}`, + `gapic/${VERSION}` + ]; + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + + // Load the applicable protos. + const protos = merge( + {}, + gaxGrpc.loadProto( + path.join(__dirname, "..", "..", "protos"), + "google/cloud/securitycenter/v1beta1/securitycenter_service.proto" + ) + ); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this._pathTemplates = { + organizationPathTemplate: new gax.PathTemplate( + "organizations/{organization}" + ), + sourcePathTemplate: new gax.PathTemplate( + "organizations/{organization}/sources/{source}" + ), + organizationSettingsPathTemplate: new gax.PathTemplate( + "organizations/{organization}/organizationSettings" + ), + findingPathTemplate: new gax.PathTemplate( + "organizations/{organization}/sources/{source}/findings/{finding}" + ), + assetSecurityMarksPathTemplate: new gax.PathTemplate( + "organizations/{organization}/assets/{asset}/securityMarks" + ) + }; + + // Some of the methods on this service return "paged" results, + // (e.g. 50 results at a time, with tokens to get subsequent + // pages). Denote the keys used for pagination and results. + this._descriptors.page = { + groupAssets: new gax.PageDescriptor( + "pageToken", + "nextPageToken", + "groupByResults" + ), + groupFindings: new gax.PageDescriptor( + "pageToken", + "nextPageToken", + "groupByResults" + ), + listAssets: new gax.PageDescriptor( + "pageToken", + "nextPageToken", + "listAssetsResults" + ), + listFindings: new gax.PageDescriptor( + "pageToken", + "nextPageToken", + "findings" + ), + listSources: new gax.PageDescriptor( + "pageToken", + "nextPageToken", + "sources" + ) + }; + let protoFilesRoot = new gax.GoogleProtoFilesRoot(); + protoFilesRoot = protobuf.loadSync( + path.join( + __dirname, + "..", + "..", + "protos", + "google/cloud/securitycenter/v1beta1/securitycenter_service.proto" + ), + protoFilesRoot + ); + + // This API contains "long-running operations", which return a + // an Operation object that allows for tracking of the operation, + // rather than holding a request open. + this.operationsClient = new gax.lro({ + auth: gaxGrpc.auth, + grpc: gaxGrpc.grpc + }).operationsClient(opts); + + const runAssetDiscoveryResponse = protoFilesRoot.lookup( + "google.protobuf.Empty" + ); + const runAssetDiscoveryMetadata = protoFilesRoot.lookup( + "google.protobuf.Empty" + ); + + this._descriptors.longrunning = { + runAssetDiscovery: new gax.LongrunningDescriptor( + this.operationsClient, + runAssetDiscoveryResponse.decode.bind(runAssetDiscoveryResponse), + runAssetDiscoveryMetadata.decode.bind(runAssetDiscoveryMetadata) + ) + }; + + // Put together the default options sent with requests. + const defaults = gaxGrpc.constructSettings( + "google.cloud.securitycenter.v1beta1.SecurityCenter", + gapicConfig, + 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 = {}; + + // Put together the "service stub" for + // google.cloud.securitycenter.v1beta1.SecurityCenter. + const securityCenterStub = gaxGrpc.createStub( + protos.google.cloud.securitycenter.v1beta1.SecurityCenter, + opts + ); + + // Iterate over each of the methods that the service provides + // and create an API call method for each. + const securityCenterStubMethods = [ + "createSource", + "createFinding", + "getIamPolicy", + "getOrganizationSettings", + "getSource", + "groupAssets", + "groupFindings", + "listAssets", + "listFindings", + "listSources", + "runAssetDiscovery", + "setFindingState", + "setIamPolicy", + "testIamPermissions", + "updateFinding", + "updateOrganizationSettings", + "updateSource", + "updateSecurityMarks" + ]; + for (const methodName of securityCenterStubMethods) { + this._innerApiCalls[methodName] = gax.createApiCall( + securityCenterStub.then( + stub => + function() { + const args = Array.prototype.slice.call(arguments, 0); + return stub[methodName].apply(stub, args); + } + ), + defaults[methodName], + this._descriptors.page[methodName] || + this._descriptors.longrunning[methodName] + ); + } + } + + /** + * The DNS address for this API service. + */ + static get servicePath() { + return "securitycenter.googleapis.com"; + } + + /** + * The port for this API service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + */ + static get scopes() { + return ["https://www.googleapis.com/auth/cloud-platform"]; + } + + /** + * Return the project ID used by this class. + * @param {function(Error, string)} callback - the callback to + * be called with the current project Id. + */ + getProjectId(callback) { + return this.auth.getProjectId(callback); + } + + // ------------------- + // -- Service calls -- + // ------------------- + + /** + * Creates a source. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Resource name of the new source's parent. Its format should be + * "organizations/[organization_id]". + * @param {Object} request.source + * The Source being created, only the display_name and description will be + * used. All other fields will be ignored. + * + * This object should have the same structure as [Source]{@link google.cloud.securitycenter.v1beta1.Source} + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing [Source]{@link google.cloud.securitycenter.v1beta1.Source}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Source]{@link google.cloud.securitycenter.v1beta1.Source}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + * @example + * + * const securitycenter = require('securitycenter.v1beta1'); + * + * const client = new securitycenter.v1beta1.SecurityCenterClient({ + * // optional auth parameters. + * }); + * + * const formattedParent = client.organizationPath('[ORGANIZATION]'); + * const source = {}; + * const request = { + * parent: formattedParent, + * source: source, + * }; + * client.createSource(request) + * .then(responses => { + * const response = responses[0]; + * // doThingsWith(response) + * }) + * .catch(err => { + * console.error(err); + * }); + */ + createSource(request, options, callback) { + if (options instanceof Function && callback === undefined) { + callback = options; + options = {}; + } + options = options || {}; + + return this._innerApiCalls.createSource(request, options, callback); + } + + /** + * Creates a finding. The corresponding source must exist for finding creation + * to succeed. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Resource name of the new finding's parent. Its format should be + * "organizations/[organization_id]/sources/[source_id]". + * @param {string} request.findingId + * Unique identifier provided by the client within the parent scope. + * It must be alphanumeric and less than or equal to 32 characters and + * greater than 0 characters in length. + * @param {Object} request.finding + * The Finding being created. The name and security_marks will be ignored as + * they are both output only fields on this resource. + * + * This object should have the same structure as [Finding]{@link google.cloud.securitycenter.v1beta1.Finding} + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing [Finding]{@link google.cloud.securitycenter.v1beta1.Finding}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Finding]{@link google.cloud.securitycenter.v1beta1.Finding}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + * @example + * + * const securitycenter = require('securitycenter.v1beta1'); + * + * const client = new securitycenter.v1beta1.SecurityCenterClient({ + * // optional auth parameters. + * }); + * + * const formattedParent = client.sourcePath('[ORGANIZATION]', '[SOURCE]'); + * const findingId = ''; + * const finding = {}; + * const request = { + * parent: formattedParent, + * findingId: findingId, + * finding: finding, + * }; + * client.createFinding(request) + * .then(responses => { + * const response = responses[0]; + * // doThingsWith(response) + * }) + * .catch(err => { + * console.error(err); + * }); + */ + createFinding(request, options, callback) { + if (options instanceof Function && callback === undefined) { + callback = options; + options = {}; + } + options = options || {}; + + return this._innerApiCalls.createFinding(request, options, callback); + } + + /** + * Gets the access control policy on the specified Source. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy is being requested. + * `resource` is usually specified as a path. For example, a Project + * resource is specified as `projects/{project}`. + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing [Policy]{@link google.iam.v1.Policy}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Policy]{@link google.iam.v1.Policy}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + * @example + * + * const securitycenter = require('securitycenter.v1beta1'); + * + * const client = new securitycenter.v1beta1.SecurityCenterClient({ + * // optional auth parameters. + * }); + * + * const formattedResource = client.sourcePath('[ORGANIZATION]', '[SOURCE]'); + * client.getIamPolicy({resource: formattedResource}) + * .then(responses => { + * const response = responses[0]; + * // doThingsWith(response) + * }) + * .catch(err => { + * console.error(err); + * }); + */ + getIamPolicy(request, options, callback) { + if (options instanceof Function && callback === undefined) { + callback = options; + options = {}; + } + options = options || {}; + + return this._innerApiCalls.getIamPolicy(request, options, callback); + } + + /** + * Gets the settings for an organization. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Name of the organization to get organization settings for. Its format is + * "organizations/[organization_id]/organizationSettings". + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing [OrganizationSettings]{@link google.cloud.securitycenter.v1beta1.OrganizationSettings}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [OrganizationSettings]{@link google.cloud.securitycenter.v1beta1.OrganizationSettings}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + * @example + * + * const securitycenter = require('securitycenter.v1beta1'); + * + * const client = new securitycenter.v1beta1.SecurityCenterClient({ + * // optional auth parameters. + * }); + * + * const formattedName = client.organizationSettingsPath('[ORGANIZATION]'); + * client.getOrganizationSettings({name: formattedName}) + * .then(responses => { + * const response = responses[0]; + * // doThingsWith(response) + * }) + * .catch(err => { + * console.error(err); + * }); + */ + getOrganizationSettings(request, options, callback) { + if (options instanceof Function && callback === undefined) { + callback = options; + options = {}; + } + options = options || {}; + + return this._innerApiCalls.getOrganizationSettings( + request, + options, + callback + ); + } + + /** + * Gets a source. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Relative resource name of the source. Its format is + * "organizations/[organization_id]/source/[source_id]". + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing [Source]{@link google.cloud.securitycenter.v1beta1.Source}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Source]{@link google.cloud.securitycenter.v1beta1.Source}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + * @example + * + * const securitycenter = require('securitycenter.v1beta1'); + * + * const client = new securitycenter.v1beta1.SecurityCenterClient({ + * // optional auth parameters. + * }); + * + * const formattedName = client.sourcePath('[ORGANIZATION]', '[SOURCE]'); + * client.getSource({name: formattedName}) + * .then(responses => { + * const response = responses[0]; + * // doThingsWith(response) + * }) + * .catch(err => { + * console.error(err); + * }); + */ + getSource(request, options, callback) { + if (options instanceof Function && callback === undefined) { + callback = options; + options = {}; + } + options = options || {}; + + return this._innerApiCalls.getSource(request, options, callback); + } + + /** + * Filters an organization's assets and groups them by their specified + * properties. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Name of the organization to groupBy. Its format is + * "organizations/[organization_id]". + * @param {string} request.groupBy + * Expression that defines what assets fields to use for grouping. The string + * value should follow SQL syntax: comma separated list of fields. For + * example: + * "security_center_properties.resource_project,security_center_properties.project". + * + * The following fields are supported when compare_duration is not set: + * + * * security_center_properties.resource_name + * * security_center_properties.resource_project + * * security_center_properties.resource_type + * * security_center_properties.resource_parent + * + * The following fields are supported when compare_duration is set: + * + * * security_center_properties.resource_type + * @param {string} [request.filter] + * Expression that defines the filter to apply across assets. + * The expression is a list of zero or more restrictions combined via logical + * operators `AND` and `OR`. + * Parentheses are not supported, and `OR` has higher precedence than `AND`. + * + * Restrictions have the form ` ` and may have a `-` + * character in front of them to indicate negation. The fields map to those + * defined in the Asset resource. Examples include: + * + * * name + * * security_center_properties.resource_name + * * resource_properties.a_property + * * security_marks.marks.marka + * + * The supported operators are: + * + * * `=` for all value types. + * * `>`, `<`, `>=`, `<=` for integer values. + * * `:`, meaning substring matching, for strings. + * + * The supported value types are: + * + * * string literals in quotes. + * * integer literals without quotes. + * * boolean literals `true` and `false` without quotes. + * + * For example, `resource_properties.size = 100` is a valid filter string. + * @param {Object} [request.compareDuration] + * When compare_duration is set, the Asset's "state" property is updated to + * indicate whether the asset was added, removed, or remained present during + * the compare_duration period of time that precedes the read_time. This is + * the time between (read_time - compare_duration) and read_time. + * + * The state value is derived based on the presence of the asset at the two + * points in time. Intermediate state changes between the two times don't + * affect the result. For example, the results aren't affected if the asset is + * removed and re-created again. + * + * Possible "state" values when compare_duration is specified: + * + * * "ADDED": indicates that the asset was not present before + * compare_duration, but present at reference_time. + * * "REMOVED": indicates that the asset was present at the start of + * compare_duration, but not present at reference_time. + * * "ACTIVE_AT_BOTH": indicates that the asset was present at both the + * start and the end of the time period defined by + * compare_duration and reference_time. + * + * This field is ignored if `state` is not a field in `group_by`. + * + * This object should have the same structure as [Duration]{@link google.protobuf.Duration} + * @param {Object} [request.readTime] + * Time used as a reference point when filtering assets. The filter is limited + * to assets existing at the supplied time and their values are those at that + * specific time. Absence of this field will default to the API's version of + * NOW. + * + * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} + * @param {number} [request.pageSize] + * The maximum number of resources contained in the underlying API + * response. If page streaming is performed per-resource, this + * parameter does not affect the return value. If page streaming is + * performed per-page, this determines the maximum number of + * resources in a page. + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. + * @param {function(?Error, ?Array, ?Object, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is Array of [GroupResult]{@link google.cloud.securitycenter.v1beta1.GroupResult}. + * + * When autoPaginate: false is specified through options, it contains the result + * in a single response. If the response indicates the next page exists, the third + * parameter is set to be used for the next request object. The fourth parameter keeps + * the raw response object of an object representing [GroupAssetsResponse]{@link google.cloud.securitycenter.v1beta1.GroupAssetsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [GroupResult]{@link google.cloud.securitycenter.v1beta1.GroupResult}. + * + * When autoPaginate: false is specified through options, the array has three elements. + * The first element is Array of [GroupResult]{@link google.cloud.securitycenter.v1beta1.GroupResult} in a single response. + * The second element is the next request object if the response + * indicates the next page exists, or null. The third element is + * an object representing [GroupAssetsResponse]{@link google.cloud.securitycenter.v1beta1.GroupAssetsResponse}. + * + * The promise has a method named "cancel" which cancels the ongoing API call. + * + * @example + * + * const securitycenter = require('securitycenter.v1beta1'); + * + * const client = new securitycenter.v1beta1.SecurityCenterClient({ + * // optional auth parameters. + * }); + * + * // Iterate over all elements. + * const formattedParent = client.organizationPath('[ORGANIZATION]'); + * const groupBy = ''; + * const request = { + * parent: formattedParent, + * groupBy: groupBy, + * }; + * + * client.groupAssets(request) + * .then(responses => { + * const resources = responses[0]; + * for (let i = 0; i < resources.length; i += 1) { + * // doThingsWith(resources[i]) + * } + * }) + * .catch(err => { + * console.error(err); + * }); + * + * // Or obtain the paged response. + * const formattedParent = client.organizationPath('[ORGANIZATION]'); + * const groupBy = ''; + * const request = { + * parent: formattedParent, + * groupBy: groupBy, + * }; + * + * + * const options = {autoPaginate: false}; + * const callback = responses => { + * // The actual resources in a response. + * const resources = responses[0]; + * // The next request if the response shows that there are more responses. + * const nextRequest = responses[1]; + * // The actual response object, if necessary. + * // const rawResponse = responses[2]; + * for (let i = 0; i < resources.length; i += 1) { + * // doThingsWith(resources[i]); + * } + * if (nextRequest) { + * // Fetch the next page. + * return client.groupAssets(nextRequest, options).then(callback); + * } + * } + * client.groupAssets(request, options) + * .then(callback) + * .catch(err => { + * console.error(err); + * }); + */ + groupAssets(request, options, callback) { + if (options instanceof Function && callback === undefined) { + callback = options; + options = {}; + } + options = options || {}; + + return this._innerApiCalls.groupAssets(request, options, callback); + } + + /** + * Equivalent to {@link groupAssets}, but returns a NodeJS Stream object. + * + * This fetches the paged responses for {@link groupAssets} continuously + * and invokes the callback registered for 'data' event for each element in the + * responses. + * + * The returned object has 'end' method when no more elements are required. + * + * autoPaginate option will be ignored. + * + * @see {@link https://nodejs.org/api/stream.html} + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Name of the organization to groupBy. Its format is + * "organizations/[organization_id]". + * @param {string} request.groupBy + * Expression that defines what assets fields to use for grouping. The string + * value should follow SQL syntax: comma separated list of fields. For + * example: + * "security_center_properties.resource_project,security_center_properties.project". + * + * The following fields are supported when compare_duration is not set: + * + * * security_center_properties.resource_name + * * security_center_properties.resource_project + * * security_center_properties.resource_type + * * security_center_properties.resource_parent + * + * The following fields are supported when compare_duration is set: + * + * * security_center_properties.resource_type + * @param {string} [request.filter] + * Expression that defines the filter to apply across assets. + * The expression is a list of zero or more restrictions combined via logical + * operators `AND` and `OR`. + * Parentheses are not supported, and `OR` has higher precedence than `AND`. + * + * Restrictions have the form ` ` and may have a `-` + * character in front of them to indicate negation. The fields map to those + * defined in the Asset resource. Examples include: + * + * * name + * * security_center_properties.resource_name + * * resource_properties.a_property + * * security_marks.marks.marka + * + * The supported operators are: + * + * * `=` for all value types. + * * `>`, `<`, `>=`, `<=` for integer values. + * * `:`, meaning substring matching, for strings. + * + * The supported value types are: + * + * * string literals in quotes. + * * integer literals without quotes. + * * boolean literals `true` and `false` without quotes. + * + * For example, `resource_properties.size = 100` is a valid filter string. + * @param {Object} [request.compareDuration] + * When compare_duration is set, the Asset's "state" property is updated to + * indicate whether the asset was added, removed, or remained present during + * the compare_duration period of time that precedes the read_time. This is + * the time between (read_time - compare_duration) and read_time. + * + * The state value is derived based on the presence of the asset at the two + * points in time. Intermediate state changes between the two times don't + * affect the result. For example, the results aren't affected if the asset is + * removed and re-created again. + * + * Possible "state" values when compare_duration is specified: + * + * * "ADDED": indicates that the asset was not present before + * compare_duration, but present at reference_time. + * * "REMOVED": indicates that the asset was present at the start of + * compare_duration, but not present at reference_time. + * * "ACTIVE_AT_BOTH": indicates that the asset was present at both the + * start and the end of the time period defined by + * compare_duration and reference_time. + * + * This field is ignored if `state` is not a field in `group_by`. + * + * This object should have the same structure as [Duration]{@link google.protobuf.Duration} + * @param {Object} [request.readTime] + * Time used as a reference point when filtering assets. The filter is limited + * to assets existing at the supplied time and their values are those at that + * specific time. Absence of this field will default to the API's version of + * NOW. + * + * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} + * @param {number} [request.pageSize] + * The maximum number of resources contained in the underlying API + * response. If page streaming is performed per-resource, this + * parameter does not affect the return value. If page streaming is + * performed per-page, this determines the maximum number of + * resources in a page. + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. + * @returns {Stream} + * An object stream which emits an object representing [GroupResult]{@link google.cloud.securitycenter.v1beta1.GroupResult} on 'data' event. + * + * @example + * + * const securitycenter = require('securitycenter.v1beta1'); + * + * const client = new securitycenter.v1beta1.SecurityCenterClient({ + * // optional auth parameters. + * }); + * + * const formattedParent = client.organizationPath('[ORGANIZATION]'); + * const groupBy = ''; + * const request = { + * parent: formattedParent, + * groupBy: groupBy, + * }; + * client.groupAssetsStream(request) + * .on('data', element => { + * // doThingsWith(element) + * }).on('error', err => { + * console.log(err); + * }); + */ + groupAssetsStream(request, options) { + options = options || {}; + + return this._descriptors.page.groupAssets.createStream( + this._innerApiCalls.groupAssets, + request, + options + ); + } + + /** + * Filters an organization or source's findings and groups them by their + * specified properties. + * + * To group across all sources provide a `-` as the source id. + * Example: /v1beta1/organizations/123/sources/-/findings + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Name of the source to groupBy. Its format is + * "organizations/[organization_id]/sources/[source_id]". To groupBy across + * all sources provide a source_id of `-`. For example: + * organizations/123/sources/- + * @param {string} request.groupBy + * Expression that defines what assets fields to use for grouping (including + * `state`). The string value should follow SQL syntax: comma separated list + * of fields. For example: + * "parent,resource_name". + * + * The following fields are supported: + * + * * resource_name + * * category + * * state + * * parent + * @param {string} [request.filter] + * Expression that defines the filter to apply across findings. + * The expression is a list of one or more restrictions combined via logical + * operators `AND` and `OR`. + * Parentheses are not supported, and `OR` has higher precedence than `AND`. + * + * Restrictions have the form ` ` and may have a `-` + * character in front of them to indicate negation. Examples include: + * + * * name + * * source_properties.a_property + * * security_marks.marks.marka + * + * The supported operators are: + * + * * `=` for all value types. + * * `>`, `<`, `>=`, `<=` for integer values. + * * `:`, meaning substring matching, for strings. + * + * The supported value types are: + * + * * string literals in quotes. + * * integer literals without quotes. + * * boolean literals `true` and `false` without quotes. + * + * For example, `source_properties.size = 100` is a valid filter string. + * @param {Object} [request.readTime] + * Time used as a reference point when filtering findings. The filter is + * limited to findings existing at the supplied time and their values are + * those at that specific time. Absence of this field will default to the + * API's version of NOW. + * + * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} + * @param {number} [request.pageSize] + * The maximum number of resources contained in the underlying API + * response. If page streaming is performed per-resource, this + * parameter does not affect the return value. If page streaming is + * performed per-page, this determines the maximum number of + * resources in a page. + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. + * @param {function(?Error, ?Array, ?Object, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is Array of [GroupResult]{@link google.cloud.securitycenter.v1beta1.GroupResult}. + * + * When autoPaginate: false is specified through options, it contains the result + * in a single response. If the response indicates the next page exists, the third + * parameter is set to be used for the next request object. The fourth parameter keeps + * the raw response object of an object representing [GroupFindingsResponse]{@link google.cloud.securitycenter.v1beta1.GroupFindingsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [GroupResult]{@link google.cloud.securitycenter.v1beta1.GroupResult}. + * + * When autoPaginate: false is specified through options, the array has three elements. + * The first element is Array of [GroupResult]{@link google.cloud.securitycenter.v1beta1.GroupResult} in a single response. + * The second element is the next request object if the response + * indicates the next page exists, or null. The third element is + * an object representing [GroupFindingsResponse]{@link google.cloud.securitycenter.v1beta1.GroupFindingsResponse}. + * + * The promise has a method named "cancel" which cancels the ongoing API call. + * + * @example + * + * const securitycenter = require('securitycenter.v1beta1'); + * + * const client = new securitycenter.v1beta1.SecurityCenterClient({ + * // optional auth parameters. + * }); + * + * // Iterate over all elements. + * const formattedParent = client.sourcePath('[ORGANIZATION]', '[SOURCE]'); + * const groupBy = ''; + * const request = { + * parent: formattedParent, + * groupBy: groupBy, + * }; + * + * client.groupFindings(request) + * .then(responses => { + * const resources = responses[0]; + * for (let i = 0; i < resources.length; i += 1) { + * // doThingsWith(resources[i]) + * } + * }) + * .catch(err => { + * console.error(err); + * }); + * + * // Or obtain the paged response. + * const formattedParent = client.sourcePath('[ORGANIZATION]', '[SOURCE]'); + * const groupBy = ''; + * const request = { + * parent: formattedParent, + * groupBy: groupBy, + * }; + * + * + * const options = {autoPaginate: false}; + * const callback = responses => { + * // The actual resources in a response. + * const resources = responses[0]; + * // The next request if the response shows that there are more responses. + * const nextRequest = responses[1]; + * // The actual response object, if necessary. + * // const rawResponse = responses[2]; + * for (let i = 0; i < resources.length; i += 1) { + * // doThingsWith(resources[i]); + * } + * if (nextRequest) { + * // Fetch the next page. + * return client.groupFindings(nextRequest, options).then(callback); + * } + * } + * client.groupFindings(request, options) + * .then(callback) + * .catch(err => { + * console.error(err); + * }); + */ + groupFindings(request, options, callback) { + if (options instanceof Function && callback === undefined) { + callback = options; + options = {}; + } + options = options || {}; + + return this._innerApiCalls.groupFindings(request, options, callback); + } + + /** + * Equivalent to {@link groupFindings}, but returns a NodeJS Stream object. + * + * This fetches the paged responses for {@link groupFindings} continuously + * and invokes the callback registered for 'data' event for each element in the + * responses. + * + * The returned object has 'end' method when no more elements are required. + * + * autoPaginate option will be ignored. + * + * @see {@link https://nodejs.org/api/stream.html} + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Name of the source to groupBy. Its format is + * "organizations/[organization_id]/sources/[source_id]". To groupBy across + * all sources provide a source_id of `-`. For example: + * organizations/123/sources/- + * @param {string} request.groupBy + * Expression that defines what assets fields to use for grouping (including + * `state`). The string value should follow SQL syntax: comma separated list + * of fields. For example: + * "parent,resource_name". + * + * The following fields are supported: + * + * * resource_name + * * category + * * state + * * parent + * @param {string} [request.filter] + * Expression that defines the filter to apply across findings. + * The expression is a list of one or more restrictions combined via logical + * operators `AND` and `OR`. + * Parentheses are not supported, and `OR` has higher precedence than `AND`. + * + * Restrictions have the form ` ` and may have a `-` + * character in front of them to indicate negation. Examples include: + * + * * name + * * source_properties.a_property + * * security_marks.marks.marka + * + * The supported operators are: + * + * * `=` for all value types. + * * `>`, `<`, `>=`, `<=` for integer values. + * * `:`, meaning substring matching, for strings. + * + * The supported value types are: + * + * * string literals in quotes. + * * integer literals without quotes. + * * boolean literals `true` and `false` without quotes. + * + * For example, `source_properties.size = 100` is a valid filter string. + * @param {Object} [request.readTime] + * Time used as a reference point when filtering findings. The filter is + * limited to findings existing at the supplied time and their values are + * those at that specific time. Absence of this field will default to the + * API's version of NOW. + * + * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} + * @param {number} [request.pageSize] + * The maximum number of resources contained in the underlying API + * response. If page streaming is performed per-resource, this + * parameter does not affect the return value. If page streaming is + * performed per-page, this determines the maximum number of + * resources in a page. + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. + * @returns {Stream} + * An object stream which emits an object representing [GroupResult]{@link google.cloud.securitycenter.v1beta1.GroupResult} on 'data' event. + * + * @example + * + * const securitycenter = require('securitycenter.v1beta1'); + * + * const client = new securitycenter.v1beta1.SecurityCenterClient({ + * // optional auth parameters. + * }); + * + * const formattedParent = client.sourcePath('[ORGANIZATION]', '[SOURCE]'); + * const groupBy = ''; + * const request = { + * parent: formattedParent, + * groupBy: groupBy, + * }; + * client.groupFindingsStream(request) + * .on('data', element => { + * // doThingsWith(element) + * }).on('error', err => { + * console.log(err); + * }); + */ + groupFindingsStream(request, options) { + options = options || {}; + + return this._descriptors.page.groupFindings.createStream( + this._innerApiCalls.groupFindings, + request, + options + ); + } + + /** + * Lists an organization's assets. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Name of the organization assets should belong to. Its format is + * "organizations/[organization_id]". + * @param {string} [request.filter] + * Expression that defines the filter to apply across assets. + * The expression is a list of zero or more restrictions combined via logical + * operators `AND` and `OR`. + * Parentheses are not supported, and `OR` has higher precedence than `AND`. + * + * Restrictions have the form ` ` and may have a `-` + * character in front of them to indicate negation. The fields map to those + * defined in the Asset resource. Examples include: + * + * * name + * * security_center_properties.resource_name + * * resource_properties.a_property + * * security_marks.marks.marka + * + * The supported operators are: + * + * * `=` for all value types. + * * `>`, `<`, `>=`, `<=` for integer values. + * * `:`, meaning substring matching, for strings. + * + * The supported value types are: + * + * * string literals in quotes. + * * integer literals without quotes. + * * boolean literals `true` and `false` without quotes. + * + * For example, `resource_properties.size = 100` is a valid filter string. + * @param {string} [request.orderBy] + * Expression that defines what fields and order to use for sorting. The + * string value should follow SQL syntax: comma separated list of fields. For + * example: "name,resource_properties.a_property". The default sorting order + * is ascending. To specify descending order for a field, a suffix " desc" + * should be appended to the field name. For example: "name + * desc,resource_properties.a_property". Redundant space characters in the + * syntax are insignificant. "name desc,resource_properties.a_property" and " + * name desc , resource_properties.a_property " are equivalent. + * @param {Object} [request.readTime] + * Time used as a reference point when filtering assets. The filter is limited + * to assets existing at the supplied time and their values are those at that + * specific time. Absence of this field will default to the API's version of + * NOW. + * + * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} + * @param {Object} [request.compareDuration] + * When compare_duration is set, the ListAssetResult's "state" attribute is + * updated to indicate whether the asset was added, removed, or remained + * present during the compare_duration period of time that precedes the + * read_time. This is the time between (read_time - + * compare_duration) and read_time. + * + * The state value is derived based on the presence of the asset at the two + * points in time. Intermediate state changes between the two times don't + * affect the result. For example, the results aren't affected if the asset is + * removed and re-created again. + * + * Possible "state" values when compare_duration is specified: + * + * * "ADDED": indicates that the asset was not present before + * compare_duration, but present at read_time. + * * "REMOVED": indicates that the asset was present at the start of + * compare_duration, but not present at read_time. + * * "ACTIVE": indicates that the asset was present at both the + * start and the end of the time period defined by + * compare_duration and read_time. + * + * If compare_duration is not specified, then the only possible state is + * "UNUSED", which indicates that the asset is present at read_time. + * + * This object should have the same structure as [Duration]{@link google.protobuf.Duration} + * @param {Object} [request.fieldMask] + * Optional. + * + * A field mask to specify the ListAssetsResult fields to be listed in the + * response. + * An empty field mask will list all fields. + * + * This object should have the same structure as [FieldMask]{@link google.protobuf.FieldMask} + * @param {number} [request.pageSize] + * The maximum number of resources contained in the underlying API + * response. If page streaming is performed per-resource, this + * parameter does not affect the return value. If page streaming is + * performed per-page, this determines the maximum number of + * resources in a page. + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. + * @param {function(?Error, ?Array, ?Object, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is Array of [ListAssetsResult]{@link google.cloud.securitycenter.v1beta1.ListAssetsResult}. + * + * When autoPaginate: false is specified through options, it contains the result + * in a single response. If the response indicates the next page exists, the third + * parameter is set to be used for the next request object. The fourth parameter keeps + * the raw response object of an object representing [ListAssetsResponse]{@link google.cloud.securitycenter.v1beta1.ListAssetsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [ListAssetsResult]{@link google.cloud.securitycenter.v1beta1.ListAssetsResult}. + * + * When autoPaginate: false is specified through options, the array has three elements. + * The first element is Array of [ListAssetsResult]{@link google.cloud.securitycenter.v1beta1.ListAssetsResult} in a single response. + * The second element is the next request object if the response + * indicates the next page exists, or null. The third element is + * an object representing [ListAssetsResponse]{@link google.cloud.securitycenter.v1beta1.ListAssetsResponse}. + * + * The promise has a method named "cancel" which cancels the ongoing API call. + * + * @example + * + * const securitycenter = require('securitycenter.v1beta1'); + * + * const client = new securitycenter.v1beta1.SecurityCenterClient({ + * // optional auth parameters. + * }); + * + * // Iterate over all elements. + * const formattedParent = client.organizationPath('[ORGANIZATION]'); + * + * client.listAssets({parent: formattedParent}) + * .then(responses => { + * const resources = responses[0]; + * for (let i = 0; i < resources.length; i += 1) { + * // doThingsWith(resources[i]) + * } + * }) + * .catch(err => { + * console.error(err); + * }); + * + * // Or obtain the paged response. + * const formattedParent = client.organizationPath('[ORGANIZATION]'); + * + * + * const options = {autoPaginate: false}; + * const callback = responses => { + * // The actual resources in a response. + * const resources = responses[0]; + * // The next request if the response shows that there are more responses. + * const nextRequest = responses[1]; + * // The actual response object, if necessary. + * // const rawResponse = responses[2]; + * for (let i = 0; i < resources.length; i += 1) { + * // doThingsWith(resources[i]); + * } + * if (nextRequest) { + * // Fetch the next page. + * return client.listAssets(nextRequest, options).then(callback); + * } + * } + * client.listAssets({parent: formattedParent}, options) + * .then(callback) + * .catch(err => { + * console.error(err); + * }); + */ + listAssets(request, options, callback) { + if (options instanceof Function && callback === undefined) { + callback = options; + options = {}; + } + options = options || {}; + + return this._innerApiCalls.listAssets(request, options, callback); + } + + /** + * Equivalent to {@link listAssets}, but returns a NodeJS Stream object. + * + * This fetches the paged responses for {@link listAssets} continuously + * and invokes the callback registered for 'data' event for each element in the + * responses. + * + * The returned object has 'end' method when no more elements are required. + * + * autoPaginate option will be ignored. + * + * @see {@link https://nodejs.org/api/stream.html} + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Name of the organization assets should belong to. Its format is + * "organizations/[organization_id]". + * @param {string} [request.filter] + * Expression that defines the filter to apply across assets. + * The expression is a list of zero or more restrictions combined via logical + * operators `AND` and `OR`. + * Parentheses are not supported, and `OR` has higher precedence than `AND`. + * + * Restrictions have the form ` ` and may have a `-` + * character in front of them to indicate negation. The fields map to those + * defined in the Asset resource. Examples include: + * + * * name + * * security_center_properties.resource_name + * * resource_properties.a_property + * * security_marks.marks.marka + * + * The supported operators are: + * + * * `=` for all value types. + * * `>`, `<`, `>=`, `<=` for integer values. + * * `:`, meaning substring matching, for strings. + * + * The supported value types are: + * + * * string literals in quotes. + * * integer literals without quotes. + * * boolean literals `true` and `false` without quotes. + * + * For example, `resource_properties.size = 100` is a valid filter string. + * @param {string} [request.orderBy] + * Expression that defines what fields and order to use for sorting. The + * string value should follow SQL syntax: comma separated list of fields. For + * example: "name,resource_properties.a_property". The default sorting order + * is ascending. To specify descending order for a field, a suffix " desc" + * should be appended to the field name. For example: "name + * desc,resource_properties.a_property". Redundant space characters in the + * syntax are insignificant. "name desc,resource_properties.a_property" and " + * name desc , resource_properties.a_property " are equivalent. + * @param {Object} [request.readTime] + * Time used as a reference point when filtering assets. The filter is limited + * to assets existing at the supplied time and their values are those at that + * specific time. Absence of this field will default to the API's version of + * NOW. + * + * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} + * @param {Object} [request.compareDuration] + * When compare_duration is set, the ListAssetResult's "state" attribute is + * updated to indicate whether the asset was added, removed, or remained + * present during the compare_duration period of time that precedes the + * read_time. This is the time between (read_time - + * compare_duration) and read_time. + * + * The state value is derived based on the presence of the asset at the two + * points in time. Intermediate state changes between the two times don't + * affect the result. For example, the results aren't affected if the asset is + * removed and re-created again. + * + * Possible "state" values when compare_duration is specified: + * + * * "ADDED": indicates that the asset was not present before + * compare_duration, but present at read_time. + * * "REMOVED": indicates that the asset was present at the start of + * compare_duration, but not present at read_time. + * * "ACTIVE": indicates that the asset was present at both the + * start and the end of the time period defined by + * compare_duration and read_time. + * + * If compare_duration is not specified, then the only possible state is + * "UNUSED", which indicates that the asset is present at read_time. + * + * This object should have the same structure as [Duration]{@link google.protobuf.Duration} + * @param {Object} [request.fieldMask] + * Optional. + * + * A field mask to specify the ListAssetsResult fields to be listed in the + * response. + * An empty field mask will list all fields. + * + * This object should have the same structure as [FieldMask]{@link google.protobuf.FieldMask} + * @param {number} [request.pageSize] + * The maximum number of resources contained in the underlying API + * response. If page streaming is performed per-resource, this + * parameter does not affect the return value. If page streaming is + * performed per-page, this determines the maximum number of + * resources in a page. + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. + * @returns {Stream} + * An object stream which emits an object representing [ListAssetsResult]{@link google.cloud.securitycenter.v1beta1.ListAssetsResult} on 'data' event. + * + * @example + * + * const securitycenter = require('securitycenter.v1beta1'); + * + * const client = new securitycenter.v1beta1.SecurityCenterClient({ + * // optional auth parameters. + * }); + * + * const formattedParent = client.organizationPath('[ORGANIZATION]'); + * client.listAssetsStream({parent: formattedParent}) + * .on('data', element => { + * // doThingsWith(element) + * }).on('error', err => { + * console.log(err); + * }); + */ + listAssetsStream(request, options) { + options = options || {}; + + return this._descriptors.page.listAssets.createStream( + this._innerApiCalls.listAssets, + request, + options + ); + } + + /** + * Lists an organization or source's assets. + * + * To list across all sources provide a `-` as the source id. + * Example: /v1beta1/organizations/123/sources/-/findings + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Name of the source the findings belong to. Its format is + * "organizations/[organization_id]/sources/[source_id]". To list across all + * sources provide a source_id of `-`. For example: + * organizations/123/sources/- + * @param {string} [request.filter] + * Expression that defines the filter to apply across findings. + * The expression is a list of one or more restrictions combined via logical + * operators `AND` and `OR`. + * Parentheses are not supported, and `OR` has higher precedence than `AND`. + * + * Restrictions have the form ` ` and may have a `-` + * character in front of them to indicate negation. Examples include: + * + * * name + * * source_properties.a_property + * * security_marks.marks.marka + * + * The supported operators are: + * + * * `=` for all value types. + * * `>`, `<`, `>=`, `<=` for integer values. + * * `:`, meaning substring matching, for strings. + * + * The supported value types are: + * + * * string literals in quotes. + * * integer literals without quotes. + * * boolean literals `true` and `false` without quotes. + * + * For example, `source_properties.size = 100` is a valid filter string. + * @param {string} [request.orderBy] + * Expression that defines what fields and order to use for sorting. The + * string value should follow SQL syntax: comma separated list of fields. For + * example: "name,resource_properties.a_property". The default sorting order + * is ascending. To specify descending order for a field, a suffix " desc" + * should be appended to the field name. For example: "name + * desc,source_properties.a_property". Redundant space characters in the + * syntax are insignificant. "name desc,source_properties.a_property" and " + * name desc , source_properties.a_property " are equivalent. + * @param {Object} [request.readTime] + * Time used as a reference point when filtering findings. The filter is + * limited to findings existing at the supplied time and their values are + * those at that specific time. Absence of this field will default to the + * API's version of NOW. + * + * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} + * @param {Object} [request.fieldMask] + * Optional. + * + * A field mask to specify the Finding fields to be listed in the response. + * An empty field mask will list all fields. + * + * This object should have the same structure as [FieldMask]{@link google.protobuf.FieldMask} + * @param {number} [request.pageSize] + * The maximum number of resources contained in the underlying API + * response. If page streaming is performed per-resource, this + * parameter does not affect the return value. If page streaming is + * performed per-page, this determines the maximum number of + * resources in a page. + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. + * @param {function(?Error, ?Array, ?Object, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is Array of [Finding]{@link google.cloud.securitycenter.v1beta1.Finding}. + * + * When autoPaginate: false is specified through options, it contains the result + * in a single response. If the response indicates the next page exists, the third + * parameter is set to be used for the next request object. The fourth parameter keeps + * the raw response object of an object representing [ListFindingsResponse]{@link google.cloud.securitycenter.v1beta1.ListFindingsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [Finding]{@link google.cloud.securitycenter.v1beta1.Finding}. + * + * When autoPaginate: false is specified through options, the array has three elements. + * The first element is Array of [Finding]{@link google.cloud.securitycenter.v1beta1.Finding} in a single response. + * The second element is the next request object if the response + * indicates the next page exists, or null. The third element is + * an object representing [ListFindingsResponse]{@link google.cloud.securitycenter.v1beta1.ListFindingsResponse}. + * + * The promise has a method named "cancel" which cancels the ongoing API call. + * + * @example + * + * const securitycenter = require('securitycenter.v1beta1'); + * + * const client = new securitycenter.v1beta1.SecurityCenterClient({ + * // optional auth parameters. + * }); + * + * // Iterate over all elements. + * const formattedParent = client.sourcePath('[ORGANIZATION]', '[SOURCE]'); + * + * client.listFindings({parent: formattedParent}) + * .then(responses => { + * const resources = responses[0]; + * for (let i = 0; i < resources.length; i += 1) { + * // doThingsWith(resources[i]) + * } + * }) + * .catch(err => { + * console.error(err); + * }); + * + * // Or obtain the paged response. + * const formattedParent = client.sourcePath('[ORGANIZATION]', '[SOURCE]'); + * + * + * const options = {autoPaginate: false}; + * const callback = responses => { + * // The actual resources in a response. + * const resources = responses[0]; + * // The next request if the response shows that there are more responses. + * const nextRequest = responses[1]; + * // The actual response object, if necessary. + * // const rawResponse = responses[2]; + * for (let i = 0; i < resources.length; i += 1) { + * // doThingsWith(resources[i]); + * } + * if (nextRequest) { + * // Fetch the next page. + * return client.listFindings(nextRequest, options).then(callback); + * } + * } + * client.listFindings({parent: formattedParent}, options) + * .then(callback) + * .catch(err => { + * console.error(err); + * }); + */ + listFindings(request, options, callback) { + if (options instanceof Function && callback === undefined) { + callback = options; + options = {}; + } + options = options || {}; + + return this._innerApiCalls.listFindings(request, options, callback); + } + + /** + * Equivalent to {@link listFindings}, but returns a NodeJS Stream object. + * + * This fetches the paged responses for {@link listFindings} continuously + * and invokes the callback registered for 'data' event for each element in the + * responses. + * + * The returned object has 'end' method when no more elements are required. + * + * autoPaginate option will be ignored. + * + * @see {@link https://nodejs.org/api/stream.html} + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Name of the source the findings belong to. Its format is + * "organizations/[organization_id]/sources/[source_id]". To list across all + * sources provide a source_id of `-`. For example: + * organizations/123/sources/- + * @param {string} [request.filter] + * Expression that defines the filter to apply across findings. + * The expression is a list of one or more restrictions combined via logical + * operators `AND` and `OR`. + * Parentheses are not supported, and `OR` has higher precedence than `AND`. + * + * Restrictions have the form ` ` and may have a `-` + * character in front of them to indicate negation. Examples include: + * + * * name + * * source_properties.a_property + * * security_marks.marks.marka + * + * The supported operators are: + * + * * `=` for all value types. + * * `>`, `<`, `>=`, `<=` for integer values. + * * `:`, meaning substring matching, for strings. + * + * The supported value types are: + * + * * string literals in quotes. + * * integer literals without quotes. + * * boolean literals `true` and `false` without quotes. + * + * For example, `source_properties.size = 100` is a valid filter string. + * @param {string} [request.orderBy] + * Expression that defines what fields and order to use for sorting. The + * string value should follow SQL syntax: comma separated list of fields. For + * example: "name,resource_properties.a_property". The default sorting order + * is ascending. To specify descending order for a field, a suffix " desc" + * should be appended to the field name. For example: "name + * desc,source_properties.a_property". Redundant space characters in the + * syntax are insignificant. "name desc,source_properties.a_property" and " + * name desc , source_properties.a_property " are equivalent. + * @param {Object} [request.readTime] + * Time used as a reference point when filtering findings. The filter is + * limited to findings existing at the supplied time and their values are + * those at that specific time. Absence of this field will default to the + * API's version of NOW. + * + * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} + * @param {Object} [request.fieldMask] + * Optional. + * + * A field mask to specify the Finding fields to be listed in the response. + * An empty field mask will list all fields. + * + * This object should have the same structure as [FieldMask]{@link google.protobuf.FieldMask} + * @param {number} [request.pageSize] + * The maximum number of resources contained in the underlying API + * response. If page streaming is performed per-resource, this + * parameter does not affect the return value. If page streaming is + * performed per-page, this determines the maximum number of + * resources in a page. + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. + * @returns {Stream} + * An object stream which emits an object representing [Finding]{@link google.cloud.securitycenter.v1beta1.Finding} on 'data' event. + * + * @example + * + * const securitycenter = require('securitycenter.v1beta1'); + * + * const client = new securitycenter.v1beta1.SecurityCenterClient({ + * // optional auth parameters. + * }); + * + * const formattedParent = client.sourcePath('[ORGANIZATION]', '[SOURCE]'); + * client.listFindingsStream({parent: formattedParent}) + * .on('data', element => { + * // doThingsWith(element) + * }).on('error', err => { + * console.log(err); + * }); + */ + listFindingsStream(request, options) { + options = options || {}; + + return this._descriptors.page.listFindings.createStream( + this._innerApiCalls.listFindings, + request, + options + ); + } + + /** + * Lists all sources belonging to an organization. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Resource name of the parent of sources to list. Its format should be + * "organizations/[organization_id]". + * @param {number} [request.pageSize] + * The maximum number of resources contained in the underlying API + * response. If page streaming is performed per-resource, this + * parameter does not affect the return value. If page streaming is + * performed per-page, this determines the maximum number of + * resources in a page. + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. + * @param {function(?Error, ?Array, ?Object, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is Array of [Source]{@link google.cloud.securitycenter.v1beta1.Source}. + * + * When autoPaginate: false is specified through options, it contains the result + * in a single response. If the response indicates the next page exists, the third + * parameter is set to be used for the next request object. The fourth parameter keeps + * the raw response object of an object representing [ListSourcesResponse]{@link google.cloud.securitycenter.v1beta1.ListSourcesResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [Source]{@link google.cloud.securitycenter.v1beta1.Source}. + * + * When autoPaginate: false is specified through options, the array has three elements. + * The first element is Array of [Source]{@link google.cloud.securitycenter.v1beta1.Source} in a single response. + * The second element is the next request object if the response + * indicates the next page exists, or null. The third element is + * an object representing [ListSourcesResponse]{@link google.cloud.securitycenter.v1beta1.ListSourcesResponse}. + * + * The promise has a method named "cancel" which cancels the ongoing API call. + * + * @example + * + * const securitycenter = require('securitycenter.v1beta1'); + * + * const client = new securitycenter.v1beta1.SecurityCenterClient({ + * // optional auth parameters. + * }); + * + * // Iterate over all elements. + * const formattedParent = client.organizationPath('[ORGANIZATION]'); + * + * client.listSources({parent: formattedParent}) + * .then(responses => { + * const resources = responses[0]; + * for (let i = 0; i < resources.length; i += 1) { + * // doThingsWith(resources[i]) + * } + * }) + * .catch(err => { + * console.error(err); + * }); + * + * // Or obtain the paged response. + * const formattedParent = client.organizationPath('[ORGANIZATION]'); + * + * + * const options = {autoPaginate: false}; + * const callback = responses => { + * // The actual resources in a response. + * const resources = responses[0]; + * // The next request if the response shows that there are more responses. + * const nextRequest = responses[1]; + * // The actual response object, if necessary. + * // const rawResponse = responses[2]; + * for (let i = 0; i < resources.length; i += 1) { + * // doThingsWith(resources[i]); + * } + * if (nextRequest) { + * // Fetch the next page. + * return client.listSources(nextRequest, options).then(callback); + * } + * } + * client.listSources({parent: formattedParent}, options) + * .then(callback) + * .catch(err => { + * console.error(err); + * }); + */ + listSources(request, options, callback) { + if (options instanceof Function && callback === undefined) { + callback = options; + options = {}; + } + options = options || {}; + + return this._innerApiCalls.listSources(request, options, callback); + } + + /** + * Equivalent to {@link listSources}, but returns a NodeJS Stream object. + * + * This fetches the paged responses for {@link listSources} continuously + * and invokes the callback registered for 'data' event for each element in the + * responses. + * + * The returned object has 'end' method when no more elements are required. + * + * autoPaginate option will be ignored. + * + * @see {@link https://nodejs.org/api/stream.html} + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Resource name of the parent of sources to list. Its format should be + * "organizations/[organization_id]". + * @param {number} [request.pageSize] + * The maximum number of resources contained in the underlying API + * response. If page streaming is performed per-resource, this + * parameter does not affect the return value. If page streaming is + * performed per-page, this determines the maximum number of + * resources in a page. + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. + * @returns {Stream} + * An object stream which emits an object representing [Source]{@link google.cloud.securitycenter.v1beta1.Source} on 'data' event. + * + * @example + * + * const securitycenter = require('securitycenter.v1beta1'); + * + * const client = new securitycenter.v1beta1.SecurityCenterClient({ + * // optional auth parameters. + * }); + * + * const formattedParent = client.organizationPath('[ORGANIZATION]'); + * client.listSourcesStream({parent: formattedParent}) + * .on('data', element => { + * // doThingsWith(element) + * }).on('error', err => { + * console.log(err); + * }); + */ + listSourcesStream(request, options) { + options = options || {}; + + return this._descriptors.page.listSources.createStream( + this._innerApiCalls.listSources, + request, + options + ); + } + + /** + * Runs asset discovery. The discovery is tracked with a long-running + * operation. + * + * This API can only be called with limited frequency for an organization. If + * it is called too frequently the caller will receive a TOO_MANY_REQUESTS + * error. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Name of the organization to run asset discovery for. Its format is + * "organizations/[organization_id]". + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is a [gax.Operation]{@link https://googleapis.github.io/gax-nodejs/Operation} object. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is a [gax.Operation]{@link https://googleapis.github.io/gax-nodejs/Operation} object. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + * @example + * + * const securitycenter = require('securitycenter.v1beta1'); + * + * const client = new securitycenter.v1beta1.SecurityCenterClient({ + * // optional auth parameters. + * }); + * + * const formattedParent = client.organizationPath('[ORGANIZATION]'); + * + * // Handle the operation using the promise pattern. + * client.runAssetDiscovery({parent: formattedParent}) + * .then(responses => { + * const operation = responses[0]; + * const initialApiResponse = responses[1]; + * + * // Operation#promise starts polling for the completion of the LRO. + * return operation.promise(); + * }) + * .then(responses => { + * // The final result of the operation. + * const result = responses[0]; + * + * // The metadata value of the completed operation. + * const metadata = responses[1]; + * + * // The response of the api call returning the complete operation. + * const finalApiResponse = responses[2]; + * }) + * .catch(err => { + * console.error(err); + * }); + * + * const formattedParent = client.organizationPath('[ORGANIZATION]'); + * + * // Handle the operation using the event emitter pattern. + * client.runAssetDiscovery({parent: formattedParent}) + * .then(responses => { + * const operation = responses[0]; + * const initialApiResponse = responses[1]; + * + * // Adding a listener for the "complete" event starts polling for the + * // completion of the operation. + * operation.on('complete', (result, metadata, finalApiResponse) => { + * // doSomethingWith(result); + * }); + * + * // Adding a listener for the "progress" event causes the callback to be + * // called on any change in metadata when the operation is polled. + * operation.on('progress', (metadata, apiResponse) => { + * // doSomethingWith(metadata) + * }); + * + * // Adding a listener for the "error" event handles any errors found during polling. + * operation.on('error', err => { + * // throw(err); + * }); + * }) + * .catch(err => { + * console.error(err); + * }); + */ + runAssetDiscovery(request, options, callback) { + if (options instanceof Function && callback === undefined) { + callback = options; + options = {}; + } + options = options || {}; + + return this._innerApiCalls.runAssetDiscovery(request, options, callback); + } + + /** + * Updates the state of a finding. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * The relative resource name of the finding. See: + * https://cloud.google.com/apis/design/resource_names#relative_resource_name + * Example: + * "organizations/123/sources/456/finding/789". + * @param {number} request.state + * The desired State of the finding. + * + * The number should be among the values of [State]{@link google.cloud.securitycenter.v1beta1.State} + * @param {Object} request.startTime + * The time at which the updated state takes effect. + * + * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing [Finding]{@link google.cloud.securitycenter.v1beta1.Finding}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Finding]{@link google.cloud.securitycenter.v1beta1.Finding}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + * @example + * + * const securitycenter = require('securitycenter.v1beta1'); + * + * const client = new securitycenter.v1beta1.SecurityCenterClient({ + * // optional auth parameters. + * }); + * + * const formattedName = client.findingPath('[ORGANIZATION]', '[SOURCE]', '[FINDING]'); + * const state = 'STATE_UNSPECIFIED'; + * const startTime = {}; + * const request = { + * name: formattedName, + * state: state, + * startTime: startTime, + * }; + * client.setFindingState(request) + * .then(responses => { + * const response = responses[0]; + * // doThingsWith(response) + * }) + * .catch(err => { + * console.error(err); + * }); + */ + setFindingState(request, options, callback) { + if (options instanceof Function && callback === undefined) { + callback = options; + options = {}; + } + options = options || {}; + + return this._innerApiCalls.setFindingState(request, options, callback); + } + + /** + * Sets the access control policy on the specified Source. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy is being specified. + * `resource` is usually specified as a path. For example, a Project + * resource is specified as `projects/{project}`. + * @param {Object} request.policy + * REQUIRED: The complete policy to be applied to the `resource`. The size of + * the policy is limited to a few 10s of KB. An empty policy is a + * valid policy but certain Cloud Platform services (such as Projects) + * might reject them. + * + * This object should have the same structure as [Policy]{@link google.iam.v1.Policy} + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing [Policy]{@link google.iam.v1.Policy}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Policy]{@link google.iam.v1.Policy}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + * @example + * + * const securitycenter = require('securitycenter.v1beta1'); + * + * const client = new securitycenter.v1beta1.SecurityCenterClient({ + * // optional auth parameters. + * }); + * + * const formattedResource = client.sourcePath('[ORGANIZATION]', '[SOURCE]'); + * const policy = {}; + * const request = { + * resource: formattedResource, + * policy: policy, + * }; + * client.setIamPolicy(request) + * .then(responses => { + * const response = responses[0]; + * // doThingsWith(response) + * }) + * .catch(err => { + * console.error(err); + * }); + */ + setIamPolicy(request, options, callback) { + if (options instanceof Function && callback === undefined) { + callback = options; + options = {}; + } + options = options || {}; + + return this._innerApiCalls.setIamPolicy(request, options, callback); + } + + /** + * Returns the permissions that a caller has on the specified source. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy detail is being requested. + * `resource` is usually specified as a path. For example, a Project + * resource is specified as `projects/{project}`. + * @param {string[]} request.permissions + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see + * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + * @example + * + * const securitycenter = require('securitycenter.v1beta1'); + * + * const client = new securitycenter.v1beta1.SecurityCenterClient({ + * // optional auth parameters. + * }); + * + * const formattedResource = client.sourcePath('[ORGANIZATION]', '[SOURCE]'); + * const permissions = []; + * const request = { + * resource: formattedResource, + * permissions: permissions, + * }; + * client.testIamPermissions(request) + * .then(responses => { + * const response = responses[0]; + * // doThingsWith(response) + * }) + * .catch(err => { + * console.error(err); + * }); + */ + testIamPermissions(request, options, callback) { + if (options instanceof Function && callback === undefined) { + callback = options; + options = {}; + } + options = options || {}; + + return this._innerApiCalls.testIamPermissions(request, options, callback); + } + + /** + * Creates or updates a finding. The corresponding source must exist for a + * finding creation to succeed. + * + * @param {Object} request + * The request object that will be sent. + * @param {Object} request.finding + * The finding resource to update or create if it does not already exist. + * parent, security_marks, and update_time will be ignored. + * + * In the case of creation, the finding id portion of the name must + * alphanumeric and less than or equal to 32 characters and greater than 0 + * characters in length. + * + * This object should have the same structure as [Finding]{@link google.cloud.securitycenter.v1beta1.Finding} + * @param {Object} [request.updateMask] + * The FieldMask to use when updating the finding resource. This field is + * ignored if the finding does not already exist and the finding is created. + * + * This object should have the same structure as [FieldMask]{@link google.protobuf.FieldMask} + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing [Finding]{@link google.cloud.securitycenter.v1beta1.Finding}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Finding]{@link google.cloud.securitycenter.v1beta1.Finding}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + * @example + * + * const securitycenter = require('securitycenter.v1beta1'); + * + * const client = new securitycenter.v1beta1.SecurityCenterClient({ + * // optional auth parameters. + * }); + * + * const finding = {}; + * client.updateFinding({finding: finding}) + * .then(responses => { + * const response = responses[0]; + * // doThingsWith(response) + * }) + * .catch(err => { + * console.error(err); + * }); + */ + updateFinding(request, options, callback) { + if (options instanceof Function && callback === undefined) { + callback = options; + options = {}; + } + options = options || {}; + + return this._innerApiCalls.updateFinding(request, options, callback); + } + + /** + * Updates an organization's settings. + * + * @param {Object} request + * The request object that will be sent. + * @param {Object} request.organizationSettings + * The organization settings resource to update. + * + * This object should have the same structure as [OrganizationSettings]{@link google.cloud.securitycenter.v1beta1.OrganizationSettings} + * @param {Object} [request.updateMask] + * The FieldMask to use when updating the settings resource. + * + * This object should have the same structure as [FieldMask]{@link google.protobuf.FieldMask} + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing [OrganizationSettings]{@link google.cloud.securitycenter.v1beta1.OrganizationSettings}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [OrganizationSettings]{@link google.cloud.securitycenter.v1beta1.OrganizationSettings}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + * @example + * + * const securitycenter = require('securitycenter.v1beta1'); + * + * const client = new securitycenter.v1beta1.SecurityCenterClient({ + * // optional auth parameters. + * }); + * + * const organizationSettings = {}; + * client.updateOrganizationSettings({organizationSettings: organizationSettings}) + * .then(responses => { + * const response = responses[0]; + * // doThingsWith(response) + * }) + * .catch(err => { + * console.error(err); + * }); + */ + updateOrganizationSettings(request, options, callback) { + if (options instanceof Function && callback === undefined) { + callback = options; + options = {}; + } + options = options || {}; + + return this._innerApiCalls.updateOrganizationSettings( + request, + options, + callback + ); + } + + /** + * Updates a source. + * + * @param {Object} request + * The request object that will be sent. + * @param {Object} request.source + * The source resource to update. + * + * This object should have the same structure as [Source]{@link google.cloud.securitycenter.v1beta1.Source} + * @param {Object} [request.updateMask] + * The FieldMask to use when updating the source resource. + * + * This object should have the same structure as [FieldMask]{@link google.protobuf.FieldMask} + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing [Source]{@link google.cloud.securitycenter.v1beta1.Source}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Source]{@link google.cloud.securitycenter.v1beta1.Source}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + * @example + * + * const securitycenter = require('securitycenter.v1beta1'); + * + * const client = new securitycenter.v1beta1.SecurityCenterClient({ + * // optional auth parameters. + * }); + * + * const source = {}; + * client.updateSource({source: source}) + * .then(responses => { + * const response = responses[0]; + * // doThingsWith(response) + * }) + * .catch(err => { + * console.error(err); + * }); + */ + updateSource(request, options, callback) { + if (options instanceof Function && callback === undefined) { + callback = options; + options = {}; + } + options = options || {}; + + return this._innerApiCalls.updateSource(request, options, callback); + } + + /** + * Updates security marks. + * + * @param {Object} request + * The request object that will be sent. + * @param {Object} request.securityMarks + * The security marks resource to update. + * + * This object should have the same structure as [SecurityMarks]{@link google.cloud.securitycenter.v1beta1.SecurityMarks} + * @param {Object} [request.updateMask] + * The FieldMask to use when updating the security marks resource. + * + * This object should have the same structure as [FieldMask]{@link google.protobuf.FieldMask} + * @param {Object} [request.startTime] + * The time at which the updated SecurityMarks take effect. + * + * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing [SecurityMarks]{@link google.cloud.securitycenter.v1beta1.SecurityMarks}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [SecurityMarks]{@link google.cloud.securitycenter.v1beta1.SecurityMarks}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + * @example + * + * const securitycenter = require('securitycenter.v1beta1'); + * + * const client = new securitycenter.v1beta1.SecurityCenterClient({ + * // optional auth parameters. + * }); + * + * const securityMarks = {}; + * client.updateSecurityMarks({securityMarks: securityMarks}) + * .then(responses => { + * const response = responses[0]; + * // doThingsWith(response) + * }) + * .catch(err => { + * console.error(err); + * }); + */ + updateSecurityMarks(request, options, callback) { + if (options instanceof Function && callback === undefined) { + callback = options; + options = {}; + } + options = options || {}; + + return this._innerApiCalls.updateSecurityMarks(request, options, callback); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified organization resource name string. + * + * @param {String} organization + * @returns {String} + */ + organizationPath(organization) { + return this._pathTemplates.organizationPathTemplate.render({ + organization: organization + }); + } + + /** + * Return a fully-qualified source resource name string. + * + * @param {String} organization + * @param {String} source + * @returns {String} + */ + sourcePath(organization, source) { + return this._pathTemplates.sourcePathTemplate.render({ + organization: organization, + source: source + }); + } + + /** + * Return a fully-qualified organization_settings resource name string. + * + * @param {String} organization + * @returns {String} + */ + organizationSettingsPath(organization) { + return this._pathTemplates.organizationSettingsPathTemplate.render({ + organization: organization + }); + } + + /** + * Return a fully-qualified finding resource name string. + * + * @param {String} organization + * @param {String} source + * @param {String} finding + * @returns {String} + */ + findingPath(organization, source, finding) { + return this._pathTemplates.findingPathTemplate.render({ + organization: organization, + source: source, + finding: finding + }); + } + + /** + * Return a fully-qualified asset_security_marks resource name string. + * + * @param {String} organization + * @param {String} asset + * @returns {String} + */ + assetSecurityMarksPath(organization, asset) { + return this._pathTemplates.assetSecurityMarksPathTemplate.render({ + organization: organization, + asset: asset + }); + } + + /** + * Parse the organizationName from a organization resource. + * + * @param {String} organizationName + * A fully-qualified path representing a organization resources. + * @returns {String} - A string representing the organization. + */ + matchOrganizationFromOrganizationName(organizationName) { + return this._pathTemplates.organizationPathTemplate.match(organizationName) + .organization; + } + + /** + * Parse the sourceName from a source resource. + * + * @param {String} sourceName + * A fully-qualified path representing a source resources. + * @returns {String} - A string representing the organization. + */ + matchOrganizationFromSourceName(sourceName) { + return this._pathTemplates.sourcePathTemplate.match(sourceName) + .organization; + } + + /** + * Parse the sourceName from a source resource. + * + * @param {String} sourceName + * A fully-qualified path representing a source resources. + * @returns {String} - A string representing the source. + */ + matchSourceFromSourceName(sourceName) { + return this._pathTemplates.sourcePathTemplate.match(sourceName).source; + } + + /** + * Parse the organizationSettingsName from a organization_settings resource. + * + * @param {String} organizationSettingsName + * A fully-qualified path representing a organization_settings resources. + * @returns {String} - A string representing the organization. + */ + matchOrganizationFromOrganizationSettingsName(organizationSettingsName) { + return this._pathTemplates.organizationSettingsPathTemplate.match( + organizationSettingsName + ).organization; + } + + /** + * Parse the findingName from a finding resource. + * + * @param {String} findingName + * A fully-qualified path representing a finding resources. + * @returns {String} - A string representing the organization. + */ + matchOrganizationFromFindingName(findingName) { + return this._pathTemplates.findingPathTemplate.match(findingName) + .organization; + } + + /** + * Parse the findingName from a finding resource. + * + * @param {String} findingName + * A fully-qualified path representing a finding resources. + * @returns {String} - A string representing the source. + */ + matchSourceFromFindingName(findingName) { + return this._pathTemplates.findingPathTemplate.match(findingName).source; + } + + /** + * Parse the findingName from a finding resource. + * + * @param {String} findingName + * A fully-qualified path representing a finding resources. + * @returns {String} - A string representing the finding. + */ + matchFindingFromFindingName(findingName) { + return this._pathTemplates.findingPathTemplate.match(findingName).finding; + } + + /** + * Parse the assetSecurityMarksName from a asset_security_marks resource. + * + * @param {String} assetSecurityMarksName + * A fully-qualified path representing a asset_security_marks resources. + * @returns {String} - A string representing the organization. + */ + matchOrganizationFromAssetSecurityMarksName(assetSecurityMarksName) { + return this._pathTemplates.assetSecurityMarksPathTemplate.match( + assetSecurityMarksName + ).organization; + } + + /** + * Parse the assetSecurityMarksName from a asset_security_marks resource. + * + * @param {String} assetSecurityMarksName + * A fully-qualified path representing a asset_security_marks resources. + * @returns {String} - A string representing the asset. + */ + matchAssetFromAssetSecurityMarksName(assetSecurityMarksName) { + return this._pathTemplates.assetSecurityMarksPathTemplate.match( + assetSecurityMarksName + ).asset; + } +} + +module.exports = SecurityCenterClient; diff --git a/packages/google-cloud-securitycenter/src/v1beta1/security_center_client_config.json b/packages/google-cloud-securitycenter/src/v1beta1/security_center_client_config.json new file mode 100644 index 00000000000..3ddfa413fad --- /dev/null +++ b/packages/google-cloud-securitycenter/src/v1beta1/security_center_client_config.json @@ -0,0 +1,116 @@ +{ + "interfaces": { + "google.cloud.securitycenter.v1beta1.SecurityCenter": { + "retry_codes": { + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ], + "non_idempotent": [] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 20000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 20000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "CreateSource": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateFinding": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetIamPolicy": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "GetOrganizationSettings": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "GetSource": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "GroupAssets": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "GroupFindings": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "ListAssets": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "ListFindings": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "ListSources": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "RunAssetDiscovery": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "SetFindingState": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "SetIamPolicy": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "TestIamPermissions": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "UpdateFinding": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateOrganizationSettings": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateSource": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateSecurityMarks": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-cloud-securitycenter/synth.py b/packages/google-cloud-securitycenter/synth.py new file mode 100644 index 00000000000..11783254aad --- /dev/null +++ b/packages/google-cloud-securitycenter/synth.py @@ -0,0 +1,41 @@ +# Copyright 2018 Google LLC +# +# Licensed under the Apache License, Version 2.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 synthtool as s +import synthtool.gcp as gcp +import subprocess +import logging + +logging.basicConfig(level=logging.DEBUG) + +gapic = gcp.GAPICGenerator() +common_templates = gcp.CommonTemplates() + + +versions = ['v1beta1'] + +for version in versions: + library = gapic.node_library('securitycenter', version) + s.copy(library, excludes=['src/index.js', 'README.md', 'package.json']) + +templates = common_templates.node_library() +s.copy(templates) + + +''' +Node.js specific cleanup +''' +subprocess.run(['npm', 'install']) +subprocess.run(['npm', 'run', 'prettier']) +subprocess.run(['npm', 'run', 'lint']) diff --git a/packages/google-cloud-securitycenter/test/gapic-v1beta1.js b/packages/google-cloud-securitycenter/test/gapic-v1beta1.js new file mode 100644 index 00000000000..acf1a4bb851 --- /dev/null +++ b/packages/google-cloud-securitycenter/test/gapic-v1beta1.js @@ -0,0 +1,1284 @@ +// Copyright 2018 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT 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"; + +const assert = require("assert"); + +const securitycenterModule = require("../src"); + +const FAKE_STATUS_CODE = 1; +const error = new Error(); +error.code = FAKE_STATUS_CODE; + +describe("SecurityCenterClient", () => { + describe("createSource", () => { + it("invokes createSource without error", done => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: { client_email: "bogus", private_key: "bogus" }, + projectId: "bogus" + }); + + // Mock request + const formattedParent = client.organizationPath("[ORGANIZATION]"); + const source = {}; + const request = { + parent: formattedParent, + source: source + }; + + // Mock response + const name = "name3373707"; + const displayName = "displayName1615086568"; + const description = "description-1724546052"; + const expectedResponse = { + name: name, + displayName: displayName, + description: description + }; + + // Mock Grpc layer + client._innerApiCalls.createSource = mockSimpleGrpcMethod( + request, + expectedResponse + ); + + client.createSource(request, (err, response) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it("invokes createSource with error", done => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: { client_email: "bogus", private_key: "bogus" }, + projectId: "bogus" + }); + + // Mock request + const formattedParent = client.organizationPath("[ORGANIZATION]"); + const source = {}; + const request = { + parent: formattedParent, + source: source + }; + + // Mock Grpc layer + client._innerApiCalls.createSource = mockSimpleGrpcMethod( + request, + null, + error + ); + + client.createSource(request, (err, response) => { + assert(err instanceof Error); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === "undefined"); + done(); + }); + }); + }); + + describe("createFinding", () => { + it("invokes createFinding without error", done => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: { client_email: "bogus", private_key: "bogus" }, + projectId: "bogus" + }); + + // Mock request + const formattedParent = client.sourcePath("[ORGANIZATION]", "[SOURCE]"); + const findingId = "findingId728776081"; + const finding = {}; + const request = { + parent: formattedParent, + findingId: findingId, + finding: finding + }; + + // Mock response + const name = "name3373707"; + const parent2 = "parent21175163357"; + const resourceName = "resourceName979421212"; + const category = "category50511102"; + const externalUri = "externalUri-1385596168"; + const expectedResponse = { + name: name, + parent: parent2, + resourceName: resourceName, + category: category, + externalUri: externalUri + }; + + // Mock Grpc layer + client._innerApiCalls.createFinding = mockSimpleGrpcMethod( + request, + expectedResponse + ); + + client.createFinding(request, (err, response) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it("invokes createFinding with error", done => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: { client_email: "bogus", private_key: "bogus" }, + projectId: "bogus" + }); + + // Mock request + const formattedParent = client.sourcePath("[ORGANIZATION]", "[SOURCE]"); + const findingId = "findingId728776081"; + const finding = {}; + const request = { + parent: formattedParent, + findingId: findingId, + finding: finding + }; + + // Mock Grpc layer + client._innerApiCalls.createFinding = mockSimpleGrpcMethod( + request, + null, + error + ); + + client.createFinding(request, (err, response) => { + assert(err instanceof Error); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === "undefined"); + done(); + }); + }); + }); + + describe("getIamPolicy", () => { + it("invokes getIamPolicy without error", done => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: { client_email: "bogus", private_key: "bogus" }, + projectId: "bogus" + }); + + // Mock request + const formattedResource = client.sourcePath("[ORGANIZATION]", "[SOURCE]"); + const request = { + resource: formattedResource + }; + + // Mock response + const version = 351608024; + const etag = "21"; + const expectedResponse = { + version: version, + etag: etag + }; + + // Mock Grpc layer + client._innerApiCalls.getIamPolicy = mockSimpleGrpcMethod( + request, + expectedResponse + ); + + client.getIamPolicy(request, (err, response) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it("invokes getIamPolicy with error", done => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: { client_email: "bogus", private_key: "bogus" }, + projectId: "bogus" + }); + + // Mock request + const formattedResource = client.sourcePath("[ORGANIZATION]", "[SOURCE]"); + const request = { + resource: formattedResource + }; + + // Mock Grpc layer + client._innerApiCalls.getIamPolicy = mockSimpleGrpcMethod( + request, + null, + error + ); + + client.getIamPolicy(request, (err, response) => { + assert(err instanceof Error); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === "undefined"); + done(); + }); + }); + }); + + describe("getOrganizationSettings", () => { + it("invokes getOrganizationSettings without error", done => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: { client_email: "bogus", private_key: "bogus" }, + projectId: "bogus" + }); + + // Mock request + const formattedName = client.organizationSettingsPath("[ORGANIZATION]"); + const request = { + name: formattedName + }; + + // Mock response + const name2 = "name2-1052831874"; + const enableAssetDiscovery = false; + const expectedResponse = { + name: name2, + enableAssetDiscovery: enableAssetDiscovery + }; + + // Mock Grpc layer + client._innerApiCalls.getOrganizationSettings = mockSimpleGrpcMethod( + request, + expectedResponse + ); + + client.getOrganizationSettings(request, (err, response) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it("invokes getOrganizationSettings with error", done => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: { client_email: "bogus", private_key: "bogus" }, + projectId: "bogus" + }); + + // Mock request + const formattedName = client.organizationSettingsPath("[ORGANIZATION]"); + const request = { + name: formattedName + }; + + // Mock Grpc layer + client._innerApiCalls.getOrganizationSettings = mockSimpleGrpcMethod( + request, + null, + error + ); + + client.getOrganizationSettings(request, (err, response) => { + assert(err instanceof Error); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === "undefined"); + done(); + }); + }); + }); + + describe("getSource", () => { + it("invokes getSource without error", done => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: { client_email: "bogus", private_key: "bogus" }, + projectId: "bogus" + }); + + // Mock request + const formattedName = client.sourcePath("[ORGANIZATION]", "[SOURCE]"); + const request = { + name: formattedName + }; + + // Mock response + const name2 = "name2-1052831874"; + const displayName = "displayName1615086568"; + const description = "description-1724546052"; + const expectedResponse = { + name: name2, + displayName: displayName, + description: description + }; + + // Mock Grpc layer + client._innerApiCalls.getSource = mockSimpleGrpcMethod( + request, + expectedResponse + ); + + client.getSource(request, (err, response) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it("invokes getSource with error", done => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: { client_email: "bogus", private_key: "bogus" }, + projectId: "bogus" + }); + + // Mock request + const formattedName = client.sourcePath("[ORGANIZATION]", "[SOURCE]"); + const request = { + name: formattedName + }; + + // Mock Grpc layer + client._innerApiCalls.getSource = mockSimpleGrpcMethod( + request, + null, + error + ); + + client.getSource(request, (err, response) => { + assert(err instanceof Error); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === "undefined"); + done(); + }); + }); + }); + + describe("groupAssets", () => { + it("invokes groupAssets without error", done => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: { client_email: "bogus", private_key: "bogus" }, + projectId: "bogus" + }); + + // Mock request + const formattedParent = client.organizationPath("[ORGANIZATION]"); + const groupBy = "groupBy506361367"; + const request = { + parent: formattedParent, + groupBy: groupBy + }; + + // Mock response + const nextPageToken = ""; + const groupByResultsElement = {}; + const groupByResults = [groupByResultsElement]; + const expectedResponse = { + nextPageToken: nextPageToken, + groupByResults: groupByResults + }; + + // Mock Grpc layer + client._innerApiCalls.groupAssets = ( + actualRequest, + options, + callback + ) => { + assert.deepStrictEqual(actualRequest, request); + callback(null, expectedResponse.groupByResults); + }; + + client.groupAssets(request, (err, response) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse.groupByResults); + done(); + }); + }); + + it("invokes groupAssets with error", done => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: { client_email: "bogus", private_key: "bogus" }, + projectId: "bogus" + }); + + // Mock request + const formattedParent = client.organizationPath("[ORGANIZATION]"); + const groupBy = "groupBy506361367"; + const request = { + parent: formattedParent, + groupBy: groupBy + }; + + // Mock Grpc layer + client._innerApiCalls.groupAssets = mockSimpleGrpcMethod( + request, + null, + error + ); + + client.groupAssets(request, (err, response) => { + assert(err instanceof Error); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === "undefined"); + done(); + }); + }); + }); + + describe("groupFindings", () => { + it("invokes groupFindings without error", done => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: { client_email: "bogus", private_key: "bogus" }, + projectId: "bogus" + }); + + // Mock request + const formattedParent = client.sourcePath("[ORGANIZATION]", "[SOURCE]"); + const groupBy = "groupBy506361367"; + const request = { + parent: formattedParent, + groupBy: groupBy + }; + + // Mock response + const nextPageToken = ""; + const groupByResultsElement = {}; + const groupByResults = [groupByResultsElement]; + const expectedResponse = { + nextPageToken: nextPageToken, + groupByResults: groupByResults + }; + + // Mock Grpc layer + client._innerApiCalls.groupFindings = ( + actualRequest, + options, + callback + ) => { + assert.deepStrictEqual(actualRequest, request); + callback(null, expectedResponse.groupByResults); + }; + + client.groupFindings(request, (err, response) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse.groupByResults); + done(); + }); + }); + + it("invokes groupFindings with error", done => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: { client_email: "bogus", private_key: "bogus" }, + projectId: "bogus" + }); + + // Mock request + const formattedParent = client.sourcePath("[ORGANIZATION]", "[SOURCE]"); + const groupBy = "groupBy506361367"; + const request = { + parent: formattedParent, + groupBy: groupBy + }; + + // Mock Grpc layer + client._innerApiCalls.groupFindings = mockSimpleGrpcMethod( + request, + null, + error + ); + + client.groupFindings(request, (err, response) => { + assert(err instanceof Error); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === "undefined"); + done(); + }); + }); + }); + + describe("listAssets", () => { + it("invokes listAssets without error", done => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: { client_email: "bogus", private_key: "bogus" }, + projectId: "bogus" + }); + + // Mock request + const formattedParent = client.organizationPath("[ORGANIZATION]"); + const request = { + parent: formattedParent + }; + + // Mock response + const nextPageToken = ""; + const totalSize = 705419236; + const listAssetsResultsElement = {}; + const listAssetsResults = [listAssetsResultsElement]; + const expectedResponse = { + nextPageToken: nextPageToken, + totalSize: totalSize, + listAssetsResults: listAssetsResults + }; + + // Mock Grpc layer + client._innerApiCalls.listAssets = (actualRequest, options, callback) => { + assert.deepStrictEqual(actualRequest, request); + callback(null, expectedResponse.listAssetsResults); + }; + + client.listAssets(request, (err, response) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse.listAssetsResults); + done(); + }); + }); + + it("invokes listAssets with error", done => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: { client_email: "bogus", private_key: "bogus" }, + projectId: "bogus" + }); + + // Mock request + const formattedParent = client.organizationPath("[ORGANIZATION]"); + const request = { + parent: formattedParent + }; + + // Mock Grpc layer + client._innerApiCalls.listAssets = mockSimpleGrpcMethod( + request, + null, + error + ); + + client.listAssets(request, (err, response) => { + assert(err instanceof Error); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === "undefined"); + done(); + }); + }); + }); + + describe("listFindings", () => { + it("invokes listFindings without error", done => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: { client_email: "bogus", private_key: "bogus" }, + projectId: "bogus" + }); + + // Mock request + const formattedParent = client.sourcePath("[ORGANIZATION]", "[SOURCE]"); + const request = { + parent: formattedParent + }; + + // Mock response + const nextPageToken = ""; + const totalSize = 705419236; + const findingsElement = {}; + const findings = [findingsElement]; + const expectedResponse = { + nextPageToken: nextPageToken, + totalSize: totalSize, + findings: findings + }; + + // Mock Grpc layer + client._innerApiCalls.listFindings = ( + actualRequest, + options, + callback + ) => { + assert.deepStrictEqual(actualRequest, request); + callback(null, expectedResponse.findings); + }; + + client.listFindings(request, (err, response) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse.findings); + done(); + }); + }); + + it("invokes listFindings with error", done => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: { client_email: "bogus", private_key: "bogus" }, + projectId: "bogus" + }); + + // Mock request + const formattedParent = client.sourcePath("[ORGANIZATION]", "[SOURCE]"); + const request = { + parent: formattedParent + }; + + // Mock Grpc layer + client._innerApiCalls.listFindings = mockSimpleGrpcMethod( + request, + null, + error + ); + + client.listFindings(request, (err, response) => { + assert(err instanceof Error); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === "undefined"); + done(); + }); + }); + }); + + describe("listSources", () => { + it("invokes listSources without error", done => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: { client_email: "bogus", private_key: "bogus" }, + projectId: "bogus" + }); + + // Mock request + const formattedParent = client.organizationPath("[ORGANIZATION]"); + const request = { + parent: formattedParent + }; + + // Mock response + const nextPageToken = ""; + const sourcesElement = {}; + const sources = [sourcesElement]; + const expectedResponse = { + nextPageToken: nextPageToken, + sources: sources + }; + + // Mock Grpc layer + client._innerApiCalls.listSources = ( + actualRequest, + options, + callback + ) => { + assert.deepStrictEqual(actualRequest, request); + callback(null, expectedResponse.sources); + }; + + client.listSources(request, (err, response) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse.sources); + done(); + }); + }); + + it("invokes listSources with error", done => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: { client_email: "bogus", private_key: "bogus" }, + projectId: "bogus" + }); + + // Mock request + const formattedParent = client.organizationPath("[ORGANIZATION]"); + const request = { + parent: formattedParent + }; + + // Mock Grpc layer + client._innerApiCalls.listSources = mockSimpleGrpcMethod( + request, + null, + error + ); + + client.listSources(request, (err, response) => { + assert(err instanceof Error); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === "undefined"); + done(); + }); + }); + }); + + describe("runAssetDiscovery", function() { + it("invokes runAssetDiscovery without error", done => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: { client_email: "bogus", private_key: "bogus" }, + projectId: "bogus" + }); + + // Mock request + const formattedParent = client.organizationPath("[ORGANIZATION]"); + const request = { + parent: formattedParent + }; + + // Mock response + const expectedResponse = {}; + + // Mock Grpc layer + client._innerApiCalls.runAssetDiscovery = mockLongRunningGrpcMethod( + request, + expectedResponse + ); + + client + .runAssetDiscovery(request) + .then(responses => { + const operation = responses[0]; + return operation.promise(); + }) + .then(responses => { + assert.deepStrictEqual(responses[0], expectedResponse); + done(); + }) + .catch(err => { + done(err); + }); + }); + + it("invokes runAssetDiscovery with error", done => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: { client_email: "bogus", private_key: "bogus" }, + projectId: "bogus" + }); + + // Mock request + const formattedParent = client.organizationPath("[ORGANIZATION]"); + const request = { + parent: formattedParent + }; + + // Mock Grpc layer + client._innerApiCalls.runAssetDiscovery = mockLongRunningGrpcMethod( + request, + null, + error + ); + + client + .runAssetDiscovery(request) + .then(responses => { + const operation = responses[0]; + return operation.promise(); + }) + .then(() => { + assert.fail(); + }) + .catch(err => { + assert(err instanceof Error); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + done(); + }); + }); + + it("has longrunning decoder functions", () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: { client_email: "bogus", private_key: "bogus" }, + projectId: "bogus" + }); + assert( + client._descriptors.longrunning.runAssetDiscovery + .responseDecoder instanceof Function + ); + assert( + client._descriptors.longrunning.runAssetDiscovery + .metadataDecoder instanceof Function + ); + }); + }); + + describe("setFindingState", () => { + it("invokes setFindingState without error", done => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: { client_email: "bogus", private_key: "bogus" }, + projectId: "bogus" + }); + + // Mock request + const formattedName = client.findingPath( + "[ORGANIZATION]", + "[SOURCE]", + "[FINDING]" + ); + const state = "STATE_UNSPECIFIED"; + const startTime = {}; + const request = { + name: formattedName, + state: state, + startTime: startTime + }; + + // Mock response + const name2 = "name2-1052831874"; + const parent = "parent-995424086"; + const resourceName = "resourceName979421212"; + const category = "category50511102"; + const externalUri = "externalUri-1385596168"; + const expectedResponse = { + name: name2, + parent: parent, + resourceName: resourceName, + category: category, + externalUri: externalUri + }; + + // Mock Grpc layer + client._innerApiCalls.setFindingState = mockSimpleGrpcMethod( + request, + expectedResponse + ); + + client.setFindingState(request, (err, response) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it("invokes setFindingState with error", done => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: { client_email: "bogus", private_key: "bogus" }, + projectId: "bogus" + }); + + // Mock request + const formattedName = client.findingPath( + "[ORGANIZATION]", + "[SOURCE]", + "[FINDING]" + ); + const state = "STATE_UNSPECIFIED"; + const startTime = {}; + const request = { + name: formattedName, + state: state, + startTime: startTime + }; + + // Mock Grpc layer + client._innerApiCalls.setFindingState = mockSimpleGrpcMethod( + request, + null, + error + ); + + client.setFindingState(request, (err, response) => { + assert(err instanceof Error); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === "undefined"); + done(); + }); + }); + }); + + describe("setIamPolicy", () => { + it("invokes setIamPolicy without error", done => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: { client_email: "bogus", private_key: "bogus" }, + projectId: "bogus" + }); + + // Mock request + const formattedResource = client.sourcePath("[ORGANIZATION]", "[SOURCE]"); + const policy = {}; + const request = { + resource: formattedResource, + policy: policy + }; + + // Mock response + const version = 351608024; + const etag = "21"; + const expectedResponse = { + version: version, + etag: etag + }; + + // Mock Grpc layer + client._innerApiCalls.setIamPolicy = mockSimpleGrpcMethod( + request, + expectedResponse + ); + + client.setIamPolicy(request, (err, response) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it("invokes setIamPolicy with error", done => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: { client_email: "bogus", private_key: "bogus" }, + projectId: "bogus" + }); + + // Mock request + const formattedResource = client.sourcePath("[ORGANIZATION]", "[SOURCE]"); + const policy = {}; + const request = { + resource: formattedResource, + policy: policy + }; + + // Mock Grpc layer + client._innerApiCalls.setIamPolicy = mockSimpleGrpcMethod( + request, + null, + error + ); + + client.setIamPolicy(request, (err, response) => { + assert(err instanceof Error); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === "undefined"); + done(); + }); + }); + }); + + describe("testIamPermissions", () => { + it("invokes testIamPermissions without error", done => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: { client_email: "bogus", private_key: "bogus" }, + projectId: "bogus" + }); + + // Mock request + const formattedResource = client.sourcePath("[ORGANIZATION]", "[SOURCE]"); + const permissions = []; + const request = { + resource: formattedResource, + permissions: permissions + }; + + // Mock response + const expectedResponse = {}; + + // Mock Grpc layer + client._innerApiCalls.testIamPermissions = mockSimpleGrpcMethod( + request, + expectedResponse + ); + + client.testIamPermissions(request, (err, response) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it("invokes testIamPermissions with error", done => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: { client_email: "bogus", private_key: "bogus" }, + projectId: "bogus" + }); + + // Mock request + const formattedResource = client.sourcePath("[ORGANIZATION]", "[SOURCE]"); + const permissions = []; + const request = { + resource: formattedResource, + permissions: permissions + }; + + // Mock Grpc layer + client._innerApiCalls.testIamPermissions = mockSimpleGrpcMethod( + request, + null, + error + ); + + client.testIamPermissions(request, (err, response) => { + assert(err instanceof Error); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === "undefined"); + done(); + }); + }); + }); + + describe("updateFinding", () => { + it("invokes updateFinding without error", done => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: { client_email: "bogus", private_key: "bogus" }, + projectId: "bogus" + }); + + // Mock request + const finding = {}; + const request = { + finding: finding + }; + + // Mock response + const name = "name3373707"; + const parent = "parent-995424086"; + const resourceName = "resourceName979421212"; + const category = "category50511102"; + const externalUri = "externalUri-1385596168"; + const expectedResponse = { + name: name, + parent: parent, + resourceName: resourceName, + category: category, + externalUri: externalUri + }; + + // Mock Grpc layer + client._innerApiCalls.updateFinding = mockSimpleGrpcMethod( + request, + expectedResponse + ); + + client.updateFinding(request, (err, response) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it("invokes updateFinding with error", done => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: { client_email: "bogus", private_key: "bogus" }, + projectId: "bogus" + }); + + // Mock request + const finding = {}; + const request = { + finding: finding + }; + + // Mock Grpc layer + client._innerApiCalls.updateFinding = mockSimpleGrpcMethod( + request, + null, + error + ); + + client.updateFinding(request, (err, response) => { + assert(err instanceof Error); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === "undefined"); + done(); + }); + }); + }); + + describe("updateOrganizationSettings", () => { + it("invokes updateOrganizationSettings without error", done => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: { client_email: "bogus", private_key: "bogus" }, + projectId: "bogus" + }); + + // Mock request + const organizationSettings = {}; + const request = { + organizationSettings: organizationSettings + }; + + // Mock response + const name = "name3373707"; + const enableAssetDiscovery = false; + const expectedResponse = { + name: name, + enableAssetDiscovery: enableAssetDiscovery + }; + + // Mock Grpc layer + client._innerApiCalls.updateOrganizationSettings = mockSimpleGrpcMethod( + request, + expectedResponse + ); + + client.updateOrganizationSettings(request, (err, response) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it("invokes updateOrganizationSettings with error", done => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: { client_email: "bogus", private_key: "bogus" }, + projectId: "bogus" + }); + + // Mock request + const organizationSettings = {}; + const request = { + organizationSettings: organizationSettings + }; + + // Mock Grpc layer + client._innerApiCalls.updateOrganizationSettings = mockSimpleGrpcMethod( + request, + null, + error + ); + + client.updateOrganizationSettings(request, (err, response) => { + assert(err instanceof Error); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === "undefined"); + done(); + }); + }); + }); + + describe("updateSource", () => { + it("invokes updateSource without error", done => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: { client_email: "bogus", private_key: "bogus" }, + projectId: "bogus" + }); + + // Mock request + const source = {}; + const request = { + source: source + }; + + // Mock response + const name = "name3373707"; + const displayName = "displayName1615086568"; + const description = "description-1724546052"; + const expectedResponse = { + name: name, + displayName: displayName, + description: description + }; + + // Mock Grpc layer + client._innerApiCalls.updateSource = mockSimpleGrpcMethod( + request, + expectedResponse + ); + + client.updateSource(request, (err, response) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it("invokes updateSource with error", done => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: { client_email: "bogus", private_key: "bogus" }, + projectId: "bogus" + }); + + // Mock request + const source = {}; + const request = { + source: source + }; + + // Mock Grpc layer + client._innerApiCalls.updateSource = mockSimpleGrpcMethod( + request, + null, + error + ); + + client.updateSource(request, (err, response) => { + assert(err instanceof Error); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === "undefined"); + done(); + }); + }); + }); + + describe("updateSecurityMarks", () => { + it("invokes updateSecurityMarks without error", done => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: { client_email: "bogus", private_key: "bogus" }, + projectId: "bogus" + }); + + // Mock request + const securityMarks = {}; + const request = { + securityMarks: securityMarks + }; + + // Mock response + const name = "name3373707"; + const expectedResponse = { + name: name + }; + + // Mock Grpc layer + client._innerApiCalls.updateSecurityMarks = mockSimpleGrpcMethod( + request, + expectedResponse + ); + + client.updateSecurityMarks(request, (err, response) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it("invokes updateSecurityMarks with error", done => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: { client_email: "bogus", private_key: "bogus" }, + projectId: "bogus" + }); + + // Mock request + const securityMarks = {}; + const request = { + securityMarks: securityMarks + }; + + // Mock Grpc layer + client._innerApiCalls.updateSecurityMarks = mockSimpleGrpcMethod( + request, + null, + error + ); + + client.updateSecurityMarks(request, (err, response) => { + assert(err instanceof Error); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === "undefined"); + done(); + }); + }); + }); +}); + +function mockSimpleGrpcMethod(expectedRequest, response, error) { + return function(actualRequest, options, callback) { + assert.deepStrictEqual(actualRequest, expectedRequest); + if (error) { + callback(error); + } else if (response) { + callback(null, response); + } else { + callback(null); + } + }; +} + +function mockLongRunningGrpcMethod(expectedRequest, response, error) { + return request => { + assert.deepStrictEqual(request, expectedRequest); + const mockOperation = { + promise: function() { + return new Promise((resolve, reject) => { + if (error) { + reject(error); + } else { + resolve([response]); + } + }); + } + }; + return Promise.resolve([mockOperation]); + }; +} From 7588b2231c03754cd40976af496ba753174c34aa Mon Sep 17 00:00:00 2001 From: Jonathan Lui Date: Thu, 8 Nov 2018 11:05:13 -0800 Subject: [PATCH 002/342] add more scaffolding --- .../.cloud-repo-tools.json | 8 + .../google-cloud-securitycenter/.gitignore | 5 +- .../.prettierignore | 3 + .../google-cloud-securitycenter/.prettierrc | 8 + .../google-cloud-securitycenter/CONTRIBUTORS | 6 + packages/google-cloud-securitycenter/LICENSE | 202 + .../google-cloud-securitycenter/README.md | 84 + .../package-lock.json | 12611 ++++++++++++++++ .../samples/.eslintrc.yml | 3 + .../samples/quickstart.js | 21 + .../google-cloud-securitycenter/src/index.js | 4 +- .../src/v1beta1/index.js | 4 +- .../src/v1beta1/security_center_client.js | 136 +- packages/google-cloud-securitycenter/synth.py | 1 - .../system-test/.eslintrc.yml | 6 + .../test/.eslintrc.yml | 5 + .../test/gapic-v1beta1.js | 554 +- 17 files changed, 13310 insertions(+), 351 deletions(-) create mode 100644 packages/google-cloud-securitycenter/.cloud-repo-tools.json create mode 100644 packages/google-cloud-securitycenter/.prettierignore create mode 100644 packages/google-cloud-securitycenter/.prettierrc create mode 100644 packages/google-cloud-securitycenter/CONTRIBUTORS create mode 100644 packages/google-cloud-securitycenter/LICENSE create mode 100644 packages/google-cloud-securitycenter/README.md create mode 100644 packages/google-cloud-securitycenter/package-lock.json create mode 100644 packages/google-cloud-securitycenter/samples/.eslintrc.yml create mode 100644 packages/google-cloud-securitycenter/samples/quickstart.js create mode 100644 packages/google-cloud-securitycenter/system-test/.eslintrc.yml create mode 100644 packages/google-cloud-securitycenter/test/.eslintrc.yml diff --git a/packages/google-cloud-securitycenter/.cloud-repo-tools.json b/packages/google-cloud-securitycenter/.cloud-repo-tools.json new file mode 100644 index 00000000000..6cad4dfa761 --- /dev/null +++ b/packages/google-cloud-securitycenter/.cloud-repo-tools.json @@ -0,0 +1,8 @@ +{ + "requiresKeyFile": true, + "requiresProjectId": true, + "product": "security-center", + "client_reference_url": "https://cloud.google.com/nodejs/docs/reference/securitycenter/latest/", + "release_quality": "beta", + "samples": [] +} diff --git a/packages/google-cloud-securitycenter/.gitignore b/packages/google-cloud-securitycenter/.gitignore index 6b002b948bd..5b265aef806 100644 --- a/packages/google-cloud-securitycenter/.gitignore +++ b/packages/google-cloud-securitycenter/.gitignore @@ -4,7 +4,10 @@ .nyc_output docs/ out/ +build/ system-test/secrets.js system-test/*key.json *.lock -package-lock.json +.DS_Store +google-cloud-logging-winston-*.tgz +google-cloud-logging-bunyan-*.tgz diff --git a/packages/google-cloud-securitycenter/.prettierignore b/packages/google-cloud-securitycenter/.prettierignore new file mode 100644 index 00000000000..f6fac98b0a8 --- /dev/null +++ b/packages/google-cloud-securitycenter/.prettierignore @@ -0,0 +1,3 @@ +node_modules/* +samples/node_modules/* +src/**/doc/* diff --git a/packages/google-cloud-securitycenter/.prettierrc b/packages/google-cloud-securitycenter/.prettierrc new file mode 100644 index 00000000000..df6eac07446 --- /dev/null +++ b/packages/google-cloud-securitycenter/.prettierrc @@ -0,0 +1,8 @@ +--- +bracketSpacing: false +printWidth: 80 +semi: true +singleQuote: true +tabWidth: 2 +trailingComma: es5 +useTabs: false diff --git a/packages/google-cloud-securitycenter/CONTRIBUTORS b/packages/google-cloud-securitycenter/CONTRIBUTORS new file mode 100644 index 00000000000..6585b55f8f2 --- /dev/null +++ b/packages/google-cloud-securitycenter/CONTRIBUTORS @@ -0,0 +1,6 @@ +# The names of individuals who have contributed to this project. +# +# Names are formatted as: +# name +# +Jonathan Lui diff --git a/packages/google-cloud-securitycenter/LICENSE b/packages/google-cloud-securitycenter/LICENSE new file mode 100644 index 00000000000..d6456956733 --- /dev/null +++ b/packages/google-cloud-securitycenter/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-cloud-securitycenter/README.md b/packages/google-cloud-securitycenter/README.md new file mode 100644 index 00000000000..b5873778f06 --- /dev/null +++ b/packages/google-cloud-securitycenter/README.md @@ -0,0 +1,84 @@ +[//]: # "This README.md file is auto-generated, all changes to this file will be lost." +[//]: # "To regenerate it, use `npm run generate-scaffolding`." +Google Cloud Platform logo + +# [Google Cloud Security Command Center: Node.js Client](https://github.com/googleapis/nodejs-security-center) + +[![release level](https://img.shields.io/badge/release%20level-beta-yellow.svg?style=flat)](https://cloud.google.com/terms/launch-stages) +[![CircleCI](https://img.shields.io/circleci/project/github/googleapis/nodejs-security-center.svg?style=flat)](https://circleci.com/gh/googleapis/nodejs-security-center) +[![AppVeyor](https://ci.appveyor.com/api/projects/status/github/googleapis/nodejs-security-center?branch=master&svg=true)](https://ci.appveyor.com/project/googleapis/nodejs-security-center) +[![codecov](https://img.shields.io/codecov/c/github/googleapis/nodejs-security-center/master.svg?style=flat)](https://codecov.io/gh/googleapis/nodejs-security-center) + +[Cloud Security Command Center](https://cloud.google.com/security-center/docs/) helps security teams gather data, identify threats, and act on them before they result in business damage or loss. It offers deep insight into application and data risk so that you can quickly mitigate threats to your cloud resources and evaluate overall health. With Cloud Security Command Center, you can view and monitor an inventory of your cloud assets, scan storage systems for sensitive data, detect common web vulnerabilities, and review access rights to your critical resources, all from a single, centralized dashboard. + + +* [Using the client library](#using-the-client-library) +* [Versioning](#versioning) +* [Contributing](#contributing) +* [License](#license) + +## Using the client library + +1. [Select or create a Cloud Platform project][projects]. + +1. [Enable billing for your project][billing]. + +1. [Set up authentication with a service account][auth] so you can access the + API from your local workstation. + +1. Install the client library: + + npm install --save @google-cloud/security-center + +1. Try an example: + +```javascript +// Imports the Google Cloud client library +const sc = require('@google-cloud/securitycenter'); +``` + + +The [Cloud Security Command Center Node.js Client API Reference][client-docs] documentation +also contains samples. + +## Versioning + +This library follows [Semantic Versioning](http://semver.org/). + +This library is considered to be in **beta**. This means it is expected to be +mostly stable while we work toward a general availability release; however, +complete stability is not guaranteed. We will address issues and requests +against beta libraries with a high priority. + +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-security-center/blob/master/.github/CONTRIBUTING.md). + +## License + +Apache Version 2.0 + +See [LICENSE](https://github.com/googleapis/nodejs-security-center/blob/master/LICENSE) + +## What's Next + +* [Cloud Security Command Center Documentation][product-docs] +* [Cloud Security Command Center Node.js Client API Reference][client-docs] +* [github.com/googleapis/nodejs-security-center](https://github.com/googleapis/nodejs-security-center) + +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 + +[client-docs]: https://cloud.google.com/nodejs/docs/reference/securitycenter/latest/ +[product-docs]: https://cloud.google.com/security-center/docs/ +[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= +[auth]: https://cloud.google.com/docs/authentication/getting-started diff --git a/packages/google-cloud-securitycenter/package-lock.json b/packages/google-cloud-securitycenter/package-lock.json new file mode 100644 index 00000000000..ba28b4715fa --- /dev/null +++ b/packages/google-cloud-securitycenter/package-lock.json @@ -0,0 +1,12611 @@ +{ + "name": "@google-cloud/security-center", + "version": "0.1.0", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "@ava/babel-plugin-throws-helper": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@ava/babel-plugin-throws-helper/-/babel-plugin-throws-helper-2.0.0.tgz", + "integrity": "sha1-L8H+PCEacQcaTsp7j3r1hCzRrnw=", + "dev": true + }, + "@ava/babel-preset-stage-4": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@ava/babel-preset-stage-4/-/babel-preset-stage-4-1.1.0.tgz", + "integrity": "sha512-oWqTnIGXW3k72UFidXzW0ONlO7hnO9x02S/QReJ7NBGeiBH9cUHY9+EfV6C8PXC6YJH++WrliEq03wMSJGNZFg==", + "dev": true, + "requires": { + "babel-plugin-check-es2015-constants": "^6.8.0", + "babel-plugin-syntax-trailing-function-commas": "^6.20.0", + "babel-plugin-transform-async-to-generator": "^6.16.0", + "babel-plugin-transform-es2015-destructuring": "^6.19.0", + "babel-plugin-transform-es2015-function-name": "^6.9.0", + "babel-plugin-transform-es2015-modules-commonjs": "^6.18.0", + "babel-plugin-transform-es2015-parameters": "^6.21.0", + "babel-plugin-transform-es2015-spread": "^6.8.0", + "babel-plugin-transform-es2015-sticky-regex": "^6.8.0", + "babel-plugin-transform-es2015-unicode-regex": "^6.11.0", + "babel-plugin-transform-exponentiation-operator": "^6.8.0", + "package-hash": "^1.2.0" + }, + "dependencies": { + "md5-hex": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/md5-hex/-/md5-hex-1.3.0.tgz", + "integrity": "sha1-0sSv6YPENwZiF5uMrRRSGRNQRsQ=", + "dev": true, + "requires": { + "md5-o-matic": "^0.1.1" + } + }, + "package-hash": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/package-hash/-/package-hash-1.2.0.tgz", + "integrity": "sha1-AD5WzVe3NqbtYRTMK4FUJnJ3DkQ=", + "dev": true, + "requires": { + "md5-hex": "^1.3.0" + } + } + } + }, + "@ava/babel-preset-transform-test-files": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@ava/babel-preset-transform-test-files/-/babel-preset-transform-test-files-3.0.0.tgz", + "integrity": "sha1-ze0RlqjY2TgaUJJAq5LpGl7Aafc=", + "dev": true, + "requires": { + "@ava/babel-plugin-throws-helper": "^2.0.0", + "babel-plugin-espower": "^2.3.2" + } + }, + "@ava/write-file-atomic": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/@ava/write-file-atomic/-/write-file-atomic-2.2.0.tgz", + "integrity": "sha512-BTNB3nGbEfJT+69wuqXFr/bQH7Vr7ihx2xGOMNqPgDGhwspoZhiWumDDZNjBy7AScmqS5CELIOGtPVXESyrnDA==", + "dev": true, + "requires": { + "graceful-fs": "^4.1.11", + "imurmurhash": "^0.1.4", + "slide": "^1.1.5" + } + }, + "@babel/code-frame": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.0.0.tgz", + "integrity": "sha512-OfC2uemaknXr87bdLUkWog7nYuliM9Ij5HUcajsVcMCpQrcLmtxRbVFTIqmcSkSeYRBFBRxs2FiUqFJDLdiebA==", + "dev": true, + "requires": { + "@babel/highlight": "^7.0.0" + } + }, + "@babel/generator": { + "version": "7.1.3", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.1.3.tgz", + "integrity": "sha512-ZoCZGcfIJFJuZBqxcY9OjC1KW2lWK64qrX1o4UYL3yshVhwKFYgzpWZ0vvtGMNJdTlvkw0W+HR1VnYN8q3QPFQ==", + "dev": true, + "requires": { + "@babel/types": "^7.1.3", + "jsesc": "^2.5.1", + "lodash": "^4.17.10", + "source-map": "^0.5.0", + "trim-right": "^1.0.1" + }, + "dependencies": { + "jsesc": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.1.tgz", + "integrity": "sha1-5CGiqOINawgZ3yiQj3glJrlt0f4=", + "dev": true + } + } + }, + "@babel/helper-function-name": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.1.0.tgz", + "integrity": "sha512-A95XEoCpb3TO+KZzJ4S/5uW5fNe26DjBGqf1o9ucyLyCmi1dXq/B3c8iaWTfBk3VvetUxl16e8tIrd5teOCfGw==", + "dev": true, + "requires": { + "@babel/helper-get-function-arity": "^7.0.0", + "@babel/template": "^7.1.0", + "@babel/types": "^7.0.0" + } + }, + "@babel/helper-get-function-arity": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.0.0.tgz", + "integrity": "sha512-r2DbJeg4svYvt3HOS74U4eWKsUAMRH01Z1ds1zx8KNTPtpTL5JAsdFv8BNyOpVqdFhHkkRDIg5B4AsxmkjAlmQ==", + "dev": true, + "requires": { + "@babel/types": "^7.0.0" + } + }, + "@babel/helper-split-export-declaration": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.0.0.tgz", + "integrity": "sha512-MXkOJqva62dfC0w85mEf/LucPPS/1+04nmmRMPEBUB++hiiThQ2zPtX/mEWQ3mtzCEjIJvPY8nuwxXtQeQwUag==", + "dev": true, + "requires": { + "@babel/types": "^7.0.0" + } + }, + "@babel/highlight": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.0.0.tgz", + "integrity": "sha512-UFMC4ZeFC48Tpvj7C8UgLvtkaUuovQX+5xNWrsIoMG8o2z+XFKjKaN9iVmS84dPwVN00W4wPmqvYoZF3EGAsfw==", + "dev": true, + "requires": { + "chalk": "^2.0.0", + "esutils": "^2.0.2", + "js-tokens": "^4.0.0" + }, + "dependencies": { + "js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "dev": true + } + } + }, + "@babel/parser": { + "version": "7.1.3", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.1.3.tgz", + "integrity": "sha512-gqmspPZOMW3MIRb9HlrnbZHXI1/KHTOroBwN1NcLL6pWxzqzEKGvRTq0W/PxS45OtQGbaFikSQpkS5zbnsQm2w==", + "dev": true + }, + "@babel/template": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.1.2.tgz", + "integrity": "sha512-SY1MmplssORfFiLDcOETrW7fCLl+PavlwMh92rrGcikQaRq4iWPVH0MpwPpY3etVMx6RnDjXtr6VZYr/IbP/Ag==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.0.0", + "@babel/parser": "^7.1.2", + "@babel/types": "^7.1.2" + } + }, + "@babel/traverse": { + "version": "7.1.4", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.1.4.tgz", + "integrity": "sha512-my9mdrAIGdDiSVBuMjpn/oXYpva0/EZwWL3sm3Wcy/AVWO2eXnsoZruOT9jOGNRXU8KbCIu5zsKnXcAJ6PcV6Q==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.0.0", + "@babel/generator": "^7.1.3", + "@babel/helper-function-name": "^7.1.0", + "@babel/helper-split-export-declaration": "^7.0.0", + "@babel/parser": "^7.1.3", + "@babel/types": "^7.1.3", + "debug": "^3.1.0", + "globals": "^11.1.0", + "lodash": "^4.17.10" + }, + "dependencies": { + "debug": { + "version": "3.2.6", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", + "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + }, + "globals": { + "version": "11.8.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.8.0.tgz", + "integrity": "sha512-io6LkyPVuzCHBSQV9fmOwxZkUk6nIaGmxheLDgmuFv89j0fm2aqDbIXKAGfzCMHqz3HLF2Zf8WSG6VqMh2qFmA==", + "dev": true + }, + "ms": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", + "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", + "dev": true + } + } + }, + "@babel/types": { + "version": "7.1.3", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.1.3.tgz", + "integrity": "sha512-RpPOVfK+yatXyn8n4PB1NW6k9qjinrXrRR8ugBN8fD6hCy5RXI6PSbVqpOJBO9oSaY7Nom4ohj35feb0UR9hSA==", + "dev": true, + "requires": { + "esutils": "^2.0.2", + "lodash": "^4.17.10", + "to-fast-properties": "^2.0.0" + }, + "dependencies": { + "to-fast-properties": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", + "integrity": "sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4=", + "dev": true + } + } + }, + "@concordance/react": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@concordance/react/-/react-1.0.0.tgz", + "integrity": "sha512-htrsRaQX8Iixlsek8zQU7tE8wcsTQJ5UhZkSPEA8slCDAisKpC/2VgU/ucPn32M5/LjGGXRaUEKvEw1Wiuu4zQ==", + "dev": true, + "requires": { + "arrify": "^1.0.1" + } + }, + "@google-cloud/nodejs-repo-tools": { + "version": "2.3.5", + "resolved": "https://registry.npmjs.org/@google-cloud/nodejs-repo-tools/-/nodejs-repo-tools-2.3.5.tgz", + "integrity": "sha512-KqYh9hJFkmEzaFBM58+e2DjuOSO3M0pUZ/S5Ms8LEFuymwYbH8hZgjUFOgXDhi3J5Z2Ol4XTPTSVSrVZU4RVDg==", + "dev": true, + "requires": { + "@sindresorhus/slugify": "^0.3.0", + "ava": "0.25.0", + "colors": "1.1.2", + "fs-extra": "^6.0.0", + "got": "^8.3.2", + "handlebars": "4.0.11", + "lodash": "^4.17.11", + "nyc": "11.7.2", + "proxyquire": "^2.0.0", + "semver": "^5.5.0", + "sinon": "6.0.1", + "supertest": "^3.2.0", + "yargs": "^12.0.1", + "yargs-parser": "10.1.0" + }, + "dependencies": { + "ansi-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "dev": true + }, + "cliui": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-4.1.0.tgz", + "integrity": "sha512-4FG+RSG9DL7uEwRUZXZn3SS34DiDPfzP0VOiEwtUWlE+AR2EIg+hSyvrIgUUfhdgR/UkAeW2QHgeP+hWrXs7jQ==", + "dev": true, + "requires": { + "string-width": "^2.1.1", + "strip-ansi": "^4.0.0", + "wrap-ansi": "^2.0.0" + } + }, + "cross-spawn": { + "version": "6.0.5", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", + "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", + "dev": true, + "requires": { + "nice-try": "^1.0.4", + "path-key": "^2.0.1", + "semver": "^5.5.0", + "shebang-command": "^1.2.0", + "which": "^1.2.9" + } + }, + "decamelize": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-2.0.0.tgz", + "integrity": "sha512-Ikpp5scV3MSYxY39ymh45ZLEecsTdv/Xj2CaQfI8RLMuwi7XvjX9H/fhraiSuU+C5w5NTDu4ZU72xNiZnurBPg==", + "dev": true, + "requires": { + "xregexp": "4.0.0" + } + }, + "execa": { + "version": "0.10.0", + "resolved": "https://registry.npmjs.org/execa/-/execa-0.10.0.tgz", + "integrity": "sha512-7XOMnz8Ynx1gGo/3hyV9loYNPWM94jG3+3T3Y8tsfSstFmETmENCMU/A/zj8Lyaj1lkgEepKepvd6240tBRvlw==", + "dev": true, + "requires": { + "cross-spawn": "^6.0.0", + "get-stream": "^3.0.0", + "is-stream": "^1.1.0", + "npm-run-path": "^2.0.0", + "p-finally": "^1.0.0", + "signal-exit": "^3.0.0", + "strip-eof": "^1.0.0" + } + }, + "find-up": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", + "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", + "dev": true, + "requires": { + "locate-path": "^3.0.0" + } + }, + "invert-kv": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-2.0.0.tgz", + "integrity": "sha512-wPVv/y/QQ/Uiirj/vh3oP+1Ww+AWehmi1g5fFWGPF6IpCBCDVrhgHRMvrLfdYcwDh3QJbGXDW4JAuzxElLSqKA==", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true + }, + "lcid": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/lcid/-/lcid-2.0.0.tgz", + "integrity": "sha512-avPEb8P8EGnwXKClwsNUgryVjllcRqtMYa49NTsbQagYuT1DcXnl1915oxWjoyGrXR6zH/Y0Zc96xWsPcoDKeA==", + "dev": true, + "requires": { + "invert-kv": "^2.0.0" + } + }, + "locate-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", + "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", + "dev": true, + "requires": { + "p-locate": "^3.0.0", + "path-exists": "^3.0.0" + } + }, + "nyc": { + "version": "11.7.2", + "resolved": "https://registry.npmjs.org/nyc/-/nyc-11.7.2.tgz", + "integrity": "sha512-gBt7qwsR1vryYfglVjQRx1D+AtMZW5NbUKxb+lZe8SN8KsheGCPGWEsSC9AGQG+r2+te1+10uPHUCahuqm1nGQ==", + "dev": true, + "requires": { + "archy": "^1.0.0", + "arrify": "^1.0.1", + "caching-transform": "^1.0.0", + "convert-source-map": "^1.5.1", + "debug-log": "^1.0.1", + "default-require-extensions": "^1.0.0", + "find-cache-dir": "^0.1.1", + "find-up": "^2.1.0", + "foreground-child": "^1.5.3", + "glob": "^7.0.6", + "istanbul-lib-coverage": "^1.1.2", + "istanbul-lib-hook": "^1.1.0", + "istanbul-lib-instrument": "^1.10.0", + "istanbul-lib-report": "^1.1.3", + "istanbul-lib-source-maps": "^1.2.3", + "istanbul-reports": "^1.4.0", + "md5-hex": "^1.2.0", + "merge-source-map": "^1.1.0", + "micromatch": "^3.1.10", + "mkdirp": "^0.5.0", + "resolve-from": "^2.0.0", + "rimraf": "^2.6.2", + "signal-exit": "^3.0.1", + "spawn-wrap": "^1.4.2", + "test-exclude": "^4.2.0", + "yargs": "11.1.0", + "yargs-parser": "^8.0.0" + }, + "dependencies": { + "align-text": { + "version": "0.1.4", + "bundled": true, + "dev": true, + "requires": { + "kind-of": "^3.0.2", + "longest": "^1.0.1", + "repeat-string": "^1.5.2" + } + }, + "amdefine": { + "version": "1.0.1", + "bundled": true, + "dev": true + }, + "ansi-regex": { + "version": "2.1.1", + "bundled": true, + "dev": true + }, + "ansi-styles": { + "version": "2.2.1", + "bundled": true, + "dev": true + }, + "append-transform": { + "version": "0.4.0", + "bundled": true, + "dev": true, + "requires": { + "default-require-extensions": "^1.0.0" + } + }, + "archy": { + "version": "1.0.0", + "bundled": true, + "dev": true + }, + "arr-diff": { + "version": "4.0.0", + "bundled": true, + "dev": true + }, + "arr-flatten": { + "version": "1.1.0", + "bundled": true, + "dev": true + }, + "arr-union": { + "version": "3.1.0", + "bundled": true, + "dev": true + }, + "array-unique": { + "version": "0.3.2", + "bundled": true, + "dev": true + }, + "arrify": { + "version": "1.0.1", + "bundled": true, + "dev": true + }, + "assign-symbols": { + "version": "1.0.0", + "bundled": true, + "dev": true + }, + "async": { + "version": "1.5.2", + "bundled": true, + "dev": true + }, + "atob": { + "version": "2.1.1", + "bundled": true, + "dev": true + }, + "babel-code-frame": { + "version": "6.26.0", + "bundled": true, + "dev": true, + "requires": { + "chalk": "^1.1.3", + "esutils": "^2.0.2", + "js-tokens": "^3.0.2" + } + }, + "babel-generator": { + "version": "6.26.1", + "bundled": true, + "dev": true, + "requires": { + "babel-messages": "^6.23.0", + "babel-runtime": "^6.26.0", + "babel-types": "^6.26.0", + "detect-indent": "^4.0.0", + "jsesc": "^1.3.0", + "lodash": "^4.17.4", + "source-map": "^0.5.7", + "trim-right": "^1.0.1" + } + }, + "babel-messages": { + "version": "6.23.0", + "bundled": true, + "dev": true, + "requires": { + "babel-runtime": "^6.22.0" + } + }, + "babel-runtime": { + "version": "6.26.0", + "bundled": true, + "dev": true, + "requires": { + "core-js": "^2.4.0", + "regenerator-runtime": "^0.11.0" + } + }, + "babel-template": { + "version": "6.26.0", + "bundled": true, + "dev": true, + "requires": { + "babel-runtime": "^6.26.0", + "babel-traverse": "^6.26.0", + "babel-types": "^6.26.0", + "babylon": "^6.18.0", + "lodash": "^4.17.4" + } + }, + "babel-traverse": { + "version": "6.26.0", + "bundled": true, + "dev": true, + "requires": { + "babel-code-frame": "^6.26.0", + "babel-messages": "^6.23.0", + "babel-runtime": "^6.26.0", + "babel-types": "^6.26.0", + "babylon": "^6.18.0", + "debug": "^2.6.8", + "globals": "^9.18.0", + "invariant": "^2.2.2", + "lodash": "^4.17.4" + } + }, + "babel-types": { + "version": "6.26.0", + "bundled": true, + "dev": true, + "requires": { + "babel-runtime": "^6.26.0", + "esutils": "^2.0.2", + "lodash": "^4.17.4", + "to-fast-properties": "^1.0.3" + } + }, + "babylon": { + "version": "6.18.0", + "bundled": true, + "dev": true + }, + "balanced-match": { + "version": "1.0.0", + "bundled": true, + "dev": true + }, + "base": { + "version": "0.11.2", + "bundled": true, + "dev": true, + "requires": { + "cache-base": "^1.0.1", + "class-utils": "^0.3.5", + "component-emitter": "^1.2.1", + "define-property": "^1.0.0", + "isobject": "^3.0.1", + "mixin-deep": "^1.2.0", + "pascalcase": "^0.1.1" + }, + "dependencies": { + "define-property": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "requires": { + "is-descriptor": "^1.0.0" + } + }, + "is-accessor-descriptor": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-descriptor": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "requires": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + } + }, + "kind-of": { + "version": "6.0.2", + "bundled": true, + "dev": true + } + } + }, + "brace-expansion": { + "version": "1.1.11", + "bundled": true, + "dev": true, + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "braces": { + "version": "2.3.2", + "bundled": true, + "dev": true, + "requires": { + "arr-flatten": "^1.1.0", + "array-unique": "^0.3.2", + "extend-shallow": "^2.0.1", + "fill-range": "^4.0.0", + "isobject": "^3.0.1", + "repeat-element": "^1.1.2", + "snapdragon": "^0.8.1", + "snapdragon-node": "^2.0.1", + "split-string": "^3.0.2", + "to-regex": "^3.0.1" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "bundled": true, + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "builtin-modules": { + "version": "1.1.1", + "bundled": true, + "dev": true + }, + "cache-base": { + "version": "1.0.1", + "bundled": true, + "dev": true, + "requires": { + "collection-visit": "^1.0.0", + "component-emitter": "^1.2.1", + "get-value": "^2.0.6", + "has-value": "^1.0.0", + "isobject": "^3.0.1", + "set-value": "^2.0.0", + "to-object-path": "^0.3.0", + "union-value": "^1.0.0", + "unset-value": "^1.0.0" + } + }, + "caching-transform": { + "version": "1.0.1", + "bundled": true, + "dev": true, + "requires": { + "md5-hex": "^1.2.0", + "mkdirp": "^0.5.1", + "write-file-atomic": "^1.1.4" + } + }, + "camelcase": { + "version": "1.2.1", + "bundled": true, + "dev": true, + "optional": true + }, + "center-align": { + "version": "0.1.3", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "align-text": "^0.1.3", + "lazy-cache": "^1.0.3" + } + }, + "chalk": { + "version": "1.1.3", + "bundled": true, + "dev": true, + "requires": { + "ansi-styles": "^2.2.1", + "escape-string-regexp": "^1.0.2", + "has-ansi": "^2.0.0", + "strip-ansi": "^3.0.0", + "supports-color": "^2.0.0" + } + }, + "class-utils": { + "version": "0.3.6", + "bundled": true, + "dev": true, + "requires": { + "arr-union": "^3.1.0", + "define-property": "^0.2.5", + "isobject": "^3.0.0", + "static-extend": "^0.1.1" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "bundled": true, + "dev": true, + "requires": { + "is-descriptor": "^0.1.0" + } + } + } + }, + "cliui": { + "version": "2.1.0", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "center-align": "^0.1.1", + "right-align": "^0.1.1", + "wordwrap": "0.0.2" + }, + "dependencies": { + "wordwrap": { + "version": "0.0.2", + "bundled": true, + "dev": true, + "optional": true + } + } + }, + "code-point-at": { + "version": "1.1.0", + "bundled": true, + "dev": true + }, + "collection-visit": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "requires": { + "map-visit": "^1.0.0", + "object-visit": "^1.0.0" + } + }, + "commondir": { + "version": "1.0.1", + "bundled": true, + "dev": true + }, + "component-emitter": { + "version": "1.2.1", + "bundled": true, + "dev": true + }, + "concat-map": { + "version": "0.0.1", + "bundled": true, + "dev": true + }, + "convert-source-map": { + "version": "1.5.1", + "bundled": true, + "dev": true + }, + "copy-descriptor": { + "version": "0.1.1", + "bundled": true, + "dev": true + }, + "core-js": { + "version": "2.5.6", + "bundled": true, + "dev": true + }, + "cross-spawn": { + "version": "4.0.2", + "bundled": true, + "dev": true, + "requires": { + "lru-cache": "^4.0.1", + "which": "^1.2.9" + } + }, + "debug": { + "version": "2.6.9", + "bundled": true, + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "debug-log": { + "version": "1.0.1", + "bundled": true, + "dev": true + }, + "decamelize": { + "version": "1.2.0", + "bundled": true, + "dev": true + }, + "decode-uri-component": { + "version": "0.2.0", + "bundled": true, + "dev": true + }, + "default-require-extensions": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "requires": { + "strip-bom": "^2.0.0" + } + }, + "define-property": { + "version": "2.0.2", + "bundled": true, + "dev": true, + "requires": { + "is-descriptor": "^1.0.2", + "isobject": "^3.0.1" + }, + "dependencies": { + "is-accessor-descriptor": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-descriptor": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "requires": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + } + }, + "kind-of": { + "version": "6.0.2", + "bundled": true, + "dev": true + } + } + }, + "detect-indent": { + "version": "4.0.0", + "bundled": true, + "dev": true, + "requires": { + "repeating": "^2.0.0" + } + }, + "error-ex": { + "version": "1.3.1", + "bundled": true, + "dev": true, + "requires": { + "is-arrayish": "^0.2.1" + } + }, + "escape-string-regexp": { + "version": "1.0.5", + "bundled": true, + "dev": true + }, + "esutils": { + "version": "2.0.2", + "bundled": true, + "dev": true + }, + "execa": { + "version": "0.7.0", + "bundled": true, + "dev": true, + "requires": { + "cross-spawn": "^5.0.1", + "get-stream": "^3.0.0", + "is-stream": "^1.1.0", + "npm-run-path": "^2.0.0", + "p-finally": "^1.0.0", + "signal-exit": "^3.0.0", + "strip-eof": "^1.0.0" + }, + "dependencies": { + "cross-spawn": { + "version": "5.1.0", + "bundled": true, + "dev": true, + "requires": { + "lru-cache": "^4.0.1", + "shebang-command": "^1.2.0", + "which": "^1.2.9" + } + } + } + }, + "expand-brackets": { + "version": "2.1.4", + "bundled": true, + "dev": true, + "requires": { + "debug": "^2.3.3", + "define-property": "^0.2.5", + "extend-shallow": "^2.0.1", + "posix-character-classes": "^0.1.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "bundled": true, + "dev": true, + "requires": { + "is-descriptor": "^0.1.0" + } + }, + "extend-shallow": { + "version": "2.0.1", + "bundled": true, + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "extend-shallow": { + "version": "3.0.2", + "bundled": true, + "dev": true, + "requires": { + "assign-symbols": "^1.0.0", + "is-extendable": "^1.0.1" + }, + "dependencies": { + "is-extendable": { + "version": "1.0.1", + "bundled": true, + "dev": true, + "requires": { + "is-plain-object": "^2.0.4" + } + } + } + }, + "extglob": { + "version": "2.0.4", + "bundled": true, + "dev": true, + "requires": { + "array-unique": "^0.3.2", + "define-property": "^1.0.0", + "expand-brackets": "^2.1.4", + "extend-shallow": "^2.0.1", + "fragment-cache": "^0.2.1", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" + }, + "dependencies": { + "define-property": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "requires": { + "is-descriptor": "^1.0.0" + } + }, + "extend-shallow": { + "version": "2.0.1", + "bundled": true, + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + }, + "is-accessor-descriptor": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-descriptor": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "requires": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + } + }, + "kind-of": { + "version": "6.0.2", + "bundled": true, + "dev": true + } + } + }, + "fill-range": { + "version": "4.0.0", + "bundled": true, + "dev": true, + "requires": { + "extend-shallow": "^2.0.1", + "is-number": "^3.0.0", + "repeat-string": "^1.6.1", + "to-regex-range": "^2.1.0" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "bundled": true, + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "find-cache-dir": { + "version": "0.1.1", + "bundled": true, + "dev": true, + "requires": { + "commondir": "^1.0.1", + "mkdirp": "^0.5.1", + "pkg-dir": "^1.0.0" + } + }, + "find-up": { + "version": "2.1.0", + "bundled": true, + "dev": true, + "requires": { + "locate-path": "^2.0.0" + } + }, + "for-in": { + "version": "1.0.2", + "bundled": true, + "dev": true + }, + "foreground-child": { + "version": "1.5.6", + "bundled": true, + "dev": true, + "requires": { + "cross-spawn": "^4", + "signal-exit": "^3.0.0" + } + }, + "fragment-cache": { + "version": "0.2.1", + "bundled": true, + "dev": true, + "requires": { + "map-cache": "^0.2.2" + } + }, + "fs.realpath": { + "version": "1.0.0", + "bundled": true, + "dev": true + }, + "get-caller-file": { + "version": "1.0.2", + "bundled": true, + "dev": true + }, + "get-stream": { + "version": "3.0.0", + "bundled": true, + "dev": true + }, + "get-value": { + "version": "2.0.6", + "bundled": true, + "dev": true + }, + "glob": { + "version": "7.1.2", + "bundled": true, + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "globals": { + "version": "9.18.0", + "bundled": true, + "dev": true + }, + "graceful-fs": { + "version": "4.1.11", + "bundled": true, + "dev": true + }, + "handlebars": { + "version": "4.0.11", + "bundled": true, + "dev": true, + "requires": { + "async": "^1.4.0", + "optimist": "^0.6.1", + "source-map": "^0.4.4", + "uglify-js": "^2.6" + }, + "dependencies": { + "source-map": { + "version": "0.4.4", + "bundled": true, + "dev": true, + "requires": { + "amdefine": ">=0.0.4" + } + } + } + }, + "has-ansi": { + "version": "2.0.0", + "bundled": true, + "dev": true, + "requires": { + "ansi-regex": "^2.0.0" + } + }, + "has-flag": { + "version": "1.0.0", + "bundled": true, + "dev": true + }, + "has-value": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "requires": { + "get-value": "^2.0.6", + "has-values": "^1.0.0", + "isobject": "^3.0.0" + } + }, + "has-values": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "requires": { + "is-number": "^3.0.0", + "kind-of": "^4.0.0" + }, + "dependencies": { + "kind-of": { + "version": "4.0.0", + "bundled": true, + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "hosted-git-info": { + "version": "2.6.0", + "bundled": true, + "dev": true + }, + "imurmurhash": { + "version": "0.1.4", + "bundled": true, + "dev": true + }, + "inflight": { + "version": "1.0.6", + "bundled": true, + "dev": true, + "requires": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "inherits": { + "version": "2.0.3", + "bundled": true, + "dev": true + }, + "invariant": { + "version": "2.2.4", + "bundled": true, + "dev": true, + "requires": { + "loose-envify": "^1.0.0" + } + }, + "invert-kv": { + "version": "1.0.0", + "bundled": true, + "dev": true + }, + "is-accessor-descriptor": { + "version": "0.1.6", + "bundled": true, + "dev": true, + "requires": { + "kind-of": "^3.0.2" + } + }, + "is-arrayish": { + "version": "0.2.1", + "bundled": true, + "dev": true + }, + "is-buffer": { + "version": "1.1.6", + "bundled": true, + "dev": true + }, + "is-builtin-module": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "requires": { + "builtin-modules": "^1.0.0" + } + }, + "is-data-descriptor": { + "version": "0.1.4", + "bundled": true, + "dev": true, + "requires": { + "kind-of": "^3.0.2" + } + }, + "is-descriptor": { + "version": "0.1.6", + "bundled": true, + "dev": true, + "requires": { + "is-accessor-descriptor": "^0.1.6", + "is-data-descriptor": "^0.1.4", + "kind-of": "^5.0.0" + }, + "dependencies": { + "kind-of": { + "version": "5.1.0", + "bundled": true, + "dev": true + } + } + }, + "is-extendable": { + "version": "0.1.1", + "bundled": true, + "dev": true + }, + "is-finite": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "requires": { + "number-is-nan": "^1.0.0" + } + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "bundled": true, + "dev": true + }, + "is-number": { + "version": "3.0.0", + "bundled": true, + "dev": true, + "requires": { + "kind-of": "^3.0.2" + } + }, + "is-odd": { + "version": "2.0.0", + "bundled": true, + "dev": true, + "requires": { + "is-number": "^4.0.0" + }, + "dependencies": { + "is-number": { + "version": "4.0.0", + "bundled": true, + "dev": true + } + } + }, + "is-plain-object": { + "version": "2.0.4", + "bundled": true, + "dev": true, + "requires": { + "isobject": "^3.0.1" + } + }, + "is-stream": { + "version": "1.1.0", + "bundled": true, + "dev": true + }, + "is-utf8": { + "version": "0.2.1", + "bundled": true, + "dev": true + }, + "is-windows": { + "version": "1.0.2", + "bundled": true, + "dev": true + }, + "isarray": { + "version": "1.0.0", + "bundled": true, + "dev": true + }, + "isexe": { + "version": "2.0.0", + "bundled": true, + "dev": true + }, + "isobject": { + "version": "3.0.1", + "bundled": true, + "dev": true + }, + "istanbul-lib-coverage": { + "version": "1.2.0", + "bundled": true, + "dev": true + }, + "istanbul-lib-hook": { + "version": "1.1.0", + "bundled": true, + "dev": true, + "requires": { + "append-transform": "^0.4.0" + } + }, + "istanbul-lib-instrument": { + "version": "1.10.1", + "bundled": true, + "dev": true, + "requires": { + "babel-generator": "^6.18.0", + "babel-template": "^6.16.0", + "babel-traverse": "^6.18.0", + "babel-types": "^6.18.0", + "babylon": "^6.18.0", + "istanbul-lib-coverage": "^1.2.0", + "semver": "^5.3.0" + } + }, + "istanbul-lib-report": { + "version": "1.1.3", + "bundled": true, + "dev": true, + "requires": { + "istanbul-lib-coverage": "^1.1.2", + "mkdirp": "^0.5.1", + "path-parse": "^1.0.5", + "supports-color": "^3.1.2" + }, + "dependencies": { + "supports-color": { + "version": "3.2.3", + "bundled": true, + "dev": true, + "requires": { + "has-flag": "^1.0.0" + } + } + } + }, + "istanbul-lib-source-maps": { + "version": "1.2.3", + "bundled": true, + "dev": true, + "requires": { + "debug": "^3.1.0", + "istanbul-lib-coverage": "^1.1.2", + "mkdirp": "^0.5.1", + "rimraf": "^2.6.1", + "source-map": "^0.5.3" + }, + "dependencies": { + "debug": { + "version": "3.1.0", + "bundled": true, + "dev": true, + "requires": { + "ms": "2.0.0" + } + } + } + }, + "istanbul-reports": { + "version": "1.4.0", + "bundled": true, + "dev": true, + "requires": { + "handlebars": "^4.0.3" + } + }, + "js-tokens": { + "version": "3.0.2", + "bundled": true, + "dev": true + }, + "jsesc": { + "version": "1.3.0", + "bundled": true, + "dev": true + }, + "kind-of": { + "version": "3.2.2", + "bundled": true, + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + }, + "lazy-cache": { + "version": "1.0.4", + "bundled": true, + "dev": true, + "optional": true + }, + "lcid": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "requires": { + "invert-kv": "^1.0.0" + } + }, + "load-json-file": { + "version": "1.1.0", + "bundled": true, + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "parse-json": "^2.2.0", + "pify": "^2.0.0", + "pinkie-promise": "^2.0.0", + "strip-bom": "^2.0.0" + } + }, + "locate-path": { + "version": "2.0.0", + "bundled": true, + "dev": true, + "requires": { + "p-locate": "^2.0.0", + "path-exists": "^3.0.0" + }, + "dependencies": { + "path-exists": { + "version": "3.0.0", + "bundled": true, + "dev": true + } + } + }, + "lodash": { + "version": "4.17.10", + "bundled": true, + "dev": true + }, + "longest": { + "version": "1.0.1", + "bundled": true, + "dev": true + }, + "loose-envify": { + "version": "1.3.1", + "bundled": true, + "dev": true, + "requires": { + "js-tokens": "^3.0.0" + } + }, + "lru-cache": { + "version": "4.1.3", + "bundled": true, + "dev": true, + "requires": { + "pseudomap": "^1.0.2", + "yallist": "^2.1.2" + } + }, + "map-cache": { + "version": "0.2.2", + "bundled": true, + "dev": true + }, + "map-visit": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "requires": { + "object-visit": "^1.0.0" + } + }, + "md5-hex": { + "version": "1.3.0", + "bundled": true, + "dev": true, + "requires": { + "md5-o-matic": "^0.1.1" + } + }, + "md5-o-matic": { + "version": "0.1.1", + "bundled": true, + "dev": true + }, + "mem": { + "version": "1.1.0", + "bundled": true, + "dev": true, + "requires": { + "mimic-fn": "^1.0.0" + } + }, + "merge-source-map": { + "version": "1.1.0", + "bundled": true, + "dev": true, + "requires": { + "source-map": "^0.6.1" + }, + "dependencies": { + "source-map": { + "version": "0.6.1", + "bundled": true, + "dev": true + } + } + }, + "micromatch": { + "version": "3.1.10", + "bundled": true, + "dev": true, + "requires": { + "arr-diff": "^4.0.0", + "array-unique": "^0.3.2", + "braces": "^2.3.1", + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "extglob": "^2.0.4", + "fragment-cache": "^0.2.1", + "kind-of": "^6.0.2", + "nanomatch": "^1.2.9", + "object.pick": "^1.3.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "6.0.2", + "bundled": true, + "dev": true + } + } + }, + "mimic-fn": { + "version": "1.2.0", + "bundled": true, + "dev": true + }, + "minimatch": { + "version": "3.0.4", + "bundled": true, + "dev": true, + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "minimist": { + "version": "0.0.8", + "bundled": true, + "dev": true + }, + "mixin-deep": { + "version": "1.3.1", + "bundled": true, + "dev": true, + "requires": { + "for-in": "^1.0.2", + "is-extendable": "^1.0.1" + }, + "dependencies": { + "is-extendable": { + "version": "1.0.1", + "bundled": true, + "dev": true, + "requires": { + "is-plain-object": "^2.0.4" + } + } + } + }, + "mkdirp": { + "version": "0.5.1", + "bundled": true, + "dev": true, + "requires": { + "minimist": "0.0.8" + } + }, + "ms": { + "version": "2.0.0", + "bundled": true, + "dev": true + }, + "nanomatch": { + "version": "1.2.9", + "bundled": true, + "dev": true, + "requires": { + "arr-diff": "^4.0.0", + "array-unique": "^0.3.2", + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "fragment-cache": "^0.2.1", + "is-odd": "^2.0.0", + "is-windows": "^1.0.2", + "kind-of": "^6.0.2", + "object.pick": "^1.3.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" + }, + "dependencies": { + "kind-of": { + "version": "6.0.2", + "bundled": true, + "dev": true + } + } + }, + "normalize-package-data": { + "version": "2.4.0", + "bundled": true, + "dev": true, + "requires": { + "hosted-git-info": "^2.1.4", + "is-builtin-module": "^1.0.0", + "semver": "2 || 3 || 4 || 5", + "validate-npm-package-license": "^3.0.1" + } + }, + "npm-run-path": { + "version": "2.0.2", + "bundled": true, + "dev": true, + "requires": { + "path-key": "^2.0.0" + } + }, + "number-is-nan": { + "version": "1.0.1", + "bundled": true, + "dev": true + }, + "object-assign": { + "version": "4.1.1", + "bundled": true, + "dev": true + }, + "object-copy": { + "version": "0.1.0", + "bundled": true, + "dev": true, + "requires": { + "copy-descriptor": "^0.1.0", + "define-property": "^0.2.5", + "kind-of": "^3.0.3" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "bundled": true, + "dev": true, + "requires": { + "is-descriptor": "^0.1.0" + } + } + } + }, + "object-visit": { + "version": "1.0.1", + "bundled": true, + "dev": true, + "requires": { + "isobject": "^3.0.0" + } + }, + "object.pick": { + "version": "1.3.0", + "bundled": true, + "dev": true, + "requires": { + "isobject": "^3.0.1" + } + }, + "once": { + "version": "1.4.0", + "bundled": true, + "dev": true, + "requires": { + "wrappy": "1" + } + }, + "optimist": { + "version": "0.6.1", + "bundled": true, + "dev": true, + "requires": { + "minimist": "~0.0.1", + "wordwrap": "~0.0.2" + } + }, + "os-homedir": { + "version": "1.0.2", + "bundled": true, + "dev": true + }, + "os-locale": { + "version": "2.1.0", + "bundled": true, + "dev": true, + "requires": { + "execa": "^0.7.0", + "lcid": "^1.0.0", + "mem": "^1.1.0" + } + }, + "p-finally": { + "version": "1.0.0", + "bundled": true, + "dev": true + }, + "p-limit": { + "version": "1.2.0", + "bundled": true, + "dev": true, + "requires": { + "p-try": "^1.0.0" + } + }, + "p-locate": { + "version": "2.0.0", + "bundled": true, + "dev": true, + "requires": { + "p-limit": "^1.1.0" + } + }, + "p-try": { + "version": "1.0.0", + "bundled": true, + "dev": true + }, + "parse-json": { + "version": "2.2.0", + "bundled": true, + "dev": true, + "requires": { + "error-ex": "^1.2.0" + } + }, + "pascalcase": { + "version": "0.1.1", + "bundled": true, + "dev": true + }, + "path-exists": { + "version": "2.1.0", + "bundled": true, + "dev": true, + "requires": { + "pinkie-promise": "^2.0.0" + } + }, + "path-is-absolute": { + "version": "1.0.1", + "bundled": true, + "dev": true + }, + "path-key": { + "version": "2.0.1", + "bundled": true, + "dev": true + }, + "path-parse": { + "version": "1.0.5", + "bundled": true, + "dev": true + }, + "path-type": { + "version": "1.1.0", + "bundled": true, + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "pify": "^2.0.0", + "pinkie-promise": "^2.0.0" + } + }, + "pify": { + "version": "2.3.0", + "bundled": true, + "dev": true + }, + "pinkie": { + "version": "2.0.4", + "bundled": true, + "dev": true + }, + "pinkie-promise": { + "version": "2.0.1", + "bundled": true, + "dev": true, + "requires": { + "pinkie": "^2.0.0" + } + }, + "pkg-dir": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "requires": { + "find-up": "^1.0.0" + }, + "dependencies": { + "find-up": { + "version": "1.1.2", + "bundled": true, + "dev": true, + "requires": { + "path-exists": "^2.0.0", + "pinkie-promise": "^2.0.0" + } + } + } + }, + "posix-character-classes": { + "version": "0.1.1", + "bundled": true, + "dev": true + }, + "pseudomap": { + "version": "1.0.2", + "bundled": true, + "dev": true + }, + "read-pkg": { + "version": "1.1.0", + "bundled": true, + "dev": true, + "requires": { + "load-json-file": "^1.0.0", + "normalize-package-data": "^2.3.2", + "path-type": "^1.0.0" + } + }, + "read-pkg-up": { + "version": "1.0.1", + "bundled": true, + "dev": true, + "requires": { + "find-up": "^1.0.0", + "read-pkg": "^1.0.0" + }, + "dependencies": { + "find-up": { + "version": "1.1.2", + "bundled": true, + "dev": true, + "requires": { + "path-exists": "^2.0.0", + "pinkie-promise": "^2.0.0" + } + } + } + }, + "regenerator-runtime": { + "version": "0.11.1", + "bundled": true, + "dev": true + }, + "regex-not": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "requires": { + "extend-shallow": "^3.0.2", + "safe-regex": "^1.1.0" + } + }, + "repeat-element": { + "version": "1.1.2", + "bundled": true, + "dev": true + }, + "repeat-string": { + "version": "1.6.1", + "bundled": true, + "dev": true + }, + "repeating": { + "version": "2.0.1", + "bundled": true, + "dev": true, + "requires": { + "is-finite": "^1.0.0" + } + }, + "require-directory": { + "version": "2.1.1", + "bundled": true, + "dev": true + }, + "require-main-filename": { + "version": "1.0.1", + "bundled": true, + "dev": true + }, + "resolve-from": { + "version": "2.0.0", + "bundled": true, + "dev": true + }, + "resolve-url": { + "version": "0.2.1", + "bundled": true, + "dev": true + }, + "ret": { + "version": "0.1.15", + "bundled": true, + "dev": true + }, + "right-align": { + "version": "0.1.3", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "align-text": "^0.1.1" + } + }, + "rimraf": { + "version": "2.6.2", + "bundled": true, + "dev": true, + "requires": { + "glob": "^7.0.5" + } + }, + "safe-regex": { + "version": "1.1.0", + "bundled": true, + "dev": true, + "requires": { + "ret": "~0.1.10" + } + }, + "semver": { + "version": "5.5.0", + "bundled": true, + "dev": true + }, + "set-blocking": { + "version": "2.0.0", + "bundled": true, + "dev": true + }, + "set-value": { + "version": "2.0.0", + "bundled": true, + "dev": true, + "requires": { + "extend-shallow": "^2.0.1", + "is-extendable": "^0.1.1", + "is-plain-object": "^2.0.3", + "split-string": "^3.0.1" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "bundled": true, + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "shebang-command": { + "version": "1.2.0", + "bundled": true, + "dev": true, + "requires": { + "shebang-regex": "^1.0.0" + } + }, + "shebang-regex": { + "version": "1.0.0", + "bundled": true, + "dev": true + }, + "signal-exit": { + "version": "3.0.2", + "bundled": true, + "dev": true + }, + "slide": { + "version": "1.1.6", + "bundled": true, + "dev": true + }, + "snapdragon": { + "version": "0.8.2", + "bundled": true, + "dev": true, + "requires": { + "base": "^0.11.1", + "debug": "^2.2.0", + "define-property": "^0.2.5", + "extend-shallow": "^2.0.1", + "map-cache": "^0.2.2", + "source-map": "^0.5.6", + "source-map-resolve": "^0.5.0", + "use": "^3.1.0" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "bundled": true, + "dev": true, + "requires": { + "is-descriptor": "^0.1.0" + } + }, + "extend-shallow": { + "version": "2.0.1", + "bundled": true, + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "snapdragon-node": { + "version": "2.1.1", + "bundled": true, + "dev": true, + "requires": { + "define-property": "^1.0.0", + "isobject": "^3.0.0", + "snapdragon-util": "^3.0.1" + }, + "dependencies": { + "define-property": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "requires": { + "is-descriptor": "^1.0.0" + } + }, + "is-accessor-descriptor": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-descriptor": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "requires": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + } + }, + "kind-of": { + "version": "6.0.2", + "bundled": true, + "dev": true + } + } + }, + "snapdragon-util": { + "version": "3.0.1", + "bundled": true, + "dev": true, + "requires": { + "kind-of": "^3.2.0" + } + }, + "source-map": { + "version": "0.5.7", + "bundled": true, + "dev": true + }, + "source-map-resolve": { + "version": "0.5.1", + "bundled": true, + "dev": true, + "requires": { + "atob": "^2.0.0", + "decode-uri-component": "^0.2.0", + "resolve-url": "^0.2.1", + "source-map-url": "^0.4.0", + "urix": "^0.1.0" + } + }, + "source-map-url": { + "version": "0.4.0", + "bundled": true, + "dev": true + }, + "spawn-wrap": { + "version": "1.4.2", + "bundled": true, + "dev": true, + "requires": { + "foreground-child": "^1.5.6", + "mkdirp": "^0.5.0", + "os-homedir": "^1.0.1", + "rimraf": "^2.6.2", + "signal-exit": "^3.0.2", + "which": "^1.3.0" + } + }, + "spdx-correct": { + "version": "3.0.0", + "bundled": true, + "dev": true, + "requires": { + "spdx-expression-parse": "^3.0.0", + "spdx-license-ids": "^3.0.0" + } + }, + "spdx-exceptions": { + "version": "2.1.0", + "bundled": true, + "dev": true + }, + "spdx-expression-parse": { + "version": "3.0.0", + "bundled": true, + "dev": true, + "requires": { + "spdx-exceptions": "^2.1.0", + "spdx-license-ids": "^3.0.0" + } + }, + "spdx-license-ids": { + "version": "3.0.0", + "bundled": true, + "dev": true + }, + "split-string": { + "version": "3.1.0", + "bundled": true, + "dev": true, + "requires": { + "extend-shallow": "^3.0.0" + } + }, + "static-extend": { + "version": "0.1.2", + "bundled": true, + "dev": true, + "requires": { + "define-property": "^0.2.5", + "object-copy": "^0.1.0" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "bundled": true, + "dev": true, + "requires": { + "is-descriptor": "^0.1.0" + } + } + } + }, + "string-width": { + "version": "2.1.1", + "bundled": true, + "dev": true, + "requires": { + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^4.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "3.0.0", + "bundled": true, + "dev": true + }, + "strip-ansi": { + "version": "4.0.0", + "bundled": true, + "dev": true, + "requires": { + "ansi-regex": "^3.0.0" + } + } + } + }, + "strip-ansi": { + "version": "3.0.1", + "bundled": true, + "dev": true, + "requires": { + "ansi-regex": "^2.0.0" + } + }, + "strip-bom": { + "version": "2.0.0", + "bundled": true, + "dev": true, + "requires": { + "is-utf8": "^0.2.0" + } + }, + "strip-eof": { + "version": "1.0.0", + "bundled": true, + "dev": true + }, + "supports-color": { + "version": "2.0.0", + "bundled": true, + "dev": true + }, + "test-exclude": { + "version": "4.2.1", + "bundled": true, + "dev": true, + "requires": { + "arrify": "^1.0.1", + "micromatch": "^3.1.8", + "object-assign": "^4.1.0", + "read-pkg-up": "^1.0.1", + "require-main-filename": "^1.0.1" + } + }, + "to-fast-properties": { + "version": "1.0.3", + "bundled": true, + "dev": true + }, + "to-object-path": { + "version": "0.3.0", + "bundled": true, + "dev": true, + "requires": { + "kind-of": "^3.0.2" + } + }, + "to-regex": { + "version": "3.0.2", + "bundled": true, + "dev": true, + "requires": { + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "regex-not": "^1.0.2", + "safe-regex": "^1.1.0" + } + }, + "to-regex-range": { + "version": "2.1.1", + "bundled": true, + "dev": true, + "requires": { + "is-number": "^3.0.0", + "repeat-string": "^1.6.1" + } + }, + "trim-right": { + "version": "1.0.1", + "bundled": true, + "dev": true + }, + "uglify-js": { + "version": "2.8.29", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "source-map": "~0.5.1", + "uglify-to-browserify": "~1.0.0", + "yargs": "~3.10.0" + }, + "dependencies": { + "yargs": { + "version": "3.10.0", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "camelcase": "^1.0.2", + "cliui": "^2.1.0", + "decamelize": "^1.0.0", + "window-size": "0.1.0" + } + } + } + }, + "uglify-to-browserify": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "optional": true + }, + "union-value": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "requires": { + "arr-union": "^3.1.0", + "get-value": "^2.0.6", + "is-extendable": "^0.1.1", + "set-value": "^0.4.3" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "bundled": true, + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + }, + "set-value": { + "version": "0.4.3", + "bundled": true, + "dev": true, + "requires": { + "extend-shallow": "^2.0.1", + "is-extendable": "^0.1.1", + "is-plain-object": "^2.0.1", + "to-object-path": "^0.3.0" + } + } + } + }, + "unset-value": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "requires": { + "has-value": "^0.3.1", + "isobject": "^3.0.0" + }, + "dependencies": { + "has-value": { + "version": "0.3.1", + "bundled": true, + "dev": true, + "requires": { + "get-value": "^2.0.3", + "has-values": "^0.1.4", + "isobject": "^2.0.0" + }, + "dependencies": { + "isobject": { + "version": "2.1.0", + "bundled": true, + "dev": true, + "requires": { + "isarray": "1.0.0" + } + } + } + }, + "has-values": { + "version": "0.1.4", + "bundled": true, + "dev": true + } + } + }, + "urix": { + "version": "0.1.0", + "bundled": true, + "dev": true + }, + "use": { + "version": "3.1.0", + "bundled": true, + "dev": true, + "requires": { + "kind-of": "^6.0.2" + }, + "dependencies": { + "kind-of": { + "version": "6.0.2", + "bundled": true, + "dev": true + } + } + }, + "validate-npm-package-license": { + "version": "3.0.3", + "bundled": true, + "dev": true, + "requires": { + "spdx-correct": "^3.0.0", + "spdx-expression-parse": "^3.0.0" + } + }, + "which": { + "version": "1.3.0", + "bundled": true, + "dev": true, + "requires": { + "isexe": "^2.0.0" + } + }, + "which-module": { + "version": "2.0.0", + "bundled": true, + "dev": true + }, + "window-size": { + "version": "0.1.0", + "bundled": true, + "dev": true, + "optional": true + }, + "wordwrap": { + "version": "0.0.3", + "bundled": true, + "dev": true + }, + "wrap-ansi": { + "version": "2.1.0", + "bundled": true, + "dev": true, + "requires": { + "string-width": "^1.0.1", + "strip-ansi": "^3.0.1" + }, + "dependencies": { + "is-fullwidth-code-point": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "requires": { + "number-is-nan": "^1.0.0" + } + }, + "string-width": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "requires": { + "code-point-at": "^1.0.0", + "is-fullwidth-code-point": "^1.0.0", + "strip-ansi": "^3.0.0" + } + } + } + }, + "wrappy": { + "version": "1.0.2", + "bundled": true, + "dev": true + }, + "write-file-atomic": { + "version": "1.3.4", + "bundled": true, + "dev": true, + "requires": { + "graceful-fs": "^4.1.11", + "imurmurhash": "^0.1.4", + "slide": "^1.1.5" + } + }, + "y18n": { + "version": "3.2.1", + "bundled": true, + "dev": true + }, + "yallist": { + "version": "2.1.2", + "bundled": true, + "dev": true + }, + "yargs": { + "version": "11.1.0", + "bundled": true, + "dev": true, + "requires": { + "cliui": "^4.0.0", + "decamelize": "^1.1.1", + "find-up": "^2.1.0", + "get-caller-file": "^1.0.1", + "os-locale": "^2.0.0", + "require-directory": "^2.1.1", + "require-main-filename": "^1.0.1", + "set-blocking": "^2.0.0", + "string-width": "^2.0.0", + "which-module": "^2.0.0", + "y18n": "^3.2.1", + "yargs-parser": "^9.0.2" + }, + "dependencies": { + "ansi-regex": { + "version": "3.0.0", + "bundled": true, + "dev": true + }, + "camelcase": { + "version": "4.1.0", + "bundled": true, + "dev": true + }, + "cliui": { + "version": "4.1.0", + "bundled": true, + "dev": true, + "requires": { + "string-width": "^2.1.1", + "strip-ansi": "^4.0.0", + "wrap-ansi": "^2.0.0" + } + }, + "strip-ansi": { + "version": "4.0.0", + "bundled": true, + "dev": true, + "requires": { + "ansi-regex": "^3.0.0" + } + }, + "yargs-parser": { + "version": "9.0.2", + "bundled": true, + "dev": true, + "requires": { + "camelcase": "^4.1.0" + } + } + } + }, + "yargs-parser": { + "version": "8.1.0", + "bundled": true, + "dev": true, + "requires": { + "camelcase": "^4.1.0" + }, + "dependencies": { + "camelcase": { + "version": "4.1.0", + "bundled": true, + "dev": true + } + } + } + } + }, + "os-locale": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-3.0.1.tgz", + "integrity": "sha512-7g5e7dmXPtzcP4bgsZ8ixDVqA7oWYuEz4lOSujeWyliPai4gfVDiFIcwBg3aGCPnmSGfzOKTK3ccPn0CKv3DBw==", + "dev": true, + "requires": { + "execa": "^0.10.0", + "lcid": "^2.0.0", + "mem": "^4.0.0" + } + }, + "p-limit": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.0.0.tgz", + "integrity": "sha512-fl5s52lI5ahKCernzzIyAP0QAZbGIovtVHGwpcu1Jr/EpzLVDI2myISHwGqK7m8uQFugVWSrbxH7XnhGtvEc+A==", + "dev": true, + "requires": { + "p-try": "^2.0.0" + } + }, + "p-locate": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", + "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", + "dev": true, + "requires": { + "p-limit": "^2.0.0" + } + }, + "p-try": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.0.0.tgz", + "integrity": "sha512-hMp0onDKIajHfIkdRk3P4CdCmErkYAxxDtP3Wx/4nZ3aGlau2VKh3mZpcuFkH27WQkL/3WBCPOktzA9ZOAnMQQ==", + "dev": true + }, + "string-width": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", + "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "dev": true, + "requires": { + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^4.0.0" + } + }, + "strip-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "dev": true, + "requires": { + "ansi-regex": "^3.0.0" + } + }, + "yargs": { + "version": "12.0.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-12.0.2.tgz", + "integrity": "sha512-e7SkEx6N6SIZ5c5H22RTZae61qtn3PYUE8JYbBFlK9sYmh3DMQ6E5ygtaG/2BW0JZi4WGgTR2IV5ChqlqrDGVQ==", + "dev": true, + "requires": { + "cliui": "^4.0.0", + "decamelize": "^2.0.0", + "find-up": "^3.0.0", + "get-caller-file": "^1.0.1", + "os-locale": "^3.0.0", + "require-directory": "^2.1.1", + "require-main-filename": "^1.0.1", + "set-blocking": "^2.0.0", + "string-width": "^2.0.0", + "which-module": "^2.0.0", + "y18n": "^3.2.1 || ^4.0.0", + "yargs-parser": "^10.1.0" + } + } + } + }, + "@grpc/grpc-js": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/@grpc/grpc-js/-/grpc-js-0.2.0.tgz", + "integrity": "sha512-89xjKxo3iuc8Gsln3brtXfTUV8H2UPzWBEJ/iVD1YlSqp+LomEC1L700/PwyWRCX4rdJnOpuv4RCGE8zrOSlyA==", + "requires": { + "lodash": "^4.17.4" + } + }, + "@grpc/proto-loader": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/@grpc/proto-loader/-/proto-loader-0.3.0.tgz", + "integrity": "sha512-9b8S/V+3W4Gv7G/JKSZ48zApgyYbfIR7mAC9XNnaSWme3zj57MIESu0ELzm9j5oxNIpFG8DgO00iJMIUZ5luqw==", + "requires": { + "@types/lodash": "^4.14.104", + "@types/node": "^9.4.6", + "lodash": "^4.17.5", + "protobufjs": "^6.8.6" + } + }, + "@ladjs/time-require": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/@ladjs/time-require/-/time-require-0.1.4.tgz", + "integrity": "sha512-weIbJqTMfQ4r1YX85u54DKfjLZs2jwn1XZ6tIOP/pFgMwhIN5BAtaCp/1wn9DzyLsDR9tW0R2NIePcVJ45ivQQ==", + "dev": true, + "requires": { + "chalk": "^0.4.0", + "date-time": "^0.1.1", + "pretty-ms": "^0.2.1", + "text-table": "^0.2.0" + }, + "dependencies": { + "ansi-styles": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-1.0.0.tgz", + "integrity": "sha1-yxAt8cVvUSPquLZ817mAJ6AnkXg=", + "dev": true + }, + "chalk": { + "version": "0.4.0", + "resolved": "http://registry.npmjs.org/chalk/-/chalk-0.4.0.tgz", + "integrity": "sha1-UZmj3c0MHv4jvAjBsCewYXbgxk8=", + "dev": true, + "requires": { + "ansi-styles": "~1.0.0", + "has-color": "~0.1.0", + "strip-ansi": "~0.1.0" + } + }, + "pretty-ms": { + "version": "0.2.2", + "resolved": "http://registry.npmjs.org/pretty-ms/-/pretty-ms-0.2.2.tgz", + "integrity": "sha1-2oeaaC/zOjcBEEbxPWJ/Z8c7hPY=", + "dev": true, + "requires": { + "parse-ms": "^0.1.0" + } + }, + "strip-ansi": { + "version": "0.1.1", + "resolved": "http://registry.npmjs.org/strip-ansi/-/strip-ansi-0.1.1.tgz", + "integrity": "sha1-OeipjQRNFQZgq+SmgIrPcLt7yZE=", + "dev": true + } + } + }, + "@mrmlnc/readdir-enhanced": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/@mrmlnc/readdir-enhanced/-/readdir-enhanced-2.2.1.tgz", + "integrity": "sha512-bPHp6Ji8b41szTOcaP63VlnbbO5Ny6dwAATtY6JTjh5N2OLrb5Qk/Th5cRkRQhkWCt+EJsYrNB0MiL+Gpn6e3g==", + "requires": { + "call-me-maybe": "^1.0.1", + "glob-to-regexp": "^0.3.0" + } + }, + "@nodelib/fs.stat": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-1.1.3.tgz", + "integrity": "sha512-shAmDyaQC4H92APFoIaVDHCx5bStIocgvbwQyxPRrbUY20V1EYTbSDchWbuwlMG3V17cprZhA6+78JfB+3DTPw==" + }, + "@protobufjs/aspromise": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@protobufjs/aspromise/-/aspromise-1.1.2.tgz", + "integrity": "sha1-m4sMxmPWaafY9vXQiToU00jzD78=" + }, + "@protobufjs/base64": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@protobufjs/base64/-/base64-1.1.2.tgz", + "integrity": "sha512-AZkcAA5vnN/v4PDqKyMR5lx7hZttPDgClv83E//FMNhR2TMcLUhfRUBHCmSl0oi9zMgDDqRUJkSxO3wm85+XLg==" + }, + "@protobufjs/codegen": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@protobufjs/codegen/-/codegen-2.0.4.tgz", + "integrity": "sha512-YyFaikqM5sH0ziFZCN3xDC7zeGaB/d0IUb9CATugHWbd1FRFwWwt4ld4OYMPWu5a3Xe01mGAULCdqhMlPl29Jg==" + }, + "@protobufjs/eventemitter": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/eventemitter/-/eventemitter-1.1.0.tgz", + "integrity": "sha1-NVy8mLr61ZePntCV85diHx0Ga3A=" + }, + "@protobufjs/fetch": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/fetch/-/fetch-1.1.0.tgz", + "integrity": "sha1-upn7WYYUr2VwDBYZ/wbUVLDYTEU=", + "requires": { + "@protobufjs/aspromise": "^1.1.1", + "@protobufjs/inquire": "^1.1.0" + } + }, + "@protobufjs/float": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@protobufjs/float/-/float-1.0.2.tgz", + "integrity": "sha1-Xp4avctz/Ap8uLKR33jIy9l7h9E=" + }, + "@protobufjs/inquire": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/inquire/-/inquire-1.1.0.tgz", + "integrity": "sha1-/yAOPnzyQp4tyvwRQIKOjMY48Ik=" + }, + "@protobufjs/path": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@protobufjs/path/-/path-1.1.2.tgz", + "integrity": "sha1-bMKyDFya1q0NzP0hynZz2Nf79o0=" + }, + "@protobufjs/pool": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/pool/-/pool-1.1.0.tgz", + "integrity": "sha1-Cf0V8tbTq/qbZbw2ZQbWrXhG/1Q=" + }, + "@protobufjs/utf8": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/utf8/-/utf8-1.1.0.tgz", + "integrity": "sha1-p3c2C1s5oaLlEG+OhY8v0tBgxXA=" + }, + "@sindresorhus/is": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-0.7.0.tgz", + "integrity": "sha512-ONhaKPIufzzrlNbqtWFFd+jlnemX6lJAgq9ZeiZtS7I1PIf/la7CW4m83rTXRnVnsMbW2k56pGYu7AUFJD9Pow==", + "dev": true + }, + "@sindresorhus/slugify": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/@sindresorhus/slugify/-/slugify-0.3.0.tgz", + "integrity": "sha512-kKdS9yWggjFSpTKInwq2hP2X+heBxDeCDF+5D3Xzd+b3yALPHgqLtGzzPiONeXDke7+QFVUkOpReCmU23XQscA==", + "dev": true, + "requires": { + "escape-string-regexp": "^1.0.5", + "lodash.deburr": "^4.1.0" + } + }, + "@sinonjs/formatio": { + "version": "2.0.0", + "resolved": "http://registry.npmjs.org/@sinonjs/formatio/-/formatio-2.0.0.tgz", + "integrity": "sha512-ls6CAMA6/5gG+O/IdsBcblvnd8qcO/l1TYoNeAzp3wcISOxlPXQEus0mLcdwazEkWjaBdaJ3TaxmNgCLWwvWzg==", + "dev": true, + "requires": { + "samsam": "1.3.0" + } + }, + "@sinonjs/samsam": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@sinonjs/samsam/-/samsam-2.1.0.tgz", + "integrity": "sha512-5x2kFgJYupaF1ns/RmharQ90lQkd2ELS8A9X0ymkAAdemYHGtI2KiUHG8nX2WU0T1qgnOU5YMqnBM2V7NUanNw==", + "dev": true, + "requires": { + "array-from": "^2.1.1" + } + }, + "@types/lodash": { + "version": "4.14.118", + "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.118.tgz", + "integrity": "sha512-iiJbKLZbhSa6FYRip/9ZDX6HXhayXLDGY2Fqws9cOkEQ6XeKfaxB0sC541mowZJueYyMnVUmmG+al5/4fCDrgw==" + }, + "@types/long": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@types/long/-/long-4.0.0.tgz", + "integrity": "sha512-1w52Nyx4Gq47uuu0EVcsHBxZFJgurQ+rTKS3qMHxR1GY2T8c2AJYd6vZoZ9q1rupaDjU0yT+Jc2XTyXkjeMA+Q==" + }, + "@types/node": { + "version": "9.6.36", + "resolved": "https://registry.npmjs.org/@types/node/-/node-9.6.36.tgz", + "integrity": "sha512-Fbw+AdRLL01vv7Rk7bYaNPecqmKoinJHGbpKnDpbUZmUj/0vj3nLqPQ4CNBzr3q2zso6Cq/4jHoCAdH78fvJrw==" + }, + "acorn": { + "version": "5.7.3", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.7.3.tgz", + "integrity": "sha512-T/zvzYRfbVojPWahDsE5evJdHb3oJoQfFbsrKM7w5Zcs++Tr257tia3BmMP8XYVjp1S9RZXQMh7gao96BlqZOw==" + }, + "acorn-es7-plugin": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/acorn-es7-plugin/-/acorn-es7-plugin-1.1.7.tgz", + "integrity": "sha1-8u4fMiipDurRJF+asZIusucdM2s=" + }, + "acorn-jsx": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.0.0.tgz", + "integrity": "sha512-XkB50fn0MURDyww9+UYL3c1yLbOBz0ZFvrdYlGB8l+Ije1oSC75qAqrzSPjYQbdnQUzhlUGNKuesryAv0gxZOg==", + "dev": true + }, + "agent-base": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-4.2.1.tgz", + "integrity": "sha512-JVwXMr9nHYTUXsBFKUqhJwvlcYU/blreOEUkhNR2eXZIvwd+c+o5V4MgDPKWnMS/56awN3TRzIP+KoPn+roQtg==", + "requires": { + "es6-promisify": "^5.0.0" + } + }, + "ajv": { + "version": "5.5.2", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-5.5.2.tgz", + "integrity": "sha1-c7Xuyj+rZT49P5Qis0GtQiBdyWU=", + "dev": true, + "requires": { + "co": "^4.6.0", + "fast-deep-equal": "^1.0.0", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.3.0" + } + }, + "align-text": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/align-text/-/align-text-0.1.4.tgz", + "integrity": "sha1-DNkKVhCT810KmSVsIrcGlDP60Rc=", + "dev": true, + "requires": { + "kind-of": "^3.0.2", + "longest": "^1.0.1", + "repeat-string": "^1.5.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "amdefine": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/amdefine/-/amdefine-1.0.1.tgz", + "integrity": "sha1-SlKCrBZHKek2Gbz9OtFR+BfOkfU=", + "dev": true + }, + "ansi-align": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ansi-align/-/ansi-align-2.0.0.tgz", + "integrity": "sha1-w2rsy6VjuJzrVW82kPCx2eNUf38=", + "dev": true, + "requires": { + "string-width": "^2.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true + }, + "string-width": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", + "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "dev": true, + "requires": { + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^4.0.0" + } + }, + "strip-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "dev": true, + "requires": { + "ansi-regex": "^3.0.0" + } + } + } + }, + "ansi-escapes": { + "version": "3.1.0", + "resolved": "http://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.1.0.tgz", + "integrity": "sha512-UgAb8H9D41AQnu/PbWlCofQVcnV4Gs2bBJi9eZPxfU/hgglFh3SMDMENRIqdr7H6XFnXdoknctFByVsCOotTVw==", + "dev": true + }, + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=" + }, + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "anymatch": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-1.3.2.tgz", + "integrity": "sha512-0XNayC8lTHQ2OI8aljNCN3sSx6hsr/1+rlcDAotXJR7C1oZZHCNsfpbKwMjRA3Uqb5tF1Rae2oloTr4xpq+WjA==", + "dev": true, + "requires": { + "micromatch": "^2.1.5", + "normalize-path": "^2.0.0" + }, + "dependencies": { + "arr-diff": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-2.0.0.tgz", + "integrity": "sha1-jzuCf5Vai9ZpaX5KQlasPOrjVs8=", + "dev": true, + "requires": { + "arr-flatten": "^1.0.1" + } + }, + "array-unique": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.2.1.tgz", + "integrity": "sha1-odl8yvy8JiXMcPrc6zalDFiwGlM=", + "dev": true + }, + "braces": { + "version": "1.8.5", + "resolved": "https://registry.npmjs.org/braces/-/braces-1.8.5.tgz", + "integrity": "sha1-uneWLhLf+WnWt2cR6RS3N4V79qc=", + "dev": true, + "requires": { + "expand-range": "^1.8.1", + "preserve": "^0.2.0", + "repeat-element": "^1.1.2" + } + }, + "expand-brackets": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-0.1.5.tgz", + "integrity": "sha1-3wcoTjQqgHzXM6xa9yQR5YHRF3s=", + "dev": true, + "requires": { + "is-posix-bracket": "^0.1.0" + } + }, + "extglob": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/extglob/-/extglob-0.3.2.tgz", + "integrity": "sha1-Lhj/PS9JqydlzskCPwEdqo2DSaE=", + "dev": true, + "requires": { + "is-extglob": "^1.0.0" + } + }, + "is-extglob": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz", + "integrity": "sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA=", + "dev": true + }, + "is-glob": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz", + "integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=", + "dev": true, + "requires": { + "is-extglob": "^1.0.0" + } + }, + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + }, + "micromatch": { + "version": "2.3.11", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-2.3.11.tgz", + "integrity": "sha1-hmd8l9FyCzY0MdBNDRUpO9OMFWU=", + "dev": true, + "requires": { + "arr-diff": "^2.0.0", + "array-unique": "^0.2.1", + "braces": "^1.8.2", + "expand-brackets": "^0.1.4", + "extglob": "^0.3.1", + "filename-regex": "^2.0.0", + "is-extglob": "^1.0.0", + "is-glob": "^2.0.1", + "kind-of": "^3.0.2", + "normalize-path": "^2.0.1", + "object.omit": "^2.0.0", + "parse-glob": "^3.0.4", + "regex-cache": "^0.4.2" + } + } + } + }, + "argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "dev": true, + "requires": { + "sprintf-js": "~1.0.2" + } + }, + "argv": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/argv/-/argv-0.0.2.tgz", + "integrity": "sha1-7L0W+JSbFXGDcRsb2jNPN4QBhas=", + "dev": true + }, + "arr-diff": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz", + "integrity": "sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA=" + }, + "arr-exclude": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/arr-exclude/-/arr-exclude-1.0.0.tgz", + "integrity": "sha1-38fC5VKicHI8zaBM8xKMjL/lxjE=", + "dev": true + }, + "arr-flatten": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.1.0.tgz", + "integrity": "sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg==" + }, + "arr-union": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/arr-union/-/arr-union-3.1.0.tgz", + "integrity": "sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ=" + }, + "array-differ": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/array-differ/-/array-differ-1.0.0.tgz", + "integrity": "sha1-7/UuN1gknTO+QCuLuOVkuytdQDE=", + "dev": true + }, + "array-filter": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/array-filter/-/array-filter-1.0.0.tgz", + "integrity": "sha1-uveeYubvTCpMC4MSMtr/7CUfnYM=" + }, + "array-find": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/array-find/-/array-find-1.0.0.tgz", + "integrity": "sha1-bI4obRHtdoMn+OYuzuhzU8o+eLg=", + "dev": true + }, + "array-find-index": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/array-find-index/-/array-find-index-1.0.2.tgz", + "integrity": "sha1-3wEKoSh+Fku9pvlyOwqWoexBh6E=", + "dev": true + }, + "array-from": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/array-from/-/array-from-2.1.1.tgz", + "integrity": "sha1-z+nYwmYoudxa7MYqn12PHzUsEZU=", + "dev": true + }, + "array-union": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-1.0.2.tgz", + "integrity": "sha1-mjRBDk9OPaI96jdb5b5w8kd47Dk=", + "requires": { + "array-uniq": "^1.0.1" + } + }, + "array-uniq": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/array-uniq/-/array-uniq-1.0.3.tgz", + "integrity": "sha1-r2rId6Jcx/dOBYiUdThY39sk/bY=" + }, + "array-unique": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz", + "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=" + }, + "arrify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", + "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=" + }, + "ascli": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/ascli/-/ascli-1.0.1.tgz", + "integrity": "sha1-vPpZdKYvGOgcq660lzKrSoj5Brw=", + "requires": { + "colour": "~0.7.1", + "optjs": "~3.2.2" + } + }, + "asn1": { + "version": "0.2.4", + "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz", + "integrity": "sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg==", + "dev": true, + "requires": { + "safer-buffer": "~2.1.0" + } + }, + "assert-plus": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", + "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", + "dev": true + }, + "assign-symbols": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assign-symbols/-/assign-symbols-1.0.0.tgz", + "integrity": "sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c=" + }, + "async": { + "version": "1.5.2", + "resolved": "http://registry.npmjs.org/async/-/async-1.5.2.tgz", + "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=", + "dev": true + }, + "async-each": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/async-each/-/async-each-1.0.1.tgz", + "integrity": "sha1-GdOGodntxufByF04iu28xW0zYC0=", + "dev": true + }, + "asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=", + "dev": true + }, + "atob": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/atob/-/atob-2.1.2.tgz", + "integrity": "sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==" + }, + "auto-bind": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/auto-bind/-/auto-bind-1.2.1.tgz", + "integrity": "sha512-/W9yj1yKmBLwpexwAujeD9YHwYmRuWFGV8HWE7smQab797VeHa4/cnE2NFeDhA+E+5e/OGBI8763EhLjfZ/MXA==", + "dev": true + }, + "ava": { + "version": "0.25.0", + "resolved": "https://registry.npmjs.org/ava/-/ava-0.25.0.tgz", + "integrity": "sha512-4lGNJCf6xL8SvsKVEKxEE46se7JAUIAZoKHw9itTQuwcsydhpAMkBs5gOOiWiwt0JKNIuXWc2/r4r8ZdcNrBEw==", + "dev": true, + "requires": { + "@ava/babel-preset-stage-4": "^1.1.0", + "@ava/babel-preset-transform-test-files": "^3.0.0", + "@ava/write-file-atomic": "^2.2.0", + "@concordance/react": "^1.0.0", + "@ladjs/time-require": "^0.1.4", + "ansi-escapes": "^3.0.0", + "ansi-styles": "^3.1.0", + "arr-flatten": "^1.0.1", + "array-union": "^1.0.1", + "array-uniq": "^1.0.2", + "arrify": "^1.0.0", + "auto-bind": "^1.1.0", + "ava-init": "^0.2.0", + "babel-core": "^6.17.0", + "babel-generator": "^6.26.0", + "babel-plugin-syntax-object-rest-spread": "^6.13.0", + "bluebird": "^3.0.0", + "caching-transform": "^1.0.0", + "chalk": "^2.0.1", + "chokidar": "^1.4.2", + "clean-stack": "^1.1.1", + "clean-yaml-object": "^0.1.0", + "cli-cursor": "^2.1.0", + "cli-spinners": "^1.0.0", + "cli-truncate": "^1.0.0", + "co-with-promise": "^4.6.0", + "code-excerpt": "^2.1.1", + "common-path-prefix": "^1.0.0", + "concordance": "^3.0.0", + "convert-source-map": "^1.5.1", + "core-assert": "^0.2.0", + "currently-unhandled": "^0.4.1", + "debug": "^3.0.1", + "dot-prop": "^4.1.0", + "empower-core": "^0.6.1", + "equal-length": "^1.0.0", + "figures": "^2.0.0", + "find-cache-dir": "^1.0.0", + "fn-name": "^2.0.0", + "get-port": "^3.0.0", + "globby": "^6.0.0", + "has-flag": "^2.0.0", + "hullabaloo-config-manager": "^1.1.0", + "ignore-by-default": "^1.0.0", + "import-local": "^0.1.1", + "indent-string": "^3.0.0", + "is-ci": "^1.0.7", + "is-generator-fn": "^1.0.0", + "is-obj": "^1.0.0", + "is-observable": "^1.0.0", + "is-promise": "^2.1.0", + "last-line-stream": "^1.0.0", + "lodash.clonedeepwith": "^4.5.0", + "lodash.debounce": "^4.0.3", + "lodash.difference": "^4.3.0", + "lodash.flatten": "^4.2.0", + "loud-rejection": "^1.2.0", + "make-dir": "^1.0.0", + "matcher": "^1.0.0", + "md5-hex": "^2.0.0", + "meow": "^3.7.0", + "ms": "^2.0.0", + "multimatch": "^2.1.0", + "observable-to-promise": "^0.5.0", + "option-chain": "^1.0.0", + "package-hash": "^2.0.0", + "pkg-conf": "^2.0.0", + "plur": "^2.0.0", + "pretty-ms": "^3.0.0", + "require-precompiled": "^0.1.0", + "resolve-cwd": "^2.0.0", + "safe-buffer": "^5.1.1", + "semver": "^5.4.1", + "slash": "^1.0.0", + "source-map-support": "^0.5.0", + "stack-utils": "^1.0.1", + "strip-ansi": "^4.0.0", + "strip-bom-buf": "^1.0.0", + "supertap": "^1.0.0", + "supports-color": "^5.0.0", + "trim-off-newlines": "^1.0.1", + "unique-temp-dir": "^1.0.0", + "update-notifier": "^2.3.0" + }, + "dependencies": { + "ansi-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "dev": true + }, + "debug": { + "version": "3.2.6", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", + "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", + "dev": true, + "requires": { + "ms": "^2.1.1" + }, + "dependencies": { + "ms": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", + "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", + "dev": true + } + } + }, + "empower-core": { + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/empower-core/-/empower-core-0.6.2.tgz", + "integrity": "sha1-Wt71ZgiOMfuoC6CjbfR9cJQWkUQ=", + "dev": true, + "requires": { + "call-signature": "0.0.2", + "core-js": "^2.0.0" + } + }, + "globby": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/globby/-/globby-6.1.0.tgz", + "integrity": "sha1-9abXDoOV4hyFj7BInWTfAkJNUGw=", + "dev": true, + "requires": { + "array-union": "^1.0.1", + "glob": "^7.0.3", + "object-assign": "^4.0.1", + "pify": "^2.0.0", + "pinkie-promise": "^2.0.0" + } + }, + "pify": { + "version": "2.3.0", + "resolved": "http://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", + "dev": true + }, + "pinkie": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz", + "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA=", + "dev": true + }, + "pinkie-promise": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", + "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=", + "dev": true, + "requires": { + "pinkie": "^2.0.0" + } + }, + "strip-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "dev": true, + "requires": { + "ansi-regex": "^3.0.0" + } + } + } + }, + "ava-init": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/ava-init/-/ava-init-0.2.1.tgz", + "integrity": "sha512-lXwK5LM+2g1euDRqW1mcSX/tqzY1QU7EjKpqayFPPtNRmbSYZ8RzPO5tqluTToijmtjp2M+pNpVdbcHssC4glg==", + "dev": true, + "requires": { + "arr-exclude": "^1.0.0", + "execa": "^0.7.0", + "has-yarn": "^1.0.0", + "read-pkg-up": "^2.0.0", + "write-pkg": "^3.1.0" + } + }, + "aws-sign2": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", + "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=", + "dev": true + }, + "aws4": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.8.0.tgz", + "integrity": "sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ==", + "dev": true + }, + "axios": { + "version": "0.18.0", + "resolved": "http://registry.npmjs.org/axios/-/axios-0.18.0.tgz", + "integrity": "sha1-MtU+SFHv3AoRmTts0AB4nXDAUQI=", + "requires": { + "follow-redirects": "^1.3.0", + "is-buffer": "^1.1.5" + } + }, + "babel-code-frame": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-code-frame/-/babel-code-frame-6.26.0.tgz", + "integrity": "sha1-Y/1D99weO7fONZR9uP42mj9Yx0s=", + "dev": true, + "requires": { + "chalk": "^1.1.3", + "esutils": "^2.0.2", + "js-tokens": "^3.0.2" + }, + "dependencies": { + "ansi-styles": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", + "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", + "dev": true + }, + "chalk": { + "version": "1.1.3", + "resolved": "http://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", + "dev": true, + "requires": { + "ansi-styles": "^2.2.1", + "escape-string-regexp": "^1.0.2", + "has-ansi": "^2.0.0", + "strip-ansi": "^3.0.0", + "supports-color": "^2.0.0" + } + }, + "supports-color": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", + "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", + "dev": true + } + } + }, + "babel-core": { + "version": "6.26.3", + "resolved": "https://registry.npmjs.org/babel-core/-/babel-core-6.26.3.tgz", + "integrity": "sha512-6jyFLuDmeidKmUEb3NM+/yawG0M2bDZ9Z1qbZP59cyHLz8kYGKYwpJP0UwUKKUiTRNvxfLesJnTedqczP7cTDA==", + "dev": true, + "requires": { + "babel-code-frame": "^6.26.0", + "babel-generator": "^6.26.0", + "babel-helpers": "^6.24.1", + "babel-messages": "^6.23.0", + "babel-register": "^6.26.0", + "babel-runtime": "^6.26.0", + "babel-template": "^6.26.0", + "babel-traverse": "^6.26.0", + "babel-types": "^6.26.0", + "babylon": "^6.18.0", + "convert-source-map": "^1.5.1", + "debug": "^2.6.9", + "json5": "^0.5.1", + "lodash": "^4.17.4", + "minimatch": "^3.0.4", + "path-is-absolute": "^1.0.1", + "private": "^0.1.8", + "slash": "^1.0.0", + "source-map": "^0.5.7" + } + }, + "babel-generator": { + "version": "6.26.1", + "resolved": "https://registry.npmjs.org/babel-generator/-/babel-generator-6.26.1.tgz", + "integrity": "sha512-HyfwY6ApZj7BYTcJURpM5tznulaBvyio7/0d4zFOeMPUmfxkCjHocCuoLa2SAGzBI8AREcH3eP3758F672DppA==", + "dev": true, + "requires": { + "babel-messages": "^6.23.0", + "babel-runtime": "^6.26.0", + "babel-types": "^6.26.0", + "detect-indent": "^4.0.0", + "jsesc": "^1.3.0", + "lodash": "^4.17.4", + "source-map": "^0.5.7", + "trim-right": "^1.0.1" + }, + "dependencies": { + "jsesc": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-1.3.0.tgz", + "integrity": "sha1-RsP+yMGJKxKwgz25vHYiF226s0s=", + "dev": true + } + } + }, + "babel-helper-builder-binary-assignment-operator-visitor": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-helper-builder-binary-assignment-operator-visitor/-/babel-helper-builder-binary-assignment-operator-visitor-6.24.1.tgz", + "integrity": "sha1-zORReto1b0IgvK6KAsKzRvmlZmQ=", + "dev": true, + "requires": { + "babel-helper-explode-assignable-expression": "^6.24.1", + "babel-runtime": "^6.22.0", + "babel-types": "^6.24.1" + } + }, + "babel-helper-call-delegate": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-helper-call-delegate/-/babel-helper-call-delegate-6.24.1.tgz", + "integrity": "sha1-7Oaqzdx25Bw0YfiL/Fdb0Nqi340=", + "dev": true, + "requires": { + "babel-helper-hoist-variables": "^6.24.1", + "babel-runtime": "^6.22.0", + "babel-traverse": "^6.24.1", + "babel-types": "^6.24.1" + } + }, + "babel-helper-explode-assignable-expression": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-helper-explode-assignable-expression/-/babel-helper-explode-assignable-expression-6.24.1.tgz", + "integrity": "sha1-8luCz33BBDPFX3BZLVdGQArCLKo=", + "dev": true, + "requires": { + "babel-runtime": "^6.22.0", + "babel-traverse": "^6.24.1", + "babel-types": "^6.24.1" + } + }, + "babel-helper-function-name": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-helper-function-name/-/babel-helper-function-name-6.24.1.tgz", + "integrity": "sha1-00dbjAPtmCQqJbSDUasYOZ01gKk=", + "dev": true, + "requires": { + "babel-helper-get-function-arity": "^6.24.1", + "babel-runtime": "^6.22.0", + "babel-template": "^6.24.1", + "babel-traverse": "^6.24.1", + "babel-types": "^6.24.1" + } + }, + "babel-helper-get-function-arity": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-helper-get-function-arity/-/babel-helper-get-function-arity-6.24.1.tgz", + "integrity": "sha1-j3eCqpNAfEHTqlCQj4mwMbG2hT0=", + "dev": true, + "requires": { + "babel-runtime": "^6.22.0", + "babel-types": "^6.24.1" + } + }, + "babel-helper-hoist-variables": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-helper-hoist-variables/-/babel-helper-hoist-variables-6.24.1.tgz", + "integrity": "sha1-HssnaJydJVE+rbyZFKc/VAi+enY=", + "dev": true, + "requires": { + "babel-runtime": "^6.22.0", + "babel-types": "^6.24.1" + } + }, + "babel-helper-regex": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-helper-regex/-/babel-helper-regex-6.26.0.tgz", + "integrity": "sha1-MlxZ+QL4LyS3T6zu0DY5VPZJXnI=", + "dev": true, + "requires": { + "babel-runtime": "^6.26.0", + "babel-types": "^6.26.0", + "lodash": "^4.17.4" + } + }, + "babel-helper-remap-async-to-generator": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-helper-remap-async-to-generator/-/babel-helper-remap-async-to-generator-6.24.1.tgz", + "integrity": "sha1-XsWBgnrXI/7N04HxySg5BnbkVRs=", + "dev": true, + "requires": { + "babel-helper-function-name": "^6.24.1", + "babel-runtime": "^6.22.0", + "babel-template": "^6.24.1", + "babel-traverse": "^6.24.1", + "babel-types": "^6.24.1" + } + }, + "babel-helpers": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-helpers/-/babel-helpers-6.24.1.tgz", + "integrity": "sha1-NHHenK7DiOXIUOWX5Yom3fN2ArI=", + "dev": true, + "requires": { + "babel-runtime": "^6.22.0", + "babel-template": "^6.24.1" + } + }, + "babel-messages": { + "version": "6.23.0", + "resolved": "https://registry.npmjs.org/babel-messages/-/babel-messages-6.23.0.tgz", + "integrity": "sha1-8830cDhYA1sqKVHG7F7fbGLyYw4=", + "dev": true, + "requires": { + "babel-runtime": "^6.22.0" + } + }, + "babel-plugin-check-es2015-constants": { + "version": "6.22.0", + "resolved": "https://registry.npmjs.org/babel-plugin-check-es2015-constants/-/babel-plugin-check-es2015-constants-6.22.0.tgz", + "integrity": "sha1-NRV7EBQm/S/9PaP3XH0ekYNbv4o=", + "dev": true, + "requires": { + "babel-runtime": "^6.22.0" + } + }, + "babel-plugin-espower": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/babel-plugin-espower/-/babel-plugin-espower-2.4.0.tgz", + "integrity": "sha512-/+SRpy7pKgTI28oEHfn1wkuM5QFAdRq8WNsOOih1dVrdV6A/WbNbRZyl0eX5eyDgtb0lOE27PeDFuCX2j8OxVg==", + "dev": true, + "requires": { + "babel-generator": "^6.1.0", + "babylon": "^6.1.0", + "call-matcher": "^1.0.0", + "core-js": "^2.0.0", + "espower-location-detector": "^1.0.0", + "espurify": "^1.6.0", + "estraverse": "^4.1.1" + } + }, + "babel-plugin-syntax-async-functions": { + "version": "6.13.0", + "resolved": "http://registry.npmjs.org/babel-plugin-syntax-async-functions/-/babel-plugin-syntax-async-functions-6.13.0.tgz", + "integrity": "sha1-ytnK0RkbWtY0vzCuCHI5HgZHvpU=", + "dev": true + }, + "babel-plugin-syntax-exponentiation-operator": { + "version": "6.13.0", + "resolved": "http://registry.npmjs.org/babel-plugin-syntax-exponentiation-operator/-/babel-plugin-syntax-exponentiation-operator-6.13.0.tgz", + "integrity": "sha1-nufoM3KQ2pUoggGmpX9BcDF4MN4=", + "dev": true + }, + "babel-plugin-syntax-object-rest-spread": { + "version": "6.13.0", + "resolved": "http://registry.npmjs.org/babel-plugin-syntax-object-rest-spread/-/babel-plugin-syntax-object-rest-spread-6.13.0.tgz", + "integrity": "sha1-/WU28rzhODb/o6VFjEkDpZe7O/U=", + "dev": true + }, + "babel-plugin-syntax-trailing-function-commas": { + "version": "6.22.0", + "resolved": "https://registry.npmjs.org/babel-plugin-syntax-trailing-function-commas/-/babel-plugin-syntax-trailing-function-commas-6.22.0.tgz", + "integrity": "sha1-ugNgk3+NBuQBgKQ/4NVhb/9TLPM=", + "dev": true + }, + "babel-plugin-transform-async-to-generator": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-async-to-generator/-/babel-plugin-transform-async-to-generator-6.24.1.tgz", + "integrity": "sha1-ZTbjeK/2yx1VF6wOQOs+n8jQh2E=", + "dev": true, + "requires": { + "babel-helper-remap-async-to-generator": "^6.24.1", + "babel-plugin-syntax-async-functions": "^6.8.0", + "babel-runtime": "^6.22.0" + } + }, + "babel-plugin-transform-es2015-destructuring": { + "version": "6.23.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-destructuring/-/babel-plugin-transform-es2015-destructuring-6.23.0.tgz", + "integrity": "sha1-mXux8auWf2gtKwh2/jWNYOdlxW0=", + "dev": true, + "requires": { + "babel-runtime": "^6.22.0" + } + }, + "babel-plugin-transform-es2015-function-name": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-function-name/-/babel-plugin-transform-es2015-function-name-6.24.1.tgz", + "integrity": "sha1-g0yJhTvDaxrw86TF26qU/Y6sqos=", + "dev": true, + "requires": { + "babel-helper-function-name": "^6.24.1", + "babel-runtime": "^6.22.0", + "babel-types": "^6.24.1" + } + }, + "babel-plugin-transform-es2015-modules-commonjs": { + "version": "6.26.2", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-modules-commonjs/-/babel-plugin-transform-es2015-modules-commonjs-6.26.2.tgz", + "integrity": "sha512-CV9ROOHEdrjcwhIaJNBGMBCodN+1cfkwtM1SbUHmvyy35KGT7fohbpOxkE2uLz1o6odKK2Ck/tz47z+VqQfi9Q==", + "dev": true, + "requires": { + "babel-plugin-transform-strict-mode": "^6.24.1", + "babel-runtime": "^6.26.0", + "babel-template": "^6.26.0", + "babel-types": "^6.26.0" + } + }, + "babel-plugin-transform-es2015-parameters": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-parameters/-/babel-plugin-transform-es2015-parameters-6.24.1.tgz", + "integrity": "sha1-V6w1GrScrxSpfNE7CfZv3wpiXys=", + "dev": true, + "requires": { + "babel-helper-call-delegate": "^6.24.1", + "babel-helper-get-function-arity": "^6.24.1", + "babel-runtime": "^6.22.0", + "babel-template": "^6.24.1", + "babel-traverse": "^6.24.1", + "babel-types": "^6.24.1" + } + }, + "babel-plugin-transform-es2015-spread": { + "version": "6.22.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-spread/-/babel-plugin-transform-es2015-spread-6.22.0.tgz", + "integrity": "sha1-1taKmfia7cRTbIGlQujdnxdG+NE=", + "dev": true, + "requires": { + "babel-runtime": "^6.22.0" + } + }, + "babel-plugin-transform-es2015-sticky-regex": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-sticky-regex/-/babel-plugin-transform-es2015-sticky-regex-6.24.1.tgz", + "integrity": "sha1-AMHNsaynERLN8M9hJsLta0V8zbw=", + "dev": true, + "requires": { + "babel-helper-regex": "^6.24.1", + "babel-runtime": "^6.22.0", + "babel-types": "^6.24.1" + } + }, + "babel-plugin-transform-es2015-unicode-regex": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-unicode-regex/-/babel-plugin-transform-es2015-unicode-regex-6.24.1.tgz", + "integrity": "sha1-04sS9C6nMj9yk4fxinxa4frrNek=", + "dev": true, + "requires": { + "babel-helper-regex": "^6.24.1", + "babel-runtime": "^6.22.0", + "regexpu-core": "^2.0.0" + } + }, + "babel-plugin-transform-exponentiation-operator": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-exponentiation-operator/-/babel-plugin-transform-exponentiation-operator-6.24.1.tgz", + "integrity": "sha1-KrDJx/MJj6SJB3cruBP+QejeOg4=", + "dev": true, + "requires": { + "babel-helper-builder-binary-assignment-operator-visitor": "^6.24.1", + "babel-plugin-syntax-exponentiation-operator": "^6.8.0", + "babel-runtime": "^6.22.0" + } + }, + "babel-plugin-transform-strict-mode": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-strict-mode/-/babel-plugin-transform-strict-mode-6.24.1.tgz", + "integrity": "sha1-1fr3qleKZbvlkc9e2uBKDGcCB1g=", + "dev": true, + "requires": { + "babel-runtime": "^6.22.0", + "babel-types": "^6.24.1" + } + }, + "babel-register": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-register/-/babel-register-6.26.0.tgz", + "integrity": "sha1-btAhFz4vy0htestFxgCahW9kcHE=", + "dev": true, + "requires": { + "babel-core": "^6.26.0", + "babel-runtime": "^6.26.0", + "core-js": "^2.5.0", + "home-or-tmp": "^2.0.0", + "lodash": "^4.17.4", + "mkdirp": "^0.5.1", + "source-map-support": "^0.4.15" + }, + "dependencies": { + "source-map-support": { + "version": "0.4.18", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.4.18.tgz", + "integrity": "sha512-try0/JqxPLF9nOjvSta7tVondkP5dwgyLDjVoyMDlmjugT2lRZ1OfsrYTkCd2hkDnJTKRbO/Rl3orm8vlsUzbA==", + "dev": true, + "requires": { + "source-map": "^0.5.6" + } + } + } + }, + "babel-runtime": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.26.0.tgz", + "integrity": "sha1-llxwWGaOgrVde/4E/yM3vItWR/4=", + "dev": true, + "requires": { + "core-js": "^2.4.0", + "regenerator-runtime": "^0.11.0" + } + }, + "babel-template": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-template/-/babel-template-6.26.0.tgz", + "integrity": "sha1-3gPi0WOWsGn0bdn/+FIfsaDjXgI=", + "dev": true, + "requires": { + "babel-runtime": "^6.26.0", + "babel-traverse": "^6.26.0", + "babel-types": "^6.26.0", + "babylon": "^6.18.0", + "lodash": "^4.17.4" + } + }, + "babel-traverse": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-traverse/-/babel-traverse-6.26.0.tgz", + "integrity": "sha1-RqnL1+3MYsjlwGTi0tjQ9ANXZu4=", + "dev": true, + "requires": { + "babel-code-frame": "^6.26.0", + "babel-messages": "^6.23.0", + "babel-runtime": "^6.26.0", + "babel-types": "^6.26.0", + "babylon": "^6.18.0", + "debug": "^2.6.8", + "globals": "^9.18.0", + "invariant": "^2.2.2", + "lodash": "^4.17.4" + } + }, + "babel-types": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-types/-/babel-types-6.26.0.tgz", + "integrity": "sha1-o7Bz+Uq0nrb6Vc1lInozQ4BjJJc=", + "dev": true, + "requires": { + "babel-runtime": "^6.26.0", + "esutils": "^2.0.2", + "lodash": "^4.17.4", + "to-fast-properties": "^1.0.3" + } + }, + "babylon": { + "version": "6.18.0", + "resolved": "https://registry.npmjs.org/babylon/-/babylon-6.18.0.tgz", + "integrity": "sha512-q/UEjfGJ2Cm3oKV71DJz9d25TPnq5rhBVL2Q4fA5wcC3jcrdn7+SssEybFIxwAvvP+YCsCYNKughoF33GxgycQ==", + "dev": true + }, + "balanced-match": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=" + }, + "base": { + "version": "0.11.2", + "resolved": "https://registry.npmjs.org/base/-/base-0.11.2.tgz", + "integrity": "sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg==", + "requires": { + "cache-base": "^1.0.1", + "class-utils": "^0.3.5", + "component-emitter": "^1.2.1", + "define-property": "^1.0.0", + "isobject": "^3.0.1", + "mixin-deep": "^1.2.0", + "pascalcase": "^0.1.1" + }, + "dependencies": { + "define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "requires": { + "is-descriptor": "^1.0.0" + } + }, + "is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "requires": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + } + } + } + }, + "bcrypt-pbkdf": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", + "integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=", + "dev": true, + "requires": { + "tweetnacl": "^0.14.3" + } + }, + "binary-extensions": { + "version": "1.12.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-1.12.0.tgz", + "integrity": "sha512-DYWGk01lDcxeS/K9IHPGWfT8PsJmbXRtRd2Sx72Tnb8pcYZQFF1oSDb8hJtS1vhp212q1Rzi5dUf9+nq0o9UIg==", + "dev": true + }, + "bluebird": { + "version": "3.5.2", + "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.5.2.tgz", + "integrity": "sha512-dhHTWMI7kMx5whMQntl7Vr9C6BvV10lFXDAasnqnrMYhXVCzzk6IO9Fo2L75jXHT07WrOngL1WDXOp+yYS91Yg==", + "dev": true + }, + "boxen": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/boxen/-/boxen-1.3.0.tgz", + "integrity": "sha512-TNPjfTr432qx7yOjQyaXm3dSR0MH9vXp7eT1BFSl/C51g+EFnOR9hTg1IreahGBmDNCehscshe45f+C1TBZbLw==", + "dev": true, + "requires": { + "ansi-align": "^2.0.0", + "camelcase": "^4.0.0", + "chalk": "^2.0.1", + "cli-boxes": "^1.0.0", + "string-width": "^2.0.0", + "term-size": "^1.2.0", + "widest-line": "^2.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "dev": true + }, + "camelcase": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz", + "integrity": "sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0=", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true + }, + "string-width": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", + "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "dev": true, + "requires": { + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^4.0.0" + } + }, + "strip-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "dev": true, + "requires": { + "ansi-regex": "^3.0.0" + } + } + } + }, + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "braces": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", + "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", + "requires": { + "arr-flatten": "^1.1.0", + "array-unique": "^0.3.2", + "extend-shallow": "^2.0.1", + "fill-range": "^4.0.0", + "isobject": "^3.0.1", + "repeat-element": "^1.1.2", + "snapdragon": "^0.8.1", + "snapdragon-node": "^2.0.1", + "split-string": "^3.0.2", + "to-regex": "^3.0.1" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "browser-stdout": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz", + "integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==", + "dev": true + }, + "buf-compare": { + "version": "1.0.1", + "resolved": "http://registry.npmjs.org/buf-compare/-/buf-compare-1.0.1.tgz", + "integrity": "sha1-/vKNqLgROgoNtEMLC2Rntpcws0o=", + "dev": true + }, + "buffer-equal-constant-time": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz", + "integrity": "sha1-+OcRMvf/5uAaXJaXpMbz5I1cyBk=" + }, + "buffer-from": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz", + "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==", + "dev": true + }, + "builtin-modules": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz", + "integrity": "sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8=", + "dev": true + }, + "bytebuffer": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/bytebuffer/-/bytebuffer-5.0.1.tgz", + "integrity": "sha1-WC7qSxqHO20CCkjVjfhfC7ps/d0=", + "requires": { + "long": "~3" + }, + "dependencies": { + "long": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/long/-/long-3.2.0.tgz", + "integrity": "sha1-2CG3E4yhy1gcFymQ7xTbIAtcR0s=" + } + } + }, + "cache-base": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/cache-base/-/cache-base-1.0.1.tgz", + "integrity": "sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ==", + "requires": { + "collection-visit": "^1.0.0", + "component-emitter": "^1.2.1", + "get-value": "^2.0.6", + "has-value": "^1.0.0", + "isobject": "^3.0.1", + "set-value": "^2.0.0", + "to-object-path": "^0.3.0", + "union-value": "^1.0.0", + "unset-value": "^1.0.0" + } + }, + "cacheable-request": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/cacheable-request/-/cacheable-request-2.1.4.tgz", + "integrity": "sha1-DYCIAbY0KtM8kd+dC0TcCbkeXD0=", + "dev": true, + "requires": { + "clone-response": "1.0.2", + "get-stream": "3.0.0", + "http-cache-semantics": "3.8.1", + "keyv": "3.0.0", + "lowercase-keys": "1.0.0", + "normalize-url": "2.0.1", + "responselike": "1.0.2" + }, + "dependencies": { + "lowercase-keys": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-1.0.0.tgz", + "integrity": "sha1-TjNms55/VFfjXxMkvfb4jQv8cwY=", + "dev": true + } + } + }, + "caching-transform": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/caching-transform/-/caching-transform-1.0.1.tgz", + "integrity": "sha1-bb2y8g+Nj7znnz6U6dF0Lc31wKE=", + "dev": true, + "requires": { + "md5-hex": "^1.2.0", + "mkdirp": "^0.5.1", + "write-file-atomic": "^1.1.4" + }, + "dependencies": { + "md5-hex": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/md5-hex/-/md5-hex-1.3.0.tgz", + "integrity": "sha1-0sSv6YPENwZiF5uMrRRSGRNQRsQ=", + "dev": true, + "requires": { + "md5-o-matic": "^0.1.1" + } + }, + "write-file-atomic": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-1.3.4.tgz", + "integrity": "sha1-+Aek8LHZ6ROuekgRLmzDrxmRtF8=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.11", + "imurmurhash": "^0.1.4", + "slide": "^1.1.5" + } + } + } + }, + "call-matcher": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/call-matcher/-/call-matcher-1.1.0.tgz", + "integrity": "sha512-IoQLeNwwf9KTNbtSA7aEBb1yfDbdnzwjCetjkC8io5oGeOmK2CBNdg0xr+tadRYKO0p7uQyZzvon0kXlZbvGrw==", + "dev": true, + "requires": { + "core-js": "^2.0.0", + "deep-equal": "^1.0.0", + "espurify": "^1.6.0", + "estraverse": "^4.0.0" + } + }, + "call-me-maybe": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/call-me-maybe/-/call-me-maybe-1.0.1.tgz", + "integrity": "sha1-JtII6onje1y95gJQoV8DHBak1ms=" + }, + "call-signature": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/call-signature/-/call-signature-0.0.2.tgz", + "integrity": "sha1-qEq8glpV70yysCi9dOIFpluaSZY=" + }, + "caller-path": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/caller-path/-/caller-path-0.1.0.tgz", + "integrity": "sha1-lAhe9jWB7NPaqSREqP6U6CV3dR8=", + "dev": true, + "requires": { + "callsites": "^0.2.0" + } + }, + "callsites": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-0.2.0.tgz", + "integrity": "sha1-r6uWJikQp/M8GaV3WCXGnzTjUMo=", + "dev": true + }, + "camelcase": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-2.1.1.tgz", + "integrity": "sha1-fB0W1nmhu+WcoCys7PsBHiAfWh8=" + }, + "camelcase-keys": { + "version": "2.1.0", + "resolved": "http://registry.npmjs.org/camelcase-keys/-/camelcase-keys-2.1.0.tgz", + "integrity": "sha1-MIvur/3ygRkFHvodkyITyRuPkuc=", + "dev": true, + "requires": { + "camelcase": "^2.0.0", + "map-obj": "^1.0.0" + } + }, + "capture-stack-trace": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/capture-stack-trace/-/capture-stack-trace-1.0.1.tgz", + "integrity": "sha512-mYQLZnx5Qt1JgB1WEiMCf2647plpGeQ2NMR/5L0HNZzGQo4fuSPnK+wjfPnKZV0aiJDgzmWqqkV/g7JD+DW0qw==", + "dev": true + }, + "caseless": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", + "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=", + "dev": true + }, + "catharsis": { + "version": "0.8.9", + "resolved": "https://registry.npmjs.org/catharsis/-/catharsis-0.8.9.tgz", + "integrity": "sha1-mMyJDKZS3S7w5ws3klMQ/56Q/Is=", + "dev": true, + "requires": { + "underscore-contrib": "~0.3.0" + } + }, + "center-align": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/center-align/-/center-align-0.1.3.tgz", + "integrity": "sha1-qg0yYptu6XIgBBHL1EYckHvCt60=", + "dev": true, + "optional": true, + "requires": { + "align-text": "^0.1.3", + "lazy-cache": "^1.0.3" + } + }, + "chalk": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "chardet": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.7.0.tgz", + "integrity": "sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==", + "dev": true + }, + "chokidar": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-1.7.0.tgz", + "integrity": "sha1-eY5ol3gVHIB2tLNg5e3SjNortGg=", + "dev": true, + "requires": { + "anymatch": "^1.3.0", + "async-each": "^1.0.0", + "fsevents": "^1.0.0", + "glob-parent": "^2.0.0", + "inherits": "^2.0.1", + "is-binary-path": "^1.0.0", + "is-glob": "^2.0.0", + "path-is-absolute": "^1.0.0", + "readdirp": "^2.0.0" + }, + "dependencies": { + "glob-parent": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-2.0.0.tgz", + "integrity": "sha1-gTg9ctsFT8zPUzbaqQLxgvbtuyg=", + "dev": true, + "requires": { + "is-glob": "^2.0.0" + } + }, + "is-extglob": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz", + "integrity": "sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA=", + "dev": true + }, + "is-glob": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz", + "integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=", + "dev": true, + "requires": { + "is-extglob": "^1.0.0" + } + } + } + }, + "ci-info": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-1.6.0.tgz", + "integrity": "sha512-vsGdkwSCDpWmP80ncATX7iea5DWQemg1UgCW5J8tqjU3lYw4FBYuj89J0CTVomA7BEfvSZd84GmHko+MxFQU2A==", + "dev": true + }, + "circular-json": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/circular-json/-/circular-json-0.3.3.tgz", + "integrity": "sha512-UZK3NBx2Mca+b5LsG7bY183pHWt5Y1xts4P3Pz7ENTwGVnJOUWbRb3ocjvX7hx9tq/yTAdclXm9sZ38gNuem4A==", + "dev": true + }, + "class-utils": { + "version": "0.3.6", + "resolved": "https://registry.npmjs.org/class-utils/-/class-utils-0.3.6.tgz", + "integrity": "sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg==", + "requires": { + "arr-union": "^3.1.0", + "define-property": "^0.2.5", + "isobject": "^3.0.0", + "static-extend": "^0.1.1" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "requires": { + "is-descriptor": "^0.1.0" + } + } + } + }, + "clean-stack": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-1.3.0.tgz", + "integrity": "sha1-noIVAa6XmYbEax1m0tQy2y/UrjE=", + "dev": true + }, + "clean-yaml-object": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/clean-yaml-object/-/clean-yaml-object-0.1.0.tgz", + "integrity": "sha1-Y/sRDcLOGoTcIfbZM0h20BCui2g=", + "dev": true + }, + "cli-boxes": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/cli-boxes/-/cli-boxes-1.0.0.tgz", + "integrity": "sha1-T6kXw+WclKAEzWH47lCdplFocUM=", + "dev": true + }, + "cli-cursor": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-2.1.0.tgz", + "integrity": "sha1-s12sN2R5+sw+lHR9QdDQ9SOP/LU=", + "dev": true, + "requires": { + "restore-cursor": "^2.0.0" + } + }, + "cli-spinners": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/cli-spinners/-/cli-spinners-1.3.1.tgz", + "integrity": "sha512-1QL4544moEsDVH9T/l6Cemov/37iv1RtoKf7NJ04A60+4MREXNfx/QvavbH6QoGdsD4N4Mwy49cmaINR/o2mdg==", + "dev": true + }, + "cli-truncate": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/cli-truncate/-/cli-truncate-1.1.0.tgz", + "integrity": "sha512-bAtZo0u82gCfaAGfSNxUdTI9mNyza7D8w4CVCcaOsy7sgwDzvx6ekr6cuWJqY3UGzgnQ1+4wgENup5eIhgxEYA==", + "dev": true, + "requires": { + "slice-ansi": "^1.0.0", + "string-width": "^2.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true + }, + "string-width": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", + "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "dev": true, + "requires": { + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^4.0.0" + } + }, + "strip-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "dev": true, + "requires": { + "ansi-regex": "^3.0.0" + } + } + } + }, + "cli-width": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-2.2.0.tgz", + "integrity": "sha1-/xnt6Kml5XkyQUewwR8PvLq+1jk=", + "dev": true + }, + "cliui": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-3.2.0.tgz", + "integrity": "sha1-EgYBU3qRbSmUD5NNo7SNWFo5IT0=", + "requires": { + "string-width": "^1.0.1", + "strip-ansi": "^3.0.1", + "wrap-ansi": "^2.0.0" + } + }, + "clone-response": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/clone-response/-/clone-response-1.0.2.tgz", + "integrity": "sha1-0dyXOSAxTfZ/vrlCI7TuNQI56Ws=", + "dev": true, + "requires": { + "mimic-response": "^1.0.0" + } + }, + "co": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", + "integrity": "sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ=", + "dev": true + }, + "co-with-promise": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/co-with-promise/-/co-with-promise-4.6.0.tgz", + "integrity": "sha1-QT59tvWJOmC5Qs9JLEvsk9tBWrc=", + "dev": true, + "requires": { + "pinkie-promise": "^1.0.0" + } + }, + "code-excerpt": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/code-excerpt/-/code-excerpt-2.1.1.tgz", + "integrity": "sha512-tJLhH3EpFm/1x7heIW0hemXJTUU5EWl2V0EIX558jp05Mt1U6DVryCgkp3l37cxqs+DNbNgxG43SkwJXpQ14Jw==", + "dev": true, + "requires": { + "convert-to-spaces": "^1.0.1" + } + }, + "code-point-at": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", + "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=" + }, + "codecov": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/codecov/-/codecov-3.1.0.tgz", + "integrity": "sha512-aWQc/rtHbcWEQLka6WmBAOpV58J2TwyXqlpAQGhQaSiEUoigTTUk6lLd2vB3kXkhnDyzyH74RXfmV4dq2txmdA==", + "dev": true, + "requires": { + "argv": "^0.0.2", + "ignore-walk": "^3.0.1", + "js-yaml": "^3.12.0", + "request": "^2.87.0", + "urlgrey": "^0.4.4" + } + }, + "collection-visit": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/collection-visit/-/collection-visit-1.0.0.tgz", + "integrity": "sha1-S8A3PBZLwykbTTaMgpzxqApZ3KA=", + "requires": { + "map-visit": "^1.0.0", + "object-visit": "^1.0.0" + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "dev": true + }, + "colors": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/colors/-/colors-1.1.2.tgz", + "integrity": "sha1-FopHAXVran9RoSzgyXv6KMCE7WM=", + "dev": true + }, + "colour": { + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/colour/-/colour-0.7.1.tgz", + "integrity": "sha1-nLFpkX7F0SwHNtPoaFdG3xyt93g=" + }, + "combined-stream": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.7.tgz", + "integrity": "sha512-brWl9y6vOB1xYPZcpZde3N9zDByXTosAeMDo4p1wzo6UMOX4vumB+TP1RZ76sfE6Md68Q0NJSrE/gbezd4Ul+w==", + "dev": true, + "requires": { + "delayed-stream": "~1.0.0" + } + }, + "commander": { + "version": "2.15.1", + "resolved": "http://registry.npmjs.org/commander/-/commander-2.15.1.tgz", + "integrity": "sha512-VlfT9F3V0v+jr4yxPc5gg9s62/fIVWsd2Bk2iD435um1NlGMYdVCq+MjcXnhYq2icNOizHr1kK+5TI6H0Hy0ag==", + "dev": true + }, + "common-path-prefix": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/common-path-prefix/-/common-path-prefix-1.0.0.tgz", + "integrity": "sha1-zVL28HEuC6q5fW+XModPIvR3UsA=", + "dev": true + }, + "commondir": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", + "integrity": "sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs=", + "dev": true + }, + "component-emitter": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.2.1.tgz", + "integrity": "sha1-E3kY1teCg/ffemt8WmPhQOaUJeY=" + }, + "concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" + }, + "concordance": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/concordance/-/concordance-3.0.0.tgz", + "integrity": "sha512-CZBzJ3/l5QJjlZM20WY7+5GP5pMTw+1UEbThcpMw8/rojsi5sBCiD8ZbBLtD+jYpRGAkwuKuqk108c154V9eyQ==", + "dev": true, + "requires": { + "date-time": "^2.1.0", + "esutils": "^2.0.2", + "fast-diff": "^1.1.1", + "function-name-support": "^0.2.0", + "js-string-escape": "^1.0.1", + "lodash.clonedeep": "^4.5.0", + "lodash.flattendeep": "^4.4.0", + "lodash.merge": "^4.6.0", + "md5-hex": "^2.0.0", + "semver": "^5.3.0", + "well-known-symbols": "^1.0.0" + }, + "dependencies": { + "date-time": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/date-time/-/date-time-2.1.0.tgz", + "integrity": "sha512-/9+C44X7lot0IeiyfgJmETtRMhBidBYM2QFFIkGa0U1k+hSyY87Nw7PY3eDqpvCBm7I3WCSfPeZskW/YYq6m4g==", + "dev": true, + "requires": { + "time-zone": "^1.0.0" + } + } + } + }, + "configstore": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/configstore/-/configstore-3.1.2.tgz", + "integrity": "sha512-vtv5HtGjcYUgFrXc6Kx747B83MRRVS5R1VTEQoXvuP+kMI+if6uywV0nDGoiydJRy4yk7h9od5Og0kxx4zUXmw==", + "dev": true, + "requires": { + "dot-prop": "^4.1.0", + "graceful-fs": "^4.1.2", + "make-dir": "^1.0.0", + "unique-string": "^1.0.0", + "write-file-atomic": "^2.0.0", + "xdg-basedir": "^3.0.0" + } + }, + "convert-source-map": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.6.0.tgz", + "integrity": "sha512-eFu7XigvxdZ1ETfbgPBohgyQ/Z++C0eEhTor0qRwBw9unw+L0/6V8wkSuGgzdThkiS5lSpdptOQPD8Ak40a+7A==", + "dev": true, + "requires": { + "safe-buffer": "~5.1.1" + } + }, + "convert-to-spaces": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/convert-to-spaces/-/convert-to-spaces-1.0.2.tgz", + "integrity": "sha1-fj5Iu+bZl7FBfdyihoIEtNPYVxU=", + "dev": true + }, + "cookiejar": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/cookiejar/-/cookiejar-2.1.2.tgz", + "integrity": "sha512-Mw+adcfzPxcPeI+0WlvRrr/3lGVO0bD75SxX6811cxSh1Wbxx7xZBGK1eVtDf6si8rg2lhnUjsVLMFMfbRIuwA==", + "dev": true + }, + "copy-descriptor": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/copy-descriptor/-/copy-descriptor-0.1.1.tgz", + "integrity": "sha1-Z29us8OZl8LuGsOpJP1hJHSPV40=" + }, + "core-assert": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/core-assert/-/core-assert-0.2.1.tgz", + "integrity": "sha1-+F4s+b/tKPdzzIs/pcW2m9wC/j8=", + "dev": true, + "requires": { + "buf-compare": "^1.0.0", + "is-error": "^2.2.0" + } + }, + "core-js": { + "version": "2.5.7", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.5.7.tgz", + "integrity": "sha512-RszJCAxg/PP6uzXVXL6BsxSXx/B05oJAQ2vkJRjyjrEcNVycaqOmNb5OTxZPE3xa5gwZduqza6L9JOCenh/Ecw==" + }, + "core-util-is": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", + "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" + }, + "create-error-class": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/create-error-class/-/create-error-class-3.0.2.tgz", + "integrity": "sha1-Br56vvlHo/FKMP1hBnHUAbyot7Y=", + "dev": true, + "requires": { + "capture-stack-trace": "^1.0.0" + } + }, + "cross-spawn": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-5.1.0.tgz", + "integrity": "sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk=", + "dev": true, + "requires": { + "lru-cache": "^4.0.1", + "shebang-command": "^1.2.0", + "which": "^1.2.9" + } + }, + "crypto-random-string": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/crypto-random-string/-/crypto-random-string-1.0.0.tgz", + "integrity": "sha1-ojD2T1aDEOFJgAmUB5DsmVRbyn4=", + "dev": true + }, + "currently-unhandled": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/currently-unhandled/-/currently-unhandled-0.4.1.tgz", + "integrity": "sha1-mI3zP+qxke95mmE2nddsF635V+o=", + "dev": true, + "requires": { + "array-find-index": "^1.0.1" + } + }, + "d": { + "version": "1.0.0", + "resolved": "http://registry.npmjs.org/d/-/d-1.0.0.tgz", + "integrity": "sha1-dUu1v+VUUdpppYuU1F9MWwRi1Y8=", + "dev": true, + "requires": { + "es5-ext": "^0.10.9" + } + }, + "dashdash": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", + "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", + "dev": true, + "requires": { + "assert-plus": "^1.0.0" + } + }, + "date-time": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/date-time/-/date-time-0.1.1.tgz", + "integrity": "sha1-7S9tk9l5DOL9ZtW1/z7dW7y/Owc=", + "dev": true + }, + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "requires": { + "ms": "2.0.0" + } + }, + "decamelize": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", + "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=" + }, + "decode-uri-component": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.0.tgz", + "integrity": "sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU=" + }, + "decompress-response": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-3.3.0.tgz", + "integrity": "sha1-gKTdMjdIOEv6JICDYirt7Jgq3/M=", + "dev": true, + "requires": { + "mimic-response": "^1.0.0" + } + }, + "deep-equal": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-1.0.1.tgz", + "integrity": "sha1-9dJgKStmDghO/0zbyfCK0yR0SLU=", + "dev": true + }, + "deep-extend": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", + "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==", + "dev": true + }, + "deep-is": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", + "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=", + "dev": true + }, + "define-properties": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", + "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==", + "requires": { + "object-keys": "^1.0.12" + } + }, + "define-property": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-2.0.2.tgz", + "integrity": "sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ==", + "requires": { + "is-descriptor": "^1.0.2", + "isobject": "^3.0.1" + }, + "dependencies": { + "is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "requires": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + } + } + } + }, + "del": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/del/-/del-2.2.2.tgz", + "integrity": "sha1-wSyYHQZ4RshLyvhiz/kw2Qf/0ag=", + "dev": true, + "requires": { + "globby": "^5.0.0", + "is-path-cwd": "^1.0.0", + "is-path-in-cwd": "^1.0.0", + "object-assign": "^4.0.1", + "pify": "^2.0.0", + "pinkie-promise": "^2.0.0", + "rimraf": "^2.2.8" + }, + "dependencies": { + "globby": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/globby/-/globby-5.0.0.tgz", + "integrity": "sha1-69hGZ8oNuzMLmbz8aOrCvFQ3Dg0=", + "dev": true, + "requires": { + "array-union": "^1.0.1", + "arrify": "^1.0.0", + "glob": "^7.0.3", + "object-assign": "^4.0.1", + "pify": "^2.0.0", + "pinkie-promise": "^2.0.0" + } + }, + "pify": { + "version": "2.3.0", + "resolved": "http://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", + "dev": true + }, + "pinkie": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz", + "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA=", + "dev": true + }, + "pinkie-promise": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", + "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=", + "dev": true, + "requires": { + "pinkie": "^2.0.0" + } + } + } + }, + "delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=", + "dev": true + }, + "detect-indent": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/detect-indent/-/detect-indent-4.0.0.tgz", + "integrity": "sha1-920GQ1LN9Docts5hnE7jqUdd4gg=", + "dev": true, + "requires": { + "repeating": "^2.0.0" + } + }, + "diff": { + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz", + "integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==", + "dev": true + }, + "diff-match-patch": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/diff-match-patch/-/diff-match-patch-1.0.4.tgz", + "integrity": "sha512-Uv3SW8bmH9nAtHKaKSanOQmj2DnlH65fUpcrMdfdaOxUG02QQ4YGZ8AE7kKOMisF7UqvOlGKVYWRvezdncW9lg==" + }, + "dir-glob": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-2.0.0.tgz", + "integrity": "sha512-37qirFDz8cA5fimp9feo43fSuRo2gHwaIn6dXL8Ber1dGwUosDrGZeCCXq57WnIqE4aQ+u3eQZzsk1yOzhdwag==", + "requires": { + "arrify": "^1.0.1", + "path-type": "^3.0.0" + } + }, + "doctrine": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz", + "integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==", + "dev": true, + "requires": { + "esutils": "^2.0.2" + } + }, + "dom-serializer": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-0.1.0.tgz", + "integrity": "sha1-BzxpdUbOB4DOI75KKOKT5AvDDII=", + "dev": true, + "requires": { + "domelementtype": "~1.1.1", + "entities": "~1.1.1" + }, + "dependencies": { + "domelementtype": { + "version": "1.1.3", + "resolved": "http://registry.npmjs.org/domelementtype/-/domelementtype-1.1.3.tgz", + "integrity": "sha1-vSh3PiZCiBrsUVRJJCmcXNgiGFs=", + "dev": true + } + } + }, + "domelementtype": { + "version": "1.3.0", + "resolved": "http://registry.npmjs.org/domelementtype/-/domelementtype-1.3.0.tgz", + "integrity": "sha1-sXrtguirWeUt2cGbF1bg/BhyBMI=", + "dev": true + }, + "domhandler": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-2.4.2.tgz", + "integrity": "sha512-JiK04h0Ht5u/80fdLMCEmV4zkNh2BcoMFBmZ/91WtYZ8qVXSKjiw7fXMgFPnHcSZgOo3XdinHvmnDUeMf5R4wA==", + "dev": true, + "requires": { + "domelementtype": "1" + } + }, + "domutils": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/domutils/-/domutils-1.7.0.tgz", + "integrity": "sha512-Lgd2XcJ/NjEw+7tFvfKxOzCYKZsdct5lczQ2ZaQY8Djz7pfAD3Gbp8ySJWtreII/vDlMVmxwa6pHmdxIYgttDg==", + "dev": true, + "requires": { + "dom-serializer": "0", + "domelementtype": "1" + } + }, + "dot-prop": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-4.2.0.tgz", + "integrity": "sha512-tUMXrxlExSW6U2EXiiKGSBVdYgtV8qlHL+C10TsW4PURY/ic+eaysnSkwB4kA/mBlCyy/IKDJ+Lc3wbWeaXtuQ==", + "dev": true, + "requires": { + "is-obj": "^1.0.0" + } + }, + "duplexer3": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/duplexer3/-/duplexer3-0.1.4.tgz", + "integrity": "sha1-7gHdHKwO08vH/b6jfcCo8c4ALOI=", + "dev": true + }, + "duplexify": { + "version": "3.6.1", + "resolved": "https://registry.npmjs.org/duplexify/-/duplexify-3.6.1.tgz", + "integrity": "sha512-vM58DwdnKmty+FSPzT14K9JXb90H+j5emaR4KYbr2KTIz00WHGbWOe5ghQTx233ZCLZtrGDALzKwcjEtSt35mA==", + "requires": { + "end-of-stream": "^1.0.0", + "inherits": "^2.0.1", + "readable-stream": "^2.0.0", + "stream-shift": "^1.0.0" + } + }, + "eastasianwidth": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", + "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==" + }, + "ecc-jsbn": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", + "integrity": "sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=", + "dev": true, + "requires": { + "jsbn": "~0.1.0", + "safer-buffer": "^2.1.0" + } + }, + "ecdsa-sig-formatter": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.10.tgz", + "integrity": "sha1-HFlQAPBKiJffuFAAiSoPTDOvhsM=", + "requires": { + "safe-buffer": "^5.0.1" + } + }, + "empower": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/empower/-/empower-1.3.1.tgz", + "integrity": "sha512-uB6/ViBaawOO/uujFADTK3SqdYlxYNn+N4usK9MRKZ4Hbn/1QSy8k2PezxCA2/+JGbF8vd/eOfghZ90oOSDZCA==", + "requires": { + "core-js": "^2.0.0", + "empower-core": "^1.2.0" + } + }, + "empower-assert": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/empower-assert/-/empower-assert-1.1.0.tgz", + "integrity": "sha512-Ylck0Q6p8y/LpNzYeBccaxAPm2ZyuqBgErgZpO9KT0HuQWF0sJckBKCLmgS1/DEXEiyBi9XtYh3clZm5cAdARw==", + "dev": true, + "requires": { + "estraverse": "^4.2.0" + } + }, + "empower-core": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/empower-core/-/empower-core-1.2.0.tgz", + "integrity": "sha512-g6+K6Geyc1o6FdXs9HwrXleCFan7d66G5xSCfSF7x1mJDCes6t0om9lFQG3zOrzh3Bkb/45N0cZ5Gqsf7YrzGQ==", + "requires": { + "call-signature": "0.0.2", + "core-js": "^2.0.0" + } + }, + "end-of-stream": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.1.tgz", + "integrity": "sha512-1MkrZNvWTKCaigbn+W15elq2BB/L22nqrSY5DKlo3X6+vclJm8Bb5djXJBmEX6fS3+zCh/F4VBK5Z2KxJt4s2Q==", + "requires": { + "once": "^1.4.0" + } + }, + "entities": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/entities/-/entities-1.1.2.tgz", + "integrity": "sha512-f2LZMYl1Fzu7YSBKg+RoROelpOaNrcGmE9AZubeDfrCEia483oW4MI4VyFd5VNHIgQ/7qm1I0wUHK1eJnn2y2w==", + "dev": true + }, + "equal-length": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/equal-length/-/equal-length-1.0.1.tgz", + "integrity": "sha1-IcoRLUirJLTh5//A5TOdMf38J0w=", + "dev": true + }, + "error-ex": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", + "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", + "dev": true, + "requires": { + "is-arrayish": "^0.2.1" + } + }, + "es5-ext": { + "version": "0.10.46", + "resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.46.tgz", + "integrity": "sha512-24XxRvJXNFwEMpJb3nOkiRJKRoupmjYmOPVlI65Qy2SrtxwOTB+g6ODjBKOtwEHbYrhWRty9xxOWLNdClT2djw==", + "dev": true, + "requires": { + "es6-iterator": "~2.0.3", + "es6-symbol": "~3.1.1", + "next-tick": "1" + } + }, + "es6-error": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/es6-error/-/es6-error-4.1.1.tgz", + "integrity": "sha512-Um/+FxMr9CISWh0bi5Zv0iOD+4cFh5qLeks1qhAopKVAJw3drgKbKySikp7wGhDL0HPeaja0P5ULZrxLkniUVg==", + "dev": true + }, + "es6-iterator": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/es6-iterator/-/es6-iterator-2.0.3.tgz", + "integrity": "sha1-p96IkUGgWpSwhUQDstCg+/qY87c=", + "dev": true, + "requires": { + "d": "1", + "es5-ext": "^0.10.35", + "es6-symbol": "^3.1.1" + } + }, + "es6-map": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/es6-map/-/es6-map-0.1.5.tgz", + "integrity": "sha1-kTbgUD3MBqMBaQ8LsU/042TpSfA=", + "dev": true, + "requires": { + "d": "1", + "es5-ext": "~0.10.14", + "es6-iterator": "~2.0.1", + "es6-set": "~0.1.5", + "es6-symbol": "~3.1.1", + "event-emitter": "~0.3.5" + } + }, + "es6-promise": { + "version": "4.2.5", + "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-4.2.5.tgz", + "integrity": "sha512-n6wvpdE43VFtJq+lUDYDBFUwV8TZbuGXLV4D6wKafg13ldznKsyEvatubnmUe31zcvelSzOHF+XbaT+Bl9ObDg==" + }, + "es6-promisify": { + "version": "5.0.0", + "resolved": "http://registry.npmjs.org/es6-promisify/-/es6-promisify-5.0.0.tgz", + "integrity": "sha1-UQnWLz5W6pZ8S2NQWu8IKRyKUgM=", + "requires": { + "es6-promise": "^4.0.3" + } + }, + "es6-set": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/es6-set/-/es6-set-0.1.5.tgz", + "integrity": "sha1-0rPsXU2ADO2BjbU40ol02wpzzLE=", + "dev": true, + "requires": { + "d": "1", + "es5-ext": "~0.10.14", + "es6-iterator": "~2.0.1", + "es6-symbol": "3.1.1", + "event-emitter": "~0.3.5" + } + }, + "es6-symbol": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.1.tgz", + "integrity": "sha1-vwDvT9q2uhtG7Le2KbTH7VcVzHc=", + "dev": true, + "requires": { + "d": "1", + "es5-ext": "~0.10.14" + } + }, + "es6-weak-map": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/es6-weak-map/-/es6-weak-map-2.0.2.tgz", + "integrity": "sha1-XjqzIlH/0VOKH45f+hNXdy+S2W8=", + "dev": true, + "requires": { + "d": "1", + "es5-ext": "^0.10.14", + "es6-iterator": "^2.0.1", + "es6-symbol": "^3.1.1" + } + }, + "escallmatch": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/escallmatch/-/escallmatch-1.5.0.tgz", + "integrity": "sha1-UAmdhugJGwkt+N37w/mm+wWgJNA=", + "dev": true, + "requires": { + "call-matcher": "^1.0.0", + "esprima": "^2.0.0" + }, + "dependencies": { + "esprima": { + "version": "2.7.3", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-2.7.3.tgz", + "integrity": "sha1-luO3DVd59q1JzQMmc9HDEnZ7pYE=", + "dev": true + } + } + }, + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "dev": true + }, + "escodegen": { + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.11.0.tgz", + "integrity": "sha512-IeMV45ReixHS53K/OmfKAIztN/igDHzTJUhZM3k1jMhIZWjk45SMwAtBsEXiJp3vSPmTcu6CXn7mDvFHRN66fw==", + "dev": true, + "requires": { + "esprima": "^3.1.3", + "estraverse": "^4.2.0", + "esutils": "^2.0.2", + "optionator": "^0.8.1", + "source-map": "~0.6.1" + }, + "dependencies": { + "esprima": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-3.1.3.tgz", + "integrity": "sha1-/cpRzuYTOJXjyI1TXOSdv/YqRjM=", + "dev": true + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true, + "optional": true + } + } + }, + "escope": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/escope/-/escope-3.6.0.tgz", + "integrity": "sha1-4Bl16BJ4GhY6ba392AOY3GTIicM=", + "dev": true, + "requires": { + "es6-map": "^0.1.3", + "es6-weak-map": "^2.0.1", + "esrecurse": "^4.1.0", + "estraverse": "^4.1.1" + } + }, + "eslint": { + "version": "5.8.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-5.8.0.tgz", + "integrity": "sha512-Zok6Bru3y2JprqTNm14mgQ15YQu/SMDkWdnmHfFg770DIUlmMFd/gqqzCHekxzjHZJxXv3tmTpH0C1icaYJsRQ==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.0.0", + "ajv": "^6.5.3", + "chalk": "^2.1.0", + "cross-spawn": "^6.0.5", + "debug": "^4.0.1", + "doctrine": "^2.1.0", + "eslint-scope": "^4.0.0", + "eslint-utils": "^1.3.1", + "eslint-visitor-keys": "^1.0.0", + "espree": "^4.0.0", + "esquery": "^1.0.1", + "esutils": "^2.0.2", + "file-entry-cache": "^2.0.0", + "functional-red-black-tree": "^1.0.1", + "glob": "^7.1.2", + "globals": "^11.7.0", + "ignore": "^4.0.6", + "imurmurhash": "^0.1.4", + "inquirer": "^6.1.0", + "is-resolvable": "^1.1.0", + "js-yaml": "^3.12.0", + "json-stable-stringify-without-jsonify": "^1.0.1", + "levn": "^0.3.0", + "lodash": "^4.17.5", + "minimatch": "^3.0.4", + "mkdirp": "^0.5.1", + "natural-compare": "^1.4.0", + "optionator": "^0.8.2", + "path-is-inside": "^1.0.2", + "pluralize": "^7.0.0", + "progress": "^2.0.0", + "regexpp": "^2.0.1", + "require-uncached": "^1.0.3", + "semver": "^5.5.1", + "strip-ansi": "^4.0.0", + "strip-json-comments": "^2.0.1", + "table": "^5.0.2", + "text-table": "^0.2.0" + }, + "dependencies": { + "ajv": { + "version": "6.5.5", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.5.5.tgz", + "integrity": "sha512-7q7gtRQDJSyuEHjuVgHoUa2VuemFiCMrfQc9Tc08XTAc4Zj/5U1buQJ0HU6i7fKjXU09SVgSmxa4sLvuvS8Iyg==", + "dev": true, + "requires": { + "fast-deep-equal": "^2.0.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + } + }, + "ansi-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "dev": true + }, + "cross-spawn": { + "version": "6.0.5", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", + "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", + "dev": true, + "requires": { + "nice-try": "^1.0.4", + "path-key": "^2.0.1", + "semver": "^5.5.0", + "shebang-command": "^1.2.0", + "which": "^1.2.9" + } + }, + "debug": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.0.tgz", + "integrity": "sha512-heNPJUJIqC+xB6ayLAMHaIrmN9HKa7aQO8MGqKpvCA+uJYVcvR6l5kgdrhRuwPFHU7P5/A1w0BjByPHwpfTDKg==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + }, + "fast-deep-equal": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz", + "integrity": "sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk=", + "dev": true + }, + "globals": { + "version": "11.8.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.8.0.tgz", + "integrity": "sha512-io6LkyPVuzCHBSQV9fmOwxZkUk6nIaGmxheLDgmuFv89j0fm2aqDbIXKAGfzCMHqz3HLF2Zf8WSG6VqMh2qFmA==", + "dev": true + }, + "ignore": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", + "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", + "dev": true + }, + "json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true + }, + "ms": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", + "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", + "dev": true + }, + "strip-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "dev": true, + "requires": { + "ansi-regex": "^3.0.0" + } + } + } + }, + "eslint-config-prettier": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-3.1.0.tgz", + "integrity": "sha512-QYGfmzuc4q4J6XIhlp8vRKdI/fI0tQfQPy1dME3UOLprE+v4ssH/3W9LM2Q7h5qBcy5m0ehCrBDU2YF8q6OY8w==", + "dev": true, + "requires": { + "get-stdin": "^6.0.0" + }, + "dependencies": { + "get-stdin": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-6.0.0.tgz", + "integrity": "sha512-jp4tHawyV7+fkkSKyvjuLZswblUtz+SQKzSWnBbii16BuZksJlU1wuBYXY75r+duh/llF1ur6oNwi+2ZzjKZ7g==", + "dev": true + } + } + }, + "eslint-plugin-es": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-es/-/eslint-plugin-es-1.3.1.tgz", + "integrity": "sha512-9XcVyZiQRVeFjqHw8qHNDAZcQLqaHlOGGpeYqzYh8S4JYCWTCO3yzyen8yVmA5PratfzTRWDwCOFphtDEG+w/w==", + "dev": true, + "requires": { + "eslint-utils": "^1.3.0", + "regexpp": "^2.0.0" + } + }, + "eslint-plugin-node": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-node/-/eslint-plugin-node-8.0.0.tgz", + "integrity": "sha512-Y+ln8iQ52scz9+rSPnSWRaAxeWaoJZ4wIveDR0vLHkuSZGe44Vk1J4HX7WvEP5Cm+iXPE8ixo7OM7gAO3/OKpQ==", + "dev": true, + "requires": { + "eslint-plugin-es": "^1.3.1", + "eslint-utils": "^1.3.1", + "ignore": "^5.0.2", + "minimatch": "^3.0.4", + "resolve": "^1.8.1", + "semver": "^5.5.0" + }, + "dependencies": { + "ignore": { + "version": "5.0.4", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.0.4.tgz", + "integrity": "sha512-WLsTMEhsQuXpCiG173+f3aymI43SXa+fB1rSfbzyP4GkPP+ZFVuO0/3sFUGNBtifisPeDcl/uD/Y2NxZ7xFq4g==", + "dev": true + } + } + }, + "eslint-plugin-prettier": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-3.0.0.tgz", + "integrity": "sha512-4g11opzhqq/8+AMmo5Vc2Gn7z9alZ4JqrbZ+D4i8KlSyxeQhZHlmIrY8U9Akf514MoEhogPa87Jgkq87aZ2Ohw==", + "dev": true, + "requires": { + "prettier-linter-helpers": "^1.0.0" + } + }, + "eslint-scope": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-4.0.0.tgz", + "integrity": "sha512-1G6UTDi7Jc1ELFwnR58HV4fK9OQK4S6N985f166xqXxpjU6plxFISJa2Ba9KCQuFa8RCnj/lSFJbHo7UFDBnUA==", + "dev": true, + "requires": { + "esrecurse": "^4.1.0", + "estraverse": "^4.1.1" + } + }, + "eslint-utils": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-1.3.1.tgz", + "integrity": "sha512-Z7YjnIldX+2XMcjr7ZkgEsOj/bREONV60qYeB/bjMAqqqZ4zxKyWX+BOUkdmRmA9riiIPVvo5x86m5elviOk0Q==", + "dev": true + }, + "eslint-visitor-keys": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz", + "integrity": "sha512-qzm/XxIbxm/FHyH341ZrbnMUpe+5Bocte9xkmFMzPMjRaZMcXww+MpBptFvtU+79L362nqiLhekCxCxDPaUMBQ==", + "dev": true + }, + "espower": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/espower/-/espower-2.1.1.tgz", + "integrity": "sha512-F4TY1qYJB1aUyzB03NsZksZzUQmQoEBaTUjRJGR30GxbkbjKI41NhCyYjrF+bGgWN7x/ZsczYppRpz/0WdI0ug==", + "dev": true, + "requires": { + "array-find": "^1.0.0", + "escallmatch": "^1.5.0", + "escodegen": "^1.7.0", + "escope": "^3.3.0", + "espower-location-detector": "^1.0.0", + "espurify": "^1.3.0", + "estraverse": "^4.1.0", + "source-map": "^0.5.0", + "type-name": "^2.0.0", + "xtend": "^4.0.0" + } + }, + "espower-loader": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/espower-loader/-/espower-loader-1.2.2.tgz", + "integrity": "sha1-7bRsPFmga6yOpzppXIblxaC8gto=", + "dev": true, + "requires": { + "convert-source-map": "^1.1.0", + "espower-source": "^2.0.0", + "minimatch": "^3.0.0", + "source-map-support": "^0.4.0", + "xtend": "^4.0.0" + }, + "dependencies": { + "source-map-support": { + "version": "0.4.18", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.4.18.tgz", + "integrity": "sha512-try0/JqxPLF9nOjvSta7tVondkP5dwgyLDjVoyMDlmjugT2lRZ1OfsrYTkCd2hkDnJTKRbO/Rl3orm8vlsUzbA==", + "dev": true, + "requires": { + "source-map": "^0.5.6" + } + } + } + }, + "espower-location-detector": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/espower-location-detector/-/espower-location-detector-1.0.0.tgz", + "integrity": "sha1-oXt+zFnTDheeK+9z+0E3cEyzMbU=", + "dev": true, + "requires": { + "is-url": "^1.2.1", + "path-is-absolute": "^1.0.0", + "source-map": "^0.5.0", + "xtend": "^4.0.0" + } + }, + "espower-source": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/espower-source/-/espower-source-2.3.0.tgz", + "integrity": "sha512-Wc4kC4zUAEV7Qt31JRPoBUc5jjowHRylml2L2VaDQ1XEbnqQofGWx+gPR03TZAPokAMl5dqyL36h3ITyMXy3iA==", + "dev": true, + "requires": { + "acorn": "^5.0.0", + "acorn-es7-plugin": "^1.0.10", + "convert-source-map": "^1.1.1", + "empower-assert": "^1.0.0", + "escodegen": "^1.10.0", + "espower": "^2.1.1", + "estraverse": "^4.0.0", + "merge-estraverse-visitors": "^1.0.0", + "multi-stage-sourcemap": "^0.2.1", + "path-is-absolute": "^1.0.0", + "xtend": "^4.0.0" + } + }, + "espree": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/espree/-/espree-4.1.0.tgz", + "integrity": "sha512-I5BycZW6FCVIub93TeVY1s7vjhP9CY6cXCznIRfiig7nRviKZYdRnj/sHEWC6A7WE9RDWOFq9+7OsWSYz8qv2w==", + "dev": true, + "requires": { + "acorn": "^6.0.2", + "acorn-jsx": "^5.0.0", + "eslint-visitor-keys": "^1.0.0" + }, + "dependencies": { + "acorn": { + "version": "6.0.4", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.0.4.tgz", + "integrity": "sha512-VY4i5EKSKkofY2I+6QLTbTTN/UvEQPCo6eiwzzSaSWfpaDhOmStMCMod6wmuPciNq+XS0faCglFu2lHZpdHUtg==", + "dev": true + } + } + }, + "esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "dev": true + }, + "espurify": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/espurify/-/espurify-1.8.1.tgz", + "integrity": "sha512-ZDko6eY/o+D/gHCWyHTU85mKDgYcS4FJj7S+YD6WIInm7GQ6AnOjmcL4+buFV/JOztVLELi/7MmuGU5NHta0Mg==", + "requires": { + "core-js": "^2.0.0" + } + }, + "esquery": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.0.1.tgz", + "integrity": "sha512-SmiyZ5zIWH9VM+SRUReLS5Q8a7GxtRdxEBVZpm98rJM7Sb+A9DVCndXfkeFUd3byderg+EbDkfnevfCwynWaNA==", + "dev": true, + "requires": { + "estraverse": "^4.0.0" + } + }, + "esrecurse": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.2.1.tgz", + "integrity": "sha512-64RBB++fIOAXPw3P9cy89qfMlvZEXZkqqJkjqqXIvzP5ezRZjW+lPWjw35UX/3EhUPFYbg5ER4JYgDw4007/DQ==", + "dev": true, + "requires": { + "estraverse": "^4.1.0" + } + }, + "estraverse": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.2.0.tgz", + "integrity": "sha1-De4/7TH81GlhjOc0IJn8GvoL2xM=" + }, + "esutils": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz", + "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=", + "dev": true + }, + "event-emitter": { + "version": "0.3.5", + "resolved": "https://registry.npmjs.org/event-emitter/-/event-emitter-0.3.5.tgz", + "integrity": "sha1-34xp7vFkeSPHFXuc6DhAYQsCzDk=", + "dev": true, + "requires": { + "d": "1", + "es5-ext": "~0.10.14" + } + }, + "execa": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/execa/-/execa-0.7.0.tgz", + "integrity": "sha1-lEvs00zEHuMqY6n68nrVpl/Fl3c=", + "dev": true, + "requires": { + "cross-spawn": "^5.0.1", + "get-stream": "^3.0.0", + "is-stream": "^1.1.0", + "npm-run-path": "^2.0.0", + "p-finally": "^1.0.0", + "signal-exit": "^3.0.0", + "strip-eof": "^1.0.0" + } + }, + "expand-brackets": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz", + "integrity": "sha1-t3c14xXOMPa27/D4OwQVGiJEliI=", + "requires": { + "debug": "^2.3.3", + "define-property": "^0.2.5", + "extend-shallow": "^2.0.1", + "posix-character-classes": "^0.1.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "requires": { + "is-descriptor": "^0.1.0" + } + }, + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "expand-range": { + "version": "1.8.2", + "resolved": "https://registry.npmjs.org/expand-range/-/expand-range-1.8.2.tgz", + "integrity": "sha1-opnv/TNf4nIeuujiV+x5ZE/IUzc=", + "dev": true, + "requires": { + "fill-range": "^2.1.0" + }, + "dependencies": { + "fill-range": { + "version": "2.2.4", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-2.2.4.tgz", + "integrity": "sha512-cnrcCbj01+j2gTG921VZPnHbjmdAf8oQV/iGeV2kZxGSyfYjjTyY79ErsK1WJWMpw6DaApEX72binqJE+/d+5Q==", + "dev": true, + "requires": { + "is-number": "^2.1.0", + "isobject": "^2.0.0", + "randomatic": "^3.0.0", + "repeat-element": "^1.1.2", + "repeat-string": "^1.5.2" + } + }, + "is-number": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-2.1.0.tgz", + "integrity": "sha1-Afy7s5NGOlSPL0ZszhbezknbkI8=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + } + }, + "isobject": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", + "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=", + "dev": true, + "requires": { + "isarray": "1.0.0" + } + }, + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "extend": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", + "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==" + }, + "extend-shallow": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz", + "integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=", + "requires": { + "assign-symbols": "^1.0.0", + "is-extendable": "^1.0.1" + }, + "dependencies": { + "is-extendable": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", + "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", + "requires": { + "is-plain-object": "^2.0.4" + } + } + } + }, + "external-editor": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-3.0.3.tgz", + "integrity": "sha512-bn71H9+qWoOQKyZDo25mOMVpSmXROAsTJVVVYzrrtol3d4y+AsKjf4Iwl2Q+IuT0kFSQ1qo166UuIwqYq7mGnA==", + "dev": true, + "requires": { + "chardet": "^0.7.0", + "iconv-lite": "^0.4.24", + "tmp": "^0.0.33" + } + }, + "extglob": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/extglob/-/extglob-2.0.4.tgz", + "integrity": "sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw==", + "requires": { + "array-unique": "^0.3.2", + "define-property": "^1.0.0", + "expand-brackets": "^2.1.4", + "extend-shallow": "^2.0.1", + "fragment-cache": "^0.2.1", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" + }, + "dependencies": { + "define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "requires": { + "is-descriptor": "^1.0.0" + } + }, + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "requires": { + "is-extendable": "^0.1.0" + } + }, + "is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "requires": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + } + } + } + }, + "extsprintf": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", + "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=", + "dev": true + }, + "fast-deep-equal": { + "version": "1.1.0", + "resolved": "http://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-1.1.0.tgz", + "integrity": "sha1-wFNHeBfIa1HaqFPIHgWbcz0CNhQ=", + "dev": true + }, + "fast-diff": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/fast-diff/-/fast-diff-1.2.0.tgz", + "integrity": "sha512-xJuoT5+L99XlZ8twedaRf6Ax2TgQVxvgZOYoPKqZufmJib0tL2tegPBOZb1pVNgIhlqDlA0eO0c3wBvQcmzx4w==", + "dev": true + }, + "fast-glob": { + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-2.2.3.tgz", + "integrity": "sha512-NiX+JXjnx43RzvVFwRWfPKo4U+1BrK5pJPsHQdKMlLoFHrrGktXglQhHliSihWAq+m1z6fHk3uwGHrtRbS9vLA==", + "requires": { + "@mrmlnc/readdir-enhanced": "^2.2.1", + "@nodelib/fs.stat": "^1.0.1", + "glob-parent": "^3.1.0", + "is-glob": "^4.0.0", + "merge2": "^1.2.1", + "micromatch": "^3.1.10" + } + }, + "fast-json-stable-stringify": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz", + "integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I=", + "dev": true + }, + "fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", + "dev": true + }, + "figures": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/figures/-/figures-2.0.0.tgz", + "integrity": "sha1-OrGi0qYsi/tDGgyUy3l6L84nyWI=", + "dev": true, + "requires": { + "escape-string-regexp": "^1.0.5" + } + }, + "file-entry-cache": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-2.0.0.tgz", + "integrity": "sha1-w5KZDD5oR4PYOLjISkXYoEhFg2E=", + "dev": true, + "requires": { + "flat-cache": "^1.2.1", + "object-assign": "^4.0.1" + } + }, + "filename-regex": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/filename-regex/-/filename-regex-2.0.1.tgz", + "integrity": "sha1-wcS5vuPglyXdsQa3XB4wH+LxiyY=", + "dev": true + }, + "fill-keys": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/fill-keys/-/fill-keys-1.0.2.tgz", + "integrity": "sha1-mo+jb06K1jTjv2tPPIiCVRRS6yA=", + "dev": true, + "requires": { + "is-object": "~1.0.1", + "merge-descriptors": "~1.0.0" + } + }, + "fill-range": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", + "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", + "requires": { + "extend-shallow": "^2.0.1", + "is-number": "^3.0.0", + "repeat-string": "^1.6.1", + "to-regex-range": "^2.1.0" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "find-cache-dir": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-1.0.0.tgz", + "integrity": "sha1-kojj6ePMN0hxfTnq3hfPcfww7m8=", + "dev": true, + "requires": { + "commondir": "^1.0.1", + "make-dir": "^1.0.0", + "pkg-dir": "^2.0.0" + } + }, + "find-up": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", + "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", + "dev": true, + "requires": { + "locate-path": "^2.0.0" + } + }, + "flat-cache": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-1.3.0.tgz", + "integrity": "sha1-0wMLMrOBVPTjt+nHCfSQ9++XxIE=", + "dev": true, + "requires": { + "circular-json": "^0.3.1", + "del": "^2.0.2", + "graceful-fs": "^4.1.2", + "write": "^0.2.1" + } + }, + "fn-name": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/fn-name/-/fn-name-2.0.1.tgz", + "integrity": "sha1-UhTXU3pNBqSjAcDMJi/rhBiAAuc=", + "dev": true + }, + "follow-redirects": { + "version": "1.5.9", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.5.9.tgz", + "integrity": "sha512-Bh65EZI/RU8nx0wbYF9shkFZlqLP+6WT/5FnA3cE/djNSuKNHJEinGGZgu/cQEkeeb2GdFOgenAmn8qaqYke2w==", + "requires": { + "debug": "=3.1.0" + }, + "dependencies": { + "debug": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", + "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", + "requires": { + "ms": "2.0.0" + } + } + } + }, + "for-in": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", + "integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=" + }, + "for-own": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/for-own/-/for-own-0.1.5.tgz", + "integrity": "sha1-UmXGgaTylNq78XyVCbZ2OqhFEM4=", + "dev": true, + "requires": { + "for-in": "^1.0.1" + } + }, + "forever-agent": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", + "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=", + "dev": true + }, + "form-data": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz", + "integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==", + "dev": true, + "requires": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.6", + "mime-types": "^2.1.12" + } + }, + "formidable": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/formidable/-/formidable-1.2.1.tgz", + "integrity": "sha512-Fs9VRguL0gqGHkXS5GQiMCr1VhZBxz0JnJs4JmMp/2jL18Fmbzvv7vOFRU+U8TBkHEE/CX1qDXzJplVULgsLeg==", + "dev": true + }, + "fragment-cache": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/fragment-cache/-/fragment-cache-0.2.1.tgz", + "integrity": "sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk=", + "requires": { + "map-cache": "^0.2.2" + } + }, + "from2": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/from2/-/from2-2.3.0.tgz", + "integrity": "sha1-i/tVAr3kpNNs/e6gB/zKIdfjgq8=", + "dev": true, + "requires": { + "inherits": "^2.0.1", + "readable-stream": "^2.0.0" + } + }, + "fs-extra": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-6.0.1.tgz", + "integrity": "sha512-GnyIkKhhzXZUWFCaJzvyDLEEgDkPfb4/TPvJCJVuS8MWZgoSsErf++QpiAlDnKFcqhRlm+tIOcencCjyJE6ZCA==", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + } + }, + "fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" + }, + "fsevents": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.4.tgz", + "integrity": "sha512-z8H8/diyk76B7q5wg+Ud0+CqzcAF3mBBI/bA5ne5zrRUUIvNkJY//D3BqyH571KuAC4Nr7Rw7CjWX4r0y9DvNg==", + "dev": true, + "optional": true, + "requires": { + "nan": "^2.9.2", + "node-pre-gyp": "^0.10.0" + }, + "dependencies": { + "abbrev": { + "version": "1.1.1", + "bundled": true, + "dev": true, + "optional": true + }, + "ansi-regex": { + "version": "2.1.1", + "bundled": true, + "dev": true + }, + "aproba": { + "version": "1.2.0", + "bundled": true, + "dev": true, + "optional": true + }, + "are-we-there-yet": { + "version": "1.1.4", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "delegates": "^1.0.0", + "readable-stream": "^2.0.6" + } + }, + "balanced-match": { + "version": "1.0.0", + "bundled": true, + "dev": true + }, + "brace-expansion": { + "version": "1.1.11", + "bundled": true, + "dev": true, + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "chownr": { + "version": "1.0.1", + "bundled": true, + "dev": true, + "optional": true + }, + "code-point-at": { + "version": "1.1.0", + "bundled": true, + "dev": true + }, + "concat-map": { + "version": "0.0.1", + "bundled": true, + "dev": true + }, + "console-control-strings": { + "version": "1.1.0", + "bundled": true, + "dev": true + }, + "core-util-is": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "optional": true + }, + "debug": { + "version": "2.6.9", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "ms": "2.0.0" + } + }, + "deep-extend": { + "version": "0.5.1", + "bundled": true, + "dev": true, + "optional": true + }, + "delegates": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "optional": true + }, + "detect-libc": { + "version": "1.0.3", + "bundled": true, + "dev": true, + "optional": true + }, + "fs-minipass": { + "version": "1.2.5", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "minipass": "^2.2.1" + } + }, + "fs.realpath": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "optional": true + }, + "gauge": { + "version": "2.7.4", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "aproba": "^1.0.3", + "console-control-strings": "^1.0.0", + "has-unicode": "^2.0.0", + "object-assign": "^4.1.0", + "signal-exit": "^3.0.0", + "string-width": "^1.0.1", + "strip-ansi": "^3.0.1", + "wide-align": "^1.1.0" + } + }, + "glob": { + "version": "7.1.2", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "has-unicode": { + "version": "2.0.1", + "bundled": true, + "dev": true, + "optional": true + }, + "iconv-lite": { + "version": "0.4.21", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "safer-buffer": "^2.1.0" + } + }, + "ignore-walk": { + "version": "3.0.1", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "minimatch": "^3.0.4" + } + }, + "inflight": { + "version": "1.0.6", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "inherits": { + "version": "2.0.3", + "bundled": true, + "dev": true + }, + "ini": { + "version": "1.3.5", + "bundled": true, + "dev": true, + "optional": true + }, + "is-fullwidth-code-point": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "requires": { + "number-is-nan": "^1.0.0" + } + }, + "isarray": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "optional": true + }, + "minimatch": { + "version": "3.0.4", + "bundled": true, + "dev": true, + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "minimist": { + "version": "0.0.8", + "bundled": true, + "dev": true + }, + "minipass": { + "version": "2.2.4", + "bundled": true, + "dev": true, + "requires": { + "safe-buffer": "^5.1.1", + "yallist": "^3.0.0" + } + }, + "minizlib": { + "version": "1.1.0", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "minipass": "^2.2.1" + } + }, + "mkdirp": { + "version": "0.5.1", + "bundled": true, + "dev": true, + "requires": { + "minimist": "0.0.8" + } + }, + "ms": { + "version": "2.0.0", + "bundled": true, + "dev": true, + "optional": true + }, + "needle": { + "version": "2.2.0", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "debug": "^2.1.2", + "iconv-lite": "^0.4.4", + "sax": "^1.2.4" + } + }, + "node-pre-gyp": { + "version": "0.10.0", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "detect-libc": "^1.0.2", + "mkdirp": "^0.5.1", + "needle": "^2.2.0", + "nopt": "^4.0.1", + "npm-packlist": "^1.1.6", + "npmlog": "^4.0.2", + "rc": "^1.1.7", + "rimraf": "^2.6.1", + "semver": "^5.3.0", + "tar": "^4" + } + }, + "nopt": { + "version": "4.0.1", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "abbrev": "1", + "osenv": "^0.1.4" + } + }, + "npm-bundled": { + "version": "1.0.3", + "bundled": true, + "dev": true, + "optional": true + }, + "npm-packlist": { + "version": "1.1.10", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "ignore-walk": "^3.0.1", + "npm-bundled": "^1.0.1" + } + }, + "npmlog": { + "version": "4.1.2", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "are-we-there-yet": "~1.1.2", + "console-control-strings": "~1.1.0", + "gauge": "~2.7.3", + "set-blocking": "~2.0.0" + } + }, + "number-is-nan": { + "version": "1.0.1", + "bundled": true, + "dev": true + }, + "object-assign": { + "version": "4.1.1", + "bundled": true, + "dev": true, + "optional": true + }, + "once": { + "version": "1.4.0", + "bundled": true, + "dev": true, + "requires": { + "wrappy": "1" + } + }, + "os-homedir": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "optional": true + }, + "os-tmpdir": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "optional": true + }, + "osenv": { + "version": "0.1.5", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "os-homedir": "^1.0.0", + "os-tmpdir": "^1.0.0" + } + }, + "path-is-absolute": { + "version": "1.0.1", + "bundled": true, + "dev": true, + "optional": true + }, + "process-nextick-args": { + "version": "2.0.0", + "bundled": true, + "dev": true, + "optional": true + }, + "rc": { + "version": "1.2.7", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "deep-extend": "^0.5.1", + "ini": "~1.3.0", + "minimist": "^1.2.0", + "strip-json-comments": "~2.0.1" + }, + "dependencies": { + "minimist": { + "version": "1.2.0", + "bundled": true, + "dev": true, + "optional": true + } + } + }, + "readable-stream": { + "version": "2.3.6", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "rimraf": { + "version": "2.6.2", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "glob": "^7.0.5" + } + }, + "safe-buffer": { + "version": "5.1.1", + "bundled": true, + "dev": true + }, + "safer-buffer": { + "version": "2.1.2", + "bundled": true, + "dev": true, + "optional": true + }, + "sax": { + "version": "1.2.4", + "bundled": true, + "dev": true, + "optional": true + }, + "semver": { + "version": "5.5.0", + "bundled": true, + "dev": true, + "optional": true + }, + "set-blocking": { + "version": "2.0.0", + "bundled": true, + "dev": true, + "optional": true + }, + "signal-exit": { + "version": "3.0.2", + "bundled": true, + "dev": true, + "optional": true + }, + "string-width": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "requires": { + "code-point-at": "^1.0.0", + "is-fullwidth-code-point": "^1.0.0", + "strip-ansi": "^3.0.0" + } + }, + "string_decoder": { + "version": "1.1.1", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "safe-buffer": "~5.1.0" + } + }, + "strip-ansi": { + "version": "3.0.1", + "bundled": true, + "dev": true, + "requires": { + "ansi-regex": "^2.0.0" + } + }, + "strip-json-comments": { + "version": "2.0.1", + "bundled": true, + "dev": true, + "optional": true + }, + "tar": { + "version": "4.4.1", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "chownr": "^1.0.1", + "fs-minipass": "^1.2.5", + "minipass": "^2.2.4", + "minizlib": "^1.1.0", + "mkdirp": "^0.5.0", + "safe-buffer": "^5.1.1", + "yallist": "^3.0.2" + } + }, + "util-deprecate": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "optional": true + }, + "wide-align": { + "version": "1.1.2", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "string-width": "^1.0.2" + } + }, + "wrappy": { + "version": "1.0.2", + "bundled": true, + "dev": true + }, + "yallist": { + "version": "3.0.2", + "bundled": true, + "dev": true + } + } + }, + "function-name-support": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/function-name-support/-/function-name-support-0.2.0.tgz", + "integrity": "sha1-VdO/qm6v1QWlD5vIH99XVkoLsHE=", + "dev": true + }, + "functional-red-black-tree": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", + "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=", + "dev": true + }, + "gcp-metadata": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/gcp-metadata/-/gcp-metadata-0.7.0.tgz", + "integrity": "sha512-ffjC09amcDWjh3VZdkDngIo7WoluyC5Ag9PAYxZbmQLOLNI8lvPtoKTSCyU54j2gwy5roZh6sSMTfkY2ct7K3g==", + "requires": { + "axios": "^0.18.0", + "extend": "^3.0.1", + "retry-axios": "0.3.2" + } + }, + "get-caller-file": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.3.tgz", + "integrity": "sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w==", + "dev": true + }, + "get-port": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/get-port/-/get-port-3.2.0.tgz", + "integrity": "sha1-3Xzn3hh8Bsi/NTeWrHHgmfCYDrw=", + "dev": true + }, + "get-stdin": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-4.0.1.tgz", + "integrity": "sha1-uWjGsKBDhDJJAui/Gl3zJXmkUP4=", + "dev": true + }, + "get-stream": { + "version": "3.0.0", + "resolved": "http://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz", + "integrity": "sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ=", + "dev": true + }, + "get-value": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz", + "integrity": "sha1-3BXKHGcjh8p2vTesCjlbogQqLCg=" + }, + "getpass": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", + "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", + "dev": true, + "requires": { + "assert-plus": "^1.0.0" + } + }, + "glob": { + "version": "7.1.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz", + "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==", + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "glob-base": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/glob-base/-/glob-base-0.3.0.tgz", + "integrity": "sha1-27Fk9iIbHAscz4Kuoyi0l98Oo8Q=", + "dev": true, + "requires": { + "glob-parent": "^2.0.0", + "is-glob": "^2.0.0" + }, + "dependencies": { + "glob-parent": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-2.0.0.tgz", + "integrity": "sha1-gTg9ctsFT8zPUzbaqQLxgvbtuyg=", + "dev": true, + "requires": { + "is-glob": "^2.0.0" + } + }, + "is-extglob": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz", + "integrity": "sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA=", + "dev": true + }, + "is-glob": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz", + "integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=", + "dev": true, + "requires": { + "is-extglob": "^1.0.0" + } + } + } + }, + "glob-parent": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-3.1.0.tgz", + "integrity": "sha1-nmr2KZ2NO9K9QEMIMr0RPfkGxa4=", + "requires": { + "is-glob": "^3.1.0", + "path-dirname": "^1.0.0" + }, + "dependencies": { + "is-glob": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-3.1.0.tgz", + "integrity": "sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo=", + "requires": { + "is-extglob": "^2.1.0" + } + } + } + }, + "glob-to-regexp": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/glob-to-regexp/-/glob-to-regexp-0.3.0.tgz", + "integrity": "sha1-jFoUlNIGbFcMw7/kSWF1rMTVAqs=" + }, + "global-dirs": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/global-dirs/-/global-dirs-0.1.1.tgz", + "integrity": "sha1-sxnA3UYH81PzvpzKTHL8FIxJ9EU=", + "dev": true, + "requires": { + "ini": "^1.3.4" + } + }, + "globals": { + "version": "9.18.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-9.18.0.tgz", + "integrity": "sha512-S0nG3CLEQiY/ILxqtztTWH/3iRRdyBLw6KMDxnKMchrtbj2OFmehVh0WUCfW3DUrIgx/qFrJPICrq4Z4sTR9UQ==", + "dev": true + }, + "globby": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/globby/-/globby-8.0.1.tgz", + "integrity": "sha512-oMrYrJERnKBLXNLVTqhm3vPEdJ/b2ZE28xN4YARiix1NOIOBPEpOUnm844K1iu/BkphCaf2WNFwMszv8Soi1pw==", + "requires": { + "array-union": "^1.0.1", + "dir-glob": "^2.0.0", + "fast-glob": "^2.0.2", + "glob": "^7.1.2", + "ignore": "^3.3.5", + "pify": "^3.0.0", + "slash": "^1.0.0" + } + }, + "google-auth-library": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/google-auth-library/-/google-auth-library-2.0.1.tgz", + "integrity": "sha512-CWLKZxqYw4SE+fE3GWbVT9r/10h75w8lB3cdmmLpLtCfccFDcsI84qI5rx7npemlrHtKJh3C2HUz4s6SihCeIQ==", + "requires": { + "axios": "^0.18.0", + "gcp-metadata": "^0.7.0", + "gtoken": "^2.3.0", + "https-proxy-agent": "^2.2.1", + "jws": "^3.1.5", + "lodash.isstring": "^4.0.1", + "lru-cache": "^4.1.3", + "semver": "^5.5.0" + } + }, + "google-gax": { + "version": "0.20.0", + "resolved": "https://registry.npmjs.org/google-gax/-/google-gax-0.20.0.tgz", + "integrity": "sha512-JoaRCQtks60zuB3c5/5y60jG+xFBP67yYIgF6UuuDDVZtj/Z6kCKqjrGWNXEzFH2jolHZcvocST3JMwA/XClvA==", + "requires": { + "@grpc/grpc-js": "^0.2.0", + "@grpc/proto-loader": "^0.3.0", + "duplexify": "^3.6.0", + "extend": "^3.0.1", + "globby": "^8.0.1", + "google-auth-library": "^2.0.0", + "google-proto-files": "^0.16.0", + "grpc": "^1.12.2", + "is-stream-ended": "^0.1.4", + "lodash": "^4.17.10", + "protobufjs": "^6.8.8", + "retry-request": "^4.0.0", + "semver": "^5.5.1", + "through2": "^2.0.3" + } + }, + "google-p12-pem": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/google-p12-pem/-/google-p12-pem-1.0.2.tgz", + "integrity": "sha512-+EuKr4CLlGsnXx4XIJIVkcKYrsa2xkAmCvxRhX2HsazJzUBAJ35wARGeApHUn4nNfPD03Vl057FskNr20VaCyg==", + "requires": { + "node-forge": "^0.7.4", + "pify": "^3.0.0" + } + }, + "google-proto-files": { + "version": "0.16.1", + "resolved": "https://registry.npmjs.org/google-proto-files/-/google-proto-files-0.16.1.tgz", + "integrity": "sha512-ykdhaYDiU/jlyrkzZDPemraKwVIgLT31XMHVNSJW//R9VED56hqSDRMx1Jlxbf0O4iDZnBWQ0JQLHbM2r5+wuA==", + "requires": { + "globby": "^8.0.0", + "power-assert": "^1.4.4", + "protobufjs": "^6.8.0" + } + }, + "got": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/got/-/got-8.3.2.tgz", + "integrity": "sha512-qjUJ5U/hawxosMryILofZCkm3C84PLJS/0grRIpjAwu+Lkxxj5cxeCU25BG0/3mDSpXKTyZr8oh8wIgLaH0QCw==", + "dev": true, + "requires": { + "@sindresorhus/is": "^0.7.0", + "cacheable-request": "^2.1.1", + "decompress-response": "^3.3.0", + "duplexer3": "^0.1.4", + "get-stream": "^3.0.0", + "into-stream": "^3.1.0", + "is-retry-allowed": "^1.1.0", + "isurl": "^1.0.0-alpha5", + "lowercase-keys": "^1.0.0", + "mimic-response": "^1.0.0", + "p-cancelable": "^0.4.0", + "p-timeout": "^2.0.1", + "pify": "^3.0.0", + "safe-buffer": "^5.1.1", + "timed-out": "^4.0.1", + "url-parse-lax": "^3.0.0", + "url-to-options": "^1.0.1" + }, + "dependencies": { + "prepend-http": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/prepend-http/-/prepend-http-2.0.0.tgz", + "integrity": "sha1-6SQ0v6XqjBn0HN/UAddBo8gZ2Jc=", + "dev": true + }, + "url-parse-lax": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/url-parse-lax/-/url-parse-lax-3.0.0.tgz", + "integrity": "sha1-FrXK/Afb42dsGxmZF3gj1lA6yww=", + "dev": true, + "requires": { + "prepend-http": "^2.0.0" + } + } + } + }, + "graceful-fs": { + "version": "4.1.15", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.15.tgz", + "integrity": "sha512-6uHUhOPEBgQ24HM+r6b/QwWfZq+yiFcipKFrOFiBEnWdy5sdzYoi+pJeQaPI5qOLRFqWmAXUPQNsielzdLoecA==", + "dev": true + }, + "growl": { + "version": "1.10.5", + "resolved": "https://registry.npmjs.org/growl/-/growl-1.10.5.tgz", + "integrity": "sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA==", + "dev": true + }, + "grpc": { + "version": "1.16.0", + "resolved": "https://registry.npmjs.org/grpc/-/grpc-1.16.0.tgz", + "integrity": "sha512-+p8YRIng7Gihkn2jycAXwXdA9aQ10SikRrcHY+/r3W1Z1Pr9NFIbLcmBZPoaTbzzLDv/ysqwqFEZriAdd8tveQ==", + "requires": { + "lodash": "^4.17.5", + "nan": "^2.0.0", + "node-pre-gyp": "^0.10.0", + "protobufjs": "^5.0.3" + }, + "dependencies": { + "abbrev": { + "version": "1.1.1", + "bundled": true + }, + "ansi-regex": { + "version": "2.1.1", + "bundled": true + }, + "aproba": { + "version": "1.2.0", + "bundled": true + }, + "are-we-there-yet": { + "version": "1.1.5", + "bundled": true, + "requires": { + "delegates": "^1.0.0", + "readable-stream": "^2.0.6" + } + }, + "balanced-match": { + "version": "1.0.0", + "bundled": true + }, + "brace-expansion": { + "version": "1.1.11", + "bundled": true, + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "chownr": { + "version": "1.0.1", + "bundled": true + }, + "code-point-at": { + "version": "1.1.0", + "bundled": true + }, + "concat-map": { + "version": "0.0.1", + "bundled": true + }, + "console-control-strings": { + "version": "1.1.0", + "bundled": true + }, + "core-util-is": { + "version": "1.0.2", + "bundled": true + }, + "debug": { + "version": "2.6.9", + "bundled": true, + "requires": { + "ms": "2.0.0" + } + }, + "deep-extend": { + "version": "0.6.0", + "bundled": true + }, + "delegates": { + "version": "1.0.0", + "bundled": true + }, + "detect-libc": { + "version": "1.0.3", + "bundled": true + }, + "fs-minipass": { + "version": "1.2.5", + "bundled": true, + "requires": { + "minipass": "^2.2.1" + } + }, + "fs.realpath": { + "version": "1.0.0", + "bundled": true + }, + "gauge": { + "version": "2.7.4", + "bundled": true, + "requires": { + "aproba": "^1.0.3", + "console-control-strings": "^1.0.0", + "has-unicode": "^2.0.0", + "object-assign": "^4.1.0", + "signal-exit": "^3.0.0", + "string-width": "^1.0.1", + "strip-ansi": "^3.0.1", + "wide-align": "^1.1.0" + } + }, + "glob": { + "version": "7.1.2", + "bundled": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "has-unicode": { + "version": "2.0.1", + "bundled": true + }, + "iconv-lite": { + "version": "0.4.23", + "bundled": true, + "requires": { + "safer-buffer": ">= 2.1.2 < 3" + } + }, + "ignore-walk": { + "version": "3.0.1", + "bundled": true, + "requires": { + "minimatch": "^3.0.4" + } + }, + "inflight": { + "version": "1.0.6", + "bundled": true, + "requires": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "inherits": { + "version": "2.0.3", + "bundled": true + }, + "ini": { + "version": "1.3.5", + "bundled": true + }, + "is-fullwidth-code-point": { + "version": "1.0.0", + "bundled": true, + "requires": { + "number-is-nan": "^1.0.0" + } + }, + "isarray": { + "version": "1.0.0", + "bundled": true + }, + "minimatch": { + "version": "3.0.4", + "bundled": true, + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "minimist": { + "version": "1.2.0", + "bundled": true + }, + "minipass": { + "version": "2.3.3", + "bundled": true, + "requires": { + "safe-buffer": "^5.1.2", + "yallist": "^3.0.0" + } + }, + "minizlib": { + "version": "1.1.0", + "bundled": true, + "requires": { + "minipass": "^2.2.1" + } + }, + "mkdirp": { + "version": "0.5.1", + "bundled": true, + "requires": { + "minimist": "0.0.8" + }, + "dependencies": { + "minimist": { + "version": "0.0.8", + "bundled": true + } + } + }, + "ms": { + "version": "2.0.0", + "bundled": true + }, + "needle": { + "version": "2.2.2", + "bundled": true, + "requires": { + "debug": "^2.1.2", + "iconv-lite": "^0.4.4", + "sax": "^1.2.4" + } + }, + "node-pre-gyp": { + "version": "0.10.3", + "bundled": true, + "requires": { + "detect-libc": "^1.0.2", + "mkdirp": "^0.5.1", + "needle": "^2.2.1", + "nopt": "^4.0.1", + "npm-packlist": "^1.1.6", + "npmlog": "^4.0.2", + "rc": "^1.2.7", + "rimraf": "^2.6.1", + "semver": "^5.3.0", + "tar": "^4" + } + }, + "nopt": { + "version": "4.0.1", + "bundled": true, + "requires": { + "abbrev": "1", + "osenv": "^0.1.4" + } + }, + "npm-bundled": { + "version": "1.0.3", + "bundled": true + }, + "npm-packlist": { + "version": "1.1.11", + "bundled": true, + "requires": { + "ignore-walk": "^3.0.1", + "npm-bundled": "^1.0.1" + } + }, + "npmlog": { + "version": "4.1.2", + "bundled": true, + "requires": { + "are-we-there-yet": "~1.1.2", + "console-control-strings": "~1.1.0", + "gauge": "~2.7.3", + "set-blocking": "~2.0.0" + } + }, + "number-is-nan": { + "version": "1.0.1", + "bundled": true + }, + "object-assign": { + "version": "4.1.1", + "bundled": true + }, + "once": { + "version": "1.4.0", + "bundled": true, + "requires": { + "wrappy": "1" + } + }, + "os-homedir": { + "version": "1.0.2", + "bundled": true + }, + "os-tmpdir": { + "version": "1.0.2", + "bundled": true + }, + "osenv": { + "version": "0.1.5", + "bundled": true, + "requires": { + "os-homedir": "^1.0.0", + "os-tmpdir": "^1.0.0" + } + }, + "path-is-absolute": { + "version": "1.0.1", + "bundled": true + }, + "process-nextick-args": { + "version": "2.0.0", + "bundled": true + }, + "protobufjs": { + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-5.0.3.tgz", + "integrity": "sha512-55Kcx1MhPZX0zTbVosMQEO5R6/rikNXd9b6RQK4KSPcrSIIwoXTtebIczUrXlwaSrbz4x8XUVThGPob1n8I4QA==", + "requires": { + "ascli": "~1", + "bytebuffer": "~5", + "glob": "^7.0.5", + "yargs": "^3.10.0" + } + }, + "rc": { + "version": "1.2.8", + "bundled": true, + "requires": { + "deep-extend": "^0.6.0", + "ini": "~1.3.0", + "minimist": "^1.2.0", + "strip-json-comments": "~2.0.1" + } + }, + "readable-stream": { + "version": "2.3.6", + "bundled": true, + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "rimraf": { + "version": "2.6.2", + "bundled": true, + "requires": { + "glob": "^7.0.5" + } + }, + "safe-buffer": { + "version": "5.1.2", + "bundled": true + }, + "safer-buffer": { + "version": "2.1.2", + "bundled": true + }, + "sax": { + "version": "1.2.4", + "bundled": true + }, + "semver": { + "version": "5.5.0", + "bundled": true + }, + "set-blocking": { + "version": "2.0.0", + "bundled": true + }, + "signal-exit": { + "version": "3.0.2", + "bundled": true + }, + "string-width": { + "version": "1.0.2", + "bundled": true, + "requires": { + "code-point-at": "^1.0.0", + "is-fullwidth-code-point": "^1.0.0", + "strip-ansi": "^3.0.0" + } + }, + "string_decoder": { + "version": "1.1.1", + "bundled": true, + "requires": { + "safe-buffer": "~5.1.0" + } + }, + "strip-ansi": { + "version": "3.0.1", + "bundled": true, + "requires": { + "ansi-regex": "^2.0.0" + } + }, + "strip-json-comments": { + "version": "2.0.1", + "bundled": true + }, + "tar": { + "version": "4.4.6", + "bundled": true, + "requires": { + "chownr": "^1.0.1", + "fs-minipass": "^1.2.5", + "minipass": "^2.3.3", + "minizlib": "^1.1.0", + "mkdirp": "^0.5.0", + "safe-buffer": "^5.1.2", + "yallist": "^3.0.2" + } + }, + "util-deprecate": { + "version": "1.0.2", + "bundled": true + }, + "wide-align": { + "version": "1.1.3", + "bundled": true, + "requires": { + "string-width": "^1.0.2 || 2" + } + }, + "wrappy": { + "version": "1.0.2", + "bundled": true + }, + "yallist": { + "version": "3.0.2", + "bundled": true + } + } + }, + "gtoken": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/gtoken/-/gtoken-2.3.0.tgz", + "integrity": "sha512-Jc9/8mV630cZE9FC5tIlJCZNdUjwunvlwOtCz6IDlaiB4Sz68ki29a1+q97sWTnTYroiuF9B135rod9zrQdHLw==", + "requires": { + "axios": "^0.18.0", + "google-p12-pem": "^1.0.0", + "jws": "^3.1.4", + "mime": "^2.2.0", + "pify": "^3.0.0" + } + }, + "handlebars": { + "version": "4.0.11", + "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.0.11.tgz", + "integrity": "sha1-Ywo13+ApS8KB7a5v/F0yn8eYLcw=", + "dev": true, + "requires": { + "async": "^1.4.0", + "optimist": "^0.6.1", + "source-map": "^0.4.4", + "uglify-js": "^2.6" + }, + "dependencies": { + "source-map": { + "version": "0.4.4", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.4.4.tgz", + "integrity": "sha1-66T12pwNyZneaAMti092FzZSA2s=", + "dev": true, + "requires": { + "amdefine": ">=0.0.4" + } + } + } + }, + "har-schema": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", + "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=", + "dev": true + }, + "har-validator": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.0.tgz", + "integrity": "sha512-+qnmNjI4OfH2ipQ9VQOw23bBd/ibtfbVdK2fYbY4acTDqKTW/YDp9McimZdDbG8iV9fZizUqQMD5xvriB146TA==", + "dev": true, + "requires": { + "ajv": "^5.3.0", + "har-schema": "^2.0.0" + } + }, + "has-ansi": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", + "integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=", + "dev": true, + "requires": { + "ansi-regex": "^2.0.0" + } + }, + "has-color": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/has-color/-/has-color-0.1.7.tgz", + "integrity": "sha1-ZxRKUmDDT8PMpnfQQdr1L+e3iy8=", + "dev": true + }, + "has-flag": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz", + "integrity": "sha1-6CB68cx7MNRGzHC3NLXovhj4jVE=", + "dev": true + }, + "has-symbol-support-x": { + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/has-symbol-support-x/-/has-symbol-support-x-1.4.2.tgz", + "integrity": "sha512-3ToOva++HaW+eCpgqZrCfN51IPB+7bJNVT6CUATzueB5Heb8o6Nam0V3HG5dlDvZU1Gn5QLcbahiKw/XVk5JJw==", + "dev": true + }, + "has-to-string-tag-x": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/has-to-string-tag-x/-/has-to-string-tag-x-1.4.1.tgz", + "integrity": "sha512-vdbKfmw+3LoOYVr+mtxHaX5a96+0f3DljYd8JOqvOLsf5mw2Otda2qCDT9qRqLAhrjyQ0h7ual5nOiASpsGNFw==", + "dev": true, + "requires": { + "has-symbol-support-x": "^1.4.1" + } + }, + "has-value": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-value/-/has-value-1.0.0.tgz", + "integrity": "sha1-GLKB2lhbHFxR3vJMkw7SmgvmsXc=", + "requires": { + "get-value": "^2.0.6", + "has-values": "^1.0.0", + "isobject": "^3.0.0" + } + }, + "has-values": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-values/-/has-values-1.0.0.tgz", + "integrity": "sha1-lbC2P+whRmGab+V/51Yo1aOe/k8=", + "requires": { + "is-number": "^3.0.0", + "kind-of": "^4.0.0" + }, + "dependencies": { + "kind-of": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz", + "integrity": "sha1-IIE989cSkosgc3hpGkUGb65y3Vc=", + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "has-yarn": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-yarn/-/has-yarn-1.0.0.tgz", + "integrity": "sha1-ieJdtgS3Jcj1l2//Ct3JIbgopac=", + "dev": true + }, + "he": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/he/-/he-1.1.1.tgz", + "integrity": "sha1-k0EP0hsAlzUVH4howvJx80J+I/0=", + "dev": true + }, + "home-or-tmp": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/home-or-tmp/-/home-or-tmp-2.0.0.tgz", + "integrity": "sha1-42w/LSyufXRqhX440Y1fMqeILbg=", + "dev": true, + "requires": { + "os-homedir": "^1.0.0", + "os-tmpdir": "^1.0.1" + } + }, + "hosted-git-info": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.7.1.tgz", + "integrity": "sha512-7T/BxH19zbcCTa8XkMlbK5lTo1WtgkFi3GvdWEyNuc4Vex7/9Dqbnpsf4JMydcfj9HCg4zUWFTL3Za6lapg5/w==", + "dev": true + }, + "htmlparser2": { + "version": "3.10.0", + "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-3.10.0.tgz", + "integrity": "sha512-J1nEUGv+MkXS0weHNWVKJJ+UrLfePxRWpN3C9bEi9fLxL2+ggW94DQvgYVXsaT30PGwYRIZKNZXuyMhp3Di4bQ==", + "dev": true, + "requires": { + "domelementtype": "^1.3.0", + "domhandler": "^2.3.0", + "domutils": "^1.5.1", + "entities": "^1.1.1", + "inherits": "^2.0.1", + "readable-stream": "^3.0.6" + }, + "dependencies": { + "readable-stream": { + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.0.6.tgz", + "integrity": "sha512-9E1oLoOWfhSXHGv6QlwXJim7uNzd9EVlWK+21tCU9Ju/kR0/p2AZYPz4qSchgO8PlLIH4FpZYfzwS+rEksZjIg==", + "dev": true, + "requires": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + } + } + } + }, + "http-cache-semantics": { + "version": "3.8.1", + "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-3.8.1.tgz", + "integrity": "sha512-5ai2iksyV8ZXmnZhHH4rWPoxxistEexSi5936zIQ1bnNTW5VnA85B6P/VpXiRM017IgRvb2kKo1a//y+0wSp3w==", + "dev": true + }, + "http-signature": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", + "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", + "dev": true, + "requires": { + "assert-plus": "^1.0.0", + "jsprim": "^1.2.2", + "sshpk": "^1.7.0" + } + }, + "https-proxy-agent": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-2.2.1.tgz", + "integrity": "sha512-HPCTS1LW51bcyMYbxUIOO4HEOlQ1/1qRaFWcyxvwaqUS9TY88aoEuHUY33kuAh1YhVVaDQhLZsnPd+XNARWZlQ==", + "requires": { + "agent-base": "^4.1.0", + "debug": "^3.1.0" + }, + "dependencies": { + "debug": { + "version": "3.2.6", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", + "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", + "requires": { + "ms": "^2.1.1" + } + }, + "ms": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", + "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==" + } + } + }, + "hullabaloo-config-manager": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/hullabaloo-config-manager/-/hullabaloo-config-manager-1.1.1.tgz", + "integrity": "sha512-ztKnkZV0TmxnumCDHHgLGNiDnotu4EHCp9YMkznWuo4uTtCyJ+cu+RNcxUeXYKTllpvLFWnbfWry09yzszgg+A==", + "dev": true, + "requires": { + "dot-prop": "^4.1.0", + "es6-error": "^4.0.2", + "graceful-fs": "^4.1.11", + "indent-string": "^3.1.0", + "json5": "^0.5.1", + "lodash.clonedeep": "^4.5.0", + "lodash.clonedeepwith": "^4.5.0", + "lodash.isequal": "^4.5.0", + "lodash.merge": "^4.6.0", + "md5-hex": "^2.0.0", + "package-hash": "^2.0.0", + "pkg-dir": "^2.0.0", + "resolve-from": "^3.0.0", + "safe-buffer": "^5.0.1" + } + }, + "iconv-lite": { + "version": "0.4.24", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "dev": true, + "requires": { + "safer-buffer": ">= 2.1.2 < 3" + } + }, + "ignore": { + "version": "3.3.10", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-3.3.10.tgz", + "integrity": "sha512-Pgs951kaMm5GXP7MOvxERINe3gsaVjUWFm+UZPSq9xYriQAksyhg0csnS0KXSNRD5NmNdapXEpjxG49+AKh/ug==" + }, + "ignore-by-default": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/ignore-by-default/-/ignore-by-default-1.0.1.tgz", + "integrity": "sha1-SMptcvbGo68Aqa1K5odr44ieKwk=", + "dev": true + }, + "ignore-walk": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/ignore-walk/-/ignore-walk-3.0.1.tgz", + "integrity": "sha512-DTVlMx3IYPe0/JJcYP7Gxg7ttZZu3IInhuEhbchuqneY9wWe5Ojy2mXLBaQFUQmo0AW2r3qG7m1mg86js+gnlQ==", + "dev": true, + "requires": { + "minimatch": "^3.0.4" + } + }, + "import-lazy": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/import-lazy/-/import-lazy-2.1.0.tgz", + "integrity": "sha1-BWmOPUXIjo1+nZLLBYTnfwlvPkM=", + "dev": true + }, + "import-local": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/import-local/-/import-local-0.1.1.tgz", + "integrity": "sha1-sReVcqrNwRxqkQCftDDbyrX2aKg=", + "dev": true, + "requires": { + "pkg-dir": "^2.0.0", + "resolve-cwd": "^2.0.0" + } + }, + "imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", + "dev": true + }, + "indent-string": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-3.2.0.tgz", + "integrity": "sha1-Sl/W0nzDMvN+VBmlBNu4NxBckok=", + "dev": true + }, + "indexof": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/indexof/-/indexof-0.0.1.tgz", + "integrity": "sha1-gtwzbSMrkGIXnQWrMpOmYFn9Q10=" + }, + "inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "requires": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "inherits": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" + }, + "ini": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.5.tgz", + "integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==", + "dev": true + }, + "ink-docstrap": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/ink-docstrap/-/ink-docstrap-1.3.2.tgz", + "integrity": "sha512-STx5orGQU1gfrkoI/fMU7lX6CSP7LBGO10gXNgOZhwKhUqbtNjCkYSewJtNnLmWP1tAGN6oyEpG1HFPw5vpa5Q==", + "dev": true, + "requires": { + "moment": "^2.14.1", + "sanitize-html": "^1.13.0" + } + }, + "inquirer": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-6.2.0.tgz", + "integrity": "sha512-QIEQG4YyQ2UYZGDC4srMZ7BjHOmNk1lR2JQj5UknBapklm6WHA+VVH7N+sUdX3A7NeCfGF8o4X1S3Ao7nAcIeg==", + "dev": true, + "requires": { + "ansi-escapes": "^3.0.0", + "chalk": "^2.0.0", + "cli-cursor": "^2.1.0", + "cli-width": "^2.0.0", + "external-editor": "^3.0.0", + "figures": "^2.0.0", + "lodash": "^4.17.10", + "mute-stream": "0.0.7", + "run-async": "^2.2.0", + "rxjs": "^6.1.0", + "string-width": "^2.1.0", + "strip-ansi": "^4.0.0", + "through": "^2.3.6" + }, + "dependencies": { + "ansi-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true + }, + "string-width": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", + "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "dev": true, + "requires": { + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^4.0.0" + } + }, + "strip-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "dev": true, + "requires": { + "ansi-regex": "^3.0.0" + } + } + } + }, + "intelli-espower-loader": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/intelli-espower-loader/-/intelli-espower-loader-1.0.1.tgz", + "integrity": "sha1-LHsDFGvB1GvyENCgOXxckatMorA=", + "dev": true, + "requires": { + "espower-loader": "^1.0.0" + } + }, + "into-stream": { + "version": "3.1.0", + "resolved": "http://registry.npmjs.org/into-stream/-/into-stream-3.1.0.tgz", + "integrity": "sha1-lvsKk2wSur1v8XUqF9BWFqvQlMY=", + "dev": true, + "requires": { + "from2": "^2.1.1", + "p-is-promise": "^1.1.0" + } + }, + "invariant": { + "version": "2.2.4", + "resolved": "https://registry.npmjs.org/invariant/-/invariant-2.2.4.tgz", + "integrity": "sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA==", + "dev": true, + "requires": { + "loose-envify": "^1.0.0" + } + }, + "invert-kv": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-1.0.0.tgz", + "integrity": "sha1-EEqOSqym09jNFXqO+L+rLXo//bY=" + }, + "irregular-plurals": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/irregular-plurals/-/irregular-plurals-1.4.0.tgz", + "integrity": "sha1-LKmwM2UREYVUEvFr5dd8YqRYp2Y=", + "dev": true + }, + "is-accessor-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", + "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "is-arrayish": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", + "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=", + "dev": true + }, + "is-binary-path": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-1.0.1.tgz", + "integrity": "sha1-dfFmQrSA8YenEcgUFh/TpKdlWJg=", + "dev": true, + "requires": { + "binary-extensions": "^1.0.0" + } + }, + "is-buffer": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==" + }, + "is-builtin-module": { + "version": "1.0.0", + "resolved": "http://registry.npmjs.org/is-builtin-module/-/is-builtin-module-1.0.0.tgz", + "integrity": "sha1-VAVy0096wxGfj3bDDLwbHgN6/74=", + "dev": true, + "requires": { + "builtin-modules": "^1.0.0" + } + }, + "is-ci": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/is-ci/-/is-ci-1.2.1.tgz", + "integrity": "sha512-s6tfsaQaQi3JNciBH6shVqEDvhGut0SUXr31ag8Pd8BBbVVlcGfWhpPmEOoM6RJ5TFhbypvf5yyRw/VXW1IiWg==", + "dev": true, + "requires": { + "ci-info": "^1.5.0" + } + }, + "is-data-descriptor": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", + "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "is-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", + "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", + "requires": { + "is-accessor-descriptor": "^0.1.6", + "is-data-descriptor": "^0.1.4", + "kind-of": "^5.0.0" + }, + "dependencies": { + "kind-of": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", + "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==" + } + } + }, + "is-dotfile": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/is-dotfile/-/is-dotfile-1.0.3.tgz", + "integrity": "sha1-pqLzL/0t+wT1yiXs0Pa4PPeYoeE=", + "dev": true + }, + "is-equal-shallow": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/is-equal-shallow/-/is-equal-shallow-0.1.3.tgz", + "integrity": "sha1-IjgJj8Ih3gvPpdnqxMRdY4qhxTQ=", + "dev": true, + "requires": { + "is-primitive": "^2.0.0" + } + }, + "is-error": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/is-error/-/is-error-2.2.1.tgz", + "integrity": "sha1-aEqW2EB2V3yY9M20DG0mpRI78Zw=", + "dev": true + }, + "is-extendable": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", + "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=" + }, + "is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=" + }, + "is-finite": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-finite/-/is-finite-1.0.2.tgz", + "integrity": "sha1-zGZ3aVYCvlUO8R6LSqYwU0K20Ko=", + "dev": true, + "requires": { + "number-is-nan": "^1.0.0" + } + }, + "is-fullwidth-code-point": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", + "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", + "requires": { + "number-is-nan": "^1.0.0" + } + }, + "is-generator-fn": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-generator-fn/-/is-generator-fn-1.0.0.tgz", + "integrity": "sha1-lp1J4bszKfa7fwkIm+JleLLd1Go=", + "dev": true + }, + "is-glob": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.0.tgz", + "integrity": "sha1-lSHHaEXMJhCoUgPd8ICpWML/q8A=", + "requires": { + "is-extglob": "^2.1.1" + } + }, + "is-installed-globally": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/is-installed-globally/-/is-installed-globally-0.1.0.tgz", + "integrity": "sha1-Df2Y9akRFxbdU13aZJL2e/PSWoA=", + "dev": true, + "requires": { + "global-dirs": "^0.1.0", + "is-path-inside": "^1.0.0" + } + }, + "is-npm": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-npm/-/is-npm-1.0.0.tgz", + "integrity": "sha1-8vtjpl5JBbQGyGBydloaTceTufQ=", + "dev": true + }, + "is-number": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", + "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "is-obj": { + "version": "1.0.1", + "resolved": "http://registry.npmjs.org/is-obj/-/is-obj-1.0.1.tgz", + "integrity": "sha1-PkcprB9f3gJc19g6iW2rn09n2w8=", + "dev": true + }, + "is-object": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-object/-/is-object-1.0.1.tgz", + "integrity": "sha1-iVJojF7C/9awPsyF52ngKQMINHA=", + "dev": true + }, + "is-observable": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-observable/-/is-observable-1.1.0.tgz", + "integrity": "sha512-NqCa4Sa2d+u7BWc6CukaObG3Fh+CU9bvixbpcXYhy2VvYS7vVGIdAgnIS5Ks3A/cqk4rebLJ9s8zBstT2aKnIA==", + "dev": true, + "requires": { + "symbol-observable": "^1.1.0" + } + }, + "is-path-cwd": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-path-cwd/-/is-path-cwd-1.0.0.tgz", + "integrity": "sha1-0iXsIxMuie3Tj9p2dHLmLmXxEG0=", + "dev": true + }, + "is-path-in-cwd": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-path-in-cwd/-/is-path-in-cwd-1.0.1.tgz", + "integrity": "sha512-FjV1RTW48E7CWM7eE/J2NJvAEEVektecDBVBE5Hh3nM1Jd0kvhHtX68Pr3xsDf857xt3Y4AkwVULK1Vku62aaQ==", + "dev": true, + "requires": { + "is-path-inside": "^1.0.0" + } + }, + "is-path-inside": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-1.0.1.tgz", + "integrity": "sha1-jvW33lBDej/cprToZe96pVy0gDY=", + "dev": true, + "requires": { + "path-is-inside": "^1.0.1" + } + }, + "is-plain-obj": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz", + "integrity": "sha1-caUMhCnfync8kqOQpKA7OfzVHT4=", + "dev": true + }, + "is-plain-object": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", + "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", + "requires": { + "isobject": "^3.0.1" + } + }, + "is-posix-bracket": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/is-posix-bracket/-/is-posix-bracket-0.1.1.tgz", + "integrity": "sha1-MzTceXdDaOkvAW5vvAqI9c1ua8Q=", + "dev": true + }, + "is-primitive": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-primitive/-/is-primitive-2.0.0.tgz", + "integrity": "sha1-IHurkWOEmcB7Kt8kCkGochADRXU=", + "dev": true + }, + "is-promise": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-2.1.0.tgz", + "integrity": "sha1-eaKp7OfwlugPNtKy87wWwf9L8/o=", + "dev": true + }, + "is-redirect": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-redirect/-/is-redirect-1.0.0.tgz", + "integrity": "sha1-HQPd7VO9jbDzDCbk+V02/HyH3CQ=", + "dev": true + }, + "is-resolvable": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-resolvable/-/is-resolvable-1.1.0.tgz", + "integrity": "sha512-qgDYXFSR5WvEfuS5dMj6oTMEbrrSaM0CrFk2Yiq/gXnBvD9pMa2jGXxyhGLfvhZpuMZe18CJpFxAt3CRs42NMg==", + "dev": true + }, + "is-retry-allowed": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-retry-allowed/-/is-retry-allowed-1.1.0.tgz", + "integrity": "sha1-EaBgVotnM5REAz0BJaYaINVk+zQ=", + "dev": true + }, + "is-stream": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", + "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=", + "dev": true + }, + "is-stream-ended": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/is-stream-ended/-/is-stream-ended-0.1.4.tgz", + "integrity": "sha512-xj0XPvmr7bQFTvirqnFr50o0hQIh6ZItDqloxt5aJrR4NQsYeSsyFQERYGCAzfindAcnKjINnwEEgLx4IqVzQw==" + }, + "is-typedarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", + "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=", + "dev": true + }, + "is-url": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/is-url/-/is-url-1.2.4.tgz", + "integrity": "sha512-ITvGim8FhRiYe4IQ5uHSkj7pVaPDrCTkNd3yq3cV7iZAcJdHTUMPMEHcqSOy9xZ9qFenQCvi+2wjH9a1nXqHww==", + "dev": true + }, + "is-utf8": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-utf8/-/is-utf8-0.2.1.tgz", + "integrity": "sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI=", + "dev": true + }, + "is-windows": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", + "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==" + }, + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" + }, + "isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", + "dev": true + }, + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=" + }, + "isstream": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", + "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=", + "dev": true + }, + "istanbul-lib-coverage": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.1.tgz", + "integrity": "sha512-nPvSZsVlbG9aLhZYaC3Oi1gT/tpyo3Yt5fNyf6NmcKIayz4VV/txxJFFKAK/gU4dcNn8ehsanBbVHVl0+amOLA==", + "dev": true + }, + "istanbul-lib-instrument": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-3.0.0.tgz", + "integrity": "sha512-eQY9vN9elYjdgN9Iv6NS/00bptm02EBBk70lRMaVjeA6QYocQgenVrSgC28TJurdnZa80AGO3ASdFN+w/njGiQ==", + "dev": true, + "requires": { + "@babel/generator": "^7.0.0", + "@babel/parser": "^7.0.0", + "@babel/template": "^7.0.0", + "@babel/traverse": "^7.0.0", + "@babel/types": "^7.0.0", + "istanbul-lib-coverage": "^2.0.1", + "semver": "^5.5.0" + } + }, + "isurl": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isurl/-/isurl-1.0.0.tgz", + "integrity": "sha512-1P/yWsxPlDtn7QeRD+ULKQPaIaN6yF368GZ2vDfv0AL0NwpStafjWCDDdn0k8wgFMWpVAqG7oJhxHnlud42i9w==", + "dev": true, + "requires": { + "has-to-string-tag-x": "^1.2.0", + "is-object": "^1.0.1" + } + }, + "js-string-escape": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/js-string-escape/-/js-string-escape-1.0.1.tgz", + "integrity": "sha1-4mJbrbwNZ8dTPp7cEGjFh65BN+8=", + "dev": true + }, + "js-tokens": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-3.0.2.tgz", + "integrity": "sha1-mGbfOVECEw449/mWvOtlRDIJwls=", + "dev": true + }, + "js-yaml": { + "version": "3.12.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.12.0.tgz", + "integrity": "sha512-PIt2cnwmPfL4hKNwqeiuz4bKfnzHTBv6HyVgjahA6mPLwPDzjDWrplJBMjHUFxku/N3FlmrbyPclad+I+4mJ3A==", + "dev": true, + "requires": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + } + }, + "js2xmlparser": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/js2xmlparser/-/js2xmlparser-3.0.0.tgz", + "integrity": "sha1-P7YOqgicVED5MZ9RdgzNB+JJlzM=", + "dev": true, + "requires": { + "xmlcreate": "^1.0.1" + } + }, + "jsbn": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", + "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=", + "dev": true + }, + "jsdoc": { + "version": "3.5.5", + "resolved": "https://registry.npmjs.org/jsdoc/-/jsdoc-3.5.5.tgz", + "integrity": "sha512-6PxB65TAU4WO0Wzyr/4/YhlGovXl0EVYfpKbpSroSj0qBxT4/xod/l40Opkm38dRHRdQgdeY836M0uVnJQG7kg==", + "dev": true, + "requires": { + "babylon": "7.0.0-beta.19", + "bluebird": "~3.5.0", + "catharsis": "~0.8.9", + "escape-string-regexp": "~1.0.5", + "js2xmlparser": "~3.0.0", + "klaw": "~2.0.0", + "marked": "~0.3.6", + "mkdirp": "~0.5.1", + "requizzle": "~0.2.1", + "strip-json-comments": "~2.0.1", + "taffydb": "2.6.2", + "underscore": "~1.8.3" + }, + "dependencies": { + "babylon": { + "version": "7.0.0-beta.19", + "resolved": "https://registry.npmjs.org/babylon/-/babylon-7.0.0-beta.19.tgz", + "integrity": "sha512-Vg0C9s/REX6/WIXN37UKpv5ZhRi6A4pjHlpkE34+8/a6c2W1Q692n3hmc+SZG5lKRnaExLUbxtJ1SVT+KaCQ/A==", + "dev": true + } + } + }, + "jsesc": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz", + "integrity": "sha1-597mbjXW/Bb3EP6R1c9p9w8IkR0=", + "dev": true + }, + "json-buffer": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.0.tgz", + "integrity": "sha1-Wx85evx11ne96Lz8Dkfh+aPZqJg=", + "dev": true + }, + "json-parse-better-errors": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz", + "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==", + "dev": true + }, + "json-schema": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz", + "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=", + "dev": true + }, + "json-schema-traverse": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.3.1.tgz", + "integrity": "sha1-NJptRMU6Ud6JtAgFxdXlm0F9M0A=", + "dev": true + }, + "json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", + "dev": true + }, + "json-stringify-safe": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", + "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=", + "dev": true + }, + "json5": { + "version": "0.5.1", + "resolved": "http://registry.npmjs.org/json5/-/json5-0.5.1.tgz", + "integrity": "sha1-Hq3nrMASA0rYTiOWdn6tn6VJWCE=", + "dev": true + }, + "jsonfile": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", + "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.6" + } + }, + "jsprim": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz", + "integrity": "sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=", + "dev": true, + "requires": { + "assert-plus": "1.0.0", + "extsprintf": "1.3.0", + "json-schema": "0.2.3", + "verror": "1.10.0" + } + }, + "just-extend": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/just-extend/-/just-extend-3.0.0.tgz", + "integrity": "sha512-Fu3T6pKBuxjWT/p4DkqGHFRsysc8OauWr4ZRTY9dIx07Y9O0RkoR5jcv28aeD1vuAwhm3nLkDurwLXoALp4DpQ==", + "dev": true + }, + "jwa": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/jwa/-/jwa-1.1.6.tgz", + "integrity": "sha512-tBO/cf++BUsJkYql/kBbJroKOgHWEigTKBAjjBEmrMGYd1QMBC74Hr4Wo2zCZw6ZrVhlJPvoMrkcOnlWR/DJfw==", + "requires": { + "buffer-equal-constant-time": "1.0.1", + "ecdsa-sig-formatter": "1.0.10", + "safe-buffer": "^5.0.1" + } + }, + "jws": { + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/jws/-/jws-3.1.5.tgz", + "integrity": "sha512-GsCSexFADNQUr8T5HPJvayTjvPIfoyJPtLQBwn5a4WZQchcrPMPMAWcC1AzJVRDKyD6ZPROPAxgv6rfHViO4uQ==", + "requires": { + "jwa": "^1.1.5", + "safe-buffer": "^5.0.1" + } + }, + "keyv": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/keyv/-/keyv-3.0.0.tgz", + "integrity": "sha512-eguHnq22OE3uVoSYG0LVWNP+4ppamWr9+zWBe1bsNcovIMy6huUJFPgy4mGwCd/rnl3vOLGW1MTlu4c57CT1xA==", + "dev": true, + "requires": { + "json-buffer": "3.0.0" + } + }, + "kind-of": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", + "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==" + }, + "klaw": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/klaw/-/klaw-2.0.0.tgz", + "integrity": "sha1-WcEo4Nxc5BAgEVEZTuucv4WGUPY=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.9" + } + }, + "last-line-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/last-line-stream/-/last-line-stream-1.0.0.tgz", + "integrity": "sha1-0bZNafhv8kry0EiDos7uFFIKVgA=", + "dev": true, + "requires": { + "through2": "^2.0.0" + } + }, + "latest-version": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/latest-version/-/latest-version-3.1.0.tgz", + "integrity": "sha1-ogU4P+oyKzO1rjsYq+4NwvNW7hU=", + "dev": true, + "requires": { + "package-json": "^4.0.0" + } + }, + "lazy-cache": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/lazy-cache/-/lazy-cache-1.0.4.tgz", + "integrity": "sha1-odePw6UEdMuAhF07O24dpJpEbo4=", + "dev": true, + "optional": true + }, + "lcid": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/lcid/-/lcid-1.0.0.tgz", + "integrity": "sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU=", + "requires": { + "invert-kv": "^1.0.0" + } + }, + "levn": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", + "integrity": "sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4=", + "dev": true, + "requires": { + "prelude-ls": "~1.1.2", + "type-check": "~0.3.2" + } + }, + "load-json-file": { + "version": "2.0.0", + "resolved": "http://registry.npmjs.org/load-json-file/-/load-json-file-2.0.0.tgz", + "integrity": "sha1-eUfkIUmvgNaWy/eXvKq8/h/inKg=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "parse-json": "^2.2.0", + "pify": "^2.0.0", + "strip-bom": "^3.0.0" + }, + "dependencies": { + "pify": { + "version": "2.3.0", + "resolved": "http://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", + "dev": true + } + } + }, + "locate-path": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", + "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", + "dev": true, + "requires": { + "p-locate": "^2.0.0", + "path-exists": "^3.0.0" + } + }, + "lodash": { + "version": "4.17.11", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz", + "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==" + }, + "lodash.clonedeep": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz", + "integrity": "sha1-4j8/nE+Pvd6HJSnBBxhXoIblzO8=", + "dev": true + }, + "lodash.clonedeepwith": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/lodash.clonedeepwith/-/lodash.clonedeepwith-4.5.0.tgz", + "integrity": "sha1-buMFc6A6GmDWcKYu8zwQzxr9vdQ=", + "dev": true + }, + "lodash.debounce": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/lodash.debounce/-/lodash.debounce-4.0.8.tgz", + "integrity": "sha1-gteb/zCmfEAF/9XiUVMArZyk168=", + "dev": true + }, + "lodash.deburr": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/lodash.deburr/-/lodash.deburr-4.1.0.tgz", + "integrity": "sha1-3bG7s+8HRYwBd7oH3hRCLLAz/5s=", + "dev": true + }, + "lodash.difference": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/lodash.difference/-/lodash.difference-4.5.0.tgz", + "integrity": "sha1-nMtOUF1Ia5FlE0V3KIWi3yf9AXw=", + "dev": true + }, + "lodash.escaperegexp": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/lodash.escaperegexp/-/lodash.escaperegexp-4.1.2.tgz", + "integrity": "sha1-ZHYsSGGAglGKw99Mz11YhtriA0c=", + "dev": true + }, + "lodash.flatten": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/lodash.flatten/-/lodash.flatten-4.4.0.tgz", + "integrity": "sha1-8xwiIlqWMtK7+OSt2+8kCqdlph8=", + "dev": true + }, + "lodash.flattendeep": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/lodash.flattendeep/-/lodash.flattendeep-4.4.0.tgz", + "integrity": "sha1-+wMJF/hqMTTlvJvsDWngAT3f7bI=", + "dev": true + }, + "lodash.get": { + "version": "4.4.2", + "resolved": "https://registry.npmjs.org/lodash.get/-/lodash.get-4.4.2.tgz", + "integrity": "sha1-LRd/ZS+jHpObRDjVNBSZ36OCXpk=", + "dev": true + }, + "lodash.isequal": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/lodash.isequal/-/lodash.isequal-4.5.0.tgz", + "integrity": "sha1-QVxEePK8wwEgwizhDtMib30+GOA=", + "dev": true + }, + "lodash.isplainobject": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz", + "integrity": "sha1-fFJqUtibRcRcxpC4gWO+BJf1UMs=", + "dev": true + }, + "lodash.isstring": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/lodash.isstring/-/lodash.isstring-4.0.1.tgz", + "integrity": "sha1-1SfftUVuynzJu5XV2ur4i6VKVFE=" + }, + "lodash.merge": { + "version": "4.6.1", + "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.1.tgz", + "integrity": "sha512-AOYza4+Hf5z1/0Hztxpm2/xiPZgi/cjMqdnKTUWTBSKchJlxXXuUSxCCl8rJlf4g6yww/j6mA8nC8Hw/EZWxKQ==" + }, + "lodash.mergewith": { + "version": "4.6.1", + "resolved": "https://registry.npmjs.org/lodash.mergewith/-/lodash.mergewith-4.6.1.tgz", + "integrity": "sha512-eWw5r+PYICtEBgrBE5hhlT6aAa75f411bgDz/ZL2KZqYV03USvucsxcHUIlGTDTECs1eunpI7HOV7U+WLDvNdQ==", + "dev": true + }, + "lolex": { + "version": "2.7.5", + "resolved": "https://registry.npmjs.org/lolex/-/lolex-2.7.5.tgz", + "integrity": "sha512-l9x0+1offnKKIzYVjyXU2SiwhXDLekRzKyhnbyldPHvC7BvLPVpdNUNR2KeMAiCN2D/kLNttZgQD5WjSxuBx3Q==", + "dev": true + }, + "long": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/long/-/long-4.0.0.tgz", + "integrity": "sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA==" + }, + "longest": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/longest/-/longest-1.0.1.tgz", + "integrity": "sha1-MKCy2jj3N3DoKUoNIuZiXtd9AJc=", + "dev": true + }, + "loose-envify": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", + "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", + "dev": true, + "requires": { + "js-tokens": "^3.0.0 || ^4.0.0" + } + }, + "loud-rejection": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/loud-rejection/-/loud-rejection-1.6.0.tgz", + "integrity": "sha1-W0b4AUft7leIcPCG0Eghz5mOVR8=", + "dev": true, + "requires": { + "currently-unhandled": "^0.4.1", + "signal-exit": "^3.0.0" + } + }, + "lowercase-keys": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-1.0.1.tgz", + "integrity": "sha512-G2Lj61tXDnVFFOi8VZds+SoQjtQC3dgokKdDG2mTm1tx4m50NUHBOZSBwQQHyy0V12A0JTG4icfZQH+xPyh8VA==", + "dev": true + }, + "lru-cache": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.3.tgz", + "integrity": "sha512-fFEhvcgzuIoJVUF8fYr5KR0YqxD238zgObTps31YdADwPPAp82a4M8TrckkWyx7ekNlf9aBcVn81cFwwXngrJA==", + "requires": { + "pseudomap": "^1.0.2", + "yallist": "^2.1.2" + } + }, + "make-dir": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-1.3.0.tgz", + "integrity": "sha512-2w31R7SJtieJJnQtGc7RVL2StM2vGYVfqUOvUDxH6bC6aJTxPxTF0GnIgCyu7tjockiUWAYQRbxa7vKn34s5sQ==", + "dev": true, + "requires": { + "pify": "^3.0.0" + } + }, + "map-age-cleaner": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/map-age-cleaner/-/map-age-cleaner-0.1.2.tgz", + "integrity": "sha512-UN1dNocxQq44IhJyMI4TU8phc2m9BddacHRPRjKGLYaF0jqd3xLz0jS0skpAU9WgYyoR4gHtUpzytNBS385FWQ==", + "dev": true, + "requires": { + "p-defer": "^1.0.0" + } + }, + "map-cache": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/map-cache/-/map-cache-0.2.2.tgz", + "integrity": "sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8=" + }, + "map-obj": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-1.0.1.tgz", + "integrity": "sha1-2TPOuSBdgr3PSIb2dCvcK03qFG0=", + "dev": true + }, + "map-visit": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/map-visit/-/map-visit-1.0.0.tgz", + "integrity": "sha1-7Nyo8TFE5mDxtb1B8S80edmN+48=", + "requires": { + "object-visit": "^1.0.0" + } + }, + "marked": { + "version": "0.3.19", + "resolved": "http://registry.npmjs.org/marked/-/marked-0.3.19.tgz", + "integrity": "sha512-ea2eGWOqNxPcXv8dyERdSr/6FmzvWwzjMxpfGB/sbMccXoct+xY+YukPD+QTUZwyvK7BZwcr4m21WBOW41pAkg==", + "dev": true + }, + "matcher": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/matcher/-/matcher-1.1.1.tgz", + "integrity": "sha512-+BmqxWIubKTRKNWx/ahnCkk3mG8m7OturVlqq6HiojGJTd5hVYbgZm6WzcYPCoB+KBT4Vd6R7WSRG2OADNaCjg==", + "dev": true, + "requires": { + "escape-string-regexp": "^1.0.4" + } + }, + "math-random": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/math-random/-/math-random-1.0.1.tgz", + "integrity": "sha1-izqsWIuKZuSXXjzepn97sylgH6w=", + "dev": true + }, + "md5-hex": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/md5-hex/-/md5-hex-2.0.0.tgz", + "integrity": "sha1-0FiOnxx0lUSS7NJKwKxs6ZfZLjM=", + "dev": true, + "requires": { + "md5-o-matic": "^0.1.1" + } + }, + "md5-o-matic": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/md5-o-matic/-/md5-o-matic-0.1.1.tgz", + "integrity": "sha1-givM1l4RfFFPqxdrJZRdVBAKA8M=", + "dev": true + }, + "mem": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/mem/-/mem-4.0.0.tgz", + "integrity": "sha512-WQxG/5xYc3tMbYLXoXPm81ET2WDULiU5FxbuIoNbJqLOOI8zehXFdZuiUEgfdrU2mVB1pxBZUGlYORSrpuJreA==", + "dev": true, + "requires": { + "map-age-cleaner": "^0.1.1", + "mimic-fn": "^1.0.0", + "p-is-promise": "^1.1.0" + } + }, + "meow": { + "version": "3.7.0", + "resolved": "http://registry.npmjs.org/meow/-/meow-3.7.0.tgz", + "integrity": "sha1-cstmi0JSKCkKu/qFaJJYcwioAfs=", + "dev": true, + "requires": { + "camelcase-keys": "^2.0.0", + "decamelize": "^1.1.2", + "loud-rejection": "^1.0.0", + "map-obj": "^1.0.1", + "minimist": "^1.1.3", + "normalize-package-data": "^2.3.4", + "object-assign": "^4.0.1", + "read-pkg-up": "^1.0.1", + "redent": "^1.0.0", + "trim-newlines": "^1.0.0" + }, + "dependencies": { + "find-up": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz", + "integrity": "sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8=", + "dev": true, + "requires": { + "path-exists": "^2.0.0", + "pinkie-promise": "^2.0.0" + } + }, + "load-json-file": { + "version": "1.1.0", + "resolved": "http://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz", + "integrity": "sha1-lWkFcI1YtLq0wiYbBPWfMcmTdMA=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "parse-json": "^2.2.0", + "pify": "^2.0.0", + "pinkie-promise": "^2.0.0", + "strip-bom": "^2.0.0" + } + }, + "minimist": { + "version": "1.2.0", + "resolved": "http://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", + "dev": true + }, + "path-exists": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-2.1.0.tgz", + "integrity": "sha1-D+tsZPD8UY2adU3V77YscCJ2H0s=", + "dev": true, + "requires": { + "pinkie-promise": "^2.0.0" + } + }, + "path-type": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-1.1.0.tgz", + "integrity": "sha1-WcRPfuSR2nBNpBXaWkBwuk+P5EE=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "pify": "^2.0.0", + "pinkie-promise": "^2.0.0" + } + }, + "pify": { + "version": "2.3.0", + "resolved": "http://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", + "dev": true + }, + "pinkie": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz", + "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA=", + "dev": true + }, + "pinkie-promise": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", + "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=", + "dev": true, + "requires": { + "pinkie": "^2.0.0" + } + }, + "read-pkg": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-1.1.0.tgz", + "integrity": "sha1-9f+qXs0pyzHAR0vKfXVra7KePyg=", + "dev": true, + "requires": { + "load-json-file": "^1.0.0", + "normalize-package-data": "^2.3.2", + "path-type": "^1.0.0" + } + }, + "read-pkg-up": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-1.0.1.tgz", + "integrity": "sha1-nWPBMnbAZZGNV/ACpX9AobZD+wI=", + "dev": true, + "requires": { + "find-up": "^1.0.0", + "read-pkg": "^1.0.0" + } + }, + "strip-bom": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz", + "integrity": "sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4=", + "dev": true, + "requires": { + "is-utf8": "^0.2.0" + } + } + } + }, + "merge-descriptors": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", + "integrity": "sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E=", + "dev": true + }, + "merge-estraverse-visitors": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/merge-estraverse-visitors/-/merge-estraverse-visitors-1.0.0.tgz", + "integrity": "sha1-65aDOLXe1c7tgs7AMH3sui2OqZQ=", + "dev": true, + "requires": { + "estraverse": "^4.0.0" + } + }, + "merge2": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.2.3.tgz", + "integrity": "sha512-gdUU1Fwj5ep4kplwcmftruWofEFt6lfpkkr3h860CXbAB9c3hGb55EOL2ali0Td5oebvW0E1+3Sr+Ur7XfKpRA==" + }, + "methods": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", + "integrity": "sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4=", + "dev": true + }, + "micromatch": { + "version": "3.1.10", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", + "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", + "requires": { + "arr-diff": "^4.0.0", + "array-unique": "^0.3.2", + "braces": "^2.3.1", + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "extglob": "^2.0.4", + "fragment-cache": "^0.2.1", + "kind-of": "^6.0.2", + "nanomatch": "^1.2.9", + "object.pick": "^1.3.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.2" + } + }, + "mime": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/mime/-/mime-2.3.1.tgz", + "integrity": "sha512-OEUllcVoydBHGN1z84yfQDimn58pZNNNXgZlHXSboxMlFvgI6MXSWpWKpFRra7H1HxpVhHTkrghfRW49k6yjeg==" + }, + "mime-db": { + "version": "1.37.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.37.0.tgz", + "integrity": "sha512-R3C4db6bgQhlIhPU48fUtdVmKnflq+hRdad7IyKhtFj06VPNVdk2RhiYL3UjQIlso8L+YxAtFkobT0VK+S/ybg==", + "dev": true + }, + "mime-types": { + "version": "2.1.21", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.21.tgz", + "integrity": "sha512-3iL6DbwpyLzjR3xHSFNFeb9Nz/M8WDkX33t1GFQnFOllWk8pOrh/LSrB5OXlnlW5P9LH73X6loW/eogc+F5lJg==", + "dev": true, + "requires": { + "mime-db": "~1.37.0" + } + }, + "mimic-fn": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz", + "integrity": "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==", + "dev": true + }, + "mimic-response": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-1.0.1.tgz", + "integrity": "sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ==", + "dev": true + }, + "minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "minimist": { + "version": "0.0.8", + "resolved": "http://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", + "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", + "dev": true + }, + "mixin-deep": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.1.tgz", + "integrity": "sha512-8ZItLHeEgaqEvd5lYBXfm4EZSFCX29Jb9K+lAHhDKzReKBQKj3R+7NOF6tjqYi9t4oI8VUfaWITJQm86wnXGNQ==", + "requires": { + "for-in": "^1.0.2", + "is-extendable": "^1.0.1" + }, + "dependencies": { + "is-extendable": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", + "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", + "requires": { + "is-plain-object": "^2.0.4" + } + } + } + }, + "mkdirp": { + "version": "0.5.1", + "resolved": "http://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", + "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", + "dev": true, + "requires": { + "minimist": "0.0.8" + } + }, + "mocha": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-5.2.0.tgz", + "integrity": "sha512-2IUgKDhc3J7Uug+FxMXuqIyYzH7gJjXECKe/w43IGgQHTSj3InJi+yAA7T24L9bQMRKiUEHxEX37G5JpVUGLcQ==", + "dev": true, + "requires": { + "browser-stdout": "1.3.1", + "commander": "2.15.1", + "debug": "3.1.0", + "diff": "3.5.0", + "escape-string-regexp": "1.0.5", + "glob": "7.1.2", + "growl": "1.10.5", + "he": "1.1.1", + "minimatch": "3.0.4", + "mkdirp": "0.5.1", + "supports-color": "5.4.0" + }, + "dependencies": { + "debug": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", + "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "glob": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", + "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "supports-color": { + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", + "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, + "module-not-found-error": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/module-not-found-error/-/module-not-found-error-1.0.1.tgz", + "integrity": "sha1-z4tP9PKWQGdNbN0CsOO8UjwrvcA=", + "dev": true + }, + "moment": { + "version": "2.22.2", + "resolved": "https://registry.npmjs.org/moment/-/moment-2.22.2.tgz", + "integrity": "sha1-PCV/mDn8DpP/UxSWMiOeuQeD/2Y=", + "dev": true + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" + }, + "multi-stage-sourcemap": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/multi-stage-sourcemap/-/multi-stage-sourcemap-0.2.1.tgz", + "integrity": "sha1-sJ/IWG6qF/gdV1xK0C4Pej9rEQU=", + "dev": true, + "requires": { + "source-map": "^0.1.34" + }, + "dependencies": { + "source-map": { + "version": "0.1.43", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.1.43.tgz", + "integrity": "sha1-wkvBRspRfBRx9drL4lcbK3+eM0Y=", + "dev": true, + "requires": { + "amdefine": ">=0.0.4" + } + } + } + }, + "multimatch": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/multimatch/-/multimatch-2.1.0.tgz", + "integrity": "sha1-nHkGoi+0wCkZ4vX3UWG0zb1LKis=", + "dev": true, + "requires": { + "array-differ": "^1.0.0", + "array-union": "^1.0.1", + "arrify": "^1.0.0", + "minimatch": "^3.0.0" + } + }, + "mute-stream": { + "version": "0.0.7", + "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.7.tgz", + "integrity": "sha1-MHXOk7whuPq0PhvE2n6BFe0ee6s=", + "dev": true + }, + "nan": { + "version": "2.11.1", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.11.1.tgz", + "integrity": "sha512-iji6k87OSXa0CcrLl9z+ZiYSuR2o+c0bGuNmXdrhTQTakxytAFsC56SArGYoiHlJlFoHSnvmhpceZJaXkVuOtA==" + }, + "nanomatch": { + "version": "1.2.13", + "resolved": "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.13.tgz", + "integrity": "sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA==", + "requires": { + "arr-diff": "^4.0.0", + "array-unique": "^0.3.2", + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "fragment-cache": "^0.2.1", + "is-windows": "^1.0.2", + "kind-of": "^6.0.2", + "object.pick": "^1.3.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" + } + }, + "natural-compare": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", + "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", + "dev": true + }, + "next-tick": { + "version": "1.0.0", + "resolved": "http://registry.npmjs.org/next-tick/-/next-tick-1.0.0.tgz", + "integrity": "sha1-yobR/ogoFpsBICCOPchCS524NCw=", + "dev": true + }, + "nice-try": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", + "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", + "dev": true + }, + "nise": { + "version": "1.4.6", + "resolved": "https://registry.npmjs.org/nise/-/nise-1.4.6.tgz", + "integrity": "sha512-1GedetLKzmqmgwabuMSqPsT7oumdR77SBpDfNNJhADRIeA3LN/2RVqR4fFqwvzhAqcTef6PPCzQwITE/YQ8S8A==", + "dev": true, + "requires": { + "@sinonjs/formatio": "3.0.0", + "just-extend": "^3.0.0", + "lolex": "^2.3.2", + "path-to-regexp": "^1.7.0", + "text-encoding": "^0.6.4" + }, + "dependencies": { + "@sinonjs/formatio": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@sinonjs/formatio/-/formatio-3.0.0.tgz", + "integrity": "sha512-vdjoYLDptCgvtJs57ULshak3iJe4NW3sJ3g36xVDGff5AE8P30S6A093EIEPjdi2noGhfuNOEkbxt3J3awFW1w==", + "dev": true, + "requires": { + "@sinonjs/samsam": "2.1.0" + } + } + } + }, + "node-forge": { + "version": "0.7.6", + "resolved": "https://registry.npmjs.org/node-forge/-/node-forge-0.7.6.tgz", + "integrity": "sha512-sol30LUpz1jQFBjOKwbjxijiE3b6pjd74YwfD0fJOKPjF+fONKb2Yg8rYgS6+bK6VDl+/wfr4IYpC7jDzLUIfw==" + }, + "normalize-package-data": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.4.0.tgz", + "integrity": "sha512-9jjUFbTPfEy3R/ad/2oNbKtW9Hgovl5O1FvFWKkKblNXoN/Oou6+9+KKohPK13Yc3/TyunyWhJp6gvRNR/PPAw==", + "dev": true, + "requires": { + "hosted-git-info": "^2.1.4", + "is-builtin-module": "^1.0.0", + "semver": "2 || 3 || 4 || 5", + "validate-npm-package-license": "^3.0.1" + } + }, + "normalize-path": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", + "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=", + "dev": true, + "requires": { + "remove-trailing-separator": "^1.0.1" + } + }, + "normalize-url": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-2.0.1.tgz", + "integrity": "sha512-D6MUW4K/VzoJ4rJ01JFKxDrtY1v9wrgzCX5f2qj/lzH1m/lW6MhUZFKerVsnyjOhOsYzI9Kqqak+10l4LvLpMw==", + "dev": true, + "requires": { + "prepend-http": "^2.0.0", + "query-string": "^5.0.1", + "sort-keys": "^2.0.0" + }, + "dependencies": { + "prepend-http": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/prepend-http/-/prepend-http-2.0.0.tgz", + "integrity": "sha1-6SQ0v6XqjBn0HN/UAddBo8gZ2Jc=", + "dev": true + } + } + }, + "npm-run-path": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz", + "integrity": "sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8=", + "dev": true, + "requires": { + "path-key": "^2.0.0" + } + }, + "number-is-nan": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", + "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=" + }, + "nyc": { + "version": "13.1.0", + "resolved": "https://registry.npmjs.org/nyc/-/nyc-13.1.0.tgz", + "integrity": "sha512-3GyY6TpQ58z9Frpv4GMExE1SV2tAgYqC7HSy2omEhNiCT3mhT9NyiOvIE8zkbuJVFzmvvNTnE4h/7/wQae7xLg==", + "dev": true, + "requires": { + "archy": "^1.0.0", + "arrify": "^1.0.1", + "caching-transform": "^2.0.0", + "convert-source-map": "^1.6.0", + "debug-log": "^1.0.1", + "find-cache-dir": "^2.0.0", + "find-up": "^3.0.0", + "foreground-child": "^1.5.6", + "glob": "^7.1.3", + "istanbul-lib-coverage": "^2.0.1", + "istanbul-lib-hook": "^2.0.1", + "istanbul-lib-instrument": "^3.0.0", + "istanbul-lib-report": "^2.0.2", + "istanbul-lib-source-maps": "^2.0.1", + "istanbul-reports": "^2.0.1", + "make-dir": "^1.3.0", + "merge-source-map": "^1.1.0", + "resolve-from": "^4.0.0", + "rimraf": "^2.6.2", + "signal-exit": "^3.0.2", + "spawn-wrap": "^1.4.2", + "test-exclude": "^5.0.0", + "uuid": "^3.3.2", + "yargs": "11.1.0", + "yargs-parser": "^9.0.2" + }, + "dependencies": { + "align-text": { + "version": "0.1.4", + "bundled": true, + "dev": true, + "requires": { + "kind-of": "^3.0.2", + "longest": "^1.0.1", + "repeat-string": "^1.5.2" + } + }, + "amdefine": { + "version": "1.0.1", + "bundled": true, + "dev": true + }, + "ansi-regex": { + "version": "3.0.0", + "bundled": true, + "dev": true + }, + "append-transform": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "requires": { + "default-require-extensions": "^2.0.0" + } + }, + "archy": { + "version": "1.0.0", + "bundled": true, + "dev": true + }, + "arrify": { + "version": "1.0.1", + "bundled": true, + "dev": true + }, + "async": { + "version": "1.5.2", + "bundled": true, + "dev": true + }, + "balanced-match": { + "version": "1.0.0", + "bundled": true, + "dev": true + }, + "brace-expansion": { + "version": "1.1.11", + "bundled": true, + "dev": true, + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "builtin-modules": { + "version": "1.1.1", + "bundled": true, + "dev": true + }, + "caching-transform": { + "version": "2.0.0", + "bundled": true, + "dev": true, + "requires": { + "make-dir": "^1.0.0", + "md5-hex": "^2.0.0", + "package-hash": "^2.0.0", + "write-file-atomic": "^2.0.0" + } + }, + "camelcase": { + "version": "1.2.1", + "bundled": true, + "dev": true, + "optional": true + }, + "center-align": { + "version": "0.1.3", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "align-text": "^0.1.3", + "lazy-cache": "^1.0.3" + } + }, + "cliui": { + "version": "2.1.0", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "center-align": "^0.1.1", + "right-align": "^0.1.1", + "wordwrap": "0.0.2" + }, + "dependencies": { + "wordwrap": { + "version": "0.0.2", + "bundled": true, + "dev": true, + "optional": true + } + } + }, + "code-point-at": { + "version": "1.1.0", + "bundled": true, + "dev": true + }, + "commondir": { + "version": "1.0.1", + "bundled": true, + "dev": true + }, + "concat-map": { + "version": "0.0.1", + "bundled": true, + "dev": true + }, + "convert-source-map": { + "version": "1.6.0", + "bundled": true, + "dev": true, + "requires": { + "safe-buffer": "~5.1.1" + } + }, + "cross-spawn": { + "version": "4.0.2", + "bundled": true, + "dev": true, + "requires": { + "lru-cache": "^4.0.1", + "which": "^1.2.9" + } + }, + "debug": { + "version": "3.1.0", + "bundled": true, + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "debug-log": { + "version": "1.0.1", + "bundled": true, + "dev": true + }, + "decamelize": { + "version": "1.2.0", + "bundled": true, + "dev": true + }, + "default-require-extensions": { + "version": "2.0.0", + "bundled": true, + "dev": true, + "requires": { + "strip-bom": "^3.0.0" + } + }, + "error-ex": { + "version": "1.3.2", + "bundled": true, + "dev": true, + "requires": { + "is-arrayish": "^0.2.1" + } + }, + "es6-error": { + "version": "4.1.1", + "bundled": true, + "dev": true + }, + "execa": { + "version": "0.7.0", + "bundled": true, + "dev": true, + "requires": { + "cross-spawn": "^5.0.1", + "get-stream": "^3.0.0", + "is-stream": "^1.1.0", + "npm-run-path": "^2.0.0", + "p-finally": "^1.0.0", + "signal-exit": "^3.0.0", + "strip-eof": "^1.0.0" + }, + "dependencies": { + "cross-spawn": { + "version": "5.1.0", + "bundled": true, + "dev": true, + "requires": { + "lru-cache": "^4.0.1", + "shebang-command": "^1.2.0", + "which": "^1.2.9" + } + } + } + }, + "find-cache-dir": { + "version": "2.0.0", + "bundled": true, + "dev": true, + "requires": { + "commondir": "^1.0.1", + "make-dir": "^1.0.0", + "pkg-dir": "^3.0.0" + } + }, + "find-up": { + "version": "3.0.0", + "bundled": true, + "dev": true, + "requires": { + "locate-path": "^3.0.0" + } + }, + "foreground-child": { + "version": "1.5.6", + "bundled": true, + "dev": true, + "requires": { + "cross-spawn": "^4", + "signal-exit": "^3.0.0" + } + }, + "fs.realpath": { + "version": "1.0.0", + "bundled": true, + "dev": true + }, + "get-caller-file": { + "version": "1.0.3", + "bundled": true, + "dev": true + }, + "get-stream": { + "version": "3.0.0", + "bundled": true, + "dev": true + }, + "glob": { + "version": "7.1.3", + "bundled": true, + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "graceful-fs": { + "version": "4.1.11", + "bundled": true, + "dev": true + }, + "handlebars": { + "version": "4.0.11", + "bundled": true, + "dev": true, + "requires": { + "async": "^1.4.0", + "optimist": "^0.6.1", + "source-map": "^0.4.4", + "uglify-js": "^2.6" + }, + "dependencies": { + "source-map": { + "version": "0.4.4", + "bundled": true, + "dev": true, + "requires": { + "amdefine": ">=0.0.4" + } + } + } + }, + "has-flag": { + "version": "3.0.0", + "bundled": true, + "dev": true + }, + "hosted-git-info": { + "version": "2.7.1", + "bundled": true, + "dev": true + }, + "imurmurhash": { + "version": "0.1.4", + "bundled": true, + "dev": true + }, + "inflight": { + "version": "1.0.6", + "bundled": true, + "dev": true, + "requires": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "inherits": { + "version": "2.0.3", + "bundled": true, + "dev": true + }, + "invert-kv": { + "version": "1.0.0", + "bundled": true, + "dev": true + }, + "is-arrayish": { + "version": "0.2.1", + "bundled": true, + "dev": true + }, + "is-buffer": { + "version": "1.1.6", + "bundled": true, + "dev": true + }, + "is-builtin-module": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "requires": { + "builtin-modules": "^1.0.0" + } + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "bundled": true, + "dev": true + }, + "is-stream": { + "version": "1.1.0", + "bundled": true, + "dev": true + }, + "isexe": { + "version": "2.0.0", + "bundled": true, + "dev": true + }, + "istanbul-lib-coverage": { + "version": "2.0.1", + "bundled": true, + "dev": true + }, + "istanbul-lib-hook": { + "version": "2.0.1", + "bundled": true, + "dev": true, + "requires": { + "append-transform": "^1.0.0" + } + }, + "istanbul-lib-report": { + "version": "2.0.2", + "bundled": true, + "dev": true, + "requires": { + "istanbul-lib-coverage": "^2.0.1", + "make-dir": "^1.3.0", + "supports-color": "^5.4.0" + } + }, + "istanbul-lib-source-maps": { + "version": "2.0.1", + "bundled": true, + "dev": true, + "requires": { + "debug": "^3.1.0", + "istanbul-lib-coverage": "^2.0.1", + "make-dir": "^1.3.0", + "rimraf": "^2.6.2", + "source-map": "^0.6.1" + }, + "dependencies": { + "source-map": { + "version": "0.6.1", + "bundled": true, + "dev": true + } + } + }, + "istanbul-reports": { + "version": "2.0.1", + "bundled": true, + "dev": true, + "requires": { + "handlebars": "^4.0.11" + } + }, + "json-parse-better-errors": { + "version": "1.0.2", + "bundled": true, + "dev": true + }, + "kind-of": { + "version": "3.2.2", + "bundled": true, + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + }, + "lazy-cache": { + "version": "1.0.4", + "bundled": true, + "dev": true, + "optional": true + }, + "lcid": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "requires": { + "invert-kv": "^1.0.0" + } + }, + "load-json-file": { + "version": "4.0.0", + "bundled": true, + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "parse-json": "^4.0.0", + "pify": "^3.0.0", + "strip-bom": "^3.0.0" + } + }, + "locate-path": { + "version": "3.0.0", + "bundled": true, + "dev": true, + "requires": { + "p-locate": "^3.0.0", + "path-exists": "^3.0.0" + } + }, + "lodash.flattendeep": { + "version": "4.4.0", + "bundled": true, + "dev": true + }, + "longest": { + "version": "1.0.1", + "bundled": true, + "dev": true + }, + "lru-cache": { + "version": "4.1.3", + "bundled": true, + "dev": true, + "requires": { + "pseudomap": "^1.0.2", + "yallist": "^2.1.2" + } + }, + "make-dir": { + "version": "1.3.0", + "bundled": true, + "dev": true, + "requires": { + "pify": "^3.0.0" + } + }, + "md5-hex": { + "version": "2.0.0", + "bundled": true, + "dev": true, + "requires": { + "md5-o-matic": "^0.1.1" + } + }, + "md5-o-matic": { + "version": "0.1.1", + "bundled": true, + "dev": true + }, + "mem": { + "version": "1.1.0", + "bundled": true, + "dev": true, + "requires": { + "mimic-fn": "^1.0.0" + } + }, + "merge-source-map": { + "version": "1.1.0", + "bundled": true, + "dev": true, + "requires": { + "source-map": "^0.6.1" + }, + "dependencies": { + "source-map": { + "version": "0.6.1", + "bundled": true, + "dev": true + } + } + }, + "mimic-fn": { + "version": "1.2.0", + "bundled": true, + "dev": true + }, + "minimatch": { + "version": "3.0.4", + "bundled": true, + "dev": true, + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "minimist": { + "version": "0.0.10", + "bundled": true, + "dev": true + }, + "mkdirp": { + "version": "0.5.1", + "bundled": true, + "dev": true, + "requires": { + "minimist": "0.0.8" + }, + "dependencies": { + "minimist": { + "version": "0.0.8", + "bundled": true, + "dev": true + } + } + }, + "ms": { + "version": "2.0.0", + "bundled": true, + "dev": true + }, + "normalize-package-data": { + "version": "2.4.0", + "bundled": true, + "dev": true, + "requires": { + "hosted-git-info": "^2.1.4", + "is-builtin-module": "^1.0.0", + "semver": "2 || 3 || 4 || 5", + "validate-npm-package-license": "^3.0.1" + } + }, + "npm-run-path": { + "version": "2.0.2", + "bundled": true, + "dev": true, + "requires": { + "path-key": "^2.0.0" + } + }, + "number-is-nan": { + "version": "1.0.1", + "bundled": true, + "dev": true + }, + "once": { + "version": "1.4.0", + "bundled": true, + "dev": true, + "requires": { + "wrappy": "1" + } + }, + "optimist": { + "version": "0.6.1", + "bundled": true, + "dev": true, + "requires": { + "minimist": "~0.0.1", + "wordwrap": "~0.0.2" + } + }, + "os-homedir": { + "version": "1.0.2", + "bundled": true, + "dev": true + }, + "os-locale": { + "version": "2.1.0", + "bundled": true, + "dev": true, + "requires": { + "execa": "^0.7.0", + "lcid": "^1.0.0", + "mem": "^1.1.0" + } + }, + "p-finally": { + "version": "1.0.0", + "bundled": true, + "dev": true + }, + "p-limit": { + "version": "2.0.0", + "bundled": true, + "dev": true, + "requires": { + "p-try": "^2.0.0" + } + }, + "p-locate": { + "version": "3.0.0", + "bundled": true, + "dev": true, + "requires": { + "p-limit": "^2.0.0" + } + }, + "p-try": { + "version": "2.0.0", + "bundled": true, + "dev": true + }, + "package-hash": { + "version": "2.0.0", + "bundled": true, + "dev": true, + "requires": { + "graceful-fs": "^4.1.11", + "lodash.flattendeep": "^4.4.0", + "md5-hex": "^2.0.0", + "release-zalgo": "^1.0.0" + } + }, + "parse-json": { + "version": "4.0.0", + "bundled": true, + "dev": true, + "requires": { + "error-ex": "^1.3.1", + "json-parse-better-errors": "^1.0.1" + } + }, + "path-exists": { + "version": "3.0.0", + "bundled": true, + "dev": true + }, + "path-is-absolute": { + "version": "1.0.1", + "bundled": true, + "dev": true + }, + "path-key": { + "version": "2.0.1", + "bundled": true, + "dev": true + }, + "path-type": { + "version": "3.0.0", + "bundled": true, + "dev": true, + "requires": { + "pify": "^3.0.0" + } + }, + "pify": { + "version": "3.0.0", + "bundled": true, + "dev": true + }, + "pkg-dir": { + "version": "3.0.0", + "bundled": true, + "dev": true, + "requires": { + "find-up": "^3.0.0" + } + }, + "pseudomap": { + "version": "1.0.2", + "bundled": true, + "dev": true + }, + "read-pkg": { + "version": "3.0.0", + "bundled": true, + "dev": true, + "requires": { + "load-json-file": "^4.0.0", + "normalize-package-data": "^2.3.2", + "path-type": "^3.0.0" + } + }, + "read-pkg-up": { + "version": "4.0.0", + "bundled": true, + "dev": true, + "requires": { + "find-up": "^3.0.0", + "read-pkg": "^3.0.0" + } + }, + "release-zalgo": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "requires": { + "es6-error": "^4.0.1" + } + }, + "repeat-string": { + "version": "1.6.1", + "bundled": true, + "dev": true + }, + "require-directory": { + "version": "2.1.1", + "bundled": true, + "dev": true + }, + "require-main-filename": { + "version": "1.0.1", + "bundled": true, + "dev": true + }, + "resolve-from": { + "version": "4.0.0", + "bundled": true, + "dev": true + }, + "right-align": { + "version": "0.1.3", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "align-text": "^0.1.1" + } + }, + "rimraf": { + "version": "2.6.2", + "bundled": true, + "dev": true, + "requires": { + "glob": "^7.0.5" + } + }, + "safe-buffer": { + "version": "5.1.2", + "bundled": true, + "dev": true + }, + "semver": { + "version": "5.5.0", + "bundled": true, + "dev": true + }, + "set-blocking": { + "version": "2.0.0", + "bundled": true, + "dev": true + }, + "shebang-command": { + "version": "1.2.0", + "bundled": true, + "dev": true, + "requires": { + "shebang-regex": "^1.0.0" + } + }, + "shebang-regex": { + "version": "1.0.0", + "bundled": true, + "dev": true + }, + "signal-exit": { + "version": "3.0.2", + "bundled": true, + "dev": true + }, + "source-map": { + "version": "0.5.7", + "bundled": true, + "dev": true, + "optional": true + }, + "spawn-wrap": { + "version": "1.4.2", + "bundled": true, + "dev": true, + "requires": { + "foreground-child": "^1.5.6", + "mkdirp": "^0.5.0", + "os-homedir": "^1.0.1", + "rimraf": "^2.6.2", + "signal-exit": "^3.0.2", + "which": "^1.3.0" + } + }, + "spdx-correct": { + "version": "3.0.0", + "bundled": true, + "dev": true, + "requires": { + "spdx-expression-parse": "^3.0.0", + "spdx-license-ids": "^3.0.0" + } + }, + "spdx-exceptions": { + "version": "2.1.0", + "bundled": true, + "dev": true + }, + "spdx-expression-parse": { + "version": "3.0.0", + "bundled": true, + "dev": true, + "requires": { + "spdx-exceptions": "^2.1.0", + "spdx-license-ids": "^3.0.0" + } + }, + "spdx-license-ids": { + "version": "3.0.0", + "bundled": true, + "dev": true + }, + "string-width": { + "version": "2.1.1", + "bundled": true, + "dev": true, + "requires": { + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^4.0.0" + } + }, + "strip-ansi": { + "version": "4.0.0", + "bundled": true, + "dev": true, + "requires": { + "ansi-regex": "^3.0.0" + } + }, + "strip-bom": { + "version": "3.0.0", + "bundled": true, + "dev": true + }, + "strip-eof": { + "version": "1.0.0", + "bundled": true, + "dev": true + }, + "supports-color": { + "version": "5.4.0", + "bundled": true, + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + }, + "test-exclude": { + "version": "5.0.0", + "bundled": true, + "dev": true, + "requires": { + "arrify": "^1.0.1", + "minimatch": "^3.0.4", + "read-pkg-up": "^4.0.0", + "require-main-filename": "^1.0.1" + } + }, + "uglify-js": { + "version": "2.8.29", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "source-map": "~0.5.1", + "uglify-to-browserify": "~1.0.0", + "yargs": "~3.10.0" + }, + "dependencies": { + "yargs": { + "version": "3.10.0", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "camelcase": "^1.0.2", + "cliui": "^2.1.0", + "decamelize": "^1.0.0", + "window-size": "0.1.0" + } + } + } + }, + "uglify-to-browserify": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "optional": true + }, + "uuid": { + "version": "3.3.2", + "bundled": true, + "dev": true + }, + "validate-npm-package-license": { + "version": "3.0.3", + "bundled": true, + "dev": true, + "requires": { + "spdx-correct": "^3.0.0", + "spdx-expression-parse": "^3.0.0" + } + }, + "which": { + "version": "1.3.1", + "bundled": true, + "dev": true, + "requires": { + "isexe": "^2.0.0" + } + }, + "which-module": { + "version": "2.0.0", + "bundled": true, + "dev": true + }, + "window-size": { + "version": "0.1.0", + "bundled": true, + "dev": true, + "optional": true + }, + "wordwrap": { + "version": "0.0.3", + "bundled": true, + "dev": true + }, + "wrap-ansi": { + "version": "2.1.0", + "bundled": true, + "dev": true, + "requires": { + "string-width": "^1.0.1", + "strip-ansi": "^3.0.1" + }, + "dependencies": { + "ansi-regex": { + "version": "2.1.1", + "bundled": true, + "dev": true + }, + "is-fullwidth-code-point": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "requires": { + "number-is-nan": "^1.0.0" + } + }, + "string-width": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "requires": { + "code-point-at": "^1.0.0", + "is-fullwidth-code-point": "^1.0.0", + "strip-ansi": "^3.0.0" + } + }, + "strip-ansi": { + "version": "3.0.1", + "bundled": true, + "dev": true, + "requires": { + "ansi-regex": "^2.0.0" + } + } + } + }, + "wrappy": { + "version": "1.0.2", + "bundled": true, + "dev": true + }, + "write-file-atomic": { + "version": "2.3.0", + "bundled": true, + "dev": true, + "requires": { + "graceful-fs": "^4.1.11", + "imurmurhash": "^0.1.4", + "signal-exit": "^3.0.2" + } + }, + "y18n": { + "version": "3.2.1", + "bundled": true, + "dev": true + }, + "yallist": { + "version": "2.1.2", + "bundled": true, + "dev": true + }, + "yargs": { + "version": "11.1.0", + "bundled": true, + "dev": true, + "requires": { + "cliui": "^4.0.0", + "decamelize": "^1.1.1", + "find-up": "^2.1.0", + "get-caller-file": "^1.0.1", + "os-locale": "^2.0.0", + "require-directory": "^2.1.1", + "require-main-filename": "^1.0.1", + "set-blocking": "^2.0.0", + "string-width": "^2.0.0", + "which-module": "^2.0.0", + "y18n": "^3.2.1", + "yargs-parser": "^9.0.2" + }, + "dependencies": { + "cliui": { + "version": "4.1.0", + "bundled": true, + "dev": true, + "requires": { + "string-width": "^2.1.1", + "strip-ansi": "^4.0.0", + "wrap-ansi": "^2.0.0" + } + }, + "find-up": { + "version": "2.1.0", + "bundled": true, + "dev": true, + "requires": { + "locate-path": "^2.0.0" + } + }, + "locate-path": { + "version": "2.0.0", + "bundled": true, + "dev": true, + "requires": { + "p-locate": "^2.0.0", + "path-exists": "^3.0.0" + } + }, + "p-limit": { + "version": "1.3.0", + "bundled": true, + "dev": true, + "requires": { + "p-try": "^1.0.0" + } + }, + "p-locate": { + "version": "2.0.0", + "bundled": true, + "dev": true, + "requires": { + "p-limit": "^1.1.0" + } + }, + "p-try": { + "version": "1.0.0", + "bundled": true, + "dev": true + } + } + }, + "yargs-parser": { + "version": "9.0.2", + "bundled": true, + "dev": true, + "requires": { + "camelcase": "^4.1.0" + }, + "dependencies": { + "camelcase": { + "version": "4.1.0", + "bundled": true, + "dev": true + } + } + } + } + }, + "oauth-sign": { + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", + "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==", + "dev": true + }, + "object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", + "dev": true + }, + "object-copy": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/object-copy/-/object-copy-0.1.0.tgz", + "integrity": "sha1-fn2Fi3gb18mRpBupde04EnVOmYw=", + "requires": { + "copy-descriptor": "^0.1.0", + "define-property": "^0.2.5", + "kind-of": "^3.0.3" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "requires": { + "is-descriptor": "^0.1.0" + } + }, + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "object-keys": { + "version": "1.0.12", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.0.12.tgz", + "integrity": "sha512-FTMyFUm2wBcGHnH2eXmz7tC6IwlqQZ6mVZ+6dm6vZ4IQIHjs6FdNsQBuKGPuUUUY6NfJw2PshC08Tn6LzLDOag==" + }, + "object-visit": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/object-visit/-/object-visit-1.0.1.tgz", + "integrity": "sha1-95xEk68MU3e1n+OdOV5BBC3QRbs=", + "requires": { + "isobject": "^3.0.0" + } + }, + "object.omit": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/object.omit/-/object.omit-2.0.1.tgz", + "integrity": "sha1-Gpx0SCnznbuFjHbKNXmuKlTr0fo=", + "dev": true, + "requires": { + "for-own": "^0.1.4", + "is-extendable": "^0.1.1" + } + }, + "object.pick": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/object.pick/-/object.pick-1.3.0.tgz", + "integrity": "sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c=", + "requires": { + "isobject": "^3.0.1" + } + }, + "observable-to-promise": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/observable-to-promise/-/observable-to-promise-0.5.0.tgz", + "integrity": "sha1-yCjw8NxH6fhq+KSXfF1VB2znqR8=", + "dev": true, + "requires": { + "is-observable": "^0.2.0", + "symbol-observable": "^1.0.4" + }, + "dependencies": { + "is-observable": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/is-observable/-/is-observable-0.2.0.tgz", + "integrity": "sha1-s2ExHYPG5dcmyr9eJQsCNxBvWuI=", + "dev": true, + "requires": { + "symbol-observable": "^0.2.2" + }, + "dependencies": { + "symbol-observable": { + "version": "0.2.4", + "resolved": "https://registry.npmjs.org/symbol-observable/-/symbol-observable-0.2.4.tgz", + "integrity": "sha1-lag9smGG1q9+ehjb2XYKL4bQj0A=", + "dev": true + } + } + } + } + }, + "once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "requires": { + "wrappy": "1" + } + }, + "onetime": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-2.0.1.tgz", + "integrity": "sha1-BnQoIw/WdEOyeUsiu6UotoZ5YtQ=", + "dev": true, + "requires": { + "mimic-fn": "^1.0.0" + } + }, + "optimist": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/optimist/-/optimist-0.6.1.tgz", + "integrity": "sha1-2j6nRob6IaGaERwybpDrFaAZZoY=", + "dev": true, + "requires": { + "minimist": "~0.0.1", + "wordwrap": "~0.0.2" + } + }, + "option-chain": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/option-chain/-/option-chain-1.0.0.tgz", + "integrity": "sha1-k41zvU4Xg/lI00AjZEraI2aeMPI=", + "dev": true + }, + "optionator": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.2.tgz", + "integrity": "sha1-NkxeQJ0/TWMB1sC0wFu6UBgK62Q=", + "dev": true, + "requires": { + "deep-is": "~0.1.3", + "fast-levenshtein": "~2.0.4", + "levn": "~0.3.0", + "prelude-ls": "~1.1.2", + "type-check": "~0.3.2", + "wordwrap": "~1.0.0" + }, + "dependencies": { + "wordwrap": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", + "integrity": "sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus=", + "dev": true + } + } + }, + "optjs": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/optjs/-/optjs-3.2.2.tgz", + "integrity": "sha1-aabOicRCpEQDFBrS+bNwvVu29O4=" + }, + "os-homedir": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", + "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=", + "dev": true + }, + "os-locale": { + "version": "1.4.0", + "resolved": "http://registry.npmjs.org/os-locale/-/os-locale-1.4.0.tgz", + "integrity": "sha1-IPnxeuKe00XoveWDsT0gCYA8FNk=", + "requires": { + "lcid": "^1.0.0" + } + }, + "os-tmpdir": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", + "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", + "dev": true + }, + "p-cancelable": { + "version": "0.4.1", + "resolved": "http://registry.npmjs.org/p-cancelable/-/p-cancelable-0.4.1.tgz", + "integrity": "sha512-HNa1A8LvB1kie7cERyy21VNeHb2CWJJYqyyC2o3klWFfMGlFmWv2Z7sFgZH8ZiaYL95ydToKTFVXgMV/Os0bBQ==", + "dev": true + }, + "p-defer": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-defer/-/p-defer-1.0.0.tgz", + "integrity": "sha1-n26xgvbJqozXQwBKfU+WsZaw+ww=", + "dev": true + }, + "p-finally": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", + "integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=", + "dev": true + }, + "p-is-promise": { + "version": "1.1.0", + "resolved": "http://registry.npmjs.org/p-is-promise/-/p-is-promise-1.1.0.tgz", + "integrity": "sha1-nJRWmJ6fZYgBewQ01WCXZ1w9oF4=", + "dev": true + }, + "p-limit": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", + "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", + "dev": true, + "requires": { + "p-try": "^1.0.0" + } + }, + "p-locate": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", + "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", + "dev": true, + "requires": { + "p-limit": "^1.1.0" + } + }, + "p-timeout": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/p-timeout/-/p-timeout-2.0.1.tgz", + "integrity": "sha512-88em58dDVB/KzPEx1X0N3LwFfYZPyDc4B6eF38M1rk9VTZMbxXXgjugz8mmwpS9Ox4BDZ+t6t3QP5+/gazweIA==", + "dev": true, + "requires": { + "p-finally": "^1.0.0" + } + }, + "p-try": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", + "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=", + "dev": true + }, + "package-hash": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/package-hash/-/package-hash-2.0.0.tgz", + "integrity": "sha1-eK4ybIngWk2BO2hgGXevBcANKg0=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.11", + "lodash.flattendeep": "^4.4.0", + "md5-hex": "^2.0.0", + "release-zalgo": "^1.0.0" + } + }, + "package-json": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/package-json/-/package-json-4.0.1.tgz", + "integrity": "sha1-iGmgQBJTZhxMTKPabCEh7VVfXu0=", + "dev": true, + "requires": { + "got": "^6.7.1", + "registry-auth-token": "^3.0.1", + "registry-url": "^3.0.3", + "semver": "^5.1.0" + }, + "dependencies": { + "got": { + "version": "6.7.1", + "resolved": "http://registry.npmjs.org/got/-/got-6.7.1.tgz", + "integrity": "sha1-JAzQV4WpoY5WHcG0S0HHY+8ejbA=", + "dev": true, + "requires": { + "create-error-class": "^3.0.0", + "duplexer3": "^0.1.4", + "get-stream": "^3.0.0", + "is-redirect": "^1.0.0", + "is-retry-allowed": "^1.0.0", + "is-stream": "^1.0.0", + "lowercase-keys": "^1.0.0", + "safe-buffer": "^5.0.1", + "timed-out": "^4.0.0", + "unzip-response": "^2.0.1", + "url-parse-lax": "^1.0.0" + } + } + } + }, + "parse-glob": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/parse-glob/-/parse-glob-3.0.4.tgz", + "integrity": "sha1-ssN2z7EfNVE7rdFz7wu246OIORw=", + "dev": true, + "requires": { + "glob-base": "^0.3.0", + "is-dotfile": "^1.0.0", + "is-extglob": "^1.0.0", + "is-glob": "^2.0.0" + }, + "dependencies": { + "is-extglob": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz", + "integrity": "sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA=", + "dev": true + }, + "is-glob": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz", + "integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=", + "dev": true, + "requires": { + "is-extglob": "^1.0.0" + } + } + } + }, + "parse-json": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", + "integrity": "sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=", + "dev": true, + "requires": { + "error-ex": "^1.2.0" + } + }, + "parse-ms": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/parse-ms/-/parse-ms-0.1.2.tgz", + "integrity": "sha1-3T+iXtbC78e93hKtm0bBY6opIk4=", + "dev": true + }, + "pascalcase": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/pascalcase/-/pascalcase-0.1.1.tgz", + "integrity": "sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ=" + }, + "path-dirname": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/path-dirname/-/path-dirname-1.0.2.tgz", + "integrity": "sha1-zDPSTVJeCZpTiMAzbG4yuRYGCeA=" + }, + "path-exists": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", + "dev": true + }, + "path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=" + }, + "path-is-inside": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/path-is-inside/-/path-is-inside-1.0.2.tgz", + "integrity": "sha1-NlQX3t5EQw0cEa9hAn+s8HS9/FM=", + "dev": true + }, + "path-key": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", + "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", + "dev": true + }, + "path-parse": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", + "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", + "dev": true + }, + "path-to-regexp": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-1.7.0.tgz", + "integrity": "sha1-Wf3g9DW62suhA6hOnTvGTpa5k30=", + "dev": true, + "requires": { + "isarray": "0.0.1" + }, + "dependencies": { + "isarray": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", + "dev": true + } + } + }, + "path-type": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-3.0.0.tgz", + "integrity": "sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg==", + "requires": { + "pify": "^3.0.0" + } + }, + "performance-now": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", + "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=", + "dev": true + }, + "pify": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", + "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=" + }, + "pinkie": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-1.0.0.tgz", + "integrity": "sha1-Wkfyi6EBXQIBvae/DzWOR77Ix+Q=", + "dev": true + }, + "pinkie-promise": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-1.0.0.tgz", + "integrity": "sha1-0dpn9UglY7t89X8oauKCLs+/NnA=", + "dev": true, + "requires": { + "pinkie": "^1.0.0" + } + }, + "pkg-conf": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/pkg-conf/-/pkg-conf-2.1.0.tgz", + "integrity": "sha1-ISZRTKbyq/69FoWW3xi6V4Z/AFg=", + "dev": true, + "requires": { + "find-up": "^2.0.0", + "load-json-file": "^4.0.0" + }, + "dependencies": { + "load-json-file": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-4.0.0.tgz", + "integrity": "sha1-L19Fq5HjMhYjT9U62rZo607AmTs=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "parse-json": "^4.0.0", + "pify": "^3.0.0", + "strip-bom": "^3.0.0" + } + }, + "parse-json": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz", + "integrity": "sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA=", + "dev": true, + "requires": { + "error-ex": "^1.3.1", + "json-parse-better-errors": "^1.0.1" + } + } + } + }, + "pkg-dir": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-2.0.0.tgz", + "integrity": "sha1-9tXREJ4Z1j7fQo4L1X4Sd3YVM0s=", + "dev": true, + "requires": { + "find-up": "^2.1.0" + } + }, + "plur": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/plur/-/plur-2.1.2.tgz", + "integrity": "sha1-dIJFLBoPUI4+NE6uwxLJHCncZVo=", + "dev": true, + "requires": { + "irregular-plurals": "^1.0.0" + } + }, + "pluralize": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/pluralize/-/pluralize-7.0.0.tgz", + "integrity": "sha512-ARhBOdzS3e41FbkW/XWrTEtukqqLoK5+Z/4UeDaLuSW+39JPeFgs4gCGqsrJHVZX0fUrx//4OF0K1CUGwlIFow==", + "dev": true + }, + "posix-character-classes": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/posix-character-classes/-/posix-character-classes-0.1.1.tgz", + "integrity": "sha1-AerA/jta9xoqbAL+q7jB/vfgDqs=" + }, + "postcss": { + "version": "6.0.23", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.23.tgz", + "integrity": "sha512-soOk1h6J3VMTZtVeVpv15/Hpdl2cBLX3CAw4TAbkpTJiNPk9YP/zWcD1ND+xEtvyuuvKzbxliTOIyvkSeSJ6ag==", + "dev": true, + "requires": { + "chalk": "^2.4.1", + "source-map": "^0.6.1", + "supports-color": "^5.4.0" + }, + "dependencies": { + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + } + } + }, + "power-assert": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/power-assert/-/power-assert-1.6.1.tgz", + "integrity": "sha512-VWkkZV6Y+W8qLX/PtJu2Ur2jDPIs0a5vbP0TpKeybNcIXmT4vcKoVkyTp5lnQvTpY/DxacAZ4RZisHRHLJcAZQ==", + "requires": { + "define-properties": "^1.1.2", + "empower": "^1.3.1", + "power-assert-formatter": "^1.4.1", + "universal-deep-strict-equal": "^1.2.1", + "xtend": "^4.0.0" + } + }, + "power-assert-context-formatter": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/power-assert-context-formatter/-/power-assert-context-formatter-1.2.0.tgz", + "integrity": "sha512-HLNEW8Bin+BFCpk/zbyKwkEu9W8/zThIStxGo7weYcFkKgMuGCHUJhvJeBGXDZf0Qm2xis4pbnnciGZiX0EpSg==", + "requires": { + "core-js": "^2.0.0", + "power-assert-context-traversal": "^1.2.0" + } + }, + "power-assert-context-reducer-ast": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/power-assert-context-reducer-ast/-/power-assert-context-reducer-ast-1.2.0.tgz", + "integrity": "sha512-EgOxmZ/Lb7tw4EwSKX7ZnfC0P/qRZFEG28dx/690qvhmOJ6hgThYFm5TUWANDLK5NiNKlPBi5WekVGd2+5wPrw==", + "requires": { + "acorn": "^5.0.0", + "acorn-es7-plugin": "^1.0.12", + "core-js": "^2.0.0", + "espurify": "^1.6.0", + "estraverse": "^4.2.0" + } + }, + "power-assert-context-traversal": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/power-assert-context-traversal/-/power-assert-context-traversal-1.2.0.tgz", + "integrity": "sha512-NFoHU6g2umNajiP2l4qb0BRWD773Aw9uWdWYH9EQsVwIZnog5bd2YYLFCVvaxWpwNzWeEfZIon2xtyc63026pQ==", + "requires": { + "core-js": "^2.0.0", + "estraverse": "^4.1.0" + } + }, + "power-assert-formatter": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/power-assert-formatter/-/power-assert-formatter-1.4.1.tgz", + "integrity": "sha1-XcEl7VCj37HdomwZNH879Y7CiEo=", + "requires": { + "core-js": "^2.0.0", + "power-assert-context-formatter": "^1.0.7", + "power-assert-context-reducer-ast": "^1.0.7", + "power-assert-renderer-assertion": "^1.0.7", + "power-assert-renderer-comparison": "^1.0.7", + "power-assert-renderer-diagram": "^1.0.7", + "power-assert-renderer-file": "^1.0.7" + } + }, + "power-assert-renderer-assertion": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/power-assert-renderer-assertion/-/power-assert-renderer-assertion-1.2.0.tgz", + "integrity": "sha512-3F7Q1ZLmV2ZCQv7aV7NJLNK9G7QsostrhOU7U0RhEQS/0vhEqrRg2jEJl1jtUL4ZyL2dXUlaaqrmPv5r9kRvIg==", + "requires": { + "power-assert-renderer-base": "^1.1.1", + "power-assert-util-string-width": "^1.2.0" + } + }, + "power-assert-renderer-base": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/power-assert-renderer-base/-/power-assert-renderer-base-1.1.1.tgz", + "integrity": "sha1-lqZQxv0F7hvB9mtUrWFELIs/Y+s=" + }, + "power-assert-renderer-comparison": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/power-assert-renderer-comparison/-/power-assert-renderer-comparison-1.2.0.tgz", + "integrity": "sha512-7c3RKPDBKK4E3JqdPtYRE9cM8AyX4LC4yfTvvTYyx8zSqmT5kJnXwzR0yWQLOavACllZfwrAGQzFiXPc5sWa+g==", + "requires": { + "core-js": "^2.0.0", + "diff-match-patch": "^1.0.0", + "power-assert-renderer-base": "^1.1.1", + "stringifier": "^1.3.0", + "type-name": "^2.0.1" + } + }, + "power-assert-renderer-diagram": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/power-assert-renderer-diagram/-/power-assert-renderer-diagram-1.2.0.tgz", + "integrity": "sha512-JZ6PC+DJPQqfU6dwSmpcoD7gNnb/5U77bU5KgNwPPa+i1Pxiz6UuDeM3EUBlhZ1HvH9tMjI60anqVyi5l2oNdg==", + "requires": { + "core-js": "^2.0.0", + "power-assert-renderer-base": "^1.1.1", + "power-assert-util-string-width": "^1.2.0", + "stringifier": "^1.3.0" + } + }, + "power-assert-renderer-file": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/power-assert-renderer-file/-/power-assert-renderer-file-1.2.0.tgz", + "integrity": "sha512-/oaVrRbeOtGoyyd7e4IdLP/jIIUFJdqJtsYzP9/88R39CMnfF/S/rUc8ZQalENfUfQ/wQHu+XZYRMaCEZmEesg==", + "requires": { + "power-assert-renderer-base": "^1.1.1" + } + }, + "power-assert-util-string-width": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/power-assert-util-string-width/-/power-assert-util-string-width-1.2.0.tgz", + "integrity": "sha512-lX90G0igAW0iyORTILZ/QjZWsa1MZ6VVY3L0K86e2eKun3S4LKPH4xZIl8fdeMYLfOjkaszbNSzf1uugLeAm2A==", + "requires": { + "eastasianwidth": "^0.2.0" + } + }, + "prelude-ls": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", + "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=", + "dev": true + }, + "prepend-http": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/prepend-http/-/prepend-http-1.0.4.tgz", + "integrity": "sha1-1PRWKwzjaW5BrFLQ4ALlemNdxtw=", + "dev": true + }, + "preserve": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/preserve/-/preserve-0.2.0.tgz", + "integrity": "sha1-gV7R9uvGWSb4ZbMQwHE7yzMVzks=", + "dev": true + }, + "prettier": { + "version": "1.14.3", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-1.14.3.tgz", + "integrity": "sha512-qZDVnCrnpsRJJq5nSsiHCE3BYMED2OtsI+cmzIzF1QIfqm5ALf8tEJcO27zV1gKNKRPdhjO0dNWnrzssDQ1tFg==", + "dev": true + }, + "prettier-linter-helpers": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/prettier-linter-helpers/-/prettier-linter-helpers-1.0.0.tgz", + "integrity": "sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w==", + "dev": true, + "requires": { + "fast-diff": "^1.1.2" + } + }, + "pretty-ms": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/pretty-ms/-/pretty-ms-3.2.0.tgz", + "integrity": "sha512-ZypexbfVUGTFxb0v+m1bUyy92DHe5SyYlnyY0msyms5zd3RwyvNgyxZZsXXgoyzlxjx5MiqtXUdhUfvQbe0A2Q==", + "dev": true, + "requires": { + "parse-ms": "^1.0.0" + }, + "dependencies": { + "parse-ms": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parse-ms/-/parse-ms-1.0.1.tgz", + "integrity": "sha1-VjRtR0nXjyNDDKDHE4UK75GqNh0=", + "dev": true + } + } + }, + "private": { + "version": "0.1.8", + "resolved": "https://registry.npmjs.org/private/-/private-0.1.8.tgz", + "integrity": "sha512-VvivMrbvd2nKkiG38qjULzlc+4Vx4wm/whI9pQD35YrARNnhxeiRktSOhSukRLFNlzg6Br/cJPet5J/u19r/mg==", + "dev": true + }, + "process-nextick-args": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.0.tgz", + "integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==" + }, + "progress": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.1.tgz", + "integrity": "sha512-OE+a6vzqazc+K6LxJrX5UPyKFvGnL5CYmq2jFGNIBWHpc4QyE49/YOumcrpQFJpfejmvRtbJzgO1zPmMCqlbBg==", + "dev": true + }, + "protobufjs": { + "version": "6.8.8", + "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-6.8.8.tgz", + "integrity": "sha512-AAmHtD5pXgZfi7GMpllpO3q1Xw1OYldr+dMUlAnffGTAhqkg72WdmSY71uKBF/JuyiKs8psYbtKrhi0ASCD8qw==", + "requires": { + "@protobufjs/aspromise": "^1.1.2", + "@protobufjs/base64": "^1.1.2", + "@protobufjs/codegen": "^2.0.4", + "@protobufjs/eventemitter": "^1.1.0", + "@protobufjs/fetch": "^1.1.0", + "@protobufjs/float": "^1.0.2", + "@protobufjs/inquire": "^1.1.0", + "@protobufjs/path": "^1.1.2", + "@protobufjs/pool": "^1.1.0", + "@protobufjs/utf8": "^1.1.0", + "@types/long": "^4.0.0", + "@types/node": "^10.1.0", + "long": "^4.0.0" + }, + "dependencies": { + "@types/node": { + "version": "10.12.2", + "resolved": "https://registry.npmjs.org/@types/node/-/node-10.12.2.tgz", + "integrity": "sha512-53ElVDSnZeFUUFIYzI8WLQ25IhWzb6vbddNp8UHlXQyU0ET2RhV5zg0NfubzU7iNMh5bBXb0htCzfvrSVNgzaQ==" + } + } + }, + "proxyquire": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/proxyquire/-/proxyquire-2.1.0.tgz", + "integrity": "sha512-kptdFArCfGRtQFv3Qwjr10lwbEV0TBJYvfqzhwucyfEXqVgmnAkyEw/S3FYzR5HI9i5QOq4rcqQjZ6AlknlCDQ==", + "dev": true, + "requires": { + "fill-keys": "^1.0.2", + "module-not-found-error": "^1.0.0", + "resolve": "~1.8.1" + } + }, + "pseudomap": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", + "integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM=" + }, + "psl": { + "version": "1.1.29", + "resolved": "https://registry.npmjs.org/psl/-/psl-1.1.29.tgz", + "integrity": "sha512-AeUmQ0oLN02flVHXWh9sSJF7mcdFq0ppid/JkErufc3hGIV/AMa8Fo9VgDo/cT2jFdOWoFvHp90qqBH54W+gjQ==", + "dev": true + }, + "punycode": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", + "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=", + "dev": true + }, + "qs": { + "version": "6.5.2", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz", + "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==", + "dev": true + }, + "query-string": { + "version": "5.1.1", + "resolved": "http://registry.npmjs.org/query-string/-/query-string-5.1.1.tgz", + "integrity": "sha512-gjWOsm2SoGlgLEdAGt7a6slVOk9mGiXmPFMqrEhLQ68rhQuBnpfs3+EmlvqKyxnCo9/PPlF+9MtY02S1aFg+Jw==", + "dev": true, + "requires": { + "decode-uri-component": "^0.2.0", + "object-assign": "^4.1.0", + "strict-uri-encode": "^1.0.0" + } + }, + "randomatic": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/randomatic/-/randomatic-3.1.1.tgz", + "integrity": "sha512-TuDE5KxZ0J461RVjrJZCJc+J+zCkTb1MbH9AQUq68sMhOMcy9jLcb3BrZKgp9q9Ncltdg4QVqWrH02W2EFFVYw==", + "dev": true, + "requires": { + "is-number": "^4.0.0", + "kind-of": "^6.0.0", + "math-random": "^1.0.1" + }, + "dependencies": { + "is-number": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-4.0.0.tgz", + "integrity": "sha512-rSklcAIlf1OmFdyAqbnWTLVelsQ58uvZ66S/ZyawjWqIviTWCjg2PzVGw8WUA+nNuPTqb4wgA+NszrJ+08LlgQ==", + "dev": true + } + } + }, + "rc": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", + "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==", + "dev": true, + "requires": { + "deep-extend": "^0.6.0", + "ini": "~1.3.0", + "minimist": "^1.2.0", + "strip-json-comments": "~2.0.1" + }, + "dependencies": { + "minimist": { + "version": "1.2.0", + "resolved": "http://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", + "dev": true + } + } + }, + "read-pkg": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-2.0.0.tgz", + "integrity": "sha1-jvHAYjxqbbDcZxPEv6xGMysjaPg=", + "dev": true, + "requires": { + "load-json-file": "^2.0.0", + "normalize-package-data": "^2.3.2", + "path-type": "^2.0.0" + }, + "dependencies": { + "path-type": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-2.0.0.tgz", + "integrity": "sha1-8BLMuEFbcJb8LaoQVMPXI4lZTHM=", + "dev": true, + "requires": { + "pify": "^2.0.0" + } + }, + "pify": { + "version": "2.3.0", + "resolved": "http://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", + "dev": true + } + } + }, + "read-pkg-up": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-2.0.0.tgz", + "integrity": "sha1-a3KoBImE4MQeeVEP1en6mbO1Sb4=", + "dev": true, + "requires": { + "find-up": "^2.0.0", + "read-pkg": "^2.0.0" + } + }, + "readable-stream": { + "version": "2.3.6", + "resolved": "http://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", + "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "readdirp": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-2.2.1.tgz", + "integrity": "sha512-1JU/8q+VgFZyxwrJ+SVIOsh+KywWGpds3NTqikiKpDMZWScmAYyKIgqkO+ARvNWJfXeXR1zxz7aHF4u4CyH6vQ==", + "dev": true, + "requires": { + "graceful-fs": "^4.1.11", + "micromatch": "^3.1.10", + "readable-stream": "^2.0.2" + } + }, + "redent": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/redent/-/redent-1.0.0.tgz", + "integrity": "sha1-z5Fqsf1fHxbfsggi3W7H9zDCr94=", + "dev": true, + "requires": { + "indent-string": "^2.1.0", + "strip-indent": "^1.0.1" + }, + "dependencies": { + "indent-string": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-2.1.0.tgz", + "integrity": "sha1-ji1INIdCEhtKghi3oTfppSBJ3IA=", + "dev": true, + "requires": { + "repeating": "^2.0.0" + } + } + } + }, + "regenerate": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/regenerate/-/regenerate-1.4.0.tgz", + "integrity": "sha512-1G6jJVDWrt0rK99kBjvEtziZNCICAuvIPkSiUFIQxVP06RCVpq3dmDo2oi6ABpYaDYaTRr67BEhL8r1wgEZZKg==", + "dev": true + }, + "regenerator-runtime": { + "version": "0.11.1", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz", + "integrity": "sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg==", + "dev": true + }, + "regex-cache": { + "version": "0.4.4", + "resolved": "https://registry.npmjs.org/regex-cache/-/regex-cache-0.4.4.tgz", + "integrity": "sha512-nVIZwtCjkC9YgvWkpM55B5rBhBYRZhAaJbgcFYXXsHnbZ9UZI9nnVWYZpBlCqv9ho2eZryPnWrZGsOdPwVWXWQ==", + "dev": true, + "requires": { + "is-equal-shallow": "^0.1.3" + } + }, + "regex-not": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/regex-not/-/regex-not-1.0.2.tgz", + "integrity": "sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A==", + "requires": { + "extend-shallow": "^3.0.2", + "safe-regex": "^1.1.0" + } + }, + "regexpp": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-2.0.1.tgz", + "integrity": "sha512-lv0M6+TkDVniA3aD1Eg0DVpfU/booSu7Eev3TDO/mZKHBfVjgCGTV4t4buppESEYDtkArYFOxTJWv6S5C+iaNw==", + "dev": true + }, + "regexpu-core": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-2.0.0.tgz", + "integrity": "sha1-SdA4g3uNz4v6W5pCE5k45uoq4kA=", + "dev": true, + "requires": { + "regenerate": "^1.2.1", + "regjsgen": "^0.2.0", + "regjsparser": "^0.1.4" + } + }, + "registry-auth-token": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/registry-auth-token/-/registry-auth-token-3.3.2.tgz", + "integrity": "sha512-JL39c60XlzCVgNrO+qq68FoNb56w/m7JYvGR2jT5iR1xBrUA3Mfx5Twk5rqTThPmQKMWydGmq8oFtDlxfrmxnQ==", + "dev": true, + "requires": { + "rc": "^1.1.6", + "safe-buffer": "^5.0.1" + } + }, + "registry-url": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/registry-url/-/registry-url-3.1.0.tgz", + "integrity": "sha1-PU74cPc93h138M+aOBQyRE4XSUI=", + "dev": true, + "requires": { + "rc": "^1.0.1" + } + }, + "regjsgen": { + "version": "0.2.0", + "resolved": "http://registry.npmjs.org/regjsgen/-/regjsgen-0.2.0.tgz", + "integrity": "sha1-bAFq3qxVT3WCP+N6wFuS1aTtsfc=", + "dev": true + }, + "regjsparser": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.1.5.tgz", + "integrity": "sha1-fuj4Tcb6eS0/0K4ijSS9lJ6tIFw=", + "dev": true, + "requires": { + "jsesc": "~0.5.0" + } + }, + "release-zalgo": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/release-zalgo/-/release-zalgo-1.0.0.tgz", + "integrity": "sha1-CXALflB0Mpc5Mw5TXFqQ+2eFFzA=", + "dev": true, + "requires": { + "es6-error": "^4.0.1" + } + }, + "remove-trailing-separator": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz", + "integrity": "sha1-wkvOKig62tW8P1jg1IJJuSN52O8=", + "dev": true + }, + "repeat-element": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.3.tgz", + "integrity": "sha512-ahGq0ZnV5m5XtZLMb+vP76kcAM5nkLqk0lpqAuojSKGgQtn4eRi4ZZGm2olo2zKFH+sMsWaqOCW1dqAnOru72g==" + }, + "repeat-string": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", + "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=" + }, + "repeating": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/repeating/-/repeating-2.0.1.tgz", + "integrity": "sha1-UhTFOpJtNVJwdSf7q0FdvAjQbdo=", + "dev": true, + "requires": { + "is-finite": "^1.0.0" + } + }, + "request": { + "version": "2.88.0", + "resolved": "https://registry.npmjs.org/request/-/request-2.88.0.tgz", + "integrity": "sha512-NAqBSrijGLZdM0WZNsInLJpkJokL72XYjUpnB0iwsRgxh7dB6COrHnTBNwN0E+lHDAJzu7kLAkDeY08z2/A0hg==", + "dev": true, + "requires": { + "aws-sign2": "~0.7.0", + "aws4": "^1.8.0", + "caseless": "~0.12.0", + "combined-stream": "~1.0.6", + "extend": "~3.0.2", + "forever-agent": "~0.6.1", + "form-data": "~2.3.2", + "har-validator": "~5.1.0", + "http-signature": "~1.2.0", + "is-typedarray": "~1.0.0", + "isstream": "~0.1.2", + "json-stringify-safe": "~5.0.1", + "mime-types": "~2.1.19", + "oauth-sign": "~0.9.0", + "performance-now": "^2.1.0", + "qs": "~6.5.2", + "safe-buffer": "^5.1.2", + "tough-cookie": "~2.4.3", + "tunnel-agent": "^0.6.0", + "uuid": "^3.3.2" + } + }, + "require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", + "dev": true + }, + "require-main-filename": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-1.0.1.tgz", + "integrity": "sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE=", + "dev": true + }, + "require-precompiled": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/require-precompiled/-/require-precompiled-0.1.0.tgz", + "integrity": "sha1-WhtS63Dr7UPrmC6XTIWrWVceVvo=", + "dev": true + }, + "require-uncached": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/require-uncached/-/require-uncached-1.0.3.tgz", + "integrity": "sha1-Tg1W1slmL9MeQwEcS5WqSZVUIdM=", + "dev": true, + "requires": { + "caller-path": "^0.1.0", + "resolve-from": "^1.0.0" + }, + "dependencies": { + "resolve-from": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-1.0.1.tgz", + "integrity": "sha1-Jsv+k10a7uq7Kbw/5a6wHpPUQiY=", + "dev": true + } + } + }, + "requizzle": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/requizzle/-/requizzle-0.2.1.tgz", + "integrity": "sha1-aUPDUwxNmn5G8c3dUcFY/GcM294=", + "dev": true, + "requires": { + "underscore": "~1.6.0" + }, + "dependencies": { + "underscore": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.6.0.tgz", + "integrity": "sha1-izixDKze9jM3uLJOT/htRa6lKag=", + "dev": true + } + } + }, + "resolve": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.8.1.tgz", + "integrity": "sha512-AicPrAC7Qu1JxPCZ9ZgCZlY35QgFnNqc+0LtbRNxnVw4TXvjQ72wnuL9JQcEBgXkI9JM8MsT9kaQoHcpCRJOYA==", + "dev": true, + "requires": { + "path-parse": "^1.0.5" + } + }, + "resolve-cwd": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/resolve-cwd/-/resolve-cwd-2.0.0.tgz", + "integrity": "sha1-AKn3OHVW4nA46uIyyqNypqWbZlo=", + "dev": true, + "requires": { + "resolve-from": "^3.0.0" + } + }, + "resolve-from": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-3.0.0.tgz", + "integrity": "sha1-six699nWiBvItuZTM17rywoYh0g=", + "dev": true + }, + "resolve-url": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz", + "integrity": "sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=" + }, + "responselike": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/responselike/-/responselike-1.0.2.tgz", + "integrity": "sha1-kYcg7ztjHFZCvgaPFa3lpG9Loec=", + "dev": true, + "requires": { + "lowercase-keys": "^1.0.0" + } + }, + "restore-cursor": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-2.0.0.tgz", + "integrity": "sha1-n37ih/gv0ybU/RYpI9YhKe7g368=", + "dev": true, + "requires": { + "onetime": "^2.0.0", + "signal-exit": "^3.0.2" + } + }, + "ret": { + "version": "0.1.15", + "resolved": "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz", + "integrity": "sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==" + }, + "retry-axios": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/retry-axios/-/retry-axios-0.3.2.tgz", + "integrity": "sha512-jp4YlI0qyDFfXiXGhkCOliBN1G7fRH03Nqy8YdShzGqbY5/9S2x/IR6C88ls2DFkbWuL3ASkP7QD3pVrNpPgwQ==" + }, + "retry-request": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/retry-request/-/retry-request-4.0.0.tgz", + "integrity": "sha512-S4HNLaWcMP6r8E4TMH52Y7/pM8uNayOcTDDQNBwsCccL1uI+Ol2TljxRDPzaNfbhOB30+XWP5NnZkB3LiJxi1w==", + "requires": { + "through2": "^2.0.0" + } + }, + "right-align": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/right-align/-/right-align-0.1.3.tgz", + "integrity": "sha1-YTObci/mo1FWiSENJOFMlhSGE+8=", + "dev": true, + "optional": true, + "requires": { + "align-text": "^0.1.1" + } + }, + "rimraf": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.2.tgz", + "integrity": "sha512-lreewLK/BlghmxtfH36YYVg1i8IAce4TI7oao75I1g245+6BctqTVQiBP3YUJ9C6DQOXJmkYR9X9fCLtCOJc5w==", + "dev": true, + "requires": { + "glob": "^7.0.5" + } + }, + "run-async": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.3.0.tgz", + "integrity": "sha1-A3GrSuC91yDUFm19/aZP96RFpsA=", + "dev": true, + "requires": { + "is-promise": "^2.1.0" + } + }, + "rxjs": { + "version": "6.3.3", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.3.3.tgz", + "integrity": "sha512-JTWmoY9tWCs7zvIk/CvRjhjGaOd+OVBM987mxFo+OW66cGpdKjZcpmc74ES1sB//7Kl/PAe8+wEakuhG4pcgOw==", + "dev": true, + "requires": { + "tslib": "^1.9.0" + } + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + }, + "safe-regex": { + "version": "1.1.0", + "resolved": "http://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz", + "integrity": "sha1-QKNmnzsHfR6UPURinhV91IAjvy4=", + "requires": { + "ret": "~0.1.10" + } + }, + "safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "dev": true + }, + "samsam": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/samsam/-/samsam-1.3.0.tgz", + "integrity": "sha512-1HwIYD/8UlOtFS3QO3w7ey+SdSDFE4HRNLZoZRYVQefrOY3l17epswImeB1ijgJFQJodIaHcwkp3r/myBjFVbg==", + "dev": true + }, + "sanitize-html": { + "version": "1.19.1", + "resolved": "https://registry.npmjs.org/sanitize-html/-/sanitize-html-1.19.1.tgz", + "integrity": "sha512-zNYr6FvBn4bZukr9x2uny6od/9YdjCLwF+FqxivqI0YOt/m9GIxfX+tWhm52tBAPUXiTTb4bJTGVagRz5b06bw==", + "dev": true, + "requires": { + "chalk": "^2.3.0", + "htmlparser2": "^3.9.0", + "lodash.clonedeep": "^4.5.0", + "lodash.escaperegexp": "^4.1.2", + "lodash.isplainobject": "^4.0.6", + "lodash.isstring": "^4.0.1", + "lodash.mergewith": "^4.6.0", + "postcss": "^6.0.14", + "srcset": "^1.0.0", + "xtend": "^4.0.0" + } + }, + "semver": { + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.6.0.tgz", + "integrity": "sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg==" + }, + "semver-diff": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/semver-diff/-/semver-diff-2.1.0.tgz", + "integrity": "sha1-S7uEN8jTfksM8aaP1ybsbWRdbTY=", + "dev": true, + "requires": { + "semver": "^5.0.3" + } + }, + "serialize-error": { + "version": "2.1.0", + "resolved": "http://registry.npmjs.org/serialize-error/-/serialize-error-2.1.0.tgz", + "integrity": "sha1-ULZ51WNc34Rme9yOWa9OW4HV9go=", + "dev": true + }, + "set-blocking": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", + "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", + "dev": true + }, + "set-value": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.0.tgz", + "integrity": "sha512-hw0yxk9GT/Hr5yJEYnHNKYXkIA8mVJgd9ditYZCe16ZczcaELYYcfvaXesNACk2O8O0nTiPQcQhGUQj8JLzeeg==", + "requires": { + "extend-shallow": "^2.0.1", + "is-extendable": "^0.1.1", + "is-plain-object": "^2.0.3", + "split-string": "^3.0.1" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "shebang-command": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", + "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", + "dev": true, + "requires": { + "shebang-regex": "^1.0.0" + } + }, + "shebang-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", + "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", + "dev": true + }, + "signal-exit": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", + "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", + "dev": true + }, + "sinon": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/sinon/-/sinon-6.0.1.tgz", + "integrity": "sha512-rfszhNcfamK2+ofIPi9XqeH89pH7KGDcAtM+F9CsjHXOK3jzWG99vyhyD2V+r7s4IipmWcWUFYq4ftZ9/Eu2Wg==", + "dev": true, + "requires": { + "@sinonjs/formatio": "^2.0.0", + "diff": "^3.5.0", + "lodash.get": "^4.4.2", + "lolex": "^2.4.2", + "nise": "^1.3.3", + "supports-color": "^5.4.0", + "type-detect": "^4.0.8" + } + }, + "slash": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-1.0.0.tgz", + "integrity": "sha1-xB8vbDn8FtHNF61LXYlhFK5HDVU=" + }, + "slice-ansi": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-1.0.0.tgz", + "integrity": "sha512-POqxBK6Lb3q6s047D/XsDVNPnF9Dl8JSaqe9h9lURl0OdNqy/ujDrOiIHtsqXMGbWWTIomRzAMaTyawAU//Reg==", + "dev": true, + "requires": { + "is-fullwidth-code-point": "^2.0.0" + }, + "dependencies": { + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true + } + } + }, + "slide": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/slide/-/slide-1.1.6.tgz", + "integrity": "sha1-VusCfWW00tzmyy4tMsTUr8nh1wc=", + "dev": true + }, + "snapdragon": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.2.tgz", + "integrity": "sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg==", + "requires": { + "base": "^0.11.1", + "debug": "^2.2.0", + "define-property": "^0.2.5", + "extend-shallow": "^2.0.1", + "map-cache": "^0.2.2", + "source-map": "^0.5.6", + "source-map-resolve": "^0.5.0", + "use": "^3.1.0" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "requires": { + "is-descriptor": "^0.1.0" + } + }, + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "snapdragon-node": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/snapdragon-node/-/snapdragon-node-2.1.1.tgz", + "integrity": "sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw==", + "requires": { + "define-property": "^1.0.0", + "isobject": "^3.0.0", + "snapdragon-util": "^3.0.1" + }, + "dependencies": { + "define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "requires": { + "is-descriptor": "^1.0.0" + } + }, + "is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "requires": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + } + } + } + }, + "snapdragon-util": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/snapdragon-util/-/snapdragon-util-3.0.1.tgz", + "integrity": "sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ==", + "requires": { + "kind-of": "^3.2.0" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "sort-keys": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/sort-keys/-/sort-keys-2.0.0.tgz", + "integrity": "sha1-ZYU1WEhh7JfXMNbPQYIuH1ZoQSg=", + "dev": true, + "requires": { + "is-plain-obj": "^1.0.0" + } + }, + "source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=" + }, + "source-map-resolve": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.5.2.tgz", + "integrity": "sha512-MjqsvNwyz1s0k81Goz/9vRBe9SZdB09Bdw+/zYyO+3CuPk6fouTaxscHkgtE8jKvf01kVfl8riHzERQ/kefaSA==", + "requires": { + "atob": "^2.1.1", + "decode-uri-component": "^0.2.0", + "resolve-url": "^0.2.1", + "source-map-url": "^0.4.0", + "urix": "^0.1.0" + } + }, + "source-map-support": { + "version": "0.5.9", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.9.tgz", + "integrity": "sha512-gR6Rw4MvUlYy83vP0vxoVNzM6t8MUXqNuRsuBmBHQDu1Fh6X015FrLdgoDKcNdkwGubozq0P4N0Q37UyFVr1EA==", + "dev": true, + "requires": { + "buffer-from": "^1.0.0", + "source-map": "^0.6.0" + }, + "dependencies": { + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + } + } + }, + "source-map-url": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/source-map-url/-/source-map-url-0.4.0.tgz", + "integrity": "sha1-PpNdfd1zYxuXZZlW1VEo6HtQhKM=" + }, + "spdx-correct": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.0.2.tgz", + "integrity": "sha512-q9hedtzyXHr5S0A1vEPoK/7l8NpfkFYTq6iCY+Pno2ZbdZR6WexZFtqeVGkGxW3TEJMN914Z55EnAGMmenlIQQ==", + "dev": true, + "requires": { + "spdx-expression-parse": "^3.0.0", + "spdx-license-ids": "^3.0.0" + } + }, + "spdx-exceptions": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.2.0.tgz", + "integrity": "sha512-2XQACfElKi9SlVb1CYadKDXvoajPgBVPn/gOQLrTvHdElaVhr7ZEbqJaRnJLVNeaI4cMEAgVCeBMKF6MWRDCRA==", + "dev": true + }, + "spdx-expression-parse": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.0.tgz", + "integrity": "sha512-Yg6D3XpRD4kkOmTpdgbUiEJFKghJH03fiC1OPll5h/0sO6neh2jqRDVHOQ4o/LMea0tgCkbMgea5ip/e+MkWyg==", + "dev": true, + "requires": { + "spdx-exceptions": "^2.1.0", + "spdx-license-ids": "^3.0.0" + } + }, + "spdx-license-ids": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.2.tgz", + "integrity": "sha512-qky9CVt0lVIECkEsYbNILVnPvycuEBkXoMFLRWsREkomQLevYhtRKC+R91a5TOAQ3bCMjikRwhyaRqj1VYatYg==", + "dev": true + }, + "split-string": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/split-string/-/split-string-3.1.0.tgz", + "integrity": "sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw==", + "requires": { + "extend-shallow": "^3.0.0" + } + }, + "sprintf-js": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", + "dev": true + }, + "srcset": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/srcset/-/srcset-1.0.0.tgz", + "integrity": "sha1-pWad4StC87HV6D7QPHEEb8SPQe8=", + "dev": true, + "requires": { + "array-uniq": "^1.0.2", + "number-is-nan": "^1.0.0" + } + }, + "sshpk": { + "version": "1.15.2", + "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.15.2.tgz", + "integrity": "sha512-Ra/OXQtuh0/enyl4ETZAfTaeksa6BXks5ZcjpSUNrjBr0DvrJKX+1fsKDPpT9TBXgHAFsa4510aNVgI8g/+SzA==", + "dev": true, + "requires": { + "asn1": "~0.2.3", + "assert-plus": "^1.0.0", + "bcrypt-pbkdf": "^1.0.0", + "dashdash": "^1.12.0", + "ecc-jsbn": "~0.1.1", + "getpass": "^0.1.1", + "jsbn": "~0.1.0", + "safer-buffer": "^2.0.2", + "tweetnacl": "~0.14.0" + } + }, + "stack-utils": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/stack-utils/-/stack-utils-1.0.1.tgz", + "integrity": "sha1-1PM6tU6OOHeLDKXP07OvsS22hiA=", + "dev": true + }, + "static-extend": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/static-extend/-/static-extend-0.1.2.tgz", + "integrity": "sha1-YICcOcv/VTNyJv1eC1IPNB8ftcY=", + "requires": { + "define-property": "^0.2.5", + "object-copy": "^0.1.0" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "requires": { + "is-descriptor": "^0.1.0" + } + } + } + }, + "stream-shift": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/stream-shift/-/stream-shift-1.0.0.tgz", + "integrity": "sha1-1cdSgl5TZ+eG944Y5EXqIjoVWVI=" + }, + "strict-uri-encode": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/strict-uri-encode/-/strict-uri-encode-1.1.0.tgz", + "integrity": "sha1-J5siXfHVgrH1TmWt3UNS4Y+qBxM=", + "dev": true + }, + "string-width": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", + "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", + "requires": { + "code-point-at": "^1.0.0", + "is-fullwidth-code-point": "^1.0.0", + "strip-ansi": "^3.0.0" + } + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "requires": { + "safe-buffer": "~5.1.0" + } + }, + "stringifier": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/stringifier/-/stringifier-1.4.0.tgz", + "integrity": "sha512-cNsMOqqrcbLcHTXEVmkw9y0fwDwkdgtZwlfyolzpQDoAE1xdNGhQhxBUfiDvvZIKl1hnUEgMv66nHwtMz3OjPw==", + "requires": { + "core-js": "^2.0.0", + "traverse": "^0.6.6", + "type-name": "^2.0.1" + } + }, + "strip-ansi": { + "version": "3.0.1", + "resolved": "http://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "requires": { + "ansi-regex": "^2.0.0" + } + }, + "strip-bom": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=", + "dev": true + }, + "strip-bom-buf": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/strip-bom-buf/-/strip-bom-buf-1.0.0.tgz", + "integrity": "sha1-HLRar1dTD0yvhsf3UXnSyaUd1XI=", + "dev": true, + "requires": { + "is-utf8": "^0.2.1" + } + }, + "strip-eof": { + "version": "1.0.0", + "resolved": "http://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz", + "integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=", + "dev": true + }, + "strip-indent": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-1.0.1.tgz", + "integrity": "sha1-DHlipq3vp7vUrDZkYKY4VSrhoKI=", + "dev": true, + "requires": { + "get-stdin": "^4.0.1" + } + }, + "strip-json-comments": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", + "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", + "dev": true + }, + "superagent": { + "version": "3.8.3", + "resolved": "https://registry.npmjs.org/superagent/-/superagent-3.8.3.tgz", + "integrity": "sha512-GLQtLMCoEIK4eDv6OGtkOoSMt3D+oq0y3dsxMuYuDvaNUvuT8eFBuLmfR0iYYzHC1e8hpzC6ZsxbuP6DIalMFA==", + "dev": true, + "requires": { + "component-emitter": "^1.2.0", + "cookiejar": "^2.1.0", + "debug": "^3.1.0", + "extend": "^3.0.0", + "form-data": "^2.3.1", + "formidable": "^1.2.0", + "methods": "^1.1.1", + "mime": "^1.4.1", + "qs": "^6.5.1", + "readable-stream": "^2.3.5" + }, + "dependencies": { + "debug": { + "version": "3.2.6", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", + "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + }, + "mime": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", + "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==", + "dev": true + }, + "ms": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", + "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", + "dev": true + } + } + }, + "supertap": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/supertap/-/supertap-1.0.0.tgz", + "integrity": "sha512-HZJ3geIMPgVwKk2VsmO5YHqnnJYl6bV5A9JW2uzqV43WmpgliNEYbuvukfor7URpaqpxuw3CfZ3ONdVbZjCgIA==", + "dev": true, + "requires": { + "arrify": "^1.0.1", + "indent-string": "^3.2.0", + "js-yaml": "^3.10.0", + "serialize-error": "^2.1.0", + "strip-ansi": "^4.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "dev": true + }, + "strip-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "dev": true, + "requires": { + "ansi-regex": "^3.0.0" + } + } + } + }, + "supertest": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/supertest/-/supertest-3.3.0.tgz", + "integrity": "sha512-dMQSzYdaZRSANH5LL8kX3UpgK9G1LRh/jnggs/TI0W2Sz7rkMx9Y48uia3K9NgcaWEV28tYkBnXE4tiFC77ygQ==", + "dev": true, + "requires": { + "methods": "^1.1.2", + "superagent": "^3.8.3" + } + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + }, + "dependencies": { + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + } + } + }, + "symbol-observable": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/symbol-observable/-/symbol-observable-1.2.0.tgz", + "integrity": "sha512-e900nM8RRtGhlV36KGEU9k65K3mPb1WV70OdjfxlG2EAuM1noi/E/BaW/uMhL7bPEssK8QV57vN3esixjUvcXQ==", + "dev": true + }, + "table": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/table/-/table-5.1.0.tgz", + "integrity": "sha512-e542in22ZLhD/fOIuXs/8yDZ9W61ltF8daM88rkRNtgTIct+vI2fTnAyu/Db2TCfEcI8i7mjZz6meLq0nW7TYg==", + "dev": true, + "requires": { + "ajv": "^6.5.3", + "lodash": "^4.17.10", + "slice-ansi": "1.0.0", + "string-width": "^2.1.1" + }, + "dependencies": { + "ajv": { + "version": "6.5.5", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.5.5.tgz", + "integrity": "sha512-7q7gtRQDJSyuEHjuVgHoUa2VuemFiCMrfQc9Tc08XTAc4Zj/5U1buQJ0HU6i7fKjXU09SVgSmxa4sLvuvS8Iyg==", + "dev": true, + "requires": { + "fast-deep-equal": "^2.0.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + } + }, + "ansi-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "dev": true + }, + "fast-deep-equal": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz", + "integrity": "sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk=", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true + }, + "json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true + }, + "string-width": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", + "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "dev": true, + "requires": { + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^4.0.0" + } + }, + "strip-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "dev": true, + "requires": { + "ansi-regex": "^3.0.0" + } + } + } + }, + "taffydb": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/taffydb/-/taffydb-2.6.2.tgz", + "integrity": "sha1-fLy2S1oUG2ou/CxdLGe04VCyomg=", + "dev": true + }, + "term-size": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/term-size/-/term-size-1.2.0.tgz", + "integrity": "sha1-RYuDiH8oj8Vtb/+/rSYuJmOO+mk=", + "dev": true, + "requires": { + "execa": "^0.7.0" + } + }, + "text-encoding": { + "version": "0.6.4", + "resolved": "http://registry.npmjs.org/text-encoding/-/text-encoding-0.6.4.tgz", + "integrity": "sha1-45mpgiV6J22uQou5KEXLcb3CbRk=", + "dev": true + }, + "text-table": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", + "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=", + "dev": true + }, + "through": { + "version": "2.3.8", + "resolved": "http://registry.npmjs.org/through/-/through-2.3.8.tgz", + "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=", + "dev": true + }, + "through2": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.3.tgz", + "integrity": "sha1-AARWmzfHx0ujnEPzzteNGtlBQL4=", + "requires": { + "readable-stream": "^2.1.5", + "xtend": "~4.0.1" + } + }, + "time-zone": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/time-zone/-/time-zone-1.0.0.tgz", + "integrity": "sha1-mcW/VZWJZq9tBtg73zgA3IL67F0=", + "dev": true + }, + "timed-out": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/timed-out/-/timed-out-4.0.1.tgz", + "integrity": "sha1-8y6srFoXW+ol1/q1Zas+2HQe9W8=", + "dev": true + }, + "tmp": { + "version": "0.0.33", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", + "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", + "dev": true, + "requires": { + "os-tmpdir": "~1.0.2" + } + }, + "to-fast-properties": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-1.0.3.tgz", + "integrity": "sha1-uDVx+k2MJbguIxsG46MFXeTKGkc=", + "dev": true + }, + "to-object-path": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/to-object-path/-/to-object-path-0.3.0.tgz", + "integrity": "sha1-KXWIt7Dn4KwI4E5nL4XB9JmeF68=", + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "to-regex": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/to-regex/-/to-regex-3.0.2.tgz", + "integrity": "sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw==", + "requires": { + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "regex-not": "^1.0.2", + "safe-regex": "^1.1.0" + } + }, + "to-regex-range": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz", + "integrity": "sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg=", + "requires": { + "is-number": "^3.0.0", + "repeat-string": "^1.6.1" + } + }, + "tough-cookie": { + "version": "2.4.3", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.4.3.tgz", + "integrity": "sha512-Q5srk/4vDM54WJsJio3XNn6K2sCG+CQ8G5Wz6bZhRZoAe/+TxjWB/GlFAnYEbkYVlON9FMk/fE3h2RLpPXo4lQ==", + "dev": true, + "requires": { + "psl": "^1.1.24", + "punycode": "^1.4.1" + } + }, + "traverse": { + "version": "0.6.6", + "resolved": "https://registry.npmjs.org/traverse/-/traverse-0.6.6.tgz", + "integrity": "sha1-y99WD9e5r2MlAv7UD5GMFX6pcTc=" + }, + "trim-newlines": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-1.0.0.tgz", + "integrity": "sha1-WIeWa7WCpFA6QetST301ARgVphM=", + "dev": true + }, + "trim-off-newlines": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/trim-off-newlines/-/trim-off-newlines-1.0.1.tgz", + "integrity": "sha1-n5up2e+odkw4dpi8v+sshI8RrbM=", + "dev": true + }, + "trim-right": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/trim-right/-/trim-right-1.0.1.tgz", + "integrity": "sha1-yy4SAwZ+DI3h9hQJS5/kVwTqYAM=", + "dev": true + }, + "tslib": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.9.3.tgz", + "integrity": "sha512-4krF8scpejhaOgqzBEcGM7yDIEfi0/8+8zDRZhNZZ2kjmHJ4hv3zCbQWxoJGz1iw5U0Jl0nma13xzHXcncMavQ==", + "dev": true + }, + "tunnel-agent": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", + "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", + "dev": true, + "requires": { + "safe-buffer": "^5.0.1" + } + }, + "tweetnacl": { + "version": "0.14.5", + "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", + "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=", + "dev": true + }, + "type-check": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", + "integrity": "sha1-WITKtRLPHTVeP7eE8wgEsrUg23I=", + "dev": true, + "requires": { + "prelude-ls": "~1.1.2" + } + }, + "type-detect": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", + "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", + "dev": true + }, + "type-name": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/type-name/-/type-name-2.0.2.tgz", + "integrity": "sha1-7+fUEj2KxSr/9/QMfk3sUmYAj7Q=" + }, + "uglify-js": { + "version": "2.8.29", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-2.8.29.tgz", + "integrity": "sha1-KcVzMUgFe7Th913zW3qcty5qWd0=", + "dev": true, + "optional": true, + "requires": { + "source-map": "~0.5.1", + "uglify-to-browserify": "~1.0.0", + "yargs": "~3.10.0" + }, + "dependencies": { + "camelcase": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-1.2.1.tgz", + "integrity": "sha1-m7UwTS4LVmmLLHWLCKPqqdqlijk=", + "dev": true, + "optional": true + }, + "cliui": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-2.1.0.tgz", + "integrity": "sha1-S0dXYP+AJkx2LDoXGQMukcf+oNE=", + "dev": true, + "optional": true, + "requires": { + "center-align": "^0.1.1", + "right-align": "^0.1.1", + "wordwrap": "0.0.2" + } + }, + "window-size": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/window-size/-/window-size-0.1.0.tgz", + "integrity": "sha1-VDjNLqk7IC76Ohn+iIeu58lPnJ0=", + "dev": true, + "optional": true + }, + "wordwrap": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.2.tgz", + "integrity": "sha1-t5Zpu0LstAn4PVg8rVLKF+qhZD8=", + "dev": true, + "optional": true + }, + "yargs": { + "version": "3.10.0", + "resolved": "http://registry.npmjs.org/yargs/-/yargs-3.10.0.tgz", + "integrity": "sha1-9+572FfdfB0tOMDnTvvWgdFDH9E=", + "dev": true, + "optional": true, + "requires": { + "camelcase": "^1.0.2", + "cliui": "^2.1.0", + "decamelize": "^1.0.0", + "window-size": "0.1.0" + } + } + } + }, + "uglify-to-browserify": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/uglify-to-browserify/-/uglify-to-browserify-1.0.2.tgz", + "integrity": "sha1-bgkk1r2mta/jSeOabWMoUKD4grc=", + "dev": true, + "optional": true + }, + "uid2": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/uid2/-/uid2-0.0.3.tgz", + "integrity": "sha1-SDEm4Rd03y9xuLY53NeZw3YWK4I=", + "dev": true + }, + "underscore": { + "version": "1.8.3", + "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.8.3.tgz", + "integrity": "sha1-Tz+1OxBuYJf8+ctBCfKl6b36UCI=", + "dev": true + }, + "underscore-contrib": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/underscore-contrib/-/underscore-contrib-0.3.0.tgz", + "integrity": "sha1-ZltmwkeD+PorGMn4y7Dix9SMJsc=", + "dev": true, + "requires": { + "underscore": "1.6.0" + }, + "dependencies": { + "underscore": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.6.0.tgz", + "integrity": "sha1-izixDKze9jM3uLJOT/htRa6lKag=", + "dev": true + } + } + }, + "union-value": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.0.tgz", + "integrity": "sha1-XHHDTLW61dzr4+oM0IIHulqhrqQ=", + "requires": { + "arr-union": "^3.1.0", + "get-value": "^2.0.6", + "is-extendable": "^0.1.1", + "set-value": "^0.4.3" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "requires": { + "is-extendable": "^0.1.0" + } + }, + "set-value": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/set-value/-/set-value-0.4.3.tgz", + "integrity": "sha1-fbCPnT0i3H945Trzw79GZuzfzPE=", + "requires": { + "extend-shallow": "^2.0.1", + "is-extendable": "^0.1.1", + "is-plain-object": "^2.0.1", + "to-object-path": "^0.3.0" + } + } + } + }, + "unique-string": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unique-string/-/unique-string-1.0.0.tgz", + "integrity": "sha1-nhBXzKhRq7kzmPizOuGHuZyuwRo=", + "dev": true, + "requires": { + "crypto-random-string": "^1.0.0" + } + }, + "unique-temp-dir": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unique-temp-dir/-/unique-temp-dir-1.0.0.tgz", + "integrity": "sha1-bc6VsmgcoAPuv7MEpBX5y6vMU4U=", + "dev": true, + "requires": { + "mkdirp": "^0.5.1", + "os-tmpdir": "^1.0.1", + "uid2": "0.0.3" + } + }, + "universal-deep-strict-equal": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/universal-deep-strict-equal/-/universal-deep-strict-equal-1.2.2.tgz", + "integrity": "sha1-DaSsL3PP95JMgfpN4BjKViyisKc=", + "requires": { + "array-filter": "^1.0.0", + "indexof": "0.0.1", + "object-keys": "^1.0.0" + } + }, + "universalify": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", + "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", + "dev": true + }, + "unset-value": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unset-value/-/unset-value-1.0.0.tgz", + "integrity": "sha1-g3aHP30jNRef+x5vw6jtDfyKtVk=", + "requires": { + "has-value": "^0.3.1", + "isobject": "^3.0.0" + }, + "dependencies": { + "has-value": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/has-value/-/has-value-0.3.1.tgz", + "integrity": "sha1-ex9YutpiyoJ+wKIHgCVlSEWZXh8=", + "requires": { + "get-value": "^2.0.3", + "has-values": "^0.1.4", + "isobject": "^2.0.0" + }, + "dependencies": { + "isobject": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", + "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=", + "requires": { + "isarray": "1.0.0" + } + } + } + }, + "has-values": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/has-values/-/has-values-0.1.4.tgz", + "integrity": "sha1-bWHeldkd/Km5oCCJrThL/49it3E=" + } + } + }, + "unzip-response": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/unzip-response/-/unzip-response-2.0.1.tgz", + "integrity": "sha1-0vD3N9FrBhXnKmk17QQhRXLVb5c=", + "dev": true + }, + "update-notifier": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/update-notifier/-/update-notifier-2.5.0.tgz", + "integrity": "sha512-gwMdhgJHGuj/+wHJJs9e6PcCszpxR1b236igrOkUofGhqJuG+amlIKwApH1IW1WWl7ovZxsX49lMBWLxSdm5Dw==", + "dev": true, + "requires": { + "boxen": "^1.2.1", + "chalk": "^2.0.1", + "configstore": "^3.0.0", + "import-lazy": "^2.1.0", + "is-ci": "^1.0.10", + "is-installed-globally": "^0.1.0", + "is-npm": "^1.0.0", + "latest-version": "^3.0.0", + "semver-diff": "^2.0.0", + "xdg-basedir": "^3.0.0" + } + }, + "uri-js": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.2.2.tgz", + "integrity": "sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ==", + "dev": true, + "requires": { + "punycode": "^2.1.0" + }, + "dependencies": { + "punycode": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", + "dev": true + } + } + }, + "urix": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/urix/-/urix-0.1.0.tgz", + "integrity": "sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI=" + }, + "url-parse-lax": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/url-parse-lax/-/url-parse-lax-1.0.0.tgz", + "integrity": "sha1-evjzA2Rem9eaJy56FKxovAYJ2nM=", + "dev": true, + "requires": { + "prepend-http": "^1.0.1" + } + }, + "url-to-options": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/url-to-options/-/url-to-options-1.0.1.tgz", + "integrity": "sha1-FQWgOiiaSMvXpDTvuu7FBV9WM6k=", + "dev": true + }, + "urlgrey": { + "version": "0.4.4", + "resolved": "https://registry.npmjs.org/urlgrey/-/urlgrey-0.4.4.tgz", + "integrity": "sha1-iS/pWWCAXoVRnxzUOJ8stMu3ZS8=", + "dev": true + }, + "use": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/use/-/use-3.1.1.tgz", + "integrity": "sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ==" + }, + "util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" + }, + "uuid": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.2.tgz", + "integrity": "sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA==", + "dev": true + }, + "validate-npm-package-license": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", + "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", + "dev": true, + "requires": { + "spdx-correct": "^3.0.0", + "spdx-expression-parse": "^3.0.0" + } + }, + "verror": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", + "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", + "dev": true, + "requires": { + "assert-plus": "^1.0.0", + "core-util-is": "1.0.2", + "extsprintf": "^1.2.0" + } + }, + "well-known-symbols": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/well-known-symbols/-/well-known-symbols-1.0.0.tgz", + "integrity": "sha1-c8eK6Bp3Jqj6WY4ogIAcixYiVRg=", + "dev": true + }, + "which": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "dev": true, + "requires": { + "isexe": "^2.0.0" + } + }, + "which-module": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", + "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=", + "dev": true + }, + "widest-line": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/widest-line/-/widest-line-2.0.1.tgz", + "integrity": "sha512-Ba5m9/Fa4Xt9eb2ELXt77JxVDV8w7qQrH0zS/TWSJdLyAwQjWoOzpzj5lwVftDz6n/EOu3tNACS84v509qwnJA==", + "dev": true, + "requires": { + "string-width": "^2.1.1" + }, + "dependencies": { + "ansi-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true + }, + "string-width": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", + "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "dev": true, + "requires": { + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^4.0.0" + } + }, + "strip-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "dev": true, + "requires": { + "ansi-regex": "^3.0.0" + } + } + } + }, + "window-size": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/window-size/-/window-size-0.1.4.tgz", + "integrity": "sha1-+OGqHuWlPsW/FR/6CXQqatdpeHY=" + }, + "wordwrap": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.3.tgz", + "integrity": "sha1-o9XabNXAvAAI03I0u68b7WMFkQc=", + "dev": true + }, + "wrap-ansi": { + "version": "2.1.0", + "resolved": "http://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz", + "integrity": "sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU=", + "requires": { + "string-width": "^1.0.1", + "strip-ansi": "^3.0.1" + } + }, + "wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" + }, + "write": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/write/-/write-0.2.1.tgz", + "integrity": "sha1-X8A4KOJkzqP+kUVUdvejxWbLB1c=", + "dev": true, + "requires": { + "mkdirp": "^0.5.1" + } + }, + "write-file-atomic": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-2.3.0.tgz", + "integrity": "sha512-xuPeK4OdjWqtfi59ylvVL0Yn35SF3zgcAcv7rBPFHVaEapaDr4GdGgm3j7ckTwH9wHL7fGmgfAnb0+THrHb8tA==", + "dev": true, + "requires": { + "graceful-fs": "^4.1.11", + "imurmurhash": "^0.1.4", + "signal-exit": "^3.0.2" + } + }, + "write-json-file": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/write-json-file/-/write-json-file-2.3.0.tgz", + "integrity": "sha1-K2TIozAE1UuGmMdtWFp3zrYdoy8=", + "dev": true, + "requires": { + "detect-indent": "^5.0.0", + "graceful-fs": "^4.1.2", + "make-dir": "^1.0.0", + "pify": "^3.0.0", + "sort-keys": "^2.0.0", + "write-file-atomic": "^2.0.0" + }, + "dependencies": { + "detect-indent": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/detect-indent/-/detect-indent-5.0.0.tgz", + "integrity": "sha1-OHHMCmoALow+Wzz38zYmRnXwa50=", + "dev": true + } + } + }, + "write-pkg": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/write-pkg/-/write-pkg-3.2.0.tgz", + "integrity": "sha512-tX2ifZ0YqEFOF1wjRW2Pk93NLsj02+n1UP5RvO6rCs0K6R2g1padvf006cY74PQJKMGS2r42NK7FD0dG6Y6paw==", + "dev": true, + "requires": { + "sort-keys": "^2.0.0", + "write-json-file": "^2.2.0" + } + }, + "xdg-basedir": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/xdg-basedir/-/xdg-basedir-3.0.0.tgz", + "integrity": "sha1-SWsswQnsqNus/i3HK2A8F8WHCtQ=", + "dev": true + }, + "xmlcreate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/xmlcreate/-/xmlcreate-1.0.2.tgz", + "integrity": "sha1-+mv3YqYKQT+z3Y9LA8WyaSONMI8=", + "dev": true + }, + "xregexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/xregexp/-/xregexp-4.0.0.tgz", + "integrity": "sha512-PHyM+sQouu7xspQQwELlGwwd05mXUFqwFYfqPO0cC7x4fxyHnnuetmQr6CjJiafIDoH4MogHb9dOoJzR/Y4rFg==", + "dev": true + }, + "xtend": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz", + "integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68=" + }, + "y18n": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-3.2.1.tgz", + "integrity": "sha1-bRX7qITAhnnA136I53WegR4H+kE=" + }, + "yallist": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz", + "integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=" + }, + "yargs": { + "version": "3.32.0", + "resolved": "http://registry.npmjs.org/yargs/-/yargs-3.32.0.tgz", + "integrity": "sha1-AwiOnr+edWtpdRYR0qXvWRSCyZU=", + "requires": { + "camelcase": "^2.0.1", + "cliui": "^3.0.3", + "decamelize": "^1.1.1", + "os-locale": "^1.4.0", + "string-width": "^1.0.1", + "window-size": "^0.1.4", + "y18n": "^3.2.0" + } + }, + "yargs-parser": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-10.1.0.tgz", + "integrity": "sha512-VCIyR1wJoEBZUqk5PA+oOBF6ypbwh5aNB3I50guxAL/quggdfs4TtNHQrSazFA3fYZ+tEqfs0zIGlv0c/rgjbQ==", + "dev": true, + "requires": { + "camelcase": "^4.1.0" + }, + "dependencies": { + "camelcase": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz", + "integrity": "sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0=", + "dev": true + } + } + } + } +} diff --git a/packages/google-cloud-securitycenter/samples/.eslintrc.yml b/packages/google-cloud-securitycenter/samples/.eslintrc.yml new file mode 100644 index 00000000000..282535f55f6 --- /dev/null +++ b/packages/google-cloud-securitycenter/samples/.eslintrc.yml @@ -0,0 +1,3 @@ +--- +rules: + no-console: off diff --git a/packages/google-cloud-securitycenter/samples/quickstart.js b/packages/google-cloud-securitycenter/samples/quickstart.js new file mode 100644 index 00000000000..50faad3a91c --- /dev/null +++ b/packages/google-cloud-securitycenter/samples/quickstart.js @@ -0,0 +1,21 @@ +/** + * Copyright 2018, Google, LLC. + * Licensed under the Apache License, Version 2.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'; + +// [START securitycenter_quickstart] +// Imports the Google Cloud client library +const sc = require('@google-cloud/securitycenter'); +// [END securitycenter_quickstart] diff --git a/packages/google-cloud-securitycenter/src/index.js b/packages/google-cloud-securitycenter/src/index.js index d921fe2c193..d5a3c9e3946 100644 --- a/packages/google-cloud-securitycenter/src/index.js +++ b/packages/google-cloud-securitycenter/src/index.js @@ -25,11 +25,11 @@ * @namespace google.cloud.securitycenter.v1beta1 */ -"use strict"; +'use strict'; // Import the clients for each version supported by this package. const gapic = Object.freeze({ - v1beta1: require("./v1beta1") + v1beta1: require('./v1beta1'), }); /** diff --git a/packages/google-cloud-securitycenter/src/v1beta1/index.js b/packages/google-cloud-securitycenter/src/v1beta1/index.js index 2577d795a82..d70ac5ef7ef 100644 --- a/packages/google-cloud-securitycenter/src/v1beta1/index.js +++ b/packages/google-cloud-securitycenter/src/v1beta1/index.js @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -"use strict"; +'use strict'; -const SecurityCenterClient = require("./security_center_client"); +const SecurityCenterClient = require('./security_center_client'); module.exports.SecurityCenterClient = SecurityCenterClient; diff --git a/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.js b/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.js index ac54f838c13..f262231163d 100644 --- a/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.js +++ b/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.js @@ -12,15 +12,15 @@ // See the License for the specific language governing permissions and // limitations under the License. -"use strict"; +'use strict'; -const gapicConfig = require("./security_center_client_config"); -const gax = require("google-gax"); -const merge = require("lodash.merge"); -const path = require("path"); -const protobuf = require("protobufjs"); +const gapicConfig = require('./security_center_client_config'); +const gax = require('google-gax'); +const merge = require('lodash.merge'); +const path = require('path'); +const protobuf = require('protobufjs'); -const VERSION = require("../../package.json").version; +const VERSION = require('../../package.json').version; /** * V1 Beta APIs for Security Center service. @@ -64,7 +64,7 @@ class SecurityCenterClient { { clientConfig: {}, port: this.constructor.port, - servicePath: this.constructor.servicePath + servicePath: this.constructor.servicePath, }, opts ); @@ -82,7 +82,7 @@ class SecurityCenterClient { `gl-node/${process.version}`, `grpc/${gaxGrpc.grpcVersion}`, `gax/${gax.version}`, - `gapic/${VERSION}` + `gapic/${VERSION}`, ]; if (opts.libName && opts.libVersion) { clientHeader.push(`${opts.libName}/${opts.libVersion}`); @@ -92,8 +92,8 @@ class SecurityCenterClient { const protos = merge( {}, gaxGrpc.loadProto( - path.join(__dirname, "..", "..", "protos"), - "google/cloud/securitycenter/v1beta1/securitycenter_service.proto" + path.join(__dirname, '..', '..', 'protos'), + 'google/cloud/securitycenter/v1beta1/securitycenter_service.proto' ) ); @@ -102,20 +102,20 @@ class SecurityCenterClient { // Create useful helper objects for these. this._pathTemplates = { organizationPathTemplate: new gax.PathTemplate( - "organizations/{organization}" + 'organizations/{organization}' ), sourcePathTemplate: new gax.PathTemplate( - "organizations/{organization}/sources/{source}" + 'organizations/{organization}/sources/{source}' ), organizationSettingsPathTemplate: new gax.PathTemplate( - "organizations/{organization}/organizationSettings" + 'organizations/{organization}/organizationSettings' ), findingPathTemplate: new gax.PathTemplate( - "organizations/{organization}/sources/{source}/findings/{finding}" + 'organizations/{organization}/sources/{source}/findings/{finding}' ), assetSecurityMarksPathTemplate: new gax.PathTemplate( - "organizations/{organization}/assets/{asset}/securityMarks" - ) + 'organizations/{organization}/assets/{asset}/securityMarks' + ), }; // Some of the methods on this service return "paged" results, @@ -123,39 +123,39 @@ class SecurityCenterClient { // pages). Denote the keys used for pagination and results. this._descriptors.page = { groupAssets: new gax.PageDescriptor( - "pageToken", - "nextPageToken", - "groupByResults" + 'pageToken', + 'nextPageToken', + 'groupByResults' ), groupFindings: new gax.PageDescriptor( - "pageToken", - "nextPageToken", - "groupByResults" + 'pageToken', + 'nextPageToken', + 'groupByResults' ), listAssets: new gax.PageDescriptor( - "pageToken", - "nextPageToken", - "listAssetsResults" + 'pageToken', + 'nextPageToken', + 'listAssetsResults' ), listFindings: new gax.PageDescriptor( - "pageToken", - "nextPageToken", - "findings" + 'pageToken', + 'nextPageToken', + 'findings' ), listSources: new gax.PageDescriptor( - "pageToken", - "nextPageToken", - "sources" - ) + 'pageToken', + 'nextPageToken', + 'sources' + ), }; let protoFilesRoot = new gax.GoogleProtoFilesRoot(); protoFilesRoot = protobuf.loadSync( path.join( __dirname, - "..", - "..", - "protos", - "google/cloud/securitycenter/v1beta1/securitycenter_service.proto" + '..', + '..', + 'protos', + 'google/cloud/securitycenter/v1beta1/securitycenter_service.proto' ), protoFilesRoot ); @@ -165,14 +165,14 @@ class SecurityCenterClient { // rather than holding a request open. this.operationsClient = new gax.lro({ auth: gaxGrpc.auth, - grpc: gaxGrpc.grpc + grpc: gaxGrpc.grpc, }).operationsClient(opts); const runAssetDiscoveryResponse = protoFilesRoot.lookup( - "google.protobuf.Empty" + 'google.protobuf.Empty' ); const runAssetDiscoveryMetadata = protoFilesRoot.lookup( - "google.protobuf.Empty" + 'google.protobuf.Empty' ); this._descriptors.longrunning = { @@ -180,15 +180,15 @@ class SecurityCenterClient { this.operationsClient, runAssetDiscoveryResponse.decode.bind(runAssetDiscoveryResponse), runAssetDiscoveryMetadata.decode.bind(runAssetDiscoveryMetadata) - ) + ), }; // Put together the default options sent with requests. const defaults = gaxGrpc.constructSettings( - "google.cloud.securitycenter.v1beta1.SecurityCenter", + 'google.cloud.securitycenter.v1beta1.SecurityCenter', gapicConfig, opts.clientConfig, - { "x-goog-api-client": clientHeader.join(" ") } + {'x-goog-api-client': clientHeader.join(' ')} ); // Set up a dictionary of "inner API calls"; the core implementation @@ -206,24 +206,24 @@ class SecurityCenterClient { // Iterate over each of the methods that the service provides // and create an API call method for each. const securityCenterStubMethods = [ - "createSource", - "createFinding", - "getIamPolicy", - "getOrganizationSettings", - "getSource", - "groupAssets", - "groupFindings", - "listAssets", - "listFindings", - "listSources", - "runAssetDiscovery", - "setFindingState", - "setIamPolicy", - "testIamPermissions", - "updateFinding", - "updateOrganizationSettings", - "updateSource", - "updateSecurityMarks" + 'createSource', + 'createFinding', + 'getIamPolicy', + 'getOrganizationSettings', + 'getSource', + 'groupAssets', + 'groupFindings', + 'listAssets', + 'listFindings', + 'listSources', + 'runAssetDiscovery', + 'setFindingState', + 'setIamPolicy', + 'testIamPermissions', + 'updateFinding', + 'updateOrganizationSettings', + 'updateSource', + 'updateSecurityMarks', ]; for (const methodName of securityCenterStubMethods) { this._innerApiCalls[methodName] = gax.createApiCall( @@ -245,7 +245,7 @@ class SecurityCenterClient { * The DNS address for this API service. */ static get servicePath() { - return "securitycenter.googleapis.com"; + return 'securitycenter.googleapis.com'; } /** @@ -260,7 +260,7 @@ class SecurityCenterClient { * in this service. */ static get scopes() { - return ["https://www.googleapis.com/auth/cloud-platform"]; + return ['https://www.googleapis.com/auth/cloud-platform']; } /** @@ -2351,7 +2351,7 @@ class SecurityCenterClient { */ organizationPath(organization) { return this._pathTemplates.organizationPathTemplate.render({ - organization: organization + organization: organization, }); } @@ -2365,7 +2365,7 @@ class SecurityCenterClient { sourcePath(organization, source) { return this._pathTemplates.sourcePathTemplate.render({ organization: organization, - source: source + source: source, }); } @@ -2377,7 +2377,7 @@ class SecurityCenterClient { */ organizationSettingsPath(organization) { return this._pathTemplates.organizationSettingsPathTemplate.render({ - organization: organization + organization: organization, }); } @@ -2393,7 +2393,7 @@ class SecurityCenterClient { return this._pathTemplates.findingPathTemplate.render({ organization: organization, source: source, - finding: finding + finding: finding, }); } @@ -2407,7 +2407,7 @@ class SecurityCenterClient { assetSecurityMarksPath(organization, asset) { return this._pathTemplates.assetSecurityMarksPathTemplate.render({ organization: organization, - asset: asset + asset: asset, }); } diff --git a/packages/google-cloud-securitycenter/synth.py b/packages/google-cloud-securitycenter/synth.py index 11783254aad..a0ef3c52fa7 100644 --- a/packages/google-cloud-securitycenter/synth.py +++ b/packages/google-cloud-securitycenter/synth.py @@ -38,4 +38,3 @@ ''' subprocess.run(['npm', 'install']) subprocess.run(['npm', 'run', 'prettier']) -subprocess.run(['npm', 'run', 'lint']) diff --git a/packages/google-cloud-securitycenter/system-test/.eslintrc.yml b/packages/google-cloud-securitycenter/system-test/.eslintrc.yml new file mode 100644 index 00000000000..2e6882e46d2 --- /dev/null +++ b/packages/google-cloud-securitycenter/system-test/.eslintrc.yml @@ -0,0 +1,6 @@ +--- +env: + mocha: true +rules: + node/no-unpublished-require: off + no-console: off diff --git a/packages/google-cloud-securitycenter/test/.eslintrc.yml b/packages/google-cloud-securitycenter/test/.eslintrc.yml new file mode 100644 index 00000000000..73f7bbc946f --- /dev/null +++ b/packages/google-cloud-securitycenter/test/.eslintrc.yml @@ -0,0 +1,5 @@ +--- +env: + mocha: true +rules: + node/no-unpublished-require: off diff --git a/packages/google-cloud-securitycenter/test/gapic-v1beta1.js b/packages/google-cloud-securitycenter/test/gapic-v1beta1.js index acf1a4bb851..f68fba672d3 100644 --- a/packages/google-cloud-securitycenter/test/gapic-v1beta1.js +++ b/packages/google-cloud-securitycenter/test/gapic-v1beta1.js @@ -12,40 +12,40 @@ // See the License for the specific language governing permissions and // limitations under the License. -"use strict"; +'use strict'; -const assert = require("assert"); +const assert = require('assert'); -const securitycenterModule = require("../src"); +const securitycenterModule = require('../src'); const FAKE_STATUS_CODE = 1; const error = new Error(); error.code = FAKE_STATUS_CODE; -describe("SecurityCenterClient", () => { - describe("createSource", () => { - it("invokes createSource without error", done => { +describe('SecurityCenterClient', () => { + describe('createSource', () => { + it('invokes createSource without error', done => { const client = new securitycenterModule.v1beta1.SecurityCenterClient({ - credentials: { client_email: "bogus", private_key: "bogus" }, - projectId: "bogus" + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', }); // Mock request - const formattedParent = client.organizationPath("[ORGANIZATION]"); + const formattedParent = client.organizationPath('[ORGANIZATION]'); const source = {}; const request = { parent: formattedParent, - source: source + source: source, }; // Mock response - const name = "name3373707"; - const displayName = "displayName1615086568"; - const description = "description-1724546052"; + const name = 'name3373707'; + const displayName = 'displayName1615086568'; + const description = 'description-1724546052'; const expectedResponse = { name: name, displayName: displayName, - description: description + description: description, }; // Mock Grpc layer @@ -61,18 +61,18 @@ describe("SecurityCenterClient", () => { }); }); - it("invokes createSource with error", done => { + it('invokes createSource with error', done => { const client = new securitycenterModule.v1beta1.SecurityCenterClient({ - credentials: { client_email: "bogus", private_key: "bogus" }, - projectId: "bogus" + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', }); // Mock request - const formattedParent = client.organizationPath("[ORGANIZATION]"); + const formattedParent = client.organizationPath('[ORGANIZATION]'); const source = {}; const request = { parent: formattedParent, - source: source + source: source, }; // Mock Grpc layer @@ -85,41 +85,41 @@ describe("SecurityCenterClient", () => { client.createSource(request, (err, response) => { assert(err instanceof Error); assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === "undefined"); + assert(typeof response === 'undefined'); done(); }); }); }); - describe("createFinding", () => { - it("invokes createFinding without error", done => { + describe('createFinding', () => { + it('invokes createFinding without error', done => { const client = new securitycenterModule.v1beta1.SecurityCenterClient({ - credentials: { client_email: "bogus", private_key: "bogus" }, - projectId: "bogus" + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', }); // Mock request - const formattedParent = client.sourcePath("[ORGANIZATION]", "[SOURCE]"); - const findingId = "findingId728776081"; + const formattedParent = client.sourcePath('[ORGANIZATION]', '[SOURCE]'); + const findingId = 'findingId728776081'; const finding = {}; const request = { parent: formattedParent, findingId: findingId, - finding: finding + finding: finding, }; // Mock response - const name = "name3373707"; - const parent2 = "parent21175163357"; - const resourceName = "resourceName979421212"; - const category = "category50511102"; - const externalUri = "externalUri-1385596168"; + const name = 'name3373707'; + const parent2 = 'parent21175163357'; + const resourceName = 'resourceName979421212'; + const category = 'category50511102'; + const externalUri = 'externalUri-1385596168'; const expectedResponse = { name: name, parent: parent2, resourceName: resourceName, category: category, - externalUri: externalUri + externalUri: externalUri, }; // Mock Grpc layer @@ -135,20 +135,20 @@ describe("SecurityCenterClient", () => { }); }); - it("invokes createFinding with error", done => { + it('invokes createFinding with error', done => { const client = new securitycenterModule.v1beta1.SecurityCenterClient({ - credentials: { client_email: "bogus", private_key: "bogus" }, - projectId: "bogus" + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', }); // Mock request - const formattedParent = client.sourcePath("[ORGANIZATION]", "[SOURCE]"); - const findingId = "findingId728776081"; + const formattedParent = client.sourcePath('[ORGANIZATION]', '[SOURCE]'); + const findingId = 'findingId728776081'; const finding = {}; const request = { parent: formattedParent, findingId: findingId, - finding: finding + finding: finding, }; // Mock Grpc layer @@ -161,31 +161,31 @@ describe("SecurityCenterClient", () => { client.createFinding(request, (err, response) => { assert(err instanceof Error); assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === "undefined"); + assert(typeof response === 'undefined'); done(); }); }); }); - describe("getIamPolicy", () => { - it("invokes getIamPolicy without error", done => { + describe('getIamPolicy', () => { + it('invokes getIamPolicy without error', done => { const client = new securitycenterModule.v1beta1.SecurityCenterClient({ - credentials: { client_email: "bogus", private_key: "bogus" }, - projectId: "bogus" + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', }); // Mock request - const formattedResource = client.sourcePath("[ORGANIZATION]", "[SOURCE]"); + const formattedResource = client.sourcePath('[ORGANIZATION]', '[SOURCE]'); const request = { - resource: formattedResource + resource: formattedResource, }; // Mock response const version = 351608024; - const etag = "21"; + const etag = '21'; const expectedResponse = { version: version, - etag: etag + etag: etag, }; // Mock Grpc layer @@ -201,16 +201,16 @@ describe("SecurityCenterClient", () => { }); }); - it("invokes getIamPolicy with error", done => { + it('invokes getIamPolicy with error', done => { const client = new securitycenterModule.v1beta1.SecurityCenterClient({ - credentials: { client_email: "bogus", private_key: "bogus" }, - projectId: "bogus" + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', }); // Mock request - const formattedResource = client.sourcePath("[ORGANIZATION]", "[SOURCE]"); + const formattedResource = client.sourcePath('[ORGANIZATION]', '[SOURCE]'); const request = { - resource: formattedResource + resource: formattedResource, }; // Mock Grpc layer @@ -223,31 +223,31 @@ describe("SecurityCenterClient", () => { client.getIamPolicy(request, (err, response) => { assert(err instanceof Error); assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === "undefined"); + assert(typeof response === 'undefined'); done(); }); }); }); - describe("getOrganizationSettings", () => { - it("invokes getOrganizationSettings without error", done => { + describe('getOrganizationSettings', () => { + it('invokes getOrganizationSettings without error', done => { const client = new securitycenterModule.v1beta1.SecurityCenterClient({ - credentials: { client_email: "bogus", private_key: "bogus" }, - projectId: "bogus" + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', }); // Mock request - const formattedName = client.organizationSettingsPath("[ORGANIZATION]"); + const formattedName = client.organizationSettingsPath('[ORGANIZATION]'); const request = { - name: formattedName + name: formattedName, }; // Mock response - const name2 = "name2-1052831874"; + const name2 = 'name2-1052831874'; const enableAssetDiscovery = false; const expectedResponse = { name: name2, - enableAssetDiscovery: enableAssetDiscovery + enableAssetDiscovery: enableAssetDiscovery, }; // Mock Grpc layer @@ -263,16 +263,16 @@ describe("SecurityCenterClient", () => { }); }); - it("invokes getOrganizationSettings with error", done => { + it('invokes getOrganizationSettings with error', done => { const client = new securitycenterModule.v1beta1.SecurityCenterClient({ - credentials: { client_email: "bogus", private_key: "bogus" }, - projectId: "bogus" + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', }); // Mock request - const formattedName = client.organizationSettingsPath("[ORGANIZATION]"); + const formattedName = client.organizationSettingsPath('[ORGANIZATION]'); const request = { - name: formattedName + name: formattedName, }; // Mock Grpc layer @@ -285,33 +285,33 @@ describe("SecurityCenterClient", () => { client.getOrganizationSettings(request, (err, response) => { assert(err instanceof Error); assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === "undefined"); + assert(typeof response === 'undefined'); done(); }); }); }); - describe("getSource", () => { - it("invokes getSource without error", done => { + describe('getSource', () => { + it('invokes getSource without error', done => { const client = new securitycenterModule.v1beta1.SecurityCenterClient({ - credentials: { client_email: "bogus", private_key: "bogus" }, - projectId: "bogus" + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', }); // Mock request - const formattedName = client.sourcePath("[ORGANIZATION]", "[SOURCE]"); + const formattedName = client.sourcePath('[ORGANIZATION]', '[SOURCE]'); const request = { - name: formattedName + name: formattedName, }; // Mock response - const name2 = "name2-1052831874"; - const displayName = "displayName1615086568"; - const description = "description-1724546052"; + const name2 = 'name2-1052831874'; + const displayName = 'displayName1615086568'; + const description = 'description-1724546052'; const expectedResponse = { name: name2, displayName: displayName, - description: description + description: description, }; // Mock Grpc layer @@ -327,16 +327,16 @@ describe("SecurityCenterClient", () => { }); }); - it("invokes getSource with error", done => { + it('invokes getSource with error', done => { const client = new securitycenterModule.v1beta1.SecurityCenterClient({ - credentials: { client_email: "bogus", private_key: "bogus" }, - projectId: "bogus" + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', }); // Mock request - const formattedName = client.sourcePath("[ORGANIZATION]", "[SOURCE]"); + const formattedName = client.sourcePath('[ORGANIZATION]', '[SOURCE]'); const request = { - name: formattedName + name: formattedName, }; // Mock Grpc layer @@ -349,34 +349,34 @@ describe("SecurityCenterClient", () => { client.getSource(request, (err, response) => { assert(err instanceof Error); assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === "undefined"); + assert(typeof response === 'undefined'); done(); }); }); }); - describe("groupAssets", () => { - it("invokes groupAssets without error", done => { + describe('groupAssets', () => { + it('invokes groupAssets without error', done => { const client = new securitycenterModule.v1beta1.SecurityCenterClient({ - credentials: { client_email: "bogus", private_key: "bogus" }, - projectId: "bogus" + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', }); // Mock request - const formattedParent = client.organizationPath("[ORGANIZATION]"); - const groupBy = "groupBy506361367"; + const formattedParent = client.organizationPath('[ORGANIZATION]'); + const groupBy = 'groupBy506361367'; const request = { parent: formattedParent, - groupBy: groupBy + groupBy: groupBy, }; // Mock response - const nextPageToken = ""; + const nextPageToken = ''; const groupByResultsElement = {}; const groupByResults = [groupByResultsElement]; const expectedResponse = { nextPageToken: nextPageToken, - groupByResults: groupByResults + groupByResults: groupByResults, }; // Mock Grpc layer @@ -396,18 +396,18 @@ describe("SecurityCenterClient", () => { }); }); - it("invokes groupAssets with error", done => { + it('invokes groupAssets with error', done => { const client = new securitycenterModule.v1beta1.SecurityCenterClient({ - credentials: { client_email: "bogus", private_key: "bogus" }, - projectId: "bogus" + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', }); // Mock request - const formattedParent = client.organizationPath("[ORGANIZATION]"); - const groupBy = "groupBy506361367"; + const formattedParent = client.organizationPath('[ORGANIZATION]'); + const groupBy = 'groupBy506361367'; const request = { parent: formattedParent, - groupBy: groupBy + groupBy: groupBy, }; // Mock Grpc layer @@ -420,34 +420,34 @@ describe("SecurityCenterClient", () => { client.groupAssets(request, (err, response) => { assert(err instanceof Error); assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === "undefined"); + assert(typeof response === 'undefined'); done(); }); }); }); - describe("groupFindings", () => { - it("invokes groupFindings without error", done => { + describe('groupFindings', () => { + it('invokes groupFindings without error', done => { const client = new securitycenterModule.v1beta1.SecurityCenterClient({ - credentials: { client_email: "bogus", private_key: "bogus" }, - projectId: "bogus" + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', }); // Mock request - const formattedParent = client.sourcePath("[ORGANIZATION]", "[SOURCE]"); - const groupBy = "groupBy506361367"; + const formattedParent = client.sourcePath('[ORGANIZATION]', '[SOURCE]'); + const groupBy = 'groupBy506361367'; const request = { parent: formattedParent, - groupBy: groupBy + groupBy: groupBy, }; // Mock response - const nextPageToken = ""; + const nextPageToken = ''; const groupByResultsElement = {}; const groupByResults = [groupByResultsElement]; const expectedResponse = { nextPageToken: nextPageToken, - groupByResults: groupByResults + groupByResults: groupByResults, }; // Mock Grpc layer @@ -467,18 +467,18 @@ describe("SecurityCenterClient", () => { }); }); - it("invokes groupFindings with error", done => { + it('invokes groupFindings with error', done => { const client = new securitycenterModule.v1beta1.SecurityCenterClient({ - credentials: { client_email: "bogus", private_key: "bogus" }, - projectId: "bogus" + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', }); // Mock request - const formattedParent = client.sourcePath("[ORGANIZATION]", "[SOURCE]"); - const groupBy = "groupBy506361367"; + const formattedParent = client.sourcePath('[ORGANIZATION]', '[SOURCE]'); + const groupBy = 'groupBy506361367'; const request = { parent: formattedParent, - groupBy: groupBy + groupBy: groupBy, }; // Mock Grpc layer @@ -491,34 +491,34 @@ describe("SecurityCenterClient", () => { client.groupFindings(request, (err, response) => { assert(err instanceof Error); assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === "undefined"); + assert(typeof response === 'undefined'); done(); }); }); }); - describe("listAssets", () => { - it("invokes listAssets without error", done => { + describe('listAssets', () => { + it('invokes listAssets without error', done => { const client = new securitycenterModule.v1beta1.SecurityCenterClient({ - credentials: { client_email: "bogus", private_key: "bogus" }, - projectId: "bogus" + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', }); // Mock request - const formattedParent = client.organizationPath("[ORGANIZATION]"); + const formattedParent = client.organizationPath('[ORGANIZATION]'); const request = { - parent: formattedParent + parent: formattedParent, }; // Mock response - const nextPageToken = ""; + const nextPageToken = ''; const totalSize = 705419236; const listAssetsResultsElement = {}; const listAssetsResults = [listAssetsResultsElement]; const expectedResponse = { nextPageToken: nextPageToken, totalSize: totalSize, - listAssetsResults: listAssetsResults + listAssetsResults: listAssetsResults, }; // Mock Grpc layer @@ -534,16 +534,16 @@ describe("SecurityCenterClient", () => { }); }); - it("invokes listAssets with error", done => { + it('invokes listAssets with error', done => { const client = new securitycenterModule.v1beta1.SecurityCenterClient({ - credentials: { client_email: "bogus", private_key: "bogus" }, - projectId: "bogus" + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', }); // Mock request - const formattedParent = client.organizationPath("[ORGANIZATION]"); + const formattedParent = client.organizationPath('[ORGANIZATION]'); const request = { - parent: formattedParent + parent: formattedParent, }; // Mock Grpc layer @@ -556,34 +556,34 @@ describe("SecurityCenterClient", () => { client.listAssets(request, (err, response) => { assert(err instanceof Error); assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === "undefined"); + assert(typeof response === 'undefined'); done(); }); }); }); - describe("listFindings", () => { - it("invokes listFindings without error", done => { + describe('listFindings', () => { + it('invokes listFindings without error', done => { const client = new securitycenterModule.v1beta1.SecurityCenterClient({ - credentials: { client_email: "bogus", private_key: "bogus" }, - projectId: "bogus" + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', }); // Mock request - const formattedParent = client.sourcePath("[ORGANIZATION]", "[SOURCE]"); + const formattedParent = client.sourcePath('[ORGANIZATION]', '[SOURCE]'); const request = { - parent: formattedParent + parent: formattedParent, }; // Mock response - const nextPageToken = ""; + const nextPageToken = ''; const totalSize = 705419236; const findingsElement = {}; const findings = [findingsElement]; const expectedResponse = { nextPageToken: nextPageToken, totalSize: totalSize, - findings: findings + findings: findings, }; // Mock Grpc layer @@ -603,16 +603,16 @@ describe("SecurityCenterClient", () => { }); }); - it("invokes listFindings with error", done => { + it('invokes listFindings with error', done => { const client = new securitycenterModule.v1beta1.SecurityCenterClient({ - credentials: { client_email: "bogus", private_key: "bogus" }, - projectId: "bogus" + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', }); // Mock request - const formattedParent = client.sourcePath("[ORGANIZATION]", "[SOURCE]"); + const formattedParent = client.sourcePath('[ORGANIZATION]', '[SOURCE]'); const request = { - parent: formattedParent + parent: formattedParent, }; // Mock Grpc layer @@ -625,32 +625,32 @@ describe("SecurityCenterClient", () => { client.listFindings(request, (err, response) => { assert(err instanceof Error); assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === "undefined"); + assert(typeof response === 'undefined'); done(); }); }); }); - describe("listSources", () => { - it("invokes listSources without error", done => { + describe('listSources', () => { + it('invokes listSources without error', done => { const client = new securitycenterModule.v1beta1.SecurityCenterClient({ - credentials: { client_email: "bogus", private_key: "bogus" }, - projectId: "bogus" + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', }); // Mock request - const formattedParent = client.organizationPath("[ORGANIZATION]"); + const formattedParent = client.organizationPath('[ORGANIZATION]'); const request = { - parent: formattedParent + parent: formattedParent, }; // Mock response - const nextPageToken = ""; + const nextPageToken = ''; const sourcesElement = {}; const sources = [sourcesElement]; const expectedResponse = { nextPageToken: nextPageToken, - sources: sources + sources: sources, }; // Mock Grpc layer @@ -670,16 +670,16 @@ describe("SecurityCenterClient", () => { }); }); - it("invokes listSources with error", done => { + it('invokes listSources with error', done => { const client = new securitycenterModule.v1beta1.SecurityCenterClient({ - credentials: { client_email: "bogus", private_key: "bogus" }, - projectId: "bogus" + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', }); // Mock request - const formattedParent = client.organizationPath("[ORGANIZATION]"); + const formattedParent = client.organizationPath('[ORGANIZATION]'); const request = { - parent: formattedParent + parent: formattedParent, }; // Mock Grpc layer @@ -692,23 +692,23 @@ describe("SecurityCenterClient", () => { client.listSources(request, (err, response) => { assert(err instanceof Error); assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === "undefined"); + assert(typeof response === 'undefined'); done(); }); }); }); - describe("runAssetDiscovery", function() { - it("invokes runAssetDiscovery without error", done => { + describe('runAssetDiscovery', function() { + it('invokes runAssetDiscovery without error', done => { const client = new securitycenterModule.v1beta1.SecurityCenterClient({ - credentials: { client_email: "bogus", private_key: "bogus" }, - projectId: "bogus" + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', }); // Mock request - const formattedParent = client.organizationPath("[ORGANIZATION]"); + const formattedParent = client.organizationPath('[ORGANIZATION]'); const request = { - parent: formattedParent + parent: formattedParent, }; // Mock response @@ -735,16 +735,16 @@ describe("SecurityCenterClient", () => { }); }); - it("invokes runAssetDiscovery with error", done => { + it('invokes runAssetDiscovery with error', done => { const client = new securitycenterModule.v1beta1.SecurityCenterClient({ - credentials: { client_email: "bogus", private_key: "bogus" }, - projectId: "bogus" + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', }); // Mock request - const formattedParent = client.organizationPath("[ORGANIZATION]"); + const formattedParent = client.organizationPath('[ORGANIZATION]'); const request = { - parent: formattedParent + parent: formattedParent, }; // Mock Grpc layer @@ -770,10 +770,10 @@ describe("SecurityCenterClient", () => { }); }); - it("has longrunning decoder functions", () => { + it('has longrunning decoder functions', () => { const client = new securitycenterModule.v1beta1.SecurityCenterClient({ - credentials: { client_email: "bogus", private_key: "bogus" }, - projectId: "bogus" + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', }); assert( client._descriptors.longrunning.runAssetDiscovery @@ -786,39 +786,39 @@ describe("SecurityCenterClient", () => { }); }); - describe("setFindingState", () => { - it("invokes setFindingState without error", done => { + describe('setFindingState', () => { + it('invokes setFindingState without error', done => { const client = new securitycenterModule.v1beta1.SecurityCenterClient({ - credentials: { client_email: "bogus", private_key: "bogus" }, - projectId: "bogus" + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', }); // Mock request const formattedName = client.findingPath( - "[ORGANIZATION]", - "[SOURCE]", - "[FINDING]" + '[ORGANIZATION]', + '[SOURCE]', + '[FINDING]' ); - const state = "STATE_UNSPECIFIED"; + const state = 'STATE_UNSPECIFIED'; const startTime = {}; const request = { name: formattedName, state: state, - startTime: startTime + startTime: startTime, }; // Mock response - const name2 = "name2-1052831874"; - const parent = "parent-995424086"; - const resourceName = "resourceName979421212"; - const category = "category50511102"; - const externalUri = "externalUri-1385596168"; + const name2 = 'name2-1052831874'; + const parent = 'parent-995424086'; + const resourceName = 'resourceName979421212'; + const category = 'category50511102'; + const externalUri = 'externalUri-1385596168'; const expectedResponse = { name: name2, parent: parent, resourceName: resourceName, category: category, - externalUri: externalUri + externalUri: externalUri, }; // Mock Grpc layer @@ -834,24 +834,24 @@ describe("SecurityCenterClient", () => { }); }); - it("invokes setFindingState with error", done => { + it('invokes setFindingState with error', done => { const client = new securitycenterModule.v1beta1.SecurityCenterClient({ - credentials: { client_email: "bogus", private_key: "bogus" }, - projectId: "bogus" + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', }); // Mock request const formattedName = client.findingPath( - "[ORGANIZATION]", - "[SOURCE]", - "[FINDING]" + '[ORGANIZATION]', + '[SOURCE]', + '[FINDING]' ); - const state = "STATE_UNSPECIFIED"; + const state = 'STATE_UNSPECIFIED'; const startTime = {}; const request = { name: formattedName, state: state, - startTime: startTime + startTime: startTime, }; // Mock Grpc layer @@ -864,33 +864,33 @@ describe("SecurityCenterClient", () => { client.setFindingState(request, (err, response) => { assert(err instanceof Error); assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === "undefined"); + assert(typeof response === 'undefined'); done(); }); }); }); - describe("setIamPolicy", () => { - it("invokes setIamPolicy without error", done => { + describe('setIamPolicy', () => { + it('invokes setIamPolicy without error', done => { const client = new securitycenterModule.v1beta1.SecurityCenterClient({ - credentials: { client_email: "bogus", private_key: "bogus" }, - projectId: "bogus" + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', }); // Mock request - const formattedResource = client.sourcePath("[ORGANIZATION]", "[SOURCE]"); + const formattedResource = client.sourcePath('[ORGANIZATION]', '[SOURCE]'); const policy = {}; const request = { resource: formattedResource, - policy: policy + policy: policy, }; // Mock response const version = 351608024; - const etag = "21"; + const etag = '21'; const expectedResponse = { version: version, - etag: etag + etag: etag, }; // Mock Grpc layer @@ -906,18 +906,18 @@ describe("SecurityCenterClient", () => { }); }); - it("invokes setIamPolicy with error", done => { + it('invokes setIamPolicy with error', done => { const client = new securitycenterModule.v1beta1.SecurityCenterClient({ - credentials: { client_email: "bogus", private_key: "bogus" }, - projectId: "bogus" + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', }); // Mock request - const formattedResource = client.sourcePath("[ORGANIZATION]", "[SOURCE]"); + const formattedResource = client.sourcePath('[ORGANIZATION]', '[SOURCE]'); const policy = {}; const request = { resource: formattedResource, - policy: policy + policy: policy, }; // Mock Grpc layer @@ -930,25 +930,25 @@ describe("SecurityCenterClient", () => { client.setIamPolicy(request, (err, response) => { assert(err instanceof Error); assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === "undefined"); + assert(typeof response === 'undefined'); done(); }); }); }); - describe("testIamPermissions", () => { - it("invokes testIamPermissions without error", done => { + describe('testIamPermissions', () => { + it('invokes testIamPermissions without error', done => { const client = new securitycenterModule.v1beta1.SecurityCenterClient({ - credentials: { client_email: "bogus", private_key: "bogus" }, - projectId: "bogus" + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', }); // Mock request - const formattedResource = client.sourcePath("[ORGANIZATION]", "[SOURCE]"); + const formattedResource = client.sourcePath('[ORGANIZATION]', '[SOURCE]'); const permissions = []; const request = { resource: formattedResource, - permissions: permissions + permissions: permissions, }; // Mock response @@ -967,18 +967,18 @@ describe("SecurityCenterClient", () => { }); }); - it("invokes testIamPermissions with error", done => { + it('invokes testIamPermissions with error', done => { const client = new securitycenterModule.v1beta1.SecurityCenterClient({ - credentials: { client_email: "bogus", private_key: "bogus" }, - projectId: "bogus" + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', }); // Mock request - const formattedResource = client.sourcePath("[ORGANIZATION]", "[SOURCE]"); + const formattedResource = client.sourcePath('[ORGANIZATION]', '[SOURCE]'); const permissions = []; const request = { resource: formattedResource, - permissions: permissions + permissions: permissions, }; // Mock Grpc layer @@ -991,37 +991,37 @@ describe("SecurityCenterClient", () => { client.testIamPermissions(request, (err, response) => { assert(err instanceof Error); assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === "undefined"); + assert(typeof response === 'undefined'); done(); }); }); }); - describe("updateFinding", () => { - it("invokes updateFinding without error", done => { + describe('updateFinding', () => { + it('invokes updateFinding without error', done => { const client = new securitycenterModule.v1beta1.SecurityCenterClient({ - credentials: { client_email: "bogus", private_key: "bogus" }, - projectId: "bogus" + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', }); // Mock request const finding = {}; const request = { - finding: finding + finding: finding, }; // Mock response - const name = "name3373707"; - const parent = "parent-995424086"; - const resourceName = "resourceName979421212"; - const category = "category50511102"; - const externalUri = "externalUri-1385596168"; + const name = 'name3373707'; + const parent = 'parent-995424086'; + const resourceName = 'resourceName979421212'; + const category = 'category50511102'; + const externalUri = 'externalUri-1385596168'; const expectedResponse = { name: name, parent: parent, resourceName: resourceName, category: category, - externalUri: externalUri + externalUri: externalUri, }; // Mock Grpc layer @@ -1037,16 +1037,16 @@ describe("SecurityCenterClient", () => { }); }); - it("invokes updateFinding with error", done => { + it('invokes updateFinding with error', done => { const client = new securitycenterModule.v1beta1.SecurityCenterClient({ - credentials: { client_email: "bogus", private_key: "bogus" }, - projectId: "bogus" + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', }); // Mock request const finding = {}; const request = { - finding: finding + finding: finding, }; // Mock Grpc layer @@ -1059,31 +1059,31 @@ describe("SecurityCenterClient", () => { client.updateFinding(request, (err, response) => { assert(err instanceof Error); assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === "undefined"); + assert(typeof response === 'undefined'); done(); }); }); }); - describe("updateOrganizationSettings", () => { - it("invokes updateOrganizationSettings without error", done => { + describe('updateOrganizationSettings', () => { + it('invokes updateOrganizationSettings without error', done => { const client = new securitycenterModule.v1beta1.SecurityCenterClient({ - credentials: { client_email: "bogus", private_key: "bogus" }, - projectId: "bogus" + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', }); // Mock request const organizationSettings = {}; const request = { - organizationSettings: organizationSettings + organizationSettings: organizationSettings, }; // Mock response - const name = "name3373707"; + const name = 'name3373707'; const enableAssetDiscovery = false; const expectedResponse = { name: name, - enableAssetDiscovery: enableAssetDiscovery + enableAssetDiscovery: enableAssetDiscovery, }; // Mock Grpc layer @@ -1099,16 +1099,16 @@ describe("SecurityCenterClient", () => { }); }); - it("invokes updateOrganizationSettings with error", done => { + it('invokes updateOrganizationSettings with error', done => { const client = new securitycenterModule.v1beta1.SecurityCenterClient({ - credentials: { client_email: "bogus", private_key: "bogus" }, - projectId: "bogus" + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', }); // Mock request const organizationSettings = {}; const request = { - organizationSettings: organizationSettings + organizationSettings: organizationSettings, }; // Mock Grpc layer @@ -1121,33 +1121,33 @@ describe("SecurityCenterClient", () => { client.updateOrganizationSettings(request, (err, response) => { assert(err instanceof Error); assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === "undefined"); + assert(typeof response === 'undefined'); done(); }); }); }); - describe("updateSource", () => { - it("invokes updateSource without error", done => { + describe('updateSource', () => { + it('invokes updateSource without error', done => { const client = new securitycenterModule.v1beta1.SecurityCenterClient({ - credentials: { client_email: "bogus", private_key: "bogus" }, - projectId: "bogus" + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', }); // Mock request const source = {}; const request = { - source: source + source: source, }; // Mock response - const name = "name3373707"; - const displayName = "displayName1615086568"; - const description = "description-1724546052"; + const name = 'name3373707'; + const displayName = 'displayName1615086568'; + const description = 'description-1724546052'; const expectedResponse = { name: name, displayName: displayName, - description: description + description: description, }; // Mock Grpc layer @@ -1163,16 +1163,16 @@ describe("SecurityCenterClient", () => { }); }); - it("invokes updateSource with error", done => { + it('invokes updateSource with error', done => { const client = new securitycenterModule.v1beta1.SecurityCenterClient({ - credentials: { client_email: "bogus", private_key: "bogus" }, - projectId: "bogus" + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', }); // Mock request const source = {}; const request = { - source: source + source: source, }; // Mock Grpc layer @@ -1185,29 +1185,29 @@ describe("SecurityCenterClient", () => { client.updateSource(request, (err, response) => { assert(err instanceof Error); assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === "undefined"); + assert(typeof response === 'undefined'); done(); }); }); }); - describe("updateSecurityMarks", () => { - it("invokes updateSecurityMarks without error", done => { + describe('updateSecurityMarks', () => { + it('invokes updateSecurityMarks without error', done => { const client = new securitycenterModule.v1beta1.SecurityCenterClient({ - credentials: { client_email: "bogus", private_key: "bogus" }, - projectId: "bogus" + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', }); // Mock request const securityMarks = {}; const request = { - securityMarks: securityMarks + securityMarks: securityMarks, }; // Mock response - const name = "name3373707"; + const name = 'name3373707'; const expectedResponse = { - name: name + name: name, }; // Mock Grpc layer @@ -1223,16 +1223,16 @@ describe("SecurityCenterClient", () => { }); }); - it("invokes updateSecurityMarks with error", done => { + it('invokes updateSecurityMarks with error', done => { const client = new securitycenterModule.v1beta1.SecurityCenterClient({ - credentials: { client_email: "bogus", private_key: "bogus" }, - projectId: "bogus" + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', }); // Mock request const securityMarks = {}; const request = { - securityMarks: securityMarks + securityMarks: securityMarks, }; // Mock Grpc layer @@ -1245,7 +1245,7 @@ describe("SecurityCenterClient", () => { client.updateSecurityMarks(request, (err, response) => { assert(err instanceof Error); assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === "undefined"); + assert(typeof response === 'undefined'); done(); }); }); @@ -1277,7 +1277,7 @@ function mockLongRunningGrpcMethod(expectedRequest, response, error) { resolve([response]); } }); - } + }, }; return Promise.resolve([mockOperation]); }; From f43da5c9821fbdb423c6ede4fb9212a6d15a8e7a Mon Sep 17 00:00:00 2001 From: Jonathan Lui Date: Thu, 8 Nov 2018 11:08:46 -0800 Subject: [PATCH 003/342] license header on npm-install-retry --- .../.circleci/npm-install-retry.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/packages/google-cloud-securitycenter/.circleci/npm-install-retry.js b/packages/google-cloud-securitycenter/.circleci/npm-install-retry.js index 3240aa2cbf2..6c4c0b6ffdf 100755 --- a/packages/google-cloud-securitycenter/.circleci/npm-install-retry.js +++ b/packages/google-cloud-securitycenter/.circleci/npm-install-retry.js @@ -1,5 +1,20 @@ #!/usr/bin/env node +/** + * Copyright 2018, Google, LLC. + * Licensed under the Apache License, Version 2.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. + */ + let spawn = require('child_process').spawn; // From c2e27fd6aeaf38cb9425a71cb630e0c06343a801 Mon Sep 17 00:00:00 2001 From: Jonathan Lui Date: Mon, 12 Nov 2018 12:07:30 -0800 Subject: [PATCH 004/342] remove CONTRIBUTORS --- packages/google-cloud-securitycenter/CONTRIBUTORS | 6 ------ 1 file changed, 6 deletions(-) delete mode 100644 packages/google-cloud-securitycenter/CONTRIBUTORS diff --git a/packages/google-cloud-securitycenter/CONTRIBUTORS b/packages/google-cloud-securitycenter/CONTRIBUTORS deleted file mode 100644 index 6585b55f8f2..00000000000 --- a/packages/google-cloud-securitycenter/CONTRIBUTORS +++ /dev/null @@ -1,6 +0,0 @@ -# The names of individuals who have contributed to this project. -# -# Names are formatted as: -# name -# -Jonathan Lui From 58bab1bce94deab02b7a6c2b89e2aa1f24459119 Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Tue, 20 Nov 2018 11:16:39 -0800 Subject: [PATCH 005/342] refactor: fix lint rules and make consistent (#1) --- .../google-cloud-securitycenter/.eslintignore | 3 +- .../google-cloud-securitycenter/.gitignore | 4 +- .../package-lock.json | 12611 ---------------- .../google-cloud-securitycenter/package.json | 14 +- .../samples/.eslintrc.yml | 1 + .../samples/package.json | 15 + .../samples/quickstart.js | 1 + packages/google-cloud-securitycenter/synth.py | 14 +- .../test/mocha.opts | 3 + 9 files changed, 31 insertions(+), 12635 deletions(-) delete mode 100644 packages/google-cloud-securitycenter/package-lock.json create mode 100644 packages/google-cloud-securitycenter/samples/package.json create mode 100644 packages/google-cloud-securitycenter/test/mocha.opts diff --git a/packages/google-cloud-securitycenter/.eslintignore b/packages/google-cloud-securitycenter/.eslintignore index f08b0fd1c65..2f642cb6044 100644 --- a/packages/google-cloud-securitycenter/.eslintignore +++ b/packages/google-cloud-securitycenter/.eslintignore @@ -1,4 +1,3 @@ -node_modules/* -samples/node_modules/* +**/node_modules src/**/doc/* build/ diff --git a/packages/google-cloud-securitycenter/.gitignore b/packages/google-cloud-securitycenter/.gitignore index 5b265aef806..95fcedf6538 100644 --- a/packages/google-cloud-securitycenter/.gitignore +++ b/packages/google-cloud-securitycenter/.gitignore @@ -3,11 +3,9 @@ .coverage .nyc_output docs/ -out/ build/ system-test/secrets.js system-test/*key.json *.lock +**/package-lock.json .DS_Store -google-cloud-logging-winston-*.tgz -google-cloud-logging-bunyan-*.tgz diff --git a/packages/google-cloud-securitycenter/package-lock.json b/packages/google-cloud-securitycenter/package-lock.json deleted file mode 100644 index ba28b4715fa..00000000000 --- a/packages/google-cloud-securitycenter/package-lock.json +++ /dev/null @@ -1,12611 +0,0 @@ -{ - "name": "@google-cloud/security-center", - "version": "0.1.0", - "lockfileVersion": 1, - "requires": true, - "dependencies": { - "@ava/babel-plugin-throws-helper": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@ava/babel-plugin-throws-helper/-/babel-plugin-throws-helper-2.0.0.tgz", - "integrity": "sha1-L8H+PCEacQcaTsp7j3r1hCzRrnw=", - "dev": true - }, - "@ava/babel-preset-stage-4": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@ava/babel-preset-stage-4/-/babel-preset-stage-4-1.1.0.tgz", - "integrity": "sha512-oWqTnIGXW3k72UFidXzW0ONlO7hnO9x02S/QReJ7NBGeiBH9cUHY9+EfV6C8PXC6YJH++WrliEq03wMSJGNZFg==", - "dev": true, - "requires": { - "babel-plugin-check-es2015-constants": "^6.8.0", - "babel-plugin-syntax-trailing-function-commas": "^6.20.0", - "babel-plugin-transform-async-to-generator": "^6.16.0", - "babel-plugin-transform-es2015-destructuring": "^6.19.0", - "babel-plugin-transform-es2015-function-name": "^6.9.0", - "babel-plugin-transform-es2015-modules-commonjs": "^6.18.0", - "babel-plugin-transform-es2015-parameters": "^6.21.0", - "babel-plugin-transform-es2015-spread": "^6.8.0", - "babel-plugin-transform-es2015-sticky-regex": "^6.8.0", - "babel-plugin-transform-es2015-unicode-regex": "^6.11.0", - "babel-plugin-transform-exponentiation-operator": "^6.8.0", - "package-hash": "^1.2.0" - }, - "dependencies": { - "md5-hex": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/md5-hex/-/md5-hex-1.3.0.tgz", - "integrity": "sha1-0sSv6YPENwZiF5uMrRRSGRNQRsQ=", - "dev": true, - "requires": { - "md5-o-matic": "^0.1.1" - } - }, - "package-hash": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/package-hash/-/package-hash-1.2.0.tgz", - "integrity": "sha1-AD5WzVe3NqbtYRTMK4FUJnJ3DkQ=", - "dev": true, - "requires": { - "md5-hex": "^1.3.0" - } - } - } - }, - "@ava/babel-preset-transform-test-files": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@ava/babel-preset-transform-test-files/-/babel-preset-transform-test-files-3.0.0.tgz", - "integrity": "sha1-ze0RlqjY2TgaUJJAq5LpGl7Aafc=", - "dev": true, - "requires": { - "@ava/babel-plugin-throws-helper": "^2.0.0", - "babel-plugin-espower": "^2.3.2" - } - }, - "@ava/write-file-atomic": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/@ava/write-file-atomic/-/write-file-atomic-2.2.0.tgz", - "integrity": "sha512-BTNB3nGbEfJT+69wuqXFr/bQH7Vr7ihx2xGOMNqPgDGhwspoZhiWumDDZNjBy7AScmqS5CELIOGtPVXESyrnDA==", - "dev": true, - "requires": { - "graceful-fs": "^4.1.11", - "imurmurhash": "^0.1.4", - "slide": "^1.1.5" - } - }, - "@babel/code-frame": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.0.0.tgz", - "integrity": "sha512-OfC2uemaknXr87bdLUkWog7nYuliM9Ij5HUcajsVcMCpQrcLmtxRbVFTIqmcSkSeYRBFBRxs2FiUqFJDLdiebA==", - "dev": true, - "requires": { - "@babel/highlight": "^7.0.0" - } - }, - "@babel/generator": { - "version": "7.1.3", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.1.3.tgz", - "integrity": "sha512-ZoCZGcfIJFJuZBqxcY9OjC1KW2lWK64qrX1o4UYL3yshVhwKFYgzpWZ0vvtGMNJdTlvkw0W+HR1VnYN8q3QPFQ==", - "dev": true, - "requires": { - "@babel/types": "^7.1.3", - "jsesc": "^2.5.1", - "lodash": "^4.17.10", - "source-map": "^0.5.0", - "trim-right": "^1.0.1" - }, - "dependencies": { - "jsesc": { - "version": "2.5.1", - "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.1.tgz", - "integrity": "sha1-5CGiqOINawgZ3yiQj3glJrlt0f4=", - "dev": true - } - } - }, - "@babel/helper-function-name": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.1.0.tgz", - "integrity": "sha512-A95XEoCpb3TO+KZzJ4S/5uW5fNe26DjBGqf1o9ucyLyCmi1dXq/B3c8iaWTfBk3VvetUxl16e8tIrd5teOCfGw==", - "dev": true, - "requires": { - "@babel/helper-get-function-arity": "^7.0.0", - "@babel/template": "^7.1.0", - "@babel/types": "^7.0.0" - } - }, - "@babel/helper-get-function-arity": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.0.0.tgz", - "integrity": "sha512-r2DbJeg4svYvt3HOS74U4eWKsUAMRH01Z1ds1zx8KNTPtpTL5JAsdFv8BNyOpVqdFhHkkRDIg5B4AsxmkjAlmQ==", - "dev": true, - "requires": { - "@babel/types": "^7.0.0" - } - }, - "@babel/helper-split-export-declaration": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.0.0.tgz", - "integrity": "sha512-MXkOJqva62dfC0w85mEf/LucPPS/1+04nmmRMPEBUB++hiiThQ2zPtX/mEWQ3mtzCEjIJvPY8nuwxXtQeQwUag==", - "dev": true, - "requires": { - "@babel/types": "^7.0.0" - } - }, - "@babel/highlight": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.0.0.tgz", - "integrity": "sha512-UFMC4ZeFC48Tpvj7C8UgLvtkaUuovQX+5xNWrsIoMG8o2z+XFKjKaN9iVmS84dPwVN00W4wPmqvYoZF3EGAsfw==", - "dev": true, - "requires": { - "chalk": "^2.0.0", - "esutils": "^2.0.2", - "js-tokens": "^4.0.0" - }, - "dependencies": { - "js-tokens": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", - "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", - "dev": true - } - } - }, - "@babel/parser": { - "version": "7.1.3", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.1.3.tgz", - "integrity": "sha512-gqmspPZOMW3MIRb9HlrnbZHXI1/KHTOroBwN1NcLL6pWxzqzEKGvRTq0W/PxS45OtQGbaFikSQpkS5zbnsQm2w==", - "dev": true - }, - "@babel/template": { - "version": "7.1.2", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.1.2.tgz", - "integrity": "sha512-SY1MmplssORfFiLDcOETrW7fCLl+PavlwMh92rrGcikQaRq4iWPVH0MpwPpY3etVMx6RnDjXtr6VZYr/IbP/Ag==", - "dev": true, - "requires": { - "@babel/code-frame": "^7.0.0", - "@babel/parser": "^7.1.2", - "@babel/types": "^7.1.2" - } - }, - "@babel/traverse": { - "version": "7.1.4", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.1.4.tgz", - "integrity": "sha512-my9mdrAIGdDiSVBuMjpn/oXYpva0/EZwWL3sm3Wcy/AVWO2eXnsoZruOT9jOGNRXU8KbCIu5zsKnXcAJ6PcV6Q==", - "dev": true, - "requires": { - "@babel/code-frame": "^7.0.0", - "@babel/generator": "^7.1.3", - "@babel/helper-function-name": "^7.1.0", - "@babel/helper-split-export-declaration": "^7.0.0", - "@babel/parser": "^7.1.3", - "@babel/types": "^7.1.3", - "debug": "^3.1.0", - "globals": "^11.1.0", - "lodash": "^4.17.10" - }, - "dependencies": { - "debug": { - "version": "3.2.6", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", - "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", - "dev": true, - "requires": { - "ms": "^2.1.1" - } - }, - "globals": { - "version": "11.8.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-11.8.0.tgz", - "integrity": "sha512-io6LkyPVuzCHBSQV9fmOwxZkUk6nIaGmxheLDgmuFv89j0fm2aqDbIXKAGfzCMHqz3HLF2Zf8WSG6VqMh2qFmA==", - "dev": true - }, - "ms": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", - "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", - "dev": true - } - } - }, - "@babel/types": { - "version": "7.1.3", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.1.3.tgz", - "integrity": "sha512-RpPOVfK+yatXyn8n4PB1NW6k9qjinrXrRR8ugBN8fD6hCy5RXI6PSbVqpOJBO9oSaY7Nom4ohj35feb0UR9hSA==", - "dev": true, - "requires": { - "esutils": "^2.0.2", - "lodash": "^4.17.10", - "to-fast-properties": "^2.0.0" - }, - "dependencies": { - "to-fast-properties": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", - "integrity": "sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4=", - "dev": true - } - } - }, - "@concordance/react": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/@concordance/react/-/react-1.0.0.tgz", - "integrity": "sha512-htrsRaQX8Iixlsek8zQU7tE8wcsTQJ5UhZkSPEA8slCDAisKpC/2VgU/ucPn32M5/LjGGXRaUEKvEw1Wiuu4zQ==", - "dev": true, - "requires": { - "arrify": "^1.0.1" - } - }, - "@google-cloud/nodejs-repo-tools": { - "version": "2.3.5", - "resolved": "https://registry.npmjs.org/@google-cloud/nodejs-repo-tools/-/nodejs-repo-tools-2.3.5.tgz", - "integrity": "sha512-KqYh9hJFkmEzaFBM58+e2DjuOSO3M0pUZ/S5Ms8LEFuymwYbH8hZgjUFOgXDhi3J5Z2Ol4XTPTSVSrVZU4RVDg==", - "dev": true, - "requires": { - "@sindresorhus/slugify": "^0.3.0", - "ava": "0.25.0", - "colors": "1.1.2", - "fs-extra": "^6.0.0", - "got": "^8.3.2", - "handlebars": "4.0.11", - "lodash": "^4.17.11", - "nyc": "11.7.2", - "proxyquire": "^2.0.0", - "semver": "^5.5.0", - "sinon": "6.0.1", - "supertest": "^3.2.0", - "yargs": "^12.0.1", - "yargs-parser": "10.1.0" - }, - "dependencies": { - "ansi-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", - "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", - "dev": true - }, - "cliui": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-4.1.0.tgz", - "integrity": "sha512-4FG+RSG9DL7uEwRUZXZn3SS34DiDPfzP0VOiEwtUWlE+AR2EIg+hSyvrIgUUfhdgR/UkAeW2QHgeP+hWrXs7jQ==", - "dev": true, - "requires": { - "string-width": "^2.1.1", - "strip-ansi": "^4.0.0", - "wrap-ansi": "^2.0.0" - } - }, - "cross-spawn": { - "version": "6.0.5", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", - "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", - "dev": true, - "requires": { - "nice-try": "^1.0.4", - "path-key": "^2.0.1", - "semver": "^5.5.0", - "shebang-command": "^1.2.0", - "which": "^1.2.9" - } - }, - "decamelize": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-2.0.0.tgz", - "integrity": "sha512-Ikpp5scV3MSYxY39ymh45ZLEecsTdv/Xj2CaQfI8RLMuwi7XvjX9H/fhraiSuU+C5w5NTDu4ZU72xNiZnurBPg==", - "dev": true, - "requires": { - "xregexp": "4.0.0" - } - }, - "execa": { - "version": "0.10.0", - "resolved": "https://registry.npmjs.org/execa/-/execa-0.10.0.tgz", - "integrity": "sha512-7XOMnz8Ynx1gGo/3hyV9loYNPWM94jG3+3T3Y8tsfSstFmETmENCMU/A/zj8Lyaj1lkgEepKepvd6240tBRvlw==", - "dev": true, - "requires": { - "cross-spawn": "^6.0.0", - "get-stream": "^3.0.0", - "is-stream": "^1.1.0", - "npm-run-path": "^2.0.0", - "p-finally": "^1.0.0", - "signal-exit": "^3.0.0", - "strip-eof": "^1.0.0" - } - }, - "find-up": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", - "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", - "dev": true, - "requires": { - "locate-path": "^3.0.0" - } - }, - "invert-kv": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-2.0.0.tgz", - "integrity": "sha512-wPVv/y/QQ/Uiirj/vh3oP+1Ww+AWehmi1g5fFWGPF6IpCBCDVrhgHRMvrLfdYcwDh3QJbGXDW4JAuzxElLSqKA==", - "dev": true - }, - "is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", - "dev": true - }, - "lcid": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/lcid/-/lcid-2.0.0.tgz", - "integrity": "sha512-avPEb8P8EGnwXKClwsNUgryVjllcRqtMYa49NTsbQagYuT1DcXnl1915oxWjoyGrXR6zH/Y0Zc96xWsPcoDKeA==", - "dev": true, - "requires": { - "invert-kv": "^2.0.0" - } - }, - "locate-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", - "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", - "dev": true, - "requires": { - "p-locate": "^3.0.0", - "path-exists": "^3.0.0" - } - }, - "nyc": { - "version": "11.7.2", - "resolved": "https://registry.npmjs.org/nyc/-/nyc-11.7.2.tgz", - "integrity": "sha512-gBt7qwsR1vryYfglVjQRx1D+AtMZW5NbUKxb+lZe8SN8KsheGCPGWEsSC9AGQG+r2+te1+10uPHUCahuqm1nGQ==", - "dev": true, - "requires": { - "archy": "^1.0.0", - "arrify": "^1.0.1", - "caching-transform": "^1.0.0", - "convert-source-map": "^1.5.1", - "debug-log": "^1.0.1", - "default-require-extensions": "^1.0.0", - "find-cache-dir": "^0.1.1", - "find-up": "^2.1.0", - "foreground-child": "^1.5.3", - "glob": "^7.0.6", - "istanbul-lib-coverage": "^1.1.2", - "istanbul-lib-hook": "^1.1.0", - "istanbul-lib-instrument": "^1.10.0", - "istanbul-lib-report": "^1.1.3", - "istanbul-lib-source-maps": "^1.2.3", - "istanbul-reports": "^1.4.0", - "md5-hex": "^1.2.0", - "merge-source-map": "^1.1.0", - "micromatch": "^3.1.10", - "mkdirp": "^0.5.0", - "resolve-from": "^2.0.0", - "rimraf": "^2.6.2", - "signal-exit": "^3.0.1", - "spawn-wrap": "^1.4.2", - "test-exclude": "^4.2.0", - "yargs": "11.1.0", - "yargs-parser": "^8.0.0" - }, - "dependencies": { - "align-text": { - "version": "0.1.4", - "bundled": true, - "dev": true, - "requires": { - "kind-of": "^3.0.2", - "longest": "^1.0.1", - "repeat-string": "^1.5.2" - } - }, - "amdefine": { - "version": "1.0.1", - "bundled": true, - "dev": true - }, - "ansi-regex": { - "version": "2.1.1", - "bundled": true, - "dev": true - }, - "ansi-styles": { - "version": "2.2.1", - "bundled": true, - "dev": true - }, - "append-transform": { - "version": "0.4.0", - "bundled": true, - "dev": true, - "requires": { - "default-require-extensions": "^1.0.0" - } - }, - "archy": { - "version": "1.0.0", - "bundled": true, - "dev": true - }, - "arr-diff": { - "version": "4.0.0", - "bundled": true, - "dev": true - }, - "arr-flatten": { - "version": "1.1.0", - "bundled": true, - "dev": true - }, - "arr-union": { - "version": "3.1.0", - "bundled": true, - "dev": true - }, - "array-unique": { - "version": "0.3.2", - "bundled": true, - "dev": true - }, - "arrify": { - "version": "1.0.1", - "bundled": true, - "dev": true - }, - "assign-symbols": { - "version": "1.0.0", - "bundled": true, - "dev": true - }, - "async": { - "version": "1.5.2", - "bundled": true, - "dev": true - }, - "atob": { - "version": "2.1.1", - "bundled": true, - "dev": true - }, - "babel-code-frame": { - "version": "6.26.0", - "bundled": true, - "dev": true, - "requires": { - "chalk": "^1.1.3", - "esutils": "^2.0.2", - "js-tokens": "^3.0.2" - } - }, - "babel-generator": { - "version": "6.26.1", - "bundled": true, - "dev": true, - "requires": { - "babel-messages": "^6.23.0", - "babel-runtime": "^6.26.0", - "babel-types": "^6.26.0", - "detect-indent": "^4.0.0", - "jsesc": "^1.3.0", - "lodash": "^4.17.4", - "source-map": "^0.5.7", - "trim-right": "^1.0.1" - } - }, - "babel-messages": { - "version": "6.23.0", - "bundled": true, - "dev": true, - "requires": { - "babel-runtime": "^6.22.0" - } - }, - "babel-runtime": { - "version": "6.26.0", - "bundled": true, - "dev": true, - "requires": { - "core-js": "^2.4.0", - "regenerator-runtime": "^0.11.0" - } - }, - "babel-template": { - "version": "6.26.0", - "bundled": true, - "dev": true, - "requires": { - "babel-runtime": "^6.26.0", - "babel-traverse": "^6.26.0", - "babel-types": "^6.26.0", - "babylon": "^6.18.0", - "lodash": "^4.17.4" - } - }, - "babel-traverse": { - "version": "6.26.0", - "bundled": true, - "dev": true, - "requires": { - "babel-code-frame": "^6.26.0", - "babel-messages": "^6.23.0", - "babel-runtime": "^6.26.0", - "babel-types": "^6.26.0", - "babylon": "^6.18.0", - "debug": "^2.6.8", - "globals": "^9.18.0", - "invariant": "^2.2.2", - "lodash": "^4.17.4" - } - }, - "babel-types": { - "version": "6.26.0", - "bundled": true, - "dev": true, - "requires": { - "babel-runtime": "^6.26.0", - "esutils": "^2.0.2", - "lodash": "^4.17.4", - "to-fast-properties": "^1.0.3" - } - }, - "babylon": { - "version": "6.18.0", - "bundled": true, - "dev": true - }, - "balanced-match": { - "version": "1.0.0", - "bundled": true, - "dev": true - }, - "base": { - "version": "0.11.2", - "bundled": true, - "dev": true, - "requires": { - "cache-base": "^1.0.1", - "class-utils": "^0.3.5", - "component-emitter": "^1.2.1", - "define-property": "^1.0.0", - "isobject": "^3.0.1", - "mixin-deep": "^1.2.0", - "pascalcase": "^0.1.1" - }, - "dependencies": { - "define-property": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "requires": { - "is-descriptor": "^1.0.0" - } - }, - "is-accessor-descriptor": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-data-descriptor": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-descriptor": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "requires": { - "is-accessor-descriptor": "^1.0.0", - "is-data-descriptor": "^1.0.0", - "kind-of": "^6.0.2" - } - }, - "kind-of": { - "version": "6.0.2", - "bundled": true, - "dev": true - } - } - }, - "brace-expansion": { - "version": "1.1.11", - "bundled": true, - "dev": true, - "requires": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "braces": { - "version": "2.3.2", - "bundled": true, - "dev": true, - "requires": { - "arr-flatten": "^1.1.0", - "array-unique": "^0.3.2", - "extend-shallow": "^2.0.1", - "fill-range": "^4.0.0", - "isobject": "^3.0.1", - "repeat-element": "^1.1.2", - "snapdragon": "^0.8.1", - "snapdragon-node": "^2.0.1", - "split-string": "^3.0.2", - "to-regex": "^3.0.1" - }, - "dependencies": { - "extend-shallow": { - "version": "2.0.1", - "bundled": true, - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - } - } - }, - "builtin-modules": { - "version": "1.1.1", - "bundled": true, - "dev": true - }, - "cache-base": { - "version": "1.0.1", - "bundled": true, - "dev": true, - "requires": { - "collection-visit": "^1.0.0", - "component-emitter": "^1.2.1", - "get-value": "^2.0.6", - "has-value": "^1.0.0", - "isobject": "^3.0.1", - "set-value": "^2.0.0", - "to-object-path": "^0.3.0", - "union-value": "^1.0.0", - "unset-value": "^1.0.0" - } - }, - "caching-transform": { - "version": "1.0.1", - "bundled": true, - "dev": true, - "requires": { - "md5-hex": "^1.2.0", - "mkdirp": "^0.5.1", - "write-file-atomic": "^1.1.4" - } - }, - "camelcase": { - "version": "1.2.1", - "bundled": true, - "dev": true, - "optional": true - }, - "center-align": { - "version": "0.1.3", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "align-text": "^0.1.3", - "lazy-cache": "^1.0.3" - } - }, - "chalk": { - "version": "1.1.3", - "bundled": true, - "dev": true, - "requires": { - "ansi-styles": "^2.2.1", - "escape-string-regexp": "^1.0.2", - "has-ansi": "^2.0.0", - "strip-ansi": "^3.0.0", - "supports-color": "^2.0.0" - } - }, - "class-utils": { - "version": "0.3.6", - "bundled": true, - "dev": true, - "requires": { - "arr-union": "^3.1.0", - "define-property": "^0.2.5", - "isobject": "^3.0.0", - "static-extend": "^0.1.1" - }, - "dependencies": { - "define-property": { - "version": "0.2.5", - "bundled": true, - "dev": true, - "requires": { - "is-descriptor": "^0.1.0" - } - } - } - }, - "cliui": { - "version": "2.1.0", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "center-align": "^0.1.1", - "right-align": "^0.1.1", - "wordwrap": "0.0.2" - }, - "dependencies": { - "wordwrap": { - "version": "0.0.2", - "bundled": true, - "dev": true, - "optional": true - } - } - }, - "code-point-at": { - "version": "1.1.0", - "bundled": true, - "dev": true - }, - "collection-visit": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "requires": { - "map-visit": "^1.0.0", - "object-visit": "^1.0.0" - } - }, - "commondir": { - "version": "1.0.1", - "bundled": true, - "dev": true - }, - "component-emitter": { - "version": "1.2.1", - "bundled": true, - "dev": true - }, - "concat-map": { - "version": "0.0.1", - "bundled": true, - "dev": true - }, - "convert-source-map": { - "version": "1.5.1", - "bundled": true, - "dev": true - }, - "copy-descriptor": { - "version": "0.1.1", - "bundled": true, - "dev": true - }, - "core-js": { - "version": "2.5.6", - "bundled": true, - "dev": true - }, - "cross-spawn": { - "version": "4.0.2", - "bundled": true, - "dev": true, - "requires": { - "lru-cache": "^4.0.1", - "which": "^1.2.9" - } - }, - "debug": { - "version": "2.6.9", - "bundled": true, - "dev": true, - "requires": { - "ms": "2.0.0" - } - }, - "debug-log": { - "version": "1.0.1", - "bundled": true, - "dev": true - }, - "decamelize": { - "version": "1.2.0", - "bundled": true, - "dev": true - }, - "decode-uri-component": { - "version": "0.2.0", - "bundled": true, - "dev": true - }, - "default-require-extensions": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "requires": { - "strip-bom": "^2.0.0" - } - }, - "define-property": { - "version": "2.0.2", - "bundled": true, - "dev": true, - "requires": { - "is-descriptor": "^1.0.2", - "isobject": "^3.0.1" - }, - "dependencies": { - "is-accessor-descriptor": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-data-descriptor": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-descriptor": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "requires": { - "is-accessor-descriptor": "^1.0.0", - "is-data-descriptor": "^1.0.0", - "kind-of": "^6.0.2" - } - }, - "kind-of": { - "version": "6.0.2", - "bundled": true, - "dev": true - } - } - }, - "detect-indent": { - "version": "4.0.0", - "bundled": true, - "dev": true, - "requires": { - "repeating": "^2.0.0" - } - }, - "error-ex": { - "version": "1.3.1", - "bundled": true, - "dev": true, - "requires": { - "is-arrayish": "^0.2.1" - } - }, - "escape-string-regexp": { - "version": "1.0.5", - "bundled": true, - "dev": true - }, - "esutils": { - "version": "2.0.2", - "bundled": true, - "dev": true - }, - "execa": { - "version": "0.7.0", - "bundled": true, - "dev": true, - "requires": { - "cross-spawn": "^5.0.1", - "get-stream": "^3.0.0", - "is-stream": "^1.1.0", - "npm-run-path": "^2.0.0", - "p-finally": "^1.0.0", - "signal-exit": "^3.0.0", - "strip-eof": "^1.0.0" - }, - "dependencies": { - "cross-spawn": { - "version": "5.1.0", - "bundled": true, - "dev": true, - "requires": { - "lru-cache": "^4.0.1", - "shebang-command": "^1.2.0", - "which": "^1.2.9" - } - } - } - }, - "expand-brackets": { - "version": "2.1.4", - "bundled": true, - "dev": true, - "requires": { - "debug": "^2.3.3", - "define-property": "^0.2.5", - "extend-shallow": "^2.0.1", - "posix-character-classes": "^0.1.0", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.1" - }, - "dependencies": { - "define-property": { - "version": "0.2.5", - "bundled": true, - "dev": true, - "requires": { - "is-descriptor": "^0.1.0" - } - }, - "extend-shallow": { - "version": "2.0.1", - "bundled": true, - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - } - } - }, - "extend-shallow": { - "version": "3.0.2", - "bundled": true, - "dev": true, - "requires": { - "assign-symbols": "^1.0.0", - "is-extendable": "^1.0.1" - }, - "dependencies": { - "is-extendable": { - "version": "1.0.1", - "bundled": true, - "dev": true, - "requires": { - "is-plain-object": "^2.0.4" - } - } - } - }, - "extglob": { - "version": "2.0.4", - "bundled": true, - "dev": true, - "requires": { - "array-unique": "^0.3.2", - "define-property": "^1.0.0", - "expand-brackets": "^2.1.4", - "extend-shallow": "^2.0.1", - "fragment-cache": "^0.2.1", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.1" - }, - "dependencies": { - "define-property": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "requires": { - "is-descriptor": "^1.0.0" - } - }, - "extend-shallow": { - "version": "2.0.1", - "bundled": true, - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - }, - "is-accessor-descriptor": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-data-descriptor": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-descriptor": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "requires": { - "is-accessor-descriptor": "^1.0.0", - "is-data-descriptor": "^1.0.0", - "kind-of": "^6.0.2" - } - }, - "kind-of": { - "version": "6.0.2", - "bundled": true, - "dev": true - } - } - }, - "fill-range": { - "version": "4.0.0", - "bundled": true, - "dev": true, - "requires": { - "extend-shallow": "^2.0.1", - "is-number": "^3.0.0", - "repeat-string": "^1.6.1", - "to-regex-range": "^2.1.0" - }, - "dependencies": { - "extend-shallow": { - "version": "2.0.1", - "bundled": true, - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - } - } - }, - "find-cache-dir": { - "version": "0.1.1", - "bundled": true, - "dev": true, - "requires": { - "commondir": "^1.0.1", - "mkdirp": "^0.5.1", - "pkg-dir": "^1.0.0" - } - }, - "find-up": { - "version": "2.1.0", - "bundled": true, - "dev": true, - "requires": { - "locate-path": "^2.0.0" - } - }, - "for-in": { - "version": "1.0.2", - "bundled": true, - "dev": true - }, - "foreground-child": { - "version": "1.5.6", - "bundled": true, - "dev": true, - "requires": { - "cross-spawn": "^4", - "signal-exit": "^3.0.0" - } - }, - "fragment-cache": { - "version": "0.2.1", - "bundled": true, - "dev": true, - "requires": { - "map-cache": "^0.2.2" - } - }, - "fs.realpath": { - "version": "1.0.0", - "bundled": true, - "dev": true - }, - "get-caller-file": { - "version": "1.0.2", - "bundled": true, - "dev": true - }, - "get-stream": { - "version": "3.0.0", - "bundled": true, - "dev": true - }, - "get-value": { - "version": "2.0.6", - "bundled": true, - "dev": true - }, - "glob": { - "version": "7.1.2", - "bundled": true, - "dev": true, - "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - }, - "globals": { - "version": "9.18.0", - "bundled": true, - "dev": true - }, - "graceful-fs": { - "version": "4.1.11", - "bundled": true, - "dev": true - }, - "handlebars": { - "version": "4.0.11", - "bundled": true, - "dev": true, - "requires": { - "async": "^1.4.0", - "optimist": "^0.6.1", - "source-map": "^0.4.4", - "uglify-js": "^2.6" - }, - "dependencies": { - "source-map": { - "version": "0.4.4", - "bundled": true, - "dev": true, - "requires": { - "amdefine": ">=0.0.4" - } - } - } - }, - "has-ansi": { - "version": "2.0.0", - "bundled": true, - "dev": true, - "requires": { - "ansi-regex": "^2.0.0" - } - }, - "has-flag": { - "version": "1.0.0", - "bundled": true, - "dev": true - }, - "has-value": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "requires": { - "get-value": "^2.0.6", - "has-values": "^1.0.0", - "isobject": "^3.0.0" - } - }, - "has-values": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "requires": { - "is-number": "^3.0.0", - "kind-of": "^4.0.0" - }, - "dependencies": { - "kind-of": { - "version": "4.0.0", - "bundled": true, - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "hosted-git-info": { - "version": "2.6.0", - "bundled": true, - "dev": true - }, - "imurmurhash": { - "version": "0.1.4", - "bundled": true, - "dev": true - }, - "inflight": { - "version": "1.0.6", - "bundled": true, - "dev": true, - "requires": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "inherits": { - "version": "2.0.3", - "bundled": true, - "dev": true - }, - "invariant": { - "version": "2.2.4", - "bundled": true, - "dev": true, - "requires": { - "loose-envify": "^1.0.0" - } - }, - "invert-kv": { - "version": "1.0.0", - "bundled": true, - "dev": true - }, - "is-accessor-descriptor": { - "version": "0.1.6", - "bundled": true, - "dev": true, - "requires": { - "kind-of": "^3.0.2" - } - }, - "is-arrayish": { - "version": "0.2.1", - "bundled": true, - "dev": true - }, - "is-buffer": { - "version": "1.1.6", - "bundled": true, - "dev": true - }, - "is-builtin-module": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "requires": { - "builtin-modules": "^1.0.0" - } - }, - "is-data-descriptor": { - "version": "0.1.4", - "bundled": true, - "dev": true, - "requires": { - "kind-of": "^3.0.2" - } - }, - "is-descriptor": { - "version": "0.1.6", - "bundled": true, - "dev": true, - "requires": { - "is-accessor-descriptor": "^0.1.6", - "is-data-descriptor": "^0.1.4", - "kind-of": "^5.0.0" - }, - "dependencies": { - "kind-of": { - "version": "5.1.0", - "bundled": true, - "dev": true - } - } - }, - "is-extendable": { - "version": "0.1.1", - "bundled": true, - "dev": true - }, - "is-finite": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "requires": { - "number-is-nan": "^1.0.0" - } - }, - "is-fullwidth-code-point": { - "version": "2.0.0", - "bundled": true, - "dev": true - }, - "is-number": { - "version": "3.0.0", - "bundled": true, - "dev": true, - "requires": { - "kind-of": "^3.0.2" - } - }, - "is-odd": { - "version": "2.0.0", - "bundled": true, - "dev": true, - "requires": { - "is-number": "^4.0.0" - }, - "dependencies": { - "is-number": { - "version": "4.0.0", - "bundled": true, - "dev": true - } - } - }, - "is-plain-object": { - "version": "2.0.4", - "bundled": true, - "dev": true, - "requires": { - "isobject": "^3.0.1" - } - }, - "is-stream": { - "version": "1.1.0", - "bundled": true, - "dev": true - }, - "is-utf8": { - "version": "0.2.1", - "bundled": true, - "dev": true - }, - "is-windows": { - "version": "1.0.2", - "bundled": true, - "dev": true - }, - "isarray": { - "version": "1.0.0", - "bundled": true, - "dev": true - }, - "isexe": { - "version": "2.0.0", - "bundled": true, - "dev": true - }, - "isobject": { - "version": "3.0.1", - "bundled": true, - "dev": true - }, - "istanbul-lib-coverage": { - "version": "1.2.0", - "bundled": true, - "dev": true - }, - "istanbul-lib-hook": { - "version": "1.1.0", - "bundled": true, - "dev": true, - "requires": { - "append-transform": "^0.4.0" - } - }, - "istanbul-lib-instrument": { - "version": "1.10.1", - "bundled": true, - "dev": true, - "requires": { - "babel-generator": "^6.18.0", - "babel-template": "^6.16.0", - "babel-traverse": "^6.18.0", - "babel-types": "^6.18.0", - "babylon": "^6.18.0", - "istanbul-lib-coverage": "^1.2.0", - "semver": "^5.3.0" - } - }, - "istanbul-lib-report": { - "version": "1.1.3", - "bundled": true, - "dev": true, - "requires": { - "istanbul-lib-coverage": "^1.1.2", - "mkdirp": "^0.5.1", - "path-parse": "^1.0.5", - "supports-color": "^3.1.2" - }, - "dependencies": { - "supports-color": { - "version": "3.2.3", - "bundled": true, - "dev": true, - "requires": { - "has-flag": "^1.0.0" - } - } - } - }, - "istanbul-lib-source-maps": { - "version": "1.2.3", - "bundled": true, - "dev": true, - "requires": { - "debug": "^3.1.0", - "istanbul-lib-coverage": "^1.1.2", - "mkdirp": "^0.5.1", - "rimraf": "^2.6.1", - "source-map": "^0.5.3" - }, - "dependencies": { - "debug": { - "version": "3.1.0", - "bundled": true, - "dev": true, - "requires": { - "ms": "2.0.0" - } - } - } - }, - "istanbul-reports": { - "version": "1.4.0", - "bundled": true, - "dev": true, - "requires": { - "handlebars": "^4.0.3" - } - }, - "js-tokens": { - "version": "3.0.2", - "bundled": true, - "dev": true - }, - "jsesc": { - "version": "1.3.0", - "bundled": true, - "dev": true - }, - "kind-of": { - "version": "3.2.2", - "bundled": true, - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - }, - "lazy-cache": { - "version": "1.0.4", - "bundled": true, - "dev": true, - "optional": true - }, - "lcid": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "requires": { - "invert-kv": "^1.0.0" - } - }, - "load-json-file": { - "version": "1.1.0", - "bundled": true, - "dev": true, - "requires": { - "graceful-fs": "^4.1.2", - "parse-json": "^2.2.0", - "pify": "^2.0.0", - "pinkie-promise": "^2.0.0", - "strip-bom": "^2.0.0" - } - }, - "locate-path": { - "version": "2.0.0", - "bundled": true, - "dev": true, - "requires": { - "p-locate": "^2.0.0", - "path-exists": "^3.0.0" - }, - "dependencies": { - "path-exists": { - "version": "3.0.0", - "bundled": true, - "dev": true - } - } - }, - "lodash": { - "version": "4.17.10", - "bundled": true, - "dev": true - }, - "longest": { - "version": "1.0.1", - "bundled": true, - "dev": true - }, - "loose-envify": { - "version": "1.3.1", - "bundled": true, - "dev": true, - "requires": { - "js-tokens": "^3.0.0" - } - }, - "lru-cache": { - "version": "4.1.3", - "bundled": true, - "dev": true, - "requires": { - "pseudomap": "^1.0.2", - "yallist": "^2.1.2" - } - }, - "map-cache": { - "version": "0.2.2", - "bundled": true, - "dev": true - }, - "map-visit": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "requires": { - "object-visit": "^1.0.0" - } - }, - "md5-hex": { - "version": "1.3.0", - "bundled": true, - "dev": true, - "requires": { - "md5-o-matic": "^0.1.1" - } - }, - "md5-o-matic": { - "version": "0.1.1", - "bundled": true, - "dev": true - }, - "mem": { - "version": "1.1.0", - "bundled": true, - "dev": true, - "requires": { - "mimic-fn": "^1.0.0" - } - }, - "merge-source-map": { - "version": "1.1.0", - "bundled": true, - "dev": true, - "requires": { - "source-map": "^0.6.1" - }, - "dependencies": { - "source-map": { - "version": "0.6.1", - "bundled": true, - "dev": true - } - } - }, - "micromatch": { - "version": "3.1.10", - "bundled": true, - "dev": true, - "requires": { - "arr-diff": "^4.0.0", - "array-unique": "^0.3.2", - "braces": "^2.3.1", - "define-property": "^2.0.2", - "extend-shallow": "^3.0.2", - "extglob": "^2.0.4", - "fragment-cache": "^0.2.1", - "kind-of": "^6.0.2", - "nanomatch": "^1.2.9", - "object.pick": "^1.3.0", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.2" - }, - "dependencies": { - "kind-of": { - "version": "6.0.2", - "bundled": true, - "dev": true - } - } - }, - "mimic-fn": { - "version": "1.2.0", - "bundled": true, - "dev": true - }, - "minimatch": { - "version": "3.0.4", - "bundled": true, - "dev": true, - "requires": { - "brace-expansion": "^1.1.7" - } - }, - "minimist": { - "version": "0.0.8", - "bundled": true, - "dev": true - }, - "mixin-deep": { - "version": "1.3.1", - "bundled": true, - "dev": true, - "requires": { - "for-in": "^1.0.2", - "is-extendable": "^1.0.1" - }, - "dependencies": { - "is-extendable": { - "version": "1.0.1", - "bundled": true, - "dev": true, - "requires": { - "is-plain-object": "^2.0.4" - } - } - } - }, - "mkdirp": { - "version": "0.5.1", - "bundled": true, - "dev": true, - "requires": { - "minimist": "0.0.8" - } - }, - "ms": { - "version": "2.0.0", - "bundled": true, - "dev": true - }, - "nanomatch": { - "version": "1.2.9", - "bundled": true, - "dev": true, - "requires": { - "arr-diff": "^4.0.0", - "array-unique": "^0.3.2", - "define-property": "^2.0.2", - "extend-shallow": "^3.0.2", - "fragment-cache": "^0.2.1", - "is-odd": "^2.0.0", - "is-windows": "^1.0.2", - "kind-of": "^6.0.2", - "object.pick": "^1.3.0", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.1" - }, - "dependencies": { - "kind-of": { - "version": "6.0.2", - "bundled": true, - "dev": true - } - } - }, - "normalize-package-data": { - "version": "2.4.0", - "bundled": true, - "dev": true, - "requires": { - "hosted-git-info": "^2.1.4", - "is-builtin-module": "^1.0.0", - "semver": "2 || 3 || 4 || 5", - "validate-npm-package-license": "^3.0.1" - } - }, - "npm-run-path": { - "version": "2.0.2", - "bundled": true, - "dev": true, - "requires": { - "path-key": "^2.0.0" - } - }, - "number-is-nan": { - "version": "1.0.1", - "bundled": true, - "dev": true - }, - "object-assign": { - "version": "4.1.1", - "bundled": true, - "dev": true - }, - "object-copy": { - "version": "0.1.0", - "bundled": true, - "dev": true, - "requires": { - "copy-descriptor": "^0.1.0", - "define-property": "^0.2.5", - "kind-of": "^3.0.3" - }, - "dependencies": { - "define-property": { - "version": "0.2.5", - "bundled": true, - "dev": true, - "requires": { - "is-descriptor": "^0.1.0" - } - } - } - }, - "object-visit": { - "version": "1.0.1", - "bundled": true, - "dev": true, - "requires": { - "isobject": "^3.0.0" - } - }, - "object.pick": { - "version": "1.3.0", - "bundled": true, - "dev": true, - "requires": { - "isobject": "^3.0.1" - } - }, - "once": { - "version": "1.4.0", - "bundled": true, - "dev": true, - "requires": { - "wrappy": "1" - } - }, - "optimist": { - "version": "0.6.1", - "bundled": true, - "dev": true, - "requires": { - "minimist": "~0.0.1", - "wordwrap": "~0.0.2" - } - }, - "os-homedir": { - "version": "1.0.2", - "bundled": true, - "dev": true - }, - "os-locale": { - "version": "2.1.0", - "bundled": true, - "dev": true, - "requires": { - "execa": "^0.7.0", - "lcid": "^1.0.0", - "mem": "^1.1.0" - } - }, - "p-finally": { - "version": "1.0.0", - "bundled": true, - "dev": true - }, - "p-limit": { - "version": "1.2.0", - "bundled": true, - "dev": true, - "requires": { - "p-try": "^1.0.0" - } - }, - "p-locate": { - "version": "2.0.0", - "bundled": true, - "dev": true, - "requires": { - "p-limit": "^1.1.0" - } - }, - "p-try": { - "version": "1.0.0", - "bundled": true, - "dev": true - }, - "parse-json": { - "version": "2.2.0", - "bundled": true, - "dev": true, - "requires": { - "error-ex": "^1.2.0" - } - }, - "pascalcase": { - "version": "0.1.1", - "bundled": true, - "dev": true - }, - "path-exists": { - "version": "2.1.0", - "bundled": true, - "dev": true, - "requires": { - "pinkie-promise": "^2.0.0" - } - }, - "path-is-absolute": { - "version": "1.0.1", - "bundled": true, - "dev": true - }, - "path-key": { - "version": "2.0.1", - "bundled": true, - "dev": true - }, - "path-parse": { - "version": "1.0.5", - "bundled": true, - "dev": true - }, - "path-type": { - "version": "1.1.0", - "bundled": true, - "dev": true, - "requires": { - "graceful-fs": "^4.1.2", - "pify": "^2.0.0", - "pinkie-promise": "^2.0.0" - } - }, - "pify": { - "version": "2.3.0", - "bundled": true, - "dev": true - }, - "pinkie": { - "version": "2.0.4", - "bundled": true, - "dev": true - }, - "pinkie-promise": { - "version": "2.0.1", - "bundled": true, - "dev": true, - "requires": { - "pinkie": "^2.0.0" - } - }, - "pkg-dir": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "requires": { - "find-up": "^1.0.0" - }, - "dependencies": { - "find-up": { - "version": "1.1.2", - "bundled": true, - "dev": true, - "requires": { - "path-exists": "^2.0.0", - "pinkie-promise": "^2.0.0" - } - } - } - }, - "posix-character-classes": { - "version": "0.1.1", - "bundled": true, - "dev": true - }, - "pseudomap": { - "version": "1.0.2", - "bundled": true, - "dev": true - }, - "read-pkg": { - "version": "1.1.0", - "bundled": true, - "dev": true, - "requires": { - "load-json-file": "^1.0.0", - "normalize-package-data": "^2.3.2", - "path-type": "^1.0.0" - } - }, - "read-pkg-up": { - "version": "1.0.1", - "bundled": true, - "dev": true, - "requires": { - "find-up": "^1.0.0", - "read-pkg": "^1.0.0" - }, - "dependencies": { - "find-up": { - "version": "1.1.2", - "bundled": true, - "dev": true, - "requires": { - "path-exists": "^2.0.0", - "pinkie-promise": "^2.0.0" - } - } - } - }, - "regenerator-runtime": { - "version": "0.11.1", - "bundled": true, - "dev": true - }, - "regex-not": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "requires": { - "extend-shallow": "^3.0.2", - "safe-regex": "^1.1.0" - } - }, - "repeat-element": { - "version": "1.1.2", - "bundled": true, - "dev": true - }, - "repeat-string": { - "version": "1.6.1", - "bundled": true, - "dev": true - }, - "repeating": { - "version": "2.0.1", - "bundled": true, - "dev": true, - "requires": { - "is-finite": "^1.0.0" - } - }, - "require-directory": { - "version": "2.1.1", - "bundled": true, - "dev": true - }, - "require-main-filename": { - "version": "1.0.1", - "bundled": true, - "dev": true - }, - "resolve-from": { - "version": "2.0.0", - "bundled": true, - "dev": true - }, - "resolve-url": { - "version": "0.2.1", - "bundled": true, - "dev": true - }, - "ret": { - "version": "0.1.15", - "bundled": true, - "dev": true - }, - "right-align": { - "version": "0.1.3", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "align-text": "^0.1.1" - } - }, - "rimraf": { - "version": "2.6.2", - "bundled": true, - "dev": true, - "requires": { - "glob": "^7.0.5" - } - }, - "safe-regex": { - "version": "1.1.0", - "bundled": true, - "dev": true, - "requires": { - "ret": "~0.1.10" - } - }, - "semver": { - "version": "5.5.0", - "bundled": true, - "dev": true - }, - "set-blocking": { - "version": "2.0.0", - "bundled": true, - "dev": true - }, - "set-value": { - "version": "2.0.0", - "bundled": true, - "dev": true, - "requires": { - "extend-shallow": "^2.0.1", - "is-extendable": "^0.1.1", - "is-plain-object": "^2.0.3", - "split-string": "^3.0.1" - }, - "dependencies": { - "extend-shallow": { - "version": "2.0.1", - "bundled": true, - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - } - } - }, - "shebang-command": { - "version": "1.2.0", - "bundled": true, - "dev": true, - "requires": { - "shebang-regex": "^1.0.0" - } - }, - "shebang-regex": { - "version": "1.0.0", - "bundled": true, - "dev": true - }, - "signal-exit": { - "version": "3.0.2", - "bundled": true, - "dev": true - }, - "slide": { - "version": "1.1.6", - "bundled": true, - "dev": true - }, - "snapdragon": { - "version": "0.8.2", - "bundled": true, - "dev": true, - "requires": { - "base": "^0.11.1", - "debug": "^2.2.0", - "define-property": "^0.2.5", - "extend-shallow": "^2.0.1", - "map-cache": "^0.2.2", - "source-map": "^0.5.6", - "source-map-resolve": "^0.5.0", - "use": "^3.1.0" - }, - "dependencies": { - "define-property": { - "version": "0.2.5", - "bundled": true, - "dev": true, - "requires": { - "is-descriptor": "^0.1.0" - } - }, - "extend-shallow": { - "version": "2.0.1", - "bundled": true, - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - } - } - }, - "snapdragon-node": { - "version": "2.1.1", - "bundled": true, - "dev": true, - "requires": { - "define-property": "^1.0.0", - "isobject": "^3.0.0", - "snapdragon-util": "^3.0.1" - }, - "dependencies": { - "define-property": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "requires": { - "is-descriptor": "^1.0.0" - } - }, - "is-accessor-descriptor": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-data-descriptor": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-descriptor": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "requires": { - "is-accessor-descriptor": "^1.0.0", - "is-data-descriptor": "^1.0.0", - "kind-of": "^6.0.2" - } - }, - "kind-of": { - "version": "6.0.2", - "bundled": true, - "dev": true - } - } - }, - "snapdragon-util": { - "version": "3.0.1", - "bundled": true, - "dev": true, - "requires": { - "kind-of": "^3.2.0" - } - }, - "source-map": { - "version": "0.5.7", - "bundled": true, - "dev": true - }, - "source-map-resolve": { - "version": "0.5.1", - "bundled": true, - "dev": true, - "requires": { - "atob": "^2.0.0", - "decode-uri-component": "^0.2.0", - "resolve-url": "^0.2.1", - "source-map-url": "^0.4.0", - "urix": "^0.1.0" - } - }, - "source-map-url": { - "version": "0.4.0", - "bundled": true, - "dev": true - }, - "spawn-wrap": { - "version": "1.4.2", - "bundled": true, - "dev": true, - "requires": { - "foreground-child": "^1.5.6", - "mkdirp": "^0.5.0", - "os-homedir": "^1.0.1", - "rimraf": "^2.6.2", - "signal-exit": "^3.0.2", - "which": "^1.3.0" - } - }, - "spdx-correct": { - "version": "3.0.0", - "bundled": true, - "dev": true, - "requires": { - "spdx-expression-parse": "^3.0.0", - "spdx-license-ids": "^3.0.0" - } - }, - "spdx-exceptions": { - "version": "2.1.0", - "bundled": true, - "dev": true - }, - "spdx-expression-parse": { - "version": "3.0.0", - "bundled": true, - "dev": true, - "requires": { - "spdx-exceptions": "^2.1.0", - "spdx-license-ids": "^3.0.0" - } - }, - "spdx-license-ids": { - "version": "3.0.0", - "bundled": true, - "dev": true - }, - "split-string": { - "version": "3.1.0", - "bundled": true, - "dev": true, - "requires": { - "extend-shallow": "^3.0.0" - } - }, - "static-extend": { - "version": "0.1.2", - "bundled": true, - "dev": true, - "requires": { - "define-property": "^0.2.5", - "object-copy": "^0.1.0" - }, - "dependencies": { - "define-property": { - "version": "0.2.5", - "bundled": true, - "dev": true, - "requires": { - "is-descriptor": "^0.1.0" - } - } - } - }, - "string-width": { - "version": "2.1.1", - "bundled": true, - "dev": true, - "requires": { - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^4.0.0" - }, - "dependencies": { - "ansi-regex": { - "version": "3.0.0", - "bundled": true, - "dev": true - }, - "strip-ansi": { - "version": "4.0.0", - "bundled": true, - "dev": true, - "requires": { - "ansi-regex": "^3.0.0" - } - } - } - }, - "strip-ansi": { - "version": "3.0.1", - "bundled": true, - "dev": true, - "requires": { - "ansi-regex": "^2.0.0" - } - }, - "strip-bom": { - "version": "2.0.0", - "bundled": true, - "dev": true, - "requires": { - "is-utf8": "^0.2.0" - } - }, - "strip-eof": { - "version": "1.0.0", - "bundled": true, - "dev": true - }, - "supports-color": { - "version": "2.0.0", - "bundled": true, - "dev": true - }, - "test-exclude": { - "version": "4.2.1", - "bundled": true, - "dev": true, - "requires": { - "arrify": "^1.0.1", - "micromatch": "^3.1.8", - "object-assign": "^4.1.0", - "read-pkg-up": "^1.0.1", - "require-main-filename": "^1.0.1" - } - }, - "to-fast-properties": { - "version": "1.0.3", - "bundled": true, - "dev": true - }, - "to-object-path": { - "version": "0.3.0", - "bundled": true, - "dev": true, - "requires": { - "kind-of": "^3.0.2" - } - }, - "to-regex": { - "version": "3.0.2", - "bundled": true, - "dev": true, - "requires": { - "define-property": "^2.0.2", - "extend-shallow": "^3.0.2", - "regex-not": "^1.0.2", - "safe-regex": "^1.1.0" - } - }, - "to-regex-range": { - "version": "2.1.1", - "bundled": true, - "dev": true, - "requires": { - "is-number": "^3.0.0", - "repeat-string": "^1.6.1" - } - }, - "trim-right": { - "version": "1.0.1", - "bundled": true, - "dev": true - }, - "uglify-js": { - "version": "2.8.29", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "source-map": "~0.5.1", - "uglify-to-browserify": "~1.0.0", - "yargs": "~3.10.0" - }, - "dependencies": { - "yargs": { - "version": "3.10.0", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "camelcase": "^1.0.2", - "cliui": "^2.1.0", - "decamelize": "^1.0.0", - "window-size": "0.1.0" - } - } - } - }, - "uglify-to-browserify": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "optional": true - }, - "union-value": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "requires": { - "arr-union": "^3.1.0", - "get-value": "^2.0.6", - "is-extendable": "^0.1.1", - "set-value": "^0.4.3" - }, - "dependencies": { - "extend-shallow": { - "version": "2.0.1", - "bundled": true, - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - }, - "set-value": { - "version": "0.4.3", - "bundled": true, - "dev": true, - "requires": { - "extend-shallow": "^2.0.1", - "is-extendable": "^0.1.1", - "is-plain-object": "^2.0.1", - "to-object-path": "^0.3.0" - } - } - } - }, - "unset-value": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "requires": { - "has-value": "^0.3.1", - "isobject": "^3.0.0" - }, - "dependencies": { - "has-value": { - "version": "0.3.1", - "bundled": true, - "dev": true, - "requires": { - "get-value": "^2.0.3", - "has-values": "^0.1.4", - "isobject": "^2.0.0" - }, - "dependencies": { - "isobject": { - "version": "2.1.0", - "bundled": true, - "dev": true, - "requires": { - "isarray": "1.0.0" - } - } - } - }, - "has-values": { - "version": "0.1.4", - "bundled": true, - "dev": true - } - } - }, - "urix": { - "version": "0.1.0", - "bundled": true, - "dev": true - }, - "use": { - "version": "3.1.0", - "bundled": true, - "dev": true, - "requires": { - "kind-of": "^6.0.2" - }, - "dependencies": { - "kind-of": { - "version": "6.0.2", - "bundled": true, - "dev": true - } - } - }, - "validate-npm-package-license": { - "version": "3.0.3", - "bundled": true, - "dev": true, - "requires": { - "spdx-correct": "^3.0.0", - "spdx-expression-parse": "^3.0.0" - } - }, - "which": { - "version": "1.3.0", - "bundled": true, - "dev": true, - "requires": { - "isexe": "^2.0.0" - } - }, - "which-module": { - "version": "2.0.0", - "bundled": true, - "dev": true - }, - "window-size": { - "version": "0.1.0", - "bundled": true, - "dev": true, - "optional": true - }, - "wordwrap": { - "version": "0.0.3", - "bundled": true, - "dev": true - }, - "wrap-ansi": { - "version": "2.1.0", - "bundled": true, - "dev": true, - "requires": { - "string-width": "^1.0.1", - "strip-ansi": "^3.0.1" - }, - "dependencies": { - "is-fullwidth-code-point": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "requires": { - "number-is-nan": "^1.0.0" - } - }, - "string-width": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "requires": { - "code-point-at": "^1.0.0", - "is-fullwidth-code-point": "^1.0.0", - "strip-ansi": "^3.0.0" - } - } - } - }, - "wrappy": { - "version": "1.0.2", - "bundled": true, - "dev": true - }, - "write-file-atomic": { - "version": "1.3.4", - "bundled": true, - "dev": true, - "requires": { - "graceful-fs": "^4.1.11", - "imurmurhash": "^0.1.4", - "slide": "^1.1.5" - } - }, - "y18n": { - "version": "3.2.1", - "bundled": true, - "dev": true - }, - "yallist": { - "version": "2.1.2", - "bundled": true, - "dev": true - }, - "yargs": { - "version": "11.1.0", - "bundled": true, - "dev": true, - "requires": { - "cliui": "^4.0.0", - "decamelize": "^1.1.1", - "find-up": "^2.1.0", - "get-caller-file": "^1.0.1", - "os-locale": "^2.0.0", - "require-directory": "^2.1.1", - "require-main-filename": "^1.0.1", - "set-blocking": "^2.0.0", - "string-width": "^2.0.0", - "which-module": "^2.0.0", - "y18n": "^3.2.1", - "yargs-parser": "^9.0.2" - }, - "dependencies": { - "ansi-regex": { - "version": "3.0.0", - "bundled": true, - "dev": true - }, - "camelcase": { - "version": "4.1.0", - "bundled": true, - "dev": true - }, - "cliui": { - "version": "4.1.0", - "bundled": true, - "dev": true, - "requires": { - "string-width": "^2.1.1", - "strip-ansi": "^4.0.0", - "wrap-ansi": "^2.0.0" - } - }, - "strip-ansi": { - "version": "4.0.0", - "bundled": true, - "dev": true, - "requires": { - "ansi-regex": "^3.0.0" - } - }, - "yargs-parser": { - "version": "9.0.2", - "bundled": true, - "dev": true, - "requires": { - "camelcase": "^4.1.0" - } - } - } - }, - "yargs-parser": { - "version": "8.1.0", - "bundled": true, - "dev": true, - "requires": { - "camelcase": "^4.1.0" - }, - "dependencies": { - "camelcase": { - "version": "4.1.0", - "bundled": true, - "dev": true - } - } - } - } - }, - "os-locale": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-3.0.1.tgz", - "integrity": "sha512-7g5e7dmXPtzcP4bgsZ8ixDVqA7oWYuEz4lOSujeWyliPai4gfVDiFIcwBg3aGCPnmSGfzOKTK3ccPn0CKv3DBw==", - "dev": true, - "requires": { - "execa": "^0.10.0", - "lcid": "^2.0.0", - "mem": "^4.0.0" - } - }, - "p-limit": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.0.0.tgz", - "integrity": "sha512-fl5s52lI5ahKCernzzIyAP0QAZbGIovtVHGwpcu1Jr/EpzLVDI2myISHwGqK7m8uQFugVWSrbxH7XnhGtvEc+A==", - "dev": true, - "requires": { - "p-try": "^2.0.0" - } - }, - "p-locate": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", - "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", - "dev": true, - "requires": { - "p-limit": "^2.0.0" - } - }, - "p-try": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.0.0.tgz", - "integrity": "sha512-hMp0onDKIajHfIkdRk3P4CdCmErkYAxxDtP3Wx/4nZ3aGlau2VKh3mZpcuFkH27WQkL/3WBCPOktzA9ZOAnMQQ==", - "dev": true - }, - "string-width": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", - "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", - "dev": true, - "requires": { - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^4.0.0" - } - }, - "strip-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", - "dev": true, - "requires": { - "ansi-regex": "^3.0.0" - } - }, - "yargs": { - "version": "12.0.2", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-12.0.2.tgz", - "integrity": "sha512-e7SkEx6N6SIZ5c5H22RTZae61qtn3PYUE8JYbBFlK9sYmh3DMQ6E5ygtaG/2BW0JZi4WGgTR2IV5ChqlqrDGVQ==", - "dev": true, - "requires": { - "cliui": "^4.0.0", - "decamelize": "^2.0.0", - "find-up": "^3.0.0", - "get-caller-file": "^1.0.1", - "os-locale": "^3.0.0", - "require-directory": "^2.1.1", - "require-main-filename": "^1.0.1", - "set-blocking": "^2.0.0", - "string-width": "^2.0.0", - "which-module": "^2.0.0", - "y18n": "^3.2.1 || ^4.0.0", - "yargs-parser": "^10.1.0" - } - } - } - }, - "@grpc/grpc-js": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/@grpc/grpc-js/-/grpc-js-0.2.0.tgz", - "integrity": "sha512-89xjKxo3iuc8Gsln3brtXfTUV8H2UPzWBEJ/iVD1YlSqp+LomEC1L700/PwyWRCX4rdJnOpuv4RCGE8zrOSlyA==", - "requires": { - "lodash": "^4.17.4" - } - }, - "@grpc/proto-loader": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/@grpc/proto-loader/-/proto-loader-0.3.0.tgz", - "integrity": "sha512-9b8S/V+3W4Gv7G/JKSZ48zApgyYbfIR7mAC9XNnaSWme3zj57MIESu0ELzm9j5oxNIpFG8DgO00iJMIUZ5luqw==", - "requires": { - "@types/lodash": "^4.14.104", - "@types/node": "^9.4.6", - "lodash": "^4.17.5", - "protobufjs": "^6.8.6" - } - }, - "@ladjs/time-require": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/@ladjs/time-require/-/time-require-0.1.4.tgz", - "integrity": "sha512-weIbJqTMfQ4r1YX85u54DKfjLZs2jwn1XZ6tIOP/pFgMwhIN5BAtaCp/1wn9DzyLsDR9tW0R2NIePcVJ45ivQQ==", - "dev": true, - "requires": { - "chalk": "^0.4.0", - "date-time": "^0.1.1", - "pretty-ms": "^0.2.1", - "text-table": "^0.2.0" - }, - "dependencies": { - "ansi-styles": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-1.0.0.tgz", - "integrity": "sha1-yxAt8cVvUSPquLZ817mAJ6AnkXg=", - "dev": true - }, - "chalk": { - "version": "0.4.0", - "resolved": "http://registry.npmjs.org/chalk/-/chalk-0.4.0.tgz", - "integrity": "sha1-UZmj3c0MHv4jvAjBsCewYXbgxk8=", - "dev": true, - "requires": { - "ansi-styles": "~1.0.0", - "has-color": "~0.1.0", - "strip-ansi": "~0.1.0" - } - }, - "pretty-ms": { - "version": "0.2.2", - "resolved": "http://registry.npmjs.org/pretty-ms/-/pretty-ms-0.2.2.tgz", - "integrity": "sha1-2oeaaC/zOjcBEEbxPWJ/Z8c7hPY=", - "dev": true, - "requires": { - "parse-ms": "^0.1.0" - } - }, - "strip-ansi": { - "version": "0.1.1", - "resolved": "http://registry.npmjs.org/strip-ansi/-/strip-ansi-0.1.1.tgz", - "integrity": "sha1-OeipjQRNFQZgq+SmgIrPcLt7yZE=", - "dev": true - } - } - }, - "@mrmlnc/readdir-enhanced": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/@mrmlnc/readdir-enhanced/-/readdir-enhanced-2.2.1.tgz", - "integrity": "sha512-bPHp6Ji8b41szTOcaP63VlnbbO5Ny6dwAATtY6JTjh5N2OLrb5Qk/Th5cRkRQhkWCt+EJsYrNB0MiL+Gpn6e3g==", - "requires": { - "call-me-maybe": "^1.0.1", - "glob-to-regexp": "^0.3.0" - } - }, - "@nodelib/fs.stat": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-1.1.3.tgz", - "integrity": "sha512-shAmDyaQC4H92APFoIaVDHCx5bStIocgvbwQyxPRrbUY20V1EYTbSDchWbuwlMG3V17cprZhA6+78JfB+3DTPw==" - }, - "@protobufjs/aspromise": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@protobufjs/aspromise/-/aspromise-1.1.2.tgz", - "integrity": "sha1-m4sMxmPWaafY9vXQiToU00jzD78=" - }, - "@protobufjs/base64": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@protobufjs/base64/-/base64-1.1.2.tgz", - "integrity": "sha512-AZkcAA5vnN/v4PDqKyMR5lx7hZttPDgClv83E//FMNhR2TMcLUhfRUBHCmSl0oi9zMgDDqRUJkSxO3wm85+XLg==" - }, - "@protobufjs/codegen": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/@protobufjs/codegen/-/codegen-2.0.4.tgz", - "integrity": "sha512-YyFaikqM5sH0ziFZCN3xDC7zeGaB/d0IUb9CATugHWbd1FRFwWwt4ld4OYMPWu5a3Xe01mGAULCdqhMlPl29Jg==" - }, - "@protobufjs/eventemitter": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@protobufjs/eventemitter/-/eventemitter-1.1.0.tgz", - "integrity": "sha1-NVy8mLr61ZePntCV85diHx0Ga3A=" - }, - "@protobufjs/fetch": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@protobufjs/fetch/-/fetch-1.1.0.tgz", - "integrity": "sha1-upn7WYYUr2VwDBYZ/wbUVLDYTEU=", - "requires": { - "@protobufjs/aspromise": "^1.1.1", - "@protobufjs/inquire": "^1.1.0" - } - }, - "@protobufjs/float": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/@protobufjs/float/-/float-1.0.2.tgz", - "integrity": "sha1-Xp4avctz/Ap8uLKR33jIy9l7h9E=" - }, - "@protobufjs/inquire": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@protobufjs/inquire/-/inquire-1.1.0.tgz", - "integrity": "sha1-/yAOPnzyQp4tyvwRQIKOjMY48Ik=" - }, - "@protobufjs/path": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@protobufjs/path/-/path-1.1.2.tgz", - "integrity": "sha1-bMKyDFya1q0NzP0hynZz2Nf79o0=" - }, - "@protobufjs/pool": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@protobufjs/pool/-/pool-1.1.0.tgz", - "integrity": "sha1-Cf0V8tbTq/qbZbw2ZQbWrXhG/1Q=" - }, - "@protobufjs/utf8": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@protobufjs/utf8/-/utf8-1.1.0.tgz", - "integrity": "sha1-p3c2C1s5oaLlEG+OhY8v0tBgxXA=" - }, - "@sindresorhus/is": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-0.7.0.tgz", - "integrity": "sha512-ONhaKPIufzzrlNbqtWFFd+jlnemX6lJAgq9ZeiZtS7I1PIf/la7CW4m83rTXRnVnsMbW2k56pGYu7AUFJD9Pow==", - "dev": true - }, - "@sindresorhus/slugify": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/@sindresorhus/slugify/-/slugify-0.3.0.tgz", - "integrity": "sha512-kKdS9yWggjFSpTKInwq2hP2X+heBxDeCDF+5D3Xzd+b3yALPHgqLtGzzPiONeXDke7+QFVUkOpReCmU23XQscA==", - "dev": true, - "requires": { - "escape-string-regexp": "^1.0.5", - "lodash.deburr": "^4.1.0" - } - }, - "@sinonjs/formatio": { - "version": "2.0.0", - "resolved": "http://registry.npmjs.org/@sinonjs/formatio/-/formatio-2.0.0.tgz", - "integrity": "sha512-ls6CAMA6/5gG+O/IdsBcblvnd8qcO/l1TYoNeAzp3wcISOxlPXQEus0mLcdwazEkWjaBdaJ3TaxmNgCLWwvWzg==", - "dev": true, - "requires": { - "samsam": "1.3.0" - } - }, - "@sinonjs/samsam": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/@sinonjs/samsam/-/samsam-2.1.0.tgz", - "integrity": "sha512-5x2kFgJYupaF1ns/RmharQ90lQkd2ELS8A9X0ymkAAdemYHGtI2KiUHG8nX2WU0T1qgnOU5YMqnBM2V7NUanNw==", - "dev": true, - "requires": { - "array-from": "^2.1.1" - } - }, - "@types/lodash": { - "version": "4.14.118", - "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.118.tgz", - "integrity": "sha512-iiJbKLZbhSa6FYRip/9ZDX6HXhayXLDGY2Fqws9cOkEQ6XeKfaxB0sC541mowZJueYyMnVUmmG+al5/4fCDrgw==" - }, - "@types/long": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/@types/long/-/long-4.0.0.tgz", - "integrity": "sha512-1w52Nyx4Gq47uuu0EVcsHBxZFJgurQ+rTKS3qMHxR1GY2T8c2AJYd6vZoZ9q1rupaDjU0yT+Jc2XTyXkjeMA+Q==" - }, - "@types/node": { - "version": "9.6.36", - "resolved": "https://registry.npmjs.org/@types/node/-/node-9.6.36.tgz", - "integrity": "sha512-Fbw+AdRLL01vv7Rk7bYaNPecqmKoinJHGbpKnDpbUZmUj/0vj3nLqPQ4CNBzr3q2zso6Cq/4jHoCAdH78fvJrw==" - }, - "acorn": { - "version": "5.7.3", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.7.3.tgz", - "integrity": "sha512-T/zvzYRfbVojPWahDsE5evJdHb3oJoQfFbsrKM7w5Zcs++Tr257tia3BmMP8XYVjp1S9RZXQMh7gao96BlqZOw==" - }, - "acorn-es7-plugin": { - "version": "1.1.7", - "resolved": "https://registry.npmjs.org/acorn-es7-plugin/-/acorn-es7-plugin-1.1.7.tgz", - "integrity": "sha1-8u4fMiipDurRJF+asZIusucdM2s=" - }, - "acorn-jsx": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.0.0.tgz", - "integrity": "sha512-XkB50fn0MURDyww9+UYL3c1yLbOBz0ZFvrdYlGB8l+Ije1oSC75qAqrzSPjYQbdnQUzhlUGNKuesryAv0gxZOg==", - "dev": true - }, - "agent-base": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-4.2.1.tgz", - "integrity": "sha512-JVwXMr9nHYTUXsBFKUqhJwvlcYU/blreOEUkhNR2eXZIvwd+c+o5V4MgDPKWnMS/56awN3TRzIP+KoPn+roQtg==", - "requires": { - "es6-promisify": "^5.0.0" - } - }, - "ajv": { - "version": "5.5.2", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-5.5.2.tgz", - "integrity": "sha1-c7Xuyj+rZT49P5Qis0GtQiBdyWU=", - "dev": true, - "requires": { - "co": "^4.6.0", - "fast-deep-equal": "^1.0.0", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.3.0" - } - }, - "align-text": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/align-text/-/align-text-0.1.4.tgz", - "integrity": "sha1-DNkKVhCT810KmSVsIrcGlDP60Rc=", - "dev": true, - "requires": { - "kind-of": "^3.0.2", - "longest": "^1.0.1", - "repeat-string": "^1.5.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "amdefine": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/amdefine/-/amdefine-1.0.1.tgz", - "integrity": "sha1-SlKCrBZHKek2Gbz9OtFR+BfOkfU=", - "dev": true - }, - "ansi-align": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ansi-align/-/ansi-align-2.0.0.tgz", - "integrity": "sha1-w2rsy6VjuJzrVW82kPCx2eNUf38=", - "dev": true, - "requires": { - "string-width": "^2.0.0" - }, - "dependencies": { - "ansi-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", - "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", - "dev": true - }, - "is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", - "dev": true - }, - "string-width": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", - "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", - "dev": true, - "requires": { - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^4.0.0" - } - }, - "strip-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", - "dev": true, - "requires": { - "ansi-regex": "^3.0.0" - } - } - } - }, - "ansi-escapes": { - "version": "3.1.0", - "resolved": "http://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.1.0.tgz", - "integrity": "sha512-UgAb8H9D41AQnu/PbWlCofQVcnV4Gs2bBJi9eZPxfU/hgglFh3SMDMENRIqdr7H6XFnXdoknctFByVsCOotTVw==", - "dev": true - }, - "ansi-regex": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=" - }, - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "requires": { - "color-convert": "^1.9.0" - } - }, - "anymatch": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-1.3.2.tgz", - "integrity": "sha512-0XNayC8lTHQ2OI8aljNCN3sSx6hsr/1+rlcDAotXJR7C1oZZHCNsfpbKwMjRA3Uqb5tF1Rae2oloTr4xpq+WjA==", - "dev": true, - "requires": { - "micromatch": "^2.1.5", - "normalize-path": "^2.0.0" - }, - "dependencies": { - "arr-diff": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-2.0.0.tgz", - "integrity": "sha1-jzuCf5Vai9ZpaX5KQlasPOrjVs8=", - "dev": true, - "requires": { - "arr-flatten": "^1.0.1" - } - }, - "array-unique": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.2.1.tgz", - "integrity": "sha1-odl8yvy8JiXMcPrc6zalDFiwGlM=", - "dev": true - }, - "braces": { - "version": "1.8.5", - "resolved": "https://registry.npmjs.org/braces/-/braces-1.8.5.tgz", - "integrity": "sha1-uneWLhLf+WnWt2cR6RS3N4V79qc=", - "dev": true, - "requires": { - "expand-range": "^1.8.1", - "preserve": "^0.2.0", - "repeat-element": "^1.1.2" - } - }, - "expand-brackets": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-0.1.5.tgz", - "integrity": "sha1-3wcoTjQqgHzXM6xa9yQR5YHRF3s=", - "dev": true, - "requires": { - "is-posix-bracket": "^0.1.0" - } - }, - "extglob": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/extglob/-/extglob-0.3.2.tgz", - "integrity": "sha1-Lhj/PS9JqydlzskCPwEdqo2DSaE=", - "dev": true, - "requires": { - "is-extglob": "^1.0.0" - } - }, - "is-extglob": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz", - "integrity": "sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA=", - "dev": true - }, - "is-glob": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz", - "integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=", - "dev": true, - "requires": { - "is-extglob": "^1.0.0" - } - }, - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - }, - "micromatch": { - "version": "2.3.11", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-2.3.11.tgz", - "integrity": "sha1-hmd8l9FyCzY0MdBNDRUpO9OMFWU=", - "dev": true, - "requires": { - "arr-diff": "^2.0.0", - "array-unique": "^0.2.1", - "braces": "^1.8.2", - "expand-brackets": "^0.1.4", - "extglob": "^0.3.1", - "filename-regex": "^2.0.0", - "is-extglob": "^1.0.0", - "is-glob": "^2.0.1", - "kind-of": "^3.0.2", - "normalize-path": "^2.0.1", - "object.omit": "^2.0.0", - "parse-glob": "^3.0.4", - "regex-cache": "^0.4.2" - } - } - } - }, - "argparse": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", - "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", - "dev": true, - "requires": { - "sprintf-js": "~1.0.2" - } - }, - "argv": { - "version": "0.0.2", - "resolved": "https://registry.npmjs.org/argv/-/argv-0.0.2.tgz", - "integrity": "sha1-7L0W+JSbFXGDcRsb2jNPN4QBhas=", - "dev": true - }, - "arr-diff": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz", - "integrity": "sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA=" - }, - "arr-exclude": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/arr-exclude/-/arr-exclude-1.0.0.tgz", - "integrity": "sha1-38fC5VKicHI8zaBM8xKMjL/lxjE=", - "dev": true - }, - "arr-flatten": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.1.0.tgz", - "integrity": "sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg==" - }, - "arr-union": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/arr-union/-/arr-union-3.1.0.tgz", - "integrity": "sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ=" - }, - "array-differ": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/array-differ/-/array-differ-1.0.0.tgz", - "integrity": "sha1-7/UuN1gknTO+QCuLuOVkuytdQDE=", - "dev": true - }, - "array-filter": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/array-filter/-/array-filter-1.0.0.tgz", - "integrity": "sha1-uveeYubvTCpMC4MSMtr/7CUfnYM=" - }, - "array-find": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/array-find/-/array-find-1.0.0.tgz", - "integrity": "sha1-bI4obRHtdoMn+OYuzuhzU8o+eLg=", - "dev": true - }, - "array-find-index": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/array-find-index/-/array-find-index-1.0.2.tgz", - "integrity": "sha1-3wEKoSh+Fku9pvlyOwqWoexBh6E=", - "dev": true - }, - "array-from": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/array-from/-/array-from-2.1.1.tgz", - "integrity": "sha1-z+nYwmYoudxa7MYqn12PHzUsEZU=", - "dev": true - }, - "array-union": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/array-union/-/array-union-1.0.2.tgz", - "integrity": "sha1-mjRBDk9OPaI96jdb5b5w8kd47Dk=", - "requires": { - "array-uniq": "^1.0.1" - } - }, - "array-uniq": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/array-uniq/-/array-uniq-1.0.3.tgz", - "integrity": "sha1-r2rId6Jcx/dOBYiUdThY39sk/bY=" - }, - "array-unique": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz", - "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=" - }, - "arrify": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", - "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=" - }, - "ascli": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/ascli/-/ascli-1.0.1.tgz", - "integrity": "sha1-vPpZdKYvGOgcq660lzKrSoj5Brw=", - "requires": { - "colour": "~0.7.1", - "optjs": "~3.2.2" - } - }, - "asn1": { - "version": "0.2.4", - "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz", - "integrity": "sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg==", - "dev": true, - "requires": { - "safer-buffer": "~2.1.0" - } - }, - "assert-plus": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", - "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", - "dev": true - }, - "assign-symbols": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/assign-symbols/-/assign-symbols-1.0.0.tgz", - "integrity": "sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c=" - }, - "async": { - "version": "1.5.2", - "resolved": "http://registry.npmjs.org/async/-/async-1.5.2.tgz", - "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=", - "dev": true - }, - "async-each": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/async-each/-/async-each-1.0.1.tgz", - "integrity": "sha1-GdOGodntxufByF04iu28xW0zYC0=", - "dev": true - }, - "asynckit": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", - "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=", - "dev": true - }, - "atob": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/atob/-/atob-2.1.2.tgz", - "integrity": "sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==" - }, - "auto-bind": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/auto-bind/-/auto-bind-1.2.1.tgz", - "integrity": "sha512-/W9yj1yKmBLwpexwAujeD9YHwYmRuWFGV8HWE7smQab797VeHa4/cnE2NFeDhA+E+5e/OGBI8763EhLjfZ/MXA==", - "dev": true - }, - "ava": { - "version": "0.25.0", - "resolved": "https://registry.npmjs.org/ava/-/ava-0.25.0.tgz", - "integrity": "sha512-4lGNJCf6xL8SvsKVEKxEE46se7JAUIAZoKHw9itTQuwcsydhpAMkBs5gOOiWiwt0JKNIuXWc2/r4r8ZdcNrBEw==", - "dev": true, - "requires": { - "@ava/babel-preset-stage-4": "^1.1.0", - "@ava/babel-preset-transform-test-files": "^3.0.0", - "@ava/write-file-atomic": "^2.2.0", - "@concordance/react": "^1.0.0", - "@ladjs/time-require": "^0.1.4", - "ansi-escapes": "^3.0.0", - "ansi-styles": "^3.1.0", - "arr-flatten": "^1.0.1", - "array-union": "^1.0.1", - "array-uniq": "^1.0.2", - "arrify": "^1.0.0", - "auto-bind": "^1.1.0", - "ava-init": "^0.2.0", - "babel-core": "^6.17.0", - "babel-generator": "^6.26.0", - "babel-plugin-syntax-object-rest-spread": "^6.13.0", - "bluebird": "^3.0.0", - "caching-transform": "^1.0.0", - "chalk": "^2.0.1", - "chokidar": "^1.4.2", - "clean-stack": "^1.1.1", - "clean-yaml-object": "^0.1.0", - "cli-cursor": "^2.1.0", - "cli-spinners": "^1.0.0", - "cli-truncate": "^1.0.0", - "co-with-promise": "^4.6.0", - "code-excerpt": "^2.1.1", - "common-path-prefix": "^1.0.0", - "concordance": "^3.0.0", - "convert-source-map": "^1.5.1", - "core-assert": "^0.2.0", - "currently-unhandled": "^0.4.1", - "debug": "^3.0.1", - "dot-prop": "^4.1.0", - "empower-core": "^0.6.1", - "equal-length": "^1.0.0", - "figures": "^2.0.0", - "find-cache-dir": "^1.0.0", - "fn-name": "^2.0.0", - "get-port": "^3.0.0", - "globby": "^6.0.0", - "has-flag": "^2.0.0", - "hullabaloo-config-manager": "^1.1.0", - "ignore-by-default": "^1.0.0", - "import-local": "^0.1.1", - "indent-string": "^3.0.0", - "is-ci": "^1.0.7", - "is-generator-fn": "^1.0.0", - "is-obj": "^1.0.0", - "is-observable": "^1.0.0", - "is-promise": "^2.1.0", - "last-line-stream": "^1.0.0", - "lodash.clonedeepwith": "^4.5.0", - "lodash.debounce": "^4.0.3", - "lodash.difference": "^4.3.0", - "lodash.flatten": "^4.2.0", - "loud-rejection": "^1.2.0", - "make-dir": "^1.0.0", - "matcher": "^1.0.0", - "md5-hex": "^2.0.0", - "meow": "^3.7.0", - "ms": "^2.0.0", - "multimatch": "^2.1.0", - "observable-to-promise": "^0.5.0", - "option-chain": "^1.0.0", - "package-hash": "^2.0.0", - "pkg-conf": "^2.0.0", - "plur": "^2.0.0", - "pretty-ms": "^3.0.0", - "require-precompiled": "^0.1.0", - "resolve-cwd": "^2.0.0", - "safe-buffer": "^5.1.1", - "semver": "^5.4.1", - "slash": "^1.0.0", - "source-map-support": "^0.5.0", - "stack-utils": "^1.0.1", - "strip-ansi": "^4.0.0", - "strip-bom-buf": "^1.0.0", - "supertap": "^1.0.0", - "supports-color": "^5.0.0", - "trim-off-newlines": "^1.0.1", - "unique-temp-dir": "^1.0.0", - "update-notifier": "^2.3.0" - }, - "dependencies": { - "ansi-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", - "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", - "dev": true - }, - "debug": { - "version": "3.2.6", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", - "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", - "dev": true, - "requires": { - "ms": "^2.1.1" - }, - "dependencies": { - "ms": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", - "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", - "dev": true - } - } - }, - "empower-core": { - "version": "0.6.2", - "resolved": "https://registry.npmjs.org/empower-core/-/empower-core-0.6.2.tgz", - "integrity": "sha1-Wt71ZgiOMfuoC6CjbfR9cJQWkUQ=", - "dev": true, - "requires": { - "call-signature": "0.0.2", - "core-js": "^2.0.0" - } - }, - "globby": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/globby/-/globby-6.1.0.tgz", - "integrity": "sha1-9abXDoOV4hyFj7BInWTfAkJNUGw=", - "dev": true, - "requires": { - "array-union": "^1.0.1", - "glob": "^7.0.3", - "object-assign": "^4.0.1", - "pify": "^2.0.0", - "pinkie-promise": "^2.0.0" - } - }, - "pify": { - "version": "2.3.0", - "resolved": "http://registry.npmjs.org/pify/-/pify-2.3.0.tgz", - "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", - "dev": true - }, - "pinkie": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz", - "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA=", - "dev": true - }, - "pinkie-promise": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", - "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=", - "dev": true, - "requires": { - "pinkie": "^2.0.0" - } - }, - "strip-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", - "dev": true, - "requires": { - "ansi-regex": "^3.0.0" - } - } - } - }, - "ava-init": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/ava-init/-/ava-init-0.2.1.tgz", - "integrity": "sha512-lXwK5LM+2g1euDRqW1mcSX/tqzY1QU7EjKpqayFPPtNRmbSYZ8RzPO5tqluTToijmtjp2M+pNpVdbcHssC4glg==", - "dev": true, - "requires": { - "arr-exclude": "^1.0.0", - "execa": "^0.7.0", - "has-yarn": "^1.0.0", - "read-pkg-up": "^2.0.0", - "write-pkg": "^3.1.0" - } - }, - "aws-sign2": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", - "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=", - "dev": true - }, - "aws4": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.8.0.tgz", - "integrity": "sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ==", - "dev": true - }, - "axios": { - "version": "0.18.0", - "resolved": "http://registry.npmjs.org/axios/-/axios-0.18.0.tgz", - "integrity": "sha1-MtU+SFHv3AoRmTts0AB4nXDAUQI=", - "requires": { - "follow-redirects": "^1.3.0", - "is-buffer": "^1.1.5" - } - }, - "babel-code-frame": { - "version": "6.26.0", - "resolved": "https://registry.npmjs.org/babel-code-frame/-/babel-code-frame-6.26.0.tgz", - "integrity": "sha1-Y/1D99weO7fONZR9uP42mj9Yx0s=", - "dev": true, - "requires": { - "chalk": "^1.1.3", - "esutils": "^2.0.2", - "js-tokens": "^3.0.2" - }, - "dependencies": { - "ansi-styles": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", - "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", - "dev": true - }, - "chalk": { - "version": "1.1.3", - "resolved": "http://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", - "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", - "dev": true, - "requires": { - "ansi-styles": "^2.2.1", - "escape-string-regexp": "^1.0.2", - "has-ansi": "^2.0.0", - "strip-ansi": "^3.0.0", - "supports-color": "^2.0.0" - } - }, - "supports-color": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", - "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", - "dev": true - } - } - }, - "babel-core": { - "version": "6.26.3", - "resolved": "https://registry.npmjs.org/babel-core/-/babel-core-6.26.3.tgz", - "integrity": "sha512-6jyFLuDmeidKmUEb3NM+/yawG0M2bDZ9Z1qbZP59cyHLz8kYGKYwpJP0UwUKKUiTRNvxfLesJnTedqczP7cTDA==", - "dev": true, - "requires": { - "babel-code-frame": "^6.26.0", - "babel-generator": "^6.26.0", - "babel-helpers": "^6.24.1", - "babel-messages": "^6.23.0", - "babel-register": "^6.26.0", - "babel-runtime": "^6.26.0", - "babel-template": "^6.26.0", - "babel-traverse": "^6.26.0", - "babel-types": "^6.26.0", - "babylon": "^6.18.0", - "convert-source-map": "^1.5.1", - "debug": "^2.6.9", - "json5": "^0.5.1", - "lodash": "^4.17.4", - "minimatch": "^3.0.4", - "path-is-absolute": "^1.0.1", - "private": "^0.1.8", - "slash": "^1.0.0", - "source-map": "^0.5.7" - } - }, - "babel-generator": { - "version": "6.26.1", - "resolved": "https://registry.npmjs.org/babel-generator/-/babel-generator-6.26.1.tgz", - "integrity": "sha512-HyfwY6ApZj7BYTcJURpM5tznulaBvyio7/0d4zFOeMPUmfxkCjHocCuoLa2SAGzBI8AREcH3eP3758F672DppA==", - "dev": true, - "requires": { - "babel-messages": "^6.23.0", - "babel-runtime": "^6.26.0", - "babel-types": "^6.26.0", - "detect-indent": "^4.0.0", - "jsesc": "^1.3.0", - "lodash": "^4.17.4", - "source-map": "^0.5.7", - "trim-right": "^1.0.1" - }, - "dependencies": { - "jsesc": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-1.3.0.tgz", - "integrity": "sha1-RsP+yMGJKxKwgz25vHYiF226s0s=", - "dev": true - } - } - }, - "babel-helper-builder-binary-assignment-operator-visitor": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-helper-builder-binary-assignment-operator-visitor/-/babel-helper-builder-binary-assignment-operator-visitor-6.24.1.tgz", - "integrity": "sha1-zORReto1b0IgvK6KAsKzRvmlZmQ=", - "dev": true, - "requires": { - "babel-helper-explode-assignable-expression": "^6.24.1", - "babel-runtime": "^6.22.0", - "babel-types": "^6.24.1" - } - }, - "babel-helper-call-delegate": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-helper-call-delegate/-/babel-helper-call-delegate-6.24.1.tgz", - "integrity": "sha1-7Oaqzdx25Bw0YfiL/Fdb0Nqi340=", - "dev": true, - "requires": { - "babel-helper-hoist-variables": "^6.24.1", - "babel-runtime": "^6.22.0", - "babel-traverse": "^6.24.1", - "babel-types": "^6.24.1" - } - }, - "babel-helper-explode-assignable-expression": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-helper-explode-assignable-expression/-/babel-helper-explode-assignable-expression-6.24.1.tgz", - "integrity": "sha1-8luCz33BBDPFX3BZLVdGQArCLKo=", - "dev": true, - "requires": { - "babel-runtime": "^6.22.0", - "babel-traverse": "^6.24.1", - "babel-types": "^6.24.1" - } - }, - "babel-helper-function-name": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-helper-function-name/-/babel-helper-function-name-6.24.1.tgz", - "integrity": "sha1-00dbjAPtmCQqJbSDUasYOZ01gKk=", - "dev": true, - "requires": { - "babel-helper-get-function-arity": "^6.24.1", - "babel-runtime": "^6.22.0", - "babel-template": "^6.24.1", - "babel-traverse": "^6.24.1", - "babel-types": "^6.24.1" - } - }, - "babel-helper-get-function-arity": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-helper-get-function-arity/-/babel-helper-get-function-arity-6.24.1.tgz", - "integrity": "sha1-j3eCqpNAfEHTqlCQj4mwMbG2hT0=", - "dev": true, - "requires": { - "babel-runtime": "^6.22.0", - "babel-types": "^6.24.1" - } - }, - "babel-helper-hoist-variables": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-helper-hoist-variables/-/babel-helper-hoist-variables-6.24.1.tgz", - "integrity": "sha1-HssnaJydJVE+rbyZFKc/VAi+enY=", - "dev": true, - "requires": { - "babel-runtime": "^6.22.0", - "babel-types": "^6.24.1" - } - }, - "babel-helper-regex": { - "version": "6.26.0", - "resolved": "https://registry.npmjs.org/babel-helper-regex/-/babel-helper-regex-6.26.0.tgz", - "integrity": "sha1-MlxZ+QL4LyS3T6zu0DY5VPZJXnI=", - "dev": true, - "requires": { - "babel-runtime": "^6.26.0", - "babel-types": "^6.26.0", - "lodash": "^4.17.4" - } - }, - "babel-helper-remap-async-to-generator": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-helper-remap-async-to-generator/-/babel-helper-remap-async-to-generator-6.24.1.tgz", - "integrity": "sha1-XsWBgnrXI/7N04HxySg5BnbkVRs=", - "dev": true, - "requires": { - "babel-helper-function-name": "^6.24.1", - "babel-runtime": "^6.22.0", - "babel-template": "^6.24.1", - "babel-traverse": "^6.24.1", - "babel-types": "^6.24.1" - } - }, - "babel-helpers": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-helpers/-/babel-helpers-6.24.1.tgz", - "integrity": "sha1-NHHenK7DiOXIUOWX5Yom3fN2ArI=", - "dev": true, - "requires": { - "babel-runtime": "^6.22.0", - "babel-template": "^6.24.1" - } - }, - "babel-messages": { - "version": "6.23.0", - "resolved": "https://registry.npmjs.org/babel-messages/-/babel-messages-6.23.0.tgz", - "integrity": "sha1-8830cDhYA1sqKVHG7F7fbGLyYw4=", - "dev": true, - "requires": { - "babel-runtime": "^6.22.0" - } - }, - "babel-plugin-check-es2015-constants": { - "version": "6.22.0", - "resolved": "https://registry.npmjs.org/babel-plugin-check-es2015-constants/-/babel-plugin-check-es2015-constants-6.22.0.tgz", - "integrity": "sha1-NRV7EBQm/S/9PaP3XH0ekYNbv4o=", - "dev": true, - "requires": { - "babel-runtime": "^6.22.0" - } - }, - "babel-plugin-espower": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/babel-plugin-espower/-/babel-plugin-espower-2.4.0.tgz", - "integrity": "sha512-/+SRpy7pKgTI28oEHfn1wkuM5QFAdRq8WNsOOih1dVrdV6A/WbNbRZyl0eX5eyDgtb0lOE27PeDFuCX2j8OxVg==", - "dev": true, - "requires": { - "babel-generator": "^6.1.0", - "babylon": "^6.1.0", - "call-matcher": "^1.0.0", - "core-js": "^2.0.0", - "espower-location-detector": "^1.0.0", - "espurify": "^1.6.0", - "estraverse": "^4.1.1" - } - }, - "babel-plugin-syntax-async-functions": { - "version": "6.13.0", - "resolved": "http://registry.npmjs.org/babel-plugin-syntax-async-functions/-/babel-plugin-syntax-async-functions-6.13.0.tgz", - "integrity": "sha1-ytnK0RkbWtY0vzCuCHI5HgZHvpU=", - "dev": true - }, - "babel-plugin-syntax-exponentiation-operator": { - "version": "6.13.0", - "resolved": "http://registry.npmjs.org/babel-plugin-syntax-exponentiation-operator/-/babel-plugin-syntax-exponentiation-operator-6.13.0.tgz", - "integrity": "sha1-nufoM3KQ2pUoggGmpX9BcDF4MN4=", - "dev": true - }, - "babel-plugin-syntax-object-rest-spread": { - "version": "6.13.0", - "resolved": "http://registry.npmjs.org/babel-plugin-syntax-object-rest-spread/-/babel-plugin-syntax-object-rest-spread-6.13.0.tgz", - "integrity": "sha1-/WU28rzhODb/o6VFjEkDpZe7O/U=", - "dev": true - }, - "babel-plugin-syntax-trailing-function-commas": { - "version": "6.22.0", - "resolved": "https://registry.npmjs.org/babel-plugin-syntax-trailing-function-commas/-/babel-plugin-syntax-trailing-function-commas-6.22.0.tgz", - "integrity": "sha1-ugNgk3+NBuQBgKQ/4NVhb/9TLPM=", - "dev": true - }, - "babel-plugin-transform-async-to-generator": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-async-to-generator/-/babel-plugin-transform-async-to-generator-6.24.1.tgz", - "integrity": "sha1-ZTbjeK/2yx1VF6wOQOs+n8jQh2E=", - "dev": true, - "requires": { - "babel-helper-remap-async-to-generator": "^6.24.1", - "babel-plugin-syntax-async-functions": "^6.8.0", - "babel-runtime": "^6.22.0" - } - }, - "babel-plugin-transform-es2015-destructuring": { - "version": "6.23.0", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-destructuring/-/babel-plugin-transform-es2015-destructuring-6.23.0.tgz", - "integrity": "sha1-mXux8auWf2gtKwh2/jWNYOdlxW0=", - "dev": true, - "requires": { - "babel-runtime": "^6.22.0" - } - }, - "babel-plugin-transform-es2015-function-name": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-function-name/-/babel-plugin-transform-es2015-function-name-6.24.1.tgz", - "integrity": "sha1-g0yJhTvDaxrw86TF26qU/Y6sqos=", - "dev": true, - "requires": { - "babel-helper-function-name": "^6.24.1", - "babel-runtime": "^6.22.0", - "babel-types": "^6.24.1" - } - }, - "babel-plugin-transform-es2015-modules-commonjs": { - "version": "6.26.2", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-modules-commonjs/-/babel-plugin-transform-es2015-modules-commonjs-6.26.2.tgz", - "integrity": "sha512-CV9ROOHEdrjcwhIaJNBGMBCodN+1cfkwtM1SbUHmvyy35KGT7fohbpOxkE2uLz1o6odKK2Ck/tz47z+VqQfi9Q==", - "dev": true, - "requires": { - "babel-plugin-transform-strict-mode": "^6.24.1", - "babel-runtime": "^6.26.0", - "babel-template": "^6.26.0", - "babel-types": "^6.26.0" - } - }, - "babel-plugin-transform-es2015-parameters": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-parameters/-/babel-plugin-transform-es2015-parameters-6.24.1.tgz", - "integrity": "sha1-V6w1GrScrxSpfNE7CfZv3wpiXys=", - "dev": true, - "requires": { - "babel-helper-call-delegate": "^6.24.1", - "babel-helper-get-function-arity": "^6.24.1", - "babel-runtime": "^6.22.0", - "babel-template": "^6.24.1", - "babel-traverse": "^6.24.1", - "babel-types": "^6.24.1" - } - }, - "babel-plugin-transform-es2015-spread": { - "version": "6.22.0", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-spread/-/babel-plugin-transform-es2015-spread-6.22.0.tgz", - "integrity": "sha1-1taKmfia7cRTbIGlQujdnxdG+NE=", - "dev": true, - "requires": { - "babel-runtime": "^6.22.0" - } - }, - "babel-plugin-transform-es2015-sticky-regex": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-sticky-regex/-/babel-plugin-transform-es2015-sticky-regex-6.24.1.tgz", - "integrity": "sha1-AMHNsaynERLN8M9hJsLta0V8zbw=", - "dev": true, - "requires": { - "babel-helper-regex": "^6.24.1", - "babel-runtime": "^6.22.0", - "babel-types": "^6.24.1" - } - }, - "babel-plugin-transform-es2015-unicode-regex": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-unicode-regex/-/babel-plugin-transform-es2015-unicode-regex-6.24.1.tgz", - "integrity": "sha1-04sS9C6nMj9yk4fxinxa4frrNek=", - "dev": true, - "requires": { - "babel-helper-regex": "^6.24.1", - "babel-runtime": "^6.22.0", - "regexpu-core": "^2.0.0" - } - }, - "babel-plugin-transform-exponentiation-operator": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-exponentiation-operator/-/babel-plugin-transform-exponentiation-operator-6.24.1.tgz", - "integrity": "sha1-KrDJx/MJj6SJB3cruBP+QejeOg4=", - "dev": true, - "requires": { - "babel-helper-builder-binary-assignment-operator-visitor": "^6.24.1", - "babel-plugin-syntax-exponentiation-operator": "^6.8.0", - "babel-runtime": "^6.22.0" - } - }, - "babel-plugin-transform-strict-mode": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-strict-mode/-/babel-plugin-transform-strict-mode-6.24.1.tgz", - "integrity": "sha1-1fr3qleKZbvlkc9e2uBKDGcCB1g=", - "dev": true, - "requires": { - "babel-runtime": "^6.22.0", - "babel-types": "^6.24.1" - } - }, - "babel-register": { - "version": "6.26.0", - "resolved": "https://registry.npmjs.org/babel-register/-/babel-register-6.26.0.tgz", - "integrity": "sha1-btAhFz4vy0htestFxgCahW9kcHE=", - "dev": true, - "requires": { - "babel-core": "^6.26.0", - "babel-runtime": "^6.26.0", - "core-js": "^2.5.0", - "home-or-tmp": "^2.0.0", - "lodash": "^4.17.4", - "mkdirp": "^0.5.1", - "source-map-support": "^0.4.15" - }, - "dependencies": { - "source-map-support": { - "version": "0.4.18", - "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.4.18.tgz", - "integrity": "sha512-try0/JqxPLF9nOjvSta7tVondkP5dwgyLDjVoyMDlmjugT2lRZ1OfsrYTkCd2hkDnJTKRbO/Rl3orm8vlsUzbA==", - "dev": true, - "requires": { - "source-map": "^0.5.6" - } - } - } - }, - "babel-runtime": { - "version": "6.26.0", - "resolved": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.26.0.tgz", - "integrity": "sha1-llxwWGaOgrVde/4E/yM3vItWR/4=", - "dev": true, - "requires": { - "core-js": "^2.4.0", - "regenerator-runtime": "^0.11.0" - } - }, - "babel-template": { - "version": "6.26.0", - "resolved": "https://registry.npmjs.org/babel-template/-/babel-template-6.26.0.tgz", - "integrity": "sha1-3gPi0WOWsGn0bdn/+FIfsaDjXgI=", - "dev": true, - "requires": { - "babel-runtime": "^6.26.0", - "babel-traverse": "^6.26.0", - "babel-types": "^6.26.0", - "babylon": "^6.18.0", - "lodash": "^4.17.4" - } - }, - "babel-traverse": { - "version": "6.26.0", - "resolved": "https://registry.npmjs.org/babel-traverse/-/babel-traverse-6.26.0.tgz", - "integrity": "sha1-RqnL1+3MYsjlwGTi0tjQ9ANXZu4=", - "dev": true, - "requires": { - "babel-code-frame": "^6.26.0", - "babel-messages": "^6.23.0", - "babel-runtime": "^6.26.0", - "babel-types": "^6.26.0", - "babylon": "^6.18.0", - "debug": "^2.6.8", - "globals": "^9.18.0", - "invariant": "^2.2.2", - "lodash": "^4.17.4" - } - }, - "babel-types": { - "version": "6.26.0", - "resolved": "https://registry.npmjs.org/babel-types/-/babel-types-6.26.0.tgz", - "integrity": "sha1-o7Bz+Uq0nrb6Vc1lInozQ4BjJJc=", - "dev": true, - "requires": { - "babel-runtime": "^6.26.0", - "esutils": "^2.0.2", - "lodash": "^4.17.4", - "to-fast-properties": "^1.0.3" - } - }, - "babylon": { - "version": "6.18.0", - "resolved": "https://registry.npmjs.org/babylon/-/babylon-6.18.0.tgz", - "integrity": "sha512-q/UEjfGJ2Cm3oKV71DJz9d25TPnq5rhBVL2Q4fA5wcC3jcrdn7+SssEybFIxwAvvP+YCsCYNKughoF33GxgycQ==", - "dev": true - }, - "balanced-match": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", - "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=" - }, - "base": { - "version": "0.11.2", - "resolved": "https://registry.npmjs.org/base/-/base-0.11.2.tgz", - "integrity": "sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg==", - "requires": { - "cache-base": "^1.0.1", - "class-utils": "^0.3.5", - "component-emitter": "^1.2.1", - "define-property": "^1.0.0", - "isobject": "^3.0.1", - "mixin-deep": "^1.2.0", - "pascalcase": "^0.1.1" - }, - "dependencies": { - "define-property": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", - "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", - "requires": { - "is-descriptor": "^1.0.0" - } - }, - "is-accessor-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", - "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-data-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", - "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-descriptor": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", - "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", - "requires": { - "is-accessor-descriptor": "^1.0.0", - "is-data-descriptor": "^1.0.0", - "kind-of": "^6.0.2" - } - } - } - }, - "bcrypt-pbkdf": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", - "integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=", - "dev": true, - "requires": { - "tweetnacl": "^0.14.3" - } - }, - "binary-extensions": { - "version": "1.12.0", - "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-1.12.0.tgz", - "integrity": "sha512-DYWGk01lDcxeS/K9IHPGWfT8PsJmbXRtRd2Sx72Tnb8pcYZQFF1oSDb8hJtS1vhp212q1Rzi5dUf9+nq0o9UIg==", - "dev": true - }, - "bluebird": { - "version": "3.5.2", - "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.5.2.tgz", - "integrity": "sha512-dhHTWMI7kMx5whMQntl7Vr9C6BvV10lFXDAasnqnrMYhXVCzzk6IO9Fo2L75jXHT07WrOngL1WDXOp+yYS91Yg==", - "dev": true - }, - "boxen": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/boxen/-/boxen-1.3.0.tgz", - "integrity": "sha512-TNPjfTr432qx7yOjQyaXm3dSR0MH9vXp7eT1BFSl/C51g+EFnOR9hTg1IreahGBmDNCehscshe45f+C1TBZbLw==", - "dev": true, - "requires": { - "ansi-align": "^2.0.0", - "camelcase": "^4.0.0", - "chalk": "^2.0.1", - "cli-boxes": "^1.0.0", - "string-width": "^2.0.0", - "term-size": "^1.2.0", - "widest-line": "^2.0.0" - }, - "dependencies": { - "ansi-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", - "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", - "dev": true - }, - "camelcase": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz", - "integrity": "sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0=", - "dev": true - }, - "is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", - "dev": true - }, - "string-width": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", - "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", - "dev": true, - "requires": { - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^4.0.0" - } - }, - "strip-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", - "dev": true, - "requires": { - "ansi-regex": "^3.0.0" - } - } - } - }, - "brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "requires": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "braces": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", - "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", - "requires": { - "arr-flatten": "^1.1.0", - "array-unique": "^0.3.2", - "extend-shallow": "^2.0.1", - "fill-range": "^4.0.0", - "isobject": "^3.0.1", - "repeat-element": "^1.1.2", - "snapdragon": "^0.8.1", - "snapdragon-node": "^2.0.1", - "split-string": "^3.0.2", - "to-regex": "^3.0.1" - }, - "dependencies": { - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "requires": { - "is-extendable": "^0.1.0" - } - } - } - }, - "browser-stdout": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz", - "integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==", - "dev": true - }, - "buf-compare": { - "version": "1.0.1", - "resolved": "http://registry.npmjs.org/buf-compare/-/buf-compare-1.0.1.tgz", - "integrity": "sha1-/vKNqLgROgoNtEMLC2Rntpcws0o=", - "dev": true - }, - "buffer-equal-constant-time": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz", - "integrity": "sha1-+OcRMvf/5uAaXJaXpMbz5I1cyBk=" - }, - "buffer-from": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz", - "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==", - "dev": true - }, - "builtin-modules": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz", - "integrity": "sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8=", - "dev": true - }, - "bytebuffer": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/bytebuffer/-/bytebuffer-5.0.1.tgz", - "integrity": "sha1-WC7qSxqHO20CCkjVjfhfC7ps/d0=", - "requires": { - "long": "~3" - }, - "dependencies": { - "long": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/long/-/long-3.2.0.tgz", - "integrity": "sha1-2CG3E4yhy1gcFymQ7xTbIAtcR0s=" - } - } - }, - "cache-base": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/cache-base/-/cache-base-1.0.1.tgz", - "integrity": "sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ==", - "requires": { - "collection-visit": "^1.0.0", - "component-emitter": "^1.2.1", - "get-value": "^2.0.6", - "has-value": "^1.0.0", - "isobject": "^3.0.1", - "set-value": "^2.0.0", - "to-object-path": "^0.3.0", - "union-value": "^1.0.0", - "unset-value": "^1.0.0" - } - }, - "cacheable-request": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/cacheable-request/-/cacheable-request-2.1.4.tgz", - "integrity": "sha1-DYCIAbY0KtM8kd+dC0TcCbkeXD0=", - "dev": true, - "requires": { - "clone-response": "1.0.2", - "get-stream": "3.0.0", - "http-cache-semantics": "3.8.1", - "keyv": "3.0.0", - "lowercase-keys": "1.0.0", - "normalize-url": "2.0.1", - "responselike": "1.0.2" - }, - "dependencies": { - "lowercase-keys": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-1.0.0.tgz", - "integrity": "sha1-TjNms55/VFfjXxMkvfb4jQv8cwY=", - "dev": true - } - } - }, - "caching-transform": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/caching-transform/-/caching-transform-1.0.1.tgz", - "integrity": "sha1-bb2y8g+Nj7znnz6U6dF0Lc31wKE=", - "dev": true, - "requires": { - "md5-hex": "^1.2.0", - "mkdirp": "^0.5.1", - "write-file-atomic": "^1.1.4" - }, - "dependencies": { - "md5-hex": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/md5-hex/-/md5-hex-1.3.0.tgz", - "integrity": "sha1-0sSv6YPENwZiF5uMrRRSGRNQRsQ=", - "dev": true, - "requires": { - "md5-o-matic": "^0.1.1" - } - }, - "write-file-atomic": { - "version": "1.3.4", - "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-1.3.4.tgz", - "integrity": "sha1-+Aek8LHZ6ROuekgRLmzDrxmRtF8=", - "dev": true, - "requires": { - "graceful-fs": "^4.1.11", - "imurmurhash": "^0.1.4", - "slide": "^1.1.5" - } - } - } - }, - "call-matcher": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/call-matcher/-/call-matcher-1.1.0.tgz", - "integrity": "sha512-IoQLeNwwf9KTNbtSA7aEBb1yfDbdnzwjCetjkC8io5oGeOmK2CBNdg0xr+tadRYKO0p7uQyZzvon0kXlZbvGrw==", - "dev": true, - "requires": { - "core-js": "^2.0.0", - "deep-equal": "^1.0.0", - "espurify": "^1.6.0", - "estraverse": "^4.0.0" - } - }, - "call-me-maybe": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/call-me-maybe/-/call-me-maybe-1.0.1.tgz", - "integrity": "sha1-JtII6onje1y95gJQoV8DHBak1ms=" - }, - "call-signature": { - "version": "0.0.2", - "resolved": "https://registry.npmjs.org/call-signature/-/call-signature-0.0.2.tgz", - "integrity": "sha1-qEq8glpV70yysCi9dOIFpluaSZY=" - }, - "caller-path": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/caller-path/-/caller-path-0.1.0.tgz", - "integrity": "sha1-lAhe9jWB7NPaqSREqP6U6CV3dR8=", - "dev": true, - "requires": { - "callsites": "^0.2.0" - } - }, - "callsites": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/callsites/-/callsites-0.2.0.tgz", - "integrity": "sha1-r6uWJikQp/M8GaV3WCXGnzTjUMo=", - "dev": true - }, - "camelcase": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-2.1.1.tgz", - "integrity": "sha1-fB0W1nmhu+WcoCys7PsBHiAfWh8=" - }, - "camelcase-keys": { - "version": "2.1.0", - "resolved": "http://registry.npmjs.org/camelcase-keys/-/camelcase-keys-2.1.0.tgz", - "integrity": "sha1-MIvur/3ygRkFHvodkyITyRuPkuc=", - "dev": true, - "requires": { - "camelcase": "^2.0.0", - "map-obj": "^1.0.0" - } - }, - "capture-stack-trace": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/capture-stack-trace/-/capture-stack-trace-1.0.1.tgz", - "integrity": "sha512-mYQLZnx5Qt1JgB1WEiMCf2647plpGeQ2NMR/5L0HNZzGQo4fuSPnK+wjfPnKZV0aiJDgzmWqqkV/g7JD+DW0qw==", - "dev": true - }, - "caseless": { - "version": "0.12.0", - "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", - "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=", - "dev": true - }, - "catharsis": { - "version": "0.8.9", - "resolved": "https://registry.npmjs.org/catharsis/-/catharsis-0.8.9.tgz", - "integrity": "sha1-mMyJDKZS3S7w5ws3klMQ/56Q/Is=", - "dev": true, - "requires": { - "underscore-contrib": "~0.3.0" - } - }, - "center-align": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/center-align/-/center-align-0.1.3.tgz", - "integrity": "sha1-qg0yYptu6XIgBBHL1EYckHvCt60=", - "dev": true, - "optional": true, - "requires": { - "align-text": "^0.1.3", - "lazy-cache": "^1.0.3" - } - }, - "chalk": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", - "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", - "dev": true, - "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - } - }, - "chardet": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.7.0.tgz", - "integrity": "sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==", - "dev": true - }, - "chokidar": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-1.7.0.tgz", - "integrity": "sha1-eY5ol3gVHIB2tLNg5e3SjNortGg=", - "dev": true, - "requires": { - "anymatch": "^1.3.0", - "async-each": "^1.0.0", - "fsevents": "^1.0.0", - "glob-parent": "^2.0.0", - "inherits": "^2.0.1", - "is-binary-path": "^1.0.0", - "is-glob": "^2.0.0", - "path-is-absolute": "^1.0.0", - "readdirp": "^2.0.0" - }, - "dependencies": { - "glob-parent": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-2.0.0.tgz", - "integrity": "sha1-gTg9ctsFT8zPUzbaqQLxgvbtuyg=", - "dev": true, - "requires": { - "is-glob": "^2.0.0" - } - }, - "is-extglob": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz", - "integrity": "sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA=", - "dev": true - }, - "is-glob": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz", - "integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=", - "dev": true, - "requires": { - "is-extglob": "^1.0.0" - } - } - } - }, - "ci-info": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-1.6.0.tgz", - "integrity": "sha512-vsGdkwSCDpWmP80ncATX7iea5DWQemg1UgCW5J8tqjU3lYw4FBYuj89J0CTVomA7BEfvSZd84GmHko+MxFQU2A==", - "dev": true - }, - "circular-json": { - "version": "0.3.3", - "resolved": "https://registry.npmjs.org/circular-json/-/circular-json-0.3.3.tgz", - "integrity": "sha512-UZK3NBx2Mca+b5LsG7bY183pHWt5Y1xts4P3Pz7ENTwGVnJOUWbRb3ocjvX7hx9tq/yTAdclXm9sZ38gNuem4A==", - "dev": true - }, - "class-utils": { - "version": "0.3.6", - "resolved": "https://registry.npmjs.org/class-utils/-/class-utils-0.3.6.tgz", - "integrity": "sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg==", - "requires": { - "arr-union": "^3.1.0", - "define-property": "^0.2.5", - "isobject": "^3.0.0", - "static-extend": "^0.1.1" - }, - "dependencies": { - "define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", - "requires": { - "is-descriptor": "^0.1.0" - } - } - } - }, - "clean-stack": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-1.3.0.tgz", - "integrity": "sha1-noIVAa6XmYbEax1m0tQy2y/UrjE=", - "dev": true - }, - "clean-yaml-object": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/clean-yaml-object/-/clean-yaml-object-0.1.0.tgz", - "integrity": "sha1-Y/sRDcLOGoTcIfbZM0h20BCui2g=", - "dev": true - }, - "cli-boxes": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/cli-boxes/-/cli-boxes-1.0.0.tgz", - "integrity": "sha1-T6kXw+WclKAEzWH47lCdplFocUM=", - "dev": true - }, - "cli-cursor": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-2.1.0.tgz", - "integrity": "sha1-s12sN2R5+sw+lHR9QdDQ9SOP/LU=", - "dev": true, - "requires": { - "restore-cursor": "^2.0.0" - } - }, - "cli-spinners": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/cli-spinners/-/cli-spinners-1.3.1.tgz", - "integrity": "sha512-1QL4544moEsDVH9T/l6Cemov/37iv1RtoKf7NJ04A60+4MREXNfx/QvavbH6QoGdsD4N4Mwy49cmaINR/o2mdg==", - "dev": true - }, - "cli-truncate": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/cli-truncate/-/cli-truncate-1.1.0.tgz", - "integrity": "sha512-bAtZo0u82gCfaAGfSNxUdTI9mNyza7D8w4CVCcaOsy7sgwDzvx6ekr6cuWJqY3UGzgnQ1+4wgENup5eIhgxEYA==", - "dev": true, - "requires": { - "slice-ansi": "^1.0.0", - "string-width": "^2.0.0" - }, - "dependencies": { - "ansi-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", - "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", - "dev": true - }, - "is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", - "dev": true - }, - "string-width": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", - "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", - "dev": true, - "requires": { - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^4.0.0" - } - }, - "strip-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", - "dev": true, - "requires": { - "ansi-regex": "^3.0.0" - } - } - } - }, - "cli-width": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-2.2.0.tgz", - "integrity": "sha1-/xnt6Kml5XkyQUewwR8PvLq+1jk=", - "dev": true - }, - "cliui": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-3.2.0.tgz", - "integrity": "sha1-EgYBU3qRbSmUD5NNo7SNWFo5IT0=", - "requires": { - "string-width": "^1.0.1", - "strip-ansi": "^3.0.1", - "wrap-ansi": "^2.0.0" - } - }, - "clone-response": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/clone-response/-/clone-response-1.0.2.tgz", - "integrity": "sha1-0dyXOSAxTfZ/vrlCI7TuNQI56Ws=", - "dev": true, - "requires": { - "mimic-response": "^1.0.0" - } - }, - "co": { - "version": "4.6.0", - "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", - "integrity": "sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ=", - "dev": true - }, - "co-with-promise": { - "version": "4.6.0", - "resolved": "https://registry.npmjs.org/co-with-promise/-/co-with-promise-4.6.0.tgz", - "integrity": "sha1-QT59tvWJOmC5Qs9JLEvsk9tBWrc=", - "dev": true, - "requires": { - "pinkie-promise": "^1.0.0" - } - }, - "code-excerpt": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/code-excerpt/-/code-excerpt-2.1.1.tgz", - "integrity": "sha512-tJLhH3EpFm/1x7heIW0hemXJTUU5EWl2V0EIX558jp05Mt1U6DVryCgkp3l37cxqs+DNbNgxG43SkwJXpQ14Jw==", - "dev": true, - "requires": { - "convert-to-spaces": "^1.0.1" - } - }, - "code-point-at": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", - "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=" - }, - "codecov": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/codecov/-/codecov-3.1.0.tgz", - "integrity": "sha512-aWQc/rtHbcWEQLka6WmBAOpV58J2TwyXqlpAQGhQaSiEUoigTTUk6lLd2vB3kXkhnDyzyH74RXfmV4dq2txmdA==", - "dev": true, - "requires": { - "argv": "^0.0.2", - "ignore-walk": "^3.0.1", - "js-yaml": "^3.12.0", - "request": "^2.87.0", - "urlgrey": "^0.4.4" - } - }, - "collection-visit": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/collection-visit/-/collection-visit-1.0.0.tgz", - "integrity": "sha1-S8A3PBZLwykbTTaMgpzxqApZ3KA=", - "requires": { - "map-visit": "^1.0.0", - "object-visit": "^1.0.0" - } - }, - "color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "dev": true, - "requires": { - "color-name": "1.1.3" - } - }, - "color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", - "dev": true - }, - "colors": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/colors/-/colors-1.1.2.tgz", - "integrity": "sha1-FopHAXVran9RoSzgyXv6KMCE7WM=", - "dev": true - }, - "colour": { - "version": "0.7.1", - "resolved": "https://registry.npmjs.org/colour/-/colour-0.7.1.tgz", - "integrity": "sha1-nLFpkX7F0SwHNtPoaFdG3xyt93g=" - }, - "combined-stream": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.7.tgz", - "integrity": "sha512-brWl9y6vOB1xYPZcpZde3N9zDByXTosAeMDo4p1wzo6UMOX4vumB+TP1RZ76sfE6Md68Q0NJSrE/gbezd4Ul+w==", - "dev": true, - "requires": { - "delayed-stream": "~1.0.0" - } - }, - "commander": { - "version": "2.15.1", - "resolved": "http://registry.npmjs.org/commander/-/commander-2.15.1.tgz", - "integrity": "sha512-VlfT9F3V0v+jr4yxPc5gg9s62/fIVWsd2Bk2iD435um1NlGMYdVCq+MjcXnhYq2icNOizHr1kK+5TI6H0Hy0ag==", - "dev": true - }, - "common-path-prefix": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/common-path-prefix/-/common-path-prefix-1.0.0.tgz", - "integrity": "sha1-zVL28HEuC6q5fW+XModPIvR3UsA=", - "dev": true - }, - "commondir": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", - "integrity": "sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs=", - "dev": true - }, - "component-emitter": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.2.1.tgz", - "integrity": "sha1-E3kY1teCg/ffemt8WmPhQOaUJeY=" - }, - "concat-map": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" - }, - "concordance": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/concordance/-/concordance-3.0.0.tgz", - "integrity": "sha512-CZBzJ3/l5QJjlZM20WY7+5GP5pMTw+1UEbThcpMw8/rojsi5sBCiD8ZbBLtD+jYpRGAkwuKuqk108c154V9eyQ==", - "dev": true, - "requires": { - "date-time": "^2.1.0", - "esutils": "^2.0.2", - "fast-diff": "^1.1.1", - "function-name-support": "^0.2.0", - "js-string-escape": "^1.0.1", - "lodash.clonedeep": "^4.5.0", - "lodash.flattendeep": "^4.4.0", - "lodash.merge": "^4.6.0", - "md5-hex": "^2.0.0", - "semver": "^5.3.0", - "well-known-symbols": "^1.0.0" - }, - "dependencies": { - "date-time": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/date-time/-/date-time-2.1.0.tgz", - "integrity": "sha512-/9+C44X7lot0IeiyfgJmETtRMhBidBYM2QFFIkGa0U1k+hSyY87Nw7PY3eDqpvCBm7I3WCSfPeZskW/YYq6m4g==", - "dev": true, - "requires": { - "time-zone": "^1.0.0" - } - } - } - }, - "configstore": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/configstore/-/configstore-3.1.2.tgz", - "integrity": "sha512-vtv5HtGjcYUgFrXc6Kx747B83MRRVS5R1VTEQoXvuP+kMI+if6uywV0nDGoiydJRy4yk7h9od5Og0kxx4zUXmw==", - "dev": true, - "requires": { - "dot-prop": "^4.1.0", - "graceful-fs": "^4.1.2", - "make-dir": "^1.0.0", - "unique-string": "^1.0.0", - "write-file-atomic": "^2.0.0", - "xdg-basedir": "^3.0.0" - } - }, - "convert-source-map": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.6.0.tgz", - "integrity": "sha512-eFu7XigvxdZ1ETfbgPBohgyQ/Z++C0eEhTor0qRwBw9unw+L0/6V8wkSuGgzdThkiS5lSpdptOQPD8Ak40a+7A==", - "dev": true, - "requires": { - "safe-buffer": "~5.1.1" - } - }, - "convert-to-spaces": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/convert-to-spaces/-/convert-to-spaces-1.0.2.tgz", - "integrity": "sha1-fj5Iu+bZl7FBfdyihoIEtNPYVxU=", - "dev": true - }, - "cookiejar": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/cookiejar/-/cookiejar-2.1.2.tgz", - "integrity": "sha512-Mw+adcfzPxcPeI+0WlvRrr/3lGVO0bD75SxX6811cxSh1Wbxx7xZBGK1eVtDf6si8rg2lhnUjsVLMFMfbRIuwA==", - "dev": true - }, - "copy-descriptor": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/copy-descriptor/-/copy-descriptor-0.1.1.tgz", - "integrity": "sha1-Z29us8OZl8LuGsOpJP1hJHSPV40=" - }, - "core-assert": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/core-assert/-/core-assert-0.2.1.tgz", - "integrity": "sha1-+F4s+b/tKPdzzIs/pcW2m9wC/j8=", - "dev": true, - "requires": { - "buf-compare": "^1.0.0", - "is-error": "^2.2.0" - } - }, - "core-js": { - "version": "2.5.7", - "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.5.7.tgz", - "integrity": "sha512-RszJCAxg/PP6uzXVXL6BsxSXx/B05oJAQ2vkJRjyjrEcNVycaqOmNb5OTxZPE3xa5gwZduqza6L9JOCenh/Ecw==" - }, - "core-util-is": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", - "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" - }, - "create-error-class": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/create-error-class/-/create-error-class-3.0.2.tgz", - "integrity": "sha1-Br56vvlHo/FKMP1hBnHUAbyot7Y=", - "dev": true, - "requires": { - "capture-stack-trace": "^1.0.0" - } - }, - "cross-spawn": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-5.1.0.tgz", - "integrity": "sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk=", - "dev": true, - "requires": { - "lru-cache": "^4.0.1", - "shebang-command": "^1.2.0", - "which": "^1.2.9" - } - }, - "crypto-random-string": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/crypto-random-string/-/crypto-random-string-1.0.0.tgz", - "integrity": "sha1-ojD2T1aDEOFJgAmUB5DsmVRbyn4=", - "dev": true - }, - "currently-unhandled": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/currently-unhandled/-/currently-unhandled-0.4.1.tgz", - "integrity": "sha1-mI3zP+qxke95mmE2nddsF635V+o=", - "dev": true, - "requires": { - "array-find-index": "^1.0.1" - } - }, - "d": { - "version": "1.0.0", - "resolved": "http://registry.npmjs.org/d/-/d-1.0.0.tgz", - "integrity": "sha1-dUu1v+VUUdpppYuU1F9MWwRi1Y8=", - "dev": true, - "requires": { - "es5-ext": "^0.10.9" - } - }, - "dashdash": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", - "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", - "dev": true, - "requires": { - "assert-plus": "^1.0.0" - } - }, - "date-time": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/date-time/-/date-time-0.1.1.tgz", - "integrity": "sha1-7S9tk9l5DOL9ZtW1/z7dW7y/Owc=", - "dev": true - }, - "debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "requires": { - "ms": "2.0.0" - } - }, - "decamelize": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", - "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=" - }, - "decode-uri-component": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.0.tgz", - "integrity": "sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU=" - }, - "decompress-response": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-3.3.0.tgz", - "integrity": "sha1-gKTdMjdIOEv6JICDYirt7Jgq3/M=", - "dev": true, - "requires": { - "mimic-response": "^1.0.0" - } - }, - "deep-equal": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-1.0.1.tgz", - "integrity": "sha1-9dJgKStmDghO/0zbyfCK0yR0SLU=", - "dev": true - }, - "deep-extend": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", - "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==", - "dev": true - }, - "deep-is": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", - "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=", - "dev": true - }, - "define-properties": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", - "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==", - "requires": { - "object-keys": "^1.0.12" - } - }, - "define-property": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-2.0.2.tgz", - "integrity": "sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ==", - "requires": { - "is-descriptor": "^1.0.2", - "isobject": "^3.0.1" - }, - "dependencies": { - "is-accessor-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", - "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-data-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", - "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-descriptor": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", - "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", - "requires": { - "is-accessor-descriptor": "^1.0.0", - "is-data-descriptor": "^1.0.0", - "kind-of": "^6.0.2" - } - } - } - }, - "del": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/del/-/del-2.2.2.tgz", - "integrity": "sha1-wSyYHQZ4RshLyvhiz/kw2Qf/0ag=", - "dev": true, - "requires": { - "globby": "^5.0.0", - "is-path-cwd": "^1.0.0", - "is-path-in-cwd": "^1.0.0", - "object-assign": "^4.0.1", - "pify": "^2.0.0", - "pinkie-promise": "^2.0.0", - "rimraf": "^2.2.8" - }, - "dependencies": { - "globby": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/globby/-/globby-5.0.0.tgz", - "integrity": "sha1-69hGZ8oNuzMLmbz8aOrCvFQ3Dg0=", - "dev": true, - "requires": { - "array-union": "^1.0.1", - "arrify": "^1.0.0", - "glob": "^7.0.3", - "object-assign": "^4.0.1", - "pify": "^2.0.0", - "pinkie-promise": "^2.0.0" - } - }, - "pify": { - "version": "2.3.0", - "resolved": "http://registry.npmjs.org/pify/-/pify-2.3.0.tgz", - "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", - "dev": true - }, - "pinkie": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz", - "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA=", - "dev": true - }, - "pinkie-promise": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", - "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=", - "dev": true, - "requires": { - "pinkie": "^2.0.0" - } - } - } - }, - "delayed-stream": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", - "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=", - "dev": true - }, - "detect-indent": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/detect-indent/-/detect-indent-4.0.0.tgz", - "integrity": "sha1-920GQ1LN9Docts5hnE7jqUdd4gg=", - "dev": true, - "requires": { - "repeating": "^2.0.0" - } - }, - "diff": { - "version": "3.5.0", - "resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz", - "integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==", - "dev": true - }, - "diff-match-patch": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/diff-match-patch/-/diff-match-patch-1.0.4.tgz", - "integrity": "sha512-Uv3SW8bmH9nAtHKaKSanOQmj2DnlH65fUpcrMdfdaOxUG02QQ4YGZ8AE7kKOMisF7UqvOlGKVYWRvezdncW9lg==" - }, - "dir-glob": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-2.0.0.tgz", - "integrity": "sha512-37qirFDz8cA5fimp9feo43fSuRo2gHwaIn6dXL8Ber1dGwUosDrGZeCCXq57WnIqE4aQ+u3eQZzsk1yOzhdwag==", - "requires": { - "arrify": "^1.0.1", - "path-type": "^3.0.0" - } - }, - "doctrine": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz", - "integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==", - "dev": true, - "requires": { - "esutils": "^2.0.2" - } - }, - "dom-serializer": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-0.1.0.tgz", - "integrity": "sha1-BzxpdUbOB4DOI75KKOKT5AvDDII=", - "dev": true, - "requires": { - "domelementtype": "~1.1.1", - "entities": "~1.1.1" - }, - "dependencies": { - "domelementtype": { - "version": "1.1.3", - "resolved": "http://registry.npmjs.org/domelementtype/-/domelementtype-1.1.3.tgz", - "integrity": "sha1-vSh3PiZCiBrsUVRJJCmcXNgiGFs=", - "dev": true - } - } - }, - "domelementtype": { - "version": "1.3.0", - "resolved": "http://registry.npmjs.org/domelementtype/-/domelementtype-1.3.0.tgz", - "integrity": "sha1-sXrtguirWeUt2cGbF1bg/BhyBMI=", - "dev": true - }, - "domhandler": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-2.4.2.tgz", - "integrity": "sha512-JiK04h0Ht5u/80fdLMCEmV4zkNh2BcoMFBmZ/91WtYZ8qVXSKjiw7fXMgFPnHcSZgOo3XdinHvmnDUeMf5R4wA==", - "dev": true, - "requires": { - "domelementtype": "1" - } - }, - "domutils": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/domutils/-/domutils-1.7.0.tgz", - "integrity": "sha512-Lgd2XcJ/NjEw+7tFvfKxOzCYKZsdct5lczQ2ZaQY8Djz7pfAD3Gbp8ySJWtreII/vDlMVmxwa6pHmdxIYgttDg==", - "dev": true, - "requires": { - "dom-serializer": "0", - "domelementtype": "1" - } - }, - "dot-prop": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-4.2.0.tgz", - "integrity": "sha512-tUMXrxlExSW6U2EXiiKGSBVdYgtV8qlHL+C10TsW4PURY/ic+eaysnSkwB4kA/mBlCyy/IKDJ+Lc3wbWeaXtuQ==", - "dev": true, - "requires": { - "is-obj": "^1.0.0" - } - }, - "duplexer3": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/duplexer3/-/duplexer3-0.1.4.tgz", - "integrity": "sha1-7gHdHKwO08vH/b6jfcCo8c4ALOI=", - "dev": true - }, - "duplexify": { - "version": "3.6.1", - "resolved": "https://registry.npmjs.org/duplexify/-/duplexify-3.6.1.tgz", - "integrity": "sha512-vM58DwdnKmty+FSPzT14K9JXb90H+j5emaR4KYbr2KTIz00WHGbWOe5ghQTx233ZCLZtrGDALzKwcjEtSt35mA==", - "requires": { - "end-of-stream": "^1.0.0", - "inherits": "^2.0.1", - "readable-stream": "^2.0.0", - "stream-shift": "^1.0.0" - } - }, - "eastasianwidth": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", - "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==" - }, - "ecc-jsbn": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", - "integrity": "sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=", - "dev": true, - "requires": { - "jsbn": "~0.1.0", - "safer-buffer": "^2.1.0" - } - }, - "ecdsa-sig-formatter": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.10.tgz", - "integrity": "sha1-HFlQAPBKiJffuFAAiSoPTDOvhsM=", - "requires": { - "safe-buffer": "^5.0.1" - } - }, - "empower": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/empower/-/empower-1.3.1.tgz", - "integrity": "sha512-uB6/ViBaawOO/uujFADTK3SqdYlxYNn+N4usK9MRKZ4Hbn/1QSy8k2PezxCA2/+JGbF8vd/eOfghZ90oOSDZCA==", - "requires": { - "core-js": "^2.0.0", - "empower-core": "^1.2.0" - } - }, - "empower-assert": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/empower-assert/-/empower-assert-1.1.0.tgz", - "integrity": "sha512-Ylck0Q6p8y/LpNzYeBccaxAPm2ZyuqBgErgZpO9KT0HuQWF0sJckBKCLmgS1/DEXEiyBi9XtYh3clZm5cAdARw==", - "dev": true, - "requires": { - "estraverse": "^4.2.0" - } - }, - "empower-core": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/empower-core/-/empower-core-1.2.0.tgz", - "integrity": "sha512-g6+K6Geyc1o6FdXs9HwrXleCFan7d66G5xSCfSF7x1mJDCes6t0om9lFQG3zOrzh3Bkb/45N0cZ5Gqsf7YrzGQ==", - "requires": { - "call-signature": "0.0.2", - "core-js": "^2.0.0" - } - }, - "end-of-stream": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.1.tgz", - "integrity": "sha512-1MkrZNvWTKCaigbn+W15elq2BB/L22nqrSY5DKlo3X6+vclJm8Bb5djXJBmEX6fS3+zCh/F4VBK5Z2KxJt4s2Q==", - "requires": { - "once": "^1.4.0" - } - }, - "entities": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/entities/-/entities-1.1.2.tgz", - "integrity": "sha512-f2LZMYl1Fzu7YSBKg+RoROelpOaNrcGmE9AZubeDfrCEia483oW4MI4VyFd5VNHIgQ/7qm1I0wUHK1eJnn2y2w==", - "dev": true - }, - "equal-length": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/equal-length/-/equal-length-1.0.1.tgz", - "integrity": "sha1-IcoRLUirJLTh5//A5TOdMf38J0w=", - "dev": true - }, - "error-ex": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", - "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", - "dev": true, - "requires": { - "is-arrayish": "^0.2.1" - } - }, - "es5-ext": { - "version": "0.10.46", - "resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.46.tgz", - "integrity": "sha512-24XxRvJXNFwEMpJb3nOkiRJKRoupmjYmOPVlI65Qy2SrtxwOTB+g6ODjBKOtwEHbYrhWRty9xxOWLNdClT2djw==", - "dev": true, - "requires": { - "es6-iterator": "~2.0.3", - "es6-symbol": "~3.1.1", - "next-tick": "1" - } - }, - "es6-error": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/es6-error/-/es6-error-4.1.1.tgz", - "integrity": "sha512-Um/+FxMr9CISWh0bi5Zv0iOD+4cFh5qLeks1qhAopKVAJw3drgKbKySikp7wGhDL0HPeaja0P5ULZrxLkniUVg==", - "dev": true - }, - "es6-iterator": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/es6-iterator/-/es6-iterator-2.0.3.tgz", - "integrity": "sha1-p96IkUGgWpSwhUQDstCg+/qY87c=", - "dev": true, - "requires": { - "d": "1", - "es5-ext": "^0.10.35", - "es6-symbol": "^3.1.1" - } - }, - "es6-map": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/es6-map/-/es6-map-0.1.5.tgz", - "integrity": "sha1-kTbgUD3MBqMBaQ8LsU/042TpSfA=", - "dev": true, - "requires": { - "d": "1", - "es5-ext": "~0.10.14", - "es6-iterator": "~2.0.1", - "es6-set": "~0.1.5", - "es6-symbol": "~3.1.1", - "event-emitter": "~0.3.5" - } - }, - "es6-promise": { - "version": "4.2.5", - "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-4.2.5.tgz", - "integrity": "sha512-n6wvpdE43VFtJq+lUDYDBFUwV8TZbuGXLV4D6wKafg13ldznKsyEvatubnmUe31zcvelSzOHF+XbaT+Bl9ObDg==" - }, - "es6-promisify": { - "version": "5.0.0", - "resolved": "http://registry.npmjs.org/es6-promisify/-/es6-promisify-5.0.0.tgz", - "integrity": "sha1-UQnWLz5W6pZ8S2NQWu8IKRyKUgM=", - "requires": { - "es6-promise": "^4.0.3" - } - }, - "es6-set": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/es6-set/-/es6-set-0.1.5.tgz", - "integrity": "sha1-0rPsXU2ADO2BjbU40ol02wpzzLE=", - "dev": true, - "requires": { - "d": "1", - "es5-ext": "~0.10.14", - "es6-iterator": "~2.0.1", - "es6-symbol": "3.1.1", - "event-emitter": "~0.3.5" - } - }, - "es6-symbol": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.1.tgz", - "integrity": "sha1-vwDvT9q2uhtG7Le2KbTH7VcVzHc=", - "dev": true, - "requires": { - "d": "1", - "es5-ext": "~0.10.14" - } - }, - "es6-weak-map": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/es6-weak-map/-/es6-weak-map-2.0.2.tgz", - "integrity": "sha1-XjqzIlH/0VOKH45f+hNXdy+S2W8=", - "dev": true, - "requires": { - "d": "1", - "es5-ext": "^0.10.14", - "es6-iterator": "^2.0.1", - "es6-symbol": "^3.1.1" - } - }, - "escallmatch": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/escallmatch/-/escallmatch-1.5.0.tgz", - "integrity": "sha1-UAmdhugJGwkt+N37w/mm+wWgJNA=", - "dev": true, - "requires": { - "call-matcher": "^1.0.0", - "esprima": "^2.0.0" - }, - "dependencies": { - "esprima": { - "version": "2.7.3", - "resolved": "https://registry.npmjs.org/esprima/-/esprima-2.7.3.tgz", - "integrity": "sha1-luO3DVd59q1JzQMmc9HDEnZ7pYE=", - "dev": true - } - } - }, - "escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", - "dev": true - }, - "escodegen": { - "version": "1.11.0", - "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.11.0.tgz", - "integrity": "sha512-IeMV45ReixHS53K/OmfKAIztN/igDHzTJUhZM3k1jMhIZWjk45SMwAtBsEXiJp3vSPmTcu6CXn7mDvFHRN66fw==", - "dev": true, - "requires": { - "esprima": "^3.1.3", - "estraverse": "^4.2.0", - "esutils": "^2.0.2", - "optionator": "^0.8.1", - "source-map": "~0.6.1" - }, - "dependencies": { - "esprima": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/esprima/-/esprima-3.1.3.tgz", - "integrity": "sha1-/cpRzuYTOJXjyI1TXOSdv/YqRjM=", - "dev": true - }, - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true, - "optional": true - } - } - }, - "escope": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/escope/-/escope-3.6.0.tgz", - "integrity": "sha1-4Bl16BJ4GhY6ba392AOY3GTIicM=", - "dev": true, - "requires": { - "es6-map": "^0.1.3", - "es6-weak-map": "^2.0.1", - "esrecurse": "^4.1.0", - "estraverse": "^4.1.1" - } - }, - "eslint": { - "version": "5.8.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-5.8.0.tgz", - "integrity": "sha512-Zok6Bru3y2JprqTNm14mgQ15YQu/SMDkWdnmHfFg770DIUlmMFd/gqqzCHekxzjHZJxXv3tmTpH0C1icaYJsRQ==", - "dev": true, - "requires": { - "@babel/code-frame": "^7.0.0", - "ajv": "^6.5.3", - "chalk": "^2.1.0", - "cross-spawn": "^6.0.5", - "debug": "^4.0.1", - "doctrine": "^2.1.0", - "eslint-scope": "^4.0.0", - "eslint-utils": "^1.3.1", - "eslint-visitor-keys": "^1.0.0", - "espree": "^4.0.0", - "esquery": "^1.0.1", - "esutils": "^2.0.2", - "file-entry-cache": "^2.0.0", - "functional-red-black-tree": "^1.0.1", - "glob": "^7.1.2", - "globals": "^11.7.0", - "ignore": "^4.0.6", - "imurmurhash": "^0.1.4", - "inquirer": "^6.1.0", - "is-resolvable": "^1.1.0", - "js-yaml": "^3.12.0", - "json-stable-stringify-without-jsonify": "^1.0.1", - "levn": "^0.3.0", - "lodash": "^4.17.5", - "minimatch": "^3.0.4", - "mkdirp": "^0.5.1", - "natural-compare": "^1.4.0", - "optionator": "^0.8.2", - "path-is-inside": "^1.0.2", - "pluralize": "^7.0.0", - "progress": "^2.0.0", - "regexpp": "^2.0.1", - "require-uncached": "^1.0.3", - "semver": "^5.5.1", - "strip-ansi": "^4.0.0", - "strip-json-comments": "^2.0.1", - "table": "^5.0.2", - "text-table": "^0.2.0" - }, - "dependencies": { - "ajv": { - "version": "6.5.5", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.5.5.tgz", - "integrity": "sha512-7q7gtRQDJSyuEHjuVgHoUa2VuemFiCMrfQc9Tc08XTAc4Zj/5U1buQJ0HU6i7fKjXU09SVgSmxa4sLvuvS8Iyg==", - "dev": true, - "requires": { - "fast-deep-equal": "^2.0.1", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.4.1", - "uri-js": "^4.2.2" - } - }, - "ansi-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", - "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", - "dev": true - }, - "cross-spawn": { - "version": "6.0.5", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", - "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", - "dev": true, - "requires": { - "nice-try": "^1.0.4", - "path-key": "^2.0.1", - "semver": "^5.5.0", - "shebang-command": "^1.2.0", - "which": "^1.2.9" - } - }, - "debug": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.0.tgz", - "integrity": "sha512-heNPJUJIqC+xB6ayLAMHaIrmN9HKa7aQO8MGqKpvCA+uJYVcvR6l5kgdrhRuwPFHU7P5/A1w0BjByPHwpfTDKg==", - "dev": true, - "requires": { - "ms": "^2.1.1" - } - }, - "fast-deep-equal": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz", - "integrity": "sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk=", - "dev": true - }, - "globals": { - "version": "11.8.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-11.8.0.tgz", - "integrity": "sha512-io6LkyPVuzCHBSQV9fmOwxZkUk6nIaGmxheLDgmuFv89j0fm2aqDbIXKAGfzCMHqz3HLF2Zf8WSG6VqMh2qFmA==", - "dev": true - }, - "ignore": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", - "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", - "dev": true - }, - "json-schema-traverse": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", - "dev": true - }, - "ms": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", - "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", - "dev": true - }, - "strip-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", - "dev": true, - "requires": { - "ansi-regex": "^3.0.0" - } - } - } - }, - "eslint-config-prettier": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-3.1.0.tgz", - "integrity": "sha512-QYGfmzuc4q4J6XIhlp8vRKdI/fI0tQfQPy1dME3UOLprE+v4ssH/3W9LM2Q7h5qBcy5m0ehCrBDU2YF8q6OY8w==", - "dev": true, - "requires": { - "get-stdin": "^6.0.0" - }, - "dependencies": { - "get-stdin": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-6.0.0.tgz", - "integrity": "sha512-jp4tHawyV7+fkkSKyvjuLZswblUtz+SQKzSWnBbii16BuZksJlU1wuBYXY75r+duh/llF1ur6oNwi+2ZzjKZ7g==", - "dev": true - } - } - }, - "eslint-plugin-es": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/eslint-plugin-es/-/eslint-plugin-es-1.3.1.tgz", - "integrity": "sha512-9XcVyZiQRVeFjqHw8qHNDAZcQLqaHlOGGpeYqzYh8S4JYCWTCO3yzyen8yVmA5PratfzTRWDwCOFphtDEG+w/w==", - "dev": true, - "requires": { - "eslint-utils": "^1.3.0", - "regexpp": "^2.0.0" - } - }, - "eslint-plugin-node": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-node/-/eslint-plugin-node-8.0.0.tgz", - "integrity": "sha512-Y+ln8iQ52scz9+rSPnSWRaAxeWaoJZ4wIveDR0vLHkuSZGe44Vk1J4HX7WvEP5Cm+iXPE8ixo7OM7gAO3/OKpQ==", - "dev": true, - "requires": { - "eslint-plugin-es": "^1.3.1", - "eslint-utils": "^1.3.1", - "ignore": "^5.0.2", - "minimatch": "^3.0.4", - "resolve": "^1.8.1", - "semver": "^5.5.0" - }, - "dependencies": { - "ignore": { - "version": "5.0.4", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.0.4.tgz", - "integrity": "sha512-WLsTMEhsQuXpCiG173+f3aymI43SXa+fB1rSfbzyP4GkPP+ZFVuO0/3sFUGNBtifisPeDcl/uD/Y2NxZ7xFq4g==", - "dev": true - } - } - }, - "eslint-plugin-prettier": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-3.0.0.tgz", - "integrity": "sha512-4g11opzhqq/8+AMmo5Vc2Gn7z9alZ4JqrbZ+D4i8KlSyxeQhZHlmIrY8U9Akf514MoEhogPa87Jgkq87aZ2Ohw==", - "dev": true, - "requires": { - "prettier-linter-helpers": "^1.0.0" - } - }, - "eslint-scope": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-4.0.0.tgz", - "integrity": "sha512-1G6UTDi7Jc1ELFwnR58HV4fK9OQK4S6N985f166xqXxpjU6plxFISJa2Ba9KCQuFa8RCnj/lSFJbHo7UFDBnUA==", - "dev": true, - "requires": { - "esrecurse": "^4.1.0", - "estraverse": "^4.1.1" - } - }, - "eslint-utils": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-1.3.1.tgz", - "integrity": "sha512-Z7YjnIldX+2XMcjr7ZkgEsOj/bREONV60qYeB/bjMAqqqZ4zxKyWX+BOUkdmRmA9riiIPVvo5x86m5elviOk0Q==", - "dev": true - }, - "eslint-visitor-keys": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz", - "integrity": "sha512-qzm/XxIbxm/FHyH341ZrbnMUpe+5Bocte9xkmFMzPMjRaZMcXww+MpBptFvtU+79L362nqiLhekCxCxDPaUMBQ==", - "dev": true - }, - "espower": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/espower/-/espower-2.1.1.tgz", - "integrity": "sha512-F4TY1qYJB1aUyzB03NsZksZzUQmQoEBaTUjRJGR30GxbkbjKI41NhCyYjrF+bGgWN7x/ZsczYppRpz/0WdI0ug==", - "dev": true, - "requires": { - "array-find": "^1.0.0", - "escallmatch": "^1.5.0", - "escodegen": "^1.7.0", - "escope": "^3.3.0", - "espower-location-detector": "^1.0.0", - "espurify": "^1.3.0", - "estraverse": "^4.1.0", - "source-map": "^0.5.0", - "type-name": "^2.0.0", - "xtend": "^4.0.0" - } - }, - "espower-loader": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/espower-loader/-/espower-loader-1.2.2.tgz", - "integrity": "sha1-7bRsPFmga6yOpzppXIblxaC8gto=", - "dev": true, - "requires": { - "convert-source-map": "^1.1.0", - "espower-source": "^2.0.0", - "minimatch": "^3.0.0", - "source-map-support": "^0.4.0", - "xtend": "^4.0.0" - }, - "dependencies": { - "source-map-support": { - "version": "0.4.18", - "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.4.18.tgz", - "integrity": "sha512-try0/JqxPLF9nOjvSta7tVondkP5dwgyLDjVoyMDlmjugT2lRZ1OfsrYTkCd2hkDnJTKRbO/Rl3orm8vlsUzbA==", - "dev": true, - "requires": { - "source-map": "^0.5.6" - } - } - } - }, - "espower-location-detector": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/espower-location-detector/-/espower-location-detector-1.0.0.tgz", - "integrity": "sha1-oXt+zFnTDheeK+9z+0E3cEyzMbU=", - "dev": true, - "requires": { - "is-url": "^1.2.1", - "path-is-absolute": "^1.0.0", - "source-map": "^0.5.0", - "xtend": "^4.0.0" - } - }, - "espower-source": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/espower-source/-/espower-source-2.3.0.tgz", - "integrity": "sha512-Wc4kC4zUAEV7Qt31JRPoBUc5jjowHRylml2L2VaDQ1XEbnqQofGWx+gPR03TZAPokAMl5dqyL36h3ITyMXy3iA==", - "dev": true, - "requires": { - "acorn": "^5.0.0", - "acorn-es7-plugin": "^1.0.10", - "convert-source-map": "^1.1.1", - "empower-assert": "^1.0.0", - "escodegen": "^1.10.0", - "espower": "^2.1.1", - "estraverse": "^4.0.0", - "merge-estraverse-visitors": "^1.0.0", - "multi-stage-sourcemap": "^0.2.1", - "path-is-absolute": "^1.0.0", - "xtend": "^4.0.0" - } - }, - "espree": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/espree/-/espree-4.1.0.tgz", - "integrity": "sha512-I5BycZW6FCVIub93TeVY1s7vjhP9CY6cXCznIRfiig7nRviKZYdRnj/sHEWC6A7WE9RDWOFq9+7OsWSYz8qv2w==", - "dev": true, - "requires": { - "acorn": "^6.0.2", - "acorn-jsx": "^5.0.0", - "eslint-visitor-keys": "^1.0.0" - }, - "dependencies": { - "acorn": { - "version": "6.0.4", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.0.4.tgz", - "integrity": "sha512-VY4i5EKSKkofY2I+6QLTbTTN/UvEQPCo6eiwzzSaSWfpaDhOmStMCMod6wmuPciNq+XS0faCglFu2lHZpdHUtg==", - "dev": true - } - } - }, - "esprima": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", - "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", - "dev": true - }, - "espurify": { - "version": "1.8.1", - "resolved": "https://registry.npmjs.org/espurify/-/espurify-1.8.1.tgz", - "integrity": "sha512-ZDko6eY/o+D/gHCWyHTU85mKDgYcS4FJj7S+YD6WIInm7GQ6AnOjmcL4+buFV/JOztVLELi/7MmuGU5NHta0Mg==", - "requires": { - "core-js": "^2.0.0" - } - }, - "esquery": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.0.1.tgz", - "integrity": "sha512-SmiyZ5zIWH9VM+SRUReLS5Q8a7GxtRdxEBVZpm98rJM7Sb+A9DVCndXfkeFUd3byderg+EbDkfnevfCwynWaNA==", - "dev": true, - "requires": { - "estraverse": "^4.0.0" - } - }, - "esrecurse": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.2.1.tgz", - "integrity": "sha512-64RBB++fIOAXPw3P9cy89qfMlvZEXZkqqJkjqqXIvzP5ezRZjW+lPWjw35UX/3EhUPFYbg5ER4JYgDw4007/DQ==", - "dev": true, - "requires": { - "estraverse": "^4.1.0" - } - }, - "estraverse": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.2.0.tgz", - "integrity": "sha1-De4/7TH81GlhjOc0IJn8GvoL2xM=" - }, - "esutils": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz", - "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=", - "dev": true - }, - "event-emitter": { - "version": "0.3.5", - "resolved": "https://registry.npmjs.org/event-emitter/-/event-emitter-0.3.5.tgz", - "integrity": "sha1-34xp7vFkeSPHFXuc6DhAYQsCzDk=", - "dev": true, - "requires": { - "d": "1", - "es5-ext": "~0.10.14" - } - }, - "execa": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/execa/-/execa-0.7.0.tgz", - "integrity": "sha1-lEvs00zEHuMqY6n68nrVpl/Fl3c=", - "dev": true, - "requires": { - "cross-spawn": "^5.0.1", - "get-stream": "^3.0.0", - "is-stream": "^1.1.0", - "npm-run-path": "^2.0.0", - "p-finally": "^1.0.0", - "signal-exit": "^3.0.0", - "strip-eof": "^1.0.0" - } - }, - "expand-brackets": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz", - "integrity": "sha1-t3c14xXOMPa27/D4OwQVGiJEliI=", - "requires": { - "debug": "^2.3.3", - "define-property": "^0.2.5", - "extend-shallow": "^2.0.1", - "posix-character-classes": "^0.1.0", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.1" - }, - "dependencies": { - "define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", - "requires": { - "is-descriptor": "^0.1.0" - } - }, - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "requires": { - "is-extendable": "^0.1.0" - } - } - } - }, - "expand-range": { - "version": "1.8.2", - "resolved": "https://registry.npmjs.org/expand-range/-/expand-range-1.8.2.tgz", - "integrity": "sha1-opnv/TNf4nIeuujiV+x5ZE/IUzc=", - "dev": true, - "requires": { - "fill-range": "^2.1.0" - }, - "dependencies": { - "fill-range": { - "version": "2.2.4", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-2.2.4.tgz", - "integrity": "sha512-cnrcCbj01+j2gTG921VZPnHbjmdAf8oQV/iGeV2kZxGSyfYjjTyY79ErsK1WJWMpw6DaApEX72binqJE+/d+5Q==", - "dev": true, - "requires": { - "is-number": "^2.1.0", - "isobject": "^2.0.0", - "randomatic": "^3.0.0", - "repeat-element": "^1.1.2", - "repeat-string": "^1.5.2" - } - }, - "is-number": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-2.1.0.tgz", - "integrity": "sha1-Afy7s5NGOlSPL0ZszhbezknbkI8=", - "dev": true, - "requires": { - "kind-of": "^3.0.2" - } - }, - "isobject": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", - "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=", - "dev": true, - "requires": { - "isarray": "1.0.0" - } - }, - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "extend": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", - "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==" - }, - "extend-shallow": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz", - "integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=", - "requires": { - "assign-symbols": "^1.0.0", - "is-extendable": "^1.0.1" - }, - "dependencies": { - "is-extendable": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", - "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", - "requires": { - "is-plain-object": "^2.0.4" - } - } - } - }, - "external-editor": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-3.0.3.tgz", - "integrity": "sha512-bn71H9+qWoOQKyZDo25mOMVpSmXROAsTJVVVYzrrtol3d4y+AsKjf4Iwl2Q+IuT0kFSQ1qo166UuIwqYq7mGnA==", - "dev": true, - "requires": { - "chardet": "^0.7.0", - "iconv-lite": "^0.4.24", - "tmp": "^0.0.33" - } - }, - "extglob": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/extglob/-/extglob-2.0.4.tgz", - "integrity": "sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw==", - "requires": { - "array-unique": "^0.3.2", - "define-property": "^1.0.0", - "expand-brackets": "^2.1.4", - "extend-shallow": "^2.0.1", - "fragment-cache": "^0.2.1", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.1" - }, - "dependencies": { - "define-property": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", - "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", - "requires": { - "is-descriptor": "^1.0.0" - } - }, - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "requires": { - "is-extendable": "^0.1.0" - } - }, - "is-accessor-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", - "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-data-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", - "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-descriptor": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", - "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", - "requires": { - "is-accessor-descriptor": "^1.0.0", - "is-data-descriptor": "^1.0.0", - "kind-of": "^6.0.2" - } - } - } - }, - "extsprintf": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", - "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=", - "dev": true - }, - "fast-deep-equal": { - "version": "1.1.0", - "resolved": "http://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-1.1.0.tgz", - "integrity": "sha1-wFNHeBfIa1HaqFPIHgWbcz0CNhQ=", - "dev": true - }, - "fast-diff": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/fast-diff/-/fast-diff-1.2.0.tgz", - "integrity": "sha512-xJuoT5+L99XlZ8twedaRf6Ax2TgQVxvgZOYoPKqZufmJib0tL2tegPBOZb1pVNgIhlqDlA0eO0c3wBvQcmzx4w==", - "dev": true - }, - "fast-glob": { - "version": "2.2.3", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-2.2.3.tgz", - "integrity": "sha512-NiX+JXjnx43RzvVFwRWfPKo4U+1BrK5pJPsHQdKMlLoFHrrGktXglQhHliSihWAq+m1z6fHk3uwGHrtRbS9vLA==", - "requires": { - "@mrmlnc/readdir-enhanced": "^2.2.1", - "@nodelib/fs.stat": "^1.0.1", - "glob-parent": "^3.1.0", - "is-glob": "^4.0.0", - "merge2": "^1.2.1", - "micromatch": "^3.1.10" - } - }, - "fast-json-stable-stringify": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz", - "integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I=", - "dev": true - }, - "fast-levenshtein": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", - "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", - "dev": true - }, - "figures": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/figures/-/figures-2.0.0.tgz", - "integrity": "sha1-OrGi0qYsi/tDGgyUy3l6L84nyWI=", - "dev": true, - "requires": { - "escape-string-regexp": "^1.0.5" - } - }, - "file-entry-cache": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-2.0.0.tgz", - "integrity": "sha1-w5KZDD5oR4PYOLjISkXYoEhFg2E=", - "dev": true, - "requires": { - "flat-cache": "^1.2.1", - "object-assign": "^4.0.1" - } - }, - "filename-regex": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/filename-regex/-/filename-regex-2.0.1.tgz", - "integrity": "sha1-wcS5vuPglyXdsQa3XB4wH+LxiyY=", - "dev": true - }, - "fill-keys": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/fill-keys/-/fill-keys-1.0.2.tgz", - "integrity": "sha1-mo+jb06K1jTjv2tPPIiCVRRS6yA=", - "dev": true, - "requires": { - "is-object": "~1.0.1", - "merge-descriptors": "~1.0.0" - } - }, - "fill-range": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", - "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", - "requires": { - "extend-shallow": "^2.0.1", - "is-number": "^3.0.0", - "repeat-string": "^1.6.1", - "to-regex-range": "^2.1.0" - }, - "dependencies": { - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "requires": { - "is-extendable": "^0.1.0" - } - } - } - }, - "find-cache-dir": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-1.0.0.tgz", - "integrity": "sha1-kojj6ePMN0hxfTnq3hfPcfww7m8=", - "dev": true, - "requires": { - "commondir": "^1.0.1", - "make-dir": "^1.0.0", - "pkg-dir": "^2.0.0" - } - }, - "find-up": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", - "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", - "dev": true, - "requires": { - "locate-path": "^2.0.0" - } - }, - "flat-cache": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-1.3.0.tgz", - "integrity": "sha1-0wMLMrOBVPTjt+nHCfSQ9++XxIE=", - "dev": true, - "requires": { - "circular-json": "^0.3.1", - "del": "^2.0.2", - "graceful-fs": "^4.1.2", - "write": "^0.2.1" - } - }, - "fn-name": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/fn-name/-/fn-name-2.0.1.tgz", - "integrity": "sha1-UhTXU3pNBqSjAcDMJi/rhBiAAuc=", - "dev": true - }, - "follow-redirects": { - "version": "1.5.9", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.5.9.tgz", - "integrity": "sha512-Bh65EZI/RU8nx0wbYF9shkFZlqLP+6WT/5FnA3cE/djNSuKNHJEinGGZgu/cQEkeeb2GdFOgenAmn8qaqYke2w==", - "requires": { - "debug": "=3.1.0" - }, - "dependencies": { - "debug": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", - "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", - "requires": { - "ms": "2.0.0" - } - } - } - }, - "for-in": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", - "integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=" - }, - "for-own": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/for-own/-/for-own-0.1.5.tgz", - "integrity": "sha1-UmXGgaTylNq78XyVCbZ2OqhFEM4=", - "dev": true, - "requires": { - "for-in": "^1.0.1" - } - }, - "forever-agent": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", - "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=", - "dev": true - }, - "form-data": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz", - "integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==", - "dev": true, - "requires": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.6", - "mime-types": "^2.1.12" - } - }, - "formidable": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/formidable/-/formidable-1.2.1.tgz", - "integrity": "sha512-Fs9VRguL0gqGHkXS5GQiMCr1VhZBxz0JnJs4JmMp/2jL18Fmbzvv7vOFRU+U8TBkHEE/CX1qDXzJplVULgsLeg==", - "dev": true - }, - "fragment-cache": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/fragment-cache/-/fragment-cache-0.2.1.tgz", - "integrity": "sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk=", - "requires": { - "map-cache": "^0.2.2" - } - }, - "from2": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/from2/-/from2-2.3.0.tgz", - "integrity": "sha1-i/tVAr3kpNNs/e6gB/zKIdfjgq8=", - "dev": true, - "requires": { - "inherits": "^2.0.1", - "readable-stream": "^2.0.0" - } - }, - "fs-extra": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-6.0.1.tgz", - "integrity": "sha512-GnyIkKhhzXZUWFCaJzvyDLEEgDkPfb4/TPvJCJVuS8MWZgoSsErf++QpiAlDnKFcqhRlm+tIOcencCjyJE6ZCA==", - "dev": true, - "requires": { - "graceful-fs": "^4.1.2", - "jsonfile": "^4.0.0", - "universalify": "^0.1.0" - } - }, - "fs.realpath": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" - }, - "fsevents": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.4.tgz", - "integrity": "sha512-z8H8/diyk76B7q5wg+Ud0+CqzcAF3mBBI/bA5ne5zrRUUIvNkJY//D3BqyH571KuAC4Nr7Rw7CjWX4r0y9DvNg==", - "dev": true, - "optional": true, - "requires": { - "nan": "^2.9.2", - "node-pre-gyp": "^0.10.0" - }, - "dependencies": { - "abbrev": { - "version": "1.1.1", - "bundled": true, - "dev": true, - "optional": true - }, - "ansi-regex": { - "version": "2.1.1", - "bundled": true, - "dev": true - }, - "aproba": { - "version": "1.2.0", - "bundled": true, - "dev": true, - "optional": true - }, - "are-we-there-yet": { - "version": "1.1.4", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "delegates": "^1.0.0", - "readable-stream": "^2.0.6" - } - }, - "balanced-match": { - "version": "1.0.0", - "bundled": true, - "dev": true - }, - "brace-expansion": { - "version": "1.1.11", - "bundled": true, - "dev": true, - "requires": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "chownr": { - "version": "1.0.1", - "bundled": true, - "dev": true, - "optional": true - }, - "code-point-at": { - "version": "1.1.0", - "bundled": true, - "dev": true - }, - "concat-map": { - "version": "0.0.1", - "bundled": true, - "dev": true - }, - "console-control-strings": { - "version": "1.1.0", - "bundled": true, - "dev": true - }, - "core-util-is": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "optional": true - }, - "debug": { - "version": "2.6.9", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "ms": "2.0.0" - } - }, - "deep-extend": { - "version": "0.5.1", - "bundled": true, - "dev": true, - "optional": true - }, - "delegates": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "optional": true - }, - "detect-libc": { - "version": "1.0.3", - "bundled": true, - "dev": true, - "optional": true - }, - "fs-minipass": { - "version": "1.2.5", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "minipass": "^2.2.1" - } - }, - "fs.realpath": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "optional": true - }, - "gauge": { - "version": "2.7.4", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "aproba": "^1.0.3", - "console-control-strings": "^1.0.0", - "has-unicode": "^2.0.0", - "object-assign": "^4.1.0", - "signal-exit": "^3.0.0", - "string-width": "^1.0.1", - "strip-ansi": "^3.0.1", - "wide-align": "^1.1.0" - } - }, - "glob": { - "version": "7.1.2", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - }, - "has-unicode": { - "version": "2.0.1", - "bundled": true, - "dev": true, - "optional": true - }, - "iconv-lite": { - "version": "0.4.21", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "safer-buffer": "^2.1.0" - } - }, - "ignore-walk": { - "version": "3.0.1", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "minimatch": "^3.0.4" - } - }, - "inflight": { - "version": "1.0.6", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "inherits": { - "version": "2.0.3", - "bundled": true, - "dev": true - }, - "ini": { - "version": "1.3.5", - "bundled": true, - "dev": true, - "optional": true - }, - "is-fullwidth-code-point": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "requires": { - "number-is-nan": "^1.0.0" - } - }, - "isarray": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "optional": true - }, - "minimatch": { - "version": "3.0.4", - "bundled": true, - "dev": true, - "requires": { - "brace-expansion": "^1.1.7" - } - }, - "minimist": { - "version": "0.0.8", - "bundled": true, - "dev": true - }, - "minipass": { - "version": "2.2.4", - "bundled": true, - "dev": true, - "requires": { - "safe-buffer": "^5.1.1", - "yallist": "^3.0.0" - } - }, - "minizlib": { - "version": "1.1.0", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "minipass": "^2.2.1" - } - }, - "mkdirp": { - "version": "0.5.1", - "bundled": true, - "dev": true, - "requires": { - "minimist": "0.0.8" - } - }, - "ms": { - "version": "2.0.0", - "bundled": true, - "dev": true, - "optional": true - }, - "needle": { - "version": "2.2.0", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "debug": "^2.1.2", - "iconv-lite": "^0.4.4", - "sax": "^1.2.4" - } - }, - "node-pre-gyp": { - "version": "0.10.0", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "detect-libc": "^1.0.2", - "mkdirp": "^0.5.1", - "needle": "^2.2.0", - "nopt": "^4.0.1", - "npm-packlist": "^1.1.6", - "npmlog": "^4.0.2", - "rc": "^1.1.7", - "rimraf": "^2.6.1", - "semver": "^5.3.0", - "tar": "^4" - } - }, - "nopt": { - "version": "4.0.1", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "abbrev": "1", - "osenv": "^0.1.4" - } - }, - "npm-bundled": { - "version": "1.0.3", - "bundled": true, - "dev": true, - "optional": true - }, - "npm-packlist": { - "version": "1.1.10", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "ignore-walk": "^3.0.1", - "npm-bundled": "^1.0.1" - } - }, - "npmlog": { - "version": "4.1.2", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "are-we-there-yet": "~1.1.2", - "console-control-strings": "~1.1.0", - "gauge": "~2.7.3", - "set-blocking": "~2.0.0" - } - }, - "number-is-nan": { - "version": "1.0.1", - "bundled": true, - "dev": true - }, - "object-assign": { - "version": "4.1.1", - "bundled": true, - "dev": true, - "optional": true - }, - "once": { - "version": "1.4.0", - "bundled": true, - "dev": true, - "requires": { - "wrappy": "1" - } - }, - "os-homedir": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "optional": true - }, - "os-tmpdir": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "optional": true - }, - "osenv": { - "version": "0.1.5", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "os-homedir": "^1.0.0", - "os-tmpdir": "^1.0.0" - } - }, - "path-is-absolute": { - "version": "1.0.1", - "bundled": true, - "dev": true, - "optional": true - }, - "process-nextick-args": { - "version": "2.0.0", - "bundled": true, - "dev": true, - "optional": true - }, - "rc": { - "version": "1.2.7", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "deep-extend": "^0.5.1", - "ini": "~1.3.0", - "minimist": "^1.2.0", - "strip-json-comments": "~2.0.1" - }, - "dependencies": { - "minimist": { - "version": "1.2.0", - "bundled": true, - "dev": true, - "optional": true - } - } - }, - "readable-stream": { - "version": "2.3.6", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "rimraf": { - "version": "2.6.2", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "glob": "^7.0.5" - } - }, - "safe-buffer": { - "version": "5.1.1", - "bundled": true, - "dev": true - }, - "safer-buffer": { - "version": "2.1.2", - "bundled": true, - "dev": true, - "optional": true - }, - "sax": { - "version": "1.2.4", - "bundled": true, - "dev": true, - "optional": true - }, - "semver": { - "version": "5.5.0", - "bundled": true, - "dev": true, - "optional": true - }, - "set-blocking": { - "version": "2.0.0", - "bundled": true, - "dev": true, - "optional": true - }, - "signal-exit": { - "version": "3.0.2", - "bundled": true, - "dev": true, - "optional": true - }, - "string-width": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "requires": { - "code-point-at": "^1.0.0", - "is-fullwidth-code-point": "^1.0.0", - "strip-ansi": "^3.0.0" - } - }, - "string_decoder": { - "version": "1.1.1", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "safe-buffer": "~5.1.0" - } - }, - "strip-ansi": { - "version": "3.0.1", - "bundled": true, - "dev": true, - "requires": { - "ansi-regex": "^2.0.0" - } - }, - "strip-json-comments": { - "version": "2.0.1", - "bundled": true, - "dev": true, - "optional": true - }, - "tar": { - "version": "4.4.1", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "chownr": "^1.0.1", - "fs-minipass": "^1.2.5", - "minipass": "^2.2.4", - "minizlib": "^1.1.0", - "mkdirp": "^0.5.0", - "safe-buffer": "^5.1.1", - "yallist": "^3.0.2" - } - }, - "util-deprecate": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "optional": true - }, - "wide-align": { - "version": "1.1.2", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "string-width": "^1.0.2" - } - }, - "wrappy": { - "version": "1.0.2", - "bundled": true, - "dev": true - }, - "yallist": { - "version": "3.0.2", - "bundled": true, - "dev": true - } - } - }, - "function-name-support": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/function-name-support/-/function-name-support-0.2.0.tgz", - "integrity": "sha1-VdO/qm6v1QWlD5vIH99XVkoLsHE=", - "dev": true - }, - "functional-red-black-tree": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", - "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=", - "dev": true - }, - "gcp-metadata": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/gcp-metadata/-/gcp-metadata-0.7.0.tgz", - "integrity": "sha512-ffjC09amcDWjh3VZdkDngIo7WoluyC5Ag9PAYxZbmQLOLNI8lvPtoKTSCyU54j2gwy5roZh6sSMTfkY2ct7K3g==", - "requires": { - "axios": "^0.18.0", - "extend": "^3.0.1", - "retry-axios": "0.3.2" - } - }, - "get-caller-file": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.3.tgz", - "integrity": "sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w==", - "dev": true - }, - "get-port": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/get-port/-/get-port-3.2.0.tgz", - "integrity": "sha1-3Xzn3hh8Bsi/NTeWrHHgmfCYDrw=", - "dev": true - }, - "get-stdin": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-4.0.1.tgz", - "integrity": "sha1-uWjGsKBDhDJJAui/Gl3zJXmkUP4=", - "dev": true - }, - "get-stream": { - "version": "3.0.0", - "resolved": "http://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz", - "integrity": "sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ=", - "dev": true - }, - "get-value": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz", - "integrity": "sha1-3BXKHGcjh8p2vTesCjlbogQqLCg=" - }, - "getpass": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", - "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", - "dev": true, - "requires": { - "assert-plus": "^1.0.0" - } - }, - "glob": { - "version": "7.1.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz", - "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==", - "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - }, - "glob-base": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/glob-base/-/glob-base-0.3.0.tgz", - "integrity": "sha1-27Fk9iIbHAscz4Kuoyi0l98Oo8Q=", - "dev": true, - "requires": { - "glob-parent": "^2.0.0", - "is-glob": "^2.0.0" - }, - "dependencies": { - "glob-parent": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-2.0.0.tgz", - "integrity": "sha1-gTg9ctsFT8zPUzbaqQLxgvbtuyg=", - "dev": true, - "requires": { - "is-glob": "^2.0.0" - } - }, - "is-extglob": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz", - "integrity": "sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA=", - "dev": true - }, - "is-glob": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz", - "integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=", - "dev": true, - "requires": { - "is-extglob": "^1.0.0" - } - } - } - }, - "glob-parent": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-3.1.0.tgz", - "integrity": "sha1-nmr2KZ2NO9K9QEMIMr0RPfkGxa4=", - "requires": { - "is-glob": "^3.1.0", - "path-dirname": "^1.0.0" - }, - "dependencies": { - "is-glob": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-3.1.0.tgz", - "integrity": "sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo=", - "requires": { - "is-extglob": "^2.1.0" - } - } - } - }, - "glob-to-regexp": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/glob-to-regexp/-/glob-to-regexp-0.3.0.tgz", - "integrity": "sha1-jFoUlNIGbFcMw7/kSWF1rMTVAqs=" - }, - "global-dirs": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/global-dirs/-/global-dirs-0.1.1.tgz", - "integrity": "sha1-sxnA3UYH81PzvpzKTHL8FIxJ9EU=", - "dev": true, - "requires": { - "ini": "^1.3.4" - } - }, - "globals": { - "version": "9.18.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-9.18.0.tgz", - "integrity": "sha512-S0nG3CLEQiY/ILxqtztTWH/3iRRdyBLw6KMDxnKMchrtbj2OFmehVh0WUCfW3DUrIgx/qFrJPICrq4Z4sTR9UQ==", - "dev": true - }, - "globby": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/globby/-/globby-8.0.1.tgz", - "integrity": "sha512-oMrYrJERnKBLXNLVTqhm3vPEdJ/b2ZE28xN4YARiix1NOIOBPEpOUnm844K1iu/BkphCaf2WNFwMszv8Soi1pw==", - "requires": { - "array-union": "^1.0.1", - "dir-glob": "^2.0.0", - "fast-glob": "^2.0.2", - "glob": "^7.1.2", - "ignore": "^3.3.5", - "pify": "^3.0.0", - "slash": "^1.0.0" - } - }, - "google-auth-library": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/google-auth-library/-/google-auth-library-2.0.1.tgz", - "integrity": "sha512-CWLKZxqYw4SE+fE3GWbVT9r/10h75w8lB3cdmmLpLtCfccFDcsI84qI5rx7npemlrHtKJh3C2HUz4s6SihCeIQ==", - "requires": { - "axios": "^0.18.0", - "gcp-metadata": "^0.7.0", - "gtoken": "^2.3.0", - "https-proxy-agent": "^2.2.1", - "jws": "^3.1.5", - "lodash.isstring": "^4.0.1", - "lru-cache": "^4.1.3", - "semver": "^5.5.0" - } - }, - "google-gax": { - "version": "0.20.0", - "resolved": "https://registry.npmjs.org/google-gax/-/google-gax-0.20.0.tgz", - "integrity": "sha512-JoaRCQtks60zuB3c5/5y60jG+xFBP67yYIgF6UuuDDVZtj/Z6kCKqjrGWNXEzFH2jolHZcvocST3JMwA/XClvA==", - "requires": { - "@grpc/grpc-js": "^0.2.0", - "@grpc/proto-loader": "^0.3.0", - "duplexify": "^3.6.0", - "extend": "^3.0.1", - "globby": "^8.0.1", - "google-auth-library": "^2.0.0", - "google-proto-files": "^0.16.0", - "grpc": "^1.12.2", - "is-stream-ended": "^0.1.4", - "lodash": "^4.17.10", - "protobufjs": "^6.8.8", - "retry-request": "^4.0.0", - "semver": "^5.5.1", - "through2": "^2.0.3" - } - }, - "google-p12-pem": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/google-p12-pem/-/google-p12-pem-1.0.2.tgz", - "integrity": "sha512-+EuKr4CLlGsnXx4XIJIVkcKYrsa2xkAmCvxRhX2HsazJzUBAJ35wARGeApHUn4nNfPD03Vl057FskNr20VaCyg==", - "requires": { - "node-forge": "^0.7.4", - "pify": "^3.0.0" - } - }, - "google-proto-files": { - "version": "0.16.1", - "resolved": "https://registry.npmjs.org/google-proto-files/-/google-proto-files-0.16.1.tgz", - "integrity": "sha512-ykdhaYDiU/jlyrkzZDPemraKwVIgLT31XMHVNSJW//R9VED56hqSDRMx1Jlxbf0O4iDZnBWQ0JQLHbM2r5+wuA==", - "requires": { - "globby": "^8.0.0", - "power-assert": "^1.4.4", - "protobufjs": "^6.8.0" - } - }, - "got": { - "version": "8.3.2", - "resolved": "https://registry.npmjs.org/got/-/got-8.3.2.tgz", - "integrity": "sha512-qjUJ5U/hawxosMryILofZCkm3C84PLJS/0grRIpjAwu+Lkxxj5cxeCU25BG0/3mDSpXKTyZr8oh8wIgLaH0QCw==", - "dev": true, - "requires": { - "@sindresorhus/is": "^0.7.0", - "cacheable-request": "^2.1.1", - "decompress-response": "^3.3.0", - "duplexer3": "^0.1.4", - "get-stream": "^3.0.0", - "into-stream": "^3.1.0", - "is-retry-allowed": "^1.1.0", - "isurl": "^1.0.0-alpha5", - "lowercase-keys": "^1.0.0", - "mimic-response": "^1.0.0", - "p-cancelable": "^0.4.0", - "p-timeout": "^2.0.1", - "pify": "^3.0.0", - "safe-buffer": "^5.1.1", - "timed-out": "^4.0.1", - "url-parse-lax": "^3.0.0", - "url-to-options": "^1.0.1" - }, - "dependencies": { - "prepend-http": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/prepend-http/-/prepend-http-2.0.0.tgz", - "integrity": "sha1-6SQ0v6XqjBn0HN/UAddBo8gZ2Jc=", - "dev": true - }, - "url-parse-lax": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/url-parse-lax/-/url-parse-lax-3.0.0.tgz", - "integrity": "sha1-FrXK/Afb42dsGxmZF3gj1lA6yww=", - "dev": true, - "requires": { - "prepend-http": "^2.0.0" - } - } - } - }, - "graceful-fs": { - "version": "4.1.15", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.15.tgz", - "integrity": "sha512-6uHUhOPEBgQ24HM+r6b/QwWfZq+yiFcipKFrOFiBEnWdy5sdzYoi+pJeQaPI5qOLRFqWmAXUPQNsielzdLoecA==", - "dev": true - }, - "growl": { - "version": "1.10.5", - "resolved": "https://registry.npmjs.org/growl/-/growl-1.10.5.tgz", - "integrity": "sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA==", - "dev": true - }, - "grpc": { - "version": "1.16.0", - "resolved": "https://registry.npmjs.org/grpc/-/grpc-1.16.0.tgz", - "integrity": "sha512-+p8YRIng7Gihkn2jycAXwXdA9aQ10SikRrcHY+/r3W1Z1Pr9NFIbLcmBZPoaTbzzLDv/ysqwqFEZriAdd8tveQ==", - "requires": { - "lodash": "^4.17.5", - "nan": "^2.0.0", - "node-pre-gyp": "^0.10.0", - "protobufjs": "^5.0.3" - }, - "dependencies": { - "abbrev": { - "version": "1.1.1", - "bundled": true - }, - "ansi-regex": { - "version": "2.1.1", - "bundled": true - }, - "aproba": { - "version": "1.2.0", - "bundled": true - }, - "are-we-there-yet": { - "version": "1.1.5", - "bundled": true, - "requires": { - "delegates": "^1.0.0", - "readable-stream": "^2.0.6" - } - }, - "balanced-match": { - "version": "1.0.0", - "bundled": true - }, - "brace-expansion": { - "version": "1.1.11", - "bundled": true, - "requires": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "chownr": { - "version": "1.0.1", - "bundled": true - }, - "code-point-at": { - "version": "1.1.0", - "bundled": true - }, - "concat-map": { - "version": "0.0.1", - "bundled": true - }, - "console-control-strings": { - "version": "1.1.0", - "bundled": true - }, - "core-util-is": { - "version": "1.0.2", - "bundled": true - }, - "debug": { - "version": "2.6.9", - "bundled": true, - "requires": { - "ms": "2.0.0" - } - }, - "deep-extend": { - "version": "0.6.0", - "bundled": true - }, - "delegates": { - "version": "1.0.0", - "bundled": true - }, - "detect-libc": { - "version": "1.0.3", - "bundled": true - }, - "fs-minipass": { - "version": "1.2.5", - "bundled": true, - "requires": { - "minipass": "^2.2.1" - } - }, - "fs.realpath": { - "version": "1.0.0", - "bundled": true - }, - "gauge": { - "version": "2.7.4", - "bundled": true, - "requires": { - "aproba": "^1.0.3", - "console-control-strings": "^1.0.0", - "has-unicode": "^2.0.0", - "object-assign": "^4.1.0", - "signal-exit": "^3.0.0", - "string-width": "^1.0.1", - "strip-ansi": "^3.0.1", - "wide-align": "^1.1.0" - } - }, - "glob": { - "version": "7.1.2", - "bundled": true, - "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - }, - "has-unicode": { - "version": "2.0.1", - "bundled": true - }, - "iconv-lite": { - "version": "0.4.23", - "bundled": true, - "requires": { - "safer-buffer": ">= 2.1.2 < 3" - } - }, - "ignore-walk": { - "version": "3.0.1", - "bundled": true, - "requires": { - "minimatch": "^3.0.4" - } - }, - "inflight": { - "version": "1.0.6", - "bundled": true, - "requires": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "inherits": { - "version": "2.0.3", - "bundled": true - }, - "ini": { - "version": "1.3.5", - "bundled": true - }, - "is-fullwidth-code-point": { - "version": "1.0.0", - "bundled": true, - "requires": { - "number-is-nan": "^1.0.0" - } - }, - "isarray": { - "version": "1.0.0", - "bundled": true - }, - "minimatch": { - "version": "3.0.4", - "bundled": true, - "requires": { - "brace-expansion": "^1.1.7" - } - }, - "minimist": { - "version": "1.2.0", - "bundled": true - }, - "minipass": { - "version": "2.3.3", - "bundled": true, - "requires": { - "safe-buffer": "^5.1.2", - "yallist": "^3.0.0" - } - }, - "minizlib": { - "version": "1.1.0", - "bundled": true, - "requires": { - "minipass": "^2.2.1" - } - }, - "mkdirp": { - "version": "0.5.1", - "bundled": true, - "requires": { - "minimist": "0.0.8" - }, - "dependencies": { - "minimist": { - "version": "0.0.8", - "bundled": true - } - } - }, - "ms": { - "version": "2.0.0", - "bundled": true - }, - "needle": { - "version": "2.2.2", - "bundled": true, - "requires": { - "debug": "^2.1.2", - "iconv-lite": "^0.4.4", - "sax": "^1.2.4" - } - }, - "node-pre-gyp": { - "version": "0.10.3", - "bundled": true, - "requires": { - "detect-libc": "^1.0.2", - "mkdirp": "^0.5.1", - "needle": "^2.2.1", - "nopt": "^4.0.1", - "npm-packlist": "^1.1.6", - "npmlog": "^4.0.2", - "rc": "^1.2.7", - "rimraf": "^2.6.1", - "semver": "^5.3.0", - "tar": "^4" - } - }, - "nopt": { - "version": "4.0.1", - "bundled": true, - "requires": { - "abbrev": "1", - "osenv": "^0.1.4" - } - }, - "npm-bundled": { - "version": "1.0.3", - "bundled": true - }, - "npm-packlist": { - "version": "1.1.11", - "bundled": true, - "requires": { - "ignore-walk": "^3.0.1", - "npm-bundled": "^1.0.1" - } - }, - "npmlog": { - "version": "4.1.2", - "bundled": true, - "requires": { - "are-we-there-yet": "~1.1.2", - "console-control-strings": "~1.1.0", - "gauge": "~2.7.3", - "set-blocking": "~2.0.0" - } - }, - "number-is-nan": { - "version": "1.0.1", - "bundled": true - }, - "object-assign": { - "version": "4.1.1", - "bundled": true - }, - "once": { - "version": "1.4.0", - "bundled": true, - "requires": { - "wrappy": "1" - } - }, - "os-homedir": { - "version": "1.0.2", - "bundled": true - }, - "os-tmpdir": { - "version": "1.0.2", - "bundled": true - }, - "osenv": { - "version": "0.1.5", - "bundled": true, - "requires": { - "os-homedir": "^1.0.0", - "os-tmpdir": "^1.0.0" - } - }, - "path-is-absolute": { - "version": "1.0.1", - "bundled": true - }, - "process-nextick-args": { - "version": "2.0.0", - "bundled": true - }, - "protobufjs": { - "version": "5.0.3", - "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-5.0.3.tgz", - "integrity": "sha512-55Kcx1MhPZX0zTbVosMQEO5R6/rikNXd9b6RQK4KSPcrSIIwoXTtebIczUrXlwaSrbz4x8XUVThGPob1n8I4QA==", - "requires": { - "ascli": "~1", - "bytebuffer": "~5", - "glob": "^7.0.5", - "yargs": "^3.10.0" - } - }, - "rc": { - "version": "1.2.8", - "bundled": true, - "requires": { - "deep-extend": "^0.6.0", - "ini": "~1.3.0", - "minimist": "^1.2.0", - "strip-json-comments": "~2.0.1" - } - }, - "readable-stream": { - "version": "2.3.6", - "bundled": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "rimraf": { - "version": "2.6.2", - "bundled": true, - "requires": { - "glob": "^7.0.5" - } - }, - "safe-buffer": { - "version": "5.1.2", - "bundled": true - }, - "safer-buffer": { - "version": "2.1.2", - "bundled": true - }, - "sax": { - "version": "1.2.4", - "bundled": true - }, - "semver": { - "version": "5.5.0", - "bundled": true - }, - "set-blocking": { - "version": "2.0.0", - "bundled": true - }, - "signal-exit": { - "version": "3.0.2", - "bundled": true - }, - "string-width": { - "version": "1.0.2", - "bundled": true, - "requires": { - "code-point-at": "^1.0.0", - "is-fullwidth-code-point": "^1.0.0", - "strip-ansi": "^3.0.0" - } - }, - "string_decoder": { - "version": "1.1.1", - "bundled": true, - "requires": { - "safe-buffer": "~5.1.0" - } - }, - "strip-ansi": { - "version": "3.0.1", - "bundled": true, - "requires": { - "ansi-regex": "^2.0.0" - } - }, - "strip-json-comments": { - "version": "2.0.1", - "bundled": true - }, - "tar": { - "version": "4.4.6", - "bundled": true, - "requires": { - "chownr": "^1.0.1", - "fs-minipass": "^1.2.5", - "minipass": "^2.3.3", - "minizlib": "^1.1.0", - "mkdirp": "^0.5.0", - "safe-buffer": "^5.1.2", - "yallist": "^3.0.2" - } - }, - "util-deprecate": { - "version": "1.0.2", - "bundled": true - }, - "wide-align": { - "version": "1.1.3", - "bundled": true, - "requires": { - "string-width": "^1.0.2 || 2" - } - }, - "wrappy": { - "version": "1.0.2", - "bundled": true - }, - "yallist": { - "version": "3.0.2", - "bundled": true - } - } - }, - "gtoken": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/gtoken/-/gtoken-2.3.0.tgz", - "integrity": "sha512-Jc9/8mV630cZE9FC5tIlJCZNdUjwunvlwOtCz6IDlaiB4Sz68ki29a1+q97sWTnTYroiuF9B135rod9zrQdHLw==", - "requires": { - "axios": "^0.18.0", - "google-p12-pem": "^1.0.0", - "jws": "^3.1.4", - "mime": "^2.2.0", - "pify": "^3.0.0" - } - }, - "handlebars": { - "version": "4.0.11", - "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.0.11.tgz", - "integrity": "sha1-Ywo13+ApS8KB7a5v/F0yn8eYLcw=", - "dev": true, - "requires": { - "async": "^1.4.0", - "optimist": "^0.6.1", - "source-map": "^0.4.4", - "uglify-js": "^2.6" - }, - "dependencies": { - "source-map": { - "version": "0.4.4", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.4.4.tgz", - "integrity": "sha1-66T12pwNyZneaAMti092FzZSA2s=", - "dev": true, - "requires": { - "amdefine": ">=0.0.4" - } - } - } - }, - "har-schema": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", - "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=", - "dev": true - }, - "har-validator": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.0.tgz", - "integrity": "sha512-+qnmNjI4OfH2ipQ9VQOw23bBd/ibtfbVdK2fYbY4acTDqKTW/YDp9McimZdDbG8iV9fZizUqQMD5xvriB146TA==", - "dev": true, - "requires": { - "ajv": "^5.3.0", - "har-schema": "^2.0.0" - } - }, - "has-ansi": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", - "integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=", - "dev": true, - "requires": { - "ansi-regex": "^2.0.0" - } - }, - "has-color": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/has-color/-/has-color-0.1.7.tgz", - "integrity": "sha1-ZxRKUmDDT8PMpnfQQdr1L+e3iy8=", - "dev": true - }, - "has-flag": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz", - "integrity": "sha1-6CB68cx7MNRGzHC3NLXovhj4jVE=", - "dev": true - }, - "has-symbol-support-x": { - "version": "1.4.2", - "resolved": "https://registry.npmjs.org/has-symbol-support-x/-/has-symbol-support-x-1.4.2.tgz", - "integrity": "sha512-3ToOva++HaW+eCpgqZrCfN51IPB+7bJNVT6CUATzueB5Heb8o6Nam0V3HG5dlDvZU1Gn5QLcbahiKw/XVk5JJw==", - "dev": true - }, - "has-to-string-tag-x": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/has-to-string-tag-x/-/has-to-string-tag-x-1.4.1.tgz", - "integrity": "sha512-vdbKfmw+3LoOYVr+mtxHaX5a96+0f3DljYd8JOqvOLsf5mw2Otda2qCDT9qRqLAhrjyQ0h7ual5nOiASpsGNFw==", - "dev": true, - "requires": { - "has-symbol-support-x": "^1.4.1" - } - }, - "has-value": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-value/-/has-value-1.0.0.tgz", - "integrity": "sha1-GLKB2lhbHFxR3vJMkw7SmgvmsXc=", - "requires": { - "get-value": "^2.0.6", - "has-values": "^1.0.0", - "isobject": "^3.0.0" - } - }, - "has-values": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-values/-/has-values-1.0.0.tgz", - "integrity": "sha1-lbC2P+whRmGab+V/51Yo1aOe/k8=", - "requires": { - "is-number": "^3.0.0", - "kind-of": "^4.0.0" - }, - "dependencies": { - "kind-of": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz", - "integrity": "sha1-IIE989cSkosgc3hpGkUGb65y3Vc=", - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "has-yarn": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-yarn/-/has-yarn-1.0.0.tgz", - "integrity": "sha1-ieJdtgS3Jcj1l2//Ct3JIbgopac=", - "dev": true - }, - "he": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/he/-/he-1.1.1.tgz", - "integrity": "sha1-k0EP0hsAlzUVH4howvJx80J+I/0=", - "dev": true - }, - "home-or-tmp": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/home-or-tmp/-/home-or-tmp-2.0.0.tgz", - "integrity": "sha1-42w/LSyufXRqhX440Y1fMqeILbg=", - "dev": true, - "requires": { - "os-homedir": "^1.0.0", - "os-tmpdir": "^1.0.1" - } - }, - "hosted-git-info": { - "version": "2.7.1", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.7.1.tgz", - "integrity": "sha512-7T/BxH19zbcCTa8XkMlbK5lTo1WtgkFi3GvdWEyNuc4Vex7/9Dqbnpsf4JMydcfj9HCg4zUWFTL3Za6lapg5/w==", - "dev": true - }, - "htmlparser2": { - "version": "3.10.0", - "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-3.10.0.tgz", - "integrity": "sha512-J1nEUGv+MkXS0weHNWVKJJ+UrLfePxRWpN3C9bEi9fLxL2+ggW94DQvgYVXsaT30PGwYRIZKNZXuyMhp3Di4bQ==", - "dev": true, - "requires": { - "domelementtype": "^1.3.0", - "domhandler": "^2.3.0", - "domutils": "^1.5.1", - "entities": "^1.1.1", - "inherits": "^2.0.1", - "readable-stream": "^3.0.6" - }, - "dependencies": { - "readable-stream": { - "version": "3.0.6", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.0.6.tgz", - "integrity": "sha512-9E1oLoOWfhSXHGv6QlwXJim7uNzd9EVlWK+21tCU9Ju/kR0/p2AZYPz4qSchgO8PlLIH4FpZYfzwS+rEksZjIg==", - "dev": true, - "requires": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - } - } - } - }, - "http-cache-semantics": { - "version": "3.8.1", - "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-3.8.1.tgz", - "integrity": "sha512-5ai2iksyV8ZXmnZhHH4rWPoxxistEexSi5936zIQ1bnNTW5VnA85B6P/VpXiRM017IgRvb2kKo1a//y+0wSp3w==", - "dev": true - }, - "http-signature": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", - "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", - "dev": true, - "requires": { - "assert-plus": "^1.0.0", - "jsprim": "^1.2.2", - "sshpk": "^1.7.0" - } - }, - "https-proxy-agent": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-2.2.1.tgz", - "integrity": "sha512-HPCTS1LW51bcyMYbxUIOO4HEOlQ1/1qRaFWcyxvwaqUS9TY88aoEuHUY33kuAh1YhVVaDQhLZsnPd+XNARWZlQ==", - "requires": { - "agent-base": "^4.1.0", - "debug": "^3.1.0" - }, - "dependencies": { - "debug": { - "version": "3.2.6", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", - "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", - "requires": { - "ms": "^2.1.1" - } - }, - "ms": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", - "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==" - } - } - }, - "hullabaloo-config-manager": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/hullabaloo-config-manager/-/hullabaloo-config-manager-1.1.1.tgz", - "integrity": "sha512-ztKnkZV0TmxnumCDHHgLGNiDnotu4EHCp9YMkznWuo4uTtCyJ+cu+RNcxUeXYKTllpvLFWnbfWry09yzszgg+A==", - "dev": true, - "requires": { - "dot-prop": "^4.1.0", - "es6-error": "^4.0.2", - "graceful-fs": "^4.1.11", - "indent-string": "^3.1.0", - "json5": "^0.5.1", - "lodash.clonedeep": "^4.5.0", - "lodash.clonedeepwith": "^4.5.0", - "lodash.isequal": "^4.5.0", - "lodash.merge": "^4.6.0", - "md5-hex": "^2.0.0", - "package-hash": "^2.0.0", - "pkg-dir": "^2.0.0", - "resolve-from": "^3.0.0", - "safe-buffer": "^5.0.1" - } - }, - "iconv-lite": { - "version": "0.4.24", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", - "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", - "dev": true, - "requires": { - "safer-buffer": ">= 2.1.2 < 3" - } - }, - "ignore": { - "version": "3.3.10", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-3.3.10.tgz", - "integrity": "sha512-Pgs951kaMm5GXP7MOvxERINe3gsaVjUWFm+UZPSq9xYriQAksyhg0csnS0KXSNRD5NmNdapXEpjxG49+AKh/ug==" - }, - "ignore-by-default": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/ignore-by-default/-/ignore-by-default-1.0.1.tgz", - "integrity": "sha1-SMptcvbGo68Aqa1K5odr44ieKwk=", - "dev": true - }, - "ignore-walk": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/ignore-walk/-/ignore-walk-3.0.1.tgz", - "integrity": "sha512-DTVlMx3IYPe0/JJcYP7Gxg7ttZZu3IInhuEhbchuqneY9wWe5Ojy2mXLBaQFUQmo0AW2r3qG7m1mg86js+gnlQ==", - "dev": true, - "requires": { - "minimatch": "^3.0.4" - } - }, - "import-lazy": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/import-lazy/-/import-lazy-2.1.0.tgz", - "integrity": "sha1-BWmOPUXIjo1+nZLLBYTnfwlvPkM=", - "dev": true - }, - "import-local": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/import-local/-/import-local-0.1.1.tgz", - "integrity": "sha1-sReVcqrNwRxqkQCftDDbyrX2aKg=", - "dev": true, - "requires": { - "pkg-dir": "^2.0.0", - "resolve-cwd": "^2.0.0" - } - }, - "imurmurhash": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", - "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", - "dev": true - }, - "indent-string": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-3.2.0.tgz", - "integrity": "sha1-Sl/W0nzDMvN+VBmlBNu4NxBckok=", - "dev": true - }, - "indexof": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/indexof/-/indexof-0.0.1.tgz", - "integrity": "sha1-gtwzbSMrkGIXnQWrMpOmYFn9Q10=" - }, - "inflight": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", - "requires": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "inherits": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" - }, - "ini": { - "version": "1.3.5", - "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.5.tgz", - "integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==", - "dev": true - }, - "ink-docstrap": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/ink-docstrap/-/ink-docstrap-1.3.2.tgz", - "integrity": "sha512-STx5orGQU1gfrkoI/fMU7lX6CSP7LBGO10gXNgOZhwKhUqbtNjCkYSewJtNnLmWP1tAGN6oyEpG1HFPw5vpa5Q==", - "dev": true, - "requires": { - "moment": "^2.14.1", - "sanitize-html": "^1.13.0" - } - }, - "inquirer": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-6.2.0.tgz", - "integrity": "sha512-QIEQG4YyQ2UYZGDC4srMZ7BjHOmNk1lR2JQj5UknBapklm6WHA+VVH7N+sUdX3A7NeCfGF8o4X1S3Ao7nAcIeg==", - "dev": true, - "requires": { - "ansi-escapes": "^3.0.0", - "chalk": "^2.0.0", - "cli-cursor": "^2.1.0", - "cli-width": "^2.0.0", - "external-editor": "^3.0.0", - "figures": "^2.0.0", - "lodash": "^4.17.10", - "mute-stream": "0.0.7", - "run-async": "^2.2.0", - "rxjs": "^6.1.0", - "string-width": "^2.1.0", - "strip-ansi": "^4.0.0", - "through": "^2.3.6" - }, - "dependencies": { - "ansi-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", - "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", - "dev": true - }, - "is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", - "dev": true - }, - "string-width": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", - "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", - "dev": true, - "requires": { - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^4.0.0" - } - }, - "strip-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", - "dev": true, - "requires": { - "ansi-regex": "^3.0.0" - } - } - } - }, - "intelli-espower-loader": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/intelli-espower-loader/-/intelli-espower-loader-1.0.1.tgz", - "integrity": "sha1-LHsDFGvB1GvyENCgOXxckatMorA=", - "dev": true, - "requires": { - "espower-loader": "^1.0.0" - } - }, - "into-stream": { - "version": "3.1.0", - "resolved": "http://registry.npmjs.org/into-stream/-/into-stream-3.1.0.tgz", - "integrity": "sha1-lvsKk2wSur1v8XUqF9BWFqvQlMY=", - "dev": true, - "requires": { - "from2": "^2.1.1", - "p-is-promise": "^1.1.0" - } - }, - "invariant": { - "version": "2.2.4", - "resolved": "https://registry.npmjs.org/invariant/-/invariant-2.2.4.tgz", - "integrity": "sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA==", - "dev": true, - "requires": { - "loose-envify": "^1.0.0" - } - }, - "invert-kv": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-1.0.0.tgz", - "integrity": "sha1-EEqOSqym09jNFXqO+L+rLXo//bY=" - }, - "irregular-plurals": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/irregular-plurals/-/irregular-plurals-1.4.0.tgz", - "integrity": "sha1-LKmwM2UREYVUEvFr5dd8YqRYp2Y=", - "dev": true - }, - "is-accessor-descriptor": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", - "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", - "requires": { - "kind-of": "^3.0.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "is-arrayish": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", - "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=", - "dev": true - }, - "is-binary-path": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-1.0.1.tgz", - "integrity": "sha1-dfFmQrSA8YenEcgUFh/TpKdlWJg=", - "dev": true, - "requires": { - "binary-extensions": "^1.0.0" - } - }, - "is-buffer": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", - "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==" - }, - "is-builtin-module": { - "version": "1.0.0", - "resolved": "http://registry.npmjs.org/is-builtin-module/-/is-builtin-module-1.0.0.tgz", - "integrity": "sha1-VAVy0096wxGfj3bDDLwbHgN6/74=", - "dev": true, - "requires": { - "builtin-modules": "^1.0.0" - } - }, - "is-ci": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/is-ci/-/is-ci-1.2.1.tgz", - "integrity": "sha512-s6tfsaQaQi3JNciBH6shVqEDvhGut0SUXr31ag8Pd8BBbVVlcGfWhpPmEOoM6RJ5TFhbypvf5yyRw/VXW1IiWg==", - "dev": true, - "requires": { - "ci-info": "^1.5.0" - } - }, - "is-data-descriptor": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", - "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", - "requires": { - "kind-of": "^3.0.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "is-descriptor": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", - "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", - "requires": { - "is-accessor-descriptor": "^0.1.6", - "is-data-descriptor": "^0.1.4", - "kind-of": "^5.0.0" - }, - "dependencies": { - "kind-of": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", - "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==" - } - } - }, - "is-dotfile": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/is-dotfile/-/is-dotfile-1.0.3.tgz", - "integrity": "sha1-pqLzL/0t+wT1yiXs0Pa4PPeYoeE=", - "dev": true - }, - "is-equal-shallow": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/is-equal-shallow/-/is-equal-shallow-0.1.3.tgz", - "integrity": "sha1-IjgJj8Ih3gvPpdnqxMRdY4qhxTQ=", - "dev": true, - "requires": { - "is-primitive": "^2.0.0" - } - }, - "is-error": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/is-error/-/is-error-2.2.1.tgz", - "integrity": "sha1-aEqW2EB2V3yY9M20DG0mpRI78Zw=", - "dev": true - }, - "is-extendable": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", - "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=" - }, - "is-extglob": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=" - }, - "is-finite": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-finite/-/is-finite-1.0.2.tgz", - "integrity": "sha1-zGZ3aVYCvlUO8R6LSqYwU0K20Ko=", - "dev": true, - "requires": { - "number-is-nan": "^1.0.0" - } - }, - "is-fullwidth-code-point": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", - "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", - "requires": { - "number-is-nan": "^1.0.0" - } - }, - "is-generator-fn": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-generator-fn/-/is-generator-fn-1.0.0.tgz", - "integrity": "sha1-lp1J4bszKfa7fwkIm+JleLLd1Go=", - "dev": true - }, - "is-glob": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.0.tgz", - "integrity": "sha1-lSHHaEXMJhCoUgPd8ICpWML/q8A=", - "requires": { - "is-extglob": "^2.1.1" - } - }, - "is-installed-globally": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/is-installed-globally/-/is-installed-globally-0.1.0.tgz", - "integrity": "sha1-Df2Y9akRFxbdU13aZJL2e/PSWoA=", - "dev": true, - "requires": { - "global-dirs": "^0.1.0", - "is-path-inside": "^1.0.0" - } - }, - "is-npm": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-npm/-/is-npm-1.0.0.tgz", - "integrity": "sha1-8vtjpl5JBbQGyGBydloaTceTufQ=", - "dev": true - }, - "is-number": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", - "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", - "requires": { - "kind-of": "^3.0.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "is-obj": { - "version": "1.0.1", - "resolved": "http://registry.npmjs.org/is-obj/-/is-obj-1.0.1.tgz", - "integrity": "sha1-PkcprB9f3gJc19g6iW2rn09n2w8=", - "dev": true - }, - "is-object": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-object/-/is-object-1.0.1.tgz", - "integrity": "sha1-iVJojF7C/9awPsyF52ngKQMINHA=", - "dev": true - }, - "is-observable": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-observable/-/is-observable-1.1.0.tgz", - "integrity": "sha512-NqCa4Sa2d+u7BWc6CukaObG3Fh+CU9bvixbpcXYhy2VvYS7vVGIdAgnIS5Ks3A/cqk4rebLJ9s8zBstT2aKnIA==", - "dev": true, - "requires": { - "symbol-observable": "^1.1.0" - } - }, - "is-path-cwd": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-path-cwd/-/is-path-cwd-1.0.0.tgz", - "integrity": "sha1-0iXsIxMuie3Tj9p2dHLmLmXxEG0=", - "dev": true - }, - "is-path-in-cwd": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-path-in-cwd/-/is-path-in-cwd-1.0.1.tgz", - "integrity": "sha512-FjV1RTW48E7CWM7eE/J2NJvAEEVektecDBVBE5Hh3nM1Jd0kvhHtX68Pr3xsDf857xt3Y4AkwVULK1Vku62aaQ==", - "dev": true, - "requires": { - "is-path-inside": "^1.0.0" - } - }, - "is-path-inside": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-1.0.1.tgz", - "integrity": "sha1-jvW33lBDej/cprToZe96pVy0gDY=", - "dev": true, - "requires": { - "path-is-inside": "^1.0.1" - } - }, - "is-plain-obj": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz", - "integrity": "sha1-caUMhCnfync8kqOQpKA7OfzVHT4=", - "dev": true - }, - "is-plain-object": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", - "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", - "requires": { - "isobject": "^3.0.1" - } - }, - "is-posix-bracket": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/is-posix-bracket/-/is-posix-bracket-0.1.1.tgz", - "integrity": "sha1-MzTceXdDaOkvAW5vvAqI9c1ua8Q=", - "dev": true - }, - "is-primitive": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-primitive/-/is-primitive-2.0.0.tgz", - "integrity": "sha1-IHurkWOEmcB7Kt8kCkGochADRXU=", - "dev": true - }, - "is-promise": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-2.1.0.tgz", - "integrity": "sha1-eaKp7OfwlugPNtKy87wWwf9L8/o=", - "dev": true - }, - "is-redirect": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-redirect/-/is-redirect-1.0.0.tgz", - "integrity": "sha1-HQPd7VO9jbDzDCbk+V02/HyH3CQ=", - "dev": true - }, - "is-resolvable": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-resolvable/-/is-resolvable-1.1.0.tgz", - "integrity": "sha512-qgDYXFSR5WvEfuS5dMj6oTMEbrrSaM0CrFk2Yiq/gXnBvD9pMa2jGXxyhGLfvhZpuMZe18CJpFxAt3CRs42NMg==", - "dev": true - }, - "is-retry-allowed": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-retry-allowed/-/is-retry-allowed-1.1.0.tgz", - "integrity": "sha1-EaBgVotnM5REAz0BJaYaINVk+zQ=", - "dev": true - }, - "is-stream": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", - "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=", - "dev": true - }, - "is-stream-ended": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/is-stream-ended/-/is-stream-ended-0.1.4.tgz", - "integrity": "sha512-xj0XPvmr7bQFTvirqnFr50o0hQIh6ZItDqloxt5aJrR4NQsYeSsyFQERYGCAzfindAcnKjINnwEEgLx4IqVzQw==" - }, - "is-typedarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", - "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=", - "dev": true - }, - "is-url": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/is-url/-/is-url-1.2.4.tgz", - "integrity": "sha512-ITvGim8FhRiYe4IQ5uHSkj7pVaPDrCTkNd3yq3cV7iZAcJdHTUMPMEHcqSOy9xZ9qFenQCvi+2wjH9a1nXqHww==", - "dev": true - }, - "is-utf8": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/is-utf8/-/is-utf8-0.2.1.tgz", - "integrity": "sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI=", - "dev": true - }, - "is-windows": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", - "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==" - }, - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" - }, - "isexe": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", - "dev": true - }, - "isobject": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", - "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=" - }, - "isstream": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", - "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=", - "dev": true - }, - "istanbul-lib-coverage": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.1.tgz", - "integrity": "sha512-nPvSZsVlbG9aLhZYaC3Oi1gT/tpyo3Yt5fNyf6NmcKIayz4VV/txxJFFKAK/gU4dcNn8ehsanBbVHVl0+amOLA==", - "dev": true - }, - "istanbul-lib-instrument": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-3.0.0.tgz", - "integrity": "sha512-eQY9vN9elYjdgN9Iv6NS/00bptm02EBBk70lRMaVjeA6QYocQgenVrSgC28TJurdnZa80AGO3ASdFN+w/njGiQ==", - "dev": true, - "requires": { - "@babel/generator": "^7.0.0", - "@babel/parser": "^7.0.0", - "@babel/template": "^7.0.0", - "@babel/traverse": "^7.0.0", - "@babel/types": "^7.0.0", - "istanbul-lib-coverage": "^2.0.1", - "semver": "^5.5.0" - } - }, - "isurl": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isurl/-/isurl-1.0.0.tgz", - "integrity": "sha512-1P/yWsxPlDtn7QeRD+ULKQPaIaN6yF368GZ2vDfv0AL0NwpStafjWCDDdn0k8wgFMWpVAqG7oJhxHnlud42i9w==", - "dev": true, - "requires": { - "has-to-string-tag-x": "^1.2.0", - "is-object": "^1.0.1" - } - }, - "js-string-escape": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/js-string-escape/-/js-string-escape-1.0.1.tgz", - "integrity": "sha1-4mJbrbwNZ8dTPp7cEGjFh65BN+8=", - "dev": true - }, - "js-tokens": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-3.0.2.tgz", - "integrity": "sha1-mGbfOVECEw449/mWvOtlRDIJwls=", - "dev": true - }, - "js-yaml": { - "version": "3.12.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.12.0.tgz", - "integrity": "sha512-PIt2cnwmPfL4hKNwqeiuz4bKfnzHTBv6HyVgjahA6mPLwPDzjDWrplJBMjHUFxku/N3FlmrbyPclad+I+4mJ3A==", - "dev": true, - "requires": { - "argparse": "^1.0.7", - "esprima": "^4.0.0" - } - }, - "js2xmlparser": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/js2xmlparser/-/js2xmlparser-3.0.0.tgz", - "integrity": "sha1-P7YOqgicVED5MZ9RdgzNB+JJlzM=", - "dev": true, - "requires": { - "xmlcreate": "^1.0.1" - } - }, - "jsbn": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", - "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=", - "dev": true - }, - "jsdoc": { - "version": "3.5.5", - "resolved": "https://registry.npmjs.org/jsdoc/-/jsdoc-3.5.5.tgz", - "integrity": "sha512-6PxB65TAU4WO0Wzyr/4/YhlGovXl0EVYfpKbpSroSj0qBxT4/xod/l40Opkm38dRHRdQgdeY836M0uVnJQG7kg==", - "dev": true, - "requires": { - "babylon": "7.0.0-beta.19", - "bluebird": "~3.5.0", - "catharsis": "~0.8.9", - "escape-string-regexp": "~1.0.5", - "js2xmlparser": "~3.0.0", - "klaw": "~2.0.0", - "marked": "~0.3.6", - "mkdirp": "~0.5.1", - "requizzle": "~0.2.1", - "strip-json-comments": "~2.0.1", - "taffydb": "2.6.2", - "underscore": "~1.8.3" - }, - "dependencies": { - "babylon": { - "version": "7.0.0-beta.19", - "resolved": "https://registry.npmjs.org/babylon/-/babylon-7.0.0-beta.19.tgz", - "integrity": "sha512-Vg0C9s/REX6/WIXN37UKpv5ZhRi6A4pjHlpkE34+8/a6c2W1Q692n3hmc+SZG5lKRnaExLUbxtJ1SVT+KaCQ/A==", - "dev": true - } - } - }, - "jsesc": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz", - "integrity": "sha1-597mbjXW/Bb3EP6R1c9p9w8IkR0=", - "dev": true - }, - "json-buffer": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.0.tgz", - "integrity": "sha1-Wx85evx11ne96Lz8Dkfh+aPZqJg=", - "dev": true - }, - "json-parse-better-errors": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz", - "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==", - "dev": true - }, - "json-schema": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz", - "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=", - "dev": true - }, - "json-schema-traverse": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.3.1.tgz", - "integrity": "sha1-NJptRMU6Ud6JtAgFxdXlm0F9M0A=", - "dev": true - }, - "json-stable-stringify-without-jsonify": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", - "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", - "dev": true - }, - "json-stringify-safe": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", - "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=", - "dev": true - }, - "json5": { - "version": "0.5.1", - "resolved": "http://registry.npmjs.org/json5/-/json5-0.5.1.tgz", - "integrity": "sha1-Hq3nrMASA0rYTiOWdn6tn6VJWCE=", - "dev": true - }, - "jsonfile": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", - "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", - "dev": true, - "requires": { - "graceful-fs": "^4.1.6" - } - }, - "jsprim": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz", - "integrity": "sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=", - "dev": true, - "requires": { - "assert-plus": "1.0.0", - "extsprintf": "1.3.0", - "json-schema": "0.2.3", - "verror": "1.10.0" - } - }, - "just-extend": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/just-extend/-/just-extend-3.0.0.tgz", - "integrity": "sha512-Fu3T6pKBuxjWT/p4DkqGHFRsysc8OauWr4ZRTY9dIx07Y9O0RkoR5jcv28aeD1vuAwhm3nLkDurwLXoALp4DpQ==", - "dev": true - }, - "jwa": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/jwa/-/jwa-1.1.6.tgz", - "integrity": "sha512-tBO/cf++BUsJkYql/kBbJroKOgHWEigTKBAjjBEmrMGYd1QMBC74Hr4Wo2zCZw6ZrVhlJPvoMrkcOnlWR/DJfw==", - "requires": { - "buffer-equal-constant-time": "1.0.1", - "ecdsa-sig-formatter": "1.0.10", - "safe-buffer": "^5.0.1" - } - }, - "jws": { - "version": "3.1.5", - "resolved": "https://registry.npmjs.org/jws/-/jws-3.1.5.tgz", - "integrity": "sha512-GsCSexFADNQUr8T5HPJvayTjvPIfoyJPtLQBwn5a4WZQchcrPMPMAWcC1AzJVRDKyD6ZPROPAxgv6rfHViO4uQ==", - "requires": { - "jwa": "^1.1.5", - "safe-buffer": "^5.0.1" - } - }, - "keyv": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/keyv/-/keyv-3.0.0.tgz", - "integrity": "sha512-eguHnq22OE3uVoSYG0LVWNP+4ppamWr9+zWBe1bsNcovIMy6huUJFPgy4mGwCd/rnl3vOLGW1MTlu4c57CT1xA==", - "dev": true, - "requires": { - "json-buffer": "3.0.0" - } - }, - "kind-of": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", - "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==" - }, - "klaw": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/klaw/-/klaw-2.0.0.tgz", - "integrity": "sha1-WcEo4Nxc5BAgEVEZTuucv4WGUPY=", - "dev": true, - "requires": { - "graceful-fs": "^4.1.9" - } - }, - "last-line-stream": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/last-line-stream/-/last-line-stream-1.0.0.tgz", - "integrity": "sha1-0bZNafhv8kry0EiDos7uFFIKVgA=", - "dev": true, - "requires": { - "through2": "^2.0.0" - } - }, - "latest-version": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/latest-version/-/latest-version-3.1.0.tgz", - "integrity": "sha1-ogU4P+oyKzO1rjsYq+4NwvNW7hU=", - "dev": true, - "requires": { - "package-json": "^4.0.0" - } - }, - "lazy-cache": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/lazy-cache/-/lazy-cache-1.0.4.tgz", - "integrity": "sha1-odePw6UEdMuAhF07O24dpJpEbo4=", - "dev": true, - "optional": true - }, - "lcid": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/lcid/-/lcid-1.0.0.tgz", - "integrity": "sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU=", - "requires": { - "invert-kv": "^1.0.0" - } - }, - "levn": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", - "integrity": "sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4=", - "dev": true, - "requires": { - "prelude-ls": "~1.1.2", - "type-check": "~0.3.2" - } - }, - "load-json-file": { - "version": "2.0.0", - "resolved": "http://registry.npmjs.org/load-json-file/-/load-json-file-2.0.0.tgz", - "integrity": "sha1-eUfkIUmvgNaWy/eXvKq8/h/inKg=", - "dev": true, - "requires": { - "graceful-fs": "^4.1.2", - "parse-json": "^2.2.0", - "pify": "^2.0.0", - "strip-bom": "^3.0.0" - }, - "dependencies": { - "pify": { - "version": "2.3.0", - "resolved": "http://registry.npmjs.org/pify/-/pify-2.3.0.tgz", - "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", - "dev": true - } - } - }, - "locate-path": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", - "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", - "dev": true, - "requires": { - "p-locate": "^2.0.0", - "path-exists": "^3.0.0" - } - }, - "lodash": { - "version": "4.17.11", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz", - "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==" - }, - "lodash.clonedeep": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz", - "integrity": "sha1-4j8/nE+Pvd6HJSnBBxhXoIblzO8=", - "dev": true - }, - "lodash.clonedeepwith": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/lodash.clonedeepwith/-/lodash.clonedeepwith-4.5.0.tgz", - "integrity": "sha1-buMFc6A6GmDWcKYu8zwQzxr9vdQ=", - "dev": true - }, - "lodash.debounce": { - "version": "4.0.8", - "resolved": "https://registry.npmjs.org/lodash.debounce/-/lodash.debounce-4.0.8.tgz", - "integrity": "sha1-gteb/zCmfEAF/9XiUVMArZyk168=", - "dev": true - }, - "lodash.deburr": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/lodash.deburr/-/lodash.deburr-4.1.0.tgz", - "integrity": "sha1-3bG7s+8HRYwBd7oH3hRCLLAz/5s=", - "dev": true - }, - "lodash.difference": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/lodash.difference/-/lodash.difference-4.5.0.tgz", - "integrity": "sha1-nMtOUF1Ia5FlE0V3KIWi3yf9AXw=", - "dev": true - }, - "lodash.escaperegexp": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/lodash.escaperegexp/-/lodash.escaperegexp-4.1.2.tgz", - "integrity": "sha1-ZHYsSGGAglGKw99Mz11YhtriA0c=", - "dev": true - }, - "lodash.flatten": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/lodash.flatten/-/lodash.flatten-4.4.0.tgz", - "integrity": "sha1-8xwiIlqWMtK7+OSt2+8kCqdlph8=", - "dev": true - }, - "lodash.flattendeep": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/lodash.flattendeep/-/lodash.flattendeep-4.4.0.tgz", - "integrity": "sha1-+wMJF/hqMTTlvJvsDWngAT3f7bI=", - "dev": true - }, - "lodash.get": { - "version": "4.4.2", - "resolved": "https://registry.npmjs.org/lodash.get/-/lodash.get-4.4.2.tgz", - "integrity": "sha1-LRd/ZS+jHpObRDjVNBSZ36OCXpk=", - "dev": true - }, - "lodash.isequal": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/lodash.isequal/-/lodash.isequal-4.5.0.tgz", - "integrity": "sha1-QVxEePK8wwEgwizhDtMib30+GOA=", - "dev": true - }, - "lodash.isplainobject": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz", - "integrity": "sha1-fFJqUtibRcRcxpC4gWO+BJf1UMs=", - "dev": true - }, - "lodash.isstring": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/lodash.isstring/-/lodash.isstring-4.0.1.tgz", - "integrity": "sha1-1SfftUVuynzJu5XV2ur4i6VKVFE=" - }, - "lodash.merge": { - "version": "4.6.1", - "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.1.tgz", - "integrity": "sha512-AOYza4+Hf5z1/0Hztxpm2/xiPZgi/cjMqdnKTUWTBSKchJlxXXuUSxCCl8rJlf4g6yww/j6mA8nC8Hw/EZWxKQ==" - }, - "lodash.mergewith": { - "version": "4.6.1", - "resolved": "https://registry.npmjs.org/lodash.mergewith/-/lodash.mergewith-4.6.1.tgz", - "integrity": "sha512-eWw5r+PYICtEBgrBE5hhlT6aAa75f411bgDz/ZL2KZqYV03USvucsxcHUIlGTDTECs1eunpI7HOV7U+WLDvNdQ==", - "dev": true - }, - "lolex": { - "version": "2.7.5", - "resolved": "https://registry.npmjs.org/lolex/-/lolex-2.7.5.tgz", - "integrity": "sha512-l9x0+1offnKKIzYVjyXU2SiwhXDLekRzKyhnbyldPHvC7BvLPVpdNUNR2KeMAiCN2D/kLNttZgQD5WjSxuBx3Q==", - "dev": true - }, - "long": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/long/-/long-4.0.0.tgz", - "integrity": "sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA==" - }, - "longest": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/longest/-/longest-1.0.1.tgz", - "integrity": "sha1-MKCy2jj3N3DoKUoNIuZiXtd9AJc=", - "dev": true - }, - "loose-envify": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", - "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", - "dev": true, - "requires": { - "js-tokens": "^3.0.0 || ^4.0.0" - } - }, - "loud-rejection": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/loud-rejection/-/loud-rejection-1.6.0.tgz", - "integrity": "sha1-W0b4AUft7leIcPCG0Eghz5mOVR8=", - "dev": true, - "requires": { - "currently-unhandled": "^0.4.1", - "signal-exit": "^3.0.0" - } - }, - "lowercase-keys": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-1.0.1.tgz", - "integrity": "sha512-G2Lj61tXDnVFFOi8VZds+SoQjtQC3dgokKdDG2mTm1tx4m50NUHBOZSBwQQHyy0V12A0JTG4icfZQH+xPyh8VA==", - "dev": true - }, - "lru-cache": { - "version": "4.1.3", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.3.tgz", - "integrity": "sha512-fFEhvcgzuIoJVUF8fYr5KR0YqxD238zgObTps31YdADwPPAp82a4M8TrckkWyx7ekNlf9aBcVn81cFwwXngrJA==", - "requires": { - "pseudomap": "^1.0.2", - "yallist": "^2.1.2" - } - }, - "make-dir": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-1.3.0.tgz", - "integrity": "sha512-2w31R7SJtieJJnQtGc7RVL2StM2vGYVfqUOvUDxH6bC6aJTxPxTF0GnIgCyu7tjockiUWAYQRbxa7vKn34s5sQ==", - "dev": true, - "requires": { - "pify": "^3.0.0" - } - }, - "map-age-cleaner": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/map-age-cleaner/-/map-age-cleaner-0.1.2.tgz", - "integrity": "sha512-UN1dNocxQq44IhJyMI4TU8phc2m9BddacHRPRjKGLYaF0jqd3xLz0jS0skpAU9WgYyoR4gHtUpzytNBS385FWQ==", - "dev": true, - "requires": { - "p-defer": "^1.0.0" - } - }, - "map-cache": { - "version": "0.2.2", - "resolved": "https://registry.npmjs.org/map-cache/-/map-cache-0.2.2.tgz", - "integrity": "sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8=" - }, - "map-obj": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-1.0.1.tgz", - "integrity": "sha1-2TPOuSBdgr3PSIb2dCvcK03qFG0=", - "dev": true - }, - "map-visit": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/map-visit/-/map-visit-1.0.0.tgz", - "integrity": "sha1-7Nyo8TFE5mDxtb1B8S80edmN+48=", - "requires": { - "object-visit": "^1.0.0" - } - }, - "marked": { - "version": "0.3.19", - "resolved": "http://registry.npmjs.org/marked/-/marked-0.3.19.tgz", - "integrity": "sha512-ea2eGWOqNxPcXv8dyERdSr/6FmzvWwzjMxpfGB/sbMccXoct+xY+YukPD+QTUZwyvK7BZwcr4m21WBOW41pAkg==", - "dev": true - }, - "matcher": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/matcher/-/matcher-1.1.1.tgz", - "integrity": "sha512-+BmqxWIubKTRKNWx/ahnCkk3mG8m7OturVlqq6HiojGJTd5hVYbgZm6WzcYPCoB+KBT4Vd6R7WSRG2OADNaCjg==", - "dev": true, - "requires": { - "escape-string-regexp": "^1.0.4" - } - }, - "math-random": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/math-random/-/math-random-1.0.1.tgz", - "integrity": "sha1-izqsWIuKZuSXXjzepn97sylgH6w=", - "dev": true - }, - "md5-hex": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/md5-hex/-/md5-hex-2.0.0.tgz", - "integrity": "sha1-0FiOnxx0lUSS7NJKwKxs6ZfZLjM=", - "dev": true, - "requires": { - "md5-o-matic": "^0.1.1" - } - }, - "md5-o-matic": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/md5-o-matic/-/md5-o-matic-0.1.1.tgz", - "integrity": "sha1-givM1l4RfFFPqxdrJZRdVBAKA8M=", - "dev": true - }, - "mem": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/mem/-/mem-4.0.0.tgz", - "integrity": "sha512-WQxG/5xYc3tMbYLXoXPm81ET2WDULiU5FxbuIoNbJqLOOI8zehXFdZuiUEgfdrU2mVB1pxBZUGlYORSrpuJreA==", - "dev": true, - "requires": { - "map-age-cleaner": "^0.1.1", - "mimic-fn": "^1.0.0", - "p-is-promise": "^1.1.0" - } - }, - "meow": { - "version": "3.7.0", - "resolved": "http://registry.npmjs.org/meow/-/meow-3.7.0.tgz", - "integrity": "sha1-cstmi0JSKCkKu/qFaJJYcwioAfs=", - "dev": true, - "requires": { - "camelcase-keys": "^2.0.0", - "decamelize": "^1.1.2", - "loud-rejection": "^1.0.0", - "map-obj": "^1.0.1", - "minimist": "^1.1.3", - "normalize-package-data": "^2.3.4", - "object-assign": "^4.0.1", - "read-pkg-up": "^1.0.1", - "redent": "^1.0.0", - "trim-newlines": "^1.0.0" - }, - "dependencies": { - "find-up": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz", - "integrity": "sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8=", - "dev": true, - "requires": { - "path-exists": "^2.0.0", - "pinkie-promise": "^2.0.0" - } - }, - "load-json-file": { - "version": "1.1.0", - "resolved": "http://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz", - "integrity": "sha1-lWkFcI1YtLq0wiYbBPWfMcmTdMA=", - "dev": true, - "requires": { - "graceful-fs": "^4.1.2", - "parse-json": "^2.2.0", - "pify": "^2.0.0", - "pinkie-promise": "^2.0.0", - "strip-bom": "^2.0.0" - } - }, - "minimist": { - "version": "1.2.0", - "resolved": "http://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", - "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", - "dev": true - }, - "path-exists": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-2.1.0.tgz", - "integrity": "sha1-D+tsZPD8UY2adU3V77YscCJ2H0s=", - "dev": true, - "requires": { - "pinkie-promise": "^2.0.0" - } - }, - "path-type": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-1.1.0.tgz", - "integrity": "sha1-WcRPfuSR2nBNpBXaWkBwuk+P5EE=", - "dev": true, - "requires": { - "graceful-fs": "^4.1.2", - "pify": "^2.0.0", - "pinkie-promise": "^2.0.0" - } - }, - "pify": { - "version": "2.3.0", - "resolved": "http://registry.npmjs.org/pify/-/pify-2.3.0.tgz", - "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", - "dev": true - }, - "pinkie": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz", - "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA=", - "dev": true - }, - "pinkie-promise": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", - "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=", - "dev": true, - "requires": { - "pinkie": "^2.0.0" - } - }, - "read-pkg": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-1.1.0.tgz", - "integrity": "sha1-9f+qXs0pyzHAR0vKfXVra7KePyg=", - "dev": true, - "requires": { - "load-json-file": "^1.0.0", - "normalize-package-data": "^2.3.2", - "path-type": "^1.0.0" - } - }, - "read-pkg-up": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-1.0.1.tgz", - "integrity": "sha1-nWPBMnbAZZGNV/ACpX9AobZD+wI=", - "dev": true, - "requires": { - "find-up": "^1.0.0", - "read-pkg": "^1.0.0" - } - }, - "strip-bom": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz", - "integrity": "sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4=", - "dev": true, - "requires": { - "is-utf8": "^0.2.0" - } - } - } - }, - "merge-descriptors": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", - "integrity": "sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E=", - "dev": true - }, - "merge-estraverse-visitors": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/merge-estraverse-visitors/-/merge-estraverse-visitors-1.0.0.tgz", - "integrity": "sha1-65aDOLXe1c7tgs7AMH3sui2OqZQ=", - "dev": true, - "requires": { - "estraverse": "^4.0.0" - } - }, - "merge2": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.2.3.tgz", - "integrity": "sha512-gdUU1Fwj5ep4kplwcmftruWofEFt6lfpkkr3h860CXbAB9c3hGb55EOL2ali0Td5oebvW0E1+3Sr+Ur7XfKpRA==" - }, - "methods": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", - "integrity": "sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4=", - "dev": true - }, - "micromatch": { - "version": "3.1.10", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", - "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", - "requires": { - "arr-diff": "^4.0.0", - "array-unique": "^0.3.2", - "braces": "^2.3.1", - "define-property": "^2.0.2", - "extend-shallow": "^3.0.2", - "extglob": "^2.0.4", - "fragment-cache": "^0.2.1", - "kind-of": "^6.0.2", - "nanomatch": "^1.2.9", - "object.pick": "^1.3.0", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.2" - } - }, - "mime": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/mime/-/mime-2.3.1.tgz", - "integrity": "sha512-OEUllcVoydBHGN1z84yfQDimn58pZNNNXgZlHXSboxMlFvgI6MXSWpWKpFRra7H1HxpVhHTkrghfRW49k6yjeg==" - }, - "mime-db": { - "version": "1.37.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.37.0.tgz", - "integrity": "sha512-R3C4db6bgQhlIhPU48fUtdVmKnflq+hRdad7IyKhtFj06VPNVdk2RhiYL3UjQIlso8L+YxAtFkobT0VK+S/ybg==", - "dev": true - }, - "mime-types": { - "version": "2.1.21", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.21.tgz", - "integrity": "sha512-3iL6DbwpyLzjR3xHSFNFeb9Nz/M8WDkX33t1GFQnFOllWk8pOrh/LSrB5OXlnlW5P9LH73X6loW/eogc+F5lJg==", - "dev": true, - "requires": { - "mime-db": "~1.37.0" - } - }, - "mimic-fn": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz", - "integrity": "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==", - "dev": true - }, - "mimic-response": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-1.0.1.tgz", - "integrity": "sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ==", - "dev": true - }, - "minimatch": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", - "requires": { - "brace-expansion": "^1.1.7" - } - }, - "minimist": { - "version": "0.0.8", - "resolved": "http://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", - "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", - "dev": true - }, - "mixin-deep": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.1.tgz", - "integrity": "sha512-8ZItLHeEgaqEvd5lYBXfm4EZSFCX29Jb9K+lAHhDKzReKBQKj3R+7NOF6tjqYi9t4oI8VUfaWITJQm86wnXGNQ==", - "requires": { - "for-in": "^1.0.2", - "is-extendable": "^1.0.1" - }, - "dependencies": { - "is-extendable": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", - "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", - "requires": { - "is-plain-object": "^2.0.4" - } - } - } - }, - "mkdirp": { - "version": "0.5.1", - "resolved": "http://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", - "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", - "dev": true, - "requires": { - "minimist": "0.0.8" - } - }, - "mocha": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-5.2.0.tgz", - "integrity": "sha512-2IUgKDhc3J7Uug+FxMXuqIyYzH7gJjXECKe/w43IGgQHTSj3InJi+yAA7T24L9bQMRKiUEHxEX37G5JpVUGLcQ==", - "dev": true, - "requires": { - "browser-stdout": "1.3.1", - "commander": "2.15.1", - "debug": "3.1.0", - "diff": "3.5.0", - "escape-string-regexp": "1.0.5", - "glob": "7.1.2", - "growl": "1.10.5", - "he": "1.1.1", - "minimatch": "3.0.4", - "mkdirp": "0.5.1", - "supports-color": "5.4.0" - }, - "dependencies": { - "debug": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", - "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", - "dev": true, - "requires": { - "ms": "2.0.0" - } - }, - "glob": { - "version": "7.1.2", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", - "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", - "dev": true, - "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - }, - "has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", - "dev": true - }, - "supports-color": { - "version": "5.4.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", - "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" - } - } - } - }, - "module-not-found-error": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/module-not-found-error/-/module-not-found-error-1.0.1.tgz", - "integrity": "sha1-z4tP9PKWQGdNbN0CsOO8UjwrvcA=", - "dev": true - }, - "moment": { - "version": "2.22.2", - "resolved": "https://registry.npmjs.org/moment/-/moment-2.22.2.tgz", - "integrity": "sha1-PCV/mDn8DpP/UxSWMiOeuQeD/2Y=", - "dev": true - }, - "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" - }, - "multi-stage-sourcemap": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/multi-stage-sourcemap/-/multi-stage-sourcemap-0.2.1.tgz", - "integrity": "sha1-sJ/IWG6qF/gdV1xK0C4Pej9rEQU=", - "dev": true, - "requires": { - "source-map": "^0.1.34" - }, - "dependencies": { - "source-map": { - "version": "0.1.43", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.1.43.tgz", - "integrity": "sha1-wkvBRspRfBRx9drL4lcbK3+eM0Y=", - "dev": true, - "requires": { - "amdefine": ">=0.0.4" - } - } - } - }, - "multimatch": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/multimatch/-/multimatch-2.1.0.tgz", - "integrity": "sha1-nHkGoi+0wCkZ4vX3UWG0zb1LKis=", - "dev": true, - "requires": { - "array-differ": "^1.0.0", - "array-union": "^1.0.1", - "arrify": "^1.0.0", - "minimatch": "^3.0.0" - } - }, - "mute-stream": { - "version": "0.0.7", - "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.7.tgz", - "integrity": "sha1-MHXOk7whuPq0PhvE2n6BFe0ee6s=", - "dev": true - }, - "nan": { - "version": "2.11.1", - "resolved": "https://registry.npmjs.org/nan/-/nan-2.11.1.tgz", - "integrity": "sha512-iji6k87OSXa0CcrLl9z+ZiYSuR2o+c0bGuNmXdrhTQTakxytAFsC56SArGYoiHlJlFoHSnvmhpceZJaXkVuOtA==" - }, - "nanomatch": { - "version": "1.2.13", - "resolved": "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.13.tgz", - "integrity": "sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA==", - "requires": { - "arr-diff": "^4.0.0", - "array-unique": "^0.3.2", - "define-property": "^2.0.2", - "extend-shallow": "^3.0.2", - "fragment-cache": "^0.2.1", - "is-windows": "^1.0.2", - "kind-of": "^6.0.2", - "object.pick": "^1.3.0", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.1" - } - }, - "natural-compare": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", - "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", - "dev": true - }, - "next-tick": { - "version": "1.0.0", - "resolved": "http://registry.npmjs.org/next-tick/-/next-tick-1.0.0.tgz", - "integrity": "sha1-yobR/ogoFpsBICCOPchCS524NCw=", - "dev": true - }, - "nice-try": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", - "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", - "dev": true - }, - "nise": { - "version": "1.4.6", - "resolved": "https://registry.npmjs.org/nise/-/nise-1.4.6.tgz", - "integrity": "sha512-1GedetLKzmqmgwabuMSqPsT7oumdR77SBpDfNNJhADRIeA3LN/2RVqR4fFqwvzhAqcTef6PPCzQwITE/YQ8S8A==", - "dev": true, - "requires": { - "@sinonjs/formatio": "3.0.0", - "just-extend": "^3.0.0", - "lolex": "^2.3.2", - "path-to-regexp": "^1.7.0", - "text-encoding": "^0.6.4" - }, - "dependencies": { - "@sinonjs/formatio": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@sinonjs/formatio/-/formatio-3.0.0.tgz", - "integrity": "sha512-vdjoYLDptCgvtJs57ULshak3iJe4NW3sJ3g36xVDGff5AE8P30S6A093EIEPjdi2noGhfuNOEkbxt3J3awFW1w==", - "dev": true, - "requires": { - "@sinonjs/samsam": "2.1.0" - } - } - } - }, - "node-forge": { - "version": "0.7.6", - "resolved": "https://registry.npmjs.org/node-forge/-/node-forge-0.7.6.tgz", - "integrity": "sha512-sol30LUpz1jQFBjOKwbjxijiE3b6pjd74YwfD0fJOKPjF+fONKb2Yg8rYgS6+bK6VDl+/wfr4IYpC7jDzLUIfw==" - }, - "normalize-package-data": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.4.0.tgz", - "integrity": "sha512-9jjUFbTPfEy3R/ad/2oNbKtW9Hgovl5O1FvFWKkKblNXoN/Oou6+9+KKohPK13Yc3/TyunyWhJp6gvRNR/PPAw==", - "dev": true, - "requires": { - "hosted-git-info": "^2.1.4", - "is-builtin-module": "^1.0.0", - "semver": "2 || 3 || 4 || 5", - "validate-npm-package-license": "^3.0.1" - } - }, - "normalize-path": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", - "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=", - "dev": true, - "requires": { - "remove-trailing-separator": "^1.0.1" - } - }, - "normalize-url": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-2.0.1.tgz", - "integrity": "sha512-D6MUW4K/VzoJ4rJ01JFKxDrtY1v9wrgzCX5f2qj/lzH1m/lW6MhUZFKerVsnyjOhOsYzI9Kqqak+10l4LvLpMw==", - "dev": true, - "requires": { - "prepend-http": "^2.0.0", - "query-string": "^5.0.1", - "sort-keys": "^2.0.0" - }, - "dependencies": { - "prepend-http": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/prepend-http/-/prepend-http-2.0.0.tgz", - "integrity": "sha1-6SQ0v6XqjBn0HN/UAddBo8gZ2Jc=", - "dev": true - } - } - }, - "npm-run-path": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz", - "integrity": "sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8=", - "dev": true, - "requires": { - "path-key": "^2.0.0" - } - }, - "number-is-nan": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", - "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=" - }, - "nyc": { - "version": "13.1.0", - "resolved": "https://registry.npmjs.org/nyc/-/nyc-13.1.0.tgz", - "integrity": "sha512-3GyY6TpQ58z9Frpv4GMExE1SV2tAgYqC7HSy2omEhNiCT3mhT9NyiOvIE8zkbuJVFzmvvNTnE4h/7/wQae7xLg==", - "dev": true, - "requires": { - "archy": "^1.0.0", - "arrify": "^1.0.1", - "caching-transform": "^2.0.0", - "convert-source-map": "^1.6.0", - "debug-log": "^1.0.1", - "find-cache-dir": "^2.0.0", - "find-up": "^3.0.0", - "foreground-child": "^1.5.6", - "glob": "^7.1.3", - "istanbul-lib-coverage": "^2.0.1", - "istanbul-lib-hook": "^2.0.1", - "istanbul-lib-instrument": "^3.0.0", - "istanbul-lib-report": "^2.0.2", - "istanbul-lib-source-maps": "^2.0.1", - "istanbul-reports": "^2.0.1", - "make-dir": "^1.3.0", - "merge-source-map": "^1.1.0", - "resolve-from": "^4.0.0", - "rimraf": "^2.6.2", - "signal-exit": "^3.0.2", - "spawn-wrap": "^1.4.2", - "test-exclude": "^5.0.0", - "uuid": "^3.3.2", - "yargs": "11.1.0", - "yargs-parser": "^9.0.2" - }, - "dependencies": { - "align-text": { - "version": "0.1.4", - "bundled": true, - "dev": true, - "requires": { - "kind-of": "^3.0.2", - "longest": "^1.0.1", - "repeat-string": "^1.5.2" - } - }, - "amdefine": { - "version": "1.0.1", - "bundled": true, - "dev": true - }, - "ansi-regex": { - "version": "3.0.0", - "bundled": true, - "dev": true - }, - "append-transform": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "requires": { - "default-require-extensions": "^2.0.0" - } - }, - "archy": { - "version": "1.0.0", - "bundled": true, - "dev": true - }, - "arrify": { - "version": "1.0.1", - "bundled": true, - "dev": true - }, - "async": { - "version": "1.5.2", - "bundled": true, - "dev": true - }, - "balanced-match": { - "version": "1.0.0", - "bundled": true, - "dev": true - }, - "brace-expansion": { - "version": "1.1.11", - "bundled": true, - "dev": true, - "requires": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "builtin-modules": { - "version": "1.1.1", - "bundled": true, - "dev": true - }, - "caching-transform": { - "version": "2.0.0", - "bundled": true, - "dev": true, - "requires": { - "make-dir": "^1.0.0", - "md5-hex": "^2.0.0", - "package-hash": "^2.0.0", - "write-file-atomic": "^2.0.0" - } - }, - "camelcase": { - "version": "1.2.1", - "bundled": true, - "dev": true, - "optional": true - }, - "center-align": { - "version": "0.1.3", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "align-text": "^0.1.3", - "lazy-cache": "^1.0.3" - } - }, - "cliui": { - "version": "2.1.0", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "center-align": "^0.1.1", - "right-align": "^0.1.1", - "wordwrap": "0.0.2" - }, - "dependencies": { - "wordwrap": { - "version": "0.0.2", - "bundled": true, - "dev": true, - "optional": true - } - } - }, - "code-point-at": { - "version": "1.1.0", - "bundled": true, - "dev": true - }, - "commondir": { - "version": "1.0.1", - "bundled": true, - "dev": true - }, - "concat-map": { - "version": "0.0.1", - "bundled": true, - "dev": true - }, - "convert-source-map": { - "version": "1.6.0", - "bundled": true, - "dev": true, - "requires": { - "safe-buffer": "~5.1.1" - } - }, - "cross-spawn": { - "version": "4.0.2", - "bundled": true, - "dev": true, - "requires": { - "lru-cache": "^4.0.1", - "which": "^1.2.9" - } - }, - "debug": { - "version": "3.1.0", - "bundled": true, - "dev": true, - "requires": { - "ms": "2.0.0" - } - }, - "debug-log": { - "version": "1.0.1", - "bundled": true, - "dev": true - }, - "decamelize": { - "version": "1.2.0", - "bundled": true, - "dev": true - }, - "default-require-extensions": { - "version": "2.0.0", - "bundled": true, - "dev": true, - "requires": { - "strip-bom": "^3.0.0" - } - }, - "error-ex": { - "version": "1.3.2", - "bundled": true, - "dev": true, - "requires": { - "is-arrayish": "^0.2.1" - } - }, - "es6-error": { - "version": "4.1.1", - "bundled": true, - "dev": true - }, - "execa": { - "version": "0.7.0", - "bundled": true, - "dev": true, - "requires": { - "cross-spawn": "^5.0.1", - "get-stream": "^3.0.0", - "is-stream": "^1.1.0", - "npm-run-path": "^2.0.0", - "p-finally": "^1.0.0", - "signal-exit": "^3.0.0", - "strip-eof": "^1.0.0" - }, - "dependencies": { - "cross-spawn": { - "version": "5.1.0", - "bundled": true, - "dev": true, - "requires": { - "lru-cache": "^4.0.1", - "shebang-command": "^1.2.0", - "which": "^1.2.9" - } - } - } - }, - "find-cache-dir": { - "version": "2.0.0", - "bundled": true, - "dev": true, - "requires": { - "commondir": "^1.0.1", - "make-dir": "^1.0.0", - "pkg-dir": "^3.0.0" - } - }, - "find-up": { - "version": "3.0.0", - "bundled": true, - "dev": true, - "requires": { - "locate-path": "^3.0.0" - } - }, - "foreground-child": { - "version": "1.5.6", - "bundled": true, - "dev": true, - "requires": { - "cross-spawn": "^4", - "signal-exit": "^3.0.0" - } - }, - "fs.realpath": { - "version": "1.0.0", - "bundled": true, - "dev": true - }, - "get-caller-file": { - "version": "1.0.3", - "bundled": true, - "dev": true - }, - "get-stream": { - "version": "3.0.0", - "bundled": true, - "dev": true - }, - "glob": { - "version": "7.1.3", - "bundled": true, - "dev": true, - "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - }, - "graceful-fs": { - "version": "4.1.11", - "bundled": true, - "dev": true - }, - "handlebars": { - "version": "4.0.11", - "bundled": true, - "dev": true, - "requires": { - "async": "^1.4.0", - "optimist": "^0.6.1", - "source-map": "^0.4.4", - "uglify-js": "^2.6" - }, - "dependencies": { - "source-map": { - "version": "0.4.4", - "bundled": true, - "dev": true, - "requires": { - "amdefine": ">=0.0.4" - } - } - } - }, - "has-flag": { - "version": "3.0.0", - "bundled": true, - "dev": true - }, - "hosted-git-info": { - "version": "2.7.1", - "bundled": true, - "dev": true - }, - "imurmurhash": { - "version": "0.1.4", - "bundled": true, - "dev": true - }, - "inflight": { - "version": "1.0.6", - "bundled": true, - "dev": true, - "requires": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "inherits": { - "version": "2.0.3", - "bundled": true, - "dev": true - }, - "invert-kv": { - "version": "1.0.0", - "bundled": true, - "dev": true - }, - "is-arrayish": { - "version": "0.2.1", - "bundled": true, - "dev": true - }, - "is-buffer": { - "version": "1.1.6", - "bundled": true, - "dev": true - }, - "is-builtin-module": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "requires": { - "builtin-modules": "^1.0.0" - } - }, - "is-fullwidth-code-point": { - "version": "2.0.0", - "bundled": true, - "dev": true - }, - "is-stream": { - "version": "1.1.0", - "bundled": true, - "dev": true - }, - "isexe": { - "version": "2.0.0", - "bundled": true, - "dev": true - }, - "istanbul-lib-coverage": { - "version": "2.0.1", - "bundled": true, - "dev": true - }, - "istanbul-lib-hook": { - "version": "2.0.1", - "bundled": true, - "dev": true, - "requires": { - "append-transform": "^1.0.0" - } - }, - "istanbul-lib-report": { - "version": "2.0.2", - "bundled": true, - "dev": true, - "requires": { - "istanbul-lib-coverage": "^2.0.1", - "make-dir": "^1.3.0", - "supports-color": "^5.4.0" - } - }, - "istanbul-lib-source-maps": { - "version": "2.0.1", - "bundled": true, - "dev": true, - "requires": { - "debug": "^3.1.0", - "istanbul-lib-coverage": "^2.0.1", - "make-dir": "^1.3.0", - "rimraf": "^2.6.2", - "source-map": "^0.6.1" - }, - "dependencies": { - "source-map": { - "version": "0.6.1", - "bundled": true, - "dev": true - } - } - }, - "istanbul-reports": { - "version": "2.0.1", - "bundled": true, - "dev": true, - "requires": { - "handlebars": "^4.0.11" - } - }, - "json-parse-better-errors": { - "version": "1.0.2", - "bundled": true, - "dev": true - }, - "kind-of": { - "version": "3.2.2", - "bundled": true, - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - }, - "lazy-cache": { - "version": "1.0.4", - "bundled": true, - "dev": true, - "optional": true - }, - "lcid": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "requires": { - "invert-kv": "^1.0.0" - } - }, - "load-json-file": { - "version": "4.0.0", - "bundled": true, - "dev": true, - "requires": { - "graceful-fs": "^4.1.2", - "parse-json": "^4.0.0", - "pify": "^3.0.0", - "strip-bom": "^3.0.0" - } - }, - "locate-path": { - "version": "3.0.0", - "bundled": true, - "dev": true, - "requires": { - "p-locate": "^3.0.0", - "path-exists": "^3.0.0" - } - }, - "lodash.flattendeep": { - "version": "4.4.0", - "bundled": true, - "dev": true - }, - "longest": { - "version": "1.0.1", - "bundled": true, - "dev": true - }, - "lru-cache": { - "version": "4.1.3", - "bundled": true, - "dev": true, - "requires": { - "pseudomap": "^1.0.2", - "yallist": "^2.1.2" - } - }, - "make-dir": { - "version": "1.3.0", - "bundled": true, - "dev": true, - "requires": { - "pify": "^3.0.0" - } - }, - "md5-hex": { - "version": "2.0.0", - "bundled": true, - "dev": true, - "requires": { - "md5-o-matic": "^0.1.1" - } - }, - "md5-o-matic": { - "version": "0.1.1", - "bundled": true, - "dev": true - }, - "mem": { - "version": "1.1.0", - "bundled": true, - "dev": true, - "requires": { - "mimic-fn": "^1.0.0" - } - }, - "merge-source-map": { - "version": "1.1.0", - "bundled": true, - "dev": true, - "requires": { - "source-map": "^0.6.1" - }, - "dependencies": { - "source-map": { - "version": "0.6.1", - "bundled": true, - "dev": true - } - } - }, - "mimic-fn": { - "version": "1.2.0", - "bundled": true, - "dev": true - }, - "minimatch": { - "version": "3.0.4", - "bundled": true, - "dev": true, - "requires": { - "brace-expansion": "^1.1.7" - } - }, - "minimist": { - "version": "0.0.10", - "bundled": true, - "dev": true - }, - "mkdirp": { - "version": "0.5.1", - "bundled": true, - "dev": true, - "requires": { - "minimist": "0.0.8" - }, - "dependencies": { - "minimist": { - "version": "0.0.8", - "bundled": true, - "dev": true - } - } - }, - "ms": { - "version": "2.0.0", - "bundled": true, - "dev": true - }, - "normalize-package-data": { - "version": "2.4.0", - "bundled": true, - "dev": true, - "requires": { - "hosted-git-info": "^2.1.4", - "is-builtin-module": "^1.0.0", - "semver": "2 || 3 || 4 || 5", - "validate-npm-package-license": "^3.0.1" - } - }, - "npm-run-path": { - "version": "2.0.2", - "bundled": true, - "dev": true, - "requires": { - "path-key": "^2.0.0" - } - }, - "number-is-nan": { - "version": "1.0.1", - "bundled": true, - "dev": true - }, - "once": { - "version": "1.4.0", - "bundled": true, - "dev": true, - "requires": { - "wrappy": "1" - } - }, - "optimist": { - "version": "0.6.1", - "bundled": true, - "dev": true, - "requires": { - "minimist": "~0.0.1", - "wordwrap": "~0.0.2" - } - }, - "os-homedir": { - "version": "1.0.2", - "bundled": true, - "dev": true - }, - "os-locale": { - "version": "2.1.0", - "bundled": true, - "dev": true, - "requires": { - "execa": "^0.7.0", - "lcid": "^1.0.0", - "mem": "^1.1.0" - } - }, - "p-finally": { - "version": "1.0.0", - "bundled": true, - "dev": true - }, - "p-limit": { - "version": "2.0.0", - "bundled": true, - "dev": true, - "requires": { - "p-try": "^2.0.0" - } - }, - "p-locate": { - "version": "3.0.0", - "bundled": true, - "dev": true, - "requires": { - "p-limit": "^2.0.0" - } - }, - "p-try": { - "version": "2.0.0", - "bundled": true, - "dev": true - }, - "package-hash": { - "version": "2.0.0", - "bundled": true, - "dev": true, - "requires": { - "graceful-fs": "^4.1.11", - "lodash.flattendeep": "^4.4.0", - "md5-hex": "^2.0.0", - "release-zalgo": "^1.0.0" - } - }, - "parse-json": { - "version": "4.0.0", - "bundled": true, - "dev": true, - "requires": { - "error-ex": "^1.3.1", - "json-parse-better-errors": "^1.0.1" - } - }, - "path-exists": { - "version": "3.0.0", - "bundled": true, - "dev": true - }, - "path-is-absolute": { - "version": "1.0.1", - "bundled": true, - "dev": true - }, - "path-key": { - "version": "2.0.1", - "bundled": true, - "dev": true - }, - "path-type": { - "version": "3.0.0", - "bundled": true, - "dev": true, - "requires": { - "pify": "^3.0.0" - } - }, - "pify": { - "version": "3.0.0", - "bundled": true, - "dev": true - }, - "pkg-dir": { - "version": "3.0.0", - "bundled": true, - "dev": true, - "requires": { - "find-up": "^3.0.0" - } - }, - "pseudomap": { - "version": "1.0.2", - "bundled": true, - "dev": true - }, - "read-pkg": { - "version": "3.0.0", - "bundled": true, - "dev": true, - "requires": { - "load-json-file": "^4.0.0", - "normalize-package-data": "^2.3.2", - "path-type": "^3.0.0" - } - }, - "read-pkg-up": { - "version": "4.0.0", - "bundled": true, - "dev": true, - "requires": { - "find-up": "^3.0.0", - "read-pkg": "^3.0.0" - } - }, - "release-zalgo": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "requires": { - "es6-error": "^4.0.1" - } - }, - "repeat-string": { - "version": "1.6.1", - "bundled": true, - "dev": true - }, - "require-directory": { - "version": "2.1.1", - "bundled": true, - "dev": true - }, - "require-main-filename": { - "version": "1.0.1", - "bundled": true, - "dev": true - }, - "resolve-from": { - "version": "4.0.0", - "bundled": true, - "dev": true - }, - "right-align": { - "version": "0.1.3", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "align-text": "^0.1.1" - } - }, - "rimraf": { - "version": "2.6.2", - "bundled": true, - "dev": true, - "requires": { - "glob": "^7.0.5" - } - }, - "safe-buffer": { - "version": "5.1.2", - "bundled": true, - "dev": true - }, - "semver": { - "version": "5.5.0", - "bundled": true, - "dev": true - }, - "set-blocking": { - "version": "2.0.0", - "bundled": true, - "dev": true - }, - "shebang-command": { - "version": "1.2.0", - "bundled": true, - "dev": true, - "requires": { - "shebang-regex": "^1.0.0" - } - }, - "shebang-regex": { - "version": "1.0.0", - "bundled": true, - "dev": true - }, - "signal-exit": { - "version": "3.0.2", - "bundled": true, - "dev": true - }, - "source-map": { - "version": "0.5.7", - "bundled": true, - "dev": true, - "optional": true - }, - "spawn-wrap": { - "version": "1.4.2", - "bundled": true, - "dev": true, - "requires": { - "foreground-child": "^1.5.6", - "mkdirp": "^0.5.0", - "os-homedir": "^1.0.1", - "rimraf": "^2.6.2", - "signal-exit": "^3.0.2", - "which": "^1.3.0" - } - }, - "spdx-correct": { - "version": "3.0.0", - "bundled": true, - "dev": true, - "requires": { - "spdx-expression-parse": "^3.0.0", - "spdx-license-ids": "^3.0.0" - } - }, - "spdx-exceptions": { - "version": "2.1.0", - "bundled": true, - "dev": true - }, - "spdx-expression-parse": { - "version": "3.0.0", - "bundled": true, - "dev": true, - "requires": { - "spdx-exceptions": "^2.1.0", - "spdx-license-ids": "^3.0.0" - } - }, - "spdx-license-ids": { - "version": "3.0.0", - "bundled": true, - "dev": true - }, - "string-width": { - "version": "2.1.1", - "bundled": true, - "dev": true, - "requires": { - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^4.0.0" - } - }, - "strip-ansi": { - "version": "4.0.0", - "bundled": true, - "dev": true, - "requires": { - "ansi-regex": "^3.0.0" - } - }, - "strip-bom": { - "version": "3.0.0", - "bundled": true, - "dev": true - }, - "strip-eof": { - "version": "1.0.0", - "bundled": true, - "dev": true - }, - "supports-color": { - "version": "5.4.0", - "bundled": true, - "dev": true, - "requires": { - "has-flag": "^3.0.0" - } - }, - "test-exclude": { - "version": "5.0.0", - "bundled": true, - "dev": true, - "requires": { - "arrify": "^1.0.1", - "minimatch": "^3.0.4", - "read-pkg-up": "^4.0.0", - "require-main-filename": "^1.0.1" - } - }, - "uglify-js": { - "version": "2.8.29", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "source-map": "~0.5.1", - "uglify-to-browserify": "~1.0.0", - "yargs": "~3.10.0" - }, - "dependencies": { - "yargs": { - "version": "3.10.0", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "camelcase": "^1.0.2", - "cliui": "^2.1.0", - "decamelize": "^1.0.0", - "window-size": "0.1.0" - } - } - } - }, - "uglify-to-browserify": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "optional": true - }, - "uuid": { - "version": "3.3.2", - "bundled": true, - "dev": true - }, - "validate-npm-package-license": { - "version": "3.0.3", - "bundled": true, - "dev": true, - "requires": { - "spdx-correct": "^3.0.0", - "spdx-expression-parse": "^3.0.0" - } - }, - "which": { - "version": "1.3.1", - "bundled": true, - "dev": true, - "requires": { - "isexe": "^2.0.0" - } - }, - "which-module": { - "version": "2.0.0", - "bundled": true, - "dev": true - }, - "window-size": { - "version": "0.1.0", - "bundled": true, - "dev": true, - "optional": true - }, - "wordwrap": { - "version": "0.0.3", - "bundled": true, - "dev": true - }, - "wrap-ansi": { - "version": "2.1.0", - "bundled": true, - "dev": true, - "requires": { - "string-width": "^1.0.1", - "strip-ansi": "^3.0.1" - }, - "dependencies": { - "ansi-regex": { - "version": "2.1.1", - "bundled": true, - "dev": true - }, - "is-fullwidth-code-point": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "requires": { - "number-is-nan": "^1.0.0" - } - }, - "string-width": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "requires": { - "code-point-at": "^1.0.0", - "is-fullwidth-code-point": "^1.0.0", - "strip-ansi": "^3.0.0" - } - }, - "strip-ansi": { - "version": "3.0.1", - "bundled": true, - "dev": true, - "requires": { - "ansi-regex": "^2.0.0" - } - } - } - }, - "wrappy": { - "version": "1.0.2", - "bundled": true, - "dev": true - }, - "write-file-atomic": { - "version": "2.3.0", - "bundled": true, - "dev": true, - "requires": { - "graceful-fs": "^4.1.11", - "imurmurhash": "^0.1.4", - "signal-exit": "^3.0.2" - } - }, - "y18n": { - "version": "3.2.1", - "bundled": true, - "dev": true - }, - "yallist": { - "version": "2.1.2", - "bundled": true, - "dev": true - }, - "yargs": { - "version": "11.1.0", - "bundled": true, - "dev": true, - "requires": { - "cliui": "^4.0.0", - "decamelize": "^1.1.1", - "find-up": "^2.1.0", - "get-caller-file": "^1.0.1", - "os-locale": "^2.0.0", - "require-directory": "^2.1.1", - "require-main-filename": "^1.0.1", - "set-blocking": "^2.0.0", - "string-width": "^2.0.0", - "which-module": "^2.0.0", - "y18n": "^3.2.1", - "yargs-parser": "^9.0.2" - }, - "dependencies": { - "cliui": { - "version": "4.1.0", - "bundled": true, - "dev": true, - "requires": { - "string-width": "^2.1.1", - "strip-ansi": "^4.0.0", - "wrap-ansi": "^2.0.0" - } - }, - "find-up": { - "version": "2.1.0", - "bundled": true, - "dev": true, - "requires": { - "locate-path": "^2.0.0" - } - }, - "locate-path": { - "version": "2.0.0", - "bundled": true, - "dev": true, - "requires": { - "p-locate": "^2.0.0", - "path-exists": "^3.0.0" - } - }, - "p-limit": { - "version": "1.3.0", - "bundled": true, - "dev": true, - "requires": { - "p-try": "^1.0.0" - } - }, - "p-locate": { - "version": "2.0.0", - "bundled": true, - "dev": true, - "requires": { - "p-limit": "^1.1.0" - } - }, - "p-try": { - "version": "1.0.0", - "bundled": true, - "dev": true - } - } - }, - "yargs-parser": { - "version": "9.0.2", - "bundled": true, - "dev": true, - "requires": { - "camelcase": "^4.1.0" - }, - "dependencies": { - "camelcase": { - "version": "4.1.0", - "bundled": true, - "dev": true - } - } - } - } - }, - "oauth-sign": { - "version": "0.9.0", - "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", - "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==", - "dev": true - }, - "object-assign": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", - "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", - "dev": true - }, - "object-copy": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/object-copy/-/object-copy-0.1.0.tgz", - "integrity": "sha1-fn2Fi3gb18mRpBupde04EnVOmYw=", - "requires": { - "copy-descriptor": "^0.1.0", - "define-property": "^0.2.5", - "kind-of": "^3.0.3" - }, - "dependencies": { - "define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", - "requires": { - "is-descriptor": "^0.1.0" - } - }, - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "object-keys": { - "version": "1.0.12", - "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.0.12.tgz", - "integrity": "sha512-FTMyFUm2wBcGHnH2eXmz7tC6IwlqQZ6mVZ+6dm6vZ4IQIHjs6FdNsQBuKGPuUUUY6NfJw2PshC08Tn6LzLDOag==" - }, - "object-visit": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/object-visit/-/object-visit-1.0.1.tgz", - "integrity": "sha1-95xEk68MU3e1n+OdOV5BBC3QRbs=", - "requires": { - "isobject": "^3.0.0" - } - }, - "object.omit": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/object.omit/-/object.omit-2.0.1.tgz", - "integrity": "sha1-Gpx0SCnznbuFjHbKNXmuKlTr0fo=", - "dev": true, - "requires": { - "for-own": "^0.1.4", - "is-extendable": "^0.1.1" - } - }, - "object.pick": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/object.pick/-/object.pick-1.3.0.tgz", - "integrity": "sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c=", - "requires": { - "isobject": "^3.0.1" - } - }, - "observable-to-promise": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/observable-to-promise/-/observable-to-promise-0.5.0.tgz", - "integrity": "sha1-yCjw8NxH6fhq+KSXfF1VB2znqR8=", - "dev": true, - "requires": { - "is-observable": "^0.2.0", - "symbol-observable": "^1.0.4" - }, - "dependencies": { - "is-observable": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/is-observable/-/is-observable-0.2.0.tgz", - "integrity": "sha1-s2ExHYPG5dcmyr9eJQsCNxBvWuI=", - "dev": true, - "requires": { - "symbol-observable": "^0.2.2" - }, - "dependencies": { - "symbol-observable": { - "version": "0.2.4", - "resolved": "https://registry.npmjs.org/symbol-observable/-/symbol-observable-0.2.4.tgz", - "integrity": "sha1-lag9smGG1q9+ehjb2XYKL4bQj0A=", - "dev": true - } - } - } - } - }, - "once": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", - "requires": { - "wrappy": "1" - } - }, - "onetime": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/onetime/-/onetime-2.0.1.tgz", - "integrity": "sha1-BnQoIw/WdEOyeUsiu6UotoZ5YtQ=", - "dev": true, - "requires": { - "mimic-fn": "^1.0.0" - } - }, - "optimist": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/optimist/-/optimist-0.6.1.tgz", - "integrity": "sha1-2j6nRob6IaGaERwybpDrFaAZZoY=", - "dev": true, - "requires": { - "minimist": "~0.0.1", - "wordwrap": "~0.0.2" - } - }, - "option-chain": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/option-chain/-/option-chain-1.0.0.tgz", - "integrity": "sha1-k41zvU4Xg/lI00AjZEraI2aeMPI=", - "dev": true - }, - "optionator": { - "version": "0.8.2", - "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.2.tgz", - "integrity": "sha1-NkxeQJ0/TWMB1sC0wFu6UBgK62Q=", - "dev": true, - "requires": { - "deep-is": "~0.1.3", - "fast-levenshtein": "~2.0.4", - "levn": "~0.3.0", - "prelude-ls": "~1.1.2", - "type-check": "~0.3.2", - "wordwrap": "~1.0.0" - }, - "dependencies": { - "wordwrap": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", - "integrity": "sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus=", - "dev": true - } - } - }, - "optjs": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/optjs/-/optjs-3.2.2.tgz", - "integrity": "sha1-aabOicRCpEQDFBrS+bNwvVu29O4=" - }, - "os-homedir": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", - "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=", - "dev": true - }, - "os-locale": { - "version": "1.4.0", - "resolved": "http://registry.npmjs.org/os-locale/-/os-locale-1.4.0.tgz", - "integrity": "sha1-IPnxeuKe00XoveWDsT0gCYA8FNk=", - "requires": { - "lcid": "^1.0.0" - } - }, - "os-tmpdir": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", - "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", - "dev": true - }, - "p-cancelable": { - "version": "0.4.1", - "resolved": "http://registry.npmjs.org/p-cancelable/-/p-cancelable-0.4.1.tgz", - "integrity": "sha512-HNa1A8LvB1kie7cERyy21VNeHb2CWJJYqyyC2o3klWFfMGlFmWv2Z7sFgZH8ZiaYL95ydToKTFVXgMV/Os0bBQ==", - "dev": true - }, - "p-defer": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/p-defer/-/p-defer-1.0.0.tgz", - "integrity": "sha1-n26xgvbJqozXQwBKfU+WsZaw+ww=", - "dev": true - }, - "p-finally": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", - "integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=", - "dev": true - }, - "p-is-promise": { - "version": "1.1.0", - "resolved": "http://registry.npmjs.org/p-is-promise/-/p-is-promise-1.1.0.tgz", - "integrity": "sha1-nJRWmJ6fZYgBewQ01WCXZ1w9oF4=", - "dev": true - }, - "p-limit": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", - "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", - "dev": true, - "requires": { - "p-try": "^1.0.0" - } - }, - "p-locate": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", - "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", - "dev": true, - "requires": { - "p-limit": "^1.1.0" - } - }, - "p-timeout": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/p-timeout/-/p-timeout-2.0.1.tgz", - "integrity": "sha512-88em58dDVB/KzPEx1X0N3LwFfYZPyDc4B6eF38M1rk9VTZMbxXXgjugz8mmwpS9Ox4BDZ+t6t3QP5+/gazweIA==", - "dev": true, - "requires": { - "p-finally": "^1.0.0" - } - }, - "p-try": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", - "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=", - "dev": true - }, - "package-hash": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/package-hash/-/package-hash-2.0.0.tgz", - "integrity": "sha1-eK4ybIngWk2BO2hgGXevBcANKg0=", - "dev": true, - "requires": { - "graceful-fs": "^4.1.11", - "lodash.flattendeep": "^4.4.0", - "md5-hex": "^2.0.0", - "release-zalgo": "^1.0.0" - } - }, - "package-json": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/package-json/-/package-json-4.0.1.tgz", - "integrity": "sha1-iGmgQBJTZhxMTKPabCEh7VVfXu0=", - "dev": true, - "requires": { - "got": "^6.7.1", - "registry-auth-token": "^3.0.1", - "registry-url": "^3.0.3", - "semver": "^5.1.0" - }, - "dependencies": { - "got": { - "version": "6.7.1", - "resolved": "http://registry.npmjs.org/got/-/got-6.7.1.tgz", - "integrity": "sha1-JAzQV4WpoY5WHcG0S0HHY+8ejbA=", - "dev": true, - "requires": { - "create-error-class": "^3.0.0", - "duplexer3": "^0.1.4", - "get-stream": "^3.0.0", - "is-redirect": "^1.0.0", - "is-retry-allowed": "^1.0.0", - "is-stream": "^1.0.0", - "lowercase-keys": "^1.0.0", - "safe-buffer": "^5.0.1", - "timed-out": "^4.0.0", - "unzip-response": "^2.0.1", - "url-parse-lax": "^1.0.0" - } - } - } - }, - "parse-glob": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/parse-glob/-/parse-glob-3.0.4.tgz", - "integrity": "sha1-ssN2z7EfNVE7rdFz7wu246OIORw=", - "dev": true, - "requires": { - "glob-base": "^0.3.0", - "is-dotfile": "^1.0.0", - "is-extglob": "^1.0.0", - "is-glob": "^2.0.0" - }, - "dependencies": { - "is-extglob": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz", - "integrity": "sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA=", - "dev": true - }, - "is-glob": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz", - "integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=", - "dev": true, - "requires": { - "is-extglob": "^1.0.0" - } - } - } - }, - "parse-json": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", - "integrity": "sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=", - "dev": true, - "requires": { - "error-ex": "^1.2.0" - } - }, - "parse-ms": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/parse-ms/-/parse-ms-0.1.2.tgz", - "integrity": "sha1-3T+iXtbC78e93hKtm0bBY6opIk4=", - "dev": true - }, - "pascalcase": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/pascalcase/-/pascalcase-0.1.1.tgz", - "integrity": "sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ=" - }, - "path-dirname": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/path-dirname/-/path-dirname-1.0.2.tgz", - "integrity": "sha1-zDPSTVJeCZpTiMAzbG4yuRYGCeA=" - }, - "path-exists": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", - "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", - "dev": true - }, - "path-is-absolute": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=" - }, - "path-is-inside": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/path-is-inside/-/path-is-inside-1.0.2.tgz", - "integrity": "sha1-NlQX3t5EQw0cEa9hAn+s8HS9/FM=", - "dev": true - }, - "path-key": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", - "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", - "dev": true - }, - "path-parse": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", - "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", - "dev": true - }, - "path-to-regexp": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-1.7.0.tgz", - "integrity": "sha1-Wf3g9DW62suhA6hOnTvGTpa5k30=", - "dev": true, - "requires": { - "isarray": "0.0.1" - }, - "dependencies": { - "isarray": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", - "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", - "dev": true - } - } - }, - "path-type": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-3.0.0.tgz", - "integrity": "sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg==", - "requires": { - "pify": "^3.0.0" - } - }, - "performance-now": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", - "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=", - "dev": true - }, - "pify": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", - "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=" - }, - "pinkie": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-1.0.0.tgz", - "integrity": "sha1-Wkfyi6EBXQIBvae/DzWOR77Ix+Q=", - "dev": true - }, - "pinkie-promise": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-1.0.0.tgz", - "integrity": "sha1-0dpn9UglY7t89X8oauKCLs+/NnA=", - "dev": true, - "requires": { - "pinkie": "^1.0.0" - } - }, - "pkg-conf": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/pkg-conf/-/pkg-conf-2.1.0.tgz", - "integrity": "sha1-ISZRTKbyq/69FoWW3xi6V4Z/AFg=", - "dev": true, - "requires": { - "find-up": "^2.0.0", - "load-json-file": "^4.0.0" - }, - "dependencies": { - "load-json-file": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-4.0.0.tgz", - "integrity": "sha1-L19Fq5HjMhYjT9U62rZo607AmTs=", - "dev": true, - "requires": { - "graceful-fs": "^4.1.2", - "parse-json": "^4.0.0", - "pify": "^3.0.0", - "strip-bom": "^3.0.0" - } - }, - "parse-json": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz", - "integrity": "sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA=", - "dev": true, - "requires": { - "error-ex": "^1.3.1", - "json-parse-better-errors": "^1.0.1" - } - } - } - }, - "pkg-dir": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-2.0.0.tgz", - "integrity": "sha1-9tXREJ4Z1j7fQo4L1X4Sd3YVM0s=", - "dev": true, - "requires": { - "find-up": "^2.1.0" - } - }, - "plur": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/plur/-/plur-2.1.2.tgz", - "integrity": "sha1-dIJFLBoPUI4+NE6uwxLJHCncZVo=", - "dev": true, - "requires": { - "irregular-plurals": "^1.0.0" - } - }, - "pluralize": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/pluralize/-/pluralize-7.0.0.tgz", - "integrity": "sha512-ARhBOdzS3e41FbkW/XWrTEtukqqLoK5+Z/4UeDaLuSW+39JPeFgs4gCGqsrJHVZX0fUrx//4OF0K1CUGwlIFow==", - "dev": true - }, - "posix-character-classes": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/posix-character-classes/-/posix-character-classes-0.1.1.tgz", - "integrity": "sha1-AerA/jta9xoqbAL+q7jB/vfgDqs=" - }, - "postcss": { - "version": "6.0.23", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.23.tgz", - "integrity": "sha512-soOk1h6J3VMTZtVeVpv15/Hpdl2cBLX3CAw4TAbkpTJiNPk9YP/zWcD1ND+xEtvyuuvKzbxliTOIyvkSeSJ6ag==", - "dev": true, - "requires": { - "chalk": "^2.4.1", - "source-map": "^0.6.1", - "supports-color": "^5.4.0" - }, - "dependencies": { - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true - } - } - }, - "power-assert": { - "version": "1.6.1", - "resolved": "https://registry.npmjs.org/power-assert/-/power-assert-1.6.1.tgz", - "integrity": "sha512-VWkkZV6Y+W8qLX/PtJu2Ur2jDPIs0a5vbP0TpKeybNcIXmT4vcKoVkyTp5lnQvTpY/DxacAZ4RZisHRHLJcAZQ==", - "requires": { - "define-properties": "^1.1.2", - "empower": "^1.3.1", - "power-assert-formatter": "^1.4.1", - "universal-deep-strict-equal": "^1.2.1", - "xtend": "^4.0.0" - } - }, - "power-assert-context-formatter": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/power-assert-context-formatter/-/power-assert-context-formatter-1.2.0.tgz", - "integrity": "sha512-HLNEW8Bin+BFCpk/zbyKwkEu9W8/zThIStxGo7weYcFkKgMuGCHUJhvJeBGXDZf0Qm2xis4pbnnciGZiX0EpSg==", - "requires": { - "core-js": "^2.0.0", - "power-assert-context-traversal": "^1.2.0" - } - }, - "power-assert-context-reducer-ast": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/power-assert-context-reducer-ast/-/power-assert-context-reducer-ast-1.2.0.tgz", - "integrity": "sha512-EgOxmZ/Lb7tw4EwSKX7ZnfC0P/qRZFEG28dx/690qvhmOJ6hgThYFm5TUWANDLK5NiNKlPBi5WekVGd2+5wPrw==", - "requires": { - "acorn": "^5.0.0", - "acorn-es7-plugin": "^1.0.12", - "core-js": "^2.0.0", - "espurify": "^1.6.0", - "estraverse": "^4.2.0" - } - }, - "power-assert-context-traversal": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/power-assert-context-traversal/-/power-assert-context-traversal-1.2.0.tgz", - "integrity": "sha512-NFoHU6g2umNajiP2l4qb0BRWD773Aw9uWdWYH9EQsVwIZnog5bd2YYLFCVvaxWpwNzWeEfZIon2xtyc63026pQ==", - "requires": { - "core-js": "^2.0.0", - "estraverse": "^4.1.0" - } - }, - "power-assert-formatter": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/power-assert-formatter/-/power-assert-formatter-1.4.1.tgz", - "integrity": "sha1-XcEl7VCj37HdomwZNH879Y7CiEo=", - "requires": { - "core-js": "^2.0.0", - "power-assert-context-formatter": "^1.0.7", - "power-assert-context-reducer-ast": "^1.0.7", - "power-assert-renderer-assertion": "^1.0.7", - "power-assert-renderer-comparison": "^1.0.7", - "power-assert-renderer-diagram": "^1.0.7", - "power-assert-renderer-file": "^1.0.7" - } - }, - "power-assert-renderer-assertion": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/power-assert-renderer-assertion/-/power-assert-renderer-assertion-1.2.0.tgz", - "integrity": "sha512-3F7Q1ZLmV2ZCQv7aV7NJLNK9G7QsostrhOU7U0RhEQS/0vhEqrRg2jEJl1jtUL4ZyL2dXUlaaqrmPv5r9kRvIg==", - "requires": { - "power-assert-renderer-base": "^1.1.1", - "power-assert-util-string-width": "^1.2.0" - } - }, - "power-assert-renderer-base": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/power-assert-renderer-base/-/power-assert-renderer-base-1.1.1.tgz", - "integrity": "sha1-lqZQxv0F7hvB9mtUrWFELIs/Y+s=" - }, - "power-assert-renderer-comparison": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/power-assert-renderer-comparison/-/power-assert-renderer-comparison-1.2.0.tgz", - "integrity": "sha512-7c3RKPDBKK4E3JqdPtYRE9cM8AyX4LC4yfTvvTYyx8zSqmT5kJnXwzR0yWQLOavACllZfwrAGQzFiXPc5sWa+g==", - "requires": { - "core-js": "^2.0.0", - "diff-match-patch": "^1.0.0", - "power-assert-renderer-base": "^1.1.1", - "stringifier": "^1.3.0", - "type-name": "^2.0.1" - } - }, - "power-assert-renderer-diagram": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/power-assert-renderer-diagram/-/power-assert-renderer-diagram-1.2.0.tgz", - "integrity": "sha512-JZ6PC+DJPQqfU6dwSmpcoD7gNnb/5U77bU5KgNwPPa+i1Pxiz6UuDeM3EUBlhZ1HvH9tMjI60anqVyi5l2oNdg==", - "requires": { - "core-js": "^2.0.0", - "power-assert-renderer-base": "^1.1.1", - "power-assert-util-string-width": "^1.2.0", - "stringifier": "^1.3.0" - } - }, - "power-assert-renderer-file": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/power-assert-renderer-file/-/power-assert-renderer-file-1.2.0.tgz", - "integrity": "sha512-/oaVrRbeOtGoyyd7e4IdLP/jIIUFJdqJtsYzP9/88R39CMnfF/S/rUc8ZQalENfUfQ/wQHu+XZYRMaCEZmEesg==", - "requires": { - "power-assert-renderer-base": "^1.1.1" - } - }, - "power-assert-util-string-width": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/power-assert-util-string-width/-/power-assert-util-string-width-1.2.0.tgz", - "integrity": "sha512-lX90G0igAW0iyORTILZ/QjZWsa1MZ6VVY3L0K86e2eKun3S4LKPH4xZIl8fdeMYLfOjkaszbNSzf1uugLeAm2A==", - "requires": { - "eastasianwidth": "^0.2.0" - } - }, - "prelude-ls": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", - "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=", - "dev": true - }, - "prepend-http": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/prepend-http/-/prepend-http-1.0.4.tgz", - "integrity": "sha1-1PRWKwzjaW5BrFLQ4ALlemNdxtw=", - "dev": true - }, - "preserve": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/preserve/-/preserve-0.2.0.tgz", - "integrity": "sha1-gV7R9uvGWSb4ZbMQwHE7yzMVzks=", - "dev": true - }, - "prettier": { - "version": "1.14.3", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-1.14.3.tgz", - "integrity": "sha512-qZDVnCrnpsRJJq5nSsiHCE3BYMED2OtsI+cmzIzF1QIfqm5ALf8tEJcO27zV1gKNKRPdhjO0dNWnrzssDQ1tFg==", - "dev": true - }, - "prettier-linter-helpers": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/prettier-linter-helpers/-/prettier-linter-helpers-1.0.0.tgz", - "integrity": "sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w==", - "dev": true, - "requires": { - "fast-diff": "^1.1.2" - } - }, - "pretty-ms": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/pretty-ms/-/pretty-ms-3.2.0.tgz", - "integrity": "sha512-ZypexbfVUGTFxb0v+m1bUyy92DHe5SyYlnyY0msyms5zd3RwyvNgyxZZsXXgoyzlxjx5MiqtXUdhUfvQbe0A2Q==", - "dev": true, - "requires": { - "parse-ms": "^1.0.0" - }, - "dependencies": { - "parse-ms": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/parse-ms/-/parse-ms-1.0.1.tgz", - "integrity": "sha1-VjRtR0nXjyNDDKDHE4UK75GqNh0=", - "dev": true - } - } - }, - "private": { - "version": "0.1.8", - "resolved": "https://registry.npmjs.org/private/-/private-0.1.8.tgz", - "integrity": "sha512-VvivMrbvd2nKkiG38qjULzlc+4Vx4wm/whI9pQD35YrARNnhxeiRktSOhSukRLFNlzg6Br/cJPet5J/u19r/mg==", - "dev": true - }, - "process-nextick-args": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.0.tgz", - "integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==" - }, - "progress": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.1.tgz", - "integrity": "sha512-OE+a6vzqazc+K6LxJrX5UPyKFvGnL5CYmq2jFGNIBWHpc4QyE49/YOumcrpQFJpfejmvRtbJzgO1zPmMCqlbBg==", - "dev": true - }, - "protobufjs": { - "version": "6.8.8", - "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-6.8.8.tgz", - "integrity": "sha512-AAmHtD5pXgZfi7GMpllpO3q1Xw1OYldr+dMUlAnffGTAhqkg72WdmSY71uKBF/JuyiKs8psYbtKrhi0ASCD8qw==", - "requires": { - "@protobufjs/aspromise": "^1.1.2", - "@protobufjs/base64": "^1.1.2", - "@protobufjs/codegen": "^2.0.4", - "@protobufjs/eventemitter": "^1.1.0", - "@protobufjs/fetch": "^1.1.0", - "@protobufjs/float": "^1.0.2", - "@protobufjs/inquire": "^1.1.0", - "@protobufjs/path": "^1.1.2", - "@protobufjs/pool": "^1.1.0", - "@protobufjs/utf8": "^1.1.0", - "@types/long": "^4.0.0", - "@types/node": "^10.1.0", - "long": "^4.0.0" - }, - "dependencies": { - "@types/node": { - "version": "10.12.2", - "resolved": "https://registry.npmjs.org/@types/node/-/node-10.12.2.tgz", - "integrity": "sha512-53ElVDSnZeFUUFIYzI8WLQ25IhWzb6vbddNp8UHlXQyU0ET2RhV5zg0NfubzU7iNMh5bBXb0htCzfvrSVNgzaQ==" - } - } - }, - "proxyquire": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/proxyquire/-/proxyquire-2.1.0.tgz", - "integrity": "sha512-kptdFArCfGRtQFv3Qwjr10lwbEV0TBJYvfqzhwucyfEXqVgmnAkyEw/S3FYzR5HI9i5QOq4rcqQjZ6AlknlCDQ==", - "dev": true, - "requires": { - "fill-keys": "^1.0.2", - "module-not-found-error": "^1.0.0", - "resolve": "~1.8.1" - } - }, - "pseudomap": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", - "integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM=" - }, - "psl": { - "version": "1.1.29", - "resolved": "https://registry.npmjs.org/psl/-/psl-1.1.29.tgz", - "integrity": "sha512-AeUmQ0oLN02flVHXWh9sSJF7mcdFq0ppid/JkErufc3hGIV/AMa8Fo9VgDo/cT2jFdOWoFvHp90qqBH54W+gjQ==", - "dev": true - }, - "punycode": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", - "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=", - "dev": true - }, - "qs": { - "version": "6.5.2", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz", - "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==", - "dev": true - }, - "query-string": { - "version": "5.1.1", - "resolved": "http://registry.npmjs.org/query-string/-/query-string-5.1.1.tgz", - "integrity": "sha512-gjWOsm2SoGlgLEdAGt7a6slVOk9mGiXmPFMqrEhLQ68rhQuBnpfs3+EmlvqKyxnCo9/PPlF+9MtY02S1aFg+Jw==", - "dev": true, - "requires": { - "decode-uri-component": "^0.2.0", - "object-assign": "^4.1.0", - "strict-uri-encode": "^1.0.0" - } - }, - "randomatic": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/randomatic/-/randomatic-3.1.1.tgz", - "integrity": "sha512-TuDE5KxZ0J461RVjrJZCJc+J+zCkTb1MbH9AQUq68sMhOMcy9jLcb3BrZKgp9q9Ncltdg4QVqWrH02W2EFFVYw==", - "dev": true, - "requires": { - "is-number": "^4.0.0", - "kind-of": "^6.0.0", - "math-random": "^1.0.1" - }, - "dependencies": { - "is-number": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-4.0.0.tgz", - "integrity": "sha512-rSklcAIlf1OmFdyAqbnWTLVelsQ58uvZ66S/ZyawjWqIviTWCjg2PzVGw8WUA+nNuPTqb4wgA+NszrJ+08LlgQ==", - "dev": true - } - } - }, - "rc": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", - "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==", - "dev": true, - "requires": { - "deep-extend": "^0.6.0", - "ini": "~1.3.0", - "minimist": "^1.2.0", - "strip-json-comments": "~2.0.1" - }, - "dependencies": { - "minimist": { - "version": "1.2.0", - "resolved": "http://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", - "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", - "dev": true - } - } - }, - "read-pkg": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-2.0.0.tgz", - "integrity": "sha1-jvHAYjxqbbDcZxPEv6xGMysjaPg=", - "dev": true, - "requires": { - "load-json-file": "^2.0.0", - "normalize-package-data": "^2.3.2", - "path-type": "^2.0.0" - }, - "dependencies": { - "path-type": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-2.0.0.tgz", - "integrity": "sha1-8BLMuEFbcJb8LaoQVMPXI4lZTHM=", - "dev": true, - "requires": { - "pify": "^2.0.0" - } - }, - "pify": { - "version": "2.3.0", - "resolved": "http://registry.npmjs.org/pify/-/pify-2.3.0.tgz", - "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", - "dev": true - } - } - }, - "read-pkg-up": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-2.0.0.tgz", - "integrity": "sha1-a3KoBImE4MQeeVEP1en6mbO1Sb4=", - "dev": true, - "requires": { - "find-up": "^2.0.0", - "read-pkg": "^2.0.0" - } - }, - "readable-stream": { - "version": "2.3.6", - "resolved": "http://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", - "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "readdirp": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-2.2.1.tgz", - "integrity": "sha512-1JU/8q+VgFZyxwrJ+SVIOsh+KywWGpds3NTqikiKpDMZWScmAYyKIgqkO+ARvNWJfXeXR1zxz7aHF4u4CyH6vQ==", - "dev": true, - "requires": { - "graceful-fs": "^4.1.11", - "micromatch": "^3.1.10", - "readable-stream": "^2.0.2" - } - }, - "redent": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/redent/-/redent-1.0.0.tgz", - "integrity": "sha1-z5Fqsf1fHxbfsggi3W7H9zDCr94=", - "dev": true, - "requires": { - "indent-string": "^2.1.0", - "strip-indent": "^1.0.1" - }, - "dependencies": { - "indent-string": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-2.1.0.tgz", - "integrity": "sha1-ji1INIdCEhtKghi3oTfppSBJ3IA=", - "dev": true, - "requires": { - "repeating": "^2.0.0" - } - } - } - }, - "regenerate": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/regenerate/-/regenerate-1.4.0.tgz", - "integrity": "sha512-1G6jJVDWrt0rK99kBjvEtziZNCICAuvIPkSiUFIQxVP06RCVpq3dmDo2oi6ABpYaDYaTRr67BEhL8r1wgEZZKg==", - "dev": true - }, - "regenerator-runtime": { - "version": "0.11.1", - "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz", - "integrity": "sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg==", - "dev": true - }, - "regex-cache": { - "version": "0.4.4", - "resolved": "https://registry.npmjs.org/regex-cache/-/regex-cache-0.4.4.tgz", - "integrity": "sha512-nVIZwtCjkC9YgvWkpM55B5rBhBYRZhAaJbgcFYXXsHnbZ9UZI9nnVWYZpBlCqv9ho2eZryPnWrZGsOdPwVWXWQ==", - "dev": true, - "requires": { - "is-equal-shallow": "^0.1.3" - } - }, - "regex-not": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/regex-not/-/regex-not-1.0.2.tgz", - "integrity": "sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A==", - "requires": { - "extend-shallow": "^3.0.2", - "safe-regex": "^1.1.0" - } - }, - "regexpp": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-2.0.1.tgz", - "integrity": "sha512-lv0M6+TkDVniA3aD1Eg0DVpfU/booSu7Eev3TDO/mZKHBfVjgCGTV4t4buppESEYDtkArYFOxTJWv6S5C+iaNw==", - "dev": true - }, - "regexpu-core": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-2.0.0.tgz", - "integrity": "sha1-SdA4g3uNz4v6W5pCE5k45uoq4kA=", - "dev": true, - "requires": { - "regenerate": "^1.2.1", - "regjsgen": "^0.2.0", - "regjsparser": "^0.1.4" - } - }, - "registry-auth-token": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/registry-auth-token/-/registry-auth-token-3.3.2.tgz", - "integrity": "sha512-JL39c60XlzCVgNrO+qq68FoNb56w/m7JYvGR2jT5iR1xBrUA3Mfx5Twk5rqTThPmQKMWydGmq8oFtDlxfrmxnQ==", - "dev": true, - "requires": { - "rc": "^1.1.6", - "safe-buffer": "^5.0.1" - } - }, - "registry-url": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/registry-url/-/registry-url-3.1.0.tgz", - "integrity": "sha1-PU74cPc93h138M+aOBQyRE4XSUI=", - "dev": true, - "requires": { - "rc": "^1.0.1" - } - }, - "regjsgen": { - "version": "0.2.0", - "resolved": "http://registry.npmjs.org/regjsgen/-/regjsgen-0.2.0.tgz", - "integrity": "sha1-bAFq3qxVT3WCP+N6wFuS1aTtsfc=", - "dev": true - }, - "regjsparser": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.1.5.tgz", - "integrity": "sha1-fuj4Tcb6eS0/0K4ijSS9lJ6tIFw=", - "dev": true, - "requires": { - "jsesc": "~0.5.0" - } - }, - "release-zalgo": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/release-zalgo/-/release-zalgo-1.0.0.tgz", - "integrity": "sha1-CXALflB0Mpc5Mw5TXFqQ+2eFFzA=", - "dev": true, - "requires": { - "es6-error": "^4.0.1" - } - }, - "remove-trailing-separator": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz", - "integrity": "sha1-wkvOKig62tW8P1jg1IJJuSN52O8=", - "dev": true - }, - "repeat-element": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.3.tgz", - "integrity": "sha512-ahGq0ZnV5m5XtZLMb+vP76kcAM5nkLqk0lpqAuojSKGgQtn4eRi4ZZGm2olo2zKFH+sMsWaqOCW1dqAnOru72g==" - }, - "repeat-string": { - "version": "1.6.1", - "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", - "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=" - }, - "repeating": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/repeating/-/repeating-2.0.1.tgz", - "integrity": "sha1-UhTFOpJtNVJwdSf7q0FdvAjQbdo=", - "dev": true, - "requires": { - "is-finite": "^1.0.0" - } - }, - "request": { - "version": "2.88.0", - "resolved": "https://registry.npmjs.org/request/-/request-2.88.0.tgz", - "integrity": "sha512-NAqBSrijGLZdM0WZNsInLJpkJokL72XYjUpnB0iwsRgxh7dB6COrHnTBNwN0E+lHDAJzu7kLAkDeY08z2/A0hg==", - "dev": true, - "requires": { - "aws-sign2": "~0.7.0", - "aws4": "^1.8.0", - "caseless": "~0.12.0", - "combined-stream": "~1.0.6", - "extend": "~3.0.2", - "forever-agent": "~0.6.1", - "form-data": "~2.3.2", - "har-validator": "~5.1.0", - "http-signature": "~1.2.0", - "is-typedarray": "~1.0.0", - "isstream": "~0.1.2", - "json-stringify-safe": "~5.0.1", - "mime-types": "~2.1.19", - "oauth-sign": "~0.9.0", - "performance-now": "^2.1.0", - "qs": "~6.5.2", - "safe-buffer": "^5.1.2", - "tough-cookie": "~2.4.3", - "tunnel-agent": "^0.6.0", - "uuid": "^3.3.2" - } - }, - "require-directory": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", - "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", - "dev": true - }, - "require-main-filename": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-1.0.1.tgz", - "integrity": "sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE=", - "dev": true - }, - "require-precompiled": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/require-precompiled/-/require-precompiled-0.1.0.tgz", - "integrity": "sha1-WhtS63Dr7UPrmC6XTIWrWVceVvo=", - "dev": true - }, - "require-uncached": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/require-uncached/-/require-uncached-1.0.3.tgz", - "integrity": "sha1-Tg1W1slmL9MeQwEcS5WqSZVUIdM=", - "dev": true, - "requires": { - "caller-path": "^0.1.0", - "resolve-from": "^1.0.0" - }, - "dependencies": { - "resolve-from": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-1.0.1.tgz", - "integrity": "sha1-Jsv+k10a7uq7Kbw/5a6wHpPUQiY=", - "dev": true - } - } - }, - "requizzle": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/requizzle/-/requizzle-0.2.1.tgz", - "integrity": "sha1-aUPDUwxNmn5G8c3dUcFY/GcM294=", - "dev": true, - "requires": { - "underscore": "~1.6.0" - }, - "dependencies": { - "underscore": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.6.0.tgz", - "integrity": "sha1-izixDKze9jM3uLJOT/htRa6lKag=", - "dev": true - } - } - }, - "resolve": { - "version": "1.8.1", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.8.1.tgz", - "integrity": "sha512-AicPrAC7Qu1JxPCZ9ZgCZlY35QgFnNqc+0LtbRNxnVw4TXvjQ72wnuL9JQcEBgXkI9JM8MsT9kaQoHcpCRJOYA==", - "dev": true, - "requires": { - "path-parse": "^1.0.5" - } - }, - "resolve-cwd": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/resolve-cwd/-/resolve-cwd-2.0.0.tgz", - "integrity": "sha1-AKn3OHVW4nA46uIyyqNypqWbZlo=", - "dev": true, - "requires": { - "resolve-from": "^3.0.0" - } - }, - "resolve-from": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-3.0.0.tgz", - "integrity": "sha1-six699nWiBvItuZTM17rywoYh0g=", - "dev": true - }, - "resolve-url": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz", - "integrity": "sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=" - }, - "responselike": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/responselike/-/responselike-1.0.2.tgz", - "integrity": "sha1-kYcg7ztjHFZCvgaPFa3lpG9Loec=", - "dev": true, - "requires": { - "lowercase-keys": "^1.0.0" - } - }, - "restore-cursor": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-2.0.0.tgz", - "integrity": "sha1-n37ih/gv0ybU/RYpI9YhKe7g368=", - "dev": true, - "requires": { - "onetime": "^2.0.0", - "signal-exit": "^3.0.2" - } - }, - "ret": { - "version": "0.1.15", - "resolved": "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz", - "integrity": "sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==" - }, - "retry-axios": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/retry-axios/-/retry-axios-0.3.2.tgz", - "integrity": "sha512-jp4YlI0qyDFfXiXGhkCOliBN1G7fRH03Nqy8YdShzGqbY5/9S2x/IR6C88ls2DFkbWuL3ASkP7QD3pVrNpPgwQ==" - }, - "retry-request": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/retry-request/-/retry-request-4.0.0.tgz", - "integrity": "sha512-S4HNLaWcMP6r8E4TMH52Y7/pM8uNayOcTDDQNBwsCccL1uI+Ol2TljxRDPzaNfbhOB30+XWP5NnZkB3LiJxi1w==", - "requires": { - "through2": "^2.0.0" - } - }, - "right-align": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/right-align/-/right-align-0.1.3.tgz", - "integrity": "sha1-YTObci/mo1FWiSENJOFMlhSGE+8=", - "dev": true, - "optional": true, - "requires": { - "align-text": "^0.1.1" - } - }, - "rimraf": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.2.tgz", - "integrity": "sha512-lreewLK/BlghmxtfH36YYVg1i8IAce4TI7oao75I1g245+6BctqTVQiBP3YUJ9C6DQOXJmkYR9X9fCLtCOJc5w==", - "dev": true, - "requires": { - "glob": "^7.0.5" - } - }, - "run-async": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.3.0.tgz", - "integrity": "sha1-A3GrSuC91yDUFm19/aZP96RFpsA=", - "dev": true, - "requires": { - "is-promise": "^2.1.0" - } - }, - "rxjs": { - "version": "6.3.3", - "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.3.3.tgz", - "integrity": "sha512-JTWmoY9tWCs7zvIk/CvRjhjGaOd+OVBM987mxFo+OW66cGpdKjZcpmc74ES1sB//7Kl/PAe8+wEakuhG4pcgOw==", - "dev": true, - "requires": { - "tslib": "^1.9.0" - } - }, - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" - }, - "safe-regex": { - "version": "1.1.0", - "resolved": "http://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz", - "integrity": "sha1-QKNmnzsHfR6UPURinhV91IAjvy4=", - "requires": { - "ret": "~0.1.10" - } - }, - "safer-buffer": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", - "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", - "dev": true - }, - "samsam": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/samsam/-/samsam-1.3.0.tgz", - "integrity": "sha512-1HwIYD/8UlOtFS3QO3w7ey+SdSDFE4HRNLZoZRYVQefrOY3l17epswImeB1ijgJFQJodIaHcwkp3r/myBjFVbg==", - "dev": true - }, - "sanitize-html": { - "version": "1.19.1", - "resolved": "https://registry.npmjs.org/sanitize-html/-/sanitize-html-1.19.1.tgz", - "integrity": "sha512-zNYr6FvBn4bZukr9x2uny6od/9YdjCLwF+FqxivqI0YOt/m9GIxfX+tWhm52tBAPUXiTTb4bJTGVagRz5b06bw==", - "dev": true, - "requires": { - "chalk": "^2.3.0", - "htmlparser2": "^3.9.0", - "lodash.clonedeep": "^4.5.0", - "lodash.escaperegexp": "^4.1.2", - "lodash.isplainobject": "^4.0.6", - "lodash.isstring": "^4.0.1", - "lodash.mergewith": "^4.6.0", - "postcss": "^6.0.14", - "srcset": "^1.0.0", - "xtend": "^4.0.0" - } - }, - "semver": { - "version": "5.6.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.6.0.tgz", - "integrity": "sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg==" - }, - "semver-diff": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/semver-diff/-/semver-diff-2.1.0.tgz", - "integrity": "sha1-S7uEN8jTfksM8aaP1ybsbWRdbTY=", - "dev": true, - "requires": { - "semver": "^5.0.3" - } - }, - "serialize-error": { - "version": "2.1.0", - "resolved": "http://registry.npmjs.org/serialize-error/-/serialize-error-2.1.0.tgz", - "integrity": "sha1-ULZ51WNc34Rme9yOWa9OW4HV9go=", - "dev": true - }, - "set-blocking": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", - "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", - "dev": true - }, - "set-value": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.0.tgz", - "integrity": "sha512-hw0yxk9GT/Hr5yJEYnHNKYXkIA8mVJgd9ditYZCe16ZczcaELYYcfvaXesNACk2O8O0nTiPQcQhGUQj8JLzeeg==", - "requires": { - "extend-shallow": "^2.0.1", - "is-extendable": "^0.1.1", - "is-plain-object": "^2.0.3", - "split-string": "^3.0.1" - }, - "dependencies": { - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "requires": { - "is-extendable": "^0.1.0" - } - } - } - }, - "shebang-command": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", - "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", - "dev": true, - "requires": { - "shebang-regex": "^1.0.0" - } - }, - "shebang-regex": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", - "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", - "dev": true - }, - "signal-exit": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", - "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", - "dev": true - }, - "sinon": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/sinon/-/sinon-6.0.1.tgz", - "integrity": "sha512-rfszhNcfamK2+ofIPi9XqeH89pH7KGDcAtM+F9CsjHXOK3jzWG99vyhyD2V+r7s4IipmWcWUFYq4ftZ9/Eu2Wg==", - "dev": true, - "requires": { - "@sinonjs/formatio": "^2.0.0", - "diff": "^3.5.0", - "lodash.get": "^4.4.2", - "lolex": "^2.4.2", - "nise": "^1.3.3", - "supports-color": "^5.4.0", - "type-detect": "^4.0.8" - } - }, - "slash": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/slash/-/slash-1.0.0.tgz", - "integrity": "sha1-xB8vbDn8FtHNF61LXYlhFK5HDVU=" - }, - "slice-ansi": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-1.0.0.tgz", - "integrity": "sha512-POqxBK6Lb3q6s047D/XsDVNPnF9Dl8JSaqe9h9lURl0OdNqy/ujDrOiIHtsqXMGbWWTIomRzAMaTyawAU//Reg==", - "dev": true, - "requires": { - "is-fullwidth-code-point": "^2.0.0" - }, - "dependencies": { - "is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", - "dev": true - } - } - }, - "slide": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/slide/-/slide-1.1.6.tgz", - "integrity": "sha1-VusCfWW00tzmyy4tMsTUr8nh1wc=", - "dev": true - }, - "snapdragon": { - "version": "0.8.2", - "resolved": "https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.2.tgz", - "integrity": "sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg==", - "requires": { - "base": "^0.11.1", - "debug": "^2.2.0", - "define-property": "^0.2.5", - "extend-shallow": "^2.0.1", - "map-cache": "^0.2.2", - "source-map": "^0.5.6", - "source-map-resolve": "^0.5.0", - "use": "^3.1.0" - }, - "dependencies": { - "define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", - "requires": { - "is-descriptor": "^0.1.0" - } - }, - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "requires": { - "is-extendable": "^0.1.0" - } - } - } - }, - "snapdragon-node": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/snapdragon-node/-/snapdragon-node-2.1.1.tgz", - "integrity": "sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw==", - "requires": { - "define-property": "^1.0.0", - "isobject": "^3.0.0", - "snapdragon-util": "^3.0.1" - }, - "dependencies": { - "define-property": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", - "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", - "requires": { - "is-descriptor": "^1.0.0" - } - }, - "is-accessor-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", - "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-data-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", - "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-descriptor": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", - "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", - "requires": { - "is-accessor-descriptor": "^1.0.0", - "is-data-descriptor": "^1.0.0", - "kind-of": "^6.0.2" - } - } - } - }, - "snapdragon-util": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/snapdragon-util/-/snapdragon-util-3.0.1.tgz", - "integrity": "sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ==", - "requires": { - "kind-of": "^3.2.0" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "sort-keys": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/sort-keys/-/sort-keys-2.0.0.tgz", - "integrity": "sha1-ZYU1WEhh7JfXMNbPQYIuH1ZoQSg=", - "dev": true, - "requires": { - "is-plain-obj": "^1.0.0" - } - }, - "source-map": { - "version": "0.5.7", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", - "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=" - }, - "source-map-resolve": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.5.2.tgz", - "integrity": "sha512-MjqsvNwyz1s0k81Goz/9vRBe9SZdB09Bdw+/zYyO+3CuPk6fouTaxscHkgtE8jKvf01kVfl8riHzERQ/kefaSA==", - "requires": { - "atob": "^2.1.1", - "decode-uri-component": "^0.2.0", - "resolve-url": "^0.2.1", - "source-map-url": "^0.4.0", - "urix": "^0.1.0" - } - }, - "source-map-support": { - "version": "0.5.9", - "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.9.tgz", - "integrity": "sha512-gR6Rw4MvUlYy83vP0vxoVNzM6t8MUXqNuRsuBmBHQDu1Fh6X015FrLdgoDKcNdkwGubozq0P4N0Q37UyFVr1EA==", - "dev": true, - "requires": { - "buffer-from": "^1.0.0", - "source-map": "^0.6.0" - }, - "dependencies": { - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true - } - } - }, - "source-map-url": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/source-map-url/-/source-map-url-0.4.0.tgz", - "integrity": "sha1-PpNdfd1zYxuXZZlW1VEo6HtQhKM=" - }, - "spdx-correct": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.0.2.tgz", - "integrity": "sha512-q9hedtzyXHr5S0A1vEPoK/7l8NpfkFYTq6iCY+Pno2ZbdZR6WexZFtqeVGkGxW3TEJMN914Z55EnAGMmenlIQQ==", - "dev": true, - "requires": { - "spdx-expression-parse": "^3.0.0", - "spdx-license-ids": "^3.0.0" - } - }, - "spdx-exceptions": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.2.0.tgz", - "integrity": "sha512-2XQACfElKi9SlVb1CYadKDXvoajPgBVPn/gOQLrTvHdElaVhr7ZEbqJaRnJLVNeaI4cMEAgVCeBMKF6MWRDCRA==", - "dev": true - }, - "spdx-expression-parse": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.0.tgz", - "integrity": "sha512-Yg6D3XpRD4kkOmTpdgbUiEJFKghJH03fiC1OPll5h/0sO6neh2jqRDVHOQ4o/LMea0tgCkbMgea5ip/e+MkWyg==", - "dev": true, - "requires": { - "spdx-exceptions": "^2.1.0", - "spdx-license-ids": "^3.0.0" - } - }, - "spdx-license-ids": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.2.tgz", - "integrity": "sha512-qky9CVt0lVIECkEsYbNILVnPvycuEBkXoMFLRWsREkomQLevYhtRKC+R91a5TOAQ3bCMjikRwhyaRqj1VYatYg==", - "dev": true - }, - "split-string": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/split-string/-/split-string-3.1.0.tgz", - "integrity": "sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw==", - "requires": { - "extend-shallow": "^3.0.0" - } - }, - "sprintf-js": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", - "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", - "dev": true - }, - "srcset": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/srcset/-/srcset-1.0.0.tgz", - "integrity": "sha1-pWad4StC87HV6D7QPHEEb8SPQe8=", - "dev": true, - "requires": { - "array-uniq": "^1.0.2", - "number-is-nan": "^1.0.0" - } - }, - "sshpk": { - "version": "1.15.2", - "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.15.2.tgz", - "integrity": "sha512-Ra/OXQtuh0/enyl4ETZAfTaeksa6BXks5ZcjpSUNrjBr0DvrJKX+1fsKDPpT9TBXgHAFsa4510aNVgI8g/+SzA==", - "dev": true, - "requires": { - "asn1": "~0.2.3", - "assert-plus": "^1.0.0", - "bcrypt-pbkdf": "^1.0.0", - "dashdash": "^1.12.0", - "ecc-jsbn": "~0.1.1", - "getpass": "^0.1.1", - "jsbn": "~0.1.0", - "safer-buffer": "^2.0.2", - "tweetnacl": "~0.14.0" - } - }, - "stack-utils": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/stack-utils/-/stack-utils-1.0.1.tgz", - "integrity": "sha1-1PM6tU6OOHeLDKXP07OvsS22hiA=", - "dev": true - }, - "static-extend": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/static-extend/-/static-extend-0.1.2.tgz", - "integrity": "sha1-YICcOcv/VTNyJv1eC1IPNB8ftcY=", - "requires": { - "define-property": "^0.2.5", - "object-copy": "^0.1.0" - }, - "dependencies": { - "define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", - "requires": { - "is-descriptor": "^0.1.0" - } - } - } - }, - "stream-shift": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/stream-shift/-/stream-shift-1.0.0.tgz", - "integrity": "sha1-1cdSgl5TZ+eG944Y5EXqIjoVWVI=" - }, - "strict-uri-encode": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/strict-uri-encode/-/strict-uri-encode-1.1.0.tgz", - "integrity": "sha1-J5siXfHVgrH1TmWt3UNS4Y+qBxM=", - "dev": true - }, - "string-width": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", - "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", - "requires": { - "code-point-at": "^1.0.0", - "is-fullwidth-code-point": "^1.0.0", - "strip-ansi": "^3.0.0" - } - }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "requires": { - "safe-buffer": "~5.1.0" - } - }, - "stringifier": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/stringifier/-/stringifier-1.4.0.tgz", - "integrity": "sha512-cNsMOqqrcbLcHTXEVmkw9y0fwDwkdgtZwlfyolzpQDoAE1xdNGhQhxBUfiDvvZIKl1hnUEgMv66nHwtMz3OjPw==", - "requires": { - "core-js": "^2.0.0", - "traverse": "^0.6.6", - "type-name": "^2.0.1" - } - }, - "strip-ansi": { - "version": "3.0.1", - "resolved": "http://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", - "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", - "requires": { - "ansi-regex": "^2.0.0" - } - }, - "strip-bom": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", - "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=", - "dev": true - }, - "strip-bom-buf": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/strip-bom-buf/-/strip-bom-buf-1.0.0.tgz", - "integrity": "sha1-HLRar1dTD0yvhsf3UXnSyaUd1XI=", - "dev": true, - "requires": { - "is-utf8": "^0.2.1" - } - }, - "strip-eof": { - "version": "1.0.0", - "resolved": "http://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz", - "integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=", - "dev": true - }, - "strip-indent": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-1.0.1.tgz", - "integrity": "sha1-DHlipq3vp7vUrDZkYKY4VSrhoKI=", - "dev": true, - "requires": { - "get-stdin": "^4.0.1" - } - }, - "strip-json-comments": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", - "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", - "dev": true - }, - "superagent": { - "version": "3.8.3", - "resolved": "https://registry.npmjs.org/superagent/-/superagent-3.8.3.tgz", - "integrity": "sha512-GLQtLMCoEIK4eDv6OGtkOoSMt3D+oq0y3dsxMuYuDvaNUvuT8eFBuLmfR0iYYzHC1e8hpzC6ZsxbuP6DIalMFA==", - "dev": true, - "requires": { - "component-emitter": "^1.2.0", - "cookiejar": "^2.1.0", - "debug": "^3.1.0", - "extend": "^3.0.0", - "form-data": "^2.3.1", - "formidable": "^1.2.0", - "methods": "^1.1.1", - "mime": "^1.4.1", - "qs": "^6.5.1", - "readable-stream": "^2.3.5" - }, - "dependencies": { - "debug": { - "version": "3.2.6", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", - "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", - "dev": true, - "requires": { - "ms": "^2.1.1" - } - }, - "mime": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", - "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==", - "dev": true - }, - "ms": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", - "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", - "dev": true - } - } - }, - "supertap": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/supertap/-/supertap-1.0.0.tgz", - "integrity": "sha512-HZJ3geIMPgVwKk2VsmO5YHqnnJYl6bV5A9JW2uzqV43WmpgliNEYbuvukfor7URpaqpxuw3CfZ3ONdVbZjCgIA==", - "dev": true, - "requires": { - "arrify": "^1.0.1", - "indent-string": "^3.2.0", - "js-yaml": "^3.10.0", - "serialize-error": "^2.1.0", - "strip-ansi": "^4.0.0" - }, - "dependencies": { - "ansi-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", - "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", - "dev": true - }, - "strip-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", - "dev": true, - "requires": { - "ansi-regex": "^3.0.0" - } - } - } - }, - "supertest": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/supertest/-/supertest-3.3.0.tgz", - "integrity": "sha512-dMQSzYdaZRSANH5LL8kX3UpgK9G1LRh/jnggs/TI0W2Sz7rkMx9Y48uia3K9NgcaWEV28tYkBnXE4tiFC77ygQ==", - "dev": true, - "requires": { - "methods": "^1.1.2", - "superagent": "^3.8.3" - } - }, - "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" - }, - "dependencies": { - "has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", - "dev": true - } - } - }, - "symbol-observable": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/symbol-observable/-/symbol-observable-1.2.0.tgz", - "integrity": "sha512-e900nM8RRtGhlV36KGEU9k65K3mPb1WV70OdjfxlG2EAuM1noi/E/BaW/uMhL7bPEssK8QV57vN3esixjUvcXQ==", - "dev": true - }, - "table": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/table/-/table-5.1.0.tgz", - "integrity": "sha512-e542in22ZLhD/fOIuXs/8yDZ9W61ltF8daM88rkRNtgTIct+vI2fTnAyu/Db2TCfEcI8i7mjZz6meLq0nW7TYg==", - "dev": true, - "requires": { - "ajv": "^6.5.3", - "lodash": "^4.17.10", - "slice-ansi": "1.0.0", - "string-width": "^2.1.1" - }, - "dependencies": { - "ajv": { - "version": "6.5.5", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.5.5.tgz", - "integrity": "sha512-7q7gtRQDJSyuEHjuVgHoUa2VuemFiCMrfQc9Tc08XTAc4Zj/5U1buQJ0HU6i7fKjXU09SVgSmxa4sLvuvS8Iyg==", - "dev": true, - "requires": { - "fast-deep-equal": "^2.0.1", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.4.1", - "uri-js": "^4.2.2" - } - }, - "ansi-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", - "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", - "dev": true - }, - "fast-deep-equal": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz", - "integrity": "sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk=", - "dev": true - }, - "is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", - "dev": true - }, - "json-schema-traverse": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", - "dev": true - }, - "string-width": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", - "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", - "dev": true, - "requires": { - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^4.0.0" - } - }, - "strip-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", - "dev": true, - "requires": { - "ansi-regex": "^3.0.0" - } - } - } - }, - "taffydb": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/taffydb/-/taffydb-2.6.2.tgz", - "integrity": "sha1-fLy2S1oUG2ou/CxdLGe04VCyomg=", - "dev": true - }, - "term-size": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/term-size/-/term-size-1.2.0.tgz", - "integrity": "sha1-RYuDiH8oj8Vtb/+/rSYuJmOO+mk=", - "dev": true, - "requires": { - "execa": "^0.7.0" - } - }, - "text-encoding": { - "version": "0.6.4", - "resolved": "http://registry.npmjs.org/text-encoding/-/text-encoding-0.6.4.tgz", - "integrity": "sha1-45mpgiV6J22uQou5KEXLcb3CbRk=", - "dev": true - }, - "text-table": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", - "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=", - "dev": true - }, - "through": { - "version": "2.3.8", - "resolved": "http://registry.npmjs.org/through/-/through-2.3.8.tgz", - "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=", - "dev": true - }, - "through2": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.3.tgz", - "integrity": "sha1-AARWmzfHx0ujnEPzzteNGtlBQL4=", - "requires": { - "readable-stream": "^2.1.5", - "xtend": "~4.0.1" - } - }, - "time-zone": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/time-zone/-/time-zone-1.0.0.tgz", - "integrity": "sha1-mcW/VZWJZq9tBtg73zgA3IL67F0=", - "dev": true - }, - "timed-out": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/timed-out/-/timed-out-4.0.1.tgz", - "integrity": "sha1-8y6srFoXW+ol1/q1Zas+2HQe9W8=", - "dev": true - }, - "tmp": { - "version": "0.0.33", - "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", - "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", - "dev": true, - "requires": { - "os-tmpdir": "~1.0.2" - } - }, - "to-fast-properties": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-1.0.3.tgz", - "integrity": "sha1-uDVx+k2MJbguIxsG46MFXeTKGkc=", - "dev": true - }, - "to-object-path": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/to-object-path/-/to-object-path-0.3.0.tgz", - "integrity": "sha1-KXWIt7Dn4KwI4E5nL4XB9JmeF68=", - "requires": { - "kind-of": "^3.0.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "to-regex": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/to-regex/-/to-regex-3.0.2.tgz", - "integrity": "sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw==", - "requires": { - "define-property": "^2.0.2", - "extend-shallow": "^3.0.2", - "regex-not": "^1.0.2", - "safe-regex": "^1.1.0" - } - }, - "to-regex-range": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz", - "integrity": "sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg=", - "requires": { - "is-number": "^3.0.0", - "repeat-string": "^1.6.1" - } - }, - "tough-cookie": { - "version": "2.4.3", - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.4.3.tgz", - "integrity": "sha512-Q5srk/4vDM54WJsJio3XNn6K2sCG+CQ8G5Wz6bZhRZoAe/+TxjWB/GlFAnYEbkYVlON9FMk/fE3h2RLpPXo4lQ==", - "dev": true, - "requires": { - "psl": "^1.1.24", - "punycode": "^1.4.1" - } - }, - "traverse": { - "version": "0.6.6", - "resolved": "https://registry.npmjs.org/traverse/-/traverse-0.6.6.tgz", - "integrity": "sha1-y99WD9e5r2MlAv7UD5GMFX6pcTc=" - }, - "trim-newlines": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-1.0.0.tgz", - "integrity": "sha1-WIeWa7WCpFA6QetST301ARgVphM=", - "dev": true - }, - "trim-off-newlines": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/trim-off-newlines/-/trim-off-newlines-1.0.1.tgz", - "integrity": "sha1-n5up2e+odkw4dpi8v+sshI8RrbM=", - "dev": true - }, - "trim-right": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/trim-right/-/trim-right-1.0.1.tgz", - "integrity": "sha1-yy4SAwZ+DI3h9hQJS5/kVwTqYAM=", - "dev": true - }, - "tslib": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.9.3.tgz", - "integrity": "sha512-4krF8scpejhaOgqzBEcGM7yDIEfi0/8+8zDRZhNZZ2kjmHJ4hv3zCbQWxoJGz1iw5U0Jl0nma13xzHXcncMavQ==", - "dev": true - }, - "tunnel-agent": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", - "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", - "dev": true, - "requires": { - "safe-buffer": "^5.0.1" - } - }, - "tweetnacl": { - "version": "0.14.5", - "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", - "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=", - "dev": true - }, - "type-check": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", - "integrity": "sha1-WITKtRLPHTVeP7eE8wgEsrUg23I=", - "dev": true, - "requires": { - "prelude-ls": "~1.1.2" - } - }, - "type-detect": { - "version": "4.0.8", - "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", - "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", - "dev": true - }, - "type-name": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/type-name/-/type-name-2.0.2.tgz", - "integrity": "sha1-7+fUEj2KxSr/9/QMfk3sUmYAj7Q=" - }, - "uglify-js": { - "version": "2.8.29", - "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-2.8.29.tgz", - "integrity": "sha1-KcVzMUgFe7Th913zW3qcty5qWd0=", - "dev": true, - "optional": true, - "requires": { - "source-map": "~0.5.1", - "uglify-to-browserify": "~1.0.0", - "yargs": "~3.10.0" - }, - "dependencies": { - "camelcase": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-1.2.1.tgz", - "integrity": "sha1-m7UwTS4LVmmLLHWLCKPqqdqlijk=", - "dev": true, - "optional": true - }, - "cliui": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-2.1.0.tgz", - "integrity": "sha1-S0dXYP+AJkx2LDoXGQMukcf+oNE=", - "dev": true, - "optional": true, - "requires": { - "center-align": "^0.1.1", - "right-align": "^0.1.1", - "wordwrap": "0.0.2" - } - }, - "window-size": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/window-size/-/window-size-0.1.0.tgz", - "integrity": "sha1-VDjNLqk7IC76Ohn+iIeu58lPnJ0=", - "dev": true, - "optional": true - }, - "wordwrap": { - "version": "0.0.2", - "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.2.tgz", - "integrity": "sha1-t5Zpu0LstAn4PVg8rVLKF+qhZD8=", - "dev": true, - "optional": true - }, - "yargs": { - "version": "3.10.0", - "resolved": "http://registry.npmjs.org/yargs/-/yargs-3.10.0.tgz", - "integrity": "sha1-9+572FfdfB0tOMDnTvvWgdFDH9E=", - "dev": true, - "optional": true, - "requires": { - "camelcase": "^1.0.2", - "cliui": "^2.1.0", - "decamelize": "^1.0.0", - "window-size": "0.1.0" - } - } - } - }, - "uglify-to-browserify": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/uglify-to-browserify/-/uglify-to-browserify-1.0.2.tgz", - "integrity": "sha1-bgkk1r2mta/jSeOabWMoUKD4grc=", - "dev": true, - "optional": true - }, - "uid2": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/uid2/-/uid2-0.0.3.tgz", - "integrity": "sha1-SDEm4Rd03y9xuLY53NeZw3YWK4I=", - "dev": true - }, - "underscore": { - "version": "1.8.3", - "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.8.3.tgz", - "integrity": "sha1-Tz+1OxBuYJf8+ctBCfKl6b36UCI=", - "dev": true - }, - "underscore-contrib": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/underscore-contrib/-/underscore-contrib-0.3.0.tgz", - "integrity": "sha1-ZltmwkeD+PorGMn4y7Dix9SMJsc=", - "dev": true, - "requires": { - "underscore": "1.6.0" - }, - "dependencies": { - "underscore": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.6.0.tgz", - "integrity": "sha1-izixDKze9jM3uLJOT/htRa6lKag=", - "dev": true - } - } - }, - "union-value": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.0.tgz", - "integrity": "sha1-XHHDTLW61dzr4+oM0IIHulqhrqQ=", - "requires": { - "arr-union": "^3.1.0", - "get-value": "^2.0.6", - "is-extendable": "^0.1.1", - "set-value": "^0.4.3" - }, - "dependencies": { - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "requires": { - "is-extendable": "^0.1.0" - } - }, - "set-value": { - "version": "0.4.3", - "resolved": "https://registry.npmjs.org/set-value/-/set-value-0.4.3.tgz", - "integrity": "sha1-fbCPnT0i3H945Trzw79GZuzfzPE=", - "requires": { - "extend-shallow": "^2.0.1", - "is-extendable": "^0.1.1", - "is-plain-object": "^2.0.1", - "to-object-path": "^0.3.0" - } - } - } - }, - "unique-string": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/unique-string/-/unique-string-1.0.0.tgz", - "integrity": "sha1-nhBXzKhRq7kzmPizOuGHuZyuwRo=", - "dev": true, - "requires": { - "crypto-random-string": "^1.0.0" - } - }, - "unique-temp-dir": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/unique-temp-dir/-/unique-temp-dir-1.0.0.tgz", - "integrity": "sha1-bc6VsmgcoAPuv7MEpBX5y6vMU4U=", - "dev": true, - "requires": { - "mkdirp": "^0.5.1", - "os-tmpdir": "^1.0.1", - "uid2": "0.0.3" - } - }, - "universal-deep-strict-equal": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/universal-deep-strict-equal/-/universal-deep-strict-equal-1.2.2.tgz", - "integrity": "sha1-DaSsL3PP95JMgfpN4BjKViyisKc=", - "requires": { - "array-filter": "^1.0.0", - "indexof": "0.0.1", - "object-keys": "^1.0.0" - } - }, - "universalify": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", - "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", - "dev": true - }, - "unset-value": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/unset-value/-/unset-value-1.0.0.tgz", - "integrity": "sha1-g3aHP30jNRef+x5vw6jtDfyKtVk=", - "requires": { - "has-value": "^0.3.1", - "isobject": "^3.0.0" - }, - "dependencies": { - "has-value": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/has-value/-/has-value-0.3.1.tgz", - "integrity": "sha1-ex9YutpiyoJ+wKIHgCVlSEWZXh8=", - "requires": { - "get-value": "^2.0.3", - "has-values": "^0.1.4", - "isobject": "^2.0.0" - }, - "dependencies": { - "isobject": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", - "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=", - "requires": { - "isarray": "1.0.0" - } - } - } - }, - "has-values": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/has-values/-/has-values-0.1.4.tgz", - "integrity": "sha1-bWHeldkd/Km5oCCJrThL/49it3E=" - } - } - }, - "unzip-response": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/unzip-response/-/unzip-response-2.0.1.tgz", - "integrity": "sha1-0vD3N9FrBhXnKmk17QQhRXLVb5c=", - "dev": true - }, - "update-notifier": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/update-notifier/-/update-notifier-2.5.0.tgz", - "integrity": "sha512-gwMdhgJHGuj/+wHJJs9e6PcCszpxR1b236igrOkUofGhqJuG+amlIKwApH1IW1WWl7ovZxsX49lMBWLxSdm5Dw==", - "dev": true, - "requires": { - "boxen": "^1.2.1", - "chalk": "^2.0.1", - "configstore": "^3.0.0", - "import-lazy": "^2.1.0", - "is-ci": "^1.0.10", - "is-installed-globally": "^0.1.0", - "is-npm": "^1.0.0", - "latest-version": "^3.0.0", - "semver-diff": "^2.0.0", - "xdg-basedir": "^3.0.0" - } - }, - "uri-js": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.2.2.tgz", - "integrity": "sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ==", - "dev": true, - "requires": { - "punycode": "^2.1.0" - }, - "dependencies": { - "punycode": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", - "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", - "dev": true - } - } - }, - "urix": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/urix/-/urix-0.1.0.tgz", - "integrity": "sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI=" - }, - "url-parse-lax": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/url-parse-lax/-/url-parse-lax-1.0.0.tgz", - "integrity": "sha1-evjzA2Rem9eaJy56FKxovAYJ2nM=", - "dev": true, - "requires": { - "prepend-http": "^1.0.1" - } - }, - "url-to-options": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/url-to-options/-/url-to-options-1.0.1.tgz", - "integrity": "sha1-FQWgOiiaSMvXpDTvuu7FBV9WM6k=", - "dev": true - }, - "urlgrey": { - "version": "0.4.4", - "resolved": "https://registry.npmjs.org/urlgrey/-/urlgrey-0.4.4.tgz", - "integrity": "sha1-iS/pWWCAXoVRnxzUOJ8stMu3ZS8=", - "dev": true - }, - "use": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/use/-/use-3.1.1.tgz", - "integrity": "sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ==" - }, - "util-deprecate": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" - }, - "uuid": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.2.tgz", - "integrity": "sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA==", - "dev": true - }, - "validate-npm-package-license": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", - "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", - "dev": true, - "requires": { - "spdx-correct": "^3.0.0", - "spdx-expression-parse": "^3.0.0" - } - }, - "verror": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", - "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", - "dev": true, - "requires": { - "assert-plus": "^1.0.0", - "core-util-is": "1.0.2", - "extsprintf": "^1.2.0" - } - }, - "well-known-symbols": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/well-known-symbols/-/well-known-symbols-1.0.0.tgz", - "integrity": "sha1-c8eK6Bp3Jqj6WY4ogIAcixYiVRg=", - "dev": true - }, - "which": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", - "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", - "dev": true, - "requires": { - "isexe": "^2.0.0" - } - }, - "which-module": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", - "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=", - "dev": true - }, - "widest-line": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/widest-line/-/widest-line-2.0.1.tgz", - "integrity": "sha512-Ba5m9/Fa4Xt9eb2ELXt77JxVDV8w7qQrH0zS/TWSJdLyAwQjWoOzpzj5lwVftDz6n/EOu3tNACS84v509qwnJA==", - "dev": true, - "requires": { - "string-width": "^2.1.1" - }, - "dependencies": { - "ansi-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", - "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", - "dev": true - }, - "is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", - "dev": true - }, - "string-width": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", - "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", - "dev": true, - "requires": { - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^4.0.0" - } - }, - "strip-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", - "dev": true, - "requires": { - "ansi-regex": "^3.0.0" - } - } - } - }, - "window-size": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/window-size/-/window-size-0.1.4.tgz", - "integrity": "sha1-+OGqHuWlPsW/FR/6CXQqatdpeHY=" - }, - "wordwrap": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.3.tgz", - "integrity": "sha1-o9XabNXAvAAI03I0u68b7WMFkQc=", - "dev": true - }, - "wrap-ansi": { - "version": "2.1.0", - "resolved": "http://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz", - "integrity": "sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU=", - "requires": { - "string-width": "^1.0.1", - "strip-ansi": "^3.0.1" - } - }, - "wrappy": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" - }, - "write": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/write/-/write-0.2.1.tgz", - "integrity": "sha1-X8A4KOJkzqP+kUVUdvejxWbLB1c=", - "dev": true, - "requires": { - "mkdirp": "^0.5.1" - } - }, - "write-file-atomic": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-2.3.0.tgz", - "integrity": "sha512-xuPeK4OdjWqtfi59ylvVL0Yn35SF3zgcAcv7rBPFHVaEapaDr4GdGgm3j7ckTwH9wHL7fGmgfAnb0+THrHb8tA==", - "dev": true, - "requires": { - "graceful-fs": "^4.1.11", - "imurmurhash": "^0.1.4", - "signal-exit": "^3.0.2" - } - }, - "write-json-file": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/write-json-file/-/write-json-file-2.3.0.tgz", - "integrity": "sha1-K2TIozAE1UuGmMdtWFp3zrYdoy8=", - "dev": true, - "requires": { - "detect-indent": "^5.0.0", - "graceful-fs": "^4.1.2", - "make-dir": "^1.0.0", - "pify": "^3.0.0", - "sort-keys": "^2.0.0", - "write-file-atomic": "^2.0.0" - }, - "dependencies": { - "detect-indent": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/detect-indent/-/detect-indent-5.0.0.tgz", - "integrity": "sha1-OHHMCmoALow+Wzz38zYmRnXwa50=", - "dev": true - } - } - }, - "write-pkg": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/write-pkg/-/write-pkg-3.2.0.tgz", - "integrity": "sha512-tX2ifZ0YqEFOF1wjRW2Pk93NLsj02+n1UP5RvO6rCs0K6R2g1padvf006cY74PQJKMGS2r42NK7FD0dG6Y6paw==", - "dev": true, - "requires": { - "sort-keys": "^2.0.0", - "write-json-file": "^2.2.0" - } - }, - "xdg-basedir": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/xdg-basedir/-/xdg-basedir-3.0.0.tgz", - "integrity": "sha1-SWsswQnsqNus/i3HK2A8F8WHCtQ=", - "dev": true - }, - "xmlcreate": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/xmlcreate/-/xmlcreate-1.0.2.tgz", - "integrity": "sha1-+mv3YqYKQT+z3Y9LA8WyaSONMI8=", - "dev": true - }, - "xregexp": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/xregexp/-/xregexp-4.0.0.tgz", - "integrity": "sha512-PHyM+sQouu7xspQQwELlGwwd05mXUFqwFYfqPO0cC7x4fxyHnnuetmQr6CjJiafIDoH4MogHb9dOoJzR/Y4rFg==", - "dev": true - }, - "xtend": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz", - "integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68=" - }, - "y18n": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-3.2.1.tgz", - "integrity": "sha1-bRX7qITAhnnA136I53WegR4H+kE=" - }, - "yallist": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz", - "integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=" - }, - "yargs": { - "version": "3.32.0", - "resolved": "http://registry.npmjs.org/yargs/-/yargs-3.32.0.tgz", - "integrity": "sha1-AwiOnr+edWtpdRYR0qXvWRSCyZU=", - "requires": { - "camelcase": "^2.0.1", - "cliui": "^3.0.3", - "decamelize": "^1.1.1", - "os-locale": "^1.4.0", - "string-width": "^1.0.1", - "window-size": "^0.1.4", - "y18n": "^3.2.0" - } - }, - "yargs-parser": { - "version": "10.1.0", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-10.1.0.tgz", - "integrity": "sha512-VCIyR1wJoEBZUqk5PA+oOBF6ypbwh5aNB3I50guxAL/quggdfs4TtNHQrSazFA3fYZ+tEqfs0zIGlv0c/rgjbQ==", - "dev": true, - "requires": { - "camelcase": "^4.1.0" - }, - "dependencies": { - "camelcase": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz", - "integrity": "sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0=", - "dev": true - } - } - } - } -} diff --git a/packages/google-cloud-securitycenter/package.json b/packages/google-cloud-securitycenter/package.json index 5e6ade3a013..7de07dbe1e3 100644 --- a/packages/google-cloud-securitycenter/package.json +++ b/packages/google-cloud-securitycenter/package.json @@ -11,9 +11,7 @@ "main": "src/index.js", "files": [ "protos", - "src", - "AUTHORS", - "COPYING" + "src" ], "keywords": [ "google apis client", @@ -28,23 +26,19 @@ "Security Center", "Security Command Center API" ], - "contributors": [ - "Jonathan Lui " - ], "scripts": { "cover": "nyc --reporter=lcov mocha test/*.js && nyc report", "docs": "jsdoc -c .jsdoc.js", "generate-scaffolding": "repo-tools generate all && repo-tools generate lib_samples_readme -l samples/ --config ../.cloud-repo-tools.json", - "lint": "eslint src/ samples/ system-test/ test/", - "prettier": "prettier --write src/*.js src/*/*.js samples/*.js samples/*/*.js test/*.js test/*/*.js system-test/*.js system-test/*/*.js", + "lint": "eslint '**/*.js'", "samples-test": "cd samples/ && npm link ../ && npm test && cd ../", "system-test": "mocha system-test/*.js --timeout 600000", "test-no-cover": "mocha test/*.js", "test": "npm run cover", - "fix": "eslint --fix '**/*.js' && npm run prettier" + "fix": "eslint --fix '**/*.js'" }, "dependencies": { - "google-gax": "^0.20.0", + "google-gax": "^0.22.0", "lodash.merge": "^4.6.0", "protobufjs": "^6.8.0" }, diff --git a/packages/google-cloud-securitycenter/samples/.eslintrc.yml b/packages/google-cloud-securitycenter/samples/.eslintrc.yml index 282535f55f6..0aa37ac630e 100644 --- a/packages/google-cloud-securitycenter/samples/.eslintrc.yml +++ b/packages/google-cloud-securitycenter/samples/.eslintrc.yml @@ -1,3 +1,4 @@ --- rules: no-console: off + node/no-missing-require: off diff --git a/packages/google-cloud-securitycenter/samples/package.json b/packages/google-cloud-securitycenter/samples/package.json new file mode 100644 index 00000000000..4e403b259cf --- /dev/null +++ b/packages/google-cloud-securitycenter/samples/package.json @@ -0,0 +1,15 @@ +{ + "name": "nodejs-security-center-samples", + "main": "quickstart.js", + "private": true, + "scripts": { + "test": "mocha system-test" + }, + "license": "Apache-2.0", + "dependencies": { + "@google-cloud/security-center": "^0.1.0" + }, + "devDependencies": { + "mocha": "^5.2.0" + } +} diff --git a/packages/google-cloud-securitycenter/samples/quickstart.js b/packages/google-cloud-securitycenter/samples/quickstart.js index 50faad3a91c..c984865131a 100644 --- a/packages/google-cloud-securitycenter/samples/quickstart.js +++ b/packages/google-cloud-securitycenter/samples/quickstart.js @@ -18,4 +18,5 @@ // [START securitycenter_quickstart] // Imports the Google Cloud client library const sc = require('@google-cloud/securitycenter'); +console.log(sc); // [END securitycenter_quickstart] diff --git a/packages/google-cloud-securitycenter/synth.py b/packages/google-cloud-securitycenter/synth.py index a0ef3c52fa7..75371a5a4c7 100644 --- a/packages/google-cloud-securitycenter/synth.py +++ b/packages/google-cloud-securitycenter/synth.py @@ -19,22 +19,18 @@ logging.basicConfig(level=logging.DEBUG) +# Run the gapic generator gapic = gcp.GAPICGenerator() -common_templates = gcp.CommonTemplates() - - versions = ['v1beta1'] - for version in versions: library = gapic.node_library('securitycenter', version) s.copy(library, excludes=['src/index.js', 'README.md', 'package.json']) +# Copy common templates +common_templates = gcp.CommonTemplates() templates = common_templates.node_library() s.copy(templates) - -''' -Node.js specific cleanup -''' +# Node.js specific cleanup subprocess.run(['npm', 'install']) -subprocess.run(['npm', 'run', 'prettier']) +subprocess.run(['npm', 'run', 'fix']) diff --git a/packages/google-cloud-securitycenter/test/mocha.opts b/packages/google-cloud-securitycenter/test/mocha.opts new file mode 100644 index 00000000000..8751e7bae37 --- /dev/null +++ b/packages/google-cloud-securitycenter/test/mocha.opts @@ -0,0 +1,3 @@ +--require intelli-espower-loader +--timeout 10000 +--throw-deprecation From 60d37bd2c97a03c5b2e08fa0961c45cdaeac9736 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot <44816363+yoshi-automation@users.noreply.github.com> Date: Mon, 26 Nov 2018 13:24:19 -0800 Subject: [PATCH 006/342] docs: sync protos comment changes --- .../.circleci/npm-install-retry.js | 15 -------- .../cloud/securitycenter/v1beta1/asset.proto | 36 ++++++++++--------- .../securitycenter/v1beta1/finding.proto | 26 +++++++------- .../v1beta1/organization_settings.proto | 23 ++++++------ .../v1beta1/security_marks.proto | 10 +++--- .../v1beta1/securitycenter_service.proto | 25 ++++++------- .../cloud/securitycenter/v1beta1/source.proto | 14 ++++---- .../cloud/securitycenter/v1beta1/doc_asset.js | 34 +++++++++--------- .../securitycenter/v1beta1/doc_finding.js | 24 ++++++------- .../v1beta1/doc_organization_settings.js | 21 +++++------ .../v1beta1/doc_security_marks.js | 8 ++--- .../v1beta1/doc_securitycenter_service.js | 3 +- .../securitycenter/v1beta1/doc_source.js | 12 +++---- .../src/v1beta1/security_center_client.js | 8 ++--- 14 files changed, 124 insertions(+), 135 deletions(-) diff --git a/packages/google-cloud-securitycenter/.circleci/npm-install-retry.js b/packages/google-cloud-securitycenter/.circleci/npm-install-retry.js index 6c4c0b6ffdf..3240aa2cbf2 100755 --- a/packages/google-cloud-securitycenter/.circleci/npm-install-retry.js +++ b/packages/google-cloud-securitycenter/.circleci/npm-install-retry.js @@ -1,20 +1,5 @@ #!/usr/bin/env node -/** - * Copyright 2018, Google, LLC. - * Licensed under the Apache License, Version 2.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. - */ - let spawn = require('child_process').spawn; // diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/asset.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/asset.proto index 87e16aa55fc..d8f93409a8c 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/asset.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/asset.proto @@ -23,26 +23,28 @@ import "google/protobuf/struct.proto"; import "google/protobuf/timestamp.proto"; option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1beta1;securitycenter"; +option java_multiple_files = true; option java_package = "com.google.cloud.securitycenter.v1beta1"; -// Security Center's representation of a Google Cloud Platform resource. + +// Cloud Security Command Center's (Cloud SCC) representation of a Google Cloud +// Platform (GCP) resource. // -// The Asset is a resource of Security Center that is meant to capture -// information regarding a single Google Cloud Platform resource. All -// modifications to an Asset are only within the context of Security Center and -// do not effect the referenced Google Cloud Platform resource. +// The Asset is a Cloud SCC resource that captures information about a single GCP +// resource. All modifications to an Asset are only within the context of Cloud +// SCC and don't affect the referenced GCP resource. message Asset { - // Security Center managed properties. These properties are managed by - // Security Center and cannot be modified by the user. + // Cloud SCC managed properties. These properties are managed by Cloud SCC and + // cannot be modified by the user. message SecurityCenterProperties { - // The full resource name of the Google Cloud Platform resource this asset + // The full resource name of the GCP resource this asset // represents. This field is immutable after create time. See: // https://cloud.google.com/apis/design/resource_names#full_resource_name string resource_name = 1; - // The type of the Google Cloud resource. Examples include: APPLICATION, + // The type of the GCP resource. Examples include: APPLICATION, // PROJECT, and ORGANIZATION. This is a case insensitive field defined by - // Security Center and/or the producer of the resource and is immutable + // Cloud SCC and/or the producer of the resource and is immutable // after create time. string resource_type = 2; @@ -64,22 +66,22 @@ message Asset { // "organizations/123/assets/456". string name = 1; - // Security Center managed properties. These properties are managed by - // Security Center and cannot be modified by the user. + // Cloud SCC managed properties. These properties are managed by + // Cloud SCC and cannot be modified by the user. SecurityCenterProperties security_center_properties = 2; // Resource managed properties. These properties are managed and defined by - // the Google Cloud Platform resource and cannot be modified by the user. + // the GCP resource and cannot be modified by the user. map resource_properties = 7; // User specified security marks. These marks are entirely managed by the user - // and come from the SecurityMarks resource belonging to the asset. + // and come from the SecurityMarks resource that belongs to the asset. SecurityMarks security_marks = 8; - // The time at which the asset was created in Security Center. + // The time at which the asset was created in Cloud SCC. google.protobuf.Timestamp create_time = 9; - // The time at which the asset was last updated, added, or deleted in Security - // Center. + // The time at which the asset was last updated, added, or deleted in Cloud + // SCC. google.protobuf.Timestamp update_time = 10; } diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/finding.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/finding.proto index 7d9016e0f81..0c99247b605 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/finding.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/finding.proto @@ -23,14 +23,16 @@ import "google/protobuf/struct.proto"; import "google/protobuf/timestamp.proto"; option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1beta1;securitycenter"; +option java_multiple_files = true; option java_package = "com.google.cloud.securitycenter.v1beta1"; -// Security Center's finding. + +// Cloud Security Command Center (Cloud SCC) finding. // // A finding is a record of assessment data (security, risk, health or privacy) -// ingested into Security Center for presentation, notification, analysis, -// policy testing and enforcement. For example, an XSS vulnerability in an -// AppEngine application is a finding. +// ingested into Cloud SCC for presentation, notification, analysis, +// policy testing, and enforcement. For example, an XSS vulnerability in an +// App Engine application is a finding. message Finding { // The state of the finding. enum State { @@ -58,8 +60,8 @@ message Finding { // "organizations/123/sources/456" string parent = 2; - // The full resource name of the Google Cloud Platform resource this finding - // is for. See: + // The full resource name of the Google Cloud Platform (GCP) resource this + // finding is for. See: // https://cloud.google.com/apis/design/resource_names#full_resource_name // This field is immutable after creation time. string resource_name = 3; @@ -72,18 +74,18 @@ message Finding { // Example: "XSS_FLASH_INJECTION" string category = 5; - // The URI that, if available, points to a web page outside of Security Center + // The URI that, if available, points to a web page outside of Cloud SCC // where additional information about the finding can be found. This field is - // guaranteed to be either empty or a well formed url. + // guaranteed to be either empty or a well formed URL. string external_uri = 6; // Source specific properties. These properties are managed by the source - // writing the finding. + // that writes the finding. map source_properties = 7; // Output only. User specified security marks. These marks are entirely - // managed by the user and come from the SecurityMarks resource belonging to - // the finding. + // managed by the user and come from the SecurityMarks resource that belongs + // to the finding. SecurityMarks security_marks = 8; // The time at which the event took place. For example, if the finding @@ -91,6 +93,6 @@ message Finding { // detected. google.protobuf.Timestamp event_time = 9; - // The time at which the finding was created in Security Center. + // The time at which the finding was created in Cloud SCC. google.protobuf.Timestamp create_time = 10; } diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/organization_settings.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/organization_settings.proto index 80fafe5b5b2..cc9f1c3ce3e 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/organization_settings.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/organization_settings.proto @@ -20,20 +20,23 @@ package google.cloud.securitycenter.v1beta1; import "google/api/annotations.proto"; option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1beta1;securitycenter"; +option java_multiple_files = true; option java_package = "com.google.cloud.securitycenter.v1beta1"; -// User specified settings that are attached to the Security Center -// organization. + +// User specified settings that are attached to the Cloud Security Command +// Center (Cloud SCC) organization. message OrganizationSettings { // The configuration used for Asset Discovery runs. message AssetDiscoveryConfig { // The mode of inclusion when running Asset Discovery. // Asset discovery can be limited by explicitly identifying projects to be - // included or excluded. If INCLUDE_ONLY is set then only those projects - // (within the organization) and their children are discovered during asset - // discovery. If EXCLUDE is set then projects not matching those projects - // are discovered during asset discovery. If neither are set then all - // projects within the organization are discovered during asset discovery. + // included or excluded. If INCLUDE_ONLY is set, then only those projects + // within the organization and their children are discovered during asset + // discovery. If EXCLUDE is set, then projects that don't match those + // projects are discovered during asset discovery. If neither are set, then + // all projects within the organization are discovered during asset + // discovery. enum InclusionMode { // Unspecified. Setting the mode with this value will disable // inclusion/exclusion filtering for Asset Discovery. @@ -61,9 +64,9 @@ message OrganizationSettings { // "organizations/123/organizationSettings". string name = 1; - // A flag indicating whether Asset Discovery should be enabled. If the flag is - // set to true then discovery of assets will occur. If it is set to false all - // historical assets will remain but discovery of future assets will not + // A flag that indicates if Asset Discovery should be enabled. If the flag is + // set to `true`, then discovery of assets will occur. If it is set to `false, + // all historical assets will remain, but discovery of future assets will not // occur. bool enable_asset_discovery = 2; diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/security_marks.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/security_marks.proto index 1d011dc2d67..02eb9ed23f7 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/security_marks.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/security_marks.proto @@ -20,12 +20,14 @@ package google.cloud.securitycenter.v1beta1; import "google/api/annotations.proto"; option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1beta1;securitycenter"; +option java_multiple_files = true; option java_package = "com.google.cloud.securitycenter.v1beta1"; -// User specified security marks that are attached to the parent Security Center -// resource. Security marks are scoped within a Security Center organization -- -// they are modifiable and viewable by all with proper permissions on the -// organization. + +// User specified security marks that are attached to the parent Cloud Security +// Command Center (Cloud SCC) resource. Security marks are scoped within a Cloud +// SCC organization -- they can be modified and viewed by all users who have +// proper permissions on the organization. message SecurityMarks { // The relative resource name of the SecurityMarks. See: // https://cloud.google.com/apis/design/resource_names#relative_resource_name diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/securitycenter_service.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/securitycenter_service.proto index dd710207b0f..fecca4f0dff 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/securitycenter_service.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/securitycenter_service.proto @@ -33,8 +33,10 @@ import "google/protobuf/struct.proto"; import "google/protobuf/timestamp.proto"; option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1beta1;securitycenter"; +option java_multiple_files = true; option java_package = "com.google.cloud.securitycenter.v1beta1"; + // V1 Beta APIs for Security Center service. service SecurityCenter { // Creates a source. @@ -55,8 +57,7 @@ service SecurityCenter { } // Gets the access control policy on the specified Source. - rpc GetIamPolicy(google.iam.v1.GetIamPolicyRequest) - returns (google.iam.v1.Policy) { + rpc GetIamPolicy(google.iam.v1.GetIamPolicyRequest) returns (google.iam.v1.Policy) { option (google.api.http) = { post: "/v1beta1/{resource=organizations/*/sources/*}:getIamPolicy" body: "*" @@ -64,8 +65,7 @@ service SecurityCenter { } // Gets the settings for an organization. - rpc GetOrganizationSettings(GetOrganizationSettingsRequest) - returns (OrganizationSettings) { + rpc GetOrganizationSettings(GetOrganizationSettingsRequest) returns (OrganizationSettings) { option (google.api.http) = { get: "/v1beta1/{name=organizations/*/organizationSettings}" }; @@ -106,7 +106,7 @@ service SecurityCenter { }; } - // Lists an organization or source's assets. + // Lists an organization or source's findings. // // To list across all sources provide a `-` as the source id. // Example: /v1beta1/organizations/123/sources/-/findings @@ -129,8 +129,7 @@ service SecurityCenter { // This API can only be called with limited frequency for an organization. If // it is called too frequently the caller will receive a TOO_MANY_REQUESTS // error. - rpc RunAssetDiscovery(RunAssetDiscoveryRequest) - returns (google.longrunning.Operation) { + rpc RunAssetDiscovery(RunAssetDiscoveryRequest) returns (google.longrunning.Operation) { option (google.api.http) = { post: "/v1beta1/{parent=organizations/*}/assets:runDiscovery" body: "*" @@ -146,8 +145,7 @@ service SecurityCenter { } // Sets the access control policy on the specified Source. - rpc SetIamPolicy(google.iam.v1.SetIamPolicyRequest) - returns (google.iam.v1.Policy) { + rpc SetIamPolicy(google.iam.v1.SetIamPolicyRequest) returns (google.iam.v1.Policy) { option (google.api.http) = { post: "/v1beta1/{resource=organizations/*/sources/*}:setIamPolicy" body: "*" @@ -155,8 +153,7 @@ service SecurityCenter { } // Returns the permissions that a caller has on the specified source. - rpc TestIamPermissions(google.iam.v1.TestIamPermissionsRequest) - returns (google.iam.v1.TestIamPermissionsResponse) { + rpc TestIamPermissions(google.iam.v1.TestIamPermissionsRequest) returns (google.iam.v1.TestIamPermissionsResponse) { option (google.api.http) = { post: "/v1beta1/{resource=organizations/*/sources/*}:testIamPermissions" body: "*" @@ -173,8 +170,7 @@ service SecurityCenter { } // Updates an organization's settings. - rpc UpdateOrganizationSettings(UpdateOrganizationSettingsRequest) - returns (OrganizationSettings) { + rpc UpdateOrganizationSettings(UpdateOrganizationSettingsRequest) returns (OrganizationSettings) { option (google.api.http) = { patch: "/v1beta1/{organization_settings.name=organizations/*/organizationSettings}" body: "organization_settings" @@ -285,7 +281,6 @@ message GroupAssetsRequest { // // The following fields are supported when compare_duration is not set: // - // * security_center_properties.resource_name // * security_center_properties.resource_project // * security_center_properties.resource_type // * security_center_properties.resource_parent @@ -311,7 +306,7 @@ message GroupAssetsRequest { // compare_duration, but present at reference_time. // * "REMOVED": indicates that the asset was present at the start of // compare_duration, but not present at reference_time. - // * "ACTIVE_AT_BOTH": indicates that the asset was present at both the + // * "ACTIVE": indicates that the asset was present at both the // start and the end of the time period defined by // compare_duration and reference_time. // diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/source.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/source.proto index c732ff08cb2..9dfc9490e9a 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/source.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/source.proto @@ -20,10 +20,12 @@ package google.cloud.securitycenter.v1beta1; import "google/api/annotations.proto"; option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1beta1;securitycenter"; +option java_multiple_files = true; option java_package = "com.google.cloud.securitycenter.v1beta1"; -// Security Center's finding source. A finding source is an entity or a -// mechanism that can produce a finding. A source can also be thought of as a + +// Cloud Security Command Center's (Cloud SCC) finding source. A finding source +// is an entity or a mechanism that can produce a finding. A source is like a // container of findings that come from the same scanner, logger, monitor, etc. message Source { // The relative resource name of this source. See: @@ -33,10 +35,10 @@ message Source { string name = 1; // The source’s display name. - // A source’s display name must be unique amongst its siblings, e.g. - // no two sources with the same parent can share the same display name. + // A source’s display name must be unique amongst its siblings, for example, + // two sources with the same parent can't share the same display name. // The display name must start and end with a letter or digit, may contain - // letters, digits, spaces, hyphens and underscores and can be no longer + // letters, digits, spaces, hyphens, and underscores, and can be no longer // than 30 characters. This is captured by the regular expression: // [\p{L}\p{N}]({\p{L}\p{N}_- ]{0,28}[\p{L}\p{N}])?. string display_name = 2; @@ -44,7 +46,7 @@ message Source { // The description of the source (max of 1024 characters). // Example: // "Cloud Security Scanner is a web security scanner for common - // vulnerabilities in Google App Engine applications. It can automatically + // vulnerabilities in App Engine applications. It can automatically // scan and detect four common vulnerabilities, including cross-site-scripting // (XSS), Flash injection, mixed content (HTTP in HTTPS), and // outdated/insecure libraries." diff --git a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_asset.js b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_asset.js index df79bb7a501..868cb14a848 100644 --- a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_asset.js +++ b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_asset.js @@ -16,12 +16,12 @@ // to be loaded as the JS file. /** - * Security Center's representation of a Google Cloud Platform resource. + * Cloud Security Command Center's (Cloud SCC) representation of a Google Cloud + * Platform (GCP) resource. * - * The Asset is a resource of Security Center that is meant to capture - * information regarding a single Google Cloud Platform resource. All - * modifications to an Asset are only within the context of Security Center and - * do not effect the referenced Google Cloud Platform resource. + * The Asset is a Cloud SCC resource that captures information about a single GCP + * resource. All modifications to an Asset are only within the context of Cloud + * SCC and don't affect the referenced GCP resource. * * @property {string} name * The relative resource name of this asset. See: @@ -30,29 +30,29 @@ * "organizations/123/assets/456". * * @property {Object} securityCenterProperties - * Security Center managed properties. These properties are managed by - * Security Center and cannot be modified by the user. + * Cloud SCC managed properties. These properties are managed by + * Cloud SCC and cannot be modified by the user. * * This object should have the same structure as [SecurityCenterProperties]{@link google.cloud.securitycenter.v1beta1.SecurityCenterProperties} * * @property {Object.} resourceProperties * Resource managed properties. These properties are managed and defined by - * the Google Cloud Platform resource and cannot be modified by the user. + * the GCP resource and cannot be modified by the user. * * @property {Object} securityMarks * User specified security marks. These marks are entirely managed by the user - * and come from the SecurityMarks resource belonging to the asset. + * and come from the SecurityMarks resource that belongs to the asset. * * This object should have the same structure as [SecurityMarks]{@link google.cloud.securitycenter.v1beta1.SecurityMarks} * * @property {Object} createTime - * The time at which the asset was created in Security Center. + * The time at which the asset was created in Cloud SCC. * * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} * * @property {Object} updateTime - * The time at which the asset was last updated, added, or deleted in Security - * Center. + * The time at which the asset was last updated, added, or deleted in Cloud + * SCC. * * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} * @@ -64,18 +64,18 @@ const Asset = { // This is for documentation. Actual contents will be loaded by gRPC. /** - * Security Center managed properties. These properties are managed by - * Security Center and cannot be modified by the user. + * Cloud SCC managed properties. These properties are managed by Cloud SCC and + * cannot be modified by the user. * * @property {string} resourceName - * The full resource name of the Google Cloud Platform resource this asset + * The full resource name of the GCP resource this asset * represents. This field is immutable after create time. See: * https://cloud.google.com/apis/design/resource_names#full_resource_name * * @property {string} resourceType - * The type of the Google Cloud resource. Examples include: APPLICATION, + * The type of the GCP resource. Examples include: APPLICATION, * PROJECT, and ORGANIZATION. This is a case insensitive field defined by - * Security Center and/or the producer of the resource and is immutable + * Cloud SCC and/or the producer of the resource and is immutable * after create time. * * @property {string} resourceParent diff --git a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_finding.js b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_finding.js index f6b6c6157e2..9a6f83719a5 100644 --- a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_finding.js +++ b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_finding.js @@ -16,12 +16,12 @@ // to be loaded as the JS file. /** - * Security Center's finding. + * Cloud Security Command Center (Cloud SCC) finding. * * A finding is a record of assessment data (security, risk, health or privacy) - * ingested into Security Center for presentation, notification, analysis, - * policy testing and enforcement. For example, an XSS vulnerability in an - * AppEngine application is a finding. + * ingested into Cloud SCC for presentation, notification, analysis, + * policy testing, and enforcement. For example, an XSS vulnerability in an + * App Engine application is a finding. * * @property {string} name * The relative resource name of this finding. See: @@ -37,8 +37,8 @@ * "organizations/123/sources/456" * * @property {string} resourceName - * The full resource name of the Google Cloud Platform resource this finding - * is for. See: + * The full resource name of the Google Cloud Platform (GCP) resource this + * finding is for. See: * https://cloud.google.com/apis/design/resource_names#full_resource_name * This field is immutable after creation time. * @@ -53,18 +53,18 @@ * Example: "XSS_FLASH_INJECTION" * * @property {string} externalUri - * The URI that, if available, points to a web page outside of Security Center + * The URI that, if available, points to a web page outside of Cloud SCC * where additional information about the finding can be found. This field is - * guaranteed to be either empty or a well formed url. + * guaranteed to be either empty or a well formed URL. * * @property {Object.} sourceProperties * Source specific properties. These properties are managed by the source - * writing the finding. + * that writes the finding. * * @property {Object} securityMarks * Output only. User specified security marks. These marks are entirely - * managed by the user and come from the SecurityMarks resource belonging to - * the finding. + * managed by the user and come from the SecurityMarks resource that belongs + * to the finding. * * This object should have the same structure as [SecurityMarks]{@link google.cloud.securitycenter.v1beta1.SecurityMarks} * @@ -76,7 +76,7 @@ * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} * * @property {Object} createTime - * The time at which the finding was created in Security Center. + * The time at which the finding was created in Cloud SCC. * * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} * diff --git a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_organization_settings.js b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_organization_settings.js index f71c58c650b..c76981c5e17 100644 --- a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_organization_settings.js +++ b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_organization_settings.js @@ -16,8 +16,8 @@ // to be loaded as the JS file. /** - * User specified settings that are attached to the Security Center - * organization. + * User specified settings that are attached to the Cloud Security Command + * Center (Cloud SCC) organization. * * @property {string} name * The relative resource name of the settings. See: @@ -26,9 +26,9 @@ * "organizations/123/organizationSettings". * * @property {boolean} enableAssetDiscovery - * A flag indicating whether Asset Discovery should be enabled. If the flag is - * set to true then discovery of assets will occur. If it is set to false all - * historical assets will remain but discovery of future assets will not + * A flag that indicates if Asset Discovery should be enabled. If the flag is + * set to `true`, then discovery of assets will occur. If it is set to `false, + * all historical assets will remain, but discovery of future assets will not * occur. * * @property {Object} assetDiscoveryConfig @@ -64,11 +64,12 @@ const OrganizationSettings = { /** * The mode of inclusion when running Asset Discovery. * Asset discovery can be limited by explicitly identifying projects to be - * included or excluded. If INCLUDE_ONLY is set then only those projects - * (within the organization) and their children are discovered during asset - * discovery. If EXCLUDE is set then projects not matching those projects - * are discovered during asset discovery. If neither are set then all - * projects within the organization are discovered during asset discovery. + * included or excluded. If INCLUDE_ONLY is set, then only those projects + * within the organization and their children are discovered during asset + * discovery. If EXCLUDE is set, then projects that don't match those + * projects are discovered during asset discovery. If neither are set, then + * all projects within the organization are discovered during asset + * discovery. * * @enum {number} * @memberof google.cloud.securitycenter.v1beta1 diff --git a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_security_marks.js b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_security_marks.js index 78b29bdf3e1..4612e4c69b2 100644 --- a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_security_marks.js +++ b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_security_marks.js @@ -16,10 +16,10 @@ // to be loaded as the JS file. /** - * User specified security marks that are attached to the parent Security Center - * resource. Security marks are scoped within a Security Center organization -- - * they are modifiable and viewable by all with proper permissions on the - * organization. + * User specified security marks that are attached to the parent Cloud Security + * Command Center (Cloud SCC) resource. Security marks are scoped within a Cloud + * SCC organization -- they can be modified and viewed by all users who have + * proper permissions on the organization. * * @property {string} name * The relative resource name of the SecurityMarks. See: diff --git a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_securitycenter_service.js b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_securitycenter_service.js index 7b8a3360a34..439e338f1a3 100644 --- a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_securitycenter_service.js +++ b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_securitycenter_service.js @@ -136,7 +136,6 @@ const GetSourceRequest = { * * The following fields are supported when compare_duration is not set: * - * * security_center_properties.resource_name * * security_center_properties.resource_project * * security_center_properties.resource_type * * security_center_properties.resource_parent @@ -162,7 +161,7 @@ const GetSourceRequest = { * compare_duration, but present at reference_time. * * "REMOVED": indicates that the asset was present at the start of * compare_duration, but not present at reference_time. - * * "ACTIVE_AT_BOTH": indicates that the asset was present at both the + * * "ACTIVE": indicates that the asset was present at both the * start and the end of the time period defined by * compare_duration and reference_time. * diff --git a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_source.js b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_source.js index 5f9957de073..45f1e645d54 100644 --- a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_source.js +++ b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_source.js @@ -16,8 +16,8 @@ // to be loaded as the JS file. /** - * Security Center's finding source. A finding source is an entity or a - * mechanism that can produce a finding. A source can also be thought of as a + * Cloud Security Command Center's (Cloud SCC) finding source. A finding source + * is an entity or a mechanism that can produce a finding. A source is like a * container of findings that come from the same scanner, logger, monitor, etc. * * @property {string} name @@ -28,10 +28,10 @@ * * @property {string} displayName * The source’s display name. - * A source’s display name must be unique amongst its siblings, e.g. - * no two sources with the same parent can share the same display name. + * A source’s display name must be unique amongst its siblings, for example, + * two sources with the same parent can't share the same display name. * The display name must start and end with a letter or digit, may contain - * letters, digits, spaces, hyphens and underscores and can be no longer + * letters, digits, spaces, hyphens, and underscores, and can be no longer * than 30 characters. This is captured by the regular expression: * [\p{L}\p{N}](https://cloud.google.com{\p{L}\p{N}_- ]{0,28}[\p{L}\p{N}])?. * @@ -39,7 +39,7 @@ * The description of the source (max of 1024 characters). * Example: * "Cloud Security Scanner is a web security scanner for common - * vulnerabilities in Google App Engine applications. It can automatically + * vulnerabilities in App Engine applications. It can automatically * scan and detect four common vulnerabilities, including cross-site-scripting * (XSS), Flash injection, mixed content (HTTP in HTTPS), and * outdated/insecure libraries." diff --git a/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.js b/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.js index f262231163d..2dd509d1c59 100644 --- a/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.js +++ b/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.js @@ -560,7 +560,6 @@ class SecurityCenterClient { * * The following fields are supported when compare_duration is not set: * - * * security_center_properties.resource_name * * security_center_properties.resource_project * * security_center_properties.resource_type * * security_center_properties.resource_parent @@ -613,7 +612,7 @@ class SecurityCenterClient { * compare_duration, but present at reference_time. * * "REMOVED": indicates that the asset was present at the start of * compare_duration, but not present at reference_time. - * * "ACTIVE_AT_BOTH": indicates that the asset was present at both the + * * "ACTIVE": indicates that the asset was present at both the * start and the end of the time period defined by * compare_duration and reference_time. * @@ -750,7 +749,6 @@ class SecurityCenterClient { * * The following fields are supported when compare_duration is not set: * - * * security_center_properties.resource_name * * security_center_properties.resource_project * * security_center_properties.resource_type * * security_center_properties.resource_parent @@ -803,7 +801,7 @@ class SecurityCenterClient { * compare_duration, but present at reference_time. * * "REMOVED": indicates that the asset was present at the start of * compare_duration, but not present at reference_time. - * * "ACTIVE_AT_BOTH": indicates that the asset was present at both the + * * "ACTIVE": indicates that the asset was present at both the * start and the end of the time period defined by * compare_duration and reference_time. * @@ -1432,7 +1430,7 @@ class SecurityCenterClient { } /** - * Lists an organization or source's assets. + * Lists an organization or source's findings. * * To list across all sources provide a `-` as the source id. * Example: /v1beta1/organizations/123/sources/-/findings From fd6ca2c28874945481f6c877d73f8d422c9e520b Mon Sep 17 00:00:00 2001 From: Jonathan Lui Date: Fri, 30 Nov 2018 16:17:38 -0800 Subject: [PATCH 007/342] fix(build): fix system key decryption (#5) --- packages/google-cloud-securitycenter/.circleci/config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-securitycenter/.circleci/config.yml b/packages/google-cloud-securitycenter/.circleci/config.yml index 6735ebdaaa1..86c63432242 100644 --- a/packages/google-cloud-securitycenter/.circleci/config.yml +++ b/packages/google-cloud-securitycenter/.circleci/config.yml @@ -116,7 +116,7 @@ jobs: name: Decrypt credentials. command: | if ! [[ -z "${SYSTEM_TESTS_ENCRYPTION_KEY}" ]]; then - openssl aes-256-cbc -d -in .circleci/key.json.enc \ + openssl aes-256-cbc -d -md md5 -in .circleci/key.json.enc \ -out .circleci/key.json \ -k "${SYSTEM_TESTS_ENCRYPTION_KEY}" fi @@ -148,7 +148,7 @@ jobs: command: | if ! [[ -z "${SYSTEM_TESTS_ENCRYPTION_KEY}" ]]; then for encrypted_key in .circleci/*.json.enc; do - openssl aes-256-cbc -d -in $encrypted_key \ + openssl aes-256-cbc -d -md md5 -in $encrypted_key \ -out $(echo $encrypted_key | sed 's/\.enc//') \ -k "${SYSTEM_TESTS_ENCRYPTION_KEY}" done From 07ad14c07e853d8eb2f44ccfc900b78da42624b0 Mon Sep 17 00:00:00 2001 From: Jonathan Lui Date: Mon, 3 Dec 2018 10:10:56 -0800 Subject: [PATCH 008/342] add dummy no test yet file to system test and samples test dirs --- packages/google-cloud-securitycenter/system-test/no-test.js | 1 + 1 file changed, 1 insertion(+) create mode 100644 packages/google-cloud-securitycenter/system-test/no-test.js diff --git a/packages/google-cloud-securitycenter/system-test/no-test.js b/packages/google-cloud-securitycenter/system-test/no-test.js new file mode 100644 index 00000000000..ed54b008e0c --- /dev/null +++ b/packages/google-cloud-securitycenter/system-test/no-test.js @@ -0,0 +1 @@ +console.log('no tests yet'); From d5a5fc114a862afb875ce9d8fc7ab529c7876f44 Mon Sep 17 00:00:00 2001 From: Jonathan Lui Date: Mon, 3 Dec 2018 11:01:19 -0800 Subject: [PATCH 009/342] build: add encrypted key (#8) --- .../.circleci/key.json.enc | Bin 0 -> 2352 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 packages/google-cloud-securitycenter/.circleci/key.json.enc diff --git a/packages/google-cloud-securitycenter/.circleci/key.json.enc b/packages/google-cloud-securitycenter/.circleci/key.json.enc new file mode 100644 index 0000000000000000000000000000000000000000..f44a58d71836b6b2d7e5f10671736830062705b4 GIT binary patch literal 2352 zcmV-03D5RZVQh3|WM5yK`O*QxmOAz^NI-L~l_t7FZesR!&_Gt~RV$-gEl0+*u7~bp05)+ z?i@{6HmdQf$#r3m_ky-wzY8~>K4zW`-+ZEaL;mZFc~+R~4{z{lJooRp2G}C3wH>B8 zEGkp{JSFo*{98#Ch`~C%N`NHb{nZ!v%h*^4Kfx+l>O3!-5<+4ZbPyIK@K6R>xXshq z2w9S8wqCHA4@fFzs$p`=XwKG@g(ikdqZGXTos1w`jl=0pxdeoJ0tG}(Fwk8W91}}Z zuq}TGNIT_P6*XpMg0oyDIv&K(V_WC-3&)_pNG8S@k!I=0#jR~WGldaVM(WutpNZ|# zTjb!z4qUGqs(ma3pqMBo7a+4Yg~ZES*+A%r$h?#}|AX!FE{an@h6m=5F>t`IbTmt1 zL6c3mM?W2kRB{;CG=9~jbxy^|c~ss5Lks;~g94va7Y7M-t}w#$bpz-9MnH7g45s}= z>RSA}L^H*mY+i^1Z8o?xg!`KQa;X)1u?i6~q_K{P^=Kg{N#rKov`@s)%G)n($2NRy$2>=E-%ZO8 z69;+8P0aOF=bmsQrWq`raEo6WT>%9#^tA;WqRcc-HfXj(3LmW|1&P6|pm3Pg6CY;E zHaG?xM^GOlq)x9ad*Gd5y!I{fhCb%Z+L0?u9h!Xdb(mRANR}Y|E8C(GbZGO##vZX{ zg(0CTr3F%yi~wk_L2AE5PKWf>JT0GDMAgcu(xzxTn?lIV;_YTMN_PsGoNY@1R?Tdo z4?dZci>ykORZUv;QWYe39;%Z4heIVmG}OE*RG&=X@}4YzrbR(nu4K7{<3@ELcd|`}s5Z4+?<$q_0gy^!MXO0dfK+WKx?aePdmJoRQj_GWv zo^}6pZ%yuv(0_9AIn|ZZY-(PcHyPHiwH5PQ)W3C%4n+WXI41@#S*GFU%)`VN>xC^vkh`Llku#=^*yyMhiM=R3&_u?Vt$o1&7_vUAEvXx2Q z!qPIGex!xh2pttycJ!%CGQ_UD`>0v*UjI-?u~c4RoKmu(DU2a}_n`2z56f8{qQBzS z@3X*ser)l6?e%TUr$o4HahbL;&{vO^ikf62)sily?JqE>!i(GzY{(S^IuDws(c<#A z6%c1dLJ_oPvYZz8vP_jG^!P9MSMKKOgS2Q#X@haIHf7Z598{5xcnbhMknY9^<-RUF z7YU-wjkWqN$f8X@f=?Y9#D+N~VCbzYvgOOw`TR`IylOOit)pk#C8}3=$AH@`Tw_jf z^D>$|OdXR2%r^&zPMxJ{iEhLD}Ra&R(N*tqep1C>H`AiLf-2#}AXXo?s z#H_*43+0sf7-P>2=6w}|L61GTs=StLaX>fVIhqK8AE30XM-M-~Ssw};2plTOk=0p+A4fl`rUZ;}1UYc(X6Etw zuETxcBHT%L(Xkf<9$Wp6umU3T2gQf%f8lPKHx7|9>75A&l!Qqo*q?DowQT;uSk@AR zAnVN2IS5((wy_P&cHZvY>DKbqh@}>WBU*f89M+6pMzG_OA!b{RNpabl@8|VUtVn`6 znsho+dTXo-`9xz#>rQGjeYk0$EF9?SyZT8)3Pw7_Z#9m+x@TX>f@Is$)^v?|e=J!B z6rPrh_0>V*?2rN82E8qOGbcxSuKm#?cz`mR(?E{i;Z1%GOJIB`BI@Msz8V4Cfx*@O zfX#IJA^^rAV?9W50Xl0$x@k!Xb^EetDIZD1<|t>FLm|*2{Wtc^(y0_3SNxy&7vKXN zL~Le_=^d9*$WFZQDdwDhyNp{!-0OS}QOY5NXP{8TOANm{;< z{SHfI2$acp4R{wLC{v%6K3XHLQzmtL&BDnM#UVR|<_;R@lmyH5bFtAf2lJk?pn_&w@p&Q?zre>`tJ9`Lb0lxZL^C%1QUiNe-<9cOE0UAc zQkVd37rciH(AP|2sjt zjPuYXGOF;Wi6L5X*yuhysWIG1|E}T2W$gwX0*0%xC>g$v8{)aES2D8=29(UN0qWGZ zvm}`A)g&J*@~Smil1Rbz!vmZzdpGeRU9Et)0T#m`SS#zO!%GO@23U7chKkUaB3j6y W`jC4YdTKOxG`92c0ZW*e6_iGF!;uyM literal 0 HcmV?d00001 From 588935fa962389cdb98fc974e983f483d8b7e6d8 Mon Sep 17 00:00:00 2001 From: Jonathan Lui Date: Mon, 3 Dec 2018 11:16:04 -0800 Subject: [PATCH 010/342] feat: release v0.1.0 (#9) --- .../google-cloud-securitycenter/CHANGELOG.md | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 packages/google-cloud-securitycenter/CHANGELOG.md diff --git a/packages/google-cloud-securitycenter/CHANGELOG.md b/packages/google-cloud-securitycenter/CHANGELOG.md new file mode 100644 index 00000000000..b15b4b432e5 --- /dev/null +++ b/packages/google-cloud-securitycenter/CHANGELOG.md @@ -0,0 +1,23 @@ +# Changelog + +[npm history][1] + +[1]: https://www.npmjs.com/package/@google-cloud/security-center?activeTab=versions + +## v0.1.0 + +This is the initial release of the Cloud Security Center API Node.js client library. + +### Documentation +- docs: sync protos comment changes + +### Internal / Testing Changes +- build: add encrypted key ([#8](https://github.com/googleapis/nodejs-security-center/pull/8)) +- add dummy no test yet file to system test and samples test dirs +- chore(build): Configure Renovate ([#6](https://github.com/googleapis/nodejs-security-center/pull/6)) +- fix(build): fix system key decryption ([#5](https://github.com/googleapis/nodejs-security-center/pull/5)) +- refactor: fix lint rules and make consistent ([#1](https://github.com/googleapis/nodejs-security-center/pull/1)) +- remove CONTRIBUTORS +- license header on npm-install-retry +- add more scaffolding + From be988e769a582ff517b3221a15ccaef877c70ed5 Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Mon, 3 Dec 2018 15:33:45 -0800 Subject: [PATCH 011/342] docs: update readme badges (#11) --- packages/google-cloud-securitycenter/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-securitycenter/README.md b/packages/google-cloud-securitycenter/README.md index b5873778f06..09ac272271f 100644 --- a/packages/google-cloud-securitycenter/README.md +++ b/packages/google-cloud-securitycenter/README.md @@ -5,8 +5,7 @@ # [Google Cloud Security Command Center: Node.js Client](https://github.com/googleapis/nodejs-security-center) [![release level](https://img.shields.io/badge/release%20level-beta-yellow.svg?style=flat)](https://cloud.google.com/terms/launch-stages) -[![CircleCI](https://img.shields.io/circleci/project/github/googleapis/nodejs-security-center.svg?style=flat)](https://circleci.com/gh/googleapis/nodejs-security-center) -[![AppVeyor](https://ci.appveyor.com/api/projects/status/github/googleapis/nodejs-security-center?branch=master&svg=true)](https://ci.appveyor.com/project/googleapis/nodejs-security-center) +[![npm version](https://img.shields.io/npm/v/@google-cloud/security-center.svg)](https://www.npmjs.org/package/@google-cloud/security-center) [![codecov](https://img.shields.io/codecov/c/github/googleapis/nodejs-security-center/master.svg?style=flat)](https://codecov.io/gh/googleapis/nodejs-security-center) [Cloud Security Command Center](https://cloud.google.com/security-center/docs/) helps security teams gather data, identify threats, and act on them before they result in business damage or loss. It offers deep insight into application and data risk so that you can quickly mitigate threats to your cloud resources and evaluate overall health. With Cloud Security Command Center, you can view and monitor an inventory of your cloud assets, scan storage systems for sensitive data, detect common web vulnerabilities, and review access rights to your critical resources, all from a single, centralized dashboard. @@ -82,3 +81,4 @@ Google APIs Client Libraries, in [Client Libraries Explained][explained]. [billing]: https://support.google.com/cloud/answer/6293499#enable-billing [enable_api]: https://console.cloud.google.com/flows/enableapi?apiid= [auth]: https://cloud.google.com/docs/authentication/getting-started + From 50b6d042a6b59442d105cf7823df551d9f012e07 Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Wed, 5 Dec 2018 15:56:52 -0800 Subject: [PATCH 012/342] chore: nyc ignore build/test by default (#14) --- packages/google-cloud-securitycenter/.nycrc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/google-cloud-securitycenter/.nycrc b/packages/google-cloud-securitycenter/.nycrc index a1a8e6920ce..feb032400d4 100644 --- a/packages/google-cloud-securitycenter/.nycrc +++ b/packages/google-cloud-securitycenter/.nycrc @@ -3,7 +3,8 @@ "exclude": [ "src/*{/*,/**/*}.js", "src/*/v*/*.js", - "test/**/*.js" + "test/**/*.js", + "build/test" ], "watermarks": { "branches": [ From 6abb661e943e95214e702563154ff9bfa0c508b9 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" Date: Thu, 6 Dec 2018 15:35:01 -0800 Subject: [PATCH 013/342] chore(deps): update dependency @google-cloud/nodejs-repo-tools to v3 (#12) --- packages/google-cloud-securitycenter/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-securitycenter/package.json b/packages/google-cloud-securitycenter/package.json index 7de07dbe1e3..391db08b92f 100644 --- a/packages/google-cloud-securitycenter/package.json +++ b/packages/google-cloud-securitycenter/package.json @@ -43,7 +43,7 @@ "protobufjs": "^6.8.0" }, "devDependencies": { - "@google-cloud/nodejs-repo-tools": "^2.3.5", + "@google-cloud/nodejs-repo-tools": "^3.0.0", "codecov": "^3.0.0", "eslint": "^5.0.0", "eslint-config-prettier": "^3.0.0", From 34cf89620e21b7221da0b5352794f3b080cbdc5c Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot <44816363+yoshi-automation@users.noreply.github.com> Date: Sat, 8 Dec 2018 07:15:17 -0800 Subject: [PATCH 014/342] chore: add synth.metadata (#17) chore: add synth.metadata --- .../synth.metadata | 39 +++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 packages/google-cloud-securitycenter/synth.metadata diff --git a/packages/google-cloud-securitycenter/synth.metadata b/packages/google-cloud-securitycenter/synth.metadata new file mode 100644 index 00000000000..8d4dfd1b522 --- /dev/null +++ b/packages/google-cloud-securitycenter/synth.metadata @@ -0,0 +1,39 @@ +{ + "updateTime": "2018-12-08T12:21:42.100694Z", + "sources": [ + { + "generator": { + "name": "artman", + "version": "0.16.2", + "dockerImage": "googleapis/artman@sha256:2f6b261ee7fe1aedf238991c93a20b3820de37a343d0cacf3e3e9555c2aaf2ea" + } + }, + { + "git": { + "name": "googleapis", + "remote": "https://github.com/googleapis/googleapis.git", + "sha": "6f6505a69b2b0a1260c93e890d636eefb859e76e", + "internalRef": "224530961" + } + }, + { + "template": { + "name": "node_library", + "origin": "synthtool.gcp", + "version": "2018.12.6" + } + } + ], + "destinations": [ + { + "client": { + "source": "googleapis", + "apiName": "securitycenter", + "apiVersion": "v1beta1", + "language": "nodejs", + "generator": "gapic", + "config": "google/cloud/securitycenter/artman_securitycenter_v1beta1.yaml" + } + } + ] +} \ No newline at end of file From 990d9b5ea4f1681bfa84f11e82fac66037a30832 Mon Sep 17 00:00:00 2001 From: Jonathan Lui Date: Mon, 10 Dec 2018 13:36:45 -0800 Subject: [PATCH 015/342] build: add Kokoro configs for autorelease (#18) * build: add Kokoro configs for autorelease * build: add Kokoro configs for autorelease * chore: remove CircleCI config --- .../.circleci/config.yml | 179 ------------------ .../.circleci/key.json.enc | Bin 2352 -> 0 bytes .../.circleci/npm-install-retry.js | 60 ------ 3 files changed, 239 deletions(-) delete mode 100644 packages/google-cloud-securitycenter/.circleci/config.yml delete mode 100644 packages/google-cloud-securitycenter/.circleci/key.json.enc delete mode 100755 packages/google-cloud-securitycenter/.circleci/npm-install-retry.js diff --git a/packages/google-cloud-securitycenter/.circleci/config.yml b/packages/google-cloud-securitycenter/.circleci/config.yml deleted file mode 100644 index 86c63432242..00000000000 --- a/packages/google-cloud-securitycenter/.circleci/config.yml +++ /dev/null @@ -1,179 +0,0 @@ -version: 2 -workflows: - version: 2 - tests: - jobs: &workflow_jobs - - node6: - filters: &all_commits - tags: - only: /.*/ - - node8: - filters: *all_commits - - node10: - filters: *all_commits - - lint: - requires: - - node6 - - node8 - - node10 - filters: *all_commits - - docs: - requires: - - node6 - - node8 - - node10 - filters: *all_commits - - system_tests: - requires: - - lint - - docs - filters: &master_and_releases - branches: - only: master - tags: &releases - only: '/^v[\d.]+$/' - - sample_tests: - requires: - - lint - - docs - filters: *master_and_releases - - publish_npm: - requires: - - system_tests - - sample_tests - filters: - branches: - ignore: /.*/ - tags: *releases - nightly: - triggers: - - schedule: - cron: 0 7 * * * - filters: - branches: - only: master - jobs: *workflow_jobs -jobs: - node6: - docker: - - image: 'node:6' - user: node - steps: &unit_tests_steps - - checkout - - run: &npm_install_and_link - name: Install and link the module - command: |- - mkdir -p /home/node/.npm-global - ./.circleci/npm-install-retry.js - environment: - NPM_CONFIG_PREFIX: /home/node/.npm-global - - run: npm test - node8: - docker: - - image: 'node:8' - user: node - steps: *unit_tests_steps - node10: - docker: - - image: 'node:10' - user: node - steps: *unit_tests_steps - lint: - docker: - - image: 'node:8' - user: node - steps: - - checkout - - run: *npm_install_and_link - - run: &samples_npm_install_and_link - name: Link the module being tested to the samples. - command: | - cd samples/ - npm link ../ - ./../.circleci/npm-install-retry.js - environment: - NPM_CONFIG_PREFIX: /home/node/.npm-global - - run: - name: Run linting. - command: npm run lint - environment: - NPM_CONFIG_PREFIX: /home/node/.npm-global - docs: - docker: - - image: 'node:8' - user: node - steps: - - checkout - - run: *npm_install_and_link - - run: npm run docs - sample_tests: - docker: - - image: 'node:8' - user: node - steps: - - checkout - - run: - name: Decrypt credentials. - command: | - if ! [[ -z "${SYSTEM_TESTS_ENCRYPTION_KEY}" ]]; then - openssl aes-256-cbc -d -md md5 -in .circleci/key.json.enc \ - -out .circleci/key.json \ - -k "${SYSTEM_TESTS_ENCRYPTION_KEY}" - fi - - run: *npm_install_and_link - - run: *samples_npm_install_and_link - - run: - name: Run sample tests. - command: npm run samples-test - environment: - GCLOUD_PROJECT: long-door-651 - GOOGLE_APPLICATION_CREDENTIALS: /home/node/samples/.circleci/key.json - NPM_CONFIG_PREFIX: /home/node/.npm-global - - run: - name: Remove unencrypted key. - command: | - if ! [[ -z "${SYSTEM_TESTS_ENCRYPTION_KEY}" ]]; then - rm .circleci/key.json - fi - when: always - working_directory: /home/node/samples/ - system_tests: - docker: - - image: 'node:8' - user: node - steps: - - checkout - - run: - name: Decrypt credentials. - command: | - if ! [[ -z "${SYSTEM_TESTS_ENCRYPTION_KEY}" ]]; then - for encrypted_key in .circleci/*.json.enc; do - openssl aes-256-cbc -d -md md5 -in $encrypted_key \ - -out $(echo $encrypted_key | sed 's/\.enc//') \ - -k "${SYSTEM_TESTS_ENCRYPTION_KEY}" - done - fi - - run: *npm_install_and_link - - run: - name: Run system tests. - command: npm run system-test - environment: - GCLOUD_PROJECT: long-door-651 - GOOGLE_APPLICATION_CREDENTIALS: /home/node/project/.circleci/key.json - NPM_CONFIG_PREFIX: /home/node/.npm-global - - run: - name: Remove unencrypted key. - command: | - if ! [[ -z "${SYSTEM_TESTS_ENCRYPTION_KEY}" ]]; then - rm .circleci/*.json - fi - when: always - publish_npm: - docker: - - image: 'node:8' - user: node - steps: - - checkout - - run: ./.circleci/npm-install-retry.js - - run: echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc - - run: npm publish --access=public diff --git a/packages/google-cloud-securitycenter/.circleci/key.json.enc b/packages/google-cloud-securitycenter/.circleci/key.json.enc deleted file mode 100644 index f44a58d71836b6b2d7e5f10671736830062705b4..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2352 zcmV-03D5RZVQh3|WM5yK`O*QxmOAz^NI-L~l_t7FZesR!&_Gt~RV$-gEl0+*u7~bp05)+ z?i@{6HmdQf$#r3m_ky-wzY8~>K4zW`-+ZEaL;mZFc~+R~4{z{lJooRp2G}C3wH>B8 zEGkp{JSFo*{98#Ch`~C%N`NHb{nZ!v%h*^4Kfx+l>O3!-5<+4ZbPyIK@K6R>xXshq z2w9S8wqCHA4@fFzs$p`=XwKG@g(ikdqZGXTos1w`jl=0pxdeoJ0tG}(Fwk8W91}}Z zuq}TGNIT_P6*XpMg0oyDIv&K(V_WC-3&)_pNG8S@k!I=0#jR~WGldaVM(WutpNZ|# zTjb!z4qUGqs(ma3pqMBo7a+4Yg~ZES*+A%r$h?#}|AX!FE{an@h6m=5F>t`IbTmt1 zL6c3mM?W2kRB{;CG=9~jbxy^|c~ss5Lks;~g94va7Y7M-t}w#$bpz-9MnH7g45s}= z>RSA}L^H*mY+i^1Z8o?xg!`KQa;X)1u?i6~q_K{P^=Kg{N#rKov`@s)%G)n($2NRy$2>=E-%ZO8 z69;+8P0aOF=bmsQrWq`raEo6WT>%9#^tA;WqRcc-HfXj(3LmW|1&P6|pm3Pg6CY;E zHaG?xM^GOlq)x9ad*Gd5y!I{fhCb%Z+L0?u9h!Xdb(mRANR}Y|E8C(GbZGO##vZX{ zg(0CTr3F%yi~wk_L2AE5PKWf>JT0GDMAgcu(xzxTn?lIV;_YTMN_PsGoNY@1R?Tdo z4?dZci>ykORZUv;QWYe39;%Z4heIVmG}OE*RG&=X@}4YzrbR(nu4K7{<3@ELcd|`}s5Z4+?<$q_0gy^!MXO0dfK+WKx?aePdmJoRQj_GWv zo^}6pZ%yuv(0_9AIn|ZZY-(PcHyPHiwH5PQ)W3C%4n+WXI41@#S*GFU%)`VN>xC^vkh`Llku#=^*yyMhiM=R3&_u?Vt$o1&7_vUAEvXx2Q z!qPIGex!xh2pttycJ!%CGQ_UD`>0v*UjI-?u~c4RoKmu(DU2a}_n`2z56f8{qQBzS z@3X*ser)l6?e%TUr$o4HahbL;&{vO^ikf62)sily?JqE>!i(GzY{(S^IuDws(c<#A z6%c1dLJ_oPvYZz8vP_jG^!P9MSMKKOgS2Q#X@haIHf7Z598{5xcnbhMknY9^<-RUF z7YU-wjkWqN$f8X@f=?Y9#D+N~VCbzYvgOOw`TR`IylOOit)pk#C8}3=$AH@`Tw_jf z^D>$|OdXR2%r^&zPMxJ{iEhLD}Ra&R(N*tqep1C>H`AiLf-2#}AXXo?s z#H_*43+0sf7-P>2=6w}|L61GTs=StLaX>fVIhqK8AE30XM-M-~Ssw};2plTOk=0p+A4fl`rUZ;}1UYc(X6Etw zuETxcBHT%L(Xkf<9$Wp6umU3T2gQf%f8lPKHx7|9>75A&l!Qqo*q?DowQT;uSk@AR zAnVN2IS5((wy_P&cHZvY>DKbqh@}>WBU*f89M+6pMzG_OA!b{RNpabl@8|VUtVn`6 znsho+dTXo-`9xz#>rQGjeYk0$EF9?SyZT8)3Pw7_Z#9m+x@TX>f@Is$)^v?|e=J!B z6rPrh_0>V*?2rN82E8qOGbcxSuKm#?cz`mR(?E{i;Z1%GOJIB`BI@Msz8V4Cfx*@O zfX#IJA^^rAV?9W50Xl0$x@k!Xb^EetDIZD1<|t>FLm|*2{Wtc^(y0_3SNxy&7vKXN zL~Le_=^d9*$WFZQDdwDhyNp{!-0OS}QOY5NXP{8TOANm{;< z{SHfI2$acp4R{wLC{v%6K3XHLQzmtL&BDnM#UVR|<_;R@lmyH5bFtAf2lJk?pn_&w@p&Q?zre>`tJ9`Lb0lxZL^C%1QUiNe-<9cOE0UAc zQkVd37rciH(AP|2sjt zjPuYXGOF;Wi6L5X*yuhysWIG1|E}T2W$gwX0*0%xC>g$v8{)aES2D8=29(UN0qWGZ zvm}`A)g&J*@~Smil1Rbz!vmZzdpGeRU9Et)0T#m`SS#zO!%GO@23U7chKkUaB3j6y W`jC4YdTKOxG`92c0ZW*e6_iGF!;uyM diff --git a/packages/google-cloud-securitycenter/.circleci/npm-install-retry.js b/packages/google-cloud-securitycenter/.circleci/npm-install-retry.js deleted file mode 100755 index 3240aa2cbf2..00000000000 --- a/packages/google-cloud-securitycenter/.circleci/npm-install-retry.js +++ /dev/null @@ -1,60 +0,0 @@ -#!/usr/bin/env node - -let spawn = require('child_process').spawn; - -// -//USE: ./index.js [... NPM ARGS] -// - -let timeout = process.argv[2] || process.env.NPM_INSTALL_TIMEOUT || 60000; -let attempts = process.argv[3] || 3; -let args = process.argv.slice(4); -if (args.length === 0) { - args = ['install']; -} - -(function npm() { - let timer; - args.push('--verbose'); - let proc = spawn('npm', args); - proc.stdout.pipe(process.stdout); - proc.stderr.pipe(process.stderr); - proc.stdin.end(); - proc.stdout.on('data', () => { - setTimer(); - }); - proc.stderr.on('data', () => { - setTimer(); - }); - - // side effect: this also restarts when npm exits with a bad code even if it - // didnt timeout - proc.on('close', (code, signal) => { - clearTimeout(timer); - if (code || signal) { - console.log('[npm-are-you-sleeping] npm exited with code ' + code + ''); - - if (--attempts) { - console.log('[npm-are-you-sleeping] restarting'); - npm(); - } else { - console.log('[npm-are-you-sleeping] i tried lots of times. giving up.'); - throw new Error("npm install fails"); - } - } - }); - - function setTimer() { - clearTimeout(timer); - timer = setTimeout(() => { - console.log('[npm-are-you-sleeping] killing npm with SIGTERM'); - proc.kill('SIGTERM'); - // wait a couple seconds - timer = setTimeout(() => { - // its it's still not closed sigkill - console.log('[npm-are-you-sleeping] killing npm with SIGKILL'); - proc.kill('SIGKILL'); - }, 2000); - }, timeout); - } -})(); From 9f5a74164db800cf31dabf5cdfb224a42eb01c46 Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Tue, 11 Dec 2018 10:36:46 -0800 Subject: [PATCH 016/342] chore: update nyc and eslint configs (#22) --- packages/google-cloud-securitycenter/.eslintignore | 1 + packages/google-cloud-securitycenter/.nycrc | 1 + 2 files changed, 2 insertions(+) diff --git a/packages/google-cloud-securitycenter/.eslintignore b/packages/google-cloud-securitycenter/.eslintignore index 2f642cb6044..f0c7aead4bf 100644 --- a/packages/google-cloud-securitycenter/.eslintignore +++ b/packages/google-cloud-securitycenter/.eslintignore @@ -1,3 +1,4 @@ **/node_modules src/**/doc/* build/ +docs/ diff --git a/packages/google-cloud-securitycenter/.nycrc b/packages/google-cloud-securitycenter/.nycrc index feb032400d4..88b001cb587 100644 --- a/packages/google-cloud-securitycenter/.nycrc +++ b/packages/google-cloud-securitycenter/.nycrc @@ -1,5 +1,6 @@ { "report-dir": "./.coverage", + "reporter": "lcov", "exclude": [ "src/*{/*,/**/*}.js", "src/*/v*/*.js", From 0a56b6b79a1daa9890e1c5b9b33788c6041ab93a Mon Sep 17 00:00:00 2001 From: Jonathan Lui Date: Wed, 2 Jan 2019 13:54:35 -0800 Subject: [PATCH 017/342] fix(docs): fix require module in samples (#26) * fix(docs): fix require module * fix module * reverty --- .../google-cloud-securitycenter/src/index.js | 2 +- .../v1beta1/doc/google/iam/v1/doc_policy.js | 44 --------- .../doc/google/longrunning/doc_operations.js | 84 ----------------- .../src/v1beta1/security_center_client.js | 92 +++++++++---------- .../test/gapic-v1beta1.js | 76 +++++++-------- 5 files changed, 85 insertions(+), 213 deletions(-) diff --git a/packages/google-cloud-securitycenter/src/index.js b/packages/google-cloud-securitycenter/src/index.js index d5a3c9e3946..6db8e961e14 100644 --- a/packages/google-cloud-securitycenter/src/index.js +++ b/packages/google-cloud-securitycenter/src/index.js @@ -42,7 +42,7 @@ const gapic = Object.freeze({ * - `SecurityCenterClient` - Reference to * {@link v1beta1.SecurityCenterClient} * - * @module {object} securitycenter + * @module {object} @google-cloud/securitycenter * @alias nodejs-securitycenter * * @example Install the client library with npm: diff --git a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/iam/v1/doc_policy.js b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/iam/v1/doc_policy.js index 59fca18810c..5e7237e0fa9 100644 --- a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/iam/v1/doc_policy.js +++ b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/iam/v1/doc_policy.js @@ -115,48 +115,4 @@ const Policy = { */ const Binding = { // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * The difference delta between two policies. - * - * @property {Object[]} bindingDeltas - * The delta for Bindings between two policies. - * - * This object should have the same structure as [BindingDelta]{@link google.iam.v1.BindingDelta} - * - * @typedef PolicyDelta - * @memberof google.iam.v1 - * @see [google.iam.v1.PolicyDelta definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/iam/v1/policy.proto} - */ -const PolicyDelta = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * One delta entry for Binding. Each individual change (only one member in each - * entry) to a binding will be a separate entry. - * - * @property {number} action - * The action that was performed on a Binding. - * Required - * - * The number should be among the values of [Action]{@link google.iam.v1.Action} - * - * @property {string} role - * Role that is assigned to `members`. - * For example, `roles/viewer`, `roles/editor`, or `roles/owner`. - * Required - * - * @property {string} member - * A single identity requesting access for a Cloud Platform resource. - * Follows the same format of Binding.members. - * Required - * - * @typedef BindingDelta - * @memberof google.iam.v1 - * @see [google.iam.v1.BindingDelta definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/iam/v1/policy.proto} - */ -const BindingDelta = { - // This is for documentation. Actual contents will be loaded by gRPC. }; \ No newline at end of file diff --git a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/longrunning/doc_operations.js b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/longrunning/doc_operations.js index 4af5d7d3574..e6dd81d4eea 100644 --- a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/longrunning/doc_operations.js +++ b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/longrunning/doc_operations.js @@ -60,88 +60,4 @@ */ const Operation = { // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * The request message for Operations.GetOperation. - * - * @property {string} name - * The name of the operation resource. - * - * @typedef GetOperationRequest - * @memberof google.longrunning - * @see [google.longrunning.GetOperationRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/longrunning/operations.proto} - */ -const GetOperationRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * The request message for Operations.ListOperations. - * - * @property {string} name - * The name of the operation collection. - * - * @property {string} filter - * The standard list filter. - * - * @property {number} pageSize - * The standard list page size. - * - * @property {string} pageToken - * The standard list page token. - * - * @typedef ListOperationsRequest - * @memberof google.longrunning - * @see [google.longrunning.ListOperationsRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/longrunning/operations.proto} - */ -const ListOperationsRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * The response message for Operations.ListOperations. - * - * @property {Object[]} operations - * A list of operations that matches the specified filter in the request. - * - * This object should have the same structure as [Operation]{@link google.longrunning.Operation} - * - * @property {string} nextPageToken - * The standard List next-page token. - * - * @typedef ListOperationsResponse - * @memberof google.longrunning - * @see [google.longrunning.ListOperationsResponse definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/longrunning/operations.proto} - */ -const ListOperationsResponse = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * The request message for Operations.CancelOperation. - * - * @property {string} name - * The name of the operation resource to be cancelled. - * - * @typedef CancelOperationRequest - * @memberof google.longrunning - * @see [google.longrunning.CancelOperationRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/longrunning/operations.proto} - */ -const CancelOperationRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * The request message for Operations.DeleteOperation. - * - * @property {string} name - * The name of the operation resource to be deleted. - * - * @typedef DeleteOperationRequest - * @memberof google.longrunning - * @see [google.longrunning.DeleteOperationRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/longrunning/operations.proto} - */ -const DeleteOperationRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. }; \ No newline at end of file diff --git a/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.js b/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.js index 2dd509d1c59..aabb5ad52f1 100644 --- a/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.js +++ b/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.js @@ -302,9 +302,9 @@ class SecurityCenterClient { * * @example * - * const securitycenter = require('securitycenter.v1beta1'); + * const securityCenter = require('@google-cloud/security-center'); * - * const client = new securitycenter.v1beta1.SecurityCenterClient({ + * const client = new securityCenter.v1beta1.SecurityCenterClient({ * // optional auth parameters. * }); * @@ -364,9 +364,9 @@ class SecurityCenterClient { * * @example * - * const securitycenter = require('securitycenter.v1beta1'); + * const securityCenter = require('@google-cloud/security-center'); * - * const client = new securitycenter.v1beta1.SecurityCenterClient({ + * const client = new securityCenter.v1beta1.SecurityCenterClient({ * // optional auth parameters. * }); * @@ -419,9 +419,9 @@ class SecurityCenterClient { * * @example * - * const securitycenter = require('securitycenter.v1beta1'); + * const securityCenter = require('@google-cloud/security-center'); * - * const client = new securitycenter.v1beta1.SecurityCenterClient({ + * const client = new securityCenter.v1beta1.SecurityCenterClient({ * // optional auth parameters. * }); * @@ -466,9 +466,9 @@ class SecurityCenterClient { * * @example * - * const securitycenter = require('securitycenter.v1beta1'); + * const securityCenter = require('@google-cloud/security-center'); * - * const client = new securitycenter.v1beta1.SecurityCenterClient({ + * const client = new securityCenter.v1beta1.SecurityCenterClient({ * // optional auth parameters. * }); * @@ -517,9 +517,9 @@ class SecurityCenterClient { * * @example * - * const securitycenter = require('securitycenter.v1beta1'); + * const securityCenter = require('@google-cloud/security-center'); * - * const client = new securitycenter.v1beta1.SecurityCenterClient({ + * const client = new securityCenter.v1beta1.SecurityCenterClient({ * // optional auth parameters. * }); * @@ -657,9 +657,9 @@ class SecurityCenterClient { * * @example * - * const securitycenter = require('securitycenter.v1beta1'); + * const securityCenter = require('@google-cloud/security-center'); * - * const client = new securitycenter.v1beta1.SecurityCenterClient({ + * const client = new securityCenter.v1beta1.SecurityCenterClient({ * // optional auth parameters. * }); * @@ -829,9 +829,9 @@ class SecurityCenterClient { * * @example * - * const securitycenter = require('securitycenter.v1beta1'); + * const securityCenter = require('@google-cloud/security-center'); * - * const client = new securitycenter.v1beta1.SecurityCenterClient({ + * const client = new securityCenter.v1beta1.SecurityCenterClient({ * // optional auth parameters. * }); * @@ -948,9 +948,9 @@ class SecurityCenterClient { * * @example * - * const securitycenter = require('securitycenter.v1beta1'); + * const securityCenter = require('@google-cloud/security-center'); * - * const client = new securitycenter.v1beta1.SecurityCenterClient({ + * const client = new securityCenter.v1beta1.SecurityCenterClient({ * // optional auth parameters. * }); * @@ -1093,9 +1093,9 @@ class SecurityCenterClient { * * @example * - * const securitycenter = require('securitycenter.v1beta1'); + * const securityCenter = require('@google-cloud/security-center'); * - * const client = new securitycenter.v1beta1.SecurityCenterClient({ + * const client = new securityCenter.v1beta1.SecurityCenterClient({ * // optional auth parameters. * }); * @@ -1239,9 +1239,9 @@ class SecurityCenterClient { * * @example * - * const securitycenter = require('securitycenter.v1beta1'); + * const securityCenter = require('@google-cloud/security-center'); * - * const client = new securitycenter.v1beta1.SecurityCenterClient({ + * const client = new securityCenter.v1beta1.SecurityCenterClient({ * // optional auth parameters. * }); * @@ -1405,9 +1405,9 @@ class SecurityCenterClient { * * @example * - * const securitycenter = require('securitycenter.v1beta1'); + * const securityCenter = require('@google-cloud/security-center'); * - * const client = new securitycenter.v1beta1.SecurityCenterClient({ + * const client = new securityCenter.v1beta1.SecurityCenterClient({ * // optional auth parameters. * }); * @@ -1522,9 +1522,9 @@ class SecurityCenterClient { * * @example * - * const securitycenter = require('securitycenter.v1beta1'); + * const securityCenter = require('@google-cloud/security-center'); * - * const client = new securitycenter.v1beta1.SecurityCenterClient({ + * const client = new securityCenter.v1beta1.SecurityCenterClient({ * // optional auth parameters. * }); * @@ -1661,9 +1661,9 @@ class SecurityCenterClient { * * @example * - * const securitycenter = require('securitycenter.v1beta1'); + * const securityCenter = require('@google-cloud/security-center'); * - * const client = new securitycenter.v1beta1.SecurityCenterClient({ + * const client = new securityCenter.v1beta1.SecurityCenterClient({ * // optional auth parameters. * }); * @@ -1724,9 +1724,9 @@ class SecurityCenterClient { * * @example * - * const securitycenter = require('securitycenter.v1beta1'); + * const securityCenter = require('@google-cloud/security-center'); * - * const client = new securitycenter.v1beta1.SecurityCenterClient({ + * const client = new securityCenter.v1beta1.SecurityCenterClient({ * // optional auth parameters. * }); * @@ -1812,9 +1812,9 @@ class SecurityCenterClient { * * @example * - * const securitycenter = require('securitycenter.v1beta1'); + * const securityCenter = require('@google-cloud/security-center'); * - * const client = new securitycenter.v1beta1.SecurityCenterClient({ + * const client = new securityCenter.v1beta1.SecurityCenterClient({ * // optional auth parameters. * }); * @@ -1862,9 +1862,9 @@ class SecurityCenterClient { * * @example * - * const securitycenter = require('securitycenter.v1beta1'); + * const securityCenter = require('@google-cloud/security-center'); * - * const client = new securitycenter.v1beta1.SecurityCenterClient({ + * const client = new securityCenter.v1beta1.SecurityCenterClient({ * // optional auth parameters. * }); * @@ -1963,9 +1963,9 @@ class SecurityCenterClient { * * @example * - * const securitycenter = require('securitycenter.v1beta1'); + * const securityCenter = require('@google-cloud/security-center'); * - * const client = new securitycenter.v1beta1.SecurityCenterClient({ + * const client = new securityCenter.v1beta1.SecurityCenterClient({ * // optional auth parameters. * }); * @@ -2025,9 +2025,9 @@ class SecurityCenterClient { * * @example * - * const securitycenter = require('securitycenter.v1beta1'); + * const securityCenter = require('@google-cloud/security-center'); * - * const client = new securitycenter.v1beta1.SecurityCenterClient({ + * const client = new securityCenter.v1beta1.SecurityCenterClient({ * // optional auth parameters. * }); * @@ -2083,9 +2083,9 @@ class SecurityCenterClient { * * @example * - * const securitycenter = require('securitycenter.v1beta1'); + * const securityCenter = require('@google-cloud/security-center'); * - * const client = new securitycenter.v1beta1.SecurityCenterClient({ + * const client = new securityCenter.v1beta1.SecurityCenterClient({ * // optional auth parameters. * }); * @@ -2147,9 +2147,9 @@ class SecurityCenterClient { * * @example * - * const securitycenter = require('securitycenter.v1beta1'); + * const securityCenter = require('@google-cloud/security-center'); * - * const client = new securitycenter.v1beta1.SecurityCenterClient({ + * const client = new securityCenter.v1beta1.SecurityCenterClient({ * // optional auth parameters. * }); * @@ -2199,9 +2199,9 @@ class SecurityCenterClient { * * @example * - * const securitycenter = require('securitycenter.v1beta1'); + * const securityCenter = require('@google-cloud/security-center'); * - * const client = new securitycenter.v1beta1.SecurityCenterClient({ + * const client = new securityCenter.v1beta1.SecurityCenterClient({ * // optional auth parameters. * }); * @@ -2255,9 +2255,9 @@ class SecurityCenterClient { * * @example * - * const securitycenter = require('securitycenter.v1beta1'); + * const securityCenter = require('@google-cloud/security-center'); * - * const client = new securitycenter.v1beta1.SecurityCenterClient({ + * const client = new securityCenter.v1beta1.SecurityCenterClient({ * // optional auth parameters. * }); * @@ -2311,9 +2311,9 @@ class SecurityCenterClient { * * @example * - * const securitycenter = require('securitycenter.v1beta1'); + * const securityCenter = require('@google-cloud/security-center'); * - * const client = new securitycenter.v1beta1.SecurityCenterClient({ + * const client = new securityCenter.v1beta1.SecurityCenterClient({ * // optional auth parameters. * }); * diff --git a/packages/google-cloud-securitycenter/test/gapic-v1beta1.js b/packages/google-cloud-securitycenter/test/gapic-v1beta1.js index f68fba672d3..f001338b3bc 100644 --- a/packages/google-cloud-securitycenter/test/gapic-v1beta1.js +++ b/packages/google-cloud-securitycenter/test/gapic-v1beta1.js @@ -16,7 +16,7 @@ const assert = require('assert'); -const securitycenterModule = require('../src'); +const securityCenterModule = require('../src'); const FAKE_STATUS_CODE = 1; const error = new Error(); @@ -25,7 +25,7 @@ error.code = FAKE_STATUS_CODE; describe('SecurityCenterClient', () => { describe('createSource', () => { it('invokes createSource without error', done => { - const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + const client = new securityCenterModule.v1beta1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); @@ -62,7 +62,7 @@ describe('SecurityCenterClient', () => { }); it('invokes createSource with error', done => { - const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + const client = new securityCenterModule.v1beta1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); @@ -93,7 +93,7 @@ describe('SecurityCenterClient', () => { describe('createFinding', () => { it('invokes createFinding without error', done => { - const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + const client = new securityCenterModule.v1beta1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); @@ -136,7 +136,7 @@ describe('SecurityCenterClient', () => { }); it('invokes createFinding with error', done => { - const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + const client = new securityCenterModule.v1beta1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); @@ -169,7 +169,7 @@ describe('SecurityCenterClient', () => { describe('getIamPolicy', () => { it('invokes getIamPolicy without error', done => { - const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + const client = new securityCenterModule.v1beta1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); @@ -202,7 +202,7 @@ describe('SecurityCenterClient', () => { }); it('invokes getIamPolicy with error', done => { - const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + const client = new securityCenterModule.v1beta1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); @@ -231,7 +231,7 @@ describe('SecurityCenterClient', () => { describe('getOrganizationSettings', () => { it('invokes getOrganizationSettings without error', done => { - const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + const client = new securityCenterModule.v1beta1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); @@ -264,7 +264,7 @@ describe('SecurityCenterClient', () => { }); it('invokes getOrganizationSettings with error', done => { - const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + const client = new securityCenterModule.v1beta1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); @@ -293,7 +293,7 @@ describe('SecurityCenterClient', () => { describe('getSource', () => { it('invokes getSource without error', done => { - const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + const client = new securityCenterModule.v1beta1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); @@ -328,7 +328,7 @@ describe('SecurityCenterClient', () => { }); it('invokes getSource with error', done => { - const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + const client = new securityCenterModule.v1beta1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); @@ -357,7 +357,7 @@ describe('SecurityCenterClient', () => { describe('groupAssets', () => { it('invokes groupAssets without error', done => { - const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + const client = new securityCenterModule.v1beta1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); @@ -397,7 +397,7 @@ describe('SecurityCenterClient', () => { }); it('invokes groupAssets with error', done => { - const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + const client = new securityCenterModule.v1beta1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); @@ -428,7 +428,7 @@ describe('SecurityCenterClient', () => { describe('groupFindings', () => { it('invokes groupFindings without error', done => { - const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + const client = new securityCenterModule.v1beta1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); @@ -468,7 +468,7 @@ describe('SecurityCenterClient', () => { }); it('invokes groupFindings with error', done => { - const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + const client = new securityCenterModule.v1beta1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); @@ -499,7 +499,7 @@ describe('SecurityCenterClient', () => { describe('listAssets', () => { it('invokes listAssets without error', done => { - const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + const client = new securityCenterModule.v1beta1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); @@ -535,7 +535,7 @@ describe('SecurityCenterClient', () => { }); it('invokes listAssets with error', done => { - const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + const client = new securityCenterModule.v1beta1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); @@ -564,7 +564,7 @@ describe('SecurityCenterClient', () => { describe('listFindings', () => { it('invokes listFindings without error', done => { - const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + const client = new securityCenterModule.v1beta1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); @@ -604,7 +604,7 @@ describe('SecurityCenterClient', () => { }); it('invokes listFindings with error', done => { - const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + const client = new securityCenterModule.v1beta1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); @@ -633,7 +633,7 @@ describe('SecurityCenterClient', () => { describe('listSources', () => { it('invokes listSources without error', done => { - const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + const client = new securityCenterModule.v1beta1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); @@ -671,7 +671,7 @@ describe('SecurityCenterClient', () => { }); it('invokes listSources with error', done => { - const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + const client = new securityCenterModule.v1beta1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); @@ -700,7 +700,7 @@ describe('SecurityCenterClient', () => { describe('runAssetDiscovery', function() { it('invokes runAssetDiscovery without error', done => { - const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + const client = new securityCenterModule.v1beta1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); @@ -736,7 +736,7 @@ describe('SecurityCenterClient', () => { }); it('invokes runAssetDiscovery with error', done => { - const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + const client = new securityCenterModule.v1beta1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); @@ -771,7 +771,7 @@ describe('SecurityCenterClient', () => { }); it('has longrunning decoder functions', () => { - const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + const client = new securityCenterModule.v1beta1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); @@ -788,7 +788,7 @@ describe('SecurityCenterClient', () => { describe('setFindingState', () => { it('invokes setFindingState without error', done => { - const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + const client = new securityCenterModule.v1beta1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); @@ -835,7 +835,7 @@ describe('SecurityCenterClient', () => { }); it('invokes setFindingState with error', done => { - const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + const client = new securityCenterModule.v1beta1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); @@ -872,7 +872,7 @@ describe('SecurityCenterClient', () => { describe('setIamPolicy', () => { it('invokes setIamPolicy without error', done => { - const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + const client = new securityCenterModule.v1beta1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); @@ -907,7 +907,7 @@ describe('SecurityCenterClient', () => { }); it('invokes setIamPolicy with error', done => { - const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + const client = new securityCenterModule.v1beta1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); @@ -938,7 +938,7 @@ describe('SecurityCenterClient', () => { describe('testIamPermissions', () => { it('invokes testIamPermissions without error', done => { - const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + const client = new securityCenterModule.v1beta1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); @@ -968,7 +968,7 @@ describe('SecurityCenterClient', () => { }); it('invokes testIamPermissions with error', done => { - const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + const client = new securityCenterModule.v1beta1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); @@ -999,7 +999,7 @@ describe('SecurityCenterClient', () => { describe('updateFinding', () => { it('invokes updateFinding without error', done => { - const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + const client = new securityCenterModule.v1beta1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); @@ -1038,7 +1038,7 @@ describe('SecurityCenterClient', () => { }); it('invokes updateFinding with error', done => { - const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + const client = new securityCenterModule.v1beta1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); @@ -1067,7 +1067,7 @@ describe('SecurityCenterClient', () => { describe('updateOrganizationSettings', () => { it('invokes updateOrganizationSettings without error', done => { - const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + const client = new securityCenterModule.v1beta1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); @@ -1100,7 +1100,7 @@ describe('SecurityCenterClient', () => { }); it('invokes updateOrganizationSettings with error', done => { - const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + const client = new securityCenterModule.v1beta1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); @@ -1129,7 +1129,7 @@ describe('SecurityCenterClient', () => { describe('updateSource', () => { it('invokes updateSource without error', done => { - const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + const client = new securityCenterModule.v1beta1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); @@ -1164,7 +1164,7 @@ describe('SecurityCenterClient', () => { }); it('invokes updateSource with error', done => { - const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + const client = new securityCenterModule.v1beta1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); @@ -1193,7 +1193,7 @@ describe('SecurityCenterClient', () => { describe('updateSecurityMarks', () => { it('invokes updateSecurityMarks without error', done => { - const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + const client = new securityCenterModule.v1beta1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); @@ -1224,7 +1224,7 @@ describe('SecurityCenterClient', () => { }); it('invokes updateSecurityMarks with error', done => { - const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + const client = new securityCenterModule.v1beta1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); From 667386fc4a0ef161113e2d881159e78a3f8d2054 Mon Sep 17 00:00:00 2001 From: Jonathan Lui Date: Wed, 2 Jan 2019 14:54:00 -0800 Subject: [PATCH 018/342] add missing namespaces (#27) --- packages/google-cloud-securitycenter/src/index.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/packages/google-cloud-securitycenter/src/index.js b/packages/google-cloud-securitycenter/src/index.js index 6db8e961e14..b387de58f63 100644 --- a/packages/google-cloud-securitycenter/src/index.js +++ b/packages/google-cloud-securitycenter/src/index.js @@ -24,6 +24,18 @@ /** * @namespace google.cloud.securitycenter.v1beta1 */ +/** + * @namespace google.iam.v1 + */ +/** + * @namespace google.protobuf + */ +/** + * @namespace google.longrunning + */ +/** + * @namespace google.rpc + */ 'use strict'; From a18af0881f27691c5411022a9a3540e84dfb6951 Mon Sep 17 00:00:00 2001 From: Jonathan Lui Date: Thu, 3 Jan 2019 10:01:44 -0800 Subject: [PATCH 019/342] fix(docs): require stmt (#29) --- packages/google-cloud-securitycenter/src/index.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/google-cloud-securitycenter/src/index.js b/packages/google-cloud-securitycenter/src/index.js index b387de58f63..6bd17be12dc 100644 --- a/packages/google-cloud-securitycenter/src/index.js +++ b/packages/google-cloud-securitycenter/src/index.js @@ -54,14 +54,14 @@ const gapic = Object.freeze({ * - `SecurityCenterClient` - Reference to * {@link v1beta1.SecurityCenterClient} * - * @module {object} @google-cloud/securitycenter + * @module {object} @google-cloud/security-center * @alias nodejs-securitycenter * * @example Install the client library with npm: - * npm install --save securitycenter + * npm install --save @google-cloud/security-center * * @example Import the client library: - * const securitycenter = require('securitycenter'); + * const securitycenter = require('@google-cloud/security-center'); * * @example Create a client that uses Application Default Credentials (ADC): * const client = new securitycenter.SecurityCenterClient(); From e911853c31bccaff3a40f586b29592df4302f39a Mon Sep 17 00:00:00 2001 From: Jonathan Lui Date: Thu, 3 Jan 2019 10:14:55 -0800 Subject: [PATCH 020/342] Release @google-cloud/security-center v0.1.1 (#28) * Release v0.1.1 * Update CHANGELOG.md --- .../google-cloud-securitycenter/CHANGELOG.md | 21 +++++++++++++++++++ .../google-cloud-securitycenter/package.json | 2 +- .../samples/package.json | 2 +- 3 files changed, 23 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-securitycenter/CHANGELOG.md b/packages/google-cloud-securitycenter/CHANGELOG.md index b15b4b432e5..37b1a86fcbc 100644 --- a/packages/google-cloud-securitycenter/CHANGELOG.md +++ b/packages/google-cloud-securitycenter/CHANGELOG.md @@ -4,6 +4,27 @@ [1]: https://www.npmjs.com/package/@google-cloud/security-center?activeTab=versions +## v0.1.1 + +01-02-2019 14:54 PST + +### Documentation +- fix(docs): require stmt (#29) +- add missing namespaces ([#27](https://github.com/googleapis/nodejs-security-center/pull/27)) +- fix(docs): fix require module in samples ([#26](https://github.com/googleapis/nodejs-security-center/pull/26)) + +### Internal / Testing Changes +- chore(build): inject yoshi automation key ([#23](https://github.com/googleapis/nodejs-security-center/pull/23)) +- chore: update nyc and eslint configs ([#22](https://github.com/googleapis/nodejs-security-center/pull/22)) +- chore: fix publish.sh permission +x ([#20](https://github.com/googleapis/nodejs-security-center/pull/20)) +- fix(build): fix Kokoro release script ([#19](https://github.com/googleapis/nodejs-security-center/pull/19)) +- build: add Kokoro configs for autorelease ([#18](https://github.com/googleapis/nodejs-security-center/pull/18)) +- chore: add synth.metadata ([#17](https://github.com/googleapis/nodejs-security-center/pull/17)) +- chore(deps): update dependency @google-cloud/nodejs-repo-tools to v3 ([#12](https://github.com/googleapis/nodejs-security-center/pull/12)) +- chore: always nyc report before calling codecov ([#15](https://github.com/googleapis/nodejs-security-center/pull/15)) +- chore: nyc ignore build/test by default ([#14](https://github.com/googleapis/nodejs-security-center/pull/14)) +- docs: update readme badges ([#11](https://github.com/googleapis/nodejs-security-center/pull/11)) + ## v0.1.0 This is the initial release of the Cloud Security Center API Node.js client library. diff --git a/packages/google-cloud-securitycenter/package.json b/packages/google-cloud-securitycenter/package.json index 391db08b92f..306b22c9fbd 100644 --- a/packages/google-cloud-securitycenter/package.json +++ b/packages/google-cloud-securitycenter/package.json @@ -1,7 +1,7 @@ { "name": "@google-cloud/security-center", "description": "Cloud Security Command Center API client for Node.js", - "version": "0.1.0", + "version": "0.1.1", "license": "Apache-2.0", "author": "Google LLC", "engines": { diff --git a/packages/google-cloud-securitycenter/samples/package.json b/packages/google-cloud-securitycenter/samples/package.json index 4e403b259cf..deb4d399bf5 100644 --- a/packages/google-cloud-securitycenter/samples/package.json +++ b/packages/google-cloud-securitycenter/samples/package.json @@ -7,7 +7,7 @@ }, "license": "Apache-2.0", "dependencies": { - "@google-cloud/security-center": "^0.1.0" + "@google-cloud/security-center": "^0.1.1" }, "devDependencies": { "mocha": "^5.2.0" From 82532a1d4f16c4ebebae48c1872407cfc19f6a90 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot <44816363+yoshi-automation@users.noreply.github.com> Date: Fri, 4 Jan 2019 07:16:09 -0800 Subject: [PATCH 021/342] docs: update the comments in the protos (#30) --- .../google/cloud/securitycenter/v1beta1/source.proto | 4 ++-- .../google/cloud/securitycenter/v1beta1/doc_source.js | 4 ++-- packages/google-cloud-securitycenter/synth.metadata | 10 +++++----- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/source.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/source.proto index 9dfc9490e9a..5eabe2b1a34 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/source.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/source.proto @@ -34,8 +34,8 @@ message Source { // "organizations/123/sources/456" string name = 1; - // The source’s display name. - // A source’s display name must be unique amongst its siblings, for example, + // The source's display name. + // A source's display name must be unique amongst its siblings, for example, // two sources with the same parent can't share the same display name. // The display name must start and end with a letter or digit, may contain // letters, digits, spaces, hyphens, and underscores, and can be no longer diff --git a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_source.js b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_source.js index 45f1e645d54..ce16f98fb7d 100644 --- a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_source.js +++ b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_source.js @@ -27,8 +27,8 @@ * "organizations/123/sources/456" * * @property {string} displayName - * The source’s display name. - * A source’s display name must be unique amongst its siblings, for example, + * The source's display name. + * A source's display name must be unique amongst its siblings, for example, * two sources with the same parent can't share the same display name. * The display name must start and end with a letter or digit, may contain * letters, digits, spaces, hyphens, and underscores, and can be no longer diff --git a/packages/google-cloud-securitycenter/synth.metadata b/packages/google-cloud-securitycenter/synth.metadata index 8d4dfd1b522..f68f097c4f7 100644 --- a/packages/google-cloud-securitycenter/synth.metadata +++ b/packages/google-cloud-securitycenter/synth.metadata @@ -1,19 +1,19 @@ { - "updateTime": "2018-12-08T12:21:42.100694Z", + "updateTime": "2019-01-04T12:09:24.971220Z", "sources": [ { "generator": { "name": "artman", - "version": "0.16.2", - "dockerImage": "googleapis/artman@sha256:2f6b261ee7fe1aedf238991c93a20b3820de37a343d0cacf3e3e9555c2aaf2ea" + "version": "0.16.4", + "dockerImage": "googleapis/artman@sha256:8b45fae963557c3299921037ecbb86f0689f41b1b4aea73408ebc50562cb2857" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "6f6505a69b2b0a1260c93e890d636eefb859e76e", - "internalRef": "224530961" + "sha": "4930597beb4d26be020513af985506b39d4b73cd", + "internalRef": "227765328" } }, { From 007e3e3d10e8d33faa556a9befbbbcea1508a724 Mon Sep 17 00:00:00 2001 From: Jonathan Lui Date: Thu, 10 Jan 2019 11:17:02 -0800 Subject: [PATCH 022/342] samples: add quickstart (#33) * samples: add quickstart * sync quickstart to README.md * rm console.log * update README.md * npm run fix --- .../google-cloud-securitycenter/README.md | 23 +++++++++++++--- .../samples/package.json | 5 ++++ .../samples/quickstart.js | 26 ++++++++++++++++--- 3 files changed, 48 insertions(+), 6 deletions(-) diff --git a/packages/google-cloud-securitycenter/README.md b/packages/google-cloud-securitycenter/README.md index 09ac272271f..9581d104b81 100644 --- a/packages/google-cloud-securitycenter/README.md +++ b/packages/google-cloud-securitycenter/README.md @@ -32,8 +32,26 @@ 1. Try an example: ```javascript -// Imports the Google Cloud client library -const sc = require('@google-cloud/securitycenter'); +async function quickstart( + organization = 'YOUR_ORGANIZATION', // Your GCP organization +) { + const sc = require('@google-cloud/security-center'); + + // Create a client + const client = new sc.SecurityCenterClient(); + + const formattedParent = client.organizationPath(organization); + const reqSource = {}; + const request = { + parent: formattedParent, + source: reqSource, + }; + + const [source] = await client.createSource(request); + // The newly created source. + console.log('Source created.'); + console.log(source); +} ``` @@ -81,4 +99,3 @@ Google APIs Client Libraries, in [Client Libraries Explained][explained]. [billing]: https://support.google.com/cloud/answer/6293499#enable-billing [enable_api]: https://console.cloud.google.com/flows/enableapi?apiid= [auth]: https://cloud.google.com/docs/authentication/getting-started - diff --git a/packages/google-cloud-securitycenter/samples/package.json b/packages/google-cloud-securitycenter/samples/package.json index deb4d399bf5..11d3cf7493e 100644 --- a/packages/google-cloud-securitycenter/samples/package.json +++ b/packages/google-cloud-securitycenter/samples/package.json @@ -2,6 +2,9 @@ "name": "nodejs-security-center-samples", "main": "quickstart.js", "private": true, + "engines": { + "node": ">=8" + }, "scripts": { "test": "mocha system-test" }, @@ -10,6 +13,8 @@ "@google-cloud/security-center": "^0.1.1" }, "devDependencies": { + "chai": "^4.2.0", + "execa": "^1.0.0", "mocha": "^5.2.0" } } diff --git a/packages/google-cloud-securitycenter/samples/quickstart.js b/packages/google-cloud-securitycenter/samples/quickstart.js index c984865131a..e9d8017a5eb 100644 --- a/packages/google-cloud-securitycenter/samples/quickstart.js +++ b/packages/google-cloud-securitycenter/samples/quickstart.js @@ -16,7 +16,27 @@ 'use strict'; // [START securitycenter_quickstart] -// Imports the Google Cloud client library -const sc = require('@google-cloud/securitycenter'); -console.log(sc); +async function quickstart( + organization = 'YOUR_ORGANIZATION' // Your GCP organization +) { + const sc = require('@google-cloud/security-center'); + + // Create a client + const client = new sc.SecurityCenterClient(); + + const formattedParent = client.organizationPath(organization); + const reqSource = {}; + const request = { + parent: formattedParent, + source: reqSource, + }; + + const [source] = await client.createSource(request); + // The newly created source. + console.log('Source created.'); + console.log(source); +} // [END securitycenter_quickstart] + +const args = process.argv.slice(2); +quickstart(...args).catch(console.error); From f108eced91172149d3cccd49bfd845cb52910111 Mon Sep 17 00:00:00 2001 From: Jonathan Lui Date: Thu, 10 Jan 2019 12:50:56 -0800 Subject: [PATCH 023/342] fix(docs): broken link to API ref docs (#32) --- packages/google-cloud-securitycenter/.cloud-repo-tools.json | 2 +- packages/google-cloud-securitycenter/README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-securitycenter/.cloud-repo-tools.json b/packages/google-cloud-securitycenter/.cloud-repo-tools.json index 6cad4dfa761..3e24bfb8914 100644 --- a/packages/google-cloud-securitycenter/.cloud-repo-tools.json +++ b/packages/google-cloud-securitycenter/.cloud-repo-tools.json @@ -2,7 +2,7 @@ "requiresKeyFile": true, "requiresProjectId": true, "product": "security-center", - "client_reference_url": "https://cloud.google.com/nodejs/docs/reference/securitycenter/latest/", + "client_reference_url": "https://cloud.google.com/nodejs/docs/reference/security-center/latest/", "release_quality": "beta", "samples": [] } diff --git a/packages/google-cloud-securitycenter/README.md b/packages/google-cloud-securitycenter/README.md index 9581d104b81..4a3a9280915 100644 --- a/packages/google-cloud-securitycenter/README.md +++ b/packages/google-cloud-securitycenter/README.md @@ -92,7 +92,7 @@ Google APIs Client Libraries, in [Client Libraries Explained][explained]. [explained]: https://cloud.google.com/apis/docs/client-libraries-explained -[client-docs]: https://cloud.google.com/nodejs/docs/reference/securitycenter/latest/ +[client-docs]: https://cloud.google.com/nodejs/docs/reference/security-center/latest/ [product-docs]: https://cloud.google.com/security-center/docs/ [shell_img]: https://gstatic.com/cloudssh/images/open-btn.png [projects]: https://console.cloud.google.com/project From a5f8581c97dddb8b5ee5941714c53479c7f695b5 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" Date: Mon, 14 Jan 2019 12:02:16 -0800 Subject: [PATCH 024/342] fix(deps): update dependency google-gax to ^0.23.0 (#34) --- packages/google-cloud-securitycenter/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-securitycenter/package.json b/packages/google-cloud-securitycenter/package.json index 306b22c9fbd..edd1d7b3bb4 100644 --- a/packages/google-cloud-securitycenter/package.json +++ b/packages/google-cloud-securitycenter/package.json @@ -38,7 +38,7 @@ "fix": "eslint --fix '**/*.js'" }, "dependencies": { - "google-gax": "^0.22.0", + "google-gax": "^0.23.0", "lodash.merge": "^4.6.0", "protobufjs": "^6.8.0" }, From 572482dca93f7e88ad137d8a93e4383fe5520162 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot <44816363+yoshi-automation@users.noreply.github.com> Date: Mon, 14 Jan 2019 12:07:23 -0800 Subject: [PATCH 025/342] docs: various doc changes in protos and generated source (#31) --- .../cloud/securitycenter/v1beta1/asset.proto | 7 +++--- .../securitycenter/v1beta1/finding.proto | 7 +++--- .../v1beta1/securitycenter_service.proto | 23 +++++++++++-------- .../cloud/securitycenter/v1beta1/source.proto | 5 ++-- .../cloud/securitycenter/v1beta1/doc_asset.js | 6 ++--- .../securitycenter/v1beta1/doc_finding.js | 6 +++-- .../v1beta1/doc_securitycenter_service.js | 4 ++-- .../securitycenter/v1beta1/doc_source.js | 4 ++-- .../src/v1beta1/security_center_client.js | 4 ++-- .../synth.metadata | 10 ++++---- 10 files changed, 41 insertions(+), 35 deletions(-) diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/asset.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/asset.proto index d8f93409a8c..3dd5b358141 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/asset.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/asset.proto @@ -26,13 +26,12 @@ option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/ option java_multiple_files = true; option java_package = "com.google.cloud.securitycenter.v1beta1"; - // Cloud Security Command Center's (Cloud SCC) representation of a Google Cloud // Platform (GCP) resource. // -// The Asset is a Cloud SCC resource that captures information about a single GCP -// resource. All modifications to an Asset are only within the context of Cloud -// SCC and don't affect the referenced GCP resource. +// The Asset is a Cloud SCC resource that captures information about a single +// GCP resource. All modifications to an Asset are only within the context of +// Cloud SCC and don't affect the referenced GCP resource. message Asset { // Cloud SCC managed properties. These properties are managed by Cloud SCC and // cannot be modified by the user. diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/finding.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/finding.proto index 0c99247b605..21dfdd5616e 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/finding.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/finding.proto @@ -26,7 +26,6 @@ option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/ option java_multiple_files = true; option java_package = "com.google.cloud.securitycenter.v1beta1"; - // Cloud Security Command Center (Cloud SCC) finding. // // A finding is a record of assessment data (security, risk, health or privacy) @@ -69,7 +68,7 @@ message Finding { // The state of the finding. State state = 4; - // The additional taxonomy group within findings from a give source. + // The additional taxonomy group within findings from a given source. // This field is immutable after creation time. // Example: "XSS_FLASH_INJECTION" string category = 5; @@ -80,7 +79,9 @@ message Finding { string external_uri = 6; // Source specific properties. These properties are managed by the source - // that writes the finding. + // that writes the finding. The key names in the source_properties map must be + // between 1 and 255 characters, and must start with a letter and contain + // alphanumeric characters or underscores only. map source_properties = 7; // Output only. User specified security marks. These marks are entirely diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/securitycenter_service.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/securitycenter_service.proto index fecca4f0dff..dafce562dc7 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/securitycenter_service.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/securitycenter_service.proto @@ -36,7 +36,6 @@ option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/ option java_multiple_files = true; option java_package = "com.google.cloud.securitycenter.v1beta1"; - // V1 Beta APIs for Security Center service. service SecurityCenter { // Creates a source. @@ -57,7 +56,8 @@ service SecurityCenter { } // Gets the access control policy on the specified Source. - rpc GetIamPolicy(google.iam.v1.GetIamPolicyRequest) returns (google.iam.v1.Policy) { + rpc GetIamPolicy(google.iam.v1.GetIamPolicyRequest) + returns (google.iam.v1.Policy) { option (google.api.http) = { post: "/v1beta1/{resource=organizations/*/sources/*}:getIamPolicy" body: "*" @@ -65,7 +65,8 @@ service SecurityCenter { } // Gets the settings for an organization. - rpc GetOrganizationSettings(GetOrganizationSettingsRequest) returns (OrganizationSettings) { + rpc GetOrganizationSettings(GetOrganizationSettingsRequest) + returns (OrganizationSettings) { option (google.api.http) = { get: "/v1beta1/{name=organizations/*/organizationSettings}" }; @@ -129,7 +130,8 @@ service SecurityCenter { // This API can only be called with limited frequency for an organization. If // it is called too frequently the caller will receive a TOO_MANY_REQUESTS // error. - rpc RunAssetDiscovery(RunAssetDiscoveryRequest) returns (google.longrunning.Operation) { + rpc RunAssetDiscovery(RunAssetDiscoveryRequest) + returns (google.longrunning.Operation) { option (google.api.http) = { post: "/v1beta1/{parent=organizations/*}/assets:runDiscovery" body: "*" @@ -145,7 +147,8 @@ service SecurityCenter { } // Sets the access control policy on the specified Source. - rpc SetIamPolicy(google.iam.v1.SetIamPolicyRequest) returns (google.iam.v1.Policy) { + rpc SetIamPolicy(google.iam.v1.SetIamPolicyRequest) + returns (google.iam.v1.Policy) { option (google.api.http) = { post: "/v1beta1/{resource=organizations/*/sources/*}:setIamPolicy" body: "*" @@ -153,7 +156,8 @@ service SecurityCenter { } // Returns the permissions that a caller has on the specified source. - rpc TestIamPermissions(google.iam.v1.TestIamPermissionsRequest) returns (google.iam.v1.TestIamPermissionsResponse) { + rpc TestIamPermissions(google.iam.v1.TestIamPermissionsRequest) + returns (google.iam.v1.TestIamPermissionsResponse) { option (google.api.http) = { post: "/v1beta1/{resource=organizations/*/sources/*}:testIamPermissions" body: "*" @@ -170,7 +174,8 @@ service SecurityCenter { } // Updates an organization's settings. - rpc UpdateOrganizationSettings(UpdateOrganizationSettingsRequest) returns (OrganizationSettings) { + rpc UpdateOrganizationSettings(UpdateOrganizationSettingsRequest) + returns (OrganizationSettings) { option (google.api.http) = { patch: "/v1beta1/{organization_settings.name=organizations/*/organizationSettings}" body: "organization_settings" @@ -714,8 +719,8 @@ message UpdateFindingRequest { // characters in length. Finding finding = 1; - // The FieldMask to use when updating the finding resource. This field is - // ignored if the finding does not already exist and the finding is created. + // The FieldMask to use when updating the finding resource. This field should + // not be specified when creating a finding. google.protobuf.FieldMask update_mask = 2; } diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/source.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/source.proto index 5eabe2b1a34..cc1fae6eaa6 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/source.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/source.proto @@ -23,7 +23,6 @@ option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/ option java_multiple_files = true; option java_package = "com.google.cloud.securitycenter.v1beta1"; - // Cloud Security Command Center's (Cloud SCC) finding source. A finding source // is an entity or a mechanism that can produce a finding. A source is like a // container of findings that come from the same scanner, logger, monitor, etc. @@ -39,8 +38,8 @@ message Source { // two sources with the same parent can't share the same display name. // The display name must start and end with a letter or digit, may contain // letters, digits, spaces, hyphens, and underscores, and can be no longer - // than 30 characters. This is captured by the regular expression: - // [\p{L}\p{N}]({\p{L}\p{N}_- ]{0,28}[\p{L}\p{N}])?. + // than 32 characters. This is captured by the regular expression: + // [\p{L}\p{N}]({\p{L}\p{N}_- ]{0,30}[\p{L}\p{N}])?. string display_name = 2; // The description of the source (max of 1024 characters). diff --git a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_asset.js b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_asset.js index 868cb14a848..f972f7c8b51 100644 --- a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_asset.js +++ b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_asset.js @@ -19,9 +19,9 @@ * Cloud Security Command Center's (Cloud SCC) representation of a Google Cloud * Platform (GCP) resource. * - * The Asset is a Cloud SCC resource that captures information about a single GCP - * resource. All modifications to an Asset are only within the context of Cloud - * SCC and don't affect the referenced GCP resource. + * The Asset is a Cloud SCC resource that captures information about a single + * GCP resource. All modifications to an Asset are only within the context of + * Cloud SCC and don't affect the referenced GCP resource. * * @property {string} name * The relative resource name of this asset. See: diff --git a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_finding.js b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_finding.js index 9a6f83719a5..9c92d43c097 100644 --- a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_finding.js +++ b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_finding.js @@ -48,7 +48,7 @@ * The number should be among the values of [State]{@link google.cloud.securitycenter.v1beta1.State} * * @property {string} category - * The additional taxonomy group within findings from a give source. + * The additional taxonomy group within findings from a given source. * This field is immutable after creation time. * Example: "XSS_FLASH_INJECTION" * @@ -59,7 +59,9 @@ * * @property {Object.} sourceProperties * Source specific properties. These properties are managed by the source - * that writes the finding. + * that writes the finding. The key names in the source_properties map must be + * between 1 and 255 characters, and must start with a letter and contain + * alphanumeric characters or underscores only. * * @property {Object} securityMarks * Output only. User specified security marks. These marks are entirely diff --git a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_securitycenter_service.js b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_securitycenter_service.js index 439e338f1a3..2a387af85a5 100644 --- a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_securitycenter_service.js +++ b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_securitycenter_service.js @@ -741,8 +741,8 @@ const RunAssetDiscoveryRequest = { * This object should have the same structure as [Finding]{@link google.cloud.securitycenter.v1beta1.Finding} * * @property {Object} updateMask - * The FieldMask to use when updating the finding resource. This field is - * ignored if the finding does not already exist and the finding is created. + * The FieldMask to use when updating the finding resource. This field should + * not be specified when creating a finding. * * This object should have the same structure as [FieldMask]{@link google.protobuf.FieldMask} * diff --git a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_source.js b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_source.js index ce16f98fb7d..711883d5969 100644 --- a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_source.js +++ b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_source.js @@ -32,8 +32,8 @@ * two sources with the same parent can't share the same display name. * The display name must start and end with a letter or digit, may contain * letters, digits, spaces, hyphens, and underscores, and can be no longer - * than 30 characters. This is captured by the regular expression: - * [\p{L}\p{N}](https://cloud.google.com{\p{L}\p{N}_- ]{0,28}[\p{L}\p{N}])?. + * than 32 characters. This is captured by the regular expression: + * [\p{L}\p{N}](https://cloud.google.com{\p{L}\p{N}_- ]{0,30}[\p{L}\p{N}])?. * * @property {string} description * The description of the source (max of 1024 characters). diff --git a/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.js b/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.js index aabb5ad52f1..ad3f245a2d7 100644 --- a/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.js +++ b/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.js @@ -2130,8 +2130,8 @@ class SecurityCenterClient { * * This object should have the same structure as [Finding]{@link google.cloud.securitycenter.v1beta1.Finding} * @param {Object} [request.updateMask] - * The FieldMask to use when updating the finding resource. This field is - * ignored if the finding does not already exist and the finding is created. + * The FieldMask to use when updating the finding resource. This field should + * not be specified when creating a finding. * * This object should have the same structure as [FieldMask]{@link google.protobuf.FieldMask} * @param {Object} [options] diff --git a/packages/google-cloud-securitycenter/synth.metadata b/packages/google-cloud-securitycenter/synth.metadata index f68f097c4f7..dc01126702e 100644 --- a/packages/google-cloud-securitycenter/synth.metadata +++ b/packages/google-cloud-securitycenter/synth.metadata @@ -1,19 +1,19 @@ { - "updateTime": "2019-01-04T12:09:24.971220Z", + "updateTime": "2019-01-09T12:20:11.411487Z", "sources": [ { "generator": { "name": "artman", - "version": "0.16.4", - "dockerImage": "googleapis/artman@sha256:8b45fae963557c3299921037ecbb86f0689f41b1b4aea73408ebc50562cb2857" + "version": "0.16.5", + "dockerImage": "googleapis/artman@sha256:5a96c2c5c6f9570cc9556b63dc9ce1838777fd9166b5b64e43ad8e0ecee2fe2c" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "4930597beb4d26be020513af985506b39d4b73cd", - "internalRef": "227765328" + "sha": "659d66ec24bf40b35a41a0b79218d96ba3add3d3", + "internalRef": "228437827" } }, { From 13e94c734fe3ca100d26f32b3493b5157e12a8d5 Mon Sep 17 00:00:00 2001 From: Jonathan Lui Date: Mon, 14 Jan 2019 16:07:56 -0800 Subject: [PATCH 026/342] build: check broken links in generated docs (#25) --- packages/google-cloud-securitycenter/.jsdoc.js | 2 +- packages/google-cloud-securitycenter/README.md | 6 +++--- packages/google-cloud-securitycenter/package.json | 2 +- .../cloud/securitycenter/v1beta1/doc_source.js | 10 +++++----- .../v1beta1/doc/google/protobuf/doc_timestamp.js | 6 ++---- packages/google-cloud-securitycenter/synth.py | 14 ++++++++++++++ 6 files changed, 26 insertions(+), 14 deletions(-) diff --git a/packages/google-cloud-securitycenter/.jsdoc.js b/packages/google-cloud-securitycenter/.jsdoc.js index bf57e3f53da..a67138482f6 100644 --- a/packages/google-cloud-securitycenter/.jsdoc.js +++ b/packages/google-cloud-securitycenter/.jsdoc.js @@ -20,7 +20,7 @@ module.exports = { opts: { readme: './README.md', package: './package.json', - template: './node_modules/ink-docstrap/template', + template: './node_modules/jsdoc-baseline', recurse: true, verbose: true, destination: './docs/' diff --git a/packages/google-cloud-securitycenter/README.md b/packages/google-cloud-securitycenter/README.md index 4a3a9280915..d64c54c7f64 100644 --- a/packages/google-cloud-securitycenter/README.md +++ b/packages/google-cloud-securitycenter/README.md @@ -8,7 +8,7 @@ [![npm version](https://img.shields.io/npm/v/@google-cloud/security-center.svg)](https://www.npmjs.org/package/@google-cloud/security-center) [![codecov](https://img.shields.io/codecov/c/github/googleapis/nodejs-security-center/master.svg?style=flat)](https://codecov.io/gh/googleapis/nodejs-security-center) -[Cloud Security Command Center](https://cloud.google.com/security-center/docs/) helps security teams gather data, identify threats, and act on them before they result in business damage or loss. It offers deep insight into application and data risk so that you can quickly mitigate threats to your cloud resources and evaluate overall health. With Cloud Security Command Center, you can view and monitor an inventory of your cloud assets, scan storage systems for sensitive data, detect common web vulnerabilities, and review access rights to your critical resources, all from a single, centralized dashboard. +[Cloud Security Command Center](https://cloud.google.com/security-command-center/docs/) helps security teams gather data, identify threats, and act on them before they result in business damage or loss. It offers deep insight into application and data risk so that you can quickly mitigate threats to your cloud resources and evaluate overall health. With Cloud Security Command Center, you can view and monitor an inventory of your cloud assets, scan storage systems for sensitive data, detect common web vulnerabilities, and review access rights to your critical resources, all from a single, centralized dashboard. * [Using the client library](#using-the-client-library) @@ -33,7 +33,7 @@ ```javascript async function quickstart( - organization = 'YOUR_ORGANIZATION', // Your GCP organization + organization = 'YOUR_ORGANIZATION' // Your GCP organization ) { const sc = require('@google-cloud/security-center'); @@ -93,7 +93,7 @@ Google APIs Client Libraries, in [Client Libraries Explained][explained]. [explained]: https://cloud.google.com/apis/docs/client-libraries-explained [client-docs]: https://cloud.google.com/nodejs/docs/reference/security-center/latest/ -[product-docs]: https://cloud.google.com/security-center/docs/ +[product-docs]: https://cloud.google.com/security-command-center/docs/ [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 diff --git a/packages/google-cloud-securitycenter/package.json b/packages/google-cloud-securitycenter/package.json index edd1d7b3bb4..9615db9cab6 100644 --- a/packages/google-cloud-securitycenter/package.json +++ b/packages/google-cloud-securitycenter/package.json @@ -49,7 +49,7 @@ "eslint-config-prettier": "^3.0.0", "eslint-plugin-node": "^8.0.0", "eslint-plugin-prettier": "^3.0.0", - "ink-docstrap": "^1.3.0", + "jsdoc-baseline": "git+https://github.com/hegemonic/jsdoc-baseline.git", "intelli-espower-loader": "^1.0.1", "jsdoc": "^3.5.5", "mocha": "^5.0.0", diff --git a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_source.js b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_source.js index 711883d5969..7d2cac8744f 100644 --- a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_source.js +++ b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_source.js @@ -27,13 +27,13 @@ * "organizations/123/sources/456" * * @property {string} displayName - * The source's display name. - * A source's display name must be unique amongst its siblings, for example, + * The source’s display name. + * A source’s display name must be unique amongst its siblings, for example, * two sources with the same parent can't share the same display name. * The display name must start and end with a letter or digit, may contain * letters, digits, spaces, hyphens, and underscores, and can be no longer - * than 32 characters. This is captured by the regular expression: - * [\p{L}\p{N}](https://cloud.google.com{\p{L}\p{N}_- ]{0,30}[\p{L}\p{N}])?. + * than 30 characters. This is captured by the regular expression: + * `\[\p{L}\p{N}]({\p{L}\p{N}_- ]{0,30}[\p{L}\p{N}])?`. * * @property {string} description * The description of the source (max of 1024 characters). @@ -50,4 +50,4 @@ */ const Source = { // This is for documentation. Actual contents will be loaded by gRPC. -}; \ No newline at end of file +}; diff --git a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/protobuf/doc_timestamp.js b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/protobuf/doc_timestamp.js index 1ebe2e6e1a5..1cc64cbed80 100644 --- a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/protobuf/doc_timestamp.js +++ b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/protobuf/doc_timestamp.js @@ -87,13 +87,11 @@ * 01:30 UTC on January 15, 2017. * * In JavaScript, one can convert a Date object to this format using the - * standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString] + * standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) * method. In Python, a standard `datetime.datetime` object can be converted * to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) * with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one - * can use the Joda Time's [`ISODateTimeFormat.dateTime()`](https://cloud.google.com - * http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime-- - * ) to obtain a formatter capable of generating timestamps in this format. + * can use the Joda Time's [`ISODateTimeFormat.dateTime()`](https://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime--) to obtain a formatter capable of generating timestamps in this format. * * @property {number} seconds * Represents seconds of UTC time since Unix epoch diff --git a/packages/google-cloud-securitycenter/synth.py b/packages/google-cloud-securitycenter/synth.py index 75371a5a4c7..f25c5a7dbb6 100644 --- a/packages/google-cloud-securitycenter/synth.py +++ b/packages/google-cloud-securitycenter/synth.py @@ -31,6 +31,20 @@ templates = common_templates.node_library() s.copy(templates) +s.replace('src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_source.js', + r"\[\\p\{L\}\\p\{N\}\]\(https:\/\/cloud\.google\.com\{\\p\{L\}\\p\{N\}_- \]\{0\,30\}\[\\p\{L\}\\p\{N\}\]\)\?", + r"`\[\p{L}\p{N}]({\p{L}\p{N}_- ]{0,30}[\p{L}\p{N}])?`") + +# [START fix-dead-link] +s.replace('**/doc/google/protobuf/doc_timestamp.js', + 'https:\/\/cloud\.google\.com[\s\*]*http:\/\/(.*)[\s\*]*\)', + r"https://\1)") + +s.replace('**/doc/google/protobuf/doc_timestamp.js', + 'toISOString\]', + 'toISOString)') +# [END fix-dead-link] + # Node.js specific cleanup subprocess.run(['npm', 'install']) subprocess.run(['npm', 'run', 'fix']) From 773b278281f42e5c887f080a804ed9a2e6d20755 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot <44816363+yoshi-automation@users.noreply.github.com> Date: Wed, 16 Jan 2019 09:39:32 -0800 Subject: [PATCH 027/342] docs: update jsdoc comments (#36) docs: update jsdoc comments --- .../doc/google/cloud/securitycenter/v1beta1/doc_source.js | 8 ++++---- packages/google-cloud-securitycenter/synth.metadata | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_source.js b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_source.js index 7d2cac8744f..fad38b385d7 100644 --- a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_source.js +++ b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_source.js @@ -27,12 +27,12 @@ * "organizations/123/sources/456" * * @property {string} displayName - * The source’s display name. - * A source’s display name must be unique amongst its siblings, for example, + * The source's display name. + * A source's display name must be unique amongst its siblings, for example, * two sources with the same parent can't share the same display name. * The display name must start and end with a letter or digit, may contain * letters, digits, spaces, hyphens, and underscores, and can be no longer - * than 30 characters. This is captured by the regular expression: + * than 32 characters. This is captured by the regular expression: * `\[\p{L}\p{N}]({\p{L}\p{N}_- ]{0,30}[\p{L}\p{N}])?`. * * @property {string} description @@ -50,4 +50,4 @@ */ const Source = { // This is for documentation. Actual contents will be loaded by gRPC. -}; +}; \ No newline at end of file diff --git a/packages/google-cloud-securitycenter/synth.metadata b/packages/google-cloud-securitycenter/synth.metadata index dc01126702e..508000e10a2 100644 --- a/packages/google-cloud-securitycenter/synth.metadata +++ b/packages/google-cloud-securitycenter/synth.metadata @@ -1,5 +1,5 @@ { - "updateTime": "2019-01-09T12:20:11.411487Z", + "updateTime": "2019-01-16T12:25:27.431780Z", "sources": [ { "generator": { @@ -12,8 +12,8 @@ "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "659d66ec24bf40b35a41a0b79218d96ba3add3d3", - "internalRef": "228437827" + "sha": "7a81902f287a4ac2ac130994889c80f87f91d035", + "internalRef": "229452079" } }, { From 82c6d1f605133951a5aa63a7b894e1dbf648d440 Mon Sep 17 00:00:00 2001 From: Jonathan Lui Date: Wed, 16 Jan 2019 16:35:19 -0800 Subject: [PATCH 028/342] Release v0.1.2 (#37) --- packages/google-cloud-securitycenter/CHANGELOG.md | 15 +++++++++++++++ packages/google-cloud-securitycenter/package.json | 2 +- .../samples/package.json | 2 +- 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-securitycenter/CHANGELOG.md b/packages/google-cloud-securitycenter/CHANGELOG.md index 37b1a86fcbc..03045aee7a6 100644 --- a/packages/google-cloud-securitycenter/CHANGELOG.md +++ b/packages/google-cloud-securitycenter/CHANGELOG.md @@ -4,6 +4,21 @@ [1]: https://www.npmjs.com/package/@google-cloud/security-center?activeTab=versions +## v0.1.2 + +01-16-2019 16:03 PST + +### Dependencies +- fix(deps): update dependency google-gax to ^0.23.0 ([#34](https://github.com/googleapis/nodejs-security-center/pull/34)) + +### Documentation +- docs: update jsdoc comments ([#36](https://github.com/googleapis/nodejs-security-center/pull/36)) +- build: check broken links in generated docs ([#25](https://github.com/googleapis/nodejs-security-center/pull/25)) +- docs: various doc changes in protos and generated source ([#31](https://github.com/googleapis/nodejs-security-center/pull/31)) +- fix(docs): broken link to API ref docs ([#32](https://github.com/googleapis/nodejs-security-center/pull/32)) +- docs: update the comments in the protos ([#30](https://github.com/googleapis/nodejs-security-center/pull/30)) +- samples: add quickstart ([#33](https://github.com/googleapis/nodejs-security-center/pull/33)) + ## v0.1.1 01-02-2019 14:54 PST diff --git a/packages/google-cloud-securitycenter/package.json b/packages/google-cloud-securitycenter/package.json index 9615db9cab6..aec16221a02 100644 --- a/packages/google-cloud-securitycenter/package.json +++ b/packages/google-cloud-securitycenter/package.json @@ -1,7 +1,7 @@ { "name": "@google-cloud/security-center", "description": "Cloud Security Command Center API client for Node.js", - "version": "0.1.1", + "version": "0.1.2", "license": "Apache-2.0", "author": "Google LLC", "engines": { diff --git a/packages/google-cloud-securitycenter/samples/package.json b/packages/google-cloud-securitycenter/samples/package.json index 11d3cf7493e..cbbd4eeef1f 100644 --- a/packages/google-cloud-securitycenter/samples/package.json +++ b/packages/google-cloud-securitycenter/samples/package.json @@ -10,7 +10,7 @@ }, "license": "Apache-2.0", "dependencies": { - "@google-cloud/security-center": "^0.1.1" + "@google-cloud/security-center": "^0.1.2" }, "devDependencies": { "chai": "^4.2.0", From a0118f2eea22f031986a74d41dd4cf7796c37e85 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot <44816363+yoshi-automation@users.noreply.github.com> Date: Thu, 17 Jan 2019 06:37:37 -0800 Subject: [PATCH 029/342] chore: sync gapic files --- .../google/cloud/securitycenter/v1beta1/doc_asset.js | 2 +- .../cloud/securitycenter/v1beta1/doc_finding.js | 2 +- .../v1beta1/doc_organization_settings.js | 2 +- .../securitycenter/v1beta1/doc_security_marks.js | 2 +- .../v1beta1/doc_securitycenter_service.js | 2 +- .../cloud/securitycenter/v1beta1/doc_source.js | 2 +- .../src/v1beta1/doc/google/iam/v1/doc_iam_policy.js | 2 +- .../src/v1beta1/doc/google/iam/v1/doc_policy.js | 2 +- .../v1beta1/doc/google/longrunning/doc_operations.js | 2 +- .../src/v1beta1/doc/google/protobuf/doc_any.js | 2 +- .../src/v1beta1/doc/google/protobuf/doc_duration.js | 2 +- .../v1beta1/doc/google/protobuf/doc_field_mask.js | 2 +- .../src/v1beta1/doc/google/protobuf/doc_struct.js | 2 +- .../src/v1beta1/doc/google/protobuf/doc_timestamp.js | 2 +- .../src/v1beta1/doc/google/rpc/doc_status.js | 2 +- .../google-cloud-securitycenter/src/v1beta1/index.js | 2 +- .../src/v1beta1/security_center_client.js | 2 +- packages/google-cloud-securitycenter/synth.metadata | 12 ++++++------ .../test/gapic-v1beta1.js | 2 +- 19 files changed, 24 insertions(+), 24 deletions(-) diff --git a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_asset.js b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_asset.js index f972f7c8b51..5167b5ddcf8 100644 --- a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_asset.js +++ b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_asset.js @@ -1,4 +1,4 @@ -// Copyright 2018 Google LLC +// Copyright 2019 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_finding.js b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_finding.js index 9c92d43c097..72dd6e7ef75 100644 --- a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_finding.js +++ b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_finding.js @@ -1,4 +1,4 @@ -// Copyright 2018 Google LLC +// Copyright 2019 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_organization_settings.js b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_organization_settings.js index c76981c5e17..b4a159eda7e 100644 --- a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_organization_settings.js +++ b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_organization_settings.js @@ -1,4 +1,4 @@ -// Copyright 2018 Google LLC +// Copyright 2019 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_security_marks.js b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_security_marks.js index 4612e4c69b2..9e7cf544ab0 100644 --- a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_security_marks.js +++ b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_security_marks.js @@ -1,4 +1,4 @@ -// Copyright 2018 Google LLC +// Copyright 2019 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_securitycenter_service.js b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_securitycenter_service.js index 2a387af85a5..c29342073b4 100644 --- a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_securitycenter_service.js +++ b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_securitycenter_service.js @@ -1,4 +1,4 @@ -// Copyright 2018 Google LLC +// Copyright 2019 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_source.js b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_source.js index fad38b385d7..676e8bd25f2 100644 --- a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_source.js +++ b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_source.js @@ -1,4 +1,4 @@ -// Copyright 2018 Google LLC +// Copyright 2019 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/iam/v1/doc_iam_policy.js b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/iam/v1/doc_iam_policy.js index e952d5d1f02..12b7ac5df09 100644 --- a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/iam/v1/doc_iam_policy.js +++ b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/iam/v1/doc_iam_policy.js @@ -1,4 +1,4 @@ -// Copyright 2018 Google LLC +// Copyright 2019 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/iam/v1/doc_policy.js b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/iam/v1/doc_policy.js index 5e7237e0fa9..bcae4a7d873 100644 --- a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/iam/v1/doc_policy.js +++ b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/iam/v1/doc_policy.js @@ -1,4 +1,4 @@ -// Copyright 2018 Google LLC +// Copyright 2019 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/longrunning/doc_operations.js b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/longrunning/doc_operations.js index e6dd81d4eea..bd03cc3da0e 100644 --- a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/longrunning/doc_operations.js +++ b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/longrunning/doc_operations.js @@ -1,4 +1,4 @@ -// Copyright 2018 Google LLC +// Copyright 2019 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/protobuf/doc_any.js b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/protobuf/doc_any.js index 3accb1fc0d8..f3278b34e66 100644 --- a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/protobuf/doc_any.js +++ b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/protobuf/doc_any.js @@ -1,4 +1,4 @@ -// Copyright 2018 Google LLC +// Copyright 2019 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/protobuf/doc_duration.js b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/protobuf/doc_duration.js index c03ce2fb3df..1275f8f4d13 100644 --- a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/protobuf/doc_duration.js +++ b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/protobuf/doc_duration.js @@ -1,4 +1,4 @@ -// Copyright 2018 Google LLC +// Copyright 2019 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/protobuf/doc_field_mask.js b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/protobuf/doc_field_mask.js index 0cb35328962..d55d97e6e38 100644 --- a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/protobuf/doc_field_mask.js +++ b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/protobuf/doc_field_mask.js @@ -1,4 +1,4 @@ -// Copyright 2018 Google LLC +// Copyright 2019 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/protobuf/doc_struct.js b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/protobuf/doc_struct.js index ddf7e5c95dc..ae7e4ef1ff6 100644 --- a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/protobuf/doc_struct.js +++ b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/protobuf/doc_struct.js @@ -1,4 +1,4 @@ -// Copyright 2018 Google LLC +// Copyright 2019 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/protobuf/doc_timestamp.js b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/protobuf/doc_timestamp.js index 1cc64cbed80..b47f41c2b30 100644 --- a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/protobuf/doc_timestamp.js +++ b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/protobuf/doc_timestamp.js @@ -1,4 +1,4 @@ -// Copyright 2018 Google LLC +// Copyright 2019 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/rpc/doc_status.js b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/rpc/doc_status.js index 13cfcab1021..fc4b5be93f0 100644 --- a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/rpc/doc_status.js +++ b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/rpc/doc_status.js @@ -1,4 +1,4 @@ -// Copyright 2018 Google LLC +// Copyright 2019 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-securitycenter/src/v1beta1/index.js b/packages/google-cloud-securitycenter/src/v1beta1/index.js index d70ac5ef7ef..1f988c41e32 100644 --- a/packages/google-cloud-securitycenter/src/v1beta1/index.js +++ b/packages/google-cloud-securitycenter/src/v1beta1/index.js @@ -1,4 +1,4 @@ -// Copyright 2018 Google LLC +// Copyright 2019 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.js b/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.js index ad3f245a2d7..60f426251c5 100644 --- a/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.js +++ b/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.js @@ -1,4 +1,4 @@ -// Copyright 2018 Google LLC +// Copyright 2019 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-securitycenter/synth.metadata b/packages/google-cloud-securitycenter/synth.metadata index 508000e10a2..a2dd91bf714 100644 --- a/packages/google-cloud-securitycenter/synth.metadata +++ b/packages/google-cloud-securitycenter/synth.metadata @@ -1,26 +1,26 @@ { - "updateTime": "2019-01-16T12:25:27.431780Z", + "updateTime": "2019-01-17T12:56:42.103153Z", "sources": [ { "generator": { "name": "artman", - "version": "0.16.5", - "dockerImage": "googleapis/artman@sha256:5a96c2c5c6f9570cc9556b63dc9ce1838777fd9166b5b64e43ad8e0ecee2fe2c" + "version": "0.16.6", + "dockerImage": "googleapis/artman@sha256:12722f2ca3fbc3b53cc6aa5f0e569d7d221b46bd876a2136497089dec5e3634e" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "7a81902f287a4ac2ac130994889c80f87f91d035", - "internalRef": "229452079" + "sha": "0ac60e21a1aa86c07c1836865b35308ba8178b05", + "internalRef": "229626798" } }, { "template": { "name": "node_library", "origin": "synthtool.gcp", - "version": "2018.12.6" + "version": "2019.1.16" } } ], diff --git a/packages/google-cloud-securitycenter/test/gapic-v1beta1.js b/packages/google-cloud-securitycenter/test/gapic-v1beta1.js index f001338b3bc..783cb9a339b 100644 --- a/packages/google-cloud-securitycenter/test/gapic-v1beta1.js +++ b/packages/google-cloud-securitycenter/test/gapic-v1beta1.js @@ -1,4 +1,4 @@ -// Copyright 2018 Google LLC +// Copyright 2019 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. From 2dca56ba7ef8a05b699b304e933af36585cd139e Mon Sep 17 00:00:00 2001 From: "renovate[bot]" Date: Fri, 25 Jan 2019 09:51:53 -0800 Subject: [PATCH 030/342] fix(deps): update dependency google-gax to ^0.24.0 (#40) --- packages/google-cloud-securitycenter/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-securitycenter/package.json b/packages/google-cloud-securitycenter/package.json index aec16221a02..8e2ed07162c 100644 --- a/packages/google-cloud-securitycenter/package.json +++ b/packages/google-cloud-securitycenter/package.json @@ -38,7 +38,7 @@ "fix": "eslint --fix '**/*.js'" }, "dependencies": { - "google-gax": "^0.23.0", + "google-gax": "^0.24.0", "lodash.merge": "^4.6.0", "protobufjs": "^6.8.0" }, From b05118e7283a92fcd7e6a284e1f95ac8f4fa9f6c Mon Sep 17 00:00:00 2001 From: "renovate[bot]" Date: Sat, 26 Jan 2019 10:38:59 -0800 Subject: [PATCH 031/342] chore(deps): update dependency eslint-config-prettier to v4 (#41) --- packages/google-cloud-securitycenter/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-securitycenter/package.json b/packages/google-cloud-securitycenter/package.json index 8e2ed07162c..97add966c07 100644 --- a/packages/google-cloud-securitycenter/package.json +++ b/packages/google-cloud-securitycenter/package.json @@ -46,7 +46,7 @@ "@google-cloud/nodejs-repo-tools": "^3.0.0", "codecov": "^3.0.0", "eslint": "^5.0.0", - "eslint-config-prettier": "^3.0.0", + "eslint-config-prettier": "^4.0.0", "eslint-plugin-node": "^8.0.0", "eslint-plugin-prettier": "^3.0.0", "jsdoc-baseline": "git+https://github.com/hegemonic/jsdoc-baseline.git", From 779f0587e75ead9178be7906549260ec9c770927 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" Date: Wed, 30 Jan 2019 12:19:32 -0800 Subject: [PATCH 032/342] fix(deps): update dependency google-gax to ^0.25.0 (#42) --- packages/google-cloud-securitycenter/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-securitycenter/package.json b/packages/google-cloud-securitycenter/package.json index 97add966c07..c0f66561728 100644 --- a/packages/google-cloud-securitycenter/package.json +++ b/packages/google-cloud-securitycenter/package.json @@ -38,7 +38,7 @@ "fix": "eslint --fix '**/*.js'" }, "dependencies": { - "google-gax": "^0.24.0", + "google-gax": "^0.25.0", "lodash.merge": "^4.6.0", "protobufjs": "^6.8.0" }, From ed4f35e89047c0271d300b96b0309b506979c355 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot <44816363+yoshi-automation@users.noreply.github.com> Date: Sat, 2 Feb 2019 10:30:16 -0800 Subject: [PATCH 033/342] refactor: improve generated code style. (#43) --- .../src/v1beta1/security_center_client.js | 31 +++++++------------ .../synth.metadata | 10 +++--- 2 files changed, 17 insertions(+), 24 deletions(-) diff --git a/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.js b/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.js index 60f426251c5..db565af3ce7 100644 --- a/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.js +++ b/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.js @@ -674,7 +674,7 @@ class SecurityCenterClient { * client.groupAssets(request) * .then(responses => { * const resources = responses[0]; - * for (let i = 0; i < resources.length; i += 1) { + * for (const resource of resources) { * // doThingsWith(resources[i]) * } * }) @@ -699,7 +699,7 @@ class SecurityCenterClient { * const nextRequest = responses[1]; * // The actual response object, if necessary. * // const rawResponse = responses[2]; - * for (let i = 0; i < resources.length; i += 1) { + * for (const resource of resources) { * // doThingsWith(resources[i]); * } * if (nextRequest) { @@ -965,7 +965,7 @@ class SecurityCenterClient { * client.groupFindings(request) * .then(responses => { * const resources = responses[0]; - * for (let i = 0; i < resources.length; i += 1) { + * for (const resource of resources) { * // doThingsWith(resources[i]) * } * }) @@ -990,7 +990,7 @@ class SecurityCenterClient { * const nextRequest = responses[1]; * // The actual response object, if necessary. * // const rawResponse = responses[2]; - * for (let i = 0; i < resources.length; i += 1) { + * for (const resource of resources) { * // doThingsWith(resources[i]); * } * if (nextRequest) { @@ -1251,7 +1251,7 @@ class SecurityCenterClient { * client.listAssets({parent: formattedParent}) * .then(responses => { * const resources = responses[0]; - * for (let i = 0; i < resources.length; i += 1) { + * for (const resource of resources) { * // doThingsWith(resources[i]) * } * }) @@ -1271,7 +1271,7 @@ class SecurityCenterClient { * const nextRequest = responses[1]; * // The actual response object, if necessary. * // const rawResponse = responses[2]; - * for (let i = 0; i < resources.length; i += 1) { + * for (const resource of resources) { * // doThingsWith(resources[i]); * } * if (nextRequest) { @@ -1534,7 +1534,7 @@ class SecurityCenterClient { * client.listFindings({parent: formattedParent}) * .then(responses => { * const resources = responses[0]; - * for (let i = 0; i < resources.length; i += 1) { + * for (const resource of resources) { * // doThingsWith(resources[i]) * } * }) @@ -1554,7 +1554,7 @@ class SecurityCenterClient { * const nextRequest = responses[1]; * // The actual response object, if necessary. * // const rawResponse = responses[2]; - * for (let i = 0; i < resources.length; i += 1) { + * for (const resource of resources) { * // doThingsWith(resources[i]); * } * if (nextRequest) { @@ -1736,7 +1736,7 @@ class SecurityCenterClient { * client.listSources({parent: formattedParent}) * .then(responses => { * const resources = responses[0]; - * for (let i = 0; i < resources.length; i += 1) { + * for (const resource of resources) { * // doThingsWith(resources[i]) * } * }) @@ -1756,7 +1756,7 @@ class SecurityCenterClient { * const nextRequest = responses[1]; * // The actual response object, if necessary. * // const rawResponse = responses[2]; - * for (let i = 0; i < resources.length; i += 1) { + * for (const resource of resources) { * // doThingsWith(resources[i]); * } * if (nextRequest) { @@ -1873,20 +1873,14 @@ class SecurityCenterClient { * // Handle the operation using the promise pattern. * client.runAssetDiscovery({parent: formattedParent}) * .then(responses => { - * const operation = responses[0]; - * const initialApiResponse = responses[1]; + * const [operation, initialApiResponse] = responses; * * // Operation#promise starts polling for the completion of the LRO. * return operation.promise(); * }) * .then(responses => { - * // The final result of the operation. * const result = responses[0]; - * - * // The metadata value of the completed operation. * const metadata = responses[1]; - * - * // The response of the api call returning the complete operation. * const finalApiResponse = responses[2]; * }) * .catch(err => { @@ -1898,8 +1892,7 @@ class SecurityCenterClient { * // Handle the operation using the event emitter pattern. * client.runAssetDiscovery({parent: formattedParent}) * .then(responses => { - * const operation = responses[0]; - * const initialApiResponse = responses[1]; + * const [operation, initialApiResponse] = responses; * * // Adding a listener for the "complete" event starts polling for the * // completion of the operation. diff --git a/packages/google-cloud-securitycenter/synth.metadata b/packages/google-cloud-securitycenter/synth.metadata index a2dd91bf714..1f6df75ce59 100644 --- a/packages/google-cloud-securitycenter/synth.metadata +++ b/packages/google-cloud-securitycenter/synth.metadata @@ -1,19 +1,19 @@ { - "updateTime": "2019-01-17T12:56:42.103153Z", + "updateTime": "2019-02-02T12:22:53.102764Z", "sources": [ { "generator": { "name": "artman", - "version": "0.16.6", - "dockerImage": "googleapis/artman@sha256:12722f2ca3fbc3b53cc6aa5f0e569d7d221b46bd876a2136497089dec5e3634e" + "version": "0.16.8", + "dockerImage": "googleapis/artman@sha256:75bc07ef34a1de9895c18af54dc503ed3b3f3b52e85062e3360a979d2a0741e7" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "0ac60e21a1aa86c07c1836865b35308ba8178b05", - "internalRef": "229626798" + "sha": "bce093dab3e65c40eb9a37efbdc960f34df6037a", + "internalRef": "231974277" } }, { From a3024265d6a6047ba5d679fd79e37e1b09814983 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot <44816363+yoshi-automation@users.noreply.github.com> Date: Tue, 5 Feb 2019 08:23:54 -0800 Subject: [PATCH 034/342] docs: fix example comments (#44) --- .../src/v1beta1/security_center_client.js | 20 +++++++++---------- .../synth.metadata | 10 +++++----- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.js b/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.js index db565af3ce7..52b3d074efc 100644 --- a/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.js +++ b/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.js @@ -675,7 +675,7 @@ class SecurityCenterClient { * .then(responses => { * const resources = responses[0]; * for (const resource of resources) { - * // doThingsWith(resources[i]) + * // doThingsWith(resource) * } * }) * .catch(err => { @@ -700,7 +700,7 @@ class SecurityCenterClient { * // The actual response object, if necessary. * // const rawResponse = responses[2]; * for (const resource of resources) { - * // doThingsWith(resources[i]); + * // doThingsWith(resource); * } * if (nextRequest) { * // Fetch the next page. @@ -966,7 +966,7 @@ class SecurityCenterClient { * .then(responses => { * const resources = responses[0]; * for (const resource of resources) { - * // doThingsWith(resources[i]) + * // doThingsWith(resource) * } * }) * .catch(err => { @@ -991,7 +991,7 @@ class SecurityCenterClient { * // The actual response object, if necessary. * // const rawResponse = responses[2]; * for (const resource of resources) { - * // doThingsWith(resources[i]); + * // doThingsWith(resource); * } * if (nextRequest) { * // Fetch the next page. @@ -1252,7 +1252,7 @@ class SecurityCenterClient { * .then(responses => { * const resources = responses[0]; * for (const resource of resources) { - * // doThingsWith(resources[i]) + * // doThingsWith(resource) * } * }) * .catch(err => { @@ -1272,7 +1272,7 @@ class SecurityCenterClient { * // The actual response object, if necessary. * // const rawResponse = responses[2]; * for (const resource of resources) { - * // doThingsWith(resources[i]); + * // doThingsWith(resource); * } * if (nextRequest) { * // Fetch the next page. @@ -1535,7 +1535,7 @@ class SecurityCenterClient { * .then(responses => { * const resources = responses[0]; * for (const resource of resources) { - * // doThingsWith(resources[i]) + * // doThingsWith(resource) * } * }) * .catch(err => { @@ -1555,7 +1555,7 @@ class SecurityCenterClient { * // The actual response object, if necessary. * // const rawResponse = responses[2]; * for (const resource of resources) { - * // doThingsWith(resources[i]); + * // doThingsWith(resource); * } * if (nextRequest) { * // Fetch the next page. @@ -1737,7 +1737,7 @@ class SecurityCenterClient { * .then(responses => { * const resources = responses[0]; * for (const resource of resources) { - * // doThingsWith(resources[i]) + * // doThingsWith(resource) * } * }) * .catch(err => { @@ -1757,7 +1757,7 @@ class SecurityCenterClient { * // The actual response object, if necessary. * // const rawResponse = responses[2]; * for (const resource of resources) { - * // doThingsWith(resources[i]); + * // doThingsWith(resource); * } * if (nextRequest) { * // Fetch the next page. diff --git a/packages/google-cloud-securitycenter/synth.metadata b/packages/google-cloud-securitycenter/synth.metadata index 1f6df75ce59..118ca803936 100644 --- a/packages/google-cloud-securitycenter/synth.metadata +++ b/packages/google-cloud-securitycenter/synth.metadata @@ -1,19 +1,19 @@ { - "updateTime": "2019-02-02T12:22:53.102764Z", + "updateTime": "2019-02-05T12:18:23.177943Z", "sources": [ { "generator": { "name": "artman", - "version": "0.16.8", - "dockerImage": "googleapis/artman@sha256:75bc07ef34a1de9895c18af54dc503ed3b3f3b52e85062e3360a979d2a0741e7" + "version": "0.16.9", + "dockerImage": "googleapis/artman@sha256:80c39fa84e7203c8f355e01bdeef82155013cc39dcaa48fba7a6fe2c253623e3" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "bce093dab3e65c40eb9a37efbdc960f34df6037a", - "internalRef": "231974277" + "sha": "f26c727dde5051abefc5ad9e7dee82a2686ad2b0", + "internalRef": "232306662" } }, { From 68bd74aef8b2c59471b5ffa68b4169cfb1bac8b4 Mon Sep 17 00:00:00 2001 From: Jonathan Lui Date: Thu, 7 Feb 2019 15:43:05 -0800 Subject: [PATCH 035/342] chore: move CONTRIBUTING.md to root (#47) --- .../CONTRIBUTING.md | 57 +++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 packages/google-cloud-securitycenter/CONTRIBUTING.md diff --git a/packages/google-cloud-securitycenter/CONTRIBUTING.md b/packages/google-cloud-securitycenter/CONTRIBUTING.md new file mode 100644 index 00000000000..b958f235007 --- /dev/null +++ b/packages/google-cloud-securitycenter/CONTRIBUTING.md @@ -0,0 +1,57 @@ +# 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. Submit a pull request. + +## Running the tests + +1. [Prepare your environment for Node.js setup][setup]. + +1. Install dependencies: + + npm install + +1. Run the tests: + + npm test + +1. Lint (and maybe fix) any changes: + + npm run fix + +[setup]: https://cloud.google.com/nodejs/docs/setup From 36c87b3b3441b845297ea0e9277803370eee6090 Mon Sep 17 00:00:00 2001 From: Dave Gramlich Date: Thu, 7 Feb 2019 18:48:30 -0800 Subject: [PATCH 036/342] docs: update contributing path in README (#48) --- packages/google-cloud-securitycenter/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-securitycenter/README.md b/packages/google-cloud-securitycenter/README.md index d64c54c7f64..7173728c144 100644 --- a/packages/google-cloud-securitycenter/README.md +++ b/packages/google-cloud-securitycenter/README.md @@ -73,7 +73,7 @@ More Information: [Google Cloud Platform Launch Stages][launch_stages] ## Contributing -Contributions welcome! See the [Contributing Guide](https://github.com/googleapis/nodejs-security-center/blob/master/.github/CONTRIBUTING.md). +Contributions welcome! See the [Contributing Guide](https://github.com/googleapis/nodejs-security-center/blob/master/CONTRIBUTING.md). ## License From d42535d8334c5474a508b550180f9d41e5cdc647 Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Sun, 10 Feb 2019 20:54:27 -0800 Subject: [PATCH 037/342] build: create docs test npm scripts (#50) --- packages/google-cloud-securitycenter/package.json | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-securitycenter/package.json b/packages/google-cloud-securitycenter/package.json index c0f66561728..da2b8615c61 100644 --- a/packages/google-cloud-securitycenter/package.json +++ b/packages/google-cloud-securitycenter/package.json @@ -35,7 +35,9 @@ "system-test": "mocha system-test/*.js --timeout 600000", "test-no-cover": "mocha test/*.js", "test": "npm run cover", - "fix": "eslint --fix '**/*.js'" + "fix": "eslint --fix '**/*.js'", + "docs-test": "blcl docs -r --exclude www.googleapis.com", + "predocs-test": "npm run docs" }, "dependencies": { "google-gax": "^0.25.0", @@ -55,6 +57,7 @@ "mocha": "^5.0.0", "nyc": "^13.0.0", "power-assert": "^1.4.4", - "prettier": "^1.7.4" + "prettier": "^1.7.4", + "broken-link-checker-local": "^0.2.0" } } From f12565836ff08a5c92bd939e9752cb1194f32694 Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Thu, 14 Feb 2019 08:50:46 -0800 Subject: [PATCH 038/342] docs: update links in contrib guide (#53) --- packages/google-cloud-securitycenter/CONTRIBUTING.md | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/packages/google-cloud-securitycenter/CONTRIBUTING.md b/packages/google-cloud-securitycenter/CONTRIBUTING.md index b958f235007..78aaa61b269 100644 --- a/packages/google-cloud-securitycenter/CONTRIBUTING.md +++ b/packages/google-cloud-securitycenter/CONTRIBUTING.md @@ -16,11 +16,9 @@ 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). + 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). + 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 From 8fa9e60947a1d3f91f48821b5b9eca73702608bb Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Thu, 14 Feb 2019 12:02:17 -0800 Subject: [PATCH 039/342] build: use linkinator for docs test (#52) --- packages/google-cloud-securitycenter/package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-securitycenter/package.json b/packages/google-cloud-securitycenter/package.json index da2b8615c61..c97505c8f81 100644 --- a/packages/google-cloud-securitycenter/package.json +++ b/packages/google-cloud-securitycenter/package.json @@ -36,7 +36,7 @@ "test-no-cover": "mocha test/*.js", "test": "npm run cover", "fix": "eslint --fix '**/*.js'", - "docs-test": "blcl docs -r --exclude www.googleapis.com", + "docs-test": "linkinator docs -r --skip www.googleapis.com", "predocs-test": "npm run docs" }, "dependencies": { @@ -58,6 +58,6 @@ "nyc": "^13.0.0", "power-assert": "^1.4.4", "prettier": "^1.7.4", - "broken-link-checker-local": "^0.2.0" + "linkinator": "^1.1.2" } } From 712169cdde0e22acc1880e24f5f74e4ea1afcbb9 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot <44816363+yoshi-automation@users.noreply.github.com> Date: Thu, 14 Feb 2019 12:39:02 -0800 Subject: [PATCH 040/342] fix: throw on invalid credentials --- .../src/v1beta1/security_center_client.js | 4 ++++ packages/google-cloud-securitycenter/synth.metadata | 10 +++++----- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.js b/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.js index 52b3d074efc..766e29e5f1d 100644 --- a/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.js +++ b/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.js @@ -232,6 +232,10 @@ class SecurityCenterClient { function() { const args = Array.prototype.slice.call(arguments, 0); return stub[methodName].apply(stub, args); + }, + err => + function() { + throw err; } ), defaults[methodName], diff --git a/packages/google-cloud-securitycenter/synth.metadata b/packages/google-cloud-securitycenter/synth.metadata index 118ca803936..8e8ce98d7a5 100644 --- a/packages/google-cloud-securitycenter/synth.metadata +++ b/packages/google-cloud-securitycenter/synth.metadata @@ -1,19 +1,19 @@ { - "updateTime": "2019-02-05T12:18:23.177943Z", + "updateTime": "2019-02-13T12:24:12.223137Z", "sources": [ { "generator": { "name": "artman", - "version": "0.16.9", - "dockerImage": "googleapis/artman@sha256:80c39fa84e7203c8f355e01bdeef82155013cc39dcaa48fba7a6fe2c253623e3" + "version": "0.16.13", + "dockerImage": "googleapis/artman@sha256:5fd9aee1d82a00cebf425c8fa431f5457539562f5867ad9c54370f0ec9a7ccaa" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "f26c727dde5051abefc5ad9e7dee82a2686ad2b0", - "internalRef": "232306662" + "sha": "ca61898878f0926dd9dcc68ba90764f17133efe4", + "internalRef": "233680013" } }, { From a3fb4897feb125852253be2d04d530c768c49af8 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" Date: Tue, 19 Feb 2019 10:04:13 -0800 Subject: [PATCH 041/342] chore(deps): update dependency mocha to v6 chore(deps): update dependency mocha to v6 This PR contains the following updates: | Package | Type | Update | Change | References | |---|---|---|---|---| | mocha | devDependencies | major | `^5.2.0` -> `^6.0.0` | [homepage](https://mochajs.org/), [source](https://togithub.com/mochajs/mocha) | --- ### Release Notes
mochajs/mocha ### [`v6.0.0`](https://togithub.com/mochajs/mocha/blob/master/CHANGELOG.md#​600--2019-02-18) [Compare Source](https://togithub.com/mochajs/mocha/compare/v5.2.0...v6.0.0) #### :tada: Enhancements - [#​3726](https://togithub.com/mochajs/mocha/issues/3726): Add ability to unload files from `require` cache ([**@​plroebuck**](https://togithub.com/plroebuck)) #### :bug: Fixes - [#​3737](https://togithub.com/mochajs/mocha/issues/3737): Fix falsy values from options globals ([**@​plroebuck**](https://togithub.com/plroebuck)) - [#​3707](https://togithub.com/mochajs/mocha/issues/3707): Fix encapsulation issues for `Suite#_onlyTests` and `Suite#_onlySuites` ([**@​vkarpov15**](https://togithub.com/vkarpov15)) - [#​3711](https://togithub.com/mochajs/mocha/issues/3711): Fix diagnostic messages dealing with plurality and markup of output ([**@​plroebuck**](https://togithub.com/plroebuck)) - [#​3723](https://togithub.com/mochajs/mocha/issues/3723): Fix "reporter-option" to allow comma-separated options ([**@​boneskull**](https://togithub.com/boneskull)) - [#​3722](https://togithub.com/mochajs/mocha/issues/3722): Fix code quality and performance of `lookupFiles` and `files` ([**@​plroebuck**](https://togithub.com/plroebuck)) - [#​3650](https://togithub.com/mochajs/mocha/issues/3650), [#​3654](https://togithub.com/mochajs/mocha/issues/3654): Fix noisy error message when no files found ([**@​craigtaub**](https://togithub.com/craigtaub)) - [#​3632](https://togithub.com/mochajs/mocha/issues/3632): Tests having an empty title are no longer confused with the "root" suite ([**@​juergba**](https://togithub.com/juergba)) - [#​3666](https://togithub.com/mochajs/mocha/issues/3666): Fix missing error codes ([**@​vkarpov15**](https://togithub.com/vkarpov15)) - [#​3684](https://togithub.com/mochajs/mocha/issues/3684): Fix exiting problem in Node.js v11.7.0+ ([**@​addaleax**](https://togithub.com/addaleax)) - [#​3691](https://togithub.com/mochajs/mocha/issues/3691): Fix `--delay` (and other boolean options) not working in all cases ([**@​boneskull**](https://togithub.com/boneskull)) - [#​3692](https://togithub.com/mochajs/mocha/issues/3692): Fix invalid command-line argument usage not causing actual errors ([**@​boneskull**](https://togithub.com/boneskull)) - [#​3698](https://togithub.com/mochajs/mocha/issues/3698), [#​3699](https://togithub.com/mochajs/mocha/issues/3699): Fix debug-related Node.js options not working in all cases ([**@​boneskull**](https://togithub.com/boneskull)) - [#​3700](https://togithub.com/mochajs/mocha/issues/3700): Growl notifications now show the correct number of tests run ([**@​outsideris**](https://togithub.com/outsideris)) - [#​3686](https://togithub.com/mochajs/mocha/issues/3686): Avoid potential ReDoS when diffing large objects ([**@​cyjake**](https://togithub.com/cyjake)) - [#​3715](https://togithub.com/mochajs/mocha/issues/3715): Fix incorrect order of emitted events when used programmatically ([**@​boneskull**](https://togithub.com/boneskull)) - [#​3706](https://togithub.com/mochajs/mocha/issues/3706): Fix regression wherein `--reporter-option`/`--reporter-options` did not support comma-separated key/value pairs ([**@​boneskull**](https://togithub.com/boneskull)) #### :book: Documentation - [#​3652](https://togithub.com/mochajs/mocha/issues/3652): Switch from Jekyll to Eleventy ([**@​Munter**](https://togithub.com/Munter)) #### :nut_and_bolt: Other - [#​3677](https://togithub.com/mochajs/mocha/issues/3677): Add error objects for createUnsupportedError and createInvalidExceptionError ([**@​boneskull**](https://togithub.com/boneskull)) - [#​3733](https://togithub.com/mochajs/mocha/issues/3733): Removed unnecessary processing in post-processing hook ([**@​wanseob**](https://togithub.com/wanseob)) - [#​3730](https://togithub.com/mochajs/mocha/issues/3730): Update nyc to latest version ([**@​coreyfarrell**](https://togithub.com/coreyfarrell)) - [#​3648](https://togithub.com/mochajs/mocha/issues/3648), [#​3680](https://togithub.com/mochajs/mocha/issues/3680): Fixes to support latest versions of [unexpected](https://npm.im/unexpected) and [unexpected-sinon](https://npm.im/unexpected-sinon) ([**@​sunesimonsen**](https://togithub.com/sunesimonsen)) - [#​3638](https://togithub.com/mochajs/mocha/issues/3638): Add meta tag to site ([**@​MartijnCuppens**](https://togithub.com/MartijnCuppens)) - [#​3653](https://togithub.com/mochajs/mocha/issues/3653): Fix parts of test suite failing to run on Windows ([**@​boneskull**](https://togithub.com/boneskull))
--- ### Renovate configuration :date: **Schedule**: "after 9am and before 3pm" (UTC). :vertical_traffic_light: **Automerge**: Disabled by config. Please merge this manually once you are satisfied. :recycle: **Rebasing**: Whenever PR is stale, or if you modify the PR title to begin with "`rebase!`". :no_bell: **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://togithub.com/marketplace/renovate). View repository job log [here](https://renovatebot.com/dashboard#googleapis/nodejs-security-center). #54 automerged by dpebot --- packages/google-cloud-securitycenter/package.json | 2 +- packages/google-cloud-securitycenter/samples/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-securitycenter/package.json b/packages/google-cloud-securitycenter/package.json index c97505c8f81..2f6227a6872 100644 --- a/packages/google-cloud-securitycenter/package.json +++ b/packages/google-cloud-securitycenter/package.json @@ -54,7 +54,7 @@ "jsdoc-baseline": "git+https://github.com/hegemonic/jsdoc-baseline.git", "intelli-espower-loader": "^1.0.1", "jsdoc": "^3.5.5", - "mocha": "^5.0.0", + "mocha": "^6.0.0", "nyc": "^13.0.0", "power-assert": "^1.4.4", "prettier": "^1.7.4", diff --git a/packages/google-cloud-securitycenter/samples/package.json b/packages/google-cloud-securitycenter/samples/package.json index cbbd4eeef1f..dc879fc245a 100644 --- a/packages/google-cloud-securitycenter/samples/package.json +++ b/packages/google-cloud-securitycenter/samples/package.json @@ -15,6 +15,6 @@ "devDependencies": { "chai": "^4.2.0", "execa": "^1.0.0", - "mocha": "^5.2.0" + "mocha": "^6.0.0" } } From b790e38ca1a4bfb580bab10c5562144553450e5e Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot <44816363+yoshi-automation@users.noreply.github.com> Date: Tue, 26 Feb 2019 05:44:28 -0800 Subject: [PATCH 042/342] chore: sync latest proto docs --- .../src/v1beta1/doc/google/rpc/doc_status.js | 31 ++++++++++--------- .../synth.metadata | 10 +++--- 2 files changed, 22 insertions(+), 19 deletions(-) diff --git a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/rpc/doc_status.js b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/rpc/doc_status.js index fc4b5be93f0..432ab6bb928 100644 --- a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/rpc/doc_status.js +++ b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/rpc/doc_status.js @@ -16,24 +16,25 @@ // to be loaded as the JS file. /** - * The `Status` type defines a logical error model that is suitable for different - * programming environments, including REST APIs and RPC APIs. It is used by - * [gRPC](https://github.com/grpc). The error model is designed to be: + * The `Status` type defines a logical error model that is suitable for + * different programming environments, including REST APIs and RPC APIs. It is + * used by [gRPC](https://github.com/grpc). The error model is designed to be: * * - Simple to use and understand for most users * - Flexible enough to meet unexpected needs * * # Overview * - * The `Status` message contains three pieces of data: error code, error message, - * and error details. The error code should be an enum value of - * google.rpc.Code, but it may accept additional error codes if needed. The - * error message should be a developer-facing English message that helps - * developers *understand* and *resolve* the error. If a localized user-facing - * error message is needed, put the localized message in the error details or - * localize it in the client. The optional error details may contain arbitrary - * information about the error. There is a predefined set of error detail types - * in the package `google.rpc` that can be used for common error conditions. + * The `Status` message contains three pieces of data: error code, error + * message, and error details. The error code should be an enum value of + * google.rpc.Code, but it may accept additional error codes + * if needed. The error message should be a developer-facing English message + * that helps developers *understand* and *resolve* the error. If a localized + * user-facing error message is needed, put the localized message in the error + * details or localize it in the client. The optional error details may contain + * arbitrary information about the error. There is a predefined set of error + * detail types in the package `google.rpc` that can be used for common error + * conditions. * * # Language mapping * @@ -70,12 +71,14 @@ * be used directly after any stripping needed for security/privacy reasons. * * @property {number} code - * The status code, which should be an enum value of google.rpc.Code. + * The status code, which should be an enum value of + * google.rpc.Code. * * @property {string} message * A developer-facing error message, which should be in English. Any * user-facing error message should be localized and sent in the - * google.rpc.Status.details field, or localized by the client. + * google.rpc.Status.details field, or localized + * by the client. * * @property {Object[]} details * A list of messages that carry the error details. There is a common set of diff --git a/packages/google-cloud-securitycenter/synth.metadata b/packages/google-cloud-securitycenter/synth.metadata index 8e8ce98d7a5..e63e93f275a 100644 --- a/packages/google-cloud-securitycenter/synth.metadata +++ b/packages/google-cloud-securitycenter/synth.metadata @@ -1,19 +1,19 @@ { - "updateTime": "2019-02-13T12:24:12.223137Z", + "updateTime": "2019-02-26T12:37:43.580695Z", "sources": [ { "generator": { "name": "artman", - "version": "0.16.13", - "dockerImage": "googleapis/artman@sha256:5fd9aee1d82a00cebf425c8fa431f5457539562f5867ad9c54370f0ec9a7ccaa" + "version": "0.16.14", + "dockerImage": "googleapis/artman@sha256:f3d61ae45abaeefb6be5f228cda22732c2f1b00fb687c79c4bd4f2c42bb1e1a7" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "ca61898878f0926dd9dcc68ba90764f17133efe4", - "internalRef": "233680013" + "sha": "29f098cb03a9983cc9cb15993de5da64419046f2", + "internalRef": "235621085" } }, { From b510571ef1654379d26136f7b3a7b8c6c39c7cdf Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot <44816363+yoshi-automation@users.noreply.github.com> Date: Fri, 1 Mar 2019 08:54:58 -0800 Subject: [PATCH 043/342] docs: update comments on protos (#56) --- .../securitycenter/v1beta1/organization_settings.proto | 1 - .../cloud/securitycenter/v1beta1/security_marks.proto | 1 - packages/google-cloud-securitycenter/synth.metadata | 8 ++++---- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/organization_settings.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/organization_settings.proto index cc9f1c3ce3e..ca9be114547 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/organization_settings.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/organization_settings.proto @@ -23,7 +23,6 @@ option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/ option java_multiple_files = true; option java_package = "com.google.cloud.securitycenter.v1beta1"; - // User specified settings that are attached to the Cloud Security Command // Center (Cloud SCC) organization. message OrganizationSettings { diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/security_marks.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/security_marks.proto index 02eb9ed23f7..cfcb5f7dcb9 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/security_marks.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/security_marks.proto @@ -23,7 +23,6 @@ option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/ option java_multiple_files = true; option java_package = "com.google.cloud.securitycenter.v1beta1"; - // User specified security marks that are attached to the parent Cloud Security // Command Center (Cloud SCC) resource. Security marks are scoped within a Cloud // SCC organization -- they can be modified and viewed by all users who have diff --git a/packages/google-cloud-securitycenter/synth.metadata b/packages/google-cloud-securitycenter/synth.metadata index e63e93f275a..1cd34e3cf53 100644 --- a/packages/google-cloud-securitycenter/synth.metadata +++ b/packages/google-cloud-securitycenter/synth.metadata @@ -1,5 +1,5 @@ { - "updateTime": "2019-02-26T12:37:43.580695Z", + "updateTime": "2019-03-01T12:20:31.246886Z", "sources": [ { "generator": { @@ -12,15 +12,15 @@ "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "29f098cb03a9983cc9cb15993de5da64419046f2", - "internalRef": "235621085" + "sha": "41d72d444fbe445f4da89e13be02078734fb7875", + "internalRef": "236230004" } }, { "template": { "name": "node_library", "origin": "synthtool.gcp", - "version": "2019.1.16" + "version": "2019.2.26" } } ], From 4531edd6fd8dd081a14bdf6a0575d78486a2ba16 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot <44816363+yoshi-automation@users.noreply.github.com> Date: Tue, 5 Mar 2019 05:34:41 -0800 Subject: [PATCH 044/342] build: update release configuration This PR was generated using Autosynth. :rainbow: Here's the log from Synthtool: ``` synthtool > Executing /tmpfs/src/git/autosynth/working_repo/synth.py. synthtool > Ensuring dependencies. synthtool > Pulling artman image. latest: Pulling from googleapis/artman Digest: sha256:f3d61ae45abaeefb6be5f228cda22732c2f1b00fb687c79c4bd4f2c42bb1e1a7 Status: Image is up to date for googleapis/artman:latest synthtool > Cloning googleapis. synthtool > Running generator for google/cloud/securitycenter/artman_securitycenter_v1beta1.yaml. synthtool > Generated code into /home/kbuilder/.cache/synthtool/googleapis/artman-genfiles/js/securitycenter-v1beta1. .eslintignore .eslintrc.yml .github/ISSUE_TEMPLATE/bug_report.md .github/ISSUE_TEMPLATE/feature_request.md .github/ISSUE_TEMPLATE/support_request.md .jsdoc.js .kokoro/common.cfg .kokoro/continuous/node10/common.cfg .kokoro/continuous/node10/test.cfg .kokoro/continuous/node11/common.cfg .kokoro/continuous/node11/test.cfg .kokoro/continuous/node6/common.cfg .kokoro/continuous/node6/test.cfg .kokoro/continuous/node8/common.cfg .kokoro/continuous/node8/docs.cfg .kokoro/continuous/node8/lint.cfg .kokoro/continuous/node8/samples-test.cfg .kokoro/continuous/node8/system-test-grpcjs.cfg .kokoro/continuous/node8/system-test.cfg .kokoro/continuous/node8/test.cfg .kokoro/docs.sh .kokoro/lint.sh .kokoro/presubmit/node10/common.cfg .kokoro/presubmit/node10/test.cfg .kokoro/presubmit/node11/common.cfg .kokoro/presubmit/node11/test.cfg .kokoro/presubmit/node6/common.cfg .kokoro/presubmit/node6/test.cfg .kokoro/presubmit/node8/common.cfg .kokoro/presubmit/node8/docs.cfg .kokoro/presubmit/node8/lint.cfg .kokoro/presubmit/node8/samples-test.cfg .kokoro/presubmit/node8/system-test-grpcjs.cfg .kokoro/presubmit/node8/system-test.cfg .kokoro/presubmit/node8/test.cfg .kokoro/presubmit/windows/common.cfg .kokoro/presubmit/windows/test.cfg .kokoro/publish.sh .kokoro/release/publish.cfg .kokoro/samples-test.sh .kokoro/system-test.sh .kokoro/test.bat .kokoro/test.sh .kokoro/trampoline.sh .nycrc .prettierignore .prettierrc CODE_OF_CONDUCT.md CONTRIBUTING.md LICENSE codecov.yaml renovate.json synthtool > Replaced '\\[\\\\p\\{L\\}\\\\p\\{N\\}\\]\\(https:\\/\\/cloud\\.google\\.com\\{\\\\p\\{L\\}\\\\p\\{N\\}_- \\]\\{0\\,30\\}\\[\\\\p\\{L\\}\\\\p\\{N\\}\\]\\)\\?' in src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_source.js. synthtool > Replaced 'https:\\/\\/cloud\\.google\\.com[\\s\\*]*http:\\/\\/(.*)[\\s\\*]*\\)' in src/v1beta1/doc/google/protobuf/doc_timestamp.js. synthtool > Replaced 'toISOString\\]' in src/v1beta1/doc/google/protobuf/doc_timestamp.js. > grpc@1.19.0 install /tmpfs/src/git/autosynth/working_repo/node_modules/grpc > node-pre-gyp install --fallback-to-build --library=static_library node-pre-gyp WARN Using needle for node-pre-gyp https download [grpc] Success: "/tmpfs/src/git/autosynth/working_repo/node_modules/grpc/src/node/extension_binary/node-v57-linux-x64-glibc/grpc_node.node" is installed via remote > protobufjs@6.8.8 postinstall /tmpfs/src/git/autosynth/working_repo/node_modules/protobufjs > node scripts/postinstall npm notice created a lockfile as package-lock.json. You should commit this file. npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.7 (node_modules/fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.7: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"}) added 1107 packages from 1300 contributors and audited 6738 packages in 26.021s found 1 low severity vulnerability run `npm audit fix` to fix them, or `npm audit` for details > @google-cloud/security-center@0.1.2 fix /tmpfs/src/git/autosynth/working_repo > eslint --fix '**/*.js' synthtool > Cleaned up 2 temporary directories. synthtool > Wrote metadata to synth.metadata. ``` --- packages/google-cloud-securitycenter/synth.metadata | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/google-cloud-securitycenter/synth.metadata b/packages/google-cloud-securitycenter/synth.metadata index 1cd34e3cf53..3773e38ec98 100644 --- a/packages/google-cloud-securitycenter/synth.metadata +++ b/packages/google-cloud-securitycenter/synth.metadata @@ -1,5 +1,5 @@ { - "updateTime": "2019-03-01T12:20:31.246886Z", + "updateTime": "2019-03-05T12:23:57.461335Z", "sources": [ { "generator": { @@ -12,8 +12,8 @@ "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "41d72d444fbe445f4da89e13be02078734fb7875", - "internalRef": "236230004" + "sha": "b4a22569c88f1f0444e889d8139ddacb799f287c", + "internalRef": "236712632" } }, { From b42363eeac7882fda4e380be36105d2af4eabf33 Mon Sep 17 00:00:00 2001 From: Jonathan Lui Date: Thu, 7 Mar 2019 18:05:57 -0800 Subject: [PATCH 045/342] build: Add docuploader credentials to node publish jobs (#59) --- .../synth.metadata | 28 +++---------------- 1 file changed, 4 insertions(+), 24 deletions(-) diff --git a/packages/google-cloud-securitycenter/synth.metadata b/packages/google-cloud-securitycenter/synth.metadata index 3773e38ec98..2b6dcd9d0ae 100644 --- a/packages/google-cloud-securitycenter/synth.metadata +++ b/packages/google-cloud-securitycenter/synth.metadata @@ -1,38 +1,18 @@ { - "updateTime": "2019-03-05T12:23:57.461335Z", + "updateTime": "2019-03-08T00:45:46.676886Z", "sources": [ { "generator": { "name": "artman", - "version": "0.16.14", - "dockerImage": "googleapis/artman@sha256:f3d61ae45abaeefb6be5f228cda22732c2f1b00fb687c79c4bd4f2c42bb1e1a7" + "version": "0.16.15", + "dockerImage": "googleapis/artman@sha256:9caadfa59d48224cba5f3217eb9d61a155b78ccf31e628abef385bc5b7ed3bd2" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "b4a22569c88f1f0444e889d8139ddacb799f287c", - "internalRef": "236712632" - } - }, - { - "template": { - "name": "node_library", - "origin": "synthtool.gcp", - "version": "2019.2.26" - } - } - ], - "destinations": [ - { - "client": { - "source": "googleapis", - "apiName": "securitycenter", - "apiVersion": "v1beta1", - "language": "nodejs", - "generator": "gapic", - "config": "google/cloud/securitycenter/artman_securitycenter_v1beta1.yaml" + "sha": "c986e1d9618ac41343962b353d136201d72626ae" } } ] From 7c263cd9be5ec7a063a8e3e7c12f3d75e06e6336 Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Mon, 11 Mar 2019 09:51:55 -0700 Subject: [PATCH 046/342] feat: add v1 variant of the API (#61) * feat: add v1 variant of the API * fixy --- .../google-cloud-securitycenter/.gitignore | 1 + .../cloud/securitycenter/v1/asset.proto | 102 + .../cloud/securitycenter/v1/finding.proto | 100 + .../v1/organization_settings.proto | 77 + .../securitycenter/v1/security_marks.proto | 47 + .../v1/securitycenter_service.proto | 892 ++++++ .../cloud/securitycenter/v1/source.proto | 56 + .../google-cloud-securitycenter/src/index.js | 13 +- .../cloud/securitycenter/v1/doc_asset.js | 124 + .../cloud/securitycenter/v1/doc_finding.js | 116 + .../v1/doc_organization_settings.js | 98 + .../securitycenter/v1/doc_security_marks.js | 46 + .../v1/doc_securitycenter_service.js | 989 ++++++ .../cloud/securitycenter/v1/doc_source.js | 53 + .../v1/doc/google/iam/v1/doc_iam_policy.js | 93 + .../src/v1/doc/google/iam/v1/doc_policy.js | 118 + .../doc/google/longrunning/doc_operations.js | 63 + .../src/v1/doc/google/protobuf/doc_any.js | 136 + .../v1/doc/google/protobuf/doc_duration.js | 97 + .../v1/doc/google/protobuf/doc_field_mask.js | 236 ++ .../src/v1/doc/google/protobuf/doc_struct.js | 112 + .../v1/doc/google/protobuf/doc_timestamp.js | 113 + .../src/v1/doc/google/rpc/doc_status.js | 95 + .../src/v1/index.js | 19 + .../src/v1/security_center_client.js | 2777 +++++++++++++++++ .../src/v1/security_center_client_config.json | 116 + .../synth.metadata | 34 +- packages/google-cloud-securitycenter/synth.py | 4 +- .../test/gapic-v1.js | 1288 ++++++++ 29 files changed, 8010 insertions(+), 5 deletions(-) create mode 100644 packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/asset.proto create mode 100644 packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/finding.proto create mode 100644 packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/organization_settings.proto create mode 100644 packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/security_marks.proto create mode 100644 packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/securitycenter_service.proto create mode 100644 packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/source.proto create mode 100644 packages/google-cloud-securitycenter/src/v1/doc/google/cloud/securitycenter/v1/doc_asset.js create mode 100644 packages/google-cloud-securitycenter/src/v1/doc/google/cloud/securitycenter/v1/doc_finding.js create mode 100644 packages/google-cloud-securitycenter/src/v1/doc/google/cloud/securitycenter/v1/doc_organization_settings.js create mode 100644 packages/google-cloud-securitycenter/src/v1/doc/google/cloud/securitycenter/v1/doc_security_marks.js create mode 100644 packages/google-cloud-securitycenter/src/v1/doc/google/cloud/securitycenter/v1/doc_securitycenter_service.js create mode 100644 packages/google-cloud-securitycenter/src/v1/doc/google/cloud/securitycenter/v1/doc_source.js create mode 100644 packages/google-cloud-securitycenter/src/v1/doc/google/iam/v1/doc_iam_policy.js create mode 100644 packages/google-cloud-securitycenter/src/v1/doc/google/iam/v1/doc_policy.js create mode 100644 packages/google-cloud-securitycenter/src/v1/doc/google/longrunning/doc_operations.js create mode 100644 packages/google-cloud-securitycenter/src/v1/doc/google/protobuf/doc_any.js create mode 100644 packages/google-cloud-securitycenter/src/v1/doc/google/protobuf/doc_duration.js create mode 100644 packages/google-cloud-securitycenter/src/v1/doc/google/protobuf/doc_field_mask.js create mode 100644 packages/google-cloud-securitycenter/src/v1/doc/google/protobuf/doc_struct.js create mode 100644 packages/google-cloud-securitycenter/src/v1/doc/google/protobuf/doc_timestamp.js create mode 100644 packages/google-cloud-securitycenter/src/v1/doc/google/rpc/doc_status.js create mode 100644 packages/google-cloud-securitycenter/src/v1/index.js create mode 100644 packages/google-cloud-securitycenter/src/v1/security_center_client.js create mode 100644 packages/google-cloud-securitycenter/src/v1/security_center_client_config.json create mode 100644 packages/google-cloud-securitycenter/test/gapic-v1.js diff --git a/packages/google-cloud-securitycenter/.gitignore b/packages/google-cloud-securitycenter/.gitignore index 95fcedf6538..97cdf45ca3b 100644 --- a/packages/google-cloud-securitycenter/.gitignore +++ b/packages/google-cloud-securitycenter/.gitignore @@ -9,3 +9,4 @@ system-test/*key.json *.lock **/package-lock.json .DS_Store +__pycache__ diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/asset.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/asset.proto new file mode 100644 index 00000000000..97b5bfb0b94 --- /dev/null +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/asset.proto @@ -0,0 +1,102 @@ +// Copyright 2019 Google LLC. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +syntax = "proto3"; + +package google.cloud.securitycenter.v1; + +import "google/api/annotations.proto"; +import "google/cloud/securitycenter/v1/security_marks.proto"; +import "google/protobuf/struct.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1;securitycenter"; +option java_multiple_files = true; +option java_package = "com.google.cloud.securitycenter.v1"; + +// Cloud Security Command Center's (Cloud SCC) representation of a Google Cloud +// Platform (GCP) resource. +// +// The Asset is a Cloud SCC resource that captures information about a single +// GCP resource. All modifications to an Asset are only within the context of +// Cloud SCC and don't affect the referenced GCP resource. +message Asset { + // Cloud SCC managed properties. These properties are managed by Cloud SCC and + // cannot be modified by the user. + message SecurityCenterProperties { + // The full resource name of the GCP resource this asset + // represents. This field is immutable after create time. See: + // https://cloud.google.com/apis/design/resource_names#full_resource_name + string resource_name = 1; + + // The type of the GCP resource. Examples include: APPLICATION, + // PROJECT, and ORGANIZATION. This is a case insensitive field defined by + // Cloud SCC and/or the producer of the resource and is immutable + // after create time. + string resource_type = 2; + + // The full resource name of the immediate parent of the resource. See: + // https://cloud.google.com/apis/design/resource_names#full_resource_name + string resource_parent = 3; + + // The full resource name of the project the resource belongs to. See: + // https://cloud.google.com/apis/design/resource_names#full_resource_name + string resource_project = 4; + + // Owners of the Google Cloud resource. + repeated string resource_owners = 5; + } + + // IAM Policy information associated with the GCP resource described by the + // Cloud SCC asset. This information is managed and defined by the GCP + // resource and cannot be modified by the user. + message IamPolicy { + // The JSON representation of the Policy associated with the asset. + // See https://cloud.google.com/iam/reference/rest/v1/Policy for format + // details. + string policy_blob = 1; + } + + // The relative resource name of this asset. See: + // https://cloud.google.com/apis/design/resource_names#relative_resource_name + // Example: + // "organizations/123/assets/456". + string name = 1; + + // Cloud SCC managed properties. These properties are managed by + // Cloud SCC and cannot be modified by the user. + SecurityCenterProperties security_center_properties = 2; + + // Resource managed properties. These properties are managed and defined by + // the GCP resource and cannot be modified by the user. + map resource_properties = 7; + + // User specified security marks. These marks are entirely managed by the user + // and come from the SecurityMarks resource that belongs to the asset. + SecurityMarks security_marks = 8; + + // The time at which the asset was created in Cloud SCC. + google.protobuf.Timestamp create_time = 9; + + // The time at which the asset was last updated, added, or deleted in Cloud + // SCC. + google.protobuf.Timestamp update_time = 10; + + // IAM Policy information associated with the GCP resource described by the + // Cloud SCC asset. This information is managed and defined by the GCP + // resource and cannot be modified by the user. + IamPolicy iam_policy = 11; +} diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/finding.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/finding.proto new file mode 100644 index 00000000000..0c20b85f693 --- /dev/null +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/finding.proto @@ -0,0 +1,100 @@ +// Copyright 2019 Google LLC. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +syntax = "proto3"; + +package google.cloud.securitycenter.v1; + +import "google/api/annotations.proto"; +import "google/cloud/securitycenter/v1/security_marks.proto"; +import "google/protobuf/struct.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1;securitycenter"; +option java_multiple_files = true; +option java_package = "com.google.cloud.securitycenter.v1"; + +// Cloud Security Command Center (Cloud SCC) finding. +// +// A finding is a record of assessment data (security, risk, health or privacy) +// ingested into Cloud SCC for presentation, notification, analysis, +// policy testing, and enforcement. For example, an XSS vulnerability in an +// App Engine application is a finding. +message Finding { + // The state of the finding. + enum State { + // Unspecified state. + STATE_UNSPECIFIED = 0; + + // The finding requires attention and has not been addressed yet. + ACTIVE = 1; + + // The finding has been fixed, triaged as a non-issue or otherwise addressed + // and is no longer active. + INACTIVE = 2; + } + + // The relative resource name of this finding. See: + // https://cloud.google.com/apis/design/resource_names#relative_resource_name + // Example: + // "organizations/123/sources/456/findings/789" + string name = 1; + + // The relative resource name of the source the finding belongs to. See: + // https://cloud.google.com/apis/design/resource_names#relative_resource_name + // This field is immutable after creation time. + // For example: + // "organizations/123/sources/456" + string parent = 2; + + // The full resource name of the Google Cloud Platform (GCP) resource this + // finding is for. See: + // https://cloud.google.com/apis/design/resource_names#full_resource_name + // This field is immutable after creation time. + string resource_name = 3; + + // The state of the finding. + State state = 4; + + // The additional taxonomy group within findings from a given source. + // This field is immutable after creation time. + // Example: "XSS_FLASH_INJECTION" + string category = 5; + + // The URI that, if available, points to a web page outside of Cloud SCC + // where additional information about the finding can be found. This field is + // guaranteed to be either empty or a well formed URL. + string external_uri = 6; + + // Source specific properties. These properties are managed by the source + // that writes the finding. The key names in the source_properties map must be + // between 1 and 255 characters, and must start with a letter and contain + // alphanumeric characters or underscores only. + map source_properties = 7; + + // Output only. User specified security marks. These marks are entirely + // managed by the user and come from the SecurityMarks resource that belongs + // to the finding. + SecurityMarks security_marks = 8; + + // The time at which the event took place. For example, if the finding + // represents an open firewall it would capture the time the open firewall was + // detected. + google.protobuf.Timestamp event_time = 9; + + // The time at which the finding was created in Cloud SCC. + google.protobuf.Timestamp create_time = 10; +} diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/organization_settings.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/organization_settings.proto new file mode 100644 index 00000000000..92c2f9d5b85 --- /dev/null +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/organization_settings.proto @@ -0,0 +1,77 @@ +// Copyright 2019 Google LLC. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +syntax = "proto3"; + +package google.cloud.securitycenter.v1; + +import "google/api/annotations.proto"; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1;securitycenter"; +option java_multiple_files = true; +option java_package = "com.google.cloud.securitycenter.v1"; + +// User specified settings that are attached to the Cloud Security Command +// Center (Cloud SCC) organization. +message OrganizationSettings { + // The configuration used for Asset Discovery runs. + message AssetDiscoveryConfig { + // The mode of inclusion when running Asset Discovery. + // Asset discovery can be limited by explicitly identifying projects to be + // included or excluded. If INCLUDE_ONLY is set, then only those projects + // within the organization and their children are discovered during asset + // discovery. If EXCLUDE is set, then projects that don't match those + // projects are discovered during asset discovery. If neither are set, then + // all projects within the organization are discovered during asset + // discovery. + enum InclusionMode { + // Unspecified. Setting the mode with this value will disable + // inclusion/exclusion filtering for Asset Discovery. + INCLUSION_MODE_UNSPECIFIED = 0; + + // Asset Discovery will capture only the resources within the projects + // specified. All other resources will be ignored. + INCLUDE_ONLY = 1; + + // Asset Discovery will ignore all resources under the projects specified. + // All other resources will be retrieved. + EXCLUDE = 2; + } + + // The project ids to use for filtering asset discovery. + repeated string project_ids = 1; + + // The mode to use for filtering asset discovery. + InclusionMode inclusion_mode = 2; + } + + // The relative resource name of the settings. See: + // https://cloud.google.com/apis/design/resource_names#relative_resource_name + // Example: + // "organizations/123/organizationSettings". + string name = 1; + + // A flag that indicates if Asset Discovery should be enabled. If the flag is + // set to `true`, then discovery of assets will occur. If it is set to `false, + // all historical assets will remain, but discovery of future assets will not + // occur. + bool enable_asset_discovery = 2; + + // The configuration used for Asset Discovery runs. + AssetDiscoveryConfig asset_discovery_config = 3; + + reserved 4, 5; +} diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/security_marks.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/security_marks.proto new file mode 100644 index 00000000000..00328a53d55 --- /dev/null +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/security_marks.proto @@ -0,0 +1,47 @@ +// Copyright 2019 Google LLC. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +syntax = "proto3"; + +package google.cloud.securitycenter.v1; + +import "google/api/annotations.proto"; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1;securitycenter"; +option java_multiple_files = true; +option java_package = "com.google.cloud.securitycenter.v1"; + +// User specified security marks that are attached to the parent Cloud Security +// Command Center (Cloud SCC) resource. Security marks are scoped within a Cloud +// SCC organization -- they can be modified and viewed by all users who have +// proper permissions on the organization. +message SecurityMarks { + // The relative resource name of the SecurityMarks. See: + // https://cloud.google.com/apis/design/resource_names#relative_resource_name + // Examples: + // "organizations/123/assets/456/securityMarks" + // "organizations/123/sources/456/findings/789/securityMarks". + string name = 1; + + // Mutable user specified security marks belonging to the parent resource. + // Constraints are as follows: + // - Keys and values are treated as case insensitive + // - Keys must be between 1 - 256 characters (inclusive) + // - Keys must be letters, numbers, underscores, or dashes + // - Values have leading and trailing whitespace trimmed, remaining + // characters must be between 1 - 4096 characters (inclusive) + map marks = 2; +} diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/securitycenter_service.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/securitycenter_service.proto new file mode 100644 index 00000000000..f49fb8528d0 --- /dev/null +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/securitycenter_service.proto @@ -0,0 +1,892 @@ +// Copyright 2019 Google LLC. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +syntax = "proto3"; + +package google.cloud.securitycenter.v1; + +import "google/api/annotations.proto"; +import "google/cloud/securitycenter/v1/asset.proto"; +import "google/cloud/securitycenter/v1/finding.proto"; +import "google/cloud/securitycenter/v1/organization_settings.proto"; +import "google/cloud/securitycenter/v1/security_marks.proto"; +import "google/cloud/securitycenter/v1/source.proto"; +import "google/iam/v1/iam_policy.proto"; +import "google/iam/v1/policy.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/struct.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1;securitycenter"; +option java_multiple_files = true; +option java_package = "com.google.cloud.securitycenter.v1"; + +// V1 APIs for Security Center service. +service SecurityCenter { + // Creates a source. + rpc CreateSource(CreateSourceRequest) returns (Source) { + option (google.api.http) = { + post: "/v1/{parent=organizations/*}/sources" + body: "source" + }; + } + + // Creates a finding. The corresponding source must exist for finding creation + // to succeed. + rpc CreateFinding(CreateFindingRequest) returns (Finding) { + option (google.api.http) = { + post: "/v1/{parent=organizations/*/sources/*}/findings" + body: "finding" + }; + } + + // Gets the access control policy on the specified Source. + rpc GetIamPolicy(google.iam.v1.GetIamPolicyRequest) + returns (google.iam.v1.Policy) { + option (google.api.http) = { + post: "/v1/{resource=organizations/*/sources/*}:getIamPolicy" + body: "*" + }; + } + + // Gets the settings for an organization. + rpc GetOrganizationSettings(GetOrganizationSettingsRequest) + returns (OrganizationSettings) { + option (google.api.http) = { + get: "/v1/{name=organizations/*/organizationSettings}" + }; + } + + // Gets a source. + rpc GetSource(GetSourceRequest) returns (Source) { + option (google.api.http) = { + get: "/v1/{name=organizations/*/sources/*}" + }; + } + + // Filters an organization's assets and groups them by their specified + // properties. + rpc GroupAssets(GroupAssetsRequest) returns (GroupAssetsResponse) { + option (google.api.http) = { + post: "/v1/{parent=organizations/*}/assets:group" + body: "*" + }; + } + + // Filters an organization or source's findings and groups them by their + // specified properties. + // + // To group across all sources provide a `-` as the source id. + // Example: /v1/organizations/123/sources/-/findings + rpc GroupFindings(GroupFindingsRequest) returns (GroupFindingsResponse) { + option (google.api.http) = { + post: "/v1/{parent=organizations/*/sources/*}/findings:group" + body: "*" + }; + } + + // Lists an organization's assets. + rpc ListAssets(ListAssetsRequest) returns (ListAssetsResponse) { + option (google.api.http) = { + get: "/v1/{parent=organizations/*}/assets" + }; + } + + // Lists an organization or source's findings. + // + // To list across all sources provide a `-` as the source id. + // Example: /v1/organizations/123/sources/-/findings + rpc ListFindings(ListFindingsRequest) returns (ListFindingsResponse) { + option (google.api.http) = { + get: "/v1/{parent=organizations/*/sources/*}/findings" + }; + } + + // Lists all sources belonging to an organization. + rpc ListSources(ListSourcesRequest) returns (ListSourcesResponse) { + option (google.api.http) = { + get: "/v1/{parent=organizations/*}/sources" + }; + } + + // Runs asset discovery. The discovery is tracked with a long-running + // operation. + // + // This API can only be called with limited frequency for an organization. If + // it is called too frequently the caller will receive a TOO_MANY_REQUESTS + // error. + rpc RunAssetDiscovery(RunAssetDiscoveryRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=organizations/*}/assets:runDiscovery" + body: "*" + }; + } + + // Updates the state of a finding. + rpc SetFindingState(SetFindingStateRequest) returns (Finding) { + option (google.api.http) = { + post: "/v1/{name=organizations/*/sources/*/findings/*}:setState" + body: "*" + }; + } + + // Sets the access control policy on the specified Source. + rpc SetIamPolicy(google.iam.v1.SetIamPolicyRequest) + returns (google.iam.v1.Policy) { + option (google.api.http) = { + post: "/v1/{resource=organizations/*/sources/*}:setIamPolicy" + body: "*" + }; + } + + // Returns the permissions that a caller has on the specified source. + rpc TestIamPermissions(google.iam.v1.TestIamPermissionsRequest) + returns (google.iam.v1.TestIamPermissionsResponse) { + option (google.api.http) = { + post: "/v1/{resource=organizations/*/sources/*}:testIamPermissions" + body: "*" + }; + } + + // Creates or updates a finding. The corresponding source must exist for a + // finding creation to succeed. + rpc UpdateFinding(UpdateFindingRequest) returns (Finding) { + option (google.api.http) = { + patch: "/v1/{finding.name=organizations/*/sources/*/findings/*}" + body: "finding" + }; + } + + // Updates an organization's settings. + rpc UpdateOrganizationSettings(UpdateOrganizationSettingsRequest) + returns (OrganizationSettings) { + option (google.api.http) = { + patch: "/v1/{organization_settings.name=organizations/*/organizationSettings}" + body: "organization_settings" + }; + } + + // Updates a source. + rpc UpdateSource(UpdateSourceRequest) returns (Source) { + option (google.api.http) = { + patch: "/v1/{source.name=organizations/*/sources/*}" + body: "source" + }; + } + + // Updates security marks. + rpc UpdateSecurityMarks(UpdateSecurityMarksRequest) returns (SecurityMarks) { + option (google.api.http) = { + patch: "/v1/{security_marks.name=organizations/*/assets/*/securityMarks}" + body: "security_marks" + additional_bindings { + patch: "/v1/{security_marks.name=organizations/*/sources/*/findings/*/securityMarks}" + body: "security_marks" + } + }; + } +} + +// Request message for creating a finding. +message CreateFindingRequest { + // Resource name of the new finding's parent. Its format should be + // "organizations/[organization_id]/sources/[source_id]". + string parent = 1; + + // Unique identifier provided by the client within the parent scope. + // It must be alphanumeric and less than or equal to 32 characters and + // greater than 0 characters in length. + string finding_id = 2; + + // The Finding being created. The name and security_marks will be ignored as + // they are both output only fields on this resource. + Finding finding = 3; +} + +// Request message for creating a source. +message CreateSourceRequest { + // Resource name of the new source's parent. Its format should be + // "organizations/[organization_id]". + string parent = 1; + + // The Source being created, only the display_name and description will be + // used. All other fields will be ignored. + Source source = 2; +} + +// Request message for getting organization settings. +message GetOrganizationSettingsRequest { + // Name of the organization to get organization settings for. Its format is + // "organizations/[organization_id]/organizationSettings". + string name = 1; +} + +// Request message for getting a source. +message GetSourceRequest { + // Relative resource name of the source. Its format is + // "organizations/[organization_id]/source/[source_id]". + string name = 1; +} + +// Request message for grouping by assets. +message GroupAssetsRequest { + // Name of the organization to groupBy. Its format is + // "organizations/[organization_id]". + string parent = 1; + + // Expression that defines the filter to apply across assets. + // The expression is a list of zero or more restrictions combined via logical + // operators `AND` and `OR`. + // Parentheses are supported, and `OR` has higher precedence than `AND`. + // + // Restrictions have the form ` ` and may have a `-` + // character in front of them to indicate negation. The fields map to those + // defined in the Asset resource. Examples include: + // + // * name + // * security_center_properties.resource_name + // * resource_properties.a_property + // * security_marks.marks.marka + // + // The supported operators are: + // + // * `=` for all value types. + // * `>`, `<`, `>=`, `<=` for integer values. + // * `:`, meaning substring matching, for strings. + // + // The supported value types are: + // + // * string literals in quotes. + // * integer literals without quotes. + // * boolean literals `true` and `false` without quotes. + // + // For example, `resource_properties.size = 100` is a valid filter string. + string filter = 2; + + // Expression that defines what assets fields to use for grouping. The string + // value should follow SQL syntax: comma separated list of fields. For + // example: + // "security_center_properties.resource_project,security_center_properties.project". + // + // The following fields are supported when compare_duration is not set: + // + // * security_center_properties.resource_project + // * security_center_properties.resource_type + // * security_center_properties.resource_parent + // + // The following fields are supported when compare_duration is set: + // + // * security_center_properties.resource_type + string group_by = 3; + + // When compare_duration is set, the GroupResult's "state_change" property is + // updated to indicate whether the asset was added, removed, or remained + // present during the compare_duration period of time that precedes the + // read_time. This is the time between (read_time - compare_duration) and + // read_time. + // + // The state change value is derived based on the presence of the asset at the + // two points in time. Intermediate state changes between the two times don't + // affect the result. For example, the results aren't affected if the asset is + // removed and re-created again. + // + // Possible "state_change" values when compare_duration is specified: + // + // * "ADDED": indicates that the asset was not present at the start of + // compare_duration, but present at reference_time. + // * "REMOVED": indicates that the asset was present at the start of + // compare_duration, but not present at reference_time. + // * "ACTIVE": indicates that the asset was present at both the + // start and the end of the time period defined by + // compare_duration and reference_time. + // + // If compare_duration is not specified, then the only possible state_change + // is "UNUSED", which will be the state_change set for all assets present at + // read_time. + // + // If this field is set then `state_change` must be a specified field in + // `group_by`. + google.protobuf.Duration compare_duration = 4; + + // Time used as a reference point when filtering assets. The filter is limited + // to assets existing at the supplied time and their values are those at that + // specific time. Absence of this field will default to the API's version of + // NOW. + google.protobuf.Timestamp read_time = 5; + + // Filter that specifies what fields to further filter on *after* the query + // filter has been executed. Currently only 'state_change' is supported and + // requires compare_duration to be specified. + string having = 6; + + // The value returned by the last `GroupAssetsResponse`; indicates + // that this is a continuation of a prior `GroupAssets` call, and that the + // system should return the next page of data. + string page_token = 7; + + // The maximum number of results to return in a single response. Default is + // 10, minimum is 1, maximum is 1000. + int32 page_size = 8; +} + +// Response message for grouping by assets. +message GroupAssetsResponse { + // Group results. There exists an element for each existing unique + // combination of property/values. The element contains a count for the number + // of times those specific property/values appear. + repeated GroupResult group_by_results = 1; + + // Time used for executing the groupBy request. + google.protobuf.Timestamp read_time = 2; + + // Token to retrieve the next page of results, or empty if there are no more + // results. + string next_page_token = 3; + + // The total number of results matching the query. + int32 total_size = 4; +} + +// Request message for grouping by findings. +message GroupFindingsRequest { + // Name of the source to groupBy. Its format is + // "organizations/[organization_id]/sources/[source_id]". To groupBy across + // all sources provide a source_id of `-`. For example: + // organizations/123/sources/- + string parent = 1; + + // Expression that defines the filter to apply across findings. + // The expression is a list of one or more restrictions combined via logical + // operators `AND` and `OR`. + // Parentheses are supported, and `OR` has higher precedence than `AND`. + // + // Restrictions have the form ` ` and may have a `-` + // character in front of them to indicate negation. Examples include: + // + // * name + // * source_properties.a_property + // * security_marks.marks.marka + // + // The supported operators are: + // + // * `=` for all value types. + // * `>`, `<`, `>=`, `<=` for integer values. + // * `:`, meaning substring matching, for strings. + // + // The supported value types are: + // + // * string literals in quotes. + // * integer literals without quotes. + // * boolean literals `true` and `false` without quotes. + // + // For example, `source_properties.size = 100` is a valid filter string. + string filter = 2; + + // Expression that defines what assets fields to use for grouping (including + // `state_change`). The string value should follow SQL syntax: comma separated + // list of fields. For example: "parent,resource_name". + // + // The following fields are supported: + // + // * resource_name + // * category + // * state + // * state_change + // * parent + string group_by = 3; + + // Time used as a reference point when filtering findings. The filter is + // limited to findings existing at the supplied time and their values are + // those at that specific time. Absence of this field will default to the + // API's version of NOW. + google.protobuf.Timestamp read_time = 4; + + // When compare_duration is set, the GroupResult's "state_change" attribute is + // updated to indicate whether the finding had its state changed, the + // finding's state remained unchanged, or if the finding was added during the + // compare_duration period of time that precedes the read_time. This is the + // time between (read_time - compare_duration) and read_time. + // + // The state_change value is derived based on the presence and state of the + // finding at the two points in time. Intermediate state changes between the + // two times don't affect the result. For example, the results aren't affected + // if the finding is made inactive and then active again. + // + // Possible "state_change" values when compare_duration is specified: + // + // * "CHANGED": indicates that the finding was present at the start of + // compare_duration, but changed its state at read_time. + // * "UNCHANGED": indicates that the finding was present at the start of + // compare_duration and did not change state at read_time. + // * "ADDED": indicates that the finding was not present at the start + // of compare_duration, but was present at read_time. + // + // If compare_duration is not specified, then the only possible state_change + // is "UNUSED", which will be the state_change set for all findings present + // at read_time. + // + // If this field is set then `state_change` must be a specified field in + // `group_by`. + google.protobuf.Duration compare_duration = 5; + + // Filter that specifies what fields to further filter on *after* the query + // filter has been executed. Currently only 'finding.state' and 'state_change' + // are supported and requires compare_duration to be specified. + string having = 6; + + // The value returned by the last `GroupFindingsResponse`; indicates + // that this is a continuation of a prior `GroupFindings` call, and + // that the system should return the next page of data. + string page_token = 7; + + // The maximum number of results to return in a single response. Default is + // 10, minimum is 1, maximum is 1000. + int32 page_size = 8; +} + +// Response message for group by findings. +message GroupFindingsResponse { + // Group results. There exists an element for each existing unique + // combination of property/values. The element contains a count for the number + // of times those specific property/values appear. + repeated GroupResult group_by_results = 1; + + // Time used for executing the groupBy request. + google.protobuf.Timestamp read_time = 2; + + // Token to retrieve the next page of results, or empty if there are no more + // results. + string next_page_token = 3; + + // The total number of results matching the query. + int32 total_size = 4; +} + +// Result containing the properties and count of a groupBy request. +message GroupResult { + // Properties matching the groupBy fields in the request. + map properties = 1; + + // Total count of resources for the given properties. + int64 count = 2; +} + +// Request message for listing sources. +message ListSourcesRequest { + // Resource name of the parent of sources to list. Its format should be + // "organizations/[organization_id]". + string parent = 1; + + // The value returned by the last `ListSourcesResponse`; indicates + // that this is a continuation of a prior `ListSources` call, and + // that the system should return the next page of data. + string page_token = 2; + + // The maximum number of results to return in a single response. Default is + // 10, minimum is 1, maximum is 1000. + int32 page_size = 7; +} + +// Response message for listing sources. +message ListSourcesResponse { + // Sources belonging to the requested parent. + repeated Source sources = 1; + + // Token to retrieve the next page of results, or empty if there are no more + // results. + string next_page_token = 2; +} + +// Request message for listing assets. +message ListAssetsRequest { + // Name of the organization assets should belong to. Its format is + // "organizations/[organization_id]". + string parent = 1; + + // Expression that defines the filter to apply across assets. + // The expression is a list of zero or more restrictions combined via logical + // operators `AND` and `OR`. + // Parentheses are supported, and `OR` has higher precedence than `AND`. + // + // Restrictions have the form ` ` and may have a `-` + // character in front of them to indicate negation. The fields map to those + // defined in the Asset resource. Examples include: + // + // * name + // * security_center_properties.resource_name + // * resource_properties.a_property + // * security_marks.marks.marka + // + // The supported operators are: + // + // * `=` for all value types. + // * `>`, `<`, `>=`, `<=` for integer values. + // * `:`, meaning substring matching, for strings. + // + // The supported value types are: + // + // * string literals in quotes. + // * integer literals without quotes. + // * boolean literals `true` and `false` without quotes. + // + // For example, `resource_properties.size = 100` is a valid filter string. + string filter = 2; + + // Expression that defines what fields and order to use for sorting. The + // string value should follow SQL syntax: comma separated list of fields. For + // example: "name,resource_properties.a_property". The default sorting order + // is ascending. To specify descending order for a field, a suffix " desc" + // should be appended to the field name. For example: "name + // desc,resource_properties.a_property". Redundant space characters in the + // syntax are insignificant. "name desc,resource_properties.a_property" and " + // name desc , resource_properties.a_property " are equivalent. + string order_by = 3; + + // Time used as a reference point when filtering assets. The filter is limited + // to assets existing at the supplied time and their values are those at that + // specific time. Absence of this field will default to the API's version of + // NOW. + google.protobuf.Timestamp read_time = 4; + + // When compare_duration is set, the ListAssetsResult's "state_change" + // attribute is updated to indicate whether the asset was added, removed, or + // remained present during the compare_duration period of time that precedes + // the read_time. This is the time between (read_time - compare_duration) and + // read_time. + // + // The state_change value is derived based on the presence of the asset at the + // two points in time. Intermediate state changes between the two times don't + // affect the result. For example, the results aren't affected if the asset is + // removed and re-created again. + // + // Possible "state_change" values when compare_duration is specified: + // + // * "ADDED": indicates that the asset was not present at the start of + // compare_duration, but present at read_time. + // * "REMOVED": indicates that the asset was present at the start of + // compare_duration, but not present at read_time. + // * "ACTIVE": indicates that the asset was present at both the + // start and the end of the time period defined by + // compare_duration and read_time. + // + // If compare_duration is not specified, then the only possible state_change + // is "UNUSED", which will be the state_change set for all assets present at + // read_time. + google.protobuf.Duration compare_duration = 5; + + // Filter that specifies what fields to further filter on *after* the query + // filter has been executed. Currently only 'state_change' is supported and + // requires compare_duration to be specified. + string having = 6; + + // Optional. + // + // A field mask to specify the ListAssetsResult fields to be listed in the + // response. + // An empty field mask will list all fields. + google.protobuf.FieldMask field_mask = 7; + + // The value returned by the last `ListAssetsResponse`; indicates + // that this is a continuation of a prior `ListAssets` call, and + // that the system should return the next page of data. + string page_token = 8; + + // The maximum number of results to return in a single response. Default is + // 10, minimum is 1, maximum is 1000. + int32 page_size = 9; +} + +// Response message for listing assets. +message ListAssetsResponse { + // Result containing the Asset and its State. + message ListAssetsResult { + // The change in state of the asset. + // + // When querying across two points in time this describes + // the change between the two points: ADDED, REMOVED, or ACTIVE. + // If there was no compare_duration supplied in the request the state change + // will be: UNUSED + enum StateChange { + // State change is unused, this is the canonical default for this enum. + UNUSED = 0; + + // Asset was added between the points in time. + ADDED = 1; + + // Asset was removed between the points in time. + REMOVED = 2; + + // Asset was present at both point(s) in time. + ACTIVE = 3; + } + + // Asset matching the search request. + Asset asset = 1; + + // State change of the asset between the points in time. + StateChange state_change = 2; + } + + // Assets matching the list request. + repeated ListAssetsResult list_assets_results = 1; + + // Time used for executing the list request. + google.protobuf.Timestamp read_time = 2; + + // Token to retrieve the next page of results, or empty if there are no more + // results. + string next_page_token = 3; + + // The total number of assets matching the query. + int32 total_size = 4; +} + +// Request message for listing findings. +message ListFindingsRequest { + // Name of the source the findings belong to. Its format is + // "organizations/[organization_id]/sources/[source_id]". To list across all + // sources provide a source_id of `-`. For example: + // organizations/123/sources/- + string parent = 1; + + // Expression that defines the filter to apply across findings. + // The expression is a list of one or more restrictions combined via logical + // operators `AND` and `OR`. + // Parentheses are supported, and `OR` has higher precedence than `AND`. + // + // Restrictions have the form ` ` and may have a `-` + // character in front of them to indicate negation. Examples include: + // + // * name + // * source_properties.a_property + // * security_marks.marks.marka + // + // The supported operators are: + // + // * `=` for all value types. + // * `>`, `<`, `>=`, `<=` for integer values. + // * `:`, meaning substring matching, for strings. + // + // The supported value types are: + // + // * string literals in quotes. + // * integer literals without quotes. + // * boolean literals `true` and `false` without quotes. + // + // For example, `source_properties.size = 100` is a valid filter string. + string filter = 2; + + // Expression that defines what fields and order to use for sorting. The + // string value should follow SQL syntax: comma separated list of fields. For + // example: "name,resource_properties.a_property". The default sorting order + // is ascending. To specify descending order for a field, a suffix " desc" + // should be appended to the field name. For example: "name + // desc,source_properties.a_property". Redundant space characters in the + // syntax are insignificant. "name desc,source_properties.a_property" and " + // name desc , source_properties.a_property " are equivalent. + string order_by = 3; + + // Time used as a reference point when filtering findings. The filter is + // limited to findings existing at the supplied time and their values are + // those at that specific time. Absence of this field will default to the + // API's version of NOW. + google.protobuf.Timestamp read_time = 4; + + // When compare_duration is set, the ListFindingsResult's "state_change" + // attribute is updated to indicate whether the finding had its state changed, + // the finding's state remained unchanged, or if the finding was added in any + // state during the compare_duration period of time that precedes the + // read_time. This is the time between (read_time - compare_duration) and + // read_time. + // + // The state_change value is derived based on the presence and state of the + // finding at the two points in time. Intermediate state changes between the + // two times don't affect the result. For example, the results aren't affected + // if the finding is made inactive and then active again. + // + // Possible "state_change" values when compare_duration is specified: + // + // * "CHANGED": indicates that the finding was present at the start of + // compare_duration, but changed its state at read_time. + // * "UNCHANGED": indicates that the finding was present at the start of + // compare_duration and did not change state at read_time. + // * "ADDED": indicates that the finding was not present at the start + // of compare_duration, but was present at read_time. + // + // If compare_duration is not specified, then the only possible state_change + // is "UNUSED", which will be the state_change set for all findings present at + // read_time. + google.protobuf.Duration compare_duration = 5; + + // Filter that specifies what fields to further filter on *after* the query + // filter has been executed. Currently only 'finding.state' and 'state_change' + // are supported and requires compare_duration to be specified. + string having = 6; + + // Optional. + // + // A field mask to specify the Finding fields to be listed in the response. + // An empty field mask will list all fields. + google.protobuf.FieldMask field_mask = 7; + + // The value returned by the last `ListFindingsResponse`; indicates + // that this is a continuation of a prior `ListFindings` call, and + // that the system should return the next page of data. + string page_token = 8; + + // The maximum number of results to return in a single response. Default is + // 10, minimum is 1, maximum is 1000. + int32 page_size = 9; +} + +// Response message for listing findings. +message ListFindingsResponse { + // Result containing the Finding and its StateChange. + message ListFindingsResult { + // The change in state of the finding. + // + // When querying across two points in time this describes + // the change in the finding between the two points: CHANGED, UNCHANGED, + // ADDED, or REMOVED. Findings can not be deleted, so REMOVED implies that + // the finding at timestamp does not match the filter specified, but it did + // at timestamp - compare_duration. If there was no compare_duration + // supplied in the request the state change will be: UNUSED + enum StateChange { + // State change is unused, this is the canonical default for this enum. + UNUSED = 0; + + // The finding has changed state in some way between the points in time + // and existed at both points. + CHANGED = 1; + + // The finding has not changed state between the points in time and + // existed at both points. + UNCHANGED = 2; + + // The finding was created between the points in time. + ADDED = 3; + + // The finding at timestamp does not match the filter specified, but it + // did at timestamp - compare_duration. + REMOVED = 4; + } + + // Finding matching the search request. + Finding finding = 1; + + // State change of the finding between the points in time. + StateChange state_change = 2; + } + + // Findings matching the list request. + repeated ListFindingsResult list_findings_results = 1; + + // Time used for executing the list request. + google.protobuf.Timestamp read_time = 2; + + // Token to retrieve the next page of results, or empty if there are no more + // results. + string next_page_token = 3; + + // The total number of findings matching the query. + int32 total_size = 4; +} + +// Request message for updating a finding's state. +message SetFindingStateRequest { + // The relative resource name of the finding. See: + // https://cloud.google.com/apis/design/resource_names#relative_resource_name + // Example: + // "organizations/123/sources/456/finding/789". + string name = 1; + + // The desired State of the finding. + Finding.State state = 2; + + // The time at which the updated state takes effect. + google.protobuf.Timestamp start_time = 3; +} + +// Request message for running asset discovery for an organization. +message RunAssetDiscoveryRequest { + // Name of the organization to run asset discovery for. Its format is + // "organizations/[organization_id]". + string parent = 1; +} + +// Request message for updating or creating a finding. +message UpdateFindingRequest { + // The finding resource to update or create if it does not already exist. + // parent, security_marks, and update_time will be ignored. + // + // In the case of creation, the finding id portion of the name must be + // alphanumeric and less than or equal to 32 characters and greater than 0 + // characters in length. + Finding finding = 1; + + // The FieldMask to use when updating the finding resource. This field should + // not be specified when creating a finding. + // + // When updating a finding, an empty mask is treated as updating all mutable + // fields and replacing source_properties. Individual source_properties can + // be added/updated by using "source_properties." in the field + // mask. + google.protobuf.FieldMask update_mask = 2; +} + +// Request message for updating an organization's settings. +message UpdateOrganizationSettingsRequest { + // The organization settings resource to update. + OrganizationSettings organization_settings = 1; + + // The FieldMask to use when updating the settings resource. + // + // If empty all mutable fields will be updated. + google.protobuf.FieldMask update_mask = 2; +} + +// Request message for updating a source. +message UpdateSourceRequest { + // The source resource to update. + Source source = 1; + + // The FieldMask to use when updating the source resource. + // + // If empty all mutable fields will be updated. + google.protobuf.FieldMask update_mask = 2; +} + +// Request message for updating a SecurityMarks resource. +message UpdateSecurityMarksRequest { + // The security marks resource to update. + SecurityMarks security_marks = 1; + + // The FieldMask to use when updating the security marks resource. + // + // The field mask must not contain duplicate fields. + // If empty or set to "marks", all marks will be replaced. Individual + // marks can be updated using "marks.". + google.protobuf.FieldMask update_mask = 2; + + // The time at which the updated SecurityMarks take effect. + // If not set uses current server time. Updates will be applied to the + // SecurityMarks that are active immediately preceding this time. + google.protobuf.Timestamp start_time = 3; +} diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/source.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/source.proto new file mode 100644 index 00000000000..7d835ec05a7 --- /dev/null +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/source.proto @@ -0,0 +1,56 @@ +// Copyright 2019 Google LLC. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +syntax = "proto3"; + +package google.cloud.securitycenter.v1; + +import "google/api/annotations.proto"; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1;securitycenter"; +option java_multiple_files = true; +option java_package = "com.google.cloud.securitycenter.v1"; + +// Cloud Security Command Center's (Cloud SCC) finding source. A finding source +// is an entity or a mechanism that can produce a finding. A source is like a +// container of findings that come from the same scanner, logger, monitor, etc. +message Source { + // The relative resource name of this source. See: + // https://cloud.google.com/apis/design/resource_names#relative_resource_name + // Example: + // "organizations/123/sources/456" + string name = 1; + + // The source’s display name. + // A source’s display name must be unique amongst its siblings, for example, + // two sources with the same parent can't share the same display name. + // The display name must start and end with a letter or digit, may contain + // letters, digits, spaces, hyphens, and underscores, and can be no longer + // than 32 characters. This is captured by the regular expression: + // [\p{L}\p{N}]({\p{L}\p{N}_- ]{0,30}[\p{L}\p{N}])?. + string display_name = 2; + + // The description of the source (max of 1024 characters). + // Example: + // "Cloud Security Scanner is a web security scanner for common + // vulnerabilities in App Engine applications. It can automatically + // scan and detect four common vulnerabilities, including cross-site-scripting + // (XSS), Flash injection, mixed content (HTTP in HTTPS), and + // outdated/insecure libraries." + string description = 3; + + reserved 4; +} diff --git a/packages/google-cloud-securitycenter/src/index.js b/packages/google-cloud-securitycenter/src/index.js index 6bd17be12dc..e6a09df2331 100644 --- a/packages/google-cloud-securitycenter/src/index.js +++ b/packages/google-cloud-securitycenter/src/index.js @@ -24,6 +24,9 @@ /** * @namespace google.cloud.securitycenter.v1beta1 */ +/** + * @namespace google.cloud.securitycenter.v1 + */ /** * @namespace google.iam.v1 */ @@ -42,6 +45,7 @@ // Import the clients for each version supported by this package. const gapic = Object.freeze({ v1beta1: require('./v1beta1'), + v1: require('./v1'), }); /** @@ -78,7 +82,7 @@ const gapic = Object.freeze({ * @property {constructor} SecurityCenterClient * Reference to {@link v1beta1.SecurityCenterClient} */ -module.exports = gapic.v1beta1; +module.exports = gapic.v1; /** * @type {object} @@ -87,5 +91,12 @@ module.exports = gapic.v1beta1; */ module.exports.v1beta1 = gapic.v1beta1; +/** + * @type {object} + * @property {constructor} SecurityCenterClient + * Reference to {@link v1.SecurityCenterClient} + */ +module.exports.v1 = gapic.v1; + // Alias `module.exports` as `module.exports.default`, for future-proofing. module.exports.default = Object.assign({}, module.exports); diff --git a/packages/google-cloud-securitycenter/src/v1/doc/google/cloud/securitycenter/v1/doc_asset.js b/packages/google-cloud-securitycenter/src/v1/doc/google/cloud/securitycenter/v1/doc_asset.js new file mode 100644 index 00000000000..db52a32f282 --- /dev/null +++ b/packages/google-cloud-securitycenter/src/v1/doc/google/cloud/securitycenter/v1/doc_asset.js @@ -0,0 +1,124 @@ +// Copyright 2019 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Note: this file is purely for documentation. Any contents are not expected +// to be loaded as the JS file. + +/** + * Cloud Security Command Center's (Cloud SCC) representation of a Google Cloud + * Platform (GCP) resource. + * + * The Asset is a Cloud SCC resource that captures information about a single + * GCP resource. All modifications to an Asset are only within the context of + * Cloud SCC and don't affect the referenced GCP resource. + * + * @property {string} name + * The relative resource name of this asset. See: + * https://cloud.google.com/apis/design/resource_names#relative_resource_name + * Example: + * "organizations/123/assets/456". + * + * @property {Object} securityCenterProperties + * Cloud SCC managed properties. These properties are managed by + * Cloud SCC and cannot be modified by the user. + * + * This object should have the same structure as [SecurityCenterProperties]{@link google.cloud.securitycenter.v1.SecurityCenterProperties} + * + * @property {Object.} resourceProperties + * Resource managed properties. These properties are managed and defined by + * the GCP resource and cannot be modified by the user. + * + * @property {Object} securityMarks + * User specified security marks. These marks are entirely managed by the user + * and come from the SecurityMarks resource that belongs to the asset. + * + * This object should have the same structure as [SecurityMarks]{@link google.cloud.securitycenter.v1.SecurityMarks} + * + * @property {Object} createTime + * The time at which the asset was created in Cloud SCC. + * + * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} + * + * @property {Object} updateTime + * The time at which the asset was last updated, added, or deleted in Cloud + * SCC. + * + * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} + * + * @property {Object} iamPolicy + * IAM Policy information associated with the GCP resource described by the + * Cloud SCC asset. This information is managed and defined by the GCP + * resource and cannot be modified by the user. + * + * This object should have the same structure as [IamPolicy]{@link google.cloud.securitycenter.v1.IamPolicy} + * + * @typedef Asset + * @memberof google.cloud.securitycenter.v1 + * @see [google.cloud.securitycenter.v1.Asset definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/securitycenter/v1/asset.proto} + */ +const Asset = { + // This is for documentation. Actual contents will be loaded by gRPC. + + /** + * Cloud SCC managed properties. These properties are managed by Cloud SCC and + * cannot be modified by the user. + * + * @property {string} resourceName + * The full resource name of the GCP resource this asset + * represents. This field is immutable after create time. See: + * https://cloud.google.com/apis/design/resource_names#full_resource_name + * + * @property {string} resourceType + * The type of the GCP resource. Examples include: APPLICATION, + * PROJECT, and ORGANIZATION. This is a case insensitive field defined by + * Cloud SCC and/or the producer of the resource and is immutable + * after create time. + * + * @property {string} resourceParent + * The full resource name of the immediate parent of the resource. See: + * https://cloud.google.com/apis/design/resource_names#full_resource_name + * + * @property {string} resourceProject + * The full resource name of the project the resource belongs to. See: + * https://cloud.google.com/apis/design/resource_names#full_resource_name + * + * @property {string[]} resourceOwners + * Owners of the Google Cloud resource. + * + * @typedef SecurityCenterProperties + * @memberof google.cloud.securitycenter.v1 + * @see [google.cloud.securitycenter.v1.Asset.SecurityCenterProperties definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/securitycenter/v1/asset.proto} + */ + SecurityCenterProperties: { + // This is for documentation. Actual contents will be loaded by gRPC. + }, + + /** + * IAM Policy information associated with the GCP resource described by the + * Cloud SCC asset. This information is managed and defined by the GCP + * resource and cannot be modified by the user. + * + * @property {string} policyBlob + * The JSON representation of the Policy associated with the asset. + * See https://cloud.google.com/iam/reference/rest/v1/Policy for format + * details. + * + * @typedef IamPolicy + * @memberof google.cloud.securitycenter.v1 + * @see [google.cloud.securitycenter.v1.Asset.IamPolicy definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/securitycenter/v1/asset.proto} + */ + IamPolicy: { + // This is for documentation. Actual contents will be loaded by gRPC. + } +}; \ No newline at end of file diff --git a/packages/google-cloud-securitycenter/src/v1/doc/google/cloud/securitycenter/v1/doc_finding.js b/packages/google-cloud-securitycenter/src/v1/doc/google/cloud/securitycenter/v1/doc_finding.js new file mode 100644 index 00000000000..4a275e7c35c --- /dev/null +++ b/packages/google-cloud-securitycenter/src/v1/doc/google/cloud/securitycenter/v1/doc_finding.js @@ -0,0 +1,116 @@ +// Copyright 2019 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Note: this file is purely for documentation. Any contents are not expected +// to be loaded as the JS file. + +/** + * Cloud Security Command Center (Cloud SCC) finding. + * + * A finding is a record of assessment data (security, risk, health or privacy) + * ingested into Cloud SCC for presentation, notification, analysis, + * policy testing, and enforcement. For example, an XSS vulnerability in an + * App Engine application is a finding. + * + * @property {string} name + * The relative resource name of this finding. See: + * https://cloud.google.com/apis/design/resource_names#relative_resource_name + * Example: + * "organizations/123/sources/456/findings/789" + * + * @property {string} parent + * The relative resource name of the source the finding belongs to. See: + * https://cloud.google.com/apis/design/resource_names#relative_resource_name + * This field is immutable after creation time. + * For example: + * "organizations/123/sources/456" + * + * @property {string} resourceName + * The full resource name of the Google Cloud Platform (GCP) resource this + * finding is for. See: + * https://cloud.google.com/apis/design/resource_names#full_resource_name + * This field is immutable after creation time. + * + * @property {number} state + * The state of the finding. + * + * The number should be among the values of [State]{@link google.cloud.securitycenter.v1.State} + * + * @property {string} category + * The additional taxonomy group within findings from a given source. + * This field is immutable after creation time. + * Example: "XSS_FLASH_INJECTION" + * + * @property {string} externalUri + * The URI that, if available, points to a web page outside of Cloud SCC + * where additional information about the finding can be found. This field is + * guaranteed to be either empty or a well formed URL. + * + * @property {Object.} sourceProperties + * Source specific properties. These properties are managed by the source + * that writes the finding. The key names in the source_properties map must be + * between 1 and 255 characters, and must start with a letter and contain + * alphanumeric characters or underscores only. + * + * @property {Object} securityMarks + * Output only. User specified security marks. These marks are entirely + * managed by the user and come from the SecurityMarks resource that belongs + * to the finding. + * + * This object should have the same structure as [SecurityMarks]{@link google.cloud.securitycenter.v1.SecurityMarks} + * + * @property {Object} eventTime + * The time at which the event took place. For example, if the finding + * represents an open firewall it would capture the time the open firewall was + * detected. + * + * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} + * + * @property {Object} createTime + * The time at which the finding was created in Cloud SCC. + * + * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} + * + * @typedef Finding + * @memberof google.cloud.securitycenter.v1 + * @see [google.cloud.securitycenter.v1.Finding definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/securitycenter/v1/finding.proto} + */ +const Finding = { + // This is for documentation. Actual contents will be loaded by gRPC. + + /** + * The state of the finding. + * + * @enum {number} + * @memberof google.cloud.securitycenter.v1 + */ + State: { + + /** + * Unspecified state. + */ + STATE_UNSPECIFIED: 0, + + /** + * The finding requires attention and has not been addressed yet. + */ + ACTIVE: 1, + + /** + * The finding has been fixed, triaged as a non-issue or otherwise addressed + * and is no longer active. + */ + INACTIVE: 2 + } +}; \ No newline at end of file diff --git a/packages/google-cloud-securitycenter/src/v1/doc/google/cloud/securitycenter/v1/doc_organization_settings.js b/packages/google-cloud-securitycenter/src/v1/doc/google/cloud/securitycenter/v1/doc_organization_settings.js new file mode 100644 index 00000000000..734d0306e4f --- /dev/null +++ b/packages/google-cloud-securitycenter/src/v1/doc/google/cloud/securitycenter/v1/doc_organization_settings.js @@ -0,0 +1,98 @@ +// Copyright 2019 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Note: this file is purely for documentation. Any contents are not expected +// to be loaded as the JS file. + +/** + * User specified settings that are attached to the Cloud Security Command + * Center (Cloud SCC) organization. + * + * @property {string} name + * The relative resource name of the settings. See: + * https://cloud.google.com/apis/design/resource_names#relative_resource_name + * Example: + * "organizations/123/organizationSettings". + * + * @property {boolean} enableAssetDiscovery + * A flag that indicates if Asset Discovery should be enabled. If the flag is + * set to `true`, then discovery of assets will occur. If it is set to `false, + * all historical assets will remain, but discovery of future assets will not + * occur. + * + * @property {Object} assetDiscoveryConfig + * The configuration used for Asset Discovery runs. + * + * This object should have the same structure as [AssetDiscoveryConfig]{@link google.cloud.securitycenter.v1.AssetDiscoveryConfig} + * + * @typedef OrganizationSettings + * @memberof google.cloud.securitycenter.v1 + * @see [google.cloud.securitycenter.v1.OrganizationSettings definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/securitycenter/v1/organization_settings.proto} + */ +const OrganizationSettings = { + // This is for documentation. Actual contents will be loaded by gRPC. + + /** + * The configuration used for Asset Discovery runs. + * + * @property {string[]} projectIds + * The project ids to use for filtering asset discovery. + * + * @property {number} inclusionMode + * The mode to use for filtering asset discovery. + * + * The number should be among the values of [InclusionMode]{@link google.cloud.securitycenter.v1.InclusionMode} + * + * @typedef AssetDiscoveryConfig + * @memberof google.cloud.securitycenter.v1 + * @see [google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/securitycenter/v1/organization_settings.proto} + */ + AssetDiscoveryConfig: { + // This is for documentation. Actual contents will be loaded by gRPC. + + /** + * The mode of inclusion when running Asset Discovery. + * Asset discovery can be limited by explicitly identifying projects to be + * included or excluded. If INCLUDE_ONLY is set, then only those projects + * within the organization and their children are discovered during asset + * discovery. If EXCLUDE is set, then projects that don't match those + * projects are discovered during asset discovery. If neither are set, then + * all projects within the organization are discovered during asset + * discovery. + * + * @enum {number} + * @memberof google.cloud.securitycenter.v1 + */ + InclusionMode: { + + /** + * Unspecified. Setting the mode with this value will disable + * inclusion/exclusion filtering for Asset Discovery. + */ + INCLUSION_MODE_UNSPECIFIED: 0, + + /** + * Asset Discovery will capture only the resources within the projects + * specified. All other resources will be ignored. + */ + INCLUDE_ONLY: 1, + + /** + * Asset Discovery will ignore all resources under the projects specified. + * All other resources will be retrieved. + */ + EXCLUDE: 2 + } + } +}; \ No newline at end of file diff --git a/packages/google-cloud-securitycenter/src/v1/doc/google/cloud/securitycenter/v1/doc_security_marks.js b/packages/google-cloud-securitycenter/src/v1/doc/google/cloud/securitycenter/v1/doc_security_marks.js new file mode 100644 index 00000000000..30114cbe6b6 --- /dev/null +++ b/packages/google-cloud-securitycenter/src/v1/doc/google/cloud/securitycenter/v1/doc_security_marks.js @@ -0,0 +1,46 @@ +// Copyright 2019 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Note: this file is purely for documentation. Any contents are not expected +// to be loaded as the JS file. + +/** + * User specified security marks that are attached to the parent Cloud Security + * Command Center (Cloud SCC) resource. Security marks are scoped within a Cloud + * SCC organization -- they can be modified and viewed by all users who have + * proper permissions on the organization. + * + * @property {string} name + * The relative resource name of the SecurityMarks. See: + * https://cloud.google.com/apis/design/resource_names#relative_resource_name + * Examples: + * "organizations/123/assets/456/securityMarks" + * "organizations/123/sources/456/findings/789/securityMarks". + * + * @property {Object.} marks + * Mutable user specified security marks belonging to the parent resource. + * Constraints are as follows: + * - Keys and values are treated as case insensitive + * - Keys must be between 1 - 256 characters (inclusive) + * - Keys must be letters, numbers, underscores, or dashes + * - Values have leading and trailing whitespace trimmed, remaining + * characters must be between 1 - 4096 characters (inclusive) + * + * @typedef SecurityMarks + * @memberof google.cloud.securitycenter.v1 + * @see [google.cloud.securitycenter.v1.SecurityMarks definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/securitycenter/v1/security_marks.proto} + */ +const SecurityMarks = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; \ No newline at end of file diff --git a/packages/google-cloud-securitycenter/src/v1/doc/google/cloud/securitycenter/v1/doc_securitycenter_service.js b/packages/google-cloud-securitycenter/src/v1/doc/google/cloud/securitycenter/v1/doc_securitycenter_service.js new file mode 100644 index 00000000000..d33fe5d698e --- /dev/null +++ b/packages/google-cloud-securitycenter/src/v1/doc/google/cloud/securitycenter/v1/doc_securitycenter_service.js @@ -0,0 +1,989 @@ +// Copyright 2019 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Note: this file is purely for documentation. Any contents are not expected +// to be loaded as the JS file. + +/** + * Request message for creating a finding. + * + * @property {string} parent + * Resource name of the new finding's parent. Its format should be + * "organizations/[organization_id]/sources/[source_id]". + * + * @property {string} findingId + * Unique identifier provided by the client within the parent scope. + * It must be alphanumeric and less than or equal to 32 characters and + * greater than 0 characters in length. + * + * @property {Object} finding + * The Finding being created. The name and security_marks will be ignored as + * they are both output only fields on this resource. + * + * This object should have the same structure as [Finding]{@link google.cloud.securitycenter.v1.Finding} + * + * @typedef CreateFindingRequest + * @memberof google.cloud.securitycenter.v1 + * @see [google.cloud.securitycenter.v1.CreateFindingRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/securitycenter/v1/securitycenter_service.proto} + */ +const CreateFindingRequest = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * Request message for creating a source. + * + * @property {string} parent + * Resource name of the new source's parent. Its format should be + * "organizations/[organization_id]". + * + * @property {Object} source + * The Source being created, only the display_name and description will be + * used. All other fields will be ignored. + * + * This object should have the same structure as [Source]{@link google.cloud.securitycenter.v1.Source} + * + * @typedef CreateSourceRequest + * @memberof google.cloud.securitycenter.v1 + * @see [google.cloud.securitycenter.v1.CreateSourceRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/securitycenter/v1/securitycenter_service.proto} + */ +const CreateSourceRequest = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * Request message for getting organization settings. + * + * @property {string} name + * Name of the organization to get organization settings for. Its format is + * "organizations/[organization_id]/organizationSettings". + * + * @typedef GetOrganizationSettingsRequest + * @memberof google.cloud.securitycenter.v1 + * @see [google.cloud.securitycenter.v1.GetOrganizationSettingsRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/securitycenter/v1/securitycenter_service.proto} + */ +const GetOrganizationSettingsRequest = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * Request message for getting a source. + * + * @property {string} name + * Relative resource name of the source. Its format is + * "organizations/[organization_id]/source/[source_id]". + * + * @typedef GetSourceRequest + * @memberof google.cloud.securitycenter.v1 + * @see [google.cloud.securitycenter.v1.GetSourceRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/securitycenter/v1/securitycenter_service.proto} + */ +const GetSourceRequest = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * Request message for grouping by assets. + * + * @property {string} parent + * Name of the organization to groupBy. Its format is + * "organizations/[organization_id]". + * + * @property {string} filter + * Expression that defines the filter to apply across assets. + * The expression is a list of zero or more restrictions combined via logical + * operators `AND` and `OR`. + * Parentheses are supported, and `OR` has higher precedence than `AND`. + * + * Restrictions have the form ` ` and may have a `-` + * character in front of them to indicate negation. The fields map to those + * defined in the Asset resource. Examples include: + * + * * name + * * security_center_properties.resource_name + * * resource_properties.a_property + * * security_marks.marks.marka + * + * The supported operators are: + * + * * `=` for all value types. + * * `>`, `<`, `>=`, `<=` for integer values. + * * `:`, meaning substring matching, for strings. + * + * The supported value types are: + * + * * string literals in quotes. + * * integer literals without quotes. + * * boolean literals `true` and `false` without quotes. + * + * For example, `resource_properties.size = 100` is a valid filter string. + * + * @property {string} groupBy + * Expression that defines what assets fields to use for grouping. The string + * value should follow SQL syntax: comma separated list of fields. For + * example: + * "security_center_properties.resource_project,security_center_properties.project". + * + * The following fields are supported when compare_duration is not set: + * + * * security_center_properties.resource_project + * * security_center_properties.resource_type + * * security_center_properties.resource_parent + * + * The following fields are supported when compare_duration is set: + * + * * security_center_properties.resource_type + * + * @property {Object} compareDuration + * When compare_duration is set, the GroupResult's "state_change" property is + * updated to indicate whether the asset was added, removed, or remained + * present during the compare_duration period of time that precedes the + * read_time. This is the time between (read_time - compare_duration) and + * read_time. + * + * The state change value is derived based on the presence of the asset at the + * two points in time. Intermediate state changes between the two times don't + * affect the result. For example, the results aren't affected if the asset is + * removed and re-created again. + * + * Possible "state_change" values when compare_duration is specified: + * + * * "ADDED": indicates that the asset was not present at the start of + * compare_duration, but present at reference_time. + * * "REMOVED": indicates that the asset was present at the start of + * compare_duration, but not present at reference_time. + * * "ACTIVE": indicates that the asset was present at both the + * start and the end of the time period defined by + * compare_duration and reference_time. + * + * If compare_duration is not specified, then the only possible state_change + * is "UNUSED", which will be the state_change set for all assets present at + * read_time. + * + * If this field is set then `state_change` must be a specified field in + * `group_by`. + * + * This object should have the same structure as [Duration]{@link google.protobuf.Duration} + * + * @property {Object} readTime + * Time used as a reference point when filtering assets. The filter is limited + * to assets existing at the supplied time and their values are those at that + * specific time. Absence of this field will default to the API's version of + * NOW. + * + * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} + * + * @property {string} having + * Filter that specifies what fields to further filter on *after* the query + * filter has been executed. Currently only 'state_change' is supported and + * requires compare_duration to be specified. + * + * @property {string} pageToken + * The value returned by the last `GroupAssetsResponse`; indicates + * that this is a continuation of a prior `GroupAssets` call, and that the + * system should return the next page of data. + * + * @property {number} pageSize + * The maximum number of results to return in a single response. Default is + * 10, minimum is 1, maximum is 1000. + * + * @typedef GroupAssetsRequest + * @memberof google.cloud.securitycenter.v1 + * @see [google.cloud.securitycenter.v1.GroupAssetsRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/securitycenter/v1/securitycenter_service.proto} + */ +const GroupAssetsRequest = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * Response message for grouping by assets. + * + * @property {Object[]} groupByResults + * Group results. There exists an element for each existing unique + * combination of property/values. The element contains a count for the number + * of times those specific property/values appear. + * + * This object should have the same structure as [GroupResult]{@link google.cloud.securitycenter.v1.GroupResult} + * + * @property {Object} readTime + * Time used for executing the groupBy request. + * + * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} + * + * @property {string} nextPageToken + * Token to retrieve the next page of results, or empty if there are no more + * results. + * + * @property {number} totalSize + * The total number of results matching the query. + * + * @typedef GroupAssetsResponse + * @memberof google.cloud.securitycenter.v1 + * @see [google.cloud.securitycenter.v1.GroupAssetsResponse definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/securitycenter/v1/securitycenter_service.proto} + */ +const GroupAssetsResponse = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * Request message for grouping by findings. + * + * @property {string} parent + * Name of the source to groupBy. Its format is + * "organizations/[organization_id]/sources/[source_id]". To groupBy across + * all sources provide a source_id of `-`. For example: + * organizations/123/sources/- + * + * @property {string} filter + * Expression that defines the filter to apply across findings. + * The expression is a list of one or more restrictions combined via logical + * operators `AND` and `OR`. + * Parentheses are supported, and `OR` has higher precedence than `AND`. + * + * Restrictions have the form ` ` and may have a `-` + * character in front of them to indicate negation. Examples include: + * + * * name + * * source_properties.a_property + * * security_marks.marks.marka + * + * The supported operators are: + * + * * `=` for all value types. + * * `>`, `<`, `>=`, `<=` for integer values. + * * `:`, meaning substring matching, for strings. + * + * The supported value types are: + * + * * string literals in quotes. + * * integer literals without quotes. + * * boolean literals `true` and `false` without quotes. + * + * For example, `source_properties.size = 100` is a valid filter string. + * + * @property {string} groupBy + * Expression that defines what assets fields to use for grouping (including + * `state_change`). The string value should follow SQL syntax: comma separated + * list of fields. For example: "parent,resource_name". + * + * The following fields are supported: + * + * * resource_name + * * category + * * state + * * state_change + * * parent + * + * @property {Object} readTime + * Time used as a reference point when filtering findings. The filter is + * limited to findings existing at the supplied time and their values are + * those at that specific time. Absence of this field will default to the + * API's version of NOW. + * + * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} + * + * @property {Object} compareDuration + * When compare_duration is set, the GroupResult's "state_change" attribute is + * updated to indicate whether the finding had its state changed, the + * finding's state remained unchanged, or if the finding was added during the + * compare_duration period of time that precedes the read_time. This is the + * time between (read_time - compare_duration) and read_time. + * + * The state_change value is derived based on the presence and state of the + * finding at the two points in time. Intermediate state changes between the + * two times don't affect the result. For example, the results aren't affected + * if the finding is made inactive and then active again. + * + * Possible "state_change" values when compare_duration is specified: + * + * * "CHANGED": indicates that the finding was present at the start of + * compare_duration, but changed its state at read_time. + * * "UNCHANGED": indicates that the finding was present at the start of + * compare_duration and did not change state at read_time. + * * "ADDED": indicates that the finding was not present at the start + * of compare_duration, but was present at read_time. + * + * If compare_duration is not specified, then the only possible state_change + * is "UNUSED", which will be the state_change set for all findings present + * at read_time. + * + * If this field is set then `state_change` must be a specified field in + * `group_by`. + * + * This object should have the same structure as [Duration]{@link google.protobuf.Duration} + * + * @property {string} having + * Filter that specifies what fields to further filter on *after* the query + * filter has been executed. Currently only 'finding.state' and 'state_change' + * are supported and requires compare_duration to be specified. + * + * @property {string} pageToken + * The value returned by the last `GroupFindingsResponse`; indicates + * that this is a continuation of a prior `GroupFindings` call, and + * that the system should return the next page of data. + * + * @property {number} pageSize + * The maximum number of results to return in a single response. Default is + * 10, minimum is 1, maximum is 1000. + * + * @typedef GroupFindingsRequest + * @memberof google.cloud.securitycenter.v1 + * @see [google.cloud.securitycenter.v1.GroupFindingsRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/securitycenter/v1/securitycenter_service.proto} + */ +const GroupFindingsRequest = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * Response message for group by findings. + * + * @property {Object[]} groupByResults + * Group results. There exists an element for each existing unique + * combination of property/values. The element contains a count for the number + * of times those specific property/values appear. + * + * This object should have the same structure as [GroupResult]{@link google.cloud.securitycenter.v1.GroupResult} + * + * @property {Object} readTime + * Time used for executing the groupBy request. + * + * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} + * + * @property {string} nextPageToken + * Token to retrieve the next page of results, or empty if there are no more + * results. + * + * @property {number} totalSize + * The total number of results matching the query. + * + * @typedef GroupFindingsResponse + * @memberof google.cloud.securitycenter.v1 + * @see [google.cloud.securitycenter.v1.GroupFindingsResponse definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/securitycenter/v1/securitycenter_service.proto} + */ +const GroupFindingsResponse = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * Result containing the properties and count of a groupBy request. + * + * @property {Object.} properties + * Properties matching the groupBy fields in the request. + * + * @property {number} count + * Total count of resources for the given properties. + * + * @typedef GroupResult + * @memberof google.cloud.securitycenter.v1 + * @see [google.cloud.securitycenter.v1.GroupResult definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/securitycenter/v1/securitycenter_service.proto} + */ +const GroupResult = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * Request message for listing sources. + * + * @property {string} parent + * Resource name of the parent of sources to list. Its format should be + * "organizations/[organization_id]". + * + * @property {string} pageToken + * The value returned by the last `ListSourcesResponse`; indicates + * that this is a continuation of a prior `ListSources` call, and + * that the system should return the next page of data. + * + * @property {number} pageSize + * The maximum number of results to return in a single response. Default is + * 10, minimum is 1, maximum is 1000. + * + * @typedef ListSourcesRequest + * @memberof google.cloud.securitycenter.v1 + * @see [google.cloud.securitycenter.v1.ListSourcesRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/securitycenter/v1/securitycenter_service.proto} + */ +const ListSourcesRequest = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * Response message for listing sources. + * + * @property {Object[]} sources + * Sources belonging to the requested parent. + * + * This object should have the same structure as [Source]{@link google.cloud.securitycenter.v1.Source} + * + * @property {string} nextPageToken + * Token to retrieve the next page of results, or empty if there are no more + * results. + * + * @typedef ListSourcesResponse + * @memberof google.cloud.securitycenter.v1 + * @see [google.cloud.securitycenter.v1.ListSourcesResponse definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/securitycenter/v1/securitycenter_service.proto} + */ +const ListSourcesResponse = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * Request message for listing assets. + * + * @property {string} parent + * Name of the organization assets should belong to. Its format is + * "organizations/[organization_id]". + * + * @property {string} filter + * Expression that defines the filter to apply across assets. + * The expression is a list of zero or more restrictions combined via logical + * operators `AND` and `OR`. + * Parentheses are supported, and `OR` has higher precedence than `AND`. + * + * Restrictions have the form ` ` and may have a `-` + * character in front of them to indicate negation. The fields map to those + * defined in the Asset resource. Examples include: + * + * * name + * * security_center_properties.resource_name + * * resource_properties.a_property + * * security_marks.marks.marka + * + * The supported operators are: + * + * * `=` for all value types. + * * `>`, `<`, `>=`, `<=` for integer values. + * * `:`, meaning substring matching, for strings. + * + * The supported value types are: + * + * * string literals in quotes. + * * integer literals without quotes. + * * boolean literals `true` and `false` without quotes. + * + * For example, `resource_properties.size = 100` is a valid filter string. + * + * @property {string} orderBy + * Expression that defines what fields and order to use for sorting. The + * string value should follow SQL syntax: comma separated list of fields. For + * example: "name,resource_properties.a_property". The default sorting order + * is ascending. To specify descending order for a field, a suffix " desc" + * should be appended to the field name. For example: "name + * desc,resource_properties.a_property". Redundant space characters in the + * syntax are insignificant. "name desc,resource_properties.a_property" and " + * name desc , resource_properties.a_property " are equivalent. + * + * @property {Object} readTime + * Time used as a reference point when filtering assets. The filter is limited + * to assets existing at the supplied time and their values are those at that + * specific time. Absence of this field will default to the API's version of + * NOW. + * + * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} + * + * @property {Object} compareDuration + * When compare_duration is set, the ListAssetsResult's "state_change" + * attribute is updated to indicate whether the asset was added, removed, or + * remained present during the compare_duration period of time that precedes + * the read_time. This is the time between (read_time - compare_duration) and + * read_time. + * + * The state_change value is derived based on the presence of the asset at the + * two points in time. Intermediate state changes between the two times don't + * affect the result. For example, the results aren't affected if the asset is + * removed and re-created again. + * + * Possible "state_change" values when compare_duration is specified: + * + * * "ADDED": indicates that the asset was not present at the start of + * compare_duration, but present at read_time. + * * "REMOVED": indicates that the asset was present at the start of + * compare_duration, but not present at read_time. + * * "ACTIVE": indicates that the asset was present at both the + * start and the end of the time period defined by + * compare_duration and read_time. + * + * If compare_duration is not specified, then the only possible state_change + * is "UNUSED", which will be the state_change set for all assets present at + * read_time. + * + * This object should have the same structure as [Duration]{@link google.protobuf.Duration} + * + * @property {string} having + * Filter that specifies what fields to further filter on *after* the query + * filter has been executed. Currently only 'state_change' is supported and + * requires compare_duration to be specified. + * + * @property {Object} fieldMask + * Optional. + * + * A field mask to specify the ListAssetsResult fields to be listed in the + * response. + * An empty field mask will list all fields. + * + * This object should have the same structure as [FieldMask]{@link google.protobuf.FieldMask} + * + * @property {string} pageToken + * The value returned by the last `ListAssetsResponse`; indicates + * that this is a continuation of a prior `ListAssets` call, and + * that the system should return the next page of data. + * + * @property {number} pageSize + * The maximum number of results to return in a single response. Default is + * 10, minimum is 1, maximum is 1000. + * + * @typedef ListAssetsRequest + * @memberof google.cloud.securitycenter.v1 + * @see [google.cloud.securitycenter.v1.ListAssetsRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/securitycenter/v1/securitycenter_service.proto} + */ +const ListAssetsRequest = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * Response message for listing assets. + * + * @property {Object[]} listAssetsResults + * Assets matching the list request. + * + * This object should have the same structure as [ListAssetsResult]{@link google.cloud.securitycenter.v1.ListAssetsResult} + * + * @property {Object} readTime + * Time used for executing the list request. + * + * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} + * + * @property {string} nextPageToken + * Token to retrieve the next page of results, or empty if there are no more + * results. + * + * @property {number} totalSize + * The total number of assets matching the query. + * + * @typedef ListAssetsResponse + * @memberof google.cloud.securitycenter.v1 + * @see [google.cloud.securitycenter.v1.ListAssetsResponse definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/securitycenter/v1/securitycenter_service.proto} + */ +const ListAssetsResponse = { + // This is for documentation. Actual contents will be loaded by gRPC. + + /** + * Result containing the Asset and its State. + * + * @property {Object} asset + * Asset matching the search request. + * + * This object should have the same structure as [Asset]{@link google.cloud.securitycenter.v1.Asset} + * + * @property {number} stateChange + * State change of the asset between the points in time. + * + * The number should be among the values of [StateChange]{@link google.cloud.securitycenter.v1.StateChange} + * + * @typedef ListAssetsResult + * @memberof google.cloud.securitycenter.v1 + * @see [google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/securitycenter/v1/securitycenter_service.proto} + */ + ListAssetsResult: { + // This is for documentation. Actual contents will be loaded by gRPC. + + /** + * The change in state of the asset. + * + * When querying across two points in time this describes + * the change between the two points: ADDED, REMOVED, or ACTIVE. + * If there was no compare_duration supplied in the request the state change + * will be: UNUSED + * + * @enum {number} + * @memberof google.cloud.securitycenter.v1 + */ + StateChange: { + + /** + * State change is unused, this is the canonical default for this enum. + */ + UNUSED: 0, + + /** + * Asset was added between the points in time. + */ + ADDED: 1, + + /** + * Asset was removed between the points in time. + */ + REMOVED: 2, + + /** + * Asset was present at both point(s) in time. + */ + ACTIVE: 3 + } + } +}; + +/** + * Request message for listing findings. + * + * @property {string} parent + * Name of the source the findings belong to. Its format is + * "organizations/[organization_id]/sources/[source_id]". To list across all + * sources provide a source_id of `-`. For example: + * organizations/123/sources/- + * + * @property {string} filter + * Expression that defines the filter to apply across findings. + * The expression is a list of one or more restrictions combined via logical + * operators `AND` and `OR`. + * Parentheses are supported, and `OR` has higher precedence than `AND`. + * + * Restrictions have the form ` ` and may have a `-` + * character in front of them to indicate negation. Examples include: + * + * * name + * * source_properties.a_property + * * security_marks.marks.marka + * + * The supported operators are: + * + * * `=` for all value types. + * * `>`, `<`, `>=`, `<=` for integer values. + * * `:`, meaning substring matching, for strings. + * + * The supported value types are: + * + * * string literals in quotes. + * * integer literals without quotes. + * * boolean literals `true` and `false` without quotes. + * + * For example, `source_properties.size = 100` is a valid filter string. + * + * @property {string} orderBy + * Expression that defines what fields and order to use for sorting. The + * string value should follow SQL syntax: comma separated list of fields. For + * example: "name,resource_properties.a_property". The default sorting order + * is ascending. To specify descending order for a field, a suffix " desc" + * should be appended to the field name. For example: "name + * desc,source_properties.a_property". Redundant space characters in the + * syntax are insignificant. "name desc,source_properties.a_property" and " + * name desc , source_properties.a_property " are equivalent. + * + * @property {Object} readTime + * Time used as a reference point when filtering findings. The filter is + * limited to findings existing at the supplied time and their values are + * those at that specific time. Absence of this field will default to the + * API's version of NOW. + * + * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} + * + * @property {Object} compareDuration + * When compare_duration is set, the ListFindingsResult's "state_change" + * attribute is updated to indicate whether the finding had its state changed, + * the finding's state remained unchanged, or if the finding was added in any + * state during the compare_duration period of time that precedes the + * read_time. This is the time between (read_time - compare_duration) and + * read_time. + * + * The state_change value is derived based on the presence and state of the + * finding at the two points in time. Intermediate state changes between the + * two times don't affect the result. For example, the results aren't affected + * if the finding is made inactive and then active again. + * + * Possible "state_change" values when compare_duration is specified: + * + * * "CHANGED": indicates that the finding was present at the start of + * compare_duration, but changed its state at read_time. + * * "UNCHANGED": indicates that the finding was present at the start of + * compare_duration and did not change state at read_time. + * * "ADDED": indicates that the finding was not present at the start + * of compare_duration, but was present at read_time. + * + * If compare_duration is not specified, then the only possible state_change + * is "UNUSED", which will be the state_change set for all findings present at + * read_time. + * + * This object should have the same structure as [Duration]{@link google.protobuf.Duration} + * + * @property {string} having + * Filter that specifies what fields to further filter on *after* the query + * filter has been executed. Currently only 'finding.state' and 'state_change' + * are supported and requires compare_duration to be specified. + * + * @property {Object} fieldMask + * Optional. + * + * A field mask to specify the Finding fields to be listed in the response. + * An empty field mask will list all fields. + * + * This object should have the same structure as [FieldMask]{@link google.protobuf.FieldMask} + * + * @property {string} pageToken + * The value returned by the last `ListFindingsResponse`; indicates + * that this is a continuation of a prior `ListFindings` call, and + * that the system should return the next page of data. + * + * @property {number} pageSize + * The maximum number of results to return in a single response. Default is + * 10, minimum is 1, maximum is 1000. + * + * @typedef ListFindingsRequest + * @memberof google.cloud.securitycenter.v1 + * @see [google.cloud.securitycenter.v1.ListFindingsRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/securitycenter/v1/securitycenter_service.proto} + */ +const ListFindingsRequest = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * Response message for listing findings. + * + * @property {Object[]} listFindingsResults + * Findings matching the list request. + * + * This object should have the same structure as [ListFindingsResult]{@link google.cloud.securitycenter.v1.ListFindingsResult} + * + * @property {Object} readTime + * Time used for executing the list request. + * + * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} + * + * @property {string} nextPageToken + * Token to retrieve the next page of results, or empty if there are no more + * results. + * + * @property {number} totalSize + * The total number of findings matching the query. + * + * @typedef ListFindingsResponse + * @memberof google.cloud.securitycenter.v1 + * @see [google.cloud.securitycenter.v1.ListFindingsResponse definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/securitycenter/v1/securitycenter_service.proto} + */ +const ListFindingsResponse = { + // This is for documentation. Actual contents will be loaded by gRPC. + + /** + * Result containing the Finding and its StateChange. + * + * @property {Object} finding + * Finding matching the search request. + * + * This object should have the same structure as [Finding]{@link google.cloud.securitycenter.v1.Finding} + * + * @property {number} stateChange + * State change of the finding between the points in time. + * + * The number should be among the values of [StateChange]{@link google.cloud.securitycenter.v1.StateChange} + * + * @typedef ListFindingsResult + * @memberof google.cloud.securitycenter.v1 + * @see [google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/securitycenter/v1/securitycenter_service.proto} + */ + ListFindingsResult: { + // This is for documentation. Actual contents will be loaded by gRPC. + + /** + * The change in state of the finding. + * + * When querying across two points in time this describes + * the change in the finding between the two points: CHANGED, UNCHANGED, + * ADDED, or REMOVED. Findings can not be deleted, so REMOVED implies that + * the finding at timestamp does not match the filter specified, but it did + * at timestamp - compare_duration. If there was no compare_duration + * supplied in the request the state change will be: UNUSED + * + * @enum {number} + * @memberof google.cloud.securitycenter.v1 + */ + StateChange: { + + /** + * State change is unused, this is the canonical default for this enum. + */ + UNUSED: 0, + + /** + * The finding has changed state in some way between the points in time + * and existed at both points. + */ + CHANGED: 1, + + /** + * The finding has not changed state between the points in time and + * existed at both points. + */ + UNCHANGED: 2, + + /** + * The finding was created between the points in time. + */ + ADDED: 3, + + /** + * The finding at timestamp does not match the filter specified, but it + * did at timestamp - compare_duration. + */ + REMOVED: 4 + } + } +}; + +/** + * Request message for updating a finding's state. + * + * @property {string} name + * The relative resource name of the finding. See: + * https://cloud.google.com/apis/design/resource_names#relative_resource_name + * Example: + * "organizations/123/sources/456/finding/789". + * + * @property {number} state + * The desired State of the finding. + * + * The number should be among the values of [State]{@link google.cloud.securitycenter.v1.State} + * + * @property {Object} startTime + * The time at which the updated state takes effect. + * + * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} + * + * @typedef SetFindingStateRequest + * @memberof google.cloud.securitycenter.v1 + * @see [google.cloud.securitycenter.v1.SetFindingStateRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/securitycenter/v1/securitycenter_service.proto} + */ +const SetFindingStateRequest = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * Request message for running asset discovery for an organization. + * + * @property {string} parent + * Name of the organization to run asset discovery for. Its format is + * "organizations/[organization_id]". + * + * @typedef RunAssetDiscoveryRequest + * @memberof google.cloud.securitycenter.v1 + * @see [google.cloud.securitycenter.v1.RunAssetDiscoveryRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/securitycenter/v1/securitycenter_service.proto} + */ +const RunAssetDiscoveryRequest = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * Request message for updating or creating a finding. + * + * @property {Object} finding + * The finding resource to update or create if it does not already exist. + * parent, security_marks, and update_time will be ignored. + * + * In the case of creation, the finding id portion of the name must be + * alphanumeric and less than or equal to 32 characters and greater than 0 + * characters in length. + * + * This object should have the same structure as [Finding]{@link google.cloud.securitycenter.v1.Finding} + * + * @property {Object} updateMask + * The FieldMask to use when updating the finding resource. This field should + * not be specified when creating a finding. + * + * When updating a finding, an empty mask is treated as updating all mutable + * fields and replacing source_properties. Individual source_properties can + * be added/updated by using "source_properties." in the field + * mask. + * + * This object should have the same structure as [FieldMask]{@link google.protobuf.FieldMask} + * + * @typedef UpdateFindingRequest + * @memberof google.cloud.securitycenter.v1 + * @see [google.cloud.securitycenter.v1.UpdateFindingRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/securitycenter/v1/securitycenter_service.proto} + */ +const UpdateFindingRequest = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * Request message for updating an organization's settings. + * + * @property {Object} organizationSettings + * The organization settings resource to update. + * + * This object should have the same structure as [OrganizationSettings]{@link google.cloud.securitycenter.v1.OrganizationSettings} + * + * @property {Object} updateMask + * The FieldMask to use when updating the settings resource. + * + * If empty all mutable fields will be updated. + * + * This object should have the same structure as [FieldMask]{@link google.protobuf.FieldMask} + * + * @typedef UpdateOrganizationSettingsRequest + * @memberof google.cloud.securitycenter.v1 + * @see [google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/securitycenter/v1/securitycenter_service.proto} + */ +const UpdateOrganizationSettingsRequest = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * Request message for updating a source. + * + * @property {Object} source + * The source resource to update. + * + * This object should have the same structure as [Source]{@link google.cloud.securitycenter.v1.Source} + * + * @property {Object} updateMask + * The FieldMask to use when updating the source resource. + * + * If empty all mutable fields will be updated. + * + * This object should have the same structure as [FieldMask]{@link google.protobuf.FieldMask} + * + * @typedef UpdateSourceRequest + * @memberof google.cloud.securitycenter.v1 + * @see [google.cloud.securitycenter.v1.UpdateSourceRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/securitycenter/v1/securitycenter_service.proto} + */ +const UpdateSourceRequest = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * Request message for updating a SecurityMarks resource. + * + * @property {Object} securityMarks + * The security marks resource to update. + * + * This object should have the same structure as [SecurityMarks]{@link google.cloud.securitycenter.v1.SecurityMarks} + * + * @property {Object} updateMask + * The FieldMask to use when updating the security marks resource. + * + * The field mask must not contain duplicate fields. + * If empty or set to "marks", all marks will be replaced. Individual + * marks can be updated using "marks.". + * + * This object should have the same structure as [FieldMask]{@link google.protobuf.FieldMask} + * + * @property {Object} startTime + * The time at which the updated SecurityMarks take effect. + * If not set uses current server time. Updates will be applied to the + * SecurityMarks that are active immediately preceding this time. + * + * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} + * + * @typedef UpdateSecurityMarksRequest + * @memberof google.cloud.securitycenter.v1 + * @see [google.cloud.securitycenter.v1.UpdateSecurityMarksRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/securitycenter/v1/securitycenter_service.proto} + */ +const UpdateSecurityMarksRequest = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; \ No newline at end of file diff --git a/packages/google-cloud-securitycenter/src/v1/doc/google/cloud/securitycenter/v1/doc_source.js b/packages/google-cloud-securitycenter/src/v1/doc/google/cloud/securitycenter/v1/doc_source.js new file mode 100644 index 00000000000..98b8fc3568c --- /dev/null +++ b/packages/google-cloud-securitycenter/src/v1/doc/google/cloud/securitycenter/v1/doc_source.js @@ -0,0 +1,53 @@ +// Copyright 2019 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Note: this file is purely for documentation. Any contents are not expected +// to be loaded as the JS file. + +/** + * Cloud Security Command Center's (Cloud SCC) finding source. A finding source + * is an entity or a mechanism that can produce a finding. A source is like a + * container of findings that come from the same scanner, logger, monitor, etc. + * + * @property {string} name + * The relative resource name of this source. See: + * https://cloud.google.com/apis/design/resource_names#relative_resource_name + * Example: + * "organizations/123/sources/456" + * + * @property {string} displayName + * The source’s display name. + * A source’s display name must be unique amongst its siblings, for example, + * two sources with the same parent can't share the same display name. + * The display name must start and end with a letter or digit, may contain + * letters, digits, spaces, hyphens, and underscores, and can be no longer + * than 32 characters. This is captured by the regular expression: + * `\[\p{L}\p{N}]({\p{L}\p{N}_- ]{0,30}[\p{L}\p{N}])?`. + * + * @property {string} description + * The description of the source (max of 1024 characters). + * Example: + * "Cloud Security Scanner is a web security scanner for common + * vulnerabilities in App Engine applications. It can automatically + * scan and detect four common vulnerabilities, including cross-site-scripting + * (XSS), Flash injection, mixed content (HTTP in HTTPS), and + * outdated/insecure libraries." + * + * @typedef Source + * @memberof google.cloud.securitycenter.v1 + * @see [google.cloud.securitycenter.v1.Source definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/securitycenter/v1/source.proto} + */ +const Source = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; \ No newline at end of file diff --git a/packages/google-cloud-securitycenter/src/v1/doc/google/iam/v1/doc_iam_policy.js b/packages/google-cloud-securitycenter/src/v1/doc/google/iam/v1/doc_iam_policy.js new file mode 100644 index 00000000000..12b7ac5df09 --- /dev/null +++ b/packages/google-cloud-securitycenter/src/v1/doc/google/iam/v1/doc_iam_policy.js @@ -0,0 +1,93 @@ +// Copyright 2019 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Note: this file is purely for documentation. Any contents are not expected +// to be loaded as the JS file. + +/** + * Request message for `SetIamPolicy` method. + * + * @property {string} resource + * REQUIRED: The resource for which the policy is being specified. + * `resource` is usually specified as a path. For example, a Project + * resource is specified as `projects/{project}`. + * + * @property {Object} policy + * REQUIRED: The complete policy to be applied to the `resource`. The size of + * the policy is limited to a few 10s of KB. An empty policy is a + * valid policy but certain Cloud Platform services (such as Projects) + * might reject them. + * + * This object should have the same structure as [Policy]{@link google.iam.v1.Policy} + * + * @typedef SetIamPolicyRequest + * @memberof google.iam.v1 + * @see [google.iam.v1.SetIamPolicyRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/iam/v1/iam_policy.proto} + */ +const SetIamPolicyRequest = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * Request message for `GetIamPolicy` method. + * + * @property {string} resource + * REQUIRED: The resource for which the policy is being requested. + * `resource` is usually specified as a path. For example, a Project + * resource is specified as `projects/{project}`. + * + * @typedef GetIamPolicyRequest + * @memberof google.iam.v1 + * @see [google.iam.v1.GetIamPolicyRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/iam/v1/iam_policy.proto} + */ +const GetIamPolicyRequest = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * Request message for `TestIamPermissions` method. + * + * @property {string} resource + * REQUIRED: The resource for which the policy detail is being requested. + * `resource` is usually specified as a path. For example, a Project + * resource is specified as `projects/{project}`. + * + * @property {string[]} permissions + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see + * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + * + * @typedef TestIamPermissionsRequest + * @memberof google.iam.v1 + * @see [google.iam.v1.TestIamPermissionsRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/iam/v1/iam_policy.proto} + */ +const TestIamPermissionsRequest = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * Response message for `TestIamPermissions` method. + * + * @property {string[]} permissions + * A subset of `TestPermissionsRequest.permissions` that the caller is + * allowed. + * + * @typedef TestIamPermissionsResponse + * @memberof google.iam.v1 + * @see [google.iam.v1.TestIamPermissionsResponse definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/iam/v1/iam_policy.proto} + */ +const TestIamPermissionsResponse = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; \ No newline at end of file diff --git a/packages/google-cloud-securitycenter/src/v1/doc/google/iam/v1/doc_policy.js b/packages/google-cloud-securitycenter/src/v1/doc/google/iam/v1/doc_policy.js new file mode 100644 index 00000000000..bcae4a7d873 --- /dev/null +++ b/packages/google-cloud-securitycenter/src/v1/doc/google/iam/v1/doc_policy.js @@ -0,0 +1,118 @@ +// Copyright 2019 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Note: this file is purely for documentation. Any contents are not expected +// to be loaded as the JS file. + +/** + * Defines an Identity and Access Management (IAM) policy. It is used to + * specify access control policies for Cloud Platform resources. + * + * + * A `Policy` consists of a list of `bindings`. A `Binding` binds a list of + * `members` to a `role`, where the members can be user accounts, Google groups, + * Google domains, and service accounts. A `role` is a named list of permissions + * defined by IAM. + * + * **Example** + * + * { + * "bindings": [ + * { + * "role": "roles/owner", + * "members": [ + * "user:mike@example.com", + * "group:admins@example.com", + * "domain:google.com", + * "serviceAccount:my-other-app@appspot.gserviceaccount.com", + * ] + * }, + * { + * "role": "roles/viewer", + * "members": ["user:sean@example.com"] + * } + * ] + * } + * + * For a description of IAM and its features, see the + * [IAM developer's guide](https://cloud.google.com/iam). + * + * @property {number} version + * Version of the `Policy`. The default version is 0. + * + * @property {Object[]} bindings + * Associates a list of `members` to a `role`. + * Multiple `bindings` must not be specified for the same `role`. + * `bindings` with no members will result in an error. + * + * This object should have the same structure as [Binding]{@link google.iam.v1.Binding} + * + * @property {string} etag + * `etag` is used for optimistic concurrency control as a way to help + * prevent simultaneous updates of a policy from overwriting each other. + * It is strongly suggested that systems make use of the `etag` in the + * read-modify-write cycle to perform policy updates in order to avoid race + * conditions: An `etag` is returned in the response to `getIamPolicy`, and + * systems are expected to put that etag in the request to `setIamPolicy` to + * ensure that their change will be applied to the same version of the policy. + * + * If no `etag` is provided in the call to `setIamPolicy`, then the existing + * policy is overwritten blindly. + * + * @typedef Policy + * @memberof google.iam.v1 + * @see [google.iam.v1.Policy definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/iam/v1/policy.proto} + */ +const Policy = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * Associates `members` with a `role`. + * + * @property {string} role + * Role that is assigned to `members`. + * For example, `roles/viewer`, `roles/editor`, or `roles/owner`. + * Required + * + * @property {string[]} members + * Specifies the identities requesting access for a Cloud Platform resource. + * `members` can have the following values: + * + * * `allUsers`: A special identifier that represents anyone who is + * on the internet; with or without a Google account. + * + * * `allAuthenticatedUsers`: A special identifier that represents anyone + * who is authenticated with a Google account or a service account. + * + * * `user:{emailid}`: An email address that represents a specific Google + * account. For example, `alice@gmail.com` or `joe@example.com`. + * + * + * * `serviceAccount:{emailid}`: An email address that represents a service + * account. For example, `my-other-app@appspot.gserviceaccount.com`. + * + * * `group:{emailid}`: An email address that represents a Google group. + * For example, `admins@example.com`. + * + * * `domain:{domain}`: A Google Apps domain name that represents all the + * users of that domain. For example, `google.com` or `example.com`. + * + * @typedef Binding + * @memberof google.iam.v1 + * @see [google.iam.v1.Binding definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/iam/v1/policy.proto} + */ +const Binding = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; \ No newline at end of file diff --git a/packages/google-cloud-securitycenter/src/v1/doc/google/longrunning/doc_operations.js b/packages/google-cloud-securitycenter/src/v1/doc/google/longrunning/doc_operations.js new file mode 100644 index 00000000000..bd03cc3da0e --- /dev/null +++ b/packages/google-cloud-securitycenter/src/v1/doc/google/longrunning/doc_operations.js @@ -0,0 +1,63 @@ +// Copyright 2019 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Note: this file is purely for documentation. Any contents are not expected +// to be loaded as the JS file. + +/** + * This resource represents a long-running operation that is the result of a + * network API call. + * + * @property {string} name + * The server-assigned name, which is only unique within the same service that + * originally returns it. If you use the default HTTP mapping, the + * `name` should have the format of `operations/some/unique/name`. + * + * @property {Object} metadata + * Service-specific metadata associated with the operation. It typically + * contains progress information and common metadata such as create time. + * Some services might not provide such metadata. Any method that returns a + * long-running operation should document the metadata type, if any. + * + * This object should have the same structure as [Any]{@link google.protobuf.Any} + * + * @property {boolean} done + * If the value is `false`, it means the operation is still in progress. + * If true, the operation is completed, and either `error` or `response` is + * available. + * + * @property {Object} error + * The error result of the operation in case of failure or cancellation. + * + * This object should have the same structure as [Status]{@link google.rpc.Status} + * + * @property {Object} response + * The normal response of the operation in case of success. If the original + * method returns no data on success, such as `Delete`, the response is + * `google.protobuf.Empty`. If the original method is standard + * `Get`/`Create`/`Update`, the response should be the resource. For other + * methods, the response should have the type `XxxResponse`, where `Xxx` + * is the original method name. For example, if the original method name + * is `TakeSnapshot()`, the inferred response type is + * `TakeSnapshotResponse`. + * + * This object should have the same structure as [Any]{@link google.protobuf.Any} + * + * @typedef Operation + * @memberof google.longrunning + * @see [google.longrunning.Operation definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/longrunning/operations.proto} + */ +const Operation = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; \ No newline at end of file diff --git a/packages/google-cloud-securitycenter/src/v1/doc/google/protobuf/doc_any.js b/packages/google-cloud-securitycenter/src/v1/doc/google/protobuf/doc_any.js new file mode 100644 index 00000000000..f3278b34e66 --- /dev/null +++ b/packages/google-cloud-securitycenter/src/v1/doc/google/protobuf/doc_any.js @@ -0,0 +1,136 @@ +// Copyright 2019 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Note: this file is purely for documentation. Any contents are not expected +// to be loaded as the JS file. + +/** + * `Any` contains an arbitrary serialized protocol buffer message along with a + * URL that describes the type of the serialized message. + * + * Protobuf library provides support to pack/unpack Any values in the form + * of utility functions or additional generated methods of the Any type. + * + * Example 1: Pack and unpack a message in C++. + * + * Foo foo = ...; + * Any any; + * any.PackFrom(foo); + * ... + * if (any.UnpackTo(&foo)) { + * ... + * } + * + * Example 2: Pack and unpack a message in Java. + * + * Foo foo = ...; + * Any any = Any.pack(foo); + * ... + * if (any.is(Foo.class)) { + * foo = any.unpack(Foo.class); + * } + * + * Example 3: Pack and unpack a message in Python. + * + * foo = Foo(...) + * any = Any() + * any.Pack(foo) + * ... + * if any.Is(Foo.DESCRIPTOR): + * any.Unpack(foo) + * ... + * + * Example 4: Pack and unpack a message in Go + * + * foo := &pb.Foo{...} + * any, err := ptypes.MarshalAny(foo) + * ... + * foo := &pb.Foo{} + * if err := ptypes.UnmarshalAny(any, foo); err != nil { + * ... + * } + * + * The pack methods provided by protobuf library will by default use + * 'type.googleapis.com/full.type.name' as the type URL and the unpack + * methods only use the fully qualified type name after the last '/' + * in the type URL, for example "foo.bar.com/x/y.z" will yield type + * name "y.z". + * + * + * # JSON + * + * The JSON representation of an `Any` value uses the regular + * representation of the deserialized, embedded message, with an + * additional field `@type` which contains the type URL. Example: + * + * package google.profile; + * message Person { + * string first_name = 1; + * string last_name = 2; + * } + * + * { + * "@type": "type.googleapis.com/google.profile.Person", + * "firstName": , + * "lastName": + * } + * + * If the embedded message type is well-known and has a custom JSON + * representation, that representation will be embedded adding a field + * `value` which holds the custom JSON in addition to the `@type` + * field. Example (for message google.protobuf.Duration): + * + * { + * "@type": "type.googleapis.com/google.protobuf.Duration", + * "value": "1.212s" + * } + * + * @property {string} typeUrl + * A URL/resource name that uniquely identifies the type of the serialized + * protocol buffer message. The last segment of the URL's path must represent + * the fully qualified name of the type (as in + * `path/google.protobuf.Duration`). The name should be in a canonical form + * (e.g., leading "." is not accepted). + * + * In practice, teams usually precompile into the binary all types that they + * expect it to use in the context of Any. However, for URLs which use the + * scheme `http`, `https`, or no scheme, one can optionally set up a type + * server that maps type URLs to message definitions as follows: + * + * * If no scheme is provided, `https` is assumed. + * * An HTTP GET on the URL must yield a google.protobuf.Type + * value in binary format, or produce an error. + * * Applications are allowed to cache lookup results based on the + * URL, or have them precompiled into a binary to avoid any + * lookup. Therefore, binary compatibility needs to be preserved + * on changes to types. (Use versioned type names to manage + * breaking changes.) + * + * Note: this functionality is not currently available in the official + * protobuf release, and it is not used for type URLs beginning with + * type.googleapis.com. + * + * Schemes other than `http`, `https` (or the empty scheme) might be + * used with implementation specific semantics. + * + * @property {string} value + * Must be a valid serialized protocol buffer of the above specified type. + * + * @typedef Any + * @memberof google.protobuf + * @see [google.protobuf.Any definition in proto format]{@link https://github.com/google/protobuf/blob/master/src/google/protobuf/any.proto} + */ +const Any = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; \ No newline at end of file diff --git a/packages/google-cloud-securitycenter/src/v1/doc/google/protobuf/doc_duration.js b/packages/google-cloud-securitycenter/src/v1/doc/google/protobuf/doc_duration.js new file mode 100644 index 00000000000..1275f8f4d13 --- /dev/null +++ b/packages/google-cloud-securitycenter/src/v1/doc/google/protobuf/doc_duration.js @@ -0,0 +1,97 @@ +// Copyright 2019 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Note: this file is purely for documentation. Any contents are not expected +// to be loaded as the JS file. + +/** + * A Duration represents a signed, fixed-length span of time represented + * as a count of seconds and fractions of seconds at nanosecond + * resolution. It is independent of any calendar and concepts like "day" + * or "month". It is related to Timestamp in that the difference between + * two Timestamp values is a Duration and it can be added or subtracted + * from a Timestamp. Range is approximately +-10,000 years. + * + * # Examples + * + * Example 1: Compute Duration from two Timestamps in pseudo code. + * + * Timestamp start = ...; + * Timestamp end = ...; + * Duration duration = ...; + * + * duration.seconds = end.seconds - start.seconds; + * duration.nanos = end.nanos - start.nanos; + * + * if (duration.seconds < 0 && duration.nanos > 0) { + * duration.seconds += 1; + * duration.nanos -= 1000000000; + * } else if (durations.seconds > 0 && duration.nanos < 0) { + * duration.seconds -= 1; + * duration.nanos += 1000000000; + * } + * + * Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. + * + * Timestamp start = ...; + * Duration duration = ...; + * Timestamp end = ...; + * + * end.seconds = start.seconds + duration.seconds; + * end.nanos = start.nanos + duration.nanos; + * + * if (end.nanos < 0) { + * end.seconds -= 1; + * end.nanos += 1000000000; + * } else if (end.nanos >= 1000000000) { + * end.seconds += 1; + * end.nanos -= 1000000000; + * } + * + * Example 3: Compute Duration from datetime.timedelta in Python. + * + * td = datetime.timedelta(days=3, minutes=10) + * duration = Duration() + * duration.FromTimedelta(td) + * + * # JSON Mapping + * + * In JSON format, the Duration type is encoded as a string rather than an + * object, where the string ends in the suffix "s" (indicating seconds) and + * is preceded by the number of seconds, with nanoseconds expressed as + * fractional seconds. For example, 3 seconds with 0 nanoseconds should be + * encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should + * be expressed in JSON format as "3.000000001s", and 3 seconds and 1 + * microsecond should be expressed in JSON format as "3.000001s". + * + * @property {number} seconds + * Signed seconds of the span of time. Must be from -315,576,000,000 + * to +315,576,000,000 inclusive. Note: these bounds are computed from: + * 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years + * + * @property {number} nanos + * Signed fractions of a second at nanosecond resolution of the span + * of time. Durations less than one second are represented with a 0 + * `seconds` field and a positive or negative `nanos` field. For durations + * of one second or more, a non-zero value for the `nanos` field must be + * of the same sign as the `seconds` field. Must be from -999,999,999 + * to +999,999,999 inclusive. + * + * @typedef Duration + * @memberof google.protobuf + * @see [google.protobuf.Duration definition in proto format]{@link https://github.com/google/protobuf/blob/master/src/google/protobuf/duration.proto} + */ +const Duration = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; \ No newline at end of file diff --git a/packages/google-cloud-securitycenter/src/v1/doc/google/protobuf/doc_field_mask.js b/packages/google-cloud-securitycenter/src/v1/doc/google/protobuf/doc_field_mask.js new file mode 100644 index 00000000000..d55d97e6e38 --- /dev/null +++ b/packages/google-cloud-securitycenter/src/v1/doc/google/protobuf/doc_field_mask.js @@ -0,0 +1,236 @@ +// Copyright 2019 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Note: this file is purely for documentation. Any contents are not expected +// to be loaded as the JS file. + +/** + * `FieldMask` represents a set of symbolic field paths, for example: + * + * paths: "f.a" + * paths: "f.b.d" + * + * Here `f` represents a field in some root message, `a` and `b` + * fields in the message found in `f`, and `d` a field found in the + * message in `f.b`. + * + * Field masks are used to specify a subset of fields that should be + * returned by a get operation or modified by an update operation. + * Field masks also have a custom JSON encoding (see below). + * + * # Field Masks in Projections + * + * When used in the context of a projection, a response message or + * sub-message is filtered by the API to only contain those fields as + * specified in the mask. For example, if the mask in the previous + * example is applied to a response message as follows: + * + * f { + * a : 22 + * b { + * d : 1 + * x : 2 + * } + * y : 13 + * } + * z: 8 + * + * The result will not contain specific values for fields x,y and z + * (their value will be set to the default, and omitted in proto text + * output): + * + * + * f { + * a : 22 + * b { + * d : 1 + * } + * } + * + * A repeated field is not allowed except at the last position of a + * paths string. + * + * If a FieldMask object is not present in a get operation, the + * operation applies to all fields (as if a FieldMask of all fields + * had been specified). + * + * Note that a field mask does not necessarily apply to the + * top-level response message. In case of a REST get operation, the + * field mask applies directly to the response, but in case of a REST + * list operation, the mask instead applies to each individual message + * in the returned resource list. In case of a REST custom method, + * other definitions may be used. Where the mask applies will be + * clearly documented together with its declaration in the API. In + * any case, the effect on the returned resource/resources is required + * behavior for APIs. + * + * # Field Masks in Update Operations + * + * A field mask in update operations specifies which fields of the + * targeted resource are going to be updated. The API is required + * to only change the values of the fields as specified in the mask + * and leave the others untouched. If a resource is passed in to + * describe the updated values, the API ignores the values of all + * fields not covered by the mask. + * + * If a repeated field is specified for an update operation, the existing + * repeated values in the target resource will be overwritten by the new values. + * Note that a repeated field is only allowed in the last position of a `paths` + * string. + * + * If a sub-message is specified in the last position of the field mask for an + * update operation, then the existing sub-message in the target resource is + * overwritten. Given the target message: + * + * f { + * b { + * d : 1 + * x : 2 + * } + * c : 1 + * } + * + * And an update message: + * + * f { + * b { + * d : 10 + * } + * } + * + * then if the field mask is: + * + * paths: "f.b" + * + * then the result will be: + * + * f { + * b { + * d : 10 + * } + * c : 1 + * } + * + * However, if the update mask was: + * + * paths: "f.b.d" + * + * then the result would be: + * + * f { + * b { + * d : 10 + * x : 2 + * } + * c : 1 + * } + * + * In order to reset a field's value to the default, the field must + * be in the mask and set to the default value in the provided resource. + * Hence, in order to reset all fields of a resource, provide a default + * instance of the resource and set all fields in the mask, or do + * not provide a mask as described below. + * + * If a field mask is not present on update, the operation applies to + * all fields (as if a field mask of all fields has been specified). + * Note that in the presence of schema evolution, this may mean that + * fields the client does not know and has therefore not filled into + * the request will be reset to their default. If this is unwanted + * behavior, a specific service may require a client to always specify + * a field mask, producing an error if not. + * + * As with get operations, the location of the resource which + * describes the updated values in the request message depends on the + * operation kind. In any case, the effect of the field mask is + * required to be honored by the API. + * + * ## Considerations for HTTP REST + * + * The HTTP kind of an update operation which uses a field mask must + * be set to PATCH instead of PUT in order to satisfy HTTP semantics + * (PUT must only be used for full updates). + * + * # JSON Encoding of Field Masks + * + * In JSON, a field mask is encoded as a single string where paths are + * separated by a comma. Fields name in each path are converted + * to/from lower-camel naming conventions. + * + * As an example, consider the following message declarations: + * + * message Profile { + * User user = 1; + * Photo photo = 2; + * } + * message User { + * string display_name = 1; + * string address = 2; + * } + * + * In proto a field mask for `Profile` may look as such: + * + * mask { + * paths: "user.display_name" + * paths: "photo" + * } + * + * In JSON, the same mask is represented as below: + * + * { + * mask: "user.displayName,photo" + * } + * + * # Field Masks and Oneof Fields + * + * Field masks treat fields in oneofs just as regular fields. Consider the + * following message: + * + * message SampleMessage { + * oneof test_oneof { + * string name = 4; + * SubMessage sub_message = 9; + * } + * } + * + * The field mask can be: + * + * mask { + * paths: "name" + * } + * + * Or: + * + * mask { + * paths: "sub_message" + * } + * + * Note that oneof type names ("test_oneof" in this case) cannot be used in + * paths. + * + * ## Field Mask Verification + * + * The implementation of any API method which has a FieldMask type field in the + * request should verify the included field paths, and return an + * `INVALID_ARGUMENT` error if any path is duplicated or unmappable. + * + * @property {string[]} paths + * The set of field mask paths. + * + * @typedef FieldMask + * @memberof google.protobuf + * @see [google.protobuf.FieldMask definition in proto format]{@link https://github.com/google/protobuf/blob/master/src/google/protobuf/field_mask.proto} + */ +const FieldMask = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; \ No newline at end of file diff --git a/packages/google-cloud-securitycenter/src/v1/doc/google/protobuf/doc_struct.js b/packages/google-cloud-securitycenter/src/v1/doc/google/protobuf/doc_struct.js new file mode 100644 index 00000000000..ae7e4ef1ff6 --- /dev/null +++ b/packages/google-cloud-securitycenter/src/v1/doc/google/protobuf/doc_struct.js @@ -0,0 +1,112 @@ +// Copyright 2019 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Note: this file is purely for documentation. Any contents are not expected +// to be loaded as the JS file. + +/** + * `Struct` represents a structured data value, consisting of fields + * which map to dynamically typed values. In some languages, `Struct` + * might be supported by a native representation. For example, in + * scripting languages like JS a struct is represented as an + * object. The details of that representation are described together + * with the proto support for the language. + * + * The JSON representation for `Struct` is JSON object. + * + * @property {Object.} fields + * Unordered map of dynamically typed values. + * + * @typedef Struct + * @memberof google.protobuf + * @see [google.protobuf.Struct definition in proto format]{@link https://github.com/google/protobuf/blob/master/src/google/protobuf/struct.proto} + */ +const Struct = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * `Value` represents a dynamically typed value which can be either + * null, a number, a string, a boolean, a recursive struct value, or a + * list of values. A producer of value is expected to set one of that + * variants, absence of any variant indicates an error. + * + * The JSON representation for `Value` is JSON value. + * + * @property {number} nullValue + * Represents a null value. + * + * The number should be among the values of [NullValue]{@link google.protobuf.NullValue} + * + * @property {number} numberValue + * Represents a double value. + * + * @property {string} stringValue + * Represents a string value. + * + * @property {boolean} boolValue + * Represents a boolean value. + * + * @property {Object} structValue + * Represents a structured value. + * + * This object should have the same structure as [Struct]{@link google.protobuf.Struct} + * + * @property {Object} listValue + * Represents a repeated `Value`. + * + * This object should have the same structure as [ListValue]{@link google.protobuf.ListValue} + * + * @typedef Value + * @memberof google.protobuf + * @see [google.protobuf.Value definition in proto format]{@link https://github.com/google/protobuf/blob/master/src/google/protobuf/struct.proto} + */ +const Value = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * `ListValue` is a wrapper around a repeated field of values. + * + * The JSON representation for `ListValue` is JSON array. + * + * @property {Object[]} values + * Repeated field of dynamically typed values. + * + * This object should have the same structure as [Value]{@link google.protobuf.Value} + * + * @typedef ListValue + * @memberof google.protobuf + * @see [google.protobuf.ListValue definition in proto format]{@link https://github.com/google/protobuf/blob/master/src/google/protobuf/struct.proto} + */ +const ListValue = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * `NullValue` is a singleton enumeration to represent the null value for the + * `Value` type union. + * + * The JSON representation for `NullValue` is JSON `null`. + * + * @enum {number} + * @memberof google.protobuf + */ +const NullValue = { + + /** + * Null value. + */ + NULL_VALUE: 0 +}; \ No newline at end of file diff --git a/packages/google-cloud-securitycenter/src/v1/doc/google/protobuf/doc_timestamp.js b/packages/google-cloud-securitycenter/src/v1/doc/google/protobuf/doc_timestamp.js new file mode 100644 index 00000000000..b47f41c2b30 --- /dev/null +++ b/packages/google-cloud-securitycenter/src/v1/doc/google/protobuf/doc_timestamp.js @@ -0,0 +1,113 @@ +// Copyright 2019 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Note: this file is purely for documentation. Any contents are not expected +// to be loaded as the JS file. + +/** + * A Timestamp represents a point in time independent of any time zone + * or calendar, represented as seconds and fractions of seconds at + * nanosecond resolution in UTC Epoch time. It is encoded using the + * Proleptic Gregorian Calendar which extends the Gregorian calendar + * backwards to year one. It is encoded assuming all minutes are 60 + * seconds long, i.e. leap seconds are "smeared" so that no leap second + * table is needed for interpretation. Range is from + * 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. + * By restricting to that range, we ensure that we can convert to + * and from RFC 3339 date strings. + * See [https://www.ietf.org/rfc/rfc3339.txt](https://www.ietf.org/rfc/rfc3339.txt). + * + * # Examples + * + * Example 1: Compute Timestamp from POSIX `time()`. + * + * Timestamp timestamp; + * timestamp.set_seconds(time(NULL)); + * timestamp.set_nanos(0); + * + * Example 2: Compute Timestamp from POSIX `gettimeofday()`. + * + * struct timeval tv; + * gettimeofday(&tv, NULL); + * + * Timestamp timestamp; + * timestamp.set_seconds(tv.tv_sec); + * timestamp.set_nanos(tv.tv_usec * 1000); + * + * Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + * + * FILETIME ft; + * GetSystemTimeAsFileTime(&ft); + * UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + * + * // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + * // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + * Timestamp timestamp; + * timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + * timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + * + * Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + * + * long millis = System.currentTimeMillis(); + * + * Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + * .setNanos((int) ((millis % 1000) * 1000000)).build(); + * + * + * Example 5: Compute Timestamp from current time in Python. + * + * timestamp = Timestamp() + * timestamp.GetCurrentTime() + * + * # JSON Mapping + * + * In JSON format, the Timestamp type is encoded as a string in the + * [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the + * format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" + * where {year} is always expressed using four digits while {month}, {day}, + * {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional + * seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), + * are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone + * is required. A proto3 JSON serializer should always use UTC (as indicated by + * "Z") when printing the Timestamp type and a proto3 JSON parser should be + * able to accept both UTC and other timezones (as indicated by an offset). + * + * For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past + * 01:30 UTC on January 15, 2017. + * + * In JavaScript, one can convert a Date object to this format using the + * standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + * method. In Python, a standard `datetime.datetime` object can be converted + * to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) + * with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one + * can use the Joda Time's [`ISODateTimeFormat.dateTime()`](https://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime--) to obtain a formatter capable of generating timestamps in this format. + * + * @property {number} seconds + * Represents seconds of UTC time since Unix epoch + * 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to + * 9999-12-31T23:59:59Z inclusive. + * + * @property {number} nanos + * Non-negative fractions of a second at nanosecond resolution. Negative + * second values with fractions must still have non-negative nanos values + * that count forward in time. Must be from 0 to 999,999,999 + * inclusive. + * + * @typedef Timestamp + * @memberof google.protobuf + * @see [google.protobuf.Timestamp definition in proto format]{@link https://github.com/google/protobuf/blob/master/src/google/protobuf/timestamp.proto} + */ +const Timestamp = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; \ No newline at end of file diff --git a/packages/google-cloud-securitycenter/src/v1/doc/google/rpc/doc_status.js b/packages/google-cloud-securitycenter/src/v1/doc/google/rpc/doc_status.js new file mode 100644 index 00000000000..432ab6bb928 --- /dev/null +++ b/packages/google-cloud-securitycenter/src/v1/doc/google/rpc/doc_status.js @@ -0,0 +1,95 @@ +// Copyright 2019 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Note: this file is purely for documentation. Any contents are not expected +// to be loaded as the JS file. + +/** + * The `Status` type defines a logical error model that is suitable for + * different programming environments, including REST APIs and RPC APIs. It is + * used by [gRPC](https://github.com/grpc). The error model is designed to be: + * + * - Simple to use and understand for most users + * - Flexible enough to meet unexpected needs + * + * # Overview + * + * The `Status` message contains three pieces of data: error code, error + * message, and error details. The error code should be an enum value of + * google.rpc.Code, but it may accept additional error codes + * if needed. The error message should be a developer-facing English message + * that helps developers *understand* and *resolve* the error. If a localized + * user-facing error message is needed, put the localized message in the error + * details or localize it in the client. The optional error details may contain + * arbitrary information about the error. There is a predefined set of error + * detail types in the package `google.rpc` that can be used for common error + * conditions. + * + * # Language mapping + * + * The `Status` message is the logical representation of the error model, but it + * is not necessarily the actual wire format. When the `Status` message is + * exposed in different client libraries and different wire protocols, it can be + * mapped differently. For example, it will likely be mapped to some exceptions + * in Java, but more likely mapped to some error codes in C. + * + * # Other uses + * + * The error model and the `Status` message can be used in a variety of + * environments, either with or without APIs, to provide a + * consistent developer experience across different environments. + * + * Example uses of this error model include: + * + * - Partial errors. If a service needs to return partial errors to the client, + * it may embed the `Status` in the normal response to indicate the partial + * errors. + * + * - Workflow errors. A typical workflow has multiple steps. Each step may + * have a `Status` message for error reporting. + * + * - Batch operations. If a client uses batch request and batch response, the + * `Status` message should be used directly inside batch response, one for + * each error sub-response. + * + * - Asynchronous operations. If an API call embeds asynchronous operation + * results in its response, the status of those operations should be + * represented directly using the `Status` message. + * + * - Logging. If some API errors are stored in logs, the message `Status` could + * be used directly after any stripping needed for security/privacy reasons. + * + * @property {number} code + * The status code, which should be an enum value of + * google.rpc.Code. + * + * @property {string} message + * A developer-facing error message, which should be in English. Any + * user-facing error message should be localized and sent in the + * google.rpc.Status.details field, or localized + * by the client. + * + * @property {Object[]} details + * A list of messages that carry the error details. There is a common set of + * message types for APIs to use. + * + * This object should have the same structure as [Any]{@link google.protobuf.Any} + * + * @typedef Status + * @memberof google.rpc + * @see [google.rpc.Status definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/rpc/status.proto} + */ +const Status = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; \ No newline at end of file diff --git a/packages/google-cloud-securitycenter/src/v1/index.js b/packages/google-cloud-securitycenter/src/v1/index.js new file mode 100644 index 00000000000..1f988c41e32 --- /dev/null +++ b/packages/google-cloud-securitycenter/src/v1/index.js @@ -0,0 +1,19 @@ +// Copyright 2019 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT 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'; + +const SecurityCenterClient = require('./security_center_client'); + +module.exports.SecurityCenterClient = SecurityCenterClient; diff --git a/packages/google-cloud-securitycenter/src/v1/security_center_client.js b/packages/google-cloud-securitycenter/src/v1/security_center_client.js new file mode 100644 index 00000000000..87a9c59c5f8 --- /dev/null +++ b/packages/google-cloud-securitycenter/src/v1/security_center_client.js @@ -0,0 +1,2777 @@ +// Copyright 2019 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT 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'; + +const gapicConfig = require('./security_center_client_config'); +const gax = require('google-gax'); +const merge = require('lodash.merge'); +const path = require('path'); +const protobuf = require('protobufjs'); + +const VERSION = require('../../package.json').version; + +/** + * V1 APIs for Security Center service. + * + * @class + * @memberof v1 + */ +class SecurityCenterClient { + /** + * Construct an instance of SecurityCenterClient. + * + * @param {object} [options] - The configuration object. See the subsequent + * parameters for more details. + * @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 {function} [options.promise] - Custom promise module to use instead + * of native Promises. + * @param {string} [options.servicePath] - The domain name of the + * API remote host. + */ + constructor(opts) { + this._descriptors = {}; + + // Ensure that options include the service address and port. + opts = Object.assign( + { + clientConfig: {}, + port: this.constructor.port, + servicePath: this.constructor.servicePath, + }, + opts + ); + + // Create a `gaxGrpc` object, with any grpc-specific options + // sent to the client. + opts.scopes = this.constructor.scopes; + const gaxGrpc = new gax.GrpcClient(opts); + + // Save the auth object to the client, for use by other methods. + this.auth = gaxGrpc.auth; + + // Determine the client header string. + const clientHeader = [ + `gl-node/${process.version}`, + `grpc/${gaxGrpc.grpcVersion}`, + `gax/${gax.version}`, + `gapic/${VERSION}`, + ]; + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + + // Load the applicable protos. + const protos = merge( + {}, + gaxGrpc.loadProto( + path.join(__dirname, '..', '..', 'protos'), + 'google/cloud/securitycenter/v1/securitycenter_service.proto' + ) + ); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this._pathTemplates = { + organizationPathTemplate: new gax.PathTemplate( + 'organizations/{organization}' + ), + assetSecurityMarksPathTemplate: new gax.PathTemplate( + 'organizations/{organization}/assets/{asset}/securityMarks' + ), + findingSecurityMarksPathTemplate: new gax.PathTemplate( + 'organizations/{organization}/sources/{source}/findings/{finding}/securityMarks' + ), + organizationSettingsPathTemplate: new gax.PathTemplate( + 'organizations/{organization}/organizationSettings' + ), + organizationSourcesPathTemplate: new gax.PathTemplate( + 'organizations/{organization}/sources/-' + ), + sourcePathTemplate: new gax.PathTemplate( + 'organizations/{organization}/sources/{source}' + ), + findingPathTemplate: new gax.PathTemplate( + 'organizations/{organization}/sources/{source}/findings/{finding}' + ), + }; + + // Some of the methods on this service return "paged" results, + // (e.g. 50 results at a time, with tokens to get subsequent + // pages). Denote the keys used for pagination and results. + this._descriptors.page = { + groupAssets: new gax.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'groupByResults' + ), + groupFindings: new gax.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'groupByResults' + ), + listAssets: new gax.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'listAssetsResults' + ), + listFindings: new gax.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'listFindingsResults' + ), + listSources: new gax.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'sources' + ), + }; + let protoFilesRoot = new gax.GoogleProtoFilesRoot(); + protoFilesRoot = protobuf.loadSync( + path.join( + __dirname, + '..', + '..', + 'protos', + 'google/cloud/securitycenter/v1/securitycenter_service.proto' + ), + protoFilesRoot + ); + + // This API contains "long-running operations", which return a + // an Operation object that allows for tracking of the operation, + // rather than holding a request open. + this.operationsClient = new gax.lro({ + auth: gaxGrpc.auth, + grpc: gaxGrpc.grpc, + }).operationsClient(opts); + + const runAssetDiscoveryResponse = protoFilesRoot.lookup( + 'google.protobuf.Empty' + ); + const runAssetDiscoveryMetadata = protoFilesRoot.lookup( + 'google.protobuf.Empty' + ); + + this._descriptors.longrunning = { + runAssetDiscovery: new gax.LongrunningDescriptor( + this.operationsClient, + runAssetDiscoveryResponse.decode.bind(runAssetDiscoveryResponse), + runAssetDiscoveryMetadata.decode.bind(runAssetDiscoveryMetadata) + ), + }; + + // Put together the default options sent with requests. + const defaults = gaxGrpc.constructSettings( + 'google.cloud.securitycenter.v1.SecurityCenter', + gapicConfig, + 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 = {}; + + // Put together the "service stub" for + // google.cloud.securitycenter.v1.SecurityCenter. + const securityCenterStub = gaxGrpc.createStub( + protos.google.cloud.securitycenter.v1.SecurityCenter, + opts + ); + + // Iterate over each of the methods that the service provides + // and create an API call method for each. + const securityCenterStubMethods = [ + 'createSource', + 'createFinding', + 'getIamPolicy', + 'getOrganizationSettings', + 'getSource', + 'groupAssets', + 'groupFindings', + 'listAssets', + 'listFindings', + 'listSources', + 'runAssetDiscovery', + 'setFindingState', + 'setIamPolicy', + 'testIamPermissions', + 'updateFinding', + 'updateOrganizationSettings', + 'updateSource', + 'updateSecurityMarks', + ]; + for (const methodName of securityCenterStubMethods) { + this._innerApiCalls[methodName] = gax.createApiCall( + securityCenterStub.then( + stub => + function() { + const args = Array.prototype.slice.call(arguments, 0); + return stub[methodName].apply(stub, args); + }, + err => + function() { + throw err; + } + ), + defaults[methodName], + this._descriptors.page[methodName] || + this._descriptors.longrunning[methodName] + ); + } + } + + /** + * The DNS address for this API service. + */ + static get servicePath() { + return 'securitycenter.googleapis.com'; + } + + /** + * The port for this API service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + */ + static get scopes() { + return ['https://www.googleapis.com/auth/cloud-platform']; + } + + /** + * Return the project ID used by this class. + * @param {function(Error, string)} callback - the callback to + * be called with the current project Id. + */ + getProjectId(callback) { + return this.auth.getProjectId(callback); + } + + // ------------------- + // -- Service calls -- + // ------------------- + + /** + * Creates a source. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Resource name of the new source's parent. Its format should be + * "organizations/[organization_id]". + * @param {Object} request.source + * The Source being created, only the display_name and description will be + * used. All other fields will be ignored. + * + * This object should have the same structure as [Source]{@link google.cloud.securitycenter.v1.Source} + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing [Source]{@link google.cloud.securitycenter.v1.Source}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Source]{@link google.cloud.securitycenter.v1.Source}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + * @example + * + * const securityCenter = require('@google-cloud/security-center'); + * + * const client = new securityCenter.v1.SecurityCenterClient({ + * // optional auth parameters. + * }); + * + * const formattedParent = client.organizationPath('[ORGANIZATION]'); + * const source = {}; + * const request = { + * parent: formattedParent, + * source: source, + * }; + * client.createSource(request) + * .then(responses => { + * const response = responses[0]; + * // doThingsWith(response) + * }) + * .catch(err => { + * console.error(err); + * }); + */ + createSource(request, options, callback) { + if (options instanceof Function && callback === undefined) { + callback = options; + options = {}; + } + options = options || {}; + + return this._innerApiCalls.createSource(request, options, callback); + } + + /** + * Creates a finding. The corresponding source must exist for finding creation + * to succeed. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Resource name of the new finding's parent. Its format should be + * "organizations/[organization_id]/sources/[source_id]". + * @param {string} request.findingId + * Unique identifier provided by the client within the parent scope. + * It must be alphanumeric and less than or equal to 32 characters and + * greater than 0 characters in length. + * @param {Object} request.finding + * The Finding being created. The name and security_marks will be ignored as + * they are both output only fields on this resource. + * + * This object should have the same structure as [Finding]{@link google.cloud.securitycenter.v1.Finding} + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing [Finding]{@link google.cloud.securitycenter.v1.Finding}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Finding]{@link google.cloud.securitycenter.v1.Finding}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + * @example + * + * const securityCenter = require('@google-cloud/security-center'); + * + * const client = new securityCenter.v1.SecurityCenterClient({ + * // optional auth parameters. + * }); + * + * const formattedParent = client.sourcePath('[ORGANIZATION]', '[SOURCE]'); + * const findingId = ''; + * const finding = {}; + * const request = { + * parent: formattedParent, + * findingId: findingId, + * finding: finding, + * }; + * client.createFinding(request) + * .then(responses => { + * const response = responses[0]; + * // doThingsWith(response) + * }) + * .catch(err => { + * console.error(err); + * }); + */ + createFinding(request, options, callback) { + if (options instanceof Function && callback === undefined) { + callback = options; + options = {}; + } + options = options || {}; + + return this._innerApiCalls.createFinding(request, options, callback); + } + + /** + * Gets the access control policy on the specified Source. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy is being requested. + * `resource` is usually specified as a path. For example, a Project + * resource is specified as `projects/{project}`. + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing [Policy]{@link google.iam.v1.Policy}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Policy]{@link google.iam.v1.Policy}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + * @example + * + * const securityCenter = require('@google-cloud/security-center'); + * + * const client = new securityCenter.v1.SecurityCenterClient({ + * // optional auth parameters. + * }); + * + * const formattedResource = client.sourcePath('[ORGANIZATION]', '[SOURCE]'); + * client.getIamPolicy({resource: formattedResource}) + * .then(responses => { + * const response = responses[0]; + * // doThingsWith(response) + * }) + * .catch(err => { + * console.error(err); + * }); + */ + getIamPolicy(request, options, callback) { + if (options instanceof Function && callback === undefined) { + callback = options; + options = {}; + } + options = options || {}; + + return this._innerApiCalls.getIamPolicy(request, options, callback); + } + + /** + * Gets the settings for an organization. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Name of the organization to get organization settings for. Its format is + * "organizations/[organization_id]/organizationSettings". + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing [OrganizationSettings]{@link google.cloud.securitycenter.v1.OrganizationSettings}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [OrganizationSettings]{@link google.cloud.securitycenter.v1.OrganizationSettings}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + * @example + * + * const securityCenter = require('@google-cloud/security-center'); + * + * const client = new securityCenter.v1.SecurityCenterClient({ + * // optional auth parameters. + * }); + * + * const formattedName = client.organizationSettingsPath('[ORGANIZATION]'); + * client.getOrganizationSettings({name: formattedName}) + * .then(responses => { + * const response = responses[0]; + * // doThingsWith(response) + * }) + * .catch(err => { + * console.error(err); + * }); + */ + getOrganizationSettings(request, options, callback) { + if (options instanceof Function && callback === undefined) { + callback = options; + options = {}; + } + options = options || {}; + + return this._innerApiCalls.getOrganizationSettings( + request, + options, + callback + ); + } + + /** + * Gets a source. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Relative resource name of the source. Its format is + * "organizations/[organization_id]/source/[source_id]". + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing [Source]{@link google.cloud.securitycenter.v1.Source}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Source]{@link google.cloud.securitycenter.v1.Source}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + * @example + * + * const securityCenter = require('@google-cloud/security-center'); + * + * const client = new securityCenter.v1.SecurityCenterClient({ + * // optional auth parameters. + * }); + * + * const formattedName = client.sourcePath('[ORGANIZATION]', '[SOURCE]'); + * client.getSource({name: formattedName}) + * .then(responses => { + * const response = responses[0]; + * // doThingsWith(response) + * }) + * .catch(err => { + * console.error(err); + * }); + */ + getSource(request, options, callback) { + if (options instanceof Function && callback === undefined) { + callback = options; + options = {}; + } + options = options || {}; + + return this._innerApiCalls.getSource(request, options, callback); + } + + /** + * Filters an organization's assets and groups them by their specified + * properties. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Name of the organization to groupBy. Its format is + * "organizations/[organization_id]". + * @param {string} request.groupBy + * Expression that defines what assets fields to use for grouping. The string + * value should follow SQL syntax: comma separated list of fields. For + * example: + * "security_center_properties.resource_project,security_center_properties.project". + * + * The following fields are supported when compare_duration is not set: + * + * * security_center_properties.resource_project + * * security_center_properties.resource_type + * * security_center_properties.resource_parent + * + * The following fields are supported when compare_duration is set: + * + * * security_center_properties.resource_type + * @param {string} [request.filter] + * Expression that defines the filter to apply across assets. + * The expression is a list of zero or more restrictions combined via logical + * operators `AND` and `OR`. + * Parentheses are supported, and `OR` has higher precedence than `AND`. + * + * Restrictions have the form ` ` and may have a `-` + * character in front of them to indicate negation. The fields map to those + * defined in the Asset resource. Examples include: + * + * * name + * * security_center_properties.resource_name + * * resource_properties.a_property + * * security_marks.marks.marka + * + * The supported operators are: + * + * * `=` for all value types. + * * `>`, `<`, `>=`, `<=` for integer values. + * * `:`, meaning substring matching, for strings. + * + * The supported value types are: + * + * * string literals in quotes. + * * integer literals without quotes. + * * boolean literals `true` and `false` without quotes. + * + * For example, `resource_properties.size = 100` is a valid filter string. + * @param {Object} [request.compareDuration] + * When compare_duration is set, the GroupResult's "state_change" property is + * updated to indicate whether the asset was added, removed, or remained + * present during the compare_duration period of time that precedes the + * read_time. This is the time between (read_time - compare_duration) and + * read_time. + * + * The state change value is derived based on the presence of the asset at the + * two points in time. Intermediate state changes between the two times don't + * affect the result. For example, the results aren't affected if the asset is + * removed and re-created again. + * + * Possible "state_change" values when compare_duration is specified: + * + * * "ADDED": indicates that the asset was not present at the start of + * compare_duration, but present at reference_time. + * * "REMOVED": indicates that the asset was present at the start of + * compare_duration, but not present at reference_time. + * * "ACTIVE": indicates that the asset was present at both the + * start and the end of the time period defined by + * compare_duration and reference_time. + * + * If compare_duration is not specified, then the only possible state_change + * is "UNUSED", which will be the state_change set for all assets present at + * read_time. + * + * If this field is set then `state_change` must be a specified field in + * `group_by`. + * + * This object should have the same structure as [Duration]{@link google.protobuf.Duration} + * @param {Object} [request.readTime] + * Time used as a reference point when filtering assets. The filter is limited + * to assets existing at the supplied time and their values are those at that + * specific time. Absence of this field will default to the API's version of + * NOW. + * + * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} + * @param {string} [request.having] + * Filter that specifies what fields to further filter on *after* the query + * filter has been executed. Currently only 'state_change' is supported and + * requires compare_duration to be specified. + * @param {number} [request.pageSize] + * The maximum number of resources contained in the underlying API + * response. If page streaming is performed per-resource, this + * parameter does not affect the return value. If page streaming is + * performed per-page, this determines the maximum number of + * resources in a page. + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. + * @param {function(?Error, ?Array, ?Object, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is Array of [GroupResult]{@link google.cloud.securitycenter.v1.GroupResult}. + * + * When autoPaginate: false is specified through options, it contains the result + * in a single response. If the response indicates the next page exists, the third + * parameter is set to be used for the next request object. The fourth parameter keeps + * the raw response object of an object representing [GroupAssetsResponse]{@link google.cloud.securitycenter.v1.GroupAssetsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [GroupResult]{@link google.cloud.securitycenter.v1.GroupResult}. + * + * When autoPaginate: false is specified through options, the array has three elements. + * The first element is Array of [GroupResult]{@link google.cloud.securitycenter.v1.GroupResult} in a single response. + * The second element is the next request object if the response + * indicates the next page exists, or null. The third element is + * an object representing [GroupAssetsResponse]{@link google.cloud.securitycenter.v1.GroupAssetsResponse}. + * + * The promise has a method named "cancel" which cancels the ongoing API call. + * + * @example + * + * const securityCenter = require('@google-cloud/security-center'); + * + * const client = new securityCenter.v1.SecurityCenterClient({ + * // optional auth parameters. + * }); + * + * // Iterate over all elements. + * const formattedParent = client.organizationPath('[ORGANIZATION]'); + * const groupBy = ''; + * const request = { + * parent: formattedParent, + * groupBy: groupBy, + * }; + * + * client.groupAssets(request) + * .then(responses => { + * const resources = responses[0]; + * for (const resource of resources) { + * // doThingsWith(resource) + * } + * }) + * .catch(err => { + * console.error(err); + * }); + * + * // Or obtain the paged response. + * const formattedParent = client.organizationPath('[ORGANIZATION]'); + * const groupBy = ''; + * const request = { + * parent: formattedParent, + * groupBy: groupBy, + * }; + * + * + * const options = {autoPaginate: false}; + * const callback = responses => { + * // The actual resources in a response. + * const resources = responses[0]; + * // The next request if the response shows that there are more responses. + * const nextRequest = responses[1]; + * // The actual response object, if necessary. + * // const rawResponse = responses[2]; + * for (const resource of resources) { + * // doThingsWith(resource); + * } + * if (nextRequest) { + * // Fetch the next page. + * return client.groupAssets(nextRequest, options).then(callback); + * } + * } + * client.groupAssets(request, options) + * .then(callback) + * .catch(err => { + * console.error(err); + * }); + */ + groupAssets(request, options, callback) { + if (options instanceof Function && callback === undefined) { + callback = options; + options = {}; + } + options = options || {}; + + return this._innerApiCalls.groupAssets(request, options, callback); + } + + /** + * Equivalent to {@link groupAssets}, but returns a NodeJS Stream object. + * + * This fetches the paged responses for {@link groupAssets} continuously + * and invokes the callback registered for 'data' event for each element in the + * responses. + * + * The returned object has 'end' method when no more elements are required. + * + * autoPaginate option will be ignored. + * + * @see {@link https://nodejs.org/api/stream.html} + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Name of the organization to groupBy. Its format is + * "organizations/[organization_id]". + * @param {string} request.groupBy + * Expression that defines what assets fields to use for grouping. The string + * value should follow SQL syntax: comma separated list of fields. For + * example: + * "security_center_properties.resource_project,security_center_properties.project". + * + * The following fields are supported when compare_duration is not set: + * + * * security_center_properties.resource_project + * * security_center_properties.resource_type + * * security_center_properties.resource_parent + * + * The following fields are supported when compare_duration is set: + * + * * security_center_properties.resource_type + * @param {string} [request.filter] + * Expression that defines the filter to apply across assets. + * The expression is a list of zero or more restrictions combined via logical + * operators `AND` and `OR`. + * Parentheses are supported, and `OR` has higher precedence than `AND`. + * + * Restrictions have the form ` ` and may have a `-` + * character in front of them to indicate negation. The fields map to those + * defined in the Asset resource. Examples include: + * + * * name + * * security_center_properties.resource_name + * * resource_properties.a_property + * * security_marks.marks.marka + * + * The supported operators are: + * + * * `=` for all value types. + * * `>`, `<`, `>=`, `<=` for integer values. + * * `:`, meaning substring matching, for strings. + * + * The supported value types are: + * + * * string literals in quotes. + * * integer literals without quotes. + * * boolean literals `true` and `false` without quotes. + * + * For example, `resource_properties.size = 100` is a valid filter string. + * @param {Object} [request.compareDuration] + * When compare_duration is set, the GroupResult's "state_change" property is + * updated to indicate whether the asset was added, removed, or remained + * present during the compare_duration period of time that precedes the + * read_time. This is the time between (read_time - compare_duration) and + * read_time. + * + * The state change value is derived based on the presence of the asset at the + * two points in time. Intermediate state changes between the two times don't + * affect the result. For example, the results aren't affected if the asset is + * removed and re-created again. + * + * Possible "state_change" values when compare_duration is specified: + * + * * "ADDED": indicates that the asset was not present at the start of + * compare_duration, but present at reference_time. + * * "REMOVED": indicates that the asset was present at the start of + * compare_duration, but not present at reference_time. + * * "ACTIVE": indicates that the asset was present at both the + * start and the end of the time period defined by + * compare_duration and reference_time. + * + * If compare_duration is not specified, then the only possible state_change + * is "UNUSED", which will be the state_change set for all assets present at + * read_time. + * + * If this field is set then `state_change` must be a specified field in + * `group_by`. + * + * This object should have the same structure as [Duration]{@link google.protobuf.Duration} + * @param {Object} [request.readTime] + * Time used as a reference point when filtering assets. The filter is limited + * to assets existing at the supplied time and their values are those at that + * specific time. Absence of this field will default to the API's version of + * NOW. + * + * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} + * @param {string} [request.having] + * Filter that specifies what fields to further filter on *after* the query + * filter has been executed. Currently only 'state_change' is supported and + * requires compare_duration to be specified. + * @param {number} [request.pageSize] + * The maximum number of resources contained in the underlying API + * response. If page streaming is performed per-resource, this + * parameter does not affect the return value. If page streaming is + * performed per-page, this determines the maximum number of + * resources in a page. + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. + * @returns {Stream} + * An object stream which emits an object representing [GroupResult]{@link google.cloud.securitycenter.v1.GroupResult} on 'data' event. + * + * @example + * + * const securityCenter = require('@google-cloud/security-center'); + * + * const client = new securityCenter.v1.SecurityCenterClient({ + * // optional auth parameters. + * }); + * + * const formattedParent = client.organizationPath('[ORGANIZATION]'); + * const groupBy = ''; + * const request = { + * parent: formattedParent, + * groupBy: groupBy, + * }; + * client.groupAssetsStream(request) + * .on('data', element => { + * // doThingsWith(element) + * }).on('error', err => { + * console.log(err); + * }); + */ + groupAssetsStream(request, options) { + options = options || {}; + + return this._descriptors.page.groupAssets.createStream( + this._innerApiCalls.groupAssets, + request, + options + ); + } + + /** + * Filters an organization or source's findings and groups them by their + * specified properties. + * + * To group across all sources provide a `-` as the source id. + * Example: /v1/organizations/123/sources/-/findings + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Name of the source to groupBy. Its format is + * "organizations/[organization_id]/sources/[source_id]". To groupBy across + * all sources provide a source_id of `-`. For example: + * organizations/123/sources/- + * @param {string} request.groupBy + * Expression that defines what assets fields to use for grouping (including + * `state_change`). The string value should follow SQL syntax: comma separated + * list of fields. For example: "parent,resource_name". + * + * The following fields are supported: + * + * * resource_name + * * category + * * state + * * state_change + * * parent + * @param {string} [request.filter] + * Expression that defines the filter to apply across findings. + * The expression is a list of one or more restrictions combined via logical + * operators `AND` and `OR`. + * Parentheses are supported, and `OR` has higher precedence than `AND`. + * + * Restrictions have the form ` ` and may have a `-` + * character in front of them to indicate negation. Examples include: + * + * * name + * * source_properties.a_property + * * security_marks.marks.marka + * + * The supported operators are: + * + * * `=` for all value types. + * * `>`, `<`, `>=`, `<=` for integer values. + * * `:`, meaning substring matching, for strings. + * + * The supported value types are: + * + * * string literals in quotes. + * * integer literals without quotes. + * * boolean literals `true` and `false` without quotes. + * + * For example, `source_properties.size = 100` is a valid filter string. + * @param {Object} [request.readTime] + * Time used as a reference point when filtering findings. The filter is + * limited to findings existing at the supplied time and their values are + * those at that specific time. Absence of this field will default to the + * API's version of NOW. + * + * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} + * @param {Object} [request.compareDuration] + * When compare_duration is set, the GroupResult's "state_change" attribute is + * updated to indicate whether the finding had its state changed, the + * finding's state remained unchanged, or if the finding was added during the + * compare_duration period of time that precedes the read_time. This is the + * time between (read_time - compare_duration) and read_time. + * + * The state_change value is derived based on the presence and state of the + * finding at the two points in time. Intermediate state changes between the + * two times don't affect the result. For example, the results aren't affected + * if the finding is made inactive and then active again. + * + * Possible "state_change" values when compare_duration is specified: + * + * * "CHANGED": indicates that the finding was present at the start of + * compare_duration, but changed its state at read_time. + * * "UNCHANGED": indicates that the finding was present at the start of + * compare_duration and did not change state at read_time. + * * "ADDED": indicates that the finding was not present at the start + * of compare_duration, but was present at read_time. + * + * If compare_duration is not specified, then the only possible state_change + * is "UNUSED", which will be the state_change set for all findings present + * at read_time. + * + * If this field is set then `state_change` must be a specified field in + * `group_by`. + * + * This object should have the same structure as [Duration]{@link google.protobuf.Duration} + * @param {string} [request.having] + * Filter that specifies what fields to further filter on *after* the query + * filter has been executed. Currently only 'finding.state' and 'state_change' + * are supported and requires compare_duration to be specified. + * @param {number} [request.pageSize] + * The maximum number of resources contained in the underlying API + * response. If page streaming is performed per-resource, this + * parameter does not affect the return value. If page streaming is + * performed per-page, this determines the maximum number of + * resources in a page. + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. + * @param {function(?Error, ?Array, ?Object, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is Array of [GroupResult]{@link google.cloud.securitycenter.v1.GroupResult}. + * + * When autoPaginate: false is specified through options, it contains the result + * in a single response. If the response indicates the next page exists, the third + * parameter is set to be used for the next request object. The fourth parameter keeps + * the raw response object of an object representing [GroupFindingsResponse]{@link google.cloud.securitycenter.v1.GroupFindingsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [GroupResult]{@link google.cloud.securitycenter.v1.GroupResult}. + * + * When autoPaginate: false is specified through options, the array has three elements. + * The first element is Array of [GroupResult]{@link google.cloud.securitycenter.v1.GroupResult} in a single response. + * The second element is the next request object if the response + * indicates the next page exists, or null. The third element is + * an object representing [GroupFindingsResponse]{@link google.cloud.securitycenter.v1.GroupFindingsResponse}. + * + * The promise has a method named "cancel" which cancels the ongoing API call. + * + * @example + * + * const securityCenter = require('@google-cloud/security-center'); + * + * const client = new securityCenter.v1.SecurityCenterClient({ + * // optional auth parameters. + * }); + * + * // Iterate over all elements. + * const formattedParent = client.sourcePath('[ORGANIZATION]', '[SOURCE]'); + * const groupBy = ''; + * const request = { + * parent: formattedParent, + * groupBy: groupBy, + * }; + * + * client.groupFindings(request) + * .then(responses => { + * const resources = responses[0]; + * for (const resource of resources) { + * // doThingsWith(resource) + * } + * }) + * .catch(err => { + * console.error(err); + * }); + * + * // Or obtain the paged response. + * const formattedParent = client.sourcePath('[ORGANIZATION]', '[SOURCE]'); + * const groupBy = ''; + * const request = { + * parent: formattedParent, + * groupBy: groupBy, + * }; + * + * + * const options = {autoPaginate: false}; + * const callback = responses => { + * // The actual resources in a response. + * const resources = responses[0]; + * // The next request if the response shows that there are more responses. + * const nextRequest = responses[1]; + * // The actual response object, if necessary. + * // const rawResponse = responses[2]; + * for (const resource of resources) { + * // doThingsWith(resource); + * } + * if (nextRequest) { + * // Fetch the next page. + * return client.groupFindings(nextRequest, options).then(callback); + * } + * } + * client.groupFindings(request, options) + * .then(callback) + * .catch(err => { + * console.error(err); + * }); + */ + groupFindings(request, options, callback) { + if (options instanceof Function && callback === undefined) { + callback = options; + options = {}; + } + options = options || {}; + + return this._innerApiCalls.groupFindings(request, options, callback); + } + + /** + * Equivalent to {@link groupFindings}, but returns a NodeJS Stream object. + * + * This fetches the paged responses for {@link groupFindings} continuously + * and invokes the callback registered for 'data' event for each element in the + * responses. + * + * The returned object has 'end' method when no more elements are required. + * + * autoPaginate option will be ignored. + * + * @see {@link https://nodejs.org/api/stream.html} + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Name of the source to groupBy. Its format is + * "organizations/[organization_id]/sources/[source_id]". To groupBy across + * all sources provide a source_id of `-`. For example: + * organizations/123/sources/- + * @param {string} request.groupBy + * Expression that defines what assets fields to use for grouping (including + * `state_change`). The string value should follow SQL syntax: comma separated + * list of fields. For example: "parent,resource_name". + * + * The following fields are supported: + * + * * resource_name + * * category + * * state + * * state_change + * * parent + * @param {string} [request.filter] + * Expression that defines the filter to apply across findings. + * The expression is a list of one or more restrictions combined via logical + * operators `AND` and `OR`. + * Parentheses are supported, and `OR` has higher precedence than `AND`. + * + * Restrictions have the form ` ` and may have a `-` + * character in front of them to indicate negation. Examples include: + * + * * name + * * source_properties.a_property + * * security_marks.marks.marka + * + * The supported operators are: + * + * * `=` for all value types. + * * `>`, `<`, `>=`, `<=` for integer values. + * * `:`, meaning substring matching, for strings. + * + * The supported value types are: + * + * * string literals in quotes. + * * integer literals without quotes. + * * boolean literals `true` and `false` without quotes. + * + * For example, `source_properties.size = 100` is a valid filter string. + * @param {Object} [request.readTime] + * Time used as a reference point when filtering findings. The filter is + * limited to findings existing at the supplied time and their values are + * those at that specific time. Absence of this field will default to the + * API's version of NOW. + * + * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} + * @param {Object} [request.compareDuration] + * When compare_duration is set, the GroupResult's "state_change" attribute is + * updated to indicate whether the finding had its state changed, the + * finding's state remained unchanged, or if the finding was added during the + * compare_duration period of time that precedes the read_time. This is the + * time between (read_time - compare_duration) and read_time. + * + * The state_change value is derived based on the presence and state of the + * finding at the two points in time. Intermediate state changes between the + * two times don't affect the result. For example, the results aren't affected + * if the finding is made inactive and then active again. + * + * Possible "state_change" values when compare_duration is specified: + * + * * "CHANGED": indicates that the finding was present at the start of + * compare_duration, but changed its state at read_time. + * * "UNCHANGED": indicates that the finding was present at the start of + * compare_duration and did not change state at read_time. + * * "ADDED": indicates that the finding was not present at the start + * of compare_duration, but was present at read_time. + * + * If compare_duration is not specified, then the only possible state_change + * is "UNUSED", which will be the state_change set for all findings present + * at read_time. + * + * If this field is set then `state_change` must be a specified field in + * `group_by`. + * + * This object should have the same structure as [Duration]{@link google.protobuf.Duration} + * @param {string} [request.having] + * Filter that specifies what fields to further filter on *after* the query + * filter has been executed. Currently only 'finding.state' and 'state_change' + * are supported and requires compare_duration to be specified. + * @param {number} [request.pageSize] + * The maximum number of resources contained in the underlying API + * response. If page streaming is performed per-resource, this + * parameter does not affect the return value. If page streaming is + * performed per-page, this determines the maximum number of + * resources in a page. + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. + * @returns {Stream} + * An object stream which emits an object representing [GroupResult]{@link google.cloud.securitycenter.v1.GroupResult} on 'data' event. + * + * @example + * + * const securityCenter = require('@google-cloud/security-center'); + * + * const client = new securityCenter.v1.SecurityCenterClient({ + * // optional auth parameters. + * }); + * + * const formattedParent = client.sourcePath('[ORGANIZATION]', '[SOURCE]'); + * const groupBy = ''; + * const request = { + * parent: formattedParent, + * groupBy: groupBy, + * }; + * client.groupFindingsStream(request) + * .on('data', element => { + * // doThingsWith(element) + * }).on('error', err => { + * console.log(err); + * }); + */ + groupFindingsStream(request, options) { + options = options || {}; + + return this._descriptors.page.groupFindings.createStream( + this._innerApiCalls.groupFindings, + request, + options + ); + } + + /** + * Lists an organization's assets. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Name of the organization assets should belong to. Its format is + * "organizations/[organization_id]". + * @param {string} [request.filter] + * Expression that defines the filter to apply across assets. + * The expression is a list of zero or more restrictions combined via logical + * operators `AND` and `OR`. + * Parentheses are supported, and `OR` has higher precedence than `AND`. + * + * Restrictions have the form ` ` and may have a `-` + * character in front of them to indicate negation. The fields map to those + * defined in the Asset resource. Examples include: + * + * * name + * * security_center_properties.resource_name + * * resource_properties.a_property + * * security_marks.marks.marka + * + * The supported operators are: + * + * * `=` for all value types. + * * `>`, `<`, `>=`, `<=` for integer values. + * * `:`, meaning substring matching, for strings. + * + * The supported value types are: + * + * * string literals in quotes. + * * integer literals without quotes. + * * boolean literals `true` and `false` without quotes. + * + * For example, `resource_properties.size = 100` is a valid filter string. + * @param {string} [request.orderBy] + * Expression that defines what fields and order to use for sorting. The + * string value should follow SQL syntax: comma separated list of fields. For + * example: "name,resource_properties.a_property". The default sorting order + * is ascending. To specify descending order for a field, a suffix " desc" + * should be appended to the field name. For example: "name + * desc,resource_properties.a_property". Redundant space characters in the + * syntax are insignificant. "name desc,resource_properties.a_property" and " + * name desc , resource_properties.a_property " are equivalent. + * @param {Object} [request.readTime] + * Time used as a reference point when filtering assets. The filter is limited + * to assets existing at the supplied time and their values are those at that + * specific time. Absence of this field will default to the API's version of + * NOW. + * + * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} + * @param {Object} [request.compareDuration] + * When compare_duration is set, the ListAssetsResult's "state_change" + * attribute is updated to indicate whether the asset was added, removed, or + * remained present during the compare_duration period of time that precedes + * the read_time. This is the time between (read_time - compare_duration) and + * read_time. + * + * The state_change value is derived based on the presence of the asset at the + * two points in time. Intermediate state changes between the two times don't + * affect the result. For example, the results aren't affected if the asset is + * removed and re-created again. + * + * Possible "state_change" values when compare_duration is specified: + * + * * "ADDED": indicates that the asset was not present at the start of + * compare_duration, but present at read_time. + * * "REMOVED": indicates that the asset was present at the start of + * compare_duration, but not present at read_time. + * * "ACTIVE": indicates that the asset was present at both the + * start and the end of the time period defined by + * compare_duration and read_time. + * + * If compare_duration is not specified, then the only possible state_change + * is "UNUSED", which will be the state_change set for all assets present at + * read_time. + * + * This object should have the same structure as [Duration]{@link google.protobuf.Duration} + * @param {string} [request.having] + * Filter that specifies what fields to further filter on *after* the query + * filter has been executed. Currently only 'state_change' is supported and + * requires compare_duration to be specified. + * @param {Object} [request.fieldMask] + * Optional. + * + * A field mask to specify the ListAssetsResult fields to be listed in the + * response. + * An empty field mask will list all fields. + * + * This object should have the same structure as [FieldMask]{@link google.protobuf.FieldMask} + * @param {number} [request.pageSize] + * The maximum number of resources contained in the underlying API + * response. If page streaming is performed per-resource, this + * parameter does not affect the return value. If page streaming is + * performed per-page, this determines the maximum number of + * resources in a page. + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. + * @param {function(?Error, ?Array, ?Object, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is Array of [ListAssetsResult]{@link google.cloud.securitycenter.v1.ListAssetsResult}. + * + * When autoPaginate: false is specified through options, it contains the result + * in a single response. If the response indicates the next page exists, the third + * parameter is set to be used for the next request object. The fourth parameter keeps + * the raw response object of an object representing [ListAssetsResponse]{@link google.cloud.securitycenter.v1.ListAssetsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [ListAssetsResult]{@link google.cloud.securitycenter.v1.ListAssetsResult}. + * + * When autoPaginate: false is specified through options, the array has three elements. + * The first element is Array of [ListAssetsResult]{@link google.cloud.securitycenter.v1.ListAssetsResult} in a single response. + * The second element is the next request object if the response + * indicates the next page exists, or null. The third element is + * an object representing [ListAssetsResponse]{@link google.cloud.securitycenter.v1.ListAssetsResponse}. + * + * The promise has a method named "cancel" which cancels the ongoing API call. + * + * @example + * + * const securityCenter = require('@google-cloud/security-center'); + * + * const client = new securityCenter.v1.SecurityCenterClient({ + * // optional auth parameters. + * }); + * + * // Iterate over all elements. + * const formattedParent = client.organizationPath('[ORGANIZATION]'); + * + * client.listAssets({parent: formattedParent}) + * .then(responses => { + * const resources = responses[0]; + * for (const resource of resources) { + * // doThingsWith(resource) + * } + * }) + * .catch(err => { + * console.error(err); + * }); + * + * // Or obtain the paged response. + * const formattedParent = client.organizationPath('[ORGANIZATION]'); + * + * + * const options = {autoPaginate: false}; + * const callback = responses => { + * // The actual resources in a response. + * const resources = responses[0]; + * // The next request if the response shows that there are more responses. + * const nextRequest = responses[1]; + * // The actual response object, if necessary. + * // const rawResponse = responses[2]; + * for (const resource of resources) { + * // doThingsWith(resource); + * } + * if (nextRequest) { + * // Fetch the next page. + * return client.listAssets(nextRequest, options).then(callback); + * } + * } + * client.listAssets({parent: formattedParent}, options) + * .then(callback) + * .catch(err => { + * console.error(err); + * }); + */ + listAssets(request, options, callback) { + if (options instanceof Function && callback === undefined) { + callback = options; + options = {}; + } + options = options || {}; + + return this._innerApiCalls.listAssets(request, options, callback); + } + + /** + * Equivalent to {@link listAssets}, but returns a NodeJS Stream object. + * + * This fetches the paged responses for {@link listAssets} continuously + * and invokes the callback registered for 'data' event for each element in the + * responses. + * + * The returned object has 'end' method when no more elements are required. + * + * autoPaginate option will be ignored. + * + * @see {@link https://nodejs.org/api/stream.html} + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Name of the organization assets should belong to. Its format is + * "organizations/[organization_id]". + * @param {string} [request.filter] + * Expression that defines the filter to apply across assets. + * The expression is a list of zero or more restrictions combined via logical + * operators `AND` and `OR`. + * Parentheses are supported, and `OR` has higher precedence than `AND`. + * + * Restrictions have the form ` ` and may have a `-` + * character in front of them to indicate negation. The fields map to those + * defined in the Asset resource. Examples include: + * + * * name + * * security_center_properties.resource_name + * * resource_properties.a_property + * * security_marks.marks.marka + * + * The supported operators are: + * + * * `=` for all value types. + * * `>`, `<`, `>=`, `<=` for integer values. + * * `:`, meaning substring matching, for strings. + * + * The supported value types are: + * + * * string literals in quotes. + * * integer literals without quotes. + * * boolean literals `true` and `false` without quotes. + * + * For example, `resource_properties.size = 100` is a valid filter string. + * @param {string} [request.orderBy] + * Expression that defines what fields and order to use for sorting. The + * string value should follow SQL syntax: comma separated list of fields. For + * example: "name,resource_properties.a_property". The default sorting order + * is ascending. To specify descending order for a field, a suffix " desc" + * should be appended to the field name. For example: "name + * desc,resource_properties.a_property". Redundant space characters in the + * syntax are insignificant. "name desc,resource_properties.a_property" and " + * name desc , resource_properties.a_property " are equivalent. + * @param {Object} [request.readTime] + * Time used as a reference point when filtering assets. The filter is limited + * to assets existing at the supplied time and their values are those at that + * specific time. Absence of this field will default to the API's version of + * NOW. + * + * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} + * @param {Object} [request.compareDuration] + * When compare_duration is set, the ListAssetsResult's "state_change" + * attribute is updated to indicate whether the asset was added, removed, or + * remained present during the compare_duration period of time that precedes + * the read_time. This is the time between (read_time - compare_duration) and + * read_time. + * + * The state_change value is derived based on the presence of the asset at the + * two points in time. Intermediate state changes between the two times don't + * affect the result. For example, the results aren't affected if the asset is + * removed and re-created again. + * + * Possible "state_change" values when compare_duration is specified: + * + * * "ADDED": indicates that the asset was not present at the start of + * compare_duration, but present at read_time. + * * "REMOVED": indicates that the asset was present at the start of + * compare_duration, but not present at read_time. + * * "ACTIVE": indicates that the asset was present at both the + * start and the end of the time period defined by + * compare_duration and read_time. + * + * If compare_duration is not specified, then the only possible state_change + * is "UNUSED", which will be the state_change set for all assets present at + * read_time. + * + * This object should have the same structure as [Duration]{@link google.protobuf.Duration} + * @param {string} [request.having] + * Filter that specifies what fields to further filter on *after* the query + * filter has been executed. Currently only 'state_change' is supported and + * requires compare_duration to be specified. + * @param {Object} [request.fieldMask] + * Optional. + * + * A field mask to specify the ListAssetsResult fields to be listed in the + * response. + * An empty field mask will list all fields. + * + * This object should have the same structure as [FieldMask]{@link google.protobuf.FieldMask} + * @param {number} [request.pageSize] + * The maximum number of resources contained in the underlying API + * response. If page streaming is performed per-resource, this + * parameter does not affect the return value. If page streaming is + * performed per-page, this determines the maximum number of + * resources in a page. + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. + * @returns {Stream} + * An object stream which emits an object representing [ListAssetsResult]{@link google.cloud.securitycenter.v1.ListAssetsResult} on 'data' event. + * + * @example + * + * const securityCenter = require('@google-cloud/security-center'); + * + * const client = new securityCenter.v1.SecurityCenterClient({ + * // optional auth parameters. + * }); + * + * const formattedParent = client.organizationPath('[ORGANIZATION]'); + * client.listAssetsStream({parent: formattedParent}) + * .on('data', element => { + * // doThingsWith(element) + * }).on('error', err => { + * console.log(err); + * }); + */ + listAssetsStream(request, options) { + options = options || {}; + + return this._descriptors.page.listAssets.createStream( + this._innerApiCalls.listAssets, + request, + options + ); + } + + /** + * Lists an organization or source's findings. + * + * To list across all sources provide a `-` as the source id. + * Example: /v1/organizations/123/sources/-/findings + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Name of the source the findings belong to. Its format is + * "organizations/[organization_id]/sources/[source_id]". To list across all + * sources provide a source_id of `-`. For example: + * organizations/123/sources/- + * @param {string} [request.filter] + * Expression that defines the filter to apply across findings. + * The expression is a list of one or more restrictions combined via logical + * operators `AND` and `OR`. + * Parentheses are supported, and `OR` has higher precedence than `AND`. + * + * Restrictions have the form ` ` and may have a `-` + * character in front of them to indicate negation. Examples include: + * + * * name + * * source_properties.a_property + * * security_marks.marks.marka + * + * The supported operators are: + * + * * `=` for all value types. + * * `>`, `<`, `>=`, `<=` for integer values. + * * `:`, meaning substring matching, for strings. + * + * The supported value types are: + * + * * string literals in quotes. + * * integer literals without quotes. + * * boolean literals `true` and `false` without quotes. + * + * For example, `source_properties.size = 100` is a valid filter string. + * @param {string} [request.orderBy] + * Expression that defines what fields and order to use for sorting. The + * string value should follow SQL syntax: comma separated list of fields. For + * example: "name,resource_properties.a_property". The default sorting order + * is ascending. To specify descending order for a field, a suffix " desc" + * should be appended to the field name. For example: "name + * desc,source_properties.a_property". Redundant space characters in the + * syntax are insignificant. "name desc,source_properties.a_property" and " + * name desc , source_properties.a_property " are equivalent. + * @param {Object} [request.readTime] + * Time used as a reference point when filtering findings. The filter is + * limited to findings existing at the supplied time and their values are + * those at that specific time. Absence of this field will default to the + * API's version of NOW. + * + * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} + * @param {Object} [request.compareDuration] + * When compare_duration is set, the ListFindingsResult's "state_change" + * attribute is updated to indicate whether the finding had its state changed, + * the finding's state remained unchanged, or if the finding was added in any + * state during the compare_duration period of time that precedes the + * read_time. This is the time between (read_time - compare_duration) and + * read_time. + * + * The state_change value is derived based on the presence and state of the + * finding at the two points in time. Intermediate state changes between the + * two times don't affect the result. For example, the results aren't affected + * if the finding is made inactive and then active again. + * + * Possible "state_change" values when compare_duration is specified: + * + * * "CHANGED": indicates that the finding was present at the start of + * compare_duration, but changed its state at read_time. + * * "UNCHANGED": indicates that the finding was present at the start of + * compare_duration and did not change state at read_time. + * * "ADDED": indicates that the finding was not present at the start + * of compare_duration, but was present at read_time. + * + * If compare_duration is not specified, then the only possible state_change + * is "UNUSED", which will be the state_change set for all findings present at + * read_time. + * + * This object should have the same structure as [Duration]{@link google.protobuf.Duration} + * @param {string} [request.having] + * Filter that specifies what fields to further filter on *after* the query + * filter has been executed. Currently only 'finding.state' and 'state_change' + * are supported and requires compare_duration to be specified. + * @param {Object} [request.fieldMask] + * Optional. + * + * A field mask to specify the Finding fields to be listed in the response. + * An empty field mask will list all fields. + * + * This object should have the same structure as [FieldMask]{@link google.protobuf.FieldMask} + * @param {number} [request.pageSize] + * The maximum number of resources contained in the underlying API + * response. If page streaming is performed per-resource, this + * parameter does not affect the return value. If page streaming is + * performed per-page, this determines the maximum number of + * resources in a page. + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. + * @param {function(?Error, ?Array, ?Object, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is Array of [ListFindingsResult]{@link google.cloud.securitycenter.v1.ListFindingsResult}. + * + * When autoPaginate: false is specified through options, it contains the result + * in a single response. If the response indicates the next page exists, the third + * parameter is set to be used for the next request object. The fourth parameter keeps + * the raw response object of an object representing [ListFindingsResponse]{@link google.cloud.securitycenter.v1.ListFindingsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [ListFindingsResult]{@link google.cloud.securitycenter.v1.ListFindingsResult}. + * + * When autoPaginate: false is specified through options, the array has three elements. + * The first element is Array of [ListFindingsResult]{@link google.cloud.securitycenter.v1.ListFindingsResult} in a single response. + * The second element is the next request object if the response + * indicates the next page exists, or null. The third element is + * an object representing [ListFindingsResponse]{@link google.cloud.securitycenter.v1.ListFindingsResponse}. + * + * The promise has a method named "cancel" which cancels the ongoing API call. + * + * @example + * + * const securityCenter = require('@google-cloud/security-center'); + * + * const client = new securityCenter.v1.SecurityCenterClient({ + * // optional auth parameters. + * }); + * + * // Iterate over all elements. + * const formattedParent = client.sourcePath('[ORGANIZATION]', '[SOURCE]'); + * + * client.listFindings({parent: formattedParent}) + * .then(responses => { + * const resources = responses[0]; + * for (const resource of resources) { + * // doThingsWith(resource) + * } + * }) + * .catch(err => { + * console.error(err); + * }); + * + * // Or obtain the paged response. + * const formattedParent = client.sourcePath('[ORGANIZATION]', '[SOURCE]'); + * + * + * const options = {autoPaginate: false}; + * const callback = responses => { + * // The actual resources in a response. + * const resources = responses[0]; + * // The next request if the response shows that there are more responses. + * const nextRequest = responses[1]; + * // The actual response object, if necessary. + * // const rawResponse = responses[2]; + * for (const resource of resources) { + * // doThingsWith(resource); + * } + * if (nextRequest) { + * // Fetch the next page. + * return client.listFindings(nextRequest, options).then(callback); + * } + * } + * client.listFindings({parent: formattedParent}, options) + * .then(callback) + * .catch(err => { + * console.error(err); + * }); + */ + listFindings(request, options, callback) { + if (options instanceof Function && callback === undefined) { + callback = options; + options = {}; + } + options = options || {}; + + return this._innerApiCalls.listFindings(request, options, callback); + } + + /** + * Equivalent to {@link listFindings}, but returns a NodeJS Stream object. + * + * This fetches the paged responses for {@link listFindings} continuously + * and invokes the callback registered for 'data' event for each element in the + * responses. + * + * The returned object has 'end' method when no more elements are required. + * + * autoPaginate option will be ignored. + * + * @see {@link https://nodejs.org/api/stream.html} + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Name of the source the findings belong to. Its format is + * "organizations/[organization_id]/sources/[source_id]". To list across all + * sources provide a source_id of `-`. For example: + * organizations/123/sources/- + * @param {string} [request.filter] + * Expression that defines the filter to apply across findings. + * The expression is a list of one or more restrictions combined via logical + * operators `AND` and `OR`. + * Parentheses are supported, and `OR` has higher precedence than `AND`. + * + * Restrictions have the form ` ` and may have a `-` + * character in front of them to indicate negation. Examples include: + * + * * name + * * source_properties.a_property + * * security_marks.marks.marka + * + * The supported operators are: + * + * * `=` for all value types. + * * `>`, `<`, `>=`, `<=` for integer values. + * * `:`, meaning substring matching, for strings. + * + * The supported value types are: + * + * * string literals in quotes. + * * integer literals without quotes. + * * boolean literals `true` and `false` without quotes. + * + * For example, `source_properties.size = 100` is a valid filter string. + * @param {string} [request.orderBy] + * Expression that defines what fields and order to use for sorting. The + * string value should follow SQL syntax: comma separated list of fields. For + * example: "name,resource_properties.a_property". The default sorting order + * is ascending. To specify descending order for a field, a suffix " desc" + * should be appended to the field name. For example: "name + * desc,source_properties.a_property". Redundant space characters in the + * syntax are insignificant. "name desc,source_properties.a_property" and " + * name desc , source_properties.a_property " are equivalent. + * @param {Object} [request.readTime] + * Time used as a reference point when filtering findings. The filter is + * limited to findings existing at the supplied time and their values are + * those at that specific time. Absence of this field will default to the + * API's version of NOW. + * + * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} + * @param {Object} [request.compareDuration] + * When compare_duration is set, the ListFindingsResult's "state_change" + * attribute is updated to indicate whether the finding had its state changed, + * the finding's state remained unchanged, or if the finding was added in any + * state during the compare_duration period of time that precedes the + * read_time. This is the time between (read_time - compare_duration) and + * read_time. + * + * The state_change value is derived based on the presence and state of the + * finding at the two points in time. Intermediate state changes between the + * two times don't affect the result. For example, the results aren't affected + * if the finding is made inactive and then active again. + * + * Possible "state_change" values when compare_duration is specified: + * + * * "CHANGED": indicates that the finding was present at the start of + * compare_duration, but changed its state at read_time. + * * "UNCHANGED": indicates that the finding was present at the start of + * compare_duration and did not change state at read_time. + * * "ADDED": indicates that the finding was not present at the start + * of compare_duration, but was present at read_time. + * + * If compare_duration is not specified, then the only possible state_change + * is "UNUSED", which will be the state_change set for all findings present at + * read_time. + * + * This object should have the same structure as [Duration]{@link google.protobuf.Duration} + * @param {string} [request.having] + * Filter that specifies what fields to further filter on *after* the query + * filter has been executed. Currently only 'finding.state' and 'state_change' + * are supported and requires compare_duration to be specified. + * @param {Object} [request.fieldMask] + * Optional. + * + * A field mask to specify the Finding fields to be listed in the response. + * An empty field mask will list all fields. + * + * This object should have the same structure as [FieldMask]{@link google.protobuf.FieldMask} + * @param {number} [request.pageSize] + * The maximum number of resources contained in the underlying API + * response. If page streaming is performed per-resource, this + * parameter does not affect the return value. If page streaming is + * performed per-page, this determines the maximum number of + * resources in a page. + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. + * @returns {Stream} + * An object stream which emits an object representing [ListFindingsResult]{@link google.cloud.securitycenter.v1.ListFindingsResult} on 'data' event. + * + * @example + * + * const securityCenter = require('@google-cloud/security-center'); + * + * const client = new securityCenter.v1.SecurityCenterClient({ + * // optional auth parameters. + * }); + * + * const formattedParent = client.sourcePath('[ORGANIZATION]', '[SOURCE]'); + * client.listFindingsStream({parent: formattedParent}) + * .on('data', element => { + * // doThingsWith(element) + * }).on('error', err => { + * console.log(err); + * }); + */ + listFindingsStream(request, options) { + options = options || {}; + + return this._descriptors.page.listFindings.createStream( + this._innerApiCalls.listFindings, + request, + options + ); + } + + /** + * Lists all sources belonging to an organization. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Resource name of the parent of sources to list. Its format should be + * "organizations/[organization_id]". + * @param {number} [request.pageSize] + * The maximum number of resources contained in the underlying API + * response. If page streaming is performed per-resource, this + * parameter does not affect the return value. If page streaming is + * performed per-page, this determines the maximum number of + * resources in a page. + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. + * @param {function(?Error, ?Array, ?Object, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is Array of [Source]{@link google.cloud.securitycenter.v1.Source}. + * + * When autoPaginate: false is specified through options, it contains the result + * in a single response. If the response indicates the next page exists, the third + * parameter is set to be used for the next request object. The fourth parameter keeps + * the raw response object of an object representing [ListSourcesResponse]{@link google.cloud.securitycenter.v1.ListSourcesResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [Source]{@link google.cloud.securitycenter.v1.Source}. + * + * When autoPaginate: false is specified through options, the array has three elements. + * The first element is Array of [Source]{@link google.cloud.securitycenter.v1.Source} in a single response. + * The second element is the next request object if the response + * indicates the next page exists, or null. The third element is + * an object representing [ListSourcesResponse]{@link google.cloud.securitycenter.v1.ListSourcesResponse}. + * + * The promise has a method named "cancel" which cancels the ongoing API call. + * + * @example + * + * const securityCenter = require('@google-cloud/security-center'); + * + * const client = new securityCenter.v1.SecurityCenterClient({ + * // optional auth parameters. + * }); + * + * // Iterate over all elements. + * const formattedParent = client.organizationPath('[ORGANIZATION]'); + * + * client.listSources({parent: formattedParent}) + * .then(responses => { + * const resources = responses[0]; + * for (const resource of resources) { + * // doThingsWith(resource) + * } + * }) + * .catch(err => { + * console.error(err); + * }); + * + * // Or obtain the paged response. + * const formattedParent = client.organizationPath('[ORGANIZATION]'); + * + * + * const options = {autoPaginate: false}; + * const callback = responses => { + * // The actual resources in a response. + * const resources = responses[0]; + * // The next request if the response shows that there are more responses. + * const nextRequest = responses[1]; + * // The actual response object, if necessary. + * // const rawResponse = responses[2]; + * for (const resource of resources) { + * // doThingsWith(resource); + * } + * if (nextRequest) { + * // Fetch the next page. + * return client.listSources(nextRequest, options).then(callback); + * } + * } + * client.listSources({parent: formattedParent}, options) + * .then(callback) + * .catch(err => { + * console.error(err); + * }); + */ + listSources(request, options, callback) { + if (options instanceof Function && callback === undefined) { + callback = options; + options = {}; + } + options = options || {}; + + return this._innerApiCalls.listSources(request, options, callback); + } + + /** + * Equivalent to {@link listSources}, but returns a NodeJS Stream object. + * + * This fetches the paged responses for {@link listSources} continuously + * and invokes the callback registered for 'data' event for each element in the + * responses. + * + * The returned object has 'end' method when no more elements are required. + * + * autoPaginate option will be ignored. + * + * @see {@link https://nodejs.org/api/stream.html} + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Resource name of the parent of sources to list. Its format should be + * "organizations/[organization_id]". + * @param {number} [request.pageSize] + * The maximum number of resources contained in the underlying API + * response. If page streaming is performed per-resource, this + * parameter does not affect the return value. If page streaming is + * performed per-page, this determines the maximum number of + * resources in a page. + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. + * @returns {Stream} + * An object stream which emits an object representing [Source]{@link google.cloud.securitycenter.v1.Source} on 'data' event. + * + * @example + * + * const securityCenter = require('@google-cloud/security-center'); + * + * const client = new securityCenter.v1.SecurityCenterClient({ + * // optional auth parameters. + * }); + * + * const formattedParent = client.organizationPath('[ORGANIZATION]'); + * client.listSourcesStream({parent: formattedParent}) + * .on('data', element => { + * // doThingsWith(element) + * }).on('error', err => { + * console.log(err); + * }); + */ + listSourcesStream(request, options) { + options = options || {}; + + return this._descriptors.page.listSources.createStream( + this._innerApiCalls.listSources, + request, + options + ); + } + + /** + * Runs asset discovery. The discovery is tracked with a long-running + * operation. + * + * This API can only be called with limited frequency for an organization. If + * it is called too frequently the caller will receive a TOO_MANY_REQUESTS + * error. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Name of the organization to run asset discovery for. Its format is + * "organizations/[organization_id]". + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is a [gax.Operation]{@link https://googleapis.github.io/gax-nodejs/Operation} object. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is a [gax.Operation]{@link https://googleapis.github.io/gax-nodejs/Operation} object. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + * @example + * + * const securityCenter = require('@google-cloud/security-center'); + * + * const client = new securityCenter.v1.SecurityCenterClient({ + * // optional auth parameters. + * }); + * + * const formattedParent = client.organizationPath('[ORGANIZATION]'); + * + * // Handle the operation using the promise pattern. + * client.runAssetDiscovery({parent: formattedParent}) + * .then(responses => { + * const [operation, initialApiResponse] = responses; + * + * // Operation#promise starts polling for the completion of the LRO. + * return operation.promise(); + * }) + * .then(responses => { + * const result = responses[0]; + * const metadata = responses[1]; + * const finalApiResponse = responses[2]; + * }) + * .catch(err => { + * console.error(err); + * }); + * + * const formattedParent = client.organizationPath('[ORGANIZATION]'); + * + * // Handle the operation using the event emitter pattern. + * client.runAssetDiscovery({parent: formattedParent}) + * .then(responses => { + * const [operation, initialApiResponse] = responses; + * + * // Adding a listener for the "complete" event starts polling for the + * // completion of the operation. + * operation.on('complete', (result, metadata, finalApiResponse) => { + * // doSomethingWith(result); + * }); + * + * // Adding a listener for the "progress" event causes the callback to be + * // called on any change in metadata when the operation is polled. + * operation.on('progress', (metadata, apiResponse) => { + * // doSomethingWith(metadata) + * }); + * + * // Adding a listener for the "error" event handles any errors found during polling. + * operation.on('error', err => { + * // throw(err); + * }); + * }) + * .catch(err => { + * console.error(err); + * }); + */ + runAssetDiscovery(request, options, callback) { + if (options instanceof Function && callback === undefined) { + callback = options; + options = {}; + } + options = options || {}; + + return this._innerApiCalls.runAssetDiscovery(request, options, callback); + } + + /** + * Updates the state of a finding. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * The relative resource name of the finding. See: + * https://cloud.google.com/apis/design/resource_names#relative_resource_name + * Example: + * "organizations/123/sources/456/finding/789". + * @param {number} request.state + * The desired State of the finding. + * + * The number should be among the values of [State]{@link google.cloud.securitycenter.v1.State} + * @param {Object} request.startTime + * The time at which the updated state takes effect. + * + * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing [Finding]{@link google.cloud.securitycenter.v1.Finding}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Finding]{@link google.cloud.securitycenter.v1.Finding}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + * @example + * + * const securityCenter = require('@google-cloud/security-center'); + * + * const client = new securityCenter.v1.SecurityCenterClient({ + * // optional auth parameters. + * }); + * + * const formattedName = client.findingPath('[ORGANIZATION]', '[SOURCE]', '[FINDING]'); + * const state = 'STATE_UNSPECIFIED'; + * const startTime = {}; + * const request = { + * name: formattedName, + * state: state, + * startTime: startTime, + * }; + * client.setFindingState(request) + * .then(responses => { + * const response = responses[0]; + * // doThingsWith(response) + * }) + * .catch(err => { + * console.error(err); + * }); + */ + setFindingState(request, options, callback) { + if (options instanceof Function && callback === undefined) { + callback = options; + options = {}; + } + options = options || {}; + + return this._innerApiCalls.setFindingState(request, options, callback); + } + + /** + * Sets the access control policy on the specified Source. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy is being specified. + * `resource` is usually specified as a path. For example, a Project + * resource is specified as `projects/{project}`. + * @param {Object} request.policy + * REQUIRED: The complete policy to be applied to the `resource`. The size of + * the policy is limited to a few 10s of KB. An empty policy is a + * valid policy but certain Cloud Platform services (such as Projects) + * might reject them. + * + * This object should have the same structure as [Policy]{@link google.iam.v1.Policy} + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing [Policy]{@link google.iam.v1.Policy}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Policy]{@link google.iam.v1.Policy}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + * @example + * + * const securityCenter = require('@google-cloud/security-center'); + * + * const client = new securityCenter.v1.SecurityCenterClient({ + * // optional auth parameters. + * }); + * + * const formattedResource = client.sourcePath('[ORGANIZATION]', '[SOURCE]'); + * const policy = {}; + * const request = { + * resource: formattedResource, + * policy: policy, + * }; + * client.setIamPolicy(request) + * .then(responses => { + * const response = responses[0]; + * // doThingsWith(response) + * }) + * .catch(err => { + * console.error(err); + * }); + */ + setIamPolicy(request, options, callback) { + if (options instanceof Function && callback === undefined) { + callback = options; + options = {}; + } + options = options || {}; + + return this._innerApiCalls.setIamPolicy(request, options, callback); + } + + /** + * Returns the permissions that a caller has on the specified source. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy detail is being requested. + * `resource` is usually specified as a path. For example, a Project + * resource is specified as `projects/{project}`. + * @param {string[]} request.permissions + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see + * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + * @example + * + * const securityCenter = require('@google-cloud/security-center'); + * + * const client = new securityCenter.v1.SecurityCenterClient({ + * // optional auth parameters. + * }); + * + * const formattedResource = client.sourcePath('[ORGANIZATION]', '[SOURCE]'); + * const permissions = []; + * const request = { + * resource: formattedResource, + * permissions: permissions, + * }; + * client.testIamPermissions(request) + * .then(responses => { + * const response = responses[0]; + * // doThingsWith(response) + * }) + * .catch(err => { + * console.error(err); + * }); + */ + testIamPermissions(request, options, callback) { + if (options instanceof Function && callback === undefined) { + callback = options; + options = {}; + } + options = options || {}; + + return this._innerApiCalls.testIamPermissions(request, options, callback); + } + + /** + * Creates or updates a finding. The corresponding source must exist for a + * finding creation to succeed. + * + * @param {Object} request + * The request object that will be sent. + * @param {Object} request.finding + * The finding resource to update or create if it does not already exist. + * parent, security_marks, and update_time will be ignored. + * + * In the case of creation, the finding id portion of the name must be + * alphanumeric and less than or equal to 32 characters and greater than 0 + * characters in length. + * + * This object should have the same structure as [Finding]{@link google.cloud.securitycenter.v1.Finding} + * @param {Object} [request.updateMask] + * The FieldMask to use when updating the finding resource. This field should + * not be specified when creating a finding. + * + * When updating a finding, an empty mask is treated as updating all mutable + * fields and replacing source_properties. Individual source_properties can + * be added/updated by using "source_properties." in the field + * mask. + * + * This object should have the same structure as [FieldMask]{@link google.protobuf.FieldMask} + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing [Finding]{@link google.cloud.securitycenter.v1.Finding}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Finding]{@link google.cloud.securitycenter.v1.Finding}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + * @example + * + * const securityCenter = require('@google-cloud/security-center'); + * + * const client = new securityCenter.v1.SecurityCenterClient({ + * // optional auth parameters. + * }); + * + * const finding = {}; + * client.updateFinding({finding: finding}) + * .then(responses => { + * const response = responses[0]; + * // doThingsWith(response) + * }) + * .catch(err => { + * console.error(err); + * }); + */ + updateFinding(request, options, callback) { + if (options instanceof Function && callback === undefined) { + callback = options; + options = {}; + } + options = options || {}; + + return this._innerApiCalls.updateFinding(request, options, callback); + } + + /** + * Updates an organization's settings. + * + * @param {Object} request + * The request object that will be sent. + * @param {Object} request.organizationSettings + * The organization settings resource to update. + * + * This object should have the same structure as [OrganizationSettings]{@link google.cloud.securitycenter.v1.OrganizationSettings} + * @param {Object} [request.updateMask] + * The FieldMask to use when updating the settings resource. + * + * If empty all mutable fields will be updated. + * + * This object should have the same structure as [FieldMask]{@link google.protobuf.FieldMask} + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing [OrganizationSettings]{@link google.cloud.securitycenter.v1.OrganizationSettings}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [OrganizationSettings]{@link google.cloud.securitycenter.v1.OrganizationSettings}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + * @example + * + * const securityCenter = require('@google-cloud/security-center'); + * + * const client = new securityCenter.v1.SecurityCenterClient({ + * // optional auth parameters. + * }); + * + * const organizationSettings = {}; + * client.updateOrganizationSettings({organizationSettings: organizationSettings}) + * .then(responses => { + * const response = responses[0]; + * // doThingsWith(response) + * }) + * .catch(err => { + * console.error(err); + * }); + */ + updateOrganizationSettings(request, options, callback) { + if (options instanceof Function && callback === undefined) { + callback = options; + options = {}; + } + options = options || {}; + + return this._innerApiCalls.updateOrganizationSettings( + request, + options, + callback + ); + } + + /** + * Updates a source. + * + * @param {Object} request + * The request object that will be sent. + * @param {Object} request.source + * The source resource to update. + * + * This object should have the same structure as [Source]{@link google.cloud.securitycenter.v1.Source} + * @param {Object} [request.updateMask] + * The FieldMask to use when updating the source resource. + * + * If empty all mutable fields will be updated. + * + * This object should have the same structure as [FieldMask]{@link google.protobuf.FieldMask} + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing [Source]{@link google.cloud.securitycenter.v1.Source}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Source]{@link google.cloud.securitycenter.v1.Source}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + * @example + * + * const securityCenter = require('@google-cloud/security-center'); + * + * const client = new securityCenter.v1.SecurityCenterClient({ + * // optional auth parameters. + * }); + * + * const source = {}; + * client.updateSource({source: source}) + * .then(responses => { + * const response = responses[0]; + * // doThingsWith(response) + * }) + * .catch(err => { + * console.error(err); + * }); + */ + updateSource(request, options, callback) { + if (options instanceof Function && callback === undefined) { + callback = options; + options = {}; + } + options = options || {}; + + return this._innerApiCalls.updateSource(request, options, callback); + } + + /** + * Updates security marks. + * + * @param {Object} request + * The request object that will be sent. + * @param {Object} request.securityMarks + * The security marks resource to update. + * + * This object should have the same structure as [SecurityMarks]{@link google.cloud.securitycenter.v1.SecurityMarks} + * @param {Object} [request.updateMask] + * The FieldMask to use when updating the security marks resource. + * + * The field mask must not contain duplicate fields. + * If empty or set to "marks", all marks will be replaced. Individual + * marks can be updated using "marks.". + * + * This object should have the same structure as [FieldMask]{@link google.protobuf.FieldMask} + * @param {Object} [request.startTime] + * The time at which the updated SecurityMarks take effect. + * If not set uses current server time. Updates will be applied to the + * SecurityMarks that are active immediately preceding this time. + * + * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing [SecurityMarks]{@link google.cloud.securitycenter.v1.SecurityMarks}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [SecurityMarks]{@link google.cloud.securitycenter.v1.SecurityMarks}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + * @example + * + * const securityCenter = require('@google-cloud/security-center'); + * + * const client = new securityCenter.v1.SecurityCenterClient({ + * // optional auth parameters. + * }); + * + * const securityMarks = {}; + * client.updateSecurityMarks({securityMarks: securityMarks}) + * .then(responses => { + * const response = responses[0]; + * // doThingsWith(response) + * }) + * .catch(err => { + * console.error(err); + * }); + */ + updateSecurityMarks(request, options, callback) { + if (options instanceof Function && callback === undefined) { + callback = options; + options = {}; + } + options = options || {}; + + return this._innerApiCalls.updateSecurityMarks(request, options, callback); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified organization resource name string. + * + * @param {String} organization + * @returns {String} + */ + organizationPath(organization) { + return this._pathTemplates.organizationPathTemplate.render({ + organization: organization, + }); + } + + /** + * Return a fully-qualified asset_security_marks resource name string. + * + * @param {String} organization + * @param {String} asset + * @returns {String} + */ + assetSecurityMarksPath(organization, asset) { + return this._pathTemplates.assetSecurityMarksPathTemplate.render({ + organization: organization, + asset: asset, + }); + } + + /** + * Return a fully-qualified finding_security_marks resource name string. + * + * @param {String} organization + * @param {String} source + * @param {String} finding + * @returns {String} + */ + findingSecurityMarksPath(organization, source, finding) { + return this._pathTemplates.findingSecurityMarksPathTemplate.render({ + organization: organization, + source: source, + finding: finding, + }); + } + + /** + * Return a fully-qualified organization_settings resource name string. + * + * @param {String} organization + * @returns {String} + */ + organizationSettingsPath(organization) { + return this._pathTemplates.organizationSettingsPathTemplate.render({ + organization: organization, + }); + } + + /** + * Return a fully-qualified organization_sources resource name string. + * + * @param {String} organization + * @returns {String} + */ + organizationSourcesPath(organization) { + return this._pathTemplates.organizationSourcesPathTemplate.render({ + organization: organization, + }); + } + + /** + * Return a fully-qualified source resource name string. + * + * @param {String} organization + * @param {String} source + * @returns {String} + */ + sourcePath(organization, source) { + return this._pathTemplates.sourcePathTemplate.render({ + organization: organization, + source: source, + }); + } + + /** + * Return a fully-qualified finding resource name string. + * + * @param {String} organization + * @param {String} source + * @param {String} finding + * @returns {String} + */ + findingPath(organization, source, finding) { + return this._pathTemplates.findingPathTemplate.render({ + organization: organization, + source: source, + finding: finding, + }); + } + + /** + * Parse the organizationName from a organization resource. + * + * @param {String} organizationName + * A fully-qualified path representing a organization resources. + * @returns {String} - A string representing the organization. + */ + matchOrganizationFromOrganizationName(organizationName) { + return this._pathTemplates.organizationPathTemplate.match(organizationName) + .organization; + } + + /** + * Parse the assetSecurityMarksName from a asset_security_marks resource. + * + * @param {String} assetSecurityMarksName + * A fully-qualified path representing a asset_security_marks resources. + * @returns {String} - A string representing the organization. + */ + matchOrganizationFromAssetSecurityMarksName(assetSecurityMarksName) { + return this._pathTemplates.assetSecurityMarksPathTemplate.match( + assetSecurityMarksName + ).organization; + } + + /** + * Parse the assetSecurityMarksName from a asset_security_marks resource. + * + * @param {String} assetSecurityMarksName + * A fully-qualified path representing a asset_security_marks resources. + * @returns {String} - A string representing the asset. + */ + matchAssetFromAssetSecurityMarksName(assetSecurityMarksName) { + return this._pathTemplates.assetSecurityMarksPathTemplate.match( + assetSecurityMarksName + ).asset; + } + + /** + * Parse the findingSecurityMarksName from a finding_security_marks resource. + * + * @param {String} findingSecurityMarksName + * A fully-qualified path representing a finding_security_marks resources. + * @returns {String} - A string representing the organization. + */ + matchOrganizationFromFindingSecurityMarksName(findingSecurityMarksName) { + return this._pathTemplates.findingSecurityMarksPathTemplate.match( + findingSecurityMarksName + ).organization; + } + + /** + * Parse the findingSecurityMarksName from a finding_security_marks resource. + * + * @param {String} findingSecurityMarksName + * A fully-qualified path representing a finding_security_marks resources. + * @returns {String} - A string representing the source. + */ + matchSourceFromFindingSecurityMarksName(findingSecurityMarksName) { + return this._pathTemplates.findingSecurityMarksPathTemplate.match( + findingSecurityMarksName + ).source; + } + + /** + * Parse the findingSecurityMarksName from a finding_security_marks resource. + * + * @param {String} findingSecurityMarksName + * A fully-qualified path representing a finding_security_marks resources. + * @returns {String} - A string representing the finding. + */ + matchFindingFromFindingSecurityMarksName(findingSecurityMarksName) { + return this._pathTemplates.findingSecurityMarksPathTemplate.match( + findingSecurityMarksName + ).finding; + } + + /** + * Parse the organizationSettingsName from a organization_settings resource. + * + * @param {String} organizationSettingsName + * A fully-qualified path representing a organization_settings resources. + * @returns {String} - A string representing the organization. + */ + matchOrganizationFromOrganizationSettingsName(organizationSettingsName) { + return this._pathTemplates.organizationSettingsPathTemplate.match( + organizationSettingsName + ).organization; + } + + /** + * Parse the organizationSourcesName from a organization_sources resource. + * + * @param {String} organizationSourcesName + * A fully-qualified path representing a organization_sources resources. + * @returns {String} - A string representing the organization. + */ + matchOrganizationFromOrganizationSourcesName(organizationSourcesName) { + return this._pathTemplates.organizationSourcesPathTemplate.match( + organizationSourcesName + ).organization; + } + + /** + * Parse the sourceName from a source resource. + * + * @param {String} sourceName + * A fully-qualified path representing a source resources. + * @returns {String} - A string representing the organization. + */ + matchOrganizationFromSourceName(sourceName) { + return this._pathTemplates.sourcePathTemplate.match(sourceName) + .organization; + } + + /** + * Parse the sourceName from a source resource. + * + * @param {String} sourceName + * A fully-qualified path representing a source resources. + * @returns {String} - A string representing the source. + */ + matchSourceFromSourceName(sourceName) { + return this._pathTemplates.sourcePathTemplate.match(sourceName).source; + } + + /** + * Parse the findingName from a finding resource. + * + * @param {String} findingName + * A fully-qualified path representing a finding resources. + * @returns {String} - A string representing the organization. + */ + matchOrganizationFromFindingName(findingName) { + return this._pathTemplates.findingPathTemplate.match(findingName) + .organization; + } + + /** + * Parse the findingName from a finding resource. + * + * @param {String} findingName + * A fully-qualified path representing a finding resources. + * @returns {String} - A string representing the source. + */ + matchSourceFromFindingName(findingName) { + return this._pathTemplates.findingPathTemplate.match(findingName).source; + } + + /** + * Parse the findingName from a finding resource. + * + * @param {String} findingName + * A fully-qualified path representing a finding resources. + * @returns {String} - A string representing the finding. + */ + matchFindingFromFindingName(findingName) { + return this._pathTemplates.findingPathTemplate.match(findingName).finding; + } +} + +module.exports = SecurityCenterClient; diff --git a/packages/google-cloud-securitycenter/src/v1/security_center_client_config.json b/packages/google-cloud-securitycenter/src/v1/security_center_client_config.json new file mode 100644 index 00000000000..3ca6c2cd104 --- /dev/null +++ b/packages/google-cloud-securitycenter/src/v1/security_center_client_config.json @@ -0,0 +1,116 @@ +{ + "interfaces": { + "google.cloud.securitycenter.v1.SecurityCenter": { + "retry_codes": { + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ], + "non_idempotent": [] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 20000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 20000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "CreateSource": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateFinding": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetIamPolicy": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "GetOrganizationSettings": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "GetSource": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "GroupAssets": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "GroupFindings": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "ListAssets": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "ListFindings": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "ListSources": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "RunAssetDiscovery": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "SetFindingState": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "SetIamPolicy": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "TestIamPermissions": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "UpdateFinding": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateOrganizationSettings": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateSource": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateSecurityMarks": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-cloud-securitycenter/synth.metadata b/packages/google-cloud-securitycenter/synth.metadata index 2b6dcd9d0ae..63db70090fb 100644 --- a/packages/google-cloud-securitycenter/synth.metadata +++ b/packages/google-cloud-securitycenter/synth.metadata @@ -1,5 +1,5 @@ { - "updateTime": "2019-03-08T00:45:46.676886Z", + "updateTime": "2019-03-11T16:15:47.458225Z", "sources": [ { "generator": { @@ -12,7 +12,37 @@ "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "c986e1d9618ac41343962b353d136201d72626ae" + "sha": "8ecc5ed455d948cd097d62e538e7fe3d2696a8ee", + "internalRef": "237808840" + } + }, + { + "template": { + "name": "node_library", + "origin": "synthtool.gcp", + "version": "2019.2.26" + } + } + ], + "destinations": [ + { + "client": { + "source": "googleapis", + "apiName": "securitycenter", + "apiVersion": "v1beta1", + "language": "nodejs", + "generator": "gapic", + "config": "google/cloud/securitycenter/artman_securitycenter_v1beta1.yaml" + } + }, + { + "client": { + "source": "googleapis", + "apiName": "securitycenter", + "apiVersion": "v1", + "language": "nodejs", + "generator": "gapic", + "config": "google/cloud/securitycenter/artman_securitycenter_v1.yaml" } } ] diff --git a/packages/google-cloud-securitycenter/synth.py b/packages/google-cloud-securitycenter/synth.py index f25c5a7dbb6..cb7dfb86a34 100644 --- a/packages/google-cloud-securitycenter/synth.py +++ b/packages/google-cloud-securitycenter/synth.py @@ -21,7 +21,7 @@ # Run the gapic generator gapic = gcp.GAPICGenerator() -versions = ['v1beta1'] +versions = ['v1beta1', 'v1'] for version in versions: library = gapic.node_library('securitycenter', version) s.copy(library, excludes=['src/index.js', 'README.md', 'package.json']) @@ -31,7 +31,7 @@ templates = common_templates.node_library() s.copy(templates) -s.replace('src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_source.js', +s.replace('src/v1*/doc/google/cloud/securitycenter/v1*/doc_source.js', r"\[\\p\{L\}\\p\{N\}\]\(https:\/\/cloud\.google\.com\{\\p\{L\}\\p\{N\}_- \]\{0\,30\}\[\\p\{L\}\\p\{N\}\]\)\?", r"`\[\p{L}\p{N}]({\p{L}\p{N}_- ]{0,30}[\p{L}\p{N}])?`") diff --git a/packages/google-cloud-securitycenter/test/gapic-v1.js b/packages/google-cloud-securitycenter/test/gapic-v1.js new file mode 100644 index 00000000000..e83ba71cfa6 --- /dev/null +++ b/packages/google-cloud-securitycenter/test/gapic-v1.js @@ -0,0 +1,1288 @@ +// Copyright 2019 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT 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'; + +const assert = require('assert'); + +const securityCenterModule = require('../src'); + +const FAKE_STATUS_CODE = 1; +const error = new Error(); +error.code = FAKE_STATUS_CODE; + +describe('SecurityCenterClient', () => { + describe('createSource', () => { + it('invokes createSource without error', done => { + const client = new securityCenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + + // Mock request + const formattedParent = client.organizationPath('[ORGANIZATION]'); + const source = {}; + const request = { + parent: formattedParent, + source: source, + }; + + // Mock response + const name = 'name3373707'; + const displayName = 'displayName1615086568'; + const description = 'description-1724546052'; + const expectedResponse = { + name: name, + displayName: displayName, + description: description, + }; + + // Mock Grpc layer + client._innerApiCalls.createSource = mockSimpleGrpcMethod( + request, + expectedResponse + ); + + client.createSource(request, (err, response) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes createSource with error', done => { + const client = new securityCenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + + // Mock request + const formattedParent = client.organizationPath('[ORGANIZATION]'); + const source = {}; + const request = { + parent: formattedParent, + source: source, + }; + + // Mock Grpc layer + client._innerApiCalls.createSource = mockSimpleGrpcMethod( + request, + null, + error + ); + + client.createSource(request, (err, response) => { + assert(err instanceof Error); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + + describe('createFinding', () => { + it('invokes createFinding without error', done => { + const client = new securityCenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + + // Mock request + const formattedParent = client.sourcePath('[ORGANIZATION]', '[SOURCE]'); + const findingId = 'findingId728776081'; + const finding = {}; + const request = { + parent: formattedParent, + findingId: findingId, + finding: finding, + }; + + // Mock response + const name = 'name3373707'; + const parent2 = 'parent21175163357'; + const resourceName = 'resourceName979421212'; + const category = 'category50511102'; + const externalUri = 'externalUri-1385596168'; + const expectedResponse = { + name: name, + parent: parent2, + resourceName: resourceName, + category: category, + externalUri: externalUri, + }; + + // Mock Grpc layer + client._innerApiCalls.createFinding = mockSimpleGrpcMethod( + request, + expectedResponse + ); + + client.createFinding(request, (err, response) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes createFinding with error', done => { + const client = new securityCenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + + // Mock request + const formattedParent = client.sourcePath('[ORGANIZATION]', '[SOURCE]'); + const findingId = 'findingId728776081'; + const finding = {}; + const request = { + parent: formattedParent, + findingId: findingId, + finding: finding, + }; + + // Mock Grpc layer + client._innerApiCalls.createFinding = mockSimpleGrpcMethod( + request, + null, + error + ); + + client.createFinding(request, (err, response) => { + assert(err instanceof Error); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + + describe('getIamPolicy', () => { + it('invokes getIamPolicy without error', done => { + const client = new securityCenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + + // Mock request + const formattedResource = client.sourcePath('[ORGANIZATION]', '[SOURCE]'); + const request = { + resource: formattedResource, + }; + + // Mock response + const version = 351608024; + const etag = '21'; + const expectedResponse = { + version: version, + etag: etag, + }; + + // Mock Grpc layer + client._innerApiCalls.getIamPolicy = mockSimpleGrpcMethod( + request, + expectedResponse + ); + + client.getIamPolicy(request, (err, response) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes getIamPolicy with error', done => { + const client = new securityCenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + + // Mock request + const formattedResource = client.sourcePath('[ORGANIZATION]', '[SOURCE]'); + const request = { + resource: formattedResource, + }; + + // Mock Grpc layer + client._innerApiCalls.getIamPolicy = mockSimpleGrpcMethod( + request, + null, + error + ); + + client.getIamPolicy(request, (err, response) => { + assert(err instanceof Error); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + + describe('getOrganizationSettings', () => { + it('invokes getOrganizationSettings without error', done => { + const client = new securityCenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + + // Mock request + const formattedName = client.organizationSettingsPath('[ORGANIZATION]'); + const request = { + name: formattedName, + }; + + // Mock response + const name2 = 'name2-1052831874'; + const enableAssetDiscovery = false; + const expectedResponse = { + name: name2, + enableAssetDiscovery: enableAssetDiscovery, + }; + + // Mock Grpc layer + client._innerApiCalls.getOrganizationSettings = mockSimpleGrpcMethod( + request, + expectedResponse + ); + + client.getOrganizationSettings(request, (err, response) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes getOrganizationSettings with error', done => { + const client = new securityCenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + + // Mock request + const formattedName = client.organizationSettingsPath('[ORGANIZATION]'); + const request = { + name: formattedName, + }; + + // Mock Grpc layer + client._innerApiCalls.getOrganizationSettings = mockSimpleGrpcMethod( + request, + null, + error + ); + + client.getOrganizationSettings(request, (err, response) => { + assert(err instanceof Error); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + + describe('getSource', () => { + it('invokes getSource without error', done => { + const client = new securityCenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + + // Mock request + const formattedName = client.sourcePath('[ORGANIZATION]', '[SOURCE]'); + const request = { + name: formattedName, + }; + + // Mock response + const name2 = 'name2-1052831874'; + const displayName = 'displayName1615086568'; + const description = 'description-1724546052'; + const expectedResponse = { + name: name2, + displayName: displayName, + description: description, + }; + + // Mock Grpc layer + client._innerApiCalls.getSource = mockSimpleGrpcMethod( + request, + expectedResponse + ); + + client.getSource(request, (err, response) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes getSource with error', done => { + const client = new securityCenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + + // Mock request + const formattedName = client.sourcePath('[ORGANIZATION]', '[SOURCE]'); + const request = { + name: formattedName, + }; + + // Mock Grpc layer + client._innerApiCalls.getSource = mockSimpleGrpcMethod( + request, + null, + error + ); + + client.getSource(request, (err, response) => { + assert(err instanceof Error); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + + describe('groupAssets', () => { + it('invokes groupAssets without error', done => { + const client = new securityCenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + + // Mock request + const formattedParent = client.organizationPath('[ORGANIZATION]'); + const groupBy = 'groupBy506361367'; + const request = { + parent: formattedParent, + groupBy: groupBy, + }; + + // Mock response + const nextPageToken = ''; + const totalSize = 705419236; + const groupByResultsElement = {}; + const groupByResults = [groupByResultsElement]; + const expectedResponse = { + nextPageToken: nextPageToken, + totalSize: totalSize, + groupByResults: groupByResults, + }; + + // Mock Grpc layer + client._innerApiCalls.groupAssets = ( + actualRequest, + options, + callback + ) => { + assert.deepStrictEqual(actualRequest, request); + callback(null, expectedResponse.groupByResults); + }; + + client.groupAssets(request, (err, response) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse.groupByResults); + done(); + }); + }); + + it('invokes groupAssets with error', done => { + const client = new securityCenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + + // Mock request + const formattedParent = client.organizationPath('[ORGANIZATION]'); + const groupBy = 'groupBy506361367'; + const request = { + parent: formattedParent, + groupBy: groupBy, + }; + + // Mock Grpc layer + client._innerApiCalls.groupAssets = mockSimpleGrpcMethod( + request, + null, + error + ); + + client.groupAssets(request, (err, response) => { + assert(err instanceof Error); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + + describe('groupFindings', () => { + it('invokes groupFindings without error', done => { + const client = new securityCenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + + // Mock request + const formattedParent = client.sourcePath('[ORGANIZATION]', '[SOURCE]'); + const groupBy = 'groupBy506361367'; + const request = { + parent: formattedParent, + groupBy: groupBy, + }; + + // Mock response + const nextPageToken = ''; + const totalSize = 705419236; + const groupByResultsElement = {}; + const groupByResults = [groupByResultsElement]; + const expectedResponse = { + nextPageToken: nextPageToken, + totalSize: totalSize, + groupByResults: groupByResults, + }; + + // Mock Grpc layer + client._innerApiCalls.groupFindings = ( + actualRequest, + options, + callback + ) => { + assert.deepStrictEqual(actualRequest, request); + callback(null, expectedResponse.groupByResults); + }; + + client.groupFindings(request, (err, response) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse.groupByResults); + done(); + }); + }); + + it('invokes groupFindings with error', done => { + const client = new securityCenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + + // Mock request + const formattedParent = client.sourcePath('[ORGANIZATION]', '[SOURCE]'); + const groupBy = 'groupBy506361367'; + const request = { + parent: formattedParent, + groupBy: groupBy, + }; + + // Mock Grpc layer + client._innerApiCalls.groupFindings = mockSimpleGrpcMethod( + request, + null, + error + ); + + client.groupFindings(request, (err, response) => { + assert(err instanceof Error); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + + describe('listAssets', () => { + it('invokes listAssets without error', done => { + const client = new securityCenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + + // Mock request + const formattedParent = client.organizationPath('[ORGANIZATION]'); + const request = { + parent: formattedParent, + }; + + // Mock response + const nextPageToken = ''; + const totalSize = 705419236; + const listAssetsResultsElement = {}; + const listAssetsResults = [listAssetsResultsElement]; + const expectedResponse = { + nextPageToken: nextPageToken, + totalSize: totalSize, + listAssetsResults: listAssetsResults, + }; + + // Mock Grpc layer + client._innerApiCalls.listAssets = (actualRequest, options, callback) => { + assert.deepStrictEqual(actualRequest, request); + callback(null, expectedResponse.listAssetsResults); + }; + + client.listAssets(request, (err, response) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse.listAssetsResults); + done(); + }); + }); + + it('invokes listAssets with error', done => { + const client = new securityCenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + + // Mock request + const formattedParent = client.organizationPath('[ORGANIZATION]'); + const request = { + parent: formattedParent, + }; + + // Mock Grpc layer + client._innerApiCalls.listAssets = mockSimpleGrpcMethod( + request, + null, + error + ); + + client.listAssets(request, (err, response) => { + assert(err instanceof Error); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + + describe('listFindings', () => { + it('invokes listFindings without error', done => { + const client = new securityCenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + + // Mock request + const formattedParent = client.sourcePath('[ORGANIZATION]', '[SOURCE]'); + const request = { + parent: formattedParent, + }; + + // Mock response + const nextPageToken = ''; + const totalSize = 705419236; + const listFindingsResultsElement = {}; + const listFindingsResults = [listFindingsResultsElement]; + const expectedResponse = { + nextPageToken: nextPageToken, + totalSize: totalSize, + listFindingsResults: listFindingsResults, + }; + + // Mock Grpc layer + client._innerApiCalls.listFindings = ( + actualRequest, + options, + callback + ) => { + assert.deepStrictEqual(actualRequest, request); + callback(null, expectedResponse.listFindingsResults); + }; + + client.listFindings(request, (err, response) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse.listFindingsResults); + done(); + }); + }); + + it('invokes listFindings with error', done => { + const client = new securityCenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + + // Mock request + const formattedParent = client.sourcePath('[ORGANIZATION]', '[SOURCE]'); + const request = { + parent: formattedParent, + }; + + // Mock Grpc layer + client._innerApiCalls.listFindings = mockSimpleGrpcMethod( + request, + null, + error + ); + + client.listFindings(request, (err, response) => { + assert(err instanceof Error); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + + describe('listSources', () => { + it('invokes listSources without error', done => { + const client = new securityCenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + + // Mock request + const formattedParent = client.organizationPath('[ORGANIZATION]'); + const request = { + parent: formattedParent, + }; + + // Mock response + const nextPageToken = ''; + const sourcesElement = {}; + const sources = [sourcesElement]; + const expectedResponse = { + nextPageToken: nextPageToken, + sources: sources, + }; + + // Mock Grpc layer + client._innerApiCalls.listSources = ( + actualRequest, + options, + callback + ) => { + assert.deepStrictEqual(actualRequest, request); + callback(null, expectedResponse.sources); + }; + + client.listSources(request, (err, response) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse.sources); + done(); + }); + }); + + it('invokes listSources with error', done => { + const client = new securityCenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + + // Mock request + const formattedParent = client.organizationPath('[ORGANIZATION]'); + const request = { + parent: formattedParent, + }; + + // Mock Grpc layer + client._innerApiCalls.listSources = mockSimpleGrpcMethod( + request, + null, + error + ); + + client.listSources(request, (err, response) => { + assert(err instanceof Error); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + + describe('runAssetDiscovery', function() { + it('invokes runAssetDiscovery without error', done => { + const client = new securityCenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + + // Mock request + const formattedParent = client.organizationPath('[ORGANIZATION]'); + const request = { + parent: formattedParent, + }; + + // Mock response + const expectedResponse = {}; + + // Mock Grpc layer + client._innerApiCalls.runAssetDiscovery = mockLongRunningGrpcMethod( + request, + expectedResponse + ); + + client + .runAssetDiscovery(request) + .then(responses => { + const operation = responses[0]; + return operation.promise(); + }) + .then(responses => { + assert.deepStrictEqual(responses[0], expectedResponse); + done(); + }) + .catch(err => { + done(err); + }); + }); + + it('invokes runAssetDiscovery with error', done => { + const client = new securityCenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + + // Mock request + const formattedParent = client.organizationPath('[ORGANIZATION]'); + const request = { + parent: formattedParent, + }; + + // Mock Grpc layer + client._innerApiCalls.runAssetDiscovery = mockLongRunningGrpcMethod( + request, + null, + error + ); + + client + .runAssetDiscovery(request) + .then(responses => { + const operation = responses[0]; + return operation.promise(); + }) + .then(() => { + assert.fail(); + }) + .catch(err => { + assert(err instanceof Error); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + done(); + }); + }); + + it('has longrunning decoder functions', () => { + const client = new securityCenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert( + client._descriptors.longrunning.runAssetDiscovery + .responseDecoder instanceof Function + ); + assert( + client._descriptors.longrunning.runAssetDiscovery + .metadataDecoder instanceof Function + ); + }); + }); + + describe('setFindingState', () => { + it('invokes setFindingState without error', done => { + const client = new securityCenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + + // Mock request + const formattedName = client.findingPath( + '[ORGANIZATION]', + '[SOURCE]', + '[FINDING]' + ); + const state = 'STATE_UNSPECIFIED'; + const startTime = {}; + const request = { + name: formattedName, + state: state, + startTime: startTime, + }; + + // Mock response + const name2 = 'name2-1052831874'; + const parent = 'parent-995424086'; + const resourceName = 'resourceName979421212'; + const category = 'category50511102'; + const externalUri = 'externalUri-1385596168'; + const expectedResponse = { + name: name2, + parent: parent, + resourceName: resourceName, + category: category, + externalUri: externalUri, + }; + + // Mock Grpc layer + client._innerApiCalls.setFindingState = mockSimpleGrpcMethod( + request, + expectedResponse + ); + + client.setFindingState(request, (err, response) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes setFindingState with error', done => { + const client = new securityCenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + + // Mock request + const formattedName = client.findingPath( + '[ORGANIZATION]', + '[SOURCE]', + '[FINDING]' + ); + const state = 'STATE_UNSPECIFIED'; + const startTime = {}; + const request = { + name: formattedName, + state: state, + startTime: startTime, + }; + + // Mock Grpc layer + client._innerApiCalls.setFindingState = mockSimpleGrpcMethod( + request, + null, + error + ); + + client.setFindingState(request, (err, response) => { + assert(err instanceof Error); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + + describe('setIamPolicy', () => { + it('invokes setIamPolicy without error', done => { + const client = new securityCenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + + // Mock request + const formattedResource = client.sourcePath('[ORGANIZATION]', '[SOURCE]'); + const policy = {}; + const request = { + resource: formattedResource, + policy: policy, + }; + + // Mock response + const version = 351608024; + const etag = '21'; + const expectedResponse = { + version: version, + etag: etag, + }; + + // Mock Grpc layer + client._innerApiCalls.setIamPolicy = mockSimpleGrpcMethod( + request, + expectedResponse + ); + + client.setIamPolicy(request, (err, response) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes setIamPolicy with error', done => { + const client = new securityCenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + + // Mock request + const formattedResource = client.sourcePath('[ORGANIZATION]', '[SOURCE]'); + const policy = {}; + const request = { + resource: formattedResource, + policy: policy, + }; + + // Mock Grpc layer + client._innerApiCalls.setIamPolicy = mockSimpleGrpcMethod( + request, + null, + error + ); + + client.setIamPolicy(request, (err, response) => { + assert(err instanceof Error); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + + describe('testIamPermissions', () => { + it('invokes testIamPermissions without error', done => { + const client = new securityCenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + + // Mock request + const formattedResource = client.sourcePath('[ORGANIZATION]', '[SOURCE]'); + const permissions = []; + const request = { + resource: formattedResource, + permissions: permissions, + }; + + // Mock response + const expectedResponse = {}; + + // Mock Grpc layer + client._innerApiCalls.testIamPermissions = mockSimpleGrpcMethod( + request, + expectedResponse + ); + + client.testIamPermissions(request, (err, response) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes testIamPermissions with error', done => { + const client = new securityCenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + + // Mock request + const formattedResource = client.sourcePath('[ORGANIZATION]', '[SOURCE]'); + const permissions = []; + const request = { + resource: formattedResource, + permissions: permissions, + }; + + // Mock Grpc layer + client._innerApiCalls.testIamPermissions = mockSimpleGrpcMethod( + request, + null, + error + ); + + client.testIamPermissions(request, (err, response) => { + assert(err instanceof Error); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + + describe('updateFinding', () => { + it('invokes updateFinding without error', done => { + const client = new securityCenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + + // Mock request + const finding = {}; + const request = { + finding: finding, + }; + + // Mock response + const name = 'name3373707'; + const parent = 'parent-995424086'; + const resourceName = 'resourceName979421212'; + const category = 'category50511102'; + const externalUri = 'externalUri-1385596168'; + const expectedResponse = { + name: name, + parent: parent, + resourceName: resourceName, + category: category, + externalUri: externalUri, + }; + + // Mock Grpc layer + client._innerApiCalls.updateFinding = mockSimpleGrpcMethod( + request, + expectedResponse + ); + + client.updateFinding(request, (err, response) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes updateFinding with error', done => { + const client = new securityCenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + + // Mock request + const finding = {}; + const request = { + finding: finding, + }; + + // Mock Grpc layer + client._innerApiCalls.updateFinding = mockSimpleGrpcMethod( + request, + null, + error + ); + + client.updateFinding(request, (err, response) => { + assert(err instanceof Error); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + + describe('updateOrganizationSettings', () => { + it('invokes updateOrganizationSettings without error', done => { + const client = new securityCenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + + // Mock request + const organizationSettings = {}; + const request = { + organizationSettings: organizationSettings, + }; + + // Mock response + const name = 'name3373707'; + const enableAssetDiscovery = false; + const expectedResponse = { + name: name, + enableAssetDiscovery: enableAssetDiscovery, + }; + + // Mock Grpc layer + client._innerApiCalls.updateOrganizationSettings = mockSimpleGrpcMethod( + request, + expectedResponse + ); + + client.updateOrganizationSettings(request, (err, response) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes updateOrganizationSettings with error', done => { + const client = new securityCenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + + // Mock request + const organizationSettings = {}; + const request = { + organizationSettings: organizationSettings, + }; + + // Mock Grpc layer + client._innerApiCalls.updateOrganizationSettings = mockSimpleGrpcMethod( + request, + null, + error + ); + + client.updateOrganizationSettings(request, (err, response) => { + assert(err instanceof Error); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + + describe('updateSource', () => { + it('invokes updateSource without error', done => { + const client = new securityCenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + + // Mock request + const source = {}; + const request = { + source: source, + }; + + // Mock response + const name = 'name3373707'; + const displayName = 'displayName1615086568'; + const description = 'description-1724546052'; + const expectedResponse = { + name: name, + displayName: displayName, + description: description, + }; + + // Mock Grpc layer + client._innerApiCalls.updateSource = mockSimpleGrpcMethod( + request, + expectedResponse + ); + + client.updateSource(request, (err, response) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes updateSource with error', done => { + const client = new securityCenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + + // Mock request + const source = {}; + const request = { + source: source, + }; + + // Mock Grpc layer + client._innerApiCalls.updateSource = mockSimpleGrpcMethod( + request, + null, + error + ); + + client.updateSource(request, (err, response) => { + assert(err instanceof Error); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + + describe('updateSecurityMarks', () => { + it('invokes updateSecurityMarks without error', done => { + const client = new securityCenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + + // Mock request + const securityMarks = {}; + const request = { + securityMarks: securityMarks, + }; + + // Mock response + const name = 'name3373707'; + const expectedResponse = { + name: name, + }; + + // Mock Grpc layer + client._innerApiCalls.updateSecurityMarks = mockSimpleGrpcMethod( + request, + expectedResponse + ); + + client.updateSecurityMarks(request, (err, response) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes updateSecurityMarks with error', done => { + const client = new securityCenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + + // Mock request + const securityMarks = {}; + const request = { + securityMarks: securityMarks, + }; + + // Mock Grpc layer + client._innerApiCalls.updateSecurityMarks = mockSimpleGrpcMethod( + request, + null, + error + ); + + client.updateSecurityMarks(request, (err, response) => { + assert(err instanceof Error); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); +}); + +function mockSimpleGrpcMethod(expectedRequest, response, error) { + return function(actualRequest, options, callback) { + assert.deepStrictEqual(actualRequest, expectedRequest); + if (error) { + callback(error); + } else if (response) { + callback(null, response); + } else { + callback(null); + } + }; +} + +function mockLongRunningGrpcMethod(expectedRequest, response, error) { + return request => { + assert.deepStrictEqual(request, expectedRequest); + const mockOperation = { + promise: function() { + return new Promise((resolve, reject) => { + if (error) { + reject(error); + } else { + resolve([response]); + } + }); + }, + }; + return Promise.resolve([mockOperation]); + }; +} From d9befe1d1dcf1a1224a55d0ca2d9a1b0b6db6821 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot <44816363+yoshi-automation@users.noreply.github.com> Date: Tue, 12 Mar 2019 06:37:07 -0700 Subject: [PATCH 047/342] docs: update examples This PR was generated using Autosynth. :rainbow: Here's the log from Synthtool: ``` synthtool > Executing /tmpfs/src/git/autosynth/working_repo/synth.py. synthtool > Ensuring dependencies. synthtool > Pulling artman image. latest: Pulling from googleapis/artman Digest: sha256:30babbfce7f05a62b1892c63c575aa2c8c502eb4bcc8f3bb90ec83e955d5d319 Status: Image is up to date for googleapis/artman:latest synthtool > Cloning googleapis. synthtool > Running generator for google/cloud/securitycenter/artman_securitycenter_v1beta1.yaml. synthtool > Generated code into /home/kbuilder/.cache/synthtool/googleapis/artman-genfiles/js/securitycenter-v1beta1. synthtool > Running generator for google/cloud/securitycenter/artman_securitycenter_v1.yaml. synthtool > Generated code into /home/kbuilder/.cache/synthtool/googleapis/artman-genfiles/js/securitycenter-v1. .eslintignore .eslintrc.yml .github/ISSUE_TEMPLATE/bug_report.md .github/ISSUE_TEMPLATE/feature_request.md .github/ISSUE_TEMPLATE/support_request.md .jsdoc.js .kokoro/common.cfg .kokoro/continuous/node10/common.cfg .kokoro/continuous/node10/docs.cfg .kokoro/continuous/node10/lint.cfg .kokoro/continuous/node10/samples-test.cfg .kokoro/continuous/node10/system-test-grpcjs.cfg .kokoro/continuous/node10/system-test.cfg .kokoro/continuous/node10/test.cfg .kokoro/continuous/node11/common.cfg .kokoro/continuous/node11/test.cfg .kokoro/continuous/node6/common.cfg .kokoro/continuous/node6/test.cfg .kokoro/continuous/node8/common.cfg .kokoro/continuous/node8/test.cfg .kokoro/docs.sh .kokoro/lint.sh .kokoro/presubmit/node10/common.cfg .kokoro/presubmit/node10/docs.cfg .kokoro/presubmit/node10/lint.cfg .kokoro/presubmit/node10/samples-test.cfg .kokoro/presubmit/node10/system-test-grpcjs.cfg .kokoro/presubmit/node10/system-test.cfg .kokoro/presubmit/node10/test.cfg .kokoro/presubmit/node11/common.cfg .kokoro/presubmit/node11/test.cfg .kokoro/presubmit/node6/common.cfg .kokoro/presubmit/node6/test.cfg .kokoro/presubmit/node8/common.cfg .kokoro/presubmit/node8/test.cfg .kokoro/presubmit/windows/common.cfg .kokoro/presubmit/windows/test.cfg .kokoro/publish.sh .kokoro/release/publish.cfg .kokoro/samples-test.sh .kokoro/system-test.sh .kokoro/test.bat .kokoro/test.sh .kokoro/trampoline.sh .nycrc .prettierignore .prettierrc CODE_OF_CONDUCT.md CONTRIBUTING.md LICENSE codecov.yaml renovate.json synthtool > Replaced '\\[\\\\p\\{L\\}\\\\p\\{N\\}\\]\\(https:\\/\\/cloud\\.google\\.com\\{\\\\p\\{L\\}\\\\p\\{N\\}_- \\]\\{0\\,30\\}\\[\\\\p\\{L\\}\\\\p\\{N\\}\\]\\)\\?' in src/v1/doc/google/cloud/securitycenter/v1/doc_source.js. synthtool > Replaced '\\[\\\\p\\{L\\}\\\\p\\{N\\}\\]\\(https:\\/\\/cloud\\.google\\.com\\{\\\\p\\{L\\}\\\\p\\{N\\}_- \\]\\{0\\,30\\}\\[\\\\p\\{L\\}\\\\p\\{N\\}\\]\\)\\?' in src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_source.js. synthtool > Replaced 'https:\\/\\/cloud\\.google\\.com[\\s\\*]*http:\\/\\/(.*)[\\s\\*]*\\)' in src/v1/doc/google/protobuf/doc_timestamp.js. synthtool > Replaced 'https:\\/\\/cloud\\.google\\.com[\\s\\*]*http:\\/\\/(.*)[\\s\\*]*\\)' in src/v1beta1/doc/google/protobuf/doc_timestamp.js. synthtool > Replaced 'toISOString\\]' in src/v1/doc/google/protobuf/doc_timestamp.js. synthtool > Replaced 'toISOString\\]' in src/v1beta1/doc/google/protobuf/doc_timestamp.js. > grpc@1.19.0 install /tmpfs/src/git/autosynth/working_repo/node_modules/grpc > node-pre-gyp install --fallback-to-build --library=static_library node-pre-gyp WARN Using needle for node-pre-gyp https download [grpc] Success: "/tmpfs/src/git/autosynth/working_repo/node_modules/grpc/src/node/extension_binary/node-v57-linux-x64-glibc/grpc_node.node" is installed via remote > protobufjs@6.8.8 postinstall /tmpfs/src/git/autosynth/working_repo/node_modules/protobufjs > node scripts/postinstall npm notice created a lockfile as package-lock.json. You should commit this file. npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.7 (node_modules/fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.7: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"}) added 1104 packages from 1301 contributors and audited 6739 packages in 29.714s found 1 low severity vulnerability run `npm audit fix` to fix them, or `npm audit` for details > @google-cloud/security-center@0.1.2 fix /tmpfs/src/git/autosynth/working_repo > eslint --fix '**/*.js' synthtool > Cleaned up 2 temporary directories. synthtool > Wrote metadata to synth.metadata. ``` --- .../src/v1/security_center_client.js | 9 ++++++++- .../src/v1beta1/security_center_client.js | 9 ++++++++- packages/google-cloud-securitycenter/synth.metadata | 10 +++++----- 3 files changed, 21 insertions(+), 7 deletions(-) diff --git a/packages/google-cloud-securitycenter/src/v1/security_center_client.js b/packages/google-cloud-securitycenter/src/v1/security_center_client.js index 87a9c59c5f8..274c7c2a703 100644 --- a/packages/google-cloud-securitycenter/src/v1/security_center_client.js +++ b/packages/google-cloud-securitycenter/src/v1/security_center_client.js @@ -14,7 +14,7 @@ 'use strict'; -const gapicConfig = require('./security_center_client_config'); +const gapicConfig = require('./security_center_client_config.json'); const gax = require('google-gax'); const merge = require('lodash.merge'); const path = require('path'); @@ -2082,6 +2082,13 @@ class SecurityCenterClient { * .catch(err => { * console.error(err); * }); + * + * const formattedParent = client.organizationPath('[ORGANIZATION]'); + * + * // Handle the operation using the await pattern. + * const [operation] = await client.runAssetDiscovery({parent: formattedParent}); + * + * const [response] = await operation.promise(); */ runAssetDiscovery(request, options, callback) { if (options instanceof Function && callback === undefined) { diff --git a/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.js b/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.js index 766e29e5f1d..1dbfd231391 100644 --- a/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.js +++ b/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.js @@ -14,7 +14,7 @@ 'use strict'; -const gapicConfig = require('./security_center_client_config'); +const gapicConfig = require('./security_center_client_config.json'); const gax = require('google-gax'); const merge = require('lodash.merge'); const path = require('path'); @@ -1918,6 +1918,13 @@ class SecurityCenterClient { * .catch(err => { * console.error(err); * }); + * + * const formattedParent = client.organizationPath('[ORGANIZATION]'); + * + * // Handle the operation using the await pattern. + * const [operation] = await client.runAssetDiscovery({parent: formattedParent}); + * + * const [response] = await operation.promise(); */ runAssetDiscovery(request, options, callback) { if (options instanceof Function && callback === undefined) { diff --git a/packages/google-cloud-securitycenter/synth.metadata b/packages/google-cloud-securitycenter/synth.metadata index 63db70090fb..887aaff77cf 100644 --- a/packages/google-cloud-securitycenter/synth.metadata +++ b/packages/google-cloud-securitycenter/synth.metadata @@ -1,19 +1,19 @@ { - "updateTime": "2019-03-11T16:15:47.458225Z", + "updateTime": "2019-03-12T11:23:27.551269Z", "sources": [ { "generator": { "name": "artman", - "version": "0.16.15", - "dockerImage": "googleapis/artman@sha256:9caadfa59d48224cba5f3217eb9d61a155b78ccf31e628abef385bc5b7ed3bd2" + "version": "0.16.16", + "dockerImage": "googleapis/artman@sha256:30babbfce7f05a62b1892c63c575aa2c8c502eb4bcc8f3bb90ec83e955d5d319" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "8ecc5ed455d948cd097d62e538e7fe3d2696a8ee", - "internalRef": "237808840" + "sha": "abd1c9a99c5cd7179d8e5e0c8d4c8e761054cc78", + "internalRef": "237945492" } }, { From 1d2b80bbdb2eefe2aee67bc6ecf541d2e76c395a Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Wed, 13 Mar 2019 04:02:37 -0700 Subject: [PATCH 048/342] Release @google-cloud/security-center v0.2.0 (#64) This pull request was generated using releasetool. --- .../google-cloud-securitycenter/CHANGELOG.md | 36 +++++++++++++++++++ .../google-cloud-securitycenter/package.json | 2 +- .../samples/package.json | 2 +- 3 files changed, 38 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-securitycenter/CHANGELOG.md b/packages/google-cloud-securitycenter/CHANGELOG.md index 03045aee7a6..a6bca6593ed 100644 --- a/packages/google-cloud-securitycenter/CHANGELOG.md +++ b/packages/google-cloud-securitycenter/CHANGELOG.md @@ -4,6 +4,42 @@ [1]: https://www.npmjs.com/package/@google-cloud/security-center?activeTab=versions +## v0.2.0 + +03-12-2019 16:11 PDT + +### New Features +- feat: add v1 variant of the API ([#61](https://github.com/googleapis/nodejs-security-center/pull/61)) + +### Bug Fixes +- fix: throw on invalid credentials + +### Dependencies +- fix(deps): update dependency google-gax to ^0.25.0 ([#42](https://github.com/googleapis/nodejs-security-center/pull/42)) + +### Documentation +- docs: update examples +- docs: update comments on protos ([#56](https://github.com/googleapis/nodejs-security-center/pull/56)) +- docs: sync latest proto docs +- docs: update links in contrib guide ([#53](https://github.com/googleapis/nodejs-security-center/pull/53)) +- docs: update contributing path in README ([#48](https://github.com/googleapis/nodejs-security-center/pull/48)) +- docs: move CONTRIBUTING.md to root ([#47](https://github.com/googleapis/nodejs-security-center/pull/47)) +- docs: add lint/fix example to contributing guide ([#45](https://github.com/googleapis/nodejs-security-center/pull/45)) +- docs: fix example comments ([#44](https://github.com/googleapis/nodejs-security-center/pull/44)) + +### Internal / Testing Changes +- build: Add docuploader credentials to node publish jobs ([#59](https://github.com/googleapis/nodejs-security-center/pull/59)) +- build: use node10 to run samples-test, system-test etc ([#58](https://github.com/googleapis/nodejs-security-center/pull/58)) +- build: update release configuration +- chore(deps): update dependency mocha to v6 +- build: use linkinator for docs test ([#52](https://github.com/googleapis/nodejs-security-center/pull/52)) +- build: create docs test npm scripts ([#50](https://github.com/googleapis/nodejs-security-center/pull/50)) +- build: test using @grpc/grpc-js in CI ([#49](https://github.com/googleapis/nodejs-security-center/pull/49)) +- refactor: improve generated code style. ([#43](https://github.com/googleapis/nodejs-security-center/pull/43)) +- chore(deps): update dependency eslint-config-prettier to v4 ([#41](https://github.com/googleapis/nodejs-security-center/pull/41)) +- build: ignore googleapis.com in doc link check ([#39](https://github.com/googleapis/nodejs-security-center/pull/39)) +- chore: sync gapic files + ## v0.1.2 01-16-2019 16:03 PST diff --git a/packages/google-cloud-securitycenter/package.json b/packages/google-cloud-securitycenter/package.json index 2f6227a6872..6900b6f9630 100644 --- a/packages/google-cloud-securitycenter/package.json +++ b/packages/google-cloud-securitycenter/package.json @@ -1,7 +1,7 @@ { "name": "@google-cloud/security-center", "description": "Cloud Security Command Center API client for Node.js", - "version": "0.1.2", + "version": "0.2.0", "license": "Apache-2.0", "author": "Google LLC", "engines": { diff --git a/packages/google-cloud-securitycenter/samples/package.json b/packages/google-cloud-securitycenter/samples/package.json index dc879fc245a..11b82b1ee1a 100644 --- a/packages/google-cloud-securitycenter/samples/package.json +++ b/packages/google-cloud-securitycenter/samples/package.json @@ -10,7 +10,7 @@ }, "license": "Apache-2.0", "dependencies": { - "@google-cloud/security-center": "^0.1.2" + "@google-cloud/security-center": "^0.2.0" }, "devDependencies": { "chai": "^4.2.0", From a189391877326b705fd64f876a951e05cdb8f514 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot <44816363+yoshi-automation@users.noreply.github.com> Date: Wed, 13 Mar 2019 05:07:52 -0700 Subject: [PATCH 049/342] docs: use backticks for JS values This PR was generated using Autosynth. :rainbow: Here's the log from Synthtool: ``` synthtool > Executing /tmpfs/src/git/autosynth/working_repo/synth.py. synthtool > Ensuring dependencies. synthtool > Pulling artman image. latest: Pulling from googleapis/artman Digest: sha256:7231f27272231a884e09edb5953148c85ecd8467780d33c4a35c3e507885715b Status: Image is up to date for googleapis/artman:latest synthtool > Cloning googleapis. synthtool > Running generator for google/cloud/securitycenter/artman_securitycenter_v1beta1.yaml. synthtool > Generated code into /home/kbuilder/.cache/synthtool/googleapis/artman-genfiles/js/securitycenter-v1beta1. synthtool > Running generator for google/cloud/securitycenter/artman_securitycenter_v1.yaml. synthtool > Generated code into /home/kbuilder/.cache/synthtool/googleapis/artman-genfiles/js/securitycenter-v1. .eslintignore .eslintrc.yml .github/ISSUE_TEMPLATE/bug_report.md .github/ISSUE_TEMPLATE/feature_request.md .github/ISSUE_TEMPLATE/support_request.md .jsdoc.js .kokoro/common.cfg .kokoro/continuous/node10/common.cfg .kokoro/continuous/node10/docs.cfg .kokoro/continuous/node10/lint.cfg .kokoro/continuous/node10/samples-test.cfg .kokoro/continuous/node10/system-test-grpcjs.cfg .kokoro/continuous/node10/system-test.cfg .kokoro/continuous/node10/test.cfg .kokoro/continuous/node11/common.cfg .kokoro/continuous/node11/test.cfg .kokoro/continuous/node6/common.cfg .kokoro/continuous/node6/test.cfg .kokoro/continuous/node8/common.cfg .kokoro/continuous/node8/test.cfg .kokoro/docs.sh .kokoro/lint.sh .kokoro/presubmit/node10/common.cfg .kokoro/presubmit/node10/docs.cfg .kokoro/presubmit/node10/lint.cfg .kokoro/presubmit/node10/samples-test.cfg .kokoro/presubmit/node10/system-test-grpcjs.cfg .kokoro/presubmit/node10/system-test.cfg .kokoro/presubmit/node10/test.cfg .kokoro/presubmit/node11/common.cfg .kokoro/presubmit/node11/test.cfg .kokoro/presubmit/node6/common.cfg .kokoro/presubmit/node6/test.cfg .kokoro/presubmit/node8/common.cfg .kokoro/presubmit/node8/test.cfg .kokoro/presubmit/windows/common.cfg .kokoro/presubmit/windows/test.cfg .kokoro/publish.sh .kokoro/release/publish.cfg .kokoro/samples-test.sh .kokoro/system-test.sh .kokoro/test.bat .kokoro/test.sh .kokoro/trampoline.sh .nycrc .prettierignore .prettierrc CODE_OF_CONDUCT.md CONTRIBUTING.md LICENSE codecov.yaml renovate.json synthtool > Replaced '\\[\\\\p\\{L\\}\\\\p\\{N\\}\\]\\(https:\\/\\/cloud\\.google\\.com\\{\\\\p\\{L\\}\\\\p\\{N\\}_- \\]\\{0\\,30\\}\\[\\\\p\\{L\\}\\\\p\\{N\\}\\]\\)\\?' in src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_source.js. synthtool > Replaced '\\[\\\\p\\{L\\}\\\\p\\{N\\}\\]\\(https:\\/\\/cloud\\.google\\.com\\{\\\\p\\{L\\}\\\\p\\{N\\}_- \\]\\{0\\,30\\}\\[\\\\p\\{L\\}\\\\p\\{N\\}\\]\\)\\?' in src/v1/doc/google/cloud/securitycenter/v1/doc_source.js. synthtool > Replaced 'https:\\/\\/cloud\\.google\\.com[\\s\\*]*http:\\/\\/(.*)[\\s\\*]*\\)' in src/v1beta1/doc/google/protobuf/doc_timestamp.js. synthtool > Replaced 'https:\\/\\/cloud\\.google\\.com[\\s\\*]*http:\\/\\/(.*)[\\s\\*]*\\)' in src/v1/doc/google/protobuf/doc_timestamp.js. synthtool > Replaced 'toISOString\\]' in src/v1beta1/doc/google/protobuf/doc_timestamp.js. synthtool > Replaced 'toISOString\\]' in src/v1/doc/google/protobuf/doc_timestamp.js. > grpc@1.19.0 install /tmpfs/src/git/autosynth/working_repo/node_modules/grpc > node-pre-gyp install --fallback-to-build --library=static_library node-pre-gyp WARN Using needle for node-pre-gyp https download [grpc] Success: "/tmpfs/src/git/autosynth/working_repo/node_modules/grpc/src/node/extension_binary/node-v57-linux-x64-glibc/grpc_node.node" is installed via remote > protobufjs@6.8.8 postinstall /tmpfs/src/git/autosynth/working_repo/node_modules/protobufjs > node scripts/postinstall npm notice created a lockfile as package-lock.json. You should commit this file. npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.7 (node_modules/fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.7: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"}) added 1105 packages from 1301 contributors and audited 6739 packages in 23.099s found 1 low severity vulnerability run `npm audit fix` to fix them, or `npm audit` for details > @google-cloud/security-center@0.2.0 fix /tmpfs/src/git/autosynth/working_repo > eslint --fix '**/*.js' synthtool > Cleaned up 2 temporary directories. synthtool > Wrote metadata to synth.metadata. ``` --- .../src/v1/doc/google/longrunning/doc_operations.js | 2 +- .../v1beta1/doc/google/longrunning/doc_operations.js | 2 +- packages/google-cloud-securitycenter/synth.metadata | 10 +++++----- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/packages/google-cloud-securitycenter/src/v1/doc/google/longrunning/doc_operations.js b/packages/google-cloud-securitycenter/src/v1/doc/google/longrunning/doc_operations.js index bd03cc3da0e..4719aebdc91 100644 --- a/packages/google-cloud-securitycenter/src/v1/doc/google/longrunning/doc_operations.js +++ b/packages/google-cloud-securitycenter/src/v1/doc/google/longrunning/doc_operations.js @@ -34,7 +34,7 @@ * * @property {boolean} done * If the value is `false`, it means the operation is still in progress. - * If true, the operation is completed, and either `error` or `response` is + * If `true`, the operation is completed, and either `error` or `response` is * available. * * @property {Object} error diff --git a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/longrunning/doc_operations.js b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/longrunning/doc_operations.js index bd03cc3da0e..4719aebdc91 100644 --- a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/longrunning/doc_operations.js +++ b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/longrunning/doc_operations.js @@ -34,7 +34,7 @@ * * @property {boolean} done * If the value is `false`, it means the operation is still in progress. - * If true, the operation is completed, and either `error` or `response` is + * If `true`, the operation is completed, and either `error` or `response` is * available. * * @property {Object} error diff --git a/packages/google-cloud-securitycenter/synth.metadata b/packages/google-cloud-securitycenter/synth.metadata index 887aaff77cf..fcd9cb9c59e 100644 --- a/packages/google-cloud-securitycenter/synth.metadata +++ b/packages/google-cloud-securitycenter/synth.metadata @@ -1,19 +1,19 @@ { - "updateTime": "2019-03-12T11:23:27.551269Z", + "updateTime": "2019-03-13T11:21:18.503485Z", "sources": [ { "generator": { "name": "artman", - "version": "0.16.16", - "dockerImage": "googleapis/artman@sha256:30babbfce7f05a62b1892c63c575aa2c8c502eb4bcc8f3bb90ec83e955d5d319" + "version": "0.16.17", + "dockerImage": "googleapis/artman@sha256:7231f27272231a884e09edb5953148c85ecd8467780d33c4a35c3e507885715b" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "abd1c9a99c5cd7179d8e5e0c8d4c8e761054cc78", - "internalRef": "237945492" + "sha": "e340f4a01ec287f7bb86e2331b5e98c473d10afd", + "internalRef": "238151361" } }, { From 28c34039a5ab15635a048678f22867f492f72e21 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot <44816363+yoshi-automation@users.noreply.github.com> Date: Thu, 14 Mar 2019 07:54:59 -0700 Subject: [PATCH 050/342] fix: remove the `having` enum value from `GroupFindingsRequest` (#67) BREAKING CHANGE: The `having` enum value has been removed from `GroupFindingsRequest`. This property was never meant to be exposed. --- .../v1/securitycenter_service.proto | 28 +++++----------- .../v1/doc_securitycenter_service.js | 20 ------------ .../src/v1/security_center_client.js | 32 ------------------- .../synth.metadata | 6 ++-- 4 files changed, 11 insertions(+), 75 deletions(-) diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/securitycenter_service.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/securitycenter_service.proto index f49fb8528d0..7a5d2e74450 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/securitycenter_service.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/securitycenter_service.proto @@ -331,11 +331,6 @@ message GroupAssetsRequest { // NOW. google.protobuf.Timestamp read_time = 5; - // Filter that specifies what fields to further filter on *after* the query - // filter has been executed. Currently only 'state_change' is supported and - // requires compare_duration to be specified. - string having = 6; - // The value returned by the last `GroupAssetsResponse`; indicates // that this is a continuation of a prior `GroupAssets` call, and that the // system should return the next page of data. @@ -344,6 +339,8 @@ message GroupAssetsRequest { // The maximum number of results to return in a single response. Default is // 10, minimum is 1, maximum is 1000. int32 page_size = 8; + + reserved 6; } // Response message for grouping by assets. @@ -446,11 +443,6 @@ message GroupFindingsRequest { // `group_by`. google.protobuf.Duration compare_duration = 5; - // Filter that specifies what fields to further filter on *after* the query - // filter has been executed. Currently only 'finding.state' and 'state_change' - // are supported and requires compare_duration to be specified. - string having = 6; - // The value returned by the last `GroupFindingsResponse`; indicates // that this is a continuation of a prior `GroupFindings` call, and // that the system should return the next page of data. @@ -459,6 +451,8 @@ message GroupFindingsRequest { // The maximum number of results to return in a single response. Default is // 10, minimum is 1, maximum is 1000. int32 page_size = 8; + + reserved 6; } // Response message for group by findings. @@ -591,11 +585,6 @@ message ListAssetsRequest { // read_time. google.protobuf.Duration compare_duration = 5; - // Filter that specifies what fields to further filter on *after* the query - // filter has been executed. Currently only 'state_change' is supported and - // requires compare_duration to be specified. - string having = 6; - // Optional. // // A field mask to specify the ListAssetsResult fields to be listed in the @@ -611,6 +600,8 @@ message ListAssetsRequest { // The maximum number of results to return in a single response. Default is // 10, minimum is 1, maximum is 1000. int32 page_size = 9; + + reserved 6; } // Response message for listing assets. @@ -735,11 +726,6 @@ message ListFindingsRequest { // read_time. google.protobuf.Duration compare_duration = 5; - // Filter that specifies what fields to further filter on *after* the query - // filter has been executed. Currently only 'finding.state' and 'state_change' - // are supported and requires compare_duration to be specified. - string having = 6; - // Optional. // // A field mask to specify the Finding fields to be listed in the response. @@ -754,6 +740,8 @@ message ListFindingsRequest { // The maximum number of results to return in a single response. Default is // 10, minimum is 1, maximum is 1000. int32 page_size = 9; + + reserved 6; } // Response message for listing findings. diff --git a/packages/google-cloud-securitycenter/src/v1/doc/google/cloud/securitycenter/v1/doc_securitycenter_service.js b/packages/google-cloud-securitycenter/src/v1/doc/google/cloud/securitycenter/v1/doc_securitycenter_service.js index d33fe5d698e..c351dcf0844 100644 --- a/packages/google-cloud-securitycenter/src/v1/doc/google/cloud/securitycenter/v1/doc_securitycenter_service.js +++ b/packages/google-cloud-securitycenter/src/v1/doc/google/cloud/securitycenter/v1/doc_securitycenter_service.js @@ -183,11 +183,6 @@ const GetSourceRequest = { * * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} * - * @property {string} having - * Filter that specifies what fields to further filter on *after* the query - * filter has been executed. Currently only 'state_change' is supported and - * requires compare_duration to be specified. - * * @property {string} pageToken * The value returned by the last `GroupAssetsResponse`; indicates * that this is a continuation of a prior `GroupAssets` call, and that the @@ -322,11 +317,6 @@ const GroupAssetsResponse = { * * This object should have the same structure as [Duration]{@link google.protobuf.Duration} * - * @property {string} having - * Filter that specifies what fields to further filter on *after* the query - * filter has been executed. Currently only 'finding.state' and 'state_change' - * are supported and requires compare_duration to be specified. - * * @property {string} pageToken * The value returned by the last `GroupFindingsResponse`; indicates * that this is a continuation of a prior `GroupFindings` call, and @@ -517,11 +507,6 @@ const ListSourcesResponse = { * * This object should have the same structure as [Duration]{@link google.protobuf.Duration} * - * @property {string} having - * Filter that specifies what fields to further filter on *after* the query - * filter has been executed. Currently only 'state_change' is supported and - * requires compare_duration to be specified. - * * @property {Object} fieldMask * Optional. * @@ -713,11 +698,6 @@ const ListAssetsResponse = { * * This object should have the same structure as [Duration]{@link google.protobuf.Duration} * - * @property {string} having - * Filter that specifies what fields to further filter on *after* the query - * filter has been executed. Currently only 'finding.state' and 'state_change' - * are supported and requires compare_duration to be specified. - * * @property {Object} fieldMask * Optional. * diff --git a/packages/google-cloud-securitycenter/src/v1/security_center_client.js b/packages/google-cloud-securitycenter/src/v1/security_center_client.js index 274c7c2a703..2ab6e9a5a37 100644 --- a/packages/google-cloud-securitycenter/src/v1/security_center_client.js +++ b/packages/google-cloud-securitycenter/src/v1/security_center_client.js @@ -642,10 +642,6 @@ class SecurityCenterClient { * NOW. * * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} - * @param {string} [request.having] - * Filter that specifies what fields to further filter on *after* the query - * filter has been executed. Currently only 'state_change' is supported and - * requires compare_duration to be specified. * @param {number} [request.pageSize] * The maximum number of resources contained in the underlying API * response. If page streaming is performed per-resource, this @@ -841,10 +837,6 @@ class SecurityCenterClient { * NOW. * * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} - * @param {string} [request.having] - * Filter that specifies what fields to further filter on *after* the query - * filter has been executed. Currently only 'state_change' is supported and - * requires compare_duration to be specified. * @param {number} [request.pageSize] * The maximum number of resources contained in the underlying API * response. If page streaming is performed per-resource, this @@ -976,10 +968,6 @@ class SecurityCenterClient { * `group_by`. * * This object should have the same structure as [Duration]{@link google.protobuf.Duration} - * @param {string} [request.having] - * Filter that specifies what fields to further filter on *after* the query - * filter has been executed. Currently only 'finding.state' and 'state_change' - * are supported and requires compare_duration to be specified. * @param {number} [request.pageSize] * The maximum number of resources contained in the underlying API * response. If page streaming is performed per-resource, this @@ -1171,10 +1159,6 @@ class SecurityCenterClient { * `group_by`. * * This object should have the same structure as [Duration]{@link google.protobuf.Duration} - * @param {string} [request.having] - * Filter that specifies what fields to further filter on *after* the query - * filter has been executed. Currently only 'finding.state' and 'state_change' - * are supported and requires compare_duration to be specified. * @param {number} [request.pageSize] * The maximum number of resources contained in the underlying API * response. If page streaming is performed per-resource, this @@ -1297,10 +1281,6 @@ class SecurityCenterClient { * read_time. * * This object should have the same structure as [Duration]{@link google.protobuf.Duration} - * @param {string} [request.having] - * Filter that specifies what fields to further filter on *after* the query - * filter has been executed. Currently only 'state_change' is supported and - * requires compare_duration to be specified. * @param {Object} [request.fieldMask] * Optional. * @@ -1485,10 +1465,6 @@ class SecurityCenterClient { * read_time. * * This object should have the same structure as [Duration]{@link google.protobuf.Duration} - * @param {string} [request.having] - * Filter that specifies what fields to further filter on *after* the query - * filter has been executed. Currently only 'state_change' is supported and - * requires compare_duration to be specified. * @param {Object} [request.fieldMask] * Optional. * @@ -1617,10 +1593,6 @@ class SecurityCenterClient { * read_time. * * This object should have the same structure as [Duration]{@link google.protobuf.Duration} - * @param {string} [request.having] - * Filter that specifies what fields to further filter on *after* the query - * filter has been executed. Currently only 'finding.state' and 'state_change' - * are supported and requires compare_duration to be specified. * @param {Object} [request.fieldMask] * Optional. * @@ -1804,10 +1776,6 @@ class SecurityCenterClient { * read_time. * * This object should have the same structure as [Duration]{@link google.protobuf.Duration} - * @param {string} [request.having] - * Filter that specifies what fields to further filter on *after* the query - * filter has been executed. Currently only 'finding.state' and 'state_change' - * are supported and requires compare_duration to be specified. * @param {Object} [request.fieldMask] * Optional. * diff --git a/packages/google-cloud-securitycenter/synth.metadata b/packages/google-cloud-securitycenter/synth.metadata index fcd9cb9c59e..08240c71f60 100644 --- a/packages/google-cloud-securitycenter/synth.metadata +++ b/packages/google-cloud-securitycenter/synth.metadata @@ -1,5 +1,5 @@ { - "updateTime": "2019-03-13T11:21:18.503485Z", + "updateTime": "2019-03-14T11:20:21.875346Z", "sources": [ { "generator": { @@ -12,8 +12,8 @@ "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "e340f4a01ec287f7bb86e2331b5e98c473d10afd", - "internalRef": "238151361" + "sha": "d05a746ba27b89374c7407c88c0d5dabfb0afc7c", + "internalRef": "238372434" } }, { From 9712c1e9a34043a04e754b5f7f0abb20a1b2c844 Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Thu, 14 Mar 2019 17:54:52 -0700 Subject: [PATCH 051/342] Release @google-cloud/security-center v0.3.0 (#68) --- packages/google-cloud-securitycenter/CHANGELOG.md | 12 ++++++++++++ packages/google-cloud-securitycenter/package.json | 2 +- .../google-cloud-securitycenter/samples/package.json | 2 +- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-securitycenter/CHANGELOG.md b/packages/google-cloud-securitycenter/CHANGELOG.md index a6bca6593ed..a653c02b50d 100644 --- a/packages/google-cloud-securitycenter/CHANGELOG.md +++ b/packages/google-cloud-securitycenter/CHANGELOG.md @@ -4,6 +4,18 @@ [1]: https://www.npmjs.com/package/@google-cloud/security-center?activeTab=versions +## v0.3.0 + +03-14-2019 07:55 PDT + +**This release has breaking changes!** The `having` enum value from `GroupFindingsRequest` has been removed. This field was not supposed to be exposed. + +### Bug Fixes +- fix: remove the `having` enum value from `GroupFindingsRequest` ([#67](https://github.com/googleapis/nodejs-security-center/pull/67)) + +### Documentation +- docs: use backticks for JS values + ## v0.2.0 03-12-2019 16:11 PDT diff --git a/packages/google-cloud-securitycenter/package.json b/packages/google-cloud-securitycenter/package.json index 6900b6f9630..b9680b00a99 100644 --- a/packages/google-cloud-securitycenter/package.json +++ b/packages/google-cloud-securitycenter/package.json @@ -1,7 +1,7 @@ { "name": "@google-cloud/security-center", "description": "Cloud Security Command Center API client for Node.js", - "version": "0.2.0", + "version": "0.3.0", "license": "Apache-2.0", "author": "Google LLC", "engines": { diff --git a/packages/google-cloud-securitycenter/samples/package.json b/packages/google-cloud-securitycenter/samples/package.json index 11b82b1ee1a..de6e1d51c0e 100644 --- a/packages/google-cloud-securitycenter/samples/package.json +++ b/packages/google-cloud-securitycenter/samples/package.json @@ -10,7 +10,7 @@ }, "license": "Apache-2.0", "dependencies": { - "@google-cloud/security-center": "^0.2.0" + "@google-cloud/security-center": "^0.3.0" }, "devDependencies": { "chai": "^4.2.0", From 2243b1dc0fbded1724b23b6f51adfad6513588ea Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot <44816363+yoshi-automation@users.noreply.github.com> Date: Fri, 22 Mar 2019 10:23:32 -0700 Subject: [PATCH 052/342] refactor: update proto namespaces (#75) --- .../protos/google/cloud/securitycenter/v1/asset.proto | 1 + .../google/cloud/securitycenter/v1/finding.proto | 1 + .../securitycenter/v1/organization_settings.proto | 1 + .../cloud/securitycenter/v1/security_marks.proto | 1 + .../securitycenter/v1/securitycenter_service.proto | 1 + .../protos/google/cloud/securitycenter/v1/source.proto | 1 + packages/google-cloud-securitycenter/synth.metadata | 10 +++++----- 7 files changed, 11 insertions(+), 5 deletions(-) diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/asset.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/asset.proto index 97b5bfb0b94..8e8bcb2979f 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/asset.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/asset.proto @@ -26,6 +26,7 @@ option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1;securitycenter"; option java_multiple_files = true; option java_package = "com.google.cloud.securitycenter.v1"; +option php_namespace = "Google\\Cloud\\SecurityCenter\\V1"; // Cloud Security Command Center's (Cloud SCC) representation of a Google Cloud // Platform (GCP) resource. diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/finding.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/finding.proto index 0c20b85f693..2a8e75b9c34 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/finding.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/finding.proto @@ -26,6 +26,7 @@ option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1;securitycenter"; option java_multiple_files = true; option java_package = "com.google.cloud.securitycenter.v1"; +option php_namespace = "Google\\Cloud\\SecurityCenter\\V1"; // Cloud Security Command Center (Cloud SCC) finding. // diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/organization_settings.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/organization_settings.proto index 92c2f9d5b85..05e24e28ac1 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/organization_settings.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/organization_settings.proto @@ -23,6 +23,7 @@ option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1;securitycenter"; option java_multiple_files = true; option java_package = "com.google.cloud.securitycenter.v1"; +option php_namespace = "Google\\Cloud\\SecurityCenter\\V1"; // User specified settings that are attached to the Cloud Security Command // Center (Cloud SCC) organization. diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/security_marks.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/security_marks.proto index 00328a53d55..4ba82d974f0 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/security_marks.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/security_marks.proto @@ -23,6 +23,7 @@ option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1;securitycenter"; option java_multiple_files = true; option java_package = "com.google.cloud.securitycenter.v1"; +option php_namespace = "Google\\Cloud\\SecurityCenter\\V1"; // User specified security marks that are attached to the parent Cloud Security // Command Center (Cloud SCC) resource. Security marks are scoped within a Cloud diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/securitycenter_service.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/securitycenter_service.proto index 7a5d2e74450..681956f741f 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/securitycenter_service.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/securitycenter_service.proto @@ -36,6 +36,7 @@ option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1;securitycenter"; option java_multiple_files = true; option java_package = "com.google.cloud.securitycenter.v1"; +option php_namespace = "Google\\Cloud\\SecurityCenter\\V1"; // V1 APIs for Security Center service. service SecurityCenter { diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/source.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/source.proto index 7d835ec05a7..07f4c59b205 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/source.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/source.proto @@ -23,6 +23,7 @@ option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1;securitycenter"; option java_multiple_files = true; option java_package = "com.google.cloud.securitycenter.v1"; +option php_namespace = "Google\\Cloud\\SecurityCenter\\V1"; // Cloud Security Command Center's (Cloud SCC) finding source. A finding source // is an entity or a mechanism that can produce a finding. A source is like a diff --git a/packages/google-cloud-securitycenter/synth.metadata b/packages/google-cloud-securitycenter/synth.metadata index 08240c71f60..5f4c1077c29 100644 --- a/packages/google-cloud-securitycenter/synth.metadata +++ b/packages/google-cloud-securitycenter/synth.metadata @@ -1,19 +1,19 @@ { - "updateTime": "2019-03-14T11:20:21.875346Z", + "updateTime": "2019-03-22T11:21:33.788013Z", "sources": [ { "generator": { "name": "artman", - "version": "0.16.17", - "dockerImage": "googleapis/artman@sha256:7231f27272231a884e09edb5953148c85ecd8467780d33c4a35c3e507885715b" + "version": "0.16.18", + "dockerImage": "googleapis/artman@sha256:e8ac9200640e76d54643f370db71a1556bf254f565ce46b45a467bbcbacbdb37" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "d05a746ba27b89374c7407c88c0d5dabfb0afc7c", - "internalRef": "238372434" + "sha": "e2a116ac081210002ec2e634f1f840a453ebd182", + "internalRef": "239695990" } }, { From 280485ef24222730c28e2cd34222b0a258be77a1 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot <44816363+yoshi-automation@users.noreply.github.com> Date: Thu, 28 Mar 2019 15:00:06 -0700 Subject: [PATCH 053/342] fix: include 'x-goog-request-params' header in requests (#77) --- .../src/v1/security_center_client.js | 126 ++++++++++++++++++ .../src/v1beta1/security_center_client.js | 126 ++++++++++++++++++ .../synth.metadata | 10 +- 3 files changed, 257 insertions(+), 5 deletions(-) diff --git a/packages/google-cloud-securitycenter/src/v1/security_center_client.js b/packages/google-cloud-securitycenter/src/v1/security_center_client.js index 2ab6e9a5a37..fc5259fb334 100644 --- a/packages/google-cloud-securitycenter/src/v1/security_center_client.js +++ b/packages/google-cloud-securitycenter/src/v1/security_center_client.js @@ -339,6 +339,13 @@ class SecurityCenterClient { options = {}; } options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent, + }); return this._innerApiCalls.createSource(request, options, callback); } @@ -403,6 +410,13 @@ class SecurityCenterClient { options = {}; } options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent, + }); return this._innerApiCalls.createFinding(request, options, callback); } @@ -451,6 +465,13 @@ class SecurityCenterClient { options = {}; } options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + resource: request.resource, + }); return this._innerApiCalls.getIamPolicy(request, options, callback); } @@ -498,6 +519,13 @@ class SecurityCenterClient { options = {}; } options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + name: request.name, + }); return this._innerApiCalls.getOrganizationSettings( request, @@ -549,6 +577,13 @@ class SecurityCenterClient { options = {}; } options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + name: request.name, + }); return this._innerApiCalls.getSource(request, options, callback); } @@ -735,6 +770,13 @@ class SecurityCenterClient { options = {}; } options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent, + }); return this._innerApiCalls.groupAssets(request, options, callback); } @@ -1061,6 +1103,13 @@ class SecurityCenterClient { options = {}; } options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent, + }); return this._innerApiCalls.groupFindings(request, options, callback); } @@ -1372,6 +1421,13 @@ class SecurityCenterClient { options = {}; } options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent, + }); return this._innerApiCalls.listAssets(request, options, callback); } @@ -1683,6 +1739,13 @@ class SecurityCenterClient { options = {}; } options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent, + }); return this._innerApiCalls.listFindings(request, options, callback); } @@ -1912,6 +1975,13 @@ class SecurityCenterClient { options = {}; } options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent, + }); return this._innerApiCalls.listSources(request, options, callback); } @@ -2064,6 +2134,13 @@ class SecurityCenterClient { options = {}; } options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent, + }); return this._innerApiCalls.runAssetDiscovery(request, options, callback); } @@ -2128,6 +2205,13 @@ class SecurityCenterClient { options = {}; } options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + name: request.name, + }); return this._innerApiCalls.setFindingState(request, options, callback); } @@ -2188,6 +2272,13 @@ class SecurityCenterClient { options = {}; } options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + resource: request.resource, + }); return this._innerApiCalls.setIamPolicy(request, options, callback); } @@ -2246,6 +2337,13 @@ class SecurityCenterClient { options = {}; } options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + resource: request.resource, + }); return this._innerApiCalls.testIamPermissions(request, options, callback); } @@ -2310,6 +2408,13 @@ class SecurityCenterClient { options = {}; } options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'finding.name': request.finding.name, + }); return this._innerApiCalls.updateFinding(request, options, callback); } @@ -2364,6 +2469,13 @@ class SecurityCenterClient { options = {}; } options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'organization_settings.name': request.organizationSettings.name, + }); return this._innerApiCalls.updateOrganizationSettings( request, @@ -2422,6 +2534,13 @@ class SecurityCenterClient { options = {}; } options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'source.name': request.source.name, + }); return this._innerApiCalls.updateSource(request, options, callback); } @@ -2484,6 +2603,13 @@ class SecurityCenterClient { options = {}; } options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'security_marks.name': request.securityMarks.name, + }); return this._innerApiCalls.updateSecurityMarks(request, options, callback); } diff --git a/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.js b/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.js index 1dbfd231391..d581a1f7f4e 100644 --- a/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.js +++ b/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.js @@ -333,6 +333,13 @@ class SecurityCenterClient { options = {}; } options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent, + }); return this._innerApiCalls.createSource(request, options, callback); } @@ -397,6 +404,13 @@ class SecurityCenterClient { options = {}; } options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent, + }); return this._innerApiCalls.createFinding(request, options, callback); } @@ -445,6 +459,13 @@ class SecurityCenterClient { options = {}; } options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + resource: request.resource, + }); return this._innerApiCalls.getIamPolicy(request, options, callback); } @@ -492,6 +513,13 @@ class SecurityCenterClient { options = {}; } options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + name: request.name, + }); return this._innerApiCalls.getOrganizationSettings( request, @@ -543,6 +571,13 @@ class SecurityCenterClient { options = {}; } options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + name: request.name, + }); return this._innerApiCalls.getSource(request, options, callback); } @@ -723,6 +758,13 @@ class SecurityCenterClient { options = {}; } options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent, + }); return this._innerApiCalls.groupAssets(request, options, callback); } @@ -1014,6 +1056,13 @@ class SecurityCenterClient { options = {}; } options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent, + }); return this._innerApiCalls.groupFindings(request, options, callback); } @@ -1295,6 +1344,13 @@ class SecurityCenterClient { options = {}; } options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent, + }); return this._innerApiCalls.listAssets(request, options, callback); } @@ -1578,6 +1634,13 @@ class SecurityCenterClient { options = {}; } options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent, + }); return this._innerApiCalls.listFindings(request, options, callback); } @@ -1780,6 +1843,13 @@ class SecurityCenterClient { options = {}; } options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent, + }); return this._innerApiCalls.listSources(request, options, callback); } @@ -1932,6 +2002,13 @@ class SecurityCenterClient { options = {}; } options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent, + }); return this._innerApiCalls.runAssetDiscovery(request, options, callback); } @@ -1996,6 +2073,13 @@ class SecurityCenterClient { options = {}; } options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + name: request.name, + }); return this._innerApiCalls.setFindingState(request, options, callback); } @@ -2056,6 +2140,13 @@ class SecurityCenterClient { options = {}; } options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + resource: request.resource, + }); return this._innerApiCalls.setIamPolicy(request, options, callback); } @@ -2114,6 +2205,13 @@ class SecurityCenterClient { options = {}; } options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + resource: request.resource, + }); return this._innerApiCalls.testIamPermissions(request, options, callback); } @@ -2173,6 +2271,13 @@ class SecurityCenterClient { options = {}; } options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'finding.name': request.finding.name, + }); return this._innerApiCalls.updateFinding(request, options, callback); } @@ -2225,6 +2330,13 @@ class SecurityCenterClient { options = {}; } options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'organization_settings.name': request.organizationSettings.name, + }); return this._innerApiCalls.updateOrganizationSettings( request, @@ -2281,6 +2393,13 @@ class SecurityCenterClient { options = {}; } options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'source.name': request.source.name, + }); return this._innerApiCalls.updateSource(request, options, callback); } @@ -2337,6 +2456,13 @@ class SecurityCenterClient { options = {}; } options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'security_marks.name': request.securityMarks.name, + }); return this._innerApiCalls.updateSecurityMarks(request, options, callback); } diff --git a/packages/google-cloud-securitycenter/synth.metadata b/packages/google-cloud-securitycenter/synth.metadata index 5f4c1077c29..539311af4d2 100644 --- a/packages/google-cloud-securitycenter/synth.metadata +++ b/packages/google-cloud-securitycenter/synth.metadata @@ -1,19 +1,19 @@ { - "updateTime": "2019-03-22T11:21:33.788013Z", + "updateTime": "2019-03-28T11:41:02.678903Z", "sources": [ { "generator": { "name": "artman", - "version": "0.16.18", - "dockerImage": "googleapis/artman@sha256:e8ac9200640e76d54643f370db71a1556bf254f565ce46b45a467bbcbacbdb37" + "version": "0.16.20", + "dockerImage": "googleapis/artman@sha256:e3c054a2fb85a12481c722af616c7fb6f1d02d862248385eecbec3e4240ebd1e" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "e2a116ac081210002ec2e634f1f840a453ebd182", - "internalRef": "239695990" + "sha": "6a84b3267b0a95e922608b9891219075047eee29", + "internalRef": "240640999" } }, { From 3d47761ddd923f8b781de852f3b2ff5ce3a0103b Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot <44816363+yoshi-automation@users.noreply.github.com> Date: Tue, 2 Apr 2019 08:28:54 -0700 Subject: [PATCH 054/342] docs: improve the jsdoc documentation (#78) docs: improve the jsdoc documentation --- .../v1/securitycenter_service.proto | 71 ++++++++- .../v1/doc_securitycenter_service.js | 71 ++++++++- .../src/v1/security_center_client.js | 142 +++++++++++++++++- .../synth.metadata | 10 +- 4 files changed, 285 insertions(+), 9 deletions(-) diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/securitycenter_service.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/securitycenter_service.proto index 681956f741f..ba0bedde578 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/securitycenter_service.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/securitycenter_service.proto @@ -278,6 +278,18 @@ message GroupAssetsRequest { // * integer literals without quotes. // * boolean literals `true` and `false` without quotes. // + // The following field and operator combinations are supported: + // name | `=` + // update_time | `>`, `<`, `>=`, `<=` + // iam_policy.policy_blob | '=', ':' + // resource_properties | '=', ':', `>`, `<`, `>=`, `<=` + // security_marks | '=', ':' + // security_center_properties.resource_name | '=', ':' + // security_center_properties.resource_type | '=', ':' + // security_center_properties.resource_parent | '=', ':' + // security_center_properties.resource_project | '=', ':' + // security_center_properties.resource_owners | '=', ':' + // // For example, `resource_properties.size = 100` is a valid filter string. string filter = 2; @@ -394,6 +406,17 @@ message GroupFindingsRequest { // * integer literals without quotes. // * boolean literals `true` and `false` without quotes. // + // The following field and operator combinations are supported: + // name | `=` + // parent | '=', ':' + // resource_name | '=', ':' + // state | '=', ':' + // category | '=', ':' + // external_uri | '=', ':' + // event_time | `>`, `<`, `>=`, `<=` + // security_marks | '=', ':' + // source_properties | '=', ':', `>`, `<`, `>=`, `<=` + // // For example, `source_properties.size = 100` is a valid filter string. string filter = 2; @@ -406,8 +429,11 @@ message GroupFindingsRequest { // * resource_name // * category // * state - // * state_change // * parent + // + // The following fields are supported when compare_duration is set: + // + // * state_change string group_by = 3; // Time used as a reference point when filtering findings. The filter is @@ -541,6 +567,18 @@ message ListAssetsRequest { // * integer literals without quotes. // * boolean literals `true` and `false` without quotes. // + // The following are the allowed field and operator combinations: + // name | `=` + // update_time | `>`, `<`, `>=`, `<=` + // iam_policy.policy_blob | '=', ':' + // resource_properties | '=', ':', `>`, `<`, `>=`, `<=` + // security_marks | '=', ':' + // security_center_properties.resource_name | '=', ':' + // security_center_properties.resource_type | '=', ':' + // security_center_properties.resource_parent | '=', ':' + // security_center_properties.resource_project | '=', ':' + // security_center_properties.resource_owners | '=', ':' + // // For example, `resource_properties.size = 100` is a valid filter string. string filter = 2; @@ -552,6 +590,16 @@ message ListAssetsRequest { // desc,resource_properties.a_property". Redundant space characters in the // syntax are insignificant. "name desc,resource_properties.a_property" and " // name desc , resource_properties.a_property " are equivalent. + // + // The following fields are supported: + // name + // update_time + // resource_properties + // security_marks + // security_center_properties.resource_name + // security_center_properties.resource_parent + // security_center_properties.resource_project + // security_center_properties.resource_type string order_by = 3; // Time used as a reference point when filtering assets. The filter is limited @@ -682,6 +730,17 @@ message ListFindingsRequest { // * integer literals without quotes. // * boolean literals `true` and `false` without quotes. // + // The following field and operator combinations are supported: + // name | `=` + // parent | '=', ':' + // resource_name | '=', ':' + // state | '=', ':' + // category | '=', ':' + // external_uri | '=', ':' + // event_time | `>`, `<`, `>=`, `<=` + // security_marks | '=', ':' + // source_properties | '=', ':', `>`, `<`, `>=`, `<=` + // // For example, `source_properties.size = 100` is a valid filter string. string filter = 2; @@ -693,6 +752,16 @@ message ListFindingsRequest { // desc,source_properties.a_property". Redundant space characters in the // syntax are insignificant. "name desc,source_properties.a_property" and " // name desc , source_properties.a_property " are equivalent. + // + // The following fields are supported: + // name + // parent + // state + // category + // resource_name + // event_time + // source_properties + // security_marks string order_by = 3; // Time used as a reference point when filtering findings. The filter is diff --git a/packages/google-cloud-securitycenter/src/v1/doc/google/cloud/securitycenter/v1/doc_securitycenter_service.js b/packages/google-cloud-securitycenter/src/v1/doc/google/cloud/securitycenter/v1/doc_securitycenter_service.js index c351dcf0844..de694b43917 100644 --- a/packages/google-cloud-securitycenter/src/v1/doc/google/cloud/securitycenter/v1/doc_securitycenter_service.js +++ b/packages/google-cloud-securitycenter/src/v1/doc/google/cloud/securitycenter/v1/doc_securitycenter_service.js @@ -126,6 +126,18 @@ const GetSourceRequest = { * * integer literals without quotes. * * boolean literals `true` and `false` without quotes. * + * The following field and operator combinations are supported: + * name | `=` + * update_time | `>`, `<`, `>=`, `<=` + * iam_policy.policy_blob | '=', ':' + * resource_properties | '=', ':', `>`, `<`, `>=`, `<=` + * security_marks | '=', ':' + * security_center_properties.resource_name | '=', ':' + * security_center_properties.resource_type | '=', ':' + * security_center_properties.resource_parent | '=', ':' + * security_center_properties.resource_project | '=', ':' + * security_center_properties.resource_owners | '=', ':' + * * For example, `resource_properties.size = 100` is a valid filter string. * * @property {string} groupBy @@ -264,6 +276,17 @@ const GroupAssetsResponse = { * * integer literals without quotes. * * boolean literals `true` and `false` without quotes. * + * The following field and operator combinations are supported: + * name | `=` + * parent | '=', ':' + * resource_name | '=', ':' + * state | '=', ':' + * category | '=', ':' + * external_uri | '=', ':' + * event_time | `>`, `<`, `>=`, `<=` + * security_marks | '=', ':' + * source_properties | '=', ':', `>`, `<`, `>=`, `<=` + * * For example, `source_properties.size = 100` is a valid filter string. * * @property {string} groupBy @@ -276,9 +299,12 @@ const GroupAssetsResponse = { * * resource_name * * category * * state - * * state_change * * parent * + * The following fields are supported when compare_duration is set: + * + * * state_change + * * @property {Object} readTime * Time used as a reference point when filtering findings. The filter is * limited to findings existing at the supplied time and their values are @@ -459,6 +485,18 @@ const ListSourcesResponse = { * * integer literals without quotes. * * boolean literals `true` and `false` without quotes. * + * The following are the allowed field and operator combinations: + * name | `=` + * update_time | `>`, `<`, `>=`, `<=` + * iam_policy.policy_blob | '=', ':' + * resource_properties | '=', ':', `>`, `<`, `>=`, `<=` + * security_marks | '=', ':' + * security_center_properties.resource_name | '=', ':' + * security_center_properties.resource_type | '=', ':' + * security_center_properties.resource_parent | '=', ':' + * security_center_properties.resource_project | '=', ':' + * security_center_properties.resource_owners | '=', ':' + * * For example, `resource_properties.size = 100` is a valid filter string. * * @property {string} orderBy @@ -471,6 +509,16 @@ const ListSourcesResponse = { * syntax are insignificant. "name desc,resource_properties.a_property" and " * name desc , resource_properties.a_property " are equivalent. * + * The following fields are supported: + * name + * update_time + * resource_properties + * security_marks + * security_center_properties.resource_name + * security_center_properties.resource_parent + * security_center_properties.resource_project + * security_center_properties.resource_type + * * @property {Object} readTime * Time used as a reference point when filtering assets. The filter is limited * to assets existing at the supplied time and their values are those at that @@ -650,6 +698,17 @@ const ListAssetsResponse = { * * integer literals without quotes. * * boolean literals `true` and `false` without quotes. * + * The following field and operator combinations are supported: + * name | `=` + * parent | '=', ':' + * resource_name | '=', ':' + * state | '=', ':' + * category | '=', ':' + * external_uri | '=', ':' + * event_time | `>`, `<`, `>=`, `<=` + * security_marks | '=', ':' + * source_properties | '=', ':', `>`, `<`, `>=`, `<=` + * * For example, `source_properties.size = 100` is a valid filter string. * * @property {string} orderBy @@ -662,6 +721,16 @@ const ListAssetsResponse = { * syntax are insignificant. "name desc,source_properties.a_property" and " * name desc , source_properties.a_property " are equivalent. * + * The following fields are supported: + * name + * parent + * state + * category + * resource_name + * event_time + * source_properties + * security_marks + * * @property {Object} readTime * Time used as a reference point when filtering findings. The filter is * limited to findings existing at the supplied time and their values are diff --git a/packages/google-cloud-securitycenter/src/v1/security_center_client.js b/packages/google-cloud-securitycenter/src/v1/security_center_client.js index fc5259fb334..7e381757e21 100644 --- a/packages/google-cloud-securitycenter/src/v1/security_center_client.js +++ b/packages/google-cloud-securitycenter/src/v1/security_center_client.js @@ -639,6 +639,18 @@ class SecurityCenterClient { * * integer literals without quotes. * * boolean literals `true` and `false` without quotes. * + * The following field and operator combinations are supported: + * name | `=` + * update_time | `>`, `<`, `>=`, `<=` + * iam_policy.policy_blob | '=', ':' + * resource_properties | '=', ':', `>`, `<`, `>=`, `<=` + * security_marks | '=', ':' + * security_center_properties.resource_name | '=', ':' + * security_center_properties.resource_type | '=', ':' + * security_center_properties.resource_parent | '=', ':' + * security_center_properties.resource_project | '=', ':' + * security_center_properties.resource_owners | '=', ':' + * * For example, `resource_properties.size = 100` is a valid filter string. * @param {Object} [request.compareDuration] * When compare_duration is set, the GroupResult's "state_change" property is @@ -841,6 +853,18 @@ class SecurityCenterClient { * * integer literals without quotes. * * boolean literals `true` and `false` without quotes. * + * The following field and operator combinations are supported: + * name | `=` + * update_time | `>`, `<`, `>=`, `<=` + * iam_policy.policy_blob | '=', ':' + * resource_properties | '=', ':', `>`, `<`, `>=`, `<=` + * security_marks | '=', ':' + * security_center_properties.resource_name | '=', ':' + * security_center_properties.resource_type | '=', ':' + * security_center_properties.resource_parent | '=', ':' + * security_center_properties.resource_project | '=', ':' + * security_center_properties.resource_owners | '=', ':' + * * For example, `resource_properties.size = 100` is a valid filter string. * @param {Object} [request.compareDuration] * When compare_duration is set, the GroupResult's "state_change" property is @@ -946,8 +970,11 @@ class SecurityCenterClient { * * resource_name * * category * * state - * * state_change * * parent + * + * The following fields are supported when compare_duration is set: + * + * * state_change * @param {string} [request.filter] * Expression that defines the filter to apply across findings. * The expression is a list of one or more restrictions combined via logical @@ -973,6 +1000,17 @@ class SecurityCenterClient { * * integer literals without quotes. * * boolean literals `true` and `false` without quotes. * + * The following field and operator combinations are supported: + * name | `=` + * parent | '=', ':' + * resource_name | '=', ':' + * state | '=', ':' + * category | '=', ':' + * external_uri | '=', ':' + * event_time | `>`, `<`, `>=`, `<=` + * security_marks | '=', ':' + * source_properties | '=', ':', `>`, `<`, `>=`, `<=` + * * For example, `source_properties.size = 100` is a valid filter string. * @param {Object} [request.readTime] * Time used as a reference point when filtering findings. The filter is @@ -1144,8 +1182,11 @@ class SecurityCenterClient { * * resource_name * * category * * state - * * state_change * * parent + * + * The following fields are supported when compare_duration is set: + * + * * state_change * @param {string} [request.filter] * Expression that defines the filter to apply across findings. * The expression is a list of one or more restrictions combined via logical @@ -1171,6 +1212,17 @@ class SecurityCenterClient { * * integer literals without quotes. * * boolean literals `true` and `false` without quotes. * + * The following field and operator combinations are supported: + * name | `=` + * parent | '=', ':' + * resource_name | '=', ':' + * state | '=', ':' + * category | '=', ':' + * external_uri | '=', ':' + * event_time | `>`, `<`, `>=`, `<=` + * security_marks | '=', ':' + * source_properties | '=', ':', `>`, `<`, `>=`, `<=` + * * For example, `source_properties.size = 100` is a valid filter string. * @param {Object} [request.readTime] * Time used as a reference point when filtering findings. The filter is @@ -1286,6 +1338,18 @@ class SecurityCenterClient { * * integer literals without quotes. * * boolean literals `true` and `false` without quotes. * + * The following are the allowed field and operator combinations: + * name | `=` + * update_time | `>`, `<`, `>=`, `<=` + * iam_policy.policy_blob | '=', ':' + * resource_properties | '=', ':', `>`, `<`, `>=`, `<=` + * security_marks | '=', ':' + * security_center_properties.resource_name | '=', ':' + * security_center_properties.resource_type | '=', ':' + * security_center_properties.resource_parent | '=', ':' + * security_center_properties.resource_project | '=', ':' + * security_center_properties.resource_owners | '=', ':' + * * For example, `resource_properties.size = 100` is a valid filter string. * @param {string} [request.orderBy] * Expression that defines what fields and order to use for sorting. The @@ -1296,6 +1360,16 @@ class SecurityCenterClient { * desc,resource_properties.a_property". Redundant space characters in the * syntax are insignificant. "name desc,resource_properties.a_property" and " * name desc , resource_properties.a_property " are equivalent. + * + * The following fields are supported: + * name + * update_time + * resource_properties + * security_marks + * security_center_properties.resource_name + * security_center_properties.resource_parent + * security_center_properties.resource_project + * security_center_properties.resource_type * @param {Object} [request.readTime] * Time used as a reference point when filtering assets. The filter is limited * to assets existing at the supplied time and their values are those at that @@ -1477,6 +1551,18 @@ class SecurityCenterClient { * * integer literals without quotes. * * boolean literals `true` and `false` without quotes. * + * The following are the allowed field and operator combinations: + * name | `=` + * update_time | `>`, `<`, `>=`, `<=` + * iam_policy.policy_blob | '=', ':' + * resource_properties | '=', ':', `>`, `<`, `>=`, `<=` + * security_marks | '=', ':' + * security_center_properties.resource_name | '=', ':' + * security_center_properties.resource_type | '=', ':' + * security_center_properties.resource_parent | '=', ':' + * security_center_properties.resource_project | '=', ':' + * security_center_properties.resource_owners | '=', ':' + * * For example, `resource_properties.size = 100` is a valid filter string. * @param {string} [request.orderBy] * Expression that defines what fields and order to use for sorting. The @@ -1487,6 +1573,16 @@ class SecurityCenterClient { * desc,resource_properties.a_property". Redundant space characters in the * syntax are insignificant. "name desc,resource_properties.a_property" and " * name desc , resource_properties.a_property " are equivalent. + * + * The following fields are supported: + * name + * update_time + * resource_properties + * security_marks + * security_center_properties.resource_name + * security_center_properties.resource_parent + * security_center_properties.resource_project + * security_center_properties.resource_type * @param {Object} [request.readTime] * Time used as a reference point when filtering assets. The filter is limited * to assets existing at the supplied time and their values are those at that @@ -1605,6 +1701,17 @@ class SecurityCenterClient { * * integer literals without quotes. * * boolean literals `true` and `false` without quotes. * + * The following field and operator combinations are supported: + * name | `=` + * parent | '=', ':' + * resource_name | '=', ':' + * state | '=', ':' + * category | '=', ':' + * external_uri | '=', ':' + * event_time | `>`, `<`, `>=`, `<=` + * security_marks | '=', ':' + * source_properties | '=', ':', `>`, `<`, `>=`, `<=` + * * For example, `source_properties.size = 100` is a valid filter string. * @param {string} [request.orderBy] * Expression that defines what fields and order to use for sorting. The @@ -1615,6 +1722,16 @@ class SecurityCenterClient { * desc,source_properties.a_property". Redundant space characters in the * syntax are insignificant. "name desc,source_properties.a_property" and " * name desc , source_properties.a_property " are equivalent. + * + * The following fields are supported: + * name + * parent + * state + * category + * resource_name + * event_time + * source_properties + * security_marks * @param {Object} [request.readTime] * Time used as a reference point when filtering findings. The filter is * limited to findings existing at the supplied time and their values are @@ -1795,6 +1912,17 @@ class SecurityCenterClient { * * integer literals without quotes. * * boolean literals `true` and `false` without quotes. * + * The following field and operator combinations are supported: + * name | `=` + * parent | '=', ':' + * resource_name | '=', ':' + * state | '=', ':' + * category | '=', ':' + * external_uri | '=', ':' + * event_time | `>`, `<`, `>=`, `<=` + * security_marks | '=', ':' + * source_properties | '=', ':', `>`, `<`, `>=`, `<=` + * * For example, `source_properties.size = 100` is a valid filter string. * @param {string} [request.orderBy] * Expression that defines what fields and order to use for sorting. The @@ -1805,6 +1933,16 @@ class SecurityCenterClient { * desc,source_properties.a_property". Redundant space characters in the * syntax are insignificant. "name desc,source_properties.a_property" and " * name desc , source_properties.a_property " are equivalent. + * + * The following fields are supported: + * name + * parent + * state + * category + * resource_name + * event_time + * source_properties + * security_marks * @param {Object} [request.readTime] * Time used as a reference point when filtering findings. The filter is * limited to findings existing at the supplied time and their values are diff --git a/packages/google-cloud-securitycenter/synth.metadata b/packages/google-cloud-securitycenter/synth.metadata index 539311af4d2..34376332c1c 100644 --- a/packages/google-cloud-securitycenter/synth.metadata +++ b/packages/google-cloud-securitycenter/synth.metadata @@ -1,19 +1,19 @@ { - "updateTime": "2019-03-28T11:41:02.678903Z", + "updateTime": "2019-04-02T11:20:42.204430Z", "sources": [ { "generator": { "name": "artman", - "version": "0.16.20", - "dockerImage": "googleapis/artman@sha256:e3c054a2fb85a12481c722af616c7fb6f1d02d862248385eecbec3e4240ebd1e" + "version": "0.16.22", + "dockerImage": "googleapis/artman@sha256:e7f9554322a8aa1416c122c918fdc4cdec8cfe816f027fc948dec0be7edef320" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "6a84b3267b0a95e922608b9891219075047eee29", - "internalRef": "240640999" + "sha": "6c48ab5aef47dc14e02e2dc718d232a28067129d", + "internalRef": "241437588" } }, { From d9ee88502dff38caca07f16e3f3643e627d0b9e7 Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Thu, 4 Apr 2019 12:34:52 -0700 Subject: [PATCH 055/342] refactor: use execSync for tests refactor: use execSync for tests #80 automerged by dpebot --- packages/google-cloud-securitycenter/samples/package.json | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/google-cloud-securitycenter/samples/package.json b/packages/google-cloud-securitycenter/samples/package.json index de6e1d51c0e..fd6b67bad4a 100644 --- a/packages/google-cloud-securitycenter/samples/package.json +++ b/packages/google-cloud-securitycenter/samples/package.json @@ -14,7 +14,6 @@ }, "devDependencies": { "chai": "^4.2.0", - "execa": "^1.0.0", "mocha": "^6.0.0" } } From 92c0b795f097e16e184e477f4129ebfdcc47015d Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot <44816363+yoshi-automation@users.noreply.github.com> Date: Wed, 10 Apr 2019 09:18:21 -0700 Subject: [PATCH 056/342] chore: update proto metadata (#83) --- .../securitycenter/v1/securitycenter_service.proto | 1 + packages/google-cloud-securitycenter/synth.metadata | 10 +++++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/securitycenter_service.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/securitycenter_service.proto index ba0bedde578..84e210376ca 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/securitycenter_service.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/securitycenter_service.proto @@ -37,6 +37,7 @@ option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/ option java_multiple_files = true; option java_package = "com.google.cloud.securitycenter.v1"; option php_namespace = "Google\\Cloud\\SecurityCenter\\V1"; +option ruby_package = "Google::Cloud::SecurityCenter::V1"; // V1 APIs for Security Center service. service SecurityCenter { diff --git a/packages/google-cloud-securitycenter/synth.metadata b/packages/google-cloud-securitycenter/synth.metadata index 34376332c1c..e211b3a5989 100644 --- a/packages/google-cloud-securitycenter/synth.metadata +++ b/packages/google-cloud-securitycenter/synth.metadata @@ -1,19 +1,19 @@ { - "updateTime": "2019-04-02T11:20:42.204430Z", + "updateTime": "2019-04-10T11:21:52.927716Z", "sources": [ { "generator": { "name": "artman", - "version": "0.16.22", - "dockerImage": "googleapis/artman@sha256:e7f9554322a8aa1416c122c918fdc4cdec8cfe816f027fc948dec0be7edef320" + "version": "0.16.25", + "dockerImage": "googleapis/artman@sha256:d9597f983d1d4e61272c63cb97b7d8f8234da9999526c35d357de3d781f0ec1b" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "6c48ab5aef47dc14e02e2dc718d232a28067129d", - "internalRef": "241437588" + "sha": "3f57de2fbe951640b587d9c2d503daf554747749", + "internalRef": "242707837" } }, { From 19d449b7f124f4210785085e73c82b4e4791a1f6 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot <44816363+yoshi-automation@users.noreply.github.com> Date: Thu, 11 Apr 2019 13:05:47 -0700 Subject: [PATCH 057/342] feat: asset path template & matchers (#84) --- .../src/v1/security_center_client.js | 215 +++++++++++------- .../synth.metadata | 8 +- 2 files changed, 131 insertions(+), 92 deletions(-) diff --git a/packages/google-cloud-securitycenter/src/v1/security_center_client.js b/packages/google-cloud-securitycenter/src/v1/security_center_client.js index 7e381757e21..a3f086b232d 100644 --- a/packages/google-cloud-securitycenter/src/v1/security_center_client.js +++ b/packages/google-cloud-securitycenter/src/v1/security_center_client.js @@ -104,24 +104,27 @@ class SecurityCenterClient { organizationPathTemplate: new gax.PathTemplate( 'organizations/{organization}' ), - assetSecurityMarksPathTemplate: new gax.PathTemplate( - 'organizations/{organization}/assets/{asset}/securityMarks' - ), - findingSecurityMarksPathTemplate: new gax.PathTemplate( - 'organizations/{organization}/sources/{source}/findings/{finding}/securityMarks' - ), organizationSettingsPathTemplate: new gax.PathTemplate( 'organizations/{organization}/organizationSettings' ), - organizationSourcesPathTemplate: new gax.PathTemplate( - 'organizations/{organization}/sources/-' + assetPathTemplate: new gax.PathTemplate( + 'organizations/{organization}/assets/{asset}' + ), + assetSecurityMarksPathTemplate: new gax.PathTemplate( + 'organizations/{organization}/assets/{asset}/securityMarks' ), sourcePathTemplate: new gax.PathTemplate( 'organizations/{organization}/sources/{source}' ), + organizationSourcesPathTemplate: new gax.PathTemplate( + 'organizations/{organization}/sources/-' + ), findingPathTemplate: new gax.PathTemplate( 'organizations/{organization}/sources/{source}/findings/{finding}' ), + findingSecurityMarksPathTemplate: new gax.PathTemplate( + 'organizations/{organization}/sources/{source}/findings/{finding}/securityMarks' + ), }; // Some of the methods on this service return "paged" results, @@ -2769,44 +2772,56 @@ class SecurityCenterClient { } /** - * Return a fully-qualified asset_security_marks resource name string. + * Return a fully-qualified organization_settings resource name string. + * + * @param {String} organization + * @returns {String} + */ + organizationSettingsPath(organization) { + return this._pathTemplates.organizationSettingsPathTemplate.render({ + organization: organization, + }); + } + + /** + * Return a fully-qualified asset resource name string. * * @param {String} organization * @param {String} asset * @returns {String} */ - assetSecurityMarksPath(organization, asset) { - return this._pathTemplates.assetSecurityMarksPathTemplate.render({ + assetPath(organization, asset) { + return this._pathTemplates.assetPathTemplate.render({ organization: organization, asset: asset, }); } /** - * Return a fully-qualified finding_security_marks resource name string. + * Return a fully-qualified asset_security_marks resource name string. * * @param {String} organization - * @param {String} source - * @param {String} finding + * @param {String} asset * @returns {String} */ - findingSecurityMarksPath(organization, source, finding) { - return this._pathTemplates.findingSecurityMarksPathTemplate.render({ + assetSecurityMarksPath(organization, asset) { + return this._pathTemplates.assetSecurityMarksPathTemplate.render({ organization: organization, - source: source, - finding: finding, + asset: asset, }); } /** - * Return a fully-qualified organization_settings resource name string. + * Return a fully-qualified source resource name string. * * @param {String} organization + * @param {String} source * @returns {String} */ - organizationSettingsPath(organization) { - return this._pathTemplates.organizationSettingsPathTemplate.render({ + sourcePath(organization, source) { + return this._pathTemplates.sourcePathTemplate.render({ organization: organization, + source: source, }); } @@ -2823,29 +2838,31 @@ class SecurityCenterClient { } /** - * Return a fully-qualified source resource name string. + * Return a fully-qualified finding resource name string. * * @param {String} organization * @param {String} source + * @param {String} finding * @returns {String} */ - sourcePath(organization, source) { - return this._pathTemplates.sourcePathTemplate.render({ + findingPath(organization, source, finding) { + return this._pathTemplates.findingPathTemplate.render({ organization: organization, source: source, + finding: finding, }); } /** - * Return a fully-qualified finding resource name string. + * Return a fully-qualified finding_security_marks resource name string. * * @param {String} organization * @param {String} source * @param {String} finding * @returns {String} */ - findingPath(organization, source, finding) { - return this._pathTemplates.findingPathTemplate.render({ + findingSecurityMarksPath(organization, source, finding) { + return this._pathTemplates.findingSecurityMarksPathTemplate.render({ organization: organization, source: source, finding: finding, @@ -2865,94 +2882,64 @@ class SecurityCenterClient { } /** - * Parse the assetSecurityMarksName from a asset_security_marks resource. + * Parse the organizationSettingsName from a organization_settings resource. * - * @param {String} assetSecurityMarksName - * A fully-qualified path representing a asset_security_marks resources. + * @param {String} organizationSettingsName + * A fully-qualified path representing a organization_settings resources. * @returns {String} - A string representing the organization. */ - matchOrganizationFromAssetSecurityMarksName(assetSecurityMarksName) { - return this._pathTemplates.assetSecurityMarksPathTemplate.match( - assetSecurityMarksName + matchOrganizationFromOrganizationSettingsName(organizationSettingsName) { + return this._pathTemplates.organizationSettingsPathTemplate.match( + organizationSettingsName ).organization; } /** - * Parse the assetSecurityMarksName from a asset_security_marks resource. + * Parse the assetName from a asset resource. * - * @param {String} assetSecurityMarksName - * A fully-qualified path representing a asset_security_marks resources. - * @returns {String} - A string representing the asset. - */ - matchAssetFromAssetSecurityMarksName(assetSecurityMarksName) { - return this._pathTemplates.assetSecurityMarksPathTemplate.match( - assetSecurityMarksName - ).asset; - } - - /** - * Parse the findingSecurityMarksName from a finding_security_marks resource. - * - * @param {String} findingSecurityMarksName - * A fully-qualified path representing a finding_security_marks resources. + * @param {String} assetName + * A fully-qualified path representing a asset resources. * @returns {String} - A string representing the organization. */ - matchOrganizationFromFindingSecurityMarksName(findingSecurityMarksName) { - return this._pathTemplates.findingSecurityMarksPathTemplate.match( - findingSecurityMarksName - ).organization; - } - - /** - * Parse the findingSecurityMarksName from a finding_security_marks resource. - * - * @param {String} findingSecurityMarksName - * A fully-qualified path representing a finding_security_marks resources. - * @returns {String} - A string representing the source. - */ - matchSourceFromFindingSecurityMarksName(findingSecurityMarksName) { - return this._pathTemplates.findingSecurityMarksPathTemplate.match( - findingSecurityMarksName - ).source; + matchOrganizationFromAssetName(assetName) { + return this._pathTemplates.assetPathTemplate.match(assetName).organization; } /** - * Parse the findingSecurityMarksName from a finding_security_marks resource. + * Parse the assetName from a asset resource. * - * @param {String} findingSecurityMarksName - * A fully-qualified path representing a finding_security_marks resources. - * @returns {String} - A string representing the finding. + * @param {String} assetName + * A fully-qualified path representing a asset resources. + * @returns {String} - A string representing the asset. */ - matchFindingFromFindingSecurityMarksName(findingSecurityMarksName) { - return this._pathTemplates.findingSecurityMarksPathTemplate.match( - findingSecurityMarksName - ).finding; + matchAssetFromAssetName(assetName) { + return this._pathTemplates.assetPathTemplate.match(assetName).asset; } /** - * Parse the organizationSettingsName from a organization_settings resource. + * Parse the assetSecurityMarksName from a asset_security_marks resource. * - * @param {String} organizationSettingsName - * A fully-qualified path representing a organization_settings resources. + * @param {String} assetSecurityMarksName + * A fully-qualified path representing a asset_security_marks resources. * @returns {String} - A string representing the organization. */ - matchOrganizationFromOrganizationSettingsName(organizationSettingsName) { - return this._pathTemplates.organizationSettingsPathTemplate.match( - organizationSettingsName + matchOrganizationFromAssetSecurityMarksName(assetSecurityMarksName) { + return this._pathTemplates.assetSecurityMarksPathTemplate.match( + assetSecurityMarksName ).organization; } /** - * Parse the organizationSourcesName from a organization_sources resource. + * Parse the assetSecurityMarksName from a asset_security_marks resource. * - * @param {String} organizationSourcesName - * A fully-qualified path representing a organization_sources resources. - * @returns {String} - A string representing the organization. + * @param {String} assetSecurityMarksName + * A fully-qualified path representing a asset_security_marks resources. + * @returns {String} - A string representing the asset. */ - matchOrganizationFromOrganizationSourcesName(organizationSourcesName) { - return this._pathTemplates.organizationSourcesPathTemplate.match( - organizationSourcesName - ).organization; + matchAssetFromAssetSecurityMarksName(assetSecurityMarksName) { + return this._pathTemplates.assetSecurityMarksPathTemplate.match( + assetSecurityMarksName + ).asset; } /** @@ -2978,6 +2965,19 @@ class SecurityCenterClient { return this._pathTemplates.sourcePathTemplate.match(sourceName).source; } + /** + * Parse the organizationSourcesName from a organization_sources resource. + * + * @param {String} organizationSourcesName + * A fully-qualified path representing a organization_sources resources. + * @returns {String} - A string representing the organization. + */ + matchOrganizationFromOrganizationSourcesName(organizationSourcesName) { + return this._pathTemplates.organizationSourcesPathTemplate.match( + organizationSourcesName + ).organization; + } + /** * Parse the findingName from a finding resource. * @@ -3011,6 +3011,45 @@ class SecurityCenterClient { matchFindingFromFindingName(findingName) { return this._pathTemplates.findingPathTemplate.match(findingName).finding; } + + /** + * Parse the findingSecurityMarksName from a finding_security_marks resource. + * + * @param {String} findingSecurityMarksName + * A fully-qualified path representing a finding_security_marks resources. + * @returns {String} - A string representing the organization. + */ + matchOrganizationFromFindingSecurityMarksName(findingSecurityMarksName) { + return this._pathTemplates.findingSecurityMarksPathTemplate.match( + findingSecurityMarksName + ).organization; + } + + /** + * Parse the findingSecurityMarksName from a finding_security_marks resource. + * + * @param {String} findingSecurityMarksName + * A fully-qualified path representing a finding_security_marks resources. + * @returns {String} - A string representing the source. + */ + matchSourceFromFindingSecurityMarksName(findingSecurityMarksName) { + return this._pathTemplates.findingSecurityMarksPathTemplate.match( + findingSecurityMarksName + ).source; + } + + /** + * Parse the findingSecurityMarksName from a finding_security_marks resource. + * + * @param {String} findingSecurityMarksName + * A fully-qualified path representing a finding_security_marks resources. + * @returns {String} - A string representing the finding. + */ + matchFindingFromFindingSecurityMarksName(findingSecurityMarksName) { + return this._pathTemplates.findingSecurityMarksPathTemplate.match( + findingSecurityMarksName + ).finding; + } } module.exports = SecurityCenterClient; diff --git a/packages/google-cloud-securitycenter/synth.metadata b/packages/google-cloud-securitycenter/synth.metadata index e211b3a5989..a73c8f0daf0 100644 --- a/packages/google-cloud-securitycenter/synth.metadata +++ b/packages/google-cloud-securitycenter/synth.metadata @@ -1,5 +1,5 @@ { - "updateTime": "2019-04-10T11:21:52.927716Z", + "updateTime": "2019-04-11T11:21:27.131524Z", "sources": [ { "generator": { @@ -12,15 +12,15 @@ "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "3f57de2fbe951640b587d9c2d503daf554747749", - "internalRef": "242707837" + "sha": "fecf169b1b202e7acd8c0bd3b1d1f5e52747fd63", + "internalRef": "242946317" } }, { "template": { "name": "node_library", "origin": "synthtool.gcp", - "version": "2019.2.26" + "version": "2019.4.10" } } ], From 954eb6faeb8e66f55d6a7efaf48c707223b9c06f Mon Sep 17 00:00:00 2001 From: "renovate[bot]" Date: Fri, 26 Apr 2019 12:54:41 -0700 Subject: [PATCH 058/342] chore(deps): update dependency nyc to v14 (#85) --- packages/google-cloud-securitycenter/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-securitycenter/package.json b/packages/google-cloud-securitycenter/package.json index b9680b00a99..22487196584 100644 --- a/packages/google-cloud-securitycenter/package.json +++ b/packages/google-cloud-securitycenter/package.json @@ -55,7 +55,7 @@ "intelli-espower-loader": "^1.0.1", "jsdoc": "^3.5.5", "mocha": "^6.0.0", - "nyc": "^13.0.0", + "nyc": "^14.0.0", "power-assert": "^1.4.4", "prettier": "^1.7.4", "linkinator": "^1.1.2" From 1139ee68df786d9a90138e18a7fd897eba29bb43 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot <44816363+yoshi-automation@users.noreply.github.com> Date: Fri, 26 Apr 2019 14:23:48 -0700 Subject: [PATCH 059/342] chore: update code formatting (#86) --- .../protos/google/cloud/securitycenter/v1/asset.proto | 1 + .../protos/google/cloud/securitycenter/v1/finding.proto | 1 + .../cloud/securitycenter/v1/organization_settings.proto | 1 + .../google/cloud/securitycenter/v1/security_marks.proto | 1 + .../protos/google/cloud/securitycenter/v1/source.proto | 1 + packages/google-cloud-securitycenter/synth.metadata | 6 +++--- 6 files changed, 8 insertions(+), 3 deletions(-) diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/asset.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/asset.proto index 8e8bcb2979f..74ec9b2138a 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/asset.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/asset.proto @@ -27,6 +27,7 @@ option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/ option java_multiple_files = true; option java_package = "com.google.cloud.securitycenter.v1"; option php_namespace = "Google\\Cloud\\SecurityCenter\\V1"; +option ruby_package = "Google::Cloud::SecurityCenter::V1"; // Cloud Security Command Center's (Cloud SCC) representation of a Google Cloud // Platform (GCP) resource. diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/finding.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/finding.proto index 2a8e75b9c34..e75247e88e8 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/finding.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/finding.proto @@ -27,6 +27,7 @@ option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/ option java_multiple_files = true; option java_package = "com.google.cloud.securitycenter.v1"; option php_namespace = "Google\\Cloud\\SecurityCenter\\V1"; +option ruby_package = "Google::Cloud::SecurityCenter::V1"; // Cloud Security Command Center (Cloud SCC) finding. // diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/organization_settings.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/organization_settings.proto index 05e24e28ac1..e975e566cba 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/organization_settings.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/organization_settings.proto @@ -24,6 +24,7 @@ option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/ option java_multiple_files = true; option java_package = "com.google.cloud.securitycenter.v1"; option php_namespace = "Google\\Cloud\\SecurityCenter\\V1"; +option ruby_package = "Google::Cloud::SecurityCenter::V1"; // User specified settings that are attached to the Cloud Security Command // Center (Cloud SCC) organization. diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/security_marks.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/security_marks.proto index 4ba82d974f0..97b3f93775b 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/security_marks.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/security_marks.proto @@ -24,6 +24,7 @@ option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/ option java_multiple_files = true; option java_package = "com.google.cloud.securitycenter.v1"; option php_namespace = "Google\\Cloud\\SecurityCenter\\V1"; +option ruby_package = "Google::Cloud::SecurityCenter::V1"; // User specified security marks that are attached to the parent Cloud Security // Command Center (Cloud SCC) resource. Security marks are scoped within a Cloud diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/source.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/source.proto index 07f4c59b205..26b0d5a64d1 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/source.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/source.proto @@ -24,6 +24,7 @@ option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/ option java_multiple_files = true; option java_package = "com.google.cloud.securitycenter.v1"; option php_namespace = "Google\\Cloud\\SecurityCenter\\V1"; +option ruby_package = "Google::Cloud::SecurityCenter::V1"; // Cloud Security Command Center's (Cloud SCC) finding source. A finding source // is an entity or a mechanism that can produce a finding. A source is like a diff --git a/packages/google-cloud-securitycenter/synth.metadata b/packages/google-cloud-securitycenter/synth.metadata index a73c8f0daf0..0f6e13fb67a 100644 --- a/packages/google-cloud-securitycenter/synth.metadata +++ b/packages/google-cloud-securitycenter/synth.metadata @@ -1,5 +1,5 @@ { - "updateTime": "2019-04-11T11:21:27.131524Z", + "updateTime": "2019-04-18T11:20:31.265935Z", "sources": [ { "generator": { @@ -12,8 +12,8 @@ "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "fecf169b1b202e7acd8c0bd3b1d1f5e52747fd63", - "internalRef": "242946317" + "sha": "d35ca3509160f09d3b0cc5360531751d95f3e292", + "internalRef": "244086609" } }, { From b6788178c52f446427cbfbaf330626779cb89ded Mon Sep 17 00:00:00 2001 From: "Benjamin E. Coe" Date: Mon, 29 Apr 2019 15:05:05 -0700 Subject: [PATCH 060/342] update to .nycrc with --all enabled (#89) --- packages/google-cloud-securitycenter/.nycrc | 40 +++++++++------------ 1 file changed, 17 insertions(+), 23 deletions(-) diff --git a/packages/google-cloud-securitycenter/.nycrc b/packages/google-cloud-securitycenter/.nycrc index 88b001cb587..bfe4073a6ab 100644 --- a/packages/google-cloud-securitycenter/.nycrc +++ b/packages/google-cloud-securitycenter/.nycrc @@ -1,28 +1,22 @@ { "report-dir": "./.coverage", - "reporter": "lcov", + "reporter": ["text", "lcov"], "exclude": [ - "src/*{/*,/**/*}.js", - "src/*/v*/*.js", - "test/**/*.js", - "build/test" + "**/*-test", + "**/.coverage", + "**/apis", + "**/benchmark", + "**/docs", + "**/samples", + "**/scripts", + "**/src/**/v*/**/*.js", + "**/test", + ".jsdoc.js", + "**/.jsdoc.js", + "karma.conf.js", + "webpack-tests.config.js", + "webpack.config.js" ], - "watermarks": { - "branches": [ - 95, - 100 - ], - "functions": [ - 95, - 100 - ], - "lines": [ - 95, - 100 - ], - "statements": [ - 95, - 100 - ] - } + "exclude-after-remap": false, + "all": true } From f2b3a0de256684b2c18fa461e8293b9aa1e6f0cf Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot <44816363+yoshi-automation@users.noreply.github.com> Date: Mon, 29 Apr 2019 18:54:34 -0700 Subject: [PATCH 061/342] refactor: update generated sources (#88) --- .../v1/securitycenter_service.proto | 7 +- .../v1/doc_securitycenter_service.js | 7 +- .../src/v1/doc/google/protobuf/doc_any.js | 3 +- .../v1/doc/google/protobuf/doc_field_mask.js | 44 ++-- .../v1/doc/google/protobuf/doc_timestamp.js | 26 +- .../src/v1/security_center_client.js | 228 +++++++++--------- .../v1beta1/doc/google/protobuf/doc_any.js | 3 +- .../doc/google/protobuf/doc_field_mask.js | 44 ++-- .../doc/google/protobuf/doc_timestamp.js | 26 +- .../src/v1beta1/security_center_client.js | 160 ++++++------ .../synth.metadata | 10 +- 11 files changed, 276 insertions(+), 282 deletions(-) diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/securitycenter_service.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/securitycenter_service.proto index 84e210376ca..d75be44b725 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/securitycenter_service.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/securitycenter_service.proto @@ -280,10 +280,11 @@ message GroupAssetsRequest { // * boolean literals `true` and `false` without quotes. // // The following field and operator combinations are supported: - // name | `=` - // update_time | `>`, `<`, `>=`, `<=` + // name | '=' + // update_time | '>', '<', '>=', '<=', '=' + // create_time | '>', '<', '>=', '<=', '=' // iam_policy.policy_blob | '=', ':' - // resource_properties | '=', ':', `>`, `<`, `>=`, `<=` + // resource_properties | '=', ':', '>', '<', '>=', '<=' // security_marks | '=', ':' // security_center_properties.resource_name | '=', ':' // security_center_properties.resource_type | '=', ':' diff --git a/packages/google-cloud-securitycenter/src/v1/doc/google/cloud/securitycenter/v1/doc_securitycenter_service.js b/packages/google-cloud-securitycenter/src/v1/doc/google/cloud/securitycenter/v1/doc_securitycenter_service.js index de694b43917..057608cf683 100644 --- a/packages/google-cloud-securitycenter/src/v1/doc/google/cloud/securitycenter/v1/doc_securitycenter_service.js +++ b/packages/google-cloud-securitycenter/src/v1/doc/google/cloud/securitycenter/v1/doc_securitycenter_service.js @@ -127,10 +127,11 @@ const GetSourceRequest = { * * boolean literals `true` and `false` without quotes. * * The following field and operator combinations are supported: - * name | `=` - * update_time | `>`, `<`, `>=`, `<=` + * name | '=' + * update_time | '>', '<', '>=', '<=', '=' + * create_time | '>', '<', '>=', '<=', '=' * iam_policy.policy_blob | '=', ':' - * resource_properties | '=', ':', `>`, `<`, `>=`, `<=` + * resource_properties | '=', ':', '>', '<', '>=', '<=' * security_marks | '=', ':' * security_center_properties.resource_name | '=', ':' * security_center_properties.resource_type | '=', ':' diff --git a/packages/google-cloud-securitycenter/src/v1/doc/google/protobuf/doc_any.js b/packages/google-cloud-securitycenter/src/v1/doc/google/protobuf/doc_any.js index f3278b34e66..9ff5d007807 100644 --- a/packages/google-cloud-securitycenter/src/v1/doc/google/protobuf/doc_any.js +++ b/packages/google-cloud-securitycenter/src/v1/doc/google/protobuf/doc_any.js @@ -98,7 +98,8 @@ * * @property {string} typeUrl * A URL/resource name that uniquely identifies the type of the serialized - * protocol buffer message. The last segment of the URL's path must represent + * protocol buffer message. This string must contain at least + * one "/" character. The last segment of the URL's path must represent * the fully qualified name of the type (as in * `path/google.protobuf.Duration`). The name should be in a canonical form * (e.g., leading "." is not accepted). diff --git a/packages/google-cloud-securitycenter/src/v1/doc/google/protobuf/doc_field_mask.js b/packages/google-cloud-securitycenter/src/v1/doc/google/protobuf/doc_field_mask.js index d55d97e6e38..011207b8626 100644 --- a/packages/google-cloud-securitycenter/src/v1/doc/google/protobuf/doc_field_mask.js +++ b/packages/google-cloud-securitycenter/src/v1/doc/google/protobuf/doc_field_mask.js @@ -84,57 +84,49 @@ * describe the updated values, the API ignores the values of all * fields not covered by the mask. * - * If a repeated field is specified for an update operation, the existing - * repeated values in the target resource will be overwritten by the new values. - * Note that a repeated field is only allowed in the last position of a `paths` - * string. + * If a repeated field is specified for an update operation, new values will + * be appended to the existing repeated field in the target resource. Note that + * a repeated field is only allowed in the last position of a `paths` string. * * If a sub-message is specified in the last position of the field mask for an - * update operation, then the existing sub-message in the target resource is - * overwritten. Given the target message: + * update operation, then new value will be merged into the existing sub-message + * in the target resource. + * + * For example, given the target message: * * f { * b { - * d : 1 - * x : 2 + * d: 1 + * x: 2 * } - * c : 1 + * c: [1] * } * * And an update message: * * f { * b { - * d : 10 + * d: 10 * } + * c: [2] * } * * then if the field mask is: * - * paths: "f.b" + * paths: ["f.b", "f.c"] * * then the result will be: * * f { * b { - * d : 10 + * d: 10 + * x: 2 * } - * c : 1 + * c: [1, 2] * } * - * However, if the update mask was: - * - * paths: "f.b.d" - * - * then the result would be: - * - * f { - * b { - * d : 10 - * x : 2 - * } - * c : 1 - * } + * An implementation may provide options to override this default behavior for + * repeated and message fields. * * In order to reset a field's value to the default, the field must * be in the mask and set to the default value in the provided resource. diff --git a/packages/google-cloud-securitycenter/src/v1/doc/google/protobuf/doc_timestamp.js b/packages/google-cloud-securitycenter/src/v1/doc/google/protobuf/doc_timestamp.js index b47f41c2b30..98c19dbf0d3 100644 --- a/packages/google-cloud-securitycenter/src/v1/doc/google/protobuf/doc_timestamp.js +++ b/packages/google-cloud-securitycenter/src/v1/doc/google/protobuf/doc_timestamp.js @@ -16,17 +16,19 @@ // to be loaded as the JS file. /** - * A Timestamp represents a point in time independent of any time zone - * or calendar, represented as seconds and fractions of seconds at - * nanosecond resolution in UTC Epoch time. It is encoded using the - * Proleptic Gregorian Calendar which extends the Gregorian calendar - * backwards to year one. It is encoded assuming all minutes are 60 - * seconds long, i.e. leap seconds are "smeared" so that no leap second - * table is needed for interpretation. Range is from - * 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. - * By restricting to that range, we ensure that we can convert to - * and from RFC 3339 date strings. - * See [https://www.ietf.org/rfc/rfc3339.txt](https://www.ietf.org/rfc/rfc3339.txt). + * A Timestamp represents a point in time independent of any time zone or local + * calendar, encoded as a count of seconds and fractions of seconds at + * nanosecond resolution. The count is relative to an epoch at UTC midnight on + * January 1, 1970, in the proleptic Gregorian calendar which extends the + * Gregorian calendar backwards to year one. + * + * All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + * second table is needed for interpretation, using a [24-hour linear + * smear](https://developers.google.com/time/smear). + * + * The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + * restricting to that range, we ensure that we can convert to and from [RFC + * 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. * * # Examples * @@ -91,7 +93,7 @@ * method. In Python, a standard `datetime.datetime` object can be converted * to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) * with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one - * can use the Joda Time's [`ISODateTimeFormat.dateTime()`](https://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime--) to obtain a formatter capable of generating timestamps in this format. + * can use the Joda Time's [`ISODateTimeFormat.dateTime()`](https://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime%2D%2D) to obtain a formatter capable of generating timestamps in this format. * * @property {number} seconds * Represents seconds of UTC time since Unix epoch diff --git a/packages/google-cloud-securitycenter/src/v1/security_center_client.js b/packages/google-cloud-securitycenter/src/v1/security_center_client.js index a3f086b232d..19ff42ae9c0 100644 --- a/packages/google-cloud-securitycenter/src/v1/security_center_client.js +++ b/packages/google-cloud-securitycenter/src/v1/security_center_client.js @@ -101,30 +101,30 @@ class SecurityCenterClient { // identifiers to uniquely identify resources within the API. // Create useful helper objects for these. this._pathTemplates = { - organizationPathTemplate: new gax.PathTemplate( - 'organizations/{organization}' - ), - organizationSettingsPathTemplate: new gax.PathTemplate( - 'organizations/{organization}/organizationSettings' - ), assetPathTemplate: new gax.PathTemplate( 'organizations/{organization}/assets/{asset}' ), assetSecurityMarksPathTemplate: new gax.PathTemplate( 'organizations/{organization}/assets/{asset}/securityMarks' ), - sourcePathTemplate: new gax.PathTemplate( - 'organizations/{organization}/sources/{source}' - ), - organizationSourcesPathTemplate: new gax.PathTemplate( - 'organizations/{organization}/sources/-' - ), findingPathTemplate: new gax.PathTemplate( 'organizations/{organization}/sources/{source}/findings/{finding}' ), findingSecurityMarksPathTemplate: new gax.PathTemplate( 'organizations/{organization}/sources/{source}/findings/{finding}/securityMarks' ), + organizationPathTemplate: new gax.PathTemplate( + 'organizations/{organization}' + ), + organizationSettingsPathTemplate: new gax.PathTemplate( + 'organizations/{organization}/organizationSettings' + ), + organizationSourcesPathTemplate: new gax.PathTemplate( + 'organizations/{organization}/sources/-' + ), + sourcePathTemplate: new gax.PathTemplate( + 'organizations/{organization}/sources/{source}' + ), }; // Some of the methods on this service return "paged" results, @@ -643,10 +643,11 @@ class SecurityCenterClient { * * boolean literals `true` and `false` without quotes. * * The following field and operator combinations are supported: - * name | `=` - * update_time | `>`, `<`, `>=`, `<=` + * name | '=' + * update_time | '>', '<', '>=', '<=', '=' + * create_time | '>', '<', '>=', '<=', '=' * iam_policy.policy_blob | '=', ':' - * resource_properties | '=', ':', `>`, `<`, `>=`, `<=` + * resource_properties | '=', ':', '>', '<', '>=', '<=' * security_marks | '=', ':' * security_center_properties.resource_name | '=', ':' * security_center_properties.resource_type | '=', ':' @@ -857,10 +858,11 @@ class SecurityCenterClient { * * boolean literals `true` and `false` without quotes. * * The following field and operator combinations are supported: - * name | `=` - * update_time | `>`, `<`, `>=`, `<=` + * name | '=' + * update_time | '>', '<', '>=', '<=', '=' + * create_time | '>', '<', '>=', '<=', '=' * iam_policy.policy_blob | '=', ':' - * resource_properties | '=', ':', `>`, `<`, `>=`, `<=` + * resource_properties | '=', ':', '>', '<', '>=', '<=' * security_marks | '=', ':' * security_center_properties.resource_name | '=', ':' * security_center_properties.resource_type | '=', ':' @@ -2759,30 +2761,6 @@ class SecurityCenterClient { // -- Path templates -- // -------------------- - /** - * Return a fully-qualified organization resource name string. - * - * @param {String} organization - * @returns {String} - */ - organizationPath(organization) { - return this._pathTemplates.organizationPathTemplate.render({ - organization: organization, - }); - } - - /** - * Return a fully-qualified organization_settings resource name string. - * - * @param {String} organization - * @returns {String} - */ - organizationSettingsPath(organization) { - return this._pathTemplates.organizationSettingsPathTemplate.render({ - organization: organization, - }); - } - /** * Return a fully-qualified asset resource name string. * @@ -2812,86 +2790,85 @@ class SecurityCenterClient { } /** - * Return a fully-qualified source resource name string. + * Return a fully-qualified finding resource name string. * * @param {String} organization * @param {String} source + * @param {String} finding * @returns {String} */ - sourcePath(organization, source) { - return this._pathTemplates.sourcePathTemplate.render({ + findingPath(organization, source, finding) { + return this._pathTemplates.findingPathTemplate.render({ organization: organization, source: source, + finding: finding, }); } /** - * Return a fully-qualified organization_sources resource name string. + * Return a fully-qualified finding_security_marks resource name string. * * @param {String} organization + * @param {String} source + * @param {String} finding * @returns {String} */ - organizationSourcesPath(organization) { - return this._pathTemplates.organizationSourcesPathTemplate.render({ + findingSecurityMarksPath(organization, source, finding) { + return this._pathTemplates.findingSecurityMarksPathTemplate.render({ organization: organization, + source: source, + finding: finding, }); } /** - * Return a fully-qualified finding resource name string. + * Return a fully-qualified organization resource name string. * * @param {String} organization - * @param {String} source - * @param {String} finding * @returns {String} */ - findingPath(organization, source, finding) { - return this._pathTemplates.findingPathTemplate.render({ + organizationPath(organization) { + return this._pathTemplates.organizationPathTemplate.render({ organization: organization, - source: source, - finding: finding, }); } /** - * Return a fully-qualified finding_security_marks resource name string. + * Return a fully-qualified organization_settings resource name string. * * @param {String} organization - * @param {String} source - * @param {String} finding * @returns {String} */ - findingSecurityMarksPath(organization, source, finding) { - return this._pathTemplates.findingSecurityMarksPathTemplate.render({ + organizationSettingsPath(organization) { + return this._pathTemplates.organizationSettingsPathTemplate.render({ organization: organization, - source: source, - finding: finding, }); } /** - * Parse the organizationName from a organization resource. + * Return a fully-qualified organization_sources resource name string. * - * @param {String} organizationName - * A fully-qualified path representing a organization resources. - * @returns {String} - A string representing the organization. + * @param {String} organization + * @returns {String} */ - matchOrganizationFromOrganizationName(organizationName) { - return this._pathTemplates.organizationPathTemplate.match(organizationName) - .organization; + organizationSourcesPath(organization) { + return this._pathTemplates.organizationSourcesPathTemplate.render({ + organization: organization, + }); } /** - * Parse the organizationSettingsName from a organization_settings resource. + * Return a fully-qualified source resource name string. * - * @param {String} organizationSettingsName - * A fully-qualified path representing a organization_settings resources. - * @returns {String} - A string representing the organization. + * @param {String} organization + * @param {String} source + * @returns {String} */ - matchOrganizationFromOrganizationSettingsName(organizationSettingsName) { - return this._pathTemplates.organizationSettingsPathTemplate.match( - organizationSettingsName - ).organization; + sourcePath(organization, source) { + return this._pathTemplates.sourcePathTemplate.render({ + organization: organization, + source: source, + }); } /** @@ -2942,42 +2919,6 @@ class SecurityCenterClient { ).asset; } - /** - * Parse the sourceName from a source resource. - * - * @param {String} sourceName - * A fully-qualified path representing a source resources. - * @returns {String} - A string representing the organization. - */ - matchOrganizationFromSourceName(sourceName) { - return this._pathTemplates.sourcePathTemplate.match(sourceName) - .organization; - } - - /** - * Parse the sourceName from a source resource. - * - * @param {String} sourceName - * A fully-qualified path representing a source resources. - * @returns {String} - A string representing the source. - */ - matchSourceFromSourceName(sourceName) { - return this._pathTemplates.sourcePathTemplate.match(sourceName).source; - } - - /** - * Parse the organizationSourcesName from a organization_sources resource. - * - * @param {String} organizationSourcesName - * A fully-qualified path representing a organization_sources resources. - * @returns {String} - A string representing the organization. - */ - matchOrganizationFromOrganizationSourcesName(organizationSourcesName) { - return this._pathTemplates.organizationSourcesPathTemplate.match( - organizationSourcesName - ).organization; - } - /** * Parse the findingName from a finding resource. * @@ -3050,6 +2991,67 @@ class SecurityCenterClient { findingSecurityMarksName ).finding; } + + /** + * Parse the organizationName from a organization resource. + * + * @param {String} organizationName + * A fully-qualified path representing a organization resources. + * @returns {String} - A string representing the organization. + */ + matchOrganizationFromOrganizationName(organizationName) { + return this._pathTemplates.organizationPathTemplate.match(organizationName) + .organization; + } + + /** + * Parse the organizationSettingsName from a organization_settings resource. + * + * @param {String} organizationSettingsName + * A fully-qualified path representing a organization_settings resources. + * @returns {String} - A string representing the organization. + */ + matchOrganizationFromOrganizationSettingsName(organizationSettingsName) { + return this._pathTemplates.organizationSettingsPathTemplate.match( + organizationSettingsName + ).organization; + } + + /** + * Parse the organizationSourcesName from a organization_sources resource. + * + * @param {String} organizationSourcesName + * A fully-qualified path representing a organization_sources resources. + * @returns {String} - A string representing the organization. + */ + matchOrganizationFromOrganizationSourcesName(organizationSourcesName) { + return this._pathTemplates.organizationSourcesPathTemplate.match( + organizationSourcesName + ).organization; + } + + /** + * Parse the sourceName from a source resource. + * + * @param {String} sourceName + * A fully-qualified path representing a source resources. + * @returns {String} - A string representing the organization. + */ + matchOrganizationFromSourceName(sourceName) { + return this._pathTemplates.sourcePathTemplate.match(sourceName) + .organization; + } + + /** + * Parse the sourceName from a source resource. + * + * @param {String} sourceName + * A fully-qualified path representing a source resources. + * @returns {String} - A string representing the source. + */ + matchSourceFromSourceName(sourceName) { + return this._pathTemplates.sourcePathTemplate.match(sourceName).source; + } } module.exports = SecurityCenterClient; diff --git a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/protobuf/doc_any.js b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/protobuf/doc_any.js index f3278b34e66..9ff5d007807 100644 --- a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/protobuf/doc_any.js +++ b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/protobuf/doc_any.js @@ -98,7 +98,8 @@ * * @property {string} typeUrl * A URL/resource name that uniquely identifies the type of the serialized - * protocol buffer message. The last segment of the URL's path must represent + * protocol buffer message. This string must contain at least + * one "/" character. The last segment of the URL's path must represent * the fully qualified name of the type (as in * `path/google.protobuf.Duration`). The name should be in a canonical form * (e.g., leading "." is not accepted). diff --git a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/protobuf/doc_field_mask.js b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/protobuf/doc_field_mask.js index d55d97e6e38..011207b8626 100644 --- a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/protobuf/doc_field_mask.js +++ b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/protobuf/doc_field_mask.js @@ -84,57 +84,49 @@ * describe the updated values, the API ignores the values of all * fields not covered by the mask. * - * If a repeated field is specified for an update operation, the existing - * repeated values in the target resource will be overwritten by the new values. - * Note that a repeated field is only allowed in the last position of a `paths` - * string. + * If a repeated field is specified for an update operation, new values will + * be appended to the existing repeated field in the target resource. Note that + * a repeated field is only allowed in the last position of a `paths` string. * * If a sub-message is specified in the last position of the field mask for an - * update operation, then the existing sub-message in the target resource is - * overwritten. Given the target message: + * update operation, then new value will be merged into the existing sub-message + * in the target resource. + * + * For example, given the target message: * * f { * b { - * d : 1 - * x : 2 + * d: 1 + * x: 2 * } - * c : 1 + * c: [1] * } * * And an update message: * * f { * b { - * d : 10 + * d: 10 * } + * c: [2] * } * * then if the field mask is: * - * paths: "f.b" + * paths: ["f.b", "f.c"] * * then the result will be: * * f { * b { - * d : 10 + * d: 10 + * x: 2 * } - * c : 1 + * c: [1, 2] * } * - * However, if the update mask was: - * - * paths: "f.b.d" - * - * then the result would be: - * - * f { - * b { - * d : 10 - * x : 2 - * } - * c : 1 - * } + * An implementation may provide options to override this default behavior for + * repeated and message fields. * * In order to reset a field's value to the default, the field must * be in the mask and set to the default value in the provided resource. diff --git a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/protobuf/doc_timestamp.js b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/protobuf/doc_timestamp.js index b47f41c2b30..98c19dbf0d3 100644 --- a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/protobuf/doc_timestamp.js +++ b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/protobuf/doc_timestamp.js @@ -16,17 +16,19 @@ // to be loaded as the JS file. /** - * A Timestamp represents a point in time independent of any time zone - * or calendar, represented as seconds and fractions of seconds at - * nanosecond resolution in UTC Epoch time. It is encoded using the - * Proleptic Gregorian Calendar which extends the Gregorian calendar - * backwards to year one. It is encoded assuming all minutes are 60 - * seconds long, i.e. leap seconds are "smeared" so that no leap second - * table is needed for interpretation. Range is from - * 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. - * By restricting to that range, we ensure that we can convert to - * and from RFC 3339 date strings. - * See [https://www.ietf.org/rfc/rfc3339.txt](https://www.ietf.org/rfc/rfc3339.txt). + * A Timestamp represents a point in time independent of any time zone or local + * calendar, encoded as a count of seconds and fractions of seconds at + * nanosecond resolution. The count is relative to an epoch at UTC midnight on + * January 1, 1970, in the proleptic Gregorian calendar which extends the + * Gregorian calendar backwards to year one. + * + * All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + * second table is needed for interpretation, using a [24-hour linear + * smear](https://developers.google.com/time/smear). + * + * The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + * restricting to that range, we ensure that we can convert to and from [RFC + * 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. * * # Examples * @@ -91,7 +93,7 @@ * method. In Python, a standard `datetime.datetime` object can be converted * to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) * with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one - * can use the Joda Time's [`ISODateTimeFormat.dateTime()`](https://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime--) to obtain a formatter capable of generating timestamps in this format. + * can use the Joda Time's [`ISODateTimeFormat.dateTime()`](https://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime%2D%2D) to obtain a formatter capable of generating timestamps in this format. * * @property {number} seconds * Represents seconds of UTC time since Unix epoch diff --git a/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.js b/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.js index d581a1f7f4e..f7fdd0dbc80 100644 --- a/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.js +++ b/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.js @@ -101,20 +101,20 @@ class SecurityCenterClient { // identifiers to uniquely identify resources within the API. // Create useful helper objects for these. this._pathTemplates = { + assetSecurityMarksPathTemplate: new gax.PathTemplate( + 'organizations/{organization}/assets/{asset}/securityMarks' + ), + findingPathTemplate: new gax.PathTemplate( + 'organizations/{organization}/sources/{source}/findings/{finding}' + ), organizationPathTemplate: new gax.PathTemplate( 'organizations/{organization}' ), - sourcePathTemplate: new gax.PathTemplate( - 'organizations/{organization}/sources/{source}' - ), organizationSettingsPathTemplate: new gax.PathTemplate( 'organizations/{organization}/organizationSettings' ), - findingPathTemplate: new gax.PathTemplate( - 'organizations/{organization}/sources/{source}/findings/{finding}' - ), - assetSecurityMarksPathTemplate: new gax.PathTemplate( - 'organizations/{organization}/assets/{asset}/securityMarks' + sourcePathTemplate: new gax.PathTemplate( + 'organizations/{organization}/sources/{source}' ), }; @@ -2472,119 +2472,97 @@ class SecurityCenterClient { // -------------------- /** - * Return a fully-qualified organization resource name string. + * Return a fully-qualified asset_security_marks resource name string. * * @param {String} organization + * @param {String} asset * @returns {String} */ - organizationPath(organization) { - return this._pathTemplates.organizationPathTemplate.render({ + assetSecurityMarksPath(organization, asset) { + return this._pathTemplates.assetSecurityMarksPathTemplate.render({ organization: organization, + asset: asset, }); } /** - * Return a fully-qualified source resource name string. + * Return a fully-qualified finding resource name string. * * @param {String} organization * @param {String} source + * @param {String} finding * @returns {String} */ - sourcePath(organization, source) { - return this._pathTemplates.sourcePathTemplate.render({ + findingPath(organization, source, finding) { + return this._pathTemplates.findingPathTemplate.render({ organization: organization, source: source, + finding: finding, }); } /** - * Return a fully-qualified organization_settings resource name string. + * Return a fully-qualified organization resource name string. * * @param {String} organization * @returns {String} */ - organizationSettingsPath(organization) { - return this._pathTemplates.organizationSettingsPathTemplate.render({ + organizationPath(organization) { + return this._pathTemplates.organizationPathTemplate.render({ organization: organization, }); } /** - * Return a fully-qualified finding resource name string. + * Return a fully-qualified organization_settings resource name string. * * @param {String} organization - * @param {String} source - * @param {String} finding * @returns {String} */ - findingPath(organization, source, finding) { - return this._pathTemplates.findingPathTemplate.render({ + organizationSettingsPath(organization) { + return this._pathTemplates.organizationSettingsPathTemplate.render({ organization: organization, - source: source, - finding: finding, }); } /** - * Return a fully-qualified asset_security_marks resource name string. + * Return a fully-qualified source resource name string. * * @param {String} organization - * @param {String} asset + * @param {String} source * @returns {String} */ - assetSecurityMarksPath(organization, asset) { - return this._pathTemplates.assetSecurityMarksPathTemplate.render({ + sourcePath(organization, source) { + return this._pathTemplates.sourcePathTemplate.render({ organization: organization, - asset: asset, + source: source, }); } /** - * Parse the organizationName from a organization resource. - * - * @param {String} organizationName - * A fully-qualified path representing a organization resources. - * @returns {String} - A string representing the organization. - */ - matchOrganizationFromOrganizationName(organizationName) { - return this._pathTemplates.organizationPathTemplate.match(organizationName) - .organization; - } - - /** - * Parse the sourceName from a source resource. + * Parse the assetSecurityMarksName from a asset_security_marks resource. * - * @param {String} sourceName - * A fully-qualified path representing a source resources. + * @param {String} assetSecurityMarksName + * A fully-qualified path representing a asset_security_marks resources. * @returns {String} - A string representing the organization. */ - matchOrganizationFromSourceName(sourceName) { - return this._pathTemplates.sourcePathTemplate.match(sourceName) - .organization; - } - - /** - * Parse the sourceName from a source resource. - * - * @param {String} sourceName - * A fully-qualified path representing a source resources. - * @returns {String} - A string representing the source. - */ - matchSourceFromSourceName(sourceName) { - return this._pathTemplates.sourcePathTemplate.match(sourceName).source; + matchOrganizationFromAssetSecurityMarksName(assetSecurityMarksName) { + return this._pathTemplates.assetSecurityMarksPathTemplate.match( + assetSecurityMarksName + ).organization; } /** - * Parse the organizationSettingsName from a organization_settings resource. + * Parse the assetSecurityMarksName from a asset_security_marks resource. * - * @param {String} organizationSettingsName - * A fully-qualified path representing a organization_settings resources. - * @returns {String} - A string representing the organization. + * @param {String} assetSecurityMarksName + * A fully-qualified path representing a asset_security_marks resources. + * @returns {String} - A string representing the asset. */ - matchOrganizationFromOrganizationSettingsName(organizationSettingsName) { - return this._pathTemplates.organizationSettingsPathTemplate.match( - organizationSettingsName - ).organization; + matchAssetFromAssetSecurityMarksName(assetSecurityMarksName) { + return this._pathTemplates.assetSecurityMarksPathTemplate.match( + assetSecurityMarksName + ).asset; } /** @@ -2622,29 +2600,51 @@ class SecurityCenterClient { } /** - * Parse the assetSecurityMarksName from a asset_security_marks resource. + * Parse the organizationName from a organization resource. * - * @param {String} assetSecurityMarksName - * A fully-qualified path representing a asset_security_marks resources. + * @param {String} organizationName + * A fully-qualified path representing a organization resources. * @returns {String} - A string representing the organization. */ - matchOrganizationFromAssetSecurityMarksName(assetSecurityMarksName) { - return this._pathTemplates.assetSecurityMarksPathTemplate.match( - assetSecurityMarksName + matchOrganizationFromOrganizationName(organizationName) { + return this._pathTemplates.organizationPathTemplate.match(organizationName) + .organization; + } + + /** + * Parse the organizationSettingsName from a organization_settings resource. + * + * @param {String} organizationSettingsName + * A fully-qualified path representing a organization_settings resources. + * @returns {String} - A string representing the organization. + */ + matchOrganizationFromOrganizationSettingsName(organizationSettingsName) { + return this._pathTemplates.organizationSettingsPathTemplate.match( + organizationSettingsName ).organization; } /** - * Parse the assetSecurityMarksName from a asset_security_marks resource. + * Parse the sourceName from a source resource. * - * @param {String} assetSecurityMarksName - * A fully-qualified path representing a asset_security_marks resources. - * @returns {String} - A string representing the asset. + * @param {String} sourceName + * A fully-qualified path representing a source resources. + * @returns {String} - A string representing the organization. */ - matchAssetFromAssetSecurityMarksName(assetSecurityMarksName) { - return this._pathTemplates.assetSecurityMarksPathTemplate.match( - assetSecurityMarksName - ).asset; + matchOrganizationFromSourceName(sourceName) { + return this._pathTemplates.sourcePathTemplate.match(sourceName) + .organization; + } + + /** + * Parse the sourceName from a source resource. + * + * @param {String} sourceName + * A fully-qualified path representing a source resources. + * @returns {String} - A string representing the source. + */ + matchSourceFromSourceName(sourceName) { + return this._pathTemplates.sourcePathTemplate.match(sourceName).source; } } diff --git a/packages/google-cloud-securitycenter/synth.metadata b/packages/google-cloud-securitycenter/synth.metadata index 0f6e13fb67a..f3ef4a266c6 100644 --- a/packages/google-cloud-securitycenter/synth.metadata +++ b/packages/google-cloud-securitycenter/synth.metadata @@ -1,19 +1,19 @@ { - "updateTime": "2019-04-18T11:20:31.265935Z", + "updateTime": "2019-04-27T11:18:13.501517Z", "sources": [ { "generator": { "name": "artman", - "version": "0.16.25", - "dockerImage": "googleapis/artman@sha256:d9597f983d1d4e61272c63cb97b7d8f8234da9999526c35d357de3d781f0ec1b" + "version": "0.17.1", + "dockerImage": "googleapis/artman@sha256:a40ca4dd4ef031c0ded4df4909ffdf7b3f20d29b23e682ef991eb60ba0ca6025" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "d35ca3509160f09d3b0cc5360531751d95f3e292", - "internalRef": "244086609" + "sha": "808110e242c682d7ac2bab6d9c49fc3bf72d7604", + "internalRef": "245313728" } }, { From 1e548ba8fdd43adddc12f7d6defeec43a841eeee Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Mon, 29 Apr 2019 19:05:14 -0700 Subject: [PATCH 062/342] docs: use repo-metadata to generate README (#87) --- .../.cloud-repo-tools.json | 8 -- .../.readme-partials.yaml | 10 ++ .../.repo-metadata.json | 13 ++ .../google-cloud-securitycenter/README.md | 115 ++++++++++++------ .../google-cloud-securitycenter/package.json | 2 - .../samples/README.md | 52 ++++++++ .../samples/quickstart.js | 35 +++--- .../synth.metadata | 6 +- 8 files changed, 172 insertions(+), 69 deletions(-) delete mode 100644 packages/google-cloud-securitycenter/.cloud-repo-tools.json create mode 100644 packages/google-cloud-securitycenter/.readme-partials.yaml create mode 100644 packages/google-cloud-securitycenter/.repo-metadata.json create mode 100644 packages/google-cloud-securitycenter/samples/README.md diff --git a/packages/google-cloud-securitycenter/.cloud-repo-tools.json b/packages/google-cloud-securitycenter/.cloud-repo-tools.json deleted file mode 100644 index 3e24bfb8914..00000000000 --- a/packages/google-cloud-securitycenter/.cloud-repo-tools.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "requiresKeyFile": true, - "requiresProjectId": true, - "product": "security-center", - "client_reference_url": "https://cloud.google.com/nodejs/docs/reference/security-center/latest/", - "release_quality": "beta", - "samples": [] -} diff --git a/packages/google-cloud-securitycenter/.readme-partials.yaml b/packages/google-cloud-securitycenter/.readme-partials.yaml new file mode 100644 index 00000000000..aab9d229cf5 --- /dev/null +++ b/packages/google-cloud-securitycenter/.readme-partials.yaml @@ -0,0 +1,10 @@ +introduction: |- + > Node.js idiomatic client for [Cloud Security Command Center][product-docs]. + + [Cloud Security Command Center](https://cloud.google.com/security-command-center/docs/) helps + security teams gather data, identify threats, and act on them before they result in business + damage or loss. It offers deep insight into application and data risk so that you can quickly + mitigate threats to your cloud resources and evaluate overall health. With Cloud Security + Command Center, you can view and monitor an inventory of your cloud assets, scan storage + systems for sensitive data, detect common web vulnerabilities, and review access rights + to your critical resources, all from a single, centralized dashboard. \ No newline at end of file diff --git a/packages/google-cloud-securitycenter/.repo-metadata.json b/packages/google-cloud-securitycenter/.repo-metadata.json new file mode 100644 index 00000000000..96c7424b02f --- /dev/null +++ b/packages/google-cloud-securitycenter/.repo-metadata.json @@ -0,0 +1,13 @@ +{ + "name": "security-center", + "name_pretty": "Google Cloud Security Command Center", + "product_documentation": "https://cloud.google.com/security-command-center", + "client_documentation": "https://cloud.google.com/nodejs/docs/reference/security-center/latest/", + "issue_tracker": "https://issuetracker.google.com/savedsearches/559748", + "release_level": "beta", + "language": "nodejs", + "repo": "googleapis/nodejs-security-center", + "distribution_name": "@google-cloud/security-center", + "api_id": "securitycenter.googleapis.com", + "requires_billing": true +} diff --git a/packages/google-cloud-securitycenter/README.md b/packages/google-cloud-securitycenter/README.md index 7173728c144..142af8bbe39 100644 --- a/packages/google-cloud-securitycenter/README.md +++ b/packages/google-cloud-securitycenter/README.md @@ -1,72 +1,118 @@ [//]: # "This README.md file is auto-generated, all changes to this file will be lost." -[//]: # "To regenerate it, use `npm run generate-scaffolding`." +[//]: # "To regenerate it, use `python -m synthtool`." Google Cloud Platform logo # [Google Cloud Security Command Center: Node.js Client](https://github.com/googleapis/nodejs-security-center) -[![release level](https://img.shields.io/badge/release%20level-beta-yellow.svg?style=flat)](https://cloud.google.com/terms/launch-stages) +[![release level](https://img.shields.io/badge/release%20level-beta-yellow.svg?style=flat)](https://cloud.google.com/terms/launch-stages) [![npm version](https://img.shields.io/npm/v/@google-cloud/security-center.svg)](https://www.npmjs.org/package/@google-cloud/security-center) [![codecov](https://img.shields.io/codecov/c/github/googleapis/nodejs-security-center/master.svg?style=flat)](https://codecov.io/gh/googleapis/nodejs-security-center) -[Cloud Security Command Center](https://cloud.google.com/security-command-center/docs/) helps security teams gather data, identify threats, and act on them before they result in business damage or loss. It offers deep insight into application and data risk so that you can quickly mitigate threats to your cloud resources and evaluate overall health. With Cloud Security Command Center, you can view and monitor an inventory of your cloud assets, scan storage systems for sensitive data, detect common web vulnerabilities, and review access rights to your critical resources, all from a single, centralized dashboard. -* [Using the client library](#using-the-client-library) + +> Node.js idiomatic client for [Cloud Security Command Center][product-docs]. + +[Cloud Security Command Center](https://cloud.google.com/security-command-center/docs/) helps +security teams gather data, identify threats, and act on them before they result in business +damage or loss. It offers deep insight into application and data risk so that you can quickly +mitigate threats to your cloud resources and evaluate overall health. With Cloud Security +Command Center, you can view and monitor an inventory of your cloud assets, scan storage +systems for sensitive data, detect common web vulnerabilities, and review access rights +to your critical resources, all from a single, centralized dashboard. + + +* [Google Cloud Security Command Center Node.js Client API Reference][client-docs] +* [Google Cloud Security Command Center Documentation][product-docs] +* [github.com/googleapis/nodejs-security-center](https://github.com/googleapis/nodejs-security-center) + +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) -## Using the client library +## Quickstart -1. [Select or create a Cloud Platform project][projects]. +### Before you begin +1. [Select or create a Cloud Platform project][projects]. 1. [Enable billing for your project][billing]. - +1. [Enable the Google Cloud Security Command Center API][enable_api]. 1. [Set up authentication with a service account][auth] so you can access the API from your local workstation. -1. Install the client library: +### Installing the client library + +```bash +npm install @google-cloud/security-center +``` - npm install --save @google-cloud/security-center -1. Try an example: +### Using the client library ```javascript -async function quickstart( - organization = 'YOUR_ORGANIZATION' // Your GCP organization -) { const sc = require('@google-cloud/security-center'); // Create a client const client = new sc.SecurityCenterClient(); - const formattedParent = client.organizationPath(organization); - const reqSource = {}; - const request = { - parent: formattedParent, - source: reqSource, - }; - - const [source] = await client.createSource(request); - // The newly created source. - console.log('Source created.'); - console.log(source); -} + async function quickstart() { + // TODO(developer): choose the organization to use + // const organization = 'your-organization'; + const [source] = await client.createSource({ + parent: client.organizationPath(organization), + source: {}, + }); + // The newly created source. + console.log('Source created.'); + console.log(source); + } + quickstart(); + ``` -The [Cloud Security Command Center Node.js Client API Reference][client-docs] documentation + +## Samples + +Samples are in the [`samples/`](https://github.com/googleapis/nodejs-security-center/tree/master/samples) directory. The samples' `README.md` +has instructions for running the samples. + +| Sample | Source Code | Try it | +| --------------------------- | --------------------------------- | ------ | +| Quickstart | [source code](https://github.com/googleapis/nodejs-security-center/blob/master/samples/quickstart.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-security-center&page=editor&open_in_editor=samples/quickstart.js,samples/README.md) | + + + +The [Google Cloud Security Command Center Node.js Client API Reference][client-docs] documentation also contains samples. ## Versioning This library follows [Semantic Versioning](http://semver.org/). + + This library is considered to be in **beta**. This means it is expected to be mostly stable while we work toward a general availability release; however, complete stability is not guaranteed. We will address issues and requests against beta libraries with a high priority. + + + More Information: [Google Cloud Platform Launch Stages][launch_stages] [launch_stages]: https://cloud.google.com/terms/launch-stages @@ -81,21 +127,10 @@ Apache Version 2.0 See [LICENSE](https://github.com/googleapis/nodejs-security-center/blob/master/LICENSE) -## What's Next - -* [Cloud Security Command Center Documentation][product-docs] -* [Cloud Security Command Center Node.js Client API Reference][client-docs] -* [github.com/googleapis/nodejs-security-center](https://github.com/googleapis/nodejs-security-center) - -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 - [client-docs]: https://cloud.google.com/nodejs/docs/reference/security-center/latest/ -[product-docs]: https://cloud.google.com/security-command-center/docs/ +[product-docs]: https://cloud.google.com/security-command-center [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= -[auth]: https://cloud.google.com/docs/authentication/getting-started +[enable_api]: https://console.cloud.google.com/flows/enableapi?apiid=securitycenter.googleapis.com +[auth]: https://cloud.google.com/docs/authentication/getting-started \ No newline at end of file diff --git a/packages/google-cloud-securitycenter/package.json b/packages/google-cloud-securitycenter/package.json index 22487196584..0885f498320 100644 --- a/packages/google-cloud-securitycenter/package.json +++ b/packages/google-cloud-securitycenter/package.json @@ -29,7 +29,6 @@ "scripts": { "cover": "nyc --reporter=lcov mocha test/*.js && nyc report", "docs": "jsdoc -c .jsdoc.js", - "generate-scaffolding": "repo-tools generate all && repo-tools generate lib_samples_readme -l samples/ --config ../.cloud-repo-tools.json", "lint": "eslint '**/*.js'", "samples-test": "cd samples/ && npm link ../ && npm test && cd ../", "system-test": "mocha system-test/*.js --timeout 600000", @@ -45,7 +44,6 @@ "protobufjs": "^6.8.0" }, "devDependencies": { - "@google-cloud/nodejs-repo-tools": "^3.0.0", "codecov": "^3.0.0", "eslint": "^5.0.0", "eslint-config-prettier": "^4.0.0", diff --git a/packages/google-cloud-securitycenter/samples/README.md b/packages/google-cloud-securitycenter/samples/README.md new file mode 100644 index 00000000000..86afb450586 --- /dev/null +++ b/packages/google-cloud-securitycenter/samples/README.md @@ -0,0 +1,52 @@ +[//]: # "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 Cloud Security Command Center: Node.js Samples](https://github.com/googleapis/nodejs-security-center) + +[![Open in Cloud Shell][shell_img]][shell_link] + +> Node.js idiomatic client for [Cloud Security Command Center][product-docs]. + +[Cloud Security Command Center](https://cloud.google.com/security-command-center/docs/) helps +security teams gather data, identify threats, and act on them before they result in business +damage or loss. It offers deep insight into application and data risk so that you can quickly +mitigate threats to your cloud resources and evaluate overall health. With Cloud Security +Command Center, you can view and monitor an inventory of your cloud assets, scan storage +systems for sensitive data, detect common web vulnerabilities, and review access rights +to your critical resources, all from a single, centralized dashboard. + +## Table of Contents + +* [Before you begin](#before-you-begin) +* [Samples](#samples) + * [Quickstart](#quickstart) + +## 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-security-center#using-the-client-library). + +## Samples + + + +### Quickstart + +View the [source code](https://github.com/googleapis/nodejs-security-center/blob/master/samples/quickstart.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-security-center&page=editor&open_in_editor=samples/quickstart.js,samples/README.md) + +__Usage:__ + + +`node quickstart.js [organization]` + + + + + + +[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-security-center&page=editor&open_in_editor=samples/README.md +[product-docs]: https://cloud.google.com/security-command-center \ No newline at end of file diff --git a/packages/google-cloud-securitycenter/samples/quickstart.js b/packages/google-cloud-securitycenter/samples/quickstart.js index e9d8017a5eb..1eb4c21813c 100644 --- a/packages/google-cloud-securitycenter/samples/quickstart.js +++ b/packages/google-cloud-securitycenter/samples/quickstart.js @@ -13,30 +13,33 @@ * limitations under the License. */ +// sample-metadata: +// usage: node quickstart.js [organization] + 'use strict'; -// [START securitycenter_quickstart] -async function quickstart( +async function main( organization = 'YOUR_ORGANIZATION' // Your GCP organization ) { + // [START securitycenter_quickstart] const sc = require('@google-cloud/security-center'); // Create a client const client = new sc.SecurityCenterClient(); - const formattedParent = client.organizationPath(organization); - const reqSource = {}; - const request = { - parent: formattedParent, - source: reqSource, - }; - - const [source] = await client.createSource(request); - // The newly created source. - console.log('Source created.'); - console.log(source); + async function quickstart() { + // TODO(developer): choose the organization to use + // const organization = 'your-organization'; + const [source] = await client.createSource({ + parent: client.organizationPath(organization), + source: {}, + }); + // The newly created source. + console.log('Source created.'); + console.log(source); + } + quickstart(); + // [END securitycenter_quickstart] } -// [END securitycenter_quickstart] -const args = process.argv.slice(2); -quickstart(...args).catch(console.error); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-securitycenter/synth.metadata b/packages/google-cloud-securitycenter/synth.metadata index f3ef4a266c6..bb82580fffa 100644 --- a/packages/google-cloud-securitycenter/synth.metadata +++ b/packages/google-cloud-securitycenter/synth.metadata @@ -1,5 +1,5 @@ { - "updateTime": "2019-04-27T11:18:13.501517Z", + "updateTime": "2019-04-30T01:57:29.004065Z", "sources": [ { "generator": { @@ -12,8 +12,8 @@ "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "808110e242c682d7ac2bab6d9c49fc3bf72d7604", - "internalRef": "245313728" + "sha": "be3005c8a16e8424d0330e977ac78f2976bf01d3", + "internalRef": "245840921" } }, { From 2aa729e7d8dacf304481e3b9a055a4fd71dc36e6 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" Date: Thu, 2 May 2019 09:16:39 -0700 Subject: [PATCH 063/342] fix(deps): update dependency google-gax to ^0.26.0 (#91) --- packages/google-cloud-securitycenter/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-securitycenter/package.json b/packages/google-cloud-securitycenter/package.json index 0885f498320..502b6a0d550 100644 --- a/packages/google-cloud-securitycenter/package.json +++ b/packages/google-cloud-securitycenter/package.json @@ -39,7 +39,7 @@ "predocs-test": "npm run docs" }, "dependencies": { - "google-gax": "^0.25.0", + "google-gax": "^0.26.0", "lodash.merge": "^4.6.0", "protobufjs": "^6.8.0" }, From 1a13986d2e1dee724c05674a657fcf9d2b3237e0 Mon Sep 17 00:00:00 2001 From: "Benjamin E. Coe" Date: Thu, 2 May 2019 11:31:32 -0700 Subject: [PATCH 064/342] build!: upgrade engines field to >=8.10.0 (#93) --- packages/google-cloud-securitycenter/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-securitycenter/package.json b/packages/google-cloud-securitycenter/package.json index 502b6a0d550..e9dc0273461 100644 --- a/packages/google-cloud-securitycenter/package.json +++ b/packages/google-cloud-securitycenter/package.json @@ -5,7 +5,7 @@ "license": "Apache-2.0", "author": "Google LLC", "engines": { - "node": ">=6.0.0" + "node": ">=8.10.0" }, "repository": "googleapis/nodejs-security-center", "main": "src/index.js", From f9d8a04d08f62c332deb5ee7be3673560fb1fe31 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" Date: Fri, 3 May 2019 08:21:32 -0700 Subject: [PATCH 065/342] chore(deps): update dependency eslint-plugin-node to v9 (#96) --- packages/google-cloud-securitycenter/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-securitycenter/package.json b/packages/google-cloud-securitycenter/package.json index e9dc0273461..ec2b76c7cdb 100644 --- a/packages/google-cloud-securitycenter/package.json +++ b/packages/google-cloud-securitycenter/package.json @@ -47,7 +47,7 @@ "codecov": "^3.0.0", "eslint": "^5.0.0", "eslint-config-prettier": "^4.0.0", - "eslint-plugin-node": "^8.0.0", + "eslint-plugin-node": "^9.0.0", "eslint-plugin-prettier": "^3.0.0", "jsdoc-baseline": "git+https://github.com/hegemonic/jsdoc-baseline.git", "intelli-espower-loader": "^1.0.1", From 81fb400838c78db2902793d4c9ee0900279e6fd5 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" Date: Fri, 10 May 2019 15:44:02 -0700 Subject: [PATCH 066/342] fix(deps): update dependency google-gax to v1 (#100) --- packages/google-cloud-securitycenter/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-securitycenter/package.json b/packages/google-cloud-securitycenter/package.json index ec2b76c7cdb..4891d3ec9e3 100644 --- a/packages/google-cloud-securitycenter/package.json +++ b/packages/google-cloud-securitycenter/package.json @@ -39,7 +39,7 @@ "predocs-test": "npm run docs" }, "dependencies": { - "google-gax": "^0.26.0", + "google-gax": "^1.0.0", "lodash.merge": "^4.6.0", "protobufjs": "^6.8.0" }, From e424ecd061018317b521c0f175d88f574e36e104 Mon Sep 17 00:00:00 2001 From: "Benjamin E. Coe" Date: Fri, 17 May 2019 09:40:47 -0700 Subject: [PATCH 067/342] build: add new kokoro config for coverage and release-please (#102) * build: add new kokoro config for release-please and coverage * build: actually commit the config * fix: do not fail test if nyc did not run --- .../v1/doc/google/iam/v1/doc_iam_policy.js | 9 ++--- .../src/v1/doc/google/iam/v1/doc_policy.js | 39 ++++++++++++++----- .../src/v1/security_center_client.js | 11 ++---- .../doc/google/iam/v1/doc_iam_policy.js | 9 ++--- .../v1beta1/doc/google/iam/v1/doc_policy.js | 39 ++++++++++++++----- .../src/v1beta1/security_center_client.js | 9 ++--- .../synth.metadata | 10 ++--- 7 files changed, 78 insertions(+), 48 deletions(-) diff --git a/packages/google-cloud-securitycenter/src/v1/doc/google/iam/v1/doc_iam_policy.js b/packages/google-cloud-securitycenter/src/v1/doc/google/iam/v1/doc_iam_policy.js index 12b7ac5df09..d675b1b0d54 100644 --- a/packages/google-cloud-securitycenter/src/v1/doc/google/iam/v1/doc_iam_policy.js +++ b/packages/google-cloud-securitycenter/src/v1/doc/google/iam/v1/doc_iam_policy.js @@ -20,8 +20,7 @@ * * @property {string} resource * REQUIRED: The resource for which the policy is being specified. - * `resource` is usually specified as a path. For example, a Project - * resource is specified as `projects/{project}`. + * See the operation documentation for the appropriate value for this field. * * @property {Object} policy * REQUIRED: The complete policy to be applied to the `resource`. The size of @@ -44,8 +43,7 @@ const SetIamPolicyRequest = { * * @property {string} resource * REQUIRED: The resource for which the policy is being requested. - * `resource` is usually specified as a path. For example, a Project - * resource is specified as `projects/{project}`. + * See the operation documentation for the appropriate value for this field. * * @typedef GetIamPolicyRequest * @memberof google.iam.v1 @@ -60,8 +58,7 @@ const GetIamPolicyRequest = { * * @property {string} resource * REQUIRED: The resource for which the policy detail is being requested. - * `resource` is usually specified as a path. For example, a Project - * resource is specified as `projects/{project}`. + * See the operation documentation for the appropriate value for this field. * * @property {string[]} permissions * The set of permissions to check for the `resource`. Permissions with diff --git a/packages/google-cloud-securitycenter/src/v1/doc/google/iam/v1/doc_policy.js b/packages/google-cloud-securitycenter/src/v1/doc/google/iam/v1/doc_policy.js index bcae4a7d873..09c3a5bdc56 100644 --- a/packages/google-cloud-securitycenter/src/v1/doc/google/iam/v1/doc_policy.js +++ b/packages/google-cloud-securitycenter/src/v1/doc/google/iam/v1/doc_policy.js @@ -20,12 +20,12 @@ * specify access control policies for Cloud Platform resources. * * - * A `Policy` consists of a list of `bindings`. A `Binding` binds a list of + * A `Policy` consists of a list of `bindings`. A `binding` binds a list of * `members` to a `role`, where the members can be user accounts, Google groups, * Google domains, and service accounts. A `role` is a named list of permissions * defined by IAM. * - * **Example** + * **JSON Example** * * { * "bindings": [ @@ -35,7 +35,7 @@ * "user:mike@example.com", * "group:admins@example.com", * "domain:google.com", - * "serviceAccount:my-other-app@appspot.gserviceaccount.com", + * "serviceAccount:my-other-app@appspot.gserviceaccount.com" * ] * }, * { @@ -45,15 +45,28 @@ * ] * } * + * **YAML Example** + * + * bindings: + * - members: + * - user:mike@example.com + * - group:admins@example.com + * - domain:google.com + * - serviceAccount:my-other-app@appspot.gserviceaccount.com + * role: roles/owner + * - members: + * - user:sean@example.com + * role: roles/viewer + * + * * For a description of IAM and its features, see the - * [IAM developer's guide](https://cloud.google.com/iam). + * [IAM developer's guide](https://cloud.google.com/iam/docs). * * @property {number} version - * Version of the `Policy`. The default version is 0. + * Deprecated. * * @property {Object[]} bindings * Associates a list of `members` to a `role`. - * Multiple `bindings` must not be specified for the same `role`. * `bindings` with no members will result in an error. * * This object should have the same structure as [Binding]{@link google.iam.v1.Binding} @@ -84,7 +97,6 @@ const Policy = { * @property {string} role * Role that is assigned to `members`. * For example, `roles/viewer`, `roles/editor`, or `roles/owner`. - * Required * * @property {string[]} members * Specifies the identities requesting access for a Cloud Platform resource. @@ -97,7 +109,7 @@ const Policy = { * who is authenticated with a Google account or a service account. * * * `user:{emailid}`: An email address that represents a specific Google - * account. For example, `alice@gmail.com` or `joe@example.com`. + * account. For example, `alice@gmail.com` . * * * * `serviceAccount:{emailid}`: An email address that represents a service @@ -106,9 +118,18 @@ const Policy = { * * `group:{emailid}`: An email address that represents a Google group. * For example, `admins@example.com`. * - * * `domain:{domain}`: A Google Apps domain name that represents all the + * + * * `domain:{domain}`: The G Suite domain (primary) that represents all the * users of that domain. For example, `google.com` or `example.com`. * + * @property {Object} condition + * The condition that is associated with this binding. + * NOTE: An unsatisfied condition will not allow user access via current + * binding. Different bindings, including their conditions, are examined + * independently. + * + * This object should have the same structure as [Expr]{@link google.type.Expr} + * * @typedef Binding * @memberof google.iam.v1 * @see [google.iam.v1.Binding definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/iam/v1/policy.proto} diff --git a/packages/google-cloud-securitycenter/src/v1/security_center_client.js b/packages/google-cloud-securitycenter/src/v1/security_center_client.js index 19ff42ae9c0..e5c473f449a 100644 --- a/packages/google-cloud-securitycenter/src/v1/security_center_client.js +++ b/packages/google-cloud-securitycenter/src/v1/security_center_client.js @@ -178,7 +178,7 @@ class SecurityCenterClient { }).operationsClient(opts); const runAssetDiscoveryResponse = protoFilesRoot.lookup( - 'google.protobuf.Empty' + 'google.cloud.securitycenter.v1.RunAssetDiscoveryResponse' ); const runAssetDiscoveryMetadata = protoFilesRoot.lookup( 'google.protobuf.Empty' @@ -431,8 +431,7 @@ class SecurityCenterClient { * The request object that will be sent. * @param {string} request.resource * REQUIRED: The resource for which the policy is being requested. - * `resource` is usually specified as a path. For example, a Project - * resource is specified as `projects/{project}`. + * See the operation documentation for the appropriate value for this field. * @param {Object} [options] * Optional parameters. You can override the default settings for this call, e.g, timeout, * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. @@ -2366,8 +2365,7 @@ class SecurityCenterClient { * The request object that will be sent. * @param {string} request.resource * REQUIRED: The resource for which the policy is being specified. - * `resource` is usually specified as a path. For example, a Project - * resource is specified as `projects/{project}`. + * See the operation documentation for the appropriate value for this field. * @param {Object} request.policy * REQUIRED: The complete policy to be applied to the `resource`. The size of * the policy is limited to a few 10s of KB. An empty policy is a @@ -2433,8 +2431,7 @@ class SecurityCenterClient { * The request object that will be sent. * @param {string} request.resource * REQUIRED: The resource for which the policy detail is being requested. - * `resource` is usually specified as a path. For example, a Project - * resource is specified as `projects/{project}`. + * See the operation documentation for the appropriate value for this field. * @param {string[]} request.permissions * The set of permissions to check for the `resource`. Permissions with * wildcards (such as '*' or 'storage.*') are not allowed. For more diff --git a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/iam/v1/doc_iam_policy.js b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/iam/v1/doc_iam_policy.js index 12b7ac5df09..d675b1b0d54 100644 --- a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/iam/v1/doc_iam_policy.js +++ b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/iam/v1/doc_iam_policy.js @@ -20,8 +20,7 @@ * * @property {string} resource * REQUIRED: The resource for which the policy is being specified. - * `resource` is usually specified as a path. For example, a Project - * resource is specified as `projects/{project}`. + * See the operation documentation for the appropriate value for this field. * * @property {Object} policy * REQUIRED: The complete policy to be applied to the `resource`. The size of @@ -44,8 +43,7 @@ const SetIamPolicyRequest = { * * @property {string} resource * REQUIRED: The resource for which the policy is being requested. - * `resource` is usually specified as a path. For example, a Project - * resource is specified as `projects/{project}`. + * See the operation documentation for the appropriate value for this field. * * @typedef GetIamPolicyRequest * @memberof google.iam.v1 @@ -60,8 +58,7 @@ const GetIamPolicyRequest = { * * @property {string} resource * REQUIRED: The resource for which the policy detail is being requested. - * `resource` is usually specified as a path. For example, a Project - * resource is specified as `projects/{project}`. + * See the operation documentation for the appropriate value for this field. * * @property {string[]} permissions * The set of permissions to check for the `resource`. Permissions with diff --git a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/iam/v1/doc_policy.js b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/iam/v1/doc_policy.js index bcae4a7d873..09c3a5bdc56 100644 --- a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/iam/v1/doc_policy.js +++ b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/iam/v1/doc_policy.js @@ -20,12 +20,12 @@ * specify access control policies for Cloud Platform resources. * * - * A `Policy` consists of a list of `bindings`. A `Binding` binds a list of + * A `Policy` consists of a list of `bindings`. A `binding` binds a list of * `members` to a `role`, where the members can be user accounts, Google groups, * Google domains, and service accounts. A `role` is a named list of permissions * defined by IAM. * - * **Example** + * **JSON Example** * * { * "bindings": [ @@ -35,7 +35,7 @@ * "user:mike@example.com", * "group:admins@example.com", * "domain:google.com", - * "serviceAccount:my-other-app@appspot.gserviceaccount.com", + * "serviceAccount:my-other-app@appspot.gserviceaccount.com" * ] * }, * { @@ -45,15 +45,28 @@ * ] * } * + * **YAML Example** + * + * bindings: + * - members: + * - user:mike@example.com + * - group:admins@example.com + * - domain:google.com + * - serviceAccount:my-other-app@appspot.gserviceaccount.com + * role: roles/owner + * - members: + * - user:sean@example.com + * role: roles/viewer + * + * * For a description of IAM and its features, see the - * [IAM developer's guide](https://cloud.google.com/iam). + * [IAM developer's guide](https://cloud.google.com/iam/docs). * * @property {number} version - * Version of the `Policy`. The default version is 0. + * Deprecated. * * @property {Object[]} bindings * Associates a list of `members` to a `role`. - * Multiple `bindings` must not be specified for the same `role`. * `bindings` with no members will result in an error. * * This object should have the same structure as [Binding]{@link google.iam.v1.Binding} @@ -84,7 +97,6 @@ const Policy = { * @property {string} role * Role that is assigned to `members`. * For example, `roles/viewer`, `roles/editor`, or `roles/owner`. - * Required * * @property {string[]} members * Specifies the identities requesting access for a Cloud Platform resource. @@ -97,7 +109,7 @@ const Policy = { * who is authenticated with a Google account or a service account. * * * `user:{emailid}`: An email address that represents a specific Google - * account. For example, `alice@gmail.com` or `joe@example.com`. + * account. For example, `alice@gmail.com` . * * * * `serviceAccount:{emailid}`: An email address that represents a service @@ -106,9 +118,18 @@ const Policy = { * * `group:{emailid}`: An email address that represents a Google group. * For example, `admins@example.com`. * - * * `domain:{domain}`: A Google Apps domain name that represents all the + * + * * `domain:{domain}`: The G Suite domain (primary) that represents all the * users of that domain. For example, `google.com` or `example.com`. * + * @property {Object} condition + * The condition that is associated with this binding. + * NOTE: An unsatisfied condition will not allow user access via current + * binding. Different bindings, including their conditions, are examined + * independently. + * + * This object should have the same structure as [Expr]{@link google.type.Expr} + * * @typedef Binding * @memberof google.iam.v1 * @see [google.iam.v1.Binding definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/iam/v1/policy.proto} diff --git a/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.js b/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.js index f7fdd0dbc80..9c523111262 100644 --- a/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.js +++ b/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.js @@ -422,8 +422,7 @@ class SecurityCenterClient { * The request object that will be sent. * @param {string} request.resource * REQUIRED: The resource for which the policy is being requested. - * `resource` is usually specified as a path. For example, a Project - * resource is specified as `projects/{project}`. + * See the operation documentation for the appropriate value for this field. * @param {Object} [options] * Optional parameters. You can override the default settings for this call, e.g, timeout, * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. @@ -2091,8 +2090,7 @@ class SecurityCenterClient { * The request object that will be sent. * @param {string} request.resource * REQUIRED: The resource for which the policy is being specified. - * `resource` is usually specified as a path. For example, a Project - * resource is specified as `projects/{project}`. + * See the operation documentation for the appropriate value for this field. * @param {Object} request.policy * REQUIRED: The complete policy to be applied to the `resource`. The size of * the policy is limited to a few 10s of KB. An empty policy is a @@ -2158,8 +2156,7 @@ class SecurityCenterClient { * The request object that will be sent. * @param {string} request.resource * REQUIRED: The resource for which the policy detail is being requested. - * `resource` is usually specified as a path. For example, a Project - * resource is specified as `projects/{project}`. + * See the operation documentation for the appropriate value for this field. * @param {string[]} request.permissions * The set of permissions to check for the `resource`. Permissions with * wildcards (such as '*' or 'storage.*') are not allowed. For more diff --git a/packages/google-cloud-securitycenter/synth.metadata b/packages/google-cloud-securitycenter/synth.metadata index bb82580fffa..9a05c43c7ab 100644 --- a/packages/google-cloud-securitycenter/synth.metadata +++ b/packages/google-cloud-securitycenter/synth.metadata @@ -1,19 +1,19 @@ { - "updateTime": "2019-04-30T01:57:29.004065Z", + "updateTime": "2019-05-17T01:11:10.647265Z", "sources": [ { "generator": { "name": "artman", - "version": "0.17.1", - "dockerImage": "googleapis/artman@sha256:a40ca4dd4ef031c0ded4df4909ffdf7b3f20d29b23e682ef991eb60ba0ca6025" + "version": "0.19.0", + "dockerImage": "googleapis/artman@sha256:d3df563538225ac6caac45d8ad86499500211d1bcb2536955a6dbda15e1b368e" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "be3005c8a16e8424d0330e977ac78f2976bf01d3", - "internalRef": "245840921" + "sha": "03269e767cff9dd644d7784a4d4350b2ba6daf69", + "internalRef": "248524261" } }, { From 4de757dd0f62a0b91f2e060176bb4b76f6888fef Mon Sep 17 00:00:00 2001 From: "Benjamin E. Coe" Date: Fri, 17 May 2019 16:50:20 -0700 Subject: [PATCH 068/342] build: updated kokoro config for coverage and release-please (#103) --- packages/google-cloud-securitycenter/synth.metadata | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/google-cloud-securitycenter/synth.metadata b/packages/google-cloud-securitycenter/synth.metadata index 9a05c43c7ab..0f302311c77 100644 --- a/packages/google-cloud-securitycenter/synth.metadata +++ b/packages/google-cloud-securitycenter/synth.metadata @@ -1,5 +1,5 @@ { - "updateTime": "2019-05-17T01:11:10.647265Z", + "updateTime": "2019-05-17T19:50:31.193162Z", "sources": [ { "generator": { @@ -12,8 +12,8 @@ "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "03269e767cff9dd644d7784a4d4350b2ba6daf69", - "internalRef": "248524261" + "sha": "99efb1441b7c2aeb75c69f8baf9b61d4221bb744", + "internalRef": "248724297" } }, { From 72c1b7a36c7ea1ecc1e81d692059fde6b7171d62 Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Thu, 23 May 2019 02:39:31 +0000 Subject: [PATCH 069/342] chore: use published jsdoc-baseline package (#104) --- packages/google-cloud-securitycenter/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-securitycenter/package.json b/packages/google-cloud-securitycenter/package.json index 4891d3ec9e3..979333d4fbf 100644 --- a/packages/google-cloud-securitycenter/package.json +++ b/packages/google-cloud-securitycenter/package.json @@ -49,7 +49,7 @@ "eslint-config-prettier": "^4.0.0", "eslint-plugin-node": "^9.0.0", "eslint-plugin-prettier": "^3.0.0", - "jsdoc-baseline": "git+https://github.com/hegemonic/jsdoc-baseline.git", + "jsdoc-baseline": "^0.1.0", "intelli-espower-loader": "^1.0.1", "jsdoc": "^3.5.5", "mocha": "^6.0.0", From afeadfac31a507e8d8156faa9a5f39346bafef0b Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Tue, 28 May 2019 20:40:36 +0000 Subject: [PATCH 070/342] build: ignore proto files in test coverage (#108) --- packages/google-cloud-securitycenter/.nycrc | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/google-cloud-securitycenter/.nycrc b/packages/google-cloud-securitycenter/.nycrc index bfe4073a6ab..83a421a0628 100644 --- a/packages/google-cloud-securitycenter/.nycrc +++ b/packages/google-cloud-securitycenter/.nycrc @@ -10,6 +10,7 @@ "**/samples", "**/scripts", "**/src/**/v*/**/*.js", + "**/protos", "**/test", ".jsdoc.js", "**/.jsdoc.js", From d3273bb96fe51b9d004f1e7a91c80d2726bd552b Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Fri, 31 May 2019 19:36:27 +0000 Subject: [PATCH 071/342] fix: drop dependency on lodash.merge (#105) --- .../google-cloud-securitycenter/package.json | 8 +-- .../v1/run_asset_discovery_response.proto | 54 +++++++++++++++++ .../src/v1/doc/google/type/doc_expr.js | 51 ++++++++++++++++ .../src/v1/security_center_client.js | 60 +++++++++---------- .../src/v1beta1/doc/google/type/doc_expr.js | 51 ++++++++++++++++ .../src/v1beta1/security_center_client.js | 60 +++++++++---------- .../synth.metadata | 12 ++-- 7 files changed, 222 insertions(+), 74 deletions(-) create mode 100644 packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/run_asset_discovery_response.proto create mode 100644 packages/google-cloud-securitycenter/src/v1/doc/google/type/doc_expr.js create mode 100644 packages/google-cloud-securitycenter/src/v1beta1/doc/google/type/doc_expr.js diff --git a/packages/google-cloud-securitycenter/package.json b/packages/google-cloud-securitycenter/package.json index 979333d4fbf..35b0333f6aa 100644 --- a/packages/google-cloud-securitycenter/package.json +++ b/packages/google-cloud-securitycenter/package.json @@ -49,13 +49,13 @@ "eslint-config-prettier": "^4.0.0", "eslint-plugin-node": "^9.0.0", "eslint-plugin-prettier": "^3.0.0", - "jsdoc-baseline": "^0.1.0", "intelli-espower-loader": "^1.0.1", - "jsdoc": "^3.5.5", + "jsdoc": "^3.6.2", + "jsdoc-baseline": "^0.1.0", + "linkinator": "^1.4.2", "mocha": "^6.0.0", "nyc": "^14.0.0", "power-assert": "^1.4.4", - "prettier": "^1.7.4", - "linkinator": "^1.1.2" + "prettier": "^1.7.4" } } diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/run_asset_discovery_response.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/run_asset_discovery_response.proto new file mode 100644 index 00000000000..1cbba38e713 --- /dev/null +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/run_asset_discovery_response.proto @@ -0,0 +1,54 @@ +// Copyright 2019 Google LLC. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +syntax = "proto3"; + +package google.cloud.securitycenter.v1; + +import "google/protobuf/duration.proto"; +import "google/protobuf/timestamp.proto"; +import "google/api/annotations.proto"; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1;securitycenter"; +option java_multiple_files = true; +option java_package = "com.google.cloud.securitycenter.v1"; +option php_namespace = "Google\\Cloud\\SecurityCenter\\V1"; +option ruby_package = "Google::Cloud::SecurityCenter::V1"; + +// Response of asset discovery run +message RunAssetDiscoveryResponse { + // The state of an asset discovery run. + enum State { + // Asset discovery run state was unspecified. + STATE_UNSPECIFIED = 0; + + // Asset discovery run completed successfully. + COMPLETED = 1; + + // Asset discovery run was cancelled with tasks still pending, as another + // run for the same organization was started with a higher priority. + SUPERSEDED = 2; + + // Asset discovery run was killed and terminated. + TERMINATED = 3; + } + + // The state of an asset discovery run. + State state = 1; + + // The duration between asset discovery run start and end + google.protobuf.Duration duration = 2; +} diff --git a/packages/google-cloud-securitycenter/src/v1/doc/google/type/doc_expr.js b/packages/google-cloud-securitycenter/src/v1/doc/google/type/doc_expr.js new file mode 100644 index 00000000000..421a7ee9e6a --- /dev/null +++ b/packages/google-cloud-securitycenter/src/v1/doc/google/type/doc_expr.js @@ -0,0 +1,51 @@ +// Copyright 2019 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Note: this file is purely for documentation. Any contents are not expected +// to be loaded as the JS file. + +/** + * Represents an expression text. Example: + * + * title: "User account presence" + * description: "Determines whether the request has a user account" + * expression: "size(request.user) > 0" + * + * @property {string} expression + * Textual representation of an expression in + * Common Expression Language syntax. + * + * The application context of the containing message determines which + * well-known feature set of CEL is supported. + * + * @property {string} title + * An optional title for the expression, i.e. a short string describing + * its purpose. This can be used e.g. in UIs which allow to enter the + * expression. + * + * @property {string} description + * An optional description of the expression. This is a longer text which + * describes the expression, e.g. when hovered over it in a UI. + * + * @property {string} location + * An optional string indicating the location of the expression for error + * reporting, e.g. a file name and a position in the file. + * + * @typedef Expr + * @memberof google.type + * @see [google.type.Expr definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/type/expr.proto} + */ +const Expr = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; \ No newline at end of file diff --git a/packages/google-cloud-securitycenter/src/v1/security_center_client.js b/packages/google-cloud-securitycenter/src/v1/security_center_client.js index e5c473f449a..bde9ae37fe9 100644 --- a/packages/google-cloud-securitycenter/src/v1/security_center_client.js +++ b/packages/google-cloud-securitycenter/src/v1/security_center_client.js @@ -16,7 +16,6 @@ const gapicConfig = require('./security_center_client_config.json'); const gax = require('google-gax'); -const merge = require('lodash.merge'); const path = require('path'); const protobuf = require('protobufjs'); @@ -89,12 +88,9 @@ class SecurityCenterClient { } // Load the applicable protos. - const protos = merge( - {}, - gaxGrpc.loadProto( - path.join(__dirname, '..', '..', 'protos'), - 'google/cloud/securitycenter/v1/securitycenter_service.proto' - ) + const protos = gaxGrpc.loadProto( + path.join(__dirname, '..', '..', 'protos'), + ['google/cloud/securitycenter/v1/securitycenter_service.proto'] ); // This API contains "path templates"; forward-slash-separated @@ -304,7 +300,7 @@ class SecurityCenterClient { * This object should have the same structure as [Source]{@link google.cloud.securitycenter.v1.Source} * @param {Object} [options] * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. * @param {function(?Error, ?Object)} [callback] * The function which will be called with the result of the API call. * @@ -373,7 +369,7 @@ class SecurityCenterClient { * This object should have the same structure as [Finding]{@link google.cloud.securitycenter.v1.Finding} * @param {Object} [options] * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. * @param {function(?Error, ?Object)} [callback] * The function which will be called with the result of the API call. * @@ -434,7 +430,7 @@ class SecurityCenterClient { * See the operation documentation for the appropriate value for this field. * @param {Object} [options] * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. * @param {function(?Error, ?Object)} [callback] * The function which will be called with the result of the API call. * @@ -488,7 +484,7 @@ class SecurityCenterClient { * "organizations/[organization_id]/organizationSettings". * @param {Object} [options] * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. * @param {function(?Error, ?Object)} [callback] * The function which will be called with the result of the API call. * @@ -546,7 +542,7 @@ class SecurityCenterClient { * "organizations/[organization_id]/source/[source_id]". * @param {Object} [options] * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. * @param {function(?Error, ?Object)} [callback] * The function which will be called with the result of the API call. * @@ -700,7 +696,7 @@ class SecurityCenterClient { * resources in a page. * @param {Object} [options] * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. * @param {function(?Error, ?Array, ?Object, ?Object)} [callback] * The function which will be called with the result of the API call. * @@ -915,7 +911,7 @@ class SecurityCenterClient { * resources in a page. * @param {Object} [options] * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. * @returns {Stream} * An object stream which emits an object representing [GroupResult]{@link google.cloud.securitycenter.v1.GroupResult} on 'data' event. * @@ -1060,7 +1056,7 @@ class SecurityCenterClient { * resources in a page. * @param {Object} [options] * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. * @param {function(?Error, ?Array, ?Object, ?Object)} [callback] * The function which will be called with the result of the API call. * @@ -1272,7 +1268,7 @@ class SecurityCenterClient { * resources in a page. * @param {Object} [options] * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. * @returns {Stream} * An object stream which emits an object representing [GroupResult]{@link google.cloud.securitycenter.v1.GroupResult} on 'data' event. * @@ -1424,7 +1420,7 @@ class SecurityCenterClient { * resources in a page. * @param {Object} [options] * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. * @param {function(?Error, ?Array, ?Object, ?Object)} [callback] * The function which will be called with the result of the API call. * @@ -1637,7 +1633,7 @@ class SecurityCenterClient { * resources in a page. * @param {Object} [options] * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. * @returns {Stream} * An object stream which emits an object representing [ListAssetsResult]{@link google.cloud.securitycenter.v1.ListAssetsResult} on 'data' event. * @@ -1785,7 +1781,7 @@ class SecurityCenterClient { * resources in a page. * @param {Object} [options] * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. * @param {function(?Error, ?Array, ?Object, ?Object)} [callback] * The function which will be called with the result of the API call. * @@ -1996,7 +1992,7 @@ class SecurityCenterClient { * resources in a page. * @param {Object} [options] * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. * @returns {Stream} * An object stream which emits an object representing [ListFindingsResult]{@link google.cloud.securitycenter.v1.ListFindingsResult} on 'data' event. * @@ -2042,7 +2038,7 @@ class SecurityCenterClient { * resources in a page. * @param {Object} [options] * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. * @param {function(?Error, ?Array, ?Object, ?Object)} [callback] * The function which will be called with the result of the API call. * @@ -2154,7 +2150,7 @@ class SecurityCenterClient { * resources in a page. * @param {Object} [options] * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. * @returns {Stream} * An object stream which emits an object representing [Source]{@link google.cloud.securitycenter.v1.Source} on 'data' event. * @@ -2199,13 +2195,13 @@ class SecurityCenterClient { * "organizations/[organization_id]". * @param {Object} [options] * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. * @param {function(?Error, ?Object)} [callback] * The function which will be called with the result of the API call. * - * The second parameter to the callback is a [gax.Operation]{@link https://googleapis.github.io/gax-nodejs/Operation} object. + * The second parameter to the callback is a [gax.Operation]{@link https://googleapis.github.io/gax-nodejs/classes/Operation.html} object. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is a [gax.Operation]{@link https://googleapis.github.io/gax-nodejs/Operation} object. + * The first element of the array is a [gax.Operation]{@link https://googleapis.github.io/gax-nodejs/classes/Operation.html} object. * The promise has a method named "cancel" which cancels the ongoing API call. * * @example @@ -2307,7 +2303,7 @@ class SecurityCenterClient { * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} * @param {Object} [options] * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. * @param {function(?Error, ?Object)} [callback] * The function which will be called with the result of the API call. * @@ -2375,7 +2371,7 @@ class SecurityCenterClient { * This object should have the same structure as [Policy]{@link google.iam.v1.Policy} * @param {Object} [options] * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. * @param {function(?Error, ?Object)} [callback] * The function which will be called with the result of the API call. * @@ -2439,7 +2435,7 @@ class SecurityCenterClient { * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). * @param {Object} [options] * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. * @param {function(?Error, ?Object)} [callback] * The function which will be called with the result of the API call. * @@ -2515,7 +2511,7 @@ class SecurityCenterClient { * This object should have the same structure as [FieldMask]{@link google.protobuf.FieldMask} * @param {Object} [options] * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. * @param {function(?Error, ?Object)} [callback] * The function which will be called with the result of the API call. * @@ -2576,7 +2572,7 @@ class SecurityCenterClient { * This object should have the same structure as [FieldMask]{@link google.protobuf.FieldMask} * @param {Object} [options] * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. * @param {function(?Error, ?Object)} [callback] * The function which will be called with the result of the API call. * @@ -2641,7 +2637,7 @@ class SecurityCenterClient { * This object should have the same structure as [FieldMask]{@link google.protobuf.FieldMask} * @param {Object} [options] * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. * @param {function(?Error, ?Object)} [callback] * The function which will be called with the result of the API call. * @@ -2710,7 +2706,7 @@ class SecurityCenterClient { * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} * @param {Object} [options] * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. * @param {function(?Error, ?Object)} [callback] * The function which will be called with the result of the API call. * diff --git a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/type/doc_expr.js b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/type/doc_expr.js new file mode 100644 index 00000000000..421a7ee9e6a --- /dev/null +++ b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/type/doc_expr.js @@ -0,0 +1,51 @@ +// Copyright 2019 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Note: this file is purely for documentation. Any contents are not expected +// to be loaded as the JS file. + +/** + * Represents an expression text. Example: + * + * title: "User account presence" + * description: "Determines whether the request has a user account" + * expression: "size(request.user) > 0" + * + * @property {string} expression + * Textual representation of an expression in + * Common Expression Language syntax. + * + * The application context of the containing message determines which + * well-known feature set of CEL is supported. + * + * @property {string} title + * An optional title for the expression, i.e. a short string describing + * its purpose. This can be used e.g. in UIs which allow to enter the + * expression. + * + * @property {string} description + * An optional description of the expression. This is a longer text which + * describes the expression, e.g. when hovered over it in a UI. + * + * @property {string} location + * An optional string indicating the location of the expression for error + * reporting, e.g. a file name and a position in the file. + * + * @typedef Expr + * @memberof google.type + * @see [google.type.Expr definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/type/expr.proto} + */ +const Expr = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; \ No newline at end of file diff --git a/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.js b/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.js index 9c523111262..50946a0f634 100644 --- a/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.js +++ b/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.js @@ -16,7 +16,6 @@ const gapicConfig = require('./security_center_client_config.json'); const gax = require('google-gax'); -const merge = require('lodash.merge'); const path = require('path'); const protobuf = require('protobufjs'); @@ -89,12 +88,9 @@ class SecurityCenterClient { } // Load the applicable protos. - const protos = merge( - {}, - gaxGrpc.loadProto( - path.join(__dirname, '..', '..', 'protos'), - 'google/cloud/securitycenter/v1beta1/securitycenter_service.proto' - ) + const protos = gaxGrpc.loadProto( + path.join(__dirname, '..', '..', 'protos'), + ['google/cloud/securitycenter/v1beta1/securitycenter_service.proto'] ); // This API contains "path templates"; forward-slash-separated @@ -295,7 +291,7 @@ class SecurityCenterClient { * This object should have the same structure as [Source]{@link google.cloud.securitycenter.v1beta1.Source} * @param {Object} [options] * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. * @param {function(?Error, ?Object)} [callback] * The function which will be called with the result of the API call. * @@ -364,7 +360,7 @@ class SecurityCenterClient { * This object should have the same structure as [Finding]{@link google.cloud.securitycenter.v1beta1.Finding} * @param {Object} [options] * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. * @param {function(?Error, ?Object)} [callback] * The function which will be called with the result of the API call. * @@ -425,7 +421,7 @@ class SecurityCenterClient { * See the operation documentation for the appropriate value for this field. * @param {Object} [options] * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. * @param {function(?Error, ?Object)} [callback] * The function which will be called with the result of the API call. * @@ -479,7 +475,7 @@ class SecurityCenterClient { * "organizations/[organization_id]/organizationSettings". * @param {Object} [options] * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. * @param {function(?Error, ?Object)} [callback] * The function which will be called with the result of the API call. * @@ -537,7 +533,7 @@ class SecurityCenterClient { * "organizations/[organization_id]/source/[source_id]". * @param {Object} [options] * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. * @param {function(?Error, ?Object)} [callback] * The function which will be called with the result of the API call. * @@ -672,7 +668,7 @@ class SecurityCenterClient { * resources in a page. * @param {Object} [options] * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. * @param {function(?Error, ?Array, ?Object, ?Object)} [callback] * The function which will be called with the result of the API call. * @@ -868,7 +864,7 @@ class SecurityCenterClient { * resources in a page. * @param {Object} [options] * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. * @returns {Stream} * An object stream which emits an object representing [GroupResult]{@link google.cloud.securitycenter.v1beta1.GroupResult} on 'data' event. * @@ -970,7 +966,7 @@ class SecurityCenterClient { * resources in a page. * @param {Object} [options] * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. * @param {function(?Error, ?Array, ?Object, ?Object)} [callback] * The function which will be called with the result of the API call. * @@ -1139,7 +1135,7 @@ class SecurityCenterClient { * resources in a page. * @param {Object} [options] * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. * @returns {Stream} * An object stream which emits an object representing [GroupResult]{@link google.cloud.securitycenter.v1beta1.GroupResult} on 'data' event. * @@ -1268,7 +1264,7 @@ class SecurityCenterClient { * resources in a page. * @param {Object} [options] * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. * @param {function(?Error, ?Array, ?Object, ?Object)} [callback] * The function which will be called with the result of the API call. * @@ -1458,7 +1454,7 @@ class SecurityCenterClient { * resources in a page. * @param {Object} [options] * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. * @returns {Stream} * An object stream which emits an object representing [ListAssetsResult]{@link google.cloud.securitycenter.v1beta1.ListAssetsResult} on 'data' event. * @@ -1558,7 +1554,7 @@ class SecurityCenterClient { * resources in a page. * @param {Object} [options] * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. * @param {function(?Error, ?Array, ?Object, ?Object)} [callback] * The function which will be called with the result of the API call. * @@ -1721,7 +1717,7 @@ class SecurityCenterClient { * resources in a page. * @param {Object} [options] * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. * @returns {Stream} * An object stream which emits an object representing [Finding]{@link google.cloud.securitycenter.v1beta1.Finding} on 'data' event. * @@ -1767,7 +1763,7 @@ class SecurityCenterClient { * resources in a page. * @param {Object} [options] * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. * @param {function(?Error, ?Array, ?Object, ?Object)} [callback] * The function which will be called with the result of the API call. * @@ -1879,7 +1875,7 @@ class SecurityCenterClient { * resources in a page. * @param {Object} [options] * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. * @returns {Stream} * An object stream which emits an object representing [Source]{@link google.cloud.securitycenter.v1beta1.Source} on 'data' event. * @@ -1924,13 +1920,13 @@ class SecurityCenterClient { * "organizations/[organization_id]". * @param {Object} [options] * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. * @param {function(?Error, ?Object)} [callback] * The function which will be called with the result of the API call. * - * The second parameter to the callback is a [gax.Operation]{@link https://googleapis.github.io/gax-nodejs/Operation} object. + * The second parameter to the callback is a [gax.Operation]{@link https://googleapis.github.io/gax-nodejs/classes/Operation.html} object. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is a [gax.Operation]{@link https://googleapis.github.io/gax-nodejs/Operation} object. + * The first element of the array is a [gax.Operation]{@link https://googleapis.github.io/gax-nodejs/classes/Operation.html} object. * The promise has a method named "cancel" which cancels the ongoing API call. * * @example @@ -2032,7 +2028,7 @@ class SecurityCenterClient { * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} * @param {Object} [options] * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. * @param {function(?Error, ?Object)} [callback] * The function which will be called with the result of the API call. * @@ -2100,7 +2096,7 @@ class SecurityCenterClient { * This object should have the same structure as [Policy]{@link google.iam.v1.Policy} * @param {Object} [options] * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. * @param {function(?Error, ?Object)} [callback] * The function which will be called with the result of the API call. * @@ -2164,7 +2160,7 @@ class SecurityCenterClient { * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). * @param {Object} [options] * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. * @param {function(?Error, ?Object)} [callback] * The function which will be called with the result of the API call. * @@ -2235,7 +2231,7 @@ class SecurityCenterClient { * This object should have the same structure as [FieldMask]{@link google.protobuf.FieldMask} * @param {Object} [options] * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. * @param {function(?Error, ?Object)} [callback] * The function which will be called with the result of the API call. * @@ -2294,7 +2290,7 @@ class SecurityCenterClient { * This object should have the same structure as [FieldMask]{@link google.protobuf.FieldMask} * @param {Object} [options] * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. * @param {function(?Error, ?Object)} [callback] * The function which will be called with the result of the API call. * @@ -2357,7 +2353,7 @@ class SecurityCenterClient { * This object should have the same structure as [FieldMask]{@link google.protobuf.FieldMask} * @param {Object} [options] * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. * @param {function(?Error, ?Object)} [callback] * The function which will be called with the result of the API call. * @@ -2420,7 +2416,7 @@ class SecurityCenterClient { * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} * @param {Object} [options] * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. * @param {function(?Error, ?Object)} [callback] * The function which will be called with the result of the API call. * diff --git a/packages/google-cloud-securitycenter/synth.metadata b/packages/google-cloud-securitycenter/synth.metadata index 0f302311c77..8e5ff10490a 100644 --- a/packages/google-cloud-securitycenter/synth.metadata +++ b/packages/google-cloud-securitycenter/synth.metadata @@ -1,26 +1,26 @@ { - "updateTime": "2019-05-17T19:50:31.193162Z", + "updateTime": "2019-05-23T20:32:45.718938Z", "sources": [ { "generator": { "name": "artman", - "version": "0.19.0", - "dockerImage": "googleapis/artman@sha256:d3df563538225ac6caac45d8ad86499500211d1bcb2536955a6dbda15e1b368e" + "version": "0.20.0", + "dockerImage": "googleapis/artman@sha256:3246adac900f4bdbd62920e80de2e5877380e44036b3feae13667ec255ebf5ec" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "99efb1441b7c2aeb75c69f8baf9b61d4221bb744", - "internalRef": "248724297" + "sha": "6a2f0244d6a07f2683e4a8cec514425bb27cfa03", + "internalRef": "249677018" } }, { "template": { "name": "node_library", "origin": "synthtool.gcp", - "version": "2019.4.10" + "version": "2019.5.2" } } ], From 02b252275bb7d5d78f49eace44a7f8dc4b6d3fae Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Wed, 5 Jun 2019 08:47:03 -0700 Subject: [PATCH 072/342] feat: support apiEndpoint override in client constructor (#112) --- .../src/v1/security_center_client.js | 14 ++++++++++- .../src/v1beta1/security_center_client.js | 14 ++++++++++- .../synth.metadata | 10 ++++---- .../test/gapic-v1.js | 23 +++++++++++++++++++ .../test/gapic-v1beta1.js | 23 +++++++++++++++++++ 5 files changed, 77 insertions(+), 7 deletions(-) diff --git a/packages/google-cloud-securitycenter/src/v1/security_center_client.js b/packages/google-cloud-securitycenter/src/v1/security_center_client.js index bde9ae37fe9..42ef8b041f3 100644 --- a/packages/google-cloud-securitycenter/src/v1/security_center_client.js +++ b/packages/google-cloud-securitycenter/src/v1/security_center_client.js @@ -56,14 +56,18 @@ class SecurityCenterClient { * API remote host. */ constructor(opts) { + opts = opts || {}; this._descriptors = {}; + const servicePath = + opts.servicePath || opts.apiEndpoint || this.constructor.servicePath; + // Ensure that options include the service address and port. opts = Object.assign( { clientConfig: {}, port: this.constructor.port, - servicePath: this.constructor.servicePath, + servicePath, }, opts ); @@ -257,6 +261,14 @@ class SecurityCenterClient { return 'securitycenter.googleapis.com'; } + /** + * The DNS address for this API service - same as servicePath(), + * exists for compatibility reasons. + */ + static get apiEndpoint() { + return 'securitycenter.googleapis.com'; + } + /** * The port for this API service. */ diff --git a/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.js b/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.js index 50946a0f634..2920b7b8dab 100644 --- a/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.js +++ b/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.js @@ -56,14 +56,18 @@ class SecurityCenterClient { * API remote host. */ constructor(opts) { + opts = opts || {}; this._descriptors = {}; + const servicePath = + opts.servicePath || opts.apiEndpoint || this.constructor.servicePath; + // Ensure that options include the service address and port. opts = Object.assign( { clientConfig: {}, port: this.constructor.port, - servicePath: this.constructor.servicePath, + servicePath, }, opts ); @@ -248,6 +252,14 @@ class SecurityCenterClient { return 'securitycenter.googleapis.com'; } + /** + * The DNS address for this API service - same as servicePath(), + * exists for compatibility reasons. + */ + static get apiEndpoint() { + return 'securitycenter.googleapis.com'; + } + /** * The port for this API service. */ diff --git a/packages/google-cloud-securitycenter/synth.metadata b/packages/google-cloud-securitycenter/synth.metadata index 8e5ff10490a..f8ea7324527 100644 --- a/packages/google-cloud-securitycenter/synth.metadata +++ b/packages/google-cloud-securitycenter/synth.metadata @@ -1,19 +1,19 @@ { - "updateTime": "2019-05-23T20:32:45.718938Z", + "updateTime": "2019-06-05T14:25:08.839987Z", "sources": [ { "generator": { "name": "artman", - "version": "0.20.0", - "dockerImage": "googleapis/artman@sha256:3246adac900f4bdbd62920e80de2e5877380e44036b3feae13667ec255ebf5ec" + "version": "0.23.1", + "dockerImage": "googleapis/artman@sha256:9d5cae1454da64ac3a87028f8ef486b04889e351c83bb95e83b8fab3959faed0" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "6a2f0244d6a07f2683e4a8cec514425bb27cfa03", - "internalRef": "249677018" + "sha": "47c142a7cecc6efc9f6f8af804b8be55392b795b", + "internalRef": "251635729" } }, { diff --git a/packages/google-cloud-securitycenter/test/gapic-v1.js b/packages/google-cloud-securitycenter/test/gapic-v1.js index e83ba71cfa6..10c065cdb8e 100644 --- a/packages/google-cloud-securitycenter/test/gapic-v1.js +++ b/packages/google-cloud-securitycenter/test/gapic-v1.js @@ -23,6 +23,29 @@ const error = new Error(); error.code = FAKE_STATUS_CODE; describe('SecurityCenterClient', () => { + it('has servicePath', () => { + const servicePath = + securityCenterModule.v1.SecurityCenterClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = + securityCenterModule.v1.SecurityCenterClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = securityCenterModule.v1.SecurityCenterClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no options', () => { + const client = new securityCenterModule.v1.SecurityCenterClient(); + assert(client); + }); + describe('createSource', () => { it('invokes createSource without error', done => { const client = new securityCenterModule.v1.SecurityCenterClient({ diff --git a/packages/google-cloud-securitycenter/test/gapic-v1beta1.js b/packages/google-cloud-securitycenter/test/gapic-v1beta1.js index 783cb9a339b..71139ae8301 100644 --- a/packages/google-cloud-securitycenter/test/gapic-v1beta1.js +++ b/packages/google-cloud-securitycenter/test/gapic-v1beta1.js @@ -23,6 +23,29 @@ const error = new Error(); error.code = FAKE_STATUS_CODE; describe('SecurityCenterClient', () => { + it('has servicePath', () => { + const servicePath = + securityCenterModule.v1beta1.SecurityCenterClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = + securityCenterModule.v1beta1.SecurityCenterClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = securityCenterModule.v1beta1.SecurityCenterClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no options', () => { + const client = new securityCenterModule.v1beta1.SecurityCenterClient(); + assert(client); + }); + describe('createSource', () => { it('invokes createSource without error', done => { const client = new securityCenterModule.v1beta1.SecurityCenterClient({ From 67958137ccb869a6a8764d69cfb65df131cf76ef Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Wed, 12 Jun 2019 08:09:29 -0700 Subject: [PATCH 073/342] docs: update return type in jsdoc for Buffers (#113) --- .../src/v1/doc/google/iam/v1/doc_policy.js | 2 +- .../src/v1/doc/google/protobuf/doc_any.js | 2 +- .../src/v1beta1/doc/google/iam/v1/doc_policy.js | 2 +- .../src/v1beta1/doc/google/protobuf/doc_any.js | 2 +- packages/google-cloud-securitycenter/synth.metadata | 10 +++++----- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/packages/google-cloud-securitycenter/src/v1/doc/google/iam/v1/doc_policy.js b/packages/google-cloud-securitycenter/src/v1/doc/google/iam/v1/doc_policy.js index 09c3a5bdc56..e58c2122510 100644 --- a/packages/google-cloud-securitycenter/src/v1/doc/google/iam/v1/doc_policy.js +++ b/packages/google-cloud-securitycenter/src/v1/doc/google/iam/v1/doc_policy.js @@ -71,7 +71,7 @@ * * This object should have the same structure as [Binding]{@link google.iam.v1.Binding} * - * @property {string} etag + * @property {Buffer} etag * `etag` is used for optimistic concurrency control as a way to help * prevent simultaneous updates of a policy from overwriting each other. * It is strongly suggested that systems make use of the `etag` in the diff --git a/packages/google-cloud-securitycenter/src/v1/doc/google/protobuf/doc_any.js b/packages/google-cloud-securitycenter/src/v1/doc/google/protobuf/doc_any.js index 9ff5d007807..cdd2fc80e49 100644 --- a/packages/google-cloud-securitycenter/src/v1/doc/google/protobuf/doc_any.js +++ b/packages/google-cloud-securitycenter/src/v1/doc/google/protobuf/doc_any.js @@ -125,7 +125,7 @@ * Schemes other than `http`, `https` (or the empty scheme) might be * used with implementation specific semantics. * - * @property {string} value + * @property {Buffer} value * Must be a valid serialized protocol buffer of the above specified type. * * @typedef Any diff --git a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/iam/v1/doc_policy.js b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/iam/v1/doc_policy.js index 09c3a5bdc56..e58c2122510 100644 --- a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/iam/v1/doc_policy.js +++ b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/iam/v1/doc_policy.js @@ -71,7 +71,7 @@ * * This object should have the same structure as [Binding]{@link google.iam.v1.Binding} * - * @property {string} etag + * @property {Buffer} etag * `etag` is used for optimistic concurrency control as a way to help * prevent simultaneous updates of a policy from overwriting each other. * It is strongly suggested that systems make use of the `etag` in the diff --git a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/protobuf/doc_any.js b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/protobuf/doc_any.js index 9ff5d007807..cdd2fc80e49 100644 --- a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/protobuf/doc_any.js +++ b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/protobuf/doc_any.js @@ -125,7 +125,7 @@ * Schemes other than `http`, `https` (or the empty scheme) might be * used with implementation specific semantics. * - * @property {string} value + * @property {Buffer} value * Must be a valid serialized protocol buffer of the above specified type. * * @typedef Any diff --git a/packages/google-cloud-securitycenter/synth.metadata b/packages/google-cloud-securitycenter/synth.metadata index f8ea7324527..59fa8cb99c4 100644 --- a/packages/google-cloud-securitycenter/synth.metadata +++ b/packages/google-cloud-securitycenter/synth.metadata @@ -1,19 +1,19 @@ { - "updateTime": "2019-06-05T14:25:08.839987Z", + "updateTime": "2019-06-12T11:23:37.073244Z", "sources": [ { "generator": { "name": "artman", - "version": "0.23.1", - "dockerImage": "googleapis/artman@sha256:9d5cae1454da64ac3a87028f8ef486b04889e351c83bb95e83b8fab3959faed0" + "version": "0.24.1", + "dockerImage": "googleapis/artman@sha256:6018498e15310260dc9b03c9d576608908ed9fbabe42e1494ff3d827fea27b19" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "47c142a7cecc6efc9f6f8af804b8be55392b795b", - "internalRef": "251635729" + "sha": "f117dac435e96ebe58d85280a3faf2350c4d4219", + "internalRef": "252714985" } }, { From f40887013875fd457a7c895ba75aa6a666f953c3 Mon Sep 17 00:00:00 2001 From: "Benjamin E. Coe" Date: Wed, 12 Jun 2019 22:10:19 -0700 Subject: [PATCH 074/342] fix(docs): move to new client docs URL (#114) --- packages/google-cloud-securitycenter/.repo-metadata.json | 4 ++-- packages/google-cloud-securitycenter/README.md | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/google-cloud-securitycenter/.repo-metadata.json b/packages/google-cloud-securitycenter/.repo-metadata.json index 96c7424b02f..d632c7f4cc2 100644 --- a/packages/google-cloud-securitycenter/.repo-metadata.json +++ b/packages/google-cloud-securitycenter/.repo-metadata.json @@ -2,7 +2,7 @@ "name": "security-center", "name_pretty": "Google Cloud Security Command Center", "product_documentation": "https://cloud.google.com/security-command-center", - "client_documentation": "https://cloud.google.com/nodejs/docs/reference/security-center/latest/", + "client_documentation": "https://googleapis.dev/nodejs/security-center/latest", "issue_tracker": "https://issuetracker.google.com/savedsearches/559748", "release_level": "beta", "language": "nodejs", @@ -10,4 +10,4 @@ "distribution_name": "@google-cloud/security-center", "api_id": "securitycenter.googleapis.com", "requires_billing": true -} +} \ No newline at end of file diff --git a/packages/google-cloud-securitycenter/README.md b/packages/google-cloud-securitycenter/README.md index 142af8bbe39..138aeb0d3d2 100644 --- a/packages/google-cloud-securitycenter/README.md +++ b/packages/google-cloud-securitycenter/README.md @@ -127,7 +127,7 @@ Apache Version 2.0 See [LICENSE](https://github.com/googleapis/nodejs-security-center/blob/master/LICENSE) -[client-docs]: https://cloud.google.com/nodejs/docs/reference/security-center/latest/ +[client-docs]: https://googleapis.dev/nodejs/security-center/latest [product-docs]: https://cloud.google.com/security-command-center [shell_img]: https://gstatic.com/cloudssh/images/open-btn.png [projects]: https://console.cloud.google.com/project From 8378e3c4833181069dbc84cc6ac1d9e03854c797 Mon Sep 17 00:00:00 2001 From: "Benjamin E. Coe" Date: Tue, 18 Jun 2019 13:38:43 -0700 Subject: [PATCH 075/342] build: switch to GitHub magic proxy (#115) --- packages/google-cloud-securitycenter/synth.metadata | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/google-cloud-securitycenter/synth.metadata b/packages/google-cloud-securitycenter/synth.metadata index 59fa8cb99c4..41933c15d6c 100644 --- a/packages/google-cloud-securitycenter/synth.metadata +++ b/packages/google-cloud-securitycenter/synth.metadata @@ -1,19 +1,19 @@ { - "updateTime": "2019-06-12T11:23:37.073244Z", + "updateTime": "2019-06-18T01:04:11.762881Z", "sources": [ { "generator": { "name": "artman", - "version": "0.24.1", - "dockerImage": "googleapis/artman@sha256:6018498e15310260dc9b03c9d576608908ed9fbabe42e1494ff3d827fea27b19" + "version": "0.26.0", + "dockerImage": "googleapis/artman@sha256:6db0735b0d3beec5b887153a2a7c7411fc7bb53f73f6f389a822096bd14a3a15" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "f117dac435e96ebe58d85280a3faf2350c4d4219", - "internalRef": "252714985" + "sha": "384aa843867c4d17756d14a01f047b6368494d32", + "internalRef": "253675319" } }, { From a0765a3c4ea04b3b24d65088a9070c9e626e326a Mon Sep 17 00:00:00 2001 From: "Benjamin E. Coe" Date: Tue, 25 Jun 2019 16:42:37 -0700 Subject: [PATCH 076/342] fix(docs): link to reference docs section on googleapis.dev (#117) * fix(docs): reference docs should link to section of googleapis.dev with API reference * fix(docs): make anchors work in jsdoc --- packages/google-cloud-securitycenter/.jsdoc.js | 3 +++ packages/google-cloud-securitycenter/README.md | 6 ++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-securitycenter/.jsdoc.js b/packages/google-cloud-securitycenter/.jsdoc.js index a67138482f6..43a96ae8a57 100644 --- a/packages/google-cloud-securitycenter/.jsdoc.js +++ b/packages/google-cloud-securitycenter/.jsdoc.js @@ -41,5 +41,8 @@ module.exports = { sourceFiles: false, systemName: '@google-cloud/security-center', theme: 'lumen' + }, + markdown: { + idInHeadings: true } }; diff --git a/packages/google-cloud-securitycenter/README.md b/packages/google-cloud-securitycenter/README.md index 138aeb0d3d2..9b8819b9479 100644 --- a/packages/google-cloud-securitycenter/README.md +++ b/packages/google-cloud-securitycenter/README.md @@ -127,10 +127,12 @@ Apache Version 2.0 See [LICENSE](https://github.com/googleapis/nodejs-security-center/blob/master/LICENSE) -[client-docs]: https://googleapis.dev/nodejs/security-center/latest +[client-docs]: https://googleapis.dev/nodejs/security-center/latest#reference [product-docs]: https://cloud.google.com/security-command-center [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=securitycenter.googleapis.com -[auth]: https://cloud.google.com/docs/authentication/getting-started \ No newline at end of file +[auth]: https://cloud.google.com/docs/authentication/getting-started + + From 5f65427cd6234865383fb43b9e663c8724022d78 Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Fri, 28 Jun 2019 11:27:33 -0700 Subject: [PATCH 077/342] build: use config file for linkinator (#118) --- .../google-cloud-securitycenter/linkinator.config.json | 7 +++++++ packages/google-cloud-securitycenter/package.json | 4 ++-- 2 files changed, 9 insertions(+), 2 deletions(-) create mode 100644 packages/google-cloud-securitycenter/linkinator.config.json diff --git a/packages/google-cloud-securitycenter/linkinator.config.json b/packages/google-cloud-securitycenter/linkinator.config.json new file mode 100644 index 00000000000..d780d6bfff5 --- /dev/null +++ b/packages/google-cloud-securitycenter/linkinator.config.json @@ -0,0 +1,7 @@ +{ + "recurse": true, + "skip": [ + "https://codecov.io/gh/googleapis/", + "www.googleapis.com" + ] +} diff --git a/packages/google-cloud-securitycenter/package.json b/packages/google-cloud-securitycenter/package.json index 35b0333f6aa..d3371b61881 100644 --- a/packages/google-cloud-securitycenter/package.json +++ b/packages/google-cloud-securitycenter/package.json @@ -35,7 +35,7 @@ "test-no-cover": "mocha test/*.js", "test": "npm run cover", "fix": "eslint --fix '**/*.js'", - "docs-test": "linkinator docs -r --skip www.googleapis.com", + "docs-test": "linkinator docs", "predocs-test": "npm run docs" }, "dependencies": { @@ -52,7 +52,7 @@ "intelli-espower-loader": "^1.0.1", "jsdoc": "^3.6.2", "jsdoc-baseline": "^0.1.0", - "linkinator": "^1.4.2", + "linkinator": "^1.5.0", "mocha": "^6.0.0", "nyc": "^14.0.0", "power-assert": "^1.4.4", From 5c04ef863829da2e68f0001f35e5db61a26d6503 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Tue, 2 Jul 2019 15:00:49 -0700 Subject: [PATCH 078/342] fix: import run_asset_discovery_response.proto (#119) --- .../v1/securitycenter_service.proto | 1 + .../samples/.eslintrc.yml | 1 + .../google-cloud-securitycenter/src/index.js | 4 +++ .../v1/doc/google/iam/v1/doc_iam_policy.js | 6 ++++ .../src/v1/doc/google/iam/v1/doc_options.js | 33 +++++++++++++++++++ .../src/v1/security_center_client.js | 5 +++ .../doc/google/iam/v1/doc_iam_policy.js | 6 ++++ .../v1beta1/doc/google/iam/v1/doc_options.js | 33 +++++++++++++++++++ .../src/v1beta1/security_center_client.js | 5 +++ .../synth.metadata | 10 +++--- packages/google-cloud-securitycenter/synth.py | 14 ++++++++ 11 files changed, 113 insertions(+), 5 deletions(-) create mode 100644 packages/google-cloud-securitycenter/src/v1/doc/google/iam/v1/doc_options.js create mode 100644 packages/google-cloud-securitycenter/src/v1beta1/doc/google/iam/v1/doc_options.js diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/securitycenter_service.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/securitycenter_service.proto index d75be44b725..bcb4e863df6 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/securitycenter_service.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/securitycenter_service.proto @@ -21,6 +21,7 @@ import "google/api/annotations.proto"; import "google/cloud/securitycenter/v1/asset.proto"; import "google/cloud/securitycenter/v1/finding.proto"; import "google/cloud/securitycenter/v1/organization_settings.proto"; +import "google/cloud/securitycenter/v1/run_asset_discovery_response.proto"; import "google/cloud/securitycenter/v1/security_marks.proto"; import "google/cloud/securitycenter/v1/source.proto"; import "google/iam/v1/iam_policy.proto"; diff --git a/packages/google-cloud-securitycenter/samples/.eslintrc.yml b/packages/google-cloud-securitycenter/samples/.eslintrc.yml index 0aa37ac630e..59a8aeb576b 100644 --- a/packages/google-cloud-securitycenter/samples/.eslintrc.yml +++ b/packages/google-cloud-securitycenter/samples/.eslintrc.yml @@ -2,3 +2,4 @@ rules: no-console: off node/no-missing-require: off + no-warning-comments: off \ No newline at end of file diff --git a/packages/google-cloud-securitycenter/src/index.js b/packages/google-cloud-securitycenter/src/index.js index e6a09df2331..93a7d9ae877 100644 --- a/packages/google-cloud-securitycenter/src/index.js +++ b/packages/google-cloud-securitycenter/src/index.js @@ -15,6 +15,10 @@ /** * @namespace google */ +/** + * @namespace google.type + */ + /** * @namespace google.cloud */ diff --git a/packages/google-cloud-securitycenter/src/v1/doc/google/iam/v1/doc_iam_policy.js b/packages/google-cloud-securitycenter/src/v1/doc/google/iam/v1/doc_iam_policy.js index d675b1b0d54..15b6fb823d4 100644 --- a/packages/google-cloud-securitycenter/src/v1/doc/google/iam/v1/doc_iam_policy.js +++ b/packages/google-cloud-securitycenter/src/v1/doc/google/iam/v1/doc_iam_policy.js @@ -45,6 +45,12 @@ const SetIamPolicyRequest = { * REQUIRED: The resource for which the policy is being requested. * See the operation documentation for the appropriate value for this field. * + * @property {Object} options + * OPTIONAL: A `GetPolicyOptions` object for specifying options to + * `GetIamPolicy`. This field is only used by Cloud IAM. + * + * This object should have the same structure as [GetPolicyOptions]{@link google.iam.v1.GetPolicyOptions} + * * @typedef GetIamPolicyRequest * @memberof google.iam.v1 * @see [google.iam.v1.GetIamPolicyRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/iam/v1/iam_policy.proto} diff --git a/packages/google-cloud-securitycenter/src/v1/doc/google/iam/v1/doc_options.js b/packages/google-cloud-securitycenter/src/v1/doc/google/iam/v1/doc_options.js new file mode 100644 index 00000000000..e4166f39254 --- /dev/null +++ b/packages/google-cloud-securitycenter/src/v1/doc/google/iam/v1/doc_options.js @@ -0,0 +1,33 @@ +// Copyright 2019 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Note: this file is purely for documentation. Any contents are not expected +// to be loaded as the JS file. + +/** + * Encapsulates settings provided to GetIamPolicy. + * + * @property {number} requestedPolicyVersion + * Optional. The policy format version to be returned. + * Acceptable values are 0 and 1. + * If the value is 0, or the field is omitted, policy format version 1 will be + * returned. + * + * @typedef GetPolicyOptions + * @memberof google.iam.v1 + * @see [google.iam.v1.GetPolicyOptions definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/iam/v1/options.proto} + */ +const GetPolicyOptions = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; \ No newline at end of file diff --git a/packages/google-cloud-securitycenter/src/v1/security_center_client.js b/packages/google-cloud-securitycenter/src/v1/security_center_client.js index 42ef8b041f3..de0a471cba3 100644 --- a/packages/google-cloud-securitycenter/src/v1/security_center_client.js +++ b/packages/google-cloud-securitycenter/src/v1/security_center_client.js @@ -440,6 +440,11 @@ class SecurityCenterClient { * @param {string} request.resource * REQUIRED: The resource for which the policy is being requested. * See the operation documentation for the appropriate value for this field. + * @param {Object} [request.options] + * OPTIONAL: A `GetPolicyOptions` object for specifying options to + * `GetIamPolicy`. This field is only used by Cloud IAM. + * + * This object should have the same structure as [GetPolicyOptions]{@link google.iam.v1.GetPolicyOptions} * @param {Object} [options] * Optional parameters. You can override the default settings for this call, e.g, timeout, * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. diff --git a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/iam/v1/doc_iam_policy.js b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/iam/v1/doc_iam_policy.js index d675b1b0d54..15b6fb823d4 100644 --- a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/iam/v1/doc_iam_policy.js +++ b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/iam/v1/doc_iam_policy.js @@ -45,6 +45,12 @@ const SetIamPolicyRequest = { * REQUIRED: The resource for which the policy is being requested. * See the operation documentation for the appropriate value for this field. * + * @property {Object} options + * OPTIONAL: A `GetPolicyOptions` object for specifying options to + * `GetIamPolicy`. This field is only used by Cloud IAM. + * + * This object should have the same structure as [GetPolicyOptions]{@link google.iam.v1.GetPolicyOptions} + * * @typedef GetIamPolicyRequest * @memberof google.iam.v1 * @see [google.iam.v1.GetIamPolicyRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/iam/v1/iam_policy.proto} diff --git a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/iam/v1/doc_options.js b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/iam/v1/doc_options.js new file mode 100644 index 00000000000..e4166f39254 --- /dev/null +++ b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/iam/v1/doc_options.js @@ -0,0 +1,33 @@ +// Copyright 2019 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Note: this file is purely for documentation. Any contents are not expected +// to be loaded as the JS file. + +/** + * Encapsulates settings provided to GetIamPolicy. + * + * @property {number} requestedPolicyVersion + * Optional. The policy format version to be returned. + * Acceptable values are 0 and 1. + * If the value is 0, or the field is omitted, policy format version 1 will be + * returned. + * + * @typedef GetPolicyOptions + * @memberof google.iam.v1 + * @see [google.iam.v1.GetPolicyOptions definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/iam/v1/options.proto} + */ +const GetPolicyOptions = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; \ No newline at end of file diff --git a/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.js b/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.js index 2920b7b8dab..463fb2f9252 100644 --- a/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.js +++ b/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.js @@ -431,6 +431,11 @@ class SecurityCenterClient { * @param {string} request.resource * REQUIRED: The resource for which the policy is being requested. * See the operation documentation for the appropriate value for this field. + * @param {Object} [request.options] + * OPTIONAL: A `GetPolicyOptions` object for specifying options to + * `GetIamPolicy`. This field is only used by Cloud IAM. + * + * This object should have the same structure as [GetPolicyOptions]{@link google.iam.v1.GetPolicyOptions} * @param {Object} [options] * Optional parameters. You can override the default settings for this call, e.g, timeout, * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. diff --git a/packages/google-cloud-securitycenter/synth.metadata b/packages/google-cloud-securitycenter/synth.metadata index 41933c15d6c..2f4e6fd0f85 100644 --- a/packages/google-cloud-securitycenter/synth.metadata +++ b/packages/google-cloud-securitycenter/synth.metadata @@ -1,19 +1,19 @@ { - "updateTime": "2019-06-18T01:04:11.762881Z", + "updateTime": "2019-07-02T21:50:39.781012Z", "sources": [ { "generator": { "name": "artman", - "version": "0.26.0", - "dockerImage": "googleapis/artman@sha256:6db0735b0d3beec5b887153a2a7c7411fc7bb53f73f6f389a822096bd14a3a15" + "version": "0.29.3", + "dockerImage": "googleapis/artman@sha256:8900f94a81adaab0238965aa8a7b3648791f4f3a95ee65adc6a56cfcc3753101" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "384aa843867c4d17756d14a01f047b6368494d32", - "internalRef": "253675319" + "sha": "69916b6ffbb7717fa009033351777d0c9909fb79", + "internalRef": "256241904" } }, { diff --git a/packages/google-cloud-securitycenter/synth.py b/packages/google-cloud-securitycenter/synth.py index cb7dfb86a34..c387660714a 100644 --- a/packages/google-cloud-securitycenter/synth.py +++ b/packages/google-cloud-securitycenter/synth.py @@ -35,6 +35,20 @@ r"\[\\p\{L\}\\p\{N\}\]\(https:\/\/cloud\.google\.com\{\\p\{L\}\\p\{N\}_- \]\{0\,30\}\[\\p\{L\}\\p\{N\}\]\)\?", r"`\[\p{L}\p{N}]({\p{L}\p{N}_- ]{0,30}[\p{L}\p{N}])?`") +# cleanup some hiccups in jsdoc comments. +s.replace("src/index.js", +r"""\/\*\* + \* @namespace google + \*/""", +r""" +/** + * @namespace google + */ +/** + * @namespace google.type + */ +""") + # [START fix-dead-link] s.replace('**/doc/google/protobuf/doc_timestamp.js', 'https:\/\/cloud\.google\.com[\s\*]*http:\/\/(.*)[\s\*]*\)', From adb50b94cf042e31413b541f7bfd204289fa83cf Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Tue, 2 Jul 2019 15:17:23 -0700 Subject: [PATCH 079/342] chore: release 1.0.0 (#120) * updated CHANGELOG.md [ci skip] * updated package.json [ci skip] * updated samples/package.json [ci skip] --- .../google-cloud-securitycenter/CHANGELOG.md | 29 ++++++++++++++++++- .../google-cloud-securitycenter/package.json | 2 +- .../samples/package.json | 2 +- 3 files changed, 30 insertions(+), 3 deletions(-) diff --git a/packages/google-cloud-securitycenter/CHANGELOG.md b/packages/google-cloud-securitycenter/CHANGELOG.md index a653c02b50d..f1628fb894f 100644 --- a/packages/google-cloud-securitycenter/CHANGELOG.md +++ b/packages/google-cloud-securitycenter/CHANGELOG.md @@ -4,6 +4,34 @@ [1]: https://www.npmjs.com/package/@google-cloud/security-center?activeTab=versions +## [1.0.0](https://www.github.com/googleapis/nodejs-security-center/compare/v0.3.0...v1.0.0) (2019-07-02) + + +### ⚠ BREAKING CHANGES + +* upgrade engines field to >=8.10.0 (#93) + +### Bug Fixes + +* **deps:** update dependency google-gax to ^0.26.0 ([#91](https://www.github.com/googleapis/nodejs-security-center/issues/91)) ([b4708af](https://www.github.com/googleapis/nodejs-security-center/commit/b4708af)) +* **deps:** update dependency google-gax to v1 ([#100](https://www.github.com/googleapis/nodejs-security-center/issues/100)) ([10e455c](https://www.github.com/googleapis/nodejs-security-center/commit/10e455c)) +* drop dependency on lodash.merge ([#105](https://www.github.com/googleapis/nodejs-security-center/issues/105)) ([093822e](https://www.github.com/googleapis/nodejs-security-center/commit/093822e)) +* **docs:** link to reference docs section on googleapis.dev ([#117](https://www.github.com/googleapis/nodejs-security-center/issues/117)) ([df786bf](https://www.github.com/googleapis/nodejs-security-center/commit/df786bf)) +* **docs:** move to new client docs URL ([#114](https://www.github.com/googleapis/nodejs-security-center/issues/114)) ([c8e406e](https://www.github.com/googleapis/nodejs-security-center/commit/c8e406e)) +* import run_asset_discovery_response.proto ([#119](https://www.github.com/googleapis/nodejs-security-center/issues/119)) ([8fed12f](https://www.github.com/googleapis/nodejs-security-center/commit/8fed12f)) +* include 'x-goog-request-params' header in requests ([#77](https://www.github.com/googleapis/nodejs-security-center/issues/77)) ([2556bb7](https://www.github.com/googleapis/nodejs-security-center/commit/2556bb7)) + + +### Build System + +* upgrade engines field to >=8.10.0 ([#93](https://www.github.com/googleapis/nodejs-security-center/issues/93)) ([3714719](https://www.github.com/googleapis/nodejs-security-center/commit/3714719)) + + +### Features + +* asset path template & matchers ([#84](https://www.github.com/googleapis/nodejs-security-center/issues/84)) ([3c4bc9a](https://www.github.com/googleapis/nodejs-security-center/commit/3c4bc9a)) +* support apiEndpoint override in client constructor ([#112](https://www.github.com/googleapis/nodejs-security-center/issues/112)) ([58ddc40](https://www.github.com/googleapis/nodejs-security-center/commit/58ddc40)) + ## v0.3.0 03-14-2019 07:55 PDT @@ -104,4 +132,3 @@ This is the initial release of the Cloud Security Center API Node.js client libr - remove CONTRIBUTORS - license header on npm-install-retry - add more scaffolding - diff --git a/packages/google-cloud-securitycenter/package.json b/packages/google-cloud-securitycenter/package.json index d3371b61881..df6b0ada64b 100644 --- a/packages/google-cloud-securitycenter/package.json +++ b/packages/google-cloud-securitycenter/package.json @@ -1,7 +1,7 @@ { "name": "@google-cloud/security-center", "description": "Cloud Security Command Center API client for Node.js", - "version": "0.3.0", + "version": "1.0.0", "license": "Apache-2.0", "author": "Google LLC", "engines": { diff --git a/packages/google-cloud-securitycenter/samples/package.json b/packages/google-cloud-securitycenter/samples/package.json index fd6b67bad4a..d708220b17f 100644 --- a/packages/google-cloud-securitycenter/samples/package.json +++ b/packages/google-cloud-securitycenter/samples/package.json @@ -10,7 +10,7 @@ }, "license": "Apache-2.0", "dependencies": { - "@google-cloud/security-center": "^0.3.0" + "@google-cloud/security-center": "^1.0.0" }, "devDependencies": { "chai": "^4.2.0", From 995efde94556724bed6d65ec8ac467561674e43b Mon Sep 17 00:00:00 2001 From: emkornfield Date: Wed, 3 Jul 2019 08:29:31 -0700 Subject: [PATCH 080/342] docs(samples): add a comprehensive set of samples (#82) --- packages/google-cloud-securitycenter/samples/package.json | 6 +++--- packages/google-cloud-securitycenter/synth.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/google-cloud-securitycenter/samples/package.json b/packages/google-cloud-securitycenter/samples/package.json index d708220b17f..fb179903e4a 100644 --- a/packages/google-cloud-securitycenter/samples/package.json +++ b/packages/google-cloud-securitycenter/samples/package.json @@ -1,12 +1,11 @@ { "name": "nodejs-security-center-samples", - "main": "quickstart.js", "private": true, "engines": { "node": ">=8" }, "scripts": { - "test": "mocha system-test" + "test": "mocha system-test/ --recursive --timeout 6000000" }, "license": "Apache-2.0", "dependencies": { @@ -14,6 +13,7 @@ }, "devDependencies": { "chai": "^4.2.0", - "mocha": "^6.0.0" + "execa": "^1.0.0", + "mocha": "^6.0.2" } } diff --git a/packages/google-cloud-securitycenter/synth.py b/packages/google-cloud-securitycenter/synth.py index c387660714a..6f8afcee202 100644 --- a/packages/google-cloud-securitycenter/synth.py +++ b/packages/google-cloud-securitycenter/synth.py @@ -24,7 +24,7 @@ versions = ['v1beta1', 'v1'] for version in versions: library = gapic.node_library('securitycenter', version) - s.copy(library, excludes=['src/index.js', 'README.md', 'package.json']) + s.copy(library, excludes=['src/index.js', 'README.md', 'package.json', '.kokoro/sample-test.sh']) # Copy common templates common_templates = gcp.CommonTemplates() From da61baad9565b0c8ce722f2ce64677bdfaa90130 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Wed, 3 Jul 2019 08:29:53 -0700 Subject: [PATCH 081/342] docs: add reference in jsdoc header (#121) --- packages/google-cloud-securitycenter/src/index.js | 4 ++++ packages/google-cloud-securitycenter/synth.metadata | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/google-cloud-securitycenter/src/index.js b/packages/google-cloud-securitycenter/src/index.js index 93a7d9ae877..5242419795b 100644 --- a/packages/google-cloud-securitycenter/src/index.js +++ b/packages/google-cloud-securitycenter/src/index.js @@ -19,6 +19,10 @@ * @namespace google.type */ +/** + * @namespace google.type + */ + /** * @namespace google.cloud */ diff --git a/packages/google-cloud-securitycenter/synth.metadata b/packages/google-cloud-securitycenter/synth.metadata index 2f4e6fd0f85..50da33d4d9a 100644 --- a/packages/google-cloud-securitycenter/synth.metadata +++ b/packages/google-cloud-securitycenter/synth.metadata @@ -1,5 +1,5 @@ { - "updateTime": "2019-07-02T21:50:39.781012Z", + "updateTime": "2019-07-03T11:19:04.252185Z", "sources": [ { "generator": { From 3983ed943bbd2556510437fd55290a6e12367e7c Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Tue, 16 Jul 2019 15:24:50 -0700 Subject: [PATCH 082/342] feat!: adds findingSecurityMarksPathTemplate (#122) --- .../google-cloud-securitycenter/src/index.js | 48 +- .../src/v1beta1/security_center_client.js | 58 + .../synth.metadata | 10 +- packages/google-cloud-securitycenter/synth.py | 25 +- .../test/gapic-v1beta1.js | 1307 ----------------- 5 files changed, 107 insertions(+), 1341 deletions(-) delete mode 100644 packages/google-cloud-securitycenter/test/gapic-v1beta1.js diff --git a/packages/google-cloud-securitycenter/src/index.js b/packages/google-cloud-securitycenter/src/index.js index 5242419795b..d56ca644030 100644 --- a/packages/google-cloud-securitycenter/src/index.js +++ b/packages/google-cloud-securitycenter/src/index.js @@ -1,4 +1,4 @@ -// Copyright 2018 Google LLC +// Copyright 2019 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -18,68 +18,69 @@ /** * @namespace google.type */ - /** - * @namespace google.type + * @namespace google.longrunning */ - /** - * @namespace google.cloud + * @namespace google.protobuf */ /** - * @namespace google.cloud.securitycenter + * @namespace google.type */ /** - * @namespace google.cloud.securitycenter.v1beta1 + * @namespace google.rpc */ /** * @namespace google.cloud.securitycenter.v1 */ +/** + * @namespace google.cloud.securitycenter.v1beta1 + */ /** * @namespace google.iam.v1 */ + /** - * @namespace google.protobuf + * @namespace google.cloud */ /** - * @namespace google.longrunning + * @namespace google.cloud.security-center */ /** - * @namespace google.rpc + * @namespace google.cloud.security-center.v1 */ 'use strict'; // Import the clients for each version supported by this package. const gapic = Object.freeze({ - v1beta1: require('./v1beta1'), v1: require('./v1'), }); /** - * The `securitycenter` package has the following named exports: + * The `@google-cloud/security-center` package has the following named exports: * * - `SecurityCenterClient` - Reference to - * {@link v1beta1.SecurityCenterClient} - * - `v1beta1` - This is used for selecting or pinning a + * {@link v1.SecurityCenterClient} + * - `v1` - This is used for selecting or pinning a * particular backend service version. It exports: * - `SecurityCenterClient` - Reference to - * {@link v1beta1.SecurityCenterClient} + * {@link v1.SecurityCenterClient} * * @module {object} @google-cloud/security-center - * @alias nodejs-securitycenter + * @alias nodejs-security-center * * @example Install the client library with npm: * npm install --save @google-cloud/security-center * * @example Import the client library: - * const securitycenter = require('@google-cloud/security-center'); + * const security-center = require('@google-cloud/security-center'); * * @example Create a client that uses Application Default Credentials (ADC): - * const client = new securitycenter.SecurityCenterClient(); + * const client = new security-center.SecurityCenterClient(); * * @example Create a client with explicit credentials: - * const client = new securitycenter.SecurityCenterClient({ + * const client = new security-center.SecurityCenterClient({ * projectId: 'your-project-id', * keyFilename: '/path/to/keyfile.json', * }); @@ -88,17 +89,10 @@ const gapic = Object.freeze({ /** * @type {object} * @property {constructor} SecurityCenterClient - * Reference to {@link v1beta1.SecurityCenterClient} + * Reference to {@link v1.SecurityCenterClient} */ module.exports = gapic.v1; -/** - * @type {object} - * @property {constructor} SecurityCenterClient - * Reference to {@link v1beta1.SecurityCenterClient} - */ -module.exports.v1beta1 = gapic.v1beta1; - /** * @type {object} * @property {constructor} SecurityCenterClient diff --git a/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.js b/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.js index 463fb2f9252..ba92f1bfe89 100644 --- a/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.js +++ b/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.js @@ -107,6 +107,9 @@ class SecurityCenterClient { findingPathTemplate: new gax.PathTemplate( 'organizations/{organization}/sources/{source}/findings/{finding}' ), + findingSecurityMarksPathTemplate: new gax.PathTemplate( + 'organizations/{organization}/sources/{source}/findings/{finding}/securityMarks' + ), organizationPathTemplate: new gax.PathTemplate( 'organizations/{organization}' ), @@ -2511,6 +2514,22 @@ class SecurityCenterClient { }); } + /** + * Return a fully-qualified finding_security_marks resource name string. + * + * @param {String} organization + * @param {String} source + * @param {String} finding + * @returns {String} + */ + findingSecurityMarksPath(organization, source, finding) { + return this._pathTemplates.findingSecurityMarksPathTemplate.render({ + organization: organization, + source: source, + finding: finding, + }); + } + /** * Return a fully-qualified organization resource name string. * @@ -2609,6 +2628,45 @@ class SecurityCenterClient { return this._pathTemplates.findingPathTemplate.match(findingName).finding; } + /** + * Parse the findingSecurityMarksName from a finding_security_marks resource. + * + * @param {String} findingSecurityMarksName + * A fully-qualified path representing a finding_security_marks resources. + * @returns {String} - A string representing the organization. + */ + matchOrganizationFromFindingSecurityMarksName(findingSecurityMarksName) { + return this._pathTemplates.findingSecurityMarksPathTemplate.match( + findingSecurityMarksName + ).organization; + } + + /** + * Parse the findingSecurityMarksName from a finding_security_marks resource. + * + * @param {String} findingSecurityMarksName + * A fully-qualified path representing a finding_security_marks resources. + * @returns {String} - A string representing the source. + */ + matchSourceFromFindingSecurityMarksName(findingSecurityMarksName) { + return this._pathTemplates.findingSecurityMarksPathTemplate.match( + findingSecurityMarksName + ).source; + } + + /** + * Parse the findingSecurityMarksName from a finding_security_marks resource. + * + * @param {String} findingSecurityMarksName + * A fully-qualified path representing a finding_security_marks resources. + * @returns {String} - A string representing the finding. + */ + matchFindingFromFindingSecurityMarksName(findingSecurityMarksName) { + return this._pathTemplates.findingSecurityMarksPathTemplate.match( + findingSecurityMarksName + ).finding; + } + /** * Parse the organizationName from a organization resource. * diff --git a/packages/google-cloud-securitycenter/synth.metadata b/packages/google-cloud-securitycenter/synth.metadata index 50da33d4d9a..c0090af385d 100644 --- a/packages/google-cloud-securitycenter/synth.metadata +++ b/packages/google-cloud-securitycenter/synth.metadata @@ -1,19 +1,19 @@ { - "updateTime": "2019-07-03T11:19:04.252185Z", + "updateTime": "2019-07-16T21:57:58.657213Z", "sources": [ { "generator": { "name": "artman", - "version": "0.29.3", - "dockerImage": "googleapis/artman@sha256:8900f94a81adaab0238965aa8a7b3648791f4f3a95ee65adc6a56cfcc3753101" + "version": "0.30.0", + "dockerImage": "googleapis/artman@sha256:a44d9fb6fe826ca0ea7d6f7be23c596346bed82ee513a0043f3c068279717439" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "69916b6ffbb7717fa009033351777d0c9909fb79", - "internalRef": "256241904" + "sha": "96d5a05171e99b6a2378eb0a3423f765351878b7", + "internalRef": "258424288" } }, { diff --git a/packages/google-cloud-securitycenter/synth.py b/packages/google-cloud-securitycenter/synth.py index 6f8afcee202..2faecd05b3d 100644 --- a/packages/google-cloud-securitycenter/synth.py +++ b/packages/google-cloud-securitycenter/synth.py @@ -24,12 +24,12 @@ versions = ['v1beta1', 'v1'] for version in versions: library = gapic.node_library('securitycenter', version) - s.copy(library, excludes=['src/index.js', 'README.md', 'package.json', '.kokoro/sample-test.sh']) + s.copy(library, excludes=['README.md', 'package.json', 'test/gapic-v1beta1.js']) # Copy common templates common_templates = gcp.CommonTemplates() templates = common_templates.node_library() -s.copy(templates) +s.copy(templates, excludes=['.kokoro/samples-test.sh']) s.replace('src/v1*/doc/google/cloud/securitycenter/v1*/doc_source.js', r"\[\\p\{L\}\\p\{N\}\]\(https:\/\/cloud\.google\.com\{\\p\{L\}\\p\{N\}_- \]\{0\,30\}\[\\p\{L\}\\p\{N\}\]\)\?", @@ -47,6 +47,27 @@ /** * @namespace google.type */ +/** + * @namespace google.longrunning + */ +/** + * @namespace google.protobuf + */ +/** + * @namespace google.type + */ +/** + * @namespace google.rpc + */ +/** + * @namespace google.cloud.securitycenter.v1 + */ +/** + * @namespace google.cloud.securitycenter.v1beta1 + */ +/** + * @namespace google.iam.v1 + */ """) # [START fix-dead-link] diff --git a/packages/google-cloud-securitycenter/test/gapic-v1beta1.js b/packages/google-cloud-securitycenter/test/gapic-v1beta1.js deleted file mode 100644 index 71139ae8301..00000000000 --- a/packages/google-cloud-securitycenter/test/gapic-v1beta1.js +++ /dev/null @@ -1,1307 +0,0 @@ -// Copyright 2019 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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'; - -const assert = require('assert'); - -const securityCenterModule = require('../src'); - -const FAKE_STATUS_CODE = 1; -const error = new Error(); -error.code = FAKE_STATUS_CODE; - -describe('SecurityCenterClient', () => { - it('has servicePath', () => { - const servicePath = - securityCenterModule.v1beta1.SecurityCenterClient.servicePath; - assert(servicePath); - }); - - it('has apiEndpoint', () => { - const apiEndpoint = - securityCenterModule.v1beta1.SecurityCenterClient.apiEndpoint; - assert(apiEndpoint); - }); - - it('has port', () => { - const port = securityCenterModule.v1beta1.SecurityCenterClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no options', () => { - const client = new securityCenterModule.v1beta1.SecurityCenterClient(); - assert(client); - }); - - describe('createSource', () => { - it('invokes createSource without error', done => { - const client = new securityCenterModule.v1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedParent = client.organizationPath('[ORGANIZATION]'); - const source = {}; - const request = { - parent: formattedParent, - source: source, - }; - - // Mock response - const name = 'name3373707'; - const displayName = 'displayName1615086568'; - const description = 'description-1724546052'; - const expectedResponse = { - name: name, - displayName: displayName, - description: description, - }; - - // Mock Grpc layer - client._innerApiCalls.createSource = mockSimpleGrpcMethod( - request, - expectedResponse - ); - - client.createSource(request, (err, response) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes createSource with error', done => { - const client = new securityCenterModule.v1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedParent = client.organizationPath('[ORGANIZATION]'); - const source = {}; - const request = { - parent: formattedParent, - source: source, - }; - - // Mock Grpc layer - client._innerApiCalls.createSource = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.createSource(request, (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - - describe('createFinding', () => { - it('invokes createFinding without error', done => { - const client = new securityCenterModule.v1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedParent = client.sourcePath('[ORGANIZATION]', '[SOURCE]'); - const findingId = 'findingId728776081'; - const finding = {}; - const request = { - parent: formattedParent, - findingId: findingId, - finding: finding, - }; - - // Mock response - const name = 'name3373707'; - const parent2 = 'parent21175163357'; - const resourceName = 'resourceName979421212'; - const category = 'category50511102'; - const externalUri = 'externalUri-1385596168'; - const expectedResponse = { - name: name, - parent: parent2, - resourceName: resourceName, - category: category, - externalUri: externalUri, - }; - - // Mock Grpc layer - client._innerApiCalls.createFinding = mockSimpleGrpcMethod( - request, - expectedResponse - ); - - client.createFinding(request, (err, response) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes createFinding with error', done => { - const client = new securityCenterModule.v1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedParent = client.sourcePath('[ORGANIZATION]', '[SOURCE]'); - const findingId = 'findingId728776081'; - const finding = {}; - const request = { - parent: formattedParent, - findingId: findingId, - finding: finding, - }; - - // Mock Grpc layer - client._innerApiCalls.createFinding = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.createFinding(request, (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - - describe('getIamPolicy', () => { - it('invokes getIamPolicy without error', done => { - const client = new securityCenterModule.v1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedResource = client.sourcePath('[ORGANIZATION]', '[SOURCE]'); - const request = { - resource: formattedResource, - }; - - // Mock response - const version = 351608024; - const etag = '21'; - const expectedResponse = { - version: version, - etag: etag, - }; - - // Mock Grpc layer - client._innerApiCalls.getIamPolicy = mockSimpleGrpcMethod( - request, - expectedResponse - ); - - client.getIamPolicy(request, (err, response) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes getIamPolicy with error', done => { - const client = new securityCenterModule.v1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedResource = client.sourcePath('[ORGANIZATION]', '[SOURCE]'); - const request = { - resource: formattedResource, - }; - - // Mock Grpc layer - client._innerApiCalls.getIamPolicy = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.getIamPolicy(request, (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - - describe('getOrganizationSettings', () => { - it('invokes getOrganizationSettings without error', done => { - const client = new securityCenterModule.v1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedName = client.organizationSettingsPath('[ORGANIZATION]'); - const request = { - name: formattedName, - }; - - // Mock response - const name2 = 'name2-1052831874'; - const enableAssetDiscovery = false; - const expectedResponse = { - name: name2, - enableAssetDiscovery: enableAssetDiscovery, - }; - - // Mock Grpc layer - client._innerApiCalls.getOrganizationSettings = mockSimpleGrpcMethod( - request, - expectedResponse - ); - - client.getOrganizationSettings(request, (err, response) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes getOrganizationSettings with error', done => { - const client = new securityCenterModule.v1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedName = client.organizationSettingsPath('[ORGANIZATION]'); - const request = { - name: formattedName, - }; - - // Mock Grpc layer - client._innerApiCalls.getOrganizationSettings = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.getOrganizationSettings(request, (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - - describe('getSource', () => { - it('invokes getSource without error', done => { - const client = new securityCenterModule.v1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedName = client.sourcePath('[ORGANIZATION]', '[SOURCE]'); - const request = { - name: formattedName, - }; - - // Mock response - const name2 = 'name2-1052831874'; - const displayName = 'displayName1615086568'; - const description = 'description-1724546052'; - const expectedResponse = { - name: name2, - displayName: displayName, - description: description, - }; - - // Mock Grpc layer - client._innerApiCalls.getSource = mockSimpleGrpcMethod( - request, - expectedResponse - ); - - client.getSource(request, (err, response) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes getSource with error', done => { - const client = new securityCenterModule.v1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedName = client.sourcePath('[ORGANIZATION]', '[SOURCE]'); - const request = { - name: formattedName, - }; - - // Mock Grpc layer - client._innerApiCalls.getSource = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.getSource(request, (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - - describe('groupAssets', () => { - it('invokes groupAssets without error', done => { - const client = new securityCenterModule.v1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedParent = client.organizationPath('[ORGANIZATION]'); - const groupBy = 'groupBy506361367'; - const request = { - parent: formattedParent, - groupBy: groupBy, - }; - - // Mock response - const nextPageToken = ''; - const groupByResultsElement = {}; - const groupByResults = [groupByResultsElement]; - const expectedResponse = { - nextPageToken: nextPageToken, - groupByResults: groupByResults, - }; - - // Mock Grpc layer - client._innerApiCalls.groupAssets = ( - actualRequest, - options, - callback - ) => { - assert.deepStrictEqual(actualRequest, request); - callback(null, expectedResponse.groupByResults); - }; - - client.groupAssets(request, (err, response) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse.groupByResults); - done(); - }); - }); - - it('invokes groupAssets with error', done => { - const client = new securityCenterModule.v1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedParent = client.organizationPath('[ORGANIZATION]'); - const groupBy = 'groupBy506361367'; - const request = { - parent: formattedParent, - groupBy: groupBy, - }; - - // Mock Grpc layer - client._innerApiCalls.groupAssets = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.groupAssets(request, (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - - describe('groupFindings', () => { - it('invokes groupFindings without error', done => { - const client = new securityCenterModule.v1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedParent = client.sourcePath('[ORGANIZATION]', '[SOURCE]'); - const groupBy = 'groupBy506361367'; - const request = { - parent: formattedParent, - groupBy: groupBy, - }; - - // Mock response - const nextPageToken = ''; - const groupByResultsElement = {}; - const groupByResults = [groupByResultsElement]; - const expectedResponse = { - nextPageToken: nextPageToken, - groupByResults: groupByResults, - }; - - // Mock Grpc layer - client._innerApiCalls.groupFindings = ( - actualRequest, - options, - callback - ) => { - assert.deepStrictEqual(actualRequest, request); - callback(null, expectedResponse.groupByResults); - }; - - client.groupFindings(request, (err, response) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse.groupByResults); - done(); - }); - }); - - it('invokes groupFindings with error', done => { - const client = new securityCenterModule.v1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedParent = client.sourcePath('[ORGANIZATION]', '[SOURCE]'); - const groupBy = 'groupBy506361367'; - const request = { - parent: formattedParent, - groupBy: groupBy, - }; - - // Mock Grpc layer - client._innerApiCalls.groupFindings = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.groupFindings(request, (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - - describe('listAssets', () => { - it('invokes listAssets without error', done => { - const client = new securityCenterModule.v1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedParent = client.organizationPath('[ORGANIZATION]'); - const request = { - parent: formattedParent, - }; - - // Mock response - const nextPageToken = ''; - const totalSize = 705419236; - const listAssetsResultsElement = {}; - const listAssetsResults = [listAssetsResultsElement]; - const expectedResponse = { - nextPageToken: nextPageToken, - totalSize: totalSize, - listAssetsResults: listAssetsResults, - }; - - // Mock Grpc layer - client._innerApiCalls.listAssets = (actualRequest, options, callback) => { - assert.deepStrictEqual(actualRequest, request); - callback(null, expectedResponse.listAssetsResults); - }; - - client.listAssets(request, (err, response) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse.listAssetsResults); - done(); - }); - }); - - it('invokes listAssets with error', done => { - const client = new securityCenterModule.v1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedParent = client.organizationPath('[ORGANIZATION]'); - const request = { - parent: formattedParent, - }; - - // Mock Grpc layer - client._innerApiCalls.listAssets = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.listAssets(request, (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - - describe('listFindings', () => { - it('invokes listFindings without error', done => { - const client = new securityCenterModule.v1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedParent = client.sourcePath('[ORGANIZATION]', '[SOURCE]'); - const request = { - parent: formattedParent, - }; - - // Mock response - const nextPageToken = ''; - const totalSize = 705419236; - const findingsElement = {}; - const findings = [findingsElement]; - const expectedResponse = { - nextPageToken: nextPageToken, - totalSize: totalSize, - findings: findings, - }; - - // Mock Grpc layer - client._innerApiCalls.listFindings = ( - actualRequest, - options, - callback - ) => { - assert.deepStrictEqual(actualRequest, request); - callback(null, expectedResponse.findings); - }; - - client.listFindings(request, (err, response) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse.findings); - done(); - }); - }); - - it('invokes listFindings with error', done => { - const client = new securityCenterModule.v1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedParent = client.sourcePath('[ORGANIZATION]', '[SOURCE]'); - const request = { - parent: formattedParent, - }; - - // Mock Grpc layer - client._innerApiCalls.listFindings = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.listFindings(request, (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - - describe('listSources', () => { - it('invokes listSources without error', done => { - const client = new securityCenterModule.v1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedParent = client.organizationPath('[ORGANIZATION]'); - const request = { - parent: formattedParent, - }; - - // Mock response - const nextPageToken = ''; - const sourcesElement = {}; - const sources = [sourcesElement]; - const expectedResponse = { - nextPageToken: nextPageToken, - sources: sources, - }; - - // Mock Grpc layer - client._innerApiCalls.listSources = ( - actualRequest, - options, - callback - ) => { - assert.deepStrictEqual(actualRequest, request); - callback(null, expectedResponse.sources); - }; - - client.listSources(request, (err, response) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse.sources); - done(); - }); - }); - - it('invokes listSources with error', done => { - const client = new securityCenterModule.v1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedParent = client.organizationPath('[ORGANIZATION]'); - const request = { - parent: formattedParent, - }; - - // Mock Grpc layer - client._innerApiCalls.listSources = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.listSources(request, (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - - describe('runAssetDiscovery', function() { - it('invokes runAssetDiscovery without error', done => { - const client = new securityCenterModule.v1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedParent = client.organizationPath('[ORGANIZATION]'); - const request = { - parent: formattedParent, - }; - - // Mock response - const expectedResponse = {}; - - // Mock Grpc layer - client._innerApiCalls.runAssetDiscovery = mockLongRunningGrpcMethod( - request, - expectedResponse - ); - - client - .runAssetDiscovery(request) - .then(responses => { - const operation = responses[0]; - return operation.promise(); - }) - .then(responses => { - assert.deepStrictEqual(responses[0], expectedResponse); - done(); - }) - .catch(err => { - done(err); - }); - }); - - it('invokes runAssetDiscovery with error', done => { - const client = new securityCenterModule.v1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedParent = client.organizationPath('[ORGANIZATION]'); - const request = { - parent: formattedParent, - }; - - // Mock Grpc layer - client._innerApiCalls.runAssetDiscovery = mockLongRunningGrpcMethod( - request, - null, - error - ); - - client - .runAssetDiscovery(request) - .then(responses => { - const operation = responses[0]; - return operation.promise(); - }) - .then(() => { - assert.fail(); - }) - .catch(err => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - done(); - }); - }); - - it('has longrunning decoder functions', () => { - const client = new securityCenterModule.v1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert( - client._descriptors.longrunning.runAssetDiscovery - .responseDecoder instanceof Function - ); - assert( - client._descriptors.longrunning.runAssetDiscovery - .metadataDecoder instanceof Function - ); - }); - }); - - describe('setFindingState', () => { - it('invokes setFindingState without error', done => { - const client = new securityCenterModule.v1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedName = client.findingPath( - '[ORGANIZATION]', - '[SOURCE]', - '[FINDING]' - ); - const state = 'STATE_UNSPECIFIED'; - const startTime = {}; - const request = { - name: formattedName, - state: state, - startTime: startTime, - }; - - // Mock response - const name2 = 'name2-1052831874'; - const parent = 'parent-995424086'; - const resourceName = 'resourceName979421212'; - const category = 'category50511102'; - const externalUri = 'externalUri-1385596168'; - const expectedResponse = { - name: name2, - parent: parent, - resourceName: resourceName, - category: category, - externalUri: externalUri, - }; - - // Mock Grpc layer - client._innerApiCalls.setFindingState = mockSimpleGrpcMethod( - request, - expectedResponse - ); - - client.setFindingState(request, (err, response) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes setFindingState with error', done => { - const client = new securityCenterModule.v1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedName = client.findingPath( - '[ORGANIZATION]', - '[SOURCE]', - '[FINDING]' - ); - const state = 'STATE_UNSPECIFIED'; - const startTime = {}; - const request = { - name: formattedName, - state: state, - startTime: startTime, - }; - - // Mock Grpc layer - client._innerApiCalls.setFindingState = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.setFindingState(request, (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - - describe('setIamPolicy', () => { - it('invokes setIamPolicy without error', done => { - const client = new securityCenterModule.v1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedResource = client.sourcePath('[ORGANIZATION]', '[SOURCE]'); - const policy = {}; - const request = { - resource: formattedResource, - policy: policy, - }; - - // Mock response - const version = 351608024; - const etag = '21'; - const expectedResponse = { - version: version, - etag: etag, - }; - - // Mock Grpc layer - client._innerApiCalls.setIamPolicy = mockSimpleGrpcMethod( - request, - expectedResponse - ); - - client.setIamPolicy(request, (err, response) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes setIamPolicy with error', done => { - const client = new securityCenterModule.v1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedResource = client.sourcePath('[ORGANIZATION]', '[SOURCE]'); - const policy = {}; - const request = { - resource: formattedResource, - policy: policy, - }; - - // Mock Grpc layer - client._innerApiCalls.setIamPolicy = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.setIamPolicy(request, (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - - describe('testIamPermissions', () => { - it('invokes testIamPermissions without error', done => { - const client = new securityCenterModule.v1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedResource = client.sourcePath('[ORGANIZATION]', '[SOURCE]'); - const permissions = []; - const request = { - resource: formattedResource, - permissions: permissions, - }; - - // Mock response - const expectedResponse = {}; - - // Mock Grpc layer - client._innerApiCalls.testIamPermissions = mockSimpleGrpcMethod( - request, - expectedResponse - ); - - client.testIamPermissions(request, (err, response) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes testIamPermissions with error', done => { - const client = new securityCenterModule.v1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedResource = client.sourcePath('[ORGANIZATION]', '[SOURCE]'); - const permissions = []; - const request = { - resource: formattedResource, - permissions: permissions, - }; - - // Mock Grpc layer - client._innerApiCalls.testIamPermissions = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.testIamPermissions(request, (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - - describe('updateFinding', () => { - it('invokes updateFinding without error', done => { - const client = new securityCenterModule.v1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const finding = {}; - const request = { - finding: finding, - }; - - // Mock response - const name = 'name3373707'; - const parent = 'parent-995424086'; - const resourceName = 'resourceName979421212'; - const category = 'category50511102'; - const externalUri = 'externalUri-1385596168'; - const expectedResponse = { - name: name, - parent: parent, - resourceName: resourceName, - category: category, - externalUri: externalUri, - }; - - // Mock Grpc layer - client._innerApiCalls.updateFinding = mockSimpleGrpcMethod( - request, - expectedResponse - ); - - client.updateFinding(request, (err, response) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes updateFinding with error', done => { - const client = new securityCenterModule.v1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const finding = {}; - const request = { - finding: finding, - }; - - // Mock Grpc layer - client._innerApiCalls.updateFinding = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.updateFinding(request, (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - - describe('updateOrganizationSettings', () => { - it('invokes updateOrganizationSettings without error', done => { - const client = new securityCenterModule.v1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const organizationSettings = {}; - const request = { - organizationSettings: organizationSettings, - }; - - // Mock response - const name = 'name3373707'; - const enableAssetDiscovery = false; - const expectedResponse = { - name: name, - enableAssetDiscovery: enableAssetDiscovery, - }; - - // Mock Grpc layer - client._innerApiCalls.updateOrganizationSettings = mockSimpleGrpcMethod( - request, - expectedResponse - ); - - client.updateOrganizationSettings(request, (err, response) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes updateOrganizationSettings with error', done => { - const client = new securityCenterModule.v1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const organizationSettings = {}; - const request = { - organizationSettings: organizationSettings, - }; - - // Mock Grpc layer - client._innerApiCalls.updateOrganizationSettings = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.updateOrganizationSettings(request, (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - - describe('updateSource', () => { - it('invokes updateSource without error', done => { - const client = new securityCenterModule.v1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const source = {}; - const request = { - source: source, - }; - - // Mock response - const name = 'name3373707'; - const displayName = 'displayName1615086568'; - const description = 'description-1724546052'; - const expectedResponse = { - name: name, - displayName: displayName, - description: description, - }; - - // Mock Grpc layer - client._innerApiCalls.updateSource = mockSimpleGrpcMethod( - request, - expectedResponse - ); - - client.updateSource(request, (err, response) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes updateSource with error', done => { - const client = new securityCenterModule.v1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const source = {}; - const request = { - source: source, - }; - - // Mock Grpc layer - client._innerApiCalls.updateSource = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.updateSource(request, (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - - describe('updateSecurityMarks', () => { - it('invokes updateSecurityMarks without error', done => { - const client = new securityCenterModule.v1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const securityMarks = {}; - const request = { - securityMarks: securityMarks, - }; - - // Mock response - const name = 'name3373707'; - const expectedResponse = { - name: name, - }; - - // Mock Grpc layer - client._innerApiCalls.updateSecurityMarks = mockSimpleGrpcMethod( - request, - expectedResponse - ); - - client.updateSecurityMarks(request, (err, response) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes updateSecurityMarks with error', done => { - const client = new securityCenterModule.v1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const securityMarks = {}; - const request = { - securityMarks: securityMarks, - }; - - // Mock Grpc layer - client._innerApiCalls.updateSecurityMarks = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.updateSecurityMarks(request, (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); -}); - -function mockSimpleGrpcMethod(expectedRequest, response, error) { - return function(actualRequest, options, callback) { - assert.deepStrictEqual(actualRequest, expectedRequest); - if (error) { - callback(error); - } else if (response) { - callback(null, response); - } else { - callback(null); - } - }; -} - -function mockLongRunningGrpcMethod(expectedRequest, response, error) { - return request => { - assert.deepStrictEqual(request, expectedRequest); - const mockOperation = { - promise: function() { - return new Promise((resolve, reject) => { - if (error) { - reject(error); - } else { - resolve([response]); - } - }); - }, - }; - return Promise.resolve([mockOperation]); - }; -} From 97077ef23791390dad2288c68c61a4620140e50f Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Fri, 19 Jul 2019 11:20:05 -0700 Subject: [PATCH 083/342] docs: update jsdoc to make datetime usage more clear (#124) --- .../v1/securitycenter_service.proto | 47 +++++++++- .../v1/doc_securitycenter_service.js | 47 +++++++++- .../src/v1/security_center_client.js | 94 +++++++++++++++++-- .../synth.metadata | 10 +- 4 files changed, 173 insertions(+), 25 deletions(-) diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/securitycenter_service.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/securitycenter_service.proto index bcb4e863df6..0687928f3ba 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/securitycenter_service.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/securitycenter_service.proto @@ -282,8 +282,20 @@ message GroupAssetsRequest { // // The following field and operator combinations are supported: // name | '=' - // update_time | '>', '<', '>=', '<=', '=' - // create_time | '>', '<', '>=', '<=', '=' + // update_time | '=', '>', '<', '>=', '<=' + // + // Usage: This should be milliseconds since epoch or an RFC3339 string. + // Examples: + // "update_time = \"2019-06-10T16:07:18-07:00\"" + // "update_time = 1560208038000" + // + // create_time | '=', '>', '<', '>=', '<=' + // + // Usage: This should be milliseconds since epoch or an RFC3339 string. + // Examples: + // "create_time = \"2019-06-10T16:07:18-07:00\"" + // "create_time = 1560208038000" + // // iam_policy.policy_blob | '=', ':' // resource_properties | '=', ':', '>', '<', '>=', '<=' // security_marks | '=', ':' @@ -416,7 +428,13 @@ message GroupFindingsRequest { // state | '=', ':' // category | '=', ':' // external_uri | '=', ':' - // event_time | `>`, `<`, `>=`, `<=` + // event_time | `=`, `>`, `<`, `>=`, `<=` + // + // Usage: This should be milliseconds since epoch or an RFC3339 string. + // Examples: + // "event_time = \"2019-06-10T16:07:18-07:00\"" + // "event_time = 1560208038000" + // // security_marks | '=', ':' // source_properties | '=', ':', `>`, `<`, `>=`, `<=` // @@ -572,7 +590,20 @@ message ListAssetsRequest { // // The following are the allowed field and operator combinations: // name | `=` - // update_time | `>`, `<`, `>=`, `<=` + // update_time | `=`, `>`, `<`, `>=`, `<=` + // + // Usage: This should be milliseconds since epoch or an RFC3339 string. + // Examples: + // "update_time = \"2019-06-10T16:07:18-07:00\"" + // "update_time = 1560208038000" + // + // create_time | `=`, `>`, `<`, `>=`, `<=` + // + // Usage: This should be milliseconds since epoch or an RFC3339 string. + // Examples: + // "create_time = \"2019-06-10T16:07:18-07:00\"" + // "create_time = 1560208038000" + // // iam_policy.policy_blob | '=', ':' // resource_properties | '=', ':', `>`, `<`, `>=`, `<=` // security_marks | '=', ':' @@ -740,7 +771,13 @@ message ListFindingsRequest { // state | '=', ':' // category | '=', ':' // external_uri | '=', ':' - // event_time | `>`, `<`, `>=`, `<=` + // event_time | `=`, `>`, `<`, `>=`, `<=` + // + // Usage: This should be milliseconds since epoch or an RFC3339 string. + // Examples: + // "event_time = \"2019-06-10T16:07:18-07:00\"" + // "event_time = 1560208038000" + // // security_marks | '=', ':' // source_properties | '=', ':', `>`, `<`, `>=`, `<=` // diff --git a/packages/google-cloud-securitycenter/src/v1/doc/google/cloud/securitycenter/v1/doc_securitycenter_service.js b/packages/google-cloud-securitycenter/src/v1/doc/google/cloud/securitycenter/v1/doc_securitycenter_service.js index 057608cf683..5e52ff07702 100644 --- a/packages/google-cloud-securitycenter/src/v1/doc/google/cloud/securitycenter/v1/doc_securitycenter_service.js +++ b/packages/google-cloud-securitycenter/src/v1/doc/google/cloud/securitycenter/v1/doc_securitycenter_service.js @@ -128,8 +128,20 @@ const GetSourceRequest = { * * The following field and operator combinations are supported: * name | '=' - * update_time | '>', '<', '>=', '<=', '=' - * create_time | '>', '<', '>=', '<=', '=' + * update_time | '=', '>', '<', '>=', '<=' + * + * Usage: This should be milliseconds since epoch or an RFC3339 string. + * Examples: + * "update_time = \"2019-06-10T16:07:18-07:00\"" + * "update_time = 1560208038000" + * + * create_time | '=', '>', '<', '>=', '<=' + * + * Usage: This should be milliseconds since epoch or an RFC3339 string. + * Examples: + * "create_time = \"2019-06-10T16:07:18-07:00\"" + * "create_time = 1560208038000" + * * iam_policy.policy_blob | '=', ':' * resource_properties | '=', ':', '>', '<', '>=', '<=' * security_marks | '=', ':' @@ -284,7 +296,13 @@ const GroupAssetsResponse = { * state | '=', ':' * category | '=', ':' * external_uri | '=', ':' - * event_time | `>`, `<`, `>=`, `<=` + * event_time | `=`, `>`, `<`, `>=`, `<=` + * + * Usage: This should be milliseconds since epoch or an RFC3339 string. + * Examples: + * "event_time = \"2019-06-10T16:07:18-07:00\"" + * "event_time = 1560208038000" + * * security_marks | '=', ':' * source_properties | '=', ':', `>`, `<`, `>=`, `<=` * @@ -488,7 +506,20 @@ const ListSourcesResponse = { * * The following are the allowed field and operator combinations: * name | `=` - * update_time | `>`, `<`, `>=`, `<=` + * update_time | `=`, `>`, `<`, `>=`, `<=` + * + * Usage: This should be milliseconds since epoch or an RFC3339 string. + * Examples: + * "update_time = \"2019-06-10T16:07:18-07:00\"" + * "update_time = 1560208038000" + * + * create_time | `=`, `>`, `<`, `>=`, `<=` + * + * Usage: This should be milliseconds since epoch or an RFC3339 string. + * Examples: + * "create_time = \"2019-06-10T16:07:18-07:00\"" + * "create_time = 1560208038000" + * * iam_policy.policy_blob | '=', ':' * resource_properties | '=', ':', `>`, `<`, `>=`, `<=` * security_marks | '=', ':' @@ -706,7 +737,13 @@ const ListAssetsResponse = { * state | '=', ':' * category | '=', ':' * external_uri | '=', ':' - * event_time | `>`, `<`, `>=`, `<=` + * event_time | `=`, `>`, `<`, `>=`, `<=` + * + * Usage: This should be milliseconds since epoch or an RFC3339 string. + * Examples: + * "event_time = \"2019-06-10T16:07:18-07:00\"" + * "event_time = 1560208038000" + * * security_marks | '=', ':' * source_properties | '=', ':', `>`, `<`, `>=`, `<=` * diff --git a/packages/google-cloud-securitycenter/src/v1/security_center_client.js b/packages/google-cloud-securitycenter/src/v1/security_center_client.js index de0a471cba3..6cd47b81644 100644 --- a/packages/google-cloud-securitycenter/src/v1/security_center_client.js +++ b/packages/google-cloud-securitycenter/src/v1/security_center_client.js @@ -656,8 +656,20 @@ class SecurityCenterClient { * * The following field and operator combinations are supported: * name | '=' - * update_time | '>', '<', '>=', '<=', '=' - * create_time | '>', '<', '>=', '<=', '=' + * update_time | '=', '>', '<', '>=', '<=' + * + * Usage: This should be milliseconds since epoch or an RFC3339 string. + * Examples: + * "update_time = \"2019-06-10T16:07:18-07:00\"" + * "update_time = 1560208038000" + * + * create_time | '=', '>', '<', '>=', '<=' + * + * Usage: This should be milliseconds since epoch or an RFC3339 string. + * Examples: + * "create_time = \"2019-06-10T16:07:18-07:00\"" + * "create_time = 1560208038000" + * * iam_policy.policy_blob | '=', ':' * resource_properties | '=', ':', '>', '<', '>=', '<=' * security_marks | '=', ':' @@ -871,8 +883,20 @@ class SecurityCenterClient { * * The following field and operator combinations are supported: * name | '=' - * update_time | '>', '<', '>=', '<=', '=' - * create_time | '>', '<', '>=', '<=', '=' + * update_time | '=', '>', '<', '>=', '<=' + * + * Usage: This should be milliseconds since epoch or an RFC3339 string. + * Examples: + * "update_time = \"2019-06-10T16:07:18-07:00\"" + * "update_time = 1560208038000" + * + * create_time | '=', '>', '<', '>=', '<=' + * + * Usage: This should be milliseconds since epoch or an RFC3339 string. + * Examples: + * "create_time = \"2019-06-10T16:07:18-07:00\"" + * "create_time = 1560208038000" + * * iam_policy.policy_blob | '=', ':' * resource_properties | '=', ':', '>', '<', '>=', '<=' * security_marks | '=', ':' @@ -1024,7 +1048,13 @@ class SecurityCenterClient { * state | '=', ':' * category | '=', ':' * external_uri | '=', ':' - * event_time | `>`, `<`, `>=`, `<=` + * event_time | `=`, `>`, `<`, `>=`, `<=` + * + * Usage: This should be milliseconds since epoch or an RFC3339 string. + * Examples: + * "event_time = \"2019-06-10T16:07:18-07:00\"" + * "event_time = 1560208038000" + * * security_marks | '=', ':' * source_properties | '=', ':', `>`, `<`, `>=`, `<=` * @@ -1236,7 +1266,13 @@ class SecurityCenterClient { * state | '=', ':' * category | '=', ':' * external_uri | '=', ':' - * event_time | `>`, `<`, `>=`, `<=` + * event_time | `=`, `>`, `<`, `>=`, `<=` + * + * Usage: This should be milliseconds since epoch or an RFC3339 string. + * Examples: + * "event_time = \"2019-06-10T16:07:18-07:00\"" + * "event_time = 1560208038000" + * * security_marks | '=', ':' * source_properties | '=', ':', `>`, `<`, `>=`, `<=` * @@ -1357,7 +1393,20 @@ class SecurityCenterClient { * * The following are the allowed field and operator combinations: * name | `=` - * update_time | `>`, `<`, `>=`, `<=` + * update_time | `=`, `>`, `<`, `>=`, `<=` + * + * Usage: This should be milliseconds since epoch or an RFC3339 string. + * Examples: + * "update_time = \"2019-06-10T16:07:18-07:00\"" + * "update_time = 1560208038000" + * + * create_time | `=`, `>`, `<`, `>=`, `<=` + * + * Usage: This should be milliseconds since epoch or an RFC3339 string. + * Examples: + * "create_time = \"2019-06-10T16:07:18-07:00\"" + * "create_time = 1560208038000" + * * iam_policy.policy_blob | '=', ':' * resource_properties | '=', ':', `>`, `<`, `>=`, `<=` * security_marks | '=', ':' @@ -1570,7 +1619,20 @@ class SecurityCenterClient { * * The following are the allowed field and operator combinations: * name | `=` - * update_time | `>`, `<`, `>=`, `<=` + * update_time | `=`, `>`, `<`, `>=`, `<=` + * + * Usage: This should be milliseconds since epoch or an RFC3339 string. + * Examples: + * "update_time = \"2019-06-10T16:07:18-07:00\"" + * "update_time = 1560208038000" + * + * create_time | `=`, `>`, `<`, `>=`, `<=` + * + * Usage: This should be milliseconds since epoch or an RFC3339 string. + * Examples: + * "create_time = \"2019-06-10T16:07:18-07:00\"" + * "create_time = 1560208038000" + * * iam_policy.policy_blob | '=', ':' * resource_properties | '=', ':', `>`, `<`, `>=`, `<=` * security_marks | '=', ':' @@ -1725,7 +1787,13 @@ class SecurityCenterClient { * state | '=', ':' * category | '=', ':' * external_uri | '=', ':' - * event_time | `>`, `<`, `>=`, `<=` + * event_time | `=`, `>`, `<`, `>=`, `<=` + * + * Usage: This should be milliseconds since epoch or an RFC3339 string. + * Examples: + * "event_time = \"2019-06-10T16:07:18-07:00\"" + * "event_time = 1560208038000" + * * security_marks | '=', ':' * source_properties | '=', ':', `>`, `<`, `>=`, `<=` * @@ -1936,7 +2004,13 @@ class SecurityCenterClient { * state | '=', ':' * category | '=', ':' * external_uri | '=', ':' - * event_time | `>`, `<`, `>=`, `<=` + * event_time | `=`, `>`, `<`, `>=`, `<=` + * + * Usage: This should be milliseconds since epoch or an RFC3339 string. + * Examples: + * "event_time = \"2019-06-10T16:07:18-07:00\"" + * "event_time = 1560208038000" + * * security_marks | '=', ':' * source_properties | '=', ':', `>`, `<`, `>=`, `<=` * diff --git a/packages/google-cloud-securitycenter/synth.metadata b/packages/google-cloud-securitycenter/synth.metadata index c0090af385d..2228a8b967e 100644 --- a/packages/google-cloud-securitycenter/synth.metadata +++ b/packages/google-cloud-securitycenter/synth.metadata @@ -1,19 +1,19 @@ { - "updateTime": "2019-07-16T21:57:58.657213Z", + "updateTime": "2019-07-19T11:21:50.473296Z", "sources": [ { "generator": { "name": "artman", - "version": "0.30.0", - "dockerImage": "googleapis/artman@sha256:a44d9fb6fe826ca0ea7d6f7be23c596346bed82ee513a0043f3c068279717439" + "version": "0.30.1", + "dockerImage": "googleapis/artman@sha256:f1a2e851e5e012c59e1da4125480bb19878f86a4e7fac4f375f2e819956b5aa3" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "96d5a05171e99b6a2378eb0a3423f765351878b7", - "internalRef": "258424288" + "sha": "f78612e8d008b9678252da84c035da12e92c0093", + "internalRef": "258869625" } }, { From 6c45849e1f5d740aafa6e7a12ac8e112cbcd52a0 Mon Sep 17 00:00:00 2001 From: Cyd La Luz Date: Tue, 23 Jul 2019 08:48:01 -0700 Subject: [PATCH 084/342] fix(deps): remove unused dependency (#126) --- packages/google-cloud-securitycenter/package.json | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/google-cloud-securitycenter/package.json b/packages/google-cloud-securitycenter/package.json index df6b0ada64b..01c8202a65c 100644 --- a/packages/google-cloud-securitycenter/package.json +++ b/packages/google-cloud-securitycenter/package.json @@ -40,7 +40,6 @@ }, "dependencies": { "google-gax": "^1.0.0", - "lodash.merge": "^4.6.0", "protobufjs": "^6.8.0" }, "devDependencies": { From ea0ffa34af774a7221dc68830b432bd587e36912 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Tue, 23 Jul 2019 09:11:11 -0700 Subject: [PATCH 085/342] chore: release 2.0.0 (#123) * updated CHANGELOG.md [ci skip] * updated package.json [ci skip] * updated samples/package.json [ci skip] --- .../google-cloud-securitycenter/CHANGELOG.md | 16 ++++++++++++++++ .../google-cloud-securitycenter/package.json | 2 +- .../samples/package.json | 2 +- 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-securitycenter/CHANGELOG.md b/packages/google-cloud-securitycenter/CHANGELOG.md index f1628fb894f..6cbd2539b68 100644 --- a/packages/google-cloud-securitycenter/CHANGELOG.md +++ b/packages/google-cloud-securitycenter/CHANGELOG.md @@ -4,6 +4,22 @@ [1]: https://www.npmjs.com/package/@google-cloud/security-center?activeTab=versions +## [2.0.0](https://www.github.com/googleapis/nodejs-security-center/compare/v1.0.0...v2.0.0) (2019-07-23) + + +### ⚠ BREAKING CHANGES + +* adds findingSecurityMarksPathTemplate (#122) + +### Bug Fixes + +* **deps:** remove unused dependency ([#126](https://www.github.com/googleapis/nodejs-security-center/issues/126)) ([2c606ea](https://www.github.com/googleapis/nodejs-security-center/commit/2c606ea)) + + +### Features + +* adds findingSecurityMarksPathTemplate ([#122](https://www.github.com/googleapis/nodejs-security-center/issues/122)) ([3070f29](https://www.github.com/googleapis/nodejs-security-center/commit/3070f29)) + ## [1.0.0](https://www.github.com/googleapis/nodejs-security-center/compare/v0.3.0...v1.0.0) (2019-07-02) diff --git a/packages/google-cloud-securitycenter/package.json b/packages/google-cloud-securitycenter/package.json index 01c8202a65c..45f62082b12 100644 --- a/packages/google-cloud-securitycenter/package.json +++ b/packages/google-cloud-securitycenter/package.json @@ -1,7 +1,7 @@ { "name": "@google-cloud/security-center", "description": "Cloud Security Command Center API client for Node.js", - "version": "1.0.0", + "version": "2.0.0", "license": "Apache-2.0", "author": "Google LLC", "engines": { diff --git a/packages/google-cloud-securitycenter/samples/package.json b/packages/google-cloud-securitycenter/samples/package.json index fb179903e4a..2604a22997c 100644 --- a/packages/google-cloud-securitycenter/samples/package.json +++ b/packages/google-cloud-securitycenter/samples/package.json @@ -9,7 +9,7 @@ }, "license": "Apache-2.0", "dependencies": { - "@google-cloud/security-center": "^1.0.0" + "@google-cloud/security-center": "^2.0.0" }, "devDependencies": { "chai": "^4.2.0", From 45f43aa933a71c263fb0616078947deb5e978d83 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Fri, 26 Jul 2019 18:58:28 +0300 Subject: [PATCH 086/342] chore(deps): update linters (#128) --- packages/google-cloud-securitycenter/package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-securitycenter/package.json b/packages/google-cloud-securitycenter/package.json index 45f62082b12..c3a20c1c1e5 100644 --- a/packages/google-cloud-securitycenter/package.json +++ b/packages/google-cloud-securitycenter/package.json @@ -44,8 +44,8 @@ }, "devDependencies": { "codecov": "^3.0.0", - "eslint": "^5.0.0", - "eslint-config-prettier": "^4.0.0", + "eslint": "^6.0.0", + "eslint-config-prettier": "^6.0.0", "eslint-plugin-node": "^9.0.0", "eslint-plugin-prettier": "^3.0.0", "intelli-espower-loader": "^1.0.1", From 42a4f9e57fca54e9846cd7c0a293acf660e744b3 Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Wed, 31 Jul 2019 08:42:35 -0700 Subject: [PATCH 087/342] docs: use the jsdoc-fresh theme (#129) --- packages/google-cloud-securitycenter/.jsdoc.js | 2 +- packages/google-cloud-securitycenter/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-securitycenter/.jsdoc.js b/packages/google-cloud-securitycenter/.jsdoc.js index 43a96ae8a57..f852daaa0ad 100644 --- a/packages/google-cloud-securitycenter/.jsdoc.js +++ b/packages/google-cloud-securitycenter/.jsdoc.js @@ -20,7 +20,7 @@ module.exports = { opts: { readme: './README.md', package: './package.json', - template: './node_modules/jsdoc-baseline', + template: './node_modules/jsdoc-fresh', recurse: true, verbose: true, destination: './docs/' diff --git a/packages/google-cloud-securitycenter/package.json b/packages/google-cloud-securitycenter/package.json index c3a20c1c1e5..a98c90a42fe 100644 --- a/packages/google-cloud-securitycenter/package.json +++ b/packages/google-cloud-securitycenter/package.json @@ -50,7 +50,7 @@ "eslint-plugin-prettier": "^3.0.0", "intelli-espower-loader": "^1.0.1", "jsdoc": "^3.6.2", - "jsdoc-baseline": "^0.1.0", + "jsdoc-fresh": "^1.0.1", "linkinator": "^1.5.0", "mocha": "^6.0.0", "nyc": "^14.0.0", From bc96125bea591f5d2dd8067f3aede50483337db4 Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Wed, 31 Jul 2019 16:07:08 -0700 Subject: [PATCH 088/342] docs: document apiEndpoint over servicePath (#132) --- .../src/v1/security_center_client.js | 2 +- .../src/v1beta1/security_center_client.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-securitycenter/src/v1/security_center_client.js b/packages/google-cloud-securitycenter/src/v1/security_center_client.js index 6cd47b81644..616447229a5 100644 --- a/packages/google-cloud-securitycenter/src/v1/security_center_client.js +++ b/packages/google-cloud-securitycenter/src/v1/security_center_client.js @@ -52,7 +52,7 @@ class SecurityCenterClient { * your project ID will be detected automatically. * @param {function} [options.promise] - Custom promise module to use instead * of native Promises. - * @param {string} [options.servicePath] - The domain name of the + * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. */ constructor(opts) { diff --git a/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.js b/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.js index ba92f1bfe89..376b3d8f111 100644 --- a/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.js +++ b/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.js @@ -52,7 +52,7 @@ class SecurityCenterClient { * your project ID will be detected automatically. * @param {function} [options.promise] - Custom promise module to use instead * of native Promises. - * @param {string} [options.servicePath] - The domain name of the + * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. */ constructor(opts) { From 4d3244ca12a5f0363cb871a32f97e8232e74e423 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Fri, 2 Aug 2019 10:52:58 -0700 Subject: [PATCH 089/342] fix: allow calls with no request, add JSON proto --- .../protos/protos.json | 2432 +++++++++++++++++ .../src/service_proto_list.json | 1 + .../src/v1/security_center_client.js | 18 + .../src/v1beta1/security_center_client.js | 18 + .../synth.metadata | 10 +- 5 files changed, 2474 insertions(+), 5 deletions(-) create mode 100644 packages/google-cloud-securitycenter/protos/protos.json create mode 100644 packages/google-cloud-securitycenter/src/service_proto_list.json diff --git a/packages/google-cloud-securitycenter/protos/protos.json b/packages/google-cloud-securitycenter/protos/protos.json new file mode 100644 index 00000000000..a7387c92a45 --- /dev/null +++ b/packages/google-cloud-securitycenter/protos/protos.json @@ -0,0 +1,2432 @@ +{ + "nested": { + "google": { + "nested": { + "cloud": { + "nested": { + "securitycenter": { + "nested": { + "v1": { + "options": { + "csharp_namespace": "Google.Cloud.SecurityCenter.V1", + "go_package": "google.golang.org/genproto/googleapis/cloud/securitycenter/v1;securitycenter", + "java_multiple_files": true, + "java_package": "com.google.cloud.securitycenter.v1", + "php_namespace": "Google\\Cloud\\SecurityCenter\\V1", + "ruby_package": "Google::Cloud::SecurityCenter::V1" + }, + "nested": { + "Finding": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "parent": { + "type": "string", + "id": 2 + }, + "resourceName": { + "type": "string", + "id": 3 + }, + "state": { + "type": "State", + "id": 4 + }, + "category": { + "type": "string", + "id": 5 + }, + "externalUri": { + "type": "string", + "id": 6 + }, + "sourceProperties": { + "keyType": "string", + "type": "google.protobuf.Value", + "id": 7 + }, + "securityMarks": { + "type": "SecurityMarks", + "id": 8 + }, + "eventTime": { + "type": "google.protobuf.Timestamp", + "id": 9 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 10 + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "ACTIVE": 1, + "INACTIVE": 2 + } + } + } + }, + "SecurityMarks": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "marks": { + "keyType": "string", + "type": "string", + "id": 2 + } + } + }, + "Asset": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "securityCenterProperties": { + "type": "SecurityCenterProperties", + "id": 2 + }, + "resourceProperties": { + "keyType": "string", + "type": "google.protobuf.Value", + "id": 7 + }, + "securityMarks": { + "type": "SecurityMarks", + "id": 8 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 9 + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 10 + }, + "iamPolicy": { + "type": "IamPolicy", + "id": 11 + } + }, + "nested": { + "SecurityCenterProperties": { + "fields": { + "resourceName": { + "type": "string", + "id": 1 + }, + "resourceType": { + "type": "string", + "id": 2 + }, + "resourceParent": { + "type": "string", + "id": 3 + }, + "resourceProject": { + "type": "string", + "id": 4 + }, + "resourceOwners": { + "rule": "repeated", + "type": "string", + "id": 5 + } + } + }, + "IamPolicy": { + "fields": { + "policyBlob": { + "type": "string", + "id": 1 + } + } + } + } + }, + "Source": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "displayName": { + "type": "string", + "id": 2 + }, + "description": { + "type": "string", + "id": 3 + } + }, + "reserved": [ + [ + 4, + 4 + ] + ] + }, + "SecurityCenter": { + "methods": { + "CreateSource": { + "requestType": "CreateSourceRequest", + "responseType": "Source", + "options": { + "(google.api.http).post": "/v1/{parent=organizations/*}/sources", + "(google.api.http).body": "source" + } + }, + "CreateFinding": { + "requestType": "CreateFindingRequest", + "responseType": "Finding", + "options": { + "(google.api.http).post": "/v1/{parent=organizations/*/sources/*}/findings", + "(google.api.http).body": "finding" + } + }, + "GetIamPolicy": { + "requestType": "google.iam.v1.GetIamPolicyRequest", + "responseType": "google.iam.v1.Policy", + "options": { + "(google.api.http).post": "/v1/{resource=organizations/*/sources/*}:getIamPolicy", + "(google.api.http).body": "*" + } + }, + "GetOrganizationSettings": { + "requestType": "GetOrganizationSettingsRequest", + "responseType": "OrganizationSettings", + "options": { + "(google.api.http).get": "/v1/{name=organizations/*/organizationSettings}" + } + }, + "GetSource": { + "requestType": "GetSourceRequest", + "responseType": "Source", + "options": { + "(google.api.http).get": "/v1/{name=organizations/*/sources/*}" + } + }, + "GroupAssets": { + "requestType": "GroupAssetsRequest", + "responseType": "GroupAssetsResponse", + "options": { + "(google.api.http).post": "/v1/{parent=organizations/*}/assets:group", + "(google.api.http).body": "*" + } + }, + "GroupFindings": { + "requestType": "GroupFindingsRequest", + "responseType": "GroupFindingsResponse", + "options": { + "(google.api.http).post": "/v1/{parent=organizations/*/sources/*}/findings:group", + "(google.api.http).body": "*" + } + }, + "ListAssets": { + "requestType": "ListAssetsRequest", + "responseType": "ListAssetsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=organizations/*}/assets" + } + }, + "ListFindings": { + "requestType": "ListFindingsRequest", + "responseType": "ListFindingsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=organizations/*/sources/*}/findings" + } + }, + "ListSources": { + "requestType": "ListSourcesRequest", + "responseType": "ListSourcesResponse", + "options": { + "(google.api.http).get": "/v1/{parent=organizations/*}/sources" + } + }, + "RunAssetDiscovery": { + "requestType": "RunAssetDiscoveryRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{parent=organizations/*}/assets:runDiscovery", + "(google.api.http).body": "*" + } + }, + "SetFindingState": { + "requestType": "SetFindingStateRequest", + "responseType": "Finding", + "options": { + "(google.api.http).post": "/v1/{name=organizations/*/sources/*/findings/*}:setState", + "(google.api.http).body": "*" + } + }, + "SetIamPolicy": { + "requestType": "google.iam.v1.SetIamPolicyRequest", + "responseType": "google.iam.v1.Policy", + "options": { + "(google.api.http).post": "/v1/{resource=organizations/*/sources/*}:setIamPolicy", + "(google.api.http).body": "*" + } + }, + "TestIamPermissions": { + "requestType": "google.iam.v1.TestIamPermissionsRequest", + "responseType": "google.iam.v1.TestIamPermissionsResponse", + "options": { + "(google.api.http).post": "/v1/{resource=organizations/*/sources/*}:testIamPermissions", + "(google.api.http).body": "*" + } + }, + "UpdateFinding": { + "requestType": "UpdateFindingRequest", + "responseType": "Finding", + "options": { + "(google.api.http).patch": "/v1/{finding.name=organizations/*/sources/*/findings/*}", + "(google.api.http).body": "finding" + } + }, + "UpdateOrganizationSettings": { + "requestType": "UpdateOrganizationSettingsRequest", + "responseType": "OrganizationSettings", + "options": { + "(google.api.http).patch": "/v1/{organization_settings.name=organizations/*/organizationSettings}", + "(google.api.http).body": "organization_settings" + } + }, + "UpdateSource": { + "requestType": "UpdateSourceRequest", + "responseType": "Source", + "options": { + "(google.api.http).patch": "/v1/{source.name=organizations/*/sources/*}", + "(google.api.http).body": "source" + } + }, + "UpdateSecurityMarks": { + "requestType": "UpdateSecurityMarksRequest", + "responseType": "SecurityMarks", + "options": { + "(google.api.http).patch": "/v1/{security_marks.name=organizations/*/assets/*/securityMarks}", + "(google.api.http).body": "security_marks", + "(google.api.http).additional_bindings.patch": "/v1/{security_marks.name=organizations/*/sources/*/findings/*/securityMarks}", + "(google.api.http).additional_bindings.body": "security_marks" + } + } + } + }, + "CreateFindingRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1 + }, + "findingId": { + "type": "string", + "id": 2 + }, + "finding": { + "type": "Finding", + "id": 3 + } + } + }, + "CreateSourceRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1 + }, + "source": { + "type": "Source", + "id": 2 + } + } + }, + "GetOrganizationSettingsRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "GetSourceRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "GroupAssetsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1 + }, + "filter": { + "type": "string", + "id": 2 + }, + "groupBy": { + "type": "string", + "id": 3 + }, + "compareDuration": { + "type": "google.protobuf.Duration", + "id": 4 + }, + "readTime": { + "type": "google.protobuf.Timestamp", + "id": 5 + }, + "pageToken": { + "type": "string", + "id": 7 + }, + "pageSize": { + "type": "int32", + "id": 8 + } + }, + "reserved": [ + [ + 6, + 6 + ] + ] + }, + "GroupAssetsResponse": { + "fields": { + "groupByResults": { + "rule": "repeated", + "type": "GroupResult", + "id": 1 + }, + "readTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + }, + "nextPageToken": { + "type": "string", + "id": 3 + }, + "totalSize": { + "type": "int32", + "id": 4 + } + } + }, + "GroupFindingsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1 + }, + "filter": { + "type": "string", + "id": 2 + }, + "groupBy": { + "type": "string", + "id": 3 + }, + "readTime": { + "type": "google.protobuf.Timestamp", + "id": 4 + }, + "compareDuration": { + "type": "google.protobuf.Duration", + "id": 5 + }, + "pageToken": { + "type": "string", + "id": 7 + }, + "pageSize": { + "type": "int32", + "id": 8 + } + }, + "reserved": [ + [ + 6, + 6 + ] + ] + }, + "GroupFindingsResponse": { + "fields": { + "groupByResults": { + "rule": "repeated", + "type": "GroupResult", + "id": 1 + }, + "readTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + }, + "nextPageToken": { + "type": "string", + "id": 3 + }, + "totalSize": { + "type": "int32", + "id": 4 + } + } + }, + "GroupResult": { + "fields": { + "properties": { + "keyType": "string", + "type": "google.protobuf.Value", + "id": 1 + }, + "count": { + "type": "int64", + "id": 2 + } + } + }, + "ListSourcesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1 + }, + "pageToken": { + "type": "string", + "id": 2 + }, + "pageSize": { + "type": "int32", + "id": 7 + } + } + }, + "ListSourcesResponse": { + "fields": { + "sources": { + "rule": "repeated", + "type": "Source", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "ListAssetsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1 + }, + "filter": { + "type": "string", + "id": 2 + }, + "orderBy": { + "type": "string", + "id": 3 + }, + "readTime": { + "type": "google.protobuf.Timestamp", + "id": 4 + }, + "compareDuration": { + "type": "google.protobuf.Duration", + "id": 5 + }, + "fieldMask": { + "type": "google.protobuf.FieldMask", + "id": 7 + }, + "pageToken": { + "type": "string", + "id": 8 + }, + "pageSize": { + "type": "int32", + "id": 9 + } + }, + "reserved": [ + [ + 6, + 6 + ] + ] + }, + "ListAssetsResponse": { + "fields": { + "listAssetsResults": { + "rule": "repeated", + "type": "ListAssetsResult", + "id": 1 + }, + "readTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + }, + "nextPageToken": { + "type": "string", + "id": 3 + }, + "totalSize": { + "type": "int32", + "id": 4 + } + }, + "nested": { + "ListAssetsResult": { + "fields": { + "asset": { + "type": "Asset", + "id": 1 + }, + "stateChange": { + "type": "StateChange", + "id": 2 + } + }, + "nested": { + "StateChange": { + "values": { + "UNUSED": 0, + "ADDED": 1, + "REMOVED": 2, + "ACTIVE": 3 + } + } + } + } + } + }, + "ListFindingsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1 + }, + "filter": { + "type": "string", + "id": 2 + }, + "orderBy": { + "type": "string", + "id": 3 + }, + "readTime": { + "type": "google.protobuf.Timestamp", + "id": 4 + }, + "compareDuration": { + "type": "google.protobuf.Duration", + "id": 5 + }, + "fieldMask": { + "type": "google.protobuf.FieldMask", + "id": 7 + }, + "pageToken": { + "type": "string", + "id": 8 + }, + "pageSize": { + "type": "int32", + "id": 9 + } + }, + "reserved": [ + [ + 6, + 6 + ] + ] + }, + "ListFindingsResponse": { + "fields": { + "listFindingsResults": { + "rule": "repeated", + "type": "ListFindingsResult", + "id": 1 + }, + "readTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + }, + "nextPageToken": { + "type": "string", + "id": 3 + }, + "totalSize": { + "type": "int32", + "id": 4 + } + }, + "nested": { + "ListFindingsResult": { + "fields": { + "finding": { + "type": "Finding", + "id": 1 + }, + "stateChange": { + "type": "StateChange", + "id": 2 + } + }, + "nested": { + "StateChange": { + "values": { + "UNUSED": 0, + "CHANGED": 1, + "UNCHANGED": 2, + "ADDED": 3, + "REMOVED": 4 + } + } + } + } + } + }, + "SetFindingStateRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "state": { + "type": "Finding.State", + "id": 2 + }, + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 3 + } + } + }, + "RunAssetDiscoveryRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1 + } + } + }, + "UpdateFindingRequest": { + "fields": { + "finding": { + "type": "Finding", + "id": 1 + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2 + } + } + }, + "UpdateOrganizationSettingsRequest": { + "fields": { + "organizationSettings": { + "type": "OrganizationSettings", + "id": 1 + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2 + } + } + }, + "UpdateSourceRequest": { + "fields": { + "source": { + "type": "Source", + "id": 1 + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2 + } + } + }, + "UpdateSecurityMarksRequest": { + "fields": { + "securityMarks": { + "type": "SecurityMarks", + "id": 1 + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2 + }, + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 3 + } + } + }, + "OrganizationSettings": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "enableAssetDiscovery": { + "type": "bool", + "id": 2 + }, + "assetDiscoveryConfig": { + "type": "AssetDiscoveryConfig", + "id": 3 + } + }, + "reserved": [ + [ + 4, + 4 + ], + [ + 5, + 5 + ] + ], + "nested": { + "AssetDiscoveryConfig": { + "fields": { + "projectIds": { + "rule": "repeated", + "type": "string", + "id": 1 + }, + "inclusionMode": { + "type": "InclusionMode", + "id": 2 + } + }, + "nested": { + "InclusionMode": { + "values": { + "INCLUSION_MODE_UNSPECIFIED": 0, + "INCLUDE_ONLY": 1, + "EXCLUDE": 2 + } + } + } + } + } + }, + "RunAssetDiscoveryResponse": { + "fields": { + "state": { + "type": "State", + "id": 1 + }, + "duration": { + "type": "google.protobuf.Duration", + "id": 2 + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "COMPLETED": 1, + "SUPERSEDED": 2, + "TERMINATED": 3 + } + } + } + } + } + } + } + } + } + }, + "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 + } + } + }, + "resourceReference": { + "type": "google.api.ResourceReference", + "id": 1055, + "extend": "google.protobuf.FieldOptions" + }, + "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 + } + }, + "nested": { + "History": { + "values": { + "HISTORY_UNSPECIFIED": 0, + "ORIGINALLY_SINGLE_PATTERN": 1, + "FUTURE_MULTI_PATTERN": 2 + } + } + } + }, + "ResourceReference": { + "fields": { + "type": { + "type": "string", + "id": 1 + }, + "childType": { + "type": "string", + "id": 2 + } + } + } + } + }, + "protobuf": { + "options": { + "go_package": "github.com/golang/protobuf/protoc-gen-go/descriptor;descriptor", + "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": { + "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 + } + } + }, + "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 + } + }, + "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": false + } + }, + "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": [ + [ + 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 + } + }, + "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 + } + } + } + } + }, + "Struct": { + "fields": { + "fields": { + "keyType": "string", + "type": "Value", + "id": 1 + } + } + }, + "Value": { + "oneofs": { + "kind": { + "oneof": [ + "nullValue", + "numberValue", + "stringValue", + "boolValue", + "structValue", + "listValue" + ] + } + }, + "fields": { + "nullValue": { + "type": "NullValue", + "id": 1 + }, + "numberValue": { + "type": "double", + "id": 2 + }, + "stringValue": { + "type": "string", + "id": 3 + }, + "boolValue": { + "type": "bool", + "id": 4 + }, + "structValue": { + "type": "Struct", + "id": 5 + }, + "listValue": { + "type": "ListValue", + "id": 6 + } + } + }, + "NullValue": { + "values": { + "NULL_VALUE": 0 + } + }, + "ListValue": { + "fields": { + "values": { + "rule": "repeated", + "type": "Value", + "id": 1 + } + } + }, + "Timestamp": { + "fields": { + "seconds": { + "type": "int64", + "id": 1 + }, + "nanos": { + "type": "int32", + "id": 2 + } + } + }, + "Duration": { + "fields": { + "seconds": { + "type": "int64", + "id": 1 + }, + "nanos": { + "type": "int32", + "id": 2 + } + } + }, + "Any": { + "fields": { + "type_url": { + "type": "string", + "id": 1 + }, + "value": { + "type": "bytes", + "id": 2 + } + } + }, + "Empty": { + "fields": {} + }, + "FieldMask": { + "fields": { + "paths": { + "rule": "repeated", + "type": "string", + "id": 1 + } + } + } + } + }, + "iam": { + "nested": { + "v1": { + "options": { + "cc_enable_arenas": true, + "csharp_namespace": "Google.Cloud.Iam.V1", + "go_package": "google.golang.org/genproto/googleapis/iam/v1;iam", + "java_multiple_files": true, + "java_outer_classname": "PolicyProto", + "java_package": "com.google.iam.v1", + "php_namespace": "Google\\Cloud\\Iam\\V1" + }, + "nested": { + "IAMPolicy": { + "methods": { + "SetIamPolicy": { + "requestType": "SetIamPolicyRequest", + "responseType": "Policy", + "options": { + "(google.api.http).post": "/v1/{resource=**}:setIamPolicy", + "(google.api.http).body": "*" + } + }, + "GetIamPolicy": { + "requestType": "GetIamPolicyRequest", + "responseType": "Policy", + "options": { + "(google.api.http).post": "/v1/{resource=**}:getIamPolicy", + "(google.api.http).body": "*" + } + }, + "TestIamPermissions": { + "requestType": "TestIamPermissionsRequest", + "responseType": "TestIamPermissionsResponse", + "options": { + "(google.api.http).post": "/v1/{resource=**}:testIamPermissions", + "(google.api.http).body": "*" + } + } + } + }, + "SetIamPolicyRequest": { + "fields": { + "resource": { + "type": "string", + "id": 1 + }, + "policy": { + "type": "Policy", + "id": 2 + } + } + }, + "GetIamPolicyRequest": { + "fields": { + "resource": { + "type": "string", + "id": 1 + } + } + }, + "TestIamPermissionsRequest": { + "fields": { + "resource": { + "type": "string", + "id": 1 + }, + "permissions": { + "rule": "repeated", + "type": "string", + "id": 2 + } + } + }, + "TestIamPermissionsResponse": { + "fields": { + "permissions": { + "rule": "repeated", + "type": "string", + "id": 1 + } + } + }, + "Policy": { + "fields": { + "version": { + "type": "int32", + "id": 1 + }, + "bindings": { + "rule": "repeated", + "type": "Binding", + "id": 4 + }, + "etag": { + "type": "bytes", + "id": 3 + } + } + }, + "Binding": { + "fields": { + "role": { + "type": "string", + "id": 1 + }, + "members": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "condition": { + "type": "google.type.Expr", + "id": 3 + } + } + }, + "PolicyDelta": { + "fields": { + "bindingDeltas": { + "rule": "repeated", + "type": "BindingDelta", + "id": 1 + }, + "auditConfigDeltas": { + "rule": "repeated", + "type": "AuditConfigDelta", + "id": 2 + } + } + }, + "BindingDelta": { + "fields": { + "action": { + "type": "Action", + "id": 1 + }, + "role": { + "type": "string", + "id": 2 + }, + "member": { + "type": "string", + "id": 3 + }, + "condition": { + "type": "google.type.Expr", + "id": 4 + } + }, + "nested": { + "Action": { + "values": { + "ACTION_UNSPECIFIED": 0, + "ADD": 1, + "REMOVE": 2 + } + } + } + }, + "AuditConfigDelta": { + "fields": { + "action": { + "type": "Action", + "id": 1 + }, + "service": { + "type": "string", + "id": 2 + }, + "exemptedMember": { + "type": "string", + "id": 3 + }, + "logType": { + "type": "string", + "id": 4 + } + }, + "nested": { + "Action": { + "values": { + "ACTION_UNSPECIFIED": 0, + "ADD": 1, + "REMOVE": 2 + } + } + } + } + } + } + } + }, + "type": { + "options": { + "go_package": "google.golang.org/genproto/googleapis/type/expr;expr", + "java_multiple_files": true, + "java_outer_classname": "ExprProto", + "java_package": "com.google.type", + "objc_class_prefix": "GTP" + }, + "nested": { + "Expr": { + "fields": { + "expression": { + "type": "string", + "id": 1 + }, + "title": { + "type": "string", + "id": 2 + }, + "description": { + "type": "string", + "id": 3 + }, + "location": { + "type": "string", + "id": 4 + } + } + } + } + }, + "longrunning": { + "options": { + "cc_enable_arenas": true, + "csharp_namespace": "Google.LongRunning", + "go_package": "google.golang.org/genproto/googleapis/longrunning;longrunning", + "java_multiple_files": true, + "java_outer_classname": "OperationsProto", + "java_package": "com.google.longrunning", + "php_namespace": "Google\\LongRunning" + }, + "nested": { + "operationInfo": { + "type": "google.longrunning.OperationInfo", + "id": 1049, + "extend": "google.protobuf.MethodOptions" + }, + "Operations": { + "methods": { + "ListOperations": { + "requestType": "ListOperationsRequest", + "responseType": "ListOperationsResponse", + "options": { + "(google.api.http).get": "/v1/{name=operations}" + } + }, + "GetOperation": { + "requestType": "GetOperationRequest", + "responseType": "Operation", + "options": { + "(google.api.http).get": "/v1/{name=operations/**}" + } + }, + "DeleteOperation": { + "requestType": "DeleteOperationRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/{name=operations/**}" + } + }, + "CancelOperation": { + "requestType": "CancelOperationRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).post": "/v1/{name=operations/**}:cancel", + "(google.api.http).body": "*" + } + }, + "WaitOperation": { + "requestType": "WaitOperationRequest", + "responseType": "Operation" + } + } + }, + "Operation": { + "oneofs": { + "result": { + "oneof": [ + "error", + "response" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "metadata": { + "type": "google.protobuf.Any", + "id": 2 + }, + "done": { + "type": "bool", + "id": 3 + }, + "error": { + "type": "google.rpc.Status", + "id": 4 + }, + "response": { + "type": "google.protobuf.Any", + "id": 5 + } + } + }, + "GetOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "ListOperationsRequest": { + "fields": { + "name": { + "type": "string", + "id": 4 + }, + "filter": { + "type": "string", + "id": 1 + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListOperationsResponse": { + "fields": { + "operations": { + "rule": "repeated", + "type": "Operation", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "CancelOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "DeleteOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "WaitOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "timeout": { + "type": "google.protobuf.Duration", + "id": 2 + } + } + }, + "OperationInfo": { + "fields": { + "responseType": { + "type": "string", + "id": 1 + }, + "metadataType": { + "type": "string", + "id": 2 + } + } + } + } + }, + "rpc": { + "options": { + "go_package": "google.golang.org/genproto/googleapis/rpc/status;status", + "java_multiple_files": true, + "java_outer_classname": "StatusProto", + "java_package": "com.google.rpc", + "objc_class_prefix": "RPC" + }, + "nested": { + "Status": { + "fields": { + "code": { + "type": "int32", + "id": 1 + }, + "message": { + "type": "string", + "id": 2 + }, + "details": { + "rule": "repeated", + "type": "google.protobuf.Any", + "id": 3 + } + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/packages/google-cloud-securitycenter/src/service_proto_list.json b/packages/google-cloud-securitycenter/src/service_proto_list.json new file mode 100644 index 00000000000..08bb6c13c79 --- /dev/null +++ b/packages/google-cloud-securitycenter/src/service_proto_list.json @@ -0,0 +1 @@ +["../protos/google/cloud/securitycenter/v1/finding.proto", "../protos/google/cloud/securitycenter/v1/asset.proto", "../protos/google/cloud/securitycenter/v1/source.proto", "../protos/google/cloud/securitycenter/v1/securitycenter_service.proto", "../protos/google/cloud/securitycenter/v1/organization_settings.proto", "../protos/google/cloud/securitycenter/v1/security_marks.proto", "../protos/google/cloud/securitycenter/v1/run_asset_discovery_response.proto"] \ No newline at end of file diff --git a/packages/google-cloud-securitycenter/src/v1/security_center_client.js b/packages/google-cloud-securitycenter/src/v1/security_center_client.js index 616447229a5..741ca36ec84 100644 --- a/packages/google-cloud-securitycenter/src/v1/security_center_client.js +++ b/packages/google-cloud-securitycenter/src/v1/security_center_client.js @@ -349,6 +349,7 @@ class SecurityCenterClient { callback = options; options = {}; } + request = request || {}; options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; @@ -420,6 +421,7 @@ class SecurityCenterClient { callback = options; options = {}; } + request = request || {}; options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; @@ -479,6 +481,7 @@ class SecurityCenterClient { callback = options; options = {}; } + request = request || {}; options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; @@ -533,6 +536,7 @@ class SecurityCenterClient { callback = options; options = {}; } + request = request || {}; options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; @@ -591,6 +595,7 @@ class SecurityCenterClient { callback = options; options = {}; } + request = request || {}; options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; @@ -809,6 +814,7 @@ class SecurityCenterClient { callback = options; options = {}; } + request = request || {}; options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; @@ -1187,6 +1193,7 @@ class SecurityCenterClient { callback = options; options = {}; } + request = request || {}; options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; @@ -1560,6 +1567,7 @@ class SecurityCenterClient { callback = options; options = {}; } + request = request || {}; options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; @@ -1940,6 +1948,7 @@ class SecurityCenterClient { callback = options; options = {}; } + request = request || {}; options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; @@ -2203,6 +2212,7 @@ class SecurityCenterClient { callback = options; options = {}; } + request = request || {}; options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; @@ -2362,6 +2372,7 @@ class SecurityCenterClient { callback = options; options = {}; } + request = request || {}; options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; @@ -2433,6 +2444,7 @@ class SecurityCenterClient { callback = options; options = {}; } + request = request || {}; options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; @@ -2499,6 +2511,7 @@ class SecurityCenterClient { callback = options; options = {}; } + request = request || {}; options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; @@ -2563,6 +2576,7 @@ class SecurityCenterClient { callback = options; options = {}; } + request = request || {}; options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; @@ -2634,6 +2648,7 @@ class SecurityCenterClient { callback = options; options = {}; } + request = request || {}; options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; @@ -2695,6 +2710,7 @@ class SecurityCenterClient { callback = options; options = {}; } + request = request || {}; options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; @@ -2760,6 +2776,7 @@ class SecurityCenterClient { callback = options; options = {}; } + request = request || {}; options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; @@ -2829,6 +2846,7 @@ class SecurityCenterClient { callback = options; options = {}; } + request = request || {}; options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; diff --git a/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.js b/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.js index 376b3d8f111..6e45a46987d 100644 --- a/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.js +++ b/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.js @@ -343,6 +343,7 @@ class SecurityCenterClient { callback = options; options = {}; } + request = request || {}; options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; @@ -414,6 +415,7 @@ class SecurityCenterClient { callback = options; options = {}; } + request = request || {}; options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; @@ -473,6 +475,7 @@ class SecurityCenterClient { callback = options; options = {}; } + request = request || {}; options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; @@ -527,6 +530,7 @@ class SecurityCenterClient { callback = options; options = {}; } + request = request || {}; options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; @@ -585,6 +589,7 @@ class SecurityCenterClient { callback = options; options = {}; } + request = request || {}; options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; @@ -772,6 +777,7 @@ class SecurityCenterClient { callback = options; options = {}; } + request = request || {}; options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; @@ -1070,6 +1076,7 @@ class SecurityCenterClient { callback = options; options = {}; } + request = request || {}; options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; @@ -1358,6 +1365,7 @@ class SecurityCenterClient { callback = options; options = {}; } + request = request || {}; options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; @@ -1648,6 +1656,7 @@ class SecurityCenterClient { callback = options; options = {}; } + request = request || {}; options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; @@ -1857,6 +1866,7 @@ class SecurityCenterClient { callback = options; options = {}; } + request = request || {}; options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; @@ -2016,6 +2026,7 @@ class SecurityCenterClient { callback = options; options = {}; } + request = request || {}; options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; @@ -2087,6 +2098,7 @@ class SecurityCenterClient { callback = options; options = {}; } + request = request || {}; options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; @@ -2153,6 +2165,7 @@ class SecurityCenterClient { callback = options; options = {}; } + request = request || {}; options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; @@ -2217,6 +2230,7 @@ class SecurityCenterClient { callback = options; options = {}; } + request = request || {}; options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; @@ -2283,6 +2297,7 @@ class SecurityCenterClient { callback = options; options = {}; } + request = request || {}; options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; @@ -2342,6 +2357,7 @@ class SecurityCenterClient { callback = options; options = {}; } + request = request || {}; options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; @@ -2405,6 +2421,7 @@ class SecurityCenterClient { callback = options; options = {}; } + request = request || {}; options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; @@ -2468,6 +2485,7 @@ class SecurityCenterClient { callback = options; options = {}; } + request = request || {}; options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; diff --git a/packages/google-cloud-securitycenter/synth.metadata b/packages/google-cloud-securitycenter/synth.metadata index 2228a8b967e..4ad542cd8c2 100644 --- a/packages/google-cloud-securitycenter/synth.metadata +++ b/packages/google-cloud-securitycenter/synth.metadata @@ -1,19 +1,19 @@ { - "updateTime": "2019-07-19T11:21:50.473296Z", + "updateTime": "2019-08-02T11:24:22.967998Z", "sources": [ { "generator": { "name": "artman", - "version": "0.30.1", - "dockerImage": "googleapis/artman@sha256:f1a2e851e5e012c59e1da4125480bb19878f86a4e7fac4f375f2e819956b5aa3" + "version": "0.32.0", + "dockerImage": "googleapis/artman@sha256:6929f343c400122d85818195b18613330a12a014bffc1e08499550d40571479d" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "f78612e8d008b9678252da84c035da12e92c0093", - "internalRef": "258869625" + "sha": "3a40d3a5f5e5a33fd49888a8a33ed021f65c0ccf", + "internalRef": "261297518" } }, { From 8ac5c0dbb11b8233dd1cad1dfceba3aa72e7b753 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Mon, 5 Aug 2019 10:04:48 -0700 Subject: [PATCH 090/342] chore: release 2.0.1 (#136) * updated CHANGELOG.md [ci skip] * updated package.json [ci skip] * updated samples/package.json [ci skip] --- packages/google-cloud-securitycenter/CHANGELOG.md | 7 +++++++ packages/google-cloud-securitycenter/package.json | 2 +- packages/google-cloud-securitycenter/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-securitycenter/CHANGELOG.md b/packages/google-cloud-securitycenter/CHANGELOG.md index 6cbd2539b68..4434d4d5dee 100644 --- a/packages/google-cloud-securitycenter/CHANGELOG.md +++ b/packages/google-cloud-securitycenter/CHANGELOG.md @@ -4,6 +4,13 @@ [1]: https://www.npmjs.com/package/@google-cloud/security-center?activeTab=versions +### [2.0.1](https://www.github.com/googleapis/nodejs-security-center/compare/v2.0.0...v2.0.1) (2019-08-05) + + +### Bug Fixes + +* allow calls with no request, add JSON proto ([63e4855](https://www.github.com/googleapis/nodejs-security-center/commit/63e4855)) + ## [2.0.0](https://www.github.com/googleapis/nodejs-security-center/compare/v1.0.0...v2.0.0) (2019-07-23) diff --git a/packages/google-cloud-securitycenter/package.json b/packages/google-cloud-securitycenter/package.json index a98c90a42fe..59ad1261276 100644 --- a/packages/google-cloud-securitycenter/package.json +++ b/packages/google-cloud-securitycenter/package.json @@ -1,7 +1,7 @@ { "name": "@google-cloud/security-center", "description": "Cloud Security Command Center API client for Node.js", - "version": "2.0.0", + "version": "2.0.1", "license": "Apache-2.0", "author": "Google LLC", "engines": { diff --git a/packages/google-cloud-securitycenter/samples/package.json b/packages/google-cloud-securitycenter/samples/package.json index 2604a22997c..6c90548cfd4 100644 --- a/packages/google-cloud-securitycenter/samples/package.json +++ b/packages/google-cloud-securitycenter/samples/package.json @@ -9,7 +9,7 @@ }, "license": "Apache-2.0", "dependencies": { - "@google-cloud/security-center": "^2.0.0" + "@google-cloud/security-center": "^2.0.1" }, "devDependencies": { "chai": "^4.2.0", From 987fdc1aef8603594a315e5ea1f4c6951f73ecaf Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Thu, 8 Aug 2019 09:05:20 -0700 Subject: [PATCH 091/342] docs: update jsdoc comments (#137) --- .../src/v1/doc/google/iam/v1/doc_policy.js | 4 ++-- .../src/v1beta1/doc/google/iam/v1/doc_policy.js | 4 ++-- packages/google-cloud-securitycenter/synth.metadata | 10 +++++----- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/packages/google-cloud-securitycenter/src/v1/doc/google/iam/v1/doc_policy.js b/packages/google-cloud-securitycenter/src/v1/doc/google/iam/v1/doc_policy.js index e58c2122510..e1607b08a11 100644 --- a/packages/google-cloud-securitycenter/src/v1/doc/google/iam/v1/doc_policy.js +++ b/packages/google-cloud-securitycenter/src/v1/doc/google/iam/v1/doc_policy.js @@ -81,7 +81,7 @@ * ensure that their change will be applied to the same version of the policy. * * If no `etag` is provided in the call to `setIamPolicy`, then the existing - * policy is overwritten blindly. + * policy is overwritten. * * @typedef Policy * @memberof google.iam.v1 @@ -109,7 +109,7 @@ const Policy = { * who is authenticated with a Google account or a service account. * * * `user:{emailid}`: An email address that represents a specific Google - * account. For example, `alice@gmail.com` . + * account. For example, `alice@example.com` . * * * * `serviceAccount:{emailid}`: An email address that represents a service diff --git a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/iam/v1/doc_policy.js b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/iam/v1/doc_policy.js index e58c2122510..e1607b08a11 100644 --- a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/iam/v1/doc_policy.js +++ b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/iam/v1/doc_policy.js @@ -81,7 +81,7 @@ * ensure that their change will be applied to the same version of the policy. * * If no `etag` is provided in the call to `setIamPolicy`, then the existing - * policy is overwritten blindly. + * policy is overwritten. * * @typedef Policy * @memberof google.iam.v1 @@ -109,7 +109,7 @@ const Policy = { * who is authenticated with a Google account or a service account. * * * `user:{emailid}`: An email address that represents a specific Google - * account. For example, `alice@gmail.com` . + * account. For example, `alice@example.com` . * * * * `serviceAccount:{emailid}`: An email address that represents a service diff --git a/packages/google-cloud-securitycenter/synth.metadata b/packages/google-cloud-securitycenter/synth.metadata index 4ad542cd8c2..67e51e41373 100644 --- a/packages/google-cloud-securitycenter/synth.metadata +++ b/packages/google-cloud-securitycenter/synth.metadata @@ -1,19 +1,19 @@ { - "updateTime": "2019-08-02T11:24:22.967998Z", + "updateTime": "2019-08-08T11:22:12.744139Z", "sources": [ { "generator": { "name": "artman", - "version": "0.32.0", - "dockerImage": "googleapis/artman@sha256:6929f343c400122d85818195b18613330a12a014bffc1e08499550d40571479d" + "version": "0.33.0", + "dockerImage": "googleapis/artman@sha256:c6231efb525569736226b1f7af7565dbc84248efafb3692a5bb1d2d8a7975d53" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "3a40d3a5f5e5a33fd49888a8a33ed021f65c0ccf", - "internalRef": "261297518" + "sha": "7e56e8d4fec63bb04ab4f79a98f65b29f235a0a0", + "internalRef": "262242585" } }, { From 6bf9e49113de104490993c8162c5830e8f8f7d9e Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Sun, 25 Aug 2019 18:04:30 -0700 Subject: [PATCH 092/342] fix: include the correct version of node in a header (#138) --- .../src/v1/security_center_client.js | 2 +- .../src/v1beta1/security_center_client.js | 2 +- packages/google-cloud-securitycenter/synth.metadata | 10 +++++----- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/packages/google-cloud-securitycenter/src/v1/security_center_client.js b/packages/google-cloud-securitycenter/src/v1/security_center_client.js index 741ca36ec84..5f19176dd2b 100644 --- a/packages/google-cloud-securitycenter/src/v1/security_center_client.js +++ b/packages/google-cloud-securitycenter/src/v1/security_center_client.js @@ -82,7 +82,7 @@ class SecurityCenterClient { // Determine the client header string. const clientHeader = [ - `gl-node/${process.version}`, + `gl-node/${process.versions.node}`, `grpc/${gaxGrpc.grpcVersion}`, `gax/${gax.version}`, `gapic/${VERSION}`, diff --git a/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.js b/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.js index 6e45a46987d..8afd3b0a1b7 100644 --- a/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.js +++ b/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.js @@ -82,7 +82,7 @@ class SecurityCenterClient { // Determine the client header string. const clientHeader = [ - `gl-node/${process.version}`, + `gl-node/${process.versions.node}`, `grpc/${gaxGrpc.grpcVersion}`, `gax/${gax.version}`, `gapic/${VERSION}`, diff --git a/packages/google-cloud-securitycenter/synth.metadata b/packages/google-cloud-securitycenter/synth.metadata index 67e51e41373..1ecf478af18 100644 --- a/packages/google-cloud-securitycenter/synth.metadata +++ b/packages/google-cloud-securitycenter/synth.metadata @@ -1,19 +1,19 @@ { - "updateTime": "2019-08-08T11:22:12.744139Z", + "updateTime": "2019-08-21T11:21:48.902286Z", "sources": [ { "generator": { "name": "artman", - "version": "0.33.0", - "dockerImage": "googleapis/artman@sha256:c6231efb525569736226b1f7af7565dbc84248efafb3692a5bb1d2d8a7975d53" + "version": "0.34.0", + "dockerImage": "googleapis/artman@sha256:38a27ba6245f96c3e86df7acb2ebcc33b4f186d9e475efe2d64303aec3d4e0ea" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "7e56e8d4fec63bb04ab4f79a98f65b29f235a0a0", - "internalRef": "262242585" + "sha": "11592a15391951348a64f5c303399733b1c5b3b2", + "internalRef": "264425502" } }, { From 4b97dfd3cc423ee25eb92a9d5a1738b72edf2a98 Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Sun, 25 Aug 2019 19:17:29 -0700 Subject: [PATCH 093/342] refactor: drop dependency on execa (#131) --- packages/google-cloud-securitycenter/samples/package.json | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/google-cloud-securitycenter/samples/package.json b/packages/google-cloud-securitycenter/samples/package.json index 6c90548cfd4..947d8001f55 100644 --- a/packages/google-cloud-securitycenter/samples/package.json +++ b/packages/google-cloud-securitycenter/samples/package.json @@ -13,7 +13,6 @@ }, "devDependencies": { "chai": "^4.2.0", - "execa": "^1.0.0", "mocha": "^6.0.2" } } From a67e85cb7b43f6a152c43276bc75d4b785dd4783 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Tue, 27 Aug 2019 07:35:06 -0700 Subject: [PATCH 094/342] docs: update function documentation --- .../src/v1/doc/google/iam/v1/doc_options.js | 10 +++++++--- .../src/v1/doc/google/iam/v1/doc_policy.js | 9 ++++++++- .../src/v1/doc/google/protobuf/doc_timestamp.js | 10 ++++++---- .../src/v1beta1/doc/google/iam/v1/doc_options.js | 10 +++++++--- .../src/v1beta1/doc/google/iam/v1/doc_policy.js | 9 ++++++++- .../src/v1beta1/doc/google/protobuf/doc_timestamp.js | 10 ++++++---- packages/google-cloud-securitycenter/synth.metadata | 10 +++++----- 7 files changed, 47 insertions(+), 21 deletions(-) diff --git a/packages/google-cloud-securitycenter/src/v1/doc/google/iam/v1/doc_options.js b/packages/google-cloud-securitycenter/src/v1/doc/google/iam/v1/doc_options.js index e4166f39254..b725d806cce 100644 --- a/packages/google-cloud-securitycenter/src/v1/doc/google/iam/v1/doc_options.js +++ b/packages/google-cloud-securitycenter/src/v1/doc/google/iam/v1/doc_options.js @@ -20,9 +20,13 @@ * * @property {number} requestedPolicyVersion * Optional. The policy format version to be returned. - * Acceptable values are 0 and 1. - * If the value is 0, or the field is omitted, policy format version 1 will be - * returned. + * + * Valid values are 0, 1, and 3. Requests specifying an invalid value will be + * rejected. + * + * Requests for policies with any conditional bindings must specify version 3. + * Policies without any conditional bindings may specify any valid value or + * leave the field unset. * * @typedef GetPolicyOptions * @memberof google.iam.v1 diff --git a/packages/google-cloud-securitycenter/src/v1/doc/google/iam/v1/doc_policy.js b/packages/google-cloud-securitycenter/src/v1/doc/google/iam/v1/doc_policy.js index e1607b08a11..2dbe3faa3a6 100644 --- a/packages/google-cloud-securitycenter/src/v1/doc/google/iam/v1/doc_policy.js +++ b/packages/google-cloud-securitycenter/src/v1/doc/google/iam/v1/doc_policy.js @@ -63,7 +63,14 @@ * [IAM developer's guide](https://cloud.google.com/iam/docs). * * @property {number} version - * Deprecated. + * Specifies the format of the policy. + * + * Valid values are 0, 1, and 3. Requests specifying an invalid value will be + * rejected. + * + * Policies with any conditional bindings must specify version 3. Policies + * without any conditional bindings may specify any valid value or leave the + * field unset. * * @property {Object[]} bindings * Associates a list of `members` to a `role`. diff --git a/packages/google-cloud-securitycenter/src/v1/doc/google/protobuf/doc_timestamp.js b/packages/google-cloud-securitycenter/src/v1/doc/google/protobuf/doc_timestamp.js index 98c19dbf0d3..c457acc0c7d 100644 --- a/packages/google-cloud-securitycenter/src/v1/doc/google/protobuf/doc_timestamp.js +++ b/packages/google-cloud-securitycenter/src/v1/doc/google/protobuf/doc_timestamp.js @@ -89,11 +89,13 @@ * 01:30 UTC on January 15, 2017. * * In JavaScript, one can convert a Date object to this format using the - * standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + * standard + * [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) * method. In Python, a standard `datetime.datetime` object can be converted - * to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) - * with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one - * can use the Joda Time's [`ISODateTimeFormat.dateTime()`](https://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime%2D%2D) to obtain a formatter capable of generating timestamps in this format. + * to this format using + * [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with + * the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use + * the Joda Time's [`ISODateTimeFormat.dateTime()`](https://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime%2D%2D) to obtain a formatter capable of generating timestamps in this format. * * @property {number} seconds * Represents seconds of UTC time since Unix epoch diff --git a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/iam/v1/doc_options.js b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/iam/v1/doc_options.js index e4166f39254..b725d806cce 100644 --- a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/iam/v1/doc_options.js +++ b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/iam/v1/doc_options.js @@ -20,9 +20,13 @@ * * @property {number} requestedPolicyVersion * Optional. The policy format version to be returned. - * Acceptable values are 0 and 1. - * If the value is 0, or the field is omitted, policy format version 1 will be - * returned. + * + * Valid values are 0, 1, and 3. Requests specifying an invalid value will be + * rejected. + * + * Requests for policies with any conditional bindings must specify version 3. + * Policies without any conditional bindings may specify any valid value or + * leave the field unset. * * @typedef GetPolicyOptions * @memberof google.iam.v1 diff --git a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/iam/v1/doc_policy.js b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/iam/v1/doc_policy.js index e1607b08a11..2dbe3faa3a6 100644 --- a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/iam/v1/doc_policy.js +++ b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/iam/v1/doc_policy.js @@ -63,7 +63,14 @@ * [IAM developer's guide](https://cloud.google.com/iam/docs). * * @property {number} version - * Deprecated. + * Specifies the format of the policy. + * + * Valid values are 0, 1, and 3. Requests specifying an invalid value will be + * rejected. + * + * Policies with any conditional bindings must specify version 3. Policies + * without any conditional bindings may specify any valid value or leave the + * field unset. * * @property {Object[]} bindings * Associates a list of `members` to a `role`. diff --git a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/protobuf/doc_timestamp.js b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/protobuf/doc_timestamp.js index 98c19dbf0d3..c457acc0c7d 100644 --- a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/protobuf/doc_timestamp.js +++ b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/protobuf/doc_timestamp.js @@ -89,11 +89,13 @@ * 01:30 UTC on January 15, 2017. * * In JavaScript, one can convert a Date object to this format using the - * standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + * standard + * [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) * method. In Python, a standard `datetime.datetime` object can be converted - * to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) - * with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one - * can use the Joda Time's [`ISODateTimeFormat.dateTime()`](https://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime%2D%2D) to obtain a formatter capable of generating timestamps in this format. + * to this format using + * [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with + * the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use + * the Joda Time's [`ISODateTimeFormat.dateTime()`](https://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime%2D%2D) to obtain a formatter capable of generating timestamps in this format. * * @property {number} seconds * Represents seconds of UTC time since Unix epoch diff --git a/packages/google-cloud-securitycenter/synth.metadata b/packages/google-cloud-securitycenter/synth.metadata index 1ecf478af18..c1e8d67a8e1 100644 --- a/packages/google-cloud-securitycenter/synth.metadata +++ b/packages/google-cloud-securitycenter/synth.metadata @@ -1,19 +1,19 @@ { - "updateTime": "2019-08-21T11:21:48.902286Z", + "updateTime": "2019-08-27T11:19:06.222743Z", "sources": [ { "generator": { "name": "artman", - "version": "0.34.0", - "dockerImage": "googleapis/artman@sha256:38a27ba6245f96c3e86df7acb2ebcc33b4f186d9e475efe2d64303aec3d4e0ea" + "version": "0.35.1", + "dockerImage": "googleapis/artman@sha256:b11c7ea0d0831c54016fb50f4b796d24d1971439b30fbc32a369ba1ac887c384" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "11592a15391951348a64f5c303399733b1c5b3b2", - "internalRef": "264425502" + "sha": "650caad718bb063f189405c23972dc9818886358", + "internalRef": "265565344" } }, { From d785b7aae2df787025c88f029c4879a5fcf3371a Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Wed, 28 Aug 2019 12:21:54 -0700 Subject: [PATCH 095/342] docs: update link to client docs (#141) --- packages/google-cloud-securitycenter/README.md | 4 +--- packages/google-cloud-securitycenter/synth.metadata | 6 +++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/packages/google-cloud-securitycenter/README.md b/packages/google-cloud-securitycenter/README.md index 9b8819b9479..61a70ed5ddc 100644 --- a/packages/google-cloud-securitycenter/README.md +++ b/packages/google-cloud-securitycenter/README.md @@ -127,12 +127,10 @@ Apache Version 2.0 See [LICENSE](https://github.com/googleapis/nodejs-security-center/blob/master/LICENSE) -[client-docs]: https://googleapis.dev/nodejs/security-center/latest#reference +[client-docs]: https://googleapis.dev/nodejs/security-center/latest [product-docs]: https://cloud.google.com/security-command-center [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=securitycenter.googleapis.com [auth]: https://cloud.google.com/docs/authentication/getting-started - - diff --git a/packages/google-cloud-securitycenter/synth.metadata b/packages/google-cloud-securitycenter/synth.metadata index c1e8d67a8e1..a3be3edca7d 100644 --- a/packages/google-cloud-securitycenter/synth.metadata +++ b/packages/google-cloud-securitycenter/synth.metadata @@ -1,5 +1,5 @@ { - "updateTime": "2019-08-27T11:19:06.222743Z", + "updateTime": "2019-08-28T11:20:59.012640Z", "sources": [ { "generator": { @@ -12,8 +12,8 @@ "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "650caad718bb063f189405c23972dc9818886358", - "internalRef": "265565344" + "sha": "dbd38035c35083507e2f0b839985cf17e212cb1c", + "internalRef": "265796259" } }, { From a2c440b7da2b9a62a673656685ddff7682781448 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Tue, 3 Sep 2019 10:05:00 -0700 Subject: [PATCH 096/342] feat: load protos from JSON, grpc-fallback support (#142) --- .../protos/protos.json | 1127 +++++++++++++---- .../src/browser.js | 21 + .../src/service_proto_list.json | 1 - .../src/v1/security_center_client.js | 115 +- .../src/v1/security_center_proto_list.json | 3 + .../src/v1beta1/security_center_client.js | 113 +- .../v1beta1/security_center_proto_list.json | 3 + .../synth.metadata | 10 +- packages/google-cloud-securitycenter/synth.py | 1 + .../test/gapic-v1.js | 7 + .../webpack.config.js | 46 + 11 files changed, 1133 insertions(+), 314 deletions(-) create mode 100644 packages/google-cloud-securitycenter/src/browser.js delete mode 100644 packages/google-cloud-securitycenter/src/service_proto_list.json create mode 100644 packages/google-cloud-securitycenter/src/v1/security_center_proto_list.json create mode 100644 packages/google-cloud-securitycenter/src/v1beta1/security_center_proto_list.json create mode 100644 packages/google-cloud-securitycenter/webpack.config.js diff --git a/packages/google-cloud-securitycenter/protos/protos.json b/packages/google-cloud-securitycenter/protos/protos.json index a7387c92a45..26544b8c767 100644 --- a/packages/google-cloud-securitycenter/protos/protos.json +++ b/packages/google-cloud-securitycenter/protos/protos.json @@ -16,70 +16,603 @@ "ruby_package": "Google::Cloud::SecurityCenter::V1" }, "nested": { - "Finding": { + "SecurityCenter": { + "methods": { + "CreateSource": { + "requestType": "CreateSourceRequest", + "responseType": "Source", + "options": { + "(google.api.http).post": "/v1/{parent=organizations/*}/sources", + "(google.api.http).body": "source" + } + }, + "CreateFinding": { + "requestType": "CreateFindingRequest", + "responseType": "Finding", + "options": { + "(google.api.http).post": "/v1/{parent=organizations/*/sources/*}/findings", + "(google.api.http).body": "finding" + } + }, + "GetIamPolicy": { + "requestType": "google.iam.v1.GetIamPolicyRequest", + "responseType": "google.iam.v1.Policy", + "options": { + "(google.api.http).post": "/v1/{resource=organizations/*/sources/*}:getIamPolicy", + "(google.api.http).body": "*" + } + }, + "GetOrganizationSettings": { + "requestType": "GetOrganizationSettingsRequest", + "responseType": "OrganizationSettings", + "options": { + "(google.api.http).get": "/v1/{name=organizations/*/organizationSettings}" + } + }, + "GetSource": { + "requestType": "GetSourceRequest", + "responseType": "Source", + "options": { + "(google.api.http).get": "/v1/{name=organizations/*/sources/*}" + } + }, + "GroupAssets": { + "requestType": "GroupAssetsRequest", + "responseType": "GroupAssetsResponse", + "options": { + "(google.api.http).post": "/v1/{parent=organizations/*}/assets:group", + "(google.api.http).body": "*" + } + }, + "GroupFindings": { + "requestType": "GroupFindingsRequest", + "responseType": "GroupFindingsResponse", + "options": { + "(google.api.http).post": "/v1/{parent=organizations/*/sources/*}/findings:group", + "(google.api.http).body": "*" + } + }, + "ListAssets": { + "requestType": "ListAssetsRequest", + "responseType": "ListAssetsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=organizations/*}/assets" + } + }, + "ListFindings": { + "requestType": "ListFindingsRequest", + "responseType": "ListFindingsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=organizations/*/sources/*}/findings" + } + }, + "ListSources": { + "requestType": "ListSourcesRequest", + "responseType": "ListSourcesResponse", + "options": { + "(google.api.http).get": "/v1/{parent=organizations/*}/sources" + } + }, + "RunAssetDiscovery": { + "requestType": "RunAssetDiscoveryRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{parent=organizations/*}/assets:runDiscovery", + "(google.api.http).body": "*" + } + }, + "SetFindingState": { + "requestType": "SetFindingStateRequest", + "responseType": "Finding", + "options": { + "(google.api.http).post": "/v1/{name=organizations/*/sources/*/findings/*}:setState", + "(google.api.http).body": "*" + } + }, + "SetIamPolicy": { + "requestType": "google.iam.v1.SetIamPolicyRequest", + "responseType": "google.iam.v1.Policy", + "options": { + "(google.api.http).post": "/v1/{resource=organizations/*/sources/*}:setIamPolicy", + "(google.api.http).body": "*" + } + }, + "TestIamPermissions": { + "requestType": "google.iam.v1.TestIamPermissionsRequest", + "responseType": "google.iam.v1.TestIamPermissionsResponse", + "options": { + "(google.api.http).post": "/v1/{resource=organizations/*/sources/*}:testIamPermissions", + "(google.api.http).body": "*" + } + }, + "UpdateFinding": { + "requestType": "UpdateFindingRequest", + "responseType": "Finding", + "options": { + "(google.api.http).patch": "/v1/{finding.name=organizations/*/sources/*/findings/*}", + "(google.api.http).body": "finding" + } + }, + "UpdateOrganizationSettings": { + "requestType": "UpdateOrganizationSettingsRequest", + "responseType": "OrganizationSettings", + "options": { + "(google.api.http).patch": "/v1/{organization_settings.name=organizations/*/organizationSettings}", + "(google.api.http).body": "organization_settings" + } + }, + "UpdateSource": { + "requestType": "UpdateSourceRequest", + "responseType": "Source", + "options": { + "(google.api.http).patch": "/v1/{source.name=organizations/*/sources/*}", + "(google.api.http).body": "source" + } + }, + "UpdateSecurityMarks": { + "requestType": "UpdateSecurityMarksRequest", + "responseType": "SecurityMarks", + "options": { + "(google.api.http).patch": "/v1/{security_marks.name=organizations/*/assets/*/securityMarks}", + "(google.api.http).body": "security_marks", + "(google.api.http).additional_bindings.patch": "/v1/{security_marks.name=organizations/*/sources/*/findings/*/securityMarks}", + "(google.api.http).additional_bindings.body": "security_marks" + } + } + } + }, + "CreateFindingRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1 + }, + "findingId": { + "type": "string", + "id": 2 + }, + "finding": { + "type": "Finding", + "id": 3 + } + } + }, + "CreateSourceRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1 + }, + "source": { + "type": "Source", + "id": 2 + } + } + }, + "GetOrganizationSettingsRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "GetSourceRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "GroupAssetsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1 + }, + "filter": { + "type": "string", + "id": 2 + }, + "groupBy": { + "type": "string", + "id": 3 + }, + "compareDuration": { + "type": "google.protobuf.Duration", + "id": 4 + }, + "readTime": { + "type": "google.protobuf.Timestamp", + "id": 5 + }, + "pageToken": { + "type": "string", + "id": 7 + }, + "pageSize": { + "type": "int32", + "id": 8 + } + }, + "reserved": [ + [ + 6, + 6 + ] + ] + }, + "GroupAssetsResponse": { + "fields": { + "groupByResults": { + "rule": "repeated", + "type": "GroupResult", + "id": 1 + }, + "readTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + }, + "nextPageToken": { + "type": "string", + "id": 3 + }, + "totalSize": { + "type": "int32", + "id": 4 + } + } + }, + "GroupFindingsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1 + }, + "filter": { + "type": "string", + "id": 2 + }, + "groupBy": { + "type": "string", + "id": 3 + }, + "readTime": { + "type": "google.protobuf.Timestamp", + "id": 4 + }, + "compareDuration": { + "type": "google.protobuf.Duration", + "id": 5 + }, + "pageToken": { + "type": "string", + "id": 7 + }, + "pageSize": { + "type": "int32", + "id": 8 + } + }, + "reserved": [ + [ + 6, + 6 + ] + ] + }, + "GroupFindingsResponse": { + "fields": { + "groupByResults": { + "rule": "repeated", + "type": "GroupResult", + "id": 1 + }, + "readTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + }, + "nextPageToken": { + "type": "string", + "id": 3 + }, + "totalSize": { + "type": "int32", + "id": 4 + } + } + }, + "GroupResult": { "fields": { - "name": { + "properties": { + "keyType": "string", + "type": "google.protobuf.Value", + "id": 1 + }, + "count": { + "type": "int64", + "id": 2 + } + } + }, + "ListSourcesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1 + }, + "pageToken": { "type": "string", + "id": 2 + }, + "pageSize": { + "type": "int32", + "id": 7 + } + } + }, + "ListSourcesResponse": { + "fields": { + "sources": { + "rule": "repeated", + "type": "Source", "id": 1 }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "ListAssetsRequest": { + "fields": { "parent": { + "type": "string", + "id": 1 + }, + "filter": { "type": "string", "id": 2 }, - "resourceName": { + "orderBy": { "type": "string", "id": 3 }, - "state": { - "type": "State", + "readTime": { + "type": "google.protobuf.Timestamp", "id": 4 }, - "category": { - "type": "string", + "compareDuration": { + "type": "google.protobuf.Duration", "id": 5 }, - "externalUri": { + "fieldMask": { + "type": "google.protobuf.FieldMask", + "id": 7 + }, + "pageToken": { "type": "string", - "id": 6 + "id": 8 }, - "sourceProperties": { - "keyType": "string", - "type": "google.protobuf.Value", + "pageSize": { + "type": "int32", + "id": 9 + } + }, + "reserved": [ + [ + 6, + 6 + ] + ] + }, + "ListAssetsResponse": { + "fields": { + "listAssetsResults": { + "rule": "repeated", + "type": "ListAssetsResult", + "id": 1 + }, + "readTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + }, + "nextPageToken": { + "type": "string", + "id": 3 + }, + "totalSize": { + "type": "int32", + "id": 4 + } + }, + "nested": { + "ListAssetsResult": { + "fields": { + "asset": { + "type": "Asset", + "id": 1 + }, + "stateChange": { + "type": "StateChange", + "id": 2 + } + }, + "nested": { + "StateChange": { + "values": { + "UNUSED": 0, + "ADDED": 1, + "REMOVED": 2, + "ACTIVE": 3 + } + } + } + } + } + }, + "ListFindingsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1 + }, + "filter": { + "type": "string", + "id": 2 + }, + "orderBy": { + "type": "string", + "id": 3 + }, + "readTime": { + "type": "google.protobuf.Timestamp", + "id": 4 + }, + "compareDuration": { + "type": "google.protobuf.Duration", + "id": 5 + }, + "fieldMask": { + "type": "google.protobuf.FieldMask", "id": 7 }, - "securityMarks": { - "type": "SecurityMarks", + "pageToken": { + "type": "string", "id": 8 }, - "eventTime": { - "type": "google.protobuf.Timestamp", + "pageSize": { + "type": "int32", "id": 9 + } + }, + "reserved": [ + [ + 6, + 6 + ] + ] + }, + "ListFindingsResponse": { + "fields": { + "listFindingsResults": { + "rule": "repeated", + "type": "ListFindingsResult", + "id": 1 + }, + "readTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + }, + "nextPageToken": { + "type": "string", + "id": 3 + }, + "totalSize": { + "type": "int32", + "id": 4 + } + }, + "nested": { + "ListFindingsResult": { + "fields": { + "finding": { + "type": "Finding", + "id": 1 + }, + "stateChange": { + "type": "StateChange", + "id": 2 + } + }, + "nested": { + "StateChange": { + "values": { + "UNUSED": 0, + "CHANGED": 1, + "UNCHANGED": 2, + "ADDED": 3, + "REMOVED": 4 + } + } + } + } + } + }, + "SetFindingStateRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "state": { + "type": "Finding.State", + "id": 2 + }, + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 3 + } + } + }, + "RunAssetDiscoveryRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1 + } + } + }, + "UpdateFindingRequest": { + "fields": { + "finding": { + "type": "Finding", + "id": 1 + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2 + } + } + }, + "UpdateOrganizationSettingsRequest": { + "fields": { + "organizationSettings": { + "type": "OrganizationSettings", + "id": 1 }, - "createTime": { - "type": "google.protobuf.Timestamp", - "id": 10 + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2 } - }, - "nested": { - "State": { - "values": { - "STATE_UNSPECIFIED": 0, - "ACTIVE": 1, - "INACTIVE": 2 - } + } + }, + "UpdateSourceRequest": { + "fields": { + "source": { + "type": "Source", + "id": 1 + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2 } } }, - "SecurityMarks": { + "UpdateSecurityMarksRequest": { "fields": { - "name": { - "type": "string", + "securityMarks": { + "type": "SecurityMarks", "id": 1 }, - "marks": { - "keyType": "string", - "type": "string", + "updateMask": { + "type": "google.protobuf.FieldMask", "id": 2 + }, + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 3 } } }, @@ -151,6 +684,145 @@ } } }, + "SecurityMarks": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "marks": { + "keyType": "string", + "type": "string", + "id": 2 + } + } + }, + "Finding": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "parent": { + "type": "string", + "id": 2 + }, + "resourceName": { + "type": "string", + "id": 3 + }, + "state": { + "type": "State", + "id": 4 + }, + "category": { + "type": "string", + "id": 5 + }, + "externalUri": { + "type": "string", + "id": 6 + }, + "sourceProperties": { + "keyType": "string", + "type": "google.protobuf.Value", + "id": 7 + }, + "securityMarks": { + "type": "SecurityMarks", + "id": 8 + }, + "eventTime": { + "type": "google.protobuf.Timestamp", + "id": 9 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 10 + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "ACTIVE": 1, + "INACTIVE": 2 + } + } + } + }, + "OrganizationSettings": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "enableAssetDiscovery": { + "type": "bool", + "id": 2 + }, + "assetDiscoveryConfig": { + "type": "AssetDiscoveryConfig", + "id": 3 + } + }, + "reserved": [ + [ + 4, + 4 + ], + [ + 5, + 5 + ] + ], + "nested": { + "AssetDiscoveryConfig": { + "fields": { + "projectIds": { + "rule": "repeated", + "type": "string", + "id": 1 + }, + "inclusionMode": { + "type": "InclusionMode", + "id": 2 + } + }, + "nested": { + "InclusionMode": { + "values": { + "INCLUSION_MODE_UNSPECIFIED": 0, + "INCLUDE_ONLY": 1, + "EXCLUDE": 2 + } + } + } + } + } + }, + "RunAssetDiscoveryResponse": { + "fields": { + "state": { + "type": "State", + "id": 1 + }, + "duration": { + "type": "google.protobuf.Duration", + "id": 2 + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "COMPLETED": 1, + "SUPERSEDED": 2, + "TERMINATED": 3 + } + } + } + }, "Source": { "fields": { "name": { @@ -172,14 +844,23 @@ 4 ] ] - }, + } + } + }, + "v1beta1": { + "options": { + "go_package": "google.golang.org/genproto/googleapis/cloud/securitycenter/v1beta1;securitycenter", + "java_multiple_files": true, + "java_package": "com.google.cloud.securitycenter.v1beta1" + }, + "nested": { "SecurityCenter": { "methods": { "CreateSource": { "requestType": "CreateSourceRequest", "responseType": "Source", "options": { - "(google.api.http).post": "/v1/{parent=organizations/*}/sources", + "(google.api.http).post": "/v1beta1/{parent=organizations/*}/sources", "(google.api.http).body": "source" } }, @@ -187,7 +868,7 @@ "requestType": "CreateFindingRequest", "responseType": "Finding", "options": { - "(google.api.http).post": "/v1/{parent=organizations/*/sources/*}/findings", + "(google.api.http).post": "/v1beta1/{parent=organizations/*/sources/*}/findings", "(google.api.http).body": "finding" } }, @@ -195,7 +876,7 @@ "requestType": "google.iam.v1.GetIamPolicyRequest", "responseType": "google.iam.v1.Policy", "options": { - "(google.api.http).post": "/v1/{resource=organizations/*/sources/*}:getIamPolicy", + "(google.api.http).post": "/v1beta1/{resource=organizations/*/sources/*}:getIamPolicy", "(google.api.http).body": "*" } }, @@ -203,21 +884,21 @@ "requestType": "GetOrganizationSettingsRequest", "responseType": "OrganizationSettings", "options": { - "(google.api.http).get": "/v1/{name=organizations/*/organizationSettings}" + "(google.api.http).get": "/v1beta1/{name=organizations/*/organizationSettings}" } }, "GetSource": { "requestType": "GetSourceRequest", "responseType": "Source", "options": { - "(google.api.http).get": "/v1/{name=organizations/*/sources/*}" + "(google.api.http).get": "/v1beta1/{name=organizations/*/sources/*}" } }, "GroupAssets": { "requestType": "GroupAssetsRequest", "responseType": "GroupAssetsResponse", "options": { - "(google.api.http).post": "/v1/{parent=organizations/*}/assets:group", + "(google.api.http).post": "/v1beta1/{parent=organizations/*}/assets:group", "(google.api.http).body": "*" } }, @@ -225,7 +906,7 @@ "requestType": "GroupFindingsRequest", "responseType": "GroupFindingsResponse", "options": { - "(google.api.http).post": "/v1/{parent=organizations/*/sources/*}/findings:group", + "(google.api.http).post": "/v1beta1/{parent=organizations/*/sources/*}/findings:group", "(google.api.http).body": "*" } }, @@ -233,28 +914,28 @@ "requestType": "ListAssetsRequest", "responseType": "ListAssetsResponse", "options": { - "(google.api.http).get": "/v1/{parent=organizations/*}/assets" + "(google.api.http).get": "/v1beta1/{parent=organizations/*}/assets" } }, "ListFindings": { "requestType": "ListFindingsRequest", "responseType": "ListFindingsResponse", "options": { - "(google.api.http).get": "/v1/{parent=organizations/*/sources/*}/findings" + "(google.api.http).get": "/v1beta1/{parent=organizations/*/sources/*}/findings" } }, "ListSources": { "requestType": "ListSourcesRequest", "responseType": "ListSourcesResponse", "options": { - "(google.api.http).get": "/v1/{parent=organizations/*}/sources" + "(google.api.http).get": "/v1beta1/{parent=organizations/*}/sources" } }, "RunAssetDiscovery": { "requestType": "RunAssetDiscoveryRequest", "responseType": "google.longrunning.Operation", "options": { - "(google.api.http).post": "/v1/{parent=organizations/*}/assets:runDiscovery", + "(google.api.http).post": "/v1beta1/{parent=organizations/*}/assets:runDiscovery", "(google.api.http).body": "*" } }, @@ -262,7 +943,7 @@ "requestType": "SetFindingStateRequest", "responseType": "Finding", "options": { - "(google.api.http).post": "/v1/{name=organizations/*/sources/*/findings/*}:setState", + "(google.api.http).post": "/v1beta1/{name=organizations/*/sources/*/findings/*}:setState", "(google.api.http).body": "*" } }, @@ -270,7 +951,7 @@ "requestType": "google.iam.v1.SetIamPolicyRequest", "responseType": "google.iam.v1.Policy", "options": { - "(google.api.http).post": "/v1/{resource=organizations/*/sources/*}:setIamPolicy", + "(google.api.http).post": "/v1beta1/{resource=organizations/*/sources/*}:setIamPolicy", "(google.api.http).body": "*" } }, @@ -278,7 +959,7 @@ "requestType": "google.iam.v1.TestIamPermissionsRequest", "responseType": "google.iam.v1.TestIamPermissionsResponse", "options": { - "(google.api.http).post": "/v1/{resource=organizations/*/sources/*}:testIamPermissions", + "(google.api.http).post": "/v1beta1/{resource=organizations/*/sources/*}:testIamPermissions", "(google.api.http).body": "*" } }, @@ -286,7 +967,7 @@ "requestType": "UpdateFindingRequest", "responseType": "Finding", "options": { - "(google.api.http).patch": "/v1/{finding.name=organizations/*/sources/*/findings/*}", + "(google.api.http).patch": "/v1beta1/{finding.name=organizations/*/sources/*/findings/*}", "(google.api.http).body": "finding" } }, @@ -294,7 +975,7 @@ "requestType": "UpdateOrganizationSettingsRequest", "responseType": "OrganizationSettings", "options": { - "(google.api.http).patch": "/v1/{organization_settings.name=organizations/*/organizationSettings}", + "(google.api.http).patch": "/v1beta1/{organization_settings.name=organizations/*/organizationSettings}", "(google.api.http).body": "organization_settings" } }, @@ -302,7 +983,7 @@ "requestType": "UpdateSourceRequest", "responseType": "Source", "options": { - "(google.api.http).patch": "/v1/{source.name=organizations/*/sources/*}", + "(google.api.http).patch": "/v1beta1/{source.name=organizations/*/sources/*}", "(google.api.http).body": "source" } }, @@ -310,9 +991,9 @@ "requestType": "UpdateSecurityMarksRequest", "responseType": "SecurityMarks", "options": { - "(google.api.http).patch": "/v1/{security_marks.name=organizations/*/assets/*/securityMarks}", + "(google.api.http).patch": "/v1beta1/{security_marks.name=organizations/*/assets/*/securityMarks}", "(google.api.http).body": "security_marks", - "(google.api.http).additional_bindings.patch": "/v1/{security_marks.name=organizations/*/sources/*/findings/*/securityMarks}", + "(google.api.http).additional_bindings.patch": "/v1beta1/{security_marks.name=organizations/*/sources/*/findings/*/securityMarks}", "(google.api.http).additional_bindings.body": "security_marks" } } @@ -392,13 +1073,7 @@ "type": "int32", "id": 8 } - }, - "reserved": [ - [ - 6, - 6 - ] - ] + } }, "GroupAssetsResponse": { "fields": { @@ -414,10 +1089,6 @@ "nextPageToken": { "type": "string", "id": 3 - }, - "totalSize": { - "type": "int32", - "id": 4 } } }, @@ -439,25 +1110,15 @@ "type": "google.protobuf.Timestamp", "id": 4 }, - "compareDuration": { - "type": "google.protobuf.Duration", - "id": 5 - }, "pageToken": { "type": "string", - "id": 7 + "id": 5 }, "pageSize": { "type": "int32", - "id": 8 + "id": 6 } - }, - "reserved": [ - [ - 6, - 6 - ] - ] + } }, "GroupFindingsResponse": { "fields": { @@ -473,10 +1134,6 @@ "nextPageToken": { "type": "string", "id": 3 - }, - "totalSize": { - "type": "int32", - "id": 4 } } }, @@ -555,14 +1212,8 @@ "pageSize": { "type": "int32", "id": 9 - } - }, - "reserved": [ - [ - 6, - 6 - ] - ] + } + } }, "ListAssetsResponse": { "fields": { @@ -591,18 +1242,19 @@ "type": "Asset", "id": 1 }, - "stateChange": { - "type": "StateChange", + "state": { + "type": "State", "id": 2 } }, "nested": { - "StateChange": { + "State": { "values": { - "UNUSED": 0, - "ADDED": 1, - "REMOVED": 2, - "ACTIVE": 3 + "STATE_UNSPECIFIED": 0, + "UNUSED": 1, + "ADDED": 2, + "REMOVED": 3, + "ACTIVE": 4 } } } @@ -627,35 +1279,25 @@ "type": "google.protobuf.Timestamp", "id": 4 }, - "compareDuration": { - "type": "google.protobuf.Duration", - "id": 5 - }, "fieldMask": { "type": "google.protobuf.FieldMask", - "id": 7 + "id": 5 }, "pageToken": { "type": "string", - "id": 8 + "id": 6 }, "pageSize": { "type": "int32", - "id": 9 + "id": 7 } - }, - "reserved": [ - [ - 6, - 6 - ] - ] + } }, "ListFindingsResponse": { "fields": { - "listFindingsResults": { + "findings": { "rule": "repeated", - "type": "ListFindingsResult", + "type": "Finding", "id": 1 }, "readTime": { @@ -670,31 +1312,6 @@ "type": "int32", "id": 4 } - }, - "nested": { - "ListFindingsResult": { - "fields": { - "finding": { - "type": "Finding", - "id": 1 - }, - "stateChange": { - "type": "StateChange", - "id": 2 - } - }, - "nested": { - "StateChange": { - "values": { - "UNUSED": 0, - "CHANGED": 1, - "UNCHANGED": 2, - "ADDED": 3, - "REMOVED": 4 - } - } - } - } } }, "SetFindingStateRequest": { @@ -773,6 +1390,129 @@ } } }, + "Asset": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "securityCenterProperties": { + "type": "SecurityCenterProperties", + "id": 2 + }, + "resourceProperties": { + "keyType": "string", + "type": "google.protobuf.Value", + "id": 7 + }, + "securityMarks": { + "type": "SecurityMarks", + "id": 8 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 9 + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 10 + } + }, + "nested": { + "SecurityCenterProperties": { + "fields": { + "resourceName": { + "type": "string", + "id": 1 + }, + "resourceType": { + "type": "string", + "id": 2 + }, + "resourceParent": { + "type": "string", + "id": 3 + }, + "resourceProject": { + "type": "string", + "id": 4 + }, + "resourceOwners": { + "rule": "repeated", + "type": "string", + "id": 5 + } + } + } + } + }, + "SecurityMarks": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "marks": { + "keyType": "string", + "type": "string", + "id": 2 + } + } + }, + "Finding": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "parent": { + "type": "string", + "id": 2 + }, + "resourceName": { + "type": "string", + "id": 3 + }, + "state": { + "type": "State", + "id": 4 + }, + "category": { + "type": "string", + "id": 5 + }, + "externalUri": { + "type": "string", + "id": 6 + }, + "sourceProperties": { + "keyType": "string", + "type": "google.protobuf.Value", + "id": 7 + }, + "securityMarks": { + "type": "SecurityMarks", + "id": 8 + }, + "eventTime": { + "type": "google.protobuf.Timestamp", + "id": 9 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 10 + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "ACTIVE": 1, + "INACTIVE": 2 + } + } + } + }, "OrganizationSettings": { "fields": { "name": { @@ -788,16 +1528,6 @@ "id": 3 } }, - "reserved": [ - [ - 4, - 4 - ], - [ - 5, - 5 - ] - ], "nested": { "AssetDiscoveryConfig": { "fields": { @@ -823,25 +1553,19 @@ } } }, - "RunAssetDiscoveryResponse": { + "Source": { "fields": { - "state": { - "type": "State", + "name": { + "type": "string", "id": 1 }, - "duration": { - "type": "google.protobuf.Duration", + "displayName": { + "type": "string", "id": 2 - } - }, - "nested": { - "State": { - "values": { - "STATE_UNSPECIFIED": 0, - "COMPLETED": 1, - "SUPERSEDED": 2, - "TERMINATED": 3 - } + }, + "description": { + "type": "string", + "id": 3 } } } @@ -855,7 +1579,7 @@ "options": { "go_package": "google.golang.org/genproto/googleapis/api/annotations;annotations", "java_multiple_files": true, - "java_outer_classname": "ResourceProto", + "java_outer_classname": "ClientProto", "java_package": "com.google.api", "objc_class_prefix": "GAPI", "cc_enable_arenas": true @@ -948,57 +1672,21 @@ } } }, - "resourceReference": { - "type": "google.api.ResourceReference", - "id": 1055, - "extend": "google.protobuf.FieldOptions" - }, - "resource": { - "type": "google.api.ResourceDescriptor", - "id": 1053, - "extend": "google.protobuf.MessageOptions" + "methodSignature": { + "rule": "repeated", + "type": "string", + "id": 1051, + "extend": "google.protobuf.MethodOptions" }, - "ResourceDescriptor": { - "fields": { - "type": { - "type": "string", - "id": 1 - }, - "pattern": { - "rule": "repeated", - "type": "string", - "id": 2 - }, - "nameField": { - "type": "string", - "id": 3 - }, - "history": { - "type": "History", - "id": 4 - } - }, - "nested": { - "History": { - "values": { - "HISTORY_UNSPECIFIED": 0, - "ORIGINALLY_SINGLE_PATTERN": 1, - "FUTURE_MULTI_PATTERN": 2 - } - } - } + "defaultHost": { + "type": "string", + "id": 1049, + "extend": "google.protobuf.ServiceOptions" }, - "ResourceReference": { - "fields": { - "type": { - "type": "string", - "id": 1 - }, - "childType": { - "type": "string", - "id": 2 - } - } + "oauthScopes": { + "type": "string", + "id": 1050, + "extend": "google.protobuf.ServiceOptions" } } }, @@ -2020,6 +2708,9 @@ }, "nested": { "IAMPolicy": { + "options": { + "(google.api.default_host)": "iam-meta-api.googleapis.com" + }, "methods": { "SetIamPolicy": { "requestType": "SetIamPolicyRequest", @@ -2064,6 +2755,10 @@ "resource": { "type": "string", "id": 1 + }, + "options": { + "type": "google.iam.v1.GetPolicyOptions", + "id": 2 } } }, @@ -2089,6 +2784,14 @@ } } }, + "GetPolicyOptions": { + "fields": { + "requestedPolicyVersion": { + "type": "int32", + "id": 1 + } + } + }, "Policy": { "fields": { "version": { diff --git a/packages/google-cloud-securitycenter/src/browser.js b/packages/google-cloud-securitycenter/src/browser.js new file mode 100644 index 00000000000..ddbcd7ecb9a --- /dev/null +++ b/packages/google-cloud-securitycenter/src/browser.js @@ -0,0 +1,21 @@ +// Copyright 2019 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT 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'; + +// Set a flag that we are running in a browser bundle. +global.isBrowser = true; + +// Re-export all exports from ./index.js. +module.exports = require('./index'); diff --git a/packages/google-cloud-securitycenter/src/service_proto_list.json b/packages/google-cloud-securitycenter/src/service_proto_list.json deleted file mode 100644 index 08bb6c13c79..00000000000 --- a/packages/google-cloud-securitycenter/src/service_proto_list.json +++ /dev/null @@ -1 +0,0 @@ -["../protos/google/cloud/securitycenter/v1/finding.proto", "../protos/google/cloud/securitycenter/v1/asset.proto", "../protos/google/cloud/securitycenter/v1/source.proto", "../protos/google/cloud/securitycenter/v1/securitycenter_service.proto", "../protos/google/cloud/securitycenter/v1/organization_settings.proto", "../protos/google/cloud/securitycenter/v1/security_marks.proto", "../protos/google/cloud/securitycenter/v1/run_asset_discovery_response.proto"] \ No newline at end of file diff --git a/packages/google-cloud-securitycenter/src/v1/security_center_client.js b/packages/google-cloud-securitycenter/src/v1/security_center_client.js index 5f19176dd2b..a407069fc4c 100644 --- a/packages/google-cloud-securitycenter/src/v1/security_center_client.js +++ b/packages/google-cloud-securitycenter/src/v1/security_center_client.js @@ -17,7 +17,6 @@ const gapicConfig = require('./security_center_client_config.json'); const gax = require('google-gax'); const path = require('path'); -const protobuf = require('protobufjs'); const VERSION = require('../../package.json').version; @@ -59,6 +58,16 @@ class SecurityCenterClient { opts = opts || {}; this._descriptors = {}; + if (global.isBrowser) { + // If we're in browser, we use gRPC fallback. + opts.fallback = true; + } + + // If we are in browser, we are already using fallback because of the + // "browser" field in package.json. + // But if we were explicitly requested to use fallback, let's do it now. + const gaxModule = !global.isBrowser && opts.fallback ? gax.fallback : gax; + const servicePath = opts.servicePath || opts.apiEndpoint || this.constructor.servicePath; @@ -75,54 +84,69 @@ class SecurityCenterClient { // Create a `gaxGrpc` object, with any grpc-specific options // sent to the client. opts.scopes = this.constructor.scopes; - const gaxGrpc = new gax.GrpcClient(opts); + const gaxGrpc = new gaxModule.GrpcClient(opts); // Save the auth object to the client, for use by other methods. this.auth = gaxGrpc.auth; // Determine the client header string. - const clientHeader = [ - `gl-node/${process.versions.node}`, - `grpc/${gaxGrpc.grpcVersion}`, - `gax/${gax.version}`, - `gapic/${VERSION}`, - ]; + const clientHeader = []; + + if (typeof process !== 'undefined' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } + clientHeader.push(`gax/${gaxModule.version}`); + if (opts.fallback) { + clientHeader.push(`gl-web/${gaxModule.version}`); + } else { + clientHeader.push(`grpc/${gaxGrpc.grpcVersion}`); + } + clientHeader.push(`gapic/${VERSION}`); if (opts.libName && opts.libVersion) { clientHeader.push(`${opts.libName}/${opts.libVersion}`); } // Load the applicable protos. + // For Node.js, pass the path to JSON proto file. + // For browsers, pass the JSON content. + + const nodejsProtoPath = path.join( + __dirname, + '..', + '..', + 'protos', + 'protos.json' + ); const protos = gaxGrpc.loadProto( - path.join(__dirname, '..', '..', 'protos'), - ['google/cloud/securitycenter/v1/securitycenter_service.proto'] + opts.fallback ? require('../../protos/protos.json') : nodejsProtoPath ); // This API contains "path templates"; forward-slash-separated // identifiers to uniquely identify resources within the API. // Create useful helper objects for these. this._pathTemplates = { - assetPathTemplate: new gax.PathTemplate( + assetPathTemplate: new gaxModule.PathTemplate( 'organizations/{organization}/assets/{asset}' ), - assetSecurityMarksPathTemplate: new gax.PathTemplate( + assetSecurityMarksPathTemplate: new gaxModule.PathTemplate( 'organizations/{organization}/assets/{asset}/securityMarks' ), - findingPathTemplate: new gax.PathTemplate( + findingPathTemplate: new gaxModule.PathTemplate( 'organizations/{organization}/sources/{source}/findings/{finding}' ), - findingSecurityMarksPathTemplate: new gax.PathTemplate( + findingSecurityMarksPathTemplate: new gaxModule.PathTemplate( 'organizations/{organization}/sources/{source}/findings/{finding}/securityMarks' ), - organizationPathTemplate: new gax.PathTemplate( + organizationPathTemplate: new gaxModule.PathTemplate( 'organizations/{organization}' ), - organizationSettingsPathTemplate: new gax.PathTemplate( + organizationSettingsPathTemplate: new gaxModule.PathTemplate( 'organizations/{organization}/organizationSettings' ), - organizationSourcesPathTemplate: new gax.PathTemplate( + organizationSourcesPathTemplate: new gaxModule.PathTemplate( 'organizations/{organization}/sources/-' ), - sourcePathTemplate: new gax.PathTemplate( + sourcePathTemplate: new gaxModule.PathTemplate( 'organizations/{organization}/sources/{source}' ), }; @@ -131,48 +155,41 @@ class SecurityCenterClient { // (e.g. 50 results at a time, with tokens to get subsequent // pages). Denote the keys used for pagination and results. this._descriptors.page = { - groupAssets: new gax.PageDescriptor( + groupAssets: new gaxModule.PageDescriptor( 'pageToken', 'nextPageToken', 'groupByResults' ), - groupFindings: new gax.PageDescriptor( + groupFindings: new gaxModule.PageDescriptor( 'pageToken', 'nextPageToken', 'groupByResults' ), - listAssets: new gax.PageDescriptor( + listAssets: new gaxModule.PageDescriptor( 'pageToken', 'nextPageToken', 'listAssetsResults' ), - listFindings: new gax.PageDescriptor( + listFindings: new gaxModule.PageDescriptor( 'pageToken', 'nextPageToken', 'listFindingsResults' ), - listSources: new gax.PageDescriptor( + listSources: new gaxModule.PageDescriptor( 'pageToken', 'nextPageToken', 'sources' ), }; - let protoFilesRoot = new gax.GoogleProtoFilesRoot(); - protoFilesRoot = protobuf.loadSync( - path.join( - __dirname, - '..', - '..', - 'protos', - 'google/cloud/securitycenter/v1/securitycenter_service.proto' - ), - protoFilesRoot - ); + + const protoFilesRoot = opts.fallback + ? gaxModule.protobuf.Root.fromJSON(require('../../protos/protos.json')) + : gaxModule.protobuf.loadSync(nodejsProtoPath); // This API contains "long-running operations", which return a // an Operation object that allows for tracking of the operation, // rather than holding a request open. - this.operationsClient = new gax.lro({ + this.operationsClient = new gaxModule.lro({ auth: gaxGrpc.auth, grpc: gaxGrpc.grpc, }).operationsClient(opts); @@ -185,7 +202,7 @@ class SecurityCenterClient { ); this._descriptors.longrunning = { - runAssetDiscovery: new gax.LongrunningDescriptor( + runAssetDiscovery: new gaxModule.LongrunningDescriptor( this.operationsClient, runAssetDiscoveryResponse.decode.bind(runAssetDiscoveryResponse), runAssetDiscoveryMetadata.decode.bind(runAssetDiscoveryMetadata) @@ -208,7 +225,9 @@ class SecurityCenterClient { // Put together the "service stub" for // google.cloud.securitycenter.v1.SecurityCenter. const securityCenterStub = gaxGrpc.createStub( - protos.google.cloud.securitycenter.v1.SecurityCenter, + opts.fallback + ? protos.lookupService('google.cloud.securitycenter.v1.SecurityCenter') + : protos.google.cloud.securitycenter.v1.SecurityCenter, opts ); @@ -235,18 +254,16 @@ class SecurityCenterClient { 'updateSecurityMarks', ]; for (const methodName of securityCenterStubMethods) { - this._innerApiCalls[methodName] = gax.createApiCall( - securityCenterStub.then( - stub => - function() { - const args = Array.prototype.slice.call(arguments, 0); - return stub[methodName].apply(stub, args); - }, - err => - function() { - throw err; - } - ), + const innerCallPromise = securityCenterStub.then( + stub => (...args) => { + return stub[methodName].apply(stub, args); + }, + err => () => { + throw err; + } + ); + this._innerApiCalls[methodName] = gaxModule.createApiCall( + innerCallPromise, defaults[methodName], this._descriptors.page[methodName] || this._descriptors.longrunning[methodName] diff --git a/packages/google-cloud-securitycenter/src/v1/security_center_proto_list.json b/packages/google-cloud-securitycenter/src/v1/security_center_proto_list.json new file mode 100644 index 00000000000..684ca569657 --- /dev/null +++ b/packages/google-cloud-securitycenter/src/v1/security_center_proto_list.json @@ -0,0 +1,3 @@ +[ + "../../protos/google/cloud/securitycenter/v1/securitycenter_service.proto" +] diff --git a/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.js b/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.js index 8afd3b0a1b7..596fa7a2d85 100644 --- a/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.js +++ b/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.js @@ -17,7 +17,6 @@ const gapicConfig = require('./security_center_client_config.json'); const gax = require('google-gax'); const path = require('path'); -const protobuf = require('protobufjs'); const VERSION = require('../../package.json').version; @@ -59,6 +58,16 @@ class SecurityCenterClient { opts = opts || {}; this._descriptors = {}; + if (global.isBrowser) { + // If we're in browser, we use gRPC fallback. + opts.fallback = true; + } + + // If we are in browser, we are already using fallback because of the + // "browser" field in package.json. + // But if we were explicitly requested to use fallback, let's do it now. + const gaxModule = !global.isBrowser && opts.fallback ? gax.fallback : gax; + const servicePath = opts.servicePath || opts.apiEndpoint || this.constructor.servicePath; @@ -75,48 +84,63 @@ class SecurityCenterClient { // Create a `gaxGrpc` object, with any grpc-specific options // sent to the client. opts.scopes = this.constructor.scopes; - const gaxGrpc = new gax.GrpcClient(opts); + const gaxGrpc = new gaxModule.GrpcClient(opts); // Save the auth object to the client, for use by other methods. this.auth = gaxGrpc.auth; // Determine the client header string. - const clientHeader = [ - `gl-node/${process.versions.node}`, - `grpc/${gaxGrpc.grpcVersion}`, - `gax/${gax.version}`, - `gapic/${VERSION}`, - ]; + const clientHeader = []; + + if (typeof process !== 'undefined' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } + clientHeader.push(`gax/${gaxModule.version}`); + if (opts.fallback) { + clientHeader.push(`gl-web/${gaxModule.version}`); + } else { + clientHeader.push(`grpc/${gaxGrpc.grpcVersion}`); + } + clientHeader.push(`gapic/${VERSION}`); if (opts.libName && opts.libVersion) { clientHeader.push(`${opts.libName}/${opts.libVersion}`); } // Load the applicable protos. + // For Node.js, pass the path to JSON proto file. + // For browsers, pass the JSON content. + + const nodejsProtoPath = path.join( + __dirname, + '..', + '..', + 'protos', + 'protos.json' + ); const protos = gaxGrpc.loadProto( - path.join(__dirname, '..', '..', 'protos'), - ['google/cloud/securitycenter/v1beta1/securitycenter_service.proto'] + opts.fallback ? require('../../protos/protos.json') : nodejsProtoPath ); // This API contains "path templates"; forward-slash-separated // identifiers to uniquely identify resources within the API. // Create useful helper objects for these. this._pathTemplates = { - assetSecurityMarksPathTemplate: new gax.PathTemplate( + assetSecurityMarksPathTemplate: new gaxModule.PathTemplate( 'organizations/{organization}/assets/{asset}/securityMarks' ), - findingPathTemplate: new gax.PathTemplate( + findingPathTemplate: new gaxModule.PathTemplate( 'organizations/{organization}/sources/{source}/findings/{finding}' ), - findingSecurityMarksPathTemplate: new gax.PathTemplate( + findingSecurityMarksPathTemplate: new gaxModule.PathTemplate( 'organizations/{organization}/sources/{source}/findings/{finding}/securityMarks' ), - organizationPathTemplate: new gax.PathTemplate( + organizationPathTemplate: new gaxModule.PathTemplate( 'organizations/{organization}' ), - organizationSettingsPathTemplate: new gax.PathTemplate( + organizationSettingsPathTemplate: new gaxModule.PathTemplate( 'organizations/{organization}/organizationSettings' ), - sourcePathTemplate: new gax.PathTemplate( + sourcePathTemplate: new gaxModule.PathTemplate( 'organizations/{organization}/sources/{source}' ), }; @@ -125,48 +149,41 @@ class SecurityCenterClient { // (e.g. 50 results at a time, with tokens to get subsequent // pages). Denote the keys used for pagination and results. this._descriptors.page = { - groupAssets: new gax.PageDescriptor( + groupAssets: new gaxModule.PageDescriptor( 'pageToken', 'nextPageToken', 'groupByResults' ), - groupFindings: new gax.PageDescriptor( + groupFindings: new gaxModule.PageDescriptor( 'pageToken', 'nextPageToken', 'groupByResults' ), - listAssets: new gax.PageDescriptor( + listAssets: new gaxModule.PageDescriptor( 'pageToken', 'nextPageToken', 'listAssetsResults' ), - listFindings: new gax.PageDescriptor( + listFindings: new gaxModule.PageDescriptor( 'pageToken', 'nextPageToken', 'findings' ), - listSources: new gax.PageDescriptor( + listSources: new gaxModule.PageDescriptor( 'pageToken', 'nextPageToken', 'sources' ), }; - let protoFilesRoot = new gax.GoogleProtoFilesRoot(); - protoFilesRoot = protobuf.loadSync( - path.join( - __dirname, - '..', - '..', - 'protos', - 'google/cloud/securitycenter/v1beta1/securitycenter_service.proto' - ), - protoFilesRoot - ); + + const protoFilesRoot = opts.fallback + ? gaxModule.protobuf.Root.fromJSON(require('../../protos/protos.json')) + : gaxModule.protobuf.loadSync(nodejsProtoPath); // This API contains "long-running operations", which return a // an Operation object that allows for tracking of the operation, // rather than holding a request open. - this.operationsClient = new gax.lro({ + this.operationsClient = new gaxModule.lro({ auth: gaxGrpc.auth, grpc: gaxGrpc.grpc, }).operationsClient(opts); @@ -179,7 +196,7 @@ class SecurityCenterClient { ); this._descriptors.longrunning = { - runAssetDiscovery: new gax.LongrunningDescriptor( + runAssetDiscovery: new gaxModule.LongrunningDescriptor( this.operationsClient, runAssetDiscoveryResponse.decode.bind(runAssetDiscoveryResponse), runAssetDiscoveryMetadata.decode.bind(runAssetDiscoveryMetadata) @@ -202,7 +219,11 @@ class SecurityCenterClient { // Put together the "service stub" for // google.cloud.securitycenter.v1beta1.SecurityCenter. const securityCenterStub = gaxGrpc.createStub( - protos.google.cloud.securitycenter.v1beta1.SecurityCenter, + opts.fallback + ? protos.lookupService( + 'google.cloud.securitycenter.v1beta1.SecurityCenter' + ) + : protos.google.cloud.securitycenter.v1beta1.SecurityCenter, opts ); @@ -229,18 +250,16 @@ class SecurityCenterClient { 'updateSecurityMarks', ]; for (const methodName of securityCenterStubMethods) { - this._innerApiCalls[methodName] = gax.createApiCall( - securityCenterStub.then( - stub => - function() { - const args = Array.prototype.slice.call(arguments, 0); - return stub[methodName].apply(stub, args); - }, - err => - function() { - throw err; - } - ), + const innerCallPromise = securityCenterStub.then( + stub => (...args) => { + return stub[methodName].apply(stub, args); + }, + err => () => { + throw err; + } + ); + this._innerApiCalls[methodName] = gaxModule.createApiCall( + innerCallPromise, defaults[methodName], this._descriptors.page[methodName] || this._descriptors.longrunning[methodName] diff --git a/packages/google-cloud-securitycenter/src/v1beta1/security_center_proto_list.json b/packages/google-cloud-securitycenter/src/v1beta1/security_center_proto_list.json new file mode 100644 index 00000000000..24e63a24411 --- /dev/null +++ b/packages/google-cloud-securitycenter/src/v1beta1/security_center_proto_list.json @@ -0,0 +1,3 @@ +[ + "../../protos/google/cloud/securitycenter/v1beta1/securitycenter_service.proto" +] diff --git a/packages/google-cloud-securitycenter/synth.metadata b/packages/google-cloud-securitycenter/synth.metadata index a3be3edca7d..7189b6bf0ff 100644 --- a/packages/google-cloud-securitycenter/synth.metadata +++ b/packages/google-cloud-securitycenter/synth.metadata @@ -1,19 +1,19 @@ { - "updateTime": "2019-08-28T11:20:59.012640Z", + "updateTime": "2019-08-31T11:17:38.289655Z", "sources": [ { "generator": { "name": "artman", - "version": "0.35.1", - "dockerImage": "googleapis/artman@sha256:b11c7ea0d0831c54016fb50f4b796d24d1971439b30fbc32a369ba1ac887c384" + "version": "0.36.1", + "dockerImage": "googleapis/artman@sha256:7c20f006c7a62d9d782e2665647d52290c37a952ef3cd134624d5dd62b3f71bd" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "dbd38035c35083507e2f0b839985cf17e212cb1c", - "internalRef": "265796259" + "sha": "82809578652607c8ee29d9e199c21f28f81a03e0", + "internalRef": "266247326" } }, { diff --git a/packages/google-cloud-securitycenter/synth.py b/packages/google-cloud-securitycenter/synth.py index 2faecd05b3d..ffcd43df6b0 100644 --- a/packages/google-cloud-securitycenter/synth.py +++ b/packages/google-cloud-securitycenter/synth.py @@ -83,3 +83,4 @@ # Node.js specific cleanup subprocess.run(['npm', 'install']) subprocess.run(['npm', 'run', 'fix']) +subprocess.run(['npx', 'compileProtos', 'src']) diff --git a/packages/google-cloud-securitycenter/test/gapic-v1.js b/packages/google-cloud-securitycenter/test/gapic-v1.js index 10c065cdb8e..dba9a6501fc 100644 --- a/packages/google-cloud-securitycenter/test/gapic-v1.js +++ b/packages/google-cloud-securitycenter/test/gapic-v1.js @@ -46,6 +46,13 @@ describe('SecurityCenterClient', () => { assert(client); }); + it('should create a client with gRPC fallback', () => { + const client = new securityCenterModule.v1.SecurityCenterClient({ + fallback: true, + }); + assert(client); + }); + describe('createSource', () => { it('invokes createSource without error', done => { const client = new securityCenterModule.v1.SecurityCenterClient({ diff --git a/packages/google-cloud-securitycenter/webpack.config.js b/packages/google-cloud-securitycenter/webpack.config.js new file mode 100644 index 00000000000..ca4a2ec15e6 --- /dev/null +++ b/packages/google-cloud-securitycenter/webpack.config.js @@ -0,0 +1,46 @@ +// Copyright 2019 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT 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 = { + entry: './src/browser.js', + output: { + library: 'security-center', + filename: './security-center.js', + }, + node: { + child_process: 'empty', + fs: 'empty', + crypto: 'empty', + }, + resolve: { + extensions: ['.js', '.json'], + }, + module: { + rules: [ + { + test: /node_modules[\\/]retry-request[\\/]/, + use: 'null-loader', + }, + { + test: /node_modules[\\/]https-proxy-agent[\\/]/, + use: 'null-loader', + }, + { + test: /node_modules[\\/]gtoken[\\/]/, + use: 'null-loader', + }, + ], + }, + mode: 'production', +}; From ecea646f640044cfdd5b29a589689b990714d853 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Thu, 5 Sep 2019 22:02:02 +0300 Subject: [PATCH 097/342] chore(deps): update dependency eslint-plugin-node to v10 (#144) --- packages/google-cloud-securitycenter/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-securitycenter/package.json b/packages/google-cloud-securitycenter/package.json index 59ad1261276..1b1ee37ffa9 100644 --- a/packages/google-cloud-securitycenter/package.json +++ b/packages/google-cloud-securitycenter/package.json @@ -46,7 +46,7 @@ "codecov": "^3.0.0", "eslint": "^6.0.0", "eslint-config-prettier": "^6.0.0", - "eslint-plugin-node": "^9.0.0", + "eslint-plugin-node": "^10.0.0", "eslint-plugin-prettier": "^3.0.0", "intelli-espower-loader": "^1.0.1", "jsdoc": "^3.6.2", From 1d3d93c58a51d45351f2f9f7913799324d642508 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Fri, 6 Sep 2019 08:33:49 -0700 Subject: [PATCH 098/342] chore: release 2.1.0 (#143) * updated CHANGELOG.md [ci skip] * updated package.json [ci skip] * updated samples/package.json [ci skip] --- packages/google-cloud-securitycenter/CHANGELOG.md | 12 ++++++++++++ packages/google-cloud-securitycenter/package.json | 2 +- .../google-cloud-securitycenter/samples/package.json | 2 +- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-securitycenter/CHANGELOG.md b/packages/google-cloud-securitycenter/CHANGELOG.md index 4434d4d5dee..daec367e068 100644 --- a/packages/google-cloud-securitycenter/CHANGELOG.md +++ b/packages/google-cloud-securitycenter/CHANGELOG.md @@ -4,6 +4,18 @@ [1]: https://www.npmjs.com/package/@google-cloud/security-center?activeTab=versions +## [2.1.0](https://www.github.com/googleapis/nodejs-security-center/compare/v2.0.1...v2.1.0) (2019-09-06) + + +### Bug Fixes + +* include the correct version of node in a header ([#138](https://www.github.com/googleapis/nodejs-security-center/issues/138)) ([4b42390](https://www.github.com/googleapis/nodejs-security-center/commit/4b42390)) + + +### Features + +* load protos from JSON, grpc-fallback support ([#142](https://www.github.com/googleapis/nodejs-security-center/issues/142)) ([570cca4](https://www.github.com/googleapis/nodejs-security-center/commit/570cca4)) + ### [2.0.1](https://www.github.com/googleapis/nodejs-security-center/compare/v2.0.0...v2.0.1) (2019-08-05) diff --git a/packages/google-cloud-securitycenter/package.json b/packages/google-cloud-securitycenter/package.json index 1b1ee37ffa9..0c18b7d9bbf 100644 --- a/packages/google-cloud-securitycenter/package.json +++ b/packages/google-cloud-securitycenter/package.json @@ -1,7 +1,7 @@ { "name": "@google-cloud/security-center", "description": "Cloud Security Command Center API client for Node.js", - "version": "2.0.1", + "version": "2.1.0", "license": "Apache-2.0", "author": "Google LLC", "engines": { diff --git a/packages/google-cloud-securitycenter/samples/package.json b/packages/google-cloud-securitycenter/samples/package.json index 947d8001f55..39cd9495ce8 100644 --- a/packages/google-cloud-securitycenter/samples/package.json +++ b/packages/google-cloud-securitycenter/samples/package.json @@ -9,7 +9,7 @@ }, "license": "Apache-2.0", "dependencies": { - "@google-cloud/security-center": "^2.0.1" + "@google-cloud/security-center": "^2.1.0" }, "devDependencies": { "chai": "^4.2.0", From c53aa2a81870215e3347673a730b2135e17484fe Mon Sep 17 00:00:00 2001 From: "Benjamin E. Coe" Date: Fri, 6 Sep 2019 18:40:47 -0400 Subject: [PATCH 099/342] update .nycrc ignore rules (#145) --- packages/google-cloud-securitycenter/.nycrc | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/google-cloud-securitycenter/.nycrc b/packages/google-cloud-securitycenter/.nycrc index 83a421a0628..23e322204ec 100644 --- a/packages/google-cloud-securitycenter/.nycrc +++ b/packages/google-cloud-securitycenter/.nycrc @@ -6,6 +6,7 @@ "**/.coverage", "**/apis", "**/benchmark", + "**/conformance", "**/docs", "**/samples", "**/scripts", From a6f2fc9e26ff86d1800ebf4bf3c5b7af0e9eb090 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Mon, 23 Sep 2019 06:09:53 -0700 Subject: [PATCH 100/342] feat: .d.ts for protos (#148) --- .../google-cloud-securitycenter/.eslintignore | 1 + .../protos/protos.d.ts | 13800 +++++++ .../protos/protos.js | 33741 ++++++++++++++++ .../src/v1/doc/google/iam/v1/doc_policy.js | 56 +- .../v1beta1/doc/google/iam/v1/doc_policy.js | 56 +- .../synth.metadata | 10 +- 6 files changed, 47623 insertions(+), 41 deletions(-) create mode 100644 packages/google-cloud-securitycenter/protos/protos.d.ts create mode 100644 packages/google-cloud-securitycenter/protos/protos.js diff --git a/packages/google-cloud-securitycenter/.eslintignore b/packages/google-cloud-securitycenter/.eslintignore index f0c7aead4bf..09b31fe735a 100644 --- a/packages/google-cloud-securitycenter/.eslintignore +++ b/packages/google-cloud-securitycenter/.eslintignore @@ -2,3 +2,4 @@ src/**/doc/* build/ docs/ +protos/ diff --git a/packages/google-cloud-securitycenter/protos/protos.d.ts b/packages/google-cloud-securitycenter/protos/protos.d.ts new file mode 100644 index 00000000000..9920dec9be4 --- /dev/null +++ b/packages/google-cloud-securitycenter/protos/protos.d.ts @@ -0,0 +1,13800 @@ +import * as $protobuf from "protobufjs"; +/** Namespace google. */ +export namespace google { + + /** Namespace cloud. */ + namespace cloud { + + /** Namespace securitycenter. */ + namespace securitycenter { + + /** Namespace v1. */ + namespace v1 { + + /** Represents a SecurityCenter */ + class SecurityCenter extends $protobuf.rpc.Service { + + /** + * Constructs a new SecurityCenter 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 SecurityCenter 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): SecurityCenter; + + /** + * Calls CreateSource. + * @param request CreateSourceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Source + */ + public createSource(request: google.cloud.securitycenter.v1.ICreateSourceRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.CreateSourceCallback): void; + + /** + * Calls CreateSource. + * @param request CreateSourceRequest message or plain object + * @returns Promise + */ + public createSource(request: google.cloud.securitycenter.v1.ICreateSourceRequest): Promise; + + /** + * Calls CreateFinding. + * @param request CreateFindingRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Finding + */ + public createFinding(request: google.cloud.securitycenter.v1.ICreateFindingRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.CreateFindingCallback): void; + + /** + * Calls CreateFinding. + * @param request CreateFindingRequest message or plain object + * @returns Promise + */ + public createFinding(request: google.cloud.securitycenter.v1.ICreateFindingRequest): Promise; + + /** + * Calls GetIamPolicy. + * @param request GetIamPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Policy + */ + public getIamPolicy(request: google.iam.v1.IGetIamPolicyRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.GetIamPolicyCallback): void; + + /** + * Calls GetIamPolicy. + * @param request GetIamPolicyRequest message or plain object + * @returns Promise + */ + public getIamPolicy(request: google.iam.v1.IGetIamPolicyRequest): Promise; + + /** + * Calls GetOrganizationSettings. + * @param request GetOrganizationSettingsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and OrganizationSettings + */ + public getOrganizationSettings(request: google.cloud.securitycenter.v1.IGetOrganizationSettingsRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.GetOrganizationSettingsCallback): void; + + /** + * Calls GetOrganizationSettings. + * @param request GetOrganizationSettingsRequest message or plain object + * @returns Promise + */ + public getOrganizationSettings(request: google.cloud.securitycenter.v1.IGetOrganizationSettingsRequest): Promise; + + /** + * Calls GetSource. + * @param request GetSourceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Source + */ + public getSource(request: google.cloud.securitycenter.v1.IGetSourceRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.GetSourceCallback): void; + + /** + * Calls GetSource. + * @param request GetSourceRequest message or plain object + * @returns Promise + */ + public getSource(request: google.cloud.securitycenter.v1.IGetSourceRequest): Promise; + + /** + * Calls GroupAssets. + * @param request GroupAssetsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and GroupAssetsResponse + */ + public groupAssets(request: google.cloud.securitycenter.v1.IGroupAssetsRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.GroupAssetsCallback): void; + + /** + * Calls GroupAssets. + * @param request GroupAssetsRequest message or plain object + * @returns Promise + */ + public groupAssets(request: google.cloud.securitycenter.v1.IGroupAssetsRequest): Promise; + + /** + * Calls GroupFindings. + * @param request GroupFindingsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and GroupFindingsResponse + */ + public groupFindings(request: google.cloud.securitycenter.v1.IGroupFindingsRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.GroupFindingsCallback): void; + + /** + * Calls GroupFindings. + * @param request GroupFindingsRequest message or plain object + * @returns Promise + */ + public groupFindings(request: google.cloud.securitycenter.v1.IGroupFindingsRequest): Promise; + + /** + * Calls ListAssets. + * @param request ListAssetsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListAssetsResponse + */ + public listAssets(request: google.cloud.securitycenter.v1.IListAssetsRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.ListAssetsCallback): void; + + /** + * Calls ListAssets. + * @param request ListAssetsRequest message or plain object + * @returns Promise + */ + public listAssets(request: google.cloud.securitycenter.v1.IListAssetsRequest): Promise; + + /** + * Calls ListFindings. + * @param request ListFindingsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListFindingsResponse + */ + public listFindings(request: google.cloud.securitycenter.v1.IListFindingsRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.ListFindingsCallback): void; + + /** + * Calls ListFindings. + * @param request ListFindingsRequest message or plain object + * @returns Promise + */ + public listFindings(request: google.cloud.securitycenter.v1.IListFindingsRequest): Promise; + + /** + * Calls ListSources. + * @param request ListSourcesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListSourcesResponse + */ + public listSources(request: google.cloud.securitycenter.v1.IListSourcesRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.ListSourcesCallback): void; + + /** + * Calls ListSources. + * @param request ListSourcesRequest message or plain object + * @returns Promise + */ + public listSources(request: google.cloud.securitycenter.v1.IListSourcesRequest): Promise; + + /** + * Calls RunAssetDiscovery. + * @param request RunAssetDiscoveryRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public runAssetDiscovery(request: google.cloud.securitycenter.v1.IRunAssetDiscoveryRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.RunAssetDiscoveryCallback): void; + + /** + * Calls RunAssetDiscovery. + * @param request RunAssetDiscoveryRequest message or plain object + * @returns Promise + */ + public runAssetDiscovery(request: google.cloud.securitycenter.v1.IRunAssetDiscoveryRequest): Promise; + + /** + * Calls SetFindingState. + * @param request SetFindingStateRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Finding + */ + public setFindingState(request: google.cloud.securitycenter.v1.ISetFindingStateRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.SetFindingStateCallback): void; + + /** + * Calls SetFindingState. + * @param request SetFindingStateRequest message or plain object + * @returns Promise + */ + public setFindingState(request: google.cloud.securitycenter.v1.ISetFindingStateRequest): Promise; + + /** + * Calls SetIamPolicy. + * @param request SetIamPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Policy + */ + public setIamPolicy(request: google.iam.v1.ISetIamPolicyRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.SetIamPolicyCallback): void; + + /** + * Calls SetIamPolicy. + * @param request SetIamPolicyRequest message or plain object + * @returns Promise + */ + public setIamPolicy(request: google.iam.v1.ISetIamPolicyRequest): Promise; + + /** + * Calls TestIamPermissions. + * @param request TestIamPermissionsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and TestIamPermissionsResponse + */ + public testIamPermissions(request: google.iam.v1.ITestIamPermissionsRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.TestIamPermissionsCallback): void; + + /** + * Calls TestIamPermissions. + * @param request TestIamPermissionsRequest message or plain object + * @returns Promise + */ + public testIamPermissions(request: google.iam.v1.ITestIamPermissionsRequest): Promise; + + /** + * Calls UpdateFinding. + * @param request UpdateFindingRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Finding + */ + public updateFinding(request: google.cloud.securitycenter.v1.IUpdateFindingRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.UpdateFindingCallback): void; + + /** + * Calls UpdateFinding. + * @param request UpdateFindingRequest message or plain object + * @returns Promise + */ + public updateFinding(request: google.cloud.securitycenter.v1.IUpdateFindingRequest): Promise; + + /** + * Calls UpdateOrganizationSettings. + * @param request UpdateOrganizationSettingsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and OrganizationSettings + */ + public updateOrganizationSettings(request: google.cloud.securitycenter.v1.IUpdateOrganizationSettingsRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.UpdateOrganizationSettingsCallback): void; + + /** + * Calls UpdateOrganizationSettings. + * @param request UpdateOrganizationSettingsRequest message or plain object + * @returns Promise + */ + public updateOrganizationSettings(request: google.cloud.securitycenter.v1.IUpdateOrganizationSettingsRequest): Promise; + + /** + * Calls UpdateSource. + * @param request UpdateSourceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Source + */ + public updateSource(request: google.cloud.securitycenter.v1.IUpdateSourceRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.UpdateSourceCallback): void; + + /** + * Calls UpdateSource. + * @param request UpdateSourceRequest message or plain object + * @returns Promise + */ + public updateSource(request: google.cloud.securitycenter.v1.IUpdateSourceRequest): Promise; + + /** + * Calls UpdateSecurityMarks. + * @param request UpdateSecurityMarksRequest message or plain object + * @param callback Node-style callback called with the error, if any, and SecurityMarks + */ + public updateSecurityMarks(request: google.cloud.securitycenter.v1.IUpdateSecurityMarksRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.UpdateSecurityMarksCallback): void; + + /** + * Calls UpdateSecurityMarks. + * @param request UpdateSecurityMarksRequest message or plain object + * @returns Promise + */ + public updateSecurityMarks(request: google.cloud.securitycenter.v1.IUpdateSecurityMarksRequest): Promise; + } + + namespace SecurityCenter { + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#createSource}. + * @param error Error, if any + * @param [response] Source + */ + type CreateSourceCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.Source) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#createFinding}. + * @param error Error, if any + * @param [response] Finding + */ + type CreateFindingCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.Finding) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#getIamPolicy}. + * @param error Error, if any + * @param [response] Policy + */ + type GetIamPolicyCallback = (error: (Error|null), response?: google.iam.v1.Policy) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#getOrganizationSettings}. + * @param error Error, if any + * @param [response] OrganizationSettings + */ + type GetOrganizationSettingsCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.OrganizationSettings) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#getSource}. + * @param error Error, if any + * @param [response] Source + */ + type GetSourceCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.Source) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#groupAssets}. + * @param error Error, if any + * @param [response] GroupAssetsResponse + */ + type GroupAssetsCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.GroupAssetsResponse) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#groupFindings}. + * @param error Error, if any + * @param [response] GroupFindingsResponse + */ + type GroupFindingsCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.GroupFindingsResponse) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#listAssets}. + * @param error Error, if any + * @param [response] ListAssetsResponse + */ + type ListAssetsCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.ListAssetsResponse) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#listFindings}. + * @param error Error, if any + * @param [response] ListFindingsResponse + */ + type ListFindingsCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.ListFindingsResponse) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#listSources}. + * @param error Error, if any + * @param [response] ListSourcesResponse + */ + type ListSourcesCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.ListSourcesResponse) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#runAssetDiscovery}. + * @param error Error, if any + * @param [response] Operation + */ + type RunAssetDiscoveryCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#setFindingState}. + * @param error Error, if any + * @param [response] Finding + */ + type SetFindingStateCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.Finding) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#setIamPolicy}. + * @param error Error, if any + * @param [response] Policy + */ + type SetIamPolicyCallback = (error: (Error|null), response?: google.iam.v1.Policy) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#testIamPermissions}. + * @param error Error, if any + * @param [response] TestIamPermissionsResponse + */ + type TestIamPermissionsCallback = (error: (Error|null), response?: google.iam.v1.TestIamPermissionsResponse) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#updateFinding}. + * @param error Error, if any + * @param [response] Finding + */ + type UpdateFindingCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.Finding) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#updateOrganizationSettings}. + * @param error Error, if any + * @param [response] OrganizationSettings + */ + type UpdateOrganizationSettingsCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.OrganizationSettings) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#updateSource}. + * @param error Error, if any + * @param [response] Source + */ + type UpdateSourceCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.Source) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#updateSecurityMarks}. + * @param error Error, if any + * @param [response] SecurityMarks + */ + type UpdateSecurityMarksCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.SecurityMarks) => void; + } + + /** Properties of a CreateFindingRequest. */ + interface ICreateFindingRequest { + + /** CreateFindingRequest parent */ + parent?: (string|null); + + /** CreateFindingRequest findingId */ + findingId?: (string|null); + + /** CreateFindingRequest finding */ + finding?: (google.cloud.securitycenter.v1.IFinding|null); + } + + /** Represents a CreateFindingRequest. */ + class CreateFindingRequest implements ICreateFindingRequest { + + /** + * Constructs a new CreateFindingRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.ICreateFindingRequest); + + /** CreateFindingRequest parent. */ + public parent: string; + + /** CreateFindingRequest findingId. */ + public findingId: string; + + /** CreateFindingRequest finding. */ + public finding?: (google.cloud.securitycenter.v1.IFinding|null); + + /** + * Creates a new CreateFindingRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateFindingRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v1.ICreateFindingRequest): google.cloud.securitycenter.v1.CreateFindingRequest; + + /** + * Encodes the specified CreateFindingRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.CreateFindingRequest.verify|verify} messages. + * @param message CreateFindingRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.ICreateFindingRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateFindingRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.CreateFindingRequest.verify|verify} messages. + * @param message CreateFindingRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.ICreateFindingRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateFindingRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateFindingRequest + * @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.cloud.securitycenter.v1.CreateFindingRequest; + + /** + * Decodes a CreateFindingRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateFindingRequest + * @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.cloud.securitycenter.v1.CreateFindingRequest; + + /** + * Verifies a CreateFindingRequest 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 CreateFindingRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateFindingRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.CreateFindingRequest; + + /** + * Creates a plain object from a CreateFindingRequest message. Also converts values to other types if specified. + * @param message CreateFindingRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.CreateFindingRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateFindingRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a CreateSourceRequest. */ + interface ICreateSourceRequest { + + /** CreateSourceRequest parent */ + parent?: (string|null); + + /** CreateSourceRequest source */ + source?: (google.cloud.securitycenter.v1.ISource|null); + } + + /** Represents a CreateSourceRequest. */ + class CreateSourceRequest implements ICreateSourceRequest { + + /** + * Constructs a new CreateSourceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.ICreateSourceRequest); + + /** CreateSourceRequest parent. */ + public parent: string; + + /** CreateSourceRequest source. */ + public source?: (google.cloud.securitycenter.v1.ISource|null); + + /** + * Creates a new CreateSourceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateSourceRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v1.ICreateSourceRequest): google.cloud.securitycenter.v1.CreateSourceRequest; + + /** + * Encodes the specified CreateSourceRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.CreateSourceRequest.verify|verify} messages. + * @param message CreateSourceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.ICreateSourceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateSourceRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.CreateSourceRequest.verify|verify} messages. + * @param message CreateSourceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.ICreateSourceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateSourceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateSourceRequest + * @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.cloud.securitycenter.v1.CreateSourceRequest; + + /** + * Decodes a CreateSourceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateSourceRequest + * @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.cloud.securitycenter.v1.CreateSourceRequest; + + /** + * Verifies a CreateSourceRequest 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 CreateSourceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateSourceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.CreateSourceRequest; + + /** + * Creates a plain object from a CreateSourceRequest message. Also converts values to other types if specified. + * @param message CreateSourceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.CreateSourceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateSourceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GetOrganizationSettingsRequest. */ + interface IGetOrganizationSettingsRequest { + + /** GetOrganizationSettingsRequest name */ + name?: (string|null); + } + + /** Represents a GetOrganizationSettingsRequest. */ + class GetOrganizationSettingsRequest implements IGetOrganizationSettingsRequest { + + /** + * Constructs a new GetOrganizationSettingsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IGetOrganizationSettingsRequest); + + /** GetOrganizationSettingsRequest name. */ + public name: string; + + /** + * Creates a new GetOrganizationSettingsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetOrganizationSettingsRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IGetOrganizationSettingsRequest): google.cloud.securitycenter.v1.GetOrganizationSettingsRequest; + + /** + * Encodes the specified GetOrganizationSettingsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.GetOrganizationSettingsRequest.verify|verify} messages. + * @param message GetOrganizationSettingsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IGetOrganizationSettingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetOrganizationSettingsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.GetOrganizationSettingsRequest.verify|verify} messages. + * @param message GetOrganizationSettingsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IGetOrganizationSettingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetOrganizationSettingsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetOrganizationSettingsRequest + * @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.cloud.securitycenter.v1.GetOrganizationSettingsRequest; + + /** + * Decodes a GetOrganizationSettingsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetOrganizationSettingsRequest + * @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.cloud.securitycenter.v1.GetOrganizationSettingsRequest; + + /** + * Verifies a GetOrganizationSettingsRequest 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 GetOrganizationSettingsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetOrganizationSettingsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.GetOrganizationSettingsRequest; + + /** + * Creates a plain object from a GetOrganizationSettingsRequest message. Also converts values to other types if specified. + * @param message GetOrganizationSettingsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.GetOrganizationSettingsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetOrganizationSettingsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GetSourceRequest. */ + interface IGetSourceRequest { + + /** GetSourceRequest name */ + name?: (string|null); + } + + /** Represents a GetSourceRequest. */ + class GetSourceRequest implements IGetSourceRequest { + + /** + * Constructs a new GetSourceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IGetSourceRequest); + + /** GetSourceRequest name. */ + public name: string; + + /** + * Creates a new GetSourceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetSourceRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IGetSourceRequest): google.cloud.securitycenter.v1.GetSourceRequest; + + /** + * Encodes the specified GetSourceRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.GetSourceRequest.verify|verify} messages. + * @param message GetSourceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IGetSourceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetSourceRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.GetSourceRequest.verify|verify} messages. + * @param message GetSourceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IGetSourceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetSourceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetSourceRequest + * @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.cloud.securitycenter.v1.GetSourceRequest; + + /** + * Decodes a GetSourceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetSourceRequest + * @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.cloud.securitycenter.v1.GetSourceRequest; + + /** + * Verifies a GetSourceRequest 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 GetSourceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetSourceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.GetSourceRequest; + + /** + * Creates a plain object from a GetSourceRequest message. Also converts values to other types if specified. + * @param message GetSourceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.GetSourceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetSourceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GroupAssetsRequest. */ + interface IGroupAssetsRequest { + + /** GroupAssetsRequest parent */ + parent?: (string|null); + + /** GroupAssetsRequest filter */ + filter?: (string|null); + + /** GroupAssetsRequest groupBy */ + groupBy?: (string|null); + + /** GroupAssetsRequest compareDuration */ + compareDuration?: (google.protobuf.IDuration|null); + + /** GroupAssetsRequest readTime */ + readTime?: (google.protobuf.ITimestamp|null); + + /** GroupAssetsRequest pageToken */ + pageToken?: (string|null); + + /** GroupAssetsRequest pageSize */ + pageSize?: (number|null); + } + + /** Represents a GroupAssetsRequest. */ + class GroupAssetsRequest implements IGroupAssetsRequest { + + /** + * Constructs a new GroupAssetsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IGroupAssetsRequest); + + /** GroupAssetsRequest parent. */ + public parent: string; + + /** GroupAssetsRequest filter. */ + public filter: string; + + /** GroupAssetsRequest groupBy. */ + public groupBy: string; + + /** GroupAssetsRequest compareDuration. */ + public compareDuration?: (google.protobuf.IDuration|null); + + /** GroupAssetsRequest readTime. */ + public readTime?: (google.protobuf.ITimestamp|null); + + /** GroupAssetsRequest pageToken. */ + public pageToken: string; + + /** GroupAssetsRequest pageSize. */ + public pageSize: number; + + /** + * Creates a new GroupAssetsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GroupAssetsRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IGroupAssetsRequest): google.cloud.securitycenter.v1.GroupAssetsRequest; + + /** + * Encodes the specified GroupAssetsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.GroupAssetsRequest.verify|verify} messages. + * @param message GroupAssetsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IGroupAssetsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GroupAssetsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.GroupAssetsRequest.verify|verify} messages. + * @param message GroupAssetsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IGroupAssetsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GroupAssetsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GroupAssetsRequest + * @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.cloud.securitycenter.v1.GroupAssetsRequest; + + /** + * Decodes a GroupAssetsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GroupAssetsRequest + * @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.cloud.securitycenter.v1.GroupAssetsRequest; + + /** + * Verifies a GroupAssetsRequest 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 GroupAssetsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GroupAssetsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.GroupAssetsRequest; + + /** + * Creates a plain object from a GroupAssetsRequest message. Also converts values to other types if specified. + * @param message GroupAssetsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.GroupAssetsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GroupAssetsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GroupAssetsResponse. */ + interface IGroupAssetsResponse { + + /** GroupAssetsResponse groupByResults */ + groupByResults?: (google.cloud.securitycenter.v1.IGroupResult[]|null); + + /** GroupAssetsResponse readTime */ + readTime?: (google.protobuf.ITimestamp|null); + + /** GroupAssetsResponse nextPageToken */ + nextPageToken?: (string|null); + + /** GroupAssetsResponse totalSize */ + totalSize?: (number|null); + } + + /** Represents a GroupAssetsResponse. */ + class GroupAssetsResponse implements IGroupAssetsResponse { + + /** + * Constructs a new GroupAssetsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IGroupAssetsResponse); + + /** GroupAssetsResponse groupByResults. */ + public groupByResults: google.cloud.securitycenter.v1.IGroupResult[]; + + /** GroupAssetsResponse readTime. */ + public readTime?: (google.protobuf.ITimestamp|null); + + /** GroupAssetsResponse nextPageToken. */ + public nextPageToken: string; + + /** GroupAssetsResponse totalSize. */ + public totalSize: number; + + /** + * Creates a new GroupAssetsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns GroupAssetsResponse instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IGroupAssetsResponse): google.cloud.securitycenter.v1.GroupAssetsResponse; + + /** + * Encodes the specified GroupAssetsResponse message. Does not implicitly {@link google.cloud.securitycenter.v1.GroupAssetsResponse.verify|verify} messages. + * @param message GroupAssetsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IGroupAssetsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GroupAssetsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.GroupAssetsResponse.verify|verify} messages. + * @param message GroupAssetsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IGroupAssetsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GroupAssetsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GroupAssetsResponse + * @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.cloud.securitycenter.v1.GroupAssetsResponse; + + /** + * Decodes a GroupAssetsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GroupAssetsResponse + * @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.cloud.securitycenter.v1.GroupAssetsResponse; + + /** + * Verifies a GroupAssetsResponse 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 GroupAssetsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GroupAssetsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.GroupAssetsResponse; + + /** + * Creates a plain object from a GroupAssetsResponse message. Also converts values to other types if specified. + * @param message GroupAssetsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.GroupAssetsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GroupAssetsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GroupFindingsRequest. */ + interface IGroupFindingsRequest { + + /** GroupFindingsRequest parent */ + parent?: (string|null); + + /** GroupFindingsRequest filter */ + filter?: (string|null); + + /** GroupFindingsRequest groupBy */ + groupBy?: (string|null); + + /** GroupFindingsRequest readTime */ + readTime?: (google.protobuf.ITimestamp|null); + + /** GroupFindingsRequest compareDuration */ + compareDuration?: (google.protobuf.IDuration|null); + + /** GroupFindingsRequest pageToken */ + pageToken?: (string|null); + + /** GroupFindingsRequest pageSize */ + pageSize?: (number|null); + } + + /** Represents a GroupFindingsRequest. */ + class GroupFindingsRequest implements IGroupFindingsRequest { + + /** + * Constructs a new GroupFindingsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IGroupFindingsRequest); + + /** GroupFindingsRequest parent. */ + public parent: string; + + /** GroupFindingsRequest filter. */ + public filter: string; + + /** GroupFindingsRequest groupBy. */ + public groupBy: string; + + /** GroupFindingsRequest readTime. */ + public readTime?: (google.protobuf.ITimestamp|null); + + /** GroupFindingsRequest compareDuration. */ + public compareDuration?: (google.protobuf.IDuration|null); + + /** GroupFindingsRequest pageToken. */ + public pageToken: string; + + /** GroupFindingsRequest pageSize. */ + public pageSize: number; + + /** + * Creates a new GroupFindingsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GroupFindingsRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IGroupFindingsRequest): google.cloud.securitycenter.v1.GroupFindingsRequest; + + /** + * Encodes the specified GroupFindingsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.GroupFindingsRequest.verify|verify} messages. + * @param message GroupFindingsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IGroupFindingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GroupFindingsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.GroupFindingsRequest.verify|verify} messages. + * @param message GroupFindingsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IGroupFindingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GroupFindingsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GroupFindingsRequest + * @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.cloud.securitycenter.v1.GroupFindingsRequest; + + /** + * Decodes a GroupFindingsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GroupFindingsRequest + * @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.cloud.securitycenter.v1.GroupFindingsRequest; + + /** + * Verifies a GroupFindingsRequest 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 GroupFindingsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GroupFindingsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.GroupFindingsRequest; + + /** + * Creates a plain object from a GroupFindingsRequest message. Also converts values to other types if specified. + * @param message GroupFindingsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.GroupFindingsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GroupFindingsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GroupFindingsResponse. */ + interface IGroupFindingsResponse { + + /** GroupFindingsResponse groupByResults */ + groupByResults?: (google.cloud.securitycenter.v1.IGroupResult[]|null); + + /** GroupFindingsResponse readTime */ + readTime?: (google.protobuf.ITimestamp|null); + + /** GroupFindingsResponse nextPageToken */ + nextPageToken?: (string|null); + + /** GroupFindingsResponse totalSize */ + totalSize?: (number|null); + } + + /** Represents a GroupFindingsResponse. */ + class GroupFindingsResponse implements IGroupFindingsResponse { + + /** + * Constructs a new GroupFindingsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IGroupFindingsResponse); + + /** GroupFindingsResponse groupByResults. */ + public groupByResults: google.cloud.securitycenter.v1.IGroupResult[]; + + /** GroupFindingsResponse readTime. */ + public readTime?: (google.protobuf.ITimestamp|null); + + /** GroupFindingsResponse nextPageToken. */ + public nextPageToken: string; + + /** GroupFindingsResponse totalSize. */ + public totalSize: number; + + /** + * Creates a new GroupFindingsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns GroupFindingsResponse instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IGroupFindingsResponse): google.cloud.securitycenter.v1.GroupFindingsResponse; + + /** + * Encodes the specified GroupFindingsResponse message. Does not implicitly {@link google.cloud.securitycenter.v1.GroupFindingsResponse.verify|verify} messages. + * @param message GroupFindingsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IGroupFindingsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GroupFindingsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.GroupFindingsResponse.verify|verify} messages. + * @param message GroupFindingsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IGroupFindingsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GroupFindingsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GroupFindingsResponse + * @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.cloud.securitycenter.v1.GroupFindingsResponse; + + /** + * Decodes a GroupFindingsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GroupFindingsResponse + * @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.cloud.securitycenter.v1.GroupFindingsResponse; + + /** + * Verifies a GroupFindingsResponse 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 GroupFindingsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GroupFindingsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.GroupFindingsResponse; + + /** + * Creates a plain object from a GroupFindingsResponse message. Also converts values to other types if specified. + * @param message GroupFindingsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.GroupFindingsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GroupFindingsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GroupResult. */ + interface IGroupResult { + + /** GroupResult properties */ + properties?: ({ [k: string]: google.protobuf.IValue }|null); + + /** GroupResult count */ + count?: (number|Long|null); + } + + /** Represents a GroupResult. */ + class GroupResult implements IGroupResult { + + /** + * Constructs a new GroupResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IGroupResult); + + /** GroupResult properties. */ + public properties: { [k: string]: google.protobuf.IValue }; + + /** GroupResult count. */ + public count: (number|Long); + + /** + * Creates a new GroupResult instance using the specified properties. + * @param [properties] Properties to set + * @returns GroupResult instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IGroupResult): google.cloud.securitycenter.v1.GroupResult; + + /** + * Encodes the specified GroupResult message. Does not implicitly {@link google.cloud.securitycenter.v1.GroupResult.verify|verify} messages. + * @param message GroupResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IGroupResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GroupResult message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.GroupResult.verify|verify} messages. + * @param message GroupResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IGroupResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GroupResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GroupResult + * @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.cloud.securitycenter.v1.GroupResult; + + /** + * Decodes a GroupResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GroupResult + * @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.cloud.securitycenter.v1.GroupResult; + + /** + * Verifies a GroupResult 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 GroupResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GroupResult + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.GroupResult; + + /** + * Creates a plain object from a GroupResult message. Also converts values to other types if specified. + * @param message GroupResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.GroupResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GroupResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListSourcesRequest. */ + interface IListSourcesRequest { + + /** ListSourcesRequest parent */ + parent?: (string|null); + + /** ListSourcesRequest pageToken */ + pageToken?: (string|null); + + /** ListSourcesRequest pageSize */ + pageSize?: (number|null); + } + + /** Represents a ListSourcesRequest. */ + class ListSourcesRequest implements IListSourcesRequest { + + /** + * Constructs a new ListSourcesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IListSourcesRequest); + + /** ListSourcesRequest parent. */ + public parent: string; + + /** ListSourcesRequest pageToken. */ + public pageToken: string; + + /** ListSourcesRequest pageSize. */ + public pageSize: number; + + /** + * Creates a new ListSourcesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListSourcesRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IListSourcesRequest): google.cloud.securitycenter.v1.ListSourcesRequest; + + /** + * Encodes the specified ListSourcesRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.ListSourcesRequest.verify|verify} messages. + * @param message ListSourcesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IListSourcesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListSourcesRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListSourcesRequest.verify|verify} messages. + * @param message ListSourcesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IListSourcesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListSourcesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListSourcesRequest + * @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.cloud.securitycenter.v1.ListSourcesRequest; + + /** + * Decodes a ListSourcesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListSourcesRequest + * @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.cloud.securitycenter.v1.ListSourcesRequest; + + /** + * Verifies a ListSourcesRequest 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 ListSourcesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListSourcesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.ListSourcesRequest; + + /** + * Creates a plain object from a ListSourcesRequest message. Also converts values to other types if specified. + * @param message ListSourcesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.ListSourcesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListSourcesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListSourcesResponse. */ + interface IListSourcesResponse { + + /** ListSourcesResponse sources */ + sources?: (google.cloud.securitycenter.v1.ISource[]|null); + + /** ListSourcesResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListSourcesResponse. */ + class ListSourcesResponse implements IListSourcesResponse { + + /** + * Constructs a new ListSourcesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IListSourcesResponse); + + /** ListSourcesResponse sources. */ + public sources: google.cloud.securitycenter.v1.ISource[]; + + /** ListSourcesResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListSourcesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListSourcesResponse instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IListSourcesResponse): google.cloud.securitycenter.v1.ListSourcesResponse; + + /** + * Encodes the specified ListSourcesResponse message. Does not implicitly {@link google.cloud.securitycenter.v1.ListSourcesResponse.verify|verify} messages. + * @param message ListSourcesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IListSourcesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListSourcesResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListSourcesResponse.verify|verify} messages. + * @param message ListSourcesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IListSourcesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListSourcesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListSourcesResponse + * @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.cloud.securitycenter.v1.ListSourcesResponse; + + /** + * Decodes a ListSourcesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListSourcesResponse + * @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.cloud.securitycenter.v1.ListSourcesResponse; + + /** + * Verifies a ListSourcesResponse 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 ListSourcesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListSourcesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.ListSourcesResponse; + + /** + * Creates a plain object from a ListSourcesResponse message. Also converts values to other types if specified. + * @param message ListSourcesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.ListSourcesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListSourcesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListAssetsRequest. */ + interface IListAssetsRequest { + + /** ListAssetsRequest parent */ + parent?: (string|null); + + /** ListAssetsRequest filter */ + filter?: (string|null); + + /** ListAssetsRequest orderBy */ + orderBy?: (string|null); + + /** ListAssetsRequest readTime */ + readTime?: (google.protobuf.ITimestamp|null); + + /** ListAssetsRequest compareDuration */ + compareDuration?: (google.protobuf.IDuration|null); + + /** ListAssetsRequest fieldMask */ + fieldMask?: (google.protobuf.IFieldMask|null); + + /** ListAssetsRequest pageToken */ + pageToken?: (string|null); + + /** ListAssetsRequest pageSize */ + pageSize?: (number|null); + } + + /** Represents a ListAssetsRequest. */ + class ListAssetsRequest implements IListAssetsRequest { + + /** + * Constructs a new ListAssetsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IListAssetsRequest); + + /** ListAssetsRequest parent. */ + public parent: string; + + /** ListAssetsRequest filter. */ + public filter: string; + + /** ListAssetsRequest orderBy. */ + public orderBy: string; + + /** ListAssetsRequest readTime. */ + public readTime?: (google.protobuf.ITimestamp|null); + + /** ListAssetsRequest compareDuration. */ + public compareDuration?: (google.protobuf.IDuration|null); + + /** ListAssetsRequest fieldMask. */ + public fieldMask?: (google.protobuf.IFieldMask|null); + + /** ListAssetsRequest pageToken. */ + public pageToken: string; + + /** ListAssetsRequest pageSize. */ + public pageSize: number; + + /** + * Creates a new ListAssetsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListAssetsRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IListAssetsRequest): google.cloud.securitycenter.v1.ListAssetsRequest; + + /** + * Encodes the specified ListAssetsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.ListAssetsRequest.verify|verify} messages. + * @param message ListAssetsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IListAssetsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListAssetsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListAssetsRequest.verify|verify} messages. + * @param message ListAssetsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IListAssetsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListAssetsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListAssetsRequest + * @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.cloud.securitycenter.v1.ListAssetsRequest; + + /** + * Decodes a ListAssetsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListAssetsRequest + * @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.cloud.securitycenter.v1.ListAssetsRequest; + + /** + * Verifies a ListAssetsRequest 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 ListAssetsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListAssetsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.ListAssetsRequest; + + /** + * Creates a plain object from a ListAssetsRequest message. Also converts values to other types if specified. + * @param message ListAssetsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.ListAssetsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListAssetsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListAssetsResponse. */ + interface IListAssetsResponse { + + /** ListAssetsResponse listAssetsResults */ + listAssetsResults?: (google.cloud.securitycenter.v1.ListAssetsResponse.IListAssetsResult[]|null); + + /** ListAssetsResponse readTime */ + readTime?: (google.protobuf.ITimestamp|null); + + /** ListAssetsResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListAssetsResponse totalSize */ + totalSize?: (number|null); + } + + /** Represents a ListAssetsResponse. */ + class ListAssetsResponse implements IListAssetsResponse { + + /** + * Constructs a new ListAssetsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IListAssetsResponse); + + /** ListAssetsResponse listAssetsResults. */ + public listAssetsResults: google.cloud.securitycenter.v1.ListAssetsResponse.IListAssetsResult[]; + + /** ListAssetsResponse readTime. */ + public readTime?: (google.protobuf.ITimestamp|null); + + /** ListAssetsResponse nextPageToken. */ + public nextPageToken: string; + + /** ListAssetsResponse totalSize. */ + public totalSize: number; + + /** + * Creates a new ListAssetsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListAssetsResponse instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IListAssetsResponse): google.cloud.securitycenter.v1.ListAssetsResponse; + + /** + * Encodes the specified ListAssetsResponse message. Does not implicitly {@link google.cloud.securitycenter.v1.ListAssetsResponse.verify|verify} messages. + * @param message ListAssetsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IListAssetsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListAssetsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListAssetsResponse.verify|verify} messages. + * @param message ListAssetsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IListAssetsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListAssetsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListAssetsResponse + * @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.cloud.securitycenter.v1.ListAssetsResponse; + + /** + * Decodes a ListAssetsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListAssetsResponse + * @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.cloud.securitycenter.v1.ListAssetsResponse; + + /** + * Verifies a ListAssetsResponse 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 ListAssetsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListAssetsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.ListAssetsResponse; + + /** + * Creates a plain object from a ListAssetsResponse message. Also converts values to other types if specified. + * @param message ListAssetsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.ListAssetsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListAssetsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace ListAssetsResponse { + + /** Properties of a ListAssetsResult. */ + interface IListAssetsResult { + + /** ListAssetsResult asset */ + asset?: (google.cloud.securitycenter.v1.IAsset|null); + + /** ListAssetsResult stateChange */ + stateChange?: (google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult.StateChange|null); + } + + /** Represents a ListAssetsResult. */ + class ListAssetsResult implements IListAssetsResult { + + /** + * Constructs a new ListAssetsResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.ListAssetsResponse.IListAssetsResult); + + /** ListAssetsResult asset. */ + public asset?: (google.cloud.securitycenter.v1.IAsset|null); + + /** ListAssetsResult stateChange. */ + public stateChange: google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult.StateChange; + + /** + * Creates a new ListAssetsResult instance using the specified properties. + * @param [properties] Properties to set + * @returns ListAssetsResult instance + */ + public static create(properties?: google.cloud.securitycenter.v1.ListAssetsResponse.IListAssetsResult): google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult; + + /** + * Encodes the specified ListAssetsResult message. Does not implicitly {@link google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult.verify|verify} messages. + * @param message ListAssetsResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.ListAssetsResponse.IListAssetsResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListAssetsResult message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult.verify|verify} messages. + * @param message ListAssetsResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.ListAssetsResponse.IListAssetsResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListAssetsResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListAssetsResult + * @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.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult; + + /** + * Decodes a ListAssetsResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListAssetsResult + * @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.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult; + + /** + * Verifies a ListAssetsResult 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 ListAssetsResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListAssetsResult + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult; + + /** + * Creates a plain object from a ListAssetsResult message. Also converts values to other types if specified. + * @param message ListAssetsResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListAssetsResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace ListAssetsResult { + + /** StateChange enum. */ + enum StateChange { + UNUSED = 0, + ADDED = 1, + REMOVED = 2, + ACTIVE = 3 + } + } + } + + /** Properties of a ListFindingsRequest. */ + interface IListFindingsRequest { + + /** ListFindingsRequest parent */ + parent?: (string|null); + + /** ListFindingsRequest filter */ + filter?: (string|null); + + /** ListFindingsRequest orderBy */ + orderBy?: (string|null); + + /** ListFindingsRequest readTime */ + readTime?: (google.protobuf.ITimestamp|null); + + /** ListFindingsRequest compareDuration */ + compareDuration?: (google.protobuf.IDuration|null); + + /** ListFindingsRequest fieldMask */ + fieldMask?: (google.protobuf.IFieldMask|null); + + /** ListFindingsRequest pageToken */ + pageToken?: (string|null); + + /** ListFindingsRequest pageSize */ + pageSize?: (number|null); + } + + /** Represents a ListFindingsRequest. */ + class ListFindingsRequest implements IListFindingsRequest { + + /** + * Constructs a new ListFindingsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IListFindingsRequest); + + /** ListFindingsRequest parent. */ + public parent: string; + + /** ListFindingsRequest filter. */ + public filter: string; + + /** ListFindingsRequest orderBy. */ + public orderBy: string; + + /** ListFindingsRequest readTime. */ + public readTime?: (google.protobuf.ITimestamp|null); + + /** ListFindingsRequest compareDuration. */ + public compareDuration?: (google.protobuf.IDuration|null); + + /** ListFindingsRequest fieldMask. */ + public fieldMask?: (google.protobuf.IFieldMask|null); + + /** ListFindingsRequest pageToken. */ + public pageToken: string; + + /** ListFindingsRequest pageSize. */ + public pageSize: number; + + /** + * Creates a new ListFindingsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListFindingsRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IListFindingsRequest): google.cloud.securitycenter.v1.ListFindingsRequest; + + /** + * Encodes the specified ListFindingsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.ListFindingsRequest.verify|verify} messages. + * @param message ListFindingsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IListFindingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListFindingsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListFindingsRequest.verify|verify} messages. + * @param message ListFindingsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IListFindingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListFindingsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListFindingsRequest + * @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.cloud.securitycenter.v1.ListFindingsRequest; + + /** + * Decodes a ListFindingsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListFindingsRequest + * @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.cloud.securitycenter.v1.ListFindingsRequest; + + /** + * Verifies a ListFindingsRequest 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 ListFindingsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListFindingsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.ListFindingsRequest; + + /** + * Creates a plain object from a ListFindingsRequest message. Also converts values to other types if specified. + * @param message ListFindingsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.ListFindingsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListFindingsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListFindingsResponse. */ + interface IListFindingsResponse { + + /** ListFindingsResponse listFindingsResults */ + listFindingsResults?: (google.cloud.securitycenter.v1.ListFindingsResponse.IListFindingsResult[]|null); + + /** ListFindingsResponse readTime */ + readTime?: (google.protobuf.ITimestamp|null); + + /** ListFindingsResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListFindingsResponse totalSize */ + totalSize?: (number|null); + } + + /** Represents a ListFindingsResponse. */ + class ListFindingsResponse implements IListFindingsResponse { + + /** + * Constructs a new ListFindingsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IListFindingsResponse); + + /** ListFindingsResponse listFindingsResults. */ + public listFindingsResults: google.cloud.securitycenter.v1.ListFindingsResponse.IListFindingsResult[]; + + /** ListFindingsResponse readTime. */ + public readTime?: (google.protobuf.ITimestamp|null); + + /** ListFindingsResponse nextPageToken. */ + public nextPageToken: string; + + /** ListFindingsResponse totalSize. */ + public totalSize: number; + + /** + * Creates a new ListFindingsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListFindingsResponse instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IListFindingsResponse): google.cloud.securitycenter.v1.ListFindingsResponse; + + /** + * Encodes the specified ListFindingsResponse message. Does not implicitly {@link google.cloud.securitycenter.v1.ListFindingsResponse.verify|verify} messages. + * @param message ListFindingsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IListFindingsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListFindingsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListFindingsResponse.verify|verify} messages. + * @param message ListFindingsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IListFindingsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListFindingsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListFindingsResponse + * @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.cloud.securitycenter.v1.ListFindingsResponse; + + /** + * Decodes a ListFindingsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListFindingsResponse + * @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.cloud.securitycenter.v1.ListFindingsResponse; + + /** + * Verifies a ListFindingsResponse 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 ListFindingsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListFindingsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.ListFindingsResponse; + + /** + * Creates a plain object from a ListFindingsResponse message. Also converts values to other types if specified. + * @param message ListFindingsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.ListFindingsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListFindingsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace ListFindingsResponse { + + /** Properties of a ListFindingsResult. */ + interface IListFindingsResult { + + /** ListFindingsResult finding */ + finding?: (google.cloud.securitycenter.v1.IFinding|null); + + /** ListFindingsResult stateChange */ + stateChange?: (google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.StateChange|null); + } + + /** Represents a ListFindingsResult. */ + class ListFindingsResult implements IListFindingsResult { + + /** + * Constructs a new ListFindingsResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.ListFindingsResponse.IListFindingsResult); + + /** ListFindingsResult finding. */ + public finding?: (google.cloud.securitycenter.v1.IFinding|null); + + /** ListFindingsResult stateChange. */ + public stateChange: google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.StateChange; + + /** + * Creates a new ListFindingsResult instance using the specified properties. + * @param [properties] Properties to set + * @returns ListFindingsResult instance + */ + public static create(properties?: google.cloud.securitycenter.v1.ListFindingsResponse.IListFindingsResult): google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult; + + /** + * Encodes the specified ListFindingsResult message. Does not implicitly {@link google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.verify|verify} messages. + * @param message ListFindingsResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.ListFindingsResponse.IListFindingsResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListFindingsResult message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.verify|verify} messages. + * @param message ListFindingsResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.ListFindingsResponse.IListFindingsResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListFindingsResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListFindingsResult + * @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.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult; + + /** + * Decodes a ListFindingsResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListFindingsResult + * @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.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult; + + /** + * Verifies a ListFindingsResult 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 ListFindingsResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListFindingsResult + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult; + + /** + * Creates a plain object from a ListFindingsResult message. Also converts values to other types if specified. + * @param message ListFindingsResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListFindingsResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace ListFindingsResult { + + /** StateChange enum. */ + enum StateChange { + UNUSED = 0, + CHANGED = 1, + UNCHANGED = 2, + ADDED = 3, + REMOVED = 4 + } + } + } + + /** Properties of a SetFindingStateRequest. */ + interface ISetFindingStateRequest { + + /** SetFindingStateRequest name */ + name?: (string|null); + + /** SetFindingStateRequest state */ + state?: (google.cloud.securitycenter.v1.Finding.State|null); + + /** SetFindingStateRequest startTime */ + startTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a SetFindingStateRequest. */ + class SetFindingStateRequest implements ISetFindingStateRequest { + + /** + * Constructs a new SetFindingStateRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.ISetFindingStateRequest); + + /** SetFindingStateRequest name. */ + public name: string; + + /** SetFindingStateRequest state. */ + public state: google.cloud.securitycenter.v1.Finding.State; + + /** SetFindingStateRequest startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new SetFindingStateRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns SetFindingStateRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v1.ISetFindingStateRequest): google.cloud.securitycenter.v1.SetFindingStateRequest; + + /** + * Encodes the specified SetFindingStateRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.SetFindingStateRequest.verify|verify} messages. + * @param message SetFindingStateRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.ISetFindingStateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SetFindingStateRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.SetFindingStateRequest.verify|verify} messages. + * @param message SetFindingStateRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.ISetFindingStateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SetFindingStateRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SetFindingStateRequest + * @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.cloud.securitycenter.v1.SetFindingStateRequest; + + /** + * Decodes a SetFindingStateRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SetFindingStateRequest + * @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.cloud.securitycenter.v1.SetFindingStateRequest; + + /** + * Verifies a SetFindingStateRequest 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 SetFindingStateRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SetFindingStateRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.SetFindingStateRequest; + + /** + * Creates a plain object from a SetFindingStateRequest message. Also converts values to other types if specified. + * @param message SetFindingStateRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.SetFindingStateRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SetFindingStateRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a RunAssetDiscoveryRequest. */ + interface IRunAssetDiscoveryRequest { + + /** RunAssetDiscoveryRequest parent */ + parent?: (string|null); + } + + /** Represents a RunAssetDiscoveryRequest. */ + class RunAssetDiscoveryRequest implements IRunAssetDiscoveryRequest { + + /** + * Constructs a new RunAssetDiscoveryRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IRunAssetDiscoveryRequest); + + /** RunAssetDiscoveryRequest parent. */ + public parent: string; + + /** + * Creates a new RunAssetDiscoveryRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns RunAssetDiscoveryRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IRunAssetDiscoveryRequest): google.cloud.securitycenter.v1.RunAssetDiscoveryRequest; + + /** + * Encodes the specified RunAssetDiscoveryRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.RunAssetDiscoveryRequest.verify|verify} messages. + * @param message RunAssetDiscoveryRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IRunAssetDiscoveryRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RunAssetDiscoveryRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.RunAssetDiscoveryRequest.verify|verify} messages. + * @param message RunAssetDiscoveryRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IRunAssetDiscoveryRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RunAssetDiscoveryRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RunAssetDiscoveryRequest + * @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.cloud.securitycenter.v1.RunAssetDiscoveryRequest; + + /** + * Decodes a RunAssetDiscoveryRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RunAssetDiscoveryRequest + * @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.cloud.securitycenter.v1.RunAssetDiscoveryRequest; + + /** + * Verifies a RunAssetDiscoveryRequest 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 RunAssetDiscoveryRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RunAssetDiscoveryRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.RunAssetDiscoveryRequest; + + /** + * Creates a plain object from a RunAssetDiscoveryRequest message. Also converts values to other types if specified. + * @param message RunAssetDiscoveryRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.RunAssetDiscoveryRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RunAssetDiscoveryRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an UpdateFindingRequest. */ + interface IUpdateFindingRequest { + + /** UpdateFindingRequest finding */ + finding?: (google.cloud.securitycenter.v1.IFinding|null); + + /** UpdateFindingRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateFindingRequest. */ + class UpdateFindingRequest implements IUpdateFindingRequest { + + /** + * Constructs a new UpdateFindingRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IUpdateFindingRequest); + + /** UpdateFindingRequest finding. */ + public finding?: (google.cloud.securitycenter.v1.IFinding|null); + + /** UpdateFindingRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateFindingRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateFindingRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IUpdateFindingRequest): google.cloud.securitycenter.v1.UpdateFindingRequest; + + /** + * Encodes the specified UpdateFindingRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.UpdateFindingRequest.verify|verify} messages. + * @param message UpdateFindingRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IUpdateFindingRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateFindingRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.UpdateFindingRequest.verify|verify} messages. + * @param message UpdateFindingRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IUpdateFindingRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateFindingRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateFindingRequest + * @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.cloud.securitycenter.v1.UpdateFindingRequest; + + /** + * Decodes an UpdateFindingRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateFindingRequest + * @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.cloud.securitycenter.v1.UpdateFindingRequest; + + /** + * Verifies an UpdateFindingRequest 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 UpdateFindingRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateFindingRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.UpdateFindingRequest; + + /** + * Creates a plain object from an UpdateFindingRequest message. Also converts values to other types if specified. + * @param message UpdateFindingRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.UpdateFindingRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateFindingRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an UpdateOrganizationSettingsRequest. */ + interface IUpdateOrganizationSettingsRequest { + + /** UpdateOrganizationSettingsRequest organizationSettings */ + organizationSettings?: (google.cloud.securitycenter.v1.IOrganizationSettings|null); + + /** UpdateOrganizationSettingsRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateOrganizationSettingsRequest. */ + class UpdateOrganizationSettingsRequest implements IUpdateOrganizationSettingsRequest { + + /** + * Constructs a new UpdateOrganizationSettingsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IUpdateOrganizationSettingsRequest); + + /** UpdateOrganizationSettingsRequest organizationSettings. */ + public organizationSettings?: (google.cloud.securitycenter.v1.IOrganizationSettings|null); + + /** UpdateOrganizationSettingsRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateOrganizationSettingsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateOrganizationSettingsRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IUpdateOrganizationSettingsRequest): google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest; + + /** + * Encodes the specified UpdateOrganizationSettingsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest.verify|verify} messages. + * @param message UpdateOrganizationSettingsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IUpdateOrganizationSettingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateOrganizationSettingsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest.verify|verify} messages. + * @param message UpdateOrganizationSettingsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IUpdateOrganizationSettingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateOrganizationSettingsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateOrganizationSettingsRequest + * @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.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest; + + /** + * Decodes an UpdateOrganizationSettingsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateOrganizationSettingsRequest + * @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.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest; + + /** + * Verifies an UpdateOrganizationSettingsRequest 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 UpdateOrganizationSettingsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateOrganizationSettingsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest; + + /** + * Creates a plain object from an UpdateOrganizationSettingsRequest message. Also converts values to other types if specified. + * @param message UpdateOrganizationSettingsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateOrganizationSettingsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an UpdateSourceRequest. */ + interface IUpdateSourceRequest { + + /** UpdateSourceRequest source */ + source?: (google.cloud.securitycenter.v1.ISource|null); + + /** UpdateSourceRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateSourceRequest. */ + class UpdateSourceRequest implements IUpdateSourceRequest { + + /** + * Constructs a new UpdateSourceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IUpdateSourceRequest); + + /** UpdateSourceRequest source. */ + public source?: (google.cloud.securitycenter.v1.ISource|null); + + /** UpdateSourceRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateSourceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateSourceRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IUpdateSourceRequest): google.cloud.securitycenter.v1.UpdateSourceRequest; + + /** + * Encodes the specified UpdateSourceRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.UpdateSourceRequest.verify|verify} messages. + * @param message UpdateSourceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IUpdateSourceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateSourceRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.UpdateSourceRequest.verify|verify} messages. + * @param message UpdateSourceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IUpdateSourceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateSourceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateSourceRequest + * @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.cloud.securitycenter.v1.UpdateSourceRequest; + + /** + * Decodes an UpdateSourceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateSourceRequest + * @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.cloud.securitycenter.v1.UpdateSourceRequest; + + /** + * Verifies an UpdateSourceRequest 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 UpdateSourceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateSourceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.UpdateSourceRequest; + + /** + * Creates a plain object from an UpdateSourceRequest message. Also converts values to other types if specified. + * @param message UpdateSourceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.UpdateSourceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateSourceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an UpdateSecurityMarksRequest. */ + interface IUpdateSecurityMarksRequest { + + /** UpdateSecurityMarksRequest securityMarks */ + securityMarks?: (google.cloud.securitycenter.v1.ISecurityMarks|null); + + /** UpdateSecurityMarksRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateSecurityMarksRequest startTime */ + startTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents an UpdateSecurityMarksRequest. */ + class UpdateSecurityMarksRequest implements IUpdateSecurityMarksRequest { + + /** + * Constructs a new UpdateSecurityMarksRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IUpdateSecurityMarksRequest); + + /** UpdateSecurityMarksRequest securityMarks. */ + public securityMarks?: (google.cloud.securitycenter.v1.ISecurityMarks|null); + + /** UpdateSecurityMarksRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateSecurityMarksRequest startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new UpdateSecurityMarksRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateSecurityMarksRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IUpdateSecurityMarksRequest): google.cloud.securitycenter.v1.UpdateSecurityMarksRequest; + + /** + * Encodes the specified UpdateSecurityMarksRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.UpdateSecurityMarksRequest.verify|verify} messages. + * @param message UpdateSecurityMarksRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IUpdateSecurityMarksRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateSecurityMarksRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.UpdateSecurityMarksRequest.verify|verify} messages. + * @param message UpdateSecurityMarksRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IUpdateSecurityMarksRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateSecurityMarksRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateSecurityMarksRequest + * @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.cloud.securitycenter.v1.UpdateSecurityMarksRequest; + + /** + * Decodes an UpdateSecurityMarksRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateSecurityMarksRequest + * @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.cloud.securitycenter.v1.UpdateSecurityMarksRequest; + + /** + * Verifies an UpdateSecurityMarksRequest 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 UpdateSecurityMarksRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateSecurityMarksRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.UpdateSecurityMarksRequest; + + /** + * Creates a plain object from an UpdateSecurityMarksRequest message. Also converts values to other types if specified. + * @param message UpdateSecurityMarksRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.UpdateSecurityMarksRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateSecurityMarksRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an Asset. */ + interface IAsset { + + /** Asset name */ + name?: (string|null); + + /** Asset securityCenterProperties */ + securityCenterProperties?: (google.cloud.securitycenter.v1.Asset.ISecurityCenterProperties|null); + + /** Asset resourceProperties */ + resourceProperties?: ({ [k: string]: google.protobuf.IValue }|null); + + /** Asset securityMarks */ + securityMarks?: (google.cloud.securitycenter.v1.ISecurityMarks|null); + + /** Asset createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Asset updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** Asset iamPolicy */ + iamPolicy?: (google.cloud.securitycenter.v1.Asset.IIamPolicy|null); + } + + /** Represents an Asset. */ + class Asset implements IAsset { + + /** + * Constructs a new Asset. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IAsset); + + /** Asset name. */ + public name: string; + + /** Asset securityCenterProperties. */ + public securityCenterProperties?: (google.cloud.securitycenter.v1.Asset.ISecurityCenterProperties|null); + + /** Asset resourceProperties. */ + public resourceProperties: { [k: string]: google.protobuf.IValue }; + + /** Asset securityMarks. */ + public securityMarks?: (google.cloud.securitycenter.v1.ISecurityMarks|null); + + /** Asset createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Asset updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** Asset iamPolicy. */ + public iamPolicy?: (google.cloud.securitycenter.v1.Asset.IIamPolicy|null); + + /** + * Creates a new Asset instance using the specified properties. + * @param [properties] Properties to set + * @returns Asset instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IAsset): google.cloud.securitycenter.v1.Asset; + + /** + * Encodes the specified Asset message. Does not implicitly {@link google.cloud.securitycenter.v1.Asset.verify|verify} messages. + * @param message Asset message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IAsset, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Asset message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Asset.verify|verify} messages. + * @param message Asset message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IAsset, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Asset message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Asset + * @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.cloud.securitycenter.v1.Asset; + + /** + * Decodes an Asset message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Asset + * @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.cloud.securitycenter.v1.Asset; + + /** + * Verifies an Asset 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 Asset message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Asset + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.Asset; + + /** + * Creates a plain object from an Asset message. Also converts values to other types if specified. + * @param message Asset + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.Asset, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Asset to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace Asset { + + /** Properties of a SecurityCenterProperties. */ + interface ISecurityCenterProperties { + + /** SecurityCenterProperties resourceName */ + resourceName?: (string|null); + + /** SecurityCenterProperties resourceType */ + resourceType?: (string|null); + + /** SecurityCenterProperties resourceParent */ + resourceParent?: (string|null); + + /** SecurityCenterProperties resourceProject */ + resourceProject?: (string|null); + + /** SecurityCenterProperties resourceOwners */ + resourceOwners?: (string[]|null); + } + + /** Represents a SecurityCenterProperties. */ + class SecurityCenterProperties implements ISecurityCenterProperties { + + /** + * Constructs a new SecurityCenterProperties. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.Asset.ISecurityCenterProperties); + + /** SecurityCenterProperties resourceName. */ + public resourceName: string; + + /** SecurityCenterProperties resourceType. */ + public resourceType: string; + + /** SecurityCenterProperties resourceParent. */ + public resourceParent: string; + + /** SecurityCenterProperties resourceProject. */ + public resourceProject: string; + + /** SecurityCenterProperties resourceOwners. */ + public resourceOwners: string[]; + + /** + * Creates a new SecurityCenterProperties instance using the specified properties. + * @param [properties] Properties to set + * @returns SecurityCenterProperties instance + */ + public static create(properties?: google.cloud.securitycenter.v1.Asset.ISecurityCenterProperties): google.cloud.securitycenter.v1.Asset.SecurityCenterProperties; + + /** + * Encodes the specified SecurityCenterProperties message. Does not implicitly {@link google.cloud.securitycenter.v1.Asset.SecurityCenterProperties.verify|verify} messages. + * @param message SecurityCenterProperties message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.Asset.ISecurityCenterProperties, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SecurityCenterProperties message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Asset.SecurityCenterProperties.verify|verify} messages. + * @param message SecurityCenterProperties message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.Asset.ISecurityCenterProperties, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SecurityCenterProperties message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SecurityCenterProperties + * @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.cloud.securitycenter.v1.Asset.SecurityCenterProperties; + + /** + * Decodes a SecurityCenterProperties message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SecurityCenterProperties + * @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.cloud.securitycenter.v1.Asset.SecurityCenterProperties; + + /** + * Verifies a SecurityCenterProperties 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 SecurityCenterProperties message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SecurityCenterProperties + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.Asset.SecurityCenterProperties; + + /** + * Creates a plain object from a SecurityCenterProperties message. Also converts values to other types if specified. + * @param message SecurityCenterProperties + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.Asset.SecurityCenterProperties, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SecurityCenterProperties to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an IamPolicy. */ + interface IIamPolicy { + + /** IamPolicy policyBlob */ + policyBlob?: (string|null); + } + + /** Represents an IamPolicy. */ + class IamPolicy implements IIamPolicy { + + /** + * Constructs a new IamPolicy. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.Asset.IIamPolicy); + + /** IamPolicy policyBlob. */ + public policyBlob: string; + + /** + * Creates a new IamPolicy instance using the specified properties. + * @param [properties] Properties to set + * @returns IamPolicy instance + */ + public static create(properties?: google.cloud.securitycenter.v1.Asset.IIamPolicy): google.cloud.securitycenter.v1.Asset.IamPolicy; + + /** + * Encodes the specified IamPolicy message. Does not implicitly {@link google.cloud.securitycenter.v1.Asset.IamPolicy.verify|verify} messages. + * @param message IamPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.Asset.IIamPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified IamPolicy message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Asset.IamPolicy.verify|verify} messages. + * @param message IamPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.Asset.IIamPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an IamPolicy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns IamPolicy + * @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.cloud.securitycenter.v1.Asset.IamPolicy; + + /** + * Decodes an IamPolicy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns IamPolicy + * @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.cloud.securitycenter.v1.Asset.IamPolicy; + + /** + * Verifies an IamPolicy 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 IamPolicy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns IamPolicy + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.Asset.IamPolicy; + + /** + * Creates a plain object from an IamPolicy message. Also converts values to other types if specified. + * @param message IamPolicy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.Asset.IamPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this IamPolicy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** Properties of a SecurityMarks. */ + interface ISecurityMarks { + + /** SecurityMarks name */ + name?: (string|null); + + /** SecurityMarks marks */ + marks?: ({ [k: string]: string }|null); + } + + /** Represents a SecurityMarks. */ + class SecurityMarks implements ISecurityMarks { + + /** + * Constructs a new SecurityMarks. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.ISecurityMarks); + + /** SecurityMarks name. */ + public name: string; + + /** SecurityMarks marks. */ + public marks: { [k: string]: string }; + + /** + * Creates a new SecurityMarks instance using the specified properties. + * @param [properties] Properties to set + * @returns SecurityMarks instance + */ + public static create(properties?: google.cloud.securitycenter.v1.ISecurityMarks): google.cloud.securitycenter.v1.SecurityMarks; + + /** + * Encodes the specified SecurityMarks message. Does not implicitly {@link google.cloud.securitycenter.v1.SecurityMarks.verify|verify} messages. + * @param message SecurityMarks message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.ISecurityMarks, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SecurityMarks message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.SecurityMarks.verify|verify} messages. + * @param message SecurityMarks message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.ISecurityMarks, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SecurityMarks message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SecurityMarks + * @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.cloud.securitycenter.v1.SecurityMarks; + + /** + * Decodes a SecurityMarks message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SecurityMarks + * @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.cloud.securitycenter.v1.SecurityMarks; + + /** + * Verifies a SecurityMarks 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 SecurityMarks message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SecurityMarks + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.SecurityMarks; + + /** + * Creates a plain object from a SecurityMarks message. Also converts values to other types if specified. + * @param message SecurityMarks + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.SecurityMarks, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SecurityMarks to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a Finding. */ + interface IFinding { + + /** Finding name */ + name?: (string|null); + + /** Finding parent */ + parent?: (string|null); + + /** Finding resourceName */ + resourceName?: (string|null); + + /** Finding state */ + state?: (google.cloud.securitycenter.v1.Finding.State|null); + + /** Finding category */ + category?: (string|null); + + /** Finding externalUri */ + externalUri?: (string|null); + + /** Finding sourceProperties */ + sourceProperties?: ({ [k: string]: google.protobuf.IValue }|null); + + /** Finding securityMarks */ + securityMarks?: (google.cloud.securitycenter.v1.ISecurityMarks|null); + + /** Finding eventTime */ + eventTime?: (google.protobuf.ITimestamp|null); + + /** Finding createTime */ + createTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a Finding. */ + class Finding implements IFinding { + + /** + * Constructs a new Finding. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IFinding); + + /** Finding name. */ + public name: string; + + /** Finding parent. */ + public parent: string; + + /** Finding resourceName. */ + public resourceName: string; + + /** Finding state. */ + public state: google.cloud.securitycenter.v1.Finding.State; + + /** Finding category. */ + public category: string; + + /** Finding externalUri. */ + public externalUri: string; + + /** Finding sourceProperties. */ + public sourceProperties: { [k: string]: google.protobuf.IValue }; + + /** Finding securityMarks. */ + public securityMarks?: (google.cloud.securitycenter.v1.ISecurityMarks|null); + + /** Finding eventTime. */ + public eventTime?: (google.protobuf.ITimestamp|null); + + /** Finding createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new Finding instance using the specified properties. + * @param [properties] Properties to set + * @returns Finding instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IFinding): google.cloud.securitycenter.v1.Finding; + + /** + * Encodes the specified Finding message. Does not implicitly {@link google.cloud.securitycenter.v1.Finding.verify|verify} messages. + * @param message Finding message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IFinding, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Finding message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Finding.verify|verify} messages. + * @param message Finding message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IFinding, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Finding message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Finding + * @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.cloud.securitycenter.v1.Finding; + + /** + * Decodes a Finding message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Finding + * @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.cloud.securitycenter.v1.Finding; + + /** + * Verifies a Finding 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 Finding message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Finding + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.Finding; + + /** + * Creates a plain object from a Finding message. Also converts values to other types if specified. + * @param message Finding + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.Finding, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Finding to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace Finding { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + ACTIVE = 1, + INACTIVE = 2 + } + } + + /** Properties of an OrganizationSettings. */ + interface IOrganizationSettings { + + /** OrganizationSettings name */ + name?: (string|null); + + /** OrganizationSettings enableAssetDiscovery */ + enableAssetDiscovery?: (boolean|null); + + /** OrganizationSettings assetDiscoveryConfig */ + assetDiscoveryConfig?: (google.cloud.securitycenter.v1.OrganizationSettings.IAssetDiscoveryConfig|null); + } + + /** Represents an OrganizationSettings. */ + class OrganizationSettings implements IOrganizationSettings { + + /** + * Constructs a new OrganizationSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IOrganizationSettings); + + /** OrganizationSettings name. */ + public name: string; + + /** OrganizationSettings enableAssetDiscovery. */ + public enableAssetDiscovery: boolean; + + /** OrganizationSettings assetDiscoveryConfig. */ + public assetDiscoveryConfig?: (google.cloud.securitycenter.v1.OrganizationSettings.IAssetDiscoveryConfig|null); + + /** + * Creates a new OrganizationSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns OrganizationSettings instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IOrganizationSettings): google.cloud.securitycenter.v1.OrganizationSettings; + + /** + * Encodes the specified OrganizationSettings message. Does not implicitly {@link google.cloud.securitycenter.v1.OrganizationSettings.verify|verify} messages. + * @param message OrganizationSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IOrganizationSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OrganizationSettings message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.OrganizationSettings.verify|verify} messages. + * @param message OrganizationSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IOrganizationSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OrganizationSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OrganizationSettings + * @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.cloud.securitycenter.v1.OrganizationSettings; + + /** + * Decodes an OrganizationSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OrganizationSettings + * @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.cloud.securitycenter.v1.OrganizationSettings; + + /** + * Verifies an OrganizationSettings 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 OrganizationSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OrganizationSettings + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.OrganizationSettings; + + /** + * Creates a plain object from an OrganizationSettings message. Also converts values to other types if specified. + * @param message OrganizationSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.OrganizationSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OrganizationSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace OrganizationSettings { + + /** Properties of an AssetDiscoveryConfig. */ + interface IAssetDiscoveryConfig { + + /** AssetDiscoveryConfig projectIds */ + projectIds?: (string[]|null); + + /** AssetDiscoveryConfig inclusionMode */ + inclusionMode?: (google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode|null); + } + + /** Represents an AssetDiscoveryConfig. */ + class AssetDiscoveryConfig implements IAssetDiscoveryConfig { + + /** + * Constructs a new AssetDiscoveryConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.OrganizationSettings.IAssetDiscoveryConfig); + + /** AssetDiscoveryConfig projectIds. */ + public projectIds: string[]; + + /** AssetDiscoveryConfig inclusionMode. */ + public inclusionMode: google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode; + + /** + * Creates a new AssetDiscoveryConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns AssetDiscoveryConfig instance + */ + public static create(properties?: google.cloud.securitycenter.v1.OrganizationSettings.IAssetDiscoveryConfig): google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig; + + /** + * Encodes the specified AssetDiscoveryConfig message. Does not implicitly {@link google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.verify|verify} messages. + * @param message AssetDiscoveryConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.OrganizationSettings.IAssetDiscoveryConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AssetDiscoveryConfig message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.verify|verify} messages. + * @param message AssetDiscoveryConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.OrganizationSettings.IAssetDiscoveryConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AssetDiscoveryConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AssetDiscoveryConfig + * @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.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig; + + /** + * Decodes an AssetDiscoveryConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AssetDiscoveryConfig + * @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.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig; + + /** + * Verifies an AssetDiscoveryConfig 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 AssetDiscoveryConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AssetDiscoveryConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig; + + /** + * Creates a plain object from an AssetDiscoveryConfig message. Also converts values to other types if specified. + * @param message AssetDiscoveryConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AssetDiscoveryConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace AssetDiscoveryConfig { + + /** InclusionMode enum. */ + enum InclusionMode { + INCLUSION_MODE_UNSPECIFIED = 0, + INCLUDE_ONLY = 1, + EXCLUDE = 2 + } + } + } + + /** Properties of a RunAssetDiscoveryResponse. */ + interface IRunAssetDiscoveryResponse { + + /** RunAssetDiscoveryResponse state */ + state?: (google.cloud.securitycenter.v1.RunAssetDiscoveryResponse.State|null); + + /** RunAssetDiscoveryResponse duration */ + duration?: (google.protobuf.IDuration|null); + } + + /** Represents a RunAssetDiscoveryResponse. */ + class RunAssetDiscoveryResponse implements IRunAssetDiscoveryResponse { + + /** + * Constructs a new RunAssetDiscoveryResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IRunAssetDiscoveryResponse); + + /** RunAssetDiscoveryResponse state. */ + public state: google.cloud.securitycenter.v1.RunAssetDiscoveryResponse.State; + + /** RunAssetDiscoveryResponse duration. */ + public duration?: (google.protobuf.IDuration|null); + + /** + * Creates a new RunAssetDiscoveryResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns RunAssetDiscoveryResponse instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IRunAssetDiscoveryResponse): google.cloud.securitycenter.v1.RunAssetDiscoveryResponse; + + /** + * Encodes the specified RunAssetDiscoveryResponse message. Does not implicitly {@link google.cloud.securitycenter.v1.RunAssetDiscoveryResponse.verify|verify} messages. + * @param message RunAssetDiscoveryResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IRunAssetDiscoveryResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RunAssetDiscoveryResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.RunAssetDiscoveryResponse.verify|verify} messages. + * @param message RunAssetDiscoveryResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IRunAssetDiscoveryResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RunAssetDiscoveryResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RunAssetDiscoveryResponse + * @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.cloud.securitycenter.v1.RunAssetDiscoveryResponse; + + /** + * Decodes a RunAssetDiscoveryResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RunAssetDiscoveryResponse + * @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.cloud.securitycenter.v1.RunAssetDiscoveryResponse; + + /** + * Verifies a RunAssetDiscoveryResponse 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 RunAssetDiscoveryResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RunAssetDiscoveryResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.RunAssetDiscoveryResponse; + + /** + * Creates a plain object from a RunAssetDiscoveryResponse message. Also converts values to other types if specified. + * @param message RunAssetDiscoveryResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.RunAssetDiscoveryResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RunAssetDiscoveryResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace RunAssetDiscoveryResponse { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + COMPLETED = 1, + SUPERSEDED = 2, + TERMINATED = 3 + } + } + + /** Properties of a Source. */ + interface ISource { + + /** Source name */ + name?: (string|null); + + /** Source displayName */ + displayName?: (string|null); + + /** Source description */ + description?: (string|null); + } + + /** Represents a Source. */ + class Source implements ISource { + + /** + * Constructs a new Source. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.ISource); + + /** Source name. */ + public name: string; + + /** Source displayName. */ + public displayName: string; + + /** Source description. */ + public description: string; + + /** + * Creates a new Source instance using the specified properties. + * @param [properties] Properties to set + * @returns Source instance + */ + public static create(properties?: google.cloud.securitycenter.v1.ISource): google.cloud.securitycenter.v1.Source; + + /** + * Encodes the specified Source message. Does not implicitly {@link google.cloud.securitycenter.v1.Source.verify|verify} messages. + * @param message Source message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.ISource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Source message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Source.verify|verify} messages. + * @param message Source message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.ISource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Source message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Source + * @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.cloud.securitycenter.v1.Source; + + /** + * Decodes a Source message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Source + * @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.cloud.securitycenter.v1.Source; + + /** + * Verifies a Source 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 Source message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Source + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.Source; + + /** + * Creates a plain object from a Source message. Also converts values to other types if specified. + * @param message Source + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.Source, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Source to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** Namespace v1beta1. */ + namespace v1beta1 { + + /** Represents a SecurityCenter */ + class SecurityCenter extends $protobuf.rpc.Service { + + /** + * Constructs a new SecurityCenter 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 SecurityCenter 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): SecurityCenter; + + /** + * Calls CreateSource. + * @param request CreateSourceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Source + */ + public createSource(request: google.cloud.securitycenter.v1beta1.ICreateSourceRequest, callback: google.cloud.securitycenter.v1beta1.SecurityCenter.CreateSourceCallback): void; + + /** + * Calls CreateSource. + * @param request CreateSourceRequest message or plain object + * @returns Promise + */ + public createSource(request: google.cloud.securitycenter.v1beta1.ICreateSourceRequest): Promise; + + /** + * Calls CreateFinding. + * @param request CreateFindingRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Finding + */ + public createFinding(request: google.cloud.securitycenter.v1beta1.ICreateFindingRequest, callback: google.cloud.securitycenter.v1beta1.SecurityCenter.CreateFindingCallback): void; + + /** + * Calls CreateFinding. + * @param request CreateFindingRequest message or plain object + * @returns Promise + */ + public createFinding(request: google.cloud.securitycenter.v1beta1.ICreateFindingRequest): Promise; + + /** + * Calls GetIamPolicy. + * @param request GetIamPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Policy + */ + public getIamPolicy(request: google.iam.v1.IGetIamPolicyRequest, callback: google.cloud.securitycenter.v1beta1.SecurityCenter.GetIamPolicyCallback): void; + + /** + * Calls GetIamPolicy. + * @param request GetIamPolicyRequest message or plain object + * @returns Promise + */ + public getIamPolicy(request: google.iam.v1.IGetIamPolicyRequest): Promise; + + /** + * Calls GetOrganizationSettings. + * @param request GetOrganizationSettingsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and OrganizationSettings + */ + public getOrganizationSettings(request: google.cloud.securitycenter.v1beta1.IGetOrganizationSettingsRequest, callback: google.cloud.securitycenter.v1beta1.SecurityCenter.GetOrganizationSettingsCallback): void; + + /** + * Calls GetOrganizationSettings. + * @param request GetOrganizationSettingsRequest message or plain object + * @returns Promise + */ + public getOrganizationSettings(request: google.cloud.securitycenter.v1beta1.IGetOrganizationSettingsRequest): Promise; + + /** + * Calls GetSource. + * @param request GetSourceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Source + */ + public getSource(request: google.cloud.securitycenter.v1beta1.IGetSourceRequest, callback: google.cloud.securitycenter.v1beta1.SecurityCenter.GetSourceCallback): void; + + /** + * Calls GetSource. + * @param request GetSourceRequest message or plain object + * @returns Promise + */ + public getSource(request: google.cloud.securitycenter.v1beta1.IGetSourceRequest): Promise; + + /** + * Calls GroupAssets. + * @param request GroupAssetsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and GroupAssetsResponse + */ + public groupAssets(request: google.cloud.securitycenter.v1beta1.IGroupAssetsRequest, callback: google.cloud.securitycenter.v1beta1.SecurityCenter.GroupAssetsCallback): void; + + /** + * Calls GroupAssets. + * @param request GroupAssetsRequest message or plain object + * @returns Promise + */ + public groupAssets(request: google.cloud.securitycenter.v1beta1.IGroupAssetsRequest): Promise; + + /** + * Calls GroupFindings. + * @param request GroupFindingsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and GroupFindingsResponse + */ + public groupFindings(request: google.cloud.securitycenter.v1beta1.IGroupFindingsRequest, callback: google.cloud.securitycenter.v1beta1.SecurityCenter.GroupFindingsCallback): void; + + /** + * Calls GroupFindings. + * @param request GroupFindingsRequest message or plain object + * @returns Promise + */ + public groupFindings(request: google.cloud.securitycenter.v1beta1.IGroupFindingsRequest): Promise; + + /** + * Calls ListAssets. + * @param request ListAssetsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListAssetsResponse + */ + public listAssets(request: google.cloud.securitycenter.v1beta1.IListAssetsRequest, callback: google.cloud.securitycenter.v1beta1.SecurityCenter.ListAssetsCallback): void; + + /** + * Calls ListAssets. + * @param request ListAssetsRequest message or plain object + * @returns Promise + */ + public listAssets(request: google.cloud.securitycenter.v1beta1.IListAssetsRequest): Promise; + + /** + * Calls ListFindings. + * @param request ListFindingsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListFindingsResponse + */ + public listFindings(request: google.cloud.securitycenter.v1beta1.IListFindingsRequest, callback: google.cloud.securitycenter.v1beta1.SecurityCenter.ListFindingsCallback): void; + + /** + * Calls ListFindings. + * @param request ListFindingsRequest message or plain object + * @returns Promise + */ + public listFindings(request: google.cloud.securitycenter.v1beta1.IListFindingsRequest): Promise; + + /** + * Calls ListSources. + * @param request ListSourcesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListSourcesResponse + */ + public listSources(request: google.cloud.securitycenter.v1beta1.IListSourcesRequest, callback: google.cloud.securitycenter.v1beta1.SecurityCenter.ListSourcesCallback): void; + + /** + * Calls ListSources. + * @param request ListSourcesRequest message or plain object + * @returns Promise + */ + public listSources(request: google.cloud.securitycenter.v1beta1.IListSourcesRequest): Promise; + + /** + * Calls RunAssetDiscovery. + * @param request RunAssetDiscoveryRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public runAssetDiscovery(request: google.cloud.securitycenter.v1beta1.IRunAssetDiscoveryRequest, callback: google.cloud.securitycenter.v1beta1.SecurityCenter.RunAssetDiscoveryCallback): void; + + /** + * Calls RunAssetDiscovery. + * @param request RunAssetDiscoveryRequest message or plain object + * @returns Promise + */ + public runAssetDiscovery(request: google.cloud.securitycenter.v1beta1.IRunAssetDiscoveryRequest): Promise; + + /** + * Calls SetFindingState. + * @param request SetFindingStateRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Finding + */ + public setFindingState(request: google.cloud.securitycenter.v1beta1.ISetFindingStateRequest, callback: google.cloud.securitycenter.v1beta1.SecurityCenter.SetFindingStateCallback): void; + + /** + * Calls SetFindingState. + * @param request SetFindingStateRequest message or plain object + * @returns Promise + */ + public setFindingState(request: google.cloud.securitycenter.v1beta1.ISetFindingStateRequest): Promise; + + /** + * Calls SetIamPolicy. + * @param request SetIamPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Policy + */ + public setIamPolicy(request: google.iam.v1.ISetIamPolicyRequest, callback: google.cloud.securitycenter.v1beta1.SecurityCenter.SetIamPolicyCallback): void; + + /** + * Calls SetIamPolicy. + * @param request SetIamPolicyRequest message or plain object + * @returns Promise + */ + public setIamPolicy(request: google.iam.v1.ISetIamPolicyRequest): Promise; + + /** + * Calls TestIamPermissions. + * @param request TestIamPermissionsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and TestIamPermissionsResponse + */ + public testIamPermissions(request: google.iam.v1.ITestIamPermissionsRequest, callback: google.cloud.securitycenter.v1beta1.SecurityCenter.TestIamPermissionsCallback): void; + + /** + * Calls TestIamPermissions. + * @param request TestIamPermissionsRequest message or plain object + * @returns Promise + */ + public testIamPermissions(request: google.iam.v1.ITestIamPermissionsRequest): Promise; + + /** + * Calls UpdateFinding. + * @param request UpdateFindingRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Finding + */ + public updateFinding(request: google.cloud.securitycenter.v1beta1.IUpdateFindingRequest, callback: google.cloud.securitycenter.v1beta1.SecurityCenter.UpdateFindingCallback): void; + + /** + * Calls UpdateFinding. + * @param request UpdateFindingRequest message or plain object + * @returns Promise + */ + public updateFinding(request: google.cloud.securitycenter.v1beta1.IUpdateFindingRequest): Promise; + + /** + * Calls UpdateOrganizationSettings. + * @param request UpdateOrganizationSettingsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and OrganizationSettings + */ + public updateOrganizationSettings(request: google.cloud.securitycenter.v1beta1.IUpdateOrganizationSettingsRequest, callback: google.cloud.securitycenter.v1beta1.SecurityCenter.UpdateOrganizationSettingsCallback): void; + + /** + * Calls UpdateOrganizationSettings. + * @param request UpdateOrganizationSettingsRequest message or plain object + * @returns Promise + */ + public updateOrganizationSettings(request: google.cloud.securitycenter.v1beta1.IUpdateOrganizationSettingsRequest): Promise; + + /** + * Calls UpdateSource. + * @param request UpdateSourceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Source + */ + public updateSource(request: google.cloud.securitycenter.v1beta1.IUpdateSourceRequest, callback: google.cloud.securitycenter.v1beta1.SecurityCenter.UpdateSourceCallback): void; + + /** + * Calls UpdateSource. + * @param request UpdateSourceRequest message or plain object + * @returns Promise + */ + public updateSource(request: google.cloud.securitycenter.v1beta1.IUpdateSourceRequest): Promise; + + /** + * Calls UpdateSecurityMarks. + * @param request UpdateSecurityMarksRequest message or plain object + * @param callback Node-style callback called with the error, if any, and SecurityMarks + */ + public updateSecurityMarks(request: google.cloud.securitycenter.v1beta1.IUpdateSecurityMarksRequest, callback: google.cloud.securitycenter.v1beta1.SecurityCenter.UpdateSecurityMarksCallback): void; + + /** + * Calls UpdateSecurityMarks. + * @param request UpdateSecurityMarksRequest message or plain object + * @returns Promise + */ + public updateSecurityMarks(request: google.cloud.securitycenter.v1beta1.IUpdateSecurityMarksRequest): Promise; + } + + namespace SecurityCenter { + + /** + * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter#createSource}. + * @param error Error, if any + * @param [response] Source + */ + type CreateSourceCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1beta1.Source) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter#createFinding}. + * @param error Error, if any + * @param [response] Finding + */ + type CreateFindingCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1beta1.Finding) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter#getIamPolicy}. + * @param error Error, if any + * @param [response] Policy + */ + type GetIamPolicyCallback = (error: (Error|null), response?: google.iam.v1.Policy) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter#getOrganizationSettings}. + * @param error Error, if any + * @param [response] OrganizationSettings + */ + type GetOrganizationSettingsCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1beta1.OrganizationSettings) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter#getSource}. + * @param error Error, if any + * @param [response] Source + */ + type GetSourceCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1beta1.Source) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter#groupAssets}. + * @param error Error, if any + * @param [response] GroupAssetsResponse + */ + type GroupAssetsCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1beta1.GroupAssetsResponse) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter#groupFindings}. + * @param error Error, if any + * @param [response] GroupFindingsResponse + */ + type GroupFindingsCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1beta1.GroupFindingsResponse) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter#listAssets}. + * @param error Error, if any + * @param [response] ListAssetsResponse + */ + type ListAssetsCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1beta1.ListAssetsResponse) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter#listFindings}. + * @param error Error, if any + * @param [response] ListFindingsResponse + */ + type ListFindingsCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1beta1.ListFindingsResponse) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter#listSources}. + * @param error Error, if any + * @param [response] ListSourcesResponse + */ + type ListSourcesCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1beta1.ListSourcesResponse) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter#runAssetDiscovery}. + * @param error Error, if any + * @param [response] Operation + */ + type RunAssetDiscoveryCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter#setFindingState}. + * @param error Error, if any + * @param [response] Finding + */ + type SetFindingStateCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1beta1.Finding) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter#setIamPolicy}. + * @param error Error, if any + * @param [response] Policy + */ + type SetIamPolicyCallback = (error: (Error|null), response?: google.iam.v1.Policy) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter#testIamPermissions}. + * @param error Error, if any + * @param [response] TestIamPermissionsResponse + */ + type TestIamPermissionsCallback = (error: (Error|null), response?: google.iam.v1.TestIamPermissionsResponse) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter#updateFinding}. + * @param error Error, if any + * @param [response] Finding + */ + type UpdateFindingCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1beta1.Finding) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter#updateOrganizationSettings}. + * @param error Error, if any + * @param [response] OrganizationSettings + */ + type UpdateOrganizationSettingsCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1beta1.OrganizationSettings) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter#updateSource}. + * @param error Error, if any + * @param [response] Source + */ + type UpdateSourceCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1beta1.Source) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter#updateSecurityMarks}. + * @param error Error, if any + * @param [response] SecurityMarks + */ + type UpdateSecurityMarksCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1beta1.SecurityMarks) => void; + } + + /** Properties of a CreateFindingRequest. */ + interface ICreateFindingRequest { + + /** CreateFindingRequest parent */ + parent?: (string|null); + + /** CreateFindingRequest findingId */ + findingId?: (string|null); + + /** CreateFindingRequest finding */ + finding?: (google.cloud.securitycenter.v1beta1.IFinding|null); + } + + /** Represents a CreateFindingRequest. */ + class CreateFindingRequest implements ICreateFindingRequest { + + /** + * Constructs a new CreateFindingRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1beta1.ICreateFindingRequest); + + /** CreateFindingRequest parent. */ + public parent: string; + + /** CreateFindingRequest findingId. */ + public findingId: string; + + /** CreateFindingRequest finding. */ + public finding?: (google.cloud.securitycenter.v1beta1.IFinding|null); + + /** + * Creates a new CreateFindingRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateFindingRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v1beta1.ICreateFindingRequest): google.cloud.securitycenter.v1beta1.CreateFindingRequest; + + /** + * Encodes the specified CreateFindingRequest message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.CreateFindingRequest.verify|verify} messages. + * @param message CreateFindingRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1beta1.ICreateFindingRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateFindingRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.CreateFindingRequest.verify|verify} messages. + * @param message CreateFindingRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1beta1.ICreateFindingRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateFindingRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateFindingRequest + * @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.cloud.securitycenter.v1beta1.CreateFindingRequest; + + /** + * Decodes a CreateFindingRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateFindingRequest + * @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.cloud.securitycenter.v1beta1.CreateFindingRequest; + + /** + * Verifies a CreateFindingRequest 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 CreateFindingRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateFindingRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1beta1.CreateFindingRequest; + + /** + * Creates a plain object from a CreateFindingRequest message. Also converts values to other types if specified. + * @param message CreateFindingRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1beta1.CreateFindingRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateFindingRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a CreateSourceRequest. */ + interface ICreateSourceRequest { + + /** CreateSourceRequest parent */ + parent?: (string|null); + + /** CreateSourceRequest source */ + source?: (google.cloud.securitycenter.v1beta1.ISource|null); + } + + /** Represents a CreateSourceRequest. */ + class CreateSourceRequest implements ICreateSourceRequest { + + /** + * Constructs a new CreateSourceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1beta1.ICreateSourceRequest); + + /** CreateSourceRequest parent. */ + public parent: string; + + /** CreateSourceRequest source. */ + public source?: (google.cloud.securitycenter.v1beta1.ISource|null); + + /** + * Creates a new CreateSourceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateSourceRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v1beta1.ICreateSourceRequest): google.cloud.securitycenter.v1beta1.CreateSourceRequest; + + /** + * Encodes the specified CreateSourceRequest message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.CreateSourceRequest.verify|verify} messages. + * @param message CreateSourceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1beta1.ICreateSourceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateSourceRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.CreateSourceRequest.verify|verify} messages. + * @param message CreateSourceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1beta1.ICreateSourceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateSourceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateSourceRequest + * @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.cloud.securitycenter.v1beta1.CreateSourceRequest; + + /** + * Decodes a CreateSourceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateSourceRequest + * @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.cloud.securitycenter.v1beta1.CreateSourceRequest; + + /** + * Verifies a CreateSourceRequest 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 CreateSourceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateSourceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1beta1.CreateSourceRequest; + + /** + * Creates a plain object from a CreateSourceRequest message. Also converts values to other types if specified. + * @param message CreateSourceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1beta1.CreateSourceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateSourceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GetOrganizationSettingsRequest. */ + interface IGetOrganizationSettingsRequest { + + /** GetOrganizationSettingsRequest name */ + name?: (string|null); + } + + /** Represents a GetOrganizationSettingsRequest. */ + class GetOrganizationSettingsRequest implements IGetOrganizationSettingsRequest { + + /** + * Constructs a new GetOrganizationSettingsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1beta1.IGetOrganizationSettingsRequest); + + /** GetOrganizationSettingsRequest name. */ + public name: string; + + /** + * Creates a new GetOrganizationSettingsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetOrganizationSettingsRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v1beta1.IGetOrganizationSettingsRequest): google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest; + + /** + * Encodes the specified GetOrganizationSettingsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest.verify|verify} messages. + * @param message GetOrganizationSettingsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1beta1.IGetOrganizationSettingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetOrganizationSettingsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest.verify|verify} messages. + * @param message GetOrganizationSettingsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1beta1.IGetOrganizationSettingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetOrganizationSettingsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetOrganizationSettingsRequest + * @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.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest; + + /** + * Decodes a GetOrganizationSettingsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetOrganizationSettingsRequest + * @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.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest; + + /** + * Verifies a GetOrganizationSettingsRequest 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 GetOrganizationSettingsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetOrganizationSettingsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest; + + /** + * Creates a plain object from a GetOrganizationSettingsRequest message. Also converts values to other types if specified. + * @param message GetOrganizationSettingsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetOrganizationSettingsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GetSourceRequest. */ + interface IGetSourceRequest { + + /** GetSourceRequest name */ + name?: (string|null); + } + + /** Represents a GetSourceRequest. */ + class GetSourceRequest implements IGetSourceRequest { + + /** + * Constructs a new GetSourceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1beta1.IGetSourceRequest); + + /** GetSourceRequest name. */ + public name: string; + + /** + * Creates a new GetSourceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetSourceRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v1beta1.IGetSourceRequest): google.cloud.securitycenter.v1beta1.GetSourceRequest; + + /** + * Encodes the specified GetSourceRequest message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.GetSourceRequest.verify|verify} messages. + * @param message GetSourceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1beta1.IGetSourceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetSourceRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.GetSourceRequest.verify|verify} messages. + * @param message GetSourceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1beta1.IGetSourceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetSourceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetSourceRequest + * @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.cloud.securitycenter.v1beta1.GetSourceRequest; + + /** + * Decodes a GetSourceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetSourceRequest + * @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.cloud.securitycenter.v1beta1.GetSourceRequest; + + /** + * Verifies a GetSourceRequest 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 GetSourceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetSourceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1beta1.GetSourceRequest; + + /** + * Creates a plain object from a GetSourceRequest message. Also converts values to other types if specified. + * @param message GetSourceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1beta1.GetSourceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetSourceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GroupAssetsRequest. */ + interface IGroupAssetsRequest { + + /** GroupAssetsRequest parent */ + parent?: (string|null); + + /** GroupAssetsRequest filter */ + filter?: (string|null); + + /** GroupAssetsRequest groupBy */ + groupBy?: (string|null); + + /** GroupAssetsRequest compareDuration */ + compareDuration?: (google.protobuf.IDuration|null); + + /** GroupAssetsRequest readTime */ + readTime?: (google.protobuf.ITimestamp|null); + + /** GroupAssetsRequest pageToken */ + pageToken?: (string|null); + + /** GroupAssetsRequest pageSize */ + pageSize?: (number|null); + } + + /** Represents a GroupAssetsRequest. */ + class GroupAssetsRequest implements IGroupAssetsRequest { + + /** + * Constructs a new GroupAssetsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1beta1.IGroupAssetsRequest); + + /** GroupAssetsRequest parent. */ + public parent: string; + + /** GroupAssetsRequest filter. */ + public filter: string; + + /** GroupAssetsRequest groupBy. */ + public groupBy: string; + + /** GroupAssetsRequest compareDuration. */ + public compareDuration?: (google.protobuf.IDuration|null); + + /** GroupAssetsRequest readTime. */ + public readTime?: (google.protobuf.ITimestamp|null); + + /** GroupAssetsRequest pageToken. */ + public pageToken: string; + + /** GroupAssetsRequest pageSize. */ + public pageSize: number; + + /** + * Creates a new GroupAssetsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GroupAssetsRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v1beta1.IGroupAssetsRequest): google.cloud.securitycenter.v1beta1.GroupAssetsRequest; + + /** + * Encodes the specified GroupAssetsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.GroupAssetsRequest.verify|verify} messages. + * @param message GroupAssetsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1beta1.IGroupAssetsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GroupAssetsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.GroupAssetsRequest.verify|verify} messages. + * @param message GroupAssetsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1beta1.IGroupAssetsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GroupAssetsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GroupAssetsRequest + * @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.cloud.securitycenter.v1beta1.GroupAssetsRequest; + + /** + * Decodes a GroupAssetsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GroupAssetsRequest + * @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.cloud.securitycenter.v1beta1.GroupAssetsRequest; + + /** + * Verifies a GroupAssetsRequest 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 GroupAssetsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GroupAssetsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1beta1.GroupAssetsRequest; + + /** + * Creates a plain object from a GroupAssetsRequest message. Also converts values to other types if specified. + * @param message GroupAssetsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1beta1.GroupAssetsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GroupAssetsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GroupAssetsResponse. */ + interface IGroupAssetsResponse { + + /** GroupAssetsResponse groupByResults */ + groupByResults?: (google.cloud.securitycenter.v1beta1.IGroupResult[]|null); + + /** GroupAssetsResponse readTime */ + readTime?: (google.protobuf.ITimestamp|null); + + /** GroupAssetsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a GroupAssetsResponse. */ + class GroupAssetsResponse implements IGroupAssetsResponse { + + /** + * Constructs a new GroupAssetsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1beta1.IGroupAssetsResponse); + + /** GroupAssetsResponse groupByResults. */ + public groupByResults: google.cloud.securitycenter.v1beta1.IGroupResult[]; + + /** GroupAssetsResponse readTime. */ + public readTime?: (google.protobuf.ITimestamp|null); + + /** GroupAssetsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new GroupAssetsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns GroupAssetsResponse instance + */ + public static create(properties?: google.cloud.securitycenter.v1beta1.IGroupAssetsResponse): google.cloud.securitycenter.v1beta1.GroupAssetsResponse; + + /** + * Encodes the specified GroupAssetsResponse message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.GroupAssetsResponse.verify|verify} messages. + * @param message GroupAssetsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1beta1.IGroupAssetsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GroupAssetsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.GroupAssetsResponse.verify|verify} messages. + * @param message GroupAssetsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1beta1.IGroupAssetsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GroupAssetsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GroupAssetsResponse + * @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.cloud.securitycenter.v1beta1.GroupAssetsResponse; + + /** + * Decodes a GroupAssetsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GroupAssetsResponse + * @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.cloud.securitycenter.v1beta1.GroupAssetsResponse; + + /** + * Verifies a GroupAssetsResponse 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 GroupAssetsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GroupAssetsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1beta1.GroupAssetsResponse; + + /** + * Creates a plain object from a GroupAssetsResponse message. Also converts values to other types if specified. + * @param message GroupAssetsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1beta1.GroupAssetsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GroupAssetsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GroupFindingsRequest. */ + interface IGroupFindingsRequest { + + /** GroupFindingsRequest parent */ + parent?: (string|null); + + /** GroupFindingsRequest filter */ + filter?: (string|null); + + /** GroupFindingsRequest groupBy */ + groupBy?: (string|null); + + /** GroupFindingsRequest readTime */ + readTime?: (google.protobuf.ITimestamp|null); + + /** GroupFindingsRequest pageToken */ + pageToken?: (string|null); + + /** GroupFindingsRequest pageSize */ + pageSize?: (number|null); + } + + /** Represents a GroupFindingsRequest. */ + class GroupFindingsRequest implements IGroupFindingsRequest { + + /** + * Constructs a new GroupFindingsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1beta1.IGroupFindingsRequest); + + /** GroupFindingsRequest parent. */ + public parent: string; + + /** GroupFindingsRequest filter. */ + public filter: string; + + /** GroupFindingsRequest groupBy. */ + public groupBy: string; + + /** GroupFindingsRequest readTime. */ + public readTime?: (google.protobuf.ITimestamp|null); + + /** GroupFindingsRequest pageToken. */ + public pageToken: string; + + /** GroupFindingsRequest pageSize. */ + public pageSize: number; + + /** + * Creates a new GroupFindingsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GroupFindingsRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v1beta1.IGroupFindingsRequest): google.cloud.securitycenter.v1beta1.GroupFindingsRequest; + + /** + * Encodes the specified GroupFindingsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.GroupFindingsRequest.verify|verify} messages. + * @param message GroupFindingsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1beta1.IGroupFindingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GroupFindingsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.GroupFindingsRequest.verify|verify} messages. + * @param message GroupFindingsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1beta1.IGroupFindingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GroupFindingsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GroupFindingsRequest + * @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.cloud.securitycenter.v1beta1.GroupFindingsRequest; + + /** + * Decodes a GroupFindingsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GroupFindingsRequest + * @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.cloud.securitycenter.v1beta1.GroupFindingsRequest; + + /** + * Verifies a GroupFindingsRequest 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 GroupFindingsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GroupFindingsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1beta1.GroupFindingsRequest; + + /** + * Creates a plain object from a GroupFindingsRequest message. Also converts values to other types if specified. + * @param message GroupFindingsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1beta1.GroupFindingsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GroupFindingsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GroupFindingsResponse. */ + interface IGroupFindingsResponse { + + /** GroupFindingsResponse groupByResults */ + groupByResults?: (google.cloud.securitycenter.v1beta1.IGroupResult[]|null); + + /** GroupFindingsResponse readTime */ + readTime?: (google.protobuf.ITimestamp|null); + + /** GroupFindingsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a GroupFindingsResponse. */ + class GroupFindingsResponse implements IGroupFindingsResponse { + + /** + * Constructs a new GroupFindingsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1beta1.IGroupFindingsResponse); + + /** GroupFindingsResponse groupByResults. */ + public groupByResults: google.cloud.securitycenter.v1beta1.IGroupResult[]; + + /** GroupFindingsResponse readTime. */ + public readTime?: (google.protobuf.ITimestamp|null); + + /** GroupFindingsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new GroupFindingsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns GroupFindingsResponse instance + */ + public static create(properties?: google.cloud.securitycenter.v1beta1.IGroupFindingsResponse): google.cloud.securitycenter.v1beta1.GroupFindingsResponse; + + /** + * Encodes the specified GroupFindingsResponse message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.GroupFindingsResponse.verify|verify} messages. + * @param message GroupFindingsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1beta1.IGroupFindingsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GroupFindingsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.GroupFindingsResponse.verify|verify} messages. + * @param message GroupFindingsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1beta1.IGroupFindingsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GroupFindingsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GroupFindingsResponse + * @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.cloud.securitycenter.v1beta1.GroupFindingsResponse; + + /** + * Decodes a GroupFindingsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GroupFindingsResponse + * @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.cloud.securitycenter.v1beta1.GroupFindingsResponse; + + /** + * Verifies a GroupFindingsResponse 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 GroupFindingsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GroupFindingsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1beta1.GroupFindingsResponse; + + /** + * Creates a plain object from a GroupFindingsResponse message. Also converts values to other types if specified. + * @param message GroupFindingsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1beta1.GroupFindingsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GroupFindingsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GroupResult. */ + interface IGroupResult { + + /** GroupResult properties */ + properties?: ({ [k: string]: google.protobuf.IValue }|null); + + /** GroupResult count */ + count?: (number|Long|null); + } + + /** Represents a GroupResult. */ + class GroupResult implements IGroupResult { + + /** + * Constructs a new GroupResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1beta1.IGroupResult); + + /** GroupResult properties. */ + public properties: { [k: string]: google.protobuf.IValue }; + + /** GroupResult count. */ + public count: (number|Long); + + /** + * Creates a new GroupResult instance using the specified properties. + * @param [properties] Properties to set + * @returns GroupResult instance + */ + public static create(properties?: google.cloud.securitycenter.v1beta1.IGroupResult): google.cloud.securitycenter.v1beta1.GroupResult; + + /** + * Encodes the specified GroupResult message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.GroupResult.verify|verify} messages. + * @param message GroupResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1beta1.IGroupResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GroupResult message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.GroupResult.verify|verify} messages. + * @param message GroupResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1beta1.IGroupResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GroupResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GroupResult + * @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.cloud.securitycenter.v1beta1.GroupResult; + + /** + * Decodes a GroupResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GroupResult + * @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.cloud.securitycenter.v1beta1.GroupResult; + + /** + * Verifies a GroupResult 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 GroupResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GroupResult + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1beta1.GroupResult; + + /** + * Creates a plain object from a GroupResult message. Also converts values to other types if specified. + * @param message GroupResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1beta1.GroupResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GroupResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListSourcesRequest. */ + interface IListSourcesRequest { + + /** ListSourcesRequest parent */ + parent?: (string|null); + + /** ListSourcesRequest pageToken */ + pageToken?: (string|null); + + /** ListSourcesRequest pageSize */ + pageSize?: (number|null); + } + + /** Represents a ListSourcesRequest. */ + class ListSourcesRequest implements IListSourcesRequest { + + /** + * Constructs a new ListSourcesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1beta1.IListSourcesRequest); + + /** ListSourcesRequest parent. */ + public parent: string; + + /** ListSourcesRequest pageToken. */ + public pageToken: string; + + /** ListSourcesRequest pageSize. */ + public pageSize: number; + + /** + * Creates a new ListSourcesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListSourcesRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v1beta1.IListSourcesRequest): google.cloud.securitycenter.v1beta1.ListSourcesRequest; + + /** + * Encodes the specified ListSourcesRequest message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.ListSourcesRequest.verify|verify} messages. + * @param message ListSourcesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1beta1.IListSourcesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListSourcesRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.ListSourcesRequest.verify|verify} messages. + * @param message ListSourcesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1beta1.IListSourcesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListSourcesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListSourcesRequest + * @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.cloud.securitycenter.v1beta1.ListSourcesRequest; + + /** + * Decodes a ListSourcesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListSourcesRequest + * @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.cloud.securitycenter.v1beta1.ListSourcesRequest; + + /** + * Verifies a ListSourcesRequest 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 ListSourcesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListSourcesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1beta1.ListSourcesRequest; + + /** + * Creates a plain object from a ListSourcesRequest message. Also converts values to other types if specified. + * @param message ListSourcesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1beta1.ListSourcesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListSourcesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListSourcesResponse. */ + interface IListSourcesResponse { + + /** ListSourcesResponse sources */ + sources?: (google.cloud.securitycenter.v1beta1.ISource[]|null); + + /** ListSourcesResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListSourcesResponse. */ + class ListSourcesResponse implements IListSourcesResponse { + + /** + * Constructs a new ListSourcesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1beta1.IListSourcesResponse); + + /** ListSourcesResponse sources. */ + public sources: google.cloud.securitycenter.v1beta1.ISource[]; + + /** ListSourcesResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListSourcesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListSourcesResponse instance + */ + public static create(properties?: google.cloud.securitycenter.v1beta1.IListSourcesResponse): google.cloud.securitycenter.v1beta1.ListSourcesResponse; + + /** + * Encodes the specified ListSourcesResponse message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.ListSourcesResponse.verify|verify} messages. + * @param message ListSourcesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1beta1.IListSourcesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListSourcesResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.ListSourcesResponse.verify|verify} messages. + * @param message ListSourcesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1beta1.IListSourcesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListSourcesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListSourcesResponse + * @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.cloud.securitycenter.v1beta1.ListSourcesResponse; + + /** + * Decodes a ListSourcesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListSourcesResponse + * @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.cloud.securitycenter.v1beta1.ListSourcesResponse; + + /** + * Verifies a ListSourcesResponse 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 ListSourcesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListSourcesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1beta1.ListSourcesResponse; + + /** + * Creates a plain object from a ListSourcesResponse message. Also converts values to other types if specified. + * @param message ListSourcesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1beta1.ListSourcesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListSourcesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListAssetsRequest. */ + interface IListAssetsRequest { + + /** ListAssetsRequest parent */ + parent?: (string|null); + + /** ListAssetsRequest filter */ + filter?: (string|null); + + /** ListAssetsRequest orderBy */ + orderBy?: (string|null); + + /** ListAssetsRequest readTime */ + readTime?: (google.protobuf.ITimestamp|null); + + /** ListAssetsRequest compareDuration */ + compareDuration?: (google.protobuf.IDuration|null); + + /** ListAssetsRequest fieldMask */ + fieldMask?: (google.protobuf.IFieldMask|null); + + /** ListAssetsRequest pageToken */ + pageToken?: (string|null); + + /** ListAssetsRequest pageSize */ + pageSize?: (number|null); + } + + /** Represents a ListAssetsRequest. */ + class ListAssetsRequest implements IListAssetsRequest { + + /** + * Constructs a new ListAssetsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1beta1.IListAssetsRequest); + + /** ListAssetsRequest parent. */ + public parent: string; + + /** ListAssetsRequest filter. */ + public filter: string; + + /** ListAssetsRequest orderBy. */ + public orderBy: string; + + /** ListAssetsRequest readTime. */ + public readTime?: (google.protobuf.ITimestamp|null); + + /** ListAssetsRequest compareDuration. */ + public compareDuration?: (google.protobuf.IDuration|null); + + /** ListAssetsRequest fieldMask. */ + public fieldMask?: (google.protobuf.IFieldMask|null); + + /** ListAssetsRequest pageToken. */ + public pageToken: string; + + /** ListAssetsRequest pageSize. */ + public pageSize: number; + + /** + * Creates a new ListAssetsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListAssetsRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v1beta1.IListAssetsRequest): google.cloud.securitycenter.v1beta1.ListAssetsRequest; + + /** + * Encodes the specified ListAssetsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.ListAssetsRequest.verify|verify} messages. + * @param message ListAssetsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1beta1.IListAssetsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListAssetsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.ListAssetsRequest.verify|verify} messages. + * @param message ListAssetsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1beta1.IListAssetsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListAssetsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListAssetsRequest + * @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.cloud.securitycenter.v1beta1.ListAssetsRequest; + + /** + * Decodes a ListAssetsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListAssetsRequest + * @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.cloud.securitycenter.v1beta1.ListAssetsRequest; + + /** + * Verifies a ListAssetsRequest 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 ListAssetsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListAssetsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1beta1.ListAssetsRequest; + + /** + * Creates a plain object from a ListAssetsRequest message. Also converts values to other types if specified. + * @param message ListAssetsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1beta1.ListAssetsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListAssetsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListAssetsResponse. */ + interface IListAssetsResponse { + + /** ListAssetsResponse listAssetsResults */ + listAssetsResults?: (google.cloud.securitycenter.v1beta1.ListAssetsResponse.IListAssetsResult[]|null); + + /** ListAssetsResponse readTime */ + readTime?: (google.protobuf.ITimestamp|null); + + /** ListAssetsResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListAssetsResponse totalSize */ + totalSize?: (number|null); + } + + /** Represents a ListAssetsResponse. */ + class ListAssetsResponse implements IListAssetsResponse { + + /** + * Constructs a new ListAssetsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1beta1.IListAssetsResponse); + + /** ListAssetsResponse listAssetsResults. */ + public listAssetsResults: google.cloud.securitycenter.v1beta1.ListAssetsResponse.IListAssetsResult[]; + + /** ListAssetsResponse readTime. */ + public readTime?: (google.protobuf.ITimestamp|null); + + /** ListAssetsResponse nextPageToken. */ + public nextPageToken: string; + + /** ListAssetsResponse totalSize. */ + public totalSize: number; + + /** + * Creates a new ListAssetsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListAssetsResponse instance + */ + public static create(properties?: google.cloud.securitycenter.v1beta1.IListAssetsResponse): google.cloud.securitycenter.v1beta1.ListAssetsResponse; + + /** + * Encodes the specified ListAssetsResponse message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.ListAssetsResponse.verify|verify} messages. + * @param message ListAssetsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1beta1.IListAssetsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListAssetsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.ListAssetsResponse.verify|verify} messages. + * @param message ListAssetsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1beta1.IListAssetsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListAssetsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListAssetsResponse + * @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.cloud.securitycenter.v1beta1.ListAssetsResponse; + + /** + * Decodes a ListAssetsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListAssetsResponse + * @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.cloud.securitycenter.v1beta1.ListAssetsResponse; + + /** + * Verifies a ListAssetsResponse 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 ListAssetsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListAssetsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1beta1.ListAssetsResponse; + + /** + * Creates a plain object from a ListAssetsResponse message. Also converts values to other types if specified. + * @param message ListAssetsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1beta1.ListAssetsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListAssetsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace ListAssetsResponse { + + /** Properties of a ListAssetsResult. */ + interface IListAssetsResult { + + /** ListAssetsResult asset */ + asset?: (google.cloud.securitycenter.v1beta1.IAsset|null); + + /** ListAssetsResult state */ + state?: (google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult.State|null); + } + + /** Represents a ListAssetsResult. */ + class ListAssetsResult implements IListAssetsResult { + + /** + * Constructs a new ListAssetsResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1beta1.ListAssetsResponse.IListAssetsResult); + + /** ListAssetsResult asset. */ + public asset?: (google.cloud.securitycenter.v1beta1.IAsset|null); + + /** ListAssetsResult state. */ + public state: google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult.State; + + /** + * Creates a new ListAssetsResult instance using the specified properties. + * @param [properties] Properties to set + * @returns ListAssetsResult instance + */ + public static create(properties?: google.cloud.securitycenter.v1beta1.ListAssetsResponse.IListAssetsResult): google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult; + + /** + * Encodes the specified ListAssetsResult message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult.verify|verify} messages. + * @param message ListAssetsResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1beta1.ListAssetsResponse.IListAssetsResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListAssetsResult message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult.verify|verify} messages. + * @param message ListAssetsResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1beta1.ListAssetsResponse.IListAssetsResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListAssetsResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListAssetsResult + * @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.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult; + + /** + * Decodes a ListAssetsResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListAssetsResult + * @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.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult; + + /** + * Verifies a ListAssetsResult 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 ListAssetsResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListAssetsResult + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult; + + /** + * Creates a plain object from a ListAssetsResult message. Also converts values to other types if specified. + * @param message ListAssetsResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListAssetsResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace ListAssetsResult { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + UNUSED = 1, + ADDED = 2, + REMOVED = 3, + ACTIVE = 4 + } + } + } + + /** Properties of a ListFindingsRequest. */ + interface IListFindingsRequest { + + /** ListFindingsRequest parent */ + parent?: (string|null); + + /** ListFindingsRequest filter */ + filter?: (string|null); + + /** ListFindingsRequest orderBy */ + orderBy?: (string|null); + + /** ListFindingsRequest readTime */ + readTime?: (google.protobuf.ITimestamp|null); + + /** ListFindingsRequest fieldMask */ + fieldMask?: (google.protobuf.IFieldMask|null); + + /** ListFindingsRequest pageToken */ + pageToken?: (string|null); + + /** ListFindingsRequest pageSize */ + pageSize?: (number|null); + } + + /** Represents a ListFindingsRequest. */ + class ListFindingsRequest implements IListFindingsRequest { + + /** + * Constructs a new ListFindingsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1beta1.IListFindingsRequest); + + /** ListFindingsRequest parent. */ + public parent: string; + + /** ListFindingsRequest filter. */ + public filter: string; + + /** ListFindingsRequest orderBy. */ + public orderBy: string; + + /** ListFindingsRequest readTime. */ + public readTime?: (google.protobuf.ITimestamp|null); + + /** ListFindingsRequest fieldMask. */ + public fieldMask?: (google.protobuf.IFieldMask|null); + + /** ListFindingsRequest pageToken. */ + public pageToken: string; + + /** ListFindingsRequest pageSize. */ + public pageSize: number; + + /** + * Creates a new ListFindingsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListFindingsRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v1beta1.IListFindingsRequest): google.cloud.securitycenter.v1beta1.ListFindingsRequest; + + /** + * Encodes the specified ListFindingsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.ListFindingsRequest.verify|verify} messages. + * @param message ListFindingsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1beta1.IListFindingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListFindingsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.ListFindingsRequest.verify|verify} messages. + * @param message ListFindingsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1beta1.IListFindingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListFindingsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListFindingsRequest + * @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.cloud.securitycenter.v1beta1.ListFindingsRequest; + + /** + * Decodes a ListFindingsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListFindingsRequest + * @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.cloud.securitycenter.v1beta1.ListFindingsRequest; + + /** + * Verifies a ListFindingsRequest 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 ListFindingsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListFindingsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1beta1.ListFindingsRequest; + + /** + * Creates a plain object from a ListFindingsRequest message. Also converts values to other types if specified. + * @param message ListFindingsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1beta1.ListFindingsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListFindingsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListFindingsResponse. */ + interface IListFindingsResponse { + + /** ListFindingsResponse findings */ + findings?: (google.cloud.securitycenter.v1beta1.IFinding[]|null); + + /** ListFindingsResponse readTime */ + readTime?: (google.protobuf.ITimestamp|null); + + /** ListFindingsResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListFindingsResponse totalSize */ + totalSize?: (number|null); + } + + /** Represents a ListFindingsResponse. */ + class ListFindingsResponse implements IListFindingsResponse { + + /** + * Constructs a new ListFindingsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1beta1.IListFindingsResponse); + + /** ListFindingsResponse findings. */ + public findings: google.cloud.securitycenter.v1beta1.IFinding[]; + + /** ListFindingsResponse readTime. */ + public readTime?: (google.protobuf.ITimestamp|null); + + /** ListFindingsResponse nextPageToken. */ + public nextPageToken: string; + + /** ListFindingsResponse totalSize. */ + public totalSize: number; + + /** + * Creates a new ListFindingsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListFindingsResponse instance + */ + public static create(properties?: google.cloud.securitycenter.v1beta1.IListFindingsResponse): google.cloud.securitycenter.v1beta1.ListFindingsResponse; + + /** + * Encodes the specified ListFindingsResponse message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.ListFindingsResponse.verify|verify} messages. + * @param message ListFindingsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1beta1.IListFindingsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListFindingsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.ListFindingsResponse.verify|verify} messages. + * @param message ListFindingsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1beta1.IListFindingsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListFindingsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListFindingsResponse + * @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.cloud.securitycenter.v1beta1.ListFindingsResponse; + + /** + * Decodes a ListFindingsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListFindingsResponse + * @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.cloud.securitycenter.v1beta1.ListFindingsResponse; + + /** + * Verifies a ListFindingsResponse 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 ListFindingsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListFindingsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1beta1.ListFindingsResponse; + + /** + * Creates a plain object from a ListFindingsResponse message. Also converts values to other types if specified. + * @param message ListFindingsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1beta1.ListFindingsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListFindingsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a SetFindingStateRequest. */ + interface ISetFindingStateRequest { + + /** SetFindingStateRequest name */ + name?: (string|null); + + /** SetFindingStateRequest state */ + state?: (google.cloud.securitycenter.v1beta1.Finding.State|null); + + /** SetFindingStateRequest startTime */ + startTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a SetFindingStateRequest. */ + class SetFindingStateRequest implements ISetFindingStateRequest { + + /** + * Constructs a new SetFindingStateRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1beta1.ISetFindingStateRequest); + + /** SetFindingStateRequest name. */ + public name: string; + + /** SetFindingStateRequest state. */ + public state: google.cloud.securitycenter.v1beta1.Finding.State; + + /** SetFindingStateRequest startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new SetFindingStateRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns SetFindingStateRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v1beta1.ISetFindingStateRequest): google.cloud.securitycenter.v1beta1.SetFindingStateRequest; + + /** + * Encodes the specified SetFindingStateRequest message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.SetFindingStateRequest.verify|verify} messages. + * @param message SetFindingStateRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1beta1.ISetFindingStateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SetFindingStateRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.SetFindingStateRequest.verify|verify} messages. + * @param message SetFindingStateRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1beta1.ISetFindingStateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SetFindingStateRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SetFindingStateRequest + * @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.cloud.securitycenter.v1beta1.SetFindingStateRequest; + + /** + * Decodes a SetFindingStateRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SetFindingStateRequest + * @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.cloud.securitycenter.v1beta1.SetFindingStateRequest; + + /** + * Verifies a SetFindingStateRequest 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 SetFindingStateRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SetFindingStateRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1beta1.SetFindingStateRequest; + + /** + * Creates a plain object from a SetFindingStateRequest message. Also converts values to other types if specified. + * @param message SetFindingStateRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1beta1.SetFindingStateRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SetFindingStateRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a RunAssetDiscoveryRequest. */ + interface IRunAssetDiscoveryRequest { + + /** RunAssetDiscoveryRequest parent */ + parent?: (string|null); + } + + /** Represents a RunAssetDiscoveryRequest. */ + class RunAssetDiscoveryRequest implements IRunAssetDiscoveryRequest { + + /** + * Constructs a new RunAssetDiscoveryRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1beta1.IRunAssetDiscoveryRequest); + + /** RunAssetDiscoveryRequest parent. */ + public parent: string; + + /** + * Creates a new RunAssetDiscoveryRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns RunAssetDiscoveryRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v1beta1.IRunAssetDiscoveryRequest): google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest; + + /** + * Encodes the specified RunAssetDiscoveryRequest message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest.verify|verify} messages. + * @param message RunAssetDiscoveryRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1beta1.IRunAssetDiscoveryRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RunAssetDiscoveryRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest.verify|verify} messages. + * @param message RunAssetDiscoveryRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1beta1.IRunAssetDiscoveryRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RunAssetDiscoveryRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RunAssetDiscoveryRequest + * @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.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest; + + /** + * Decodes a RunAssetDiscoveryRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RunAssetDiscoveryRequest + * @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.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest; + + /** + * Verifies a RunAssetDiscoveryRequest 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 RunAssetDiscoveryRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RunAssetDiscoveryRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest; + + /** + * Creates a plain object from a RunAssetDiscoveryRequest message. Also converts values to other types if specified. + * @param message RunAssetDiscoveryRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RunAssetDiscoveryRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an UpdateFindingRequest. */ + interface IUpdateFindingRequest { + + /** UpdateFindingRequest finding */ + finding?: (google.cloud.securitycenter.v1beta1.IFinding|null); + + /** UpdateFindingRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateFindingRequest. */ + class UpdateFindingRequest implements IUpdateFindingRequest { + + /** + * Constructs a new UpdateFindingRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1beta1.IUpdateFindingRequest); + + /** UpdateFindingRequest finding. */ + public finding?: (google.cloud.securitycenter.v1beta1.IFinding|null); + + /** UpdateFindingRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateFindingRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateFindingRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v1beta1.IUpdateFindingRequest): google.cloud.securitycenter.v1beta1.UpdateFindingRequest; + + /** + * Encodes the specified UpdateFindingRequest message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.UpdateFindingRequest.verify|verify} messages. + * @param message UpdateFindingRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1beta1.IUpdateFindingRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateFindingRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.UpdateFindingRequest.verify|verify} messages. + * @param message UpdateFindingRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1beta1.IUpdateFindingRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateFindingRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateFindingRequest + * @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.cloud.securitycenter.v1beta1.UpdateFindingRequest; + + /** + * Decodes an UpdateFindingRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateFindingRequest + * @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.cloud.securitycenter.v1beta1.UpdateFindingRequest; + + /** + * Verifies an UpdateFindingRequest 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 UpdateFindingRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateFindingRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1beta1.UpdateFindingRequest; + + /** + * Creates a plain object from an UpdateFindingRequest message. Also converts values to other types if specified. + * @param message UpdateFindingRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1beta1.UpdateFindingRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateFindingRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an UpdateOrganizationSettingsRequest. */ + interface IUpdateOrganizationSettingsRequest { + + /** UpdateOrganizationSettingsRequest organizationSettings */ + organizationSettings?: (google.cloud.securitycenter.v1beta1.IOrganizationSettings|null); + + /** UpdateOrganizationSettingsRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateOrganizationSettingsRequest. */ + class UpdateOrganizationSettingsRequest implements IUpdateOrganizationSettingsRequest { + + /** + * Constructs a new UpdateOrganizationSettingsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1beta1.IUpdateOrganizationSettingsRequest); + + /** UpdateOrganizationSettingsRequest organizationSettings. */ + public organizationSettings?: (google.cloud.securitycenter.v1beta1.IOrganizationSettings|null); + + /** UpdateOrganizationSettingsRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateOrganizationSettingsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateOrganizationSettingsRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v1beta1.IUpdateOrganizationSettingsRequest): google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest; + + /** + * Encodes the specified UpdateOrganizationSettingsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest.verify|verify} messages. + * @param message UpdateOrganizationSettingsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1beta1.IUpdateOrganizationSettingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateOrganizationSettingsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest.verify|verify} messages. + * @param message UpdateOrganizationSettingsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1beta1.IUpdateOrganizationSettingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateOrganizationSettingsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateOrganizationSettingsRequest + * @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.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest; + + /** + * Decodes an UpdateOrganizationSettingsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateOrganizationSettingsRequest + * @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.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest; + + /** + * Verifies an UpdateOrganizationSettingsRequest 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 UpdateOrganizationSettingsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateOrganizationSettingsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest; + + /** + * Creates a plain object from an UpdateOrganizationSettingsRequest message. Also converts values to other types if specified. + * @param message UpdateOrganizationSettingsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateOrganizationSettingsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an UpdateSourceRequest. */ + interface IUpdateSourceRequest { + + /** UpdateSourceRequest source */ + source?: (google.cloud.securitycenter.v1beta1.ISource|null); + + /** UpdateSourceRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateSourceRequest. */ + class UpdateSourceRequest implements IUpdateSourceRequest { + + /** + * Constructs a new UpdateSourceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1beta1.IUpdateSourceRequest); + + /** UpdateSourceRequest source. */ + public source?: (google.cloud.securitycenter.v1beta1.ISource|null); + + /** UpdateSourceRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateSourceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateSourceRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v1beta1.IUpdateSourceRequest): google.cloud.securitycenter.v1beta1.UpdateSourceRequest; + + /** + * Encodes the specified UpdateSourceRequest message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.UpdateSourceRequest.verify|verify} messages. + * @param message UpdateSourceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1beta1.IUpdateSourceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateSourceRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.UpdateSourceRequest.verify|verify} messages. + * @param message UpdateSourceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1beta1.IUpdateSourceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateSourceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateSourceRequest + * @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.cloud.securitycenter.v1beta1.UpdateSourceRequest; + + /** + * Decodes an UpdateSourceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateSourceRequest + * @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.cloud.securitycenter.v1beta1.UpdateSourceRequest; + + /** + * Verifies an UpdateSourceRequest 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 UpdateSourceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateSourceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1beta1.UpdateSourceRequest; + + /** + * Creates a plain object from an UpdateSourceRequest message. Also converts values to other types if specified. + * @param message UpdateSourceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1beta1.UpdateSourceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateSourceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an UpdateSecurityMarksRequest. */ + interface IUpdateSecurityMarksRequest { + + /** UpdateSecurityMarksRequest securityMarks */ + securityMarks?: (google.cloud.securitycenter.v1beta1.ISecurityMarks|null); + + /** UpdateSecurityMarksRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateSecurityMarksRequest startTime */ + startTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents an UpdateSecurityMarksRequest. */ + class UpdateSecurityMarksRequest implements IUpdateSecurityMarksRequest { + + /** + * Constructs a new UpdateSecurityMarksRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1beta1.IUpdateSecurityMarksRequest); + + /** UpdateSecurityMarksRequest securityMarks. */ + public securityMarks?: (google.cloud.securitycenter.v1beta1.ISecurityMarks|null); + + /** UpdateSecurityMarksRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateSecurityMarksRequest startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new UpdateSecurityMarksRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateSecurityMarksRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v1beta1.IUpdateSecurityMarksRequest): google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest; + + /** + * Encodes the specified UpdateSecurityMarksRequest message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest.verify|verify} messages. + * @param message UpdateSecurityMarksRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1beta1.IUpdateSecurityMarksRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateSecurityMarksRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest.verify|verify} messages. + * @param message UpdateSecurityMarksRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1beta1.IUpdateSecurityMarksRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateSecurityMarksRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateSecurityMarksRequest + * @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.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest; + + /** + * Decodes an UpdateSecurityMarksRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateSecurityMarksRequest + * @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.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest; + + /** + * Verifies an UpdateSecurityMarksRequest 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 UpdateSecurityMarksRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateSecurityMarksRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest; + + /** + * Creates a plain object from an UpdateSecurityMarksRequest message. Also converts values to other types if specified. + * @param message UpdateSecurityMarksRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateSecurityMarksRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an Asset. */ + interface IAsset { + + /** Asset name */ + name?: (string|null); + + /** Asset securityCenterProperties */ + securityCenterProperties?: (google.cloud.securitycenter.v1beta1.Asset.ISecurityCenterProperties|null); + + /** Asset resourceProperties */ + resourceProperties?: ({ [k: string]: google.protobuf.IValue }|null); + + /** Asset securityMarks */ + securityMarks?: (google.cloud.securitycenter.v1beta1.ISecurityMarks|null); + + /** Asset createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Asset updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents an Asset. */ + class Asset implements IAsset { + + /** + * Constructs a new Asset. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1beta1.IAsset); + + /** Asset name. */ + public name: string; + + /** Asset securityCenterProperties. */ + public securityCenterProperties?: (google.cloud.securitycenter.v1beta1.Asset.ISecurityCenterProperties|null); + + /** Asset resourceProperties. */ + public resourceProperties: { [k: string]: google.protobuf.IValue }; + + /** Asset securityMarks. */ + public securityMarks?: (google.cloud.securitycenter.v1beta1.ISecurityMarks|null); + + /** Asset createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Asset updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new Asset instance using the specified properties. + * @param [properties] Properties to set + * @returns Asset instance + */ + public static create(properties?: google.cloud.securitycenter.v1beta1.IAsset): google.cloud.securitycenter.v1beta1.Asset; + + /** + * Encodes the specified Asset message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.Asset.verify|verify} messages. + * @param message Asset message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1beta1.IAsset, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Asset message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.Asset.verify|verify} messages. + * @param message Asset message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1beta1.IAsset, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Asset message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Asset + * @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.cloud.securitycenter.v1beta1.Asset; + + /** + * Decodes an Asset message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Asset + * @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.cloud.securitycenter.v1beta1.Asset; + + /** + * Verifies an Asset 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 Asset message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Asset + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1beta1.Asset; + + /** + * Creates a plain object from an Asset message. Also converts values to other types if specified. + * @param message Asset + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1beta1.Asset, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Asset to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace Asset { + + /** Properties of a SecurityCenterProperties. */ + interface ISecurityCenterProperties { + + /** SecurityCenterProperties resourceName */ + resourceName?: (string|null); + + /** SecurityCenterProperties resourceType */ + resourceType?: (string|null); + + /** SecurityCenterProperties resourceParent */ + resourceParent?: (string|null); + + /** SecurityCenterProperties resourceProject */ + resourceProject?: (string|null); + + /** SecurityCenterProperties resourceOwners */ + resourceOwners?: (string[]|null); + } + + /** Represents a SecurityCenterProperties. */ + class SecurityCenterProperties implements ISecurityCenterProperties { + + /** + * Constructs a new SecurityCenterProperties. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1beta1.Asset.ISecurityCenterProperties); + + /** SecurityCenterProperties resourceName. */ + public resourceName: string; + + /** SecurityCenterProperties resourceType. */ + public resourceType: string; + + /** SecurityCenterProperties resourceParent. */ + public resourceParent: string; + + /** SecurityCenterProperties resourceProject. */ + public resourceProject: string; + + /** SecurityCenterProperties resourceOwners. */ + public resourceOwners: string[]; + + /** + * Creates a new SecurityCenterProperties instance using the specified properties. + * @param [properties] Properties to set + * @returns SecurityCenterProperties instance + */ + public static create(properties?: google.cloud.securitycenter.v1beta1.Asset.ISecurityCenterProperties): google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties; + + /** + * Encodes the specified SecurityCenterProperties message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties.verify|verify} messages. + * @param message SecurityCenterProperties message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1beta1.Asset.ISecurityCenterProperties, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SecurityCenterProperties message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties.verify|verify} messages. + * @param message SecurityCenterProperties message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1beta1.Asset.ISecurityCenterProperties, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SecurityCenterProperties message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SecurityCenterProperties + * @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.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties; + + /** + * Decodes a SecurityCenterProperties message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SecurityCenterProperties + * @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.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties; + + /** + * Verifies a SecurityCenterProperties 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 SecurityCenterProperties message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SecurityCenterProperties + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties; + + /** + * Creates a plain object from a SecurityCenterProperties message. Also converts values to other types if specified. + * @param message SecurityCenterProperties + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SecurityCenterProperties to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** Properties of a SecurityMarks. */ + interface ISecurityMarks { + + /** SecurityMarks name */ + name?: (string|null); + + /** SecurityMarks marks */ + marks?: ({ [k: string]: string }|null); + } + + /** Represents a SecurityMarks. */ + class SecurityMarks implements ISecurityMarks { + + /** + * Constructs a new SecurityMarks. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1beta1.ISecurityMarks); + + /** SecurityMarks name. */ + public name: string; + + /** SecurityMarks marks. */ + public marks: { [k: string]: string }; + + /** + * Creates a new SecurityMarks instance using the specified properties. + * @param [properties] Properties to set + * @returns SecurityMarks instance + */ + public static create(properties?: google.cloud.securitycenter.v1beta1.ISecurityMarks): google.cloud.securitycenter.v1beta1.SecurityMarks; + + /** + * Encodes the specified SecurityMarks message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.SecurityMarks.verify|verify} messages. + * @param message SecurityMarks message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1beta1.ISecurityMarks, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SecurityMarks message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.SecurityMarks.verify|verify} messages. + * @param message SecurityMarks message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1beta1.ISecurityMarks, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SecurityMarks message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SecurityMarks + * @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.cloud.securitycenter.v1beta1.SecurityMarks; + + /** + * Decodes a SecurityMarks message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SecurityMarks + * @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.cloud.securitycenter.v1beta1.SecurityMarks; + + /** + * Verifies a SecurityMarks 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 SecurityMarks message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SecurityMarks + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1beta1.SecurityMarks; + + /** + * Creates a plain object from a SecurityMarks message. Also converts values to other types if specified. + * @param message SecurityMarks + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1beta1.SecurityMarks, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SecurityMarks to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a Finding. */ + interface IFinding { + + /** Finding name */ + name?: (string|null); + + /** Finding parent */ + parent?: (string|null); + + /** Finding resourceName */ + resourceName?: (string|null); + + /** Finding state */ + state?: (google.cloud.securitycenter.v1beta1.Finding.State|null); + + /** Finding category */ + category?: (string|null); + + /** Finding externalUri */ + externalUri?: (string|null); + + /** Finding sourceProperties */ + sourceProperties?: ({ [k: string]: google.protobuf.IValue }|null); + + /** Finding securityMarks */ + securityMarks?: (google.cloud.securitycenter.v1beta1.ISecurityMarks|null); + + /** Finding eventTime */ + eventTime?: (google.protobuf.ITimestamp|null); + + /** Finding createTime */ + createTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a Finding. */ + class Finding implements IFinding { + + /** + * Constructs a new Finding. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1beta1.IFinding); + + /** Finding name. */ + public name: string; + + /** Finding parent. */ + public parent: string; + + /** Finding resourceName. */ + public resourceName: string; + + /** Finding state. */ + public state: google.cloud.securitycenter.v1beta1.Finding.State; + + /** Finding category. */ + public category: string; + + /** Finding externalUri. */ + public externalUri: string; + + /** Finding sourceProperties. */ + public sourceProperties: { [k: string]: google.protobuf.IValue }; + + /** Finding securityMarks. */ + public securityMarks?: (google.cloud.securitycenter.v1beta1.ISecurityMarks|null); + + /** Finding eventTime. */ + public eventTime?: (google.protobuf.ITimestamp|null); + + /** Finding createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new Finding instance using the specified properties. + * @param [properties] Properties to set + * @returns Finding instance + */ + public static create(properties?: google.cloud.securitycenter.v1beta1.IFinding): google.cloud.securitycenter.v1beta1.Finding; + + /** + * Encodes the specified Finding message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.Finding.verify|verify} messages. + * @param message Finding message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1beta1.IFinding, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Finding message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.Finding.verify|verify} messages. + * @param message Finding message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1beta1.IFinding, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Finding message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Finding + * @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.cloud.securitycenter.v1beta1.Finding; + + /** + * Decodes a Finding message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Finding + * @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.cloud.securitycenter.v1beta1.Finding; + + /** + * Verifies a Finding 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 Finding message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Finding + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1beta1.Finding; + + /** + * Creates a plain object from a Finding message. Also converts values to other types if specified. + * @param message Finding + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1beta1.Finding, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Finding to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace Finding { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + ACTIVE = 1, + INACTIVE = 2 + } + } + + /** Properties of an OrganizationSettings. */ + interface IOrganizationSettings { + + /** OrganizationSettings name */ + name?: (string|null); + + /** OrganizationSettings enableAssetDiscovery */ + enableAssetDiscovery?: (boolean|null); + + /** OrganizationSettings assetDiscoveryConfig */ + assetDiscoveryConfig?: (google.cloud.securitycenter.v1beta1.OrganizationSettings.IAssetDiscoveryConfig|null); + } + + /** Represents an OrganizationSettings. */ + class OrganizationSettings implements IOrganizationSettings { + + /** + * Constructs a new OrganizationSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1beta1.IOrganizationSettings); + + /** OrganizationSettings name. */ + public name: string; + + /** OrganizationSettings enableAssetDiscovery. */ + public enableAssetDiscovery: boolean; + + /** OrganizationSettings assetDiscoveryConfig. */ + public assetDiscoveryConfig?: (google.cloud.securitycenter.v1beta1.OrganizationSettings.IAssetDiscoveryConfig|null); + + /** + * Creates a new OrganizationSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns OrganizationSettings instance + */ + public static create(properties?: google.cloud.securitycenter.v1beta1.IOrganizationSettings): google.cloud.securitycenter.v1beta1.OrganizationSettings; + + /** + * Encodes the specified OrganizationSettings message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.OrganizationSettings.verify|verify} messages. + * @param message OrganizationSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1beta1.IOrganizationSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OrganizationSettings message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.OrganizationSettings.verify|verify} messages. + * @param message OrganizationSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1beta1.IOrganizationSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OrganizationSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OrganizationSettings + * @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.cloud.securitycenter.v1beta1.OrganizationSettings; + + /** + * Decodes an OrganizationSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OrganizationSettings + * @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.cloud.securitycenter.v1beta1.OrganizationSettings; + + /** + * Verifies an OrganizationSettings 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 OrganizationSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OrganizationSettings + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1beta1.OrganizationSettings; + + /** + * Creates a plain object from an OrganizationSettings message. Also converts values to other types if specified. + * @param message OrganizationSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1beta1.OrganizationSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OrganizationSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace OrganizationSettings { + + /** Properties of an AssetDiscoveryConfig. */ + interface IAssetDiscoveryConfig { + + /** AssetDiscoveryConfig projectIds */ + projectIds?: (string[]|null); + + /** AssetDiscoveryConfig inclusionMode */ + inclusionMode?: (google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode|null); + } + + /** Represents an AssetDiscoveryConfig. */ + class AssetDiscoveryConfig implements IAssetDiscoveryConfig { + + /** + * Constructs a new AssetDiscoveryConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1beta1.OrganizationSettings.IAssetDiscoveryConfig); + + /** AssetDiscoveryConfig projectIds. */ + public projectIds: string[]; + + /** AssetDiscoveryConfig inclusionMode. */ + public inclusionMode: google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode; + + /** + * Creates a new AssetDiscoveryConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns AssetDiscoveryConfig instance + */ + public static create(properties?: google.cloud.securitycenter.v1beta1.OrganizationSettings.IAssetDiscoveryConfig): google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig; + + /** + * Encodes the specified AssetDiscoveryConfig message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig.verify|verify} messages. + * @param message AssetDiscoveryConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1beta1.OrganizationSettings.IAssetDiscoveryConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AssetDiscoveryConfig message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig.verify|verify} messages. + * @param message AssetDiscoveryConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1beta1.OrganizationSettings.IAssetDiscoveryConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AssetDiscoveryConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AssetDiscoveryConfig + * @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.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig; + + /** + * Decodes an AssetDiscoveryConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AssetDiscoveryConfig + * @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.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig; + + /** + * Verifies an AssetDiscoveryConfig 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 AssetDiscoveryConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AssetDiscoveryConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig; + + /** + * Creates a plain object from an AssetDiscoveryConfig message. Also converts values to other types if specified. + * @param message AssetDiscoveryConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AssetDiscoveryConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace AssetDiscoveryConfig { + + /** InclusionMode enum. */ + enum InclusionMode { + INCLUSION_MODE_UNSPECIFIED = 0, + INCLUDE_ONLY = 1, + EXCLUDE = 2 + } + } + } + + /** Properties of a Source. */ + interface ISource { + + /** Source name */ + name?: (string|null); + + /** Source displayName */ + displayName?: (string|null); + + /** Source description */ + description?: (string|null); + } + + /** Represents a Source. */ + class Source implements ISource { + + /** + * Constructs a new Source. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1beta1.ISource); + + /** Source name. */ + public name: string; + + /** Source displayName. */ + public displayName: string; + + /** Source description. */ + public description: string; + + /** + * Creates a new Source instance using the specified properties. + * @param [properties] Properties to set + * @returns Source instance + */ + public static create(properties?: google.cloud.securitycenter.v1beta1.ISource): google.cloud.securitycenter.v1beta1.Source; + + /** + * Encodes the specified Source message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.Source.verify|verify} messages. + * @param message Source message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1beta1.ISource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Source message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.Source.verify|verify} messages. + * @param message Source message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1beta1.ISource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Source message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Source + * @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.cloud.securitycenter.v1beta1.Source; + + /** + * Decodes a Source message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Source + * @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.cloud.securitycenter.v1beta1.Source; + + /** + * Verifies a Source 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 Source message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Source + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1beta1.Source; + + /** + * Creates a plain object from a Source message. Also converts values to other types if specified. + * @param message Source + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1beta1.Source, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Source to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + } + } + + /** 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 }; + } + + /** 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; + + /** HttpRule put. */ + public put: string; + + /** HttpRule post. */ + public post: string; + + /** HttpRule delete. */ + public delete: string; + + /** HttpRule patch. */ + public patch: string; + + /** 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 }; + } + + /** 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 }; + } + } + + /** Namespace protobuf. */ + namespace protobuf { + + /** 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 }; + } + + /** 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); + } + + /** 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; + + /** + * 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 }; + } + + /** 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 }; + } + + 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 }; + } + + /** 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 }; + } + } + + /** 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 }; + } + + /** Properties of a FieldDescriptorProto. */ + interface IFieldDescriptorProto { + + /** FieldDescriptorProto name */ + name?: (string|null); + + /** FieldDescriptorProto number */ + number?: (number|null); + + /** FieldDescriptorProto label */ + label?: (google.protobuf.FieldDescriptorProto.Label|null); + + /** FieldDescriptorProto type */ + type?: (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); + } + + /** 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; + + /** FieldDescriptorProto type. */ + public type: 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); + + /** + * 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 }; + } + + 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 }; + } + + /** 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 }; + } + + 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 }; + } + } + + /** 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 }; + } + + /** 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 }; + } + + /** 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 }; + } + + /** 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|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); + } + + /** 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; + + /** 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 }; + } + + 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); + } + + /** 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 }; + } + + /** Properties of a FieldOptions. */ + interface IFieldOptions { + + /** FieldOptions ctype */ + ctype?: (google.protobuf.FieldOptions.CType|null); + + /** FieldOptions packed */ + packed?: (boolean|null); + + /** FieldOptions jstype */ + jstype?: (google.protobuf.FieldOptions.JSType|null); + + /** FieldOptions lazy */ + lazy?: (boolean|null); + + /** FieldOptions deprecated */ + deprecated?: (boolean|null); + + /** FieldOptions weak */ + weak?: (boolean|null); + + /** FieldOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|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; + + /** FieldOptions packed. */ + public packed: boolean; + + /** FieldOptions jstype. */ + public jstype: google.protobuf.FieldOptions.JSType; + + /** FieldOptions lazy. */ + public lazy: 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 }; + } + + 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 }; + } + + /** 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 }; + } + + /** 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 }; + } + + /** 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 }; + } + + /** Properties of a MethodOptions. */ + interface IMethodOptions { + + /** MethodOptions deprecated */ + deprecated?: (boolean|null); + + /** MethodOptions idempotencyLevel */ + idempotencyLevel?: (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); + + /** MethodOptions .google.longrunning.operationInfo */ + ".google.longrunning.operationInfo"?: (google.longrunning.IOperationInfo|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; + + /** 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 }; + } + + 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|null); + + /** UninterpretedOption negativeIntValue */ + negativeIntValue?: (number|Long|null); + + /** UninterpretedOption doubleValue */ + doubleValue?: (number|null); + + /** UninterpretedOption stringValue */ + stringValue?: (Uint8Array|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); + + /** UninterpretedOption negativeIntValue. */ + public negativeIntValue: (number|Long); + + /** UninterpretedOption doubleValue. */ + public doubleValue: number; + + /** UninterpretedOption stringValue. */ + public stringValue: Uint8Array; + + /** 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 }; + } + + 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 }; + } + } + + /** 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 }; + } + + 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 }; + } + } + + /** 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 }; + } + + 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); + } + + /** 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; + + /** + * 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 }; + } + } + + /** Properties of a Struct. */ + interface IStruct { + + /** Struct fields */ + fields?: ({ [k: string]: google.protobuf.IValue }|null); + } + + /** Represents a Struct. */ + class Struct implements IStruct { + + /** + * Constructs a new Struct. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IStruct); + + /** Struct fields. */ + public fields: { [k: string]: google.protobuf.IValue }; + + /** + * Creates a new Struct instance using the specified properties. + * @param [properties] Properties to set + * @returns Struct instance + */ + public static create(properties?: google.protobuf.IStruct): google.protobuf.Struct; + + /** + * Encodes the specified Struct message. Does not implicitly {@link google.protobuf.Struct.verify|verify} messages. + * @param message Struct message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IStruct, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Struct message, length delimited. Does not implicitly {@link google.protobuf.Struct.verify|verify} messages. + * @param message Struct message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IStruct, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Struct message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Struct + * @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.Struct; + + /** + * Decodes a Struct message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Struct + * @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.Struct; + + /** + * Verifies a Struct 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 Struct message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Struct + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Struct; + + /** + * Creates a plain object from a Struct message. Also converts values to other types if specified. + * @param message Struct + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Struct, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Struct to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a Value. */ + interface IValue { + + /** Value nullValue */ + nullValue?: (google.protobuf.NullValue|null); + + /** Value numberValue */ + numberValue?: (number|null); + + /** Value stringValue */ + stringValue?: (string|null); + + /** Value boolValue */ + boolValue?: (boolean|null); + + /** Value structValue */ + structValue?: (google.protobuf.IStruct|null); + + /** Value listValue */ + listValue?: (google.protobuf.IListValue|null); + } + + /** Represents a Value. */ + class Value implements IValue { + + /** + * Constructs a new Value. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IValue); + + /** Value nullValue. */ + public nullValue: google.protobuf.NullValue; + + /** Value numberValue. */ + public numberValue: number; + + /** Value stringValue. */ + public stringValue: string; + + /** Value boolValue. */ + public boolValue: boolean; + + /** Value structValue. */ + public structValue?: (google.protobuf.IStruct|null); + + /** Value listValue. */ + public listValue?: (google.protobuf.IListValue|null); + + /** Value kind. */ + public kind?: ("nullValue"|"numberValue"|"stringValue"|"boolValue"|"structValue"|"listValue"); + + /** + * Creates a new Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Value instance + */ + public static create(properties?: google.protobuf.IValue): google.protobuf.Value; + + /** + * Encodes the specified Value message. Does not implicitly {@link google.protobuf.Value.verify|verify} messages. + * @param message Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Value message, length delimited. Does not implicitly {@link google.protobuf.Value.verify|verify} messages. + * @param message Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Value message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Value + * @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.Value; + + /** + * Decodes a Value message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Value + * @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.Value; + + /** + * Verifies a Value 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 Value message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Value + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Value; + + /** + * Creates a plain object from a Value message. Also converts values to other types if specified. + * @param message Value + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Value to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** NullValue enum. */ + enum NullValue { + NULL_VALUE = 0 + } + + /** Properties of a ListValue. */ + interface IListValue { + + /** ListValue values */ + values?: (google.protobuf.IValue[]|null); + } + + /** Represents a ListValue. */ + class ListValue implements IListValue { + + /** + * Constructs a new ListValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IListValue); + + /** ListValue values. */ + public values: google.protobuf.IValue[]; + + /** + * Creates a new ListValue instance using the specified properties. + * @param [properties] Properties to set + * @returns ListValue instance + */ + public static create(properties?: google.protobuf.IListValue): google.protobuf.ListValue; + + /** + * Encodes the specified ListValue message. Does not implicitly {@link google.protobuf.ListValue.verify|verify} messages. + * @param message ListValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IListValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListValue message, length delimited. Does not implicitly {@link google.protobuf.ListValue.verify|verify} messages. + * @param message ListValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IListValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListValue + * @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.ListValue; + + /** + * Decodes a ListValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListValue + * @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.ListValue; + + /** + * Verifies a ListValue 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 ListValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListValue + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ListValue; + + /** + * Creates a plain object from a ListValue message. Also converts values to other types if specified. + * @param message ListValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ListValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a Timestamp. */ + interface ITimestamp { + + /** Timestamp seconds */ + seconds?: (number|Long|null); + + /** Timestamp nanos */ + nanos?: (number|null); + } + + /** Represents a Timestamp. */ + class Timestamp implements ITimestamp { + + /** + * Constructs a new Timestamp. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.ITimestamp); + + /** Timestamp seconds. */ + public seconds: (number|Long); + + /** Timestamp nanos. */ + public nanos: number; + + /** + * Creates a new Timestamp instance using the specified properties. + * @param [properties] Properties to set + * @returns Timestamp instance + */ + public static create(properties?: google.protobuf.ITimestamp): google.protobuf.Timestamp; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @param message Timestamp message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @param message Timestamp message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Timestamp + * @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.Timestamp; + + /** + * Decodes a Timestamp message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Timestamp + * @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.Timestamp; + + /** + * Verifies a Timestamp 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 Timestamp message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Timestamp + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Timestamp; + + /** + * Creates a plain object from a Timestamp message. Also converts values to other types if specified. + * @param message Timestamp + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Timestamp, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Timestamp to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a Duration. */ + interface IDuration { + + /** Duration seconds */ + seconds?: (number|Long|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); + + /** 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 }; + } + + /** Properties of an Any. */ + interface IAny { + + /** Any type_url */ + type_url?: (string|null); + + /** Any value */ + value?: (Uint8Array|null); + } + + /** Represents an Any. */ + class Any implements IAny { + + /** + * Constructs a new Any. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IAny); + + /** Any type_url. */ + public type_url: string; + + /** Any value. */ + public value: Uint8Array; + + /** + * Creates a new Any instance using the specified properties. + * @param [properties] Properties to set + * @returns Any instance + */ + public static create(properties?: google.protobuf.IAny): google.protobuf.Any; + + /** + * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @param message Any message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IAny, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @param message Any message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IAny, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Any message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Any + * @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.Any; + + /** + * Decodes an Any message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Any + * @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.Any; + + /** + * Verifies an Any 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 Any message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Any + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Any; + + /** + * Creates a plain object from an Any message. Also converts values to other types if specified. + * @param message Any + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Any, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Any to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an Empty. */ + interface IEmpty { + } + + /** Represents an Empty. */ + class Empty implements IEmpty { + + /** + * Constructs a new Empty. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEmpty); + + /** + * Creates a new Empty instance using the specified properties. + * @param [properties] Properties to set + * @returns Empty instance + */ + public static create(properties?: google.protobuf.IEmpty): google.protobuf.Empty; + + /** + * Encodes the specified Empty message. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @param message Empty message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEmpty, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Empty message, length delimited. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @param message Empty message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEmpty, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Empty message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Empty + * @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.Empty; + + /** + * Decodes an Empty message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Empty + * @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.Empty; + + /** + * Verifies an Empty 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 Empty message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Empty + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Empty; + + /** + * Creates a plain object from an Empty message. Also converts values to other types if specified. + * @param message Empty + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Empty, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Empty to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a FieldMask. */ + interface IFieldMask { + + /** FieldMask paths */ + paths?: (string[]|null); + } + + /** Represents a FieldMask. */ + class FieldMask implements IFieldMask { + + /** + * Constructs a new FieldMask. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFieldMask); + + /** FieldMask paths. */ + public paths: string[]; + + /** + * Creates a new FieldMask instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldMask instance + */ + public static create(properties?: google.protobuf.IFieldMask): google.protobuf.FieldMask; + + /** + * Encodes the specified FieldMask message. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @param message FieldMask message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFieldMask, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldMask message, length delimited. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @param message FieldMask message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFieldMask, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldMask message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldMask + * @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.FieldMask; + + /** + * Decodes a FieldMask message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldMask + * @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.FieldMask; + + /** + * Verifies a FieldMask 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 FieldMask message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldMask + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldMask; + + /** + * Creates a plain object from a FieldMask message. Also converts values to other types if specified. + * @param message FieldMask + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldMask, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldMask to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** Namespace iam. */ + namespace iam { + + /** Namespace v1. */ + namespace v1 { + + /** Represents a IAMPolicy */ + class IAMPolicy extends $protobuf.rpc.Service { + + /** + * Constructs a new IAMPolicy 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 IAMPolicy 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): IAMPolicy; + + /** + * Calls SetIamPolicy. + * @param request SetIamPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Policy + */ + public setIamPolicy(request: google.iam.v1.ISetIamPolicyRequest, callback: google.iam.v1.IAMPolicy.SetIamPolicyCallback): void; + + /** + * Calls SetIamPolicy. + * @param request SetIamPolicyRequest message or plain object + * @returns Promise + */ + public setIamPolicy(request: google.iam.v1.ISetIamPolicyRequest): Promise; + + /** + * Calls GetIamPolicy. + * @param request GetIamPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Policy + */ + public getIamPolicy(request: google.iam.v1.IGetIamPolicyRequest, callback: google.iam.v1.IAMPolicy.GetIamPolicyCallback): void; + + /** + * Calls GetIamPolicy. + * @param request GetIamPolicyRequest message or plain object + * @returns Promise + */ + public getIamPolicy(request: google.iam.v1.IGetIamPolicyRequest): Promise; + + /** + * Calls TestIamPermissions. + * @param request TestIamPermissionsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and TestIamPermissionsResponse + */ + public testIamPermissions(request: google.iam.v1.ITestIamPermissionsRequest, callback: google.iam.v1.IAMPolicy.TestIamPermissionsCallback): void; + + /** + * Calls TestIamPermissions. + * @param request TestIamPermissionsRequest message or plain object + * @returns Promise + */ + public testIamPermissions(request: google.iam.v1.ITestIamPermissionsRequest): Promise; + } + + namespace IAMPolicy { + + /** + * Callback as used by {@link google.iam.v1.IAMPolicy#setIamPolicy}. + * @param error Error, if any + * @param [response] Policy + */ + type SetIamPolicyCallback = (error: (Error|null), response?: google.iam.v1.Policy) => void; + + /** + * Callback as used by {@link google.iam.v1.IAMPolicy#getIamPolicy}. + * @param error Error, if any + * @param [response] Policy + */ + type GetIamPolicyCallback = (error: (Error|null), response?: google.iam.v1.Policy) => void; + + /** + * Callback as used by {@link google.iam.v1.IAMPolicy#testIamPermissions}. + * @param error Error, if any + * @param [response] TestIamPermissionsResponse + */ + type TestIamPermissionsCallback = (error: (Error|null), response?: google.iam.v1.TestIamPermissionsResponse) => void; + } + + /** Properties of a SetIamPolicyRequest. */ + interface ISetIamPolicyRequest { + + /** SetIamPolicyRequest resource */ + resource?: (string|null); + + /** SetIamPolicyRequest policy */ + policy?: (google.iam.v1.IPolicy|null); + } + + /** Represents a SetIamPolicyRequest. */ + class SetIamPolicyRequest implements ISetIamPolicyRequest { + + /** + * Constructs a new SetIamPolicyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.ISetIamPolicyRequest); + + /** SetIamPolicyRequest resource. */ + public resource: string; + + /** SetIamPolicyRequest policy. */ + public policy?: (google.iam.v1.IPolicy|null); + + /** + * Creates a new SetIamPolicyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns SetIamPolicyRequest instance + */ + public static create(properties?: google.iam.v1.ISetIamPolicyRequest): google.iam.v1.SetIamPolicyRequest; + + /** + * Encodes the specified SetIamPolicyRequest message. Does not implicitly {@link google.iam.v1.SetIamPolicyRequest.verify|verify} messages. + * @param message SetIamPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.ISetIamPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SetIamPolicyRequest message, length delimited. Does not implicitly {@link google.iam.v1.SetIamPolicyRequest.verify|verify} messages. + * @param message SetIamPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.ISetIamPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SetIamPolicyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SetIamPolicyRequest + * @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.iam.v1.SetIamPolicyRequest; + + /** + * Decodes a SetIamPolicyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SetIamPolicyRequest + * @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.iam.v1.SetIamPolicyRequest; + + /** + * Verifies a SetIamPolicyRequest 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 SetIamPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SetIamPolicyRequest + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.SetIamPolicyRequest; + + /** + * Creates a plain object from a SetIamPolicyRequest message. Also converts values to other types if specified. + * @param message SetIamPolicyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.SetIamPolicyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SetIamPolicyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GetIamPolicyRequest. */ + interface IGetIamPolicyRequest { + + /** GetIamPolicyRequest resource */ + resource?: (string|null); + + /** GetIamPolicyRequest options */ + options?: (google.iam.v1.IGetPolicyOptions|null); + } + + /** Represents a GetIamPolicyRequest. */ + class GetIamPolicyRequest implements IGetIamPolicyRequest { + + /** + * Constructs a new GetIamPolicyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IGetIamPolicyRequest); + + /** GetIamPolicyRequest resource. */ + public resource: string; + + /** GetIamPolicyRequest options. */ + public options?: (google.iam.v1.IGetPolicyOptions|null); + + /** + * Creates a new GetIamPolicyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetIamPolicyRequest instance + */ + public static create(properties?: google.iam.v1.IGetIamPolicyRequest): google.iam.v1.GetIamPolicyRequest; + + /** + * Encodes the specified GetIamPolicyRequest message. Does not implicitly {@link google.iam.v1.GetIamPolicyRequest.verify|verify} messages. + * @param message GetIamPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IGetIamPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetIamPolicyRequest message, length delimited. Does not implicitly {@link google.iam.v1.GetIamPolicyRequest.verify|verify} messages. + * @param message GetIamPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IGetIamPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetIamPolicyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetIamPolicyRequest + * @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.iam.v1.GetIamPolicyRequest; + + /** + * Decodes a GetIamPolicyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetIamPolicyRequest + * @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.iam.v1.GetIamPolicyRequest; + + /** + * Verifies a GetIamPolicyRequest 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 GetIamPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetIamPolicyRequest + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.GetIamPolicyRequest; + + /** + * Creates a plain object from a GetIamPolicyRequest message. Also converts values to other types if specified. + * @param message GetIamPolicyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.GetIamPolicyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetIamPolicyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a TestIamPermissionsRequest. */ + interface ITestIamPermissionsRequest { + + /** TestIamPermissionsRequest resource */ + resource?: (string|null); + + /** TestIamPermissionsRequest permissions */ + permissions?: (string[]|null); + } + + /** Represents a TestIamPermissionsRequest. */ + class TestIamPermissionsRequest implements ITestIamPermissionsRequest { + + /** + * Constructs a new TestIamPermissionsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.ITestIamPermissionsRequest); + + /** TestIamPermissionsRequest resource. */ + public resource: string; + + /** TestIamPermissionsRequest permissions. */ + public permissions: string[]; + + /** + * Creates a new TestIamPermissionsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns TestIamPermissionsRequest instance + */ + public static create(properties?: google.iam.v1.ITestIamPermissionsRequest): google.iam.v1.TestIamPermissionsRequest; + + /** + * Encodes the specified TestIamPermissionsRequest message. Does not implicitly {@link google.iam.v1.TestIamPermissionsRequest.verify|verify} messages. + * @param message TestIamPermissionsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.ITestIamPermissionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TestIamPermissionsRequest message, length delimited. Does not implicitly {@link google.iam.v1.TestIamPermissionsRequest.verify|verify} messages. + * @param message TestIamPermissionsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.ITestIamPermissionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TestIamPermissionsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TestIamPermissionsRequest + * @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.iam.v1.TestIamPermissionsRequest; + + /** + * Decodes a TestIamPermissionsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TestIamPermissionsRequest + * @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.iam.v1.TestIamPermissionsRequest; + + /** + * Verifies a TestIamPermissionsRequest 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 TestIamPermissionsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TestIamPermissionsRequest + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.TestIamPermissionsRequest; + + /** + * Creates a plain object from a TestIamPermissionsRequest message. Also converts values to other types if specified. + * @param message TestIamPermissionsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.TestIamPermissionsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TestIamPermissionsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a TestIamPermissionsResponse. */ + interface ITestIamPermissionsResponse { + + /** TestIamPermissionsResponse permissions */ + permissions?: (string[]|null); + } + + /** Represents a TestIamPermissionsResponse. */ + class TestIamPermissionsResponse implements ITestIamPermissionsResponse { + + /** + * Constructs a new TestIamPermissionsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.ITestIamPermissionsResponse); + + /** TestIamPermissionsResponse permissions. */ + public permissions: string[]; + + /** + * Creates a new TestIamPermissionsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns TestIamPermissionsResponse instance + */ + public static create(properties?: google.iam.v1.ITestIamPermissionsResponse): google.iam.v1.TestIamPermissionsResponse; + + /** + * Encodes the specified TestIamPermissionsResponse message. Does not implicitly {@link google.iam.v1.TestIamPermissionsResponse.verify|verify} messages. + * @param message TestIamPermissionsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.ITestIamPermissionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TestIamPermissionsResponse message, length delimited. Does not implicitly {@link google.iam.v1.TestIamPermissionsResponse.verify|verify} messages. + * @param message TestIamPermissionsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.ITestIamPermissionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TestIamPermissionsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TestIamPermissionsResponse + * @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.iam.v1.TestIamPermissionsResponse; + + /** + * Decodes a TestIamPermissionsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TestIamPermissionsResponse + * @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.iam.v1.TestIamPermissionsResponse; + + /** + * Verifies a TestIamPermissionsResponse 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 TestIamPermissionsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TestIamPermissionsResponse + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.TestIamPermissionsResponse; + + /** + * Creates a plain object from a TestIamPermissionsResponse message. Also converts values to other types if specified. + * @param message TestIamPermissionsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.TestIamPermissionsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TestIamPermissionsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GetPolicyOptions. */ + interface IGetPolicyOptions { + + /** GetPolicyOptions requestedPolicyVersion */ + requestedPolicyVersion?: (number|null); + } + + /** Represents a GetPolicyOptions. */ + class GetPolicyOptions implements IGetPolicyOptions { + + /** + * Constructs a new GetPolicyOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IGetPolicyOptions); + + /** GetPolicyOptions requestedPolicyVersion. */ + public requestedPolicyVersion: number; + + /** + * Creates a new GetPolicyOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns GetPolicyOptions instance + */ + public static create(properties?: google.iam.v1.IGetPolicyOptions): google.iam.v1.GetPolicyOptions; + + /** + * Encodes the specified GetPolicyOptions message. Does not implicitly {@link google.iam.v1.GetPolicyOptions.verify|verify} messages. + * @param message GetPolicyOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IGetPolicyOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetPolicyOptions message, length delimited. Does not implicitly {@link google.iam.v1.GetPolicyOptions.verify|verify} messages. + * @param message GetPolicyOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IGetPolicyOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetPolicyOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetPolicyOptions + * @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.iam.v1.GetPolicyOptions; + + /** + * Decodes a GetPolicyOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetPolicyOptions + * @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.iam.v1.GetPolicyOptions; + + /** + * Verifies a GetPolicyOptions 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 GetPolicyOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetPolicyOptions + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.GetPolicyOptions; + + /** + * Creates a plain object from a GetPolicyOptions message. Also converts values to other types if specified. + * @param message GetPolicyOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.GetPolicyOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetPolicyOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a Policy. */ + interface IPolicy { + + /** Policy version */ + version?: (number|null); + + /** Policy bindings */ + bindings?: (google.iam.v1.IBinding[]|null); + + /** Policy etag */ + etag?: (Uint8Array|null); + } + + /** Represents a Policy. */ + class Policy implements IPolicy { + + /** + * Constructs a new Policy. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IPolicy); + + /** Policy version. */ + public version: number; + + /** Policy bindings. */ + public bindings: google.iam.v1.IBinding[]; + + /** Policy etag. */ + public etag: Uint8Array; + + /** + * Creates a new Policy instance using the specified properties. + * @param [properties] Properties to set + * @returns Policy instance + */ + public static create(properties?: google.iam.v1.IPolicy): google.iam.v1.Policy; + + /** + * Encodes the specified Policy message. Does not implicitly {@link google.iam.v1.Policy.verify|verify} messages. + * @param message Policy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Policy message, length delimited. Does not implicitly {@link google.iam.v1.Policy.verify|verify} messages. + * @param message Policy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Policy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Policy + * @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.iam.v1.Policy; + + /** + * Decodes a Policy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Policy + * @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.iam.v1.Policy; + + /** + * Verifies a Policy 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 Policy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Policy + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.Policy; + + /** + * Creates a plain object from a Policy message. Also converts values to other types if specified. + * @param message Policy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.Policy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Policy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a Binding. */ + interface IBinding { + + /** Binding role */ + role?: (string|null); + + /** Binding members */ + members?: (string[]|null); + + /** Binding condition */ + condition?: (google.type.IExpr|null); + } + + /** Represents a Binding. */ + class Binding implements IBinding { + + /** + * Constructs a new Binding. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IBinding); + + /** Binding role. */ + public role: string; + + /** Binding members. */ + public members: string[]; + + /** Binding condition. */ + public condition?: (google.type.IExpr|null); + + /** + * Creates a new Binding instance using the specified properties. + * @param [properties] Properties to set + * @returns Binding instance + */ + public static create(properties?: google.iam.v1.IBinding): google.iam.v1.Binding; + + /** + * Encodes the specified Binding message. Does not implicitly {@link google.iam.v1.Binding.verify|verify} messages. + * @param message Binding message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IBinding, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Binding message, length delimited. Does not implicitly {@link google.iam.v1.Binding.verify|verify} messages. + * @param message Binding message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IBinding, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Binding message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Binding + * @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.iam.v1.Binding; + + /** + * Decodes a Binding message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Binding + * @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.iam.v1.Binding; + + /** + * Verifies a Binding 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 Binding message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Binding + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.Binding; + + /** + * Creates a plain object from a Binding message. Also converts values to other types if specified. + * @param message Binding + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.Binding, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Binding to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a PolicyDelta. */ + interface IPolicyDelta { + + /** PolicyDelta bindingDeltas */ + bindingDeltas?: (google.iam.v1.IBindingDelta[]|null); + + /** PolicyDelta auditConfigDeltas */ + auditConfigDeltas?: (google.iam.v1.IAuditConfigDelta[]|null); + } + + /** Represents a PolicyDelta. */ + class PolicyDelta implements IPolicyDelta { + + /** + * Constructs a new PolicyDelta. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IPolicyDelta); + + /** PolicyDelta bindingDeltas. */ + public bindingDeltas: google.iam.v1.IBindingDelta[]; + + /** PolicyDelta auditConfigDeltas. */ + public auditConfigDeltas: google.iam.v1.IAuditConfigDelta[]; + + /** + * Creates a new PolicyDelta instance using the specified properties. + * @param [properties] Properties to set + * @returns PolicyDelta instance + */ + public static create(properties?: google.iam.v1.IPolicyDelta): google.iam.v1.PolicyDelta; + + /** + * Encodes the specified PolicyDelta message. Does not implicitly {@link google.iam.v1.PolicyDelta.verify|verify} messages. + * @param message PolicyDelta message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IPolicyDelta, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PolicyDelta message, length delimited. Does not implicitly {@link google.iam.v1.PolicyDelta.verify|verify} messages. + * @param message PolicyDelta message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IPolicyDelta, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PolicyDelta message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PolicyDelta + * @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.iam.v1.PolicyDelta; + + /** + * Decodes a PolicyDelta message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PolicyDelta + * @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.iam.v1.PolicyDelta; + + /** + * Verifies a PolicyDelta 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 PolicyDelta message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PolicyDelta + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.PolicyDelta; + + /** + * Creates a plain object from a PolicyDelta message. Also converts values to other types if specified. + * @param message PolicyDelta + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.PolicyDelta, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PolicyDelta to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a BindingDelta. */ + interface IBindingDelta { + + /** BindingDelta action */ + action?: (google.iam.v1.BindingDelta.Action|null); + + /** BindingDelta role */ + role?: (string|null); + + /** BindingDelta member */ + member?: (string|null); + + /** BindingDelta condition */ + condition?: (google.type.IExpr|null); + } + + /** Represents a BindingDelta. */ + class BindingDelta implements IBindingDelta { + + /** + * Constructs a new BindingDelta. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IBindingDelta); + + /** BindingDelta action. */ + public action: google.iam.v1.BindingDelta.Action; + + /** BindingDelta role. */ + public role: string; + + /** BindingDelta member. */ + public member: string; + + /** BindingDelta condition. */ + public condition?: (google.type.IExpr|null); + + /** + * Creates a new BindingDelta instance using the specified properties. + * @param [properties] Properties to set + * @returns BindingDelta instance + */ + public static create(properties?: google.iam.v1.IBindingDelta): google.iam.v1.BindingDelta; + + /** + * Encodes the specified BindingDelta message. Does not implicitly {@link google.iam.v1.BindingDelta.verify|verify} messages. + * @param message BindingDelta message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IBindingDelta, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BindingDelta message, length delimited. Does not implicitly {@link google.iam.v1.BindingDelta.verify|verify} messages. + * @param message BindingDelta message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IBindingDelta, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BindingDelta message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BindingDelta + * @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.iam.v1.BindingDelta; + + /** + * Decodes a BindingDelta message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BindingDelta + * @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.iam.v1.BindingDelta; + + /** + * Verifies a BindingDelta 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 BindingDelta message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BindingDelta + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.BindingDelta; + + /** + * Creates a plain object from a BindingDelta message. Also converts values to other types if specified. + * @param message BindingDelta + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.BindingDelta, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BindingDelta to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace BindingDelta { + + /** Action enum. */ + enum Action { + ACTION_UNSPECIFIED = 0, + ADD = 1, + REMOVE = 2 + } + } + + /** Properties of an AuditConfigDelta. */ + interface IAuditConfigDelta { + + /** AuditConfigDelta action */ + action?: (google.iam.v1.AuditConfigDelta.Action|null); + + /** AuditConfigDelta service */ + service?: (string|null); + + /** AuditConfigDelta exemptedMember */ + exemptedMember?: (string|null); + + /** AuditConfigDelta logType */ + logType?: (string|null); + } + + /** Represents an AuditConfigDelta. */ + class AuditConfigDelta implements IAuditConfigDelta { + + /** + * Constructs a new AuditConfigDelta. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IAuditConfigDelta); + + /** AuditConfigDelta action. */ + public action: google.iam.v1.AuditConfigDelta.Action; + + /** AuditConfigDelta service. */ + public service: string; + + /** AuditConfigDelta exemptedMember. */ + public exemptedMember: string; + + /** AuditConfigDelta logType. */ + public logType: string; + + /** + * Creates a new AuditConfigDelta instance using the specified properties. + * @param [properties] Properties to set + * @returns AuditConfigDelta instance + */ + public static create(properties?: google.iam.v1.IAuditConfigDelta): google.iam.v1.AuditConfigDelta; + + /** + * Encodes the specified AuditConfigDelta message. Does not implicitly {@link google.iam.v1.AuditConfigDelta.verify|verify} messages. + * @param message AuditConfigDelta message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IAuditConfigDelta, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AuditConfigDelta message, length delimited. Does not implicitly {@link google.iam.v1.AuditConfigDelta.verify|verify} messages. + * @param message AuditConfigDelta message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IAuditConfigDelta, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AuditConfigDelta message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AuditConfigDelta + * @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.iam.v1.AuditConfigDelta; + + /** + * Decodes an AuditConfigDelta message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AuditConfigDelta + * @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.iam.v1.AuditConfigDelta; + + /** + * Verifies an AuditConfigDelta 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 AuditConfigDelta message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AuditConfigDelta + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.AuditConfigDelta; + + /** + * Creates a plain object from an AuditConfigDelta message. Also converts values to other types if specified. + * @param message AuditConfigDelta + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.AuditConfigDelta, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AuditConfigDelta to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace AuditConfigDelta { + + /** Action enum. */ + enum Action { + ACTION_UNSPECIFIED = 0, + ADD = 1, + REMOVE = 2 + } + } + } + } + + /** Namespace type. */ + namespace type { + + /** Properties of an Expr. */ + interface IExpr { + + /** Expr expression */ + expression?: (string|null); + + /** Expr title */ + title?: (string|null); + + /** Expr description */ + description?: (string|null); + + /** Expr location */ + location?: (string|null); + } + + /** Represents an Expr. */ + class Expr implements IExpr { + + /** + * Constructs a new Expr. + * @param [properties] Properties to set + */ + constructor(properties?: google.type.IExpr); + + /** Expr expression. */ + public expression: string; + + /** Expr title. */ + public title: string; + + /** Expr description. */ + public description: string; + + /** Expr location. */ + public location: string; + + /** + * Creates a new Expr instance using the specified properties. + * @param [properties] Properties to set + * @returns Expr instance + */ + public static create(properties?: google.type.IExpr): google.type.Expr; + + /** + * Encodes the specified Expr message. Does not implicitly {@link google.type.Expr.verify|verify} messages. + * @param message Expr message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.type.IExpr, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Expr message, length delimited. Does not implicitly {@link google.type.Expr.verify|verify} messages. + * @param message Expr message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.type.IExpr, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Expr message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Expr + * @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.type.Expr; + + /** + * Decodes an Expr message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Expr + * @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.type.Expr; + + /** + * Verifies an Expr 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 Expr message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Expr + */ + public static fromObject(object: { [k: string]: any }): google.type.Expr; + + /** + * Creates a plain object from an Expr message. Also converts values to other types if specified. + * @param message Expr + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.type.Expr, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Expr to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** Namespace longrunning. */ + namespace longrunning { + + /** Represents an Operations */ + class Operations extends $protobuf.rpc.Service { + + /** + * Constructs a new Operations 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 Operations 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): Operations; + + /** + * Calls ListOperations. + * @param request ListOperationsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListOperationsResponse + */ + public listOperations(request: google.longrunning.IListOperationsRequest, callback: google.longrunning.Operations.ListOperationsCallback): void; + + /** + * Calls ListOperations. + * @param request ListOperationsRequest message or plain object + * @returns Promise + */ + public listOperations(request: google.longrunning.IListOperationsRequest): Promise; + + /** + * Calls GetOperation. + * @param request GetOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public getOperation(request: google.longrunning.IGetOperationRequest, callback: google.longrunning.Operations.GetOperationCallback): void; + + /** + * Calls GetOperation. + * @param request GetOperationRequest message or plain object + * @returns Promise + */ + public getOperation(request: google.longrunning.IGetOperationRequest): Promise; + + /** + * Calls DeleteOperation. + * @param request DeleteOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteOperation(request: google.longrunning.IDeleteOperationRequest, callback: google.longrunning.Operations.DeleteOperationCallback): void; + + /** + * Calls DeleteOperation. + * @param request DeleteOperationRequest message or plain object + * @returns Promise + */ + public deleteOperation(request: google.longrunning.IDeleteOperationRequest): Promise; + + /** + * Calls CancelOperation. + * @param request CancelOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public cancelOperation(request: google.longrunning.ICancelOperationRequest, callback: google.longrunning.Operations.CancelOperationCallback): void; + + /** + * Calls CancelOperation. + * @param request CancelOperationRequest message or plain object + * @returns Promise + */ + public cancelOperation(request: google.longrunning.ICancelOperationRequest): Promise; + + /** + * Calls WaitOperation. + * @param request WaitOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public waitOperation(request: google.longrunning.IWaitOperationRequest, callback: google.longrunning.Operations.WaitOperationCallback): void; + + /** + * Calls WaitOperation. + * @param request WaitOperationRequest message or plain object + * @returns Promise + */ + public waitOperation(request: google.longrunning.IWaitOperationRequest): Promise; + } + + namespace Operations { + + /** + * Callback as used by {@link google.longrunning.Operations#listOperations}. + * @param error Error, if any + * @param [response] ListOperationsResponse + */ + type ListOperationsCallback = (error: (Error|null), response?: google.longrunning.ListOperationsResponse) => void; + + /** + * Callback as used by {@link google.longrunning.Operations#getOperation}. + * @param error Error, if any + * @param [response] Operation + */ + type GetOperationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.longrunning.Operations#deleteOperation}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteOperationCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.longrunning.Operations#cancelOperation}. + * @param error Error, if any + * @param [response] Empty + */ + type CancelOperationCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.longrunning.Operations#waitOperation}. + * @param error Error, if any + * @param [response] Operation + */ + type WaitOperationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + } + + /** Properties of an Operation. */ + interface IOperation { + + /** Operation name */ + name?: (string|null); + + /** Operation metadata */ + metadata?: (google.protobuf.IAny|null); + + /** Operation done */ + done?: (boolean|null); + + /** Operation error */ + error?: (google.rpc.IStatus|null); + + /** Operation response */ + response?: (google.protobuf.IAny|null); + } + + /** Represents an Operation. */ + class Operation implements IOperation { + + /** + * Constructs a new Operation. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IOperation); + + /** Operation name. */ + public name: string; + + /** Operation metadata. */ + public metadata?: (google.protobuf.IAny|null); + + /** Operation done. */ + public done: boolean; + + /** Operation error. */ + public error?: (google.rpc.IStatus|null); + + /** Operation response. */ + public response?: (google.protobuf.IAny|null); + + /** Operation result. */ + public result?: ("error"|"response"); + + /** + * Creates a new Operation instance using the specified properties. + * @param [properties] Properties to set + * @returns Operation instance + */ + public static create(properties?: google.longrunning.IOperation): google.longrunning.Operation; + + /** + * Encodes the specified Operation message. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @param message Operation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IOperation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Operation message, length delimited. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @param message Operation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IOperation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Operation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Operation + * @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.longrunning.Operation; + + /** + * Decodes an Operation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Operation + * @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.longrunning.Operation; + + /** + * Verifies an Operation 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 Operation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Operation + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.Operation; + + /** + * Creates a plain object from an Operation message. Also converts values to other types if specified. + * @param message Operation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.Operation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Operation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GetOperationRequest. */ + interface IGetOperationRequest { + + /** GetOperationRequest name */ + name?: (string|null); + } + + /** Represents a GetOperationRequest. */ + class GetOperationRequest implements IGetOperationRequest { + + /** + * Constructs a new GetOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IGetOperationRequest); + + /** GetOperationRequest name. */ + public name: string; + + /** + * Creates a new GetOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetOperationRequest instance + */ + public static create(properties?: google.longrunning.IGetOperationRequest): google.longrunning.GetOperationRequest; + + /** + * Encodes the specified GetOperationRequest message. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @param message GetOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IGetOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @param message GetOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IGetOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetOperationRequest + * @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.longrunning.GetOperationRequest; + + /** + * Decodes a GetOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetOperationRequest + * @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.longrunning.GetOperationRequest; + + /** + * Verifies a GetOperationRequest 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 GetOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.GetOperationRequest; + + /** + * Creates a plain object from a GetOperationRequest message. Also converts values to other types if specified. + * @param message GetOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.GetOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListOperationsRequest. */ + interface IListOperationsRequest { + + /** ListOperationsRequest name */ + name?: (string|null); + + /** ListOperationsRequest filter */ + filter?: (string|null); + + /** ListOperationsRequest pageSize */ + pageSize?: (number|null); + + /** ListOperationsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListOperationsRequest. */ + class ListOperationsRequest implements IListOperationsRequest { + + /** + * Constructs a new ListOperationsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IListOperationsRequest); + + /** ListOperationsRequest name. */ + public name: string; + + /** ListOperationsRequest filter. */ + public filter: string; + + /** ListOperationsRequest pageSize. */ + public pageSize: number; + + /** ListOperationsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListOperationsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListOperationsRequest instance + */ + public static create(properties?: google.longrunning.IListOperationsRequest): google.longrunning.ListOperationsRequest; + + /** + * Encodes the specified ListOperationsRequest message. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @param message ListOperationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IListOperationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListOperationsRequest message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @param message ListOperationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IListOperationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListOperationsRequest + * @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.longrunning.ListOperationsRequest; + + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListOperationsRequest + * @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.longrunning.ListOperationsRequest; + + /** + * Verifies a ListOperationsRequest 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 ListOperationsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListOperationsRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.ListOperationsRequest; + + /** + * Creates a plain object from a ListOperationsRequest message. Also converts values to other types if specified. + * @param message ListOperationsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.ListOperationsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListOperationsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListOperationsResponse. */ + interface IListOperationsResponse { + + /** ListOperationsResponse operations */ + operations?: (google.longrunning.IOperation[]|null); + + /** ListOperationsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListOperationsResponse. */ + class ListOperationsResponse implements IListOperationsResponse { + + /** + * Constructs a new ListOperationsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IListOperationsResponse); + + /** ListOperationsResponse operations. */ + public operations: google.longrunning.IOperation[]; + + /** ListOperationsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListOperationsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListOperationsResponse instance + */ + public static create(properties?: google.longrunning.IListOperationsResponse): google.longrunning.ListOperationsResponse; + + /** + * Encodes the specified ListOperationsResponse message. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @param message ListOperationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IListOperationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListOperationsResponse message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @param message ListOperationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IListOperationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListOperationsResponse + * @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.longrunning.ListOperationsResponse; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListOperationsResponse + * @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.longrunning.ListOperationsResponse; + + /** + * Verifies a ListOperationsResponse 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 ListOperationsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListOperationsResponse + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.ListOperationsResponse; + + /** + * Creates a plain object from a ListOperationsResponse message. Also converts values to other types if specified. + * @param message ListOperationsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.ListOperationsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListOperationsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a CancelOperationRequest. */ + interface ICancelOperationRequest { + + /** CancelOperationRequest name */ + name?: (string|null); + } + + /** Represents a CancelOperationRequest. */ + class CancelOperationRequest implements ICancelOperationRequest { + + /** + * Constructs a new CancelOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.ICancelOperationRequest); + + /** CancelOperationRequest name. */ + public name: string; + + /** + * Creates a new CancelOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CancelOperationRequest instance + */ + public static create(properties?: google.longrunning.ICancelOperationRequest): google.longrunning.CancelOperationRequest; + + /** + * Encodes the specified CancelOperationRequest message. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @param message CancelOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.ICancelOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CancelOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @param message CancelOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.ICancelOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CancelOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CancelOperationRequest + * @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.longrunning.CancelOperationRequest; + + /** + * Decodes a CancelOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CancelOperationRequest + * @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.longrunning.CancelOperationRequest; + + /** + * Verifies a CancelOperationRequest 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 CancelOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CancelOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.CancelOperationRequest; + + /** + * Creates a plain object from a CancelOperationRequest message. Also converts values to other types if specified. + * @param message CancelOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.CancelOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CancelOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DeleteOperationRequest. */ + interface IDeleteOperationRequest { + + /** DeleteOperationRequest name */ + name?: (string|null); + } + + /** Represents a DeleteOperationRequest. */ + class DeleteOperationRequest implements IDeleteOperationRequest { + + /** + * Constructs a new DeleteOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IDeleteOperationRequest); + + /** DeleteOperationRequest name. */ + public name: string; + + /** + * Creates a new DeleteOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteOperationRequest instance + */ + public static create(properties?: google.longrunning.IDeleteOperationRequest): google.longrunning.DeleteOperationRequest; + + /** + * Encodes the specified DeleteOperationRequest message. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @param message DeleteOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IDeleteOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @param message DeleteOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IDeleteOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteOperationRequest + * @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.longrunning.DeleteOperationRequest; + + /** + * Decodes a DeleteOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteOperationRequest + * @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.longrunning.DeleteOperationRequest; + + /** + * Verifies a DeleteOperationRequest 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 DeleteOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.DeleteOperationRequest; + + /** + * Creates a plain object from a DeleteOperationRequest message. Also converts values to other types if specified. + * @param message DeleteOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.DeleteOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a WaitOperationRequest. */ + interface IWaitOperationRequest { + + /** WaitOperationRequest name */ + name?: (string|null); + + /** WaitOperationRequest timeout */ + timeout?: (google.protobuf.IDuration|null); + } + + /** Represents a WaitOperationRequest. */ + class WaitOperationRequest implements IWaitOperationRequest { + + /** + * Constructs a new WaitOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IWaitOperationRequest); + + /** WaitOperationRequest name. */ + public name: string; + + /** WaitOperationRequest timeout. */ + public timeout?: (google.protobuf.IDuration|null); + + /** + * Creates a new WaitOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns WaitOperationRequest instance + */ + public static create(properties?: google.longrunning.IWaitOperationRequest): google.longrunning.WaitOperationRequest; + + /** + * Encodes the specified WaitOperationRequest message. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @param message WaitOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IWaitOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WaitOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @param message WaitOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IWaitOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WaitOperationRequest + * @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.longrunning.WaitOperationRequest; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WaitOperationRequest + * @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.longrunning.WaitOperationRequest; + + /** + * Verifies a WaitOperationRequest 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 WaitOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WaitOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.WaitOperationRequest; + + /** + * Creates a plain object from a WaitOperationRequest message. Also converts values to other types if specified. + * @param message WaitOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.WaitOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WaitOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an OperationInfo. */ + interface IOperationInfo { + + /** OperationInfo responseType */ + responseType?: (string|null); + + /** OperationInfo metadataType */ + metadataType?: (string|null); + } + + /** Represents an OperationInfo. */ + class OperationInfo implements IOperationInfo { + + /** + * Constructs a new OperationInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IOperationInfo); + + /** OperationInfo responseType. */ + public responseType: string; + + /** OperationInfo metadataType. */ + public metadataType: string; + + /** + * Creates a new OperationInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns OperationInfo instance + */ + public static create(properties?: google.longrunning.IOperationInfo): google.longrunning.OperationInfo; + + /** + * Encodes the specified OperationInfo message. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @param message OperationInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IOperationInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OperationInfo message, length delimited. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @param message OperationInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IOperationInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OperationInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OperationInfo + * @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.longrunning.OperationInfo; + + /** + * Decodes an OperationInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OperationInfo + * @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.longrunning.OperationInfo; + + /** + * Verifies an OperationInfo 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 OperationInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OperationInfo + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.OperationInfo; + + /** + * Creates a plain object from an OperationInfo message. Also converts values to other types if specified. + * @param message OperationInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.OperationInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OperationInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** Namespace rpc. */ + namespace rpc { + + /** Properties of a Status. */ + interface IStatus { + + /** Status code */ + code?: (number|null); + + /** Status message */ + message?: (string|null); + + /** Status details */ + details?: (google.protobuf.IAny[]|null); + } + + /** Represents a Status. */ + class Status implements IStatus { + + /** + * Constructs a new Status. + * @param [properties] Properties to set + */ + constructor(properties?: google.rpc.IStatus); + + /** Status code. */ + public code: number; + + /** Status message. */ + public message: string; + + /** Status details. */ + public details: google.protobuf.IAny[]; + + /** + * Creates a new Status instance using the specified properties. + * @param [properties] Properties to set + * @returns Status instance + */ + public static create(properties?: google.rpc.IStatus): google.rpc.Status; + + /** + * Encodes the specified Status message. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @param message Status message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.rpc.IStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Status message, length delimited. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @param message Status message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.rpc.IStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Status message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Status + * @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.rpc.Status; + + /** + * Decodes a Status message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Status + * @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.rpc.Status; + + /** + * Verifies a Status 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 Status message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Status + */ + public static fromObject(object: { [k: string]: any }): google.rpc.Status; + + /** + * Creates a plain object from a Status message. Also converts values to other types if specified. + * @param message Status + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.rpc.Status, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Status to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } +} diff --git a/packages/google-cloud-securitycenter/protos/protos.js b/packages/google-cloud-securitycenter/protos/protos.js new file mode 100644 index 00000000000..134c4db0f33 --- /dev/null +++ b/packages/google-cloud-securitycenter/protos/protos.js @@ -0,0 +1,33741 @@ +/*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("protobufjs/minimal")); + +})(this, function($protobuf) { + "use strict"; + + // Common aliases + var $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util; + + // Exported root namespace + var $root = $protobuf.roots["default"] || ($protobuf.roots["default"] = {}); + + $root.google = (function() { + + /** + * Namespace google. + * @exports google + * @namespace + */ + var google = {}; + + google.cloud = (function() { + + /** + * Namespace cloud. + * @memberof google + * @namespace + */ + var cloud = {}; + + cloud.securitycenter = (function() { + + /** + * Namespace securitycenter. + * @memberof google.cloud + * @namespace + */ + var securitycenter = {}; + + securitycenter.v1 = (function() { + + /** + * Namespace v1. + * @memberof google.cloud.securitycenter + * @namespace + */ + var v1 = {}; + + v1.SecurityCenter = (function() { + + /** + * Constructs a new SecurityCenter service. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a SecurityCenter + * @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 SecurityCenter(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (SecurityCenter.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = SecurityCenter; + + /** + * Creates new SecurityCenter service using the specified rpc implementation. + * @function create + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @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 {SecurityCenter} RPC service. Useful where requests and/or responses are streamed. + */ + SecurityCenter.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#createSource}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef CreateSourceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1.Source} [response] Source + */ + + /** + * Calls CreateSource. + * @function createSource + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.ICreateSourceRequest} request CreateSourceRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.CreateSourceCallback} callback Node-style callback called with the error, if any, and Source + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.createSource = function createSource(request, callback) { + return this.rpcCall(createSource, $root.google.cloud.securitycenter.v1.CreateSourceRequest, $root.google.cloud.securitycenter.v1.Source, request, callback); + }, "name", { value: "CreateSource" }); + + /** + * Calls CreateSource. + * @function createSource + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.ICreateSourceRequest} request CreateSourceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#createFinding}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef CreateFindingCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1.Finding} [response] Finding + */ + + /** + * Calls CreateFinding. + * @function createFinding + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.ICreateFindingRequest} request CreateFindingRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.CreateFindingCallback} callback Node-style callback called with the error, if any, and Finding + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.createFinding = function createFinding(request, callback) { + return this.rpcCall(createFinding, $root.google.cloud.securitycenter.v1.CreateFindingRequest, $root.google.cloud.securitycenter.v1.Finding, request, callback); + }, "name", { value: "CreateFinding" }); + + /** + * Calls CreateFinding. + * @function createFinding + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.ICreateFindingRequest} request CreateFindingRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#getIamPolicy}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef GetIamPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.iam.v1.Policy} [response] Policy + */ + + /** + * Calls GetIamPolicy. + * @function getIamPolicy + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.iam.v1.IGetIamPolicyRequest} request GetIamPolicyRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.GetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.getIamPolicy = function getIamPolicy(request, callback) { + return this.rpcCall(getIamPolicy, $root.google.iam.v1.GetIamPolicyRequest, $root.google.iam.v1.Policy, request, callback); + }, "name", { value: "GetIamPolicy" }); + + /** + * Calls GetIamPolicy. + * @function getIamPolicy + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.iam.v1.IGetIamPolicyRequest} request GetIamPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#getOrganizationSettings}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef GetOrganizationSettingsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1.OrganizationSettings} [response] OrganizationSettings + */ + + /** + * Calls GetOrganizationSettings. + * @function getOrganizationSettings + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IGetOrganizationSettingsRequest} request GetOrganizationSettingsRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.GetOrganizationSettingsCallback} callback Node-style callback called with the error, if any, and OrganizationSettings + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.getOrganizationSettings = function getOrganizationSettings(request, callback) { + return this.rpcCall(getOrganizationSettings, $root.google.cloud.securitycenter.v1.GetOrganizationSettingsRequest, $root.google.cloud.securitycenter.v1.OrganizationSettings, request, callback); + }, "name", { value: "GetOrganizationSettings" }); + + /** + * Calls GetOrganizationSettings. + * @function getOrganizationSettings + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IGetOrganizationSettingsRequest} request GetOrganizationSettingsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#getSource}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef GetSourceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1.Source} [response] Source + */ + + /** + * Calls GetSource. + * @function getSource + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IGetSourceRequest} request GetSourceRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.GetSourceCallback} callback Node-style callback called with the error, if any, and Source + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.getSource = function getSource(request, callback) { + return this.rpcCall(getSource, $root.google.cloud.securitycenter.v1.GetSourceRequest, $root.google.cloud.securitycenter.v1.Source, request, callback); + }, "name", { value: "GetSource" }); + + /** + * Calls GetSource. + * @function getSource + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IGetSourceRequest} request GetSourceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#groupAssets}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef GroupAssetsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1.GroupAssetsResponse} [response] GroupAssetsResponse + */ + + /** + * Calls GroupAssets. + * @function groupAssets + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IGroupAssetsRequest} request GroupAssetsRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.GroupAssetsCallback} callback Node-style callback called with the error, if any, and GroupAssetsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.groupAssets = function groupAssets(request, callback) { + return this.rpcCall(groupAssets, $root.google.cloud.securitycenter.v1.GroupAssetsRequest, $root.google.cloud.securitycenter.v1.GroupAssetsResponse, request, callback); + }, "name", { value: "GroupAssets" }); + + /** + * Calls GroupAssets. + * @function groupAssets + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IGroupAssetsRequest} request GroupAssetsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#groupFindings}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef GroupFindingsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1.GroupFindingsResponse} [response] GroupFindingsResponse + */ + + /** + * Calls GroupFindings. + * @function groupFindings + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IGroupFindingsRequest} request GroupFindingsRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.GroupFindingsCallback} callback Node-style callback called with the error, if any, and GroupFindingsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.groupFindings = function groupFindings(request, callback) { + return this.rpcCall(groupFindings, $root.google.cloud.securitycenter.v1.GroupFindingsRequest, $root.google.cloud.securitycenter.v1.GroupFindingsResponse, request, callback); + }, "name", { value: "GroupFindings" }); + + /** + * Calls GroupFindings. + * @function groupFindings + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IGroupFindingsRequest} request GroupFindingsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#listAssets}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef ListAssetsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1.ListAssetsResponse} [response] ListAssetsResponse + */ + + /** + * Calls ListAssets. + * @function listAssets + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IListAssetsRequest} request ListAssetsRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.ListAssetsCallback} callback Node-style callback called with the error, if any, and ListAssetsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.listAssets = function listAssets(request, callback) { + return this.rpcCall(listAssets, $root.google.cloud.securitycenter.v1.ListAssetsRequest, $root.google.cloud.securitycenter.v1.ListAssetsResponse, request, callback); + }, "name", { value: "ListAssets" }); + + /** + * Calls ListAssets. + * @function listAssets + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IListAssetsRequest} request ListAssetsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#listFindings}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef ListFindingsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1.ListFindingsResponse} [response] ListFindingsResponse + */ + + /** + * Calls ListFindings. + * @function listFindings + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IListFindingsRequest} request ListFindingsRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.ListFindingsCallback} callback Node-style callback called with the error, if any, and ListFindingsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.listFindings = function listFindings(request, callback) { + return this.rpcCall(listFindings, $root.google.cloud.securitycenter.v1.ListFindingsRequest, $root.google.cloud.securitycenter.v1.ListFindingsResponse, request, callback); + }, "name", { value: "ListFindings" }); + + /** + * Calls ListFindings. + * @function listFindings + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IListFindingsRequest} request ListFindingsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#listSources}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef ListSourcesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1.ListSourcesResponse} [response] ListSourcesResponse + */ + + /** + * Calls ListSources. + * @function listSources + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IListSourcesRequest} request ListSourcesRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.ListSourcesCallback} callback Node-style callback called with the error, if any, and ListSourcesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.listSources = function listSources(request, callback) { + return this.rpcCall(listSources, $root.google.cloud.securitycenter.v1.ListSourcesRequest, $root.google.cloud.securitycenter.v1.ListSourcesResponse, request, callback); + }, "name", { value: "ListSources" }); + + /** + * Calls ListSources. + * @function listSources + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IListSourcesRequest} request ListSourcesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#runAssetDiscovery}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef RunAssetDiscoveryCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls RunAssetDiscovery. + * @function runAssetDiscovery + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IRunAssetDiscoveryRequest} request RunAssetDiscoveryRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.RunAssetDiscoveryCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.runAssetDiscovery = function runAssetDiscovery(request, callback) { + return this.rpcCall(runAssetDiscovery, $root.google.cloud.securitycenter.v1.RunAssetDiscoveryRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "RunAssetDiscovery" }); + + /** + * Calls RunAssetDiscovery. + * @function runAssetDiscovery + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IRunAssetDiscoveryRequest} request RunAssetDiscoveryRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#setFindingState}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef SetFindingStateCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1.Finding} [response] Finding + */ + + /** + * Calls SetFindingState. + * @function setFindingState + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.ISetFindingStateRequest} request SetFindingStateRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.SetFindingStateCallback} callback Node-style callback called with the error, if any, and Finding + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.setFindingState = function setFindingState(request, callback) { + return this.rpcCall(setFindingState, $root.google.cloud.securitycenter.v1.SetFindingStateRequest, $root.google.cloud.securitycenter.v1.Finding, request, callback); + }, "name", { value: "SetFindingState" }); + + /** + * Calls SetFindingState. + * @function setFindingState + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.ISetFindingStateRequest} request SetFindingStateRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#setIamPolicy}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef SetIamPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.iam.v1.Policy} [response] Policy + */ + + /** + * Calls SetIamPolicy. + * @function setIamPolicy + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.iam.v1.ISetIamPolicyRequest} request SetIamPolicyRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.SetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.setIamPolicy = function setIamPolicy(request, callback) { + return this.rpcCall(setIamPolicy, $root.google.iam.v1.SetIamPolicyRequest, $root.google.iam.v1.Policy, request, callback); + }, "name", { value: "SetIamPolicy" }); + + /** + * Calls SetIamPolicy. + * @function setIamPolicy + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.iam.v1.ISetIamPolicyRequest} request SetIamPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#testIamPermissions}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef TestIamPermissionsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.iam.v1.TestIamPermissionsResponse} [response] TestIamPermissionsResponse + */ + + /** + * Calls TestIamPermissions. + * @function testIamPermissions + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.iam.v1.ITestIamPermissionsRequest} request TestIamPermissionsRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.TestIamPermissionsCallback} callback Node-style callback called with the error, if any, and TestIamPermissionsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.testIamPermissions = function testIamPermissions(request, callback) { + return this.rpcCall(testIamPermissions, $root.google.iam.v1.TestIamPermissionsRequest, $root.google.iam.v1.TestIamPermissionsResponse, request, callback); + }, "name", { value: "TestIamPermissions" }); + + /** + * Calls TestIamPermissions. + * @function testIamPermissions + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.iam.v1.ITestIamPermissionsRequest} request TestIamPermissionsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#updateFinding}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef UpdateFindingCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1.Finding} [response] Finding + */ + + /** + * Calls UpdateFinding. + * @function updateFinding + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IUpdateFindingRequest} request UpdateFindingRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.UpdateFindingCallback} callback Node-style callback called with the error, if any, and Finding + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.updateFinding = function updateFinding(request, callback) { + return this.rpcCall(updateFinding, $root.google.cloud.securitycenter.v1.UpdateFindingRequest, $root.google.cloud.securitycenter.v1.Finding, request, callback); + }, "name", { value: "UpdateFinding" }); + + /** + * Calls UpdateFinding. + * @function updateFinding + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IUpdateFindingRequest} request UpdateFindingRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#updateOrganizationSettings}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef UpdateOrganizationSettingsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1.OrganizationSettings} [response] OrganizationSettings + */ + + /** + * Calls UpdateOrganizationSettings. + * @function updateOrganizationSettings + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IUpdateOrganizationSettingsRequest} request UpdateOrganizationSettingsRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.UpdateOrganizationSettingsCallback} callback Node-style callback called with the error, if any, and OrganizationSettings + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.updateOrganizationSettings = function updateOrganizationSettings(request, callback) { + return this.rpcCall(updateOrganizationSettings, $root.google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest, $root.google.cloud.securitycenter.v1.OrganizationSettings, request, callback); + }, "name", { value: "UpdateOrganizationSettings" }); + + /** + * Calls UpdateOrganizationSettings. + * @function updateOrganizationSettings + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IUpdateOrganizationSettingsRequest} request UpdateOrganizationSettingsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#updateSource}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef UpdateSourceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1.Source} [response] Source + */ + + /** + * Calls UpdateSource. + * @function updateSource + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IUpdateSourceRequest} request UpdateSourceRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.UpdateSourceCallback} callback Node-style callback called with the error, if any, and Source + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.updateSource = function updateSource(request, callback) { + return this.rpcCall(updateSource, $root.google.cloud.securitycenter.v1.UpdateSourceRequest, $root.google.cloud.securitycenter.v1.Source, request, callback); + }, "name", { value: "UpdateSource" }); + + /** + * Calls UpdateSource. + * @function updateSource + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IUpdateSourceRequest} request UpdateSourceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#updateSecurityMarks}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef UpdateSecurityMarksCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1.SecurityMarks} [response] SecurityMarks + */ + + /** + * Calls UpdateSecurityMarks. + * @function updateSecurityMarks + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IUpdateSecurityMarksRequest} request UpdateSecurityMarksRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.UpdateSecurityMarksCallback} callback Node-style callback called with the error, if any, and SecurityMarks + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.updateSecurityMarks = function updateSecurityMarks(request, callback) { + return this.rpcCall(updateSecurityMarks, $root.google.cloud.securitycenter.v1.UpdateSecurityMarksRequest, $root.google.cloud.securitycenter.v1.SecurityMarks, request, callback); + }, "name", { value: "UpdateSecurityMarks" }); + + /** + * Calls UpdateSecurityMarks. + * @function updateSecurityMarks + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IUpdateSecurityMarksRequest} request UpdateSecurityMarksRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return SecurityCenter; + })(); + + v1.CreateFindingRequest = (function() { + + /** + * Properties of a CreateFindingRequest. + * @memberof google.cloud.securitycenter.v1 + * @interface ICreateFindingRequest + * @property {string|null} [parent] CreateFindingRequest parent + * @property {string|null} [findingId] CreateFindingRequest findingId + * @property {google.cloud.securitycenter.v1.IFinding|null} [finding] CreateFindingRequest finding + */ + + /** + * Constructs a new CreateFindingRequest. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a CreateFindingRequest. + * @implements ICreateFindingRequest + * @constructor + * @param {google.cloud.securitycenter.v1.ICreateFindingRequest=} [properties] Properties to set + */ + function CreateFindingRequest(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]]; + } + + /** + * CreateFindingRequest parent. + * @member {string} parent + * @memberof google.cloud.securitycenter.v1.CreateFindingRequest + * @instance + */ + CreateFindingRequest.prototype.parent = ""; + + /** + * CreateFindingRequest findingId. + * @member {string} findingId + * @memberof google.cloud.securitycenter.v1.CreateFindingRequest + * @instance + */ + CreateFindingRequest.prototype.findingId = ""; + + /** + * CreateFindingRequest finding. + * @member {google.cloud.securitycenter.v1.IFinding|null|undefined} finding + * @memberof google.cloud.securitycenter.v1.CreateFindingRequest + * @instance + */ + CreateFindingRequest.prototype.finding = null; + + /** + * Creates a new CreateFindingRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.CreateFindingRequest + * @static + * @param {google.cloud.securitycenter.v1.ICreateFindingRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.CreateFindingRequest} CreateFindingRequest instance + */ + CreateFindingRequest.create = function create(properties) { + return new CreateFindingRequest(properties); + }; + + /** + * Encodes the specified CreateFindingRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.CreateFindingRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.CreateFindingRequest + * @static + * @param {google.cloud.securitycenter.v1.ICreateFindingRequest} message CreateFindingRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateFindingRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && message.hasOwnProperty("parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.findingId != null && message.hasOwnProperty("findingId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.findingId); + if (message.finding != null && message.hasOwnProperty("finding")) + $root.google.cloud.securitycenter.v1.Finding.encode(message.finding, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateFindingRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.CreateFindingRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.CreateFindingRequest + * @static + * @param {google.cloud.securitycenter.v1.ICreateFindingRequest} message CreateFindingRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateFindingRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateFindingRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.CreateFindingRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.CreateFindingRequest} CreateFindingRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateFindingRequest.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.cloud.securitycenter.v1.CreateFindingRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.findingId = reader.string(); + break; + case 3: + message.finding = $root.google.cloud.securitycenter.v1.Finding.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateFindingRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.CreateFindingRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.CreateFindingRequest} CreateFindingRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateFindingRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateFindingRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1.CreateFindingRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateFindingRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.findingId != null && message.hasOwnProperty("findingId")) + if (!$util.isString(message.findingId)) + return "findingId: string expected"; + if (message.finding != null && message.hasOwnProperty("finding")) { + var error = $root.google.cloud.securitycenter.v1.Finding.verify(message.finding); + if (error) + return "finding." + error; + } + return null; + }; + + /** + * Creates a CreateFindingRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.CreateFindingRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.CreateFindingRequest} CreateFindingRequest + */ + CreateFindingRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.CreateFindingRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1.CreateFindingRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.findingId != null) + message.findingId = String(object.findingId); + if (object.finding != null) { + if (typeof object.finding !== "object") + throw TypeError(".google.cloud.securitycenter.v1.CreateFindingRequest.finding: object expected"); + message.finding = $root.google.cloud.securitycenter.v1.Finding.fromObject(object.finding); + } + return message; + }; + + /** + * Creates a plain object from a CreateFindingRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.CreateFindingRequest + * @static + * @param {google.cloud.securitycenter.v1.CreateFindingRequest} message CreateFindingRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateFindingRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.findingId = ""; + object.finding = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.findingId != null && message.hasOwnProperty("findingId")) + object.findingId = message.findingId; + if (message.finding != null && message.hasOwnProperty("finding")) + object.finding = $root.google.cloud.securitycenter.v1.Finding.toObject(message.finding, options); + return object; + }; + + /** + * Converts this CreateFindingRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.CreateFindingRequest + * @instance + * @returns {Object.} JSON object + */ + CreateFindingRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return CreateFindingRequest; + })(); + + v1.CreateSourceRequest = (function() { + + /** + * Properties of a CreateSourceRequest. + * @memberof google.cloud.securitycenter.v1 + * @interface ICreateSourceRequest + * @property {string|null} [parent] CreateSourceRequest parent + * @property {google.cloud.securitycenter.v1.ISource|null} [source] CreateSourceRequest source + */ + + /** + * Constructs a new CreateSourceRequest. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a CreateSourceRequest. + * @implements ICreateSourceRequest + * @constructor + * @param {google.cloud.securitycenter.v1.ICreateSourceRequest=} [properties] Properties to set + */ + function CreateSourceRequest(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]]; + } + + /** + * CreateSourceRequest parent. + * @member {string} parent + * @memberof google.cloud.securitycenter.v1.CreateSourceRequest + * @instance + */ + CreateSourceRequest.prototype.parent = ""; + + /** + * CreateSourceRequest source. + * @member {google.cloud.securitycenter.v1.ISource|null|undefined} source + * @memberof google.cloud.securitycenter.v1.CreateSourceRequest + * @instance + */ + CreateSourceRequest.prototype.source = null; + + /** + * Creates a new CreateSourceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.CreateSourceRequest + * @static + * @param {google.cloud.securitycenter.v1.ICreateSourceRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.CreateSourceRequest} CreateSourceRequest instance + */ + CreateSourceRequest.create = function create(properties) { + return new CreateSourceRequest(properties); + }; + + /** + * Encodes the specified CreateSourceRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.CreateSourceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.CreateSourceRequest + * @static + * @param {google.cloud.securitycenter.v1.ICreateSourceRequest} message CreateSourceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateSourceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && message.hasOwnProperty("parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.source != null && message.hasOwnProperty("source")) + $root.google.cloud.securitycenter.v1.Source.encode(message.source, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateSourceRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.CreateSourceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.CreateSourceRequest + * @static + * @param {google.cloud.securitycenter.v1.ICreateSourceRequest} message CreateSourceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateSourceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateSourceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.CreateSourceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.CreateSourceRequest} CreateSourceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateSourceRequest.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.cloud.securitycenter.v1.CreateSourceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.source = $root.google.cloud.securitycenter.v1.Source.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateSourceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.CreateSourceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.CreateSourceRequest} CreateSourceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateSourceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateSourceRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1.CreateSourceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateSourceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.source != null && message.hasOwnProperty("source")) { + var error = $root.google.cloud.securitycenter.v1.Source.verify(message.source); + if (error) + return "source." + error; + } + return null; + }; + + /** + * Creates a CreateSourceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.CreateSourceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.CreateSourceRequest} CreateSourceRequest + */ + CreateSourceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.CreateSourceRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1.CreateSourceRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.source != null) { + if (typeof object.source !== "object") + throw TypeError(".google.cloud.securitycenter.v1.CreateSourceRequest.source: object expected"); + message.source = $root.google.cloud.securitycenter.v1.Source.fromObject(object.source); + } + return message; + }; + + /** + * Creates a plain object from a CreateSourceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.CreateSourceRequest + * @static + * @param {google.cloud.securitycenter.v1.CreateSourceRequest} message CreateSourceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateSourceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.source = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.source != null && message.hasOwnProperty("source")) + object.source = $root.google.cloud.securitycenter.v1.Source.toObject(message.source, options); + return object; + }; + + /** + * Converts this CreateSourceRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.CreateSourceRequest + * @instance + * @returns {Object.} JSON object + */ + CreateSourceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return CreateSourceRequest; + })(); + + v1.GetOrganizationSettingsRequest = (function() { + + /** + * Properties of a GetOrganizationSettingsRequest. + * @memberof google.cloud.securitycenter.v1 + * @interface IGetOrganizationSettingsRequest + * @property {string|null} [name] GetOrganizationSettingsRequest name + */ + + /** + * Constructs a new GetOrganizationSettingsRequest. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a GetOrganizationSettingsRequest. + * @implements IGetOrganizationSettingsRequest + * @constructor + * @param {google.cloud.securitycenter.v1.IGetOrganizationSettingsRequest=} [properties] Properties to set + */ + function GetOrganizationSettingsRequest(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]]; + } + + /** + * GetOrganizationSettingsRequest name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1.GetOrganizationSettingsRequest + * @instance + */ + GetOrganizationSettingsRequest.prototype.name = ""; + + /** + * Creates a new GetOrganizationSettingsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.GetOrganizationSettingsRequest + * @static + * @param {google.cloud.securitycenter.v1.IGetOrganizationSettingsRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.GetOrganizationSettingsRequest} GetOrganizationSettingsRequest instance + */ + GetOrganizationSettingsRequest.create = function create(properties) { + return new GetOrganizationSettingsRequest(properties); + }; + + /** + * Encodes the specified GetOrganizationSettingsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.GetOrganizationSettingsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.GetOrganizationSettingsRequest + * @static + * @param {google.cloud.securitycenter.v1.IGetOrganizationSettingsRequest} message GetOrganizationSettingsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetOrganizationSettingsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetOrganizationSettingsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.GetOrganizationSettingsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.GetOrganizationSettingsRequest + * @static + * @param {google.cloud.securitycenter.v1.IGetOrganizationSettingsRequest} message GetOrganizationSettingsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetOrganizationSettingsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetOrganizationSettingsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.GetOrganizationSettingsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.GetOrganizationSettingsRequest} GetOrganizationSettingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetOrganizationSettingsRequest.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.cloud.securitycenter.v1.GetOrganizationSettingsRequest(); + 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 GetOrganizationSettingsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.GetOrganizationSettingsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.GetOrganizationSettingsRequest} GetOrganizationSettingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetOrganizationSettingsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetOrganizationSettingsRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1.GetOrganizationSettingsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetOrganizationSettingsRequest.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 GetOrganizationSettingsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.GetOrganizationSettingsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.GetOrganizationSettingsRequest} GetOrganizationSettingsRequest + */ + GetOrganizationSettingsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.GetOrganizationSettingsRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1.GetOrganizationSettingsRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetOrganizationSettingsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.GetOrganizationSettingsRequest + * @static + * @param {google.cloud.securitycenter.v1.GetOrganizationSettingsRequest} message GetOrganizationSettingsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetOrganizationSettingsRequest.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 GetOrganizationSettingsRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.GetOrganizationSettingsRequest + * @instance + * @returns {Object.} JSON object + */ + GetOrganizationSettingsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetOrganizationSettingsRequest; + })(); + + v1.GetSourceRequest = (function() { + + /** + * Properties of a GetSourceRequest. + * @memberof google.cloud.securitycenter.v1 + * @interface IGetSourceRequest + * @property {string|null} [name] GetSourceRequest name + */ + + /** + * Constructs a new GetSourceRequest. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a GetSourceRequest. + * @implements IGetSourceRequest + * @constructor + * @param {google.cloud.securitycenter.v1.IGetSourceRequest=} [properties] Properties to set + */ + function GetSourceRequest(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]]; + } + + /** + * GetSourceRequest name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1.GetSourceRequest + * @instance + */ + GetSourceRequest.prototype.name = ""; + + /** + * Creates a new GetSourceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.GetSourceRequest + * @static + * @param {google.cloud.securitycenter.v1.IGetSourceRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.GetSourceRequest} GetSourceRequest instance + */ + GetSourceRequest.create = function create(properties) { + return new GetSourceRequest(properties); + }; + + /** + * Encodes the specified GetSourceRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.GetSourceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.GetSourceRequest + * @static + * @param {google.cloud.securitycenter.v1.IGetSourceRequest} message GetSourceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetSourceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetSourceRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.GetSourceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.GetSourceRequest + * @static + * @param {google.cloud.securitycenter.v1.IGetSourceRequest} message GetSourceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetSourceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetSourceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.GetSourceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.GetSourceRequest} GetSourceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetSourceRequest.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.cloud.securitycenter.v1.GetSourceRequest(); + 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 GetSourceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.GetSourceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.GetSourceRequest} GetSourceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetSourceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetSourceRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1.GetSourceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetSourceRequest.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 GetSourceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.GetSourceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.GetSourceRequest} GetSourceRequest + */ + GetSourceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.GetSourceRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1.GetSourceRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetSourceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.GetSourceRequest + * @static + * @param {google.cloud.securitycenter.v1.GetSourceRequest} message GetSourceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetSourceRequest.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 GetSourceRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.GetSourceRequest + * @instance + * @returns {Object.} JSON object + */ + GetSourceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetSourceRequest; + })(); + + v1.GroupAssetsRequest = (function() { + + /** + * Properties of a GroupAssetsRequest. + * @memberof google.cloud.securitycenter.v1 + * @interface IGroupAssetsRequest + * @property {string|null} [parent] GroupAssetsRequest parent + * @property {string|null} [filter] GroupAssetsRequest filter + * @property {string|null} [groupBy] GroupAssetsRequest groupBy + * @property {google.protobuf.IDuration|null} [compareDuration] GroupAssetsRequest compareDuration + * @property {google.protobuf.ITimestamp|null} [readTime] GroupAssetsRequest readTime + * @property {string|null} [pageToken] GroupAssetsRequest pageToken + * @property {number|null} [pageSize] GroupAssetsRequest pageSize + */ + + /** + * Constructs a new GroupAssetsRequest. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a GroupAssetsRequest. + * @implements IGroupAssetsRequest + * @constructor + * @param {google.cloud.securitycenter.v1.IGroupAssetsRequest=} [properties] Properties to set + */ + function GroupAssetsRequest(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]]; + } + + /** + * GroupAssetsRequest parent. + * @member {string} parent + * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest + * @instance + */ + GroupAssetsRequest.prototype.parent = ""; + + /** + * GroupAssetsRequest filter. + * @member {string} filter + * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest + * @instance + */ + GroupAssetsRequest.prototype.filter = ""; + + /** + * GroupAssetsRequest groupBy. + * @member {string} groupBy + * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest + * @instance + */ + GroupAssetsRequest.prototype.groupBy = ""; + + /** + * GroupAssetsRequest compareDuration. + * @member {google.protobuf.IDuration|null|undefined} compareDuration + * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest + * @instance + */ + GroupAssetsRequest.prototype.compareDuration = null; + + /** + * GroupAssetsRequest readTime. + * @member {google.protobuf.ITimestamp|null|undefined} readTime + * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest + * @instance + */ + GroupAssetsRequest.prototype.readTime = null; + + /** + * GroupAssetsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest + * @instance + */ + GroupAssetsRequest.prototype.pageToken = ""; + + /** + * GroupAssetsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest + * @instance + */ + GroupAssetsRequest.prototype.pageSize = 0; + + /** + * Creates a new GroupAssetsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest + * @static + * @param {google.cloud.securitycenter.v1.IGroupAssetsRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.GroupAssetsRequest} GroupAssetsRequest instance + */ + GroupAssetsRequest.create = function create(properties) { + return new GroupAssetsRequest(properties); + }; + + /** + * Encodes the specified GroupAssetsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.GroupAssetsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest + * @static + * @param {google.cloud.securitycenter.v1.IGroupAssetsRequest} message GroupAssetsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroupAssetsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && message.hasOwnProperty("parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.filter != null && message.hasOwnProperty("filter")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); + if (message.groupBy != null && message.hasOwnProperty("groupBy")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.groupBy); + if (message.compareDuration != null && message.hasOwnProperty("compareDuration")) + $root.google.protobuf.Duration.encode(message.compareDuration, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.readTime != null && message.hasOwnProperty("readTime")) + $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.pageToken); + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.pageSize); + return writer; + }; + + /** + * Encodes the specified GroupAssetsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.GroupAssetsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest + * @static + * @param {google.cloud.securitycenter.v1.IGroupAssetsRequest} message GroupAssetsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroupAssetsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GroupAssetsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.GroupAssetsRequest} GroupAssetsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GroupAssetsRequest.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.cloud.securitycenter.v1.GroupAssetsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.filter = reader.string(); + break; + case 3: + message.groupBy = reader.string(); + break; + case 4: + message.compareDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + case 5: + message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 7: + message.pageToken = reader.string(); + break; + case 8: + message.pageSize = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GroupAssetsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.GroupAssetsRequest} GroupAssetsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GroupAssetsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GroupAssetsRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GroupAssetsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.groupBy != null && message.hasOwnProperty("groupBy")) + if (!$util.isString(message.groupBy)) + return "groupBy: string expected"; + if (message.compareDuration != null && message.hasOwnProperty("compareDuration")) { + var error = $root.google.protobuf.Duration.verify(message.compareDuration); + if (error) + return "compareDuration." + error; + } + if (message.readTime != null && message.hasOwnProperty("readTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.readTime); + if (error) + return "readTime." + error; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + return null; + }; + + /** + * Creates a GroupAssetsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.GroupAssetsRequest} GroupAssetsRequest + */ + GroupAssetsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.GroupAssetsRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1.GroupAssetsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.filter != null) + message.filter = String(object.filter); + if (object.groupBy != null) + message.groupBy = String(object.groupBy); + if (object.compareDuration != null) { + if (typeof object.compareDuration !== "object") + throw TypeError(".google.cloud.securitycenter.v1.GroupAssetsRequest.compareDuration: object expected"); + message.compareDuration = $root.google.protobuf.Duration.fromObject(object.compareDuration); + } + if (object.readTime != null) { + if (typeof object.readTime !== "object") + throw TypeError(".google.cloud.securitycenter.v1.GroupAssetsRequest.readTime: object expected"); + message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); + } + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + return message; + }; + + /** + * Creates a plain object from a GroupAssetsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest + * @static + * @param {google.cloud.securitycenter.v1.GroupAssetsRequest} message GroupAssetsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GroupAssetsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.filter = ""; + object.groupBy = ""; + object.compareDuration = null; + object.readTime = null; + object.pageToken = ""; + object.pageSize = 0; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.groupBy != null && message.hasOwnProperty("groupBy")) + object.groupBy = message.groupBy; + if (message.compareDuration != null && message.hasOwnProperty("compareDuration")) + object.compareDuration = $root.google.protobuf.Duration.toObject(message.compareDuration, options); + if (message.readTime != null && message.hasOwnProperty("readTime")) + object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + return object; + }; + + /** + * Converts this GroupAssetsRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest + * @instance + * @returns {Object.} JSON object + */ + GroupAssetsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GroupAssetsRequest; + })(); + + v1.GroupAssetsResponse = (function() { + + /** + * Properties of a GroupAssetsResponse. + * @memberof google.cloud.securitycenter.v1 + * @interface IGroupAssetsResponse + * @property {Array.|null} [groupByResults] GroupAssetsResponse groupByResults + * @property {google.protobuf.ITimestamp|null} [readTime] GroupAssetsResponse readTime + * @property {string|null} [nextPageToken] GroupAssetsResponse nextPageToken + * @property {number|null} [totalSize] GroupAssetsResponse totalSize + */ + + /** + * Constructs a new GroupAssetsResponse. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a GroupAssetsResponse. + * @implements IGroupAssetsResponse + * @constructor + * @param {google.cloud.securitycenter.v1.IGroupAssetsResponse=} [properties] Properties to set + */ + function GroupAssetsResponse(properties) { + this.groupByResults = []; + 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]]; + } + + /** + * GroupAssetsResponse groupByResults. + * @member {Array.} groupByResults + * @memberof google.cloud.securitycenter.v1.GroupAssetsResponse + * @instance + */ + GroupAssetsResponse.prototype.groupByResults = $util.emptyArray; + + /** + * GroupAssetsResponse readTime. + * @member {google.protobuf.ITimestamp|null|undefined} readTime + * @memberof google.cloud.securitycenter.v1.GroupAssetsResponse + * @instance + */ + GroupAssetsResponse.prototype.readTime = null; + + /** + * GroupAssetsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.securitycenter.v1.GroupAssetsResponse + * @instance + */ + GroupAssetsResponse.prototype.nextPageToken = ""; + + /** + * GroupAssetsResponse totalSize. + * @member {number} totalSize + * @memberof google.cloud.securitycenter.v1.GroupAssetsResponse + * @instance + */ + GroupAssetsResponse.prototype.totalSize = 0; + + /** + * Creates a new GroupAssetsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.GroupAssetsResponse + * @static + * @param {google.cloud.securitycenter.v1.IGroupAssetsResponse=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.GroupAssetsResponse} GroupAssetsResponse instance + */ + GroupAssetsResponse.create = function create(properties) { + return new GroupAssetsResponse(properties); + }; + + /** + * Encodes the specified GroupAssetsResponse message. Does not implicitly {@link google.cloud.securitycenter.v1.GroupAssetsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.GroupAssetsResponse + * @static + * @param {google.cloud.securitycenter.v1.IGroupAssetsResponse} message GroupAssetsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroupAssetsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.groupByResults != null && message.groupByResults.length) + for (var i = 0; i < message.groupByResults.length; ++i) + $root.google.cloud.securitycenter.v1.GroupResult.encode(message.groupByResults[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.readTime != null && message.hasOwnProperty("readTime")) + $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.nextPageToken); + if (message.totalSize != null && message.hasOwnProperty("totalSize")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.totalSize); + return writer; + }; + + /** + * Encodes the specified GroupAssetsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.GroupAssetsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.GroupAssetsResponse + * @static + * @param {google.cloud.securitycenter.v1.IGroupAssetsResponse} message GroupAssetsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroupAssetsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GroupAssetsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.GroupAssetsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.GroupAssetsResponse} GroupAssetsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GroupAssetsResponse.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.cloud.securitycenter.v1.GroupAssetsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.groupByResults && message.groupByResults.length)) + message.groupByResults = []; + message.groupByResults.push($root.google.cloud.securitycenter.v1.GroupResult.decode(reader, reader.uint32())); + break; + case 2: + message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 3: + message.nextPageToken = reader.string(); + break; + case 4: + message.totalSize = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GroupAssetsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.GroupAssetsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.GroupAssetsResponse} GroupAssetsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GroupAssetsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GroupAssetsResponse message. + * @function verify + * @memberof google.cloud.securitycenter.v1.GroupAssetsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GroupAssetsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.groupByResults != null && message.hasOwnProperty("groupByResults")) { + if (!Array.isArray(message.groupByResults)) + return "groupByResults: array expected"; + for (var i = 0; i < message.groupByResults.length; ++i) { + var error = $root.google.cloud.securitycenter.v1.GroupResult.verify(message.groupByResults[i]); + if (error) + return "groupByResults." + error; + } + } + if (message.readTime != null && message.hasOwnProperty("readTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.readTime); + if (error) + return "readTime." + error; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.totalSize != null && message.hasOwnProperty("totalSize")) + if (!$util.isInteger(message.totalSize)) + return "totalSize: integer expected"; + return null; + }; + + /** + * Creates a GroupAssetsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.GroupAssetsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.GroupAssetsResponse} GroupAssetsResponse + */ + GroupAssetsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.GroupAssetsResponse) + return object; + var message = new $root.google.cloud.securitycenter.v1.GroupAssetsResponse(); + if (object.groupByResults) { + if (!Array.isArray(object.groupByResults)) + throw TypeError(".google.cloud.securitycenter.v1.GroupAssetsResponse.groupByResults: array expected"); + message.groupByResults = []; + for (var i = 0; i < object.groupByResults.length; ++i) { + if (typeof object.groupByResults[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v1.GroupAssetsResponse.groupByResults: object expected"); + message.groupByResults[i] = $root.google.cloud.securitycenter.v1.GroupResult.fromObject(object.groupByResults[i]); + } + } + if (object.readTime != null) { + if (typeof object.readTime !== "object") + throw TypeError(".google.cloud.securitycenter.v1.GroupAssetsResponse.readTime: object expected"); + message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.totalSize != null) + message.totalSize = object.totalSize | 0; + return message; + }; + + /** + * Creates a plain object from a GroupAssetsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.GroupAssetsResponse + * @static + * @param {google.cloud.securitycenter.v1.GroupAssetsResponse} message GroupAssetsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GroupAssetsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.groupByResults = []; + if (options.defaults) { + object.readTime = null; + object.nextPageToken = ""; + object.totalSize = 0; + } + if (message.groupByResults && message.groupByResults.length) { + object.groupByResults = []; + for (var j = 0; j < message.groupByResults.length; ++j) + object.groupByResults[j] = $root.google.cloud.securitycenter.v1.GroupResult.toObject(message.groupByResults[j], options); + } + if (message.readTime != null && message.hasOwnProperty("readTime")) + object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.totalSize != null && message.hasOwnProperty("totalSize")) + object.totalSize = message.totalSize; + return object; + }; + + /** + * Converts this GroupAssetsResponse to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.GroupAssetsResponse + * @instance + * @returns {Object.} JSON object + */ + GroupAssetsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GroupAssetsResponse; + })(); + + v1.GroupFindingsRequest = (function() { + + /** + * Properties of a GroupFindingsRequest. + * @memberof google.cloud.securitycenter.v1 + * @interface IGroupFindingsRequest + * @property {string|null} [parent] GroupFindingsRequest parent + * @property {string|null} [filter] GroupFindingsRequest filter + * @property {string|null} [groupBy] GroupFindingsRequest groupBy + * @property {google.protobuf.ITimestamp|null} [readTime] GroupFindingsRequest readTime + * @property {google.protobuf.IDuration|null} [compareDuration] GroupFindingsRequest compareDuration + * @property {string|null} [pageToken] GroupFindingsRequest pageToken + * @property {number|null} [pageSize] GroupFindingsRequest pageSize + */ + + /** + * Constructs a new GroupFindingsRequest. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a GroupFindingsRequest. + * @implements IGroupFindingsRequest + * @constructor + * @param {google.cloud.securitycenter.v1.IGroupFindingsRequest=} [properties] Properties to set + */ + function GroupFindingsRequest(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]]; + } + + /** + * GroupFindingsRequest parent. + * @member {string} parent + * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest + * @instance + */ + GroupFindingsRequest.prototype.parent = ""; + + /** + * GroupFindingsRequest filter. + * @member {string} filter + * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest + * @instance + */ + GroupFindingsRequest.prototype.filter = ""; + + /** + * GroupFindingsRequest groupBy. + * @member {string} groupBy + * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest + * @instance + */ + GroupFindingsRequest.prototype.groupBy = ""; + + /** + * GroupFindingsRequest readTime. + * @member {google.protobuf.ITimestamp|null|undefined} readTime + * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest + * @instance + */ + GroupFindingsRequest.prototype.readTime = null; + + /** + * GroupFindingsRequest compareDuration. + * @member {google.protobuf.IDuration|null|undefined} compareDuration + * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest + * @instance + */ + GroupFindingsRequest.prototype.compareDuration = null; + + /** + * GroupFindingsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest + * @instance + */ + GroupFindingsRequest.prototype.pageToken = ""; + + /** + * GroupFindingsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest + * @instance + */ + GroupFindingsRequest.prototype.pageSize = 0; + + /** + * Creates a new GroupFindingsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest + * @static + * @param {google.cloud.securitycenter.v1.IGroupFindingsRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.GroupFindingsRequest} GroupFindingsRequest instance + */ + GroupFindingsRequest.create = function create(properties) { + return new GroupFindingsRequest(properties); + }; + + /** + * Encodes the specified GroupFindingsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.GroupFindingsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest + * @static + * @param {google.cloud.securitycenter.v1.IGroupFindingsRequest} message GroupFindingsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroupFindingsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && message.hasOwnProperty("parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.filter != null && message.hasOwnProperty("filter")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); + if (message.groupBy != null && message.hasOwnProperty("groupBy")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.groupBy); + if (message.readTime != null && message.hasOwnProperty("readTime")) + $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.compareDuration != null && message.hasOwnProperty("compareDuration")) + $root.google.protobuf.Duration.encode(message.compareDuration, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.pageToken); + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.pageSize); + return writer; + }; + + /** + * Encodes the specified GroupFindingsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.GroupFindingsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest + * @static + * @param {google.cloud.securitycenter.v1.IGroupFindingsRequest} message GroupFindingsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroupFindingsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GroupFindingsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.GroupFindingsRequest} GroupFindingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GroupFindingsRequest.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.cloud.securitycenter.v1.GroupFindingsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.filter = reader.string(); + break; + case 3: + message.groupBy = reader.string(); + break; + case 4: + message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 5: + message.compareDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + case 7: + message.pageToken = reader.string(); + break; + case 8: + message.pageSize = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GroupFindingsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.GroupFindingsRequest} GroupFindingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GroupFindingsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GroupFindingsRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GroupFindingsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.groupBy != null && message.hasOwnProperty("groupBy")) + if (!$util.isString(message.groupBy)) + return "groupBy: string expected"; + if (message.readTime != null && message.hasOwnProperty("readTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.readTime); + if (error) + return "readTime." + error; + } + if (message.compareDuration != null && message.hasOwnProperty("compareDuration")) { + var error = $root.google.protobuf.Duration.verify(message.compareDuration); + if (error) + return "compareDuration." + error; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + return null; + }; + + /** + * Creates a GroupFindingsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.GroupFindingsRequest} GroupFindingsRequest + */ + GroupFindingsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.GroupFindingsRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1.GroupFindingsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.filter != null) + message.filter = String(object.filter); + if (object.groupBy != null) + message.groupBy = String(object.groupBy); + if (object.readTime != null) { + if (typeof object.readTime !== "object") + throw TypeError(".google.cloud.securitycenter.v1.GroupFindingsRequest.readTime: object expected"); + message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); + } + if (object.compareDuration != null) { + if (typeof object.compareDuration !== "object") + throw TypeError(".google.cloud.securitycenter.v1.GroupFindingsRequest.compareDuration: object expected"); + message.compareDuration = $root.google.protobuf.Duration.fromObject(object.compareDuration); + } + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + return message; + }; + + /** + * Creates a plain object from a GroupFindingsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest + * @static + * @param {google.cloud.securitycenter.v1.GroupFindingsRequest} message GroupFindingsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GroupFindingsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.filter = ""; + object.groupBy = ""; + object.readTime = null; + object.compareDuration = null; + object.pageToken = ""; + object.pageSize = 0; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.groupBy != null && message.hasOwnProperty("groupBy")) + object.groupBy = message.groupBy; + if (message.readTime != null && message.hasOwnProperty("readTime")) + object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); + if (message.compareDuration != null && message.hasOwnProperty("compareDuration")) + object.compareDuration = $root.google.protobuf.Duration.toObject(message.compareDuration, options); + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + return object; + }; + + /** + * Converts this GroupFindingsRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest + * @instance + * @returns {Object.} JSON object + */ + GroupFindingsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GroupFindingsRequest; + })(); + + v1.GroupFindingsResponse = (function() { + + /** + * Properties of a GroupFindingsResponse. + * @memberof google.cloud.securitycenter.v1 + * @interface IGroupFindingsResponse + * @property {Array.|null} [groupByResults] GroupFindingsResponse groupByResults + * @property {google.protobuf.ITimestamp|null} [readTime] GroupFindingsResponse readTime + * @property {string|null} [nextPageToken] GroupFindingsResponse nextPageToken + * @property {number|null} [totalSize] GroupFindingsResponse totalSize + */ + + /** + * Constructs a new GroupFindingsResponse. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a GroupFindingsResponse. + * @implements IGroupFindingsResponse + * @constructor + * @param {google.cloud.securitycenter.v1.IGroupFindingsResponse=} [properties] Properties to set + */ + function GroupFindingsResponse(properties) { + this.groupByResults = []; + 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]]; + } + + /** + * GroupFindingsResponse groupByResults. + * @member {Array.} groupByResults + * @memberof google.cloud.securitycenter.v1.GroupFindingsResponse + * @instance + */ + GroupFindingsResponse.prototype.groupByResults = $util.emptyArray; + + /** + * GroupFindingsResponse readTime. + * @member {google.protobuf.ITimestamp|null|undefined} readTime + * @memberof google.cloud.securitycenter.v1.GroupFindingsResponse + * @instance + */ + GroupFindingsResponse.prototype.readTime = null; + + /** + * GroupFindingsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.securitycenter.v1.GroupFindingsResponse + * @instance + */ + GroupFindingsResponse.prototype.nextPageToken = ""; + + /** + * GroupFindingsResponse totalSize. + * @member {number} totalSize + * @memberof google.cloud.securitycenter.v1.GroupFindingsResponse + * @instance + */ + GroupFindingsResponse.prototype.totalSize = 0; + + /** + * Creates a new GroupFindingsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.GroupFindingsResponse + * @static + * @param {google.cloud.securitycenter.v1.IGroupFindingsResponse=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.GroupFindingsResponse} GroupFindingsResponse instance + */ + GroupFindingsResponse.create = function create(properties) { + return new GroupFindingsResponse(properties); + }; + + /** + * Encodes the specified GroupFindingsResponse message. Does not implicitly {@link google.cloud.securitycenter.v1.GroupFindingsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.GroupFindingsResponse + * @static + * @param {google.cloud.securitycenter.v1.IGroupFindingsResponse} message GroupFindingsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroupFindingsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.groupByResults != null && message.groupByResults.length) + for (var i = 0; i < message.groupByResults.length; ++i) + $root.google.cloud.securitycenter.v1.GroupResult.encode(message.groupByResults[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.readTime != null && message.hasOwnProperty("readTime")) + $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.nextPageToken); + if (message.totalSize != null && message.hasOwnProperty("totalSize")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.totalSize); + return writer; + }; + + /** + * Encodes the specified GroupFindingsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.GroupFindingsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.GroupFindingsResponse + * @static + * @param {google.cloud.securitycenter.v1.IGroupFindingsResponse} message GroupFindingsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroupFindingsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GroupFindingsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.GroupFindingsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.GroupFindingsResponse} GroupFindingsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GroupFindingsResponse.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.cloud.securitycenter.v1.GroupFindingsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.groupByResults && message.groupByResults.length)) + message.groupByResults = []; + message.groupByResults.push($root.google.cloud.securitycenter.v1.GroupResult.decode(reader, reader.uint32())); + break; + case 2: + message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 3: + message.nextPageToken = reader.string(); + break; + case 4: + message.totalSize = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GroupFindingsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.GroupFindingsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.GroupFindingsResponse} GroupFindingsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GroupFindingsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GroupFindingsResponse message. + * @function verify + * @memberof google.cloud.securitycenter.v1.GroupFindingsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GroupFindingsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.groupByResults != null && message.hasOwnProperty("groupByResults")) { + if (!Array.isArray(message.groupByResults)) + return "groupByResults: array expected"; + for (var i = 0; i < message.groupByResults.length; ++i) { + var error = $root.google.cloud.securitycenter.v1.GroupResult.verify(message.groupByResults[i]); + if (error) + return "groupByResults." + error; + } + } + if (message.readTime != null && message.hasOwnProperty("readTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.readTime); + if (error) + return "readTime." + error; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.totalSize != null && message.hasOwnProperty("totalSize")) + if (!$util.isInteger(message.totalSize)) + return "totalSize: integer expected"; + return null; + }; + + /** + * Creates a GroupFindingsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.GroupFindingsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.GroupFindingsResponse} GroupFindingsResponse + */ + GroupFindingsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.GroupFindingsResponse) + return object; + var message = new $root.google.cloud.securitycenter.v1.GroupFindingsResponse(); + if (object.groupByResults) { + if (!Array.isArray(object.groupByResults)) + throw TypeError(".google.cloud.securitycenter.v1.GroupFindingsResponse.groupByResults: array expected"); + message.groupByResults = []; + for (var i = 0; i < object.groupByResults.length; ++i) { + if (typeof object.groupByResults[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v1.GroupFindingsResponse.groupByResults: object expected"); + message.groupByResults[i] = $root.google.cloud.securitycenter.v1.GroupResult.fromObject(object.groupByResults[i]); + } + } + if (object.readTime != null) { + if (typeof object.readTime !== "object") + throw TypeError(".google.cloud.securitycenter.v1.GroupFindingsResponse.readTime: object expected"); + message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.totalSize != null) + message.totalSize = object.totalSize | 0; + return message; + }; + + /** + * Creates a plain object from a GroupFindingsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.GroupFindingsResponse + * @static + * @param {google.cloud.securitycenter.v1.GroupFindingsResponse} message GroupFindingsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GroupFindingsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.groupByResults = []; + if (options.defaults) { + object.readTime = null; + object.nextPageToken = ""; + object.totalSize = 0; + } + if (message.groupByResults && message.groupByResults.length) { + object.groupByResults = []; + for (var j = 0; j < message.groupByResults.length; ++j) + object.groupByResults[j] = $root.google.cloud.securitycenter.v1.GroupResult.toObject(message.groupByResults[j], options); + } + if (message.readTime != null && message.hasOwnProperty("readTime")) + object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.totalSize != null && message.hasOwnProperty("totalSize")) + object.totalSize = message.totalSize; + return object; + }; + + /** + * Converts this GroupFindingsResponse to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.GroupFindingsResponse + * @instance + * @returns {Object.} JSON object + */ + GroupFindingsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GroupFindingsResponse; + })(); + + v1.GroupResult = (function() { + + /** + * Properties of a GroupResult. + * @memberof google.cloud.securitycenter.v1 + * @interface IGroupResult + * @property {Object.|null} [properties] GroupResult properties + * @property {number|Long|null} [count] GroupResult count + */ + + /** + * Constructs a new GroupResult. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a GroupResult. + * @implements IGroupResult + * @constructor + * @param {google.cloud.securitycenter.v1.IGroupResult=} [properties] Properties to set + */ + function GroupResult(properties) { + this.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]]; + } + + /** + * GroupResult properties. + * @member {Object.} properties + * @memberof google.cloud.securitycenter.v1.GroupResult + * @instance + */ + GroupResult.prototype.properties = $util.emptyObject; + + /** + * GroupResult count. + * @member {number|Long} count + * @memberof google.cloud.securitycenter.v1.GroupResult + * @instance + */ + GroupResult.prototype.count = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new GroupResult instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.GroupResult + * @static + * @param {google.cloud.securitycenter.v1.IGroupResult=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.GroupResult} GroupResult instance + */ + GroupResult.create = function create(properties) { + return new GroupResult(properties); + }; + + /** + * Encodes the specified GroupResult message. Does not implicitly {@link google.cloud.securitycenter.v1.GroupResult.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.GroupResult + * @static + * @param {google.cloud.securitycenter.v1.IGroupResult} message GroupResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroupResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.properties != null && message.hasOwnProperty("properties")) + for (var keys = Object.keys(message.properties), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.protobuf.Value.encode(message.properties[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.count != null && message.hasOwnProperty("count")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.count); + return writer; + }; + + /** + * Encodes the specified GroupResult message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.GroupResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.GroupResult + * @static + * @param {google.cloud.securitycenter.v1.IGroupResult} message GroupResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroupResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GroupResult message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.GroupResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.GroupResult} GroupResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GroupResult.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.cloud.securitycenter.v1.GroupResult(), key; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + reader.skip().pos++; + if (message.properties === $util.emptyObject) + message.properties = {}; + key = reader.string(); + reader.pos++; + message.properties[key] = $root.google.protobuf.Value.decode(reader, reader.uint32()); + break; + case 2: + message.count = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GroupResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.GroupResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.GroupResult} GroupResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GroupResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GroupResult message. + * @function verify + * @memberof google.cloud.securitycenter.v1.GroupResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GroupResult.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.properties != null && message.hasOwnProperty("properties")) { + if (!$util.isObject(message.properties)) + return "properties: object expected"; + var key = Object.keys(message.properties); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.protobuf.Value.verify(message.properties[key[i]]); + if (error) + return "properties." + error; + } + } + if (message.count != null && message.hasOwnProperty("count")) + if (!$util.isInteger(message.count) && !(message.count && $util.isInteger(message.count.low) && $util.isInteger(message.count.high))) + return "count: integer|Long expected"; + return null; + }; + + /** + * Creates a GroupResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.GroupResult + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.GroupResult} GroupResult + */ + GroupResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.GroupResult) + return object; + var message = new $root.google.cloud.securitycenter.v1.GroupResult(); + if (object.properties) { + if (typeof object.properties !== "object") + throw TypeError(".google.cloud.securitycenter.v1.GroupResult.properties: object expected"); + message.properties = {}; + for (var keys = Object.keys(object.properties), i = 0; i < keys.length; ++i) { + if (typeof object.properties[keys[i]] !== "object") + throw TypeError(".google.cloud.securitycenter.v1.GroupResult.properties: object expected"); + message.properties[keys[i]] = $root.google.protobuf.Value.fromObject(object.properties[keys[i]]); + } + } + if (object.count != null) + if ($util.Long) + (message.count = $util.Long.fromValue(object.count)).unsigned = false; + else if (typeof object.count === "string") + message.count = parseInt(object.count, 10); + else if (typeof object.count === "number") + message.count = object.count; + else if (typeof object.count === "object") + message.count = new $util.LongBits(object.count.low >>> 0, object.count.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a GroupResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.GroupResult + * @static + * @param {google.cloud.securitycenter.v1.GroupResult} message GroupResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GroupResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.properties = {}; + if (options.defaults) + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.count = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.count = options.longs === String ? "0" : 0; + var keys2; + if (message.properties && (keys2 = Object.keys(message.properties)).length) { + object.properties = {}; + for (var j = 0; j < keys2.length; ++j) + object.properties[keys2[j]] = $root.google.protobuf.Value.toObject(message.properties[keys2[j]], options); + } + if (message.count != null && message.hasOwnProperty("count")) + if (typeof message.count === "number") + object.count = options.longs === String ? String(message.count) : message.count; + else + object.count = options.longs === String ? $util.Long.prototype.toString.call(message.count) : options.longs === Number ? new $util.LongBits(message.count.low >>> 0, message.count.high >>> 0).toNumber() : message.count; + return object; + }; + + /** + * Converts this GroupResult to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.GroupResult + * @instance + * @returns {Object.} JSON object + */ + GroupResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GroupResult; + })(); + + v1.ListSourcesRequest = (function() { + + /** + * Properties of a ListSourcesRequest. + * @memberof google.cloud.securitycenter.v1 + * @interface IListSourcesRequest + * @property {string|null} [parent] ListSourcesRequest parent + * @property {string|null} [pageToken] ListSourcesRequest pageToken + * @property {number|null} [pageSize] ListSourcesRequest pageSize + */ + + /** + * Constructs a new ListSourcesRequest. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a ListSourcesRequest. + * @implements IListSourcesRequest + * @constructor + * @param {google.cloud.securitycenter.v1.IListSourcesRequest=} [properties] Properties to set + */ + function ListSourcesRequest(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]]; + } + + /** + * ListSourcesRequest parent. + * @member {string} parent + * @memberof google.cloud.securitycenter.v1.ListSourcesRequest + * @instance + */ + ListSourcesRequest.prototype.parent = ""; + + /** + * ListSourcesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.securitycenter.v1.ListSourcesRequest + * @instance + */ + ListSourcesRequest.prototype.pageToken = ""; + + /** + * ListSourcesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.securitycenter.v1.ListSourcesRequest + * @instance + */ + ListSourcesRequest.prototype.pageSize = 0; + + /** + * Creates a new ListSourcesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.ListSourcesRequest + * @static + * @param {google.cloud.securitycenter.v1.IListSourcesRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.ListSourcesRequest} ListSourcesRequest instance + */ + ListSourcesRequest.create = function create(properties) { + return new ListSourcesRequest(properties); + }; + + /** + * Encodes the specified ListSourcesRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.ListSourcesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.ListSourcesRequest + * @static + * @param {google.cloud.securitycenter.v1.IListSourcesRequest} message ListSourcesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSourcesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && message.hasOwnProperty("parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.pageToken); + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.pageSize); + return writer; + }; + + /** + * Encodes the specified ListSourcesRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListSourcesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.ListSourcesRequest + * @static + * @param {google.cloud.securitycenter.v1.IListSourcesRequest} message ListSourcesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSourcesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListSourcesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.ListSourcesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.ListSourcesRequest} ListSourcesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSourcesRequest.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.cloud.securitycenter.v1.ListSourcesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.pageToken = reader.string(); + break; + case 7: + message.pageSize = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListSourcesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.ListSourcesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.ListSourcesRequest} ListSourcesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSourcesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListSourcesRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1.ListSourcesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListSourcesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + return null; + }; + + /** + * Creates a ListSourcesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.ListSourcesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.ListSourcesRequest} ListSourcesRequest + */ + ListSourcesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.ListSourcesRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1.ListSourcesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + return message; + }; + + /** + * Creates a plain object from a ListSourcesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.ListSourcesRequest + * @static + * @param {google.cloud.securitycenter.v1.ListSourcesRequest} message ListSourcesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListSourcesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageToken = ""; + object.pageSize = 0; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + return object; + }; + + /** + * Converts this ListSourcesRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.ListSourcesRequest + * @instance + * @returns {Object.} JSON object + */ + ListSourcesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListSourcesRequest; + })(); + + v1.ListSourcesResponse = (function() { + + /** + * Properties of a ListSourcesResponse. + * @memberof google.cloud.securitycenter.v1 + * @interface IListSourcesResponse + * @property {Array.|null} [sources] ListSourcesResponse sources + * @property {string|null} [nextPageToken] ListSourcesResponse nextPageToken + */ + + /** + * Constructs a new ListSourcesResponse. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a ListSourcesResponse. + * @implements IListSourcesResponse + * @constructor + * @param {google.cloud.securitycenter.v1.IListSourcesResponse=} [properties] Properties to set + */ + function ListSourcesResponse(properties) { + this.sources = []; + 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]]; + } + + /** + * ListSourcesResponse sources. + * @member {Array.} sources + * @memberof google.cloud.securitycenter.v1.ListSourcesResponse + * @instance + */ + ListSourcesResponse.prototype.sources = $util.emptyArray; + + /** + * ListSourcesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.securitycenter.v1.ListSourcesResponse + * @instance + */ + ListSourcesResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListSourcesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.ListSourcesResponse + * @static + * @param {google.cloud.securitycenter.v1.IListSourcesResponse=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.ListSourcesResponse} ListSourcesResponse instance + */ + ListSourcesResponse.create = function create(properties) { + return new ListSourcesResponse(properties); + }; + + /** + * Encodes the specified ListSourcesResponse message. Does not implicitly {@link google.cloud.securitycenter.v1.ListSourcesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.ListSourcesResponse + * @static + * @param {google.cloud.securitycenter.v1.IListSourcesResponse} message ListSourcesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSourcesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.sources != null && message.sources.length) + for (var i = 0; i < message.sources.length; ++i) + $root.google.cloud.securitycenter.v1.Source.encode(message.sources[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListSourcesResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListSourcesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.ListSourcesResponse + * @static + * @param {google.cloud.securitycenter.v1.IListSourcesResponse} message ListSourcesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSourcesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListSourcesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.ListSourcesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.ListSourcesResponse} ListSourcesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSourcesResponse.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.cloud.securitycenter.v1.ListSourcesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.sources && message.sources.length)) + message.sources = []; + message.sources.push($root.google.cloud.securitycenter.v1.Source.decode(reader, reader.uint32())); + break; + case 2: + message.nextPageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListSourcesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.ListSourcesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.ListSourcesResponse} ListSourcesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSourcesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListSourcesResponse message. + * @function verify + * @memberof google.cloud.securitycenter.v1.ListSourcesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListSourcesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.sources != null && message.hasOwnProperty("sources")) { + if (!Array.isArray(message.sources)) + return "sources: array expected"; + for (var i = 0; i < message.sources.length; ++i) { + var error = $root.google.cloud.securitycenter.v1.Source.verify(message.sources[i]); + if (error) + return "sources." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListSourcesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.ListSourcesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.ListSourcesResponse} ListSourcesResponse + */ + ListSourcesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.ListSourcesResponse) + return object; + var message = new $root.google.cloud.securitycenter.v1.ListSourcesResponse(); + if (object.sources) { + if (!Array.isArray(object.sources)) + throw TypeError(".google.cloud.securitycenter.v1.ListSourcesResponse.sources: array expected"); + message.sources = []; + for (var i = 0; i < object.sources.length; ++i) { + if (typeof object.sources[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v1.ListSourcesResponse.sources: object expected"); + message.sources[i] = $root.google.cloud.securitycenter.v1.Source.fromObject(object.sources[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListSourcesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.ListSourcesResponse + * @static + * @param {google.cloud.securitycenter.v1.ListSourcesResponse} message ListSourcesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListSourcesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.sources = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.sources && message.sources.length) { + object.sources = []; + for (var j = 0; j < message.sources.length; ++j) + object.sources[j] = $root.google.cloud.securitycenter.v1.Source.toObject(message.sources[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListSourcesResponse to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.ListSourcesResponse + * @instance + * @returns {Object.} JSON object + */ + ListSourcesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListSourcesResponse; + })(); + + v1.ListAssetsRequest = (function() { + + /** + * Properties of a ListAssetsRequest. + * @memberof google.cloud.securitycenter.v1 + * @interface IListAssetsRequest + * @property {string|null} [parent] ListAssetsRequest parent + * @property {string|null} [filter] ListAssetsRequest filter + * @property {string|null} [orderBy] ListAssetsRequest orderBy + * @property {google.protobuf.ITimestamp|null} [readTime] ListAssetsRequest readTime + * @property {google.protobuf.IDuration|null} [compareDuration] ListAssetsRequest compareDuration + * @property {google.protobuf.IFieldMask|null} [fieldMask] ListAssetsRequest fieldMask + * @property {string|null} [pageToken] ListAssetsRequest pageToken + * @property {number|null} [pageSize] ListAssetsRequest pageSize + */ + + /** + * Constructs a new ListAssetsRequest. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a ListAssetsRequest. + * @implements IListAssetsRequest + * @constructor + * @param {google.cloud.securitycenter.v1.IListAssetsRequest=} [properties] Properties to set + */ + function ListAssetsRequest(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]]; + } + + /** + * ListAssetsRequest parent. + * @member {string} parent + * @memberof google.cloud.securitycenter.v1.ListAssetsRequest + * @instance + */ + ListAssetsRequest.prototype.parent = ""; + + /** + * ListAssetsRequest filter. + * @member {string} filter + * @memberof google.cloud.securitycenter.v1.ListAssetsRequest + * @instance + */ + ListAssetsRequest.prototype.filter = ""; + + /** + * ListAssetsRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.securitycenter.v1.ListAssetsRequest + * @instance + */ + ListAssetsRequest.prototype.orderBy = ""; + + /** + * ListAssetsRequest readTime. + * @member {google.protobuf.ITimestamp|null|undefined} readTime + * @memberof google.cloud.securitycenter.v1.ListAssetsRequest + * @instance + */ + ListAssetsRequest.prototype.readTime = null; + + /** + * ListAssetsRequest compareDuration. + * @member {google.protobuf.IDuration|null|undefined} compareDuration + * @memberof google.cloud.securitycenter.v1.ListAssetsRequest + * @instance + */ + ListAssetsRequest.prototype.compareDuration = null; + + /** + * ListAssetsRequest fieldMask. + * @member {google.protobuf.IFieldMask|null|undefined} fieldMask + * @memberof google.cloud.securitycenter.v1.ListAssetsRequest + * @instance + */ + ListAssetsRequest.prototype.fieldMask = null; + + /** + * ListAssetsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.securitycenter.v1.ListAssetsRequest + * @instance + */ + ListAssetsRequest.prototype.pageToken = ""; + + /** + * ListAssetsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.securitycenter.v1.ListAssetsRequest + * @instance + */ + ListAssetsRequest.prototype.pageSize = 0; + + /** + * Creates a new ListAssetsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.ListAssetsRequest + * @static + * @param {google.cloud.securitycenter.v1.IListAssetsRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.ListAssetsRequest} ListAssetsRequest instance + */ + ListAssetsRequest.create = function create(properties) { + return new ListAssetsRequest(properties); + }; + + /** + * Encodes the specified ListAssetsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.ListAssetsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.ListAssetsRequest + * @static + * @param {google.cloud.securitycenter.v1.IListAssetsRequest} message ListAssetsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAssetsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && message.hasOwnProperty("parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.filter != null && message.hasOwnProperty("filter")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.orderBy); + if (message.readTime != null && message.hasOwnProperty("readTime")) + $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.compareDuration != null && message.hasOwnProperty("compareDuration")) + $root.google.protobuf.Duration.encode(message.compareDuration, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.fieldMask != null && message.hasOwnProperty("fieldMask")) + $root.google.protobuf.FieldMask.encode(message.fieldMask, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.pageToken); + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.pageSize); + return writer; + }; + + /** + * Encodes the specified ListAssetsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListAssetsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.ListAssetsRequest + * @static + * @param {google.cloud.securitycenter.v1.IListAssetsRequest} message ListAssetsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAssetsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListAssetsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.ListAssetsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.ListAssetsRequest} ListAssetsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAssetsRequest.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.cloud.securitycenter.v1.ListAssetsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.filter = reader.string(); + break; + case 3: + message.orderBy = reader.string(); + break; + case 4: + message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 5: + message.compareDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + case 7: + message.fieldMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + case 8: + message.pageToken = reader.string(); + break; + case 9: + message.pageSize = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListAssetsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.ListAssetsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.ListAssetsRequest} ListAssetsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAssetsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListAssetsRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1.ListAssetsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListAssetsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + if (message.readTime != null && message.hasOwnProperty("readTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.readTime); + if (error) + return "readTime." + error; + } + if (message.compareDuration != null && message.hasOwnProperty("compareDuration")) { + var error = $root.google.protobuf.Duration.verify(message.compareDuration); + if (error) + return "compareDuration." + error; + } + if (message.fieldMask != null && message.hasOwnProperty("fieldMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.fieldMask); + if (error) + return "fieldMask." + error; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + return null; + }; + + /** + * Creates a ListAssetsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.ListAssetsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.ListAssetsRequest} ListAssetsRequest + */ + ListAssetsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.ListAssetsRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1.ListAssetsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.filter != null) + message.filter = String(object.filter); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.readTime != null) { + if (typeof object.readTime !== "object") + throw TypeError(".google.cloud.securitycenter.v1.ListAssetsRequest.readTime: object expected"); + message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); + } + if (object.compareDuration != null) { + if (typeof object.compareDuration !== "object") + throw TypeError(".google.cloud.securitycenter.v1.ListAssetsRequest.compareDuration: object expected"); + message.compareDuration = $root.google.protobuf.Duration.fromObject(object.compareDuration); + } + if (object.fieldMask != null) { + if (typeof object.fieldMask !== "object") + throw TypeError(".google.cloud.securitycenter.v1.ListAssetsRequest.fieldMask: object expected"); + message.fieldMask = $root.google.protobuf.FieldMask.fromObject(object.fieldMask); + } + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + return message; + }; + + /** + * Creates a plain object from a ListAssetsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.ListAssetsRequest + * @static + * @param {google.cloud.securitycenter.v1.ListAssetsRequest} message ListAssetsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListAssetsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.filter = ""; + object.orderBy = ""; + object.readTime = null; + object.compareDuration = null; + object.fieldMask = null; + object.pageToken = ""; + object.pageSize = 0; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; + if (message.readTime != null && message.hasOwnProperty("readTime")) + object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); + if (message.compareDuration != null && message.hasOwnProperty("compareDuration")) + object.compareDuration = $root.google.protobuf.Duration.toObject(message.compareDuration, options); + if (message.fieldMask != null && message.hasOwnProperty("fieldMask")) + object.fieldMask = $root.google.protobuf.FieldMask.toObject(message.fieldMask, options); + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + return object; + }; + + /** + * Converts this ListAssetsRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.ListAssetsRequest + * @instance + * @returns {Object.} JSON object + */ + ListAssetsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListAssetsRequest; + })(); + + v1.ListAssetsResponse = (function() { + + /** + * Properties of a ListAssetsResponse. + * @memberof google.cloud.securitycenter.v1 + * @interface IListAssetsResponse + * @property {Array.|null} [listAssetsResults] ListAssetsResponse listAssetsResults + * @property {google.protobuf.ITimestamp|null} [readTime] ListAssetsResponse readTime + * @property {string|null} [nextPageToken] ListAssetsResponse nextPageToken + * @property {number|null} [totalSize] ListAssetsResponse totalSize + */ + + /** + * Constructs a new ListAssetsResponse. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a ListAssetsResponse. + * @implements IListAssetsResponse + * @constructor + * @param {google.cloud.securitycenter.v1.IListAssetsResponse=} [properties] Properties to set + */ + function ListAssetsResponse(properties) { + this.listAssetsResults = []; + 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]]; + } + + /** + * ListAssetsResponse listAssetsResults. + * @member {Array.} listAssetsResults + * @memberof google.cloud.securitycenter.v1.ListAssetsResponse + * @instance + */ + ListAssetsResponse.prototype.listAssetsResults = $util.emptyArray; + + /** + * ListAssetsResponse readTime. + * @member {google.protobuf.ITimestamp|null|undefined} readTime + * @memberof google.cloud.securitycenter.v1.ListAssetsResponse + * @instance + */ + ListAssetsResponse.prototype.readTime = null; + + /** + * ListAssetsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.securitycenter.v1.ListAssetsResponse + * @instance + */ + ListAssetsResponse.prototype.nextPageToken = ""; + + /** + * ListAssetsResponse totalSize. + * @member {number} totalSize + * @memberof google.cloud.securitycenter.v1.ListAssetsResponse + * @instance + */ + ListAssetsResponse.prototype.totalSize = 0; + + /** + * Creates a new ListAssetsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.ListAssetsResponse + * @static + * @param {google.cloud.securitycenter.v1.IListAssetsResponse=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.ListAssetsResponse} ListAssetsResponse instance + */ + ListAssetsResponse.create = function create(properties) { + return new ListAssetsResponse(properties); + }; + + /** + * Encodes the specified ListAssetsResponse message. Does not implicitly {@link google.cloud.securitycenter.v1.ListAssetsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.ListAssetsResponse + * @static + * @param {google.cloud.securitycenter.v1.IListAssetsResponse} message ListAssetsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAssetsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.listAssetsResults != null && message.listAssetsResults.length) + for (var i = 0; i < message.listAssetsResults.length; ++i) + $root.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult.encode(message.listAssetsResults[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.readTime != null && message.hasOwnProperty("readTime")) + $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.nextPageToken); + if (message.totalSize != null && message.hasOwnProperty("totalSize")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.totalSize); + return writer; + }; + + /** + * Encodes the specified ListAssetsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListAssetsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.ListAssetsResponse + * @static + * @param {google.cloud.securitycenter.v1.IListAssetsResponse} message ListAssetsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAssetsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListAssetsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.ListAssetsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.ListAssetsResponse} ListAssetsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAssetsResponse.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.cloud.securitycenter.v1.ListAssetsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.listAssetsResults && message.listAssetsResults.length)) + message.listAssetsResults = []; + message.listAssetsResults.push($root.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult.decode(reader, reader.uint32())); + break; + case 2: + message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 3: + message.nextPageToken = reader.string(); + break; + case 4: + message.totalSize = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListAssetsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.ListAssetsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.ListAssetsResponse} ListAssetsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAssetsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListAssetsResponse message. + * @function verify + * @memberof google.cloud.securitycenter.v1.ListAssetsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListAssetsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.listAssetsResults != null && message.hasOwnProperty("listAssetsResults")) { + if (!Array.isArray(message.listAssetsResults)) + return "listAssetsResults: array expected"; + for (var i = 0; i < message.listAssetsResults.length; ++i) { + var error = $root.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult.verify(message.listAssetsResults[i]); + if (error) + return "listAssetsResults." + error; + } + } + if (message.readTime != null && message.hasOwnProperty("readTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.readTime); + if (error) + return "readTime." + error; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.totalSize != null && message.hasOwnProperty("totalSize")) + if (!$util.isInteger(message.totalSize)) + return "totalSize: integer expected"; + return null; + }; + + /** + * Creates a ListAssetsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.ListAssetsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.ListAssetsResponse} ListAssetsResponse + */ + ListAssetsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.ListAssetsResponse) + return object; + var message = new $root.google.cloud.securitycenter.v1.ListAssetsResponse(); + if (object.listAssetsResults) { + if (!Array.isArray(object.listAssetsResults)) + throw TypeError(".google.cloud.securitycenter.v1.ListAssetsResponse.listAssetsResults: array expected"); + message.listAssetsResults = []; + for (var i = 0; i < object.listAssetsResults.length; ++i) { + if (typeof object.listAssetsResults[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v1.ListAssetsResponse.listAssetsResults: object expected"); + message.listAssetsResults[i] = $root.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult.fromObject(object.listAssetsResults[i]); + } + } + if (object.readTime != null) { + if (typeof object.readTime !== "object") + throw TypeError(".google.cloud.securitycenter.v1.ListAssetsResponse.readTime: object expected"); + message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.totalSize != null) + message.totalSize = object.totalSize | 0; + return message; + }; + + /** + * Creates a plain object from a ListAssetsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.ListAssetsResponse + * @static + * @param {google.cloud.securitycenter.v1.ListAssetsResponse} message ListAssetsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListAssetsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.listAssetsResults = []; + if (options.defaults) { + object.readTime = null; + object.nextPageToken = ""; + object.totalSize = 0; + } + if (message.listAssetsResults && message.listAssetsResults.length) { + object.listAssetsResults = []; + for (var j = 0; j < message.listAssetsResults.length; ++j) + object.listAssetsResults[j] = $root.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult.toObject(message.listAssetsResults[j], options); + } + if (message.readTime != null && message.hasOwnProperty("readTime")) + object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.totalSize != null && message.hasOwnProperty("totalSize")) + object.totalSize = message.totalSize; + return object; + }; + + /** + * Converts this ListAssetsResponse to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.ListAssetsResponse + * @instance + * @returns {Object.} JSON object + */ + ListAssetsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + ListAssetsResponse.ListAssetsResult = (function() { + + /** + * Properties of a ListAssetsResult. + * @memberof google.cloud.securitycenter.v1.ListAssetsResponse + * @interface IListAssetsResult + * @property {google.cloud.securitycenter.v1.IAsset|null} [asset] ListAssetsResult asset + * @property {google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult.StateChange|null} [stateChange] ListAssetsResult stateChange + */ + + /** + * Constructs a new ListAssetsResult. + * @memberof google.cloud.securitycenter.v1.ListAssetsResponse + * @classdesc Represents a ListAssetsResult. + * @implements IListAssetsResult + * @constructor + * @param {google.cloud.securitycenter.v1.ListAssetsResponse.IListAssetsResult=} [properties] Properties to set + */ + function ListAssetsResult(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]]; + } + + /** + * ListAssetsResult asset. + * @member {google.cloud.securitycenter.v1.IAsset|null|undefined} asset + * @memberof google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult + * @instance + */ + ListAssetsResult.prototype.asset = null; + + /** + * ListAssetsResult stateChange. + * @member {google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult.StateChange} stateChange + * @memberof google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult + * @instance + */ + ListAssetsResult.prototype.stateChange = 0; + + /** + * Creates a new ListAssetsResult instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult + * @static + * @param {google.cloud.securitycenter.v1.ListAssetsResponse.IListAssetsResult=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult} ListAssetsResult instance + */ + ListAssetsResult.create = function create(properties) { + return new ListAssetsResult(properties); + }; + + /** + * Encodes the specified ListAssetsResult message. Does not implicitly {@link google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult + * @static + * @param {google.cloud.securitycenter.v1.ListAssetsResponse.IListAssetsResult} message ListAssetsResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAssetsResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.asset != null && message.hasOwnProperty("asset")) + $root.google.cloud.securitycenter.v1.Asset.encode(message.asset, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.stateChange != null && message.hasOwnProperty("stateChange")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.stateChange); + return writer; + }; + + /** + * Encodes the specified ListAssetsResult message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult + * @static + * @param {google.cloud.securitycenter.v1.ListAssetsResponse.IListAssetsResult} message ListAssetsResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAssetsResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListAssetsResult message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult} ListAssetsResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAssetsResult.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.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.asset = $root.google.cloud.securitycenter.v1.Asset.decode(reader, reader.uint32()); + break; + case 2: + message.stateChange = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListAssetsResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult} ListAssetsResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAssetsResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListAssetsResult message. + * @function verify + * @memberof google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListAssetsResult.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.asset != null && message.hasOwnProperty("asset")) { + var error = $root.google.cloud.securitycenter.v1.Asset.verify(message.asset); + if (error) + return "asset." + error; + } + if (message.stateChange != null && message.hasOwnProperty("stateChange")) + switch (message.stateChange) { + default: + return "stateChange: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + return null; + }; + + /** + * Creates a ListAssetsResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult} ListAssetsResult + */ + ListAssetsResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult) + return object; + var message = new $root.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult(); + if (object.asset != null) { + if (typeof object.asset !== "object") + throw TypeError(".google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult.asset: object expected"); + message.asset = $root.google.cloud.securitycenter.v1.Asset.fromObject(object.asset); + } + switch (object.stateChange) { + case "UNUSED": + case 0: + message.stateChange = 0; + break; + case "ADDED": + case 1: + message.stateChange = 1; + break; + case "REMOVED": + case 2: + message.stateChange = 2; + break; + case "ACTIVE": + case 3: + message.stateChange = 3; + break; + } + return message; + }; + + /** + * Creates a plain object from a ListAssetsResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult + * @static + * @param {google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult} message ListAssetsResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListAssetsResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.asset = null; + object.stateChange = options.enums === String ? "UNUSED" : 0; + } + if (message.asset != null && message.hasOwnProperty("asset")) + object.asset = $root.google.cloud.securitycenter.v1.Asset.toObject(message.asset, options); + if (message.stateChange != null && message.hasOwnProperty("stateChange")) + object.stateChange = options.enums === String ? $root.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult.StateChange[message.stateChange] : message.stateChange; + return object; + }; + + /** + * Converts this ListAssetsResult to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult + * @instance + * @returns {Object.} JSON object + */ + ListAssetsResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * StateChange enum. + * @name google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult.StateChange + * @enum {string} + * @property {number} UNUSED=0 UNUSED value + * @property {number} ADDED=1 ADDED value + * @property {number} REMOVED=2 REMOVED value + * @property {number} ACTIVE=3 ACTIVE value + */ + ListAssetsResult.StateChange = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNUSED"] = 0; + values[valuesById[1] = "ADDED"] = 1; + values[valuesById[2] = "REMOVED"] = 2; + values[valuesById[3] = "ACTIVE"] = 3; + return values; + })(); + + return ListAssetsResult; + })(); + + return ListAssetsResponse; + })(); + + v1.ListFindingsRequest = (function() { + + /** + * Properties of a ListFindingsRequest. + * @memberof google.cloud.securitycenter.v1 + * @interface IListFindingsRequest + * @property {string|null} [parent] ListFindingsRequest parent + * @property {string|null} [filter] ListFindingsRequest filter + * @property {string|null} [orderBy] ListFindingsRequest orderBy + * @property {google.protobuf.ITimestamp|null} [readTime] ListFindingsRequest readTime + * @property {google.protobuf.IDuration|null} [compareDuration] ListFindingsRequest compareDuration + * @property {google.protobuf.IFieldMask|null} [fieldMask] ListFindingsRequest fieldMask + * @property {string|null} [pageToken] ListFindingsRequest pageToken + * @property {number|null} [pageSize] ListFindingsRequest pageSize + */ + + /** + * Constructs a new ListFindingsRequest. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a ListFindingsRequest. + * @implements IListFindingsRequest + * @constructor + * @param {google.cloud.securitycenter.v1.IListFindingsRequest=} [properties] Properties to set + */ + function ListFindingsRequest(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]]; + } + + /** + * ListFindingsRequest parent. + * @member {string} parent + * @memberof google.cloud.securitycenter.v1.ListFindingsRequest + * @instance + */ + ListFindingsRequest.prototype.parent = ""; + + /** + * ListFindingsRequest filter. + * @member {string} filter + * @memberof google.cloud.securitycenter.v1.ListFindingsRequest + * @instance + */ + ListFindingsRequest.prototype.filter = ""; + + /** + * ListFindingsRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.securitycenter.v1.ListFindingsRequest + * @instance + */ + ListFindingsRequest.prototype.orderBy = ""; + + /** + * ListFindingsRequest readTime. + * @member {google.protobuf.ITimestamp|null|undefined} readTime + * @memberof google.cloud.securitycenter.v1.ListFindingsRequest + * @instance + */ + ListFindingsRequest.prototype.readTime = null; + + /** + * ListFindingsRequest compareDuration. + * @member {google.protobuf.IDuration|null|undefined} compareDuration + * @memberof google.cloud.securitycenter.v1.ListFindingsRequest + * @instance + */ + ListFindingsRequest.prototype.compareDuration = null; + + /** + * ListFindingsRequest fieldMask. + * @member {google.protobuf.IFieldMask|null|undefined} fieldMask + * @memberof google.cloud.securitycenter.v1.ListFindingsRequest + * @instance + */ + ListFindingsRequest.prototype.fieldMask = null; + + /** + * ListFindingsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.securitycenter.v1.ListFindingsRequest + * @instance + */ + ListFindingsRequest.prototype.pageToken = ""; + + /** + * ListFindingsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.securitycenter.v1.ListFindingsRequest + * @instance + */ + ListFindingsRequest.prototype.pageSize = 0; + + /** + * Creates a new ListFindingsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.ListFindingsRequest + * @static + * @param {google.cloud.securitycenter.v1.IListFindingsRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.ListFindingsRequest} ListFindingsRequest instance + */ + ListFindingsRequest.create = function create(properties) { + return new ListFindingsRequest(properties); + }; + + /** + * Encodes the specified ListFindingsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.ListFindingsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.ListFindingsRequest + * @static + * @param {google.cloud.securitycenter.v1.IListFindingsRequest} message ListFindingsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListFindingsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && message.hasOwnProperty("parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.filter != null && message.hasOwnProperty("filter")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.orderBy); + if (message.readTime != null && message.hasOwnProperty("readTime")) + $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.compareDuration != null && message.hasOwnProperty("compareDuration")) + $root.google.protobuf.Duration.encode(message.compareDuration, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.fieldMask != null && message.hasOwnProperty("fieldMask")) + $root.google.protobuf.FieldMask.encode(message.fieldMask, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.pageToken); + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.pageSize); + return writer; + }; + + /** + * Encodes the specified ListFindingsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListFindingsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.ListFindingsRequest + * @static + * @param {google.cloud.securitycenter.v1.IListFindingsRequest} message ListFindingsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListFindingsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListFindingsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.ListFindingsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.ListFindingsRequest} ListFindingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListFindingsRequest.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.cloud.securitycenter.v1.ListFindingsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.filter = reader.string(); + break; + case 3: + message.orderBy = reader.string(); + break; + case 4: + message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 5: + message.compareDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + case 7: + message.fieldMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + case 8: + message.pageToken = reader.string(); + break; + case 9: + message.pageSize = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListFindingsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.ListFindingsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.ListFindingsRequest} ListFindingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListFindingsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListFindingsRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1.ListFindingsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListFindingsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + if (message.readTime != null && message.hasOwnProperty("readTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.readTime); + if (error) + return "readTime." + error; + } + if (message.compareDuration != null && message.hasOwnProperty("compareDuration")) { + var error = $root.google.protobuf.Duration.verify(message.compareDuration); + if (error) + return "compareDuration." + error; + } + if (message.fieldMask != null && message.hasOwnProperty("fieldMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.fieldMask); + if (error) + return "fieldMask." + error; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + return null; + }; + + /** + * Creates a ListFindingsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.ListFindingsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.ListFindingsRequest} ListFindingsRequest + */ + ListFindingsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.ListFindingsRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1.ListFindingsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.filter != null) + message.filter = String(object.filter); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.readTime != null) { + if (typeof object.readTime !== "object") + throw TypeError(".google.cloud.securitycenter.v1.ListFindingsRequest.readTime: object expected"); + message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); + } + if (object.compareDuration != null) { + if (typeof object.compareDuration !== "object") + throw TypeError(".google.cloud.securitycenter.v1.ListFindingsRequest.compareDuration: object expected"); + message.compareDuration = $root.google.protobuf.Duration.fromObject(object.compareDuration); + } + if (object.fieldMask != null) { + if (typeof object.fieldMask !== "object") + throw TypeError(".google.cloud.securitycenter.v1.ListFindingsRequest.fieldMask: object expected"); + message.fieldMask = $root.google.protobuf.FieldMask.fromObject(object.fieldMask); + } + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + return message; + }; + + /** + * Creates a plain object from a ListFindingsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.ListFindingsRequest + * @static + * @param {google.cloud.securitycenter.v1.ListFindingsRequest} message ListFindingsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListFindingsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.filter = ""; + object.orderBy = ""; + object.readTime = null; + object.compareDuration = null; + object.fieldMask = null; + object.pageToken = ""; + object.pageSize = 0; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; + if (message.readTime != null && message.hasOwnProperty("readTime")) + object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); + if (message.compareDuration != null && message.hasOwnProperty("compareDuration")) + object.compareDuration = $root.google.protobuf.Duration.toObject(message.compareDuration, options); + if (message.fieldMask != null && message.hasOwnProperty("fieldMask")) + object.fieldMask = $root.google.protobuf.FieldMask.toObject(message.fieldMask, options); + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + return object; + }; + + /** + * Converts this ListFindingsRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.ListFindingsRequest + * @instance + * @returns {Object.} JSON object + */ + ListFindingsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListFindingsRequest; + })(); + + v1.ListFindingsResponse = (function() { + + /** + * Properties of a ListFindingsResponse. + * @memberof google.cloud.securitycenter.v1 + * @interface IListFindingsResponse + * @property {Array.|null} [listFindingsResults] ListFindingsResponse listFindingsResults + * @property {google.protobuf.ITimestamp|null} [readTime] ListFindingsResponse readTime + * @property {string|null} [nextPageToken] ListFindingsResponse nextPageToken + * @property {number|null} [totalSize] ListFindingsResponse totalSize + */ + + /** + * Constructs a new ListFindingsResponse. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a ListFindingsResponse. + * @implements IListFindingsResponse + * @constructor + * @param {google.cloud.securitycenter.v1.IListFindingsResponse=} [properties] Properties to set + */ + function ListFindingsResponse(properties) { + this.listFindingsResults = []; + 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]]; + } + + /** + * ListFindingsResponse listFindingsResults. + * @member {Array.} listFindingsResults + * @memberof google.cloud.securitycenter.v1.ListFindingsResponse + * @instance + */ + ListFindingsResponse.prototype.listFindingsResults = $util.emptyArray; + + /** + * ListFindingsResponse readTime. + * @member {google.protobuf.ITimestamp|null|undefined} readTime + * @memberof google.cloud.securitycenter.v1.ListFindingsResponse + * @instance + */ + ListFindingsResponse.prototype.readTime = null; + + /** + * ListFindingsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.securitycenter.v1.ListFindingsResponse + * @instance + */ + ListFindingsResponse.prototype.nextPageToken = ""; + + /** + * ListFindingsResponse totalSize. + * @member {number} totalSize + * @memberof google.cloud.securitycenter.v1.ListFindingsResponse + * @instance + */ + ListFindingsResponse.prototype.totalSize = 0; + + /** + * Creates a new ListFindingsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.ListFindingsResponse + * @static + * @param {google.cloud.securitycenter.v1.IListFindingsResponse=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.ListFindingsResponse} ListFindingsResponse instance + */ + ListFindingsResponse.create = function create(properties) { + return new ListFindingsResponse(properties); + }; + + /** + * Encodes the specified ListFindingsResponse message. Does not implicitly {@link google.cloud.securitycenter.v1.ListFindingsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.ListFindingsResponse + * @static + * @param {google.cloud.securitycenter.v1.IListFindingsResponse} message ListFindingsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListFindingsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.listFindingsResults != null && message.listFindingsResults.length) + for (var i = 0; i < message.listFindingsResults.length; ++i) + $root.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.encode(message.listFindingsResults[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.readTime != null && message.hasOwnProperty("readTime")) + $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.nextPageToken); + if (message.totalSize != null && message.hasOwnProperty("totalSize")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.totalSize); + return writer; + }; + + /** + * Encodes the specified ListFindingsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListFindingsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.ListFindingsResponse + * @static + * @param {google.cloud.securitycenter.v1.IListFindingsResponse} message ListFindingsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListFindingsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListFindingsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.ListFindingsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.ListFindingsResponse} ListFindingsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListFindingsResponse.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.cloud.securitycenter.v1.ListFindingsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.listFindingsResults && message.listFindingsResults.length)) + message.listFindingsResults = []; + message.listFindingsResults.push($root.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.decode(reader, reader.uint32())); + break; + case 2: + message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 3: + message.nextPageToken = reader.string(); + break; + case 4: + message.totalSize = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListFindingsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.ListFindingsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.ListFindingsResponse} ListFindingsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListFindingsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListFindingsResponse message. + * @function verify + * @memberof google.cloud.securitycenter.v1.ListFindingsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListFindingsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.listFindingsResults != null && message.hasOwnProperty("listFindingsResults")) { + if (!Array.isArray(message.listFindingsResults)) + return "listFindingsResults: array expected"; + for (var i = 0; i < message.listFindingsResults.length; ++i) { + var error = $root.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.verify(message.listFindingsResults[i]); + if (error) + return "listFindingsResults." + error; + } + } + if (message.readTime != null && message.hasOwnProperty("readTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.readTime); + if (error) + return "readTime." + error; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.totalSize != null && message.hasOwnProperty("totalSize")) + if (!$util.isInteger(message.totalSize)) + return "totalSize: integer expected"; + return null; + }; + + /** + * Creates a ListFindingsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.ListFindingsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.ListFindingsResponse} ListFindingsResponse + */ + ListFindingsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.ListFindingsResponse) + return object; + var message = new $root.google.cloud.securitycenter.v1.ListFindingsResponse(); + if (object.listFindingsResults) { + if (!Array.isArray(object.listFindingsResults)) + throw TypeError(".google.cloud.securitycenter.v1.ListFindingsResponse.listFindingsResults: array expected"); + message.listFindingsResults = []; + for (var i = 0; i < object.listFindingsResults.length; ++i) { + if (typeof object.listFindingsResults[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v1.ListFindingsResponse.listFindingsResults: object expected"); + message.listFindingsResults[i] = $root.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.fromObject(object.listFindingsResults[i]); + } + } + if (object.readTime != null) { + if (typeof object.readTime !== "object") + throw TypeError(".google.cloud.securitycenter.v1.ListFindingsResponse.readTime: object expected"); + message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.totalSize != null) + message.totalSize = object.totalSize | 0; + return message; + }; + + /** + * Creates a plain object from a ListFindingsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.ListFindingsResponse + * @static + * @param {google.cloud.securitycenter.v1.ListFindingsResponse} message ListFindingsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListFindingsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.listFindingsResults = []; + if (options.defaults) { + object.readTime = null; + object.nextPageToken = ""; + object.totalSize = 0; + } + if (message.listFindingsResults && message.listFindingsResults.length) { + object.listFindingsResults = []; + for (var j = 0; j < message.listFindingsResults.length; ++j) + object.listFindingsResults[j] = $root.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.toObject(message.listFindingsResults[j], options); + } + if (message.readTime != null && message.hasOwnProperty("readTime")) + object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.totalSize != null && message.hasOwnProperty("totalSize")) + object.totalSize = message.totalSize; + return object; + }; + + /** + * Converts this ListFindingsResponse to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.ListFindingsResponse + * @instance + * @returns {Object.} JSON object + */ + ListFindingsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + ListFindingsResponse.ListFindingsResult = (function() { + + /** + * Properties of a ListFindingsResult. + * @memberof google.cloud.securitycenter.v1.ListFindingsResponse + * @interface IListFindingsResult + * @property {google.cloud.securitycenter.v1.IFinding|null} [finding] ListFindingsResult finding + * @property {google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.StateChange|null} [stateChange] ListFindingsResult stateChange + */ + + /** + * Constructs a new ListFindingsResult. + * @memberof google.cloud.securitycenter.v1.ListFindingsResponse + * @classdesc Represents a ListFindingsResult. + * @implements IListFindingsResult + * @constructor + * @param {google.cloud.securitycenter.v1.ListFindingsResponse.IListFindingsResult=} [properties] Properties to set + */ + function ListFindingsResult(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]]; + } + + /** + * ListFindingsResult finding. + * @member {google.cloud.securitycenter.v1.IFinding|null|undefined} finding + * @memberof google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult + * @instance + */ + ListFindingsResult.prototype.finding = null; + + /** + * ListFindingsResult stateChange. + * @member {google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.StateChange} stateChange + * @memberof google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult + * @instance + */ + ListFindingsResult.prototype.stateChange = 0; + + /** + * Creates a new ListFindingsResult instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult + * @static + * @param {google.cloud.securitycenter.v1.ListFindingsResponse.IListFindingsResult=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult} ListFindingsResult instance + */ + ListFindingsResult.create = function create(properties) { + return new ListFindingsResult(properties); + }; + + /** + * Encodes the specified ListFindingsResult message. Does not implicitly {@link google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult + * @static + * @param {google.cloud.securitycenter.v1.ListFindingsResponse.IListFindingsResult} message ListFindingsResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListFindingsResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.finding != null && message.hasOwnProperty("finding")) + $root.google.cloud.securitycenter.v1.Finding.encode(message.finding, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.stateChange != null && message.hasOwnProperty("stateChange")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.stateChange); + return writer; + }; + + /** + * Encodes the specified ListFindingsResult message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult + * @static + * @param {google.cloud.securitycenter.v1.ListFindingsResponse.IListFindingsResult} message ListFindingsResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListFindingsResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListFindingsResult message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult} ListFindingsResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListFindingsResult.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.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.finding = $root.google.cloud.securitycenter.v1.Finding.decode(reader, reader.uint32()); + break; + case 2: + message.stateChange = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListFindingsResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult} ListFindingsResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListFindingsResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListFindingsResult message. + * @function verify + * @memberof google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListFindingsResult.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.finding != null && message.hasOwnProperty("finding")) { + var error = $root.google.cloud.securitycenter.v1.Finding.verify(message.finding); + if (error) + return "finding." + error; + } + if (message.stateChange != null && message.hasOwnProperty("stateChange")) + switch (message.stateChange) { + default: + return "stateChange: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + return null; + }; + + /** + * Creates a ListFindingsResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult} ListFindingsResult + */ + ListFindingsResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult) + return object; + var message = new $root.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult(); + if (object.finding != null) { + if (typeof object.finding !== "object") + throw TypeError(".google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.finding: object expected"); + message.finding = $root.google.cloud.securitycenter.v1.Finding.fromObject(object.finding); + } + switch (object.stateChange) { + case "UNUSED": + case 0: + message.stateChange = 0; + break; + case "CHANGED": + case 1: + message.stateChange = 1; + break; + case "UNCHANGED": + case 2: + message.stateChange = 2; + break; + case "ADDED": + case 3: + message.stateChange = 3; + break; + case "REMOVED": + case 4: + message.stateChange = 4; + break; + } + return message; + }; + + /** + * Creates a plain object from a ListFindingsResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult + * @static + * @param {google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult} message ListFindingsResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListFindingsResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.finding = null; + object.stateChange = options.enums === String ? "UNUSED" : 0; + } + if (message.finding != null && message.hasOwnProperty("finding")) + object.finding = $root.google.cloud.securitycenter.v1.Finding.toObject(message.finding, options); + if (message.stateChange != null && message.hasOwnProperty("stateChange")) + object.stateChange = options.enums === String ? $root.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.StateChange[message.stateChange] : message.stateChange; + return object; + }; + + /** + * Converts this ListFindingsResult to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult + * @instance + * @returns {Object.} JSON object + */ + ListFindingsResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * StateChange enum. + * @name google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.StateChange + * @enum {string} + * @property {number} UNUSED=0 UNUSED value + * @property {number} CHANGED=1 CHANGED value + * @property {number} UNCHANGED=2 UNCHANGED value + * @property {number} ADDED=3 ADDED value + * @property {number} REMOVED=4 REMOVED value + */ + ListFindingsResult.StateChange = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNUSED"] = 0; + values[valuesById[1] = "CHANGED"] = 1; + values[valuesById[2] = "UNCHANGED"] = 2; + values[valuesById[3] = "ADDED"] = 3; + values[valuesById[4] = "REMOVED"] = 4; + return values; + })(); + + return ListFindingsResult; + })(); + + return ListFindingsResponse; + })(); + + v1.SetFindingStateRequest = (function() { + + /** + * Properties of a SetFindingStateRequest. + * @memberof google.cloud.securitycenter.v1 + * @interface ISetFindingStateRequest + * @property {string|null} [name] SetFindingStateRequest name + * @property {google.cloud.securitycenter.v1.Finding.State|null} [state] SetFindingStateRequest state + * @property {google.protobuf.ITimestamp|null} [startTime] SetFindingStateRequest startTime + */ + + /** + * Constructs a new SetFindingStateRequest. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a SetFindingStateRequest. + * @implements ISetFindingStateRequest + * @constructor + * @param {google.cloud.securitycenter.v1.ISetFindingStateRequest=} [properties] Properties to set + */ + function SetFindingStateRequest(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]]; + } + + /** + * SetFindingStateRequest name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1.SetFindingStateRequest + * @instance + */ + SetFindingStateRequest.prototype.name = ""; + + /** + * SetFindingStateRequest state. + * @member {google.cloud.securitycenter.v1.Finding.State} state + * @memberof google.cloud.securitycenter.v1.SetFindingStateRequest + * @instance + */ + SetFindingStateRequest.prototype.state = 0; + + /** + * SetFindingStateRequest startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.cloud.securitycenter.v1.SetFindingStateRequest + * @instance + */ + SetFindingStateRequest.prototype.startTime = null; + + /** + * Creates a new SetFindingStateRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.SetFindingStateRequest + * @static + * @param {google.cloud.securitycenter.v1.ISetFindingStateRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.SetFindingStateRequest} SetFindingStateRequest instance + */ + SetFindingStateRequest.create = function create(properties) { + return new SetFindingStateRequest(properties); + }; + + /** + * Encodes the specified SetFindingStateRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.SetFindingStateRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.SetFindingStateRequest + * @static + * @param {google.cloud.securitycenter.v1.ISetFindingStateRequest} message SetFindingStateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetFindingStateRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.state != null && message.hasOwnProperty("state")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.state); + if (message.startTime != null && message.hasOwnProperty("startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SetFindingStateRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.SetFindingStateRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.SetFindingStateRequest + * @static + * @param {google.cloud.securitycenter.v1.ISetFindingStateRequest} message SetFindingStateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetFindingStateRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SetFindingStateRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.SetFindingStateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.SetFindingStateRequest} SetFindingStateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetFindingStateRequest.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.cloud.securitycenter.v1.SetFindingStateRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.state = reader.int32(); + break; + case 3: + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SetFindingStateRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.SetFindingStateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.SetFindingStateRequest} SetFindingStateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetFindingStateRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SetFindingStateRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1.SetFindingStateRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SetFindingStateRequest.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.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.startTime != null && message.hasOwnProperty("startTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.startTime); + if (error) + return "startTime." + error; + } + return null; + }; + + /** + * Creates a SetFindingStateRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.SetFindingStateRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.SetFindingStateRequest} SetFindingStateRequest + */ + SetFindingStateRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.SetFindingStateRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1.SetFindingStateRequest(); + if (object.name != null) + message.name = String(object.name); + switch (object.state) { + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "ACTIVE": + case 1: + message.state = 1; + break; + case "INACTIVE": + case 2: + message.state = 2; + break; + } + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.cloud.securitycenter.v1.SetFindingStateRequest.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); + } + return message; + }; + + /** + * Creates a plain object from a SetFindingStateRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.SetFindingStateRequest + * @static + * @param {google.cloud.securitycenter.v1.SetFindingStateRequest} message SetFindingStateRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SetFindingStateRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.startTime = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.securitycenter.v1.Finding.State[message.state] : message.state; + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); + return object; + }; + + /** + * Converts this SetFindingStateRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.SetFindingStateRequest + * @instance + * @returns {Object.} JSON object + */ + SetFindingStateRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SetFindingStateRequest; + })(); + + v1.RunAssetDiscoveryRequest = (function() { + + /** + * Properties of a RunAssetDiscoveryRequest. + * @memberof google.cloud.securitycenter.v1 + * @interface IRunAssetDiscoveryRequest + * @property {string|null} [parent] RunAssetDiscoveryRequest parent + */ + + /** + * Constructs a new RunAssetDiscoveryRequest. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a RunAssetDiscoveryRequest. + * @implements IRunAssetDiscoveryRequest + * @constructor + * @param {google.cloud.securitycenter.v1.IRunAssetDiscoveryRequest=} [properties] Properties to set + */ + function RunAssetDiscoveryRequest(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]]; + } + + /** + * RunAssetDiscoveryRequest parent. + * @member {string} parent + * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryRequest + * @instance + */ + RunAssetDiscoveryRequest.prototype.parent = ""; + + /** + * Creates a new RunAssetDiscoveryRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryRequest + * @static + * @param {google.cloud.securitycenter.v1.IRunAssetDiscoveryRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.RunAssetDiscoveryRequest} RunAssetDiscoveryRequest instance + */ + RunAssetDiscoveryRequest.create = function create(properties) { + return new RunAssetDiscoveryRequest(properties); + }; + + /** + * Encodes the specified RunAssetDiscoveryRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.RunAssetDiscoveryRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryRequest + * @static + * @param {google.cloud.securitycenter.v1.IRunAssetDiscoveryRequest} message RunAssetDiscoveryRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RunAssetDiscoveryRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && message.hasOwnProperty("parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + return writer; + }; + + /** + * Encodes the specified RunAssetDiscoveryRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.RunAssetDiscoveryRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryRequest + * @static + * @param {google.cloud.securitycenter.v1.IRunAssetDiscoveryRequest} message RunAssetDiscoveryRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RunAssetDiscoveryRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RunAssetDiscoveryRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.RunAssetDiscoveryRequest} RunAssetDiscoveryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RunAssetDiscoveryRequest.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.cloud.securitycenter.v1.RunAssetDiscoveryRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RunAssetDiscoveryRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.RunAssetDiscoveryRequest} RunAssetDiscoveryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RunAssetDiscoveryRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RunAssetDiscoveryRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RunAssetDiscoveryRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + return null; + }; + + /** + * Creates a RunAssetDiscoveryRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.RunAssetDiscoveryRequest} RunAssetDiscoveryRequest + */ + RunAssetDiscoveryRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.RunAssetDiscoveryRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1.RunAssetDiscoveryRequest(); + if (object.parent != null) + message.parent = String(object.parent); + return message; + }; + + /** + * Creates a plain object from a RunAssetDiscoveryRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryRequest + * @static + * @param {google.cloud.securitycenter.v1.RunAssetDiscoveryRequest} message RunAssetDiscoveryRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RunAssetDiscoveryRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.parent = ""; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + return object; + }; + + /** + * Converts this RunAssetDiscoveryRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryRequest + * @instance + * @returns {Object.} JSON object + */ + RunAssetDiscoveryRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return RunAssetDiscoveryRequest; + })(); + + v1.UpdateFindingRequest = (function() { + + /** + * Properties of an UpdateFindingRequest. + * @memberof google.cloud.securitycenter.v1 + * @interface IUpdateFindingRequest + * @property {google.cloud.securitycenter.v1.IFinding|null} [finding] UpdateFindingRequest finding + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateFindingRequest updateMask + */ + + /** + * Constructs a new UpdateFindingRequest. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents an UpdateFindingRequest. + * @implements IUpdateFindingRequest + * @constructor + * @param {google.cloud.securitycenter.v1.IUpdateFindingRequest=} [properties] Properties to set + */ + function UpdateFindingRequest(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]]; + } + + /** + * UpdateFindingRequest finding. + * @member {google.cloud.securitycenter.v1.IFinding|null|undefined} finding + * @memberof google.cloud.securitycenter.v1.UpdateFindingRequest + * @instance + */ + UpdateFindingRequest.prototype.finding = null; + + /** + * UpdateFindingRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.securitycenter.v1.UpdateFindingRequest + * @instance + */ + UpdateFindingRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateFindingRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.UpdateFindingRequest + * @static + * @param {google.cloud.securitycenter.v1.IUpdateFindingRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.UpdateFindingRequest} UpdateFindingRequest instance + */ + UpdateFindingRequest.create = function create(properties) { + return new UpdateFindingRequest(properties); + }; + + /** + * Encodes the specified UpdateFindingRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.UpdateFindingRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.UpdateFindingRequest + * @static + * @param {google.cloud.securitycenter.v1.IUpdateFindingRequest} message UpdateFindingRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateFindingRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.finding != null && message.hasOwnProperty("finding")) + $root.google.cloud.securitycenter.v1.Finding.encode(message.finding, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateFindingRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.UpdateFindingRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.UpdateFindingRequest + * @static + * @param {google.cloud.securitycenter.v1.IUpdateFindingRequest} message UpdateFindingRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateFindingRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateFindingRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.UpdateFindingRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.UpdateFindingRequest} UpdateFindingRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateFindingRequest.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.cloud.securitycenter.v1.UpdateFindingRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.finding = $root.google.cloud.securitycenter.v1.Finding.decode(reader, reader.uint32()); + break; + case 2: + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateFindingRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.UpdateFindingRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.UpdateFindingRequest} UpdateFindingRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateFindingRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateFindingRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1.UpdateFindingRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateFindingRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.finding != null && message.hasOwnProperty("finding")) { + var error = $root.google.cloud.securitycenter.v1.Finding.verify(message.finding); + if (error) + return "finding." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + return null; + }; + + /** + * Creates an UpdateFindingRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.UpdateFindingRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.UpdateFindingRequest} UpdateFindingRequest + */ + UpdateFindingRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.UpdateFindingRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1.UpdateFindingRequest(); + if (object.finding != null) { + if (typeof object.finding !== "object") + throw TypeError(".google.cloud.securitycenter.v1.UpdateFindingRequest.finding: object expected"); + message.finding = $root.google.cloud.securitycenter.v1.Finding.fromObject(object.finding); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.securitycenter.v1.UpdateFindingRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateFindingRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.UpdateFindingRequest + * @static + * @param {google.cloud.securitycenter.v1.UpdateFindingRequest} message UpdateFindingRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateFindingRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.finding = null; + object.updateMask = null; + } + if (message.finding != null && message.hasOwnProperty("finding")) + object.finding = $root.google.cloud.securitycenter.v1.Finding.toObject(message.finding, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateFindingRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.UpdateFindingRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateFindingRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return UpdateFindingRequest; + })(); + + v1.UpdateOrganizationSettingsRequest = (function() { + + /** + * Properties of an UpdateOrganizationSettingsRequest. + * @memberof google.cloud.securitycenter.v1 + * @interface IUpdateOrganizationSettingsRequest + * @property {google.cloud.securitycenter.v1.IOrganizationSettings|null} [organizationSettings] UpdateOrganizationSettingsRequest organizationSettings + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateOrganizationSettingsRequest updateMask + */ + + /** + * Constructs a new UpdateOrganizationSettingsRequest. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents an UpdateOrganizationSettingsRequest. + * @implements IUpdateOrganizationSettingsRequest + * @constructor + * @param {google.cloud.securitycenter.v1.IUpdateOrganizationSettingsRequest=} [properties] Properties to set + */ + function UpdateOrganizationSettingsRequest(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]]; + } + + /** + * UpdateOrganizationSettingsRequest organizationSettings. + * @member {google.cloud.securitycenter.v1.IOrganizationSettings|null|undefined} organizationSettings + * @memberof google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest + * @instance + */ + UpdateOrganizationSettingsRequest.prototype.organizationSettings = null; + + /** + * UpdateOrganizationSettingsRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest + * @instance + */ + UpdateOrganizationSettingsRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateOrganizationSettingsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest + * @static + * @param {google.cloud.securitycenter.v1.IUpdateOrganizationSettingsRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest} UpdateOrganizationSettingsRequest instance + */ + UpdateOrganizationSettingsRequest.create = function create(properties) { + return new UpdateOrganizationSettingsRequest(properties); + }; + + /** + * Encodes the specified UpdateOrganizationSettingsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest + * @static + * @param {google.cloud.securitycenter.v1.IUpdateOrganizationSettingsRequest} message UpdateOrganizationSettingsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateOrganizationSettingsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.organizationSettings != null && message.hasOwnProperty("organizationSettings")) + $root.google.cloud.securitycenter.v1.OrganizationSettings.encode(message.organizationSettings, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateOrganizationSettingsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest + * @static + * @param {google.cloud.securitycenter.v1.IUpdateOrganizationSettingsRequest} message UpdateOrganizationSettingsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateOrganizationSettingsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateOrganizationSettingsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest} UpdateOrganizationSettingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateOrganizationSettingsRequest.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.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.organizationSettings = $root.google.cloud.securitycenter.v1.OrganizationSettings.decode(reader, reader.uint32()); + break; + case 2: + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateOrganizationSettingsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest} UpdateOrganizationSettingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateOrganizationSettingsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateOrganizationSettingsRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateOrganizationSettingsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.organizationSettings != null && message.hasOwnProperty("organizationSettings")) { + var error = $root.google.cloud.securitycenter.v1.OrganizationSettings.verify(message.organizationSettings); + if (error) + return "organizationSettings." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + return null; + }; + + /** + * Creates an UpdateOrganizationSettingsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest} UpdateOrganizationSettingsRequest + */ + UpdateOrganizationSettingsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest(); + if (object.organizationSettings != null) { + if (typeof object.organizationSettings !== "object") + throw TypeError(".google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest.organizationSettings: object expected"); + message.organizationSettings = $root.google.cloud.securitycenter.v1.OrganizationSettings.fromObject(object.organizationSettings); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateOrganizationSettingsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest + * @static + * @param {google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest} message UpdateOrganizationSettingsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateOrganizationSettingsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.organizationSettings = null; + object.updateMask = null; + } + if (message.organizationSettings != null && message.hasOwnProperty("organizationSettings")) + object.organizationSettings = $root.google.cloud.securitycenter.v1.OrganizationSettings.toObject(message.organizationSettings, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateOrganizationSettingsRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateOrganizationSettingsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return UpdateOrganizationSettingsRequest; + })(); + + v1.UpdateSourceRequest = (function() { + + /** + * Properties of an UpdateSourceRequest. + * @memberof google.cloud.securitycenter.v1 + * @interface IUpdateSourceRequest + * @property {google.cloud.securitycenter.v1.ISource|null} [source] UpdateSourceRequest source + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateSourceRequest updateMask + */ + + /** + * Constructs a new UpdateSourceRequest. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents an UpdateSourceRequest. + * @implements IUpdateSourceRequest + * @constructor + * @param {google.cloud.securitycenter.v1.IUpdateSourceRequest=} [properties] Properties to set + */ + function UpdateSourceRequest(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]]; + } + + /** + * UpdateSourceRequest source. + * @member {google.cloud.securitycenter.v1.ISource|null|undefined} source + * @memberof google.cloud.securitycenter.v1.UpdateSourceRequest + * @instance + */ + UpdateSourceRequest.prototype.source = null; + + /** + * UpdateSourceRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.securitycenter.v1.UpdateSourceRequest + * @instance + */ + UpdateSourceRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateSourceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.UpdateSourceRequest + * @static + * @param {google.cloud.securitycenter.v1.IUpdateSourceRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.UpdateSourceRequest} UpdateSourceRequest instance + */ + UpdateSourceRequest.create = function create(properties) { + return new UpdateSourceRequest(properties); + }; + + /** + * Encodes the specified UpdateSourceRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.UpdateSourceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.UpdateSourceRequest + * @static + * @param {google.cloud.securitycenter.v1.IUpdateSourceRequest} message UpdateSourceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateSourceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.source != null && message.hasOwnProperty("source")) + $root.google.cloud.securitycenter.v1.Source.encode(message.source, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateSourceRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.UpdateSourceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.UpdateSourceRequest + * @static + * @param {google.cloud.securitycenter.v1.IUpdateSourceRequest} message UpdateSourceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateSourceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateSourceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.UpdateSourceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.UpdateSourceRequest} UpdateSourceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateSourceRequest.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.cloud.securitycenter.v1.UpdateSourceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.source = $root.google.cloud.securitycenter.v1.Source.decode(reader, reader.uint32()); + break; + case 2: + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateSourceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.UpdateSourceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.UpdateSourceRequest} UpdateSourceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateSourceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateSourceRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1.UpdateSourceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateSourceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.source != null && message.hasOwnProperty("source")) { + var error = $root.google.cloud.securitycenter.v1.Source.verify(message.source); + if (error) + return "source." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + return null; + }; + + /** + * Creates an UpdateSourceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.UpdateSourceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.UpdateSourceRequest} UpdateSourceRequest + */ + UpdateSourceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.UpdateSourceRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1.UpdateSourceRequest(); + if (object.source != null) { + if (typeof object.source !== "object") + throw TypeError(".google.cloud.securitycenter.v1.UpdateSourceRequest.source: object expected"); + message.source = $root.google.cloud.securitycenter.v1.Source.fromObject(object.source); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.securitycenter.v1.UpdateSourceRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateSourceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.UpdateSourceRequest + * @static + * @param {google.cloud.securitycenter.v1.UpdateSourceRequest} message UpdateSourceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateSourceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.source = null; + object.updateMask = null; + } + if (message.source != null && message.hasOwnProperty("source")) + object.source = $root.google.cloud.securitycenter.v1.Source.toObject(message.source, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateSourceRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.UpdateSourceRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateSourceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return UpdateSourceRequest; + })(); + + v1.UpdateSecurityMarksRequest = (function() { + + /** + * Properties of an UpdateSecurityMarksRequest. + * @memberof google.cloud.securitycenter.v1 + * @interface IUpdateSecurityMarksRequest + * @property {google.cloud.securitycenter.v1.ISecurityMarks|null} [securityMarks] UpdateSecurityMarksRequest securityMarks + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateSecurityMarksRequest updateMask + * @property {google.protobuf.ITimestamp|null} [startTime] UpdateSecurityMarksRequest startTime + */ + + /** + * Constructs a new UpdateSecurityMarksRequest. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents an UpdateSecurityMarksRequest. + * @implements IUpdateSecurityMarksRequest + * @constructor + * @param {google.cloud.securitycenter.v1.IUpdateSecurityMarksRequest=} [properties] Properties to set + */ + function UpdateSecurityMarksRequest(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]]; + } + + /** + * UpdateSecurityMarksRequest securityMarks. + * @member {google.cloud.securitycenter.v1.ISecurityMarks|null|undefined} securityMarks + * @memberof google.cloud.securitycenter.v1.UpdateSecurityMarksRequest + * @instance + */ + UpdateSecurityMarksRequest.prototype.securityMarks = null; + + /** + * UpdateSecurityMarksRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.securitycenter.v1.UpdateSecurityMarksRequest + * @instance + */ + UpdateSecurityMarksRequest.prototype.updateMask = null; + + /** + * UpdateSecurityMarksRequest startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.cloud.securitycenter.v1.UpdateSecurityMarksRequest + * @instance + */ + UpdateSecurityMarksRequest.prototype.startTime = null; + + /** + * Creates a new UpdateSecurityMarksRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.UpdateSecurityMarksRequest + * @static + * @param {google.cloud.securitycenter.v1.IUpdateSecurityMarksRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.UpdateSecurityMarksRequest} UpdateSecurityMarksRequest instance + */ + UpdateSecurityMarksRequest.create = function create(properties) { + return new UpdateSecurityMarksRequest(properties); + }; + + /** + * Encodes the specified UpdateSecurityMarksRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.UpdateSecurityMarksRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.UpdateSecurityMarksRequest + * @static + * @param {google.cloud.securitycenter.v1.IUpdateSecurityMarksRequest} message UpdateSecurityMarksRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateSecurityMarksRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.securityMarks != null && message.hasOwnProperty("securityMarks")) + $root.google.cloud.securitycenter.v1.SecurityMarks.encode(message.securityMarks, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.startTime != null && message.hasOwnProperty("startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateSecurityMarksRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.UpdateSecurityMarksRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.UpdateSecurityMarksRequest + * @static + * @param {google.cloud.securitycenter.v1.IUpdateSecurityMarksRequest} message UpdateSecurityMarksRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateSecurityMarksRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateSecurityMarksRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.UpdateSecurityMarksRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.UpdateSecurityMarksRequest} UpdateSecurityMarksRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateSecurityMarksRequest.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.cloud.securitycenter.v1.UpdateSecurityMarksRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.securityMarks = $root.google.cloud.securitycenter.v1.SecurityMarks.decode(reader, reader.uint32()); + break; + case 2: + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + case 3: + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateSecurityMarksRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.UpdateSecurityMarksRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.UpdateSecurityMarksRequest} UpdateSecurityMarksRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateSecurityMarksRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateSecurityMarksRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1.UpdateSecurityMarksRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateSecurityMarksRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.securityMarks != null && message.hasOwnProperty("securityMarks")) { + var error = $root.google.cloud.securitycenter.v1.SecurityMarks.verify(message.securityMarks); + if (error) + return "securityMarks." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + if (message.startTime != null && message.hasOwnProperty("startTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.startTime); + if (error) + return "startTime." + error; + } + return null; + }; + + /** + * Creates an UpdateSecurityMarksRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.UpdateSecurityMarksRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.UpdateSecurityMarksRequest} UpdateSecurityMarksRequest + */ + UpdateSecurityMarksRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.UpdateSecurityMarksRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1.UpdateSecurityMarksRequest(); + if (object.securityMarks != null) { + if (typeof object.securityMarks !== "object") + throw TypeError(".google.cloud.securitycenter.v1.UpdateSecurityMarksRequest.securityMarks: object expected"); + message.securityMarks = $root.google.cloud.securitycenter.v1.SecurityMarks.fromObject(object.securityMarks); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.securitycenter.v1.UpdateSecurityMarksRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.cloud.securitycenter.v1.UpdateSecurityMarksRequest.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); + } + return message; + }; + + /** + * Creates a plain object from an UpdateSecurityMarksRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.UpdateSecurityMarksRequest + * @static + * @param {google.cloud.securitycenter.v1.UpdateSecurityMarksRequest} message UpdateSecurityMarksRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateSecurityMarksRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.securityMarks = null; + object.updateMask = null; + object.startTime = null; + } + if (message.securityMarks != null && message.hasOwnProperty("securityMarks")) + object.securityMarks = $root.google.cloud.securitycenter.v1.SecurityMarks.toObject(message.securityMarks, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); + return object; + }; + + /** + * Converts this UpdateSecurityMarksRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.UpdateSecurityMarksRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateSecurityMarksRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return UpdateSecurityMarksRequest; + })(); + + v1.Asset = (function() { + + /** + * Properties of an Asset. + * @memberof google.cloud.securitycenter.v1 + * @interface IAsset + * @property {string|null} [name] Asset name + * @property {google.cloud.securitycenter.v1.Asset.ISecurityCenterProperties|null} [securityCenterProperties] Asset securityCenterProperties + * @property {Object.|null} [resourceProperties] Asset resourceProperties + * @property {google.cloud.securitycenter.v1.ISecurityMarks|null} [securityMarks] Asset securityMarks + * @property {google.protobuf.ITimestamp|null} [createTime] Asset createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Asset updateTime + * @property {google.cloud.securitycenter.v1.Asset.IIamPolicy|null} [iamPolicy] Asset iamPolicy + */ + + /** + * Constructs a new Asset. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents an Asset. + * @implements IAsset + * @constructor + * @param {google.cloud.securitycenter.v1.IAsset=} [properties] Properties to set + */ + function Asset(properties) { + this.resourceProperties = {}; + 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]]; + } + + /** + * Asset name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1.Asset + * @instance + */ + Asset.prototype.name = ""; + + /** + * Asset securityCenterProperties. + * @member {google.cloud.securitycenter.v1.Asset.ISecurityCenterProperties|null|undefined} securityCenterProperties + * @memberof google.cloud.securitycenter.v1.Asset + * @instance + */ + Asset.prototype.securityCenterProperties = null; + + /** + * Asset resourceProperties. + * @member {Object.} resourceProperties + * @memberof google.cloud.securitycenter.v1.Asset + * @instance + */ + Asset.prototype.resourceProperties = $util.emptyObject; + + /** + * Asset securityMarks. + * @member {google.cloud.securitycenter.v1.ISecurityMarks|null|undefined} securityMarks + * @memberof google.cloud.securitycenter.v1.Asset + * @instance + */ + Asset.prototype.securityMarks = null; + + /** + * Asset createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.securitycenter.v1.Asset + * @instance + */ + Asset.prototype.createTime = null; + + /** + * Asset updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.securitycenter.v1.Asset + * @instance + */ + Asset.prototype.updateTime = null; + + /** + * Asset iamPolicy. + * @member {google.cloud.securitycenter.v1.Asset.IIamPolicy|null|undefined} iamPolicy + * @memberof google.cloud.securitycenter.v1.Asset + * @instance + */ + Asset.prototype.iamPolicy = null; + + /** + * Creates a new Asset instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.Asset + * @static + * @param {google.cloud.securitycenter.v1.IAsset=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.Asset} Asset instance + */ + Asset.create = function create(properties) { + return new Asset(properties); + }; + + /** + * Encodes the specified Asset message. Does not implicitly {@link google.cloud.securitycenter.v1.Asset.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.Asset + * @static + * @param {google.cloud.securitycenter.v1.IAsset} message Asset message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Asset.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.securityCenterProperties != null && message.hasOwnProperty("securityCenterProperties")) + $root.google.cloud.securitycenter.v1.Asset.SecurityCenterProperties.encode(message.securityCenterProperties, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.resourceProperties != null && message.hasOwnProperty("resourceProperties")) + for (var keys = Object.keys(message.resourceProperties), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 7, wireType 2 =*/58).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.protobuf.Value.encode(message.resourceProperties[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.securityMarks != null && message.hasOwnProperty("securityMarks")) + $root.google.cloud.securitycenter.v1.SecurityMarks.encode(message.securityMarks, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.createTime != null && message.hasOwnProperty("createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.iamPolicy != null && message.hasOwnProperty("iamPolicy")) + $root.google.cloud.securitycenter.v1.Asset.IamPolicy.encode(message.iamPolicy, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Asset message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Asset.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.Asset + * @static + * @param {google.cloud.securitycenter.v1.IAsset} message Asset message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Asset.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Asset message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.Asset + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.Asset} Asset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Asset.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.cloud.securitycenter.v1.Asset(), key; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.securityCenterProperties = $root.google.cloud.securitycenter.v1.Asset.SecurityCenterProperties.decode(reader, reader.uint32()); + break; + case 7: + reader.skip().pos++; + if (message.resourceProperties === $util.emptyObject) + message.resourceProperties = {}; + key = reader.string(); + reader.pos++; + message.resourceProperties[key] = $root.google.protobuf.Value.decode(reader, reader.uint32()); + break; + case 8: + message.securityMarks = $root.google.cloud.securitycenter.v1.SecurityMarks.decode(reader, reader.uint32()); + break; + case 9: + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 10: + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 11: + message.iamPolicy = $root.google.cloud.securitycenter.v1.Asset.IamPolicy.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Asset message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.Asset + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.Asset} Asset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Asset.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Asset message. + * @function verify + * @memberof google.cloud.securitycenter.v1.Asset + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Asset.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.securityCenterProperties != null && message.hasOwnProperty("securityCenterProperties")) { + var error = $root.google.cloud.securitycenter.v1.Asset.SecurityCenterProperties.verify(message.securityCenterProperties); + if (error) + return "securityCenterProperties." + error; + } + if (message.resourceProperties != null && message.hasOwnProperty("resourceProperties")) { + if (!$util.isObject(message.resourceProperties)) + return "resourceProperties: object expected"; + var key = Object.keys(message.resourceProperties); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.protobuf.Value.verify(message.resourceProperties[key[i]]); + if (error) + return "resourceProperties." + error; + } + } + if (message.securityMarks != null && message.hasOwnProperty("securityMarks")) { + var error = $root.google.cloud.securitycenter.v1.SecurityMarks.verify(message.securityMarks); + if (error) + return "securityMarks." + error; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.iamPolicy != null && message.hasOwnProperty("iamPolicy")) { + var error = $root.google.cloud.securitycenter.v1.Asset.IamPolicy.verify(message.iamPolicy); + if (error) + return "iamPolicy." + error; + } + return null; + }; + + /** + * Creates an Asset message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.Asset + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.Asset} Asset + */ + Asset.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.Asset) + return object; + var message = new $root.google.cloud.securitycenter.v1.Asset(); + if (object.name != null) + message.name = String(object.name); + if (object.securityCenterProperties != null) { + if (typeof object.securityCenterProperties !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Asset.securityCenterProperties: object expected"); + message.securityCenterProperties = $root.google.cloud.securitycenter.v1.Asset.SecurityCenterProperties.fromObject(object.securityCenterProperties); + } + if (object.resourceProperties) { + if (typeof object.resourceProperties !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Asset.resourceProperties: object expected"); + message.resourceProperties = {}; + for (var keys = Object.keys(object.resourceProperties), i = 0; i < keys.length; ++i) { + if (typeof object.resourceProperties[keys[i]] !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Asset.resourceProperties: object expected"); + message.resourceProperties[keys[i]] = $root.google.protobuf.Value.fromObject(object.resourceProperties[keys[i]]); + } + } + if (object.securityMarks != null) { + if (typeof object.securityMarks !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Asset.securityMarks: object expected"); + message.securityMarks = $root.google.cloud.securitycenter.v1.SecurityMarks.fromObject(object.securityMarks); + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Asset.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Asset.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.iamPolicy != null) { + if (typeof object.iamPolicy !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Asset.iamPolicy: object expected"); + message.iamPolicy = $root.google.cloud.securitycenter.v1.Asset.IamPolicy.fromObject(object.iamPolicy); + } + return message; + }; + + /** + * Creates a plain object from an Asset message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.Asset + * @static + * @param {google.cloud.securitycenter.v1.Asset} message Asset + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Asset.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.resourceProperties = {}; + if (options.defaults) { + object.name = ""; + object.securityCenterProperties = null; + object.securityMarks = null; + object.createTime = null; + object.updateTime = null; + object.iamPolicy = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.securityCenterProperties != null && message.hasOwnProperty("securityCenterProperties")) + object.securityCenterProperties = $root.google.cloud.securitycenter.v1.Asset.SecurityCenterProperties.toObject(message.securityCenterProperties, options); + var keys2; + if (message.resourceProperties && (keys2 = Object.keys(message.resourceProperties)).length) { + object.resourceProperties = {}; + for (var j = 0; j < keys2.length; ++j) + object.resourceProperties[keys2[j]] = $root.google.protobuf.Value.toObject(message.resourceProperties[keys2[j]], options); + } + if (message.securityMarks != null && message.hasOwnProperty("securityMarks")) + object.securityMarks = $root.google.cloud.securitycenter.v1.SecurityMarks.toObject(message.securityMarks, options); + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.iamPolicy != null && message.hasOwnProperty("iamPolicy")) + object.iamPolicy = $root.google.cloud.securitycenter.v1.Asset.IamPolicy.toObject(message.iamPolicy, options); + return object; + }; + + /** + * Converts this Asset to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.Asset + * @instance + * @returns {Object.} JSON object + */ + Asset.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + Asset.SecurityCenterProperties = (function() { + + /** + * Properties of a SecurityCenterProperties. + * @memberof google.cloud.securitycenter.v1.Asset + * @interface ISecurityCenterProperties + * @property {string|null} [resourceName] SecurityCenterProperties resourceName + * @property {string|null} [resourceType] SecurityCenterProperties resourceType + * @property {string|null} [resourceParent] SecurityCenterProperties resourceParent + * @property {string|null} [resourceProject] SecurityCenterProperties resourceProject + * @property {Array.|null} [resourceOwners] SecurityCenterProperties resourceOwners + */ + + /** + * Constructs a new SecurityCenterProperties. + * @memberof google.cloud.securitycenter.v1.Asset + * @classdesc Represents a SecurityCenterProperties. + * @implements ISecurityCenterProperties + * @constructor + * @param {google.cloud.securitycenter.v1.Asset.ISecurityCenterProperties=} [properties] Properties to set + */ + function SecurityCenterProperties(properties) { + this.resourceOwners = []; + 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]]; + } + + /** + * SecurityCenterProperties resourceName. + * @member {string} resourceName + * @memberof google.cloud.securitycenter.v1.Asset.SecurityCenterProperties + * @instance + */ + SecurityCenterProperties.prototype.resourceName = ""; + + /** + * SecurityCenterProperties resourceType. + * @member {string} resourceType + * @memberof google.cloud.securitycenter.v1.Asset.SecurityCenterProperties + * @instance + */ + SecurityCenterProperties.prototype.resourceType = ""; + + /** + * SecurityCenterProperties resourceParent. + * @member {string} resourceParent + * @memberof google.cloud.securitycenter.v1.Asset.SecurityCenterProperties + * @instance + */ + SecurityCenterProperties.prototype.resourceParent = ""; + + /** + * SecurityCenterProperties resourceProject. + * @member {string} resourceProject + * @memberof google.cloud.securitycenter.v1.Asset.SecurityCenterProperties + * @instance + */ + SecurityCenterProperties.prototype.resourceProject = ""; + + /** + * SecurityCenterProperties resourceOwners. + * @member {Array.} resourceOwners + * @memberof google.cloud.securitycenter.v1.Asset.SecurityCenterProperties + * @instance + */ + SecurityCenterProperties.prototype.resourceOwners = $util.emptyArray; + + /** + * Creates a new SecurityCenterProperties instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.Asset.SecurityCenterProperties + * @static + * @param {google.cloud.securitycenter.v1.Asset.ISecurityCenterProperties=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.Asset.SecurityCenterProperties} SecurityCenterProperties instance + */ + SecurityCenterProperties.create = function create(properties) { + return new SecurityCenterProperties(properties); + }; + + /** + * Encodes the specified SecurityCenterProperties message. Does not implicitly {@link google.cloud.securitycenter.v1.Asset.SecurityCenterProperties.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.Asset.SecurityCenterProperties + * @static + * @param {google.cloud.securitycenter.v1.Asset.ISecurityCenterProperties} message SecurityCenterProperties message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SecurityCenterProperties.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.resourceName != null && message.hasOwnProperty("resourceName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.resourceName); + if (message.resourceType != null && message.hasOwnProperty("resourceType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.resourceType); + if (message.resourceParent != null && message.hasOwnProperty("resourceParent")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.resourceParent); + if (message.resourceProject != null && message.hasOwnProperty("resourceProject")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.resourceProject); + if (message.resourceOwners != null && message.resourceOwners.length) + for (var i = 0; i < message.resourceOwners.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.resourceOwners[i]); + return writer; + }; + + /** + * Encodes the specified SecurityCenterProperties message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Asset.SecurityCenterProperties.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.Asset.SecurityCenterProperties + * @static + * @param {google.cloud.securitycenter.v1.Asset.ISecurityCenterProperties} message SecurityCenterProperties message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SecurityCenterProperties.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SecurityCenterProperties message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.Asset.SecurityCenterProperties + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.Asset.SecurityCenterProperties} SecurityCenterProperties + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SecurityCenterProperties.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.cloud.securitycenter.v1.Asset.SecurityCenterProperties(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.resourceName = reader.string(); + break; + case 2: + message.resourceType = reader.string(); + break; + case 3: + message.resourceParent = reader.string(); + break; + case 4: + message.resourceProject = reader.string(); + break; + case 5: + if (!(message.resourceOwners && message.resourceOwners.length)) + message.resourceOwners = []; + message.resourceOwners.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SecurityCenterProperties message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.Asset.SecurityCenterProperties + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.Asset.SecurityCenterProperties} SecurityCenterProperties + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SecurityCenterProperties.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SecurityCenterProperties message. + * @function verify + * @memberof google.cloud.securitycenter.v1.Asset.SecurityCenterProperties + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SecurityCenterProperties.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.resourceName != null && message.hasOwnProperty("resourceName")) + if (!$util.isString(message.resourceName)) + return "resourceName: string expected"; + if (message.resourceType != null && message.hasOwnProperty("resourceType")) + if (!$util.isString(message.resourceType)) + return "resourceType: string expected"; + if (message.resourceParent != null && message.hasOwnProperty("resourceParent")) + if (!$util.isString(message.resourceParent)) + return "resourceParent: string expected"; + if (message.resourceProject != null && message.hasOwnProperty("resourceProject")) + if (!$util.isString(message.resourceProject)) + return "resourceProject: string expected"; + if (message.resourceOwners != null && message.hasOwnProperty("resourceOwners")) { + if (!Array.isArray(message.resourceOwners)) + return "resourceOwners: array expected"; + for (var i = 0; i < message.resourceOwners.length; ++i) + if (!$util.isString(message.resourceOwners[i])) + return "resourceOwners: string[] expected"; + } + return null; + }; + + /** + * Creates a SecurityCenterProperties message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.Asset.SecurityCenterProperties + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.Asset.SecurityCenterProperties} SecurityCenterProperties + */ + SecurityCenterProperties.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.Asset.SecurityCenterProperties) + return object; + var message = new $root.google.cloud.securitycenter.v1.Asset.SecurityCenterProperties(); + if (object.resourceName != null) + message.resourceName = String(object.resourceName); + if (object.resourceType != null) + message.resourceType = String(object.resourceType); + if (object.resourceParent != null) + message.resourceParent = String(object.resourceParent); + if (object.resourceProject != null) + message.resourceProject = String(object.resourceProject); + if (object.resourceOwners) { + if (!Array.isArray(object.resourceOwners)) + throw TypeError(".google.cloud.securitycenter.v1.Asset.SecurityCenterProperties.resourceOwners: array expected"); + message.resourceOwners = []; + for (var i = 0; i < object.resourceOwners.length; ++i) + message.resourceOwners[i] = String(object.resourceOwners[i]); + } + return message; + }; + + /** + * Creates a plain object from a SecurityCenterProperties message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.Asset.SecurityCenterProperties + * @static + * @param {google.cloud.securitycenter.v1.Asset.SecurityCenterProperties} message SecurityCenterProperties + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SecurityCenterProperties.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.resourceOwners = []; + if (options.defaults) { + object.resourceName = ""; + object.resourceType = ""; + object.resourceParent = ""; + object.resourceProject = ""; + } + if (message.resourceName != null && message.hasOwnProperty("resourceName")) + object.resourceName = message.resourceName; + if (message.resourceType != null && message.hasOwnProperty("resourceType")) + object.resourceType = message.resourceType; + if (message.resourceParent != null && message.hasOwnProperty("resourceParent")) + object.resourceParent = message.resourceParent; + if (message.resourceProject != null && message.hasOwnProperty("resourceProject")) + object.resourceProject = message.resourceProject; + if (message.resourceOwners && message.resourceOwners.length) { + object.resourceOwners = []; + for (var j = 0; j < message.resourceOwners.length; ++j) + object.resourceOwners[j] = message.resourceOwners[j]; + } + return object; + }; + + /** + * Converts this SecurityCenterProperties to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.Asset.SecurityCenterProperties + * @instance + * @returns {Object.} JSON object + */ + SecurityCenterProperties.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SecurityCenterProperties; + })(); + + Asset.IamPolicy = (function() { + + /** + * Properties of an IamPolicy. + * @memberof google.cloud.securitycenter.v1.Asset + * @interface IIamPolicy + * @property {string|null} [policyBlob] IamPolicy policyBlob + */ + + /** + * Constructs a new IamPolicy. + * @memberof google.cloud.securitycenter.v1.Asset + * @classdesc Represents an IamPolicy. + * @implements IIamPolicy + * @constructor + * @param {google.cloud.securitycenter.v1.Asset.IIamPolicy=} [properties] Properties to set + */ + function IamPolicy(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]]; + } + + /** + * IamPolicy policyBlob. + * @member {string} policyBlob + * @memberof google.cloud.securitycenter.v1.Asset.IamPolicy + * @instance + */ + IamPolicy.prototype.policyBlob = ""; + + /** + * Creates a new IamPolicy instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.Asset.IamPolicy + * @static + * @param {google.cloud.securitycenter.v1.Asset.IIamPolicy=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.Asset.IamPolicy} IamPolicy instance + */ + IamPolicy.create = function create(properties) { + return new IamPolicy(properties); + }; + + /** + * Encodes the specified IamPolicy message. Does not implicitly {@link google.cloud.securitycenter.v1.Asset.IamPolicy.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.Asset.IamPolicy + * @static + * @param {google.cloud.securitycenter.v1.Asset.IIamPolicy} message IamPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IamPolicy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.policyBlob != null && message.hasOwnProperty("policyBlob")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.policyBlob); + return writer; + }; + + /** + * Encodes the specified IamPolicy message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Asset.IamPolicy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.Asset.IamPolicy + * @static + * @param {google.cloud.securitycenter.v1.Asset.IIamPolicy} message IamPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IamPolicy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an IamPolicy message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.Asset.IamPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.Asset.IamPolicy} IamPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IamPolicy.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.cloud.securitycenter.v1.Asset.IamPolicy(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.policyBlob = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an IamPolicy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.Asset.IamPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.Asset.IamPolicy} IamPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IamPolicy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an IamPolicy message. + * @function verify + * @memberof google.cloud.securitycenter.v1.Asset.IamPolicy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IamPolicy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.policyBlob != null && message.hasOwnProperty("policyBlob")) + if (!$util.isString(message.policyBlob)) + return "policyBlob: string expected"; + return null; + }; + + /** + * Creates an IamPolicy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.Asset.IamPolicy + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.Asset.IamPolicy} IamPolicy + */ + IamPolicy.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.Asset.IamPolicy) + return object; + var message = new $root.google.cloud.securitycenter.v1.Asset.IamPolicy(); + if (object.policyBlob != null) + message.policyBlob = String(object.policyBlob); + return message; + }; + + /** + * Creates a plain object from an IamPolicy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.Asset.IamPolicy + * @static + * @param {google.cloud.securitycenter.v1.Asset.IamPolicy} message IamPolicy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IamPolicy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.policyBlob = ""; + if (message.policyBlob != null && message.hasOwnProperty("policyBlob")) + object.policyBlob = message.policyBlob; + return object; + }; + + /** + * Converts this IamPolicy to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.Asset.IamPolicy + * @instance + * @returns {Object.} JSON object + */ + IamPolicy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return IamPolicy; + })(); + + return Asset; + })(); + + v1.SecurityMarks = (function() { + + /** + * Properties of a SecurityMarks. + * @memberof google.cloud.securitycenter.v1 + * @interface ISecurityMarks + * @property {string|null} [name] SecurityMarks name + * @property {Object.|null} [marks] SecurityMarks marks + */ + + /** + * Constructs a new SecurityMarks. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a SecurityMarks. + * @implements ISecurityMarks + * @constructor + * @param {google.cloud.securitycenter.v1.ISecurityMarks=} [properties] Properties to set + */ + function SecurityMarks(properties) { + this.marks = {}; + 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]]; + } + + /** + * SecurityMarks name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1.SecurityMarks + * @instance + */ + SecurityMarks.prototype.name = ""; + + /** + * SecurityMarks marks. + * @member {Object.} marks + * @memberof google.cloud.securitycenter.v1.SecurityMarks + * @instance + */ + SecurityMarks.prototype.marks = $util.emptyObject; + + /** + * Creates a new SecurityMarks instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.SecurityMarks + * @static + * @param {google.cloud.securitycenter.v1.ISecurityMarks=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.SecurityMarks} SecurityMarks instance + */ + SecurityMarks.create = function create(properties) { + return new SecurityMarks(properties); + }; + + /** + * Encodes the specified SecurityMarks message. Does not implicitly {@link google.cloud.securitycenter.v1.SecurityMarks.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.SecurityMarks + * @static + * @param {google.cloud.securitycenter.v1.ISecurityMarks} message SecurityMarks message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SecurityMarks.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.marks != null && message.hasOwnProperty("marks")) + for (var keys = Object.keys(message.marks), i = 0; i < keys.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.marks[keys[i]]).ldelim(); + return writer; + }; + + /** + * Encodes the specified SecurityMarks message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.SecurityMarks.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.SecurityMarks + * @static + * @param {google.cloud.securitycenter.v1.ISecurityMarks} message SecurityMarks message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SecurityMarks.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SecurityMarks message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.SecurityMarks + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.SecurityMarks} SecurityMarks + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SecurityMarks.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.cloud.securitycenter.v1.SecurityMarks(), key; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + reader.skip().pos++; + if (message.marks === $util.emptyObject) + message.marks = {}; + key = reader.string(); + reader.pos++; + message.marks[key] = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SecurityMarks message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.SecurityMarks + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.SecurityMarks} SecurityMarks + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SecurityMarks.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SecurityMarks message. + * @function verify + * @memberof google.cloud.securitycenter.v1.SecurityMarks + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SecurityMarks.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.marks != null && message.hasOwnProperty("marks")) { + if (!$util.isObject(message.marks)) + return "marks: object expected"; + var key = Object.keys(message.marks); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.marks[key[i]])) + return "marks: string{k:string} expected"; + } + return null; + }; + + /** + * Creates a SecurityMarks message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.SecurityMarks + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.SecurityMarks} SecurityMarks + */ + SecurityMarks.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.SecurityMarks) + return object; + var message = new $root.google.cloud.securitycenter.v1.SecurityMarks(); + if (object.name != null) + message.name = String(object.name); + if (object.marks) { + if (typeof object.marks !== "object") + throw TypeError(".google.cloud.securitycenter.v1.SecurityMarks.marks: object expected"); + message.marks = {}; + for (var keys = Object.keys(object.marks), i = 0; i < keys.length; ++i) + message.marks[keys[i]] = String(object.marks[keys[i]]); + } + return message; + }; + + /** + * Creates a plain object from a SecurityMarks message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.SecurityMarks + * @static + * @param {google.cloud.securitycenter.v1.SecurityMarks} message SecurityMarks + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SecurityMarks.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.marks = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + var keys2; + if (message.marks && (keys2 = Object.keys(message.marks)).length) { + object.marks = {}; + for (var j = 0; j < keys2.length; ++j) + object.marks[keys2[j]] = message.marks[keys2[j]]; + } + return object; + }; + + /** + * Converts this SecurityMarks to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.SecurityMarks + * @instance + * @returns {Object.} JSON object + */ + SecurityMarks.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SecurityMarks; + })(); + + v1.Finding = (function() { + + /** + * Properties of a Finding. + * @memberof google.cloud.securitycenter.v1 + * @interface IFinding + * @property {string|null} [name] Finding name + * @property {string|null} [parent] Finding parent + * @property {string|null} [resourceName] Finding resourceName + * @property {google.cloud.securitycenter.v1.Finding.State|null} [state] Finding state + * @property {string|null} [category] Finding category + * @property {string|null} [externalUri] Finding externalUri + * @property {Object.|null} [sourceProperties] Finding sourceProperties + * @property {google.cloud.securitycenter.v1.ISecurityMarks|null} [securityMarks] Finding securityMarks + * @property {google.protobuf.ITimestamp|null} [eventTime] Finding eventTime + * @property {google.protobuf.ITimestamp|null} [createTime] Finding createTime + */ + + /** + * Constructs a new Finding. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a Finding. + * @implements IFinding + * @constructor + * @param {google.cloud.securitycenter.v1.IFinding=} [properties] Properties to set + */ + function Finding(properties) { + this.sourceProperties = {}; + 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]]; + } + + /** + * Finding name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1.Finding + * @instance + */ + Finding.prototype.name = ""; + + /** + * Finding parent. + * @member {string} parent + * @memberof google.cloud.securitycenter.v1.Finding + * @instance + */ + Finding.prototype.parent = ""; + + /** + * Finding resourceName. + * @member {string} resourceName + * @memberof google.cloud.securitycenter.v1.Finding + * @instance + */ + Finding.prototype.resourceName = ""; + + /** + * Finding state. + * @member {google.cloud.securitycenter.v1.Finding.State} state + * @memberof google.cloud.securitycenter.v1.Finding + * @instance + */ + Finding.prototype.state = 0; + + /** + * Finding category. + * @member {string} category + * @memberof google.cloud.securitycenter.v1.Finding + * @instance + */ + Finding.prototype.category = ""; + + /** + * Finding externalUri. + * @member {string} externalUri + * @memberof google.cloud.securitycenter.v1.Finding + * @instance + */ + Finding.prototype.externalUri = ""; + + /** + * Finding sourceProperties. + * @member {Object.} sourceProperties + * @memberof google.cloud.securitycenter.v1.Finding + * @instance + */ + Finding.prototype.sourceProperties = $util.emptyObject; + + /** + * Finding securityMarks. + * @member {google.cloud.securitycenter.v1.ISecurityMarks|null|undefined} securityMarks + * @memberof google.cloud.securitycenter.v1.Finding + * @instance + */ + Finding.prototype.securityMarks = null; + + /** + * Finding eventTime. + * @member {google.protobuf.ITimestamp|null|undefined} eventTime + * @memberof google.cloud.securitycenter.v1.Finding + * @instance + */ + Finding.prototype.eventTime = null; + + /** + * Finding createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.securitycenter.v1.Finding + * @instance + */ + Finding.prototype.createTime = null; + + /** + * Creates a new Finding instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.Finding + * @static + * @param {google.cloud.securitycenter.v1.IFinding=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.Finding} Finding instance + */ + Finding.create = function create(properties) { + return new Finding(properties); + }; + + /** + * Encodes the specified Finding message. Does not implicitly {@link google.cloud.securitycenter.v1.Finding.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.Finding + * @static + * @param {google.cloud.securitycenter.v1.IFinding} message Finding message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Finding.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.parent != null && message.hasOwnProperty("parent")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.parent); + if (message.resourceName != null && message.hasOwnProperty("resourceName")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.resourceName); + if (message.state != null && message.hasOwnProperty("state")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.state); + if (message.category != null && message.hasOwnProperty("category")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.category); + if (message.externalUri != null && message.hasOwnProperty("externalUri")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.externalUri); + if (message.sourceProperties != null && message.hasOwnProperty("sourceProperties")) + for (var keys = Object.keys(message.sourceProperties), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 7, wireType 2 =*/58).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.protobuf.Value.encode(message.sourceProperties[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.securityMarks != null && message.hasOwnProperty("securityMarks")) + $root.google.cloud.securitycenter.v1.SecurityMarks.encode(message.securityMarks, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.eventTime != null && message.hasOwnProperty("eventTime")) + $root.google.protobuf.Timestamp.encode(message.eventTime, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.createTime != null && message.hasOwnProperty("createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Finding message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Finding.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.Finding + * @static + * @param {google.cloud.securitycenter.v1.IFinding} message Finding message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Finding.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Finding message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.Finding + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.Finding} Finding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Finding.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.cloud.securitycenter.v1.Finding(), key; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.parent = reader.string(); + break; + case 3: + message.resourceName = reader.string(); + break; + case 4: + message.state = reader.int32(); + break; + case 5: + message.category = reader.string(); + break; + case 6: + message.externalUri = reader.string(); + break; + case 7: + reader.skip().pos++; + if (message.sourceProperties === $util.emptyObject) + message.sourceProperties = {}; + key = reader.string(); + reader.pos++; + message.sourceProperties[key] = $root.google.protobuf.Value.decode(reader, reader.uint32()); + break; + case 8: + message.securityMarks = $root.google.cloud.securitycenter.v1.SecurityMarks.decode(reader, reader.uint32()); + break; + case 9: + message.eventTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 10: + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Finding message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.Finding + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.Finding} Finding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Finding.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Finding message. + * @function verify + * @memberof google.cloud.securitycenter.v1.Finding + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Finding.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.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.resourceName != null && message.hasOwnProperty("resourceName")) + if (!$util.isString(message.resourceName)) + return "resourceName: string expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: 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"; + if (message.externalUri != null && message.hasOwnProperty("externalUri")) + if (!$util.isString(message.externalUri)) + return "externalUri: string expected"; + if (message.sourceProperties != null && message.hasOwnProperty("sourceProperties")) { + if (!$util.isObject(message.sourceProperties)) + return "sourceProperties: object expected"; + var key = Object.keys(message.sourceProperties); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.protobuf.Value.verify(message.sourceProperties[key[i]]); + if (error) + return "sourceProperties." + error; + } + } + if (message.securityMarks != null && message.hasOwnProperty("securityMarks")) { + var error = $root.google.cloud.securitycenter.v1.SecurityMarks.verify(message.securityMarks); + if (error) + return "securityMarks." + error; + } + if (message.eventTime != null && message.hasOwnProperty("eventTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.eventTime); + if (error) + return "eventTime." + error; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + return null; + }; + + /** + * Creates a Finding message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.Finding + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.Finding} Finding + */ + Finding.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.Finding) + return object; + var message = new $root.google.cloud.securitycenter.v1.Finding(); + if (object.name != null) + message.name = String(object.name); + if (object.parent != null) + message.parent = String(object.parent); + if (object.resourceName != null) + message.resourceName = String(object.resourceName); + switch (object.state) { + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "ACTIVE": + case 1: + message.state = 1; + break; + case "INACTIVE": + case 2: + message.state = 2; + break; + } + if (object.category != null) + message.category = String(object.category); + if (object.externalUri != null) + message.externalUri = String(object.externalUri); + if (object.sourceProperties) { + if (typeof object.sourceProperties !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Finding.sourceProperties: object expected"); + message.sourceProperties = {}; + for (var keys = Object.keys(object.sourceProperties), i = 0; i < keys.length; ++i) { + if (typeof object.sourceProperties[keys[i]] !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Finding.sourceProperties: object expected"); + message.sourceProperties[keys[i]] = $root.google.protobuf.Value.fromObject(object.sourceProperties[keys[i]]); + } + } + if (object.securityMarks != null) { + if (typeof object.securityMarks !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Finding.securityMarks: object expected"); + message.securityMarks = $root.google.cloud.securitycenter.v1.SecurityMarks.fromObject(object.securityMarks); + } + if (object.eventTime != null) { + if (typeof object.eventTime !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Finding.eventTime: object expected"); + message.eventTime = $root.google.protobuf.Timestamp.fromObject(object.eventTime); + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Finding.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + return message; + }; + + /** + * Creates a plain object from a Finding message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.Finding + * @static + * @param {google.cloud.securitycenter.v1.Finding} message Finding + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Finding.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.sourceProperties = {}; + if (options.defaults) { + object.name = ""; + object.parent = ""; + object.resourceName = ""; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.category = ""; + object.externalUri = ""; + object.securityMarks = null; + object.eventTime = null; + object.createTime = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.resourceName != null && message.hasOwnProperty("resourceName")) + object.resourceName = message.resourceName; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.securitycenter.v1.Finding.State[message.state] : message.state; + if (message.category != null && message.hasOwnProperty("category")) + object.category = message.category; + if (message.externalUri != null && message.hasOwnProperty("externalUri")) + object.externalUri = message.externalUri; + var keys2; + if (message.sourceProperties && (keys2 = Object.keys(message.sourceProperties)).length) { + object.sourceProperties = {}; + for (var j = 0; j < keys2.length; ++j) + object.sourceProperties[keys2[j]] = $root.google.protobuf.Value.toObject(message.sourceProperties[keys2[j]], options); + } + if (message.securityMarks != null && message.hasOwnProperty("securityMarks")) + object.securityMarks = $root.google.cloud.securitycenter.v1.SecurityMarks.toObject(message.securityMarks, options); + if (message.eventTime != null && message.hasOwnProperty("eventTime")) + object.eventTime = $root.google.protobuf.Timestamp.toObject(message.eventTime, options); + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + return object; + }; + + /** + * Converts this Finding to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.Finding + * @instance + * @returns {Object.} JSON object + */ + Finding.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * State enum. + * @name google.cloud.securitycenter.v1.Finding.State + * @enum {string} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} ACTIVE=1 ACTIVE value + * @property {number} INACTIVE=2 INACTIVE value + */ + Finding.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ACTIVE"] = 1; + values[valuesById[2] = "INACTIVE"] = 2; + return values; + })(); + + return Finding; + })(); + + v1.OrganizationSettings = (function() { + + /** + * Properties of an OrganizationSettings. + * @memberof google.cloud.securitycenter.v1 + * @interface IOrganizationSettings + * @property {string|null} [name] OrganizationSettings name + * @property {boolean|null} [enableAssetDiscovery] OrganizationSettings enableAssetDiscovery + * @property {google.cloud.securitycenter.v1.OrganizationSettings.IAssetDiscoveryConfig|null} [assetDiscoveryConfig] OrganizationSettings assetDiscoveryConfig + */ + + /** + * Constructs a new OrganizationSettings. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents an OrganizationSettings. + * @implements IOrganizationSettings + * @constructor + * @param {google.cloud.securitycenter.v1.IOrganizationSettings=} [properties] Properties to set + */ + function OrganizationSettings(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]]; + } + + /** + * OrganizationSettings name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1.OrganizationSettings + * @instance + */ + OrganizationSettings.prototype.name = ""; + + /** + * OrganizationSettings enableAssetDiscovery. + * @member {boolean} enableAssetDiscovery + * @memberof google.cloud.securitycenter.v1.OrganizationSettings + * @instance + */ + OrganizationSettings.prototype.enableAssetDiscovery = false; + + /** + * OrganizationSettings assetDiscoveryConfig. + * @member {google.cloud.securitycenter.v1.OrganizationSettings.IAssetDiscoveryConfig|null|undefined} assetDiscoveryConfig + * @memberof google.cloud.securitycenter.v1.OrganizationSettings + * @instance + */ + OrganizationSettings.prototype.assetDiscoveryConfig = null; + + /** + * Creates a new OrganizationSettings instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.OrganizationSettings + * @static + * @param {google.cloud.securitycenter.v1.IOrganizationSettings=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.OrganizationSettings} OrganizationSettings instance + */ + OrganizationSettings.create = function create(properties) { + return new OrganizationSettings(properties); + }; + + /** + * Encodes the specified OrganizationSettings message. Does not implicitly {@link google.cloud.securitycenter.v1.OrganizationSettings.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.OrganizationSettings + * @static + * @param {google.cloud.securitycenter.v1.IOrganizationSettings} message OrganizationSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OrganizationSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.enableAssetDiscovery != null && message.hasOwnProperty("enableAssetDiscovery")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.enableAssetDiscovery); + if (message.assetDiscoveryConfig != null && message.hasOwnProperty("assetDiscoveryConfig")) + $root.google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.encode(message.assetDiscoveryConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OrganizationSettings message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.OrganizationSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.OrganizationSettings + * @static + * @param {google.cloud.securitycenter.v1.IOrganizationSettings} message OrganizationSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OrganizationSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OrganizationSettings message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.OrganizationSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.OrganizationSettings} OrganizationSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OrganizationSettings.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.cloud.securitycenter.v1.OrganizationSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.enableAssetDiscovery = reader.bool(); + break; + case 3: + message.assetDiscoveryConfig = $root.google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OrganizationSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.OrganizationSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.OrganizationSettings} OrganizationSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OrganizationSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OrganizationSettings message. + * @function verify + * @memberof google.cloud.securitycenter.v1.OrganizationSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OrganizationSettings.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.enableAssetDiscovery != null && message.hasOwnProperty("enableAssetDiscovery")) + if (typeof message.enableAssetDiscovery !== "boolean") + return "enableAssetDiscovery: boolean expected"; + if (message.assetDiscoveryConfig != null && message.hasOwnProperty("assetDiscoveryConfig")) { + var error = $root.google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.verify(message.assetDiscoveryConfig); + if (error) + return "assetDiscoveryConfig." + error; + } + return null; + }; + + /** + * Creates an OrganizationSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.OrganizationSettings + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.OrganizationSettings} OrganizationSettings + */ + OrganizationSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.OrganizationSettings) + return object; + var message = new $root.google.cloud.securitycenter.v1.OrganizationSettings(); + if (object.name != null) + message.name = String(object.name); + if (object.enableAssetDiscovery != null) + message.enableAssetDiscovery = Boolean(object.enableAssetDiscovery); + if (object.assetDiscoveryConfig != null) { + if (typeof object.assetDiscoveryConfig !== "object") + throw TypeError(".google.cloud.securitycenter.v1.OrganizationSettings.assetDiscoveryConfig: object expected"); + message.assetDiscoveryConfig = $root.google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.fromObject(object.assetDiscoveryConfig); + } + return message; + }; + + /** + * Creates a plain object from an OrganizationSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.OrganizationSettings + * @static + * @param {google.cloud.securitycenter.v1.OrganizationSettings} message OrganizationSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OrganizationSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.enableAssetDiscovery = false; + object.assetDiscoveryConfig = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.enableAssetDiscovery != null && message.hasOwnProperty("enableAssetDiscovery")) + object.enableAssetDiscovery = message.enableAssetDiscovery; + if (message.assetDiscoveryConfig != null && message.hasOwnProperty("assetDiscoveryConfig")) + object.assetDiscoveryConfig = $root.google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.toObject(message.assetDiscoveryConfig, options); + return object; + }; + + /** + * Converts this OrganizationSettings to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.OrganizationSettings + * @instance + * @returns {Object.} JSON object + */ + OrganizationSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + OrganizationSettings.AssetDiscoveryConfig = (function() { + + /** + * Properties of an AssetDiscoveryConfig. + * @memberof google.cloud.securitycenter.v1.OrganizationSettings + * @interface IAssetDiscoveryConfig + * @property {Array.|null} [projectIds] AssetDiscoveryConfig projectIds + * @property {google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode|null} [inclusionMode] AssetDiscoveryConfig inclusionMode + */ + + /** + * Constructs a new AssetDiscoveryConfig. + * @memberof google.cloud.securitycenter.v1.OrganizationSettings + * @classdesc Represents an AssetDiscoveryConfig. + * @implements IAssetDiscoveryConfig + * @constructor + * @param {google.cloud.securitycenter.v1.OrganizationSettings.IAssetDiscoveryConfig=} [properties] Properties to set + */ + function AssetDiscoveryConfig(properties) { + this.projectIds = []; + 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]]; + } + + /** + * AssetDiscoveryConfig projectIds. + * @member {Array.} projectIds + * @memberof google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig + * @instance + */ + AssetDiscoveryConfig.prototype.projectIds = $util.emptyArray; + + /** + * AssetDiscoveryConfig inclusionMode. + * @member {google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode} inclusionMode + * @memberof google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig + * @instance + */ + AssetDiscoveryConfig.prototype.inclusionMode = 0; + + /** + * Creates a new AssetDiscoveryConfig instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig + * @static + * @param {google.cloud.securitycenter.v1.OrganizationSettings.IAssetDiscoveryConfig=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig} AssetDiscoveryConfig instance + */ + AssetDiscoveryConfig.create = function create(properties) { + return new AssetDiscoveryConfig(properties); + }; + + /** + * Encodes the specified AssetDiscoveryConfig message. Does not implicitly {@link google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig + * @static + * @param {google.cloud.securitycenter.v1.OrganizationSettings.IAssetDiscoveryConfig} message AssetDiscoveryConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AssetDiscoveryConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.projectIds != null && message.projectIds.length) + for (var i = 0; i < message.projectIds.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectIds[i]); + if (message.inclusionMode != null && message.hasOwnProperty("inclusionMode")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.inclusionMode); + return writer; + }; + + /** + * Encodes the specified AssetDiscoveryConfig message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig + * @static + * @param {google.cloud.securitycenter.v1.OrganizationSettings.IAssetDiscoveryConfig} message AssetDiscoveryConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AssetDiscoveryConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AssetDiscoveryConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig} AssetDiscoveryConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AssetDiscoveryConfig.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.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.projectIds && message.projectIds.length)) + message.projectIds = []; + message.projectIds.push(reader.string()); + break; + case 2: + message.inclusionMode = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AssetDiscoveryConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig} AssetDiscoveryConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AssetDiscoveryConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AssetDiscoveryConfig message. + * @function verify + * @memberof google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AssetDiscoveryConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.projectIds != null && message.hasOwnProperty("projectIds")) { + if (!Array.isArray(message.projectIds)) + return "projectIds: array expected"; + for (var i = 0; i < message.projectIds.length; ++i) + if (!$util.isString(message.projectIds[i])) + return "projectIds: string[] expected"; + } + if (message.inclusionMode != null && message.hasOwnProperty("inclusionMode")) + switch (message.inclusionMode) { + default: + return "inclusionMode: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates an AssetDiscoveryConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig} AssetDiscoveryConfig + */ + AssetDiscoveryConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig) + return object; + var message = new $root.google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig(); + if (object.projectIds) { + if (!Array.isArray(object.projectIds)) + throw TypeError(".google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.projectIds: array expected"); + message.projectIds = []; + for (var i = 0; i < object.projectIds.length; ++i) + message.projectIds[i] = String(object.projectIds[i]); + } + switch (object.inclusionMode) { + case "INCLUSION_MODE_UNSPECIFIED": + case 0: + message.inclusionMode = 0; + break; + case "INCLUDE_ONLY": + case 1: + message.inclusionMode = 1; + break; + case "EXCLUDE": + case 2: + message.inclusionMode = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from an AssetDiscoveryConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig + * @static + * @param {google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig} message AssetDiscoveryConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AssetDiscoveryConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.projectIds = []; + if (options.defaults) + object.inclusionMode = options.enums === String ? "INCLUSION_MODE_UNSPECIFIED" : 0; + if (message.projectIds && message.projectIds.length) { + object.projectIds = []; + for (var j = 0; j < message.projectIds.length; ++j) + object.projectIds[j] = message.projectIds[j]; + } + if (message.inclusionMode != null && message.hasOwnProperty("inclusionMode")) + object.inclusionMode = options.enums === String ? $root.google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode[message.inclusionMode] : message.inclusionMode; + return object; + }; + + /** + * Converts this AssetDiscoveryConfig to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig + * @instance + * @returns {Object.} JSON object + */ + AssetDiscoveryConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * InclusionMode enum. + * @name google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode + * @enum {string} + * @property {number} INCLUSION_MODE_UNSPECIFIED=0 INCLUSION_MODE_UNSPECIFIED value + * @property {number} INCLUDE_ONLY=1 INCLUDE_ONLY value + * @property {number} EXCLUDE=2 EXCLUDE value + */ + AssetDiscoveryConfig.InclusionMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "INCLUSION_MODE_UNSPECIFIED"] = 0; + values[valuesById[1] = "INCLUDE_ONLY"] = 1; + values[valuesById[2] = "EXCLUDE"] = 2; + return values; + })(); + + return AssetDiscoveryConfig; + })(); + + return OrganizationSettings; + })(); + + v1.RunAssetDiscoveryResponse = (function() { + + /** + * Properties of a RunAssetDiscoveryResponse. + * @memberof google.cloud.securitycenter.v1 + * @interface IRunAssetDiscoveryResponse + * @property {google.cloud.securitycenter.v1.RunAssetDiscoveryResponse.State|null} [state] RunAssetDiscoveryResponse state + * @property {google.protobuf.IDuration|null} [duration] RunAssetDiscoveryResponse duration + */ + + /** + * Constructs a new RunAssetDiscoveryResponse. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a RunAssetDiscoveryResponse. + * @implements IRunAssetDiscoveryResponse + * @constructor + * @param {google.cloud.securitycenter.v1.IRunAssetDiscoveryResponse=} [properties] Properties to set + */ + function RunAssetDiscoveryResponse(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]]; + } + + /** + * RunAssetDiscoveryResponse state. + * @member {google.cloud.securitycenter.v1.RunAssetDiscoveryResponse.State} state + * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryResponse + * @instance + */ + RunAssetDiscoveryResponse.prototype.state = 0; + + /** + * RunAssetDiscoveryResponse duration. + * @member {google.protobuf.IDuration|null|undefined} duration + * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryResponse + * @instance + */ + RunAssetDiscoveryResponse.prototype.duration = null; + + /** + * Creates a new RunAssetDiscoveryResponse instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryResponse + * @static + * @param {google.cloud.securitycenter.v1.IRunAssetDiscoveryResponse=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.RunAssetDiscoveryResponse} RunAssetDiscoveryResponse instance + */ + RunAssetDiscoveryResponse.create = function create(properties) { + return new RunAssetDiscoveryResponse(properties); + }; + + /** + * Encodes the specified RunAssetDiscoveryResponse message. Does not implicitly {@link google.cloud.securitycenter.v1.RunAssetDiscoveryResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryResponse + * @static + * @param {google.cloud.securitycenter.v1.IRunAssetDiscoveryResponse} message RunAssetDiscoveryResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RunAssetDiscoveryResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.state != null && message.hasOwnProperty("state")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.state); + if (message.duration != null && message.hasOwnProperty("duration")) + $root.google.protobuf.Duration.encode(message.duration, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RunAssetDiscoveryResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.RunAssetDiscoveryResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryResponse + * @static + * @param {google.cloud.securitycenter.v1.IRunAssetDiscoveryResponse} message RunAssetDiscoveryResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RunAssetDiscoveryResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RunAssetDiscoveryResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.RunAssetDiscoveryResponse} RunAssetDiscoveryResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RunAssetDiscoveryResponse.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.cloud.securitycenter.v1.RunAssetDiscoveryResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.state = reader.int32(); + break; + case 2: + message.duration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RunAssetDiscoveryResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.RunAssetDiscoveryResponse} RunAssetDiscoveryResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RunAssetDiscoveryResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RunAssetDiscoveryResponse message. + * @function verify + * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RunAssetDiscoveryResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.duration != null && message.hasOwnProperty("duration")) { + var error = $root.google.protobuf.Duration.verify(message.duration); + if (error) + return "duration." + error; + } + return null; + }; + + /** + * Creates a RunAssetDiscoveryResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.RunAssetDiscoveryResponse} RunAssetDiscoveryResponse + */ + RunAssetDiscoveryResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.RunAssetDiscoveryResponse) + return object; + var message = new $root.google.cloud.securitycenter.v1.RunAssetDiscoveryResponse(); + switch (object.state) { + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "COMPLETED": + case 1: + message.state = 1; + break; + case "SUPERSEDED": + case 2: + message.state = 2; + break; + case "TERMINATED": + case 3: + message.state = 3; + break; + } + if (object.duration != null) { + if (typeof object.duration !== "object") + throw TypeError(".google.cloud.securitycenter.v1.RunAssetDiscoveryResponse.duration: object expected"); + message.duration = $root.google.protobuf.Duration.fromObject(object.duration); + } + return message; + }; + + /** + * Creates a plain object from a RunAssetDiscoveryResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryResponse + * @static + * @param {google.cloud.securitycenter.v1.RunAssetDiscoveryResponse} message RunAssetDiscoveryResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RunAssetDiscoveryResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.duration = null; + } + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.securitycenter.v1.RunAssetDiscoveryResponse.State[message.state] : message.state; + if (message.duration != null && message.hasOwnProperty("duration")) + object.duration = $root.google.protobuf.Duration.toObject(message.duration, options); + return object; + }; + + /** + * Converts this RunAssetDiscoveryResponse to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryResponse + * @instance + * @returns {Object.} JSON object + */ + RunAssetDiscoveryResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * State enum. + * @name google.cloud.securitycenter.v1.RunAssetDiscoveryResponse.State + * @enum {string} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} COMPLETED=1 COMPLETED value + * @property {number} SUPERSEDED=2 SUPERSEDED value + * @property {number} TERMINATED=3 TERMINATED value + */ + RunAssetDiscoveryResponse.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "COMPLETED"] = 1; + values[valuesById[2] = "SUPERSEDED"] = 2; + values[valuesById[3] = "TERMINATED"] = 3; + return values; + })(); + + return RunAssetDiscoveryResponse; + })(); + + v1.Source = (function() { + + /** + * Properties of a Source. + * @memberof google.cloud.securitycenter.v1 + * @interface ISource + * @property {string|null} [name] Source name + * @property {string|null} [displayName] Source displayName + * @property {string|null} [description] Source description + */ + + /** + * Constructs a new Source. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a Source. + * @implements ISource + * @constructor + * @param {google.cloud.securitycenter.v1.ISource=} [properties] Properties to set + */ + function Source(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]]; + } + + /** + * Source name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1.Source + * @instance + */ + Source.prototype.name = ""; + + /** + * Source displayName. + * @member {string} displayName + * @memberof google.cloud.securitycenter.v1.Source + * @instance + */ + Source.prototype.displayName = ""; + + /** + * Source description. + * @member {string} description + * @memberof google.cloud.securitycenter.v1.Source + * @instance + */ + Source.prototype.description = ""; + + /** + * Creates a new Source instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.Source + * @static + * @param {google.cloud.securitycenter.v1.ISource=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.Source} Source instance + */ + Source.create = function create(properties) { + return new Source(properties); + }; + + /** + * Encodes the specified Source message. Does not implicitly {@link google.cloud.securitycenter.v1.Source.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.Source + * @static + * @param {google.cloud.securitycenter.v1.ISource} message Source message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Source.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.displayName != null && message.hasOwnProperty("displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + if (message.description != null && message.hasOwnProperty("description")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + return writer; + }; + + /** + * Encodes the specified Source message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Source.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.Source + * @static + * @param {google.cloud.securitycenter.v1.ISource} message Source message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Source.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Source message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.Source + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.Source} Source + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Source.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.cloud.securitycenter.v1.Source(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.displayName = reader.string(); + break; + case 3: + message.description = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Source message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.Source + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.Source} Source + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Source.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Source message. + * @function verify + * @memberof google.cloud.securitycenter.v1.Source + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Source.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.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + return null; + }; + + /** + * Creates a Source message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.Source + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.Source} Source + */ + Source.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.Source) + return object; + var message = new $root.google.cloud.securitycenter.v1.Source(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.description != null) + message.description = String(object.description); + return message; + }; + + /** + * Creates a plain object from a Source message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.Source + * @static + * @param {google.cloud.securitycenter.v1.Source} message Source + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Source.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.description = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + return object; + }; + + /** + * Converts this Source to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.Source + * @instance + * @returns {Object.} JSON object + */ + Source.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Source; + })(); + + return v1; + })(); + + securitycenter.v1beta1 = (function() { + + /** + * Namespace v1beta1. + * @memberof google.cloud.securitycenter + * @namespace + */ + var v1beta1 = {}; + + v1beta1.SecurityCenter = (function() { + + /** + * Constructs a new SecurityCenter service. + * @memberof google.cloud.securitycenter.v1beta1 + * @classdesc Represents a SecurityCenter + * @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 SecurityCenter(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (SecurityCenter.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = SecurityCenter; + + /** + * Creates new SecurityCenter service using the specified rpc implementation. + * @function create + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @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 {SecurityCenter} RPC service. Useful where requests and/or responses are streamed. + */ + SecurityCenter.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter#createSource}. + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @typedef CreateSourceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1beta1.Source} [response] Source + */ + + /** + * Calls CreateSource. + * @function createSource + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1beta1.ICreateSourceRequest} request CreateSourceRequest message or plain object + * @param {google.cloud.securitycenter.v1beta1.SecurityCenter.CreateSourceCallback} callback Node-style callback called with the error, if any, and Source + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.createSource = function createSource(request, callback) { + return this.rpcCall(createSource, $root.google.cloud.securitycenter.v1beta1.CreateSourceRequest, $root.google.cloud.securitycenter.v1beta1.Source, request, callback); + }, "name", { value: "CreateSource" }); + + /** + * Calls CreateSource. + * @function createSource + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1beta1.ICreateSourceRequest} request CreateSourceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter#createFinding}. + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @typedef CreateFindingCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1beta1.Finding} [response] Finding + */ + + /** + * Calls CreateFinding. + * @function createFinding + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1beta1.ICreateFindingRequest} request CreateFindingRequest message or plain object + * @param {google.cloud.securitycenter.v1beta1.SecurityCenter.CreateFindingCallback} callback Node-style callback called with the error, if any, and Finding + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.createFinding = function createFinding(request, callback) { + return this.rpcCall(createFinding, $root.google.cloud.securitycenter.v1beta1.CreateFindingRequest, $root.google.cloud.securitycenter.v1beta1.Finding, request, callback); + }, "name", { value: "CreateFinding" }); + + /** + * Calls CreateFinding. + * @function createFinding + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1beta1.ICreateFindingRequest} request CreateFindingRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter#getIamPolicy}. + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @typedef GetIamPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.iam.v1.Policy} [response] Policy + */ + + /** + * Calls GetIamPolicy. + * @function getIamPolicy + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @instance + * @param {google.iam.v1.IGetIamPolicyRequest} request GetIamPolicyRequest message or plain object + * @param {google.cloud.securitycenter.v1beta1.SecurityCenter.GetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.getIamPolicy = function getIamPolicy(request, callback) { + return this.rpcCall(getIamPolicy, $root.google.iam.v1.GetIamPolicyRequest, $root.google.iam.v1.Policy, request, callback); + }, "name", { value: "GetIamPolicy" }); + + /** + * Calls GetIamPolicy. + * @function getIamPolicy + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @instance + * @param {google.iam.v1.IGetIamPolicyRequest} request GetIamPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter#getOrganizationSettings}. + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @typedef GetOrganizationSettingsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1beta1.OrganizationSettings} [response] OrganizationSettings + */ + + /** + * Calls GetOrganizationSettings. + * @function getOrganizationSettings + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1beta1.IGetOrganizationSettingsRequest} request GetOrganizationSettingsRequest message or plain object + * @param {google.cloud.securitycenter.v1beta1.SecurityCenter.GetOrganizationSettingsCallback} callback Node-style callback called with the error, if any, and OrganizationSettings + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.getOrganizationSettings = function getOrganizationSettings(request, callback) { + return this.rpcCall(getOrganizationSettings, $root.google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest, $root.google.cloud.securitycenter.v1beta1.OrganizationSettings, request, callback); + }, "name", { value: "GetOrganizationSettings" }); + + /** + * Calls GetOrganizationSettings. + * @function getOrganizationSettings + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1beta1.IGetOrganizationSettingsRequest} request GetOrganizationSettingsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter#getSource}. + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @typedef GetSourceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1beta1.Source} [response] Source + */ + + /** + * Calls GetSource. + * @function getSource + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1beta1.IGetSourceRequest} request GetSourceRequest message or plain object + * @param {google.cloud.securitycenter.v1beta1.SecurityCenter.GetSourceCallback} callback Node-style callback called with the error, if any, and Source + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.getSource = function getSource(request, callback) { + return this.rpcCall(getSource, $root.google.cloud.securitycenter.v1beta1.GetSourceRequest, $root.google.cloud.securitycenter.v1beta1.Source, request, callback); + }, "name", { value: "GetSource" }); + + /** + * Calls GetSource. + * @function getSource + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1beta1.IGetSourceRequest} request GetSourceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter#groupAssets}. + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @typedef GroupAssetsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1beta1.GroupAssetsResponse} [response] GroupAssetsResponse + */ + + /** + * Calls GroupAssets. + * @function groupAssets + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1beta1.IGroupAssetsRequest} request GroupAssetsRequest message or plain object + * @param {google.cloud.securitycenter.v1beta1.SecurityCenter.GroupAssetsCallback} callback Node-style callback called with the error, if any, and GroupAssetsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.groupAssets = function groupAssets(request, callback) { + return this.rpcCall(groupAssets, $root.google.cloud.securitycenter.v1beta1.GroupAssetsRequest, $root.google.cloud.securitycenter.v1beta1.GroupAssetsResponse, request, callback); + }, "name", { value: "GroupAssets" }); + + /** + * Calls GroupAssets. + * @function groupAssets + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1beta1.IGroupAssetsRequest} request GroupAssetsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter#groupFindings}. + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @typedef GroupFindingsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1beta1.GroupFindingsResponse} [response] GroupFindingsResponse + */ + + /** + * Calls GroupFindings. + * @function groupFindings + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1beta1.IGroupFindingsRequest} request GroupFindingsRequest message or plain object + * @param {google.cloud.securitycenter.v1beta1.SecurityCenter.GroupFindingsCallback} callback Node-style callback called with the error, if any, and GroupFindingsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.groupFindings = function groupFindings(request, callback) { + return this.rpcCall(groupFindings, $root.google.cloud.securitycenter.v1beta1.GroupFindingsRequest, $root.google.cloud.securitycenter.v1beta1.GroupFindingsResponse, request, callback); + }, "name", { value: "GroupFindings" }); + + /** + * Calls GroupFindings. + * @function groupFindings + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1beta1.IGroupFindingsRequest} request GroupFindingsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter#listAssets}. + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @typedef ListAssetsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1beta1.ListAssetsResponse} [response] ListAssetsResponse + */ + + /** + * Calls ListAssets. + * @function listAssets + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1beta1.IListAssetsRequest} request ListAssetsRequest message or plain object + * @param {google.cloud.securitycenter.v1beta1.SecurityCenter.ListAssetsCallback} callback Node-style callback called with the error, if any, and ListAssetsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.listAssets = function listAssets(request, callback) { + return this.rpcCall(listAssets, $root.google.cloud.securitycenter.v1beta1.ListAssetsRequest, $root.google.cloud.securitycenter.v1beta1.ListAssetsResponse, request, callback); + }, "name", { value: "ListAssets" }); + + /** + * Calls ListAssets. + * @function listAssets + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1beta1.IListAssetsRequest} request ListAssetsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter#listFindings}. + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @typedef ListFindingsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1beta1.ListFindingsResponse} [response] ListFindingsResponse + */ + + /** + * Calls ListFindings. + * @function listFindings + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1beta1.IListFindingsRequest} request ListFindingsRequest message or plain object + * @param {google.cloud.securitycenter.v1beta1.SecurityCenter.ListFindingsCallback} callback Node-style callback called with the error, if any, and ListFindingsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.listFindings = function listFindings(request, callback) { + return this.rpcCall(listFindings, $root.google.cloud.securitycenter.v1beta1.ListFindingsRequest, $root.google.cloud.securitycenter.v1beta1.ListFindingsResponse, request, callback); + }, "name", { value: "ListFindings" }); + + /** + * Calls ListFindings. + * @function listFindings + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1beta1.IListFindingsRequest} request ListFindingsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter#listSources}. + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @typedef ListSourcesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1beta1.ListSourcesResponse} [response] ListSourcesResponse + */ + + /** + * Calls ListSources. + * @function listSources + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1beta1.IListSourcesRequest} request ListSourcesRequest message or plain object + * @param {google.cloud.securitycenter.v1beta1.SecurityCenter.ListSourcesCallback} callback Node-style callback called with the error, if any, and ListSourcesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.listSources = function listSources(request, callback) { + return this.rpcCall(listSources, $root.google.cloud.securitycenter.v1beta1.ListSourcesRequest, $root.google.cloud.securitycenter.v1beta1.ListSourcesResponse, request, callback); + }, "name", { value: "ListSources" }); + + /** + * Calls ListSources. + * @function listSources + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1beta1.IListSourcesRequest} request ListSourcesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter#runAssetDiscovery}. + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @typedef RunAssetDiscoveryCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls RunAssetDiscovery. + * @function runAssetDiscovery + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1beta1.IRunAssetDiscoveryRequest} request RunAssetDiscoveryRequest message or plain object + * @param {google.cloud.securitycenter.v1beta1.SecurityCenter.RunAssetDiscoveryCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.runAssetDiscovery = function runAssetDiscovery(request, callback) { + return this.rpcCall(runAssetDiscovery, $root.google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "RunAssetDiscovery" }); + + /** + * Calls RunAssetDiscovery. + * @function runAssetDiscovery + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1beta1.IRunAssetDiscoveryRequest} request RunAssetDiscoveryRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter#setFindingState}. + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @typedef SetFindingStateCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1beta1.Finding} [response] Finding + */ + + /** + * Calls SetFindingState. + * @function setFindingState + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1beta1.ISetFindingStateRequest} request SetFindingStateRequest message or plain object + * @param {google.cloud.securitycenter.v1beta1.SecurityCenter.SetFindingStateCallback} callback Node-style callback called with the error, if any, and Finding + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.setFindingState = function setFindingState(request, callback) { + return this.rpcCall(setFindingState, $root.google.cloud.securitycenter.v1beta1.SetFindingStateRequest, $root.google.cloud.securitycenter.v1beta1.Finding, request, callback); + }, "name", { value: "SetFindingState" }); + + /** + * Calls SetFindingState. + * @function setFindingState + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1beta1.ISetFindingStateRequest} request SetFindingStateRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter#setIamPolicy}. + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @typedef SetIamPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.iam.v1.Policy} [response] Policy + */ + + /** + * Calls SetIamPolicy. + * @function setIamPolicy + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @instance + * @param {google.iam.v1.ISetIamPolicyRequest} request SetIamPolicyRequest message or plain object + * @param {google.cloud.securitycenter.v1beta1.SecurityCenter.SetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.setIamPolicy = function setIamPolicy(request, callback) { + return this.rpcCall(setIamPolicy, $root.google.iam.v1.SetIamPolicyRequest, $root.google.iam.v1.Policy, request, callback); + }, "name", { value: "SetIamPolicy" }); + + /** + * Calls SetIamPolicy. + * @function setIamPolicy + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @instance + * @param {google.iam.v1.ISetIamPolicyRequest} request SetIamPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter#testIamPermissions}. + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @typedef TestIamPermissionsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.iam.v1.TestIamPermissionsResponse} [response] TestIamPermissionsResponse + */ + + /** + * Calls TestIamPermissions. + * @function testIamPermissions + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @instance + * @param {google.iam.v1.ITestIamPermissionsRequest} request TestIamPermissionsRequest message or plain object + * @param {google.cloud.securitycenter.v1beta1.SecurityCenter.TestIamPermissionsCallback} callback Node-style callback called with the error, if any, and TestIamPermissionsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.testIamPermissions = function testIamPermissions(request, callback) { + return this.rpcCall(testIamPermissions, $root.google.iam.v1.TestIamPermissionsRequest, $root.google.iam.v1.TestIamPermissionsResponse, request, callback); + }, "name", { value: "TestIamPermissions" }); + + /** + * Calls TestIamPermissions. + * @function testIamPermissions + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @instance + * @param {google.iam.v1.ITestIamPermissionsRequest} request TestIamPermissionsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter#updateFinding}. + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @typedef UpdateFindingCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1beta1.Finding} [response] Finding + */ + + /** + * Calls UpdateFinding. + * @function updateFinding + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1beta1.IUpdateFindingRequest} request UpdateFindingRequest message or plain object + * @param {google.cloud.securitycenter.v1beta1.SecurityCenter.UpdateFindingCallback} callback Node-style callback called with the error, if any, and Finding + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.updateFinding = function updateFinding(request, callback) { + return this.rpcCall(updateFinding, $root.google.cloud.securitycenter.v1beta1.UpdateFindingRequest, $root.google.cloud.securitycenter.v1beta1.Finding, request, callback); + }, "name", { value: "UpdateFinding" }); + + /** + * Calls UpdateFinding. + * @function updateFinding + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1beta1.IUpdateFindingRequest} request UpdateFindingRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter#updateOrganizationSettings}. + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @typedef UpdateOrganizationSettingsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1beta1.OrganizationSettings} [response] OrganizationSettings + */ + + /** + * Calls UpdateOrganizationSettings. + * @function updateOrganizationSettings + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1beta1.IUpdateOrganizationSettingsRequest} request UpdateOrganizationSettingsRequest message or plain object + * @param {google.cloud.securitycenter.v1beta1.SecurityCenter.UpdateOrganizationSettingsCallback} callback Node-style callback called with the error, if any, and OrganizationSettings + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.updateOrganizationSettings = function updateOrganizationSettings(request, callback) { + return this.rpcCall(updateOrganizationSettings, $root.google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest, $root.google.cloud.securitycenter.v1beta1.OrganizationSettings, request, callback); + }, "name", { value: "UpdateOrganizationSettings" }); + + /** + * Calls UpdateOrganizationSettings. + * @function updateOrganizationSettings + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1beta1.IUpdateOrganizationSettingsRequest} request UpdateOrganizationSettingsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter#updateSource}. + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @typedef UpdateSourceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1beta1.Source} [response] Source + */ + + /** + * Calls UpdateSource. + * @function updateSource + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1beta1.IUpdateSourceRequest} request UpdateSourceRequest message or plain object + * @param {google.cloud.securitycenter.v1beta1.SecurityCenter.UpdateSourceCallback} callback Node-style callback called with the error, if any, and Source + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.updateSource = function updateSource(request, callback) { + return this.rpcCall(updateSource, $root.google.cloud.securitycenter.v1beta1.UpdateSourceRequest, $root.google.cloud.securitycenter.v1beta1.Source, request, callback); + }, "name", { value: "UpdateSource" }); + + /** + * Calls UpdateSource. + * @function updateSource + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1beta1.IUpdateSourceRequest} request UpdateSourceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter#updateSecurityMarks}. + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @typedef UpdateSecurityMarksCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1beta1.SecurityMarks} [response] SecurityMarks + */ + + /** + * Calls UpdateSecurityMarks. + * @function updateSecurityMarks + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1beta1.IUpdateSecurityMarksRequest} request UpdateSecurityMarksRequest message or plain object + * @param {google.cloud.securitycenter.v1beta1.SecurityCenter.UpdateSecurityMarksCallback} callback Node-style callback called with the error, if any, and SecurityMarks + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.updateSecurityMarks = function updateSecurityMarks(request, callback) { + return this.rpcCall(updateSecurityMarks, $root.google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest, $root.google.cloud.securitycenter.v1beta1.SecurityMarks, request, callback); + }, "name", { value: "UpdateSecurityMarks" }); + + /** + * Calls UpdateSecurityMarks. + * @function updateSecurityMarks + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1beta1.IUpdateSecurityMarksRequest} request UpdateSecurityMarksRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return SecurityCenter; + })(); + + v1beta1.CreateFindingRequest = (function() { + + /** + * Properties of a CreateFindingRequest. + * @memberof google.cloud.securitycenter.v1beta1 + * @interface ICreateFindingRequest + * @property {string|null} [parent] CreateFindingRequest parent + * @property {string|null} [findingId] CreateFindingRequest findingId + * @property {google.cloud.securitycenter.v1beta1.IFinding|null} [finding] CreateFindingRequest finding + */ + + /** + * Constructs a new CreateFindingRequest. + * @memberof google.cloud.securitycenter.v1beta1 + * @classdesc Represents a CreateFindingRequest. + * @implements ICreateFindingRequest + * @constructor + * @param {google.cloud.securitycenter.v1beta1.ICreateFindingRequest=} [properties] Properties to set + */ + function CreateFindingRequest(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]]; + } + + /** + * CreateFindingRequest parent. + * @member {string} parent + * @memberof google.cloud.securitycenter.v1beta1.CreateFindingRequest + * @instance + */ + CreateFindingRequest.prototype.parent = ""; + + /** + * CreateFindingRequest findingId. + * @member {string} findingId + * @memberof google.cloud.securitycenter.v1beta1.CreateFindingRequest + * @instance + */ + CreateFindingRequest.prototype.findingId = ""; + + /** + * CreateFindingRequest finding. + * @member {google.cloud.securitycenter.v1beta1.IFinding|null|undefined} finding + * @memberof google.cloud.securitycenter.v1beta1.CreateFindingRequest + * @instance + */ + CreateFindingRequest.prototype.finding = null; + + /** + * Creates a new CreateFindingRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1beta1.CreateFindingRequest + * @static + * @param {google.cloud.securitycenter.v1beta1.ICreateFindingRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1beta1.CreateFindingRequest} CreateFindingRequest instance + */ + CreateFindingRequest.create = function create(properties) { + return new CreateFindingRequest(properties); + }; + + /** + * Encodes the specified CreateFindingRequest message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.CreateFindingRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1beta1.CreateFindingRequest + * @static + * @param {google.cloud.securitycenter.v1beta1.ICreateFindingRequest} message CreateFindingRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateFindingRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && message.hasOwnProperty("parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.findingId != null && message.hasOwnProperty("findingId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.findingId); + if (message.finding != null && message.hasOwnProperty("finding")) + $root.google.cloud.securitycenter.v1beta1.Finding.encode(message.finding, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateFindingRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.CreateFindingRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1beta1.CreateFindingRequest + * @static + * @param {google.cloud.securitycenter.v1beta1.ICreateFindingRequest} message CreateFindingRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateFindingRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateFindingRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1beta1.CreateFindingRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1beta1.CreateFindingRequest} CreateFindingRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateFindingRequest.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.cloud.securitycenter.v1beta1.CreateFindingRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.findingId = reader.string(); + break; + case 3: + message.finding = $root.google.cloud.securitycenter.v1beta1.Finding.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateFindingRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1beta1.CreateFindingRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1beta1.CreateFindingRequest} CreateFindingRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateFindingRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateFindingRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1beta1.CreateFindingRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateFindingRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.findingId != null && message.hasOwnProperty("findingId")) + if (!$util.isString(message.findingId)) + return "findingId: string expected"; + if (message.finding != null && message.hasOwnProperty("finding")) { + var error = $root.google.cloud.securitycenter.v1beta1.Finding.verify(message.finding); + if (error) + return "finding." + error; + } + return null; + }; + + /** + * Creates a CreateFindingRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1beta1.CreateFindingRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1beta1.CreateFindingRequest} CreateFindingRequest + */ + CreateFindingRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1beta1.CreateFindingRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1beta1.CreateFindingRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.findingId != null) + message.findingId = String(object.findingId); + if (object.finding != null) { + if (typeof object.finding !== "object") + throw TypeError(".google.cloud.securitycenter.v1beta1.CreateFindingRequest.finding: object expected"); + message.finding = $root.google.cloud.securitycenter.v1beta1.Finding.fromObject(object.finding); + } + return message; + }; + + /** + * Creates a plain object from a CreateFindingRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1beta1.CreateFindingRequest + * @static + * @param {google.cloud.securitycenter.v1beta1.CreateFindingRequest} message CreateFindingRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateFindingRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.findingId = ""; + object.finding = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.findingId != null && message.hasOwnProperty("findingId")) + object.findingId = message.findingId; + if (message.finding != null && message.hasOwnProperty("finding")) + object.finding = $root.google.cloud.securitycenter.v1beta1.Finding.toObject(message.finding, options); + return object; + }; + + /** + * Converts this CreateFindingRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1beta1.CreateFindingRequest + * @instance + * @returns {Object.} JSON object + */ + CreateFindingRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return CreateFindingRequest; + })(); + + v1beta1.CreateSourceRequest = (function() { + + /** + * Properties of a CreateSourceRequest. + * @memberof google.cloud.securitycenter.v1beta1 + * @interface ICreateSourceRequest + * @property {string|null} [parent] CreateSourceRequest parent + * @property {google.cloud.securitycenter.v1beta1.ISource|null} [source] CreateSourceRequest source + */ + + /** + * Constructs a new CreateSourceRequest. + * @memberof google.cloud.securitycenter.v1beta1 + * @classdesc Represents a CreateSourceRequest. + * @implements ICreateSourceRequest + * @constructor + * @param {google.cloud.securitycenter.v1beta1.ICreateSourceRequest=} [properties] Properties to set + */ + function CreateSourceRequest(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]]; + } + + /** + * CreateSourceRequest parent. + * @member {string} parent + * @memberof google.cloud.securitycenter.v1beta1.CreateSourceRequest + * @instance + */ + CreateSourceRequest.prototype.parent = ""; + + /** + * CreateSourceRequest source. + * @member {google.cloud.securitycenter.v1beta1.ISource|null|undefined} source + * @memberof google.cloud.securitycenter.v1beta1.CreateSourceRequest + * @instance + */ + CreateSourceRequest.prototype.source = null; + + /** + * Creates a new CreateSourceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1beta1.CreateSourceRequest + * @static + * @param {google.cloud.securitycenter.v1beta1.ICreateSourceRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1beta1.CreateSourceRequest} CreateSourceRequest instance + */ + CreateSourceRequest.create = function create(properties) { + return new CreateSourceRequest(properties); + }; + + /** + * Encodes the specified CreateSourceRequest message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.CreateSourceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1beta1.CreateSourceRequest + * @static + * @param {google.cloud.securitycenter.v1beta1.ICreateSourceRequest} message CreateSourceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateSourceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && message.hasOwnProperty("parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.source != null && message.hasOwnProperty("source")) + $root.google.cloud.securitycenter.v1beta1.Source.encode(message.source, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateSourceRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.CreateSourceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1beta1.CreateSourceRequest + * @static + * @param {google.cloud.securitycenter.v1beta1.ICreateSourceRequest} message CreateSourceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateSourceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateSourceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1beta1.CreateSourceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1beta1.CreateSourceRequest} CreateSourceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateSourceRequest.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.cloud.securitycenter.v1beta1.CreateSourceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.source = $root.google.cloud.securitycenter.v1beta1.Source.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateSourceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1beta1.CreateSourceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1beta1.CreateSourceRequest} CreateSourceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateSourceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateSourceRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1beta1.CreateSourceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateSourceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.source != null && message.hasOwnProperty("source")) { + var error = $root.google.cloud.securitycenter.v1beta1.Source.verify(message.source); + if (error) + return "source." + error; + } + return null; + }; + + /** + * Creates a CreateSourceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1beta1.CreateSourceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1beta1.CreateSourceRequest} CreateSourceRequest + */ + CreateSourceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1beta1.CreateSourceRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1beta1.CreateSourceRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.source != null) { + if (typeof object.source !== "object") + throw TypeError(".google.cloud.securitycenter.v1beta1.CreateSourceRequest.source: object expected"); + message.source = $root.google.cloud.securitycenter.v1beta1.Source.fromObject(object.source); + } + return message; + }; + + /** + * Creates a plain object from a CreateSourceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1beta1.CreateSourceRequest + * @static + * @param {google.cloud.securitycenter.v1beta1.CreateSourceRequest} message CreateSourceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateSourceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.source = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.source != null && message.hasOwnProperty("source")) + object.source = $root.google.cloud.securitycenter.v1beta1.Source.toObject(message.source, options); + return object; + }; + + /** + * Converts this CreateSourceRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1beta1.CreateSourceRequest + * @instance + * @returns {Object.} JSON object + */ + CreateSourceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return CreateSourceRequest; + })(); + + v1beta1.GetOrganizationSettingsRequest = (function() { + + /** + * Properties of a GetOrganizationSettingsRequest. + * @memberof google.cloud.securitycenter.v1beta1 + * @interface IGetOrganizationSettingsRequest + * @property {string|null} [name] GetOrganizationSettingsRequest name + */ + + /** + * Constructs a new GetOrganizationSettingsRequest. + * @memberof google.cloud.securitycenter.v1beta1 + * @classdesc Represents a GetOrganizationSettingsRequest. + * @implements IGetOrganizationSettingsRequest + * @constructor + * @param {google.cloud.securitycenter.v1beta1.IGetOrganizationSettingsRequest=} [properties] Properties to set + */ + function GetOrganizationSettingsRequest(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]]; + } + + /** + * GetOrganizationSettingsRequest name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest + * @instance + */ + GetOrganizationSettingsRequest.prototype.name = ""; + + /** + * Creates a new GetOrganizationSettingsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest + * @static + * @param {google.cloud.securitycenter.v1beta1.IGetOrganizationSettingsRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest} GetOrganizationSettingsRequest instance + */ + GetOrganizationSettingsRequest.create = function create(properties) { + return new GetOrganizationSettingsRequest(properties); + }; + + /** + * Encodes the specified GetOrganizationSettingsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest + * @static + * @param {google.cloud.securitycenter.v1beta1.IGetOrganizationSettingsRequest} message GetOrganizationSettingsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetOrganizationSettingsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetOrganizationSettingsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest + * @static + * @param {google.cloud.securitycenter.v1beta1.IGetOrganizationSettingsRequest} message GetOrganizationSettingsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetOrganizationSettingsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetOrganizationSettingsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest} GetOrganizationSettingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetOrganizationSettingsRequest.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.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest(); + 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 GetOrganizationSettingsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest} GetOrganizationSettingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetOrganizationSettingsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetOrganizationSettingsRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetOrganizationSettingsRequest.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 GetOrganizationSettingsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest} GetOrganizationSettingsRequest + */ + GetOrganizationSettingsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetOrganizationSettingsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest + * @static + * @param {google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest} message GetOrganizationSettingsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetOrganizationSettingsRequest.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 GetOrganizationSettingsRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest + * @instance + * @returns {Object.} JSON object + */ + GetOrganizationSettingsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetOrganizationSettingsRequest; + })(); + + v1beta1.GetSourceRequest = (function() { + + /** + * Properties of a GetSourceRequest. + * @memberof google.cloud.securitycenter.v1beta1 + * @interface IGetSourceRequest + * @property {string|null} [name] GetSourceRequest name + */ + + /** + * Constructs a new GetSourceRequest. + * @memberof google.cloud.securitycenter.v1beta1 + * @classdesc Represents a GetSourceRequest. + * @implements IGetSourceRequest + * @constructor + * @param {google.cloud.securitycenter.v1beta1.IGetSourceRequest=} [properties] Properties to set + */ + function GetSourceRequest(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]]; + } + + /** + * GetSourceRequest name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1beta1.GetSourceRequest + * @instance + */ + GetSourceRequest.prototype.name = ""; + + /** + * Creates a new GetSourceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1beta1.GetSourceRequest + * @static + * @param {google.cloud.securitycenter.v1beta1.IGetSourceRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1beta1.GetSourceRequest} GetSourceRequest instance + */ + GetSourceRequest.create = function create(properties) { + return new GetSourceRequest(properties); + }; + + /** + * Encodes the specified GetSourceRequest message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.GetSourceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1beta1.GetSourceRequest + * @static + * @param {google.cloud.securitycenter.v1beta1.IGetSourceRequest} message GetSourceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetSourceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetSourceRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.GetSourceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1beta1.GetSourceRequest + * @static + * @param {google.cloud.securitycenter.v1beta1.IGetSourceRequest} message GetSourceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetSourceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetSourceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1beta1.GetSourceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1beta1.GetSourceRequest} GetSourceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetSourceRequest.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.cloud.securitycenter.v1beta1.GetSourceRequest(); + 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 GetSourceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1beta1.GetSourceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1beta1.GetSourceRequest} GetSourceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetSourceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetSourceRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1beta1.GetSourceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetSourceRequest.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 GetSourceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1beta1.GetSourceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1beta1.GetSourceRequest} GetSourceRequest + */ + GetSourceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1beta1.GetSourceRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1beta1.GetSourceRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetSourceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1beta1.GetSourceRequest + * @static + * @param {google.cloud.securitycenter.v1beta1.GetSourceRequest} message GetSourceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetSourceRequest.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 GetSourceRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1beta1.GetSourceRequest + * @instance + * @returns {Object.} JSON object + */ + GetSourceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetSourceRequest; + })(); + + v1beta1.GroupAssetsRequest = (function() { + + /** + * Properties of a GroupAssetsRequest. + * @memberof google.cloud.securitycenter.v1beta1 + * @interface IGroupAssetsRequest + * @property {string|null} [parent] GroupAssetsRequest parent + * @property {string|null} [filter] GroupAssetsRequest filter + * @property {string|null} [groupBy] GroupAssetsRequest groupBy + * @property {google.protobuf.IDuration|null} [compareDuration] GroupAssetsRequest compareDuration + * @property {google.protobuf.ITimestamp|null} [readTime] GroupAssetsRequest readTime + * @property {string|null} [pageToken] GroupAssetsRequest pageToken + * @property {number|null} [pageSize] GroupAssetsRequest pageSize + */ + + /** + * Constructs a new GroupAssetsRequest. + * @memberof google.cloud.securitycenter.v1beta1 + * @classdesc Represents a GroupAssetsRequest. + * @implements IGroupAssetsRequest + * @constructor + * @param {google.cloud.securitycenter.v1beta1.IGroupAssetsRequest=} [properties] Properties to set + */ + function GroupAssetsRequest(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]]; + } + + /** + * GroupAssetsRequest parent. + * @member {string} parent + * @memberof google.cloud.securitycenter.v1beta1.GroupAssetsRequest + * @instance + */ + GroupAssetsRequest.prototype.parent = ""; + + /** + * GroupAssetsRequest filter. + * @member {string} filter + * @memberof google.cloud.securitycenter.v1beta1.GroupAssetsRequest + * @instance + */ + GroupAssetsRequest.prototype.filter = ""; + + /** + * GroupAssetsRequest groupBy. + * @member {string} groupBy + * @memberof google.cloud.securitycenter.v1beta1.GroupAssetsRequest + * @instance + */ + GroupAssetsRequest.prototype.groupBy = ""; + + /** + * GroupAssetsRequest compareDuration. + * @member {google.protobuf.IDuration|null|undefined} compareDuration + * @memberof google.cloud.securitycenter.v1beta1.GroupAssetsRequest + * @instance + */ + GroupAssetsRequest.prototype.compareDuration = null; + + /** + * GroupAssetsRequest readTime. + * @member {google.protobuf.ITimestamp|null|undefined} readTime + * @memberof google.cloud.securitycenter.v1beta1.GroupAssetsRequest + * @instance + */ + GroupAssetsRequest.prototype.readTime = null; + + /** + * GroupAssetsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.securitycenter.v1beta1.GroupAssetsRequest + * @instance + */ + GroupAssetsRequest.prototype.pageToken = ""; + + /** + * GroupAssetsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.securitycenter.v1beta1.GroupAssetsRequest + * @instance + */ + GroupAssetsRequest.prototype.pageSize = 0; + + /** + * Creates a new GroupAssetsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1beta1.GroupAssetsRequest + * @static + * @param {google.cloud.securitycenter.v1beta1.IGroupAssetsRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1beta1.GroupAssetsRequest} GroupAssetsRequest instance + */ + GroupAssetsRequest.create = function create(properties) { + return new GroupAssetsRequest(properties); + }; + + /** + * Encodes the specified GroupAssetsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.GroupAssetsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1beta1.GroupAssetsRequest + * @static + * @param {google.cloud.securitycenter.v1beta1.IGroupAssetsRequest} message GroupAssetsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroupAssetsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && message.hasOwnProperty("parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.filter != null && message.hasOwnProperty("filter")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); + if (message.groupBy != null && message.hasOwnProperty("groupBy")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.groupBy); + if (message.compareDuration != null && message.hasOwnProperty("compareDuration")) + $root.google.protobuf.Duration.encode(message.compareDuration, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.readTime != null && message.hasOwnProperty("readTime")) + $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.pageToken); + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.pageSize); + return writer; + }; + + /** + * Encodes the specified GroupAssetsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.GroupAssetsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1beta1.GroupAssetsRequest + * @static + * @param {google.cloud.securitycenter.v1beta1.IGroupAssetsRequest} message GroupAssetsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroupAssetsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GroupAssetsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1beta1.GroupAssetsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1beta1.GroupAssetsRequest} GroupAssetsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GroupAssetsRequest.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.cloud.securitycenter.v1beta1.GroupAssetsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.filter = reader.string(); + break; + case 3: + message.groupBy = reader.string(); + break; + case 4: + message.compareDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + case 5: + message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 7: + message.pageToken = reader.string(); + break; + case 8: + message.pageSize = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GroupAssetsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1beta1.GroupAssetsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1beta1.GroupAssetsRequest} GroupAssetsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GroupAssetsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GroupAssetsRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1beta1.GroupAssetsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GroupAssetsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.groupBy != null && message.hasOwnProperty("groupBy")) + if (!$util.isString(message.groupBy)) + return "groupBy: string expected"; + if (message.compareDuration != null && message.hasOwnProperty("compareDuration")) { + var error = $root.google.protobuf.Duration.verify(message.compareDuration); + if (error) + return "compareDuration." + error; + } + if (message.readTime != null && message.hasOwnProperty("readTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.readTime); + if (error) + return "readTime." + error; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + return null; + }; + + /** + * Creates a GroupAssetsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1beta1.GroupAssetsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1beta1.GroupAssetsRequest} GroupAssetsRequest + */ + GroupAssetsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1beta1.GroupAssetsRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1beta1.GroupAssetsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.filter != null) + message.filter = String(object.filter); + if (object.groupBy != null) + message.groupBy = String(object.groupBy); + if (object.compareDuration != null) { + if (typeof object.compareDuration !== "object") + throw TypeError(".google.cloud.securitycenter.v1beta1.GroupAssetsRequest.compareDuration: object expected"); + message.compareDuration = $root.google.protobuf.Duration.fromObject(object.compareDuration); + } + if (object.readTime != null) { + if (typeof object.readTime !== "object") + throw TypeError(".google.cloud.securitycenter.v1beta1.GroupAssetsRequest.readTime: object expected"); + message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); + } + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + return message; + }; + + /** + * Creates a plain object from a GroupAssetsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1beta1.GroupAssetsRequest + * @static + * @param {google.cloud.securitycenter.v1beta1.GroupAssetsRequest} message GroupAssetsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GroupAssetsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.filter = ""; + object.groupBy = ""; + object.compareDuration = null; + object.readTime = null; + object.pageToken = ""; + object.pageSize = 0; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.groupBy != null && message.hasOwnProperty("groupBy")) + object.groupBy = message.groupBy; + if (message.compareDuration != null && message.hasOwnProperty("compareDuration")) + object.compareDuration = $root.google.protobuf.Duration.toObject(message.compareDuration, options); + if (message.readTime != null && message.hasOwnProperty("readTime")) + object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + return object; + }; + + /** + * Converts this GroupAssetsRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1beta1.GroupAssetsRequest + * @instance + * @returns {Object.} JSON object + */ + GroupAssetsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GroupAssetsRequest; + })(); + + v1beta1.GroupAssetsResponse = (function() { + + /** + * Properties of a GroupAssetsResponse. + * @memberof google.cloud.securitycenter.v1beta1 + * @interface IGroupAssetsResponse + * @property {Array.|null} [groupByResults] GroupAssetsResponse groupByResults + * @property {google.protobuf.ITimestamp|null} [readTime] GroupAssetsResponse readTime + * @property {string|null} [nextPageToken] GroupAssetsResponse nextPageToken + */ + + /** + * Constructs a new GroupAssetsResponse. + * @memberof google.cloud.securitycenter.v1beta1 + * @classdesc Represents a GroupAssetsResponse. + * @implements IGroupAssetsResponse + * @constructor + * @param {google.cloud.securitycenter.v1beta1.IGroupAssetsResponse=} [properties] Properties to set + */ + function GroupAssetsResponse(properties) { + this.groupByResults = []; + 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]]; + } + + /** + * GroupAssetsResponse groupByResults. + * @member {Array.} groupByResults + * @memberof google.cloud.securitycenter.v1beta1.GroupAssetsResponse + * @instance + */ + GroupAssetsResponse.prototype.groupByResults = $util.emptyArray; + + /** + * GroupAssetsResponse readTime. + * @member {google.protobuf.ITimestamp|null|undefined} readTime + * @memberof google.cloud.securitycenter.v1beta1.GroupAssetsResponse + * @instance + */ + GroupAssetsResponse.prototype.readTime = null; + + /** + * GroupAssetsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.securitycenter.v1beta1.GroupAssetsResponse + * @instance + */ + GroupAssetsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new GroupAssetsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1beta1.GroupAssetsResponse + * @static + * @param {google.cloud.securitycenter.v1beta1.IGroupAssetsResponse=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1beta1.GroupAssetsResponse} GroupAssetsResponse instance + */ + GroupAssetsResponse.create = function create(properties) { + return new GroupAssetsResponse(properties); + }; + + /** + * Encodes the specified GroupAssetsResponse message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.GroupAssetsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1beta1.GroupAssetsResponse + * @static + * @param {google.cloud.securitycenter.v1beta1.IGroupAssetsResponse} message GroupAssetsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroupAssetsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.groupByResults != null && message.groupByResults.length) + for (var i = 0; i < message.groupByResults.length; ++i) + $root.google.cloud.securitycenter.v1beta1.GroupResult.encode(message.groupByResults[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.readTime != null && message.hasOwnProperty("readTime")) + $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified GroupAssetsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.GroupAssetsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1beta1.GroupAssetsResponse + * @static + * @param {google.cloud.securitycenter.v1beta1.IGroupAssetsResponse} message GroupAssetsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroupAssetsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GroupAssetsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1beta1.GroupAssetsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1beta1.GroupAssetsResponse} GroupAssetsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GroupAssetsResponse.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.cloud.securitycenter.v1beta1.GroupAssetsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.groupByResults && message.groupByResults.length)) + message.groupByResults = []; + message.groupByResults.push($root.google.cloud.securitycenter.v1beta1.GroupResult.decode(reader, reader.uint32())); + break; + case 2: + message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 3: + message.nextPageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GroupAssetsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1beta1.GroupAssetsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1beta1.GroupAssetsResponse} GroupAssetsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GroupAssetsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GroupAssetsResponse message. + * @function verify + * @memberof google.cloud.securitycenter.v1beta1.GroupAssetsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GroupAssetsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.groupByResults != null && message.hasOwnProperty("groupByResults")) { + if (!Array.isArray(message.groupByResults)) + return "groupByResults: array expected"; + for (var i = 0; i < message.groupByResults.length; ++i) { + var error = $root.google.cloud.securitycenter.v1beta1.GroupResult.verify(message.groupByResults[i]); + if (error) + return "groupByResults." + error; + } + } + if (message.readTime != null && message.hasOwnProperty("readTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.readTime); + if (error) + return "readTime." + error; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a GroupAssetsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1beta1.GroupAssetsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1beta1.GroupAssetsResponse} GroupAssetsResponse + */ + GroupAssetsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1beta1.GroupAssetsResponse) + return object; + var message = new $root.google.cloud.securitycenter.v1beta1.GroupAssetsResponse(); + if (object.groupByResults) { + if (!Array.isArray(object.groupByResults)) + throw TypeError(".google.cloud.securitycenter.v1beta1.GroupAssetsResponse.groupByResults: array expected"); + message.groupByResults = []; + for (var i = 0; i < object.groupByResults.length; ++i) { + if (typeof object.groupByResults[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v1beta1.GroupAssetsResponse.groupByResults: object expected"); + message.groupByResults[i] = $root.google.cloud.securitycenter.v1beta1.GroupResult.fromObject(object.groupByResults[i]); + } + } + if (object.readTime != null) { + if (typeof object.readTime !== "object") + throw TypeError(".google.cloud.securitycenter.v1beta1.GroupAssetsResponse.readTime: object expected"); + message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a GroupAssetsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1beta1.GroupAssetsResponse + * @static + * @param {google.cloud.securitycenter.v1beta1.GroupAssetsResponse} message GroupAssetsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GroupAssetsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.groupByResults = []; + if (options.defaults) { + object.readTime = null; + object.nextPageToken = ""; + } + if (message.groupByResults && message.groupByResults.length) { + object.groupByResults = []; + for (var j = 0; j < message.groupByResults.length; ++j) + object.groupByResults[j] = $root.google.cloud.securitycenter.v1beta1.GroupResult.toObject(message.groupByResults[j], options); + } + if (message.readTime != null && message.hasOwnProperty("readTime")) + object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this GroupAssetsResponse to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1beta1.GroupAssetsResponse + * @instance + * @returns {Object.} JSON object + */ + GroupAssetsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GroupAssetsResponse; + })(); + + v1beta1.GroupFindingsRequest = (function() { + + /** + * Properties of a GroupFindingsRequest. + * @memberof google.cloud.securitycenter.v1beta1 + * @interface IGroupFindingsRequest + * @property {string|null} [parent] GroupFindingsRequest parent + * @property {string|null} [filter] GroupFindingsRequest filter + * @property {string|null} [groupBy] GroupFindingsRequest groupBy + * @property {google.protobuf.ITimestamp|null} [readTime] GroupFindingsRequest readTime + * @property {string|null} [pageToken] GroupFindingsRequest pageToken + * @property {number|null} [pageSize] GroupFindingsRequest pageSize + */ + + /** + * Constructs a new GroupFindingsRequest. + * @memberof google.cloud.securitycenter.v1beta1 + * @classdesc Represents a GroupFindingsRequest. + * @implements IGroupFindingsRequest + * @constructor + * @param {google.cloud.securitycenter.v1beta1.IGroupFindingsRequest=} [properties] Properties to set + */ + function GroupFindingsRequest(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]]; + } + + /** + * GroupFindingsRequest parent. + * @member {string} parent + * @memberof google.cloud.securitycenter.v1beta1.GroupFindingsRequest + * @instance + */ + GroupFindingsRequest.prototype.parent = ""; + + /** + * GroupFindingsRequest filter. + * @member {string} filter + * @memberof google.cloud.securitycenter.v1beta1.GroupFindingsRequest + * @instance + */ + GroupFindingsRequest.prototype.filter = ""; + + /** + * GroupFindingsRequest groupBy. + * @member {string} groupBy + * @memberof google.cloud.securitycenter.v1beta1.GroupFindingsRequest + * @instance + */ + GroupFindingsRequest.prototype.groupBy = ""; + + /** + * GroupFindingsRequest readTime. + * @member {google.protobuf.ITimestamp|null|undefined} readTime + * @memberof google.cloud.securitycenter.v1beta1.GroupFindingsRequest + * @instance + */ + GroupFindingsRequest.prototype.readTime = null; + + /** + * GroupFindingsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.securitycenter.v1beta1.GroupFindingsRequest + * @instance + */ + GroupFindingsRequest.prototype.pageToken = ""; + + /** + * GroupFindingsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.securitycenter.v1beta1.GroupFindingsRequest + * @instance + */ + GroupFindingsRequest.prototype.pageSize = 0; + + /** + * Creates a new GroupFindingsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1beta1.GroupFindingsRequest + * @static + * @param {google.cloud.securitycenter.v1beta1.IGroupFindingsRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1beta1.GroupFindingsRequest} GroupFindingsRequest instance + */ + GroupFindingsRequest.create = function create(properties) { + return new GroupFindingsRequest(properties); + }; + + /** + * Encodes the specified GroupFindingsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.GroupFindingsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1beta1.GroupFindingsRequest + * @static + * @param {google.cloud.securitycenter.v1beta1.IGroupFindingsRequest} message GroupFindingsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroupFindingsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && message.hasOwnProperty("parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.filter != null && message.hasOwnProperty("filter")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); + if (message.groupBy != null && message.hasOwnProperty("groupBy")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.groupBy); + if (message.readTime != null && message.hasOwnProperty("readTime")) + $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.pageToken); + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.pageSize); + return writer; + }; + + /** + * Encodes the specified GroupFindingsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.GroupFindingsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1beta1.GroupFindingsRequest + * @static + * @param {google.cloud.securitycenter.v1beta1.IGroupFindingsRequest} message GroupFindingsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroupFindingsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GroupFindingsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1beta1.GroupFindingsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1beta1.GroupFindingsRequest} GroupFindingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GroupFindingsRequest.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.cloud.securitycenter.v1beta1.GroupFindingsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.filter = reader.string(); + break; + case 3: + message.groupBy = reader.string(); + break; + case 4: + message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 5: + message.pageToken = reader.string(); + break; + case 6: + message.pageSize = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GroupFindingsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1beta1.GroupFindingsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1beta1.GroupFindingsRequest} GroupFindingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GroupFindingsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GroupFindingsRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1beta1.GroupFindingsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GroupFindingsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.groupBy != null && message.hasOwnProperty("groupBy")) + if (!$util.isString(message.groupBy)) + return "groupBy: string expected"; + if (message.readTime != null && message.hasOwnProperty("readTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.readTime); + if (error) + return "readTime." + error; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + return null; + }; + + /** + * Creates a GroupFindingsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1beta1.GroupFindingsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1beta1.GroupFindingsRequest} GroupFindingsRequest + */ + GroupFindingsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1beta1.GroupFindingsRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1beta1.GroupFindingsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.filter != null) + message.filter = String(object.filter); + if (object.groupBy != null) + message.groupBy = String(object.groupBy); + if (object.readTime != null) { + if (typeof object.readTime !== "object") + throw TypeError(".google.cloud.securitycenter.v1beta1.GroupFindingsRequest.readTime: object expected"); + message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); + } + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + return message; + }; + + /** + * Creates a plain object from a GroupFindingsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1beta1.GroupFindingsRequest + * @static + * @param {google.cloud.securitycenter.v1beta1.GroupFindingsRequest} message GroupFindingsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GroupFindingsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.filter = ""; + object.groupBy = ""; + object.readTime = null; + object.pageToken = ""; + object.pageSize = 0; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.groupBy != null && message.hasOwnProperty("groupBy")) + object.groupBy = message.groupBy; + if (message.readTime != null && message.hasOwnProperty("readTime")) + object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + return object; + }; + + /** + * Converts this GroupFindingsRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1beta1.GroupFindingsRequest + * @instance + * @returns {Object.} JSON object + */ + GroupFindingsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GroupFindingsRequest; + })(); + + v1beta1.GroupFindingsResponse = (function() { + + /** + * Properties of a GroupFindingsResponse. + * @memberof google.cloud.securitycenter.v1beta1 + * @interface IGroupFindingsResponse + * @property {Array.|null} [groupByResults] GroupFindingsResponse groupByResults + * @property {google.protobuf.ITimestamp|null} [readTime] GroupFindingsResponse readTime + * @property {string|null} [nextPageToken] GroupFindingsResponse nextPageToken + */ + + /** + * Constructs a new GroupFindingsResponse. + * @memberof google.cloud.securitycenter.v1beta1 + * @classdesc Represents a GroupFindingsResponse. + * @implements IGroupFindingsResponse + * @constructor + * @param {google.cloud.securitycenter.v1beta1.IGroupFindingsResponse=} [properties] Properties to set + */ + function GroupFindingsResponse(properties) { + this.groupByResults = []; + 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]]; + } + + /** + * GroupFindingsResponse groupByResults. + * @member {Array.} groupByResults + * @memberof google.cloud.securitycenter.v1beta1.GroupFindingsResponse + * @instance + */ + GroupFindingsResponse.prototype.groupByResults = $util.emptyArray; + + /** + * GroupFindingsResponse readTime. + * @member {google.protobuf.ITimestamp|null|undefined} readTime + * @memberof google.cloud.securitycenter.v1beta1.GroupFindingsResponse + * @instance + */ + GroupFindingsResponse.prototype.readTime = null; + + /** + * GroupFindingsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.securitycenter.v1beta1.GroupFindingsResponse + * @instance + */ + GroupFindingsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new GroupFindingsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1beta1.GroupFindingsResponse + * @static + * @param {google.cloud.securitycenter.v1beta1.IGroupFindingsResponse=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1beta1.GroupFindingsResponse} GroupFindingsResponse instance + */ + GroupFindingsResponse.create = function create(properties) { + return new GroupFindingsResponse(properties); + }; + + /** + * Encodes the specified GroupFindingsResponse message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.GroupFindingsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1beta1.GroupFindingsResponse + * @static + * @param {google.cloud.securitycenter.v1beta1.IGroupFindingsResponse} message GroupFindingsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroupFindingsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.groupByResults != null && message.groupByResults.length) + for (var i = 0; i < message.groupByResults.length; ++i) + $root.google.cloud.securitycenter.v1beta1.GroupResult.encode(message.groupByResults[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.readTime != null && message.hasOwnProperty("readTime")) + $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified GroupFindingsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.GroupFindingsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1beta1.GroupFindingsResponse + * @static + * @param {google.cloud.securitycenter.v1beta1.IGroupFindingsResponse} message GroupFindingsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroupFindingsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GroupFindingsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1beta1.GroupFindingsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1beta1.GroupFindingsResponse} GroupFindingsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GroupFindingsResponse.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.cloud.securitycenter.v1beta1.GroupFindingsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.groupByResults && message.groupByResults.length)) + message.groupByResults = []; + message.groupByResults.push($root.google.cloud.securitycenter.v1beta1.GroupResult.decode(reader, reader.uint32())); + break; + case 2: + message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 3: + message.nextPageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GroupFindingsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1beta1.GroupFindingsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1beta1.GroupFindingsResponse} GroupFindingsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GroupFindingsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GroupFindingsResponse message. + * @function verify + * @memberof google.cloud.securitycenter.v1beta1.GroupFindingsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GroupFindingsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.groupByResults != null && message.hasOwnProperty("groupByResults")) { + if (!Array.isArray(message.groupByResults)) + return "groupByResults: array expected"; + for (var i = 0; i < message.groupByResults.length; ++i) { + var error = $root.google.cloud.securitycenter.v1beta1.GroupResult.verify(message.groupByResults[i]); + if (error) + return "groupByResults." + error; + } + } + if (message.readTime != null && message.hasOwnProperty("readTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.readTime); + if (error) + return "readTime." + error; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a GroupFindingsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1beta1.GroupFindingsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1beta1.GroupFindingsResponse} GroupFindingsResponse + */ + GroupFindingsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1beta1.GroupFindingsResponse) + return object; + var message = new $root.google.cloud.securitycenter.v1beta1.GroupFindingsResponse(); + if (object.groupByResults) { + if (!Array.isArray(object.groupByResults)) + throw TypeError(".google.cloud.securitycenter.v1beta1.GroupFindingsResponse.groupByResults: array expected"); + message.groupByResults = []; + for (var i = 0; i < object.groupByResults.length; ++i) { + if (typeof object.groupByResults[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v1beta1.GroupFindingsResponse.groupByResults: object expected"); + message.groupByResults[i] = $root.google.cloud.securitycenter.v1beta1.GroupResult.fromObject(object.groupByResults[i]); + } + } + if (object.readTime != null) { + if (typeof object.readTime !== "object") + throw TypeError(".google.cloud.securitycenter.v1beta1.GroupFindingsResponse.readTime: object expected"); + message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a GroupFindingsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1beta1.GroupFindingsResponse + * @static + * @param {google.cloud.securitycenter.v1beta1.GroupFindingsResponse} message GroupFindingsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GroupFindingsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.groupByResults = []; + if (options.defaults) { + object.readTime = null; + object.nextPageToken = ""; + } + if (message.groupByResults && message.groupByResults.length) { + object.groupByResults = []; + for (var j = 0; j < message.groupByResults.length; ++j) + object.groupByResults[j] = $root.google.cloud.securitycenter.v1beta1.GroupResult.toObject(message.groupByResults[j], options); + } + if (message.readTime != null && message.hasOwnProperty("readTime")) + object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this GroupFindingsResponse to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1beta1.GroupFindingsResponse + * @instance + * @returns {Object.} JSON object + */ + GroupFindingsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GroupFindingsResponse; + })(); + + v1beta1.GroupResult = (function() { + + /** + * Properties of a GroupResult. + * @memberof google.cloud.securitycenter.v1beta1 + * @interface IGroupResult + * @property {Object.|null} [properties] GroupResult properties + * @property {number|Long|null} [count] GroupResult count + */ + + /** + * Constructs a new GroupResult. + * @memberof google.cloud.securitycenter.v1beta1 + * @classdesc Represents a GroupResult. + * @implements IGroupResult + * @constructor + * @param {google.cloud.securitycenter.v1beta1.IGroupResult=} [properties] Properties to set + */ + function GroupResult(properties) { + this.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]]; + } + + /** + * GroupResult properties. + * @member {Object.} properties + * @memberof google.cloud.securitycenter.v1beta1.GroupResult + * @instance + */ + GroupResult.prototype.properties = $util.emptyObject; + + /** + * GroupResult count. + * @member {number|Long} count + * @memberof google.cloud.securitycenter.v1beta1.GroupResult + * @instance + */ + GroupResult.prototype.count = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new GroupResult instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1beta1.GroupResult + * @static + * @param {google.cloud.securitycenter.v1beta1.IGroupResult=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1beta1.GroupResult} GroupResult instance + */ + GroupResult.create = function create(properties) { + return new GroupResult(properties); + }; + + /** + * Encodes the specified GroupResult message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.GroupResult.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1beta1.GroupResult + * @static + * @param {google.cloud.securitycenter.v1beta1.IGroupResult} message GroupResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroupResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.properties != null && message.hasOwnProperty("properties")) + for (var keys = Object.keys(message.properties), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.protobuf.Value.encode(message.properties[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.count != null && message.hasOwnProperty("count")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.count); + return writer; + }; + + /** + * Encodes the specified GroupResult message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.GroupResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1beta1.GroupResult + * @static + * @param {google.cloud.securitycenter.v1beta1.IGroupResult} message GroupResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroupResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GroupResult message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1beta1.GroupResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1beta1.GroupResult} GroupResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GroupResult.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.cloud.securitycenter.v1beta1.GroupResult(), key; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + reader.skip().pos++; + if (message.properties === $util.emptyObject) + message.properties = {}; + key = reader.string(); + reader.pos++; + message.properties[key] = $root.google.protobuf.Value.decode(reader, reader.uint32()); + break; + case 2: + message.count = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GroupResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1beta1.GroupResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1beta1.GroupResult} GroupResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GroupResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GroupResult message. + * @function verify + * @memberof google.cloud.securitycenter.v1beta1.GroupResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GroupResult.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.properties != null && message.hasOwnProperty("properties")) { + if (!$util.isObject(message.properties)) + return "properties: object expected"; + var key = Object.keys(message.properties); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.protobuf.Value.verify(message.properties[key[i]]); + if (error) + return "properties." + error; + } + } + if (message.count != null && message.hasOwnProperty("count")) + if (!$util.isInteger(message.count) && !(message.count && $util.isInteger(message.count.low) && $util.isInteger(message.count.high))) + return "count: integer|Long expected"; + return null; + }; + + /** + * Creates a GroupResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1beta1.GroupResult + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1beta1.GroupResult} GroupResult + */ + GroupResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1beta1.GroupResult) + return object; + var message = new $root.google.cloud.securitycenter.v1beta1.GroupResult(); + if (object.properties) { + if (typeof object.properties !== "object") + throw TypeError(".google.cloud.securitycenter.v1beta1.GroupResult.properties: object expected"); + message.properties = {}; + for (var keys = Object.keys(object.properties), i = 0; i < keys.length; ++i) { + if (typeof object.properties[keys[i]] !== "object") + throw TypeError(".google.cloud.securitycenter.v1beta1.GroupResult.properties: object expected"); + message.properties[keys[i]] = $root.google.protobuf.Value.fromObject(object.properties[keys[i]]); + } + } + if (object.count != null) + if ($util.Long) + (message.count = $util.Long.fromValue(object.count)).unsigned = false; + else if (typeof object.count === "string") + message.count = parseInt(object.count, 10); + else if (typeof object.count === "number") + message.count = object.count; + else if (typeof object.count === "object") + message.count = new $util.LongBits(object.count.low >>> 0, object.count.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a GroupResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1beta1.GroupResult + * @static + * @param {google.cloud.securitycenter.v1beta1.GroupResult} message GroupResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GroupResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.properties = {}; + if (options.defaults) + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.count = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.count = options.longs === String ? "0" : 0; + var keys2; + if (message.properties && (keys2 = Object.keys(message.properties)).length) { + object.properties = {}; + for (var j = 0; j < keys2.length; ++j) + object.properties[keys2[j]] = $root.google.protobuf.Value.toObject(message.properties[keys2[j]], options); + } + if (message.count != null && message.hasOwnProperty("count")) + if (typeof message.count === "number") + object.count = options.longs === String ? String(message.count) : message.count; + else + object.count = options.longs === String ? $util.Long.prototype.toString.call(message.count) : options.longs === Number ? new $util.LongBits(message.count.low >>> 0, message.count.high >>> 0).toNumber() : message.count; + return object; + }; + + /** + * Converts this GroupResult to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1beta1.GroupResult + * @instance + * @returns {Object.} JSON object + */ + GroupResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GroupResult; + })(); + + v1beta1.ListSourcesRequest = (function() { + + /** + * Properties of a ListSourcesRequest. + * @memberof google.cloud.securitycenter.v1beta1 + * @interface IListSourcesRequest + * @property {string|null} [parent] ListSourcesRequest parent + * @property {string|null} [pageToken] ListSourcesRequest pageToken + * @property {number|null} [pageSize] ListSourcesRequest pageSize + */ + + /** + * Constructs a new ListSourcesRequest. + * @memberof google.cloud.securitycenter.v1beta1 + * @classdesc Represents a ListSourcesRequest. + * @implements IListSourcesRequest + * @constructor + * @param {google.cloud.securitycenter.v1beta1.IListSourcesRequest=} [properties] Properties to set + */ + function ListSourcesRequest(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]]; + } + + /** + * ListSourcesRequest parent. + * @member {string} parent + * @memberof google.cloud.securitycenter.v1beta1.ListSourcesRequest + * @instance + */ + ListSourcesRequest.prototype.parent = ""; + + /** + * ListSourcesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.securitycenter.v1beta1.ListSourcesRequest + * @instance + */ + ListSourcesRequest.prototype.pageToken = ""; + + /** + * ListSourcesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.securitycenter.v1beta1.ListSourcesRequest + * @instance + */ + ListSourcesRequest.prototype.pageSize = 0; + + /** + * Creates a new ListSourcesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1beta1.ListSourcesRequest + * @static + * @param {google.cloud.securitycenter.v1beta1.IListSourcesRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1beta1.ListSourcesRequest} ListSourcesRequest instance + */ + ListSourcesRequest.create = function create(properties) { + return new ListSourcesRequest(properties); + }; + + /** + * Encodes the specified ListSourcesRequest message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.ListSourcesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1beta1.ListSourcesRequest + * @static + * @param {google.cloud.securitycenter.v1beta1.IListSourcesRequest} message ListSourcesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSourcesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && message.hasOwnProperty("parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.pageToken); + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.pageSize); + return writer; + }; + + /** + * Encodes the specified ListSourcesRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.ListSourcesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1beta1.ListSourcesRequest + * @static + * @param {google.cloud.securitycenter.v1beta1.IListSourcesRequest} message ListSourcesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSourcesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListSourcesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1beta1.ListSourcesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1beta1.ListSourcesRequest} ListSourcesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSourcesRequest.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.cloud.securitycenter.v1beta1.ListSourcesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.pageToken = reader.string(); + break; + case 7: + message.pageSize = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListSourcesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1beta1.ListSourcesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1beta1.ListSourcesRequest} ListSourcesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSourcesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListSourcesRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1beta1.ListSourcesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListSourcesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + return null; + }; + + /** + * Creates a ListSourcesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1beta1.ListSourcesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1beta1.ListSourcesRequest} ListSourcesRequest + */ + ListSourcesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1beta1.ListSourcesRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1beta1.ListSourcesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + return message; + }; + + /** + * Creates a plain object from a ListSourcesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1beta1.ListSourcesRequest + * @static + * @param {google.cloud.securitycenter.v1beta1.ListSourcesRequest} message ListSourcesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListSourcesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageToken = ""; + object.pageSize = 0; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + return object; + }; + + /** + * Converts this ListSourcesRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1beta1.ListSourcesRequest + * @instance + * @returns {Object.} JSON object + */ + ListSourcesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListSourcesRequest; + })(); + + v1beta1.ListSourcesResponse = (function() { + + /** + * Properties of a ListSourcesResponse. + * @memberof google.cloud.securitycenter.v1beta1 + * @interface IListSourcesResponse + * @property {Array.|null} [sources] ListSourcesResponse sources + * @property {string|null} [nextPageToken] ListSourcesResponse nextPageToken + */ + + /** + * Constructs a new ListSourcesResponse. + * @memberof google.cloud.securitycenter.v1beta1 + * @classdesc Represents a ListSourcesResponse. + * @implements IListSourcesResponse + * @constructor + * @param {google.cloud.securitycenter.v1beta1.IListSourcesResponse=} [properties] Properties to set + */ + function ListSourcesResponse(properties) { + this.sources = []; + 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]]; + } + + /** + * ListSourcesResponse sources. + * @member {Array.} sources + * @memberof google.cloud.securitycenter.v1beta1.ListSourcesResponse + * @instance + */ + ListSourcesResponse.prototype.sources = $util.emptyArray; + + /** + * ListSourcesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.securitycenter.v1beta1.ListSourcesResponse + * @instance + */ + ListSourcesResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListSourcesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1beta1.ListSourcesResponse + * @static + * @param {google.cloud.securitycenter.v1beta1.IListSourcesResponse=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1beta1.ListSourcesResponse} ListSourcesResponse instance + */ + ListSourcesResponse.create = function create(properties) { + return new ListSourcesResponse(properties); + }; + + /** + * Encodes the specified ListSourcesResponse message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.ListSourcesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1beta1.ListSourcesResponse + * @static + * @param {google.cloud.securitycenter.v1beta1.IListSourcesResponse} message ListSourcesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSourcesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.sources != null && message.sources.length) + for (var i = 0; i < message.sources.length; ++i) + $root.google.cloud.securitycenter.v1beta1.Source.encode(message.sources[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListSourcesResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.ListSourcesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1beta1.ListSourcesResponse + * @static + * @param {google.cloud.securitycenter.v1beta1.IListSourcesResponse} message ListSourcesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSourcesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListSourcesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1beta1.ListSourcesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1beta1.ListSourcesResponse} ListSourcesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSourcesResponse.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.cloud.securitycenter.v1beta1.ListSourcesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.sources && message.sources.length)) + message.sources = []; + message.sources.push($root.google.cloud.securitycenter.v1beta1.Source.decode(reader, reader.uint32())); + break; + case 2: + message.nextPageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListSourcesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1beta1.ListSourcesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1beta1.ListSourcesResponse} ListSourcesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSourcesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListSourcesResponse message. + * @function verify + * @memberof google.cloud.securitycenter.v1beta1.ListSourcesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListSourcesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.sources != null && message.hasOwnProperty("sources")) { + if (!Array.isArray(message.sources)) + return "sources: array expected"; + for (var i = 0; i < message.sources.length; ++i) { + var error = $root.google.cloud.securitycenter.v1beta1.Source.verify(message.sources[i]); + if (error) + return "sources." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListSourcesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1beta1.ListSourcesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1beta1.ListSourcesResponse} ListSourcesResponse + */ + ListSourcesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1beta1.ListSourcesResponse) + return object; + var message = new $root.google.cloud.securitycenter.v1beta1.ListSourcesResponse(); + if (object.sources) { + if (!Array.isArray(object.sources)) + throw TypeError(".google.cloud.securitycenter.v1beta1.ListSourcesResponse.sources: array expected"); + message.sources = []; + for (var i = 0; i < object.sources.length; ++i) { + if (typeof object.sources[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v1beta1.ListSourcesResponse.sources: object expected"); + message.sources[i] = $root.google.cloud.securitycenter.v1beta1.Source.fromObject(object.sources[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListSourcesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1beta1.ListSourcesResponse + * @static + * @param {google.cloud.securitycenter.v1beta1.ListSourcesResponse} message ListSourcesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListSourcesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.sources = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.sources && message.sources.length) { + object.sources = []; + for (var j = 0; j < message.sources.length; ++j) + object.sources[j] = $root.google.cloud.securitycenter.v1beta1.Source.toObject(message.sources[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListSourcesResponse to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1beta1.ListSourcesResponse + * @instance + * @returns {Object.} JSON object + */ + ListSourcesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListSourcesResponse; + })(); + + v1beta1.ListAssetsRequest = (function() { + + /** + * Properties of a ListAssetsRequest. + * @memberof google.cloud.securitycenter.v1beta1 + * @interface IListAssetsRequest + * @property {string|null} [parent] ListAssetsRequest parent + * @property {string|null} [filter] ListAssetsRequest filter + * @property {string|null} [orderBy] ListAssetsRequest orderBy + * @property {google.protobuf.ITimestamp|null} [readTime] ListAssetsRequest readTime + * @property {google.protobuf.IDuration|null} [compareDuration] ListAssetsRequest compareDuration + * @property {google.protobuf.IFieldMask|null} [fieldMask] ListAssetsRequest fieldMask + * @property {string|null} [pageToken] ListAssetsRequest pageToken + * @property {number|null} [pageSize] ListAssetsRequest pageSize + */ + + /** + * Constructs a new ListAssetsRequest. + * @memberof google.cloud.securitycenter.v1beta1 + * @classdesc Represents a ListAssetsRequest. + * @implements IListAssetsRequest + * @constructor + * @param {google.cloud.securitycenter.v1beta1.IListAssetsRequest=} [properties] Properties to set + */ + function ListAssetsRequest(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]]; + } + + /** + * ListAssetsRequest parent. + * @member {string} parent + * @memberof google.cloud.securitycenter.v1beta1.ListAssetsRequest + * @instance + */ + ListAssetsRequest.prototype.parent = ""; + + /** + * ListAssetsRequest filter. + * @member {string} filter + * @memberof google.cloud.securitycenter.v1beta1.ListAssetsRequest + * @instance + */ + ListAssetsRequest.prototype.filter = ""; + + /** + * ListAssetsRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.securitycenter.v1beta1.ListAssetsRequest + * @instance + */ + ListAssetsRequest.prototype.orderBy = ""; + + /** + * ListAssetsRequest readTime. + * @member {google.protobuf.ITimestamp|null|undefined} readTime + * @memberof google.cloud.securitycenter.v1beta1.ListAssetsRequest + * @instance + */ + ListAssetsRequest.prototype.readTime = null; + + /** + * ListAssetsRequest compareDuration. + * @member {google.protobuf.IDuration|null|undefined} compareDuration + * @memberof google.cloud.securitycenter.v1beta1.ListAssetsRequest + * @instance + */ + ListAssetsRequest.prototype.compareDuration = null; + + /** + * ListAssetsRequest fieldMask. + * @member {google.protobuf.IFieldMask|null|undefined} fieldMask + * @memberof google.cloud.securitycenter.v1beta1.ListAssetsRequest + * @instance + */ + ListAssetsRequest.prototype.fieldMask = null; + + /** + * ListAssetsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.securitycenter.v1beta1.ListAssetsRequest + * @instance + */ + ListAssetsRequest.prototype.pageToken = ""; + + /** + * ListAssetsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.securitycenter.v1beta1.ListAssetsRequest + * @instance + */ + ListAssetsRequest.prototype.pageSize = 0; + + /** + * Creates a new ListAssetsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1beta1.ListAssetsRequest + * @static + * @param {google.cloud.securitycenter.v1beta1.IListAssetsRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1beta1.ListAssetsRequest} ListAssetsRequest instance + */ + ListAssetsRequest.create = function create(properties) { + return new ListAssetsRequest(properties); + }; + + /** + * Encodes the specified ListAssetsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.ListAssetsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1beta1.ListAssetsRequest + * @static + * @param {google.cloud.securitycenter.v1beta1.IListAssetsRequest} message ListAssetsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAssetsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && message.hasOwnProperty("parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.filter != null && message.hasOwnProperty("filter")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.orderBy); + if (message.readTime != null && message.hasOwnProperty("readTime")) + $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.compareDuration != null && message.hasOwnProperty("compareDuration")) + $root.google.protobuf.Duration.encode(message.compareDuration, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.fieldMask != null && message.hasOwnProperty("fieldMask")) + $root.google.protobuf.FieldMask.encode(message.fieldMask, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.pageToken); + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.pageSize); + return writer; + }; + + /** + * Encodes the specified ListAssetsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.ListAssetsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1beta1.ListAssetsRequest + * @static + * @param {google.cloud.securitycenter.v1beta1.IListAssetsRequest} message ListAssetsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAssetsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListAssetsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1beta1.ListAssetsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1beta1.ListAssetsRequest} ListAssetsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAssetsRequest.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.cloud.securitycenter.v1beta1.ListAssetsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.filter = reader.string(); + break; + case 3: + message.orderBy = reader.string(); + break; + case 4: + message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 5: + message.compareDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + case 7: + message.fieldMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + case 8: + message.pageToken = reader.string(); + break; + case 9: + message.pageSize = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListAssetsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1beta1.ListAssetsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1beta1.ListAssetsRequest} ListAssetsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAssetsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListAssetsRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1beta1.ListAssetsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListAssetsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + if (message.readTime != null && message.hasOwnProperty("readTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.readTime); + if (error) + return "readTime." + error; + } + if (message.compareDuration != null && message.hasOwnProperty("compareDuration")) { + var error = $root.google.protobuf.Duration.verify(message.compareDuration); + if (error) + return "compareDuration." + error; + } + if (message.fieldMask != null && message.hasOwnProperty("fieldMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.fieldMask); + if (error) + return "fieldMask." + error; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + return null; + }; + + /** + * Creates a ListAssetsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1beta1.ListAssetsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1beta1.ListAssetsRequest} ListAssetsRequest + */ + ListAssetsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1beta1.ListAssetsRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1beta1.ListAssetsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.filter != null) + message.filter = String(object.filter); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.readTime != null) { + if (typeof object.readTime !== "object") + throw TypeError(".google.cloud.securitycenter.v1beta1.ListAssetsRequest.readTime: object expected"); + message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); + } + if (object.compareDuration != null) { + if (typeof object.compareDuration !== "object") + throw TypeError(".google.cloud.securitycenter.v1beta1.ListAssetsRequest.compareDuration: object expected"); + message.compareDuration = $root.google.protobuf.Duration.fromObject(object.compareDuration); + } + if (object.fieldMask != null) { + if (typeof object.fieldMask !== "object") + throw TypeError(".google.cloud.securitycenter.v1beta1.ListAssetsRequest.fieldMask: object expected"); + message.fieldMask = $root.google.protobuf.FieldMask.fromObject(object.fieldMask); + } + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + return message; + }; + + /** + * Creates a plain object from a ListAssetsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1beta1.ListAssetsRequest + * @static + * @param {google.cloud.securitycenter.v1beta1.ListAssetsRequest} message ListAssetsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListAssetsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.filter = ""; + object.orderBy = ""; + object.readTime = null; + object.compareDuration = null; + object.fieldMask = null; + object.pageToken = ""; + object.pageSize = 0; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; + if (message.readTime != null && message.hasOwnProperty("readTime")) + object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); + if (message.compareDuration != null && message.hasOwnProperty("compareDuration")) + object.compareDuration = $root.google.protobuf.Duration.toObject(message.compareDuration, options); + if (message.fieldMask != null && message.hasOwnProperty("fieldMask")) + object.fieldMask = $root.google.protobuf.FieldMask.toObject(message.fieldMask, options); + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + return object; + }; + + /** + * Converts this ListAssetsRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1beta1.ListAssetsRequest + * @instance + * @returns {Object.} JSON object + */ + ListAssetsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListAssetsRequest; + })(); + + v1beta1.ListAssetsResponse = (function() { + + /** + * Properties of a ListAssetsResponse. + * @memberof google.cloud.securitycenter.v1beta1 + * @interface IListAssetsResponse + * @property {Array.|null} [listAssetsResults] ListAssetsResponse listAssetsResults + * @property {google.protobuf.ITimestamp|null} [readTime] ListAssetsResponse readTime + * @property {string|null} [nextPageToken] ListAssetsResponse nextPageToken + * @property {number|null} [totalSize] ListAssetsResponse totalSize + */ + + /** + * Constructs a new ListAssetsResponse. + * @memberof google.cloud.securitycenter.v1beta1 + * @classdesc Represents a ListAssetsResponse. + * @implements IListAssetsResponse + * @constructor + * @param {google.cloud.securitycenter.v1beta1.IListAssetsResponse=} [properties] Properties to set + */ + function ListAssetsResponse(properties) { + this.listAssetsResults = []; + 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]]; + } + + /** + * ListAssetsResponse listAssetsResults. + * @member {Array.} listAssetsResults + * @memberof google.cloud.securitycenter.v1beta1.ListAssetsResponse + * @instance + */ + ListAssetsResponse.prototype.listAssetsResults = $util.emptyArray; + + /** + * ListAssetsResponse readTime. + * @member {google.protobuf.ITimestamp|null|undefined} readTime + * @memberof google.cloud.securitycenter.v1beta1.ListAssetsResponse + * @instance + */ + ListAssetsResponse.prototype.readTime = null; + + /** + * ListAssetsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.securitycenter.v1beta1.ListAssetsResponse + * @instance + */ + ListAssetsResponse.prototype.nextPageToken = ""; + + /** + * ListAssetsResponse totalSize. + * @member {number} totalSize + * @memberof google.cloud.securitycenter.v1beta1.ListAssetsResponse + * @instance + */ + ListAssetsResponse.prototype.totalSize = 0; + + /** + * Creates a new ListAssetsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1beta1.ListAssetsResponse + * @static + * @param {google.cloud.securitycenter.v1beta1.IListAssetsResponse=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1beta1.ListAssetsResponse} ListAssetsResponse instance + */ + ListAssetsResponse.create = function create(properties) { + return new ListAssetsResponse(properties); + }; + + /** + * Encodes the specified ListAssetsResponse message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.ListAssetsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1beta1.ListAssetsResponse + * @static + * @param {google.cloud.securitycenter.v1beta1.IListAssetsResponse} message ListAssetsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAssetsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.listAssetsResults != null && message.listAssetsResults.length) + for (var i = 0; i < message.listAssetsResults.length; ++i) + $root.google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult.encode(message.listAssetsResults[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.readTime != null && message.hasOwnProperty("readTime")) + $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.nextPageToken); + if (message.totalSize != null && message.hasOwnProperty("totalSize")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.totalSize); + return writer; + }; + + /** + * Encodes the specified ListAssetsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.ListAssetsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1beta1.ListAssetsResponse + * @static + * @param {google.cloud.securitycenter.v1beta1.IListAssetsResponse} message ListAssetsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAssetsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListAssetsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1beta1.ListAssetsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1beta1.ListAssetsResponse} ListAssetsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAssetsResponse.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.cloud.securitycenter.v1beta1.ListAssetsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.listAssetsResults && message.listAssetsResults.length)) + message.listAssetsResults = []; + message.listAssetsResults.push($root.google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult.decode(reader, reader.uint32())); + break; + case 2: + message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 3: + message.nextPageToken = reader.string(); + break; + case 4: + message.totalSize = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListAssetsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1beta1.ListAssetsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1beta1.ListAssetsResponse} ListAssetsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAssetsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListAssetsResponse message. + * @function verify + * @memberof google.cloud.securitycenter.v1beta1.ListAssetsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListAssetsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.listAssetsResults != null && message.hasOwnProperty("listAssetsResults")) { + if (!Array.isArray(message.listAssetsResults)) + return "listAssetsResults: array expected"; + for (var i = 0; i < message.listAssetsResults.length; ++i) { + var error = $root.google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult.verify(message.listAssetsResults[i]); + if (error) + return "listAssetsResults." + error; + } + } + if (message.readTime != null && message.hasOwnProperty("readTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.readTime); + if (error) + return "readTime." + error; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.totalSize != null && message.hasOwnProperty("totalSize")) + if (!$util.isInteger(message.totalSize)) + return "totalSize: integer expected"; + return null; + }; + + /** + * Creates a ListAssetsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1beta1.ListAssetsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1beta1.ListAssetsResponse} ListAssetsResponse + */ + ListAssetsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1beta1.ListAssetsResponse) + return object; + var message = new $root.google.cloud.securitycenter.v1beta1.ListAssetsResponse(); + if (object.listAssetsResults) { + if (!Array.isArray(object.listAssetsResults)) + throw TypeError(".google.cloud.securitycenter.v1beta1.ListAssetsResponse.listAssetsResults: array expected"); + message.listAssetsResults = []; + for (var i = 0; i < object.listAssetsResults.length; ++i) { + if (typeof object.listAssetsResults[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v1beta1.ListAssetsResponse.listAssetsResults: object expected"); + message.listAssetsResults[i] = $root.google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult.fromObject(object.listAssetsResults[i]); + } + } + if (object.readTime != null) { + if (typeof object.readTime !== "object") + throw TypeError(".google.cloud.securitycenter.v1beta1.ListAssetsResponse.readTime: object expected"); + message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.totalSize != null) + message.totalSize = object.totalSize | 0; + return message; + }; + + /** + * Creates a plain object from a ListAssetsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1beta1.ListAssetsResponse + * @static + * @param {google.cloud.securitycenter.v1beta1.ListAssetsResponse} message ListAssetsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListAssetsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.listAssetsResults = []; + if (options.defaults) { + object.readTime = null; + object.nextPageToken = ""; + object.totalSize = 0; + } + if (message.listAssetsResults && message.listAssetsResults.length) { + object.listAssetsResults = []; + for (var j = 0; j < message.listAssetsResults.length; ++j) + object.listAssetsResults[j] = $root.google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult.toObject(message.listAssetsResults[j], options); + } + if (message.readTime != null && message.hasOwnProperty("readTime")) + object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.totalSize != null && message.hasOwnProperty("totalSize")) + object.totalSize = message.totalSize; + return object; + }; + + /** + * Converts this ListAssetsResponse to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1beta1.ListAssetsResponse + * @instance + * @returns {Object.} JSON object + */ + ListAssetsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + ListAssetsResponse.ListAssetsResult = (function() { + + /** + * Properties of a ListAssetsResult. + * @memberof google.cloud.securitycenter.v1beta1.ListAssetsResponse + * @interface IListAssetsResult + * @property {google.cloud.securitycenter.v1beta1.IAsset|null} [asset] ListAssetsResult asset + * @property {google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult.State|null} [state] ListAssetsResult state + */ + + /** + * Constructs a new ListAssetsResult. + * @memberof google.cloud.securitycenter.v1beta1.ListAssetsResponse + * @classdesc Represents a ListAssetsResult. + * @implements IListAssetsResult + * @constructor + * @param {google.cloud.securitycenter.v1beta1.ListAssetsResponse.IListAssetsResult=} [properties] Properties to set + */ + function ListAssetsResult(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]]; + } + + /** + * ListAssetsResult asset. + * @member {google.cloud.securitycenter.v1beta1.IAsset|null|undefined} asset + * @memberof google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult + * @instance + */ + ListAssetsResult.prototype.asset = null; + + /** + * ListAssetsResult state. + * @member {google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult.State} state + * @memberof google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult + * @instance + */ + ListAssetsResult.prototype.state = 0; + + /** + * Creates a new ListAssetsResult instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult + * @static + * @param {google.cloud.securitycenter.v1beta1.ListAssetsResponse.IListAssetsResult=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult} ListAssetsResult instance + */ + ListAssetsResult.create = function create(properties) { + return new ListAssetsResult(properties); + }; + + /** + * Encodes the specified ListAssetsResult message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult + * @static + * @param {google.cloud.securitycenter.v1beta1.ListAssetsResponse.IListAssetsResult} message ListAssetsResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAssetsResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.asset != null && message.hasOwnProperty("asset")) + $root.google.cloud.securitycenter.v1beta1.Asset.encode(message.asset, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.state != null && message.hasOwnProperty("state")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.state); + return writer; + }; + + /** + * Encodes the specified ListAssetsResult message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult + * @static + * @param {google.cloud.securitycenter.v1beta1.ListAssetsResponse.IListAssetsResult} message ListAssetsResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAssetsResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListAssetsResult message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult} ListAssetsResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAssetsResult.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.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.asset = $root.google.cloud.securitycenter.v1beta1.Asset.decode(reader, reader.uint32()); + break; + case 2: + message.state = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListAssetsResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult} ListAssetsResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAssetsResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListAssetsResult message. + * @function verify + * @memberof google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListAssetsResult.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.asset != null && message.hasOwnProperty("asset")) { + var error = $root.google.cloud.securitycenter.v1beta1.Asset.verify(message.asset); + if (error) + return "asset." + error; + } + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + return null; + }; + + /** + * Creates a ListAssetsResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult} ListAssetsResult + */ + ListAssetsResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult) + return object; + var message = new $root.google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult(); + if (object.asset != null) { + if (typeof object.asset !== "object") + throw TypeError(".google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult.asset: object expected"); + message.asset = $root.google.cloud.securitycenter.v1beta1.Asset.fromObject(object.asset); + } + switch (object.state) { + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "UNUSED": + case 1: + message.state = 1; + break; + case "ADDED": + case 2: + message.state = 2; + break; + case "REMOVED": + case 3: + message.state = 3; + break; + case "ACTIVE": + case 4: + message.state = 4; + break; + } + return message; + }; + + /** + * Creates a plain object from a ListAssetsResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult + * @static + * @param {google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult} message ListAssetsResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListAssetsResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.asset = null; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + } + if (message.asset != null && message.hasOwnProperty("asset")) + object.asset = $root.google.cloud.securitycenter.v1beta1.Asset.toObject(message.asset, options); + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult.State[message.state] : message.state; + return object; + }; + + /** + * Converts this ListAssetsResult to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult + * @instance + * @returns {Object.} JSON object + */ + ListAssetsResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * State enum. + * @name google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult.State + * @enum {string} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} UNUSED=1 UNUSED value + * @property {number} ADDED=2 ADDED value + * @property {number} REMOVED=3 REMOVED value + * @property {number} ACTIVE=4 ACTIVE value + */ + ListAssetsResult.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "UNUSED"] = 1; + values[valuesById[2] = "ADDED"] = 2; + values[valuesById[3] = "REMOVED"] = 3; + values[valuesById[4] = "ACTIVE"] = 4; + return values; + })(); + + return ListAssetsResult; + })(); + + return ListAssetsResponse; + })(); + + v1beta1.ListFindingsRequest = (function() { + + /** + * Properties of a ListFindingsRequest. + * @memberof google.cloud.securitycenter.v1beta1 + * @interface IListFindingsRequest + * @property {string|null} [parent] ListFindingsRequest parent + * @property {string|null} [filter] ListFindingsRequest filter + * @property {string|null} [orderBy] ListFindingsRequest orderBy + * @property {google.protobuf.ITimestamp|null} [readTime] ListFindingsRequest readTime + * @property {google.protobuf.IFieldMask|null} [fieldMask] ListFindingsRequest fieldMask + * @property {string|null} [pageToken] ListFindingsRequest pageToken + * @property {number|null} [pageSize] ListFindingsRequest pageSize + */ + + /** + * Constructs a new ListFindingsRequest. + * @memberof google.cloud.securitycenter.v1beta1 + * @classdesc Represents a ListFindingsRequest. + * @implements IListFindingsRequest + * @constructor + * @param {google.cloud.securitycenter.v1beta1.IListFindingsRequest=} [properties] Properties to set + */ + function ListFindingsRequest(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]]; + } + + /** + * ListFindingsRequest parent. + * @member {string} parent + * @memberof google.cloud.securitycenter.v1beta1.ListFindingsRequest + * @instance + */ + ListFindingsRequest.prototype.parent = ""; + + /** + * ListFindingsRequest filter. + * @member {string} filter + * @memberof google.cloud.securitycenter.v1beta1.ListFindingsRequest + * @instance + */ + ListFindingsRequest.prototype.filter = ""; + + /** + * ListFindingsRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.securitycenter.v1beta1.ListFindingsRequest + * @instance + */ + ListFindingsRequest.prototype.orderBy = ""; + + /** + * ListFindingsRequest readTime. + * @member {google.protobuf.ITimestamp|null|undefined} readTime + * @memberof google.cloud.securitycenter.v1beta1.ListFindingsRequest + * @instance + */ + ListFindingsRequest.prototype.readTime = null; + + /** + * ListFindingsRequest fieldMask. + * @member {google.protobuf.IFieldMask|null|undefined} fieldMask + * @memberof google.cloud.securitycenter.v1beta1.ListFindingsRequest + * @instance + */ + ListFindingsRequest.prototype.fieldMask = null; + + /** + * ListFindingsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.securitycenter.v1beta1.ListFindingsRequest + * @instance + */ + ListFindingsRequest.prototype.pageToken = ""; + + /** + * ListFindingsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.securitycenter.v1beta1.ListFindingsRequest + * @instance + */ + ListFindingsRequest.prototype.pageSize = 0; + + /** + * Creates a new ListFindingsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1beta1.ListFindingsRequest + * @static + * @param {google.cloud.securitycenter.v1beta1.IListFindingsRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1beta1.ListFindingsRequest} ListFindingsRequest instance + */ + ListFindingsRequest.create = function create(properties) { + return new ListFindingsRequest(properties); + }; + + /** + * Encodes the specified ListFindingsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.ListFindingsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1beta1.ListFindingsRequest + * @static + * @param {google.cloud.securitycenter.v1beta1.IListFindingsRequest} message ListFindingsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListFindingsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && message.hasOwnProperty("parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.filter != null && message.hasOwnProperty("filter")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.orderBy); + if (message.readTime != null && message.hasOwnProperty("readTime")) + $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.fieldMask != null && message.hasOwnProperty("fieldMask")) + $root.google.protobuf.FieldMask.encode(message.fieldMask, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.pageToken); + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.pageSize); + return writer; + }; + + /** + * Encodes the specified ListFindingsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.ListFindingsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1beta1.ListFindingsRequest + * @static + * @param {google.cloud.securitycenter.v1beta1.IListFindingsRequest} message ListFindingsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListFindingsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListFindingsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1beta1.ListFindingsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1beta1.ListFindingsRequest} ListFindingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListFindingsRequest.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.cloud.securitycenter.v1beta1.ListFindingsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.filter = reader.string(); + break; + case 3: + message.orderBy = reader.string(); + break; + case 4: + message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 5: + message.fieldMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + case 6: + message.pageToken = reader.string(); + break; + case 7: + message.pageSize = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListFindingsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1beta1.ListFindingsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1beta1.ListFindingsRequest} ListFindingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListFindingsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListFindingsRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1beta1.ListFindingsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListFindingsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + if (message.readTime != null && message.hasOwnProperty("readTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.readTime); + if (error) + return "readTime." + error; + } + if (message.fieldMask != null && message.hasOwnProperty("fieldMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.fieldMask); + if (error) + return "fieldMask." + error; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + return null; + }; + + /** + * Creates a ListFindingsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1beta1.ListFindingsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1beta1.ListFindingsRequest} ListFindingsRequest + */ + ListFindingsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1beta1.ListFindingsRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1beta1.ListFindingsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.filter != null) + message.filter = String(object.filter); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.readTime != null) { + if (typeof object.readTime !== "object") + throw TypeError(".google.cloud.securitycenter.v1beta1.ListFindingsRequest.readTime: object expected"); + message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); + } + if (object.fieldMask != null) { + if (typeof object.fieldMask !== "object") + throw TypeError(".google.cloud.securitycenter.v1beta1.ListFindingsRequest.fieldMask: object expected"); + message.fieldMask = $root.google.protobuf.FieldMask.fromObject(object.fieldMask); + } + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + return message; + }; + + /** + * Creates a plain object from a ListFindingsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1beta1.ListFindingsRequest + * @static + * @param {google.cloud.securitycenter.v1beta1.ListFindingsRequest} message ListFindingsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListFindingsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.filter = ""; + object.orderBy = ""; + object.readTime = null; + object.fieldMask = null; + object.pageToken = ""; + object.pageSize = 0; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; + if (message.readTime != null && message.hasOwnProperty("readTime")) + object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); + if (message.fieldMask != null && message.hasOwnProperty("fieldMask")) + object.fieldMask = $root.google.protobuf.FieldMask.toObject(message.fieldMask, options); + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + return object; + }; + + /** + * Converts this ListFindingsRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1beta1.ListFindingsRequest + * @instance + * @returns {Object.} JSON object + */ + ListFindingsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListFindingsRequest; + })(); + + v1beta1.ListFindingsResponse = (function() { + + /** + * Properties of a ListFindingsResponse. + * @memberof google.cloud.securitycenter.v1beta1 + * @interface IListFindingsResponse + * @property {Array.|null} [findings] ListFindingsResponse findings + * @property {google.protobuf.ITimestamp|null} [readTime] ListFindingsResponse readTime + * @property {string|null} [nextPageToken] ListFindingsResponse nextPageToken + * @property {number|null} [totalSize] ListFindingsResponse totalSize + */ + + /** + * Constructs a new ListFindingsResponse. + * @memberof google.cloud.securitycenter.v1beta1 + * @classdesc Represents a ListFindingsResponse. + * @implements IListFindingsResponse + * @constructor + * @param {google.cloud.securitycenter.v1beta1.IListFindingsResponse=} [properties] Properties to set + */ + function ListFindingsResponse(properties) { + this.findings = []; + 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]]; + } + + /** + * ListFindingsResponse findings. + * @member {Array.} findings + * @memberof google.cloud.securitycenter.v1beta1.ListFindingsResponse + * @instance + */ + ListFindingsResponse.prototype.findings = $util.emptyArray; + + /** + * ListFindingsResponse readTime. + * @member {google.protobuf.ITimestamp|null|undefined} readTime + * @memberof google.cloud.securitycenter.v1beta1.ListFindingsResponse + * @instance + */ + ListFindingsResponse.prototype.readTime = null; + + /** + * ListFindingsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.securitycenter.v1beta1.ListFindingsResponse + * @instance + */ + ListFindingsResponse.prototype.nextPageToken = ""; + + /** + * ListFindingsResponse totalSize. + * @member {number} totalSize + * @memberof google.cloud.securitycenter.v1beta1.ListFindingsResponse + * @instance + */ + ListFindingsResponse.prototype.totalSize = 0; + + /** + * Creates a new ListFindingsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1beta1.ListFindingsResponse + * @static + * @param {google.cloud.securitycenter.v1beta1.IListFindingsResponse=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1beta1.ListFindingsResponse} ListFindingsResponse instance + */ + ListFindingsResponse.create = function create(properties) { + return new ListFindingsResponse(properties); + }; + + /** + * Encodes the specified ListFindingsResponse message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.ListFindingsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1beta1.ListFindingsResponse + * @static + * @param {google.cloud.securitycenter.v1beta1.IListFindingsResponse} message ListFindingsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListFindingsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.findings != null && message.findings.length) + for (var i = 0; i < message.findings.length; ++i) + $root.google.cloud.securitycenter.v1beta1.Finding.encode(message.findings[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.readTime != null && message.hasOwnProperty("readTime")) + $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.nextPageToken); + if (message.totalSize != null && message.hasOwnProperty("totalSize")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.totalSize); + return writer; + }; + + /** + * Encodes the specified ListFindingsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.ListFindingsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1beta1.ListFindingsResponse + * @static + * @param {google.cloud.securitycenter.v1beta1.IListFindingsResponse} message ListFindingsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListFindingsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListFindingsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1beta1.ListFindingsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1beta1.ListFindingsResponse} ListFindingsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListFindingsResponse.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.cloud.securitycenter.v1beta1.ListFindingsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.findings && message.findings.length)) + message.findings = []; + message.findings.push($root.google.cloud.securitycenter.v1beta1.Finding.decode(reader, reader.uint32())); + break; + case 2: + message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 3: + message.nextPageToken = reader.string(); + break; + case 4: + message.totalSize = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListFindingsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1beta1.ListFindingsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1beta1.ListFindingsResponse} ListFindingsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListFindingsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListFindingsResponse message. + * @function verify + * @memberof google.cloud.securitycenter.v1beta1.ListFindingsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListFindingsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.findings != null && message.hasOwnProperty("findings")) { + if (!Array.isArray(message.findings)) + return "findings: array expected"; + for (var i = 0; i < message.findings.length; ++i) { + var error = $root.google.cloud.securitycenter.v1beta1.Finding.verify(message.findings[i]); + if (error) + return "findings." + error; + } + } + if (message.readTime != null && message.hasOwnProperty("readTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.readTime); + if (error) + return "readTime." + error; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.totalSize != null && message.hasOwnProperty("totalSize")) + if (!$util.isInteger(message.totalSize)) + return "totalSize: integer expected"; + return null; + }; + + /** + * Creates a ListFindingsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1beta1.ListFindingsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1beta1.ListFindingsResponse} ListFindingsResponse + */ + ListFindingsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1beta1.ListFindingsResponse) + return object; + var message = new $root.google.cloud.securitycenter.v1beta1.ListFindingsResponse(); + if (object.findings) { + if (!Array.isArray(object.findings)) + throw TypeError(".google.cloud.securitycenter.v1beta1.ListFindingsResponse.findings: array expected"); + message.findings = []; + for (var i = 0; i < object.findings.length; ++i) { + if (typeof object.findings[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v1beta1.ListFindingsResponse.findings: object expected"); + message.findings[i] = $root.google.cloud.securitycenter.v1beta1.Finding.fromObject(object.findings[i]); + } + } + if (object.readTime != null) { + if (typeof object.readTime !== "object") + throw TypeError(".google.cloud.securitycenter.v1beta1.ListFindingsResponse.readTime: object expected"); + message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.totalSize != null) + message.totalSize = object.totalSize | 0; + return message; + }; + + /** + * Creates a plain object from a ListFindingsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1beta1.ListFindingsResponse + * @static + * @param {google.cloud.securitycenter.v1beta1.ListFindingsResponse} message ListFindingsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListFindingsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.findings = []; + if (options.defaults) { + object.readTime = null; + object.nextPageToken = ""; + object.totalSize = 0; + } + if (message.findings && message.findings.length) { + object.findings = []; + for (var j = 0; j < message.findings.length; ++j) + object.findings[j] = $root.google.cloud.securitycenter.v1beta1.Finding.toObject(message.findings[j], options); + } + if (message.readTime != null && message.hasOwnProperty("readTime")) + object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.totalSize != null && message.hasOwnProperty("totalSize")) + object.totalSize = message.totalSize; + return object; + }; + + /** + * Converts this ListFindingsResponse to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1beta1.ListFindingsResponse + * @instance + * @returns {Object.} JSON object + */ + ListFindingsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListFindingsResponse; + })(); + + v1beta1.SetFindingStateRequest = (function() { + + /** + * Properties of a SetFindingStateRequest. + * @memberof google.cloud.securitycenter.v1beta1 + * @interface ISetFindingStateRequest + * @property {string|null} [name] SetFindingStateRequest name + * @property {google.cloud.securitycenter.v1beta1.Finding.State|null} [state] SetFindingStateRequest state + * @property {google.protobuf.ITimestamp|null} [startTime] SetFindingStateRequest startTime + */ + + /** + * Constructs a new SetFindingStateRequest. + * @memberof google.cloud.securitycenter.v1beta1 + * @classdesc Represents a SetFindingStateRequest. + * @implements ISetFindingStateRequest + * @constructor + * @param {google.cloud.securitycenter.v1beta1.ISetFindingStateRequest=} [properties] Properties to set + */ + function SetFindingStateRequest(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]]; + } + + /** + * SetFindingStateRequest name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1beta1.SetFindingStateRequest + * @instance + */ + SetFindingStateRequest.prototype.name = ""; + + /** + * SetFindingStateRequest state. + * @member {google.cloud.securitycenter.v1beta1.Finding.State} state + * @memberof google.cloud.securitycenter.v1beta1.SetFindingStateRequest + * @instance + */ + SetFindingStateRequest.prototype.state = 0; + + /** + * SetFindingStateRequest startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.cloud.securitycenter.v1beta1.SetFindingStateRequest + * @instance + */ + SetFindingStateRequest.prototype.startTime = null; + + /** + * Creates a new SetFindingStateRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1beta1.SetFindingStateRequest + * @static + * @param {google.cloud.securitycenter.v1beta1.ISetFindingStateRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1beta1.SetFindingStateRequest} SetFindingStateRequest instance + */ + SetFindingStateRequest.create = function create(properties) { + return new SetFindingStateRequest(properties); + }; + + /** + * Encodes the specified SetFindingStateRequest message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.SetFindingStateRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1beta1.SetFindingStateRequest + * @static + * @param {google.cloud.securitycenter.v1beta1.ISetFindingStateRequest} message SetFindingStateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetFindingStateRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.state != null && message.hasOwnProperty("state")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.state); + if (message.startTime != null && message.hasOwnProperty("startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SetFindingStateRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.SetFindingStateRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1beta1.SetFindingStateRequest + * @static + * @param {google.cloud.securitycenter.v1beta1.ISetFindingStateRequest} message SetFindingStateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetFindingStateRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SetFindingStateRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1beta1.SetFindingStateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1beta1.SetFindingStateRequest} SetFindingStateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetFindingStateRequest.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.cloud.securitycenter.v1beta1.SetFindingStateRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.state = reader.int32(); + break; + case 3: + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SetFindingStateRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1beta1.SetFindingStateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1beta1.SetFindingStateRequest} SetFindingStateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetFindingStateRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SetFindingStateRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1beta1.SetFindingStateRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SetFindingStateRequest.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.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.startTime != null && message.hasOwnProperty("startTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.startTime); + if (error) + return "startTime." + error; + } + return null; + }; + + /** + * Creates a SetFindingStateRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1beta1.SetFindingStateRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1beta1.SetFindingStateRequest} SetFindingStateRequest + */ + SetFindingStateRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1beta1.SetFindingStateRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1beta1.SetFindingStateRequest(); + if (object.name != null) + message.name = String(object.name); + switch (object.state) { + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "ACTIVE": + case 1: + message.state = 1; + break; + case "INACTIVE": + case 2: + message.state = 2; + break; + } + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.cloud.securitycenter.v1beta1.SetFindingStateRequest.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); + } + return message; + }; + + /** + * Creates a plain object from a SetFindingStateRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1beta1.SetFindingStateRequest + * @static + * @param {google.cloud.securitycenter.v1beta1.SetFindingStateRequest} message SetFindingStateRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SetFindingStateRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.startTime = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.securitycenter.v1beta1.Finding.State[message.state] : message.state; + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); + return object; + }; + + /** + * Converts this SetFindingStateRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1beta1.SetFindingStateRequest + * @instance + * @returns {Object.} JSON object + */ + SetFindingStateRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SetFindingStateRequest; + })(); + + v1beta1.RunAssetDiscoveryRequest = (function() { + + /** + * Properties of a RunAssetDiscoveryRequest. + * @memberof google.cloud.securitycenter.v1beta1 + * @interface IRunAssetDiscoveryRequest + * @property {string|null} [parent] RunAssetDiscoveryRequest parent + */ + + /** + * Constructs a new RunAssetDiscoveryRequest. + * @memberof google.cloud.securitycenter.v1beta1 + * @classdesc Represents a RunAssetDiscoveryRequest. + * @implements IRunAssetDiscoveryRequest + * @constructor + * @param {google.cloud.securitycenter.v1beta1.IRunAssetDiscoveryRequest=} [properties] Properties to set + */ + function RunAssetDiscoveryRequest(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]]; + } + + /** + * RunAssetDiscoveryRequest parent. + * @member {string} parent + * @memberof google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest + * @instance + */ + RunAssetDiscoveryRequest.prototype.parent = ""; + + /** + * Creates a new RunAssetDiscoveryRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest + * @static + * @param {google.cloud.securitycenter.v1beta1.IRunAssetDiscoveryRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest} RunAssetDiscoveryRequest instance + */ + RunAssetDiscoveryRequest.create = function create(properties) { + return new RunAssetDiscoveryRequest(properties); + }; + + /** + * Encodes the specified RunAssetDiscoveryRequest message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest + * @static + * @param {google.cloud.securitycenter.v1beta1.IRunAssetDiscoveryRequest} message RunAssetDiscoveryRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RunAssetDiscoveryRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && message.hasOwnProperty("parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + return writer; + }; + + /** + * Encodes the specified RunAssetDiscoveryRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest + * @static + * @param {google.cloud.securitycenter.v1beta1.IRunAssetDiscoveryRequest} message RunAssetDiscoveryRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RunAssetDiscoveryRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RunAssetDiscoveryRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest} RunAssetDiscoveryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RunAssetDiscoveryRequest.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.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RunAssetDiscoveryRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest} RunAssetDiscoveryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RunAssetDiscoveryRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RunAssetDiscoveryRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RunAssetDiscoveryRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + return null; + }; + + /** + * Creates a RunAssetDiscoveryRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest} RunAssetDiscoveryRequest + */ + RunAssetDiscoveryRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest(); + if (object.parent != null) + message.parent = String(object.parent); + return message; + }; + + /** + * Creates a plain object from a RunAssetDiscoveryRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest + * @static + * @param {google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest} message RunAssetDiscoveryRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RunAssetDiscoveryRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.parent = ""; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + return object; + }; + + /** + * Converts this RunAssetDiscoveryRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest + * @instance + * @returns {Object.} JSON object + */ + RunAssetDiscoveryRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return RunAssetDiscoveryRequest; + })(); + + v1beta1.UpdateFindingRequest = (function() { + + /** + * Properties of an UpdateFindingRequest. + * @memberof google.cloud.securitycenter.v1beta1 + * @interface IUpdateFindingRequest + * @property {google.cloud.securitycenter.v1beta1.IFinding|null} [finding] UpdateFindingRequest finding + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateFindingRequest updateMask + */ + + /** + * Constructs a new UpdateFindingRequest. + * @memberof google.cloud.securitycenter.v1beta1 + * @classdesc Represents an UpdateFindingRequest. + * @implements IUpdateFindingRequest + * @constructor + * @param {google.cloud.securitycenter.v1beta1.IUpdateFindingRequest=} [properties] Properties to set + */ + function UpdateFindingRequest(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]]; + } + + /** + * UpdateFindingRequest finding. + * @member {google.cloud.securitycenter.v1beta1.IFinding|null|undefined} finding + * @memberof google.cloud.securitycenter.v1beta1.UpdateFindingRequest + * @instance + */ + UpdateFindingRequest.prototype.finding = null; + + /** + * UpdateFindingRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.securitycenter.v1beta1.UpdateFindingRequest + * @instance + */ + UpdateFindingRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateFindingRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1beta1.UpdateFindingRequest + * @static + * @param {google.cloud.securitycenter.v1beta1.IUpdateFindingRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1beta1.UpdateFindingRequest} UpdateFindingRequest instance + */ + UpdateFindingRequest.create = function create(properties) { + return new UpdateFindingRequest(properties); + }; + + /** + * Encodes the specified UpdateFindingRequest message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.UpdateFindingRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1beta1.UpdateFindingRequest + * @static + * @param {google.cloud.securitycenter.v1beta1.IUpdateFindingRequest} message UpdateFindingRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateFindingRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.finding != null && message.hasOwnProperty("finding")) + $root.google.cloud.securitycenter.v1beta1.Finding.encode(message.finding, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateFindingRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.UpdateFindingRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1beta1.UpdateFindingRequest + * @static + * @param {google.cloud.securitycenter.v1beta1.IUpdateFindingRequest} message UpdateFindingRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateFindingRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateFindingRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1beta1.UpdateFindingRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1beta1.UpdateFindingRequest} UpdateFindingRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateFindingRequest.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.cloud.securitycenter.v1beta1.UpdateFindingRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.finding = $root.google.cloud.securitycenter.v1beta1.Finding.decode(reader, reader.uint32()); + break; + case 2: + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateFindingRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1beta1.UpdateFindingRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1beta1.UpdateFindingRequest} UpdateFindingRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateFindingRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateFindingRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1beta1.UpdateFindingRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateFindingRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.finding != null && message.hasOwnProperty("finding")) { + var error = $root.google.cloud.securitycenter.v1beta1.Finding.verify(message.finding); + if (error) + return "finding." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + return null; + }; + + /** + * Creates an UpdateFindingRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1beta1.UpdateFindingRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1beta1.UpdateFindingRequest} UpdateFindingRequest + */ + UpdateFindingRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1beta1.UpdateFindingRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1beta1.UpdateFindingRequest(); + if (object.finding != null) { + if (typeof object.finding !== "object") + throw TypeError(".google.cloud.securitycenter.v1beta1.UpdateFindingRequest.finding: object expected"); + message.finding = $root.google.cloud.securitycenter.v1beta1.Finding.fromObject(object.finding); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.securitycenter.v1beta1.UpdateFindingRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateFindingRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1beta1.UpdateFindingRequest + * @static + * @param {google.cloud.securitycenter.v1beta1.UpdateFindingRequest} message UpdateFindingRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateFindingRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.finding = null; + object.updateMask = null; + } + if (message.finding != null && message.hasOwnProperty("finding")) + object.finding = $root.google.cloud.securitycenter.v1beta1.Finding.toObject(message.finding, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateFindingRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1beta1.UpdateFindingRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateFindingRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return UpdateFindingRequest; + })(); + + v1beta1.UpdateOrganizationSettingsRequest = (function() { + + /** + * Properties of an UpdateOrganizationSettingsRequest. + * @memberof google.cloud.securitycenter.v1beta1 + * @interface IUpdateOrganizationSettingsRequest + * @property {google.cloud.securitycenter.v1beta1.IOrganizationSettings|null} [organizationSettings] UpdateOrganizationSettingsRequest organizationSettings + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateOrganizationSettingsRequest updateMask + */ + + /** + * Constructs a new UpdateOrganizationSettingsRequest. + * @memberof google.cloud.securitycenter.v1beta1 + * @classdesc Represents an UpdateOrganizationSettingsRequest. + * @implements IUpdateOrganizationSettingsRequest + * @constructor + * @param {google.cloud.securitycenter.v1beta1.IUpdateOrganizationSettingsRequest=} [properties] Properties to set + */ + function UpdateOrganizationSettingsRequest(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]]; + } + + /** + * UpdateOrganizationSettingsRequest organizationSettings. + * @member {google.cloud.securitycenter.v1beta1.IOrganizationSettings|null|undefined} organizationSettings + * @memberof google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest + * @instance + */ + UpdateOrganizationSettingsRequest.prototype.organizationSettings = null; + + /** + * UpdateOrganizationSettingsRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest + * @instance + */ + UpdateOrganizationSettingsRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateOrganizationSettingsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest + * @static + * @param {google.cloud.securitycenter.v1beta1.IUpdateOrganizationSettingsRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest} UpdateOrganizationSettingsRequest instance + */ + UpdateOrganizationSettingsRequest.create = function create(properties) { + return new UpdateOrganizationSettingsRequest(properties); + }; + + /** + * Encodes the specified UpdateOrganizationSettingsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest + * @static + * @param {google.cloud.securitycenter.v1beta1.IUpdateOrganizationSettingsRequest} message UpdateOrganizationSettingsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateOrganizationSettingsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.organizationSettings != null && message.hasOwnProperty("organizationSettings")) + $root.google.cloud.securitycenter.v1beta1.OrganizationSettings.encode(message.organizationSettings, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateOrganizationSettingsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest + * @static + * @param {google.cloud.securitycenter.v1beta1.IUpdateOrganizationSettingsRequest} message UpdateOrganizationSettingsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateOrganizationSettingsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateOrganizationSettingsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest} UpdateOrganizationSettingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateOrganizationSettingsRequest.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.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.organizationSettings = $root.google.cloud.securitycenter.v1beta1.OrganizationSettings.decode(reader, reader.uint32()); + break; + case 2: + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateOrganizationSettingsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest} UpdateOrganizationSettingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateOrganizationSettingsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateOrganizationSettingsRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateOrganizationSettingsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.organizationSettings != null && message.hasOwnProperty("organizationSettings")) { + var error = $root.google.cloud.securitycenter.v1beta1.OrganizationSettings.verify(message.organizationSettings); + if (error) + return "organizationSettings." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + return null; + }; + + /** + * Creates an UpdateOrganizationSettingsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest} UpdateOrganizationSettingsRequest + */ + UpdateOrganizationSettingsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest(); + if (object.organizationSettings != null) { + if (typeof object.organizationSettings !== "object") + throw TypeError(".google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest.organizationSettings: object expected"); + message.organizationSettings = $root.google.cloud.securitycenter.v1beta1.OrganizationSettings.fromObject(object.organizationSettings); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateOrganizationSettingsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest + * @static + * @param {google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest} message UpdateOrganizationSettingsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateOrganizationSettingsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.organizationSettings = null; + object.updateMask = null; + } + if (message.organizationSettings != null && message.hasOwnProperty("organizationSettings")) + object.organizationSettings = $root.google.cloud.securitycenter.v1beta1.OrganizationSettings.toObject(message.organizationSettings, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateOrganizationSettingsRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateOrganizationSettingsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return UpdateOrganizationSettingsRequest; + })(); + + v1beta1.UpdateSourceRequest = (function() { + + /** + * Properties of an UpdateSourceRequest. + * @memberof google.cloud.securitycenter.v1beta1 + * @interface IUpdateSourceRequest + * @property {google.cloud.securitycenter.v1beta1.ISource|null} [source] UpdateSourceRequest source + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateSourceRequest updateMask + */ + + /** + * Constructs a new UpdateSourceRequest. + * @memberof google.cloud.securitycenter.v1beta1 + * @classdesc Represents an UpdateSourceRequest. + * @implements IUpdateSourceRequest + * @constructor + * @param {google.cloud.securitycenter.v1beta1.IUpdateSourceRequest=} [properties] Properties to set + */ + function UpdateSourceRequest(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]]; + } + + /** + * UpdateSourceRequest source. + * @member {google.cloud.securitycenter.v1beta1.ISource|null|undefined} source + * @memberof google.cloud.securitycenter.v1beta1.UpdateSourceRequest + * @instance + */ + UpdateSourceRequest.prototype.source = null; + + /** + * UpdateSourceRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.securitycenter.v1beta1.UpdateSourceRequest + * @instance + */ + UpdateSourceRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateSourceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1beta1.UpdateSourceRequest + * @static + * @param {google.cloud.securitycenter.v1beta1.IUpdateSourceRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1beta1.UpdateSourceRequest} UpdateSourceRequest instance + */ + UpdateSourceRequest.create = function create(properties) { + return new UpdateSourceRequest(properties); + }; + + /** + * Encodes the specified UpdateSourceRequest message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.UpdateSourceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1beta1.UpdateSourceRequest + * @static + * @param {google.cloud.securitycenter.v1beta1.IUpdateSourceRequest} message UpdateSourceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateSourceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.source != null && message.hasOwnProperty("source")) + $root.google.cloud.securitycenter.v1beta1.Source.encode(message.source, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateSourceRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.UpdateSourceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1beta1.UpdateSourceRequest + * @static + * @param {google.cloud.securitycenter.v1beta1.IUpdateSourceRequest} message UpdateSourceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateSourceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateSourceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1beta1.UpdateSourceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1beta1.UpdateSourceRequest} UpdateSourceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateSourceRequest.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.cloud.securitycenter.v1beta1.UpdateSourceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.source = $root.google.cloud.securitycenter.v1beta1.Source.decode(reader, reader.uint32()); + break; + case 2: + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateSourceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1beta1.UpdateSourceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1beta1.UpdateSourceRequest} UpdateSourceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateSourceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateSourceRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1beta1.UpdateSourceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateSourceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.source != null && message.hasOwnProperty("source")) { + var error = $root.google.cloud.securitycenter.v1beta1.Source.verify(message.source); + if (error) + return "source." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + return null; + }; + + /** + * Creates an UpdateSourceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1beta1.UpdateSourceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1beta1.UpdateSourceRequest} UpdateSourceRequest + */ + UpdateSourceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1beta1.UpdateSourceRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1beta1.UpdateSourceRequest(); + if (object.source != null) { + if (typeof object.source !== "object") + throw TypeError(".google.cloud.securitycenter.v1beta1.UpdateSourceRequest.source: object expected"); + message.source = $root.google.cloud.securitycenter.v1beta1.Source.fromObject(object.source); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.securitycenter.v1beta1.UpdateSourceRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateSourceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1beta1.UpdateSourceRequest + * @static + * @param {google.cloud.securitycenter.v1beta1.UpdateSourceRequest} message UpdateSourceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateSourceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.source = null; + object.updateMask = null; + } + if (message.source != null && message.hasOwnProperty("source")) + object.source = $root.google.cloud.securitycenter.v1beta1.Source.toObject(message.source, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateSourceRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1beta1.UpdateSourceRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateSourceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return UpdateSourceRequest; + })(); + + v1beta1.UpdateSecurityMarksRequest = (function() { + + /** + * Properties of an UpdateSecurityMarksRequest. + * @memberof google.cloud.securitycenter.v1beta1 + * @interface IUpdateSecurityMarksRequest + * @property {google.cloud.securitycenter.v1beta1.ISecurityMarks|null} [securityMarks] UpdateSecurityMarksRequest securityMarks + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateSecurityMarksRequest updateMask + * @property {google.protobuf.ITimestamp|null} [startTime] UpdateSecurityMarksRequest startTime + */ + + /** + * Constructs a new UpdateSecurityMarksRequest. + * @memberof google.cloud.securitycenter.v1beta1 + * @classdesc Represents an UpdateSecurityMarksRequest. + * @implements IUpdateSecurityMarksRequest + * @constructor + * @param {google.cloud.securitycenter.v1beta1.IUpdateSecurityMarksRequest=} [properties] Properties to set + */ + function UpdateSecurityMarksRequest(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]]; + } + + /** + * UpdateSecurityMarksRequest securityMarks. + * @member {google.cloud.securitycenter.v1beta1.ISecurityMarks|null|undefined} securityMarks + * @memberof google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest + * @instance + */ + UpdateSecurityMarksRequest.prototype.securityMarks = null; + + /** + * UpdateSecurityMarksRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest + * @instance + */ + UpdateSecurityMarksRequest.prototype.updateMask = null; + + /** + * UpdateSecurityMarksRequest startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest + * @instance + */ + UpdateSecurityMarksRequest.prototype.startTime = null; + + /** + * Creates a new UpdateSecurityMarksRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest + * @static + * @param {google.cloud.securitycenter.v1beta1.IUpdateSecurityMarksRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest} UpdateSecurityMarksRequest instance + */ + UpdateSecurityMarksRequest.create = function create(properties) { + return new UpdateSecurityMarksRequest(properties); + }; + + /** + * Encodes the specified UpdateSecurityMarksRequest message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest + * @static + * @param {google.cloud.securitycenter.v1beta1.IUpdateSecurityMarksRequest} message UpdateSecurityMarksRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateSecurityMarksRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.securityMarks != null && message.hasOwnProperty("securityMarks")) + $root.google.cloud.securitycenter.v1beta1.SecurityMarks.encode(message.securityMarks, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.startTime != null && message.hasOwnProperty("startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateSecurityMarksRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest + * @static + * @param {google.cloud.securitycenter.v1beta1.IUpdateSecurityMarksRequest} message UpdateSecurityMarksRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateSecurityMarksRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateSecurityMarksRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest} UpdateSecurityMarksRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateSecurityMarksRequest.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.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.securityMarks = $root.google.cloud.securitycenter.v1beta1.SecurityMarks.decode(reader, reader.uint32()); + break; + case 2: + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + case 3: + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateSecurityMarksRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest} UpdateSecurityMarksRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateSecurityMarksRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateSecurityMarksRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateSecurityMarksRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.securityMarks != null && message.hasOwnProperty("securityMarks")) { + var error = $root.google.cloud.securitycenter.v1beta1.SecurityMarks.verify(message.securityMarks); + if (error) + return "securityMarks." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + if (message.startTime != null && message.hasOwnProperty("startTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.startTime); + if (error) + return "startTime." + error; + } + return null; + }; + + /** + * Creates an UpdateSecurityMarksRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest} UpdateSecurityMarksRequest + */ + UpdateSecurityMarksRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest(); + if (object.securityMarks != null) { + if (typeof object.securityMarks !== "object") + throw TypeError(".google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest.securityMarks: object expected"); + message.securityMarks = $root.google.cloud.securitycenter.v1beta1.SecurityMarks.fromObject(object.securityMarks); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); + } + return message; + }; + + /** + * Creates a plain object from an UpdateSecurityMarksRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest + * @static + * @param {google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest} message UpdateSecurityMarksRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateSecurityMarksRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.securityMarks = null; + object.updateMask = null; + object.startTime = null; + } + if (message.securityMarks != null && message.hasOwnProperty("securityMarks")) + object.securityMarks = $root.google.cloud.securitycenter.v1beta1.SecurityMarks.toObject(message.securityMarks, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); + return object; + }; + + /** + * Converts this UpdateSecurityMarksRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateSecurityMarksRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return UpdateSecurityMarksRequest; + })(); + + v1beta1.Asset = (function() { + + /** + * Properties of an Asset. + * @memberof google.cloud.securitycenter.v1beta1 + * @interface IAsset + * @property {string|null} [name] Asset name + * @property {google.cloud.securitycenter.v1beta1.Asset.ISecurityCenterProperties|null} [securityCenterProperties] Asset securityCenterProperties + * @property {Object.|null} [resourceProperties] Asset resourceProperties + * @property {google.cloud.securitycenter.v1beta1.ISecurityMarks|null} [securityMarks] Asset securityMarks + * @property {google.protobuf.ITimestamp|null} [createTime] Asset createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Asset updateTime + */ + + /** + * Constructs a new Asset. + * @memberof google.cloud.securitycenter.v1beta1 + * @classdesc Represents an Asset. + * @implements IAsset + * @constructor + * @param {google.cloud.securitycenter.v1beta1.IAsset=} [properties] Properties to set + */ + function Asset(properties) { + this.resourceProperties = {}; + 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]]; + } + + /** + * Asset name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1beta1.Asset + * @instance + */ + Asset.prototype.name = ""; + + /** + * Asset securityCenterProperties. + * @member {google.cloud.securitycenter.v1beta1.Asset.ISecurityCenterProperties|null|undefined} securityCenterProperties + * @memberof google.cloud.securitycenter.v1beta1.Asset + * @instance + */ + Asset.prototype.securityCenterProperties = null; + + /** + * Asset resourceProperties. + * @member {Object.} resourceProperties + * @memberof google.cloud.securitycenter.v1beta1.Asset + * @instance + */ + Asset.prototype.resourceProperties = $util.emptyObject; + + /** + * Asset securityMarks. + * @member {google.cloud.securitycenter.v1beta1.ISecurityMarks|null|undefined} securityMarks + * @memberof google.cloud.securitycenter.v1beta1.Asset + * @instance + */ + Asset.prototype.securityMarks = null; + + /** + * Asset createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.securitycenter.v1beta1.Asset + * @instance + */ + Asset.prototype.createTime = null; + + /** + * Asset updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.securitycenter.v1beta1.Asset + * @instance + */ + Asset.prototype.updateTime = null; + + /** + * Creates a new Asset instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1beta1.Asset + * @static + * @param {google.cloud.securitycenter.v1beta1.IAsset=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1beta1.Asset} Asset instance + */ + Asset.create = function create(properties) { + return new Asset(properties); + }; + + /** + * Encodes the specified Asset message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.Asset.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1beta1.Asset + * @static + * @param {google.cloud.securitycenter.v1beta1.IAsset} message Asset message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Asset.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.securityCenterProperties != null && message.hasOwnProperty("securityCenterProperties")) + $root.google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties.encode(message.securityCenterProperties, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.resourceProperties != null && message.hasOwnProperty("resourceProperties")) + for (var keys = Object.keys(message.resourceProperties), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 7, wireType 2 =*/58).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.protobuf.Value.encode(message.resourceProperties[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.securityMarks != null && message.hasOwnProperty("securityMarks")) + $root.google.cloud.securitycenter.v1beta1.SecurityMarks.encode(message.securityMarks, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.createTime != null && message.hasOwnProperty("createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Asset message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.Asset.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1beta1.Asset + * @static + * @param {google.cloud.securitycenter.v1beta1.IAsset} message Asset message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Asset.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Asset message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1beta1.Asset + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1beta1.Asset} Asset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Asset.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.cloud.securitycenter.v1beta1.Asset(), key; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.securityCenterProperties = $root.google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties.decode(reader, reader.uint32()); + break; + case 7: + reader.skip().pos++; + if (message.resourceProperties === $util.emptyObject) + message.resourceProperties = {}; + key = reader.string(); + reader.pos++; + message.resourceProperties[key] = $root.google.protobuf.Value.decode(reader, reader.uint32()); + break; + case 8: + message.securityMarks = $root.google.cloud.securitycenter.v1beta1.SecurityMarks.decode(reader, reader.uint32()); + break; + case 9: + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 10: + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Asset message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1beta1.Asset + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1beta1.Asset} Asset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Asset.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Asset message. + * @function verify + * @memberof google.cloud.securitycenter.v1beta1.Asset + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Asset.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.securityCenterProperties != null && message.hasOwnProperty("securityCenterProperties")) { + var error = $root.google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties.verify(message.securityCenterProperties); + if (error) + return "securityCenterProperties." + error; + } + if (message.resourceProperties != null && message.hasOwnProperty("resourceProperties")) { + if (!$util.isObject(message.resourceProperties)) + return "resourceProperties: object expected"; + var key = Object.keys(message.resourceProperties); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.protobuf.Value.verify(message.resourceProperties[key[i]]); + if (error) + return "resourceProperties." + error; + } + } + if (message.securityMarks != null && message.hasOwnProperty("securityMarks")) { + var error = $root.google.cloud.securitycenter.v1beta1.SecurityMarks.verify(message.securityMarks); + if (error) + return "securityMarks." + error; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + return null; + }; + + /** + * Creates an Asset message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1beta1.Asset + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1beta1.Asset} Asset + */ + Asset.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1beta1.Asset) + return object; + var message = new $root.google.cloud.securitycenter.v1beta1.Asset(); + if (object.name != null) + message.name = String(object.name); + if (object.securityCenterProperties != null) { + if (typeof object.securityCenterProperties !== "object") + throw TypeError(".google.cloud.securitycenter.v1beta1.Asset.securityCenterProperties: object expected"); + message.securityCenterProperties = $root.google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties.fromObject(object.securityCenterProperties); + } + if (object.resourceProperties) { + if (typeof object.resourceProperties !== "object") + throw TypeError(".google.cloud.securitycenter.v1beta1.Asset.resourceProperties: object expected"); + message.resourceProperties = {}; + for (var keys = Object.keys(object.resourceProperties), i = 0; i < keys.length; ++i) { + if (typeof object.resourceProperties[keys[i]] !== "object") + throw TypeError(".google.cloud.securitycenter.v1beta1.Asset.resourceProperties: object expected"); + message.resourceProperties[keys[i]] = $root.google.protobuf.Value.fromObject(object.resourceProperties[keys[i]]); + } + } + if (object.securityMarks != null) { + if (typeof object.securityMarks !== "object") + throw TypeError(".google.cloud.securitycenter.v1beta1.Asset.securityMarks: object expected"); + message.securityMarks = $root.google.cloud.securitycenter.v1beta1.SecurityMarks.fromObject(object.securityMarks); + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.securitycenter.v1beta1.Asset.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.securitycenter.v1beta1.Asset.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + return message; + }; + + /** + * Creates a plain object from an Asset message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1beta1.Asset + * @static + * @param {google.cloud.securitycenter.v1beta1.Asset} message Asset + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Asset.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.resourceProperties = {}; + if (options.defaults) { + object.name = ""; + object.securityCenterProperties = null; + object.securityMarks = null; + object.createTime = null; + object.updateTime = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.securityCenterProperties != null && message.hasOwnProperty("securityCenterProperties")) + object.securityCenterProperties = $root.google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties.toObject(message.securityCenterProperties, options); + var keys2; + if (message.resourceProperties && (keys2 = Object.keys(message.resourceProperties)).length) { + object.resourceProperties = {}; + for (var j = 0; j < keys2.length; ++j) + object.resourceProperties[keys2[j]] = $root.google.protobuf.Value.toObject(message.resourceProperties[keys2[j]], options); + } + if (message.securityMarks != null && message.hasOwnProperty("securityMarks")) + object.securityMarks = $root.google.cloud.securitycenter.v1beta1.SecurityMarks.toObject(message.securityMarks, options); + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + return object; + }; + + /** + * Converts this Asset to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1beta1.Asset + * @instance + * @returns {Object.} JSON object + */ + Asset.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + Asset.SecurityCenterProperties = (function() { + + /** + * Properties of a SecurityCenterProperties. + * @memberof google.cloud.securitycenter.v1beta1.Asset + * @interface ISecurityCenterProperties + * @property {string|null} [resourceName] SecurityCenterProperties resourceName + * @property {string|null} [resourceType] SecurityCenterProperties resourceType + * @property {string|null} [resourceParent] SecurityCenterProperties resourceParent + * @property {string|null} [resourceProject] SecurityCenterProperties resourceProject + * @property {Array.|null} [resourceOwners] SecurityCenterProperties resourceOwners + */ + + /** + * Constructs a new SecurityCenterProperties. + * @memberof google.cloud.securitycenter.v1beta1.Asset + * @classdesc Represents a SecurityCenterProperties. + * @implements ISecurityCenterProperties + * @constructor + * @param {google.cloud.securitycenter.v1beta1.Asset.ISecurityCenterProperties=} [properties] Properties to set + */ + function SecurityCenterProperties(properties) { + this.resourceOwners = []; + 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]]; + } + + /** + * SecurityCenterProperties resourceName. + * @member {string} resourceName + * @memberof google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties + * @instance + */ + SecurityCenterProperties.prototype.resourceName = ""; + + /** + * SecurityCenterProperties resourceType. + * @member {string} resourceType + * @memberof google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties + * @instance + */ + SecurityCenterProperties.prototype.resourceType = ""; + + /** + * SecurityCenterProperties resourceParent. + * @member {string} resourceParent + * @memberof google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties + * @instance + */ + SecurityCenterProperties.prototype.resourceParent = ""; + + /** + * SecurityCenterProperties resourceProject. + * @member {string} resourceProject + * @memberof google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties + * @instance + */ + SecurityCenterProperties.prototype.resourceProject = ""; + + /** + * SecurityCenterProperties resourceOwners. + * @member {Array.} resourceOwners + * @memberof google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties + * @instance + */ + SecurityCenterProperties.prototype.resourceOwners = $util.emptyArray; + + /** + * Creates a new SecurityCenterProperties instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties + * @static + * @param {google.cloud.securitycenter.v1beta1.Asset.ISecurityCenterProperties=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties} SecurityCenterProperties instance + */ + SecurityCenterProperties.create = function create(properties) { + return new SecurityCenterProperties(properties); + }; + + /** + * Encodes the specified SecurityCenterProperties message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties + * @static + * @param {google.cloud.securitycenter.v1beta1.Asset.ISecurityCenterProperties} message SecurityCenterProperties message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SecurityCenterProperties.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.resourceName != null && message.hasOwnProperty("resourceName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.resourceName); + if (message.resourceType != null && message.hasOwnProperty("resourceType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.resourceType); + if (message.resourceParent != null && message.hasOwnProperty("resourceParent")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.resourceParent); + if (message.resourceProject != null && message.hasOwnProperty("resourceProject")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.resourceProject); + if (message.resourceOwners != null && message.resourceOwners.length) + for (var i = 0; i < message.resourceOwners.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.resourceOwners[i]); + return writer; + }; + + /** + * Encodes the specified SecurityCenterProperties message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties + * @static + * @param {google.cloud.securitycenter.v1beta1.Asset.ISecurityCenterProperties} message SecurityCenterProperties message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SecurityCenterProperties.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SecurityCenterProperties message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties} SecurityCenterProperties + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SecurityCenterProperties.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.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.resourceName = reader.string(); + break; + case 2: + message.resourceType = reader.string(); + break; + case 3: + message.resourceParent = reader.string(); + break; + case 4: + message.resourceProject = reader.string(); + break; + case 5: + if (!(message.resourceOwners && message.resourceOwners.length)) + message.resourceOwners = []; + message.resourceOwners.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SecurityCenterProperties message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties} SecurityCenterProperties + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SecurityCenterProperties.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SecurityCenterProperties message. + * @function verify + * @memberof google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SecurityCenterProperties.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.resourceName != null && message.hasOwnProperty("resourceName")) + if (!$util.isString(message.resourceName)) + return "resourceName: string expected"; + if (message.resourceType != null && message.hasOwnProperty("resourceType")) + if (!$util.isString(message.resourceType)) + return "resourceType: string expected"; + if (message.resourceParent != null && message.hasOwnProperty("resourceParent")) + if (!$util.isString(message.resourceParent)) + return "resourceParent: string expected"; + if (message.resourceProject != null && message.hasOwnProperty("resourceProject")) + if (!$util.isString(message.resourceProject)) + return "resourceProject: string expected"; + if (message.resourceOwners != null && message.hasOwnProperty("resourceOwners")) { + if (!Array.isArray(message.resourceOwners)) + return "resourceOwners: array expected"; + for (var i = 0; i < message.resourceOwners.length; ++i) + if (!$util.isString(message.resourceOwners[i])) + return "resourceOwners: string[] expected"; + } + return null; + }; + + /** + * Creates a SecurityCenterProperties message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties} SecurityCenterProperties + */ + SecurityCenterProperties.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties) + return object; + var message = new $root.google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties(); + if (object.resourceName != null) + message.resourceName = String(object.resourceName); + if (object.resourceType != null) + message.resourceType = String(object.resourceType); + if (object.resourceParent != null) + message.resourceParent = String(object.resourceParent); + if (object.resourceProject != null) + message.resourceProject = String(object.resourceProject); + if (object.resourceOwners) { + if (!Array.isArray(object.resourceOwners)) + throw TypeError(".google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties.resourceOwners: array expected"); + message.resourceOwners = []; + for (var i = 0; i < object.resourceOwners.length; ++i) + message.resourceOwners[i] = String(object.resourceOwners[i]); + } + return message; + }; + + /** + * Creates a plain object from a SecurityCenterProperties message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties + * @static + * @param {google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties} message SecurityCenterProperties + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SecurityCenterProperties.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.resourceOwners = []; + if (options.defaults) { + object.resourceName = ""; + object.resourceType = ""; + object.resourceParent = ""; + object.resourceProject = ""; + } + if (message.resourceName != null && message.hasOwnProperty("resourceName")) + object.resourceName = message.resourceName; + if (message.resourceType != null && message.hasOwnProperty("resourceType")) + object.resourceType = message.resourceType; + if (message.resourceParent != null && message.hasOwnProperty("resourceParent")) + object.resourceParent = message.resourceParent; + if (message.resourceProject != null && message.hasOwnProperty("resourceProject")) + object.resourceProject = message.resourceProject; + if (message.resourceOwners && message.resourceOwners.length) { + object.resourceOwners = []; + for (var j = 0; j < message.resourceOwners.length; ++j) + object.resourceOwners[j] = message.resourceOwners[j]; + } + return object; + }; + + /** + * Converts this SecurityCenterProperties to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties + * @instance + * @returns {Object.} JSON object + */ + SecurityCenterProperties.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SecurityCenterProperties; + })(); + + return Asset; + })(); + + v1beta1.SecurityMarks = (function() { + + /** + * Properties of a SecurityMarks. + * @memberof google.cloud.securitycenter.v1beta1 + * @interface ISecurityMarks + * @property {string|null} [name] SecurityMarks name + * @property {Object.|null} [marks] SecurityMarks marks + */ + + /** + * Constructs a new SecurityMarks. + * @memberof google.cloud.securitycenter.v1beta1 + * @classdesc Represents a SecurityMarks. + * @implements ISecurityMarks + * @constructor + * @param {google.cloud.securitycenter.v1beta1.ISecurityMarks=} [properties] Properties to set + */ + function SecurityMarks(properties) { + this.marks = {}; + 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]]; + } + + /** + * SecurityMarks name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1beta1.SecurityMarks + * @instance + */ + SecurityMarks.prototype.name = ""; + + /** + * SecurityMarks marks. + * @member {Object.} marks + * @memberof google.cloud.securitycenter.v1beta1.SecurityMarks + * @instance + */ + SecurityMarks.prototype.marks = $util.emptyObject; + + /** + * Creates a new SecurityMarks instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1beta1.SecurityMarks + * @static + * @param {google.cloud.securitycenter.v1beta1.ISecurityMarks=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1beta1.SecurityMarks} SecurityMarks instance + */ + SecurityMarks.create = function create(properties) { + return new SecurityMarks(properties); + }; + + /** + * Encodes the specified SecurityMarks message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.SecurityMarks.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1beta1.SecurityMarks + * @static + * @param {google.cloud.securitycenter.v1beta1.ISecurityMarks} message SecurityMarks message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SecurityMarks.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.marks != null && message.hasOwnProperty("marks")) + for (var keys = Object.keys(message.marks), i = 0; i < keys.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.marks[keys[i]]).ldelim(); + return writer; + }; + + /** + * Encodes the specified SecurityMarks message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.SecurityMarks.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1beta1.SecurityMarks + * @static + * @param {google.cloud.securitycenter.v1beta1.ISecurityMarks} message SecurityMarks message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SecurityMarks.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SecurityMarks message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1beta1.SecurityMarks + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1beta1.SecurityMarks} SecurityMarks + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SecurityMarks.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.cloud.securitycenter.v1beta1.SecurityMarks(), key; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + reader.skip().pos++; + if (message.marks === $util.emptyObject) + message.marks = {}; + key = reader.string(); + reader.pos++; + message.marks[key] = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SecurityMarks message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1beta1.SecurityMarks + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1beta1.SecurityMarks} SecurityMarks + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SecurityMarks.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SecurityMarks message. + * @function verify + * @memberof google.cloud.securitycenter.v1beta1.SecurityMarks + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SecurityMarks.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.marks != null && message.hasOwnProperty("marks")) { + if (!$util.isObject(message.marks)) + return "marks: object expected"; + var key = Object.keys(message.marks); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.marks[key[i]])) + return "marks: string{k:string} expected"; + } + return null; + }; + + /** + * Creates a SecurityMarks message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1beta1.SecurityMarks + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1beta1.SecurityMarks} SecurityMarks + */ + SecurityMarks.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1beta1.SecurityMarks) + return object; + var message = new $root.google.cloud.securitycenter.v1beta1.SecurityMarks(); + if (object.name != null) + message.name = String(object.name); + if (object.marks) { + if (typeof object.marks !== "object") + throw TypeError(".google.cloud.securitycenter.v1beta1.SecurityMarks.marks: object expected"); + message.marks = {}; + for (var keys = Object.keys(object.marks), i = 0; i < keys.length; ++i) + message.marks[keys[i]] = String(object.marks[keys[i]]); + } + return message; + }; + + /** + * Creates a plain object from a SecurityMarks message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1beta1.SecurityMarks + * @static + * @param {google.cloud.securitycenter.v1beta1.SecurityMarks} message SecurityMarks + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SecurityMarks.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.marks = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + var keys2; + if (message.marks && (keys2 = Object.keys(message.marks)).length) { + object.marks = {}; + for (var j = 0; j < keys2.length; ++j) + object.marks[keys2[j]] = message.marks[keys2[j]]; + } + return object; + }; + + /** + * Converts this SecurityMarks to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1beta1.SecurityMarks + * @instance + * @returns {Object.} JSON object + */ + SecurityMarks.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SecurityMarks; + })(); + + v1beta1.Finding = (function() { + + /** + * Properties of a Finding. + * @memberof google.cloud.securitycenter.v1beta1 + * @interface IFinding + * @property {string|null} [name] Finding name + * @property {string|null} [parent] Finding parent + * @property {string|null} [resourceName] Finding resourceName + * @property {google.cloud.securitycenter.v1beta1.Finding.State|null} [state] Finding state + * @property {string|null} [category] Finding category + * @property {string|null} [externalUri] Finding externalUri + * @property {Object.|null} [sourceProperties] Finding sourceProperties + * @property {google.cloud.securitycenter.v1beta1.ISecurityMarks|null} [securityMarks] Finding securityMarks + * @property {google.protobuf.ITimestamp|null} [eventTime] Finding eventTime + * @property {google.protobuf.ITimestamp|null} [createTime] Finding createTime + */ + + /** + * Constructs a new Finding. + * @memberof google.cloud.securitycenter.v1beta1 + * @classdesc Represents a Finding. + * @implements IFinding + * @constructor + * @param {google.cloud.securitycenter.v1beta1.IFinding=} [properties] Properties to set + */ + function Finding(properties) { + this.sourceProperties = {}; + 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]]; + } + + /** + * Finding name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1beta1.Finding + * @instance + */ + Finding.prototype.name = ""; + + /** + * Finding parent. + * @member {string} parent + * @memberof google.cloud.securitycenter.v1beta1.Finding + * @instance + */ + Finding.prototype.parent = ""; + + /** + * Finding resourceName. + * @member {string} resourceName + * @memberof google.cloud.securitycenter.v1beta1.Finding + * @instance + */ + Finding.prototype.resourceName = ""; + + /** + * Finding state. + * @member {google.cloud.securitycenter.v1beta1.Finding.State} state + * @memberof google.cloud.securitycenter.v1beta1.Finding + * @instance + */ + Finding.prototype.state = 0; + + /** + * Finding category. + * @member {string} category + * @memberof google.cloud.securitycenter.v1beta1.Finding + * @instance + */ + Finding.prototype.category = ""; + + /** + * Finding externalUri. + * @member {string} externalUri + * @memberof google.cloud.securitycenter.v1beta1.Finding + * @instance + */ + Finding.prototype.externalUri = ""; + + /** + * Finding sourceProperties. + * @member {Object.} sourceProperties + * @memberof google.cloud.securitycenter.v1beta1.Finding + * @instance + */ + Finding.prototype.sourceProperties = $util.emptyObject; + + /** + * Finding securityMarks. + * @member {google.cloud.securitycenter.v1beta1.ISecurityMarks|null|undefined} securityMarks + * @memberof google.cloud.securitycenter.v1beta1.Finding + * @instance + */ + Finding.prototype.securityMarks = null; + + /** + * Finding eventTime. + * @member {google.protobuf.ITimestamp|null|undefined} eventTime + * @memberof google.cloud.securitycenter.v1beta1.Finding + * @instance + */ + Finding.prototype.eventTime = null; + + /** + * Finding createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.securitycenter.v1beta1.Finding + * @instance + */ + Finding.prototype.createTime = null; + + /** + * Creates a new Finding instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1beta1.Finding + * @static + * @param {google.cloud.securitycenter.v1beta1.IFinding=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1beta1.Finding} Finding instance + */ + Finding.create = function create(properties) { + return new Finding(properties); + }; + + /** + * Encodes the specified Finding message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.Finding.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1beta1.Finding + * @static + * @param {google.cloud.securitycenter.v1beta1.IFinding} message Finding message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Finding.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.parent != null && message.hasOwnProperty("parent")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.parent); + if (message.resourceName != null && message.hasOwnProperty("resourceName")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.resourceName); + if (message.state != null && message.hasOwnProperty("state")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.state); + if (message.category != null && message.hasOwnProperty("category")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.category); + if (message.externalUri != null && message.hasOwnProperty("externalUri")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.externalUri); + if (message.sourceProperties != null && message.hasOwnProperty("sourceProperties")) + for (var keys = Object.keys(message.sourceProperties), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 7, wireType 2 =*/58).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.protobuf.Value.encode(message.sourceProperties[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.securityMarks != null && message.hasOwnProperty("securityMarks")) + $root.google.cloud.securitycenter.v1beta1.SecurityMarks.encode(message.securityMarks, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.eventTime != null && message.hasOwnProperty("eventTime")) + $root.google.protobuf.Timestamp.encode(message.eventTime, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.createTime != null && message.hasOwnProperty("createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Finding message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.Finding.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1beta1.Finding + * @static + * @param {google.cloud.securitycenter.v1beta1.IFinding} message Finding message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Finding.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Finding message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1beta1.Finding + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1beta1.Finding} Finding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Finding.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.cloud.securitycenter.v1beta1.Finding(), key; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.parent = reader.string(); + break; + case 3: + message.resourceName = reader.string(); + break; + case 4: + message.state = reader.int32(); + break; + case 5: + message.category = reader.string(); + break; + case 6: + message.externalUri = reader.string(); + break; + case 7: + reader.skip().pos++; + if (message.sourceProperties === $util.emptyObject) + message.sourceProperties = {}; + key = reader.string(); + reader.pos++; + message.sourceProperties[key] = $root.google.protobuf.Value.decode(reader, reader.uint32()); + break; + case 8: + message.securityMarks = $root.google.cloud.securitycenter.v1beta1.SecurityMarks.decode(reader, reader.uint32()); + break; + case 9: + message.eventTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 10: + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Finding message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1beta1.Finding + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1beta1.Finding} Finding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Finding.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Finding message. + * @function verify + * @memberof google.cloud.securitycenter.v1beta1.Finding + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Finding.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.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.resourceName != null && message.hasOwnProperty("resourceName")) + if (!$util.isString(message.resourceName)) + return "resourceName: string expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: 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"; + if (message.externalUri != null && message.hasOwnProperty("externalUri")) + if (!$util.isString(message.externalUri)) + return "externalUri: string expected"; + if (message.sourceProperties != null && message.hasOwnProperty("sourceProperties")) { + if (!$util.isObject(message.sourceProperties)) + return "sourceProperties: object expected"; + var key = Object.keys(message.sourceProperties); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.protobuf.Value.verify(message.sourceProperties[key[i]]); + if (error) + return "sourceProperties." + error; + } + } + if (message.securityMarks != null && message.hasOwnProperty("securityMarks")) { + var error = $root.google.cloud.securitycenter.v1beta1.SecurityMarks.verify(message.securityMarks); + if (error) + return "securityMarks." + error; + } + if (message.eventTime != null && message.hasOwnProperty("eventTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.eventTime); + if (error) + return "eventTime." + error; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + return null; + }; + + /** + * Creates a Finding message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1beta1.Finding + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1beta1.Finding} Finding + */ + Finding.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1beta1.Finding) + return object; + var message = new $root.google.cloud.securitycenter.v1beta1.Finding(); + if (object.name != null) + message.name = String(object.name); + if (object.parent != null) + message.parent = String(object.parent); + if (object.resourceName != null) + message.resourceName = String(object.resourceName); + switch (object.state) { + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "ACTIVE": + case 1: + message.state = 1; + break; + case "INACTIVE": + case 2: + message.state = 2; + break; + } + if (object.category != null) + message.category = String(object.category); + if (object.externalUri != null) + message.externalUri = String(object.externalUri); + if (object.sourceProperties) { + if (typeof object.sourceProperties !== "object") + throw TypeError(".google.cloud.securitycenter.v1beta1.Finding.sourceProperties: object expected"); + message.sourceProperties = {}; + for (var keys = Object.keys(object.sourceProperties), i = 0; i < keys.length; ++i) { + if (typeof object.sourceProperties[keys[i]] !== "object") + throw TypeError(".google.cloud.securitycenter.v1beta1.Finding.sourceProperties: object expected"); + message.sourceProperties[keys[i]] = $root.google.protobuf.Value.fromObject(object.sourceProperties[keys[i]]); + } + } + if (object.securityMarks != null) { + if (typeof object.securityMarks !== "object") + throw TypeError(".google.cloud.securitycenter.v1beta1.Finding.securityMarks: object expected"); + message.securityMarks = $root.google.cloud.securitycenter.v1beta1.SecurityMarks.fromObject(object.securityMarks); + } + if (object.eventTime != null) { + if (typeof object.eventTime !== "object") + throw TypeError(".google.cloud.securitycenter.v1beta1.Finding.eventTime: object expected"); + message.eventTime = $root.google.protobuf.Timestamp.fromObject(object.eventTime); + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.securitycenter.v1beta1.Finding.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + return message; + }; + + /** + * Creates a plain object from a Finding message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1beta1.Finding + * @static + * @param {google.cloud.securitycenter.v1beta1.Finding} message Finding + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Finding.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.sourceProperties = {}; + if (options.defaults) { + object.name = ""; + object.parent = ""; + object.resourceName = ""; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.category = ""; + object.externalUri = ""; + object.securityMarks = null; + object.eventTime = null; + object.createTime = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.resourceName != null && message.hasOwnProperty("resourceName")) + object.resourceName = message.resourceName; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.securitycenter.v1beta1.Finding.State[message.state] : message.state; + if (message.category != null && message.hasOwnProperty("category")) + object.category = message.category; + if (message.externalUri != null && message.hasOwnProperty("externalUri")) + object.externalUri = message.externalUri; + var keys2; + if (message.sourceProperties && (keys2 = Object.keys(message.sourceProperties)).length) { + object.sourceProperties = {}; + for (var j = 0; j < keys2.length; ++j) + object.sourceProperties[keys2[j]] = $root.google.protobuf.Value.toObject(message.sourceProperties[keys2[j]], options); + } + if (message.securityMarks != null && message.hasOwnProperty("securityMarks")) + object.securityMarks = $root.google.cloud.securitycenter.v1beta1.SecurityMarks.toObject(message.securityMarks, options); + if (message.eventTime != null && message.hasOwnProperty("eventTime")) + object.eventTime = $root.google.protobuf.Timestamp.toObject(message.eventTime, options); + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + return object; + }; + + /** + * Converts this Finding to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1beta1.Finding + * @instance + * @returns {Object.} JSON object + */ + Finding.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * State enum. + * @name google.cloud.securitycenter.v1beta1.Finding.State + * @enum {string} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} ACTIVE=1 ACTIVE value + * @property {number} INACTIVE=2 INACTIVE value + */ + Finding.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ACTIVE"] = 1; + values[valuesById[2] = "INACTIVE"] = 2; + return values; + })(); + + return Finding; + })(); + + v1beta1.OrganizationSettings = (function() { + + /** + * Properties of an OrganizationSettings. + * @memberof google.cloud.securitycenter.v1beta1 + * @interface IOrganizationSettings + * @property {string|null} [name] OrganizationSettings name + * @property {boolean|null} [enableAssetDiscovery] OrganizationSettings enableAssetDiscovery + * @property {google.cloud.securitycenter.v1beta1.OrganizationSettings.IAssetDiscoveryConfig|null} [assetDiscoveryConfig] OrganizationSettings assetDiscoveryConfig + */ + + /** + * Constructs a new OrganizationSettings. + * @memberof google.cloud.securitycenter.v1beta1 + * @classdesc Represents an OrganizationSettings. + * @implements IOrganizationSettings + * @constructor + * @param {google.cloud.securitycenter.v1beta1.IOrganizationSettings=} [properties] Properties to set + */ + function OrganizationSettings(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]]; + } + + /** + * OrganizationSettings name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1beta1.OrganizationSettings + * @instance + */ + OrganizationSettings.prototype.name = ""; + + /** + * OrganizationSettings enableAssetDiscovery. + * @member {boolean} enableAssetDiscovery + * @memberof google.cloud.securitycenter.v1beta1.OrganizationSettings + * @instance + */ + OrganizationSettings.prototype.enableAssetDiscovery = false; + + /** + * OrganizationSettings assetDiscoveryConfig. + * @member {google.cloud.securitycenter.v1beta1.OrganizationSettings.IAssetDiscoveryConfig|null|undefined} assetDiscoveryConfig + * @memberof google.cloud.securitycenter.v1beta1.OrganizationSettings + * @instance + */ + OrganizationSettings.prototype.assetDiscoveryConfig = null; + + /** + * Creates a new OrganizationSettings instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1beta1.OrganizationSettings + * @static + * @param {google.cloud.securitycenter.v1beta1.IOrganizationSettings=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1beta1.OrganizationSettings} OrganizationSettings instance + */ + OrganizationSettings.create = function create(properties) { + return new OrganizationSettings(properties); + }; + + /** + * Encodes the specified OrganizationSettings message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.OrganizationSettings.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1beta1.OrganizationSettings + * @static + * @param {google.cloud.securitycenter.v1beta1.IOrganizationSettings} message OrganizationSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OrganizationSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.enableAssetDiscovery != null && message.hasOwnProperty("enableAssetDiscovery")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.enableAssetDiscovery); + if (message.assetDiscoveryConfig != null && message.hasOwnProperty("assetDiscoveryConfig")) + $root.google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig.encode(message.assetDiscoveryConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OrganizationSettings message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.OrganizationSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1beta1.OrganizationSettings + * @static + * @param {google.cloud.securitycenter.v1beta1.IOrganizationSettings} message OrganizationSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OrganizationSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OrganizationSettings message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1beta1.OrganizationSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1beta1.OrganizationSettings} OrganizationSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OrganizationSettings.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.cloud.securitycenter.v1beta1.OrganizationSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.enableAssetDiscovery = reader.bool(); + break; + case 3: + message.assetDiscoveryConfig = $root.google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OrganizationSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1beta1.OrganizationSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1beta1.OrganizationSettings} OrganizationSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OrganizationSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OrganizationSettings message. + * @function verify + * @memberof google.cloud.securitycenter.v1beta1.OrganizationSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OrganizationSettings.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.enableAssetDiscovery != null && message.hasOwnProperty("enableAssetDiscovery")) + if (typeof message.enableAssetDiscovery !== "boolean") + return "enableAssetDiscovery: boolean expected"; + if (message.assetDiscoveryConfig != null && message.hasOwnProperty("assetDiscoveryConfig")) { + var error = $root.google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig.verify(message.assetDiscoveryConfig); + if (error) + return "assetDiscoveryConfig." + error; + } + return null; + }; + + /** + * Creates an OrganizationSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1beta1.OrganizationSettings + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1beta1.OrganizationSettings} OrganizationSettings + */ + OrganizationSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1beta1.OrganizationSettings) + return object; + var message = new $root.google.cloud.securitycenter.v1beta1.OrganizationSettings(); + if (object.name != null) + message.name = String(object.name); + if (object.enableAssetDiscovery != null) + message.enableAssetDiscovery = Boolean(object.enableAssetDiscovery); + if (object.assetDiscoveryConfig != null) { + if (typeof object.assetDiscoveryConfig !== "object") + throw TypeError(".google.cloud.securitycenter.v1beta1.OrganizationSettings.assetDiscoveryConfig: object expected"); + message.assetDiscoveryConfig = $root.google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig.fromObject(object.assetDiscoveryConfig); + } + return message; + }; + + /** + * Creates a plain object from an OrganizationSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1beta1.OrganizationSettings + * @static + * @param {google.cloud.securitycenter.v1beta1.OrganizationSettings} message OrganizationSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OrganizationSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.enableAssetDiscovery = false; + object.assetDiscoveryConfig = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.enableAssetDiscovery != null && message.hasOwnProperty("enableAssetDiscovery")) + object.enableAssetDiscovery = message.enableAssetDiscovery; + if (message.assetDiscoveryConfig != null && message.hasOwnProperty("assetDiscoveryConfig")) + object.assetDiscoveryConfig = $root.google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig.toObject(message.assetDiscoveryConfig, options); + return object; + }; + + /** + * Converts this OrganizationSettings to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1beta1.OrganizationSettings + * @instance + * @returns {Object.} JSON object + */ + OrganizationSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + OrganizationSettings.AssetDiscoveryConfig = (function() { + + /** + * Properties of an AssetDiscoveryConfig. + * @memberof google.cloud.securitycenter.v1beta1.OrganizationSettings + * @interface IAssetDiscoveryConfig + * @property {Array.|null} [projectIds] AssetDiscoveryConfig projectIds + * @property {google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode|null} [inclusionMode] AssetDiscoveryConfig inclusionMode + */ + + /** + * Constructs a new AssetDiscoveryConfig. + * @memberof google.cloud.securitycenter.v1beta1.OrganizationSettings + * @classdesc Represents an AssetDiscoveryConfig. + * @implements IAssetDiscoveryConfig + * @constructor + * @param {google.cloud.securitycenter.v1beta1.OrganizationSettings.IAssetDiscoveryConfig=} [properties] Properties to set + */ + function AssetDiscoveryConfig(properties) { + this.projectIds = []; + 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]]; + } + + /** + * AssetDiscoveryConfig projectIds. + * @member {Array.} projectIds + * @memberof google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig + * @instance + */ + AssetDiscoveryConfig.prototype.projectIds = $util.emptyArray; + + /** + * AssetDiscoveryConfig inclusionMode. + * @member {google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode} inclusionMode + * @memberof google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig + * @instance + */ + AssetDiscoveryConfig.prototype.inclusionMode = 0; + + /** + * Creates a new AssetDiscoveryConfig instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig + * @static + * @param {google.cloud.securitycenter.v1beta1.OrganizationSettings.IAssetDiscoveryConfig=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig} AssetDiscoveryConfig instance + */ + AssetDiscoveryConfig.create = function create(properties) { + return new AssetDiscoveryConfig(properties); + }; + + /** + * Encodes the specified AssetDiscoveryConfig message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig + * @static + * @param {google.cloud.securitycenter.v1beta1.OrganizationSettings.IAssetDiscoveryConfig} message AssetDiscoveryConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AssetDiscoveryConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.projectIds != null && message.projectIds.length) + for (var i = 0; i < message.projectIds.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectIds[i]); + if (message.inclusionMode != null && message.hasOwnProperty("inclusionMode")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.inclusionMode); + return writer; + }; + + /** + * Encodes the specified AssetDiscoveryConfig message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig + * @static + * @param {google.cloud.securitycenter.v1beta1.OrganizationSettings.IAssetDiscoveryConfig} message AssetDiscoveryConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AssetDiscoveryConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AssetDiscoveryConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig} AssetDiscoveryConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AssetDiscoveryConfig.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.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.projectIds && message.projectIds.length)) + message.projectIds = []; + message.projectIds.push(reader.string()); + break; + case 2: + message.inclusionMode = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AssetDiscoveryConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig} AssetDiscoveryConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AssetDiscoveryConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AssetDiscoveryConfig message. + * @function verify + * @memberof google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AssetDiscoveryConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.projectIds != null && message.hasOwnProperty("projectIds")) { + if (!Array.isArray(message.projectIds)) + return "projectIds: array expected"; + for (var i = 0; i < message.projectIds.length; ++i) + if (!$util.isString(message.projectIds[i])) + return "projectIds: string[] expected"; + } + if (message.inclusionMode != null && message.hasOwnProperty("inclusionMode")) + switch (message.inclusionMode) { + default: + return "inclusionMode: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates an AssetDiscoveryConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig} AssetDiscoveryConfig + */ + AssetDiscoveryConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig) + return object; + var message = new $root.google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig(); + if (object.projectIds) { + if (!Array.isArray(object.projectIds)) + throw TypeError(".google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig.projectIds: array expected"); + message.projectIds = []; + for (var i = 0; i < object.projectIds.length; ++i) + message.projectIds[i] = String(object.projectIds[i]); + } + switch (object.inclusionMode) { + case "INCLUSION_MODE_UNSPECIFIED": + case 0: + message.inclusionMode = 0; + break; + case "INCLUDE_ONLY": + case 1: + message.inclusionMode = 1; + break; + case "EXCLUDE": + case 2: + message.inclusionMode = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from an AssetDiscoveryConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig + * @static + * @param {google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig} message AssetDiscoveryConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AssetDiscoveryConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.projectIds = []; + if (options.defaults) + object.inclusionMode = options.enums === String ? "INCLUSION_MODE_UNSPECIFIED" : 0; + if (message.projectIds && message.projectIds.length) { + object.projectIds = []; + for (var j = 0; j < message.projectIds.length; ++j) + object.projectIds[j] = message.projectIds[j]; + } + if (message.inclusionMode != null && message.hasOwnProperty("inclusionMode")) + object.inclusionMode = options.enums === String ? $root.google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode[message.inclusionMode] : message.inclusionMode; + return object; + }; + + /** + * Converts this AssetDiscoveryConfig to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig + * @instance + * @returns {Object.} JSON object + */ + AssetDiscoveryConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * InclusionMode enum. + * @name google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode + * @enum {string} + * @property {number} INCLUSION_MODE_UNSPECIFIED=0 INCLUSION_MODE_UNSPECIFIED value + * @property {number} INCLUDE_ONLY=1 INCLUDE_ONLY value + * @property {number} EXCLUDE=2 EXCLUDE value + */ + AssetDiscoveryConfig.InclusionMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "INCLUSION_MODE_UNSPECIFIED"] = 0; + values[valuesById[1] = "INCLUDE_ONLY"] = 1; + values[valuesById[2] = "EXCLUDE"] = 2; + return values; + })(); + + return AssetDiscoveryConfig; + })(); + + return OrganizationSettings; + })(); + + v1beta1.Source = (function() { + + /** + * Properties of a Source. + * @memberof google.cloud.securitycenter.v1beta1 + * @interface ISource + * @property {string|null} [name] Source name + * @property {string|null} [displayName] Source displayName + * @property {string|null} [description] Source description + */ + + /** + * Constructs a new Source. + * @memberof google.cloud.securitycenter.v1beta1 + * @classdesc Represents a Source. + * @implements ISource + * @constructor + * @param {google.cloud.securitycenter.v1beta1.ISource=} [properties] Properties to set + */ + function Source(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]]; + } + + /** + * Source name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1beta1.Source + * @instance + */ + Source.prototype.name = ""; + + /** + * Source displayName. + * @member {string} displayName + * @memberof google.cloud.securitycenter.v1beta1.Source + * @instance + */ + Source.prototype.displayName = ""; + + /** + * Source description. + * @member {string} description + * @memberof google.cloud.securitycenter.v1beta1.Source + * @instance + */ + Source.prototype.description = ""; + + /** + * Creates a new Source instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1beta1.Source + * @static + * @param {google.cloud.securitycenter.v1beta1.ISource=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1beta1.Source} Source instance + */ + Source.create = function create(properties) { + return new Source(properties); + }; + + /** + * Encodes the specified Source message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.Source.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1beta1.Source + * @static + * @param {google.cloud.securitycenter.v1beta1.ISource} message Source message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Source.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.displayName != null && message.hasOwnProperty("displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + if (message.description != null && message.hasOwnProperty("description")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + return writer; + }; + + /** + * Encodes the specified Source message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.Source.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1beta1.Source + * @static + * @param {google.cloud.securitycenter.v1beta1.ISource} message Source message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Source.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Source message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1beta1.Source + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1beta1.Source} Source + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Source.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.cloud.securitycenter.v1beta1.Source(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.displayName = reader.string(); + break; + case 3: + message.description = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Source message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1beta1.Source + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1beta1.Source} Source + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Source.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Source message. + * @function verify + * @memberof google.cloud.securitycenter.v1beta1.Source + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Source.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.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + return null; + }; + + /** + * Creates a Source message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1beta1.Source + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1beta1.Source} Source + */ + Source.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1beta1.Source) + return object; + var message = new $root.google.cloud.securitycenter.v1beta1.Source(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.description != null) + message.description = String(object.description); + return message; + }; + + /** + * Creates a plain object from a Source message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1beta1.Source + * @static + * @param {google.cloud.securitycenter.v1beta1.Source} message Source + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Source.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.description = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + return object; + }; + + /** + * Converts this Source to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1beta1.Source + * @instance + * @returns {Object.} JSON object + */ + Source.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Source; + })(); + + return v1beta1; + })(); + + return securitycenter; + })(); + + return cloud; + })(); + + 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 && message.hasOwnProperty("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); + }; + + 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} get + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.get = ""; + + /** + * HttpRule put. + * @member {string} put + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.put = ""; + + /** + * HttpRule post. + * @member {string} post + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.post = ""; + + /** + * HttpRule delete. + * @member {string} delete + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype["delete"] = ""; + + /** + * HttpRule patch. + * @member {string} patch + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.patch = ""; + + /** + * 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 && message.hasOwnProperty("selector")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector); + if (message.get != null && message.hasOwnProperty("get")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.get); + if (message.put != null && message.hasOwnProperty("put")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.put); + if (message.post != null && message.hasOwnProperty("post")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.post); + if (message["delete"] != null && message.hasOwnProperty("delete")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message["delete"]); + if (message.patch != null && message.hasOwnProperty("patch")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.patch); + if (message.body != null && message.hasOwnProperty("body")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.body); + if (message.custom != null && message.hasOwnProperty("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 && message.hasOwnProperty("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); + }; + + 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 && message.hasOwnProperty("kind")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.kind); + if (message.path != null && message.hasOwnProperty("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); + }; + + return CustomHttpPattern; + })(); + + return api; + })(); + + google.protobuf = (function() { + + /** + * Namespace protobuf. + * @memberof google + * @namespace + */ + var protobuf = {}; + + 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); + }; + + 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 + */ + + /** + * 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 = ""; + + /** + * 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 && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message["package"] != null && message.hasOwnProperty("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 && message.hasOwnProperty("options")) + $root.google.protobuf.FileOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.sourceCodeInfo != null && message.hasOwnProperty("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 && message.hasOwnProperty("syntax")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.syntax); + 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; + 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"; + 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); + 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 = ""; + } + 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; + 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); + }; + + 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 && message.hasOwnProperty("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 && message.hasOwnProperty("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); + }; + + 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 && message.hasOwnProperty("start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && message.hasOwnProperty("end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + if (message.options != null && message.hasOwnProperty("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); + }; + + 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 && message.hasOwnProperty("start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && message.hasOwnProperty("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); + }; + + 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); + }; + + 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 + */ + + /** + * 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; + + /** + * 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 && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.extendee != null && message.hasOwnProperty("extendee")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.extendee); + if (message.number != null && message.hasOwnProperty("number")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.number); + if (message.label != null && message.hasOwnProperty("label")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.label); + if (message.type != null && message.hasOwnProperty("type")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.type); + if (message.typeName != null && message.hasOwnProperty("typeName")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.typeName); + if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.defaultValue); + if (message.options != null && message.hasOwnProperty("options")) + $root.google.protobuf.FieldOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.oneofIndex); + if (message.jsonName != null && message.hasOwnProperty("jsonName")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.jsonName); + 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; + 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; + } + 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) { + 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) { + 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); + } + 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 = ""; + } + 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] : message.label; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $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; + 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); + }; + + /** + * Type enum. + * @name google.protobuf.FieldDescriptorProto.Type + * @enum {string} + * @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 {string} + * @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 && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.options != null && message.hasOwnProperty("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); + }; + + 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 && message.hasOwnProperty("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 && message.hasOwnProperty("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); + }; + + 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 && message.hasOwnProperty("start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && message.hasOwnProperty("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); + }; + + 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 && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.number != null && message.hasOwnProperty("number")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.number); + if (message.options != null && message.hasOwnProperty("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); + }; + + 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 && message.hasOwnProperty("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 && message.hasOwnProperty("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); + }; + + 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 && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.inputType != null && message.hasOwnProperty("inputType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.inputType); + if (message.outputType != null && message.hasOwnProperty("outputType")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.outputType); + if (message.options != null && message.hasOwnProperty("options")) + $root.google.protobuf.MethodOptions.encode(message.options, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.clientStreaming); + if (message.serverStreaming != null && message.hasOwnProperty("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); + }; + + 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 + */ + + /** + * 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 = []; + 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 = false; + + /** + * 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; + + /** + * 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 && message.hasOwnProperty("javaPackage")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.javaPackage); + if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.javaOuterClassname); + if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.optimizeFor); + if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) + writer.uint32(/* id 10, wireType 0 =*/80).bool(message.javaMultipleFiles); + if (message.goPackage != null && message.hasOwnProperty("goPackage")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.goPackage); + if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) + writer.uint32(/* id 16, wireType 0 =*/128).bool(message.ccGenericServices); + if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) + writer.uint32(/* id 17, wireType 0 =*/136).bool(message.javaGenericServices); + if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) + writer.uint32(/* id 18, wireType 0 =*/144).bool(message.pyGenericServices); + if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) + writer.uint32(/* id 20, wireType 0 =*/160).bool(message.javaGenerateEqualsAndHash); + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + writer.uint32(/* id 23, wireType 0 =*/184).bool(message.deprecated); + if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) + writer.uint32(/* id 27, wireType 0 =*/216).bool(message.javaStringCheckUtf8); + if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) + writer.uint32(/* id 31, wireType 0 =*/248).bool(message.ccEnableArenas); + if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) + writer.uint32(/* id 36, wireType 2 =*/290).string(message.objcClassPrefix); + if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) + writer.uint32(/* id 37, wireType 2 =*/298).string(message.csharpNamespace); + if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) + writer.uint32(/* id 39, wireType 2 =*/314).string(message.swiftPrefix); + if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) + writer.uint32(/* id 40, wireType 2 =*/322).string(message.phpClassPrefix); + if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) + writer.uint32(/* id 41, wireType 2 =*/330).string(message.phpNamespace); + if (message.phpGenericServices != null && message.hasOwnProperty("phpGenericServices")) + writer.uint32(/* id 42, wireType 0 =*/336).bool(message.phpGenericServices); + if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) + writer.uint32(/* id 44, wireType 2 =*/354).string(message.phpMetadataNamespace); + if (message.rubyPackage != null && message.hasOwnProperty("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(); + 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; + 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; + } + } + 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) { + 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]); + } + } + 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 = []; + 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 = false; + 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] : 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); + } + 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); + }; + + /** + * OptimizeMode enum. + * @name google.protobuf.FileOptions.OptimizeMode + * @enum {string} + * @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 + */ + + /** + * 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; + + /** + * 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 && message.hasOwnProperty("messageSetWireFormat")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.messageSetWireFormat); + if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.noStandardDescriptorAccessor); + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.mapEntry != null && message.hasOwnProperty("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(); + 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; + 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; + } + } + 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]); + } + } + 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; + } + 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); + } + 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); + }; + + 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} [deprecated] FieldOptions deprecated + * @property {boolean|null} [weak] FieldOptions weak + * @property {Array.|null} [uninterpretedOption] FieldOptions uninterpretedOption + */ + + /** + * 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 = []; + 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 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; + + /** + * 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 && message.hasOwnProperty("ctype")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.ctype); + if (message.packed != null && message.hasOwnProperty("packed")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.packed); + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.lazy != null && message.hasOwnProperty("lazy")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.lazy); + if (message.jstype != null && message.hasOwnProperty("jstype")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jstype); + if (message.weak != null && message.hasOwnProperty("weak")) + writer.uint32(/* id 10, wireType 0 =*/80).bool(message.weak); + 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 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 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; + 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.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; + } + } + 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) { + 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) { + 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.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]); + } + } + 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 = []; + 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; + } + if (message.ctype != null && message.hasOwnProperty("ctype")) + object.ctype = options.enums === String ? $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] : message.jstype; + if (message.weak != null && message.hasOwnProperty("weak")) + object.weak = message.weak; + 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 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); + }; + + /** + * CType enum. + * @name google.protobuf.FieldOptions.CType + * @enum {string} + * @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 {string} + * @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); + }; + + 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 && message.hasOwnProperty("allowAlias")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.allowAlias); + if (message.deprecated != null && message.hasOwnProperty("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); + }; + + 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 && message.hasOwnProperty("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); + }; + + 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 && message.hasOwnProperty("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 && message.hasOwnProperty(".google.api.defaultHost")) + writer.uint32(/* id 1049, wireType 2 =*/8394).string(message[".google.api.defaultHost"]); + if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".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); + }; + + 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 + * @property {google.longrunning.IOperationInfo|null} [".google.longrunning.operationInfo"] MethodOptions .google.longrunning.operationInfo + */ + + /** + * 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; + + /** + * MethodOptions .google.longrunning.operationInfo. + * @member {google.longrunning.IOperationInfo|null|undefined} .google.longrunning.operationInfo + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype[".google.longrunning.operationInfo"] = null; + + /** + * 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 && message.hasOwnProperty("deprecated")) + writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); + if (message.idempotencyLevel != null && message.hasOwnProperty("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.longrunning.operationInfo"] != null && message.hasOwnProperty(".google.longrunning.operationInfo")) + $root.google.longrunning.OperationInfo.encode(message[".google.longrunning.operationInfo"], writer.uint32(/* id 1049, wireType 2 =*/8394).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 && message.hasOwnProperty(".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; + case 1049: + message[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.decode(reader, reader.uint32()); + 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"; + } + if (message[".google.longrunning.operationInfo"] != null && message.hasOwnProperty(".google.longrunning.operationInfo")) { + var error = $root.google.longrunning.OperationInfo.verify(message[".google.longrunning.operationInfo"]); + if (error) + return ".google.longrunning.operationInfo." + error; + } + 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) { + 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]); + } + if (object[".google.longrunning.operationInfo"] != null) { + if (typeof object[".google.longrunning.operationInfo"] !== "object") + throw TypeError(".google.protobuf.MethodOptions..google.longrunning.operationInfo: object expected"); + message[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.fromObject(object[".google.longrunning.operationInfo"]); + } + 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.longrunning.operationInfo"] = null; + 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] : 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.longrunning.operationInfo"] != null && message.hasOwnProperty(".google.longrunning.operationInfo")) + object[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.toObject(message[".google.longrunning.operationInfo"], 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); + }; + + /** + * IdempotencyLevel enum. + * @name google.protobuf.MethodOptions.IdempotencyLevel + * @enum {string} + * @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 && message.hasOwnProperty("identifierValue")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.identifierValue); + if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) + writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.positiveIntValue); + if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) + writer.uint32(/* id 5, wireType 0 =*/40).int64(message.negativeIntValue); + if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) + writer.uint32(/* id 6, wireType 1 =*/49).double(message.doubleValue); + if (message.stringValue != null && message.hasOwnProperty("stringValue")) + writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.stringValue); + if (message.aggregateValue != null && message.hasOwnProperty("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) + 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); + }; + + 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); + }; + + 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); + }; + + 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 && message.hasOwnProperty("leadingComments")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.leadingComments); + if (message.trailingComments != null && message.hasOwnProperty("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); + }; + + 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); + }; + + 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 + */ + + /** + * 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; + + /** + * 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 && message.hasOwnProperty("sourceFile")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.sourceFile); + if (message.begin != null && message.hasOwnProperty("begin")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.begin); + if (message.end != null && message.hasOwnProperty("end")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.end); + 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; + 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"; + 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; + 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; + } + 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; + 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); + }; + + return Annotation; + })(); + + return GeneratedCodeInfo; + })(); + + protobuf.Struct = (function() { + + /** + * Properties of a Struct. + * @memberof google.protobuf + * @interface IStruct + * @property {Object.|null} [fields] Struct fields + */ + + /** + * Constructs a new Struct. + * @memberof google.protobuf + * @classdesc Represents a Struct. + * @implements IStruct + * @constructor + * @param {google.protobuf.IStruct=} [properties] Properties to set + */ + function Struct(properties) { + this.fields = {}; + 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]]; + } + + /** + * Struct fields. + * @member {Object.} fields + * @memberof google.protobuf.Struct + * @instance + */ + Struct.prototype.fields = $util.emptyObject; + + /** + * Creates a new Struct instance using the specified properties. + * @function create + * @memberof google.protobuf.Struct + * @static + * @param {google.protobuf.IStruct=} [properties] Properties to set + * @returns {google.protobuf.Struct} Struct instance + */ + Struct.create = function create(properties) { + return new Struct(properties); + }; + + /** + * Encodes the specified Struct message. Does not implicitly {@link google.protobuf.Struct.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Struct + * @static + * @param {google.protobuf.IStruct} message Struct message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Struct.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.fields != null && message.hasOwnProperty("fields")) + for (var keys = Object.keys(message.fields), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.protobuf.Value.encode(message.fields[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + return writer; + }; + + /** + * Encodes the specified Struct message, length delimited. Does not implicitly {@link google.protobuf.Struct.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Struct + * @static + * @param {google.protobuf.IStruct} message Struct message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Struct.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Struct message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Struct + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Struct} Struct + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Struct.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.Struct(), key; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + reader.skip().pos++; + if (message.fields === $util.emptyObject) + message.fields = {}; + key = reader.string(); + reader.pos++; + message.fields[key] = $root.google.protobuf.Value.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Struct message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Struct + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Struct} Struct + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Struct.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Struct message. + * @function verify + * @memberof google.protobuf.Struct + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Struct.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.fields != null && message.hasOwnProperty("fields")) { + if (!$util.isObject(message.fields)) + return "fields: object expected"; + var key = Object.keys(message.fields); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.protobuf.Value.verify(message.fields[key[i]]); + if (error) + return "fields." + error; + } + } + return null; + }; + + /** + * Creates a Struct message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Struct + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Struct} Struct + */ + Struct.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Struct) + return object; + var message = new $root.google.protobuf.Struct(); + if (object.fields) { + if (typeof object.fields !== "object") + throw TypeError(".google.protobuf.Struct.fields: object expected"); + message.fields = {}; + for (var keys = Object.keys(object.fields), i = 0; i < keys.length; ++i) { + if (typeof object.fields[keys[i]] !== "object") + throw TypeError(".google.protobuf.Struct.fields: object expected"); + message.fields[keys[i]] = $root.google.protobuf.Value.fromObject(object.fields[keys[i]]); + } + } + return message; + }; + + /** + * Creates a plain object from a Struct message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Struct + * @static + * @param {google.protobuf.Struct} message Struct + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Struct.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.fields = {}; + var keys2; + if (message.fields && (keys2 = Object.keys(message.fields)).length) { + object.fields = {}; + for (var j = 0; j < keys2.length; ++j) + object.fields[keys2[j]] = $root.google.protobuf.Value.toObject(message.fields[keys2[j]], options); + } + return object; + }; + + /** + * Converts this Struct to JSON. + * @function toJSON + * @memberof google.protobuf.Struct + * @instance + * @returns {Object.} JSON object + */ + Struct.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Struct; + })(); + + protobuf.Value = (function() { + + /** + * Properties of a Value. + * @memberof google.protobuf + * @interface IValue + * @property {google.protobuf.NullValue|null} [nullValue] Value nullValue + * @property {number|null} [numberValue] Value numberValue + * @property {string|null} [stringValue] Value stringValue + * @property {boolean|null} [boolValue] Value boolValue + * @property {google.protobuf.IStruct|null} [structValue] Value structValue + * @property {google.protobuf.IListValue|null} [listValue] Value listValue + */ + + /** + * Constructs a new Value. + * @memberof google.protobuf + * @classdesc Represents a Value. + * @implements IValue + * @constructor + * @param {google.protobuf.IValue=} [properties] Properties to set + */ + function Value(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]]; + } + + /** + * Value nullValue. + * @member {google.protobuf.NullValue} nullValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.nullValue = 0; + + /** + * Value numberValue. + * @member {number} numberValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.numberValue = 0; + + /** + * Value stringValue. + * @member {string} stringValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.stringValue = ""; + + /** + * Value boolValue. + * @member {boolean} boolValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.boolValue = false; + + /** + * Value structValue. + * @member {google.protobuf.IStruct|null|undefined} structValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.structValue = null; + + /** + * Value listValue. + * @member {google.protobuf.IListValue|null|undefined} listValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.listValue = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Value kind. + * @member {"nullValue"|"numberValue"|"stringValue"|"boolValue"|"structValue"|"listValue"|undefined} kind + * @memberof google.protobuf.Value + * @instance + */ + Object.defineProperty(Value.prototype, "kind", { + get: $util.oneOfGetter($oneOfFields = ["nullValue", "numberValue", "stringValue", "boolValue", "structValue", "listValue"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Value + * @static + * @param {google.protobuf.IValue=} [properties] Properties to set + * @returns {google.protobuf.Value} Value instance + */ + Value.create = function create(properties) { + return new Value(properties); + }; + + /** + * Encodes the specified Value message. Does not implicitly {@link google.protobuf.Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Value + * @static + * @param {google.protobuf.IValue} message Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Value.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.nullValue != null && message.hasOwnProperty("nullValue")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.nullValue); + if (message.numberValue != null && message.hasOwnProperty("numberValue")) + writer.uint32(/* id 2, wireType 1 =*/17).double(message.numberValue); + if (message.stringValue != null && message.hasOwnProperty("stringValue")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.stringValue); + if (message.boolValue != null && message.hasOwnProperty("boolValue")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.boolValue); + if (message.structValue != null && message.hasOwnProperty("structValue")) + $root.google.protobuf.Struct.encode(message.structValue, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.listValue != null && message.hasOwnProperty("listValue")) + $root.google.protobuf.ListValue.encode(message.listValue, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Value message, length delimited. Does not implicitly {@link google.protobuf.Value.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Value + * @static + * @param {google.protobuf.IValue} message Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Value.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Value} Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Value.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.Value(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.nullValue = reader.int32(); + break; + case 2: + message.numberValue = reader.double(); + break; + case 3: + message.stringValue = reader.string(); + break; + case 4: + message.boolValue = reader.bool(); + break; + case 5: + message.structValue = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + case 6: + message.listValue = $root.google.protobuf.ListValue.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Value message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Value} Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Value.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Value message. + * @function verify + * @memberof google.protobuf.Value + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Value.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.nullValue != null && message.hasOwnProperty("nullValue")) { + properties.kind = 1; + switch (message.nullValue) { + default: + return "nullValue: enum value expected"; + case 0: + break; + } + } + if (message.numberValue != null && message.hasOwnProperty("numberValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + if (typeof message.numberValue !== "number") + return "numberValue: number expected"; + } + if (message.stringValue != null && message.hasOwnProperty("stringValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + if (!$util.isString(message.stringValue)) + return "stringValue: string expected"; + } + if (message.boolValue != null && message.hasOwnProperty("boolValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + if (typeof message.boolValue !== "boolean") + return "boolValue: boolean expected"; + } + if (message.structValue != null && message.hasOwnProperty("structValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + { + var error = $root.google.protobuf.Struct.verify(message.structValue); + if (error) + return "structValue." + error; + } + } + if (message.listValue != null && message.hasOwnProperty("listValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + { + var error = $root.google.protobuf.ListValue.verify(message.listValue); + if (error) + return "listValue." + error; + } + } + return null; + }; + + /** + * Creates a Value message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Value + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Value} Value + */ + Value.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Value) + return object; + var message = new $root.google.protobuf.Value(); + switch (object.nullValue) { + case "NULL_VALUE": + case 0: + message.nullValue = 0; + break; + } + if (object.numberValue != null) + message.numberValue = Number(object.numberValue); + if (object.stringValue != null) + message.stringValue = String(object.stringValue); + if (object.boolValue != null) + message.boolValue = Boolean(object.boolValue); + if (object.structValue != null) { + if (typeof object.structValue !== "object") + throw TypeError(".google.protobuf.Value.structValue: object expected"); + message.structValue = $root.google.protobuf.Struct.fromObject(object.structValue); + } + if (object.listValue != null) { + if (typeof object.listValue !== "object") + throw TypeError(".google.protobuf.Value.listValue: object expected"); + message.listValue = $root.google.protobuf.ListValue.fromObject(object.listValue); + } + return message; + }; + + /** + * Creates a plain object from a Value message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Value + * @static + * @param {google.protobuf.Value} message Value + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Value.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.nullValue != null && message.hasOwnProperty("nullValue")) { + object.nullValue = options.enums === String ? $root.google.protobuf.NullValue[message.nullValue] : message.nullValue; + if (options.oneofs) + object.kind = "nullValue"; + } + if (message.numberValue != null && message.hasOwnProperty("numberValue")) { + object.numberValue = options.json && !isFinite(message.numberValue) ? String(message.numberValue) : message.numberValue; + if (options.oneofs) + object.kind = "numberValue"; + } + if (message.stringValue != null && message.hasOwnProperty("stringValue")) { + object.stringValue = message.stringValue; + if (options.oneofs) + object.kind = "stringValue"; + } + if (message.boolValue != null && message.hasOwnProperty("boolValue")) { + object.boolValue = message.boolValue; + if (options.oneofs) + object.kind = "boolValue"; + } + if (message.structValue != null && message.hasOwnProperty("structValue")) { + object.structValue = $root.google.protobuf.Struct.toObject(message.structValue, options); + if (options.oneofs) + object.kind = "structValue"; + } + if (message.listValue != null && message.hasOwnProperty("listValue")) { + object.listValue = $root.google.protobuf.ListValue.toObject(message.listValue, options); + if (options.oneofs) + object.kind = "listValue"; + } + return object; + }; + + /** + * Converts this Value to JSON. + * @function toJSON + * @memberof google.protobuf.Value + * @instance + * @returns {Object.} JSON object + */ + Value.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Value; + })(); + + /** + * NullValue enum. + * @name google.protobuf.NullValue + * @enum {string} + * @property {number} NULL_VALUE=0 NULL_VALUE value + */ + protobuf.NullValue = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NULL_VALUE"] = 0; + return values; + })(); + + protobuf.ListValue = (function() { + + /** + * Properties of a ListValue. + * @memberof google.protobuf + * @interface IListValue + * @property {Array.|null} [values] ListValue values + */ + + /** + * Constructs a new ListValue. + * @memberof google.protobuf + * @classdesc Represents a ListValue. + * @implements IListValue + * @constructor + * @param {google.protobuf.IListValue=} [properties] Properties to set + */ + function ListValue(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]]; + } + + /** + * ListValue values. + * @member {Array.} values + * @memberof google.protobuf.ListValue + * @instance + */ + ListValue.prototype.values = $util.emptyArray; + + /** + * Creates a new ListValue instance using the specified properties. + * @function create + * @memberof google.protobuf.ListValue + * @static + * @param {google.protobuf.IListValue=} [properties] Properties to set + * @returns {google.protobuf.ListValue} ListValue instance + */ + ListValue.create = function create(properties) { + return new ListValue(properties); + }; + + /** + * Encodes the specified ListValue message. Does not implicitly {@link google.protobuf.ListValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ListValue + * @static + * @param {google.protobuf.IListValue} message ListValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListValue.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) + $root.google.protobuf.Value.encode(message.values[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ListValue message, length delimited. Does not implicitly {@link google.protobuf.ListValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ListValue + * @static + * @param {google.protobuf.IListValue} message ListValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ListValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ListValue} ListValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListValue.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.ListValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.values && message.values.length)) + message.values = []; + message.values.push($root.google.protobuf.Value.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ListValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ListValue} ListValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListValue message. + * @function verify + * @memberof google.protobuf.ListValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListValue.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) { + var error = $root.google.protobuf.Value.verify(message.values[i]); + if (error) + return "values." + error; + } + } + return null; + }; + + /** + * Creates a ListValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ListValue + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ListValue} ListValue + */ + ListValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ListValue) + return object; + var message = new $root.google.protobuf.ListValue(); + if (object.values) { + if (!Array.isArray(object.values)) + throw TypeError(".google.protobuf.ListValue.values: array expected"); + message.values = []; + for (var i = 0; i < object.values.length; ++i) { + if (typeof object.values[i] !== "object") + throw TypeError(".google.protobuf.ListValue.values: object expected"); + message.values[i] = $root.google.protobuf.Value.fromObject(object.values[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a ListValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ListValue + * @static + * @param {google.protobuf.ListValue} message ListValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.values = []; + if (message.values && message.values.length) { + object.values = []; + for (var j = 0; j < message.values.length; ++j) + object.values[j] = $root.google.protobuf.Value.toObject(message.values[j], options); + } + return object; + }; + + /** + * Converts this ListValue to JSON. + * @function toJSON + * @memberof google.protobuf.ListValue + * @instance + * @returns {Object.} JSON object + */ + ListValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListValue; + })(); + + protobuf.Timestamp = (function() { + + /** + * Properties of a Timestamp. + * @memberof google.protobuf + * @interface ITimestamp + * @property {number|Long|null} [seconds] Timestamp seconds + * @property {number|null} [nanos] Timestamp nanos + */ + + /** + * Constructs a new Timestamp. + * @memberof google.protobuf + * @classdesc Represents a Timestamp. + * @implements ITimestamp + * @constructor + * @param {google.protobuf.ITimestamp=} [properties] Properties to set + */ + function Timestamp(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]]; + } + + /** + * Timestamp seconds. + * @member {number|Long} seconds + * @memberof google.protobuf.Timestamp + * @instance + */ + Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Timestamp nanos. + * @member {number} nanos + * @memberof google.protobuf.Timestamp + * @instance + */ + Timestamp.prototype.nanos = 0; + + /** + * Creates a new Timestamp instance using the specified properties. + * @function create + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp=} [properties] Properties to set + * @returns {google.protobuf.Timestamp} Timestamp instance + */ + Timestamp.create = function create(properties) { + return new Timestamp(properties); + }; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.seconds != null && message.hasOwnProperty("seconds")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); + if (message.nanos != null && message.hasOwnProperty("nanos")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); + return writer; + }; + + /** + * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.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.Timestamp(); + 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 Timestamp message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Timestamp message. + * @function verify + * @memberof google.protobuf.Timestamp + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Timestamp.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 Timestamp message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Timestamp + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Timestamp} Timestamp + */ + Timestamp.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Timestamp) + return object; + var message = new $root.google.protobuf.Timestamp(); + 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 Timestamp message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.Timestamp} message Timestamp + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Timestamp.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 Timestamp to JSON. + * @function toJSON + * @memberof google.protobuf.Timestamp + * @instance + * @returns {Object.} JSON object + */ + Timestamp.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Timestamp; + })(); + + 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 && message.hasOwnProperty("seconds")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); + if (message.nanos != null && message.hasOwnProperty("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); + }; + + return Duration; + })(); + + protobuf.Any = (function() { + + /** + * Properties of an Any. + * @memberof google.protobuf + * @interface IAny + * @property {string|null} [type_url] Any type_url + * @property {Uint8Array|null} [value] Any value + */ + + /** + * Constructs a new Any. + * @memberof google.protobuf + * @classdesc Represents an Any. + * @implements IAny + * @constructor + * @param {google.protobuf.IAny=} [properties] Properties to set + */ + function Any(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]]; + } + + /** + * Any type_url. + * @member {string} type_url + * @memberof google.protobuf.Any + * @instance + */ + Any.prototype.type_url = ""; + + /** + * Any value. + * @member {Uint8Array} value + * @memberof google.protobuf.Any + * @instance + */ + Any.prototype.value = $util.newBuffer([]); + + /** + * Creates a new Any instance using the specified properties. + * @function create + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny=} [properties] Properties to set + * @returns {google.protobuf.Any} Any instance + */ + Any.create = function create(properties) { + return new Any(properties); + }; + + /** + * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny} message Any message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Any.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type_url != null && message.hasOwnProperty("type_url")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type_url); + if (message.value != null && message.hasOwnProperty("value")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.value); + return writer; + }; + + /** + * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny} message Any message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Any.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Any message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Any + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Any} Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Any.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.Any(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.type_url = reader.string(); + break; + case 2: + message.value = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Any message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Any + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Any} Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Any.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Any message. + * @function verify + * @memberof google.protobuf.Any + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Any.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type_url != null && message.hasOwnProperty("type_url")) + if (!$util.isString(message.type_url)) + return "type_url: string expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value))) + return "value: buffer expected"; + return null; + }; + + /** + * Creates an Any message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Any + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Any} Any + */ + Any.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Any) + return object; + var message = new $root.google.protobuf.Any(); + if (object.type_url != null) + message.type_url = String(object.type_url); + if (object.value != null) + if (typeof object.value === "string") + $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); + else if (object.value.length) + message.value = object.value; + return message; + }; + + /** + * Creates a plain object from an Any message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.Any} message Any + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Any.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type_url = ""; + if (options.bytes === String) + object.value = ""; + else { + object.value = []; + if (options.bytes !== Array) + object.value = $util.newBuffer(object.value); + } + } + if (message.type_url != null && message.hasOwnProperty("type_url")) + object.type_url = message.type_url; + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value; + return object; + }; + + /** + * Converts this Any to JSON. + * @function toJSON + * @memberof google.protobuf.Any + * @instance + * @returns {Object.} JSON object + */ + Any.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Any; + })(); + + protobuf.Empty = (function() { + + /** + * Properties of an Empty. + * @memberof google.protobuf + * @interface IEmpty + */ + + /** + * Constructs a new Empty. + * @memberof google.protobuf + * @classdesc Represents an Empty. + * @implements IEmpty + * @constructor + * @param {google.protobuf.IEmpty=} [properties] Properties to set + */ + function Empty(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]]; + } + + /** + * Creates a new Empty instance using the specified properties. + * @function create + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.IEmpty=} [properties] Properties to set + * @returns {google.protobuf.Empty} Empty instance + */ + Empty.create = function create(properties) { + return new Empty(properties); + }; + + /** + * Encodes the specified Empty message. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.IEmpty} message Empty message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Empty.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified Empty message, length delimited. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.IEmpty} message Empty message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Empty.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Empty message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Empty + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Empty} Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Empty.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.Empty(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Empty message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Empty + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Empty} Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Empty.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Empty message. + * @function verify + * @memberof google.protobuf.Empty + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Empty.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates an Empty message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Empty + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Empty} Empty + */ + Empty.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Empty) + return object; + return new $root.google.protobuf.Empty(); + }; + + /** + * Creates a plain object from an Empty message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.Empty} message Empty + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Empty.toObject = function toObject() { + return {}; + }; + + /** + * Converts this Empty to JSON. + * @function toJSON + * @memberof google.protobuf.Empty + * @instance + * @returns {Object.} JSON object + */ + Empty.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Empty; + })(); + + protobuf.FieldMask = (function() { + + /** + * Properties of a FieldMask. + * @memberof google.protobuf + * @interface IFieldMask + * @property {Array.|null} [paths] FieldMask paths + */ + + /** + * Constructs a new FieldMask. + * @memberof google.protobuf + * @classdesc Represents a FieldMask. + * @implements IFieldMask + * @constructor + * @param {google.protobuf.IFieldMask=} [properties] Properties to set + */ + function FieldMask(properties) { + this.paths = []; + 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]]; + } + + /** + * FieldMask paths. + * @member {Array.} paths + * @memberof google.protobuf.FieldMask + * @instance + */ + FieldMask.prototype.paths = $util.emptyArray; + + /** + * Creates a new FieldMask instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.IFieldMask=} [properties] Properties to set + * @returns {google.protobuf.FieldMask} FieldMask instance + */ + FieldMask.create = function create(properties) { + return new FieldMask(properties); + }; + + /** + * Encodes the specified FieldMask message. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.IFieldMask} message FieldMask message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldMask.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.paths != null && message.paths.length) + for (var i = 0; i < message.paths.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.paths[i]); + return writer; + }; + + /** + * Encodes the specified FieldMask message, length delimited. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.IFieldMask} message FieldMask message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldMask.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldMask message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldMask + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldMask} FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldMask.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.FieldMask(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.paths && message.paths.length)) + message.paths = []; + message.paths.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldMask message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldMask + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldMask} FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldMask.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldMask message. + * @function verify + * @memberof google.protobuf.FieldMask + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldMask.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.paths != null && message.hasOwnProperty("paths")) { + if (!Array.isArray(message.paths)) + return "paths: array expected"; + for (var i = 0; i < message.paths.length; ++i) + if (!$util.isString(message.paths[i])) + return "paths: string[] expected"; + } + return null; + }; + + /** + * Creates a FieldMask message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldMask + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldMask} FieldMask + */ + FieldMask.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldMask) + return object; + var message = new $root.google.protobuf.FieldMask(); + if (object.paths) { + if (!Array.isArray(object.paths)) + throw TypeError(".google.protobuf.FieldMask.paths: array expected"); + message.paths = []; + for (var i = 0; i < object.paths.length; ++i) + message.paths[i] = String(object.paths[i]); + } + return message; + }; + + /** + * Creates a plain object from a FieldMask message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.FieldMask} message FieldMask + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldMask.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.paths = []; + if (message.paths && message.paths.length) { + object.paths = []; + for (var j = 0; j < message.paths.length; ++j) + object.paths[j] = message.paths[j]; + } + return object; + }; + + /** + * Converts this FieldMask to JSON. + * @function toJSON + * @memberof google.protobuf.FieldMask + * @instance + * @returns {Object.} JSON object + */ + FieldMask.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return FieldMask; + })(); + + return protobuf; + })(); + + google.iam = (function() { + + /** + * Namespace iam. + * @memberof google + * @namespace + */ + var iam = {}; + + iam.v1 = (function() { + + /** + * Namespace v1. + * @memberof google.iam + * @namespace + */ + var v1 = {}; + + v1.IAMPolicy = (function() { + + /** + * Constructs a new IAMPolicy service. + * @memberof google.iam.v1 + * @classdesc Represents a IAMPolicy + * @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 IAMPolicy(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (IAMPolicy.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = IAMPolicy; + + /** + * Creates new IAMPolicy service using the specified rpc implementation. + * @function create + * @memberof google.iam.v1.IAMPolicy + * @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 {IAMPolicy} RPC service. Useful where requests and/or responses are streamed. + */ + IAMPolicy.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.iam.v1.IAMPolicy#setIamPolicy}. + * @memberof google.iam.v1.IAMPolicy + * @typedef SetIamPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.iam.v1.Policy} [response] Policy + */ + + /** + * Calls SetIamPolicy. + * @function setIamPolicy + * @memberof google.iam.v1.IAMPolicy + * @instance + * @param {google.iam.v1.ISetIamPolicyRequest} request SetIamPolicyRequest message or plain object + * @param {google.iam.v1.IAMPolicy.SetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(IAMPolicy.prototype.setIamPolicy = function setIamPolicy(request, callback) { + return this.rpcCall(setIamPolicy, $root.google.iam.v1.SetIamPolicyRequest, $root.google.iam.v1.Policy, request, callback); + }, "name", { value: "SetIamPolicy" }); + + /** + * Calls SetIamPolicy. + * @function setIamPolicy + * @memberof google.iam.v1.IAMPolicy + * @instance + * @param {google.iam.v1.ISetIamPolicyRequest} request SetIamPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.iam.v1.IAMPolicy#getIamPolicy}. + * @memberof google.iam.v1.IAMPolicy + * @typedef GetIamPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.iam.v1.Policy} [response] Policy + */ + + /** + * Calls GetIamPolicy. + * @function getIamPolicy + * @memberof google.iam.v1.IAMPolicy + * @instance + * @param {google.iam.v1.IGetIamPolicyRequest} request GetIamPolicyRequest message or plain object + * @param {google.iam.v1.IAMPolicy.GetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(IAMPolicy.prototype.getIamPolicy = function getIamPolicy(request, callback) { + return this.rpcCall(getIamPolicy, $root.google.iam.v1.GetIamPolicyRequest, $root.google.iam.v1.Policy, request, callback); + }, "name", { value: "GetIamPolicy" }); + + /** + * Calls GetIamPolicy. + * @function getIamPolicy + * @memberof google.iam.v1.IAMPolicy + * @instance + * @param {google.iam.v1.IGetIamPolicyRequest} request GetIamPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.iam.v1.IAMPolicy#testIamPermissions}. + * @memberof google.iam.v1.IAMPolicy + * @typedef TestIamPermissionsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.iam.v1.TestIamPermissionsResponse} [response] TestIamPermissionsResponse + */ + + /** + * Calls TestIamPermissions. + * @function testIamPermissions + * @memberof google.iam.v1.IAMPolicy + * @instance + * @param {google.iam.v1.ITestIamPermissionsRequest} request TestIamPermissionsRequest message or plain object + * @param {google.iam.v1.IAMPolicy.TestIamPermissionsCallback} callback Node-style callback called with the error, if any, and TestIamPermissionsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(IAMPolicy.prototype.testIamPermissions = function testIamPermissions(request, callback) { + return this.rpcCall(testIamPermissions, $root.google.iam.v1.TestIamPermissionsRequest, $root.google.iam.v1.TestIamPermissionsResponse, request, callback); + }, "name", { value: "TestIamPermissions" }); + + /** + * Calls TestIamPermissions. + * @function testIamPermissions + * @memberof google.iam.v1.IAMPolicy + * @instance + * @param {google.iam.v1.ITestIamPermissionsRequest} request TestIamPermissionsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return IAMPolicy; + })(); + + v1.SetIamPolicyRequest = (function() { + + /** + * Properties of a SetIamPolicyRequest. + * @memberof google.iam.v1 + * @interface ISetIamPolicyRequest + * @property {string|null} [resource] SetIamPolicyRequest resource + * @property {google.iam.v1.IPolicy|null} [policy] SetIamPolicyRequest policy + */ + + /** + * Constructs a new SetIamPolicyRequest. + * @memberof google.iam.v1 + * @classdesc Represents a SetIamPolicyRequest. + * @implements ISetIamPolicyRequest + * @constructor + * @param {google.iam.v1.ISetIamPolicyRequest=} [properties] Properties to set + */ + function SetIamPolicyRequest(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]]; + } + + /** + * SetIamPolicyRequest resource. + * @member {string} resource + * @memberof google.iam.v1.SetIamPolicyRequest + * @instance + */ + SetIamPolicyRequest.prototype.resource = ""; + + /** + * SetIamPolicyRequest policy. + * @member {google.iam.v1.IPolicy|null|undefined} policy + * @memberof google.iam.v1.SetIamPolicyRequest + * @instance + */ + SetIamPolicyRequest.prototype.policy = null; + + /** + * Creates a new SetIamPolicyRequest instance using the specified properties. + * @function create + * @memberof google.iam.v1.SetIamPolicyRequest + * @static + * @param {google.iam.v1.ISetIamPolicyRequest=} [properties] Properties to set + * @returns {google.iam.v1.SetIamPolicyRequest} SetIamPolicyRequest instance + */ + SetIamPolicyRequest.create = function create(properties) { + return new SetIamPolicyRequest(properties); + }; + + /** + * Encodes the specified SetIamPolicyRequest message. Does not implicitly {@link google.iam.v1.SetIamPolicyRequest.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.SetIamPolicyRequest + * @static + * @param {google.iam.v1.ISetIamPolicyRequest} message SetIamPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetIamPolicyRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.resource != null && message.hasOwnProperty("resource")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.resource); + if (message.policy != null && message.hasOwnProperty("policy")) + $root.google.iam.v1.Policy.encode(message.policy, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SetIamPolicyRequest message, length delimited. Does not implicitly {@link google.iam.v1.SetIamPolicyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.SetIamPolicyRequest + * @static + * @param {google.iam.v1.ISetIamPolicyRequest} message SetIamPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetIamPolicyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SetIamPolicyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.SetIamPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.SetIamPolicyRequest} SetIamPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetIamPolicyRequest.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.iam.v1.SetIamPolicyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.resource = reader.string(); + break; + case 2: + message.policy = $root.google.iam.v1.Policy.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SetIamPolicyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.SetIamPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.SetIamPolicyRequest} SetIamPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetIamPolicyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SetIamPolicyRequest message. + * @function verify + * @memberof google.iam.v1.SetIamPolicyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SetIamPolicyRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.resource != null && message.hasOwnProperty("resource")) + if (!$util.isString(message.resource)) + return "resource: string expected"; + if (message.policy != null && message.hasOwnProperty("policy")) { + var error = $root.google.iam.v1.Policy.verify(message.policy); + if (error) + return "policy." + error; + } + return null; + }; + + /** + * Creates a SetIamPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.SetIamPolicyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.SetIamPolicyRequest} SetIamPolicyRequest + */ + SetIamPolicyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.SetIamPolicyRequest) + return object; + var message = new $root.google.iam.v1.SetIamPolicyRequest(); + if (object.resource != null) + message.resource = String(object.resource); + if (object.policy != null) { + if (typeof object.policy !== "object") + throw TypeError(".google.iam.v1.SetIamPolicyRequest.policy: object expected"); + message.policy = $root.google.iam.v1.Policy.fromObject(object.policy); + } + return message; + }; + + /** + * Creates a plain object from a SetIamPolicyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.SetIamPolicyRequest + * @static + * @param {google.iam.v1.SetIamPolicyRequest} message SetIamPolicyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SetIamPolicyRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.resource = ""; + object.policy = null; + } + if (message.resource != null && message.hasOwnProperty("resource")) + object.resource = message.resource; + if (message.policy != null && message.hasOwnProperty("policy")) + object.policy = $root.google.iam.v1.Policy.toObject(message.policy, options); + return object; + }; + + /** + * Converts this SetIamPolicyRequest to JSON. + * @function toJSON + * @memberof google.iam.v1.SetIamPolicyRequest + * @instance + * @returns {Object.} JSON object + */ + SetIamPolicyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SetIamPolicyRequest; + })(); + + v1.GetIamPolicyRequest = (function() { + + /** + * Properties of a GetIamPolicyRequest. + * @memberof google.iam.v1 + * @interface IGetIamPolicyRequest + * @property {string|null} [resource] GetIamPolicyRequest resource + * @property {google.iam.v1.IGetPolicyOptions|null} [options] GetIamPolicyRequest options + */ + + /** + * Constructs a new GetIamPolicyRequest. + * @memberof google.iam.v1 + * @classdesc Represents a GetIamPolicyRequest. + * @implements IGetIamPolicyRequest + * @constructor + * @param {google.iam.v1.IGetIamPolicyRequest=} [properties] Properties to set + */ + function GetIamPolicyRequest(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]]; + } + + /** + * GetIamPolicyRequest resource. + * @member {string} resource + * @memberof google.iam.v1.GetIamPolicyRequest + * @instance + */ + GetIamPolicyRequest.prototype.resource = ""; + + /** + * GetIamPolicyRequest options. + * @member {google.iam.v1.IGetPolicyOptions|null|undefined} options + * @memberof google.iam.v1.GetIamPolicyRequest + * @instance + */ + GetIamPolicyRequest.prototype.options = null; + + /** + * Creates a new GetIamPolicyRequest instance using the specified properties. + * @function create + * @memberof google.iam.v1.GetIamPolicyRequest + * @static + * @param {google.iam.v1.IGetIamPolicyRequest=} [properties] Properties to set + * @returns {google.iam.v1.GetIamPolicyRequest} GetIamPolicyRequest instance + */ + GetIamPolicyRequest.create = function create(properties) { + return new GetIamPolicyRequest(properties); + }; + + /** + * Encodes the specified GetIamPolicyRequest message. Does not implicitly {@link google.iam.v1.GetIamPolicyRequest.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.GetIamPolicyRequest + * @static + * @param {google.iam.v1.IGetIamPolicyRequest} message GetIamPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIamPolicyRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.resource != null && message.hasOwnProperty("resource")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.resource); + if (message.options != null && message.hasOwnProperty("options")) + $root.google.iam.v1.GetPolicyOptions.encode(message.options, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetIamPolicyRequest message, length delimited. Does not implicitly {@link google.iam.v1.GetIamPolicyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.GetIamPolicyRequest + * @static + * @param {google.iam.v1.IGetIamPolicyRequest} message GetIamPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIamPolicyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIamPolicyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.GetIamPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.GetIamPolicyRequest} GetIamPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIamPolicyRequest.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.iam.v1.GetIamPolicyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.resource = reader.string(); + break; + case 2: + message.options = $root.google.iam.v1.GetPolicyOptions.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIamPolicyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.GetIamPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.GetIamPolicyRequest} GetIamPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIamPolicyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIamPolicyRequest message. + * @function verify + * @memberof google.iam.v1.GetIamPolicyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIamPolicyRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.resource != null && message.hasOwnProperty("resource")) + if (!$util.isString(message.resource)) + return "resource: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.iam.v1.GetPolicyOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates a GetIamPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.GetIamPolicyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.GetIamPolicyRequest} GetIamPolicyRequest + */ + GetIamPolicyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.GetIamPolicyRequest) + return object; + var message = new $root.google.iam.v1.GetIamPolicyRequest(); + if (object.resource != null) + message.resource = String(object.resource); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.iam.v1.GetIamPolicyRequest.options: object expected"); + message.options = $root.google.iam.v1.GetPolicyOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from a GetIamPolicyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.GetIamPolicyRequest + * @static + * @param {google.iam.v1.GetIamPolicyRequest} message GetIamPolicyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIamPolicyRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.resource = ""; + object.options = null; + } + if (message.resource != null && message.hasOwnProperty("resource")) + object.resource = message.resource; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.iam.v1.GetPolicyOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this GetIamPolicyRequest to JSON. + * @function toJSON + * @memberof google.iam.v1.GetIamPolicyRequest + * @instance + * @returns {Object.} JSON object + */ + GetIamPolicyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetIamPolicyRequest; + })(); + + v1.TestIamPermissionsRequest = (function() { + + /** + * Properties of a TestIamPermissionsRequest. + * @memberof google.iam.v1 + * @interface ITestIamPermissionsRequest + * @property {string|null} [resource] TestIamPermissionsRequest resource + * @property {Array.|null} [permissions] TestIamPermissionsRequest permissions + */ + + /** + * Constructs a new TestIamPermissionsRequest. + * @memberof google.iam.v1 + * @classdesc Represents a TestIamPermissionsRequest. + * @implements ITestIamPermissionsRequest + * @constructor + * @param {google.iam.v1.ITestIamPermissionsRequest=} [properties] Properties to set + */ + function TestIamPermissionsRequest(properties) { + this.permissions = []; + 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]]; + } + + /** + * TestIamPermissionsRequest resource. + * @member {string} resource + * @memberof google.iam.v1.TestIamPermissionsRequest + * @instance + */ + TestIamPermissionsRequest.prototype.resource = ""; + + /** + * TestIamPermissionsRequest permissions. + * @member {Array.} permissions + * @memberof google.iam.v1.TestIamPermissionsRequest + * @instance + */ + TestIamPermissionsRequest.prototype.permissions = $util.emptyArray; + + /** + * Creates a new TestIamPermissionsRequest instance using the specified properties. + * @function create + * @memberof google.iam.v1.TestIamPermissionsRequest + * @static + * @param {google.iam.v1.ITestIamPermissionsRequest=} [properties] Properties to set + * @returns {google.iam.v1.TestIamPermissionsRequest} TestIamPermissionsRequest instance + */ + TestIamPermissionsRequest.create = function create(properties) { + return new TestIamPermissionsRequest(properties); + }; + + /** + * Encodes the specified TestIamPermissionsRequest message. Does not implicitly {@link google.iam.v1.TestIamPermissionsRequest.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.TestIamPermissionsRequest + * @static + * @param {google.iam.v1.ITestIamPermissionsRequest} message TestIamPermissionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TestIamPermissionsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.resource != null && message.hasOwnProperty("resource")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.resource); + if (message.permissions != null && message.permissions.length) + for (var i = 0; i < message.permissions.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.permissions[i]); + return writer; + }; + + /** + * Encodes the specified TestIamPermissionsRequest message, length delimited. Does not implicitly {@link google.iam.v1.TestIamPermissionsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.TestIamPermissionsRequest + * @static + * @param {google.iam.v1.ITestIamPermissionsRequest} message TestIamPermissionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TestIamPermissionsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TestIamPermissionsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.TestIamPermissionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.TestIamPermissionsRequest} TestIamPermissionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TestIamPermissionsRequest.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.iam.v1.TestIamPermissionsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.resource = reader.string(); + break; + case 2: + if (!(message.permissions && message.permissions.length)) + message.permissions = []; + message.permissions.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TestIamPermissionsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.TestIamPermissionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.TestIamPermissionsRequest} TestIamPermissionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TestIamPermissionsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TestIamPermissionsRequest message. + * @function verify + * @memberof google.iam.v1.TestIamPermissionsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TestIamPermissionsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.resource != null && message.hasOwnProperty("resource")) + if (!$util.isString(message.resource)) + return "resource: string expected"; + if (message.permissions != null && message.hasOwnProperty("permissions")) { + if (!Array.isArray(message.permissions)) + return "permissions: array expected"; + for (var i = 0; i < message.permissions.length; ++i) + if (!$util.isString(message.permissions[i])) + return "permissions: string[] expected"; + } + return null; + }; + + /** + * Creates a TestIamPermissionsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.TestIamPermissionsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.TestIamPermissionsRequest} TestIamPermissionsRequest + */ + TestIamPermissionsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.TestIamPermissionsRequest) + return object; + var message = new $root.google.iam.v1.TestIamPermissionsRequest(); + if (object.resource != null) + message.resource = String(object.resource); + if (object.permissions) { + if (!Array.isArray(object.permissions)) + throw TypeError(".google.iam.v1.TestIamPermissionsRequest.permissions: array expected"); + message.permissions = []; + for (var i = 0; i < object.permissions.length; ++i) + message.permissions[i] = String(object.permissions[i]); + } + return message; + }; + + /** + * Creates a plain object from a TestIamPermissionsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.TestIamPermissionsRequest + * @static + * @param {google.iam.v1.TestIamPermissionsRequest} message TestIamPermissionsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TestIamPermissionsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.permissions = []; + if (options.defaults) + object.resource = ""; + if (message.resource != null && message.hasOwnProperty("resource")) + object.resource = message.resource; + if (message.permissions && message.permissions.length) { + object.permissions = []; + for (var j = 0; j < message.permissions.length; ++j) + object.permissions[j] = message.permissions[j]; + } + return object; + }; + + /** + * Converts this TestIamPermissionsRequest to JSON. + * @function toJSON + * @memberof google.iam.v1.TestIamPermissionsRequest + * @instance + * @returns {Object.} JSON object + */ + TestIamPermissionsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TestIamPermissionsRequest; + })(); + + v1.TestIamPermissionsResponse = (function() { + + /** + * Properties of a TestIamPermissionsResponse. + * @memberof google.iam.v1 + * @interface ITestIamPermissionsResponse + * @property {Array.|null} [permissions] TestIamPermissionsResponse permissions + */ + + /** + * Constructs a new TestIamPermissionsResponse. + * @memberof google.iam.v1 + * @classdesc Represents a TestIamPermissionsResponse. + * @implements ITestIamPermissionsResponse + * @constructor + * @param {google.iam.v1.ITestIamPermissionsResponse=} [properties] Properties to set + */ + function TestIamPermissionsResponse(properties) { + this.permissions = []; + 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]]; + } + + /** + * TestIamPermissionsResponse permissions. + * @member {Array.} permissions + * @memberof google.iam.v1.TestIamPermissionsResponse + * @instance + */ + TestIamPermissionsResponse.prototype.permissions = $util.emptyArray; + + /** + * Creates a new TestIamPermissionsResponse instance using the specified properties. + * @function create + * @memberof google.iam.v1.TestIamPermissionsResponse + * @static + * @param {google.iam.v1.ITestIamPermissionsResponse=} [properties] Properties to set + * @returns {google.iam.v1.TestIamPermissionsResponse} TestIamPermissionsResponse instance + */ + TestIamPermissionsResponse.create = function create(properties) { + return new TestIamPermissionsResponse(properties); + }; + + /** + * Encodes the specified TestIamPermissionsResponse message. Does not implicitly {@link google.iam.v1.TestIamPermissionsResponse.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.TestIamPermissionsResponse + * @static + * @param {google.iam.v1.ITestIamPermissionsResponse} message TestIamPermissionsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TestIamPermissionsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.permissions != null && message.permissions.length) + for (var i = 0; i < message.permissions.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.permissions[i]); + return writer; + }; + + /** + * Encodes the specified TestIamPermissionsResponse message, length delimited. Does not implicitly {@link google.iam.v1.TestIamPermissionsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.TestIamPermissionsResponse + * @static + * @param {google.iam.v1.ITestIamPermissionsResponse} message TestIamPermissionsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TestIamPermissionsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TestIamPermissionsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.TestIamPermissionsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.TestIamPermissionsResponse} TestIamPermissionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TestIamPermissionsResponse.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.iam.v1.TestIamPermissionsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.permissions && message.permissions.length)) + message.permissions = []; + message.permissions.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TestIamPermissionsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.TestIamPermissionsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.TestIamPermissionsResponse} TestIamPermissionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TestIamPermissionsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TestIamPermissionsResponse message. + * @function verify + * @memberof google.iam.v1.TestIamPermissionsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TestIamPermissionsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.permissions != null && message.hasOwnProperty("permissions")) { + if (!Array.isArray(message.permissions)) + return "permissions: array expected"; + for (var i = 0; i < message.permissions.length; ++i) + if (!$util.isString(message.permissions[i])) + return "permissions: string[] expected"; + } + return null; + }; + + /** + * Creates a TestIamPermissionsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.TestIamPermissionsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.TestIamPermissionsResponse} TestIamPermissionsResponse + */ + TestIamPermissionsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.TestIamPermissionsResponse) + return object; + var message = new $root.google.iam.v1.TestIamPermissionsResponse(); + if (object.permissions) { + if (!Array.isArray(object.permissions)) + throw TypeError(".google.iam.v1.TestIamPermissionsResponse.permissions: array expected"); + message.permissions = []; + for (var i = 0; i < object.permissions.length; ++i) + message.permissions[i] = String(object.permissions[i]); + } + return message; + }; + + /** + * Creates a plain object from a TestIamPermissionsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.TestIamPermissionsResponse + * @static + * @param {google.iam.v1.TestIamPermissionsResponse} message TestIamPermissionsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TestIamPermissionsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.permissions = []; + if (message.permissions && message.permissions.length) { + object.permissions = []; + for (var j = 0; j < message.permissions.length; ++j) + object.permissions[j] = message.permissions[j]; + } + return object; + }; + + /** + * Converts this TestIamPermissionsResponse to JSON. + * @function toJSON + * @memberof google.iam.v1.TestIamPermissionsResponse + * @instance + * @returns {Object.} JSON object + */ + TestIamPermissionsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TestIamPermissionsResponse; + })(); + + v1.GetPolicyOptions = (function() { + + /** + * Properties of a GetPolicyOptions. + * @memberof google.iam.v1 + * @interface IGetPolicyOptions + * @property {number|null} [requestedPolicyVersion] GetPolicyOptions requestedPolicyVersion + */ + + /** + * Constructs a new GetPolicyOptions. + * @memberof google.iam.v1 + * @classdesc Represents a GetPolicyOptions. + * @implements IGetPolicyOptions + * @constructor + * @param {google.iam.v1.IGetPolicyOptions=} [properties] Properties to set + */ + function GetPolicyOptions(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]]; + } + + /** + * GetPolicyOptions requestedPolicyVersion. + * @member {number} requestedPolicyVersion + * @memberof google.iam.v1.GetPolicyOptions + * @instance + */ + GetPolicyOptions.prototype.requestedPolicyVersion = 0; + + /** + * Creates a new GetPolicyOptions instance using the specified properties. + * @function create + * @memberof google.iam.v1.GetPolicyOptions + * @static + * @param {google.iam.v1.IGetPolicyOptions=} [properties] Properties to set + * @returns {google.iam.v1.GetPolicyOptions} GetPolicyOptions instance + */ + GetPolicyOptions.create = function create(properties) { + return new GetPolicyOptions(properties); + }; + + /** + * Encodes the specified GetPolicyOptions message. Does not implicitly {@link google.iam.v1.GetPolicyOptions.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.GetPolicyOptions + * @static + * @param {google.iam.v1.IGetPolicyOptions} message GetPolicyOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetPolicyOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestedPolicyVersion != null && message.hasOwnProperty("requestedPolicyVersion")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.requestedPolicyVersion); + return writer; + }; + + /** + * Encodes the specified GetPolicyOptions message, length delimited. Does not implicitly {@link google.iam.v1.GetPolicyOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.GetPolicyOptions + * @static + * @param {google.iam.v1.IGetPolicyOptions} message GetPolicyOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetPolicyOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetPolicyOptions message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.GetPolicyOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.GetPolicyOptions} GetPolicyOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetPolicyOptions.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.iam.v1.GetPolicyOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.requestedPolicyVersion = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetPolicyOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.GetPolicyOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.GetPolicyOptions} GetPolicyOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetPolicyOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetPolicyOptions message. + * @function verify + * @memberof google.iam.v1.GetPolicyOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetPolicyOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.requestedPolicyVersion != null && message.hasOwnProperty("requestedPolicyVersion")) + if (!$util.isInteger(message.requestedPolicyVersion)) + return "requestedPolicyVersion: integer expected"; + return null; + }; + + /** + * Creates a GetPolicyOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.GetPolicyOptions + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.GetPolicyOptions} GetPolicyOptions + */ + GetPolicyOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.GetPolicyOptions) + return object; + var message = new $root.google.iam.v1.GetPolicyOptions(); + if (object.requestedPolicyVersion != null) + message.requestedPolicyVersion = object.requestedPolicyVersion | 0; + return message; + }; + + /** + * Creates a plain object from a GetPolicyOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.GetPolicyOptions + * @static + * @param {google.iam.v1.GetPolicyOptions} message GetPolicyOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetPolicyOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.requestedPolicyVersion = 0; + if (message.requestedPolicyVersion != null && message.hasOwnProperty("requestedPolicyVersion")) + object.requestedPolicyVersion = message.requestedPolicyVersion; + return object; + }; + + /** + * Converts this GetPolicyOptions to JSON. + * @function toJSON + * @memberof google.iam.v1.GetPolicyOptions + * @instance + * @returns {Object.} JSON object + */ + GetPolicyOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetPolicyOptions; + })(); + + v1.Policy = (function() { + + /** + * Properties of a Policy. + * @memberof google.iam.v1 + * @interface IPolicy + * @property {number|null} [version] Policy version + * @property {Array.|null} [bindings] Policy bindings + * @property {Uint8Array|null} [etag] Policy etag + */ + + /** + * Constructs a new Policy. + * @memberof google.iam.v1 + * @classdesc Represents a Policy. + * @implements IPolicy + * @constructor + * @param {google.iam.v1.IPolicy=} [properties] Properties to set + */ + function Policy(properties) { + this.bindings = []; + 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]]; + } + + /** + * Policy version. + * @member {number} version + * @memberof google.iam.v1.Policy + * @instance + */ + Policy.prototype.version = 0; + + /** + * Policy bindings. + * @member {Array.} bindings + * @memberof google.iam.v1.Policy + * @instance + */ + Policy.prototype.bindings = $util.emptyArray; + + /** + * Policy etag. + * @member {Uint8Array} etag + * @memberof google.iam.v1.Policy + * @instance + */ + Policy.prototype.etag = $util.newBuffer([]); + + /** + * Creates a new Policy instance using the specified properties. + * @function create + * @memberof google.iam.v1.Policy + * @static + * @param {google.iam.v1.IPolicy=} [properties] Properties to set + * @returns {google.iam.v1.Policy} Policy instance + */ + Policy.create = function create(properties) { + return new Policy(properties); + }; + + /** + * Encodes the specified Policy message. Does not implicitly {@link google.iam.v1.Policy.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.Policy + * @static + * @param {google.iam.v1.IPolicy} message Policy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Policy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.version != null && message.hasOwnProperty("version")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.version); + if (message.etag != null && message.hasOwnProperty("etag")) + writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.etag); + if (message.bindings != null && message.bindings.length) + for (var i = 0; i < message.bindings.length; ++i) + $root.google.iam.v1.Binding.encode(message.bindings[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Policy message, length delimited. Does not implicitly {@link google.iam.v1.Policy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.Policy + * @static + * @param {google.iam.v1.IPolicy} message Policy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Policy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Policy message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.Policy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.Policy} Policy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Policy.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.iam.v1.Policy(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.version = reader.int32(); + break; + case 4: + if (!(message.bindings && message.bindings.length)) + message.bindings = []; + message.bindings.push($root.google.iam.v1.Binding.decode(reader, reader.uint32())); + break; + case 3: + message.etag = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Policy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.Policy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.Policy} Policy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Policy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Policy message. + * @function verify + * @memberof google.iam.v1.Policy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Policy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isInteger(message.version)) + return "version: integer expected"; + if (message.bindings != null && message.hasOwnProperty("bindings")) { + if (!Array.isArray(message.bindings)) + return "bindings: array expected"; + for (var i = 0; i < message.bindings.length; ++i) { + var error = $root.google.iam.v1.Binding.verify(message.bindings[i]); + if (error) + return "bindings." + error; + } + } + if (message.etag != null && message.hasOwnProperty("etag")) + if (!(message.etag && typeof message.etag.length === "number" || $util.isString(message.etag))) + return "etag: buffer expected"; + return null; + }; + + /** + * Creates a Policy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.Policy + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.Policy} Policy + */ + Policy.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.Policy) + return object; + var message = new $root.google.iam.v1.Policy(); + if (object.version != null) + message.version = object.version | 0; + if (object.bindings) { + if (!Array.isArray(object.bindings)) + throw TypeError(".google.iam.v1.Policy.bindings: array expected"); + message.bindings = []; + for (var i = 0; i < object.bindings.length; ++i) { + if (typeof object.bindings[i] !== "object") + throw TypeError(".google.iam.v1.Policy.bindings: object expected"); + message.bindings[i] = $root.google.iam.v1.Binding.fromObject(object.bindings[i]); + } + } + if (object.etag != null) + if (typeof object.etag === "string") + $util.base64.decode(object.etag, message.etag = $util.newBuffer($util.base64.length(object.etag)), 0); + else if (object.etag.length) + message.etag = object.etag; + return message; + }; + + /** + * Creates a plain object from a Policy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.Policy + * @static + * @param {google.iam.v1.Policy} message Policy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Policy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.bindings = []; + if (options.defaults) { + object.version = 0; + if (options.bytes === String) + object.etag = ""; + else { + object.etag = []; + if (options.bytes !== Array) + object.etag = $util.newBuffer(object.etag); + } + } + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = options.bytes === String ? $util.base64.encode(message.etag, 0, message.etag.length) : options.bytes === Array ? Array.prototype.slice.call(message.etag) : message.etag; + if (message.bindings && message.bindings.length) { + object.bindings = []; + for (var j = 0; j < message.bindings.length; ++j) + object.bindings[j] = $root.google.iam.v1.Binding.toObject(message.bindings[j], options); + } + return object; + }; + + /** + * Converts this Policy to JSON. + * @function toJSON + * @memberof google.iam.v1.Policy + * @instance + * @returns {Object.} JSON object + */ + Policy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Policy; + })(); + + v1.Binding = (function() { + + /** + * Properties of a Binding. + * @memberof google.iam.v1 + * @interface IBinding + * @property {string|null} [role] Binding role + * @property {Array.|null} [members] Binding members + * @property {google.type.IExpr|null} [condition] Binding condition + */ + + /** + * Constructs a new Binding. + * @memberof google.iam.v1 + * @classdesc Represents a Binding. + * @implements IBinding + * @constructor + * @param {google.iam.v1.IBinding=} [properties] Properties to set + */ + function Binding(properties) { + this.members = []; + 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]]; + } + + /** + * Binding role. + * @member {string} role + * @memberof google.iam.v1.Binding + * @instance + */ + Binding.prototype.role = ""; + + /** + * Binding members. + * @member {Array.} members + * @memberof google.iam.v1.Binding + * @instance + */ + Binding.prototype.members = $util.emptyArray; + + /** + * Binding condition. + * @member {google.type.IExpr|null|undefined} condition + * @memberof google.iam.v1.Binding + * @instance + */ + Binding.prototype.condition = null; + + /** + * Creates a new Binding instance using the specified properties. + * @function create + * @memberof google.iam.v1.Binding + * @static + * @param {google.iam.v1.IBinding=} [properties] Properties to set + * @returns {google.iam.v1.Binding} Binding instance + */ + Binding.create = function create(properties) { + return new Binding(properties); + }; + + /** + * Encodes the specified Binding message. Does not implicitly {@link google.iam.v1.Binding.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.Binding + * @static + * @param {google.iam.v1.IBinding} message Binding message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Binding.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.role != null && message.hasOwnProperty("role")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.role); + if (message.members != null && message.members.length) + for (var i = 0; i < message.members.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.members[i]); + if (message.condition != null && message.hasOwnProperty("condition")) + $root.google.type.Expr.encode(message.condition, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Binding message, length delimited. Does not implicitly {@link google.iam.v1.Binding.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.Binding + * @static + * @param {google.iam.v1.IBinding} message Binding message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Binding.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Binding message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.Binding + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.Binding} Binding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Binding.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.iam.v1.Binding(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.role = reader.string(); + break; + case 2: + if (!(message.members && message.members.length)) + message.members = []; + message.members.push(reader.string()); + break; + case 3: + message.condition = $root.google.type.Expr.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Binding message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.Binding + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.Binding} Binding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Binding.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Binding message. + * @function verify + * @memberof google.iam.v1.Binding + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Binding.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.role != null && message.hasOwnProperty("role")) + if (!$util.isString(message.role)) + return "role: string expected"; + if (message.members != null && message.hasOwnProperty("members")) { + if (!Array.isArray(message.members)) + return "members: array expected"; + for (var i = 0; i < message.members.length; ++i) + if (!$util.isString(message.members[i])) + return "members: string[] expected"; + } + if (message.condition != null && message.hasOwnProperty("condition")) { + var error = $root.google.type.Expr.verify(message.condition); + if (error) + return "condition." + error; + } + return null; + }; + + /** + * Creates a Binding message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.Binding + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.Binding} Binding + */ + Binding.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.Binding) + return object; + var message = new $root.google.iam.v1.Binding(); + if (object.role != null) + message.role = String(object.role); + if (object.members) { + if (!Array.isArray(object.members)) + throw TypeError(".google.iam.v1.Binding.members: array expected"); + message.members = []; + for (var i = 0; i < object.members.length; ++i) + message.members[i] = String(object.members[i]); + } + if (object.condition != null) { + if (typeof object.condition !== "object") + throw TypeError(".google.iam.v1.Binding.condition: object expected"); + message.condition = $root.google.type.Expr.fromObject(object.condition); + } + return message; + }; + + /** + * Creates a plain object from a Binding message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.Binding + * @static + * @param {google.iam.v1.Binding} message Binding + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Binding.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.members = []; + if (options.defaults) { + object.role = ""; + object.condition = null; + } + if (message.role != null && message.hasOwnProperty("role")) + object.role = message.role; + if (message.members && message.members.length) { + object.members = []; + for (var j = 0; j < message.members.length; ++j) + object.members[j] = message.members[j]; + } + if (message.condition != null && message.hasOwnProperty("condition")) + object.condition = $root.google.type.Expr.toObject(message.condition, options); + return object; + }; + + /** + * Converts this Binding to JSON. + * @function toJSON + * @memberof google.iam.v1.Binding + * @instance + * @returns {Object.} JSON object + */ + Binding.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Binding; + })(); + + v1.PolicyDelta = (function() { + + /** + * Properties of a PolicyDelta. + * @memberof google.iam.v1 + * @interface IPolicyDelta + * @property {Array.|null} [bindingDeltas] PolicyDelta bindingDeltas + * @property {Array.|null} [auditConfigDeltas] PolicyDelta auditConfigDeltas + */ + + /** + * Constructs a new PolicyDelta. + * @memberof google.iam.v1 + * @classdesc Represents a PolicyDelta. + * @implements IPolicyDelta + * @constructor + * @param {google.iam.v1.IPolicyDelta=} [properties] Properties to set + */ + function PolicyDelta(properties) { + this.bindingDeltas = []; + this.auditConfigDeltas = []; + 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]]; + } + + /** + * PolicyDelta bindingDeltas. + * @member {Array.} bindingDeltas + * @memberof google.iam.v1.PolicyDelta + * @instance + */ + PolicyDelta.prototype.bindingDeltas = $util.emptyArray; + + /** + * PolicyDelta auditConfigDeltas. + * @member {Array.} auditConfigDeltas + * @memberof google.iam.v1.PolicyDelta + * @instance + */ + PolicyDelta.prototype.auditConfigDeltas = $util.emptyArray; + + /** + * Creates a new PolicyDelta instance using the specified properties. + * @function create + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {google.iam.v1.IPolicyDelta=} [properties] Properties to set + * @returns {google.iam.v1.PolicyDelta} PolicyDelta instance + */ + PolicyDelta.create = function create(properties) { + return new PolicyDelta(properties); + }; + + /** + * Encodes the specified PolicyDelta message. Does not implicitly {@link google.iam.v1.PolicyDelta.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {google.iam.v1.IPolicyDelta} message PolicyDelta message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PolicyDelta.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.bindingDeltas != null && message.bindingDeltas.length) + for (var i = 0; i < message.bindingDeltas.length; ++i) + $root.google.iam.v1.BindingDelta.encode(message.bindingDeltas[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.auditConfigDeltas != null && message.auditConfigDeltas.length) + for (var i = 0; i < message.auditConfigDeltas.length; ++i) + $root.google.iam.v1.AuditConfigDelta.encode(message.auditConfigDeltas[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PolicyDelta message, length delimited. Does not implicitly {@link google.iam.v1.PolicyDelta.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {google.iam.v1.IPolicyDelta} message PolicyDelta message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PolicyDelta.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PolicyDelta message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.PolicyDelta} PolicyDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PolicyDelta.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.iam.v1.PolicyDelta(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.bindingDeltas && message.bindingDeltas.length)) + message.bindingDeltas = []; + message.bindingDeltas.push($root.google.iam.v1.BindingDelta.decode(reader, reader.uint32())); + break; + case 2: + if (!(message.auditConfigDeltas && message.auditConfigDeltas.length)) + message.auditConfigDeltas = []; + message.auditConfigDeltas.push($root.google.iam.v1.AuditConfigDelta.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PolicyDelta message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.PolicyDelta} PolicyDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PolicyDelta.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PolicyDelta message. + * @function verify + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PolicyDelta.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.bindingDeltas != null && message.hasOwnProperty("bindingDeltas")) { + if (!Array.isArray(message.bindingDeltas)) + return "bindingDeltas: array expected"; + for (var i = 0; i < message.bindingDeltas.length; ++i) { + var error = $root.google.iam.v1.BindingDelta.verify(message.bindingDeltas[i]); + if (error) + return "bindingDeltas." + error; + } + } + if (message.auditConfigDeltas != null && message.hasOwnProperty("auditConfigDeltas")) { + if (!Array.isArray(message.auditConfigDeltas)) + return "auditConfigDeltas: array expected"; + for (var i = 0; i < message.auditConfigDeltas.length; ++i) { + var error = $root.google.iam.v1.AuditConfigDelta.verify(message.auditConfigDeltas[i]); + if (error) + return "auditConfigDeltas." + error; + } + } + return null; + }; + + /** + * Creates a PolicyDelta message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.PolicyDelta} PolicyDelta + */ + PolicyDelta.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.PolicyDelta) + return object; + var message = new $root.google.iam.v1.PolicyDelta(); + if (object.bindingDeltas) { + if (!Array.isArray(object.bindingDeltas)) + throw TypeError(".google.iam.v1.PolicyDelta.bindingDeltas: array expected"); + message.bindingDeltas = []; + for (var i = 0; i < object.bindingDeltas.length; ++i) { + if (typeof object.bindingDeltas[i] !== "object") + throw TypeError(".google.iam.v1.PolicyDelta.bindingDeltas: object expected"); + message.bindingDeltas[i] = $root.google.iam.v1.BindingDelta.fromObject(object.bindingDeltas[i]); + } + } + if (object.auditConfigDeltas) { + if (!Array.isArray(object.auditConfigDeltas)) + throw TypeError(".google.iam.v1.PolicyDelta.auditConfigDeltas: array expected"); + message.auditConfigDeltas = []; + for (var i = 0; i < object.auditConfigDeltas.length; ++i) { + if (typeof object.auditConfigDeltas[i] !== "object") + throw TypeError(".google.iam.v1.PolicyDelta.auditConfigDeltas: object expected"); + message.auditConfigDeltas[i] = $root.google.iam.v1.AuditConfigDelta.fromObject(object.auditConfigDeltas[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a PolicyDelta message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {google.iam.v1.PolicyDelta} message PolicyDelta + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PolicyDelta.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.bindingDeltas = []; + object.auditConfigDeltas = []; + } + if (message.bindingDeltas && message.bindingDeltas.length) { + object.bindingDeltas = []; + for (var j = 0; j < message.bindingDeltas.length; ++j) + object.bindingDeltas[j] = $root.google.iam.v1.BindingDelta.toObject(message.bindingDeltas[j], options); + } + if (message.auditConfigDeltas && message.auditConfigDeltas.length) { + object.auditConfigDeltas = []; + for (var j = 0; j < message.auditConfigDeltas.length; ++j) + object.auditConfigDeltas[j] = $root.google.iam.v1.AuditConfigDelta.toObject(message.auditConfigDeltas[j], options); + } + return object; + }; + + /** + * Converts this PolicyDelta to JSON. + * @function toJSON + * @memberof google.iam.v1.PolicyDelta + * @instance + * @returns {Object.} JSON object + */ + PolicyDelta.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return PolicyDelta; + })(); + + v1.BindingDelta = (function() { + + /** + * Properties of a BindingDelta. + * @memberof google.iam.v1 + * @interface IBindingDelta + * @property {google.iam.v1.BindingDelta.Action|null} [action] BindingDelta action + * @property {string|null} [role] BindingDelta role + * @property {string|null} [member] BindingDelta member + * @property {google.type.IExpr|null} [condition] BindingDelta condition + */ + + /** + * Constructs a new BindingDelta. + * @memberof google.iam.v1 + * @classdesc Represents a BindingDelta. + * @implements IBindingDelta + * @constructor + * @param {google.iam.v1.IBindingDelta=} [properties] Properties to set + */ + function BindingDelta(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]]; + } + + /** + * BindingDelta action. + * @member {google.iam.v1.BindingDelta.Action} action + * @memberof google.iam.v1.BindingDelta + * @instance + */ + BindingDelta.prototype.action = 0; + + /** + * BindingDelta role. + * @member {string} role + * @memberof google.iam.v1.BindingDelta + * @instance + */ + BindingDelta.prototype.role = ""; + + /** + * BindingDelta member. + * @member {string} member + * @memberof google.iam.v1.BindingDelta + * @instance + */ + BindingDelta.prototype.member = ""; + + /** + * BindingDelta condition. + * @member {google.type.IExpr|null|undefined} condition + * @memberof google.iam.v1.BindingDelta + * @instance + */ + BindingDelta.prototype.condition = null; + + /** + * Creates a new BindingDelta instance using the specified properties. + * @function create + * @memberof google.iam.v1.BindingDelta + * @static + * @param {google.iam.v1.IBindingDelta=} [properties] Properties to set + * @returns {google.iam.v1.BindingDelta} BindingDelta instance + */ + BindingDelta.create = function create(properties) { + return new BindingDelta(properties); + }; + + /** + * Encodes the specified BindingDelta message. Does not implicitly {@link google.iam.v1.BindingDelta.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.BindingDelta + * @static + * @param {google.iam.v1.IBindingDelta} message BindingDelta message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BindingDelta.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.action != null && message.hasOwnProperty("action")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.action); + if (message.role != null && message.hasOwnProperty("role")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.role); + if (message.member != null && message.hasOwnProperty("member")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.member); + if (message.condition != null && message.hasOwnProperty("condition")) + $root.google.type.Expr.encode(message.condition, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BindingDelta message, length delimited. Does not implicitly {@link google.iam.v1.BindingDelta.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.BindingDelta + * @static + * @param {google.iam.v1.IBindingDelta} message BindingDelta message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BindingDelta.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BindingDelta message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.BindingDelta + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.BindingDelta} BindingDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BindingDelta.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.iam.v1.BindingDelta(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.action = reader.int32(); + break; + case 2: + message.role = reader.string(); + break; + case 3: + message.member = reader.string(); + break; + case 4: + message.condition = $root.google.type.Expr.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BindingDelta message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.BindingDelta + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.BindingDelta} BindingDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BindingDelta.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BindingDelta message. + * @function verify + * @memberof google.iam.v1.BindingDelta + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BindingDelta.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.action != null && message.hasOwnProperty("action")) + switch (message.action) { + default: + return "action: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.role != null && message.hasOwnProperty("role")) + if (!$util.isString(message.role)) + return "role: string expected"; + if (message.member != null && message.hasOwnProperty("member")) + if (!$util.isString(message.member)) + return "member: string expected"; + if (message.condition != null && message.hasOwnProperty("condition")) { + var error = $root.google.type.Expr.verify(message.condition); + if (error) + return "condition." + error; + } + return null; + }; + + /** + * Creates a BindingDelta message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.BindingDelta + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.BindingDelta} BindingDelta + */ + BindingDelta.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.BindingDelta) + return object; + var message = new $root.google.iam.v1.BindingDelta(); + switch (object.action) { + case "ACTION_UNSPECIFIED": + case 0: + message.action = 0; + break; + case "ADD": + case 1: + message.action = 1; + break; + case "REMOVE": + case 2: + message.action = 2; + break; + } + if (object.role != null) + message.role = String(object.role); + if (object.member != null) + message.member = String(object.member); + if (object.condition != null) { + if (typeof object.condition !== "object") + throw TypeError(".google.iam.v1.BindingDelta.condition: object expected"); + message.condition = $root.google.type.Expr.fromObject(object.condition); + } + return message; + }; + + /** + * Creates a plain object from a BindingDelta message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.BindingDelta + * @static + * @param {google.iam.v1.BindingDelta} message BindingDelta + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BindingDelta.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.action = options.enums === String ? "ACTION_UNSPECIFIED" : 0; + object.role = ""; + object.member = ""; + object.condition = null; + } + if (message.action != null && message.hasOwnProperty("action")) + object.action = options.enums === String ? $root.google.iam.v1.BindingDelta.Action[message.action] : message.action; + if (message.role != null && message.hasOwnProperty("role")) + object.role = message.role; + if (message.member != null && message.hasOwnProperty("member")) + object.member = message.member; + if (message.condition != null && message.hasOwnProperty("condition")) + object.condition = $root.google.type.Expr.toObject(message.condition, options); + return object; + }; + + /** + * Converts this BindingDelta to JSON. + * @function toJSON + * @memberof google.iam.v1.BindingDelta + * @instance + * @returns {Object.} JSON object + */ + BindingDelta.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Action enum. + * @name google.iam.v1.BindingDelta.Action + * @enum {string} + * @property {number} ACTION_UNSPECIFIED=0 ACTION_UNSPECIFIED value + * @property {number} ADD=1 ADD value + * @property {number} REMOVE=2 REMOVE value + */ + BindingDelta.Action = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ACTION_UNSPECIFIED"] = 0; + values[valuesById[1] = "ADD"] = 1; + values[valuesById[2] = "REMOVE"] = 2; + return values; + })(); + + return BindingDelta; + })(); + + v1.AuditConfigDelta = (function() { + + /** + * Properties of an AuditConfigDelta. + * @memberof google.iam.v1 + * @interface IAuditConfigDelta + * @property {google.iam.v1.AuditConfigDelta.Action|null} [action] AuditConfigDelta action + * @property {string|null} [service] AuditConfigDelta service + * @property {string|null} [exemptedMember] AuditConfigDelta exemptedMember + * @property {string|null} [logType] AuditConfigDelta logType + */ + + /** + * Constructs a new AuditConfigDelta. + * @memberof google.iam.v1 + * @classdesc Represents an AuditConfigDelta. + * @implements IAuditConfigDelta + * @constructor + * @param {google.iam.v1.IAuditConfigDelta=} [properties] Properties to set + */ + function AuditConfigDelta(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]]; + } + + /** + * AuditConfigDelta action. + * @member {google.iam.v1.AuditConfigDelta.Action} action + * @memberof google.iam.v1.AuditConfigDelta + * @instance + */ + AuditConfigDelta.prototype.action = 0; + + /** + * AuditConfigDelta service. + * @member {string} service + * @memberof google.iam.v1.AuditConfigDelta + * @instance + */ + AuditConfigDelta.prototype.service = ""; + + /** + * AuditConfigDelta exemptedMember. + * @member {string} exemptedMember + * @memberof google.iam.v1.AuditConfigDelta + * @instance + */ + AuditConfigDelta.prototype.exemptedMember = ""; + + /** + * AuditConfigDelta logType. + * @member {string} logType + * @memberof google.iam.v1.AuditConfigDelta + * @instance + */ + AuditConfigDelta.prototype.logType = ""; + + /** + * Creates a new AuditConfigDelta instance using the specified properties. + * @function create + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {google.iam.v1.IAuditConfigDelta=} [properties] Properties to set + * @returns {google.iam.v1.AuditConfigDelta} AuditConfigDelta instance + */ + AuditConfigDelta.create = function create(properties) { + return new AuditConfigDelta(properties); + }; + + /** + * Encodes the specified AuditConfigDelta message. Does not implicitly {@link google.iam.v1.AuditConfigDelta.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {google.iam.v1.IAuditConfigDelta} message AuditConfigDelta message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuditConfigDelta.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.action != null && message.hasOwnProperty("action")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.action); + if (message.service != null && message.hasOwnProperty("service")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.service); + if (message.exemptedMember != null && message.hasOwnProperty("exemptedMember")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.exemptedMember); + if (message.logType != null && message.hasOwnProperty("logType")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.logType); + return writer; + }; + + /** + * Encodes the specified AuditConfigDelta message, length delimited. Does not implicitly {@link google.iam.v1.AuditConfigDelta.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {google.iam.v1.IAuditConfigDelta} message AuditConfigDelta message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuditConfigDelta.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AuditConfigDelta message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.AuditConfigDelta} AuditConfigDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuditConfigDelta.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.iam.v1.AuditConfigDelta(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.action = reader.int32(); + break; + case 2: + message.service = reader.string(); + break; + case 3: + message.exemptedMember = reader.string(); + break; + case 4: + message.logType = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AuditConfigDelta message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.AuditConfigDelta} AuditConfigDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuditConfigDelta.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AuditConfigDelta message. + * @function verify + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AuditConfigDelta.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.action != null && message.hasOwnProperty("action")) + switch (message.action) { + default: + return "action: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.service != null && message.hasOwnProperty("service")) + if (!$util.isString(message.service)) + return "service: string expected"; + if (message.exemptedMember != null && message.hasOwnProperty("exemptedMember")) + if (!$util.isString(message.exemptedMember)) + return "exemptedMember: string expected"; + if (message.logType != null && message.hasOwnProperty("logType")) + if (!$util.isString(message.logType)) + return "logType: string expected"; + return null; + }; + + /** + * Creates an AuditConfigDelta message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.AuditConfigDelta} AuditConfigDelta + */ + AuditConfigDelta.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.AuditConfigDelta) + return object; + var message = new $root.google.iam.v1.AuditConfigDelta(); + switch (object.action) { + case "ACTION_UNSPECIFIED": + case 0: + message.action = 0; + break; + case "ADD": + case 1: + message.action = 1; + break; + case "REMOVE": + case 2: + message.action = 2; + break; + } + if (object.service != null) + message.service = String(object.service); + if (object.exemptedMember != null) + message.exemptedMember = String(object.exemptedMember); + if (object.logType != null) + message.logType = String(object.logType); + return message; + }; + + /** + * Creates a plain object from an AuditConfigDelta message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {google.iam.v1.AuditConfigDelta} message AuditConfigDelta + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AuditConfigDelta.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.action = options.enums === String ? "ACTION_UNSPECIFIED" : 0; + object.service = ""; + object.exemptedMember = ""; + object.logType = ""; + } + if (message.action != null && message.hasOwnProperty("action")) + object.action = options.enums === String ? $root.google.iam.v1.AuditConfigDelta.Action[message.action] : message.action; + if (message.service != null && message.hasOwnProperty("service")) + object.service = message.service; + if (message.exemptedMember != null && message.hasOwnProperty("exemptedMember")) + object.exemptedMember = message.exemptedMember; + if (message.logType != null && message.hasOwnProperty("logType")) + object.logType = message.logType; + return object; + }; + + /** + * Converts this AuditConfigDelta to JSON. + * @function toJSON + * @memberof google.iam.v1.AuditConfigDelta + * @instance + * @returns {Object.} JSON object + */ + AuditConfigDelta.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Action enum. + * @name google.iam.v1.AuditConfigDelta.Action + * @enum {string} + * @property {number} ACTION_UNSPECIFIED=0 ACTION_UNSPECIFIED value + * @property {number} ADD=1 ADD value + * @property {number} REMOVE=2 REMOVE value + */ + AuditConfigDelta.Action = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ACTION_UNSPECIFIED"] = 0; + values[valuesById[1] = "ADD"] = 1; + values[valuesById[2] = "REMOVE"] = 2; + return values; + })(); + + return AuditConfigDelta; + })(); + + return v1; + })(); + + return iam; + })(); + + google.type = (function() { + + /** + * Namespace type. + * @memberof google + * @namespace + */ + var type = {}; + + type.Expr = (function() { + + /** + * Properties of an Expr. + * @memberof google.type + * @interface IExpr + * @property {string|null} [expression] Expr expression + * @property {string|null} [title] Expr title + * @property {string|null} [description] Expr description + * @property {string|null} [location] Expr location + */ + + /** + * Constructs a new Expr. + * @memberof google.type + * @classdesc Represents an Expr. + * @implements IExpr + * @constructor + * @param {google.type.IExpr=} [properties] Properties to set + */ + function Expr(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]]; + } + + /** + * Expr expression. + * @member {string} expression + * @memberof google.type.Expr + * @instance + */ + Expr.prototype.expression = ""; + + /** + * Expr title. + * @member {string} title + * @memberof google.type.Expr + * @instance + */ + Expr.prototype.title = ""; + + /** + * Expr description. + * @member {string} description + * @memberof google.type.Expr + * @instance + */ + Expr.prototype.description = ""; + + /** + * Expr location. + * @member {string} location + * @memberof google.type.Expr + * @instance + */ + Expr.prototype.location = ""; + + /** + * Creates a new Expr instance using the specified properties. + * @function create + * @memberof google.type.Expr + * @static + * @param {google.type.IExpr=} [properties] Properties to set + * @returns {google.type.Expr} Expr instance + */ + Expr.create = function create(properties) { + return new Expr(properties); + }; + + /** + * Encodes the specified Expr message. Does not implicitly {@link google.type.Expr.verify|verify} messages. + * @function encode + * @memberof google.type.Expr + * @static + * @param {google.type.IExpr} message Expr message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Expr.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.expression != null && message.hasOwnProperty("expression")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.expression); + if (message.title != null && message.hasOwnProperty("title")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.title); + if (message.description != null && message.hasOwnProperty("description")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + if (message.location != null && message.hasOwnProperty("location")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.location); + return writer; + }; + + /** + * Encodes the specified Expr message, length delimited. Does not implicitly {@link google.type.Expr.verify|verify} messages. + * @function encodeDelimited + * @memberof google.type.Expr + * @static + * @param {google.type.IExpr} message Expr message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Expr.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Expr message from the specified reader or buffer. + * @function decode + * @memberof google.type.Expr + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.type.Expr} Expr + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Expr.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.type.Expr(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.expression = reader.string(); + break; + case 2: + message.title = reader.string(); + break; + case 3: + message.description = reader.string(); + break; + case 4: + message.location = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Expr message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.type.Expr + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.type.Expr} Expr + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Expr.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Expr message. + * @function verify + * @memberof google.type.Expr + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Expr.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.expression != null && message.hasOwnProperty("expression")) + if (!$util.isString(message.expression)) + return "expression: string expected"; + if (message.title != null && message.hasOwnProperty("title")) + if (!$util.isString(message.title)) + return "title: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.location != null && message.hasOwnProperty("location")) + if (!$util.isString(message.location)) + return "location: string expected"; + return null; + }; + + /** + * Creates an Expr message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.type.Expr + * @static + * @param {Object.} object Plain object + * @returns {google.type.Expr} Expr + */ + Expr.fromObject = function fromObject(object) { + if (object instanceof $root.google.type.Expr) + return object; + var message = new $root.google.type.Expr(); + if (object.expression != null) + message.expression = String(object.expression); + if (object.title != null) + message.title = String(object.title); + if (object.description != null) + message.description = String(object.description); + if (object.location != null) + message.location = String(object.location); + return message; + }; + + /** + * Creates a plain object from an Expr message. Also converts values to other types if specified. + * @function toObject + * @memberof google.type.Expr + * @static + * @param {google.type.Expr} message Expr + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Expr.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.expression = ""; + object.title = ""; + object.description = ""; + object.location = ""; + } + if (message.expression != null && message.hasOwnProperty("expression")) + object.expression = message.expression; + if (message.title != null && message.hasOwnProperty("title")) + object.title = message.title; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.location != null && message.hasOwnProperty("location")) + object.location = message.location; + return object; + }; + + /** + * Converts this Expr to JSON. + * @function toJSON + * @memberof google.type.Expr + * @instance + * @returns {Object.} JSON object + */ + Expr.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Expr; + })(); + + return type; + })(); + + google.longrunning = (function() { + + /** + * Namespace longrunning. + * @memberof google + * @namespace + */ + var longrunning = {}; + + longrunning.Operations = (function() { + + /** + * Constructs a new Operations service. + * @memberof google.longrunning + * @classdesc Represents an Operations + * @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 Operations(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Operations.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Operations; + + /** + * Creates new Operations service using the specified rpc implementation. + * @function create + * @memberof google.longrunning.Operations + * @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 {Operations} RPC service. Useful where requests and/or responses are streamed. + */ + Operations.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.longrunning.Operations#listOperations}. + * @memberof google.longrunning.Operations + * @typedef ListOperationsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.ListOperationsResponse} [response] ListOperationsResponse + */ + + /** + * Calls ListOperations. + * @function listOperations + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IListOperationsRequest} request ListOperationsRequest message or plain object + * @param {google.longrunning.Operations.ListOperationsCallback} callback Node-style callback called with the error, if any, and ListOperationsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.listOperations = function listOperations(request, callback) { + return this.rpcCall(listOperations, $root.google.longrunning.ListOperationsRequest, $root.google.longrunning.ListOperationsResponse, request, callback); + }, "name", { value: "ListOperations" }); + + /** + * Calls ListOperations. + * @function listOperations + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IListOperationsRequest} request ListOperationsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations#getOperation}. + * @memberof google.longrunning.Operations + * @typedef GetOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls GetOperation. + * @function getOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IGetOperationRequest} request GetOperationRequest message or plain object + * @param {google.longrunning.Operations.GetOperationCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.getOperation = function getOperation(request, callback) { + return this.rpcCall(getOperation, $root.google.longrunning.GetOperationRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "GetOperation" }); + + /** + * Calls GetOperation. + * @function getOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IGetOperationRequest} request GetOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations#deleteOperation}. + * @memberof google.longrunning.Operations + * @typedef DeleteOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteOperation. + * @function deleteOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IDeleteOperationRequest} request DeleteOperationRequest message or plain object + * @param {google.longrunning.Operations.DeleteOperationCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.deleteOperation = function deleteOperation(request, callback) { + return this.rpcCall(deleteOperation, $root.google.longrunning.DeleteOperationRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteOperation" }); + + /** + * Calls DeleteOperation. + * @function deleteOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IDeleteOperationRequest} request DeleteOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations#cancelOperation}. + * @memberof google.longrunning.Operations + * @typedef CancelOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls CancelOperation. + * @function cancelOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.ICancelOperationRequest} request CancelOperationRequest message or plain object + * @param {google.longrunning.Operations.CancelOperationCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.cancelOperation = function cancelOperation(request, callback) { + return this.rpcCall(cancelOperation, $root.google.longrunning.CancelOperationRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "CancelOperation" }); + + /** + * Calls CancelOperation. + * @function cancelOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.ICancelOperationRequest} request CancelOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations#waitOperation}. + * @memberof google.longrunning.Operations + * @typedef WaitOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls WaitOperation. + * @function waitOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IWaitOperationRequest} request WaitOperationRequest message or plain object + * @param {google.longrunning.Operations.WaitOperationCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.waitOperation = function waitOperation(request, callback) { + return this.rpcCall(waitOperation, $root.google.longrunning.WaitOperationRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "WaitOperation" }); + + /** + * Calls WaitOperation. + * @function waitOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IWaitOperationRequest} request WaitOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Operations; + })(); + + longrunning.Operation = (function() { + + /** + * Properties of an Operation. + * @memberof google.longrunning + * @interface IOperation + * @property {string|null} [name] Operation name + * @property {google.protobuf.IAny|null} [metadata] Operation metadata + * @property {boolean|null} [done] Operation done + * @property {google.rpc.IStatus|null} [error] Operation error + * @property {google.protobuf.IAny|null} [response] Operation response + */ + + /** + * Constructs a new Operation. + * @memberof google.longrunning + * @classdesc Represents an Operation. + * @implements IOperation + * @constructor + * @param {google.longrunning.IOperation=} [properties] Properties to set + */ + function Operation(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]]; + } + + /** + * Operation name. + * @member {string} name + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.name = ""; + + /** + * Operation metadata. + * @member {google.protobuf.IAny|null|undefined} metadata + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.metadata = null; + + /** + * Operation done. + * @member {boolean} done + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.done = false; + + /** + * Operation error. + * @member {google.rpc.IStatus|null|undefined} error + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.error = null; + + /** + * Operation response. + * @member {google.protobuf.IAny|null|undefined} response + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.response = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Operation result. + * @member {"error"|"response"|undefined} result + * @memberof google.longrunning.Operation + * @instance + */ + Object.defineProperty(Operation.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["error", "response"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Operation instance using the specified properties. + * @function create + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.IOperation=} [properties] Properties to set + * @returns {google.longrunning.Operation} Operation instance + */ + Operation.create = function create(properties) { + return new Operation(properties); + }; + + /** + * Encodes the specified Operation message. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @function encode + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.IOperation} message Operation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Operation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.metadata != null && message.hasOwnProperty("metadata")) + $root.google.protobuf.Any.encode(message.metadata, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.done != null && message.hasOwnProperty("done")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.done); + if (message.error != null && message.hasOwnProperty("error")) + $root.google.rpc.Status.encode(message.error, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.response != null && message.hasOwnProperty("response")) + $root.google.protobuf.Any.encode(message.response, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Operation message, length delimited. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.IOperation} message Operation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Operation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Operation message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.Operation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.Operation} Operation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Operation.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.longrunning.Operation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.metadata = $root.google.protobuf.Any.decode(reader, reader.uint32()); + break; + case 3: + message.done = reader.bool(); + break; + case 4: + message.error = $root.google.rpc.Status.decode(reader, reader.uint32()); + break; + case 5: + message.response = $root.google.protobuf.Any.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Operation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.Operation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.Operation} Operation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Operation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Operation message. + * @function verify + * @memberof google.longrunning.Operation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Operation.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.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.google.protobuf.Any.verify(message.metadata); + if (error) + return "metadata." + error; + } + if (message.done != null && message.hasOwnProperty("done")) + if (typeof message.done !== "boolean") + return "done: boolean expected"; + if (message.error != null && message.hasOwnProperty("error")) { + properties.result = 1; + { + var error = $root.google.rpc.Status.verify(message.error); + if (error) + return "error." + error; + } + } + if (message.response != null && message.hasOwnProperty("response")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.google.protobuf.Any.verify(message.response); + if (error) + return "response." + error; + } + } + return null; + }; + + /** + * Creates an Operation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.Operation + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.Operation} Operation + */ + Operation.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.Operation) + return object; + var message = new $root.google.longrunning.Operation(); + if (object.name != null) + message.name = String(object.name); + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".google.longrunning.Operation.metadata: object expected"); + message.metadata = $root.google.protobuf.Any.fromObject(object.metadata); + } + if (object.done != null) + message.done = Boolean(object.done); + if (object.error != null) { + if (typeof object.error !== "object") + throw TypeError(".google.longrunning.Operation.error: object expected"); + message.error = $root.google.rpc.Status.fromObject(object.error); + } + if (object.response != null) { + if (typeof object.response !== "object") + throw TypeError(".google.longrunning.Operation.response: object expected"); + message.response = $root.google.protobuf.Any.fromObject(object.response); + } + return message; + }; + + /** + * Creates a plain object from an Operation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.Operation} message Operation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Operation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.metadata = null; + object.done = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.google.protobuf.Any.toObject(message.metadata, options); + if (message.done != null && message.hasOwnProperty("done")) + object.done = message.done; + if (message.error != null && message.hasOwnProperty("error")) { + object.error = $root.google.rpc.Status.toObject(message.error, options); + if (options.oneofs) + object.result = "error"; + } + if (message.response != null && message.hasOwnProperty("response")) { + object.response = $root.google.protobuf.Any.toObject(message.response, options); + if (options.oneofs) + object.result = "response"; + } + return object; + }; + + /** + * Converts this Operation to JSON. + * @function toJSON + * @memberof google.longrunning.Operation + * @instance + * @returns {Object.} JSON object + */ + Operation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Operation; + })(); + + longrunning.GetOperationRequest = (function() { + + /** + * Properties of a GetOperationRequest. + * @memberof google.longrunning + * @interface IGetOperationRequest + * @property {string|null} [name] GetOperationRequest name + */ + + /** + * Constructs a new GetOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a GetOperationRequest. + * @implements IGetOperationRequest + * @constructor + * @param {google.longrunning.IGetOperationRequest=} [properties] Properties to set + */ + function GetOperationRequest(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]]; + } + + /** + * GetOperationRequest name. + * @member {string} name + * @memberof google.longrunning.GetOperationRequest + * @instance + */ + GetOperationRequest.prototype.name = ""; + + /** + * Creates a new GetOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.IGetOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest instance + */ + GetOperationRequest.create = function create(properties) { + return new GetOperationRequest(properties); + }; + + /** + * Encodes the specified GetOperationRequest message. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.IGetOperationRequest} message GetOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetOperationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.IGetOperationRequest} message GetOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetOperationRequest.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.longrunning.GetOperationRequest(); + 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 GetOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetOperationRequest message. + * @function verify + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetOperationRequest.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 GetOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest + */ + GetOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.GetOperationRequest) + return object; + var message = new $root.google.longrunning.GetOperationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.GetOperationRequest} message GetOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetOperationRequest.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 GetOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.GetOperationRequest + * @instance + * @returns {Object.} JSON object + */ + GetOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetOperationRequest; + })(); + + longrunning.ListOperationsRequest = (function() { + + /** + * Properties of a ListOperationsRequest. + * @memberof google.longrunning + * @interface IListOperationsRequest + * @property {string|null} [name] ListOperationsRequest name + * @property {string|null} [filter] ListOperationsRequest filter + * @property {number|null} [pageSize] ListOperationsRequest pageSize + * @property {string|null} [pageToken] ListOperationsRequest pageToken + */ + + /** + * Constructs a new ListOperationsRequest. + * @memberof google.longrunning + * @classdesc Represents a ListOperationsRequest. + * @implements IListOperationsRequest + * @constructor + * @param {google.longrunning.IListOperationsRequest=} [properties] Properties to set + */ + function ListOperationsRequest(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]]; + } + + /** + * ListOperationsRequest name. + * @member {string} name + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.name = ""; + + /** + * ListOperationsRequest filter. + * @member {string} filter + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.filter = ""; + + /** + * ListOperationsRequest pageSize. + * @member {number} pageSize + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.pageSize = 0; + + /** + * ListOperationsRequest pageToken. + * @member {string} pageToken + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListOperationsRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.IListOperationsRequest=} [properties] Properties to set + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest instance + */ + ListOperationsRequest.create = function create(properties) { + return new ListOperationsRequest(properties); + }; + + /** + * Encodes the specified ListOperationsRequest message. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.IListOperationsRequest} message ListOperationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOperationsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.filter != null && message.hasOwnProperty("filter")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.filter); + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.name); + return writer; + }; + + /** + * Encodes the specified ListOperationsRequest message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.IListOperationsRequest} message ListOperationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOperationsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOperationsRequest.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.longrunning.ListOperationsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 4: + message.name = reader.string(); + break; + case 1: + message.filter = reader.string(); + break; + case 2: + message.pageSize = reader.int32(); + break; + case 3: + message.pageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOperationsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListOperationsRequest message. + * @function verify + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListOperationsRequest.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.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListOperationsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest + */ + ListOperationsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.ListOperationsRequest) + return object; + var message = new $root.google.longrunning.ListOperationsRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.filter != null) + message.filter = String(object.filter); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListOperationsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.ListOperationsRequest} message ListOperationsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListOperationsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.filter = ""; + object.pageSize = 0; + object.pageToken = ""; + object.name = ""; + } + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this ListOperationsRequest to JSON. + * @function toJSON + * @memberof google.longrunning.ListOperationsRequest + * @instance + * @returns {Object.} JSON object + */ + ListOperationsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListOperationsRequest; + })(); + + longrunning.ListOperationsResponse = (function() { + + /** + * Properties of a ListOperationsResponse. + * @memberof google.longrunning + * @interface IListOperationsResponse + * @property {Array.|null} [operations] ListOperationsResponse operations + * @property {string|null} [nextPageToken] ListOperationsResponse nextPageToken + */ + + /** + * Constructs a new ListOperationsResponse. + * @memberof google.longrunning + * @classdesc Represents a ListOperationsResponse. + * @implements IListOperationsResponse + * @constructor + * @param {google.longrunning.IListOperationsResponse=} [properties] Properties to set + */ + function ListOperationsResponse(properties) { + this.operations = []; + 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]]; + } + + /** + * ListOperationsResponse operations. + * @member {Array.} operations + * @memberof google.longrunning.ListOperationsResponse + * @instance + */ + ListOperationsResponse.prototype.operations = $util.emptyArray; + + /** + * ListOperationsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.longrunning.ListOperationsResponse + * @instance + */ + ListOperationsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListOperationsResponse instance using the specified properties. + * @function create + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.IListOperationsResponse=} [properties] Properties to set + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse instance + */ + ListOperationsResponse.create = function create(properties) { + return new ListOperationsResponse(properties); + }; + + /** + * Encodes the specified ListOperationsResponse message. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @function encode + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.IListOperationsResponse} message ListOperationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOperationsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.operations != null && message.operations.length) + for (var i = 0; i < message.operations.length; ++i) + $root.google.longrunning.Operation.encode(message.operations[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListOperationsResponse message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.IListOperationsResponse} message ListOperationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOperationsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOperationsResponse.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.longrunning.ListOperationsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.operations && message.operations.length)) + message.operations = []; + message.operations.push($root.google.longrunning.Operation.decode(reader, reader.uint32())); + break; + case 2: + message.nextPageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOperationsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListOperationsResponse message. + * @function verify + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListOperationsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.operations != null && message.hasOwnProperty("operations")) { + if (!Array.isArray(message.operations)) + return "operations: array expected"; + for (var i = 0; i < message.operations.length; ++i) { + var error = $root.google.longrunning.Operation.verify(message.operations[i]); + if (error) + return "operations." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListOperationsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse + */ + ListOperationsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.ListOperationsResponse) + return object; + var message = new $root.google.longrunning.ListOperationsResponse(); + if (object.operations) { + if (!Array.isArray(object.operations)) + throw TypeError(".google.longrunning.ListOperationsResponse.operations: array expected"); + message.operations = []; + for (var i = 0; i < object.operations.length; ++i) { + if (typeof object.operations[i] !== "object") + throw TypeError(".google.longrunning.ListOperationsResponse.operations: object expected"); + message.operations[i] = $root.google.longrunning.Operation.fromObject(object.operations[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListOperationsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.ListOperationsResponse} message ListOperationsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListOperationsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.operations = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.operations && message.operations.length) { + object.operations = []; + for (var j = 0; j < message.operations.length; ++j) + object.operations[j] = $root.google.longrunning.Operation.toObject(message.operations[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListOperationsResponse to JSON. + * @function toJSON + * @memberof google.longrunning.ListOperationsResponse + * @instance + * @returns {Object.} JSON object + */ + ListOperationsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListOperationsResponse; + })(); + + longrunning.CancelOperationRequest = (function() { + + /** + * Properties of a CancelOperationRequest. + * @memberof google.longrunning + * @interface ICancelOperationRequest + * @property {string|null} [name] CancelOperationRequest name + */ + + /** + * Constructs a new CancelOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a CancelOperationRequest. + * @implements ICancelOperationRequest + * @constructor + * @param {google.longrunning.ICancelOperationRequest=} [properties] Properties to set + */ + function CancelOperationRequest(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]]; + } + + /** + * CancelOperationRequest name. + * @member {string} name + * @memberof google.longrunning.CancelOperationRequest + * @instance + */ + CancelOperationRequest.prototype.name = ""; + + /** + * Creates a new CancelOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.ICancelOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest instance + */ + CancelOperationRequest.create = function create(properties) { + return new CancelOperationRequest(properties); + }; + + /** + * Encodes the specified CancelOperationRequest message. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.ICancelOperationRequest} message CancelOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CancelOperationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified CancelOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.ICancelOperationRequest} message CancelOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CancelOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CancelOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CancelOperationRequest.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.longrunning.CancelOperationRequest(); + 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 CancelOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CancelOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CancelOperationRequest message. + * @function verify + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CancelOperationRequest.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 CancelOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest + */ + CancelOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.CancelOperationRequest) + return object; + var message = new $root.google.longrunning.CancelOperationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a CancelOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.CancelOperationRequest} message CancelOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CancelOperationRequest.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 CancelOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.CancelOperationRequest + * @instance + * @returns {Object.} JSON object + */ + CancelOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return CancelOperationRequest; + })(); + + longrunning.DeleteOperationRequest = (function() { + + /** + * Properties of a DeleteOperationRequest. + * @memberof google.longrunning + * @interface IDeleteOperationRequest + * @property {string|null} [name] DeleteOperationRequest name + */ + + /** + * Constructs a new DeleteOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a DeleteOperationRequest. + * @implements IDeleteOperationRequest + * @constructor + * @param {google.longrunning.IDeleteOperationRequest=} [properties] Properties to set + */ + function DeleteOperationRequest(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]]; + } + + /** + * DeleteOperationRequest name. + * @member {string} name + * @memberof google.longrunning.DeleteOperationRequest + * @instance + */ + DeleteOperationRequest.prototype.name = ""; + + /** + * Creates a new DeleteOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.IDeleteOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest instance + */ + DeleteOperationRequest.create = function create(properties) { + return new DeleteOperationRequest(properties); + }; + + /** + * Encodes the specified DeleteOperationRequest message. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.IDeleteOperationRequest} message DeleteOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteOperationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified DeleteOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.IDeleteOperationRequest} message DeleteOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteOperationRequest.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.longrunning.DeleteOperationRequest(); + 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 DeleteOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteOperationRequest message. + * @function verify + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteOperationRequest.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 DeleteOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest + */ + DeleteOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.DeleteOperationRequest) + return object; + var message = new $root.google.longrunning.DeleteOperationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.DeleteOperationRequest} message DeleteOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteOperationRequest.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 DeleteOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.DeleteOperationRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DeleteOperationRequest; + })(); + + longrunning.WaitOperationRequest = (function() { + + /** + * Properties of a WaitOperationRequest. + * @memberof google.longrunning + * @interface IWaitOperationRequest + * @property {string|null} [name] WaitOperationRequest name + * @property {google.protobuf.IDuration|null} [timeout] WaitOperationRequest timeout + */ + + /** + * Constructs a new WaitOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a WaitOperationRequest. + * @implements IWaitOperationRequest + * @constructor + * @param {google.longrunning.IWaitOperationRequest=} [properties] Properties to set + */ + function WaitOperationRequest(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]]; + } + + /** + * WaitOperationRequest name. + * @member {string} name + * @memberof google.longrunning.WaitOperationRequest + * @instance + */ + WaitOperationRequest.prototype.name = ""; + + /** + * WaitOperationRequest timeout. + * @member {google.protobuf.IDuration|null|undefined} timeout + * @memberof google.longrunning.WaitOperationRequest + * @instance + */ + WaitOperationRequest.prototype.timeout = null; + + /** + * Creates a new WaitOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.IWaitOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest instance + */ + WaitOperationRequest.create = function create(properties) { + return new WaitOperationRequest(properties); + }; + + /** + * Encodes the specified WaitOperationRequest message. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.IWaitOperationRequest} message WaitOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WaitOperationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.timeout != null && message.hasOwnProperty("timeout")) + $root.google.protobuf.Duration.encode(message.timeout, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified WaitOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.IWaitOperationRequest} message WaitOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WaitOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WaitOperationRequest.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.longrunning.WaitOperationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.timeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WaitOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WaitOperationRequest message. + * @function verify + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WaitOperationRequest.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.timeout != null && message.hasOwnProperty("timeout")) { + var error = $root.google.protobuf.Duration.verify(message.timeout); + if (error) + return "timeout." + error; + } + return null; + }; + + /** + * Creates a WaitOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest + */ + WaitOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.WaitOperationRequest) + return object; + var message = new $root.google.longrunning.WaitOperationRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.timeout != null) { + if (typeof object.timeout !== "object") + throw TypeError(".google.longrunning.WaitOperationRequest.timeout: object expected"); + message.timeout = $root.google.protobuf.Duration.fromObject(object.timeout); + } + return message; + }; + + /** + * Creates a plain object from a WaitOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.WaitOperationRequest} message WaitOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WaitOperationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.timeout = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.timeout != null && message.hasOwnProperty("timeout")) + object.timeout = $root.google.protobuf.Duration.toObject(message.timeout, options); + return object; + }; + + /** + * Converts this WaitOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.WaitOperationRequest + * @instance + * @returns {Object.} JSON object + */ + WaitOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return WaitOperationRequest; + })(); + + longrunning.OperationInfo = (function() { + + /** + * Properties of an OperationInfo. + * @memberof google.longrunning + * @interface IOperationInfo + * @property {string|null} [responseType] OperationInfo responseType + * @property {string|null} [metadataType] OperationInfo metadataType + */ + + /** + * Constructs a new OperationInfo. + * @memberof google.longrunning + * @classdesc Represents an OperationInfo. + * @implements IOperationInfo + * @constructor + * @param {google.longrunning.IOperationInfo=} [properties] Properties to set + */ + function OperationInfo(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]]; + } + + /** + * OperationInfo responseType. + * @member {string} responseType + * @memberof google.longrunning.OperationInfo + * @instance + */ + OperationInfo.prototype.responseType = ""; + + /** + * OperationInfo metadataType. + * @member {string} metadataType + * @memberof google.longrunning.OperationInfo + * @instance + */ + OperationInfo.prototype.metadataType = ""; + + /** + * Creates a new OperationInfo instance using the specified properties. + * @function create + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.IOperationInfo=} [properties] Properties to set + * @returns {google.longrunning.OperationInfo} OperationInfo instance + */ + OperationInfo.create = function create(properties) { + return new OperationInfo(properties); + }; + + /** + * Encodes the specified OperationInfo message. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @function encode + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.IOperationInfo} message OperationInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.responseType != null && message.hasOwnProperty("responseType")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.responseType); + if (message.metadataType != null && message.hasOwnProperty("metadataType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.metadataType); + return writer; + }; + + /** + * Encodes the specified OperationInfo message, length delimited. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.IOperationInfo} message OperationInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OperationInfo message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.OperationInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.OperationInfo} OperationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationInfo.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.longrunning.OperationInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.responseType = reader.string(); + break; + case 2: + message.metadataType = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OperationInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.OperationInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.OperationInfo} OperationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OperationInfo message. + * @function verify + * @memberof google.longrunning.OperationInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OperationInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.responseType != null && message.hasOwnProperty("responseType")) + if (!$util.isString(message.responseType)) + return "responseType: string expected"; + if (message.metadataType != null && message.hasOwnProperty("metadataType")) + if (!$util.isString(message.metadataType)) + return "metadataType: string expected"; + return null; + }; + + /** + * Creates an OperationInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.OperationInfo + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.OperationInfo} OperationInfo + */ + OperationInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.OperationInfo) + return object; + var message = new $root.google.longrunning.OperationInfo(); + if (object.responseType != null) + message.responseType = String(object.responseType); + if (object.metadataType != null) + message.metadataType = String(object.metadataType); + return message; + }; + + /** + * Creates a plain object from an OperationInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.OperationInfo} message OperationInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OperationInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.responseType = ""; + object.metadataType = ""; + } + if (message.responseType != null && message.hasOwnProperty("responseType")) + object.responseType = message.responseType; + if (message.metadataType != null && message.hasOwnProperty("metadataType")) + object.metadataType = message.metadataType; + return object; + }; + + /** + * Converts this OperationInfo to JSON. + * @function toJSON + * @memberof google.longrunning.OperationInfo + * @instance + * @returns {Object.} JSON object + */ + OperationInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return OperationInfo; + })(); + + return longrunning; + })(); + + google.rpc = (function() { + + /** + * Namespace rpc. + * @memberof google + * @namespace + */ + var rpc = {}; + + rpc.Status = (function() { + + /** + * Properties of a Status. + * @memberof google.rpc + * @interface IStatus + * @property {number|null} [code] Status code + * @property {string|null} [message] Status message + * @property {Array.|null} [details] Status details + */ + + /** + * Constructs a new Status. + * @memberof google.rpc + * @classdesc Represents a Status. + * @implements IStatus + * @constructor + * @param {google.rpc.IStatus=} [properties] Properties to set + */ + function Status(properties) { + this.details = []; + 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]]; + } + + /** + * Status code. + * @member {number} code + * @memberof google.rpc.Status + * @instance + */ + Status.prototype.code = 0; + + /** + * Status message. + * @member {string} message + * @memberof google.rpc.Status + * @instance + */ + Status.prototype.message = ""; + + /** + * Status details. + * @member {Array.} details + * @memberof google.rpc.Status + * @instance + */ + Status.prototype.details = $util.emptyArray; + + /** + * Creates a new Status instance using the specified properties. + * @function create + * @memberof google.rpc.Status + * @static + * @param {google.rpc.IStatus=} [properties] Properties to set + * @returns {google.rpc.Status} Status instance + */ + Status.create = function create(properties) { + return new Status(properties); + }; + + /** + * Encodes the specified Status message. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @function encode + * @memberof google.rpc.Status + * @static + * @param {google.rpc.IStatus} message Status message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Status.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.code != null && message.hasOwnProperty("code")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.code); + if (message.message != null && message.hasOwnProperty("message")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.message); + if (message.details != null && message.details.length) + for (var i = 0; i < message.details.length; ++i) + $root.google.protobuf.Any.encode(message.details[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Status message, length delimited. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @function encodeDelimited + * @memberof google.rpc.Status + * @static + * @param {google.rpc.IStatus} message Status message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Status.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Status message from the specified reader or buffer. + * @function decode + * @memberof google.rpc.Status + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.rpc.Status} Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Status.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.rpc.Status(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.code = reader.int32(); + break; + case 2: + message.message = reader.string(); + break; + case 3: + if (!(message.details && message.details.length)) + message.details = []; + message.details.push($root.google.protobuf.Any.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Status message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.rpc.Status + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.rpc.Status} Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Status.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Status message. + * @function verify + * @memberof google.rpc.Status + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Status.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.code != null && message.hasOwnProperty("code")) + if (!$util.isInteger(message.code)) + return "code: integer expected"; + if (message.message != null && message.hasOwnProperty("message")) + if (!$util.isString(message.message)) + return "message: string expected"; + if (message.details != null && message.hasOwnProperty("details")) { + if (!Array.isArray(message.details)) + return "details: array expected"; + for (var i = 0; i < message.details.length; ++i) { + var error = $root.google.protobuf.Any.verify(message.details[i]); + if (error) + return "details." + error; + } + } + return null; + }; + + /** + * Creates a Status message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.rpc.Status + * @static + * @param {Object.} object Plain object + * @returns {google.rpc.Status} Status + */ + Status.fromObject = function fromObject(object) { + if (object instanceof $root.google.rpc.Status) + return object; + var message = new $root.google.rpc.Status(); + if (object.code != null) + message.code = object.code | 0; + if (object.message != null) + message.message = String(object.message); + if (object.details) { + if (!Array.isArray(object.details)) + throw TypeError(".google.rpc.Status.details: array expected"); + message.details = []; + for (var i = 0; i < object.details.length; ++i) { + if (typeof object.details[i] !== "object") + throw TypeError(".google.rpc.Status.details: object expected"); + message.details[i] = $root.google.protobuf.Any.fromObject(object.details[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Status message. Also converts values to other types if specified. + * @function toObject + * @memberof google.rpc.Status + * @static + * @param {google.rpc.Status} message Status + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Status.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.details = []; + if (options.defaults) { + object.code = 0; + object.message = ""; + } + if (message.code != null && message.hasOwnProperty("code")) + object.code = message.code; + if (message.message != null && message.hasOwnProperty("message")) + object.message = message.message; + if (message.details && message.details.length) { + object.details = []; + for (var j = 0; j < message.details.length; ++j) + object.details[j] = $root.google.protobuf.Any.toObject(message.details[j], options); + } + return object; + }; + + /** + * Converts this Status to JSON. + * @function toJSON + * @memberof google.rpc.Status + * @instance + * @returns {Object.} JSON object + */ + Status.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Status; + })(); + + return rpc; + })(); + + return google; + })(); + + return $root; +}); diff --git a/packages/google-cloud-securitycenter/src/v1/doc/google/iam/v1/doc_policy.js b/packages/google-cloud-securitycenter/src/v1/doc/google/iam/v1/doc_policy.js index 2dbe3faa3a6..dd2654a99ba 100644 --- a/packages/google-cloud-securitycenter/src/v1/doc/google/iam/v1/doc_policy.js +++ b/packages/google-cloud-securitycenter/src/v1/doc/google/iam/v1/doc_policy.js @@ -20,27 +20,36 @@ * specify access control policies for Cloud Platform resources. * * - * A `Policy` consists of a list of `bindings`. A `binding` binds a list of - * `members` to a `role`, where the members can be user accounts, Google groups, - * Google domains, and service accounts. A `role` is a named list of permissions - * defined by IAM. + * A `Policy` is a collection of `bindings`. A `binding` binds one or more + * `members` to a single `role`. Members can be user accounts, service accounts, + * Google groups, and domains (such as G Suite). A `role` is a named list of + * permissions (defined by IAM or configured by users). A `binding` can + * optionally specify a `condition`, which is a logic expression that further + * constrains the role binding based on attributes about the request and/or + * target resource. * * **JSON Example** * * { * "bindings": [ * { - * "role": "roles/owner", + * "role": "role/resourcemanager.organizationAdmin", * "members": [ * "user:mike@example.com", * "group:admins@example.com", * "domain:google.com", - * "serviceAccount:my-other-app@appspot.gserviceaccount.com" + * "serviceAccount:my-project-id@appspot.gserviceaccount.com" * ] * }, * { - * "role": "roles/viewer", - * "members": ["user:sean@example.com"] + * "role": "roles/resourcemanager.organizationViewer", + * "members": ["user:eve@example.com"], + * "condition": { + * "title": "expirable access", + * "description": "Does not grant access after Sep 2020", + * "expression": "request.time < + * timestamp('2020-10-01T00:00:00.000Z')", + * } * } * ] * } @@ -52,12 +61,15 @@ * - user:mike@example.com * - group:admins@example.com * - domain:google.com - * - serviceAccount:my-other-app@appspot.gserviceaccount.com - * role: roles/owner + * - serviceAccount:my-project-id@appspot.gserviceaccount.com + * role: roles/resourcemanager.organizationAdmin * - members: - * - user:sean@example.com - * role: roles/viewer - * + * - user:eve@example.com + * role: roles/resourcemanager.organizationViewer + * condition: + * title: expirable access + * description: Does not grant access after Sep 2020 + * expression: request.time < timestamp('2020-10-01T00:00:00.000Z') * * For a description of IAM and its features, see the * [IAM developer's guide](https://cloud.google.com/iam/docs). @@ -68,12 +80,18 @@ * Valid values are 0, 1, and 3. Requests specifying an invalid value will be * rejected. * - * Policies with any conditional bindings must specify version 3. Policies - * without any conditional bindings may specify any valid value or leave the - * field unset. + * Operations affecting conditional bindings must specify version 3. This can + * be either setting a conditional policy, modifying a conditional binding, + * or removing a conditional binding from the stored conditional policy. + * Operations on non-conditional policies may specify any valid value or + * leave the field unset. + * + * If no etag is provided in the call to `setIamPolicy`, any version + * compliance checks on the incoming and/or stored policy is skipped. * * @property {Object[]} bindings - * Associates a list of `members` to a `role`. + * Associates a list of `members` to a `role`. Optionally may specify a + * `condition` that determines when binding is in effect. * `bindings` with no members will result in an error. * * This object should have the same structure as [Binding]{@link google.iam.v1.Binding} @@ -88,7 +106,9 @@ * ensure that their change will be applied to the same version of the policy. * * If no `etag` is provided in the call to `setIamPolicy`, then the existing - * policy is overwritten. + * policy is overwritten. Due to blind-set semantics of an etag-less policy, + * 'setIamPolicy' will not fail even if either of incoming or stored policy + * does not meet the version requirements. * * @typedef Policy * @memberof google.iam.v1 diff --git a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/iam/v1/doc_policy.js b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/iam/v1/doc_policy.js index 2dbe3faa3a6..dd2654a99ba 100644 --- a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/iam/v1/doc_policy.js +++ b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/iam/v1/doc_policy.js @@ -20,27 +20,36 @@ * specify access control policies for Cloud Platform resources. * * - * A `Policy` consists of a list of `bindings`. A `binding` binds a list of - * `members` to a `role`, where the members can be user accounts, Google groups, - * Google domains, and service accounts. A `role` is a named list of permissions - * defined by IAM. + * A `Policy` is a collection of `bindings`. A `binding` binds one or more + * `members` to a single `role`. Members can be user accounts, service accounts, + * Google groups, and domains (such as G Suite). A `role` is a named list of + * permissions (defined by IAM or configured by users). A `binding` can + * optionally specify a `condition`, which is a logic expression that further + * constrains the role binding based on attributes about the request and/or + * target resource. * * **JSON Example** * * { * "bindings": [ * { - * "role": "roles/owner", + * "role": "role/resourcemanager.organizationAdmin", * "members": [ * "user:mike@example.com", * "group:admins@example.com", * "domain:google.com", - * "serviceAccount:my-other-app@appspot.gserviceaccount.com" + * "serviceAccount:my-project-id@appspot.gserviceaccount.com" * ] * }, * { - * "role": "roles/viewer", - * "members": ["user:sean@example.com"] + * "role": "roles/resourcemanager.organizationViewer", + * "members": ["user:eve@example.com"], + * "condition": { + * "title": "expirable access", + * "description": "Does not grant access after Sep 2020", + * "expression": "request.time < + * timestamp('2020-10-01T00:00:00.000Z')", + * } * } * ] * } @@ -52,12 +61,15 @@ * - user:mike@example.com * - group:admins@example.com * - domain:google.com - * - serviceAccount:my-other-app@appspot.gserviceaccount.com - * role: roles/owner + * - serviceAccount:my-project-id@appspot.gserviceaccount.com + * role: roles/resourcemanager.organizationAdmin * - members: - * - user:sean@example.com - * role: roles/viewer - * + * - user:eve@example.com + * role: roles/resourcemanager.organizationViewer + * condition: + * title: expirable access + * description: Does not grant access after Sep 2020 + * expression: request.time < timestamp('2020-10-01T00:00:00.000Z') * * For a description of IAM and its features, see the * [IAM developer's guide](https://cloud.google.com/iam/docs). @@ -68,12 +80,18 @@ * Valid values are 0, 1, and 3. Requests specifying an invalid value will be * rejected. * - * Policies with any conditional bindings must specify version 3. Policies - * without any conditional bindings may specify any valid value or leave the - * field unset. + * Operations affecting conditional bindings must specify version 3. This can + * be either setting a conditional policy, modifying a conditional binding, + * or removing a conditional binding from the stored conditional policy. + * Operations on non-conditional policies may specify any valid value or + * leave the field unset. + * + * If no etag is provided in the call to `setIamPolicy`, any version + * compliance checks on the incoming and/or stored policy is skipped. * * @property {Object[]} bindings - * Associates a list of `members` to a `role`. + * Associates a list of `members` to a `role`. Optionally may specify a + * `condition` that determines when binding is in effect. * `bindings` with no members will result in an error. * * This object should have the same structure as [Binding]{@link google.iam.v1.Binding} @@ -88,7 +106,9 @@ * ensure that their change will be applied to the same version of the policy. * * If no `etag` is provided in the call to `setIamPolicy`, then the existing - * policy is overwritten. + * policy is overwritten. Due to blind-set semantics of an etag-less policy, + * 'setIamPolicy' will not fail even if either of incoming or stored policy + * does not meet the version requirements. * * @typedef Policy * @memberof google.iam.v1 diff --git a/packages/google-cloud-securitycenter/synth.metadata b/packages/google-cloud-securitycenter/synth.metadata index 7189b6bf0ff..ee5e40c7eae 100644 --- a/packages/google-cloud-securitycenter/synth.metadata +++ b/packages/google-cloud-securitycenter/synth.metadata @@ -1,19 +1,19 @@ { - "updateTime": "2019-08-31T11:17:38.289655Z", + "updateTime": "2019-09-20T11:23:04.653894Z", "sources": [ { "generator": { "name": "artman", - "version": "0.36.1", - "dockerImage": "googleapis/artman@sha256:7c20f006c7a62d9d782e2665647d52290c37a952ef3cd134624d5dd62b3f71bd" + "version": "0.36.3", + "dockerImage": "googleapis/artman@sha256:66ca01f27ef7dc50fbfb7743b67028115a6a8acf43b2d82f9fc826de008adac4" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "82809578652607c8ee29d9e199c21f28f81a03e0", - "internalRef": "266247326" + "sha": "44e588d97e7497dff01107d39b6a19062f9a4ffa", + "internalRef": "270200097" } }, { From 554f8df3679e5797282dc7641ae616f5f8dd7103 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Fri, 27 Sep 2019 10:17:57 -0700 Subject: [PATCH 101/342] docs(iam): update bindings example (#150) --- .../src/v1/doc/google/iam/v1/doc_policy.js | 2 +- .../src/v1beta1/doc/google/iam/v1/doc_policy.js | 2 +- packages/google-cloud-securitycenter/synth.metadata | 10 +++++----- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/packages/google-cloud-securitycenter/src/v1/doc/google/iam/v1/doc_policy.js b/packages/google-cloud-securitycenter/src/v1/doc/google/iam/v1/doc_policy.js index dd2654a99ba..57db8df60b1 100644 --- a/packages/google-cloud-securitycenter/src/v1/doc/google/iam/v1/doc_policy.js +++ b/packages/google-cloud-securitycenter/src/v1/doc/google/iam/v1/doc_policy.js @@ -33,7 +33,7 @@ * { * "bindings": [ * { - * "role": "role/resourcemanager.organizationAdmin", + * "role": "roles/resourcemanager.organizationAdmin", * "members": [ * "user:mike@example.com", * "group:admins@example.com", diff --git a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/iam/v1/doc_policy.js b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/iam/v1/doc_policy.js index dd2654a99ba..57db8df60b1 100644 --- a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/iam/v1/doc_policy.js +++ b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/iam/v1/doc_policy.js @@ -33,7 +33,7 @@ * { * "bindings": [ * { - * "role": "role/resourcemanager.organizationAdmin", + * "role": "roles/resourcemanager.organizationAdmin", * "members": [ * "user:mike@example.com", * "group:admins@example.com", diff --git a/packages/google-cloud-securitycenter/synth.metadata b/packages/google-cloud-securitycenter/synth.metadata index ee5e40c7eae..f0df2eae551 100644 --- a/packages/google-cloud-securitycenter/synth.metadata +++ b/packages/google-cloud-securitycenter/synth.metadata @@ -1,19 +1,19 @@ { - "updateTime": "2019-09-20T11:23:04.653894Z", + "updateTime": "2019-09-27T11:26:01.232452Z", "sources": [ { "generator": { "name": "artman", - "version": "0.36.3", - "dockerImage": "googleapis/artman@sha256:66ca01f27ef7dc50fbfb7743b67028115a6a8acf43b2d82f9fc826de008adac4" + "version": "0.37.1", + "dockerImage": "googleapis/artman@sha256:6068f67900a3f0bdece596b97bda8fc70406ca0e137a941f4c81d3217c994a80" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "44e588d97e7497dff01107d39b6a19062f9a4ffa", - "internalRef": "270200097" + "sha": "cd112d8d255e0099df053643d4bd12c228ef7b1b", + "internalRef": "271468707" } }, { From ef286ac6c9a63ea583e40035696d800c149bc892 Mon Sep 17 00:00:00 2001 From: Alexander Fenster Date: Wed, 2 Oct 2019 01:09:50 -0700 Subject: [PATCH 102/342] fix: use compatible version of google-gax * fix: use compatible version of google-gax * fix: use gax v1.6.3 --- packages/google-cloud-securitycenter/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-securitycenter/package.json b/packages/google-cloud-securitycenter/package.json index 0c18b7d9bbf..7bc523b470d 100644 --- a/packages/google-cloud-securitycenter/package.json +++ b/packages/google-cloud-securitycenter/package.json @@ -39,7 +39,7 @@ "predocs-test": "npm run docs" }, "dependencies": { - "google-gax": "^1.0.0", + "google-gax": "^1.6.3", "protobufjs": "^6.8.0" }, "devDependencies": { From c9b3c39266d5770096deadf7fe109c914f12502e Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Mon, 7 Oct 2019 16:48:28 -0700 Subject: [PATCH 103/342] chore: update pull request template --- packages/google-cloud-securitycenter/synth.metadata | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/google-cloud-securitycenter/synth.metadata b/packages/google-cloud-securitycenter/synth.metadata index f0df2eae551..6bc491803f9 100644 --- a/packages/google-cloud-securitycenter/synth.metadata +++ b/packages/google-cloud-securitycenter/synth.metadata @@ -1,5 +1,5 @@ { - "updateTime": "2019-09-27T11:26:01.232452Z", + "updateTime": "2019-10-01T11:29:57.164484Z", "sources": [ { "generator": { @@ -12,8 +12,8 @@ "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "cd112d8d255e0099df053643d4bd12c228ef7b1b", - "internalRef": "271468707" + "sha": "ce3c574d1266026cebea3a893247790bd68191c2", + "internalRef": "272147209" } }, { From b741339895e02e8382c4ccb7c9e509fe8c1e6f76 Mon Sep 17 00:00:00 2001 From: "Benjamin E. Coe" Date: Tue, 8 Oct 2019 18:09:47 -0700 Subject: [PATCH 104/342] chore: update CONTRIBUTING.md and make releaseType node (#157) --- packages/google-cloud-securitycenter/CONTRIBUTING.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/packages/google-cloud-securitycenter/CONTRIBUTING.md b/packages/google-cloud-securitycenter/CONTRIBUTING.md index 78aaa61b269..f6c4cf010e3 100644 --- a/packages/google-cloud-securitycenter/CONTRIBUTING.md +++ b/packages/google-cloud-securitycenter/CONTRIBUTING.md @@ -34,6 +34,7 @@ accept your pull requests. 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. ## Running the tests @@ -46,8 +47,17 @@ accept your pull requests. 1. Run the tests: + # Run unit tests. npm test + # Run sample integration tests. + gcloud auth application-default login + npm run samples-test + + # Run all system tests. + gcloud auth application-default login + npm run system-test + 1. Lint (and maybe fix) any changes: npm run fix From 5ecca023b832862406da52f74fe56e45f6a1c255 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Fri, 11 Oct 2019 21:25:10 -0700 Subject: [PATCH 105/342] chore: release 2.2.0 (#149) * updated CHANGELOG.md [ci skip] * updated package.json [ci skip] * updated samples/package.json [ci skip] --- packages/google-cloud-securitycenter/CHANGELOG.md | 12 ++++++++++++ packages/google-cloud-securitycenter/package.json | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/packages/google-cloud-securitycenter/CHANGELOG.md b/packages/google-cloud-securitycenter/CHANGELOG.md index daec367e068..fc27166bea8 100644 --- a/packages/google-cloud-securitycenter/CHANGELOG.md +++ b/packages/google-cloud-securitycenter/CHANGELOG.md @@ -4,6 +4,18 @@ [1]: https://www.npmjs.com/package/@google-cloud/security-center?activeTab=versions +## [2.2.0](https://www.github.com/googleapis/nodejs-security-center/compare/v2.1.0...v2.2.0) (2019-10-09) + + +### Bug Fixes + +* use compatible version of google-gax ([e85bac4](https://www.github.com/googleapis/nodejs-security-center/commit/e85bac4)) + + +### Features + +* .d.ts for protos ([#148](https://www.github.com/googleapis/nodejs-security-center/issues/148)) ([f10a7ab](https://www.github.com/googleapis/nodejs-security-center/commit/f10a7ab)) + ## [2.1.0](https://www.github.com/googleapis/nodejs-security-center/compare/v2.0.1...v2.1.0) (2019-09-06) diff --git a/packages/google-cloud-securitycenter/package.json b/packages/google-cloud-securitycenter/package.json index 7bc523b470d..293976a0ec0 100644 --- a/packages/google-cloud-securitycenter/package.json +++ b/packages/google-cloud-securitycenter/package.json @@ -1,7 +1,7 @@ { "name": "@google-cloud/security-center", "description": "Cloud Security Command Center API client for Node.js", - "version": "2.1.0", + "version": "2.2.0", "license": "Apache-2.0", "author": "Google LLC", "engines": { From c98f8b56ec984d64fb4d349fbcbc2c9061a0de94 Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Mon, 21 Oct 2019 18:13:39 -0700 Subject: [PATCH 106/342] fix(deps): bump google-gax to 1.7.5 (#158) --- packages/google-cloud-securitycenter/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-securitycenter/package.json b/packages/google-cloud-securitycenter/package.json index 293976a0ec0..3bd963c7245 100644 --- a/packages/google-cloud-securitycenter/package.json +++ b/packages/google-cloud-securitycenter/package.json @@ -39,7 +39,7 @@ "predocs-test": "npm run docs" }, "dependencies": { - "google-gax": "^1.6.3", + "google-gax": "^1.7.5", "protobufjs": "^6.8.0" }, "devDependencies": { From 0cf72a7810866eab62f3edff13f666a10ba97331 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 22 Oct 2019 13:31:38 -0700 Subject: [PATCH 107/342] chore: release 2.2.1 (#159) --- packages/google-cloud-securitycenter/CHANGELOG.md | 7 +++++++ packages/google-cloud-securitycenter/package.json | 2 +- packages/google-cloud-securitycenter/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-securitycenter/CHANGELOG.md b/packages/google-cloud-securitycenter/CHANGELOG.md index fc27166bea8..1bae3f805f1 100644 --- a/packages/google-cloud-securitycenter/CHANGELOG.md +++ b/packages/google-cloud-securitycenter/CHANGELOG.md @@ -4,6 +4,13 @@ [1]: https://www.npmjs.com/package/@google-cloud/security-center?activeTab=versions +### [2.2.1](https://www.github.com/googleapis/nodejs-security-center/compare/v2.2.0...v2.2.1) (2019-10-22) + + +### Bug Fixes + +* **deps:** bump google-gax to 1.7.5 ([#158](https://www.github.com/googleapis/nodejs-security-center/issues/158)) ([16d27c8](https://www.github.com/googleapis/nodejs-security-center/commit/16d27c87ce951546163dd1e8a16e57daf2877093)) + ## [2.2.0](https://www.github.com/googleapis/nodejs-security-center/compare/v2.1.0...v2.2.0) (2019-10-09) diff --git a/packages/google-cloud-securitycenter/package.json b/packages/google-cloud-securitycenter/package.json index 3bd963c7245..ce8ad4b766b 100644 --- a/packages/google-cloud-securitycenter/package.json +++ b/packages/google-cloud-securitycenter/package.json @@ -1,7 +1,7 @@ { "name": "@google-cloud/security-center", "description": "Cloud Security Command Center API client for Node.js", - "version": "2.2.0", + "version": "2.2.1", "license": "Apache-2.0", "author": "Google LLC", "engines": { diff --git a/packages/google-cloud-securitycenter/samples/package.json b/packages/google-cloud-securitycenter/samples/package.json index 39cd9495ce8..bd4a2a187ba 100644 --- a/packages/google-cloud-securitycenter/samples/package.json +++ b/packages/google-cloud-securitycenter/samples/package.json @@ -9,7 +9,7 @@ }, "license": "Apache-2.0", "dependencies": { - "@google-cloud/security-center": "^2.1.0" + "@google-cloud/security-center": "^2.2.1" }, "devDependencies": { "chai": "^4.2.0", From 166c19bd08b983478c32a8f5887b31752a337fdc Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Fri, 1 Nov 2019 12:45:25 -0700 Subject: [PATCH 108/342] test: don't exclude src/ in coverage --- packages/google-cloud-securitycenter/.nycrc | 1 - packages/google-cloud-securitycenter/synth.metadata | 12 ++++++------ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/packages/google-cloud-securitycenter/.nycrc b/packages/google-cloud-securitycenter/.nycrc index 23e322204ec..367688844eb 100644 --- a/packages/google-cloud-securitycenter/.nycrc +++ b/packages/google-cloud-securitycenter/.nycrc @@ -10,7 +10,6 @@ "**/docs", "**/samples", "**/scripts", - "**/src/**/v*/**/*.js", "**/protos", "**/test", ".jsdoc.js", diff --git a/packages/google-cloud-securitycenter/synth.metadata b/packages/google-cloud-securitycenter/synth.metadata index 6bc491803f9..ac17c6260db 100644 --- a/packages/google-cloud-securitycenter/synth.metadata +++ b/packages/google-cloud-securitycenter/synth.metadata @@ -1,26 +1,26 @@ { - "updateTime": "2019-10-01T11:29:57.164484Z", + "updateTime": "2019-11-01T19:19:57.284036Z", "sources": [ { "generator": { "name": "artman", - "version": "0.37.1", - "dockerImage": "googleapis/artman@sha256:6068f67900a3f0bdece596b97bda8fc70406ca0e137a941f4c81d3217c994a80" + "version": "0.41.0", + "dockerImage": "googleapis/artman@sha256:75b38a3b073a7b243545f2332463096624c802bb1e56b8cb6f22ba1ecd325fa9" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "ce3c574d1266026cebea3a893247790bd68191c2", - "internalRef": "272147209" + "sha": "bba93d7148ff203d400a4929cd0fbc7dafd8dae2", + "internalRef": "277920288" } }, { "template": { "name": "node_library", "origin": "synthtool.gcp", - "version": "2019.5.2" + "version": "2019.10.17" } } ], From 212ec1def2affc5cd16b23abc7a1015316652136 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Wed, 13 Nov 2019 12:38:01 -0800 Subject: [PATCH 109/342] fix: import long into proto ts declaration file (#167) --- .../google-cloud-securitycenter/protos/protos.d.ts | 1 + .../src/v1/doc/google/iam/v1/doc_policy.js | 11 ++++++----- .../src/v1beta1/doc/google/iam/v1/doc_policy.js | 11 ++++++----- packages/google-cloud-securitycenter/synth.metadata | 10 +++++----- 4 files changed, 18 insertions(+), 15 deletions(-) diff --git a/packages/google-cloud-securitycenter/protos/protos.d.ts b/packages/google-cloud-securitycenter/protos/protos.d.ts index 9920dec9be4..41618aca954 100644 --- a/packages/google-cloud-securitycenter/protos/protos.d.ts +++ b/packages/google-cloud-securitycenter/protos/protos.d.ts @@ -1,3 +1,4 @@ +import * as Long from "long"; import * as $protobuf from "protobufjs"; /** Namespace google. */ export namespace google { diff --git a/packages/google-cloud-securitycenter/src/v1/doc/google/iam/v1/doc_policy.js b/packages/google-cloud-securitycenter/src/v1/doc/google/iam/v1/doc_policy.js index 57db8df60b1..606cdf98cad 100644 --- a/packages/google-cloud-securitycenter/src/v1/doc/google/iam/v1/doc_policy.js +++ b/packages/google-cloud-securitycenter/src/v1/doc/google/iam/v1/doc_policy.js @@ -82,12 +82,13 @@ * * Operations affecting conditional bindings must specify version 3. This can * be either setting a conditional policy, modifying a conditional binding, - * or removing a conditional binding from the stored conditional policy. + * or removing a binding (conditional or unconditional) from the stored + * conditional policy. * Operations on non-conditional policies may specify any valid value or * leave the field unset. * - * If no etag is provided in the call to `setIamPolicy`, any version - * compliance checks on the incoming and/or stored policy is skipped. + * If no etag is provided in the call to `setIamPolicy`, version compliance + * checks against the stored policy is skipped. * * @property {Object[]} bindings * Associates a list of `members` to a `role`. Optionally may specify a @@ -107,8 +108,8 @@ * * If no `etag` is provided in the call to `setIamPolicy`, then the existing * policy is overwritten. Due to blind-set semantics of an etag-less policy, - * 'setIamPolicy' will not fail even if either of incoming or stored policy - * does not meet the version requirements. + * 'setIamPolicy' will not fail even if the incoming policy version does not + * meet the requirements for modifying the stored policy. * * @typedef Policy * @memberof google.iam.v1 diff --git a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/iam/v1/doc_policy.js b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/iam/v1/doc_policy.js index 57db8df60b1..606cdf98cad 100644 --- a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/iam/v1/doc_policy.js +++ b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/iam/v1/doc_policy.js @@ -82,12 +82,13 @@ * * Operations affecting conditional bindings must specify version 3. This can * be either setting a conditional policy, modifying a conditional binding, - * or removing a conditional binding from the stored conditional policy. + * or removing a binding (conditional or unconditional) from the stored + * conditional policy. * Operations on non-conditional policies may specify any valid value or * leave the field unset. * - * If no etag is provided in the call to `setIamPolicy`, any version - * compliance checks on the incoming and/or stored policy is skipped. + * If no etag is provided in the call to `setIamPolicy`, version compliance + * checks against the stored policy is skipped. * * @property {Object[]} bindings * Associates a list of `members` to a `role`. Optionally may specify a @@ -107,8 +108,8 @@ * * If no `etag` is provided in the call to `setIamPolicy`, then the existing * policy is overwritten. Due to blind-set semantics of an etag-less policy, - * 'setIamPolicy' will not fail even if either of incoming or stored policy - * does not meet the version requirements. + * 'setIamPolicy' will not fail even if the incoming policy version does not + * meet the requirements for modifying the stored policy. * * @typedef Policy * @memberof google.iam.v1 diff --git a/packages/google-cloud-securitycenter/synth.metadata b/packages/google-cloud-securitycenter/synth.metadata index ac17c6260db..e26395b0333 100644 --- a/packages/google-cloud-securitycenter/synth.metadata +++ b/packages/google-cloud-securitycenter/synth.metadata @@ -1,19 +1,19 @@ { - "updateTime": "2019-11-01T19:19:57.284036Z", + "updateTime": "2019-11-12T12:24:06.540194Z", "sources": [ { "generator": { "name": "artman", - "version": "0.41.0", - "dockerImage": "googleapis/artman@sha256:75b38a3b073a7b243545f2332463096624c802bb1e56b8cb6f22ba1ecd325fa9" + "version": "0.41.1", + "dockerImage": "googleapis/artman@sha256:545c758c76c3f779037aa259023ec3d1ef2d57d2c8cd00a222cb187d63ceac5e" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "bba93d7148ff203d400a4929cd0fbc7dafd8dae2", - "internalRef": "277920288" + "sha": "f69562be0608904932bdcfbc5ad8b9a22d9dceb8", + "internalRef": "279774957" } }, { From 66bc27f9f962441b56933d6db6a394962f5c811d Mon Sep 17 00:00:00 2001 From: "Benjamin E. Coe" Date: Wed, 13 Nov 2019 14:51:17 -0800 Subject: [PATCH 110/342] fix(docs): snippets are now replaced in jsdoc comments (#166) --- packages/google-cloud-securitycenter/.jsdoc.js | 3 ++- packages/google-cloud-securitycenter/package.json | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/google-cloud-securitycenter/.jsdoc.js b/packages/google-cloud-securitycenter/.jsdoc.js index f852daaa0ad..2291bf4a37d 100644 --- a/packages/google-cloud-securitycenter/.jsdoc.js +++ b/packages/google-cloud-securitycenter/.jsdoc.js @@ -26,7 +26,8 @@ module.exports = { destination: './docs/' }, plugins: [ - 'plugins/markdown' + 'plugins/markdown', + 'jsdoc-region-tag' ], source: { excludePattern: '(^|\\/|\\\\)[._]', diff --git a/packages/google-cloud-securitycenter/package.json b/packages/google-cloud-securitycenter/package.json index ce8ad4b766b..ae6e498cc93 100644 --- a/packages/google-cloud-securitycenter/package.json +++ b/packages/google-cloud-securitycenter/package.json @@ -51,6 +51,7 @@ "intelli-espower-loader": "^1.0.1", "jsdoc": "^3.6.2", "jsdoc-fresh": "^1.0.1", + "jsdoc-region-tag": "^1.0.2", "linkinator": "^1.5.0", "mocha": "^6.0.0", "nyc": "^14.0.0", From 015f9849e088ebb11c9d4aa4a57c49e5e8db261a Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Thu, 14 Nov 2019 19:43:01 -0800 Subject: [PATCH 111/342] chore: add license header to protos.d.ts (#169) --- .../google-cloud-securitycenter/protos/protos.d.ts | 14 ++++++++++++++ .../google-cloud-securitycenter/synth.metadata | 6 +++--- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/packages/google-cloud-securitycenter/protos/protos.d.ts b/packages/google-cloud-securitycenter/protos/protos.d.ts index 41618aca954..5f5b80dbd7f 100644 --- a/packages/google-cloud-securitycenter/protos/protos.d.ts +++ b/packages/google-cloud-securitycenter/protos/protos.d.ts @@ -1,3 +1,17 @@ +// Copyright 2019 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + import * as Long from "long"; import * as $protobuf from "protobufjs"; /** Namespace google. */ diff --git a/packages/google-cloud-securitycenter/synth.metadata b/packages/google-cloud-securitycenter/synth.metadata index e26395b0333..bd95f9fd497 100644 --- a/packages/google-cloud-securitycenter/synth.metadata +++ b/packages/google-cloud-securitycenter/synth.metadata @@ -1,5 +1,5 @@ { - "updateTime": "2019-11-12T12:24:06.540194Z", + "updateTime": "2019-11-14T12:23:31.997026Z", "sources": [ { "generator": { @@ -12,8 +12,8 @@ "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "f69562be0608904932bdcfbc5ad8b9a22d9dceb8", - "internalRef": "279774957" + "sha": "4f747bda9b099b4426f495985680d16d0227fa5f", + "internalRef": "280394936" } }, { From dc382ff3b7d3e891d3ebb0b0f8da1ee4ae69fd37 Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Fri, 15 Nov 2019 11:14:43 -0800 Subject: [PATCH 112/342] fix(docs): bump release level to GA (#171) --- .../.repo-metadata.json | 4 ++-- packages/google-cloud-securitycenter/README.md | 11 ++++++----- .../google-cloud-securitycenter/protos/protos.js | 14 ++++++++++++++ .../google-cloud-securitycenter/synth.metadata | 6 +++--- 4 files changed, 25 insertions(+), 10 deletions(-) diff --git a/packages/google-cloud-securitycenter/.repo-metadata.json b/packages/google-cloud-securitycenter/.repo-metadata.json index d632c7f4cc2..44f54d2dab8 100644 --- a/packages/google-cloud-securitycenter/.repo-metadata.json +++ b/packages/google-cloud-securitycenter/.repo-metadata.json @@ -4,10 +4,10 @@ "product_documentation": "https://cloud.google.com/security-command-center", "client_documentation": "https://googleapis.dev/nodejs/security-center/latest", "issue_tracker": "https://issuetracker.google.com/savedsearches/559748", - "release_level": "beta", + "release_level": "ga", "language": "nodejs", "repo": "googleapis/nodejs-security-center", "distribution_name": "@google-cloud/security-center", "api_id": "securitycenter.googleapis.com", "requires_billing": true -} \ No newline at end of file +} diff --git a/packages/google-cloud-securitycenter/README.md b/packages/google-cloud-securitycenter/README.md index 61a70ed5ddc..0e9c4d6982f 100644 --- a/packages/google-cloud-securitycenter/README.md +++ b/packages/google-cloud-securitycenter/README.md @@ -4,7 +4,7 @@ # [Google Cloud Security Command Center: Node.js Client](https://github.com/googleapis/nodejs-security-center) -[![release level](https://img.shields.io/badge/release%20level-beta-yellow.svg?style=flat)](https://cloud.google.com/terms/launch-stages) +[![release level](https://img.shields.io/badge/release%20level-general%20availability%20%28GA%29-brightgreen.svg?style=flat)](https://cloud.google.com/terms/launch-stages) [![npm version](https://img.shields.io/npm/v/@google-cloud/security-center.svg)](https://www.npmjs.org/package/@google-cloud/security-center) [![codecov](https://img.shields.io/codecov/c/github/googleapis/nodejs-security-center/master.svg?style=flat)](https://codecov.io/gh/googleapis/nodejs-security-center) @@ -104,11 +104,12 @@ also contains samples. This library follows [Semantic Versioning](http://semver.org/). +This library is considered to be **General Availability (GA)**. This means it +is stable; the code surface will not change in backwards-incompatible ways +unless absolutely necessary (e.g. because of critical security issues) or with +an extensive deprecation period. Issues and requests against **GA** libraries +are addressed with the highest priority. -This library is considered to be in **beta**. This means it is expected to be -mostly stable while we work toward a general availability release; however, -complete stability is not guaranteed. We will address issues and requests -against beta libraries with a high priority. diff --git a/packages/google-cloud-securitycenter/protos/protos.js b/packages/google-cloud-securitycenter/protos/protos.js index 134c4db0f33..63f907ba61d 100644 --- a/packages/google-cloud-securitycenter/protos/protos.js +++ b/packages/google-cloud-securitycenter/protos/protos.js @@ -1,3 +1,17 @@ +// Copyright 2019 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + /*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 */ diff --git a/packages/google-cloud-securitycenter/synth.metadata b/packages/google-cloud-securitycenter/synth.metadata index bd95f9fd497..fbef87f92f8 100644 --- a/packages/google-cloud-securitycenter/synth.metadata +++ b/packages/google-cloud-securitycenter/synth.metadata @@ -1,5 +1,5 @@ { - "updateTime": "2019-11-14T12:23:31.997026Z", + "updateTime": "2019-11-15T03:45:57.191048Z", "sources": [ { "generator": { @@ -12,8 +12,8 @@ "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "4f747bda9b099b4426f495985680d16d0227fa5f", - "internalRef": "280394936" + "sha": "1935fb8889686f5c9d107f11b3c6870fc3aa7cdc", + "internalRef": "280451656" } }, { From ffcbe0ef47b50eec836ce4563642f9cb6f24a6fe Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Fri, 15 Nov 2019 12:17:54 -0800 Subject: [PATCH 113/342] chore: release 2.2.2 (#168) --- packages/google-cloud-securitycenter/CHANGELOG.md | 9 +++++++++ packages/google-cloud-securitycenter/package.json | 2 +- .../google-cloud-securitycenter/samples/package.json | 2 +- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-securitycenter/CHANGELOG.md b/packages/google-cloud-securitycenter/CHANGELOG.md index 1bae3f805f1..0aebeed42e5 100644 --- a/packages/google-cloud-securitycenter/CHANGELOG.md +++ b/packages/google-cloud-securitycenter/CHANGELOG.md @@ -4,6 +4,15 @@ [1]: https://www.npmjs.com/package/@google-cloud/security-center?activeTab=versions +### [2.2.2](https://www.github.com/googleapis/nodejs-security-center/compare/v2.2.1...v2.2.2) (2019-11-15) + + +### Bug Fixes + +* import long into proto ts declaration file ([#167](https://www.github.com/googleapis/nodejs-security-center/issues/167)) ([8548ae2](https://www.github.com/googleapis/nodejs-security-center/commit/8548ae2d620a690dcaa2f270c35c91745c37329f)) +* **docs:** bump release level to GA ([#171](https://www.github.com/googleapis/nodejs-security-center/issues/171)) ([8169088](https://www.github.com/googleapis/nodejs-security-center/commit/81690887c934e3a06ca82dd8850d47a74e4ad1c9)) +* **docs:** snippets are now replaced in jsdoc comments ([#166](https://www.github.com/googleapis/nodejs-security-center/issues/166)) ([c2d6f93](https://www.github.com/googleapis/nodejs-security-center/commit/c2d6f93c360bcb44ac095dea23c3191f3d5a4e2b)) + ### [2.2.1](https://www.github.com/googleapis/nodejs-security-center/compare/v2.2.0...v2.2.1) (2019-10-22) diff --git a/packages/google-cloud-securitycenter/package.json b/packages/google-cloud-securitycenter/package.json index ae6e498cc93..ec82fb2508a 100644 --- a/packages/google-cloud-securitycenter/package.json +++ b/packages/google-cloud-securitycenter/package.json @@ -1,7 +1,7 @@ { "name": "@google-cloud/security-center", "description": "Cloud Security Command Center API client for Node.js", - "version": "2.2.1", + "version": "2.2.2", "license": "Apache-2.0", "author": "Google LLC", "engines": { diff --git a/packages/google-cloud-securitycenter/samples/package.json b/packages/google-cloud-securitycenter/samples/package.json index bd4a2a187ba..52f3add663c 100644 --- a/packages/google-cloud-securitycenter/samples/package.json +++ b/packages/google-cloud-securitycenter/samples/package.json @@ -9,7 +9,7 @@ }, "license": "Apache-2.0", "dependencies": { - "@google-cloud/security-center": "^2.2.1" + "@google-cloud/security-center": "^2.2.2" }, "devDependencies": { "chai": "^4.2.0", From 1589e27ec5c531dc1199f724c885289f66a533e0 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Fri, 22 Nov 2019 13:12:48 -0800 Subject: [PATCH 114/342] feat: support resource descriptors (#174) --- .../protos/protos.d.ts | 248 ++++++ .../protos/protos.js | 765 +++++++++++++++++- .../protos/protos.json | 114 ++- .../synth.metadata | 10 +- 4 files changed, 1123 insertions(+), 14 deletions(-) diff --git a/packages/google-cloud-securitycenter/protos/protos.d.ts b/packages/google-cloud-securitycenter/protos/protos.d.ts index 5f5b80dbd7f..186c0a77015 100644 --- a/packages/google-cloud-securitycenter/protos/protos.d.ts +++ b/packages/google-cloud-securitycenter/protos/protos.d.ts @@ -7693,6 +7693,242 @@ export namespace google { */ public toJSON(): { [k: string]: any }; } + + /** FieldBehavior enum. */ + enum FieldBehavior { + FIELD_BEHAVIOR_UNSPECIFIED = 0, + OPTIONAL = 1, + REQUIRED = 2, + OUTPUT_ONLY = 3, + INPUT_ONLY = 4, + IMMUTABLE = 5 + } + + /** 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|null); + + /** ResourceDescriptor plural */ + plural?: (string|null); + + /** ResourceDescriptor singular */ + singular?: (string|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; + + /** ResourceDescriptor plural. */ + public plural: string; + + /** ResourceDescriptor singular. */ + public singular: string; + + /** + * 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 }; + } + + namespace ResourceDescriptor { + + /** History enum. */ + enum History { + HISTORY_UNSPECIFIED = 0, + ORIGINALLY_SINGLE_PATTERN = 1, + FUTURE_MULTI_PATTERN = 2 + } + } + + /** 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 }; + } } /** Namespace protobuf. */ @@ -9253,6 +9489,9 @@ export namespace google { /** FileOptions uninterpretedOption */ uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** FileOptions .google.api.resourceDefinition */ + ".google.api.resourceDefinition"?: (google.api.IResourceDescriptor[]|null); } /** Represents a FileOptions. */ @@ -9425,6 +9664,9 @@ export namespace google { /** MessageOptions uninterpretedOption */ uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** MessageOptions .google.api.resource */ + ".google.api.resource"?: (google.api.IResourceDescriptor|null); } /** Represents a MessageOptions. */ @@ -9545,6 +9787,12 @@ export namespace google { /** 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. */ diff --git a/packages/google-cloud-securitycenter/protos/protos.js b/packages/google-cloud-securitycenter/protos/protos.js index 63f907ba61d..bc5292fa10f 100644 --- a/packages/google-cloud-securitycenter/protos/protos.js +++ b/packages/google-cloud-securitycenter/protos/protos.js @@ -18316,6 +18316,587 @@ return CustomHttpPattern; })(); + /** + * FieldBehavior enum. + * @name google.api.FieldBehavior + * @enum {string} + * @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 + */ + 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; + 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 + */ + + /** + * 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 = []; + 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 = ""; + + /** + * 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 && message.hasOwnProperty("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 && message.hasOwnProperty("nameField")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.nameField); + if (message.history != null && message.hasOwnProperty("history")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.history); + if (message.plural != null && message.hasOwnProperty("plural")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.plural); + if (message.singular != null && message.hasOwnProperty("singular")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.singular); + 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; + 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"; + 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) { + 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); + 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 = []; + 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] : message.history; + if (message.plural != null && message.hasOwnProperty("plural")) + object.plural = message.plural; + if (message.singular != null && message.hasOwnProperty("singular")) + object.singular = message.singular; + 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); + }; + + /** + * History enum. + * @name google.api.ResourceDescriptor.History + * @enum {string} + * @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; + })(); + + 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 && message.hasOwnProperty("type")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); + if (message.childType != null && message.hasOwnProperty("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); + }; + + return ResourceReference; + })(); + return api; })(); @@ -22487,6 +23068,7 @@ * @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 */ /** @@ -22499,6 +23081,7 @@ */ 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) @@ -22673,6 +23256,14 @@ */ 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 @@ -22740,6 +23331,9 @@ 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; }; @@ -22839,6 +23433,11 @@ 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; @@ -22949,6 +23548,15 @@ 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; }; @@ -23026,6 +23634,16 @@ 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; }; @@ -23042,8 +23660,10 @@ if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) + if (options.arrays || options.defaults) { object.uninterpretedOption = []; + object[".google.api.resourceDefinition"] = []; + } if (options.defaults) { object.javaPackage = ""; object.javaOuterClassname = ""; @@ -23111,6 +23731,11 @@ 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; }; @@ -23155,6 +23780,7 @@ * @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 */ /** @@ -23213,6 +23839,14 @@ */ 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 @@ -23248,6 +23882,8 @@ 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 && message.hasOwnProperty(".google.api.resource")) + $root.google.api.ResourceDescriptor.encode(message[".google.api.resource"], writer.uint32(/* id 1053, wireType 2 =*/8426).fork()).ldelim(); return writer; }; @@ -23299,6 +23935,9 @@ 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; @@ -23355,6 +23994,11 @@ 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; }; @@ -23388,6 +24032,11 @@ 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; }; @@ -23411,6 +24060,7 @@ 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; @@ -23425,6 +24075,8 @@ 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; }; @@ -23455,6 +24107,8 @@ * @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 */ /** @@ -23467,6 +24121,7 @@ */ 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) @@ -23529,6 +24184,22 @@ */ 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 @@ -23568,6 +24239,14 @@ 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 && message.hasOwnProperty(".google.api.resourceReference")) + $root.google.api.ResourceReference.encode(message[".google.api.resourceReference"], writer.uint32(/* id 1055, wireType 2 =*/8442).fork()).ldelim(); return writer; }; @@ -23625,6 +24304,19 @@ 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; @@ -23699,6 +24391,27 @@ 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: + 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; }; @@ -23760,6 +24473,44 @@ 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: + 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; + } + } + 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; }; @@ -23776,8 +24527,10 @@ if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) + if (options.arrays || options.defaults) { object.uninterpretedOption = []; + object[".google.api.fieldBehavior"] = []; + } if (options.defaults) { object.ctype = options.enums === String ? "STRING" : 0; object.packed = false; @@ -23785,6 +24538,7 @@ object.lazy = false; object.jstype = options.enums === String ? "JS_NORMAL" : 0; object.weak = 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] : message.ctype; @@ -23803,6 +24557,13 @@ 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]] : 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; }; diff --git a/packages/google-cloud-securitycenter/protos/protos.json b/packages/google-cloud-securitycenter/protos/protos.json index 26544b8c767..bb0f91ca4c4 100644 --- a/packages/google-cloud-securitycenter/protos/protos.json +++ b/packages/google-cloud-securitycenter/protos/protos.json @@ -1579,7 +1579,7 @@ "options": { "go_package": "google.golang.org/genproto/googleapis/api/annotations;annotations", "java_multiple_files": true, - "java_outer_classname": "ClientProto", + "java_outer_classname": "ResourceProto", "java_package": "com.google.api", "objc_class_prefix": "GAPI", "cc_enable_arenas": true @@ -1687,6 +1687,88 @@ "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 + } + }, + "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 + } + }, + "nested": { + "History": { + "values": { + "HISTORY_UNSPECIFIED": 0, + "ORIGINALLY_SINGLE_PATTERN": 1, + "FUTURE_MULTI_PATTERN": 2 + } + } + } + }, + "ResourceReference": { + "fields": { + "type": { + "type": "string", + "id": 1 + }, + "childType": { + "type": "string", + "id": 2 + } + } } } }, @@ -2742,11 +2824,18 @@ "fields": { "resource": { "type": "string", - "id": 1 + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "*" + } }, "policy": { "type": "Policy", - "id": 2 + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } } } }, @@ -2754,10 +2843,14 @@ "fields": { "resource": { "type": "string", - "id": 1 + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "*" + } }, "options": { - "type": "google.iam.v1.GetPolicyOptions", + "type": "GetPolicyOptions", "id": 2 } } @@ -2766,12 +2859,19 @@ "fields": { "resource": { "type": "string", - "id": 1 + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "*" + } }, "permissions": { "rule": "repeated", "type": "string", - "id": 2 + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } } } }, diff --git a/packages/google-cloud-securitycenter/synth.metadata b/packages/google-cloud-securitycenter/synth.metadata index fbef87f92f8..af52ca90bab 100644 --- a/packages/google-cloud-securitycenter/synth.metadata +++ b/packages/google-cloud-securitycenter/synth.metadata @@ -1,19 +1,19 @@ { - "updateTime": "2019-11-15T03:45:57.191048Z", + "updateTime": "2019-11-19T12:26:58.400457Z", "sources": [ { "generator": { "name": "artman", - "version": "0.41.1", - "dockerImage": "googleapis/artman@sha256:545c758c76c3f779037aa259023ec3d1ef2d57d2c8cd00a222cb187d63ceac5e" + "version": "0.42.1", + "dockerImage": "googleapis/artman@sha256:c773192618c608a7a0415dd95282f841f8e6bcdef7dd760a988c93b77a64bd57" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "1935fb8889686f5c9d107f11b3c6870fc3aa7cdc", - "internalRef": "280451656" + "sha": "d8dd7fe8d5304f7bd1c52207703d7f27d5328c5a", + "internalRef": "281088257" } }, { From 34276111f0af1e54ede7147e712bbc766b53347b Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Mon, 25 Nov 2019 08:57:42 -0800 Subject: [PATCH 115/342] chore: update license headers (#176) --- .../samples/quickstart.js | 27 +++++++++---------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/packages/google-cloud-securitycenter/samples/quickstart.js b/packages/google-cloud-securitycenter/samples/quickstart.js index 1eb4c21813c..d0f4e5a50a3 100644 --- a/packages/google-cloud-securitycenter/samples/quickstart.js +++ b/packages/google-cloud-securitycenter/samples/quickstart.js @@ -1,17 +1,16 @@ -/** - * Copyright 2018, Google, LLC. - * Licensed under the Apache License, Version 2.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. - */ +// Copyright 2018 Google LLC +// +// Licensed under the Apache License, Version 2.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. // sample-metadata: // usage: node quickstart.js [organization] From 58d2b77fbbf6834c0b5ae15846616b304e850e00 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Tue, 10 Dec 2019 10:26:53 -0800 Subject: [PATCH 116/342] refactor: update field options (#180) --- .../cloud/securitycenter/v1/asset.proto | 8 +- .../cloud/securitycenter/v1/finding.proto | 32 +- .../v1/organization_settings.proto | 10 +- .../v1/run_asset_discovery_response.proto | 3 +- .../securitycenter/v1/security_marks.proto | 20 +- .../v1/securitycenter_service.proto | 304 +++++++++++------- .../cloud/securitycenter/v1/source.proto | 27 +- .../protos/protos.json | 257 ++++++++++----- .../cloud/securitycenter/v1/doc_asset.js | 2 +- .../cloud/securitycenter/v1/doc_finding.js | 23 +- .../v1/doc_organization_settings.js | 2 +- .../securitycenter/v1/doc_security_marks.js | 13 +- .../v1/doc_securitycenter_service.js | 146 ++++----- .../cloud/securitycenter/v1/doc_source.js | 19 +- .../src/v1/security_center_client.js | 264 +++++++-------- .../synth.metadata | 6 +- 16 files changed, 661 insertions(+), 475 deletions(-) diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/asset.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/asset.proto index 74ec9b2138a..3b99d35d11d 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/asset.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/asset.proto @@ -18,6 +18,7 @@ syntax = "proto3"; package google.cloud.securitycenter.v1; import "google/api/annotations.proto"; +import "google/api/resource.proto"; import "google/cloud/securitycenter/v1/security_marks.proto"; import "google/protobuf/struct.proto"; import "google/protobuf/timestamp.proto"; @@ -36,6 +37,11 @@ option ruby_package = "Google::Cloud::SecurityCenter::V1"; // GCP resource. All modifications to an Asset are only within the context of // Cloud SCC and don't affect the referenced GCP resource. message Asset { + option (google.api.resource) = { + type: "securitycenter.googleapis.com/Asset" + pattern: "organizations/{organization}/assets/{asset}" + }; + // Cloud SCC managed properties. These properties are managed by Cloud SCC and // cannot be modified by the user. message SecurityCenterProperties { @@ -75,7 +81,7 @@ message Asset { // The relative resource name of this asset. See: // https://cloud.google.com/apis/design/resource_names#relative_resource_name // Example: - // "organizations/123/assets/456". + // "organizations/{organization_id}/assets/{asset_id}". string name = 1; // Cloud SCC managed properties. These properties are managed by diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/finding.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/finding.proto index e75247e88e8..0c64d4d79fe 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/finding.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/finding.proto @@ -18,6 +18,8 @@ syntax = "proto3"; package google.cloud.securitycenter.v1; import "google/api/annotations.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; import "google/cloud/securitycenter/v1/security_marks.proto"; import "google/protobuf/struct.proto"; import "google/protobuf/timestamp.proto"; @@ -31,11 +33,17 @@ option ruby_package = "Google::Cloud::SecurityCenter::V1"; // Cloud Security Command Center (Cloud SCC) finding. // -// A finding is a record of assessment data (security, risk, health or privacy) -// ingested into Cloud SCC for presentation, notification, analysis, -// policy testing, and enforcement. For example, an XSS vulnerability in an -// App Engine application is a finding. +// A finding is a record of assessment data like security, risk, health, or +// privacy, that is ingested into Cloud SCC for presentation, notification, +// analysis, policy testing, and enforcement. For example, a +// cross-site scripting (XSS) vulnerability in an App Engine application is a +// finding. message Finding { + option (google.api.resource) = { + type: "securitycenter.googleapis.com/Finding" + pattern: "organizations/{organization}/sources/{source}/findings/{finding}" + }; + // The state of the finding. enum State { // Unspecified state. @@ -52,19 +60,21 @@ message Finding { // The relative resource name of this finding. See: // https://cloud.google.com/apis/design/resource_names#relative_resource_name // Example: - // "organizations/123/sources/456/findings/789" + // "organizations/{organization_id}/sources/{source_id}/findings/{finding_id}" string name = 1; // The relative resource name of the source the finding belongs to. See: // https://cloud.google.com/apis/design/resource_names#relative_resource_name // This field is immutable after creation time. // For example: - // "organizations/123/sources/456" + // "organizations/{organization_id}/sources/{source_id}" string parent = 2; - // The full resource name of the Google Cloud Platform (GCP) resource this - // finding is for. See: + // For findings on Google Cloud Platform (GCP) resources, the full resource + // name of the GCP resource this finding is for. See: // https://cloud.google.com/apis/design/resource_names#full_resource_name + // When the finding is for a non-GCP resource, the resourceName can be a + // customer or partner defined string. // This field is immutable after creation time. string resource_name = 3; @@ -90,11 +100,11 @@ message Finding { // Output only. User specified security marks. These marks are entirely // managed by the user and come from the SecurityMarks resource that belongs // to the finding. - SecurityMarks security_marks = 8; + SecurityMarks security_marks = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; // The time at which the event took place. For example, if the finding - // represents an open firewall it would capture the time the open firewall was - // detected. + // represents an open firewall it would capture the time the detector believes + // the firewall became open. The accuracy is determined by the detector. google.protobuf.Timestamp event_time = 9; // The time at which the finding was created in Cloud SCC. diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/organization_settings.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/organization_settings.proto index e975e566cba..db2097048c5 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/organization_settings.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/organization_settings.proto @@ -18,6 +18,7 @@ syntax = "proto3"; package google.cloud.securitycenter.v1; import "google/api/annotations.proto"; +import "google/api/resource.proto"; option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1;securitycenter"; @@ -29,6 +30,11 @@ option ruby_package = "Google::Cloud::SecurityCenter::V1"; // User specified settings that are attached to the Cloud Security Command // Center (Cloud SCC) organization. message OrganizationSettings { + option (google.api.resource) = { + type: "securitycenter.googleapis.com/OrganizationSettings" + pattern: "organizations/{organization}/organizationSettings" + }; + // The configuration used for Asset Discovery runs. message AssetDiscoveryConfig { // The mode of inclusion when running Asset Discovery. @@ -63,7 +69,7 @@ message OrganizationSettings { // The relative resource name of the settings. See: // https://cloud.google.com/apis/design/resource_names#relative_resource_name // Example: - // "organizations/123/organizationSettings". + // "organizations/{organization_id}/organizationSettings". string name = 1; // A flag that indicates if Asset Discovery should be enabled. If the flag is @@ -74,6 +80,4 @@ message OrganizationSettings { // The configuration used for Asset Discovery runs. AssetDiscoveryConfig asset_discovery_config = 3; - - reserved 4, 5; } diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/run_asset_discovery_response.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/run_asset_discovery_response.proto index 1cbba38e713..93fb58b1172 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/run_asset_discovery_response.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/run_asset_discovery_response.proto @@ -17,9 +17,8 @@ syntax = "proto3"; package google.cloud.securitycenter.v1; -import "google/protobuf/duration.proto"; -import "google/protobuf/timestamp.proto"; import "google/api/annotations.proto"; +import "google/protobuf/duration.proto"; option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1;securitycenter"; diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/security_marks.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/security_marks.proto index 97b3f93775b..b3ad429811a 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/security_marks.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/security_marks.proto @@ -18,6 +18,7 @@ syntax = "proto3"; package google.cloud.securitycenter.v1; import "google/api/annotations.proto"; +import "google/api/resource.proto"; option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1;securitycenter"; @@ -31,19 +32,26 @@ option ruby_package = "Google::Cloud::SecurityCenter::V1"; // SCC organization -- they can be modified and viewed by all users who have // proper permissions on the organization. message SecurityMarks { + option (google.api.resource) = { + type: "securitycenter.googleapis.com/SecurityMarks" + pattern: "organizations/{organization}/assets/{asset}/securityMarks" + pattern: "organizations/{organization}/sources/{source}/findings/{finding}/securityMarks" + }; + // The relative resource name of the SecurityMarks. See: // https://cloud.google.com/apis/design/resource_names#relative_resource_name // Examples: - // "organizations/123/assets/456/securityMarks" - // "organizations/123/sources/456/findings/789/securityMarks". + // "organizations/{organization_id}/assets/{asset_id}/securityMarks" + // "organizations/{organization_id}/sources/{source_id}/findings/{finding_id}/securityMarks". string name = 1; // Mutable user specified security marks belonging to the parent resource. // Constraints are as follows: - // - Keys and values are treated as case insensitive - // - Keys must be between 1 - 256 characters (inclusive) - // - Keys must be letters, numbers, underscores, or dashes - // - Values have leading and trailing whitespace trimmed, remaining + // + // * Keys and values are treated as case insensitive + // * Keys must be between 1 - 256 characters (inclusive) + // * Keys must be letters, numbers, underscores, or dashes + // * Values have leading and trailing whitespace trimmed, remaining // characters must be between 1 - 4096 characters (inclusive) map marks = 2; } diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/securitycenter_service.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/securitycenter_service.proto index 0687928f3ba..811fca5d653 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/securitycenter_service.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/securitycenter_service.proto @@ -18,6 +18,9 @@ syntax = "proto3"; package google.cloud.securitycenter.v1; import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; import "google/cloud/securitycenter/v1/asset.proto"; import "google/cloud/securitycenter/v1/finding.proto"; import "google/cloud/securitycenter/v1/organization_settings.proto"; @@ -42,12 +45,16 @@ option ruby_package = "Google::Cloud::SecurityCenter::V1"; // V1 APIs for Security Center service. service SecurityCenter { + option (google.api.default_host) = "securitycenter.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + // Creates a source. rpc CreateSource(CreateSourceRequest) returns (Source) { option (google.api.http) = { post: "/v1/{parent=organizations/*}/sources" body: "source" }; + option (google.api.method_signature) = "parent,source"; } // Creates a finding. The corresponding source must exist for finding creation @@ -57,23 +64,24 @@ service SecurityCenter { post: "/v1/{parent=organizations/*/sources/*}/findings" body: "finding" }; + option (google.api.method_signature) = "parent,finding_id,finding"; } // Gets the access control policy on the specified Source. - rpc GetIamPolicy(google.iam.v1.GetIamPolicyRequest) - returns (google.iam.v1.Policy) { + rpc GetIamPolicy(google.iam.v1.GetIamPolicyRequest) returns (google.iam.v1.Policy) { option (google.api.http) = { post: "/v1/{resource=organizations/*/sources/*}:getIamPolicy" body: "*" }; + option (google.api.method_signature) = "resource"; } // Gets the settings for an organization. - rpc GetOrganizationSettings(GetOrganizationSettingsRequest) - returns (OrganizationSettings) { + rpc GetOrganizationSettings(GetOrganizationSettingsRequest) returns (OrganizationSettings) { option (google.api.http) = { get: "/v1/{name=organizations/*/organizationSettings}" }; + option (google.api.method_signature) = "name"; } // Gets a source. @@ -81,6 +89,7 @@ service SecurityCenter { option (google.api.http) = { get: "/v1/{name=organizations/*/sources/*}" }; + option (google.api.method_signature) = "name"; } // Filters an organization's assets and groups them by their specified @@ -96,12 +105,13 @@ service SecurityCenter { // specified properties. // // To group across all sources provide a `-` as the source id. - // Example: /v1/organizations/123/sources/-/findings + // Example: /v1/organizations/{organization_id}/sources/-/findings rpc GroupFindings(GroupFindingsRequest) returns (GroupFindingsResponse) { option (google.api.http) = { post: "/v1/{parent=organizations/*/sources/*}/findings:group" body: "*" }; + option (google.api.method_signature) = "parent,group_by"; } // Lists an organization's assets. @@ -114,7 +124,7 @@ service SecurityCenter { // Lists an organization or source's findings. // // To list across all sources provide a `-` as the source id. - // Example: /v1/organizations/123/sources/-/findings + // Example: /v1/organizations/{organization_id}/sources/-/findings rpc ListFindings(ListFindingsRequest) returns (ListFindingsResponse) { option (google.api.http) = { get: "/v1/{parent=organizations/*/sources/*}/findings" @@ -126,6 +136,7 @@ service SecurityCenter { option (google.api.http) = { get: "/v1/{parent=organizations/*}/sources" }; + option (google.api.method_signature) = "parent"; } // Runs asset discovery. The discovery is tracked with a long-running @@ -134,12 +145,16 @@ service SecurityCenter { // This API can only be called with limited frequency for an organization. If // it is called too frequently the caller will receive a TOO_MANY_REQUESTS // error. - rpc RunAssetDiscovery(RunAssetDiscoveryRequest) - returns (google.longrunning.Operation) { + rpc RunAssetDiscovery(RunAssetDiscoveryRequest) returns (google.longrunning.Operation) { option (google.api.http) = { post: "/v1/{parent=organizations/*}/assets:runDiscovery" body: "*" }; + option (google.api.method_signature) = "parent"; + option (google.longrunning.operation_info) = { + response_type: "google.cloud.securitycenter.v1.RunAssetDiscoveryResponse" + metadata_type: "google.protobuf.Empty" + }; } // Updates the state of a finding. @@ -148,24 +163,25 @@ service SecurityCenter { post: "/v1/{name=organizations/*/sources/*/findings/*}:setState" body: "*" }; + option (google.api.method_signature) = "name,state,start_time"; } // Sets the access control policy on the specified Source. - rpc SetIamPolicy(google.iam.v1.SetIamPolicyRequest) - returns (google.iam.v1.Policy) { + rpc SetIamPolicy(google.iam.v1.SetIamPolicyRequest) returns (google.iam.v1.Policy) { option (google.api.http) = { post: "/v1/{resource=organizations/*/sources/*}:setIamPolicy" body: "*" }; + option (google.api.method_signature) = "resource,policy"; } // Returns the permissions that a caller has on the specified source. - rpc TestIamPermissions(google.iam.v1.TestIamPermissionsRequest) - returns (google.iam.v1.TestIamPermissionsResponse) { + rpc TestIamPermissions(google.iam.v1.TestIamPermissionsRequest) returns (google.iam.v1.TestIamPermissionsResponse) { option (google.api.http) = { post: "/v1/{resource=organizations/*/sources/*}:testIamPermissions" body: "*" }; + option (google.api.method_signature) = "resource,permissions"; } // Creates or updates a finding. The corresponding source must exist for a @@ -175,15 +191,16 @@ service SecurityCenter { patch: "/v1/{finding.name=organizations/*/sources/*/findings/*}" body: "finding" }; + option (google.api.method_signature) = "finding"; } // Updates an organization's settings. - rpc UpdateOrganizationSettings(UpdateOrganizationSettingsRequest) - returns (OrganizationSettings) { + rpc UpdateOrganizationSettings(UpdateOrganizationSettingsRequest) returns (OrganizationSettings) { option (google.api.http) = { patch: "/v1/{organization_settings.name=organizations/*/organizationSettings}" body: "organization_settings" }; + option (google.api.method_signature) = "organization_settings"; } // Updates a source. @@ -192,6 +209,7 @@ service SecurityCenter { patch: "/v1/{source.name=organizations/*/sources/*}" body: "source" }; + option (google.api.method_signature) = "source"; } // Updates security marks. @@ -204,55 +222,81 @@ service SecurityCenter { body: "security_marks" } }; + option (google.api.method_signature) = "security_marks"; } } // Request message for creating a finding. message CreateFindingRequest { - // Resource name of the new finding's parent. Its format should be + // Required. Resource name of the new finding's parent. Its format should be // "organizations/[organization_id]/sources/[source_id]". - string parent = 1; + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "securitycenter.googleapis.com/Source" + } + ]; - // Unique identifier provided by the client within the parent scope. + // Required. Unique identifier provided by the client within the parent scope. // It must be alphanumeric and less than or equal to 32 characters and // greater than 0 characters in length. - string finding_id = 2; + string finding_id = 2 [(google.api.field_behavior) = REQUIRED]; - // The Finding being created. The name and security_marks will be ignored as + // Required. The Finding being created. The name and security_marks will be ignored as // they are both output only fields on this resource. - Finding finding = 3; + Finding finding = 3 [(google.api.field_behavior) = REQUIRED]; } // Request message for creating a source. message CreateSourceRequest { - // Resource name of the new source's parent. Its format should be + // Required. Resource name of the new source's parent. Its format should be // "organizations/[organization_id]". - string parent = 1; + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudresourcemanager.googleapis.com/Organization" + } + ]; - // The Source being created, only the display_name and description will be + // Required. The Source being created, only the display_name and description will be // used. All other fields will be ignored. - Source source = 2; + Source source = 2 [(google.api.field_behavior) = REQUIRED]; } // Request message for getting organization settings. message GetOrganizationSettingsRequest { - // Name of the organization to get organization settings for. Its format is + // Required. Name of the organization to get organization settings for. Its format is // "organizations/[organization_id]/organizationSettings". - string name = 1; + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "securitycenter.googleapis.com/OrganizationSettings" + } + ]; } // Request message for getting a source. message GetSourceRequest { - // Relative resource name of the source. Its format is + // Required. Relative resource name of the source. Its format is // "organizations/[organization_id]/source/[source_id]". - string name = 1; + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "securitycenter.googleapis.com/Source" + } + ]; } // Request message for grouping by assets. message GroupAssetsRequest { - // Name of the organization to groupBy. Its format is + // Required. Name of the organization to groupBy. Its format is // "organizations/[organization_id]". - string parent = 1; + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudresourcemanager.googleapis.com/Organization" + } + ]; // Expression that defines the filter to apply across assets. // The expression is a list of zero or more restrictions combined via logical @@ -281,34 +325,35 @@ message GroupAssetsRequest { // * boolean literals `true` and `false` without quotes. // // The following field and operator combinations are supported: - // name | '=' - // update_time | '=', '>', '<', '>=', '<=' + // + // * name: `=` + // * update_time: `=`, `>`, `<`, `>=`, `<=` // // Usage: This should be milliseconds since epoch or an RFC3339 string. // Examples: // "update_time = \"2019-06-10T16:07:18-07:00\"" // "update_time = 1560208038000" // - // create_time | '=', '>', '<', '>=', '<=' + // * create_time: `=`, `>`, `<`, `>=`, `<=` // // Usage: This should be milliseconds since epoch or an RFC3339 string. // Examples: // "create_time = \"2019-06-10T16:07:18-07:00\"" // "create_time = 1560208038000" // - // iam_policy.policy_blob | '=', ':' - // resource_properties | '=', ':', '>', '<', '>=', '<=' - // security_marks | '=', ':' - // security_center_properties.resource_name | '=', ':' - // security_center_properties.resource_type | '=', ':' - // security_center_properties.resource_parent | '=', ':' - // security_center_properties.resource_project | '=', ':' - // security_center_properties.resource_owners | '=', ':' + // * iam_policy.policy_blob: `=`, `:` + // * resource_properties: `=`, `:`, `>`, `<`, `>=`, `<=` + // * security_marks.marks: `=`, `:` + // * security_center_properties.resource_name: `=`, `:` + // * security_center_properties.resource_type: `=`, `:` + // * security_center_properties.resource_parent: `=`, `:` + // * security_center_properties.resource_project: `=`, `:` + // * security_center_properties.resource_owners: `=`, `:` // // For example, `resource_properties.size = 100` is a valid filter string. string filter = 2; - // Expression that defines what assets fields to use for grouping. The string + // Required. Expression that defines what assets fields to use for grouping. The string // value should follow SQL syntax: comma separated list of fields. For // example: // "security_center_properties.resource_project,security_center_properties.project". @@ -322,7 +367,7 @@ message GroupAssetsRequest { // The following fields are supported when compare_duration is set: // // * security_center_properties.resource_type - string group_by = 3; + string group_by = 3 [(google.api.field_behavior) = REQUIRED]; // When compare_duration is set, the GroupResult's "state_change" property is // updated to indicate whether the asset was added, removed, or remained @@ -367,8 +412,6 @@ message GroupAssetsRequest { // The maximum number of results to return in a single response. Default is // 10, minimum is 1, maximum is 1000. int32 page_size = 8; - - reserved 6; } // Response message for grouping by assets. @@ -391,11 +434,16 @@ message GroupAssetsResponse { // Request message for grouping by findings. message GroupFindingsRequest { - // Name of the source to groupBy. Its format is + // Required. Name of the source to groupBy. Its format is // "organizations/[organization_id]/sources/[source_id]". To groupBy across // all sources provide a source_id of `-`. For example: - // organizations/123/sources/- - string parent = 1; + // organizations/{organization_id}/sources/- + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "securitycenter.googleapis.com/Source" + } + ]; // Expression that defines the filter to apply across findings. // The expression is a list of one or more restrictions combined via logical @@ -422,26 +470,27 @@ message GroupFindingsRequest { // * boolean literals `true` and `false` without quotes. // // The following field and operator combinations are supported: - // name | `=` - // parent | '=', ':' - // resource_name | '=', ':' - // state | '=', ':' - // category | '=', ':' - // external_uri | '=', ':' - // event_time | `=`, `>`, `<`, `>=`, `<=` + // + // * name: `=` + // * parent: `=`, `:` + // * resource_name: `=`, `:` + // * state: `=`, `:` + // * category: `=`, `:` + // * external_uri: `=`, `:` + // * event_time: `=`, `>`, `<`, `>=`, `<=` // // Usage: This should be milliseconds since epoch or an RFC3339 string. // Examples: // "event_time = \"2019-06-10T16:07:18-07:00\"" // "event_time = 1560208038000" // - // security_marks | '=', ':' - // source_properties | '=', ':', `>`, `<`, `>=`, `<=` + // * security_marks.marks: `=`, `:` + // * source_properties: `=`, `:`, `>`, `<`, `>=`, `<=` // // For example, `source_properties.size = 100` is a valid filter string. string filter = 2; - // Expression that defines what assets fields to use for grouping (including + // Required. Expression that defines what assets fields to use for grouping (including // `state_change`). The string value should follow SQL syntax: comma separated // list of fields. For example: "parent,resource_name". // @@ -455,7 +504,7 @@ message GroupFindingsRequest { // The following fields are supported when compare_duration is set: // // * state_change - string group_by = 3; + string group_by = 3 [(google.api.field_behavior) = REQUIRED]; // Time used as a reference point when filtering findings. The filter is // limited to findings existing at the supplied time and their values are @@ -499,8 +548,6 @@ message GroupFindingsRequest { // The maximum number of results to return in a single response. Default is // 10, minimum is 1, maximum is 1000. int32 page_size = 8; - - reserved 6; } // Response message for group by findings. @@ -532,9 +579,14 @@ message GroupResult { // Request message for listing sources. message ListSourcesRequest { - // Resource name of the parent of sources to list. Its format should be + // Required. Resource name of the parent of sources to list. Its format should be // "organizations/[organization_id]". - string parent = 1; + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudresourcemanager.googleapis.com/Organization" + } + ]; // The value returned by the last `ListSourcesResponse`; indicates // that this is a continuation of a prior `ListSources` call, and @@ -558,9 +610,14 @@ message ListSourcesResponse { // Request message for listing assets. message ListAssetsRequest { - // Name of the organization assets should belong to. Its format is + // Required. Name of the organization assets should belong to. Its format is // "organizations/[organization_id]". - string parent = 1; + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudresourcemanager.googleapis.com/Organization" + } + ]; // Expression that defines the filter to apply across assets. // The expression is a list of zero or more restrictions combined via logical @@ -589,29 +646,30 @@ message ListAssetsRequest { // * boolean literals `true` and `false` without quotes. // // The following are the allowed field and operator combinations: - // name | `=` - // update_time | `=`, `>`, `<`, `>=`, `<=` + // + // * name: `=` + // * update_time: `=`, `>`, `<`, `>=`, `<=` // // Usage: This should be milliseconds since epoch or an RFC3339 string. // Examples: // "update_time = \"2019-06-10T16:07:18-07:00\"" // "update_time = 1560208038000" // - // create_time | `=`, `>`, `<`, `>=`, `<=` + // * create_time: `=`, `>`, `<`, `>=`, `<=` // // Usage: This should be milliseconds since epoch or an RFC3339 string. // Examples: // "create_time = \"2019-06-10T16:07:18-07:00\"" // "create_time = 1560208038000" // - // iam_policy.policy_blob | '=', ':' - // resource_properties | '=', ':', `>`, `<`, `>=`, `<=` - // security_marks | '=', ':' - // security_center_properties.resource_name | '=', ':' - // security_center_properties.resource_type | '=', ':' - // security_center_properties.resource_parent | '=', ':' - // security_center_properties.resource_project | '=', ':' - // security_center_properties.resource_owners | '=', ':' + // * iam_policy.policy_blob: `=`, `:` + // * resource_properties: `=`, `:`, `>`, `<`, `>=`, `<=` + // * security_marks.marks: `=`, `:` + // * security_center_properties.resource_name: `=`, `:` + // * security_center_properties.resource_type: `=`, `:` + // * security_center_properties.resource_parent: `=`, `:` + // * security_center_properties.resource_project: `=`, `:` + // * security_center_properties.resource_owners: `=`, `:` // // For example, `resource_properties.size = 100` is a valid filter string. string filter = 2; @@ -629,7 +687,7 @@ message ListAssetsRequest { // name // update_time // resource_properties - // security_marks + // security_marks.marks // security_center_properties.resource_name // security_center_properties.resource_parent // security_center_properties.resource_project @@ -668,12 +726,10 @@ message ListAssetsRequest { // read_time. google.protobuf.Duration compare_duration = 5; - // Optional. - // - // A field mask to specify the ListAssetsResult fields to be listed in the + // Optional. A field mask to specify the ListAssetsResult fields to be listed in the // response. // An empty field mask will list all fields. - google.protobuf.FieldMask field_mask = 7; + google.protobuf.FieldMask field_mask = 7 [(google.api.field_behavior) = OPTIONAL]; // The value returned by the last `ListAssetsResponse`; indicates // that this is a continuation of a prior `ListAssets` call, and @@ -683,8 +739,6 @@ message ListAssetsRequest { // The maximum number of results to return in a single response. Default is // 10, minimum is 1, maximum is 1000. int32 page_size = 9; - - reserved 6; } // Response message for listing assets. @@ -734,11 +788,16 @@ message ListAssetsResponse { // Request message for listing findings. message ListFindingsRequest { - // Name of the source the findings belong to. Its format is + // Required. Name of the source the findings belong to. Its format is // "organizations/[organization_id]/sources/[source_id]". To list across all // sources provide a source_id of `-`. For example: - // organizations/123/sources/- - string parent = 1; + // organizations/{organization_id}/sources/- + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "securitycenter.googleapis.com/Source" + } + ]; // Expression that defines the filter to apply across findings. // The expression is a list of one or more restrictions combined via logical @@ -765,21 +824,22 @@ message ListFindingsRequest { // * boolean literals `true` and `false` without quotes. // // The following field and operator combinations are supported: - // name | `=` - // parent | '=', ':' - // resource_name | '=', ':' - // state | '=', ':' - // category | '=', ':' - // external_uri | '=', ':' - // event_time | `=`, `>`, `<`, `>=`, `<=` + // + // name: `=` + // parent: `=`, `:` + // resource_name: `=`, `:` + // state: `=`, `:` + // category: `=`, `:` + // external_uri: `=`, `:` + // event_time: `=`, `>`, `<`, `>=`, `<=` // // Usage: This should be milliseconds since epoch or an RFC3339 string. // Examples: // "event_time = \"2019-06-10T16:07:18-07:00\"" // "event_time = 1560208038000" // - // security_marks | '=', ':' - // source_properties | '=', ':', `>`, `<`, `>=`, `<=` + // security_marks.marks: `=`, `:` + // source_properties: `=`, `:`, `>`, `<`, `>=`, `<=` // // For example, `source_properties.size = 100` is a valid filter string. string filter = 2; @@ -801,7 +861,7 @@ message ListFindingsRequest { // resource_name // event_time // source_properties - // security_marks + // security_marks.marks string order_by = 3; // Time used as a reference point when filtering findings. The filter is @@ -836,11 +896,9 @@ message ListFindingsRequest { // read_time. google.protobuf.Duration compare_duration = 5; - // Optional. - // - // A field mask to specify the Finding fields to be listed in the response. + // Optional. A field mask to specify the Finding fields to be listed in the response. // An empty field mask will list all fields. - google.protobuf.FieldMask field_mask = 7; + google.protobuf.FieldMask field_mask = 7 [(google.api.field_behavior) = OPTIONAL]; // The value returned by the last `ListFindingsResponse`; indicates // that this is a continuation of a prior `ListFindings` call, and @@ -850,8 +908,6 @@ message ListFindingsRequest { // The maximum number of results to return in a single response. Default is // 10, minimum is 1, maximum is 1000. int32 page_size = 9; - - reserved 6; } // Response message for listing findings. @@ -909,35 +965,45 @@ message ListFindingsResponse { // Request message for updating a finding's state. message SetFindingStateRequest { - // The relative resource name of the finding. See: + // Required. The relative resource name of the finding. See: // https://cloud.google.com/apis/design/resource_names#relative_resource_name // Example: - // "organizations/123/sources/456/finding/789". - string name = 1; + // "organizations/{organization_id}/sources/{source_id}/finding/{finding_id}". + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "securitycenter.googleapis.com/Finding" + } + ]; - // The desired State of the finding. - Finding.State state = 2; + // Required. The desired State of the finding. + Finding.State state = 2 [(google.api.field_behavior) = REQUIRED]; - // The time at which the updated state takes effect. - google.protobuf.Timestamp start_time = 3; + // Required. The time at which the updated state takes effect. + google.protobuf.Timestamp start_time = 3 [(google.api.field_behavior) = REQUIRED]; } // Request message for running asset discovery for an organization. message RunAssetDiscoveryRequest { - // Name of the organization to run asset discovery for. Its format is + // Required. Name of the organization to run asset discovery for. Its format is // "organizations/[organization_id]". - string parent = 1; + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudresourcemanager.googleapis.com/Organization" + } + ]; } // Request message for updating or creating a finding. message UpdateFindingRequest { - // The finding resource to update or create if it does not already exist. + // Required. The finding resource to update or create if it does not already exist. // parent, security_marks, and update_time will be ignored. // // In the case of creation, the finding id portion of the name must be // alphanumeric and less than or equal to 32 characters and greater than 0 // characters in length. - Finding finding = 1; + Finding finding = 1 [(google.api.field_behavior) = REQUIRED]; // The FieldMask to use when updating the finding resource. This field should // not be specified when creating a finding. @@ -951,8 +1017,8 @@ message UpdateFindingRequest { // Request message for updating an organization's settings. message UpdateOrganizationSettingsRequest { - // The organization settings resource to update. - OrganizationSettings organization_settings = 1; + // Required. The organization settings resource to update. + OrganizationSettings organization_settings = 1 [(google.api.field_behavior) = REQUIRED]; // The FieldMask to use when updating the settings resource. // @@ -962,8 +1028,8 @@ message UpdateOrganizationSettingsRequest { // Request message for updating a source. message UpdateSourceRequest { - // The source resource to update. - Source source = 1; + // Required. The source resource to update. + Source source = 1 [(google.api.field_behavior) = REQUIRED]; // The FieldMask to use when updating the source resource. // @@ -973,8 +1039,8 @@ message UpdateSourceRequest { // Request message for updating a SecurityMarks resource. message UpdateSecurityMarksRequest { - // The security marks resource to update. - SecurityMarks security_marks = 1; + // Required. The security marks resource to update. + SecurityMarks security_marks = 1 [(google.api.field_behavior) = REQUIRED]; // The FieldMask to use when updating the security marks resource. // diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/source.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/source.proto index 26b0d5a64d1..4ceff737fc6 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/source.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/source.proto @@ -18,6 +18,7 @@ syntax = "proto3"; package google.cloud.securitycenter.v1; import "google/api/annotations.proto"; +import "google/api/resource.proto"; option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1;securitycenter"; @@ -28,31 +29,33 @@ option ruby_package = "Google::Cloud::SecurityCenter::V1"; // Cloud Security Command Center's (Cloud SCC) finding source. A finding source // is an entity or a mechanism that can produce a finding. A source is like a -// container of findings that come from the same scanner, logger, monitor, etc. +// container of findings that come from the same scanner, logger, monitor, and +// other tools. message Source { + option (google.api.resource) = { + type: "securitycenter.googleapis.com/Source" + pattern: "organizations/{organization}/sources/{source}" + }; + // The relative resource name of this source. See: // https://cloud.google.com/apis/design/resource_names#relative_resource_name // Example: - // "organizations/123/sources/456" + // "organizations/{organization_id}/sources/{source_id}" string name = 1; - // The source’s display name. - // A source’s display name must be unique amongst its siblings, for example, + // The source's display name. + // A source's display name must be unique amongst its siblings, for example, // two sources with the same parent can't share the same display name. - // The display name must start and end with a letter or digit, may contain - // letters, digits, spaces, hyphens, and underscores, and can be no longer - // than 32 characters. This is captured by the regular expression: - // [\p{L}\p{N}]({\p{L}\p{N}_- ]{0,30}[\p{L}\p{N}])?. + // The display name must have a length between 1 and 64 characters + // (inclusive). string display_name = 2; // The description of the source (max of 1024 characters). // Example: - // "Cloud Security Scanner is a web security scanner for common + // "Web Security Scanner is a web security scanner for common // vulnerabilities in App Engine applications. It can automatically // scan and detect four common vulnerabilities, including cross-site-scripting // (XSS), Flash injection, mixed content (HTTP in HTTPS), and - // outdated/insecure libraries." + // outdated or insecure libraries." string description = 3; - - reserved 4; } diff --git a/packages/google-cloud-securitycenter/protos/protos.json b/packages/google-cloud-securitycenter/protos/protos.json index bb0f91ca4c4..99c331d5af8 100644 --- a/packages/google-cloud-securitycenter/protos/protos.json +++ b/packages/google-cloud-securitycenter/protos/protos.json @@ -17,13 +17,18 @@ }, "nested": { "SecurityCenter": { + "options": { + "(google.api.default_host)": "securitycenter.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, "methods": { "CreateSource": { "requestType": "CreateSourceRequest", "responseType": "Source", "options": { "(google.api.http).post": "/v1/{parent=organizations/*}/sources", - "(google.api.http).body": "source" + "(google.api.http).body": "source", + "(google.api.method_signature)": "parent,source" } }, "CreateFinding": { @@ -31,7 +36,8 @@ "responseType": "Finding", "options": { "(google.api.http).post": "/v1/{parent=organizations/*/sources/*}/findings", - "(google.api.http).body": "finding" + "(google.api.http).body": "finding", + "(google.api.method_signature)": "parent,finding_id,finding" } }, "GetIamPolicy": { @@ -39,21 +45,24 @@ "responseType": "google.iam.v1.Policy", "options": { "(google.api.http).post": "/v1/{resource=organizations/*/sources/*}:getIamPolicy", - "(google.api.http).body": "*" + "(google.api.http).body": "*", + "(google.api.method_signature)": "resource" } }, "GetOrganizationSettings": { "requestType": "GetOrganizationSettingsRequest", "responseType": "OrganizationSettings", "options": { - "(google.api.http).get": "/v1/{name=organizations/*/organizationSettings}" + "(google.api.http).get": "/v1/{name=organizations/*/organizationSettings}", + "(google.api.method_signature)": "name" } }, "GetSource": { "requestType": "GetSourceRequest", "responseType": "Source", "options": { - "(google.api.http).get": "/v1/{name=organizations/*/sources/*}" + "(google.api.http).get": "/v1/{name=organizations/*/sources/*}", + "(google.api.method_signature)": "name" } }, "GroupAssets": { @@ -69,7 +78,8 @@ "responseType": "GroupFindingsResponse", "options": { "(google.api.http).post": "/v1/{parent=organizations/*/sources/*}/findings:group", - "(google.api.http).body": "*" + "(google.api.http).body": "*", + "(google.api.method_signature)": "parent,group_by" } }, "ListAssets": { @@ -90,7 +100,8 @@ "requestType": "ListSourcesRequest", "responseType": "ListSourcesResponse", "options": { - "(google.api.http).get": "/v1/{parent=organizations/*}/sources" + "(google.api.http).get": "/v1/{parent=organizations/*}/sources", + "(google.api.method_signature)": "parent" } }, "RunAssetDiscovery": { @@ -98,7 +109,10 @@ "responseType": "google.longrunning.Operation", "options": { "(google.api.http).post": "/v1/{parent=organizations/*}/assets:runDiscovery", - "(google.api.http).body": "*" + "(google.api.http).body": "*", + "(google.api.method_signature)": "parent", + "(google.longrunning.operation_info).response_type": "google.cloud.securitycenter.v1.RunAssetDiscoveryResponse", + "(google.longrunning.operation_info).metadata_type": "google.protobuf.Empty" } }, "SetFindingState": { @@ -106,7 +120,8 @@ "responseType": "Finding", "options": { "(google.api.http).post": "/v1/{name=organizations/*/sources/*/findings/*}:setState", - "(google.api.http).body": "*" + "(google.api.http).body": "*", + "(google.api.method_signature)": "name,state,start_time" } }, "SetIamPolicy": { @@ -114,7 +129,8 @@ "responseType": "google.iam.v1.Policy", "options": { "(google.api.http).post": "/v1/{resource=organizations/*/sources/*}:setIamPolicy", - "(google.api.http).body": "*" + "(google.api.http).body": "*", + "(google.api.method_signature)": "resource,policy" } }, "TestIamPermissions": { @@ -122,7 +138,8 @@ "responseType": "google.iam.v1.TestIamPermissionsResponse", "options": { "(google.api.http).post": "/v1/{resource=organizations/*/sources/*}:testIamPermissions", - "(google.api.http).body": "*" + "(google.api.http).body": "*", + "(google.api.method_signature)": "resource,permissions" } }, "UpdateFinding": { @@ -130,7 +147,8 @@ "responseType": "Finding", "options": { "(google.api.http).patch": "/v1/{finding.name=organizations/*/sources/*/findings/*}", - "(google.api.http).body": "finding" + "(google.api.http).body": "finding", + "(google.api.method_signature)": "finding" } }, "UpdateOrganizationSettings": { @@ -138,7 +156,8 @@ "responseType": "OrganizationSettings", "options": { "(google.api.http).patch": "/v1/{organization_settings.name=organizations/*/organizationSettings}", - "(google.api.http).body": "organization_settings" + "(google.api.http).body": "organization_settings", + "(google.api.method_signature)": "organization_settings" } }, "UpdateSource": { @@ -146,7 +165,8 @@ "responseType": "Source", "options": { "(google.api.http).patch": "/v1/{source.name=organizations/*/sources/*}", - "(google.api.http).body": "source" + "(google.api.http).body": "source", + "(google.api.method_signature)": "source" } }, "UpdateSecurityMarks": { @@ -156,7 +176,8 @@ "(google.api.http).patch": "/v1/{security_marks.name=organizations/*/assets/*/securityMarks}", "(google.api.http).body": "security_marks", "(google.api.http).additional_bindings.patch": "/v1/{security_marks.name=organizations/*/sources/*/findings/*/securityMarks}", - "(google.api.http).additional_bindings.body": "security_marks" + "(google.api.http).additional_bindings.body": "security_marks", + "(google.api.method_signature)": "security_marks" } } } @@ -165,15 +186,25 @@ "fields": { "parent": { "type": "string", - "id": 1 + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "securitycenter.googleapis.com/Source" + } }, "findingId": { "type": "string", - "id": 2 + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } }, "finding": { "type": "Finding", - "id": 3 + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } } } }, @@ -181,11 +212,18 @@ "fields": { "parent": { "type": "string", - "id": 1 + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudresourcemanager.googleapis.com/Organization" + } }, "source": { "type": "Source", - "id": 2 + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } } } }, @@ -193,7 +231,11 @@ "fields": { "name": { "type": "string", - "id": 1 + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "securitycenter.googleapis.com/OrganizationSettings" + } } } }, @@ -201,7 +243,11 @@ "fields": { "name": { "type": "string", - "id": 1 + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "securitycenter.googleapis.com/Source" + } } } }, @@ -209,7 +255,11 @@ "fields": { "parent": { "type": "string", - "id": 1 + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudresourcemanager.googleapis.com/Organization" + } }, "filter": { "type": "string", @@ -217,7 +267,10 @@ }, "groupBy": { "type": "string", - "id": 3 + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } }, "compareDuration": { "type": "google.protobuf.Duration", @@ -235,13 +288,7 @@ "type": "int32", "id": 8 } - }, - "reserved": [ - [ - 6, - 6 - ] - ] + } }, "GroupAssetsResponse": { "fields": { @@ -268,7 +315,11 @@ "fields": { "parent": { "type": "string", - "id": 1 + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "securitycenter.googleapis.com/Source" + } }, "filter": { "type": "string", @@ -276,7 +327,10 @@ }, "groupBy": { "type": "string", - "id": 3 + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } }, "readTime": { "type": "google.protobuf.Timestamp", @@ -294,13 +348,7 @@ "type": "int32", "id": 8 } - }, - "reserved": [ - [ - 6, - 6 - ] - ] + } }, "GroupFindingsResponse": { "fields": { @@ -340,7 +388,11 @@ "fields": { "parent": { "type": "string", - "id": 1 + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudresourcemanager.googleapis.com/Organization" + } }, "pageToken": { "type": "string", @@ -369,7 +421,11 @@ "fields": { "parent": { "type": "string", - "id": 1 + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudresourcemanager.googleapis.com/Organization" + } }, "filter": { "type": "string", @@ -389,7 +445,10 @@ }, "fieldMask": { "type": "google.protobuf.FieldMask", - "id": 7 + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } }, "pageToken": { "type": "string", @@ -399,13 +458,7 @@ "type": "int32", "id": 9 } - }, - "reserved": [ - [ - 6, - 6 - ] - ] + } }, "ListAssetsResponse": { "fields": { @@ -456,7 +509,11 @@ "fields": { "parent": { "type": "string", - "id": 1 + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "securitycenter.googleapis.com/Source" + } }, "filter": { "type": "string", @@ -476,7 +533,10 @@ }, "fieldMask": { "type": "google.protobuf.FieldMask", - "id": 7 + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } }, "pageToken": { "type": "string", @@ -486,13 +546,7 @@ "type": "int32", "id": 9 } - }, - "reserved": [ - [ - 6, - 6 - ] - ] + } }, "ListFindingsResponse": { "fields": { @@ -544,15 +598,25 @@ "fields": { "name": { "type": "string", - "id": 1 + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "securitycenter.googleapis.com/Finding" + } }, "state": { "type": "Finding.State", - "id": 2 + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } }, "startTime": { "type": "google.protobuf.Timestamp", - "id": 3 + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } } } }, @@ -560,7 +624,11 @@ "fields": { "parent": { "type": "string", - "id": 1 + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudresourcemanager.googleapis.com/Organization" + } } } }, @@ -568,7 +636,10 @@ "fields": { "finding": { "type": "Finding", - "id": 1 + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } }, "updateMask": { "type": "google.protobuf.FieldMask", @@ -580,7 +651,10 @@ "fields": { "organizationSettings": { "type": "OrganizationSettings", - "id": 1 + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } }, "updateMask": { "type": "google.protobuf.FieldMask", @@ -592,7 +666,10 @@ "fields": { "source": { "type": "Source", - "id": 1 + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } }, "updateMask": { "type": "google.protobuf.FieldMask", @@ -604,7 +681,10 @@ "fields": { "securityMarks": { "type": "SecurityMarks", - "id": 1 + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } }, "updateMask": { "type": "google.protobuf.FieldMask", @@ -617,6 +697,10 @@ } }, "Asset": { + "options": { + "(google.api.resource).type": "securitycenter.googleapis.com/Asset", + "(google.api.resource).pattern": "organizations/{organization}/assets/{asset}" + }, "fields": { "name": { "type": "string", @@ -685,6 +769,10 @@ } }, "SecurityMarks": { + "options": { + "(google.api.resource).type": "securitycenter.googleapis.com/SecurityMarks", + "(google.api.resource).pattern": "organizations/{organization}/sources/{source}/findings/{finding}/securityMarks" + }, "fields": { "name": { "type": "string", @@ -698,6 +786,10 @@ } }, "Finding": { + "options": { + "(google.api.resource).type": "securitycenter.googleapis.com/Finding", + "(google.api.resource).pattern": "organizations/{organization}/sources/{source}/findings/{finding}" + }, "fields": { "name": { "type": "string", @@ -730,7 +822,10 @@ }, "securityMarks": { "type": "SecurityMarks", - "id": 8 + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } }, "eventTime": { "type": "google.protobuf.Timestamp", @@ -752,6 +847,10 @@ } }, "OrganizationSettings": { + "options": { + "(google.api.resource).type": "securitycenter.googleapis.com/OrganizationSettings", + "(google.api.resource).pattern": "organizations/{organization}/organizationSettings" + }, "fields": { "name": { "type": "string", @@ -766,16 +865,6 @@ "id": 3 } }, - "reserved": [ - [ - 4, - 4 - ], - [ - 5, - 5 - ] - ], "nested": { "AssetDiscoveryConfig": { "fields": { @@ -824,6 +913,10 @@ } }, "Source": { + "options": { + "(google.api.resource).type": "securitycenter.googleapis.com/Source", + "(google.api.resource).pattern": "organizations/{organization}/sources/{source}" + }, "fields": { "name": { "type": "string", @@ -837,13 +930,7 @@ "type": "string", "id": 3 } - }, - "reserved": [ - [ - 4, - 4 - ] - ] + } } } }, diff --git a/packages/google-cloud-securitycenter/src/v1/doc/google/cloud/securitycenter/v1/doc_asset.js b/packages/google-cloud-securitycenter/src/v1/doc/google/cloud/securitycenter/v1/doc_asset.js index db52a32f282..285508ee5da 100644 --- a/packages/google-cloud-securitycenter/src/v1/doc/google/cloud/securitycenter/v1/doc_asset.js +++ b/packages/google-cloud-securitycenter/src/v1/doc/google/cloud/securitycenter/v1/doc_asset.js @@ -27,7 +27,7 @@ * The relative resource name of this asset. See: * https://cloud.google.com/apis/design/resource_names#relative_resource_name * Example: - * "organizations/123/assets/456". + * "organizations/{organization_id}/assets/{asset_id}". * * @property {Object} securityCenterProperties * Cloud SCC managed properties. These properties are managed by diff --git a/packages/google-cloud-securitycenter/src/v1/doc/google/cloud/securitycenter/v1/doc_finding.js b/packages/google-cloud-securitycenter/src/v1/doc/google/cloud/securitycenter/v1/doc_finding.js index 4a275e7c35c..2e2170cd5e3 100644 --- a/packages/google-cloud-securitycenter/src/v1/doc/google/cloud/securitycenter/v1/doc_finding.js +++ b/packages/google-cloud-securitycenter/src/v1/doc/google/cloud/securitycenter/v1/doc_finding.js @@ -18,28 +18,31 @@ /** * Cloud Security Command Center (Cloud SCC) finding. * - * A finding is a record of assessment data (security, risk, health or privacy) - * ingested into Cloud SCC for presentation, notification, analysis, - * policy testing, and enforcement. For example, an XSS vulnerability in an - * App Engine application is a finding. + * A finding is a record of assessment data like security, risk, health, or + * privacy, that is ingested into Cloud SCC for presentation, notification, + * analysis, policy testing, and enforcement. For example, a + * cross-site scripting (XSS) vulnerability in an App Engine application is a + * finding. * * @property {string} name * The relative resource name of this finding. See: * https://cloud.google.com/apis/design/resource_names#relative_resource_name * Example: - * "organizations/123/sources/456/findings/789" + * "organizations/{organization_id}/sources/{source_id}/findings/{finding_id}" * * @property {string} parent * The relative resource name of the source the finding belongs to. See: * https://cloud.google.com/apis/design/resource_names#relative_resource_name * This field is immutable after creation time. * For example: - * "organizations/123/sources/456" + * "organizations/{organization_id}/sources/{source_id}" * * @property {string} resourceName - * The full resource name of the Google Cloud Platform (GCP) resource this - * finding is for. See: + * For findings on Google Cloud Platform (GCP) resources, the full resource + * name of the GCP resource this finding is for. See: * https://cloud.google.com/apis/design/resource_names#full_resource_name + * When the finding is for a non-GCP resource, the resourceName can be a + * customer or partner defined string. * This field is immutable after creation time. * * @property {number} state @@ -72,8 +75,8 @@ * * @property {Object} eventTime * The time at which the event took place. For example, if the finding - * represents an open firewall it would capture the time the open firewall was - * detected. + * represents an open firewall it would capture the time the detector believes + * the firewall became open. The accuracy is determined by the detector. * * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} * diff --git a/packages/google-cloud-securitycenter/src/v1/doc/google/cloud/securitycenter/v1/doc_organization_settings.js b/packages/google-cloud-securitycenter/src/v1/doc/google/cloud/securitycenter/v1/doc_organization_settings.js index 734d0306e4f..be8bd7e92dd 100644 --- a/packages/google-cloud-securitycenter/src/v1/doc/google/cloud/securitycenter/v1/doc_organization_settings.js +++ b/packages/google-cloud-securitycenter/src/v1/doc/google/cloud/securitycenter/v1/doc_organization_settings.js @@ -23,7 +23,7 @@ * The relative resource name of the settings. See: * https://cloud.google.com/apis/design/resource_names#relative_resource_name * Example: - * "organizations/123/organizationSettings". + * "organizations/{organization_id}/organizationSettings". * * @property {boolean} enableAssetDiscovery * A flag that indicates if Asset Discovery should be enabled. If the flag is diff --git a/packages/google-cloud-securitycenter/src/v1/doc/google/cloud/securitycenter/v1/doc_security_marks.js b/packages/google-cloud-securitycenter/src/v1/doc/google/cloud/securitycenter/v1/doc_security_marks.js index 30114cbe6b6..d0e39768ca5 100644 --- a/packages/google-cloud-securitycenter/src/v1/doc/google/cloud/securitycenter/v1/doc_security_marks.js +++ b/packages/google-cloud-securitycenter/src/v1/doc/google/cloud/securitycenter/v1/doc_security_marks.js @@ -25,16 +25,17 @@ * The relative resource name of the SecurityMarks. See: * https://cloud.google.com/apis/design/resource_names#relative_resource_name * Examples: - * "organizations/123/assets/456/securityMarks" - * "organizations/123/sources/456/findings/789/securityMarks". + * "organizations/{organization_id}/assets/{asset_id}/securityMarks" + * "organizations/{organization_id}/sources/{source_id}/findings/{finding_id}/securityMarks". * * @property {Object.} marks * Mutable user specified security marks belonging to the parent resource. * Constraints are as follows: - * - Keys and values are treated as case insensitive - * - Keys must be between 1 - 256 characters (inclusive) - * - Keys must be letters, numbers, underscores, or dashes - * - Values have leading and trailing whitespace trimmed, remaining + * + * * Keys and values are treated as case insensitive + * * Keys must be between 1 - 256 characters (inclusive) + * * Keys must be letters, numbers, underscores, or dashes + * * Values have leading and trailing whitespace trimmed, remaining * characters must be between 1 - 4096 characters (inclusive) * * @typedef SecurityMarks diff --git a/packages/google-cloud-securitycenter/src/v1/doc/google/cloud/securitycenter/v1/doc_securitycenter_service.js b/packages/google-cloud-securitycenter/src/v1/doc/google/cloud/securitycenter/v1/doc_securitycenter_service.js index 5e52ff07702..304ab23f148 100644 --- a/packages/google-cloud-securitycenter/src/v1/doc/google/cloud/securitycenter/v1/doc_securitycenter_service.js +++ b/packages/google-cloud-securitycenter/src/v1/doc/google/cloud/securitycenter/v1/doc_securitycenter_service.js @@ -19,16 +19,16 @@ * Request message for creating a finding. * * @property {string} parent - * Resource name of the new finding's parent. Its format should be + * Required. Resource name of the new finding's parent. Its format should be * "organizations/[organization_id]/sources/[source_id]". * * @property {string} findingId - * Unique identifier provided by the client within the parent scope. + * Required. Unique identifier provided by the client within the parent scope. * It must be alphanumeric and less than or equal to 32 characters and * greater than 0 characters in length. * * @property {Object} finding - * The Finding being created. The name and security_marks will be ignored as + * Required. The Finding being created. The name and security_marks will be ignored as * they are both output only fields on this resource. * * This object should have the same structure as [Finding]{@link google.cloud.securitycenter.v1.Finding} @@ -45,11 +45,11 @@ const CreateFindingRequest = { * Request message for creating a source. * * @property {string} parent - * Resource name of the new source's parent. Its format should be + * Required. Resource name of the new source's parent. Its format should be * "organizations/[organization_id]". * * @property {Object} source - * The Source being created, only the display_name and description will be + * Required. The Source being created, only the display_name and description will be * used. All other fields will be ignored. * * This object should have the same structure as [Source]{@link google.cloud.securitycenter.v1.Source} @@ -66,7 +66,7 @@ const CreateSourceRequest = { * Request message for getting organization settings. * * @property {string} name - * Name of the organization to get organization settings for. Its format is + * Required. Name of the organization to get organization settings for. Its format is * "organizations/[organization_id]/organizationSettings". * * @typedef GetOrganizationSettingsRequest @@ -81,7 +81,7 @@ const GetOrganizationSettingsRequest = { * Request message for getting a source. * * @property {string} name - * Relative resource name of the source. Its format is + * Required. Relative resource name of the source. Its format is * "organizations/[organization_id]/source/[source_id]". * * @typedef GetSourceRequest @@ -96,7 +96,7 @@ const GetSourceRequest = { * Request message for grouping by assets. * * @property {string} parent - * Name of the organization to groupBy. Its format is + * Required. Name of the organization to groupBy. Its format is * "organizations/[organization_id]". * * @property {string} filter @@ -127,34 +127,35 @@ const GetSourceRequest = { * * boolean literals `true` and `false` without quotes. * * The following field and operator combinations are supported: - * name | '=' - * update_time | '=', '>', '<', '>=', '<=' + * + * * name: `=` + * * update_time: `=`, `>`, `<`, `>=`, `<=` * * Usage: This should be milliseconds since epoch or an RFC3339 string. * Examples: * "update_time = \"2019-06-10T16:07:18-07:00\"" * "update_time = 1560208038000" * - * create_time | '=', '>', '<', '>=', '<=' + * * create_time: `=`, `>`, `<`, `>=`, `<=` * * Usage: This should be milliseconds since epoch or an RFC3339 string. * Examples: * "create_time = \"2019-06-10T16:07:18-07:00\"" * "create_time = 1560208038000" * - * iam_policy.policy_blob | '=', ':' - * resource_properties | '=', ':', '>', '<', '>=', '<=' - * security_marks | '=', ':' - * security_center_properties.resource_name | '=', ':' - * security_center_properties.resource_type | '=', ':' - * security_center_properties.resource_parent | '=', ':' - * security_center_properties.resource_project | '=', ':' - * security_center_properties.resource_owners | '=', ':' + * * iam_policy.policy_blob: `=`, `:` + * * resource_properties: `=`, `:`, `>`, `<`, `>=`, `<=` + * * security_marks.marks: `=`, `:` + * * security_center_properties.resource_name: `=`, `:` + * * security_center_properties.resource_type: `=`, `:` + * * security_center_properties.resource_parent: `=`, `:` + * * security_center_properties.resource_project: `=`, `:` + * * security_center_properties.resource_owners: `=`, `:` * * For example, `resource_properties.size = 100` is a valid filter string. * * @property {string} groupBy - * Expression that defines what assets fields to use for grouping. The string + * Required. Expression that defines what assets fields to use for grouping. The string * value should follow SQL syntax: comma separated list of fields. For * example: * "security_center_properties.resource_project,security_center_properties.project". @@ -259,10 +260,10 @@ const GroupAssetsResponse = { * Request message for grouping by findings. * * @property {string} parent - * Name of the source to groupBy. Its format is + * Required. Name of the source to groupBy. Its format is * "organizations/[organization_id]/sources/[source_id]". To groupBy across * all sources provide a source_id of `-`. For example: - * organizations/123/sources/- + * organizations/{organization_id}/sources/- * * @property {string} filter * Expression that defines the filter to apply across findings. @@ -290,26 +291,27 @@ const GroupAssetsResponse = { * * boolean literals `true` and `false` without quotes. * * The following field and operator combinations are supported: - * name | `=` - * parent | '=', ':' - * resource_name | '=', ':' - * state | '=', ':' - * category | '=', ':' - * external_uri | '=', ':' - * event_time | `=`, `>`, `<`, `>=`, `<=` + * + * * name: `=` + * * parent: `=`, `:` + * * resource_name: `=`, `:` + * * state: `=`, `:` + * * category: `=`, `:` + * * external_uri: `=`, `:` + * * event_time: `=`, `>`, `<`, `>=`, `<=` * * Usage: This should be milliseconds since epoch or an RFC3339 string. * Examples: * "event_time = \"2019-06-10T16:07:18-07:00\"" * "event_time = 1560208038000" * - * security_marks | '=', ':' - * source_properties | '=', ':', `>`, `<`, `>=`, `<=` + * * security_marks.marks: `=`, `:` + * * source_properties: `=`, `:`, `>`, `<`, `>=`, `<=` * * For example, `source_properties.size = 100` is a valid filter string. * * @property {string} groupBy - * Expression that defines what assets fields to use for grouping (including + * Required. Expression that defines what assets fields to use for grouping (including * `state_change`). The string value should follow SQL syntax: comma separated * list of fields. For example: "parent,resource_name". * @@ -430,7 +432,7 @@ const GroupResult = { * Request message for listing sources. * * @property {string} parent - * Resource name of the parent of sources to list. Its format should be + * Required. Resource name of the parent of sources to list. Its format should be * "organizations/[organization_id]". * * @property {string} pageToken @@ -474,7 +476,7 @@ const ListSourcesResponse = { * Request message for listing assets. * * @property {string} parent - * Name of the organization assets should belong to. Its format is + * Required. Name of the organization assets should belong to. Its format is * "organizations/[organization_id]". * * @property {string} filter @@ -505,29 +507,30 @@ const ListSourcesResponse = { * * boolean literals `true` and `false` without quotes. * * The following are the allowed field and operator combinations: - * name | `=` - * update_time | `=`, `>`, `<`, `>=`, `<=` + * + * * name: `=` + * * update_time: `=`, `>`, `<`, `>=`, `<=` * * Usage: This should be milliseconds since epoch or an RFC3339 string. * Examples: * "update_time = \"2019-06-10T16:07:18-07:00\"" * "update_time = 1560208038000" * - * create_time | `=`, `>`, `<`, `>=`, `<=` + * * create_time: `=`, `>`, `<`, `>=`, `<=` * * Usage: This should be milliseconds since epoch or an RFC3339 string. * Examples: * "create_time = \"2019-06-10T16:07:18-07:00\"" * "create_time = 1560208038000" * - * iam_policy.policy_blob | '=', ':' - * resource_properties | '=', ':', `>`, `<`, `>=`, `<=` - * security_marks | '=', ':' - * security_center_properties.resource_name | '=', ':' - * security_center_properties.resource_type | '=', ':' - * security_center_properties.resource_parent | '=', ':' - * security_center_properties.resource_project | '=', ':' - * security_center_properties.resource_owners | '=', ':' + * * iam_policy.policy_blob: `=`, `:` + * * resource_properties: `=`, `:`, `>`, `<`, `>=`, `<=` + * * security_marks.marks: `=`, `:` + * * security_center_properties.resource_name: `=`, `:` + * * security_center_properties.resource_type: `=`, `:` + * * security_center_properties.resource_parent: `=`, `:` + * * security_center_properties.resource_project: `=`, `:` + * * security_center_properties.resource_owners: `=`, `:` * * For example, `resource_properties.size = 100` is a valid filter string. * @@ -545,7 +548,7 @@ const ListSourcesResponse = { * name * update_time * resource_properties - * security_marks + * security_marks.marks * security_center_properties.resource_name * security_center_properties.resource_parent * security_center_properties.resource_project @@ -588,9 +591,7 @@ const ListSourcesResponse = { * This object should have the same structure as [Duration]{@link google.protobuf.Duration} * * @property {Object} fieldMask - * Optional. - * - * A field mask to specify the ListAssetsResult fields to be listed in the + * Optional. A field mask to specify the ListAssetsResult fields to be listed in the * response. * An empty field mask will list all fields. * @@ -700,10 +701,10 @@ const ListAssetsResponse = { * Request message for listing findings. * * @property {string} parent - * Name of the source the findings belong to. Its format is + * Required. Name of the source the findings belong to. Its format is * "organizations/[organization_id]/sources/[source_id]". To list across all * sources provide a source_id of `-`. For example: - * organizations/123/sources/- + * organizations/{organization_id}/sources/- * * @property {string} filter * Expression that defines the filter to apply across findings. @@ -731,21 +732,22 @@ const ListAssetsResponse = { * * boolean literals `true` and `false` without quotes. * * The following field and operator combinations are supported: - * name | `=` - * parent | '=', ':' - * resource_name | '=', ':' - * state | '=', ':' - * category | '=', ':' - * external_uri | '=', ':' - * event_time | `=`, `>`, `<`, `>=`, `<=` + * + * name: `=` + * parent: `=`, `:` + * resource_name: `=`, `:` + * state: `=`, `:` + * category: `=`, `:` + * external_uri: `=`, `:` + * event_time: `=`, `>`, `<`, `>=`, `<=` * * Usage: This should be milliseconds since epoch or an RFC3339 string. * Examples: * "event_time = \"2019-06-10T16:07:18-07:00\"" * "event_time = 1560208038000" * - * security_marks | '=', ':' - * source_properties | '=', ':', `>`, `<`, `>=`, `<=` + * security_marks.marks: `=`, `:` + * source_properties: `=`, `:`, `>`, `<`, `>=`, `<=` * * For example, `source_properties.size = 100` is a valid filter string. * @@ -767,7 +769,7 @@ const ListAssetsResponse = { * resource_name * event_time * source_properties - * security_marks + * security_marks.marks * * @property {Object} readTime * Time used as a reference point when filtering findings. The filter is @@ -806,9 +808,7 @@ const ListAssetsResponse = { * This object should have the same structure as [Duration]{@link google.protobuf.Duration} * * @property {Object} fieldMask - * Optional. - * - * A field mask to specify the Finding fields to be listed in the response. + * Optional. A field mask to specify the Finding fields to be listed in the response. * An empty field mask will list all fields. * * This object should have the same structure as [FieldMask]{@link google.protobuf.FieldMask} @@ -927,18 +927,18 @@ const ListFindingsResponse = { * Request message for updating a finding's state. * * @property {string} name - * The relative resource name of the finding. See: + * Required. The relative resource name of the finding. See: * https://cloud.google.com/apis/design/resource_names#relative_resource_name * Example: - * "organizations/123/sources/456/finding/789". + * "organizations/{organization_id}/sources/{source_id}/finding/{finding_id}". * * @property {number} state - * The desired State of the finding. + * Required. The desired State of the finding. * * The number should be among the values of [State]{@link google.cloud.securitycenter.v1.State} * * @property {Object} startTime - * The time at which the updated state takes effect. + * Required. The time at which the updated state takes effect. * * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} * @@ -954,7 +954,7 @@ const SetFindingStateRequest = { * Request message for running asset discovery for an organization. * * @property {string} parent - * Name of the organization to run asset discovery for. Its format is + * Required. Name of the organization to run asset discovery for. Its format is * "organizations/[organization_id]". * * @typedef RunAssetDiscoveryRequest @@ -969,7 +969,7 @@ const RunAssetDiscoveryRequest = { * Request message for updating or creating a finding. * * @property {Object} finding - * The finding resource to update or create if it does not already exist. + * Required. The finding resource to update or create if it does not already exist. * parent, security_marks, and update_time will be ignored. * * In the case of creation, the finding id portion of the name must be @@ -1001,7 +1001,7 @@ const UpdateFindingRequest = { * Request message for updating an organization's settings. * * @property {Object} organizationSettings - * The organization settings resource to update. + * Required. The organization settings resource to update. * * This object should have the same structure as [OrganizationSettings]{@link google.cloud.securitycenter.v1.OrganizationSettings} * @@ -1024,7 +1024,7 @@ const UpdateOrganizationSettingsRequest = { * Request message for updating a source. * * @property {Object} source - * The source resource to update. + * Required. The source resource to update. * * This object should have the same structure as [Source]{@link google.cloud.securitycenter.v1.Source} * @@ -1047,7 +1047,7 @@ const UpdateSourceRequest = { * Request message for updating a SecurityMarks resource. * * @property {Object} securityMarks - * The security marks resource to update. + * Required. The security marks resource to update. * * This object should have the same structure as [SecurityMarks]{@link google.cloud.securitycenter.v1.SecurityMarks} * diff --git a/packages/google-cloud-securitycenter/src/v1/doc/google/cloud/securitycenter/v1/doc_source.js b/packages/google-cloud-securitycenter/src/v1/doc/google/cloud/securitycenter/v1/doc_source.js index 98b8fc3568c..ba85e2bab35 100644 --- a/packages/google-cloud-securitycenter/src/v1/doc/google/cloud/securitycenter/v1/doc_source.js +++ b/packages/google-cloud-securitycenter/src/v1/doc/google/cloud/securitycenter/v1/doc_source.js @@ -18,31 +18,30 @@ /** * Cloud Security Command Center's (Cloud SCC) finding source. A finding source * is an entity or a mechanism that can produce a finding. A source is like a - * container of findings that come from the same scanner, logger, monitor, etc. + * container of findings that come from the same scanner, logger, monitor, and + * other tools. * * @property {string} name * The relative resource name of this source. See: * https://cloud.google.com/apis/design/resource_names#relative_resource_name * Example: - * "organizations/123/sources/456" + * "organizations/{organization_id}/sources/{source_id}" * * @property {string} displayName - * The source’s display name. - * A source’s display name must be unique amongst its siblings, for example, + * The source's display name. + * A source's display name must be unique amongst its siblings, for example, * two sources with the same parent can't share the same display name. - * The display name must start and end with a letter or digit, may contain - * letters, digits, spaces, hyphens, and underscores, and can be no longer - * than 32 characters. This is captured by the regular expression: - * `\[\p{L}\p{N}]({\p{L}\p{N}_- ]{0,30}[\p{L}\p{N}])?`. + * The display name must have a length between 1 and 64 characters + * (inclusive). * * @property {string} description * The description of the source (max of 1024 characters). * Example: - * "Cloud Security Scanner is a web security scanner for common + * "Web Security Scanner is a web security scanner for common * vulnerabilities in App Engine applications. It can automatically * scan and detect four common vulnerabilities, including cross-site-scripting * (XSS), Flash injection, mixed content (HTTP in HTTPS), and - * outdated/insecure libraries." + * outdated or insecure libraries." * * @typedef Source * @memberof google.cloud.securitycenter.v1 diff --git a/packages/google-cloud-securitycenter/src/v1/security_center_client.js b/packages/google-cloud-securitycenter/src/v1/security_center_client.js index a407069fc4c..a26bd809107 100644 --- a/packages/google-cloud-securitycenter/src/v1/security_center_client.js +++ b/packages/google-cloud-securitycenter/src/v1/security_center_client.js @@ -320,10 +320,10 @@ class SecurityCenterClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Resource name of the new source's parent. Its format should be + * Required. Resource name of the new source's parent. Its format should be * "organizations/[organization_id]". * @param {Object} request.source - * The Source being created, only the display_name and description will be + * Required. The Source being created, only the display_name and description will be * used. All other fields will be ignored. * * This object should have the same structure as [Source]{@link google.cloud.securitycenter.v1.Source} @@ -386,14 +386,14 @@ class SecurityCenterClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Resource name of the new finding's parent. Its format should be + * Required. Resource name of the new finding's parent. Its format should be * "organizations/[organization_id]/sources/[source_id]". * @param {string} request.findingId - * Unique identifier provided by the client within the parent scope. + * Required. Unique identifier provided by the client within the parent scope. * It must be alphanumeric and less than or equal to 32 characters and * greater than 0 characters in length. * @param {Object} request.finding - * The Finding being created. The name and security_marks will be ignored as + * Required. The Finding being created. The name and security_marks will be ignored as * they are both output only fields on this resource. * * This object should have the same structure as [Finding]{@link google.cloud.securitycenter.v1.Finding} @@ -517,7 +517,7 @@ class SecurityCenterClient { * @param {Object} request * The request object that will be sent. * @param {string} request.name - * Name of the organization to get organization settings for. Its format is + * Required. Name of the organization to get organization settings for. Its format is * "organizations/[organization_id]/organizationSettings". * @param {Object} [options] * Optional parameters. You can override the default settings for this call, e.g, timeout, @@ -576,7 +576,7 @@ class SecurityCenterClient { * @param {Object} request * The request object that will be sent. * @param {string} request.name - * Relative resource name of the source. Its format is + * Required. Relative resource name of the source. Its format is * "organizations/[organization_id]/source/[source_id]". * @param {Object} [options] * Optional parameters. You can override the default settings for this call, e.g, timeout, @@ -632,10 +632,10 @@ class SecurityCenterClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Name of the organization to groupBy. Its format is + * Required. Name of the organization to groupBy. Its format is * "organizations/[organization_id]". * @param {string} request.groupBy - * Expression that defines what assets fields to use for grouping. The string + * Required. Expression that defines what assets fields to use for grouping. The string * value should follow SQL syntax: comma separated list of fields. For * example: * "security_center_properties.resource_project,security_center_properties.project". @@ -677,29 +677,30 @@ class SecurityCenterClient { * * boolean literals `true` and `false` without quotes. * * The following field and operator combinations are supported: - * name | '=' - * update_time | '=', '>', '<', '>=', '<=' + * + * * name: `=` + * * update_time: `=`, `>`, `<`, `>=`, `<=` * * Usage: This should be milliseconds since epoch or an RFC3339 string. * Examples: * "update_time = \"2019-06-10T16:07:18-07:00\"" * "update_time = 1560208038000" * - * create_time | '=', '>', '<', '>=', '<=' + * * create_time: `=`, `>`, `<`, `>=`, `<=` * * Usage: This should be milliseconds since epoch or an RFC3339 string. * Examples: * "create_time = \"2019-06-10T16:07:18-07:00\"" * "create_time = 1560208038000" * - * iam_policy.policy_blob | '=', ':' - * resource_properties | '=', ':', '>', '<', '>=', '<=' - * security_marks | '=', ':' - * security_center_properties.resource_name | '=', ':' - * security_center_properties.resource_type | '=', ':' - * security_center_properties.resource_parent | '=', ':' - * security_center_properties.resource_project | '=', ':' - * security_center_properties.resource_owners | '=', ':' + * * iam_policy.policy_blob: `=`, `:` + * * resource_properties: `=`, `:`, `>`, `<`, `>=`, `<=` + * * security_marks.marks: `=`, `:` + * * security_center_properties.resource_name: `=`, `:` + * * security_center_properties.resource_type: `=`, `:` + * * security_center_properties.resource_parent: `=`, `:` + * * security_center_properties.resource_project: `=`, `:` + * * security_center_properties.resource_owners: `=`, `:` * * For example, `resource_properties.size = 100` is a valid filter string. * @param {Object} [request.compareDuration] @@ -860,10 +861,10 @@ class SecurityCenterClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Name of the organization to groupBy. Its format is + * Required. Name of the organization to groupBy. Its format is * "organizations/[organization_id]". * @param {string} request.groupBy - * Expression that defines what assets fields to use for grouping. The string + * Required. Expression that defines what assets fields to use for grouping. The string * value should follow SQL syntax: comma separated list of fields. For * example: * "security_center_properties.resource_project,security_center_properties.project". @@ -905,29 +906,30 @@ class SecurityCenterClient { * * boolean literals `true` and `false` without quotes. * * The following field and operator combinations are supported: - * name | '=' - * update_time | '=', '>', '<', '>=', '<=' + * + * * name: `=` + * * update_time: `=`, `>`, `<`, `>=`, `<=` * * Usage: This should be milliseconds since epoch or an RFC3339 string. * Examples: * "update_time = \"2019-06-10T16:07:18-07:00\"" * "update_time = 1560208038000" * - * create_time | '=', '>', '<', '>=', '<=' + * * create_time: `=`, `>`, `<`, `>=`, `<=` * * Usage: This should be milliseconds since epoch or an RFC3339 string. * Examples: * "create_time = \"2019-06-10T16:07:18-07:00\"" * "create_time = 1560208038000" * - * iam_policy.policy_blob | '=', ':' - * resource_properties | '=', ':', '>', '<', '>=', '<=' - * security_marks | '=', ':' - * security_center_properties.resource_name | '=', ':' - * security_center_properties.resource_type | '=', ':' - * security_center_properties.resource_parent | '=', ':' - * security_center_properties.resource_project | '=', ':' - * security_center_properties.resource_owners | '=', ':' + * * iam_policy.policy_blob: `=`, `:` + * * resource_properties: `=`, `:`, `>`, `<`, `>=`, `<=` + * * security_marks.marks: `=`, `:` + * * security_center_properties.resource_name: `=`, `:` + * * security_center_properties.resource_type: `=`, `:` + * * security_center_properties.resource_parent: `=`, `:` + * * security_center_properties.resource_project: `=`, `:` + * * security_center_properties.resource_owners: `=`, `:` * * For example, `resource_properties.size = 100` is a valid filter string. * @param {Object} [request.compareDuration] @@ -1015,17 +1017,17 @@ class SecurityCenterClient { * specified properties. * * To group across all sources provide a `-` as the source id. - * Example: /v1/organizations/123/sources/-/findings + * Example: /v1/organizations/{organization_id}/sources/-/findings * * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Name of the source to groupBy. Its format is + * Required. Name of the source to groupBy. Its format is * "organizations/[organization_id]/sources/[source_id]". To groupBy across * all sources provide a source_id of `-`. For example: - * organizations/123/sources/- + * organizations/{organization_id}/sources/- * @param {string} request.groupBy - * Expression that defines what assets fields to use for grouping (including + * Required. Expression that defines what assets fields to use for grouping (including * `state_change`). The string value should follow SQL syntax: comma separated * list of fields. For example: "parent,resource_name". * @@ -1065,21 +1067,22 @@ class SecurityCenterClient { * * boolean literals `true` and `false` without quotes. * * The following field and operator combinations are supported: - * name | `=` - * parent | '=', ':' - * resource_name | '=', ':' - * state | '=', ':' - * category | '=', ':' - * external_uri | '=', ':' - * event_time | `=`, `>`, `<`, `>=`, `<=` + * + * * name: `=` + * * parent: `=`, `:` + * * resource_name: `=`, `:` + * * state: `=`, `:` + * * category: `=`, `:` + * * external_uri: `=`, `:` + * * event_time: `=`, `>`, `<`, `>=`, `<=` * * Usage: This should be milliseconds since epoch or an RFC3339 string. * Examples: * "event_time = \"2019-06-10T16:07:18-07:00\"" * "event_time = 1560208038000" * - * security_marks | '=', ':' - * source_properties | '=', ':', `>`, `<`, `>=`, `<=` + * * security_marks.marks: `=`, `:` + * * source_properties: `=`, `:`, `>`, `<`, `>=`, `<=` * * For example, `source_properties.size = 100` is a valid filter string. * @param {Object} [request.readTime] @@ -1239,12 +1242,12 @@ class SecurityCenterClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Name of the source to groupBy. Its format is + * Required. Name of the source to groupBy. Its format is * "organizations/[organization_id]/sources/[source_id]". To groupBy across * all sources provide a source_id of `-`. For example: - * organizations/123/sources/- + * organizations/{organization_id}/sources/- * @param {string} request.groupBy - * Expression that defines what assets fields to use for grouping (including + * Required. Expression that defines what assets fields to use for grouping (including * `state_change`). The string value should follow SQL syntax: comma separated * list of fields. For example: "parent,resource_name". * @@ -1284,21 +1287,22 @@ class SecurityCenterClient { * * boolean literals `true` and `false` without quotes. * * The following field and operator combinations are supported: - * name | `=` - * parent | '=', ':' - * resource_name | '=', ':' - * state | '=', ':' - * category | '=', ':' - * external_uri | '=', ':' - * event_time | `=`, `>`, `<`, `>=`, `<=` + * + * * name: `=` + * * parent: `=`, `:` + * * resource_name: `=`, `:` + * * state: `=`, `:` + * * category: `=`, `:` + * * external_uri: `=`, `:` + * * event_time: `=`, `>`, `<`, `>=`, `<=` * * Usage: This should be milliseconds since epoch or an RFC3339 string. * Examples: * "event_time = \"2019-06-10T16:07:18-07:00\"" * "event_time = 1560208038000" * - * security_marks | '=', ':' - * source_properties | '=', ':', `>`, `<`, `>=`, `<=` + * * security_marks.marks: `=`, `:` + * * source_properties: `=`, `:`, `>`, `<`, `>=`, `<=` * * For example, `source_properties.size = 100` is a valid filter string. * @param {Object} [request.readTime] @@ -1386,7 +1390,7 @@ class SecurityCenterClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Name of the organization assets should belong to. Its format is + * Required. Name of the organization assets should belong to. Its format is * "organizations/[organization_id]". * @param {string} [request.filter] * Expression that defines the filter to apply across assets. @@ -1416,29 +1420,30 @@ class SecurityCenterClient { * * boolean literals `true` and `false` without quotes. * * The following are the allowed field and operator combinations: - * name | `=` - * update_time | `=`, `>`, `<`, `>=`, `<=` + * + * * name: `=` + * * update_time: `=`, `>`, `<`, `>=`, `<=` * * Usage: This should be milliseconds since epoch or an RFC3339 string. * Examples: * "update_time = \"2019-06-10T16:07:18-07:00\"" * "update_time = 1560208038000" * - * create_time | `=`, `>`, `<`, `>=`, `<=` + * * create_time: `=`, `>`, `<`, `>=`, `<=` * * Usage: This should be milliseconds since epoch or an RFC3339 string. * Examples: * "create_time = \"2019-06-10T16:07:18-07:00\"" * "create_time = 1560208038000" * - * iam_policy.policy_blob | '=', ':' - * resource_properties | '=', ':', `>`, `<`, `>=`, `<=` - * security_marks | '=', ':' - * security_center_properties.resource_name | '=', ':' - * security_center_properties.resource_type | '=', ':' - * security_center_properties.resource_parent | '=', ':' - * security_center_properties.resource_project | '=', ':' - * security_center_properties.resource_owners | '=', ':' + * * iam_policy.policy_blob: `=`, `:` + * * resource_properties: `=`, `:`, `>`, `<`, `>=`, `<=` + * * security_marks.marks: `=`, `:` + * * security_center_properties.resource_name: `=`, `:` + * * security_center_properties.resource_type: `=`, `:` + * * security_center_properties.resource_parent: `=`, `:` + * * security_center_properties.resource_project: `=`, `:` + * * security_center_properties.resource_owners: `=`, `:` * * For example, `resource_properties.size = 100` is a valid filter string. * @param {string} [request.orderBy] @@ -1455,7 +1460,7 @@ class SecurityCenterClient { * name * update_time * resource_properties - * security_marks + * security_marks.marks * security_center_properties.resource_name * security_center_properties.resource_parent * security_center_properties.resource_project @@ -1495,9 +1500,7 @@ class SecurityCenterClient { * * This object should have the same structure as [Duration]{@link google.protobuf.Duration} * @param {Object} [request.fieldMask] - * Optional. - * - * A field mask to specify the ListAssetsResult fields to be listed in the + * Optional. A field mask to specify the ListAssetsResult fields to be listed in the * response. * An empty field mask will list all fields. * @@ -1613,7 +1616,7 @@ class SecurityCenterClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Name of the organization assets should belong to. Its format is + * Required. Name of the organization assets should belong to. Its format is * "organizations/[organization_id]". * @param {string} [request.filter] * Expression that defines the filter to apply across assets. @@ -1643,29 +1646,30 @@ class SecurityCenterClient { * * boolean literals `true` and `false` without quotes. * * The following are the allowed field and operator combinations: - * name | `=` - * update_time | `=`, `>`, `<`, `>=`, `<=` + * + * * name: `=` + * * update_time: `=`, `>`, `<`, `>=`, `<=` * * Usage: This should be milliseconds since epoch or an RFC3339 string. * Examples: * "update_time = \"2019-06-10T16:07:18-07:00\"" * "update_time = 1560208038000" * - * create_time | `=`, `>`, `<`, `>=`, `<=` + * * create_time: `=`, `>`, `<`, `>=`, `<=` * * Usage: This should be milliseconds since epoch or an RFC3339 string. * Examples: * "create_time = \"2019-06-10T16:07:18-07:00\"" * "create_time = 1560208038000" * - * iam_policy.policy_blob | '=', ':' - * resource_properties | '=', ':', `>`, `<`, `>=`, `<=` - * security_marks | '=', ':' - * security_center_properties.resource_name | '=', ':' - * security_center_properties.resource_type | '=', ':' - * security_center_properties.resource_parent | '=', ':' - * security_center_properties.resource_project | '=', ':' - * security_center_properties.resource_owners | '=', ':' + * * iam_policy.policy_blob: `=`, `:` + * * resource_properties: `=`, `:`, `>`, `<`, `>=`, `<=` + * * security_marks.marks: `=`, `:` + * * security_center_properties.resource_name: `=`, `:` + * * security_center_properties.resource_type: `=`, `:` + * * security_center_properties.resource_parent: `=`, `:` + * * security_center_properties.resource_project: `=`, `:` + * * security_center_properties.resource_owners: `=`, `:` * * For example, `resource_properties.size = 100` is a valid filter string. * @param {string} [request.orderBy] @@ -1682,7 +1686,7 @@ class SecurityCenterClient { * name * update_time * resource_properties - * security_marks + * security_marks.marks * security_center_properties.resource_name * security_center_properties.resource_parent * security_center_properties.resource_project @@ -1722,9 +1726,7 @@ class SecurityCenterClient { * * This object should have the same structure as [Duration]{@link google.protobuf.Duration} * @param {Object} [request.fieldMask] - * Optional. - * - * A field mask to specify the ListAssetsResult fields to be listed in the + * Optional. A field mask to specify the ListAssetsResult fields to be listed in the * response. * An empty field mask will list all fields. * @@ -1771,15 +1773,15 @@ class SecurityCenterClient { * Lists an organization or source's findings. * * To list across all sources provide a `-` as the source id. - * Example: /v1/organizations/123/sources/-/findings + * Example: /v1/organizations/{organization_id}/sources/-/findings * * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Name of the source the findings belong to. Its format is + * Required. Name of the source the findings belong to. Its format is * "organizations/[organization_id]/sources/[source_id]". To list across all * sources provide a source_id of `-`. For example: - * organizations/123/sources/- + * organizations/{organization_id}/sources/- * @param {string} [request.filter] * Expression that defines the filter to apply across findings. * The expression is a list of one or more restrictions combined via logical @@ -1806,21 +1808,22 @@ class SecurityCenterClient { * * boolean literals `true` and `false` without quotes. * * The following field and operator combinations are supported: - * name | `=` - * parent | '=', ':' - * resource_name | '=', ':' - * state | '=', ':' - * category | '=', ':' - * external_uri | '=', ':' - * event_time | `=`, `>`, `<`, `>=`, `<=` + * + * name: `=` + * parent: `=`, `:` + * resource_name: `=`, `:` + * state: `=`, `:` + * category: `=`, `:` + * external_uri: `=`, `:` + * event_time: `=`, `>`, `<`, `>=`, `<=` * * Usage: This should be milliseconds since epoch or an RFC3339 string. * Examples: * "event_time = \"2019-06-10T16:07:18-07:00\"" * "event_time = 1560208038000" * - * security_marks | '=', ':' - * source_properties | '=', ':', `>`, `<`, `>=`, `<=` + * security_marks.marks: `=`, `:` + * source_properties: `=`, `:`, `>`, `<`, `>=`, `<=` * * For example, `source_properties.size = 100` is a valid filter string. * @param {string} [request.orderBy] @@ -1841,7 +1844,7 @@ class SecurityCenterClient { * resource_name * event_time * source_properties - * security_marks + * security_marks.marks * @param {Object} [request.readTime] * Time used as a reference point when filtering findings. The filter is * limited to findings existing at the supplied time and their values are @@ -1877,9 +1880,7 @@ class SecurityCenterClient { * * This object should have the same structure as [Duration]{@link google.protobuf.Duration} * @param {Object} [request.fieldMask] - * Optional. - * - * A field mask to specify the Finding fields to be listed in the response. + * Optional. A field mask to specify the Finding fields to be listed in the response. * An empty field mask will list all fields. * * This object should have the same structure as [FieldMask]{@link google.protobuf.FieldMask} @@ -1994,10 +1995,10 @@ class SecurityCenterClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Name of the source the findings belong to. Its format is + * Required. Name of the source the findings belong to. Its format is * "organizations/[organization_id]/sources/[source_id]". To list across all * sources provide a source_id of `-`. For example: - * organizations/123/sources/- + * organizations/{organization_id}/sources/- * @param {string} [request.filter] * Expression that defines the filter to apply across findings. * The expression is a list of one or more restrictions combined via logical @@ -2024,21 +2025,22 @@ class SecurityCenterClient { * * boolean literals `true` and `false` without quotes. * * The following field and operator combinations are supported: - * name | `=` - * parent | '=', ':' - * resource_name | '=', ':' - * state | '=', ':' - * category | '=', ':' - * external_uri | '=', ':' - * event_time | `=`, `>`, `<`, `>=`, `<=` + * + * name: `=` + * parent: `=`, `:` + * resource_name: `=`, `:` + * state: `=`, `:` + * category: `=`, `:` + * external_uri: `=`, `:` + * event_time: `=`, `>`, `<`, `>=`, `<=` * * Usage: This should be milliseconds since epoch or an RFC3339 string. * Examples: * "event_time = \"2019-06-10T16:07:18-07:00\"" * "event_time = 1560208038000" * - * security_marks | '=', ':' - * source_properties | '=', ':', `>`, `<`, `>=`, `<=` + * security_marks.marks: `=`, `:` + * source_properties: `=`, `:`, `>`, `<`, `>=`, `<=` * * For example, `source_properties.size = 100` is a valid filter string. * @param {string} [request.orderBy] @@ -2059,7 +2061,7 @@ class SecurityCenterClient { * resource_name * event_time * source_properties - * security_marks + * security_marks.marks * @param {Object} [request.readTime] * Time used as a reference point when filtering findings. The filter is * limited to findings existing at the supplied time and their values are @@ -2095,9 +2097,7 @@ class SecurityCenterClient { * * This object should have the same structure as [Duration]{@link google.protobuf.Duration} * @param {Object} [request.fieldMask] - * Optional. - * - * A field mask to specify the Finding fields to be listed in the response. + * Optional. A field mask to specify the Finding fields to be listed in the response. * An empty field mask will list all fields. * * This object should have the same structure as [FieldMask]{@link google.protobuf.FieldMask} @@ -2145,7 +2145,7 @@ class SecurityCenterClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Resource name of the parent of sources to list. Its format should be + * Required. Resource name of the parent of sources to list. Its format should be * "organizations/[organization_id]". * @param {number} [request.pageSize] * The maximum number of resources contained in the underlying API @@ -2258,7 +2258,7 @@ class SecurityCenterClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Resource name of the parent of sources to list. Its format should be + * Required. Resource name of the parent of sources to list. Its format should be * "organizations/[organization_id]". * @param {number} [request.pageSize] * The maximum number of resources contained in the underlying API @@ -2309,7 +2309,7 @@ class SecurityCenterClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Name of the organization to run asset discovery for. Its format is + * Required. Name of the organization to run asset discovery for. Its format is * "organizations/[organization_id]". * @param {Object} [options] * Optional parameters. You can override the default settings for this call, e.g, timeout, @@ -2408,16 +2408,16 @@ class SecurityCenterClient { * @param {Object} request * The request object that will be sent. * @param {string} request.name - * The relative resource name of the finding. See: + * Required. The relative resource name of the finding. See: * https://cloud.google.com/apis/design/resource_names#relative_resource_name * Example: - * "organizations/123/sources/456/finding/789". + * "organizations/{organization_id}/sources/{source_id}/finding/{finding_id}". * @param {number} request.state - * The desired State of the finding. + * Required. The desired State of the finding. * * The number should be among the values of [State]{@link google.cloud.securitycenter.v1.State} * @param {Object} request.startTime - * The time at which the updated state takes effect. + * Required. The time at which the updated state takes effect. * * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} * @param {Object} [options] @@ -2613,7 +2613,7 @@ class SecurityCenterClient { * @param {Object} request * The request object that will be sent. * @param {Object} request.finding - * The finding resource to update or create if it does not already exist. + * Required. The finding resource to update or create if it does not already exist. * parent, security_marks, and update_time will be ignored. * * In the case of creation, the finding id portion of the name must be @@ -2684,7 +2684,7 @@ class SecurityCenterClient { * @param {Object} request * The request object that will be sent. * @param {Object} request.organizationSettings - * The organization settings resource to update. + * Required. The organization settings resource to update. * * This object should have the same structure as [OrganizationSettings]{@link google.cloud.securitycenter.v1.OrganizationSettings} * @param {Object} [request.updateMask] @@ -2750,7 +2750,7 @@ class SecurityCenterClient { * @param {Object} request * The request object that will be sent. * @param {Object} request.source - * The source resource to update. + * Required. The source resource to update. * * This object should have the same structure as [Source]{@link google.cloud.securitycenter.v1.Source} * @param {Object} [request.updateMask] @@ -2812,7 +2812,7 @@ class SecurityCenterClient { * @param {Object} request * The request object that will be sent. * @param {Object} request.securityMarks - * The security marks resource to update. + * Required. The security marks resource to update. * * This object should have the same structure as [SecurityMarks]{@link google.cloud.securitycenter.v1.SecurityMarks} * @param {Object} [request.updateMask] diff --git a/packages/google-cloud-securitycenter/synth.metadata b/packages/google-cloud-securitycenter/synth.metadata index af52ca90bab..db8fd3cfa40 100644 --- a/packages/google-cloud-securitycenter/synth.metadata +++ b/packages/google-cloud-securitycenter/synth.metadata @@ -1,5 +1,5 @@ { - "updateTime": "2019-11-19T12:26:58.400457Z", + "updateTime": "2019-12-10T12:23:11.737877Z", "sources": [ { "generator": { @@ -12,8 +12,8 @@ "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "d8dd7fe8d5304f7bd1c52207703d7f27d5328c5a", - "internalRef": "281088257" + "sha": "6cc9499e225a4f6a5e34fe07e390f67055d7991c", + "internalRef": "284643689" } }, { From 9f35fadf0bff46725cc3e0eec45d69b658494949 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Thu, 12 Dec 2019 15:02:34 -0800 Subject: [PATCH 117/342] chore: release 2.3.0 (#181) --- packages/google-cloud-securitycenter/CHANGELOG.md | 12 ++++++++++++ packages/google-cloud-securitycenter/package.json | 2 +- .../google-cloud-securitycenter/samples/package.json | 2 +- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-securitycenter/CHANGELOG.md b/packages/google-cloud-securitycenter/CHANGELOG.md index 0aebeed42e5..ef544d348cb 100644 --- a/packages/google-cloud-securitycenter/CHANGELOG.md +++ b/packages/google-cloud-securitycenter/CHANGELOG.md @@ -4,6 +4,18 @@ [1]: https://www.npmjs.com/package/@google-cloud/security-center?activeTab=versions +## [2.3.0](https://www.github.com/googleapis/nodejs-security-center/compare/v2.2.2...v2.3.0) (2019-12-10) + + +### Features + +* support resource descriptors ([#174](https://www.github.com/googleapis/nodejs-security-center/issues/174)) ([a55b223](https://www.github.com/googleapis/nodejs-security-center/commit/a55b2232a821ddcbe1132eab2f1e5873bc5e96f2)) + + +### Bug Fixes + +* **deps:** pin TypeScript below 3.7.0 ([121d969](https://www.github.com/googleapis/nodejs-security-center/commit/121d9696bcc9453d497a53e40c4679a63793673c)) + ### [2.2.2](https://www.github.com/googleapis/nodejs-security-center/compare/v2.2.1...v2.2.2) (2019-11-15) diff --git a/packages/google-cloud-securitycenter/package.json b/packages/google-cloud-securitycenter/package.json index ec82fb2508a..cdb8bbd666a 100644 --- a/packages/google-cloud-securitycenter/package.json +++ b/packages/google-cloud-securitycenter/package.json @@ -1,7 +1,7 @@ { "name": "@google-cloud/security-center", "description": "Cloud Security Command Center API client for Node.js", - "version": "2.2.2", + "version": "2.3.0", "license": "Apache-2.0", "author": "Google LLC", "engines": { diff --git a/packages/google-cloud-securitycenter/samples/package.json b/packages/google-cloud-securitycenter/samples/package.json index 52f3add663c..91894d1f71f 100644 --- a/packages/google-cloud-securitycenter/samples/package.json +++ b/packages/google-cloud-securitycenter/samples/package.json @@ -9,7 +9,7 @@ }, "license": "Apache-2.0", "dependencies": { - "@google-cloud/security-center": "^2.2.2" + "@google-cloud/security-center": "^2.3.0" }, "devDependencies": { "chai": "^4.2.0", From 898366c9b952b22a76da264131c1e548a375c27e Mon Sep 17 00:00:00 2001 From: "Benjamin E. Coe" Date: Thu, 26 Dec 2019 16:28:42 -0500 Subject: [PATCH 118/342] docs: update jsdoc license/samples-README (#183) --- .../google-cloud-securitycenter/.jsdoc.js | 29 +++++++++---------- .../samples/README.md | 8 ++++- 2 files changed, 21 insertions(+), 16 deletions(-) diff --git a/packages/google-cloud-securitycenter/.jsdoc.js b/packages/google-cloud-securitycenter/.jsdoc.js index 2291bf4a37d..b95989459a1 100644 --- a/packages/google-cloud-securitycenter/.jsdoc.js +++ b/packages/google-cloud-securitycenter/.jsdoc.js @@ -1,18 +1,17 @@ -/*! - * Copyright 2018 Google LLC. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.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. - */ +// Copyright 2019 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT 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'; diff --git a/packages/google-cloud-securitycenter/samples/README.md b/packages/google-cloud-securitycenter/samples/README.md index 86afb450586..4e4ff2b1c91 100644 --- a/packages/google-cloud-securitycenter/samples/README.md +++ b/packages/google-cloud-securitycenter/samples/README.md @@ -27,6 +27,12 @@ to your critical resources, all from a single, centralized dashboard. Before running the samples, make sure you've followed the steps outlined in [Using the client library](https://github.com/googleapis/nodejs-security-center#using-the-client-library). +`cd samples` + +`npm install` + +`cd ..` + ## Samples @@ -49,4 +55,4 @@ __Usage:__ [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-security-center&page=editor&open_in_editor=samples/README.md -[product-docs]: https://cloud.google.com/security-command-center \ No newline at end of file +[product-docs]: https://cloud.google.com/security-command-center From c93d0b979abdb31df6e8ffdadd239db20af2f499 Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Mon, 30 Dec 2019 12:02:12 -0800 Subject: [PATCH 119/342] refactor: use explicit mocha imports (#187) --- .../samples/.eslintrc.yml | 2 -- .../samples/package.json | 4 ++++ .../system-test/.eslintrc.yml | 6 ----- .../system-test/no-test.js | 1 - .../system-test/system.js | 23 +++++++++++++++++++ .../test/.eslintrc.yml | 5 ---- .../test/gapic-v1.js | 1 + 7 files changed, 28 insertions(+), 14 deletions(-) delete mode 100644 packages/google-cloud-securitycenter/system-test/.eslintrc.yml delete mode 100644 packages/google-cloud-securitycenter/system-test/no-test.js create mode 100644 packages/google-cloud-securitycenter/system-test/system.js delete mode 100644 packages/google-cloud-securitycenter/test/.eslintrc.yml diff --git a/packages/google-cloud-securitycenter/samples/.eslintrc.yml b/packages/google-cloud-securitycenter/samples/.eslintrc.yml index 59a8aeb576b..282535f55f6 100644 --- a/packages/google-cloud-securitycenter/samples/.eslintrc.yml +++ b/packages/google-cloud-securitycenter/samples/.eslintrc.yml @@ -1,5 +1,3 @@ --- rules: no-console: off - node/no-missing-require: off - no-warning-comments: off \ No newline at end of file diff --git a/packages/google-cloud-securitycenter/samples/package.json b/packages/google-cloud-securitycenter/samples/package.json index 91894d1f71f..5758f4cb3df 100644 --- a/packages/google-cloud-securitycenter/samples/package.json +++ b/packages/google-cloud-securitycenter/samples/package.json @@ -1,6 +1,10 @@ { "name": "nodejs-security-center-samples", "private": true, + "files": [ + "**/*.js", + "!system-test/" + ], "engines": { "node": ">=8" }, diff --git a/packages/google-cloud-securitycenter/system-test/.eslintrc.yml b/packages/google-cloud-securitycenter/system-test/.eslintrc.yml deleted file mode 100644 index 2e6882e46d2..00000000000 --- a/packages/google-cloud-securitycenter/system-test/.eslintrc.yml +++ /dev/null @@ -1,6 +0,0 @@ ---- -env: - mocha: true -rules: - node/no-unpublished-require: off - no-console: off diff --git a/packages/google-cloud-securitycenter/system-test/no-test.js b/packages/google-cloud-securitycenter/system-test/no-test.js deleted file mode 100644 index ed54b008e0c..00000000000 --- a/packages/google-cloud-securitycenter/system-test/no-test.js +++ /dev/null @@ -1 +0,0 @@ -console.log('no tests yet'); diff --git a/packages/google-cloud-securitycenter/system-test/system.js b/packages/google-cloud-securitycenter/system-test/system.js new file mode 100644 index 00000000000..6a460f19c33 --- /dev/null +++ b/packages/google-cloud-securitycenter/system-test/system.js @@ -0,0 +1,23 @@ +// Copyright 2019 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT 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'; + +const {describe, it} = require('mocha'); + +describe('system tests', () => { + it('should have tests', done => { + done(); + }); +}); diff --git a/packages/google-cloud-securitycenter/test/.eslintrc.yml b/packages/google-cloud-securitycenter/test/.eslintrc.yml deleted file mode 100644 index 73f7bbc946f..00000000000 --- a/packages/google-cloud-securitycenter/test/.eslintrc.yml +++ /dev/null @@ -1,5 +0,0 @@ ---- -env: - mocha: true -rules: - node/no-unpublished-require: off diff --git a/packages/google-cloud-securitycenter/test/gapic-v1.js b/packages/google-cloud-securitycenter/test/gapic-v1.js index dba9a6501fc..e88e1a4e45e 100644 --- a/packages/google-cloud-securitycenter/test/gapic-v1.js +++ b/packages/google-cloud-securitycenter/test/gapic-v1.js @@ -15,6 +15,7 @@ 'use strict'; const assert = require('assert'); +const {describe, it} = require('mocha'); const securityCenterModule = require('../src'); From f16baa91aa05ed82138921714093529c7dc36853 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Tue, 31 Dec 2019 00:56:55 +0200 Subject: [PATCH 120/342] chore(deps): update dependency eslint-plugin-node to v11 (#186) --- packages/google-cloud-securitycenter/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-securitycenter/package.json b/packages/google-cloud-securitycenter/package.json index cdb8bbd666a..672da061744 100644 --- a/packages/google-cloud-securitycenter/package.json +++ b/packages/google-cloud-securitycenter/package.json @@ -46,7 +46,7 @@ "codecov": "^3.0.0", "eslint": "^6.0.0", "eslint-config-prettier": "^6.0.0", - "eslint-plugin-node": "^10.0.0", + "eslint-plugin-node": "^11.0.0", "eslint-plugin-prettier": "^3.0.0", "intelli-espower-loader": "^1.0.1", "jsdoc": "^3.6.2", From b324c6691a028fc28f33c2abe8afdffc64d02e66 Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Tue, 31 Dec 2019 13:06:11 -0800 Subject: [PATCH 121/342] build: use c8 for coverage (#185) --- packages/google-cloud-securitycenter/package.json | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/packages/google-cloud-securitycenter/package.json b/packages/google-cloud-securitycenter/package.json index 672da061744..235f423ef45 100644 --- a/packages/google-cloud-securitycenter/package.json +++ b/packages/google-cloud-securitycenter/package.json @@ -27,13 +27,11 @@ "Security Command Center API" ], "scripts": { - "cover": "nyc --reporter=lcov mocha test/*.js && nyc report", "docs": "jsdoc -c .jsdoc.js", "lint": "eslint '**/*.js'", "samples-test": "cd samples/ && npm link ../ && npm test && cd ../", "system-test": "mocha system-test/*.js --timeout 600000", - "test-no-cover": "mocha test/*.js", - "test": "npm run cover", + "test": "c8 mocha", "fix": "eslint --fix '**/*.js'", "docs-test": "linkinator docs", "predocs-test": "npm run docs" @@ -54,7 +52,7 @@ "jsdoc-region-tag": "^1.0.2", "linkinator": "^1.5.0", "mocha": "^6.0.0", - "nyc": "^14.0.0", + "c8": "^7.0.0", "power-assert": "^1.4.4", "prettier": "^1.7.4" } From 9f19713d4e7df9f25064a961a2fa01a9f915393d Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Fri, 3 Jan 2020 21:38:45 -0800 Subject: [PATCH 122/342] fix: proto files updated with proto annotations (#182) * [CHANGE ME] Re-generated to pick up changes in the API or client library generator. * fix: add missing protos Co-authored-by: Benjamin E. Coe Co-authored-by: Alexander Fenster --- .../cloud/securitycenter/v1/asset.proto | 11 +- .../cloud/securitycenter/v1/finding.proto | 2 +- .../v1/organization_settings.proto | 2 +- .../v1/run_asset_discovery_response.proto | 2 +- .../securitycenter/v1/security_marks.proto | 2 +- .../v1/securitycenter_service.proto | 37 +- .../cloud/securitycenter/v1/source.proto | 2 +- .../cloud/securitycenter/v1beta1/asset.proto | 11 +- .../securitycenter/v1beta1/finding.proto | 31 +- .../v1beta1/organization_settings.proto | 10 +- .../run_asset_discovery_response.proto | 50 + .../v1beta1/security_marks.proto | 21 +- .../v1beta1/securitycenter_service.proto | 210 +- .../cloud/securitycenter/v1beta1/source.proto | 16 +- .../protos/protos.d.ts | 9023 +++--- .../protos/protos.js | 24091 ++++++++-------- .../protos/protos.json | 1043 +- .../src/extra_proto_list.json | 14 + .../cloud/securitycenter/v1/doc_asset.js | 9 + .../v1/doc_securitycenter_service.js | 46 + .../src/v1/security_center_client.js | 26 + .../src/v1/security_center_client_config.json | 4 +- .../cloud/securitycenter/v1beta1/doc_asset.js | 4 +- .../securitycenter/v1beta1/doc_finding.js | 16 +- .../v1beta1/doc_organization_settings.js | 2 +- .../v1beta1/doc_security_marks.js | 12 +- .../v1beta1/doc_securitycenter_service.js | 58 +- .../securitycenter/v1beta1/doc_source.js | 8 +- .../src/v1beta1/security_center_client.js | 88 +- .../synth.metadata | 2487 +- 30 files changed, 20577 insertions(+), 16761 deletions(-) create mode 100644 packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/run_asset_discovery_response.proto create mode 100644 packages/google-cloud-securitycenter/src/extra_proto_list.json diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/asset.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/asset.proto index 3b99d35d11d..bd4751a142a 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/asset.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/asset.proto @@ -17,11 +17,11 @@ syntax = "proto3"; package google.cloud.securitycenter.v1; -import "google/api/annotations.proto"; import "google/api/resource.proto"; import "google/cloud/securitycenter/v1/security_marks.proto"; import "google/protobuf/struct.proto"; import "google/protobuf/timestamp.proto"; +import "google/api/annotations.proto"; option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1;securitycenter"; @@ -66,6 +66,15 @@ message Asset { // Owners of the Google Cloud resource. repeated string resource_owners = 5; + + // The user defined display name for this resource. + string resource_display_name = 6; + + // The user defined display name for the parent of this resource. + string resource_parent_display_name = 7; + + // The user defined display name for the project of this resource. + string resource_project_display_name = 8; } // IAM Policy information associated with the GCP resource described by the diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/finding.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/finding.proto index 0c64d4d79fe..5d8e5a78918 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/finding.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/finding.proto @@ -17,12 +17,12 @@ syntax = "proto3"; package google.cloud.securitycenter.v1; -import "google/api/annotations.proto"; import "google/api/field_behavior.proto"; import "google/api/resource.proto"; import "google/cloud/securitycenter/v1/security_marks.proto"; import "google/protobuf/struct.proto"; import "google/protobuf/timestamp.proto"; +import "google/api/annotations.proto"; option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1;securitycenter"; diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/organization_settings.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/organization_settings.proto index db2097048c5..aa4e80bd1a0 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/organization_settings.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/organization_settings.proto @@ -17,8 +17,8 @@ syntax = "proto3"; package google.cloud.securitycenter.v1; -import "google/api/annotations.proto"; import "google/api/resource.proto"; +import "google/api/annotations.proto"; option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1;securitycenter"; diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/run_asset_discovery_response.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/run_asset_discovery_response.proto index 93fb58b1172..e7581078dac 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/run_asset_discovery_response.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/run_asset_discovery_response.proto @@ -17,8 +17,8 @@ syntax = "proto3"; package google.cloud.securitycenter.v1; -import "google/api/annotations.proto"; import "google/protobuf/duration.proto"; +import "google/api/annotations.proto"; option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1;securitycenter"; diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/security_marks.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/security_marks.proto index b3ad429811a..d2b53487437 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/security_marks.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/security_marks.proto @@ -17,8 +17,8 @@ syntax = "proto3"; package google.cloud.securitycenter.v1; -import "google/api/annotations.proto"; import "google/api/resource.proto"; +import "google/api/annotations.proto"; option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1;securitycenter"; diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/securitycenter_service.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/securitycenter_service.proto index 811fca5d653..1cd1aff20d7 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/securitycenter_service.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/securitycenter_service.proto @@ -24,7 +24,6 @@ import "google/api/resource.proto"; import "google/cloud/securitycenter/v1/asset.proto"; import "google/cloud/securitycenter/v1/finding.proto"; import "google/cloud/securitycenter/v1/organization_settings.proto"; -import "google/cloud/securitycenter/v1/run_asset_discovery_response.proto"; import "google/cloud/securitycenter/v1/security_marks.proto"; import "google/cloud/securitycenter/v1/source.proto"; import "google/iam/v1/iam_policy.proto"; @@ -345,9 +344,12 @@ message GroupAssetsRequest { // * resource_properties: `=`, `:`, `>`, `<`, `>=`, `<=` // * security_marks.marks: `=`, `:` // * security_center_properties.resource_name: `=`, `:` + // * security_center_properties.resource_display_name: `=`, `:` // * security_center_properties.resource_type: `=`, `:` // * security_center_properties.resource_parent: `=`, `:` + // * security_center_properties.resource_parent_display_name: `=`, `:` // * security_center_properties.resource_project: `=`, `:` + // * security_center_properties.resource_project_display_name: `=`, `:` // * security_center_properties.resource_owners: `=`, `:` // // For example, `resource_properties.size = 100` is a valid filter string. @@ -361,12 +363,16 @@ message GroupAssetsRequest { // The following fields are supported when compare_duration is not set: // // * security_center_properties.resource_project + // * security_center_properties.resource_project_display_name // * security_center_properties.resource_type // * security_center_properties.resource_parent + // * security_center_properties.resource_parent_display_name // // The following fields are supported when compare_duration is set: // // * security_center_properties.resource_type + // * security_center_properties.resource_project_display_name + // * security_center_properties.resource_parent_display_name string group_by = 3 [(google.api.field_behavior) = REQUIRED]; // When compare_duration is set, the GroupResult's "state_change" property is @@ -666,9 +672,12 @@ message ListAssetsRequest { // * resource_properties: `=`, `:`, `>`, `<`, `>=`, `<=` // * security_marks.marks: `=`, `:` // * security_center_properties.resource_name: `=`, `:` + // * security_center_properties.resource_display_name: `=`, `:` // * security_center_properties.resource_type: `=`, `:` // * security_center_properties.resource_parent: `=`, `:` + // * security_center_properties.resource_parent_display_name: `=`, `:` // * security_center_properties.resource_project: `=`, `:` + // * security_center_properties.resource_project_display_name: `=`, `:` // * security_center_properties.resource_owners: `=`, `:` // // For example, `resource_properties.size = 100` is a valid filter string. @@ -689,8 +698,11 @@ message ListAssetsRequest { // resource_properties // security_marks.marks // security_center_properties.resource_name + // security_center_properties.resource_display_name // security_center_properties.resource_parent + // security_center_properties.resource_parent_display_name // security_center_properties.resource_project + // security_center_properties.resource_project_display_name // security_center_properties.resource_type string order_by = 3; @@ -914,6 +926,26 @@ message ListFindingsRequest { message ListFindingsResponse { // Result containing the Finding and its StateChange. message ListFindingsResult { + // Information related to the Google Cloud Platform (GCP) resource that is + // associated with this finding. + message Resource { + // The full resource name of the resource. See: + // https://cloud.google.com/apis/design/resource_names#full_resource_name + string name = 1; + + // The full resource name of project that the resource belongs to. + string project_name = 2; + + // The human readable name of project that the resource belongs to. + string project_display_name = 3; + + // The full resource name of resource's parent. + string parent_name = 4; + + // The human readable name of resource's parent. + string parent_display_name = 5; + } + // The change in state of the finding. // // When querying across two points in time this describes @@ -947,6 +979,9 @@ message ListFindingsResponse { // State change of the finding between the points in time. StateChange state_change = 2; + + // Output only. Resource that is associated with this finding. + Resource resource = 3; } // Findings matching the list request. diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/source.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/source.proto index 4ceff737fc6..d26e042f121 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/source.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/source.proto @@ -17,8 +17,8 @@ syntax = "proto3"; package google.cloud.securitycenter.v1; -import "google/api/annotations.proto"; import "google/api/resource.proto"; +import "google/api/annotations.proto"; option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1;securitycenter"; diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/asset.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/asset.proto index 3dd5b358141..85d0e0900db 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/asset.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/asset.proto @@ -1,4 +1,4 @@ -// Copyright 2018 Google LLC. +// Copyright 2019 Google LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -17,10 +17,11 @@ syntax = "proto3"; package google.cloud.securitycenter.v1beta1; -import "google/api/annotations.proto"; +import "google/api/field_behavior.proto"; import "google/cloud/securitycenter/v1beta1/security_marks.proto"; import "google/protobuf/struct.proto"; import "google/protobuf/timestamp.proto"; +import "google/api/annotations.proto"; option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1beta1;securitycenter"; option java_multiple_files = true; @@ -36,10 +37,10 @@ message Asset { // Cloud SCC managed properties. These properties are managed by Cloud SCC and // cannot be modified by the user. message SecurityCenterProperties { - // The full resource name of the GCP resource this asset + // Immutable. The full resource name of the GCP resource this asset // represents. This field is immutable after create time. See: // https://cloud.google.com/apis/design/resource_names#full_resource_name - string resource_name = 1; + string resource_name = 1 [(google.api.field_behavior) = IMMUTABLE]; // The type of the GCP resource. Examples include: APPLICATION, // PROJECT, and ORGANIZATION. This is a case insensitive field defined by @@ -62,7 +63,7 @@ message Asset { // The relative resource name of this asset. See: // https://cloud.google.com/apis/design/resource_names#relative_resource_name // Example: - // "organizations/123/assets/456". + // "organizations/{organization_id}/assets/{asset_id}". string name = 1; // Cloud SCC managed properties. These properties are managed by diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/finding.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/finding.proto index 21dfdd5616e..e582e6de3f5 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/finding.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/finding.proto @@ -1,4 +1,4 @@ -// Copyright 2018 Google LLC. +// Copyright 2019 Google LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -17,10 +17,12 @@ syntax = "proto3"; package google.cloud.securitycenter.v1beta1; -import "google/api/annotations.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; import "google/cloud/securitycenter/v1beta1/security_marks.proto"; import "google/protobuf/struct.proto"; import "google/protobuf/timestamp.proto"; +import "google/api/annotations.proto"; option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1beta1;securitycenter"; option java_multiple_files = true; @@ -33,6 +35,11 @@ option java_package = "com.google.cloud.securitycenter.v1beta1"; // policy testing, and enforcement. For example, an XSS vulnerability in an // App Engine application is a finding. message Finding { + option (google.api.resource) = { + type: "securitycenter.googleapis.com/Finding" + pattern: "organizations/{organization}/sources/{source}/findings/{finding}" + }; + // The state of the finding. enum State { // Unspecified state. @@ -49,19 +56,21 @@ message Finding { // The relative resource name of this finding. See: // https://cloud.google.com/apis/design/resource_names#relative_resource_name // Example: - // "organizations/123/sources/456/findings/789" + // "organizations/{organization_id}/sources/{source_id}/findings/{finding_id}" string name = 1; - // The relative resource name of the source the finding belongs to. See: + // Immutable. The relative resource name of the source the finding belongs to. See: // https://cloud.google.com/apis/design/resource_names#relative_resource_name // This field is immutable after creation time. // For example: - // "organizations/123/sources/456" - string parent = 2; + // "organizations/{organization_id}/sources/{source_id}" + string parent = 2 [(google.api.field_behavior) = IMMUTABLE]; - // The full resource name of the Google Cloud Platform (GCP) resource this - // finding is for. See: + // For findings on Google Cloud Platform (GCP) resources, the full resource + // name of the GCP resource this finding is for. See: // https://cloud.google.com/apis/design/resource_names#full_resource_name + // When the finding is for a non-GCP resource, the resourceName can be a + // customer or partner defined string. // This field is immutable after creation time. string resource_name = 3; @@ -87,11 +96,11 @@ message Finding { // Output only. User specified security marks. These marks are entirely // managed by the user and come from the SecurityMarks resource that belongs // to the finding. - SecurityMarks security_marks = 8; + SecurityMarks security_marks = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; // The time at which the event took place. For example, if the finding - // represents an open firewall it would capture the time the open firewall was - // detected. + // represents an open firewall it would capture the time the detector believes + // the firewall became open. The accuracy is determined by the detector. google.protobuf.Timestamp event_time = 9; // The time at which the finding was created in Cloud SCC. diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/organization_settings.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/organization_settings.proto index ca9be114547..9f7f2b0edb0 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/organization_settings.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/organization_settings.proto @@ -1,4 +1,4 @@ -// Copyright 2018 Google LLC. +// Copyright 2019 Google LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -17,6 +17,7 @@ syntax = "proto3"; package google.cloud.securitycenter.v1beta1; +import "google/api/resource.proto"; import "google/api/annotations.proto"; option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1beta1;securitycenter"; @@ -26,6 +27,11 @@ option java_package = "com.google.cloud.securitycenter.v1beta1"; // User specified settings that are attached to the Cloud Security Command // Center (Cloud SCC) organization. message OrganizationSettings { + option (google.api.resource) = { + type: "securitycenter.googleapis.com/OrganizationSettings" + pattern: "organizations/{organization}/organizationSettings" + }; + // The configuration used for Asset Discovery runs. message AssetDiscoveryConfig { // The mode of inclusion when running Asset Discovery. @@ -60,7 +66,7 @@ message OrganizationSettings { // The relative resource name of the settings. See: // https://cloud.google.com/apis/design/resource_names#relative_resource_name // Example: - // "organizations/123/organizationSettings". + // "organizations/{organization_id}/organizationSettings". string name = 1; // A flag that indicates if Asset Discovery should be enabled. If the flag is diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/run_asset_discovery_response.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/run_asset_discovery_response.proto new file mode 100644 index 00000000000..53ba02ef0cc --- /dev/null +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/run_asset_discovery_response.proto @@ -0,0 +1,50 @@ +// Copyright 2019 Google LLC. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +syntax = "proto3"; + +package google.cloud.securitycenter.v1beta1; + +import "google/protobuf/duration.proto"; +import "google/api/annotations.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1beta1;securitycenter"; +option java_multiple_files = true; +option java_package = "com.google.cloud.securitycenter.v1beta1"; + +// Response of asset discovery run +message RunAssetDiscoveryResponse { + // The state of an asset discovery run. + enum State { + // Asset discovery run state was unspecified. + STATE_UNSPECIFIED = 0; + + // Asset discovery run completed successfully. + COMPLETED = 1; + + // Asset discovery run was cancelled with tasks still pending, as another + // run for the same organization was started with a higher priority. + SUPERSEDED = 2; + + // Asset discovery run was killed and terminated. + TERMINATED = 3; + } + + // The state of an asset discovery run. + State state = 1; + + // The duration between asset discovery run start and end + google.protobuf.Duration duration = 2; +} diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/security_marks.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/security_marks.proto index cfcb5f7dcb9..97baf247980 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/security_marks.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/security_marks.proto @@ -1,4 +1,4 @@ -// Copyright 2018 Google LLC. +// Copyright 2019 Google LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -17,6 +17,7 @@ syntax = "proto3"; package google.cloud.securitycenter.v1beta1; +import "google/api/resource.proto"; import "google/api/annotations.proto"; option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1beta1;securitycenter"; @@ -28,18 +29,26 @@ option java_package = "com.google.cloud.securitycenter.v1beta1"; // SCC organization -- they can be modified and viewed by all users who have // proper permissions on the organization. message SecurityMarks { + option (google.api.resource) = { + type: "securitycenter.googleapis.com/SecurityMarks" + pattern: "organizations/{organization}/assets/{asset}/securityMarks" + pattern: "organizations/{organization}/sources/{source}/findings/{finding}/securityMarks" + }; + // The relative resource name of the SecurityMarks. See: // https://cloud.google.com/apis/design/resource_names#relative_resource_name // Examples: - // "organizations/123/assets/456/securityMarks" - // "organizations/123/sources/456/findings/789/securityMarks". + // "organizations/{organization_id}/assets/{asset_id}/securityMarks" + // "organizations/{organization_id}/sources/{source_id}/findings/{finding_id}/securityMarks". string name = 1; // Mutable user specified security marks belonging to the parent resource. // Constraints are as follows: - // - Keys and values are treated as case insensitive - // - Keys must be alphanumeric and between 1 - 256 characters (inclusive) - // - Values have leading and trailing whitespace trimmed, remaining + // + // * Keys and values are treated as case insensitive + // * Keys must be between 1 - 256 characters (inclusive) + // * Keys must be letters, numbers, underscores, or dashes + // * Values have leading and trailing whitespace trimmed, remaining // characters must be between 1 - 4096 characters (inclusive) map marks = 2; } diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/securitycenter_service.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/securitycenter_service.proto index dafce562dc7..ba2edf4eed8 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/securitycenter_service.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/securitycenter_service.proto @@ -1,4 +1,4 @@ -// Copyright 2018 Google LLC. +// Copyright 2019 Google LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -18,6 +18,9 @@ syntax = "proto3"; package google.cloud.securitycenter.v1beta1; import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; import "google/cloud/securitycenter/v1beta1/asset.proto"; import "google/cloud/securitycenter/v1beta1/finding.proto"; import "google/cloud/securitycenter/v1beta1/organization_settings.proto"; @@ -38,12 +41,16 @@ option java_package = "com.google.cloud.securitycenter.v1beta1"; // V1 Beta APIs for Security Center service. service SecurityCenter { + option (google.api.default_host) = "securitycenter.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + // Creates a source. rpc CreateSource(CreateSourceRequest) returns (Source) { option (google.api.http) = { post: "/v1beta1/{parent=organizations/*}/sources" body: "source" }; + option (google.api.method_signature) = "parent,source"; } // Creates a finding. The corresponding source must exist for finding creation @@ -53,23 +60,24 @@ service SecurityCenter { post: "/v1beta1/{parent=organizations/*/sources/*}/findings" body: "finding" }; + option (google.api.method_signature) = "parent,finding_id,finding"; } // Gets the access control policy on the specified Source. - rpc GetIamPolicy(google.iam.v1.GetIamPolicyRequest) - returns (google.iam.v1.Policy) { + rpc GetIamPolicy(google.iam.v1.GetIamPolicyRequest) returns (google.iam.v1.Policy) { option (google.api.http) = { post: "/v1beta1/{resource=organizations/*/sources/*}:getIamPolicy" body: "*" }; + option (google.api.method_signature) = "resource"; } // Gets the settings for an organization. - rpc GetOrganizationSettings(GetOrganizationSettingsRequest) - returns (OrganizationSettings) { + rpc GetOrganizationSettings(GetOrganizationSettingsRequest) returns (OrganizationSettings) { option (google.api.http) = { get: "/v1beta1/{name=organizations/*/organizationSettings}" }; + option (google.api.method_signature) = "name"; } // Gets a source. @@ -77,6 +85,7 @@ service SecurityCenter { option (google.api.http) = { get: "/v1beta1/{name=organizations/*/sources/*}" }; + option (google.api.method_signature) = "name"; } // Filters an organization's assets and groups them by their specified @@ -92,12 +101,13 @@ service SecurityCenter { // specified properties. // // To group across all sources provide a `-` as the source id. - // Example: /v1beta1/organizations/123/sources/-/findings + // Example: /v1beta1/organizations/{organization_id}/sources/-/findings rpc GroupFindings(GroupFindingsRequest) returns (GroupFindingsResponse) { option (google.api.http) = { post: "/v1beta1/{parent=organizations/*/sources/*}/findings:group" body: "*" }; + option (google.api.method_signature) = "parent,group_by"; } // Lists an organization's assets. @@ -110,7 +120,7 @@ service SecurityCenter { // Lists an organization or source's findings. // // To list across all sources provide a `-` as the source id. - // Example: /v1beta1/organizations/123/sources/-/findings + // Example: /v1beta1/organizations/{organization_id}/sources/-/findings rpc ListFindings(ListFindingsRequest) returns (ListFindingsResponse) { option (google.api.http) = { get: "/v1beta1/{parent=organizations/*/sources/*}/findings" @@ -122,6 +132,7 @@ service SecurityCenter { option (google.api.http) = { get: "/v1beta1/{parent=organizations/*}/sources" }; + option (google.api.method_signature) = "parent"; } // Runs asset discovery. The discovery is tracked with a long-running @@ -130,12 +141,16 @@ service SecurityCenter { // This API can only be called with limited frequency for an organization. If // it is called too frequently the caller will receive a TOO_MANY_REQUESTS // error. - rpc RunAssetDiscovery(RunAssetDiscoveryRequest) - returns (google.longrunning.Operation) { + rpc RunAssetDiscovery(RunAssetDiscoveryRequest) returns (google.longrunning.Operation) { option (google.api.http) = { post: "/v1beta1/{parent=organizations/*}/assets:runDiscovery" body: "*" }; + option (google.api.method_signature) = "parent"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "google.protobuf.Empty" + }; } // Updates the state of a finding. @@ -144,24 +159,25 @@ service SecurityCenter { post: "/v1beta1/{name=organizations/*/sources/*/findings/*}:setState" body: "*" }; + option (google.api.method_signature) = "name,state,start_time"; } // Sets the access control policy on the specified Source. - rpc SetIamPolicy(google.iam.v1.SetIamPolicyRequest) - returns (google.iam.v1.Policy) { + rpc SetIamPolicy(google.iam.v1.SetIamPolicyRequest) returns (google.iam.v1.Policy) { option (google.api.http) = { post: "/v1beta1/{resource=organizations/*/sources/*}:setIamPolicy" body: "*" }; + option (google.api.method_signature) = "resource,policy"; } // Returns the permissions that a caller has on the specified source. - rpc TestIamPermissions(google.iam.v1.TestIamPermissionsRequest) - returns (google.iam.v1.TestIamPermissionsResponse) { + rpc TestIamPermissions(google.iam.v1.TestIamPermissionsRequest) returns (google.iam.v1.TestIamPermissionsResponse) { option (google.api.http) = { post: "/v1beta1/{resource=organizations/*/sources/*}:testIamPermissions" body: "*" }; + option (google.api.method_signature) = "resource,permissions"; } // Creates or updates a finding. The corresponding source must exist for a @@ -171,15 +187,16 @@ service SecurityCenter { patch: "/v1beta1/{finding.name=organizations/*/sources/*/findings/*}" body: "finding" }; + option (google.api.method_signature) = "finding"; } // Updates an organization's settings. - rpc UpdateOrganizationSettings(UpdateOrganizationSettingsRequest) - returns (OrganizationSettings) { + rpc UpdateOrganizationSettings(UpdateOrganizationSettingsRequest) returns (OrganizationSettings) { option (google.api.http) = { patch: "/v1beta1/{organization_settings.name=organizations/*/organizationSettings}" body: "organization_settings" }; + option (google.api.method_signature) = "organization_settings"; } // Updates a source. @@ -188,6 +205,7 @@ service SecurityCenter { patch: "/v1beta1/{source.name=organizations/*/sources/*}" body: "source" }; + option (google.api.method_signature) = "source"; } // Updates security marks. @@ -200,55 +218,81 @@ service SecurityCenter { body: "security_marks" } }; + option (google.api.method_signature) = "security_marks"; } } // Request message for creating a finding. message CreateFindingRequest { - // Resource name of the new finding's parent. Its format should be + // Required. Resource name of the new finding's parent. Its format should be // "organizations/[organization_id]/sources/[source_id]". - string parent = 1; + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "securitycenter.googleapis.com/Source" + } + ]; - // Unique identifier provided by the client within the parent scope. + // Required. Unique identifier provided by the client within the parent scope. // It must be alphanumeric and less than or equal to 32 characters and // greater than 0 characters in length. - string finding_id = 2; + string finding_id = 2 [(google.api.field_behavior) = REQUIRED]; - // The Finding being created. The name and security_marks will be ignored as + // Required. The Finding being created. The name and security_marks will be ignored as // they are both output only fields on this resource. - Finding finding = 3; + Finding finding = 3 [(google.api.field_behavior) = REQUIRED]; } // Request message for creating a source. message CreateSourceRequest { - // Resource name of the new source's parent. Its format should be + // Required. Resource name of the new source's parent. Its format should be // "organizations/[organization_id]". - string parent = 1; + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudresourcemanager.googleapis.com/Organization" + } + ]; - // The Source being created, only the display_name and description will be + // Required. The Source being created, only the display_name and description will be // used. All other fields will be ignored. - Source source = 2; + Source source = 2 [(google.api.field_behavior) = REQUIRED]; } // Request message for getting organization settings. message GetOrganizationSettingsRequest { - // Name of the organization to get organization settings for. Its format is + // Required. Name of the organization to get organization settings for. Its format is // "organizations/[organization_id]/organizationSettings". - string name = 1; + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "securitycenter.googleapis.com/OrganizationSettings" + } + ]; } // Request message for getting a source. message GetSourceRequest { - // Relative resource name of the source. Its format is + // Required. Relative resource name of the source. Its format is // "organizations/[organization_id]/source/[source_id]". - string name = 1; + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "securitycenter.googleapis.com/Source" + } + ]; } // Request message for grouping by assets. message GroupAssetsRequest { - // Name of the organization to groupBy. Its format is + // Required. Name of the organization to groupBy. Its format is // "organizations/[organization_id]". - string parent = 1; + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudresourcemanager.googleapis.com/Organization" + } + ]; // Expression that defines the filter to apply across assets. // The expression is a list of zero or more restrictions combined via logical @@ -279,7 +323,7 @@ message GroupAssetsRequest { // For example, `resource_properties.size = 100` is a valid filter string. string filter = 2; - // Expression that defines what assets fields to use for grouping. The string + // Required. Expression that defines what assets fields to use for grouping. The string // value should follow SQL syntax: comma separated list of fields. For // example: // "security_center_properties.resource_project,security_center_properties.project". @@ -293,7 +337,7 @@ message GroupAssetsRequest { // The following fields are supported when compare_duration is set: // // * security_center_properties.resource_type - string group_by = 3; + string group_by = 3 [(google.api.field_behavior) = REQUIRED]; // When compare_duration is set, the Asset's "state" property is updated to // indicate whether the asset was added, removed, or remained present during @@ -351,11 +395,16 @@ message GroupAssetsResponse { // Request message for grouping by findings. message GroupFindingsRequest { - // Name of the source to groupBy. Its format is + // Required. Name of the source to groupBy. Its format is // "organizations/[organization_id]/sources/[source_id]". To groupBy across // all sources provide a source_id of `-`. For example: - // organizations/123/sources/- - string parent = 1; + // organizations/{organization_id}/sources/- + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "securitycenter.googleapis.com/Source" + } + ]; // Expression that defines the filter to apply across findings. // The expression is a list of one or more restrictions combined via logical @@ -384,7 +433,7 @@ message GroupFindingsRequest { // For example, `source_properties.size = 100` is a valid filter string. string filter = 2; - // Expression that defines what assets fields to use for grouping (including + // Required. Expression that defines what assets fields to use for grouping (including // `state`). The string value should follow SQL syntax: comma separated list // of fields. For example: // "parent,resource_name". @@ -395,7 +444,7 @@ message GroupFindingsRequest { // * category // * state // * parent - string group_by = 3; + string group_by = 3 [(google.api.field_behavior) = REQUIRED]; // Time used as a reference point when filtering findings. The filter is // limited to findings existing at the supplied time and their values are @@ -439,9 +488,14 @@ message GroupResult { // Request message for listing sources. message ListSourcesRequest { - // Resource name of the parent of sources to list. Its format should be + // Required. Resource name of the parent of sources to list. Its format should be // "organizations/[organization_id]". - string parent = 1; + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudresourcemanager.googleapis.com/Organization" + } + ]; // The value returned by the last `ListSourcesResponse`; indicates // that this is a continuation of a prior `ListSources` call, and @@ -465,9 +519,14 @@ message ListSourcesResponse { // Request message for listing assets. message ListAssetsRequest { - // Name of the organization assets should belong to. Its format is + // Required. Name of the organization assets should belong to. Its format is // "organizations/[organization_id]". - string parent = 1; + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudresourcemanager.googleapis.com/Organization" + } + ]; // Expression that defines the filter to apply across assets. // The expression is a list of zero or more restrictions combined via logical @@ -539,12 +598,10 @@ message ListAssetsRequest { // "UNUSED", which indicates that the asset is present at read_time. google.protobuf.Duration compare_duration = 5; - // Optional. - // - // A field mask to specify the ListAssetsResult fields to be listed in the + // Optional. A field mask to specify the ListAssetsResult fields to be listed in the // response. // An empty field mask will list all fields. - google.protobuf.FieldMask field_mask = 7; + google.protobuf.FieldMask field_mask = 7 [(google.api.field_behavior) = OPTIONAL]; // The value returned by the last `ListAssetsResponse`; indicates // that this is a continuation of a prior `ListAssets` call, and @@ -606,11 +663,16 @@ message ListAssetsResponse { // Request message for listing findings. message ListFindingsRequest { - // Name of the source the findings belong to. Its format is + // Required. Name of the source the findings belong to. Its format is // "organizations/[organization_id]/sources/[source_id]". To list across all // sources provide a source_id of `-`. For example: - // organizations/123/sources/- - string parent = 1; + // organizations/{organization_id}/sources/- + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "securitycenter.googleapis.com/Source" + } + ]; // Expression that defines the filter to apply across findings. // The expression is a list of one or more restrictions combined via logical @@ -655,11 +717,9 @@ message ListFindingsRequest { // API's version of NOW. google.protobuf.Timestamp read_time = 4; - // Optional. - // - // A field mask to specify the Finding fields to be listed in the response. + // Optional. A field mask to specify the Finding fields to be listed in the response. // An empty field mask will list all fields. - google.protobuf.FieldMask field_mask = 5; + google.protobuf.FieldMask field_mask = 5 [(google.api.field_behavior) = OPTIONAL]; // The value returned by the last `ListFindingsResponse`; indicates // that this is a continuation of a prior `ListFindings` call, and @@ -689,35 +749,45 @@ message ListFindingsResponse { // Request message for updating a finding's state. message SetFindingStateRequest { - // The relative resource name of the finding. See: + // Required. The relative resource name of the finding. See: // https://cloud.google.com/apis/design/resource_names#relative_resource_name // Example: - // "organizations/123/sources/456/finding/789". - string name = 1; + // "organizations/{organization_id}/sources/{source_id}/finding/{finding_id}". + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "securitycenter.googleapis.com/Finding" + } + ]; - // The desired State of the finding. - Finding.State state = 2; + // Required. The desired State of the finding. + Finding.State state = 2 [(google.api.field_behavior) = REQUIRED]; - // The time at which the updated state takes effect. - google.protobuf.Timestamp start_time = 3; + // Required. The time at which the updated state takes effect. + google.protobuf.Timestamp start_time = 3 [(google.api.field_behavior) = REQUIRED]; } // Request message for running asset discovery for an organization. message RunAssetDiscoveryRequest { - // Name of the organization to run asset discovery for. Its format is + // Required. Name of the organization to run asset discovery for. Its format is // "organizations/[organization_id]". - string parent = 1; + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudresourcemanager.googleapis.com/Organization" + } + ]; } // Request message for updating or creating a finding. message UpdateFindingRequest { - // The finding resource to update or create if it does not already exist. + // Required. The finding resource to update or create if it does not already exist. // parent, security_marks, and update_time will be ignored. // // In the case of creation, the finding id portion of the name must // alphanumeric and less than or equal to 32 characters and greater than 0 // characters in length. - Finding finding = 1; + Finding finding = 1 [(google.api.field_behavior) = REQUIRED]; // The FieldMask to use when updating the finding resource. This field should // not be specified when creating a finding. @@ -726,8 +796,8 @@ message UpdateFindingRequest { // Request message for updating an organization's settings. message UpdateOrganizationSettingsRequest { - // The organization settings resource to update. - OrganizationSettings organization_settings = 1; + // Required. The organization settings resource to update. + OrganizationSettings organization_settings = 1 [(google.api.field_behavior) = REQUIRED]; // The FieldMask to use when updating the settings resource. google.protobuf.FieldMask update_mask = 2; @@ -735,8 +805,8 @@ message UpdateOrganizationSettingsRequest { // Request message for updating a source. message UpdateSourceRequest { - // The source resource to update. - Source source = 1; + // Required. The source resource to update. + Source source = 1 [(google.api.field_behavior) = REQUIRED]; // The FieldMask to use when updating the source resource. google.protobuf.FieldMask update_mask = 2; @@ -744,8 +814,8 @@ message UpdateSourceRequest { // Request message for updating a SecurityMarks resource. message UpdateSecurityMarksRequest { - // The security marks resource to update. - SecurityMarks security_marks = 1; + // Required. The security marks resource to update. + SecurityMarks security_marks = 1 [(google.api.field_behavior) = REQUIRED]; // The FieldMask to use when updating the security marks resource. google.protobuf.FieldMask update_mask = 2; diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/source.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/source.proto index cc1fae6eaa6..98025bca28d 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/source.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/source.proto @@ -1,4 +1,4 @@ -// Copyright 2018 Google LLC. +// Copyright 2019 Google LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -17,6 +17,7 @@ syntax = "proto3"; package google.cloud.securitycenter.v1beta1; +import "google/api/resource.proto"; import "google/api/annotations.proto"; option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1beta1;securitycenter"; @@ -27,19 +28,22 @@ option java_package = "com.google.cloud.securitycenter.v1beta1"; // is an entity or a mechanism that can produce a finding. A source is like a // container of findings that come from the same scanner, logger, monitor, etc. message Source { + option (google.api.resource) = { + type: "securitycenter.googleapis.com/Source" + pattern: "organizations/{organization}/sources/{source}" + }; + // The relative resource name of this source. See: // https://cloud.google.com/apis/design/resource_names#relative_resource_name // Example: - // "organizations/123/sources/456" + // "organizations/{organization_id}/sources/{source_id}" string name = 1; // The source's display name. // A source's display name must be unique amongst its siblings, for example, // two sources with the same parent can't share the same display name. - // The display name must start and end with a letter or digit, may contain - // letters, digits, spaces, hyphens, and underscores, and can be no longer - // than 32 characters. This is captured by the regular expression: - // [\p{L}\p{N}]({\p{L}\p{N}_- ]{0,30}[\p{L}\p{N}])?. + // The display name must have a length between 1 and 64 characters + // (inclusive). string display_name = 2; // The description of the source (max of 1024 characters). diff --git a/packages/google-cloud-securitycenter/protos/protos.d.ts b/packages/google-cloud-securitycenter/protos/protos.d.ts index 186c0a77015..7043090e680 100644 --- a/packages/google-cloud-securitycenter/protos/protos.d.ts +++ b/packages/google-cloud-securitycenter/protos/protos.d.ts @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC +// 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. @@ -26,7334 +26,7815 @@ export namespace google { /** Namespace v1. */ namespace v1 { - /** Represents a SecurityCenter */ - class SecurityCenter extends $protobuf.rpc.Service { + /** Properties of a Finding. */ + interface IFinding { - /** - * Constructs a new SecurityCenter 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); + /** Finding name */ + name?: (string|null); + + /** Finding parent */ + parent?: (string|null); + + /** Finding resourceName */ + resourceName?: (string|null); + + /** Finding state */ + state?: (google.cloud.securitycenter.v1.Finding.State|null); + + /** Finding category */ + category?: (string|null); + + /** Finding externalUri */ + externalUri?: (string|null); + + /** Finding sourceProperties */ + sourceProperties?: ({ [k: string]: google.protobuf.IValue }|null); + + /** Finding securityMarks */ + securityMarks?: (google.cloud.securitycenter.v1.ISecurityMarks|null); + + /** Finding eventTime */ + eventTime?: (google.protobuf.ITimestamp|null); + + /** Finding createTime */ + createTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a Finding. */ + class Finding implements IFinding { /** - * Creates new SecurityCenter 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. + * Constructs a new Finding. + * @param [properties] Properties to set */ - public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): SecurityCenter; + constructor(properties?: google.cloud.securitycenter.v1.IFinding); + + /** Finding name. */ + public name: string; + + /** Finding parent. */ + public parent: string; + + /** Finding resourceName. */ + public resourceName: string; + + /** Finding state. */ + public state: google.cloud.securitycenter.v1.Finding.State; + + /** Finding category. */ + public category: string; + + /** Finding externalUri. */ + public externalUri: string; + + /** Finding sourceProperties. */ + public sourceProperties: { [k: string]: google.protobuf.IValue }; + + /** Finding securityMarks. */ + public securityMarks?: (google.cloud.securitycenter.v1.ISecurityMarks|null); + + /** Finding eventTime. */ + public eventTime?: (google.protobuf.ITimestamp|null); + + /** Finding createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); /** - * Calls CreateSource. - * @param request CreateSourceRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Source + * Creates a new Finding instance using the specified properties. + * @param [properties] Properties to set + * @returns Finding instance */ - public createSource(request: google.cloud.securitycenter.v1.ICreateSourceRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.CreateSourceCallback): void; + public static create(properties?: google.cloud.securitycenter.v1.IFinding): google.cloud.securitycenter.v1.Finding; /** - * Calls CreateSource. - * @param request CreateSourceRequest message or plain object - * @returns Promise + * Encodes the specified Finding message. Does not implicitly {@link google.cloud.securitycenter.v1.Finding.verify|verify} messages. + * @param message Finding message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - public createSource(request: google.cloud.securitycenter.v1.ICreateSourceRequest): Promise; + public static encode(message: google.cloud.securitycenter.v1.IFinding, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Calls CreateFinding. - * @param request CreateFindingRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Finding + * Encodes the specified Finding message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Finding.verify|verify} messages. + * @param message Finding message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - public createFinding(request: google.cloud.securitycenter.v1.ICreateFindingRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.CreateFindingCallback): void; + public static encodeDelimited(message: google.cloud.securitycenter.v1.IFinding, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Calls CreateFinding. - * @param request CreateFindingRequest message or plain object - * @returns Promise + * Decodes a Finding message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Finding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public createFinding(request: google.cloud.securitycenter.v1.ICreateFindingRequest): Promise; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1.Finding; /** - * Calls GetIamPolicy. - * @param request GetIamPolicyRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Policy + * Decodes a Finding message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Finding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public getIamPolicy(request: google.iam.v1.IGetIamPolicyRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.GetIamPolicyCallback): void; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1.Finding; /** - * Calls GetIamPolicy. - * @param request GetIamPolicyRequest message or plain object - * @returns Promise + * Verifies a Finding message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not */ - public getIamPolicy(request: google.iam.v1.IGetIamPolicyRequest): Promise; + public static verify(message: { [k: string]: any }): (string|null); /** - * Calls GetOrganizationSettings. - * @param request GetOrganizationSettingsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and OrganizationSettings + * Creates a Finding message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Finding */ - public getOrganizationSettings(request: google.cloud.securitycenter.v1.IGetOrganizationSettingsRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.GetOrganizationSettingsCallback): void; + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.Finding; /** - * Calls GetOrganizationSettings. - * @param request GetOrganizationSettingsRequest message or plain object - * @returns Promise + * Creates a plain object from a Finding message. Also converts values to other types if specified. + * @param message Finding + * @param [options] Conversion options + * @returns Plain object */ - public getOrganizationSettings(request: google.cloud.securitycenter.v1.IGetOrganizationSettingsRequest): Promise; + public static toObject(message: google.cloud.securitycenter.v1.Finding, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Calls GetSource. - * @param request GetSourceRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Source + * Converts this Finding to JSON. + * @returns JSON object */ - public getSource(request: google.cloud.securitycenter.v1.IGetSourceRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.GetSourceCallback): void; + public toJSON(): { [k: string]: any }; + } + + namespace Finding { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + ACTIVE = 1, + INACTIVE = 2 + } + } + + /** Properties of a SecurityMarks. */ + interface ISecurityMarks { + + /** SecurityMarks name */ + name?: (string|null); + + /** SecurityMarks marks */ + marks?: ({ [k: string]: string }|null); + } + + /** Represents a SecurityMarks. */ + class SecurityMarks implements ISecurityMarks { /** - * Calls GetSource. - * @param request GetSourceRequest message or plain object - * @returns Promise + * Constructs a new SecurityMarks. + * @param [properties] Properties to set */ - public getSource(request: google.cloud.securitycenter.v1.IGetSourceRequest): Promise; + constructor(properties?: google.cloud.securitycenter.v1.ISecurityMarks); + + /** SecurityMarks name. */ + public name: string; + + /** SecurityMarks marks. */ + public marks: { [k: string]: string }; /** - * Calls GroupAssets. - * @param request GroupAssetsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and GroupAssetsResponse + * Creates a new SecurityMarks instance using the specified properties. + * @param [properties] Properties to set + * @returns SecurityMarks instance */ - public groupAssets(request: google.cloud.securitycenter.v1.IGroupAssetsRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.GroupAssetsCallback): void; + public static create(properties?: google.cloud.securitycenter.v1.ISecurityMarks): google.cloud.securitycenter.v1.SecurityMarks; /** - * Calls GroupAssets. - * @param request GroupAssetsRequest message or plain object - * @returns Promise + * Encodes the specified SecurityMarks message. Does not implicitly {@link google.cloud.securitycenter.v1.SecurityMarks.verify|verify} messages. + * @param message SecurityMarks message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - public groupAssets(request: google.cloud.securitycenter.v1.IGroupAssetsRequest): Promise; + public static encode(message: google.cloud.securitycenter.v1.ISecurityMarks, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Calls GroupFindings. - * @param request GroupFindingsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and GroupFindingsResponse + * Encodes the specified SecurityMarks message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.SecurityMarks.verify|verify} messages. + * @param message SecurityMarks message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - public groupFindings(request: google.cloud.securitycenter.v1.IGroupFindingsRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.GroupFindingsCallback): void; + public static encodeDelimited(message: google.cloud.securitycenter.v1.ISecurityMarks, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Calls GroupFindings. - * @param request GroupFindingsRequest message or plain object - * @returns Promise + * Decodes a SecurityMarks message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SecurityMarks + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public groupFindings(request: google.cloud.securitycenter.v1.IGroupFindingsRequest): Promise; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1.SecurityMarks; /** - * Calls ListAssets. - * @param request ListAssetsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListAssetsResponse + * Decodes a SecurityMarks message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SecurityMarks + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public listAssets(request: google.cloud.securitycenter.v1.IListAssetsRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.ListAssetsCallback): void; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1.SecurityMarks; /** - * Calls ListAssets. - * @param request ListAssetsRequest message or plain object - * @returns Promise + * Verifies a SecurityMarks message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not */ - public listAssets(request: google.cloud.securitycenter.v1.IListAssetsRequest): Promise; + public static verify(message: { [k: string]: any }): (string|null); /** - * Calls ListFindings. - * @param request ListFindingsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListFindingsResponse - */ - public listFindings(request: google.cloud.securitycenter.v1.IListFindingsRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.ListFindingsCallback): void; - - /** - * Calls ListFindings. - * @param request ListFindingsRequest message or plain object - * @returns Promise - */ - public listFindings(request: google.cloud.securitycenter.v1.IListFindingsRequest): Promise; - - /** - * Calls ListSources. - * @param request ListSourcesRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListSourcesResponse + * Creates a SecurityMarks message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SecurityMarks */ - public listSources(request: google.cloud.securitycenter.v1.IListSourcesRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.ListSourcesCallback): void; + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.SecurityMarks; /** - * Calls ListSources. - * @param request ListSourcesRequest message or plain object - * @returns Promise + * Creates a plain object from a SecurityMarks message. Also converts values to other types if specified. + * @param message SecurityMarks + * @param [options] Conversion options + * @returns Plain object */ - public listSources(request: google.cloud.securitycenter.v1.IListSourcesRequest): Promise; + public static toObject(message: google.cloud.securitycenter.v1.SecurityMarks, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Calls RunAssetDiscovery. - * @param request RunAssetDiscoveryRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation + * Converts this SecurityMarks to JSON. + * @returns JSON object */ - public runAssetDiscovery(request: google.cloud.securitycenter.v1.IRunAssetDiscoveryRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.RunAssetDiscoveryCallback): void; + public toJSON(): { [k: string]: any }; + } - /** - * Calls RunAssetDiscovery. - * @param request RunAssetDiscoveryRequest message or plain object - * @returns Promise - */ - public runAssetDiscovery(request: google.cloud.securitycenter.v1.IRunAssetDiscoveryRequest): Promise; + /** Properties of an Asset. */ + interface IAsset { - /** - * Calls SetFindingState. - * @param request SetFindingStateRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Finding - */ - public setFindingState(request: google.cloud.securitycenter.v1.ISetFindingStateRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.SetFindingStateCallback): void; + /** Asset name */ + name?: (string|null); - /** - * Calls SetFindingState. - * @param request SetFindingStateRequest message or plain object - * @returns Promise - */ - public setFindingState(request: google.cloud.securitycenter.v1.ISetFindingStateRequest): Promise; + /** Asset securityCenterProperties */ + securityCenterProperties?: (google.cloud.securitycenter.v1.Asset.ISecurityCenterProperties|null); - /** - * Calls SetIamPolicy. - * @param request SetIamPolicyRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Policy - */ - public setIamPolicy(request: google.iam.v1.ISetIamPolicyRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.SetIamPolicyCallback): void; + /** Asset resourceProperties */ + resourceProperties?: ({ [k: string]: google.protobuf.IValue }|null); - /** - * Calls SetIamPolicy. - * @param request SetIamPolicyRequest message or plain object - * @returns Promise - */ - public setIamPolicy(request: google.iam.v1.ISetIamPolicyRequest): Promise; + /** Asset securityMarks */ + securityMarks?: (google.cloud.securitycenter.v1.ISecurityMarks|null); - /** - * Calls TestIamPermissions. - * @param request TestIamPermissionsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and TestIamPermissionsResponse - */ - public testIamPermissions(request: google.iam.v1.ITestIamPermissionsRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.TestIamPermissionsCallback): void; + /** Asset createTime */ + createTime?: (google.protobuf.ITimestamp|null); - /** - * Calls TestIamPermissions. - * @param request TestIamPermissionsRequest message or plain object - * @returns Promise - */ - public testIamPermissions(request: google.iam.v1.ITestIamPermissionsRequest): Promise; + /** Asset updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); - /** - * Calls UpdateFinding. - * @param request UpdateFindingRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Finding - */ - public updateFinding(request: google.cloud.securitycenter.v1.IUpdateFindingRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.UpdateFindingCallback): void; + /** Asset iamPolicy */ + iamPolicy?: (google.cloud.securitycenter.v1.Asset.IIamPolicy|null); + } - /** - * Calls UpdateFinding. - * @param request UpdateFindingRequest message or plain object - * @returns Promise - */ - public updateFinding(request: google.cloud.securitycenter.v1.IUpdateFindingRequest): Promise; + /** Represents an Asset. */ + class Asset implements IAsset { /** - * Calls UpdateOrganizationSettings. - * @param request UpdateOrganizationSettingsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and OrganizationSettings + * Constructs a new Asset. + * @param [properties] Properties to set */ - public updateOrganizationSettings(request: google.cloud.securitycenter.v1.IUpdateOrganizationSettingsRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.UpdateOrganizationSettingsCallback): void; + constructor(properties?: google.cloud.securitycenter.v1.IAsset); - /** - * Calls UpdateOrganizationSettings. - * @param request UpdateOrganizationSettingsRequest message or plain object - * @returns Promise - */ - public updateOrganizationSettings(request: google.cloud.securitycenter.v1.IUpdateOrganizationSettingsRequest): Promise; + /** Asset name. */ + public name: string; - /** - * Calls UpdateSource. - * @param request UpdateSourceRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Source - */ - public updateSource(request: google.cloud.securitycenter.v1.IUpdateSourceRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.UpdateSourceCallback): void; + /** Asset securityCenterProperties. */ + public securityCenterProperties?: (google.cloud.securitycenter.v1.Asset.ISecurityCenterProperties|null); - /** - * Calls UpdateSource. - * @param request UpdateSourceRequest message or plain object - * @returns Promise - */ - public updateSource(request: google.cloud.securitycenter.v1.IUpdateSourceRequest): Promise; + /** Asset resourceProperties. */ + public resourceProperties: { [k: string]: google.protobuf.IValue }; - /** - * Calls UpdateSecurityMarks. - * @param request UpdateSecurityMarksRequest message or plain object - * @param callback Node-style callback called with the error, if any, and SecurityMarks - */ - public updateSecurityMarks(request: google.cloud.securitycenter.v1.IUpdateSecurityMarksRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.UpdateSecurityMarksCallback): void; + /** Asset securityMarks. */ + public securityMarks?: (google.cloud.securitycenter.v1.ISecurityMarks|null); - /** - * Calls UpdateSecurityMarks. - * @param request UpdateSecurityMarksRequest message or plain object - * @returns Promise - */ - public updateSecurityMarks(request: google.cloud.securitycenter.v1.IUpdateSecurityMarksRequest): Promise; - } + /** Asset createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); - namespace SecurityCenter { + /** Asset updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); - /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#createSource}. - * @param error Error, if any - * @param [response] Source - */ - type CreateSourceCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.Source) => void; + /** Asset iamPolicy. */ + public iamPolicy?: (google.cloud.securitycenter.v1.Asset.IIamPolicy|null); /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#createFinding}. - * @param error Error, if any - * @param [response] Finding + * Creates a new Asset instance using the specified properties. + * @param [properties] Properties to set + * @returns Asset instance */ - type CreateFindingCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.Finding) => void; + public static create(properties?: google.cloud.securitycenter.v1.IAsset): google.cloud.securitycenter.v1.Asset; /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#getIamPolicy}. - * @param error Error, if any - * @param [response] Policy + * Encodes the specified Asset message. Does not implicitly {@link google.cloud.securitycenter.v1.Asset.verify|verify} messages. + * @param message Asset message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - type GetIamPolicyCallback = (error: (Error|null), response?: google.iam.v1.Policy) => void; + public static encode(message: google.cloud.securitycenter.v1.IAsset, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#getOrganizationSettings}. - * @param error Error, if any - * @param [response] OrganizationSettings + * Encodes the specified Asset message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Asset.verify|verify} messages. + * @param message Asset message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - type GetOrganizationSettingsCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.OrganizationSettings) => void; + public static encodeDelimited(message: google.cloud.securitycenter.v1.IAsset, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#getSource}. - * @param error Error, if any - * @param [response] Source + * Decodes an Asset message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Asset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - type GetSourceCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.Source) => void; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1.Asset; /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#groupAssets}. - * @param error Error, if any - * @param [response] GroupAssetsResponse + * Decodes an Asset message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Asset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - type GroupAssetsCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.GroupAssetsResponse) => void; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1.Asset; /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#groupFindings}. - * @param error Error, if any - * @param [response] GroupFindingsResponse + * Verifies an Asset message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not */ - type GroupFindingsCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.GroupFindingsResponse) => void; + public static verify(message: { [k: string]: any }): (string|null); /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#listAssets}. - * @param error Error, if any - * @param [response] ListAssetsResponse + * Creates an Asset message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Asset */ - type ListAssetsCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.ListAssetsResponse) => void; + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.Asset; /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#listFindings}. - * @param error Error, if any - * @param [response] ListFindingsResponse + * Creates a plain object from an Asset message. Also converts values to other types if specified. + * @param message Asset + * @param [options] Conversion options + * @returns Plain object */ - type ListFindingsCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.ListFindingsResponse) => void; + public static toObject(message: google.cloud.securitycenter.v1.Asset, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#listSources}. - * @param error Error, if any - * @param [response] ListSourcesResponse + * Converts this Asset to JSON. + * @returns JSON object */ - type ListSourcesCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.ListSourcesResponse) => void; + public toJSON(): { [k: string]: any }; + } - /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#runAssetDiscovery}. - * @param error Error, if any - * @param [response] Operation - */ - type RunAssetDiscoveryCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + namespace Asset { - /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#setFindingState}. - * @param error Error, if any - * @param [response] Finding - */ - type SetFindingStateCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.Finding) => void; - - /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#setIamPolicy}. - * @param error Error, if any - * @param [response] Policy - */ - type SetIamPolicyCallback = (error: (Error|null), response?: google.iam.v1.Policy) => void; + /** Properties of a SecurityCenterProperties. */ + interface ISecurityCenterProperties { - /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#testIamPermissions}. - * @param error Error, if any - * @param [response] TestIamPermissionsResponse - */ - type TestIamPermissionsCallback = (error: (Error|null), response?: google.iam.v1.TestIamPermissionsResponse) => void; + /** SecurityCenterProperties resourceName */ + resourceName?: (string|null); - /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#updateFinding}. - * @param error Error, if any - * @param [response] Finding - */ - type UpdateFindingCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.Finding) => void; + /** SecurityCenterProperties resourceType */ + resourceType?: (string|null); - /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#updateOrganizationSettings}. - * @param error Error, if any - * @param [response] OrganizationSettings - */ - type UpdateOrganizationSettingsCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.OrganizationSettings) => void; + /** SecurityCenterProperties resourceParent */ + resourceParent?: (string|null); - /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#updateSource}. - * @param error Error, if any - * @param [response] Source - */ - type UpdateSourceCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.Source) => void; + /** SecurityCenterProperties resourceProject */ + resourceProject?: (string|null); - /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#updateSecurityMarks}. - * @param error Error, if any - * @param [response] SecurityMarks - */ - type UpdateSecurityMarksCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.SecurityMarks) => void; - } + /** SecurityCenterProperties resourceOwners */ + resourceOwners?: (string[]|null); - /** Properties of a CreateFindingRequest. */ - interface ICreateFindingRequest { + /** SecurityCenterProperties resourceDisplayName */ + resourceDisplayName?: (string|null); - /** CreateFindingRequest parent */ - parent?: (string|null); + /** SecurityCenterProperties resourceParentDisplayName */ + resourceParentDisplayName?: (string|null); - /** CreateFindingRequest findingId */ - findingId?: (string|null); + /** SecurityCenterProperties resourceProjectDisplayName */ + resourceProjectDisplayName?: (string|null); + } - /** CreateFindingRequest finding */ - finding?: (google.cloud.securitycenter.v1.IFinding|null); - } + /** Represents a SecurityCenterProperties. */ + class SecurityCenterProperties implements ISecurityCenterProperties { - /** Represents a CreateFindingRequest. */ - class CreateFindingRequest implements ICreateFindingRequest { + /** + * Constructs a new SecurityCenterProperties. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.Asset.ISecurityCenterProperties); - /** - * Constructs a new CreateFindingRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v1.ICreateFindingRequest); + /** SecurityCenterProperties resourceName. */ + public resourceName: string; - /** CreateFindingRequest parent. */ - public parent: string; + /** SecurityCenterProperties resourceType. */ + public resourceType: string; - /** CreateFindingRequest findingId. */ - public findingId: string; + /** SecurityCenterProperties resourceParent. */ + public resourceParent: string; - /** CreateFindingRequest finding. */ - public finding?: (google.cloud.securitycenter.v1.IFinding|null); + /** SecurityCenterProperties resourceProject. */ + public resourceProject: string; - /** - * Creates a new CreateFindingRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns CreateFindingRequest instance - */ - public static create(properties?: google.cloud.securitycenter.v1.ICreateFindingRequest): google.cloud.securitycenter.v1.CreateFindingRequest; + /** SecurityCenterProperties resourceOwners. */ + public resourceOwners: string[]; - /** - * Encodes the specified CreateFindingRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.CreateFindingRequest.verify|verify} messages. - * @param message CreateFindingRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v1.ICreateFindingRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** SecurityCenterProperties resourceDisplayName. */ + public resourceDisplayName: string; - /** - * Encodes the specified CreateFindingRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.CreateFindingRequest.verify|verify} messages. - * @param message CreateFindingRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v1.ICreateFindingRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** SecurityCenterProperties resourceParentDisplayName. */ + public resourceParentDisplayName: string; - /** - * Decodes a CreateFindingRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CreateFindingRequest - * @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.cloud.securitycenter.v1.CreateFindingRequest; + /** SecurityCenterProperties resourceProjectDisplayName. */ + public resourceProjectDisplayName: string; - /** - * Decodes a CreateFindingRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CreateFindingRequest - * @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.cloud.securitycenter.v1.CreateFindingRequest; + /** + * Creates a new SecurityCenterProperties instance using the specified properties. + * @param [properties] Properties to set + * @returns SecurityCenterProperties instance + */ + public static create(properties?: google.cloud.securitycenter.v1.Asset.ISecurityCenterProperties): google.cloud.securitycenter.v1.Asset.SecurityCenterProperties; - /** - * Verifies a CreateFindingRequest 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); + /** + * Encodes the specified SecurityCenterProperties message. Does not implicitly {@link google.cloud.securitycenter.v1.Asset.SecurityCenterProperties.verify|verify} messages. + * @param message SecurityCenterProperties message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.Asset.ISecurityCenterProperties, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Creates a CreateFindingRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CreateFindingRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.CreateFindingRequest; + /** + * Encodes the specified SecurityCenterProperties message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Asset.SecurityCenterProperties.verify|verify} messages. + * @param message SecurityCenterProperties message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.Asset.ISecurityCenterProperties, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Creates a plain object from a CreateFindingRequest message. Also converts values to other types if specified. - * @param message CreateFindingRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v1.CreateFindingRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Decodes a SecurityCenterProperties message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SecurityCenterProperties + * @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.cloud.securitycenter.v1.Asset.SecurityCenterProperties; - /** - * Converts this CreateFindingRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Decodes a SecurityCenterProperties message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SecurityCenterProperties + * @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.cloud.securitycenter.v1.Asset.SecurityCenterProperties; - /** Properties of a CreateSourceRequest. */ - interface ICreateSourceRequest { + /** + * Verifies a SecurityCenterProperties 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); - /** CreateSourceRequest parent */ - parent?: (string|null); + /** + * Creates a SecurityCenterProperties message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SecurityCenterProperties + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.Asset.SecurityCenterProperties; - /** CreateSourceRequest source */ - source?: (google.cloud.securitycenter.v1.ISource|null); - } + /** + * Creates a plain object from a SecurityCenterProperties message. Also converts values to other types if specified. + * @param message SecurityCenterProperties + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.Asset.SecurityCenterProperties, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** Represents a CreateSourceRequest. */ - class CreateSourceRequest implements ICreateSourceRequest { + /** + * Converts this SecurityCenterProperties to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Constructs a new CreateSourceRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v1.ICreateSourceRequest); + /** Properties of an IamPolicy. */ + interface IIamPolicy { - /** CreateSourceRequest parent. */ - public parent: string; + /** IamPolicy policyBlob */ + policyBlob?: (string|null); + } - /** CreateSourceRequest source. */ - public source?: (google.cloud.securitycenter.v1.ISource|null); + /** Represents an IamPolicy. */ + class IamPolicy implements IIamPolicy { - /** - * Creates a new CreateSourceRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns CreateSourceRequest instance - */ - public static create(properties?: google.cloud.securitycenter.v1.ICreateSourceRequest): google.cloud.securitycenter.v1.CreateSourceRequest; + /** + * Constructs a new IamPolicy. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.Asset.IIamPolicy); - /** - * Encodes the specified CreateSourceRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.CreateSourceRequest.verify|verify} messages. - * @param message CreateSourceRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v1.ICreateSourceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** IamPolicy policyBlob. */ + public policyBlob: string; - /** - * Encodes the specified CreateSourceRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.CreateSourceRequest.verify|verify} messages. - * @param message CreateSourceRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v1.ICreateSourceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Creates a new IamPolicy instance using the specified properties. + * @param [properties] Properties to set + * @returns IamPolicy instance + */ + public static create(properties?: google.cloud.securitycenter.v1.Asset.IIamPolicy): google.cloud.securitycenter.v1.Asset.IamPolicy; - /** - * Decodes a CreateSourceRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CreateSourceRequest - * @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.cloud.securitycenter.v1.CreateSourceRequest; + /** + * Encodes the specified IamPolicy message. Does not implicitly {@link google.cloud.securitycenter.v1.Asset.IamPolicy.verify|verify} messages. + * @param message IamPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.Asset.IIamPolicy, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Decodes a CreateSourceRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CreateSourceRequest - * @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.cloud.securitycenter.v1.CreateSourceRequest; + /** + * Encodes the specified IamPolicy message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Asset.IamPolicy.verify|verify} messages. + * @param message IamPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.Asset.IIamPolicy, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Verifies a CreateSourceRequest 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); + /** + * Decodes an IamPolicy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns IamPolicy + * @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.cloud.securitycenter.v1.Asset.IamPolicy; - /** - * Creates a CreateSourceRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CreateSourceRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.CreateSourceRequest; + /** + * Decodes an IamPolicy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns IamPolicy + * @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.cloud.securitycenter.v1.Asset.IamPolicy; - /** - * Creates a plain object from a CreateSourceRequest message. Also converts values to other types if specified. - * @param message CreateSourceRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v1.CreateSourceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Verifies an IamPolicy 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); - /** - * Converts this CreateSourceRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** + * Creates an IamPolicy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns IamPolicy + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.Asset.IamPolicy; + + /** + * Creates a plain object from an IamPolicy message. Also converts values to other types if specified. + * @param message IamPolicy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.Asset.IamPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this IamPolicy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } } - /** Properties of a GetOrganizationSettingsRequest. */ - interface IGetOrganizationSettingsRequest { + /** Properties of a Source. */ + interface ISource { - /** GetOrganizationSettingsRequest name */ + /** Source name */ name?: (string|null); + + /** Source displayName */ + displayName?: (string|null); + + /** Source description */ + description?: (string|null); } - /** Represents a GetOrganizationSettingsRequest. */ - class GetOrganizationSettingsRequest implements IGetOrganizationSettingsRequest { + /** Represents a Source. */ + class Source implements ISource { /** - * Constructs a new GetOrganizationSettingsRequest. + * Constructs a new Source. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.securitycenter.v1.IGetOrganizationSettingsRequest); + constructor(properties?: google.cloud.securitycenter.v1.ISource); - /** GetOrganizationSettingsRequest name. */ + /** Source name. */ public name: string; + /** Source displayName. */ + public displayName: string; + + /** Source description. */ + public description: string; + /** - * Creates a new GetOrganizationSettingsRequest instance using the specified properties. + * Creates a new Source instance using the specified properties. * @param [properties] Properties to set - * @returns GetOrganizationSettingsRequest instance + * @returns Source instance */ - public static create(properties?: google.cloud.securitycenter.v1.IGetOrganizationSettingsRequest): google.cloud.securitycenter.v1.GetOrganizationSettingsRequest; + public static create(properties?: google.cloud.securitycenter.v1.ISource): google.cloud.securitycenter.v1.Source; /** - * Encodes the specified GetOrganizationSettingsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.GetOrganizationSettingsRequest.verify|verify} messages. - * @param message GetOrganizationSettingsRequest message or plain object to encode + * Encodes the specified Source message. Does not implicitly {@link google.cloud.securitycenter.v1.Source.verify|verify} messages. + * @param message Source message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.securitycenter.v1.IGetOrganizationSettingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.securitycenter.v1.ISource, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified GetOrganizationSettingsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.GetOrganizationSettingsRequest.verify|verify} messages. - * @param message GetOrganizationSettingsRequest message or plain object to encode + * Encodes the specified Source message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Source.verify|verify} messages. + * @param message Source message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.securitycenter.v1.IGetOrganizationSettingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.securitycenter.v1.ISource, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a GetOrganizationSettingsRequest message from the specified reader or buffer. + * Decodes a Source message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns GetOrganizationSettingsRequest + * @returns Source * @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.cloud.securitycenter.v1.GetOrganizationSettingsRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1.Source; /** - * Decodes a GetOrganizationSettingsRequest message from the specified reader or buffer, length delimited. + * Decodes a Source message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns GetOrganizationSettingsRequest + * @returns Source * @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.cloud.securitycenter.v1.GetOrganizationSettingsRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1.Source; /** - * Verifies a GetOrganizationSettingsRequest message. + * Verifies a Source 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 GetOrganizationSettingsRequest message from a plain object. Also converts values to their respective internal types. + * Creates a Source message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns GetOrganizationSettingsRequest + * @returns Source */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.GetOrganizationSettingsRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.Source; /** - * Creates a plain object from a GetOrganizationSettingsRequest message. Also converts values to other types if specified. - * @param message GetOrganizationSettingsRequest + * Creates a plain object from a Source message. Also converts values to other types if specified. + * @param message Source * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.securitycenter.v1.GetOrganizationSettingsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.securitycenter.v1.Source, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this GetOrganizationSettingsRequest to JSON. + * Converts this Source to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a GetSourceRequest. */ - interface IGetSourceRequest { + /** Properties of a RunAssetDiscoveryResponse. */ + interface IRunAssetDiscoveryResponse { - /** GetSourceRequest name */ - name?: (string|null); + /** RunAssetDiscoveryResponse state */ + state?: (google.cloud.securitycenter.v1.RunAssetDiscoveryResponse.State|null); + + /** RunAssetDiscoveryResponse duration */ + duration?: (google.protobuf.IDuration|null); } - /** Represents a GetSourceRequest. */ - class GetSourceRequest implements IGetSourceRequest { + /** Represents a RunAssetDiscoveryResponse. */ + class RunAssetDiscoveryResponse implements IRunAssetDiscoveryResponse { /** - * Constructs a new GetSourceRequest. + * Constructs a new RunAssetDiscoveryResponse. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.securitycenter.v1.IGetSourceRequest); + constructor(properties?: google.cloud.securitycenter.v1.IRunAssetDiscoveryResponse); - /** GetSourceRequest name. */ - public name: string; + /** RunAssetDiscoveryResponse state. */ + public state: google.cloud.securitycenter.v1.RunAssetDiscoveryResponse.State; + + /** RunAssetDiscoveryResponse duration. */ + public duration?: (google.protobuf.IDuration|null); /** - * Creates a new GetSourceRequest instance using the specified properties. + * Creates a new RunAssetDiscoveryResponse instance using the specified properties. * @param [properties] Properties to set - * @returns GetSourceRequest instance + * @returns RunAssetDiscoveryResponse instance */ - public static create(properties?: google.cloud.securitycenter.v1.IGetSourceRequest): google.cloud.securitycenter.v1.GetSourceRequest; + public static create(properties?: google.cloud.securitycenter.v1.IRunAssetDiscoveryResponse): google.cloud.securitycenter.v1.RunAssetDiscoveryResponse; /** - * Encodes the specified GetSourceRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.GetSourceRequest.verify|verify} messages. - * @param message GetSourceRequest message or plain object to encode + * Encodes the specified RunAssetDiscoveryResponse message. Does not implicitly {@link google.cloud.securitycenter.v1.RunAssetDiscoveryResponse.verify|verify} messages. + * @param message RunAssetDiscoveryResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.securitycenter.v1.IGetSourceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.securitycenter.v1.IRunAssetDiscoveryResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified GetSourceRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.GetSourceRequest.verify|verify} messages. - * @param message GetSourceRequest message or plain object to encode + * Encodes the specified RunAssetDiscoveryResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.RunAssetDiscoveryResponse.verify|verify} messages. + * @param message RunAssetDiscoveryResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.securitycenter.v1.IGetSourceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.securitycenter.v1.IRunAssetDiscoveryResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a GetSourceRequest message from the specified reader or buffer. + * Decodes a RunAssetDiscoveryResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns GetSourceRequest + * @returns RunAssetDiscoveryResponse * @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.cloud.securitycenter.v1.GetSourceRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1.RunAssetDiscoveryResponse; /** - * Decodes a GetSourceRequest message from the specified reader or buffer, length delimited. + * Decodes a RunAssetDiscoveryResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns GetSourceRequest + * @returns RunAssetDiscoveryResponse * @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.cloud.securitycenter.v1.GetSourceRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1.RunAssetDiscoveryResponse; /** - * Verifies a GetSourceRequest message. + * Verifies a RunAssetDiscoveryResponse 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 GetSourceRequest message from a plain object. Also converts values to their respective internal types. + * Creates a RunAssetDiscoveryResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns GetSourceRequest + * @returns RunAssetDiscoveryResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.GetSourceRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.RunAssetDiscoveryResponse; /** - * Creates a plain object from a GetSourceRequest message. Also converts values to other types if specified. - * @param message GetSourceRequest + * Creates a plain object from a RunAssetDiscoveryResponse message. Also converts values to other types if specified. + * @param message RunAssetDiscoveryResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.securitycenter.v1.GetSourceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.securitycenter.v1.RunAssetDiscoveryResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this GetSourceRequest to JSON. + * Converts this RunAssetDiscoveryResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a GroupAssetsRequest. */ - interface IGroupAssetsRequest { - - /** GroupAssetsRequest parent */ - parent?: (string|null); - - /** GroupAssetsRequest filter */ - filter?: (string|null); + namespace RunAssetDiscoveryResponse { - /** GroupAssetsRequest groupBy */ - groupBy?: (string|null); + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + COMPLETED = 1, + SUPERSEDED = 2, + TERMINATED = 3 + } + } - /** GroupAssetsRequest compareDuration */ - compareDuration?: (google.protobuf.IDuration|null); + /** Properties of an OrganizationSettings. */ + interface IOrganizationSettings { - /** GroupAssetsRequest readTime */ - readTime?: (google.protobuf.ITimestamp|null); + /** OrganizationSettings name */ + name?: (string|null); - /** GroupAssetsRequest pageToken */ - pageToken?: (string|null); + /** OrganizationSettings enableAssetDiscovery */ + enableAssetDiscovery?: (boolean|null); - /** GroupAssetsRequest pageSize */ - pageSize?: (number|null); + /** OrganizationSettings assetDiscoveryConfig */ + assetDiscoveryConfig?: (google.cloud.securitycenter.v1.OrganizationSettings.IAssetDiscoveryConfig|null); } - /** Represents a GroupAssetsRequest. */ - class GroupAssetsRequest implements IGroupAssetsRequest { + /** Represents an OrganizationSettings. */ + class OrganizationSettings implements IOrganizationSettings { /** - * Constructs a new GroupAssetsRequest. + * Constructs a new OrganizationSettings. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.securitycenter.v1.IGroupAssetsRequest); - - /** GroupAssetsRequest parent. */ - public parent: string; - - /** GroupAssetsRequest filter. */ - public filter: string; - - /** GroupAssetsRequest groupBy. */ - public groupBy: string; - - /** GroupAssetsRequest compareDuration. */ - public compareDuration?: (google.protobuf.IDuration|null); + constructor(properties?: google.cloud.securitycenter.v1.IOrganizationSettings); - /** GroupAssetsRequest readTime. */ - public readTime?: (google.protobuf.ITimestamp|null); + /** OrganizationSettings name. */ + public name: string; - /** GroupAssetsRequest pageToken. */ - public pageToken: string; + /** OrganizationSettings enableAssetDiscovery. */ + public enableAssetDiscovery: boolean; - /** GroupAssetsRequest pageSize. */ - public pageSize: number; + /** OrganizationSettings assetDiscoveryConfig. */ + public assetDiscoveryConfig?: (google.cloud.securitycenter.v1.OrganizationSettings.IAssetDiscoveryConfig|null); /** - * Creates a new GroupAssetsRequest instance using the specified properties. + * Creates a new OrganizationSettings instance using the specified properties. * @param [properties] Properties to set - * @returns GroupAssetsRequest instance + * @returns OrganizationSettings instance */ - public static create(properties?: google.cloud.securitycenter.v1.IGroupAssetsRequest): google.cloud.securitycenter.v1.GroupAssetsRequest; + public static create(properties?: google.cloud.securitycenter.v1.IOrganizationSettings): google.cloud.securitycenter.v1.OrganizationSettings; /** - * Encodes the specified GroupAssetsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.GroupAssetsRequest.verify|verify} messages. - * @param message GroupAssetsRequest message or plain object to encode + * Encodes the specified OrganizationSettings message. Does not implicitly {@link google.cloud.securitycenter.v1.OrganizationSettings.verify|verify} messages. + * @param message OrganizationSettings message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.securitycenter.v1.IGroupAssetsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.securitycenter.v1.IOrganizationSettings, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified GroupAssetsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.GroupAssetsRequest.verify|verify} messages. - * @param message GroupAssetsRequest message or plain object to encode + * Encodes the specified OrganizationSettings message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.OrganizationSettings.verify|verify} messages. + * @param message OrganizationSettings message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.securitycenter.v1.IGroupAssetsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.securitycenter.v1.IOrganizationSettings, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a GroupAssetsRequest message from the specified reader or buffer. + * Decodes an OrganizationSettings message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns GroupAssetsRequest + * @returns OrganizationSettings * @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.cloud.securitycenter.v1.GroupAssetsRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1.OrganizationSettings; /** - * Decodes a GroupAssetsRequest message from the specified reader or buffer, length delimited. + * Decodes an OrganizationSettings message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns GroupAssetsRequest + * @returns OrganizationSettings * @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.cloud.securitycenter.v1.GroupAssetsRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1.OrganizationSettings; /** - * Verifies a GroupAssetsRequest message. + * Verifies an OrganizationSettings 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 GroupAssetsRequest message from a plain object. Also converts values to their respective internal types. + * Creates an OrganizationSettings message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns GroupAssetsRequest + * @returns OrganizationSettings */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.GroupAssetsRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.OrganizationSettings; /** - * Creates a plain object from a GroupAssetsRequest message. Also converts values to other types if specified. - * @param message GroupAssetsRequest + * Creates a plain object from an OrganizationSettings message. Also converts values to other types if specified. + * @param message OrganizationSettings * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.securitycenter.v1.GroupAssetsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.securitycenter.v1.OrganizationSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this GroupAssetsRequest to JSON. + * Converts this OrganizationSettings to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a GroupAssetsResponse. */ - interface IGroupAssetsResponse { - - /** GroupAssetsResponse groupByResults */ - groupByResults?: (google.cloud.securitycenter.v1.IGroupResult[]|null); + namespace OrganizationSettings { - /** GroupAssetsResponse readTime */ - readTime?: (google.protobuf.ITimestamp|null); + /** Properties of an AssetDiscoveryConfig. */ + interface IAssetDiscoveryConfig { - /** GroupAssetsResponse nextPageToken */ - nextPageToken?: (string|null); + /** AssetDiscoveryConfig projectIds */ + projectIds?: (string[]|null); - /** GroupAssetsResponse totalSize */ - totalSize?: (number|null); - } + /** AssetDiscoveryConfig inclusionMode */ + inclusionMode?: (google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode|null); + } - /** Represents a GroupAssetsResponse. */ - class GroupAssetsResponse implements IGroupAssetsResponse { + /** Represents an AssetDiscoveryConfig. */ + class AssetDiscoveryConfig implements IAssetDiscoveryConfig { - /** - * Constructs a new GroupAssetsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v1.IGroupAssetsResponse); + /** + * Constructs a new AssetDiscoveryConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.OrganizationSettings.IAssetDiscoveryConfig); - /** GroupAssetsResponse groupByResults. */ - public groupByResults: google.cloud.securitycenter.v1.IGroupResult[]; + /** AssetDiscoveryConfig projectIds. */ + public projectIds: string[]; - /** GroupAssetsResponse readTime. */ - public readTime?: (google.protobuf.ITimestamp|null); + /** AssetDiscoveryConfig inclusionMode. */ + public inclusionMode: google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode; - /** GroupAssetsResponse nextPageToken. */ - public nextPageToken: string; + /** + * Creates a new AssetDiscoveryConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns AssetDiscoveryConfig instance + */ + public static create(properties?: google.cloud.securitycenter.v1.OrganizationSettings.IAssetDiscoveryConfig): google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig; - /** GroupAssetsResponse totalSize. */ - public totalSize: number; + /** + * Encodes the specified AssetDiscoveryConfig message. Does not implicitly {@link google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.verify|verify} messages. + * @param message AssetDiscoveryConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.OrganizationSettings.IAssetDiscoveryConfig, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Creates a new GroupAssetsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns GroupAssetsResponse instance - */ - public static create(properties?: google.cloud.securitycenter.v1.IGroupAssetsResponse): google.cloud.securitycenter.v1.GroupAssetsResponse; + /** + * Encodes the specified AssetDiscoveryConfig message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.verify|verify} messages. + * @param message AssetDiscoveryConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.OrganizationSettings.IAssetDiscoveryConfig, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Encodes the specified GroupAssetsResponse message. Does not implicitly {@link google.cloud.securitycenter.v1.GroupAssetsResponse.verify|verify} messages. - * @param message GroupAssetsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v1.IGroupAssetsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Decodes an AssetDiscoveryConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AssetDiscoveryConfig + * @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.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig; - /** - * Encodes the specified GroupAssetsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.GroupAssetsResponse.verify|verify} messages. - * @param message GroupAssetsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v1.IGroupAssetsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Decodes an AssetDiscoveryConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AssetDiscoveryConfig + * @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.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig; - /** - * Decodes a GroupAssetsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GroupAssetsResponse - * @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.cloud.securitycenter.v1.GroupAssetsResponse; + /** + * Verifies an AssetDiscoveryConfig 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); - /** - * Decodes a GroupAssetsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GroupAssetsResponse - * @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.cloud.securitycenter.v1.GroupAssetsResponse; + /** + * Creates an AssetDiscoveryConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AssetDiscoveryConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig; + + /** + * Creates a plain object from an AssetDiscoveryConfig message. Also converts values to other types if specified. + * @param message AssetDiscoveryConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AssetDiscoveryConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace AssetDiscoveryConfig { + + /** InclusionMode enum. */ + enum InclusionMode { + INCLUSION_MODE_UNSPECIFIED = 0, + INCLUDE_ONLY = 1, + EXCLUDE = 2 + } + } + } + + /** Represents a SecurityCenter */ + class SecurityCenter extends $protobuf.rpc.Service { /** - * Verifies a GroupAssetsResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not + * Constructs a new SecurityCenter service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited */ - public static verify(message: { [k: string]: any }): (string|null); + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); /** - * Creates a GroupAssetsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GroupAssetsResponse + * Creates new SecurityCenter 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 fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.GroupAssetsResponse; + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): SecurityCenter; /** - * Creates a plain object from a GroupAssetsResponse message. Also converts values to other types if specified. - * @param message GroupAssetsResponse - * @param [options] Conversion options - * @returns Plain object + * Calls CreateSource. + * @param request CreateSourceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Source */ - public static toObject(message: google.cloud.securitycenter.v1.GroupAssetsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public createSource(request: google.cloud.securitycenter.v1.ICreateSourceRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.CreateSourceCallback): void; /** - * Converts this GroupAssetsResponse to JSON. - * @returns JSON object + * Calls CreateSource. + * @param request CreateSourceRequest message or plain object + * @returns Promise */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a GroupFindingsRequest. */ - interface IGroupFindingsRequest { - - /** GroupFindingsRequest parent */ - parent?: (string|null); - - /** GroupFindingsRequest filter */ - filter?: (string|null); - - /** GroupFindingsRequest groupBy */ - groupBy?: (string|null); - - /** GroupFindingsRequest readTime */ - readTime?: (google.protobuf.ITimestamp|null); + public createSource(request: google.cloud.securitycenter.v1.ICreateSourceRequest): Promise; - /** GroupFindingsRequest compareDuration */ - compareDuration?: (google.protobuf.IDuration|null); + /** + * Calls CreateFinding. + * @param request CreateFindingRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Finding + */ + public createFinding(request: google.cloud.securitycenter.v1.ICreateFindingRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.CreateFindingCallback): void; - /** GroupFindingsRequest pageToken */ - pageToken?: (string|null); + /** + * Calls CreateFinding. + * @param request CreateFindingRequest message or plain object + * @returns Promise + */ + public createFinding(request: google.cloud.securitycenter.v1.ICreateFindingRequest): Promise; - /** GroupFindingsRequest pageSize */ - pageSize?: (number|null); - } + /** + * Calls GetIamPolicy. + * @param request GetIamPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Policy + */ + public getIamPolicy(request: google.iam.v1.IGetIamPolicyRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.GetIamPolicyCallback): void; - /** Represents a GroupFindingsRequest. */ - class GroupFindingsRequest implements IGroupFindingsRequest { + /** + * Calls GetIamPolicy. + * @param request GetIamPolicyRequest message or plain object + * @returns Promise + */ + public getIamPolicy(request: google.iam.v1.IGetIamPolicyRequest): Promise; /** - * Constructs a new GroupFindingsRequest. - * @param [properties] Properties to set + * Calls GetOrganizationSettings. + * @param request GetOrganizationSettingsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and OrganizationSettings */ - constructor(properties?: google.cloud.securitycenter.v1.IGroupFindingsRequest); + public getOrganizationSettings(request: google.cloud.securitycenter.v1.IGetOrganizationSettingsRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.GetOrganizationSettingsCallback): void; - /** GroupFindingsRequest parent. */ - public parent: string; + /** + * Calls GetOrganizationSettings. + * @param request GetOrganizationSettingsRequest message or plain object + * @returns Promise + */ + public getOrganizationSettings(request: google.cloud.securitycenter.v1.IGetOrganizationSettingsRequest): Promise; - /** GroupFindingsRequest filter. */ - public filter: string; + /** + * Calls GetSource. + * @param request GetSourceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Source + */ + public getSource(request: google.cloud.securitycenter.v1.IGetSourceRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.GetSourceCallback): void; - /** GroupFindingsRequest groupBy. */ - public groupBy: string; + /** + * Calls GetSource. + * @param request GetSourceRequest message or plain object + * @returns Promise + */ + public getSource(request: google.cloud.securitycenter.v1.IGetSourceRequest): Promise; - /** GroupFindingsRequest readTime. */ - public readTime?: (google.protobuf.ITimestamp|null); + /** + * Calls GroupAssets. + * @param request GroupAssetsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and GroupAssetsResponse + */ + public groupAssets(request: google.cloud.securitycenter.v1.IGroupAssetsRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.GroupAssetsCallback): void; - /** GroupFindingsRequest compareDuration. */ - public compareDuration?: (google.protobuf.IDuration|null); + /** + * Calls GroupAssets. + * @param request GroupAssetsRequest message or plain object + * @returns Promise + */ + public groupAssets(request: google.cloud.securitycenter.v1.IGroupAssetsRequest): Promise; - /** GroupFindingsRequest pageToken. */ - public pageToken: string; + /** + * Calls GroupFindings. + * @param request GroupFindingsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and GroupFindingsResponse + */ + public groupFindings(request: google.cloud.securitycenter.v1.IGroupFindingsRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.GroupFindingsCallback): void; - /** GroupFindingsRequest pageSize. */ - public pageSize: number; + /** + * Calls GroupFindings. + * @param request GroupFindingsRequest message or plain object + * @returns Promise + */ + public groupFindings(request: google.cloud.securitycenter.v1.IGroupFindingsRequest): Promise; /** - * Creates a new GroupFindingsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GroupFindingsRequest instance + * Calls ListAssets. + * @param request ListAssetsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListAssetsResponse */ - public static create(properties?: google.cloud.securitycenter.v1.IGroupFindingsRequest): google.cloud.securitycenter.v1.GroupFindingsRequest; + public listAssets(request: google.cloud.securitycenter.v1.IListAssetsRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.ListAssetsCallback): void; /** - * Encodes the specified GroupFindingsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.GroupFindingsRequest.verify|verify} messages. - * @param message GroupFindingsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer + * Calls ListAssets. + * @param request ListAssetsRequest message or plain object + * @returns Promise */ - public static encode(message: google.cloud.securitycenter.v1.IGroupFindingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public listAssets(request: google.cloud.securitycenter.v1.IListAssetsRequest): Promise; /** - * Encodes the specified GroupFindingsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.GroupFindingsRequest.verify|verify} messages. - * @param message GroupFindingsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer + * Calls ListFindings. + * @param request ListFindingsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListFindingsResponse */ - public static encodeDelimited(message: google.cloud.securitycenter.v1.IGroupFindingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public listFindings(request: google.cloud.securitycenter.v1.IListFindingsRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.ListFindingsCallback): void; /** - * Decodes a GroupFindingsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GroupFindingsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Calls ListFindings. + * @param request ListFindingsRequest message or plain object + * @returns Promise */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1.GroupFindingsRequest; + public listFindings(request: google.cloud.securitycenter.v1.IListFindingsRequest): Promise; /** - * Decodes a GroupFindingsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GroupFindingsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Calls ListSources. + * @param request ListSourcesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListSourcesResponse */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1.GroupFindingsRequest; + public listSources(request: google.cloud.securitycenter.v1.IListSourcesRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.ListSourcesCallback): void; /** - * Verifies a GroupFindingsRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not + * Calls ListSources. + * @param request ListSourcesRequest message or plain object + * @returns Promise */ - public static verify(message: { [k: string]: any }): (string|null); + public listSources(request: google.cloud.securitycenter.v1.IListSourcesRequest): Promise; /** - * Creates a GroupFindingsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GroupFindingsRequest + * Calls RunAssetDiscovery. + * @param request RunAssetDiscoveryRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.GroupFindingsRequest; + public runAssetDiscovery(request: google.cloud.securitycenter.v1.IRunAssetDiscoveryRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.RunAssetDiscoveryCallback): void; /** - * Creates a plain object from a GroupFindingsRequest message. Also converts values to other types if specified. - * @param message GroupFindingsRequest - * @param [options] Conversion options - * @returns Plain object + * Calls RunAssetDiscovery. + * @param request RunAssetDiscoveryRequest message or plain object + * @returns Promise */ - public static toObject(message: google.cloud.securitycenter.v1.GroupFindingsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public runAssetDiscovery(request: google.cloud.securitycenter.v1.IRunAssetDiscoveryRequest): Promise; /** - * Converts this GroupFindingsRequest to JSON. - * @returns JSON object + * Calls SetFindingState. + * @param request SetFindingStateRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Finding */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a GroupFindingsResponse. */ - interface IGroupFindingsResponse { - - /** GroupFindingsResponse groupByResults */ - groupByResults?: (google.cloud.securitycenter.v1.IGroupResult[]|null); - - /** GroupFindingsResponse readTime */ - readTime?: (google.protobuf.ITimestamp|null); - - /** GroupFindingsResponse nextPageToken */ - nextPageToken?: (string|null); - - /** GroupFindingsResponse totalSize */ - totalSize?: (number|null); - } - - /** Represents a GroupFindingsResponse. */ - class GroupFindingsResponse implements IGroupFindingsResponse { + public setFindingState(request: google.cloud.securitycenter.v1.ISetFindingStateRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.SetFindingStateCallback): void; /** - * Constructs a new GroupFindingsResponse. - * @param [properties] Properties to set + * Calls SetFindingState. + * @param request SetFindingStateRequest message or plain object + * @returns Promise */ - constructor(properties?: google.cloud.securitycenter.v1.IGroupFindingsResponse); - - /** GroupFindingsResponse groupByResults. */ - public groupByResults: google.cloud.securitycenter.v1.IGroupResult[]; - - /** GroupFindingsResponse readTime. */ - public readTime?: (google.protobuf.ITimestamp|null); - - /** GroupFindingsResponse nextPageToken. */ - public nextPageToken: string; - - /** GroupFindingsResponse totalSize. */ - public totalSize: number; + public setFindingState(request: google.cloud.securitycenter.v1.ISetFindingStateRequest): Promise; /** - * Creates a new GroupFindingsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns GroupFindingsResponse instance + * Calls SetIamPolicy. + * @param request SetIamPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Policy */ - public static create(properties?: google.cloud.securitycenter.v1.IGroupFindingsResponse): google.cloud.securitycenter.v1.GroupFindingsResponse; + public setIamPolicy(request: google.iam.v1.ISetIamPolicyRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.SetIamPolicyCallback): void; /** - * Encodes the specified GroupFindingsResponse message. Does not implicitly {@link google.cloud.securitycenter.v1.GroupFindingsResponse.verify|verify} messages. - * @param message GroupFindingsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer + * Calls SetIamPolicy. + * @param request SetIamPolicyRequest message or plain object + * @returns Promise */ - public static encode(message: google.cloud.securitycenter.v1.IGroupFindingsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public setIamPolicy(request: google.iam.v1.ISetIamPolicyRequest): Promise; /** - * Encodes the specified GroupFindingsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.GroupFindingsResponse.verify|verify} messages. - * @param message GroupFindingsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer + * Calls TestIamPermissions. + * @param request TestIamPermissionsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and TestIamPermissionsResponse */ - public static encodeDelimited(message: google.cloud.securitycenter.v1.IGroupFindingsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public testIamPermissions(request: google.iam.v1.ITestIamPermissionsRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.TestIamPermissionsCallback): void; /** - * Decodes a GroupFindingsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GroupFindingsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Calls TestIamPermissions. + * @param request TestIamPermissionsRequest message or plain object + * @returns Promise */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1.GroupFindingsResponse; + public testIamPermissions(request: google.iam.v1.ITestIamPermissionsRequest): Promise; /** - * Decodes a GroupFindingsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GroupFindingsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Calls UpdateFinding. + * @param request UpdateFindingRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Finding */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1.GroupFindingsResponse; + public updateFinding(request: google.cloud.securitycenter.v1.IUpdateFindingRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.UpdateFindingCallback): void; /** - * Verifies a GroupFindingsResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not + * Calls UpdateFinding. + * @param request UpdateFindingRequest message or plain object + * @returns Promise */ - public static verify(message: { [k: string]: any }): (string|null); + public updateFinding(request: google.cloud.securitycenter.v1.IUpdateFindingRequest): Promise; /** - * Creates a GroupFindingsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GroupFindingsResponse + * Calls UpdateOrganizationSettings. + * @param request UpdateOrganizationSettingsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and OrganizationSettings */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.GroupFindingsResponse; + public updateOrganizationSettings(request: google.cloud.securitycenter.v1.IUpdateOrganizationSettingsRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.UpdateOrganizationSettingsCallback): void; /** - * Creates a plain object from a GroupFindingsResponse message. Also converts values to other types if specified. - * @param message GroupFindingsResponse - * @param [options] Conversion options - * @returns Plain object + * Calls UpdateOrganizationSettings. + * @param request UpdateOrganizationSettingsRequest message or plain object + * @returns Promise */ - public static toObject(message: google.cloud.securitycenter.v1.GroupFindingsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public updateOrganizationSettings(request: google.cloud.securitycenter.v1.IUpdateOrganizationSettingsRequest): Promise; /** - * Converts this GroupFindingsResponse to JSON. - * @returns JSON object + * Calls UpdateSource. + * @param request UpdateSourceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Source */ - public toJSON(): { [k: string]: any }; - } + public updateSource(request: google.cloud.securitycenter.v1.IUpdateSourceRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.UpdateSourceCallback): void; - /** Properties of a GroupResult. */ - interface IGroupResult { + /** + * Calls UpdateSource. + * @param request UpdateSourceRequest message or plain object + * @returns Promise + */ + public updateSource(request: google.cloud.securitycenter.v1.IUpdateSourceRequest): Promise; - /** GroupResult properties */ - properties?: ({ [k: string]: google.protobuf.IValue }|null); + /** + * Calls UpdateSecurityMarks. + * @param request UpdateSecurityMarksRequest message or plain object + * @param callback Node-style callback called with the error, if any, and SecurityMarks + */ + public updateSecurityMarks(request: google.cloud.securitycenter.v1.IUpdateSecurityMarksRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.UpdateSecurityMarksCallback): void; - /** GroupResult count */ - count?: (number|Long|null); + /** + * Calls UpdateSecurityMarks. + * @param request UpdateSecurityMarksRequest message or plain object + * @returns Promise + */ + public updateSecurityMarks(request: google.cloud.securitycenter.v1.IUpdateSecurityMarksRequest): Promise; } - /** Represents a GroupResult. */ - class GroupResult implements IGroupResult { + namespace SecurityCenter { /** - * Constructs a new GroupResult. - * @param [properties] Properties to set + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#createSource}. + * @param error Error, if any + * @param [response] Source */ - constructor(properties?: google.cloud.securitycenter.v1.IGroupResult); + type CreateSourceCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.Source) => void; - /** GroupResult properties. */ - public properties: { [k: string]: google.protobuf.IValue }; + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#createFinding}. + * @param error Error, if any + * @param [response] Finding + */ + type CreateFindingCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.Finding) => void; - /** GroupResult count. */ - public count: (number|Long); + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#getIamPolicy}. + * @param error Error, if any + * @param [response] Policy + */ + type GetIamPolicyCallback = (error: (Error|null), response?: google.iam.v1.Policy) => void; /** - * Creates a new GroupResult instance using the specified properties. - * @param [properties] Properties to set - * @returns GroupResult instance + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#getOrganizationSettings}. + * @param error Error, if any + * @param [response] OrganizationSettings */ - public static create(properties?: google.cloud.securitycenter.v1.IGroupResult): google.cloud.securitycenter.v1.GroupResult; + type GetOrganizationSettingsCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.OrganizationSettings) => void; /** - * Encodes the specified GroupResult message. Does not implicitly {@link google.cloud.securitycenter.v1.GroupResult.verify|verify} messages. - * @param message GroupResult message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#getSource}. + * @param error Error, if any + * @param [response] Source */ - public static encode(message: google.cloud.securitycenter.v1.IGroupResult, writer?: $protobuf.Writer): $protobuf.Writer; + type GetSourceCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.Source) => void; /** - * Encodes the specified GroupResult message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.GroupResult.verify|verify} messages. - * @param message GroupResult message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#groupAssets}. + * @param error Error, if any + * @param [response] GroupAssetsResponse */ - public static encodeDelimited(message: google.cloud.securitycenter.v1.IGroupResult, writer?: $protobuf.Writer): $protobuf.Writer; + type GroupAssetsCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.GroupAssetsResponse) => void; /** - * Decodes a GroupResult message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GroupResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#groupFindings}. + * @param error Error, if any + * @param [response] GroupFindingsResponse */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1.GroupResult; + type GroupFindingsCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.GroupFindingsResponse) => void; /** - * Decodes a GroupResult message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GroupResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#listAssets}. + * @param error Error, if any + * @param [response] ListAssetsResponse */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1.GroupResult; + type ListAssetsCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.ListAssetsResponse) => void; /** - * Verifies a GroupResult message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#listFindings}. + * @param error Error, if any + * @param [response] ListFindingsResponse */ - public static verify(message: { [k: string]: any }): (string|null); + type ListFindingsCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.ListFindingsResponse) => void; /** - * Creates a GroupResult message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GroupResult + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#listSources}. + * @param error Error, if any + * @param [response] ListSourcesResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.GroupResult; + type ListSourcesCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.ListSourcesResponse) => void; /** - * Creates a plain object from a GroupResult message. Also converts values to other types if specified. - * @param message GroupResult - * @param [options] Conversion options - * @returns Plain object + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#runAssetDiscovery}. + * @param error Error, if any + * @param [response] Operation */ - public static toObject(message: google.cloud.securitycenter.v1.GroupResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + type RunAssetDiscoveryCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; /** - * Converts this GroupResult to JSON. - * @returns JSON object + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#setFindingState}. + * @param error Error, if any + * @param [response] Finding */ - public toJSON(): { [k: string]: any }; - } + type SetFindingStateCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.Finding) => void; - /** Properties of a ListSourcesRequest. */ - interface IListSourcesRequest { + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#setIamPolicy}. + * @param error Error, if any + * @param [response] Policy + */ + type SetIamPolicyCallback = (error: (Error|null), response?: google.iam.v1.Policy) => void; - /** ListSourcesRequest parent */ + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#testIamPermissions}. + * @param error Error, if any + * @param [response] TestIamPermissionsResponse + */ + type TestIamPermissionsCallback = (error: (Error|null), response?: google.iam.v1.TestIamPermissionsResponse) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#updateFinding}. + * @param error Error, if any + * @param [response] Finding + */ + type UpdateFindingCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.Finding) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#updateOrganizationSettings}. + * @param error Error, if any + * @param [response] OrganizationSettings + */ + type UpdateOrganizationSettingsCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.OrganizationSettings) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#updateSource}. + * @param error Error, if any + * @param [response] Source + */ + type UpdateSourceCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.Source) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#updateSecurityMarks}. + * @param error Error, if any + * @param [response] SecurityMarks + */ + type UpdateSecurityMarksCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.SecurityMarks) => void; + } + + /** Properties of a CreateFindingRequest. */ + interface ICreateFindingRequest { + + /** CreateFindingRequest parent */ parent?: (string|null); - /** ListSourcesRequest pageToken */ - pageToken?: (string|null); + /** CreateFindingRequest findingId */ + findingId?: (string|null); - /** ListSourcesRequest pageSize */ - pageSize?: (number|null); + /** CreateFindingRequest finding */ + finding?: (google.cloud.securitycenter.v1.IFinding|null); } - /** Represents a ListSourcesRequest. */ - class ListSourcesRequest implements IListSourcesRequest { + /** Represents a CreateFindingRequest. */ + class CreateFindingRequest implements ICreateFindingRequest { /** - * Constructs a new ListSourcesRequest. + * Constructs a new CreateFindingRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.securitycenter.v1.IListSourcesRequest); + constructor(properties?: google.cloud.securitycenter.v1.ICreateFindingRequest); - /** ListSourcesRequest parent. */ + /** CreateFindingRequest parent. */ public parent: string; - /** ListSourcesRequest pageToken. */ - public pageToken: string; + /** CreateFindingRequest findingId. */ + public findingId: string; - /** ListSourcesRequest pageSize. */ - public pageSize: number; + /** CreateFindingRequest finding. */ + public finding?: (google.cloud.securitycenter.v1.IFinding|null); /** - * Creates a new ListSourcesRequest instance using the specified properties. + * Creates a new CreateFindingRequest instance using the specified properties. * @param [properties] Properties to set - * @returns ListSourcesRequest instance + * @returns CreateFindingRequest instance */ - public static create(properties?: google.cloud.securitycenter.v1.IListSourcesRequest): google.cloud.securitycenter.v1.ListSourcesRequest; + public static create(properties?: google.cloud.securitycenter.v1.ICreateFindingRequest): google.cloud.securitycenter.v1.CreateFindingRequest; /** - * Encodes the specified ListSourcesRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.ListSourcesRequest.verify|verify} messages. - * @param message ListSourcesRequest message or plain object to encode + * Encodes the specified CreateFindingRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.CreateFindingRequest.verify|verify} messages. + * @param message CreateFindingRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.securitycenter.v1.IListSourcesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.securitycenter.v1.ICreateFindingRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ListSourcesRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListSourcesRequest.verify|verify} messages. - * @param message ListSourcesRequest message or plain object to encode + * Encodes the specified CreateFindingRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.CreateFindingRequest.verify|verify} messages. + * @param message CreateFindingRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.securitycenter.v1.IListSourcesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.securitycenter.v1.ICreateFindingRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ListSourcesRequest message from the specified reader or buffer. + * Decodes a CreateFindingRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ListSourcesRequest + * @returns CreateFindingRequest * @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.cloud.securitycenter.v1.ListSourcesRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1.CreateFindingRequest; /** - * Decodes a ListSourcesRequest message from the specified reader or buffer, length delimited. + * Decodes a CreateFindingRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ListSourcesRequest + * @returns CreateFindingRequest * @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.cloud.securitycenter.v1.ListSourcesRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1.CreateFindingRequest; /** - * Verifies a ListSourcesRequest message. + * Verifies a CreateFindingRequest 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 ListSourcesRequest message from a plain object. Also converts values to their respective internal types. + * Creates a CreateFindingRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ListSourcesRequest + * @returns CreateFindingRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.ListSourcesRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.CreateFindingRequest; /** - * Creates a plain object from a ListSourcesRequest message. Also converts values to other types if specified. - * @param message ListSourcesRequest + * Creates a plain object from a CreateFindingRequest message. Also converts values to other types if specified. + * @param message CreateFindingRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.securitycenter.v1.ListSourcesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.securitycenter.v1.CreateFindingRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ListSourcesRequest to JSON. + * Converts this CreateFindingRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a ListSourcesResponse. */ - interface IListSourcesResponse { + /** Properties of a CreateSourceRequest. */ + interface ICreateSourceRequest { - /** ListSourcesResponse sources */ - sources?: (google.cloud.securitycenter.v1.ISource[]|null); + /** CreateSourceRequest parent */ + parent?: (string|null); - /** ListSourcesResponse nextPageToken */ - nextPageToken?: (string|null); + /** CreateSourceRequest source */ + source?: (google.cloud.securitycenter.v1.ISource|null); } - /** Represents a ListSourcesResponse. */ - class ListSourcesResponse implements IListSourcesResponse { + /** Represents a CreateSourceRequest. */ + class CreateSourceRequest implements ICreateSourceRequest { /** - * Constructs a new ListSourcesResponse. + * Constructs a new CreateSourceRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.securitycenter.v1.IListSourcesResponse); + constructor(properties?: google.cloud.securitycenter.v1.ICreateSourceRequest); - /** ListSourcesResponse sources. */ - public sources: google.cloud.securitycenter.v1.ISource[]; + /** CreateSourceRequest parent. */ + public parent: string; - /** ListSourcesResponse nextPageToken. */ - public nextPageToken: string; + /** CreateSourceRequest source. */ + public source?: (google.cloud.securitycenter.v1.ISource|null); /** - * Creates a new ListSourcesResponse instance using the specified properties. + * Creates a new CreateSourceRequest instance using the specified properties. * @param [properties] Properties to set - * @returns ListSourcesResponse instance + * @returns CreateSourceRequest instance */ - public static create(properties?: google.cloud.securitycenter.v1.IListSourcesResponse): google.cloud.securitycenter.v1.ListSourcesResponse; + public static create(properties?: google.cloud.securitycenter.v1.ICreateSourceRequest): google.cloud.securitycenter.v1.CreateSourceRequest; /** - * Encodes the specified ListSourcesResponse message. Does not implicitly {@link google.cloud.securitycenter.v1.ListSourcesResponse.verify|verify} messages. - * @param message ListSourcesResponse message or plain object to encode + * Encodes the specified CreateSourceRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.CreateSourceRequest.verify|verify} messages. + * @param message CreateSourceRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.securitycenter.v1.IListSourcesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.securitycenter.v1.ICreateSourceRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ListSourcesResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListSourcesResponse.verify|verify} messages. - * @param message ListSourcesResponse message or plain object to encode + * Encodes the specified CreateSourceRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.CreateSourceRequest.verify|verify} messages. + * @param message CreateSourceRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.securitycenter.v1.IListSourcesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.securitycenter.v1.ICreateSourceRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ListSourcesResponse message from the specified reader or buffer. + * Decodes a CreateSourceRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ListSourcesResponse + * @returns CreateSourceRequest * @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.cloud.securitycenter.v1.ListSourcesResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1.CreateSourceRequest; /** - * Decodes a ListSourcesResponse message from the specified reader or buffer, length delimited. + * Decodes a CreateSourceRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ListSourcesResponse + * @returns CreateSourceRequest * @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.cloud.securitycenter.v1.ListSourcesResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1.CreateSourceRequest; /** - * Verifies a ListSourcesResponse message. + * Verifies a CreateSourceRequest 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 ListSourcesResponse message from a plain object. Also converts values to their respective internal types. + * Creates a CreateSourceRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ListSourcesResponse + * @returns CreateSourceRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.ListSourcesResponse; + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.CreateSourceRequest; /** - * Creates a plain object from a ListSourcesResponse message. Also converts values to other types if specified. - * @param message ListSourcesResponse + * Creates a plain object from a CreateSourceRequest message. Also converts values to other types if specified. + * @param message CreateSourceRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.securitycenter.v1.ListSourcesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.securitycenter.v1.CreateSourceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ListSourcesResponse to JSON. + * Converts this CreateSourceRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a ListAssetsRequest. */ - interface IListAssetsRequest { - - /** ListAssetsRequest parent */ - parent?: (string|null); - - /** ListAssetsRequest filter */ - filter?: (string|null); - - /** ListAssetsRequest orderBy */ - orderBy?: (string|null); - - /** ListAssetsRequest readTime */ - readTime?: (google.protobuf.ITimestamp|null); - - /** ListAssetsRequest compareDuration */ - compareDuration?: (google.protobuf.IDuration|null); - - /** ListAssetsRequest fieldMask */ - fieldMask?: (google.protobuf.IFieldMask|null); - - /** ListAssetsRequest pageToken */ - pageToken?: (string|null); + /** Properties of a GetOrganizationSettingsRequest. */ + interface IGetOrganizationSettingsRequest { - /** ListAssetsRequest pageSize */ - pageSize?: (number|null); + /** GetOrganizationSettingsRequest name */ + name?: (string|null); } - /** Represents a ListAssetsRequest. */ - class ListAssetsRequest implements IListAssetsRequest { + /** Represents a GetOrganizationSettingsRequest. */ + class GetOrganizationSettingsRequest implements IGetOrganizationSettingsRequest { /** - * Constructs a new ListAssetsRequest. + * Constructs a new GetOrganizationSettingsRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.securitycenter.v1.IListAssetsRequest); - - /** ListAssetsRequest parent. */ - public parent: string; - - /** ListAssetsRequest filter. */ - public filter: string; - - /** ListAssetsRequest orderBy. */ - public orderBy: string; - - /** ListAssetsRequest readTime. */ - public readTime?: (google.protobuf.ITimestamp|null); - - /** ListAssetsRequest compareDuration. */ - public compareDuration?: (google.protobuf.IDuration|null); - - /** ListAssetsRequest fieldMask. */ - public fieldMask?: (google.protobuf.IFieldMask|null); - - /** ListAssetsRequest pageToken. */ - public pageToken: string; + constructor(properties?: google.cloud.securitycenter.v1.IGetOrganizationSettingsRequest); - /** ListAssetsRequest pageSize. */ - public pageSize: number; + /** GetOrganizationSettingsRequest name. */ + public name: string; /** - * Creates a new ListAssetsRequest instance using the specified properties. + * Creates a new GetOrganizationSettingsRequest instance using the specified properties. * @param [properties] Properties to set - * @returns ListAssetsRequest instance + * @returns GetOrganizationSettingsRequest instance */ - public static create(properties?: google.cloud.securitycenter.v1.IListAssetsRequest): google.cloud.securitycenter.v1.ListAssetsRequest; + public static create(properties?: google.cloud.securitycenter.v1.IGetOrganizationSettingsRequest): google.cloud.securitycenter.v1.GetOrganizationSettingsRequest; /** - * Encodes the specified ListAssetsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.ListAssetsRequest.verify|verify} messages. - * @param message ListAssetsRequest message or plain object to encode + * Encodes the specified GetOrganizationSettingsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.GetOrganizationSettingsRequest.verify|verify} messages. + * @param message GetOrganizationSettingsRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.securitycenter.v1.IListAssetsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.securitycenter.v1.IGetOrganizationSettingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ListAssetsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListAssetsRequest.verify|verify} messages. - * @param message ListAssetsRequest message or plain object to encode + * Encodes the specified GetOrganizationSettingsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.GetOrganizationSettingsRequest.verify|verify} messages. + * @param message GetOrganizationSettingsRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.securitycenter.v1.IListAssetsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.securitycenter.v1.IGetOrganizationSettingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ListAssetsRequest message from the specified reader or buffer. + * Decodes a GetOrganizationSettingsRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ListAssetsRequest + * @returns GetOrganizationSettingsRequest * @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.cloud.securitycenter.v1.ListAssetsRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1.GetOrganizationSettingsRequest; /** - * Decodes a ListAssetsRequest message from the specified reader or buffer, length delimited. + * Decodes a GetOrganizationSettingsRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ListAssetsRequest + * @returns GetOrganizationSettingsRequest * @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.cloud.securitycenter.v1.ListAssetsRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1.GetOrganizationSettingsRequest; /** - * Verifies a ListAssetsRequest message. + * Verifies a GetOrganizationSettingsRequest 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 ListAssetsRequest message from a plain object. Also converts values to their respective internal types. + * Creates a GetOrganizationSettingsRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ListAssetsRequest + * @returns GetOrganizationSettingsRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.ListAssetsRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.GetOrganizationSettingsRequest; /** - * Creates a plain object from a ListAssetsRequest message. Also converts values to other types if specified. - * @param message ListAssetsRequest + * Creates a plain object from a GetOrganizationSettingsRequest message. Also converts values to other types if specified. + * @param message GetOrganizationSettingsRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.securitycenter.v1.ListAssetsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.securitycenter.v1.GetOrganizationSettingsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ListAssetsRequest to JSON. + * Converts this GetOrganizationSettingsRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a ListAssetsResponse. */ - interface IListAssetsResponse { - - /** ListAssetsResponse listAssetsResults */ - listAssetsResults?: (google.cloud.securitycenter.v1.ListAssetsResponse.IListAssetsResult[]|null); - - /** ListAssetsResponse readTime */ - readTime?: (google.protobuf.ITimestamp|null); - - /** ListAssetsResponse nextPageToken */ - nextPageToken?: (string|null); + /** Properties of a GetSourceRequest. */ + interface IGetSourceRequest { - /** ListAssetsResponse totalSize */ - totalSize?: (number|null); + /** GetSourceRequest name */ + name?: (string|null); } - /** Represents a ListAssetsResponse. */ - class ListAssetsResponse implements IListAssetsResponse { + /** Represents a GetSourceRequest. */ + class GetSourceRequest implements IGetSourceRequest { /** - * Constructs a new ListAssetsResponse. + * Constructs a new GetSourceRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.securitycenter.v1.IListAssetsResponse); - - /** ListAssetsResponse listAssetsResults. */ - public listAssetsResults: google.cloud.securitycenter.v1.ListAssetsResponse.IListAssetsResult[]; - - /** ListAssetsResponse readTime. */ - public readTime?: (google.protobuf.ITimestamp|null); - - /** ListAssetsResponse nextPageToken. */ - public nextPageToken: string; + constructor(properties?: google.cloud.securitycenter.v1.IGetSourceRequest); - /** ListAssetsResponse totalSize. */ - public totalSize: number; + /** GetSourceRequest name. */ + public name: string; /** - * Creates a new ListAssetsResponse instance using the specified properties. + * Creates a new GetSourceRequest instance using the specified properties. * @param [properties] Properties to set - * @returns ListAssetsResponse instance + * @returns GetSourceRequest instance */ - public static create(properties?: google.cloud.securitycenter.v1.IListAssetsResponse): google.cloud.securitycenter.v1.ListAssetsResponse; + public static create(properties?: google.cloud.securitycenter.v1.IGetSourceRequest): google.cloud.securitycenter.v1.GetSourceRequest; /** - * Encodes the specified ListAssetsResponse message. Does not implicitly {@link google.cloud.securitycenter.v1.ListAssetsResponse.verify|verify} messages. - * @param message ListAssetsResponse message or plain object to encode + * Encodes the specified GetSourceRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.GetSourceRequest.verify|verify} messages. + * @param message GetSourceRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.securitycenter.v1.IListAssetsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.securitycenter.v1.IGetSourceRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ListAssetsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListAssetsResponse.verify|verify} messages. - * @param message ListAssetsResponse message or plain object to encode + * Encodes the specified GetSourceRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.GetSourceRequest.verify|verify} messages. + * @param message GetSourceRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.securitycenter.v1.IListAssetsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.securitycenter.v1.IGetSourceRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ListAssetsResponse message from the specified reader or buffer. + * Decodes a GetSourceRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ListAssetsResponse + * @returns GetSourceRequest * @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.cloud.securitycenter.v1.ListAssetsResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1.GetSourceRequest; /** - * Decodes a ListAssetsResponse message from the specified reader or buffer, length delimited. + * Decodes a GetSourceRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ListAssetsResponse + * @returns GetSourceRequest * @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.cloud.securitycenter.v1.ListAssetsResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1.GetSourceRequest; /** - * Verifies a ListAssetsResponse message. + * Verifies a GetSourceRequest 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 ListAssetsResponse message from a plain object. Also converts values to their respective internal types. + * Creates a GetSourceRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ListAssetsResponse + * @returns GetSourceRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.ListAssetsResponse; + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.GetSourceRequest; /** - * Creates a plain object from a ListAssetsResponse message. Also converts values to other types if specified. - * @param message ListAssetsResponse + * Creates a plain object from a GetSourceRequest message. Also converts values to other types if specified. + * @param message GetSourceRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.securitycenter.v1.ListAssetsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.securitycenter.v1.GetSourceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ListAssetsResponse to JSON. + * Converts this GetSourceRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - namespace ListAssetsResponse { + /** Properties of a GroupAssetsRequest. */ + interface IGroupAssetsRequest { - /** Properties of a ListAssetsResult. */ - interface IListAssetsResult { + /** GroupAssetsRequest parent */ + parent?: (string|null); - /** ListAssetsResult asset */ - asset?: (google.cloud.securitycenter.v1.IAsset|null); + /** GroupAssetsRequest filter */ + filter?: (string|null); - /** ListAssetsResult stateChange */ - stateChange?: (google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult.StateChange|null); - } + /** GroupAssetsRequest groupBy */ + groupBy?: (string|null); - /** Represents a ListAssetsResult. */ - class ListAssetsResult implements IListAssetsResult { + /** GroupAssetsRequest compareDuration */ + compareDuration?: (google.protobuf.IDuration|null); - /** - * Constructs a new ListAssetsResult. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v1.ListAssetsResponse.IListAssetsResult); + /** GroupAssetsRequest readTime */ + readTime?: (google.protobuf.ITimestamp|null); - /** ListAssetsResult asset. */ - public asset?: (google.cloud.securitycenter.v1.IAsset|null); + /** GroupAssetsRequest pageToken */ + pageToken?: (string|null); - /** ListAssetsResult stateChange. */ - public stateChange: google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult.StateChange; + /** GroupAssetsRequest pageSize */ + pageSize?: (number|null); + } - /** - * Creates a new ListAssetsResult instance using the specified properties. - * @param [properties] Properties to set - * @returns ListAssetsResult instance - */ - public static create(properties?: google.cloud.securitycenter.v1.ListAssetsResponse.IListAssetsResult): google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult; + /** Represents a GroupAssetsRequest. */ + class GroupAssetsRequest implements IGroupAssetsRequest { - /** - * Encodes the specified ListAssetsResult message. Does not implicitly {@link google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult.verify|verify} messages. - * @param message ListAssetsResult message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v1.ListAssetsResponse.IListAssetsResult, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Constructs a new GroupAssetsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IGroupAssetsRequest); - /** - * Encodes the specified ListAssetsResult message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult.verify|verify} messages. - * @param message ListAssetsResult message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v1.ListAssetsResponse.IListAssetsResult, writer?: $protobuf.Writer): $protobuf.Writer; + /** GroupAssetsRequest parent. */ + public parent: string; - /** - * Decodes a ListAssetsResult message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListAssetsResult - * @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.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult; + /** GroupAssetsRequest filter. */ + public filter: string; - /** - * Decodes a ListAssetsResult message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListAssetsResult - * @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.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult; + /** GroupAssetsRequest groupBy. */ + public groupBy: string; - /** - * Verifies a ListAssetsResult 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); + /** GroupAssetsRequest compareDuration. */ + public compareDuration?: (google.protobuf.IDuration|null); - /** - * Creates a ListAssetsResult message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListAssetsResult - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult; + /** GroupAssetsRequest readTime. */ + public readTime?: (google.protobuf.ITimestamp|null); - /** - * Creates a plain object from a ListAssetsResult message. Also converts values to other types if specified. - * @param message ListAssetsResult - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** GroupAssetsRequest pageToken. */ + public pageToken: string; - /** - * Converts this ListAssetsResult to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** GroupAssetsRequest pageSize. */ + public pageSize: number; - namespace ListAssetsResult { - - /** StateChange enum. */ - enum StateChange { - UNUSED = 0, - ADDED = 1, - REMOVED = 2, - ACTIVE = 3 - } - } - } - - /** Properties of a ListFindingsRequest. */ - interface IListFindingsRequest { - - /** ListFindingsRequest parent */ - parent?: (string|null); - - /** ListFindingsRequest filter */ - filter?: (string|null); - - /** ListFindingsRequest orderBy */ - orderBy?: (string|null); - - /** ListFindingsRequest readTime */ - readTime?: (google.protobuf.ITimestamp|null); - - /** ListFindingsRequest compareDuration */ - compareDuration?: (google.protobuf.IDuration|null); - - /** ListFindingsRequest fieldMask */ - fieldMask?: (google.protobuf.IFieldMask|null); - - /** ListFindingsRequest pageToken */ - pageToken?: (string|null); - - /** ListFindingsRequest pageSize */ - pageSize?: (number|null); - } - - /** Represents a ListFindingsRequest. */ - class ListFindingsRequest implements IListFindingsRequest { - - /** - * Constructs a new ListFindingsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v1.IListFindingsRequest); - - /** ListFindingsRequest parent. */ - public parent: string; - - /** ListFindingsRequest filter. */ - public filter: string; - - /** ListFindingsRequest orderBy. */ - public orderBy: string; - - /** ListFindingsRequest readTime. */ - public readTime?: (google.protobuf.ITimestamp|null); - - /** ListFindingsRequest compareDuration. */ - public compareDuration?: (google.protobuf.IDuration|null); - - /** ListFindingsRequest fieldMask. */ - public fieldMask?: (google.protobuf.IFieldMask|null); - - /** ListFindingsRequest pageToken. */ - public pageToken: string; - - /** ListFindingsRequest pageSize. */ - public pageSize: number; + /** + * Creates a new GroupAssetsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GroupAssetsRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IGroupAssetsRequest): google.cloud.securitycenter.v1.GroupAssetsRequest; /** - * Creates a new ListFindingsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListFindingsRequest instance - */ - public static create(properties?: google.cloud.securitycenter.v1.IListFindingsRequest): google.cloud.securitycenter.v1.ListFindingsRequest; - - /** - * Encodes the specified ListFindingsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.ListFindingsRequest.verify|verify} messages. - * @param message ListFindingsRequest message or plain object to encode + * Encodes the specified GroupAssetsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.GroupAssetsRequest.verify|verify} messages. + * @param message GroupAssetsRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.securitycenter.v1.IListFindingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.securitycenter.v1.IGroupAssetsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ListFindingsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListFindingsRequest.verify|verify} messages. - * @param message ListFindingsRequest message or plain object to encode + * Encodes the specified GroupAssetsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.GroupAssetsRequest.verify|verify} messages. + * @param message GroupAssetsRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.securitycenter.v1.IListFindingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.securitycenter.v1.IGroupAssetsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ListFindingsRequest message from the specified reader or buffer. + * Decodes a GroupAssetsRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ListFindingsRequest + * @returns GroupAssetsRequest * @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.cloud.securitycenter.v1.ListFindingsRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1.GroupAssetsRequest; /** - * Decodes a ListFindingsRequest message from the specified reader or buffer, length delimited. + * Decodes a GroupAssetsRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ListFindingsRequest + * @returns GroupAssetsRequest * @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.cloud.securitycenter.v1.ListFindingsRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1.GroupAssetsRequest; /** - * Verifies a ListFindingsRequest message. + * Verifies a GroupAssetsRequest 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 ListFindingsRequest message from a plain object. Also converts values to their respective internal types. + * Creates a GroupAssetsRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ListFindingsRequest + * @returns GroupAssetsRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.ListFindingsRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.GroupAssetsRequest; /** - * Creates a plain object from a ListFindingsRequest message. Also converts values to other types if specified. - * @param message ListFindingsRequest + * Creates a plain object from a GroupAssetsRequest message. Also converts values to other types if specified. + * @param message GroupAssetsRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.securitycenter.v1.ListFindingsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.securitycenter.v1.GroupAssetsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ListFindingsRequest to JSON. + * Converts this GroupAssetsRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a ListFindingsResponse. */ - interface IListFindingsResponse { + /** Properties of a GroupAssetsResponse. */ + interface IGroupAssetsResponse { - /** ListFindingsResponse listFindingsResults */ - listFindingsResults?: (google.cloud.securitycenter.v1.ListFindingsResponse.IListFindingsResult[]|null); + /** GroupAssetsResponse groupByResults */ + groupByResults?: (google.cloud.securitycenter.v1.IGroupResult[]|null); - /** ListFindingsResponse readTime */ + /** GroupAssetsResponse readTime */ readTime?: (google.protobuf.ITimestamp|null); - /** ListFindingsResponse nextPageToken */ + /** GroupAssetsResponse nextPageToken */ nextPageToken?: (string|null); - /** ListFindingsResponse totalSize */ + /** GroupAssetsResponse totalSize */ totalSize?: (number|null); } - /** Represents a ListFindingsResponse. */ - class ListFindingsResponse implements IListFindingsResponse { + /** Represents a GroupAssetsResponse. */ + class GroupAssetsResponse implements IGroupAssetsResponse { /** - * Constructs a new ListFindingsResponse. + * Constructs a new GroupAssetsResponse. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.securitycenter.v1.IListFindingsResponse); + constructor(properties?: google.cloud.securitycenter.v1.IGroupAssetsResponse); - /** ListFindingsResponse listFindingsResults. */ - public listFindingsResults: google.cloud.securitycenter.v1.ListFindingsResponse.IListFindingsResult[]; + /** GroupAssetsResponse groupByResults. */ + public groupByResults: google.cloud.securitycenter.v1.IGroupResult[]; - /** ListFindingsResponse readTime. */ + /** GroupAssetsResponse readTime. */ public readTime?: (google.protobuf.ITimestamp|null); - /** ListFindingsResponse nextPageToken. */ + /** GroupAssetsResponse nextPageToken. */ public nextPageToken: string; - /** ListFindingsResponse totalSize. */ + /** GroupAssetsResponse totalSize. */ public totalSize: number; /** - * Creates a new ListFindingsResponse instance using the specified properties. + * Creates a new GroupAssetsResponse instance using the specified properties. * @param [properties] Properties to set - * @returns ListFindingsResponse instance + * @returns GroupAssetsResponse instance */ - public static create(properties?: google.cloud.securitycenter.v1.IListFindingsResponse): google.cloud.securitycenter.v1.ListFindingsResponse; + public static create(properties?: google.cloud.securitycenter.v1.IGroupAssetsResponse): google.cloud.securitycenter.v1.GroupAssetsResponse; /** - * Encodes the specified ListFindingsResponse message. Does not implicitly {@link google.cloud.securitycenter.v1.ListFindingsResponse.verify|verify} messages. - * @param message ListFindingsResponse message or plain object to encode + * Encodes the specified GroupAssetsResponse message. Does not implicitly {@link google.cloud.securitycenter.v1.GroupAssetsResponse.verify|verify} messages. + * @param message GroupAssetsResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.securitycenter.v1.IListFindingsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.securitycenter.v1.IGroupAssetsResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ListFindingsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListFindingsResponse.verify|verify} messages. - * @param message ListFindingsResponse message or plain object to encode + * Encodes the specified GroupAssetsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.GroupAssetsResponse.verify|verify} messages. + * @param message GroupAssetsResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.securitycenter.v1.IListFindingsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.securitycenter.v1.IGroupAssetsResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ListFindingsResponse message from the specified reader or buffer. + * Decodes a GroupAssetsResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ListFindingsResponse + * @returns GroupAssetsResponse * @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.cloud.securitycenter.v1.ListFindingsResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1.GroupAssetsResponse; /** - * Decodes a ListFindingsResponse message from the specified reader or buffer, length delimited. + * Decodes a GroupAssetsResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ListFindingsResponse + * @returns GroupAssetsResponse * @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.cloud.securitycenter.v1.ListFindingsResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1.GroupAssetsResponse; /** - * Verifies a ListFindingsResponse message. + * Verifies a GroupAssetsResponse 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 ListFindingsResponse message from a plain object. Also converts values to their respective internal types. + * Creates a GroupAssetsResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ListFindingsResponse + * @returns GroupAssetsResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.ListFindingsResponse; + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.GroupAssetsResponse; /** - * Creates a plain object from a ListFindingsResponse message. Also converts values to other types if specified. - * @param message ListFindingsResponse + * Creates a plain object from a GroupAssetsResponse message. Also converts values to other types if specified. + * @param message GroupAssetsResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.securitycenter.v1.ListFindingsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.securitycenter.v1.GroupAssetsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ListFindingsResponse to JSON. + * Converts this GroupAssetsResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - namespace ListFindingsResponse { + /** Properties of a GroupFindingsRequest. */ + interface IGroupFindingsRequest { - /** Properties of a ListFindingsResult. */ - interface IListFindingsResult { + /** GroupFindingsRequest parent */ + parent?: (string|null); - /** ListFindingsResult finding */ - finding?: (google.cloud.securitycenter.v1.IFinding|null); + /** GroupFindingsRequest filter */ + filter?: (string|null); - /** ListFindingsResult stateChange */ - stateChange?: (google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.StateChange|null); - } + /** GroupFindingsRequest groupBy */ + groupBy?: (string|null); - /** Represents a ListFindingsResult. */ - class ListFindingsResult implements IListFindingsResult { + /** GroupFindingsRequest readTime */ + readTime?: (google.protobuf.ITimestamp|null); - /** - * Constructs a new ListFindingsResult. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v1.ListFindingsResponse.IListFindingsResult); + /** GroupFindingsRequest compareDuration */ + compareDuration?: (google.protobuf.IDuration|null); - /** ListFindingsResult finding. */ - public finding?: (google.cloud.securitycenter.v1.IFinding|null); + /** GroupFindingsRequest pageToken */ + pageToken?: (string|null); - /** ListFindingsResult stateChange. */ - public stateChange: google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.StateChange; + /** GroupFindingsRequest pageSize */ + pageSize?: (number|null); + } - /** - * Creates a new ListFindingsResult instance using the specified properties. - * @param [properties] Properties to set - * @returns ListFindingsResult instance - */ - public static create(properties?: google.cloud.securitycenter.v1.ListFindingsResponse.IListFindingsResult): google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult; + /** Represents a GroupFindingsRequest. */ + class GroupFindingsRequest implements IGroupFindingsRequest { - /** - * Encodes the specified ListFindingsResult message. Does not implicitly {@link google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.verify|verify} messages. - * @param message ListFindingsResult message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v1.ListFindingsResponse.IListFindingsResult, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Constructs a new GroupFindingsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IGroupFindingsRequest); - /** - * Encodes the specified ListFindingsResult message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.verify|verify} messages. - * @param message ListFindingsResult message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v1.ListFindingsResponse.IListFindingsResult, writer?: $protobuf.Writer): $protobuf.Writer; + /** GroupFindingsRequest parent. */ + public parent: string; - /** - * Decodes a ListFindingsResult message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListFindingsResult - * @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.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult; - - /** - * Decodes a ListFindingsResult message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListFindingsResult - * @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.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult; - - /** - * Verifies a ListFindingsResult 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 ListFindingsResult message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListFindingsResult - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult; - - /** - * Creates a plain object from a ListFindingsResult message. Also converts values to other types if specified. - * @param message ListFindingsResult - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListFindingsResult to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - namespace ListFindingsResult { - - /** StateChange enum. */ - enum StateChange { - UNUSED = 0, - CHANGED = 1, - UNCHANGED = 2, - ADDED = 3, - REMOVED = 4 - } - } - } - - /** Properties of a SetFindingStateRequest. */ - interface ISetFindingStateRequest { - - /** SetFindingStateRequest name */ - name?: (string|null); - - /** SetFindingStateRequest state */ - state?: (google.cloud.securitycenter.v1.Finding.State|null); - - /** SetFindingStateRequest startTime */ - startTime?: (google.protobuf.ITimestamp|null); - } + /** GroupFindingsRequest filter. */ + public filter: string; - /** Represents a SetFindingStateRequest. */ - class SetFindingStateRequest implements ISetFindingStateRequest { + /** GroupFindingsRequest groupBy. */ + public groupBy: string; - /** - * Constructs a new SetFindingStateRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v1.ISetFindingStateRequest); + /** GroupFindingsRequest readTime. */ + public readTime?: (google.protobuf.ITimestamp|null); - /** SetFindingStateRequest name. */ - public name: string; + /** GroupFindingsRequest compareDuration. */ + public compareDuration?: (google.protobuf.IDuration|null); - /** SetFindingStateRequest state. */ - public state: google.cloud.securitycenter.v1.Finding.State; + /** GroupFindingsRequest pageToken. */ + public pageToken: string; - /** SetFindingStateRequest startTime. */ - public startTime?: (google.protobuf.ITimestamp|null); + /** GroupFindingsRequest pageSize. */ + public pageSize: number; /** - * Creates a new SetFindingStateRequest instance using the specified properties. + * Creates a new GroupFindingsRequest instance using the specified properties. * @param [properties] Properties to set - * @returns SetFindingStateRequest instance + * @returns GroupFindingsRequest instance */ - public static create(properties?: google.cloud.securitycenter.v1.ISetFindingStateRequest): google.cloud.securitycenter.v1.SetFindingStateRequest; + public static create(properties?: google.cloud.securitycenter.v1.IGroupFindingsRequest): google.cloud.securitycenter.v1.GroupFindingsRequest; /** - * Encodes the specified SetFindingStateRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.SetFindingStateRequest.verify|verify} messages. - * @param message SetFindingStateRequest message or plain object to encode + * Encodes the specified GroupFindingsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.GroupFindingsRequest.verify|verify} messages. + * @param message GroupFindingsRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.securitycenter.v1.ISetFindingStateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.securitycenter.v1.IGroupFindingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified SetFindingStateRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.SetFindingStateRequest.verify|verify} messages. - * @param message SetFindingStateRequest message or plain object to encode + * Encodes the specified GroupFindingsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.GroupFindingsRequest.verify|verify} messages. + * @param message GroupFindingsRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.securitycenter.v1.ISetFindingStateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.securitycenter.v1.IGroupFindingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a SetFindingStateRequest message from the specified reader or buffer. + * Decodes a GroupFindingsRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns SetFindingStateRequest + * @returns GroupFindingsRequest * @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.cloud.securitycenter.v1.SetFindingStateRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1.GroupFindingsRequest; /** - * Decodes a SetFindingStateRequest message from the specified reader or buffer, length delimited. + * Decodes a GroupFindingsRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns SetFindingStateRequest + * @returns GroupFindingsRequest * @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.cloud.securitycenter.v1.SetFindingStateRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1.GroupFindingsRequest; /** - * Verifies a SetFindingStateRequest message. + * Verifies a GroupFindingsRequest 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 SetFindingStateRequest message from a plain object. Also converts values to their respective internal types. + * Creates a GroupFindingsRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns SetFindingStateRequest + * @returns GroupFindingsRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.SetFindingStateRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.GroupFindingsRequest; /** - * Creates a plain object from a SetFindingStateRequest message. Also converts values to other types if specified. - * @param message SetFindingStateRequest + * Creates a plain object from a GroupFindingsRequest message. Also converts values to other types if specified. + * @param message GroupFindingsRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.securitycenter.v1.SetFindingStateRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.securitycenter.v1.GroupFindingsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this SetFindingStateRequest to JSON. + * Converts this GroupFindingsRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a RunAssetDiscoveryRequest. */ - interface IRunAssetDiscoveryRequest { + /** Properties of a GroupFindingsResponse. */ + interface IGroupFindingsResponse { - /** RunAssetDiscoveryRequest parent */ - parent?: (string|null); + /** GroupFindingsResponse groupByResults */ + groupByResults?: (google.cloud.securitycenter.v1.IGroupResult[]|null); + + /** GroupFindingsResponse readTime */ + readTime?: (google.protobuf.ITimestamp|null); + + /** GroupFindingsResponse nextPageToken */ + nextPageToken?: (string|null); + + /** GroupFindingsResponse totalSize */ + totalSize?: (number|null); } - /** Represents a RunAssetDiscoveryRequest. */ - class RunAssetDiscoveryRequest implements IRunAssetDiscoveryRequest { + /** Represents a GroupFindingsResponse. */ + class GroupFindingsResponse implements IGroupFindingsResponse { /** - * Constructs a new RunAssetDiscoveryRequest. + * Constructs a new GroupFindingsResponse. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.securitycenter.v1.IRunAssetDiscoveryRequest); + constructor(properties?: google.cloud.securitycenter.v1.IGroupFindingsResponse); - /** RunAssetDiscoveryRequest parent. */ - public parent: string; + /** GroupFindingsResponse groupByResults. */ + public groupByResults: google.cloud.securitycenter.v1.IGroupResult[]; + + /** GroupFindingsResponse readTime. */ + public readTime?: (google.protobuf.ITimestamp|null); + + /** GroupFindingsResponse nextPageToken. */ + public nextPageToken: string; + + /** GroupFindingsResponse totalSize. */ + public totalSize: number; /** - * Creates a new RunAssetDiscoveryRequest instance using the specified properties. + * Creates a new GroupFindingsResponse instance using the specified properties. * @param [properties] Properties to set - * @returns RunAssetDiscoveryRequest instance + * @returns GroupFindingsResponse instance */ - public static create(properties?: google.cloud.securitycenter.v1.IRunAssetDiscoveryRequest): google.cloud.securitycenter.v1.RunAssetDiscoveryRequest; + public static create(properties?: google.cloud.securitycenter.v1.IGroupFindingsResponse): google.cloud.securitycenter.v1.GroupFindingsResponse; /** - * Encodes the specified RunAssetDiscoveryRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.RunAssetDiscoveryRequest.verify|verify} messages. - * @param message RunAssetDiscoveryRequest message or plain object to encode + * Encodes the specified GroupFindingsResponse message. Does not implicitly {@link google.cloud.securitycenter.v1.GroupFindingsResponse.verify|verify} messages. + * @param message GroupFindingsResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.securitycenter.v1.IRunAssetDiscoveryRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.securitycenter.v1.IGroupFindingsResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified RunAssetDiscoveryRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.RunAssetDiscoveryRequest.verify|verify} messages. - * @param message RunAssetDiscoveryRequest message or plain object to encode + * Encodes the specified GroupFindingsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.GroupFindingsResponse.verify|verify} messages. + * @param message GroupFindingsResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.securitycenter.v1.IRunAssetDiscoveryRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.securitycenter.v1.IGroupFindingsResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a RunAssetDiscoveryRequest message from the specified reader or buffer. + * Decodes a GroupFindingsResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns RunAssetDiscoveryRequest + * @returns GroupFindingsResponse * @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.cloud.securitycenter.v1.RunAssetDiscoveryRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1.GroupFindingsResponse; /** - * Decodes a RunAssetDiscoveryRequest message from the specified reader or buffer, length delimited. + * Decodes a GroupFindingsResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns RunAssetDiscoveryRequest + * @returns GroupFindingsResponse * @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.cloud.securitycenter.v1.RunAssetDiscoveryRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1.GroupFindingsResponse; /** - * Verifies a RunAssetDiscoveryRequest message. + * Verifies a GroupFindingsResponse 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 RunAssetDiscoveryRequest message from a plain object. Also converts values to their respective internal types. + * Creates a GroupFindingsResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns RunAssetDiscoveryRequest + * @returns GroupFindingsResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.RunAssetDiscoveryRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.GroupFindingsResponse; /** - * Creates a plain object from a RunAssetDiscoveryRequest message. Also converts values to other types if specified. - * @param message RunAssetDiscoveryRequest + * Creates a plain object from a GroupFindingsResponse message. Also converts values to other types if specified. + * @param message GroupFindingsResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.securitycenter.v1.RunAssetDiscoveryRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.securitycenter.v1.GroupFindingsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this RunAssetDiscoveryRequest to JSON. + * Converts this GroupFindingsResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of an UpdateFindingRequest. */ - interface IUpdateFindingRequest { + /** Properties of a GroupResult. */ + interface IGroupResult { - /** UpdateFindingRequest finding */ - finding?: (google.cloud.securitycenter.v1.IFinding|null); + /** GroupResult properties */ + properties?: ({ [k: string]: google.protobuf.IValue }|null); - /** UpdateFindingRequest updateMask */ - updateMask?: (google.protobuf.IFieldMask|null); + /** GroupResult count */ + count?: (number|Long|null); } - /** Represents an UpdateFindingRequest. */ - class UpdateFindingRequest implements IUpdateFindingRequest { + /** Represents a GroupResult. */ + class GroupResult implements IGroupResult { /** - * Constructs a new UpdateFindingRequest. + * Constructs a new GroupResult. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.securitycenter.v1.IUpdateFindingRequest); + constructor(properties?: google.cloud.securitycenter.v1.IGroupResult); - /** UpdateFindingRequest finding. */ - public finding?: (google.cloud.securitycenter.v1.IFinding|null); + /** GroupResult properties. */ + public properties: { [k: string]: google.protobuf.IValue }; - /** UpdateFindingRequest updateMask. */ - public updateMask?: (google.protobuf.IFieldMask|null); + /** GroupResult count. */ + public count: (number|Long); /** - * Creates a new UpdateFindingRequest instance using the specified properties. + * Creates a new GroupResult instance using the specified properties. * @param [properties] Properties to set - * @returns UpdateFindingRequest instance + * @returns GroupResult instance */ - public static create(properties?: google.cloud.securitycenter.v1.IUpdateFindingRequest): google.cloud.securitycenter.v1.UpdateFindingRequest; + public static create(properties?: google.cloud.securitycenter.v1.IGroupResult): google.cloud.securitycenter.v1.GroupResult; /** - * Encodes the specified UpdateFindingRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.UpdateFindingRequest.verify|verify} messages. - * @param message UpdateFindingRequest message or plain object to encode + * Encodes the specified GroupResult message. Does not implicitly {@link google.cloud.securitycenter.v1.GroupResult.verify|verify} messages. + * @param message GroupResult message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.securitycenter.v1.IUpdateFindingRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.securitycenter.v1.IGroupResult, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified UpdateFindingRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.UpdateFindingRequest.verify|verify} messages. - * @param message UpdateFindingRequest message or plain object to encode + * Encodes the specified GroupResult message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.GroupResult.verify|verify} messages. + * @param message GroupResult message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.securitycenter.v1.IUpdateFindingRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.securitycenter.v1.IGroupResult, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an UpdateFindingRequest message from the specified reader or buffer. + * Decodes a GroupResult message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns UpdateFindingRequest + * @returns GroupResult * @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.cloud.securitycenter.v1.UpdateFindingRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1.GroupResult; /** - * Decodes an UpdateFindingRequest message from the specified reader or buffer, length delimited. + * Decodes a GroupResult message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns UpdateFindingRequest + * @returns GroupResult * @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.cloud.securitycenter.v1.UpdateFindingRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1.GroupResult; /** - * Verifies an UpdateFindingRequest message. + * Verifies a GroupResult 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 UpdateFindingRequest message from a plain object. Also converts values to their respective internal types. + * Creates a GroupResult message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns UpdateFindingRequest + * @returns GroupResult */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.UpdateFindingRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.GroupResult; /** - * Creates a plain object from an UpdateFindingRequest message. Also converts values to other types if specified. - * @param message UpdateFindingRequest + * Creates a plain object from a GroupResult message. Also converts values to other types if specified. + * @param message GroupResult * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.securitycenter.v1.UpdateFindingRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.securitycenter.v1.GroupResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this UpdateFindingRequest to JSON. + * Converts this GroupResult to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of an UpdateOrganizationSettingsRequest. */ - interface IUpdateOrganizationSettingsRequest { + /** Properties of a ListSourcesRequest. */ + interface IListSourcesRequest { - /** UpdateOrganizationSettingsRequest organizationSettings */ - organizationSettings?: (google.cloud.securitycenter.v1.IOrganizationSettings|null); + /** ListSourcesRequest parent */ + parent?: (string|null); - /** UpdateOrganizationSettingsRequest updateMask */ - updateMask?: (google.protobuf.IFieldMask|null); + /** ListSourcesRequest pageToken */ + pageToken?: (string|null); + + /** ListSourcesRequest pageSize */ + pageSize?: (number|null); } - /** Represents an UpdateOrganizationSettingsRequest. */ - class UpdateOrganizationSettingsRequest implements IUpdateOrganizationSettingsRequest { + /** Represents a ListSourcesRequest. */ + class ListSourcesRequest implements IListSourcesRequest { /** - * Constructs a new UpdateOrganizationSettingsRequest. + * Constructs a new ListSourcesRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.securitycenter.v1.IUpdateOrganizationSettingsRequest); + constructor(properties?: google.cloud.securitycenter.v1.IListSourcesRequest); - /** UpdateOrganizationSettingsRequest organizationSettings. */ - public organizationSettings?: (google.cloud.securitycenter.v1.IOrganizationSettings|null); + /** ListSourcesRequest parent. */ + public parent: string; - /** UpdateOrganizationSettingsRequest updateMask. */ - public updateMask?: (google.protobuf.IFieldMask|null); + /** ListSourcesRequest pageToken. */ + public pageToken: string; + + /** ListSourcesRequest pageSize. */ + public pageSize: number; /** - * Creates a new UpdateOrganizationSettingsRequest instance using the specified properties. + * Creates a new ListSourcesRequest instance using the specified properties. * @param [properties] Properties to set - * @returns UpdateOrganizationSettingsRequest instance + * @returns ListSourcesRequest instance */ - public static create(properties?: google.cloud.securitycenter.v1.IUpdateOrganizationSettingsRequest): google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest; + public static create(properties?: google.cloud.securitycenter.v1.IListSourcesRequest): google.cloud.securitycenter.v1.ListSourcesRequest; /** - * Encodes the specified UpdateOrganizationSettingsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest.verify|verify} messages. - * @param message UpdateOrganizationSettingsRequest message or plain object to encode + * Encodes the specified ListSourcesRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.ListSourcesRequest.verify|verify} messages. + * @param message ListSourcesRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.securitycenter.v1.IUpdateOrganizationSettingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.securitycenter.v1.IListSourcesRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified UpdateOrganizationSettingsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest.verify|verify} messages. - * @param message UpdateOrganizationSettingsRequest message or plain object to encode + * Encodes the specified ListSourcesRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListSourcesRequest.verify|verify} messages. + * @param message ListSourcesRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.securitycenter.v1.IUpdateOrganizationSettingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.securitycenter.v1.IListSourcesRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an UpdateOrganizationSettingsRequest message from the specified reader or buffer. + * Decodes a ListSourcesRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns UpdateOrganizationSettingsRequest + * @returns ListSourcesRequest * @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.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1.ListSourcesRequest; /** - * Decodes an UpdateOrganizationSettingsRequest message from the specified reader or buffer, length delimited. + * Decodes a ListSourcesRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns UpdateOrganizationSettingsRequest + * @returns ListSourcesRequest * @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.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1.ListSourcesRequest; /** - * Verifies an UpdateOrganizationSettingsRequest message. + * Verifies a ListSourcesRequest 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 UpdateOrganizationSettingsRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ListSourcesRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns UpdateOrganizationSettingsRequest + * @returns ListSourcesRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.ListSourcesRequest; /** - * Creates a plain object from an UpdateOrganizationSettingsRequest message. Also converts values to other types if specified. - * @param message UpdateOrganizationSettingsRequest + * Creates a plain object from a ListSourcesRequest message. Also converts values to other types if specified. + * @param message ListSourcesRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.securitycenter.v1.ListSourcesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this UpdateOrganizationSettingsRequest to JSON. + * Converts this ListSourcesRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of an UpdateSourceRequest. */ - interface IUpdateSourceRequest { + /** Properties of a ListSourcesResponse. */ + interface IListSourcesResponse { - /** UpdateSourceRequest source */ - source?: (google.cloud.securitycenter.v1.ISource|null); + /** ListSourcesResponse sources */ + sources?: (google.cloud.securitycenter.v1.ISource[]|null); - /** UpdateSourceRequest updateMask */ - updateMask?: (google.protobuf.IFieldMask|null); + /** ListSourcesResponse nextPageToken */ + nextPageToken?: (string|null); } - /** Represents an UpdateSourceRequest. */ - class UpdateSourceRequest implements IUpdateSourceRequest { + /** Represents a ListSourcesResponse. */ + class ListSourcesResponse implements IListSourcesResponse { /** - * Constructs a new UpdateSourceRequest. + * Constructs a new ListSourcesResponse. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.securitycenter.v1.IUpdateSourceRequest); + constructor(properties?: google.cloud.securitycenter.v1.IListSourcesResponse); - /** UpdateSourceRequest source. */ - public source?: (google.cloud.securitycenter.v1.ISource|null); + /** ListSourcesResponse sources. */ + public sources: google.cloud.securitycenter.v1.ISource[]; - /** UpdateSourceRequest updateMask. */ - public updateMask?: (google.protobuf.IFieldMask|null); + /** ListSourcesResponse nextPageToken. */ + public nextPageToken: string; /** - * Creates a new UpdateSourceRequest instance using the specified properties. + * Creates a new ListSourcesResponse instance using the specified properties. * @param [properties] Properties to set - * @returns UpdateSourceRequest instance + * @returns ListSourcesResponse instance */ - public static create(properties?: google.cloud.securitycenter.v1.IUpdateSourceRequest): google.cloud.securitycenter.v1.UpdateSourceRequest; + public static create(properties?: google.cloud.securitycenter.v1.IListSourcesResponse): google.cloud.securitycenter.v1.ListSourcesResponse; /** - * Encodes the specified UpdateSourceRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.UpdateSourceRequest.verify|verify} messages. - * @param message UpdateSourceRequest message or plain object to encode + * Encodes the specified ListSourcesResponse message. Does not implicitly {@link google.cloud.securitycenter.v1.ListSourcesResponse.verify|verify} messages. + * @param message ListSourcesResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.securitycenter.v1.IUpdateSourceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.securitycenter.v1.IListSourcesResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified UpdateSourceRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.UpdateSourceRequest.verify|verify} messages. - * @param message UpdateSourceRequest message or plain object to encode + * Encodes the specified ListSourcesResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListSourcesResponse.verify|verify} messages. + * @param message ListSourcesResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.securitycenter.v1.IUpdateSourceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.securitycenter.v1.IListSourcesResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an UpdateSourceRequest message from the specified reader or buffer. + * Decodes a ListSourcesResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns UpdateSourceRequest + * @returns ListSourcesResponse * @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.cloud.securitycenter.v1.UpdateSourceRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1.ListSourcesResponse; /** - * Decodes an UpdateSourceRequest message from the specified reader or buffer, length delimited. + * Decodes a ListSourcesResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns UpdateSourceRequest + * @returns ListSourcesResponse * @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.cloud.securitycenter.v1.UpdateSourceRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1.ListSourcesResponse; /** - * Verifies an UpdateSourceRequest message. + * Verifies a ListSourcesResponse 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 UpdateSourceRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ListSourcesResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns UpdateSourceRequest + * @returns ListSourcesResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.UpdateSourceRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.ListSourcesResponse; /** - * Creates a plain object from an UpdateSourceRequest message. Also converts values to other types if specified. - * @param message UpdateSourceRequest + * Creates a plain object from a ListSourcesResponse message. Also converts values to other types if specified. + * @param message ListSourcesResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.securitycenter.v1.UpdateSourceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.securitycenter.v1.ListSourcesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this UpdateSourceRequest to JSON. + * Converts this ListSourcesResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of an UpdateSecurityMarksRequest. */ - interface IUpdateSecurityMarksRequest { + /** Properties of a ListAssetsRequest. */ + interface IListAssetsRequest { - /** UpdateSecurityMarksRequest securityMarks */ - securityMarks?: (google.cloud.securitycenter.v1.ISecurityMarks|null); + /** ListAssetsRequest parent */ + parent?: (string|null); - /** UpdateSecurityMarksRequest updateMask */ - updateMask?: (google.protobuf.IFieldMask|null); + /** ListAssetsRequest filter */ + filter?: (string|null); - /** UpdateSecurityMarksRequest startTime */ - startTime?: (google.protobuf.ITimestamp|null); - } + /** ListAssetsRequest orderBy */ + orderBy?: (string|null); - /** Represents an UpdateSecurityMarksRequest. */ - class UpdateSecurityMarksRequest implements IUpdateSecurityMarksRequest { + /** ListAssetsRequest readTime */ + readTime?: (google.protobuf.ITimestamp|null); - /** - * Constructs a new UpdateSecurityMarksRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v1.IUpdateSecurityMarksRequest); + /** ListAssetsRequest compareDuration */ + compareDuration?: (google.protobuf.IDuration|null); - /** UpdateSecurityMarksRequest securityMarks. */ - public securityMarks?: (google.cloud.securitycenter.v1.ISecurityMarks|null); + /** ListAssetsRequest fieldMask */ + fieldMask?: (google.protobuf.IFieldMask|null); - /** UpdateSecurityMarksRequest updateMask. */ - public updateMask?: (google.protobuf.IFieldMask|null); + /** ListAssetsRequest pageToken */ + pageToken?: (string|null); - /** UpdateSecurityMarksRequest startTime. */ - public startTime?: (google.protobuf.ITimestamp|null); + /** ListAssetsRequest pageSize */ + pageSize?: (number|null); + } + + /** Represents a ListAssetsRequest. */ + class ListAssetsRequest implements IListAssetsRequest { /** - * Creates a new UpdateSecurityMarksRequest instance using the specified properties. + * Constructs a new ListAssetsRequest. * @param [properties] Properties to set - * @returns UpdateSecurityMarksRequest instance */ - public static create(properties?: google.cloud.securitycenter.v1.IUpdateSecurityMarksRequest): google.cloud.securitycenter.v1.UpdateSecurityMarksRequest; + constructor(properties?: google.cloud.securitycenter.v1.IListAssetsRequest); - /** - * Encodes the specified UpdateSecurityMarksRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.UpdateSecurityMarksRequest.verify|verify} messages. - * @param message UpdateSecurityMarksRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v1.IUpdateSecurityMarksRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** ListAssetsRequest parent. */ + public parent: string; + + /** ListAssetsRequest filter. */ + public filter: string; + + /** ListAssetsRequest orderBy. */ + public orderBy: string; + + /** ListAssetsRequest readTime. */ + public readTime?: (google.protobuf.ITimestamp|null); + + /** ListAssetsRequest compareDuration. */ + public compareDuration?: (google.protobuf.IDuration|null); + + /** ListAssetsRequest fieldMask. */ + public fieldMask?: (google.protobuf.IFieldMask|null); + + /** ListAssetsRequest pageToken. */ + public pageToken: string; + + /** ListAssetsRequest pageSize. */ + public pageSize: number; /** - * Encodes the specified UpdateSecurityMarksRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.UpdateSecurityMarksRequest.verify|verify} messages. - * @param message UpdateSecurityMarksRequest message or plain object to encode + * Creates a new ListAssetsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListAssetsRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IListAssetsRequest): google.cloud.securitycenter.v1.ListAssetsRequest; + + /** + * Encodes the specified ListAssetsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.ListAssetsRequest.verify|verify} messages. + * @param message ListAssetsRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.securitycenter.v1.IUpdateSecurityMarksRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.securitycenter.v1.IListAssetsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an UpdateSecurityMarksRequest message from the specified reader or buffer. + * Encodes the specified ListAssetsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListAssetsRequest.verify|verify} messages. + * @param message ListAssetsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IListAssetsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListAssetsRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns UpdateSecurityMarksRequest + * @returns ListAssetsRequest * @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.cloud.securitycenter.v1.UpdateSecurityMarksRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1.ListAssetsRequest; /** - * Decodes an UpdateSecurityMarksRequest message from the specified reader or buffer, length delimited. + * Decodes a ListAssetsRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns UpdateSecurityMarksRequest + * @returns ListAssetsRequest * @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.cloud.securitycenter.v1.UpdateSecurityMarksRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1.ListAssetsRequest; /** - * Verifies an UpdateSecurityMarksRequest message. + * Verifies a ListAssetsRequest 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 UpdateSecurityMarksRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ListAssetsRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns UpdateSecurityMarksRequest + * @returns ListAssetsRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.UpdateSecurityMarksRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.ListAssetsRequest; /** - * Creates a plain object from an UpdateSecurityMarksRequest message. Also converts values to other types if specified. - * @param message UpdateSecurityMarksRequest + * Creates a plain object from a ListAssetsRequest message. Also converts values to other types if specified. + * @param message ListAssetsRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.securitycenter.v1.UpdateSecurityMarksRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.securitycenter.v1.ListAssetsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this UpdateSecurityMarksRequest to JSON. + * Converts this ListAssetsRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of an Asset. */ - interface IAsset { - - /** Asset name */ - name?: (string|null); - - /** Asset securityCenterProperties */ - securityCenterProperties?: (google.cloud.securitycenter.v1.Asset.ISecurityCenterProperties|null); - - /** Asset resourceProperties */ - resourceProperties?: ({ [k: string]: google.protobuf.IValue }|null); + /** Properties of a ListAssetsResponse. */ + interface IListAssetsResponse { - /** Asset securityMarks */ - securityMarks?: (google.cloud.securitycenter.v1.ISecurityMarks|null); + /** ListAssetsResponse listAssetsResults */ + listAssetsResults?: (google.cloud.securitycenter.v1.ListAssetsResponse.IListAssetsResult[]|null); - /** Asset createTime */ - createTime?: (google.protobuf.ITimestamp|null); + /** ListAssetsResponse readTime */ + readTime?: (google.protobuf.ITimestamp|null); - /** Asset updateTime */ - updateTime?: (google.protobuf.ITimestamp|null); + /** ListAssetsResponse nextPageToken */ + nextPageToken?: (string|null); - /** Asset iamPolicy */ - iamPolicy?: (google.cloud.securitycenter.v1.Asset.IIamPolicy|null); + /** ListAssetsResponse totalSize */ + totalSize?: (number|null); } - /** Represents an Asset. */ - class Asset implements IAsset { + /** Represents a ListAssetsResponse. */ + class ListAssetsResponse implements IListAssetsResponse { /** - * Constructs a new Asset. + * Constructs a new ListAssetsResponse. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.securitycenter.v1.IAsset); - - /** Asset name. */ - public name: string; - - /** Asset securityCenterProperties. */ - public securityCenterProperties?: (google.cloud.securitycenter.v1.Asset.ISecurityCenterProperties|null); - - /** Asset resourceProperties. */ - public resourceProperties: { [k: string]: google.protobuf.IValue }; + constructor(properties?: google.cloud.securitycenter.v1.IListAssetsResponse); - /** Asset securityMarks. */ - public securityMarks?: (google.cloud.securitycenter.v1.ISecurityMarks|null); + /** ListAssetsResponse listAssetsResults. */ + public listAssetsResults: google.cloud.securitycenter.v1.ListAssetsResponse.IListAssetsResult[]; - /** Asset createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); + /** ListAssetsResponse readTime. */ + public readTime?: (google.protobuf.ITimestamp|null); - /** Asset updateTime. */ - public updateTime?: (google.protobuf.ITimestamp|null); + /** ListAssetsResponse nextPageToken. */ + public nextPageToken: string; - /** Asset iamPolicy. */ - public iamPolicy?: (google.cloud.securitycenter.v1.Asset.IIamPolicy|null); + /** ListAssetsResponse totalSize. */ + public totalSize: number; /** - * Creates a new Asset instance using the specified properties. + * Creates a new ListAssetsResponse instance using the specified properties. * @param [properties] Properties to set - * @returns Asset instance + * @returns ListAssetsResponse instance */ - public static create(properties?: google.cloud.securitycenter.v1.IAsset): google.cloud.securitycenter.v1.Asset; + public static create(properties?: google.cloud.securitycenter.v1.IListAssetsResponse): google.cloud.securitycenter.v1.ListAssetsResponse; /** - * Encodes the specified Asset message. Does not implicitly {@link google.cloud.securitycenter.v1.Asset.verify|verify} messages. - * @param message Asset message or plain object to encode + * Encodes the specified ListAssetsResponse message. Does not implicitly {@link google.cloud.securitycenter.v1.ListAssetsResponse.verify|verify} messages. + * @param message ListAssetsResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.securitycenter.v1.IAsset, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.securitycenter.v1.IListAssetsResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified Asset message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Asset.verify|verify} messages. - * @param message Asset message or plain object to encode + * Encodes the specified ListAssetsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListAssetsResponse.verify|verify} messages. + * @param message ListAssetsResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.securitycenter.v1.IAsset, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.securitycenter.v1.IListAssetsResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an Asset message from the specified reader or buffer. + * Decodes a ListAssetsResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns Asset + * @returns ListAssetsResponse * @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.cloud.securitycenter.v1.Asset; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1.ListAssetsResponse; /** - * Decodes an Asset message from the specified reader or buffer, length delimited. + * Decodes a ListAssetsResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Asset + * @returns ListAssetsResponse * @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.cloud.securitycenter.v1.Asset; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1.ListAssetsResponse; /** - * Verifies an Asset message. + * Verifies a ListAssetsResponse 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 Asset message from a plain object. Also converts values to their respective internal types. + * Creates a ListAssetsResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Asset + * @returns ListAssetsResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.Asset; + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.ListAssetsResponse; /** - * Creates a plain object from an Asset message. Also converts values to other types if specified. - * @param message Asset + * Creates a plain object from a ListAssetsResponse message. Also converts values to other types if specified. + * @param message ListAssetsResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.securitycenter.v1.Asset, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.securitycenter.v1.ListAssetsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Asset to JSON. + * Converts this ListAssetsResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - namespace Asset { - - /** Properties of a SecurityCenterProperties. */ - interface ISecurityCenterProperties { - - /** SecurityCenterProperties resourceName */ - resourceName?: (string|null); - - /** SecurityCenterProperties resourceType */ - resourceType?: (string|null); + namespace ListAssetsResponse { - /** SecurityCenterProperties resourceParent */ - resourceParent?: (string|null); + /** Properties of a ListAssetsResult. */ + interface IListAssetsResult { - /** SecurityCenterProperties resourceProject */ - resourceProject?: (string|null); + /** ListAssetsResult asset */ + asset?: (google.cloud.securitycenter.v1.IAsset|null); - /** SecurityCenterProperties resourceOwners */ - resourceOwners?: (string[]|null); + /** ListAssetsResult stateChange */ + stateChange?: (google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult.StateChange|null); } - /** Represents a SecurityCenterProperties. */ - class SecurityCenterProperties implements ISecurityCenterProperties { + /** Represents a ListAssetsResult. */ + class ListAssetsResult implements IListAssetsResult { /** - * Constructs a new SecurityCenterProperties. + * Constructs a new ListAssetsResult. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.securitycenter.v1.Asset.ISecurityCenterProperties); - - /** SecurityCenterProperties resourceName. */ - public resourceName: string; - - /** SecurityCenterProperties resourceType. */ - public resourceType: string; - - /** SecurityCenterProperties resourceParent. */ - public resourceParent: string; + constructor(properties?: google.cloud.securitycenter.v1.ListAssetsResponse.IListAssetsResult); - /** SecurityCenterProperties resourceProject. */ - public resourceProject: string; + /** ListAssetsResult asset. */ + public asset?: (google.cloud.securitycenter.v1.IAsset|null); - /** SecurityCenterProperties resourceOwners. */ - public resourceOwners: string[]; + /** ListAssetsResult stateChange. */ + public stateChange: google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult.StateChange; /** - * Creates a new SecurityCenterProperties instance using the specified properties. + * Creates a new ListAssetsResult instance using the specified properties. * @param [properties] Properties to set - * @returns SecurityCenterProperties instance + * @returns ListAssetsResult instance */ - public static create(properties?: google.cloud.securitycenter.v1.Asset.ISecurityCenterProperties): google.cloud.securitycenter.v1.Asset.SecurityCenterProperties; + public static create(properties?: google.cloud.securitycenter.v1.ListAssetsResponse.IListAssetsResult): google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult; /** - * Encodes the specified SecurityCenterProperties message. Does not implicitly {@link google.cloud.securitycenter.v1.Asset.SecurityCenterProperties.verify|verify} messages. - * @param message SecurityCenterProperties message or plain object to encode + * Encodes the specified ListAssetsResult message. Does not implicitly {@link google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult.verify|verify} messages. + * @param message ListAssetsResult message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.securitycenter.v1.Asset.ISecurityCenterProperties, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.securitycenter.v1.ListAssetsResponse.IListAssetsResult, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified SecurityCenterProperties message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Asset.SecurityCenterProperties.verify|verify} messages. - * @param message SecurityCenterProperties message or plain object to encode + * Encodes the specified ListAssetsResult message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult.verify|verify} messages. + * @param message ListAssetsResult message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.securitycenter.v1.Asset.ISecurityCenterProperties, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.securitycenter.v1.ListAssetsResponse.IListAssetsResult, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a SecurityCenterProperties message from the specified reader or buffer. + * Decodes a ListAssetsResult message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns SecurityCenterProperties + * @returns ListAssetsResult * @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.cloud.securitycenter.v1.Asset.SecurityCenterProperties; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult; /** - * Decodes a SecurityCenterProperties message from the specified reader or buffer, length delimited. + * Decodes a ListAssetsResult message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns SecurityCenterProperties + * @returns ListAssetsResult * @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.cloud.securitycenter.v1.Asset.SecurityCenterProperties; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult; /** - * Verifies a SecurityCenterProperties message. + * Verifies a ListAssetsResult 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 SecurityCenterProperties message from a plain object. Also converts values to their respective internal types. + * Creates a ListAssetsResult message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns SecurityCenterProperties + * @returns ListAssetsResult */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.Asset.SecurityCenterProperties; + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult; /** - * Creates a plain object from a SecurityCenterProperties message. Also converts values to other types if specified. - * @param message SecurityCenterProperties + * Creates a plain object from a ListAssetsResult message. Also converts values to other types if specified. + * @param message ListAssetsResult * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.securitycenter.v1.Asset.SecurityCenterProperties, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this SecurityCenterProperties to JSON. + * Converts this ListAssetsResult to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of an IamPolicy. */ - interface IIamPolicy { + namespace ListAssetsResult { - /** IamPolicy policyBlob */ - policyBlob?: (string|null); + /** StateChange enum. */ + enum StateChange { + UNUSED = 0, + ADDED = 1, + REMOVED = 2, + ACTIVE = 3 + } } + } - /** Represents an IamPolicy. */ - class IamPolicy implements IIamPolicy { + /** Properties of a ListFindingsRequest. */ + interface IListFindingsRequest { - /** - * Constructs a new IamPolicy. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v1.Asset.IIamPolicy); + /** ListFindingsRequest parent */ + parent?: (string|null); - /** IamPolicy policyBlob. */ - public policyBlob: string; + /** ListFindingsRequest filter */ + filter?: (string|null); - /** - * Creates a new IamPolicy instance using the specified properties. - * @param [properties] Properties to set - * @returns IamPolicy instance - */ - public static create(properties?: google.cloud.securitycenter.v1.Asset.IIamPolicy): google.cloud.securitycenter.v1.Asset.IamPolicy; + /** ListFindingsRequest orderBy */ + orderBy?: (string|null); - /** - * Encodes the specified IamPolicy message. Does not implicitly {@link google.cloud.securitycenter.v1.Asset.IamPolicy.verify|verify} messages. - * @param message IamPolicy message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v1.Asset.IIamPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + /** ListFindingsRequest readTime */ + readTime?: (google.protobuf.ITimestamp|null); - /** - * Encodes the specified IamPolicy message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Asset.IamPolicy.verify|verify} messages. - * @param message IamPolicy message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v1.Asset.IIamPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + /** ListFindingsRequest compareDuration */ + compareDuration?: (google.protobuf.IDuration|null); - /** - * Decodes an IamPolicy message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns IamPolicy - * @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.cloud.securitycenter.v1.Asset.IamPolicy; + /** ListFindingsRequest fieldMask */ + fieldMask?: (google.protobuf.IFieldMask|null); - /** - * Decodes an IamPolicy message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns IamPolicy - * @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.cloud.securitycenter.v1.Asset.IamPolicy; + /** ListFindingsRequest pageToken */ + pageToken?: (string|null); - /** - * Verifies an IamPolicy 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); + /** ListFindingsRequest pageSize */ + pageSize?: (number|null); + } - /** - * Creates an IamPolicy message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns IamPolicy - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.Asset.IamPolicy; + /** Represents a ListFindingsRequest. */ + class ListFindingsRequest implements IListFindingsRequest { - /** - * Creates a plain object from an IamPolicy message. Also converts values to other types if specified. - * @param message IamPolicy - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v1.Asset.IamPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Constructs a new ListFindingsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IListFindingsRequest); - /** - * Converts this IamPolicy to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - } + /** ListFindingsRequest parent. */ + public parent: string; - /** Properties of a SecurityMarks. */ - interface ISecurityMarks { + /** ListFindingsRequest filter. */ + public filter: string; - /** SecurityMarks name */ - name?: (string|null); + /** ListFindingsRequest orderBy. */ + public orderBy: string; - /** SecurityMarks marks */ - marks?: ({ [k: string]: string }|null); - } + /** ListFindingsRequest readTime. */ + public readTime?: (google.protobuf.ITimestamp|null); - /** Represents a SecurityMarks. */ - class SecurityMarks implements ISecurityMarks { + /** ListFindingsRequest compareDuration. */ + public compareDuration?: (google.protobuf.IDuration|null); - /** - * Constructs a new SecurityMarks. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v1.ISecurityMarks); + /** ListFindingsRequest fieldMask. */ + public fieldMask?: (google.protobuf.IFieldMask|null); - /** SecurityMarks name. */ - public name: string; + /** ListFindingsRequest pageToken. */ + public pageToken: string; - /** SecurityMarks marks. */ - public marks: { [k: string]: string }; + /** ListFindingsRequest pageSize. */ + public pageSize: number; /** - * Creates a new SecurityMarks instance using the specified properties. + * Creates a new ListFindingsRequest instance using the specified properties. * @param [properties] Properties to set - * @returns SecurityMarks instance + * @returns ListFindingsRequest instance */ - public static create(properties?: google.cloud.securitycenter.v1.ISecurityMarks): google.cloud.securitycenter.v1.SecurityMarks; + public static create(properties?: google.cloud.securitycenter.v1.IListFindingsRequest): google.cloud.securitycenter.v1.ListFindingsRequest; /** - * Encodes the specified SecurityMarks message. Does not implicitly {@link google.cloud.securitycenter.v1.SecurityMarks.verify|verify} messages. - * @param message SecurityMarks message or plain object to encode + * Encodes the specified ListFindingsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.ListFindingsRequest.verify|verify} messages. + * @param message ListFindingsRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.securitycenter.v1.ISecurityMarks, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.securitycenter.v1.IListFindingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified SecurityMarks message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.SecurityMarks.verify|verify} messages. - * @param message SecurityMarks message or plain object to encode + * Encodes the specified ListFindingsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListFindingsRequest.verify|verify} messages. + * @param message ListFindingsRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.securitycenter.v1.ISecurityMarks, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.securitycenter.v1.IListFindingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a SecurityMarks message from the specified reader or buffer. + * Decodes a ListFindingsRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns SecurityMarks + * @returns ListFindingsRequest * @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.cloud.securitycenter.v1.SecurityMarks; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1.ListFindingsRequest; /** - * Decodes a SecurityMarks message from the specified reader or buffer, length delimited. + * Decodes a ListFindingsRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns SecurityMarks + * @returns ListFindingsRequest * @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.cloud.securitycenter.v1.SecurityMarks; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1.ListFindingsRequest; /** - * Verifies a SecurityMarks message. + * Verifies a ListFindingsRequest 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 SecurityMarks message from a plain object. Also converts values to their respective internal types. + * Creates a ListFindingsRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns SecurityMarks + * @returns ListFindingsRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.SecurityMarks; + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.ListFindingsRequest; /** - * Creates a plain object from a SecurityMarks message. Also converts values to other types if specified. - * @param message SecurityMarks + * Creates a plain object from a ListFindingsRequest message. Also converts values to other types if specified. + * @param message ListFindingsRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.securitycenter.v1.SecurityMarks, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.securitycenter.v1.ListFindingsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this SecurityMarks to JSON. + * Converts this ListFindingsRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a Finding. */ - interface IFinding { - - /** Finding name */ - name?: (string|null); - - /** Finding parent */ - parent?: (string|null); - - /** Finding resourceName */ - resourceName?: (string|null); - - /** Finding state */ - state?: (google.cloud.securitycenter.v1.Finding.State|null); - - /** Finding category */ - category?: (string|null); - - /** Finding externalUri */ - externalUri?: (string|null); + /** Properties of a ListFindingsResponse. */ + interface IListFindingsResponse { - /** Finding sourceProperties */ - sourceProperties?: ({ [k: string]: google.protobuf.IValue }|null); + /** ListFindingsResponse listFindingsResults */ + listFindingsResults?: (google.cloud.securitycenter.v1.ListFindingsResponse.IListFindingsResult[]|null); - /** Finding securityMarks */ - securityMarks?: (google.cloud.securitycenter.v1.ISecurityMarks|null); + /** ListFindingsResponse readTime */ + readTime?: (google.protobuf.ITimestamp|null); - /** Finding eventTime */ - eventTime?: (google.protobuf.ITimestamp|null); + /** ListFindingsResponse nextPageToken */ + nextPageToken?: (string|null); - /** Finding createTime */ - createTime?: (google.protobuf.ITimestamp|null); + /** ListFindingsResponse totalSize */ + totalSize?: (number|null); } - /** Represents a Finding. */ - class Finding implements IFinding { + /** Represents a ListFindingsResponse. */ + class ListFindingsResponse implements IListFindingsResponse { /** - * Constructs a new Finding. + * Constructs a new ListFindingsResponse. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.securitycenter.v1.IFinding); - - /** Finding name. */ - public name: string; + constructor(properties?: google.cloud.securitycenter.v1.IListFindingsResponse); - /** Finding parent. */ - public parent: string; - - /** Finding resourceName. */ - public resourceName: string; - - /** Finding state. */ - public state: google.cloud.securitycenter.v1.Finding.State; - - /** Finding category. */ - public category: string; - - /** Finding externalUri. */ - public externalUri: string; - - /** Finding sourceProperties. */ - public sourceProperties: { [k: string]: google.protobuf.IValue }; + /** ListFindingsResponse listFindingsResults. */ + public listFindingsResults: google.cloud.securitycenter.v1.ListFindingsResponse.IListFindingsResult[]; - /** Finding securityMarks. */ - public securityMarks?: (google.cloud.securitycenter.v1.ISecurityMarks|null); + /** ListFindingsResponse readTime. */ + public readTime?: (google.protobuf.ITimestamp|null); - /** Finding eventTime. */ - public eventTime?: (google.protobuf.ITimestamp|null); + /** ListFindingsResponse nextPageToken. */ + public nextPageToken: string; - /** Finding createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); + /** ListFindingsResponse totalSize. */ + public totalSize: number; /** - * Creates a new Finding instance using the specified properties. + * Creates a new ListFindingsResponse instance using the specified properties. * @param [properties] Properties to set - * @returns Finding instance + * @returns ListFindingsResponse instance */ - public static create(properties?: google.cloud.securitycenter.v1.IFinding): google.cloud.securitycenter.v1.Finding; + public static create(properties?: google.cloud.securitycenter.v1.IListFindingsResponse): google.cloud.securitycenter.v1.ListFindingsResponse; /** - * Encodes the specified Finding message. Does not implicitly {@link google.cloud.securitycenter.v1.Finding.verify|verify} messages. - * @param message Finding message or plain object to encode + * Encodes the specified ListFindingsResponse message. Does not implicitly {@link google.cloud.securitycenter.v1.ListFindingsResponse.verify|verify} messages. + * @param message ListFindingsResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.securitycenter.v1.IFinding, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.securitycenter.v1.IListFindingsResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified Finding message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Finding.verify|verify} messages. - * @param message Finding message or plain object to encode + * Encodes the specified ListFindingsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListFindingsResponse.verify|verify} messages. + * @param message ListFindingsResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.securitycenter.v1.IFinding, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.securitycenter.v1.IListFindingsResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a Finding message from the specified reader or buffer. + * Decodes a ListFindingsResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns Finding + * @returns ListFindingsResponse * @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.cloud.securitycenter.v1.Finding; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1.ListFindingsResponse; /** - * Decodes a Finding message from the specified reader or buffer, length delimited. + * Decodes a ListFindingsResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Finding + * @returns ListFindingsResponse * @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.cloud.securitycenter.v1.Finding; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1.ListFindingsResponse; /** - * Verifies a Finding message. + * Verifies a ListFindingsResponse 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 Finding message from a plain object. Also converts values to their respective internal types. + * Creates a ListFindingsResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Finding + * @returns ListFindingsResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.Finding; + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.ListFindingsResponse; /** - * Creates a plain object from a Finding message. Also converts values to other types if specified. - * @param message Finding + * Creates a plain object from a ListFindingsResponse message. Also converts values to other types if specified. + * @param message ListFindingsResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.securitycenter.v1.Finding, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.securitycenter.v1.ListFindingsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Finding to JSON. + * Converts this ListFindingsResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - namespace Finding { - - /** State enum. */ - enum State { - STATE_UNSPECIFIED = 0, - ACTIVE = 1, - INACTIVE = 2 - } - } - - /** Properties of an OrganizationSettings. */ - interface IOrganizationSettings { - - /** OrganizationSettings name */ - name?: (string|null); - - /** OrganizationSettings enableAssetDiscovery */ - enableAssetDiscovery?: (boolean|null); - - /** OrganizationSettings assetDiscoveryConfig */ - assetDiscoveryConfig?: (google.cloud.securitycenter.v1.OrganizationSettings.IAssetDiscoveryConfig|null); - } - - /** Represents an OrganizationSettings. */ - class OrganizationSettings implements IOrganizationSettings { - - /** - * Constructs a new OrganizationSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v1.IOrganizationSettings); - - /** OrganizationSettings name. */ - public name: string; - - /** OrganizationSettings enableAssetDiscovery. */ - public enableAssetDiscovery: boolean; - - /** OrganizationSettings assetDiscoveryConfig. */ - public assetDiscoveryConfig?: (google.cloud.securitycenter.v1.OrganizationSettings.IAssetDiscoveryConfig|null); - - /** - * Creates a new OrganizationSettings instance using the specified properties. - * @param [properties] Properties to set - * @returns OrganizationSettings instance - */ - public static create(properties?: google.cloud.securitycenter.v1.IOrganizationSettings): google.cloud.securitycenter.v1.OrganizationSettings; - - /** - * Encodes the specified OrganizationSettings message. Does not implicitly {@link google.cloud.securitycenter.v1.OrganizationSettings.verify|verify} messages. - * @param message OrganizationSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v1.IOrganizationSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified OrganizationSettings message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.OrganizationSettings.verify|verify} messages. - * @param message OrganizationSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v1.IOrganizationSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an OrganizationSettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns OrganizationSettings - * @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.cloud.securitycenter.v1.OrganizationSettings; - - /** - * Decodes an OrganizationSettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns OrganizationSettings - * @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.cloud.securitycenter.v1.OrganizationSettings; - - /** - * Verifies an OrganizationSettings 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 OrganizationSettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns OrganizationSettings - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.OrganizationSettings; - - /** - * Creates a plain object from an OrganizationSettings message. Also converts values to other types if specified. - * @param message OrganizationSettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v1.OrganizationSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this OrganizationSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + namespace ListFindingsResponse { - namespace OrganizationSettings { + /** Properties of a ListFindingsResult. */ + interface IListFindingsResult { - /** Properties of an AssetDiscoveryConfig. */ - interface IAssetDiscoveryConfig { + /** ListFindingsResult finding */ + finding?: (google.cloud.securitycenter.v1.IFinding|null); - /** AssetDiscoveryConfig projectIds */ - projectIds?: (string[]|null); + /** ListFindingsResult stateChange */ + stateChange?: (google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.StateChange|null); - /** AssetDiscoveryConfig inclusionMode */ - inclusionMode?: (google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode|null); + /** ListFindingsResult resource */ + resource?: (google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.IResource|null); } - /** Represents an AssetDiscoveryConfig. */ - class AssetDiscoveryConfig implements IAssetDiscoveryConfig { + /** Represents a ListFindingsResult. */ + class ListFindingsResult implements IListFindingsResult { /** - * Constructs a new AssetDiscoveryConfig. + * Constructs a new ListFindingsResult. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.securitycenter.v1.OrganizationSettings.IAssetDiscoveryConfig); + constructor(properties?: google.cloud.securitycenter.v1.ListFindingsResponse.IListFindingsResult); - /** AssetDiscoveryConfig projectIds. */ - public projectIds: string[]; + /** ListFindingsResult finding. */ + public finding?: (google.cloud.securitycenter.v1.IFinding|null); - /** AssetDiscoveryConfig inclusionMode. */ - public inclusionMode: google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode; + /** ListFindingsResult stateChange. */ + public stateChange: google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.StateChange; + + /** ListFindingsResult resource. */ + public resource?: (google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.IResource|null); /** - * Creates a new AssetDiscoveryConfig instance using the specified properties. + * Creates a new ListFindingsResult instance using the specified properties. * @param [properties] Properties to set - * @returns AssetDiscoveryConfig instance + * @returns ListFindingsResult instance */ - public static create(properties?: google.cloud.securitycenter.v1.OrganizationSettings.IAssetDiscoveryConfig): google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig; + public static create(properties?: google.cloud.securitycenter.v1.ListFindingsResponse.IListFindingsResult): google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult; /** - * Encodes the specified AssetDiscoveryConfig message. Does not implicitly {@link google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.verify|verify} messages. - * @param message AssetDiscoveryConfig message or plain object to encode + * Encodes the specified ListFindingsResult message. Does not implicitly {@link google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.verify|verify} messages. + * @param message ListFindingsResult message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.securitycenter.v1.OrganizationSettings.IAssetDiscoveryConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.securitycenter.v1.ListFindingsResponse.IListFindingsResult, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified AssetDiscoveryConfig message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.verify|verify} messages. - * @param message AssetDiscoveryConfig message or plain object to encode + * Encodes the specified ListFindingsResult message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.verify|verify} messages. + * @param message ListFindingsResult message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.securitycenter.v1.OrganizationSettings.IAssetDiscoveryConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.securitycenter.v1.ListFindingsResponse.IListFindingsResult, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an AssetDiscoveryConfig message from the specified reader or buffer. + * Decodes a ListFindingsResult message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns AssetDiscoveryConfig + * @returns ListFindingsResult * @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.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult; /** - * Decodes an AssetDiscoveryConfig message from the specified reader or buffer, length delimited. + * Decodes a ListFindingsResult message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns AssetDiscoveryConfig + * @returns ListFindingsResult * @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.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult; /** - * Verifies an AssetDiscoveryConfig message. + * Verifies a ListFindingsResult 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 AssetDiscoveryConfig message from a plain object. Also converts values to their respective internal types. + * Creates a ListFindingsResult message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns AssetDiscoveryConfig + * @returns ListFindingsResult */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig; + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult; /** - * Creates a plain object from an AssetDiscoveryConfig message. Also converts values to other types if specified. - * @param message AssetDiscoveryConfig + * Creates a plain object from a ListFindingsResult message. Also converts values to other types if specified. + * @param message ListFindingsResult * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this AssetDiscoveryConfig to JSON. + * Converts this ListFindingsResult to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - namespace AssetDiscoveryConfig { + namespace ListFindingsResult { - /** InclusionMode enum. */ - enum InclusionMode { - INCLUSION_MODE_UNSPECIFIED = 0, - INCLUDE_ONLY = 1, - EXCLUDE = 2 + /** Properties of a Resource. */ + interface IResource { + + /** Resource name */ + name?: (string|null); + + /** Resource projectName */ + projectName?: (string|null); + + /** Resource projectDisplayName */ + projectDisplayName?: (string|null); + + /** Resource parentName */ + parentName?: (string|null); + + /** Resource parentDisplayName */ + parentDisplayName?: (string|null); + } + + /** Represents a Resource. */ + class Resource implements IResource { + + /** + * Constructs a new Resource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.IResource); + + /** Resource name. */ + public name: string; + + /** Resource projectName. */ + public projectName: string; + + /** Resource projectDisplayName. */ + public projectDisplayName: string; + + /** Resource parentName. */ + public parentName: string; + + /** Resource parentDisplayName. */ + public parentDisplayName: string; + + /** + * Creates a new Resource instance using the specified properties. + * @param [properties] Properties to set + * @returns Resource instance + */ + public static create(properties?: google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.IResource): google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource; + + /** + * Encodes the specified Resource message. Does not implicitly {@link google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource.verify|verify} messages. + * @param message Resource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.IResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Resource message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource.verify|verify} messages. + * @param message Resource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.IResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Resource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Resource + * @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.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource; + + /** + * Decodes a Resource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Resource + * @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.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource; + + /** + * Verifies a Resource 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 Resource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Resource + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource; + + /** + * Creates a plain object from a Resource message. Also converts values to other types if specified. + * @param message Resource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Resource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** StateChange enum. */ + enum StateChange { + UNUSED = 0, + CHANGED = 1, + UNCHANGED = 2, + ADDED = 3, + REMOVED = 4 } } } - /** Properties of a RunAssetDiscoveryResponse. */ - interface IRunAssetDiscoveryResponse { + /** Properties of a SetFindingStateRequest. */ + interface ISetFindingStateRequest { - /** RunAssetDiscoveryResponse state */ - state?: (google.cloud.securitycenter.v1.RunAssetDiscoveryResponse.State|null); + /** SetFindingStateRequest name */ + name?: (string|null); - /** RunAssetDiscoveryResponse duration */ - duration?: (google.protobuf.IDuration|null); + /** SetFindingStateRequest state */ + state?: (google.cloud.securitycenter.v1.Finding.State|null); + + /** SetFindingStateRequest startTime */ + startTime?: (google.protobuf.ITimestamp|null); } - /** Represents a RunAssetDiscoveryResponse. */ - class RunAssetDiscoveryResponse implements IRunAssetDiscoveryResponse { + /** Represents a SetFindingStateRequest. */ + class SetFindingStateRequest implements ISetFindingStateRequest { /** - * Constructs a new RunAssetDiscoveryResponse. + * Constructs a new SetFindingStateRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.securitycenter.v1.IRunAssetDiscoveryResponse); + constructor(properties?: google.cloud.securitycenter.v1.ISetFindingStateRequest); - /** RunAssetDiscoveryResponse state. */ - public state: google.cloud.securitycenter.v1.RunAssetDiscoveryResponse.State; + /** SetFindingStateRequest name. */ + public name: string; - /** RunAssetDiscoveryResponse duration. */ - public duration?: (google.protobuf.IDuration|null); + /** SetFindingStateRequest state. */ + public state: google.cloud.securitycenter.v1.Finding.State; + + /** SetFindingStateRequest startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); /** - * Creates a new RunAssetDiscoveryResponse instance using the specified properties. + * Creates a new SetFindingStateRequest instance using the specified properties. * @param [properties] Properties to set - * @returns RunAssetDiscoveryResponse instance + * @returns SetFindingStateRequest instance */ - public static create(properties?: google.cloud.securitycenter.v1.IRunAssetDiscoveryResponse): google.cloud.securitycenter.v1.RunAssetDiscoveryResponse; + public static create(properties?: google.cloud.securitycenter.v1.ISetFindingStateRequest): google.cloud.securitycenter.v1.SetFindingStateRequest; /** - * Encodes the specified RunAssetDiscoveryResponse message. Does not implicitly {@link google.cloud.securitycenter.v1.RunAssetDiscoveryResponse.verify|verify} messages. - * @param message RunAssetDiscoveryResponse message or plain object to encode + * Encodes the specified SetFindingStateRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.SetFindingStateRequest.verify|verify} messages. + * @param message SetFindingStateRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.securitycenter.v1.IRunAssetDiscoveryResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.securitycenter.v1.ISetFindingStateRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified RunAssetDiscoveryResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.RunAssetDiscoveryResponse.verify|verify} messages. - * @param message RunAssetDiscoveryResponse message or plain object to encode + * Encodes the specified SetFindingStateRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.SetFindingStateRequest.verify|verify} messages. + * @param message SetFindingStateRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.securitycenter.v1.IRunAssetDiscoveryResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.securitycenter.v1.ISetFindingStateRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a RunAssetDiscoveryResponse message from the specified reader or buffer. + * Decodes a SetFindingStateRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns RunAssetDiscoveryResponse + * @returns SetFindingStateRequest * @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.cloud.securitycenter.v1.RunAssetDiscoveryResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1.SetFindingStateRequest; /** - * Decodes a RunAssetDiscoveryResponse message from the specified reader or buffer, length delimited. + * Decodes a SetFindingStateRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns RunAssetDiscoveryResponse + * @returns SetFindingStateRequest * @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.cloud.securitycenter.v1.RunAssetDiscoveryResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1.SetFindingStateRequest; /** - * Verifies a RunAssetDiscoveryResponse message. + * Verifies a SetFindingStateRequest 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 RunAssetDiscoveryResponse message from a plain object. Also converts values to their respective internal types. + * Creates a SetFindingStateRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns RunAssetDiscoveryResponse + * @returns SetFindingStateRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.RunAssetDiscoveryResponse; + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.SetFindingStateRequest; /** - * Creates a plain object from a RunAssetDiscoveryResponse message. Also converts values to other types if specified. - * @param message RunAssetDiscoveryResponse + * Creates a plain object from a SetFindingStateRequest message. Also converts values to other types if specified. + * @param message SetFindingStateRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.securitycenter.v1.RunAssetDiscoveryResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.securitycenter.v1.SetFindingStateRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this RunAssetDiscoveryResponse to JSON. + * Converts this SetFindingStateRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - namespace RunAssetDiscoveryResponse { - - /** State enum. */ - enum State { - STATE_UNSPECIFIED = 0, - COMPLETED = 1, - SUPERSEDED = 2, - TERMINATED = 3 - } - } - - /** Properties of a Source. */ - interface ISource { - - /** Source name */ - name?: (string|null); - - /** Source displayName */ - displayName?: (string|null); + /** Properties of a RunAssetDiscoveryRequest. */ + interface IRunAssetDiscoveryRequest { - /** Source description */ - description?: (string|null); + /** RunAssetDiscoveryRequest parent */ + parent?: (string|null); } - /** Represents a Source. */ - class Source implements ISource { + /** Represents a RunAssetDiscoveryRequest. */ + class RunAssetDiscoveryRequest implements IRunAssetDiscoveryRequest { /** - * Constructs a new Source. + * Constructs a new RunAssetDiscoveryRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.securitycenter.v1.ISource); - - /** Source name. */ - public name: string; - - /** Source displayName. */ - public displayName: string; + constructor(properties?: google.cloud.securitycenter.v1.IRunAssetDiscoveryRequest); - /** Source description. */ - public description: string; + /** RunAssetDiscoveryRequest parent. */ + public parent: string; /** - * Creates a new Source instance using the specified properties. + * Creates a new RunAssetDiscoveryRequest instance using the specified properties. * @param [properties] Properties to set - * @returns Source instance + * @returns RunAssetDiscoveryRequest instance */ - public static create(properties?: google.cloud.securitycenter.v1.ISource): google.cloud.securitycenter.v1.Source; + public static create(properties?: google.cloud.securitycenter.v1.IRunAssetDiscoveryRequest): google.cloud.securitycenter.v1.RunAssetDiscoveryRequest; /** - * Encodes the specified Source message. Does not implicitly {@link google.cloud.securitycenter.v1.Source.verify|verify} messages. - * @param message Source message or plain object to encode + * Encodes the specified RunAssetDiscoveryRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.RunAssetDiscoveryRequest.verify|verify} messages. + * @param message RunAssetDiscoveryRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.securitycenter.v1.ISource, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.securitycenter.v1.IRunAssetDiscoveryRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified Source message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Source.verify|verify} messages. - * @param message Source message or plain object to encode + * Encodes the specified RunAssetDiscoveryRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.RunAssetDiscoveryRequest.verify|verify} messages. + * @param message RunAssetDiscoveryRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.securitycenter.v1.ISource, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.securitycenter.v1.IRunAssetDiscoveryRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a Source message from the specified reader or buffer. + * Decodes a RunAssetDiscoveryRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns Source + * @returns RunAssetDiscoveryRequest * @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.cloud.securitycenter.v1.Source; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1.RunAssetDiscoveryRequest; /** - * Decodes a Source message from the specified reader or buffer, length delimited. + * Decodes a RunAssetDiscoveryRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Source + * @returns RunAssetDiscoveryRequest * @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.cloud.securitycenter.v1.Source; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1.RunAssetDiscoveryRequest; /** - * Verifies a Source message. + * Verifies a RunAssetDiscoveryRequest 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 Source message from a plain object. Also converts values to their respective internal types. + * Creates a RunAssetDiscoveryRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Source + * @returns RunAssetDiscoveryRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.Source; + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.RunAssetDiscoveryRequest; /** - * Creates a plain object from a Source message. Also converts values to other types if specified. - * @param message Source + * Creates a plain object from a RunAssetDiscoveryRequest message. Also converts values to other types if specified. + * @param message RunAssetDiscoveryRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.securitycenter.v1.Source, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.securitycenter.v1.RunAssetDiscoveryRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Source to JSON. + * Converts this RunAssetDiscoveryRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - } - /** Namespace v1beta1. */ - namespace v1beta1 { + /** Properties of an UpdateFindingRequest. */ + interface IUpdateFindingRequest { - /** Represents a SecurityCenter */ - class SecurityCenter extends $protobuf.rpc.Service { + /** UpdateFindingRequest finding */ + finding?: (google.cloud.securitycenter.v1.IFinding|null); - /** - * Constructs a new SecurityCenter 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); + /** UpdateFindingRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateFindingRequest. */ + class UpdateFindingRequest implements IUpdateFindingRequest { /** - * Creates new SecurityCenter 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. + * Constructs a new UpdateFindingRequest. + * @param [properties] Properties to set */ - public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): SecurityCenter; + constructor(properties?: google.cloud.securitycenter.v1.IUpdateFindingRequest); + + /** UpdateFindingRequest finding. */ + public finding?: (google.cloud.securitycenter.v1.IFinding|null); + + /** UpdateFindingRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); /** - * Calls CreateSource. - * @param request CreateSourceRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Source + * Creates a new UpdateFindingRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateFindingRequest instance */ - public createSource(request: google.cloud.securitycenter.v1beta1.ICreateSourceRequest, callback: google.cloud.securitycenter.v1beta1.SecurityCenter.CreateSourceCallback): void; + public static create(properties?: google.cloud.securitycenter.v1.IUpdateFindingRequest): google.cloud.securitycenter.v1.UpdateFindingRequest; /** - * Calls CreateSource. - * @param request CreateSourceRequest message or plain object - * @returns Promise + * Encodes the specified UpdateFindingRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.UpdateFindingRequest.verify|verify} messages. + * @param message UpdateFindingRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - public createSource(request: google.cloud.securitycenter.v1beta1.ICreateSourceRequest): Promise; + public static encode(message: google.cloud.securitycenter.v1.IUpdateFindingRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Calls CreateFinding. - * @param request CreateFindingRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Finding + * Encodes the specified UpdateFindingRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.UpdateFindingRequest.verify|verify} messages. + * @param message UpdateFindingRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - public createFinding(request: google.cloud.securitycenter.v1beta1.ICreateFindingRequest, callback: google.cloud.securitycenter.v1beta1.SecurityCenter.CreateFindingCallback): void; + public static encodeDelimited(message: google.cloud.securitycenter.v1.IUpdateFindingRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Calls CreateFinding. - * @param request CreateFindingRequest message or plain object - * @returns Promise + * Decodes an UpdateFindingRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateFindingRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public createFinding(request: google.cloud.securitycenter.v1beta1.ICreateFindingRequest): Promise; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1.UpdateFindingRequest; /** - * Calls GetIamPolicy. - * @param request GetIamPolicyRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Policy + * Decodes an UpdateFindingRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateFindingRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public getIamPolicy(request: google.iam.v1.IGetIamPolicyRequest, callback: google.cloud.securitycenter.v1beta1.SecurityCenter.GetIamPolicyCallback): void; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1.UpdateFindingRequest; /** - * Calls GetIamPolicy. - * @param request GetIamPolicyRequest message or plain object - * @returns Promise + * Verifies an UpdateFindingRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not */ - public getIamPolicy(request: google.iam.v1.IGetIamPolicyRequest): Promise; + public static verify(message: { [k: string]: any }): (string|null); /** - * Calls GetOrganizationSettings. - * @param request GetOrganizationSettingsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and OrganizationSettings + * Creates an UpdateFindingRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateFindingRequest */ - public getOrganizationSettings(request: google.cloud.securitycenter.v1beta1.IGetOrganizationSettingsRequest, callback: google.cloud.securitycenter.v1beta1.SecurityCenter.GetOrganizationSettingsCallback): void; + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.UpdateFindingRequest; /** - * Calls GetOrganizationSettings. - * @param request GetOrganizationSettingsRequest message or plain object - * @returns Promise + * Creates a plain object from an UpdateFindingRequest message. Also converts values to other types if specified. + * @param message UpdateFindingRequest + * @param [options] Conversion options + * @returns Plain object */ - public getOrganizationSettings(request: google.cloud.securitycenter.v1beta1.IGetOrganizationSettingsRequest): Promise; + public static toObject(message: google.cloud.securitycenter.v1.UpdateFindingRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Calls GetSource. - * @param request GetSourceRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Source + * Converts this UpdateFindingRequest to JSON. + * @returns JSON object */ - public getSource(request: google.cloud.securitycenter.v1beta1.IGetSourceRequest, callback: google.cloud.securitycenter.v1beta1.SecurityCenter.GetSourceCallback): void; + public toJSON(): { [k: string]: any }; + } - /** - * Calls GetSource. - * @param request GetSourceRequest message or plain object - * @returns Promise - */ - public getSource(request: google.cloud.securitycenter.v1beta1.IGetSourceRequest): Promise; + /** Properties of an UpdateOrganizationSettingsRequest. */ + interface IUpdateOrganizationSettingsRequest { + + /** UpdateOrganizationSettingsRequest organizationSettings */ + organizationSettings?: (google.cloud.securitycenter.v1.IOrganizationSettings|null); + + /** UpdateOrganizationSettingsRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateOrganizationSettingsRequest. */ + class UpdateOrganizationSettingsRequest implements IUpdateOrganizationSettingsRequest { /** - * Calls GroupAssets. - * @param request GroupAssetsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and GroupAssetsResponse + * Constructs a new UpdateOrganizationSettingsRequest. + * @param [properties] Properties to set */ - public groupAssets(request: google.cloud.securitycenter.v1beta1.IGroupAssetsRequest, callback: google.cloud.securitycenter.v1beta1.SecurityCenter.GroupAssetsCallback): void; + constructor(properties?: google.cloud.securitycenter.v1.IUpdateOrganizationSettingsRequest); + + /** UpdateOrganizationSettingsRequest organizationSettings. */ + public organizationSettings?: (google.cloud.securitycenter.v1.IOrganizationSettings|null); + + /** UpdateOrganizationSettingsRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); /** - * Calls GroupAssets. - * @param request GroupAssetsRequest message or plain object - * @returns Promise + * Creates a new UpdateOrganizationSettingsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateOrganizationSettingsRequest instance */ - public groupAssets(request: google.cloud.securitycenter.v1beta1.IGroupAssetsRequest): Promise; + public static create(properties?: google.cloud.securitycenter.v1.IUpdateOrganizationSettingsRequest): google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest; /** - * Calls GroupFindings. - * @param request GroupFindingsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and GroupFindingsResponse + * Encodes the specified UpdateOrganizationSettingsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest.verify|verify} messages. + * @param message UpdateOrganizationSettingsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - public groupFindings(request: google.cloud.securitycenter.v1beta1.IGroupFindingsRequest, callback: google.cloud.securitycenter.v1beta1.SecurityCenter.GroupFindingsCallback): void; + public static encode(message: google.cloud.securitycenter.v1.IUpdateOrganizationSettingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Calls GroupFindings. - * @param request GroupFindingsRequest message or plain object - * @returns Promise + * Encodes the specified UpdateOrganizationSettingsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest.verify|verify} messages. + * @param message UpdateOrganizationSettingsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - public groupFindings(request: google.cloud.securitycenter.v1beta1.IGroupFindingsRequest): Promise; + public static encodeDelimited(message: google.cloud.securitycenter.v1.IUpdateOrganizationSettingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Calls ListAssets. - * @param request ListAssetsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListAssetsResponse + * Decodes an UpdateOrganizationSettingsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateOrganizationSettingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public listAssets(request: google.cloud.securitycenter.v1beta1.IListAssetsRequest, callback: google.cloud.securitycenter.v1beta1.SecurityCenter.ListAssetsCallback): void; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest; /** - * Calls ListAssets. - * @param request ListAssetsRequest message or plain object - * @returns Promise + * Decodes an UpdateOrganizationSettingsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateOrganizationSettingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public listAssets(request: google.cloud.securitycenter.v1beta1.IListAssetsRequest): Promise; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest; /** - * Calls ListFindings. - * @param request ListFindingsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListFindingsResponse + * Verifies an UpdateOrganizationSettingsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not */ - public listFindings(request: google.cloud.securitycenter.v1beta1.IListFindingsRequest, callback: google.cloud.securitycenter.v1beta1.SecurityCenter.ListFindingsCallback): void; + public static verify(message: { [k: string]: any }): (string|null); /** - * Calls ListFindings. - * @param request ListFindingsRequest message or plain object - * @returns Promise + * Creates an UpdateOrganizationSettingsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateOrganizationSettingsRequest */ - public listFindings(request: google.cloud.securitycenter.v1beta1.IListFindingsRequest): Promise; + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest; /** - * Calls ListSources. - * @param request ListSourcesRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListSourcesResponse + * Creates a plain object from an UpdateOrganizationSettingsRequest message. Also converts values to other types if specified. + * @param message UpdateOrganizationSettingsRequest + * @param [options] Conversion options + * @returns Plain object */ - public listSources(request: google.cloud.securitycenter.v1beta1.IListSourcesRequest, callback: google.cloud.securitycenter.v1beta1.SecurityCenter.ListSourcesCallback): void; + public static toObject(message: google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Calls ListSources. - * @param request ListSourcesRequest message or plain object - * @returns Promise + * Converts this UpdateOrganizationSettingsRequest to JSON. + * @returns JSON object */ - public listSources(request: google.cloud.securitycenter.v1beta1.IListSourcesRequest): Promise; + public toJSON(): { [k: string]: any }; + } + + /** Properties of an UpdateSourceRequest. */ + interface IUpdateSourceRequest { + + /** UpdateSourceRequest source */ + source?: (google.cloud.securitycenter.v1.ISource|null); + + /** UpdateSourceRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateSourceRequest. */ + class UpdateSourceRequest implements IUpdateSourceRequest { /** - * Calls RunAssetDiscovery. - * @param request RunAssetDiscoveryRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation + * Constructs a new UpdateSourceRequest. + * @param [properties] Properties to set */ - public runAssetDiscovery(request: google.cloud.securitycenter.v1beta1.IRunAssetDiscoveryRequest, callback: google.cloud.securitycenter.v1beta1.SecurityCenter.RunAssetDiscoveryCallback): void; + constructor(properties?: google.cloud.securitycenter.v1.IUpdateSourceRequest); + + /** UpdateSourceRequest source. */ + public source?: (google.cloud.securitycenter.v1.ISource|null); + + /** UpdateSourceRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); /** - * Calls RunAssetDiscovery. - * @param request RunAssetDiscoveryRequest message or plain object - * @returns Promise + * Creates a new UpdateSourceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateSourceRequest instance */ - public runAssetDiscovery(request: google.cloud.securitycenter.v1beta1.IRunAssetDiscoveryRequest): Promise; + public static create(properties?: google.cloud.securitycenter.v1.IUpdateSourceRequest): google.cloud.securitycenter.v1.UpdateSourceRequest; /** - * Calls SetFindingState. - * @param request SetFindingStateRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Finding + * Encodes the specified UpdateSourceRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.UpdateSourceRequest.verify|verify} messages. + * @param message UpdateSourceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - public setFindingState(request: google.cloud.securitycenter.v1beta1.ISetFindingStateRequest, callback: google.cloud.securitycenter.v1beta1.SecurityCenter.SetFindingStateCallback): void; + public static encode(message: google.cloud.securitycenter.v1.IUpdateSourceRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Calls SetFindingState. - * @param request SetFindingStateRequest message or plain object - * @returns Promise + * Encodes the specified UpdateSourceRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.UpdateSourceRequest.verify|verify} messages. + * @param message UpdateSourceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - public setFindingState(request: google.cloud.securitycenter.v1beta1.ISetFindingStateRequest): Promise; + public static encodeDelimited(message: google.cloud.securitycenter.v1.IUpdateSourceRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Calls SetIamPolicy. - * @param request SetIamPolicyRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Policy + * Decodes an UpdateSourceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateSourceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public setIamPolicy(request: google.iam.v1.ISetIamPolicyRequest, callback: google.cloud.securitycenter.v1beta1.SecurityCenter.SetIamPolicyCallback): void; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1.UpdateSourceRequest; /** - * Calls SetIamPolicy. - * @param request SetIamPolicyRequest message or plain object - * @returns Promise + * Decodes an UpdateSourceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateSourceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public setIamPolicy(request: google.iam.v1.ISetIamPolicyRequest): Promise; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1.UpdateSourceRequest; /** - * Calls TestIamPermissions. - * @param request TestIamPermissionsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and TestIamPermissionsResponse + * Verifies an UpdateSourceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not */ - public testIamPermissions(request: google.iam.v1.ITestIamPermissionsRequest, callback: google.cloud.securitycenter.v1beta1.SecurityCenter.TestIamPermissionsCallback): void; + public static verify(message: { [k: string]: any }): (string|null); /** - * Calls TestIamPermissions. - * @param request TestIamPermissionsRequest message or plain object - * @returns Promise + * Creates an UpdateSourceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateSourceRequest */ - public testIamPermissions(request: google.iam.v1.ITestIamPermissionsRequest): Promise; + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.UpdateSourceRequest; /** - * Calls UpdateFinding. - * @param request UpdateFindingRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Finding + * Creates a plain object from an UpdateSourceRequest message. Also converts values to other types if specified. + * @param message UpdateSourceRequest + * @param [options] Conversion options + * @returns Plain object */ - public updateFinding(request: google.cloud.securitycenter.v1beta1.IUpdateFindingRequest, callback: google.cloud.securitycenter.v1beta1.SecurityCenter.UpdateFindingCallback): void; + public static toObject(message: google.cloud.securitycenter.v1.UpdateSourceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Calls UpdateFinding. - * @param request UpdateFindingRequest message or plain object - * @returns Promise + * Converts this UpdateSourceRequest to JSON. + * @returns JSON object */ - public updateFinding(request: google.cloud.securitycenter.v1beta1.IUpdateFindingRequest): Promise; + public toJSON(): { [k: string]: any }; + } - /** - * Calls UpdateOrganizationSettings. - * @param request UpdateOrganizationSettingsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and OrganizationSettings - */ - public updateOrganizationSettings(request: google.cloud.securitycenter.v1beta1.IUpdateOrganizationSettingsRequest, callback: google.cloud.securitycenter.v1beta1.SecurityCenter.UpdateOrganizationSettingsCallback): void; + /** Properties of an UpdateSecurityMarksRequest. */ + interface IUpdateSecurityMarksRequest { - /** - * Calls UpdateOrganizationSettings. - * @param request UpdateOrganizationSettingsRequest message or plain object - * @returns Promise - */ - public updateOrganizationSettings(request: google.cloud.securitycenter.v1beta1.IUpdateOrganizationSettingsRequest): Promise; + /** UpdateSecurityMarksRequest securityMarks */ + securityMarks?: (google.cloud.securitycenter.v1.ISecurityMarks|null); - /** - * Calls UpdateSource. - * @param request UpdateSourceRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Source - */ - public updateSource(request: google.cloud.securitycenter.v1beta1.IUpdateSourceRequest, callback: google.cloud.securitycenter.v1beta1.SecurityCenter.UpdateSourceCallback): void; + /** UpdateSecurityMarksRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); - /** - * Calls UpdateSource. - * @param request UpdateSourceRequest message or plain object - * @returns Promise - */ - public updateSource(request: google.cloud.securitycenter.v1beta1.IUpdateSourceRequest): Promise; + /** UpdateSecurityMarksRequest startTime */ + startTime?: (google.protobuf.ITimestamp|null); + } - /** - * Calls UpdateSecurityMarks. - * @param request UpdateSecurityMarksRequest message or plain object - * @param callback Node-style callback called with the error, if any, and SecurityMarks - */ - public updateSecurityMarks(request: google.cloud.securitycenter.v1beta1.IUpdateSecurityMarksRequest, callback: google.cloud.securitycenter.v1beta1.SecurityCenter.UpdateSecurityMarksCallback): void; + /** Represents an UpdateSecurityMarksRequest. */ + class UpdateSecurityMarksRequest implements IUpdateSecurityMarksRequest { /** - * Calls UpdateSecurityMarks. - * @param request UpdateSecurityMarksRequest message or plain object - * @returns Promise + * Constructs a new UpdateSecurityMarksRequest. + * @param [properties] Properties to set */ - public updateSecurityMarks(request: google.cloud.securitycenter.v1beta1.IUpdateSecurityMarksRequest): Promise; - } + constructor(properties?: google.cloud.securitycenter.v1.IUpdateSecurityMarksRequest); - namespace SecurityCenter { + /** UpdateSecurityMarksRequest securityMarks. */ + public securityMarks?: (google.cloud.securitycenter.v1.ISecurityMarks|null); - /** - * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter#createSource}. - * @param error Error, if any - * @param [response] Source - */ - type CreateSourceCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1beta1.Source) => void; + /** UpdateSecurityMarksRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); - /** - * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter#createFinding}. - * @param error Error, if any - * @param [response] Finding - */ - type CreateFindingCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1beta1.Finding) => void; + /** UpdateSecurityMarksRequest startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); /** - * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter#getIamPolicy}. - * @param error Error, if any - * @param [response] Policy + * Creates a new UpdateSecurityMarksRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateSecurityMarksRequest instance */ - type GetIamPolicyCallback = (error: (Error|null), response?: google.iam.v1.Policy) => void; + public static create(properties?: google.cloud.securitycenter.v1.IUpdateSecurityMarksRequest): google.cloud.securitycenter.v1.UpdateSecurityMarksRequest; /** - * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter#getOrganizationSettings}. - * @param error Error, if any - * @param [response] OrganizationSettings + * Encodes the specified UpdateSecurityMarksRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.UpdateSecurityMarksRequest.verify|verify} messages. + * @param message UpdateSecurityMarksRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - type GetOrganizationSettingsCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1beta1.OrganizationSettings) => void; + public static encode(message: google.cloud.securitycenter.v1.IUpdateSecurityMarksRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter#getSource}. - * @param error Error, if any - * @param [response] Source + * Encodes the specified UpdateSecurityMarksRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.UpdateSecurityMarksRequest.verify|verify} messages. + * @param message UpdateSecurityMarksRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - type GetSourceCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1beta1.Source) => void; + public static encodeDelimited(message: google.cloud.securitycenter.v1.IUpdateSecurityMarksRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter#groupAssets}. - * @param error Error, if any - * @param [response] GroupAssetsResponse + * Decodes an UpdateSecurityMarksRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateSecurityMarksRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - type GroupAssetsCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1beta1.GroupAssetsResponse) => void; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1.UpdateSecurityMarksRequest; /** - * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter#groupFindings}. - * @param error Error, if any - * @param [response] GroupFindingsResponse + * Decodes an UpdateSecurityMarksRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateSecurityMarksRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - type GroupFindingsCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1beta1.GroupFindingsResponse) => void; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1.UpdateSecurityMarksRequest; /** - * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter#listAssets}. - * @param error Error, if any - * @param [response] ListAssetsResponse + * Verifies an UpdateSecurityMarksRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not */ - type ListAssetsCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1beta1.ListAssetsResponse) => void; + public static verify(message: { [k: string]: any }): (string|null); /** - * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter#listFindings}. - * @param error Error, if any - * @param [response] ListFindingsResponse + * Creates an UpdateSecurityMarksRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateSecurityMarksRequest */ - type ListFindingsCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1beta1.ListFindingsResponse) => void; + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.UpdateSecurityMarksRequest; /** - * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter#listSources}. - * @param error Error, if any - * @param [response] ListSourcesResponse + * Creates a plain object from an UpdateSecurityMarksRequest message. Also converts values to other types if specified. + * @param message UpdateSecurityMarksRequest + * @param [options] Conversion options + * @returns Plain object */ - type ListSourcesCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1beta1.ListSourcesResponse) => void; + public static toObject(message: google.cloud.securitycenter.v1.UpdateSecurityMarksRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter#runAssetDiscovery}. - * @param error Error, if any - * @param [response] Operation + * Converts this UpdateSecurityMarksRequest to JSON. + * @returns JSON object */ - type RunAssetDiscoveryCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + public toJSON(): { [k: string]: any }; + } + } - /** - * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter#setFindingState}. - * @param error Error, if any - * @param [response] Finding - */ - type SetFindingStateCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1beta1.Finding) => void; + /** Namespace v1beta1. */ + namespace v1beta1 { - /** - * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter#setIamPolicy}. - * @param error Error, if any - * @param [response] Policy - */ - type SetIamPolicyCallback = (error: (Error|null), response?: google.iam.v1.Policy) => void; + /** Properties of a Finding. */ + interface IFinding { - /** - * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter#testIamPermissions}. - * @param error Error, if any - * @param [response] TestIamPermissionsResponse - */ - type TestIamPermissionsCallback = (error: (Error|null), response?: google.iam.v1.TestIamPermissionsResponse) => void; + /** Finding name */ + name?: (string|null); - /** - * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter#updateFinding}. - * @param error Error, if any - * @param [response] Finding - */ - type UpdateFindingCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1beta1.Finding) => void; + /** Finding parent */ + parent?: (string|null); - /** - * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter#updateOrganizationSettings}. - * @param error Error, if any - * @param [response] OrganizationSettings - */ - type UpdateOrganizationSettingsCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1beta1.OrganizationSettings) => void; + /** Finding resourceName */ + resourceName?: (string|null); - /** - * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter#updateSource}. - * @param error Error, if any - * @param [response] Source - */ - type UpdateSourceCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1beta1.Source) => void; + /** Finding state */ + state?: (google.cloud.securitycenter.v1beta1.Finding.State|null); - /** - * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter#updateSecurityMarks}. - * @param error Error, if any - * @param [response] SecurityMarks - */ - type UpdateSecurityMarksCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1beta1.SecurityMarks) => void; - } + /** Finding category */ + category?: (string|null); - /** Properties of a CreateFindingRequest. */ - interface ICreateFindingRequest { + /** Finding externalUri */ + externalUri?: (string|null); - /** CreateFindingRequest parent */ - parent?: (string|null); + /** Finding sourceProperties */ + sourceProperties?: ({ [k: string]: google.protobuf.IValue }|null); - /** CreateFindingRequest findingId */ - findingId?: (string|null); + /** Finding securityMarks */ + securityMarks?: (google.cloud.securitycenter.v1beta1.ISecurityMarks|null); - /** CreateFindingRequest finding */ - finding?: (google.cloud.securitycenter.v1beta1.IFinding|null); + /** Finding eventTime */ + eventTime?: (google.protobuf.ITimestamp|null); + + /** Finding createTime */ + createTime?: (google.protobuf.ITimestamp|null); } - /** Represents a CreateFindingRequest. */ - class CreateFindingRequest implements ICreateFindingRequest { + /** Represents a Finding. */ + class Finding implements IFinding { /** - * Constructs a new CreateFindingRequest. + * Constructs a new Finding. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.securitycenter.v1beta1.ICreateFindingRequest); + constructor(properties?: google.cloud.securitycenter.v1beta1.IFinding); - /** CreateFindingRequest parent. */ + /** Finding name. */ + public name: string; + + /** Finding parent. */ public parent: string; - /** CreateFindingRequest findingId. */ - public findingId: string; + /** Finding resourceName. */ + public resourceName: string; - /** CreateFindingRequest finding. */ - public finding?: (google.cloud.securitycenter.v1beta1.IFinding|null); + /** Finding state. */ + public state: google.cloud.securitycenter.v1beta1.Finding.State; + + /** Finding category. */ + public category: string; + + /** Finding externalUri. */ + public externalUri: string; + + /** Finding sourceProperties. */ + public sourceProperties: { [k: string]: google.protobuf.IValue }; + + /** Finding securityMarks. */ + public securityMarks?: (google.cloud.securitycenter.v1beta1.ISecurityMarks|null); + + /** Finding eventTime. */ + public eventTime?: (google.protobuf.ITimestamp|null); + + /** Finding createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); /** - * Creates a new CreateFindingRequest instance using the specified properties. + * Creates a new Finding instance using the specified properties. * @param [properties] Properties to set - * @returns CreateFindingRequest instance + * @returns Finding instance */ - public static create(properties?: google.cloud.securitycenter.v1beta1.ICreateFindingRequest): google.cloud.securitycenter.v1beta1.CreateFindingRequest; + public static create(properties?: google.cloud.securitycenter.v1beta1.IFinding): google.cloud.securitycenter.v1beta1.Finding; /** - * Encodes the specified CreateFindingRequest message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.CreateFindingRequest.verify|verify} messages. - * @param message CreateFindingRequest message or plain object to encode + * Encodes the specified Finding message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.Finding.verify|verify} messages. + * @param message Finding message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.securitycenter.v1beta1.ICreateFindingRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.securitycenter.v1beta1.IFinding, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified CreateFindingRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.CreateFindingRequest.verify|verify} messages. - * @param message CreateFindingRequest message or plain object to encode + * Encodes the specified Finding message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.Finding.verify|verify} messages. + * @param message Finding message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.securitycenter.v1beta1.ICreateFindingRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.securitycenter.v1beta1.IFinding, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a CreateFindingRequest message from the specified reader or buffer. + * Decodes a Finding message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns CreateFindingRequest + * @returns Finding * @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.cloud.securitycenter.v1beta1.CreateFindingRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1beta1.Finding; /** - * Decodes a CreateFindingRequest message from the specified reader or buffer, length delimited. + * Decodes a Finding message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns CreateFindingRequest + * @returns Finding * @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.cloud.securitycenter.v1beta1.CreateFindingRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1beta1.Finding; /** - * Verifies a CreateFindingRequest message. + * Verifies a Finding 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 CreateFindingRequest message from a plain object. Also converts values to their respective internal types. + * Creates a Finding message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns CreateFindingRequest + * @returns Finding */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1beta1.CreateFindingRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1beta1.Finding; /** - * Creates a plain object from a CreateFindingRequest message. Also converts values to other types if specified. - * @param message CreateFindingRequest + * Creates a plain object from a Finding message. Also converts values to other types if specified. + * @param message Finding * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.securitycenter.v1beta1.CreateFindingRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.securitycenter.v1beta1.Finding, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this CreateFindingRequest to JSON. + * Converts this Finding to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a CreateSourceRequest. */ - interface ICreateSourceRequest { + namespace Finding { - /** CreateSourceRequest parent */ - parent?: (string|null); + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + ACTIVE = 1, + INACTIVE = 2 + } + } - /** CreateSourceRequest source */ - source?: (google.cloud.securitycenter.v1beta1.ISource|null); + /** Properties of a SecurityMarks. */ + interface ISecurityMarks { + + /** SecurityMarks name */ + name?: (string|null); + + /** SecurityMarks marks */ + marks?: ({ [k: string]: string }|null); } - /** Represents a CreateSourceRequest. */ - class CreateSourceRequest implements ICreateSourceRequest { + /** Represents a SecurityMarks. */ + class SecurityMarks implements ISecurityMarks { /** - * Constructs a new CreateSourceRequest. + * Constructs a new SecurityMarks. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.securitycenter.v1beta1.ICreateSourceRequest); + constructor(properties?: google.cloud.securitycenter.v1beta1.ISecurityMarks); - /** CreateSourceRequest parent. */ - public parent: string; + /** SecurityMarks name. */ + public name: string; - /** CreateSourceRequest source. */ - public source?: (google.cloud.securitycenter.v1beta1.ISource|null); + /** SecurityMarks marks. */ + public marks: { [k: string]: string }; /** - * Creates a new CreateSourceRequest instance using the specified properties. + * Creates a new SecurityMarks instance using the specified properties. * @param [properties] Properties to set - * @returns CreateSourceRequest instance + * @returns SecurityMarks instance */ - public static create(properties?: google.cloud.securitycenter.v1beta1.ICreateSourceRequest): google.cloud.securitycenter.v1beta1.CreateSourceRequest; + public static create(properties?: google.cloud.securitycenter.v1beta1.ISecurityMarks): google.cloud.securitycenter.v1beta1.SecurityMarks; /** - * Encodes the specified CreateSourceRequest message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.CreateSourceRequest.verify|verify} messages. - * @param message CreateSourceRequest message or plain object to encode + * Encodes the specified SecurityMarks message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.SecurityMarks.verify|verify} messages. + * @param message SecurityMarks message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.securitycenter.v1beta1.ICreateSourceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.securitycenter.v1beta1.ISecurityMarks, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified CreateSourceRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.CreateSourceRequest.verify|verify} messages. - * @param message CreateSourceRequest message or plain object to encode + * Encodes the specified SecurityMarks message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.SecurityMarks.verify|verify} messages. + * @param message SecurityMarks message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.securitycenter.v1beta1.ICreateSourceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.securitycenter.v1beta1.ISecurityMarks, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a CreateSourceRequest message from the specified reader or buffer. + * Decodes a SecurityMarks message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns CreateSourceRequest + * @returns SecurityMarks * @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.cloud.securitycenter.v1beta1.CreateSourceRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1beta1.SecurityMarks; /** - * Decodes a CreateSourceRequest message from the specified reader or buffer, length delimited. + * Decodes a SecurityMarks message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns CreateSourceRequest + * @returns SecurityMarks * @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.cloud.securitycenter.v1beta1.CreateSourceRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1beta1.SecurityMarks; /** - * Verifies a CreateSourceRequest message. + * Verifies a SecurityMarks 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 CreateSourceRequest message from a plain object. Also converts values to their respective internal types. + * Creates a SecurityMarks message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns CreateSourceRequest + * @returns SecurityMarks */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1beta1.CreateSourceRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1beta1.SecurityMarks; /** - * Creates a plain object from a CreateSourceRequest message. Also converts values to other types if specified. - * @param message CreateSourceRequest + * Creates a plain object from a SecurityMarks message. Also converts values to other types if specified. + * @param message SecurityMarks * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.securitycenter.v1beta1.CreateSourceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.securitycenter.v1beta1.SecurityMarks, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this CreateSourceRequest to JSON. + * Converts this SecurityMarks to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a GetOrganizationSettingsRequest. */ - interface IGetOrganizationSettingsRequest { + /** Properties of an Asset. */ + interface IAsset { - /** GetOrganizationSettingsRequest name */ + /** Asset name */ name?: (string|null); + + /** Asset securityCenterProperties */ + securityCenterProperties?: (google.cloud.securitycenter.v1beta1.Asset.ISecurityCenterProperties|null); + + /** Asset resourceProperties */ + resourceProperties?: ({ [k: string]: google.protobuf.IValue }|null); + + /** Asset securityMarks */ + securityMarks?: (google.cloud.securitycenter.v1beta1.ISecurityMarks|null); + + /** Asset createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Asset updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); } - /** Represents a GetOrganizationSettingsRequest. */ - class GetOrganizationSettingsRequest implements IGetOrganizationSettingsRequest { + /** Represents an Asset. */ + class Asset implements IAsset { /** - * Constructs a new GetOrganizationSettingsRequest. + * Constructs a new Asset. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.securitycenter.v1beta1.IGetOrganizationSettingsRequest); + constructor(properties?: google.cloud.securitycenter.v1beta1.IAsset); - /** GetOrganizationSettingsRequest name. */ + /** Asset name. */ public name: string; + /** Asset securityCenterProperties. */ + public securityCenterProperties?: (google.cloud.securitycenter.v1beta1.Asset.ISecurityCenterProperties|null); + + /** Asset resourceProperties. */ + public resourceProperties: { [k: string]: google.protobuf.IValue }; + + /** Asset securityMarks. */ + public securityMarks?: (google.cloud.securitycenter.v1beta1.ISecurityMarks|null); + + /** Asset createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Asset updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + /** - * Creates a new GetOrganizationSettingsRequest instance using the specified properties. + * Creates a new Asset instance using the specified properties. * @param [properties] Properties to set - * @returns GetOrganizationSettingsRequest instance + * @returns Asset instance */ - public static create(properties?: google.cloud.securitycenter.v1beta1.IGetOrganizationSettingsRequest): google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest; + public static create(properties?: google.cloud.securitycenter.v1beta1.IAsset): google.cloud.securitycenter.v1beta1.Asset; /** - * Encodes the specified GetOrganizationSettingsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest.verify|verify} messages. - * @param message GetOrganizationSettingsRequest message or plain object to encode + * Encodes the specified Asset message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.Asset.verify|verify} messages. + * @param message Asset message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.securitycenter.v1beta1.IGetOrganizationSettingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.securitycenter.v1beta1.IAsset, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified GetOrganizationSettingsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest.verify|verify} messages. - * @param message GetOrganizationSettingsRequest message or plain object to encode + * Encodes the specified Asset message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.Asset.verify|verify} messages. + * @param message Asset message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.securitycenter.v1beta1.IGetOrganizationSettingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.securitycenter.v1beta1.IAsset, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a GetOrganizationSettingsRequest message from the specified reader or buffer. + * Decodes an Asset message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns GetOrganizationSettingsRequest + * @returns Asset * @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.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1beta1.Asset; /** - * Decodes a GetOrganizationSettingsRequest message from the specified reader or buffer, length delimited. + * Decodes an Asset message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns GetOrganizationSettingsRequest + * @returns Asset * @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.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1beta1.Asset; /** - * Verifies a GetOrganizationSettingsRequest message. + * Verifies an Asset 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 GetOrganizationSettingsRequest message from a plain object. Also converts values to their respective internal types. + * Creates an Asset message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns GetOrganizationSettingsRequest + * @returns Asset */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1beta1.Asset; /** - * Creates a plain object from a GetOrganizationSettingsRequest message. Also converts values to other types if specified. - * @param message GetOrganizationSettingsRequest + * Creates a plain object from an Asset message. Also converts values to other types if specified. + * @param message Asset * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.securitycenter.v1beta1.Asset, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this GetOrganizationSettingsRequest to JSON. + * Converts this Asset to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a GetSourceRequest. */ - interface IGetSourceRequest { + namespace Asset { - /** GetSourceRequest name */ + /** Properties of a SecurityCenterProperties. */ + interface ISecurityCenterProperties { + + /** SecurityCenterProperties resourceName */ + resourceName?: (string|null); + + /** SecurityCenterProperties resourceType */ + resourceType?: (string|null); + + /** SecurityCenterProperties resourceParent */ + resourceParent?: (string|null); + + /** SecurityCenterProperties resourceProject */ + resourceProject?: (string|null); + + /** SecurityCenterProperties resourceOwners */ + resourceOwners?: (string[]|null); + } + + /** Represents a SecurityCenterProperties. */ + class SecurityCenterProperties implements ISecurityCenterProperties { + + /** + * Constructs a new SecurityCenterProperties. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1beta1.Asset.ISecurityCenterProperties); + + /** SecurityCenterProperties resourceName. */ + public resourceName: string; + + /** SecurityCenterProperties resourceType. */ + public resourceType: string; + + /** SecurityCenterProperties resourceParent. */ + public resourceParent: string; + + /** SecurityCenterProperties resourceProject. */ + public resourceProject: string; + + /** SecurityCenterProperties resourceOwners. */ + public resourceOwners: string[]; + + /** + * Creates a new SecurityCenterProperties instance using the specified properties. + * @param [properties] Properties to set + * @returns SecurityCenterProperties instance + */ + public static create(properties?: google.cloud.securitycenter.v1beta1.Asset.ISecurityCenterProperties): google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties; + + /** + * Encodes the specified SecurityCenterProperties message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties.verify|verify} messages. + * @param message SecurityCenterProperties message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1beta1.Asset.ISecurityCenterProperties, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SecurityCenterProperties message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties.verify|verify} messages. + * @param message SecurityCenterProperties message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1beta1.Asset.ISecurityCenterProperties, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SecurityCenterProperties message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SecurityCenterProperties + * @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.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties; + + /** + * Decodes a SecurityCenterProperties message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SecurityCenterProperties + * @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.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties; + + /** + * Verifies a SecurityCenterProperties 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 SecurityCenterProperties message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SecurityCenterProperties + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties; + + /** + * Creates a plain object from a SecurityCenterProperties message. Also converts values to other types if specified. + * @param message SecurityCenterProperties + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SecurityCenterProperties to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** Properties of a Source. */ + interface ISource { + + /** Source name */ name?: (string|null); + + /** Source displayName */ + displayName?: (string|null); + + /** Source description */ + description?: (string|null); } - /** Represents a GetSourceRequest. */ - class GetSourceRequest implements IGetSourceRequest { + /** Represents a Source. */ + class Source implements ISource { /** - * Constructs a new GetSourceRequest. + * Constructs a new Source. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.securitycenter.v1beta1.IGetSourceRequest); + constructor(properties?: google.cloud.securitycenter.v1beta1.ISource); - /** GetSourceRequest name. */ + /** Source name. */ public name: string; + /** Source displayName. */ + public displayName: string; + + /** Source description. */ + public description: string; + /** - * Creates a new GetSourceRequest instance using the specified properties. + * Creates a new Source instance using the specified properties. * @param [properties] Properties to set - * @returns GetSourceRequest instance + * @returns Source instance */ - public static create(properties?: google.cloud.securitycenter.v1beta1.IGetSourceRequest): google.cloud.securitycenter.v1beta1.GetSourceRequest; + public static create(properties?: google.cloud.securitycenter.v1beta1.ISource): google.cloud.securitycenter.v1beta1.Source; /** - * Encodes the specified GetSourceRequest message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.GetSourceRequest.verify|verify} messages. - * @param message GetSourceRequest message or plain object to encode + * Encodes the specified Source message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.Source.verify|verify} messages. + * @param message Source message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.securitycenter.v1beta1.IGetSourceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.securitycenter.v1beta1.ISource, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified GetSourceRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.GetSourceRequest.verify|verify} messages. - * @param message GetSourceRequest message or plain object to encode + * Encodes the specified Source message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.Source.verify|verify} messages. + * @param message Source message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.securitycenter.v1beta1.IGetSourceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.securitycenter.v1beta1.ISource, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a GetSourceRequest message from the specified reader or buffer. + * Decodes a Source message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns GetSourceRequest + * @returns Source * @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.cloud.securitycenter.v1beta1.GetSourceRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1beta1.Source; /** - * Decodes a GetSourceRequest message from the specified reader or buffer, length delimited. + * Decodes a Source message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns GetSourceRequest + * @returns Source * @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.cloud.securitycenter.v1beta1.GetSourceRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1beta1.Source; /** - * Verifies a GetSourceRequest message. + * Verifies a Source 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 GetSourceRequest message from a plain object. Also converts values to their respective internal types. + * Creates a Source message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns GetSourceRequest + * @returns Source */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1beta1.GetSourceRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1beta1.Source; /** - * Creates a plain object from a GetSourceRequest message. Also converts values to other types if specified. - * @param message GetSourceRequest + * Creates a plain object from a Source message. Also converts values to other types if specified. + * @param message Source * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.securitycenter.v1beta1.GetSourceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.securitycenter.v1beta1.Source, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this GetSourceRequest to JSON. + * Converts this Source to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a GroupAssetsRequest. */ - interface IGroupAssetsRequest { - - /** GroupAssetsRequest parent */ - parent?: (string|null); - - /** GroupAssetsRequest filter */ - filter?: (string|null); - - /** GroupAssetsRequest groupBy */ - groupBy?: (string|null); - - /** GroupAssetsRequest compareDuration */ - compareDuration?: (google.protobuf.IDuration|null); - - /** GroupAssetsRequest readTime */ - readTime?: (google.protobuf.ITimestamp|null); + /** Properties of a RunAssetDiscoveryResponse. */ + interface IRunAssetDiscoveryResponse { - /** GroupAssetsRequest pageToken */ - pageToken?: (string|null); + /** RunAssetDiscoveryResponse state */ + state?: (google.cloud.securitycenter.v1beta1.RunAssetDiscoveryResponse.State|null); - /** GroupAssetsRequest pageSize */ - pageSize?: (number|null); + /** RunAssetDiscoveryResponse duration */ + duration?: (google.protobuf.IDuration|null); } - /** Represents a GroupAssetsRequest. */ - class GroupAssetsRequest implements IGroupAssetsRequest { + /** Represents a RunAssetDiscoveryResponse. */ + class RunAssetDiscoveryResponse implements IRunAssetDiscoveryResponse { /** - * Constructs a new GroupAssetsRequest. + * Constructs a new RunAssetDiscoveryResponse. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.securitycenter.v1beta1.IGroupAssetsRequest); - - /** GroupAssetsRequest parent. */ - public parent: string; + constructor(properties?: google.cloud.securitycenter.v1beta1.IRunAssetDiscoveryResponse); - /** GroupAssetsRequest filter. */ - public filter: string; - - /** GroupAssetsRequest groupBy. */ - public groupBy: string; - - /** GroupAssetsRequest compareDuration. */ - public compareDuration?: (google.protobuf.IDuration|null); - - /** GroupAssetsRequest readTime. */ - public readTime?: (google.protobuf.ITimestamp|null); - - /** GroupAssetsRequest pageToken. */ - public pageToken: string; + /** RunAssetDiscoveryResponse state. */ + public state: google.cloud.securitycenter.v1beta1.RunAssetDiscoveryResponse.State; - /** GroupAssetsRequest pageSize. */ - public pageSize: number; + /** RunAssetDiscoveryResponse duration. */ + public duration?: (google.protobuf.IDuration|null); /** - * Creates a new GroupAssetsRequest instance using the specified properties. + * Creates a new RunAssetDiscoveryResponse instance using the specified properties. * @param [properties] Properties to set - * @returns GroupAssetsRequest instance + * @returns RunAssetDiscoveryResponse instance */ - public static create(properties?: google.cloud.securitycenter.v1beta1.IGroupAssetsRequest): google.cloud.securitycenter.v1beta1.GroupAssetsRequest; + public static create(properties?: google.cloud.securitycenter.v1beta1.IRunAssetDiscoveryResponse): google.cloud.securitycenter.v1beta1.RunAssetDiscoveryResponse; /** - * Encodes the specified GroupAssetsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.GroupAssetsRequest.verify|verify} messages. - * @param message GroupAssetsRequest message or plain object to encode + * Encodes the specified RunAssetDiscoveryResponse message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.RunAssetDiscoveryResponse.verify|verify} messages. + * @param message RunAssetDiscoveryResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.securitycenter.v1beta1.IGroupAssetsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.securitycenter.v1beta1.IRunAssetDiscoveryResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified GroupAssetsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.GroupAssetsRequest.verify|verify} messages. - * @param message GroupAssetsRequest message or plain object to encode + * Encodes the specified RunAssetDiscoveryResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.RunAssetDiscoveryResponse.verify|verify} messages. + * @param message RunAssetDiscoveryResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.securitycenter.v1beta1.IGroupAssetsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.securitycenter.v1beta1.IRunAssetDiscoveryResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a GroupAssetsRequest message from the specified reader or buffer. + * Decodes a RunAssetDiscoveryResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns GroupAssetsRequest + * @returns RunAssetDiscoveryResponse * @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.cloud.securitycenter.v1beta1.GroupAssetsRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1beta1.RunAssetDiscoveryResponse; /** - * Decodes a GroupAssetsRequest message from the specified reader or buffer, length delimited. + * Decodes a RunAssetDiscoveryResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns GroupAssetsRequest + * @returns RunAssetDiscoveryResponse * @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.cloud.securitycenter.v1beta1.GroupAssetsRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1beta1.RunAssetDiscoveryResponse; /** - * Verifies a GroupAssetsRequest message. + * Verifies a RunAssetDiscoveryResponse 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 GroupAssetsRequest message from a plain object. Also converts values to their respective internal types. + * Creates a RunAssetDiscoveryResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns GroupAssetsRequest + * @returns RunAssetDiscoveryResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1beta1.GroupAssetsRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1beta1.RunAssetDiscoveryResponse; /** - * Creates a plain object from a GroupAssetsRequest message. Also converts values to other types if specified. - * @param message GroupAssetsRequest + * Creates a plain object from a RunAssetDiscoveryResponse message. Also converts values to other types if specified. + * @param message RunAssetDiscoveryResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.securitycenter.v1beta1.GroupAssetsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.securitycenter.v1beta1.RunAssetDiscoveryResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this GroupAssetsRequest to JSON. + * Converts this RunAssetDiscoveryResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a GroupAssetsResponse. */ - interface IGroupAssetsResponse { + namespace RunAssetDiscoveryResponse { - /** GroupAssetsResponse groupByResults */ - groupByResults?: (google.cloud.securitycenter.v1beta1.IGroupResult[]|null); + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + COMPLETED = 1, + SUPERSEDED = 2, + TERMINATED = 3 + } + } - /** GroupAssetsResponse readTime */ - readTime?: (google.protobuf.ITimestamp|null); + /** Properties of an OrganizationSettings. */ + interface IOrganizationSettings { - /** GroupAssetsResponse nextPageToken */ - nextPageToken?: (string|null); + /** OrganizationSettings name */ + name?: (string|null); + + /** OrganizationSettings enableAssetDiscovery */ + enableAssetDiscovery?: (boolean|null); + + /** OrganizationSettings assetDiscoveryConfig */ + assetDiscoveryConfig?: (google.cloud.securitycenter.v1beta1.OrganizationSettings.IAssetDiscoveryConfig|null); } - /** Represents a GroupAssetsResponse. */ - class GroupAssetsResponse implements IGroupAssetsResponse { + /** Represents an OrganizationSettings. */ + class OrganizationSettings implements IOrganizationSettings { /** - * Constructs a new GroupAssetsResponse. + * Constructs a new OrganizationSettings. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.securitycenter.v1beta1.IGroupAssetsResponse); + constructor(properties?: google.cloud.securitycenter.v1beta1.IOrganizationSettings); - /** GroupAssetsResponse groupByResults. */ - public groupByResults: google.cloud.securitycenter.v1beta1.IGroupResult[]; + /** OrganizationSettings name. */ + public name: string; - /** GroupAssetsResponse readTime. */ - public readTime?: (google.protobuf.ITimestamp|null); + /** OrganizationSettings enableAssetDiscovery. */ + public enableAssetDiscovery: boolean; - /** GroupAssetsResponse nextPageToken. */ - public nextPageToken: string; + /** OrganizationSettings assetDiscoveryConfig. */ + public assetDiscoveryConfig?: (google.cloud.securitycenter.v1beta1.OrganizationSettings.IAssetDiscoveryConfig|null); /** - * Creates a new GroupAssetsResponse instance using the specified properties. + * Creates a new OrganizationSettings instance using the specified properties. * @param [properties] Properties to set - * @returns GroupAssetsResponse instance + * @returns OrganizationSettings instance */ - public static create(properties?: google.cloud.securitycenter.v1beta1.IGroupAssetsResponse): google.cloud.securitycenter.v1beta1.GroupAssetsResponse; + public static create(properties?: google.cloud.securitycenter.v1beta1.IOrganizationSettings): google.cloud.securitycenter.v1beta1.OrganizationSettings; /** - * Encodes the specified GroupAssetsResponse message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.GroupAssetsResponse.verify|verify} messages. - * @param message GroupAssetsResponse message or plain object to encode + * Encodes the specified OrganizationSettings message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.OrganizationSettings.verify|verify} messages. + * @param message OrganizationSettings message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.securitycenter.v1beta1.IGroupAssetsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.securitycenter.v1beta1.IOrganizationSettings, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified GroupAssetsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.GroupAssetsResponse.verify|verify} messages. - * @param message GroupAssetsResponse message or plain object to encode + * Encodes the specified OrganizationSettings message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.OrganizationSettings.verify|verify} messages. + * @param message OrganizationSettings message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.securitycenter.v1beta1.IGroupAssetsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.securitycenter.v1beta1.IOrganizationSettings, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a GroupAssetsResponse message from the specified reader or buffer. + * Decodes an OrganizationSettings message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns GroupAssetsResponse + * @returns OrganizationSettings * @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.cloud.securitycenter.v1beta1.GroupAssetsResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1beta1.OrganizationSettings; /** - * Decodes a GroupAssetsResponse message from the specified reader or buffer, length delimited. + * Decodes an OrganizationSettings message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns GroupAssetsResponse + * @returns OrganizationSettings * @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.cloud.securitycenter.v1beta1.GroupAssetsResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1beta1.OrganizationSettings; /** - * Verifies a GroupAssetsResponse message. + * Verifies an OrganizationSettings 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 GroupAssetsResponse message from a plain object. Also converts values to their respective internal types. + * Creates an OrganizationSettings message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns GroupAssetsResponse + * @returns OrganizationSettings */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1beta1.GroupAssetsResponse; + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1beta1.OrganizationSettings; /** - * Creates a plain object from a GroupAssetsResponse message. Also converts values to other types if specified. - * @param message GroupAssetsResponse + * Creates a plain object from an OrganizationSettings message. Also converts values to other types if specified. + * @param message OrganizationSettings * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.securitycenter.v1beta1.GroupAssetsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.securitycenter.v1beta1.OrganizationSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this GroupAssetsResponse to JSON. + * Converts this OrganizationSettings to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a GroupFindingsRequest. */ - interface IGroupFindingsRequest { + namespace OrganizationSettings { - /** GroupFindingsRequest parent */ - parent?: (string|null); + /** Properties of an AssetDiscoveryConfig. */ + interface IAssetDiscoveryConfig { - /** GroupFindingsRequest filter */ - filter?: (string|null); + /** AssetDiscoveryConfig projectIds */ + projectIds?: (string[]|null); - /** GroupFindingsRequest groupBy */ - groupBy?: (string|null); + /** AssetDiscoveryConfig inclusionMode */ + inclusionMode?: (google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode|null); + } - /** GroupFindingsRequest readTime */ - readTime?: (google.protobuf.ITimestamp|null); + /** Represents an AssetDiscoveryConfig. */ + class AssetDiscoveryConfig implements IAssetDiscoveryConfig { - /** GroupFindingsRequest pageToken */ - pageToken?: (string|null); + /** + * Constructs a new AssetDiscoveryConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1beta1.OrganizationSettings.IAssetDiscoveryConfig); - /** GroupFindingsRequest pageSize */ - pageSize?: (number|null); - } + /** AssetDiscoveryConfig projectIds. */ + public projectIds: string[]; - /** Represents a GroupFindingsRequest. */ - class GroupFindingsRequest implements IGroupFindingsRequest { + /** AssetDiscoveryConfig inclusionMode. */ + public inclusionMode: google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode; - /** - * Constructs a new GroupFindingsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v1beta1.IGroupFindingsRequest); + /** + * Creates a new AssetDiscoveryConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns AssetDiscoveryConfig instance + */ + public static create(properties?: google.cloud.securitycenter.v1beta1.OrganizationSettings.IAssetDiscoveryConfig): google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig; - /** GroupFindingsRequest parent. */ - public parent: string; + /** + * Encodes the specified AssetDiscoveryConfig message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig.verify|verify} messages. + * @param message AssetDiscoveryConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1beta1.OrganizationSettings.IAssetDiscoveryConfig, writer?: $protobuf.Writer): $protobuf.Writer; - /** GroupFindingsRequest filter. */ - public filter: string; + /** + * Encodes the specified AssetDiscoveryConfig message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig.verify|verify} messages. + * @param message AssetDiscoveryConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1beta1.OrganizationSettings.IAssetDiscoveryConfig, writer?: $protobuf.Writer): $protobuf.Writer; - /** GroupFindingsRequest groupBy. */ - public groupBy: string; + /** + * Decodes an AssetDiscoveryConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AssetDiscoveryConfig + * @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.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig; - /** GroupFindingsRequest readTime. */ - public readTime?: (google.protobuf.ITimestamp|null); + /** + * Decodes an AssetDiscoveryConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AssetDiscoveryConfig + * @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.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig; - /** GroupFindingsRequest pageToken. */ - public pageToken: string; + /** + * Verifies an AssetDiscoveryConfig 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); - /** GroupFindingsRequest pageSize. */ - public pageSize: number; + /** + * Creates an AssetDiscoveryConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AssetDiscoveryConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig; - /** - * Creates a new GroupFindingsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GroupFindingsRequest instance - */ - public static create(properties?: google.cloud.securitycenter.v1beta1.IGroupFindingsRequest): google.cloud.securitycenter.v1beta1.GroupFindingsRequest; + /** + * Creates a plain object from an AssetDiscoveryConfig message. Also converts values to other types if specified. + * @param message AssetDiscoveryConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Encodes the specified GroupFindingsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.GroupFindingsRequest.verify|verify} messages. - * @param message GroupFindingsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v1beta1.IGroupFindingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Converts this AssetDiscoveryConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Encodes the specified GroupFindingsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.GroupFindingsRequest.verify|verify} messages. - * @param message GroupFindingsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v1beta1.IGroupFindingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + namespace AssetDiscoveryConfig { - /** - * Decodes a GroupFindingsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GroupFindingsRequest - * @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.cloud.securitycenter.v1beta1.GroupFindingsRequest; + /** InclusionMode enum. */ + enum InclusionMode { + INCLUSION_MODE_UNSPECIFIED = 0, + INCLUDE_ONLY = 1, + EXCLUDE = 2 + } + } + } + + /** Represents a SecurityCenter */ + class SecurityCenter extends $protobuf.rpc.Service { /** - * Decodes a GroupFindingsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GroupFindingsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Constructs a new SecurityCenter service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1beta1.GroupFindingsRequest; + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); /** - * Verifies a GroupFindingsRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not + * Creates new SecurityCenter 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 verify(message: { [k: string]: any }): (string|null); + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): SecurityCenter; /** - * Creates a GroupFindingsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GroupFindingsRequest + * Calls CreateSource. + * @param request CreateSourceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Source */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1beta1.GroupFindingsRequest; + public createSource(request: google.cloud.securitycenter.v1beta1.ICreateSourceRequest, callback: google.cloud.securitycenter.v1beta1.SecurityCenter.CreateSourceCallback): void; /** - * Creates a plain object from a GroupFindingsRequest message. Also converts values to other types if specified. - * @param message GroupFindingsRequest - * @param [options] Conversion options - * @returns Plain object + * Calls CreateSource. + * @param request CreateSourceRequest message or plain object + * @returns Promise */ - public static toObject(message: google.cloud.securitycenter.v1beta1.GroupFindingsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public createSource(request: google.cloud.securitycenter.v1beta1.ICreateSourceRequest): Promise; /** - * Converts this GroupFindingsRequest to JSON. - * @returns JSON object + * Calls CreateFinding. + * @param request CreateFindingRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Finding */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a GroupFindingsResponse. */ - interface IGroupFindingsResponse { - - /** GroupFindingsResponse groupByResults */ - groupByResults?: (google.cloud.securitycenter.v1beta1.IGroupResult[]|null); - - /** GroupFindingsResponse readTime */ - readTime?: (google.protobuf.ITimestamp|null); - - /** GroupFindingsResponse nextPageToken */ - nextPageToken?: (string|null); - } - - /** Represents a GroupFindingsResponse. */ - class GroupFindingsResponse implements IGroupFindingsResponse { + public createFinding(request: google.cloud.securitycenter.v1beta1.ICreateFindingRequest, callback: google.cloud.securitycenter.v1beta1.SecurityCenter.CreateFindingCallback): void; /** - * Constructs a new GroupFindingsResponse. - * @param [properties] Properties to set + * Calls CreateFinding. + * @param request CreateFindingRequest message or plain object + * @returns Promise */ - constructor(properties?: google.cloud.securitycenter.v1beta1.IGroupFindingsResponse); - - /** GroupFindingsResponse groupByResults. */ - public groupByResults: google.cloud.securitycenter.v1beta1.IGroupResult[]; - - /** GroupFindingsResponse readTime. */ - public readTime?: (google.protobuf.ITimestamp|null); - - /** GroupFindingsResponse nextPageToken. */ - public nextPageToken: string; + public createFinding(request: google.cloud.securitycenter.v1beta1.ICreateFindingRequest): Promise; /** - * Creates a new GroupFindingsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns GroupFindingsResponse instance + * Calls GetIamPolicy. + * @param request GetIamPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Policy */ - public static create(properties?: google.cloud.securitycenter.v1beta1.IGroupFindingsResponse): google.cloud.securitycenter.v1beta1.GroupFindingsResponse; + public getIamPolicy(request: google.iam.v1.IGetIamPolicyRequest, callback: google.cloud.securitycenter.v1beta1.SecurityCenter.GetIamPolicyCallback): void; /** - * Encodes the specified GroupFindingsResponse message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.GroupFindingsResponse.verify|verify} messages. - * @param message GroupFindingsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer + * Calls GetIamPolicy. + * @param request GetIamPolicyRequest message or plain object + * @returns Promise */ - public static encode(message: google.cloud.securitycenter.v1beta1.IGroupFindingsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public getIamPolicy(request: google.iam.v1.IGetIamPolicyRequest): Promise; /** - * Encodes the specified GroupFindingsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.GroupFindingsResponse.verify|verify} messages. - * @param message GroupFindingsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer + * Calls GetOrganizationSettings. + * @param request GetOrganizationSettingsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and OrganizationSettings */ - public static encodeDelimited(message: google.cloud.securitycenter.v1beta1.IGroupFindingsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public getOrganizationSettings(request: google.cloud.securitycenter.v1beta1.IGetOrganizationSettingsRequest, callback: google.cloud.securitycenter.v1beta1.SecurityCenter.GetOrganizationSettingsCallback): void; /** - * Decodes a GroupFindingsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GroupFindingsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Calls GetOrganizationSettings. + * @param request GetOrganizationSettingsRequest message or plain object + * @returns Promise */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1beta1.GroupFindingsResponse; + public getOrganizationSettings(request: google.cloud.securitycenter.v1beta1.IGetOrganizationSettingsRequest): Promise; /** - * Decodes a GroupFindingsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GroupFindingsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Calls GetSource. + * @param request GetSourceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Source */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1beta1.GroupFindingsResponse; + public getSource(request: google.cloud.securitycenter.v1beta1.IGetSourceRequest, callback: google.cloud.securitycenter.v1beta1.SecurityCenter.GetSourceCallback): void; /** - * Verifies a GroupFindingsResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not + * Calls GetSource. + * @param request GetSourceRequest message or plain object + * @returns Promise */ - public static verify(message: { [k: string]: any }): (string|null); + public getSource(request: google.cloud.securitycenter.v1beta1.IGetSourceRequest): Promise; /** - * Creates a GroupFindingsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GroupFindingsResponse + * Calls GroupAssets. + * @param request GroupAssetsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and GroupAssetsResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1beta1.GroupFindingsResponse; + public groupAssets(request: google.cloud.securitycenter.v1beta1.IGroupAssetsRequest, callback: google.cloud.securitycenter.v1beta1.SecurityCenter.GroupAssetsCallback): void; /** - * Creates a plain object from a GroupFindingsResponse message. Also converts values to other types if specified. - * @param message GroupFindingsResponse - * @param [options] Conversion options - * @returns Plain object + * Calls GroupAssets. + * @param request GroupAssetsRequest message or plain object + * @returns Promise */ - public static toObject(message: google.cloud.securitycenter.v1beta1.GroupFindingsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public groupAssets(request: google.cloud.securitycenter.v1beta1.IGroupAssetsRequest): Promise; /** - * Converts this GroupFindingsResponse to JSON. - * @returns JSON object + * Calls GroupFindings. + * @param request GroupFindingsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and GroupFindingsResponse */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a GroupResult. */ - interface IGroupResult { - - /** GroupResult properties */ - properties?: ({ [k: string]: google.protobuf.IValue }|null); - - /** GroupResult count */ - count?: (number|Long|null); - } - - /** Represents a GroupResult. */ - class GroupResult implements IGroupResult { + public groupFindings(request: google.cloud.securitycenter.v1beta1.IGroupFindingsRequest, callback: google.cloud.securitycenter.v1beta1.SecurityCenter.GroupFindingsCallback): void; /** - * Constructs a new GroupResult. - * @param [properties] Properties to set + * Calls GroupFindings. + * @param request GroupFindingsRequest message or plain object + * @returns Promise */ - constructor(properties?: google.cloud.securitycenter.v1beta1.IGroupResult); - - /** GroupResult properties. */ - public properties: { [k: string]: google.protobuf.IValue }; - - /** GroupResult count. */ - public count: (number|Long); + public groupFindings(request: google.cloud.securitycenter.v1beta1.IGroupFindingsRequest): Promise; /** - * Creates a new GroupResult instance using the specified properties. - * @param [properties] Properties to set - * @returns GroupResult instance + * Calls ListAssets. + * @param request ListAssetsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListAssetsResponse */ - public static create(properties?: google.cloud.securitycenter.v1beta1.IGroupResult): google.cloud.securitycenter.v1beta1.GroupResult; + public listAssets(request: google.cloud.securitycenter.v1beta1.IListAssetsRequest, callback: google.cloud.securitycenter.v1beta1.SecurityCenter.ListAssetsCallback): void; /** - * Encodes the specified GroupResult message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.GroupResult.verify|verify} messages. - * @param message GroupResult message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer + * Calls ListAssets. + * @param request ListAssetsRequest message or plain object + * @returns Promise */ - public static encode(message: google.cloud.securitycenter.v1beta1.IGroupResult, writer?: $protobuf.Writer): $protobuf.Writer; + public listAssets(request: google.cloud.securitycenter.v1beta1.IListAssetsRequest): Promise; /** - * Encodes the specified GroupResult message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.GroupResult.verify|verify} messages. - * @param message GroupResult message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer + * Calls ListFindings. + * @param request ListFindingsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListFindingsResponse */ - public static encodeDelimited(message: google.cloud.securitycenter.v1beta1.IGroupResult, writer?: $protobuf.Writer): $protobuf.Writer; + public listFindings(request: google.cloud.securitycenter.v1beta1.IListFindingsRequest, callback: google.cloud.securitycenter.v1beta1.SecurityCenter.ListFindingsCallback): void; /** - * Decodes a GroupResult message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GroupResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Calls ListFindings. + * @param request ListFindingsRequest message or plain object + * @returns Promise */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1beta1.GroupResult; + public listFindings(request: google.cloud.securitycenter.v1beta1.IListFindingsRequest): Promise; /** - * Decodes a GroupResult message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GroupResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Calls ListSources. + * @param request ListSourcesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListSourcesResponse */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1beta1.GroupResult; + public listSources(request: google.cloud.securitycenter.v1beta1.IListSourcesRequest, callback: google.cloud.securitycenter.v1beta1.SecurityCenter.ListSourcesCallback): void; /** - * Verifies a GroupResult message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not + * Calls ListSources. + * @param request ListSourcesRequest message or plain object + * @returns Promise */ - public static verify(message: { [k: string]: any }): (string|null); + public listSources(request: google.cloud.securitycenter.v1beta1.IListSourcesRequest): Promise; /** - * Creates a GroupResult message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GroupResult + * Calls RunAssetDiscovery. + * @param request RunAssetDiscoveryRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1beta1.GroupResult; + public runAssetDiscovery(request: google.cloud.securitycenter.v1beta1.IRunAssetDiscoveryRequest, callback: google.cloud.securitycenter.v1beta1.SecurityCenter.RunAssetDiscoveryCallback): void; /** - * Creates a plain object from a GroupResult message. Also converts values to other types if specified. - * @param message GroupResult - * @param [options] Conversion options - * @returns Plain object + * Calls RunAssetDiscovery. + * @param request RunAssetDiscoveryRequest message or plain object + * @returns Promise */ - public static toObject(message: google.cloud.securitycenter.v1beta1.GroupResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public runAssetDiscovery(request: google.cloud.securitycenter.v1beta1.IRunAssetDiscoveryRequest): Promise; /** - * Converts this GroupResult to JSON. - * @returns JSON object + * Calls SetFindingState. + * @param request SetFindingStateRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Finding */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a ListSourcesRequest. */ - interface IListSourcesRequest { - - /** ListSourcesRequest parent */ - parent?: (string|null); - - /** ListSourcesRequest pageToken */ - pageToken?: (string|null); - - /** ListSourcesRequest pageSize */ - pageSize?: (number|null); - } - - /** Represents a ListSourcesRequest. */ - class ListSourcesRequest implements IListSourcesRequest { + public setFindingState(request: google.cloud.securitycenter.v1beta1.ISetFindingStateRequest, callback: google.cloud.securitycenter.v1beta1.SecurityCenter.SetFindingStateCallback): void; /** - * Constructs a new ListSourcesRequest. - * @param [properties] Properties to set + * Calls SetFindingState. + * @param request SetFindingStateRequest message or plain object + * @returns Promise */ - constructor(properties?: google.cloud.securitycenter.v1beta1.IListSourcesRequest); - - /** ListSourcesRequest parent. */ - public parent: string; - - /** ListSourcesRequest pageToken. */ - public pageToken: string; - - /** ListSourcesRequest pageSize. */ - public pageSize: number; + public setFindingState(request: google.cloud.securitycenter.v1beta1.ISetFindingStateRequest): Promise; /** - * Creates a new ListSourcesRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListSourcesRequest instance + * Calls SetIamPolicy. + * @param request SetIamPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Policy */ - public static create(properties?: google.cloud.securitycenter.v1beta1.IListSourcesRequest): google.cloud.securitycenter.v1beta1.ListSourcesRequest; + public setIamPolicy(request: google.iam.v1.ISetIamPolicyRequest, callback: google.cloud.securitycenter.v1beta1.SecurityCenter.SetIamPolicyCallback): void; /** - * Encodes the specified ListSourcesRequest message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.ListSourcesRequest.verify|verify} messages. - * @param message ListSourcesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer + * Calls SetIamPolicy. + * @param request SetIamPolicyRequest message or plain object + * @returns Promise */ - public static encode(message: google.cloud.securitycenter.v1beta1.IListSourcesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public setIamPolicy(request: google.iam.v1.ISetIamPolicyRequest): Promise; /** - * Encodes the specified ListSourcesRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.ListSourcesRequest.verify|verify} messages. - * @param message ListSourcesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer + * Calls TestIamPermissions. + * @param request TestIamPermissionsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and TestIamPermissionsResponse */ - public static encodeDelimited(message: google.cloud.securitycenter.v1beta1.IListSourcesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public testIamPermissions(request: google.iam.v1.ITestIamPermissionsRequest, callback: google.cloud.securitycenter.v1beta1.SecurityCenter.TestIamPermissionsCallback): void; /** - * Decodes a ListSourcesRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListSourcesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Calls TestIamPermissions. + * @param request TestIamPermissionsRequest message or plain object + * @returns Promise */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1beta1.ListSourcesRequest; + public testIamPermissions(request: google.iam.v1.ITestIamPermissionsRequest): Promise; /** - * Decodes a ListSourcesRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListSourcesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Calls UpdateFinding. + * @param request UpdateFindingRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Finding */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1beta1.ListSourcesRequest; + public updateFinding(request: google.cloud.securitycenter.v1beta1.IUpdateFindingRequest, callback: google.cloud.securitycenter.v1beta1.SecurityCenter.UpdateFindingCallback): void; /** - * Verifies a ListSourcesRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not + * Calls UpdateFinding. + * @param request UpdateFindingRequest message or plain object + * @returns Promise */ - public static verify(message: { [k: string]: any }): (string|null); + public updateFinding(request: google.cloud.securitycenter.v1beta1.IUpdateFindingRequest): Promise; /** - * Creates a ListSourcesRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListSourcesRequest + * Calls UpdateOrganizationSettings. + * @param request UpdateOrganizationSettingsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and OrganizationSettings */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1beta1.ListSourcesRequest; + public updateOrganizationSettings(request: google.cloud.securitycenter.v1beta1.IUpdateOrganizationSettingsRequest, callback: google.cloud.securitycenter.v1beta1.SecurityCenter.UpdateOrganizationSettingsCallback): void; /** - * Creates a plain object from a ListSourcesRequest message. Also converts values to other types if specified. - * @param message ListSourcesRequest - * @param [options] Conversion options - * @returns Plain object + * Calls UpdateOrganizationSettings. + * @param request UpdateOrganizationSettingsRequest message or plain object + * @returns Promise */ - public static toObject(message: google.cloud.securitycenter.v1beta1.ListSourcesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public updateOrganizationSettings(request: google.cloud.securitycenter.v1beta1.IUpdateOrganizationSettingsRequest): Promise; /** - * Converts this ListSourcesRequest to JSON. - * @returns JSON object + * Calls UpdateSource. + * @param request UpdateSourceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Source */ - public toJSON(): { [k: string]: any }; - } + public updateSource(request: google.cloud.securitycenter.v1beta1.IUpdateSourceRequest, callback: google.cloud.securitycenter.v1beta1.SecurityCenter.UpdateSourceCallback): void; - /** Properties of a ListSourcesResponse. */ - interface IListSourcesResponse { + /** + * Calls UpdateSource. + * @param request UpdateSourceRequest message or plain object + * @returns Promise + */ + public updateSource(request: google.cloud.securitycenter.v1beta1.IUpdateSourceRequest): Promise; - /** ListSourcesResponse sources */ - sources?: (google.cloud.securitycenter.v1beta1.ISource[]|null); + /** + * Calls UpdateSecurityMarks. + * @param request UpdateSecurityMarksRequest message or plain object + * @param callback Node-style callback called with the error, if any, and SecurityMarks + */ + public updateSecurityMarks(request: google.cloud.securitycenter.v1beta1.IUpdateSecurityMarksRequest, callback: google.cloud.securitycenter.v1beta1.SecurityCenter.UpdateSecurityMarksCallback): void; - /** ListSourcesResponse nextPageToken */ - nextPageToken?: (string|null); + /** + * Calls UpdateSecurityMarks. + * @param request UpdateSecurityMarksRequest message or plain object + * @returns Promise + */ + public updateSecurityMarks(request: google.cloud.securitycenter.v1beta1.IUpdateSecurityMarksRequest): Promise; } - /** Represents a ListSourcesResponse. */ - class ListSourcesResponse implements IListSourcesResponse { + namespace SecurityCenter { /** - * Constructs a new ListSourcesResponse. - * @param [properties] Properties to set + * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter#createSource}. + * @param error Error, if any + * @param [response] Source */ - constructor(properties?: google.cloud.securitycenter.v1beta1.IListSourcesResponse); - - /** ListSourcesResponse sources. */ - public sources: google.cloud.securitycenter.v1beta1.ISource[]; - - /** ListSourcesResponse nextPageToken. */ - public nextPageToken: string; + type CreateSourceCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1beta1.Source) => void; /** - * Creates a new ListSourcesResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListSourcesResponse instance + * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter#createFinding}. + * @param error Error, if any + * @param [response] Finding */ - public static create(properties?: google.cloud.securitycenter.v1beta1.IListSourcesResponse): google.cloud.securitycenter.v1beta1.ListSourcesResponse; + type CreateFindingCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1beta1.Finding) => void; /** - * Encodes the specified ListSourcesResponse message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.ListSourcesResponse.verify|verify} messages. - * @param message ListSourcesResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer + * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter#getIamPolicy}. + * @param error Error, if any + * @param [response] Policy */ - public static encode(message: google.cloud.securitycenter.v1beta1.IListSourcesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + type GetIamPolicyCallback = (error: (Error|null), response?: google.iam.v1.Policy) => void; /** - * Encodes the specified ListSourcesResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.ListSourcesResponse.verify|verify} messages. - * @param message ListSourcesResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer + * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter#getOrganizationSettings}. + * @param error Error, if any + * @param [response] OrganizationSettings */ - public static encodeDelimited(message: google.cloud.securitycenter.v1beta1.IListSourcesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + type GetOrganizationSettingsCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1beta1.OrganizationSettings) => void; /** - * Decodes a ListSourcesResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListSourcesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter#getSource}. + * @param error Error, if any + * @param [response] Source */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1beta1.ListSourcesResponse; + type GetSourceCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1beta1.Source) => void; /** - * Decodes a ListSourcesResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListSourcesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter#groupAssets}. + * @param error Error, if any + * @param [response] GroupAssetsResponse */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1beta1.ListSourcesResponse; + type GroupAssetsCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1beta1.GroupAssetsResponse) => void; /** - * Verifies a ListSourcesResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not + * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter#groupFindings}. + * @param error Error, if any + * @param [response] GroupFindingsResponse */ - public static verify(message: { [k: string]: any }): (string|null); + type GroupFindingsCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1beta1.GroupFindingsResponse) => void; /** - * Creates a ListSourcesResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListSourcesResponse + * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter#listAssets}. + * @param error Error, if any + * @param [response] ListAssetsResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1beta1.ListSourcesResponse; + type ListAssetsCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1beta1.ListAssetsResponse) => void; /** - * Creates a plain object from a ListSourcesResponse message. Also converts values to other types if specified. - * @param message ListSourcesResponse - * @param [options] Conversion options - * @returns Plain object + * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter#listFindings}. + * @param error Error, if any + * @param [response] ListFindingsResponse */ - public static toObject(message: google.cloud.securitycenter.v1beta1.ListSourcesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + type ListFindingsCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1beta1.ListFindingsResponse) => void; /** - * Converts this ListSourcesResponse to JSON. - * @returns JSON object + * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter#listSources}. + * @param error Error, if any + * @param [response] ListSourcesResponse */ - public toJSON(): { [k: string]: any }; - } + type ListSourcesCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1beta1.ListSourcesResponse) => void; - /** Properties of a ListAssetsRequest. */ - interface IListAssetsRequest { + /** + * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter#runAssetDiscovery}. + * @param error Error, if any + * @param [response] Operation + */ + type RunAssetDiscoveryCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - /** ListAssetsRequest parent */ - parent?: (string|null); + /** + * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter#setFindingState}. + * @param error Error, if any + * @param [response] Finding + */ + type SetFindingStateCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1beta1.Finding) => void; - /** ListAssetsRequest filter */ - filter?: (string|null); + /** + * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter#setIamPolicy}. + * @param error Error, if any + * @param [response] Policy + */ + type SetIamPolicyCallback = (error: (Error|null), response?: google.iam.v1.Policy) => void; - /** ListAssetsRequest orderBy */ - orderBy?: (string|null); + /** + * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter#testIamPermissions}. + * @param error Error, if any + * @param [response] TestIamPermissionsResponse + */ + type TestIamPermissionsCallback = (error: (Error|null), response?: google.iam.v1.TestIamPermissionsResponse) => void; - /** ListAssetsRequest readTime */ - readTime?: (google.protobuf.ITimestamp|null); + /** + * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter#updateFinding}. + * @param error Error, if any + * @param [response] Finding + */ + type UpdateFindingCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1beta1.Finding) => void; - /** ListAssetsRequest compareDuration */ - compareDuration?: (google.protobuf.IDuration|null); + /** + * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter#updateOrganizationSettings}. + * @param error Error, if any + * @param [response] OrganizationSettings + */ + type UpdateOrganizationSettingsCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1beta1.OrganizationSettings) => void; - /** ListAssetsRequest fieldMask */ - fieldMask?: (google.protobuf.IFieldMask|null); + /** + * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter#updateSource}. + * @param error Error, if any + * @param [response] Source + */ + type UpdateSourceCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1beta1.Source) => void; - /** ListAssetsRequest pageToken */ - pageToken?: (string|null); + /** + * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter#updateSecurityMarks}. + * @param error Error, if any + * @param [response] SecurityMarks + */ + type UpdateSecurityMarksCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1beta1.SecurityMarks) => void; + } - /** ListAssetsRequest pageSize */ - pageSize?: (number|null); + /** Properties of a CreateFindingRequest. */ + interface ICreateFindingRequest { + + /** CreateFindingRequest parent */ + parent?: (string|null); + + /** CreateFindingRequest findingId */ + findingId?: (string|null); + + /** CreateFindingRequest finding */ + finding?: (google.cloud.securitycenter.v1beta1.IFinding|null); } - /** Represents a ListAssetsRequest. */ - class ListAssetsRequest implements IListAssetsRequest { + /** Represents a CreateFindingRequest. */ + class CreateFindingRequest implements ICreateFindingRequest { /** - * Constructs a new ListAssetsRequest. + * Constructs a new CreateFindingRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.securitycenter.v1beta1.IListAssetsRequest); + constructor(properties?: google.cloud.securitycenter.v1beta1.ICreateFindingRequest); - /** ListAssetsRequest parent. */ + /** CreateFindingRequest parent. */ public parent: string; - /** ListAssetsRequest filter. */ - public filter: string; - - /** ListAssetsRequest orderBy. */ - public orderBy: string; - - /** ListAssetsRequest readTime. */ - public readTime?: (google.protobuf.ITimestamp|null); - - /** ListAssetsRequest compareDuration. */ - public compareDuration?: (google.protobuf.IDuration|null); - - /** ListAssetsRequest fieldMask. */ - public fieldMask?: (google.protobuf.IFieldMask|null); - - /** ListAssetsRequest pageToken. */ - public pageToken: string; + /** CreateFindingRequest findingId. */ + public findingId: string; - /** ListAssetsRequest pageSize. */ - public pageSize: number; + /** CreateFindingRequest finding. */ + public finding?: (google.cloud.securitycenter.v1beta1.IFinding|null); /** - * Creates a new ListAssetsRequest instance using the specified properties. + * Creates a new CreateFindingRequest instance using the specified properties. * @param [properties] Properties to set - * @returns ListAssetsRequest instance + * @returns CreateFindingRequest instance */ - public static create(properties?: google.cloud.securitycenter.v1beta1.IListAssetsRequest): google.cloud.securitycenter.v1beta1.ListAssetsRequest; + public static create(properties?: google.cloud.securitycenter.v1beta1.ICreateFindingRequest): google.cloud.securitycenter.v1beta1.CreateFindingRequest; /** - * Encodes the specified ListAssetsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.ListAssetsRequest.verify|verify} messages. - * @param message ListAssetsRequest message or plain object to encode + * Encodes the specified CreateFindingRequest message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.CreateFindingRequest.verify|verify} messages. + * @param message CreateFindingRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.securitycenter.v1beta1.IListAssetsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.securitycenter.v1beta1.ICreateFindingRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ListAssetsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.ListAssetsRequest.verify|verify} messages. - * @param message ListAssetsRequest message or plain object to encode + * Encodes the specified CreateFindingRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.CreateFindingRequest.verify|verify} messages. + * @param message CreateFindingRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.securitycenter.v1beta1.IListAssetsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.securitycenter.v1beta1.ICreateFindingRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ListAssetsRequest message from the specified reader or buffer. + * Decodes a CreateFindingRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ListAssetsRequest + * @returns CreateFindingRequest * @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.cloud.securitycenter.v1beta1.ListAssetsRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1beta1.CreateFindingRequest; /** - * Decodes a ListAssetsRequest message from the specified reader or buffer, length delimited. + * Decodes a CreateFindingRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ListAssetsRequest + * @returns CreateFindingRequest * @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.cloud.securitycenter.v1beta1.ListAssetsRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1beta1.CreateFindingRequest; /** - * Verifies a ListAssetsRequest message. + * Verifies a CreateFindingRequest 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 ListAssetsRequest message from a plain object. Also converts values to their respective internal types. + * Creates a CreateFindingRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ListAssetsRequest + * @returns CreateFindingRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1beta1.ListAssetsRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1beta1.CreateFindingRequest; /** - * Creates a plain object from a ListAssetsRequest message. Also converts values to other types if specified. - * @param message ListAssetsRequest + * Creates a plain object from a CreateFindingRequest message. Also converts values to other types if specified. + * @param message CreateFindingRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.securitycenter.v1beta1.ListAssetsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.securitycenter.v1beta1.CreateFindingRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ListAssetsRequest to JSON. + * Converts this CreateFindingRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a ListAssetsResponse. */ - interface IListAssetsResponse { - - /** ListAssetsResponse listAssetsResults */ - listAssetsResults?: (google.cloud.securitycenter.v1beta1.ListAssetsResponse.IListAssetsResult[]|null); - - /** ListAssetsResponse readTime */ - readTime?: (google.protobuf.ITimestamp|null); + /** Properties of a CreateSourceRequest. */ + interface ICreateSourceRequest { - /** ListAssetsResponse nextPageToken */ - nextPageToken?: (string|null); + /** CreateSourceRequest parent */ + parent?: (string|null); - /** ListAssetsResponse totalSize */ - totalSize?: (number|null); + /** CreateSourceRequest source */ + source?: (google.cloud.securitycenter.v1beta1.ISource|null); } - /** Represents a ListAssetsResponse. */ - class ListAssetsResponse implements IListAssetsResponse { + /** Represents a CreateSourceRequest. */ + class CreateSourceRequest implements ICreateSourceRequest { /** - * Constructs a new ListAssetsResponse. + * Constructs a new CreateSourceRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.securitycenter.v1beta1.IListAssetsResponse); - - /** ListAssetsResponse listAssetsResults. */ - public listAssetsResults: google.cloud.securitycenter.v1beta1.ListAssetsResponse.IListAssetsResult[]; - - /** ListAssetsResponse readTime. */ - public readTime?: (google.protobuf.ITimestamp|null); + constructor(properties?: google.cloud.securitycenter.v1beta1.ICreateSourceRequest); - /** ListAssetsResponse nextPageToken. */ - public nextPageToken: string; + /** CreateSourceRequest parent. */ + public parent: string; - /** ListAssetsResponse totalSize. */ - public totalSize: number; + /** CreateSourceRequest source. */ + public source?: (google.cloud.securitycenter.v1beta1.ISource|null); /** - * Creates a new ListAssetsResponse instance using the specified properties. + * Creates a new CreateSourceRequest instance using the specified properties. * @param [properties] Properties to set - * @returns ListAssetsResponse instance + * @returns CreateSourceRequest instance */ - public static create(properties?: google.cloud.securitycenter.v1beta1.IListAssetsResponse): google.cloud.securitycenter.v1beta1.ListAssetsResponse; + public static create(properties?: google.cloud.securitycenter.v1beta1.ICreateSourceRequest): google.cloud.securitycenter.v1beta1.CreateSourceRequest; /** - * Encodes the specified ListAssetsResponse message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.ListAssetsResponse.verify|verify} messages. - * @param message ListAssetsResponse message or plain object to encode + * Encodes the specified CreateSourceRequest message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.CreateSourceRequest.verify|verify} messages. + * @param message CreateSourceRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.securitycenter.v1beta1.IListAssetsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.securitycenter.v1beta1.ICreateSourceRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ListAssetsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.ListAssetsResponse.verify|verify} messages. - * @param message ListAssetsResponse message or plain object to encode + * Encodes the specified CreateSourceRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.CreateSourceRequest.verify|verify} messages. + * @param message CreateSourceRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.securitycenter.v1beta1.IListAssetsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.securitycenter.v1beta1.ICreateSourceRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ListAssetsResponse message from the specified reader or buffer. + * Decodes a CreateSourceRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ListAssetsResponse + * @returns CreateSourceRequest * @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.cloud.securitycenter.v1beta1.ListAssetsResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1beta1.CreateSourceRequest; /** - * Decodes a ListAssetsResponse message from the specified reader or buffer, length delimited. + * Decodes a CreateSourceRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ListAssetsResponse + * @returns CreateSourceRequest * @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.cloud.securitycenter.v1beta1.ListAssetsResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1beta1.CreateSourceRequest; /** - * Verifies a ListAssetsResponse message. + * Verifies a CreateSourceRequest 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 ListAssetsResponse message from a plain object. Also converts values to their respective internal types. + * Creates a CreateSourceRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ListAssetsResponse + * @returns CreateSourceRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1beta1.ListAssetsResponse; + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1beta1.CreateSourceRequest; /** - * Creates a plain object from a ListAssetsResponse message. Also converts values to other types if specified. - * @param message ListAssetsResponse + * Creates a plain object from a CreateSourceRequest message. Also converts values to other types if specified. + * @param message CreateSourceRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.securitycenter.v1beta1.ListAssetsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.securitycenter.v1beta1.CreateSourceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ListAssetsResponse to JSON. + * Converts this CreateSourceRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - namespace ListAssetsResponse { + /** Properties of a GetOrganizationSettingsRequest. */ + interface IGetOrganizationSettingsRequest { - /** Properties of a ListAssetsResult. */ - interface IListAssetsResult { + /** GetOrganizationSettingsRequest name */ + name?: (string|null); + } - /** ListAssetsResult asset */ - asset?: (google.cloud.securitycenter.v1beta1.IAsset|null); - - /** ListAssetsResult state */ - state?: (google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult.State|null); - } - - /** Represents a ListAssetsResult. */ - class ListAssetsResult implements IListAssetsResult { - - /** - * Constructs a new ListAssetsResult. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v1beta1.ListAssetsResponse.IListAssetsResult); - - /** ListAssetsResult asset. */ - public asset?: (google.cloud.securitycenter.v1beta1.IAsset|null); - - /** ListAssetsResult state. */ - public state: google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult.State; - - /** - * Creates a new ListAssetsResult instance using the specified properties. - * @param [properties] Properties to set - * @returns ListAssetsResult instance - */ - public static create(properties?: google.cloud.securitycenter.v1beta1.ListAssetsResponse.IListAssetsResult): google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult; - - /** - * Encodes the specified ListAssetsResult message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult.verify|verify} messages. - * @param message ListAssetsResult message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v1beta1.ListAssetsResponse.IListAssetsResult, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListAssetsResult message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult.verify|verify} messages. - * @param message ListAssetsResult message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v1beta1.ListAssetsResponse.IListAssetsResult, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListAssetsResult message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListAssetsResult - * @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.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult; - - /** - * Decodes a ListAssetsResult message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListAssetsResult - * @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.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult; - - /** - * Verifies a ListAssetsResult 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 ListAssetsResult message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListAssetsResult - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult; - - /** - * Creates a plain object from a ListAssetsResult message. Also converts values to other types if specified. - * @param message ListAssetsResult - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListAssetsResult to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - namespace ListAssetsResult { - - /** State enum. */ - enum State { - STATE_UNSPECIFIED = 0, - UNUSED = 1, - ADDED = 2, - REMOVED = 3, - ACTIVE = 4 - } - } - } - - /** Properties of a ListFindingsRequest. */ - interface IListFindingsRequest { - - /** ListFindingsRequest parent */ - parent?: (string|null); - - /** ListFindingsRequest filter */ - filter?: (string|null); - - /** ListFindingsRequest orderBy */ - orderBy?: (string|null); - - /** ListFindingsRequest readTime */ - readTime?: (google.protobuf.ITimestamp|null); - - /** ListFindingsRequest fieldMask */ - fieldMask?: (google.protobuf.IFieldMask|null); - - /** ListFindingsRequest pageToken */ - pageToken?: (string|null); - - /** ListFindingsRequest pageSize */ - pageSize?: (number|null); - } - - /** Represents a ListFindingsRequest. */ - class ListFindingsRequest implements IListFindingsRequest { + /** Represents a GetOrganizationSettingsRequest. */ + class GetOrganizationSettingsRequest implements IGetOrganizationSettingsRequest { /** - * Constructs a new ListFindingsRequest. + * Constructs a new GetOrganizationSettingsRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.securitycenter.v1beta1.IListFindingsRequest); - - /** ListFindingsRequest parent. */ - public parent: string; - - /** ListFindingsRequest filter. */ - public filter: string; - - /** ListFindingsRequest orderBy. */ - public orderBy: string; - - /** ListFindingsRequest readTime. */ - public readTime?: (google.protobuf.ITimestamp|null); - - /** ListFindingsRequest fieldMask. */ - public fieldMask?: (google.protobuf.IFieldMask|null); - - /** ListFindingsRequest pageToken. */ - public pageToken: string; + constructor(properties?: google.cloud.securitycenter.v1beta1.IGetOrganizationSettingsRequest); - /** ListFindingsRequest pageSize. */ - public pageSize: number; + /** GetOrganizationSettingsRequest name. */ + public name: string; /** - * Creates a new ListFindingsRequest instance using the specified properties. + * Creates a new GetOrganizationSettingsRequest instance using the specified properties. * @param [properties] Properties to set - * @returns ListFindingsRequest instance + * @returns GetOrganizationSettingsRequest instance */ - public static create(properties?: google.cloud.securitycenter.v1beta1.IListFindingsRequest): google.cloud.securitycenter.v1beta1.ListFindingsRequest; + public static create(properties?: google.cloud.securitycenter.v1beta1.IGetOrganizationSettingsRequest): google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest; /** - * Encodes the specified ListFindingsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.ListFindingsRequest.verify|verify} messages. - * @param message ListFindingsRequest message or plain object to encode + * Encodes the specified GetOrganizationSettingsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest.verify|verify} messages. + * @param message GetOrganizationSettingsRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.securitycenter.v1beta1.IListFindingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.securitycenter.v1beta1.IGetOrganizationSettingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ListFindingsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.ListFindingsRequest.verify|verify} messages. - * @param message ListFindingsRequest message or plain object to encode + * Encodes the specified GetOrganizationSettingsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest.verify|verify} messages. + * @param message GetOrganizationSettingsRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.securitycenter.v1beta1.IListFindingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.securitycenter.v1beta1.IGetOrganizationSettingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ListFindingsRequest message from the specified reader or buffer. + * Decodes a GetOrganizationSettingsRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ListFindingsRequest + * @returns GetOrganizationSettingsRequest * @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.cloud.securitycenter.v1beta1.ListFindingsRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest; /** - * Decodes a ListFindingsRequest message from the specified reader or buffer, length delimited. + * Decodes a GetOrganizationSettingsRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ListFindingsRequest + * @returns GetOrganizationSettingsRequest * @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.cloud.securitycenter.v1beta1.ListFindingsRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest; /** - * Verifies a ListFindingsRequest message. + * Verifies a GetOrganizationSettingsRequest 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 ListFindingsRequest message from a plain object. Also converts values to their respective internal types. + * Creates a GetOrganizationSettingsRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ListFindingsRequest + * @returns GetOrganizationSettingsRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1beta1.ListFindingsRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest; /** - * Creates a plain object from a ListFindingsRequest message. Also converts values to other types if specified. - * @param message ListFindingsRequest + * Creates a plain object from a GetOrganizationSettingsRequest message. Also converts values to other types if specified. + * @param message GetOrganizationSettingsRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.securitycenter.v1beta1.ListFindingsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ListFindingsRequest to JSON. + * Converts this GetOrganizationSettingsRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a ListFindingsResponse. */ - interface IListFindingsResponse { - - /** ListFindingsResponse findings */ - findings?: (google.cloud.securitycenter.v1beta1.IFinding[]|null); - - /** ListFindingsResponse readTime */ - readTime?: (google.protobuf.ITimestamp|null); - - /** ListFindingsResponse nextPageToken */ - nextPageToken?: (string|null); + /** Properties of a GetSourceRequest. */ + interface IGetSourceRequest { - /** ListFindingsResponse totalSize */ - totalSize?: (number|null); + /** GetSourceRequest name */ + name?: (string|null); } - /** Represents a ListFindingsResponse. */ - class ListFindingsResponse implements IListFindingsResponse { + /** Represents a GetSourceRequest. */ + class GetSourceRequest implements IGetSourceRequest { /** - * Constructs a new ListFindingsResponse. + * Constructs a new GetSourceRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.securitycenter.v1beta1.IListFindingsResponse); - - /** ListFindingsResponse findings. */ - public findings: google.cloud.securitycenter.v1beta1.IFinding[]; - - /** ListFindingsResponse readTime. */ - public readTime?: (google.protobuf.ITimestamp|null); - - /** ListFindingsResponse nextPageToken. */ - public nextPageToken: string; + constructor(properties?: google.cloud.securitycenter.v1beta1.IGetSourceRequest); - /** ListFindingsResponse totalSize. */ - public totalSize: number; + /** GetSourceRequest name. */ + public name: string; /** - * Creates a new ListFindingsResponse instance using the specified properties. + * Creates a new GetSourceRequest instance using the specified properties. * @param [properties] Properties to set - * @returns ListFindingsResponse instance + * @returns GetSourceRequest instance */ - public static create(properties?: google.cloud.securitycenter.v1beta1.IListFindingsResponse): google.cloud.securitycenter.v1beta1.ListFindingsResponse; + public static create(properties?: google.cloud.securitycenter.v1beta1.IGetSourceRequest): google.cloud.securitycenter.v1beta1.GetSourceRequest; /** - * Encodes the specified ListFindingsResponse message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.ListFindingsResponse.verify|verify} messages. - * @param message ListFindingsResponse message or plain object to encode + * Encodes the specified GetSourceRequest message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.GetSourceRequest.verify|verify} messages. + * @param message GetSourceRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.securitycenter.v1beta1.IListFindingsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.securitycenter.v1beta1.IGetSourceRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ListFindingsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.ListFindingsResponse.verify|verify} messages. - * @param message ListFindingsResponse message or plain object to encode - * @param [writer] Writer to encode to + * Encodes the specified GetSourceRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.GetSourceRequest.verify|verify} messages. + * @param message GetSourceRequest message or plain object to encode + * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.securitycenter.v1beta1.IListFindingsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.securitycenter.v1beta1.IGetSourceRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ListFindingsResponse message from the specified reader or buffer. + * Decodes a GetSourceRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ListFindingsResponse + * @returns GetSourceRequest * @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.cloud.securitycenter.v1beta1.ListFindingsResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1beta1.GetSourceRequest; /** - * Decodes a ListFindingsResponse message from the specified reader or buffer, length delimited. + * Decodes a GetSourceRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ListFindingsResponse + * @returns GetSourceRequest * @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.cloud.securitycenter.v1beta1.ListFindingsResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1beta1.GetSourceRequest; /** - * Verifies a ListFindingsResponse message. + * Verifies a GetSourceRequest 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 ListFindingsResponse message from a plain object. Also converts values to their respective internal types. + * Creates a GetSourceRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ListFindingsResponse + * @returns GetSourceRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1beta1.ListFindingsResponse; + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1beta1.GetSourceRequest; /** - * Creates a plain object from a ListFindingsResponse message. Also converts values to other types if specified. - * @param message ListFindingsResponse + * Creates a plain object from a GetSourceRequest message. Also converts values to other types if specified. + * @param message GetSourceRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.securitycenter.v1beta1.ListFindingsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.securitycenter.v1beta1.GetSourceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ListFindingsResponse to JSON. + * Converts this GetSourceRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a SetFindingStateRequest. */ - interface ISetFindingStateRequest { + /** Properties of a GroupAssetsRequest. */ + interface IGroupAssetsRequest { - /** SetFindingStateRequest name */ - name?: (string|null); + /** GroupAssetsRequest parent */ + parent?: (string|null); - /** SetFindingStateRequest state */ - state?: (google.cloud.securitycenter.v1beta1.Finding.State|null); + /** GroupAssetsRequest filter */ + filter?: (string|null); - /** SetFindingStateRequest startTime */ - startTime?: (google.protobuf.ITimestamp|null); + /** GroupAssetsRequest groupBy */ + groupBy?: (string|null); + + /** GroupAssetsRequest compareDuration */ + compareDuration?: (google.protobuf.IDuration|null); + + /** GroupAssetsRequest readTime */ + readTime?: (google.protobuf.ITimestamp|null); + + /** GroupAssetsRequest pageToken */ + pageToken?: (string|null); + + /** GroupAssetsRequest pageSize */ + pageSize?: (number|null); } - /** Represents a SetFindingStateRequest. */ - class SetFindingStateRequest implements ISetFindingStateRequest { + /** Represents a GroupAssetsRequest. */ + class GroupAssetsRequest implements IGroupAssetsRequest { /** - * Constructs a new SetFindingStateRequest. + * Constructs a new GroupAssetsRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.securitycenter.v1beta1.ISetFindingStateRequest); + constructor(properties?: google.cloud.securitycenter.v1beta1.IGroupAssetsRequest); - /** SetFindingStateRequest name. */ - public name: string; + /** GroupAssetsRequest parent. */ + public parent: string; - /** SetFindingStateRequest state. */ - public state: google.cloud.securitycenter.v1beta1.Finding.State; + /** GroupAssetsRequest filter. */ + public filter: string; - /** SetFindingStateRequest startTime. */ - public startTime?: (google.protobuf.ITimestamp|null); + /** GroupAssetsRequest groupBy. */ + public groupBy: string; + + /** GroupAssetsRequest compareDuration. */ + public compareDuration?: (google.protobuf.IDuration|null); + + /** GroupAssetsRequest readTime. */ + public readTime?: (google.protobuf.ITimestamp|null); + + /** GroupAssetsRequest pageToken. */ + public pageToken: string; + + /** GroupAssetsRequest pageSize. */ + public pageSize: number; /** - * Creates a new SetFindingStateRequest instance using the specified properties. + * Creates a new GroupAssetsRequest instance using the specified properties. * @param [properties] Properties to set - * @returns SetFindingStateRequest instance + * @returns GroupAssetsRequest instance */ - public static create(properties?: google.cloud.securitycenter.v1beta1.ISetFindingStateRequest): google.cloud.securitycenter.v1beta1.SetFindingStateRequest; + public static create(properties?: google.cloud.securitycenter.v1beta1.IGroupAssetsRequest): google.cloud.securitycenter.v1beta1.GroupAssetsRequest; /** - * Encodes the specified SetFindingStateRequest message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.SetFindingStateRequest.verify|verify} messages. - * @param message SetFindingStateRequest message or plain object to encode + * Encodes the specified GroupAssetsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.GroupAssetsRequest.verify|verify} messages. + * @param message GroupAssetsRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.securitycenter.v1beta1.ISetFindingStateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.securitycenter.v1beta1.IGroupAssetsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified SetFindingStateRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.SetFindingStateRequest.verify|verify} messages. - * @param message SetFindingStateRequest message or plain object to encode + * Encodes the specified GroupAssetsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.GroupAssetsRequest.verify|verify} messages. + * @param message GroupAssetsRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.securitycenter.v1beta1.ISetFindingStateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.securitycenter.v1beta1.IGroupAssetsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a SetFindingStateRequest message from the specified reader or buffer. + * Decodes a GroupAssetsRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns SetFindingStateRequest + * @returns GroupAssetsRequest * @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.cloud.securitycenter.v1beta1.SetFindingStateRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1beta1.GroupAssetsRequest; /** - * Decodes a SetFindingStateRequest message from the specified reader or buffer, length delimited. + * Decodes a GroupAssetsRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns SetFindingStateRequest + * @returns GroupAssetsRequest * @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.cloud.securitycenter.v1beta1.SetFindingStateRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1beta1.GroupAssetsRequest; /** - * Verifies a SetFindingStateRequest message. + * Verifies a GroupAssetsRequest 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 SetFindingStateRequest message from a plain object. Also converts values to their respective internal types. + * Creates a GroupAssetsRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns SetFindingStateRequest + * @returns GroupAssetsRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1beta1.SetFindingStateRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1beta1.GroupAssetsRequest; /** - * Creates a plain object from a SetFindingStateRequest message. Also converts values to other types if specified. - * @param message SetFindingStateRequest + * Creates a plain object from a GroupAssetsRequest message. Also converts values to other types if specified. + * @param message GroupAssetsRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.securitycenter.v1beta1.SetFindingStateRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.securitycenter.v1beta1.GroupAssetsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this SetFindingStateRequest to JSON. + * Converts this GroupAssetsRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a RunAssetDiscoveryRequest. */ - interface IRunAssetDiscoveryRequest { + /** Properties of a GroupAssetsResponse. */ + interface IGroupAssetsResponse { - /** RunAssetDiscoveryRequest parent */ - parent?: (string|null); + /** GroupAssetsResponse groupByResults */ + groupByResults?: (google.cloud.securitycenter.v1beta1.IGroupResult[]|null); + + /** GroupAssetsResponse readTime */ + readTime?: (google.protobuf.ITimestamp|null); + + /** GroupAssetsResponse nextPageToken */ + nextPageToken?: (string|null); } - /** Represents a RunAssetDiscoveryRequest. */ - class RunAssetDiscoveryRequest implements IRunAssetDiscoveryRequest { + /** Represents a GroupAssetsResponse. */ + class GroupAssetsResponse implements IGroupAssetsResponse { /** - * Constructs a new RunAssetDiscoveryRequest. + * Constructs a new GroupAssetsResponse. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.securitycenter.v1beta1.IRunAssetDiscoveryRequest); + constructor(properties?: google.cloud.securitycenter.v1beta1.IGroupAssetsResponse); - /** RunAssetDiscoveryRequest parent. */ - public parent: string; + /** GroupAssetsResponse groupByResults. */ + public groupByResults: google.cloud.securitycenter.v1beta1.IGroupResult[]; + + /** GroupAssetsResponse readTime. */ + public readTime?: (google.protobuf.ITimestamp|null); + + /** GroupAssetsResponse nextPageToken. */ + public nextPageToken: string; /** - * Creates a new RunAssetDiscoveryRequest instance using the specified properties. + * Creates a new GroupAssetsResponse instance using the specified properties. * @param [properties] Properties to set - * @returns RunAssetDiscoveryRequest instance + * @returns GroupAssetsResponse instance */ - public static create(properties?: google.cloud.securitycenter.v1beta1.IRunAssetDiscoveryRequest): google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest; + public static create(properties?: google.cloud.securitycenter.v1beta1.IGroupAssetsResponse): google.cloud.securitycenter.v1beta1.GroupAssetsResponse; /** - * Encodes the specified RunAssetDiscoveryRequest message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest.verify|verify} messages. - * @param message RunAssetDiscoveryRequest message or plain object to encode + * Encodes the specified GroupAssetsResponse message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.GroupAssetsResponse.verify|verify} messages. + * @param message GroupAssetsResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.securitycenter.v1beta1.IRunAssetDiscoveryRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.securitycenter.v1beta1.IGroupAssetsResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified RunAssetDiscoveryRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest.verify|verify} messages. - * @param message RunAssetDiscoveryRequest message or plain object to encode + * Encodes the specified GroupAssetsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.GroupAssetsResponse.verify|verify} messages. + * @param message GroupAssetsResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.securitycenter.v1beta1.IRunAssetDiscoveryRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.securitycenter.v1beta1.IGroupAssetsResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a RunAssetDiscoveryRequest message from the specified reader or buffer. + * Decodes a GroupAssetsResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns RunAssetDiscoveryRequest + * @returns GroupAssetsResponse * @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.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1beta1.GroupAssetsResponse; /** - * Decodes a RunAssetDiscoveryRequest message from the specified reader or buffer, length delimited. + * Decodes a GroupAssetsResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns RunAssetDiscoveryRequest + * @returns GroupAssetsResponse * @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.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1beta1.GroupAssetsResponse; /** - * Verifies a RunAssetDiscoveryRequest message. + * Verifies a GroupAssetsResponse 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 RunAssetDiscoveryRequest message from a plain object. Also converts values to their respective internal types. + * Creates a GroupAssetsResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns RunAssetDiscoveryRequest + * @returns GroupAssetsResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1beta1.GroupAssetsResponse; /** - * Creates a plain object from a RunAssetDiscoveryRequest message. Also converts values to other types if specified. - * @param message RunAssetDiscoveryRequest + * Creates a plain object from a GroupAssetsResponse message. Also converts values to other types if specified. + * @param message GroupAssetsResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.securitycenter.v1beta1.GroupAssetsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this RunAssetDiscoveryRequest to JSON. + * Converts this GroupAssetsResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of an UpdateFindingRequest. */ - interface IUpdateFindingRequest { + /** Properties of a GroupFindingsRequest. */ + interface IGroupFindingsRequest { - /** UpdateFindingRequest finding */ - finding?: (google.cloud.securitycenter.v1beta1.IFinding|null); + /** GroupFindingsRequest parent */ + parent?: (string|null); - /** UpdateFindingRequest updateMask */ - updateMask?: (google.protobuf.IFieldMask|null); - } + /** GroupFindingsRequest filter */ + filter?: (string|null); - /** Represents an UpdateFindingRequest. */ - class UpdateFindingRequest implements IUpdateFindingRequest { + /** GroupFindingsRequest groupBy */ + groupBy?: (string|null); - /** - * Constructs a new UpdateFindingRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v1beta1.IUpdateFindingRequest); + /** GroupFindingsRequest readTime */ + readTime?: (google.protobuf.ITimestamp|null); - /** UpdateFindingRequest finding. */ - public finding?: (google.cloud.securitycenter.v1beta1.IFinding|null); + /** GroupFindingsRequest pageToken */ + pageToken?: (string|null); - /** UpdateFindingRequest updateMask. */ - public updateMask?: (google.protobuf.IFieldMask|null); + /** GroupFindingsRequest pageSize */ + pageSize?: (number|null); + } + + /** Represents a GroupFindingsRequest. */ + class GroupFindingsRequest implements IGroupFindingsRequest { /** - * Creates a new UpdateFindingRequest instance using the specified properties. + * Constructs a new GroupFindingsRequest. * @param [properties] Properties to set - * @returns UpdateFindingRequest instance */ - public static create(properties?: google.cloud.securitycenter.v1beta1.IUpdateFindingRequest): google.cloud.securitycenter.v1beta1.UpdateFindingRequest; + constructor(properties?: google.cloud.securitycenter.v1beta1.IGroupFindingsRequest); + + /** GroupFindingsRequest parent. */ + public parent: string; + + /** GroupFindingsRequest filter. */ + public filter: string; + + /** GroupFindingsRequest groupBy. */ + public groupBy: string; + + /** GroupFindingsRequest readTime. */ + public readTime?: (google.protobuf.ITimestamp|null); + + /** GroupFindingsRequest pageToken. */ + public pageToken: string; + + /** GroupFindingsRequest pageSize. */ + public pageSize: number; /** - * Encodes the specified UpdateFindingRequest message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.UpdateFindingRequest.verify|verify} messages. - * @param message UpdateFindingRequest message or plain object to encode + * Creates a new GroupFindingsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GroupFindingsRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v1beta1.IGroupFindingsRequest): google.cloud.securitycenter.v1beta1.GroupFindingsRequest; + + /** + * Encodes the specified GroupFindingsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.GroupFindingsRequest.verify|verify} messages. + * @param message GroupFindingsRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.securitycenter.v1beta1.IUpdateFindingRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.securitycenter.v1beta1.IGroupFindingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified UpdateFindingRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.UpdateFindingRequest.verify|verify} messages. - * @param message UpdateFindingRequest message or plain object to encode + * Encodes the specified GroupFindingsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.GroupFindingsRequest.verify|verify} messages. + * @param message GroupFindingsRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.securitycenter.v1beta1.IUpdateFindingRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.securitycenter.v1beta1.IGroupFindingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an UpdateFindingRequest message from the specified reader or buffer. + * Decodes a GroupFindingsRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns UpdateFindingRequest + * @returns GroupFindingsRequest * @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.cloud.securitycenter.v1beta1.UpdateFindingRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1beta1.GroupFindingsRequest; /** - * Decodes an UpdateFindingRequest message from the specified reader or buffer, length delimited. + * Decodes a GroupFindingsRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns UpdateFindingRequest + * @returns GroupFindingsRequest * @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.cloud.securitycenter.v1beta1.UpdateFindingRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1beta1.GroupFindingsRequest; /** - * Verifies an UpdateFindingRequest message. + * Verifies a GroupFindingsRequest 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 UpdateFindingRequest message from a plain object. Also converts values to their respective internal types. + * Creates a GroupFindingsRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns UpdateFindingRequest + * @returns GroupFindingsRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1beta1.UpdateFindingRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1beta1.GroupFindingsRequest; /** - * Creates a plain object from an UpdateFindingRequest message. Also converts values to other types if specified. - * @param message UpdateFindingRequest + * Creates a plain object from a GroupFindingsRequest message. Also converts values to other types if specified. + * @param message GroupFindingsRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.securitycenter.v1beta1.UpdateFindingRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.securitycenter.v1beta1.GroupFindingsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this UpdateFindingRequest to JSON. + * Converts this GroupFindingsRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of an UpdateOrganizationSettingsRequest. */ - interface IUpdateOrganizationSettingsRequest { + /** Properties of a GroupFindingsResponse. */ + interface IGroupFindingsResponse { - /** UpdateOrganizationSettingsRequest organizationSettings */ - organizationSettings?: (google.cloud.securitycenter.v1beta1.IOrganizationSettings|null); + /** GroupFindingsResponse groupByResults */ + groupByResults?: (google.cloud.securitycenter.v1beta1.IGroupResult[]|null); - /** UpdateOrganizationSettingsRequest updateMask */ - updateMask?: (google.protobuf.IFieldMask|null); + /** GroupFindingsResponse readTime */ + readTime?: (google.protobuf.ITimestamp|null); + + /** GroupFindingsResponse nextPageToken */ + nextPageToken?: (string|null); } - /** Represents an UpdateOrganizationSettingsRequest. */ - class UpdateOrganizationSettingsRequest implements IUpdateOrganizationSettingsRequest { + /** Represents a GroupFindingsResponse. */ + class GroupFindingsResponse implements IGroupFindingsResponse { /** - * Constructs a new UpdateOrganizationSettingsRequest. + * Constructs a new GroupFindingsResponse. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.securitycenter.v1beta1.IUpdateOrganizationSettingsRequest); + constructor(properties?: google.cloud.securitycenter.v1beta1.IGroupFindingsResponse); - /** UpdateOrganizationSettingsRequest organizationSettings. */ - public organizationSettings?: (google.cloud.securitycenter.v1beta1.IOrganizationSettings|null); + /** GroupFindingsResponse groupByResults. */ + public groupByResults: google.cloud.securitycenter.v1beta1.IGroupResult[]; - /** UpdateOrganizationSettingsRequest updateMask. */ - public updateMask?: (google.protobuf.IFieldMask|null); + /** GroupFindingsResponse readTime. */ + public readTime?: (google.protobuf.ITimestamp|null); + + /** GroupFindingsResponse nextPageToken. */ + public nextPageToken: string; /** - * Creates a new UpdateOrganizationSettingsRequest instance using the specified properties. + * Creates a new GroupFindingsResponse instance using the specified properties. * @param [properties] Properties to set - * @returns UpdateOrganizationSettingsRequest instance + * @returns GroupFindingsResponse instance */ - public static create(properties?: google.cloud.securitycenter.v1beta1.IUpdateOrganizationSettingsRequest): google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest; + public static create(properties?: google.cloud.securitycenter.v1beta1.IGroupFindingsResponse): google.cloud.securitycenter.v1beta1.GroupFindingsResponse; /** - * Encodes the specified UpdateOrganizationSettingsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest.verify|verify} messages. - * @param message UpdateOrganizationSettingsRequest message or plain object to encode + * Encodes the specified GroupFindingsResponse message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.GroupFindingsResponse.verify|verify} messages. + * @param message GroupFindingsResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.securitycenter.v1beta1.IUpdateOrganizationSettingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.securitycenter.v1beta1.IGroupFindingsResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified UpdateOrganizationSettingsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest.verify|verify} messages. - * @param message UpdateOrganizationSettingsRequest message or plain object to encode + * Encodes the specified GroupFindingsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.GroupFindingsResponse.verify|verify} messages. + * @param message GroupFindingsResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.securitycenter.v1beta1.IUpdateOrganizationSettingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.securitycenter.v1beta1.IGroupFindingsResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an UpdateOrganizationSettingsRequest message from the specified reader or buffer. + * Decodes a GroupFindingsResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns UpdateOrganizationSettingsRequest + * @returns GroupFindingsResponse * @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.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1beta1.GroupFindingsResponse; /** - * Decodes an UpdateOrganizationSettingsRequest message from the specified reader or buffer, length delimited. + * Decodes a GroupFindingsResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns UpdateOrganizationSettingsRequest + * @returns GroupFindingsResponse * @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.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1beta1.GroupFindingsResponse; /** - * Verifies an UpdateOrganizationSettingsRequest message. + * Verifies a GroupFindingsResponse 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 UpdateOrganizationSettingsRequest message from a plain object. Also converts values to their respective internal types. + * Creates a GroupFindingsResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns UpdateOrganizationSettingsRequest + * @returns GroupFindingsResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1beta1.GroupFindingsResponse; /** - * Creates a plain object from an UpdateOrganizationSettingsRequest message. Also converts values to other types if specified. - * @param message UpdateOrganizationSettingsRequest + * Creates a plain object from a GroupFindingsResponse message. Also converts values to other types if specified. + * @param message GroupFindingsResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.securitycenter.v1beta1.GroupFindingsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this UpdateOrganizationSettingsRequest to JSON. + * Converts this GroupFindingsResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of an UpdateSourceRequest. */ - interface IUpdateSourceRequest { + /** Properties of a GroupResult. */ + interface IGroupResult { - /** UpdateSourceRequest source */ - source?: (google.cloud.securitycenter.v1beta1.ISource|null); + /** GroupResult properties */ + properties?: ({ [k: string]: google.protobuf.IValue }|null); - /** UpdateSourceRequest updateMask */ - updateMask?: (google.protobuf.IFieldMask|null); + /** GroupResult count */ + count?: (number|Long|null); } - /** Represents an UpdateSourceRequest. */ - class UpdateSourceRequest implements IUpdateSourceRequest { + /** Represents a GroupResult. */ + class GroupResult implements IGroupResult { /** - * Constructs a new UpdateSourceRequest. + * Constructs a new GroupResult. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.securitycenter.v1beta1.IUpdateSourceRequest); + constructor(properties?: google.cloud.securitycenter.v1beta1.IGroupResult); - /** UpdateSourceRequest source. */ - public source?: (google.cloud.securitycenter.v1beta1.ISource|null); + /** GroupResult properties. */ + public properties: { [k: string]: google.protobuf.IValue }; - /** UpdateSourceRequest updateMask. */ - public updateMask?: (google.protobuf.IFieldMask|null); + /** GroupResult count. */ + public count: (number|Long); /** - * Creates a new UpdateSourceRequest instance using the specified properties. + * Creates a new GroupResult instance using the specified properties. * @param [properties] Properties to set - * @returns UpdateSourceRequest instance + * @returns GroupResult instance */ - public static create(properties?: google.cloud.securitycenter.v1beta1.IUpdateSourceRequest): google.cloud.securitycenter.v1beta1.UpdateSourceRequest; + public static create(properties?: google.cloud.securitycenter.v1beta1.IGroupResult): google.cloud.securitycenter.v1beta1.GroupResult; /** - * Encodes the specified UpdateSourceRequest message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.UpdateSourceRequest.verify|verify} messages. - * @param message UpdateSourceRequest message or plain object to encode + * Encodes the specified GroupResult message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.GroupResult.verify|verify} messages. + * @param message GroupResult message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.securitycenter.v1beta1.IUpdateSourceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.securitycenter.v1beta1.IGroupResult, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified UpdateSourceRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.UpdateSourceRequest.verify|verify} messages. - * @param message UpdateSourceRequest message or plain object to encode + * Encodes the specified GroupResult message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.GroupResult.verify|verify} messages. + * @param message GroupResult message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.securitycenter.v1beta1.IUpdateSourceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.securitycenter.v1beta1.IGroupResult, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an UpdateSourceRequest message from the specified reader or buffer. + * Decodes a GroupResult message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns UpdateSourceRequest + * @returns GroupResult * @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.cloud.securitycenter.v1beta1.UpdateSourceRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1beta1.GroupResult; /** - * Decodes an UpdateSourceRequest message from the specified reader or buffer, length delimited. + * Decodes a GroupResult message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns UpdateSourceRequest + * @returns GroupResult * @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.cloud.securitycenter.v1beta1.UpdateSourceRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1beta1.GroupResult; /** - * Verifies an UpdateSourceRequest message. + * Verifies a GroupResult 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 UpdateSourceRequest message from a plain object. Also converts values to their respective internal types. + * Creates a GroupResult message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns UpdateSourceRequest + * @returns GroupResult */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1beta1.UpdateSourceRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1beta1.GroupResult; /** - * Creates a plain object from an UpdateSourceRequest message. Also converts values to other types if specified. - * @param message UpdateSourceRequest + * Creates a plain object from a GroupResult message. Also converts values to other types if specified. + * @param message GroupResult * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.securitycenter.v1beta1.UpdateSourceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.securitycenter.v1beta1.GroupResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this UpdateSourceRequest to JSON. + * Converts this GroupResult to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of an UpdateSecurityMarksRequest. */ - interface IUpdateSecurityMarksRequest { + /** Properties of a ListSourcesRequest. */ + interface IListSourcesRequest { - /** UpdateSecurityMarksRequest securityMarks */ - securityMarks?: (google.cloud.securitycenter.v1beta1.ISecurityMarks|null); + /** ListSourcesRequest parent */ + parent?: (string|null); - /** UpdateSecurityMarksRequest updateMask */ - updateMask?: (google.protobuf.IFieldMask|null); + /** ListSourcesRequest pageToken */ + pageToken?: (string|null); - /** UpdateSecurityMarksRequest startTime */ - startTime?: (google.protobuf.ITimestamp|null); + /** ListSourcesRequest pageSize */ + pageSize?: (number|null); } - /** Represents an UpdateSecurityMarksRequest. */ - class UpdateSecurityMarksRequest implements IUpdateSecurityMarksRequest { + /** Represents a ListSourcesRequest. */ + class ListSourcesRequest implements IListSourcesRequest { /** - * Constructs a new UpdateSecurityMarksRequest. + * Constructs a new ListSourcesRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.securitycenter.v1beta1.IUpdateSecurityMarksRequest); - - /** UpdateSecurityMarksRequest securityMarks. */ - public securityMarks?: (google.cloud.securitycenter.v1beta1.ISecurityMarks|null); + constructor(properties?: google.cloud.securitycenter.v1beta1.IListSourcesRequest); - /** UpdateSecurityMarksRequest updateMask. */ - public updateMask?: (google.protobuf.IFieldMask|null); + /** ListSourcesRequest parent. */ + public parent: string; - /** UpdateSecurityMarksRequest startTime. */ - public startTime?: (google.protobuf.ITimestamp|null); + /** ListSourcesRequest pageToken. */ + public pageToken: string; + + /** ListSourcesRequest pageSize. */ + public pageSize: number; /** - * Creates a new UpdateSecurityMarksRequest instance using the specified properties. + * Creates a new ListSourcesRequest instance using the specified properties. * @param [properties] Properties to set - * @returns UpdateSecurityMarksRequest instance + * @returns ListSourcesRequest instance */ - public static create(properties?: google.cloud.securitycenter.v1beta1.IUpdateSecurityMarksRequest): google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest; + public static create(properties?: google.cloud.securitycenter.v1beta1.IListSourcesRequest): google.cloud.securitycenter.v1beta1.ListSourcesRequest; /** - * Encodes the specified UpdateSecurityMarksRequest message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest.verify|verify} messages. - * @param message UpdateSecurityMarksRequest message or plain object to encode + * Encodes the specified ListSourcesRequest message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.ListSourcesRequest.verify|verify} messages. + * @param message ListSourcesRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.securitycenter.v1beta1.IUpdateSecurityMarksRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.securitycenter.v1beta1.IListSourcesRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified UpdateSecurityMarksRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest.verify|verify} messages. - * @param message UpdateSecurityMarksRequest message or plain object to encode + * Encodes the specified ListSourcesRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.ListSourcesRequest.verify|verify} messages. + * @param message ListSourcesRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.securitycenter.v1beta1.IUpdateSecurityMarksRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.securitycenter.v1beta1.IListSourcesRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an UpdateSecurityMarksRequest message from the specified reader or buffer. + * Decodes a ListSourcesRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns UpdateSecurityMarksRequest + * @returns ListSourcesRequest * @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.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1beta1.ListSourcesRequest; /** - * Decodes an UpdateSecurityMarksRequest message from the specified reader or buffer, length delimited. + * Decodes a ListSourcesRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns UpdateSecurityMarksRequest + * @returns ListSourcesRequest * @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.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1beta1.ListSourcesRequest; /** - * Verifies an UpdateSecurityMarksRequest message. + * Verifies a ListSourcesRequest 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 UpdateSecurityMarksRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ListSourcesRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns UpdateSecurityMarksRequest + * @returns ListSourcesRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1beta1.ListSourcesRequest; /** - * Creates a plain object from an UpdateSecurityMarksRequest message. Also converts values to other types if specified. - * @param message UpdateSecurityMarksRequest + * Creates a plain object from a ListSourcesRequest message. Also converts values to other types if specified. + * @param message ListSourcesRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.securitycenter.v1beta1.ListSourcesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this UpdateSecurityMarksRequest to JSON. + * Converts this ListSourcesRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of an Asset. */ - interface IAsset { - - /** Asset name */ - name?: (string|null); - - /** Asset securityCenterProperties */ - securityCenterProperties?: (google.cloud.securitycenter.v1beta1.Asset.ISecurityCenterProperties|null); - - /** Asset resourceProperties */ - resourceProperties?: ({ [k: string]: google.protobuf.IValue }|null); - - /** Asset securityMarks */ - securityMarks?: (google.cloud.securitycenter.v1beta1.ISecurityMarks|null); + /** Properties of a ListSourcesResponse. */ + interface IListSourcesResponse { - /** Asset createTime */ - createTime?: (google.protobuf.ITimestamp|null); + /** ListSourcesResponse sources */ + sources?: (google.cloud.securitycenter.v1beta1.ISource[]|null); - /** Asset updateTime */ - updateTime?: (google.protobuf.ITimestamp|null); + /** ListSourcesResponse nextPageToken */ + nextPageToken?: (string|null); } - /** Represents an Asset. */ - class Asset implements IAsset { + /** Represents a ListSourcesResponse. */ + class ListSourcesResponse implements IListSourcesResponse { /** - * Constructs a new Asset. + * Constructs a new ListSourcesResponse. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.securitycenter.v1beta1.IAsset); - - /** Asset name. */ - public name: string; - - /** Asset securityCenterProperties. */ - public securityCenterProperties?: (google.cloud.securitycenter.v1beta1.Asset.ISecurityCenterProperties|null); - - /** Asset resourceProperties. */ - public resourceProperties: { [k: string]: google.protobuf.IValue }; - - /** Asset securityMarks. */ - public securityMarks?: (google.cloud.securitycenter.v1beta1.ISecurityMarks|null); + constructor(properties?: google.cloud.securitycenter.v1beta1.IListSourcesResponse); - /** Asset createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); + /** ListSourcesResponse sources. */ + public sources: google.cloud.securitycenter.v1beta1.ISource[]; - /** Asset updateTime. */ - public updateTime?: (google.protobuf.ITimestamp|null); + /** ListSourcesResponse nextPageToken. */ + public nextPageToken: string; /** - * Creates a new Asset instance using the specified properties. + * Creates a new ListSourcesResponse instance using the specified properties. * @param [properties] Properties to set - * @returns Asset instance + * @returns ListSourcesResponse instance */ - public static create(properties?: google.cloud.securitycenter.v1beta1.IAsset): google.cloud.securitycenter.v1beta1.Asset; + public static create(properties?: google.cloud.securitycenter.v1beta1.IListSourcesResponse): google.cloud.securitycenter.v1beta1.ListSourcesResponse; /** - * Encodes the specified Asset message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.Asset.verify|verify} messages. - * @param message Asset message or plain object to encode + * Encodes the specified ListSourcesResponse message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.ListSourcesResponse.verify|verify} messages. + * @param message ListSourcesResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.securitycenter.v1beta1.IAsset, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.securitycenter.v1beta1.IListSourcesResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified Asset message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.Asset.verify|verify} messages. - * @param message Asset message or plain object to encode + * Encodes the specified ListSourcesResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.ListSourcesResponse.verify|verify} messages. + * @param message ListSourcesResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.securitycenter.v1beta1.IAsset, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.securitycenter.v1beta1.IListSourcesResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an Asset message from the specified reader or buffer. + * Decodes a ListSourcesResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns Asset + * @returns ListSourcesResponse * @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.cloud.securitycenter.v1beta1.Asset; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1beta1.ListSourcesResponse; /** - * Decodes an Asset message from the specified reader or buffer, length delimited. + * Decodes a ListSourcesResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Asset + * @returns ListSourcesResponse * @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.cloud.securitycenter.v1beta1.Asset; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1beta1.ListSourcesResponse; /** - * Verifies an Asset message. + * Verifies a ListSourcesResponse 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 Asset message from a plain object. Also converts values to their respective internal types. + * Creates a ListSourcesResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Asset + * @returns ListSourcesResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1beta1.Asset; + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1beta1.ListSourcesResponse; /** - * Creates a plain object from an Asset message. Also converts values to other types if specified. - * @param message Asset + * Creates a plain object from a ListSourcesResponse message. Also converts values to other types if specified. + * @param message ListSourcesResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.securitycenter.v1beta1.Asset, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.securitycenter.v1beta1.ListSourcesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Asset to JSON. + * Converts this ListSourcesResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - namespace Asset { - - /** Properties of a SecurityCenterProperties. */ - interface ISecurityCenterProperties { + /** Properties of a ListAssetsRequest. */ + interface IListAssetsRequest { - /** SecurityCenterProperties resourceName */ - resourceName?: (string|null); + /** ListAssetsRequest parent */ + parent?: (string|null); - /** SecurityCenterProperties resourceType */ - resourceType?: (string|null); + /** ListAssetsRequest filter */ + filter?: (string|null); - /** SecurityCenterProperties resourceParent */ - resourceParent?: (string|null); + /** ListAssetsRequest orderBy */ + orderBy?: (string|null); - /** SecurityCenterProperties resourceProject */ - resourceProject?: (string|null); + /** ListAssetsRequest readTime */ + readTime?: (google.protobuf.ITimestamp|null); - /** SecurityCenterProperties resourceOwners */ - resourceOwners?: (string[]|null); - } + /** ListAssetsRequest compareDuration */ + compareDuration?: (google.protobuf.IDuration|null); - /** Represents a SecurityCenterProperties. */ - class SecurityCenterProperties implements ISecurityCenterProperties { + /** ListAssetsRequest fieldMask */ + fieldMask?: (google.protobuf.IFieldMask|null); - /** - * Constructs a new SecurityCenterProperties. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v1beta1.Asset.ISecurityCenterProperties); + /** ListAssetsRequest pageToken */ + pageToken?: (string|null); - /** SecurityCenterProperties resourceName. */ - public resourceName: string; + /** ListAssetsRequest pageSize */ + pageSize?: (number|null); + } - /** SecurityCenterProperties resourceType. */ - public resourceType: string; + /** Represents a ListAssetsRequest. */ + class ListAssetsRequest implements IListAssetsRequest { - /** SecurityCenterProperties resourceParent. */ - public resourceParent: string; + /** + * Constructs a new ListAssetsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1beta1.IListAssetsRequest); - /** SecurityCenterProperties resourceProject. */ - public resourceProject: string; + /** ListAssetsRequest parent. */ + public parent: string; - /** SecurityCenterProperties resourceOwners. */ - public resourceOwners: string[]; + /** ListAssetsRequest filter. */ + public filter: string; - /** - * Creates a new SecurityCenterProperties instance using the specified properties. - * @param [properties] Properties to set - * @returns SecurityCenterProperties instance - */ - public static create(properties?: google.cloud.securitycenter.v1beta1.Asset.ISecurityCenterProperties): google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties; + /** ListAssetsRequest orderBy. */ + public orderBy: string; - /** - * Encodes the specified SecurityCenterProperties message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties.verify|verify} messages. - * @param message SecurityCenterProperties message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v1beta1.Asset.ISecurityCenterProperties, writer?: $protobuf.Writer): $protobuf.Writer; + /** ListAssetsRequest readTime. */ + public readTime?: (google.protobuf.ITimestamp|null); - /** - * Encodes the specified SecurityCenterProperties message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties.verify|verify} messages. - * @param message SecurityCenterProperties message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v1beta1.Asset.ISecurityCenterProperties, writer?: $protobuf.Writer): $protobuf.Writer; + /** ListAssetsRequest compareDuration. */ + public compareDuration?: (google.protobuf.IDuration|null); - /** - * Decodes a SecurityCenterProperties message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SecurityCenterProperties - * @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.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties; + /** ListAssetsRequest fieldMask. */ + public fieldMask?: (google.protobuf.IFieldMask|null); - /** - * Decodes a SecurityCenterProperties message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SecurityCenterProperties - * @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.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties; + /** ListAssetsRequest pageToken. */ + public pageToken: string; - /** - * Verifies a SecurityCenterProperties 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 SecurityCenterProperties message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SecurityCenterProperties - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties; - - /** - * Creates a plain object from a SecurityCenterProperties message. Also converts values to other types if specified. - * @param message SecurityCenterProperties - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SecurityCenterProperties to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - } - - /** Properties of a SecurityMarks. */ - interface ISecurityMarks { - - /** SecurityMarks name */ - name?: (string|null); - - /** SecurityMarks marks */ - marks?: ({ [k: string]: string }|null); - } - - /** Represents a SecurityMarks. */ - class SecurityMarks implements ISecurityMarks { - - /** - * Constructs a new SecurityMarks. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v1beta1.ISecurityMarks); - - /** SecurityMarks name. */ - public name: string; - - /** SecurityMarks marks. */ - public marks: { [k: string]: string }; + /** ListAssetsRequest pageSize. */ + public pageSize: number; /** - * Creates a new SecurityMarks instance using the specified properties. + * Creates a new ListAssetsRequest instance using the specified properties. * @param [properties] Properties to set - * @returns SecurityMarks instance + * @returns ListAssetsRequest instance */ - public static create(properties?: google.cloud.securitycenter.v1beta1.ISecurityMarks): google.cloud.securitycenter.v1beta1.SecurityMarks; + public static create(properties?: google.cloud.securitycenter.v1beta1.IListAssetsRequest): google.cloud.securitycenter.v1beta1.ListAssetsRequest; /** - * Encodes the specified SecurityMarks message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.SecurityMarks.verify|verify} messages. - * @param message SecurityMarks message or plain object to encode + * Encodes the specified ListAssetsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.ListAssetsRequest.verify|verify} messages. + * @param message ListAssetsRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.securitycenter.v1beta1.ISecurityMarks, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.securitycenter.v1beta1.IListAssetsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified SecurityMarks message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.SecurityMarks.verify|verify} messages. - * @param message SecurityMarks message or plain object to encode + * Encodes the specified ListAssetsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.ListAssetsRequest.verify|verify} messages. + * @param message ListAssetsRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.securitycenter.v1beta1.ISecurityMarks, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.securitycenter.v1beta1.IListAssetsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a SecurityMarks message from the specified reader or buffer. + * Decodes a ListAssetsRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns SecurityMarks + * @returns ListAssetsRequest * @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.cloud.securitycenter.v1beta1.SecurityMarks; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1beta1.ListAssetsRequest; /** - * Decodes a SecurityMarks message from the specified reader or buffer, length delimited. + * Decodes a ListAssetsRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns SecurityMarks + * @returns ListAssetsRequest * @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.cloud.securitycenter.v1beta1.SecurityMarks; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1beta1.ListAssetsRequest; /** - * Verifies a SecurityMarks message. + * Verifies a ListAssetsRequest 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 SecurityMarks message from a plain object. Also converts values to their respective internal types. + * Creates a ListAssetsRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns SecurityMarks + * @returns ListAssetsRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1beta1.SecurityMarks; + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1beta1.ListAssetsRequest; /** - * Creates a plain object from a SecurityMarks message. Also converts values to other types if specified. - * @param message SecurityMarks + * Creates a plain object from a ListAssetsRequest message. Also converts values to other types if specified. + * @param message ListAssetsRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.securitycenter.v1beta1.SecurityMarks, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.securitycenter.v1beta1.ListAssetsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this SecurityMarks to JSON. + * Converts this ListAssetsRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a Finding. */ - interface IFinding { - - /** Finding name */ - name?: (string|null); - - /** Finding parent */ - parent?: (string|null); - - /** Finding resourceName */ - resourceName?: (string|null); - - /** Finding state */ - state?: (google.cloud.securitycenter.v1beta1.Finding.State|null); - - /** Finding category */ - category?: (string|null); - - /** Finding externalUri */ - externalUri?: (string|null); + /** Properties of a ListAssetsResponse. */ + interface IListAssetsResponse { - /** Finding sourceProperties */ - sourceProperties?: ({ [k: string]: google.protobuf.IValue }|null); + /** ListAssetsResponse listAssetsResults */ + listAssetsResults?: (google.cloud.securitycenter.v1beta1.ListAssetsResponse.IListAssetsResult[]|null); - /** Finding securityMarks */ - securityMarks?: (google.cloud.securitycenter.v1beta1.ISecurityMarks|null); + /** ListAssetsResponse readTime */ + readTime?: (google.protobuf.ITimestamp|null); - /** Finding eventTime */ - eventTime?: (google.protobuf.ITimestamp|null); + /** ListAssetsResponse nextPageToken */ + nextPageToken?: (string|null); - /** Finding createTime */ - createTime?: (google.protobuf.ITimestamp|null); + /** ListAssetsResponse totalSize */ + totalSize?: (number|null); } - /** Represents a Finding. */ - class Finding implements IFinding { + /** Represents a ListAssetsResponse. */ + class ListAssetsResponse implements IListAssetsResponse { /** - * Constructs a new Finding. + * Constructs a new ListAssetsResponse. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.securitycenter.v1beta1.IFinding); - - /** Finding name. */ - public name: string; - - /** Finding parent. */ - public parent: string; - - /** Finding resourceName. */ - public resourceName: string; - - /** Finding state. */ - public state: google.cloud.securitycenter.v1beta1.Finding.State; - - /** Finding category. */ - public category: string; - - /** Finding externalUri. */ - public externalUri: string; + constructor(properties?: google.cloud.securitycenter.v1beta1.IListAssetsResponse); - /** Finding sourceProperties. */ - public sourceProperties: { [k: string]: google.protobuf.IValue }; + /** ListAssetsResponse listAssetsResults. */ + public listAssetsResults: google.cloud.securitycenter.v1beta1.ListAssetsResponse.IListAssetsResult[]; - /** Finding securityMarks. */ - public securityMarks?: (google.cloud.securitycenter.v1beta1.ISecurityMarks|null); + /** ListAssetsResponse readTime. */ + public readTime?: (google.protobuf.ITimestamp|null); - /** Finding eventTime. */ - public eventTime?: (google.protobuf.ITimestamp|null); + /** ListAssetsResponse nextPageToken. */ + public nextPageToken: string; - /** Finding createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); + /** ListAssetsResponse totalSize. */ + public totalSize: number; /** - * Creates a new Finding instance using the specified properties. + * Creates a new ListAssetsResponse instance using the specified properties. * @param [properties] Properties to set - * @returns Finding instance + * @returns ListAssetsResponse instance */ - public static create(properties?: google.cloud.securitycenter.v1beta1.IFinding): google.cloud.securitycenter.v1beta1.Finding; + public static create(properties?: google.cloud.securitycenter.v1beta1.IListAssetsResponse): google.cloud.securitycenter.v1beta1.ListAssetsResponse; /** - * Encodes the specified Finding message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.Finding.verify|verify} messages. - * @param message Finding message or plain object to encode + * Encodes the specified ListAssetsResponse message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.ListAssetsResponse.verify|verify} messages. + * @param message ListAssetsResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.securitycenter.v1beta1.IFinding, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.securitycenter.v1beta1.IListAssetsResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified Finding message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.Finding.verify|verify} messages. - * @param message Finding message or plain object to encode + * Encodes the specified ListAssetsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.ListAssetsResponse.verify|verify} messages. + * @param message ListAssetsResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.securitycenter.v1beta1.IFinding, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.securitycenter.v1beta1.IListAssetsResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a Finding message from the specified reader or buffer. + * Decodes a ListAssetsResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns Finding + * @returns ListAssetsResponse * @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.cloud.securitycenter.v1beta1.Finding; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1beta1.ListAssetsResponse; /** - * Decodes a Finding message from the specified reader or buffer, length delimited. + * Decodes a ListAssetsResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Finding + * @returns ListAssetsResponse * @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.cloud.securitycenter.v1beta1.Finding; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1beta1.ListAssetsResponse; /** - * Verifies a Finding message. + * Verifies a ListAssetsResponse 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 Finding message from a plain object. Also converts values to their respective internal types. + * Creates a ListAssetsResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Finding + * @returns ListAssetsResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1beta1.Finding; + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1beta1.ListAssetsResponse; /** - * Creates a plain object from a Finding message. Also converts values to other types if specified. - * @param message Finding + * Creates a plain object from a ListAssetsResponse message. Also converts values to other types if specified. + * @param message ListAssetsResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.securitycenter.v1beta1.Finding, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.securitycenter.v1beta1.ListAssetsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Finding to JSON. + * Converts this ListAssetsResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - namespace Finding { - - /** State enum. */ - enum State { - STATE_UNSPECIFIED = 0, - ACTIVE = 1, - INACTIVE = 2 - } - } + namespace ListAssetsResponse { - /** Properties of an OrganizationSettings. */ - interface IOrganizationSettings { + /** Properties of a ListAssetsResult. */ + interface IListAssetsResult { - /** OrganizationSettings name */ - name?: (string|null); + /** ListAssetsResult asset */ + asset?: (google.cloud.securitycenter.v1beta1.IAsset|null); - /** OrganizationSettings enableAssetDiscovery */ - enableAssetDiscovery?: (boolean|null); + /** ListAssetsResult state */ + state?: (google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult.State|null); + } - /** OrganizationSettings assetDiscoveryConfig */ - assetDiscoveryConfig?: (google.cloud.securitycenter.v1beta1.OrganizationSettings.IAssetDiscoveryConfig|null); - } - - /** Represents an OrganizationSettings. */ - class OrganizationSettings implements IOrganizationSettings { - - /** - * Constructs a new OrganizationSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v1beta1.IOrganizationSettings); - - /** OrganizationSettings name. */ - public name: string; - - /** OrganizationSettings enableAssetDiscovery. */ - public enableAssetDiscovery: boolean; - - /** OrganizationSettings assetDiscoveryConfig. */ - public assetDiscoveryConfig?: (google.cloud.securitycenter.v1beta1.OrganizationSettings.IAssetDiscoveryConfig|null); - - /** - * Creates a new OrganizationSettings instance using the specified properties. - * @param [properties] Properties to set - * @returns OrganizationSettings instance - */ - public static create(properties?: google.cloud.securitycenter.v1beta1.IOrganizationSettings): google.cloud.securitycenter.v1beta1.OrganizationSettings; - - /** - * Encodes the specified OrganizationSettings message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.OrganizationSettings.verify|verify} messages. - * @param message OrganizationSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v1beta1.IOrganizationSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified OrganizationSettings message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.OrganizationSettings.verify|verify} messages. - * @param message OrganizationSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v1beta1.IOrganizationSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an OrganizationSettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns OrganizationSettings - * @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.cloud.securitycenter.v1beta1.OrganizationSettings; - - /** - * Decodes an OrganizationSettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns OrganizationSettings - * @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.cloud.securitycenter.v1beta1.OrganizationSettings; - - /** - * Verifies an OrganizationSettings 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 OrganizationSettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns OrganizationSettings - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1beta1.OrganizationSettings; - - /** - * Creates a plain object from an OrganizationSettings message. Also converts values to other types if specified. - * @param message OrganizationSettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v1beta1.OrganizationSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this OrganizationSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - namespace OrganizationSettings { - - /** Properties of an AssetDiscoveryConfig. */ - interface IAssetDiscoveryConfig { - - /** AssetDiscoveryConfig projectIds */ - projectIds?: (string[]|null); - - /** AssetDiscoveryConfig inclusionMode */ - inclusionMode?: (google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode|null); - } - - /** Represents an AssetDiscoveryConfig. */ - class AssetDiscoveryConfig implements IAssetDiscoveryConfig { + /** Represents a ListAssetsResult. */ + class ListAssetsResult implements IListAssetsResult { /** - * Constructs a new AssetDiscoveryConfig. + * Constructs a new ListAssetsResult. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.securitycenter.v1beta1.OrganizationSettings.IAssetDiscoveryConfig); + constructor(properties?: google.cloud.securitycenter.v1beta1.ListAssetsResponse.IListAssetsResult); - /** AssetDiscoveryConfig projectIds. */ - public projectIds: string[]; + /** ListAssetsResult asset. */ + public asset?: (google.cloud.securitycenter.v1beta1.IAsset|null); - /** AssetDiscoveryConfig inclusionMode. */ - public inclusionMode: google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode; + /** ListAssetsResult state. */ + public state: google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult.State; /** - * Creates a new AssetDiscoveryConfig instance using the specified properties. + * Creates a new ListAssetsResult instance using the specified properties. * @param [properties] Properties to set - * @returns AssetDiscoveryConfig instance + * @returns ListAssetsResult instance */ - public static create(properties?: google.cloud.securitycenter.v1beta1.OrganizationSettings.IAssetDiscoveryConfig): google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig; + public static create(properties?: google.cloud.securitycenter.v1beta1.ListAssetsResponse.IListAssetsResult): google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult; /** - * Encodes the specified AssetDiscoveryConfig message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig.verify|verify} messages. - * @param message AssetDiscoveryConfig message or plain object to encode + * Encodes the specified ListAssetsResult message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult.verify|verify} messages. + * @param message ListAssetsResult message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.securitycenter.v1beta1.OrganizationSettings.IAssetDiscoveryConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.securitycenter.v1beta1.ListAssetsResponse.IListAssetsResult, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified AssetDiscoveryConfig message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig.verify|verify} messages. - * @param message AssetDiscoveryConfig message or plain object to encode + * Encodes the specified ListAssetsResult message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult.verify|verify} messages. + * @param message ListAssetsResult message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.securitycenter.v1beta1.OrganizationSettings.IAssetDiscoveryConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.securitycenter.v1beta1.ListAssetsResponse.IListAssetsResult, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an AssetDiscoveryConfig message from the specified reader or buffer. + * Decodes a ListAssetsResult message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns AssetDiscoveryConfig + * @returns ListAssetsResult * @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.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult; /** - * Decodes an AssetDiscoveryConfig message from the specified reader or buffer, length delimited. + * Decodes a ListAssetsResult message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns AssetDiscoveryConfig + * @returns ListAssetsResult * @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.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult; /** - * Verifies an AssetDiscoveryConfig message. + * Verifies a ListAssetsResult 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 AssetDiscoveryConfig message from a plain object. Also converts values to their respective internal types. + * Creates a ListAssetsResult message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns AssetDiscoveryConfig + * @returns ListAssetsResult */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig; + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult; /** - * Creates a plain object from an AssetDiscoveryConfig message. Also converts values to other types if specified. - * @param message AssetDiscoveryConfig + * Creates a plain object from a ListAssetsResult message. Also converts values to other types if specified. + * @param message ListAssetsResult * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this AssetDiscoveryConfig to JSON. + * Converts this ListAssetsResult to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - namespace AssetDiscoveryConfig { + namespace ListAssetsResult { - /** InclusionMode enum. */ - enum InclusionMode { - INCLUSION_MODE_UNSPECIFIED = 0, - INCLUDE_ONLY = 1, - EXCLUDE = 2 + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + UNUSED = 1, + ADDED = 2, + REMOVED = 3, + ACTIVE = 4 } } } - /** Properties of a Source. */ - interface ISource { + /** Properties of a ListFindingsRequest. */ + interface IListFindingsRequest { - /** Source name */ - name?: (string|null); + /** ListFindingsRequest parent */ + parent?: (string|null); - /** Source displayName */ - displayName?: (string|null); + /** ListFindingsRequest filter */ + filter?: (string|null); - /** Source description */ - description?: (string|null); + /** ListFindingsRequest orderBy */ + orderBy?: (string|null); + + /** ListFindingsRequest readTime */ + readTime?: (google.protobuf.ITimestamp|null); + + /** ListFindingsRequest fieldMask */ + fieldMask?: (google.protobuf.IFieldMask|null); + + /** ListFindingsRequest pageToken */ + pageToken?: (string|null); + + /** ListFindingsRequest pageSize */ + pageSize?: (number|null); } - /** Represents a Source. */ - class Source implements ISource { + /** Represents a ListFindingsRequest. */ + class ListFindingsRequest implements IListFindingsRequest { /** - * Constructs a new Source. + * Constructs a new ListFindingsRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.securitycenter.v1beta1.ISource); + constructor(properties?: google.cloud.securitycenter.v1beta1.IListFindingsRequest); - /** Source name. */ - public name: string; + /** ListFindingsRequest parent. */ + public parent: string; - /** Source displayName. */ - public displayName: string; + /** ListFindingsRequest filter. */ + public filter: string; - /** Source description. */ - public description: string; + /** ListFindingsRequest orderBy. */ + public orderBy: string; + + /** ListFindingsRequest readTime. */ + public readTime?: (google.protobuf.ITimestamp|null); + + /** ListFindingsRequest fieldMask. */ + public fieldMask?: (google.protobuf.IFieldMask|null); + + /** ListFindingsRequest pageToken. */ + public pageToken: string; + + /** ListFindingsRequest pageSize. */ + public pageSize: number; /** - * Creates a new Source instance using the specified properties. + * Creates a new ListFindingsRequest instance using the specified properties. * @param [properties] Properties to set - * @returns Source instance + * @returns ListFindingsRequest instance */ - public static create(properties?: google.cloud.securitycenter.v1beta1.ISource): google.cloud.securitycenter.v1beta1.Source; + public static create(properties?: google.cloud.securitycenter.v1beta1.IListFindingsRequest): google.cloud.securitycenter.v1beta1.ListFindingsRequest; /** - * Encodes the specified Source message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.Source.verify|verify} messages. - * @param message Source message or plain object to encode + * Encodes the specified ListFindingsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.ListFindingsRequest.verify|verify} messages. + * @param message ListFindingsRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.securitycenter.v1beta1.ISource, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.securitycenter.v1beta1.IListFindingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified Source message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.Source.verify|verify} messages. - * @param message Source message or plain object to encode + * Encodes the specified ListFindingsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.ListFindingsRequest.verify|verify} messages. + * @param message ListFindingsRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.securitycenter.v1beta1.ISource, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.securitycenter.v1beta1.IListFindingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a Source message from the specified reader or buffer. + * Decodes a ListFindingsRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns Source + * @returns ListFindingsRequest * @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.cloud.securitycenter.v1beta1.Source; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1beta1.ListFindingsRequest; /** - * Decodes a Source message from the specified reader or buffer, length delimited. + * Decodes a ListFindingsRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Source + * @returns ListFindingsRequest * @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.cloud.securitycenter.v1beta1.Source; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1beta1.ListFindingsRequest; /** - * Verifies a Source message. + * Verifies a ListFindingsRequest 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 Source message from a plain object. Also converts values to their respective internal types. + * Creates a ListFindingsRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Source + * @returns ListFindingsRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1beta1.Source; + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1beta1.ListFindingsRequest; /** - * Creates a plain object from a Source message. Also converts values to other types if specified. - * @param message Source + * Creates a plain object from a ListFindingsRequest message. Also converts values to other types if specified. + * @param message ListFindingsRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.securitycenter.v1beta1.Source, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.securitycenter.v1beta1.ListFindingsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListFindingsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListFindingsResponse. */ + interface IListFindingsResponse { + + /** ListFindingsResponse findings */ + findings?: (google.cloud.securitycenter.v1beta1.IFinding[]|null); + + /** ListFindingsResponse readTime */ + readTime?: (google.protobuf.ITimestamp|null); + + /** ListFindingsResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListFindingsResponse totalSize */ + totalSize?: (number|null); + } + + /** Represents a ListFindingsResponse. */ + class ListFindingsResponse implements IListFindingsResponse { + + /** + * Constructs a new ListFindingsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1beta1.IListFindingsResponse); + + /** ListFindingsResponse findings. */ + public findings: google.cloud.securitycenter.v1beta1.IFinding[]; + + /** ListFindingsResponse readTime. */ + public readTime?: (google.protobuf.ITimestamp|null); + + /** ListFindingsResponse nextPageToken. */ + public nextPageToken: string; + + /** ListFindingsResponse totalSize. */ + public totalSize: number; + + /** + * Creates a new ListFindingsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListFindingsResponse instance + */ + public static create(properties?: google.cloud.securitycenter.v1beta1.IListFindingsResponse): google.cloud.securitycenter.v1beta1.ListFindingsResponse; + + /** + * Encodes the specified ListFindingsResponse message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.ListFindingsResponse.verify|verify} messages. + * @param message ListFindingsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1beta1.IListFindingsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListFindingsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.ListFindingsResponse.verify|verify} messages. + * @param message ListFindingsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1beta1.IListFindingsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListFindingsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListFindingsResponse + * @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.cloud.securitycenter.v1beta1.ListFindingsResponse; + + /** + * Decodes a ListFindingsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListFindingsResponse + * @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.cloud.securitycenter.v1beta1.ListFindingsResponse; + + /** + * Verifies a ListFindingsResponse 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 ListFindingsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListFindingsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1beta1.ListFindingsResponse; + + /** + * Creates a plain object from a ListFindingsResponse message. Also converts values to other types if specified. + * @param message ListFindingsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1beta1.ListFindingsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListFindingsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a SetFindingStateRequest. */ + interface ISetFindingStateRequest { + + /** SetFindingStateRequest name */ + name?: (string|null); + + /** SetFindingStateRequest state */ + state?: (google.cloud.securitycenter.v1beta1.Finding.State|null); + + /** SetFindingStateRequest startTime */ + startTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a SetFindingStateRequest. */ + class SetFindingStateRequest implements ISetFindingStateRequest { + + /** + * Constructs a new SetFindingStateRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1beta1.ISetFindingStateRequest); + + /** SetFindingStateRequest name. */ + public name: string; + + /** SetFindingStateRequest state. */ + public state: google.cloud.securitycenter.v1beta1.Finding.State; + + /** SetFindingStateRequest startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new SetFindingStateRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns SetFindingStateRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v1beta1.ISetFindingStateRequest): google.cloud.securitycenter.v1beta1.SetFindingStateRequest; + + /** + * Encodes the specified SetFindingStateRequest message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.SetFindingStateRequest.verify|verify} messages. + * @param message SetFindingStateRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1beta1.ISetFindingStateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SetFindingStateRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.SetFindingStateRequest.verify|verify} messages. + * @param message SetFindingStateRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1beta1.ISetFindingStateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SetFindingStateRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SetFindingStateRequest + * @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.cloud.securitycenter.v1beta1.SetFindingStateRequest; + + /** + * Decodes a SetFindingStateRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SetFindingStateRequest + * @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.cloud.securitycenter.v1beta1.SetFindingStateRequest; + + /** + * Verifies a SetFindingStateRequest 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 SetFindingStateRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SetFindingStateRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1beta1.SetFindingStateRequest; + + /** + * Creates a plain object from a SetFindingStateRequest message. Also converts values to other types if specified. + * @param message SetFindingStateRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1beta1.SetFindingStateRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SetFindingStateRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a RunAssetDiscoveryRequest. */ + interface IRunAssetDiscoveryRequest { + + /** RunAssetDiscoveryRequest parent */ + parent?: (string|null); + } + + /** Represents a RunAssetDiscoveryRequest. */ + class RunAssetDiscoveryRequest implements IRunAssetDiscoveryRequest { + + /** + * Constructs a new RunAssetDiscoveryRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1beta1.IRunAssetDiscoveryRequest); + + /** RunAssetDiscoveryRequest parent. */ + public parent: string; + + /** + * Creates a new RunAssetDiscoveryRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns RunAssetDiscoveryRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v1beta1.IRunAssetDiscoveryRequest): google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest; + + /** + * Encodes the specified RunAssetDiscoveryRequest message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest.verify|verify} messages. + * @param message RunAssetDiscoveryRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1beta1.IRunAssetDiscoveryRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RunAssetDiscoveryRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest.verify|verify} messages. + * @param message RunAssetDiscoveryRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1beta1.IRunAssetDiscoveryRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RunAssetDiscoveryRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RunAssetDiscoveryRequest + * @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.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest; + + /** + * Decodes a RunAssetDiscoveryRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RunAssetDiscoveryRequest + * @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.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest; + + /** + * Verifies a RunAssetDiscoveryRequest 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 RunAssetDiscoveryRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RunAssetDiscoveryRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest; + + /** + * Creates a plain object from a RunAssetDiscoveryRequest message. Also converts values to other types if specified. + * @param message RunAssetDiscoveryRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RunAssetDiscoveryRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an UpdateFindingRequest. */ + interface IUpdateFindingRequest { + + /** UpdateFindingRequest finding */ + finding?: (google.cloud.securitycenter.v1beta1.IFinding|null); + + /** UpdateFindingRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateFindingRequest. */ + class UpdateFindingRequest implements IUpdateFindingRequest { + + /** + * Constructs a new UpdateFindingRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1beta1.IUpdateFindingRequest); + + /** UpdateFindingRequest finding. */ + public finding?: (google.cloud.securitycenter.v1beta1.IFinding|null); + + /** UpdateFindingRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateFindingRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateFindingRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v1beta1.IUpdateFindingRequest): google.cloud.securitycenter.v1beta1.UpdateFindingRequest; + + /** + * Encodes the specified UpdateFindingRequest message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.UpdateFindingRequest.verify|verify} messages. + * @param message UpdateFindingRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1beta1.IUpdateFindingRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateFindingRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.UpdateFindingRequest.verify|verify} messages. + * @param message UpdateFindingRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1beta1.IUpdateFindingRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateFindingRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateFindingRequest + * @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.cloud.securitycenter.v1beta1.UpdateFindingRequest; + + /** + * Decodes an UpdateFindingRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateFindingRequest + * @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.cloud.securitycenter.v1beta1.UpdateFindingRequest; + + /** + * Verifies an UpdateFindingRequest 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 UpdateFindingRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateFindingRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1beta1.UpdateFindingRequest; + + /** + * Creates a plain object from an UpdateFindingRequest message. Also converts values to other types if specified. + * @param message UpdateFindingRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1beta1.UpdateFindingRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateFindingRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an UpdateOrganizationSettingsRequest. */ + interface IUpdateOrganizationSettingsRequest { + + /** UpdateOrganizationSettingsRequest organizationSettings */ + organizationSettings?: (google.cloud.securitycenter.v1beta1.IOrganizationSettings|null); + + /** UpdateOrganizationSettingsRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateOrganizationSettingsRequest. */ + class UpdateOrganizationSettingsRequest implements IUpdateOrganizationSettingsRequest { + + /** + * Constructs a new UpdateOrganizationSettingsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1beta1.IUpdateOrganizationSettingsRequest); + + /** UpdateOrganizationSettingsRequest organizationSettings. */ + public organizationSettings?: (google.cloud.securitycenter.v1beta1.IOrganizationSettings|null); + + /** UpdateOrganizationSettingsRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateOrganizationSettingsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateOrganizationSettingsRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v1beta1.IUpdateOrganizationSettingsRequest): google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest; + + /** + * Encodes the specified UpdateOrganizationSettingsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest.verify|verify} messages. + * @param message UpdateOrganizationSettingsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1beta1.IUpdateOrganizationSettingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateOrganizationSettingsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest.verify|verify} messages. + * @param message UpdateOrganizationSettingsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1beta1.IUpdateOrganizationSettingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateOrganizationSettingsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateOrganizationSettingsRequest + * @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.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest; + + /** + * Decodes an UpdateOrganizationSettingsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateOrganizationSettingsRequest + * @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.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest; + + /** + * Verifies an UpdateOrganizationSettingsRequest 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 UpdateOrganizationSettingsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateOrganizationSettingsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest; + + /** + * Creates a plain object from an UpdateOrganizationSettingsRequest message. Also converts values to other types if specified. + * @param message UpdateOrganizationSettingsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateOrganizationSettingsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an UpdateSourceRequest. */ + interface IUpdateSourceRequest { + + /** UpdateSourceRequest source */ + source?: (google.cloud.securitycenter.v1beta1.ISource|null); + + /** UpdateSourceRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateSourceRequest. */ + class UpdateSourceRequest implements IUpdateSourceRequest { + + /** + * Constructs a new UpdateSourceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1beta1.IUpdateSourceRequest); + + /** UpdateSourceRequest source. */ + public source?: (google.cloud.securitycenter.v1beta1.ISource|null); + + /** UpdateSourceRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateSourceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateSourceRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v1beta1.IUpdateSourceRequest): google.cloud.securitycenter.v1beta1.UpdateSourceRequest; + + /** + * Encodes the specified UpdateSourceRequest message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.UpdateSourceRequest.verify|verify} messages. + * @param message UpdateSourceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1beta1.IUpdateSourceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateSourceRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.UpdateSourceRequest.verify|verify} messages. + * @param message UpdateSourceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1beta1.IUpdateSourceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateSourceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateSourceRequest + * @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.cloud.securitycenter.v1beta1.UpdateSourceRequest; + + /** + * Decodes an UpdateSourceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateSourceRequest + * @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.cloud.securitycenter.v1beta1.UpdateSourceRequest; + + /** + * Verifies an UpdateSourceRequest 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 UpdateSourceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateSourceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1beta1.UpdateSourceRequest; + + /** + * Creates a plain object from an UpdateSourceRequest message. Also converts values to other types if specified. + * @param message UpdateSourceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1beta1.UpdateSourceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateSourceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an UpdateSecurityMarksRequest. */ + interface IUpdateSecurityMarksRequest { + + /** UpdateSecurityMarksRequest securityMarks */ + securityMarks?: (google.cloud.securitycenter.v1beta1.ISecurityMarks|null); + + /** UpdateSecurityMarksRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateSecurityMarksRequest startTime */ + startTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents an UpdateSecurityMarksRequest. */ + class UpdateSecurityMarksRequest implements IUpdateSecurityMarksRequest { + + /** + * Constructs a new UpdateSecurityMarksRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1beta1.IUpdateSecurityMarksRequest); + + /** UpdateSecurityMarksRequest securityMarks. */ + public securityMarks?: (google.cloud.securitycenter.v1beta1.ISecurityMarks|null); + + /** UpdateSecurityMarksRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateSecurityMarksRequest startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new UpdateSecurityMarksRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateSecurityMarksRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v1beta1.IUpdateSecurityMarksRequest): google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest; + + /** + * Encodes the specified UpdateSecurityMarksRequest message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest.verify|verify} messages. + * @param message UpdateSecurityMarksRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1beta1.IUpdateSecurityMarksRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateSecurityMarksRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest.verify|verify} messages. + * @param message UpdateSecurityMarksRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1beta1.IUpdateSecurityMarksRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateSecurityMarksRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateSecurityMarksRequest + * @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.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest; + + /** + * Decodes an UpdateSecurityMarksRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateSecurityMarksRequest + * @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.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest; + + /** + * Verifies an UpdateSecurityMarksRequest 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 UpdateSecurityMarksRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateSecurityMarksRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest; + + /** + * Creates a plain object from an UpdateSecurityMarksRequest message. Also converts values to other types if specified. + * @param message UpdateSecurityMarksRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateSecurityMarksRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + } + } + + /** Namespace api. */ + namespace api { + + /** FieldBehavior enum. */ + enum FieldBehavior { + FIELD_BEHAVIOR_UNSPECIFIED = 0, + OPTIONAL = 1, + REQUIRED = 2, + OUTPUT_ONLY = 3, + INPUT_ONLY = 4, + IMMUTABLE = 5 + } + + /** 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|null); + + /** ResourceDescriptor plural */ + plural?: (string|null); + + /** ResourceDescriptor singular */ + singular?: (string|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; + + /** ResourceDescriptor plural. */ + public plural: string; + + /** ResourceDescriptor singular. */ + public singular: string; + + /** + * 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 }; + } + + namespace ResourceDescriptor { + + /** History enum. */ + enum History { + HISTORY_UNSPECIFIED = 0, + ORIGINALLY_SINGLE_PATTERN = 1, + FUTURE_MULTI_PATTERN = 2 + } + } + + /** 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 Source to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - } + /** + * Converts this ResourceReference to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; } - } - - /** Namespace api. */ - namespace api { /** Properties of a Http. */ interface IHttp { @@ -7693,242 +8174,6 @@ export namespace google { */ public toJSON(): { [k: string]: any }; } - - /** FieldBehavior enum. */ - enum FieldBehavior { - FIELD_BEHAVIOR_UNSPECIFIED = 0, - OPTIONAL = 1, - REQUIRED = 2, - OUTPUT_ONLY = 3, - INPUT_ONLY = 4, - IMMUTABLE = 5 - } - - /** 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|null); - - /** ResourceDescriptor plural */ - plural?: (string|null); - - /** ResourceDescriptor singular */ - singular?: (string|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; - - /** ResourceDescriptor plural. */ - public plural: string; - - /** ResourceDescriptor singular. */ - public singular: string; - - /** - * 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 }; - } - - namespace ResourceDescriptor { - - /** History enum. */ - enum History { - HISTORY_UNSPECIFIED = 0, - ORIGINALLY_SINGLE_PATTERN = 1, - FUTURE_MULTI_PATTERN = 2 - } - } - - /** 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 }; - } } /** Namespace protobuf. */ diff --git a/packages/google-cloud-securitycenter/protos/protos.js b/packages/google-cloud-securitycenter/protos/protos.js index bc5292fa10f..88c9349500e 100644 --- a/packages/google-cloud-securitycenter/protos/protos.js +++ b/packages/google-cloud-securitycenter/protos/protos.js @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC +// 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. @@ -66,757 +66,888 @@ */ var v1 = {}; - v1.SecurityCenter = (function() { + v1.Finding = (function() { /** - * Constructs a new SecurityCenter service. + * Properties of a Finding. * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents a SecurityCenter - * @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 SecurityCenter(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (SecurityCenter.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = SecurityCenter; - - /** - * Creates new SecurityCenter service using the specified rpc implementation. - * @function create - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @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 {SecurityCenter} RPC service. Useful where requests and/or responses are streamed. + * @interface IFinding + * @property {string|null} [name] Finding name + * @property {string|null} [parent] Finding parent + * @property {string|null} [resourceName] Finding resourceName + * @property {google.cloud.securitycenter.v1.Finding.State|null} [state] Finding state + * @property {string|null} [category] Finding category + * @property {string|null} [externalUri] Finding externalUri + * @property {Object.|null} [sourceProperties] Finding sourceProperties + * @property {google.cloud.securitycenter.v1.ISecurityMarks|null} [securityMarks] Finding securityMarks + * @property {google.protobuf.ITimestamp|null} [eventTime] Finding eventTime + * @property {google.protobuf.ITimestamp|null} [createTime] Finding createTime */ - SecurityCenter.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#createSource}. - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @typedef CreateSourceCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.securitycenter.v1.Source} [response] Source + * Constructs a new Finding. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a Finding. + * @implements IFinding + * @constructor + * @param {google.cloud.securitycenter.v1.IFinding=} [properties] Properties to set */ + function Finding(properties) { + this.sourceProperties = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } /** - * Calls CreateSource. - * @function createSource - * @memberof google.cloud.securitycenter.v1.SecurityCenter + * Finding name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1.Finding * @instance - * @param {google.cloud.securitycenter.v1.ICreateSourceRequest} request CreateSourceRequest message or plain object - * @param {google.cloud.securitycenter.v1.SecurityCenter.CreateSourceCallback} callback Node-style callback called with the error, if any, and Source - * @returns {undefined} - * @variation 1 */ - Object.defineProperty(SecurityCenter.prototype.createSource = function createSource(request, callback) { - return this.rpcCall(createSource, $root.google.cloud.securitycenter.v1.CreateSourceRequest, $root.google.cloud.securitycenter.v1.Source, request, callback); - }, "name", { value: "CreateSource" }); + Finding.prototype.name = ""; /** - * Calls CreateSource. - * @function createSource - * @memberof google.cloud.securitycenter.v1.SecurityCenter + * Finding parent. + * @member {string} parent + * @memberof google.cloud.securitycenter.v1.Finding * @instance - * @param {google.cloud.securitycenter.v1.ICreateSourceRequest} request CreateSourceRequest message or plain object - * @returns {Promise} Promise - * @variation 2 */ + Finding.prototype.parent = ""; /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#createFinding}. - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @typedef CreateFindingCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.securitycenter.v1.Finding} [response] Finding + * Finding resourceName. + * @member {string} resourceName + * @memberof google.cloud.securitycenter.v1.Finding + * @instance */ + Finding.prototype.resourceName = ""; /** - * Calls CreateFinding. - * @function createFinding - * @memberof google.cloud.securitycenter.v1.SecurityCenter + * Finding state. + * @member {google.cloud.securitycenter.v1.Finding.State} state + * @memberof google.cloud.securitycenter.v1.Finding * @instance - * @param {google.cloud.securitycenter.v1.ICreateFindingRequest} request CreateFindingRequest message or plain object - * @param {google.cloud.securitycenter.v1.SecurityCenter.CreateFindingCallback} callback Node-style callback called with the error, if any, and Finding - * @returns {undefined} - * @variation 1 */ - Object.defineProperty(SecurityCenter.prototype.createFinding = function createFinding(request, callback) { - return this.rpcCall(createFinding, $root.google.cloud.securitycenter.v1.CreateFindingRequest, $root.google.cloud.securitycenter.v1.Finding, request, callback); - }, "name", { value: "CreateFinding" }); + Finding.prototype.state = 0; /** - * Calls CreateFinding. - * @function createFinding - * @memberof google.cloud.securitycenter.v1.SecurityCenter + * Finding category. + * @member {string} category + * @memberof google.cloud.securitycenter.v1.Finding * @instance - * @param {google.cloud.securitycenter.v1.ICreateFindingRequest} request CreateFindingRequest message or plain object - * @returns {Promise} Promise - * @variation 2 */ + Finding.prototype.category = ""; /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#getIamPolicy}. - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @typedef GetIamPolicyCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.iam.v1.Policy} [response] Policy + * Finding externalUri. + * @member {string} externalUri + * @memberof google.cloud.securitycenter.v1.Finding + * @instance */ + Finding.prototype.externalUri = ""; /** - * Calls GetIamPolicy. - * @function getIamPolicy - * @memberof google.cloud.securitycenter.v1.SecurityCenter + * Finding sourceProperties. + * @member {Object.} sourceProperties + * @memberof google.cloud.securitycenter.v1.Finding * @instance - * @param {google.iam.v1.IGetIamPolicyRequest} request GetIamPolicyRequest message or plain object - * @param {google.cloud.securitycenter.v1.SecurityCenter.GetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy - * @returns {undefined} - * @variation 1 */ - Object.defineProperty(SecurityCenter.prototype.getIamPolicy = function getIamPolicy(request, callback) { - return this.rpcCall(getIamPolicy, $root.google.iam.v1.GetIamPolicyRequest, $root.google.iam.v1.Policy, request, callback); - }, "name", { value: "GetIamPolicy" }); + Finding.prototype.sourceProperties = $util.emptyObject; /** - * Calls GetIamPolicy. - * @function getIamPolicy - * @memberof google.cloud.securitycenter.v1.SecurityCenter + * Finding securityMarks. + * @member {google.cloud.securitycenter.v1.ISecurityMarks|null|undefined} securityMarks + * @memberof google.cloud.securitycenter.v1.Finding * @instance - * @param {google.iam.v1.IGetIamPolicyRequest} request GetIamPolicyRequest message or plain object - * @returns {Promise} Promise - * @variation 2 */ + Finding.prototype.securityMarks = null; /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#getOrganizationSettings}. - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @typedef GetOrganizationSettingsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.securitycenter.v1.OrganizationSettings} [response] OrganizationSettings + * Finding eventTime. + * @member {google.protobuf.ITimestamp|null|undefined} eventTime + * @memberof google.cloud.securitycenter.v1.Finding + * @instance */ + Finding.prototype.eventTime = null; /** - * Calls GetOrganizationSettings. - * @function getOrganizationSettings - * @memberof google.cloud.securitycenter.v1.SecurityCenter + * Finding createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.securitycenter.v1.Finding * @instance - * @param {google.cloud.securitycenter.v1.IGetOrganizationSettingsRequest} request GetOrganizationSettingsRequest message or plain object - * @param {google.cloud.securitycenter.v1.SecurityCenter.GetOrganizationSettingsCallback} callback Node-style callback called with the error, if any, and OrganizationSettings - * @returns {undefined} - * @variation 1 */ - Object.defineProperty(SecurityCenter.prototype.getOrganizationSettings = function getOrganizationSettings(request, callback) { - return this.rpcCall(getOrganizationSettings, $root.google.cloud.securitycenter.v1.GetOrganizationSettingsRequest, $root.google.cloud.securitycenter.v1.OrganizationSettings, request, callback); - }, "name", { value: "GetOrganizationSettings" }); + Finding.prototype.createTime = null; /** - * Calls GetOrganizationSettings. - * @function getOrganizationSettings - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1.IGetOrganizationSettingsRequest} request GetOrganizationSettingsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Creates a new Finding instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.Finding + * @static + * @param {google.cloud.securitycenter.v1.IFinding=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.Finding} Finding instance */ + Finding.create = function create(properties) { + return new Finding(properties); + }; /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#getSource}. - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @typedef GetSourceCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.securitycenter.v1.Source} [response] Source + * Encodes the specified Finding message. Does not implicitly {@link google.cloud.securitycenter.v1.Finding.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.Finding + * @static + * @param {google.cloud.securitycenter.v1.IFinding} message Finding message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ + Finding.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.parent != null && message.hasOwnProperty("parent")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.parent); + if (message.resourceName != null && message.hasOwnProperty("resourceName")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.resourceName); + if (message.state != null && message.hasOwnProperty("state")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.state); + if (message.category != null && message.hasOwnProperty("category")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.category); + if (message.externalUri != null && message.hasOwnProperty("externalUri")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.externalUri); + if (message.sourceProperties != null && message.hasOwnProperty("sourceProperties")) + for (var keys = Object.keys(message.sourceProperties), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 7, wireType 2 =*/58).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.protobuf.Value.encode(message.sourceProperties[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.securityMarks != null && message.hasOwnProperty("securityMarks")) + $root.google.cloud.securitycenter.v1.SecurityMarks.encode(message.securityMarks, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.eventTime != null && message.hasOwnProperty("eventTime")) + $root.google.protobuf.Timestamp.encode(message.eventTime, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.createTime != null && message.hasOwnProperty("createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + return writer; + }; /** - * Calls GetSource. - * @function getSource - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1.IGetSourceRequest} request GetSourceRequest message or plain object - * @param {google.cloud.securitycenter.v1.SecurityCenter.GetSourceCallback} callback Node-style callback called with the error, if any, and Source - * @returns {undefined} - * @variation 1 + * Encodes the specified Finding message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Finding.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.Finding + * @static + * @param {google.cloud.securitycenter.v1.IFinding} message Finding message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - Object.defineProperty(SecurityCenter.prototype.getSource = function getSource(request, callback) { - return this.rpcCall(getSource, $root.google.cloud.securitycenter.v1.GetSourceRequest, $root.google.cloud.securitycenter.v1.Source, request, callback); - }, "name", { value: "GetSource" }); + Finding.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; /** - * Calls GetSource. - * @function getSource - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1.IGetSourceRequest} request GetSourceRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#groupAssets}. - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @typedef GroupAssetsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.securitycenter.v1.GroupAssetsResponse} [response] GroupAssetsResponse + * Decodes a Finding message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.Finding + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.Finding} Finding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ + Finding.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.cloud.securitycenter.v1.Finding(), key; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.parent = reader.string(); + break; + case 3: + message.resourceName = reader.string(); + break; + case 4: + message.state = reader.int32(); + break; + case 5: + message.category = reader.string(); + break; + case 6: + message.externalUri = reader.string(); + break; + case 7: + reader.skip().pos++; + if (message.sourceProperties === $util.emptyObject) + message.sourceProperties = {}; + key = reader.string(); + reader.pos++; + message.sourceProperties[key] = $root.google.protobuf.Value.decode(reader, reader.uint32()); + break; + case 8: + message.securityMarks = $root.google.cloud.securitycenter.v1.SecurityMarks.decode(reader, reader.uint32()); + break; + case 9: + message.eventTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 10: + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; /** - * Calls GroupAssets. - * @function groupAssets - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1.IGroupAssetsRequest} request GroupAssetsRequest message or plain object - * @param {google.cloud.securitycenter.v1.SecurityCenter.GroupAssetsCallback} callback Node-style callback called with the error, if any, and GroupAssetsResponse - * @returns {undefined} - * @variation 1 + * Decodes a Finding message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.Finding + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.Finding} Finding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Object.defineProperty(SecurityCenter.prototype.groupAssets = function groupAssets(request, callback) { - return this.rpcCall(groupAssets, $root.google.cloud.securitycenter.v1.GroupAssetsRequest, $root.google.cloud.securitycenter.v1.GroupAssetsResponse, request, callback); - }, "name", { value: "GroupAssets" }); + Finding.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; /** - * Calls GroupAssets. - * @function groupAssets - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1.IGroupAssetsRequest} request GroupAssetsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Verifies a Finding message. + * @function verify + * @memberof google.cloud.securitycenter.v1.Finding + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not */ + Finding.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.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.resourceName != null && message.hasOwnProperty("resourceName")) + if (!$util.isString(message.resourceName)) + return "resourceName: string expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: 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"; + if (message.externalUri != null && message.hasOwnProperty("externalUri")) + if (!$util.isString(message.externalUri)) + return "externalUri: string expected"; + if (message.sourceProperties != null && message.hasOwnProperty("sourceProperties")) { + if (!$util.isObject(message.sourceProperties)) + return "sourceProperties: object expected"; + var key = Object.keys(message.sourceProperties); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.protobuf.Value.verify(message.sourceProperties[key[i]]); + if (error) + return "sourceProperties." + error; + } + } + if (message.securityMarks != null && message.hasOwnProperty("securityMarks")) { + var error = $root.google.cloud.securitycenter.v1.SecurityMarks.verify(message.securityMarks); + if (error) + return "securityMarks." + error; + } + if (message.eventTime != null && message.hasOwnProperty("eventTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.eventTime); + if (error) + return "eventTime." + error; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + return null; + }; /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#groupFindings}. - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @typedef GroupFindingsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.securitycenter.v1.GroupFindingsResponse} [response] GroupFindingsResponse + * Creates a Finding message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.Finding + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.Finding} Finding */ + Finding.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.Finding) + return object; + var message = new $root.google.cloud.securitycenter.v1.Finding(); + if (object.name != null) + message.name = String(object.name); + if (object.parent != null) + message.parent = String(object.parent); + if (object.resourceName != null) + message.resourceName = String(object.resourceName); + switch (object.state) { + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "ACTIVE": + case 1: + message.state = 1; + break; + case "INACTIVE": + case 2: + message.state = 2; + break; + } + if (object.category != null) + message.category = String(object.category); + if (object.externalUri != null) + message.externalUri = String(object.externalUri); + if (object.sourceProperties) { + if (typeof object.sourceProperties !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Finding.sourceProperties: object expected"); + message.sourceProperties = {}; + for (var keys = Object.keys(object.sourceProperties), i = 0; i < keys.length; ++i) { + if (typeof object.sourceProperties[keys[i]] !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Finding.sourceProperties: object expected"); + message.sourceProperties[keys[i]] = $root.google.protobuf.Value.fromObject(object.sourceProperties[keys[i]]); + } + } + if (object.securityMarks != null) { + if (typeof object.securityMarks !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Finding.securityMarks: object expected"); + message.securityMarks = $root.google.cloud.securitycenter.v1.SecurityMarks.fromObject(object.securityMarks); + } + if (object.eventTime != null) { + if (typeof object.eventTime !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Finding.eventTime: object expected"); + message.eventTime = $root.google.protobuf.Timestamp.fromObject(object.eventTime); + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Finding.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + return message; + }; /** - * Calls GroupFindings. - * @function groupFindings - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1.IGroupFindingsRequest} request GroupFindingsRequest message or plain object - * @param {google.cloud.securitycenter.v1.SecurityCenter.GroupFindingsCallback} callback Node-style callback called with the error, if any, and GroupFindingsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(SecurityCenter.prototype.groupFindings = function groupFindings(request, callback) { - return this.rpcCall(groupFindings, $root.google.cloud.securitycenter.v1.GroupFindingsRequest, $root.google.cloud.securitycenter.v1.GroupFindingsResponse, request, callback); - }, "name", { value: "GroupFindings" }); - - /** - * Calls GroupFindings. - * @function groupFindings - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1.IGroupFindingsRequest} request GroupFindingsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#listAssets}. - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @typedef ListAssetsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.securitycenter.v1.ListAssetsResponse} [response] ListAssetsResponse + * Creates a plain object from a Finding message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.Finding + * @static + * @param {google.cloud.securitycenter.v1.Finding} message Finding + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object */ + Finding.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.sourceProperties = {}; + if (options.defaults) { + object.name = ""; + object.parent = ""; + object.resourceName = ""; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.category = ""; + object.externalUri = ""; + object.securityMarks = null; + object.eventTime = null; + object.createTime = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.resourceName != null && message.hasOwnProperty("resourceName")) + object.resourceName = message.resourceName; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.securitycenter.v1.Finding.State[message.state] : message.state; + if (message.category != null && message.hasOwnProperty("category")) + object.category = message.category; + if (message.externalUri != null && message.hasOwnProperty("externalUri")) + object.externalUri = message.externalUri; + var keys2; + if (message.sourceProperties && (keys2 = Object.keys(message.sourceProperties)).length) { + object.sourceProperties = {}; + for (var j = 0; j < keys2.length; ++j) + object.sourceProperties[keys2[j]] = $root.google.protobuf.Value.toObject(message.sourceProperties[keys2[j]], options); + } + if (message.securityMarks != null && message.hasOwnProperty("securityMarks")) + object.securityMarks = $root.google.cloud.securitycenter.v1.SecurityMarks.toObject(message.securityMarks, options); + if (message.eventTime != null && message.hasOwnProperty("eventTime")) + object.eventTime = $root.google.protobuf.Timestamp.toObject(message.eventTime, options); + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + return object; + }; /** - * Calls ListAssets. - * @function listAssets - * @memberof google.cloud.securitycenter.v1.SecurityCenter + * Converts this Finding to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.Finding * @instance - * @param {google.cloud.securitycenter.v1.IListAssetsRequest} request ListAssetsRequest message or plain object - * @param {google.cloud.securitycenter.v1.SecurityCenter.ListAssetsCallback} callback Node-style callback called with the error, if any, and ListAssetsResponse - * @returns {undefined} - * @variation 1 + * @returns {Object.} JSON object */ - Object.defineProperty(SecurityCenter.prototype.listAssets = function listAssets(request, callback) { - return this.rpcCall(listAssets, $root.google.cloud.securitycenter.v1.ListAssetsRequest, $root.google.cloud.securitycenter.v1.ListAssetsResponse, request, callback); - }, "name", { value: "ListAssets" }); + Finding.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; /** - * Calls ListAssets. - * @function listAssets - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1.IListAssetsRequest} request ListAssetsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * State enum. + * @name google.cloud.securitycenter.v1.Finding.State + * @enum {string} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} ACTIVE=1 ACTIVE value + * @property {number} INACTIVE=2 INACTIVE value */ + Finding.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ACTIVE"] = 1; + values[valuesById[2] = "INACTIVE"] = 2; + return values; + })(); - /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#listFindings}. - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @typedef ListFindingsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.securitycenter.v1.ListFindingsResponse} [response] ListFindingsResponse - */ + return Finding; + })(); - /** - * Calls ListFindings. - * @function listFindings - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1.IListFindingsRequest} request ListFindingsRequest message or plain object - * @param {google.cloud.securitycenter.v1.SecurityCenter.ListFindingsCallback} callback Node-style callback called with the error, if any, and ListFindingsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(SecurityCenter.prototype.listFindings = function listFindings(request, callback) { - return this.rpcCall(listFindings, $root.google.cloud.securitycenter.v1.ListFindingsRequest, $root.google.cloud.securitycenter.v1.ListFindingsResponse, request, callback); - }, "name", { value: "ListFindings" }); + v1.SecurityMarks = (function() { /** - * Calls ListFindings. - * @function listFindings - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1.IListFindingsRequest} request ListFindingsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Properties of a SecurityMarks. + * @memberof google.cloud.securitycenter.v1 + * @interface ISecurityMarks + * @property {string|null} [name] SecurityMarks name + * @property {Object.|null} [marks] SecurityMarks marks */ /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#listSources}. - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @typedef ListSourcesCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.securitycenter.v1.ListSourcesResponse} [response] ListSourcesResponse + * Constructs a new SecurityMarks. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a SecurityMarks. + * @implements ISecurityMarks + * @constructor + * @param {google.cloud.securitycenter.v1.ISecurityMarks=} [properties] Properties to set */ + function SecurityMarks(properties) { + this.marks = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } /** - * Calls ListSources. - * @function listSources - * @memberof google.cloud.securitycenter.v1.SecurityCenter + * SecurityMarks name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1.SecurityMarks * @instance - * @param {google.cloud.securitycenter.v1.IListSourcesRequest} request ListSourcesRequest message or plain object - * @param {google.cloud.securitycenter.v1.SecurityCenter.ListSourcesCallback} callback Node-style callback called with the error, if any, and ListSourcesResponse - * @returns {undefined} - * @variation 1 */ - Object.defineProperty(SecurityCenter.prototype.listSources = function listSources(request, callback) { - return this.rpcCall(listSources, $root.google.cloud.securitycenter.v1.ListSourcesRequest, $root.google.cloud.securitycenter.v1.ListSourcesResponse, request, callback); - }, "name", { value: "ListSources" }); + SecurityMarks.prototype.name = ""; /** - * Calls ListSources. - * @function listSources - * @memberof google.cloud.securitycenter.v1.SecurityCenter + * SecurityMarks marks. + * @member {Object.} marks + * @memberof google.cloud.securitycenter.v1.SecurityMarks * @instance - * @param {google.cloud.securitycenter.v1.IListSourcesRequest} request ListSourcesRequest message or plain object - * @returns {Promise} Promise - * @variation 2 */ + SecurityMarks.prototype.marks = $util.emptyObject; /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#runAssetDiscovery}. - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @typedef RunAssetDiscoveryCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation + * Creates a new SecurityMarks instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.SecurityMarks + * @static + * @param {google.cloud.securitycenter.v1.ISecurityMarks=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.SecurityMarks} SecurityMarks instance */ + SecurityMarks.create = function create(properties) { + return new SecurityMarks(properties); + }; /** - * Calls RunAssetDiscovery. - * @function runAssetDiscovery - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1.IRunAssetDiscoveryRequest} request RunAssetDiscoveryRequest message or plain object - * @param {google.cloud.securitycenter.v1.SecurityCenter.RunAssetDiscoveryCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 + * Encodes the specified SecurityMarks message. Does not implicitly {@link google.cloud.securitycenter.v1.SecurityMarks.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.SecurityMarks + * @static + * @param {google.cloud.securitycenter.v1.ISecurityMarks} message SecurityMarks message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - Object.defineProperty(SecurityCenter.prototype.runAssetDiscovery = function runAssetDiscovery(request, callback) { - return this.rpcCall(runAssetDiscovery, $root.google.cloud.securitycenter.v1.RunAssetDiscoveryRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "RunAssetDiscovery" }); + SecurityMarks.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.marks != null && message.hasOwnProperty("marks")) + for (var keys = Object.keys(message.marks), i = 0; i < keys.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.marks[keys[i]]).ldelim(); + return writer; + }; /** - * Calls RunAssetDiscovery. - * @function runAssetDiscovery - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1.IRunAssetDiscoveryRequest} request RunAssetDiscoveryRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Encodes the specified SecurityMarks message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.SecurityMarks.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.SecurityMarks + * @static + * @param {google.cloud.securitycenter.v1.ISecurityMarks} message SecurityMarks message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ + SecurityMarks.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#setFindingState}. - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @typedef SetFindingStateCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.securitycenter.v1.Finding} [response] Finding + * Decodes a SecurityMarks message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.SecurityMarks + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.SecurityMarks} SecurityMarks + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - - /** - * Calls SetFindingState. - * @function setFindingState - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1.ISetFindingStateRequest} request SetFindingStateRequest message or plain object - * @param {google.cloud.securitycenter.v1.SecurityCenter.SetFindingStateCallback} callback Node-style callback called with the error, if any, and Finding - * @returns {undefined} - * @variation 1 + SecurityMarks.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.cloud.securitycenter.v1.SecurityMarks(), key; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + reader.skip().pos++; + if (message.marks === $util.emptyObject) + message.marks = {}; + key = reader.string(); + reader.pos++; + message.marks[key] = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SecurityMarks message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.SecurityMarks + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.SecurityMarks} SecurityMarks + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Object.defineProperty(SecurityCenter.prototype.setFindingState = function setFindingState(request, callback) { - return this.rpcCall(setFindingState, $root.google.cloud.securitycenter.v1.SetFindingStateRequest, $root.google.cloud.securitycenter.v1.Finding, request, callback); - }, "name", { value: "SetFindingState" }); + SecurityMarks.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; /** - * Calls SetFindingState. - * @function setFindingState - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1.ISetFindingStateRequest} request SetFindingStateRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Verifies a SecurityMarks message. + * @function verify + * @memberof google.cloud.securitycenter.v1.SecurityMarks + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not */ + SecurityMarks.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.marks != null && message.hasOwnProperty("marks")) { + if (!$util.isObject(message.marks)) + return "marks: object expected"; + var key = Object.keys(message.marks); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.marks[key[i]])) + return "marks: string{k:string} expected"; + } + return null; + }; /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#setIamPolicy}. - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @typedef SetIamPolicyCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.iam.v1.Policy} [response] Policy + * Creates a SecurityMarks message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.SecurityMarks + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.SecurityMarks} SecurityMarks */ + SecurityMarks.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.SecurityMarks) + return object; + var message = new $root.google.cloud.securitycenter.v1.SecurityMarks(); + if (object.name != null) + message.name = String(object.name); + if (object.marks) { + if (typeof object.marks !== "object") + throw TypeError(".google.cloud.securitycenter.v1.SecurityMarks.marks: object expected"); + message.marks = {}; + for (var keys = Object.keys(object.marks), i = 0; i < keys.length; ++i) + message.marks[keys[i]] = String(object.marks[keys[i]]); + } + return message; + }; /** - * Calls SetIamPolicy. - * @function setIamPolicy - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @instance - * @param {google.iam.v1.ISetIamPolicyRequest} request SetIamPolicyRequest message or plain object - * @param {google.cloud.securitycenter.v1.SecurityCenter.SetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy - * @returns {undefined} - * @variation 1 + * Creates a plain object from a SecurityMarks message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.SecurityMarks + * @static + * @param {google.cloud.securitycenter.v1.SecurityMarks} message SecurityMarks + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object */ - Object.defineProperty(SecurityCenter.prototype.setIamPolicy = function setIamPolicy(request, callback) { - return this.rpcCall(setIamPolicy, $root.google.iam.v1.SetIamPolicyRequest, $root.google.iam.v1.Policy, request, callback); - }, "name", { value: "SetIamPolicy" }); + SecurityMarks.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.marks = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + var keys2; + if (message.marks && (keys2 = Object.keys(message.marks)).length) { + object.marks = {}; + for (var j = 0; j < keys2.length; ++j) + object.marks[keys2[j]] = message.marks[keys2[j]]; + } + return object; + }; /** - * Calls SetIamPolicy. - * @function setIamPolicy - * @memberof google.cloud.securitycenter.v1.SecurityCenter + * Converts this SecurityMarks to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.SecurityMarks * @instance - * @param {google.iam.v1.ISetIamPolicyRequest} request SetIamPolicyRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * @returns {Object.} JSON object */ + SecurityMarks.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SecurityMarks; + })(); + + v1.Asset = (function() { /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#testIamPermissions}. - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @typedef TestIamPermissionsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.iam.v1.TestIamPermissionsResponse} [response] TestIamPermissionsResponse + * Properties of an Asset. + * @memberof google.cloud.securitycenter.v1 + * @interface IAsset + * @property {string|null} [name] Asset name + * @property {google.cloud.securitycenter.v1.Asset.ISecurityCenterProperties|null} [securityCenterProperties] Asset securityCenterProperties + * @property {Object.|null} [resourceProperties] Asset resourceProperties + * @property {google.cloud.securitycenter.v1.ISecurityMarks|null} [securityMarks] Asset securityMarks + * @property {google.protobuf.ITimestamp|null} [createTime] Asset createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Asset updateTime + * @property {google.cloud.securitycenter.v1.Asset.IIamPolicy|null} [iamPolicy] Asset iamPolicy */ /** - * Calls TestIamPermissions. - * @function testIamPermissions - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @instance - * @param {google.iam.v1.ITestIamPermissionsRequest} request TestIamPermissionsRequest message or plain object - * @param {google.cloud.securitycenter.v1.SecurityCenter.TestIamPermissionsCallback} callback Node-style callback called with the error, if any, and TestIamPermissionsResponse - * @returns {undefined} - * @variation 1 + * Constructs a new Asset. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents an Asset. + * @implements IAsset + * @constructor + * @param {google.cloud.securitycenter.v1.IAsset=} [properties] Properties to set */ - Object.defineProperty(SecurityCenter.prototype.testIamPermissions = function testIamPermissions(request, callback) { - return this.rpcCall(testIamPermissions, $root.google.iam.v1.TestIamPermissionsRequest, $root.google.iam.v1.TestIamPermissionsResponse, request, callback); - }, "name", { value: "TestIamPermissions" }); + function Asset(properties) { + this.resourceProperties = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } /** - * Calls TestIamPermissions. - * @function testIamPermissions - * @memberof google.cloud.securitycenter.v1.SecurityCenter + * Asset name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1.Asset * @instance - * @param {google.iam.v1.ITestIamPermissionsRequest} request TestIamPermissionsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 */ + Asset.prototype.name = ""; /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#updateFinding}. - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @typedef UpdateFindingCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.securitycenter.v1.Finding} [response] Finding + * Asset securityCenterProperties. + * @member {google.cloud.securitycenter.v1.Asset.ISecurityCenterProperties|null|undefined} securityCenterProperties + * @memberof google.cloud.securitycenter.v1.Asset + * @instance */ + Asset.prototype.securityCenterProperties = null; /** - * Calls UpdateFinding. - * @function updateFinding - * @memberof google.cloud.securitycenter.v1.SecurityCenter + * Asset resourceProperties. + * @member {Object.} resourceProperties + * @memberof google.cloud.securitycenter.v1.Asset * @instance - * @param {google.cloud.securitycenter.v1.IUpdateFindingRequest} request UpdateFindingRequest message or plain object - * @param {google.cloud.securitycenter.v1.SecurityCenter.UpdateFindingCallback} callback Node-style callback called with the error, if any, and Finding - * @returns {undefined} - * @variation 1 */ - Object.defineProperty(SecurityCenter.prototype.updateFinding = function updateFinding(request, callback) { - return this.rpcCall(updateFinding, $root.google.cloud.securitycenter.v1.UpdateFindingRequest, $root.google.cloud.securitycenter.v1.Finding, request, callback); - }, "name", { value: "UpdateFinding" }); + Asset.prototype.resourceProperties = $util.emptyObject; /** - * Calls UpdateFinding. - * @function updateFinding - * @memberof google.cloud.securitycenter.v1.SecurityCenter + * Asset securityMarks. + * @member {google.cloud.securitycenter.v1.ISecurityMarks|null|undefined} securityMarks + * @memberof google.cloud.securitycenter.v1.Asset * @instance - * @param {google.cloud.securitycenter.v1.IUpdateFindingRequest} request UpdateFindingRequest message or plain object - * @returns {Promise} Promise - * @variation 2 */ + Asset.prototype.securityMarks = null; /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#updateOrganizationSettings}. - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @typedef UpdateOrganizationSettingsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.securitycenter.v1.OrganizationSettings} [response] OrganizationSettings + * Asset createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.securitycenter.v1.Asset + * @instance */ + Asset.prototype.createTime = null; /** - * Calls UpdateOrganizationSettings. - * @function updateOrganizationSettings - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1.IUpdateOrganizationSettingsRequest} request UpdateOrganizationSettingsRequest message or plain object - * @param {google.cloud.securitycenter.v1.SecurityCenter.UpdateOrganizationSettingsCallback} callback Node-style callback called with the error, if any, and OrganizationSettings - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(SecurityCenter.prototype.updateOrganizationSettings = function updateOrganizationSettings(request, callback) { - return this.rpcCall(updateOrganizationSettings, $root.google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest, $root.google.cloud.securitycenter.v1.OrganizationSettings, request, callback); - }, "name", { value: "UpdateOrganizationSettings" }); - - /** - * Calls UpdateOrganizationSettings. - * @function updateOrganizationSettings - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1.IUpdateOrganizationSettingsRequest} request UpdateOrganizationSettingsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#updateSource}. - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @typedef UpdateSourceCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.securitycenter.v1.Source} [response] Source - */ - - /** - * Calls UpdateSource. - * @function updateSource - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1.IUpdateSourceRequest} request UpdateSourceRequest message or plain object - * @param {google.cloud.securitycenter.v1.SecurityCenter.UpdateSourceCallback} callback Node-style callback called with the error, if any, and Source - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(SecurityCenter.prototype.updateSource = function updateSource(request, callback) { - return this.rpcCall(updateSource, $root.google.cloud.securitycenter.v1.UpdateSourceRequest, $root.google.cloud.securitycenter.v1.Source, request, callback); - }, "name", { value: "UpdateSource" }); - - /** - * Calls UpdateSource. - * @function updateSource - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1.IUpdateSourceRequest} request UpdateSourceRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#updateSecurityMarks}. - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @typedef UpdateSecurityMarksCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.securitycenter.v1.SecurityMarks} [response] SecurityMarks - */ - - /** - * Calls UpdateSecurityMarks. - * @function updateSecurityMarks - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1.IUpdateSecurityMarksRequest} request UpdateSecurityMarksRequest message or plain object - * @param {google.cloud.securitycenter.v1.SecurityCenter.UpdateSecurityMarksCallback} callback Node-style callback called with the error, if any, and SecurityMarks - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(SecurityCenter.prototype.updateSecurityMarks = function updateSecurityMarks(request, callback) { - return this.rpcCall(updateSecurityMarks, $root.google.cloud.securitycenter.v1.UpdateSecurityMarksRequest, $root.google.cloud.securitycenter.v1.SecurityMarks, request, callback); - }, "name", { value: "UpdateSecurityMarks" }); - - /** - * Calls UpdateSecurityMarks. - * @function updateSecurityMarks - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1.IUpdateSecurityMarksRequest} request UpdateSecurityMarksRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return SecurityCenter; - })(); - - v1.CreateFindingRequest = (function() { - - /** - * Properties of a CreateFindingRequest. - * @memberof google.cloud.securitycenter.v1 - * @interface ICreateFindingRequest - * @property {string|null} [parent] CreateFindingRequest parent - * @property {string|null} [findingId] CreateFindingRequest findingId - * @property {google.cloud.securitycenter.v1.IFinding|null} [finding] CreateFindingRequest finding - */ - - /** - * Constructs a new CreateFindingRequest. - * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents a CreateFindingRequest. - * @implements ICreateFindingRequest - * @constructor - * @param {google.cloud.securitycenter.v1.ICreateFindingRequest=} [properties] Properties to set - */ - function CreateFindingRequest(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]]; - } - - /** - * CreateFindingRequest parent. - * @member {string} parent - * @memberof google.cloud.securitycenter.v1.CreateFindingRequest - * @instance - */ - CreateFindingRequest.prototype.parent = ""; - - /** - * CreateFindingRequest findingId. - * @member {string} findingId - * @memberof google.cloud.securitycenter.v1.CreateFindingRequest + * Asset updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.securitycenter.v1.Asset * @instance */ - CreateFindingRequest.prototype.findingId = ""; + Asset.prototype.updateTime = null; /** - * CreateFindingRequest finding. - * @member {google.cloud.securitycenter.v1.IFinding|null|undefined} finding - * @memberof google.cloud.securitycenter.v1.CreateFindingRequest + * Asset iamPolicy. + * @member {google.cloud.securitycenter.v1.Asset.IIamPolicy|null|undefined} iamPolicy + * @memberof google.cloud.securitycenter.v1.Asset * @instance */ - CreateFindingRequest.prototype.finding = null; + Asset.prototype.iamPolicy = null; /** - * Creates a new CreateFindingRequest instance using the specified properties. + * Creates a new Asset instance using the specified properties. * @function create - * @memberof google.cloud.securitycenter.v1.CreateFindingRequest + * @memberof google.cloud.securitycenter.v1.Asset * @static - * @param {google.cloud.securitycenter.v1.ICreateFindingRequest=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.CreateFindingRequest} CreateFindingRequest instance + * @param {google.cloud.securitycenter.v1.IAsset=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.Asset} Asset instance */ - CreateFindingRequest.create = function create(properties) { - return new CreateFindingRequest(properties); + Asset.create = function create(properties) { + return new Asset(properties); }; /** - * Encodes the specified CreateFindingRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.CreateFindingRequest.verify|verify} messages. + * Encodes the specified Asset message. Does not implicitly {@link google.cloud.securitycenter.v1.Asset.verify|verify} messages. * @function encode - * @memberof google.cloud.securitycenter.v1.CreateFindingRequest + * @memberof google.cloud.securitycenter.v1.Asset * @static - * @param {google.cloud.securitycenter.v1.ICreateFindingRequest} message CreateFindingRequest message or plain object to encode + * @param {google.cloud.securitycenter.v1.IAsset} message Asset message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateFindingRequest.encode = function encode(message, writer) { + Asset.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && message.hasOwnProperty("parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.findingId != null && message.hasOwnProperty("findingId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.findingId); - if (message.finding != null && message.hasOwnProperty("finding")) - $root.google.cloud.securitycenter.v1.Finding.encode(message.finding, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.securityCenterProperties != null && message.hasOwnProperty("securityCenterProperties")) + $root.google.cloud.securitycenter.v1.Asset.SecurityCenterProperties.encode(message.securityCenterProperties, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.resourceProperties != null && message.hasOwnProperty("resourceProperties")) + for (var keys = Object.keys(message.resourceProperties), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 7, wireType 2 =*/58).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.protobuf.Value.encode(message.resourceProperties[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.securityMarks != null && message.hasOwnProperty("securityMarks")) + $root.google.cloud.securitycenter.v1.SecurityMarks.encode(message.securityMarks, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.createTime != null && message.hasOwnProperty("createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.iamPolicy != null && message.hasOwnProperty("iamPolicy")) + $root.google.cloud.securitycenter.v1.Asset.IamPolicy.encode(message.iamPolicy, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); return writer; }; /** - * Encodes the specified CreateFindingRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.CreateFindingRequest.verify|verify} messages. + * Encodes the specified Asset message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Asset.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.CreateFindingRequest + * @memberof google.cloud.securitycenter.v1.Asset * @static - * @param {google.cloud.securitycenter.v1.ICreateFindingRequest} message CreateFindingRequest message or plain object to encode + * @param {google.cloud.securitycenter.v1.IAsset} message Asset message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateFindingRequest.encodeDelimited = function encodeDelimited(message, writer) { + Asset.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a CreateFindingRequest message from the specified reader or buffer. + * Decodes an Asset message from the specified reader or buffer. * @function decode - * @memberof google.cloud.securitycenter.v1.CreateFindingRequest + * @memberof google.cloud.securitycenter.v1.Asset * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.CreateFindingRequest} CreateFindingRequest + * @returns {google.cloud.securitycenter.v1.Asset} Asset * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateFindingRequest.decode = function decode(reader, length) { + Asset.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.cloud.securitycenter.v1.CreateFindingRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.Asset(), key; while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.parent = reader.string(); + message.name = reader.string(); break; case 2: - message.findingId = reader.string(); + message.securityCenterProperties = $root.google.cloud.securitycenter.v1.Asset.SecurityCenterProperties.decode(reader, reader.uint32()); break; - case 3: - message.finding = $root.google.cloud.securitycenter.v1.Finding.decode(reader, reader.uint32()); + case 7: + reader.skip().pos++; + if (message.resourceProperties === $util.emptyObject) + message.resourceProperties = {}; + key = reader.string(); + reader.pos++; + message.resourceProperties[key] = $root.google.protobuf.Value.decode(reader, reader.uint32()); + break; + case 8: + message.securityMarks = $root.google.cloud.securitycenter.v1.SecurityMarks.decode(reader, reader.uint32()); + break; + case 9: + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 10: + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 11: + message.iamPolicy = $root.google.cloud.securitycenter.v1.Asset.IamPolicy.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -827,531 +958,749 @@ }; /** - * Decodes a CreateFindingRequest message from the specified reader or buffer, length delimited. + * Decodes an Asset message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.CreateFindingRequest + * @memberof google.cloud.securitycenter.v1.Asset * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.CreateFindingRequest} CreateFindingRequest + * @returns {google.cloud.securitycenter.v1.Asset} Asset * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateFindingRequest.decodeDelimited = function decodeDelimited(reader) { + Asset.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a CreateFindingRequest message. + * Verifies an Asset message. * @function verify - * @memberof google.cloud.securitycenter.v1.CreateFindingRequest + * @memberof google.cloud.securitycenter.v1.Asset * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - CreateFindingRequest.verify = function verify(message) { + Asset.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.findingId != null && message.hasOwnProperty("findingId")) - if (!$util.isString(message.findingId)) - return "findingId: string expected"; - if (message.finding != null && message.hasOwnProperty("finding")) { - var error = $root.google.cloud.securitycenter.v1.Finding.verify(message.finding); + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.securityCenterProperties != null && message.hasOwnProperty("securityCenterProperties")) { + var error = $root.google.cloud.securitycenter.v1.Asset.SecurityCenterProperties.verify(message.securityCenterProperties); if (error) - return "finding." + error; + return "securityCenterProperties." + error; } - return null; - }; - - /** - * Creates a CreateFindingRequest message from a plain object. Also converts values to their respective internal types. + if (message.resourceProperties != null && message.hasOwnProperty("resourceProperties")) { + if (!$util.isObject(message.resourceProperties)) + return "resourceProperties: object expected"; + var key = Object.keys(message.resourceProperties); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.protobuf.Value.verify(message.resourceProperties[key[i]]); + if (error) + return "resourceProperties." + error; + } + } + if (message.securityMarks != null && message.hasOwnProperty("securityMarks")) { + var error = $root.google.cloud.securitycenter.v1.SecurityMarks.verify(message.securityMarks); + if (error) + return "securityMarks." + error; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.iamPolicy != null && message.hasOwnProperty("iamPolicy")) { + var error = $root.google.cloud.securitycenter.v1.Asset.IamPolicy.verify(message.iamPolicy); + if (error) + return "iamPolicy." + error; + } + return null; + }; + + /** + * Creates an Asset message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.securitycenter.v1.CreateFindingRequest + * @memberof google.cloud.securitycenter.v1.Asset * @static * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.CreateFindingRequest} CreateFindingRequest + * @returns {google.cloud.securitycenter.v1.Asset} Asset */ - CreateFindingRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.CreateFindingRequest) + Asset.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.Asset) return object; - var message = new $root.google.cloud.securitycenter.v1.CreateFindingRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.findingId != null) - message.findingId = String(object.findingId); - if (object.finding != null) { - if (typeof object.finding !== "object") - throw TypeError(".google.cloud.securitycenter.v1.CreateFindingRequest.finding: object expected"); - message.finding = $root.google.cloud.securitycenter.v1.Finding.fromObject(object.finding); + var message = new $root.google.cloud.securitycenter.v1.Asset(); + if (object.name != null) + message.name = String(object.name); + if (object.securityCenterProperties != null) { + if (typeof object.securityCenterProperties !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Asset.securityCenterProperties: object expected"); + message.securityCenterProperties = $root.google.cloud.securitycenter.v1.Asset.SecurityCenterProperties.fromObject(object.securityCenterProperties); + } + if (object.resourceProperties) { + if (typeof object.resourceProperties !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Asset.resourceProperties: object expected"); + message.resourceProperties = {}; + for (var keys = Object.keys(object.resourceProperties), i = 0; i < keys.length; ++i) { + if (typeof object.resourceProperties[keys[i]] !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Asset.resourceProperties: object expected"); + message.resourceProperties[keys[i]] = $root.google.protobuf.Value.fromObject(object.resourceProperties[keys[i]]); + } + } + if (object.securityMarks != null) { + if (typeof object.securityMarks !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Asset.securityMarks: object expected"); + message.securityMarks = $root.google.cloud.securitycenter.v1.SecurityMarks.fromObject(object.securityMarks); + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Asset.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Asset.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.iamPolicy != null) { + if (typeof object.iamPolicy !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Asset.iamPolicy: object expected"); + message.iamPolicy = $root.google.cloud.securitycenter.v1.Asset.IamPolicy.fromObject(object.iamPolicy); } return message; }; /** - * Creates a plain object from a CreateFindingRequest message. Also converts values to other types if specified. + * Creates a plain object from an Asset message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.securitycenter.v1.CreateFindingRequest + * @memberof google.cloud.securitycenter.v1.Asset * @static - * @param {google.cloud.securitycenter.v1.CreateFindingRequest} message CreateFindingRequest + * @param {google.cloud.securitycenter.v1.Asset} message Asset * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CreateFindingRequest.toObject = function toObject(message, options) { + Asset.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; + if (options.objects || options.defaults) + object.resourceProperties = {}; if (options.defaults) { - object.parent = ""; - object.findingId = ""; - object.finding = null; + object.name = ""; + object.securityCenterProperties = null; + object.securityMarks = null; + object.createTime = null; + object.updateTime = null; + object.iamPolicy = null; } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.findingId != null && message.hasOwnProperty("findingId")) - object.findingId = message.findingId; - if (message.finding != null && message.hasOwnProperty("finding")) - object.finding = $root.google.cloud.securitycenter.v1.Finding.toObject(message.finding, options); + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.securityCenterProperties != null && message.hasOwnProperty("securityCenterProperties")) + object.securityCenterProperties = $root.google.cloud.securitycenter.v1.Asset.SecurityCenterProperties.toObject(message.securityCenterProperties, options); + var keys2; + if (message.resourceProperties && (keys2 = Object.keys(message.resourceProperties)).length) { + object.resourceProperties = {}; + for (var j = 0; j < keys2.length; ++j) + object.resourceProperties[keys2[j]] = $root.google.protobuf.Value.toObject(message.resourceProperties[keys2[j]], options); + } + if (message.securityMarks != null && message.hasOwnProperty("securityMarks")) + object.securityMarks = $root.google.cloud.securitycenter.v1.SecurityMarks.toObject(message.securityMarks, options); + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.iamPolicy != null && message.hasOwnProperty("iamPolicy")) + object.iamPolicy = $root.google.cloud.securitycenter.v1.Asset.IamPolicy.toObject(message.iamPolicy, options); return object; }; /** - * Converts this CreateFindingRequest to JSON. + * Converts this Asset to JSON. * @function toJSON - * @memberof google.cloud.securitycenter.v1.CreateFindingRequest + * @memberof google.cloud.securitycenter.v1.Asset * @instance * @returns {Object.} JSON object */ - CreateFindingRequest.prototype.toJSON = function toJSON() { + Asset.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return CreateFindingRequest; - })(); + Asset.SecurityCenterProperties = (function() { - v1.CreateSourceRequest = (function() { + /** + * Properties of a SecurityCenterProperties. + * @memberof google.cloud.securitycenter.v1.Asset + * @interface ISecurityCenterProperties + * @property {string|null} [resourceName] SecurityCenterProperties resourceName + * @property {string|null} [resourceType] SecurityCenterProperties resourceType + * @property {string|null} [resourceParent] SecurityCenterProperties resourceParent + * @property {string|null} [resourceProject] SecurityCenterProperties resourceProject + * @property {Array.|null} [resourceOwners] SecurityCenterProperties resourceOwners + * @property {string|null} [resourceDisplayName] SecurityCenterProperties resourceDisplayName + * @property {string|null} [resourceParentDisplayName] SecurityCenterProperties resourceParentDisplayName + * @property {string|null} [resourceProjectDisplayName] SecurityCenterProperties resourceProjectDisplayName + */ - /** - * Properties of a CreateSourceRequest. - * @memberof google.cloud.securitycenter.v1 - * @interface ICreateSourceRequest - * @property {string|null} [parent] CreateSourceRequest parent - * @property {google.cloud.securitycenter.v1.ISource|null} [source] CreateSourceRequest source - */ + /** + * Constructs a new SecurityCenterProperties. + * @memberof google.cloud.securitycenter.v1.Asset + * @classdesc Represents a SecurityCenterProperties. + * @implements ISecurityCenterProperties + * @constructor + * @param {google.cloud.securitycenter.v1.Asset.ISecurityCenterProperties=} [properties] Properties to set + */ + function SecurityCenterProperties(properties) { + this.resourceOwners = []; + 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]]; + } - /** - * Constructs a new CreateSourceRequest. - * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents a CreateSourceRequest. - * @implements ICreateSourceRequest - * @constructor - * @param {google.cloud.securitycenter.v1.ICreateSourceRequest=} [properties] Properties to set - */ - function CreateSourceRequest(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]]; - } + /** + * SecurityCenterProperties resourceName. + * @member {string} resourceName + * @memberof google.cloud.securitycenter.v1.Asset.SecurityCenterProperties + * @instance + */ + SecurityCenterProperties.prototype.resourceName = ""; - /** - * CreateSourceRequest parent. - * @member {string} parent - * @memberof google.cloud.securitycenter.v1.CreateSourceRequest - * @instance - */ - CreateSourceRequest.prototype.parent = ""; + /** + * SecurityCenterProperties resourceType. + * @member {string} resourceType + * @memberof google.cloud.securitycenter.v1.Asset.SecurityCenterProperties + * @instance + */ + SecurityCenterProperties.prototype.resourceType = ""; - /** - * CreateSourceRequest source. - * @member {google.cloud.securitycenter.v1.ISource|null|undefined} source - * @memberof google.cloud.securitycenter.v1.CreateSourceRequest - * @instance - */ - CreateSourceRequest.prototype.source = null; + /** + * SecurityCenterProperties resourceParent. + * @member {string} resourceParent + * @memberof google.cloud.securitycenter.v1.Asset.SecurityCenterProperties + * @instance + */ + SecurityCenterProperties.prototype.resourceParent = ""; - /** - * Creates a new CreateSourceRequest instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v1.CreateSourceRequest - * @static - * @param {google.cloud.securitycenter.v1.ICreateSourceRequest=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.CreateSourceRequest} CreateSourceRequest instance - */ - CreateSourceRequest.create = function create(properties) { - return new CreateSourceRequest(properties); - }; + /** + * SecurityCenterProperties resourceProject. + * @member {string} resourceProject + * @memberof google.cloud.securitycenter.v1.Asset.SecurityCenterProperties + * @instance + */ + SecurityCenterProperties.prototype.resourceProject = ""; - /** - * Encodes the specified CreateSourceRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.CreateSourceRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1.CreateSourceRequest - * @static - * @param {google.cloud.securitycenter.v1.ICreateSourceRequest} message CreateSourceRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateSourceRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && message.hasOwnProperty("parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.source != null && message.hasOwnProperty("source")) - $root.google.cloud.securitycenter.v1.Source.encode(message.source, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified CreateSourceRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.CreateSourceRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.CreateSourceRequest - * @static - * @param {google.cloud.securitycenter.v1.ICreateSourceRequest} message CreateSourceRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateSourceRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CreateSourceRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v1.CreateSourceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.CreateSourceRequest} CreateSourceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateSourceRequest.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.cloud.securitycenter.v1.CreateSourceRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.parent = reader.string(); - break; - case 2: - message.source = $root.google.cloud.securitycenter.v1.Source.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * SecurityCenterProperties resourceOwners. + * @member {Array.} resourceOwners + * @memberof google.cloud.securitycenter.v1.Asset.SecurityCenterProperties + * @instance + */ + SecurityCenterProperties.prototype.resourceOwners = $util.emptyArray; - /** - * Decodes a CreateSourceRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.CreateSourceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.CreateSourceRequest} CreateSourceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateSourceRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * SecurityCenterProperties resourceDisplayName. + * @member {string} resourceDisplayName + * @memberof google.cloud.securitycenter.v1.Asset.SecurityCenterProperties + * @instance + */ + SecurityCenterProperties.prototype.resourceDisplayName = ""; - /** - * Verifies a CreateSourceRequest message. - * @function verify - * @memberof google.cloud.securitycenter.v1.CreateSourceRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CreateSourceRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.source != null && message.hasOwnProperty("source")) { - var error = $root.google.cloud.securitycenter.v1.Source.verify(message.source); - if (error) - return "source." + error; - } - return null; - }; + /** + * SecurityCenterProperties resourceParentDisplayName. + * @member {string} resourceParentDisplayName + * @memberof google.cloud.securitycenter.v1.Asset.SecurityCenterProperties + * @instance + */ + SecurityCenterProperties.prototype.resourceParentDisplayName = ""; - /** - * Creates a CreateSourceRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v1.CreateSourceRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.CreateSourceRequest} CreateSourceRequest - */ - CreateSourceRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.CreateSourceRequest) - return object; - var message = new $root.google.cloud.securitycenter.v1.CreateSourceRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.source != null) { - if (typeof object.source !== "object") - throw TypeError(".google.cloud.securitycenter.v1.CreateSourceRequest.source: object expected"); - message.source = $root.google.cloud.securitycenter.v1.Source.fromObject(object.source); - } - return message; - }; + /** + * SecurityCenterProperties resourceProjectDisplayName. + * @member {string} resourceProjectDisplayName + * @memberof google.cloud.securitycenter.v1.Asset.SecurityCenterProperties + * @instance + */ + SecurityCenterProperties.prototype.resourceProjectDisplayName = ""; - /** - * Creates a plain object from a CreateSourceRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v1.CreateSourceRequest - * @static - * @param {google.cloud.securitycenter.v1.CreateSourceRequest} message CreateSourceRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CreateSourceRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.source = null; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.source != null && message.hasOwnProperty("source")) - object.source = $root.google.cloud.securitycenter.v1.Source.toObject(message.source, options); - return object; - }; + /** + * Creates a new SecurityCenterProperties instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.Asset.SecurityCenterProperties + * @static + * @param {google.cloud.securitycenter.v1.Asset.ISecurityCenterProperties=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.Asset.SecurityCenterProperties} SecurityCenterProperties instance + */ + SecurityCenterProperties.create = function create(properties) { + return new SecurityCenterProperties(properties); + }; - /** - * Converts this CreateSourceRequest to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1.CreateSourceRequest - * @instance - * @returns {Object.} JSON object - */ - CreateSourceRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Encodes the specified SecurityCenterProperties message. Does not implicitly {@link google.cloud.securitycenter.v1.Asset.SecurityCenterProperties.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.Asset.SecurityCenterProperties + * @static + * @param {google.cloud.securitycenter.v1.Asset.ISecurityCenterProperties} message SecurityCenterProperties message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SecurityCenterProperties.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.resourceName != null && message.hasOwnProperty("resourceName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.resourceName); + if (message.resourceType != null && message.hasOwnProperty("resourceType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.resourceType); + if (message.resourceParent != null && message.hasOwnProperty("resourceParent")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.resourceParent); + if (message.resourceProject != null && message.hasOwnProperty("resourceProject")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.resourceProject); + if (message.resourceOwners != null && message.resourceOwners.length) + for (var i = 0; i < message.resourceOwners.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.resourceOwners[i]); + if (message.resourceDisplayName != null && message.hasOwnProperty("resourceDisplayName")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.resourceDisplayName); + if (message.resourceParentDisplayName != null && message.hasOwnProperty("resourceParentDisplayName")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.resourceParentDisplayName); + if (message.resourceProjectDisplayName != null && message.hasOwnProperty("resourceProjectDisplayName")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.resourceProjectDisplayName); + return writer; + }; - return CreateSourceRequest; - })(); + /** + * Encodes the specified SecurityCenterProperties message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Asset.SecurityCenterProperties.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.Asset.SecurityCenterProperties + * @static + * @param {google.cloud.securitycenter.v1.Asset.ISecurityCenterProperties} message SecurityCenterProperties message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SecurityCenterProperties.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - v1.GetOrganizationSettingsRequest = (function() { + /** + * Decodes a SecurityCenterProperties message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.Asset.SecurityCenterProperties + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.Asset.SecurityCenterProperties} SecurityCenterProperties + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SecurityCenterProperties.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.cloud.securitycenter.v1.Asset.SecurityCenterProperties(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.resourceName = reader.string(); + break; + case 2: + message.resourceType = reader.string(); + break; + case 3: + message.resourceParent = reader.string(); + break; + case 4: + message.resourceProject = reader.string(); + break; + case 5: + if (!(message.resourceOwners && message.resourceOwners.length)) + message.resourceOwners = []; + message.resourceOwners.push(reader.string()); + break; + case 6: + message.resourceDisplayName = reader.string(); + break; + case 7: + message.resourceParentDisplayName = reader.string(); + break; + case 8: + message.resourceProjectDisplayName = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Properties of a GetOrganizationSettingsRequest. - * @memberof google.cloud.securitycenter.v1 - * @interface IGetOrganizationSettingsRequest - * @property {string|null} [name] GetOrganizationSettingsRequest name - */ - - /** - * Constructs a new GetOrganizationSettingsRequest. - * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents a GetOrganizationSettingsRequest. - * @implements IGetOrganizationSettingsRequest - * @constructor - * @param {google.cloud.securitycenter.v1.IGetOrganizationSettingsRequest=} [properties] Properties to set - */ - function GetOrganizationSettingsRequest(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]]; - } + /** + * Decodes a SecurityCenterProperties message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.Asset.SecurityCenterProperties + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.Asset.SecurityCenterProperties} SecurityCenterProperties + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SecurityCenterProperties.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * GetOrganizationSettingsRequest name. - * @member {string} name - * @memberof google.cloud.securitycenter.v1.GetOrganizationSettingsRequest - * @instance - */ - GetOrganizationSettingsRequest.prototype.name = ""; + /** + * Verifies a SecurityCenterProperties message. + * @function verify + * @memberof google.cloud.securitycenter.v1.Asset.SecurityCenterProperties + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SecurityCenterProperties.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.resourceName != null && message.hasOwnProperty("resourceName")) + if (!$util.isString(message.resourceName)) + return "resourceName: string expected"; + if (message.resourceType != null && message.hasOwnProperty("resourceType")) + if (!$util.isString(message.resourceType)) + return "resourceType: string expected"; + if (message.resourceParent != null && message.hasOwnProperty("resourceParent")) + if (!$util.isString(message.resourceParent)) + return "resourceParent: string expected"; + if (message.resourceProject != null && message.hasOwnProperty("resourceProject")) + if (!$util.isString(message.resourceProject)) + return "resourceProject: string expected"; + if (message.resourceOwners != null && message.hasOwnProperty("resourceOwners")) { + if (!Array.isArray(message.resourceOwners)) + return "resourceOwners: array expected"; + for (var i = 0; i < message.resourceOwners.length; ++i) + if (!$util.isString(message.resourceOwners[i])) + return "resourceOwners: string[] expected"; + } + if (message.resourceDisplayName != null && message.hasOwnProperty("resourceDisplayName")) + if (!$util.isString(message.resourceDisplayName)) + return "resourceDisplayName: string expected"; + if (message.resourceParentDisplayName != null && message.hasOwnProperty("resourceParentDisplayName")) + if (!$util.isString(message.resourceParentDisplayName)) + return "resourceParentDisplayName: string expected"; + if (message.resourceProjectDisplayName != null && message.hasOwnProperty("resourceProjectDisplayName")) + if (!$util.isString(message.resourceProjectDisplayName)) + return "resourceProjectDisplayName: string expected"; + return null; + }; - /** - * Creates a new GetOrganizationSettingsRequest instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v1.GetOrganizationSettingsRequest - * @static - * @param {google.cloud.securitycenter.v1.IGetOrganizationSettingsRequest=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.GetOrganizationSettingsRequest} GetOrganizationSettingsRequest instance - */ - GetOrganizationSettingsRequest.create = function create(properties) { - return new GetOrganizationSettingsRequest(properties); - }; + /** + * Creates a SecurityCenterProperties message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.Asset.SecurityCenterProperties + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.Asset.SecurityCenterProperties} SecurityCenterProperties + */ + SecurityCenterProperties.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.Asset.SecurityCenterProperties) + return object; + var message = new $root.google.cloud.securitycenter.v1.Asset.SecurityCenterProperties(); + if (object.resourceName != null) + message.resourceName = String(object.resourceName); + if (object.resourceType != null) + message.resourceType = String(object.resourceType); + if (object.resourceParent != null) + message.resourceParent = String(object.resourceParent); + if (object.resourceProject != null) + message.resourceProject = String(object.resourceProject); + if (object.resourceOwners) { + if (!Array.isArray(object.resourceOwners)) + throw TypeError(".google.cloud.securitycenter.v1.Asset.SecurityCenterProperties.resourceOwners: array expected"); + message.resourceOwners = []; + for (var i = 0; i < object.resourceOwners.length; ++i) + message.resourceOwners[i] = String(object.resourceOwners[i]); + } + if (object.resourceDisplayName != null) + message.resourceDisplayName = String(object.resourceDisplayName); + if (object.resourceParentDisplayName != null) + message.resourceParentDisplayName = String(object.resourceParentDisplayName); + if (object.resourceProjectDisplayName != null) + message.resourceProjectDisplayName = String(object.resourceProjectDisplayName); + return message; + }; - /** - * Encodes the specified GetOrganizationSettingsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.GetOrganizationSettingsRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1.GetOrganizationSettingsRequest - * @static - * @param {google.cloud.securitycenter.v1.IGetOrganizationSettingsRequest} message GetOrganizationSettingsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetOrganizationSettingsRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - return writer; - }; + /** + * Creates a plain object from a SecurityCenterProperties message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.Asset.SecurityCenterProperties + * @static + * @param {google.cloud.securitycenter.v1.Asset.SecurityCenterProperties} message SecurityCenterProperties + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SecurityCenterProperties.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.resourceOwners = []; + if (options.defaults) { + object.resourceName = ""; + object.resourceType = ""; + object.resourceParent = ""; + object.resourceProject = ""; + object.resourceDisplayName = ""; + object.resourceParentDisplayName = ""; + object.resourceProjectDisplayName = ""; + } + if (message.resourceName != null && message.hasOwnProperty("resourceName")) + object.resourceName = message.resourceName; + if (message.resourceType != null && message.hasOwnProperty("resourceType")) + object.resourceType = message.resourceType; + if (message.resourceParent != null && message.hasOwnProperty("resourceParent")) + object.resourceParent = message.resourceParent; + if (message.resourceProject != null && message.hasOwnProperty("resourceProject")) + object.resourceProject = message.resourceProject; + if (message.resourceOwners && message.resourceOwners.length) { + object.resourceOwners = []; + for (var j = 0; j < message.resourceOwners.length; ++j) + object.resourceOwners[j] = message.resourceOwners[j]; + } + if (message.resourceDisplayName != null && message.hasOwnProperty("resourceDisplayName")) + object.resourceDisplayName = message.resourceDisplayName; + if (message.resourceParentDisplayName != null && message.hasOwnProperty("resourceParentDisplayName")) + object.resourceParentDisplayName = message.resourceParentDisplayName; + if (message.resourceProjectDisplayName != null && message.hasOwnProperty("resourceProjectDisplayName")) + object.resourceProjectDisplayName = message.resourceProjectDisplayName; + return object; + }; - /** - * Encodes the specified GetOrganizationSettingsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.GetOrganizationSettingsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.GetOrganizationSettingsRequest - * @static - * @param {google.cloud.securitycenter.v1.IGetOrganizationSettingsRequest} message GetOrganizationSettingsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetOrganizationSettingsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Converts this SecurityCenterProperties to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.Asset.SecurityCenterProperties + * @instance + * @returns {Object.} JSON object + */ + SecurityCenterProperties.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Decodes a GetOrganizationSettingsRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v1.GetOrganizationSettingsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.GetOrganizationSettingsRequest} GetOrganizationSettingsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetOrganizationSettingsRequest.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.cloud.securitycenter.v1.GetOrganizationSettingsRequest(); - 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; - }; + return SecurityCenterProperties; + })(); - /** - * Decodes a GetOrganizationSettingsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.GetOrganizationSettingsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.GetOrganizationSettingsRequest} GetOrganizationSettingsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetOrganizationSettingsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + Asset.IamPolicy = (function() { - /** - * Verifies a GetOrganizationSettingsRequest message. - * @function verify - * @memberof google.cloud.securitycenter.v1.GetOrganizationSettingsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetOrganizationSettingsRequest.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; - }; + /** + * Properties of an IamPolicy. + * @memberof google.cloud.securitycenter.v1.Asset + * @interface IIamPolicy + * @property {string|null} [policyBlob] IamPolicy policyBlob + */ - /** - * Creates a GetOrganizationSettingsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v1.GetOrganizationSettingsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.GetOrganizationSettingsRequest} GetOrganizationSettingsRequest - */ - GetOrganizationSettingsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.GetOrganizationSettingsRequest) + /** + * Constructs a new IamPolicy. + * @memberof google.cloud.securitycenter.v1.Asset + * @classdesc Represents an IamPolicy. + * @implements IIamPolicy + * @constructor + * @param {google.cloud.securitycenter.v1.Asset.IIamPolicy=} [properties] Properties to set + */ + function IamPolicy(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]]; + } + + /** + * IamPolicy policyBlob. + * @member {string} policyBlob + * @memberof google.cloud.securitycenter.v1.Asset.IamPolicy + * @instance + */ + IamPolicy.prototype.policyBlob = ""; + + /** + * Creates a new IamPolicy instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.Asset.IamPolicy + * @static + * @param {google.cloud.securitycenter.v1.Asset.IIamPolicy=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.Asset.IamPolicy} IamPolicy instance + */ + IamPolicy.create = function create(properties) { + return new IamPolicy(properties); + }; + + /** + * Encodes the specified IamPolicy message. Does not implicitly {@link google.cloud.securitycenter.v1.Asset.IamPolicy.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.Asset.IamPolicy + * @static + * @param {google.cloud.securitycenter.v1.Asset.IIamPolicy} message IamPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IamPolicy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.policyBlob != null && message.hasOwnProperty("policyBlob")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.policyBlob); + return writer; + }; + + /** + * Encodes the specified IamPolicy message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Asset.IamPolicy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.Asset.IamPolicy + * @static + * @param {google.cloud.securitycenter.v1.Asset.IIamPolicy} message IamPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IamPolicy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an IamPolicy message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.Asset.IamPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.Asset.IamPolicy} IamPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IamPolicy.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.cloud.securitycenter.v1.Asset.IamPolicy(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.policyBlob = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an IamPolicy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.Asset.IamPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.Asset.IamPolicy} IamPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IamPolicy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an IamPolicy message. + * @function verify + * @memberof google.cloud.securitycenter.v1.Asset.IamPolicy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IamPolicy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.policyBlob != null && message.hasOwnProperty("policyBlob")) + if (!$util.isString(message.policyBlob)) + return "policyBlob: string expected"; + return null; + }; + + /** + * Creates an IamPolicy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.Asset.IamPolicy + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.Asset.IamPolicy} IamPolicy + */ + IamPolicy.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.Asset.IamPolicy) + return object; + var message = new $root.google.cloud.securitycenter.v1.Asset.IamPolicy(); + if (object.policyBlob != null) + message.policyBlob = String(object.policyBlob); + return message; + }; + + /** + * Creates a plain object from an IamPolicy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.Asset.IamPolicy + * @static + * @param {google.cloud.securitycenter.v1.Asset.IamPolicy} message IamPolicy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IamPolicy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.policyBlob = ""; + if (message.policyBlob != null && message.hasOwnProperty("policyBlob")) + object.policyBlob = message.policyBlob; return object; - var message = new $root.google.cloud.securitycenter.v1.GetOrganizationSettingsRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; + }; - /** - * Creates a plain object from a GetOrganizationSettingsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v1.GetOrganizationSettingsRequest - * @static - * @param {google.cloud.securitycenter.v1.GetOrganizationSettingsRequest} message GetOrganizationSettingsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetOrganizationSettingsRequest.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 IamPolicy to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.Asset.IamPolicy + * @instance + * @returns {Object.} JSON object + */ + IamPolicy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Converts this GetOrganizationSettingsRequest to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1.GetOrganizationSettingsRequest - * @instance - * @returns {Object.} JSON object - */ - GetOrganizationSettingsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + return IamPolicy; + })(); - return GetOrganizationSettingsRequest; + return Asset; })(); - v1.GetSourceRequest = (function() { + v1.Source = (function() { /** - * Properties of a GetSourceRequest. + * Properties of a Source. * @memberof google.cloud.securitycenter.v1 - * @interface IGetSourceRequest - * @property {string|null} [name] GetSourceRequest name + * @interface ISource + * @property {string|null} [name] Source name + * @property {string|null} [displayName] Source displayName + * @property {string|null} [description] Source description */ /** - * Constructs a new GetSourceRequest. + * Constructs a new Source. * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents a GetSourceRequest. - * @implements IGetSourceRequest + * @classdesc Represents a Source. + * @implements ISource * @constructor - * @param {google.cloud.securitycenter.v1.IGetSourceRequest=} [properties] Properties to set + * @param {google.cloud.securitycenter.v1.ISource=} [properties] Properties to set */ - function GetSourceRequest(properties) { + function Source(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -1359,76 +1708,102 @@ } /** - * GetSourceRequest name. + * Source name. * @member {string} name - * @memberof google.cloud.securitycenter.v1.GetSourceRequest + * @memberof google.cloud.securitycenter.v1.Source * @instance */ - GetSourceRequest.prototype.name = ""; + Source.prototype.name = ""; /** - * Creates a new GetSourceRequest instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v1.GetSourceRequest - * @static - * @param {google.cloud.securitycenter.v1.IGetSourceRequest=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.GetSourceRequest} GetSourceRequest instance + * Source displayName. + * @member {string} displayName + * @memberof google.cloud.securitycenter.v1.Source + * @instance */ - GetSourceRequest.create = function create(properties) { - return new GetSourceRequest(properties); + Source.prototype.displayName = ""; + + /** + * Source description. + * @member {string} description + * @memberof google.cloud.securitycenter.v1.Source + * @instance + */ + Source.prototype.description = ""; + + /** + * Creates a new Source instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.Source + * @static + * @param {google.cloud.securitycenter.v1.ISource=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.Source} Source instance + */ + Source.create = function create(properties) { + return new Source(properties); }; /** - * Encodes the specified GetSourceRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.GetSourceRequest.verify|verify} messages. + * Encodes the specified Source message. Does not implicitly {@link google.cloud.securitycenter.v1.Source.verify|verify} messages. * @function encode - * @memberof google.cloud.securitycenter.v1.GetSourceRequest + * @memberof google.cloud.securitycenter.v1.Source * @static - * @param {google.cloud.securitycenter.v1.IGetSourceRequest} message GetSourceRequest message or plain object to encode + * @param {google.cloud.securitycenter.v1.ISource} message Source message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetSourceRequest.encode = function encode(message, writer) { + Source.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.name != null && message.hasOwnProperty("name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.displayName != null && message.hasOwnProperty("displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + if (message.description != null && message.hasOwnProperty("description")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); return writer; }; /** - * Encodes the specified GetSourceRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.GetSourceRequest.verify|verify} messages. + * Encodes the specified Source message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Source.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.GetSourceRequest + * @memberof google.cloud.securitycenter.v1.Source * @static - * @param {google.cloud.securitycenter.v1.IGetSourceRequest} message GetSourceRequest message or plain object to encode + * @param {google.cloud.securitycenter.v1.ISource} message Source message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetSourceRequest.encodeDelimited = function encodeDelimited(message, writer) { + Source.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GetSourceRequest message from the specified reader or buffer. + * Decodes a Source message from the specified reader or buffer. * @function decode - * @memberof google.cloud.securitycenter.v1.GetSourceRequest + * @memberof google.cloud.securitycenter.v1.Source * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.GetSourceRequest} GetSourceRequest + * @returns {google.cloud.securitycenter.v1.Source} Source * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetSourceRequest.decode = function decode(reader, length) { + Source.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.cloud.securitycenter.v1.GetSourceRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.Source(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.name = reader.string(); break; + case 2: + message.displayName = reader.string(); + break; + case 3: + message.description = reader.string(); + break; default: reader.skipType(tag & 7); break; @@ -1438,113 +1813,125 @@ }; /** - * Decodes a GetSourceRequest message from the specified reader or buffer, length delimited. + * Decodes a Source message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.GetSourceRequest + * @memberof google.cloud.securitycenter.v1.Source * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.GetSourceRequest} GetSourceRequest + * @returns {google.cloud.securitycenter.v1.Source} Source * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetSourceRequest.decodeDelimited = function decodeDelimited(reader) { + Source.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GetSourceRequest message. + * Verifies a Source message. * @function verify - * @memberof google.cloud.securitycenter.v1.GetSourceRequest + * @memberof google.cloud.securitycenter.v1.Source * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GetSourceRequest.verify = function verify(message) { + Source.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.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; return null; }; /** - * Creates a GetSourceRequest message from a plain object. Also converts values to their respective internal types. + * Creates a Source message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.securitycenter.v1.GetSourceRequest + * @memberof google.cloud.securitycenter.v1.Source * @static * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.GetSourceRequest} GetSourceRequest + * @returns {google.cloud.securitycenter.v1.Source} Source */ - GetSourceRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.GetSourceRequest) + Source.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.Source) return object; - var message = new $root.google.cloud.securitycenter.v1.GetSourceRequest(); + var message = new $root.google.cloud.securitycenter.v1.Source(); if (object.name != null) message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.description != null) + message.description = String(object.description); return message; }; /** - * Creates a plain object from a GetSourceRequest message. Also converts values to other types if specified. + * Creates a plain object from a Source message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.securitycenter.v1.GetSourceRequest + * @memberof google.cloud.securitycenter.v1.Source * @static - * @param {google.cloud.securitycenter.v1.GetSourceRequest} message GetSourceRequest + * @param {google.cloud.securitycenter.v1.Source} message Source * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GetSourceRequest.toObject = function toObject(message, options) { + Source.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) + if (options.defaults) { object.name = ""; + object.displayName = ""; + object.description = ""; + } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; return object; }; /** - * Converts this GetSourceRequest to JSON. + * Converts this Source to JSON. * @function toJSON - * @memberof google.cloud.securitycenter.v1.GetSourceRequest + * @memberof google.cloud.securitycenter.v1.Source * @instance * @returns {Object.} JSON object */ - GetSourceRequest.prototype.toJSON = function toJSON() { + Source.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return GetSourceRequest; + return Source; })(); - v1.GroupAssetsRequest = (function() { + v1.RunAssetDiscoveryResponse = (function() { /** - * Properties of a GroupAssetsRequest. + * Properties of a RunAssetDiscoveryResponse. * @memberof google.cloud.securitycenter.v1 - * @interface IGroupAssetsRequest - * @property {string|null} [parent] GroupAssetsRequest parent - * @property {string|null} [filter] GroupAssetsRequest filter - * @property {string|null} [groupBy] GroupAssetsRequest groupBy - * @property {google.protobuf.IDuration|null} [compareDuration] GroupAssetsRequest compareDuration - * @property {google.protobuf.ITimestamp|null} [readTime] GroupAssetsRequest readTime - * @property {string|null} [pageToken] GroupAssetsRequest pageToken - * @property {number|null} [pageSize] GroupAssetsRequest pageSize + * @interface IRunAssetDiscoveryResponse + * @property {google.cloud.securitycenter.v1.RunAssetDiscoveryResponse.State|null} [state] RunAssetDiscoveryResponse state + * @property {google.protobuf.IDuration|null} [duration] RunAssetDiscoveryResponse duration */ /** - * Constructs a new GroupAssetsRequest. + * Constructs a new RunAssetDiscoveryResponse. * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents a GroupAssetsRequest. - * @implements IGroupAssetsRequest + * @classdesc Represents a RunAssetDiscoveryResponse. + * @implements IRunAssetDiscoveryResponse * @constructor - * @param {google.cloud.securitycenter.v1.IGroupAssetsRequest=} [properties] Properties to set + * @param {google.cloud.securitycenter.v1.IRunAssetDiscoveryResponse=} [properties] Properties to set */ - function GroupAssetsRequest(properties) { + function RunAssetDiscoveryResponse(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -1552,153 +1939,88 @@ } /** - * GroupAssetsRequest parent. - * @member {string} parent - * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest - * @instance - */ - GroupAssetsRequest.prototype.parent = ""; - - /** - * GroupAssetsRequest filter. - * @member {string} filter - * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest - * @instance - */ - GroupAssetsRequest.prototype.filter = ""; - - /** - * GroupAssetsRequest groupBy. - * @member {string} groupBy - * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest - * @instance - */ - GroupAssetsRequest.prototype.groupBy = ""; - - /** - * GroupAssetsRequest compareDuration. - * @member {google.protobuf.IDuration|null|undefined} compareDuration - * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest - * @instance - */ - GroupAssetsRequest.prototype.compareDuration = null; - - /** - * GroupAssetsRequest readTime. - * @member {google.protobuf.ITimestamp|null|undefined} readTime - * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest - * @instance - */ - GroupAssetsRequest.prototype.readTime = null; - - /** - * GroupAssetsRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest + * RunAssetDiscoveryResponse state. + * @member {google.cloud.securitycenter.v1.RunAssetDiscoveryResponse.State} state + * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryResponse * @instance */ - GroupAssetsRequest.prototype.pageToken = ""; + RunAssetDiscoveryResponse.prototype.state = 0; /** - * GroupAssetsRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest + * RunAssetDiscoveryResponse duration. + * @member {google.protobuf.IDuration|null|undefined} duration + * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryResponse * @instance */ - GroupAssetsRequest.prototype.pageSize = 0; + RunAssetDiscoveryResponse.prototype.duration = null; /** - * Creates a new GroupAssetsRequest instance using the specified properties. + * Creates a new RunAssetDiscoveryResponse instance using the specified properties. * @function create - * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest + * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryResponse * @static - * @param {google.cloud.securitycenter.v1.IGroupAssetsRequest=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.GroupAssetsRequest} GroupAssetsRequest instance + * @param {google.cloud.securitycenter.v1.IRunAssetDiscoveryResponse=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.RunAssetDiscoveryResponse} RunAssetDiscoveryResponse instance */ - GroupAssetsRequest.create = function create(properties) { - return new GroupAssetsRequest(properties); + RunAssetDiscoveryResponse.create = function create(properties) { + return new RunAssetDiscoveryResponse(properties); }; /** - * Encodes the specified GroupAssetsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.GroupAssetsRequest.verify|verify} messages. + * Encodes the specified RunAssetDiscoveryResponse message. Does not implicitly {@link google.cloud.securitycenter.v1.RunAssetDiscoveryResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest + * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryResponse * @static - * @param {google.cloud.securitycenter.v1.IGroupAssetsRequest} message GroupAssetsRequest message or plain object to encode + * @param {google.cloud.securitycenter.v1.IRunAssetDiscoveryResponse} message RunAssetDiscoveryResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GroupAssetsRequest.encode = function encode(message, writer) { + RunAssetDiscoveryResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && message.hasOwnProperty("parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.filter != null && message.hasOwnProperty("filter")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); - if (message.groupBy != null && message.hasOwnProperty("groupBy")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.groupBy); - if (message.compareDuration != null && message.hasOwnProperty("compareDuration")) - $root.google.protobuf.Duration.encode(message.compareDuration, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.readTime != null && message.hasOwnProperty("readTime")) - $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.pageToken); - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - writer.uint32(/* id 8, wireType 0 =*/64).int32(message.pageSize); + if (message.state != null && message.hasOwnProperty("state")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.state); + if (message.duration != null && message.hasOwnProperty("duration")) + $root.google.protobuf.Duration.encode(message.duration, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** - * Encodes the specified GroupAssetsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.GroupAssetsRequest.verify|verify} messages. + * Encodes the specified RunAssetDiscoveryResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.RunAssetDiscoveryResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest + * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryResponse * @static - * @param {google.cloud.securitycenter.v1.IGroupAssetsRequest} message GroupAssetsRequest message or plain object to encode + * @param {google.cloud.securitycenter.v1.IRunAssetDiscoveryResponse} message RunAssetDiscoveryResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GroupAssetsRequest.encodeDelimited = function encodeDelimited(message, writer) { + RunAssetDiscoveryResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GroupAssetsRequest message from the specified reader or buffer. + * Decodes a RunAssetDiscoveryResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest + * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.GroupAssetsRequest} GroupAssetsRequest + * @returns {google.cloud.securitycenter.v1.RunAssetDiscoveryResponse} RunAssetDiscoveryResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GroupAssetsRequest.decode = function decode(reader, length) { + RunAssetDiscoveryResponse.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.cloud.securitycenter.v1.GroupAssetsRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.RunAssetDiscoveryResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.parent = reader.string(); + message.state = reader.int32(); break; case 2: - message.filter = reader.string(); - break; - case 3: - message.groupBy = reader.string(); - break; - case 4: - message.compareDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - case 5: - message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 7: - message.pageToken = reader.string(); - break; - case 8: - message.pageSize = reader.int32(); + message.duration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -1709,170 +2031,164 @@ }; /** - * Decodes a GroupAssetsRequest message from the specified reader or buffer, length delimited. + * Decodes a RunAssetDiscoveryResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest + * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.GroupAssetsRequest} GroupAssetsRequest + * @returns {google.cloud.securitycenter.v1.RunAssetDiscoveryResponse} RunAssetDiscoveryResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GroupAssetsRequest.decodeDelimited = function decodeDelimited(reader) { + RunAssetDiscoveryResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GroupAssetsRequest message. + * Verifies a RunAssetDiscoveryResponse message. * @function verify - * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest + * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GroupAssetsRequest.verify = function verify(message) { + RunAssetDiscoveryResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.filter != null && message.hasOwnProperty("filter")) - if (!$util.isString(message.filter)) - return "filter: string expected"; - if (message.groupBy != null && message.hasOwnProperty("groupBy")) - if (!$util.isString(message.groupBy)) - return "groupBy: string expected"; - if (message.compareDuration != null && message.hasOwnProperty("compareDuration")) { - var error = $root.google.protobuf.Duration.verify(message.compareDuration); - if (error) - return "compareDuration." + error; - } - if (message.readTime != null && message.hasOwnProperty("readTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.readTime); + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.duration != null && message.hasOwnProperty("duration")) { + var error = $root.google.protobuf.Duration.verify(message.duration); if (error) - return "readTime." + error; + return "duration." + error; } - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; return null; }; /** - * Creates a GroupAssetsRequest message from a plain object. Also converts values to their respective internal types. + * Creates a RunAssetDiscoveryResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest + * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.GroupAssetsRequest} GroupAssetsRequest + * @returns {google.cloud.securitycenter.v1.RunAssetDiscoveryResponse} RunAssetDiscoveryResponse */ - GroupAssetsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.GroupAssetsRequest) + RunAssetDiscoveryResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.RunAssetDiscoveryResponse) return object; - var message = new $root.google.cloud.securitycenter.v1.GroupAssetsRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.filter != null) - message.filter = String(object.filter); - if (object.groupBy != null) - message.groupBy = String(object.groupBy); - if (object.compareDuration != null) { - if (typeof object.compareDuration !== "object") - throw TypeError(".google.cloud.securitycenter.v1.GroupAssetsRequest.compareDuration: object expected"); - message.compareDuration = $root.google.protobuf.Duration.fromObject(object.compareDuration); + var message = new $root.google.cloud.securitycenter.v1.RunAssetDiscoveryResponse(); + switch (object.state) { + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "COMPLETED": + case 1: + message.state = 1; + break; + case "SUPERSEDED": + case 2: + message.state = 2; + break; + case "TERMINATED": + case 3: + message.state = 3; + break; } - if (object.readTime != null) { - if (typeof object.readTime !== "object") - throw TypeError(".google.cloud.securitycenter.v1.GroupAssetsRequest.readTime: object expected"); - message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); + if (object.duration != null) { + if (typeof object.duration !== "object") + throw TypeError(".google.cloud.securitycenter.v1.RunAssetDiscoveryResponse.duration: object expected"); + message.duration = $root.google.protobuf.Duration.fromObject(object.duration); } - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; return message; }; /** - * Creates a plain object from a GroupAssetsRequest message. Also converts values to other types if specified. + * Creates a plain object from a RunAssetDiscoveryResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest + * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryResponse * @static - * @param {google.cloud.securitycenter.v1.GroupAssetsRequest} message GroupAssetsRequest + * @param {google.cloud.securitycenter.v1.RunAssetDiscoveryResponse} message RunAssetDiscoveryResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GroupAssetsRequest.toObject = function toObject(message, options) { + RunAssetDiscoveryResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.parent = ""; - object.filter = ""; - object.groupBy = ""; - object.compareDuration = null; - object.readTime = null; - object.pageToken = ""; - object.pageSize = 0; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.duration = null; } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.filter != null && message.hasOwnProperty("filter")) - object.filter = message.filter; - if (message.groupBy != null && message.hasOwnProperty("groupBy")) - object.groupBy = message.groupBy; - if (message.compareDuration != null && message.hasOwnProperty("compareDuration")) - object.compareDuration = $root.google.protobuf.Duration.toObject(message.compareDuration, options); - if (message.readTime != null && message.hasOwnProperty("readTime")) - object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.securitycenter.v1.RunAssetDiscoveryResponse.State[message.state] : message.state; + if (message.duration != null && message.hasOwnProperty("duration")) + object.duration = $root.google.protobuf.Duration.toObject(message.duration, options); return object; }; /** - * Converts this GroupAssetsRequest to JSON. + * Converts this RunAssetDiscoveryResponse to JSON. * @function toJSON - * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest + * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryResponse * @instance * @returns {Object.} JSON object */ - GroupAssetsRequest.prototype.toJSON = function toJSON() { + RunAssetDiscoveryResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return GroupAssetsRequest; + /** + * State enum. + * @name google.cloud.securitycenter.v1.RunAssetDiscoveryResponse.State + * @enum {string} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} COMPLETED=1 COMPLETED value + * @property {number} SUPERSEDED=2 SUPERSEDED value + * @property {number} TERMINATED=3 TERMINATED value + */ + RunAssetDiscoveryResponse.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "COMPLETED"] = 1; + values[valuesById[2] = "SUPERSEDED"] = 2; + values[valuesById[3] = "TERMINATED"] = 3; + return values; + })(); + + return RunAssetDiscoveryResponse; })(); - v1.GroupAssetsResponse = (function() { + v1.OrganizationSettings = (function() { /** - * Properties of a GroupAssetsResponse. + * Properties of an OrganizationSettings. * @memberof google.cloud.securitycenter.v1 - * @interface IGroupAssetsResponse - * @property {Array.|null} [groupByResults] GroupAssetsResponse groupByResults - * @property {google.protobuf.ITimestamp|null} [readTime] GroupAssetsResponse readTime - * @property {string|null} [nextPageToken] GroupAssetsResponse nextPageToken - * @property {number|null} [totalSize] GroupAssetsResponse totalSize + * @interface IOrganizationSettings + * @property {string|null} [name] OrganizationSettings name + * @property {boolean|null} [enableAssetDiscovery] OrganizationSettings enableAssetDiscovery + * @property {google.cloud.securitycenter.v1.OrganizationSettings.IAssetDiscoveryConfig|null} [assetDiscoveryConfig] OrganizationSettings assetDiscoveryConfig */ /** - * Constructs a new GroupAssetsResponse. + * Constructs a new OrganizationSettings. * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents a GroupAssetsResponse. - * @implements IGroupAssetsResponse + * @classdesc Represents an OrganizationSettings. + * @implements IOrganizationSettings * @constructor - * @param {google.cloud.securitycenter.v1.IGroupAssetsResponse=} [properties] Properties to set + * @param {google.cloud.securitycenter.v1.IOrganizationSettings=} [properties] Properties to set */ - function GroupAssetsResponse(properties) { - this.groupByResults = []; + function OrganizationSettings(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -1880,117 +2196,101 @@ } /** - * GroupAssetsResponse groupByResults. - * @member {Array.} groupByResults - * @memberof google.cloud.securitycenter.v1.GroupAssetsResponse - * @instance - */ - GroupAssetsResponse.prototype.groupByResults = $util.emptyArray; - - /** - * GroupAssetsResponse readTime. - * @member {google.protobuf.ITimestamp|null|undefined} readTime - * @memberof google.cloud.securitycenter.v1.GroupAssetsResponse + * OrganizationSettings name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1.OrganizationSettings * @instance */ - GroupAssetsResponse.prototype.readTime = null; + OrganizationSettings.prototype.name = ""; /** - * GroupAssetsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.securitycenter.v1.GroupAssetsResponse + * OrganizationSettings enableAssetDiscovery. + * @member {boolean} enableAssetDiscovery + * @memberof google.cloud.securitycenter.v1.OrganizationSettings * @instance */ - GroupAssetsResponse.prototype.nextPageToken = ""; + OrganizationSettings.prototype.enableAssetDiscovery = false; /** - * GroupAssetsResponse totalSize. - * @member {number} totalSize - * @memberof google.cloud.securitycenter.v1.GroupAssetsResponse + * OrganizationSettings assetDiscoveryConfig. + * @member {google.cloud.securitycenter.v1.OrganizationSettings.IAssetDiscoveryConfig|null|undefined} assetDiscoveryConfig + * @memberof google.cloud.securitycenter.v1.OrganizationSettings * @instance */ - GroupAssetsResponse.prototype.totalSize = 0; + OrganizationSettings.prototype.assetDiscoveryConfig = null; /** - * Creates a new GroupAssetsResponse instance using the specified properties. + * Creates a new OrganizationSettings instance using the specified properties. * @function create - * @memberof google.cloud.securitycenter.v1.GroupAssetsResponse + * @memberof google.cloud.securitycenter.v1.OrganizationSettings * @static - * @param {google.cloud.securitycenter.v1.IGroupAssetsResponse=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.GroupAssetsResponse} GroupAssetsResponse instance + * @param {google.cloud.securitycenter.v1.IOrganizationSettings=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.OrganizationSettings} OrganizationSettings instance */ - GroupAssetsResponse.create = function create(properties) { - return new GroupAssetsResponse(properties); + OrganizationSettings.create = function create(properties) { + return new OrganizationSettings(properties); }; /** - * Encodes the specified GroupAssetsResponse message. Does not implicitly {@link google.cloud.securitycenter.v1.GroupAssetsResponse.verify|verify} messages. + * Encodes the specified OrganizationSettings message. Does not implicitly {@link google.cloud.securitycenter.v1.OrganizationSettings.verify|verify} messages. * @function encode - * @memberof google.cloud.securitycenter.v1.GroupAssetsResponse + * @memberof google.cloud.securitycenter.v1.OrganizationSettings * @static - * @param {google.cloud.securitycenter.v1.IGroupAssetsResponse} message GroupAssetsResponse message or plain object to encode + * @param {google.cloud.securitycenter.v1.IOrganizationSettings} message OrganizationSettings message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GroupAssetsResponse.encode = function encode(message, writer) { + OrganizationSettings.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.groupByResults != null && message.groupByResults.length) - for (var i = 0; i < message.groupByResults.length; ++i) - $root.google.cloud.securitycenter.v1.GroupResult.encode(message.groupByResults[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.readTime != null && message.hasOwnProperty("readTime")) - $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.nextPageToken); - if (message.totalSize != null && message.hasOwnProperty("totalSize")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.totalSize); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.enableAssetDiscovery != null && message.hasOwnProperty("enableAssetDiscovery")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.enableAssetDiscovery); + if (message.assetDiscoveryConfig != null && message.hasOwnProperty("assetDiscoveryConfig")) + $root.google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.encode(message.assetDiscoveryConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; /** - * Encodes the specified GroupAssetsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.GroupAssetsResponse.verify|verify} messages. + * Encodes the specified OrganizationSettings message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.OrganizationSettings.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.GroupAssetsResponse + * @memberof google.cloud.securitycenter.v1.OrganizationSettings * @static - * @param {google.cloud.securitycenter.v1.IGroupAssetsResponse} message GroupAssetsResponse message or plain object to encode + * @param {google.cloud.securitycenter.v1.IOrganizationSettings} message OrganizationSettings message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GroupAssetsResponse.encodeDelimited = function encodeDelimited(message, writer) { + OrganizationSettings.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GroupAssetsResponse message from the specified reader or buffer. + * Decodes an OrganizationSettings message from the specified reader or buffer. * @function decode - * @memberof google.cloud.securitycenter.v1.GroupAssetsResponse + * @memberof google.cloud.securitycenter.v1.OrganizationSettings * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.GroupAssetsResponse} GroupAssetsResponse + * @returns {google.cloud.securitycenter.v1.OrganizationSettings} OrganizationSettings * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GroupAssetsResponse.decode = function decode(reader, length) { + OrganizationSettings.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.cloud.securitycenter.v1.GroupAssetsResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.OrganizationSettings(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - if (!(message.groupByResults && message.groupByResults.length)) - message.groupByResults = []; - message.groupByResults.push($root.google.cloud.securitycenter.v1.GroupResult.decode(reader, reader.uint32())); + message.name = reader.string(); break; case 2: - message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + message.enableAssetDiscovery = reader.bool(); break; case 3: - message.nextPageToken = reader.string(); - break; - case 4: - message.totalSize = reader.int32(); + message.assetDiscoveryConfig = $root.google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -2001,1111 +2301,1111 @@ }; /** - * Decodes a GroupAssetsResponse message from the specified reader or buffer, length delimited. + * Decodes an OrganizationSettings message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.GroupAssetsResponse + * @memberof google.cloud.securitycenter.v1.OrganizationSettings * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.GroupAssetsResponse} GroupAssetsResponse + * @returns {google.cloud.securitycenter.v1.OrganizationSettings} OrganizationSettings * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GroupAssetsResponse.decodeDelimited = function decodeDelimited(reader) { + OrganizationSettings.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GroupAssetsResponse message. + * Verifies an OrganizationSettings message. * @function verify - * @memberof google.cloud.securitycenter.v1.GroupAssetsResponse + * @memberof google.cloud.securitycenter.v1.OrganizationSettings * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GroupAssetsResponse.verify = function verify(message) { + OrganizationSettings.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.groupByResults != null && message.hasOwnProperty("groupByResults")) { - if (!Array.isArray(message.groupByResults)) - return "groupByResults: array expected"; - for (var i = 0; i < message.groupByResults.length; ++i) { - var error = $root.google.cloud.securitycenter.v1.GroupResult.verify(message.groupByResults[i]); - if (error) - return "groupByResults." + error; - } - } - if (message.readTime != null && message.hasOwnProperty("readTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.readTime); + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.enableAssetDiscovery != null && message.hasOwnProperty("enableAssetDiscovery")) + if (typeof message.enableAssetDiscovery !== "boolean") + return "enableAssetDiscovery: boolean expected"; + if (message.assetDiscoveryConfig != null && message.hasOwnProperty("assetDiscoveryConfig")) { + var error = $root.google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.verify(message.assetDiscoveryConfig); if (error) - return "readTime." + error; + return "assetDiscoveryConfig." + error; } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - if (message.totalSize != null && message.hasOwnProperty("totalSize")) - if (!$util.isInteger(message.totalSize)) - return "totalSize: integer expected"; return null; }; /** - * Creates a GroupAssetsResponse message from a plain object. Also converts values to their respective internal types. + * Creates an OrganizationSettings message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.securitycenter.v1.GroupAssetsResponse + * @memberof google.cloud.securitycenter.v1.OrganizationSettings * @static * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.GroupAssetsResponse} GroupAssetsResponse + * @returns {google.cloud.securitycenter.v1.OrganizationSettings} OrganizationSettings */ - GroupAssetsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.GroupAssetsResponse) + OrganizationSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.OrganizationSettings) return object; - var message = new $root.google.cloud.securitycenter.v1.GroupAssetsResponse(); - if (object.groupByResults) { - if (!Array.isArray(object.groupByResults)) - throw TypeError(".google.cloud.securitycenter.v1.GroupAssetsResponse.groupByResults: array expected"); - message.groupByResults = []; - for (var i = 0; i < object.groupByResults.length; ++i) { - if (typeof object.groupByResults[i] !== "object") - throw TypeError(".google.cloud.securitycenter.v1.GroupAssetsResponse.groupByResults: object expected"); - message.groupByResults[i] = $root.google.cloud.securitycenter.v1.GroupResult.fromObject(object.groupByResults[i]); - } - } - if (object.readTime != null) { - if (typeof object.readTime !== "object") - throw TypeError(".google.cloud.securitycenter.v1.GroupAssetsResponse.readTime: object expected"); - message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); + var message = new $root.google.cloud.securitycenter.v1.OrganizationSettings(); + if (object.name != null) + message.name = String(object.name); + if (object.enableAssetDiscovery != null) + message.enableAssetDiscovery = Boolean(object.enableAssetDiscovery); + if (object.assetDiscoveryConfig != null) { + if (typeof object.assetDiscoveryConfig !== "object") + throw TypeError(".google.cloud.securitycenter.v1.OrganizationSettings.assetDiscoveryConfig: object expected"); + message.assetDiscoveryConfig = $root.google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.fromObject(object.assetDiscoveryConfig); } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - if (object.totalSize != null) - message.totalSize = object.totalSize | 0; return message; }; /** - * Creates a plain object from a GroupAssetsResponse message. Also converts values to other types if specified. + * Creates a plain object from an OrganizationSettings message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.securitycenter.v1.GroupAssetsResponse + * @memberof google.cloud.securitycenter.v1.OrganizationSettings * @static - * @param {google.cloud.securitycenter.v1.GroupAssetsResponse} message GroupAssetsResponse + * @param {google.cloud.securitycenter.v1.OrganizationSettings} message OrganizationSettings * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GroupAssetsResponse.toObject = function toObject(message, options) { + OrganizationSettings.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.groupByResults = []; if (options.defaults) { - object.readTime = null; - object.nextPageToken = ""; - object.totalSize = 0; - } - if (message.groupByResults && message.groupByResults.length) { - object.groupByResults = []; - for (var j = 0; j < message.groupByResults.length; ++j) - object.groupByResults[j] = $root.google.cloud.securitycenter.v1.GroupResult.toObject(message.groupByResults[j], options); + object.name = ""; + object.enableAssetDiscovery = false; + object.assetDiscoveryConfig = null; } - if (message.readTime != null && message.hasOwnProperty("readTime")) - object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - if (message.totalSize != null && message.hasOwnProperty("totalSize")) - object.totalSize = message.totalSize; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.enableAssetDiscovery != null && message.hasOwnProperty("enableAssetDiscovery")) + object.enableAssetDiscovery = message.enableAssetDiscovery; + if (message.assetDiscoveryConfig != null && message.hasOwnProperty("assetDiscoveryConfig")) + object.assetDiscoveryConfig = $root.google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.toObject(message.assetDiscoveryConfig, options); return object; }; /** - * Converts this GroupAssetsResponse to JSON. + * Converts this OrganizationSettings to JSON. * @function toJSON - * @memberof google.cloud.securitycenter.v1.GroupAssetsResponse + * @memberof google.cloud.securitycenter.v1.OrganizationSettings * @instance * @returns {Object.} JSON object */ - GroupAssetsResponse.prototype.toJSON = function toJSON() { + OrganizationSettings.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return GroupAssetsResponse; - })(); + OrganizationSettings.AssetDiscoveryConfig = (function() { - v1.GroupFindingsRequest = (function() { + /** + * Properties of an AssetDiscoveryConfig. + * @memberof google.cloud.securitycenter.v1.OrganizationSettings + * @interface IAssetDiscoveryConfig + * @property {Array.|null} [projectIds] AssetDiscoveryConfig projectIds + * @property {google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode|null} [inclusionMode] AssetDiscoveryConfig inclusionMode + */ - /** - * Properties of a GroupFindingsRequest. - * @memberof google.cloud.securitycenter.v1 - * @interface IGroupFindingsRequest - * @property {string|null} [parent] GroupFindingsRequest parent - * @property {string|null} [filter] GroupFindingsRequest filter - * @property {string|null} [groupBy] GroupFindingsRequest groupBy - * @property {google.protobuf.ITimestamp|null} [readTime] GroupFindingsRequest readTime - * @property {google.protobuf.IDuration|null} [compareDuration] GroupFindingsRequest compareDuration - * @property {string|null} [pageToken] GroupFindingsRequest pageToken - * @property {number|null} [pageSize] GroupFindingsRequest pageSize - */ + /** + * Constructs a new AssetDiscoveryConfig. + * @memberof google.cloud.securitycenter.v1.OrganizationSettings + * @classdesc Represents an AssetDiscoveryConfig. + * @implements IAssetDiscoveryConfig + * @constructor + * @param {google.cloud.securitycenter.v1.OrganizationSettings.IAssetDiscoveryConfig=} [properties] Properties to set + */ + function AssetDiscoveryConfig(properties) { + this.projectIds = []; + 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]]; + } - /** - * Constructs a new GroupFindingsRequest. - * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents a GroupFindingsRequest. - * @implements IGroupFindingsRequest - * @constructor - * @param {google.cloud.securitycenter.v1.IGroupFindingsRequest=} [properties] Properties to set - */ - function GroupFindingsRequest(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]]; - } + /** + * AssetDiscoveryConfig projectIds. + * @member {Array.} projectIds + * @memberof google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig + * @instance + */ + AssetDiscoveryConfig.prototype.projectIds = $util.emptyArray; - /** - * GroupFindingsRequest parent. - * @member {string} parent - * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest - * @instance - */ - GroupFindingsRequest.prototype.parent = ""; + /** + * AssetDiscoveryConfig inclusionMode. + * @member {google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode} inclusionMode + * @memberof google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig + * @instance + */ + AssetDiscoveryConfig.prototype.inclusionMode = 0; - /** - * GroupFindingsRequest filter. - * @member {string} filter - * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest - * @instance - */ - GroupFindingsRequest.prototype.filter = ""; + /** + * Creates a new AssetDiscoveryConfig instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig + * @static + * @param {google.cloud.securitycenter.v1.OrganizationSettings.IAssetDiscoveryConfig=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig} AssetDiscoveryConfig instance + */ + AssetDiscoveryConfig.create = function create(properties) { + return new AssetDiscoveryConfig(properties); + }; - /** - * GroupFindingsRequest groupBy. - * @member {string} groupBy - * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest - * @instance - */ - GroupFindingsRequest.prototype.groupBy = ""; + /** + * Encodes the specified AssetDiscoveryConfig message. Does not implicitly {@link google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig + * @static + * @param {google.cloud.securitycenter.v1.OrganizationSettings.IAssetDiscoveryConfig} message AssetDiscoveryConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AssetDiscoveryConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.projectIds != null && message.projectIds.length) + for (var i = 0; i < message.projectIds.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectIds[i]); + if (message.inclusionMode != null && message.hasOwnProperty("inclusionMode")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.inclusionMode); + return writer; + }; - /** - * GroupFindingsRequest readTime. - * @member {google.protobuf.ITimestamp|null|undefined} readTime - * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest - * @instance - */ - GroupFindingsRequest.prototype.readTime = null; + /** + * Encodes the specified AssetDiscoveryConfig message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig + * @static + * @param {google.cloud.securitycenter.v1.OrganizationSettings.IAssetDiscoveryConfig} message AssetDiscoveryConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AssetDiscoveryConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * GroupFindingsRequest compareDuration. - * @member {google.protobuf.IDuration|null|undefined} compareDuration - * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest - * @instance - */ - GroupFindingsRequest.prototype.compareDuration = null; + /** + * Decodes an AssetDiscoveryConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig} AssetDiscoveryConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AssetDiscoveryConfig.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.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.projectIds && message.projectIds.length)) + message.projectIds = []; + message.projectIds.push(reader.string()); + break; + case 2: + message.inclusionMode = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * GroupFindingsRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest - * @instance - */ - GroupFindingsRequest.prototype.pageToken = ""; + /** + * Decodes an AssetDiscoveryConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig} AssetDiscoveryConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AssetDiscoveryConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AssetDiscoveryConfig message. + * @function verify + * @memberof google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AssetDiscoveryConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.projectIds != null && message.hasOwnProperty("projectIds")) { + if (!Array.isArray(message.projectIds)) + return "projectIds: array expected"; + for (var i = 0; i < message.projectIds.length; ++i) + if (!$util.isString(message.projectIds[i])) + return "projectIds: string[] expected"; + } + if (message.inclusionMode != null && message.hasOwnProperty("inclusionMode")) + switch (message.inclusionMode) { + default: + return "inclusionMode: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates an AssetDiscoveryConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig} AssetDiscoveryConfig + */ + AssetDiscoveryConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig) + return object; + var message = new $root.google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig(); + if (object.projectIds) { + if (!Array.isArray(object.projectIds)) + throw TypeError(".google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.projectIds: array expected"); + message.projectIds = []; + for (var i = 0; i < object.projectIds.length; ++i) + message.projectIds[i] = String(object.projectIds[i]); + } + switch (object.inclusionMode) { + case "INCLUSION_MODE_UNSPECIFIED": + case 0: + message.inclusionMode = 0; + break; + case "INCLUDE_ONLY": + case 1: + message.inclusionMode = 1; + break; + case "EXCLUDE": + case 2: + message.inclusionMode = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from an AssetDiscoveryConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig + * @static + * @param {google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig} message AssetDiscoveryConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AssetDiscoveryConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.projectIds = []; + if (options.defaults) + object.inclusionMode = options.enums === String ? "INCLUSION_MODE_UNSPECIFIED" : 0; + if (message.projectIds && message.projectIds.length) { + object.projectIds = []; + for (var j = 0; j < message.projectIds.length; ++j) + object.projectIds[j] = message.projectIds[j]; + } + if (message.inclusionMode != null && message.hasOwnProperty("inclusionMode")) + object.inclusionMode = options.enums === String ? $root.google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode[message.inclusionMode] : message.inclusionMode; + return object; + }; + + /** + * Converts this AssetDiscoveryConfig to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig + * @instance + * @returns {Object.} JSON object + */ + AssetDiscoveryConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * InclusionMode enum. + * @name google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode + * @enum {string} + * @property {number} INCLUSION_MODE_UNSPECIFIED=0 INCLUSION_MODE_UNSPECIFIED value + * @property {number} INCLUDE_ONLY=1 INCLUDE_ONLY value + * @property {number} EXCLUDE=2 EXCLUDE value + */ + AssetDiscoveryConfig.InclusionMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "INCLUSION_MODE_UNSPECIFIED"] = 0; + values[valuesById[1] = "INCLUDE_ONLY"] = 1; + values[valuesById[2] = "EXCLUDE"] = 2; + return values; + })(); + + return AssetDiscoveryConfig; + })(); + + return OrganizationSettings; + })(); + + v1.SecurityCenter = (function() { /** - * GroupFindingsRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest - * @instance + * Constructs a new SecurityCenter service. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a SecurityCenter + * @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 */ - GroupFindingsRequest.prototype.pageSize = 0; + function SecurityCenter(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (SecurityCenter.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = SecurityCenter; /** - * Creates a new GroupFindingsRequest instance using the specified properties. + * Creates new SecurityCenter service using the specified rpc implementation. * @function create - * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest + * @memberof google.cloud.securitycenter.v1.SecurityCenter * @static - * @param {google.cloud.securitycenter.v1.IGroupFindingsRequest=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.GroupFindingsRequest} GroupFindingsRequest instance + * @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 {SecurityCenter} RPC service. Useful where requests and/or responses are streamed. */ - GroupFindingsRequest.create = function create(properties) { - return new GroupFindingsRequest(properties); + SecurityCenter.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); }; /** - * Encodes the specified GroupFindingsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.GroupFindingsRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest - * @static - * @param {google.cloud.securitycenter.v1.IGroupFindingsRequest} message GroupFindingsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#createSource}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef CreateSourceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1.Source} [response] Source */ - GroupFindingsRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && message.hasOwnProperty("parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.filter != null && message.hasOwnProperty("filter")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); - if (message.groupBy != null && message.hasOwnProperty("groupBy")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.groupBy); - if (message.readTime != null && message.hasOwnProperty("readTime")) - $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.compareDuration != null && message.hasOwnProperty("compareDuration")) - $root.google.protobuf.Duration.encode(message.compareDuration, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.pageToken); - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - writer.uint32(/* id 8, wireType 0 =*/64).int32(message.pageSize); - return writer; - }; /** - * Encodes the specified GroupFindingsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.GroupFindingsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest - * @static - * @param {google.cloud.securitycenter.v1.IGroupFindingsRequest} message GroupFindingsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * Calls CreateSource. + * @function createSource + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.ICreateSourceRequest} request CreateSourceRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.CreateSourceCallback} callback Node-style callback called with the error, if any, and Source + * @returns {undefined} + * @variation 1 */ - GroupFindingsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + Object.defineProperty(SecurityCenter.prototype.createSource = function createSource(request, callback) { + return this.rpcCall(createSource, $root.google.cloud.securitycenter.v1.CreateSourceRequest, $root.google.cloud.securitycenter.v1.Source, request, callback); + }, "name", { value: "CreateSource" }); /** - * Decodes a GroupFindingsRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.GroupFindingsRequest} GroupFindingsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Calls CreateSource. + * @function createSource + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.ICreateSourceRequest} request CreateSourceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - GroupFindingsRequest.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.cloud.securitycenter.v1.GroupFindingsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.parent = reader.string(); - break; - case 2: - message.filter = reader.string(); - break; - case 3: - message.groupBy = reader.string(); - break; - case 4: - message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 5: - message.compareDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - case 7: - message.pageToken = reader.string(); - break; - case 8: - message.pageSize = reader.int32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; /** - * Decodes a GroupFindingsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.GroupFindingsRequest} GroupFindingsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#createFinding}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef CreateFindingCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1.Finding} [response] Finding */ - GroupFindingsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; /** - * Verifies a GroupFindingsRequest message. - * @function verify - * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not + * Calls CreateFinding. + * @function createFinding + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.ICreateFindingRequest} request CreateFindingRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.CreateFindingCallback} callback Node-style callback called with the error, if any, and Finding + * @returns {undefined} + * @variation 1 */ - GroupFindingsRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.filter != null && message.hasOwnProperty("filter")) - if (!$util.isString(message.filter)) - return "filter: string expected"; - if (message.groupBy != null && message.hasOwnProperty("groupBy")) - if (!$util.isString(message.groupBy)) - return "groupBy: string expected"; - if (message.readTime != null && message.hasOwnProperty("readTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.readTime); - if (error) - return "readTime." + error; - } - if (message.compareDuration != null && message.hasOwnProperty("compareDuration")) { - var error = $root.google.protobuf.Duration.verify(message.compareDuration); - if (error) - return "compareDuration." + error; - } - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; - return null; - }; + Object.defineProperty(SecurityCenter.prototype.createFinding = function createFinding(request, callback) { + return this.rpcCall(createFinding, $root.google.cloud.securitycenter.v1.CreateFindingRequest, $root.google.cloud.securitycenter.v1.Finding, request, callback); + }, "name", { value: "CreateFinding" }); /** - * Creates a GroupFindingsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.GroupFindingsRequest} GroupFindingsRequest + * Calls CreateFinding. + * @function createFinding + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.ICreateFindingRequest} request CreateFindingRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - GroupFindingsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.GroupFindingsRequest) - return object; - var message = new $root.google.cloud.securitycenter.v1.GroupFindingsRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.filter != null) - message.filter = String(object.filter); - if (object.groupBy != null) - message.groupBy = String(object.groupBy); - if (object.readTime != null) { - if (typeof object.readTime !== "object") - throw TypeError(".google.cloud.securitycenter.v1.GroupFindingsRequest.readTime: object expected"); - message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); - } - if (object.compareDuration != null) { - if (typeof object.compareDuration !== "object") - throw TypeError(".google.cloud.securitycenter.v1.GroupFindingsRequest.compareDuration: object expected"); - message.compareDuration = $root.google.protobuf.Duration.fromObject(object.compareDuration); - } - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - return message; - }; /** - * Creates a plain object from a GroupFindingsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest - * @static - * @param {google.cloud.securitycenter.v1.GroupFindingsRequest} message GroupFindingsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#getIamPolicy}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef GetIamPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.iam.v1.Policy} [response] Policy */ - GroupFindingsRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.filter = ""; - object.groupBy = ""; - object.readTime = null; - object.compareDuration = null; - object.pageToken = ""; - object.pageSize = 0; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.filter != null && message.hasOwnProperty("filter")) - object.filter = message.filter; - if (message.groupBy != null && message.hasOwnProperty("groupBy")) - object.groupBy = message.groupBy; - if (message.readTime != null && message.hasOwnProperty("readTime")) - object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); - if (message.compareDuration != null && message.hasOwnProperty("compareDuration")) - object.compareDuration = $root.google.protobuf.Duration.toObject(message.compareDuration, options); - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - return object; - }; /** - * Converts this GroupFindingsRequest to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest + * Calls GetIamPolicy. + * @function getIamPolicy + * @memberof google.cloud.securitycenter.v1.SecurityCenter * @instance - * @returns {Object.} JSON object + * @param {google.iam.v1.IGetIamPolicyRequest} request GetIamPolicyRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.GetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy + * @returns {undefined} + * @variation 1 */ - GroupFindingsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return GroupFindingsRequest; - })(); - - v1.GroupFindingsResponse = (function() { + Object.defineProperty(SecurityCenter.prototype.getIamPolicy = function getIamPolicy(request, callback) { + return this.rpcCall(getIamPolicy, $root.google.iam.v1.GetIamPolicyRequest, $root.google.iam.v1.Policy, request, callback); + }, "name", { value: "GetIamPolicy" }); /** - * Properties of a GroupFindingsResponse. - * @memberof google.cloud.securitycenter.v1 - * @interface IGroupFindingsResponse - * @property {Array.|null} [groupByResults] GroupFindingsResponse groupByResults - * @property {google.protobuf.ITimestamp|null} [readTime] GroupFindingsResponse readTime - * @property {string|null} [nextPageToken] GroupFindingsResponse nextPageToken - * @property {number|null} [totalSize] GroupFindingsResponse totalSize + * Calls GetIamPolicy. + * @function getIamPolicy + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.iam.v1.IGetIamPolicyRequest} request GetIamPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ /** - * Constructs a new GroupFindingsResponse. - * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents a GroupFindingsResponse. - * @implements IGroupFindingsResponse - * @constructor - * @param {google.cloud.securitycenter.v1.IGroupFindingsResponse=} [properties] Properties to set + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#getOrganizationSettings}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef GetOrganizationSettingsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1.OrganizationSettings} [response] OrganizationSettings */ - function GroupFindingsResponse(properties) { - this.groupByResults = []; - 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]]; - } /** - * GroupFindingsResponse groupByResults. - * @member {Array.} groupByResults - * @memberof google.cloud.securitycenter.v1.GroupFindingsResponse + * Calls GetOrganizationSettings. + * @function getOrganizationSettings + * @memberof google.cloud.securitycenter.v1.SecurityCenter * @instance + * @param {google.cloud.securitycenter.v1.IGetOrganizationSettingsRequest} request GetOrganizationSettingsRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.GetOrganizationSettingsCallback} callback Node-style callback called with the error, if any, and OrganizationSettings + * @returns {undefined} + * @variation 1 */ - GroupFindingsResponse.prototype.groupByResults = $util.emptyArray; + Object.defineProperty(SecurityCenter.prototype.getOrganizationSettings = function getOrganizationSettings(request, callback) { + return this.rpcCall(getOrganizationSettings, $root.google.cloud.securitycenter.v1.GetOrganizationSettingsRequest, $root.google.cloud.securitycenter.v1.OrganizationSettings, request, callback); + }, "name", { value: "GetOrganizationSettings" }); /** - * GroupFindingsResponse readTime. - * @member {google.protobuf.ITimestamp|null|undefined} readTime - * @memberof google.cloud.securitycenter.v1.GroupFindingsResponse + * Calls GetOrganizationSettings. + * @function getOrganizationSettings + * @memberof google.cloud.securitycenter.v1.SecurityCenter * @instance + * @param {google.cloud.securitycenter.v1.IGetOrganizationSettingsRequest} request GetOrganizationSettingsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - GroupFindingsResponse.prototype.readTime = null; /** - * GroupFindingsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.securitycenter.v1.GroupFindingsResponse - * @instance + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#getSource}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef GetSourceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1.Source} [response] Source */ - GroupFindingsResponse.prototype.nextPageToken = ""; /** - * GroupFindingsResponse totalSize. - * @member {number} totalSize - * @memberof google.cloud.securitycenter.v1.GroupFindingsResponse + * Calls GetSource. + * @function getSource + * @memberof google.cloud.securitycenter.v1.SecurityCenter * @instance + * @param {google.cloud.securitycenter.v1.IGetSourceRequest} request GetSourceRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.GetSourceCallback} callback Node-style callback called with the error, if any, and Source + * @returns {undefined} + * @variation 1 */ - GroupFindingsResponse.prototype.totalSize = 0; + Object.defineProperty(SecurityCenter.prototype.getSource = function getSource(request, callback) { + return this.rpcCall(getSource, $root.google.cloud.securitycenter.v1.GetSourceRequest, $root.google.cloud.securitycenter.v1.Source, request, callback); + }, "name", { value: "GetSource" }); /** - * Creates a new GroupFindingsResponse instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v1.GroupFindingsResponse - * @static - * @param {google.cloud.securitycenter.v1.IGroupFindingsResponse=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.GroupFindingsResponse} GroupFindingsResponse instance + * Calls GetSource. + * @function getSource + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IGetSourceRequest} request GetSourceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - GroupFindingsResponse.create = function create(properties) { - return new GroupFindingsResponse(properties); - }; /** - * Encodes the specified GroupFindingsResponse message. Does not implicitly {@link google.cloud.securitycenter.v1.GroupFindingsResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1.GroupFindingsResponse - * @static - * @param {google.cloud.securitycenter.v1.IGroupFindingsResponse} message GroupFindingsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#groupAssets}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef GroupAssetsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1.GroupAssetsResponse} [response] GroupAssetsResponse */ - GroupFindingsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.groupByResults != null && message.groupByResults.length) - for (var i = 0; i < message.groupByResults.length; ++i) - $root.google.cloud.securitycenter.v1.GroupResult.encode(message.groupByResults[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.readTime != null && message.hasOwnProperty("readTime")) - $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.nextPageToken); - if (message.totalSize != null && message.hasOwnProperty("totalSize")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.totalSize); - return writer; - }; /** - * Encodes the specified GroupFindingsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.GroupFindingsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.GroupFindingsResponse - * @static - * @param {google.cloud.securitycenter.v1.IGroupFindingsResponse} message GroupFindingsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * Calls GroupAssets. + * @function groupAssets + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IGroupAssetsRequest} request GroupAssetsRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.GroupAssetsCallback} callback Node-style callback called with the error, if any, and GroupAssetsResponse + * @returns {undefined} + * @variation 1 */ - GroupFindingsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + Object.defineProperty(SecurityCenter.prototype.groupAssets = function groupAssets(request, callback) { + return this.rpcCall(groupAssets, $root.google.cloud.securitycenter.v1.GroupAssetsRequest, $root.google.cloud.securitycenter.v1.GroupAssetsResponse, request, callback); + }, "name", { value: "GroupAssets" }); /** - * Decodes a GroupFindingsResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v1.GroupFindingsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.GroupFindingsResponse} GroupFindingsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Calls GroupAssets. + * @function groupAssets + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IGroupAssetsRequest} request GroupAssetsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - GroupFindingsResponse.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.cloud.securitycenter.v1.GroupFindingsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.groupByResults && message.groupByResults.length)) - message.groupByResults = []; - message.groupByResults.push($root.google.cloud.securitycenter.v1.GroupResult.decode(reader, reader.uint32())); - break; - case 2: - message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 3: - message.nextPageToken = reader.string(); - break; - case 4: - message.totalSize = reader.int32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; /** - * Decodes a GroupFindingsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.GroupFindingsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.GroupFindingsResponse} GroupFindingsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#groupFindings}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef GroupFindingsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1.GroupFindingsResponse} [response] GroupFindingsResponse */ - GroupFindingsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; /** - * Verifies a GroupFindingsResponse message. - * @function verify - * @memberof google.cloud.securitycenter.v1.GroupFindingsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not + * Calls GroupFindings. + * @function groupFindings + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IGroupFindingsRequest} request GroupFindingsRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.GroupFindingsCallback} callback Node-style callback called with the error, if any, and GroupFindingsResponse + * @returns {undefined} + * @variation 1 */ - GroupFindingsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.groupByResults != null && message.hasOwnProperty("groupByResults")) { - if (!Array.isArray(message.groupByResults)) - return "groupByResults: array expected"; - for (var i = 0; i < message.groupByResults.length; ++i) { - var error = $root.google.cloud.securitycenter.v1.GroupResult.verify(message.groupByResults[i]); - if (error) - return "groupByResults." + error; - } - } - if (message.readTime != null && message.hasOwnProperty("readTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.readTime); - if (error) - return "readTime." + error; - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - if (message.totalSize != null && message.hasOwnProperty("totalSize")) - if (!$util.isInteger(message.totalSize)) - return "totalSize: integer expected"; - return null; - }; + Object.defineProperty(SecurityCenter.prototype.groupFindings = function groupFindings(request, callback) { + return this.rpcCall(groupFindings, $root.google.cloud.securitycenter.v1.GroupFindingsRequest, $root.google.cloud.securitycenter.v1.GroupFindingsResponse, request, callback); + }, "name", { value: "GroupFindings" }); /** - * Creates a GroupFindingsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v1.GroupFindingsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.GroupFindingsResponse} GroupFindingsResponse + * Calls GroupFindings. + * @function groupFindings + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IGroupFindingsRequest} request GroupFindingsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - GroupFindingsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.GroupFindingsResponse) - return object; - var message = new $root.google.cloud.securitycenter.v1.GroupFindingsResponse(); - if (object.groupByResults) { - if (!Array.isArray(object.groupByResults)) - throw TypeError(".google.cloud.securitycenter.v1.GroupFindingsResponse.groupByResults: array expected"); - message.groupByResults = []; - for (var i = 0; i < object.groupByResults.length; ++i) { - if (typeof object.groupByResults[i] !== "object") - throw TypeError(".google.cloud.securitycenter.v1.GroupFindingsResponse.groupByResults: object expected"); - message.groupByResults[i] = $root.google.cloud.securitycenter.v1.GroupResult.fromObject(object.groupByResults[i]); - } - } - if (object.readTime != null) { - if (typeof object.readTime !== "object") - throw TypeError(".google.cloud.securitycenter.v1.GroupFindingsResponse.readTime: object expected"); - message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - if (object.totalSize != null) - message.totalSize = object.totalSize | 0; - return message; - }; /** - * Creates a plain object from a GroupFindingsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v1.GroupFindingsResponse - * @static - * @param {google.cloud.securitycenter.v1.GroupFindingsResponse} message GroupFindingsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#listAssets}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef ListAssetsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1.ListAssetsResponse} [response] ListAssetsResponse */ - GroupFindingsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.groupByResults = []; - if (options.defaults) { - object.readTime = null; - object.nextPageToken = ""; - object.totalSize = 0; - } - if (message.groupByResults && message.groupByResults.length) { - object.groupByResults = []; - for (var j = 0; j < message.groupByResults.length; ++j) - object.groupByResults[j] = $root.google.cloud.securitycenter.v1.GroupResult.toObject(message.groupByResults[j], options); - } - if (message.readTime != null && message.hasOwnProperty("readTime")) - object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - if (message.totalSize != null && message.hasOwnProperty("totalSize")) - object.totalSize = message.totalSize; - return object; - }; /** - * Converts this GroupFindingsResponse to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1.GroupFindingsResponse + * Calls ListAssets. + * @function listAssets + * @memberof google.cloud.securitycenter.v1.SecurityCenter * @instance - * @returns {Object.} JSON object + * @param {google.cloud.securitycenter.v1.IListAssetsRequest} request ListAssetsRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.ListAssetsCallback} callback Node-style callback called with the error, if any, and ListAssetsResponse + * @returns {undefined} + * @variation 1 */ - GroupFindingsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return GroupFindingsResponse; - })(); - - v1.GroupResult = (function() { + Object.defineProperty(SecurityCenter.prototype.listAssets = function listAssets(request, callback) { + return this.rpcCall(listAssets, $root.google.cloud.securitycenter.v1.ListAssetsRequest, $root.google.cloud.securitycenter.v1.ListAssetsResponse, request, callback); + }, "name", { value: "ListAssets" }); /** - * Properties of a GroupResult. - * @memberof google.cloud.securitycenter.v1 - * @interface IGroupResult - * @property {Object.|null} [properties] GroupResult properties - * @property {number|Long|null} [count] GroupResult count + * Calls ListAssets. + * @function listAssets + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IListAssetsRequest} request ListAssetsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ /** - * Constructs a new GroupResult. - * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents a GroupResult. - * @implements IGroupResult - * @constructor - * @param {google.cloud.securitycenter.v1.IGroupResult=} [properties] Properties to set + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#listFindings}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef ListFindingsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1.ListFindingsResponse} [response] ListFindingsResponse */ - function GroupResult(properties) { - this.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]]; - } /** - * GroupResult properties. - * @member {Object.} properties - * @memberof google.cloud.securitycenter.v1.GroupResult + * Calls ListFindings. + * @function listFindings + * @memberof google.cloud.securitycenter.v1.SecurityCenter * @instance + * @param {google.cloud.securitycenter.v1.IListFindingsRequest} request ListFindingsRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.ListFindingsCallback} callback Node-style callback called with the error, if any, and ListFindingsResponse + * @returns {undefined} + * @variation 1 */ - GroupResult.prototype.properties = $util.emptyObject; + Object.defineProperty(SecurityCenter.prototype.listFindings = function listFindings(request, callback) { + return this.rpcCall(listFindings, $root.google.cloud.securitycenter.v1.ListFindingsRequest, $root.google.cloud.securitycenter.v1.ListFindingsResponse, request, callback); + }, "name", { value: "ListFindings" }); /** - * GroupResult count. - * @member {number|Long} count - * @memberof google.cloud.securitycenter.v1.GroupResult + * Calls ListFindings. + * @function listFindings + * @memberof google.cloud.securitycenter.v1.SecurityCenter * @instance + * @param {google.cloud.securitycenter.v1.IListFindingsRequest} request ListFindingsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - GroupResult.prototype.count = $util.Long ? $util.Long.fromBits(0,0,false) : 0; /** - * Creates a new GroupResult instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v1.GroupResult - * @static - * @param {google.cloud.securitycenter.v1.IGroupResult=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.GroupResult} GroupResult instance + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#listSources}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef ListSourcesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1.ListSourcesResponse} [response] ListSourcesResponse */ - GroupResult.create = function create(properties) { - return new GroupResult(properties); - }; /** - * Encodes the specified GroupResult message. Does not implicitly {@link google.cloud.securitycenter.v1.GroupResult.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1.GroupResult - * @static - * @param {google.cloud.securitycenter.v1.IGroupResult} message GroupResult message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * Calls ListSources. + * @function listSources + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IListSourcesRequest} request ListSourcesRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.ListSourcesCallback} callback Node-style callback called with the error, if any, and ListSourcesResponse + * @returns {undefined} + * @variation 1 */ - GroupResult.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.properties != null && message.hasOwnProperty("properties")) - for (var keys = Object.keys(message.properties), i = 0; i < keys.length; ++i) { - writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); - $root.google.protobuf.Value.encode(message.properties[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); - } - if (message.count != null && message.hasOwnProperty("count")) - writer.uint32(/* id 2, wireType 0 =*/16).int64(message.count); - return writer; - }; + Object.defineProperty(SecurityCenter.prototype.listSources = function listSources(request, callback) { + return this.rpcCall(listSources, $root.google.cloud.securitycenter.v1.ListSourcesRequest, $root.google.cloud.securitycenter.v1.ListSourcesResponse, request, callback); + }, "name", { value: "ListSources" }); /** - * Encodes the specified GroupResult message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.GroupResult.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.GroupResult - * @static - * @param {google.cloud.securitycenter.v1.IGroupResult} message GroupResult message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * Calls ListSources. + * @function listSources + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IListSourcesRequest} request ListSourcesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - GroupResult.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; /** - * Decodes a GroupResult message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v1.GroupResult - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.GroupResult} GroupResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#runAssetDiscovery}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef RunAssetDiscoveryCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation */ - GroupResult.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.cloud.securitycenter.v1.GroupResult(), key; - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - reader.skip().pos++; - if (message.properties === $util.emptyObject) - message.properties = {}; - key = reader.string(); - reader.pos++; - message.properties[key] = $root.google.protobuf.Value.decode(reader, reader.uint32()); - break; - case 2: - message.count = reader.int64(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; /** - * Decodes a GroupResult message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.GroupResult - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.GroupResult} GroupResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Calls RunAssetDiscovery. + * @function runAssetDiscovery + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IRunAssetDiscoveryRequest} request RunAssetDiscoveryRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.RunAssetDiscoveryCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 */ - GroupResult.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + Object.defineProperty(SecurityCenter.prototype.runAssetDiscovery = function runAssetDiscovery(request, callback) { + return this.rpcCall(runAssetDiscovery, $root.google.cloud.securitycenter.v1.RunAssetDiscoveryRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "RunAssetDiscovery" }); /** - * Verifies a GroupResult message. - * @function verify - * @memberof google.cloud.securitycenter.v1.GroupResult - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not + * Calls RunAssetDiscovery. + * @function runAssetDiscovery + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IRunAssetDiscoveryRequest} request RunAssetDiscoveryRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - GroupResult.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.properties != null && message.hasOwnProperty("properties")) { - if (!$util.isObject(message.properties)) - return "properties: object expected"; - var key = Object.keys(message.properties); - for (var i = 0; i < key.length; ++i) { - var error = $root.google.protobuf.Value.verify(message.properties[key[i]]); - if (error) - return "properties." + error; - } - } - if (message.count != null && message.hasOwnProperty("count")) - if (!$util.isInteger(message.count) && !(message.count && $util.isInteger(message.count.low) && $util.isInteger(message.count.high))) - return "count: integer|Long expected"; - return null; - }; /** - * Creates a GroupResult message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v1.GroupResult - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.GroupResult} GroupResult + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#setFindingState}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef SetFindingStateCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1.Finding} [response] Finding */ - GroupResult.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.GroupResult) - return object; - var message = new $root.google.cloud.securitycenter.v1.GroupResult(); - if (object.properties) { - if (typeof object.properties !== "object") - throw TypeError(".google.cloud.securitycenter.v1.GroupResult.properties: object expected"); - message.properties = {}; - for (var keys = Object.keys(object.properties), i = 0; i < keys.length; ++i) { - if (typeof object.properties[keys[i]] !== "object") - throw TypeError(".google.cloud.securitycenter.v1.GroupResult.properties: object expected"); - message.properties[keys[i]] = $root.google.protobuf.Value.fromObject(object.properties[keys[i]]); - } - } - if (object.count != null) - if ($util.Long) - (message.count = $util.Long.fromValue(object.count)).unsigned = false; - else if (typeof object.count === "string") - message.count = parseInt(object.count, 10); - else if (typeof object.count === "number") - message.count = object.count; - else if (typeof object.count === "object") - message.count = new $util.LongBits(object.count.low >>> 0, object.count.high >>> 0).toNumber(); - return message; - }; /** - * Creates a plain object from a GroupResult message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v1.GroupResult - * @static - * @param {google.cloud.securitycenter.v1.GroupResult} message GroupResult - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object + * Calls SetFindingState. + * @function setFindingState + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.ISetFindingStateRequest} request SetFindingStateRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.SetFindingStateCallback} callback Node-style callback called with the error, if any, and Finding + * @returns {undefined} + * @variation 1 */ - GroupResult.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.objects || options.defaults) - object.properties = {}; - if (options.defaults) - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.count = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.count = options.longs === String ? "0" : 0; - var keys2; - if (message.properties && (keys2 = Object.keys(message.properties)).length) { - object.properties = {}; - for (var j = 0; j < keys2.length; ++j) - object.properties[keys2[j]] = $root.google.protobuf.Value.toObject(message.properties[keys2[j]], options); - } - if (message.count != null && message.hasOwnProperty("count")) - if (typeof message.count === "number") - object.count = options.longs === String ? String(message.count) : message.count; - else - object.count = options.longs === String ? $util.Long.prototype.toString.call(message.count) : options.longs === Number ? new $util.LongBits(message.count.low >>> 0, message.count.high >>> 0).toNumber() : message.count; - return object; - }; + Object.defineProperty(SecurityCenter.prototype.setFindingState = function setFindingState(request, callback) { + return this.rpcCall(setFindingState, $root.google.cloud.securitycenter.v1.SetFindingStateRequest, $root.google.cloud.securitycenter.v1.Finding, request, callback); + }, "name", { value: "SetFindingState" }); /** - * Converts this GroupResult to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1.GroupResult + * Calls SetFindingState. + * @function setFindingState + * @memberof google.cloud.securitycenter.v1.SecurityCenter * @instance - * @returns {Object.} JSON object + * @param {google.cloud.securitycenter.v1.ISetFindingStateRequest} request SetFindingStateRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - GroupResult.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - return GroupResult; - })(); + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#setIamPolicy}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef SetIamPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.iam.v1.Policy} [response] Policy + */ - v1.ListSourcesRequest = (function() { + /** + * Calls SetIamPolicy. + * @function setIamPolicy + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.iam.v1.ISetIamPolicyRequest} request SetIamPolicyRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.SetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.setIamPolicy = function setIamPolicy(request, callback) { + return this.rpcCall(setIamPolicy, $root.google.iam.v1.SetIamPolicyRequest, $root.google.iam.v1.Policy, request, callback); + }, "name", { value: "SetIamPolicy" }); /** - * Properties of a ListSourcesRequest. - * @memberof google.cloud.securitycenter.v1 - * @interface IListSourcesRequest - * @property {string|null} [parent] ListSourcesRequest parent - * @property {string|null} [pageToken] ListSourcesRequest pageToken - * @property {number|null} [pageSize] ListSourcesRequest pageSize + * Calls SetIamPolicy. + * @function setIamPolicy + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.iam.v1.ISetIamPolicyRequest} request SetIamPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ /** - * Constructs a new ListSourcesRequest. - * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents a ListSourcesRequest. - * @implements IListSourcesRequest - * @constructor - * @param {google.cloud.securitycenter.v1.IListSourcesRequest=} [properties] Properties to set + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#testIamPermissions}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef TestIamPermissionsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.iam.v1.TestIamPermissionsResponse} [response] TestIamPermissionsResponse */ - function ListSourcesRequest(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]]; - } /** - * ListSourcesRequest parent. - * @member {string} parent - * @memberof google.cloud.securitycenter.v1.ListSourcesRequest + * Calls TestIamPermissions. + * @function testIamPermissions + * @memberof google.cloud.securitycenter.v1.SecurityCenter * @instance + * @param {google.iam.v1.ITestIamPermissionsRequest} request TestIamPermissionsRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.TestIamPermissionsCallback} callback Node-style callback called with the error, if any, and TestIamPermissionsResponse + * @returns {undefined} + * @variation 1 */ - ListSourcesRequest.prototype.parent = ""; + Object.defineProperty(SecurityCenter.prototype.testIamPermissions = function testIamPermissions(request, callback) { + return this.rpcCall(testIamPermissions, $root.google.iam.v1.TestIamPermissionsRequest, $root.google.iam.v1.TestIamPermissionsResponse, request, callback); + }, "name", { value: "TestIamPermissions" }); /** - * ListSourcesRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.securitycenter.v1.ListSourcesRequest + * Calls TestIamPermissions. + * @function testIamPermissions + * @memberof google.cloud.securitycenter.v1.SecurityCenter * @instance + * @param {google.iam.v1.ITestIamPermissionsRequest} request TestIamPermissionsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - ListSourcesRequest.prototype.pageToken = ""; /** - * ListSourcesRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.securitycenter.v1.ListSourcesRequest - * @instance + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#updateFinding}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef UpdateFindingCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1.Finding} [response] Finding */ - ListSourcesRequest.prototype.pageSize = 0; /** - * Creates a new ListSourcesRequest instance using the specified properties. + * Calls UpdateFinding. + * @function updateFinding + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IUpdateFindingRequest} request UpdateFindingRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.UpdateFindingCallback} callback Node-style callback called with the error, if any, and Finding + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.updateFinding = function updateFinding(request, callback) { + return this.rpcCall(updateFinding, $root.google.cloud.securitycenter.v1.UpdateFindingRequest, $root.google.cloud.securitycenter.v1.Finding, request, callback); + }, "name", { value: "UpdateFinding" }); + + /** + * Calls UpdateFinding. + * @function updateFinding + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IUpdateFindingRequest} request UpdateFindingRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#updateOrganizationSettings}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef UpdateOrganizationSettingsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1.OrganizationSettings} [response] OrganizationSettings + */ + + /** + * Calls UpdateOrganizationSettings. + * @function updateOrganizationSettings + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IUpdateOrganizationSettingsRequest} request UpdateOrganizationSettingsRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.UpdateOrganizationSettingsCallback} callback Node-style callback called with the error, if any, and OrganizationSettings + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.updateOrganizationSettings = function updateOrganizationSettings(request, callback) { + return this.rpcCall(updateOrganizationSettings, $root.google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest, $root.google.cloud.securitycenter.v1.OrganizationSettings, request, callback); + }, "name", { value: "UpdateOrganizationSettings" }); + + /** + * Calls UpdateOrganizationSettings. + * @function updateOrganizationSettings + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IUpdateOrganizationSettingsRequest} request UpdateOrganizationSettingsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#updateSource}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef UpdateSourceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1.Source} [response] Source + */ + + /** + * Calls UpdateSource. + * @function updateSource + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IUpdateSourceRequest} request UpdateSourceRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.UpdateSourceCallback} callback Node-style callback called with the error, if any, and Source + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.updateSource = function updateSource(request, callback) { + return this.rpcCall(updateSource, $root.google.cloud.securitycenter.v1.UpdateSourceRequest, $root.google.cloud.securitycenter.v1.Source, request, callback); + }, "name", { value: "UpdateSource" }); + + /** + * Calls UpdateSource. + * @function updateSource + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IUpdateSourceRequest} request UpdateSourceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#updateSecurityMarks}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef UpdateSecurityMarksCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1.SecurityMarks} [response] SecurityMarks + */ + + /** + * Calls UpdateSecurityMarks. + * @function updateSecurityMarks + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IUpdateSecurityMarksRequest} request UpdateSecurityMarksRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.UpdateSecurityMarksCallback} callback Node-style callback called with the error, if any, and SecurityMarks + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.updateSecurityMarks = function updateSecurityMarks(request, callback) { + return this.rpcCall(updateSecurityMarks, $root.google.cloud.securitycenter.v1.UpdateSecurityMarksRequest, $root.google.cloud.securitycenter.v1.SecurityMarks, request, callback); + }, "name", { value: "UpdateSecurityMarks" }); + + /** + * Calls UpdateSecurityMarks. + * @function updateSecurityMarks + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IUpdateSecurityMarksRequest} request UpdateSecurityMarksRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return SecurityCenter; + })(); + + v1.CreateFindingRequest = (function() { + + /** + * Properties of a CreateFindingRequest. + * @memberof google.cloud.securitycenter.v1 + * @interface ICreateFindingRequest + * @property {string|null} [parent] CreateFindingRequest parent + * @property {string|null} [findingId] CreateFindingRequest findingId + * @property {google.cloud.securitycenter.v1.IFinding|null} [finding] CreateFindingRequest finding + */ + + /** + * Constructs a new CreateFindingRequest. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a CreateFindingRequest. + * @implements ICreateFindingRequest + * @constructor + * @param {google.cloud.securitycenter.v1.ICreateFindingRequest=} [properties] Properties to set + */ + function CreateFindingRequest(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]]; + } + + /** + * CreateFindingRequest parent. + * @member {string} parent + * @memberof google.cloud.securitycenter.v1.CreateFindingRequest + * @instance + */ + CreateFindingRequest.prototype.parent = ""; + + /** + * CreateFindingRequest findingId. + * @member {string} findingId + * @memberof google.cloud.securitycenter.v1.CreateFindingRequest + * @instance + */ + CreateFindingRequest.prototype.findingId = ""; + + /** + * CreateFindingRequest finding. + * @member {google.cloud.securitycenter.v1.IFinding|null|undefined} finding + * @memberof google.cloud.securitycenter.v1.CreateFindingRequest + * @instance + */ + CreateFindingRequest.prototype.finding = null; + + /** + * Creates a new CreateFindingRequest instance using the specified properties. * @function create - * @memberof google.cloud.securitycenter.v1.ListSourcesRequest + * @memberof google.cloud.securitycenter.v1.CreateFindingRequest * @static - * @param {google.cloud.securitycenter.v1.IListSourcesRequest=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.ListSourcesRequest} ListSourcesRequest instance + * @param {google.cloud.securitycenter.v1.ICreateFindingRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.CreateFindingRequest} CreateFindingRequest instance */ - ListSourcesRequest.create = function create(properties) { - return new ListSourcesRequest(properties); + CreateFindingRequest.create = function create(properties) { + return new CreateFindingRequest(properties); }; /** - * Encodes the specified ListSourcesRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.ListSourcesRequest.verify|verify} messages. + * Encodes the specified CreateFindingRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.CreateFindingRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.securitycenter.v1.ListSourcesRequest + * @memberof google.cloud.securitycenter.v1.CreateFindingRequest * @static - * @param {google.cloud.securitycenter.v1.IListSourcesRequest} message ListSourcesRequest message or plain object to encode + * @param {google.cloud.securitycenter.v1.ICreateFindingRequest} message CreateFindingRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListSourcesRequest.encode = function encode(message, writer) { + CreateFindingRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.parent != null && message.hasOwnProperty("parent")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.pageToken); - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - writer.uint32(/* id 7, wireType 0 =*/56).int32(message.pageSize); + if (message.findingId != null && message.hasOwnProperty("findingId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.findingId); + if (message.finding != null && message.hasOwnProperty("finding")) + $root.google.cloud.securitycenter.v1.Finding.encode(message.finding, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; /** - * Encodes the specified ListSourcesRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListSourcesRequest.verify|verify} messages. + * Encodes the specified CreateFindingRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.CreateFindingRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.ListSourcesRequest + * @memberof google.cloud.securitycenter.v1.CreateFindingRequest * @static - * @param {google.cloud.securitycenter.v1.IListSourcesRequest} message ListSourcesRequest message or plain object to encode + * @param {google.cloud.securitycenter.v1.ICreateFindingRequest} message CreateFindingRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListSourcesRequest.encodeDelimited = function encodeDelimited(message, writer) { + CreateFindingRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListSourcesRequest message from the specified reader or buffer. + * Decodes a CreateFindingRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.securitycenter.v1.ListSourcesRequest + * @memberof google.cloud.securitycenter.v1.CreateFindingRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.ListSourcesRequest} ListSourcesRequest + * @returns {google.cloud.securitycenter.v1.CreateFindingRequest} CreateFindingRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListSourcesRequest.decode = function decode(reader, length) { + CreateFindingRequest.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.cloud.securitycenter.v1.ListSourcesRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.CreateFindingRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -3113,10 +3413,10 @@ message.parent = reader.string(); break; case 2: - message.pageToken = reader.string(); + message.findingId = reader.string(); break; - case 7: - message.pageSize = reader.int32(); + case 3: + message.finding = $root.google.cloud.securitycenter.v1.Finding.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -3127,126 +3427,130 @@ }; /** - * Decodes a ListSourcesRequest message from the specified reader or buffer, length delimited. + * Decodes a CreateFindingRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.ListSourcesRequest + * @memberof google.cloud.securitycenter.v1.CreateFindingRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.ListSourcesRequest} ListSourcesRequest + * @returns {google.cloud.securitycenter.v1.CreateFindingRequest} CreateFindingRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListSourcesRequest.decodeDelimited = function decodeDelimited(reader) { + CreateFindingRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListSourcesRequest message. + * Verifies a CreateFindingRequest message. * @function verify - * @memberof google.cloud.securitycenter.v1.ListSourcesRequest + * @memberof google.cloud.securitycenter.v1.CreateFindingRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListSourcesRequest.verify = function verify(message) { + CreateFindingRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.parent != null && message.hasOwnProperty("parent")) if (!$util.isString(message.parent)) return "parent: string expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; + if (message.findingId != null && message.hasOwnProperty("findingId")) + if (!$util.isString(message.findingId)) + return "findingId: string expected"; + if (message.finding != null && message.hasOwnProperty("finding")) { + var error = $root.google.cloud.securitycenter.v1.Finding.verify(message.finding); + if (error) + return "finding." + error; + } return null; }; /** - * Creates a ListSourcesRequest message from a plain object. Also converts values to their respective internal types. + * Creates a CreateFindingRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.securitycenter.v1.ListSourcesRequest + * @memberof google.cloud.securitycenter.v1.CreateFindingRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.ListSourcesRequest} ListSourcesRequest + * @returns {google.cloud.securitycenter.v1.CreateFindingRequest} CreateFindingRequest */ - ListSourcesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.ListSourcesRequest) + CreateFindingRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.CreateFindingRequest) return object; - var message = new $root.google.cloud.securitycenter.v1.ListSourcesRequest(); + var message = new $root.google.cloud.securitycenter.v1.CreateFindingRequest(); if (object.parent != null) message.parent = String(object.parent); - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; + if (object.findingId != null) + message.findingId = String(object.findingId); + if (object.finding != null) { + if (typeof object.finding !== "object") + throw TypeError(".google.cloud.securitycenter.v1.CreateFindingRequest.finding: object expected"); + message.finding = $root.google.cloud.securitycenter.v1.Finding.fromObject(object.finding); + } return message; }; /** - * Creates a plain object from a ListSourcesRequest message. Also converts values to other types if specified. + * Creates a plain object from a CreateFindingRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.securitycenter.v1.ListSourcesRequest + * @memberof google.cloud.securitycenter.v1.CreateFindingRequest * @static - * @param {google.cloud.securitycenter.v1.ListSourcesRequest} message ListSourcesRequest + * @param {google.cloud.securitycenter.v1.CreateFindingRequest} message CreateFindingRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListSourcesRequest.toObject = function toObject(message, options) { + CreateFindingRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { object.parent = ""; - object.pageToken = ""; - object.pageSize = 0; + object.findingId = ""; + object.finding = null; } if (message.parent != null && message.hasOwnProperty("parent")) object.parent = message.parent; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; + if (message.findingId != null && message.hasOwnProperty("findingId")) + object.findingId = message.findingId; + if (message.finding != null && message.hasOwnProperty("finding")) + object.finding = $root.google.cloud.securitycenter.v1.Finding.toObject(message.finding, options); return object; }; /** - * Converts this ListSourcesRequest to JSON. + * Converts this CreateFindingRequest to JSON. * @function toJSON - * @memberof google.cloud.securitycenter.v1.ListSourcesRequest + * @memberof google.cloud.securitycenter.v1.CreateFindingRequest * @instance * @returns {Object.} JSON object */ - ListSourcesRequest.prototype.toJSON = function toJSON() { + CreateFindingRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ListSourcesRequest; + return CreateFindingRequest; })(); - v1.ListSourcesResponse = (function() { + v1.CreateSourceRequest = (function() { /** - * Properties of a ListSourcesResponse. + * Properties of a CreateSourceRequest. * @memberof google.cloud.securitycenter.v1 - * @interface IListSourcesResponse - * @property {Array.|null} [sources] ListSourcesResponse sources - * @property {string|null} [nextPageToken] ListSourcesResponse nextPageToken + * @interface ICreateSourceRequest + * @property {string|null} [parent] CreateSourceRequest parent + * @property {google.cloud.securitycenter.v1.ISource|null} [source] CreateSourceRequest source */ /** - * Constructs a new ListSourcesResponse. + * Constructs a new CreateSourceRequest. * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents a ListSourcesResponse. - * @implements IListSourcesResponse + * @classdesc Represents a CreateSourceRequest. + * @implements ICreateSourceRequest * @constructor - * @param {google.cloud.securitycenter.v1.IListSourcesResponse=} [properties] Properties to set + * @param {google.cloud.securitycenter.v1.ICreateSourceRequest=} [properties] Properties to set */ - function ListSourcesResponse(properties) { - this.sources = []; + function CreateSourceRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -3254,91 +3558,88 @@ } /** - * ListSourcesResponse sources. - * @member {Array.} sources - * @memberof google.cloud.securitycenter.v1.ListSourcesResponse + * CreateSourceRequest parent. + * @member {string} parent + * @memberof google.cloud.securitycenter.v1.CreateSourceRequest * @instance */ - ListSourcesResponse.prototype.sources = $util.emptyArray; + CreateSourceRequest.prototype.parent = ""; /** - * ListSourcesResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.securitycenter.v1.ListSourcesResponse + * CreateSourceRequest source. + * @member {google.cloud.securitycenter.v1.ISource|null|undefined} source + * @memberof google.cloud.securitycenter.v1.CreateSourceRequest * @instance */ - ListSourcesResponse.prototype.nextPageToken = ""; + CreateSourceRequest.prototype.source = null; /** - * Creates a new ListSourcesResponse instance using the specified properties. + * Creates a new CreateSourceRequest instance using the specified properties. * @function create - * @memberof google.cloud.securitycenter.v1.ListSourcesResponse + * @memberof google.cloud.securitycenter.v1.CreateSourceRequest * @static - * @param {google.cloud.securitycenter.v1.IListSourcesResponse=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.ListSourcesResponse} ListSourcesResponse instance + * @param {google.cloud.securitycenter.v1.ICreateSourceRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.CreateSourceRequest} CreateSourceRequest instance */ - ListSourcesResponse.create = function create(properties) { - return new ListSourcesResponse(properties); + CreateSourceRequest.create = function create(properties) { + return new CreateSourceRequest(properties); }; /** - * Encodes the specified ListSourcesResponse message. Does not implicitly {@link google.cloud.securitycenter.v1.ListSourcesResponse.verify|verify} messages. + * Encodes the specified CreateSourceRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.CreateSourceRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.securitycenter.v1.ListSourcesResponse + * @memberof google.cloud.securitycenter.v1.CreateSourceRequest * @static - * @param {google.cloud.securitycenter.v1.IListSourcesResponse} message ListSourcesResponse message or plain object to encode + * @param {google.cloud.securitycenter.v1.ICreateSourceRequest} message CreateSourceRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListSourcesResponse.encode = function encode(message, writer) { + CreateSourceRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.sources != null && message.sources.length) - for (var i = 0; i < message.sources.length; ++i) - $root.google.cloud.securitycenter.v1.Source.encode(message.sources[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.parent != null && message.hasOwnProperty("parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.source != null && message.hasOwnProperty("source")) + $root.google.cloud.securitycenter.v1.Source.encode(message.source, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** - * Encodes the specified ListSourcesResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListSourcesResponse.verify|verify} messages. + * Encodes the specified CreateSourceRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.CreateSourceRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.ListSourcesResponse + * @memberof google.cloud.securitycenter.v1.CreateSourceRequest * @static - * @param {google.cloud.securitycenter.v1.IListSourcesResponse} message ListSourcesResponse message or plain object to encode + * @param {google.cloud.securitycenter.v1.ICreateSourceRequest} message CreateSourceRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListSourcesResponse.encodeDelimited = function encodeDelimited(message, writer) { + CreateSourceRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListSourcesResponse message from the specified reader or buffer. + * Decodes a CreateSourceRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.securitycenter.v1.ListSourcesResponse + * @memberof google.cloud.securitycenter.v1.CreateSourceRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.ListSourcesResponse} ListSourcesResponse + * @returns {google.cloud.securitycenter.v1.CreateSourceRequest} CreateSourceRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListSourcesResponse.decode = function decode(reader, length) { + CreateSourceRequest.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.cloud.securitycenter.v1.ListSourcesResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.CreateSourceRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - if (!(message.sources && message.sources.length)) - message.sources = []; - message.sources.push($root.google.cloud.securitycenter.v1.Source.decode(reader, reader.uint32())); + message.parent = reader.string(); break; case 2: - message.nextPageToken = reader.string(); + message.source = $root.google.cloud.securitycenter.v1.Source.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -3349,140 +3650,121 @@ }; /** - * Decodes a ListSourcesResponse message from the specified reader or buffer, length delimited. + * Decodes a CreateSourceRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.ListSourcesResponse + * @memberof google.cloud.securitycenter.v1.CreateSourceRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.ListSourcesResponse} ListSourcesResponse + * @returns {google.cloud.securitycenter.v1.CreateSourceRequest} CreateSourceRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListSourcesResponse.decodeDelimited = function decodeDelimited(reader) { + CreateSourceRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListSourcesResponse message. + * Verifies a CreateSourceRequest message. * @function verify - * @memberof google.cloud.securitycenter.v1.ListSourcesResponse + * @memberof google.cloud.securitycenter.v1.CreateSourceRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListSourcesResponse.verify = function verify(message) { + CreateSourceRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.sources != null && message.hasOwnProperty("sources")) { - if (!Array.isArray(message.sources)) - return "sources: array expected"; - for (var i = 0; i < message.sources.length; ++i) { - var error = $root.google.cloud.securitycenter.v1.Source.verify(message.sources[i]); - if (error) - return "sources." + error; - } + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.source != null && message.hasOwnProperty("source")) { + var error = $root.google.cloud.securitycenter.v1.Source.verify(message.source); + if (error) + return "source." + error; } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; return null; }; /** - * Creates a ListSourcesResponse message from a plain object. Also converts values to their respective internal types. + * Creates a CreateSourceRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.securitycenter.v1.ListSourcesResponse + * @memberof google.cloud.securitycenter.v1.CreateSourceRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.ListSourcesResponse} ListSourcesResponse + * @returns {google.cloud.securitycenter.v1.CreateSourceRequest} CreateSourceRequest */ - ListSourcesResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.ListSourcesResponse) + CreateSourceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.CreateSourceRequest) return object; - var message = new $root.google.cloud.securitycenter.v1.ListSourcesResponse(); - if (object.sources) { - if (!Array.isArray(object.sources)) - throw TypeError(".google.cloud.securitycenter.v1.ListSourcesResponse.sources: array expected"); - message.sources = []; - for (var i = 0; i < object.sources.length; ++i) { - if (typeof object.sources[i] !== "object") - throw TypeError(".google.cloud.securitycenter.v1.ListSourcesResponse.sources: object expected"); - message.sources[i] = $root.google.cloud.securitycenter.v1.Source.fromObject(object.sources[i]); - } + var message = new $root.google.cloud.securitycenter.v1.CreateSourceRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.source != null) { + if (typeof object.source !== "object") + throw TypeError(".google.cloud.securitycenter.v1.CreateSourceRequest.source: object expected"); + message.source = $root.google.cloud.securitycenter.v1.Source.fromObject(object.source); } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); return message; }; /** - * Creates a plain object from a ListSourcesResponse message. Also converts values to other types if specified. + * Creates a plain object from a CreateSourceRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.securitycenter.v1.ListSourcesResponse + * @memberof google.cloud.securitycenter.v1.CreateSourceRequest * @static - * @param {google.cloud.securitycenter.v1.ListSourcesResponse} message ListSourcesResponse + * @param {google.cloud.securitycenter.v1.CreateSourceRequest} message CreateSourceRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListSourcesResponse.toObject = function toObject(message, options) { + CreateSourceRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.sources = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.sources && message.sources.length) { - object.sources = []; - for (var j = 0; j < message.sources.length; ++j) - object.sources[j] = $root.google.cloud.securitycenter.v1.Source.toObject(message.sources[j], options); + if (options.defaults) { + object.parent = ""; + object.source = null; } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.source != null && message.hasOwnProperty("source")) + object.source = $root.google.cloud.securitycenter.v1.Source.toObject(message.source, options); return object; }; /** - * Converts this ListSourcesResponse to JSON. + * Converts this CreateSourceRequest to JSON. * @function toJSON - * @memberof google.cloud.securitycenter.v1.ListSourcesResponse + * @memberof google.cloud.securitycenter.v1.CreateSourceRequest * @instance * @returns {Object.} JSON object */ - ListSourcesResponse.prototype.toJSON = function toJSON() { + CreateSourceRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ListSourcesResponse; + return CreateSourceRequest; })(); - v1.ListAssetsRequest = (function() { + v1.GetOrganizationSettingsRequest = (function() { /** - * Properties of a ListAssetsRequest. + * Properties of a GetOrganizationSettingsRequest. * @memberof google.cloud.securitycenter.v1 - * @interface IListAssetsRequest - * @property {string|null} [parent] ListAssetsRequest parent - * @property {string|null} [filter] ListAssetsRequest filter - * @property {string|null} [orderBy] ListAssetsRequest orderBy - * @property {google.protobuf.ITimestamp|null} [readTime] ListAssetsRequest readTime - * @property {google.protobuf.IDuration|null} [compareDuration] ListAssetsRequest compareDuration - * @property {google.protobuf.IFieldMask|null} [fieldMask] ListAssetsRequest fieldMask - * @property {string|null} [pageToken] ListAssetsRequest pageToken - * @property {number|null} [pageSize] ListAssetsRequest pageSize + * @interface IGetOrganizationSettingsRequest + * @property {string|null} [name] GetOrganizationSettingsRequest name */ /** - * Constructs a new ListAssetsRequest. + * Constructs a new GetOrganizationSettingsRequest. * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents a ListAssetsRequest. - * @implements IListAssetsRequest + * @classdesc Represents a GetOrganizationSettingsRequest. + * @implements IGetOrganizationSettingsRequest * @constructor - * @param {google.cloud.securitycenter.v1.IListAssetsRequest=} [properties] Properties to set + * @param {google.cloud.securitycenter.v1.IGetOrganizationSettingsRequest=} [properties] Properties to set */ - function ListAssetsRequest(properties) { + function GetOrganizationSettingsRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -3490,166 +3772,75 @@ } /** - * ListAssetsRequest parent. - * @member {string} parent - * @memberof google.cloud.securitycenter.v1.ListAssetsRequest - * @instance - */ - ListAssetsRequest.prototype.parent = ""; - - /** - * ListAssetsRequest filter. - * @member {string} filter - * @memberof google.cloud.securitycenter.v1.ListAssetsRequest - * @instance - */ - ListAssetsRequest.prototype.filter = ""; - - /** - * ListAssetsRequest orderBy. - * @member {string} orderBy - * @memberof google.cloud.securitycenter.v1.ListAssetsRequest - * @instance - */ - ListAssetsRequest.prototype.orderBy = ""; - - /** - * ListAssetsRequest readTime. - * @member {google.protobuf.ITimestamp|null|undefined} readTime - * @memberof google.cloud.securitycenter.v1.ListAssetsRequest - * @instance - */ - ListAssetsRequest.prototype.readTime = null; - - /** - * ListAssetsRequest compareDuration. - * @member {google.protobuf.IDuration|null|undefined} compareDuration - * @memberof google.cloud.securitycenter.v1.ListAssetsRequest - * @instance - */ - ListAssetsRequest.prototype.compareDuration = null; - - /** - * ListAssetsRequest fieldMask. - * @member {google.protobuf.IFieldMask|null|undefined} fieldMask - * @memberof google.cloud.securitycenter.v1.ListAssetsRequest - * @instance - */ - ListAssetsRequest.prototype.fieldMask = null; - - /** - * ListAssetsRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.securitycenter.v1.ListAssetsRequest - * @instance - */ - ListAssetsRequest.prototype.pageToken = ""; - - /** - * ListAssetsRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.securitycenter.v1.ListAssetsRequest + * GetOrganizationSettingsRequest name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1.GetOrganizationSettingsRequest * @instance */ - ListAssetsRequest.prototype.pageSize = 0; + GetOrganizationSettingsRequest.prototype.name = ""; /** - * Creates a new ListAssetsRequest instance using the specified properties. + * Creates a new GetOrganizationSettingsRequest instance using the specified properties. * @function create - * @memberof google.cloud.securitycenter.v1.ListAssetsRequest + * @memberof google.cloud.securitycenter.v1.GetOrganizationSettingsRequest * @static - * @param {google.cloud.securitycenter.v1.IListAssetsRequest=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.ListAssetsRequest} ListAssetsRequest instance + * @param {google.cloud.securitycenter.v1.IGetOrganizationSettingsRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.GetOrganizationSettingsRequest} GetOrganizationSettingsRequest instance */ - ListAssetsRequest.create = function create(properties) { - return new ListAssetsRequest(properties); + GetOrganizationSettingsRequest.create = function create(properties) { + return new GetOrganizationSettingsRequest(properties); }; /** - * Encodes the specified ListAssetsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.ListAssetsRequest.verify|verify} messages. + * Encodes the specified GetOrganizationSettingsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.GetOrganizationSettingsRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.securitycenter.v1.ListAssetsRequest + * @memberof google.cloud.securitycenter.v1.GetOrganizationSettingsRequest * @static - * @param {google.cloud.securitycenter.v1.IListAssetsRequest} message ListAssetsRequest message or plain object to encode + * @param {google.cloud.securitycenter.v1.IGetOrganizationSettingsRequest} message GetOrganizationSettingsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListAssetsRequest.encode = function encode(message, writer) { + GetOrganizationSettingsRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && message.hasOwnProperty("parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.filter != null && message.hasOwnProperty("filter")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); - if (message.orderBy != null && message.hasOwnProperty("orderBy")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.orderBy); - if (message.readTime != null && message.hasOwnProperty("readTime")) - $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.compareDuration != null && message.hasOwnProperty("compareDuration")) - $root.google.protobuf.Duration.encode(message.compareDuration, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.fieldMask != null && message.hasOwnProperty("fieldMask")) - $root.google.protobuf.FieldMask.encode(message.fieldMask, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.pageToken); - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - writer.uint32(/* id 9, wireType 0 =*/72).int32(message.pageSize); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; /** - * Encodes the specified ListAssetsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListAssetsRequest.verify|verify} messages. + * Encodes the specified GetOrganizationSettingsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.GetOrganizationSettingsRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.ListAssetsRequest + * @memberof google.cloud.securitycenter.v1.GetOrganizationSettingsRequest * @static - * @param {google.cloud.securitycenter.v1.IListAssetsRequest} message ListAssetsRequest message or plain object to encode + * @param {google.cloud.securitycenter.v1.IGetOrganizationSettingsRequest} message GetOrganizationSettingsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListAssetsRequest.encodeDelimited = function encodeDelimited(message, writer) { + GetOrganizationSettingsRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListAssetsRequest message from the specified reader or buffer. + * Decodes a GetOrganizationSettingsRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.securitycenter.v1.ListAssetsRequest + * @memberof google.cloud.securitycenter.v1.GetOrganizationSettingsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.ListAssetsRequest} ListAssetsRequest + * @returns {google.cloud.securitycenter.v1.GetOrganizationSettingsRequest} GetOrganizationSettingsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListAssetsRequest.decode = function decode(reader, length) { + GetOrganizationSettingsRequest.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.cloud.securitycenter.v1.ListAssetsRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.GetOrganizationSettingsRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.parent = reader.string(); - break; - case 2: - message.filter = reader.string(); - break; - case 3: - message.orderBy = reader.string(); - break; - case 4: - message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 5: - message.compareDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - case 7: - message.fieldMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - break; - case 8: - message.pageToken = reader.string(); - break; - case 9: - message.pageSize = reader.int32(); + message.name = reader.string(); break; default: reader.skipType(tag & 7); @@ -3660,183 +3851,107 @@ }; /** - * Decodes a ListAssetsRequest message from the specified reader or buffer, length delimited. + * Decodes a GetOrganizationSettingsRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.ListAssetsRequest + * @memberof google.cloud.securitycenter.v1.GetOrganizationSettingsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.ListAssetsRequest} ListAssetsRequest + * @returns {google.cloud.securitycenter.v1.GetOrganizationSettingsRequest} GetOrganizationSettingsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListAssetsRequest.decodeDelimited = function decodeDelimited(reader) { + GetOrganizationSettingsRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListAssetsRequest message. + * Verifies a GetOrganizationSettingsRequest message. * @function verify - * @memberof google.cloud.securitycenter.v1.ListAssetsRequest + * @memberof google.cloud.securitycenter.v1.GetOrganizationSettingsRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListAssetsRequest.verify = function verify(message) { + GetOrganizationSettingsRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.filter != null && message.hasOwnProperty("filter")) - if (!$util.isString(message.filter)) - return "filter: string expected"; - if (message.orderBy != null && message.hasOwnProperty("orderBy")) - if (!$util.isString(message.orderBy)) - return "orderBy: string expected"; - if (message.readTime != null && message.hasOwnProperty("readTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.readTime); - if (error) - return "readTime." + error; - } - if (message.compareDuration != null && message.hasOwnProperty("compareDuration")) { - var error = $root.google.protobuf.Duration.verify(message.compareDuration); - if (error) - return "compareDuration." + error; - } - if (message.fieldMask != null && message.hasOwnProperty("fieldMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.fieldMask); - if (error) - return "fieldMask." + error; - } - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; return null; }; /** - * Creates a ListAssetsRequest message from a plain object. Also converts values to their respective internal types. + * Creates a GetOrganizationSettingsRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.securitycenter.v1.ListAssetsRequest + * @memberof google.cloud.securitycenter.v1.GetOrganizationSettingsRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.ListAssetsRequest} ListAssetsRequest + * @returns {google.cloud.securitycenter.v1.GetOrganizationSettingsRequest} GetOrganizationSettingsRequest */ - ListAssetsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.ListAssetsRequest) + GetOrganizationSettingsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.GetOrganizationSettingsRequest) return object; - var message = new $root.google.cloud.securitycenter.v1.ListAssetsRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.filter != null) - message.filter = String(object.filter); - if (object.orderBy != null) - message.orderBy = String(object.orderBy); - if (object.readTime != null) { - if (typeof object.readTime !== "object") - throw TypeError(".google.cloud.securitycenter.v1.ListAssetsRequest.readTime: object expected"); - message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); - } - if (object.compareDuration != null) { - if (typeof object.compareDuration !== "object") - throw TypeError(".google.cloud.securitycenter.v1.ListAssetsRequest.compareDuration: object expected"); - message.compareDuration = $root.google.protobuf.Duration.fromObject(object.compareDuration); - } - if (object.fieldMask != null) { - if (typeof object.fieldMask !== "object") - throw TypeError(".google.cloud.securitycenter.v1.ListAssetsRequest.fieldMask: object expected"); - message.fieldMask = $root.google.protobuf.FieldMask.fromObject(object.fieldMask); - } - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; + var message = new $root.google.cloud.securitycenter.v1.GetOrganizationSettingsRequest(); + if (object.name != null) + message.name = String(object.name); return message; }; /** - * Creates a plain object from a ListAssetsRequest message. Also converts values to other types if specified. + * Creates a plain object from a GetOrganizationSettingsRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.securitycenter.v1.ListAssetsRequest + * @memberof google.cloud.securitycenter.v1.GetOrganizationSettingsRequest * @static - * @param {google.cloud.securitycenter.v1.ListAssetsRequest} message ListAssetsRequest + * @param {google.cloud.securitycenter.v1.GetOrganizationSettingsRequest} message GetOrganizationSettingsRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListAssetsRequest.toObject = function toObject(message, options) { + GetOrganizationSettingsRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.parent = ""; - object.filter = ""; - object.orderBy = ""; - object.readTime = null; - object.compareDuration = null; - object.fieldMask = null; - object.pageToken = ""; - object.pageSize = 0; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.filter != null && message.hasOwnProperty("filter")) - object.filter = message.filter; - if (message.orderBy != null && message.hasOwnProperty("orderBy")) - object.orderBy = message.orderBy; - if (message.readTime != null && message.hasOwnProperty("readTime")) - object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); - if (message.compareDuration != null && message.hasOwnProperty("compareDuration")) - object.compareDuration = $root.google.protobuf.Duration.toObject(message.compareDuration, options); - if (message.fieldMask != null && message.hasOwnProperty("fieldMask")) - object.fieldMask = $root.google.protobuf.FieldMask.toObject(message.fieldMask, options); - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; return object; }; /** - * Converts this ListAssetsRequest to JSON. + * Converts this GetOrganizationSettingsRequest to JSON. * @function toJSON - * @memberof google.cloud.securitycenter.v1.ListAssetsRequest + * @memberof google.cloud.securitycenter.v1.GetOrganizationSettingsRequest * @instance * @returns {Object.} JSON object */ - ListAssetsRequest.prototype.toJSON = function toJSON() { + GetOrganizationSettingsRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ListAssetsRequest; + return GetOrganizationSettingsRequest; })(); - v1.ListAssetsResponse = (function() { + v1.GetSourceRequest = (function() { /** - * Properties of a ListAssetsResponse. + * Properties of a GetSourceRequest. * @memberof google.cloud.securitycenter.v1 - * @interface IListAssetsResponse - * @property {Array.|null} [listAssetsResults] ListAssetsResponse listAssetsResults - * @property {google.protobuf.ITimestamp|null} [readTime] ListAssetsResponse readTime - * @property {string|null} [nextPageToken] ListAssetsResponse nextPageToken - * @property {number|null} [totalSize] ListAssetsResponse totalSize + * @interface IGetSourceRequest + * @property {string|null} [name] GetSourceRequest name */ /** - * Constructs a new ListAssetsResponse. + * Constructs a new GetSourceRequest. * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents a ListAssetsResponse. - * @implements IListAssetsResponse + * @classdesc Represents a GetSourceRequest. + * @implements IGetSourceRequest * @constructor - * @param {google.cloud.securitycenter.v1.IListAssetsResponse=} [properties] Properties to set + * @param {google.cloud.securitycenter.v1.IGetSourceRequest=} [properties] Properties to set */ - function ListAssetsResponse(properties) { - this.listAssetsResults = []; + function GetSourceRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -3844,117 +3959,75 @@ } /** - * ListAssetsResponse listAssetsResults. - * @member {Array.} listAssetsResults - * @memberof google.cloud.securitycenter.v1.ListAssetsResponse - * @instance - */ - ListAssetsResponse.prototype.listAssetsResults = $util.emptyArray; - - /** - * ListAssetsResponse readTime. - * @member {google.protobuf.ITimestamp|null|undefined} readTime - * @memberof google.cloud.securitycenter.v1.ListAssetsResponse - * @instance - */ - ListAssetsResponse.prototype.readTime = null; - - /** - * ListAssetsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.securitycenter.v1.ListAssetsResponse - * @instance - */ - ListAssetsResponse.prototype.nextPageToken = ""; - - /** - * ListAssetsResponse totalSize. - * @member {number} totalSize - * @memberof google.cloud.securitycenter.v1.ListAssetsResponse + * GetSourceRequest name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1.GetSourceRequest * @instance */ - ListAssetsResponse.prototype.totalSize = 0; + GetSourceRequest.prototype.name = ""; /** - * Creates a new ListAssetsResponse instance using the specified properties. + * Creates a new GetSourceRequest instance using the specified properties. * @function create - * @memberof google.cloud.securitycenter.v1.ListAssetsResponse + * @memberof google.cloud.securitycenter.v1.GetSourceRequest * @static - * @param {google.cloud.securitycenter.v1.IListAssetsResponse=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.ListAssetsResponse} ListAssetsResponse instance + * @param {google.cloud.securitycenter.v1.IGetSourceRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.GetSourceRequest} GetSourceRequest instance */ - ListAssetsResponse.create = function create(properties) { - return new ListAssetsResponse(properties); + GetSourceRequest.create = function create(properties) { + return new GetSourceRequest(properties); }; /** - * Encodes the specified ListAssetsResponse message. Does not implicitly {@link google.cloud.securitycenter.v1.ListAssetsResponse.verify|verify} messages. + * Encodes the specified GetSourceRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.GetSourceRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.securitycenter.v1.ListAssetsResponse + * @memberof google.cloud.securitycenter.v1.GetSourceRequest * @static - * @param {google.cloud.securitycenter.v1.IListAssetsResponse} message ListAssetsResponse message or plain object to encode + * @param {google.cloud.securitycenter.v1.IGetSourceRequest} message GetSourceRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListAssetsResponse.encode = function encode(message, writer) { + GetSourceRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.listAssetsResults != null && message.listAssetsResults.length) - for (var i = 0; i < message.listAssetsResults.length; ++i) - $root.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult.encode(message.listAssetsResults[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.readTime != null && message.hasOwnProperty("readTime")) - $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.nextPageToken); - if (message.totalSize != null && message.hasOwnProperty("totalSize")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.totalSize); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; /** - * Encodes the specified ListAssetsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListAssetsResponse.verify|verify} messages. + * Encodes the specified GetSourceRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.GetSourceRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.ListAssetsResponse + * @memberof google.cloud.securitycenter.v1.GetSourceRequest * @static - * @param {google.cloud.securitycenter.v1.IListAssetsResponse} message ListAssetsResponse message or plain object to encode + * @param {google.cloud.securitycenter.v1.IGetSourceRequest} message GetSourceRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListAssetsResponse.encodeDelimited = function encodeDelimited(message, writer) { + GetSourceRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListAssetsResponse message from the specified reader or buffer. + * Decodes a GetSourceRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.securitycenter.v1.ListAssetsResponse + * @memberof google.cloud.securitycenter.v1.GetSourceRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.ListAssetsResponse} ListAssetsResponse + * @returns {google.cloud.securitycenter.v1.GetSourceRequest} GetSourceRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListAssetsResponse.decode = function decode(reader, length) { + GetSourceRequest.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.cloud.securitycenter.v1.ListAssetsResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.GetSourceRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - if (!(message.listAssetsResults && message.listAssetsResults.length)) - message.listAssetsResults = []; - message.listAssetsResults.push($root.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult.decode(reader, reader.uint32())); - break; - case 2: - message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 3: - message.nextPageToken = reader.string(); - break; - case 4: - message.totalSize = reader.int32(); + message.name = reader.string(); break; default: reader.skipType(tag & 7); @@ -3965,559 +4038,244 @@ }; /** - * Decodes a ListAssetsResponse message from the specified reader or buffer, length delimited. + * Decodes a GetSourceRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.ListAssetsResponse + * @memberof google.cloud.securitycenter.v1.GetSourceRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.ListAssetsResponse} ListAssetsResponse + * @returns {google.cloud.securitycenter.v1.GetSourceRequest} GetSourceRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListAssetsResponse.decodeDelimited = function decodeDelimited(reader) { + GetSourceRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListAssetsResponse message. + * Verifies a GetSourceRequest message. * @function verify - * @memberof google.cloud.securitycenter.v1.ListAssetsResponse + * @memberof google.cloud.securitycenter.v1.GetSourceRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListAssetsResponse.verify = function verify(message) { + GetSourceRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.listAssetsResults != null && message.hasOwnProperty("listAssetsResults")) { - if (!Array.isArray(message.listAssetsResults)) - return "listAssetsResults: array expected"; - for (var i = 0; i < message.listAssetsResults.length; ++i) { - var error = $root.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult.verify(message.listAssetsResults[i]); - if (error) - return "listAssetsResults." + error; - } - } - if (message.readTime != null && message.hasOwnProperty("readTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.readTime); - if (error) - return "readTime." + error; - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - if (message.totalSize != null && message.hasOwnProperty("totalSize")) - if (!$util.isInteger(message.totalSize)) - return "totalSize: integer expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; return null; }; /** - * Creates a ListAssetsResponse message from a plain object. Also converts values to their respective internal types. + * Creates a GetSourceRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.securitycenter.v1.ListAssetsResponse + * @memberof google.cloud.securitycenter.v1.GetSourceRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.ListAssetsResponse} ListAssetsResponse + * @returns {google.cloud.securitycenter.v1.GetSourceRequest} GetSourceRequest */ - ListAssetsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.ListAssetsResponse) + GetSourceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.GetSourceRequest) return object; - var message = new $root.google.cloud.securitycenter.v1.ListAssetsResponse(); - if (object.listAssetsResults) { - if (!Array.isArray(object.listAssetsResults)) - throw TypeError(".google.cloud.securitycenter.v1.ListAssetsResponse.listAssetsResults: array expected"); - message.listAssetsResults = []; - for (var i = 0; i < object.listAssetsResults.length; ++i) { - if (typeof object.listAssetsResults[i] !== "object") - throw TypeError(".google.cloud.securitycenter.v1.ListAssetsResponse.listAssetsResults: object expected"); - message.listAssetsResults[i] = $root.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult.fromObject(object.listAssetsResults[i]); - } - } - if (object.readTime != null) { - if (typeof object.readTime !== "object") - throw TypeError(".google.cloud.securitycenter.v1.ListAssetsResponse.readTime: object expected"); - message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - if (object.totalSize != null) - message.totalSize = object.totalSize | 0; + var message = new $root.google.cloud.securitycenter.v1.GetSourceRequest(); + if (object.name != null) + message.name = String(object.name); return message; }; /** - * Creates a plain object from a ListAssetsResponse message. Also converts values to other types if specified. + * Creates a plain object from a GetSourceRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.securitycenter.v1.ListAssetsResponse + * @memberof google.cloud.securitycenter.v1.GetSourceRequest * @static - * @param {google.cloud.securitycenter.v1.ListAssetsResponse} message ListAssetsResponse + * @param {google.cloud.securitycenter.v1.GetSourceRequest} message GetSourceRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListAssetsResponse.toObject = function toObject(message, options) { + GetSourceRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.listAssetsResults = []; - if (options.defaults) { - object.readTime = null; - object.nextPageToken = ""; - object.totalSize = 0; - } - if (message.listAssetsResults && message.listAssetsResults.length) { - object.listAssetsResults = []; - for (var j = 0; j < message.listAssetsResults.length; ++j) - object.listAssetsResults[j] = $root.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult.toObject(message.listAssetsResults[j], options); - } - if (message.readTime != null && message.hasOwnProperty("readTime")) - object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - if (message.totalSize != null && message.hasOwnProperty("totalSize")) - object.totalSize = message.totalSize; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; return object; }; /** - * Converts this ListAssetsResponse to JSON. + * Converts this GetSourceRequest to JSON. * @function toJSON - * @memberof google.cloud.securitycenter.v1.ListAssetsResponse + * @memberof google.cloud.securitycenter.v1.GetSourceRequest * @instance * @returns {Object.} JSON object */ - ListAssetsResponse.prototype.toJSON = function toJSON() { + GetSourceRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - ListAssetsResponse.ListAssetsResult = (function() { + return GetSourceRequest; + })(); - /** - * Properties of a ListAssetsResult. - * @memberof google.cloud.securitycenter.v1.ListAssetsResponse - * @interface IListAssetsResult - * @property {google.cloud.securitycenter.v1.IAsset|null} [asset] ListAssetsResult asset - * @property {google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult.StateChange|null} [stateChange] ListAssetsResult stateChange - */ + v1.GroupAssetsRequest = (function() { - /** - * Constructs a new ListAssetsResult. - * @memberof google.cloud.securitycenter.v1.ListAssetsResponse - * @classdesc Represents a ListAssetsResult. - * @implements IListAssetsResult - * @constructor - * @param {google.cloud.securitycenter.v1.ListAssetsResponse.IListAssetsResult=} [properties] Properties to set - */ - function ListAssetsResult(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]]; - } - - /** - * ListAssetsResult asset. - * @member {google.cloud.securitycenter.v1.IAsset|null|undefined} asset - * @memberof google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult - * @instance - */ - ListAssetsResult.prototype.asset = null; + /** + * Properties of a GroupAssetsRequest. + * @memberof google.cloud.securitycenter.v1 + * @interface IGroupAssetsRequest + * @property {string|null} [parent] GroupAssetsRequest parent + * @property {string|null} [filter] GroupAssetsRequest filter + * @property {string|null} [groupBy] GroupAssetsRequest groupBy + * @property {google.protobuf.IDuration|null} [compareDuration] GroupAssetsRequest compareDuration + * @property {google.protobuf.ITimestamp|null} [readTime] GroupAssetsRequest readTime + * @property {string|null} [pageToken] GroupAssetsRequest pageToken + * @property {number|null} [pageSize] GroupAssetsRequest pageSize + */ - /** - * ListAssetsResult stateChange. - * @member {google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult.StateChange} stateChange - * @memberof google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult - * @instance - */ - ListAssetsResult.prototype.stateChange = 0; + /** + * Constructs a new GroupAssetsRequest. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a GroupAssetsRequest. + * @implements IGroupAssetsRequest + * @constructor + * @param {google.cloud.securitycenter.v1.IGroupAssetsRequest=} [properties] Properties to set + */ + function GroupAssetsRequest(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]]; + } - /** - * Creates a new ListAssetsResult instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult - * @static - * @param {google.cloud.securitycenter.v1.ListAssetsResponse.IListAssetsResult=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult} ListAssetsResult instance - */ - ListAssetsResult.create = function create(properties) { - return new ListAssetsResult(properties); - }; + /** + * GroupAssetsRequest parent. + * @member {string} parent + * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest + * @instance + */ + GroupAssetsRequest.prototype.parent = ""; - /** - * Encodes the specified ListAssetsResult message. Does not implicitly {@link google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult - * @static - * @param {google.cloud.securitycenter.v1.ListAssetsResponse.IListAssetsResult} message ListAssetsResult message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListAssetsResult.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.asset != null && message.hasOwnProperty("asset")) - $root.google.cloud.securitycenter.v1.Asset.encode(message.asset, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.stateChange != null && message.hasOwnProperty("stateChange")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.stateChange); - return writer; - }; + /** + * GroupAssetsRequest filter. + * @member {string} filter + * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest + * @instance + */ + GroupAssetsRequest.prototype.filter = ""; - /** - * Encodes the specified ListAssetsResult message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult - * @static - * @param {google.cloud.securitycenter.v1.ListAssetsResponse.IListAssetsResult} message ListAssetsResult message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListAssetsResult.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * GroupAssetsRequest groupBy. + * @member {string} groupBy + * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest + * @instance + */ + GroupAssetsRequest.prototype.groupBy = ""; - /** - * Decodes a ListAssetsResult message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult} ListAssetsResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListAssetsResult.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.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.asset = $root.google.cloud.securitycenter.v1.Asset.decode(reader, reader.uint32()); - break; - case 2: - message.stateChange = reader.int32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * GroupAssetsRequest compareDuration. + * @member {google.protobuf.IDuration|null|undefined} compareDuration + * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest + * @instance + */ + GroupAssetsRequest.prototype.compareDuration = null; - /** - * Decodes a ListAssetsResult message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult} ListAssetsResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListAssetsResult.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * GroupAssetsRequest readTime. + * @member {google.protobuf.ITimestamp|null|undefined} readTime + * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest + * @instance + */ + GroupAssetsRequest.prototype.readTime = null; - /** - * Verifies a ListAssetsResult message. - * @function verify - * @memberof google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListAssetsResult.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.asset != null && message.hasOwnProperty("asset")) { - var error = $root.google.cloud.securitycenter.v1.Asset.verify(message.asset); - if (error) - return "asset." + error; - } - if (message.stateChange != null && message.hasOwnProperty("stateChange")) - switch (message.stateChange) { - default: - return "stateChange: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - return null; - }; + /** + * GroupAssetsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest + * @instance + */ + GroupAssetsRequest.prototype.pageToken = ""; - /** - * Creates a ListAssetsResult message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult} ListAssetsResult - */ - ListAssetsResult.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult) - return object; - var message = new $root.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult(); - if (object.asset != null) { - if (typeof object.asset !== "object") - throw TypeError(".google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult.asset: object expected"); - message.asset = $root.google.cloud.securitycenter.v1.Asset.fromObject(object.asset); - } - switch (object.stateChange) { - case "UNUSED": - case 0: - message.stateChange = 0; - break; - case "ADDED": - case 1: - message.stateChange = 1; - break; - case "REMOVED": - case 2: - message.stateChange = 2; - break; - case "ACTIVE": - case 3: - message.stateChange = 3; - break; - } - return message; - }; - - /** - * Creates a plain object from a ListAssetsResult message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult - * @static - * @param {google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult} message ListAssetsResult - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListAssetsResult.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.asset = null; - object.stateChange = options.enums === String ? "UNUSED" : 0; - } - if (message.asset != null && message.hasOwnProperty("asset")) - object.asset = $root.google.cloud.securitycenter.v1.Asset.toObject(message.asset, options); - if (message.stateChange != null && message.hasOwnProperty("stateChange")) - object.stateChange = options.enums === String ? $root.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult.StateChange[message.stateChange] : message.stateChange; - return object; - }; - - /** - * Converts this ListAssetsResult to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult - * @instance - * @returns {Object.} JSON object - */ - ListAssetsResult.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * StateChange enum. - * @name google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult.StateChange - * @enum {string} - * @property {number} UNUSED=0 UNUSED value - * @property {number} ADDED=1 ADDED value - * @property {number} REMOVED=2 REMOVED value - * @property {number} ACTIVE=3 ACTIVE value - */ - ListAssetsResult.StateChange = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "UNUSED"] = 0; - values[valuesById[1] = "ADDED"] = 1; - values[valuesById[2] = "REMOVED"] = 2; - values[valuesById[3] = "ACTIVE"] = 3; - return values; - })(); - - return ListAssetsResult; - })(); - - return ListAssetsResponse; - })(); - - v1.ListFindingsRequest = (function() { - - /** - * Properties of a ListFindingsRequest. - * @memberof google.cloud.securitycenter.v1 - * @interface IListFindingsRequest - * @property {string|null} [parent] ListFindingsRequest parent - * @property {string|null} [filter] ListFindingsRequest filter - * @property {string|null} [orderBy] ListFindingsRequest orderBy - * @property {google.protobuf.ITimestamp|null} [readTime] ListFindingsRequest readTime - * @property {google.protobuf.IDuration|null} [compareDuration] ListFindingsRequest compareDuration - * @property {google.protobuf.IFieldMask|null} [fieldMask] ListFindingsRequest fieldMask - * @property {string|null} [pageToken] ListFindingsRequest pageToken - * @property {number|null} [pageSize] ListFindingsRequest pageSize - */ - - /** - * Constructs a new ListFindingsRequest. - * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents a ListFindingsRequest. - * @implements IListFindingsRequest - * @constructor - * @param {google.cloud.securitycenter.v1.IListFindingsRequest=} [properties] Properties to set - */ - function ListFindingsRequest(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]]; - } - - /** - * ListFindingsRequest parent. - * @member {string} parent - * @memberof google.cloud.securitycenter.v1.ListFindingsRequest - * @instance - */ - ListFindingsRequest.prototype.parent = ""; - - /** - * ListFindingsRequest filter. - * @member {string} filter - * @memberof google.cloud.securitycenter.v1.ListFindingsRequest - * @instance - */ - ListFindingsRequest.prototype.filter = ""; - - /** - * ListFindingsRequest orderBy. - * @member {string} orderBy - * @memberof google.cloud.securitycenter.v1.ListFindingsRequest - * @instance - */ - ListFindingsRequest.prototype.orderBy = ""; - - /** - * ListFindingsRequest readTime. - * @member {google.protobuf.ITimestamp|null|undefined} readTime - * @memberof google.cloud.securitycenter.v1.ListFindingsRequest - * @instance - */ - ListFindingsRequest.prototype.readTime = null; - - /** - * ListFindingsRequest compareDuration. - * @member {google.protobuf.IDuration|null|undefined} compareDuration - * @memberof google.cloud.securitycenter.v1.ListFindingsRequest - * @instance - */ - ListFindingsRequest.prototype.compareDuration = null; - - /** - * ListFindingsRequest fieldMask. - * @member {google.protobuf.IFieldMask|null|undefined} fieldMask - * @memberof google.cloud.securitycenter.v1.ListFindingsRequest - * @instance - */ - ListFindingsRequest.prototype.fieldMask = null; - - /** - * ListFindingsRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.securitycenter.v1.ListFindingsRequest - * @instance - */ - ListFindingsRequest.prototype.pageToken = ""; - - /** - * ListFindingsRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.securitycenter.v1.ListFindingsRequest - * @instance - */ - ListFindingsRequest.prototype.pageSize = 0; + /** + * GroupAssetsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest + * @instance + */ + GroupAssetsRequest.prototype.pageSize = 0; /** - * Creates a new ListFindingsRequest instance using the specified properties. + * Creates a new GroupAssetsRequest instance using the specified properties. * @function create - * @memberof google.cloud.securitycenter.v1.ListFindingsRequest + * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest * @static - * @param {google.cloud.securitycenter.v1.IListFindingsRequest=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.ListFindingsRequest} ListFindingsRequest instance + * @param {google.cloud.securitycenter.v1.IGroupAssetsRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.GroupAssetsRequest} GroupAssetsRequest instance */ - ListFindingsRequest.create = function create(properties) { - return new ListFindingsRequest(properties); + GroupAssetsRequest.create = function create(properties) { + return new GroupAssetsRequest(properties); }; /** - * Encodes the specified ListFindingsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.ListFindingsRequest.verify|verify} messages. + * Encodes the specified GroupAssetsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.GroupAssetsRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.securitycenter.v1.ListFindingsRequest + * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest * @static - * @param {google.cloud.securitycenter.v1.IListFindingsRequest} message ListFindingsRequest message or plain object to encode + * @param {google.cloud.securitycenter.v1.IGroupAssetsRequest} message GroupAssetsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListFindingsRequest.encode = function encode(message, writer) { + GroupAssetsRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.parent != null && message.hasOwnProperty("parent")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); if (message.filter != null && message.hasOwnProperty("filter")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); - if (message.orderBy != null && message.hasOwnProperty("orderBy")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.orderBy); - if (message.readTime != null && message.hasOwnProperty("readTime")) - $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.groupBy != null && message.hasOwnProperty("groupBy")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.groupBy); if (message.compareDuration != null && message.hasOwnProperty("compareDuration")) - $root.google.protobuf.Duration.encode(message.compareDuration, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.fieldMask != null && message.hasOwnProperty("fieldMask")) - $root.google.protobuf.FieldMask.encode(message.fieldMask, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + $root.google.protobuf.Duration.encode(message.compareDuration, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.readTime != null && message.hasOwnProperty("readTime")) + $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); if (message.pageToken != null && message.hasOwnProperty("pageToken")) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.pageToken); + writer.uint32(/* id 7, wireType 2 =*/58).string(message.pageToken); if (message.pageSize != null && message.hasOwnProperty("pageSize")) - writer.uint32(/* id 9, wireType 0 =*/72).int32(message.pageSize); + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.pageSize); return writer; }; /** - * Encodes the specified ListFindingsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListFindingsRequest.verify|verify} messages. + * Encodes the specified GroupAssetsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.GroupAssetsRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.ListFindingsRequest + * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest * @static - * @param {google.cloud.securitycenter.v1.IListFindingsRequest} message ListFindingsRequest message or plain object to encode + * @param {google.cloud.securitycenter.v1.IGroupAssetsRequest} message GroupAssetsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListFindingsRequest.encodeDelimited = function encodeDelimited(message, writer) { + GroupAssetsRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListFindingsRequest message from the specified reader or buffer. + * Decodes a GroupAssetsRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.securitycenter.v1.ListFindingsRequest + * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.ListFindingsRequest} ListFindingsRequest + * @returns {google.cloud.securitycenter.v1.GroupAssetsRequest} GroupAssetsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListFindingsRequest.decode = function decode(reader, length) { + GroupAssetsRequest.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.cloud.securitycenter.v1.ListFindingsRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.GroupAssetsRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -4528,21 +4286,18 @@ message.filter = reader.string(); break; case 3: - message.orderBy = reader.string(); + message.groupBy = reader.string(); break; case 4: - message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + message.compareDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); break; case 5: - message.compareDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; case 7: - message.fieldMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - break; - case 8: message.pageToken = reader.string(); break; - case 9: + case 8: message.pageSize = reader.int32(); break; default: @@ -4554,30 +4309,30 @@ }; /** - * Decodes a ListFindingsRequest message from the specified reader or buffer, length delimited. + * Decodes a GroupAssetsRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.ListFindingsRequest + * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.ListFindingsRequest} ListFindingsRequest + * @returns {google.cloud.securitycenter.v1.GroupAssetsRequest} GroupAssetsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListFindingsRequest.decodeDelimited = function decodeDelimited(reader) { + GroupAssetsRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListFindingsRequest message. + * Verifies a GroupAssetsRequest message. * @function verify - * @memberof google.cloud.securitycenter.v1.ListFindingsRequest + * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListFindingsRequest.verify = function verify(message) { + GroupAssetsRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.parent != null && message.hasOwnProperty("parent")) @@ -4586,23 +4341,18 @@ if (message.filter != null && message.hasOwnProperty("filter")) if (!$util.isString(message.filter)) return "filter: string expected"; - if (message.orderBy != null && message.hasOwnProperty("orderBy")) - if (!$util.isString(message.orderBy)) - return "orderBy: string expected"; - if (message.readTime != null && message.hasOwnProperty("readTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.readTime); - if (error) - return "readTime." + error; - } + if (message.groupBy != null && message.hasOwnProperty("groupBy")) + if (!$util.isString(message.groupBy)) + return "groupBy: string expected"; if (message.compareDuration != null && message.hasOwnProperty("compareDuration")) { var error = $root.google.protobuf.Duration.verify(message.compareDuration); if (error) return "compareDuration." + error; } - if (message.fieldMask != null && message.hasOwnProperty("fieldMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.fieldMask); + if (message.readTime != null && message.hasOwnProperty("readTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.readTime); if (error) - return "fieldMask." + error; + return "readTime." + error; } if (message.pageToken != null && message.hasOwnProperty("pageToken")) if (!$util.isString(message.pageToken)) @@ -4614,37 +4364,32 @@ }; /** - * Creates a ListFindingsRequest message from a plain object. Also converts values to their respective internal types. + * Creates a GroupAssetsRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.securitycenter.v1.ListFindingsRequest + * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.ListFindingsRequest} ListFindingsRequest + * @returns {google.cloud.securitycenter.v1.GroupAssetsRequest} GroupAssetsRequest */ - ListFindingsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.ListFindingsRequest) + GroupAssetsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.GroupAssetsRequest) return object; - var message = new $root.google.cloud.securitycenter.v1.ListFindingsRequest(); + var message = new $root.google.cloud.securitycenter.v1.GroupAssetsRequest(); if (object.parent != null) message.parent = String(object.parent); if (object.filter != null) message.filter = String(object.filter); - if (object.orderBy != null) - message.orderBy = String(object.orderBy); - if (object.readTime != null) { - if (typeof object.readTime !== "object") - throw TypeError(".google.cloud.securitycenter.v1.ListFindingsRequest.readTime: object expected"); - message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); - } + if (object.groupBy != null) + message.groupBy = String(object.groupBy); if (object.compareDuration != null) { if (typeof object.compareDuration !== "object") - throw TypeError(".google.cloud.securitycenter.v1.ListFindingsRequest.compareDuration: object expected"); + throw TypeError(".google.cloud.securitycenter.v1.GroupAssetsRequest.compareDuration: object expected"); message.compareDuration = $root.google.protobuf.Duration.fromObject(object.compareDuration); } - if (object.fieldMask != null) { - if (typeof object.fieldMask !== "object") - throw TypeError(".google.cloud.securitycenter.v1.ListFindingsRequest.fieldMask: object expected"); - message.fieldMask = $root.google.protobuf.FieldMask.fromObject(object.fieldMask); + if (object.readTime != null) { + if (typeof object.readTime !== "object") + throw TypeError(".google.cloud.securitycenter.v1.GroupAssetsRequest.readTime: object expected"); + message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); } if (object.pageToken != null) message.pageToken = String(object.pageToken); @@ -4654,25 +4399,24 @@ }; /** - * Creates a plain object from a ListFindingsRequest message. Also converts values to other types if specified. + * Creates a plain object from a GroupAssetsRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.securitycenter.v1.ListFindingsRequest + * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest * @static - * @param {google.cloud.securitycenter.v1.ListFindingsRequest} message ListFindingsRequest + * @param {google.cloud.securitycenter.v1.GroupAssetsRequest} message GroupAssetsRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListFindingsRequest.toObject = function toObject(message, options) { + GroupAssetsRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { object.parent = ""; object.filter = ""; - object.orderBy = ""; - object.readTime = null; + object.groupBy = ""; object.compareDuration = null; - object.fieldMask = null; + object.readTime = null; object.pageToken = ""; object.pageSize = 0; } @@ -4680,14 +4424,12 @@ object.parent = message.parent; if (message.filter != null && message.hasOwnProperty("filter")) object.filter = message.filter; - if (message.orderBy != null && message.hasOwnProperty("orderBy")) - object.orderBy = message.orderBy; - if (message.readTime != null && message.hasOwnProperty("readTime")) - object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); + if (message.groupBy != null && message.hasOwnProperty("groupBy")) + object.groupBy = message.groupBy; if (message.compareDuration != null && message.hasOwnProperty("compareDuration")) object.compareDuration = $root.google.protobuf.Duration.toObject(message.compareDuration, options); - if (message.fieldMask != null && message.hasOwnProperty("fieldMask")) - object.fieldMask = $root.google.protobuf.FieldMask.toObject(message.fieldMask, options); + if (message.readTime != null && message.hasOwnProperty("readTime")) + object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); if (message.pageToken != null && message.hasOwnProperty("pageToken")) object.pageToken = message.pageToken; if (message.pageSize != null && message.hasOwnProperty("pageSize")) @@ -4696,41 +4438,41 @@ }; /** - * Converts this ListFindingsRequest to JSON. + * Converts this GroupAssetsRequest to JSON. * @function toJSON - * @memberof google.cloud.securitycenter.v1.ListFindingsRequest + * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest * @instance * @returns {Object.} JSON object */ - ListFindingsRequest.prototype.toJSON = function toJSON() { + GroupAssetsRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ListFindingsRequest; + return GroupAssetsRequest; })(); - v1.ListFindingsResponse = (function() { + v1.GroupAssetsResponse = (function() { /** - * Properties of a ListFindingsResponse. + * Properties of a GroupAssetsResponse. * @memberof google.cloud.securitycenter.v1 - * @interface IListFindingsResponse - * @property {Array.|null} [listFindingsResults] ListFindingsResponse listFindingsResults - * @property {google.protobuf.ITimestamp|null} [readTime] ListFindingsResponse readTime - * @property {string|null} [nextPageToken] ListFindingsResponse nextPageToken - * @property {number|null} [totalSize] ListFindingsResponse totalSize + * @interface IGroupAssetsResponse + * @property {Array.|null} [groupByResults] GroupAssetsResponse groupByResults + * @property {google.protobuf.ITimestamp|null} [readTime] GroupAssetsResponse readTime + * @property {string|null} [nextPageToken] GroupAssetsResponse nextPageToken + * @property {number|null} [totalSize] GroupAssetsResponse totalSize */ /** - * Constructs a new ListFindingsResponse. + * Constructs a new GroupAssetsResponse. * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents a ListFindingsResponse. - * @implements IListFindingsResponse + * @classdesc Represents a GroupAssetsResponse. + * @implements IGroupAssetsResponse * @constructor - * @param {google.cloud.securitycenter.v1.IListFindingsResponse=} [properties] Properties to set + * @param {google.cloud.securitycenter.v1.IGroupAssetsResponse=} [properties] Properties to set */ - function ListFindingsResponse(properties) { - this.listFindingsResults = []; + function GroupAssetsResponse(properties) { + this.groupByResults = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -4738,64 +4480,64 @@ } /** - * ListFindingsResponse listFindingsResults. - * @member {Array.} listFindingsResults - * @memberof google.cloud.securitycenter.v1.ListFindingsResponse + * GroupAssetsResponse groupByResults. + * @member {Array.} groupByResults + * @memberof google.cloud.securitycenter.v1.GroupAssetsResponse * @instance */ - ListFindingsResponse.prototype.listFindingsResults = $util.emptyArray; + GroupAssetsResponse.prototype.groupByResults = $util.emptyArray; /** - * ListFindingsResponse readTime. + * GroupAssetsResponse readTime. * @member {google.protobuf.ITimestamp|null|undefined} readTime - * @memberof google.cloud.securitycenter.v1.ListFindingsResponse + * @memberof google.cloud.securitycenter.v1.GroupAssetsResponse * @instance */ - ListFindingsResponse.prototype.readTime = null; + GroupAssetsResponse.prototype.readTime = null; /** - * ListFindingsResponse nextPageToken. + * GroupAssetsResponse nextPageToken. * @member {string} nextPageToken - * @memberof google.cloud.securitycenter.v1.ListFindingsResponse + * @memberof google.cloud.securitycenter.v1.GroupAssetsResponse * @instance */ - ListFindingsResponse.prototype.nextPageToken = ""; + GroupAssetsResponse.prototype.nextPageToken = ""; /** - * ListFindingsResponse totalSize. + * GroupAssetsResponse totalSize. * @member {number} totalSize - * @memberof google.cloud.securitycenter.v1.ListFindingsResponse + * @memberof google.cloud.securitycenter.v1.GroupAssetsResponse * @instance */ - ListFindingsResponse.prototype.totalSize = 0; + GroupAssetsResponse.prototype.totalSize = 0; /** - * Creates a new ListFindingsResponse instance using the specified properties. + * Creates a new GroupAssetsResponse instance using the specified properties. * @function create - * @memberof google.cloud.securitycenter.v1.ListFindingsResponse + * @memberof google.cloud.securitycenter.v1.GroupAssetsResponse * @static - * @param {google.cloud.securitycenter.v1.IListFindingsResponse=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.ListFindingsResponse} ListFindingsResponse instance + * @param {google.cloud.securitycenter.v1.IGroupAssetsResponse=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.GroupAssetsResponse} GroupAssetsResponse instance */ - ListFindingsResponse.create = function create(properties) { - return new ListFindingsResponse(properties); + GroupAssetsResponse.create = function create(properties) { + return new GroupAssetsResponse(properties); }; /** - * Encodes the specified ListFindingsResponse message. Does not implicitly {@link google.cloud.securitycenter.v1.ListFindingsResponse.verify|verify} messages. + * Encodes the specified GroupAssetsResponse message. Does not implicitly {@link google.cloud.securitycenter.v1.GroupAssetsResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.securitycenter.v1.ListFindingsResponse + * @memberof google.cloud.securitycenter.v1.GroupAssetsResponse * @static - * @param {google.cloud.securitycenter.v1.IListFindingsResponse} message ListFindingsResponse message or plain object to encode + * @param {google.cloud.securitycenter.v1.IGroupAssetsResponse} message GroupAssetsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListFindingsResponse.encode = function encode(message, writer) { + GroupAssetsResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.listFindingsResults != null && message.listFindingsResults.length) - for (var i = 0; i < message.listFindingsResults.length; ++i) - $root.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.encode(message.listFindingsResults[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.groupByResults != null && message.groupByResults.length) + for (var i = 0; i < message.groupByResults.length; ++i) + $root.google.cloud.securitycenter.v1.GroupResult.encode(message.groupByResults[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); if (message.readTime != null && message.hasOwnProperty("readTime")) $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) @@ -4806,40 +4548,40 @@ }; /** - * Encodes the specified ListFindingsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListFindingsResponse.verify|verify} messages. + * Encodes the specified GroupAssetsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.GroupAssetsResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.ListFindingsResponse + * @memberof google.cloud.securitycenter.v1.GroupAssetsResponse * @static - * @param {google.cloud.securitycenter.v1.IListFindingsResponse} message ListFindingsResponse message or plain object to encode + * @param {google.cloud.securitycenter.v1.IGroupAssetsResponse} message GroupAssetsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListFindingsResponse.encodeDelimited = function encodeDelimited(message, writer) { + GroupAssetsResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListFindingsResponse message from the specified reader or buffer. + * Decodes a GroupAssetsResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.securitycenter.v1.ListFindingsResponse + * @memberof google.cloud.securitycenter.v1.GroupAssetsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.ListFindingsResponse} ListFindingsResponse + * @returns {google.cloud.securitycenter.v1.GroupAssetsResponse} GroupAssetsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListFindingsResponse.decode = function decode(reader, length) { + GroupAssetsResponse.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.cloud.securitycenter.v1.ListFindingsResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.GroupAssetsResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - if (!(message.listFindingsResults && message.listFindingsResults.length)) - message.listFindingsResults = []; - message.listFindingsResults.push($root.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.decode(reader, reader.uint32())); + if (!(message.groupByResults && message.groupByResults.length)) + message.groupByResults = []; + message.groupByResults.push($root.google.cloud.securitycenter.v1.GroupResult.decode(reader, reader.uint32())); break; case 2: message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); @@ -4859,39 +4601,39 @@ }; /** - * Decodes a ListFindingsResponse message from the specified reader or buffer, length delimited. + * Decodes a GroupAssetsResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.ListFindingsResponse + * @memberof google.cloud.securitycenter.v1.GroupAssetsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.ListFindingsResponse} ListFindingsResponse + * @returns {google.cloud.securitycenter.v1.GroupAssetsResponse} GroupAssetsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListFindingsResponse.decodeDelimited = function decodeDelimited(reader) { + GroupAssetsResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListFindingsResponse message. + * Verifies a GroupAssetsResponse message. * @function verify - * @memberof google.cloud.securitycenter.v1.ListFindingsResponse + * @memberof google.cloud.securitycenter.v1.GroupAssetsResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListFindingsResponse.verify = function verify(message) { + GroupAssetsResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.listFindingsResults != null && message.hasOwnProperty("listFindingsResults")) { - if (!Array.isArray(message.listFindingsResults)) - return "listFindingsResults: array expected"; - for (var i = 0; i < message.listFindingsResults.length; ++i) { - var error = $root.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.verify(message.listFindingsResults[i]); + if (message.groupByResults != null && message.hasOwnProperty("groupByResults")) { + if (!Array.isArray(message.groupByResults)) + return "groupByResults: array expected"; + for (var i = 0; i < message.groupByResults.length; ++i) { + var error = $root.google.cloud.securitycenter.v1.GroupResult.verify(message.groupByResults[i]); if (error) - return "listFindingsResults." + error; + return "groupByResults." + error; } } if (message.readTime != null && message.hasOwnProperty("readTime")) { @@ -4909,30 +4651,30 @@ }; /** - * Creates a ListFindingsResponse message from a plain object. Also converts values to their respective internal types. + * Creates a GroupAssetsResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.securitycenter.v1.ListFindingsResponse + * @memberof google.cloud.securitycenter.v1.GroupAssetsResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.ListFindingsResponse} ListFindingsResponse + * @returns {google.cloud.securitycenter.v1.GroupAssetsResponse} GroupAssetsResponse */ - ListFindingsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.ListFindingsResponse) + GroupAssetsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.GroupAssetsResponse) return object; - var message = new $root.google.cloud.securitycenter.v1.ListFindingsResponse(); - if (object.listFindingsResults) { - if (!Array.isArray(object.listFindingsResults)) - throw TypeError(".google.cloud.securitycenter.v1.ListFindingsResponse.listFindingsResults: array expected"); - message.listFindingsResults = []; - for (var i = 0; i < object.listFindingsResults.length; ++i) { - if (typeof object.listFindingsResults[i] !== "object") - throw TypeError(".google.cloud.securitycenter.v1.ListFindingsResponse.listFindingsResults: object expected"); - message.listFindingsResults[i] = $root.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.fromObject(object.listFindingsResults[i]); + var message = new $root.google.cloud.securitycenter.v1.GroupAssetsResponse(); + if (object.groupByResults) { + if (!Array.isArray(object.groupByResults)) + throw TypeError(".google.cloud.securitycenter.v1.GroupAssetsResponse.groupByResults: array expected"); + message.groupByResults = []; + for (var i = 0; i < object.groupByResults.length; ++i) { + if (typeof object.groupByResults[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v1.GroupAssetsResponse.groupByResults: object expected"); + message.groupByResults[i] = $root.google.cloud.securitycenter.v1.GroupResult.fromObject(object.groupByResults[i]); } } if (object.readTime != null) { if (typeof object.readTime !== "object") - throw TypeError(".google.cloud.securitycenter.v1.ListFindingsResponse.readTime: object expected"); + throw TypeError(".google.cloud.securitycenter.v1.GroupAssetsResponse.readTime: object expected"); message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); } if (object.nextPageToken != null) @@ -4943,29 +4685,29 @@ }; /** - * Creates a plain object from a ListFindingsResponse message. Also converts values to other types if specified. + * Creates a plain object from a GroupAssetsResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.securitycenter.v1.ListFindingsResponse + * @memberof google.cloud.securitycenter.v1.GroupAssetsResponse * @static - * @param {google.cloud.securitycenter.v1.ListFindingsResponse} message ListFindingsResponse + * @param {google.cloud.securitycenter.v1.GroupAssetsResponse} message GroupAssetsResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListFindingsResponse.toObject = function toObject(message, options) { + GroupAssetsResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) - object.listFindingsResults = []; + object.groupByResults = []; if (options.defaults) { object.readTime = null; object.nextPageToken = ""; object.totalSize = 0; } - if (message.listFindingsResults && message.listFindingsResults.length) { - object.listFindingsResults = []; - for (var j = 0; j < message.listFindingsResults.length; ++j) - object.listFindingsResults[j] = $root.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.toObject(message.listFindingsResults[j], options); + if (message.groupByResults && message.groupByResults.length) { + object.groupByResults = []; + for (var j = 0; j < message.groupByResults.length; ++j) + object.groupByResults[j] = $root.google.cloud.securitycenter.v1.GroupResult.toObject(message.groupByResults[j], options); } if (message.readTime != null && message.hasOwnProperty("readTime")) object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); @@ -4977,404 +4719,197 @@ }; /** - * Converts this ListFindingsResponse to JSON. + * Converts this GroupAssetsResponse to JSON. * @function toJSON - * @memberof google.cloud.securitycenter.v1.ListFindingsResponse + * @memberof google.cloud.securitycenter.v1.GroupAssetsResponse * @instance * @returns {Object.} JSON object */ - ListFindingsResponse.prototype.toJSON = function toJSON() { + GroupAssetsResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - ListFindingsResponse.ListFindingsResult = (function() { + return GroupAssetsResponse; + })(); - /** - * Properties of a ListFindingsResult. - * @memberof google.cloud.securitycenter.v1.ListFindingsResponse - * @interface IListFindingsResult - * @property {google.cloud.securitycenter.v1.IFinding|null} [finding] ListFindingsResult finding - * @property {google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.StateChange|null} [stateChange] ListFindingsResult stateChange - */ + v1.GroupFindingsRequest = (function() { - /** - * Constructs a new ListFindingsResult. - * @memberof google.cloud.securitycenter.v1.ListFindingsResponse - * @classdesc Represents a ListFindingsResult. - * @implements IListFindingsResult - * @constructor - * @param {google.cloud.securitycenter.v1.ListFindingsResponse.IListFindingsResult=} [properties] Properties to set - */ - function ListFindingsResult(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]]; - } - - /** - * ListFindingsResult finding. - * @member {google.cloud.securitycenter.v1.IFinding|null|undefined} finding - * @memberof google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult - * @instance - */ - ListFindingsResult.prototype.finding = null; + /** + * Properties of a GroupFindingsRequest. + * @memberof google.cloud.securitycenter.v1 + * @interface IGroupFindingsRequest + * @property {string|null} [parent] GroupFindingsRequest parent + * @property {string|null} [filter] GroupFindingsRequest filter + * @property {string|null} [groupBy] GroupFindingsRequest groupBy + * @property {google.protobuf.ITimestamp|null} [readTime] GroupFindingsRequest readTime + * @property {google.protobuf.IDuration|null} [compareDuration] GroupFindingsRequest compareDuration + * @property {string|null} [pageToken] GroupFindingsRequest pageToken + * @property {number|null} [pageSize] GroupFindingsRequest pageSize + */ - /** - * ListFindingsResult stateChange. - * @member {google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.StateChange} stateChange - * @memberof google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult - * @instance - */ - ListFindingsResult.prototype.stateChange = 0; + /** + * Constructs a new GroupFindingsRequest. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a GroupFindingsRequest. + * @implements IGroupFindingsRequest + * @constructor + * @param {google.cloud.securitycenter.v1.IGroupFindingsRequest=} [properties] Properties to set + */ + function GroupFindingsRequest(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]]; + } - /** - * Creates a new ListFindingsResult instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult - * @static - * @param {google.cloud.securitycenter.v1.ListFindingsResponse.IListFindingsResult=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult} ListFindingsResult instance - */ - ListFindingsResult.create = function create(properties) { - return new ListFindingsResult(properties); - }; + /** + * GroupFindingsRequest parent. + * @member {string} parent + * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest + * @instance + */ + GroupFindingsRequest.prototype.parent = ""; - /** - * Encodes the specified ListFindingsResult message. Does not implicitly {@link google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult - * @static - * @param {google.cloud.securitycenter.v1.ListFindingsResponse.IListFindingsResult} message ListFindingsResult message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListFindingsResult.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.finding != null && message.hasOwnProperty("finding")) - $root.google.cloud.securitycenter.v1.Finding.encode(message.finding, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.stateChange != null && message.hasOwnProperty("stateChange")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.stateChange); - return writer; - }; + /** + * GroupFindingsRequest filter. + * @member {string} filter + * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest + * @instance + */ + GroupFindingsRequest.prototype.filter = ""; - /** - * Encodes the specified ListFindingsResult message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult - * @static - * @param {google.cloud.securitycenter.v1.ListFindingsResponse.IListFindingsResult} message ListFindingsResult message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListFindingsResult.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * GroupFindingsRequest groupBy. + * @member {string} groupBy + * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest + * @instance + */ + GroupFindingsRequest.prototype.groupBy = ""; - /** - * Decodes a ListFindingsResult message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult} ListFindingsResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListFindingsResult.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.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.finding = $root.google.cloud.securitycenter.v1.Finding.decode(reader, reader.uint32()); - break; - case 2: - message.stateChange = reader.int32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * GroupFindingsRequest readTime. + * @member {google.protobuf.ITimestamp|null|undefined} readTime + * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest + * @instance + */ + GroupFindingsRequest.prototype.readTime = null; - /** - * Decodes a ListFindingsResult message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult} ListFindingsResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListFindingsResult.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * GroupFindingsRequest compareDuration. + * @member {google.protobuf.IDuration|null|undefined} compareDuration + * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest + * @instance + */ + GroupFindingsRequest.prototype.compareDuration = null; - /** - * Verifies a ListFindingsResult message. - * @function verify - * @memberof google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListFindingsResult.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.finding != null && message.hasOwnProperty("finding")) { - var error = $root.google.cloud.securitycenter.v1.Finding.verify(message.finding); - if (error) - return "finding." + error; - } - if (message.stateChange != null && message.hasOwnProperty("stateChange")) - switch (message.stateChange) { - default: - return "stateChange: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - break; - } - return null; - }; + /** + * GroupFindingsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest + * @instance + */ + GroupFindingsRequest.prototype.pageToken = ""; - /** - * Creates a ListFindingsResult message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult} ListFindingsResult - */ - ListFindingsResult.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult) - return object; - var message = new $root.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult(); - if (object.finding != null) { - if (typeof object.finding !== "object") - throw TypeError(".google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.finding: object expected"); - message.finding = $root.google.cloud.securitycenter.v1.Finding.fromObject(object.finding); - } - switch (object.stateChange) { - case "UNUSED": - case 0: - message.stateChange = 0; - break; - case "CHANGED": - case 1: - message.stateChange = 1; - break; - case "UNCHANGED": - case 2: - message.stateChange = 2; - break; - case "ADDED": - case 3: - message.stateChange = 3; - break; - case "REMOVED": - case 4: - message.stateChange = 4; - break; - } - return message; - }; - - /** - * Creates a plain object from a ListFindingsResult message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult - * @static - * @param {google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult} message ListFindingsResult - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListFindingsResult.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.finding = null; - object.stateChange = options.enums === String ? "UNUSED" : 0; - } - if (message.finding != null && message.hasOwnProperty("finding")) - object.finding = $root.google.cloud.securitycenter.v1.Finding.toObject(message.finding, options); - if (message.stateChange != null && message.hasOwnProperty("stateChange")) - object.stateChange = options.enums === String ? $root.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.StateChange[message.stateChange] : message.stateChange; - return object; - }; - - /** - * Converts this ListFindingsResult to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult - * @instance - * @returns {Object.} JSON object - */ - ListFindingsResult.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * StateChange enum. - * @name google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.StateChange - * @enum {string} - * @property {number} UNUSED=0 UNUSED value - * @property {number} CHANGED=1 CHANGED value - * @property {number} UNCHANGED=2 UNCHANGED value - * @property {number} ADDED=3 ADDED value - * @property {number} REMOVED=4 REMOVED value - */ - ListFindingsResult.StateChange = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "UNUSED"] = 0; - values[valuesById[1] = "CHANGED"] = 1; - values[valuesById[2] = "UNCHANGED"] = 2; - values[valuesById[3] = "ADDED"] = 3; - values[valuesById[4] = "REMOVED"] = 4; - return values; - })(); - - return ListFindingsResult; - })(); - - return ListFindingsResponse; - })(); - - v1.SetFindingStateRequest = (function() { - - /** - * Properties of a SetFindingStateRequest. - * @memberof google.cloud.securitycenter.v1 - * @interface ISetFindingStateRequest - * @property {string|null} [name] SetFindingStateRequest name - * @property {google.cloud.securitycenter.v1.Finding.State|null} [state] SetFindingStateRequest state - * @property {google.protobuf.ITimestamp|null} [startTime] SetFindingStateRequest startTime - */ - - /** - * Constructs a new SetFindingStateRequest. - * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents a SetFindingStateRequest. - * @implements ISetFindingStateRequest - * @constructor - * @param {google.cloud.securitycenter.v1.ISetFindingStateRequest=} [properties] Properties to set - */ - function SetFindingStateRequest(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]]; - } - - /** - * SetFindingStateRequest name. - * @member {string} name - * @memberof google.cloud.securitycenter.v1.SetFindingStateRequest - * @instance - */ - SetFindingStateRequest.prototype.name = ""; - - /** - * SetFindingStateRequest state. - * @member {google.cloud.securitycenter.v1.Finding.State} state - * @memberof google.cloud.securitycenter.v1.SetFindingStateRequest - * @instance - */ - SetFindingStateRequest.prototype.state = 0; - - /** - * SetFindingStateRequest startTime. - * @member {google.protobuf.ITimestamp|null|undefined} startTime - * @memberof google.cloud.securitycenter.v1.SetFindingStateRequest - * @instance - */ - SetFindingStateRequest.prototype.startTime = null; + /** + * GroupFindingsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest + * @instance + */ + GroupFindingsRequest.prototype.pageSize = 0; /** - * Creates a new SetFindingStateRequest instance using the specified properties. + * Creates a new GroupFindingsRequest instance using the specified properties. * @function create - * @memberof google.cloud.securitycenter.v1.SetFindingStateRequest + * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest * @static - * @param {google.cloud.securitycenter.v1.ISetFindingStateRequest=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.SetFindingStateRequest} SetFindingStateRequest instance + * @param {google.cloud.securitycenter.v1.IGroupFindingsRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.GroupFindingsRequest} GroupFindingsRequest instance */ - SetFindingStateRequest.create = function create(properties) { - return new SetFindingStateRequest(properties); + GroupFindingsRequest.create = function create(properties) { + return new GroupFindingsRequest(properties); }; /** - * Encodes the specified SetFindingStateRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.SetFindingStateRequest.verify|verify} messages. + * Encodes the specified GroupFindingsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.GroupFindingsRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.securitycenter.v1.SetFindingStateRequest + * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest * @static - * @param {google.cloud.securitycenter.v1.ISetFindingStateRequest} message SetFindingStateRequest message or plain object to encode + * @param {google.cloud.securitycenter.v1.IGroupFindingsRequest} message GroupFindingsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SetFindingStateRequest.encode = function encode(message, writer) { + GroupFindingsRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.state != null && message.hasOwnProperty("state")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.state); - if (message.startTime != null && message.hasOwnProperty("startTime")) - $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.parent != null && message.hasOwnProperty("parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.filter != null && message.hasOwnProperty("filter")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); + if (message.groupBy != null && message.hasOwnProperty("groupBy")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.groupBy); + if (message.readTime != null && message.hasOwnProperty("readTime")) + $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.compareDuration != null && message.hasOwnProperty("compareDuration")) + $root.google.protobuf.Duration.encode(message.compareDuration, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.pageToken); + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.pageSize); return writer; }; /** - * Encodes the specified SetFindingStateRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.SetFindingStateRequest.verify|verify} messages. + * Encodes the specified GroupFindingsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.GroupFindingsRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.SetFindingStateRequest + * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest * @static - * @param {google.cloud.securitycenter.v1.ISetFindingStateRequest} message SetFindingStateRequest message or plain object to encode + * @param {google.cloud.securitycenter.v1.IGroupFindingsRequest} message GroupFindingsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SetFindingStateRequest.encodeDelimited = function encodeDelimited(message, writer) { + GroupFindingsRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a SetFindingStateRequest message from the specified reader or buffer. + * Decodes a GroupFindingsRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.securitycenter.v1.SetFindingStateRequest + * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.SetFindingStateRequest} SetFindingStateRequest + * @returns {google.cloud.securitycenter.v1.GroupFindingsRequest} GroupFindingsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SetFindingStateRequest.decode = function decode(reader, length) { + GroupFindingsRequest.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.cloud.securitycenter.v1.SetFindingStateRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.GroupFindingsRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.name = reader.string(); + message.parent = reader.string(); break; case 2: - message.state = reader.int32(); + message.filter = reader.string(); break; case 3: - message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + message.groupBy = reader.string(); + break; + case 4: + message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 5: + message.compareDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + case 7: + message.pageToken = reader.string(); + break; + case 8: + message.pageSize = reader.int32(); break; default: reader.skipType(tag & 7); @@ -5385,147 +4920,170 @@ }; /** - * Decodes a SetFindingStateRequest message from the specified reader or buffer, length delimited. + * Decodes a GroupFindingsRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.SetFindingStateRequest + * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.SetFindingStateRequest} SetFindingStateRequest + * @returns {google.cloud.securitycenter.v1.GroupFindingsRequest} GroupFindingsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SetFindingStateRequest.decodeDelimited = function decodeDelimited(reader) { + GroupFindingsRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a SetFindingStateRequest message. + * Verifies a GroupFindingsRequest message. * @function verify - * @memberof google.cloud.securitycenter.v1.SetFindingStateRequest + * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - SetFindingStateRequest.verify = function verify(message) { + GroupFindingsRequest.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.state != null && message.hasOwnProperty("state")) - switch (message.state) { - default: - return "state: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.startTime != null && message.hasOwnProperty("startTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.startTime); + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.groupBy != null && message.hasOwnProperty("groupBy")) + if (!$util.isString(message.groupBy)) + return "groupBy: string expected"; + if (message.readTime != null && message.hasOwnProperty("readTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.readTime); if (error) - return "startTime." + error; + return "readTime." + error; + } + if (message.compareDuration != null && message.hasOwnProperty("compareDuration")) { + var error = $root.google.protobuf.Duration.verify(message.compareDuration); + if (error) + return "compareDuration." + error; } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; return null; }; /** - * Creates a SetFindingStateRequest message from a plain object. Also converts values to their respective internal types. + * Creates a GroupFindingsRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.securitycenter.v1.SetFindingStateRequest + * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.SetFindingStateRequest} SetFindingStateRequest + * @returns {google.cloud.securitycenter.v1.GroupFindingsRequest} GroupFindingsRequest */ - SetFindingStateRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.SetFindingStateRequest) + GroupFindingsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.GroupFindingsRequest) return object; - var message = new $root.google.cloud.securitycenter.v1.SetFindingStateRequest(); - if (object.name != null) - message.name = String(object.name); - switch (object.state) { - case "STATE_UNSPECIFIED": - case 0: - message.state = 0; - break; - case "ACTIVE": - case 1: - message.state = 1; - break; - case "INACTIVE": - case 2: - message.state = 2; - break; + var message = new $root.google.cloud.securitycenter.v1.GroupFindingsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.filter != null) + message.filter = String(object.filter); + if (object.groupBy != null) + message.groupBy = String(object.groupBy); + if (object.readTime != null) { + if (typeof object.readTime !== "object") + throw TypeError(".google.cloud.securitycenter.v1.GroupFindingsRequest.readTime: object expected"); + message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); } - if (object.startTime != null) { - if (typeof object.startTime !== "object") - throw TypeError(".google.cloud.securitycenter.v1.SetFindingStateRequest.startTime: object expected"); - message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); + if (object.compareDuration != null) { + if (typeof object.compareDuration !== "object") + throw TypeError(".google.cloud.securitycenter.v1.GroupFindingsRequest.compareDuration: object expected"); + message.compareDuration = $root.google.protobuf.Duration.fromObject(object.compareDuration); } + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; return message; }; /** - * Creates a plain object from a SetFindingStateRequest message. Also converts values to other types if specified. + * Creates a plain object from a GroupFindingsRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.securitycenter.v1.SetFindingStateRequest + * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest * @static - * @param {google.cloud.securitycenter.v1.SetFindingStateRequest} message SetFindingStateRequest + * @param {google.cloud.securitycenter.v1.GroupFindingsRequest} message GroupFindingsRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SetFindingStateRequest.toObject = function toObject(message, options) { + GroupFindingsRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.name = ""; - object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; - object.startTime = null; + object.parent = ""; + object.filter = ""; + object.groupBy = ""; + object.readTime = null; + object.compareDuration = null; + object.pageToken = ""; + object.pageSize = 0; } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.securitycenter.v1.Finding.State[message.state] : message.state; - if (message.startTime != null && message.hasOwnProperty("startTime")) - object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.groupBy != null && message.hasOwnProperty("groupBy")) + object.groupBy = message.groupBy; + if (message.readTime != null && message.hasOwnProperty("readTime")) + object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); + if (message.compareDuration != null && message.hasOwnProperty("compareDuration")) + object.compareDuration = $root.google.protobuf.Duration.toObject(message.compareDuration, options); + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; return object; }; /** - * Converts this SetFindingStateRequest to JSON. + * Converts this GroupFindingsRequest to JSON. * @function toJSON - * @memberof google.cloud.securitycenter.v1.SetFindingStateRequest + * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest * @instance * @returns {Object.} JSON object */ - SetFindingStateRequest.prototype.toJSON = function toJSON() { + GroupFindingsRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return SetFindingStateRequest; + return GroupFindingsRequest; })(); - v1.RunAssetDiscoveryRequest = (function() { + v1.GroupFindingsResponse = (function() { /** - * Properties of a RunAssetDiscoveryRequest. + * Properties of a GroupFindingsResponse. * @memberof google.cloud.securitycenter.v1 - * @interface IRunAssetDiscoveryRequest - * @property {string|null} [parent] RunAssetDiscoveryRequest parent + * @interface IGroupFindingsResponse + * @property {Array.|null} [groupByResults] GroupFindingsResponse groupByResults + * @property {google.protobuf.ITimestamp|null} [readTime] GroupFindingsResponse readTime + * @property {string|null} [nextPageToken] GroupFindingsResponse nextPageToken + * @property {number|null} [totalSize] GroupFindingsResponse totalSize */ /** - * Constructs a new RunAssetDiscoveryRequest. + * Constructs a new GroupFindingsResponse. * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents a RunAssetDiscoveryRequest. - * @implements IRunAssetDiscoveryRequest + * @classdesc Represents a GroupFindingsResponse. + * @implements IGroupFindingsResponse * @constructor - * @param {google.cloud.securitycenter.v1.IRunAssetDiscoveryRequest=} [properties] Properties to set + * @param {google.cloud.securitycenter.v1.IGroupFindingsResponse=} [properties] Properties to set */ - function RunAssetDiscoveryRequest(properties) { + function GroupFindingsResponse(properties) { + this.groupByResults = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -5533,75 +5091,117 @@ } /** - * RunAssetDiscoveryRequest parent. - * @member {string} parent - * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryRequest + * GroupFindingsResponse groupByResults. + * @member {Array.} groupByResults + * @memberof google.cloud.securitycenter.v1.GroupFindingsResponse * @instance */ - RunAssetDiscoveryRequest.prototype.parent = ""; + GroupFindingsResponse.prototype.groupByResults = $util.emptyArray; /** - * Creates a new RunAssetDiscoveryRequest instance using the specified properties. + * GroupFindingsResponse readTime. + * @member {google.protobuf.ITimestamp|null|undefined} readTime + * @memberof google.cloud.securitycenter.v1.GroupFindingsResponse + * @instance + */ + GroupFindingsResponse.prototype.readTime = null; + + /** + * GroupFindingsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.securitycenter.v1.GroupFindingsResponse + * @instance + */ + GroupFindingsResponse.prototype.nextPageToken = ""; + + /** + * GroupFindingsResponse totalSize. + * @member {number} totalSize + * @memberof google.cloud.securitycenter.v1.GroupFindingsResponse + * @instance + */ + GroupFindingsResponse.prototype.totalSize = 0; + + /** + * Creates a new GroupFindingsResponse instance using the specified properties. * @function create - * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryRequest + * @memberof google.cloud.securitycenter.v1.GroupFindingsResponse * @static - * @param {google.cloud.securitycenter.v1.IRunAssetDiscoveryRequest=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.RunAssetDiscoveryRequest} RunAssetDiscoveryRequest instance + * @param {google.cloud.securitycenter.v1.IGroupFindingsResponse=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.GroupFindingsResponse} GroupFindingsResponse instance */ - RunAssetDiscoveryRequest.create = function create(properties) { - return new RunAssetDiscoveryRequest(properties); + GroupFindingsResponse.create = function create(properties) { + return new GroupFindingsResponse(properties); }; /** - * Encodes the specified RunAssetDiscoveryRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.RunAssetDiscoveryRequest.verify|verify} messages. + * Encodes the specified GroupFindingsResponse message. Does not implicitly {@link google.cloud.securitycenter.v1.GroupFindingsResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryRequest + * @memberof google.cloud.securitycenter.v1.GroupFindingsResponse * @static - * @param {google.cloud.securitycenter.v1.IRunAssetDiscoveryRequest} message RunAssetDiscoveryRequest message or plain object to encode + * @param {google.cloud.securitycenter.v1.IGroupFindingsResponse} message GroupFindingsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - RunAssetDiscoveryRequest.encode = function encode(message, writer) { + GroupFindingsResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && message.hasOwnProperty("parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.groupByResults != null && message.groupByResults.length) + for (var i = 0; i < message.groupByResults.length; ++i) + $root.google.cloud.securitycenter.v1.GroupResult.encode(message.groupByResults[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.readTime != null && message.hasOwnProperty("readTime")) + $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.nextPageToken); + if (message.totalSize != null && message.hasOwnProperty("totalSize")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.totalSize); return writer; }; /** - * Encodes the specified RunAssetDiscoveryRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.RunAssetDiscoveryRequest.verify|verify} messages. + * Encodes the specified GroupFindingsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.GroupFindingsResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryRequest + * @memberof google.cloud.securitycenter.v1.GroupFindingsResponse * @static - * @param {google.cloud.securitycenter.v1.IRunAssetDiscoveryRequest} message RunAssetDiscoveryRequest message or plain object to encode + * @param {google.cloud.securitycenter.v1.IGroupFindingsResponse} message GroupFindingsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - RunAssetDiscoveryRequest.encodeDelimited = function encodeDelimited(message, writer) { + GroupFindingsResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a RunAssetDiscoveryRequest message from the specified reader or buffer. + * Decodes a GroupFindingsResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryRequest + * @memberof google.cloud.securitycenter.v1.GroupFindingsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.RunAssetDiscoveryRequest} RunAssetDiscoveryRequest + * @returns {google.cloud.securitycenter.v1.GroupFindingsResponse} GroupFindingsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - RunAssetDiscoveryRequest.decode = function decode(reader, length) { + GroupFindingsResponse.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.cloud.securitycenter.v1.RunAssetDiscoveryRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.GroupFindingsResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.parent = reader.string(); + if (!(message.groupByResults && message.groupByResults.length)) + message.groupByResults = []; + message.groupByResults.push($root.google.cloud.securitycenter.v1.GroupResult.decode(reader, reader.uint32())); + break; + case 2: + message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 3: + message.nextPageToken = reader.string(); + break; + case 4: + message.totalSize = reader.int32(); break; default: reader.skipType(tag & 7); @@ -5612,108 +5212,157 @@ }; /** - * Decodes a RunAssetDiscoveryRequest message from the specified reader or buffer, length delimited. + * Decodes a GroupFindingsResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryRequest + * @memberof google.cloud.securitycenter.v1.GroupFindingsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.RunAssetDiscoveryRequest} RunAssetDiscoveryRequest + * @returns {google.cloud.securitycenter.v1.GroupFindingsResponse} GroupFindingsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - RunAssetDiscoveryRequest.decodeDelimited = function decodeDelimited(reader) { + GroupFindingsResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a RunAssetDiscoveryRequest message. + * Verifies a GroupFindingsResponse message. * @function verify - * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryRequest + * @memberof google.cloud.securitycenter.v1.GroupFindingsResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - RunAssetDiscoveryRequest.verify = function verify(message) { + GroupFindingsResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; + if (message.groupByResults != null && message.hasOwnProperty("groupByResults")) { + if (!Array.isArray(message.groupByResults)) + return "groupByResults: array expected"; + for (var i = 0; i < message.groupByResults.length; ++i) { + var error = $root.google.cloud.securitycenter.v1.GroupResult.verify(message.groupByResults[i]); + if (error) + return "groupByResults." + error; + } + } + if (message.readTime != null && message.hasOwnProperty("readTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.readTime); + if (error) + return "readTime." + error; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.totalSize != null && message.hasOwnProperty("totalSize")) + if (!$util.isInteger(message.totalSize)) + return "totalSize: integer expected"; return null; }; /** - * Creates a RunAssetDiscoveryRequest message from a plain object. Also converts values to their respective internal types. + * Creates a GroupFindingsResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryRequest + * @memberof google.cloud.securitycenter.v1.GroupFindingsResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.RunAssetDiscoveryRequest} RunAssetDiscoveryRequest + * @returns {google.cloud.securitycenter.v1.GroupFindingsResponse} GroupFindingsResponse */ - RunAssetDiscoveryRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.RunAssetDiscoveryRequest) + GroupFindingsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.GroupFindingsResponse) return object; - var message = new $root.google.cloud.securitycenter.v1.RunAssetDiscoveryRequest(); - if (object.parent != null) - message.parent = String(object.parent); - return message; - }; - - /** - * Creates a plain object from a RunAssetDiscoveryRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryRequest - * @static - * @param {google.cloud.securitycenter.v1.RunAssetDiscoveryRequest} message RunAssetDiscoveryRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RunAssetDiscoveryRequest.toObject = function toObject(message, options) { - if (!options) + var message = new $root.google.cloud.securitycenter.v1.GroupFindingsResponse(); + if (object.groupByResults) { + if (!Array.isArray(object.groupByResults)) + throw TypeError(".google.cloud.securitycenter.v1.GroupFindingsResponse.groupByResults: array expected"); + message.groupByResults = []; + for (var i = 0; i < object.groupByResults.length; ++i) { + if (typeof object.groupByResults[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v1.GroupFindingsResponse.groupByResults: object expected"); + message.groupByResults[i] = $root.google.cloud.securitycenter.v1.GroupResult.fromObject(object.groupByResults[i]); + } + } + if (object.readTime != null) { + if (typeof object.readTime !== "object") + throw TypeError(".google.cloud.securitycenter.v1.GroupFindingsResponse.readTime: object expected"); + message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.totalSize != null) + message.totalSize = object.totalSize | 0; + return message; + }; + + /** + * Creates a plain object from a GroupFindingsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.GroupFindingsResponse + * @static + * @param {google.cloud.securitycenter.v1.GroupFindingsResponse} message GroupFindingsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GroupFindingsResponse.toObject = function toObject(message, options) { + if (!options) options = {}; var object = {}; - if (options.defaults) - object.parent = ""; - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; + if (options.arrays || options.defaults) + object.groupByResults = []; + if (options.defaults) { + object.readTime = null; + object.nextPageToken = ""; + object.totalSize = 0; + } + if (message.groupByResults && message.groupByResults.length) { + object.groupByResults = []; + for (var j = 0; j < message.groupByResults.length; ++j) + object.groupByResults[j] = $root.google.cloud.securitycenter.v1.GroupResult.toObject(message.groupByResults[j], options); + } + if (message.readTime != null && message.hasOwnProperty("readTime")) + object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.totalSize != null && message.hasOwnProperty("totalSize")) + object.totalSize = message.totalSize; return object; }; /** - * Converts this RunAssetDiscoveryRequest to JSON. + * Converts this GroupFindingsResponse to JSON. * @function toJSON - * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryRequest + * @memberof google.cloud.securitycenter.v1.GroupFindingsResponse * @instance * @returns {Object.} JSON object */ - RunAssetDiscoveryRequest.prototype.toJSON = function toJSON() { + GroupFindingsResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return RunAssetDiscoveryRequest; + return GroupFindingsResponse; })(); - v1.UpdateFindingRequest = (function() { + v1.GroupResult = (function() { /** - * Properties of an UpdateFindingRequest. + * Properties of a GroupResult. * @memberof google.cloud.securitycenter.v1 - * @interface IUpdateFindingRequest - * @property {google.cloud.securitycenter.v1.IFinding|null} [finding] UpdateFindingRequest finding - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateFindingRequest updateMask + * @interface IGroupResult + * @property {Object.|null} [properties] GroupResult properties + * @property {number|Long|null} [count] GroupResult count */ /** - * Constructs a new UpdateFindingRequest. + * Constructs a new GroupResult. * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents an UpdateFindingRequest. - * @implements IUpdateFindingRequest + * @classdesc Represents a GroupResult. + * @implements IGroupResult * @constructor - * @param {google.cloud.securitycenter.v1.IUpdateFindingRequest=} [properties] Properties to set + * @param {google.cloud.securitycenter.v1.IGroupResult=} [properties] Properties to set */ - function UpdateFindingRequest(properties) { + function GroupResult(properties) { + this.properties = {}; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -5721,88 +5370,96 @@ } /** - * UpdateFindingRequest finding. - * @member {google.cloud.securitycenter.v1.IFinding|null|undefined} finding - * @memberof google.cloud.securitycenter.v1.UpdateFindingRequest + * GroupResult properties. + * @member {Object.} properties + * @memberof google.cloud.securitycenter.v1.GroupResult * @instance */ - UpdateFindingRequest.prototype.finding = null; + GroupResult.prototype.properties = $util.emptyObject; /** - * UpdateFindingRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.cloud.securitycenter.v1.UpdateFindingRequest + * GroupResult count. + * @member {number|Long} count + * @memberof google.cloud.securitycenter.v1.GroupResult * @instance */ - UpdateFindingRequest.prototype.updateMask = null; + GroupResult.prototype.count = $util.Long ? $util.Long.fromBits(0,0,false) : 0; /** - * Creates a new UpdateFindingRequest instance using the specified properties. + * Creates a new GroupResult instance using the specified properties. * @function create - * @memberof google.cloud.securitycenter.v1.UpdateFindingRequest + * @memberof google.cloud.securitycenter.v1.GroupResult * @static - * @param {google.cloud.securitycenter.v1.IUpdateFindingRequest=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.UpdateFindingRequest} UpdateFindingRequest instance + * @param {google.cloud.securitycenter.v1.IGroupResult=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.GroupResult} GroupResult instance */ - UpdateFindingRequest.create = function create(properties) { - return new UpdateFindingRequest(properties); + GroupResult.create = function create(properties) { + return new GroupResult(properties); }; /** - * Encodes the specified UpdateFindingRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.UpdateFindingRequest.verify|verify} messages. + * Encodes the specified GroupResult message. Does not implicitly {@link google.cloud.securitycenter.v1.GroupResult.verify|verify} messages. * @function encode - * @memberof google.cloud.securitycenter.v1.UpdateFindingRequest + * @memberof google.cloud.securitycenter.v1.GroupResult * @static - * @param {google.cloud.securitycenter.v1.IUpdateFindingRequest} message UpdateFindingRequest message or plain object to encode + * @param {google.cloud.securitycenter.v1.IGroupResult} message GroupResult message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateFindingRequest.encode = function encode(message, writer) { + GroupResult.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.finding != null && message.hasOwnProperty("finding")) - $root.google.cloud.securitycenter.v1.Finding.encode(message.finding, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.properties != null && message.hasOwnProperty("properties")) + for (var keys = Object.keys(message.properties), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.protobuf.Value.encode(message.properties[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.count != null && message.hasOwnProperty("count")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.count); return writer; }; /** - * Encodes the specified UpdateFindingRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.UpdateFindingRequest.verify|verify} messages. + * Encodes the specified GroupResult message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.GroupResult.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.UpdateFindingRequest + * @memberof google.cloud.securitycenter.v1.GroupResult * @static - * @param {google.cloud.securitycenter.v1.IUpdateFindingRequest} message UpdateFindingRequest message or plain object to encode + * @param {google.cloud.securitycenter.v1.IGroupResult} message GroupResult message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateFindingRequest.encodeDelimited = function encodeDelimited(message, writer) { + GroupResult.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an UpdateFindingRequest message from the specified reader or buffer. + * Decodes a GroupResult message from the specified reader or buffer. * @function decode - * @memberof google.cloud.securitycenter.v1.UpdateFindingRequest + * @memberof google.cloud.securitycenter.v1.GroupResult * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.UpdateFindingRequest} UpdateFindingRequest + * @returns {google.cloud.securitycenter.v1.GroupResult} GroupResult * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UpdateFindingRequest.decode = function decode(reader, length) { + GroupResult.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.cloud.securitycenter.v1.UpdateFindingRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.GroupResult(), key; while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.finding = $root.google.cloud.securitycenter.v1.Finding.decode(reader, reader.uint32()); + reader.skip().pos++; + if (message.properties === $util.emptyObject) + message.properties = {}; + key = reader.string(); + reader.pos++; + message.properties[key] = $root.google.protobuf.Value.decode(reader, reader.uint32()); break; case 2: - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + message.count = reader.int64(); break; default: reader.skipType(tag & 7); @@ -5813,127 +5470,151 @@ }; /** - * Decodes an UpdateFindingRequest message from the specified reader or buffer, length delimited. + * Decodes a GroupResult message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.UpdateFindingRequest + * @memberof google.cloud.securitycenter.v1.GroupResult * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.UpdateFindingRequest} UpdateFindingRequest + * @returns {google.cloud.securitycenter.v1.GroupResult} GroupResult * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UpdateFindingRequest.decodeDelimited = function decodeDelimited(reader) { + GroupResult.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an UpdateFindingRequest message. + * Verifies a GroupResult message. * @function verify - * @memberof google.cloud.securitycenter.v1.UpdateFindingRequest + * @memberof google.cloud.securitycenter.v1.GroupResult * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - UpdateFindingRequest.verify = function verify(message) { + GroupResult.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.finding != null && message.hasOwnProperty("finding")) { - var error = $root.google.cloud.securitycenter.v1.Finding.verify(message.finding); - if (error) - return "finding." + error; - } - if (message.updateMask != null && message.hasOwnProperty("updateMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.updateMask); - if (error) - return "updateMask." + error; + if (message.properties != null && message.hasOwnProperty("properties")) { + if (!$util.isObject(message.properties)) + return "properties: object expected"; + var key = Object.keys(message.properties); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.protobuf.Value.verify(message.properties[key[i]]); + if (error) + return "properties." + error; + } } + if (message.count != null && message.hasOwnProperty("count")) + if (!$util.isInteger(message.count) && !(message.count && $util.isInteger(message.count.low) && $util.isInteger(message.count.high))) + return "count: integer|Long expected"; return null; }; /** - * Creates an UpdateFindingRequest message from a plain object. Also converts values to their respective internal types. + * Creates a GroupResult message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.securitycenter.v1.UpdateFindingRequest + * @memberof google.cloud.securitycenter.v1.GroupResult * @static * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.UpdateFindingRequest} UpdateFindingRequest + * @returns {google.cloud.securitycenter.v1.GroupResult} GroupResult */ - UpdateFindingRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.UpdateFindingRequest) + GroupResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.GroupResult) return object; - var message = new $root.google.cloud.securitycenter.v1.UpdateFindingRequest(); - if (object.finding != null) { - if (typeof object.finding !== "object") - throw TypeError(".google.cloud.securitycenter.v1.UpdateFindingRequest.finding: object expected"); - message.finding = $root.google.cloud.securitycenter.v1.Finding.fromObject(object.finding); - } - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.cloud.securitycenter.v1.UpdateFindingRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + var message = new $root.google.cloud.securitycenter.v1.GroupResult(); + if (object.properties) { + if (typeof object.properties !== "object") + throw TypeError(".google.cloud.securitycenter.v1.GroupResult.properties: object expected"); + message.properties = {}; + for (var keys = Object.keys(object.properties), i = 0; i < keys.length; ++i) { + if (typeof object.properties[keys[i]] !== "object") + throw TypeError(".google.cloud.securitycenter.v1.GroupResult.properties: object expected"); + message.properties[keys[i]] = $root.google.protobuf.Value.fromObject(object.properties[keys[i]]); + } } + if (object.count != null) + if ($util.Long) + (message.count = $util.Long.fromValue(object.count)).unsigned = false; + else if (typeof object.count === "string") + message.count = parseInt(object.count, 10); + else if (typeof object.count === "number") + message.count = object.count; + else if (typeof object.count === "object") + message.count = new $util.LongBits(object.count.low >>> 0, object.count.high >>> 0).toNumber(); return message; }; /** - * Creates a plain object from an UpdateFindingRequest message. Also converts values to other types if specified. + * Creates a plain object from a GroupResult message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.securitycenter.v1.UpdateFindingRequest + * @memberof google.cloud.securitycenter.v1.GroupResult * @static - * @param {google.cloud.securitycenter.v1.UpdateFindingRequest} message UpdateFindingRequest + * @param {google.cloud.securitycenter.v1.GroupResult} message GroupResult * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - UpdateFindingRequest.toObject = function toObject(message, options) { + GroupResult.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.finding = null; - object.updateMask = null; - } - if (message.finding != null && message.hasOwnProperty("finding")) - object.finding = $root.google.cloud.securitycenter.v1.Finding.toObject(message.finding, options); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); - return object; - }; - - /** - * Converts this UpdateFindingRequest to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1.UpdateFindingRequest + if (options.objects || options.defaults) + object.properties = {}; + if (options.defaults) + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.count = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.count = options.longs === String ? "0" : 0; + var keys2; + if (message.properties && (keys2 = Object.keys(message.properties)).length) { + object.properties = {}; + for (var j = 0; j < keys2.length; ++j) + object.properties[keys2[j]] = $root.google.protobuf.Value.toObject(message.properties[keys2[j]], options); + } + if (message.count != null && message.hasOwnProperty("count")) + if (typeof message.count === "number") + object.count = options.longs === String ? String(message.count) : message.count; + else + object.count = options.longs === String ? $util.Long.prototype.toString.call(message.count) : options.longs === Number ? new $util.LongBits(message.count.low >>> 0, message.count.high >>> 0).toNumber() : message.count; + return object; + }; + + /** + * Converts this GroupResult to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.GroupResult * @instance * @returns {Object.} JSON object */ - UpdateFindingRequest.prototype.toJSON = function toJSON() { + GroupResult.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return UpdateFindingRequest; + return GroupResult; })(); - v1.UpdateOrganizationSettingsRequest = (function() { + v1.ListSourcesRequest = (function() { /** - * Properties of an UpdateOrganizationSettingsRequest. + * Properties of a ListSourcesRequest. * @memberof google.cloud.securitycenter.v1 - * @interface IUpdateOrganizationSettingsRequest - * @property {google.cloud.securitycenter.v1.IOrganizationSettings|null} [organizationSettings] UpdateOrganizationSettingsRequest organizationSettings - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateOrganizationSettingsRequest updateMask + * @interface IListSourcesRequest + * @property {string|null} [parent] ListSourcesRequest parent + * @property {string|null} [pageToken] ListSourcesRequest pageToken + * @property {number|null} [pageSize] ListSourcesRequest pageSize */ /** - * Constructs a new UpdateOrganizationSettingsRequest. + * Constructs a new ListSourcesRequest. * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents an UpdateOrganizationSettingsRequest. - * @implements IUpdateOrganizationSettingsRequest + * @classdesc Represents a ListSourcesRequest. + * @implements IListSourcesRequest * @constructor - * @param {google.cloud.securitycenter.v1.IUpdateOrganizationSettingsRequest=} [properties] Properties to set + * @param {google.cloud.securitycenter.v1.IListSourcesRequest=} [properties] Properties to set */ - function UpdateOrganizationSettingsRequest(properties) { + function ListSourcesRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -5941,88 +5622,101 @@ } /** - * UpdateOrganizationSettingsRequest organizationSettings. - * @member {google.cloud.securitycenter.v1.IOrganizationSettings|null|undefined} organizationSettings - * @memberof google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest + * ListSourcesRequest parent. + * @member {string} parent + * @memberof google.cloud.securitycenter.v1.ListSourcesRequest * @instance */ - UpdateOrganizationSettingsRequest.prototype.organizationSettings = null; + ListSourcesRequest.prototype.parent = ""; /** - * UpdateOrganizationSettingsRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest + * ListSourcesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.securitycenter.v1.ListSourcesRequest * @instance */ - UpdateOrganizationSettingsRequest.prototype.updateMask = null; + ListSourcesRequest.prototype.pageToken = ""; /** - * Creates a new UpdateOrganizationSettingsRequest instance using the specified properties. + * ListSourcesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.securitycenter.v1.ListSourcesRequest + * @instance + */ + ListSourcesRequest.prototype.pageSize = 0; + + /** + * Creates a new ListSourcesRequest instance using the specified properties. * @function create - * @memberof google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest + * @memberof google.cloud.securitycenter.v1.ListSourcesRequest * @static - * @param {google.cloud.securitycenter.v1.IUpdateOrganizationSettingsRequest=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest} UpdateOrganizationSettingsRequest instance + * @param {google.cloud.securitycenter.v1.IListSourcesRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.ListSourcesRequest} ListSourcesRequest instance */ - UpdateOrganizationSettingsRequest.create = function create(properties) { - return new UpdateOrganizationSettingsRequest(properties); + ListSourcesRequest.create = function create(properties) { + return new ListSourcesRequest(properties); }; /** - * Encodes the specified UpdateOrganizationSettingsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest.verify|verify} messages. + * Encodes the specified ListSourcesRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.ListSourcesRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest + * @memberof google.cloud.securitycenter.v1.ListSourcesRequest * @static - * @param {google.cloud.securitycenter.v1.IUpdateOrganizationSettingsRequest} message UpdateOrganizationSettingsRequest message or plain object to encode + * @param {google.cloud.securitycenter.v1.IListSourcesRequest} message ListSourcesRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateOrganizationSettingsRequest.encode = function encode(message, writer) { + ListSourcesRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.organizationSettings != null && message.hasOwnProperty("organizationSettings")) - $root.google.cloud.securitycenter.v1.OrganizationSettings.encode(message.organizationSettings, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.parent != null && message.hasOwnProperty("parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.pageToken); + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.pageSize); return writer; }; /** - * Encodes the specified UpdateOrganizationSettingsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest.verify|verify} messages. + * Encodes the specified ListSourcesRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListSourcesRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest + * @memberof google.cloud.securitycenter.v1.ListSourcesRequest * @static - * @param {google.cloud.securitycenter.v1.IUpdateOrganizationSettingsRequest} message UpdateOrganizationSettingsRequest message or plain object to encode + * @param {google.cloud.securitycenter.v1.IListSourcesRequest} message ListSourcesRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateOrganizationSettingsRequest.encodeDelimited = function encodeDelimited(message, writer) { + ListSourcesRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an UpdateOrganizationSettingsRequest message from the specified reader or buffer. + * Decodes a ListSourcesRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest + * @memberof google.cloud.securitycenter.v1.ListSourcesRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest} UpdateOrganizationSettingsRequest + * @returns {google.cloud.securitycenter.v1.ListSourcesRequest} ListSourcesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UpdateOrganizationSettingsRequest.decode = function decode(reader, length) { + ListSourcesRequest.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.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.ListSourcesRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.organizationSettings = $root.google.cloud.securitycenter.v1.OrganizationSettings.decode(reader, reader.uint32()); + message.parent = reader.string(); break; case 2: - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + message.pageToken = reader.string(); + break; + case 7: + message.pageSize = reader.int32(); break; default: reader.skipType(tag & 7); @@ -6033,127 +5727,126 @@ }; /** - * Decodes an UpdateOrganizationSettingsRequest message from the specified reader or buffer, length delimited. + * Decodes a ListSourcesRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest + * @memberof google.cloud.securitycenter.v1.ListSourcesRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest} UpdateOrganizationSettingsRequest + * @returns {google.cloud.securitycenter.v1.ListSourcesRequest} ListSourcesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UpdateOrganizationSettingsRequest.decodeDelimited = function decodeDelimited(reader) { + ListSourcesRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an UpdateOrganizationSettingsRequest message. + * Verifies a ListSourcesRequest message. * @function verify - * @memberof google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest + * @memberof google.cloud.securitycenter.v1.ListSourcesRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - UpdateOrganizationSettingsRequest.verify = function verify(message) { + ListSourcesRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.organizationSettings != null && message.hasOwnProperty("organizationSettings")) { - var error = $root.google.cloud.securitycenter.v1.OrganizationSettings.verify(message.organizationSettings); - if (error) - return "organizationSettings." + error; - } - if (message.updateMask != null && message.hasOwnProperty("updateMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.updateMask); - if (error) - return "updateMask." + error; - } + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; return null; }; /** - * Creates an UpdateOrganizationSettingsRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ListSourcesRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest + * @memberof google.cloud.securitycenter.v1.ListSourcesRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest} UpdateOrganizationSettingsRequest + * @returns {google.cloud.securitycenter.v1.ListSourcesRequest} ListSourcesRequest */ - UpdateOrganizationSettingsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest) + ListSourcesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.ListSourcesRequest) return object; - var message = new $root.google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest(); - if (object.organizationSettings != null) { - if (typeof object.organizationSettings !== "object") - throw TypeError(".google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest.organizationSettings: object expected"); - message.organizationSettings = $root.google.cloud.securitycenter.v1.OrganizationSettings.fromObject(object.organizationSettings); - } - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); - } + var message = new $root.google.cloud.securitycenter.v1.ListSourcesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; return message; }; /** - * Creates a plain object from an UpdateOrganizationSettingsRequest message. Also converts values to other types if specified. + * Creates a plain object from a ListSourcesRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest + * @memberof google.cloud.securitycenter.v1.ListSourcesRequest * @static - * @param {google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest} message UpdateOrganizationSettingsRequest + * @param {google.cloud.securitycenter.v1.ListSourcesRequest} message ListSourcesRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - UpdateOrganizationSettingsRequest.toObject = function toObject(message, options) { + ListSourcesRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.organizationSettings = null; - object.updateMask = null; + object.parent = ""; + object.pageToken = ""; + object.pageSize = 0; } - if (message.organizationSettings != null && message.hasOwnProperty("organizationSettings")) - object.organizationSettings = $root.google.cloud.securitycenter.v1.OrganizationSettings.toObject(message.organizationSettings, options); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; return object; }; /** - * Converts this UpdateOrganizationSettingsRequest to JSON. + * Converts this ListSourcesRequest to JSON. * @function toJSON - * @memberof google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest + * @memberof google.cloud.securitycenter.v1.ListSourcesRequest * @instance * @returns {Object.} JSON object */ - UpdateOrganizationSettingsRequest.prototype.toJSON = function toJSON() { + ListSourcesRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return UpdateOrganizationSettingsRequest; + return ListSourcesRequest; })(); - v1.UpdateSourceRequest = (function() { + v1.ListSourcesResponse = (function() { /** - * Properties of an UpdateSourceRequest. + * Properties of a ListSourcesResponse. * @memberof google.cloud.securitycenter.v1 - * @interface IUpdateSourceRequest - * @property {google.cloud.securitycenter.v1.ISource|null} [source] UpdateSourceRequest source - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateSourceRequest updateMask + * @interface IListSourcesResponse + * @property {Array.|null} [sources] ListSourcesResponse sources + * @property {string|null} [nextPageToken] ListSourcesResponse nextPageToken */ /** - * Constructs a new UpdateSourceRequest. + * Constructs a new ListSourcesResponse. * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents an UpdateSourceRequest. - * @implements IUpdateSourceRequest + * @classdesc Represents a ListSourcesResponse. + * @implements IListSourcesResponse * @constructor - * @param {google.cloud.securitycenter.v1.IUpdateSourceRequest=} [properties] Properties to set + * @param {google.cloud.securitycenter.v1.IListSourcesResponse=} [properties] Properties to set */ - function UpdateSourceRequest(properties) { + function ListSourcesResponse(properties) { + this.sources = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -6161,88 +5854,91 @@ } /** - * UpdateSourceRequest source. - * @member {google.cloud.securitycenter.v1.ISource|null|undefined} source - * @memberof google.cloud.securitycenter.v1.UpdateSourceRequest + * ListSourcesResponse sources. + * @member {Array.} sources + * @memberof google.cloud.securitycenter.v1.ListSourcesResponse * @instance */ - UpdateSourceRequest.prototype.source = null; + ListSourcesResponse.prototype.sources = $util.emptyArray; /** - * UpdateSourceRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.cloud.securitycenter.v1.UpdateSourceRequest - * @instance - */ - UpdateSourceRequest.prototype.updateMask = null; + * ListSourcesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.securitycenter.v1.ListSourcesResponse + * @instance + */ + ListSourcesResponse.prototype.nextPageToken = ""; /** - * Creates a new UpdateSourceRequest instance using the specified properties. + * Creates a new ListSourcesResponse instance using the specified properties. * @function create - * @memberof google.cloud.securitycenter.v1.UpdateSourceRequest + * @memberof google.cloud.securitycenter.v1.ListSourcesResponse * @static - * @param {google.cloud.securitycenter.v1.IUpdateSourceRequest=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.UpdateSourceRequest} UpdateSourceRequest instance + * @param {google.cloud.securitycenter.v1.IListSourcesResponse=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.ListSourcesResponse} ListSourcesResponse instance */ - UpdateSourceRequest.create = function create(properties) { - return new UpdateSourceRequest(properties); + ListSourcesResponse.create = function create(properties) { + return new ListSourcesResponse(properties); }; /** - * Encodes the specified UpdateSourceRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.UpdateSourceRequest.verify|verify} messages. + * Encodes the specified ListSourcesResponse message. Does not implicitly {@link google.cloud.securitycenter.v1.ListSourcesResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.securitycenter.v1.UpdateSourceRequest + * @memberof google.cloud.securitycenter.v1.ListSourcesResponse * @static - * @param {google.cloud.securitycenter.v1.IUpdateSourceRequest} message UpdateSourceRequest message or plain object to encode + * @param {google.cloud.securitycenter.v1.IListSourcesResponse} message ListSourcesResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateSourceRequest.encode = function encode(message, writer) { + ListSourcesResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.source != null && message.hasOwnProperty("source")) - $root.google.cloud.securitycenter.v1.Source.encode(message.source, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.sources != null && message.sources.length) + for (var i = 0; i < message.sources.length; ++i) + $root.google.cloud.securitycenter.v1.Source.encode(message.sources[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); return writer; }; /** - * Encodes the specified UpdateSourceRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.UpdateSourceRequest.verify|verify} messages. + * Encodes the specified ListSourcesResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListSourcesResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.UpdateSourceRequest + * @memberof google.cloud.securitycenter.v1.ListSourcesResponse * @static - * @param {google.cloud.securitycenter.v1.IUpdateSourceRequest} message UpdateSourceRequest message or plain object to encode + * @param {google.cloud.securitycenter.v1.IListSourcesResponse} message ListSourcesResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateSourceRequest.encodeDelimited = function encodeDelimited(message, writer) { + ListSourcesResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an UpdateSourceRequest message from the specified reader or buffer. + * Decodes a ListSourcesResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.securitycenter.v1.UpdateSourceRequest + * @memberof google.cloud.securitycenter.v1.ListSourcesResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.UpdateSourceRequest} UpdateSourceRequest + * @returns {google.cloud.securitycenter.v1.ListSourcesResponse} ListSourcesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UpdateSourceRequest.decode = function decode(reader, length) { + ListSourcesResponse.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.cloud.securitycenter.v1.UpdateSourceRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.ListSourcesResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.source = $root.google.cloud.securitycenter.v1.Source.decode(reader, reader.uint32()); + if (!(message.sources && message.sources.length)) + message.sources = []; + message.sources.push($root.google.cloud.securitycenter.v1.Source.decode(reader, reader.uint32())); break; case 2: - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + message.nextPageToken = reader.string(); break; default: reader.skipType(tag & 7); @@ -6253,128 +5949,140 @@ }; /** - * Decodes an UpdateSourceRequest message from the specified reader or buffer, length delimited. + * Decodes a ListSourcesResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.UpdateSourceRequest + * @memberof google.cloud.securitycenter.v1.ListSourcesResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.UpdateSourceRequest} UpdateSourceRequest + * @returns {google.cloud.securitycenter.v1.ListSourcesResponse} ListSourcesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UpdateSourceRequest.decodeDelimited = function decodeDelimited(reader) { + ListSourcesResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an UpdateSourceRequest message. + * Verifies a ListSourcesResponse message. * @function verify - * @memberof google.cloud.securitycenter.v1.UpdateSourceRequest + * @memberof google.cloud.securitycenter.v1.ListSourcesResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - UpdateSourceRequest.verify = function verify(message) { + ListSourcesResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.source != null && message.hasOwnProperty("source")) { - var error = $root.google.cloud.securitycenter.v1.Source.verify(message.source); - if (error) - return "source." + error; - } - if (message.updateMask != null && message.hasOwnProperty("updateMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.updateMask); - if (error) - return "updateMask." + error; + if (message.sources != null && message.hasOwnProperty("sources")) { + if (!Array.isArray(message.sources)) + return "sources: array expected"; + for (var i = 0; i < message.sources.length; ++i) { + var error = $root.google.cloud.securitycenter.v1.Source.verify(message.sources[i]); + if (error) + return "sources." + error; + } } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; return null; }; /** - * Creates an UpdateSourceRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ListSourcesResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.securitycenter.v1.UpdateSourceRequest + * @memberof google.cloud.securitycenter.v1.ListSourcesResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.UpdateSourceRequest} UpdateSourceRequest + * @returns {google.cloud.securitycenter.v1.ListSourcesResponse} ListSourcesResponse */ - UpdateSourceRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.UpdateSourceRequest) + ListSourcesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.ListSourcesResponse) return object; - var message = new $root.google.cloud.securitycenter.v1.UpdateSourceRequest(); - if (object.source != null) { - if (typeof object.source !== "object") - throw TypeError(".google.cloud.securitycenter.v1.UpdateSourceRequest.source: object expected"); - message.source = $root.google.cloud.securitycenter.v1.Source.fromObject(object.source); - } - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.cloud.securitycenter.v1.UpdateSourceRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + var message = new $root.google.cloud.securitycenter.v1.ListSourcesResponse(); + if (object.sources) { + if (!Array.isArray(object.sources)) + throw TypeError(".google.cloud.securitycenter.v1.ListSourcesResponse.sources: array expected"); + message.sources = []; + for (var i = 0; i < object.sources.length; ++i) { + if (typeof object.sources[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v1.ListSourcesResponse.sources: object expected"); + message.sources[i] = $root.google.cloud.securitycenter.v1.Source.fromObject(object.sources[i]); + } } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); return message; }; /** - * Creates a plain object from an UpdateSourceRequest message. Also converts values to other types if specified. + * Creates a plain object from a ListSourcesResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.securitycenter.v1.UpdateSourceRequest + * @memberof google.cloud.securitycenter.v1.ListSourcesResponse * @static - * @param {google.cloud.securitycenter.v1.UpdateSourceRequest} message UpdateSourceRequest + * @param {google.cloud.securitycenter.v1.ListSourcesResponse} message ListSourcesResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - UpdateSourceRequest.toObject = function toObject(message, options) { + ListSourcesResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.source = null; - object.updateMask = null; + if (options.arrays || options.defaults) + object.sources = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.sources && message.sources.length) { + object.sources = []; + for (var j = 0; j < message.sources.length; ++j) + object.sources[j] = $root.google.cloud.securitycenter.v1.Source.toObject(message.sources[j], options); } - if (message.source != null && message.hasOwnProperty("source")) - object.source = $root.google.cloud.securitycenter.v1.Source.toObject(message.source, options); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; return object; }; /** - * Converts this UpdateSourceRequest to JSON. + * Converts this ListSourcesResponse to JSON. * @function toJSON - * @memberof google.cloud.securitycenter.v1.UpdateSourceRequest + * @memberof google.cloud.securitycenter.v1.ListSourcesResponse * @instance * @returns {Object.} JSON object */ - UpdateSourceRequest.prototype.toJSON = function toJSON() { + ListSourcesResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return UpdateSourceRequest; + return ListSourcesResponse; })(); - v1.UpdateSecurityMarksRequest = (function() { + v1.ListAssetsRequest = (function() { /** - * Properties of an UpdateSecurityMarksRequest. + * Properties of a ListAssetsRequest. * @memberof google.cloud.securitycenter.v1 - * @interface IUpdateSecurityMarksRequest - * @property {google.cloud.securitycenter.v1.ISecurityMarks|null} [securityMarks] UpdateSecurityMarksRequest securityMarks - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateSecurityMarksRequest updateMask - * @property {google.protobuf.ITimestamp|null} [startTime] UpdateSecurityMarksRequest startTime + * @interface IListAssetsRequest + * @property {string|null} [parent] ListAssetsRequest parent + * @property {string|null} [filter] ListAssetsRequest filter + * @property {string|null} [orderBy] ListAssetsRequest orderBy + * @property {google.protobuf.ITimestamp|null} [readTime] ListAssetsRequest readTime + * @property {google.protobuf.IDuration|null} [compareDuration] ListAssetsRequest compareDuration + * @property {google.protobuf.IFieldMask|null} [fieldMask] ListAssetsRequest fieldMask + * @property {string|null} [pageToken] ListAssetsRequest pageToken + * @property {number|null} [pageSize] ListAssetsRequest pageSize */ /** - * Constructs a new UpdateSecurityMarksRequest. + * Constructs a new ListAssetsRequest. * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents an UpdateSecurityMarksRequest. - * @implements IUpdateSecurityMarksRequest + * @classdesc Represents a ListAssetsRequest. + * @implements IListAssetsRequest * @constructor - * @param {google.cloud.securitycenter.v1.IUpdateSecurityMarksRequest=} [properties] Properties to set + * @param {google.cloud.securitycenter.v1.IListAssetsRequest=} [properties] Properties to set */ - function UpdateSecurityMarksRequest(properties) { + function ListAssetsRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -6382,101 +6090,166 @@ } /** - * UpdateSecurityMarksRequest securityMarks. - * @member {google.cloud.securitycenter.v1.ISecurityMarks|null|undefined} securityMarks - * @memberof google.cloud.securitycenter.v1.UpdateSecurityMarksRequest + * ListAssetsRequest parent. + * @member {string} parent + * @memberof google.cloud.securitycenter.v1.ListAssetsRequest * @instance */ - UpdateSecurityMarksRequest.prototype.securityMarks = null; + ListAssetsRequest.prototype.parent = ""; /** - * UpdateSecurityMarksRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.cloud.securitycenter.v1.UpdateSecurityMarksRequest + * ListAssetsRequest filter. + * @member {string} filter + * @memberof google.cloud.securitycenter.v1.ListAssetsRequest * @instance */ - UpdateSecurityMarksRequest.prototype.updateMask = null; + ListAssetsRequest.prototype.filter = ""; /** - * UpdateSecurityMarksRequest startTime. - * @member {google.protobuf.ITimestamp|null|undefined} startTime - * @memberof google.cloud.securitycenter.v1.UpdateSecurityMarksRequest + * ListAssetsRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.securitycenter.v1.ListAssetsRequest * @instance */ - UpdateSecurityMarksRequest.prototype.startTime = null; + ListAssetsRequest.prototype.orderBy = ""; /** - * Creates a new UpdateSecurityMarksRequest instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v1.UpdateSecurityMarksRequest - * @static - * @param {google.cloud.securitycenter.v1.IUpdateSecurityMarksRequest=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.UpdateSecurityMarksRequest} UpdateSecurityMarksRequest instance + * ListAssetsRequest readTime. + * @member {google.protobuf.ITimestamp|null|undefined} readTime + * @memberof google.cloud.securitycenter.v1.ListAssetsRequest + * @instance */ - UpdateSecurityMarksRequest.create = function create(properties) { - return new UpdateSecurityMarksRequest(properties); - }; + ListAssetsRequest.prototype.readTime = null; /** - * Encodes the specified UpdateSecurityMarksRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.UpdateSecurityMarksRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1.UpdateSecurityMarksRequest - * @static - * @param {google.cloud.securitycenter.v1.IUpdateSecurityMarksRequest} message UpdateSecurityMarksRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * ListAssetsRequest compareDuration. + * @member {google.protobuf.IDuration|null|undefined} compareDuration + * @memberof google.cloud.securitycenter.v1.ListAssetsRequest + * @instance */ - UpdateSecurityMarksRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.securityMarks != null && message.hasOwnProperty("securityMarks")) - $root.google.cloud.securitycenter.v1.SecurityMarks.encode(message.securityMarks, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.startTime != null && message.hasOwnProperty("startTime")) - $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; + ListAssetsRequest.prototype.compareDuration = null; /** - * Encodes the specified UpdateSecurityMarksRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.UpdateSecurityMarksRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.UpdateSecurityMarksRequest - * @static - * @param {google.cloud.securitycenter.v1.IUpdateSecurityMarksRequest} message UpdateSecurityMarksRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateSecurityMarksRequest.encodeDelimited = function encodeDelimited(message, writer) { + * ListAssetsRequest fieldMask. + * @member {google.protobuf.IFieldMask|null|undefined} fieldMask + * @memberof google.cloud.securitycenter.v1.ListAssetsRequest + * @instance + */ + ListAssetsRequest.prototype.fieldMask = null; + + /** + * ListAssetsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.securitycenter.v1.ListAssetsRequest + * @instance + */ + ListAssetsRequest.prototype.pageToken = ""; + + /** + * ListAssetsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.securitycenter.v1.ListAssetsRequest + * @instance + */ + ListAssetsRequest.prototype.pageSize = 0; + + /** + * Creates a new ListAssetsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.ListAssetsRequest + * @static + * @param {google.cloud.securitycenter.v1.IListAssetsRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.ListAssetsRequest} ListAssetsRequest instance + */ + ListAssetsRequest.create = function create(properties) { + return new ListAssetsRequest(properties); + }; + + /** + * Encodes the specified ListAssetsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.ListAssetsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.ListAssetsRequest + * @static + * @param {google.cloud.securitycenter.v1.IListAssetsRequest} message ListAssetsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAssetsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && message.hasOwnProperty("parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.filter != null && message.hasOwnProperty("filter")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.orderBy); + if (message.readTime != null && message.hasOwnProperty("readTime")) + $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.compareDuration != null && message.hasOwnProperty("compareDuration")) + $root.google.protobuf.Duration.encode(message.compareDuration, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.fieldMask != null && message.hasOwnProperty("fieldMask")) + $root.google.protobuf.FieldMask.encode(message.fieldMask, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.pageToken); + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.pageSize); + return writer; + }; + + /** + * Encodes the specified ListAssetsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListAssetsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.ListAssetsRequest + * @static + * @param {google.cloud.securitycenter.v1.IListAssetsRequest} message ListAssetsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAssetsRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an UpdateSecurityMarksRequest message from the specified reader or buffer. + * Decodes a ListAssetsRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.securitycenter.v1.UpdateSecurityMarksRequest + * @memberof google.cloud.securitycenter.v1.ListAssetsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.UpdateSecurityMarksRequest} UpdateSecurityMarksRequest + * @returns {google.cloud.securitycenter.v1.ListAssetsRequest} ListAssetsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UpdateSecurityMarksRequest.decode = function decode(reader, length) { + ListAssetsRequest.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.cloud.securitycenter.v1.UpdateSecurityMarksRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.ListAssetsRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.securityMarks = $root.google.cloud.securitycenter.v1.SecurityMarks.decode(reader, reader.uint32()); + message.parent = reader.string(); break; case 2: - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + message.filter = reader.string(); break; case 3: - message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + message.orderBy = reader.string(); + break; + case 4: + message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 5: + message.compareDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + case 7: + message.fieldMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + case 8: + message.pageToken = reader.string(); + break; + case 9: + message.pageSize = reader.int32(); break; default: reader.skipType(tag & 7); @@ -6487,146 +6260,183 @@ }; /** - * Decodes an UpdateSecurityMarksRequest message from the specified reader or buffer, length delimited. + * Decodes a ListAssetsRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.UpdateSecurityMarksRequest + * @memberof google.cloud.securitycenter.v1.ListAssetsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.UpdateSecurityMarksRequest} UpdateSecurityMarksRequest + * @returns {google.cloud.securitycenter.v1.ListAssetsRequest} ListAssetsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UpdateSecurityMarksRequest.decodeDelimited = function decodeDelimited(reader) { + ListAssetsRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an UpdateSecurityMarksRequest message. + * Verifies a ListAssetsRequest message. * @function verify - * @memberof google.cloud.securitycenter.v1.UpdateSecurityMarksRequest + * @memberof google.cloud.securitycenter.v1.ListAssetsRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - UpdateSecurityMarksRequest.verify = function verify(message) { + ListAssetsRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.securityMarks != null && message.hasOwnProperty("securityMarks")) { - var error = $root.google.cloud.securitycenter.v1.SecurityMarks.verify(message.securityMarks); + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + if (message.readTime != null && message.hasOwnProperty("readTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.readTime); if (error) - return "securityMarks." + error; + return "readTime." + error; } - if (message.updateMask != null && message.hasOwnProperty("updateMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (message.compareDuration != null && message.hasOwnProperty("compareDuration")) { + var error = $root.google.protobuf.Duration.verify(message.compareDuration); if (error) - return "updateMask." + error; + return "compareDuration." + error; } - if (message.startTime != null && message.hasOwnProperty("startTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.startTime); + if (message.fieldMask != null && message.hasOwnProperty("fieldMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.fieldMask); if (error) - return "startTime." + error; + return "fieldMask." + error; } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; return null; }; /** - * Creates an UpdateSecurityMarksRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ListAssetsRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.securitycenter.v1.UpdateSecurityMarksRequest + * @memberof google.cloud.securitycenter.v1.ListAssetsRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.UpdateSecurityMarksRequest} UpdateSecurityMarksRequest + * @returns {google.cloud.securitycenter.v1.ListAssetsRequest} ListAssetsRequest */ - UpdateSecurityMarksRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.UpdateSecurityMarksRequest) + ListAssetsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.ListAssetsRequest) return object; - var message = new $root.google.cloud.securitycenter.v1.UpdateSecurityMarksRequest(); - if (object.securityMarks != null) { - if (typeof object.securityMarks !== "object") - throw TypeError(".google.cloud.securitycenter.v1.UpdateSecurityMarksRequest.securityMarks: object expected"); - message.securityMarks = $root.google.cloud.securitycenter.v1.SecurityMarks.fromObject(object.securityMarks); + var message = new $root.google.cloud.securitycenter.v1.ListAssetsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.filter != null) + message.filter = String(object.filter); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.readTime != null) { + if (typeof object.readTime !== "object") + throw TypeError(".google.cloud.securitycenter.v1.ListAssetsRequest.readTime: object expected"); + message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); } - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.cloud.securitycenter.v1.UpdateSecurityMarksRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + if (object.compareDuration != null) { + if (typeof object.compareDuration !== "object") + throw TypeError(".google.cloud.securitycenter.v1.ListAssetsRequest.compareDuration: object expected"); + message.compareDuration = $root.google.protobuf.Duration.fromObject(object.compareDuration); } - if (object.startTime != null) { - if (typeof object.startTime !== "object") - throw TypeError(".google.cloud.securitycenter.v1.UpdateSecurityMarksRequest.startTime: object expected"); - message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); + if (object.fieldMask != null) { + if (typeof object.fieldMask !== "object") + throw TypeError(".google.cloud.securitycenter.v1.ListAssetsRequest.fieldMask: object expected"); + message.fieldMask = $root.google.protobuf.FieldMask.fromObject(object.fieldMask); } + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; return message; }; /** - * Creates a plain object from an UpdateSecurityMarksRequest message. Also converts values to other types if specified. + * Creates a plain object from a ListAssetsRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.securitycenter.v1.UpdateSecurityMarksRequest + * @memberof google.cloud.securitycenter.v1.ListAssetsRequest * @static - * @param {google.cloud.securitycenter.v1.UpdateSecurityMarksRequest} message UpdateSecurityMarksRequest + * @param {google.cloud.securitycenter.v1.ListAssetsRequest} message ListAssetsRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - UpdateSecurityMarksRequest.toObject = function toObject(message, options) { + ListAssetsRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.securityMarks = null; - object.updateMask = null; - object.startTime = null; + object.parent = ""; + object.filter = ""; + object.orderBy = ""; + object.readTime = null; + object.compareDuration = null; + object.fieldMask = null; + object.pageToken = ""; + object.pageSize = 0; } - if (message.securityMarks != null && message.hasOwnProperty("securityMarks")) - object.securityMarks = $root.google.cloud.securitycenter.v1.SecurityMarks.toObject(message.securityMarks, options); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); - if (message.startTime != null && message.hasOwnProperty("startTime")) - object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; + if (message.readTime != null && message.hasOwnProperty("readTime")) + object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); + if (message.compareDuration != null && message.hasOwnProperty("compareDuration")) + object.compareDuration = $root.google.protobuf.Duration.toObject(message.compareDuration, options); + if (message.fieldMask != null && message.hasOwnProperty("fieldMask")) + object.fieldMask = $root.google.protobuf.FieldMask.toObject(message.fieldMask, options); + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; return object; }; /** - * Converts this UpdateSecurityMarksRequest to JSON. + * Converts this ListAssetsRequest to JSON. * @function toJSON - * @memberof google.cloud.securitycenter.v1.UpdateSecurityMarksRequest + * @memberof google.cloud.securitycenter.v1.ListAssetsRequest * @instance * @returns {Object.} JSON object */ - UpdateSecurityMarksRequest.prototype.toJSON = function toJSON() { + ListAssetsRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return UpdateSecurityMarksRequest; + return ListAssetsRequest; })(); - v1.Asset = (function() { + v1.ListAssetsResponse = (function() { /** - * Properties of an Asset. + * Properties of a ListAssetsResponse. * @memberof google.cloud.securitycenter.v1 - * @interface IAsset - * @property {string|null} [name] Asset name - * @property {google.cloud.securitycenter.v1.Asset.ISecurityCenterProperties|null} [securityCenterProperties] Asset securityCenterProperties - * @property {Object.|null} [resourceProperties] Asset resourceProperties - * @property {google.cloud.securitycenter.v1.ISecurityMarks|null} [securityMarks] Asset securityMarks - * @property {google.protobuf.ITimestamp|null} [createTime] Asset createTime - * @property {google.protobuf.ITimestamp|null} [updateTime] Asset updateTime - * @property {google.cloud.securitycenter.v1.Asset.IIamPolicy|null} [iamPolicy] Asset iamPolicy + * @interface IListAssetsResponse + * @property {Array.|null} [listAssetsResults] ListAssetsResponse listAssetsResults + * @property {google.protobuf.ITimestamp|null} [readTime] ListAssetsResponse readTime + * @property {string|null} [nextPageToken] ListAssetsResponse nextPageToken + * @property {number|null} [totalSize] ListAssetsResponse totalSize */ /** - * Constructs a new Asset. + * Constructs a new ListAssetsResponse. * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents an Asset. - * @implements IAsset + * @classdesc Represents a ListAssetsResponse. + * @implements IListAssetsResponse * @constructor - * @param {google.cloud.securitycenter.v1.IAsset=} [properties] Properties to set + * @param {google.cloud.securitycenter.v1.IListAssetsResponse=} [properties] Properties to set */ - function Asset(properties) { - this.resourceProperties = {}; + function ListAssetsResponse(properties) { + this.listAssetsResults = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -6634,161 +6444,117 @@ } /** - * Asset name. - * @member {string} name - * @memberof google.cloud.securitycenter.v1.Asset - * @instance - */ - Asset.prototype.name = ""; - - /** - * Asset securityCenterProperties. - * @member {google.cloud.securitycenter.v1.Asset.ISecurityCenterProperties|null|undefined} securityCenterProperties - * @memberof google.cloud.securitycenter.v1.Asset - * @instance - */ - Asset.prototype.securityCenterProperties = null; - - /** - * Asset resourceProperties. - * @member {Object.} resourceProperties - * @memberof google.cloud.securitycenter.v1.Asset - * @instance - */ - Asset.prototype.resourceProperties = $util.emptyObject; - - /** - * Asset securityMarks. - * @member {google.cloud.securitycenter.v1.ISecurityMarks|null|undefined} securityMarks - * @memberof google.cloud.securitycenter.v1.Asset + * ListAssetsResponse listAssetsResults. + * @member {Array.} listAssetsResults + * @memberof google.cloud.securitycenter.v1.ListAssetsResponse * @instance */ - Asset.prototype.securityMarks = null; + ListAssetsResponse.prototype.listAssetsResults = $util.emptyArray; /** - * Asset createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.securitycenter.v1.Asset + * ListAssetsResponse readTime. + * @member {google.protobuf.ITimestamp|null|undefined} readTime + * @memberof google.cloud.securitycenter.v1.ListAssetsResponse * @instance */ - Asset.prototype.createTime = null; + ListAssetsResponse.prototype.readTime = null; /** - * Asset updateTime. - * @member {google.protobuf.ITimestamp|null|undefined} updateTime - * @memberof google.cloud.securitycenter.v1.Asset + * ListAssetsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.securitycenter.v1.ListAssetsResponse * @instance */ - Asset.prototype.updateTime = null; + ListAssetsResponse.prototype.nextPageToken = ""; /** - * Asset iamPolicy. - * @member {google.cloud.securitycenter.v1.Asset.IIamPolicy|null|undefined} iamPolicy - * @memberof google.cloud.securitycenter.v1.Asset + * ListAssetsResponse totalSize. + * @member {number} totalSize + * @memberof google.cloud.securitycenter.v1.ListAssetsResponse * @instance */ - Asset.prototype.iamPolicy = null; + ListAssetsResponse.prototype.totalSize = 0; /** - * Creates a new Asset instance using the specified properties. + * Creates a new ListAssetsResponse instance using the specified properties. * @function create - * @memberof google.cloud.securitycenter.v1.Asset + * @memberof google.cloud.securitycenter.v1.ListAssetsResponse * @static - * @param {google.cloud.securitycenter.v1.IAsset=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.Asset} Asset instance + * @param {google.cloud.securitycenter.v1.IListAssetsResponse=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.ListAssetsResponse} ListAssetsResponse instance */ - Asset.create = function create(properties) { - return new Asset(properties); + ListAssetsResponse.create = function create(properties) { + return new ListAssetsResponse(properties); }; /** - * Encodes the specified Asset message. Does not implicitly {@link google.cloud.securitycenter.v1.Asset.verify|verify} messages. + * Encodes the specified ListAssetsResponse message. Does not implicitly {@link google.cloud.securitycenter.v1.ListAssetsResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.securitycenter.v1.Asset + * @memberof google.cloud.securitycenter.v1.ListAssetsResponse * @static - * @param {google.cloud.securitycenter.v1.IAsset} message Asset message or plain object to encode + * @param {google.cloud.securitycenter.v1.IListAssetsResponse} message ListAssetsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Asset.encode = function encode(message, writer) { + ListAssetsResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.securityCenterProperties != null && message.hasOwnProperty("securityCenterProperties")) - $root.google.cloud.securitycenter.v1.Asset.SecurityCenterProperties.encode(message.securityCenterProperties, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.resourceProperties != null && message.hasOwnProperty("resourceProperties")) - for (var keys = Object.keys(message.resourceProperties), i = 0; i < keys.length; ++i) { - writer.uint32(/* id 7, wireType 2 =*/58).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); - $root.google.protobuf.Value.encode(message.resourceProperties[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); - } - if (message.securityMarks != null && message.hasOwnProperty("securityMarks")) - $root.google.cloud.securitycenter.v1.SecurityMarks.encode(message.securityMarks, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.createTime != null && message.hasOwnProperty("createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.updateTime != null && message.hasOwnProperty("updateTime")) - $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); - if (message.iamPolicy != null && message.hasOwnProperty("iamPolicy")) - $root.google.cloud.securitycenter.v1.Asset.IamPolicy.encode(message.iamPolicy, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.listAssetsResults != null && message.listAssetsResults.length) + for (var i = 0; i < message.listAssetsResults.length; ++i) + $root.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult.encode(message.listAssetsResults[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.readTime != null && message.hasOwnProperty("readTime")) + $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.nextPageToken); + if (message.totalSize != null && message.hasOwnProperty("totalSize")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.totalSize); return writer; }; /** - * Encodes the specified Asset message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Asset.verify|verify} messages. + * Encodes the specified ListAssetsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListAssetsResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.Asset + * @memberof google.cloud.securitycenter.v1.ListAssetsResponse * @static - * @param {google.cloud.securitycenter.v1.IAsset} message Asset message or plain object to encode + * @param {google.cloud.securitycenter.v1.IListAssetsResponse} message ListAssetsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Asset.encodeDelimited = function encodeDelimited(message, writer) { + ListAssetsResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an Asset message from the specified reader or buffer. + * Decodes a ListAssetsResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.securitycenter.v1.Asset + * @memberof google.cloud.securitycenter.v1.ListAssetsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.Asset} Asset + * @returns {google.cloud.securitycenter.v1.ListAssetsResponse} ListAssetsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Asset.decode = function decode(reader, length) { + ListAssetsResponse.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.cloud.securitycenter.v1.Asset(), key; + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.ListAssetsResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.name = reader.string(); + if (!(message.listAssetsResults && message.listAssetsResults.length)) + message.listAssetsResults = []; + message.listAssetsResults.push($root.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult.decode(reader, reader.uint32())); break; case 2: - message.securityCenterProperties = $root.google.cloud.securitycenter.v1.Asset.SecurityCenterProperties.decode(reader, reader.uint32()); - break; - case 7: - reader.skip().pos++; - if (message.resourceProperties === $util.emptyObject) - message.resourceProperties = {}; - key = reader.string(); - reader.pos++; - message.resourceProperties[key] = $root.google.protobuf.Value.decode(reader, reader.uint32()); - break; - case 8: - message.securityMarks = $root.google.cloud.securitycenter.v1.SecurityMarks.decode(reader, reader.uint32()); - break; - case 9: - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; - case 10: - message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + case 3: + message.nextPageToken = reader.string(); break; - case 11: - message.iamPolicy = $root.google.cloud.securitycenter.v1.Asset.IamPolicy.decode(reader, reader.uint32()); + case 4: + message.totalSize = reader.int32(); break; default: reader.skipType(tag & 7); @@ -6799,203 +6565,153 @@ }; /** - * Decodes an Asset message from the specified reader or buffer, length delimited. + * Decodes a ListAssetsResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.Asset + * @memberof google.cloud.securitycenter.v1.ListAssetsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.Asset} Asset + * @returns {google.cloud.securitycenter.v1.ListAssetsResponse} ListAssetsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Asset.decodeDelimited = function decodeDelimited(reader) { + ListAssetsResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an Asset message. + * Verifies a ListAssetsResponse message. * @function verify - * @memberof google.cloud.securitycenter.v1.Asset + * @memberof google.cloud.securitycenter.v1.ListAssetsResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Asset.verify = function verify(message) { + ListAssetsResponse.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.securityCenterProperties != null && message.hasOwnProperty("securityCenterProperties")) { - var error = $root.google.cloud.securitycenter.v1.Asset.SecurityCenterProperties.verify(message.securityCenterProperties); - if (error) - return "securityCenterProperties." + error; - } - if (message.resourceProperties != null && message.hasOwnProperty("resourceProperties")) { - if (!$util.isObject(message.resourceProperties)) - return "resourceProperties: object expected"; - var key = Object.keys(message.resourceProperties); - for (var i = 0; i < key.length; ++i) { - var error = $root.google.protobuf.Value.verify(message.resourceProperties[key[i]]); + if (message.listAssetsResults != null && message.hasOwnProperty("listAssetsResults")) { + if (!Array.isArray(message.listAssetsResults)) + return "listAssetsResults: array expected"; + for (var i = 0; i < message.listAssetsResults.length; ++i) { + var error = $root.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult.verify(message.listAssetsResults[i]); if (error) - return "resourceProperties." + error; + return "listAssetsResults." + error; } } - if (message.securityMarks != null && message.hasOwnProperty("securityMarks")) { - var error = $root.google.cloud.securitycenter.v1.SecurityMarks.verify(message.securityMarks); - if (error) - return "securityMarks." + error; - } - if (message.createTime != null && message.hasOwnProperty("createTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.createTime); - if (error) - return "createTime." + error; - } - if (message.updateTime != null && message.hasOwnProperty("updateTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.updateTime); - if (error) - return "updateTime." + error; - } - if (message.iamPolicy != null && message.hasOwnProperty("iamPolicy")) { - var error = $root.google.cloud.securitycenter.v1.Asset.IamPolicy.verify(message.iamPolicy); + if (message.readTime != null && message.hasOwnProperty("readTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.readTime); if (error) - return "iamPolicy." + error; + return "readTime." + error; } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.totalSize != null && message.hasOwnProperty("totalSize")) + if (!$util.isInteger(message.totalSize)) + return "totalSize: integer expected"; return null; }; /** - * Creates an Asset message from a plain object. Also converts values to their respective internal types. + * Creates a ListAssetsResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.securitycenter.v1.Asset + * @memberof google.cloud.securitycenter.v1.ListAssetsResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.Asset} Asset + * @returns {google.cloud.securitycenter.v1.ListAssetsResponse} ListAssetsResponse */ - Asset.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.Asset) + ListAssetsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.ListAssetsResponse) return object; - var message = new $root.google.cloud.securitycenter.v1.Asset(); - if (object.name != null) - message.name = String(object.name); - if (object.securityCenterProperties != null) { - if (typeof object.securityCenterProperties !== "object") - throw TypeError(".google.cloud.securitycenter.v1.Asset.securityCenterProperties: object expected"); - message.securityCenterProperties = $root.google.cloud.securitycenter.v1.Asset.SecurityCenterProperties.fromObject(object.securityCenterProperties); - } - if (object.resourceProperties) { - if (typeof object.resourceProperties !== "object") - throw TypeError(".google.cloud.securitycenter.v1.Asset.resourceProperties: object expected"); - message.resourceProperties = {}; - for (var keys = Object.keys(object.resourceProperties), i = 0; i < keys.length; ++i) { - if (typeof object.resourceProperties[keys[i]] !== "object") - throw TypeError(".google.cloud.securitycenter.v1.Asset.resourceProperties: object expected"); - message.resourceProperties[keys[i]] = $root.google.protobuf.Value.fromObject(object.resourceProperties[keys[i]]); + var message = new $root.google.cloud.securitycenter.v1.ListAssetsResponse(); + if (object.listAssetsResults) { + if (!Array.isArray(object.listAssetsResults)) + throw TypeError(".google.cloud.securitycenter.v1.ListAssetsResponse.listAssetsResults: array expected"); + message.listAssetsResults = []; + for (var i = 0; i < object.listAssetsResults.length; ++i) { + if (typeof object.listAssetsResults[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v1.ListAssetsResponse.listAssetsResults: object expected"); + message.listAssetsResults[i] = $root.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult.fromObject(object.listAssetsResults[i]); } } - if (object.securityMarks != null) { - if (typeof object.securityMarks !== "object") - throw TypeError(".google.cloud.securitycenter.v1.Asset.securityMarks: object expected"); - message.securityMarks = $root.google.cloud.securitycenter.v1.SecurityMarks.fromObject(object.securityMarks); - } - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.securitycenter.v1.Asset.createTime: object expected"); - message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); - } - if (object.updateTime != null) { - if (typeof object.updateTime !== "object") - throw TypeError(".google.cloud.securitycenter.v1.Asset.updateTime: object expected"); - message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); - } - if (object.iamPolicy != null) { - if (typeof object.iamPolicy !== "object") - throw TypeError(".google.cloud.securitycenter.v1.Asset.iamPolicy: object expected"); - message.iamPolicy = $root.google.cloud.securitycenter.v1.Asset.IamPolicy.fromObject(object.iamPolicy); + if (object.readTime != null) { + if (typeof object.readTime !== "object") + throw TypeError(".google.cloud.securitycenter.v1.ListAssetsResponse.readTime: object expected"); + message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.totalSize != null) + message.totalSize = object.totalSize | 0; return message; }; /** - * Creates a plain object from an Asset message. Also converts values to other types if specified. + * Creates a plain object from a ListAssetsResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.securitycenter.v1.Asset + * @memberof google.cloud.securitycenter.v1.ListAssetsResponse * @static - * @param {google.cloud.securitycenter.v1.Asset} message Asset + * @param {google.cloud.securitycenter.v1.ListAssetsResponse} message ListAssetsResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Asset.toObject = function toObject(message, options) { + ListAssetsResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.objects || options.defaults) - object.resourceProperties = {}; + if (options.arrays || options.defaults) + object.listAssetsResults = []; if (options.defaults) { - object.name = ""; - object.securityCenterProperties = null; - object.securityMarks = null; - object.createTime = null; - object.updateTime = null; - object.iamPolicy = null; + object.readTime = null; + object.nextPageToken = ""; + object.totalSize = 0; } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.securityCenterProperties != null && message.hasOwnProperty("securityCenterProperties")) - object.securityCenterProperties = $root.google.cloud.securitycenter.v1.Asset.SecurityCenterProperties.toObject(message.securityCenterProperties, options); - var keys2; - if (message.resourceProperties && (keys2 = Object.keys(message.resourceProperties)).length) { - object.resourceProperties = {}; - for (var j = 0; j < keys2.length; ++j) - object.resourceProperties[keys2[j]] = $root.google.protobuf.Value.toObject(message.resourceProperties[keys2[j]], options); + if (message.listAssetsResults && message.listAssetsResults.length) { + object.listAssetsResults = []; + for (var j = 0; j < message.listAssetsResults.length; ++j) + object.listAssetsResults[j] = $root.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult.toObject(message.listAssetsResults[j], options); } - if (message.securityMarks != null && message.hasOwnProperty("securityMarks")) - object.securityMarks = $root.google.cloud.securitycenter.v1.SecurityMarks.toObject(message.securityMarks, options); - if (message.createTime != null && message.hasOwnProperty("createTime")) - object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); - if (message.updateTime != null && message.hasOwnProperty("updateTime")) - object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); - if (message.iamPolicy != null && message.hasOwnProperty("iamPolicy")) - object.iamPolicy = $root.google.cloud.securitycenter.v1.Asset.IamPolicy.toObject(message.iamPolicy, options); + if (message.readTime != null && message.hasOwnProperty("readTime")) + object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.totalSize != null && message.hasOwnProperty("totalSize")) + object.totalSize = message.totalSize; return object; }; /** - * Converts this Asset to JSON. + * Converts this ListAssetsResponse to JSON. * @function toJSON - * @memberof google.cloud.securitycenter.v1.Asset + * @memberof google.cloud.securitycenter.v1.ListAssetsResponse * @instance * @returns {Object.} JSON object */ - Asset.prototype.toJSON = function toJSON() { + ListAssetsResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - Asset.SecurityCenterProperties = (function() { + ListAssetsResponse.ListAssetsResult = (function() { /** - * Properties of a SecurityCenterProperties. - * @memberof google.cloud.securitycenter.v1.Asset - * @interface ISecurityCenterProperties - * @property {string|null} [resourceName] SecurityCenterProperties resourceName - * @property {string|null} [resourceType] SecurityCenterProperties resourceType - * @property {string|null} [resourceParent] SecurityCenterProperties resourceParent - * @property {string|null} [resourceProject] SecurityCenterProperties resourceProject - * @property {Array.|null} [resourceOwners] SecurityCenterProperties resourceOwners + * Properties of a ListAssetsResult. + * @memberof google.cloud.securitycenter.v1.ListAssetsResponse + * @interface IListAssetsResult + * @property {google.cloud.securitycenter.v1.IAsset|null} [asset] ListAssetsResult asset + * @property {google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult.StateChange|null} [stateChange] ListAssetsResult stateChange */ /** - * Constructs a new SecurityCenterProperties. - * @memberof google.cloud.securitycenter.v1.Asset - * @classdesc Represents a SecurityCenterProperties. - * @implements ISecurityCenterProperties + * Constructs a new ListAssetsResult. + * @memberof google.cloud.securitycenter.v1.ListAssetsResponse + * @classdesc Represents a ListAssetsResult. + * @implements IListAssetsResult * @constructor - * @param {google.cloud.securitycenter.v1.Asset.ISecurityCenterProperties=} [properties] Properties to set + * @param {google.cloud.securitycenter.v1.ListAssetsResponse.IListAssetsResult=} [properties] Properties to set */ - function SecurityCenterProperties(properties) { - this.resourceOwners = []; + function ListAssetsResult(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -7003,130 +6719,88 @@ } /** - * SecurityCenterProperties resourceName. - * @member {string} resourceName - * @memberof google.cloud.securitycenter.v1.Asset.SecurityCenterProperties - * @instance - */ - SecurityCenterProperties.prototype.resourceName = ""; - - /** - * SecurityCenterProperties resourceType. - * @member {string} resourceType - * @memberof google.cloud.securitycenter.v1.Asset.SecurityCenterProperties - * @instance - */ - SecurityCenterProperties.prototype.resourceType = ""; - - /** - * SecurityCenterProperties resourceParent. - * @member {string} resourceParent - * @memberof google.cloud.securitycenter.v1.Asset.SecurityCenterProperties - * @instance - */ - SecurityCenterProperties.prototype.resourceParent = ""; - - /** - * SecurityCenterProperties resourceProject. - * @member {string} resourceProject - * @memberof google.cloud.securitycenter.v1.Asset.SecurityCenterProperties + * ListAssetsResult asset. + * @member {google.cloud.securitycenter.v1.IAsset|null|undefined} asset + * @memberof google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult * @instance */ - SecurityCenterProperties.prototype.resourceProject = ""; + ListAssetsResult.prototype.asset = null; /** - * SecurityCenterProperties resourceOwners. - * @member {Array.} resourceOwners - * @memberof google.cloud.securitycenter.v1.Asset.SecurityCenterProperties + * ListAssetsResult stateChange. + * @member {google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult.StateChange} stateChange + * @memberof google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult * @instance */ - SecurityCenterProperties.prototype.resourceOwners = $util.emptyArray; + ListAssetsResult.prototype.stateChange = 0; /** - * Creates a new SecurityCenterProperties instance using the specified properties. + * Creates a new ListAssetsResult instance using the specified properties. * @function create - * @memberof google.cloud.securitycenter.v1.Asset.SecurityCenterProperties + * @memberof google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult * @static - * @param {google.cloud.securitycenter.v1.Asset.ISecurityCenterProperties=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.Asset.SecurityCenterProperties} SecurityCenterProperties instance + * @param {google.cloud.securitycenter.v1.ListAssetsResponse.IListAssetsResult=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult} ListAssetsResult instance */ - SecurityCenterProperties.create = function create(properties) { - return new SecurityCenterProperties(properties); + ListAssetsResult.create = function create(properties) { + return new ListAssetsResult(properties); }; /** - * Encodes the specified SecurityCenterProperties message. Does not implicitly {@link google.cloud.securitycenter.v1.Asset.SecurityCenterProperties.verify|verify} messages. + * Encodes the specified ListAssetsResult message. Does not implicitly {@link google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult.verify|verify} messages. * @function encode - * @memberof google.cloud.securitycenter.v1.Asset.SecurityCenterProperties + * @memberof google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult * @static - * @param {google.cloud.securitycenter.v1.Asset.ISecurityCenterProperties} message SecurityCenterProperties message or plain object to encode + * @param {google.cloud.securitycenter.v1.ListAssetsResponse.IListAssetsResult} message ListAssetsResult message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SecurityCenterProperties.encode = function encode(message, writer) { + ListAssetsResult.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.resourceName != null && message.hasOwnProperty("resourceName")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.resourceName); - if (message.resourceType != null && message.hasOwnProperty("resourceType")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.resourceType); - if (message.resourceParent != null && message.hasOwnProperty("resourceParent")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.resourceParent); - if (message.resourceProject != null && message.hasOwnProperty("resourceProject")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.resourceProject); - if (message.resourceOwners != null && message.resourceOwners.length) - for (var i = 0; i < message.resourceOwners.length; ++i) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.resourceOwners[i]); + if (message.asset != null && message.hasOwnProperty("asset")) + $root.google.cloud.securitycenter.v1.Asset.encode(message.asset, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.stateChange != null && message.hasOwnProperty("stateChange")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.stateChange); return writer; }; /** - * Encodes the specified SecurityCenterProperties message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Asset.SecurityCenterProperties.verify|verify} messages. + * Encodes the specified ListAssetsResult message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.Asset.SecurityCenterProperties + * @memberof google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult * @static - * @param {google.cloud.securitycenter.v1.Asset.ISecurityCenterProperties} message SecurityCenterProperties message or plain object to encode + * @param {google.cloud.securitycenter.v1.ListAssetsResponse.IListAssetsResult} message ListAssetsResult message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SecurityCenterProperties.encodeDelimited = function encodeDelimited(message, writer) { + ListAssetsResult.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a SecurityCenterProperties message from the specified reader or buffer. + * Decodes a ListAssetsResult message from the specified reader or buffer. * @function decode - * @memberof google.cloud.securitycenter.v1.Asset.SecurityCenterProperties + * @memberof google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.Asset.SecurityCenterProperties} SecurityCenterProperties + * @returns {google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult} ListAssetsResult * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SecurityCenterProperties.decode = function decode(reader, length) { + ListAssetsResult.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.cloud.securitycenter.v1.Asset.SecurityCenterProperties(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.resourceName = reader.string(); + message.asset = $root.google.cloud.securitycenter.v1.Asset.decode(reader, reader.uint32()); break; case 2: - message.resourceType = reader.string(); - break; - case 3: - message.resourceParent = reader.string(); - break; - case 4: - message.resourceProject = reader.string(); - break; - case 5: - if (!(message.resourceOwners && message.resourceOwners.length)) - message.resourceOwners = []; - message.resourceOwners.push(reader.string()); + message.stateChange = reader.int32(); break; default: reader.skipType(tag & 7); @@ -7137,440 +6811,339 @@ }; /** - * Decodes a SecurityCenterProperties message from the specified reader or buffer, length delimited. + * Decodes a ListAssetsResult message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.Asset.SecurityCenterProperties + * @memberof google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.Asset.SecurityCenterProperties} SecurityCenterProperties + * @returns {google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult} ListAssetsResult * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SecurityCenterProperties.decodeDelimited = function decodeDelimited(reader) { + ListAssetsResult.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a SecurityCenterProperties message. + * Verifies a ListAssetsResult message. * @function verify - * @memberof google.cloud.securitycenter.v1.Asset.SecurityCenterProperties + * @memberof google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - SecurityCenterProperties.verify = function verify(message) { + ListAssetsResult.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.resourceName != null && message.hasOwnProperty("resourceName")) - if (!$util.isString(message.resourceName)) - return "resourceName: string expected"; - if (message.resourceType != null && message.hasOwnProperty("resourceType")) - if (!$util.isString(message.resourceType)) - return "resourceType: string expected"; - if (message.resourceParent != null && message.hasOwnProperty("resourceParent")) - if (!$util.isString(message.resourceParent)) - return "resourceParent: string expected"; - if (message.resourceProject != null && message.hasOwnProperty("resourceProject")) - if (!$util.isString(message.resourceProject)) - return "resourceProject: string expected"; - if (message.resourceOwners != null && message.hasOwnProperty("resourceOwners")) { - if (!Array.isArray(message.resourceOwners)) - return "resourceOwners: array expected"; - for (var i = 0; i < message.resourceOwners.length; ++i) - if (!$util.isString(message.resourceOwners[i])) - return "resourceOwners: string[] expected"; + if (message.asset != null && message.hasOwnProperty("asset")) { + var error = $root.google.cloud.securitycenter.v1.Asset.verify(message.asset); + if (error) + return "asset." + error; } + if (message.stateChange != null && message.hasOwnProperty("stateChange")) + switch (message.stateChange) { + default: + return "stateChange: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } return null; }; /** - * Creates a SecurityCenterProperties message from a plain object. Also converts values to their respective internal types. + * Creates a ListAssetsResult message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.securitycenter.v1.Asset.SecurityCenterProperties + * @memberof google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult * @static * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.Asset.SecurityCenterProperties} SecurityCenterProperties + * @returns {google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult} ListAssetsResult */ - SecurityCenterProperties.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.Asset.SecurityCenterProperties) + ListAssetsResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult) return object; - var message = new $root.google.cloud.securitycenter.v1.Asset.SecurityCenterProperties(); - if (object.resourceName != null) - message.resourceName = String(object.resourceName); - if (object.resourceType != null) - message.resourceType = String(object.resourceType); - if (object.resourceParent != null) - message.resourceParent = String(object.resourceParent); - if (object.resourceProject != null) - message.resourceProject = String(object.resourceProject); - if (object.resourceOwners) { - if (!Array.isArray(object.resourceOwners)) - throw TypeError(".google.cloud.securitycenter.v1.Asset.SecurityCenterProperties.resourceOwners: array expected"); - message.resourceOwners = []; - for (var i = 0; i < object.resourceOwners.length; ++i) - message.resourceOwners[i] = String(object.resourceOwners[i]); + var message = new $root.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult(); + if (object.asset != null) { + if (typeof object.asset !== "object") + throw TypeError(".google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult.asset: object expected"); + message.asset = $root.google.cloud.securitycenter.v1.Asset.fromObject(object.asset); + } + switch (object.stateChange) { + case "UNUSED": + case 0: + message.stateChange = 0; + break; + case "ADDED": + case 1: + message.stateChange = 1; + break; + case "REMOVED": + case 2: + message.stateChange = 2; + break; + case "ACTIVE": + case 3: + message.stateChange = 3; + break; } return message; }; /** - * Creates a plain object from a SecurityCenterProperties message. Also converts values to other types if specified. + * Creates a plain object from a ListAssetsResult message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.securitycenter.v1.Asset.SecurityCenterProperties + * @memberof google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult * @static - * @param {google.cloud.securitycenter.v1.Asset.SecurityCenterProperties} message SecurityCenterProperties + * @param {google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult} message ListAssetsResult * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SecurityCenterProperties.toObject = function toObject(message, options) { + ListAssetsResult.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.resourceOwners = []; if (options.defaults) { - object.resourceName = ""; - object.resourceType = ""; - object.resourceParent = ""; - object.resourceProject = ""; - } - if (message.resourceName != null && message.hasOwnProperty("resourceName")) - object.resourceName = message.resourceName; - if (message.resourceType != null && message.hasOwnProperty("resourceType")) - object.resourceType = message.resourceType; - if (message.resourceParent != null && message.hasOwnProperty("resourceParent")) - object.resourceParent = message.resourceParent; - if (message.resourceProject != null && message.hasOwnProperty("resourceProject")) - object.resourceProject = message.resourceProject; - if (message.resourceOwners && message.resourceOwners.length) { - object.resourceOwners = []; - for (var j = 0; j < message.resourceOwners.length; ++j) - object.resourceOwners[j] = message.resourceOwners[j]; + object.asset = null; + object.stateChange = options.enums === String ? "UNUSED" : 0; } + if (message.asset != null && message.hasOwnProperty("asset")) + object.asset = $root.google.cloud.securitycenter.v1.Asset.toObject(message.asset, options); + if (message.stateChange != null && message.hasOwnProperty("stateChange")) + object.stateChange = options.enums === String ? $root.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult.StateChange[message.stateChange] : message.stateChange; return object; }; /** - * Converts this SecurityCenterProperties to JSON. + * Converts this ListAssetsResult to JSON. * @function toJSON - * @memberof google.cloud.securitycenter.v1.Asset.SecurityCenterProperties + * @memberof google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult * @instance * @returns {Object.} JSON object */ - SecurityCenterProperties.prototype.toJSON = function toJSON() { + ListAssetsResult.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return SecurityCenterProperties; - })(); - - Asset.IamPolicy = (function() { - /** - * Properties of an IamPolicy. - * @memberof google.cloud.securitycenter.v1.Asset - * @interface IIamPolicy - * @property {string|null} [policyBlob] IamPolicy policyBlob + * StateChange enum. + * @name google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult.StateChange + * @enum {string} + * @property {number} UNUSED=0 UNUSED value + * @property {number} ADDED=1 ADDED value + * @property {number} REMOVED=2 REMOVED value + * @property {number} ACTIVE=3 ACTIVE value */ + ListAssetsResult.StateChange = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNUSED"] = 0; + values[valuesById[1] = "ADDED"] = 1; + values[valuesById[2] = "REMOVED"] = 2; + values[valuesById[3] = "ACTIVE"] = 3; + return values; + })(); - /** - * Constructs a new IamPolicy. - * @memberof google.cloud.securitycenter.v1.Asset - * @classdesc Represents an IamPolicy. - * @implements IIamPolicy - * @constructor - * @param {google.cloud.securitycenter.v1.Asset.IIamPolicy=} [properties] Properties to set - */ - function IamPolicy(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]]; - } + return ListAssetsResult; + })(); - /** - * IamPolicy policyBlob. - * @member {string} policyBlob - * @memberof google.cloud.securitycenter.v1.Asset.IamPolicy - * @instance - */ - IamPolicy.prototype.policyBlob = ""; + return ListAssetsResponse; + })(); - /** - * Creates a new IamPolicy instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v1.Asset.IamPolicy - * @static - * @param {google.cloud.securitycenter.v1.Asset.IIamPolicy=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.Asset.IamPolicy} IamPolicy instance - */ - IamPolicy.create = function create(properties) { - return new IamPolicy(properties); - }; + v1.ListFindingsRequest = (function() { - /** - * Encodes the specified IamPolicy message. Does not implicitly {@link google.cloud.securitycenter.v1.Asset.IamPolicy.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1.Asset.IamPolicy - * @static - * @param {google.cloud.securitycenter.v1.Asset.IIamPolicy} message IamPolicy message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - IamPolicy.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.policyBlob != null && message.hasOwnProperty("policyBlob")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.policyBlob); - return writer; - }; + /** + * Properties of a ListFindingsRequest. + * @memberof google.cloud.securitycenter.v1 + * @interface IListFindingsRequest + * @property {string|null} [parent] ListFindingsRequest parent + * @property {string|null} [filter] ListFindingsRequest filter + * @property {string|null} [orderBy] ListFindingsRequest orderBy + * @property {google.protobuf.ITimestamp|null} [readTime] ListFindingsRequest readTime + * @property {google.protobuf.IDuration|null} [compareDuration] ListFindingsRequest compareDuration + * @property {google.protobuf.IFieldMask|null} [fieldMask] ListFindingsRequest fieldMask + * @property {string|null} [pageToken] ListFindingsRequest pageToken + * @property {number|null} [pageSize] ListFindingsRequest pageSize + */ - /** - * Encodes the specified IamPolicy message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Asset.IamPolicy.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.Asset.IamPolicy - * @static - * @param {google.cloud.securitycenter.v1.Asset.IIamPolicy} message IamPolicy message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - IamPolicy.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Constructs a new ListFindingsRequest. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a ListFindingsRequest. + * @implements IListFindingsRequest + * @constructor + * @param {google.cloud.securitycenter.v1.IListFindingsRequest=} [properties] Properties to set + */ + function ListFindingsRequest(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]]; + } - /** - * Decodes an IamPolicy message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v1.Asset.IamPolicy - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.Asset.IamPolicy} IamPolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - IamPolicy.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.cloud.securitycenter.v1.Asset.IamPolicy(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.policyBlob = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * ListFindingsRequest parent. + * @member {string} parent + * @memberof google.cloud.securitycenter.v1.ListFindingsRequest + * @instance + */ + ListFindingsRequest.prototype.parent = ""; - /** - * Decodes an IamPolicy message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.Asset.IamPolicy - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.Asset.IamPolicy} IamPolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - IamPolicy.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an IamPolicy message. - * @function verify - * @memberof google.cloud.securitycenter.v1.Asset.IamPolicy - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - IamPolicy.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.policyBlob != null && message.hasOwnProperty("policyBlob")) - if (!$util.isString(message.policyBlob)) - return "policyBlob: string expected"; - return null; - }; - - /** - * Creates an IamPolicy message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v1.Asset.IamPolicy - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.Asset.IamPolicy} IamPolicy - */ - IamPolicy.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.Asset.IamPolicy) - return object; - var message = new $root.google.cloud.securitycenter.v1.Asset.IamPolicy(); - if (object.policyBlob != null) - message.policyBlob = String(object.policyBlob); - return message; - }; - - /** - * Creates a plain object from an IamPolicy message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v1.Asset.IamPolicy - * @static - * @param {google.cloud.securitycenter.v1.Asset.IamPolicy} message IamPolicy - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - IamPolicy.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.policyBlob = ""; - if (message.policyBlob != null && message.hasOwnProperty("policyBlob")) - object.policyBlob = message.policyBlob; - return object; - }; - - /** - * Converts this IamPolicy to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1.Asset.IamPolicy - * @instance - * @returns {Object.} JSON object - */ - IamPolicy.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return IamPolicy; - })(); + /** + * ListFindingsRequest filter. + * @member {string} filter + * @memberof google.cloud.securitycenter.v1.ListFindingsRequest + * @instance + */ + ListFindingsRequest.prototype.filter = ""; - return Asset; - })(); + /** + * ListFindingsRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.securitycenter.v1.ListFindingsRequest + * @instance + */ + ListFindingsRequest.prototype.orderBy = ""; - v1.SecurityMarks = (function() { + /** + * ListFindingsRequest readTime. + * @member {google.protobuf.ITimestamp|null|undefined} readTime + * @memberof google.cloud.securitycenter.v1.ListFindingsRequest + * @instance + */ + ListFindingsRequest.prototype.readTime = null; /** - * Properties of a SecurityMarks. - * @memberof google.cloud.securitycenter.v1 - * @interface ISecurityMarks - * @property {string|null} [name] SecurityMarks name - * @property {Object.|null} [marks] SecurityMarks marks + * ListFindingsRequest compareDuration. + * @member {google.protobuf.IDuration|null|undefined} compareDuration + * @memberof google.cloud.securitycenter.v1.ListFindingsRequest + * @instance */ + ListFindingsRequest.prototype.compareDuration = null; /** - * Constructs a new SecurityMarks. - * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents a SecurityMarks. - * @implements ISecurityMarks - * @constructor - * @param {google.cloud.securitycenter.v1.ISecurityMarks=} [properties] Properties to set + * ListFindingsRequest fieldMask. + * @member {google.protobuf.IFieldMask|null|undefined} fieldMask + * @memberof google.cloud.securitycenter.v1.ListFindingsRequest + * @instance */ - function SecurityMarks(properties) { - this.marks = {}; - 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]]; - } + ListFindingsRequest.prototype.fieldMask = null; /** - * SecurityMarks name. - * @member {string} name - * @memberof google.cloud.securitycenter.v1.SecurityMarks + * ListFindingsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.securitycenter.v1.ListFindingsRequest * @instance */ - SecurityMarks.prototype.name = ""; + ListFindingsRequest.prototype.pageToken = ""; /** - * SecurityMarks marks. - * @member {Object.} marks - * @memberof google.cloud.securitycenter.v1.SecurityMarks + * ListFindingsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.securitycenter.v1.ListFindingsRequest * @instance */ - SecurityMarks.prototype.marks = $util.emptyObject; + ListFindingsRequest.prototype.pageSize = 0; /** - * Creates a new SecurityMarks instance using the specified properties. + * Creates a new ListFindingsRequest instance using the specified properties. * @function create - * @memberof google.cloud.securitycenter.v1.SecurityMarks + * @memberof google.cloud.securitycenter.v1.ListFindingsRequest * @static - * @param {google.cloud.securitycenter.v1.ISecurityMarks=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.SecurityMarks} SecurityMarks instance + * @param {google.cloud.securitycenter.v1.IListFindingsRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.ListFindingsRequest} ListFindingsRequest instance */ - SecurityMarks.create = function create(properties) { - return new SecurityMarks(properties); + ListFindingsRequest.create = function create(properties) { + return new ListFindingsRequest(properties); }; /** - * Encodes the specified SecurityMarks message. Does not implicitly {@link google.cloud.securitycenter.v1.SecurityMarks.verify|verify} messages. + * Encodes the specified ListFindingsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.ListFindingsRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.securitycenter.v1.SecurityMarks + * @memberof google.cloud.securitycenter.v1.ListFindingsRequest * @static - * @param {google.cloud.securitycenter.v1.ISecurityMarks} message SecurityMarks message or plain object to encode + * @param {google.cloud.securitycenter.v1.IListFindingsRequest} message ListFindingsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SecurityMarks.encode = function encode(message, writer) { + ListFindingsRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.marks != null && message.hasOwnProperty("marks")) - for (var keys = Object.keys(message.marks), i = 0; i < keys.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.marks[keys[i]]).ldelim(); + if (message.parent != null && message.hasOwnProperty("parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.filter != null && message.hasOwnProperty("filter")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.orderBy); + if (message.readTime != null && message.hasOwnProperty("readTime")) + $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.compareDuration != null && message.hasOwnProperty("compareDuration")) + $root.google.protobuf.Duration.encode(message.compareDuration, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.fieldMask != null && message.hasOwnProperty("fieldMask")) + $root.google.protobuf.FieldMask.encode(message.fieldMask, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.pageToken); + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.pageSize); return writer; }; /** - * Encodes the specified SecurityMarks message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.SecurityMarks.verify|verify} messages. + * Encodes the specified ListFindingsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListFindingsRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.SecurityMarks + * @memberof google.cloud.securitycenter.v1.ListFindingsRequest * @static - * @param {google.cloud.securitycenter.v1.ISecurityMarks} message SecurityMarks message or plain object to encode + * @param {google.cloud.securitycenter.v1.IListFindingsRequest} message ListFindingsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SecurityMarks.encodeDelimited = function encodeDelimited(message, writer) { + ListFindingsRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a SecurityMarks message from the specified reader or buffer. + * Decodes a ListFindingsRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.securitycenter.v1.SecurityMarks + * @memberof google.cloud.securitycenter.v1.ListFindingsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.SecurityMarks} SecurityMarks + * @returns {google.cloud.securitycenter.v1.ListFindingsRequest} ListFindingsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SecurityMarks.decode = function decode(reader, length) { + ListFindingsRequest.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.cloud.securitycenter.v1.SecurityMarks(), key; + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.ListFindingsRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.name = reader.string(); + message.parent = reader.string(); break; case 2: - reader.skip().pos++; - if (message.marks === $util.emptyObject) - message.marks = {}; - key = reader.string(); - reader.pos++; - message.marks[key] = reader.string(); + message.filter = reader.string(); + break; + case 3: + message.orderBy = reader.string(); + break; + case 4: + message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 5: + message.compareDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + case 7: + message.fieldMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + case 8: + message.pageToken = reader.string(); + break; + case 9: + message.pageSize = reader.int32(); break; default: reader.skipType(tag & 7); @@ -7581,140 +7154,183 @@ }; /** - * Decodes a SecurityMarks message from the specified reader or buffer, length delimited. + * Decodes a ListFindingsRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.SecurityMarks + * @memberof google.cloud.securitycenter.v1.ListFindingsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.SecurityMarks} SecurityMarks + * @returns {google.cloud.securitycenter.v1.ListFindingsRequest} ListFindingsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SecurityMarks.decodeDelimited = function decodeDelimited(reader) { + ListFindingsRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a SecurityMarks message. + * Verifies a ListFindingsRequest message. * @function verify - * @memberof google.cloud.securitycenter.v1.SecurityMarks + * @memberof google.cloud.securitycenter.v1.ListFindingsRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - SecurityMarks.verify = function verify(message) { + ListFindingsRequest.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.marks != null && message.hasOwnProperty("marks")) { - if (!$util.isObject(message.marks)) - return "marks: object expected"; - var key = Object.keys(message.marks); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.marks[key[i]])) - return "marks: string{k:string} expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + if (message.readTime != null && message.hasOwnProperty("readTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.readTime); + if (error) + return "readTime." + error; + } + if (message.compareDuration != null && message.hasOwnProperty("compareDuration")) { + var error = $root.google.protobuf.Duration.verify(message.compareDuration); + if (error) + return "compareDuration." + error; + } + if (message.fieldMask != null && message.hasOwnProperty("fieldMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.fieldMask); + if (error) + return "fieldMask." + error; } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; return null; }; /** - * Creates a SecurityMarks message from a plain object. Also converts values to their respective internal types. + * Creates a ListFindingsRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.securitycenter.v1.SecurityMarks + * @memberof google.cloud.securitycenter.v1.ListFindingsRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.SecurityMarks} SecurityMarks + * @returns {google.cloud.securitycenter.v1.ListFindingsRequest} ListFindingsRequest */ - SecurityMarks.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.SecurityMarks) + ListFindingsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.ListFindingsRequest) return object; - var message = new $root.google.cloud.securitycenter.v1.SecurityMarks(); - if (object.name != null) - message.name = String(object.name); - if (object.marks) { - if (typeof object.marks !== "object") - throw TypeError(".google.cloud.securitycenter.v1.SecurityMarks.marks: object expected"); - message.marks = {}; - for (var keys = Object.keys(object.marks), i = 0; i < keys.length; ++i) - message.marks[keys[i]] = String(object.marks[keys[i]]); + var message = new $root.google.cloud.securitycenter.v1.ListFindingsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.filter != null) + message.filter = String(object.filter); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.readTime != null) { + if (typeof object.readTime !== "object") + throw TypeError(".google.cloud.securitycenter.v1.ListFindingsRequest.readTime: object expected"); + message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); } + if (object.compareDuration != null) { + if (typeof object.compareDuration !== "object") + throw TypeError(".google.cloud.securitycenter.v1.ListFindingsRequest.compareDuration: object expected"); + message.compareDuration = $root.google.protobuf.Duration.fromObject(object.compareDuration); + } + if (object.fieldMask != null) { + if (typeof object.fieldMask !== "object") + throw TypeError(".google.cloud.securitycenter.v1.ListFindingsRequest.fieldMask: object expected"); + message.fieldMask = $root.google.protobuf.FieldMask.fromObject(object.fieldMask); + } + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; return message; }; /** - * Creates a plain object from a SecurityMarks message. Also converts values to other types if specified. + * Creates a plain object from a ListFindingsRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.securitycenter.v1.SecurityMarks + * @memberof google.cloud.securitycenter.v1.ListFindingsRequest * @static - * @param {google.cloud.securitycenter.v1.SecurityMarks} message SecurityMarks + * @param {google.cloud.securitycenter.v1.ListFindingsRequest} message ListFindingsRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SecurityMarks.toObject = function toObject(message, options) { + ListFindingsRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.objects || options.defaults) - object.marks = {}; - if (options.defaults) - object.name = ""; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - var keys2; - if (message.marks && (keys2 = Object.keys(message.marks)).length) { - object.marks = {}; - for (var j = 0; j < keys2.length; ++j) - object.marks[keys2[j]] = message.marks[keys2[j]]; + if (options.defaults) { + object.parent = ""; + object.filter = ""; + object.orderBy = ""; + object.readTime = null; + object.compareDuration = null; + object.fieldMask = null; + object.pageToken = ""; + object.pageSize = 0; } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; + if (message.readTime != null && message.hasOwnProperty("readTime")) + object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); + if (message.compareDuration != null && message.hasOwnProperty("compareDuration")) + object.compareDuration = $root.google.protobuf.Duration.toObject(message.compareDuration, options); + if (message.fieldMask != null && message.hasOwnProperty("fieldMask")) + object.fieldMask = $root.google.protobuf.FieldMask.toObject(message.fieldMask, options); + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; return object; }; /** - * Converts this SecurityMarks to JSON. + * Converts this ListFindingsRequest to JSON. * @function toJSON - * @memberof google.cloud.securitycenter.v1.SecurityMarks + * @memberof google.cloud.securitycenter.v1.ListFindingsRequest * @instance * @returns {Object.} JSON object */ - SecurityMarks.prototype.toJSON = function toJSON() { + ListFindingsRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return SecurityMarks; + return ListFindingsRequest; })(); - v1.Finding = (function() { + v1.ListFindingsResponse = (function() { /** - * Properties of a Finding. + * Properties of a ListFindingsResponse. * @memberof google.cloud.securitycenter.v1 - * @interface IFinding - * @property {string|null} [name] Finding name - * @property {string|null} [parent] Finding parent - * @property {string|null} [resourceName] Finding resourceName - * @property {google.cloud.securitycenter.v1.Finding.State|null} [state] Finding state - * @property {string|null} [category] Finding category - * @property {string|null} [externalUri] Finding externalUri - * @property {Object.|null} [sourceProperties] Finding sourceProperties - * @property {google.cloud.securitycenter.v1.ISecurityMarks|null} [securityMarks] Finding securityMarks - * @property {google.protobuf.ITimestamp|null} [eventTime] Finding eventTime - * @property {google.protobuf.ITimestamp|null} [createTime] Finding createTime + * @interface IListFindingsResponse + * @property {Array.|null} [listFindingsResults] ListFindingsResponse listFindingsResults + * @property {google.protobuf.ITimestamp|null} [readTime] ListFindingsResponse readTime + * @property {string|null} [nextPageToken] ListFindingsResponse nextPageToken + * @property {number|null} [totalSize] ListFindingsResponse totalSize */ /** - * Constructs a new Finding. + * Constructs a new ListFindingsResponse. * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents a Finding. - * @implements IFinding + * @classdesc Represents a ListFindingsResponse. + * @implements IListFindingsResponse * @constructor - * @param {google.cloud.securitycenter.v1.IFinding=} [properties] Properties to set + * @param {google.cloud.securitycenter.v1.IListFindingsResponse=} [properties] Properties to set */ - function Finding(properties) { - this.sourceProperties = {}; + function ListFindingsResponse(properties) { + this.listFindingsResults = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -7722,200 +7338,117 @@ } /** - * Finding name. - * @member {string} name - * @memberof google.cloud.securitycenter.v1.Finding + * ListFindingsResponse listFindingsResults. + * @member {Array.} listFindingsResults + * @memberof google.cloud.securitycenter.v1.ListFindingsResponse * @instance */ - Finding.prototype.name = ""; + ListFindingsResponse.prototype.listFindingsResults = $util.emptyArray; /** - * Finding parent. - * @member {string} parent - * @memberof google.cloud.securitycenter.v1.Finding + * ListFindingsResponse readTime. + * @member {google.protobuf.ITimestamp|null|undefined} readTime + * @memberof google.cloud.securitycenter.v1.ListFindingsResponse * @instance */ - Finding.prototype.parent = ""; + ListFindingsResponse.prototype.readTime = null; /** - * Finding resourceName. - * @member {string} resourceName - * @memberof google.cloud.securitycenter.v1.Finding + * ListFindingsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.securitycenter.v1.ListFindingsResponse * @instance */ - Finding.prototype.resourceName = ""; + ListFindingsResponse.prototype.nextPageToken = ""; /** - * Finding state. - * @member {google.cloud.securitycenter.v1.Finding.State} state - * @memberof google.cloud.securitycenter.v1.Finding + * ListFindingsResponse totalSize. + * @member {number} totalSize + * @memberof google.cloud.securitycenter.v1.ListFindingsResponse * @instance */ - Finding.prototype.state = 0; + ListFindingsResponse.prototype.totalSize = 0; /** - * Finding category. - * @member {string} category - * @memberof google.cloud.securitycenter.v1.Finding - * @instance + * Creates a new ListFindingsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.ListFindingsResponse + * @static + * @param {google.cloud.securitycenter.v1.IListFindingsResponse=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.ListFindingsResponse} ListFindingsResponse instance */ - Finding.prototype.category = ""; + ListFindingsResponse.create = function create(properties) { + return new ListFindingsResponse(properties); + }; /** - * Finding externalUri. - * @member {string} externalUri - * @memberof google.cloud.securitycenter.v1.Finding - * @instance + * Encodes the specified ListFindingsResponse message. Does not implicitly {@link google.cloud.securitycenter.v1.ListFindingsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.ListFindingsResponse + * @static + * @param {google.cloud.securitycenter.v1.IListFindingsResponse} message ListFindingsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - Finding.prototype.externalUri = ""; + ListFindingsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.listFindingsResults != null && message.listFindingsResults.length) + for (var i = 0; i < message.listFindingsResults.length; ++i) + $root.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.encode(message.listFindingsResults[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.readTime != null && message.hasOwnProperty("readTime")) + $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.nextPageToken); + if (message.totalSize != null && message.hasOwnProperty("totalSize")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.totalSize); + return writer; + }; /** - * Finding sourceProperties. - * @member {Object.} sourceProperties - * @memberof google.cloud.securitycenter.v1.Finding - * @instance + * Encodes the specified ListFindingsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListFindingsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.ListFindingsResponse + * @static + * @param {google.cloud.securitycenter.v1.IListFindingsResponse} message ListFindingsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - Finding.prototype.sourceProperties = $util.emptyObject; + ListFindingsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; /** - * Finding securityMarks. - * @member {google.cloud.securitycenter.v1.ISecurityMarks|null|undefined} securityMarks - * @memberof google.cloud.securitycenter.v1.Finding - * @instance - */ - Finding.prototype.securityMarks = null; - - /** - * Finding eventTime. - * @member {google.protobuf.ITimestamp|null|undefined} eventTime - * @memberof google.cloud.securitycenter.v1.Finding - * @instance - */ - Finding.prototype.eventTime = null; - - /** - * Finding createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.securitycenter.v1.Finding - * @instance - */ - Finding.prototype.createTime = null; - - /** - * Creates a new Finding instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v1.Finding - * @static - * @param {google.cloud.securitycenter.v1.IFinding=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.Finding} Finding instance - */ - Finding.create = function create(properties) { - return new Finding(properties); - }; - - /** - * Encodes the specified Finding message. Does not implicitly {@link google.cloud.securitycenter.v1.Finding.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1.Finding - * @static - * @param {google.cloud.securitycenter.v1.IFinding} message Finding message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Finding.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.parent != null && message.hasOwnProperty("parent")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.parent); - if (message.resourceName != null && message.hasOwnProperty("resourceName")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.resourceName); - if (message.state != null && message.hasOwnProperty("state")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.state); - if (message.category != null && message.hasOwnProperty("category")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.category); - if (message.externalUri != null && message.hasOwnProperty("externalUri")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.externalUri); - if (message.sourceProperties != null && message.hasOwnProperty("sourceProperties")) - for (var keys = Object.keys(message.sourceProperties), i = 0; i < keys.length; ++i) { - writer.uint32(/* id 7, wireType 2 =*/58).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); - $root.google.protobuf.Value.encode(message.sourceProperties[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); - } - if (message.securityMarks != null && message.hasOwnProperty("securityMarks")) - $root.google.cloud.securitycenter.v1.SecurityMarks.encode(message.securityMarks, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.eventTime != null && message.hasOwnProperty("eventTime")) - $root.google.protobuf.Timestamp.encode(message.eventTime, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.createTime != null && message.hasOwnProperty("createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Finding message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Finding.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.Finding - * @static - * @param {google.cloud.securitycenter.v1.IFinding} message Finding message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Finding.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Finding message from the specified reader or buffer. + * Decodes a ListFindingsResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.securitycenter.v1.Finding + * @memberof google.cloud.securitycenter.v1.ListFindingsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.Finding} Finding + * @returns {google.cloud.securitycenter.v1.ListFindingsResponse} ListFindingsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Finding.decode = function decode(reader, length) { + ListFindingsResponse.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.cloud.securitycenter.v1.Finding(), key; + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.ListFindingsResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.name = reader.string(); + if (!(message.listFindingsResults && message.listFindingsResults.length)) + message.listFindingsResults = []; + message.listFindingsResults.push($root.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.decode(reader, reader.uint32())); break; case 2: - message.parent = reader.string(); + message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; case 3: - message.resourceName = reader.string(); + message.nextPageToken = reader.string(); break; case 4: - message.state = reader.int32(); - break; - case 5: - message.category = reader.string(); - break; - case 6: - message.externalUri = reader.string(); - break; - case 7: - reader.skip().pos++; - if (message.sourceProperties === $util.emptyObject) - message.sourceProperties = {}; - key = reader.string(); - reader.pos++; - message.sourceProperties[key] = $root.google.protobuf.Value.decode(reader, reader.uint32()); - break; - case 8: - message.securityMarks = $root.google.cloud.securitycenter.v1.SecurityMarks.decode(reader, reader.uint32()); - break; - case 9: - message.eventTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 10: - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + message.totalSize = reader.int32(); break; default: reader.skipType(tag & 7); @@ -7926,577 +7459,256 @@ }; /** - * Decodes a Finding message from the specified reader or buffer, length delimited. + * Decodes a ListFindingsResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.Finding + * @memberof google.cloud.securitycenter.v1.ListFindingsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.Finding} Finding + * @returns {google.cloud.securitycenter.v1.ListFindingsResponse} ListFindingsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Finding.decodeDelimited = function decodeDelimited(reader) { + ListFindingsResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a Finding message. + * Verifies a ListFindingsResponse message. * @function verify - * @memberof google.cloud.securitycenter.v1.Finding + * @memberof google.cloud.securitycenter.v1.ListFindingsResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Finding.verify = function verify(message) { + ListFindingsResponse.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.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.resourceName != null && message.hasOwnProperty("resourceName")) - if (!$util.isString(message.resourceName)) - return "resourceName: string expected"; - if (message.state != null && message.hasOwnProperty("state")) - switch (message.state) { - default: - return "state: 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"; - if (message.externalUri != null && message.hasOwnProperty("externalUri")) - if (!$util.isString(message.externalUri)) - return "externalUri: string expected"; - if (message.sourceProperties != null && message.hasOwnProperty("sourceProperties")) { - if (!$util.isObject(message.sourceProperties)) - return "sourceProperties: object expected"; - var key = Object.keys(message.sourceProperties); - for (var i = 0; i < key.length; ++i) { - var error = $root.google.protobuf.Value.verify(message.sourceProperties[key[i]]); + if (message.listFindingsResults != null && message.hasOwnProperty("listFindingsResults")) { + if (!Array.isArray(message.listFindingsResults)) + return "listFindingsResults: array expected"; + for (var i = 0; i < message.listFindingsResults.length; ++i) { + var error = $root.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.verify(message.listFindingsResults[i]); if (error) - return "sourceProperties." + error; + return "listFindingsResults." + error; } } - if (message.securityMarks != null && message.hasOwnProperty("securityMarks")) { - var error = $root.google.cloud.securitycenter.v1.SecurityMarks.verify(message.securityMarks); - if (error) - return "securityMarks." + error; - } - if (message.eventTime != null && message.hasOwnProperty("eventTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.eventTime); - if (error) - return "eventTime." + error; - } - if (message.createTime != null && message.hasOwnProperty("createTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (message.readTime != null && message.hasOwnProperty("readTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.readTime); if (error) - return "createTime." + error; + return "readTime." + error; } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.totalSize != null && message.hasOwnProperty("totalSize")) + if (!$util.isInteger(message.totalSize)) + return "totalSize: integer expected"; return null; }; /** - * Creates a Finding message from a plain object. Also converts values to their respective internal types. + * Creates a ListFindingsResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.securitycenter.v1.Finding + * @memberof google.cloud.securitycenter.v1.ListFindingsResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.Finding} Finding + * @returns {google.cloud.securitycenter.v1.ListFindingsResponse} ListFindingsResponse */ - Finding.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.Finding) + ListFindingsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.ListFindingsResponse) return object; - var message = new $root.google.cloud.securitycenter.v1.Finding(); - if (object.name != null) - message.name = String(object.name); - if (object.parent != null) - message.parent = String(object.parent); - if (object.resourceName != null) - message.resourceName = String(object.resourceName); - switch (object.state) { - case "STATE_UNSPECIFIED": - case 0: - message.state = 0; - break; - case "ACTIVE": - case 1: - message.state = 1; - break; - case "INACTIVE": - case 2: - message.state = 2; - break; - } - if (object.category != null) - message.category = String(object.category); - if (object.externalUri != null) - message.externalUri = String(object.externalUri); - if (object.sourceProperties) { - if (typeof object.sourceProperties !== "object") - throw TypeError(".google.cloud.securitycenter.v1.Finding.sourceProperties: object expected"); - message.sourceProperties = {}; - for (var keys = Object.keys(object.sourceProperties), i = 0; i < keys.length; ++i) { - if (typeof object.sourceProperties[keys[i]] !== "object") - throw TypeError(".google.cloud.securitycenter.v1.Finding.sourceProperties: object expected"); - message.sourceProperties[keys[i]] = $root.google.protobuf.Value.fromObject(object.sourceProperties[keys[i]]); + var message = new $root.google.cloud.securitycenter.v1.ListFindingsResponse(); + if (object.listFindingsResults) { + if (!Array.isArray(object.listFindingsResults)) + throw TypeError(".google.cloud.securitycenter.v1.ListFindingsResponse.listFindingsResults: array expected"); + message.listFindingsResults = []; + for (var i = 0; i < object.listFindingsResults.length; ++i) { + if (typeof object.listFindingsResults[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v1.ListFindingsResponse.listFindingsResults: object expected"); + message.listFindingsResults[i] = $root.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.fromObject(object.listFindingsResults[i]); } } - if (object.securityMarks != null) { - if (typeof object.securityMarks !== "object") - throw TypeError(".google.cloud.securitycenter.v1.Finding.securityMarks: object expected"); - message.securityMarks = $root.google.cloud.securitycenter.v1.SecurityMarks.fromObject(object.securityMarks); - } - if (object.eventTime != null) { - if (typeof object.eventTime !== "object") - throw TypeError(".google.cloud.securitycenter.v1.Finding.eventTime: object expected"); - message.eventTime = $root.google.protobuf.Timestamp.fromObject(object.eventTime); - } - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.securitycenter.v1.Finding.createTime: object expected"); - message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + if (object.readTime != null) { + if (typeof object.readTime !== "object") + throw TypeError(".google.cloud.securitycenter.v1.ListFindingsResponse.readTime: object expected"); + message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.totalSize != null) + message.totalSize = object.totalSize | 0; return message; }; /** - * Creates a plain object from a Finding message. Also converts values to other types if specified. + * Creates a plain object from a ListFindingsResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.securitycenter.v1.Finding + * @memberof google.cloud.securitycenter.v1.ListFindingsResponse * @static - * @param {google.cloud.securitycenter.v1.Finding} message Finding + * @param {google.cloud.securitycenter.v1.ListFindingsResponse} message ListFindingsResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Finding.toObject = function toObject(message, options) { + ListFindingsResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.objects || options.defaults) - object.sourceProperties = {}; + if (options.arrays || options.defaults) + object.listFindingsResults = []; if (options.defaults) { - object.name = ""; - object.parent = ""; - object.resourceName = ""; - object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; - object.category = ""; - object.externalUri = ""; - object.securityMarks = null; - object.eventTime = null; - object.createTime = null; + object.readTime = null; + object.nextPageToken = ""; + object.totalSize = 0; } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.resourceName != null && message.hasOwnProperty("resourceName")) - object.resourceName = message.resourceName; - if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.securitycenter.v1.Finding.State[message.state] : message.state; - if (message.category != null && message.hasOwnProperty("category")) - object.category = message.category; - if (message.externalUri != null && message.hasOwnProperty("externalUri")) - object.externalUri = message.externalUri; - var keys2; - if (message.sourceProperties && (keys2 = Object.keys(message.sourceProperties)).length) { - object.sourceProperties = {}; - for (var j = 0; j < keys2.length; ++j) - object.sourceProperties[keys2[j]] = $root.google.protobuf.Value.toObject(message.sourceProperties[keys2[j]], options); + if (message.listFindingsResults && message.listFindingsResults.length) { + object.listFindingsResults = []; + for (var j = 0; j < message.listFindingsResults.length; ++j) + object.listFindingsResults[j] = $root.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.toObject(message.listFindingsResults[j], options); } - if (message.securityMarks != null && message.hasOwnProperty("securityMarks")) - object.securityMarks = $root.google.cloud.securitycenter.v1.SecurityMarks.toObject(message.securityMarks, options); - if (message.eventTime != null && message.hasOwnProperty("eventTime")) - object.eventTime = $root.google.protobuf.Timestamp.toObject(message.eventTime, options); - if (message.createTime != null && message.hasOwnProperty("createTime")) - object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.readTime != null && message.hasOwnProperty("readTime")) + object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.totalSize != null && message.hasOwnProperty("totalSize")) + object.totalSize = message.totalSize; return object; }; /** - * Converts this Finding to JSON. + * Converts this ListFindingsResponse to JSON. * @function toJSON - * @memberof google.cloud.securitycenter.v1.Finding + * @memberof google.cloud.securitycenter.v1.ListFindingsResponse * @instance * @returns {Object.} JSON object */ - Finding.prototype.toJSON = function toJSON() { + ListFindingsResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - /** - * State enum. - * @name google.cloud.securitycenter.v1.Finding.State - * @enum {string} - * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value - * @property {number} ACTIVE=1 ACTIVE value - * @property {number} INACTIVE=2 INACTIVE value - */ - Finding.State = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; - values[valuesById[1] = "ACTIVE"] = 1; - values[valuesById[2] = "INACTIVE"] = 2; - return values; - })(); - - return Finding; - })(); + ListFindingsResponse.ListFindingsResult = (function() { - v1.OrganizationSettings = (function() { + /** + * Properties of a ListFindingsResult. + * @memberof google.cloud.securitycenter.v1.ListFindingsResponse + * @interface IListFindingsResult + * @property {google.cloud.securitycenter.v1.IFinding|null} [finding] ListFindingsResult finding + * @property {google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.StateChange|null} [stateChange] ListFindingsResult stateChange + * @property {google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.IResource|null} [resource] ListFindingsResult resource + */ - /** - * Properties of an OrganizationSettings. - * @memberof google.cloud.securitycenter.v1 - * @interface IOrganizationSettings - * @property {string|null} [name] OrganizationSettings name - * @property {boolean|null} [enableAssetDiscovery] OrganizationSettings enableAssetDiscovery - * @property {google.cloud.securitycenter.v1.OrganizationSettings.IAssetDiscoveryConfig|null} [assetDiscoveryConfig] OrganizationSettings assetDiscoveryConfig - */ + /** + * Constructs a new ListFindingsResult. + * @memberof google.cloud.securitycenter.v1.ListFindingsResponse + * @classdesc Represents a ListFindingsResult. + * @implements IListFindingsResult + * @constructor + * @param {google.cloud.securitycenter.v1.ListFindingsResponse.IListFindingsResult=} [properties] Properties to set + */ + function ListFindingsResult(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]]; + } - /** - * Constructs a new OrganizationSettings. - * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents an OrganizationSettings. - * @implements IOrganizationSettings - * @constructor - * @param {google.cloud.securitycenter.v1.IOrganizationSettings=} [properties] Properties to set - */ - function OrganizationSettings(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]]; - } + /** + * ListFindingsResult finding. + * @member {google.cloud.securitycenter.v1.IFinding|null|undefined} finding + * @memberof google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult + * @instance + */ + ListFindingsResult.prototype.finding = null; - /** - * OrganizationSettings name. - * @member {string} name - * @memberof google.cloud.securitycenter.v1.OrganizationSettings - * @instance - */ - OrganizationSettings.prototype.name = ""; + /** + * ListFindingsResult stateChange. + * @member {google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.StateChange} stateChange + * @memberof google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult + * @instance + */ + ListFindingsResult.prototype.stateChange = 0; - /** - * OrganizationSettings enableAssetDiscovery. - * @member {boolean} enableAssetDiscovery - * @memberof google.cloud.securitycenter.v1.OrganizationSettings - * @instance - */ - OrganizationSettings.prototype.enableAssetDiscovery = false; + /** + * ListFindingsResult resource. + * @member {google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.IResource|null|undefined} resource + * @memberof google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult + * @instance + */ + ListFindingsResult.prototype.resource = null; - /** - * OrganizationSettings assetDiscoveryConfig. - * @member {google.cloud.securitycenter.v1.OrganizationSettings.IAssetDiscoveryConfig|null|undefined} assetDiscoveryConfig - * @memberof google.cloud.securitycenter.v1.OrganizationSettings - * @instance - */ - OrganizationSettings.prototype.assetDiscoveryConfig = null; + /** + * Creates a new ListFindingsResult instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult + * @static + * @param {google.cloud.securitycenter.v1.ListFindingsResponse.IListFindingsResult=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult} ListFindingsResult instance + */ + ListFindingsResult.create = function create(properties) { + return new ListFindingsResult(properties); + }; - /** - * Creates a new OrganizationSettings instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v1.OrganizationSettings - * @static - * @param {google.cloud.securitycenter.v1.IOrganizationSettings=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.OrganizationSettings} OrganizationSettings instance - */ - OrganizationSettings.create = function create(properties) { - return new OrganizationSettings(properties); - }; + /** + * Encodes the specified ListFindingsResult message. Does not implicitly {@link google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult + * @static + * @param {google.cloud.securitycenter.v1.ListFindingsResponse.IListFindingsResult} message ListFindingsResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListFindingsResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.finding != null && message.hasOwnProperty("finding")) + $root.google.cloud.securitycenter.v1.Finding.encode(message.finding, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.stateChange != null && message.hasOwnProperty("stateChange")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.stateChange); + if (message.resource != null && message.hasOwnProperty("resource")) + $root.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource.encode(message.resource, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; - /** - * Encodes the specified OrganizationSettings message. Does not implicitly {@link google.cloud.securitycenter.v1.OrganizationSettings.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1.OrganizationSettings - * @static - * @param {google.cloud.securitycenter.v1.IOrganizationSettings} message OrganizationSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OrganizationSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.enableAssetDiscovery != null && message.hasOwnProperty("enableAssetDiscovery")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.enableAssetDiscovery); - if (message.assetDiscoveryConfig != null && message.hasOwnProperty("assetDiscoveryConfig")) - $root.google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.encode(message.assetDiscoveryConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified OrganizationSettings message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.OrganizationSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.OrganizationSettings - * @static - * @param {google.cloud.securitycenter.v1.IOrganizationSettings} message OrganizationSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OrganizationSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an OrganizationSettings message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v1.OrganizationSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.OrganizationSettings} OrganizationSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OrganizationSettings.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.cloud.securitycenter.v1.OrganizationSettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.enableAssetDiscovery = reader.bool(); - break; - case 3: - message.assetDiscoveryConfig = $root.google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an OrganizationSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.OrganizationSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.OrganizationSettings} OrganizationSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OrganizationSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an OrganizationSettings message. - * @function verify - * @memberof google.cloud.securitycenter.v1.OrganizationSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - OrganizationSettings.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.enableAssetDiscovery != null && message.hasOwnProperty("enableAssetDiscovery")) - if (typeof message.enableAssetDiscovery !== "boolean") - return "enableAssetDiscovery: boolean expected"; - if (message.assetDiscoveryConfig != null && message.hasOwnProperty("assetDiscoveryConfig")) { - var error = $root.google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.verify(message.assetDiscoveryConfig); - if (error) - return "assetDiscoveryConfig." + error; - } - return null; - }; - - /** - * Creates an OrganizationSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v1.OrganizationSettings - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.OrganizationSettings} OrganizationSettings - */ - OrganizationSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.OrganizationSettings) - return object; - var message = new $root.google.cloud.securitycenter.v1.OrganizationSettings(); - if (object.name != null) - message.name = String(object.name); - if (object.enableAssetDiscovery != null) - message.enableAssetDiscovery = Boolean(object.enableAssetDiscovery); - if (object.assetDiscoveryConfig != null) { - if (typeof object.assetDiscoveryConfig !== "object") - throw TypeError(".google.cloud.securitycenter.v1.OrganizationSettings.assetDiscoveryConfig: object expected"); - message.assetDiscoveryConfig = $root.google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.fromObject(object.assetDiscoveryConfig); - } - return message; - }; - - /** - * Creates a plain object from an OrganizationSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v1.OrganizationSettings - * @static - * @param {google.cloud.securitycenter.v1.OrganizationSettings} message OrganizationSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - OrganizationSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.enableAssetDiscovery = false; - object.assetDiscoveryConfig = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.enableAssetDiscovery != null && message.hasOwnProperty("enableAssetDiscovery")) - object.enableAssetDiscovery = message.enableAssetDiscovery; - if (message.assetDiscoveryConfig != null && message.hasOwnProperty("assetDiscoveryConfig")) - object.assetDiscoveryConfig = $root.google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.toObject(message.assetDiscoveryConfig, options); - return object; - }; - - /** - * Converts this OrganizationSettings to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1.OrganizationSettings - * @instance - * @returns {Object.} JSON object - */ - OrganizationSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - OrganizationSettings.AssetDiscoveryConfig = (function() { - - /** - * Properties of an AssetDiscoveryConfig. - * @memberof google.cloud.securitycenter.v1.OrganizationSettings - * @interface IAssetDiscoveryConfig - * @property {Array.|null} [projectIds] AssetDiscoveryConfig projectIds - * @property {google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode|null} [inclusionMode] AssetDiscoveryConfig inclusionMode - */ - - /** - * Constructs a new AssetDiscoveryConfig. - * @memberof google.cloud.securitycenter.v1.OrganizationSettings - * @classdesc Represents an AssetDiscoveryConfig. - * @implements IAssetDiscoveryConfig - * @constructor - * @param {google.cloud.securitycenter.v1.OrganizationSettings.IAssetDiscoveryConfig=} [properties] Properties to set - */ - function AssetDiscoveryConfig(properties) { - this.projectIds = []; - 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]]; - } - - /** - * AssetDiscoveryConfig projectIds. - * @member {Array.} projectIds - * @memberof google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig - * @instance - */ - AssetDiscoveryConfig.prototype.projectIds = $util.emptyArray; - - /** - * AssetDiscoveryConfig inclusionMode. - * @member {google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode} inclusionMode - * @memberof google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig - * @instance - */ - AssetDiscoveryConfig.prototype.inclusionMode = 0; - - /** - * Creates a new AssetDiscoveryConfig instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig - * @static - * @param {google.cloud.securitycenter.v1.OrganizationSettings.IAssetDiscoveryConfig=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig} AssetDiscoveryConfig instance - */ - AssetDiscoveryConfig.create = function create(properties) { - return new AssetDiscoveryConfig(properties); - }; - - /** - * Encodes the specified AssetDiscoveryConfig message. Does not implicitly {@link google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig - * @static - * @param {google.cloud.securitycenter.v1.OrganizationSettings.IAssetDiscoveryConfig} message AssetDiscoveryConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AssetDiscoveryConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.projectIds != null && message.projectIds.length) - for (var i = 0; i < message.projectIds.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectIds[i]); - if (message.inclusionMode != null && message.hasOwnProperty("inclusionMode")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.inclusionMode); - return writer; - }; - - /** - * Encodes the specified AssetDiscoveryConfig message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig - * @static - * @param {google.cloud.securitycenter.v1.OrganizationSettings.IAssetDiscoveryConfig} message AssetDiscoveryConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AssetDiscoveryConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Encodes the specified ListFindingsResult message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult + * @static + * @param {google.cloud.securitycenter.v1.ListFindingsResponse.IListFindingsResult} message ListFindingsResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListFindingsResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; /** - * Decodes an AssetDiscoveryConfig message from the specified reader or buffer. + * Decodes a ListFindingsResult message from the specified reader or buffer. * @function decode - * @memberof google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig + * @memberof google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig} AssetDiscoveryConfig + * @returns {google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult} ListFindingsResult * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - AssetDiscoveryConfig.decode = function decode(reader, length) { + ListFindingsResult.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.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - if (!(message.projectIds && message.projectIds.length)) - message.projectIds = []; - message.projectIds.push(reader.string()); + message.finding = $root.google.cloud.securitycenter.v1.Finding.decode(reader, reader.uint32()); break; case 2: - message.inclusionMode = reader.int32(); + message.stateChange = reader.int32(); + break; + case 3: + message.resource = $root.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -8507,166 +7719,463 @@ }; /** - * Decodes an AssetDiscoveryConfig message from the specified reader or buffer, length delimited. + * Decodes a ListFindingsResult message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig + * @memberof google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig} AssetDiscoveryConfig + * @returns {google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult} ListFindingsResult * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - AssetDiscoveryConfig.decodeDelimited = function decodeDelimited(reader) { + ListFindingsResult.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an AssetDiscoveryConfig message. + * Verifies a ListFindingsResult message. * @function verify - * @memberof google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig + * @memberof google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - AssetDiscoveryConfig.verify = function verify(message) { + ListFindingsResult.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.projectIds != null && message.hasOwnProperty("projectIds")) { - if (!Array.isArray(message.projectIds)) - return "projectIds: array expected"; - for (var i = 0; i < message.projectIds.length; ++i) - if (!$util.isString(message.projectIds[i])) - return "projectIds: string[] expected"; + if (message.finding != null && message.hasOwnProperty("finding")) { + var error = $root.google.cloud.securitycenter.v1.Finding.verify(message.finding); + if (error) + return "finding." + error; } - if (message.inclusionMode != null && message.hasOwnProperty("inclusionMode")) - switch (message.inclusionMode) { + if (message.stateChange != null && message.hasOwnProperty("stateChange")) + switch (message.stateChange) { default: - return "inclusionMode: enum value expected"; + return "stateChange: enum value expected"; case 0: case 1: case 2: + case 3: + case 4: break; } + if (message.resource != null && message.hasOwnProperty("resource")) { + var error = $root.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource.verify(message.resource); + if (error) + return "resource." + error; + } return null; }; /** - * Creates an AssetDiscoveryConfig message from a plain object. Also converts values to their respective internal types. + * Creates a ListFindingsResult message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig + * @memberof google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult * @static * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig} AssetDiscoveryConfig + * @returns {google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult} ListFindingsResult */ - AssetDiscoveryConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig) + ListFindingsResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult) return object; - var message = new $root.google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig(); - if (object.projectIds) { - if (!Array.isArray(object.projectIds)) - throw TypeError(".google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.projectIds: array expected"); - message.projectIds = []; - for (var i = 0; i < object.projectIds.length; ++i) - message.projectIds[i] = String(object.projectIds[i]); + var message = new $root.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult(); + if (object.finding != null) { + if (typeof object.finding !== "object") + throw TypeError(".google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.finding: object expected"); + message.finding = $root.google.cloud.securitycenter.v1.Finding.fromObject(object.finding); } - switch (object.inclusionMode) { - case "INCLUSION_MODE_UNSPECIFIED": + switch (object.stateChange) { + case "UNUSED": case 0: - message.inclusionMode = 0; + message.stateChange = 0; break; - case "INCLUDE_ONLY": + case "CHANGED": case 1: - message.inclusionMode = 1; + message.stateChange = 1; break; - case "EXCLUDE": + case "UNCHANGED": case 2: - message.inclusionMode = 2; + message.stateChange = 2; + break; + case "ADDED": + case 3: + message.stateChange = 3; + break; + case "REMOVED": + case 4: + message.stateChange = 4; break; } + if (object.resource != null) { + if (typeof object.resource !== "object") + throw TypeError(".google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.resource: object expected"); + message.resource = $root.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource.fromObject(object.resource); + } return message; }; /** - * Creates a plain object from an AssetDiscoveryConfig message. Also converts values to other types if specified. + * Creates a plain object from a ListFindingsResult message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig + * @memberof google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult * @static - * @param {google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig} message AssetDiscoveryConfig + * @param {google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult} message ListFindingsResult * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - AssetDiscoveryConfig.toObject = function toObject(message, options) { + ListFindingsResult.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.projectIds = []; - if (options.defaults) - object.inclusionMode = options.enums === String ? "INCLUSION_MODE_UNSPECIFIED" : 0; - if (message.projectIds && message.projectIds.length) { - object.projectIds = []; - for (var j = 0; j < message.projectIds.length; ++j) - object.projectIds[j] = message.projectIds[j]; + if (options.defaults) { + object.finding = null; + object.stateChange = options.enums === String ? "UNUSED" : 0; + object.resource = null; } - if (message.inclusionMode != null && message.hasOwnProperty("inclusionMode")) - object.inclusionMode = options.enums === String ? $root.google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode[message.inclusionMode] : message.inclusionMode; + if (message.finding != null && message.hasOwnProperty("finding")) + object.finding = $root.google.cloud.securitycenter.v1.Finding.toObject(message.finding, options); + if (message.stateChange != null && message.hasOwnProperty("stateChange")) + object.stateChange = options.enums === String ? $root.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.StateChange[message.stateChange] : message.stateChange; + if (message.resource != null && message.hasOwnProperty("resource")) + object.resource = $root.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource.toObject(message.resource, options); return object; }; /** - * Converts this AssetDiscoveryConfig to JSON. + * Converts this ListFindingsResult to JSON. * @function toJSON - * @memberof google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig + * @memberof google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult * @instance * @returns {Object.} JSON object */ - AssetDiscoveryConfig.prototype.toJSON = function toJSON() { + ListFindingsResult.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + ListFindingsResult.Resource = (function() { + + /** + * Properties of a Resource. + * @memberof google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult + * @interface IResource + * @property {string|null} [name] Resource name + * @property {string|null} [projectName] Resource projectName + * @property {string|null} [projectDisplayName] Resource projectDisplayName + * @property {string|null} [parentName] Resource parentName + * @property {string|null} [parentDisplayName] Resource parentDisplayName + */ + + /** + * Constructs a new Resource. + * @memberof google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult + * @classdesc Represents a Resource. + * @implements IResource + * @constructor + * @param {google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.IResource=} [properties] Properties to set + */ + function Resource(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]]; + } + + /** + * Resource name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource + * @instance + */ + Resource.prototype.name = ""; + + /** + * Resource projectName. + * @member {string} projectName + * @memberof google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource + * @instance + */ + Resource.prototype.projectName = ""; + + /** + * Resource projectDisplayName. + * @member {string} projectDisplayName + * @memberof google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource + * @instance + */ + Resource.prototype.projectDisplayName = ""; + + /** + * Resource parentName. + * @member {string} parentName + * @memberof google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource + * @instance + */ + Resource.prototype.parentName = ""; + + /** + * Resource parentDisplayName. + * @member {string} parentDisplayName + * @memberof google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource + * @instance + */ + Resource.prototype.parentDisplayName = ""; + + /** + * Creates a new Resource instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource + * @static + * @param {google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.IResource=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource} Resource instance + */ + Resource.create = function create(properties) { + return new Resource(properties); + }; + + /** + * Encodes the specified Resource message. Does not implicitly {@link google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource + * @static + * @param {google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.IResource} message Resource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Resource.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.projectName != null && message.hasOwnProperty("projectName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.projectName); + if (message.projectDisplayName != null && message.hasOwnProperty("projectDisplayName")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.projectDisplayName); + if (message.parentName != null && message.hasOwnProperty("parentName")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.parentName); + if (message.parentDisplayName != null && message.hasOwnProperty("parentDisplayName")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.parentDisplayName); + return writer; + }; + + /** + * Encodes the specified Resource message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource + * @static + * @param {google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.IResource} message Resource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Resource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Resource message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource} Resource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Resource.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.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.projectName = reader.string(); + break; + case 3: + message.projectDisplayName = reader.string(); + break; + case 4: + message.parentName = reader.string(); + break; + case 5: + message.parentDisplayName = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Resource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource} Resource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Resource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Resource message. + * @function verify + * @memberof google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Resource.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.projectName != null && message.hasOwnProperty("projectName")) + if (!$util.isString(message.projectName)) + return "projectName: string expected"; + if (message.projectDisplayName != null && message.hasOwnProperty("projectDisplayName")) + if (!$util.isString(message.projectDisplayName)) + return "projectDisplayName: string expected"; + if (message.parentName != null && message.hasOwnProperty("parentName")) + if (!$util.isString(message.parentName)) + return "parentName: string expected"; + if (message.parentDisplayName != null && message.hasOwnProperty("parentDisplayName")) + if (!$util.isString(message.parentDisplayName)) + return "parentDisplayName: string expected"; + return null; + }; + + /** + * Creates a Resource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource} Resource + */ + Resource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource) + return object; + var message = new $root.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource(); + if (object.name != null) + message.name = String(object.name); + if (object.projectName != null) + message.projectName = String(object.projectName); + if (object.projectDisplayName != null) + message.projectDisplayName = String(object.projectDisplayName); + if (object.parentName != null) + message.parentName = String(object.parentName); + if (object.parentDisplayName != null) + message.parentDisplayName = String(object.parentDisplayName); + return message; + }; + + /** + * Creates a plain object from a Resource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource + * @static + * @param {google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource} message Resource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Resource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.projectName = ""; + object.projectDisplayName = ""; + object.parentName = ""; + object.parentDisplayName = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.projectName != null && message.hasOwnProperty("projectName")) + object.projectName = message.projectName; + if (message.projectDisplayName != null && message.hasOwnProperty("projectDisplayName")) + object.projectDisplayName = message.projectDisplayName; + if (message.parentName != null && message.hasOwnProperty("parentName")) + object.parentName = message.parentName; + if (message.parentDisplayName != null && message.hasOwnProperty("parentDisplayName")) + object.parentDisplayName = message.parentDisplayName; + return object; + }; + + /** + * Converts this Resource to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource + * @instance + * @returns {Object.} JSON object + */ + Resource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Resource; + })(); + /** - * InclusionMode enum. - * @name google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode + * StateChange enum. + * @name google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.StateChange * @enum {string} - * @property {number} INCLUSION_MODE_UNSPECIFIED=0 INCLUSION_MODE_UNSPECIFIED value - * @property {number} INCLUDE_ONLY=1 INCLUDE_ONLY value - * @property {number} EXCLUDE=2 EXCLUDE value + * @property {number} UNUSED=0 UNUSED value + * @property {number} CHANGED=1 CHANGED value + * @property {number} UNCHANGED=2 UNCHANGED value + * @property {number} ADDED=3 ADDED value + * @property {number} REMOVED=4 REMOVED value */ - AssetDiscoveryConfig.InclusionMode = (function() { + ListFindingsResult.StateChange = (function() { var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "INCLUSION_MODE_UNSPECIFIED"] = 0; - values[valuesById[1] = "INCLUDE_ONLY"] = 1; - values[valuesById[2] = "EXCLUDE"] = 2; + values[valuesById[0] = "UNUSED"] = 0; + values[valuesById[1] = "CHANGED"] = 1; + values[valuesById[2] = "UNCHANGED"] = 2; + values[valuesById[3] = "ADDED"] = 3; + values[valuesById[4] = "REMOVED"] = 4; return values; })(); - return AssetDiscoveryConfig; + return ListFindingsResult; })(); - return OrganizationSettings; + return ListFindingsResponse; })(); - v1.RunAssetDiscoveryResponse = (function() { + v1.SetFindingStateRequest = (function() { /** - * Properties of a RunAssetDiscoveryResponse. + * Properties of a SetFindingStateRequest. * @memberof google.cloud.securitycenter.v1 - * @interface IRunAssetDiscoveryResponse - * @property {google.cloud.securitycenter.v1.RunAssetDiscoveryResponse.State|null} [state] RunAssetDiscoveryResponse state - * @property {google.protobuf.IDuration|null} [duration] RunAssetDiscoveryResponse duration + * @interface ISetFindingStateRequest + * @property {string|null} [name] SetFindingStateRequest name + * @property {google.cloud.securitycenter.v1.Finding.State|null} [state] SetFindingStateRequest state + * @property {google.protobuf.ITimestamp|null} [startTime] SetFindingStateRequest startTime */ /** - * Constructs a new RunAssetDiscoveryResponse. + * Constructs a new SetFindingStateRequest. * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents a RunAssetDiscoveryResponse. - * @implements IRunAssetDiscoveryResponse + * @classdesc Represents a SetFindingStateRequest. + * @implements ISetFindingStateRequest * @constructor - * @param {google.cloud.securitycenter.v1.IRunAssetDiscoveryResponse=} [properties] Properties to set + * @param {google.cloud.securitycenter.v1.ISetFindingStateRequest=} [properties] Properties to set */ - function RunAssetDiscoveryResponse(properties) { + function SetFindingStateRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -8674,88 +8183,101 @@ } /** - * RunAssetDiscoveryResponse state. - * @member {google.cloud.securitycenter.v1.RunAssetDiscoveryResponse.State} state - * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryResponse + * SetFindingStateRequest name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1.SetFindingStateRequest * @instance */ - RunAssetDiscoveryResponse.prototype.state = 0; + SetFindingStateRequest.prototype.name = ""; /** - * RunAssetDiscoveryResponse duration. - * @member {google.protobuf.IDuration|null|undefined} duration - * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryResponse + * SetFindingStateRequest state. + * @member {google.cloud.securitycenter.v1.Finding.State} state + * @memberof google.cloud.securitycenter.v1.SetFindingStateRequest * @instance */ - RunAssetDiscoveryResponse.prototype.duration = null; + SetFindingStateRequest.prototype.state = 0; /** - * Creates a new RunAssetDiscoveryResponse instance using the specified properties. + * SetFindingStateRequest startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.cloud.securitycenter.v1.SetFindingStateRequest + * @instance + */ + SetFindingStateRequest.prototype.startTime = null; + + /** + * Creates a new SetFindingStateRequest instance using the specified properties. * @function create - * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryResponse + * @memberof google.cloud.securitycenter.v1.SetFindingStateRequest * @static - * @param {google.cloud.securitycenter.v1.IRunAssetDiscoveryResponse=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.RunAssetDiscoveryResponse} RunAssetDiscoveryResponse instance + * @param {google.cloud.securitycenter.v1.ISetFindingStateRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.SetFindingStateRequest} SetFindingStateRequest instance */ - RunAssetDiscoveryResponse.create = function create(properties) { - return new RunAssetDiscoveryResponse(properties); + SetFindingStateRequest.create = function create(properties) { + return new SetFindingStateRequest(properties); }; /** - * Encodes the specified RunAssetDiscoveryResponse message. Does not implicitly {@link google.cloud.securitycenter.v1.RunAssetDiscoveryResponse.verify|verify} messages. + * Encodes the specified SetFindingStateRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.SetFindingStateRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryResponse + * @memberof google.cloud.securitycenter.v1.SetFindingStateRequest * @static - * @param {google.cloud.securitycenter.v1.IRunAssetDiscoveryResponse} message RunAssetDiscoveryResponse message or plain object to encode + * @param {google.cloud.securitycenter.v1.ISetFindingStateRequest} message SetFindingStateRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - RunAssetDiscoveryResponse.encode = function encode(message, writer) { + SetFindingStateRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); if (message.state != null && message.hasOwnProperty("state")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.state); - if (message.duration != null && message.hasOwnProperty("duration")) - $root.google.protobuf.Duration.encode(message.duration, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.state); + if (message.startTime != null && message.hasOwnProperty("startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; /** - * Encodes the specified RunAssetDiscoveryResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.RunAssetDiscoveryResponse.verify|verify} messages. + * Encodes the specified SetFindingStateRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.SetFindingStateRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryResponse + * @memberof google.cloud.securitycenter.v1.SetFindingStateRequest * @static - * @param {google.cloud.securitycenter.v1.IRunAssetDiscoveryResponse} message RunAssetDiscoveryResponse message or plain object to encode + * @param {google.cloud.securitycenter.v1.ISetFindingStateRequest} message SetFindingStateRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - RunAssetDiscoveryResponse.encodeDelimited = function encodeDelimited(message, writer) { + SetFindingStateRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a RunAssetDiscoveryResponse message from the specified reader or buffer. + * Decodes a SetFindingStateRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryResponse + * @memberof google.cloud.securitycenter.v1.SetFindingStateRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.RunAssetDiscoveryResponse} RunAssetDiscoveryResponse + * @returns {google.cloud.securitycenter.v1.SetFindingStateRequest} SetFindingStateRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - RunAssetDiscoveryResponse.decode = function decode(reader, length) { + SetFindingStateRequest.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.cloud.securitycenter.v1.RunAssetDiscoveryResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.SetFindingStateRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.state = reader.int32(); + message.name = reader.string(); break; case 2: - message.duration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + message.state = reader.int32(); + break; + case 3: + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -8766,32 +8288,35 @@ }; /** - * Decodes a RunAssetDiscoveryResponse message from the specified reader or buffer, length delimited. + * Decodes a SetFindingStateRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryResponse + * @memberof google.cloud.securitycenter.v1.SetFindingStateRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.RunAssetDiscoveryResponse} RunAssetDiscoveryResponse + * @returns {google.cloud.securitycenter.v1.SetFindingStateRequest} SetFindingStateRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - RunAssetDiscoveryResponse.decodeDelimited = function decodeDelimited(reader) { + SetFindingStateRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a RunAssetDiscoveryResponse message. + * Verifies a SetFindingStateRequest message. * @function verify - * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryResponse + * @memberof google.cloud.securitycenter.v1.SetFindingStateRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - RunAssetDiscoveryResponse.verify = function verify(message) { + SetFindingStateRequest.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.state != null && message.hasOwnProperty("state")) switch (message.state) { default: @@ -8799,131 +8324,111 @@ case 0: case 1: case 2: - case 3: break; } - if (message.duration != null && message.hasOwnProperty("duration")) { - var error = $root.google.protobuf.Duration.verify(message.duration); + if (message.startTime != null && message.hasOwnProperty("startTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.startTime); if (error) - return "duration." + error; + return "startTime." + error; } return null; }; /** - * Creates a RunAssetDiscoveryResponse message from a plain object. Also converts values to their respective internal types. + * Creates a SetFindingStateRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryResponse + * @memberof google.cloud.securitycenter.v1.SetFindingStateRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.RunAssetDiscoveryResponse} RunAssetDiscoveryResponse + * @returns {google.cloud.securitycenter.v1.SetFindingStateRequest} SetFindingStateRequest */ - RunAssetDiscoveryResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.RunAssetDiscoveryResponse) + SetFindingStateRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.SetFindingStateRequest) return object; - var message = new $root.google.cloud.securitycenter.v1.RunAssetDiscoveryResponse(); + var message = new $root.google.cloud.securitycenter.v1.SetFindingStateRequest(); + if (object.name != null) + message.name = String(object.name); switch (object.state) { case "STATE_UNSPECIFIED": case 0: message.state = 0; break; - case "COMPLETED": + case "ACTIVE": case 1: message.state = 1; break; - case "SUPERSEDED": + case "INACTIVE": case 2: message.state = 2; break; - case "TERMINATED": - case 3: - message.state = 3; - break; } - if (object.duration != null) { - if (typeof object.duration !== "object") - throw TypeError(".google.cloud.securitycenter.v1.RunAssetDiscoveryResponse.duration: object expected"); - message.duration = $root.google.protobuf.Duration.fromObject(object.duration); + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.cloud.securitycenter.v1.SetFindingStateRequest.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); } return message; }; /** - * Creates a plain object from a RunAssetDiscoveryResponse message. Also converts values to other types if specified. + * Creates a plain object from a SetFindingStateRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryResponse + * @memberof google.cloud.securitycenter.v1.SetFindingStateRequest * @static - * @param {google.cloud.securitycenter.v1.RunAssetDiscoveryResponse} message RunAssetDiscoveryResponse + * @param {google.cloud.securitycenter.v1.SetFindingStateRequest} message SetFindingStateRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - RunAssetDiscoveryResponse.toObject = function toObject(message, options) { + SetFindingStateRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { + object.name = ""; object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; - object.duration = null; + object.startTime = null; } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.securitycenter.v1.RunAssetDiscoveryResponse.State[message.state] : message.state; - if (message.duration != null && message.hasOwnProperty("duration")) - object.duration = $root.google.protobuf.Duration.toObject(message.duration, options); + object.state = options.enums === String ? $root.google.cloud.securitycenter.v1.Finding.State[message.state] : message.state; + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); return object; }; /** - * Converts this RunAssetDiscoveryResponse to JSON. + * Converts this SetFindingStateRequest to JSON. * @function toJSON - * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryResponse + * @memberof google.cloud.securitycenter.v1.SetFindingStateRequest * @instance * @returns {Object.} JSON object */ - RunAssetDiscoveryResponse.prototype.toJSON = function toJSON() { + SetFindingStateRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - /** - * State enum. - * @name google.cloud.securitycenter.v1.RunAssetDiscoveryResponse.State - * @enum {string} - * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value - * @property {number} COMPLETED=1 COMPLETED value - * @property {number} SUPERSEDED=2 SUPERSEDED value - * @property {number} TERMINATED=3 TERMINATED value - */ - RunAssetDiscoveryResponse.State = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; - values[valuesById[1] = "COMPLETED"] = 1; - values[valuesById[2] = "SUPERSEDED"] = 2; - values[valuesById[3] = "TERMINATED"] = 3; - return values; - })(); - - return RunAssetDiscoveryResponse; + return SetFindingStateRequest; })(); - v1.Source = (function() { + v1.RunAssetDiscoveryRequest = (function() { /** - * Properties of a Source. + * Properties of a RunAssetDiscoveryRequest. * @memberof google.cloud.securitycenter.v1 - * @interface ISource - * @property {string|null} [name] Source name - * @property {string|null} [displayName] Source displayName - * @property {string|null} [description] Source description + * @interface IRunAssetDiscoveryRequest + * @property {string|null} [parent] RunAssetDiscoveryRequest parent */ /** - * Constructs a new Source. + * Constructs a new RunAssetDiscoveryRequest. * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents a Source. - * @implements ISource + * @classdesc Represents a RunAssetDiscoveryRequest. + * @implements IRunAssetDiscoveryRequest * @constructor - * @param {google.cloud.securitycenter.v1.ISource=} [properties] Properties to set + * @param {google.cloud.securitycenter.v1.IRunAssetDiscoveryRequest=} [properties] Properties to set */ - function Source(properties) { + function RunAssetDiscoveryRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -8931,101 +8436,75 @@ } /** - * Source name. - * @member {string} name - * @memberof google.cloud.securitycenter.v1.Source - * @instance - */ - Source.prototype.name = ""; - - /** - * Source displayName. - * @member {string} displayName - * @memberof google.cloud.securitycenter.v1.Source - * @instance - */ - Source.prototype.displayName = ""; - - /** - * Source description. - * @member {string} description - * @memberof google.cloud.securitycenter.v1.Source + * RunAssetDiscoveryRequest parent. + * @member {string} parent + * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryRequest * @instance */ - Source.prototype.description = ""; + RunAssetDiscoveryRequest.prototype.parent = ""; /** - * Creates a new Source instance using the specified properties. + * Creates a new RunAssetDiscoveryRequest instance using the specified properties. * @function create - * @memberof google.cloud.securitycenter.v1.Source + * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryRequest * @static - * @param {google.cloud.securitycenter.v1.ISource=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.Source} Source instance + * @param {google.cloud.securitycenter.v1.IRunAssetDiscoveryRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.RunAssetDiscoveryRequest} RunAssetDiscoveryRequest instance */ - Source.create = function create(properties) { - return new Source(properties); + RunAssetDiscoveryRequest.create = function create(properties) { + return new RunAssetDiscoveryRequest(properties); }; /** - * Encodes the specified Source message. Does not implicitly {@link google.cloud.securitycenter.v1.Source.verify|verify} messages. + * Encodes the specified RunAssetDiscoveryRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.RunAssetDiscoveryRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.securitycenter.v1.Source + * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryRequest * @static - * @param {google.cloud.securitycenter.v1.ISource} message Source message or plain object to encode + * @param {google.cloud.securitycenter.v1.IRunAssetDiscoveryRequest} message RunAssetDiscoveryRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Source.encode = function encode(message, writer) { + RunAssetDiscoveryRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.displayName != null && message.hasOwnProperty("displayName")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); - if (message.description != null && message.hasOwnProperty("description")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + if (message.parent != null && message.hasOwnProperty("parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); return writer; }; /** - * Encodes the specified Source message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Source.verify|verify} messages. + * Encodes the specified RunAssetDiscoveryRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.RunAssetDiscoveryRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.Source + * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryRequest * @static - * @param {google.cloud.securitycenter.v1.ISource} message Source message or plain object to encode + * @param {google.cloud.securitycenter.v1.IRunAssetDiscoveryRequest} message RunAssetDiscoveryRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Source.encodeDelimited = function encodeDelimited(message, writer) { + RunAssetDiscoveryRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a Source message from the specified reader or buffer. + * Decodes a RunAssetDiscoveryRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.securitycenter.v1.Source + * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.Source} Source + * @returns {google.cloud.securitycenter.v1.RunAssetDiscoveryRequest} RunAssetDiscoveryRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Source.decode = function decode(reader, length) { + RunAssetDiscoveryRequest.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.cloud.securitycenter.v1.Source(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.RunAssetDiscoveryRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.name = reader.string(); - break; - case 2: - message.displayName = reader.string(); - break; - case 3: - message.description = reader.string(); + message.parent = reader.string(); break; default: reader.skipType(tag & 7); @@ -9036,869 +8515,871 @@ }; /** - * Decodes a Source message from the specified reader or buffer, length delimited. + * Decodes a RunAssetDiscoveryRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.Source + * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.Source} Source + * @returns {google.cloud.securitycenter.v1.RunAssetDiscoveryRequest} RunAssetDiscoveryRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Source.decodeDelimited = function decodeDelimited(reader) { + RunAssetDiscoveryRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a Source message. + * Verifies a RunAssetDiscoveryRequest message. * @function verify - * @memberof google.cloud.securitycenter.v1.Source + * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Source.verify = function verify(message) { + RunAssetDiscoveryRequest.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.displayName != null && message.hasOwnProperty("displayName")) - if (!$util.isString(message.displayName)) - return "displayName: string expected"; - if (message.description != null && message.hasOwnProperty("description")) - if (!$util.isString(message.description)) - return "description: string expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; return null; }; /** - * Creates a Source message from a plain object. Also converts values to their respective internal types. + * Creates a RunAssetDiscoveryRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.securitycenter.v1.Source + * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.Source} Source + * @returns {google.cloud.securitycenter.v1.RunAssetDiscoveryRequest} RunAssetDiscoveryRequest */ - Source.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.Source) + RunAssetDiscoveryRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.RunAssetDiscoveryRequest) return object; - var message = new $root.google.cloud.securitycenter.v1.Source(); - if (object.name != null) - message.name = String(object.name); - if (object.displayName != null) - message.displayName = String(object.displayName); - if (object.description != null) - message.description = String(object.description); + var message = new $root.google.cloud.securitycenter.v1.RunAssetDiscoveryRequest(); + if (object.parent != null) + message.parent = String(object.parent); return message; }; /** - * Creates a plain object from a Source message. Also converts values to other types if specified. + * Creates a plain object from a RunAssetDiscoveryRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.securitycenter.v1.Source + * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryRequest * @static - * @param {google.cloud.securitycenter.v1.Source} message Source + * @param {google.cloud.securitycenter.v1.RunAssetDiscoveryRequest} message RunAssetDiscoveryRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Source.toObject = function toObject(message, options) { + RunAssetDiscoveryRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.name = ""; - object.displayName = ""; - object.description = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.displayName != null && message.hasOwnProperty("displayName")) - object.displayName = message.displayName; - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; + if (options.defaults) + object.parent = ""; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; return object; }; /** - * Converts this Source to JSON. + * Converts this RunAssetDiscoveryRequest to JSON. * @function toJSON - * @memberof google.cloud.securitycenter.v1.Source + * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryRequest * @instance * @returns {Object.} JSON object */ - Source.prototype.toJSON = function toJSON() { + RunAssetDiscoveryRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return Source; + return RunAssetDiscoveryRequest; })(); - return v1; - })(); - - securitycenter.v1beta1 = (function() { - - /** - * Namespace v1beta1. - * @memberof google.cloud.securitycenter - * @namespace - */ - var v1beta1 = {}; - - v1beta1.SecurityCenter = (function() { + v1.UpdateFindingRequest = (function() { /** - * Constructs a new SecurityCenter service. - * @memberof google.cloud.securitycenter.v1beta1 - * @classdesc Represents a SecurityCenter - * @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 + * Properties of an UpdateFindingRequest. + * @memberof google.cloud.securitycenter.v1 + * @interface IUpdateFindingRequest + * @property {google.cloud.securitycenter.v1.IFinding|null} [finding] UpdateFindingRequest finding + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateFindingRequest updateMask */ - function SecurityCenter(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (SecurityCenter.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = SecurityCenter; /** - * Creates new SecurityCenter service using the specified rpc implementation. - * @function create - * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter - * @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 {SecurityCenter} RPC service. Useful where requests and/or responses are streamed. + * Constructs a new UpdateFindingRequest. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents an UpdateFindingRequest. + * @implements IUpdateFindingRequest + * @constructor + * @param {google.cloud.securitycenter.v1.IUpdateFindingRequest=} [properties] Properties to set */ - SecurityCenter.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; + function UpdateFindingRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } /** - * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter#createSource}. - * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter - * @typedef CreateSourceCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.securitycenter.v1beta1.Source} [response] Source + * UpdateFindingRequest finding. + * @member {google.cloud.securitycenter.v1.IFinding|null|undefined} finding + * @memberof google.cloud.securitycenter.v1.UpdateFindingRequest + * @instance */ + UpdateFindingRequest.prototype.finding = null; /** - * Calls CreateSource. - * @function createSource - * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * UpdateFindingRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.securitycenter.v1.UpdateFindingRequest * @instance - * @param {google.cloud.securitycenter.v1beta1.ICreateSourceRequest} request CreateSourceRequest message or plain object - * @param {google.cloud.securitycenter.v1beta1.SecurityCenter.CreateSourceCallback} callback Node-style callback called with the error, if any, and Source - * @returns {undefined} - * @variation 1 */ - Object.defineProperty(SecurityCenter.prototype.createSource = function createSource(request, callback) { - return this.rpcCall(createSource, $root.google.cloud.securitycenter.v1beta1.CreateSourceRequest, $root.google.cloud.securitycenter.v1beta1.Source, request, callback); - }, "name", { value: "CreateSource" }); + UpdateFindingRequest.prototype.updateMask = null; /** - * Calls CreateSource. - * @function createSource - * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1beta1.ICreateSourceRequest} request CreateSourceRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Creates a new UpdateFindingRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.UpdateFindingRequest + * @static + * @param {google.cloud.securitycenter.v1.IUpdateFindingRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.UpdateFindingRequest} UpdateFindingRequest instance */ + UpdateFindingRequest.create = function create(properties) { + return new UpdateFindingRequest(properties); + }; /** - * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter#createFinding}. - * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter - * @typedef CreateFindingCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.securitycenter.v1beta1.Finding} [response] Finding + * Encodes the specified UpdateFindingRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.UpdateFindingRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.UpdateFindingRequest + * @static + * @param {google.cloud.securitycenter.v1.IUpdateFindingRequest} message UpdateFindingRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ + UpdateFindingRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.finding != null && message.hasOwnProperty("finding")) + $root.google.cloud.securitycenter.v1.Finding.encode(message.finding, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; /** - * Calls CreateFinding. - * @function createFinding - * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1beta1.ICreateFindingRequest} request CreateFindingRequest message or plain object - * @param {google.cloud.securitycenter.v1beta1.SecurityCenter.CreateFindingCallback} callback Node-style callback called with the error, if any, and Finding - * @returns {undefined} - * @variation 1 + * Encodes the specified UpdateFindingRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.UpdateFindingRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.UpdateFindingRequest + * @static + * @param {google.cloud.securitycenter.v1.IUpdateFindingRequest} message UpdateFindingRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - Object.defineProperty(SecurityCenter.prototype.createFinding = function createFinding(request, callback) { - return this.rpcCall(createFinding, $root.google.cloud.securitycenter.v1beta1.CreateFindingRequest, $root.google.cloud.securitycenter.v1beta1.Finding, request, callback); - }, "name", { value: "CreateFinding" }); + UpdateFindingRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; /** - * Calls CreateFinding. - * @function createFinding - * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1beta1.ICreateFindingRequest} request CreateFindingRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Decodes an UpdateFindingRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.UpdateFindingRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.UpdateFindingRequest} UpdateFindingRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ + UpdateFindingRequest.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.cloud.securitycenter.v1.UpdateFindingRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.finding = $root.google.cloud.securitycenter.v1.Finding.decode(reader, reader.uint32()); + break; + case 2: + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; /** - * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter#getIamPolicy}. - * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter - * @typedef GetIamPolicyCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.iam.v1.Policy} [response] Policy + * Decodes an UpdateFindingRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.UpdateFindingRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.UpdateFindingRequest} UpdateFindingRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ + UpdateFindingRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; /** - * Calls GetIamPolicy. - * @function getIamPolicy - * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter - * @instance - * @param {google.iam.v1.IGetIamPolicyRequest} request GetIamPolicyRequest message or plain object - * @param {google.cloud.securitycenter.v1beta1.SecurityCenter.GetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy - * @returns {undefined} - * @variation 1 + * Verifies an UpdateFindingRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1.UpdateFindingRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Object.defineProperty(SecurityCenter.prototype.getIamPolicy = function getIamPolicy(request, callback) { - return this.rpcCall(getIamPolicy, $root.google.iam.v1.GetIamPolicyRequest, $root.google.iam.v1.Policy, request, callback); - }, "name", { value: "GetIamPolicy" }); + UpdateFindingRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.finding != null && message.hasOwnProperty("finding")) { + var error = $root.google.cloud.securitycenter.v1.Finding.verify(message.finding); + if (error) + return "finding." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + return null; + }; /** - * Calls GetIamPolicy. - * @function getIamPolicy - * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter - * @instance - * @param {google.iam.v1.IGetIamPolicyRequest} request GetIamPolicyRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Creates an UpdateFindingRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.UpdateFindingRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.UpdateFindingRequest} UpdateFindingRequest */ + UpdateFindingRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.UpdateFindingRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1.UpdateFindingRequest(); + if (object.finding != null) { + if (typeof object.finding !== "object") + throw TypeError(".google.cloud.securitycenter.v1.UpdateFindingRequest.finding: object expected"); + message.finding = $root.google.cloud.securitycenter.v1.Finding.fromObject(object.finding); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.securitycenter.v1.UpdateFindingRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; /** - * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter#getOrganizationSettings}. - * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter - * @typedef GetOrganizationSettingsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.securitycenter.v1beta1.OrganizationSettings} [response] OrganizationSettings + * Creates a plain object from an UpdateFindingRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.UpdateFindingRequest + * @static + * @param {google.cloud.securitycenter.v1.UpdateFindingRequest} message UpdateFindingRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object */ + UpdateFindingRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.finding = null; + object.updateMask = null; + } + if (message.finding != null && message.hasOwnProperty("finding")) + object.finding = $root.google.cloud.securitycenter.v1.Finding.toObject(message.finding, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; /** - * Calls GetOrganizationSettings. - * @function getOrganizationSettings - * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * Converts this UpdateFindingRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.UpdateFindingRequest * @instance - * @param {google.cloud.securitycenter.v1beta1.IGetOrganizationSettingsRequest} request GetOrganizationSettingsRequest message or plain object - * @param {google.cloud.securitycenter.v1beta1.SecurityCenter.GetOrganizationSettingsCallback} callback Node-style callback called with the error, if any, and OrganizationSettings - * @returns {undefined} - * @variation 1 + * @returns {Object.} JSON object */ - Object.defineProperty(SecurityCenter.prototype.getOrganizationSettings = function getOrganizationSettings(request, callback) { - return this.rpcCall(getOrganizationSettings, $root.google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest, $root.google.cloud.securitycenter.v1beta1.OrganizationSettings, request, callback); - }, "name", { value: "GetOrganizationSettings" }); + UpdateFindingRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Calls GetOrganizationSettings. - * @function getOrganizationSettings - * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1beta1.IGetOrganizationSettingsRequest} request GetOrganizationSettingsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ + return UpdateFindingRequest; + })(); + + v1.UpdateOrganizationSettingsRequest = (function() { /** - * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter#getSource}. - * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter - * @typedef GetSourceCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.securitycenter.v1beta1.Source} [response] Source + * Properties of an UpdateOrganizationSettingsRequest. + * @memberof google.cloud.securitycenter.v1 + * @interface IUpdateOrganizationSettingsRequest + * @property {google.cloud.securitycenter.v1.IOrganizationSettings|null} [organizationSettings] UpdateOrganizationSettingsRequest organizationSettings + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateOrganizationSettingsRequest updateMask */ /** - * Calls GetSource. - * @function getSource - * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1beta1.IGetSourceRequest} request GetSourceRequest message or plain object - * @param {google.cloud.securitycenter.v1beta1.SecurityCenter.GetSourceCallback} callback Node-style callback called with the error, if any, and Source - * @returns {undefined} - * @variation 1 + * Constructs a new UpdateOrganizationSettingsRequest. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents an UpdateOrganizationSettingsRequest. + * @implements IUpdateOrganizationSettingsRequest + * @constructor + * @param {google.cloud.securitycenter.v1.IUpdateOrganizationSettingsRequest=} [properties] Properties to set */ - Object.defineProperty(SecurityCenter.prototype.getSource = function getSource(request, callback) { - return this.rpcCall(getSource, $root.google.cloud.securitycenter.v1beta1.GetSourceRequest, $root.google.cloud.securitycenter.v1beta1.Source, request, callback); - }, "name", { value: "GetSource" }); + function UpdateOrganizationSettingsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } /** - * Calls GetSource. - * @function getSource - * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * UpdateOrganizationSettingsRequest organizationSettings. + * @member {google.cloud.securitycenter.v1.IOrganizationSettings|null|undefined} organizationSettings + * @memberof google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest * @instance - * @param {google.cloud.securitycenter.v1beta1.IGetSourceRequest} request GetSourceRequest message or plain object - * @returns {Promise} Promise - * @variation 2 */ + UpdateOrganizationSettingsRequest.prototype.organizationSettings = null; /** - * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter#groupAssets}. - * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter - * @typedef GroupAssetsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.securitycenter.v1beta1.GroupAssetsResponse} [response] GroupAssetsResponse + * UpdateOrganizationSettingsRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest + * @instance */ + UpdateOrganizationSettingsRequest.prototype.updateMask = null; /** - * Calls GroupAssets. - * @function groupAssets - * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1beta1.IGroupAssetsRequest} request GroupAssetsRequest message or plain object - * @param {google.cloud.securitycenter.v1beta1.SecurityCenter.GroupAssetsCallback} callback Node-style callback called with the error, if any, and GroupAssetsResponse - * @returns {undefined} - * @variation 1 + * Creates a new UpdateOrganizationSettingsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest + * @static + * @param {google.cloud.securitycenter.v1.IUpdateOrganizationSettingsRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest} UpdateOrganizationSettingsRequest instance */ - Object.defineProperty(SecurityCenter.prototype.groupAssets = function groupAssets(request, callback) { - return this.rpcCall(groupAssets, $root.google.cloud.securitycenter.v1beta1.GroupAssetsRequest, $root.google.cloud.securitycenter.v1beta1.GroupAssetsResponse, request, callback); - }, "name", { value: "GroupAssets" }); + UpdateOrganizationSettingsRequest.create = function create(properties) { + return new UpdateOrganizationSettingsRequest(properties); + }; /** - * Calls GroupAssets. - * @function groupAssets - * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1beta1.IGroupAssetsRequest} request GroupAssetsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Encodes the specified UpdateOrganizationSettingsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest + * @static + * @param {google.cloud.securitycenter.v1.IUpdateOrganizationSettingsRequest} message UpdateOrganizationSettingsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ + UpdateOrganizationSettingsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.organizationSettings != null && message.hasOwnProperty("organizationSettings")) + $root.google.cloud.securitycenter.v1.OrganizationSettings.encode(message.organizationSettings, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; /** - * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter#groupFindings}. - * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter - * @typedef GroupFindingsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.securitycenter.v1beta1.GroupFindingsResponse} [response] GroupFindingsResponse + * Encodes the specified UpdateOrganizationSettingsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest + * @static + * @param {google.cloud.securitycenter.v1.IUpdateOrganizationSettingsRequest} message UpdateOrganizationSettingsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ + UpdateOrganizationSettingsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; /** - * Calls GroupFindings. - * @function groupFindings - * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1beta1.IGroupFindingsRequest} request GroupFindingsRequest message or plain object - * @param {google.cloud.securitycenter.v1beta1.SecurityCenter.GroupFindingsCallback} callback Node-style callback called with the error, if any, and GroupFindingsResponse - * @returns {undefined} - * @variation 1 + * Decodes an UpdateOrganizationSettingsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest} UpdateOrganizationSettingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Object.defineProperty(SecurityCenter.prototype.groupFindings = function groupFindings(request, callback) { - return this.rpcCall(groupFindings, $root.google.cloud.securitycenter.v1beta1.GroupFindingsRequest, $root.google.cloud.securitycenter.v1beta1.GroupFindingsResponse, request, callback); - }, "name", { value: "GroupFindings" }); + UpdateOrganizationSettingsRequest.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.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.organizationSettings = $root.google.cloud.securitycenter.v1.OrganizationSettings.decode(reader, reader.uint32()); + break; + case 2: + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; /** - * Calls GroupFindings. - * @function groupFindings - * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1beta1.IGroupFindingsRequest} request GroupFindingsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Decodes an UpdateOrganizationSettingsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest} UpdateOrganizationSettingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ + UpdateOrganizationSettingsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; /** - * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter#listAssets}. - * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter - * @typedef ListAssetsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.securitycenter.v1beta1.ListAssetsResponse} [response] ListAssetsResponse + * Verifies an UpdateOrganizationSettingsRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not */ + UpdateOrganizationSettingsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.organizationSettings != null && message.hasOwnProperty("organizationSettings")) { + var error = $root.google.cloud.securitycenter.v1.OrganizationSettings.verify(message.organizationSettings); + if (error) + return "organizationSettings." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + return null; + }; /** - * Calls ListAssets. - * @function listAssets - * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1beta1.IListAssetsRequest} request ListAssetsRequest message or plain object - * @param {google.cloud.securitycenter.v1beta1.SecurityCenter.ListAssetsCallback} callback Node-style callback called with the error, if any, and ListAssetsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(SecurityCenter.prototype.listAssets = function listAssets(request, callback) { - return this.rpcCall(listAssets, $root.google.cloud.securitycenter.v1beta1.ListAssetsRequest, $root.google.cloud.securitycenter.v1beta1.ListAssetsResponse, request, callback); - }, "name", { value: "ListAssets" }); - - /** - * Calls ListAssets. - * @function listAssets - * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1beta1.IListAssetsRequest} request ListAssetsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Creates an UpdateOrganizationSettingsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest} UpdateOrganizationSettingsRequest */ + UpdateOrganizationSettingsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest(); + if (object.organizationSettings != null) { + if (typeof object.organizationSettings !== "object") + throw TypeError(".google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest.organizationSettings: object expected"); + message.organizationSettings = $root.google.cloud.securitycenter.v1.OrganizationSettings.fromObject(object.organizationSettings); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; /** - * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter#listFindings}. - * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter - * @typedef ListFindingsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.securitycenter.v1beta1.ListFindingsResponse} [response] ListFindingsResponse + * Creates a plain object from an UpdateOrganizationSettingsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest + * @static + * @param {google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest} message UpdateOrganizationSettingsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object */ + UpdateOrganizationSettingsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.organizationSettings = null; + object.updateMask = null; + } + if (message.organizationSettings != null && message.hasOwnProperty("organizationSettings")) + object.organizationSettings = $root.google.cloud.securitycenter.v1.OrganizationSettings.toObject(message.organizationSettings, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; /** - * Calls ListFindings. - * @function listFindings - * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * Converts this UpdateOrganizationSettingsRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest * @instance - * @param {google.cloud.securitycenter.v1beta1.IListFindingsRequest} request ListFindingsRequest message or plain object - * @param {google.cloud.securitycenter.v1beta1.SecurityCenter.ListFindingsCallback} callback Node-style callback called with the error, if any, and ListFindingsResponse - * @returns {undefined} - * @variation 1 + * @returns {Object.} JSON object */ - Object.defineProperty(SecurityCenter.prototype.listFindings = function listFindings(request, callback) { - return this.rpcCall(listFindings, $root.google.cloud.securitycenter.v1beta1.ListFindingsRequest, $root.google.cloud.securitycenter.v1beta1.ListFindingsResponse, request, callback); - }, "name", { value: "ListFindings" }); + UpdateOrganizationSettingsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return UpdateOrganizationSettingsRequest; + })(); + + v1.UpdateSourceRequest = (function() { /** - * Calls ListFindings. - * @function listFindings - * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1beta1.IListFindingsRequest} request ListFindingsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Properties of an UpdateSourceRequest. + * @memberof google.cloud.securitycenter.v1 + * @interface IUpdateSourceRequest + * @property {google.cloud.securitycenter.v1.ISource|null} [source] UpdateSourceRequest source + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateSourceRequest updateMask */ /** - * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter#listSources}. - * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter - * @typedef ListSourcesCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.securitycenter.v1beta1.ListSourcesResponse} [response] ListSourcesResponse + * Constructs a new UpdateSourceRequest. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents an UpdateSourceRequest. + * @implements IUpdateSourceRequest + * @constructor + * @param {google.cloud.securitycenter.v1.IUpdateSourceRequest=} [properties] Properties to set */ + function UpdateSourceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } /** - * Calls ListSources. - * @function listSources - * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * UpdateSourceRequest source. + * @member {google.cloud.securitycenter.v1.ISource|null|undefined} source + * @memberof google.cloud.securitycenter.v1.UpdateSourceRequest * @instance - * @param {google.cloud.securitycenter.v1beta1.IListSourcesRequest} request ListSourcesRequest message or plain object - * @param {google.cloud.securitycenter.v1beta1.SecurityCenter.ListSourcesCallback} callback Node-style callback called with the error, if any, and ListSourcesResponse - * @returns {undefined} - * @variation 1 */ - Object.defineProperty(SecurityCenter.prototype.listSources = function listSources(request, callback) { - return this.rpcCall(listSources, $root.google.cloud.securitycenter.v1beta1.ListSourcesRequest, $root.google.cloud.securitycenter.v1beta1.ListSourcesResponse, request, callback); - }, "name", { value: "ListSources" }); + UpdateSourceRequest.prototype.source = null; /** - * Calls ListSources. - * @function listSources - * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * UpdateSourceRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.securitycenter.v1.UpdateSourceRequest * @instance - * @param {google.cloud.securitycenter.v1beta1.IListSourcesRequest} request ListSourcesRequest message or plain object - * @returns {Promise} Promise - * @variation 2 */ + UpdateSourceRequest.prototype.updateMask = null; /** - * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter#runAssetDiscovery}. - * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter - * @typedef RunAssetDiscoveryCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation + * Creates a new UpdateSourceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.UpdateSourceRequest + * @static + * @param {google.cloud.securitycenter.v1.IUpdateSourceRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.UpdateSourceRequest} UpdateSourceRequest instance */ + UpdateSourceRequest.create = function create(properties) { + return new UpdateSourceRequest(properties); + }; /** - * Calls RunAssetDiscovery. - * @function runAssetDiscovery - * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1beta1.IRunAssetDiscoveryRequest} request RunAssetDiscoveryRequest message or plain object - * @param {google.cloud.securitycenter.v1beta1.SecurityCenter.RunAssetDiscoveryCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 + * Encodes the specified UpdateSourceRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.UpdateSourceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.UpdateSourceRequest + * @static + * @param {google.cloud.securitycenter.v1.IUpdateSourceRequest} message UpdateSourceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - Object.defineProperty(SecurityCenter.prototype.runAssetDiscovery = function runAssetDiscovery(request, callback) { - return this.rpcCall(runAssetDiscovery, $root.google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "RunAssetDiscovery" }); + UpdateSourceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.source != null && message.hasOwnProperty("source")) + $root.google.cloud.securitycenter.v1.Source.encode(message.source, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; /** - * Calls RunAssetDiscovery. - * @function runAssetDiscovery - * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1beta1.IRunAssetDiscoveryRequest} request RunAssetDiscoveryRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Encodes the specified UpdateSourceRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.UpdateSourceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.UpdateSourceRequest + * @static + * @param {google.cloud.securitycenter.v1.IUpdateSourceRequest} message UpdateSourceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ + UpdateSourceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; /** - * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter#setFindingState}. - * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter - * @typedef SetFindingStateCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.securitycenter.v1beta1.Finding} [response] Finding + * Decodes an UpdateSourceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.UpdateSourceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.UpdateSourceRequest} UpdateSourceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ + UpdateSourceRequest.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.cloud.securitycenter.v1.UpdateSourceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.source = $root.google.cloud.securitycenter.v1.Source.decode(reader, reader.uint32()); + break; + case 2: + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; /** - * Calls SetFindingState. - * @function setFindingState - * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1beta1.ISetFindingStateRequest} request SetFindingStateRequest message or plain object - * @param {google.cloud.securitycenter.v1beta1.SecurityCenter.SetFindingStateCallback} callback Node-style callback called with the error, if any, and Finding - * @returns {undefined} - * @variation 1 + * Decodes an UpdateSourceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.UpdateSourceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.UpdateSourceRequest} UpdateSourceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Object.defineProperty(SecurityCenter.prototype.setFindingState = function setFindingState(request, callback) { - return this.rpcCall(setFindingState, $root.google.cloud.securitycenter.v1beta1.SetFindingStateRequest, $root.google.cloud.securitycenter.v1beta1.Finding, request, callback); - }, "name", { value: "SetFindingState" }); + UpdateSourceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; /** - * Calls SetFindingState. - * @function setFindingState - * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1beta1.ISetFindingStateRequest} request SetFindingStateRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Verifies an UpdateSourceRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1.UpdateSourceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not */ + UpdateSourceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.source != null && message.hasOwnProperty("source")) { + var error = $root.google.cloud.securitycenter.v1.Source.verify(message.source); + if (error) + return "source." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + return null; + }; /** - * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter#setIamPolicy}. - * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter - * @typedef SetIamPolicyCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.iam.v1.Policy} [response] Policy + * Creates an UpdateSourceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.UpdateSourceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.UpdateSourceRequest} UpdateSourceRequest */ + UpdateSourceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.UpdateSourceRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1.UpdateSourceRequest(); + if (object.source != null) { + if (typeof object.source !== "object") + throw TypeError(".google.cloud.securitycenter.v1.UpdateSourceRequest.source: object expected"); + message.source = $root.google.cloud.securitycenter.v1.Source.fromObject(object.source); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.securitycenter.v1.UpdateSourceRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; /** - * Calls SetIamPolicy. - * @function setIamPolicy - * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter - * @instance - * @param {google.iam.v1.ISetIamPolicyRequest} request SetIamPolicyRequest message or plain object - * @param {google.cloud.securitycenter.v1beta1.SecurityCenter.SetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy - * @returns {undefined} - * @variation 1 + * Creates a plain object from an UpdateSourceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.UpdateSourceRequest + * @static + * @param {google.cloud.securitycenter.v1.UpdateSourceRequest} message UpdateSourceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object */ - Object.defineProperty(SecurityCenter.prototype.setIamPolicy = function setIamPolicy(request, callback) { - return this.rpcCall(setIamPolicy, $root.google.iam.v1.SetIamPolicyRequest, $root.google.iam.v1.Policy, request, callback); - }, "name", { value: "SetIamPolicy" }); + UpdateSourceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.source = null; + object.updateMask = null; + } + if (message.source != null && message.hasOwnProperty("source")) + object.source = $root.google.cloud.securitycenter.v1.Source.toObject(message.source, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; /** - * Calls SetIamPolicy. - * @function setIamPolicy - * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * Converts this UpdateSourceRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.UpdateSourceRequest * @instance - * @param {google.iam.v1.ISetIamPolicyRequest} request SetIamPolicyRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * @returns {Object.} JSON object */ + UpdateSourceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter#testIamPermissions}. - * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter - * @typedef TestIamPermissionsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.iam.v1.TestIamPermissionsResponse} [response] TestIamPermissionsResponse - */ + return UpdateSourceRequest; + })(); + + v1.UpdateSecurityMarksRequest = (function() { /** - * Calls TestIamPermissions. - * @function testIamPermissions - * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter - * @instance - * @param {google.iam.v1.ITestIamPermissionsRequest} request TestIamPermissionsRequest message or plain object - * @param {google.cloud.securitycenter.v1beta1.SecurityCenter.TestIamPermissionsCallback} callback Node-style callback called with the error, if any, and TestIamPermissionsResponse - * @returns {undefined} - * @variation 1 + * Properties of an UpdateSecurityMarksRequest. + * @memberof google.cloud.securitycenter.v1 + * @interface IUpdateSecurityMarksRequest + * @property {google.cloud.securitycenter.v1.ISecurityMarks|null} [securityMarks] UpdateSecurityMarksRequest securityMarks + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateSecurityMarksRequest updateMask + * @property {google.protobuf.ITimestamp|null} [startTime] UpdateSecurityMarksRequest startTime */ - Object.defineProperty(SecurityCenter.prototype.testIamPermissions = function testIamPermissions(request, callback) { - return this.rpcCall(testIamPermissions, $root.google.iam.v1.TestIamPermissionsRequest, $root.google.iam.v1.TestIamPermissionsResponse, request, callback); - }, "name", { value: "TestIamPermissions" }); /** - * Calls TestIamPermissions. - * @function testIamPermissions - * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter - * @instance - * @param {google.iam.v1.ITestIamPermissionsRequest} request TestIamPermissionsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Constructs a new UpdateSecurityMarksRequest. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents an UpdateSecurityMarksRequest. + * @implements IUpdateSecurityMarksRequest + * @constructor + * @param {google.cloud.securitycenter.v1.IUpdateSecurityMarksRequest=} [properties] Properties to set */ + function UpdateSecurityMarksRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } /** - * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter#updateFinding}. - * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter - * @typedef UpdateFindingCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.securitycenter.v1beta1.Finding} [response] Finding + * UpdateSecurityMarksRequest securityMarks. + * @member {google.cloud.securitycenter.v1.ISecurityMarks|null|undefined} securityMarks + * @memberof google.cloud.securitycenter.v1.UpdateSecurityMarksRequest + * @instance */ + UpdateSecurityMarksRequest.prototype.securityMarks = null; /** - * Calls UpdateFinding. - * @function updateFinding - * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * UpdateSecurityMarksRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.securitycenter.v1.UpdateSecurityMarksRequest * @instance - * @param {google.cloud.securitycenter.v1beta1.IUpdateFindingRequest} request UpdateFindingRequest message or plain object - * @param {google.cloud.securitycenter.v1beta1.SecurityCenter.UpdateFindingCallback} callback Node-style callback called with the error, if any, and Finding - * @returns {undefined} - * @variation 1 */ - Object.defineProperty(SecurityCenter.prototype.updateFinding = function updateFinding(request, callback) { - return this.rpcCall(updateFinding, $root.google.cloud.securitycenter.v1beta1.UpdateFindingRequest, $root.google.cloud.securitycenter.v1beta1.Finding, request, callback); - }, "name", { value: "UpdateFinding" }); + UpdateSecurityMarksRequest.prototype.updateMask = null; /** - * Calls UpdateFinding. - * @function updateFinding - * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * UpdateSecurityMarksRequest startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.cloud.securitycenter.v1.UpdateSecurityMarksRequest * @instance - * @param {google.cloud.securitycenter.v1beta1.IUpdateFindingRequest} request UpdateFindingRequest message or plain object - * @returns {Promise} Promise - * @variation 2 */ + UpdateSecurityMarksRequest.prototype.startTime = null; /** - * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter#updateOrganizationSettings}. - * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter - * @typedef UpdateOrganizationSettingsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.securitycenter.v1beta1.OrganizationSettings} [response] OrganizationSettings + * Creates a new UpdateSecurityMarksRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.UpdateSecurityMarksRequest + * @static + * @param {google.cloud.securitycenter.v1.IUpdateSecurityMarksRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.UpdateSecurityMarksRequest} UpdateSecurityMarksRequest instance */ + UpdateSecurityMarksRequest.create = function create(properties) { + return new UpdateSecurityMarksRequest(properties); + }; /** - * Calls UpdateOrganizationSettings. - * @function updateOrganizationSettings - * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1beta1.IUpdateOrganizationSettingsRequest} request UpdateOrganizationSettingsRequest message or plain object - * @param {google.cloud.securitycenter.v1beta1.SecurityCenter.UpdateOrganizationSettingsCallback} callback Node-style callback called with the error, if any, and OrganizationSettings - * @returns {undefined} - * @variation 1 + * Encodes the specified UpdateSecurityMarksRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.UpdateSecurityMarksRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.UpdateSecurityMarksRequest + * @static + * @param {google.cloud.securitycenter.v1.IUpdateSecurityMarksRequest} message UpdateSecurityMarksRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - Object.defineProperty(SecurityCenter.prototype.updateOrganizationSettings = function updateOrganizationSettings(request, callback) { - return this.rpcCall(updateOrganizationSettings, $root.google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest, $root.google.cloud.securitycenter.v1beta1.OrganizationSettings, request, callback); - }, "name", { value: "UpdateOrganizationSettings" }); + UpdateSecurityMarksRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.securityMarks != null && message.hasOwnProperty("securityMarks")) + $root.google.cloud.securitycenter.v1.SecurityMarks.encode(message.securityMarks, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.startTime != null && message.hasOwnProperty("startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; /** - * Calls UpdateOrganizationSettings. - * @function updateOrganizationSettings - * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1beta1.IUpdateOrganizationSettingsRequest} request UpdateOrganizationSettingsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Encodes the specified UpdateSecurityMarksRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.UpdateSecurityMarksRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.UpdateSecurityMarksRequest + * @static + * @param {google.cloud.securitycenter.v1.IUpdateSecurityMarksRequest} message UpdateSecurityMarksRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ + UpdateSecurityMarksRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; /** - * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter#updateSource}. - * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter - * @typedef UpdateSourceCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.securitycenter.v1beta1.Source} [response] Source - */ - - /** - * Calls UpdateSource. - * @function updateSource - * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1beta1.IUpdateSourceRequest} request UpdateSourceRequest message or plain object - * @param {google.cloud.securitycenter.v1beta1.SecurityCenter.UpdateSourceCallback} callback Node-style callback called with the error, if any, and Source - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(SecurityCenter.prototype.updateSource = function updateSource(request, callback) { - return this.rpcCall(updateSource, $root.google.cloud.securitycenter.v1beta1.UpdateSourceRequest, $root.google.cloud.securitycenter.v1beta1.Source, request, callback); - }, "name", { value: "UpdateSource" }); - - /** - * Calls UpdateSource. - * @function updateSource - * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1beta1.IUpdateSourceRequest} request UpdateSourceRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter#updateSecurityMarks}. - * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter - * @typedef UpdateSecurityMarksCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.securitycenter.v1beta1.SecurityMarks} [response] SecurityMarks - */ - - /** - * Calls UpdateSecurityMarks. - * @function updateSecurityMarks - * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1beta1.IUpdateSecurityMarksRequest} request UpdateSecurityMarksRequest message or plain object - * @param {google.cloud.securitycenter.v1beta1.SecurityCenter.UpdateSecurityMarksCallback} callback Node-style callback called with the error, if any, and SecurityMarks - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(SecurityCenter.prototype.updateSecurityMarks = function updateSecurityMarks(request, callback) { - return this.rpcCall(updateSecurityMarks, $root.google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest, $root.google.cloud.securitycenter.v1beta1.SecurityMarks, request, callback); - }, "name", { value: "UpdateSecurityMarks" }); - - /** - * Calls UpdateSecurityMarks. - * @function updateSecurityMarks - * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1beta1.IUpdateSecurityMarksRequest} request UpdateSecurityMarksRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return SecurityCenter; - })(); - - v1beta1.CreateFindingRequest = (function() { - - /** - * Properties of a CreateFindingRequest. - * @memberof google.cloud.securitycenter.v1beta1 - * @interface ICreateFindingRequest - * @property {string|null} [parent] CreateFindingRequest parent - * @property {string|null} [findingId] CreateFindingRequest findingId - * @property {google.cloud.securitycenter.v1beta1.IFinding|null} [finding] CreateFindingRequest finding - */ - - /** - * Constructs a new CreateFindingRequest. - * @memberof google.cloud.securitycenter.v1beta1 - * @classdesc Represents a CreateFindingRequest. - * @implements ICreateFindingRequest - * @constructor - * @param {google.cloud.securitycenter.v1beta1.ICreateFindingRequest=} [properties] Properties to set - */ - function CreateFindingRequest(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]]; - } - - /** - * CreateFindingRequest parent. - * @member {string} parent - * @memberof google.cloud.securitycenter.v1beta1.CreateFindingRequest - * @instance - */ - CreateFindingRequest.prototype.parent = ""; - - /** - * CreateFindingRequest findingId. - * @member {string} findingId - * @memberof google.cloud.securitycenter.v1beta1.CreateFindingRequest - * @instance - */ - CreateFindingRequest.prototype.findingId = ""; - - /** - * CreateFindingRequest finding. - * @member {google.cloud.securitycenter.v1beta1.IFinding|null|undefined} finding - * @memberof google.cloud.securitycenter.v1beta1.CreateFindingRequest - * @instance - */ - CreateFindingRequest.prototype.finding = null; - - /** - * Creates a new CreateFindingRequest instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v1beta1.CreateFindingRequest - * @static - * @param {google.cloud.securitycenter.v1beta1.ICreateFindingRequest=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1beta1.CreateFindingRequest} CreateFindingRequest instance - */ - CreateFindingRequest.create = function create(properties) { - return new CreateFindingRequest(properties); - }; - - /** - * Encodes the specified CreateFindingRequest message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.CreateFindingRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1beta1.CreateFindingRequest - * @static - * @param {google.cloud.securitycenter.v1beta1.ICreateFindingRequest} message CreateFindingRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateFindingRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && message.hasOwnProperty("parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.findingId != null && message.hasOwnProperty("findingId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.findingId); - if (message.finding != null && message.hasOwnProperty("finding")) - $root.google.cloud.securitycenter.v1beta1.Finding.encode(message.finding, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified CreateFindingRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.CreateFindingRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1beta1.CreateFindingRequest - * @static - * @param {google.cloud.securitycenter.v1beta1.ICreateFindingRequest} message CreateFindingRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateFindingRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CreateFindingRequest message from the specified reader or buffer. + * Decodes an UpdateSecurityMarksRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.securitycenter.v1beta1.CreateFindingRequest + * @memberof google.cloud.securitycenter.v1.UpdateSecurityMarksRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1beta1.CreateFindingRequest} CreateFindingRequest + * @returns {google.cloud.securitycenter.v1.UpdateSecurityMarksRequest} UpdateSecurityMarksRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateFindingRequest.decode = function decode(reader, length) { + UpdateSecurityMarksRequest.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.cloud.securitycenter.v1beta1.CreateFindingRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.UpdateSecurityMarksRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.parent = reader.string(); + message.securityMarks = $root.google.cloud.securitycenter.v1.SecurityMarks.decode(reader, reader.uint32()); break; case 2: - message.findingId = reader.string(); + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); break; case 3: - message.finding = $root.google.cloud.securitycenter.v1beta1.Finding.decode(reader, reader.uint32()); + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -9909,130 +9390,161 @@ }; /** - * Decodes a CreateFindingRequest message from the specified reader or buffer, length delimited. + * Decodes an UpdateSecurityMarksRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1beta1.CreateFindingRequest + * @memberof google.cloud.securitycenter.v1.UpdateSecurityMarksRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1beta1.CreateFindingRequest} CreateFindingRequest + * @returns {google.cloud.securitycenter.v1.UpdateSecurityMarksRequest} UpdateSecurityMarksRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateFindingRequest.decodeDelimited = function decodeDelimited(reader) { + UpdateSecurityMarksRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a CreateFindingRequest message. + * Verifies an UpdateSecurityMarksRequest message. * @function verify - * @memberof google.cloud.securitycenter.v1beta1.CreateFindingRequest + * @memberof google.cloud.securitycenter.v1.UpdateSecurityMarksRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - CreateFindingRequest.verify = function verify(message) { + UpdateSecurityMarksRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.findingId != null && message.hasOwnProperty("findingId")) - if (!$util.isString(message.findingId)) - return "findingId: string expected"; - if (message.finding != null && message.hasOwnProperty("finding")) { - var error = $root.google.cloud.securitycenter.v1beta1.Finding.verify(message.finding); + if (message.securityMarks != null && message.hasOwnProperty("securityMarks")) { + var error = $root.google.cloud.securitycenter.v1.SecurityMarks.verify(message.securityMarks); if (error) - return "finding." + error; + return "securityMarks." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + if (message.startTime != null && message.hasOwnProperty("startTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.startTime); + if (error) + return "startTime." + error; } return null; }; /** - * Creates a CreateFindingRequest message from a plain object. Also converts values to their respective internal types. + * Creates an UpdateSecurityMarksRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.securitycenter.v1beta1.CreateFindingRequest + * @memberof google.cloud.securitycenter.v1.UpdateSecurityMarksRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1beta1.CreateFindingRequest} CreateFindingRequest + * @returns {google.cloud.securitycenter.v1.UpdateSecurityMarksRequest} UpdateSecurityMarksRequest */ - CreateFindingRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1beta1.CreateFindingRequest) + UpdateSecurityMarksRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.UpdateSecurityMarksRequest) return object; - var message = new $root.google.cloud.securitycenter.v1beta1.CreateFindingRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.findingId != null) - message.findingId = String(object.findingId); - if (object.finding != null) { - if (typeof object.finding !== "object") - throw TypeError(".google.cloud.securitycenter.v1beta1.CreateFindingRequest.finding: object expected"); - message.finding = $root.google.cloud.securitycenter.v1beta1.Finding.fromObject(object.finding); + var message = new $root.google.cloud.securitycenter.v1.UpdateSecurityMarksRequest(); + if (object.securityMarks != null) { + if (typeof object.securityMarks !== "object") + throw TypeError(".google.cloud.securitycenter.v1.UpdateSecurityMarksRequest.securityMarks: object expected"); + message.securityMarks = $root.google.cloud.securitycenter.v1.SecurityMarks.fromObject(object.securityMarks); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.securitycenter.v1.UpdateSecurityMarksRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.cloud.securitycenter.v1.UpdateSecurityMarksRequest.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); } return message; }; /** - * Creates a plain object from a CreateFindingRequest message. Also converts values to other types if specified. + * Creates a plain object from an UpdateSecurityMarksRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.securitycenter.v1beta1.CreateFindingRequest + * @memberof google.cloud.securitycenter.v1.UpdateSecurityMarksRequest * @static - * @param {google.cloud.securitycenter.v1beta1.CreateFindingRequest} message CreateFindingRequest + * @param {google.cloud.securitycenter.v1.UpdateSecurityMarksRequest} message UpdateSecurityMarksRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CreateFindingRequest.toObject = function toObject(message, options) { + UpdateSecurityMarksRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.parent = ""; - object.findingId = ""; - object.finding = null; + object.securityMarks = null; + object.updateMask = null; + object.startTime = null; } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.findingId != null && message.hasOwnProperty("findingId")) - object.findingId = message.findingId; - if (message.finding != null && message.hasOwnProperty("finding")) - object.finding = $root.google.cloud.securitycenter.v1beta1.Finding.toObject(message.finding, options); + if (message.securityMarks != null && message.hasOwnProperty("securityMarks")) + object.securityMarks = $root.google.cloud.securitycenter.v1.SecurityMarks.toObject(message.securityMarks, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); return object; }; /** - * Converts this CreateFindingRequest to JSON. + * Converts this UpdateSecurityMarksRequest to JSON. * @function toJSON - * @memberof google.cloud.securitycenter.v1beta1.CreateFindingRequest + * @memberof google.cloud.securitycenter.v1.UpdateSecurityMarksRequest * @instance * @returns {Object.} JSON object */ - CreateFindingRequest.prototype.toJSON = function toJSON() { + UpdateSecurityMarksRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return CreateFindingRequest; + return UpdateSecurityMarksRequest; })(); - v1beta1.CreateSourceRequest = (function() { + return v1; + })(); + + securitycenter.v1beta1 = (function() { + + /** + * Namespace v1beta1. + * @memberof google.cloud.securitycenter + * @namespace + */ + var v1beta1 = {}; + + v1beta1.Finding = (function() { /** - * Properties of a CreateSourceRequest. + * Properties of a Finding. * @memberof google.cloud.securitycenter.v1beta1 - * @interface ICreateSourceRequest - * @property {string|null} [parent] CreateSourceRequest parent - * @property {google.cloud.securitycenter.v1beta1.ISource|null} [source] CreateSourceRequest source + * @interface IFinding + * @property {string|null} [name] Finding name + * @property {string|null} [parent] Finding parent + * @property {string|null} [resourceName] Finding resourceName + * @property {google.cloud.securitycenter.v1beta1.Finding.State|null} [state] Finding state + * @property {string|null} [category] Finding category + * @property {string|null} [externalUri] Finding externalUri + * @property {Object.|null} [sourceProperties] Finding sourceProperties + * @property {google.cloud.securitycenter.v1beta1.ISecurityMarks|null} [securityMarks] Finding securityMarks + * @property {google.protobuf.ITimestamp|null} [eventTime] Finding eventTime + * @property {google.protobuf.ITimestamp|null} [createTime] Finding createTime */ /** - * Constructs a new CreateSourceRequest. + * Constructs a new Finding. * @memberof google.cloud.securitycenter.v1beta1 - * @classdesc Represents a CreateSourceRequest. - * @implements ICreateSourceRequest + * @classdesc Represents a Finding. + * @implements IFinding * @constructor - * @param {google.cloud.securitycenter.v1beta1.ICreateSourceRequest=} [properties] Properties to set + * @param {google.cloud.securitycenter.v1beta1.IFinding=} [properties] Properties to set */ - function CreateSourceRequest(properties) { + function Finding(properties) { + this.sourceProperties = {}; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -10040,88 +9552,200 @@ } /** - * CreateSourceRequest parent. + * Finding name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1beta1.Finding + * @instance + */ + Finding.prototype.name = ""; + + /** + * Finding parent. * @member {string} parent - * @memberof google.cloud.securitycenter.v1beta1.CreateSourceRequest + * @memberof google.cloud.securitycenter.v1beta1.Finding * @instance */ - CreateSourceRequest.prototype.parent = ""; + Finding.prototype.parent = ""; /** - * CreateSourceRequest source. - * @member {google.cloud.securitycenter.v1beta1.ISource|null|undefined} source - * @memberof google.cloud.securitycenter.v1beta1.CreateSourceRequest + * Finding resourceName. + * @member {string} resourceName + * @memberof google.cloud.securitycenter.v1beta1.Finding * @instance */ - CreateSourceRequest.prototype.source = null; + Finding.prototype.resourceName = ""; /** - * Creates a new CreateSourceRequest instance using the specified properties. + * Finding state. + * @member {google.cloud.securitycenter.v1beta1.Finding.State} state + * @memberof google.cloud.securitycenter.v1beta1.Finding + * @instance + */ + Finding.prototype.state = 0; + + /** + * Finding category. + * @member {string} category + * @memberof google.cloud.securitycenter.v1beta1.Finding + * @instance + */ + Finding.prototype.category = ""; + + /** + * Finding externalUri. + * @member {string} externalUri + * @memberof google.cloud.securitycenter.v1beta1.Finding + * @instance + */ + Finding.prototype.externalUri = ""; + + /** + * Finding sourceProperties. + * @member {Object.} sourceProperties + * @memberof google.cloud.securitycenter.v1beta1.Finding + * @instance + */ + Finding.prototype.sourceProperties = $util.emptyObject; + + /** + * Finding securityMarks. + * @member {google.cloud.securitycenter.v1beta1.ISecurityMarks|null|undefined} securityMarks + * @memberof google.cloud.securitycenter.v1beta1.Finding + * @instance + */ + Finding.prototype.securityMarks = null; + + /** + * Finding eventTime. + * @member {google.protobuf.ITimestamp|null|undefined} eventTime + * @memberof google.cloud.securitycenter.v1beta1.Finding + * @instance + */ + Finding.prototype.eventTime = null; + + /** + * Finding createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.securitycenter.v1beta1.Finding + * @instance + */ + Finding.prototype.createTime = null; + + /** + * Creates a new Finding instance using the specified properties. * @function create - * @memberof google.cloud.securitycenter.v1beta1.CreateSourceRequest + * @memberof google.cloud.securitycenter.v1beta1.Finding * @static - * @param {google.cloud.securitycenter.v1beta1.ICreateSourceRequest=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1beta1.CreateSourceRequest} CreateSourceRequest instance + * @param {google.cloud.securitycenter.v1beta1.IFinding=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1beta1.Finding} Finding instance */ - CreateSourceRequest.create = function create(properties) { - return new CreateSourceRequest(properties); + Finding.create = function create(properties) { + return new Finding(properties); }; /** - * Encodes the specified CreateSourceRequest message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.CreateSourceRequest.verify|verify} messages. + * Encodes the specified Finding message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.Finding.verify|verify} messages. * @function encode - * @memberof google.cloud.securitycenter.v1beta1.CreateSourceRequest + * @memberof google.cloud.securitycenter.v1beta1.Finding * @static - * @param {google.cloud.securitycenter.v1beta1.ICreateSourceRequest} message CreateSourceRequest message or plain object to encode + * @param {google.cloud.securitycenter.v1beta1.IFinding} message Finding message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateSourceRequest.encode = function encode(message, writer) { + Finding.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); if (message.parent != null && message.hasOwnProperty("parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.source != null && message.hasOwnProperty("source")) - $root.google.cloud.securitycenter.v1beta1.Source.encode(message.source, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + writer.uint32(/* id 2, wireType 2 =*/18).string(message.parent); + if (message.resourceName != null && message.hasOwnProperty("resourceName")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.resourceName); + if (message.state != null && message.hasOwnProperty("state")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.state); + if (message.category != null && message.hasOwnProperty("category")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.category); + if (message.externalUri != null && message.hasOwnProperty("externalUri")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.externalUri); + if (message.sourceProperties != null && message.hasOwnProperty("sourceProperties")) + for (var keys = Object.keys(message.sourceProperties), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 7, wireType 2 =*/58).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.protobuf.Value.encode(message.sourceProperties[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.securityMarks != null && message.hasOwnProperty("securityMarks")) + $root.google.cloud.securitycenter.v1beta1.SecurityMarks.encode(message.securityMarks, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.eventTime != null && message.hasOwnProperty("eventTime")) + $root.google.protobuf.Timestamp.encode(message.eventTime, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.createTime != null && message.hasOwnProperty("createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); return writer; }; /** - * Encodes the specified CreateSourceRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.CreateSourceRequest.verify|verify} messages. + * Encodes the specified Finding message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.Finding.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1beta1.CreateSourceRequest + * @memberof google.cloud.securitycenter.v1beta1.Finding * @static - * @param {google.cloud.securitycenter.v1beta1.ICreateSourceRequest} message CreateSourceRequest message or plain object to encode + * @param {google.cloud.securitycenter.v1beta1.IFinding} message Finding message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateSourceRequest.encodeDelimited = function encodeDelimited(message, writer) { + Finding.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a CreateSourceRequest message from the specified reader or buffer. + * Decodes a Finding message from the specified reader or buffer. * @function decode - * @memberof google.cloud.securitycenter.v1beta1.CreateSourceRequest + * @memberof google.cloud.securitycenter.v1beta1.Finding * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1beta1.CreateSourceRequest} CreateSourceRequest + * @returns {google.cloud.securitycenter.v1beta1.Finding} Finding * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateSourceRequest.decode = function decode(reader, length) { + Finding.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.cloud.securitycenter.v1beta1.CreateSourceRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1beta1.Finding(), key; while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.parent = reader.string(); + message.name = reader.string(); break; case 2: - message.source = $root.google.cloud.securitycenter.v1beta1.Source.decode(reader, reader.uint32()); + message.parent = reader.string(); + break; + case 3: + message.resourceName = reader.string(); + break; + case 4: + message.state = reader.int32(); + break; + case 5: + message.category = reader.string(); + break; + case 6: + message.externalUri = reader.string(); + break; + case 7: + reader.skip().pos++; + if (message.sourceProperties === $util.emptyObject) + message.sourceProperties = {}; + key = reader.string(); + reader.pos++; + message.sourceProperties[key] = $root.google.protobuf.Value.decode(reader, reader.uint32()); + break; + case 8: + message.securityMarks = $root.google.cloud.securitycenter.v1beta1.SecurityMarks.decode(reader, reader.uint32()); + break; + case 9: + message.eventTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 10: + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -10132,121 +9756,251 @@ }; /** - * Decodes a CreateSourceRequest message from the specified reader or buffer, length delimited. + * Decodes a Finding message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1beta1.CreateSourceRequest + * @memberof google.cloud.securitycenter.v1beta1.Finding * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1beta1.CreateSourceRequest} CreateSourceRequest + * @returns {google.cloud.securitycenter.v1beta1.Finding} Finding * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateSourceRequest.decodeDelimited = function decodeDelimited(reader) { + Finding.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a CreateSourceRequest message. + * Verifies a Finding message. * @function verify - * @memberof google.cloud.securitycenter.v1beta1.CreateSourceRequest + * @memberof google.cloud.securitycenter.v1beta1.Finding * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - CreateSourceRequest.verify = function verify(message) { + Finding.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) return "parent: string expected"; - if (message.source != null && message.hasOwnProperty("source")) { - var error = $root.google.cloud.securitycenter.v1beta1.Source.verify(message.source); + if (message.resourceName != null && message.hasOwnProperty("resourceName")) + if (!$util.isString(message.resourceName)) + return "resourceName: string expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: 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"; + if (message.externalUri != null && message.hasOwnProperty("externalUri")) + if (!$util.isString(message.externalUri)) + return "externalUri: string expected"; + if (message.sourceProperties != null && message.hasOwnProperty("sourceProperties")) { + if (!$util.isObject(message.sourceProperties)) + return "sourceProperties: object expected"; + var key = Object.keys(message.sourceProperties); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.protobuf.Value.verify(message.sourceProperties[key[i]]); + if (error) + return "sourceProperties." + error; + } + } + if (message.securityMarks != null && message.hasOwnProperty("securityMarks")) { + var error = $root.google.cloud.securitycenter.v1beta1.SecurityMarks.verify(message.securityMarks); if (error) - return "source." + error; + return "securityMarks." + error; + } + if (message.eventTime != null && message.hasOwnProperty("eventTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.eventTime); + if (error) + return "eventTime." + error; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; } return null; }; /** - * Creates a CreateSourceRequest message from a plain object. Also converts values to their respective internal types. + * Creates a Finding message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.securitycenter.v1beta1.CreateSourceRequest + * @memberof google.cloud.securitycenter.v1beta1.Finding * @static * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1beta1.CreateSourceRequest} CreateSourceRequest + * @returns {google.cloud.securitycenter.v1beta1.Finding} Finding */ - CreateSourceRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1beta1.CreateSourceRequest) + Finding.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1beta1.Finding) return object; - var message = new $root.google.cloud.securitycenter.v1beta1.CreateSourceRequest(); + var message = new $root.google.cloud.securitycenter.v1beta1.Finding(); + if (object.name != null) + message.name = String(object.name); if (object.parent != null) message.parent = String(object.parent); - if (object.source != null) { - if (typeof object.source !== "object") - throw TypeError(".google.cloud.securitycenter.v1beta1.CreateSourceRequest.source: object expected"); - message.source = $root.google.cloud.securitycenter.v1beta1.Source.fromObject(object.source); + if (object.resourceName != null) + message.resourceName = String(object.resourceName); + switch (object.state) { + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "ACTIVE": + case 1: + message.state = 1; + break; + case "INACTIVE": + case 2: + message.state = 2; + break; + } + if (object.category != null) + message.category = String(object.category); + if (object.externalUri != null) + message.externalUri = String(object.externalUri); + if (object.sourceProperties) { + if (typeof object.sourceProperties !== "object") + throw TypeError(".google.cloud.securitycenter.v1beta1.Finding.sourceProperties: object expected"); + message.sourceProperties = {}; + for (var keys = Object.keys(object.sourceProperties), i = 0; i < keys.length; ++i) { + if (typeof object.sourceProperties[keys[i]] !== "object") + throw TypeError(".google.cloud.securitycenter.v1beta1.Finding.sourceProperties: object expected"); + message.sourceProperties[keys[i]] = $root.google.protobuf.Value.fromObject(object.sourceProperties[keys[i]]); + } + } + if (object.securityMarks != null) { + if (typeof object.securityMarks !== "object") + throw TypeError(".google.cloud.securitycenter.v1beta1.Finding.securityMarks: object expected"); + message.securityMarks = $root.google.cloud.securitycenter.v1beta1.SecurityMarks.fromObject(object.securityMarks); + } + if (object.eventTime != null) { + if (typeof object.eventTime !== "object") + throw TypeError(".google.cloud.securitycenter.v1beta1.Finding.eventTime: object expected"); + message.eventTime = $root.google.protobuf.Timestamp.fromObject(object.eventTime); + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.securitycenter.v1beta1.Finding.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); } return message; }; /** - * Creates a plain object from a CreateSourceRequest message. Also converts values to other types if specified. + * Creates a plain object from a Finding message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.securitycenter.v1beta1.CreateSourceRequest + * @memberof google.cloud.securitycenter.v1beta1.Finding * @static - * @param {google.cloud.securitycenter.v1beta1.CreateSourceRequest} message CreateSourceRequest + * @param {google.cloud.securitycenter.v1beta1.Finding} message Finding * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CreateSourceRequest.toObject = function toObject(message, options) { + Finding.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; + if (options.objects || options.defaults) + object.sourceProperties = {}; if (options.defaults) { + object.name = ""; object.parent = ""; - object.source = null; + object.resourceName = ""; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.category = ""; + object.externalUri = ""; + object.securityMarks = null; + object.eventTime = null; + object.createTime = null; } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; if (message.parent != null && message.hasOwnProperty("parent")) object.parent = message.parent; - if (message.source != null && message.hasOwnProperty("source")) - object.source = $root.google.cloud.securitycenter.v1beta1.Source.toObject(message.source, options); + if (message.resourceName != null && message.hasOwnProperty("resourceName")) + object.resourceName = message.resourceName; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.securitycenter.v1beta1.Finding.State[message.state] : message.state; + if (message.category != null && message.hasOwnProperty("category")) + object.category = message.category; + if (message.externalUri != null && message.hasOwnProperty("externalUri")) + object.externalUri = message.externalUri; + var keys2; + if (message.sourceProperties && (keys2 = Object.keys(message.sourceProperties)).length) { + object.sourceProperties = {}; + for (var j = 0; j < keys2.length; ++j) + object.sourceProperties[keys2[j]] = $root.google.protobuf.Value.toObject(message.sourceProperties[keys2[j]], options); + } + if (message.securityMarks != null && message.hasOwnProperty("securityMarks")) + object.securityMarks = $root.google.cloud.securitycenter.v1beta1.SecurityMarks.toObject(message.securityMarks, options); + if (message.eventTime != null && message.hasOwnProperty("eventTime")) + object.eventTime = $root.google.protobuf.Timestamp.toObject(message.eventTime, options); + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); return object; }; /** - * Converts this CreateSourceRequest to JSON. + * Converts this Finding to JSON. * @function toJSON - * @memberof google.cloud.securitycenter.v1beta1.CreateSourceRequest + * @memberof google.cloud.securitycenter.v1beta1.Finding * @instance * @returns {Object.} JSON object */ - CreateSourceRequest.prototype.toJSON = function toJSON() { + Finding.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return CreateSourceRequest; + /** + * State enum. + * @name google.cloud.securitycenter.v1beta1.Finding.State + * @enum {string} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} ACTIVE=1 ACTIVE value + * @property {number} INACTIVE=2 INACTIVE value + */ + Finding.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ACTIVE"] = 1; + values[valuesById[2] = "INACTIVE"] = 2; + return values; + })(); + + return Finding; })(); - v1beta1.GetOrganizationSettingsRequest = (function() { + v1beta1.SecurityMarks = (function() { /** - * Properties of a GetOrganizationSettingsRequest. + * Properties of a SecurityMarks. * @memberof google.cloud.securitycenter.v1beta1 - * @interface IGetOrganizationSettingsRequest - * @property {string|null} [name] GetOrganizationSettingsRequest name + * @interface ISecurityMarks + * @property {string|null} [name] SecurityMarks name + * @property {Object.|null} [marks] SecurityMarks marks */ /** - * Constructs a new GetOrganizationSettingsRequest. + * Constructs a new SecurityMarks. * @memberof google.cloud.securitycenter.v1beta1 - * @classdesc Represents a GetOrganizationSettingsRequest. - * @implements IGetOrganizationSettingsRequest + * @classdesc Represents a SecurityMarks. + * @implements ISecurityMarks * @constructor - * @param {google.cloud.securitycenter.v1beta1.IGetOrganizationSettingsRequest=} [properties] Properties to set + * @param {google.cloud.securitycenter.v1beta1.ISecurityMarks=} [properties] Properties to set */ - function GetOrganizationSettingsRequest(properties) { + function SecurityMarks(properties) { + this.marks = {}; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -10254,186 +10008,234 @@ } /** - * GetOrganizationSettingsRequest name. + * SecurityMarks name. * @member {string} name - * @memberof google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest + * @memberof google.cloud.securitycenter.v1beta1.SecurityMarks * @instance */ - GetOrganizationSettingsRequest.prototype.name = ""; + SecurityMarks.prototype.name = ""; /** - * Creates a new GetOrganizationSettingsRequest instance using the specified properties. + * SecurityMarks marks. + * @member {Object.} marks + * @memberof google.cloud.securitycenter.v1beta1.SecurityMarks + * @instance + */ + SecurityMarks.prototype.marks = $util.emptyObject; + + /** + * Creates a new SecurityMarks instance using the specified properties. * @function create - * @memberof google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest + * @memberof google.cloud.securitycenter.v1beta1.SecurityMarks * @static - * @param {google.cloud.securitycenter.v1beta1.IGetOrganizationSettingsRequest=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest} GetOrganizationSettingsRequest instance + * @param {google.cloud.securitycenter.v1beta1.ISecurityMarks=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1beta1.SecurityMarks} SecurityMarks instance */ - GetOrganizationSettingsRequest.create = function create(properties) { - return new GetOrganizationSettingsRequest(properties); + SecurityMarks.create = function create(properties) { + return new SecurityMarks(properties); }; /** - * Encodes the specified GetOrganizationSettingsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest.verify|verify} messages. + * Encodes the specified SecurityMarks message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.SecurityMarks.verify|verify} messages. * @function encode - * @memberof google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest + * @memberof google.cloud.securitycenter.v1beta1.SecurityMarks * @static - * @param {google.cloud.securitycenter.v1beta1.IGetOrganizationSettingsRequest} message GetOrganizationSettingsRequest message or plain object to encode + * @param {google.cloud.securitycenter.v1beta1.ISecurityMarks} message SecurityMarks message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetOrganizationSettingsRequest.encode = function encode(message, writer) { + SecurityMarks.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.name != null && message.hasOwnProperty("name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.marks != null && message.hasOwnProperty("marks")) + for (var keys = Object.keys(message.marks), i = 0; i < keys.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.marks[keys[i]]).ldelim(); return writer; }; /** - * Encodes the specified GetOrganizationSettingsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest.verify|verify} messages. + * Encodes the specified SecurityMarks message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.SecurityMarks.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest + * @memberof google.cloud.securitycenter.v1beta1.SecurityMarks * @static - * @param {google.cloud.securitycenter.v1beta1.IGetOrganizationSettingsRequest} message GetOrganizationSettingsRequest message or plain object to encode + * @param {google.cloud.securitycenter.v1beta1.ISecurityMarks} message SecurityMarks message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetOrganizationSettingsRequest.encodeDelimited = function encodeDelimited(message, writer) { + SecurityMarks.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GetOrganizationSettingsRequest message from the specified reader or buffer. + * Decodes a SecurityMarks message from the specified reader or buffer. * @function decode - * @memberof google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest + * @memberof google.cloud.securitycenter.v1beta1.SecurityMarks * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest} GetOrganizationSettingsRequest + * @returns {google.cloud.securitycenter.v1beta1.SecurityMarks} SecurityMarks * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetOrganizationSettingsRequest.decode = function decode(reader, length) { + SecurityMarks.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.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1beta1.SecurityMarks(), key; while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.name = reader.string(); break; - default: - reader.skipType(tag & 7); - break; + case 2: + reader.skip().pos++; + if (message.marks === $util.emptyObject) + message.marks = {}; + key = reader.string(); + reader.pos++; + message.marks[key] = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; } } return message; }; /** - * Decodes a GetOrganizationSettingsRequest message from the specified reader or buffer, length delimited. + * Decodes a SecurityMarks message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest + * @memberof google.cloud.securitycenter.v1beta1.SecurityMarks * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest} GetOrganizationSettingsRequest + * @returns {google.cloud.securitycenter.v1beta1.SecurityMarks} SecurityMarks * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetOrganizationSettingsRequest.decodeDelimited = function decodeDelimited(reader) { + SecurityMarks.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GetOrganizationSettingsRequest message. + * Verifies a SecurityMarks message. * @function verify - * @memberof google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest + * @memberof google.cloud.securitycenter.v1beta1.SecurityMarks * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GetOrganizationSettingsRequest.verify = function verify(message) { + SecurityMarks.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.marks != null && message.hasOwnProperty("marks")) { + if (!$util.isObject(message.marks)) + return "marks: object expected"; + var key = Object.keys(message.marks); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.marks[key[i]])) + return "marks: string{k:string} expected"; + } return null; }; /** - * Creates a GetOrganizationSettingsRequest message from a plain object. Also converts values to their respective internal types. + * Creates a SecurityMarks message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest + * @memberof google.cloud.securitycenter.v1beta1.SecurityMarks * @static * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest} GetOrganizationSettingsRequest + * @returns {google.cloud.securitycenter.v1beta1.SecurityMarks} SecurityMarks */ - GetOrganizationSettingsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest) + SecurityMarks.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1beta1.SecurityMarks) return object; - var message = new $root.google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest(); + var message = new $root.google.cloud.securitycenter.v1beta1.SecurityMarks(); if (object.name != null) message.name = String(object.name); + if (object.marks) { + if (typeof object.marks !== "object") + throw TypeError(".google.cloud.securitycenter.v1beta1.SecurityMarks.marks: object expected"); + message.marks = {}; + for (var keys = Object.keys(object.marks), i = 0; i < keys.length; ++i) + message.marks[keys[i]] = String(object.marks[keys[i]]); + } return message; }; /** - * Creates a plain object from a GetOrganizationSettingsRequest message. Also converts values to other types if specified. + * Creates a plain object from a SecurityMarks message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest + * @memberof google.cloud.securitycenter.v1beta1.SecurityMarks * @static - * @param {google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest} message GetOrganizationSettingsRequest + * @param {google.cloud.securitycenter.v1beta1.SecurityMarks} message SecurityMarks * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GetOrganizationSettingsRequest.toObject = function toObject(message, options) { + SecurityMarks.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; + if (options.objects || options.defaults) + object.marks = {}; if (options.defaults) object.name = ""; if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; + var keys2; + if (message.marks && (keys2 = Object.keys(message.marks)).length) { + object.marks = {}; + for (var j = 0; j < keys2.length; ++j) + object.marks[keys2[j]] = message.marks[keys2[j]]; + } return object; }; /** - * Converts this GetOrganizationSettingsRequest to JSON. + * Converts this SecurityMarks to JSON. * @function toJSON - * @memberof google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest + * @memberof google.cloud.securitycenter.v1beta1.SecurityMarks * @instance * @returns {Object.} JSON object */ - GetOrganizationSettingsRequest.prototype.toJSON = function toJSON() { + SecurityMarks.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return GetOrganizationSettingsRequest; + return SecurityMarks; })(); - v1beta1.GetSourceRequest = (function() { + v1beta1.Asset = (function() { /** - * Properties of a GetSourceRequest. + * Properties of an Asset. * @memberof google.cloud.securitycenter.v1beta1 - * @interface IGetSourceRequest - * @property {string|null} [name] GetSourceRequest name + * @interface IAsset + * @property {string|null} [name] Asset name + * @property {google.cloud.securitycenter.v1beta1.Asset.ISecurityCenterProperties|null} [securityCenterProperties] Asset securityCenterProperties + * @property {Object.|null} [resourceProperties] Asset resourceProperties + * @property {google.cloud.securitycenter.v1beta1.ISecurityMarks|null} [securityMarks] Asset securityMarks + * @property {google.protobuf.ITimestamp|null} [createTime] Asset createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Asset updateTime */ /** - * Constructs a new GetSourceRequest. + * Constructs a new Asset. * @memberof google.cloud.securitycenter.v1beta1 - * @classdesc Represents a GetSourceRequest. - * @implements IGetSourceRequest + * @classdesc Represents an Asset. + * @implements IAsset * @constructor - * @param {google.cloud.securitycenter.v1beta1.IGetSourceRequest=} [properties] Properties to set + * @param {google.cloud.securitycenter.v1beta1.IAsset=} [properties] Properties to set */ - function GetSourceRequest(properties) { + function Asset(properties) { + this.resourceProperties = {}; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -10441,76 +10243,149 @@ } /** - * GetSourceRequest name. + * Asset name. * @member {string} name - * @memberof google.cloud.securitycenter.v1beta1.GetSourceRequest + * @memberof google.cloud.securitycenter.v1beta1.Asset * @instance */ - GetSourceRequest.prototype.name = ""; + Asset.prototype.name = ""; /** - * Creates a new GetSourceRequest instance using the specified properties. + * Asset securityCenterProperties. + * @member {google.cloud.securitycenter.v1beta1.Asset.ISecurityCenterProperties|null|undefined} securityCenterProperties + * @memberof google.cloud.securitycenter.v1beta1.Asset + * @instance + */ + Asset.prototype.securityCenterProperties = null; + + /** + * Asset resourceProperties. + * @member {Object.} resourceProperties + * @memberof google.cloud.securitycenter.v1beta1.Asset + * @instance + */ + Asset.prototype.resourceProperties = $util.emptyObject; + + /** + * Asset securityMarks. + * @member {google.cloud.securitycenter.v1beta1.ISecurityMarks|null|undefined} securityMarks + * @memberof google.cloud.securitycenter.v1beta1.Asset + * @instance + */ + Asset.prototype.securityMarks = null; + + /** + * Asset createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.securitycenter.v1beta1.Asset + * @instance + */ + Asset.prototype.createTime = null; + + /** + * Asset updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.securitycenter.v1beta1.Asset + * @instance + */ + Asset.prototype.updateTime = null; + + /** + * Creates a new Asset instance using the specified properties. * @function create - * @memberof google.cloud.securitycenter.v1beta1.GetSourceRequest + * @memberof google.cloud.securitycenter.v1beta1.Asset * @static - * @param {google.cloud.securitycenter.v1beta1.IGetSourceRequest=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1beta1.GetSourceRequest} GetSourceRequest instance + * @param {google.cloud.securitycenter.v1beta1.IAsset=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1beta1.Asset} Asset instance */ - GetSourceRequest.create = function create(properties) { - return new GetSourceRequest(properties); + Asset.create = function create(properties) { + return new Asset(properties); }; /** - * Encodes the specified GetSourceRequest message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.GetSourceRequest.verify|verify} messages. + * Encodes the specified Asset message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.Asset.verify|verify} messages. * @function encode - * @memberof google.cloud.securitycenter.v1beta1.GetSourceRequest + * @memberof google.cloud.securitycenter.v1beta1.Asset * @static - * @param {google.cloud.securitycenter.v1beta1.IGetSourceRequest} message GetSourceRequest message or plain object to encode + * @param {google.cloud.securitycenter.v1beta1.IAsset} message Asset message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetSourceRequest.encode = function encode(message, writer) { + Asset.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.name != null && message.hasOwnProperty("name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.securityCenterProperties != null && message.hasOwnProperty("securityCenterProperties")) + $root.google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties.encode(message.securityCenterProperties, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.resourceProperties != null && message.hasOwnProperty("resourceProperties")) + for (var keys = Object.keys(message.resourceProperties), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 7, wireType 2 =*/58).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.protobuf.Value.encode(message.resourceProperties[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.securityMarks != null && message.hasOwnProperty("securityMarks")) + $root.google.cloud.securitycenter.v1beta1.SecurityMarks.encode(message.securityMarks, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.createTime != null && message.hasOwnProperty("createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); return writer; }; /** - * Encodes the specified GetSourceRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.GetSourceRequest.verify|verify} messages. + * Encodes the specified Asset message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.Asset.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1beta1.GetSourceRequest + * @memberof google.cloud.securitycenter.v1beta1.Asset * @static - * @param {google.cloud.securitycenter.v1beta1.IGetSourceRequest} message GetSourceRequest message or plain object to encode + * @param {google.cloud.securitycenter.v1beta1.IAsset} message Asset message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetSourceRequest.encodeDelimited = function encodeDelimited(message, writer) { + Asset.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GetSourceRequest message from the specified reader or buffer. + * Decodes an Asset message from the specified reader or buffer. * @function decode - * @memberof google.cloud.securitycenter.v1beta1.GetSourceRequest + * @memberof google.cloud.securitycenter.v1beta1.Asset * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1beta1.GetSourceRequest} GetSourceRequest + * @returns {google.cloud.securitycenter.v1beta1.Asset} Asset * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetSourceRequest.decode = function decode(reader, length) { + Asset.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.cloud.securitycenter.v1beta1.GetSourceRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1beta1.Asset(), key; while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.name = reader.string(); break; + case 2: + message.securityCenterProperties = $root.google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties.decode(reader, reader.uint32()); + break; + case 7: + reader.skip().pos++; + if (message.resourceProperties === $util.emptyObject) + message.resourceProperties = {}; + key = reader.string(); + reader.pos++; + message.resourceProperties[key] = $root.google.protobuf.Value.decode(reader, reader.uint32()); + break; + case 8: + message.securityMarks = $root.google.cloud.securitycenter.v1beta1.SecurityMarks.decode(reader, reader.uint32()); + break; + case 9: + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 10: + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; default: reader.skipType(tag & 7); break; @@ -10520,267 +10395,585 @@ }; /** - * Decodes a GetSourceRequest message from the specified reader or buffer, length delimited. + * Decodes an Asset message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1beta1.GetSourceRequest + * @memberof google.cloud.securitycenter.v1beta1.Asset * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1beta1.GetSourceRequest} GetSourceRequest + * @returns {google.cloud.securitycenter.v1beta1.Asset} Asset * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetSourceRequest.decodeDelimited = function decodeDelimited(reader) { + Asset.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GetSourceRequest message. + * Verifies an Asset message. * @function verify - * @memberof google.cloud.securitycenter.v1beta1.GetSourceRequest + * @memberof google.cloud.securitycenter.v1beta1.Asset * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GetSourceRequest.verify = function verify(message) { + Asset.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 GetSourceRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v1beta1.GetSourceRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1beta1.GetSourceRequest} GetSourceRequest - */ - GetSourceRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1beta1.GetSourceRequest) - return object; - var message = new $root.google.cloud.securitycenter.v1beta1.GetSourceRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a GetSourceRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v1beta1.GetSourceRequest - * @static - * @param {google.cloud.securitycenter.v1beta1.GetSourceRequest} message GetSourceRequest + if (message.securityCenterProperties != null && message.hasOwnProperty("securityCenterProperties")) { + var error = $root.google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties.verify(message.securityCenterProperties); + if (error) + return "securityCenterProperties." + error; + } + if (message.resourceProperties != null && message.hasOwnProperty("resourceProperties")) { + if (!$util.isObject(message.resourceProperties)) + return "resourceProperties: object expected"; + var key = Object.keys(message.resourceProperties); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.protobuf.Value.verify(message.resourceProperties[key[i]]); + if (error) + return "resourceProperties." + error; + } + } + if (message.securityMarks != null && message.hasOwnProperty("securityMarks")) { + var error = $root.google.cloud.securitycenter.v1beta1.SecurityMarks.verify(message.securityMarks); + if (error) + return "securityMarks." + error; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + return null; + }; + + /** + * Creates an Asset message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1beta1.Asset + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1beta1.Asset} Asset + */ + Asset.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1beta1.Asset) + return object; + var message = new $root.google.cloud.securitycenter.v1beta1.Asset(); + if (object.name != null) + message.name = String(object.name); + if (object.securityCenterProperties != null) { + if (typeof object.securityCenterProperties !== "object") + throw TypeError(".google.cloud.securitycenter.v1beta1.Asset.securityCenterProperties: object expected"); + message.securityCenterProperties = $root.google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties.fromObject(object.securityCenterProperties); + } + if (object.resourceProperties) { + if (typeof object.resourceProperties !== "object") + throw TypeError(".google.cloud.securitycenter.v1beta1.Asset.resourceProperties: object expected"); + message.resourceProperties = {}; + for (var keys = Object.keys(object.resourceProperties), i = 0; i < keys.length; ++i) { + if (typeof object.resourceProperties[keys[i]] !== "object") + throw TypeError(".google.cloud.securitycenter.v1beta1.Asset.resourceProperties: object expected"); + message.resourceProperties[keys[i]] = $root.google.protobuf.Value.fromObject(object.resourceProperties[keys[i]]); + } + } + if (object.securityMarks != null) { + if (typeof object.securityMarks !== "object") + throw TypeError(".google.cloud.securitycenter.v1beta1.Asset.securityMarks: object expected"); + message.securityMarks = $root.google.cloud.securitycenter.v1beta1.SecurityMarks.fromObject(object.securityMarks); + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.securitycenter.v1beta1.Asset.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.securitycenter.v1beta1.Asset.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + return message; + }; + + /** + * Creates a plain object from an Asset message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1beta1.Asset + * @static + * @param {google.cloud.securitycenter.v1beta1.Asset} message Asset * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GetSourceRequest.toObject = function toObject(message, options) { + Asset.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) + if (options.objects || options.defaults) + object.resourceProperties = {}; + if (options.defaults) { object.name = ""; + object.securityCenterProperties = null; + object.securityMarks = null; + object.createTime = null; + object.updateTime = null; + } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; + if (message.securityCenterProperties != null && message.hasOwnProperty("securityCenterProperties")) + object.securityCenterProperties = $root.google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties.toObject(message.securityCenterProperties, options); + var keys2; + if (message.resourceProperties && (keys2 = Object.keys(message.resourceProperties)).length) { + object.resourceProperties = {}; + for (var j = 0; j < keys2.length; ++j) + object.resourceProperties[keys2[j]] = $root.google.protobuf.Value.toObject(message.resourceProperties[keys2[j]], options); + } + if (message.securityMarks != null && message.hasOwnProperty("securityMarks")) + object.securityMarks = $root.google.cloud.securitycenter.v1beta1.SecurityMarks.toObject(message.securityMarks, options); + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); return object; }; /** - * Converts this GetSourceRequest to JSON. + * Converts this Asset to JSON. * @function toJSON - * @memberof google.cloud.securitycenter.v1beta1.GetSourceRequest + * @memberof google.cloud.securitycenter.v1beta1.Asset * @instance * @returns {Object.} JSON object */ - GetSourceRequest.prototype.toJSON = function toJSON() { + Asset.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return GetSourceRequest; - })(); + Asset.SecurityCenterProperties = (function() { - v1beta1.GroupAssetsRequest = (function() { + /** + * Properties of a SecurityCenterProperties. + * @memberof google.cloud.securitycenter.v1beta1.Asset + * @interface ISecurityCenterProperties + * @property {string|null} [resourceName] SecurityCenterProperties resourceName + * @property {string|null} [resourceType] SecurityCenterProperties resourceType + * @property {string|null} [resourceParent] SecurityCenterProperties resourceParent + * @property {string|null} [resourceProject] SecurityCenterProperties resourceProject + * @property {Array.|null} [resourceOwners] SecurityCenterProperties resourceOwners + */ - /** - * Properties of a GroupAssetsRequest. - * @memberof google.cloud.securitycenter.v1beta1 - * @interface IGroupAssetsRequest - * @property {string|null} [parent] GroupAssetsRequest parent - * @property {string|null} [filter] GroupAssetsRequest filter - * @property {string|null} [groupBy] GroupAssetsRequest groupBy - * @property {google.protobuf.IDuration|null} [compareDuration] GroupAssetsRequest compareDuration - * @property {google.protobuf.ITimestamp|null} [readTime] GroupAssetsRequest readTime - * @property {string|null} [pageToken] GroupAssetsRequest pageToken - * @property {number|null} [pageSize] GroupAssetsRequest pageSize - */ + /** + * Constructs a new SecurityCenterProperties. + * @memberof google.cloud.securitycenter.v1beta1.Asset + * @classdesc Represents a SecurityCenterProperties. + * @implements ISecurityCenterProperties + * @constructor + * @param {google.cloud.securitycenter.v1beta1.Asset.ISecurityCenterProperties=} [properties] Properties to set + */ + function SecurityCenterProperties(properties) { + this.resourceOwners = []; + 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]]; + } - /** - * Constructs a new GroupAssetsRequest. - * @memberof google.cloud.securitycenter.v1beta1 - * @classdesc Represents a GroupAssetsRequest. - * @implements IGroupAssetsRequest - * @constructor - * @param {google.cloud.securitycenter.v1beta1.IGroupAssetsRequest=} [properties] Properties to set - */ - function GroupAssetsRequest(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]]; - } + /** + * SecurityCenterProperties resourceName. + * @member {string} resourceName + * @memberof google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties + * @instance + */ + SecurityCenterProperties.prototype.resourceName = ""; - /** - * GroupAssetsRequest parent. - * @member {string} parent - * @memberof google.cloud.securitycenter.v1beta1.GroupAssetsRequest - * @instance - */ - GroupAssetsRequest.prototype.parent = ""; + /** + * SecurityCenterProperties resourceType. + * @member {string} resourceType + * @memberof google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties + * @instance + */ + SecurityCenterProperties.prototype.resourceType = ""; - /** - * GroupAssetsRequest filter. - * @member {string} filter - * @memberof google.cloud.securitycenter.v1beta1.GroupAssetsRequest - * @instance - */ - GroupAssetsRequest.prototype.filter = ""; + /** + * SecurityCenterProperties resourceParent. + * @member {string} resourceParent + * @memberof google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties + * @instance + */ + SecurityCenterProperties.prototype.resourceParent = ""; - /** - * GroupAssetsRequest groupBy. - * @member {string} groupBy - * @memberof google.cloud.securitycenter.v1beta1.GroupAssetsRequest - * @instance - */ - GroupAssetsRequest.prototype.groupBy = ""; + /** + * SecurityCenterProperties resourceProject. + * @member {string} resourceProject + * @memberof google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties + * @instance + */ + SecurityCenterProperties.prototype.resourceProject = ""; - /** - * GroupAssetsRequest compareDuration. - * @member {google.protobuf.IDuration|null|undefined} compareDuration - * @memberof google.cloud.securitycenter.v1beta1.GroupAssetsRequest - * @instance - */ - GroupAssetsRequest.prototype.compareDuration = null; + /** + * SecurityCenterProperties resourceOwners. + * @member {Array.} resourceOwners + * @memberof google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties + * @instance + */ + SecurityCenterProperties.prototype.resourceOwners = $util.emptyArray; - /** - * GroupAssetsRequest readTime. - * @member {google.protobuf.ITimestamp|null|undefined} readTime - * @memberof google.cloud.securitycenter.v1beta1.GroupAssetsRequest - * @instance - */ - GroupAssetsRequest.prototype.readTime = null; + /** + * Creates a new SecurityCenterProperties instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties + * @static + * @param {google.cloud.securitycenter.v1beta1.Asset.ISecurityCenterProperties=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties} SecurityCenterProperties instance + */ + SecurityCenterProperties.create = function create(properties) { + return new SecurityCenterProperties(properties); + }; - /** - * GroupAssetsRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.securitycenter.v1beta1.GroupAssetsRequest - * @instance - */ - GroupAssetsRequest.prototype.pageToken = ""; + /** + * Encodes the specified SecurityCenterProperties message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties + * @static + * @param {google.cloud.securitycenter.v1beta1.Asset.ISecurityCenterProperties} message SecurityCenterProperties message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SecurityCenterProperties.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.resourceName != null && message.hasOwnProperty("resourceName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.resourceName); + if (message.resourceType != null && message.hasOwnProperty("resourceType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.resourceType); + if (message.resourceParent != null && message.hasOwnProperty("resourceParent")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.resourceParent); + if (message.resourceProject != null && message.hasOwnProperty("resourceProject")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.resourceProject); + if (message.resourceOwners != null && message.resourceOwners.length) + for (var i = 0; i < message.resourceOwners.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.resourceOwners[i]); + return writer; + }; + + /** + * Encodes the specified SecurityCenterProperties message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties + * @static + * @param {google.cloud.securitycenter.v1beta1.Asset.ISecurityCenterProperties} message SecurityCenterProperties message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SecurityCenterProperties.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SecurityCenterProperties message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties} SecurityCenterProperties + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SecurityCenterProperties.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.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.resourceName = reader.string(); + break; + case 2: + message.resourceType = reader.string(); + break; + case 3: + message.resourceParent = reader.string(); + break; + case 4: + message.resourceProject = reader.string(); + break; + case 5: + if (!(message.resourceOwners && message.resourceOwners.length)) + message.resourceOwners = []; + message.resourceOwners.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SecurityCenterProperties message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties} SecurityCenterProperties + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SecurityCenterProperties.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SecurityCenterProperties message. + * @function verify + * @memberof google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SecurityCenterProperties.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.resourceName != null && message.hasOwnProperty("resourceName")) + if (!$util.isString(message.resourceName)) + return "resourceName: string expected"; + if (message.resourceType != null && message.hasOwnProperty("resourceType")) + if (!$util.isString(message.resourceType)) + return "resourceType: string expected"; + if (message.resourceParent != null && message.hasOwnProperty("resourceParent")) + if (!$util.isString(message.resourceParent)) + return "resourceParent: string expected"; + if (message.resourceProject != null && message.hasOwnProperty("resourceProject")) + if (!$util.isString(message.resourceProject)) + return "resourceProject: string expected"; + if (message.resourceOwners != null && message.hasOwnProperty("resourceOwners")) { + if (!Array.isArray(message.resourceOwners)) + return "resourceOwners: array expected"; + for (var i = 0; i < message.resourceOwners.length; ++i) + if (!$util.isString(message.resourceOwners[i])) + return "resourceOwners: string[] expected"; + } + return null; + }; + + /** + * Creates a SecurityCenterProperties message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties} SecurityCenterProperties + */ + SecurityCenterProperties.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties) + return object; + var message = new $root.google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties(); + if (object.resourceName != null) + message.resourceName = String(object.resourceName); + if (object.resourceType != null) + message.resourceType = String(object.resourceType); + if (object.resourceParent != null) + message.resourceParent = String(object.resourceParent); + if (object.resourceProject != null) + message.resourceProject = String(object.resourceProject); + if (object.resourceOwners) { + if (!Array.isArray(object.resourceOwners)) + throw TypeError(".google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties.resourceOwners: array expected"); + message.resourceOwners = []; + for (var i = 0; i < object.resourceOwners.length; ++i) + message.resourceOwners[i] = String(object.resourceOwners[i]); + } + return message; + }; + + /** + * Creates a plain object from a SecurityCenterProperties message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties + * @static + * @param {google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties} message SecurityCenterProperties + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SecurityCenterProperties.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.resourceOwners = []; + if (options.defaults) { + object.resourceName = ""; + object.resourceType = ""; + object.resourceParent = ""; + object.resourceProject = ""; + } + if (message.resourceName != null && message.hasOwnProperty("resourceName")) + object.resourceName = message.resourceName; + if (message.resourceType != null && message.hasOwnProperty("resourceType")) + object.resourceType = message.resourceType; + if (message.resourceParent != null && message.hasOwnProperty("resourceParent")) + object.resourceParent = message.resourceParent; + if (message.resourceProject != null && message.hasOwnProperty("resourceProject")) + object.resourceProject = message.resourceProject; + if (message.resourceOwners && message.resourceOwners.length) { + object.resourceOwners = []; + for (var j = 0; j < message.resourceOwners.length; ++j) + object.resourceOwners[j] = message.resourceOwners[j]; + } + return object; + }; + + /** + * Converts this SecurityCenterProperties to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties + * @instance + * @returns {Object.} JSON object + */ + SecurityCenterProperties.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SecurityCenterProperties; + })(); + + return Asset; + })(); + + v1beta1.Source = (function() { /** - * GroupAssetsRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.securitycenter.v1beta1.GroupAssetsRequest - * @instance + * Properties of a Source. + * @memberof google.cloud.securitycenter.v1beta1 + * @interface ISource + * @property {string|null} [name] Source name + * @property {string|null} [displayName] Source displayName + * @property {string|null} [description] Source description */ - GroupAssetsRequest.prototype.pageSize = 0; /** - * Creates a new GroupAssetsRequest instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v1beta1.GroupAssetsRequest - * @static - * @param {google.cloud.securitycenter.v1beta1.IGroupAssetsRequest=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1beta1.GroupAssetsRequest} GroupAssetsRequest instance + * Constructs a new Source. + * @memberof google.cloud.securitycenter.v1beta1 + * @classdesc Represents a Source. + * @implements ISource + * @constructor + * @param {google.cloud.securitycenter.v1beta1.ISource=} [properties] Properties to set */ - GroupAssetsRequest.create = function create(properties) { - return new GroupAssetsRequest(properties); - }; + function Source(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]]; + } /** - * Encodes the specified GroupAssetsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.GroupAssetsRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1beta1.GroupAssetsRequest + * Source name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1beta1.Source + * @instance + */ + Source.prototype.name = ""; + + /** + * Source displayName. + * @member {string} displayName + * @memberof google.cloud.securitycenter.v1beta1.Source + * @instance + */ + Source.prototype.displayName = ""; + + /** + * Source description. + * @member {string} description + * @memberof google.cloud.securitycenter.v1beta1.Source + * @instance + */ + Source.prototype.description = ""; + + /** + * Creates a new Source instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1beta1.Source * @static - * @param {google.cloud.securitycenter.v1beta1.IGroupAssetsRequest} message GroupAssetsRequest message or plain object to encode + * @param {google.cloud.securitycenter.v1beta1.ISource=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1beta1.Source} Source instance + */ + Source.create = function create(properties) { + return new Source(properties); + }; + + /** + * Encodes the specified Source message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.Source.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1beta1.Source + * @static + * @param {google.cloud.securitycenter.v1beta1.ISource} message Source message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GroupAssetsRequest.encode = function encode(message, writer) { + Source.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && message.hasOwnProperty("parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.filter != null && message.hasOwnProperty("filter")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); - if (message.groupBy != null && message.hasOwnProperty("groupBy")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.groupBy); - if (message.compareDuration != null && message.hasOwnProperty("compareDuration")) - $root.google.protobuf.Duration.encode(message.compareDuration, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.readTime != null && message.hasOwnProperty("readTime")) - $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.pageToken); - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - writer.uint32(/* id 8, wireType 0 =*/64).int32(message.pageSize); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.displayName != null && message.hasOwnProperty("displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + if (message.description != null && message.hasOwnProperty("description")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); return writer; }; /** - * Encodes the specified GroupAssetsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.GroupAssetsRequest.verify|verify} messages. + * Encodes the specified Source message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.Source.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1beta1.GroupAssetsRequest + * @memberof google.cloud.securitycenter.v1beta1.Source * @static - * @param {google.cloud.securitycenter.v1beta1.IGroupAssetsRequest} message GroupAssetsRequest message or plain object to encode + * @param {google.cloud.securitycenter.v1beta1.ISource} message Source message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GroupAssetsRequest.encodeDelimited = function encodeDelimited(message, writer) { + Source.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GroupAssetsRequest message from the specified reader or buffer. + * Decodes a Source message from the specified reader or buffer. * @function decode - * @memberof google.cloud.securitycenter.v1beta1.GroupAssetsRequest + * @memberof google.cloud.securitycenter.v1beta1.Source * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1beta1.GroupAssetsRequest} GroupAssetsRequest + * @returns {google.cloud.securitycenter.v1beta1.Source} Source * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GroupAssetsRequest.decode = function decode(reader, length) { + Source.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.cloud.securitycenter.v1beta1.GroupAssetsRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1beta1.Source(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.parent = reader.string(); + message.name = reader.string(); break; case 2: - message.filter = reader.string(); + message.displayName = reader.string(); break; case 3: - message.groupBy = reader.string(); - break; - case 4: - message.compareDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - case 5: - message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 7: - message.pageToken = reader.string(); - break; - case 8: - message.pageSize = reader.int32(); + message.description = reader.string(); break; default: reader.skipType(tag & 7); @@ -10791,169 +10984,125 @@ }; /** - * Decodes a GroupAssetsRequest message from the specified reader or buffer, length delimited. + * Decodes a Source message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1beta1.GroupAssetsRequest + * @memberof google.cloud.securitycenter.v1beta1.Source * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1beta1.GroupAssetsRequest} GroupAssetsRequest + * @returns {google.cloud.securitycenter.v1beta1.Source} Source * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GroupAssetsRequest.decodeDelimited = function decodeDelimited(reader) { + Source.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GroupAssetsRequest message. + * Verifies a Source message. * @function verify - * @memberof google.cloud.securitycenter.v1beta1.GroupAssetsRequest + * @memberof google.cloud.securitycenter.v1beta1.Source * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GroupAssetsRequest.verify = function verify(message) { + Source.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.filter != null && message.hasOwnProperty("filter")) - if (!$util.isString(message.filter)) - return "filter: string expected"; - if (message.groupBy != null && message.hasOwnProperty("groupBy")) - if (!$util.isString(message.groupBy)) - return "groupBy: string expected"; - if (message.compareDuration != null && message.hasOwnProperty("compareDuration")) { - var error = $root.google.protobuf.Duration.verify(message.compareDuration); - if (error) - return "compareDuration." + error; - } - if (message.readTime != null && message.hasOwnProperty("readTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.readTime); - if (error) - return "readTime." + error; - } - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; return null; }; /** - * Creates a GroupAssetsRequest message from a plain object. Also converts values to their respective internal types. + * Creates a Source message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.securitycenter.v1beta1.GroupAssetsRequest + * @memberof google.cloud.securitycenter.v1beta1.Source * @static * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1beta1.GroupAssetsRequest} GroupAssetsRequest + * @returns {google.cloud.securitycenter.v1beta1.Source} Source */ - GroupAssetsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1beta1.GroupAssetsRequest) + Source.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1beta1.Source) return object; - var message = new $root.google.cloud.securitycenter.v1beta1.GroupAssetsRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.filter != null) - message.filter = String(object.filter); - if (object.groupBy != null) - message.groupBy = String(object.groupBy); - if (object.compareDuration != null) { - if (typeof object.compareDuration !== "object") - throw TypeError(".google.cloud.securitycenter.v1beta1.GroupAssetsRequest.compareDuration: object expected"); - message.compareDuration = $root.google.protobuf.Duration.fromObject(object.compareDuration); - } - if (object.readTime != null) { - if (typeof object.readTime !== "object") - throw TypeError(".google.cloud.securitycenter.v1beta1.GroupAssetsRequest.readTime: object expected"); - message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); - } - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; + var message = new $root.google.cloud.securitycenter.v1beta1.Source(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.description != null) + message.description = String(object.description); return message; }; /** - * Creates a plain object from a GroupAssetsRequest message. Also converts values to other types if specified. + * Creates a plain object from a Source message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.securitycenter.v1beta1.GroupAssetsRequest + * @memberof google.cloud.securitycenter.v1beta1.Source * @static - * @param {google.cloud.securitycenter.v1beta1.GroupAssetsRequest} message GroupAssetsRequest + * @param {google.cloud.securitycenter.v1beta1.Source} message Source * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GroupAssetsRequest.toObject = function toObject(message, options) { + Source.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.parent = ""; - object.filter = ""; - object.groupBy = ""; - object.compareDuration = null; - object.readTime = null; - object.pageToken = ""; - object.pageSize = 0; + object.name = ""; + object.displayName = ""; + object.description = ""; } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.filter != null && message.hasOwnProperty("filter")) - object.filter = message.filter; - if (message.groupBy != null && message.hasOwnProperty("groupBy")) - object.groupBy = message.groupBy; - if (message.compareDuration != null && message.hasOwnProperty("compareDuration")) - object.compareDuration = $root.google.protobuf.Duration.toObject(message.compareDuration, options); - if (message.readTime != null && message.hasOwnProperty("readTime")) - object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; return object; }; /** - * Converts this GroupAssetsRequest to JSON. + * Converts this Source to JSON. * @function toJSON - * @memberof google.cloud.securitycenter.v1beta1.GroupAssetsRequest + * @memberof google.cloud.securitycenter.v1beta1.Source * @instance * @returns {Object.} JSON object */ - GroupAssetsRequest.prototype.toJSON = function toJSON() { + Source.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return GroupAssetsRequest; + return Source; })(); - v1beta1.GroupAssetsResponse = (function() { + v1beta1.RunAssetDiscoveryResponse = (function() { /** - * Properties of a GroupAssetsResponse. + * Properties of a RunAssetDiscoveryResponse. * @memberof google.cloud.securitycenter.v1beta1 - * @interface IGroupAssetsResponse - * @property {Array.|null} [groupByResults] GroupAssetsResponse groupByResults - * @property {google.protobuf.ITimestamp|null} [readTime] GroupAssetsResponse readTime - * @property {string|null} [nextPageToken] GroupAssetsResponse nextPageToken + * @interface IRunAssetDiscoveryResponse + * @property {google.cloud.securitycenter.v1beta1.RunAssetDiscoveryResponse.State|null} [state] RunAssetDiscoveryResponse state + * @property {google.protobuf.IDuration|null} [duration] RunAssetDiscoveryResponse duration */ /** - * Constructs a new GroupAssetsResponse. + * Constructs a new RunAssetDiscoveryResponse. * @memberof google.cloud.securitycenter.v1beta1 - * @classdesc Represents a GroupAssetsResponse. - * @implements IGroupAssetsResponse + * @classdesc Represents a RunAssetDiscoveryResponse. + * @implements IRunAssetDiscoveryResponse * @constructor - * @param {google.cloud.securitycenter.v1beta1.IGroupAssetsResponse=} [properties] Properties to set + * @param {google.cloud.securitycenter.v1beta1.IRunAssetDiscoveryResponse=} [properties] Properties to set */ - function GroupAssetsResponse(properties) { - this.groupByResults = []; + function RunAssetDiscoveryResponse(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -10961,104 +11110,88 @@ } /** - * GroupAssetsResponse groupByResults. - * @member {Array.} groupByResults - * @memberof google.cloud.securitycenter.v1beta1.GroupAssetsResponse + * RunAssetDiscoveryResponse state. + * @member {google.cloud.securitycenter.v1beta1.RunAssetDiscoveryResponse.State} state + * @memberof google.cloud.securitycenter.v1beta1.RunAssetDiscoveryResponse * @instance */ - GroupAssetsResponse.prototype.groupByResults = $util.emptyArray; + RunAssetDiscoveryResponse.prototype.state = 0; /** - * GroupAssetsResponse readTime. - * @member {google.protobuf.ITimestamp|null|undefined} readTime - * @memberof google.cloud.securitycenter.v1beta1.GroupAssetsResponse - * @instance - */ - GroupAssetsResponse.prototype.readTime = null; - - /** - * GroupAssetsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.securitycenter.v1beta1.GroupAssetsResponse + * RunAssetDiscoveryResponse duration. + * @member {google.protobuf.IDuration|null|undefined} duration + * @memberof google.cloud.securitycenter.v1beta1.RunAssetDiscoveryResponse * @instance */ - GroupAssetsResponse.prototype.nextPageToken = ""; + RunAssetDiscoveryResponse.prototype.duration = null; /** - * Creates a new GroupAssetsResponse instance using the specified properties. + * Creates a new RunAssetDiscoveryResponse instance using the specified properties. * @function create - * @memberof google.cloud.securitycenter.v1beta1.GroupAssetsResponse + * @memberof google.cloud.securitycenter.v1beta1.RunAssetDiscoveryResponse * @static - * @param {google.cloud.securitycenter.v1beta1.IGroupAssetsResponse=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1beta1.GroupAssetsResponse} GroupAssetsResponse instance + * @param {google.cloud.securitycenter.v1beta1.IRunAssetDiscoveryResponse=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1beta1.RunAssetDiscoveryResponse} RunAssetDiscoveryResponse instance */ - GroupAssetsResponse.create = function create(properties) { - return new GroupAssetsResponse(properties); + RunAssetDiscoveryResponse.create = function create(properties) { + return new RunAssetDiscoveryResponse(properties); }; /** - * Encodes the specified GroupAssetsResponse message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.GroupAssetsResponse.verify|verify} messages. + * Encodes the specified RunAssetDiscoveryResponse message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.RunAssetDiscoveryResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.securitycenter.v1beta1.GroupAssetsResponse + * @memberof google.cloud.securitycenter.v1beta1.RunAssetDiscoveryResponse * @static - * @param {google.cloud.securitycenter.v1beta1.IGroupAssetsResponse} message GroupAssetsResponse message or plain object to encode + * @param {google.cloud.securitycenter.v1beta1.IRunAssetDiscoveryResponse} message RunAssetDiscoveryResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GroupAssetsResponse.encode = function encode(message, writer) { + RunAssetDiscoveryResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.groupByResults != null && message.groupByResults.length) - for (var i = 0; i < message.groupByResults.length; ++i) - $root.google.cloud.securitycenter.v1beta1.GroupResult.encode(message.groupByResults[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.readTime != null && message.hasOwnProperty("readTime")) - $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.nextPageToken); + if (message.state != null && message.hasOwnProperty("state")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.state); + if (message.duration != null && message.hasOwnProperty("duration")) + $root.google.protobuf.Duration.encode(message.duration, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** - * Encodes the specified GroupAssetsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.GroupAssetsResponse.verify|verify} messages. + * Encodes the specified RunAssetDiscoveryResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.RunAssetDiscoveryResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1beta1.GroupAssetsResponse + * @memberof google.cloud.securitycenter.v1beta1.RunAssetDiscoveryResponse * @static - * @param {google.cloud.securitycenter.v1beta1.IGroupAssetsResponse} message GroupAssetsResponse message or plain object to encode + * @param {google.cloud.securitycenter.v1beta1.IRunAssetDiscoveryResponse} message RunAssetDiscoveryResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GroupAssetsResponse.encodeDelimited = function encodeDelimited(message, writer) { + RunAssetDiscoveryResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GroupAssetsResponse message from the specified reader or buffer. + * Decodes a RunAssetDiscoveryResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.securitycenter.v1beta1.GroupAssetsResponse + * @memberof google.cloud.securitycenter.v1beta1.RunAssetDiscoveryResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1beta1.GroupAssetsResponse} GroupAssetsResponse + * @returns {google.cloud.securitycenter.v1beta1.RunAssetDiscoveryResponse} RunAssetDiscoveryResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GroupAssetsResponse.decode = function decode(reader, length) { + RunAssetDiscoveryResponse.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.cloud.securitycenter.v1beta1.GroupAssetsResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1beta1.RunAssetDiscoveryResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - if (!(message.groupByResults && message.groupByResults.length)) - message.groupByResults = []; - message.groupByResults.push($root.google.cloud.securitycenter.v1beta1.GroupResult.decode(reader, reader.uint32())); + message.state = reader.int32(); break; case 2: - message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 3: - message.nextPageToken = reader.string(); + message.duration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -11069,152 +11202,164 @@ }; /** - * Decodes a GroupAssetsResponse message from the specified reader or buffer, length delimited. + * Decodes a RunAssetDiscoveryResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1beta1.GroupAssetsResponse + * @memberof google.cloud.securitycenter.v1beta1.RunAssetDiscoveryResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1beta1.GroupAssetsResponse} GroupAssetsResponse + * @returns {google.cloud.securitycenter.v1beta1.RunAssetDiscoveryResponse} RunAssetDiscoveryResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GroupAssetsResponse.decodeDelimited = function decodeDelimited(reader) { + RunAssetDiscoveryResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GroupAssetsResponse message. + * Verifies a RunAssetDiscoveryResponse message. * @function verify - * @memberof google.cloud.securitycenter.v1beta1.GroupAssetsResponse + * @memberof google.cloud.securitycenter.v1beta1.RunAssetDiscoveryResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GroupAssetsResponse.verify = function verify(message) { + RunAssetDiscoveryResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.groupByResults != null && message.hasOwnProperty("groupByResults")) { - if (!Array.isArray(message.groupByResults)) - return "groupByResults: array expected"; - for (var i = 0; i < message.groupByResults.length; ++i) { - var error = $root.google.cloud.securitycenter.v1beta1.GroupResult.verify(message.groupByResults[i]); - if (error) - return "groupByResults." + error; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; } - } - if (message.readTime != null && message.hasOwnProperty("readTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.readTime); + if (message.duration != null && message.hasOwnProperty("duration")) { + var error = $root.google.protobuf.Duration.verify(message.duration); if (error) - return "readTime." + error; + return "duration." + error; } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; return null; }; /** - * Creates a GroupAssetsResponse message from a plain object. Also converts values to their respective internal types. + * Creates a RunAssetDiscoveryResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.securitycenter.v1beta1.GroupAssetsResponse + * @memberof google.cloud.securitycenter.v1beta1.RunAssetDiscoveryResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1beta1.GroupAssetsResponse} GroupAssetsResponse + * @returns {google.cloud.securitycenter.v1beta1.RunAssetDiscoveryResponse} RunAssetDiscoveryResponse */ - GroupAssetsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1beta1.GroupAssetsResponse) + RunAssetDiscoveryResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1beta1.RunAssetDiscoveryResponse) return object; - var message = new $root.google.cloud.securitycenter.v1beta1.GroupAssetsResponse(); - if (object.groupByResults) { - if (!Array.isArray(object.groupByResults)) - throw TypeError(".google.cloud.securitycenter.v1beta1.GroupAssetsResponse.groupByResults: array expected"); - message.groupByResults = []; - for (var i = 0; i < object.groupByResults.length; ++i) { - if (typeof object.groupByResults[i] !== "object") - throw TypeError(".google.cloud.securitycenter.v1beta1.GroupAssetsResponse.groupByResults: object expected"); - message.groupByResults[i] = $root.google.cloud.securitycenter.v1beta1.GroupResult.fromObject(object.groupByResults[i]); - } + var message = new $root.google.cloud.securitycenter.v1beta1.RunAssetDiscoveryResponse(); + switch (object.state) { + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "COMPLETED": + case 1: + message.state = 1; + break; + case "SUPERSEDED": + case 2: + message.state = 2; + break; + case "TERMINATED": + case 3: + message.state = 3; + break; } - if (object.readTime != null) { - if (typeof object.readTime !== "object") - throw TypeError(".google.cloud.securitycenter.v1beta1.GroupAssetsResponse.readTime: object expected"); - message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); + if (object.duration != null) { + if (typeof object.duration !== "object") + throw TypeError(".google.cloud.securitycenter.v1beta1.RunAssetDiscoveryResponse.duration: object expected"); + message.duration = $root.google.protobuf.Duration.fromObject(object.duration); } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); return message; }; /** - * Creates a plain object from a GroupAssetsResponse message. Also converts values to other types if specified. + * Creates a plain object from a RunAssetDiscoveryResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.securitycenter.v1beta1.GroupAssetsResponse + * @memberof google.cloud.securitycenter.v1beta1.RunAssetDiscoveryResponse * @static - * @param {google.cloud.securitycenter.v1beta1.GroupAssetsResponse} message GroupAssetsResponse + * @param {google.cloud.securitycenter.v1beta1.RunAssetDiscoveryResponse} message RunAssetDiscoveryResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GroupAssetsResponse.toObject = function toObject(message, options) { + RunAssetDiscoveryResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.groupByResults = []; if (options.defaults) { - object.readTime = null; - object.nextPageToken = ""; - } - if (message.groupByResults && message.groupByResults.length) { - object.groupByResults = []; - for (var j = 0; j < message.groupByResults.length; ++j) - object.groupByResults[j] = $root.google.cloud.securitycenter.v1beta1.GroupResult.toObject(message.groupByResults[j], options); + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.duration = null; } - if (message.readTime != null && message.hasOwnProperty("readTime")) - object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.securitycenter.v1beta1.RunAssetDiscoveryResponse.State[message.state] : message.state; + if (message.duration != null && message.hasOwnProperty("duration")) + object.duration = $root.google.protobuf.Duration.toObject(message.duration, options); return object; }; /** - * Converts this GroupAssetsResponse to JSON. + * Converts this RunAssetDiscoveryResponse to JSON. * @function toJSON - * @memberof google.cloud.securitycenter.v1beta1.GroupAssetsResponse + * @memberof google.cloud.securitycenter.v1beta1.RunAssetDiscoveryResponse * @instance * @returns {Object.} JSON object */ - GroupAssetsResponse.prototype.toJSON = function toJSON() { + RunAssetDiscoveryResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return GroupAssetsResponse; + /** + * State enum. + * @name google.cloud.securitycenter.v1beta1.RunAssetDiscoveryResponse.State + * @enum {string} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} COMPLETED=1 COMPLETED value + * @property {number} SUPERSEDED=2 SUPERSEDED value + * @property {number} TERMINATED=3 TERMINATED value + */ + RunAssetDiscoveryResponse.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "COMPLETED"] = 1; + values[valuesById[2] = "SUPERSEDED"] = 2; + values[valuesById[3] = "TERMINATED"] = 3; + return values; + })(); + + return RunAssetDiscoveryResponse; })(); - v1beta1.GroupFindingsRequest = (function() { + v1beta1.OrganizationSettings = (function() { /** - * Properties of a GroupFindingsRequest. + * Properties of an OrganizationSettings. * @memberof google.cloud.securitycenter.v1beta1 - * @interface IGroupFindingsRequest - * @property {string|null} [parent] GroupFindingsRequest parent - * @property {string|null} [filter] GroupFindingsRequest filter - * @property {string|null} [groupBy] GroupFindingsRequest groupBy - * @property {google.protobuf.ITimestamp|null} [readTime] GroupFindingsRequest readTime - * @property {string|null} [pageToken] GroupFindingsRequest pageToken - * @property {number|null} [pageSize] GroupFindingsRequest pageSize + * @interface IOrganizationSettings + * @property {string|null} [name] OrganizationSettings name + * @property {boolean|null} [enableAssetDiscovery] OrganizationSettings enableAssetDiscovery + * @property {google.cloud.securitycenter.v1beta1.OrganizationSettings.IAssetDiscoveryConfig|null} [assetDiscoveryConfig] OrganizationSettings assetDiscoveryConfig */ /** - * Constructs a new GroupFindingsRequest. + * Constructs a new OrganizationSettings. * @memberof google.cloud.securitycenter.v1beta1 - * @classdesc Represents a GroupFindingsRequest. - * @implements IGroupFindingsRequest + * @classdesc Represents an OrganizationSettings. + * @implements IOrganizationSettings * @constructor - * @param {google.cloud.securitycenter.v1beta1.IGroupFindingsRequest=} [properties] Properties to set + * @param {google.cloud.securitycenter.v1beta1.IOrganizationSettings=} [properties] Properties to set */ - function GroupFindingsRequest(properties) { + function OrganizationSettings(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -11222,140 +11367,101 @@ } /** - * GroupFindingsRequest parent. - * @member {string} parent - * @memberof google.cloud.securitycenter.v1beta1.GroupFindingsRequest + * OrganizationSettings name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1beta1.OrganizationSettings * @instance */ - GroupFindingsRequest.prototype.parent = ""; + OrganizationSettings.prototype.name = ""; /** - * GroupFindingsRequest filter. - * @member {string} filter - * @memberof google.cloud.securitycenter.v1beta1.GroupFindingsRequest + * OrganizationSettings enableAssetDiscovery. + * @member {boolean} enableAssetDiscovery + * @memberof google.cloud.securitycenter.v1beta1.OrganizationSettings * @instance */ - GroupFindingsRequest.prototype.filter = ""; + OrganizationSettings.prototype.enableAssetDiscovery = false; /** - * GroupFindingsRequest groupBy. - * @member {string} groupBy - * @memberof google.cloud.securitycenter.v1beta1.GroupFindingsRequest + * OrganizationSettings assetDiscoveryConfig. + * @member {google.cloud.securitycenter.v1beta1.OrganizationSettings.IAssetDiscoveryConfig|null|undefined} assetDiscoveryConfig + * @memberof google.cloud.securitycenter.v1beta1.OrganizationSettings * @instance */ - GroupFindingsRequest.prototype.groupBy = ""; + OrganizationSettings.prototype.assetDiscoveryConfig = null; /** - * GroupFindingsRequest readTime. - * @member {google.protobuf.ITimestamp|null|undefined} readTime - * @memberof google.cloud.securitycenter.v1beta1.GroupFindingsRequest - * @instance + * Creates a new OrganizationSettings instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1beta1.OrganizationSettings + * @static + * @param {google.cloud.securitycenter.v1beta1.IOrganizationSettings=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1beta1.OrganizationSettings} OrganizationSettings instance */ - GroupFindingsRequest.prototype.readTime = null; + OrganizationSettings.create = function create(properties) { + return new OrganizationSettings(properties); + }; /** - * GroupFindingsRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.securitycenter.v1beta1.GroupFindingsRequest - * @instance - */ - GroupFindingsRequest.prototype.pageToken = ""; - - /** - * GroupFindingsRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.securitycenter.v1beta1.GroupFindingsRequest - * @instance - */ - GroupFindingsRequest.prototype.pageSize = 0; - - /** - * Creates a new GroupFindingsRequest instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v1beta1.GroupFindingsRequest - * @static - * @param {google.cloud.securitycenter.v1beta1.IGroupFindingsRequest=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1beta1.GroupFindingsRequest} GroupFindingsRequest instance - */ - GroupFindingsRequest.create = function create(properties) { - return new GroupFindingsRequest(properties); - }; - - /** - * Encodes the specified GroupFindingsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.GroupFindingsRequest.verify|verify} messages. + * Encodes the specified OrganizationSettings message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.OrganizationSettings.verify|verify} messages. * @function encode - * @memberof google.cloud.securitycenter.v1beta1.GroupFindingsRequest + * @memberof google.cloud.securitycenter.v1beta1.OrganizationSettings * @static - * @param {google.cloud.securitycenter.v1beta1.IGroupFindingsRequest} message GroupFindingsRequest message or plain object to encode + * @param {google.cloud.securitycenter.v1beta1.IOrganizationSettings} message OrganizationSettings message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GroupFindingsRequest.encode = function encode(message, writer) { + OrganizationSettings.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && message.hasOwnProperty("parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.filter != null && message.hasOwnProperty("filter")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); - if (message.groupBy != null && message.hasOwnProperty("groupBy")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.groupBy); - if (message.readTime != null && message.hasOwnProperty("readTime")) - $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.pageToken); - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - writer.uint32(/* id 6, wireType 0 =*/48).int32(message.pageSize); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.enableAssetDiscovery != null && message.hasOwnProperty("enableAssetDiscovery")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.enableAssetDiscovery); + if (message.assetDiscoveryConfig != null && message.hasOwnProperty("assetDiscoveryConfig")) + $root.google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig.encode(message.assetDiscoveryConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; /** - * Encodes the specified GroupFindingsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.GroupFindingsRequest.verify|verify} messages. + * Encodes the specified OrganizationSettings message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.OrganizationSettings.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1beta1.GroupFindingsRequest + * @memberof google.cloud.securitycenter.v1beta1.OrganizationSettings * @static - * @param {google.cloud.securitycenter.v1beta1.IGroupFindingsRequest} message GroupFindingsRequest message or plain object to encode + * @param {google.cloud.securitycenter.v1beta1.IOrganizationSettings} message OrganizationSettings message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GroupFindingsRequest.encodeDelimited = function encodeDelimited(message, writer) { + OrganizationSettings.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GroupFindingsRequest message from the specified reader or buffer. + * Decodes an OrganizationSettings message from the specified reader or buffer. * @function decode - * @memberof google.cloud.securitycenter.v1beta1.GroupFindingsRequest + * @memberof google.cloud.securitycenter.v1beta1.OrganizationSettings * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1beta1.GroupFindingsRequest} GroupFindingsRequest + * @returns {google.cloud.securitycenter.v1beta1.OrganizationSettings} OrganizationSettings * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GroupFindingsRequest.decode = function decode(reader, length) { + OrganizationSettings.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.cloud.securitycenter.v1beta1.GroupFindingsRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1beta1.OrganizationSettings(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.parent = reader.string(); + message.name = reader.string(); break; case 2: - message.filter = reader.string(); + message.enableAssetDiscovery = reader.bool(); break; case 3: - message.groupBy = reader.string(); - break; - case 4: - message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 5: - message.pageToken = reader.string(); - break; - case 6: - message.pageSize = reader.int32(); + message.assetDiscoveryConfig = $root.google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -11366,1275 +11472,1111 @@ }; /** - * Decodes a GroupFindingsRequest message from the specified reader or buffer, length delimited. + * Decodes an OrganizationSettings message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1beta1.GroupFindingsRequest + * @memberof google.cloud.securitycenter.v1beta1.OrganizationSettings * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1beta1.GroupFindingsRequest} GroupFindingsRequest + * @returns {google.cloud.securitycenter.v1beta1.OrganizationSettings} OrganizationSettings * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GroupFindingsRequest.decodeDelimited = function decodeDelimited(reader) { + OrganizationSettings.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GroupFindingsRequest message. + * Verifies an OrganizationSettings message. * @function verify - * @memberof google.cloud.securitycenter.v1beta1.GroupFindingsRequest + * @memberof google.cloud.securitycenter.v1beta1.OrganizationSettings * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GroupFindingsRequest.verify = function verify(message) { + OrganizationSettings.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.filter != null && message.hasOwnProperty("filter")) - if (!$util.isString(message.filter)) - return "filter: string expected"; - if (message.groupBy != null && message.hasOwnProperty("groupBy")) - if (!$util.isString(message.groupBy)) - return "groupBy: string expected"; - if (message.readTime != null && message.hasOwnProperty("readTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.readTime); + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.enableAssetDiscovery != null && message.hasOwnProperty("enableAssetDiscovery")) + if (typeof message.enableAssetDiscovery !== "boolean") + return "enableAssetDiscovery: boolean expected"; + if (message.assetDiscoveryConfig != null && message.hasOwnProperty("assetDiscoveryConfig")) { + var error = $root.google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig.verify(message.assetDiscoveryConfig); if (error) - return "readTime." + error; + return "assetDiscoveryConfig." + error; } - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; return null; }; /** - * Creates a GroupFindingsRequest message from a plain object. Also converts values to their respective internal types. + * Creates an OrganizationSettings message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.securitycenter.v1beta1.GroupFindingsRequest + * @memberof google.cloud.securitycenter.v1beta1.OrganizationSettings * @static * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1beta1.GroupFindingsRequest} GroupFindingsRequest + * @returns {google.cloud.securitycenter.v1beta1.OrganizationSettings} OrganizationSettings */ - GroupFindingsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1beta1.GroupFindingsRequest) + OrganizationSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1beta1.OrganizationSettings) return object; - var message = new $root.google.cloud.securitycenter.v1beta1.GroupFindingsRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.filter != null) - message.filter = String(object.filter); - if (object.groupBy != null) - message.groupBy = String(object.groupBy); - if (object.readTime != null) { - if (typeof object.readTime !== "object") - throw TypeError(".google.cloud.securitycenter.v1beta1.GroupFindingsRequest.readTime: object expected"); - message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); + var message = new $root.google.cloud.securitycenter.v1beta1.OrganizationSettings(); + if (object.name != null) + message.name = String(object.name); + if (object.enableAssetDiscovery != null) + message.enableAssetDiscovery = Boolean(object.enableAssetDiscovery); + if (object.assetDiscoveryConfig != null) { + if (typeof object.assetDiscoveryConfig !== "object") + throw TypeError(".google.cloud.securitycenter.v1beta1.OrganizationSettings.assetDiscoveryConfig: object expected"); + message.assetDiscoveryConfig = $root.google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig.fromObject(object.assetDiscoveryConfig); } - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; return message; }; /** - * Creates a plain object from a GroupFindingsRequest message. Also converts values to other types if specified. + * Creates a plain object from an OrganizationSettings message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.securitycenter.v1beta1.GroupFindingsRequest + * @memberof google.cloud.securitycenter.v1beta1.OrganizationSettings * @static - * @param {google.cloud.securitycenter.v1beta1.GroupFindingsRequest} message GroupFindingsRequest + * @param {google.cloud.securitycenter.v1beta1.OrganizationSettings} message OrganizationSettings * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GroupFindingsRequest.toObject = function toObject(message, options) { + OrganizationSettings.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.parent = ""; - object.filter = ""; - object.groupBy = ""; - object.readTime = null; - object.pageToken = ""; - object.pageSize = 0; + object.name = ""; + object.enableAssetDiscovery = false; + object.assetDiscoveryConfig = null; } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.filter != null && message.hasOwnProperty("filter")) - object.filter = message.filter; - if (message.groupBy != null && message.hasOwnProperty("groupBy")) - object.groupBy = message.groupBy; - if (message.readTime != null && message.hasOwnProperty("readTime")) - object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.enableAssetDiscovery != null && message.hasOwnProperty("enableAssetDiscovery")) + object.enableAssetDiscovery = message.enableAssetDiscovery; + if (message.assetDiscoveryConfig != null && message.hasOwnProperty("assetDiscoveryConfig")) + object.assetDiscoveryConfig = $root.google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig.toObject(message.assetDiscoveryConfig, options); return object; }; /** - * Converts this GroupFindingsRequest to JSON. + * Converts this OrganizationSettings to JSON. * @function toJSON - * @memberof google.cloud.securitycenter.v1beta1.GroupFindingsRequest + * @memberof google.cloud.securitycenter.v1beta1.OrganizationSettings * @instance * @returns {Object.} JSON object */ - GroupFindingsRequest.prototype.toJSON = function toJSON() { + OrganizationSettings.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return GroupFindingsRequest; - })(); + OrganizationSettings.AssetDiscoveryConfig = (function() { - v1beta1.GroupFindingsResponse = (function() { + /** + * Properties of an AssetDiscoveryConfig. + * @memberof google.cloud.securitycenter.v1beta1.OrganizationSettings + * @interface IAssetDiscoveryConfig + * @property {Array.|null} [projectIds] AssetDiscoveryConfig projectIds + * @property {google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode|null} [inclusionMode] AssetDiscoveryConfig inclusionMode + */ - /** - * Properties of a GroupFindingsResponse. - * @memberof google.cloud.securitycenter.v1beta1 - * @interface IGroupFindingsResponse - * @property {Array.|null} [groupByResults] GroupFindingsResponse groupByResults - * @property {google.protobuf.ITimestamp|null} [readTime] GroupFindingsResponse readTime - * @property {string|null} [nextPageToken] GroupFindingsResponse nextPageToken - */ + /** + * Constructs a new AssetDiscoveryConfig. + * @memberof google.cloud.securitycenter.v1beta1.OrganizationSettings + * @classdesc Represents an AssetDiscoveryConfig. + * @implements IAssetDiscoveryConfig + * @constructor + * @param {google.cloud.securitycenter.v1beta1.OrganizationSettings.IAssetDiscoveryConfig=} [properties] Properties to set + */ + function AssetDiscoveryConfig(properties) { + this.projectIds = []; + 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]]; + } - /** - * Constructs a new GroupFindingsResponse. - * @memberof google.cloud.securitycenter.v1beta1 - * @classdesc Represents a GroupFindingsResponse. - * @implements IGroupFindingsResponse - * @constructor - * @param {google.cloud.securitycenter.v1beta1.IGroupFindingsResponse=} [properties] Properties to set - */ - function GroupFindingsResponse(properties) { - this.groupByResults = []; - 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]]; - } + /** + * AssetDiscoveryConfig projectIds. + * @member {Array.} projectIds + * @memberof google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig + * @instance + */ + AssetDiscoveryConfig.prototype.projectIds = $util.emptyArray; - /** - * GroupFindingsResponse groupByResults. - * @member {Array.} groupByResults - * @memberof google.cloud.securitycenter.v1beta1.GroupFindingsResponse - * @instance - */ - GroupFindingsResponse.prototype.groupByResults = $util.emptyArray; + /** + * AssetDiscoveryConfig inclusionMode. + * @member {google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode} inclusionMode + * @memberof google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig + * @instance + */ + AssetDiscoveryConfig.prototype.inclusionMode = 0; - /** - * GroupFindingsResponse readTime. - * @member {google.protobuf.ITimestamp|null|undefined} readTime - * @memberof google.cloud.securitycenter.v1beta1.GroupFindingsResponse - * @instance - */ - GroupFindingsResponse.prototype.readTime = null; + /** + * Creates a new AssetDiscoveryConfig instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig + * @static + * @param {google.cloud.securitycenter.v1beta1.OrganizationSettings.IAssetDiscoveryConfig=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig} AssetDiscoveryConfig instance + */ + AssetDiscoveryConfig.create = function create(properties) { + return new AssetDiscoveryConfig(properties); + }; - /** - * GroupFindingsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.securitycenter.v1beta1.GroupFindingsResponse - * @instance - */ - GroupFindingsResponse.prototype.nextPageToken = ""; + /** + * Encodes the specified AssetDiscoveryConfig message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig + * @static + * @param {google.cloud.securitycenter.v1beta1.OrganizationSettings.IAssetDiscoveryConfig} message AssetDiscoveryConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AssetDiscoveryConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.projectIds != null && message.projectIds.length) + for (var i = 0; i < message.projectIds.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectIds[i]); + if (message.inclusionMode != null && message.hasOwnProperty("inclusionMode")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.inclusionMode); + return writer; + }; - /** - * Creates a new GroupFindingsResponse instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v1beta1.GroupFindingsResponse - * @static - * @param {google.cloud.securitycenter.v1beta1.IGroupFindingsResponse=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1beta1.GroupFindingsResponse} GroupFindingsResponse instance - */ - GroupFindingsResponse.create = function create(properties) { - return new GroupFindingsResponse(properties); - }; + /** + * Encodes the specified AssetDiscoveryConfig message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig + * @static + * @param {google.cloud.securitycenter.v1beta1.OrganizationSettings.IAssetDiscoveryConfig} message AssetDiscoveryConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AssetDiscoveryConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Encodes the specified GroupFindingsResponse message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.GroupFindingsResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1beta1.GroupFindingsResponse - * @static - * @param {google.cloud.securitycenter.v1beta1.IGroupFindingsResponse} message GroupFindingsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GroupFindingsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.groupByResults != null && message.groupByResults.length) - for (var i = 0; i < message.groupByResults.length; ++i) - $root.google.cloud.securitycenter.v1beta1.GroupResult.encode(message.groupByResults[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.readTime != null && message.hasOwnProperty("readTime")) - $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.nextPageToken); - return writer; - }; + /** + * Decodes an AssetDiscoveryConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig} AssetDiscoveryConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AssetDiscoveryConfig.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.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.projectIds && message.projectIds.length)) + message.projectIds = []; + message.projectIds.push(reader.string()); + break; + case 2: + message.inclusionMode = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Encodes the specified GroupFindingsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.GroupFindingsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1beta1.GroupFindingsResponse - * @static - * @param {google.cloud.securitycenter.v1beta1.IGroupFindingsResponse} message GroupFindingsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GroupFindingsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Decodes an AssetDiscoveryConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig} AssetDiscoveryConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AssetDiscoveryConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Decodes a GroupFindingsResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v1beta1.GroupFindingsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1beta1.GroupFindingsResponse} GroupFindingsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GroupFindingsResponse.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.cloud.securitycenter.v1beta1.GroupFindingsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { + /** + * Verifies an AssetDiscoveryConfig message. + * @function verify + * @memberof google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AssetDiscoveryConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.projectIds != null && message.hasOwnProperty("projectIds")) { + if (!Array.isArray(message.projectIds)) + return "projectIds: array expected"; + for (var i = 0; i < message.projectIds.length; ++i) + if (!$util.isString(message.projectIds[i])) + return "projectIds: string[] expected"; + } + if (message.inclusionMode != null && message.hasOwnProperty("inclusionMode")) + switch (message.inclusionMode) { + default: + return "inclusionMode: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates an AssetDiscoveryConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig} AssetDiscoveryConfig + */ + AssetDiscoveryConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig) + return object; + var message = new $root.google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig(); + if (object.projectIds) { + if (!Array.isArray(object.projectIds)) + throw TypeError(".google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig.projectIds: array expected"); + message.projectIds = []; + for (var i = 0; i < object.projectIds.length; ++i) + message.projectIds[i] = String(object.projectIds[i]); + } + switch (object.inclusionMode) { + case "INCLUSION_MODE_UNSPECIFIED": + case 0: + message.inclusionMode = 0; + break; + case "INCLUDE_ONLY": case 1: - if (!(message.groupByResults && message.groupByResults.length)) - message.groupByResults = []; - message.groupByResults.push($root.google.cloud.securitycenter.v1beta1.GroupResult.decode(reader, reader.uint32())); + message.inclusionMode = 1; break; + case "EXCLUDE": case 2: - message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 3: - message.nextPageToken = reader.string(); - break; - default: - reader.skipType(tag & 7); + message.inclusionMode = 2; break; } - } - return message; - }; + return message; + }; - /** - * Decodes a GroupFindingsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1beta1.GroupFindingsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1beta1.GroupFindingsResponse} GroupFindingsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GroupFindingsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Creates a plain object from an AssetDiscoveryConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig + * @static + * @param {google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig} message AssetDiscoveryConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AssetDiscoveryConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.projectIds = []; + if (options.defaults) + object.inclusionMode = options.enums === String ? "INCLUSION_MODE_UNSPECIFIED" : 0; + if (message.projectIds && message.projectIds.length) { + object.projectIds = []; + for (var j = 0; j < message.projectIds.length; ++j) + object.projectIds[j] = message.projectIds[j]; + } + if (message.inclusionMode != null && message.hasOwnProperty("inclusionMode")) + object.inclusionMode = options.enums === String ? $root.google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode[message.inclusionMode] : message.inclusionMode; + return object; + }; + + /** + * Converts this AssetDiscoveryConfig to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig + * @instance + * @returns {Object.} JSON object + */ + AssetDiscoveryConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * InclusionMode enum. + * @name google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode + * @enum {string} + * @property {number} INCLUSION_MODE_UNSPECIFIED=0 INCLUSION_MODE_UNSPECIFIED value + * @property {number} INCLUDE_ONLY=1 INCLUDE_ONLY value + * @property {number} EXCLUDE=2 EXCLUDE value + */ + AssetDiscoveryConfig.InclusionMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "INCLUSION_MODE_UNSPECIFIED"] = 0; + values[valuesById[1] = "INCLUDE_ONLY"] = 1; + values[valuesById[2] = "EXCLUDE"] = 2; + return values; + })(); + + return AssetDiscoveryConfig; + })(); + + return OrganizationSettings; + })(); + + v1beta1.SecurityCenter = (function() { /** - * Verifies a GroupFindingsResponse message. - * @function verify - * @memberof google.cloud.securitycenter.v1beta1.GroupFindingsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not + * Constructs a new SecurityCenter service. + * @memberof google.cloud.securitycenter.v1beta1 + * @classdesc Represents a SecurityCenter + * @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 */ - GroupFindingsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.groupByResults != null && message.hasOwnProperty("groupByResults")) { - if (!Array.isArray(message.groupByResults)) - return "groupByResults: array expected"; - for (var i = 0; i < message.groupByResults.length; ++i) { - var error = $root.google.cloud.securitycenter.v1beta1.GroupResult.verify(message.groupByResults[i]); - if (error) - return "groupByResults." + error; - } - } - if (message.readTime != null && message.hasOwnProperty("readTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.readTime); - if (error) - return "readTime." + error; - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - return null; - }; + function SecurityCenter(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (SecurityCenter.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = SecurityCenter; /** - * Creates a GroupFindingsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v1beta1.GroupFindingsResponse + * Creates new SecurityCenter service using the specified rpc implementation. + * @function create + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1beta1.GroupFindingsResponse} GroupFindingsResponse + * @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 {SecurityCenter} RPC service. Useful where requests and/or responses are streamed. */ - GroupFindingsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1beta1.GroupFindingsResponse) - return object; - var message = new $root.google.cloud.securitycenter.v1beta1.GroupFindingsResponse(); - if (object.groupByResults) { - if (!Array.isArray(object.groupByResults)) - throw TypeError(".google.cloud.securitycenter.v1beta1.GroupFindingsResponse.groupByResults: array expected"); - message.groupByResults = []; - for (var i = 0; i < object.groupByResults.length; ++i) { - if (typeof object.groupByResults[i] !== "object") - throw TypeError(".google.cloud.securitycenter.v1beta1.GroupFindingsResponse.groupByResults: object expected"); - message.groupByResults[i] = $root.google.cloud.securitycenter.v1beta1.GroupResult.fromObject(object.groupByResults[i]); - } - } - if (object.readTime != null) { - if (typeof object.readTime !== "object") - throw TypeError(".google.cloud.securitycenter.v1beta1.GroupFindingsResponse.readTime: object expected"); - message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - return message; + SecurityCenter.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); }; /** - * Creates a plain object from a GroupFindingsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v1beta1.GroupFindingsResponse - * @static - * @param {google.cloud.securitycenter.v1beta1.GroupFindingsResponse} message GroupFindingsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object + * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter#createSource}. + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @typedef CreateSourceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1beta1.Source} [response] Source */ - GroupFindingsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.groupByResults = []; - if (options.defaults) { - object.readTime = null; - object.nextPageToken = ""; - } - if (message.groupByResults && message.groupByResults.length) { - object.groupByResults = []; - for (var j = 0; j < message.groupByResults.length; ++j) - object.groupByResults[j] = $root.google.cloud.securitycenter.v1beta1.GroupResult.toObject(message.groupByResults[j], options); - } - if (message.readTime != null && message.hasOwnProperty("readTime")) - object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - return object; - }; /** - * Converts this GroupFindingsResponse to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1beta1.GroupFindingsResponse + * Calls CreateSource. + * @function createSource + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter * @instance - * @returns {Object.} JSON object + * @param {google.cloud.securitycenter.v1beta1.ICreateSourceRequest} request CreateSourceRequest message or plain object + * @param {google.cloud.securitycenter.v1beta1.SecurityCenter.CreateSourceCallback} callback Node-style callback called with the error, if any, and Source + * @returns {undefined} + * @variation 1 */ - GroupFindingsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return GroupFindingsResponse; - })(); - - v1beta1.GroupResult = (function() { + Object.defineProperty(SecurityCenter.prototype.createSource = function createSource(request, callback) { + return this.rpcCall(createSource, $root.google.cloud.securitycenter.v1beta1.CreateSourceRequest, $root.google.cloud.securitycenter.v1beta1.Source, request, callback); + }, "name", { value: "CreateSource" }); /** - * Properties of a GroupResult. - * @memberof google.cloud.securitycenter.v1beta1 - * @interface IGroupResult - * @property {Object.|null} [properties] GroupResult properties - * @property {number|Long|null} [count] GroupResult count + * Calls CreateSource. + * @function createSource + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1beta1.ICreateSourceRequest} request CreateSourceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ /** - * Constructs a new GroupResult. - * @memberof google.cloud.securitycenter.v1beta1 - * @classdesc Represents a GroupResult. - * @implements IGroupResult - * @constructor - * @param {google.cloud.securitycenter.v1beta1.IGroupResult=} [properties] Properties to set + * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter#createFinding}. + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @typedef CreateFindingCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1beta1.Finding} [response] Finding */ - function GroupResult(properties) { - this.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]]; - } /** - * GroupResult properties. - * @member {Object.} properties - * @memberof google.cloud.securitycenter.v1beta1.GroupResult + * Calls CreateFinding. + * @function createFinding + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter * @instance + * @param {google.cloud.securitycenter.v1beta1.ICreateFindingRequest} request CreateFindingRequest message or plain object + * @param {google.cloud.securitycenter.v1beta1.SecurityCenter.CreateFindingCallback} callback Node-style callback called with the error, if any, and Finding + * @returns {undefined} + * @variation 1 */ - GroupResult.prototype.properties = $util.emptyObject; + Object.defineProperty(SecurityCenter.prototype.createFinding = function createFinding(request, callback) { + return this.rpcCall(createFinding, $root.google.cloud.securitycenter.v1beta1.CreateFindingRequest, $root.google.cloud.securitycenter.v1beta1.Finding, request, callback); + }, "name", { value: "CreateFinding" }); /** - * GroupResult count. - * @member {number|Long} count - * @memberof google.cloud.securitycenter.v1beta1.GroupResult + * Calls CreateFinding. + * @function createFinding + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter * @instance + * @param {google.cloud.securitycenter.v1beta1.ICreateFindingRequest} request CreateFindingRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - GroupResult.prototype.count = $util.Long ? $util.Long.fromBits(0,0,false) : 0; /** - * Creates a new GroupResult instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v1beta1.GroupResult - * @static - * @param {google.cloud.securitycenter.v1beta1.IGroupResult=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1beta1.GroupResult} GroupResult instance + * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter#getIamPolicy}. + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @typedef GetIamPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.iam.v1.Policy} [response] Policy */ - GroupResult.create = function create(properties) { - return new GroupResult(properties); - }; /** - * Encodes the specified GroupResult message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.GroupResult.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1beta1.GroupResult - * @static - * @param {google.cloud.securitycenter.v1beta1.IGroupResult} message GroupResult message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * Calls GetIamPolicy. + * @function getIamPolicy + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @instance + * @param {google.iam.v1.IGetIamPolicyRequest} request GetIamPolicyRequest message or plain object + * @param {google.cloud.securitycenter.v1beta1.SecurityCenter.GetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy + * @returns {undefined} + * @variation 1 */ - GroupResult.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.properties != null && message.hasOwnProperty("properties")) - for (var keys = Object.keys(message.properties), i = 0; i < keys.length; ++i) { - writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); - $root.google.protobuf.Value.encode(message.properties[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); - } - if (message.count != null && message.hasOwnProperty("count")) - writer.uint32(/* id 2, wireType 0 =*/16).int64(message.count); - return writer; - }; + Object.defineProperty(SecurityCenter.prototype.getIamPolicy = function getIamPolicy(request, callback) { + return this.rpcCall(getIamPolicy, $root.google.iam.v1.GetIamPolicyRequest, $root.google.iam.v1.Policy, request, callback); + }, "name", { value: "GetIamPolicy" }); /** - * Encodes the specified GroupResult message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.GroupResult.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1beta1.GroupResult - * @static - * @param {google.cloud.securitycenter.v1beta1.IGroupResult} message GroupResult message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * Calls GetIamPolicy. + * @function getIamPolicy + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @instance + * @param {google.iam.v1.IGetIamPolicyRequest} request GetIamPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - GroupResult.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; /** - * Decodes a GroupResult message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v1beta1.GroupResult - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1beta1.GroupResult} GroupResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter#getOrganizationSettings}. + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @typedef GetOrganizationSettingsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1beta1.OrganizationSettings} [response] OrganizationSettings */ - GroupResult.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.cloud.securitycenter.v1beta1.GroupResult(), key; - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - reader.skip().pos++; - if (message.properties === $util.emptyObject) - message.properties = {}; - key = reader.string(); - reader.pos++; - message.properties[key] = $root.google.protobuf.Value.decode(reader, reader.uint32()); - break; - case 2: - message.count = reader.int64(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; /** - * Decodes a GroupResult message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1beta1.GroupResult - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1beta1.GroupResult} GroupResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Calls GetOrganizationSettings. + * @function getOrganizationSettings + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1beta1.IGetOrganizationSettingsRequest} request GetOrganizationSettingsRequest message or plain object + * @param {google.cloud.securitycenter.v1beta1.SecurityCenter.GetOrganizationSettingsCallback} callback Node-style callback called with the error, if any, and OrganizationSettings + * @returns {undefined} + * @variation 1 */ - GroupResult.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + Object.defineProperty(SecurityCenter.prototype.getOrganizationSettings = function getOrganizationSettings(request, callback) { + return this.rpcCall(getOrganizationSettings, $root.google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest, $root.google.cloud.securitycenter.v1beta1.OrganizationSettings, request, callback); + }, "name", { value: "GetOrganizationSettings" }); /** - * Verifies a GroupResult message. - * @function verify - * @memberof google.cloud.securitycenter.v1beta1.GroupResult - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not + * Calls GetOrganizationSettings. + * @function getOrganizationSettings + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1beta1.IGetOrganizationSettingsRequest} request GetOrganizationSettingsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - GroupResult.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.properties != null && message.hasOwnProperty("properties")) { - if (!$util.isObject(message.properties)) - return "properties: object expected"; - var key = Object.keys(message.properties); - for (var i = 0; i < key.length; ++i) { - var error = $root.google.protobuf.Value.verify(message.properties[key[i]]); - if (error) - return "properties." + error; - } - } - if (message.count != null && message.hasOwnProperty("count")) - if (!$util.isInteger(message.count) && !(message.count && $util.isInteger(message.count.low) && $util.isInteger(message.count.high))) - return "count: integer|Long expected"; - return null; - }; /** - * Creates a GroupResult message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v1beta1.GroupResult - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1beta1.GroupResult} GroupResult + * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter#getSource}. + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @typedef GetSourceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1beta1.Source} [response] Source */ - GroupResult.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1beta1.GroupResult) - return object; - var message = new $root.google.cloud.securitycenter.v1beta1.GroupResult(); - if (object.properties) { - if (typeof object.properties !== "object") - throw TypeError(".google.cloud.securitycenter.v1beta1.GroupResult.properties: object expected"); - message.properties = {}; - for (var keys = Object.keys(object.properties), i = 0; i < keys.length; ++i) { - if (typeof object.properties[keys[i]] !== "object") - throw TypeError(".google.cloud.securitycenter.v1beta1.GroupResult.properties: object expected"); - message.properties[keys[i]] = $root.google.protobuf.Value.fromObject(object.properties[keys[i]]); - } - } - if (object.count != null) - if ($util.Long) - (message.count = $util.Long.fromValue(object.count)).unsigned = false; - else if (typeof object.count === "string") - message.count = parseInt(object.count, 10); - else if (typeof object.count === "number") - message.count = object.count; - else if (typeof object.count === "object") - message.count = new $util.LongBits(object.count.low >>> 0, object.count.high >>> 0).toNumber(); - return message; - }; /** - * Creates a plain object from a GroupResult message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v1beta1.GroupResult - * @static - * @param {google.cloud.securitycenter.v1beta1.GroupResult} message GroupResult - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object + * Calls GetSource. + * @function getSource + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1beta1.IGetSourceRequest} request GetSourceRequest message or plain object + * @param {google.cloud.securitycenter.v1beta1.SecurityCenter.GetSourceCallback} callback Node-style callback called with the error, if any, and Source + * @returns {undefined} + * @variation 1 */ - GroupResult.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.objects || options.defaults) - object.properties = {}; - if (options.defaults) - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.count = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.count = options.longs === String ? "0" : 0; - var keys2; - if (message.properties && (keys2 = Object.keys(message.properties)).length) { - object.properties = {}; - for (var j = 0; j < keys2.length; ++j) - object.properties[keys2[j]] = $root.google.protobuf.Value.toObject(message.properties[keys2[j]], options); - } - if (message.count != null && message.hasOwnProperty("count")) - if (typeof message.count === "number") - object.count = options.longs === String ? String(message.count) : message.count; - else - object.count = options.longs === String ? $util.Long.prototype.toString.call(message.count) : options.longs === Number ? new $util.LongBits(message.count.low >>> 0, message.count.high >>> 0).toNumber() : message.count; - return object; - }; + Object.defineProperty(SecurityCenter.prototype.getSource = function getSource(request, callback) { + return this.rpcCall(getSource, $root.google.cloud.securitycenter.v1beta1.GetSourceRequest, $root.google.cloud.securitycenter.v1beta1.Source, request, callback); + }, "name", { value: "GetSource" }); /** - * Converts this GroupResult to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1beta1.GroupResult + * Calls GetSource. + * @function getSource + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter * @instance - * @returns {Object.} JSON object + * @param {google.cloud.securitycenter.v1beta1.IGetSourceRequest} request GetSourceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - GroupResult.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return GroupResult; - })(); - - v1beta1.ListSourcesRequest = (function() { /** - * Properties of a ListSourcesRequest. - * @memberof google.cloud.securitycenter.v1beta1 - * @interface IListSourcesRequest - * @property {string|null} [parent] ListSourcesRequest parent - * @property {string|null} [pageToken] ListSourcesRequest pageToken - * @property {number|null} [pageSize] ListSourcesRequest pageSize + * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter#groupAssets}. + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @typedef GroupAssetsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1beta1.GroupAssetsResponse} [response] GroupAssetsResponse */ /** - * Constructs a new ListSourcesRequest. - * @memberof google.cloud.securitycenter.v1beta1 - * @classdesc Represents a ListSourcesRequest. - * @implements IListSourcesRequest - * @constructor - * @param {google.cloud.securitycenter.v1beta1.IListSourcesRequest=} [properties] Properties to set + * Calls GroupAssets. + * @function groupAssets + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1beta1.IGroupAssetsRequest} request GroupAssetsRequest message or plain object + * @param {google.cloud.securitycenter.v1beta1.SecurityCenter.GroupAssetsCallback} callback Node-style callback called with the error, if any, and GroupAssetsResponse + * @returns {undefined} + * @variation 1 */ - function ListSourcesRequest(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]]; - } + Object.defineProperty(SecurityCenter.prototype.groupAssets = function groupAssets(request, callback) { + return this.rpcCall(groupAssets, $root.google.cloud.securitycenter.v1beta1.GroupAssetsRequest, $root.google.cloud.securitycenter.v1beta1.GroupAssetsResponse, request, callback); + }, "name", { value: "GroupAssets" }); /** - * ListSourcesRequest parent. - * @member {string} parent - * @memberof google.cloud.securitycenter.v1beta1.ListSourcesRequest + * Calls GroupAssets. + * @function groupAssets + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter * @instance + * @param {google.cloud.securitycenter.v1beta1.IGroupAssetsRequest} request GroupAssetsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - ListSourcesRequest.prototype.parent = ""; /** - * ListSourcesRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.securitycenter.v1beta1.ListSourcesRequest + * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter#groupFindings}. + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @typedef GroupFindingsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1beta1.GroupFindingsResponse} [response] GroupFindingsResponse + */ + + /** + * Calls GroupFindings. + * @function groupFindings + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter * @instance + * @param {google.cloud.securitycenter.v1beta1.IGroupFindingsRequest} request GroupFindingsRequest message or plain object + * @param {google.cloud.securitycenter.v1beta1.SecurityCenter.GroupFindingsCallback} callback Node-style callback called with the error, if any, and GroupFindingsResponse + * @returns {undefined} + * @variation 1 */ - ListSourcesRequest.prototype.pageToken = ""; + Object.defineProperty(SecurityCenter.prototype.groupFindings = function groupFindings(request, callback) { + return this.rpcCall(groupFindings, $root.google.cloud.securitycenter.v1beta1.GroupFindingsRequest, $root.google.cloud.securitycenter.v1beta1.GroupFindingsResponse, request, callback); + }, "name", { value: "GroupFindings" }); /** - * ListSourcesRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.securitycenter.v1beta1.ListSourcesRequest + * Calls GroupFindings. + * @function groupFindings + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter * @instance + * @param {google.cloud.securitycenter.v1beta1.IGroupFindingsRequest} request GroupFindingsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - ListSourcesRequest.prototype.pageSize = 0; /** - * Creates a new ListSourcesRequest instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v1beta1.ListSourcesRequest - * @static - * @param {google.cloud.securitycenter.v1beta1.IListSourcesRequest=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1beta1.ListSourcesRequest} ListSourcesRequest instance + * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter#listAssets}. + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @typedef ListAssetsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1beta1.ListAssetsResponse} [response] ListAssetsResponse */ - ListSourcesRequest.create = function create(properties) { - return new ListSourcesRequest(properties); - }; /** - * Encodes the specified ListSourcesRequest message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.ListSourcesRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1beta1.ListSourcesRequest - * @static - * @param {google.cloud.securitycenter.v1beta1.IListSourcesRequest} message ListSourcesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * Calls ListAssets. + * @function listAssets + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1beta1.IListAssetsRequest} request ListAssetsRequest message or plain object + * @param {google.cloud.securitycenter.v1beta1.SecurityCenter.ListAssetsCallback} callback Node-style callback called with the error, if any, and ListAssetsResponse + * @returns {undefined} + * @variation 1 */ - ListSourcesRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && message.hasOwnProperty("parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.pageToken); - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - writer.uint32(/* id 7, wireType 0 =*/56).int32(message.pageSize); - return writer; - }; + Object.defineProperty(SecurityCenter.prototype.listAssets = function listAssets(request, callback) { + return this.rpcCall(listAssets, $root.google.cloud.securitycenter.v1beta1.ListAssetsRequest, $root.google.cloud.securitycenter.v1beta1.ListAssetsResponse, request, callback); + }, "name", { value: "ListAssets" }); /** - * Encodes the specified ListSourcesRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.ListSourcesRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1beta1.ListSourcesRequest - * @static - * @param {google.cloud.securitycenter.v1beta1.IListSourcesRequest} message ListSourcesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * Calls ListAssets. + * @function listAssets + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1beta1.IListAssetsRequest} request ListAssetsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - ListSourcesRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; /** - * Decodes a ListSourcesRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v1beta1.ListSourcesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1beta1.ListSourcesRequest} ListSourcesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter#listFindings}. + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @typedef ListFindingsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1beta1.ListFindingsResponse} [response] ListFindingsResponse */ - ListSourcesRequest.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.cloud.securitycenter.v1beta1.ListSourcesRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.parent = reader.string(); - break; - case 2: - message.pageToken = reader.string(); - break; - case 7: - message.pageSize = reader.int32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; /** - * Decodes a ListSourcesRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1beta1.ListSourcesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1beta1.ListSourcesRequest} ListSourcesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Calls ListFindings. + * @function listFindings + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1beta1.IListFindingsRequest} request ListFindingsRequest message or plain object + * @param {google.cloud.securitycenter.v1beta1.SecurityCenter.ListFindingsCallback} callback Node-style callback called with the error, if any, and ListFindingsResponse + * @returns {undefined} + * @variation 1 */ - ListSourcesRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + Object.defineProperty(SecurityCenter.prototype.listFindings = function listFindings(request, callback) { + return this.rpcCall(listFindings, $root.google.cloud.securitycenter.v1beta1.ListFindingsRequest, $root.google.cloud.securitycenter.v1beta1.ListFindingsResponse, request, callback); + }, "name", { value: "ListFindings" }); /** - * Verifies a ListSourcesRequest message. - * @function verify - * @memberof google.cloud.securitycenter.v1beta1.ListSourcesRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not + * Calls ListFindings. + * @function listFindings + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1beta1.IListFindingsRequest} request ListFindingsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - ListSourcesRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; - return null; - }; /** - * Creates a ListSourcesRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v1beta1.ListSourcesRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1beta1.ListSourcesRequest} ListSourcesRequest + * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter#listSources}. + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @typedef ListSourcesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1beta1.ListSourcesResponse} [response] ListSourcesResponse */ - ListSourcesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1beta1.ListSourcesRequest) - return object; - var message = new $root.google.cloud.securitycenter.v1beta1.ListSourcesRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - return message; - }; /** - * Creates a plain object from a ListSourcesRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v1beta1.ListSourcesRequest - * @static - * @param {google.cloud.securitycenter.v1beta1.ListSourcesRequest} message ListSourcesRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object + * Calls ListSources. + * @function listSources + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1beta1.IListSourcesRequest} request ListSourcesRequest message or plain object + * @param {google.cloud.securitycenter.v1beta1.SecurityCenter.ListSourcesCallback} callback Node-style callback called with the error, if any, and ListSourcesResponse + * @returns {undefined} + * @variation 1 */ - ListSourcesRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.pageToken = ""; - object.pageSize = 0; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - return object; - }; + Object.defineProperty(SecurityCenter.prototype.listSources = function listSources(request, callback) { + return this.rpcCall(listSources, $root.google.cloud.securitycenter.v1beta1.ListSourcesRequest, $root.google.cloud.securitycenter.v1beta1.ListSourcesResponse, request, callback); + }, "name", { value: "ListSources" }); /** - * Converts this ListSourcesRequest to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1beta1.ListSourcesRequest + * Calls ListSources. + * @function listSources + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter * @instance - * @returns {Object.} JSON object + * @param {google.cloud.securitycenter.v1beta1.IListSourcesRequest} request ListSourcesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - ListSourcesRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - return ListSourcesRequest; - })(); + /** + * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter#runAssetDiscovery}. + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @typedef RunAssetDiscoveryCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ - v1beta1.ListSourcesResponse = (function() { + /** + * Calls RunAssetDiscovery. + * @function runAssetDiscovery + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1beta1.IRunAssetDiscoveryRequest} request RunAssetDiscoveryRequest message or plain object + * @param {google.cloud.securitycenter.v1beta1.SecurityCenter.RunAssetDiscoveryCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.runAssetDiscovery = function runAssetDiscovery(request, callback) { + return this.rpcCall(runAssetDiscovery, $root.google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "RunAssetDiscovery" }); /** - * Properties of a ListSourcesResponse. - * @memberof google.cloud.securitycenter.v1beta1 - * @interface IListSourcesResponse - * @property {Array.|null} [sources] ListSourcesResponse sources - * @property {string|null} [nextPageToken] ListSourcesResponse nextPageToken + * Calls RunAssetDiscovery. + * @function runAssetDiscovery + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1beta1.IRunAssetDiscoveryRequest} request RunAssetDiscoveryRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ /** - * Constructs a new ListSourcesResponse. - * @memberof google.cloud.securitycenter.v1beta1 - * @classdesc Represents a ListSourcesResponse. - * @implements IListSourcesResponse - * @constructor - * @param {google.cloud.securitycenter.v1beta1.IListSourcesResponse=} [properties] Properties to set + * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter#setFindingState}. + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @typedef SetFindingStateCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1beta1.Finding} [response] Finding */ - function ListSourcesResponse(properties) { - this.sources = []; - 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]]; - } /** - * ListSourcesResponse sources. - * @member {Array.} sources - * @memberof google.cloud.securitycenter.v1beta1.ListSourcesResponse + * Calls SetFindingState. + * @function setFindingState + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter * @instance + * @param {google.cloud.securitycenter.v1beta1.ISetFindingStateRequest} request SetFindingStateRequest message or plain object + * @param {google.cloud.securitycenter.v1beta1.SecurityCenter.SetFindingStateCallback} callback Node-style callback called with the error, if any, and Finding + * @returns {undefined} + * @variation 1 */ - ListSourcesResponse.prototype.sources = $util.emptyArray; + Object.defineProperty(SecurityCenter.prototype.setFindingState = function setFindingState(request, callback) { + return this.rpcCall(setFindingState, $root.google.cloud.securitycenter.v1beta1.SetFindingStateRequest, $root.google.cloud.securitycenter.v1beta1.Finding, request, callback); + }, "name", { value: "SetFindingState" }); /** - * ListSourcesResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.securitycenter.v1beta1.ListSourcesResponse + * Calls SetFindingState. + * @function setFindingState + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter * @instance + * @param {google.cloud.securitycenter.v1beta1.ISetFindingStateRequest} request SetFindingStateRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - ListSourcesResponse.prototype.nextPageToken = ""; /** - * Creates a new ListSourcesResponse instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v1beta1.ListSourcesResponse - * @static - * @param {google.cloud.securitycenter.v1beta1.IListSourcesResponse=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1beta1.ListSourcesResponse} ListSourcesResponse instance + * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter#setIamPolicy}. + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @typedef SetIamPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.iam.v1.Policy} [response] Policy */ - ListSourcesResponse.create = function create(properties) { - return new ListSourcesResponse(properties); - }; /** - * Encodes the specified ListSourcesResponse message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.ListSourcesResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1beta1.ListSourcesResponse - * @static - * @param {google.cloud.securitycenter.v1beta1.IListSourcesResponse} message ListSourcesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * Calls SetIamPolicy. + * @function setIamPolicy + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @instance + * @param {google.iam.v1.ISetIamPolicyRequest} request SetIamPolicyRequest message or plain object + * @param {google.cloud.securitycenter.v1beta1.SecurityCenter.SetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy + * @returns {undefined} + * @variation 1 */ - ListSourcesResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.sources != null && message.sources.length) - for (var i = 0; i < message.sources.length; ++i) - $root.google.cloud.securitycenter.v1beta1.Source.encode(message.sources[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); - return writer; - }; + Object.defineProperty(SecurityCenter.prototype.setIamPolicy = function setIamPolicy(request, callback) { + return this.rpcCall(setIamPolicy, $root.google.iam.v1.SetIamPolicyRequest, $root.google.iam.v1.Policy, request, callback); + }, "name", { value: "SetIamPolicy" }); /** - * Encodes the specified ListSourcesResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.ListSourcesResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1beta1.ListSourcesResponse - * @static - * @param {google.cloud.securitycenter.v1beta1.IListSourcesResponse} message ListSourcesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * Calls SetIamPolicy. + * @function setIamPolicy + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @instance + * @param {google.iam.v1.ISetIamPolicyRequest} request SetIamPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - ListSourcesResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; /** - * Decodes a ListSourcesResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v1beta1.ListSourcesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1beta1.ListSourcesResponse} ListSourcesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter#testIamPermissions}. + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @typedef TestIamPermissionsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.iam.v1.TestIamPermissionsResponse} [response] TestIamPermissionsResponse */ - ListSourcesResponse.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.cloud.securitycenter.v1beta1.ListSourcesResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.sources && message.sources.length)) - message.sources = []; - message.sources.push($root.google.cloud.securitycenter.v1beta1.Source.decode(reader, reader.uint32())); - break; - case 2: - message.nextPageToken = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; /** - * Decodes a ListSourcesResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1beta1.ListSourcesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1beta1.ListSourcesResponse} ListSourcesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Calls TestIamPermissions. + * @function testIamPermissions + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @instance + * @param {google.iam.v1.ITestIamPermissionsRequest} request TestIamPermissionsRequest message or plain object + * @param {google.cloud.securitycenter.v1beta1.SecurityCenter.TestIamPermissionsCallback} callback Node-style callback called with the error, if any, and TestIamPermissionsResponse + * @returns {undefined} + * @variation 1 */ - ListSourcesResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + Object.defineProperty(SecurityCenter.prototype.testIamPermissions = function testIamPermissions(request, callback) { + return this.rpcCall(testIamPermissions, $root.google.iam.v1.TestIamPermissionsRequest, $root.google.iam.v1.TestIamPermissionsResponse, request, callback); + }, "name", { value: "TestIamPermissions" }); /** - * Verifies a ListSourcesResponse message. - * @function verify - * @memberof google.cloud.securitycenter.v1beta1.ListSourcesResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListSourcesResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.sources != null && message.hasOwnProperty("sources")) { - if (!Array.isArray(message.sources)) - return "sources: array expected"; - for (var i = 0; i < message.sources.length; ++i) { - var error = $root.google.cloud.securitycenter.v1beta1.Source.verify(message.sources[i]); - if (error) - return "sources." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - return null; - }; - - /** - * Creates a ListSourcesResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v1beta1.ListSourcesResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1beta1.ListSourcesResponse} ListSourcesResponse + * Calls TestIamPermissions. + * @function testIamPermissions + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @instance + * @param {google.iam.v1.ITestIamPermissionsRequest} request TestIamPermissionsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - ListSourcesResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1beta1.ListSourcesResponse) - return object; - var message = new $root.google.cloud.securitycenter.v1beta1.ListSourcesResponse(); - if (object.sources) { - if (!Array.isArray(object.sources)) - throw TypeError(".google.cloud.securitycenter.v1beta1.ListSourcesResponse.sources: array expected"); - message.sources = []; - for (var i = 0; i < object.sources.length; ++i) { - if (typeof object.sources[i] !== "object") - throw TypeError(".google.cloud.securitycenter.v1beta1.ListSourcesResponse.sources: object expected"); - message.sources[i] = $root.google.cloud.securitycenter.v1beta1.Source.fromObject(object.sources[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - return message; - }; /** - * Creates a plain object from a ListSourcesResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v1beta1.ListSourcesResponse - * @static - * @param {google.cloud.securitycenter.v1beta1.ListSourcesResponse} message ListSourcesResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object + * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter#updateFinding}. + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @typedef UpdateFindingCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1beta1.Finding} [response] Finding */ - ListSourcesResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.sources = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.sources && message.sources.length) { - object.sources = []; - for (var j = 0; j < message.sources.length; ++j) - object.sources[j] = $root.google.cloud.securitycenter.v1beta1.Source.toObject(message.sources[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - return object; - }; /** - * Converts this ListSourcesResponse to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1beta1.ListSourcesResponse + * Calls UpdateFinding. + * @function updateFinding + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter * @instance - * @returns {Object.} JSON object + * @param {google.cloud.securitycenter.v1beta1.IUpdateFindingRequest} request UpdateFindingRequest message or plain object + * @param {google.cloud.securitycenter.v1beta1.SecurityCenter.UpdateFindingCallback} callback Node-style callback called with the error, if any, and Finding + * @returns {undefined} + * @variation 1 */ - ListSourcesResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ListSourcesResponse; - })(); - - v1beta1.ListAssetsRequest = (function() { + Object.defineProperty(SecurityCenter.prototype.updateFinding = function updateFinding(request, callback) { + return this.rpcCall(updateFinding, $root.google.cloud.securitycenter.v1beta1.UpdateFindingRequest, $root.google.cloud.securitycenter.v1beta1.Finding, request, callback); + }, "name", { value: "UpdateFinding" }); /** - * Properties of a ListAssetsRequest. - * @memberof google.cloud.securitycenter.v1beta1 - * @interface IListAssetsRequest - * @property {string|null} [parent] ListAssetsRequest parent - * @property {string|null} [filter] ListAssetsRequest filter - * @property {string|null} [orderBy] ListAssetsRequest orderBy - * @property {google.protobuf.ITimestamp|null} [readTime] ListAssetsRequest readTime - * @property {google.protobuf.IDuration|null} [compareDuration] ListAssetsRequest compareDuration - * @property {google.protobuf.IFieldMask|null} [fieldMask] ListAssetsRequest fieldMask - * @property {string|null} [pageToken] ListAssetsRequest pageToken - * @property {number|null} [pageSize] ListAssetsRequest pageSize + * Calls UpdateFinding. + * @function updateFinding + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1beta1.IUpdateFindingRequest} request UpdateFindingRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ /** - * Constructs a new ListAssetsRequest. - * @memberof google.cloud.securitycenter.v1beta1 - * @classdesc Represents a ListAssetsRequest. - * @implements IListAssetsRequest - * @constructor - * @param {google.cloud.securitycenter.v1beta1.IListAssetsRequest=} [properties] Properties to set + * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter#updateOrganizationSettings}. + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @typedef UpdateOrganizationSettingsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1beta1.OrganizationSettings} [response] OrganizationSettings */ - function ListAssetsRequest(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]]; - } /** - * ListAssetsRequest parent. - * @member {string} parent - * @memberof google.cloud.securitycenter.v1beta1.ListAssetsRequest + * Calls UpdateOrganizationSettings. + * @function updateOrganizationSettings + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter * @instance + * @param {google.cloud.securitycenter.v1beta1.IUpdateOrganizationSettingsRequest} request UpdateOrganizationSettingsRequest message or plain object + * @param {google.cloud.securitycenter.v1beta1.SecurityCenter.UpdateOrganizationSettingsCallback} callback Node-style callback called with the error, if any, and OrganizationSettings + * @returns {undefined} + * @variation 1 */ - ListAssetsRequest.prototype.parent = ""; + Object.defineProperty(SecurityCenter.prototype.updateOrganizationSettings = function updateOrganizationSettings(request, callback) { + return this.rpcCall(updateOrganizationSettings, $root.google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest, $root.google.cloud.securitycenter.v1beta1.OrganizationSettings, request, callback); + }, "name", { value: "UpdateOrganizationSettings" }); /** - * ListAssetsRequest filter. - * @member {string} filter - * @memberof google.cloud.securitycenter.v1beta1.ListAssetsRequest + * Calls UpdateOrganizationSettings. + * @function updateOrganizationSettings + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter * @instance + * @param {google.cloud.securitycenter.v1beta1.IUpdateOrganizationSettingsRequest} request UpdateOrganizationSettingsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - ListAssetsRequest.prototype.filter = ""; /** - * ListAssetsRequest orderBy. - * @member {string} orderBy - * @memberof google.cloud.securitycenter.v1beta1.ListAssetsRequest - * @instance + * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter#updateSource}. + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @typedef UpdateSourceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1beta1.Source} [response] Source */ - ListAssetsRequest.prototype.orderBy = ""; /** - * ListAssetsRequest readTime. - * @member {google.protobuf.ITimestamp|null|undefined} readTime - * @memberof google.cloud.securitycenter.v1beta1.ListAssetsRequest + * Calls UpdateSource. + * @function updateSource + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter * @instance + * @param {google.cloud.securitycenter.v1beta1.IUpdateSourceRequest} request UpdateSourceRequest message or plain object + * @param {google.cloud.securitycenter.v1beta1.SecurityCenter.UpdateSourceCallback} callback Node-style callback called with the error, if any, and Source + * @returns {undefined} + * @variation 1 */ - ListAssetsRequest.prototype.readTime = null; + Object.defineProperty(SecurityCenter.prototype.updateSource = function updateSource(request, callback) { + return this.rpcCall(updateSource, $root.google.cloud.securitycenter.v1beta1.UpdateSourceRequest, $root.google.cloud.securitycenter.v1beta1.Source, request, callback); + }, "name", { value: "UpdateSource" }); /** - * ListAssetsRequest compareDuration. - * @member {google.protobuf.IDuration|null|undefined} compareDuration - * @memberof google.cloud.securitycenter.v1beta1.ListAssetsRequest + * Calls UpdateSource. + * @function updateSource + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter * @instance + * @param {google.cloud.securitycenter.v1beta1.IUpdateSourceRequest} request UpdateSourceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - ListAssetsRequest.prototype.compareDuration = null; /** - * ListAssetsRequest fieldMask. - * @member {google.protobuf.IFieldMask|null|undefined} fieldMask - * @memberof google.cloud.securitycenter.v1beta1.ListAssetsRequest - * @instance + * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter#updateSecurityMarks}. + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @typedef UpdateSecurityMarksCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1beta1.SecurityMarks} [response] SecurityMarks */ - ListAssetsRequest.prototype.fieldMask = null; /** - * ListAssetsRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.securitycenter.v1beta1.ListAssetsRequest + * Calls UpdateSecurityMarks. + * @function updateSecurityMarks + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter * @instance + * @param {google.cloud.securitycenter.v1beta1.IUpdateSecurityMarksRequest} request UpdateSecurityMarksRequest message or plain object + * @param {google.cloud.securitycenter.v1beta1.SecurityCenter.UpdateSecurityMarksCallback} callback Node-style callback called with the error, if any, and SecurityMarks + * @returns {undefined} + * @variation 1 */ - ListAssetsRequest.prototype.pageToken = ""; + Object.defineProperty(SecurityCenter.prototype.updateSecurityMarks = function updateSecurityMarks(request, callback) { + return this.rpcCall(updateSecurityMarks, $root.google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest, $root.google.cloud.securitycenter.v1beta1.SecurityMarks, request, callback); + }, "name", { value: "UpdateSecurityMarks" }); /** - * ListAssetsRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.securitycenter.v1beta1.ListAssetsRequest + * Calls UpdateSecurityMarks. + * @function updateSecurityMarks + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter * @instance + * @param {google.cloud.securitycenter.v1beta1.IUpdateSecurityMarksRequest} request UpdateSecurityMarksRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - ListAssetsRequest.prototype.pageSize = 0; + + return SecurityCenter; + })(); + + v1beta1.CreateFindingRequest = (function() { /** - * Creates a new ListAssetsRequest instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v1beta1.ListAssetsRequest - * @static - * @param {google.cloud.securitycenter.v1beta1.IListAssetsRequest=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1beta1.ListAssetsRequest} ListAssetsRequest instance + * Properties of a CreateFindingRequest. + * @memberof google.cloud.securitycenter.v1beta1 + * @interface ICreateFindingRequest + * @property {string|null} [parent] CreateFindingRequest parent + * @property {string|null} [findingId] CreateFindingRequest findingId + * @property {google.cloud.securitycenter.v1beta1.IFinding|null} [finding] CreateFindingRequest finding */ - ListAssetsRequest.create = function create(properties) { - return new ListAssetsRequest(properties); - }; /** - * Encodes the specified ListAssetsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.ListAssetsRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1beta1.ListAssetsRequest - * @static - * @param {google.cloud.securitycenter.v1beta1.IListAssetsRequest} message ListAssetsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to + * Constructs a new CreateFindingRequest. + * @memberof google.cloud.securitycenter.v1beta1 + * @classdesc Represents a CreateFindingRequest. + * @implements ICreateFindingRequest + * @constructor + * @param {google.cloud.securitycenter.v1beta1.ICreateFindingRequest=} [properties] Properties to set + */ + function CreateFindingRequest(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]]; + } + + /** + * CreateFindingRequest parent. + * @member {string} parent + * @memberof google.cloud.securitycenter.v1beta1.CreateFindingRequest + * @instance + */ + CreateFindingRequest.prototype.parent = ""; + + /** + * CreateFindingRequest findingId. + * @member {string} findingId + * @memberof google.cloud.securitycenter.v1beta1.CreateFindingRequest + * @instance + */ + CreateFindingRequest.prototype.findingId = ""; + + /** + * CreateFindingRequest finding. + * @member {google.cloud.securitycenter.v1beta1.IFinding|null|undefined} finding + * @memberof google.cloud.securitycenter.v1beta1.CreateFindingRequest + * @instance + */ + CreateFindingRequest.prototype.finding = null; + + /** + * Creates a new CreateFindingRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1beta1.CreateFindingRequest + * @static + * @param {google.cloud.securitycenter.v1beta1.ICreateFindingRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1beta1.CreateFindingRequest} CreateFindingRequest instance + */ + CreateFindingRequest.create = function create(properties) { + return new CreateFindingRequest(properties); + }; + + /** + * Encodes the specified CreateFindingRequest message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.CreateFindingRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1beta1.CreateFindingRequest + * @static + * @param {google.cloud.securitycenter.v1beta1.ICreateFindingRequest} message CreateFindingRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListAssetsRequest.encode = function encode(message, writer) { + CreateFindingRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.parent != null && message.hasOwnProperty("parent")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.filter != null && message.hasOwnProperty("filter")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); - if (message.orderBy != null && message.hasOwnProperty("orderBy")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.orderBy); - if (message.readTime != null && message.hasOwnProperty("readTime")) - $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.compareDuration != null && message.hasOwnProperty("compareDuration")) - $root.google.protobuf.Duration.encode(message.compareDuration, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.fieldMask != null && message.hasOwnProperty("fieldMask")) - $root.google.protobuf.FieldMask.encode(message.fieldMask, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.pageToken); - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - writer.uint32(/* id 9, wireType 0 =*/72).int32(message.pageSize); + if (message.findingId != null && message.hasOwnProperty("findingId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.findingId); + if (message.finding != null && message.hasOwnProperty("finding")) + $root.google.cloud.securitycenter.v1beta1.Finding.encode(message.finding, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; /** - * Encodes the specified ListAssetsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.ListAssetsRequest.verify|verify} messages. + * Encodes the specified CreateFindingRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.CreateFindingRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1beta1.ListAssetsRequest + * @memberof google.cloud.securitycenter.v1beta1.CreateFindingRequest * @static - * @param {google.cloud.securitycenter.v1beta1.IListAssetsRequest} message ListAssetsRequest message or plain object to encode + * @param {google.cloud.securitycenter.v1beta1.ICreateFindingRequest} message CreateFindingRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListAssetsRequest.encodeDelimited = function encodeDelimited(message, writer) { + CreateFindingRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListAssetsRequest message from the specified reader or buffer. + * Decodes a CreateFindingRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.securitycenter.v1beta1.ListAssetsRequest + * @memberof google.cloud.securitycenter.v1beta1.CreateFindingRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1beta1.ListAssetsRequest} ListAssetsRequest + * @returns {google.cloud.securitycenter.v1beta1.CreateFindingRequest} CreateFindingRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListAssetsRequest.decode = function decode(reader, length) { + CreateFindingRequest.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.cloud.securitycenter.v1beta1.ListAssetsRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1beta1.CreateFindingRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -12642,25 +12584,10 @@ message.parent = reader.string(); break; case 2: - message.filter = reader.string(); + message.findingId = reader.string(); break; case 3: - message.orderBy = reader.string(); - break; - case 4: - message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 5: - message.compareDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - case 7: - message.fieldMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - break; - case 8: - message.pageToken = reader.string(); - break; - case 9: - message.pageSize = reader.int32(); + message.finding = $root.google.cloud.securitycenter.v1beta1.Finding.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -12671,183 +12598,130 @@ }; /** - * Decodes a ListAssetsRequest message from the specified reader or buffer, length delimited. + * Decodes a CreateFindingRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1beta1.ListAssetsRequest + * @memberof google.cloud.securitycenter.v1beta1.CreateFindingRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1beta1.ListAssetsRequest} ListAssetsRequest + * @returns {google.cloud.securitycenter.v1beta1.CreateFindingRequest} CreateFindingRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListAssetsRequest.decodeDelimited = function decodeDelimited(reader) { + CreateFindingRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListAssetsRequest message. + * Verifies a CreateFindingRequest message. * @function verify - * @memberof google.cloud.securitycenter.v1beta1.ListAssetsRequest + * @memberof google.cloud.securitycenter.v1beta1.CreateFindingRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListAssetsRequest.verify = function verify(message) { + CreateFindingRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.parent != null && message.hasOwnProperty("parent")) if (!$util.isString(message.parent)) return "parent: string expected"; - if (message.filter != null && message.hasOwnProperty("filter")) - if (!$util.isString(message.filter)) - return "filter: string expected"; - if (message.orderBy != null && message.hasOwnProperty("orderBy")) - if (!$util.isString(message.orderBy)) - return "orderBy: string expected"; - if (message.readTime != null && message.hasOwnProperty("readTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.readTime); - if (error) - return "readTime." + error; - } - if (message.compareDuration != null && message.hasOwnProperty("compareDuration")) { - var error = $root.google.protobuf.Duration.verify(message.compareDuration); - if (error) - return "compareDuration." + error; - } - if (message.fieldMask != null && message.hasOwnProperty("fieldMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.fieldMask); + if (message.findingId != null && message.hasOwnProperty("findingId")) + if (!$util.isString(message.findingId)) + return "findingId: string expected"; + if (message.finding != null && message.hasOwnProperty("finding")) { + var error = $root.google.cloud.securitycenter.v1beta1.Finding.verify(message.finding); if (error) - return "fieldMask." + error; + return "finding." + error; } - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; return null; }; /** - * Creates a ListAssetsRequest message from a plain object. Also converts values to their respective internal types. + * Creates a CreateFindingRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.securitycenter.v1beta1.ListAssetsRequest + * @memberof google.cloud.securitycenter.v1beta1.CreateFindingRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1beta1.ListAssetsRequest} ListAssetsRequest + * @returns {google.cloud.securitycenter.v1beta1.CreateFindingRequest} CreateFindingRequest */ - ListAssetsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1beta1.ListAssetsRequest) + CreateFindingRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1beta1.CreateFindingRequest) return object; - var message = new $root.google.cloud.securitycenter.v1beta1.ListAssetsRequest(); + var message = new $root.google.cloud.securitycenter.v1beta1.CreateFindingRequest(); if (object.parent != null) message.parent = String(object.parent); - if (object.filter != null) - message.filter = String(object.filter); - if (object.orderBy != null) - message.orderBy = String(object.orderBy); - if (object.readTime != null) { - if (typeof object.readTime !== "object") - throw TypeError(".google.cloud.securitycenter.v1beta1.ListAssetsRequest.readTime: object expected"); - message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); - } - if (object.compareDuration != null) { - if (typeof object.compareDuration !== "object") - throw TypeError(".google.cloud.securitycenter.v1beta1.ListAssetsRequest.compareDuration: object expected"); - message.compareDuration = $root.google.protobuf.Duration.fromObject(object.compareDuration); - } - if (object.fieldMask != null) { - if (typeof object.fieldMask !== "object") - throw TypeError(".google.cloud.securitycenter.v1beta1.ListAssetsRequest.fieldMask: object expected"); - message.fieldMask = $root.google.protobuf.FieldMask.fromObject(object.fieldMask); + if (object.findingId != null) + message.findingId = String(object.findingId); + if (object.finding != null) { + if (typeof object.finding !== "object") + throw TypeError(".google.cloud.securitycenter.v1beta1.CreateFindingRequest.finding: object expected"); + message.finding = $root.google.cloud.securitycenter.v1beta1.Finding.fromObject(object.finding); } - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; return message; }; /** - * Creates a plain object from a ListAssetsRequest message. Also converts values to other types if specified. + * Creates a plain object from a CreateFindingRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.securitycenter.v1beta1.ListAssetsRequest + * @memberof google.cloud.securitycenter.v1beta1.CreateFindingRequest * @static - * @param {google.cloud.securitycenter.v1beta1.ListAssetsRequest} message ListAssetsRequest + * @param {google.cloud.securitycenter.v1beta1.CreateFindingRequest} message CreateFindingRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListAssetsRequest.toObject = function toObject(message, options) { + CreateFindingRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { object.parent = ""; - object.filter = ""; - object.orderBy = ""; - object.readTime = null; - object.compareDuration = null; - object.fieldMask = null; - object.pageToken = ""; - object.pageSize = 0; + object.findingId = ""; + object.finding = null; } if (message.parent != null && message.hasOwnProperty("parent")) object.parent = message.parent; - if (message.filter != null && message.hasOwnProperty("filter")) - object.filter = message.filter; - if (message.orderBy != null && message.hasOwnProperty("orderBy")) - object.orderBy = message.orderBy; - if (message.readTime != null && message.hasOwnProperty("readTime")) - object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); - if (message.compareDuration != null && message.hasOwnProperty("compareDuration")) - object.compareDuration = $root.google.protobuf.Duration.toObject(message.compareDuration, options); - if (message.fieldMask != null && message.hasOwnProperty("fieldMask")) - object.fieldMask = $root.google.protobuf.FieldMask.toObject(message.fieldMask, options); - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; + if (message.findingId != null && message.hasOwnProperty("findingId")) + object.findingId = message.findingId; + if (message.finding != null && message.hasOwnProperty("finding")) + object.finding = $root.google.cloud.securitycenter.v1beta1.Finding.toObject(message.finding, options); return object; }; /** - * Converts this ListAssetsRequest to JSON. + * Converts this CreateFindingRequest to JSON. * @function toJSON - * @memberof google.cloud.securitycenter.v1beta1.ListAssetsRequest + * @memberof google.cloud.securitycenter.v1beta1.CreateFindingRequest * @instance * @returns {Object.} JSON object */ - ListAssetsRequest.prototype.toJSON = function toJSON() { + CreateFindingRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ListAssetsRequest; + return CreateFindingRequest; })(); - v1beta1.ListAssetsResponse = (function() { + v1beta1.CreateSourceRequest = (function() { /** - * Properties of a ListAssetsResponse. + * Properties of a CreateSourceRequest. * @memberof google.cloud.securitycenter.v1beta1 - * @interface IListAssetsResponse - * @property {Array.|null} [listAssetsResults] ListAssetsResponse listAssetsResults - * @property {google.protobuf.ITimestamp|null} [readTime] ListAssetsResponse readTime - * @property {string|null} [nextPageToken] ListAssetsResponse nextPageToken - * @property {number|null} [totalSize] ListAssetsResponse totalSize + * @interface ICreateSourceRequest + * @property {string|null} [parent] CreateSourceRequest parent + * @property {google.cloud.securitycenter.v1beta1.ISource|null} [source] CreateSourceRequest source */ /** - * Constructs a new ListAssetsResponse. + * Constructs a new CreateSourceRequest. * @memberof google.cloud.securitycenter.v1beta1 - * @classdesc Represents a ListAssetsResponse. - * @implements IListAssetsResponse + * @classdesc Represents a CreateSourceRequest. + * @implements ICreateSourceRequest * @constructor - * @param {google.cloud.securitycenter.v1beta1.IListAssetsResponse=} [properties] Properties to set + * @param {google.cloud.securitycenter.v1beta1.ICreateSourceRequest=} [properties] Properties to set */ - function ListAssetsResponse(properties) { - this.listAssetsResults = []; + function CreateSourceRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -12855,117 +12729,88 @@ } /** - * ListAssetsResponse listAssetsResults. - * @member {Array.} listAssetsResults - * @memberof google.cloud.securitycenter.v1beta1.ListAssetsResponse - * @instance - */ - ListAssetsResponse.prototype.listAssetsResults = $util.emptyArray; - - /** - * ListAssetsResponse readTime. - * @member {google.protobuf.ITimestamp|null|undefined} readTime - * @memberof google.cloud.securitycenter.v1beta1.ListAssetsResponse - * @instance - */ - ListAssetsResponse.prototype.readTime = null; - - /** - * ListAssetsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.securitycenter.v1beta1.ListAssetsResponse + * CreateSourceRequest parent. + * @member {string} parent + * @memberof google.cloud.securitycenter.v1beta1.CreateSourceRequest * @instance */ - ListAssetsResponse.prototype.nextPageToken = ""; + CreateSourceRequest.prototype.parent = ""; /** - * ListAssetsResponse totalSize. - * @member {number} totalSize - * @memberof google.cloud.securitycenter.v1beta1.ListAssetsResponse + * CreateSourceRequest source. + * @member {google.cloud.securitycenter.v1beta1.ISource|null|undefined} source + * @memberof google.cloud.securitycenter.v1beta1.CreateSourceRequest * @instance */ - ListAssetsResponse.prototype.totalSize = 0; + CreateSourceRequest.prototype.source = null; /** - * Creates a new ListAssetsResponse instance using the specified properties. + * Creates a new CreateSourceRequest instance using the specified properties. * @function create - * @memberof google.cloud.securitycenter.v1beta1.ListAssetsResponse + * @memberof google.cloud.securitycenter.v1beta1.CreateSourceRequest * @static - * @param {google.cloud.securitycenter.v1beta1.IListAssetsResponse=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1beta1.ListAssetsResponse} ListAssetsResponse instance + * @param {google.cloud.securitycenter.v1beta1.ICreateSourceRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1beta1.CreateSourceRequest} CreateSourceRequest instance */ - ListAssetsResponse.create = function create(properties) { - return new ListAssetsResponse(properties); + CreateSourceRequest.create = function create(properties) { + return new CreateSourceRequest(properties); }; /** - * Encodes the specified ListAssetsResponse message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.ListAssetsResponse.verify|verify} messages. + * Encodes the specified CreateSourceRequest message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.CreateSourceRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.securitycenter.v1beta1.ListAssetsResponse + * @memberof google.cloud.securitycenter.v1beta1.CreateSourceRequest * @static - * @param {google.cloud.securitycenter.v1beta1.IListAssetsResponse} message ListAssetsResponse message or plain object to encode + * @param {google.cloud.securitycenter.v1beta1.ICreateSourceRequest} message CreateSourceRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListAssetsResponse.encode = function encode(message, writer) { + CreateSourceRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.listAssetsResults != null && message.listAssetsResults.length) - for (var i = 0; i < message.listAssetsResults.length; ++i) - $root.google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult.encode(message.listAssetsResults[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.readTime != null && message.hasOwnProperty("readTime")) - $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.nextPageToken); - if (message.totalSize != null && message.hasOwnProperty("totalSize")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.totalSize); + if (message.parent != null && message.hasOwnProperty("parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.source != null && message.hasOwnProperty("source")) + $root.google.cloud.securitycenter.v1beta1.Source.encode(message.source, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** - * Encodes the specified ListAssetsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.ListAssetsResponse.verify|verify} messages. + * Encodes the specified CreateSourceRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.CreateSourceRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1beta1.ListAssetsResponse + * @memberof google.cloud.securitycenter.v1beta1.CreateSourceRequest * @static - * @param {google.cloud.securitycenter.v1beta1.IListAssetsResponse} message ListAssetsResponse message or plain object to encode + * @param {google.cloud.securitycenter.v1beta1.ICreateSourceRequest} message CreateSourceRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListAssetsResponse.encodeDelimited = function encodeDelimited(message, writer) { + CreateSourceRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListAssetsResponse message from the specified reader or buffer. + * Decodes a CreateSourceRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.securitycenter.v1beta1.ListAssetsResponse + * @memberof google.cloud.securitycenter.v1beta1.CreateSourceRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1beta1.ListAssetsResponse} ListAssetsResponse + * @returns {google.cloud.securitycenter.v1beta1.CreateSourceRequest} CreateSourceRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListAssetsResponse.decode = function decode(reader, length) { + CreateSourceRequest.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.cloud.securitycenter.v1beta1.ListAssetsResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1beta1.CreateSourceRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - if (!(message.listAssetsResults && message.listAssetsResults.length)) - message.listAssetsResults = []; - message.listAssetsResults.push($root.google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult.decode(reader, reader.uint32())); + message.parent = reader.string(); break; case 2: - message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 3: - message.nextPageToken = reader.string(); - break; - case 4: - message.totalSize = reader.int32(); + message.source = $root.google.cloud.securitycenter.v1beta1.Source.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -12976,424 +12821,121 @@ }; /** - * Decodes a ListAssetsResponse message from the specified reader or buffer, length delimited. + * Decodes a CreateSourceRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1beta1.ListAssetsResponse + * @memberof google.cloud.securitycenter.v1beta1.CreateSourceRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1beta1.ListAssetsResponse} ListAssetsResponse + * @returns {google.cloud.securitycenter.v1beta1.CreateSourceRequest} CreateSourceRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListAssetsResponse.decodeDelimited = function decodeDelimited(reader) { + CreateSourceRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListAssetsResponse message. + * Verifies a CreateSourceRequest message. * @function verify - * @memberof google.cloud.securitycenter.v1beta1.ListAssetsResponse + * @memberof google.cloud.securitycenter.v1beta1.CreateSourceRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListAssetsResponse.verify = function verify(message) { + CreateSourceRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.listAssetsResults != null && message.hasOwnProperty("listAssetsResults")) { - if (!Array.isArray(message.listAssetsResults)) - return "listAssetsResults: array expected"; - for (var i = 0; i < message.listAssetsResults.length; ++i) { - var error = $root.google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult.verify(message.listAssetsResults[i]); - if (error) - return "listAssetsResults." + error; - } - } - if (message.readTime != null && message.hasOwnProperty("readTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.readTime); + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.source != null && message.hasOwnProperty("source")) { + var error = $root.google.cloud.securitycenter.v1beta1.Source.verify(message.source); if (error) - return "readTime." + error; + return "source." + error; } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - if (message.totalSize != null && message.hasOwnProperty("totalSize")) - if (!$util.isInteger(message.totalSize)) - return "totalSize: integer expected"; return null; }; /** - * Creates a ListAssetsResponse message from a plain object. Also converts values to their respective internal types. + * Creates a CreateSourceRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.securitycenter.v1beta1.ListAssetsResponse + * @memberof google.cloud.securitycenter.v1beta1.CreateSourceRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1beta1.ListAssetsResponse} ListAssetsResponse + * @returns {google.cloud.securitycenter.v1beta1.CreateSourceRequest} CreateSourceRequest */ - ListAssetsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1beta1.ListAssetsResponse) + CreateSourceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1beta1.CreateSourceRequest) return object; - var message = new $root.google.cloud.securitycenter.v1beta1.ListAssetsResponse(); - if (object.listAssetsResults) { - if (!Array.isArray(object.listAssetsResults)) - throw TypeError(".google.cloud.securitycenter.v1beta1.ListAssetsResponse.listAssetsResults: array expected"); - message.listAssetsResults = []; - for (var i = 0; i < object.listAssetsResults.length; ++i) { - if (typeof object.listAssetsResults[i] !== "object") - throw TypeError(".google.cloud.securitycenter.v1beta1.ListAssetsResponse.listAssetsResults: object expected"); - message.listAssetsResults[i] = $root.google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult.fromObject(object.listAssetsResults[i]); - } - } - if (object.readTime != null) { - if (typeof object.readTime !== "object") - throw TypeError(".google.cloud.securitycenter.v1beta1.ListAssetsResponse.readTime: object expected"); - message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); + var message = new $root.google.cloud.securitycenter.v1beta1.CreateSourceRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.source != null) { + if (typeof object.source !== "object") + throw TypeError(".google.cloud.securitycenter.v1beta1.CreateSourceRequest.source: object expected"); + message.source = $root.google.cloud.securitycenter.v1beta1.Source.fromObject(object.source); } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - if (object.totalSize != null) - message.totalSize = object.totalSize | 0; return message; }; /** - * Creates a plain object from a ListAssetsResponse message. Also converts values to other types if specified. + * Creates a plain object from a CreateSourceRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.securitycenter.v1beta1.ListAssetsResponse + * @memberof google.cloud.securitycenter.v1beta1.CreateSourceRequest * @static - * @param {google.cloud.securitycenter.v1beta1.ListAssetsResponse} message ListAssetsResponse + * @param {google.cloud.securitycenter.v1beta1.CreateSourceRequest} message CreateSourceRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListAssetsResponse.toObject = function toObject(message, options) { + CreateSourceRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.listAssetsResults = []; if (options.defaults) { - object.readTime = null; - object.nextPageToken = ""; - object.totalSize = 0; - } - if (message.listAssetsResults && message.listAssetsResults.length) { - object.listAssetsResults = []; - for (var j = 0; j < message.listAssetsResults.length; ++j) - object.listAssetsResults[j] = $root.google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult.toObject(message.listAssetsResults[j], options); + object.parent = ""; + object.source = null; } - if (message.readTime != null && message.hasOwnProperty("readTime")) - object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - if (message.totalSize != null && message.hasOwnProperty("totalSize")) - object.totalSize = message.totalSize; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.source != null && message.hasOwnProperty("source")) + object.source = $root.google.cloud.securitycenter.v1beta1.Source.toObject(message.source, options); return object; }; /** - * Converts this ListAssetsResponse to JSON. + * Converts this CreateSourceRequest to JSON. * @function toJSON - * @memberof google.cloud.securitycenter.v1beta1.ListAssetsResponse + * @memberof google.cloud.securitycenter.v1beta1.CreateSourceRequest * @instance * @returns {Object.} JSON object */ - ListAssetsResponse.prototype.toJSON = function toJSON() { + CreateSourceRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - ListAssetsResponse.ListAssetsResult = (function() { - - /** - * Properties of a ListAssetsResult. - * @memberof google.cloud.securitycenter.v1beta1.ListAssetsResponse - * @interface IListAssetsResult - * @property {google.cloud.securitycenter.v1beta1.IAsset|null} [asset] ListAssetsResult asset - * @property {google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult.State|null} [state] ListAssetsResult state - */ + return CreateSourceRequest; + })(); - /** - * Constructs a new ListAssetsResult. - * @memberof google.cloud.securitycenter.v1beta1.ListAssetsResponse - * @classdesc Represents a ListAssetsResult. - * @implements IListAssetsResult - * @constructor - * @param {google.cloud.securitycenter.v1beta1.ListAssetsResponse.IListAssetsResult=} [properties] Properties to set - */ - function ListAssetsResult(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]]; - } + v1beta1.GetOrganizationSettingsRequest = (function() { - /** - * ListAssetsResult asset. - * @member {google.cloud.securitycenter.v1beta1.IAsset|null|undefined} asset - * @memberof google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult - * @instance - */ - ListAssetsResult.prototype.asset = null; - - /** - * ListAssetsResult state. - * @member {google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult.State} state - * @memberof google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult - * @instance - */ - ListAssetsResult.prototype.state = 0; - - /** - * Creates a new ListAssetsResult instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult - * @static - * @param {google.cloud.securitycenter.v1beta1.ListAssetsResponse.IListAssetsResult=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult} ListAssetsResult instance - */ - ListAssetsResult.create = function create(properties) { - return new ListAssetsResult(properties); - }; - - /** - * Encodes the specified ListAssetsResult message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult - * @static - * @param {google.cloud.securitycenter.v1beta1.ListAssetsResponse.IListAssetsResult} message ListAssetsResult message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListAssetsResult.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.asset != null && message.hasOwnProperty("asset")) - $root.google.cloud.securitycenter.v1beta1.Asset.encode(message.asset, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.state != null && message.hasOwnProperty("state")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.state); - return writer; - }; - - /** - * Encodes the specified ListAssetsResult message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult - * @static - * @param {google.cloud.securitycenter.v1beta1.ListAssetsResponse.IListAssetsResult} message ListAssetsResult message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListAssetsResult.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListAssetsResult message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult} ListAssetsResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListAssetsResult.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.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.asset = $root.google.cloud.securitycenter.v1beta1.Asset.decode(reader, reader.uint32()); - break; - case 2: - message.state = reader.int32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListAssetsResult message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult} ListAssetsResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListAssetsResult.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListAssetsResult message. - * @function verify - * @memberof google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListAssetsResult.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.asset != null && message.hasOwnProperty("asset")) { - var error = $root.google.cloud.securitycenter.v1beta1.Asset.verify(message.asset); - if (error) - return "asset." + error; - } - if (message.state != null && message.hasOwnProperty("state")) - switch (message.state) { - default: - return "state: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - break; - } - return null; - }; - - /** - * Creates a ListAssetsResult message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult} ListAssetsResult - */ - ListAssetsResult.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult) - return object; - var message = new $root.google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult(); - if (object.asset != null) { - if (typeof object.asset !== "object") - throw TypeError(".google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult.asset: object expected"); - message.asset = $root.google.cloud.securitycenter.v1beta1.Asset.fromObject(object.asset); - } - switch (object.state) { - case "STATE_UNSPECIFIED": - case 0: - message.state = 0; - break; - case "UNUSED": - case 1: - message.state = 1; - break; - case "ADDED": - case 2: - message.state = 2; - break; - case "REMOVED": - case 3: - message.state = 3; - break; - case "ACTIVE": - case 4: - message.state = 4; - break; - } - return message; - }; - - /** - * Creates a plain object from a ListAssetsResult message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult - * @static - * @param {google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult} message ListAssetsResult - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListAssetsResult.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.asset = null; - object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; - } - if (message.asset != null && message.hasOwnProperty("asset")) - object.asset = $root.google.cloud.securitycenter.v1beta1.Asset.toObject(message.asset, options); - if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult.State[message.state] : message.state; - return object; - }; - - /** - * Converts this ListAssetsResult to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult - * @instance - * @returns {Object.} JSON object - */ - ListAssetsResult.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * State enum. - * @name google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult.State - * @enum {string} - * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value - * @property {number} UNUSED=1 UNUSED value - * @property {number} ADDED=2 ADDED value - * @property {number} REMOVED=3 REMOVED value - * @property {number} ACTIVE=4 ACTIVE value - */ - ListAssetsResult.State = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; - values[valuesById[1] = "UNUSED"] = 1; - values[valuesById[2] = "ADDED"] = 2; - values[valuesById[3] = "REMOVED"] = 3; - values[valuesById[4] = "ACTIVE"] = 4; - return values; - })(); - - return ListAssetsResult; - })(); - - return ListAssetsResponse; - })(); - - v1beta1.ListFindingsRequest = (function() { - - /** - * Properties of a ListFindingsRequest. - * @memberof google.cloud.securitycenter.v1beta1 - * @interface IListFindingsRequest - * @property {string|null} [parent] ListFindingsRequest parent - * @property {string|null} [filter] ListFindingsRequest filter - * @property {string|null} [orderBy] ListFindingsRequest orderBy - * @property {google.protobuf.ITimestamp|null} [readTime] ListFindingsRequest readTime - * @property {google.protobuf.IFieldMask|null} [fieldMask] ListFindingsRequest fieldMask - * @property {string|null} [pageToken] ListFindingsRequest pageToken - * @property {number|null} [pageSize] ListFindingsRequest pageSize - */ + /** + * Properties of a GetOrganizationSettingsRequest. + * @memberof google.cloud.securitycenter.v1beta1 + * @interface IGetOrganizationSettingsRequest + * @property {string|null} [name] GetOrganizationSettingsRequest name + */ /** - * Constructs a new ListFindingsRequest. + * Constructs a new GetOrganizationSettingsRequest. * @memberof google.cloud.securitycenter.v1beta1 - * @classdesc Represents a ListFindingsRequest. - * @implements IListFindingsRequest + * @classdesc Represents a GetOrganizationSettingsRequest. + * @implements IGetOrganizationSettingsRequest * @constructor - * @param {google.cloud.securitycenter.v1beta1.IListFindingsRequest=} [properties] Properties to set + * @param {google.cloud.securitycenter.v1beta1.IGetOrganizationSettingsRequest=} [properties] Properties to set */ - function ListFindingsRequest(properties) { + function GetOrganizationSettingsRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -13401,153 +12943,75 @@ } /** - * ListFindingsRequest parent. - * @member {string} parent - * @memberof google.cloud.securitycenter.v1beta1.ListFindingsRequest - * @instance - */ - ListFindingsRequest.prototype.parent = ""; - - /** - * ListFindingsRequest filter. - * @member {string} filter - * @memberof google.cloud.securitycenter.v1beta1.ListFindingsRequest - * @instance - */ - ListFindingsRequest.prototype.filter = ""; - - /** - * ListFindingsRequest orderBy. - * @member {string} orderBy - * @memberof google.cloud.securitycenter.v1beta1.ListFindingsRequest - * @instance - */ - ListFindingsRequest.prototype.orderBy = ""; - - /** - * ListFindingsRequest readTime. - * @member {google.protobuf.ITimestamp|null|undefined} readTime - * @memberof google.cloud.securitycenter.v1beta1.ListFindingsRequest - * @instance - */ - ListFindingsRequest.prototype.readTime = null; - - /** - * ListFindingsRequest fieldMask. - * @member {google.protobuf.IFieldMask|null|undefined} fieldMask - * @memberof google.cloud.securitycenter.v1beta1.ListFindingsRequest - * @instance - */ - ListFindingsRequest.prototype.fieldMask = null; - - /** - * ListFindingsRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.securitycenter.v1beta1.ListFindingsRequest - * @instance - */ - ListFindingsRequest.prototype.pageToken = ""; - - /** - * ListFindingsRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.securitycenter.v1beta1.ListFindingsRequest + * GetOrganizationSettingsRequest name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest * @instance */ - ListFindingsRequest.prototype.pageSize = 0; + GetOrganizationSettingsRequest.prototype.name = ""; /** - * Creates a new ListFindingsRequest instance using the specified properties. + * Creates a new GetOrganizationSettingsRequest instance using the specified properties. * @function create - * @memberof google.cloud.securitycenter.v1beta1.ListFindingsRequest + * @memberof google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest * @static - * @param {google.cloud.securitycenter.v1beta1.IListFindingsRequest=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1beta1.ListFindingsRequest} ListFindingsRequest instance + * @param {google.cloud.securitycenter.v1beta1.IGetOrganizationSettingsRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest} GetOrganizationSettingsRequest instance */ - ListFindingsRequest.create = function create(properties) { - return new ListFindingsRequest(properties); + GetOrganizationSettingsRequest.create = function create(properties) { + return new GetOrganizationSettingsRequest(properties); }; /** - * Encodes the specified ListFindingsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.ListFindingsRequest.verify|verify} messages. + * Encodes the specified GetOrganizationSettingsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.securitycenter.v1beta1.ListFindingsRequest + * @memberof google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest * @static - * @param {google.cloud.securitycenter.v1beta1.IListFindingsRequest} message ListFindingsRequest message or plain object to encode + * @param {google.cloud.securitycenter.v1beta1.IGetOrganizationSettingsRequest} message GetOrganizationSettingsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListFindingsRequest.encode = function encode(message, writer) { + GetOrganizationSettingsRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && message.hasOwnProperty("parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.filter != null && message.hasOwnProperty("filter")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); - if (message.orderBy != null && message.hasOwnProperty("orderBy")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.orderBy); - if (message.readTime != null && message.hasOwnProperty("readTime")) - $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.fieldMask != null && message.hasOwnProperty("fieldMask")) - $root.google.protobuf.FieldMask.encode(message.fieldMask, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.pageToken); - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - writer.uint32(/* id 7, wireType 0 =*/56).int32(message.pageSize); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; /** - * Encodes the specified ListFindingsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.ListFindingsRequest.verify|verify} messages. + * Encodes the specified GetOrganizationSettingsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1beta1.ListFindingsRequest + * @memberof google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest * @static - * @param {google.cloud.securitycenter.v1beta1.IListFindingsRequest} message ListFindingsRequest message or plain object to encode + * @param {google.cloud.securitycenter.v1beta1.IGetOrganizationSettingsRequest} message GetOrganizationSettingsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListFindingsRequest.encodeDelimited = function encodeDelimited(message, writer) { + GetOrganizationSettingsRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListFindingsRequest message from the specified reader or buffer. + * Decodes a GetOrganizationSettingsRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.securitycenter.v1beta1.ListFindingsRequest + * @memberof google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1beta1.ListFindingsRequest} ListFindingsRequest + * @returns {google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest} GetOrganizationSettingsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListFindingsRequest.decode = function decode(reader, length) { + GetOrganizationSettingsRequest.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.cloud.securitycenter.v1beta1.ListFindingsRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.parent = reader.string(); - break; - case 2: - message.filter = reader.string(); - break; - case 3: - message.orderBy = reader.string(); - break; - case 4: - message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 5: - message.fieldMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - break; - case 6: - message.pageToken = reader.string(); - break; - case 7: - message.pageSize = reader.int32(); + message.name = reader.string(); break; default: reader.skipType(tag & 7); @@ -13558,170 +13022,107 @@ }; /** - * Decodes a ListFindingsRequest message from the specified reader or buffer, length delimited. + * Decodes a GetOrganizationSettingsRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1beta1.ListFindingsRequest + * @memberof google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1beta1.ListFindingsRequest} ListFindingsRequest + * @returns {google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest} GetOrganizationSettingsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListFindingsRequest.decodeDelimited = function decodeDelimited(reader) { + GetOrganizationSettingsRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListFindingsRequest message. + * Verifies a GetOrganizationSettingsRequest message. * @function verify - * @memberof google.cloud.securitycenter.v1beta1.ListFindingsRequest + * @memberof google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListFindingsRequest.verify = function verify(message) { + GetOrganizationSettingsRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.filter != null && message.hasOwnProperty("filter")) - if (!$util.isString(message.filter)) - return "filter: string expected"; - if (message.orderBy != null && message.hasOwnProperty("orderBy")) - if (!$util.isString(message.orderBy)) - return "orderBy: string expected"; - if (message.readTime != null && message.hasOwnProperty("readTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.readTime); - if (error) - return "readTime." + error; - } - if (message.fieldMask != null && message.hasOwnProperty("fieldMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.fieldMask); - if (error) - return "fieldMask." + error; - } - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; return null; }; /** - * Creates a ListFindingsRequest message from a plain object. Also converts values to their respective internal types. + * Creates a GetOrganizationSettingsRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.securitycenter.v1beta1.ListFindingsRequest + * @memberof google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1beta1.ListFindingsRequest} ListFindingsRequest + * @returns {google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest} GetOrganizationSettingsRequest */ - ListFindingsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1beta1.ListFindingsRequest) + GetOrganizationSettingsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest) return object; - var message = new $root.google.cloud.securitycenter.v1beta1.ListFindingsRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.filter != null) - message.filter = String(object.filter); - if (object.orderBy != null) - message.orderBy = String(object.orderBy); - if (object.readTime != null) { - if (typeof object.readTime !== "object") - throw TypeError(".google.cloud.securitycenter.v1beta1.ListFindingsRequest.readTime: object expected"); - message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); - } - if (object.fieldMask != null) { - if (typeof object.fieldMask !== "object") - throw TypeError(".google.cloud.securitycenter.v1beta1.ListFindingsRequest.fieldMask: object expected"); - message.fieldMask = $root.google.protobuf.FieldMask.fromObject(object.fieldMask); - } - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; + var message = new $root.google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest(); + if (object.name != null) + message.name = String(object.name); return message; }; /** - * Creates a plain object from a ListFindingsRequest message. Also converts values to other types if specified. + * Creates a plain object from a GetOrganizationSettingsRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.securitycenter.v1beta1.ListFindingsRequest + * @memberof google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest * @static - * @param {google.cloud.securitycenter.v1beta1.ListFindingsRequest} message ListFindingsRequest + * @param {google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest} message GetOrganizationSettingsRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListFindingsRequest.toObject = function toObject(message, options) { + GetOrganizationSettingsRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.parent = ""; - object.filter = ""; - object.orderBy = ""; - object.readTime = null; - object.fieldMask = null; - object.pageToken = ""; - object.pageSize = 0; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.filter != null && message.hasOwnProperty("filter")) - object.filter = message.filter; - if (message.orderBy != null && message.hasOwnProperty("orderBy")) - object.orderBy = message.orderBy; - if (message.readTime != null && message.hasOwnProperty("readTime")) - object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); - if (message.fieldMask != null && message.hasOwnProperty("fieldMask")) - object.fieldMask = $root.google.protobuf.FieldMask.toObject(message.fieldMask, options); - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; return object; }; /** - * Converts this ListFindingsRequest to JSON. + * Converts this GetOrganizationSettingsRequest to JSON. * @function toJSON - * @memberof google.cloud.securitycenter.v1beta1.ListFindingsRequest + * @memberof google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest * @instance * @returns {Object.} JSON object */ - ListFindingsRequest.prototype.toJSON = function toJSON() { + GetOrganizationSettingsRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ListFindingsRequest; + return GetOrganizationSettingsRequest; })(); - v1beta1.ListFindingsResponse = (function() { + v1beta1.GetSourceRequest = (function() { /** - * Properties of a ListFindingsResponse. + * Properties of a GetSourceRequest. * @memberof google.cloud.securitycenter.v1beta1 - * @interface IListFindingsResponse - * @property {Array.|null} [findings] ListFindingsResponse findings - * @property {google.protobuf.ITimestamp|null} [readTime] ListFindingsResponse readTime - * @property {string|null} [nextPageToken] ListFindingsResponse nextPageToken - * @property {number|null} [totalSize] ListFindingsResponse totalSize + * @interface IGetSourceRequest + * @property {string|null} [name] GetSourceRequest name */ /** - * Constructs a new ListFindingsResponse. + * Constructs a new GetSourceRequest. * @memberof google.cloud.securitycenter.v1beta1 - * @classdesc Represents a ListFindingsResponse. - * @implements IListFindingsResponse + * @classdesc Represents a GetSourceRequest. + * @implements IGetSourceRequest * @constructor - * @param {google.cloud.securitycenter.v1beta1.IListFindingsResponse=} [properties] Properties to set + * @param {google.cloud.securitycenter.v1beta1.IGetSourceRequest=} [properties] Properties to set */ - function ListFindingsResponse(properties) { - this.findings = []; + function GetSourceRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -13729,117 +13130,75 @@ } /** - * ListFindingsResponse findings. - * @member {Array.} findings - * @memberof google.cloud.securitycenter.v1beta1.ListFindingsResponse - * @instance - */ - ListFindingsResponse.prototype.findings = $util.emptyArray; - - /** - * ListFindingsResponse readTime. - * @member {google.protobuf.ITimestamp|null|undefined} readTime - * @memberof google.cloud.securitycenter.v1beta1.ListFindingsResponse - * @instance - */ - ListFindingsResponse.prototype.readTime = null; - - /** - * ListFindingsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.securitycenter.v1beta1.ListFindingsResponse - * @instance - */ - ListFindingsResponse.prototype.nextPageToken = ""; - - /** - * ListFindingsResponse totalSize. - * @member {number} totalSize - * @memberof google.cloud.securitycenter.v1beta1.ListFindingsResponse + * GetSourceRequest name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1beta1.GetSourceRequest * @instance */ - ListFindingsResponse.prototype.totalSize = 0; + GetSourceRequest.prototype.name = ""; /** - * Creates a new ListFindingsResponse instance using the specified properties. + * Creates a new GetSourceRequest instance using the specified properties. * @function create - * @memberof google.cloud.securitycenter.v1beta1.ListFindingsResponse + * @memberof google.cloud.securitycenter.v1beta1.GetSourceRequest * @static - * @param {google.cloud.securitycenter.v1beta1.IListFindingsResponse=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1beta1.ListFindingsResponse} ListFindingsResponse instance + * @param {google.cloud.securitycenter.v1beta1.IGetSourceRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1beta1.GetSourceRequest} GetSourceRequest instance */ - ListFindingsResponse.create = function create(properties) { - return new ListFindingsResponse(properties); + GetSourceRequest.create = function create(properties) { + return new GetSourceRequest(properties); }; /** - * Encodes the specified ListFindingsResponse message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.ListFindingsResponse.verify|verify} messages. + * Encodes the specified GetSourceRequest message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.GetSourceRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.securitycenter.v1beta1.ListFindingsResponse + * @memberof google.cloud.securitycenter.v1beta1.GetSourceRequest * @static - * @param {google.cloud.securitycenter.v1beta1.IListFindingsResponse} message ListFindingsResponse message or plain object to encode + * @param {google.cloud.securitycenter.v1beta1.IGetSourceRequest} message GetSourceRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListFindingsResponse.encode = function encode(message, writer) { + GetSourceRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.findings != null && message.findings.length) - for (var i = 0; i < message.findings.length; ++i) - $root.google.cloud.securitycenter.v1beta1.Finding.encode(message.findings[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.readTime != null && message.hasOwnProperty("readTime")) - $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.nextPageToken); - if (message.totalSize != null && message.hasOwnProperty("totalSize")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.totalSize); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; /** - * Encodes the specified ListFindingsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.ListFindingsResponse.verify|verify} messages. + * Encodes the specified GetSourceRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.GetSourceRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1beta1.ListFindingsResponse + * @memberof google.cloud.securitycenter.v1beta1.GetSourceRequest * @static - * @param {google.cloud.securitycenter.v1beta1.IListFindingsResponse} message ListFindingsResponse message or plain object to encode + * @param {google.cloud.securitycenter.v1beta1.IGetSourceRequest} message GetSourceRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListFindingsResponse.encodeDelimited = function encodeDelimited(message, writer) { + GetSourceRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListFindingsResponse message from the specified reader or buffer. + * Decodes a GetSourceRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.securitycenter.v1beta1.ListFindingsResponse + * @memberof google.cloud.securitycenter.v1beta1.GetSourceRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1beta1.ListFindingsResponse} ListFindingsResponse + * @returns {google.cloud.securitycenter.v1beta1.GetSourceRequest} GetSourceRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListFindingsResponse.decode = function decode(reader, length) { + GetSourceRequest.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.cloud.securitycenter.v1beta1.ListFindingsResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1beta1.GetSourceRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - if (!(message.findings && message.findings.length)) - message.findings = []; - message.findings.push($root.google.cloud.securitycenter.v1beta1.Finding.decode(reader, reader.uint32())); - break; - case 2: - message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 3: - message.nextPageToken = reader.string(); - break; - case 4: - message.totalSize = reader.int32(); + message.name = reader.string(); break; default: reader.skipType(tag & 7); @@ -13850,157 +13209,113 @@ }; /** - * Decodes a ListFindingsResponse message from the specified reader or buffer, length delimited. + * Decodes a GetSourceRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1beta1.ListFindingsResponse + * @memberof google.cloud.securitycenter.v1beta1.GetSourceRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1beta1.ListFindingsResponse} ListFindingsResponse + * @returns {google.cloud.securitycenter.v1beta1.GetSourceRequest} GetSourceRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListFindingsResponse.decodeDelimited = function decodeDelimited(reader) { + GetSourceRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListFindingsResponse message. + * Verifies a GetSourceRequest message. * @function verify - * @memberof google.cloud.securitycenter.v1beta1.ListFindingsResponse + * @memberof google.cloud.securitycenter.v1beta1.GetSourceRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListFindingsResponse.verify = function verify(message) { + GetSourceRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.findings != null && message.hasOwnProperty("findings")) { - if (!Array.isArray(message.findings)) - return "findings: array expected"; - for (var i = 0; i < message.findings.length; ++i) { - var error = $root.google.cloud.securitycenter.v1beta1.Finding.verify(message.findings[i]); - if (error) - return "findings." + error; - } - } - if (message.readTime != null && message.hasOwnProperty("readTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.readTime); - if (error) - return "readTime." + error; - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - if (message.totalSize != null && message.hasOwnProperty("totalSize")) - if (!$util.isInteger(message.totalSize)) - return "totalSize: integer expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; return null; }; /** - * Creates a ListFindingsResponse message from a plain object. Also converts values to their respective internal types. + * Creates a GetSourceRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.securitycenter.v1beta1.ListFindingsResponse + * @memberof google.cloud.securitycenter.v1beta1.GetSourceRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1beta1.ListFindingsResponse} ListFindingsResponse + * @returns {google.cloud.securitycenter.v1beta1.GetSourceRequest} GetSourceRequest */ - ListFindingsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1beta1.ListFindingsResponse) + GetSourceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1beta1.GetSourceRequest) return object; - var message = new $root.google.cloud.securitycenter.v1beta1.ListFindingsResponse(); - if (object.findings) { - if (!Array.isArray(object.findings)) - throw TypeError(".google.cloud.securitycenter.v1beta1.ListFindingsResponse.findings: array expected"); - message.findings = []; - for (var i = 0; i < object.findings.length; ++i) { - if (typeof object.findings[i] !== "object") - throw TypeError(".google.cloud.securitycenter.v1beta1.ListFindingsResponse.findings: object expected"); - message.findings[i] = $root.google.cloud.securitycenter.v1beta1.Finding.fromObject(object.findings[i]); - } - } - if (object.readTime != null) { - if (typeof object.readTime !== "object") - throw TypeError(".google.cloud.securitycenter.v1beta1.ListFindingsResponse.readTime: object expected"); - message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - if (object.totalSize != null) - message.totalSize = object.totalSize | 0; + var message = new $root.google.cloud.securitycenter.v1beta1.GetSourceRequest(); + if (object.name != null) + message.name = String(object.name); return message; }; /** - * Creates a plain object from a ListFindingsResponse message. Also converts values to other types if specified. + * Creates a plain object from a GetSourceRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.securitycenter.v1beta1.ListFindingsResponse + * @memberof google.cloud.securitycenter.v1beta1.GetSourceRequest * @static - * @param {google.cloud.securitycenter.v1beta1.ListFindingsResponse} message ListFindingsResponse + * @param {google.cloud.securitycenter.v1beta1.GetSourceRequest} message GetSourceRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListFindingsResponse.toObject = function toObject(message, options) { + GetSourceRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.findings = []; - if (options.defaults) { - object.readTime = null; - object.nextPageToken = ""; - object.totalSize = 0; - } - if (message.findings && message.findings.length) { - object.findings = []; - for (var j = 0; j < message.findings.length; ++j) - object.findings[j] = $root.google.cloud.securitycenter.v1beta1.Finding.toObject(message.findings[j], options); - } - if (message.readTime != null && message.hasOwnProperty("readTime")) - object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - if (message.totalSize != null && message.hasOwnProperty("totalSize")) - object.totalSize = message.totalSize; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; return object; }; /** - * Converts this ListFindingsResponse to JSON. + * Converts this GetSourceRequest to JSON. * @function toJSON - * @memberof google.cloud.securitycenter.v1beta1.ListFindingsResponse + * @memberof google.cloud.securitycenter.v1beta1.GetSourceRequest * @instance * @returns {Object.} JSON object */ - ListFindingsResponse.prototype.toJSON = function toJSON() { + GetSourceRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ListFindingsResponse; + return GetSourceRequest; })(); - v1beta1.SetFindingStateRequest = (function() { + v1beta1.GroupAssetsRequest = (function() { /** - * Properties of a SetFindingStateRequest. + * Properties of a GroupAssetsRequest. * @memberof google.cloud.securitycenter.v1beta1 - * @interface ISetFindingStateRequest - * @property {string|null} [name] SetFindingStateRequest name - * @property {google.cloud.securitycenter.v1beta1.Finding.State|null} [state] SetFindingStateRequest state - * @property {google.protobuf.ITimestamp|null} [startTime] SetFindingStateRequest startTime + * @interface IGroupAssetsRequest + * @property {string|null} [parent] GroupAssetsRequest parent + * @property {string|null} [filter] GroupAssetsRequest filter + * @property {string|null} [groupBy] GroupAssetsRequest groupBy + * @property {google.protobuf.IDuration|null} [compareDuration] GroupAssetsRequest compareDuration + * @property {google.protobuf.ITimestamp|null} [readTime] GroupAssetsRequest readTime + * @property {string|null} [pageToken] GroupAssetsRequest pageToken + * @property {number|null} [pageSize] GroupAssetsRequest pageSize */ /** - * Constructs a new SetFindingStateRequest. + * Constructs a new GroupAssetsRequest. * @memberof google.cloud.securitycenter.v1beta1 - * @classdesc Represents a SetFindingStateRequest. - * @implements ISetFindingStateRequest + * @classdesc Represents a GroupAssetsRequest. + * @implements IGroupAssetsRequest * @constructor - * @param {google.cloud.securitycenter.v1beta1.ISetFindingStateRequest=} [properties] Properties to set + * @param {google.cloud.securitycenter.v1beta1.IGroupAssetsRequest=} [properties] Properties to set */ - function SetFindingStateRequest(properties) { + function GroupAssetsRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -14008,101 +13323,153 @@ } /** - * SetFindingStateRequest name. - * @member {string} name - * @memberof google.cloud.securitycenter.v1beta1.SetFindingStateRequest + * GroupAssetsRequest parent. + * @member {string} parent + * @memberof google.cloud.securitycenter.v1beta1.GroupAssetsRequest * @instance */ - SetFindingStateRequest.prototype.name = ""; + GroupAssetsRequest.prototype.parent = ""; /** - * SetFindingStateRequest state. - * @member {google.cloud.securitycenter.v1beta1.Finding.State} state - * @memberof google.cloud.securitycenter.v1beta1.SetFindingStateRequest + * GroupAssetsRequest filter. + * @member {string} filter + * @memberof google.cloud.securitycenter.v1beta1.GroupAssetsRequest * @instance */ - SetFindingStateRequest.prototype.state = 0; + GroupAssetsRequest.prototype.filter = ""; /** - * SetFindingStateRequest startTime. - * @member {google.protobuf.ITimestamp|null|undefined} startTime - * @memberof google.cloud.securitycenter.v1beta1.SetFindingStateRequest + * GroupAssetsRequest groupBy. + * @member {string} groupBy + * @memberof google.cloud.securitycenter.v1beta1.GroupAssetsRequest * @instance */ - SetFindingStateRequest.prototype.startTime = null; + GroupAssetsRequest.prototype.groupBy = ""; /** - * Creates a new SetFindingStateRequest instance using the specified properties. + * GroupAssetsRequest compareDuration. + * @member {google.protobuf.IDuration|null|undefined} compareDuration + * @memberof google.cloud.securitycenter.v1beta1.GroupAssetsRequest + * @instance + */ + GroupAssetsRequest.prototype.compareDuration = null; + + /** + * GroupAssetsRequest readTime. + * @member {google.protobuf.ITimestamp|null|undefined} readTime + * @memberof google.cloud.securitycenter.v1beta1.GroupAssetsRequest + * @instance + */ + GroupAssetsRequest.prototype.readTime = null; + + /** + * GroupAssetsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.securitycenter.v1beta1.GroupAssetsRequest + * @instance + */ + GroupAssetsRequest.prototype.pageToken = ""; + + /** + * GroupAssetsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.securitycenter.v1beta1.GroupAssetsRequest + * @instance + */ + GroupAssetsRequest.prototype.pageSize = 0; + + /** + * Creates a new GroupAssetsRequest instance using the specified properties. * @function create - * @memberof google.cloud.securitycenter.v1beta1.SetFindingStateRequest + * @memberof google.cloud.securitycenter.v1beta1.GroupAssetsRequest * @static - * @param {google.cloud.securitycenter.v1beta1.ISetFindingStateRequest=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1beta1.SetFindingStateRequest} SetFindingStateRequest instance + * @param {google.cloud.securitycenter.v1beta1.IGroupAssetsRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1beta1.GroupAssetsRequest} GroupAssetsRequest instance */ - SetFindingStateRequest.create = function create(properties) { - return new SetFindingStateRequest(properties); + GroupAssetsRequest.create = function create(properties) { + return new GroupAssetsRequest(properties); }; /** - * Encodes the specified SetFindingStateRequest message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.SetFindingStateRequest.verify|verify} messages. + * Encodes the specified GroupAssetsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.GroupAssetsRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.securitycenter.v1beta1.SetFindingStateRequest + * @memberof google.cloud.securitycenter.v1beta1.GroupAssetsRequest * @static - * @param {google.cloud.securitycenter.v1beta1.ISetFindingStateRequest} message SetFindingStateRequest message or plain object to encode + * @param {google.cloud.securitycenter.v1beta1.IGroupAssetsRequest} message GroupAssetsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SetFindingStateRequest.encode = function encode(message, writer) { + GroupAssetsRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.state != null && message.hasOwnProperty("state")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.state); - if (message.startTime != null && message.hasOwnProperty("startTime")) - $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.parent != null && message.hasOwnProperty("parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.filter != null && message.hasOwnProperty("filter")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); + if (message.groupBy != null && message.hasOwnProperty("groupBy")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.groupBy); + if (message.compareDuration != null && message.hasOwnProperty("compareDuration")) + $root.google.protobuf.Duration.encode(message.compareDuration, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.readTime != null && message.hasOwnProperty("readTime")) + $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.pageToken); + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.pageSize); return writer; }; /** - * Encodes the specified SetFindingStateRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.SetFindingStateRequest.verify|verify} messages. + * Encodes the specified GroupAssetsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.GroupAssetsRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1beta1.SetFindingStateRequest + * @memberof google.cloud.securitycenter.v1beta1.GroupAssetsRequest * @static - * @param {google.cloud.securitycenter.v1beta1.ISetFindingStateRequest} message SetFindingStateRequest message or plain object to encode + * @param {google.cloud.securitycenter.v1beta1.IGroupAssetsRequest} message GroupAssetsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SetFindingStateRequest.encodeDelimited = function encodeDelimited(message, writer) { + GroupAssetsRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a SetFindingStateRequest message from the specified reader or buffer. + * Decodes a GroupAssetsRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.securitycenter.v1beta1.SetFindingStateRequest + * @memberof google.cloud.securitycenter.v1beta1.GroupAssetsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1beta1.SetFindingStateRequest} SetFindingStateRequest + * @returns {google.cloud.securitycenter.v1beta1.GroupAssetsRequest} GroupAssetsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SetFindingStateRequest.decode = function decode(reader, length) { + GroupAssetsRequest.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.cloud.securitycenter.v1beta1.SetFindingStateRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1beta1.GroupAssetsRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.name = reader.string(); + message.parent = reader.string(); break; case 2: - message.state = reader.int32(); + message.filter = reader.string(); break; case 3: - message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + message.groupBy = reader.string(); + break; + case 4: + message.compareDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + case 5: + message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 7: + message.pageToken = reader.string(); + break; + case 8: + message.pageSize = reader.int32(); break; default: reader.skipType(tag & 7); @@ -14113,147 +13480,169 @@ }; /** - * Decodes a SetFindingStateRequest message from the specified reader or buffer, length delimited. + * Decodes a GroupAssetsRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1beta1.SetFindingStateRequest + * @memberof google.cloud.securitycenter.v1beta1.GroupAssetsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1beta1.SetFindingStateRequest} SetFindingStateRequest + * @returns {google.cloud.securitycenter.v1beta1.GroupAssetsRequest} GroupAssetsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SetFindingStateRequest.decodeDelimited = function decodeDelimited(reader) { + GroupAssetsRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a SetFindingStateRequest message. + * Verifies a GroupAssetsRequest message. * @function verify - * @memberof google.cloud.securitycenter.v1beta1.SetFindingStateRequest + * @memberof google.cloud.securitycenter.v1beta1.GroupAssetsRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - SetFindingStateRequest.verify = function verify(message) { + GroupAssetsRequest.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.state != null && message.hasOwnProperty("state")) - switch (message.state) { - default: - return "state: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.startTime != null && message.hasOwnProperty("startTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.startTime); + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.groupBy != null && message.hasOwnProperty("groupBy")) + if (!$util.isString(message.groupBy)) + return "groupBy: string expected"; + if (message.compareDuration != null && message.hasOwnProperty("compareDuration")) { + var error = $root.google.protobuf.Duration.verify(message.compareDuration); if (error) - return "startTime." + error; + return "compareDuration." + error; + } + if (message.readTime != null && message.hasOwnProperty("readTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.readTime); + if (error) + return "readTime." + error; } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; return null; }; /** - * Creates a SetFindingStateRequest message from a plain object. Also converts values to their respective internal types. + * Creates a GroupAssetsRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.securitycenter.v1beta1.SetFindingStateRequest + * @memberof google.cloud.securitycenter.v1beta1.GroupAssetsRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1beta1.SetFindingStateRequest} SetFindingStateRequest + * @returns {google.cloud.securitycenter.v1beta1.GroupAssetsRequest} GroupAssetsRequest */ - SetFindingStateRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1beta1.SetFindingStateRequest) + GroupAssetsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1beta1.GroupAssetsRequest) return object; - var message = new $root.google.cloud.securitycenter.v1beta1.SetFindingStateRequest(); - if (object.name != null) - message.name = String(object.name); - switch (object.state) { - case "STATE_UNSPECIFIED": - case 0: - message.state = 0; - break; - case "ACTIVE": - case 1: - message.state = 1; - break; - case "INACTIVE": - case 2: - message.state = 2; - break; + var message = new $root.google.cloud.securitycenter.v1beta1.GroupAssetsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.filter != null) + message.filter = String(object.filter); + if (object.groupBy != null) + message.groupBy = String(object.groupBy); + if (object.compareDuration != null) { + if (typeof object.compareDuration !== "object") + throw TypeError(".google.cloud.securitycenter.v1beta1.GroupAssetsRequest.compareDuration: object expected"); + message.compareDuration = $root.google.protobuf.Duration.fromObject(object.compareDuration); } - if (object.startTime != null) { - if (typeof object.startTime !== "object") - throw TypeError(".google.cloud.securitycenter.v1beta1.SetFindingStateRequest.startTime: object expected"); - message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); + if (object.readTime != null) { + if (typeof object.readTime !== "object") + throw TypeError(".google.cloud.securitycenter.v1beta1.GroupAssetsRequest.readTime: object expected"); + message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); } + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; return message; }; /** - * Creates a plain object from a SetFindingStateRequest message. Also converts values to other types if specified. + * Creates a plain object from a GroupAssetsRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.securitycenter.v1beta1.SetFindingStateRequest + * @memberof google.cloud.securitycenter.v1beta1.GroupAssetsRequest * @static - * @param {google.cloud.securitycenter.v1beta1.SetFindingStateRequest} message SetFindingStateRequest + * @param {google.cloud.securitycenter.v1beta1.GroupAssetsRequest} message GroupAssetsRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SetFindingStateRequest.toObject = function toObject(message, options) { + GroupAssetsRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.name = ""; - object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; - object.startTime = null; + object.parent = ""; + object.filter = ""; + object.groupBy = ""; + object.compareDuration = null; + object.readTime = null; + object.pageToken = ""; + object.pageSize = 0; } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.securitycenter.v1beta1.Finding.State[message.state] : message.state; - if (message.startTime != null && message.hasOwnProperty("startTime")) - object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); - return object; - }; - - /** - * Converts this SetFindingStateRequest to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1beta1.SetFindingStateRequest - * @instance - * @returns {Object.} JSON object - */ - SetFindingStateRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.groupBy != null && message.hasOwnProperty("groupBy")) + object.groupBy = message.groupBy; + if (message.compareDuration != null && message.hasOwnProperty("compareDuration")) + object.compareDuration = $root.google.protobuf.Duration.toObject(message.compareDuration, options); + if (message.readTime != null && message.hasOwnProperty("readTime")) + object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + return object; + }; - return SetFindingStateRequest; + /** + * Converts this GroupAssetsRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1beta1.GroupAssetsRequest + * @instance + * @returns {Object.} JSON object + */ + GroupAssetsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GroupAssetsRequest; })(); - v1beta1.RunAssetDiscoveryRequest = (function() { + v1beta1.GroupAssetsResponse = (function() { /** - * Properties of a RunAssetDiscoveryRequest. + * Properties of a GroupAssetsResponse. * @memberof google.cloud.securitycenter.v1beta1 - * @interface IRunAssetDiscoveryRequest - * @property {string|null} [parent] RunAssetDiscoveryRequest parent + * @interface IGroupAssetsResponse + * @property {Array.|null} [groupByResults] GroupAssetsResponse groupByResults + * @property {google.protobuf.ITimestamp|null} [readTime] GroupAssetsResponse readTime + * @property {string|null} [nextPageToken] GroupAssetsResponse nextPageToken */ /** - * Constructs a new RunAssetDiscoveryRequest. + * Constructs a new GroupAssetsResponse. * @memberof google.cloud.securitycenter.v1beta1 - * @classdesc Represents a RunAssetDiscoveryRequest. - * @implements IRunAssetDiscoveryRequest + * @classdesc Represents a GroupAssetsResponse. + * @implements IGroupAssetsResponse * @constructor - * @param {google.cloud.securitycenter.v1beta1.IRunAssetDiscoveryRequest=} [properties] Properties to set + * @param {google.cloud.securitycenter.v1beta1.IGroupAssetsResponse=} [properties] Properties to set */ - function RunAssetDiscoveryRequest(properties) { + function GroupAssetsResponse(properties) { + this.groupByResults = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -14261,75 +13650,104 @@ } /** - * RunAssetDiscoveryRequest parent. - * @member {string} parent - * @memberof google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest + * GroupAssetsResponse groupByResults. + * @member {Array.} groupByResults + * @memberof google.cloud.securitycenter.v1beta1.GroupAssetsResponse * @instance */ - RunAssetDiscoveryRequest.prototype.parent = ""; + GroupAssetsResponse.prototype.groupByResults = $util.emptyArray; /** - * Creates a new RunAssetDiscoveryRequest instance using the specified properties. + * GroupAssetsResponse readTime. + * @member {google.protobuf.ITimestamp|null|undefined} readTime + * @memberof google.cloud.securitycenter.v1beta1.GroupAssetsResponse + * @instance + */ + GroupAssetsResponse.prototype.readTime = null; + + /** + * GroupAssetsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.securitycenter.v1beta1.GroupAssetsResponse + * @instance + */ + GroupAssetsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new GroupAssetsResponse instance using the specified properties. * @function create - * @memberof google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest + * @memberof google.cloud.securitycenter.v1beta1.GroupAssetsResponse * @static - * @param {google.cloud.securitycenter.v1beta1.IRunAssetDiscoveryRequest=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest} RunAssetDiscoveryRequest instance + * @param {google.cloud.securitycenter.v1beta1.IGroupAssetsResponse=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1beta1.GroupAssetsResponse} GroupAssetsResponse instance */ - RunAssetDiscoveryRequest.create = function create(properties) { - return new RunAssetDiscoveryRequest(properties); + GroupAssetsResponse.create = function create(properties) { + return new GroupAssetsResponse(properties); }; /** - * Encodes the specified RunAssetDiscoveryRequest message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest.verify|verify} messages. + * Encodes the specified GroupAssetsResponse message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.GroupAssetsResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest + * @memberof google.cloud.securitycenter.v1beta1.GroupAssetsResponse * @static - * @param {google.cloud.securitycenter.v1beta1.IRunAssetDiscoveryRequest} message RunAssetDiscoveryRequest message or plain object to encode + * @param {google.cloud.securitycenter.v1beta1.IGroupAssetsResponse} message GroupAssetsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - RunAssetDiscoveryRequest.encode = function encode(message, writer) { + GroupAssetsResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && message.hasOwnProperty("parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.groupByResults != null && message.groupByResults.length) + for (var i = 0; i < message.groupByResults.length; ++i) + $root.google.cloud.securitycenter.v1beta1.GroupResult.encode(message.groupByResults[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.readTime != null && message.hasOwnProperty("readTime")) + $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.nextPageToken); return writer; }; /** - * Encodes the specified RunAssetDiscoveryRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest.verify|verify} messages. + * Encodes the specified GroupAssetsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.GroupAssetsResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest + * @memberof google.cloud.securitycenter.v1beta1.GroupAssetsResponse * @static - * @param {google.cloud.securitycenter.v1beta1.IRunAssetDiscoveryRequest} message RunAssetDiscoveryRequest message or plain object to encode + * @param {google.cloud.securitycenter.v1beta1.IGroupAssetsResponse} message GroupAssetsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - RunAssetDiscoveryRequest.encodeDelimited = function encodeDelimited(message, writer) { + GroupAssetsResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a RunAssetDiscoveryRequest message from the specified reader or buffer. + * Decodes a GroupAssetsResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest + * @memberof google.cloud.securitycenter.v1beta1.GroupAssetsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest} RunAssetDiscoveryRequest + * @returns {google.cloud.securitycenter.v1beta1.GroupAssetsResponse} GroupAssetsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - RunAssetDiscoveryRequest.decode = function decode(reader, length) { + GroupAssetsResponse.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.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1beta1.GroupAssetsResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.parent = reader.string(); + if (!(message.groupByResults && message.groupByResults.length)) + message.groupByResults = []; + message.groupByResults.push($root.google.cloud.securitycenter.v1beta1.GroupResult.decode(reader, reader.uint32())); + break; + case 2: + message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 3: + message.nextPageToken = reader.string(); break; default: reader.skipType(tag & 7); @@ -14340,108 +13758,152 @@ }; /** - * Decodes a RunAssetDiscoveryRequest message from the specified reader or buffer, length delimited. + * Decodes a GroupAssetsResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest + * @memberof google.cloud.securitycenter.v1beta1.GroupAssetsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest} RunAssetDiscoveryRequest + * @returns {google.cloud.securitycenter.v1beta1.GroupAssetsResponse} GroupAssetsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - RunAssetDiscoveryRequest.decodeDelimited = function decodeDelimited(reader) { + GroupAssetsResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a RunAssetDiscoveryRequest message. + * Verifies a GroupAssetsResponse message. * @function verify - * @memberof google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest + * @memberof google.cloud.securitycenter.v1beta1.GroupAssetsResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - RunAssetDiscoveryRequest.verify = function verify(message) { + GroupAssetsResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; + if (message.groupByResults != null && message.hasOwnProperty("groupByResults")) { + if (!Array.isArray(message.groupByResults)) + return "groupByResults: array expected"; + for (var i = 0; i < message.groupByResults.length; ++i) { + var error = $root.google.cloud.securitycenter.v1beta1.GroupResult.verify(message.groupByResults[i]); + if (error) + return "groupByResults." + error; + } + } + if (message.readTime != null && message.hasOwnProperty("readTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.readTime); + if (error) + return "readTime." + error; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; return null; }; /** - * Creates a RunAssetDiscoveryRequest message from a plain object. Also converts values to their respective internal types. + * Creates a GroupAssetsResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest + * @memberof google.cloud.securitycenter.v1beta1.GroupAssetsResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest} RunAssetDiscoveryRequest + * @returns {google.cloud.securitycenter.v1beta1.GroupAssetsResponse} GroupAssetsResponse */ - RunAssetDiscoveryRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest) + GroupAssetsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1beta1.GroupAssetsResponse) return object; - var message = new $root.google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest(); - if (object.parent != null) - message.parent = String(object.parent); + var message = new $root.google.cloud.securitycenter.v1beta1.GroupAssetsResponse(); + if (object.groupByResults) { + if (!Array.isArray(object.groupByResults)) + throw TypeError(".google.cloud.securitycenter.v1beta1.GroupAssetsResponse.groupByResults: array expected"); + message.groupByResults = []; + for (var i = 0; i < object.groupByResults.length; ++i) { + if (typeof object.groupByResults[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v1beta1.GroupAssetsResponse.groupByResults: object expected"); + message.groupByResults[i] = $root.google.cloud.securitycenter.v1beta1.GroupResult.fromObject(object.groupByResults[i]); + } + } + if (object.readTime != null) { + if (typeof object.readTime !== "object") + throw TypeError(".google.cloud.securitycenter.v1beta1.GroupAssetsResponse.readTime: object expected"); + message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); return message; }; /** - * Creates a plain object from a RunAssetDiscoveryRequest message. Also converts values to other types if specified. + * Creates a plain object from a GroupAssetsResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest + * @memberof google.cloud.securitycenter.v1beta1.GroupAssetsResponse * @static - * @param {google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest} message RunAssetDiscoveryRequest + * @param {google.cloud.securitycenter.v1beta1.GroupAssetsResponse} message GroupAssetsResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - RunAssetDiscoveryRequest.toObject = function toObject(message, options) { + GroupAssetsResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) - object.parent = ""; - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; + if (options.arrays || options.defaults) + object.groupByResults = []; + if (options.defaults) { + object.readTime = null; + object.nextPageToken = ""; + } + if (message.groupByResults && message.groupByResults.length) { + object.groupByResults = []; + for (var j = 0; j < message.groupByResults.length; ++j) + object.groupByResults[j] = $root.google.cloud.securitycenter.v1beta1.GroupResult.toObject(message.groupByResults[j], options); + } + if (message.readTime != null && message.hasOwnProperty("readTime")) + object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; return object; }; /** - * Converts this RunAssetDiscoveryRequest to JSON. + * Converts this GroupAssetsResponse to JSON. * @function toJSON - * @memberof google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest + * @memberof google.cloud.securitycenter.v1beta1.GroupAssetsResponse * @instance * @returns {Object.} JSON object */ - RunAssetDiscoveryRequest.prototype.toJSON = function toJSON() { + GroupAssetsResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return RunAssetDiscoveryRequest; + return GroupAssetsResponse; })(); - v1beta1.UpdateFindingRequest = (function() { + v1beta1.GroupFindingsRequest = (function() { /** - * Properties of an UpdateFindingRequest. + * Properties of a GroupFindingsRequest. * @memberof google.cloud.securitycenter.v1beta1 - * @interface IUpdateFindingRequest - * @property {google.cloud.securitycenter.v1beta1.IFinding|null} [finding] UpdateFindingRequest finding - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateFindingRequest updateMask + * @interface IGroupFindingsRequest + * @property {string|null} [parent] GroupFindingsRequest parent + * @property {string|null} [filter] GroupFindingsRequest filter + * @property {string|null} [groupBy] GroupFindingsRequest groupBy + * @property {google.protobuf.ITimestamp|null} [readTime] GroupFindingsRequest readTime + * @property {string|null} [pageToken] GroupFindingsRequest pageToken + * @property {number|null} [pageSize] GroupFindingsRequest pageSize */ /** - * Constructs a new UpdateFindingRequest. + * Constructs a new GroupFindingsRequest. * @memberof google.cloud.securitycenter.v1beta1 - * @classdesc Represents an UpdateFindingRequest. - * @implements IUpdateFindingRequest + * @classdesc Represents a GroupFindingsRequest. + * @implements IGroupFindingsRequest * @constructor - * @param {google.cloud.securitycenter.v1beta1.IUpdateFindingRequest=} [properties] Properties to set + * @param {google.cloud.securitycenter.v1beta1.IGroupFindingsRequest=} [properties] Properties to set */ - function UpdateFindingRequest(properties) { + function GroupFindingsRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -14449,88 +13911,140 @@ } /** - * UpdateFindingRequest finding. - * @member {google.cloud.securitycenter.v1beta1.IFinding|null|undefined} finding - * @memberof google.cloud.securitycenter.v1beta1.UpdateFindingRequest + * GroupFindingsRequest parent. + * @member {string} parent + * @memberof google.cloud.securitycenter.v1beta1.GroupFindingsRequest * @instance */ - UpdateFindingRequest.prototype.finding = null; + GroupFindingsRequest.prototype.parent = ""; /** - * UpdateFindingRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.cloud.securitycenter.v1beta1.UpdateFindingRequest + * GroupFindingsRequest filter. + * @member {string} filter + * @memberof google.cloud.securitycenter.v1beta1.GroupFindingsRequest * @instance */ - UpdateFindingRequest.prototype.updateMask = null; + GroupFindingsRequest.prototype.filter = ""; /** - * Creates a new UpdateFindingRequest instance using the specified properties. + * GroupFindingsRequest groupBy. + * @member {string} groupBy + * @memberof google.cloud.securitycenter.v1beta1.GroupFindingsRequest + * @instance + */ + GroupFindingsRequest.prototype.groupBy = ""; + + /** + * GroupFindingsRequest readTime. + * @member {google.protobuf.ITimestamp|null|undefined} readTime + * @memberof google.cloud.securitycenter.v1beta1.GroupFindingsRequest + * @instance + */ + GroupFindingsRequest.prototype.readTime = null; + + /** + * GroupFindingsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.securitycenter.v1beta1.GroupFindingsRequest + * @instance + */ + GroupFindingsRequest.prototype.pageToken = ""; + + /** + * GroupFindingsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.securitycenter.v1beta1.GroupFindingsRequest + * @instance + */ + GroupFindingsRequest.prototype.pageSize = 0; + + /** + * Creates a new GroupFindingsRequest instance using the specified properties. * @function create - * @memberof google.cloud.securitycenter.v1beta1.UpdateFindingRequest + * @memberof google.cloud.securitycenter.v1beta1.GroupFindingsRequest * @static - * @param {google.cloud.securitycenter.v1beta1.IUpdateFindingRequest=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1beta1.UpdateFindingRequest} UpdateFindingRequest instance + * @param {google.cloud.securitycenter.v1beta1.IGroupFindingsRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1beta1.GroupFindingsRequest} GroupFindingsRequest instance */ - UpdateFindingRequest.create = function create(properties) { - return new UpdateFindingRequest(properties); + GroupFindingsRequest.create = function create(properties) { + return new GroupFindingsRequest(properties); }; /** - * Encodes the specified UpdateFindingRequest message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.UpdateFindingRequest.verify|verify} messages. + * Encodes the specified GroupFindingsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.GroupFindingsRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.securitycenter.v1beta1.UpdateFindingRequest + * @memberof google.cloud.securitycenter.v1beta1.GroupFindingsRequest * @static - * @param {google.cloud.securitycenter.v1beta1.IUpdateFindingRequest} message UpdateFindingRequest message or plain object to encode + * @param {google.cloud.securitycenter.v1beta1.IGroupFindingsRequest} message GroupFindingsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateFindingRequest.encode = function encode(message, writer) { + GroupFindingsRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.finding != null && message.hasOwnProperty("finding")) - $root.google.cloud.securitycenter.v1beta1.Finding.encode(message.finding, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.parent != null && message.hasOwnProperty("parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.filter != null && message.hasOwnProperty("filter")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); + if (message.groupBy != null && message.hasOwnProperty("groupBy")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.groupBy); + if (message.readTime != null && message.hasOwnProperty("readTime")) + $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.pageToken); + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.pageSize); return writer; }; /** - * Encodes the specified UpdateFindingRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.UpdateFindingRequest.verify|verify} messages. + * Encodes the specified GroupFindingsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.GroupFindingsRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1beta1.UpdateFindingRequest + * @memberof google.cloud.securitycenter.v1beta1.GroupFindingsRequest * @static - * @param {google.cloud.securitycenter.v1beta1.IUpdateFindingRequest} message UpdateFindingRequest message or plain object to encode + * @param {google.cloud.securitycenter.v1beta1.IGroupFindingsRequest} message GroupFindingsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateFindingRequest.encodeDelimited = function encodeDelimited(message, writer) { + GroupFindingsRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an UpdateFindingRequest message from the specified reader or buffer. + * Decodes a GroupFindingsRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.securitycenter.v1beta1.UpdateFindingRequest + * @memberof google.cloud.securitycenter.v1beta1.GroupFindingsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1beta1.UpdateFindingRequest} UpdateFindingRequest + * @returns {google.cloud.securitycenter.v1beta1.GroupFindingsRequest} GroupFindingsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UpdateFindingRequest.decode = function decode(reader, length) { + GroupFindingsRequest.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.cloud.securitycenter.v1beta1.UpdateFindingRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1beta1.GroupFindingsRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.finding = $root.google.cloud.securitycenter.v1beta1.Finding.decode(reader, reader.uint32()); + message.parent = reader.string(); break; case 2: - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + message.filter = reader.string(); + break; + case 3: + message.groupBy = reader.string(); + break; + case 4: + message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 5: + message.pageToken = reader.string(); + break; + case 6: + message.pageSize = reader.int32(); break; default: reader.skipType(tag & 7); @@ -14541,127 +14055,156 @@ }; /** - * Decodes an UpdateFindingRequest message from the specified reader or buffer, length delimited. + * Decodes a GroupFindingsRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1beta1.UpdateFindingRequest + * @memberof google.cloud.securitycenter.v1beta1.GroupFindingsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1beta1.UpdateFindingRequest} UpdateFindingRequest + * @returns {google.cloud.securitycenter.v1beta1.GroupFindingsRequest} GroupFindingsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UpdateFindingRequest.decodeDelimited = function decodeDelimited(reader) { + GroupFindingsRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an UpdateFindingRequest message. + * Verifies a GroupFindingsRequest message. * @function verify - * @memberof google.cloud.securitycenter.v1beta1.UpdateFindingRequest + * @memberof google.cloud.securitycenter.v1beta1.GroupFindingsRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - UpdateFindingRequest.verify = function verify(message) { + GroupFindingsRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.finding != null && message.hasOwnProperty("finding")) { - var error = $root.google.cloud.securitycenter.v1beta1.Finding.verify(message.finding); - if (error) - return "finding." + error; - } - if (message.updateMask != null && message.hasOwnProperty("updateMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.groupBy != null && message.hasOwnProperty("groupBy")) + if (!$util.isString(message.groupBy)) + return "groupBy: string expected"; + if (message.readTime != null && message.hasOwnProperty("readTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.readTime); if (error) - return "updateMask." + error; + return "readTime." + error; } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; return null; }; /** - * Creates an UpdateFindingRequest message from a plain object. Also converts values to their respective internal types. + * Creates a GroupFindingsRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.securitycenter.v1beta1.UpdateFindingRequest + * @memberof google.cloud.securitycenter.v1beta1.GroupFindingsRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1beta1.UpdateFindingRequest} UpdateFindingRequest + * @returns {google.cloud.securitycenter.v1beta1.GroupFindingsRequest} GroupFindingsRequest */ - UpdateFindingRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1beta1.UpdateFindingRequest) + GroupFindingsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1beta1.GroupFindingsRequest) return object; - var message = new $root.google.cloud.securitycenter.v1beta1.UpdateFindingRequest(); - if (object.finding != null) { - if (typeof object.finding !== "object") - throw TypeError(".google.cloud.securitycenter.v1beta1.UpdateFindingRequest.finding: object expected"); - message.finding = $root.google.cloud.securitycenter.v1beta1.Finding.fromObject(object.finding); - } - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.cloud.securitycenter.v1beta1.UpdateFindingRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + var message = new $root.google.cloud.securitycenter.v1beta1.GroupFindingsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.filter != null) + message.filter = String(object.filter); + if (object.groupBy != null) + message.groupBy = String(object.groupBy); + if (object.readTime != null) { + if (typeof object.readTime !== "object") + throw TypeError(".google.cloud.securitycenter.v1beta1.GroupFindingsRequest.readTime: object expected"); + message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); } + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; return message; }; /** - * Creates a plain object from an UpdateFindingRequest message. Also converts values to other types if specified. + * Creates a plain object from a GroupFindingsRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.securitycenter.v1beta1.UpdateFindingRequest + * @memberof google.cloud.securitycenter.v1beta1.GroupFindingsRequest * @static - * @param {google.cloud.securitycenter.v1beta1.UpdateFindingRequest} message UpdateFindingRequest + * @param {google.cloud.securitycenter.v1beta1.GroupFindingsRequest} message GroupFindingsRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - UpdateFindingRequest.toObject = function toObject(message, options) { + GroupFindingsRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.finding = null; - object.updateMask = null; + object.parent = ""; + object.filter = ""; + object.groupBy = ""; + object.readTime = null; + object.pageToken = ""; + object.pageSize = 0; } - if (message.finding != null && message.hasOwnProperty("finding")) - object.finding = $root.google.cloud.securitycenter.v1beta1.Finding.toObject(message.finding, options); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.groupBy != null && message.hasOwnProperty("groupBy")) + object.groupBy = message.groupBy; + if (message.readTime != null && message.hasOwnProperty("readTime")) + object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; return object; }; /** - * Converts this UpdateFindingRequest to JSON. + * Converts this GroupFindingsRequest to JSON. * @function toJSON - * @memberof google.cloud.securitycenter.v1beta1.UpdateFindingRequest + * @memberof google.cloud.securitycenter.v1beta1.GroupFindingsRequest * @instance * @returns {Object.} JSON object */ - UpdateFindingRequest.prototype.toJSON = function toJSON() { + GroupFindingsRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return UpdateFindingRequest; + return GroupFindingsRequest; })(); - v1beta1.UpdateOrganizationSettingsRequest = (function() { + v1beta1.GroupFindingsResponse = (function() { /** - * Properties of an UpdateOrganizationSettingsRequest. + * Properties of a GroupFindingsResponse. * @memberof google.cloud.securitycenter.v1beta1 - * @interface IUpdateOrganizationSettingsRequest - * @property {google.cloud.securitycenter.v1beta1.IOrganizationSettings|null} [organizationSettings] UpdateOrganizationSettingsRequest organizationSettings - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateOrganizationSettingsRequest updateMask + * @interface IGroupFindingsResponse + * @property {Array.|null} [groupByResults] GroupFindingsResponse groupByResults + * @property {google.protobuf.ITimestamp|null} [readTime] GroupFindingsResponse readTime + * @property {string|null} [nextPageToken] GroupFindingsResponse nextPageToken */ /** - * Constructs a new UpdateOrganizationSettingsRequest. + * Constructs a new GroupFindingsResponse. * @memberof google.cloud.securitycenter.v1beta1 - * @classdesc Represents an UpdateOrganizationSettingsRequest. - * @implements IUpdateOrganizationSettingsRequest + * @classdesc Represents a GroupFindingsResponse. + * @implements IGroupFindingsResponse * @constructor - * @param {google.cloud.securitycenter.v1beta1.IUpdateOrganizationSettingsRequest=} [properties] Properties to set + * @param {google.cloud.securitycenter.v1beta1.IGroupFindingsResponse=} [properties] Properties to set */ - function UpdateOrganizationSettingsRequest(properties) { + function GroupFindingsResponse(properties) { + this.groupByResults = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -14669,88 +14212,104 @@ } /** - * UpdateOrganizationSettingsRequest organizationSettings. - * @member {google.cloud.securitycenter.v1beta1.IOrganizationSettings|null|undefined} organizationSettings - * @memberof google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest + * GroupFindingsResponse groupByResults. + * @member {Array.} groupByResults + * @memberof google.cloud.securitycenter.v1beta1.GroupFindingsResponse * @instance */ - UpdateOrganizationSettingsRequest.prototype.organizationSettings = null; + GroupFindingsResponse.prototype.groupByResults = $util.emptyArray; /** - * UpdateOrganizationSettingsRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest + * GroupFindingsResponse readTime. + * @member {google.protobuf.ITimestamp|null|undefined} readTime + * @memberof google.cloud.securitycenter.v1beta1.GroupFindingsResponse * @instance */ - UpdateOrganizationSettingsRequest.prototype.updateMask = null; + GroupFindingsResponse.prototype.readTime = null; /** - * Creates a new UpdateOrganizationSettingsRequest instance using the specified properties. + * GroupFindingsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.securitycenter.v1beta1.GroupFindingsResponse + * @instance + */ + GroupFindingsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new GroupFindingsResponse instance using the specified properties. * @function create - * @memberof google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest + * @memberof google.cloud.securitycenter.v1beta1.GroupFindingsResponse * @static - * @param {google.cloud.securitycenter.v1beta1.IUpdateOrganizationSettingsRequest=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest} UpdateOrganizationSettingsRequest instance + * @param {google.cloud.securitycenter.v1beta1.IGroupFindingsResponse=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1beta1.GroupFindingsResponse} GroupFindingsResponse instance */ - UpdateOrganizationSettingsRequest.create = function create(properties) { - return new UpdateOrganizationSettingsRequest(properties); + GroupFindingsResponse.create = function create(properties) { + return new GroupFindingsResponse(properties); }; /** - * Encodes the specified UpdateOrganizationSettingsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest.verify|verify} messages. + * Encodes the specified GroupFindingsResponse message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.GroupFindingsResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest + * @memberof google.cloud.securitycenter.v1beta1.GroupFindingsResponse * @static - * @param {google.cloud.securitycenter.v1beta1.IUpdateOrganizationSettingsRequest} message UpdateOrganizationSettingsRequest message or plain object to encode + * @param {google.cloud.securitycenter.v1beta1.IGroupFindingsResponse} message GroupFindingsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateOrganizationSettingsRequest.encode = function encode(message, writer) { + GroupFindingsResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.organizationSettings != null && message.hasOwnProperty("organizationSettings")) - $root.google.cloud.securitycenter.v1beta1.OrganizationSettings.encode(message.organizationSettings, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.groupByResults != null && message.groupByResults.length) + for (var i = 0; i < message.groupByResults.length; ++i) + $root.google.cloud.securitycenter.v1beta1.GroupResult.encode(message.groupByResults[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.readTime != null && message.hasOwnProperty("readTime")) + $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.nextPageToken); return writer; }; /** - * Encodes the specified UpdateOrganizationSettingsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest.verify|verify} messages. + * Encodes the specified GroupFindingsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.GroupFindingsResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest + * @memberof google.cloud.securitycenter.v1beta1.GroupFindingsResponse * @static - * @param {google.cloud.securitycenter.v1beta1.IUpdateOrganizationSettingsRequest} message UpdateOrganizationSettingsRequest message or plain object to encode + * @param {google.cloud.securitycenter.v1beta1.IGroupFindingsResponse} message GroupFindingsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateOrganizationSettingsRequest.encodeDelimited = function encodeDelimited(message, writer) { + GroupFindingsResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an UpdateOrganizationSettingsRequest message from the specified reader or buffer. + * Decodes a GroupFindingsResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest + * @memberof google.cloud.securitycenter.v1beta1.GroupFindingsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest} UpdateOrganizationSettingsRequest + * @returns {google.cloud.securitycenter.v1beta1.GroupFindingsResponse} GroupFindingsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UpdateOrganizationSettingsRequest.decode = function decode(reader, length) { + GroupFindingsResponse.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.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1beta1.GroupFindingsResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.organizationSettings = $root.google.cloud.securitycenter.v1beta1.OrganizationSettings.decode(reader, reader.uint32()); + if (!(message.groupByResults && message.groupByResults.length)) + message.groupByResults = []; + message.groupByResults.push($root.google.cloud.securitycenter.v1beta1.GroupResult.decode(reader, reader.uint32())); break; case 2: - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 3: + message.nextPageToken = reader.string(); break; default: reader.skipType(tag & 7); @@ -14761,127 +14320,149 @@ }; /** - * Decodes an UpdateOrganizationSettingsRequest message from the specified reader or buffer, length delimited. + * Decodes a GroupFindingsResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest + * @memberof google.cloud.securitycenter.v1beta1.GroupFindingsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest} UpdateOrganizationSettingsRequest + * @returns {google.cloud.securitycenter.v1beta1.GroupFindingsResponse} GroupFindingsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UpdateOrganizationSettingsRequest.decodeDelimited = function decodeDelimited(reader) { + GroupFindingsResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an UpdateOrganizationSettingsRequest message. + * Verifies a GroupFindingsResponse message. * @function verify - * @memberof google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest + * @memberof google.cloud.securitycenter.v1beta1.GroupFindingsResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - UpdateOrganizationSettingsRequest.verify = function verify(message) { + GroupFindingsResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.organizationSettings != null && message.hasOwnProperty("organizationSettings")) { - var error = $root.google.cloud.securitycenter.v1beta1.OrganizationSettings.verify(message.organizationSettings); - if (error) - return "organizationSettings." + error; + if (message.groupByResults != null && message.hasOwnProperty("groupByResults")) { + if (!Array.isArray(message.groupByResults)) + return "groupByResults: array expected"; + for (var i = 0; i < message.groupByResults.length; ++i) { + var error = $root.google.cloud.securitycenter.v1beta1.GroupResult.verify(message.groupByResults[i]); + if (error) + return "groupByResults." + error; + } } - if (message.updateMask != null && message.hasOwnProperty("updateMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (message.readTime != null && message.hasOwnProperty("readTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.readTime); if (error) - return "updateMask." + error; + return "readTime." + error; } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; return null; }; /** - * Creates an UpdateOrganizationSettingsRequest message from a plain object. Also converts values to their respective internal types. + * Creates a GroupFindingsResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest + * @memberof google.cloud.securitycenter.v1beta1.GroupFindingsResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest} UpdateOrganizationSettingsRequest + * @returns {google.cloud.securitycenter.v1beta1.GroupFindingsResponse} GroupFindingsResponse */ - UpdateOrganizationSettingsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest) + GroupFindingsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1beta1.GroupFindingsResponse) return object; - var message = new $root.google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest(); - if (object.organizationSettings != null) { - if (typeof object.organizationSettings !== "object") - throw TypeError(".google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest.organizationSettings: object expected"); - message.organizationSettings = $root.google.cloud.securitycenter.v1beta1.OrganizationSettings.fromObject(object.organizationSettings); + var message = new $root.google.cloud.securitycenter.v1beta1.GroupFindingsResponse(); + if (object.groupByResults) { + if (!Array.isArray(object.groupByResults)) + throw TypeError(".google.cloud.securitycenter.v1beta1.GroupFindingsResponse.groupByResults: array expected"); + message.groupByResults = []; + for (var i = 0; i < object.groupByResults.length; ++i) { + if (typeof object.groupByResults[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v1beta1.GroupFindingsResponse.groupByResults: object expected"); + message.groupByResults[i] = $root.google.cloud.securitycenter.v1beta1.GroupResult.fromObject(object.groupByResults[i]); + } } - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + if (object.readTime != null) { + if (typeof object.readTime !== "object") + throw TypeError(".google.cloud.securitycenter.v1beta1.GroupFindingsResponse.readTime: object expected"); + message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); return message; }; /** - * Creates a plain object from an UpdateOrganizationSettingsRequest message. Also converts values to other types if specified. + * Creates a plain object from a GroupFindingsResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest + * @memberof google.cloud.securitycenter.v1beta1.GroupFindingsResponse * @static - * @param {google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest} message UpdateOrganizationSettingsRequest + * @param {google.cloud.securitycenter.v1beta1.GroupFindingsResponse} message GroupFindingsResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - UpdateOrganizationSettingsRequest.toObject = function toObject(message, options) { + GroupFindingsResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) + object.groupByResults = []; if (options.defaults) { - object.organizationSettings = null; - object.updateMask = null; + object.readTime = null; + object.nextPageToken = ""; } - if (message.organizationSettings != null && message.hasOwnProperty("organizationSettings")) - object.organizationSettings = $root.google.cloud.securitycenter.v1beta1.OrganizationSettings.toObject(message.organizationSettings, options); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.groupByResults && message.groupByResults.length) { + object.groupByResults = []; + for (var j = 0; j < message.groupByResults.length; ++j) + object.groupByResults[j] = $root.google.cloud.securitycenter.v1beta1.GroupResult.toObject(message.groupByResults[j], options); + } + if (message.readTime != null && message.hasOwnProperty("readTime")) + object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; return object; }; /** - * Converts this UpdateOrganizationSettingsRequest to JSON. + * Converts this GroupFindingsResponse to JSON. * @function toJSON - * @memberof google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest + * @memberof google.cloud.securitycenter.v1beta1.GroupFindingsResponse * @instance * @returns {Object.} JSON object */ - UpdateOrganizationSettingsRequest.prototype.toJSON = function toJSON() { + GroupFindingsResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return UpdateOrganizationSettingsRequest; + return GroupFindingsResponse; })(); - v1beta1.UpdateSourceRequest = (function() { + v1beta1.GroupResult = (function() { /** - * Properties of an UpdateSourceRequest. + * Properties of a GroupResult. * @memberof google.cloud.securitycenter.v1beta1 - * @interface IUpdateSourceRequest - * @property {google.cloud.securitycenter.v1beta1.ISource|null} [source] UpdateSourceRequest source - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateSourceRequest updateMask + * @interface IGroupResult + * @property {Object.|null} [properties] GroupResult properties + * @property {number|Long|null} [count] GroupResult count */ /** - * Constructs a new UpdateSourceRequest. + * Constructs a new GroupResult. * @memberof google.cloud.securitycenter.v1beta1 - * @classdesc Represents an UpdateSourceRequest. - * @implements IUpdateSourceRequest + * @classdesc Represents a GroupResult. + * @implements IGroupResult * @constructor - * @param {google.cloud.securitycenter.v1beta1.IUpdateSourceRequest=} [properties] Properties to set + * @param {google.cloud.securitycenter.v1beta1.IGroupResult=} [properties] Properties to set */ - function UpdateSourceRequest(properties) { + function GroupResult(properties) { + this.properties = {}; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -14889,88 +14470,96 @@ } /** - * UpdateSourceRequest source. - * @member {google.cloud.securitycenter.v1beta1.ISource|null|undefined} source - * @memberof google.cloud.securitycenter.v1beta1.UpdateSourceRequest + * GroupResult properties. + * @member {Object.} properties + * @memberof google.cloud.securitycenter.v1beta1.GroupResult * @instance */ - UpdateSourceRequest.prototype.source = null; + GroupResult.prototype.properties = $util.emptyObject; /** - * UpdateSourceRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.cloud.securitycenter.v1beta1.UpdateSourceRequest + * GroupResult count. + * @member {number|Long} count + * @memberof google.cloud.securitycenter.v1beta1.GroupResult * @instance */ - UpdateSourceRequest.prototype.updateMask = null; + GroupResult.prototype.count = $util.Long ? $util.Long.fromBits(0,0,false) : 0; /** - * Creates a new UpdateSourceRequest instance using the specified properties. + * Creates a new GroupResult instance using the specified properties. * @function create - * @memberof google.cloud.securitycenter.v1beta1.UpdateSourceRequest + * @memberof google.cloud.securitycenter.v1beta1.GroupResult * @static - * @param {google.cloud.securitycenter.v1beta1.IUpdateSourceRequest=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1beta1.UpdateSourceRequest} UpdateSourceRequest instance + * @param {google.cloud.securitycenter.v1beta1.IGroupResult=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1beta1.GroupResult} GroupResult instance */ - UpdateSourceRequest.create = function create(properties) { - return new UpdateSourceRequest(properties); + GroupResult.create = function create(properties) { + return new GroupResult(properties); }; /** - * Encodes the specified UpdateSourceRequest message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.UpdateSourceRequest.verify|verify} messages. + * Encodes the specified GroupResult message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.GroupResult.verify|verify} messages. * @function encode - * @memberof google.cloud.securitycenter.v1beta1.UpdateSourceRequest + * @memberof google.cloud.securitycenter.v1beta1.GroupResult * @static - * @param {google.cloud.securitycenter.v1beta1.IUpdateSourceRequest} message UpdateSourceRequest message or plain object to encode + * @param {google.cloud.securitycenter.v1beta1.IGroupResult} message GroupResult message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateSourceRequest.encode = function encode(message, writer) { + GroupResult.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.source != null && message.hasOwnProperty("source")) - $root.google.cloud.securitycenter.v1beta1.Source.encode(message.source, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.properties != null && message.hasOwnProperty("properties")) + for (var keys = Object.keys(message.properties), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.protobuf.Value.encode(message.properties[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.count != null && message.hasOwnProperty("count")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.count); return writer; }; /** - * Encodes the specified UpdateSourceRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.UpdateSourceRequest.verify|verify} messages. + * Encodes the specified GroupResult message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.GroupResult.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1beta1.UpdateSourceRequest + * @memberof google.cloud.securitycenter.v1beta1.GroupResult * @static - * @param {google.cloud.securitycenter.v1beta1.IUpdateSourceRequest} message UpdateSourceRequest message or plain object to encode + * @param {google.cloud.securitycenter.v1beta1.IGroupResult} message GroupResult message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateSourceRequest.encodeDelimited = function encodeDelimited(message, writer) { + GroupResult.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an UpdateSourceRequest message from the specified reader or buffer. + * Decodes a GroupResult message from the specified reader or buffer. * @function decode - * @memberof google.cloud.securitycenter.v1beta1.UpdateSourceRequest + * @memberof google.cloud.securitycenter.v1beta1.GroupResult * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1beta1.UpdateSourceRequest} UpdateSourceRequest + * @returns {google.cloud.securitycenter.v1beta1.GroupResult} GroupResult * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UpdateSourceRequest.decode = function decode(reader, length) { + GroupResult.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.cloud.securitycenter.v1beta1.UpdateSourceRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1beta1.GroupResult(), key; while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.source = $root.google.cloud.securitycenter.v1beta1.Source.decode(reader, reader.uint32()); + reader.skip().pos++; + if (message.properties === $util.emptyObject) + message.properties = {}; + key = reader.string(); + reader.pos++; + message.properties[key] = $root.google.protobuf.Value.decode(reader, reader.uint32()); break; case 2: - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + message.count = reader.int64(); break; default: reader.skipType(tag & 7); @@ -14981,128 +14570,151 @@ }; /** - * Decodes an UpdateSourceRequest message from the specified reader or buffer, length delimited. + * Decodes a GroupResult message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1beta1.UpdateSourceRequest + * @memberof google.cloud.securitycenter.v1beta1.GroupResult * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1beta1.UpdateSourceRequest} UpdateSourceRequest + * @returns {google.cloud.securitycenter.v1beta1.GroupResult} GroupResult * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UpdateSourceRequest.decodeDelimited = function decodeDelimited(reader) { + GroupResult.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an UpdateSourceRequest message. + * Verifies a GroupResult message. * @function verify - * @memberof google.cloud.securitycenter.v1beta1.UpdateSourceRequest + * @memberof google.cloud.securitycenter.v1beta1.GroupResult * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - UpdateSourceRequest.verify = function verify(message) { + GroupResult.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.source != null && message.hasOwnProperty("source")) { - var error = $root.google.cloud.securitycenter.v1beta1.Source.verify(message.source); - if (error) - return "source." + error; - } - if (message.updateMask != null && message.hasOwnProperty("updateMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.updateMask); - if (error) - return "updateMask." + error; + if (message.properties != null && message.hasOwnProperty("properties")) { + if (!$util.isObject(message.properties)) + return "properties: object expected"; + var key = Object.keys(message.properties); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.protobuf.Value.verify(message.properties[key[i]]); + if (error) + return "properties." + error; + } } + if (message.count != null && message.hasOwnProperty("count")) + if (!$util.isInteger(message.count) && !(message.count && $util.isInteger(message.count.low) && $util.isInteger(message.count.high))) + return "count: integer|Long expected"; return null; }; /** - * Creates an UpdateSourceRequest message from a plain object. Also converts values to their respective internal types. + * Creates a GroupResult message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.securitycenter.v1beta1.UpdateSourceRequest + * @memberof google.cloud.securitycenter.v1beta1.GroupResult * @static * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1beta1.UpdateSourceRequest} UpdateSourceRequest + * @returns {google.cloud.securitycenter.v1beta1.GroupResult} GroupResult */ - UpdateSourceRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1beta1.UpdateSourceRequest) + GroupResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1beta1.GroupResult) return object; - var message = new $root.google.cloud.securitycenter.v1beta1.UpdateSourceRequest(); - if (object.source != null) { - if (typeof object.source !== "object") - throw TypeError(".google.cloud.securitycenter.v1beta1.UpdateSourceRequest.source: object expected"); - message.source = $root.google.cloud.securitycenter.v1beta1.Source.fromObject(object.source); - } - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.cloud.securitycenter.v1beta1.UpdateSourceRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + var message = new $root.google.cloud.securitycenter.v1beta1.GroupResult(); + if (object.properties) { + if (typeof object.properties !== "object") + throw TypeError(".google.cloud.securitycenter.v1beta1.GroupResult.properties: object expected"); + message.properties = {}; + for (var keys = Object.keys(object.properties), i = 0; i < keys.length; ++i) { + if (typeof object.properties[keys[i]] !== "object") + throw TypeError(".google.cloud.securitycenter.v1beta1.GroupResult.properties: object expected"); + message.properties[keys[i]] = $root.google.protobuf.Value.fromObject(object.properties[keys[i]]); + } } + if (object.count != null) + if ($util.Long) + (message.count = $util.Long.fromValue(object.count)).unsigned = false; + else if (typeof object.count === "string") + message.count = parseInt(object.count, 10); + else if (typeof object.count === "number") + message.count = object.count; + else if (typeof object.count === "object") + message.count = new $util.LongBits(object.count.low >>> 0, object.count.high >>> 0).toNumber(); return message; }; /** - * Creates a plain object from an UpdateSourceRequest message. Also converts values to other types if specified. + * Creates a plain object from a GroupResult message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.securitycenter.v1beta1.UpdateSourceRequest + * @memberof google.cloud.securitycenter.v1beta1.GroupResult * @static - * @param {google.cloud.securitycenter.v1beta1.UpdateSourceRequest} message UpdateSourceRequest + * @param {google.cloud.securitycenter.v1beta1.GroupResult} message GroupResult * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - UpdateSourceRequest.toObject = function toObject(message, options) { + GroupResult.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.source = null; - object.updateMask = null; + if (options.objects || options.defaults) + object.properties = {}; + if (options.defaults) + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.count = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.count = options.longs === String ? "0" : 0; + var keys2; + if (message.properties && (keys2 = Object.keys(message.properties)).length) { + object.properties = {}; + for (var j = 0; j < keys2.length; ++j) + object.properties[keys2[j]] = $root.google.protobuf.Value.toObject(message.properties[keys2[j]], options); } - if (message.source != null && message.hasOwnProperty("source")) - object.source = $root.google.cloud.securitycenter.v1beta1.Source.toObject(message.source, options); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.count != null && message.hasOwnProperty("count")) + if (typeof message.count === "number") + object.count = options.longs === String ? String(message.count) : message.count; + else + object.count = options.longs === String ? $util.Long.prototype.toString.call(message.count) : options.longs === Number ? new $util.LongBits(message.count.low >>> 0, message.count.high >>> 0).toNumber() : message.count; return object; }; /** - * Converts this UpdateSourceRequest to JSON. + * Converts this GroupResult to JSON. * @function toJSON - * @memberof google.cloud.securitycenter.v1beta1.UpdateSourceRequest + * @memberof google.cloud.securitycenter.v1beta1.GroupResult * @instance * @returns {Object.} JSON object */ - UpdateSourceRequest.prototype.toJSON = function toJSON() { + GroupResult.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return UpdateSourceRequest; + return GroupResult; })(); - v1beta1.UpdateSecurityMarksRequest = (function() { + v1beta1.ListSourcesRequest = (function() { /** - * Properties of an UpdateSecurityMarksRequest. + * Properties of a ListSourcesRequest. * @memberof google.cloud.securitycenter.v1beta1 - * @interface IUpdateSecurityMarksRequest - * @property {google.cloud.securitycenter.v1beta1.ISecurityMarks|null} [securityMarks] UpdateSecurityMarksRequest securityMarks - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateSecurityMarksRequest updateMask - * @property {google.protobuf.ITimestamp|null} [startTime] UpdateSecurityMarksRequest startTime + * @interface IListSourcesRequest + * @property {string|null} [parent] ListSourcesRequest parent + * @property {string|null} [pageToken] ListSourcesRequest pageToken + * @property {number|null} [pageSize] ListSourcesRequest pageSize */ /** - * Constructs a new UpdateSecurityMarksRequest. + * Constructs a new ListSourcesRequest. * @memberof google.cloud.securitycenter.v1beta1 - * @classdesc Represents an UpdateSecurityMarksRequest. - * @implements IUpdateSecurityMarksRequest + * @classdesc Represents a ListSourcesRequest. + * @implements IListSourcesRequest * @constructor - * @param {google.cloud.securitycenter.v1beta1.IUpdateSecurityMarksRequest=} [properties] Properties to set + * @param {google.cloud.securitycenter.v1beta1.IListSourcesRequest=} [properties] Properties to set */ - function UpdateSecurityMarksRequest(properties) { + function ListSourcesRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -15110,101 +14722,101 @@ } /** - * UpdateSecurityMarksRequest securityMarks. - * @member {google.cloud.securitycenter.v1beta1.ISecurityMarks|null|undefined} securityMarks - * @memberof google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest + * ListSourcesRequest parent. + * @member {string} parent + * @memberof google.cloud.securitycenter.v1beta1.ListSourcesRequest * @instance */ - UpdateSecurityMarksRequest.prototype.securityMarks = null; + ListSourcesRequest.prototype.parent = ""; /** - * UpdateSecurityMarksRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest + * ListSourcesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.securitycenter.v1beta1.ListSourcesRequest * @instance */ - UpdateSecurityMarksRequest.prototype.updateMask = null; + ListSourcesRequest.prototype.pageToken = ""; /** - * UpdateSecurityMarksRequest startTime. - * @member {google.protobuf.ITimestamp|null|undefined} startTime - * @memberof google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest + * ListSourcesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.securitycenter.v1beta1.ListSourcesRequest * @instance */ - UpdateSecurityMarksRequest.prototype.startTime = null; + ListSourcesRequest.prototype.pageSize = 0; /** - * Creates a new UpdateSecurityMarksRequest instance using the specified properties. + * Creates a new ListSourcesRequest instance using the specified properties. * @function create - * @memberof google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest + * @memberof google.cloud.securitycenter.v1beta1.ListSourcesRequest * @static - * @param {google.cloud.securitycenter.v1beta1.IUpdateSecurityMarksRequest=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest} UpdateSecurityMarksRequest instance + * @param {google.cloud.securitycenter.v1beta1.IListSourcesRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1beta1.ListSourcesRequest} ListSourcesRequest instance */ - UpdateSecurityMarksRequest.create = function create(properties) { - return new UpdateSecurityMarksRequest(properties); + ListSourcesRequest.create = function create(properties) { + return new ListSourcesRequest(properties); }; /** - * Encodes the specified UpdateSecurityMarksRequest message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest.verify|verify} messages. + * Encodes the specified ListSourcesRequest message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.ListSourcesRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest + * @memberof google.cloud.securitycenter.v1beta1.ListSourcesRequest * @static - * @param {google.cloud.securitycenter.v1beta1.IUpdateSecurityMarksRequest} message UpdateSecurityMarksRequest message or plain object to encode + * @param {google.cloud.securitycenter.v1beta1.IListSourcesRequest} message ListSourcesRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateSecurityMarksRequest.encode = function encode(message, writer) { + ListSourcesRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.securityMarks != null && message.hasOwnProperty("securityMarks")) - $root.google.cloud.securitycenter.v1beta1.SecurityMarks.encode(message.securityMarks, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.startTime != null && message.hasOwnProperty("startTime")) - $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.parent != null && message.hasOwnProperty("parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.pageToken); + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.pageSize); return writer; }; /** - * Encodes the specified UpdateSecurityMarksRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest.verify|verify} messages. + * Encodes the specified ListSourcesRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.ListSourcesRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest + * @memberof google.cloud.securitycenter.v1beta1.ListSourcesRequest * @static - * @param {google.cloud.securitycenter.v1beta1.IUpdateSecurityMarksRequest} message UpdateSecurityMarksRequest message or plain object to encode + * @param {google.cloud.securitycenter.v1beta1.IListSourcesRequest} message ListSourcesRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateSecurityMarksRequest.encodeDelimited = function encodeDelimited(message, writer) { + ListSourcesRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an UpdateSecurityMarksRequest message from the specified reader or buffer. + * Decodes a ListSourcesRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest + * @memberof google.cloud.securitycenter.v1beta1.ListSourcesRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest} UpdateSecurityMarksRequest + * @returns {google.cloud.securitycenter.v1beta1.ListSourcesRequest} ListSourcesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UpdateSecurityMarksRequest.decode = function decode(reader, length) { + ListSourcesRequest.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.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1beta1.ListSourcesRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.securityMarks = $root.google.cloud.securitycenter.v1beta1.SecurityMarks.decode(reader, reader.uint32()); + message.parent = reader.string(); break; case 2: - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + message.pageToken = reader.string(); break; - case 3: - message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + case 7: + message.pageSize = reader.int32(); break; default: reader.skipType(tag & 7); @@ -15215,145 +14827,126 @@ }; /** - * Decodes an UpdateSecurityMarksRequest message from the specified reader or buffer, length delimited. + * Decodes a ListSourcesRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest + * @memberof google.cloud.securitycenter.v1beta1.ListSourcesRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest} UpdateSecurityMarksRequest + * @returns {google.cloud.securitycenter.v1beta1.ListSourcesRequest} ListSourcesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UpdateSecurityMarksRequest.decodeDelimited = function decodeDelimited(reader) { + ListSourcesRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an UpdateSecurityMarksRequest message. + * Verifies a ListSourcesRequest message. * @function verify - * @memberof google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest + * @memberof google.cloud.securitycenter.v1beta1.ListSourcesRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - UpdateSecurityMarksRequest.verify = function verify(message) { + ListSourcesRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.securityMarks != null && message.hasOwnProperty("securityMarks")) { - var error = $root.google.cloud.securitycenter.v1beta1.SecurityMarks.verify(message.securityMarks); - if (error) - return "securityMarks." + error; - } - if (message.updateMask != null && message.hasOwnProperty("updateMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.updateMask); - if (error) - return "updateMask." + error; - } - if (message.startTime != null && message.hasOwnProperty("startTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.startTime); - if (error) - return "startTime." + error; - } + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; return null; }; /** - * Creates an UpdateSecurityMarksRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ListSourcesRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest + * @memberof google.cloud.securitycenter.v1beta1.ListSourcesRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest} UpdateSecurityMarksRequest + * @returns {google.cloud.securitycenter.v1beta1.ListSourcesRequest} ListSourcesRequest */ - UpdateSecurityMarksRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest) + ListSourcesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1beta1.ListSourcesRequest) return object; - var message = new $root.google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest(); - if (object.securityMarks != null) { - if (typeof object.securityMarks !== "object") - throw TypeError(".google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest.securityMarks: object expected"); - message.securityMarks = $root.google.cloud.securitycenter.v1beta1.SecurityMarks.fromObject(object.securityMarks); - } - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); - } - if (object.startTime != null) { - if (typeof object.startTime !== "object") - throw TypeError(".google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest.startTime: object expected"); - message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); - } + var message = new $root.google.cloud.securitycenter.v1beta1.ListSourcesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; return message; }; /** - * Creates a plain object from an UpdateSecurityMarksRequest message. Also converts values to other types if specified. + * Creates a plain object from a ListSourcesRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest + * @memberof google.cloud.securitycenter.v1beta1.ListSourcesRequest * @static - * @param {google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest} message UpdateSecurityMarksRequest + * @param {google.cloud.securitycenter.v1beta1.ListSourcesRequest} message ListSourcesRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - UpdateSecurityMarksRequest.toObject = function toObject(message, options) { + ListSourcesRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.securityMarks = null; - object.updateMask = null; - object.startTime = null; + object.parent = ""; + object.pageToken = ""; + object.pageSize = 0; } - if (message.securityMarks != null && message.hasOwnProperty("securityMarks")) - object.securityMarks = $root.google.cloud.securitycenter.v1beta1.SecurityMarks.toObject(message.securityMarks, options); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); - if (message.startTime != null && message.hasOwnProperty("startTime")) - object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; return object; }; /** - * Converts this UpdateSecurityMarksRequest to JSON. + * Converts this ListSourcesRequest to JSON. * @function toJSON - * @memberof google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest + * @memberof google.cloud.securitycenter.v1beta1.ListSourcesRequest * @instance * @returns {Object.} JSON object */ - UpdateSecurityMarksRequest.prototype.toJSON = function toJSON() { + ListSourcesRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return UpdateSecurityMarksRequest; + return ListSourcesRequest; })(); - v1beta1.Asset = (function() { + v1beta1.ListSourcesResponse = (function() { /** - * Properties of an Asset. + * Properties of a ListSourcesResponse. * @memberof google.cloud.securitycenter.v1beta1 - * @interface IAsset - * @property {string|null} [name] Asset name - * @property {google.cloud.securitycenter.v1beta1.Asset.ISecurityCenterProperties|null} [securityCenterProperties] Asset securityCenterProperties - * @property {Object.|null} [resourceProperties] Asset resourceProperties - * @property {google.cloud.securitycenter.v1beta1.ISecurityMarks|null} [securityMarks] Asset securityMarks - * @property {google.protobuf.ITimestamp|null} [createTime] Asset createTime - * @property {google.protobuf.ITimestamp|null} [updateTime] Asset updateTime + * @interface IListSourcesResponse + * @property {Array.|null} [sources] ListSourcesResponse sources + * @property {string|null} [nextPageToken] ListSourcesResponse nextPageToken */ /** - * Constructs a new Asset. + * Constructs a new ListSourcesResponse. * @memberof google.cloud.securitycenter.v1beta1 - * @classdesc Represents an Asset. - * @implements IAsset + * @classdesc Represents a ListSourcesResponse. + * @implements IListSourcesResponse * @constructor - * @param {google.cloud.securitycenter.v1beta1.IAsset=} [properties] Properties to set + * @param {google.cloud.securitycenter.v1beta1.IListSourcesResponse=} [properties] Properties to set */ - function Asset(properties) { - this.resourceProperties = {}; + function ListSourcesResponse(properties) { + this.sources = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -15361,148 +14954,91 @@ } /** - * Asset name. - * @member {string} name - * @memberof google.cloud.securitycenter.v1beta1.Asset - * @instance - */ - Asset.prototype.name = ""; - - /** - * Asset securityCenterProperties. - * @member {google.cloud.securitycenter.v1beta1.Asset.ISecurityCenterProperties|null|undefined} securityCenterProperties - * @memberof google.cloud.securitycenter.v1beta1.Asset - * @instance - */ - Asset.prototype.securityCenterProperties = null; - - /** - * Asset resourceProperties. - * @member {Object.} resourceProperties - * @memberof google.cloud.securitycenter.v1beta1.Asset - * @instance - */ - Asset.prototype.resourceProperties = $util.emptyObject; - - /** - * Asset securityMarks. - * @member {google.cloud.securitycenter.v1beta1.ISecurityMarks|null|undefined} securityMarks - * @memberof google.cloud.securitycenter.v1beta1.Asset - * @instance - */ - Asset.prototype.securityMarks = null; - - /** - * Asset createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.securitycenter.v1beta1.Asset + * ListSourcesResponse sources. + * @member {Array.} sources + * @memberof google.cloud.securitycenter.v1beta1.ListSourcesResponse * @instance */ - Asset.prototype.createTime = null; + ListSourcesResponse.prototype.sources = $util.emptyArray; /** - * Asset updateTime. - * @member {google.protobuf.ITimestamp|null|undefined} updateTime - * @memberof google.cloud.securitycenter.v1beta1.Asset + * ListSourcesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.securitycenter.v1beta1.ListSourcesResponse * @instance */ - Asset.prototype.updateTime = null; + ListSourcesResponse.prototype.nextPageToken = ""; /** - * Creates a new Asset instance using the specified properties. + * Creates a new ListSourcesResponse instance using the specified properties. * @function create - * @memberof google.cloud.securitycenter.v1beta1.Asset + * @memberof google.cloud.securitycenter.v1beta1.ListSourcesResponse * @static - * @param {google.cloud.securitycenter.v1beta1.IAsset=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1beta1.Asset} Asset instance + * @param {google.cloud.securitycenter.v1beta1.IListSourcesResponse=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1beta1.ListSourcesResponse} ListSourcesResponse instance */ - Asset.create = function create(properties) { - return new Asset(properties); + ListSourcesResponse.create = function create(properties) { + return new ListSourcesResponse(properties); }; /** - * Encodes the specified Asset message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.Asset.verify|verify} messages. + * Encodes the specified ListSourcesResponse message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.ListSourcesResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.securitycenter.v1beta1.Asset + * @memberof google.cloud.securitycenter.v1beta1.ListSourcesResponse * @static - * @param {google.cloud.securitycenter.v1beta1.IAsset} message Asset message or plain object to encode + * @param {google.cloud.securitycenter.v1beta1.IListSourcesResponse} message ListSourcesResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Asset.encode = function encode(message, writer) { + ListSourcesResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.securityCenterProperties != null && message.hasOwnProperty("securityCenterProperties")) - $root.google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties.encode(message.securityCenterProperties, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.resourceProperties != null && message.hasOwnProperty("resourceProperties")) - for (var keys = Object.keys(message.resourceProperties), i = 0; i < keys.length; ++i) { - writer.uint32(/* id 7, wireType 2 =*/58).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); - $root.google.protobuf.Value.encode(message.resourceProperties[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); - } - if (message.securityMarks != null && message.hasOwnProperty("securityMarks")) - $root.google.cloud.securitycenter.v1beta1.SecurityMarks.encode(message.securityMarks, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.createTime != null && message.hasOwnProperty("createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.updateTime != null && message.hasOwnProperty("updateTime")) - $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.sources != null && message.sources.length) + for (var i = 0; i < message.sources.length; ++i) + $root.google.cloud.securitycenter.v1beta1.Source.encode(message.sources[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); return writer; }; /** - * Encodes the specified Asset message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.Asset.verify|verify} messages. + * Encodes the specified ListSourcesResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.ListSourcesResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1beta1.Asset + * @memberof google.cloud.securitycenter.v1beta1.ListSourcesResponse * @static - * @param {google.cloud.securitycenter.v1beta1.IAsset} message Asset message or plain object to encode + * @param {google.cloud.securitycenter.v1beta1.IListSourcesResponse} message ListSourcesResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Asset.encodeDelimited = function encodeDelimited(message, writer) { + ListSourcesResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an Asset message from the specified reader or buffer. + * Decodes a ListSourcesResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.securitycenter.v1beta1.Asset + * @memberof google.cloud.securitycenter.v1beta1.ListSourcesResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1beta1.Asset} Asset + * @returns {google.cloud.securitycenter.v1beta1.ListSourcesResponse} ListSourcesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Asset.decode = function decode(reader, length) { + ListSourcesResponse.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.cloud.securitycenter.v1beta1.Asset(), key; + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1beta1.ListSourcesResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.name = reader.string(); + if (!(message.sources && message.sources.length)) + message.sources = []; + message.sources.push($root.google.cloud.securitycenter.v1beta1.Source.decode(reader, reader.uint32())); break; case 2: - message.securityCenterProperties = $root.google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties.decode(reader, reader.uint32()); - break; - case 7: - reader.skip().pos++; - if (message.resourceProperties === $util.emptyObject) - message.resourceProperties = {}; - key = reader.string(); - reader.pos++; - message.resourceProperties[key] = $root.google.protobuf.Value.decode(reader, reader.uint32()); - break; - case 8: - message.securityMarks = $root.google.cloud.securitycenter.v1beta1.SecurityMarks.decode(reader, reader.uint32()); - break; - case 9: - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 10: - message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + message.nextPageToken = reader.string(); break; default: reader.skipType(tag & 7); @@ -15513,578 +15049,307 @@ }; /** - * Decodes an Asset message from the specified reader or buffer, length delimited. + * Decodes a ListSourcesResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1beta1.Asset + * @memberof google.cloud.securitycenter.v1beta1.ListSourcesResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1beta1.Asset} Asset + * @returns {google.cloud.securitycenter.v1beta1.ListSourcesResponse} ListSourcesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Asset.decodeDelimited = function decodeDelimited(reader) { + ListSourcesResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an Asset message. + * Verifies a ListSourcesResponse message. * @function verify - * @memberof google.cloud.securitycenter.v1beta1.Asset + * @memberof google.cloud.securitycenter.v1beta1.ListSourcesResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Asset.verify = function verify(message) { + ListSourcesResponse.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.securityCenterProperties != null && message.hasOwnProperty("securityCenterProperties")) { - var error = $root.google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties.verify(message.securityCenterProperties); - if (error) - return "securityCenterProperties." + error; - } - if (message.resourceProperties != null && message.hasOwnProperty("resourceProperties")) { - if (!$util.isObject(message.resourceProperties)) - return "resourceProperties: object expected"; - var key = Object.keys(message.resourceProperties); - for (var i = 0; i < key.length; ++i) { - var error = $root.google.protobuf.Value.verify(message.resourceProperties[key[i]]); + if (message.sources != null && message.hasOwnProperty("sources")) { + if (!Array.isArray(message.sources)) + return "sources: array expected"; + for (var i = 0; i < message.sources.length; ++i) { + var error = $root.google.cloud.securitycenter.v1beta1.Source.verify(message.sources[i]); if (error) - return "resourceProperties." + error; + return "sources." + error; } } - if (message.securityMarks != null && message.hasOwnProperty("securityMarks")) { - var error = $root.google.cloud.securitycenter.v1beta1.SecurityMarks.verify(message.securityMarks); - if (error) - return "securityMarks." + error; - } - if (message.createTime != null && message.hasOwnProperty("createTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.createTime); - if (error) - return "createTime." + error; - } - if (message.updateTime != null && message.hasOwnProperty("updateTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.updateTime); - if (error) - return "updateTime." + error; - } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; return null; }; /** - * Creates an Asset message from a plain object. Also converts values to their respective internal types. + * Creates a ListSourcesResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.securitycenter.v1beta1.Asset + * @memberof google.cloud.securitycenter.v1beta1.ListSourcesResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1beta1.Asset} Asset + * @returns {google.cloud.securitycenter.v1beta1.ListSourcesResponse} ListSourcesResponse */ - Asset.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1beta1.Asset) + ListSourcesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1beta1.ListSourcesResponse) return object; - var message = new $root.google.cloud.securitycenter.v1beta1.Asset(); - if (object.name != null) - message.name = String(object.name); - if (object.securityCenterProperties != null) { - if (typeof object.securityCenterProperties !== "object") - throw TypeError(".google.cloud.securitycenter.v1beta1.Asset.securityCenterProperties: object expected"); - message.securityCenterProperties = $root.google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties.fromObject(object.securityCenterProperties); - } - if (object.resourceProperties) { - if (typeof object.resourceProperties !== "object") - throw TypeError(".google.cloud.securitycenter.v1beta1.Asset.resourceProperties: object expected"); - message.resourceProperties = {}; - for (var keys = Object.keys(object.resourceProperties), i = 0; i < keys.length; ++i) { - if (typeof object.resourceProperties[keys[i]] !== "object") - throw TypeError(".google.cloud.securitycenter.v1beta1.Asset.resourceProperties: object expected"); - message.resourceProperties[keys[i]] = $root.google.protobuf.Value.fromObject(object.resourceProperties[keys[i]]); + var message = new $root.google.cloud.securitycenter.v1beta1.ListSourcesResponse(); + if (object.sources) { + if (!Array.isArray(object.sources)) + throw TypeError(".google.cloud.securitycenter.v1beta1.ListSourcesResponse.sources: array expected"); + message.sources = []; + for (var i = 0; i < object.sources.length; ++i) { + if (typeof object.sources[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v1beta1.ListSourcesResponse.sources: object expected"); + message.sources[i] = $root.google.cloud.securitycenter.v1beta1.Source.fromObject(object.sources[i]); } } - if (object.securityMarks != null) { - if (typeof object.securityMarks !== "object") - throw TypeError(".google.cloud.securitycenter.v1beta1.Asset.securityMarks: object expected"); - message.securityMarks = $root.google.cloud.securitycenter.v1beta1.SecurityMarks.fromObject(object.securityMarks); - } - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.securitycenter.v1beta1.Asset.createTime: object expected"); - message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); - } - if (object.updateTime != null) { - if (typeof object.updateTime !== "object") - throw TypeError(".google.cloud.securitycenter.v1beta1.Asset.updateTime: object expected"); - message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); - } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); return message; }; /** - * Creates a plain object from an Asset message. Also converts values to other types if specified. + * Creates a plain object from a ListSourcesResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.securitycenter.v1beta1.Asset + * @memberof google.cloud.securitycenter.v1beta1.ListSourcesResponse * @static - * @param {google.cloud.securitycenter.v1beta1.Asset} message Asset + * @param {google.cloud.securitycenter.v1beta1.ListSourcesResponse} message ListSourcesResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Asset.toObject = function toObject(message, options) { + ListSourcesResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.objects || options.defaults) - object.resourceProperties = {}; - if (options.defaults) { - object.name = ""; - object.securityCenterProperties = null; - object.securityMarks = null; - object.createTime = null; - object.updateTime = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.securityCenterProperties != null && message.hasOwnProperty("securityCenterProperties")) - object.securityCenterProperties = $root.google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties.toObject(message.securityCenterProperties, options); - var keys2; - if (message.resourceProperties && (keys2 = Object.keys(message.resourceProperties)).length) { - object.resourceProperties = {}; - for (var j = 0; j < keys2.length; ++j) - object.resourceProperties[keys2[j]] = $root.google.protobuf.Value.toObject(message.resourceProperties[keys2[j]], options); + if (options.arrays || options.defaults) + object.sources = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.sources && message.sources.length) { + object.sources = []; + for (var j = 0; j < message.sources.length; ++j) + object.sources[j] = $root.google.cloud.securitycenter.v1beta1.Source.toObject(message.sources[j], options); } - if (message.securityMarks != null && message.hasOwnProperty("securityMarks")) - object.securityMarks = $root.google.cloud.securitycenter.v1beta1.SecurityMarks.toObject(message.securityMarks, options); - if (message.createTime != null && message.hasOwnProperty("createTime")) - object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); - if (message.updateTime != null && message.hasOwnProperty("updateTime")) - object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; return object; }; /** - * Converts this Asset to JSON. + * Converts this ListSourcesResponse to JSON. * @function toJSON - * @memberof google.cloud.securitycenter.v1beta1.Asset + * @memberof google.cloud.securitycenter.v1beta1.ListSourcesResponse * @instance * @returns {Object.} JSON object */ - Asset.prototype.toJSON = function toJSON() { + ListSourcesResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - Asset.SecurityCenterProperties = (function() { + return ListSourcesResponse; + })(); - /** - * Properties of a SecurityCenterProperties. - * @memberof google.cloud.securitycenter.v1beta1.Asset - * @interface ISecurityCenterProperties - * @property {string|null} [resourceName] SecurityCenterProperties resourceName - * @property {string|null} [resourceType] SecurityCenterProperties resourceType - * @property {string|null} [resourceParent] SecurityCenterProperties resourceParent - * @property {string|null} [resourceProject] SecurityCenterProperties resourceProject - * @property {Array.|null} [resourceOwners] SecurityCenterProperties resourceOwners - */ + v1beta1.ListAssetsRequest = (function() { - /** - * Constructs a new SecurityCenterProperties. - * @memberof google.cloud.securitycenter.v1beta1.Asset - * @classdesc Represents a SecurityCenterProperties. - * @implements ISecurityCenterProperties - * @constructor - * @param {google.cloud.securitycenter.v1beta1.Asset.ISecurityCenterProperties=} [properties] Properties to set - */ - function SecurityCenterProperties(properties) { - this.resourceOwners = []; - 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]]; - } + /** + * Properties of a ListAssetsRequest. + * @memberof google.cloud.securitycenter.v1beta1 + * @interface IListAssetsRequest + * @property {string|null} [parent] ListAssetsRequest parent + * @property {string|null} [filter] ListAssetsRequest filter + * @property {string|null} [orderBy] ListAssetsRequest orderBy + * @property {google.protobuf.ITimestamp|null} [readTime] ListAssetsRequest readTime + * @property {google.protobuf.IDuration|null} [compareDuration] ListAssetsRequest compareDuration + * @property {google.protobuf.IFieldMask|null} [fieldMask] ListAssetsRequest fieldMask + * @property {string|null} [pageToken] ListAssetsRequest pageToken + * @property {number|null} [pageSize] ListAssetsRequest pageSize + */ - /** - * SecurityCenterProperties resourceName. - * @member {string} resourceName - * @memberof google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties - * @instance - */ - SecurityCenterProperties.prototype.resourceName = ""; + /** + * Constructs a new ListAssetsRequest. + * @memberof google.cloud.securitycenter.v1beta1 + * @classdesc Represents a ListAssetsRequest. + * @implements IListAssetsRequest + * @constructor + * @param {google.cloud.securitycenter.v1beta1.IListAssetsRequest=} [properties] Properties to set + */ + function ListAssetsRequest(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]]; + } - /** - * SecurityCenterProperties resourceType. - * @member {string} resourceType - * @memberof google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties - * @instance - */ - SecurityCenterProperties.prototype.resourceType = ""; + /** + * ListAssetsRequest parent. + * @member {string} parent + * @memberof google.cloud.securitycenter.v1beta1.ListAssetsRequest + * @instance + */ + ListAssetsRequest.prototype.parent = ""; - /** - * SecurityCenterProperties resourceParent. - * @member {string} resourceParent - * @memberof google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties - * @instance - */ - SecurityCenterProperties.prototype.resourceParent = ""; + /** + * ListAssetsRequest filter. + * @member {string} filter + * @memberof google.cloud.securitycenter.v1beta1.ListAssetsRequest + * @instance + */ + ListAssetsRequest.prototype.filter = ""; - /** - * SecurityCenterProperties resourceProject. - * @member {string} resourceProject - * @memberof google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties - * @instance - */ - SecurityCenterProperties.prototype.resourceProject = ""; + /** + * ListAssetsRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.securitycenter.v1beta1.ListAssetsRequest + * @instance + */ + ListAssetsRequest.prototype.orderBy = ""; - /** - * SecurityCenterProperties resourceOwners. - * @member {Array.} resourceOwners - * @memberof google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties - * @instance - */ - SecurityCenterProperties.prototype.resourceOwners = $util.emptyArray; + /** + * ListAssetsRequest readTime. + * @member {google.protobuf.ITimestamp|null|undefined} readTime + * @memberof google.cloud.securitycenter.v1beta1.ListAssetsRequest + * @instance + */ + ListAssetsRequest.prototype.readTime = null; - /** - * Creates a new SecurityCenterProperties instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties - * @static - * @param {google.cloud.securitycenter.v1beta1.Asset.ISecurityCenterProperties=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties} SecurityCenterProperties instance - */ - SecurityCenterProperties.create = function create(properties) { - return new SecurityCenterProperties(properties); - }; + /** + * ListAssetsRequest compareDuration. + * @member {google.protobuf.IDuration|null|undefined} compareDuration + * @memberof google.cloud.securitycenter.v1beta1.ListAssetsRequest + * @instance + */ + ListAssetsRequest.prototype.compareDuration = null; - /** - * Encodes the specified SecurityCenterProperties message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties - * @static - * @param {google.cloud.securitycenter.v1beta1.Asset.ISecurityCenterProperties} message SecurityCenterProperties message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SecurityCenterProperties.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.resourceName != null && message.hasOwnProperty("resourceName")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.resourceName); - if (message.resourceType != null && message.hasOwnProperty("resourceType")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.resourceType); - if (message.resourceParent != null && message.hasOwnProperty("resourceParent")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.resourceParent); - if (message.resourceProject != null && message.hasOwnProperty("resourceProject")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.resourceProject); - if (message.resourceOwners != null && message.resourceOwners.length) - for (var i = 0; i < message.resourceOwners.length; ++i) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.resourceOwners[i]); - return writer; - }; + /** + * ListAssetsRequest fieldMask. + * @member {google.protobuf.IFieldMask|null|undefined} fieldMask + * @memberof google.cloud.securitycenter.v1beta1.ListAssetsRequest + * @instance + */ + ListAssetsRequest.prototype.fieldMask = null; - /** - * Encodes the specified SecurityCenterProperties message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties - * @static - * @param {google.cloud.securitycenter.v1beta1.Asset.ISecurityCenterProperties} message SecurityCenterProperties message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SecurityCenterProperties.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * ListAssetsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.securitycenter.v1beta1.ListAssetsRequest + * @instance + */ + ListAssetsRequest.prototype.pageToken = ""; - /** - * Decodes a SecurityCenterProperties message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties} SecurityCenterProperties - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SecurityCenterProperties.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.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.resourceName = reader.string(); - break; - case 2: - message.resourceType = reader.string(); - break; - case 3: - message.resourceParent = reader.string(); - break; - case 4: - message.resourceProject = reader.string(); - break; - case 5: - if (!(message.resourceOwners && message.resourceOwners.length)) - message.resourceOwners = []; - message.resourceOwners.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * ListAssetsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.securitycenter.v1beta1.ListAssetsRequest + * @instance + */ + ListAssetsRequest.prototype.pageSize = 0; - /** - * Decodes a SecurityCenterProperties message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties} SecurityCenterProperties - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SecurityCenterProperties.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Creates a new ListAssetsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1beta1.ListAssetsRequest + * @static + * @param {google.cloud.securitycenter.v1beta1.IListAssetsRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1beta1.ListAssetsRequest} ListAssetsRequest instance + */ + ListAssetsRequest.create = function create(properties) { + return new ListAssetsRequest(properties); + }; - /** - * Verifies a SecurityCenterProperties message. - * @function verify - * @memberof google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SecurityCenterProperties.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.resourceName != null && message.hasOwnProperty("resourceName")) - if (!$util.isString(message.resourceName)) - return "resourceName: string expected"; - if (message.resourceType != null && message.hasOwnProperty("resourceType")) - if (!$util.isString(message.resourceType)) - return "resourceType: string expected"; - if (message.resourceParent != null && message.hasOwnProperty("resourceParent")) - if (!$util.isString(message.resourceParent)) - return "resourceParent: string expected"; - if (message.resourceProject != null && message.hasOwnProperty("resourceProject")) - if (!$util.isString(message.resourceProject)) - return "resourceProject: string expected"; - if (message.resourceOwners != null && message.hasOwnProperty("resourceOwners")) { - if (!Array.isArray(message.resourceOwners)) - return "resourceOwners: array expected"; - for (var i = 0; i < message.resourceOwners.length; ++i) - if (!$util.isString(message.resourceOwners[i])) - return "resourceOwners: string[] expected"; - } - return null; - }; + /** + * Encodes the specified ListAssetsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.ListAssetsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1beta1.ListAssetsRequest + * @static + * @param {google.cloud.securitycenter.v1beta1.IListAssetsRequest} message ListAssetsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAssetsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && message.hasOwnProperty("parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.filter != null && message.hasOwnProperty("filter")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.orderBy); + if (message.readTime != null && message.hasOwnProperty("readTime")) + $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.compareDuration != null && message.hasOwnProperty("compareDuration")) + $root.google.protobuf.Duration.encode(message.compareDuration, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.fieldMask != null && message.hasOwnProperty("fieldMask")) + $root.google.protobuf.FieldMask.encode(message.fieldMask, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.pageToken); + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.pageSize); + return writer; + }; - /** - * Creates a SecurityCenterProperties message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties} SecurityCenterProperties - */ - SecurityCenterProperties.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties) - return object; - var message = new $root.google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties(); - if (object.resourceName != null) - message.resourceName = String(object.resourceName); - if (object.resourceType != null) - message.resourceType = String(object.resourceType); - if (object.resourceParent != null) - message.resourceParent = String(object.resourceParent); - if (object.resourceProject != null) - message.resourceProject = String(object.resourceProject); - if (object.resourceOwners) { - if (!Array.isArray(object.resourceOwners)) - throw TypeError(".google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties.resourceOwners: array expected"); - message.resourceOwners = []; - for (var i = 0; i < object.resourceOwners.length; ++i) - message.resourceOwners[i] = String(object.resourceOwners[i]); - } - return message; - }; - - /** - * Creates a plain object from a SecurityCenterProperties message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties - * @static - * @param {google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties} message SecurityCenterProperties - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SecurityCenterProperties.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.resourceOwners = []; - if (options.defaults) { - object.resourceName = ""; - object.resourceType = ""; - object.resourceParent = ""; - object.resourceProject = ""; - } - if (message.resourceName != null && message.hasOwnProperty("resourceName")) - object.resourceName = message.resourceName; - if (message.resourceType != null && message.hasOwnProperty("resourceType")) - object.resourceType = message.resourceType; - if (message.resourceParent != null && message.hasOwnProperty("resourceParent")) - object.resourceParent = message.resourceParent; - if (message.resourceProject != null && message.hasOwnProperty("resourceProject")) - object.resourceProject = message.resourceProject; - if (message.resourceOwners && message.resourceOwners.length) { - object.resourceOwners = []; - for (var j = 0; j < message.resourceOwners.length; ++j) - object.resourceOwners[j] = message.resourceOwners[j]; - } - return object; - }; - - /** - * Converts this SecurityCenterProperties to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties - * @instance - * @returns {Object.} JSON object - */ - SecurityCenterProperties.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return SecurityCenterProperties; - })(); - - return Asset; - })(); - - v1beta1.SecurityMarks = (function() { - - /** - * Properties of a SecurityMarks. - * @memberof google.cloud.securitycenter.v1beta1 - * @interface ISecurityMarks - * @property {string|null} [name] SecurityMarks name - * @property {Object.|null} [marks] SecurityMarks marks - */ - - /** - * Constructs a new SecurityMarks. - * @memberof google.cloud.securitycenter.v1beta1 - * @classdesc Represents a SecurityMarks. - * @implements ISecurityMarks - * @constructor - * @param {google.cloud.securitycenter.v1beta1.ISecurityMarks=} [properties] Properties to set - */ - function SecurityMarks(properties) { - this.marks = {}; - 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]]; - } - - /** - * SecurityMarks name. - * @member {string} name - * @memberof google.cloud.securitycenter.v1beta1.SecurityMarks - * @instance - */ - SecurityMarks.prototype.name = ""; - - /** - * SecurityMarks marks. - * @member {Object.} marks - * @memberof google.cloud.securitycenter.v1beta1.SecurityMarks - * @instance - */ - SecurityMarks.prototype.marks = $util.emptyObject; - - /** - * Creates a new SecurityMarks instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v1beta1.SecurityMarks - * @static - * @param {google.cloud.securitycenter.v1beta1.ISecurityMarks=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1beta1.SecurityMarks} SecurityMarks instance - */ - SecurityMarks.create = function create(properties) { - return new SecurityMarks(properties); - }; - - /** - * Encodes the specified SecurityMarks message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.SecurityMarks.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1beta1.SecurityMarks - * @static - * @param {google.cloud.securitycenter.v1beta1.ISecurityMarks} message SecurityMarks message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SecurityMarks.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.marks != null && message.hasOwnProperty("marks")) - for (var keys = Object.keys(message.marks), i = 0; i < keys.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.marks[keys[i]]).ldelim(); - return writer; - }; - - /** - * Encodes the specified SecurityMarks message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.SecurityMarks.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1beta1.SecurityMarks - * @static - * @param {google.cloud.securitycenter.v1beta1.ISecurityMarks} message SecurityMarks message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SecurityMarks.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Encodes the specified ListAssetsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.ListAssetsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1beta1.ListAssetsRequest + * @static + * @param {google.cloud.securitycenter.v1beta1.IListAssetsRequest} message ListAssetsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAssetsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; /** - * Decodes a SecurityMarks message from the specified reader or buffer. + * Decodes a ListAssetsRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.securitycenter.v1beta1.SecurityMarks + * @memberof google.cloud.securitycenter.v1beta1.ListAssetsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1beta1.SecurityMarks} SecurityMarks + * @returns {google.cloud.securitycenter.v1beta1.ListAssetsRequest} ListAssetsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SecurityMarks.decode = function decode(reader, length) { + ListAssetsRequest.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.cloud.securitycenter.v1beta1.SecurityMarks(), key; + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1beta1.ListAssetsRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.name = reader.string(); + message.parent = reader.string(); break; case 2: - reader.skip().pos++; - if (message.marks === $util.emptyObject) - message.marks = {}; - key = reader.string(); - reader.pos++; - message.marks[key] = reader.string(); + message.filter = reader.string(); + break; + case 3: + message.orderBy = reader.string(); + break; + case 4: + message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 5: + message.compareDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + case 7: + message.fieldMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + case 8: + message.pageToken = reader.string(); + break; + case 9: + message.pageSize = reader.int32(); break; default: reader.skipType(tag & 7); @@ -16095,140 +15360,183 @@ }; /** - * Decodes a SecurityMarks message from the specified reader or buffer, length delimited. + * Decodes a ListAssetsRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1beta1.SecurityMarks + * @memberof google.cloud.securitycenter.v1beta1.ListAssetsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1beta1.SecurityMarks} SecurityMarks + * @returns {google.cloud.securitycenter.v1beta1.ListAssetsRequest} ListAssetsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SecurityMarks.decodeDelimited = function decodeDelimited(reader) { + ListAssetsRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a SecurityMarks message. + * Verifies a ListAssetsRequest message. * @function verify - * @memberof google.cloud.securitycenter.v1beta1.SecurityMarks + * @memberof google.cloud.securitycenter.v1beta1.ListAssetsRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - SecurityMarks.verify = function verify(message) { + ListAssetsRequest.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.marks != null && message.hasOwnProperty("marks")) { - if (!$util.isObject(message.marks)) - return "marks: object expected"; - var key = Object.keys(message.marks); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.marks[key[i]])) - return "marks: string{k:string} expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + if (message.readTime != null && message.hasOwnProperty("readTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.readTime); + if (error) + return "readTime." + error; + } + if (message.compareDuration != null && message.hasOwnProperty("compareDuration")) { + var error = $root.google.protobuf.Duration.verify(message.compareDuration); + if (error) + return "compareDuration." + error; + } + if (message.fieldMask != null && message.hasOwnProperty("fieldMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.fieldMask); + if (error) + return "fieldMask." + error; } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; return null; }; /** - * Creates a SecurityMarks message from a plain object. Also converts values to their respective internal types. + * Creates a ListAssetsRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.securitycenter.v1beta1.SecurityMarks + * @memberof google.cloud.securitycenter.v1beta1.ListAssetsRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1beta1.SecurityMarks} SecurityMarks + * @returns {google.cloud.securitycenter.v1beta1.ListAssetsRequest} ListAssetsRequest */ - SecurityMarks.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1beta1.SecurityMarks) + ListAssetsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1beta1.ListAssetsRequest) return object; - var message = new $root.google.cloud.securitycenter.v1beta1.SecurityMarks(); - if (object.name != null) - message.name = String(object.name); - if (object.marks) { - if (typeof object.marks !== "object") - throw TypeError(".google.cloud.securitycenter.v1beta1.SecurityMarks.marks: object expected"); - message.marks = {}; - for (var keys = Object.keys(object.marks), i = 0; i < keys.length; ++i) - message.marks[keys[i]] = String(object.marks[keys[i]]); - } - return message; - }; - - /** - * Creates a plain object from a SecurityMarks message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v1beta1.SecurityMarks + var message = new $root.google.cloud.securitycenter.v1beta1.ListAssetsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.filter != null) + message.filter = String(object.filter); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.readTime != null) { + if (typeof object.readTime !== "object") + throw TypeError(".google.cloud.securitycenter.v1beta1.ListAssetsRequest.readTime: object expected"); + message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); + } + if (object.compareDuration != null) { + if (typeof object.compareDuration !== "object") + throw TypeError(".google.cloud.securitycenter.v1beta1.ListAssetsRequest.compareDuration: object expected"); + message.compareDuration = $root.google.protobuf.Duration.fromObject(object.compareDuration); + } + if (object.fieldMask != null) { + if (typeof object.fieldMask !== "object") + throw TypeError(".google.cloud.securitycenter.v1beta1.ListAssetsRequest.fieldMask: object expected"); + message.fieldMask = $root.google.protobuf.FieldMask.fromObject(object.fieldMask); + } + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + return message; + }; + + /** + * Creates a plain object from a ListAssetsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1beta1.ListAssetsRequest * @static - * @param {google.cloud.securitycenter.v1beta1.SecurityMarks} message SecurityMarks + * @param {google.cloud.securitycenter.v1beta1.ListAssetsRequest} message ListAssetsRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SecurityMarks.toObject = function toObject(message, options) { + ListAssetsRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.objects || options.defaults) - object.marks = {}; - if (options.defaults) - object.name = ""; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - var keys2; - if (message.marks && (keys2 = Object.keys(message.marks)).length) { - object.marks = {}; - for (var j = 0; j < keys2.length; ++j) - object.marks[keys2[j]] = message.marks[keys2[j]]; + if (options.defaults) { + object.parent = ""; + object.filter = ""; + object.orderBy = ""; + object.readTime = null; + object.compareDuration = null; + object.fieldMask = null; + object.pageToken = ""; + object.pageSize = 0; } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; + if (message.readTime != null && message.hasOwnProperty("readTime")) + object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); + if (message.compareDuration != null && message.hasOwnProperty("compareDuration")) + object.compareDuration = $root.google.protobuf.Duration.toObject(message.compareDuration, options); + if (message.fieldMask != null && message.hasOwnProperty("fieldMask")) + object.fieldMask = $root.google.protobuf.FieldMask.toObject(message.fieldMask, options); + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; return object; }; /** - * Converts this SecurityMarks to JSON. + * Converts this ListAssetsRequest to JSON. * @function toJSON - * @memberof google.cloud.securitycenter.v1beta1.SecurityMarks + * @memberof google.cloud.securitycenter.v1beta1.ListAssetsRequest * @instance * @returns {Object.} JSON object */ - SecurityMarks.prototype.toJSON = function toJSON() { + ListAssetsRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return SecurityMarks; + return ListAssetsRequest; })(); - v1beta1.Finding = (function() { + v1beta1.ListAssetsResponse = (function() { /** - * Properties of a Finding. + * Properties of a ListAssetsResponse. * @memberof google.cloud.securitycenter.v1beta1 - * @interface IFinding - * @property {string|null} [name] Finding name - * @property {string|null} [parent] Finding parent - * @property {string|null} [resourceName] Finding resourceName - * @property {google.cloud.securitycenter.v1beta1.Finding.State|null} [state] Finding state - * @property {string|null} [category] Finding category - * @property {string|null} [externalUri] Finding externalUri - * @property {Object.|null} [sourceProperties] Finding sourceProperties - * @property {google.cloud.securitycenter.v1beta1.ISecurityMarks|null} [securityMarks] Finding securityMarks - * @property {google.protobuf.ITimestamp|null} [eventTime] Finding eventTime - * @property {google.protobuf.ITimestamp|null} [createTime] Finding createTime + * @interface IListAssetsResponse + * @property {Array.|null} [listAssetsResults] ListAssetsResponse listAssetsResults + * @property {google.protobuf.ITimestamp|null} [readTime] ListAssetsResponse readTime + * @property {string|null} [nextPageToken] ListAssetsResponse nextPageToken + * @property {number|null} [totalSize] ListAssetsResponse totalSize */ /** - * Constructs a new Finding. + * Constructs a new ListAssetsResponse. * @memberof google.cloud.securitycenter.v1beta1 - * @classdesc Represents a Finding. - * @implements IFinding + * @classdesc Represents a ListAssetsResponse. + * @implements IListAssetsResponse * @constructor - * @param {google.cloud.securitycenter.v1beta1.IFinding=} [properties] Properties to set + * @param {google.cloud.securitycenter.v1beta1.IListAssetsResponse=} [properties] Properties to set */ - function Finding(properties) { - this.sourceProperties = {}; + function ListAssetsResponse(properties) { + this.listAssetsResults = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -16236,200 +15544,117 @@ } /** - * Finding name. - * @member {string} name - * @memberof google.cloud.securitycenter.v1beta1.Finding - * @instance - */ - Finding.prototype.name = ""; - - /** - * Finding parent. - * @member {string} parent - * @memberof google.cloud.securitycenter.v1beta1.Finding - * @instance - */ - Finding.prototype.parent = ""; - - /** - * Finding resourceName. - * @member {string} resourceName - * @memberof google.cloud.securitycenter.v1beta1.Finding - * @instance - */ - Finding.prototype.resourceName = ""; - - /** - * Finding state. - * @member {google.cloud.securitycenter.v1beta1.Finding.State} state - * @memberof google.cloud.securitycenter.v1beta1.Finding - * @instance - */ - Finding.prototype.state = 0; - - /** - * Finding category. - * @member {string} category - * @memberof google.cloud.securitycenter.v1beta1.Finding - * @instance - */ - Finding.prototype.category = ""; - - /** - * Finding externalUri. - * @member {string} externalUri - * @memberof google.cloud.securitycenter.v1beta1.Finding - * @instance - */ - Finding.prototype.externalUri = ""; - - /** - * Finding sourceProperties. - * @member {Object.} sourceProperties - * @memberof google.cloud.securitycenter.v1beta1.Finding + * ListAssetsResponse listAssetsResults. + * @member {Array.} listAssetsResults + * @memberof google.cloud.securitycenter.v1beta1.ListAssetsResponse * @instance */ - Finding.prototype.sourceProperties = $util.emptyObject; + ListAssetsResponse.prototype.listAssetsResults = $util.emptyArray; /** - * Finding securityMarks. - * @member {google.cloud.securitycenter.v1beta1.ISecurityMarks|null|undefined} securityMarks - * @memberof google.cloud.securitycenter.v1beta1.Finding + * ListAssetsResponse readTime. + * @member {google.protobuf.ITimestamp|null|undefined} readTime + * @memberof google.cloud.securitycenter.v1beta1.ListAssetsResponse * @instance */ - Finding.prototype.securityMarks = null; + ListAssetsResponse.prototype.readTime = null; /** - * Finding eventTime. - * @member {google.protobuf.ITimestamp|null|undefined} eventTime - * @memberof google.cloud.securitycenter.v1beta1.Finding + * ListAssetsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.securitycenter.v1beta1.ListAssetsResponse * @instance */ - Finding.prototype.eventTime = null; + ListAssetsResponse.prototype.nextPageToken = ""; /** - * Finding createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.securitycenter.v1beta1.Finding + * ListAssetsResponse totalSize. + * @member {number} totalSize + * @memberof google.cloud.securitycenter.v1beta1.ListAssetsResponse * @instance */ - Finding.prototype.createTime = null; + ListAssetsResponse.prototype.totalSize = 0; /** - * Creates a new Finding instance using the specified properties. + * Creates a new ListAssetsResponse instance using the specified properties. * @function create - * @memberof google.cloud.securitycenter.v1beta1.Finding + * @memberof google.cloud.securitycenter.v1beta1.ListAssetsResponse * @static - * @param {google.cloud.securitycenter.v1beta1.IFinding=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1beta1.Finding} Finding instance + * @param {google.cloud.securitycenter.v1beta1.IListAssetsResponse=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1beta1.ListAssetsResponse} ListAssetsResponse instance */ - Finding.create = function create(properties) { - return new Finding(properties); + ListAssetsResponse.create = function create(properties) { + return new ListAssetsResponse(properties); }; /** - * Encodes the specified Finding message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.Finding.verify|verify} messages. + * Encodes the specified ListAssetsResponse message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.ListAssetsResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.securitycenter.v1beta1.Finding + * @memberof google.cloud.securitycenter.v1beta1.ListAssetsResponse * @static - * @param {google.cloud.securitycenter.v1beta1.IFinding} message Finding message or plain object to encode + * @param {google.cloud.securitycenter.v1beta1.IListAssetsResponse} message ListAssetsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Finding.encode = function encode(message, writer) { + ListAssetsResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.parent != null && message.hasOwnProperty("parent")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.parent); - if (message.resourceName != null && message.hasOwnProperty("resourceName")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.resourceName); - if (message.state != null && message.hasOwnProperty("state")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.state); - if (message.category != null && message.hasOwnProperty("category")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.category); - if (message.externalUri != null && message.hasOwnProperty("externalUri")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.externalUri); - if (message.sourceProperties != null && message.hasOwnProperty("sourceProperties")) - for (var keys = Object.keys(message.sourceProperties), i = 0; i < keys.length; ++i) { - writer.uint32(/* id 7, wireType 2 =*/58).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); - $root.google.protobuf.Value.encode(message.sourceProperties[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); - } - if (message.securityMarks != null && message.hasOwnProperty("securityMarks")) - $root.google.cloud.securitycenter.v1beta1.SecurityMarks.encode(message.securityMarks, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.eventTime != null && message.hasOwnProperty("eventTime")) - $root.google.protobuf.Timestamp.encode(message.eventTime, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.createTime != null && message.hasOwnProperty("createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.listAssetsResults != null && message.listAssetsResults.length) + for (var i = 0; i < message.listAssetsResults.length; ++i) + $root.google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult.encode(message.listAssetsResults[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.readTime != null && message.hasOwnProperty("readTime")) + $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.nextPageToken); + if (message.totalSize != null && message.hasOwnProperty("totalSize")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.totalSize); return writer; }; /** - * Encodes the specified Finding message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.Finding.verify|verify} messages. + * Encodes the specified ListAssetsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.ListAssetsResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1beta1.Finding + * @memberof google.cloud.securitycenter.v1beta1.ListAssetsResponse * @static - * @param {google.cloud.securitycenter.v1beta1.IFinding} message Finding message or plain object to encode + * @param {google.cloud.securitycenter.v1beta1.IListAssetsResponse} message ListAssetsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Finding.encodeDelimited = function encodeDelimited(message, writer) { + ListAssetsResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a Finding message from the specified reader or buffer. + * Decodes a ListAssetsResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.securitycenter.v1beta1.Finding + * @memberof google.cloud.securitycenter.v1beta1.ListAssetsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1beta1.Finding} Finding + * @returns {google.cloud.securitycenter.v1beta1.ListAssetsResponse} ListAssetsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Finding.decode = function decode(reader, length) { + ListAssetsResponse.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.cloud.securitycenter.v1beta1.Finding(), key; + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1beta1.ListAssetsResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.name = reader.string(); + if (!(message.listAssetsResults && message.listAssetsResults.length)) + message.listAssetsResults = []; + message.listAssetsResults.push($root.google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult.decode(reader, reader.uint32())); break; case 2: - message.parent = reader.string(); + message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; case 3: - message.resourceName = reader.string(); + message.nextPageToken = reader.string(); break; case 4: - message.state = reader.int32(); - break; - case 5: - message.category = reader.string(); - break; - case 6: - message.externalUri = reader.string(); - break; - case 7: - reader.skip().pos++; - if (message.sourceProperties === $util.emptyObject) - message.sourceProperties = {}; - key = reader.string(); - reader.pos++; - message.sourceProperties[key] = $root.google.protobuf.Value.decode(reader, reader.uint32()); - break; - case 8: - message.securityMarks = $root.google.cloud.securitycenter.v1beta1.SecurityMarks.decode(reader, reader.uint32()); - break; - case 9: - message.eventTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 10: - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + message.totalSize = reader.int32(); break; default: reader.skipType(tag & 7); @@ -16440,748 +15665,2133 @@ }; /** - * Decodes a Finding message from the specified reader or buffer, length delimited. + * Decodes a ListAssetsResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1beta1.Finding + * @memberof google.cloud.securitycenter.v1beta1.ListAssetsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1beta1.Finding} Finding + * @returns {google.cloud.securitycenter.v1beta1.ListAssetsResponse} ListAssetsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Finding.decodeDelimited = function decodeDelimited(reader) { + ListAssetsResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a Finding message. + * Verifies a ListAssetsResponse message. * @function verify - * @memberof google.cloud.securitycenter.v1beta1.Finding + * @memberof google.cloud.securitycenter.v1beta1.ListAssetsResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Finding.verify = function verify(message) { + ListAssetsResponse.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.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.resourceName != null && message.hasOwnProperty("resourceName")) - if (!$util.isString(message.resourceName)) - return "resourceName: string expected"; - if (message.state != null && message.hasOwnProperty("state")) - switch (message.state) { - default: - return "state: 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"; - if (message.externalUri != null && message.hasOwnProperty("externalUri")) - if (!$util.isString(message.externalUri)) - return "externalUri: string expected"; - if (message.sourceProperties != null && message.hasOwnProperty("sourceProperties")) { - if (!$util.isObject(message.sourceProperties)) - return "sourceProperties: object expected"; - var key = Object.keys(message.sourceProperties); - for (var i = 0; i < key.length; ++i) { - var error = $root.google.protobuf.Value.verify(message.sourceProperties[key[i]]); + if (message.listAssetsResults != null && message.hasOwnProperty("listAssetsResults")) { + if (!Array.isArray(message.listAssetsResults)) + return "listAssetsResults: array expected"; + for (var i = 0; i < message.listAssetsResults.length; ++i) { + var error = $root.google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult.verify(message.listAssetsResults[i]); if (error) - return "sourceProperties." + error; + return "listAssetsResults." + error; } } - if (message.securityMarks != null && message.hasOwnProperty("securityMarks")) { - var error = $root.google.cloud.securitycenter.v1beta1.SecurityMarks.verify(message.securityMarks); - if (error) - return "securityMarks." + error; - } - if (message.eventTime != null && message.hasOwnProperty("eventTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.eventTime); - if (error) - return "eventTime." + error; - } - if (message.createTime != null && message.hasOwnProperty("createTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (message.readTime != null && message.hasOwnProperty("readTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.readTime); if (error) - return "createTime." + error; + return "readTime." + error; } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.totalSize != null && message.hasOwnProperty("totalSize")) + if (!$util.isInteger(message.totalSize)) + return "totalSize: integer expected"; return null; }; /** - * Creates a Finding message from a plain object. Also converts values to their respective internal types. + * Creates a ListAssetsResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.securitycenter.v1beta1.Finding + * @memberof google.cloud.securitycenter.v1beta1.ListAssetsResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1beta1.Finding} Finding + * @returns {google.cloud.securitycenter.v1beta1.ListAssetsResponse} ListAssetsResponse */ - Finding.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1beta1.Finding) + ListAssetsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1beta1.ListAssetsResponse) return object; - var message = new $root.google.cloud.securitycenter.v1beta1.Finding(); - if (object.name != null) - message.name = String(object.name); - if (object.parent != null) - message.parent = String(object.parent); - if (object.resourceName != null) - message.resourceName = String(object.resourceName); - switch (object.state) { - case "STATE_UNSPECIFIED": - case 0: - message.state = 0; - break; - case "ACTIVE": - case 1: - message.state = 1; - break; - case "INACTIVE": - case 2: - message.state = 2; - break; - } - if (object.category != null) - message.category = String(object.category); - if (object.externalUri != null) - message.externalUri = String(object.externalUri); - if (object.sourceProperties) { - if (typeof object.sourceProperties !== "object") - throw TypeError(".google.cloud.securitycenter.v1beta1.Finding.sourceProperties: object expected"); - message.sourceProperties = {}; - for (var keys = Object.keys(object.sourceProperties), i = 0; i < keys.length; ++i) { - if (typeof object.sourceProperties[keys[i]] !== "object") - throw TypeError(".google.cloud.securitycenter.v1beta1.Finding.sourceProperties: object expected"); - message.sourceProperties[keys[i]] = $root.google.protobuf.Value.fromObject(object.sourceProperties[keys[i]]); + var message = new $root.google.cloud.securitycenter.v1beta1.ListAssetsResponse(); + if (object.listAssetsResults) { + if (!Array.isArray(object.listAssetsResults)) + throw TypeError(".google.cloud.securitycenter.v1beta1.ListAssetsResponse.listAssetsResults: array expected"); + message.listAssetsResults = []; + for (var i = 0; i < object.listAssetsResults.length; ++i) { + if (typeof object.listAssetsResults[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v1beta1.ListAssetsResponse.listAssetsResults: object expected"); + message.listAssetsResults[i] = $root.google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult.fromObject(object.listAssetsResults[i]); } } - if (object.securityMarks != null) { - if (typeof object.securityMarks !== "object") - throw TypeError(".google.cloud.securitycenter.v1beta1.Finding.securityMarks: object expected"); - message.securityMarks = $root.google.cloud.securitycenter.v1beta1.SecurityMarks.fromObject(object.securityMarks); - } - if (object.eventTime != null) { - if (typeof object.eventTime !== "object") - throw TypeError(".google.cloud.securitycenter.v1beta1.Finding.eventTime: object expected"); - message.eventTime = $root.google.protobuf.Timestamp.fromObject(object.eventTime); - } - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.securitycenter.v1beta1.Finding.createTime: object expected"); - message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + if (object.readTime != null) { + if (typeof object.readTime !== "object") + throw TypeError(".google.cloud.securitycenter.v1beta1.ListAssetsResponse.readTime: object expected"); + message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.totalSize != null) + message.totalSize = object.totalSize | 0; return message; }; /** - * Creates a plain object from a Finding message. Also converts values to other types if specified. + * Creates a plain object from a ListAssetsResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.securitycenter.v1beta1.Finding + * @memberof google.cloud.securitycenter.v1beta1.ListAssetsResponse * @static - * @param {google.cloud.securitycenter.v1beta1.Finding} message Finding + * @param {google.cloud.securitycenter.v1beta1.ListAssetsResponse} message ListAssetsResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Finding.toObject = function toObject(message, options) { + ListAssetsResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.objects || options.defaults) - object.sourceProperties = {}; + if (options.arrays || options.defaults) + object.listAssetsResults = []; if (options.defaults) { - object.name = ""; - object.parent = ""; - object.resourceName = ""; - object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; - object.category = ""; - object.externalUri = ""; - object.securityMarks = null; - object.eventTime = null; - object.createTime = null; + object.readTime = null; + object.nextPageToken = ""; + object.totalSize = 0; } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.resourceName != null && message.hasOwnProperty("resourceName")) - object.resourceName = message.resourceName; - if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.securitycenter.v1beta1.Finding.State[message.state] : message.state; - if (message.category != null && message.hasOwnProperty("category")) - object.category = message.category; - if (message.externalUri != null && message.hasOwnProperty("externalUri")) - object.externalUri = message.externalUri; - var keys2; - if (message.sourceProperties && (keys2 = Object.keys(message.sourceProperties)).length) { - object.sourceProperties = {}; - for (var j = 0; j < keys2.length; ++j) - object.sourceProperties[keys2[j]] = $root.google.protobuf.Value.toObject(message.sourceProperties[keys2[j]], options); + if (message.listAssetsResults && message.listAssetsResults.length) { + object.listAssetsResults = []; + for (var j = 0; j < message.listAssetsResults.length; ++j) + object.listAssetsResults[j] = $root.google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult.toObject(message.listAssetsResults[j], options); } - if (message.securityMarks != null && message.hasOwnProperty("securityMarks")) - object.securityMarks = $root.google.cloud.securitycenter.v1beta1.SecurityMarks.toObject(message.securityMarks, options); - if (message.eventTime != null && message.hasOwnProperty("eventTime")) - object.eventTime = $root.google.protobuf.Timestamp.toObject(message.eventTime, options); - if (message.createTime != null && message.hasOwnProperty("createTime")) - object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.readTime != null && message.hasOwnProperty("readTime")) + object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.totalSize != null && message.hasOwnProperty("totalSize")) + object.totalSize = message.totalSize; return object; }; /** - * Converts this Finding to JSON. + * Converts this ListAssetsResponse to JSON. * @function toJSON - * @memberof google.cloud.securitycenter.v1beta1.Finding + * @memberof google.cloud.securitycenter.v1beta1.ListAssetsResponse * @instance * @returns {Object.} JSON object */ - Finding.prototype.toJSON = function toJSON() { + ListAssetsResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - /** - * State enum. - * @name google.cloud.securitycenter.v1beta1.Finding.State - * @enum {string} - * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value - * @property {number} ACTIVE=1 ACTIVE value - * @property {number} INACTIVE=2 INACTIVE value - */ - Finding.State = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; - values[valuesById[1] = "ACTIVE"] = 1; - values[valuesById[2] = "INACTIVE"] = 2; - return values; - })(); + ListAssetsResponse.ListAssetsResult = (function() { - return Finding; - })(); + /** + * Properties of a ListAssetsResult. + * @memberof google.cloud.securitycenter.v1beta1.ListAssetsResponse + * @interface IListAssetsResult + * @property {google.cloud.securitycenter.v1beta1.IAsset|null} [asset] ListAssetsResult asset + * @property {google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult.State|null} [state] ListAssetsResult state + */ - v1beta1.OrganizationSettings = (function() { + /** + * Constructs a new ListAssetsResult. + * @memberof google.cloud.securitycenter.v1beta1.ListAssetsResponse + * @classdesc Represents a ListAssetsResult. + * @implements IListAssetsResult + * @constructor + * @param {google.cloud.securitycenter.v1beta1.ListAssetsResponse.IListAssetsResult=} [properties] Properties to set + */ + function ListAssetsResult(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]]; + } - /** - * Properties of an OrganizationSettings. - * @memberof google.cloud.securitycenter.v1beta1 - * @interface IOrganizationSettings - * @property {string|null} [name] OrganizationSettings name - * @property {boolean|null} [enableAssetDiscovery] OrganizationSettings enableAssetDiscovery - * @property {google.cloud.securitycenter.v1beta1.OrganizationSettings.IAssetDiscoveryConfig|null} [assetDiscoveryConfig] OrganizationSettings assetDiscoveryConfig - */ + /** + * ListAssetsResult asset. + * @member {google.cloud.securitycenter.v1beta1.IAsset|null|undefined} asset + * @memberof google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult + * @instance + */ + ListAssetsResult.prototype.asset = null; - /** - * Constructs a new OrganizationSettings. - * @memberof google.cloud.securitycenter.v1beta1 - * @classdesc Represents an OrganizationSettings. - * @implements IOrganizationSettings - * @constructor - * @param {google.cloud.securitycenter.v1beta1.IOrganizationSettings=} [properties] Properties to set - */ - function OrganizationSettings(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]]; - } + /** + * ListAssetsResult state. + * @member {google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult.State} state + * @memberof google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult + * @instance + */ + ListAssetsResult.prototype.state = 0; - /** - * OrganizationSettings name. - * @member {string} name - * @memberof google.cloud.securitycenter.v1beta1.OrganizationSettings - * @instance - */ - OrganizationSettings.prototype.name = ""; + /** + * Creates a new ListAssetsResult instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult + * @static + * @param {google.cloud.securitycenter.v1beta1.ListAssetsResponse.IListAssetsResult=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult} ListAssetsResult instance + */ + ListAssetsResult.create = function create(properties) { + return new ListAssetsResult(properties); + }; - /** - * OrganizationSettings enableAssetDiscovery. - * @member {boolean} enableAssetDiscovery - * @memberof google.cloud.securitycenter.v1beta1.OrganizationSettings - * @instance - */ - OrganizationSettings.prototype.enableAssetDiscovery = false; + /** + * Encodes the specified ListAssetsResult message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult + * @static + * @param {google.cloud.securitycenter.v1beta1.ListAssetsResponse.IListAssetsResult} message ListAssetsResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAssetsResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.asset != null && message.hasOwnProperty("asset")) + $root.google.cloud.securitycenter.v1beta1.Asset.encode(message.asset, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.state != null && message.hasOwnProperty("state")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.state); + return writer; + }; - /** - * OrganizationSettings assetDiscoveryConfig. - * @member {google.cloud.securitycenter.v1beta1.OrganizationSettings.IAssetDiscoveryConfig|null|undefined} assetDiscoveryConfig - * @memberof google.cloud.securitycenter.v1beta1.OrganizationSettings - * @instance - */ - OrganizationSettings.prototype.assetDiscoveryConfig = null; + /** + * Encodes the specified ListAssetsResult message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult + * @static + * @param {google.cloud.securitycenter.v1beta1.ListAssetsResponse.IListAssetsResult} message ListAssetsResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAssetsResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Creates a new OrganizationSettings instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v1beta1.OrganizationSettings - * @static - * @param {google.cloud.securitycenter.v1beta1.IOrganizationSettings=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1beta1.OrganizationSettings} OrganizationSettings instance - */ - OrganizationSettings.create = function create(properties) { - return new OrganizationSettings(properties); - }; + /** + * Decodes a ListAssetsResult message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult} ListAssetsResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAssetsResult.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.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.asset = $root.google.cloud.securitycenter.v1beta1.Asset.decode(reader, reader.uint32()); + break; + case 2: + message.state = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Encodes the specified OrganizationSettings message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.OrganizationSettings.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1beta1.OrganizationSettings - * @static - * @param {google.cloud.securitycenter.v1beta1.IOrganizationSettings} message OrganizationSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OrganizationSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.enableAssetDiscovery != null && message.hasOwnProperty("enableAssetDiscovery")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.enableAssetDiscovery); - if (message.assetDiscoveryConfig != null && message.hasOwnProperty("assetDiscoveryConfig")) - $root.google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig.encode(message.assetDiscoveryConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; + /** + * Decodes a ListAssetsResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult} ListAssetsResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAssetsResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Encodes the specified OrganizationSettings message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.OrganizationSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1beta1.OrganizationSettings - * @static - * @param {google.cloud.securitycenter.v1beta1.IOrganizationSettings} message OrganizationSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OrganizationSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Verifies a ListAssetsResult message. + * @function verify + * @memberof google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListAssetsResult.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.asset != null && message.hasOwnProperty("asset")) { + var error = $root.google.cloud.securitycenter.v1beta1.Asset.verify(message.asset); + if (error) + return "asset." + error; + } + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + return null; + }; - /** - * Decodes an OrganizationSettings message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v1beta1.OrganizationSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1beta1.OrganizationSettings} OrganizationSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OrganizationSettings.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.cloud.securitycenter.v1beta1.OrganizationSettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { + /** + * Creates a ListAssetsResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult} ListAssetsResult + */ + ListAssetsResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult) + return object; + var message = new $root.google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult(); + if (object.asset != null) { + if (typeof object.asset !== "object") + throw TypeError(".google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult.asset: object expected"); + message.asset = $root.google.cloud.securitycenter.v1beta1.Asset.fromObject(object.asset); + } + switch (object.state) { + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "UNUSED": case 1: - message.name = reader.string(); + message.state = 1; break; + case "ADDED": case 2: - message.enableAssetDiscovery = reader.bool(); + message.state = 2; break; + case "REMOVED": case 3: - message.assetDiscoveryConfig = $root.google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig.decode(reader, reader.uint32()); + message.state = 3; break; - default: - reader.skipType(tag & 7); + case "ACTIVE": + case 4: + message.state = 4; break; } - } - return message; - }; + return message; + }; + + /** + * Creates a plain object from a ListAssetsResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult + * @static + * @param {google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult} message ListAssetsResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListAssetsResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.asset = null; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + } + if (message.asset != null && message.hasOwnProperty("asset")) + object.asset = $root.google.cloud.securitycenter.v1beta1.Asset.toObject(message.asset, options); + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult.State[message.state] : message.state; + return object; + }; + + /** + * Converts this ListAssetsResult to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult + * @instance + * @returns {Object.} JSON object + */ + ListAssetsResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * State enum. + * @name google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult.State + * @enum {string} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} UNUSED=1 UNUSED value + * @property {number} ADDED=2 ADDED value + * @property {number} REMOVED=3 REMOVED value + * @property {number} ACTIVE=4 ACTIVE value + */ + ListAssetsResult.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "UNUSED"] = 1; + values[valuesById[2] = "ADDED"] = 2; + values[valuesById[3] = "REMOVED"] = 3; + values[valuesById[4] = "ACTIVE"] = 4; + return values; + })(); + + return ListAssetsResult; + })(); + + return ListAssetsResponse; + })(); + + v1beta1.ListFindingsRequest = (function() { /** - * Decodes an OrganizationSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1beta1.OrganizationSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1beta1.OrganizationSettings} OrganizationSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Properties of a ListFindingsRequest. + * @memberof google.cloud.securitycenter.v1beta1 + * @interface IListFindingsRequest + * @property {string|null} [parent] ListFindingsRequest parent + * @property {string|null} [filter] ListFindingsRequest filter + * @property {string|null} [orderBy] ListFindingsRequest orderBy + * @property {google.protobuf.ITimestamp|null} [readTime] ListFindingsRequest readTime + * @property {google.protobuf.IFieldMask|null} [fieldMask] ListFindingsRequest fieldMask + * @property {string|null} [pageToken] ListFindingsRequest pageToken + * @property {number|null} [pageSize] ListFindingsRequest pageSize */ - OrganizationSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; /** - * Verifies an OrganizationSettings message. - * @function verify - * @memberof google.cloud.securitycenter.v1beta1.OrganizationSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not + * Constructs a new ListFindingsRequest. + * @memberof google.cloud.securitycenter.v1beta1 + * @classdesc Represents a ListFindingsRequest. + * @implements IListFindingsRequest + * @constructor + * @param {google.cloud.securitycenter.v1beta1.IListFindingsRequest=} [properties] Properties to set */ - OrganizationSettings.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.enableAssetDiscovery != null && message.hasOwnProperty("enableAssetDiscovery")) - if (typeof message.enableAssetDiscovery !== "boolean") - return "enableAssetDiscovery: boolean expected"; - if (message.assetDiscoveryConfig != null && message.hasOwnProperty("assetDiscoveryConfig")) { - var error = $root.google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig.verify(message.assetDiscoveryConfig); - if (error) - return "assetDiscoveryConfig." + error; - } - return null; - }; + function ListFindingsRequest(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]]; + } /** - * Creates an OrganizationSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v1beta1.OrganizationSettings - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1beta1.OrganizationSettings} OrganizationSettings + * ListFindingsRequest parent. + * @member {string} parent + * @memberof google.cloud.securitycenter.v1beta1.ListFindingsRequest + * @instance */ - OrganizationSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1beta1.OrganizationSettings) - return object; - var message = new $root.google.cloud.securitycenter.v1beta1.OrganizationSettings(); - if (object.name != null) - message.name = String(object.name); - if (object.enableAssetDiscovery != null) - message.enableAssetDiscovery = Boolean(object.enableAssetDiscovery); - if (object.assetDiscoveryConfig != null) { - if (typeof object.assetDiscoveryConfig !== "object") - throw TypeError(".google.cloud.securitycenter.v1beta1.OrganizationSettings.assetDiscoveryConfig: object expected"); - message.assetDiscoveryConfig = $root.google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig.fromObject(object.assetDiscoveryConfig); - } - return message; - }; + ListFindingsRequest.prototype.parent = ""; /** - * Creates a plain object from an OrganizationSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v1beta1.OrganizationSettings - * @static - * @param {google.cloud.securitycenter.v1beta1.OrganizationSettings} message OrganizationSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object + * ListFindingsRequest filter. + * @member {string} filter + * @memberof google.cloud.securitycenter.v1beta1.ListFindingsRequest + * @instance */ - OrganizationSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.enableAssetDiscovery = false; - object.assetDiscoveryConfig = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.enableAssetDiscovery != null && message.hasOwnProperty("enableAssetDiscovery")) - object.enableAssetDiscovery = message.enableAssetDiscovery; - if (message.assetDiscoveryConfig != null && message.hasOwnProperty("assetDiscoveryConfig")) - object.assetDiscoveryConfig = $root.google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig.toObject(message.assetDiscoveryConfig, options); - return object; - }; + ListFindingsRequest.prototype.filter = ""; /** - * Converts this OrganizationSettings to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1beta1.OrganizationSettings + * ListFindingsRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.securitycenter.v1beta1.ListFindingsRequest * @instance - * @returns {Object.} JSON object */ - OrganizationSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - OrganizationSettings.AssetDiscoveryConfig = (function() { + ListFindingsRequest.prototype.orderBy = ""; - /** - * Properties of an AssetDiscoveryConfig. - * @memberof google.cloud.securitycenter.v1beta1.OrganizationSettings - * @interface IAssetDiscoveryConfig - * @property {Array.|null} [projectIds] AssetDiscoveryConfig projectIds - * @property {google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode|null} [inclusionMode] AssetDiscoveryConfig inclusionMode - */ + /** + * ListFindingsRequest readTime. + * @member {google.protobuf.ITimestamp|null|undefined} readTime + * @memberof google.cloud.securitycenter.v1beta1.ListFindingsRequest + * @instance + */ + ListFindingsRequest.prototype.readTime = null; - /** - * Constructs a new AssetDiscoveryConfig. - * @memberof google.cloud.securitycenter.v1beta1.OrganizationSettings - * @classdesc Represents an AssetDiscoveryConfig. - * @implements IAssetDiscoveryConfig - * @constructor - * @param {google.cloud.securitycenter.v1beta1.OrganizationSettings.IAssetDiscoveryConfig=} [properties] Properties to set - */ - function AssetDiscoveryConfig(properties) { - this.projectIds = []; - 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]]; - } + /** + * ListFindingsRequest fieldMask. + * @member {google.protobuf.IFieldMask|null|undefined} fieldMask + * @memberof google.cloud.securitycenter.v1beta1.ListFindingsRequest + * @instance + */ + ListFindingsRequest.prototype.fieldMask = null; - /** - * AssetDiscoveryConfig projectIds. - * @member {Array.} projectIds - * @memberof google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig - * @instance - */ - AssetDiscoveryConfig.prototype.projectIds = $util.emptyArray; + /** + * ListFindingsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.securitycenter.v1beta1.ListFindingsRequest + * @instance + */ + ListFindingsRequest.prototype.pageToken = ""; - /** - * AssetDiscoveryConfig inclusionMode. - * @member {google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode} inclusionMode - * @memberof google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig - * @instance - */ - AssetDiscoveryConfig.prototype.inclusionMode = 0; + /** + * ListFindingsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.securitycenter.v1beta1.ListFindingsRequest + * @instance + */ + ListFindingsRequest.prototype.pageSize = 0; - /** - * Creates a new AssetDiscoveryConfig instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig - * @static - * @param {google.cloud.securitycenter.v1beta1.OrganizationSettings.IAssetDiscoveryConfig=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig} AssetDiscoveryConfig instance - */ - AssetDiscoveryConfig.create = function create(properties) { - return new AssetDiscoveryConfig(properties); - }; + /** + * Creates a new ListFindingsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1beta1.ListFindingsRequest + * @static + * @param {google.cloud.securitycenter.v1beta1.IListFindingsRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1beta1.ListFindingsRequest} ListFindingsRequest instance + */ + ListFindingsRequest.create = function create(properties) { + return new ListFindingsRequest(properties); + }; - /** - * Encodes the specified AssetDiscoveryConfig message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig - * @static - * @param {google.cloud.securitycenter.v1beta1.OrganizationSettings.IAssetDiscoveryConfig} message AssetDiscoveryConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AssetDiscoveryConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.projectIds != null && message.projectIds.length) - for (var i = 0; i < message.projectIds.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectIds[i]); - if (message.inclusionMode != null && message.hasOwnProperty("inclusionMode")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.inclusionMode); - return writer; - }; + /** + * Encodes the specified ListFindingsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.ListFindingsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1beta1.ListFindingsRequest + * @static + * @param {google.cloud.securitycenter.v1beta1.IListFindingsRequest} message ListFindingsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListFindingsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && message.hasOwnProperty("parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.filter != null && message.hasOwnProperty("filter")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.orderBy); + if (message.readTime != null && message.hasOwnProperty("readTime")) + $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.fieldMask != null && message.hasOwnProperty("fieldMask")) + $root.google.protobuf.FieldMask.encode(message.fieldMask, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.pageToken); + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.pageSize); + return writer; + }; - /** - * Encodes the specified AssetDiscoveryConfig message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig - * @static - * @param {google.cloud.securitycenter.v1beta1.OrganizationSettings.IAssetDiscoveryConfig} message AssetDiscoveryConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AssetDiscoveryConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Encodes the specified ListFindingsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.ListFindingsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1beta1.ListFindingsRequest + * @static + * @param {google.cloud.securitycenter.v1beta1.IListFindingsRequest} message ListFindingsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListFindingsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Decodes an AssetDiscoveryConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig} AssetDiscoveryConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AssetDiscoveryConfig.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.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.projectIds && message.projectIds.length)) - message.projectIds = []; - message.projectIds.push(reader.string()); - break; - case 2: - message.inclusionMode = reader.int32(); - break; - default: - reader.skipType(tag & 7); - break; - } + /** + * Decodes a ListFindingsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1beta1.ListFindingsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1beta1.ListFindingsRequest} ListFindingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListFindingsRequest.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.cloud.securitycenter.v1beta1.ListFindingsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.filter = reader.string(); + break; + case 3: + message.orderBy = reader.string(); + break; + case 4: + message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 5: + message.fieldMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + case 6: + message.pageToken = reader.string(); + break; + case 7: + message.pageSize = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; } - return message; - }; + } + return message; + }; - /** - * Decodes an AssetDiscoveryConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig} AssetDiscoveryConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AssetDiscoveryConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Decodes a ListFindingsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1beta1.ListFindingsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1beta1.ListFindingsRequest} ListFindingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListFindingsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Verifies an AssetDiscoveryConfig message. - * @function verify - * @memberof google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AssetDiscoveryConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.projectIds != null && message.hasOwnProperty("projectIds")) { - if (!Array.isArray(message.projectIds)) - return "projectIds: array expected"; - for (var i = 0; i < message.projectIds.length; ++i) - if (!$util.isString(message.projectIds[i])) - return "projectIds: string[] expected"; + /** + * Verifies a ListFindingsRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1beta1.ListFindingsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListFindingsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + if (message.readTime != null && message.hasOwnProperty("readTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.readTime); + if (error) + return "readTime." + error; + } + if (message.fieldMask != null && message.hasOwnProperty("fieldMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.fieldMask); + if (error) + return "fieldMask." + error; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + return null; + }; + + /** + * Creates a ListFindingsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1beta1.ListFindingsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1beta1.ListFindingsRequest} ListFindingsRequest + */ + ListFindingsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1beta1.ListFindingsRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1beta1.ListFindingsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.filter != null) + message.filter = String(object.filter); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.readTime != null) { + if (typeof object.readTime !== "object") + throw TypeError(".google.cloud.securitycenter.v1beta1.ListFindingsRequest.readTime: object expected"); + message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); + } + if (object.fieldMask != null) { + if (typeof object.fieldMask !== "object") + throw TypeError(".google.cloud.securitycenter.v1beta1.ListFindingsRequest.fieldMask: object expected"); + message.fieldMask = $root.google.protobuf.FieldMask.fromObject(object.fieldMask); + } + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + return message; + }; + + /** + * Creates a plain object from a ListFindingsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1beta1.ListFindingsRequest + * @static + * @param {google.cloud.securitycenter.v1beta1.ListFindingsRequest} message ListFindingsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListFindingsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.filter = ""; + object.orderBy = ""; + object.readTime = null; + object.fieldMask = null; + object.pageToken = ""; + object.pageSize = 0; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; + if (message.readTime != null && message.hasOwnProperty("readTime")) + object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); + if (message.fieldMask != null && message.hasOwnProperty("fieldMask")) + object.fieldMask = $root.google.protobuf.FieldMask.toObject(message.fieldMask, options); + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + return object; + }; + + /** + * Converts this ListFindingsRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1beta1.ListFindingsRequest + * @instance + * @returns {Object.} JSON object + */ + ListFindingsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListFindingsRequest; + })(); + + v1beta1.ListFindingsResponse = (function() { + + /** + * Properties of a ListFindingsResponse. + * @memberof google.cloud.securitycenter.v1beta1 + * @interface IListFindingsResponse + * @property {Array.|null} [findings] ListFindingsResponse findings + * @property {google.protobuf.ITimestamp|null} [readTime] ListFindingsResponse readTime + * @property {string|null} [nextPageToken] ListFindingsResponse nextPageToken + * @property {number|null} [totalSize] ListFindingsResponse totalSize + */ + + /** + * Constructs a new ListFindingsResponse. + * @memberof google.cloud.securitycenter.v1beta1 + * @classdesc Represents a ListFindingsResponse. + * @implements IListFindingsResponse + * @constructor + * @param {google.cloud.securitycenter.v1beta1.IListFindingsResponse=} [properties] Properties to set + */ + function ListFindingsResponse(properties) { + this.findings = []; + 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]]; + } + + /** + * ListFindingsResponse findings. + * @member {Array.} findings + * @memberof google.cloud.securitycenter.v1beta1.ListFindingsResponse + * @instance + */ + ListFindingsResponse.prototype.findings = $util.emptyArray; + + /** + * ListFindingsResponse readTime. + * @member {google.protobuf.ITimestamp|null|undefined} readTime + * @memberof google.cloud.securitycenter.v1beta1.ListFindingsResponse + * @instance + */ + ListFindingsResponse.prototype.readTime = null; + + /** + * ListFindingsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.securitycenter.v1beta1.ListFindingsResponse + * @instance + */ + ListFindingsResponse.prototype.nextPageToken = ""; + + /** + * ListFindingsResponse totalSize. + * @member {number} totalSize + * @memberof google.cloud.securitycenter.v1beta1.ListFindingsResponse + * @instance + */ + ListFindingsResponse.prototype.totalSize = 0; + + /** + * Creates a new ListFindingsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1beta1.ListFindingsResponse + * @static + * @param {google.cloud.securitycenter.v1beta1.IListFindingsResponse=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1beta1.ListFindingsResponse} ListFindingsResponse instance + */ + ListFindingsResponse.create = function create(properties) { + return new ListFindingsResponse(properties); + }; + + /** + * Encodes the specified ListFindingsResponse message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.ListFindingsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1beta1.ListFindingsResponse + * @static + * @param {google.cloud.securitycenter.v1beta1.IListFindingsResponse} message ListFindingsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListFindingsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.findings != null && message.findings.length) + for (var i = 0; i < message.findings.length; ++i) + $root.google.cloud.securitycenter.v1beta1.Finding.encode(message.findings[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.readTime != null && message.hasOwnProperty("readTime")) + $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.nextPageToken); + if (message.totalSize != null && message.hasOwnProperty("totalSize")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.totalSize); + return writer; + }; + + /** + * Encodes the specified ListFindingsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.ListFindingsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1beta1.ListFindingsResponse + * @static + * @param {google.cloud.securitycenter.v1beta1.IListFindingsResponse} message ListFindingsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListFindingsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListFindingsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1beta1.ListFindingsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1beta1.ListFindingsResponse} ListFindingsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListFindingsResponse.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.cloud.securitycenter.v1beta1.ListFindingsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.findings && message.findings.length)) + message.findings = []; + message.findings.push($root.google.cloud.securitycenter.v1beta1.Finding.decode(reader, reader.uint32())); + break; + case 2: + message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 3: + message.nextPageToken = reader.string(); + break; + case 4: + message.totalSize = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListFindingsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1beta1.ListFindingsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1beta1.ListFindingsResponse} ListFindingsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListFindingsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListFindingsResponse message. + * @function verify + * @memberof google.cloud.securitycenter.v1beta1.ListFindingsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListFindingsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.findings != null && message.hasOwnProperty("findings")) { + if (!Array.isArray(message.findings)) + return "findings: array expected"; + for (var i = 0; i < message.findings.length; ++i) { + var error = $root.google.cloud.securitycenter.v1beta1.Finding.verify(message.findings[i]); + if (error) + return "findings." + error; + } + } + if (message.readTime != null && message.hasOwnProperty("readTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.readTime); + if (error) + return "readTime." + error; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.totalSize != null && message.hasOwnProperty("totalSize")) + if (!$util.isInteger(message.totalSize)) + return "totalSize: integer expected"; + return null; + }; + + /** + * Creates a ListFindingsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1beta1.ListFindingsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1beta1.ListFindingsResponse} ListFindingsResponse + */ + ListFindingsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1beta1.ListFindingsResponse) + return object; + var message = new $root.google.cloud.securitycenter.v1beta1.ListFindingsResponse(); + if (object.findings) { + if (!Array.isArray(object.findings)) + throw TypeError(".google.cloud.securitycenter.v1beta1.ListFindingsResponse.findings: array expected"); + message.findings = []; + for (var i = 0; i < object.findings.length; ++i) { + if (typeof object.findings[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v1beta1.ListFindingsResponse.findings: object expected"); + message.findings[i] = $root.google.cloud.securitycenter.v1beta1.Finding.fromObject(object.findings[i]); + } + } + if (object.readTime != null) { + if (typeof object.readTime !== "object") + throw TypeError(".google.cloud.securitycenter.v1beta1.ListFindingsResponse.readTime: object expected"); + message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.totalSize != null) + message.totalSize = object.totalSize | 0; + return message; + }; + + /** + * Creates a plain object from a ListFindingsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1beta1.ListFindingsResponse + * @static + * @param {google.cloud.securitycenter.v1beta1.ListFindingsResponse} message ListFindingsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListFindingsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.findings = []; + if (options.defaults) { + object.readTime = null; + object.nextPageToken = ""; + object.totalSize = 0; + } + if (message.findings && message.findings.length) { + object.findings = []; + for (var j = 0; j < message.findings.length; ++j) + object.findings[j] = $root.google.cloud.securitycenter.v1beta1.Finding.toObject(message.findings[j], options); + } + if (message.readTime != null && message.hasOwnProperty("readTime")) + object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.totalSize != null && message.hasOwnProperty("totalSize")) + object.totalSize = message.totalSize; + return object; + }; + + /** + * Converts this ListFindingsResponse to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1beta1.ListFindingsResponse + * @instance + * @returns {Object.} JSON object + */ + ListFindingsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListFindingsResponse; + })(); + + v1beta1.SetFindingStateRequest = (function() { + + /** + * Properties of a SetFindingStateRequest. + * @memberof google.cloud.securitycenter.v1beta1 + * @interface ISetFindingStateRequest + * @property {string|null} [name] SetFindingStateRequest name + * @property {google.cloud.securitycenter.v1beta1.Finding.State|null} [state] SetFindingStateRequest state + * @property {google.protobuf.ITimestamp|null} [startTime] SetFindingStateRequest startTime + */ + + /** + * Constructs a new SetFindingStateRequest. + * @memberof google.cloud.securitycenter.v1beta1 + * @classdesc Represents a SetFindingStateRequest. + * @implements ISetFindingStateRequest + * @constructor + * @param {google.cloud.securitycenter.v1beta1.ISetFindingStateRequest=} [properties] Properties to set + */ + function SetFindingStateRequest(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]]; + } + + /** + * SetFindingStateRequest name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1beta1.SetFindingStateRequest + * @instance + */ + SetFindingStateRequest.prototype.name = ""; + + /** + * SetFindingStateRequest state. + * @member {google.cloud.securitycenter.v1beta1.Finding.State} state + * @memberof google.cloud.securitycenter.v1beta1.SetFindingStateRequest + * @instance + */ + SetFindingStateRequest.prototype.state = 0; + + /** + * SetFindingStateRequest startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.cloud.securitycenter.v1beta1.SetFindingStateRequest + * @instance + */ + SetFindingStateRequest.prototype.startTime = null; + + /** + * Creates a new SetFindingStateRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1beta1.SetFindingStateRequest + * @static + * @param {google.cloud.securitycenter.v1beta1.ISetFindingStateRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1beta1.SetFindingStateRequest} SetFindingStateRequest instance + */ + SetFindingStateRequest.create = function create(properties) { + return new SetFindingStateRequest(properties); + }; + + /** + * Encodes the specified SetFindingStateRequest message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.SetFindingStateRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1beta1.SetFindingStateRequest + * @static + * @param {google.cloud.securitycenter.v1beta1.ISetFindingStateRequest} message SetFindingStateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetFindingStateRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.state != null && message.hasOwnProperty("state")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.state); + if (message.startTime != null && message.hasOwnProperty("startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SetFindingStateRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.SetFindingStateRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1beta1.SetFindingStateRequest + * @static + * @param {google.cloud.securitycenter.v1beta1.ISetFindingStateRequest} message SetFindingStateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetFindingStateRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SetFindingStateRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1beta1.SetFindingStateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1beta1.SetFindingStateRequest} SetFindingStateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetFindingStateRequest.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.cloud.securitycenter.v1beta1.SetFindingStateRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.state = reader.int32(); + break; + case 3: + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SetFindingStateRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1beta1.SetFindingStateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1beta1.SetFindingStateRequest} SetFindingStateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetFindingStateRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SetFindingStateRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1beta1.SetFindingStateRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SetFindingStateRequest.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.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.startTime != null && message.hasOwnProperty("startTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.startTime); + if (error) + return "startTime." + error; + } + return null; + }; + + /** + * Creates a SetFindingStateRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1beta1.SetFindingStateRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1beta1.SetFindingStateRequest} SetFindingStateRequest + */ + SetFindingStateRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1beta1.SetFindingStateRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1beta1.SetFindingStateRequest(); + if (object.name != null) + message.name = String(object.name); + switch (object.state) { + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "ACTIVE": + case 1: + message.state = 1; + break; + case "INACTIVE": + case 2: + message.state = 2; + break; + } + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.cloud.securitycenter.v1beta1.SetFindingStateRequest.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); + } + return message; + }; + + /** + * Creates a plain object from a SetFindingStateRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1beta1.SetFindingStateRequest + * @static + * @param {google.cloud.securitycenter.v1beta1.SetFindingStateRequest} message SetFindingStateRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SetFindingStateRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.startTime = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.securitycenter.v1beta1.Finding.State[message.state] : message.state; + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); + return object; + }; + + /** + * Converts this SetFindingStateRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1beta1.SetFindingStateRequest + * @instance + * @returns {Object.} JSON object + */ + SetFindingStateRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SetFindingStateRequest; + })(); + + v1beta1.RunAssetDiscoveryRequest = (function() { + + /** + * Properties of a RunAssetDiscoveryRequest. + * @memberof google.cloud.securitycenter.v1beta1 + * @interface IRunAssetDiscoveryRequest + * @property {string|null} [parent] RunAssetDiscoveryRequest parent + */ + + /** + * Constructs a new RunAssetDiscoveryRequest. + * @memberof google.cloud.securitycenter.v1beta1 + * @classdesc Represents a RunAssetDiscoveryRequest. + * @implements IRunAssetDiscoveryRequest + * @constructor + * @param {google.cloud.securitycenter.v1beta1.IRunAssetDiscoveryRequest=} [properties] Properties to set + */ + function RunAssetDiscoveryRequest(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]]; + } + + /** + * RunAssetDiscoveryRequest parent. + * @member {string} parent + * @memberof google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest + * @instance + */ + RunAssetDiscoveryRequest.prototype.parent = ""; + + /** + * Creates a new RunAssetDiscoveryRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest + * @static + * @param {google.cloud.securitycenter.v1beta1.IRunAssetDiscoveryRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest} RunAssetDiscoveryRequest instance + */ + RunAssetDiscoveryRequest.create = function create(properties) { + return new RunAssetDiscoveryRequest(properties); + }; + + /** + * Encodes the specified RunAssetDiscoveryRequest message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest + * @static + * @param {google.cloud.securitycenter.v1beta1.IRunAssetDiscoveryRequest} message RunAssetDiscoveryRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RunAssetDiscoveryRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && message.hasOwnProperty("parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + return writer; + }; + + /** + * Encodes the specified RunAssetDiscoveryRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest + * @static + * @param {google.cloud.securitycenter.v1beta1.IRunAssetDiscoveryRequest} message RunAssetDiscoveryRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RunAssetDiscoveryRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RunAssetDiscoveryRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest} RunAssetDiscoveryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RunAssetDiscoveryRequest.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.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; } - if (message.inclusionMode != null && message.hasOwnProperty("inclusionMode")) - switch (message.inclusionMode) { - default: - return "inclusionMode: enum value expected"; - case 0: - case 1: - case 2: - break; - } - return null; - }; + } + return message; + }; + + /** + * Decodes a RunAssetDiscoveryRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest} RunAssetDiscoveryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RunAssetDiscoveryRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RunAssetDiscoveryRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RunAssetDiscoveryRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + return null; + }; + + /** + * Creates a RunAssetDiscoveryRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest} RunAssetDiscoveryRequest + */ + RunAssetDiscoveryRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest(); + if (object.parent != null) + message.parent = String(object.parent); + return message; + }; + + /** + * Creates a plain object from a RunAssetDiscoveryRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest + * @static + * @param {google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest} message RunAssetDiscoveryRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RunAssetDiscoveryRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.parent = ""; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + return object; + }; + + /** + * Converts this RunAssetDiscoveryRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest + * @instance + * @returns {Object.} JSON object + */ + RunAssetDiscoveryRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return RunAssetDiscoveryRequest; + })(); + + v1beta1.UpdateFindingRequest = (function() { + + /** + * Properties of an UpdateFindingRequest. + * @memberof google.cloud.securitycenter.v1beta1 + * @interface IUpdateFindingRequest + * @property {google.cloud.securitycenter.v1beta1.IFinding|null} [finding] UpdateFindingRequest finding + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateFindingRequest updateMask + */ + + /** + * Constructs a new UpdateFindingRequest. + * @memberof google.cloud.securitycenter.v1beta1 + * @classdesc Represents an UpdateFindingRequest. + * @implements IUpdateFindingRequest + * @constructor + * @param {google.cloud.securitycenter.v1beta1.IUpdateFindingRequest=} [properties] Properties to set + */ + function UpdateFindingRequest(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]]; + } + + /** + * UpdateFindingRequest finding. + * @member {google.cloud.securitycenter.v1beta1.IFinding|null|undefined} finding + * @memberof google.cloud.securitycenter.v1beta1.UpdateFindingRequest + * @instance + */ + UpdateFindingRequest.prototype.finding = null; + + /** + * UpdateFindingRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.securitycenter.v1beta1.UpdateFindingRequest + * @instance + */ + UpdateFindingRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateFindingRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1beta1.UpdateFindingRequest + * @static + * @param {google.cloud.securitycenter.v1beta1.IUpdateFindingRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1beta1.UpdateFindingRequest} UpdateFindingRequest instance + */ + UpdateFindingRequest.create = function create(properties) { + return new UpdateFindingRequest(properties); + }; + + /** + * Encodes the specified UpdateFindingRequest message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.UpdateFindingRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1beta1.UpdateFindingRequest + * @static + * @param {google.cloud.securitycenter.v1beta1.IUpdateFindingRequest} message UpdateFindingRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateFindingRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.finding != null && message.hasOwnProperty("finding")) + $root.google.cloud.securitycenter.v1beta1.Finding.encode(message.finding, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; - /** - * Creates an AssetDiscoveryConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig} AssetDiscoveryConfig - */ - AssetDiscoveryConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig) - return object; - var message = new $root.google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig(); - if (object.projectIds) { - if (!Array.isArray(object.projectIds)) - throw TypeError(".google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig.projectIds: array expected"); - message.projectIds = []; - for (var i = 0; i < object.projectIds.length; ++i) - message.projectIds[i] = String(object.projectIds[i]); - } - switch (object.inclusionMode) { - case "INCLUSION_MODE_UNSPECIFIED": - case 0: - message.inclusionMode = 0; + /** + * Encodes the specified UpdateFindingRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.UpdateFindingRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1beta1.UpdateFindingRequest + * @static + * @param {google.cloud.securitycenter.v1beta1.IUpdateFindingRequest} message UpdateFindingRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateFindingRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateFindingRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1beta1.UpdateFindingRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1beta1.UpdateFindingRequest} UpdateFindingRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateFindingRequest.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.cloud.securitycenter.v1beta1.UpdateFindingRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.finding = $root.google.cloud.securitycenter.v1beta1.Finding.decode(reader, reader.uint32()); break; - case "INCLUDE_ONLY": + case 2: + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateFindingRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1beta1.UpdateFindingRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1beta1.UpdateFindingRequest} UpdateFindingRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateFindingRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateFindingRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1beta1.UpdateFindingRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateFindingRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.finding != null && message.hasOwnProperty("finding")) { + var error = $root.google.cloud.securitycenter.v1beta1.Finding.verify(message.finding); + if (error) + return "finding." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + return null; + }; + + /** + * Creates an UpdateFindingRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1beta1.UpdateFindingRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1beta1.UpdateFindingRequest} UpdateFindingRequest + */ + UpdateFindingRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1beta1.UpdateFindingRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1beta1.UpdateFindingRequest(); + if (object.finding != null) { + if (typeof object.finding !== "object") + throw TypeError(".google.cloud.securitycenter.v1beta1.UpdateFindingRequest.finding: object expected"); + message.finding = $root.google.cloud.securitycenter.v1beta1.Finding.fromObject(object.finding); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.securitycenter.v1beta1.UpdateFindingRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateFindingRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1beta1.UpdateFindingRequest + * @static + * @param {google.cloud.securitycenter.v1beta1.UpdateFindingRequest} message UpdateFindingRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateFindingRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.finding = null; + object.updateMask = null; + } + if (message.finding != null && message.hasOwnProperty("finding")) + object.finding = $root.google.cloud.securitycenter.v1beta1.Finding.toObject(message.finding, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateFindingRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1beta1.UpdateFindingRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateFindingRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return UpdateFindingRequest; + })(); + + v1beta1.UpdateOrganizationSettingsRequest = (function() { + + /** + * Properties of an UpdateOrganizationSettingsRequest. + * @memberof google.cloud.securitycenter.v1beta1 + * @interface IUpdateOrganizationSettingsRequest + * @property {google.cloud.securitycenter.v1beta1.IOrganizationSettings|null} [organizationSettings] UpdateOrganizationSettingsRequest organizationSettings + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateOrganizationSettingsRequest updateMask + */ + + /** + * Constructs a new UpdateOrganizationSettingsRequest. + * @memberof google.cloud.securitycenter.v1beta1 + * @classdesc Represents an UpdateOrganizationSettingsRequest. + * @implements IUpdateOrganizationSettingsRequest + * @constructor + * @param {google.cloud.securitycenter.v1beta1.IUpdateOrganizationSettingsRequest=} [properties] Properties to set + */ + function UpdateOrganizationSettingsRequest(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]]; + } + + /** + * UpdateOrganizationSettingsRequest organizationSettings. + * @member {google.cloud.securitycenter.v1beta1.IOrganizationSettings|null|undefined} organizationSettings + * @memberof google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest + * @instance + */ + UpdateOrganizationSettingsRequest.prototype.organizationSettings = null; + + /** + * UpdateOrganizationSettingsRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest + * @instance + */ + UpdateOrganizationSettingsRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateOrganizationSettingsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest + * @static + * @param {google.cloud.securitycenter.v1beta1.IUpdateOrganizationSettingsRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest} UpdateOrganizationSettingsRequest instance + */ + UpdateOrganizationSettingsRequest.create = function create(properties) { + return new UpdateOrganizationSettingsRequest(properties); + }; + + /** + * Encodes the specified UpdateOrganizationSettingsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest + * @static + * @param {google.cloud.securitycenter.v1beta1.IUpdateOrganizationSettingsRequest} message UpdateOrganizationSettingsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateOrganizationSettingsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.organizationSettings != null && message.hasOwnProperty("organizationSettings")) + $root.google.cloud.securitycenter.v1beta1.OrganizationSettings.encode(message.organizationSettings, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateOrganizationSettingsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest + * @static + * @param {google.cloud.securitycenter.v1beta1.IUpdateOrganizationSettingsRequest} message UpdateOrganizationSettingsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateOrganizationSettingsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateOrganizationSettingsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest} UpdateOrganizationSettingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateOrganizationSettingsRequest.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.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { case 1: - message.inclusionMode = 1; + message.organizationSettings = $root.google.cloud.securitycenter.v1beta1.OrganizationSettings.decode(reader, reader.uint32()); break; - case "EXCLUDE": case 2: - message.inclusionMode = 2; + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); break; } - return message; - }; + } + return message; + }; - /** - * Creates a plain object from an AssetDiscoveryConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig - * @static - * @param {google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig} message AssetDiscoveryConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AssetDiscoveryConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.projectIds = []; - if (options.defaults) - object.inclusionMode = options.enums === String ? "INCLUSION_MODE_UNSPECIFIED" : 0; - if (message.projectIds && message.projectIds.length) { - object.projectIds = []; - for (var j = 0; j < message.projectIds.length; ++j) - object.projectIds[j] = message.projectIds[j]; + /** + * Decodes an UpdateOrganizationSettingsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest} UpdateOrganizationSettingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateOrganizationSettingsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateOrganizationSettingsRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateOrganizationSettingsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.organizationSettings != null && message.hasOwnProperty("organizationSettings")) { + var error = $root.google.cloud.securitycenter.v1beta1.OrganizationSettings.verify(message.organizationSettings); + if (error) + return "organizationSettings." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + return null; + }; + + /** + * Creates an UpdateOrganizationSettingsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest} UpdateOrganizationSettingsRequest + */ + UpdateOrganizationSettingsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest(); + if (object.organizationSettings != null) { + if (typeof object.organizationSettings !== "object") + throw TypeError(".google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest.organizationSettings: object expected"); + message.organizationSettings = $root.google.cloud.securitycenter.v1beta1.OrganizationSettings.fromObject(object.organizationSettings); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateOrganizationSettingsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest + * @static + * @param {google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest} message UpdateOrganizationSettingsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateOrganizationSettingsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.organizationSettings = null; + object.updateMask = null; + } + if (message.organizationSettings != null && message.hasOwnProperty("organizationSettings")) + object.organizationSettings = $root.google.cloud.securitycenter.v1beta1.OrganizationSettings.toObject(message.organizationSettings, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateOrganizationSettingsRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateOrganizationSettingsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return UpdateOrganizationSettingsRequest; + })(); + + v1beta1.UpdateSourceRequest = (function() { + + /** + * Properties of an UpdateSourceRequest. + * @memberof google.cloud.securitycenter.v1beta1 + * @interface IUpdateSourceRequest + * @property {google.cloud.securitycenter.v1beta1.ISource|null} [source] UpdateSourceRequest source + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateSourceRequest updateMask + */ + + /** + * Constructs a new UpdateSourceRequest. + * @memberof google.cloud.securitycenter.v1beta1 + * @classdesc Represents an UpdateSourceRequest. + * @implements IUpdateSourceRequest + * @constructor + * @param {google.cloud.securitycenter.v1beta1.IUpdateSourceRequest=} [properties] Properties to set + */ + function UpdateSourceRequest(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]]; + } + + /** + * UpdateSourceRequest source. + * @member {google.cloud.securitycenter.v1beta1.ISource|null|undefined} source + * @memberof google.cloud.securitycenter.v1beta1.UpdateSourceRequest + * @instance + */ + UpdateSourceRequest.prototype.source = null; + + /** + * UpdateSourceRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.securitycenter.v1beta1.UpdateSourceRequest + * @instance + */ + UpdateSourceRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateSourceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1beta1.UpdateSourceRequest + * @static + * @param {google.cloud.securitycenter.v1beta1.IUpdateSourceRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1beta1.UpdateSourceRequest} UpdateSourceRequest instance + */ + UpdateSourceRequest.create = function create(properties) { + return new UpdateSourceRequest(properties); + }; + + /** + * Encodes the specified UpdateSourceRequest message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.UpdateSourceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1beta1.UpdateSourceRequest + * @static + * @param {google.cloud.securitycenter.v1beta1.IUpdateSourceRequest} message UpdateSourceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateSourceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.source != null && message.hasOwnProperty("source")) + $root.google.cloud.securitycenter.v1beta1.Source.encode(message.source, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateSourceRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.UpdateSourceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1beta1.UpdateSourceRequest + * @static + * @param {google.cloud.securitycenter.v1beta1.IUpdateSourceRequest} message UpdateSourceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateSourceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateSourceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1beta1.UpdateSourceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1beta1.UpdateSourceRequest} UpdateSourceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateSourceRequest.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.cloud.securitycenter.v1beta1.UpdateSourceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.source = $root.google.cloud.securitycenter.v1beta1.Source.decode(reader, reader.uint32()); + break; + case 2: + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; } - if (message.inclusionMode != null && message.hasOwnProperty("inclusionMode")) - object.inclusionMode = options.enums === String ? $root.google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode[message.inclusionMode] : message.inclusionMode; - return object; - }; + } + return message; + }; - /** - * Converts this AssetDiscoveryConfig to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig - * @instance - * @returns {Object.} JSON object - */ - AssetDiscoveryConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Decodes an UpdateSourceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1beta1.UpdateSourceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1beta1.UpdateSourceRequest} UpdateSourceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateSourceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * InclusionMode enum. - * @name google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode - * @enum {string} - * @property {number} INCLUSION_MODE_UNSPECIFIED=0 INCLUSION_MODE_UNSPECIFIED value - * @property {number} INCLUDE_ONLY=1 INCLUDE_ONLY value - * @property {number} EXCLUDE=2 EXCLUDE value - */ - AssetDiscoveryConfig.InclusionMode = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "INCLUSION_MODE_UNSPECIFIED"] = 0; - values[valuesById[1] = "INCLUDE_ONLY"] = 1; - values[valuesById[2] = "EXCLUDE"] = 2; - return values; - })(); + /** + * Verifies an UpdateSourceRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1beta1.UpdateSourceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateSourceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.source != null && message.hasOwnProperty("source")) { + var error = $root.google.cloud.securitycenter.v1beta1.Source.verify(message.source); + if (error) + return "source." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + return null; + }; - return AssetDiscoveryConfig; - })(); + /** + * Creates an UpdateSourceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1beta1.UpdateSourceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1beta1.UpdateSourceRequest} UpdateSourceRequest + */ + UpdateSourceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1beta1.UpdateSourceRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1beta1.UpdateSourceRequest(); + if (object.source != null) { + if (typeof object.source !== "object") + throw TypeError(".google.cloud.securitycenter.v1beta1.UpdateSourceRequest.source: object expected"); + message.source = $root.google.cloud.securitycenter.v1beta1.Source.fromObject(object.source); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.securitycenter.v1beta1.UpdateSourceRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; - return OrganizationSettings; + /** + * Creates a plain object from an UpdateSourceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1beta1.UpdateSourceRequest + * @static + * @param {google.cloud.securitycenter.v1beta1.UpdateSourceRequest} message UpdateSourceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateSourceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.source = null; + object.updateMask = null; + } + if (message.source != null && message.hasOwnProperty("source")) + object.source = $root.google.cloud.securitycenter.v1beta1.Source.toObject(message.source, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateSourceRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1beta1.UpdateSourceRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateSourceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return UpdateSourceRequest; })(); - v1beta1.Source = (function() { + v1beta1.UpdateSecurityMarksRequest = (function() { /** - * Properties of a Source. + * Properties of an UpdateSecurityMarksRequest. * @memberof google.cloud.securitycenter.v1beta1 - * @interface ISource - * @property {string|null} [name] Source name - * @property {string|null} [displayName] Source displayName - * @property {string|null} [description] Source description + * @interface IUpdateSecurityMarksRequest + * @property {google.cloud.securitycenter.v1beta1.ISecurityMarks|null} [securityMarks] UpdateSecurityMarksRequest securityMarks + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateSecurityMarksRequest updateMask + * @property {google.protobuf.ITimestamp|null} [startTime] UpdateSecurityMarksRequest startTime */ /** - * Constructs a new Source. + * Constructs a new UpdateSecurityMarksRequest. * @memberof google.cloud.securitycenter.v1beta1 - * @classdesc Represents a Source. - * @implements ISource + * @classdesc Represents an UpdateSecurityMarksRequest. + * @implements IUpdateSecurityMarksRequest * @constructor - * @param {google.cloud.securitycenter.v1beta1.ISource=} [properties] Properties to set + * @param {google.cloud.securitycenter.v1beta1.IUpdateSecurityMarksRequest=} [properties] Properties to set */ - function Source(properties) { + function UpdateSecurityMarksRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -17189,101 +17799,101 @@ } /** - * Source name. - * @member {string} name - * @memberof google.cloud.securitycenter.v1beta1.Source + * UpdateSecurityMarksRequest securityMarks. + * @member {google.cloud.securitycenter.v1beta1.ISecurityMarks|null|undefined} securityMarks + * @memberof google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest * @instance */ - Source.prototype.name = ""; + UpdateSecurityMarksRequest.prototype.securityMarks = null; /** - * Source displayName. - * @member {string} displayName - * @memberof google.cloud.securitycenter.v1beta1.Source + * UpdateSecurityMarksRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest * @instance */ - Source.prototype.displayName = ""; + UpdateSecurityMarksRequest.prototype.updateMask = null; /** - * Source description. - * @member {string} description - * @memberof google.cloud.securitycenter.v1beta1.Source + * UpdateSecurityMarksRequest startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest * @instance */ - Source.prototype.description = ""; + UpdateSecurityMarksRequest.prototype.startTime = null; /** - * Creates a new Source instance using the specified properties. + * Creates a new UpdateSecurityMarksRequest instance using the specified properties. * @function create - * @memberof google.cloud.securitycenter.v1beta1.Source + * @memberof google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest * @static - * @param {google.cloud.securitycenter.v1beta1.ISource=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1beta1.Source} Source instance + * @param {google.cloud.securitycenter.v1beta1.IUpdateSecurityMarksRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest} UpdateSecurityMarksRequest instance */ - Source.create = function create(properties) { - return new Source(properties); + UpdateSecurityMarksRequest.create = function create(properties) { + return new UpdateSecurityMarksRequest(properties); }; /** - * Encodes the specified Source message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.Source.verify|verify} messages. + * Encodes the specified UpdateSecurityMarksRequest message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.securitycenter.v1beta1.Source + * @memberof google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest * @static - * @param {google.cloud.securitycenter.v1beta1.ISource} message Source message or plain object to encode + * @param {google.cloud.securitycenter.v1beta1.IUpdateSecurityMarksRequest} message UpdateSecurityMarksRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Source.encode = function encode(message, writer) { + UpdateSecurityMarksRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.displayName != null && message.hasOwnProperty("displayName")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); - if (message.description != null && message.hasOwnProperty("description")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + if (message.securityMarks != null && message.hasOwnProperty("securityMarks")) + $root.google.cloud.securitycenter.v1beta1.SecurityMarks.encode(message.securityMarks, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.startTime != null && message.hasOwnProperty("startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; /** - * Encodes the specified Source message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.Source.verify|verify} messages. + * Encodes the specified UpdateSecurityMarksRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1beta1.Source + * @memberof google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest * @static - * @param {google.cloud.securitycenter.v1beta1.ISource} message Source message or plain object to encode + * @param {google.cloud.securitycenter.v1beta1.IUpdateSecurityMarksRequest} message UpdateSecurityMarksRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Source.encodeDelimited = function encodeDelimited(message, writer) { + UpdateSecurityMarksRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a Source message from the specified reader or buffer. + * Decodes an UpdateSecurityMarksRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.securitycenter.v1beta1.Source + * @memberof google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1beta1.Source} Source + * @returns {google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest} UpdateSecurityMarksRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Source.decode = function decode(reader, length) { + UpdateSecurityMarksRequest.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.cloud.securitycenter.v1beta1.Source(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.name = reader.string(); + message.securityMarks = $root.google.cloud.securitycenter.v1beta1.SecurityMarks.decode(reader, reader.uint32()); break; case 2: - message.displayName = reader.string(); + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); break; case 3: - message.description = reader.string(); + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -17294,104 +17904,119 @@ }; /** - * Decodes a Source message from the specified reader or buffer, length delimited. + * Decodes an UpdateSecurityMarksRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1beta1.Source + * @memberof google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1beta1.Source} Source + * @returns {google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest} UpdateSecurityMarksRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Source.decodeDelimited = function decodeDelimited(reader) { + UpdateSecurityMarksRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a Source message. + * Verifies an UpdateSecurityMarksRequest message. * @function verify - * @memberof google.cloud.securitycenter.v1beta1.Source + * @memberof google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Source.verify = function verify(message) { + UpdateSecurityMarksRequest.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.displayName != null && message.hasOwnProperty("displayName")) - if (!$util.isString(message.displayName)) - return "displayName: string expected"; - if (message.description != null && message.hasOwnProperty("description")) - if (!$util.isString(message.description)) - return "description: string expected"; + if (message.securityMarks != null && message.hasOwnProperty("securityMarks")) { + var error = $root.google.cloud.securitycenter.v1beta1.SecurityMarks.verify(message.securityMarks); + if (error) + return "securityMarks." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + if (message.startTime != null && message.hasOwnProperty("startTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.startTime); + if (error) + return "startTime." + error; + } return null; }; /** - * Creates a Source message from a plain object. Also converts values to their respective internal types. + * Creates an UpdateSecurityMarksRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.securitycenter.v1beta1.Source + * @memberof google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1beta1.Source} Source + * @returns {google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest} UpdateSecurityMarksRequest */ - Source.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1beta1.Source) + UpdateSecurityMarksRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest) return object; - var message = new $root.google.cloud.securitycenter.v1beta1.Source(); - if (object.name != null) - message.name = String(object.name); - if (object.displayName != null) - message.displayName = String(object.displayName); - if (object.description != null) - message.description = String(object.description); + var message = new $root.google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest(); + if (object.securityMarks != null) { + if (typeof object.securityMarks !== "object") + throw TypeError(".google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest.securityMarks: object expected"); + message.securityMarks = $root.google.cloud.securitycenter.v1beta1.SecurityMarks.fromObject(object.securityMarks); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); + } return message; }; /** - * Creates a plain object from a Source message. Also converts values to other types if specified. + * Creates a plain object from an UpdateSecurityMarksRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.securitycenter.v1beta1.Source + * @memberof google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest * @static - * @param {google.cloud.securitycenter.v1beta1.Source} message Source + * @param {google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest} message UpdateSecurityMarksRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Source.toObject = function toObject(message, options) { + UpdateSecurityMarksRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.name = ""; - object.displayName = ""; - object.description = ""; + object.securityMarks = null; + object.updateMask = null; + object.startTime = null; } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.displayName != null && message.hasOwnProperty("displayName")) - object.displayName = message.displayName; - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; + if (message.securityMarks != null && message.hasOwnProperty("securityMarks")) + object.securityMarks = $root.google.cloud.securitycenter.v1beta1.SecurityMarks.toObject(message.securityMarks, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); return object; }; /** - * Converts this Source to JSON. + * Converts this UpdateSecurityMarksRequest to JSON. * @function toJSON - * @memberof google.cloud.securitycenter.v1beta1.Source + * @memberof google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest * @instance * @returns {Object.} JSON object */ - Source.prototype.toJSON = function toJSON() { + UpdateSecurityMarksRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return Source; + return UpdateSecurityMarksRequest; })(); return v1beta1; @@ -17412,26 +18037,52 @@ */ var api = {}; - api.Http = (function() { + /** + * FieldBehavior enum. + * @name google.api.FieldBehavior + * @enum {string} + * @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 + */ + 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; + return values; + })(); + + api.ResourceDescriptor = (function() { /** - * Properties of a Http. + * Properties of a ResourceDescriptor. * @memberof google.api - * @interface IHttp - * @property {Array.|null} [rules] Http rules - * @property {boolean|null} [fullyDecodeReservedExpansion] Http fullyDecodeReservedExpansion + * @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 */ /** - * Constructs a new Http. + * Constructs a new ResourceDescriptor. * @memberof google.api - * @classdesc Represents a Http. - * @implements IHttp + * @classdesc Represents a ResourceDescriptor. + * @implements IResourceDescriptor * @constructor - * @param {google.api.IHttp=} [properties] Properties to set + * @param {google.api.IResourceDescriptor=} [properties] Properties to set */ - function Http(properties) { - this.rules = []; + function ResourceDescriptor(properties) { + this.pattern = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -17439,91 +18090,143 @@ } /** - * Http rules. - * @member {Array.} rules - * @memberof google.api.Http + * ResourceDescriptor type. + * @member {string} type + * @memberof google.api.ResourceDescriptor * @instance */ - Http.prototype.rules = $util.emptyArray; + ResourceDescriptor.prototype.type = ""; /** - * Http fullyDecodeReservedExpansion. - * @member {boolean} fullyDecodeReservedExpansion - * @memberof google.api.Http + * ResourceDescriptor pattern. + * @member {Array.} pattern + * @memberof google.api.ResourceDescriptor * @instance */ - Http.prototype.fullyDecodeReservedExpansion = false; + ResourceDescriptor.prototype.pattern = $util.emptyArray; /** - * Creates a new Http instance using the specified properties. + * 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 = ""; + + /** + * Creates a new ResourceDescriptor instance using the specified properties. * @function create - * @memberof google.api.Http + * @memberof google.api.ResourceDescriptor * @static - * @param {google.api.IHttp=} [properties] Properties to set - * @returns {google.api.Http} Http instance + * @param {google.api.IResourceDescriptor=} [properties] Properties to set + * @returns {google.api.ResourceDescriptor} ResourceDescriptor instance */ - Http.create = function create(properties) { - return new Http(properties); + ResourceDescriptor.create = function create(properties) { + return new ResourceDescriptor(properties); }; /** - * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. + * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. * @function encode - * @memberof google.api.Http + * @memberof google.api.ResourceDescriptor * @static - * @param {google.api.IHttp} message Http message or plain object to encode + * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Http.encode = function encode(message, writer) { + ResourceDescriptor.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 && message.hasOwnProperty("fullyDecodeReservedExpansion")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.fullyDecodeReservedExpansion); + if (message.type != null && message.hasOwnProperty("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 && message.hasOwnProperty("nameField")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.nameField); + if (message.history != null && message.hasOwnProperty("history")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.history); + if (message.plural != null && message.hasOwnProperty("plural")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.plural); + if (message.singular != null && message.hasOwnProperty("singular")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.singular); return writer; }; /** - * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. + * Encodes the specified ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. * @function encodeDelimited - * @memberof google.api.Http + * @memberof google.api.ResourceDescriptor * @static - * @param {google.api.IHttp} message Http message or plain object to encode + * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Http.encodeDelimited = function encodeDelimited(message, writer) { + ResourceDescriptor.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a Http message from the specified reader or buffer. + * Decodes a ResourceDescriptor message from the specified reader or buffer. * @function decode - * @memberof google.api.Http + * @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.Http} Http + * @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 */ - Http.decode = function decode(reader, length) { + 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.Http(); + 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: - if (!(message.rules && message.rules.length)) - message.rules = []; - message.rules.push($root.google.api.HttpRule.decode(reader, reader.uint32())); + message.type = reader.string(); + break; + case 2: + if (!(message.pattern && message.pattern.length)) + message.pattern = []; + message.pattern.push(reader.string()); break; - case 2: - message.fullyDecodeReservedExpansion = reader.bool(); + 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; default: reader.skipType(tag & 7); @@ -17534,597 +18237,407 @@ }; /** - * Decodes a Http message from the specified reader or buffer, length delimited. + * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.api.Http + * @memberof google.api.ResourceDescriptor * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.Http} Http + * @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 */ - Http.decodeDelimited = function decodeDelimited(reader) { + ResourceDescriptor.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a Http message. + * Verifies a ResourceDescriptor message. * @function verify - * @memberof google.api.Http + * @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 */ - Http.verify = function verify(message) { + ResourceDescriptor.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.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.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) - if (typeof message.fullyDecodeReservedExpansion !== "boolean") - return "fullyDecodeReservedExpansion: boolean 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"; return null; }; /** - * Creates a Http message from a plain object. Also converts values to their respective internal types. + * Creates a ResourceDescriptor message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.api.Http + * @memberof google.api.ResourceDescriptor * @static * @param {Object.} object Plain object - * @returns {google.api.Http} Http + * @returns {google.api.ResourceDescriptor} ResourceDescriptor */ - Http.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.Http) + ResourceDescriptor.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.ResourceDescriptor) 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]); - } + 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.fullyDecodeReservedExpansion != null) - message.fullyDecodeReservedExpansion = Boolean(object.fullyDecodeReservedExpansion); + if (object.nameField != null) + message.nameField = String(object.nameField); + switch (object.history) { + 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); return message; }; /** - * Creates a plain object from a Http message. Also converts values to other types if specified. + * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. * @function toObject - * @memberof google.api.Http + * @memberof google.api.ResourceDescriptor * @static - * @param {google.api.Http} message Http + * @param {google.api.ResourceDescriptor} message ResourceDescriptor * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Http.toObject = function toObject(message, options) { + ResourceDescriptor.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); + object.pattern = []; + if (options.defaults) { + object.type = ""; + object.nameField = ""; + object.history = options.enums === String ? "HISTORY_UNSPECIFIED" : 0; + object.plural = ""; + object.singular = ""; } - if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) - object.fullyDecodeReservedExpansion = message.fullyDecodeReservedExpansion; + 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] : message.history; + if (message.plural != null && message.hasOwnProperty("plural")) + object.plural = message.plural; + if (message.singular != null && message.hasOwnProperty("singular")) + object.singular = message.singular; return object; }; /** - * Converts this Http to JSON. + * Converts this ResourceDescriptor to JSON. * @function toJSON - * @memberof google.api.Http + * @memberof google.api.ResourceDescriptor * @instance * @returns {Object.} JSON object */ - Http.prototype.toJSON = function toJSON() { + ResourceDescriptor.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - 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} get - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.get = ""; - - /** - * HttpRule put. - * @member {string} put - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.put = ""; - - /** - * HttpRule post. - * @member {string} post - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.post = ""; - - /** - * HttpRule delete. - * @member {string} delete - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype["delete"] = ""; - - /** - * HttpRule patch. - * @member {string} patch - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.patch = ""; - /** - * HttpRule custom. - * @member {google.api.ICustomHttpPattern|null|undefined} custom - * @memberof google.api.HttpRule - * @instance + * History enum. + * @name google.api.ResourceDescriptor.History + * @enum {string} + * @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 */ - HttpRule.prototype.custom = null; + 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; + })(); + + return ResourceDescriptor; + })(); + + api.ResourceReference = (function() { /** - * HttpRule body. - * @member {string} body - * @memberof google.api.HttpRule - * @instance + * Properties of a ResourceReference. + * @memberof google.api + * @interface IResourceReference + * @property {string|null} [type] ResourceReference type + * @property {string|null} [childType] ResourceReference childType */ - HttpRule.prototype.body = ""; /** - * HttpRule responseBody. - * @member {string} responseBody - * @memberof google.api.HttpRule - * @instance + * Constructs a new ResourceReference. + * @memberof google.api + * @classdesc Represents a ResourceReference. + * @implements IResourceReference + * @constructor + * @param {google.api.IResourceReference=} [properties] Properties to set */ - HttpRule.prototype.responseBody = ""; + 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]]; + } /** - * HttpRule additionalBindings. - * @member {Array.} additionalBindings - * @memberof google.api.HttpRule + * ResourceReference type. + * @member {string} type + * @memberof google.api.ResourceReference * @instance */ - HttpRule.prototype.additionalBindings = $util.emptyArray; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + ResourceReference.prototype.type = ""; /** - * HttpRule pattern. - * @member {"get"|"put"|"post"|"delete"|"patch"|"custom"|undefined} pattern - * @memberof google.api.HttpRule + * ResourceReference childType. + * @member {string} childType + * @memberof google.api.ResourceReference * @instance */ - Object.defineProperty(HttpRule.prototype, "pattern", { - get: $util.oneOfGetter($oneOfFields = ["get", "put", "post", "delete", "patch", "custom"]), - set: $util.oneOfSetter($oneOfFields) - }); + ResourceReference.prototype.childType = ""; /** - * Creates a new HttpRule instance using the specified properties. + * Creates a new ResourceReference instance using the specified properties. * @function create - * @memberof google.api.HttpRule + * @memberof google.api.ResourceReference * @static - * @param {google.api.IHttpRule=} [properties] Properties to set - * @returns {google.api.HttpRule} HttpRule instance + * @param {google.api.IResourceReference=} [properties] Properties to set + * @returns {google.api.ResourceReference} ResourceReference instance */ - HttpRule.create = function create(properties) { - return new HttpRule(properties); + ResourceReference.create = function create(properties) { + return new ResourceReference(properties); }; /** - * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. * @function encode - * @memberof google.api.HttpRule + * @memberof google.api.ResourceReference * @static - * @param {google.api.IHttpRule} message HttpRule message or plain object to encode + * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - HttpRule.encode = function encode(message, writer) { + ResourceReference.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.selector != null && message.hasOwnProperty("selector")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector); - if (message.get != null && message.hasOwnProperty("get")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.get); - if (message.put != null && message.hasOwnProperty("put")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.put); - if (message.post != null && message.hasOwnProperty("post")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.post); - if (message["delete"] != null && message.hasOwnProperty("delete")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message["delete"]); - if (message.patch != null && message.hasOwnProperty("patch")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.patch); - if (message.body != null && message.hasOwnProperty("body")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.body); - if (message.custom != null && message.hasOwnProperty("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 && message.hasOwnProperty("responseBody")) - writer.uint32(/* id 12, wireType 2 =*/98).string(message.responseBody); + if (message.type != null && message.hasOwnProperty("type")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); + if (message.childType != null && message.hasOwnProperty("childType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.childType); return writer; }; /** - * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. * @function encodeDelimited - * @memberof google.api.HttpRule + * @memberof google.api.ResourceReference * @static - * @param {google.api.IHttpRule} message HttpRule message or plain object to encode + * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - HttpRule.encodeDelimited = function encodeDelimited(message, writer) { + ResourceReference.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a HttpRule message from the specified reader or buffer. + * Decodes a ResourceReference message from the specified reader or buffer. * @function decode - * @memberof google.api.HttpRule + * @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.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 + * @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 */ - 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; + 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 HttpRule message from a plain object. Also converts values to their respective internal types. + * Creates a ResourceReference message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.api.HttpRule + * @memberof google.api.ResourceReference * @static * @param {Object.} object Plain object - * @returns {google.api.HttpRule} HttpRule + * @returns {google.api.ResourceReference} ResourceReference */ - HttpRule.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.HttpRule) + ResourceReference.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.ResourceReference) 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]); - } - } + 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 HttpRule message. Also converts values to other types if specified. + * Creates a plain object from a ResourceReference message. Also converts values to other types if specified. * @function toObject - * @memberof google.api.HttpRule + * @memberof google.api.ResourceReference * @static - * @param {google.api.HttpRule} message HttpRule + * @param {google.api.ResourceReference} message ResourceReference * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - HttpRule.toObject = function toObject(message, options) { + ResourceReference.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); + object.type = ""; + object.childType = ""; } - if (message.responseBody != null && message.hasOwnProperty("responseBody")) - object.responseBody = message.responseBody; + 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 HttpRule to JSON. + * Converts this ResourceReference to JSON. * @function toJSON - * @memberof google.api.HttpRule + * @memberof google.api.ResourceReference * @instance * @returns {Object.} JSON object */ - HttpRule.prototype.toJSON = function toJSON() { + ResourceReference.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return HttpRule; + return ResourceReference; })(); - api.CustomHttpPattern = (function() { + api.Http = (function() { /** - * Properties of a CustomHttpPattern. + * Properties of a Http. * @memberof google.api - * @interface ICustomHttpPattern - * @property {string|null} [kind] CustomHttpPattern kind - * @property {string|null} [path] CustomHttpPattern path + * @interface IHttp + * @property {Array.|null} [rules] Http rules + * @property {boolean|null} [fullyDecodeReservedExpansion] Http fullyDecodeReservedExpansion */ /** - * Constructs a new CustomHttpPattern. + * Constructs a new Http. * @memberof google.api - * @classdesc Represents a CustomHttpPattern. - * @implements ICustomHttpPattern + * @classdesc Represents a Http. + * @implements IHttp * @constructor - * @param {google.api.ICustomHttpPattern=} [properties] Properties to set + * @param {google.api.IHttp=} [properties] Properties to set */ - function CustomHttpPattern(properties) { + function Http(properties) { + this.rules = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -18132,88 +18645,91 @@ } /** - * CustomHttpPattern kind. - * @member {string} kind - * @memberof google.api.CustomHttpPattern + * Http rules. + * @member {Array.} rules + * @memberof google.api.Http * @instance */ - CustomHttpPattern.prototype.kind = ""; + Http.prototype.rules = $util.emptyArray; /** - * CustomHttpPattern path. - * @member {string} path - * @memberof google.api.CustomHttpPattern + * Http fullyDecodeReservedExpansion. + * @member {boolean} fullyDecodeReservedExpansion + * @memberof google.api.Http * @instance */ - CustomHttpPattern.prototype.path = ""; + Http.prototype.fullyDecodeReservedExpansion = false; /** - * Creates a new CustomHttpPattern instance using the specified properties. + * Creates a new Http instance using the specified properties. * @function create - * @memberof google.api.CustomHttpPattern + * @memberof google.api.Http * @static - * @param {google.api.ICustomHttpPattern=} [properties] Properties to set - * @returns {google.api.CustomHttpPattern} CustomHttpPattern instance + * @param {google.api.IHttp=} [properties] Properties to set + * @returns {google.api.Http} Http instance */ - CustomHttpPattern.create = function create(properties) { - return new CustomHttpPattern(properties); + Http.create = function create(properties) { + return new Http(properties); }; /** - * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. * @function encode - * @memberof google.api.CustomHttpPattern + * @memberof google.api.Http * @static - * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode + * @param {google.api.IHttp} message Http message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CustomHttpPattern.encode = function encode(message, writer) { + Http.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.kind != null && message.hasOwnProperty("kind")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.kind); - if (message.path != null && message.hasOwnProperty("path")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.path); + 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 && message.hasOwnProperty("fullyDecodeReservedExpansion")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.fullyDecodeReservedExpansion); return writer; }; /** - * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. * @function encodeDelimited - * @memberof google.api.CustomHttpPattern + * @memberof google.api.Http * @static - * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode + * @param {google.api.IHttp} message Http message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CustomHttpPattern.encodeDelimited = function encodeDelimited(message, writer) { + Http.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a CustomHttpPattern message from the specified reader or buffer. + * Decodes a Http message from the specified reader or buffer. * @function decode - * @memberof google.api.CustomHttpPattern + * @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.CustomHttpPattern} CustomHttpPattern + * @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 */ - CustomHttpPattern.decode = function decode(reader, length) { + 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.CustomHttpPattern(); + 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: - message.kind = reader.string(); + if (!(message.rules && message.rules.length)) + message.rules = []; + message.rules.push($root.google.api.HttpRule.decode(reader, reader.uint32())); break; case 2: - message.path = reader.string(); + message.fullyDecodeReservedExpansion = reader.bool(); break; default: reader.skipType(tag & 7); @@ -18224,144 +18740,143 @@ }; /** - * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. + * Decodes a Http message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.api.CustomHttpPattern + * @memberof google.api.Http * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.CustomHttpPattern} CustomHttpPattern + * @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 */ - CustomHttpPattern.decodeDelimited = function decodeDelimited(reader) { + Http.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a CustomHttpPattern message. + * Verifies a Http message. * @function verify - * @memberof google.api.CustomHttpPattern + * @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 */ - CustomHttpPattern.verify = function verify(message) { + Http.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"; + 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 CustomHttpPattern message from a plain object. Also converts values to their respective internal types. + * Creates a Http message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.api.CustomHttpPattern + * @memberof google.api.Http * @static * @param {Object.} object Plain object - * @returns {google.api.CustomHttpPattern} CustomHttpPattern + * @returns {google.api.Http} Http */ - CustomHttpPattern.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.CustomHttpPattern) + Http.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.Http) 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); + 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 CustomHttpPattern message. Also converts values to other types if specified. + * Creates a plain object from a Http message. Also converts values to other types if specified. * @function toObject - * @memberof google.api.CustomHttpPattern + * @memberof google.api.Http * @static - * @param {google.api.CustomHttpPattern} message CustomHttpPattern + * @param {google.api.Http} message Http * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CustomHttpPattern.toObject = function toObject(message, options) { + Http.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.kind = ""; - object.path = ""; + 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.kind != null && message.hasOwnProperty("kind")) - object.kind = message.kind; - if (message.path != null && message.hasOwnProperty("path")) - object.path = message.path; + if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) + object.fullyDecodeReservedExpansion = message.fullyDecodeReservedExpansion; return object; }; /** - * Converts this CustomHttpPattern to JSON. + * Converts this Http to JSON. * @function toJSON - * @memberof google.api.CustomHttpPattern + * @memberof google.api.Http * @instance * @returns {Object.} JSON object */ - CustomHttpPattern.prototype.toJSON = function toJSON() { + Http.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return CustomHttpPattern; - })(); - - /** - * FieldBehavior enum. - * @name google.api.FieldBehavior - * @enum {string} - * @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 - */ - 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; - return values; + return Http; })(); - api.ResourceDescriptor = (function() { + api.HttpRule = (function() { /** - * Properties of a ResourceDescriptor. + * Properties of a HttpRule. * @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 + * @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 ResourceDescriptor. + * Constructs a new HttpRule. * @memberof google.api - * @classdesc Represents a ResourceDescriptor. - * @implements IResourceDescriptor + * @classdesc Represents a HttpRule. + * @implements IHttpRule * @constructor - * @param {google.api.IResourceDescriptor=} [properties] Properties to set + * @param {google.api.IHttpRule=} [properties] Properties to set */ - function ResourceDescriptor(properties) { - this.pattern = []; + function HttpRule(properties) { + this.additionalBindings = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -18369,143 +18884,209 @@ } /** - * ResourceDescriptor type. - * @member {string} type - * @memberof google.api.ResourceDescriptor + * HttpRule selector. + * @member {string} selector + * @memberof google.api.HttpRule * @instance */ - ResourceDescriptor.prototype.type = ""; + HttpRule.prototype.selector = ""; /** - * ResourceDescriptor pattern. - * @member {Array.} pattern - * @memberof google.api.ResourceDescriptor + * HttpRule get. + * @member {string} get + * @memberof google.api.HttpRule * @instance */ - ResourceDescriptor.prototype.pattern = $util.emptyArray; + HttpRule.prototype.get = ""; /** - * ResourceDescriptor nameField. - * @member {string} nameField - * @memberof google.api.ResourceDescriptor + * HttpRule put. + * @member {string} put + * @memberof google.api.HttpRule * @instance */ - ResourceDescriptor.prototype.nameField = ""; + HttpRule.prototype.put = ""; /** - * ResourceDescriptor history. - * @member {google.api.ResourceDescriptor.History} history - * @memberof google.api.ResourceDescriptor + * HttpRule post. + * @member {string} post + * @memberof google.api.HttpRule * @instance */ - ResourceDescriptor.prototype.history = 0; + HttpRule.prototype.post = ""; /** - * ResourceDescriptor plural. - * @member {string} plural - * @memberof google.api.ResourceDescriptor + * HttpRule delete. + * @member {string} delete + * @memberof google.api.HttpRule * @instance */ - ResourceDescriptor.prototype.plural = ""; + HttpRule.prototype["delete"] = ""; /** - * ResourceDescriptor singular. - * @member {string} singular - * @memberof google.api.ResourceDescriptor + * HttpRule patch. + * @member {string} patch + * @memberof google.api.HttpRule * @instance */ - ResourceDescriptor.prototype.singular = ""; + HttpRule.prototype.patch = ""; /** - * Creates a new ResourceDescriptor instance using the specified properties. + * 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.ResourceDescriptor + * @memberof google.api.HttpRule * @static - * @param {google.api.IResourceDescriptor=} [properties] Properties to set - * @returns {google.api.ResourceDescriptor} ResourceDescriptor instance + * @param {google.api.IHttpRule=} [properties] Properties to set + * @returns {google.api.HttpRule} HttpRule instance */ - ResourceDescriptor.create = function create(properties) { - return new ResourceDescriptor(properties); + HttpRule.create = function create(properties) { + return new HttpRule(properties); }; /** - * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. * @function encode - * @memberof google.api.ResourceDescriptor + * @memberof google.api.HttpRule * @static - * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode + * @param {google.api.IHttpRule} message HttpRule message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ResourceDescriptor.encode = function encode(message, writer) { + HttpRule.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.type != null && message.hasOwnProperty("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 && message.hasOwnProperty("nameField")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.nameField); - if (message.history != null && message.hasOwnProperty("history")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.history); - if (message.plural != null && message.hasOwnProperty("plural")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.plural); - if (message.singular != null && message.hasOwnProperty("singular")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.singular); + if (message.selector != null && message.hasOwnProperty("selector")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector); + if (message.get != null && message.hasOwnProperty("get")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.get); + if (message.put != null && message.hasOwnProperty("put")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.put); + if (message.post != null && message.hasOwnProperty("post")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.post); + if (message["delete"] != null && message.hasOwnProperty("delete")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message["delete"]); + if (message.patch != null && message.hasOwnProperty("patch")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.patch); + if (message.body != null && message.hasOwnProperty("body")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.body); + if (message.custom != null && message.hasOwnProperty("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 && message.hasOwnProperty("responseBody")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.responseBody); return writer; }; /** - * Encodes the specified ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. * @function encodeDelimited - * @memberof google.api.ResourceDescriptor + * @memberof google.api.HttpRule * @static - * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode + * @param {google.api.IHttpRule} message HttpRule message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ResourceDescriptor.encodeDelimited = function encodeDelimited(message, writer) { + HttpRule.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ResourceDescriptor message from the specified reader or buffer. + * Decodes a HttpRule message from the specified reader or buffer. * @function decode - * @memberof google.api.ResourceDescriptor + * @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.ResourceDescriptor} ResourceDescriptor + * @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 */ - ResourceDescriptor.decode = function decode(reader, length) { + 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.ResourceDescriptor(); + 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.type = reader.string(); + message.selector = reader.string(); break; case 2: - if (!(message.pattern && message.pattern.length)) - message.pattern = []; - message.pattern.push(reader.string()); + message.get = reader.string(); break; case 3: - message.nameField = reader.string(); + message.put = reader.string(); break; case 4: - message.history = reader.int32(); + message.post = reader.string(); break; case 5: - message.plural = reader.string(); + message["delete"] = reader.string(); break; case 6: - message.singular = reader.string(); + 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); @@ -18516,196 +19097,240 @@ }; /** - * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. + * Decodes a HttpRule message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.api.ResourceDescriptor + * @memberof google.api.HttpRule * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.ResourceDescriptor} ResourceDescriptor + * @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 */ - ResourceDescriptor.decodeDelimited = function decodeDelimited(reader) { + HttpRule.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ResourceDescriptor message. + * Verifies a HttpRule message. * @function verify - * @memberof google.api.ResourceDescriptor + * @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 */ - ResourceDescriptor.verify = function verify(message) { + HttpRule.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"; + 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.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.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.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.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 ResourceDescriptor message from a plain object. Also converts values to their respective internal types. + * Creates a HttpRule message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.api.ResourceDescriptor + * @memberof google.api.HttpRule * @static * @param {Object.} object Plain object - * @returns {google.api.ResourceDescriptor} ResourceDescriptor + * @returns {google.api.HttpRule} HttpRule */ - ResourceDescriptor.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.ResourceDescriptor) + HttpRule.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.HttpRule) 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]); + 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.nameField != null) - message.nameField = String(object.nameField); - switch (object.history) { - 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.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]); + } } - if (object.plural != null) - message.plural = String(object.plural); - if (object.singular != null) - message.singular = String(object.singular); return message; }; /** - * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. + * Creates a plain object from a HttpRule message. Also converts values to other types if specified. * @function toObject - * @memberof google.api.ResourceDescriptor + * @memberof google.api.HttpRule * @static - * @param {google.api.ResourceDescriptor} message ResourceDescriptor + * @param {google.api.HttpRule} message HttpRule * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ResourceDescriptor.toObject = function toObject(message, options) { + HttpRule.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) - object.pattern = []; + object.additionalBindings = []; if (options.defaults) { - object.type = ""; - object.nameField = ""; - object.history = options.enums === String ? "HISTORY_UNSPECIFIED" : 0; - object.plural = ""; - object.singular = ""; + object.selector = ""; + object.body = ""; + object.responseBody = ""; } - 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.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.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] : 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.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 ResourceDescriptor to JSON. + * Converts this HttpRule to JSON. * @function toJSON - * @memberof google.api.ResourceDescriptor + * @memberof google.api.HttpRule * @instance * @returns {Object.} JSON object */ - ResourceDescriptor.prototype.toJSON = function toJSON() { + HttpRule.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - /** - * History enum. - * @name google.api.ResourceDescriptor.History - * @enum {string} - * @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; - })(); - - return ResourceDescriptor; + return HttpRule; })(); - api.ResourceReference = (function() { + api.CustomHttpPattern = (function() { /** - * Properties of a ResourceReference. + * Properties of a CustomHttpPattern. * @memberof google.api - * @interface IResourceReference - * @property {string|null} [type] ResourceReference type - * @property {string|null} [childType] ResourceReference childType + * @interface ICustomHttpPattern + * @property {string|null} [kind] CustomHttpPattern kind + * @property {string|null} [path] CustomHttpPattern path */ /** - * Constructs a new ResourceReference. + * Constructs a new CustomHttpPattern. * @memberof google.api - * @classdesc Represents a ResourceReference. - * @implements IResourceReference + * @classdesc Represents a CustomHttpPattern. + * @implements ICustomHttpPattern * @constructor - * @param {google.api.IResourceReference=} [properties] Properties to set + * @param {google.api.ICustomHttpPattern=} [properties] Properties to set */ - function ResourceReference(properties) { + function CustomHttpPattern(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -18713,88 +19338,88 @@ } /** - * ResourceReference type. - * @member {string} type - * @memberof google.api.ResourceReference + * CustomHttpPattern kind. + * @member {string} kind + * @memberof google.api.CustomHttpPattern * @instance */ - ResourceReference.prototype.type = ""; + CustomHttpPattern.prototype.kind = ""; /** - * ResourceReference childType. - * @member {string} childType - * @memberof google.api.ResourceReference + * CustomHttpPattern path. + * @member {string} path + * @memberof google.api.CustomHttpPattern * @instance */ - ResourceReference.prototype.childType = ""; + CustomHttpPattern.prototype.path = ""; /** - * Creates a new ResourceReference instance using the specified properties. + * Creates a new CustomHttpPattern instance using the specified properties. * @function create - * @memberof google.api.ResourceReference + * @memberof google.api.CustomHttpPattern * @static - * @param {google.api.IResourceReference=} [properties] Properties to set - * @returns {google.api.ResourceReference} ResourceReference instance + * @param {google.api.ICustomHttpPattern=} [properties] Properties to set + * @returns {google.api.CustomHttpPattern} CustomHttpPattern instance */ - ResourceReference.create = function create(properties) { - return new ResourceReference(properties); + CustomHttpPattern.create = function create(properties) { + return new CustomHttpPattern(properties); }; /** - * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. * @function encode - * @memberof google.api.ResourceReference + * @memberof google.api.CustomHttpPattern * @static - * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode + * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ResourceReference.encode = function encode(message, writer) { + CustomHttpPattern.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.type != null && message.hasOwnProperty("type")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); - if (message.childType != null && message.hasOwnProperty("childType")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.childType); + if (message.kind != null && message.hasOwnProperty("kind")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.kind); + if (message.path != null && message.hasOwnProperty("path")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.path); return writer; }; /** - * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. * @function encodeDelimited - * @memberof google.api.ResourceReference + * @memberof google.api.CustomHttpPattern * @static - * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode + * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ResourceReference.encodeDelimited = function encodeDelimited(message, writer) { + CustomHttpPattern.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ResourceReference message from the specified reader or buffer. + * Decodes a CustomHttpPattern message from the specified reader or buffer. * @function decode - * @memberof google.api.ResourceReference + * @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.ResourceReference} ResourceReference + * @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 */ - ResourceReference.decode = function decode(reader, length) { + 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.ResourceReference(); + 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.type = reader.string(); + message.kind = reader.string(); break; case 2: - message.childType = reader.string(); + message.path = reader.string(); break; default: reader.skipType(tag & 7); @@ -18805,96 +19430,96 @@ }; /** - * Decodes a ResourceReference message from the specified reader or buffer, length delimited. + * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.api.ResourceReference + * @memberof google.api.CustomHttpPattern * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.ResourceReference} ResourceReference + * @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 */ - ResourceReference.decodeDelimited = function decodeDelimited(reader) { + CustomHttpPattern.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ResourceReference message. + * Verifies a CustomHttpPattern message. * @function verify - * @memberof google.api.ResourceReference + * @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 */ - ResourceReference.verify = function verify(message) { + CustomHttpPattern.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"; + 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 ResourceReference message from a plain object. Also converts values to their respective internal types. + * Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.api.ResourceReference + * @memberof google.api.CustomHttpPattern * @static * @param {Object.} object Plain object - * @returns {google.api.ResourceReference} ResourceReference + * @returns {google.api.CustomHttpPattern} CustomHttpPattern */ - ResourceReference.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.ResourceReference) + CustomHttpPattern.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.CustomHttpPattern) 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); + 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 ResourceReference message. Also converts values to other types if specified. + * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. * @function toObject - * @memberof google.api.ResourceReference + * @memberof google.api.CustomHttpPattern * @static - * @param {google.api.ResourceReference} message ResourceReference + * @param {google.api.CustomHttpPattern} message CustomHttpPattern * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ResourceReference.toObject = function toObject(message, options) { + CustomHttpPattern.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.type = ""; - object.childType = ""; + object.kind = ""; + object.path = ""; } - if (message.type != null && message.hasOwnProperty("type")) - object.type = message.type; - if (message.childType != null && message.hasOwnProperty("childType")) - object.childType = message.childType; + 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 ResourceReference to JSON. + * Converts this CustomHttpPattern to JSON. * @function toJSON - * @memberof google.api.ResourceReference + * @memberof google.api.CustomHttpPattern * @instance * @returns {Object.} JSON object */ - ResourceReference.prototype.toJSON = function toJSON() { + CustomHttpPattern.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ResourceReference; + return CustomHttpPattern; })(); return api; diff --git a/packages/google-cloud-securitycenter/protos/protos.json b/packages/google-cloud-securitycenter/protos/protos.json index 99c331d5af8..da9b155d045 100644 --- a/packages/google-cloud-securitycenter/protos/protos.json +++ b/packages/google-cloud-securitycenter/protos/protos.json @@ -16,6 +16,254 @@ "ruby_package": "Google::Cloud::SecurityCenter::V1" }, "nested": { + "Finding": { + "options": { + "(google.api.resource).type": "securitycenter.googleapis.com/Finding", + "(google.api.resource).pattern": "organizations/{organization}/sources/{source}/findings/{finding}" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "parent": { + "type": "string", + "id": 2 + }, + "resourceName": { + "type": "string", + "id": 3 + }, + "state": { + "type": "State", + "id": 4 + }, + "category": { + "type": "string", + "id": 5 + }, + "externalUri": { + "type": "string", + "id": 6 + }, + "sourceProperties": { + "keyType": "string", + "type": "google.protobuf.Value", + "id": 7 + }, + "securityMarks": { + "type": "SecurityMarks", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "eventTime": { + "type": "google.protobuf.Timestamp", + "id": 9 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 10 + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "ACTIVE": 1, + "INACTIVE": 2 + } + } + } + }, + "SecurityMarks": { + "options": { + "(google.api.resource).type": "securitycenter.googleapis.com/SecurityMarks", + "(google.api.resource).pattern": "organizations/{organization}/sources/{source}/findings/{finding}/securityMarks" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "marks": { + "keyType": "string", + "type": "string", + "id": 2 + } + } + }, + "Asset": { + "options": { + "(google.api.resource).type": "securitycenter.googleapis.com/Asset", + "(google.api.resource).pattern": "organizations/{organization}/assets/{asset}" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "securityCenterProperties": { + "type": "SecurityCenterProperties", + "id": 2 + }, + "resourceProperties": { + "keyType": "string", + "type": "google.protobuf.Value", + "id": 7 + }, + "securityMarks": { + "type": "SecurityMarks", + "id": 8 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 9 + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 10 + }, + "iamPolicy": { + "type": "IamPolicy", + "id": 11 + } + }, + "nested": { + "SecurityCenterProperties": { + "fields": { + "resourceName": { + "type": "string", + "id": 1 + }, + "resourceType": { + "type": "string", + "id": 2 + }, + "resourceParent": { + "type": "string", + "id": 3 + }, + "resourceProject": { + "type": "string", + "id": 4 + }, + "resourceOwners": { + "rule": "repeated", + "type": "string", + "id": 5 + }, + "resourceDisplayName": { + "type": "string", + "id": 6 + }, + "resourceParentDisplayName": { + "type": "string", + "id": 7 + }, + "resourceProjectDisplayName": { + "type": "string", + "id": 8 + } + } + }, + "IamPolicy": { + "fields": { + "policyBlob": { + "type": "string", + "id": 1 + } + } + } + } + }, + "Source": { + "options": { + "(google.api.resource).type": "securitycenter.googleapis.com/Source", + "(google.api.resource).pattern": "organizations/{organization}/sources/{source}" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "displayName": { + "type": "string", + "id": 2 + }, + "description": { + "type": "string", + "id": 3 + } + } + }, + "RunAssetDiscoveryResponse": { + "fields": { + "state": { + "type": "State", + "id": 1 + }, + "duration": { + "type": "google.protobuf.Duration", + "id": 2 + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "COMPLETED": 1, + "SUPERSEDED": 2, + "TERMINATED": 3 + } + } + } + }, + "OrganizationSettings": { + "options": { + "(google.api.resource).type": "securitycenter.googleapis.com/OrganizationSettings", + "(google.api.resource).pattern": "organizations/{organization}/organizationSettings" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "enableAssetDiscovery": { + "type": "bool", + "id": 2 + }, + "assetDiscoveryConfig": { + "type": "AssetDiscoveryConfig", + "id": 3 + } + }, + "nested": { + "AssetDiscoveryConfig": { + "fields": { + "projectIds": { + "rule": "repeated", + "type": "string", + "id": 1 + }, + "inclusionMode": { + "type": "InclusionMode", + "id": 2 + } + }, + "nested": { + "InclusionMode": { + "values": { + "INCLUSION_MODE_UNSPECIFIED": 0, + "INCLUDE_ONLY": 1, + "EXCLUDE": 2 + } + } + } + } + } + }, "SecurityCenter": { "options": { "(google.api.default_host)": "securitycenter.googleapis.com", @@ -578,9 +826,37 @@ "stateChange": { "type": "StateChange", "id": 2 + }, + "resource": { + "type": "Resource", + "id": 3 } }, "nested": { + "Resource": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "projectName": { + "type": "string", + "id": 2 + }, + "projectDisplayName": { + "type": "string", + "id": 3 + }, + "parentName": { + "type": "string", + "id": 4 + }, + "parentDisplayName": { + "type": "string", + "id": 5 + } + } + }, "StateChange": { "values": { "UNUSED": 0, @@ -695,16 +971,102 @@ "id": 3 } } - }, - "Asset": { - "options": { - "(google.api.resource).type": "securitycenter.googleapis.com/Asset", - "(google.api.resource).pattern": "organizations/{organization}/assets/{asset}" - }, - "fields": { - "name": { - "type": "string", - "id": 1 + } + } + }, + "v1beta1": { + "options": { + "go_package": "google.golang.org/genproto/googleapis/cloud/securitycenter/v1beta1;securitycenter", + "java_multiple_files": true, + "java_package": "com.google.cloud.securitycenter.v1beta1" + }, + "nested": { + "Finding": { + "options": { + "(google.api.resource).type": "securitycenter.googleapis.com/Finding", + "(google.api.resource).pattern": "organizations/{organization}/sources/{source}/findings/{finding}" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "parent": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } + }, + "resourceName": { + "type": "string", + "id": 3 + }, + "state": { + "type": "State", + "id": 4 + }, + "category": { + "type": "string", + "id": 5 + }, + "externalUri": { + "type": "string", + "id": 6 + }, + "sourceProperties": { + "keyType": "string", + "type": "google.protobuf.Value", + "id": 7 + }, + "securityMarks": { + "type": "SecurityMarks", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "eventTime": { + "type": "google.protobuf.Timestamp", + "id": 9 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 10 + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "ACTIVE": 1, + "INACTIVE": 2 + } + } + } + }, + "SecurityMarks": { + "options": { + "(google.api.resource).type": "securitycenter.googleapis.com/SecurityMarks", + "(google.api.resource).pattern": "organizations/{organization}/sources/{source}/findings/{finding}/securityMarks" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "marks": { + "keyType": "string", + "type": "string", + "id": 2 + } + } + }, + "Asset": { + "fields": { + "name": { + "type": "string", + "id": 1 }, "securityCenterProperties": { "type": "SecurityCenterProperties", @@ -726,10 +1088,6 @@ "updateTime": { "type": "google.protobuf.Timestamp", "id": 10 - }, - "iamPolicy": { - "type": "IamPolicy", - "id": 11 } }, "nested": { @@ -737,7 +1095,10 @@ "fields": { "resourceName": { "type": "string", - "id": 1 + "id": 1, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } }, "resourceType": { "type": "string", @@ -757,91 +1118,47 @@ "id": 5 } } - }, - "IamPolicy": { - "fields": { - "policyBlob": { - "type": "string", - "id": 1 - } - } } } }, - "SecurityMarks": { + "Source": { "options": { - "(google.api.resource).type": "securitycenter.googleapis.com/SecurityMarks", - "(google.api.resource).pattern": "organizations/{organization}/sources/{source}/findings/{finding}/securityMarks" + "(google.api.resource).type": "securitycenter.googleapis.com/Source", + "(google.api.resource).pattern": "organizations/{organization}/sources/{source}" }, "fields": { "name": { "type": "string", "id": 1 }, - "marks": { - "keyType": "string", + "displayName": { "type": "string", "id": 2 + }, + "description": { + "type": "string", + "id": 3 } } }, - "Finding": { - "options": { - "(google.api.resource).type": "securitycenter.googleapis.com/Finding", - "(google.api.resource).pattern": "organizations/{organization}/sources/{source}/findings/{finding}" - }, + "RunAssetDiscoveryResponse": { "fields": { - "name": { - "type": "string", - "id": 1 - }, - "parent": { - "type": "string", - "id": 2 - }, - "resourceName": { - "type": "string", - "id": 3 - }, "state": { "type": "State", - "id": 4 - }, - "category": { - "type": "string", - "id": 5 - }, - "externalUri": { - "type": "string", - "id": 6 - }, - "sourceProperties": { - "keyType": "string", - "type": "google.protobuf.Value", - "id": 7 - }, - "securityMarks": { - "type": "SecurityMarks", - "id": 8, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "eventTime": { - "type": "google.protobuf.Timestamp", - "id": 9 + "id": 1 }, - "createTime": { - "type": "google.protobuf.Timestamp", - "id": 10 + "duration": { + "type": "google.protobuf.Duration", + "id": 2 } }, "nested": { "State": { "values": { "STATE_UNSPECIFIED": 0, - "ACTIVE": 1, - "INACTIVE": 2 + "COMPLETED": 1, + "SUPERSEDED": 2, + "TERMINATED": 3 } } } @@ -890,65 +1207,19 @@ } } }, - "RunAssetDiscoveryResponse": { - "fields": { - "state": { - "type": "State", - "id": 1 - }, - "duration": { - "type": "google.protobuf.Duration", - "id": 2 - } - }, - "nested": { - "State": { - "values": { - "STATE_UNSPECIFIED": 0, - "COMPLETED": 1, - "SUPERSEDED": 2, - "TERMINATED": 3 - } - } - } - }, - "Source": { + "SecurityCenter": { "options": { - "(google.api.resource).type": "securitycenter.googleapis.com/Source", - "(google.api.resource).pattern": "organizations/{organization}/sources/{source}" + "(google.api.default_host)": "securitycenter.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" }, - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "displayName": { - "type": "string", - "id": 2 - }, - "description": { - "type": "string", - "id": 3 - } - } - } - } - }, - "v1beta1": { - "options": { - "go_package": "google.golang.org/genproto/googleapis/cloud/securitycenter/v1beta1;securitycenter", - "java_multiple_files": true, - "java_package": "com.google.cloud.securitycenter.v1beta1" - }, - "nested": { - "SecurityCenter": { "methods": { "CreateSource": { "requestType": "CreateSourceRequest", "responseType": "Source", "options": { "(google.api.http).post": "/v1beta1/{parent=organizations/*}/sources", - "(google.api.http).body": "source" + "(google.api.http).body": "source", + "(google.api.method_signature)": "parent,source" } }, "CreateFinding": { @@ -956,7 +1227,8 @@ "responseType": "Finding", "options": { "(google.api.http).post": "/v1beta1/{parent=organizations/*/sources/*}/findings", - "(google.api.http).body": "finding" + "(google.api.http).body": "finding", + "(google.api.method_signature)": "parent,finding_id,finding" } }, "GetIamPolicy": { @@ -964,21 +1236,24 @@ "responseType": "google.iam.v1.Policy", "options": { "(google.api.http).post": "/v1beta1/{resource=organizations/*/sources/*}:getIamPolicy", - "(google.api.http).body": "*" + "(google.api.http).body": "*", + "(google.api.method_signature)": "resource" } }, "GetOrganizationSettings": { "requestType": "GetOrganizationSettingsRequest", "responseType": "OrganizationSettings", "options": { - "(google.api.http).get": "/v1beta1/{name=organizations/*/organizationSettings}" + "(google.api.http).get": "/v1beta1/{name=organizations/*/organizationSettings}", + "(google.api.method_signature)": "name" } }, "GetSource": { "requestType": "GetSourceRequest", "responseType": "Source", "options": { - "(google.api.http).get": "/v1beta1/{name=organizations/*/sources/*}" + "(google.api.http).get": "/v1beta1/{name=organizations/*/sources/*}", + "(google.api.method_signature)": "name" } }, "GroupAssets": { @@ -994,7 +1269,8 @@ "responseType": "GroupFindingsResponse", "options": { "(google.api.http).post": "/v1beta1/{parent=organizations/*/sources/*}/findings:group", - "(google.api.http).body": "*" + "(google.api.http).body": "*", + "(google.api.method_signature)": "parent,group_by" } }, "ListAssets": { @@ -1015,7 +1291,8 @@ "requestType": "ListSourcesRequest", "responseType": "ListSourcesResponse", "options": { - "(google.api.http).get": "/v1beta1/{parent=organizations/*}/sources" + "(google.api.http).get": "/v1beta1/{parent=organizations/*}/sources", + "(google.api.method_signature)": "parent" } }, "RunAssetDiscovery": { @@ -1023,7 +1300,10 @@ "responseType": "google.longrunning.Operation", "options": { "(google.api.http).post": "/v1beta1/{parent=organizations/*}/assets:runDiscovery", - "(google.api.http).body": "*" + "(google.api.http).body": "*", + "(google.api.method_signature)": "parent", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "google.protobuf.Empty" } }, "SetFindingState": { @@ -1031,7 +1311,8 @@ "responseType": "Finding", "options": { "(google.api.http).post": "/v1beta1/{name=organizations/*/sources/*/findings/*}:setState", - "(google.api.http).body": "*" + "(google.api.http).body": "*", + "(google.api.method_signature)": "name,state,start_time" } }, "SetIamPolicy": { @@ -1039,7 +1320,8 @@ "responseType": "google.iam.v1.Policy", "options": { "(google.api.http).post": "/v1beta1/{resource=organizations/*/sources/*}:setIamPolicy", - "(google.api.http).body": "*" + "(google.api.http).body": "*", + "(google.api.method_signature)": "resource,policy" } }, "TestIamPermissions": { @@ -1047,7 +1329,8 @@ "responseType": "google.iam.v1.TestIamPermissionsResponse", "options": { "(google.api.http).post": "/v1beta1/{resource=organizations/*/sources/*}:testIamPermissions", - "(google.api.http).body": "*" + "(google.api.http).body": "*", + "(google.api.method_signature)": "resource,permissions" } }, "UpdateFinding": { @@ -1055,7 +1338,8 @@ "responseType": "Finding", "options": { "(google.api.http).patch": "/v1beta1/{finding.name=organizations/*/sources/*/findings/*}", - "(google.api.http).body": "finding" + "(google.api.http).body": "finding", + "(google.api.method_signature)": "finding" } }, "UpdateOrganizationSettings": { @@ -1063,7 +1347,8 @@ "responseType": "OrganizationSettings", "options": { "(google.api.http).patch": "/v1beta1/{organization_settings.name=organizations/*/organizationSettings}", - "(google.api.http).body": "organization_settings" + "(google.api.http).body": "organization_settings", + "(google.api.method_signature)": "organization_settings" } }, "UpdateSource": { @@ -1071,7 +1356,8 @@ "responseType": "Source", "options": { "(google.api.http).patch": "/v1beta1/{source.name=organizations/*/sources/*}", - "(google.api.http).body": "source" + "(google.api.http).body": "source", + "(google.api.method_signature)": "source" } }, "UpdateSecurityMarks": { @@ -1081,7 +1367,8 @@ "(google.api.http).patch": "/v1beta1/{security_marks.name=organizations/*/assets/*/securityMarks}", "(google.api.http).body": "security_marks", "(google.api.http).additional_bindings.patch": "/v1beta1/{security_marks.name=organizations/*/sources/*/findings/*/securityMarks}", - "(google.api.http).additional_bindings.body": "security_marks" + "(google.api.http).additional_bindings.body": "security_marks", + "(google.api.method_signature)": "security_marks" } } } @@ -1090,15 +1377,25 @@ "fields": { "parent": { "type": "string", - "id": 1 + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "securitycenter.googleapis.com/Source" + } }, "findingId": { "type": "string", - "id": 2 + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } }, "finding": { "type": "Finding", - "id": 3 + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } } } }, @@ -1106,11 +1403,18 @@ "fields": { "parent": { "type": "string", - "id": 1 + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudresourcemanager.googleapis.com/Organization" + } }, "source": { "type": "Source", - "id": 2 + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } } } }, @@ -1118,7 +1422,11 @@ "fields": { "name": { "type": "string", - "id": 1 + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "securitycenter.googleapis.com/OrganizationSettings" + } } } }, @@ -1126,7 +1434,11 @@ "fields": { "name": { "type": "string", - "id": 1 + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "securitycenter.googleapis.com/Source" + } } } }, @@ -1134,7 +1446,11 @@ "fields": { "parent": { "type": "string", - "id": 1 + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudresourcemanager.googleapis.com/Organization" + } }, "filter": { "type": "string", @@ -1142,7 +1458,10 @@ }, "groupBy": { "type": "string", - "id": 3 + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } }, "compareDuration": { "type": "google.protobuf.Duration", @@ -1183,7 +1502,11 @@ "fields": { "parent": { "type": "string", - "id": 1 + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "securitycenter.googleapis.com/Source" + } }, "filter": { "type": "string", @@ -1191,7 +1514,10 @@ }, "groupBy": { "type": "string", - "id": 3 + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } }, "readTime": { "type": "google.protobuf.Timestamp", @@ -1241,7 +1567,11 @@ "fields": { "parent": { "type": "string", - "id": 1 + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudresourcemanager.googleapis.com/Organization" + } }, "pageToken": { "type": "string", @@ -1270,7 +1600,11 @@ "fields": { "parent": { "type": "string", - "id": 1 + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudresourcemanager.googleapis.com/Organization" + } }, "filter": { "type": "string", @@ -1290,7 +1624,10 @@ }, "fieldMask": { "type": "google.protobuf.FieldMask", - "id": 7 + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } }, "pageToken": { "type": "string", @@ -1352,7 +1689,11 @@ "fields": { "parent": { "type": "string", - "id": 1 + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "securitycenter.googleapis.com/Source" + } }, "filter": { "type": "string", @@ -1368,7 +1709,10 @@ }, "fieldMask": { "type": "google.protobuf.FieldMask", - "id": 5 + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } }, "pageToken": { "type": "string", @@ -1405,15 +1749,25 @@ "fields": { "name": { "type": "string", - "id": 1 + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "securitycenter.googleapis.com/Finding" + } }, "state": { "type": "Finding.State", - "id": 2 + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } }, "startTime": { "type": "google.protobuf.Timestamp", - "id": 3 + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } } } }, @@ -1421,7 +1775,11 @@ "fields": { "parent": { "type": "string", - "id": 1 + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudresourcemanager.googleapis.com/Organization" + } } } }, @@ -1429,7 +1787,10 @@ "fields": { "finding": { "type": "Finding", - "id": 1 + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } }, "updateMask": { "type": "google.protobuf.FieldMask", @@ -1441,7 +1802,10 @@ "fields": { "organizationSettings": { "type": "OrganizationSettings", - "id": 1 + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } }, "updateMask": { "type": "google.protobuf.FieldMask", @@ -1453,7 +1817,10 @@ "fields": { "source": { "type": "Source", - "id": 1 + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } }, "updateMask": { "type": "google.protobuf.FieldMask", @@ -1465,7 +1832,10 @@ "fields": { "securityMarks": { "type": "SecurityMarks", - "id": 1 + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } }, "updateMask": { "type": "google.protobuf.FieldMask", @@ -1476,185 +1846,6 @@ "id": 3 } } - }, - "Asset": { - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "securityCenterProperties": { - "type": "SecurityCenterProperties", - "id": 2 - }, - "resourceProperties": { - "keyType": "string", - "type": "google.protobuf.Value", - "id": 7 - }, - "securityMarks": { - "type": "SecurityMarks", - "id": 8 - }, - "createTime": { - "type": "google.protobuf.Timestamp", - "id": 9 - }, - "updateTime": { - "type": "google.protobuf.Timestamp", - "id": 10 - } - }, - "nested": { - "SecurityCenterProperties": { - "fields": { - "resourceName": { - "type": "string", - "id": 1 - }, - "resourceType": { - "type": "string", - "id": 2 - }, - "resourceParent": { - "type": "string", - "id": 3 - }, - "resourceProject": { - "type": "string", - "id": 4 - }, - "resourceOwners": { - "rule": "repeated", - "type": "string", - "id": 5 - } - } - } - } - }, - "SecurityMarks": { - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "marks": { - "keyType": "string", - "type": "string", - "id": 2 - } - } - }, - "Finding": { - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "parent": { - "type": "string", - "id": 2 - }, - "resourceName": { - "type": "string", - "id": 3 - }, - "state": { - "type": "State", - "id": 4 - }, - "category": { - "type": "string", - "id": 5 - }, - "externalUri": { - "type": "string", - "id": 6 - }, - "sourceProperties": { - "keyType": "string", - "type": "google.protobuf.Value", - "id": 7 - }, - "securityMarks": { - "type": "SecurityMarks", - "id": 8 - }, - "eventTime": { - "type": "google.protobuf.Timestamp", - "id": 9 - }, - "createTime": { - "type": "google.protobuf.Timestamp", - "id": 10 - } - }, - "nested": { - "State": { - "values": { - "STATE_UNSPECIFIED": 0, - "ACTIVE": 1, - "INACTIVE": 2 - } - } - } - }, - "OrganizationSettings": { - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "enableAssetDiscovery": { - "type": "bool", - "id": 2 - }, - "assetDiscoveryConfig": { - "type": "AssetDiscoveryConfig", - "id": 3 - } - }, - "nested": { - "AssetDiscoveryConfig": { - "fields": { - "projectIds": { - "rule": "repeated", - "type": "string", - "id": 1 - }, - "inclusionMode": { - "type": "InclusionMode", - "id": 2 - } - }, - "nested": { - "InclusionMode": { - "values": { - "INCLUSION_MODE_UNSPECIFIED": 0, - "INCLUDE_ONLY": 1, - "EXCLUDE": 2 - } - } - } - } - } - }, - "Source": { - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "displayName": { - "type": "string", - "id": 2 - }, - "description": { - "type": "string", - "id": 3 - } - } } } } @@ -1666,12 +1857,94 @@ "options": { "go_package": "google.golang.org/genproto/googleapis/api/annotations;annotations", "java_multiple_files": true, - "java_outer_classname": "ResourceProto", + "java_outer_classname": "ClientProto", "java_package": "com.google.api", "objc_class_prefix": "GAPI", "cc_enable_arenas": true }, "nested": { + "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 + } + }, + "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 + } + }, + "nested": { + "History": { + "values": { + "HISTORY_UNSPECIFIED": 0, + "ORIGINALLY_SINGLE_PATTERN": 1, + "FUTURE_MULTI_PATTERN": 2 + } + } + } + }, + "ResourceReference": { + "fields": { + "type": { + "type": "string", + "id": 1 + }, + "childType": { + "type": "string", + "id": 2 + } + } + }, "http": { "type": "HttpRule", "id": 72295728, @@ -1774,88 +2047,6 @@ "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 - } - }, - "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 - } - }, - "nested": { - "History": { - "values": { - "HISTORY_UNSPECIFIED": 0, - "ORIGINALLY_SINGLE_PATTERN": 1, - "FUTURE_MULTI_PATTERN": 2 - } - } - } - }, - "ResourceReference": { - "fields": { - "type": { - "type": "string", - "id": 1 - }, - "childType": { - "type": "string", - "id": 2 - } - } } } }, diff --git a/packages/google-cloud-securitycenter/src/extra_proto_list.json b/packages/google-cloud-securitycenter/src/extra_proto_list.json new file mode 100644 index 00000000000..e7ad9a63718 --- /dev/null +++ b/packages/google-cloud-securitycenter/src/extra_proto_list.json @@ -0,0 +1,14 @@ +[ + "../../protos/google/cloud/securitycenter/v1/finding.proto", + "../../protos/google/cloud/securitycenter/v1/asset.proto", + "../../protos/google/cloud/securitycenter/v1/source.proto", + "../../protos/google/cloud/securitycenter/v1/security_marks.proto", + "../../protos/google/cloud/securitycenter/v1/run_asset_discovery_response.proto", + "../../protos/google/cloud/securitycenter/v1/organization_settings.proto", + "../../protos/google/cloud/securitycenter/v1beta1/finding.proto", + "../../protos/google/cloud/securitycenter/v1beta1/asset.proto", + "../../protos/google/cloud/securitycenter/v1beta1/source.proto", + "../../protos/google/cloud/securitycenter/v1beta1/security_marks.proto", + "../../protos/google/cloud/securitycenter/v1beta1/run_asset_discovery_response.proto", + "../../protos/google/cloud/securitycenter/v1beta1/organization_settings.proto" +] diff --git a/packages/google-cloud-securitycenter/src/v1/doc/google/cloud/securitycenter/v1/doc_asset.js b/packages/google-cloud-securitycenter/src/v1/doc/google/cloud/securitycenter/v1/doc_asset.js index 285508ee5da..95e09a50615 100644 --- a/packages/google-cloud-securitycenter/src/v1/doc/google/cloud/securitycenter/v1/doc_asset.js +++ b/packages/google-cloud-securitycenter/src/v1/doc/google/cloud/securitycenter/v1/doc_asset.js @@ -96,6 +96,15 @@ const Asset = { * @property {string[]} resourceOwners * Owners of the Google Cloud resource. * + * @property {string} resourceDisplayName + * The user defined display name for this resource. + * + * @property {string} resourceParentDisplayName + * The user defined display name for the parent of this resource. + * + * @property {string} resourceProjectDisplayName + * The user defined display name for the project of this resource. + * * @typedef SecurityCenterProperties * @memberof google.cloud.securitycenter.v1 * @see [google.cloud.securitycenter.v1.Asset.SecurityCenterProperties definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/securitycenter/v1/asset.proto} diff --git a/packages/google-cloud-securitycenter/src/v1/doc/google/cloud/securitycenter/v1/doc_securitycenter_service.js b/packages/google-cloud-securitycenter/src/v1/doc/google/cloud/securitycenter/v1/doc_securitycenter_service.js index 304ab23f148..46407c877b2 100644 --- a/packages/google-cloud-securitycenter/src/v1/doc/google/cloud/securitycenter/v1/doc_securitycenter_service.js +++ b/packages/google-cloud-securitycenter/src/v1/doc/google/cloud/securitycenter/v1/doc_securitycenter_service.js @@ -147,9 +147,12 @@ const GetSourceRequest = { * * resource_properties: `=`, `:`, `>`, `<`, `>=`, `<=` * * security_marks.marks: `=`, `:` * * security_center_properties.resource_name: `=`, `:` + * * security_center_properties.resource_display_name: `=`, `:` * * security_center_properties.resource_type: `=`, `:` * * security_center_properties.resource_parent: `=`, `:` + * * security_center_properties.resource_parent_display_name: `=`, `:` * * security_center_properties.resource_project: `=`, `:` + * * security_center_properties.resource_project_display_name: `=`, `:` * * security_center_properties.resource_owners: `=`, `:` * * For example, `resource_properties.size = 100` is a valid filter string. @@ -163,12 +166,16 @@ const GetSourceRequest = { * The following fields are supported when compare_duration is not set: * * * security_center_properties.resource_project + * * security_center_properties.resource_project_display_name * * security_center_properties.resource_type * * security_center_properties.resource_parent + * * security_center_properties.resource_parent_display_name * * The following fields are supported when compare_duration is set: * * * security_center_properties.resource_type + * * security_center_properties.resource_project_display_name + * * security_center_properties.resource_parent_display_name * * @property {Object} compareDuration * When compare_duration is set, the GroupResult's "state_change" property is @@ -527,9 +534,12 @@ const ListSourcesResponse = { * * resource_properties: `=`, `:`, `>`, `<`, `>=`, `<=` * * security_marks.marks: `=`, `:` * * security_center_properties.resource_name: `=`, `:` + * * security_center_properties.resource_display_name: `=`, `:` * * security_center_properties.resource_type: `=`, `:` * * security_center_properties.resource_parent: `=`, `:` + * * security_center_properties.resource_parent_display_name: `=`, `:` * * security_center_properties.resource_project: `=`, `:` + * * security_center_properties.resource_project_display_name: `=`, `:` * * security_center_properties.resource_owners: `=`, `:` * * For example, `resource_properties.size = 100` is a valid filter string. @@ -550,8 +560,11 @@ const ListSourcesResponse = { * resource_properties * security_marks.marks * security_center_properties.resource_name + * security_center_properties.resource_display_name * security_center_properties.resource_parent + * security_center_properties.resource_parent_display_name * security_center_properties.resource_project + * security_center_properties.resource_project_display_name * security_center_properties.resource_type * * @property {Object} readTime @@ -870,6 +883,11 @@ const ListFindingsResponse = { * * The number should be among the values of [StateChange]{@link google.cloud.securitycenter.v1.StateChange} * + * @property {Object} resource + * Output only. Resource that is associated with this finding. + * + * This object should have the same structure as [Resource]{@link google.cloud.securitycenter.v1.Resource} + * * @typedef ListFindingsResult * @memberof google.cloud.securitycenter.v1 * @see [google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/securitycenter/v1/securitycenter_service.proto} @@ -877,6 +895,34 @@ const ListFindingsResponse = { ListFindingsResult: { // This is for documentation. Actual contents will be loaded by gRPC. + /** + * Information related to the Google Cloud Platform (GCP) resource that is + * associated with this finding. + * + * @property {string} name + * The full resource name of the resource. See: + * https://cloud.google.com/apis/design/resource_names#full_resource_name + * + * @property {string} projectName + * The full resource name of project that the resource belongs to. + * + * @property {string} projectDisplayName + * The human readable name of project that the resource belongs to. + * + * @property {string} parentName + * The full resource name of resource's parent. + * + * @property {string} parentDisplayName + * The human readable name of resource's parent. + * + * @typedef Resource + * @memberof google.cloud.securitycenter.v1 + * @see [google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/securitycenter/v1/securitycenter_service.proto} + */ + Resource: { + // This is for documentation. Actual contents will be loaded by gRPC. + }, + /** * The change in state of the finding. * diff --git a/packages/google-cloud-securitycenter/src/v1/security_center_client.js b/packages/google-cloud-securitycenter/src/v1/security_center_client.js index a26bd809107..8e33ae2a58e 100644 --- a/packages/google-cloud-securitycenter/src/v1/security_center_client.js +++ b/packages/google-cloud-securitycenter/src/v1/security_center_client.js @@ -643,12 +643,16 @@ class SecurityCenterClient { * The following fields are supported when compare_duration is not set: * * * security_center_properties.resource_project + * * security_center_properties.resource_project_display_name * * security_center_properties.resource_type * * security_center_properties.resource_parent + * * security_center_properties.resource_parent_display_name * * The following fields are supported when compare_duration is set: * * * security_center_properties.resource_type + * * security_center_properties.resource_project_display_name + * * security_center_properties.resource_parent_display_name * @param {string} [request.filter] * Expression that defines the filter to apply across assets. * The expression is a list of zero or more restrictions combined via logical @@ -697,9 +701,12 @@ class SecurityCenterClient { * * resource_properties: `=`, `:`, `>`, `<`, `>=`, `<=` * * security_marks.marks: `=`, `:` * * security_center_properties.resource_name: `=`, `:` + * * security_center_properties.resource_display_name: `=`, `:` * * security_center_properties.resource_type: `=`, `:` * * security_center_properties.resource_parent: `=`, `:` + * * security_center_properties.resource_parent_display_name: `=`, `:` * * security_center_properties.resource_project: `=`, `:` + * * security_center_properties.resource_project_display_name: `=`, `:` * * security_center_properties.resource_owners: `=`, `:` * * For example, `resource_properties.size = 100` is a valid filter string. @@ -872,12 +879,16 @@ class SecurityCenterClient { * The following fields are supported when compare_duration is not set: * * * security_center_properties.resource_project + * * security_center_properties.resource_project_display_name * * security_center_properties.resource_type * * security_center_properties.resource_parent + * * security_center_properties.resource_parent_display_name * * The following fields are supported when compare_duration is set: * * * security_center_properties.resource_type + * * security_center_properties.resource_project_display_name + * * security_center_properties.resource_parent_display_name * @param {string} [request.filter] * Expression that defines the filter to apply across assets. * The expression is a list of zero or more restrictions combined via logical @@ -926,9 +937,12 @@ class SecurityCenterClient { * * resource_properties: `=`, `:`, `>`, `<`, `>=`, `<=` * * security_marks.marks: `=`, `:` * * security_center_properties.resource_name: `=`, `:` + * * security_center_properties.resource_display_name: `=`, `:` * * security_center_properties.resource_type: `=`, `:` * * security_center_properties.resource_parent: `=`, `:` + * * security_center_properties.resource_parent_display_name: `=`, `:` * * security_center_properties.resource_project: `=`, `:` + * * security_center_properties.resource_project_display_name: `=`, `:` * * security_center_properties.resource_owners: `=`, `:` * * For example, `resource_properties.size = 100` is a valid filter string. @@ -1440,9 +1454,12 @@ class SecurityCenterClient { * * resource_properties: `=`, `:`, `>`, `<`, `>=`, `<=` * * security_marks.marks: `=`, `:` * * security_center_properties.resource_name: `=`, `:` + * * security_center_properties.resource_display_name: `=`, `:` * * security_center_properties.resource_type: `=`, `:` * * security_center_properties.resource_parent: `=`, `:` + * * security_center_properties.resource_parent_display_name: `=`, `:` * * security_center_properties.resource_project: `=`, `:` + * * security_center_properties.resource_project_display_name: `=`, `:` * * security_center_properties.resource_owners: `=`, `:` * * For example, `resource_properties.size = 100` is a valid filter string. @@ -1462,8 +1479,11 @@ class SecurityCenterClient { * resource_properties * security_marks.marks * security_center_properties.resource_name + * security_center_properties.resource_display_name * security_center_properties.resource_parent + * security_center_properties.resource_parent_display_name * security_center_properties.resource_project + * security_center_properties.resource_project_display_name * security_center_properties.resource_type * @param {Object} [request.readTime] * Time used as a reference point when filtering assets. The filter is limited @@ -1666,9 +1686,12 @@ class SecurityCenterClient { * * resource_properties: `=`, `:`, `>`, `<`, `>=`, `<=` * * security_marks.marks: `=`, `:` * * security_center_properties.resource_name: `=`, `:` + * * security_center_properties.resource_display_name: `=`, `:` * * security_center_properties.resource_type: `=`, `:` * * security_center_properties.resource_parent: `=`, `:` + * * security_center_properties.resource_parent_display_name: `=`, `:` * * security_center_properties.resource_project: `=`, `:` + * * security_center_properties.resource_project_display_name: `=`, `:` * * security_center_properties.resource_owners: `=`, `:` * * For example, `resource_properties.size = 100` is a valid filter string. @@ -1688,8 +1711,11 @@ class SecurityCenterClient { * resource_properties * security_marks.marks * security_center_properties.resource_name + * security_center_properties.resource_display_name * security_center_properties.resource_parent + * security_center_properties.resource_parent_display_name * security_center_properties.resource_project + * security_center_properties.resource_project_display_name * security_center_properties.resource_type * @param {Object} [request.readTime] * Time used as a reference point when filtering assets. The filter is limited diff --git a/packages/google-cloud-securitycenter/src/v1/security_center_client_config.json b/packages/google-cloud-securitycenter/src/v1/security_center_client_config.json index 3ca6c2cd104..d2419f146a7 100644 --- a/packages/google-cloud-securitycenter/src/v1/security_center_client_config.json +++ b/packages/google-cloud-securitycenter/src/v1/security_center_client_config.json @@ -13,9 +13,9 @@ "initial_retry_delay_millis": 100, "retry_delay_multiplier": 1.3, "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 20000, + "initial_rpc_timeout_millis": 480000, "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 20000, + "max_rpc_timeout_millis": 480000, "total_timeout_millis": 600000 } }, diff --git a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_asset.js b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_asset.js index 5167b5ddcf8..2c0206e3abe 100644 --- a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_asset.js +++ b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_asset.js @@ -27,7 +27,7 @@ * The relative resource name of this asset. See: * https://cloud.google.com/apis/design/resource_names#relative_resource_name * Example: - * "organizations/123/assets/456". + * "organizations/{organization_id}/assets/{asset_id}". * * @property {Object} securityCenterProperties * Cloud SCC managed properties. These properties are managed by @@ -68,7 +68,7 @@ const Asset = { * cannot be modified by the user. * * @property {string} resourceName - * The full resource name of the GCP resource this asset + * Immutable. The full resource name of the GCP resource this asset * represents. This field is immutable after create time. See: * https://cloud.google.com/apis/design/resource_names#full_resource_name * diff --git a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_finding.js b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_finding.js index 72dd6e7ef75..ded888d50ee 100644 --- a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_finding.js +++ b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_finding.js @@ -27,19 +27,21 @@ * The relative resource name of this finding. See: * https://cloud.google.com/apis/design/resource_names#relative_resource_name * Example: - * "organizations/123/sources/456/findings/789" + * "organizations/{organization_id}/sources/{source_id}/findings/{finding_id}" * * @property {string} parent - * The relative resource name of the source the finding belongs to. See: + * Immutable. The relative resource name of the source the finding belongs to. See: * https://cloud.google.com/apis/design/resource_names#relative_resource_name * This field is immutable after creation time. * For example: - * "organizations/123/sources/456" + * "organizations/{organization_id}/sources/{source_id}" * * @property {string} resourceName - * The full resource name of the Google Cloud Platform (GCP) resource this - * finding is for. See: + * For findings on Google Cloud Platform (GCP) resources, the full resource + * name of the GCP resource this finding is for. See: * https://cloud.google.com/apis/design/resource_names#full_resource_name + * When the finding is for a non-GCP resource, the resourceName can be a + * customer or partner defined string. * This field is immutable after creation time. * * @property {number} state @@ -72,8 +74,8 @@ * * @property {Object} eventTime * The time at which the event took place. For example, if the finding - * represents an open firewall it would capture the time the open firewall was - * detected. + * represents an open firewall it would capture the time the detector believes + * the firewall became open. The accuracy is determined by the detector. * * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} * diff --git a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_organization_settings.js b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_organization_settings.js index b4a159eda7e..a9da730be6c 100644 --- a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_organization_settings.js +++ b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_organization_settings.js @@ -23,7 +23,7 @@ * The relative resource name of the settings. See: * https://cloud.google.com/apis/design/resource_names#relative_resource_name * Example: - * "organizations/123/organizationSettings". + * "organizations/{organization_id}/organizationSettings". * * @property {boolean} enableAssetDiscovery * A flag that indicates if Asset Discovery should be enabled. If the flag is diff --git a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_security_marks.js b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_security_marks.js index 9e7cf544ab0..4975a2e35a2 100644 --- a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_security_marks.js +++ b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_security_marks.js @@ -25,15 +25,17 @@ * The relative resource name of the SecurityMarks. See: * https://cloud.google.com/apis/design/resource_names#relative_resource_name * Examples: - * "organizations/123/assets/456/securityMarks" - * "organizations/123/sources/456/findings/789/securityMarks". + * "organizations/{organization_id}/assets/{asset_id}/securityMarks" + * "organizations/{organization_id}/sources/{source_id}/findings/{finding_id}/securityMarks". * * @property {Object.} marks * Mutable user specified security marks belonging to the parent resource. * Constraints are as follows: - * - Keys and values are treated as case insensitive - * - Keys must be alphanumeric and between 1 - 256 characters (inclusive) - * - Values have leading and trailing whitespace trimmed, remaining + * + * * Keys and values are treated as case insensitive + * * Keys must be between 1 - 256 characters (inclusive) + * * Keys must be letters, numbers, underscores, or dashes + * * Values have leading and trailing whitespace trimmed, remaining * characters must be between 1 - 4096 characters (inclusive) * * @typedef SecurityMarks diff --git a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_securitycenter_service.js b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_securitycenter_service.js index c29342073b4..4d63259e480 100644 --- a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_securitycenter_service.js +++ b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_securitycenter_service.js @@ -19,16 +19,16 @@ * Request message for creating a finding. * * @property {string} parent - * Resource name of the new finding's parent. Its format should be + * Required. Resource name of the new finding's parent. Its format should be * "organizations/[organization_id]/sources/[source_id]". * * @property {string} findingId - * Unique identifier provided by the client within the parent scope. + * Required. Unique identifier provided by the client within the parent scope. * It must be alphanumeric and less than or equal to 32 characters and * greater than 0 characters in length. * * @property {Object} finding - * The Finding being created. The name and security_marks will be ignored as + * Required. The Finding being created. The name and security_marks will be ignored as * they are both output only fields on this resource. * * This object should have the same structure as [Finding]{@link google.cloud.securitycenter.v1beta1.Finding} @@ -45,11 +45,11 @@ const CreateFindingRequest = { * Request message for creating a source. * * @property {string} parent - * Resource name of the new source's parent. Its format should be + * Required. Resource name of the new source's parent. Its format should be * "organizations/[organization_id]". * * @property {Object} source - * The Source being created, only the display_name and description will be + * Required. The Source being created, only the display_name and description will be * used. All other fields will be ignored. * * This object should have the same structure as [Source]{@link google.cloud.securitycenter.v1beta1.Source} @@ -66,7 +66,7 @@ const CreateSourceRequest = { * Request message for getting organization settings. * * @property {string} name - * Name of the organization to get organization settings for. Its format is + * Required. Name of the organization to get organization settings for. Its format is * "organizations/[organization_id]/organizationSettings". * * @typedef GetOrganizationSettingsRequest @@ -81,7 +81,7 @@ const GetOrganizationSettingsRequest = { * Request message for getting a source. * * @property {string} name - * Relative resource name of the source. Its format is + * Required. Relative resource name of the source. Its format is * "organizations/[organization_id]/source/[source_id]". * * @typedef GetSourceRequest @@ -96,7 +96,7 @@ const GetSourceRequest = { * Request message for grouping by assets. * * @property {string} parent - * Name of the organization to groupBy. Its format is + * Required. Name of the organization to groupBy. Its format is * "organizations/[organization_id]". * * @property {string} filter @@ -129,7 +129,7 @@ const GetSourceRequest = { * For example, `resource_properties.size = 100` is a valid filter string. * * @property {string} groupBy - * Expression that defines what assets fields to use for grouping. The string + * Required. Expression that defines what assets fields to use for grouping. The string * value should follow SQL syntax: comma separated list of fields. For * example: * "security_center_properties.resource_project,security_center_properties.project". @@ -225,10 +225,10 @@ const GroupAssetsResponse = { * Request message for grouping by findings. * * @property {string} parent - * Name of the source to groupBy. Its format is + * Required. Name of the source to groupBy. Its format is * "organizations/[organization_id]/sources/[source_id]". To groupBy across * all sources provide a source_id of `-`. For example: - * organizations/123/sources/- + * organizations/{organization_id}/sources/- * * @property {string} filter * Expression that defines the filter to apply across findings. @@ -258,7 +258,7 @@ const GroupAssetsResponse = { * For example, `source_properties.size = 100` is a valid filter string. * * @property {string} groupBy - * Expression that defines what assets fields to use for grouping (including + * Required. Expression that defines what assets fields to use for grouping (including * `state`). The string value should follow SQL syntax: comma separated list * of fields. For example: * "parent,resource_name". @@ -343,7 +343,7 @@ const GroupResult = { * Request message for listing sources. * * @property {string} parent - * Resource name of the parent of sources to list. Its format should be + * Required. Resource name of the parent of sources to list. Its format should be * "organizations/[organization_id]". * * @property {string} pageToken @@ -387,7 +387,7 @@ const ListSourcesResponse = { * Request message for listing assets. * * @property {string} parent - * Name of the organization assets should belong to. Its format is + * Required. Name of the organization assets should belong to. Its format is * "organizations/[organization_id]". * * @property {string} filter @@ -465,9 +465,7 @@ const ListSourcesResponse = { * This object should have the same structure as [Duration]{@link google.protobuf.Duration} * * @property {Object} fieldMask - * Optional. - * - * A field mask to specify the ListAssetsResult fields to be listed in the + * Optional. A field mask to specify the ListAssetsResult fields to be listed in the * response. * An empty field mask will list all fields. * @@ -582,10 +580,10 @@ const ListAssetsResponse = { * Request message for listing findings. * * @property {string} parent - * Name of the source the findings belong to. Its format is + * Required. Name of the source the findings belong to. Its format is * "organizations/[organization_id]/sources/[source_id]". To list across all * sources provide a source_id of `-`. For example: - * organizations/123/sources/- + * organizations/{organization_id}/sources/- * * @property {string} filter * Expression that defines the filter to apply across findings. @@ -633,9 +631,7 @@ const ListAssetsResponse = { * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} * * @property {Object} fieldMask - * Optional. - * - * A field mask to specify the Finding fields to be listed in the response. + * Optional. A field mask to specify the Finding fields to be listed in the response. * An empty field mask will list all fields. * * This object should have the same structure as [FieldMask]{@link google.protobuf.FieldMask} @@ -689,18 +685,18 @@ const ListFindingsResponse = { * Request message for updating a finding's state. * * @property {string} name - * The relative resource name of the finding. See: + * Required. The relative resource name of the finding. See: * https://cloud.google.com/apis/design/resource_names#relative_resource_name * Example: - * "organizations/123/sources/456/finding/789". + * "organizations/{organization_id}/sources/{source_id}/finding/{finding_id}". * * @property {number} state - * The desired State of the finding. + * Required. The desired State of the finding. * * The number should be among the values of [State]{@link google.cloud.securitycenter.v1beta1.State} * * @property {Object} startTime - * The time at which the updated state takes effect. + * Required. The time at which the updated state takes effect. * * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} * @@ -716,7 +712,7 @@ const SetFindingStateRequest = { * Request message for running asset discovery for an organization. * * @property {string} parent - * Name of the organization to run asset discovery for. Its format is + * Required. Name of the organization to run asset discovery for. Its format is * "organizations/[organization_id]". * * @typedef RunAssetDiscoveryRequest @@ -731,7 +727,7 @@ const RunAssetDiscoveryRequest = { * Request message for updating or creating a finding. * * @property {Object} finding - * The finding resource to update or create if it does not already exist. + * Required. The finding resource to update or create if it does not already exist. * parent, security_marks, and update_time will be ignored. * * In the case of creation, the finding id portion of the name must @@ -758,7 +754,7 @@ const UpdateFindingRequest = { * Request message for updating an organization's settings. * * @property {Object} organizationSettings - * The organization settings resource to update. + * Required. The organization settings resource to update. * * This object should have the same structure as [OrganizationSettings]{@link google.cloud.securitycenter.v1beta1.OrganizationSettings} * @@ -779,7 +775,7 @@ const UpdateOrganizationSettingsRequest = { * Request message for updating a source. * * @property {Object} source - * The source resource to update. + * Required. The source resource to update. * * This object should have the same structure as [Source]{@link google.cloud.securitycenter.v1beta1.Source} * @@ -800,7 +796,7 @@ const UpdateSourceRequest = { * Request message for updating a SecurityMarks resource. * * @property {Object} securityMarks - * The security marks resource to update. + * Required. The security marks resource to update. * * This object should have the same structure as [SecurityMarks]{@link google.cloud.securitycenter.v1beta1.SecurityMarks} * diff --git a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_source.js b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_source.js index 676e8bd25f2..9e7cbb4e0fa 100644 --- a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_source.js +++ b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_source.js @@ -24,16 +24,14 @@ * The relative resource name of this source. See: * https://cloud.google.com/apis/design/resource_names#relative_resource_name * Example: - * "organizations/123/sources/456" + * "organizations/{organization_id}/sources/{source_id}" * * @property {string} displayName * The source's display name. * A source's display name must be unique amongst its siblings, for example, * two sources with the same parent can't share the same display name. - * The display name must start and end with a letter or digit, may contain - * letters, digits, spaces, hyphens, and underscores, and can be no longer - * than 32 characters. This is captured by the regular expression: - * `\[\p{L}\p{N}]({\p{L}\p{N}_- ]{0,30}[\p{L}\p{N}])?`. + * The display name must have a length between 1 and 64 characters + * (inclusive). * * @property {string} description * The description of the source (max of 1024 characters). diff --git a/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.js b/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.js index 596fa7a2d85..4402a128dbe 100644 --- a/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.js +++ b/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.js @@ -316,10 +316,10 @@ class SecurityCenterClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Resource name of the new source's parent. Its format should be + * Required. Resource name of the new source's parent. Its format should be * "organizations/[organization_id]". * @param {Object} request.source - * The Source being created, only the display_name and description will be + * Required. The Source being created, only the display_name and description will be * used. All other fields will be ignored. * * This object should have the same structure as [Source]{@link google.cloud.securitycenter.v1beta1.Source} @@ -382,14 +382,14 @@ class SecurityCenterClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Resource name of the new finding's parent. Its format should be + * Required. Resource name of the new finding's parent. Its format should be * "organizations/[organization_id]/sources/[source_id]". * @param {string} request.findingId - * Unique identifier provided by the client within the parent scope. + * Required. Unique identifier provided by the client within the parent scope. * It must be alphanumeric and less than or equal to 32 characters and * greater than 0 characters in length. * @param {Object} request.finding - * The Finding being created. The name and security_marks will be ignored as + * Required. The Finding being created. The name and security_marks will be ignored as * they are both output only fields on this resource. * * This object should have the same structure as [Finding]{@link google.cloud.securitycenter.v1beta1.Finding} @@ -513,7 +513,7 @@ class SecurityCenterClient { * @param {Object} request * The request object that will be sent. * @param {string} request.name - * Name of the organization to get organization settings for. Its format is + * Required. Name of the organization to get organization settings for. Its format is * "organizations/[organization_id]/organizationSettings". * @param {Object} [options] * Optional parameters. You can override the default settings for this call, e.g, timeout, @@ -572,7 +572,7 @@ class SecurityCenterClient { * @param {Object} request * The request object that will be sent. * @param {string} request.name - * Relative resource name of the source. Its format is + * Required. Relative resource name of the source. Its format is * "organizations/[organization_id]/source/[source_id]". * @param {Object} [options] * Optional parameters. You can override the default settings for this call, e.g, timeout, @@ -628,10 +628,10 @@ class SecurityCenterClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Name of the organization to groupBy. Its format is + * Required. Name of the organization to groupBy. Its format is * "organizations/[organization_id]". * @param {string} request.groupBy - * Expression that defines what assets fields to use for grouping. The string + * Required. Expression that defines what assets fields to use for grouping. The string * value should follow SQL syntax: comma separated list of fields. For * example: * "security_center_properties.resource_project,security_center_properties.project". @@ -825,10 +825,10 @@ class SecurityCenterClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Name of the organization to groupBy. Its format is + * Required. Name of the organization to groupBy. Its format is * "organizations/[organization_id]". * @param {string} request.groupBy - * Expression that defines what assets fields to use for grouping. The string + * Required. Expression that defines what assets fields to use for grouping. The string * value should follow SQL syntax: comma separated list of fields. For * example: * "security_center_properties.resource_project,security_center_properties.project". @@ -949,17 +949,17 @@ class SecurityCenterClient { * specified properties. * * To group across all sources provide a `-` as the source id. - * Example: /v1beta1/organizations/123/sources/-/findings + * Example: /v1beta1/organizations/{organization_id}/sources/-/findings * * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Name of the source to groupBy. Its format is + * Required. Name of the source to groupBy. Its format is * "organizations/[organization_id]/sources/[source_id]". To groupBy across * all sources provide a source_id of `-`. For example: - * organizations/123/sources/- + * organizations/{organization_id}/sources/- * @param {string} request.groupBy - * Expression that defines what assets fields to use for grouping (including + * Required. Expression that defines what assets fields to use for grouping (including * `state`). The string value should follow SQL syntax: comma separated list * of fields. For example: * "parent,resource_name". @@ -1124,12 +1124,12 @@ class SecurityCenterClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Name of the source to groupBy. Its format is + * Required. Name of the source to groupBy. Its format is * "organizations/[organization_id]/sources/[source_id]". To groupBy across * all sources provide a source_id of `-`. For example: - * organizations/123/sources/- + * organizations/{organization_id}/sources/- * @param {string} request.groupBy - * Expression that defines what assets fields to use for grouping (including + * Required. Expression that defines what assets fields to use for grouping (including * `state`). The string value should follow SQL syntax: comma separated list * of fields. For example: * "parent,resource_name". @@ -1222,7 +1222,7 @@ class SecurityCenterClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Name of the organization assets should belong to. Its format is + * Required. Name of the organization assets should belong to. Its format is * "organizations/[organization_id]". * @param {string} [request.filter] * Expression that defines the filter to apply across assets. @@ -1295,9 +1295,7 @@ class SecurityCenterClient { * * This object should have the same structure as [Duration]{@link google.protobuf.Duration} * @param {Object} [request.fieldMask] - * Optional. - * - * A field mask to specify the ListAssetsResult fields to be listed in the + * Optional. A field mask to specify the ListAssetsResult fields to be listed in the * response. * An empty field mask will list all fields. * @@ -1413,7 +1411,7 @@ class SecurityCenterClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Name of the organization assets should belong to. Its format is + * Required. Name of the organization assets should belong to. Its format is * "organizations/[organization_id]". * @param {string} [request.filter] * Expression that defines the filter to apply across assets. @@ -1486,9 +1484,7 @@ class SecurityCenterClient { * * This object should have the same structure as [Duration]{@link google.protobuf.Duration} * @param {Object} [request.fieldMask] - * Optional. - * - * A field mask to specify the ListAssetsResult fields to be listed in the + * Optional. A field mask to specify the ListAssetsResult fields to be listed in the * response. * An empty field mask will list all fields. * @@ -1535,15 +1531,15 @@ class SecurityCenterClient { * Lists an organization or source's findings. * * To list across all sources provide a `-` as the source id. - * Example: /v1beta1/organizations/123/sources/-/findings + * Example: /v1beta1/organizations/{organization_id}/sources/-/findings * * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Name of the source the findings belong to. Its format is + * Required. Name of the source the findings belong to. Its format is * "organizations/[organization_id]/sources/[source_id]". To list across all * sources provide a source_id of `-`. For example: - * organizations/123/sources/- + * organizations/{organization_id}/sources/- * @param {string} [request.filter] * Expression that defines the filter to apply across findings. * The expression is a list of one or more restrictions combined via logical @@ -1587,9 +1583,7 @@ class SecurityCenterClient { * * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} * @param {Object} [request.fieldMask] - * Optional. - * - * A field mask to specify the Finding fields to be listed in the response. + * Optional. A field mask to specify the Finding fields to be listed in the response. * An empty field mask will list all fields. * * This object should have the same structure as [FieldMask]{@link google.protobuf.FieldMask} @@ -1704,10 +1698,10 @@ class SecurityCenterClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Name of the source the findings belong to. Its format is + * Required. Name of the source the findings belong to. Its format is * "organizations/[organization_id]/sources/[source_id]". To list across all * sources provide a source_id of `-`. For example: - * organizations/123/sources/- + * organizations/{organization_id}/sources/- * @param {string} [request.filter] * Expression that defines the filter to apply across findings. * The expression is a list of one or more restrictions combined via logical @@ -1751,9 +1745,7 @@ class SecurityCenterClient { * * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} * @param {Object} [request.fieldMask] - * Optional. - * - * A field mask to specify the Finding fields to be listed in the response. + * Optional. A field mask to specify the Finding fields to be listed in the response. * An empty field mask will list all fields. * * This object should have the same structure as [FieldMask]{@link google.protobuf.FieldMask} @@ -1801,7 +1793,7 @@ class SecurityCenterClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Resource name of the parent of sources to list. Its format should be + * Required. Resource name of the parent of sources to list. Its format should be * "organizations/[organization_id]". * @param {number} [request.pageSize] * The maximum number of resources contained in the underlying API @@ -1914,7 +1906,7 @@ class SecurityCenterClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Resource name of the parent of sources to list. Its format should be + * Required. Resource name of the parent of sources to list. Its format should be * "organizations/[organization_id]". * @param {number} [request.pageSize] * The maximum number of resources contained in the underlying API @@ -1965,7 +1957,7 @@ class SecurityCenterClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Name of the organization to run asset discovery for. Its format is + * Required. Name of the organization to run asset discovery for. Its format is * "organizations/[organization_id]". * @param {Object} [options] * Optional parameters. You can override the default settings for this call, e.g, timeout, @@ -2064,16 +2056,16 @@ class SecurityCenterClient { * @param {Object} request * The request object that will be sent. * @param {string} request.name - * The relative resource name of the finding. See: + * Required. The relative resource name of the finding. See: * https://cloud.google.com/apis/design/resource_names#relative_resource_name * Example: - * "organizations/123/sources/456/finding/789". + * "organizations/{organization_id}/sources/{source_id}/finding/{finding_id}". * @param {number} request.state - * The desired State of the finding. + * Required. The desired State of the finding. * * The number should be among the values of [State]{@link google.cloud.securitycenter.v1beta1.State} * @param {Object} request.startTime - * The time at which the updated state takes effect. + * Required. The time at which the updated state takes effect. * * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} * @param {Object} [options] @@ -2269,7 +2261,7 @@ class SecurityCenterClient { * @param {Object} request * The request object that will be sent. * @param {Object} request.finding - * The finding resource to update or create if it does not already exist. + * Required. The finding resource to update or create if it does not already exist. * parent, security_marks, and update_time will be ignored. * * In the case of creation, the finding id portion of the name must @@ -2335,7 +2327,7 @@ class SecurityCenterClient { * @param {Object} request * The request object that will be sent. * @param {Object} request.organizationSettings - * The organization settings resource to update. + * Required. The organization settings resource to update. * * This object should have the same structure as [OrganizationSettings]{@link google.cloud.securitycenter.v1beta1.OrganizationSettings} * @param {Object} [request.updateMask] @@ -2399,7 +2391,7 @@ class SecurityCenterClient { * @param {Object} request * The request object that will be sent. * @param {Object} request.source - * The source resource to update. + * Required. The source resource to update. * * This object should have the same structure as [Source]{@link google.cloud.securitycenter.v1beta1.Source} * @param {Object} [request.updateMask] @@ -2459,7 +2451,7 @@ class SecurityCenterClient { * @param {Object} request * The request object that will be sent. * @param {Object} request.securityMarks - * The security marks resource to update. + * Required. The security marks resource to update. * * This object should have the same structure as [SecurityMarks]{@link google.cloud.securitycenter.v1beta1.SecurityMarks} * @param {Object} [request.updateMask] diff --git a/packages/google-cloud-securitycenter/synth.metadata b/packages/google-cloud-securitycenter/synth.metadata index db8fd3cfa40..12fa18facde 100644 --- a/packages/google-cloud-securitycenter/synth.metadata +++ b/packages/google-cloud-securitycenter/synth.metadata @@ -1,19 +1,19 @@ { - "updateTime": "2019-12-10T12:23:11.737877Z", + "updateTime": "2019-12-19T12:23:08.028182Z", "sources": [ { "generator": { "name": "artman", - "version": "0.42.1", - "dockerImage": "googleapis/artman@sha256:c773192618c608a7a0415dd95282f841f8e6bcdef7dd760a988c93b77a64bd57" + "version": "0.42.3", + "dockerImage": "googleapis/artman@sha256:feed210b5723c6f524b52ef6d7740a030f2d1a8f7c29a71c5e5b4481ceaad7f5" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "6cc9499e225a4f6a5e34fe07e390f67055d7991c", - "internalRef": "284643689" + "sha": "d400cb8d45df5b2ae796b909f098a215b2275c1d", + "internalRef": "286312673" } }, { @@ -45,5 +45,2482 @@ "config": "google/cloud/securitycenter/artman_securitycenter_v1.yaml" } } + ], + "newFiles": [ + { + "path": "renovate.json" + }, + { + "path": ".prettierrc" + }, + { + "path": ".nycrc" + }, + { + "path": "webpack.config.js" + }, + { + "path": "README.md" + }, + { + "path": "synth.py" + }, + { + "path": ".eslintignore" + }, + { + "path": ".gitignore" + }, + { + "path": "LICENSE" + }, + { + "path": ".repo-metadata.json" + }, + { + "path": "CONTRIBUTING.md" + }, + { + "path": "synth.metadata" + }, + { + "path": "CODE_OF_CONDUCT.md" + }, + { + "path": "CHANGELOG.md" + }, + { + "path": ".prettierignore" + }, + { + "path": "linkinator.config.json" + }, + { + "path": "package.json" + }, + { + "path": "package-lock.json" + }, + { + "path": "codecov.yaml" + }, + { + "path": ".eslintrc.yml" + }, + { + "path": ".jsdoc.js" + }, + { + "path": ".readme-partials.yaml" + }, + { + "path": "protos/protos.d.ts" + }, + { + "path": "protos/protos.js" + }, + { + "path": "protos/protos.json" + }, + { + "path": "protos/google/cloud/securitycenter/v1beta1/finding.proto" + }, + { + "path": "protos/google/cloud/securitycenter/v1beta1/run_asset_discovery_response.proto" + }, + { + "path": "protos/google/cloud/securitycenter/v1beta1/security_marks.proto" + }, + { + "path": "protos/google/cloud/securitycenter/v1beta1/securitycenter_service.proto" + }, + { + "path": "protos/google/cloud/securitycenter/v1beta1/organization_settings.proto" + }, + { + "path": "protos/google/cloud/securitycenter/v1beta1/source.proto" + }, + { + "path": "protos/google/cloud/securitycenter/v1beta1/asset.proto" + }, + { + "path": "protos/google/cloud/securitycenter/v1/finding.proto" + }, + { + "path": "protos/google/cloud/securitycenter/v1/run_asset_discovery_response.proto" + }, + { + "path": "protos/google/cloud/securitycenter/v1/security_marks.proto" + }, + { + "path": "protos/google/cloud/securitycenter/v1/securitycenter_service.proto" + }, + { + "path": "protos/google/cloud/securitycenter/v1/organization_settings.proto" + }, + { + "path": "protos/google/cloud/securitycenter/v1/source.proto" + }, + { + "path": "protos/google/cloud/securitycenter/v1/asset.proto" + }, + { + "path": ".git/config" + }, + { + "path": ".git/index" + }, + { + "path": ".git/shallow" + }, + { + "path": ".git/HEAD" + }, + { + "path": ".git/packed-refs" + }, + { + "path": ".git/refs/tags/v2.3.0" + }, + { + "path": ".git/refs/remotes/origin/HEAD" + }, + { + "path": ".git/refs/heads/autosynth" + }, + { + "path": ".git/refs/heads/master" + }, + { + "path": ".git/objects/pack/pack-37ef62494e0563d925a784c196add9f1586b4dfb.idx" + }, + { + "path": ".git/objects/pack/pack-37ef62494e0563d925a784c196add9f1586b4dfb.pack" + }, + { + "path": ".git/logs/HEAD" + }, + { + "path": ".git/logs/refs/remotes/origin/HEAD" + }, + { + "path": ".git/logs/refs/heads/autosynth" + }, + { + "path": ".git/logs/refs/heads/master" + }, + { + "path": "samples/README.md" + }, + { + "path": "samples/quickstart.js" + }, + { + "path": "samples/package.json" + }, + { + "path": "samples/.eslintrc.yml" + }, + { + "path": "samples/system-test/quickstart.test.js" + }, + { + "path": "samples/system-test/.eslintrc.yml" + }, + { + "path": "samples/system-test/v1/listAssetsAndChanges.test.js" + }, + { + "path": "samples/system-test/v1/listFilteredAssets.test.js" + }, + { + "path": "samples/system-test/v1/listAllAssets.test.js" + }, + { + "path": "samples/system-test/v1/findings.test.js" + }, + { + "path": "samples/system-test/v1/listAssetsAtTime.test.js" + }, + { + "path": "samples/system-test/v1/orgSettings.test.js" + }, + { + "path": "samples/system-test/v1/assetSecurityMarks.test.js" + }, + { + "path": "samples/v1/setSourceIam.js" + }, + { + "path": "samples/v1/updateSource.js" + }, + { + "path": "samples/v1/getSource.js" + }, + { + "path": "samples/v1/listFilteredAssets.js" + }, + { + "path": "samples/v1/enableAssetDiscovery.js" + }, + { + "path": "samples/v1/listFindingsAtTime.js" + }, + { + "path": "samples/v1/getSourceIam.js" + }, + { + "path": "samples/v1/listAllFindings.js" + }, + { + "path": "samples/v1/deleteSecurityMarks.js" + }, + { + "path": "samples/v1/getOrganizationSettings.js" + }, + { + "path": "samples/v1/addDeleteSecurityMarks.js" + }, + { + "path": "samples/v1/listAllSources.js" + }, + { + "path": "samples/v1/createSource.js" + }, + { + "path": "samples/v1/listAssetsWithSecurityMarks.js" + }, + { + "path": "samples/v1/listAssetsAndChanges.js" + }, + { + "path": "samples/v1/addSecurityMarks.js" + }, + { + "path": "samples/v1/setFindingState.js" + }, + { + "path": "samples/v1/createFinding.js" + }, + { + "path": "samples/v1/listAllAssets.js" + }, + { + "path": "samples/v1/createFindingSourceProperties.js" + }, + { + "path": "samples/v1/listAssetsAtTime.js" + }, + { + "path": "samples/v1/listFilteredFindings.js" + }, + { + "path": "samples/v1/addFindingSecurityMarks.js" + }, + { + "path": "samples/v1/testIam.js" + }, + { + "path": "samples/v1/listFindingsWithSecurityMarks.js" + }, + { + "path": "samples/v1/updateFindingSourceProperties.js" + }, + { + "path": "__pycache__/synth.cpython-36.pyc" + }, + { + "path": "node_modules/shebang-command/package.json" + }, + { + "path": "node_modules/range-parser/package.json" + }, + { + "path": "node_modules/esprima/package.json" + }, + { + "path": "node_modules/empower-assert/package.json" + }, + { + "path": "node_modules/widest-line/package.json" + }, + { + "path": "node_modules/widest-line/node_modules/ansi-regex/package.json" + }, + { + "path": "node_modules/widest-line/node_modules/strip-ansi/package.json" + }, + { + "path": "node_modules/widest-line/node_modules/is-fullwidth-code-point/package.json" + }, + { + "path": "node_modules/widest-line/node_modules/string-width/package.json" + }, + { + "path": "node_modules/is-obj/package.json" + }, + { + "path": "node_modules/is-arrayish/package.json" + }, + { + "path": "node_modules/ansi-align/package.json" + }, + { + "path": "node_modules/ansi-align/node_modules/is-fullwidth-code-point/package.json" + }, + { + "path": "node_modules/ansi-align/node_modules/string-width/package.json" + }, + { + "path": "node_modules/ansi-align/node_modules/emoji-regex/package.json" + }, + { + "path": "node_modules/css-what/package.json" + }, + { + "path": "node_modules/spdx-expression-parse/package.json" + }, + { + "path": "node_modules/graceful-fs/package.json" + }, + { + "path": "node_modules/istanbul-reports/package.json" + }, + { + "path": "node_modules/y18n/package.json" + }, + { + "path": "node_modules/eventemitter3/package.json" + }, + { + "path": "node_modules/minimatch/package.json" + }, + { + "path": "node_modules/object.assign/package.json" + }, + { + "path": "node_modules/gtoken/package.json" + }, + { + "path": "node_modules/chalk/package.json" + }, + { + "path": "node_modules/gcp-metadata/package.json" + }, + { + "path": "node_modules/prelude-ls/package.json" + }, + { + "path": "node_modules/fast-json-stable-stringify/package.json" + }, + { + "path": "node_modules/espower-loader/package.json" + }, + { + "path": "node_modules/is-url/package.json" + }, + { + "path": "node_modules/responselike/package.json" + }, + { + "path": "node_modules/got/package.json" + }, + { + "path": "node_modules/got/node_modules/get-stream/package.json" + }, + { + "path": "node_modules/growl/package.json" + }, + { + "path": "node_modules/hasha/package.json" + }, + { + "path": "node_modules/hasha/node_modules/is-stream/package.json" + }, + { + "path": "node_modules/he/package.json" + }, + { + "path": "node_modules/end-of-stream/package.json" + }, + { + "path": "node_modules/isexe/package.json" + }, + { + "path": "node_modules/source-map/package.json" + }, + { + "path": "node_modules/escope/package.json" + }, + { + "path": "node_modules/meow/package.json" + }, + { + "path": "node_modules/has-flag/package.json" + }, + { + "path": "node_modules/encodeurl/package.json" + }, + { + "path": "node_modules/multi-stage-sourcemap/package.json" + }, + { + "path": "node_modules/multi-stage-sourcemap/node_modules/source-map/package.json" + }, + { + "path": "node_modules/jwa/package.json" + }, + { + "path": "node_modules/parent-module/package.json" + }, + { + "path": "node_modules/server-destroy/package.json" + }, + { + "path": "node_modules/p-queue/package.json" + }, + { + "path": "node_modules/esutils/package.json" + }, + { + "path": "node_modules/espurify/package.json" + }, + { + "path": "node_modules/write-file-atomic/package.json" + }, + { + "path": "node_modules/es6-set/package.json" + }, + { + "path": "node_modules/es6-set/node_modules/es6-symbol/package.json" + }, + { + "path": "node_modules/path-parse/package.json" + }, + { + "path": "node_modules/iconv-lite/package.json" + }, + { + "path": "node_modules/ecdsa-sig-formatter/package.json" + }, + { + "path": "node_modules/yargs/package.json" + }, + { + "path": "node_modules/yargs/node_modules/p-limit/package.json" + }, + { + "path": "node_modules/yargs/node_modules/locate-path/package.json" + }, + { + "path": "node_modules/yargs/node_modules/find-up/package.json" + }, + { + "path": "node_modules/yargs/node_modules/is-fullwidth-code-point/package.json" + }, + { + "path": "node_modules/yargs/node_modules/string-width/package.json" + }, + { + "path": "node_modules/yargs/node_modules/yargs-parser/package.json" + }, + { + "path": "node_modules/yargs/node_modules/p-try/package.json" + }, + { + "path": "node_modules/yargs/node_modules/p-locate/package.json" + }, + { + "path": "node_modules/yargs/node_modules/camelcase/package.json" + }, + { + "path": "node_modules/yargs/node_modules/emoji-regex/package.json" + }, + { + "path": "node_modules/external-editor/package.json" + }, + { + "path": "node_modules/string.prototype.trimright/package.json" + }, + { + "path": "node_modules/is-installed-globally/package.json" + }, + { + "path": "node_modules/fast-deep-equal/package.json" + }, + { + "path": "node_modules/css-select/package.json" + }, + { + "path": "node_modules/core-util-is/package.json" + }, + { + "path": "node_modules/empower/package.json" + }, + { + "path": "node_modules/path-type/package.json" + }, + { + "path": "node_modules/define-properties/package.json" + }, + { + "path": "node_modules/resolve/package.json" + }, + { + "path": "node_modules/object-keys/package.json" + }, + { + "path": "node_modules/parseurl/package.json" + }, + { + "path": "node_modules/statuses/package.json" + }, + { + "path": "node_modules/p-limit/package.json" + }, + { + "path": "node_modules/destroy/package.json" + }, + { + "path": "node_modules/read-pkg-up/package.json" + }, + { + "path": "node_modules/path-is-absolute/package.json" + }, + { + "path": "node_modules/punycode/package.json" + }, + { + "path": "node_modules/error-ex/package.json" + }, + { + "path": "node_modules/boolbase/package.json" + }, + { + "path": "node_modules/@sindresorhus/is/package.json" + }, + { + "path": "node_modules/mimic-response/package.json" + }, + { + "path": "node_modules/indent-string/package.json" + }, + { + "path": "node_modules/append-transform/package.json" + }, + { + "path": "node_modules/neo-async/package.json" + }, + { + "path": "node_modules/diff-match-patch/package.json" + }, + { + "path": "node_modules/jsesc/package.json" + }, + { + "path": "node_modules/power-assert-context-formatter/package.json" + }, + { + "path": "node_modules/is-symbol/package.json" + }, + { + "path": "node_modules/through/package.json" + }, + { + "path": "node_modules/http-cache-semantics/package.json" + }, + { + "path": "node_modules/ms/package.json" + }, + { + "path": "node_modules/nice-try/package.json" + }, + { + "path": "node_modules/js2xmlparser/package.json" + }, + { + "path": "node_modules/mimic-fn/package.json" + }, + { + "path": "node_modules/which-module/package.json" + }, + { + "path": "node_modules/debug/package.json" + }, + { + "path": "node_modules/path-key/package.json" + }, + { + "path": "node_modules/imurmurhash/package.json" + }, + { + "path": "node_modules/catharsis/package.json" + }, + { + "path": "node_modules/node-environment-flags/package.json" + }, + { + "path": "node_modules/node-environment-flags/node_modules/semver/package.json" + }, + { + "path": "node_modules/require-directory/package.json" + }, + { + "path": "node_modules/merge-estraverse-visitors/package.json" + }, + { + "path": "node_modules/js-yaml/package.json" + }, + { + "path": "node_modules/p-finally/package.json" + }, + { + "path": "node_modules/next-tick/package.json" + }, + { + "path": "node_modules/mime/package.json" + }, + { + "path": "node_modules/es-to-primitive/package.json" + }, + { + "path": "node_modules/callsites/package.json" + }, + { + "path": "node_modules/parse5/package.json" + }, + { + "path": "node_modules/configstore/package.json" + }, + { + "path": "node_modules/unpipe/package.json" + }, + { + "path": "node_modules/merge-source-map/package.json" + }, + { + "path": "node_modules/agent-base/package.json" + }, + { + "path": "node_modules/extend/package.json" + }, + { + "path": "node_modules/eslint-utils/package.json" + }, + { + "path": "node_modules/is-promise/package.json" + }, + { + "path": "node_modules/rimraf/package.json" + }, + { + "path": "node_modules/inquirer/package.json" + }, + { + "path": "node_modules/concat-map/package.json" + }, + { + "path": "node_modules/word-wrap/package.json" + }, + { + "path": "node_modules/fresh/package.json" + }, + { + "path": "node_modules/deep-extend/package.json" + }, + { + "path": "node_modules/glob-parent/package.json" + }, + { + "path": "node_modules/node-fetch/package.json" + }, + { + "path": "node_modules/indexof/package.json" + }, + { + "path": "node_modules/power-assert-renderer-comparison/package.json" + }, + { + "path": "node_modules/package-hash/package.json" + }, + { + "path": "node_modules/es5-ext/package.json" + }, + { + "path": "node_modules/@grpc/grpc-js/package.json" + }, + { + "path": "node_modules/@grpc/proto-loader/package.json" + }, + { + "path": "node_modules/espower-location-detector/package.json" + }, + { + "path": "node_modules/espower-location-detector/node_modules/source-map/package.json" + }, + { + "path": "node_modules/brace-expansion/package.json" + }, + { + "path": "node_modules/p-timeout/package.json" + }, + { + "path": "node_modules/js-tokens/package.json" + }, + { + "path": "node_modules/onetime/package.json" + }, + { + "path": "node_modules/empower-core/package.json" + }, + { + "path": "node_modules/safe-buffer/package.json" + }, + { + "path": "node_modules/loud-rejection/package.json" + }, + { + "path": "node_modules/type-fest/package.json" + }, + { + "path": "node_modules/es6-symbol/package.json" + }, + { + "path": "node_modules/es6-promisify/package.json" + }, + { + "path": "node_modules/serve-static/package.json" + }, + { + "path": "node_modules/unique-string/package.json" + }, + { + "path": "node_modules/boxen/package.json" + }, + { + "path": "node_modules/boxen/node_modules/type-fest/package.json" + }, + { + "path": "node_modules/boxen/node_modules/is-fullwidth-code-point/package.json" + }, + { + "path": "node_modules/boxen/node_modules/string-width/package.json" + }, + { + "path": "node_modules/boxen/node_modules/camelcase/package.json" + }, + { + "path": "node_modules/boxen/node_modules/emoji-regex/package.json" + }, + { + "path": "node_modules/jsdoc-fresh/package.json" + }, + { + "path": "node_modules/jsdoc-fresh/node_modules/taffydb/package.json" + }, + { + "path": "node_modules/ini/package.json" + }, + { + "path": "node_modules/mdurl/package.json" + }, + { + "path": "node_modules/http-errors/package.json" + }, + { + "path": "node_modules/global-dirs/package.json" + }, + { + "path": "node_modules/type-name/package.json" + }, + { + "path": "node_modules/buffer-equal-constant-time/package.json" + }, + { + "path": "node_modules/es6-promise/package.json" + }, + { + "path": "node_modules/normalize-url/package.json" + }, + { + "path": "node_modules/registry-url/package.json" + }, + { + "path": "node_modules/pseudomap/package.json" + }, + { + "path": "node_modules/latest-version/package.json" + }, + { + "path": "node_modules/espower/package.json" + }, + { + "path": "node_modules/espower/node_modules/source-map/package.json" + }, + { + "path": "node_modules/isarray/package.json" + }, + { + "path": "node_modules/cacheable-request/package.json" + }, + { + "path": "node_modules/cacheable-request/node_modules/get-stream/package.json" + }, + { + "path": "node_modules/cacheable-request/node_modules/lowercase-keys/package.json" + }, + { + "path": "node_modules/toidentifier/package.json" + }, + { + "path": "node_modules/to-readable-stream/package.json" + }, + { + "path": "node_modules/quick-lru/package.json" + }, + { + "path": "node_modules/regexp.prototype.flags/package.json" + }, + { + "path": "node_modules/which/package.json" + }, + { + "path": "node_modules/spdx-correct/package.json" + }, + { + "path": "node_modules/escape-string-regexp/package.json" + }, + { + "path": "node_modules/ansi-regex/package.json" + }, + { + "path": "node_modules/wrap-ansi/package.json" + }, + { + "path": "node_modules/wrap-ansi/node_modules/is-fullwidth-code-point/package.json" + }, + { + "path": "node_modules/wrap-ansi/node_modules/string-width/package.json" + }, + { + "path": "node_modules/wrap-ansi/node_modules/emoji-regex/package.json" + }, + { + "path": "node_modules/update-notifier/package.json" + }, + { + "path": "node_modules/strip-indent/package.json" + }, + { + "path": "node_modules/has/package.json" + }, + { + "path": "node_modules/release-zalgo/package.json" + }, + { + "path": "node_modules/browser-stdout/package.json" + }, + { + "path": "node_modules/esquery/package.json" + }, + { + "path": "node_modules/bluebird/package.json" + }, + { + "path": "node_modules/ext/package.json" + }, + { + "path": "node_modules/ext/node_modules/type/package.json" + }, + { + "path": "node_modules/argparse/package.json" + }, + { + "path": "node_modules/is-ci/package.json" + }, + { + "path": "node_modules/escallmatch/package.json" + }, + { + "path": "node_modules/escallmatch/node_modules/esprima/package.json" + }, + { + "path": "node_modules/google-p12-pem/package.json" + }, + { + "path": "node_modules/d/package.json" + }, + { + "path": "node_modules/acorn-jsx/package.json" + }, + { + "path": "node_modules/text-table/package.json" + }, + { + "path": "node_modules/color-name/package.json" + }, + { + "path": "node_modules/linkify-it/package.json" + }, + { + "path": "node_modules/minimist/package.json" + }, + { + "path": "node_modules/pump/package.json" + }, + { + "path": "node_modules/util-deprecate/package.json" + }, + { + "path": "node_modules/flat/package.json" + }, + { + "path": "node_modules/load-json-file/package.json" + }, + { + "path": "node_modules/locate-path/package.json" + }, + { + "path": "node_modules/is-regex/package.json" + }, + { + "path": "node_modules/eslint-plugin-node/package.json" + }, + { + "path": "node_modules/eslint-plugin-node/node_modules/ignore/package.json" + }, + { + "path": "node_modules/yallist/package.json" + }, + { + "path": "node_modules/semver-diff/package.json" + }, + { + "path": "node_modules/semver-diff/node_modules/semver/package.json" + }, + { + "path": "node_modules/ansi-colors/package.json" + }, + { + "path": "node_modules/file-entry-cache/package.json" + }, + { + "path": "node_modules/fs.realpath/package.json" + }, + { + "path": "node_modules/execa/package.json" + }, + { + "path": "node_modules/execa/node_modules/yallist/package.json" + }, + { + "path": "node_modules/execa/node_modules/cross-spawn/package.json" + }, + { + "path": "node_modules/execa/node_modules/lru-cache/package.json" + }, + { + "path": "node_modules/execa/node_modules/is-stream/package.json" + }, + { + "path": "node_modules/clone-response/package.json" + }, + { + "path": "node_modules/object-is/package.json" + }, + { + "path": "node_modules/rxjs/package.json" + }, + { + "path": "node_modules/teeny-request/package.json" + }, + { + "path": "node_modules/teeny-request/node_modules/https-proxy-agent/package.json" + }, + { + "path": "node_modules/spawn-wrap/package.json" + }, + { + "path": "node_modules/istanbul-lib-instrument/package.json" + }, + { + "path": "node_modules/eslint-plugin-es/package.json" + }, + { + "path": "node_modules/eslint-plugin-es/node_modules/regexpp/package.json" + }, + { + "path": "node_modules/signal-exit/package.json" + }, + { + "path": "node_modules/json-bigint/package.json" + }, + { + "path": "node_modules/es6-error/package.json" + }, + { + "path": "node_modules/through2/package.json" + }, + { + "path": "node_modules/minimist-options/package.json" + }, + { + "path": "node_modules/minimist-options/node_modules/arrify/package.json" + }, + { + "path": "node_modules/cp-file/package.json" + }, + { + "path": "node_modules/cp-file/node_modules/make-dir/package.json" + }, + { + "path": "node_modules/cp-file/node_modules/pify/package.json" + }, + { + "path": "node_modules/cp-file/node_modules/semver/package.json" + }, + { + "path": "node_modules/nyc/package.json" + }, + { + "path": "node_modules/nyc/node_modules/p-limit/package.json" + }, + { + "path": "node_modules/nyc/node_modules/locate-path/package.json" + }, + { + "path": "node_modules/nyc/node_modules/find-up/package.json" + }, + { + "path": "node_modules/nyc/node_modules/make-dir/package.json" + }, + { + "path": "node_modules/nyc/node_modules/pify/package.json" + }, + { + "path": "node_modules/nyc/node_modules/yargs-parser/package.json" + }, + { + "path": "node_modules/nyc/node_modules/p-try/package.json" + }, + { + "path": "node_modules/nyc/node_modules/p-locate/package.json" + }, + { + "path": "node_modules/nyc/node_modules/semver/package.json" + }, + { + "path": "node_modules/nyc/node_modules/camelcase/package.json" + }, + { + "path": "node_modules/depd/package.json" + }, + { + "path": "node_modules/table/package.json" + }, + { + "path": "node_modules/table/node_modules/is-fullwidth-code-point/package.json" + }, + { + "path": "node_modules/table/node_modules/string-width/package.json" + }, + { + "path": "node_modules/table/node_modules/emoji-regex/package.json" + }, + { + "path": "node_modules/is-extglob/package.json" + }, + { + "path": "node_modules/ci-info/package.json" + }, + { + "path": "node_modules/lodash.has/package.json" + }, + { + "path": "node_modules/require-main-filename/package.json" + }, + { + "path": "node_modules/foreground-child/package.json" + }, + { + "path": "node_modules/foreground-child/node_modules/yallist/package.json" + }, + { + "path": "node_modules/foreground-child/node_modules/cross-spawn/package.json" + }, + { + "path": "node_modules/foreground-child/node_modules/lru-cache/package.json" + }, + { + "path": "node_modules/xtend/package.json" + }, + { + "path": "node_modules/markdown-it-anchor/package.json" + }, + { + "path": "node_modules/string_decoder/package.json" + }, + { + "path": "node_modules/node-forge/package.json" + }, + { + "path": "node_modules/type/package.json" + }, + { + "path": "node_modules/test-exclude/package.json" + }, + { + "path": "node_modules/test-exclude/node_modules/p-limit/package.json" + }, + { + "path": "node_modules/test-exclude/node_modules/read-pkg-up/package.json" + }, + { + "path": "node_modules/test-exclude/node_modules/locate-path/package.json" + }, + { + "path": "node_modules/test-exclude/node_modules/find-up/package.json" + }, + { + "path": "node_modules/test-exclude/node_modules/p-try/package.json" + }, + { + "path": "node_modules/test-exclude/node_modules/p-locate/package.json" + }, + { + "path": "node_modules/es6-map/package.json" + }, + { + "path": "node_modules/strip-ansi/package.json" + }, + { + "path": "node_modules/strip-ansi/node_modules/ansi-regex/package.json" + }, + { + "path": "node_modules/npm-run-path/package.json" + }, + { + "path": "node_modules/estraverse/package.json" + }, + { + "path": "node_modules/find-cache-dir/package.json" + }, + { + "path": "node_modules/find-cache-dir/node_modules/make-dir/package.json" + }, + { + "path": "node_modules/find-cache-dir/node_modules/pify/package.json" + }, + { + "path": "node_modules/find-cache-dir/node_modules/semver/package.json" + }, + { + "path": "node_modules/espree/package.json" + }, + { + "path": "node_modules/bignumber.js/package.json" + }, + { + "path": "node_modules/walkdir/package.json" + }, + { + "path": "node_modules/strip-bom/package.json" + }, + { + "path": "node_modules/figures/package.json" + }, + { + "path": "node_modules/parse-json/package.json" + }, + { + "path": "node_modules/run-async/package.json" + }, + { + "path": "node_modules/es6-weak-map/package.json" + }, + { + "path": "node_modules/decompress-response/package.json" + }, + { + "path": "node_modules/to-fast-properties/package.json" + }, + { + "path": "node_modules/color-convert/package.json" + }, + { + "path": "node_modules/functional-red-black-tree/package.json" + }, + { + "path": "node_modules/prettier-linter-helpers/package.json" + }, + { + "path": "node_modules/entities/package.json" + }, + { + "path": "node_modules/read-pkg/package.json" + }, + { + "path": "node_modules/istanbul-lib-report/package.json" + }, + { + "path": "node_modules/istanbul-lib-report/node_modules/make-dir/package.json" + }, + { + "path": "node_modules/istanbul-lib-report/node_modules/pify/package.json" + }, + { + "path": "node_modules/istanbul-lib-report/node_modules/semver/package.json" + }, + { + "path": "node_modules/istanbul-lib-report/node_modules/supports-color/package.json" + }, + { + "path": "node_modules/json-stable-stringify-without-jsonify/package.json" + }, + { + "path": "node_modules/package-json/package.json" + }, + { + "path": "node_modules/is-path-inside/package.json" + }, + { + "path": "node_modules/cross-spawn/README.md" + }, + { + "path": "node_modules/cross-spawn/index.js" + }, + { + "path": "node_modules/cross-spawn/LICENSE" + }, + { + "path": "node_modules/cross-spawn/CHANGELOG.md" + }, + { + "path": "node_modules/cross-spawn/package.json" + }, + { + "path": "node_modules/cross-spawn/node_modules/semver/package.json" + }, + { + "path": "node_modules/cross-spawn/lib/enoent.js" + }, + { + "path": "node_modules/cross-spawn/lib/parse.js" + }, + { + "path": "node_modules/cross-spawn/lib/util/readShebang.js" + }, + { + "path": "node_modules/cross-spawn/lib/util/escape.js" + }, + { + "path": "node_modules/cross-spawn/lib/util/resolveCommand.js" + }, + { + "path": "node_modules/intelli-espower-loader/package.json" + }, + { + "path": "node_modules/hosted-git-info/package.json" + }, + { + "path": "node_modules/argv/package.json" + }, + { + "path": "node_modules/levn/package.json" + }, + { + "path": "node_modules/json-parse-better-errors/package.json" + }, + { + "path": "node_modules/array-find/package.json" + }, + { + "path": "node_modules/uuid/package.json" + }, + { + "path": "node_modules/object-inspect/package.json" + }, + { + "path": "node_modules/uc.micro/package.json" + }, + { + "path": "node_modules/retry-request/package.json" + }, + { + "path": "node_modules/retry-request/node_modules/debug/package.json" + }, + { + "path": "node_modules/find-up/package.json" + }, + { + "path": "node_modules/underscore/package.json" + }, + { + "path": "node_modules/import-lazy/package.json" + }, + { + "path": "node_modules/flatted/package.json" + }, + { + "path": "node_modules/acorn-es7-plugin/package.json" + }, + { + "path": "node_modules/ee-first/package.json" + }, + { + "path": "node_modules/restore-cursor/package.json" + }, + { + "path": "node_modules/defer-to-connect/package.json" + }, + { + "path": "node_modules/escape-html/package.json" + }, + { + "path": "node_modules/is-date-object/package.json" + }, + { + "path": "node_modules/is-fullwidth-code-point/package.json" + }, + { + "path": "node_modules/duplexify/package.json" + }, + { + "path": "node_modules/set-blocking/package.json" + }, + { + "path": "node_modules/linkinator/package.json" + }, + { + "path": "node_modules/linkinator/node_modules/chalk/package.json" + }, + { + "path": "node_modules/linkinator/node_modules/has-flag/package.json" + }, + { + "path": "node_modules/linkinator/node_modules/color-name/package.json" + }, + { + "path": "node_modules/linkinator/node_modules/color-convert/package.json" + }, + { + "path": "node_modules/linkinator/node_modules/ansi-styles/package.json" + }, + { + "path": "node_modules/linkinator/node_modules/supports-color/package.json" + }, + { + "path": "node_modules/domelementtype/package.json" + }, + { + "path": "node_modules/htmlparser2/package.json" + }, + { + "path": "node_modules/htmlparser2/node_modules/readable-stream/package.json" + }, + { + "path": "node_modules/send/package.json" + }, + { + "path": "node_modules/send/node_modules/ms/package.json" + }, + { + "path": "node_modules/send/node_modules/debug/package.json" + }, + { + "path": "node_modules/send/node_modules/debug/node_modules/ms/package.json" + }, + { + "path": "node_modules/send/node_modules/mime/package.json" + }, + { + "path": "node_modules/xmlcreate/package.json" + }, + { + "path": "node_modules/strip-eof/package.json" + }, + { + "path": "node_modules/make-dir/package.json" + }, + { + "path": "node_modules/path-is-inside/package.json" + }, + { + "path": "node_modules/is-yarn-global/package.json" + }, + { + "path": "node_modules/eslint-plugin-prettier/package.json" + }, + { + "path": "node_modules/log-symbols/package.json" + }, + { + "path": "node_modules/taffydb/package.json" + }, + { + "path": "node_modules/url-parse-lax/package.json" + }, + { + "path": "node_modules/fast-diff/package.json" + }, + { + "path": "node_modules/chardet/package.json" + }, + { + "path": "node_modules/power-assert-renderer-assertion/package.json" + }, + { + "path": "node_modules/cliui/package.json" + }, + { + "path": "node_modules/cliui/node_modules/is-fullwidth-code-point/package.json" + }, + { + "path": "node_modules/cliui/node_modules/string-width/package.json" + }, + { + "path": "node_modules/cliui/node_modules/emoji-regex/package.json" + }, + { + "path": "node_modules/prepend-http/package.json" + }, + { + "path": "node_modules/uri-js/package.json" + }, + { + "path": "node_modules/@szmarczak/http-timer/package.json" + }, + { + "path": "node_modules/@babel/highlight/package.json" + }, + { + "path": "node_modules/@babel/helper-split-export-declaration/package.json" + }, + { + "path": "node_modules/@babel/types/package.json" + }, + { + "path": "node_modules/@babel/parser/package.json" + }, + { + "path": "node_modules/@babel/helper-function-name/package.json" + }, + { + "path": "node_modules/@babel/generator/package.json" + }, + { + "path": "node_modules/@babel/generator/node_modules/source-map/package.json" + }, + { + "path": "node_modules/@babel/code-frame/package.json" + }, + { + "path": "node_modules/@babel/helper-get-function-arity/package.json" + }, + { + "path": "node_modules/@babel/template/package.json" + }, + { + "path": "node_modules/@babel/traverse/package.json" + }, + { + "path": "node_modules/@babel/traverse/node_modules/debug/package.json" + }, + { + "path": "node_modules/@babel/traverse/node_modules/globals/package.json" + }, + { + "path": "node_modules/fast-text-encoding/package.json" + }, + { + "path": "node_modules/tslib/package.json" + }, + { + "path": "node_modules/normalize-package-data/package.json" + }, + { + "path": "node_modules/normalize-package-data/node_modules/semver/package.json" + }, + { + "path": "node_modules/mkdirp/package.json" + }, + { + "path": "node_modules/cli-boxes/package.json" + }, + { + "path": "node_modules/array-find-index/package.json" + }, + { + "path": "node_modules/commander/package.json" + }, + { + "path": "node_modules/is-callable/package.json" + }, + { + "path": "node_modules/import-fresh/package.json" + }, + { + "path": "node_modules/ignore-walk/package.json" + }, + { + "path": "node_modules/type-check/package.json" + }, + { + "path": "node_modules/camelcase-keys/package.json" + }, + { + "path": "node_modules/event-target-shim/package.json" + }, + { + "path": "node_modules/trim-newlines/package.json" + }, + { + "path": "node_modules/glob/package.json" + }, + { + "path": "node_modules/prettier/package.json" + }, + { + "path": "node_modules/mute-stream/package.json" + }, + { + "path": "node_modules/diff/package.json" + }, + { + "path": "node_modules/power-assert-context-reducer-ast/package.json" + }, + { + "path": "node_modules/power-assert-context-reducer-ast/node_modules/acorn/package.json" + }, + { + "path": "node_modules/inflight/package.json" + }, + { + "path": "node_modules/eslint-scope/package.json" + }, + { + "path": "node_modules/get-stdin/package.json" + }, + { + "path": "node_modules/pify/package.json" + }, + { + "path": "node_modules/string.prototype.trimleft/package.json" + }, + { + "path": "node_modules/lodash.camelcase/package.json" + }, + { + "path": "node_modules/codecov/package.json" + }, + { + "path": "node_modules/esrecurse/package.json" + }, + { + "path": "node_modules/domhandler/package.json" + }, + { + "path": "node_modules/currently-unhandled/package.json" + }, + { + "path": "node_modules/ansi-styles/package.json" + }, + { + "path": "node_modules/jsdoc-region-tag/package.json" + }, + { + "path": "node_modules/function-bind/package.json" + }, + { + "path": "node_modules/etag/package.json" + }, + { + "path": "node_modules/cli-width/package.json" + }, + { + "path": "node_modules/once/package.json" + }, + { + "path": "node_modules/convert-source-map/package.json" + }, + { + "path": "node_modules/string-width/package.json" + }, + { + "path": "node_modules/string-width/node_modules/strip-ansi/package.json" + }, + { + "path": "node_modules/jws/package.json" + }, + { + "path": "node_modules/xdg-basedir/package.json" + }, + { + "path": "node_modules/has-symbols/package.json" + }, + { + "path": "node_modules/safer-buffer/package.json" + }, + { + "path": "node_modules/cli-cursor/package.json" + }, + { + "path": "node_modules/lru-cache/package.json" + }, + { + "path": "node_modules/nth-check/package.json" + }, + { + "path": "node_modules/json-buffer/package.json" + }, + { + "path": "node_modules/duplexer3/package.json" + }, + { + "path": "node_modules/lodash.at/package.json" + }, + { + "path": "node_modules/istanbul-lib-hook/package.json" + }, + { + "path": "node_modules/arrify/package.json" + }, + { + "path": "node_modules/get-caller-file/package.json" + }, + { + "path": "node_modules/flat-cache/package.json" + }, + { + "path": "node_modules/regexpp/package.json" + }, + { + "path": "node_modules/eslint/package.json" + }, + { + "path": "node_modules/eslint/node_modules/debug/package.json" + }, + { + "path": "node_modules/yargs-parser/package.json" + }, + { + "path": "node_modules/eslint-config-prettier/package.json" + }, + { + "path": "node_modules/strip-json-comments/package.json" + }, + { + "path": "node_modules/decamelize-keys/package.json" + }, + { + "path": "node_modules/decamelize-keys/node_modules/map-obj/package.json" + }, + { + "path": "node_modules/yargs-unparser/package.json" + }, + { + "path": "node_modules/handlebars/package.json" + }, + { + "path": "node_modules/archy/package.json" + }, + { + "path": "node_modules/object.getownpropertydescriptors/package.json" + }, + { + "path": "node_modules/is-glob/package.json" + }, + { + "path": "node_modules/power-assert-formatter/package.json" + }, + { + "path": "node_modules/inherits/package.json" + }, + { + "path": "node_modules/power-assert-util-string-width/package.json" + }, + { + "path": "node_modules/json-schema-traverse/package.json" + }, + { + "path": "node_modules/os-tmpdir/package.json" + }, + { + "path": "node_modules/write/package.json" + }, + { + "path": "node_modules/doctrine/package.json" + }, + { + "path": "node_modules/marked/package.json" + }, + { + "path": "node_modules/cheerio/package.json" + }, + { + "path": "node_modules/abort-controller/package.json" + }, + { + "path": "node_modules/mocha/package.json" + }, + { + "path": "node_modules/mocha/node_modules/p-limit/package.json" + }, + { + "path": "node_modules/mocha/node_modules/ms/package.json" + }, + { + "path": "node_modules/mocha/node_modules/locate-path/package.json" + }, + { + "path": "node_modules/mocha/node_modules/find-up/package.json" + }, + { + "path": "node_modules/mocha/node_modules/glob/package.json" + }, + { + "path": "node_modules/mocha/node_modules/yargs-parser/package.json" + }, + { + "path": "node_modules/mocha/node_modules/strip-json-comments/package.json" + }, + { + "path": "node_modules/mocha/node_modules/p-try/package.json" + }, + { + "path": "node_modules/mocha/node_modules/p-locate/package.json" + }, + { + "path": "node_modules/mocha/node_modules/camelcase/package.json" + }, + { + "path": "node_modules/mocha/node_modules/supports-color/package.json" + }, + { + "path": "node_modules/redent/package.json" + }, + { + "path": "node_modules/markdown-it/package.json" + }, + { + "path": "node_modules/ignore/package.json" + }, + { + "path": "node_modules/is-stream/package.json" + }, + { + "path": "node_modules/os-homedir/package.json" + }, + { + "path": "node_modules/tmp/package.json" + }, + { + "path": "node_modules/readable-stream/package.json" + }, + { + "path": "node_modules/array-filter/package.json" + }, + { + "path": "node_modules/power-assert/package.json" + }, + { + "path": "node_modules/p-try/package.json" + }, + { + "path": "node_modules/slice-ansi/package.json" + }, + { + "path": "node_modules/slice-ansi/node_modules/is-fullwidth-code-point/package.json" + }, + { + "path": "node_modules/wrappy/package.json" + }, + { + "path": "node_modules/on-finished/package.json" + }, + { + "path": "node_modules/registry-auth-token/package.json" + }, + { + "path": "node_modules/eastasianwidth/package.json" + }, + { + "path": "node_modules/caching-transform/package.json" + }, + { + "path": "node_modules/caching-transform/node_modules/make-dir/package.json" + }, + { + "path": "node_modules/caching-transform/node_modules/pify/package.json" + }, + { + "path": "node_modules/caching-transform/node_modules/semver/package.json" + }, + { + "path": "node_modules/core-js/package.json" + }, + { + "path": "node_modules/istanbul-lib-source-maps/package.json" + }, + { + "path": "node_modules/istanbul-lib-source-maps/node_modules/debug/package.json" + }, + { + "path": "node_modules/istanbul-lib-source-maps/node_modules/make-dir/package.json" + }, + { + "path": "node_modules/istanbul-lib-source-maps/node_modules/pify/package.json" + }, + { + "path": "node_modules/istanbul-lib-source-maps/node_modules/semver/package.json" + }, + { + "path": "node_modules/google-gax/package.json" + }, + { + "path": "node_modules/setprototypeof/package.json" + }, + { + "path": "node_modules/pkg-dir/package.json" + }, + { + "path": "node_modules/pkg-dir/node_modules/p-limit/package.json" + }, + { + "path": "node_modules/pkg-dir/node_modules/locate-path/package.json" + }, + { + "path": "node_modules/pkg-dir/node_modules/find-up/package.json" + }, + { + "path": "node_modules/pkg-dir/node_modules/p-try/package.json" + }, + { + "path": "node_modules/pkg-dir/node_modules/p-locate/package.json" + }, + { + "path": "node_modules/p-locate/package.json" + }, + { + "path": "node_modules/finalhandler/package.json" + }, + { + "path": "node_modules/finalhandler/node_modules/ms/package.json" + }, + { + "path": "node_modules/finalhandler/node_modules/debug/package.json" + }, + { + "path": "node_modules/eslint-visitor-keys/package.json" + }, + { + "path": "node_modules/lodash/package.json" + }, + { + "path": "node_modules/natural-compare/package.json" + }, + { + "path": "node_modules/default-require-extensions/package.json" + }, + { + "path": "node_modules/@protobufjs/aspromise/package.json" + }, + { + "path": "node_modules/@protobufjs/pool/package.json" + }, + { + "path": "node_modules/@protobufjs/float/package.json" + }, + { + "path": "node_modules/@protobufjs/base64/package.json" + }, + { + "path": "node_modules/@protobufjs/codegen/package.json" + }, + { + "path": "node_modules/@protobufjs/inquire/package.json" + }, + { + "path": "node_modules/@protobufjs/eventemitter/package.json" + }, + { + "path": "node_modules/@protobufjs/fetch/package.json" + }, + { + "path": "node_modules/@protobufjs/path/package.json" + }, + { + "path": "node_modules/@protobufjs/utf8/package.json" + }, + { + "path": "node_modules/https-proxy-agent/package.json" + }, + { + "path": "node_modules/ansi-escapes/package.json" + }, + { + "path": "node_modules/spdx-license-ids/package.json" + }, + { + "path": "node_modules/power-assert-renderer-diagram/package.json" + }, + { + "path": "node_modules/wide-align/package.json" + }, + { + "path": "node_modules/wide-align/node_modules/ansi-regex/package.json" + }, + { + "path": "node_modules/wide-align/node_modules/strip-ansi/package.json" + }, + { + "path": "node_modules/wide-align/node_modules/is-fullwidth-code-point/package.json" + }, + { + "path": "node_modules/wide-align/node_modules/string-width/package.json" + }, + { + "path": "node_modules/base64-js/package.json" + }, + { + "path": "node_modules/sprintf-js/package.json" + }, + { + "path": "node_modules/is-plain-obj/package.json" + }, + { + "path": "node_modules/is-arguments/package.json" + }, + { + "path": "node_modules/commondir/package.json" + }, + { + "path": "node_modules/optimist/package.json" + }, + { + "path": "node_modules/power-assert-context-traversal/package.json" + }, + { + "path": "node_modules/source-map-support/package.json" + }, + { + "path": "node_modules/source-map-support/node_modules/source-map/package.json" + }, + { + "path": "node_modules/is-npm/package.json" + }, + { + "path": "node_modules/p-cancelable/package.json" + }, + { + "path": "node_modules/v8-compile-cache/package.json" + }, + { + "path": "node_modules/semver/package.json" + }, + { + "path": "node_modules/stringifier/package.json" + }, + { + "path": "node_modules/spdx-exceptions/package.json" + }, + { + "path": "node_modules/progress/package.json" + }, + { + "path": "node_modules/camelcase/package.json" + }, + { + "path": "node_modules/urlgrey/package.json" + }, + { + "path": "node_modules/keyv/package.json" + }, + { + "path": "node_modules/validate-npm-package-license/package.json" + }, + { + "path": "node_modules/get-stream/package.json" + }, + { + "path": "node_modules/is-stream-ended/package.json" + }, + { + "path": "node_modules/deep-equal/package.json" + }, + { + "path": "node_modules/fast-levenshtein/package.json" + }, + { + "path": "node_modules/klaw/package.json" + }, + { + "path": "node_modules/jsonexport/package.json" + }, + { + "path": "node_modules/event-emitter/package.json" + }, + { + "path": "node_modules/acorn/package.json" + }, + { + "path": "node_modules/supports-color/package.json" + }, + { + "path": "node_modules/ajv/package.json" + }, + { + "path": "node_modules/emoji-regex/package.json" + }, + { + "path": "node_modules/jsdoc/package.json" + }, + { + "path": "node_modules/jsdoc/node_modules/escape-string-regexp/package.json" + }, + { + "path": "node_modules/requizzle/package.json" + }, + { + "path": "node_modules/lowercase-keys/package.json" + }, + { + "path": "node_modules/power-assert-renderer-base/package.json" + }, + { + "path": "node_modules/wordwrap/package.json" + }, + { + "path": "node_modules/es-abstract/package.json" + }, + { + "path": "node_modules/gaxios/package.json" + }, + { + "path": "node_modules/map-obj/package.json" + }, + { + "path": "node_modules/stream-shift/package.json" + }, + { + "path": "node_modules/domutils/package.json" + }, + { + "path": "node_modules/es6-iterator/package.json" + }, + { + "path": "node_modules/uglify-js/package.json" + }, + { + "path": "node_modules/amdefine/package.json" + }, + { + "path": "node_modules/@types/color-name/package.json" + }, + { + "path": "node_modules/@types/node/package.json" + }, + { + "path": "node_modules/@types/long/package.json" + }, + { + "path": "node_modules/balanced-match/package.json" + }, + { + "path": "node_modules/is-buffer/package.json" + }, + { + "path": "node_modules/optionator/package.json" + }, + { + "path": "node_modules/rc/package.json" + }, + { + "path": "node_modules/rc/node_modules/minimist/package.json" + }, + { + "path": "node_modules/rc/node_modules/strip-json-comments/package.json" + }, + { + "path": "node_modules/nested-error-stacks/package.json" + }, + { + "path": "node_modules/traverse/package.json" + }, + { + "path": "node_modules/crypto-random-string/package.json" + }, + { + "path": "node_modules/lodash.flattendeep/package.json" + }, + { + "path": "node_modules/resolve-from/package.json" + }, + { + "path": "node_modules/espower-source/package.json" + }, + { + "path": "node_modules/espower-source/node_modules/acorn/package.json" + }, + { + "path": "node_modules/globals/package.json" + }, + { + "path": "node_modules/call-signature/package.json" + }, + { + "path": "node_modules/escodegen/package.json" + }, + { + "path": "node_modules/escodegen/node_modules/esprima/package.json" + }, + { + "path": "node_modules/google-auth-library/package.json" + }, + { + "path": "node_modules/istanbul-lib-coverage/package.json" + }, + { + "path": "node_modules/power-assert-renderer-file/package.json" + }, + { + "path": "node_modules/decamelize/package.json" + }, + { + "path": "node_modules/process-nextick-args/package.json" + }, + { + "path": "node_modules/long/package.json" + }, + { + "path": "node_modules/shebang-regex/package.json" + }, + { + "path": "node_modules/astral-regex/package.json" + }, + { + "path": "node_modules/path-exists/package.json" + }, + { + "path": "node_modules/protobufjs/package.json" + }, + { + "path": "node_modules/protobufjs/cli/package.json" + }, + { + "path": "node_modules/protobufjs/cli/package-lock.json" + }, + { + "path": "node_modules/protobufjs/cli/node_modules/acorn-jsx/package.json" + }, + { + "path": "node_modules/protobufjs/cli/node_modules/acorn-jsx/node_modules/acorn/package.json" + }, + { + "path": "node_modules/protobufjs/cli/node_modules/minimist/package.json" + }, + { + "path": "node_modules/protobufjs/cli/node_modules/espree/package.json" + }, + { + "path": "node_modules/protobufjs/cli/node_modules/semver/package.json" + }, + { + "path": "node_modules/protobufjs/cli/node_modules/acorn/package.json" + }, + { + "path": "node_modules/deep-is/package.json" + }, + { + "path": "node_modules/dot-prop/package.json" + }, + { + "path": "node_modules/dom-serializer/package.json" + }, + { + "path": "node_modules/universal-deep-strict-equal/package.json" + }, + { + "path": "node_modules/term-size/package.json" + }, + { + "path": "node_modules/has-yarn/package.json" + }, + { + "path": "node_modules/call-matcher/package.json" + }, + { + "path": "system-test/no-test.js" + }, + { + "path": "system-test/.eslintrc.yml" + }, + { + "path": ".kokoro/docs.sh" + }, + { + "path": ".kokoro/trampoline.sh" + }, + { + "path": ".kokoro/test.sh" + }, + { + "path": ".kokoro/publish.sh" + }, + { + "path": ".kokoro/common.cfg" + }, + { + "path": ".kokoro/test.bat" + }, + { + "path": ".kokoro/lint.sh" + }, + { + "path": ".kokoro/system-test.sh" + }, + { + "path": ".kokoro/.gitattributes" + }, + { + "path": ".kokoro/samples-test.sh" + }, + { + "path": ".kokoro/continuous/node8/test.cfg" + }, + { + "path": ".kokoro/continuous/node8/common.cfg" + }, + { + "path": ".kokoro/continuous/node12/test.cfg" + }, + { + "path": ".kokoro/continuous/node12/common.cfg" + }, + { + "path": ".kokoro/continuous/node10/docs.cfg" + }, + { + "path": ".kokoro/continuous/node10/lint.cfg" + }, + { + "path": ".kokoro/continuous/node10/system-test.cfg" + }, + { + "path": ".kokoro/continuous/node10/test.cfg" + }, + { + "path": ".kokoro/continuous/node10/samples-test.cfg" + }, + { + "path": ".kokoro/continuous/node10/common.cfg" + }, + { + "path": ".kokoro/presubmit/node8/test.cfg" + }, + { + "path": ".kokoro/presubmit/node8/common.cfg" + }, + { + "path": ".kokoro/presubmit/node12/test.cfg" + }, + { + "path": ".kokoro/presubmit/node12/common.cfg" + }, + { + "path": ".kokoro/presubmit/node10/docs.cfg" + }, + { + "path": ".kokoro/presubmit/node10/lint.cfg" + }, + { + "path": ".kokoro/presubmit/node10/system-test.cfg" + }, + { + "path": ".kokoro/presubmit/node10/test.cfg" + }, + { + "path": ".kokoro/presubmit/node10/samples-test.cfg" + }, + { + "path": ".kokoro/presubmit/node10/common.cfg" + }, + { + "path": ".kokoro/presubmit/windows/test.cfg" + }, + { + "path": ".kokoro/presubmit/windows/common.cfg" + }, + { + "path": ".kokoro/release/docs.cfg" + }, + { + "path": ".kokoro/release/docs.sh" + }, + { + "path": ".kokoro/release/publish.cfg" + }, + { + "path": ".kokoro/release/common.cfg" + }, + { + "path": "test/mocha.opts" + }, + { + "path": "test/.eslintrc.yml" + }, + { + "path": "test/gapic-v1.js" + }, + { + "path": "src/index.js" + }, + { + "path": "src/browser.js" + }, + { + "path": "src/v1beta1/index.js" + }, + { + "path": "src/v1beta1/security_center_proto_list.json" + }, + { + "path": "src/v1beta1/security_center_client.js" + }, + { + "path": "src/v1beta1/security_center_client_config.json" + }, + { + "path": "src/v1beta1/doc/google/protobuf/doc_any.js" + }, + { + "path": "src/v1beta1/doc/google/protobuf/doc_duration.js" + }, + { + "path": "src/v1beta1/doc/google/protobuf/doc_timestamp.js" + }, + { + "path": "src/v1beta1/doc/google/protobuf/doc_struct.js" + }, + { + "path": "src/v1beta1/doc/google/protobuf/doc_field_mask.js" + }, + { + "path": "src/v1beta1/doc/google/type/doc_expr.js" + }, + { + "path": "src/v1beta1/doc/google/iam/v1/doc_iam_policy.js" + }, + { + "path": "src/v1beta1/doc/google/iam/v1/doc_options.js" + }, + { + "path": "src/v1beta1/doc/google/iam/v1/doc_policy.js" + }, + { + "path": "src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_securitycenter_service.js" + }, + { + "path": "src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_asset.js" + }, + { + "path": "src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_source.js" + }, + { + "path": "src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_organization_settings.js" + }, + { + "path": "src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_security_marks.js" + }, + { + "path": "src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_finding.js" + }, + { + "path": "src/v1beta1/doc/google/longrunning/doc_operations.js" + }, + { + "path": "src/v1beta1/doc/google/rpc/doc_status.js" + }, + { + "path": "src/v1/index.js" + }, + { + "path": "src/v1/security_center_proto_list.json" + }, + { + "path": "src/v1/security_center_client.js" + }, + { + "path": "src/v1/security_center_client_config.json" + }, + { + "path": "src/v1/doc/google/protobuf/doc_any.js" + }, + { + "path": "src/v1/doc/google/protobuf/doc_duration.js" + }, + { + "path": "src/v1/doc/google/protobuf/doc_timestamp.js" + }, + { + "path": "src/v1/doc/google/protobuf/doc_struct.js" + }, + { + "path": "src/v1/doc/google/protobuf/doc_field_mask.js" + }, + { + "path": "src/v1/doc/google/type/doc_expr.js" + }, + { + "path": "src/v1/doc/google/iam/v1/doc_iam_policy.js" + }, + { + "path": "src/v1/doc/google/iam/v1/doc_options.js" + }, + { + "path": "src/v1/doc/google/iam/v1/doc_policy.js" + }, + { + "path": "src/v1/doc/google/cloud/securitycenter/v1/doc_securitycenter_service.js" + }, + { + "path": "src/v1/doc/google/cloud/securitycenter/v1/doc_asset.js" + }, + { + "path": "src/v1/doc/google/cloud/securitycenter/v1/doc_source.js" + }, + { + "path": "src/v1/doc/google/cloud/securitycenter/v1/doc_organization_settings.js" + }, + { + "path": "src/v1/doc/google/cloud/securitycenter/v1/doc_security_marks.js" + }, + { + "path": "src/v1/doc/google/cloud/securitycenter/v1/doc_finding.js" + }, + { + "path": "src/v1/doc/google/longrunning/doc_operations.js" + }, + { + "path": "src/v1/doc/google/rpc/doc_status.js" + }, + { + "path": ".github/ISSUE_TEMPLATE.md" + }, + { + "path": ".github/release-please.yml" + }, + { + "path": ".github/PULL_REQUEST_TEMPLATE.md" + }, + { + "path": ".github/ISSUE_TEMPLATE/bug_report.md" + }, + { + "path": ".github/ISSUE_TEMPLATE/feature_request.md" + }, + { + "path": ".github/ISSUE_TEMPLATE/support_request.md" + } ] } \ No newline at end of file From 94edd7ccfaa67082161ed423a0a7c4a465a7824a Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Sat, 4 Jan 2020 23:56:02 -0800 Subject: [PATCH 123/342] chore: update .nycrc --- packages/google-cloud-securitycenter/.nycrc | 1 + .../synth.metadata | 1687 ++++++++--------- 2 files changed, 774 insertions(+), 914 deletions(-) diff --git a/packages/google-cloud-securitycenter/.nycrc b/packages/google-cloud-securitycenter/.nycrc index 367688844eb..b18d5472b62 100644 --- a/packages/google-cloud-securitycenter/.nycrc +++ b/packages/google-cloud-securitycenter/.nycrc @@ -12,6 +12,7 @@ "**/scripts", "**/protos", "**/test", + "**/*.d.ts", ".jsdoc.js", "**/.jsdoc.js", "karma.conf.js", diff --git a/packages/google-cloud-securitycenter/synth.metadata b/packages/google-cloud-securitycenter/synth.metadata index 12fa18facde..5dbdf175ad6 100644 --- a/packages/google-cloud-securitycenter/synth.metadata +++ b/packages/google-cloud-securitycenter/synth.metadata @@ -1,19 +1,19 @@ { - "updateTime": "2019-12-19T12:23:08.028182Z", + "updateTime": "2020-01-04T12:26:10.640348Z", "sources": [ { "generator": { "name": "artman", - "version": "0.42.3", - "dockerImage": "googleapis/artman@sha256:feed210b5723c6f524b52ef6d7740a030f2d1a8f7c29a71c5e5b4481ceaad7f5" + "version": "0.43.0", + "dockerImage": "googleapis/artman@sha256:264654a37596a44b0668b8ce6ac41082d713f6ee150b3fc6425fa78cc64e4f20" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "d400cb8d45df5b2ae796b909f098a215b2275c1d", - "internalRef": "286312673" + "sha": "91ef2d9dd69807b0b79555f22566fb2d81e49ff9", + "internalRef": "287999179" } }, { @@ -48,2479 +48,2338 @@ ], "newFiles": [ { - "path": "renovate.json" - }, - { - "path": ".prettierrc" - }, - { - "path": ".nycrc" + "path": "package.json" }, { "path": "webpack.config.js" }, { - "path": "README.md" - }, - { - "path": "synth.py" + "path": ".prettierignore" }, { - "path": ".eslintignore" + "path": "CODE_OF_CONDUCT.md" }, { - "path": ".gitignore" + "path": ".repo-metadata.json" }, { - "path": "LICENSE" + "path": ".prettierrc" }, { - "path": ".repo-metadata.json" + "path": "CHANGELOG.md" }, { - "path": "CONTRIBUTING.md" + "path": "renovate.json" }, { - "path": "synth.metadata" + "path": ".nycrc" }, { - "path": "CODE_OF_CONDUCT.md" + "path": "LICENSE" }, { - "path": "CHANGELOG.md" + "path": "synth.py" }, { - "path": ".prettierignore" + "path": ".eslintignore" }, { "path": "linkinator.config.json" }, { - "path": "package.json" + "path": ".readme-partials.yaml" }, { "path": "package-lock.json" }, { - "path": "codecov.yaml" + "path": "CONTRIBUTING.md" }, { "path": ".eslintrc.yml" }, { - "path": ".jsdoc.js" + "path": "README.md" }, { - "path": ".readme-partials.yaml" + "path": "synth.metadata" }, { - "path": "protos/protos.d.ts" + "path": ".gitignore" }, { - "path": "protos/protos.js" + "path": "codecov.yaml" }, { - "path": "protos/protos.json" + "path": ".jsdoc.js" }, { - "path": "protos/google/cloud/securitycenter/v1beta1/finding.proto" + "path": ".github/ISSUE_TEMPLATE.md" }, { - "path": "protos/google/cloud/securitycenter/v1beta1/run_asset_discovery_response.proto" + "path": ".github/PULL_REQUEST_TEMPLATE.md" }, { - "path": "protos/google/cloud/securitycenter/v1beta1/security_marks.proto" + "path": ".github/release-please.yml" }, { - "path": "protos/google/cloud/securitycenter/v1beta1/securitycenter_service.proto" + "path": ".github/ISSUE_TEMPLATE/bug_report.md" }, { - "path": "protos/google/cloud/securitycenter/v1beta1/organization_settings.proto" + "path": ".github/ISSUE_TEMPLATE/feature_request.md" }, { - "path": "protos/google/cloud/securitycenter/v1beta1/source.proto" + "path": ".github/ISSUE_TEMPLATE/support_request.md" }, { - "path": "protos/google/cloud/securitycenter/v1beta1/asset.proto" + "path": "node_modules/uc.micro/package.json" }, { - "path": "protos/google/cloud/securitycenter/v1/finding.proto" + "path": "node_modules/eastasianwidth/package.json" }, { - "path": "protos/google/cloud/securitycenter/v1/run_asset_discovery_response.proto" + "path": "node_modules/defer-to-connect/package.json" }, { - "path": "protos/google/cloud/securitycenter/v1/security_marks.proto" + "path": "node_modules/object-is/package.json" }, { - "path": "protos/google/cloud/securitycenter/v1/securitycenter_service.proto" + "path": "node_modules/is-arguments/package.json" }, { - "path": "protos/google/cloud/securitycenter/v1/organization_settings.proto" + "path": "node_modules/eventemitter3/package.json" }, { - "path": "protos/google/cloud/securitycenter/v1/source.proto" + "path": "node_modules/long/package.json" }, { - "path": "protos/google/cloud/securitycenter/v1/asset.proto" + "path": "node_modules/lodash/package.json" }, { - "path": ".git/config" + "path": "node_modules/diff/package.json" }, { - "path": ".git/index" + "path": "node_modules/has-flag/package.json" }, { - "path": ".git/shallow" + "path": "node_modules/prelude-ls/package.json" }, { - "path": ".git/HEAD" + "path": "node_modules/source-map/package.json" }, { - "path": ".git/packed-refs" + "path": "node_modules/spdx-correct/package.json" }, { - "path": ".git/refs/tags/v2.3.0" + "path": "node_modules/normalize-url/package.json" }, { - "path": ".git/refs/remotes/origin/HEAD" + "path": "node_modules/tmp/package.json" }, { - "path": ".git/refs/heads/autosynth" + "path": "node_modules/got/package.json" }, { - "path": ".git/refs/heads/master" + "path": "node_modules/agent-base/package.json" }, { - "path": ".git/objects/pack/pack-37ef62494e0563d925a784c196add9f1586b4dfb.idx" + "path": "node_modules/process-nextick-args/package.json" }, { - "path": ".git/objects/pack/pack-37ef62494e0563d925a784c196add9f1586b4dfb.pack" + "path": "node_modules/google-gax/package.json" }, { - "path": ".git/logs/HEAD" + "path": "node_modules/next-tick/package.json" }, { - "path": ".git/logs/refs/remotes/origin/HEAD" + "path": "node_modules/hosted-git-info/package.json" }, { - "path": ".git/logs/refs/heads/autosynth" + "path": "node_modules/is-symbol/package.json" }, { - "path": ".git/logs/refs/heads/master" + "path": "node_modules/once/package.json" }, { - "path": "samples/README.md" + "path": "node_modules/yargs-parser/package.json" }, { - "path": "samples/quickstart.js" + "path": "node_modules/ansi-escapes/package.json" }, { - "path": "samples/package.json" + "path": "node_modules/gcp-metadata/package.json" }, { - "path": "samples/.eslintrc.yml" + "path": "node_modules/espower-loader/package.json" }, { - "path": "samples/system-test/quickstart.test.js" + "path": "node_modules/validate-npm-package-license/package.json" }, { - "path": "samples/system-test/.eslintrc.yml" + "path": "node_modules/doctrine/package.json" }, { - "path": "samples/system-test/v1/listAssetsAndChanges.test.js" + "path": "node_modules/power-assert-context-formatter/package.json" }, { - "path": "samples/system-test/v1/listFilteredAssets.test.js" + "path": "node_modules/marked/package.json" }, { - "path": "samples/system-test/v1/listAllAssets.test.js" + "path": "node_modules/jsdoc/package.json" }, { - "path": "samples/system-test/v1/findings.test.js" + "path": "node_modules/jsdoc/node_modules/escape-string-regexp/package.json" }, { - "path": "samples/system-test/v1/listAssetsAtTime.test.js" + "path": "node_modules/flat-cache/package.json" }, { - "path": "samples/system-test/v1/orgSettings.test.js" + "path": "node_modules/flat-cache/node_modules/rimraf/package.json" }, { - "path": "samples/system-test/v1/assetSecurityMarks.test.js" + "path": "node_modules/is-npm/package.json" }, { - "path": "samples/v1/setSourceIam.js" + "path": "node_modules/espower-location-detector/package.json" }, { - "path": "samples/v1/updateSource.js" + "path": "node_modules/espower-location-detector/node_modules/source-map/package.json" }, { - "path": "samples/v1/getSource.js" + "path": "node_modules/base64-js/package.json" }, { - "path": "samples/v1/listFilteredAssets.js" + "path": "node_modules/is-glob/package.json" }, { - "path": "samples/v1/enableAssetDiscovery.js" + "path": "node_modules/taffydb/package.json" }, { - "path": "samples/v1/listFindingsAtTime.js" + "path": "node_modules/mocha/package.json" }, { - "path": "samples/v1/getSourceIam.js" + "path": "node_modules/mocha/node_modules/has-flag/package.json" }, { - "path": "samples/v1/listAllFindings.js" + "path": "node_modules/mocha/node_modules/yargs-parser/package.json" }, { - "path": "samples/v1/deleteSecurityMarks.js" + "path": "node_modules/mocha/node_modules/glob/package.json" }, { - "path": "samples/v1/getOrganizationSettings.js" + "path": "node_modules/mocha/node_modules/strip-ansi/package.json" }, { - "path": "samples/v1/addDeleteSecurityMarks.js" + "path": "node_modules/mocha/node_modules/ansi-styles/package.json" }, { - "path": "samples/v1/listAllSources.js" + "path": "node_modules/mocha/node_modules/find-up/package.json" }, { - "path": "samples/v1/createSource.js" + "path": "node_modules/mocha/node_modules/strip-json-comments/package.json" }, { - "path": "samples/v1/listAssetsWithSecurityMarks.js" + "path": "node_modules/mocha/node_modules/locate-path/package.json" }, { - "path": "samples/v1/listAssetsAndChanges.js" + "path": "node_modules/mocha/node_modules/yargs/package.json" }, { - "path": "samples/v1/addSecurityMarks.js" + "path": "node_modules/mocha/node_modules/is-fullwidth-code-point/package.json" }, { - "path": "samples/v1/setFindingState.js" + "path": "node_modules/mocha/node_modules/supports-color/package.json" }, { - "path": "samples/v1/createFinding.js" + "path": "node_modules/mocha/node_modules/p-locate/package.json" }, { - "path": "samples/v1/listAllAssets.js" + "path": "node_modules/mocha/node_modules/path-exists/package.json" }, { - "path": "samples/v1/createFindingSourceProperties.js" + "path": "node_modules/mocha/node_modules/ms/package.json" }, { - "path": "samples/v1/listAssetsAtTime.js" + "path": "node_modules/mocha/node_modules/color-name/package.json" }, { - "path": "samples/v1/listFilteredFindings.js" + "path": "node_modules/mocha/node_modules/ansi-regex/package.json" }, { - "path": "samples/v1/addFindingSecurityMarks.js" + "path": "node_modules/mocha/node_modules/color-convert/package.json" }, { - "path": "samples/v1/testIam.js" + "path": "node_modules/mocha/node_modules/cliui/package.json" }, { - "path": "samples/v1/listFindingsWithSecurityMarks.js" + "path": "node_modules/mocha/node_modules/wrap-ansi/package.json" }, { - "path": "samples/v1/updateFindingSourceProperties.js" + "path": "node_modules/mocha/node_modules/which/package.json" }, { - "path": "__pycache__/synth.cpython-36.pyc" + "path": "node_modules/mocha/node_modules/string-width/package.json" }, { - "path": "node_modules/shebang-command/package.json" + "path": "node_modules/mocha/node_modules/emoji-regex/package.json" }, { - "path": "node_modules/range-parser/package.json" + "path": "node_modules/minimist/package.json" }, { - "path": "node_modules/esprima/package.json" + "path": "node_modules/type/package.json" }, { - "path": "node_modules/empower-assert/package.json" + "path": "node_modules/yargs-unparser/package.json" }, { - "path": "node_modules/widest-line/package.json" + "path": "node_modules/yargs-unparser/node_modules/yargs-parser/package.json" }, { - "path": "node_modules/widest-line/node_modules/ansi-regex/package.json" + "path": "node_modules/yargs-unparser/node_modules/strip-ansi/package.json" }, { - "path": "node_modules/widest-line/node_modules/strip-ansi/package.json" + "path": "node_modules/yargs-unparser/node_modules/ansi-styles/package.json" }, { - "path": "node_modules/widest-line/node_modules/is-fullwidth-code-point/package.json" + "path": "node_modules/yargs-unparser/node_modules/find-up/package.json" }, { - "path": "node_modules/widest-line/node_modules/string-width/package.json" + "path": "node_modules/yargs-unparser/node_modules/locate-path/package.json" }, { - "path": "node_modules/is-obj/package.json" + "path": "node_modules/yargs-unparser/node_modules/yargs/package.json" }, { - "path": "node_modules/is-arrayish/package.json" + "path": "node_modules/yargs-unparser/node_modules/is-fullwidth-code-point/package.json" }, { - "path": "node_modules/ansi-align/package.json" + "path": "node_modules/yargs-unparser/node_modules/p-locate/package.json" }, { - "path": "node_modules/ansi-align/node_modules/is-fullwidth-code-point/package.json" + "path": "node_modules/yargs-unparser/node_modules/path-exists/package.json" }, { - "path": "node_modules/ansi-align/node_modules/string-width/package.json" + "path": "node_modules/yargs-unparser/node_modules/color-name/package.json" }, { - "path": "node_modules/ansi-align/node_modules/emoji-regex/package.json" + "path": "node_modules/yargs-unparser/node_modules/ansi-regex/package.json" }, { - "path": "node_modules/css-what/package.json" + "path": "node_modules/yargs-unparser/node_modules/color-convert/package.json" }, { - "path": "node_modules/spdx-expression-parse/package.json" + "path": "node_modules/yargs-unparser/node_modules/cliui/package.json" }, { - "path": "node_modules/graceful-fs/package.json" + "path": "node_modules/yargs-unparser/node_modules/wrap-ansi/package.json" }, { - "path": "node_modules/istanbul-reports/package.json" + "path": "node_modules/yargs-unparser/node_modules/string-width/package.json" }, { - "path": "node_modules/y18n/package.json" + "path": "node_modules/yargs-unparser/node_modules/emoji-regex/package.json" }, { - "path": "node_modules/eventemitter3/package.json" + "path": "node_modules/css-select/package.json" }, { - "path": "node_modules/minimatch/package.json" + "path": "node_modules/file-entry-cache/package.json" }, { - "path": "node_modules/object.assign/package.json" + "path": "node_modules/he/package.json" }, { - "path": "node_modules/gtoken/package.json" + "path": "node_modules/xmlcreate/package.json" }, { - "path": "node_modules/chalk/package.json" + "path": "node_modules/https-proxy-agent/package.json" }, { - "path": "node_modules/gcp-metadata/package.json" + "path": "node_modules/ecdsa-sig-formatter/package.json" }, { - "path": "node_modules/prelude-ls/package.json" + "path": "node_modules/nice-try/package.json" }, { - "path": "node_modules/fast-json-stable-stringify/package.json" + "path": "node_modules/log-symbols/package.json" }, { - "path": "node_modules/espower-loader/package.json" + "path": "node_modules/object.getownpropertydescriptors/package.json" }, { - "path": "node_modules/is-url/package.json" + "path": "node_modules/@protobufjs/path/package.json" }, { - "path": "node_modules/responselike/package.json" + "path": "node_modules/@protobufjs/pool/package.json" }, { - "path": "node_modules/got/package.json" + "path": "node_modules/@protobufjs/float/package.json" }, { - "path": "node_modules/got/node_modules/get-stream/package.json" + "path": "node_modules/@protobufjs/aspromise/package.json" }, { - "path": "node_modules/growl/package.json" + "path": "node_modules/@protobufjs/fetch/package.json" }, { - "path": "node_modules/hasha/package.json" + "path": "node_modules/@protobufjs/utf8/package.json" }, { - "path": "node_modules/hasha/node_modules/is-stream/package.json" + "path": "node_modules/@protobufjs/codegen/package.json" }, { - "path": "node_modules/he/package.json" + "path": "node_modules/@protobufjs/inquire/package.json" }, { - "path": "node_modules/end-of-stream/package.json" + "path": "node_modules/@protobufjs/base64/package.json" }, { - "path": "node_modules/isexe/package.json" + "path": "node_modules/@protobufjs/eventemitter/package.json" }, { - "path": "node_modules/source-map/package.json" + "path": "node_modules/gtoken/package.json" }, { - "path": "node_modules/escope/package.json" + "path": "node_modules/through2/package.json" }, { - "path": "node_modules/meow/package.json" + "path": "node_modules/p-limit/package.json" }, { - "path": "node_modules/has-flag/package.json" + "path": "node_modules/argparse/package.json" }, { - "path": "node_modules/encodeurl/package.json" + "path": "node_modules/eslint-scope/package.json" }, { - "path": "node_modules/multi-stage-sourcemap/package.json" + "path": "node_modules/extend/package.json" }, { - "path": "node_modules/multi-stage-sourcemap/node_modules/source-map/package.json" + "path": "node_modules/is-path-inside/package.json" }, { - "path": "node_modules/jwa/package.json" + "path": "node_modules/destroy/package.json" }, { - "path": "node_modules/parent-module/package.json" + "path": "node_modules/power-assert-formatter/package.json" }, { - "path": "node_modules/server-destroy/package.json" + "path": "node_modules/read-pkg-up/package.json" }, { - "path": "node_modules/p-queue/package.json" + "path": "node_modules/global-dirs/package.json" }, { - "path": "node_modules/esutils/package.json" + "path": "node_modules/fast-deep-equal/package.json" }, { - "path": "node_modules/espurify/package.json" + "path": "node_modules/mimic-fn/package.json" }, { - "path": "node_modules/write-file-atomic/package.json" + "path": "node_modules/power-assert-context-reducer-ast/package.json" }, { - "path": "node_modules/es6-set/package.json" + "path": "node_modules/power-assert-context-reducer-ast/node_modules/acorn/package.json" }, { - "path": "node_modules/es6-set/node_modules/es6-symbol/package.json" + "path": "node_modules/core-util-is/package.json" }, { - "path": "node_modules/path-parse/package.json" + "path": "node_modules/string.prototype.trimright/package.json" }, { - "path": "node_modules/iconv-lite/package.json" + "path": "node_modules/catharsis/package.json" }, { - "path": "node_modules/ecdsa-sig-formatter/package.json" + "path": "node_modules/node-fetch/package.json" }, { - "path": "node_modules/yargs/package.json" + "path": "node_modules/linkinator/package.json" }, { - "path": "node_modules/yargs/node_modules/p-limit/package.json" + "path": "node_modules/linkinator/node_modules/chalk/package.json" }, { - "path": "node_modules/yargs/node_modules/locate-path/package.json" + "path": "node_modules/fresh/package.json" }, { - "path": "node_modules/yargs/node_modules/find-up/package.json" + "path": "node_modules/safer-buffer/package.json" }, { - "path": "node_modules/yargs/node_modules/is-fullwidth-code-point/package.json" + "path": "node_modules/is-stream-ended/package.json" }, { - "path": "node_modules/yargs/node_modules/string-width/package.json" + "path": "node_modules/mimic-response/package.json" }, { - "path": "node_modules/yargs/node_modules/yargs-parser/package.json" + "path": "node_modules/requizzle/package.json" }, { - "path": "node_modules/yargs/node_modules/p-try/package.json" + "path": "node_modules/cacheable-request/package.json" }, { - "path": "node_modules/yargs/node_modules/p-locate/package.json" + "path": "node_modules/cacheable-request/node_modules/lowercase-keys/package.json" }, { - "path": "node_modules/yargs/node_modules/camelcase/package.json" + "path": "node_modules/cacheable-request/node_modules/get-stream/package.json" }, { - "path": "node_modules/yargs/node_modules/emoji-regex/package.json" + "path": "node_modules/figures/package.json" }, { - "path": "node_modules/external-editor/package.json" + "path": "node_modules/power-assert-util-string-width/package.json" }, { - "path": "node_modules/string.prototype.trimright/package.json" + "path": "node_modules/multi-stage-sourcemap/package.json" }, { - "path": "node_modules/is-installed-globally/package.json" + "path": "node_modules/multi-stage-sourcemap/node_modules/source-map/package.json" }, { - "path": "node_modules/fast-deep-equal/package.json" + "path": "node_modules/abort-controller/package.json" }, { - "path": "node_modules/css-select/package.json" + "path": "node_modules/widest-line/package.json" }, { - "path": "node_modules/core-util-is/package.json" + "path": "node_modules/eslint-plugin-es/package.json" }, { - "path": "node_modules/empower/package.json" + "path": "node_modules/eslint-plugin-es/node_modules/eslint-utils/package.json" }, { - "path": "node_modules/path-type/package.json" + "path": "node_modules/eslint-plugin-es/node_modules/regexpp/package.json" }, { - "path": "node_modules/define-properties/package.json" + "path": "node_modules/boxen/package.json" }, { - "path": "node_modules/resolve/package.json" + "path": "node_modules/boxen/node_modules/chalk/package.json" }, { - "path": "node_modules/object-keys/package.json" + "path": "node_modules/glob/package.json" }, { - "path": "node_modules/parseurl/package.json" + "path": "node_modules/buffer-equal-constant-time/package.json" }, { - "path": "node_modules/statuses/package.json" + "path": "node_modules/strip-ansi/package.json" }, { - "path": "node_modules/p-limit/package.json" + "path": "node_modules/acorn-es7-plugin/package.json" }, { - "path": "node_modules/destroy/package.json" + "path": "node_modules/acorn/package.json" }, { - "path": "node_modules/read-pkg-up/package.json" + "path": "node_modules/spdx-expression-parse/package.json" }, { - "path": "node_modules/path-is-absolute/package.json" + "path": "node_modules/read-pkg/package.json" }, { - "path": "node_modules/punycode/package.json" + "path": "node_modules/read-pkg/node_modules/type-fest/package.json" }, { - "path": "node_modules/error-ex/package.json" + "path": "node_modules/node-environment-flags/package.json" }, { - "path": "node_modules/boolbase/package.json" + "path": "node_modules/node-environment-flags/node_modules/semver/package.json" }, { - "path": "node_modules/@sindresorhus/is/package.json" + "path": "node_modules/ansi-styles/package.json" }, { - "path": "node_modules/mimic-response/package.json" + "path": "node_modules/escallmatch/package.json" }, { - "path": "node_modules/indent-string/package.json" + "path": "node_modules/escallmatch/node_modules/esprima/package.json" }, { - "path": "node_modules/append-transform/package.json" + "path": "node_modules/is-typedarray/package.json" }, { - "path": "node_modules/neo-async/package.json" + "path": "node_modules/callsites/package.json" }, { - "path": "node_modules/diff-match-patch/package.json" + "path": "node_modules/safe-buffer/package.json" }, { - "path": "node_modules/jsesc/package.json" + "path": "node_modules/type-fest/package.json" }, { - "path": "node_modules/power-assert-context-formatter/package.json" + "path": "node_modules/espree/package.json" }, { - "path": "node_modules/is-symbol/package.json" + "path": "node_modules/server-destroy/package.json" }, { - "path": "node_modules/through/package.json" + "path": "node_modules/rc/package.json" }, { - "path": "node_modules/http-cache-semantics/package.json" + "path": "node_modules/rc/node_modules/minimist/package.json" }, { - "path": "node_modules/ms/package.json" + "path": "node_modules/rc/node_modules/strip-json-comments/package.json" }, { - "path": "node_modules/nice-try/package.json" + "path": "node_modules/fs.realpath/package.json" }, { - "path": "node_modules/js2xmlparser/package.json" + "path": "node_modules/es6-set/package.json" }, { - "path": "node_modules/mimic-fn/package.json" + "path": "node_modules/es6-set/node_modules/es6-symbol/package.json" }, { - "path": "node_modules/which-module/package.json" + "path": "node_modules/js-yaml/package.json" }, { - "path": "node_modules/debug/package.json" + "path": "node_modules/ajv/package.json" }, { - "path": "node_modules/path-key/package.json" + "path": "node_modules/prettier-linter-helpers/package.json" }, { - "path": "node_modules/imurmurhash/package.json" + "path": "node_modules/p-finally/package.json" }, { - "path": "node_modules/catharsis/package.json" + "path": "node_modules/redent/package.json" }, { - "path": "node_modules/node-environment-flags/package.json" + "path": "node_modules/diff-match-patch/package.json" }, { - "path": "node_modules/node-environment-flags/node_modules/semver/package.json" + "path": "node_modules/signal-exit/package.json" }, { - "path": "node_modules/require-directory/package.json" + "path": "node_modules/core-js/package.json" }, { - "path": "node_modules/merge-estraverse-visitors/package.json" + "path": "node_modules/package-json/package.json" }, { - "path": "node_modules/js-yaml/package.json" + "path": "node_modules/package-json/node_modules/semver/package.json" }, { - "path": "node_modules/p-finally/package.json" + "path": "node_modules/indexof/package.json" }, { - "path": "node_modules/next-tick/package.json" + "path": "node_modules/eslint-utils/package.json" }, { - "path": "node_modules/mime/package.json" + "path": "node_modules/p-try/package.json" }, { - "path": "node_modules/es-to-primitive/package.json" + "path": "node_modules/empower/package.json" }, { - "path": "node_modules/callsites/package.json" + "path": "node_modules/external-editor/package.json" }, { - "path": "node_modules/parse5/package.json" + "path": "node_modules/html-escaper/package.json" }, { - "path": "node_modules/configstore/package.json" + "path": "node_modules/shebang-regex/package.json" }, { - "path": "node_modules/unpipe/package.json" + "path": "node_modules/regexpp/package.json" }, { - "path": "node_modules/merge-source-map/package.json" + "path": "node_modules/p-cancelable/package.json" }, { - "path": "node_modules/agent-base/package.json" + "path": "node_modules/set-blocking/package.json" }, { - "path": "node_modules/extend/package.json" + "path": "node_modules/es6-symbol/package.json" }, { - "path": "node_modules/eslint-utils/package.json" + "path": "node_modules/encodeurl/package.json" }, { - "path": "node_modules/is-promise/package.json" + "path": "node_modules/table/package.json" }, { - "path": "node_modules/rimraf/package.json" + "path": "node_modules/table/node_modules/strip-ansi/package.json" }, { - "path": "node_modules/inquirer/package.json" + "path": "node_modules/table/node_modules/is-fullwidth-code-point/package.json" }, { - "path": "node_modules/concat-map/package.json" + "path": "node_modules/table/node_modules/ansi-regex/package.json" }, { - "path": "node_modules/word-wrap/package.json" + "path": "node_modules/table/node_modules/string-width/package.json" }, { - "path": "node_modules/fresh/package.json" + "path": "node_modules/table/node_modules/emoji-regex/package.json" }, { - "path": "node_modules/deep-extend/package.json" + "path": "node_modules/has-symbols/package.json" }, { - "path": "node_modules/glob-parent/package.json" + "path": "node_modules/escodegen/package.json" }, { - "path": "node_modules/node-fetch/package.json" + "path": "node_modules/escodegen/node_modules/source-map/package.json" }, { - "path": "node_modules/indexof/package.json" + "path": "node_modules/escodegen/node_modules/esprima/package.json" }, { - "path": "node_modules/power-assert-renderer-comparison/package.json" + "path": "node_modules/unpipe/package.json" }, { - "path": "node_modules/package-hash/package.json" + "path": "node_modules/dot-prop/package.json" }, { - "path": "node_modules/es5-ext/package.json" + "path": "node_modules/es-abstract/package.json" }, { - "path": "node_modules/@grpc/grpc-js/package.json" + "path": "node_modules/update-notifier/package.json" }, { - "path": "node_modules/@grpc/proto-loader/package.json" + "path": "node_modules/update-notifier/node_modules/chalk/package.json" }, { - "path": "node_modules/espower-location-detector/package.json" + "path": "node_modules/domutils/package.json" }, { - "path": "node_modules/espower-location-detector/node_modules/source-map/package.json" + "path": "node_modules/find-up/package.json" }, { - "path": "node_modules/brace-expansion/package.json" + "path": "node_modules/event-emitter/package.json" }, { - "path": "node_modules/p-timeout/package.json" + "path": "node_modules/parse-json/package.json" }, { - "path": "node_modules/js-tokens/package.json" + "path": "node_modules/linkify-it/package.json" }, { - "path": "node_modules/onetime/package.json" + "path": "node_modules/ignore/package.json" }, { - "path": "node_modules/empower-core/package.json" + "path": "node_modules/cross-spawn/package.json" }, { - "path": "node_modules/safe-buffer/package.json" + "path": "node_modules/etag/package.json" }, { - "path": "node_modules/loud-rejection/package.json" + "path": "node_modules/empower-assert/package.json" }, { - "path": "node_modules/type-fest/package.json" + "path": "node_modules/is-extglob/package.json" }, { - "path": "node_modules/es6-symbol/package.json" + "path": "node_modules/json-bigint/package.json" }, { - "path": "node_modules/es6-promisify/package.json" + "path": "node_modules/strip-json-comments/package.json" }, { - "path": "node_modules/serve-static/package.json" + "path": "node_modules/traverse/package.json" }, { - "path": "node_modules/unique-string/package.json" + "path": "node_modules/escope/package.json" }, { - "path": "node_modules/boxen/package.json" + "path": "node_modules/prettier/package.json" }, { - "path": "node_modules/boxen/node_modules/type-fest/package.json" + "path": "node_modules/mime/package.json" }, { - "path": "node_modules/boxen/node_modules/is-fullwidth-code-point/package.json" + "path": "node_modules/google-auth-library/package.json" }, { - "path": "node_modules/boxen/node_modules/string-width/package.json" + "path": "node_modules/json-stable-stringify-without-jsonify/package.json" }, { - "path": "node_modules/boxen/node_modules/camelcase/package.json" + "path": "node_modules/string.prototype.trimleft/package.json" }, { - "path": "node_modules/boxen/node_modules/emoji-regex/package.json" + "path": "node_modules/get-stdin/package.json" }, { - "path": "node_modules/jsdoc-fresh/package.json" + "path": "node_modules/espower/package.json" }, { - "path": "node_modules/jsdoc-fresh/node_modules/taffydb/package.json" + "path": "node_modules/espower/node_modules/source-map/package.json" }, { - "path": "node_modules/ini/package.json" + "path": "node_modules/minimatch/package.json" }, { - "path": "node_modules/mdurl/package.json" + "path": "node_modules/json-buffer/package.json" }, { - "path": "node_modules/http-errors/package.json" + "path": "node_modules/escape-string-regexp/package.json" }, { - "path": "node_modules/global-dirs/package.json" + "path": "node_modules/nth-check/package.json" }, { - "path": "node_modules/type-name/package.json" + "path": "node_modules/is-date-object/package.json" }, { - "path": "node_modules/buffer-equal-constant-time/package.json" + "path": "node_modules/lowercase-keys/package.json" }, { - "path": "node_modules/es6-promise/package.json" + "path": "node_modules/onetime/package.json" }, { - "path": "node_modules/normalize-url/package.json" + "path": "node_modules/argv/package.json" }, { - "path": "node_modules/registry-url/package.json" + "path": "node_modules/codecov/package.json" }, { - "path": "node_modules/pseudomap/package.json" + "path": "node_modules/uri-js/package.json" }, { - "path": "node_modules/latest-version/package.json" + "path": "node_modules/power-assert-renderer-comparison/package.json" }, { - "path": "node_modules/espower/package.json" + "path": "node_modules/locate-path/package.json" }, { - "path": "node_modules/espower/node_modules/source-map/package.json" + "path": "node_modules/text-table/package.json" }, { - "path": "node_modules/isarray/package.json" + "path": "node_modules/p-timeout/package.json" }, { - "path": "node_modules/cacheable-request/package.json" + "path": "node_modules/progress/package.json" }, { - "path": "node_modules/cacheable-request/node_modules/get-stream/package.json" + "path": "node_modules/es5-ext/package.json" }, { - "path": "node_modules/cacheable-request/node_modules/lowercase-keys/package.json" + "path": "node_modules/statuses/package.json" }, { - "path": "node_modules/toidentifier/package.json" + "path": "node_modules/markdown-it-anchor/package.json" }, { - "path": "node_modules/to-readable-stream/package.json" + "path": "node_modules/jsonexport/package.json" }, { - "path": "node_modules/quick-lru/package.json" + "path": "node_modules/domhandler/package.json" }, { - "path": "node_modules/regexp.prototype.flags/package.json" + "path": "node_modules/mkdirp/package.json" }, { - "path": "node_modules/which/package.json" + "path": "node_modules/is-installed-globally/package.json" }, { - "path": "node_modules/spdx-correct/package.json" + "path": "node_modules/http-cache-semantics/package.json" }, { - "path": "node_modules/escape-string-regexp/package.json" + "path": "node_modules/empower-core/package.json" }, { - "path": "node_modules/ansi-regex/package.json" + "path": "node_modules/string_decoder/package.json" }, { - "path": "node_modules/wrap-ansi/package.json" + "path": "node_modules/htmlparser2/package.json" }, { - "path": "node_modules/wrap-ansi/node_modules/is-fullwidth-code-point/package.json" + "path": "node_modules/htmlparser2/node_modules/readable-stream/package.json" }, { - "path": "node_modules/wrap-ansi/node_modules/string-width/package.json" + "path": "node_modules/readable-stream/package.json" }, { - "path": "node_modules/wrap-ansi/node_modules/emoji-regex/package.json" + "path": "node_modules/send/package.json" }, { - "path": "node_modules/update-notifier/package.json" + "path": "node_modules/send/node_modules/mime/package.json" }, { - "path": "node_modules/strip-indent/package.json" + "path": "node_modules/send/node_modules/debug/package.json" }, { - "path": "node_modules/has/package.json" + "path": "node_modules/send/node_modules/debug/node_modules/ms/package.json" }, { - "path": "node_modules/release-zalgo/package.json" + "path": "node_modules/send/node_modules/ms/package.json" }, { - "path": "node_modules/browser-stdout/package.json" + "path": "node_modules/convert-source-map/package.json" }, { - "path": "node_modules/esquery/package.json" + "path": "node_modules/js-tokens/package.json" }, { - "path": "node_modules/bluebird/package.json" + "path": "node_modules/es6-weak-map/package.json" }, { - "path": "node_modules/ext/package.json" + "path": "node_modules/array-filter/package.json" }, { - "path": "node_modules/ext/node_modules/type/package.json" + "path": "node_modules/es6-map/package.json" }, { - "path": "node_modules/argparse/package.json" + "path": "node_modules/to-readable-stream/package.json" }, { - "path": "node_modules/is-ci/package.json" + "path": "node_modules/type-name/package.json" }, { - "path": "node_modules/escallmatch/package.json" + "path": "node_modules/regexp.prototype.flags/package.json" }, { - "path": "node_modules/escallmatch/node_modules/esprima/package.json" + "path": "node_modules/deep-equal/package.json" }, { - "path": "node_modules/google-p12-pem/package.json" + "path": "node_modules/graceful-fs/package.json" }, { - "path": "node_modules/d/package.json" + "path": "node_modules/chalk/package.json" }, { - "path": "node_modules/acorn-jsx/package.json" + "path": "node_modules/chalk/node_modules/has-flag/package.json" }, { - "path": "node_modules/text-table/package.json" + "path": "node_modules/chalk/node_modules/ansi-styles/package.json" }, { - "path": "node_modules/color-name/package.json" + "path": "node_modules/chalk/node_modules/supports-color/package.json" }, { - "path": "node_modules/linkify-it/package.json" + "path": "node_modules/chalk/node_modules/color-name/package.json" }, { - "path": "node_modules/minimist/package.json" + "path": "node_modules/chalk/node_modules/color-convert/package.json" }, { - "path": "node_modules/pump/package.json" + "path": "node_modules/write/package.json" }, { - "path": "node_modules/util-deprecate/package.json" + "path": "node_modules/ext/package.json" }, { - "path": "node_modules/flat/package.json" + "path": "node_modules/ext/node_modules/type/package.json" }, { - "path": "node_modules/load-json-file/package.json" + "path": "node_modules/yargs/package.json" }, { - "path": "node_modules/locate-path/package.json" + "path": "node_modules/through/package.json" }, { - "path": "node_modules/is-regex/package.json" + "path": "node_modules/jsdoc-fresh/package.json" }, { - "path": "node_modules/eslint-plugin-node/package.json" + "path": "node_modules/jsdoc-fresh/node_modules/taffydb/package.json" }, { - "path": "node_modules/eslint-plugin-node/node_modules/ignore/package.json" + "path": "node_modules/parseurl/package.json" }, { - "path": "node_modules/yallist/package.json" + "path": "node_modules/setprototypeof/package.json" }, { - "path": "node_modules/semver-diff/package.json" + "path": "node_modules/jwa/package.json" }, { - "path": "node_modules/semver-diff/node_modules/semver/package.json" + "path": "node_modules/camelcase/package.json" }, { - "path": "node_modules/ansi-colors/package.json" + "path": "node_modules/deep-extend/package.json" }, { - "path": "node_modules/file-entry-cache/package.json" + "path": "node_modules/inflight/package.json" }, { - "path": "node_modules/fs.realpath/package.json" + "path": "node_modules/istanbul-reports/package.json" }, { - "path": "node_modules/execa/package.json" + "path": "node_modules/es6-iterator/package.json" }, { - "path": "node_modules/execa/node_modules/yallist/package.json" + "path": "node_modules/run-async/package.json" }, { - "path": "node_modules/execa/node_modules/cross-spawn/package.json" + "path": "node_modules/@bcoe/v8-coverage/package.json" }, { - "path": "node_modules/execa/node_modules/lru-cache/package.json" + "path": "node_modules/esquery/package.json" }, { - "path": "node_modules/execa/node_modules/is-stream/package.json" + "path": "node_modules/resolve/package.json" }, { - "path": "node_modules/clone-response/package.json" + "path": "node_modules/functional-red-black-tree/package.json" }, { - "path": "node_modules/object-is/package.json" + "path": "node_modules/inquirer/package.json" }, { - "path": "node_modules/rxjs/package.json" + "path": "node_modules/inquirer/node_modules/strip-ansi/package.json" }, { - "path": "node_modules/teeny-request/package.json" + "path": "node_modules/inquirer/node_modules/ansi-regex/package.json" }, { - "path": "node_modules/teeny-request/node_modules/https-proxy-agent/package.json" + "path": "node_modules/json-schema-traverse/package.json" }, { - "path": "node_modules/spawn-wrap/package.json" + "path": "node_modules/meow/package.json" }, { - "path": "node_modules/istanbul-lib-instrument/package.json" + "path": "node_modules/es-to-primitive/package.json" }, { - "path": "node_modules/eslint-plugin-es/package.json" + "path": "node_modules/ini/package.json" }, { - "path": "node_modules/eslint-plugin-es/node_modules/regexpp/package.json" + "path": "node_modules/call-signature/package.json" }, { - "path": "node_modules/signal-exit/package.json" + "path": "node_modules/dom-serializer/package.json" }, { - "path": "node_modules/json-bigint/package.json" + "path": "node_modules/on-finished/package.json" }, { - "path": "node_modules/es6-error/package.json" + "path": "node_modules/is-fullwidth-code-point/package.json" }, { - "path": "node_modules/through2/package.json" + "path": "node_modules/ansi-colors/package.json" }, { - "path": "node_modules/minimist-options/package.json" + "path": "node_modules/end-of-stream/package.json" }, { - "path": "node_modules/minimist-options/node_modules/arrify/package.json" + "path": "node_modules/require-main-filename/package.json" }, { - "path": "node_modules/cp-file/package.json" + "path": "node_modules/supports-color/package.json" }, { - "path": "node_modules/cp-file/node_modules/make-dir/package.json" + "path": "node_modules/eslint-visitor-keys/package.json" }, { - "path": "node_modules/cp-file/node_modules/pify/package.json" + "path": "node_modules/get-caller-file/package.json" }, { - "path": "node_modules/cp-file/node_modules/semver/package.json" + "path": "node_modules/brace-expansion/package.json" }, { - "path": "node_modules/nyc/package.json" + "path": "node_modules/ignore-walk/package.json" }, { - "path": "node_modules/nyc/node_modules/p-limit/package.json" + "path": "node_modules/urlgrey/package.json" }, { - "path": "node_modules/nyc/node_modules/locate-path/package.json" + "path": "node_modules/balanced-match/package.json" }, { - "path": "node_modules/nyc/node_modules/find-up/package.json" + "path": "node_modules/markdown-it/package.json" }, { - "path": "node_modules/nyc/node_modules/make-dir/package.json" + "path": "node_modules/rxjs/package.json" }, { - "path": "node_modules/nyc/node_modules/pify/package.json" + "path": "node_modules/iconv-lite/package.json" }, { - "path": "node_modules/nyc/node_modules/yargs-parser/package.json" + "path": "node_modules/is-plain-obj/package.json" }, { - "path": "node_modules/nyc/node_modules/p-try/package.json" + "path": "node_modules/fast-text-encoding/package.json" }, { - "path": "node_modules/nyc/node_modules/p-locate/package.json" + "path": "node_modules/os-tmpdir/package.json" }, { - "path": "node_modules/nyc/node_modules/semver/package.json" + "path": "node_modules/test-exclude/package.json" }, { - "path": "node_modules/nyc/node_modules/camelcase/package.json" + "path": "node_modules/resolve-from/package.json" }, { - "path": "node_modules/depd/package.json" + "path": "node_modules/source-map-support/package.json" }, { - "path": "node_modules/table/package.json" + "path": "node_modules/source-map-support/node_modules/source-map/package.json" }, { - "path": "node_modules/table/node_modules/is-fullwidth-code-point/package.json" + "path": "node_modules/punycode/package.json" }, { - "path": "node_modules/table/node_modules/string-width/package.json" + "path": "node_modules/ee-first/package.json" }, { - "path": "node_modules/table/node_modules/emoji-regex/package.json" + "path": "node_modules/p-locate/package.json" }, { - "path": "node_modules/is-extglob/package.json" + "path": "node_modules/@types/long/package.json" }, { - "path": "node_modules/ci-info/package.json" + "path": "node_modules/@types/minimist/package.json" }, { - "path": "node_modules/lodash.has/package.json" + "path": "node_modules/@types/node/package.json" }, { - "path": "node_modules/require-main-filename/package.json" + "path": "node_modules/@types/istanbul-lib-coverage/package.json" }, { - "path": "node_modules/foreground-child/package.json" + "path": "node_modules/@types/is-windows/package.json" }, { - "path": "node_modules/foreground-child/node_modules/yallist/package.json" + "path": "node_modules/@types/fs-extra/package.json" }, { - "path": "node_modules/foreground-child/node_modules/cross-spawn/package.json" + "path": "node_modules/@types/color-name/package.json" }, { - "path": "node_modules/foreground-child/node_modules/lru-cache/package.json" + "path": "node_modules/@types/normalize-package-data/package.json" }, { - "path": "node_modules/xtend/package.json" + "path": "node_modules/wide-align/package.json" }, { - "path": "node_modules/markdown-it-anchor/package.json" + "path": "node_modules/wide-align/node_modules/strip-ansi/package.json" }, { - "path": "node_modules/string_decoder/package.json" + "path": "node_modules/wide-align/node_modules/is-fullwidth-code-point/package.json" }, { - "path": "node_modules/node-forge/package.json" + "path": "node_modules/wide-align/node_modules/ansi-regex/package.json" }, { - "path": "node_modules/type/package.json" + "path": "node_modules/wide-align/node_modules/string-width/package.json" }, { - "path": "node_modules/test-exclude/package.json" + "path": "node_modules/is-promise/package.json" }, { - "path": "node_modules/test-exclude/node_modules/p-limit/package.json" + "path": "node_modules/spdx-exceptions/package.json" }, { - "path": "node_modules/test-exclude/node_modules/read-pkg-up/package.json" + "path": "node_modules/slice-ansi/package.json" }, { - "path": "node_modules/test-exclude/node_modules/locate-path/package.json" + "path": "node_modules/slice-ansi/node_modules/ansi-styles/package.json" }, { - "path": "node_modules/test-exclude/node_modules/find-up/package.json" + "path": "node_modules/slice-ansi/node_modules/is-fullwidth-code-point/package.json" }, { - "path": "node_modules/test-exclude/node_modules/p-try/package.json" + "path": "node_modules/slice-ansi/node_modules/color-name/package.json" }, { - "path": "node_modules/test-exclude/node_modules/p-locate/package.json" + "path": "node_modules/slice-ansi/node_modules/color-convert/package.json" }, { - "path": "node_modules/es6-map/package.json" + "path": "node_modules/eslint-plugin-prettier/package.json" }, { - "path": "node_modules/strip-ansi/package.json" + "path": "node_modules/decompress-response/package.json" }, { - "path": "node_modules/strip-ansi/node_modules/ansi-regex/package.json" + "path": "node_modules/parent-module/package.json" }, { - "path": "node_modules/npm-run-path/package.json" + "path": "node_modules/jsdoc-region-tag/package.json" }, { - "path": "node_modules/estraverse/package.json" + "path": "node_modules/domelementtype/package.json" }, { - "path": "node_modules/find-cache-dir/package.json" + "path": "node_modules/typedarray-to-buffer/package.json" }, { - "path": "node_modules/find-cache-dir/node_modules/make-dir/package.json" + "path": "node_modules/typedarray-to-buffer/.airtap.yml" }, { - "path": "node_modules/find-cache-dir/node_modules/pify/package.json" + "path": "node_modules/typedarray-to-buffer/.travis.yml" }, { - "path": "node_modules/find-cache-dir/node_modules/semver/package.json" + "path": "node_modules/typedarray-to-buffer/index.js" }, { - "path": "node_modules/espree/package.json" + "path": "node_modules/typedarray-to-buffer/LICENSE" }, { - "path": "node_modules/bignumber.js/package.json" + "path": "node_modules/typedarray-to-buffer/README.md" }, { - "path": "node_modules/walkdir/package.json" + "path": "node_modules/typedarray-to-buffer/test/basic.js" }, { - "path": "node_modules/strip-bom/package.json" + "path": "node_modules/sprintf-js/package.json" }, { - "path": "node_modules/figures/package.json" + "path": "node_modules/path-key/package.json" }, { - "path": "node_modules/parse-json/package.json" + "path": "node_modules/isarray/package.json" }, { - "path": "node_modules/run-async/package.json" + "path": "node_modules/@grpc/grpc-js/package.json" }, { - "path": "node_modules/es6-weak-map/package.json" + "path": "node_modules/@grpc/grpc-js/node_modules/semver/package.json" }, { - "path": "node_modules/decompress-response/package.json" + "path": "node_modules/@grpc/proto-loader/package.json" }, { - "path": "node_modules/to-fast-properties/package.json" + "path": "node_modules/responselike/package.json" }, { - "path": "node_modules/color-convert/package.json" + "path": "node_modules/istanbul-lib-coverage/package.json" }, { - "path": "node_modules/functional-red-black-tree/package.json" + "path": "node_modules/minimist-options/package.json" }, { - "path": "node_modules/prettier-linter-helpers/package.json" + "path": "node_modules/minimist-options/node_modules/arrify/package.json" }, { - "path": "node_modules/entities/package.json" + "path": "node_modules/latest-version/package.json" }, { - "path": "node_modules/read-pkg/package.json" + "path": "node_modules/amdefine/package.json" }, { - "path": "node_modules/istanbul-lib-report/package.json" + "path": "node_modules/estraverse/package.json" }, { - "path": "node_modules/istanbul-lib-report/node_modules/make-dir/package.json" + "path": "node_modules/http-errors/package.json" }, { - "path": "node_modules/istanbul-lib-report/node_modules/pify/package.json" + "path": "node_modules/term-size/package.json" }, { - "path": "node_modules/istanbul-lib-report/node_modules/semver/package.json" + "path": "node_modules/bluebird/package.json" }, { - "path": "node_modules/istanbul-lib-report/node_modules/supports-color/package.json" + "path": "node_modules/natural-compare/package.json" }, { - "path": "node_modules/json-stable-stringify-without-jsonify/package.json" + "path": "node_modules/xdg-basedir/package.json" }, { - "path": "node_modules/package-json/package.json" + "path": "node_modules/ansi-align/package.json" }, { - "path": "node_modules/is-path-inside/package.json" + "path": "node_modules/ansi-align/node_modules/strip-ansi/package.json" }, { - "path": "node_modules/cross-spawn/README.md" + "path": "node_modules/ansi-align/node_modules/is-fullwidth-code-point/package.json" }, { - "path": "node_modules/cross-spawn/index.js" + "path": "node_modules/ansi-align/node_modules/ansi-regex/package.json" }, { - "path": "node_modules/cross-spawn/LICENSE" + "path": "node_modules/ansi-align/node_modules/string-width/package.json" }, { - "path": "node_modules/cross-spawn/CHANGELOG.md" + "path": "node_modules/ansi-align/node_modules/emoji-regex/package.json" }, { - "path": "node_modules/cross-spawn/package.json" + "path": "node_modules/js2xmlparser/package.json" }, { - "path": "node_modules/cross-spawn/node_modules/semver/package.json" + "path": "node_modules/teeny-request/package.json" }, { - "path": "node_modules/cross-spawn/lib/enoent.js" + "path": "node_modules/teeny-request/node_modules/https-proxy-agent/package.json" }, { - "path": "node_modules/cross-spawn/lib/parse.js" + "path": "node_modules/espower-source/package.json" }, { - "path": "node_modules/cross-spawn/lib/util/readShebang.js" + "path": "node_modules/espower-source/node_modules/acorn/package.json" }, { - "path": "node_modules/cross-spawn/lib/util/escape.js" + "path": "node_modules/d/package.json" }, { - "path": "node_modules/cross-spawn/lib/util/resolveCommand.js" + "path": "node_modules/is-stream/package.json" }, { - "path": "node_modules/intelli-espower-loader/package.json" + "path": "node_modules/debug/package.json" }, { - "path": "node_modules/hosted-git-info/package.json" + "path": "node_modules/espurify/package.json" }, { - "path": "node_modules/argv/package.json" + "path": "node_modules/wrappy/package.json" }, { - "path": "node_modules/levn/package.json" + "path": "node_modules/import-fresh/package.json" }, { - "path": "node_modules/json-parse-better-errors/package.json" + "path": "node_modules/eslint/package.json" }, { - "path": "node_modules/array-find/package.json" + "path": "node_modules/eslint/node_modules/strip-ansi/package.json" }, { - "path": "node_modules/uuid/package.json" + "path": "node_modules/eslint/node_modules/shebang-regex/package.json" }, { - "path": "node_modules/object-inspect/package.json" + "path": "node_modules/eslint/node_modules/cross-spawn/package.json" }, { - "path": "node_modules/uc.micro/package.json" + "path": "node_modules/eslint/node_modules/cross-spawn/CHANGELOG.md" }, { - "path": "node_modules/retry-request/package.json" + "path": "node_modules/eslint/node_modules/cross-spawn/index.js" }, { - "path": "node_modules/retry-request/node_modules/debug/package.json" + "path": "node_modules/eslint/node_modules/cross-spawn/LICENSE" }, { - "path": "node_modules/find-up/package.json" + "path": "node_modules/eslint/node_modules/cross-spawn/README.md" }, { - "path": "node_modules/underscore/package.json" + "path": "node_modules/eslint/node_modules/cross-spawn/node_modules/semver/package.json" }, { - "path": "node_modules/import-lazy/package.json" + "path": "node_modules/eslint/node_modules/cross-spawn/lib/enoent.js" }, { - "path": "node_modules/flatted/package.json" + "path": "node_modules/eslint/node_modules/cross-spawn/lib/parse.js" }, { - "path": "node_modules/acorn-es7-plugin/package.json" + "path": "node_modules/eslint/node_modules/cross-spawn/lib/util/readShebang.js" }, { - "path": "node_modules/ee-first/package.json" + "path": "node_modules/eslint/node_modules/cross-spawn/lib/util/escape.js" }, { - "path": "node_modules/restore-cursor/package.json" + "path": "node_modules/eslint/node_modules/cross-spawn/lib/util/resolveCommand.js" }, { - "path": "node_modules/defer-to-connect/package.json" + "path": "node_modules/eslint/node_modules/path-key/package.json" }, { - "path": "node_modules/escape-html/package.json" + "path": "node_modules/eslint/node_modules/debug/package.json" }, { - "path": "node_modules/is-date-object/package.json" + "path": "node_modules/eslint/node_modules/semver/package.json" }, { - "path": "node_modules/is-fullwidth-code-point/package.json" + "path": "node_modules/eslint/node_modules/ansi-regex/package.json" }, { - "path": "node_modules/duplexify/package.json" + "path": "node_modules/eslint/node_modules/shebang-command/package.json" }, { - "path": "node_modules/set-blocking/package.json" + "path": "node_modules/eslint/node_modules/which/package.json" }, { - "path": "node_modules/linkinator/package.json" + "path": "node_modules/es6-promise/package.json" }, { - "path": "node_modules/linkinator/node_modules/chalk/package.json" + "path": "node_modules/is-yarn-global/package.json" }, { - "path": "node_modules/linkinator/node_modules/has-flag/package.json" + "path": "node_modules/array-find/package.json" }, { - "path": "node_modules/linkinator/node_modules/color-name/package.json" + "path": "node_modules/imurmurhash/package.json" }, { - "path": "node_modules/linkinator/node_modules/color-convert/package.json" + "path": "node_modules/globals/package.json" }, { - "path": "node_modules/linkinator/node_modules/ansi-styles/package.json" + "path": "node_modules/is-ci/package.json" }, { - "path": "node_modules/linkinator/node_modules/supports-color/package.json" + "path": "node_modules/mdurl/package.json" }, { - "path": "node_modules/domelementtype/package.json" + "path": "node_modules/error-ex/package.json" }, { - "path": "node_modules/htmlparser2/package.json" + "path": "node_modules/is-url/package.json" }, { - "path": "node_modules/htmlparser2/node_modules/readable-stream/package.json" + "path": "node_modules/stream-shift/package.json" }, { - "path": "node_modules/send/package.json" + "path": "node_modules/ci-info/package.json" }, { - "path": "node_modules/send/node_modules/ms/package.json" + "path": "node_modules/path-exists/package.json" }, { - "path": "node_modules/send/node_modules/debug/package.json" + "path": "node_modules/esrecurse/package.json" }, { - "path": "node_modules/send/node_modules/debug/node_modules/ms/package.json" + "path": "node_modules/lru-cache/package.json" }, { - "path": "node_modules/send/node_modules/mime/package.json" + "path": "node_modules/trim-newlines/package.json" }, { - "path": "node_modules/xmlcreate/package.json" + "path": "node_modules/json-parse-better-errors/package.json" }, { - "path": "node_modules/strip-eof/package.json" + "path": "node_modules/retry-request/package.json" }, { - "path": "node_modules/make-dir/package.json" + "path": "node_modules/retry-request/node_modules/debug/package.json" }, { - "path": "node_modules/path-is-inside/package.json" + "path": "node_modules/merge-estraverse-visitors/package.json" }, { - "path": "node_modules/is-yarn-global/package.json" + "path": "node_modules/arrify/package.json" }, { - "path": "node_modules/eslint-plugin-prettier/package.json" + "path": "node_modules/is-windows/package.json" }, { - "path": "node_modules/log-symbols/package.json" + "path": "node_modules/call-matcher/package.json" }, { - "path": "node_modules/taffydb/package.json" + "path": "node_modules/furi/package.json" }, { - "path": "node_modules/url-parse-lax/package.json" + "path": "node_modules/v8-compile-cache/package.json" }, { - "path": "node_modules/fast-diff/package.json" + "path": "node_modules/decamelize/package.json" }, { - "path": "node_modules/chardet/package.json" + "path": "node_modules/jws/package.json" }, { - "path": "node_modules/power-assert-renderer-assertion/package.json" + "path": "node_modules/unique-string/package.json" }, { - "path": "node_modules/cliui/package.json" + "path": "node_modules/css-what/package.json" }, { - "path": "node_modules/cliui/node_modules/is-fullwidth-code-point/package.json" + "path": "node_modules/crypto-random-string/package.json" }, { - "path": "node_modules/cliui/node_modules/string-width/package.json" + "path": "node_modules/url-parse-lax/package.json" }, { - "path": "node_modules/cliui/node_modules/emoji-regex/package.json" + "path": "node_modules/@istanbuljs/schema/package.json" }, { - "path": "node_modules/prepend-http/package.json" + "path": "node_modules/ms/package.json" }, { - "path": "node_modules/uri-js/package.json" + "path": "node_modules/decamelize-keys/package.json" }, { - "path": "node_modules/@szmarczak/http-timer/package.json" + "path": "node_modules/decamelize-keys/node_modules/map-obj/package.json" }, { - "path": "node_modules/@babel/highlight/package.json" + "path": "node_modules/make-dir/package.json" }, { - "path": "node_modules/@babel/helper-split-export-declaration/package.json" + "path": "node_modules/make-dir/node_modules/semver/package.json" }, { - "path": "node_modules/@babel/types/package.json" + "path": "node_modules/get-stream/package.json" }, { - "path": "node_modules/@babel/parser/package.json" + "path": "node_modules/word-wrap/package.json" }, { - "path": "node_modules/@babel/helper-function-name/package.json" + "path": "node_modules/keyv/package.json" }, { - "path": "node_modules/@babel/generator/package.json" + "path": "node_modules/semver/package.json" }, { - "path": "node_modules/@babel/generator/node_modules/source-map/package.json" + "path": "node_modules/esutils/package.json" }, { - "path": "node_modules/@babel/code-frame/package.json" + "path": "node_modules/intelli-espower-loader/package.json" }, { - "path": "node_modules/@babel/helper-get-function-arity/package.json" + "path": "node_modules/color-name/package.json" }, { - "path": "node_modules/@babel/template/package.json" + "path": "node_modules/object-keys/package.json" }, { - "path": "node_modules/@babel/traverse/package.json" + "path": "node_modules/event-target-shim/package.json" }, { - "path": "node_modules/@babel/traverse/node_modules/debug/package.json" + "path": "node_modules/stringifier/package.json" }, { - "path": "node_modules/@babel/traverse/node_modules/globals/package.json" + "path": "node_modules/write-file-atomic/package.json" }, { - "path": "node_modules/fast-text-encoding/package.json" + "path": "node_modules/is-regex/package.json" }, { - "path": "node_modules/tslib/package.json" + "path": "node_modules/google-p12-pem/package.json" }, { - "path": "node_modules/normalize-package-data/package.json" + "path": "node_modules/v8-to-istanbul/package.json" }, { - "path": "node_modules/normalize-package-data/node_modules/semver/package.json" + "path": "node_modules/@szmarczak/http-timer/package.json" }, { - "path": "node_modules/mkdirp/package.json" + "path": "node_modules/growl/package.json" }, { - "path": "node_modules/cli-boxes/package.json" + "path": "node_modules/flat/package.json" }, { - "path": "node_modules/array-find-index/package.json" + "path": "node_modules/path-is-absolute/package.json" }, { - "path": "node_modules/commander/package.json" + "path": "node_modules/path-parse/package.json" }, { - "path": "node_modules/is-callable/package.json" + "path": "node_modules/node-forge/package.json" }, { - "path": "node_modules/import-fresh/package.json" + "path": "node_modules/levn/package.json" }, { - "path": "node_modules/ignore-walk/package.json" + "path": "node_modules/chardet/package.json" }, { - "path": "node_modules/type-check/package.json" + "path": "node_modules/lodash.camelcase/package.json" }, { - "path": "node_modules/camelcase-keys/package.json" + "path": "node_modules/walkdir/package.json" }, { - "path": "node_modules/event-target-shim/package.json" + "path": "node_modules/foreground-child/package.json" }, { - "path": "node_modules/trim-newlines/package.json" + "path": "node_modules/quick-lru/package.json" }, { - "path": "node_modules/glob/package.json" + "path": "node_modules/serve-static/package.json" }, { - "path": "node_modules/prettier/package.json" + "path": "node_modules/which-module/package.json" }, { - "path": "node_modules/mute-stream/package.json" + "path": "node_modules/power-assert/package.json" }, { - "path": "node_modules/diff/package.json" + "path": "node_modules/is-buffer/package.json" }, { - "path": "node_modules/power-assert-context-reducer-ast/package.json" + "path": "node_modules/fast-levenshtein/package.json" }, { - "path": "node_modules/power-assert-context-reducer-ast/node_modules/acorn/package.json" + "path": "node_modules/power-assert-context-traversal/package.json" }, { - "path": "node_modules/inflight/package.json" + "path": "node_modules/range-parser/package.json" }, { - "path": "node_modules/eslint-scope/package.json" + "path": "node_modules/type-check/package.json" }, { - "path": "node_modules/get-stdin/package.json" + "path": "node_modules/normalize-package-data/package.json" }, { - "path": "node_modules/pify/package.json" + "path": "node_modules/normalize-package-data/node_modules/semver/package.json" }, { - "path": "node_modules/string.prototype.trimleft/package.json" + "path": "node_modules/registry-auth-token/package.json" }, { - "path": "node_modules/lodash.camelcase/package.json" + "path": "node_modules/deep-is/package.json" }, { - "path": "node_modules/codecov/package.json" + "path": "node_modules/cli-boxes/package.json" }, { - "path": "node_modules/esrecurse/package.json" + "path": "node_modules/finalhandler/package.json" }, { - "path": "node_modules/domhandler/package.json" + "path": "node_modules/finalhandler/node_modules/debug/package.json" }, { - "path": "node_modules/currently-unhandled/package.json" + "path": "node_modules/finalhandler/node_modules/ms/package.json" }, { - "path": "node_modules/ansi-styles/package.json" + "path": "node_modules/optionator/package.json" }, { - "path": "node_modules/jsdoc-region-tag/package.json" + "path": "node_modules/lodash.has/package.json" }, { - "path": "node_modules/function-bind/package.json" + "path": "node_modules/xtend/package.json" }, { - "path": "node_modules/etag/package.json" + "path": "node_modules/util-deprecate/package.json" }, { - "path": "node_modules/cli-width/package.json" + "path": "node_modules/concat-map/package.json" }, { - "path": "node_modules/once/package.json" + "path": "node_modules/duplexify/package.json" }, { - "path": "node_modules/convert-source-map/package.json" + "path": "node_modules/ansi-regex/package.json" }, { - "path": "node_modules/string-width/package.json" + "path": "node_modules/hard-rejection/package.json" }, { - "path": "node_modules/string-width/node_modules/strip-ansi/package.json" + "path": "node_modules/power-assert-renderer-file/package.json" }, { - "path": "node_modules/jws/package.json" + "path": "node_modules/gaxios/package.json" }, { - "path": "node_modules/xdg-basedir/package.json" + "path": "node_modules/y18n/package.json" }, { - "path": "node_modules/has-symbols/package.json" + "path": "node_modules/clone-response/package.json" }, { - "path": "node_modules/safer-buffer/package.json" + "path": "node_modules/is-obj/package.json" }, { - "path": "node_modules/cli-cursor/package.json" + "path": "node_modules/toidentifier/package.json" }, { - "path": "node_modules/lru-cache/package.json" + "path": "node_modules/esprima/package.json" }, { - "path": "node_modules/nth-check/package.json" + "path": "node_modules/is-callable/package.json" }, { - "path": "node_modules/json-buffer/package.json" + "path": "node_modules/camelcase-keys/package.json" }, { - "path": "node_modules/duplexer3/package.json" + "path": "node_modules/is-arrayish/package.json" }, { - "path": "node_modules/lodash.at/package.json" + "path": "node_modules/fast-diff/package.json" }, { - "path": "node_modules/istanbul-lib-hook/package.json" + "path": "node_modules/configstore/package.json" }, { - "path": "node_modules/arrify/package.json" + "path": "node_modules/universal-deep-strict-equal/package.json" }, { - "path": "node_modules/get-caller-file/package.json" + "path": "node_modules/power-assert-renderer-assertion/package.json" }, { - "path": "node_modules/flat-cache/package.json" + "path": "node_modules/glob-parent/package.json" }, { - "path": "node_modules/regexpp/package.json" + "path": "node_modules/object.assign/package.json" }, { - "path": "node_modules/eslint/package.json" + "path": "node_modules/color-convert/package.json" }, { - "path": "node_modules/eslint/node_modules/debug/package.json" + "path": "node_modules/eslint-plugin-node/package.json" }, { - "path": "node_modules/yargs-parser/package.json" + "path": "node_modules/eslint-plugin-node/node_modules/eslint-utils/package.json" }, { - "path": "node_modules/eslint-config-prettier/package.json" + "path": "node_modules/eslint-plugin-node/node_modules/ignore/package.json" }, { - "path": "node_modules/strip-json-comments/package.json" + "path": "node_modules/eslint-plugin-node/node_modules/semver/package.json" }, { - "path": "node_modules/decamelize-keys/package.json" + "path": "node_modules/cliui/package.json" }, { - "path": "node_modules/decamelize-keys/node_modules/map-obj/package.json" + "path": "node_modules/cheerio/package.json" }, { - "path": "node_modules/yargs-unparser/package.json" + "path": "node_modules/flatted/package.json" }, { - "path": "node_modules/handlebars/package.json" + "path": "node_modules/parse5/package.json" }, { - "path": "node_modules/archy/package.json" + "path": "node_modules/power-assert-renderer-base/package.json" }, { - "path": "node_modules/object.getownpropertydescriptors/package.json" + "path": "node_modules/es6-promisify/package.json" }, { - "path": "node_modules/is-glob/package.json" + "path": "node_modules/shebang-command/package.json" }, { - "path": "node_modules/power-assert-formatter/package.json" + "path": "node_modules/indent-string/package.json" }, { - "path": "node_modules/inherits/package.json" + "path": "node_modules/tslib/package.json" }, { - "path": "node_modules/power-assert-util-string-width/package.json" + "path": "node_modules/prepend-http/package.json" }, { - "path": "node_modules/json-schema-traverse/package.json" + "path": "node_modules/fast-json-stable-stringify/package.json" }, { - "path": "node_modules/os-tmpdir/package.json" + "path": "node_modules/semver-diff/package.json" }, { - "path": "node_modules/write/package.json" + "path": "node_modules/semver-diff/node_modules/semver/package.json" }, { - "path": "node_modules/doctrine/package.json" + "path": "node_modules/cli-width/package.json" }, { - "path": "node_modules/marked/package.json" + "path": "node_modules/escape-html/package.json" }, { - "path": "node_modules/cheerio/package.json" + "path": "node_modules/protobufjs/package.json" }, { - "path": "node_modules/abort-controller/package.json" + "path": "node_modules/protobufjs/cli/package.json" }, { - "path": "node_modules/mocha/package.json" + "path": "node_modules/protobufjs/cli/package-lock.json" }, { - "path": "node_modules/mocha/node_modules/p-limit/package.json" + "path": "node_modules/protobufjs/cli/node_modules/source-map/package.json" }, { - "path": "node_modules/mocha/node_modules/ms/package.json" + "path": "node_modules/protobufjs/cli/node_modules/minimist/package.json" }, { - "path": "node_modules/mocha/node_modules/locate-path/package.json" + "path": "node_modules/protobufjs/cli/node_modules/commander/package.json" }, { - "path": "node_modules/mocha/node_modules/find-up/package.json" + "path": "node_modules/protobufjs/cli/node_modules/acorn/package.json" }, { - "path": "node_modules/mocha/node_modules/glob/package.json" + "path": "node_modules/protobufjs/cli/node_modules/espree/package.json" }, { - "path": "node_modules/mocha/node_modules/yargs-parser/package.json" + "path": "node_modules/protobufjs/cli/node_modules/uglify-js/package.json" }, { - "path": "node_modules/mocha/node_modules/strip-json-comments/package.json" + "path": "node_modules/protobufjs/cli/node_modules/semver/package.json" }, { - "path": "node_modules/mocha/node_modules/p-try/package.json" + "path": "node_modules/protobufjs/cli/node_modules/acorn-jsx/package.json" }, { - "path": "node_modules/mocha/node_modules/p-locate/package.json" + "path": "node_modules/protobufjs/cli/node_modules/acorn-jsx/node_modules/acorn/package.json" }, { - "path": "node_modules/mocha/node_modules/camelcase/package.json" + "path": "node_modules/has/package.json" }, { - "path": "node_modules/mocha/node_modules/supports-color/package.json" + "path": "node_modules/boolbase/package.json" }, { - "path": "node_modules/redent/package.json" + "path": "node_modules/@sindresorhus/is/package.json" }, { - "path": "node_modules/markdown-it/package.json" + "path": "node_modules/acorn-jsx/package.json" }, { - "path": "node_modules/ignore/package.json" + "path": "node_modules/mute-stream/package.json" }, { - "path": "node_modules/is-stream/package.json" + "path": "node_modules/p-queue/package.json" }, { - "path": "node_modules/os-homedir/package.json" + "path": "node_modules/cli-cursor/package.json" }, { - "path": "node_modules/tmp/package.json" + "path": "node_modules/bignumber.js/package.json" }, { - "path": "node_modules/readable-stream/package.json" + "path": "node_modules/wrap-ansi/package.json" }, { - "path": "node_modules/array-filter/package.json" + "path": "node_modules/require-directory/package.json" }, { - "path": "node_modules/power-assert/package.json" + "path": "node_modules/uuid/package.json" }, { - "path": "node_modules/p-try/package.json" + "path": "node_modules/c8/package.json" }, { - "path": "node_modules/slice-ansi/package.json" + "path": "node_modules/eslint-config-prettier/package.json" }, { - "path": "node_modules/slice-ansi/node_modules/is-fullwidth-code-point/package.json" + "path": "node_modules/function-bind/package.json" }, { - "path": "node_modules/wrappy/package.json" + "path": "node_modules/istanbul-lib-report/package.json" }, { - "path": "node_modules/on-finished/package.json" + "path": "node_modules/object-inspect/package.json" }, { - "path": "node_modules/registry-auth-token/package.json" + "path": "node_modules/entities/package.json" }, { - "path": "node_modules/eastasianwidth/package.json" + "path": "node_modules/define-properties/package.json" }, { - "path": "node_modules/caching-transform/package.json" + "path": "node_modules/has-yarn/package.json" }, { - "path": "node_modules/caching-transform/node_modules/make-dir/package.json" + "path": "node_modules/min-indent/package.json" }, { - "path": "node_modules/caching-transform/node_modules/pify/package.json" + "path": "node_modules/underscore/package.json" }, { - "path": "node_modules/caching-transform/node_modules/semver/package.json" + "path": "node_modules/power-assert-renderer-diagram/package.json" }, { - "path": "node_modules/core-js/package.json" + "path": "node_modules/browser-stdout/package.json" }, { - "path": "node_modules/istanbul-lib-source-maps/package.json" + "path": "node_modules/registry-url/package.json" }, { - "path": "node_modules/istanbul-lib-source-maps/node_modules/debug/package.json" + "path": "node_modules/which/package.json" }, { - "path": "node_modules/istanbul-lib-source-maps/node_modules/make-dir/package.json" + "path": "node_modules/@babel/highlight/package.json" }, { - "path": "node_modules/istanbul-lib-source-maps/node_modules/pify/package.json" + "path": "node_modules/@babel/code-frame/package.json" }, { - "path": "node_modules/istanbul-lib-source-maps/node_modules/semver/package.json" + "path": "node_modules/@babel/parser/package.json" }, { - "path": "node_modules/google-gax/package.json" + "path": "node_modules/strip-indent/package.json" }, { - "path": "node_modules/setprototypeof/package.json" + "path": "node_modules/map-obj/package.json" }, { - "path": "node_modules/pkg-dir/package.json" + "path": "node_modules/duplexer3/package.json" }, { - "path": "node_modules/pkg-dir/node_modules/p-limit/package.json" + "path": "node_modules/isexe/package.json" }, { - "path": "node_modules/pkg-dir/node_modules/locate-path/package.json" + "path": "node_modules/klaw/package.json" }, { - "path": "node_modules/pkg-dir/node_modules/find-up/package.json" + "path": "node_modules/inherits/package.json" }, { - "path": "node_modules/pkg-dir/node_modules/p-try/package.json" + "path": "node_modules/lodash.at/package.json" }, { - "path": "node_modules/pkg-dir/node_modules/p-locate/package.json" + "path": "node_modules/pump/package.json" }, { - "path": "node_modules/p-locate/package.json" + "path": "node_modules/spdx-license-ids/package.json" }, { - "path": "node_modules/finalhandler/package.json" + "path": "node_modules/depd/package.json" }, { - "path": "node_modules/finalhandler/node_modules/ms/package.json" + "path": "node_modules/import-lazy/package.json" }, { - "path": "node_modules/finalhandler/node_modules/debug/package.json" + "path": "node_modules/string-width/package.json" }, { - "path": "node_modules/eslint-visitor-keys/package.json" + "path": "node_modules/lines-and-columns/package.json" }, { - "path": "node_modules/lodash/package.json" + "path": "node_modules/astral-regex/package.json" }, { - "path": "node_modules/natural-compare/package.json" + "path": "node_modules/rimraf/package.json" }, { - "path": "node_modules/default-require-extensions/package.json" + "path": "node_modules/restore-cursor/package.json" }, { - "path": "node_modules/@protobufjs/aspromise/package.json" + "path": "node_modules/yallist/package.json" }, { - "path": "node_modules/@protobufjs/pool/package.json" + "path": "node_modules/emoji-regex/package.json" }, { - "path": "node_modules/@protobufjs/float/package.json" + "path": "system-test/system.js" }, { - "path": "node_modules/@protobufjs/base64/package.json" + "path": ".git/config" }, { - "path": "node_modules/@protobufjs/codegen/package.json" + "path": ".git/index" }, { - "path": "node_modules/@protobufjs/inquire/package.json" + "path": ".git/packed-refs" }, { - "path": "node_modules/@protobufjs/eventemitter/package.json" + "path": ".git/shallow" }, { - "path": "node_modules/@protobufjs/fetch/package.json" + "path": ".git/HEAD" }, { - "path": "node_modules/@protobufjs/path/package.json" + "path": ".git/refs/heads/autosynth" }, { - "path": "node_modules/@protobufjs/utf8/package.json" + "path": ".git/refs/heads/master" }, { - "path": "node_modules/https-proxy-agent/package.json" - }, - { - "path": "node_modules/ansi-escapes/package.json" - }, - { - "path": "node_modules/spdx-license-ids/package.json" - }, - { - "path": "node_modules/power-assert-renderer-diagram/package.json" - }, - { - "path": "node_modules/wide-align/package.json" - }, - { - "path": "node_modules/wide-align/node_modules/ansi-regex/package.json" - }, - { - "path": "node_modules/wide-align/node_modules/strip-ansi/package.json" - }, - { - "path": "node_modules/wide-align/node_modules/is-fullwidth-code-point/package.json" - }, - { - "path": "node_modules/wide-align/node_modules/string-width/package.json" - }, - { - "path": "node_modules/base64-js/package.json" - }, - { - "path": "node_modules/sprintf-js/package.json" - }, - { - "path": "node_modules/is-plain-obj/package.json" - }, - { - "path": "node_modules/is-arguments/package.json" - }, - { - "path": "node_modules/commondir/package.json" - }, - { - "path": "node_modules/optimist/package.json" - }, - { - "path": "node_modules/power-assert-context-traversal/package.json" - }, - { - "path": "node_modules/source-map-support/package.json" - }, - { - "path": "node_modules/source-map-support/node_modules/source-map/package.json" - }, - { - "path": "node_modules/is-npm/package.json" - }, - { - "path": "node_modules/p-cancelable/package.json" - }, - { - "path": "node_modules/v8-compile-cache/package.json" - }, - { - "path": "node_modules/semver/package.json" - }, - { - "path": "node_modules/stringifier/package.json" - }, - { - "path": "node_modules/spdx-exceptions/package.json" - }, - { - "path": "node_modules/progress/package.json" - }, - { - "path": "node_modules/camelcase/package.json" - }, - { - "path": "node_modules/urlgrey/package.json" - }, - { - "path": "node_modules/keyv/package.json" - }, - { - "path": "node_modules/validate-npm-package-license/package.json" - }, - { - "path": "node_modules/get-stream/package.json" - }, - { - "path": "node_modules/is-stream-ended/package.json" - }, - { - "path": "node_modules/deep-equal/package.json" - }, - { - "path": "node_modules/fast-levenshtein/package.json" - }, - { - "path": "node_modules/klaw/package.json" + "path": ".git/refs/remotes/origin/HEAD" }, { - "path": "node_modules/jsonexport/package.json" + "path": ".git/objects/pack/pack-08b93a97620ab95a04f8a8a7bc8e63148779052c.pack" }, { - "path": "node_modules/event-emitter/package.json" + "path": ".git/objects/pack/pack-08b93a97620ab95a04f8a8a7bc8e63148779052c.idx" }, { - "path": "node_modules/acorn/package.json" + "path": ".git/logs/HEAD" }, { - "path": "node_modules/supports-color/package.json" + "path": ".git/logs/refs/heads/autosynth" }, { - "path": "node_modules/ajv/package.json" + "path": ".git/logs/refs/heads/master" }, { - "path": "node_modules/emoji-regex/package.json" + "path": ".git/logs/refs/remotes/origin/HEAD" }, { - "path": "node_modules/jsdoc/package.json" + "path": "src/index.js" }, { - "path": "node_modules/jsdoc/node_modules/escape-string-regexp/package.json" + "path": "src/browser.js" }, { - "path": "node_modules/requizzle/package.json" + "path": "src/extra_proto_list.json" }, { - "path": "node_modules/lowercase-keys/package.json" + "path": "src/v1/security_center_client_config.json" }, { - "path": "node_modules/power-assert-renderer-base/package.json" + "path": "src/v1/index.js" }, { - "path": "node_modules/wordwrap/package.json" + "path": "src/v1/security_center_client.js" }, { - "path": "node_modules/es-abstract/package.json" + "path": "src/v1/security_center_proto_list.json" }, { - "path": "node_modules/gaxios/package.json" + "path": "src/v1/doc/google/iam/v1/doc_iam_policy.js" }, { - "path": "node_modules/map-obj/package.json" + "path": "src/v1/doc/google/iam/v1/doc_options.js" }, { - "path": "node_modules/stream-shift/package.json" + "path": "src/v1/doc/google/iam/v1/doc_policy.js" }, { - "path": "node_modules/domutils/package.json" + "path": "src/v1/doc/google/cloud/securitycenter/v1/doc_securitycenter_service.js" }, { - "path": "node_modules/es6-iterator/package.json" + "path": "src/v1/doc/google/cloud/securitycenter/v1/doc_finding.js" }, { - "path": "node_modules/uglify-js/package.json" + "path": "src/v1/doc/google/cloud/securitycenter/v1/doc_organization_settings.js" }, { - "path": "node_modules/amdefine/package.json" + "path": "src/v1/doc/google/cloud/securitycenter/v1/doc_source.js" }, { - "path": "node_modules/@types/color-name/package.json" + "path": "src/v1/doc/google/cloud/securitycenter/v1/doc_asset.js" }, { - "path": "node_modules/@types/node/package.json" + "path": "src/v1/doc/google/cloud/securitycenter/v1/doc_security_marks.js" }, { - "path": "node_modules/@types/long/package.json" + "path": "src/v1/doc/google/type/doc_expr.js" }, { - "path": "node_modules/balanced-match/package.json" + "path": "src/v1/doc/google/rpc/doc_status.js" }, { - "path": "node_modules/is-buffer/package.json" + "path": "src/v1/doc/google/longrunning/doc_operations.js" }, { - "path": "node_modules/optionator/package.json" + "path": "src/v1/doc/google/protobuf/doc_struct.js" }, { - "path": "node_modules/rc/package.json" + "path": "src/v1/doc/google/protobuf/doc_duration.js" }, { - "path": "node_modules/rc/node_modules/minimist/package.json" + "path": "src/v1/doc/google/protobuf/doc_any.js" }, { - "path": "node_modules/rc/node_modules/strip-json-comments/package.json" + "path": "src/v1/doc/google/protobuf/doc_timestamp.js" }, { - "path": "node_modules/nested-error-stacks/package.json" + "path": "src/v1/doc/google/protobuf/doc_field_mask.js" }, { - "path": "node_modules/traverse/package.json" + "path": "src/v1beta1/security_center_client_config.json" }, { - "path": "node_modules/crypto-random-string/package.json" + "path": "src/v1beta1/index.js" }, { - "path": "node_modules/lodash.flattendeep/package.json" + "path": "src/v1beta1/security_center_client.js" }, { - "path": "node_modules/resolve-from/package.json" + "path": "src/v1beta1/security_center_proto_list.json" }, { - "path": "node_modules/espower-source/package.json" + "path": "src/v1beta1/doc/google/iam/v1/doc_iam_policy.js" }, { - "path": "node_modules/espower-source/node_modules/acorn/package.json" + "path": "src/v1beta1/doc/google/iam/v1/doc_options.js" }, { - "path": "node_modules/globals/package.json" + "path": "src/v1beta1/doc/google/iam/v1/doc_policy.js" }, { - "path": "node_modules/call-signature/package.json" + "path": "src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_securitycenter_service.js" }, { - "path": "node_modules/escodegen/package.json" + "path": "src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_finding.js" }, { - "path": "node_modules/escodegen/node_modules/esprima/package.json" + "path": "src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_organization_settings.js" }, { - "path": "node_modules/google-auth-library/package.json" + "path": "src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_source.js" }, { - "path": "node_modules/istanbul-lib-coverage/package.json" + "path": "src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_asset.js" }, { - "path": "node_modules/power-assert-renderer-file/package.json" + "path": "src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_security_marks.js" }, { - "path": "node_modules/decamelize/package.json" + "path": "src/v1beta1/doc/google/type/doc_expr.js" }, { - "path": "node_modules/process-nextick-args/package.json" + "path": "src/v1beta1/doc/google/rpc/doc_status.js" }, { - "path": "node_modules/long/package.json" + "path": "src/v1beta1/doc/google/longrunning/doc_operations.js" }, { - "path": "node_modules/shebang-regex/package.json" + "path": "src/v1beta1/doc/google/protobuf/doc_struct.js" }, { - "path": "node_modules/astral-regex/package.json" + "path": "src/v1beta1/doc/google/protobuf/doc_duration.js" }, { - "path": "node_modules/path-exists/package.json" + "path": "src/v1beta1/doc/google/protobuf/doc_any.js" }, { - "path": "node_modules/protobufjs/package.json" + "path": "src/v1beta1/doc/google/protobuf/doc_timestamp.js" }, { - "path": "node_modules/protobufjs/cli/package.json" + "path": "src/v1beta1/doc/google/protobuf/doc_field_mask.js" }, { - "path": "node_modules/protobufjs/cli/package-lock.json" + "path": "protos/protos.js" }, { - "path": "node_modules/protobufjs/cli/node_modules/acorn-jsx/package.json" + "path": "protos/protos.d.ts" }, { - "path": "node_modules/protobufjs/cli/node_modules/acorn-jsx/node_modules/acorn/package.json" + "path": "protos/protos.json" }, { - "path": "node_modules/protobufjs/cli/node_modules/minimist/package.json" + "path": "protos/google/cloud/securitycenter/v1/finding.proto" }, { - "path": "node_modules/protobufjs/cli/node_modules/espree/package.json" + "path": "protos/google/cloud/securitycenter/v1/source.proto" }, { - "path": "node_modules/protobufjs/cli/node_modules/semver/package.json" + "path": "protos/google/cloud/securitycenter/v1/security_marks.proto" }, { - "path": "node_modules/protobufjs/cli/node_modules/acorn/package.json" + "path": "protos/google/cloud/securitycenter/v1/run_asset_discovery_response.proto" }, { - "path": "node_modules/deep-is/package.json" + "path": "protos/google/cloud/securitycenter/v1/securitycenter_service.proto" }, { - "path": "node_modules/dot-prop/package.json" + "path": "protos/google/cloud/securitycenter/v1/organization_settings.proto" }, { - "path": "node_modules/dom-serializer/package.json" + "path": "protos/google/cloud/securitycenter/v1/asset.proto" }, { - "path": "node_modules/universal-deep-strict-equal/package.json" + "path": "protos/google/cloud/securitycenter/v1beta1/finding.proto" }, { - "path": "node_modules/term-size/package.json" + "path": "protos/google/cloud/securitycenter/v1beta1/source.proto" }, { - "path": "node_modules/has-yarn/package.json" + "path": "protos/google/cloud/securitycenter/v1beta1/security_marks.proto" }, { - "path": "node_modules/call-matcher/package.json" + "path": "protos/google/cloud/securitycenter/v1beta1/run_asset_discovery_response.proto" }, { - "path": "system-test/no-test.js" + "path": "protos/google/cloud/securitycenter/v1beta1/securitycenter_service.proto" }, { - "path": "system-test/.eslintrc.yml" + "path": "protos/google/cloud/securitycenter/v1beta1/organization_settings.proto" }, { - "path": ".kokoro/docs.sh" + "path": "protos/google/cloud/securitycenter/v1beta1/asset.proto" }, { - "path": ".kokoro/trampoline.sh" + "path": "__pycache__/synth.cpython-36.pyc" }, { - "path": ".kokoro/test.sh" + "path": ".kokoro/common.cfg" }, { "path": ".kokoro/publish.sh" }, { - "path": ".kokoro/common.cfg" - }, - { - "path": ".kokoro/test.bat" + "path": ".kokoro/docs.sh" }, { "path": ".kokoro/lint.sh" }, - { - "path": ".kokoro/system-test.sh" - }, { "path": ".kokoro/.gitattributes" }, { - "path": ".kokoro/samples-test.sh" - }, - { - "path": ".kokoro/continuous/node8/test.cfg" - }, - { - "path": ".kokoro/continuous/node8/common.cfg" - }, - { - "path": ".kokoro/continuous/node12/test.cfg" - }, - { - "path": ".kokoro/continuous/node12/common.cfg" - }, - { - "path": ".kokoro/continuous/node10/docs.cfg" + "path": ".kokoro/system-test.sh" }, { - "path": ".kokoro/continuous/node10/lint.cfg" + "path": ".kokoro/test.bat" }, { - "path": ".kokoro/continuous/node10/system-test.cfg" + "path": ".kokoro/test.sh" }, { - "path": ".kokoro/continuous/node10/test.cfg" + "path": ".kokoro/trampoline.sh" }, { - "path": ".kokoro/continuous/node10/samples-test.cfg" + "path": ".kokoro/samples-test.sh" }, { - "path": ".kokoro/continuous/node10/common.cfg" + "path": ".kokoro/presubmit/node10/common.cfg" }, { - "path": ".kokoro/presubmit/node8/test.cfg" + "path": ".kokoro/presubmit/node10/system-test.cfg" }, { - "path": ".kokoro/presubmit/node8/common.cfg" + "path": ".kokoro/presubmit/node10/lint.cfg" }, { - "path": ".kokoro/presubmit/node12/test.cfg" + "path": ".kokoro/presubmit/node10/test.cfg" }, { - "path": ".kokoro/presubmit/node12/common.cfg" + "path": ".kokoro/presubmit/node10/samples-test.cfg" }, { "path": ".kokoro/presubmit/node10/docs.cfg" }, { - "path": ".kokoro/presubmit/node10/lint.cfg" - }, - { - "path": ".kokoro/presubmit/node10/system-test.cfg" - }, - { - "path": ".kokoro/presubmit/node10/test.cfg" + "path": ".kokoro/presubmit/node12/common.cfg" }, { - "path": ".kokoro/presubmit/node10/samples-test.cfg" + "path": ".kokoro/presubmit/node12/test.cfg" }, { - "path": ".kokoro/presubmit/node10/common.cfg" + "path": ".kokoro/presubmit/node8/common.cfg" }, { - "path": ".kokoro/presubmit/windows/test.cfg" + "path": ".kokoro/presubmit/node8/test.cfg" }, { "path": ".kokoro/presubmit/windows/common.cfg" }, { - "path": ".kokoro/release/docs.cfg" - }, - { - "path": ".kokoro/release/docs.sh" - }, - { - "path": ".kokoro/release/publish.cfg" + "path": ".kokoro/presubmit/windows/test.cfg" }, { "path": ".kokoro/release/common.cfg" }, { - "path": "test/mocha.opts" + "path": ".kokoro/release/publish.cfg" }, { - "path": "test/.eslintrc.yml" + "path": ".kokoro/release/docs.sh" }, { - "path": "test/gapic-v1.js" + "path": ".kokoro/release/docs.cfg" }, { - "path": "src/index.js" + "path": ".kokoro/continuous/node10/common.cfg" }, { - "path": "src/browser.js" + "path": ".kokoro/continuous/node10/system-test.cfg" }, { - "path": "src/v1beta1/index.js" + "path": ".kokoro/continuous/node10/lint.cfg" }, { - "path": "src/v1beta1/security_center_proto_list.json" + "path": ".kokoro/continuous/node10/test.cfg" }, { - "path": "src/v1beta1/security_center_client.js" + "path": ".kokoro/continuous/node10/samples-test.cfg" }, { - "path": "src/v1beta1/security_center_client_config.json" + "path": ".kokoro/continuous/node10/docs.cfg" }, { - "path": "src/v1beta1/doc/google/protobuf/doc_any.js" + "path": ".kokoro/continuous/node12/common.cfg" }, { - "path": "src/v1beta1/doc/google/protobuf/doc_duration.js" + "path": ".kokoro/continuous/node12/test.cfg" }, { - "path": "src/v1beta1/doc/google/protobuf/doc_timestamp.js" + "path": ".kokoro/continuous/node8/common.cfg" }, { - "path": "src/v1beta1/doc/google/protobuf/doc_struct.js" + "path": ".kokoro/continuous/node8/test.cfg" }, { - "path": "src/v1beta1/doc/google/protobuf/doc_field_mask.js" + "path": "samples/package.json" }, { - "path": "src/v1beta1/doc/google/type/doc_expr.js" + "path": "samples/quickstart.js" }, { - "path": "src/v1beta1/doc/google/iam/v1/doc_iam_policy.js" + "path": "samples/.eslintrc.yml" }, { - "path": "src/v1beta1/doc/google/iam/v1/doc_options.js" + "path": "samples/README.md" }, { - "path": "src/v1beta1/doc/google/iam/v1/doc_policy.js" + "path": "samples/system-test/quickstart.test.js" }, { - "path": "src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_securitycenter_service.js" + "path": "samples/system-test/v1/assetSecurityMarks.test.js" }, { - "path": "src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_asset.js" + "path": "samples/system-test/v1/listFilteredAssets.test.js" }, { - "path": "src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_source.js" + "path": "samples/system-test/v1/listAssetsAtTime.test.js" }, { - "path": "src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_organization_settings.js" + "path": "samples/system-test/v1/orgSettings.test.js" }, { - "path": "src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_security_marks.js" + "path": "samples/system-test/v1/findings.test.js" }, { - "path": "src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_finding.js" + "path": "samples/system-test/v1/listAssetsAndChanges.test.js" }, { - "path": "src/v1beta1/doc/google/longrunning/doc_operations.js" + "path": "samples/system-test/v1/listAllAssets.test.js" }, { - "path": "src/v1beta1/doc/google/rpc/doc_status.js" + "path": "samples/v1/createSource.js" }, { - "path": "src/v1/index.js" + "path": "samples/v1/updateSource.js" }, { - "path": "src/v1/security_center_proto_list.json" + "path": "samples/v1/createFindingSourceProperties.js" }, { - "path": "src/v1/security_center_client.js" + "path": "samples/v1/addFindingSecurityMarks.js" }, { - "path": "src/v1/security_center_client_config.json" + "path": "samples/v1/listAllSources.js" }, { - "path": "src/v1/doc/google/protobuf/doc_any.js" + "path": "samples/v1/getSourceIam.js" }, { - "path": "src/v1/doc/google/protobuf/doc_duration.js" + "path": "samples/v1/listAllFindings.js" }, { - "path": "src/v1/doc/google/protobuf/doc_timestamp.js" + "path": "samples/v1/listAssetsAndChanges.js" }, { - "path": "src/v1/doc/google/protobuf/doc_struct.js" + "path": "samples/v1/setSourceIam.js" }, { - "path": "src/v1/doc/google/protobuf/doc_field_mask.js" + "path": "samples/v1/listFilteredFindings.js" }, { - "path": "src/v1/doc/google/type/doc_expr.js" + "path": "samples/v1/addSecurityMarks.js" }, { - "path": "src/v1/doc/google/iam/v1/doc_iam_policy.js" + "path": "samples/v1/enableAssetDiscovery.js" }, { - "path": "src/v1/doc/google/iam/v1/doc_options.js" + "path": "samples/v1/listAssetsWithSecurityMarks.js" }, { - "path": "src/v1/doc/google/iam/v1/doc_policy.js" + "path": "samples/v1/testIam.js" }, { - "path": "src/v1/doc/google/cloud/securitycenter/v1/doc_securitycenter_service.js" + "path": "samples/v1/createFinding.js" }, { - "path": "src/v1/doc/google/cloud/securitycenter/v1/doc_asset.js" + "path": "samples/v1/addDeleteSecurityMarks.js" }, { - "path": "src/v1/doc/google/cloud/securitycenter/v1/doc_source.js" + "path": "samples/v1/getOrganizationSettings.js" }, { - "path": "src/v1/doc/google/cloud/securitycenter/v1/doc_organization_settings.js" + "path": "samples/v1/listAssetsAtTime.js" }, { - "path": "src/v1/doc/google/cloud/securitycenter/v1/doc_security_marks.js" + "path": "samples/v1/deleteSecurityMarks.js" }, { - "path": "src/v1/doc/google/cloud/securitycenter/v1/doc_finding.js" + "path": "samples/v1/setFindingState.js" }, { - "path": "src/v1/doc/google/longrunning/doc_operations.js" + "path": "samples/v1/updateFindingSourceProperties.js" }, { - "path": "src/v1/doc/google/rpc/doc_status.js" + "path": "samples/v1/getSource.js" }, { - "path": ".github/ISSUE_TEMPLATE.md" + "path": "samples/v1/listFindingsAtTime.js" }, { - "path": ".github/release-please.yml" + "path": "samples/v1/listFilteredAssets.js" }, { - "path": ".github/PULL_REQUEST_TEMPLATE.md" + "path": "samples/v1/listAllAssets.js" }, { - "path": ".github/ISSUE_TEMPLATE/bug_report.md" + "path": "samples/v1/listFindingsWithSecurityMarks.js" }, { - "path": ".github/ISSUE_TEMPLATE/feature_request.md" + "path": "test/gapic-v1.js" }, { - "path": ".github/ISSUE_TEMPLATE/support_request.md" + "path": "test/mocha.opts" } ] } \ No newline at end of file From 72885abc70d2f5e1c2f0ac6f111d5dfc338bad79 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Mon, 6 Jan 2020 10:46:57 -0800 Subject: [PATCH 124/342] chore: release 2.3.1 * updated CHANGELOG.md [ci skip] * updated package.json [ci skip] * updated samples/package.json [ci skip] --- packages/google-cloud-securitycenter/CHANGELOG.md | 7 +++++++ packages/google-cloud-securitycenter/package.json | 2 +- packages/google-cloud-securitycenter/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-securitycenter/CHANGELOG.md b/packages/google-cloud-securitycenter/CHANGELOG.md index ef544d348cb..9dcd93f998d 100644 --- a/packages/google-cloud-securitycenter/CHANGELOG.md +++ b/packages/google-cloud-securitycenter/CHANGELOG.md @@ -4,6 +4,13 @@ [1]: https://www.npmjs.com/package/@google-cloud/security-center?activeTab=versions +### [2.3.1](https://www.github.com/googleapis/nodejs-security-center/compare/v2.3.0...v2.3.1) (2020-01-05) + + +### Bug Fixes + +* proto files updated with proto annotations ([#182](https://www.github.com/googleapis/nodejs-security-center/issues/182)) ([010f3de](https://www.github.com/googleapis/nodejs-security-center/commit/010f3de382300787a3e383d5c55ec1f0dcc2536a)) + ## [2.3.0](https://www.github.com/googleapis/nodejs-security-center/compare/v2.2.2...v2.3.0) (2019-12-10) diff --git a/packages/google-cloud-securitycenter/package.json b/packages/google-cloud-securitycenter/package.json index 235f423ef45..afa798bec36 100644 --- a/packages/google-cloud-securitycenter/package.json +++ b/packages/google-cloud-securitycenter/package.json @@ -1,7 +1,7 @@ { "name": "@google-cloud/security-center", "description": "Cloud Security Command Center API client for Node.js", - "version": "2.3.0", + "version": "2.3.1", "license": "Apache-2.0", "author": "Google LLC", "engines": { diff --git a/packages/google-cloud-securitycenter/samples/package.json b/packages/google-cloud-securitycenter/samples/package.json index 5758f4cb3df..e73c02cea08 100644 --- a/packages/google-cloud-securitycenter/samples/package.json +++ b/packages/google-cloud-securitycenter/samples/package.json @@ -13,7 +13,7 @@ }, "license": "Apache-2.0", "dependencies": { - "@google-cloud/security-center": "^2.3.0" + "@google-cloud/security-center": "^2.3.1" }, "devDependencies": { "chai": "^4.2.0", From 32f9e2cabb3163b51bbbdf1d577acd7dbb4d8da0 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Mon, 13 Jan 2020 17:21:03 -0800 Subject: [PATCH 125/342] docs: small change to resource format in jsdoc --- .../doc/google/longrunning/doc_operations.js | 2 +- .../doc/google/longrunning/doc_operations.js | 2 +- .../synth.metadata | 2342 +---------------- 3 files changed, 5 insertions(+), 2341 deletions(-) diff --git a/packages/google-cloud-securitycenter/src/v1/doc/google/longrunning/doc_operations.js b/packages/google-cloud-securitycenter/src/v1/doc/google/longrunning/doc_operations.js index 4719aebdc91..5aa806fd340 100644 --- a/packages/google-cloud-securitycenter/src/v1/doc/google/longrunning/doc_operations.js +++ b/packages/google-cloud-securitycenter/src/v1/doc/google/longrunning/doc_operations.js @@ -22,7 +22,7 @@ * @property {string} name * The server-assigned name, which is only unique within the same service that * originally returns it. If you use the default HTTP mapping, the - * `name` should have the format of `operations/some/unique/name`. + * `name` should be a resource name ending with `operations/{unique_id}`. * * @property {Object} metadata * Service-specific metadata associated with the operation. It typically diff --git a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/longrunning/doc_operations.js b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/longrunning/doc_operations.js index 4719aebdc91..5aa806fd340 100644 --- a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/longrunning/doc_operations.js +++ b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/longrunning/doc_operations.js @@ -22,7 +22,7 @@ * @property {string} name * The server-assigned name, which is only unique within the same service that * originally returns it. If you use the default HTTP mapping, the - * `name` should have the format of `operations/some/unique/name`. + * `name` should be a resource name ending with `operations/{unique_id}`. * * @property {Object} metadata * Service-specific metadata associated with the operation. It typically diff --git a/packages/google-cloud-securitycenter/synth.metadata b/packages/google-cloud-securitycenter/synth.metadata index 5dbdf175ad6..2bc4935be0e 100644 --- a/packages/google-cloud-securitycenter/synth.metadata +++ b/packages/google-cloud-securitycenter/synth.metadata @@ -1,5 +1,5 @@ { - "updateTime": "2020-01-04T12:26:10.640348Z", + "updateTime": "2020-01-13T12:25:40.666052Z", "sources": [ { "generator": { @@ -12,8 +12,8 @@ "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "91ef2d9dd69807b0b79555f22566fb2d81e49ff9", - "internalRef": "287999179" + "sha": "06ec6d5d053fff299eaa6eaa38afdd36c5e2fc68", + "internalRef": "289413169" } }, { @@ -45,2341 +45,5 @@ "config": "google/cloud/securitycenter/artman_securitycenter_v1.yaml" } } - ], - "newFiles": [ - { - "path": "package.json" - }, - { - "path": "webpack.config.js" - }, - { - "path": ".prettierignore" - }, - { - "path": "CODE_OF_CONDUCT.md" - }, - { - "path": ".repo-metadata.json" - }, - { - "path": ".prettierrc" - }, - { - "path": "CHANGELOG.md" - }, - { - "path": "renovate.json" - }, - { - "path": ".nycrc" - }, - { - "path": "LICENSE" - }, - { - "path": "synth.py" - }, - { - "path": ".eslintignore" - }, - { - "path": "linkinator.config.json" - }, - { - "path": ".readme-partials.yaml" - }, - { - "path": "package-lock.json" - }, - { - "path": "CONTRIBUTING.md" - }, - { - "path": ".eslintrc.yml" - }, - { - "path": "README.md" - }, - { - "path": "synth.metadata" - }, - { - "path": ".gitignore" - }, - { - "path": "codecov.yaml" - }, - { - "path": ".jsdoc.js" - }, - { - "path": ".github/ISSUE_TEMPLATE.md" - }, - { - "path": ".github/PULL_REQUEST_TEMPLATE.md" - }, - { - "path": ".github/release-please.yml" - }, - { - "path": ".github/ISSUE_TEMPLATE/bug_report.md" - }, - { - "path": ".github/ISSUE_TEMPLATE/feature_request.md" - }, - { - "path": ".github/ISSUE_TEMPLATE/support_request.md" - }, - { - "path": "node_modules/uc.micro/package.json" - }, - { - "path": "node_modules/eastasianwidth/package.json" - }, - { - "path": "node_modules/defer-to-connect/package.json" - }, - { - "path": "node_modules/object-is/package.json" - }, - { - "path": "node_modules/is-arguments/package.json" - }, - { - "path": "node_modules/eventemitter3/package.json" - }, - { - "path": "node_modules/long/package.json" - }, - { - "path": "node_modules/lodash/package.json" - }, - { - "path": "node_modules/diff/package.json" - }, - { - "path": "node_modules/has-flag/package.json" - }, - { - "path": "node_modules/prelude-ls/package.json" - }, - { - "path": "node_modules/source-map/package.json" - }, - { - "path": "node_modules/spdx-correct/package.json" - }, - { - "path": "node_modules/normalize-url/package.json" - }, - { - "path": "node_modules/tmp/package.json" - }, - { - "path": "node_modules/got/package.json" - }, - { - "path": "node_modules/agent-base/package.json" - }, - { - "path": "node_modules/process-nextick-args/package.json" - }, - { - "path": "node_modules/google-gax/package.json" - }, - { - "path": "node_modules/next-tick/package.json" - }, - { - "path": "node_modules/hosted-git-info/package.json" - }, - { - "path": "node_modules/is-symbol/package.json" - }, - { - "path": "node_modules/once/package.json" - }, - { - "path": "node_modules/yargs-parser/package.json" - }, - { - "path": "node_modules/ansi-escapes/package.json" - }, - { - "path": "node_modules/gcp-metadata/package.json" - }, - { - "path": "node_modules/espower-loader/package.json" - }, - { - "path": "node_modules/validate-npm-package-license/package.json" - }, - { - "path": "node_modules/doctrine/package.json" - }, - { - "path": "node_modules/power-assert-context-formatter/package.json" - }, - { - "path": "node_modules/marked/package.json" - }, - { - "path": "node_modules/jsdoc/package.json" - }, - { - "path": "node_modules/jsdoc/node_modules/escape-string-regexp/package.json" - }, - { - "path": "node_modules/flat-cache/package.json" - }, - { - "path": "node_modules/flat-cache/node_modules/rimraf/package.json" - }, - { - "path": "node_modules/is-npm/package.json" - }, - { - "path": "node_modules/espower-location-detector/package.json" - }, - { - "path": "node_modules/espower-location-detector/node_modules/source-map/package.json" - }, - { - "path": "node_modules/base64-js/package.json" - }, - { - "path": "node_modules/is-glob/package.json" - }, - { - "path": "node_modules/taffydb/package.json" - }, - { - "path": "node_modules/mocha/package.json" - }, - { - "path": "node_modules/mocha/node_modules/has-flag/package.json" - }, - { - "path": "node_modules/mocha/node_modules/yargs-parser/package.json" - }, - { - "path": "node_modules/mocha/node_modules/glob/package.json" - }, - { - "path": "node_modules/mocha/node_modules/strip-ansi/package.json" - }, - { - "path": "node_modules/mocha/node_modules/ansi-styles/package.json" - }, - { - "path": "node_modules/mocha/node_modules/find-up/package.json" - }, - { - "path": "node_modules/mocha/node_modules/strip-json-comments/package.json" - }, - { - "path": "node_modules/mocha/node_modules/locate-path/package.json" - }, - { - "path": "node_modules/mocha/node_modules/yargs/package.json" - }, - { - "path": "node_modules/mocha/node_modules/is-fullwidth-code-point/package.json" - }, - { - "path": "node_modules/mocha/node_modules/supports-color/package.json" - }, - { - "path": "node_modules/mocha/node_modules/p-locate/package.json" - }, - { - "path": "node_modules/mocha/node_modules/path-exists/package.json" - }, - { - "path": "node_modules/mocha/node_modules/ms/package.json" - }, - { - "path": "node_modules/mocha/node_modules/color-name/package.json" - }, - { - "path": "node_modules/mocha/node_modules/ansi-regex/package.json" - }, - { - "path": "node_modules/mocha/node_modules/color-convert/package.json" - }, - { - "path": "node_modules/mocha/node_modules/cliui/package.json" - }, - { - "path": "node_modules/mocha/node_modules/wrap-ansi/package.json" - }, - { - "path": "node_modules/mocha/node_modules/which/package.json" - }, - { - "path": "node_modules/mocha/node_modules/string-width/package.json" - }, - { - "path": "node_modules/mocha/node_modules/emoji-regex/package.json" - }, - { - "path": "node_modules/minimist/package.json" - }, - { - "path": "node_modules/type/package.json" - }, - { - "path": "node_modules/yargs-unparser/package.json" - }, - { - "path": "node_modules/yargs-unparser/node_modules/yargs-parser/package.json" - }, - { - "path": "node_modules/yargs-unparser/node_modules/strip-ansi/package.json" - }, - { - "path": "node_modules/yargs-unparser/node_modules/ansi-styles/package.json" - }, - { - "path": "node_modules/yargs-unparser/node_modules/find-up/package.json" - }, - { - "path": "node_modules/yargs-unparser/node_modules/locate-path/package.json" - }, - { - "path": "node_modules/yargs-unparser/node_modules/yargs/package.json" - }, - { - "path": "node_modules/yargs-unparser/node_modules/is-fullwidth-code-point/package.json" - }, - { - "path": "node_modules/yargs-unparser/node_modules/p-locate/package.json" - }, - { - "path": "node_modules/yargs-unparser/node_modules/path-exists/package.json" - }, - { - "path": "node_modules/yargs-unparser/node_modules/color-name/package.json" - }, - { - "path": "node_modules/yargs-unparser/node_modules/ansi-regex/package.json" - }, - { - "path": "node_modules/yargs-unparser/node_modules/color-convert/package.json" - }, - { - "path": "node_modules/yargs-unparser/node_modules/cliui/package.json" - }, - { - "path": "node_modules/yargs-unparser/node_modules/wrap-ansi/package.json" - }, - { - "path": "node_modules/yargs-unparser/node_modules/string-width/package.json" - }, - { - "path": "node_modules/yargs-unparser/node_modules/emoji-regex/package.json" - }, - { - "path": "node_modules/css-select/package.json" - }, - { - "path": "node_modules/file-entry-cache/package.json" - }, - { - "path": "node_modules/he/package.json" - }, - { - "path": "node_modules/xmlcreate/package.json" - }, - { - "path": "node_modules/https-proxy-agent/package.json" - }, - { - "path": "node_modules/ecdsa-sig-formatter/package.json" - }, - { - "path": "node_modules/nice-try/package.json" - }, - { - "path": "node_modules/log-symbols/package.json" - }, - { - "path": "node_modules/object.getownpropertydescriptors/package.json" - }, - { - "path": "node_modules/@protobufjs/path/package.json" - }, - { - "path": "node_modules/@protobufjs/pool/package.json" - }, - { - "path": "node_modules/@protobufjs/float/package.json" - }, - { - "path": "node_modules/@protobufjs/aspromise/package.json" - }, - { - "path": "node_modules/@protobufjs/fetch/package.json" - }, - { - "path": "node_modules/@protobufjs/utf8/package.json" - }, - { - "path": "node_modules/@protobufjs/codegen/package.json" - }, - { - "path": "node_modules/@protobufjs/inquire/package.json" - }, - { - "path": "node_modules/@protobufjs/base64/package.json" - }, - { - "path": "node_modules/@protobufjs/eventemitter/package.json" - }, - { - "path": "node_modules/gtoken/package.json" - }, - { - "path": "node_modules/through2/package.json" - }, - { - "path": "node_modules/p-limit/package.json" - }, - { - "path": "node_modules/argparse/package.json" - }, - { - "path": "node_modules/eslint-scope/package.json" - }, - { - "path": "node_modules/extend/package.json" - }, - { - "path": "node_modules/is-path-inside/package.json" - }, - { - "path": "node_modules/destroy/package.json" - }, - { - "path": "node_modules/power-assert-formatter/package.json" - }, - { - "path": "node_modules/read-pkg-up/package.json" - }, - { - "path": "node_modules/global-dirs/package.json" - }, - { - "path": "node_modules/fast-deep-equal/package.json" - }, - { - "path": "node_modules/mimic-fn/package.json" - }, - { - "path": "node_modules/power-assert-context-reducer-ast/package.json" - }, - { - "path": "node_modules/power-assert-context-reducer-ast/node_modules/acorn/package.json" - }, - { - "path": "node_modules/core-util-is/package.json" - }, - { - "path": "node_modules/string.prototype.trimright/package.json" - }, - { - "path": "node_modules/catharsis/package.json" - }, - { - "path": "node_modules/node-fetch/package.json" - }, - { - "path": "node_modules/linkinator/package.json" - }, - { - "path": "node_modules/linkinator/node_modules/chalk/package.json" - }, - { - "path": "node_modules/fresh/package.json" - }, - { - "path": "node_modules/safer-buffer/package.json" - }, - { - "path": "node_modules/is-stream-ended/package.json" - }, - { - "path": "node_modules/mimic-response/package.json" - }, - { - "path": "node_modules/requizzle/package.json" - }, - { - "path": "node_modules/cacheable-request/package.json" - }, - { - "path": "node_modules/cacheable-request/node_modules/lowercase-keys/package.json" - }, - { - "path": "node_modules/cacheable-request/node_modules/get-stream/package.json" - }, - { - "path": "node_modules/figures/package.json" - }, - { - "path": "node_modules/power-assert-util-string-width/package.json" - }, - { - "path": "node_modules/multi-stage-sourcemap/package.json" - }, - { - "path": "node_modules/multi-stage-sourcemap/node_modules/source-map/package.json" - }, - { - "path": "node_modules/abort-controller/package.json" - }, - { - "path": "node_modules/widest-line/package.json" - }, - { - "path": "node_modules/eslint-plugin-es/package.json" - }, - { - "path": "node_modules/eslint-plugin-es/node_modules/eslint-utils/package.json" - }, - { - "path": "node_modules/eslint-plugin-es/node_modules/regexpp/package.json" - }, - { - "path": "node_modules/boxen/package.json" - }, - { - "path": "node_modules/boxen/node_modules/chalk/package.json" - }, - { - "path": "node_modules/glob/package.json" - }, - { - "path": "node_modules/buffer-equal-constant-time/package.json" - }, - { - "path": "node_modules/strip-ansi/package.json" - }, - { - "path": "node_modules/acorn-es7-plugin/package.json" - }, - { - "path": "node_modules/acorn/package.json" - }, - { - "path": "node_modules/spdx-expression-parse/package.json" - }, - { - "path": "node_modules/read-pkg/package.json" - }, - { - "path": "node_modules/read-pkg/node_modules/type-fest/package.json" - }, - { - "path": "node_modules/node-environment-flags/package.json" - }, - { - "path": "node_modules/node-environment-flags/node_modules/semver/package.json" - }, - { - "path": "node_modules/ansi-styles/package.json" - }, - { - "path": "node_modules/escallmatch/package.json" - }, - { - "path": "node_modules/escallmatch/node_modules/esprima/package.json" - }, - { - "path": "node_modules/is-typedarray/package.json" - }, - { - "path": "node_modules/callsites/package.json" - }, - { - "path": "node_modules/safe-buffer/package.json" - }, - { - "path": "node_modules/type-fest/package.json" - }, - { - "path": "node_modules/espree/package.json" - }, - { - "path": "node_modules/server-destroy/package.json" - }, - { - "path": "node_modules/rc/package.json" - }, - { - "path": "node_modules/rc/node_modules/minimist/package.json" - }, - { - "path": "node_modules/rc/node_modules/strip-json-comments/package.json" - }, - { - "path": "node_modules/fs.realpath/package.json" - }, - { - "path": "node_modules/es6-set/package.json" - }, - { - "path": "node_modules/es6-set/node_modules/es6-symbol/package.json" - }, - { - "path": "node_modules/js-yaml/package.json" - }, - { - "path": "node_modules/ajv/package.json" - }, - { - "path": "node_modules/prettier-linter-helpers/package.json" - }, - { - "path": "node_modules/p-finally/package.json" - }, - { - "path": "node_modules/redent/package.json" - }, - { - "path": "node_modules/diff-match-patch/package.json" - }, - { - "path": "node_modules/signal-exit/package.json" - }, - { - "path": "node_modules/core-js/package.json" - }, - { - "path": "node_modules/package-json/package.json" - }, - { - "path": "node_modules/package-json/node_modules/semver/package.json" - }, - { - "path": "node_modules/indexof/package.json" - }, - { - "path": "node_modules/eslint-utils/package.json" - }, - { - "path": "node_modules/p-try/package.json" - }, - { - "path": "node_modules/empower/package.json" - }, - { - "path": "node_modules/external-editor/package.json" - }, - { - "path": "node_modules/html-escaper/package.json" - }, - { - "path": "node_modules/shebang-regex/package.json" - }, - { - "path": "node_modules/regexpp/package.json" - }, - { - "path": "node_modules/p-cancelable/package.json" - }, - { - "path": "node_modules/set-blocking/package.json" - }, - { - "path": "node_modules/es6-symbol/package.json" - }, - { - "path": "node_modules/encodeurl/package.json" - }, - { - "path": "node_modules/table/package.json" - }, - { - "path": "node_modules/table/node_modules/strip-ansi/package.json" - }, - { - "path": "node_modules/table/node_modules/is-fullwidth-code-point/package.json" - }, - { - "path": "node_modules/table/node_modules/ansi-regex/package.json" - }, - { - "path": "node_modules/table/node_modules/string-width/package.json" - }, - { - "path": "node_modules/table/node_modules/emoji-regex/package.json" - }, - { - "path": "node_modules/has-symbols/package.json" - }, - { - "path": "node_modules/escodegen/package.json" - }, - { - "path": "node_modules/escodegen/node_modules/source-map/package.json" - }, - { - "path": "node_modules/escodegen/node_modules/esprima/package.json" - }, - { - "path": "node_modules/unpipe/package.json" - }, - { - "path": "node_modules/dot-prop/package.json" - }, - { - "path": "node_modules/es-abstract/package.json" - }, - { - "path": "node_modules/update-notifier/package.json" - }, - { - "path": "node_modules/update-notifier/node_modules/chalk/package.json" - }, - { - "path": "node_modules/domutils/package.json" - }, - { - "path": "node_modules/find-up/package.json" - }, - { - "path": "node_modules/event-emitter/package.json" - }, - { - "path": "node_modules/parse-json/package.json" - }, - { - "path": "node_modules/linkify-it/package.json" - }, - { - "path": "node_modules/ignore/package.json" - }, - { - "path": "node_modules/cross-spawn/package.json" - }, - { - "path": "node_modules/etag/package.json" - }, - { - "path": "node_modules/empower-assert/package.json" - }, - { - "path": "node_modules/is-extglob/package.json" - }, - { - "path": "node_modules/json-bigint/package.json" - }, - { - "path": "node_modules/strip-json-comments/package.json" - }, - { - "path": "node_modules/traverse/package.json" - }, - { - "path": "node_modules/escope/package.json" - }, - { - "path": "node_modules/prettier/package.json" - }, - { - "path": "node_modules/mime/package.json" - }, - { - "path": "node_modules/google-auth-library/package.json" - }, - { - "path": "node_modules/json-stable-stringify-without-jsonify/package.json" - }, - { - "path": "node_modules/string.prototype.trimleft/package.json" - }, - { - "path": "node_modules/get-stdin/package.json" - }, - { - "path": "node_modules/espower/package.json" - }, - { - "path": "node_modules/espower/node_modules/source-map/package.json" - }, - { - "path": "node_modules/minimatch/package.json" - }, - { - "path": "node_modules/json-buffer/package.json" - }, - { - "path": "node_modules/escape-string-regexp/package.json" - }, - { - "path": "node_modules/nth-check/package.json" - }, - { - "path": "node_modules/is-date-object/package.json" - }, - { - "path": "node_modules/lowercase-keys/package.json" - }, - { - "path": "node_modules/onetime/package.json" - }, - { - "path": "node_modules/argv/package.json" - }, - { - "path": "node_modules/codecov/package.json" - }, - { - "path": "node_modules/uri-js/package.json" - }, - { - "path": "node_modules/power-assert-renderer-comparison/package.json" - }, - { - "path": "node_modules/locate-path/package.json" - }, - { - "path": "node_modules/text-table/package.json" - }, - { - "path": "node_modules/p-timeout/package.json" - }, - { - "path": "node_modules/progress/package.json" - }, - { - "path": "node_modules/es5-ext/package.json" - }, - { - "path": "node_modules/statuses/package.json" - }, - { - "path": "node_modules/markdown-it-anchor/package.json" - }, - { - "path": "node_modules/jsonexport/package.json" - }, - { - "path": "node_modules/domhandler/package.json" - }, - { - "path": "node_modules/mkdirp/package.json" - }, - { - "path": "node_modules/is-installed-globally/package.json" - }, - { - "path": "node_modules/http-cache-semantics/package.json" - }, - { - "path": "node_modules/empower-core/package.json" - }, - { - "path": "node_modules/string_decoder/package.json" - }, - { - "path": "node_modules/htmlparser2/package.json" - }, - { - "path": "node_modules/htmlparser2/node_modules/readable-stream/package.json" - }, - { - "path": "node_modules/readable-stream/package.json" - }, - { - "path": "node_modules/send/package.json" - }, - { - "path": "node_modules/send/node_modules/mime/package.json" - }, - { - "path": "node_modules/send/node_modules/debug/package.json" - }, - { - "path": "node_modules/send/node_modules/debug/node_modules/ms/package.json" - }, - { - "path": "node_modules/send/node_modules/ms/package.json" - }, - { - "path": "node_modules/convert-source-map/package.json" - }, - { - "path": "node_modules/js-tokens/package.json" - }, - { - "path": "node_modules/es6-weak-map/package.json" - }, - { - "path": "node_modules/array-filter/package.json" - }, - { - "path": "node_modules/es6-map/package.json" - }, - { - "path": "node_modules/to-readable-stream/package.json" - }, - { - "path": "node_modules/type-name/package.json" - }, - { - "path": "node_modules/regexp.prototype.flags/package.json" - }, - { - "path": "node_modules/deep-equal/package.json" - }, - { - "path": "node_modules/graceful-fs/package.json" - }, - { - "path": "node_modules/chalk/package.json" - }, - { - "path": "node_modules/chalk/node_modules/has-flag/package.json" - }, - { - "path": "node_modules/chalk/node_modules/ansi-styles/package.json" - }, - { - "path": "node_modules/chalk/node_modules/supports-color/package.json" - }, - { - "path": "node_modules/chalk/node_modules/color-name/package.json" - }, - { - "path": "node_modules/chalk/node_modules/color-convert/package.json" - }, - { - "path": "node_modules/write/package.json" - }, - { - "path": "node_modules/ext/package.json" - }, - { - "path": "node_modules/ext/node_modules/type/package.json" - }, - { - "path": "node_modules/yargs/package.json" - }, - { - "path": "node_modules/through/package.json" - }, - { - "path": "node_modules/jsdoc-fresh/package.json" - }, - { - "path": "node_modules/jsdoc-fresh/node_modules/taffydb/package.json" - }, - { - "path": "node_modules/parseurl/package.json" - }, - { - "path": "node_modules/setprototypeof/package.json" - }, - { - "path": "node_modules/jwa/package.json" - }, - { - "path": "node_modules/camelcase/package.json" - }, - { - "path": "node_modules/deep-extend/package.json" - }, - { - "path": "node_modules/inflight/package.json" - }, - { - "path": "node_modules/istanbul-reports/package.json" - }, - { - "path": "node_modules/es6-iterator/package.json" - }, - { - "path": "node_modules/run-async/package.json" - }, - { - "path": "node_modules/@bcoe/v8-coverage/package.json" - }, - { - "path": "node_modules/esquery/package.json" - }, - { - "path": "node_modules/resolve/package.json" - }, - { - "path": "node_modules/functional-red-black-tree/package.json" - }, - { - "path": "node_modules/inquirer/package.json" - }, - { - "path": "node_modules/inquirer/node_modules/strip-ansi/package.json" - }, - { - "path": "node_modules/inquirer/node_modules/ansi-regex/package.json" - }, - { - "path": "node_modules/json-schema-traverse/package.json" - }, - { - "path": "node_modules/meow/package.json" - }, - { - "path": "node_modules/es-to-primitive/package.json" - }, - { - "path": "node_modules/ini/package.json" - }, - { - "path": "node_modules/call-signature/package.json" - }, - { - "path": "node_modules/dom-serializer/package.json" - }, - { - "path": "node_modules/on-finished/package.json" - }, - { - "path": "node_modules/is-fullwidth-code-point/package.json" - }, - { - "path": "node_modules/ansi-colors/package.json" - }, - { - "path": "node_modules/end-of-stream/package.json" - }, - { - "path": "node_modules/require-main-filename/package.json" - }, - { - "path": "node_modules/supports-color/package.json" - }, - { - "path": "node_modules/eslint-visitor-keys/package.json" - }, - { - "path": "node_modules/get-caller-file/package.json" - }, - { - "path": "node_modules/brace-expansion/package.json" - }, - { - "path": "node_modules/ignore-walk/package.json" - }, - { - "path": "node_modules/urlgrey/package.json" - }, - { - "path": "node_modules/balanced-match/package.json" - }, - { - "path": "node_modules/markdown-it/package.json" - }, - { - "path": "node_modules/rxjs/package.json" - }, - { - "path": "node_modules/iconv-lite/package.json" - }, - { - "path": "node_modules/is-plain-obj/package.json" - }, - { - "path": "node_modules/fast-text-encoding/package.json" - }, - { - "path": "node_modules/os-tmpdir/package.json" - }, - { - "path": "node_modules/test-exclude/package.json" - }, - { - "path": "node_modules/resolve-from/package.json" - }, - { - "path": "node_modules/source-map-support/package.json" - }, - { - "path": "node_modules/source-map-support/node_modules/source-map/package.json" - }, - { - "path": "node_modules/punycode/package.json" - }, - { - "path": "node_modules/ee-first/package.json" - }, - { - "path": "node_modules/p-locate/package.json" - }, - { - "path": "node_modules/@types/long/package.json" - }, - { - "path": "node_modules/@types/minimist/package.json" - }, - { - "path": "node_modules/@types/node/package.json" - }, - { - "path": "node_modules/@types/istanbul-lib-coverage/package.json" - }, - { - "path": "node_modules/@types/is-windows/package.json" - }, - { - "path": "node_modules/@types/fs-extra/package.json" - }, - { - "path": "node_modules/@types/color-name/package.json" - }, - { - "path": "node_modules/@types/normalize-package-data/package.json" - }, - { - "path": "node_modules/wide-align/package.json" - }, - { - "path": "node_modules/wide-align/node_modules/strip-ansi/package.json" - }, - { - "path": "node_modules/wide-align/node_modules/is-fullwidth-code-point/package.json" - }, - { - "path": "node_modules/wide-align/node_modules/ansi-regex/package.json" - }, - { - "path": "node_modules/wide-align/node_modules/string-width/package.json" - }, - { - "path": "node_modules/is-promise/package.json" - }, - { - "path": "node_modules/spdx-exceptions/package.json" - }, - { - "path": "node_modules/slice-ansi/package.json" - }, - { - "path": "node_modules/slice-ansi/node_modules/ansi-styles/package.json" - }, - { - "path": "node_modules/slice-ansi/node_modules/is-fullwidth-code-point/package.json" - }, - { - "path": "node_modules/slice-ansi/node_modules/color-name/package.json" - }, - { - "path": "node_modules/slice-ansi/node_modules/color-convert/package.json" - }, - { - "path": "node_modules/eslint-plugin-prettier/package.json" - }, - { - "path": "node_modules/decompress-response/package.json" - }, - { - "path": "node_modules/parent-module/package.json" - }, - { - "path": "node_modules/jsdoc-region-tag/package.json" - }, - { - "path": "node_modules/domelementtype/package.json" - }, - { - "path": "node_modules/typedarray-to-buffer/package.json" - }, - { - "path": "node_modules/typedarray-to-buffer/.airtap.yml" - }, - { - "path": "node_modules/typedarray-to-buffer/.travis.yml" - }, - { - "path": "node_modules/typedarray-to-buffer/index.js" - }, - { - "path": "node_modules/typedarray-to-buffer/LICENSE" - }, - { - "path": "node_modules/typedarray-to-buffer/README.md" - }, - { - "path": "node_modules/typedarray-to-buffer/test/basic.js" - }, - { - "path": "node_modules/sprintf-js/package.json" - }, - { - "path": "node_modules/path-key/package.json" - }, - { - "path": "node_modules/isarray/package.json" - }, - { - "path": "node_modules/@grpc/grpc-js/package.json" - }, - { - "path": "node_modules/@grpc/grpc-js/node_modules/semver/package.json" - }, - { - "path": "node_modules/@grpc/proto-loader/package.json" - }, - { - "path": "node_modules/responselike/package.json" - }, - { - "path": "node_modules/istanbul-lib-coverage/package.json" - }, - { - "path": "node_modules/minimist-options/package.json" - }, - { - "path": "node_modules/minimist-options/node_modules/arrify/package.json" - }, - { - "path": "node_modules/latest-version/package.json" - }, - { - "path": "node_modules/amdefine/package.json" - }, - { - "path": "node_modules/estraverse/package.json" - }, - { - "path": "node_modules/http-errors/package.json" - }, - { - "path": "node_modules/term-size/package.json" - }, - { - "path": "node_modules/bluebird/package.json" - }, - { - "path": "node_modules/natural-compare/package.json" - }, - { - "path": "node_modules/xdg-basedir/package.json" - }, - { - "path": "node_modules/ansi-align/package.json" - }, - { - "path": "node_modules/ansi-align/node_modules/strip-ansi/package.json" - }, - { - "path": "node_modules/ansi-align/node_modules/is-fullwidth-code-point/package.json" - }, - { - "path": "node_modules/ansi-align/node_modules/ansi-regex/package.json" - }, - { - "path": "node_modules/ansi-align/node_modules/string-width/package.json" - }, - { - "path": "node_modules/ansi-align/node_modules/emoji-regex/package.json" - }, - { - "path": "node_modules/js2xmlparser/package.json" - }, - { - "path": "node_modules/teeny-request/package.json" - }, - { - "path": "node_modules/teeny-request/node_modules/https-proxy-agent/package.json" - }, - { - "path": "node_modules/espower-source/package.json" - }, - { - "path": "node_modules/espower-source/node_modules/acorn/package.json" - }, - { - "path": "node_modules/d/package.json" - }, - { - "path": "node_modules/is-stream/package.json" - }, - { - "path": "node_modules/debug/package.json" - }, - { - "path": "node_modules/espurify/package.json" - }, - { - "path": "node_modules/wrappy/package.json" - }, - { - "path": "node_modules/import-fresh/package.json" - }, - { - "path": "node_modules/eslint/package.json" - }, - { - "path": "node_modules/eslint/node_modules/strip-ansi/package.json" - }, - { - "path": "node_modules/eslint/node_modules/shebang-regex/package.json" - }, - { - "path": "node_modules/eslint/node_modules/cross-spawn/package.json" - }, - { - "path": "node_modules/eslint/node_modules/cross-spawn/CHANGELOG.md" - }, - { - "path": "node_modules/eslint/node_modules/cross-spawn/index.js" - }, - { - "path": "node_modules/eslint/node_modules/cross-spawn/LICENSE" - }, - { - "path": "node_modules/eslint/node_modules/cross-spawn/README.md" - }, - { - "path": "node_modules/eslint/node_modules/cross-spawn/node_modules/semver/package.json" - }, - { - "path": "node_modules/eslint/node_modules/cross-spawn/lib/enoent.js" - }, - { - "path": "node_modules/eslint/node_modules/cross-spawn/lib/parse.js" - }, - { - "path": "node_modules/eslint/node_modules/cross-spawn/lib/util/readShebang.js" - }, - { - "path": "node_modules/eslint/node_modules/cross-spawn/lib/util/escape.js" - }, - { - "path": "node_modules/eslint/node_modules/cross-spawn/lib/util/resolveCommand.js" - }, - { - "path": "node_modules/eslint/node_modules/path-key/package.json" - }, - { - "path": "node_modules/eslint/node_modules/debug/package.json" - }, - { - "path": "node_modules/eslint/node_modules/semver/package.json" - }, - { - "path": "node_modules/eslint/node_modules/ansi-regex/package.json" - }, - { - "path": "node_modules/eslint/node_modules/shebang-command/package.json" - }, - { - "path": "node_modules/eslint/node_modules/which/package.json" - }, - { - "path": "node_modules/es6-promise/package.json" - }, - { - "path": "node_modules/is-yarn-global/package.json" - }, - { - "path": "node_modules/array-find/package.json" - }, - { - "path": "node_modules/imurmurhash/package.json" - }, - { - "path": "node_modules/globals/package.json" - }, - { - "path": "node_modules/is-ci/package.json" - }, - { - "path": "node_modules/mdurl/package.json" - }, - { - "path": "node_modules/error-ex/package.json" - }, - { - "path": "node_modules/is-url/package.json" - }, - { - "path": "node_modules/stream-shift/package.json" - }, - { - "path": "node_modules/ci-info/package.json" - }, - { - "path": "node_modules/path-exists/package.json" - }, - { - "path": "node_modules/esrecurse/package.json" - }, - { - "path": "node_modules/lru-cache/package.json" - }, - { - "path": "node_modules/trim-newlines/package.json" - }, - { - "path": "node_modules/json-parse-better-errors/package.json" - }, - { - "path": "node_modules/retry-request/package.json" - }, - { - "path": "node_modules/retry-request/node_modules/debug/package.json" - }, - { - "path": "node_modules/merge-estraverse-visitors/package.json" - }, - { - "path": "node_modules/arrify/package.json" - }, - { - "path": "node_modules/is-windows/package.json" - }, - { - "path": "node_modules/call-matcher/package.json" - }, - { - "path": "node_modules/furi/package.json" - }, - { - "path": "node_modules/v8-compile-cache/package.json" - }, - { - "path": "node_modules/decamelize/package.json" - }, - { - "path": "node_modules/jws/package.json" - }, - { - "path": "node_modules/unique-string/package.json" - }, - { - "path": "node_modules/css-what/package.json" - }, - { - "path": "node_modules/crypto-random-string/package.json" - }, - { - "path": "node_modules/url-parse-lax/package.json" - }, - { - "path": "node_modules/@istanbuljs/schema/package.json" - }, - { - "path": "node_modules/ms/package.json" - }, - { - "path": "node_modules/decamelize-keys/package.json" - }, - { - "path": "node_modules/decamelize-keys/node_modules/map-obj/package.json" - }, - { - "path": "node_modules/make-dir/package.json" - }, - { - "path": "node_modules/make-dir/node_modules/semver/package.json" - }, - { - "path": "node_modules/get-stream/package.json" - }, - { - "path": "node_modules/word-wrap/package.json" - }, - { - "path": "node_modules/keyv/package.json" - }, - { - "path": "node_modules/semver/package.json" - }, - { - "path": "node_modules/esutils/package.json" - }, - { - "path": "node_modules/intelli-espower-loader/package.json" - }, - { - "path": "node_modules/color-name/package.json" - }, - { - "path": "node_modules/object-keys/package.json" - }, - { - "path": "node_modules/event-target-shim/package.json" - }, - { - "path": "node_modules/stringifier/package.json" - }, - { - "path": "node_modules/write-file-atomic/package.json" - }, - { - "path": "node_modules/is-regex/package.json" - }, - { - "path": "node_modules/google-p12-pem/package.json" - }, - { - "path": "node_modules/v8-to-istanbul/package.json" - }, - { - "path": "node_modules/@szmarczak/http-timer/package.json" - }, - { - "path": "node_modules/growl/package.json" - }, - { - "path": "node_modules/flat/package.json" - }, - { - "path": "node_modules/path-is-absolute/package.json" - }, - { - "path": "node_modules/path-parse/package.json" - }, - { - "path": "node_modules/node-forge/package.json" - }, - { - "path": "node_modules/levn/package.json" - }, - { - "path": "node_modules/chardet/package.json" - }, - { - "path": "node_modules/lodash.camelcase/package.json" - }, - { - "path": "node_modules/walkdir/package.json" - }, - { - "path": "node_modules/foreground-child/package.json" - }, - { - "path": "node_modules/quick-lru/package.json" - }, - { - "path": "node_modules/serve-static/package.json" - }, - { - "path": "node_modules/which-module/package.json" - }, - { - "path": "node_modules/power-assert/package.json" - }, - { - "path": "node_modules/is-buffer/package.json" - }, - { - "path": "node_modules/fast-levenshtein/package.json" - }, - { - "path": "node_modules/power-assert-context-traversal/package.json" - }, - { - "path": "node_modules/range-parser/package.json" - }, - { - "path": "node_modules/type-check/package.json" - }, - { - "path": "node_modules/normalize-package-data/package.json" - }, - { - "path": "node_modules/normalize-package-data/node_modules/semver/package.json" - }, - { - "path": "node_modules/registry-auth-token/package.json" - }, - { - "path": "node_modules/deep-is/package.json" - }, - { - "path": "node_modules/cli-boxes/package.json" - }, - { - "path": "node_modules/finalhandler/package.json" - }, - { - "path": "node_modules/finalhandler/node_modules/debug/package.json" - }, - { - "path": "node_modules/finalhandler/node_modules/ms/package.json" - }, - { - "path": "node_modules/optionator/package.json" - }, - { - "path": "node_modules/lodash.has/package.json" - }, - { - "path": "node_modules/xtend/package.json" - }, - { - "path": "node_modules/util-deprecate/package.json" - }, - { - "path": "node_modules/concat-map/package.json" - }, - { - "path": "node_modules/duplexify/package.json" - }, - { - "path": "node_modules/ansi-regex/package.json" - }, - { - "path": "node_modules/hard-rejection/package.json" - }, - { - "path": "node_modules/power-assert-renderer-file/package.json" - }, - { - "path": "node_modules/gaxios/package.json" - }, - { - "path": "node_modules/y18n/package.json" - }, - { - "path": "node_modules/clone-response/package.json" - }, - { - "path": "node_modules/is-obj/package.json" - }, - { - "path": "node_modules/toidentifier/package.json" - }, - { - "path": "node_modules/esprima/package.json" - }, - { - "path": "node_modules/is-callable/package.json" - }, - { - "path": "node_modules/camelcase-keys/package.json" - }, - { - "path": "node_modules/is-arrayish/package.json" - }, - { - "path": "node_modules/fast-diff/package.json" - }, - { - "path": "node_modules/configstore/package.json" - }, - { - "path": "node_modules/universal-deep-strict-equal/package.json" - }, - { - "path": "node_modules/power-assert-renderer-assertion/package.json" - }, - { - "path": "node_modules/glob-parent/package.json" - }, - { - "path": "node_modules/object.assign/package.json" - }, - { - "path": "node_modules/color-convert/package.json" - }, - { - "path": "node_modules/eslint-plugin-node/package.json" - }, - { - "path": "node_modules/eslint-plugin-node/node_modules/eslint-utils/package.json" - }, - { - "path": "node_modules/eslint-plugin-node/node_modules/ignore/package.json" - }, - { - "path": "node_modules/eslint-plugin-node/node_modules/semver/package.json" - }, - { - "path": "node_modules/cliui/package.json" - }, - { - "path": "node_modules/cheerio/package.json" - }, - { - "path": "node_modules/flatted/package.json" - }, - { - "path": "node_modules/parse5/package.json" - }, - { - "path": "node_modules/power-assert-renderer-base/package.json" - }, - { - "path": "node_modules/es6-promisify/package.json" - }, - { - "path": "node_modules/shebang-command/package.json" - }, - { - "path": "node_modules/indent-string/package.json" - }, - { - "path": "node_modules/tslib/package.json" - }, - { - "path": "node_modules/prepend-http/package.json" - }, - { - "path": "node_modules/fast-json-stable-stringify/package.json" - }, - { - "path": "node_modules/semver-diff/package.json" - }, - { - "path": "node_modules/semver-diff/node_modules/semver/package.json" - }, - { - "path": "node_modules/cli-width/package.json" - }, - { - "path": "node_modules/escape-html/package.json" - }, - { - "path": "node_modules/protobufjs/package.json" - }, - { - "path": "node_modules/protobufjs/cli/package.json" - }, - { - "path": "node_modules/protobufjs/cli/package-lock.json" - }, - { - "path": "node_modules/protobufjs/cli/node_modules/source-map/package.json" - }, - { - "path": "node_modules/protobufjs/cli/node_modules/minimist/package.json" - }, - { - "path": "node_modules/protobufjs/cli/node_modules/commander/package.json" - }, - { - "path": "node_modules/protobufjs/cli/node_modules/acorn/package.json" - }, - { - "path": "node_modules/protobufjs/cli/node_modules/espree/package.json" - }, - { - "path": "node_modules/protobufjs/cli/node_modules/uglify-js/package.json" - }, - { - "path": "node_modules/protobufjs/cli/node_modules/semver/package.json" - }, - { - "path": "node_modules/protobufjs/cli/node_modules/acorn-jsx/package.json" - }, - { - "path": "node_modules/protobufjs/cli/node_modules/acorn-jsx/node_modules/acorn/package.json" - }, - { - "path": "node_modules/has/package.json" - }, - { - "path": "node_modules/boolbase/package.json" - }, - { - "path": "node_modules/@sindresorhus/is/package.json" - }, - { - "path": "node_modules/acorn-jsx/package.json" - }, - { - "path": "node_modules/mute-stream/package.json" - }, - { - "path": "node_modules/p-queue/package.json" - }, - { - "path": "node_modules/cli-cursor/package.json" - }, - { - "path": "node_modules/bignumber.js/package.json" - }, - { - "path": "node_modules/wrap-ansi/package.json" - }, - { - "path": "node_modules/require-directory/package.json" - }, - { - "path": "node_modules/uuid/package.json" - }, - { - "path": "node_modules/c8/package.json" - }, - { - "path": "node_modules/eslint-config-prettier/package.json" - }, - { - "path": "node_modules/function-bind/package.json" - }, - { - "path": "node_modules/istanbul-lib-report/package.json" - }, - { - "path": "node_modules/object-inspect/package.json" - }, - { - "path": "node_modules/entities/package.json" - }, - { - "path": "node_modules/define-properties/package.json" - }, - { - "path": "node_modules/has-yarn/package.json" - }, - { - "path": "node_modules/min-indent/package.json" - }, - { - "path": "node_modules/underscore/package.json" - }, - { - "path": "node_modules/power-assert-renderer-diagram/package.json" - }, - { - "path": "node_modules/browser-stdout/package.json" - }, - { - "path": "node_modules/registry-url/package.json" - }, - { - "path": "node_modules/which/package.json" - }, - { - "path": "node_modules/@babel/highlight/package.json" - }, - { - "path": "node_modules/@babel/code-frame/package.json" - }, - { - "path": "node_modules/@babel/parser/package.json" - }, - { - "path": "node_modules/strip-indent/package.json" - }, - { - "path": "node_modules/map-obj/package.json" - }, - { - "path": "node_modules/duplexer3/package.json" - }, - { - "path": "node_modules/isexe/package.json" - }, - { - "path": "node_modules/klaw/package.json" - }, - { - "path": "node_modules/inherits/package.json" - }, - { - "path": "node_modules/lodash.at/package.json" - }, - { - "path": "node_modules/pump/package.json" - }, - { - "path": "node_modules/spdx-license-ids/package.json" - }, - { - "path": "node_modules/depd/package.json" - }, - { - "path": "node_modules/import-lazy/package.json" - }, - { - "path": "node_modules/string-width/package.json" - }, - { - "path": "node_modules/lines-and-columns/package.json" - }, - { - "path": "node_modules/astral-regex/package.json" - }, - { - "path": "node_modules/rimraf/package.json" - }, - { - "path": "node_modules/restore-cursor/package.json" - }, - { - "path": "node_modules/yallist/package.json" - }, - { - "path": "node_modules/emoji-regex/package.json" - }, - { - "path": "system-test/system.js" - }, - { - "path": ".git/config" - }, - { - "path": ".git/index" - }, - { - "path": ".git/packed-refs" - }, - { - "path": ".git/shallow" - }, - { - "path": ".git/HEAD" - }, - { - "path": ".git/refs/heads/autosynth" - }, - { - "path": ".git/refs/heads/master" - }, - { - "path": ".git/refs/remotes/origin/HEAD" - }, - { - "path": ".git/objects/pack/pack-08b93a97620ab95a04f8a8a7bc8e63148779052c.pack" - }, - { - "path": ".git/objects/pack/pack-08b93a97620ab95a04f8a8a7bc8e63148779052c.idx" - }, - { - "path": ".git/logs/HEAD" - }, - { - "path": ".git/logs/refs/heads/autosynth" - }, - { - "path": ".git/logs/refs/heads/master" - }, - { - "path": ".git/logs/refs/remotes/origin/HEAD" - }, - { - "path": "src/index.js" - }, - { - "path": "src/browser.js" - }, - { - "path": "src/extra_proto_list.json" - }, - { - "path": "src/v1/security_center_client_config.json" - }, - { - "path": "src/v1/index.js" - }, - { - "path": "src/v1/security_center_client.js" - }, - { - "path": "src/v1/security_center_proto_list.json" - }, - { - "path": "src/v1/doc/google/iam/v1/doc_iam_policy.js" - }, - { - "path": "src/v1/doc/google/iam/v1/doc_options.js" - }, - { - "path": "src/v1/doc/google/iam/v1/doc_policy.js" - }, - { - "path": "src/v1/doc/google/cloud/securitycenter/v1/doc_securitycenter_service.js" - }, - { - "path": "src/v1/doc/google/cloud/securitycenter/v1/doc_finding.js" - }, - { - "path": "src/v1/doc/google/cloud/securitycenter/v1/doc_organization_settings.js" - }, - { - "path": "src/v1/doc/google/cloud/securitycenter/v1/doc_source.js" - }, - { - "path": "src/v1/doc/google/cloud/securitycenter/v1/doc_asset.js" - }, - { - "path": "src/v1/doc/google/cloud/securitycenter/v1/doc_security_marks.js" - }, - { - "path": "src/v1/doc/google/type/doc_expr.js" - }, - { - "path": "src/v1/doc/google/rpc/doc_status.js" - }, - { - "path": "src/v1/doc/google/longrunning/doc_operations.js" - }, - { - "path": "src/v1/doc/google/protobuf/doc_struct.js" - }, - { - "path": "src/v1/doc/google/protobuf/doc_duration.js" - }, - { - "path": "src/v1/doc/google/protobuf/doc_any.js" - }, - { - "path": "src/v1/doc/google/protobuf/doc_timestamp.js" - }, - { - "path": "src/v1/doc/google/protobuf/doc_field_mask.js" - }, - { - "path": "src/v1beta1/security_center_client_config.json" - }, - { - "path": "src/v1beta1/index.js" - }, - { - "path": "src/v1beta1/security_center_client.js" - }, - { - "path": "src/v1beta1/security_center_proto_list.json" - }, - { - "path": "src/v1beta1/doc/google/iam/v1/doc_iam_policy.js" - }, - { - "path": "src/v1beta1/doc/google/iam/v1/doc_options.js" - }, - { - "path": "src/v1beta1/doc/google/iam/v1/doc_policy.js" - }, - { - "path": "src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_securitycenter_service.js" - }, - { - "path": "src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_finding.js" - }, - { - "path": "src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_organization_settings.js" - }, - { - "path": "src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_source.js" - }, - { - "path": "src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_asset.js" - }, - { - "path": "src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_security_marks.js" - }, - { - "path": "src/v1beta1/doc/google/type/doc_expr.js" - }, - { - "path": "src/v1beta1/doc/google/rpc/doc_status.js" - }, - { - "path": "src/v1beta1/doc/google/longrunning/doc_operations.js" - }, - { - "path": "src/v1beta1/doc/google/protobuf/doc_struct.js" - }, - { - "path": "src/v1beta1/doc/google/protobuf/doc_duration.js" - }, - { - "path": "src/v1beta1/doc/google/protobuf/doc_any.js" - }, - { - "path": "src/v1beta1/doc/google/protobuf/doc_timestamp.js" - }, - { - "path": "src/v1beta1/doc/google/protobuf/doc_field_mask.js" - }, - { - "path": "protos/protos.js" - }, - { - "path": "protos/protos.d.ts" - }, - { - "path": "protos/protos.json" - }, - { - "path": "protos/google/cloud/securitycenter/v1/finding.proto" - }, - { - "path": "protos/google/cloud/securitycenter/v1/source.proto" - }, - { - "path": "protos/google/cloud/securitycenter/v1/security_marks.proto" - }, - { - "path": "protos/google/cloud/securitycenter/v1/run_asset_discovery_response.proto" - }, - { - "path": "protos/google/cloud/securitycenter/v1/securitycenter_service.proto" - }, - { - "path": "protos/google/cloud/securitycenter/v1/organization_settings.proto" - }, - { - "path": "protos/google/cloud/securitycenter/v1/asset.proto" - }, - { - "path": "protos/google/cloud/securitycenter/v1beta1/finding.proto" - }, - { - "path": "protos/google/cloud/securitycenter/v1beta1/source.proto" - }, - { - "path": "protos/google/cloud/securitycenter/v1beta1/security_marks.proto" - }, - { - "path": "protos/google/cloud/securitycenter/v1beta1/run_asset_discovery_response.proto" - }, - { - "path": "protos/google/cloud/securitycenter/v1beta1/securitycenter_service.proto" - }, - { - "path": "protos/google/cloud/securitycenter/v1beta1/organization_settings.proto" - }, - { - "path": "protos/google/cloud/securitycenter/v1beta1/asset.proto" - }, - { - "path": "__pycache__/synth.cpython-36.pyc" - }, - { - "path": ".kokoro/common.cfg" - }, - { - "path": ".kokoro/publish.sh" - }, - { - "path": ".kokoro/docs.sh" - }, - { - "path": ".kokoro/lint.sh" - }, - { - "path": ".kokoro/.gitattributes" - }, - { - "path": ".kokoro/system-test.sh" - }, - { - "path": ".kokoro/test.bat" - }, - { - "path": ".kokoro/test.sh" - }, - { - "path": ".kokoro/trampoline.sh" - }, - { - "path": ".kokoro/samples-test.sh" - }, - { - "path": ".kokoro/presubmit/node10/common.cfg" - }, - { - "path": ".kokoro/presubmit/node10/system-test.cfg" - }, - { - "path": ".kokoro/presubmit/node10/lint.cfg" - }, - { - "path": ".kokoro/presubmit/node10/test.cfg" - }, - { - "path": ".kokoro/presubmit/node10/samples-test.cfg" - }, - { - "path": ".kokoro/presubmit/node10/docs.cfg" - }, - { - "path": ".kokoro/presubmit/node12/common.cfg" - }, - { - "path": ".kokoro/presubmit/node12/test.cfg" - }, - { - "path": ".kokoro/presubmit/node8/common.cfg" - }, - { - "path": ".kokoro/presubmit/node8/test.cfg" - }, - { - "path": ".kokoro/presubmit/windows/common.cfg" - }, - { - "path": ".kokoro/presubmit/windows/test.cfg" - }, - { - "path": ".kokoro/release/common.cfg" - }, - { - "path": ".kokoro/release/publish.cfg" - }, - { - "path": ".kokoro/release/docs.sh" - }, - { - "path": ".kokoro/release/docs.cfg" - }, - { - "path": ".kokoro/continuous/node10/common.cfg" - }, - { - "path": ".kokoro/continuous/node10/system-test.cfg" - }, - { - "path": ".kokoro/continuous/node10/lint.cfg" - }, - { - "path": ".kokoro/continuous/node10/test.cfg" - }, - { - "path": ".kokoro/continuous/node10/samples-test.cfg" - }, - { - "path": ".kokoro/continuous/node10/docs.cfg" - }, - { - "path": ".kokoro/continuous/node12/common.cfg" - }, - { - "path": ".kokoro/continuous/node12/test.cfg" - }, - { - "path": ".kokoro/continuous/node8/common.cfg" - }, - { - "path": ".kokoro/continuous/node8/test.cfg" - }, - { - "path": "samples/package.json" - }, - { - "path": "samples/quickstart.js" - }, - { - "path": "samples/.eslintrc.yml" - }, - { - "path": "samples/README.md" - }, - { - "path": "samples/system-test/quickstart.test.js" - }, - { - "path": "samples/system-test/v1/assetSecurityMarks.test.js" - }, - { - "path": "samples/system-test/v1/listFilteredAssets.test.js" - }, - { - "path": "samples/system-test/v1/listAssetsAtTime.test.js" - }, - { - "path": "samples/system-test/v1/orgSettings.test.js" - }, - { - "path": "samples/system-test/v1/findings.test.js" - }, - { - "path": "samples/system-test/v1/listAssetsAndChanges.test.js" - }, - { - "path": "samples/system-test/v1/listAllAssets.test.js" - }, - { - "path": "samples/v1/createSource.js" - }, - { - "path": "samples/v1/updateSource.js" - }, - { - "path": "samples/v1/createFindingSourceProperties.js" - }, - { - "path": "samples/v1/addFindingSecurityMarks.js" - }, - { - "path": "samples/v1/listAllSources.js" - }, - { - "path": "samples/v1/getSourceIam.js" - }, - { - "path": "samples/v1/listAllFindings.js" - }, - { - "path": "samples/v1/listAssetsAndChanges.js" - }, - { - "path": "samples/v1/setSourceIam.js" - }, - { - "path": "samples/v1/listFilteredFindings.js" - }, - { - "path": "samples/v1/addSecurityMarks.js" - }, - { - "path": "samples/v1/enableAssetDiscovery.js" - }, - { - "path": "samples/v1/listAssetsWithSecurityMarks.js" - }, - { - "path": "samples/v1/testIam.js" - }, - { - "path": "samples/v1/createFinding.js" - }, - { - "path": "samples/v1/addDeleteSecurityMarks.js" - }, - { - "path": "samples/v1/getOrganizationSettings.js" - }, - { - "path": "samples/v1/listAssetsAtTime.js" - }, - { - "path": "samples/v1/deleteSecurityMarks.js" - }, - { - "path": "samples/v1/setFindingState.js" - }, - { - "path": "samples/v1/updateFindingSourceProperties.js" - }, - { - "path": "samples/v1/getSource.js" - }, - { - "path": "samples/v1/listFindingsAtTime.js" - }, - { - "path": "samples/v1/listFilteredAssets.js" - }, - { - "path": "samples/v1/listAllAssets.js" - }, - { - "path": "samples/v1/listFindingsWithSecurityMarks.js" - }, - { - "path": "test/gapic-v1.js" - }, - { - "path": "test/mocha.opts" - } ] } \ No newline at end of file From 83874410e80e13fce62f94ab2ae61c1b5a3637be Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 14 Jan 2020 03:22:31 +0100 Subject: [PATCH 126/342] chore(deps): update dependency mocha to v7 (#190) --- packages/google-cloud-securitycenter/package.json | 2 +- packages/google-cloud-securitycenter/samples/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-securitycenter/package.json b/packages/google-cloud-securitycenter/package.json index afa798bec36..31b827ec06e 100644 --- a/packages/google-cloud-securitycenter/package.json +++ b/packages/google-cloud-securitycenter/package.json @@ -51,7 +51,7 @@ "jsdoc-fresh": "^1.0.1", "jsdoc-region-tag": "^1.0.2", "linkinator": "^1.5.0", - "mocha": "^6.0.0", + "mocha": "^7.0.0", "c8": "^7.0.0", "power-assert": "^1.4.4", "prettier": "^1.7.4" diff --git a/packages/google-cloud-securitycenter/samples/package.json b/packages/google-cloud-securitycenter/samples/package.json index e73c02cea08..773b9bd3637 100644 --- a/packages/google-cloud-securitycenter/samples/package.json +++ b/packages/google-cloud-securitycenter/samples/package.json @@ -17,6 +17,6 @@ }, "devDependencies": { "chai": "^4.2.0", - "mocha": "^6.0.2" + "mocha": "^7.0.0" } } From 339157b1fe300b0fc6eceb3ed1d60d81e8e4cb0a Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Thu, 23 Jan 2020 17:21:44 -0800 Subject: [PATCH 127/342] chore: clear synth.metadata --- .../synth.metadata | 49 ------------------- 1 file changed, 49 deletions(-) delete mode 100644 packages/google-cloud-securitycenter/synth.metadata diff --git a/packages/google-cloud-securitycenter/synth.metadata b/packages/google-cloud-securitycenter/synth.metadata deleted file mode 100644 index 2bc4935be0e..00000000000 --- a/packages/google-cloud-securitycenter/synth.metadata +++ /dev/null @@ -1,49 +0,0 @@ -{ - "updateTime": "2020-01-13T12:25:40.666052Z", - "sources": [ - { - "generator": { - "name": "artman", - "version": "0.43.0", - "dockerImage": "googleapis/artman@sha256:264654a37596a44b0668b8ce6ac41082d713f6ee150b3fc6425fa78cc64e4f20" - } - }, - { - "git": { - "name": "googleapis", - "remote": "https://github.com/googleapis/googleapis.git", - "sha": "06ec6d5d053fff299eaa6eaa38afdd36c5e2fc68", - "internalRef": "289413169" - } - }, - { - "template": { - "name": "node_library", - "origin": "synthtool.gcp", - "version": "2019.10.17" - } - } - ], - "destinations": [ - { - "client": { - "source": "googleapis", - "apiName": "securitycenter", - "apiVersion": "v1beta1", - "language": "nodejs", - "generator": "gapic", - "config": "google/cloud/securitycenter/artman_securitycenter_v1beta1.yaml" - } - }, - { - "client": { - "source": "googleapis", - "apiName": "securitycenter", - "apiVersion": "v1", - "language": "nodejs", - "generator": "gapic", - "config": "google/cloud/securitycenter/artman_securitycenter_v1.yaml" - } - } - ] -} \ No newline at end of file From 3495f4d3a9fe1a58d18ad748becabb7fb4cc291e Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Fri, 24 Jan 2020 16:59:26 -0800 Subject: [PATCH 128/342] chore: regenerate synth.metadata (#197) --- .../v1/securitycenter_service.proto | 1 + .../src/browser.js | 2 +- .../google-cloud-securitycenter/src/index.js | 2 +- .../cloud/securitycenter/v1/doc_asset.js | 2 +- .../cloud/securitycenter/v1/doc_finding.js | 2 +- .../v1/doc_organization_settings.js | 2 +- .../securitycenter/v1/doc_security_marks.js | 2 +- .../v1/doc_securitycenter_service.js | 2 +- .../cloud/securitycenter/v1/doc_source.js | 2 +- .../v1/doc/google/iam/v1/doc_iam_policy.js | 2 +- .../src/v1/doc/google/iam/v1/doc_options.js | 2 +- .../src/v1/doc/google/iam/v1/doc_policy.js | 2 +- .../doc/google/longrunning/doc_operations.js | 2 +- .../src/v1/doc/google/protobuf/doc_any.js | 2 +- .../v1/doc/google/protobuf/doc_duration.js | 2 +- .../v1/doc/google/protobuf/doc_field_mask.js | 2 +- .../src/v1/doc/google/protobuf/doc_struct.js | 2 +- .../v1/doc/google/protobuf/doc_timestamp.js | 2 +- .../src/v1/doc/google/rpc/doc_status.js | 62 +- .../src/v1/doc/google/type/doc_expr.js | 2 +- .../src/v1/index.js | 2 +- .../src/v1/security_center_client.js | 2 +- .../cloud/securitycenter/v1beta1/doc_asset.js | 2 +- .../securitycenter/v1beta1/doc_finding.js | 2 +- .../v1beta1/doc_organization_settings.js | 2 +- .../v1beta1/doc_security_marks.js | 2 +- .../v1beta1/doc_securitycenter_service.js | 2 +- .../securitycenter/v1beta1/doc_source.js | 2 +- .../doc/google/iam/v1/doc_iam_policy.js | 2 +- .../v1beta1/doc/google/iam/v1/doc_options.js | 2 +- .../v1beta1/doc/google/iam/v1/doc_policy.js | 2 +- .../doc/google/longrunning/doc_operations.js | 2 +- .../v1beta1/doc/google/protobuf/doc_any.js | 2 +- .../doc/google/protobuf/doc_duration.js | 2 +- .../doc/google/protobuf/doc_field_mask.js | 2 +- .../v1beta1/doc/google/protobuf/doc_struct.js | 2 +- .../doc/google/protobuf/doc_timestamp.js | 2 +- .../src/v1beta1/doc/google/rpc/doc_status.js | 62 +- .../src/v1beta1/doc/google/type/doc_expr.js | 2 +- .../src/v1beta1/index.js | 2 +- .../src/v1beta1/security_center_client.js | 2 +- .../synth.metadata | 546 ++++++++++++++++++ .../test/gapic-v1.js | 2 +- .../webpack.config.js | 2 +- 44 files changed, 601 insertions(+), 150 deletions(-) create mode 100644 packages/google-cloud-securitycenter/synth.metadata diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/securitycenter_service.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/securitycenter_service.proto index 1cd1aff20d7..df3e53dc3aa 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/securitycenter_service.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/securitycenter_service.proto @@ -17,6 +17,7 @@ syntax = "proto3"; package google.cloud.securitycenter.v1; +import public "google/cloud/securitycenter/v1/run_asset_discovery_response.proto"; import "google/api/annotations.proto"; import "google/api/client.proto"; import "google/api/field_behavior.proto"; diff --git a/packages/google-cloud-securitycenter/src/browser.js b/packages/google-cloud-securitycenter/src/browser.js index ddbcd7ecb9a..68dc62d25d6 100644 --- a/packages/google-cloud-securitycenter/src/browser.js +++ b/packages/google-cloud-securitycenter/src/browser.js @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC +// 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. diff --git a/packages/google-cloud-securitycenter/src/index.js b/packages/google-cloud-securitycenter/src/index.js index d56ca644030..fb65485f03b 100644 --- a/packages/google-cloud-securitycenter/src/index.js +++ b/packages/google-cloud-securitycenter/src/index.js @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC +// 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. diff --git a/packages/google-cloud-securitycenter/src/v1/doc/google/cloud/securitycenter/v1/doc_asset.js b/packages/google-cloud-securitycenter/src/v1/doc/google/cloud/securitycenter/v1/doc_asset.js index 95e09a50615..aef0418e6fa 100644 --- a/packages/google-cloud-securitycenter/src/v1/doc/google/cloud/securitycenter/v1/doc_asset.js +++ b/packages/google-cloud-securitycenter/src/v1/doc/google/cloud/securitycenter/v1/doc_asset.js @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC +// 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. diff --git a/packages/google-cloud-securitycenter/src/v1/doc/google/cloud/securitycenter/v1/doc_finding.js b/packages/google-cloud-securitycenter/src/v1/doc/google/cloud/securitycenter/v1/doc_finding.js index 2e2170cd5e3..ac7edb5fc80 100644 --- a/packages/google-cloud-securitycenter/src/v1/doc/google/cloud/securitycenter/v1/doc_finding.js +++ b/packages/google-cloud-securitycenter/src/v1/doc/google/cloud/securitycenter/v1/doc_finding.js @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC +// 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. diff --git a/packages/google-cloud-securitycenter/src/v1/doc/google/cloud/securitycenter/v1/doc_organization_settings.js b/packages/google-cloud-securitycenter/src/v1/doc/google/cloud/securitycenter/v1/doc_organization_settings.js index be8bd7e92dd..38f6bcacac6 100644 --- a/packages/google-cloud-securitycenter/src/v1/doc/google/cloud/securitycenter/v1/doc_organization_settings.js +++ b/packages/google-cloud-securitycenter/src/v1/doc/google/cloud/securitycenter/v1/doc_organization_settings.js @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC +// 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. diff --git a/packages/google-cloud-securitycenter/src/v1/doc/google/cloud/securitycenter/v1/doc_security_marks.js b/packages/google-cloud-securitycenter/src/v1/doc/google/cloud/securitycenter/v1/doc_security_marks.js index d0e39768ca5..44bacf1b9c8 100644 --- a/packages/google-cloud-securitycenter/src/v1/doc/google/cloud/securitycenter/v1/doc_security_marks.js +++ b/packages/google-cloud-securitycenter/src/v1/doc/google/cloud/securitycenter/v1/doc_security_marks.js @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC +// 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. diff --git a/packages/google-cloud-securitycenter/src/v1/doc/google/cloud/securitycenter/v1/doc_securitycenter_service.js b/packages/google-cloud-securitycenter/src/v1/doc/google/cloud/securitycenter/v1/doc_securitycenter_service.js index 46407c877b2..15d56f9a2cb 100644 --- a/packages/google-cloud-securitycenter/src/v1/doc/google/cloud/securitycenter/v1/doc_securitycenter_service.js +++ b/packages/google-cloud-securitycenter/src/v1/doc/google/cloud/securitycenter/v1/doc_securitycenter_service.js @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC +// 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. diff --git a/packages/google-cloud-securitycenter/src/v1/doc/google/cloud/securitycenter/v1/doc_source.js b/packages/google-cloud-securitycenter/src/v1/doc/google/cloud/securitycenter/v1/doc_source.js index ba85e2bab35..a150f5cfcef 100644 --- a/packages/google-cloud-securitycenter/src/v1/doc/google/cloud/securitycenter/v1/doc_source.js +++ b/packages/google-cloud-securitycenter/src/v1/doc/google/cloud/securitycenter/v1/doc_source.js @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC +// 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. diff --git a/packages/google-cloud-securitycenter/src/v1/doc/google/iam/v1/doc_iam_policy.js b/packages/google-cloud-securitycenter/src/v1/doc/google/iam/v1/doc_iam_policy.js index 15b6fb823d4..2a58fee6a13 100644 --- a/packages/google-cloud-securitycenter/src/v1/doc/google/iam/v1/doc_iam_policy.js +++ b/packages/google-cloud-securitycenter/src/v1/doc/google/iam/v1/doc_iam_policy.js @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC +// 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. diff --git a/packages/google-cloud-securitycenter/src/v1/doc/google/iam/v1/doc_options.js b/packages/google-cloud-securitycenter/src/v1/doc/google/iam/v1/doc_options.js index b725d806cce..ed4e25db8cd 100644 --- a/packages/google-cloud-securitycenter/src/v1/doc/google/iam/v1/doc_options.js +++ b/packages/google-cloud-securitycenter/src/v1/doc/google/iam/v1/doc_options.js @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC +// 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. diff --git a/packages/google-cloud-securitycenter/src/v1/doc/google/iam/v1/doc_policy.js b/packages/google-cloud-securitycenter/src/v1/doc/google/iam/v1/doc_policy.js index 606cdf98cad..f2ac79a7afa 100644 --- a/packages/google-cloud-securitycenter/src/v1/doc/google/iam/v1/doc_policy.js +++ b/packages/google-cloud-securitycenter/src/v1/doc/google/iam/v1/doc_policy.js @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC +// 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. diff --git a/packages/google-cloud-securitycenter/src/v1/doc/google/longrunning/doc_operations.js b/packages/google-cloud-securitycenter/src/v1/doc/google/longrunning/doc_operations.js index 5aa806fd340..099e418d620 100644 --- a/packages/google-cloud-securitycenter/src/v1/doc/google/longrunning/doc_operations.js +++ b/packages/google-cloud-securitycenter/src/v1/doc/google/longrunning/doc_operations.js @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC +// 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. diff --git a/packages/google-cloud-securitycenter/src/v1/doc/google/protobuf/doc_any.js b/packages/google-cloud-securitycenter/src/v1/doc/google/protobuf/doc_any.js index cdd2fc80e49..813682aa336 100644 --- a/packages/google-cloud-securitycenter/src/v1/doc/google/protobuf/doc_any.js +++ b/packages/google-cloud-securitycenter/src/v1/doc/google/protobuf/doc_any.js @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC +// 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. diff --git a/packages/google-cloud-securitycenter/src/v1/doc/google/protobuf/doc_duration.js b/packages/google-cloud-securitycenter/src/v1/doc/google/protobuf/doc_duration.js index 1275f8f4d13..bd4b4ee6067 100644 --- a/packages/google-cloud-securitycenter/src/v1/doc/google/protobuf/doc_duration.js +++ b/packages/google-cloud-securitycenter/src/v1/doc/google/protobuf/doc_duration.js @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC +// 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. diff --git a/packages/google-cloud-securitycenter/src/v1/doc/google/protobuf/doc_field_mask.js b/packages/google-cloud-securitycenter/src/v1/doc/google/protobuf/doc_field_mask.js index 011207b8626..59e745f36c2 100644 --- a/packages/google-cloud-securitycenter/src/v1/doc/google/protobuf/doc_field_mask.js +++ b/packages/google-cloud-securitycenter/src/v1/doc/google/protobuf/doc_field_mask.js @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC +// 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. diff --git a/packages/google-cloud-securitycenter/src/v1/doc/google/protobuf/doc_struct.js b/packages/google-cloud-securitycenter/src/v1/doc/google/protobuf/doc_struct.js index ae7e4ef1ff6..a143b9a6d2d 100644 --- a/packages/google-cloud-securitycenter/src/v1/doc/google/protobuf/doc_struct.js +++ b/packages/google-cloud-securitycenter/src/v1/doc/google/protobuf/doc_struct.js @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC +// 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. diff --git a/packages/google-cloud-securitycenter/src/v1/doc/google/protobuf/doc_timestamp.js b/packages/google-cloud-securitycenter/src/v1/doc/google/protobuf/doc_timestamp.js index c457acc0c7d..ad801cc9a10 100644 --- a/packages/google-cloud-securitycenter/src/v1/doc/google/protobuf/doc_timestamp.js +++ b/packages/google-cloud-securitycenter/src/v1/doc/google/protobuf/doc_timestamp.js @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC +// 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. diff --git a/packages/google-cloud-securitycenter/src/v1/doc/google/rpc/doc_status.js b/packages/google-cloud-securitycenter/src/v1/doc/google/rpc/doc_status.js index 432ab6bb928..750e0af7689 100644 --- a/packages/google-cloud-securitycenter/src/v1/doc/google/rpc/doc_status.js +++ b/packages/google-cloud-securitycenter/src/v1/doc/google/rpc/doc_status.js @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC +// 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. @@ -18,67 +18,19 @@ /** * The `Status` type defines a logical error model that is suitable for * different programming environments, including REST APIs and RPC APIs. It is - * used by [gRPC](https://github.com/grpc). The error model is designed to be: + * used by [gRPC](https://github.com/grpc). Each `Status` message contains + * three pieces of data: error code, error message, and error details. * - * - Simple to use and understand for most users - * - Flexible enough to meet unexpected needs - * - * # Overview - * - * The `Status` message contains three pieces of data: error code, error - * message, and error details. The error code should be an enum value of - * google.rpc.Code, but it may accept additional error codes - * if needed. The error message should be a developer-facing English message - * that helps developers *understand* and *resolve* the error. If a localized - * user-facing error message is needed, put the localized message in the error - * details or localize it in the client. The optional error details may contain - * arbitrary information about the error. There is a predefined set of error - * detail types in the package `google.rpc` that can be used for common error - * conditions. - * - * # Language mapping - * - * The `Status` message is the logical representation of the error model, but it - * is not necessarily the actual wire format. When the `Status` message is - * exposed in different client libraries and different wire protocols, it can be - * mapped differently. For example, it will likely be mapped to some exceptions - * in Java, but more likely mapped to some error codes in C. - * - * # Other uses - * - * The error model and the `Status` message can be used in a variety of - * environments, either with or without APIs, to provide a - * consistent developer experience across different environments. - * - * Example uses of this error model include: - * - * - Partial errors. If a service needs to return partial errors to the client, - * it may embed the `Status` in the normal response to indicate the partial - * errors. - * - * - Workflow errors. A typical workflow has multiple steps. Each step may - * have a `Status` message for error reporting. - * - * - Batch operations. If a client uses batch request and batch response, the - * `Status` message should be used directly inside batch response, one for - * each error sub-response. - * - * - Asynchronous operations. If an API call embeds asynchronous operation - * results in its response, the status of those operations should be - * represented directly using the `Status` message. - * - * - Logging. If some API errors are stored in logs, the message `Status` could - * be used directly after any stripping needed for security/privacy reasons. + * You can find out more about this error model and how to work with it in the + * [API Design Guide](https://cloud.google.com/apis/design/errors). * * @property {number} code - * The status code, which should be an enum value of - * google.rpc.Code. + * The status code, which should be an enum value of google.rpc.Code. * * @property {string} message * A developer-facing error message, which should be in English. Any * user-facing error message should be localized and sent in the - * google.rpc.Status.details field, or localized - * by the client. + * google.rpc.Status.details field, or localized by the client. * * @property {Object[]} details * A list of messages that carry the error details. There is a common set of diff --git a/packages/google-cloud-securitycenter/src/v1/doc/google/type/doc_expr.js b/packages/google-cloud-securitycenter/src/v1/doc/google/type/doc_expr.js index 421a7ee9e6a..c185edde52f 100644 --- a/packages/google-cloud-securitycenter/src/v1/doc/google/type/doc_expr.js +++ b/packages/google-cloud-securitycenter/src/v1/doc/google/type/doc_expr.js @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC +// 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. diff --git a/packages/google-cloud-securitycenter/src/v1/index.js b/packages/google-cloud-securitycenter/src/v1/index.js index 1f988c41e32..7624ae3951c 100644 --- a/packages/google-cloud-securitycenter/src/v1/index.js +++ b/packages/google-cloud-securitycenter/src/v1/index.js @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC +// 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. diff --git a/packages/google-cloud-securitycenter/src/v1/security_center_client.js b/packages/google-cloud-securitycenter/src/v1/security_center_client.js index 8e33ae2a58e..cf3b2d2f5bf 100644 --- a/packages/google-cloud-securitycenter/src/v1/security_center_client.js +++ b/packages/google-cloud-securitycenter/src/v1/security_center_client.js @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC +// 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. diff --git a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_asset.js b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_asset.js index 2c0206e3abe..b4060183881 100644 --- a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_asset.js +++ b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_asset.js @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC +// 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. diff --git a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_finding.js b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_finding.js index ded888d50ee..f5ddbd30abe 100644 --- a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_finding.js +++ b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_finding.js @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC +// 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. diff --git a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_organization_settings.js b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_organization_settings.js index a9da730be6c..0e44f01785f 100644 --- a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_organization_settings.js +++ b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_organization_settings.js @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC +// 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. diff --git a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_security_marks.js b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_security_marks.js index 4975a2e35a2..18bac6d990d 100644 --- a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_security_marks.js +++ b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_security_marks.js @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC +// 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. diff --git a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_securitycenter_service.js b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_securitycenter_service.js index 4d63259e480..ba707d7a608 100644 --- a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_securitycenter_service.js +++ b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_securitycenter_service.js @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC +// 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. diff --git a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_source.js b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_source.js index 9e7cbb4e0fa..0f50da3d72b 100644 --- a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_source.js +++ b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_source.js @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC +// 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. diff --git a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/iam/v1/doc_iam_policy.js b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/iam/v1/doc_iam_policy.js index 15b6fb823d4..2a58fee6a13 100644 --- a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/iam/v1/doc_iam_policy.js +++ b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/iam/v1/doc_iam_policy.js @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC +// 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. diff --git a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/iam/v1/doc_options.js b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/iam/v1/doc_options.js index b725d806cce..ed4e25db8cd 100644 --- a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/iam/v1/doc_options.js +++ b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/iam/v1/doc_options.js @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC +// 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. diff --git a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/iam/v1/doc_policy.js b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/iam/v1/doc_policy.js index 606cdf98cad..f2ac79a7afa 100644 --- a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/iam/v1/doc_policy.js +++ b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/iam/v1/doc_policy.js @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC +// 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. diff --git a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/longrunning/doc_operations.js b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/longrunning/doc_operations.js index 5aa806fd340..099e418d620 100644 --- a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/longrunning/doc_operations.js +++ b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/longrunning/doc_operations.js @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC +// 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. diff --git a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/protobuf/doc_any.js b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/protobuf/doc_any.js index cdd2fc80e49..813682aa336 100644 --- a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/protobuf/doc_any.js +++ b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/protobuf/doc_any.js @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC +// 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. diff --git a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/protobuf/doc_duration.js b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/protobuf/doc_duration.js index 1275f8f4d13..bd4b4ee6067 100644 --- a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/protobuf/doc_duration.js +++ b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/protobuf/doc_duration.js @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC +// 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. diff --git a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/protobuf/doc_field_mask.js b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/protobuf/doc_field_mask.js index 011207b8626..59e745f36c2 100644 --- a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/protobuf/doc_field_mask.js +++ b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/protobuf/doc_field_mask.js @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC +// 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. diff --git a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/protobuf/doc_struct.js b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/protobuf/doc_struct.js index ae7e4ef1ff6..a143b9a6d2d 100644 --- a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/protobuf/doc_struct.js +++ b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/protobuf/doc_struct.js @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC +// 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. diff --git a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/protobuf/doc_timestamp.js b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/protobuf/doc_timestamp.js index c457acc0c7d..ad801cc9a10 100644 --- a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/protobuf/doc_timestamp.js +++ b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/protobuf/doc_timestamp.js @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC +// 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. diff --git a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/rpc/doc_status.js b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/rpc/doc_status.js index 432ab6bb928..750e0af7689 100644 --- a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/rpc/doc_status.js +++ b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/rpc/doc_status.js @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC +// 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. @@ -18,67 +18,19 @@ /** * The `Status` type defines a logical error model that is suitable for * different programming environments, including REST APIs and RPC APIs. It is - * used by [gRPC](https://github.com/grpc). The error model is designed to be: + * used by [gRPC](https://github.com/grpc). Each `Status` message contains + * three pieces of data: error code, error message, and error details. * - * - Simple to use and understand for most users - * - Flexible enough to meet unexpected needs - * - * # Overview - * - * The `Status` message contains three pieces of data: error code, error - * message, and error details. The error code should be an enum value of - * google.rpc.Code, but it may accept additional error codes - * if needed. The error message should be a developer-facing English message - * that helps developers *understand* and *resolve* the error. If a localized - * user-facing error message is needed, put the localized message in the error - * details or localize it in the client. The optional error details may contain - * arbitrary information about the error. There is a predefined set of error - * detail types in the package `google.rpc` that can be used for common error - * conditions. - * - * # Language mapping - * - * The `Status` message is the logical representation of the error model, but it - * is not necessarily the actual wire format. When the `Status` message is - * exposed in different client libraries and different wire protocols, it can be - * mapped differently. For example, it will likely be mapped to some exceptions - * in Java, but more likely mapped to some error codes in C. - * - * # Other uses - * - * The error model and the `Status` message can be used in a variety of - * environments, either with or without APIs, to provide a - * consistent developer experience across different environments. - * - * Example uses of this error model include: - * - * - Partial errors. If a service needs to return partial errors to the client, - * it may embed the `Status` in the normal response to indicate the partial - * errors. - * - * - Workflow errors. A typical workflow has multiple steps. Each step may - * have a `Status` message for error reporting. - * - * - Batch operations. If a client uses batch request and batch response, the - * `Status` message should be used directly inside batch response, one for - * each error sub-response. - * - * - Asynchronous operations. If an API call embeds asynchronous operation - * results in its response, the status of those operations should be - * represented directly using the `Status` message. - * - * - Logging. If some API errors are stored in logs, the message `Status` could - * be used directly after any stripping needed for security/privacy reasons. + * You can find out more about this error model and how to work with it in the + * [API Design Guide](https://cloud.google.com/apis/design/errors). * * @property {number} code - * The status code, which should be an enum value of - * google.rpc.Code. + * The status code, which should be an enum value of google.rpc.Code. * * @property {string} message * A developer-facing error message, which should be in English. Any * user-facing error message should be localized and sent in the - * google.rpc.Status.details field, or localized - * by the client. + * google.rpc.Status.details field, or localized by the client. * * @property {Object[]} details * A list of messages that carry the error details. There is a common set of diff --git a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/type/doc_expr.js b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/type/doc_expr.js index 421a7ee9e6a..c185edde52f 100644 --- a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/type/doc_expr.js +++ b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/type/doc_expr.js @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC +// 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. diff --git a/packages/google-cloud-securitycenter/src/v1beta1/index.js b/packages/google-cloud-securitycenter/src/v1beta1/index.js index 1f988c41e32..7624ae3951c 100644 --- a/packages/google-cloud-securitycenter/src/v1beta1/index.js +++ b/packages/google-cloud-securitycenter/src/v1beta1/index.js @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC +// 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. diff --git a/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.js b/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.js index 4402a128dbe..89eb48e9f6c 100644 --- a/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.js +++ b/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.js @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC +// 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. diff --git a/packages/google-cloud-securitycenter/synth.metadata b/packages/google-cloud-securitycenter/synth.metadata new file mode 100644 index 00000000000..3e2ffd3f739 --- /dev/null +++ b/packages/google-cloud-securitycenter/synth.metadata @@ -0,0 +1,546 @@ +{ + "updateTime": "2020-01-24T12:33:32.193979Z", + "sources": [ + { + "generator": { + "name": "artman", + "version": "0.44.1", + "dockerImage": "googleapis/artman@sha256:5599b61e56a372d21b671969ee915fbca0f6c3a0daaeb898d01f8f685f1bbc8b" + } + }, + { + "git": { + "name": "googleapis", + "remote": "https://github.com/googleapis/googleapis.git", + "sha": "e26cab8afd19d396b929039dac5d874cf0b5336c", + "internalRef": "291240093" + } + }, + { + "template": { + "name": "node_library", + "origin": "synthtool.gcp", + "version": "2019.10.17" + } + } + ], + "destinations": [ + { + "client": { + "source": "googleapis", + "apiName": "securitycenter", + "apiVersion": "v1beta1", + "language": "nodejs", + "generator": "gapic", + "config": "google/cloud/securitycenter/artman_securitycenter_v1beta1.yaml" + } + }, + { + "client": { + "source": "googleapis", + "apiName": "securitycenter", + "apiVersion": "v1", + "language": "nodejs", + "generator": "gapic", + "config": "google/cloud/securitycenter/artman_securitycenter_v1.yaml" + } + } + ], + "newFiles": [ + { + "path": ".eslintignore" + }, + { + "path": ".eslintrc.yml" + }, + { + "path": ".github/ISSUE_TEMPLATE.md" + }, + { + "path": ".github/ISSUE_TEMPLATE/bug_report.md" + }, + { + "path": ".github/ISSUE_TEMPLATE/feature_request.md" + }, + { + "path": ".github/ISSUE_TEMPLATE/support_request.md" + }, + { + "path": ".github/PULL_REQUEST_TEMPLATE.md" + }, + { + "path": ".github/release-please.yml" + }, + { + "path": ".gitignore" + }, + { + "path": ".jsdoc.js" + }, + { + "path": ".kokoro/.gitattributes" + }, + { + "path": ".kokoro/common.cfg" + }, + { + "path": ".kokoro/continuous/node10/common.cfg" + }, + { + "path": ".kokoro/continuous/node10/docs.cfg" + }, + { + "path": ".kokoro/continuous/node10/lint.cfg" + }, + { + "path": ".kokoro/continuous/node10/samples-test.cfg" + }, + { + "path": ".kokoro/continuous/node10/system-test.cfg" + }, + { + "path": ".kokoro/continuous/node10/test.cfg" + }, + { + "path": ".kokoro/continuous/node12/common.cfg" + }, + { + "path": ".kokoro/continuous/node12/test.cfg" + }, + { + "path": ".kokoro/continuous/node8/common.cfg" + }, + { + "path": ".kokoro/continuous/node8/test.cfg" + }, + { + "path": ".kokoro/docs.sh" + }, + { + "path": ".kokoro/lint.sh" + }, + { + "path": ".kokoro/presubmit/node10/common.cfg" + }, + { + "path": ".kokoro/presubmit/node10/docs.cfg" + }, + { + "path": ".kokoro/presubmit/node10/lint.cfg" + }, + { + "path": ".kokoro/presubmit/node10/samples-test.cfg" + }, + { + "path": ".kokoro/presubmit/node10/system-test.cfg" + }, + { + "path": ".kokoro/presubmit/node10/test.cfg" + }, + { + "path": ".kokoro/presubmit/node12/common.cfg" + }, + { + "path": ".kokoro/presubmit/node12/test.cfg" + }, + { + "path": ".kokoro/presubmit/node8/common.cfg" + }, + { + "path": ".kokoro/presubmit/node8/test.cfg" + }, + { + "path": ".kokoro/presubmit/windows/common.cfg" + }, + { + "path": ".kokoro/presubmit/windows/test.cfg" + }, + { + "path": ".kokoro/publish.sh" + }, + { + "path": ".kokoro/release/common.cfg" + }, + { + "path": ".kokoro/release/docs.cfg" + }, + { + "path": ".kokoro/release/docs.sh" + }, + { + "path": ".kokoro/release/publish.cfg" + }, + { + "path": ".kokoro/samples-test.sh" + }, + { + "path": ".kokoro/system-test.sh" + }, + { + "path": ".kokoro/test.bat" + }, + { + "path": ".kokoro/test.sh" + }, + { + "path": ".kokoro/trampoline.sh" + }, + { + "path": ".nycrc" + }, + { + "path": ".prettierignore" + }, + { + "path": ".prettierrc" + }, + { + "path": ".readme-partials.yaml" + }, + { + "path": ".repo-metadata.json" + }, + { + "path": "CHANGELOG.md" + }, + { + "path": "CODE_OF_CONDUCT.md" + }, + { + "path": "CONTRIBUTING.md" + }, + { + "path": "LICENSE" + }, + { + "path": "README.md" + }, + { + "path": "codecov.yaml" + }, + { + "path": "linkinator.config.json" + }, + { + "path": "package.json" + }, + { + "path": "protos/google/cloud/securitycenter/v1/asset.proto" + }, + { + "path": "protos/google/cloud/securitycenter/v1/finding.proto" + }, + { + "path": "protos/google/cloud/securitycenter/v1/organization_settings.proto" + }, + { + "path": "protos/google/cloud/securitycenter/v1/run_asset_discovery_response.proto" + }, + { + "path": "protos/google/cloud/securitycenter/v1/security_marks.proto" + }, + { + "path": "protos/google/cloud/securitycenter/v1/securitycenter_service.proto" + }, + { + "path": "protos/google/cloud/securitycenter/v1/source.proto" + }, + { + "path": "protos/google/cloud/securitycenter/v1beta1/asset.proto" + }, + { + "path": "protos/google/cloud/securitycenter/v1beta1/finding.proto" + }, + { + "path": "protos/google/cloud/securitycenter/v1beta1/organization_settings.proto" + }, + { + "path": "protos/google/cloud/securitycenter/v1beta1/run_asset_discovery_response.proto" + }, + { + "path": "protos/google/cloud/securitycenter/v1beta1/security_marks.proto" + }, + { + "path": "protos/google/cloud/securitycenter/v1beta1/securitycenter_service.proto" + }, + { + "path": "protos/google/cloud/securitycenter/v1beta1/source.proto" + }, + { + "path": "protos/protos.d.ts" + }, + { + "path": "protos/protos.js" + }, + { + "path": "protos/protos.json" + }, + { + "path": "renovate.json" + }, + { + "path": "samples/.eslintrc.yml" + }, + { + "path": "samples/README.md" + }, + { + "path": "samples/package.json" + }, + { + "path": "samples/quickstart.js" + }, + { + "path": "samples/system-test/quickstart.test.js" + }, + { + "path": "samples/system-test/v1/assetSecurityMarks.test.js" + }, + { + "path": "samples/system-test/v1/findings.test.js" + }, + { + "path": "samples/system-test/v1/listAllAssets.test.js" + }, + { + "path": "samples/system-test/v1/listAssetsAndChanges.test.js" + }, + { + "path": "samples/system-test/v1/listAssetsAtTime.test.js" + }, + { + "path": "samples/system-test/v1/listFilteredAssets.test.js" + }, + { + "path": "samples/system-test/v1/orgSettings.test.js" + }, + { + "path": "samples/v1/addDeleteSecurityMarks.js" + }, + { + "path": "samples/v1/addFindingSecurityMarks.js" + }, + { + "path": "samples/v1/addSecurityMarks.js" + }, + { + "path": "samples/v1/createFinding.js" + }, + { + "path": "samples/v1/createFindingSourceProperties.js" + }, + { + "path": "samples/v1/createSource.js" + }, + { + "path": "samples/v1/deleteSecurityMarks.js" + }, + { + "path": "samples/v1/enableAssetDiscovery.js" + }, + { + "path": "samples/v1/getOrganizationSettings.js" + }, + { + "path": "samples/v1/getSource.js" + }, + { + "path": "samples/v1/getSourceIam.js" + }, + { + "path": "samples/v1/listAllAssets.js" + }, + { + "path": "samples/v1/listAllFindings.js" + }, + { + "path": "samples/v1/listAllSources.js" + }, + { + "path": "samples/v1/listAssetsAndChanges.js" + }, + { + "path": "samples/v1/listAssetsAtTime.js" + }, + { + "path": "samples/v1/listAssetsWithSecurityMarks.js" + }, + { + "path": "samples/v1/listFilteredAssets.js" + }, + { + "path": "samples/v1/listFilteredFindings.js" + }, + { + "path": "samples/v1/listFindingsAtTime.js" + }, + { + "path": "samples/v1/listFindingsWithSecurityMarks.js" + }, + { + "path": "samples/v1/setFindingState.js" + }, + { + "path": "samples/v1/setSourceIam.js" + }, + { + "path": "samples/v1/testIam.js" + }, + { + "path": "samples/v1/updateFindingSourceProperties.js" + }, + { + "path": "samples/v1/updateSource.js" + }, + { + "path": "src/browser.js" + }, + { + "path": "src/extra_proto_list.json" + }, + { + "path": "src/index.js" + }, + { + "path": "src/v1/doc/google/cloud/securitycenter/v1/doc_asset.js" + }, + { + "path": "src/v1/doc/google/cloud/securitycenter/v1/doc_finding.js" + }, + { + "path": "src/v1/doc/google/cloud/securitycenter/v1/doc_organization_settings.js" + }, + { + "path": "src/v1/doc/google/cloud/securitycenter/v1/doc_security_marks.js" + }, + { + "path": "src/v1/doc/google/cloud/securitycenter/v1/doc_securitycenter_service.js" + }, + { + "path": "src/v1/doc/google/cloud/securitycenter/v1/doc_source.js" + }, + { + "path": "src/v1/doc/google/iam/v1/doc_iam_policy.js" + }, + { + "path": "src/v1/doc/google/iam/v1/doc_options.js" + }, + { + "path": "src/v1/doc/google/iam/v1/doc_policy.js" + }, + { + "path": "src/v1/doc/google/longrunning/doc_operations.js" + }, + { + "path": "src/v1/doc/google/protobuf/doc_any.js" + }, + { + "path": "src/v1/doc/google/protobuf/doc_duration.js" + }, + { + "path": "src/v1/doc/google/protobuf/doc_field_mask.js" + }, + { + "path": "src/v1/doc/google/protobuf/doc_struct.js" + }, + { + "path": "src/v1/doc/google/protobuf/doc_timestamp.js" + }, + { + "path": "src/v1/doc/google/rpc/doc_status.js" + }, + { + "path": "src/v1/doc/google/type/doc_expr.js" + }, + { + "path": "src/v1/index.js" + }, + { + "path": "src/v1/security_center_client.js" + }, + { + "path": "src/v1/security_center_client_config.json" + }, + { + "path": "src/v1/security_center_proto_list.json" + }, + { + "path": "src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_asset.js" + }, + { + "path": "src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_finding.js" + }, + { + "path": "src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_organization_settings.js" + }, + { + "path": "src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_security_marks.js" + }, + { + "path": "src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_securitycenter_service.js" + }, + { + "path": "src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_source.js" + }, + { + "path": "src/v1beta1/doc/google/iam/v1/doc_iam_policy.js" + }, + { + "path": "src/v1beta1/doc/google/iam/v1/doc_options.js" + }, + { + "path": "src/v1beta1/doc/google/iam/v1/doc_policy.js" + }, + { + "path": "src/v1beta1/doc/google/longrunning/doc_operations.js" + }, + { + "path": "src/v1beta1/doc/google/protobuf/doc_any.js" + }, + { + "path": "src/v1beta1/doc/google/protobuf/doc_duration.js" + }, + { + "path": "src/v1beta1/doc/google/protobuf/doc_field_mask.js" + }, + { + "path": "src/v1beta1/doc/google/protobuf/doc_struct.js" + }, + { + "path": "src/v1beta1/doc/google/protobuf/doc_timestamp.js" + }, + { + "path": "src/v1beta1/doc/google/rpc/doc_status.js" + }, + { + "path": "src/v1beta1/doc/google/type/doc_expr.js" + }, + { + "path": "src/v1beta1/index.js" + }, + { + "path": "src/v1beta1/security_center_client.js" + }, + { + "path": "src/v1beta1/security_center_client_config.json" + }, + { + "path": "src/v1beta1/security_center_proto_list.json" + }, + { + "path": "synth.py" + }, + { + "path": "system-test/system.js" + }, + { + "path": "test/gapic-v1.js" + }, + { + "path": "test/mocha.opts" + }, + { + "path": "webpack.config.js" + } + ] +} \ No newline at end of file diff --git a/packages/google-cloud-securitycenter/test/gapic-v1.js b/packages/google-cloud-securitycenter/test/gapic-v1.js index e88e1a4e45e..ce442873775 100644 --- a/packages/google-cloud-securitycenter/test/gapic-v1.js +++ b/packages/google-cloud-securitycenter/test/gapic-v1.js @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC +// 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. diff --git a/packages/google-cloud-securitycenter/webpack.config.js b/packages/google-cloud-securitycenter/webpack.config.js index ca4a2ec15e6..287e48a6635 100644 --- a/packages/google-cloud-securitycenter/webpack.config.js +++ b/packages/google-cloud-securitycenter/webpack.config.js @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC +// 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. From 42a418cc9357f676a9ae7e337e88e835d717fa94 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Tue, 28 Jan 2020 14:39:06 -0800 Subject: [PATCH 129/342] fix: enum, bytes, and Long types now accept strings --- .../protos/protos.d.ts | 120 +++++++++--------- .../synth.metadata | 14 +- 2 files changed, 69 insertions(+), 65 deletions(-) diff --git a/packages/google-cloud-securitycenter/protos/protos.d.ts b/packages/google-cloud-securitycenter/protos/protos.d.ts index 7043090e680..38d3f59845e 100644 --- a/packages/google-cloud-securitycenter/protos/protos.d.ts +++ b/packages/google-cloud-securitycenter/protos/protos.d.ts @@ -39,7 +39,7 @@ export namespace google { resourceName?: (string|null); /** Finding state */ - state?: (google.cloud.securitycenter.v1.Finding.State|null); + state?: (google.cloud.securitycenter.v1.Finding.State|keyof typeof google.cloud.securitycenter.v1.Finding.State|null); /** Finding category */ category?: (string|null); @@ -79,7 +79,7 @@ export namespace google { public resourceName: string; /** Finding state. */ - public state: google.cloud.securitycenter.v1.Finding.State; + public state: (google.cloud.securitycenter.v1.Finding.State|keyof typeof google.cloud.securitycenter.v1.Finding.State); /** Finding category. */ public category: string; @@ -733,7 +733,7 @@ export namespace google { interface IRunAssetDiscoveryResponse { /** RunAssetDiscoveryResponse state */ - state?: (google.cloud.securitycenter.v1.RunAssetDiscoveryResponse.State|null); + state?: (google.cloud.securitycenter.v1.RunAssetDiscoveryResponse.State|keyof typeof google.cloud.securitycenter.v1.RunAssetDiscoveryResponse.State|null); /** RunAssetDiscoveryResponse duration */ duration?: (google.protobuf.IDuration|null); @@ -749,7 +749,7 @@ export namespace google { constructor(properties?: google.cloud.securitycenter.v1.IRunAssetDiscoveryResponse); /** RunAssetDiscoveryResponse state. */ - public state: google.cloud.securitycenter.v1.RunAssetDiscoveryResponse.State; + public state: (google.cloud.securitycenter.v1.RunAssetDiscoveryResponse.State|keyof typeof google.cloud.securitycenter.v1.RunAssetDiscoveryResponse.State); /** RunAssetDiscoveryResponse duration. */ public duration?: (google.protobuf.IDuration|null); @@ -947,7 +947,7 @@ export namespace google { projectIds?: (string[]|null); /** AssetDiscoveryConfig inclusionMode */ - inclusionMode?: (google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode|null); + inclusionMode?: (google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode|keyof typeof google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode|null); } /** Represents an AssetDiscoveryConfig. */ @@ -963,7 +963,7 @@ export namespace google { public projectIds: string[]; /** AssetDiscoveryConfig inclusionMode. */ - public inclusionMode: google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode; + public inclusionMode: (google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode|keyof typeof google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode); /** * Creates a new AssetDiscoveryConfig instance using the specified properties. @@ -2302,7 +2302,7 @@ export namespace google { properties?: ({ [k: string]: google.protobuf.IValue }|null); /** GroupResult count */ - count?: (number|Long|null); + count?: (number|Long|string|null); } /** Represents a GroupResult. */ @@ -2318,7 +2318,7 @@ export namespace google { public properties: { [k: string]: google.protobuf.IValue }; /** GroupResult count. */ - public count: (number|Long); + public count: (number|Long|string); /** * Creates a new GroupResult instance using the specified properties. @@ -2838,7 +2838,7 @@ export namespace google { asset?: (google.cloud.securitycenter.v1.IAsset|null); /** ListAssetsResult stateChange */ - stateChange?: (google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult.StateChange|null); + stateChange?: (google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult.StateChange|keyof typeof google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult.StateChange|null); } /** Represents a ListAssetsResult. */ @@ -2854,7 +2854,7 @@ export namespace google { public asset?: (google.cloud.securitycenter.v1.IAsset|null); /** ListAssetsResult stateChange. */ - public stateChange: google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult.StateChange; + public stateChange: (google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult.StateChange|keyof typeof google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult.StateChange); /** * Creates a new ListAssetsResult instance using the specified properties. @@ -3188,7 +3188,7 @@ export namespace google { finding?: (google.cloud.securitycenter.v1.IFinding|null); /** ListFindingsResult stateChange */ - stateChange?: (google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.StateChange|null); + stateChange?: (google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.StateChange|keyof typeof google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.StateChange|null); /** ListFindingsResult resource */ resource?: (google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.IResource|null); @@ -3207,7 +3207,7 @@ export namespace google { public finding?: (google.cloud.securitycenter.v1.IFinding|null); /** ListFindingsResult stateChange. */ - public stateChange: google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.StateChange; + public stateChange: (google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.StateChange|keyof typeof google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.StateChange); /** ListFindingsResult resource. */ public resource?: (google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.IResource|null); @@ -3417,7 +3417,7 @@ export namespace google { name?: (string|null); /** SetFindingStateRequest state */ - state?: (google.cloud.securitycenter.v1.Finding.State|null); + state?: (google.cloud.securitycenter.v1.Finding.State|keyof typeof google.cloud.securitycenter.v1.Finding.State|null); /** SetFindingStateRequest startTime */ startTime?: (google.protobuf.ITimestamp|null); @@ -3436,7 +3436,7 @@ export namespace google { public name: string; /** SetFindingStateRequest state. */ - public state: google.cloud.securitycenter.v1.Finding.State; + public state: (google.cloud.securitycenter.v1.Finding.State|keyof typeof google.cloud.securitycenter.v1.Finding.State); /** SetFindingStateRequest startTime. */ public startTime?: (google.protobuf.ITimestamp|null); @@ -4009,7 +4009,7 @@ export namespace google { resourceName?: (string|null); /** Finding state */ - state?: (google.cloud.securitycenter.v1beta1.Finding.State|null); + state?: (google.cloud.securitycenter.v1beta1.Finding.State|keyof typeof google.cloud.securitycenter.v1beta1.Finding.State|null); /** Finding category */ category?: (string|null); @@ -4049,7 +4049,7 @@ export namespace google { public resourceName: string; /** Finding state. */ - public state: google.cloud.securitycenter.v1beta1.Finding.State; + public state: (google.cloud.securitycenter.v1beta1.Finding.State|keyof typeof google.cloud.securitycenter.v1beta1.Finding.State); /** Finding category. */ public category: string; @@ -4589,7 +4589,7 @@ export namespace google { interface IRunAssetDiscoveryResponse { /** RunAssetDiscoveryResponse state */ - state?: (google.cloud.securitycenter.v1beta1.RunAssetDiscoveryResponse.State|null); + state?: (google.cloud.securitycenter.v1beta1.RunAssetDiscoveryResponse.State|keyof typeof google.cloud.securitycenter.v1beta1.RunAssetDiscoveryResponse.State|null); /** RunAssetDiscoveryResponse duration */ duration?: (google.protobuf.IDuration|null); @@ -4605,7 +4605,7 @@ export namespace google { constructor(properties?: google.cloud.securitycenter.v1beta1.IRunAssetDiscoveryResponse); /** RunAssetDiscoveryResponse state. */ - public state: google.cloud.securitycenter.v1beta1.RunAssetDiscoveryResponse.State; + public state: (google.cloud.securitycenter.v1beta1.RunAssetDiscoveryResponse.State|keyof typeof google.cloud.securitycenter.v1beta1.RunAssetDiscoveryResponse.State); /** RunAssetDiscoveryResponse duration. */ public duration?: (google.protobuf.IDuration|null); @@ -4803,7 +4803,7 @@ export namespace google { projectIds?: (string[]|null); /** AssetDiscoveryConfig inclusionMode */ - inclusionMode?: (google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode|null); + inclusionMode?: (google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode|keyof typeof google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode|null); } /** Represents an AssetDiscoveryConfig. */ @@ -4819,7 +4819,7 @@ export namespace google { public projectIds: string[]; /** AssetDiscoveryConfig inclusionMode. */ - public inclusionMode: google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode; + public inclusionMode: (google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode|keyof typeof google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode); /** * Creates a new AssetDiscoveryConfig instance using the specified properties. @@ -6140,7 +6140,7 @@ export namespace google { properties?: ({ [k: string]: google.protobuf.IValue }|null); /** GroupResult count */ - count?: (number|Long|null); + count?: (number|Long|string|null); } /** Represents a GroupResult. */ @@ -6156,7 +6156,7 @@ export namespace google { public properties: { [k: string]: google.protobuf.IValue }; /** GroupResult count. */ - public count: (number|Long); + public count: (number|Long|string); /** * Creates a new GroupResult instance using the specified properties. @@ -6676,7 +6676,7 @@ export namespace google { asset?: (google.cloud.securitycenter.v1beta1.IAsset|null); /** ListAssetsResult state */ - state?: (google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult.State|null); + state?: (google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult.State|keyof typeof google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult.State|null); } /** Represents a ListAssetsResult. */ @@ -6692,7 +6692,7 @@ export namespace google { public asset?: (google.cloud.securitycenter.v1beta1.IAsset|null); /** ListAssetsResult state. */ - public state: google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult.State; + public state: (google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult.State|keyof typeof google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult.State); /** * Creates a new ListAssetsResult instance using the specified properties. @@ -7019,7 +7019,7 @@ export namespace google { name?: (string|null); /** SetFindingStateRequest state */ - state?: (google.cloud.securitycenter.v1beta1.Finding.State|null); + state?: (google.cloud.securitycenter.v1beta1.Finding.State|keyof typeof google.cloud.securitycenter.v1beta1.Finding.State|null); /** SetFindingStateRequest startTime */ startTime?: (google.protobuf.ITimestamp|null); @@ -7038,7 +7038,7 @@ export namespace google { public name: string; /** SetFindingStateRequest state. */ - public state: google.cloud.securitycenter.v1beta1.Finding.State; + public state: (google.cloud.securitycenter.v1beta1.Finding.State|keyof typeof google.cloud.securitycenter.v1beta1.Finding.State); /** SetFindingStateRequest startTime. */ public startTime?: (google.protobuf.ITimestamp|null); @@ -7623,7 +7623,7 @@ export namespace google { nameField?: (string|null); /** ResourceDescriptor history */ - history?: (google.api.ResourceDescriptor.History|null); + history?: (google.api.ResourceDescriptor.History|keyof typeof google.api.ResourceDescriptor.History|null); /** ResourceDescriptor plural */ plural?: (string|null); @@ -7651,7 +7651,7 @@ export namespace google { public nameField: string; /** ResourceDescriptor history. */ - public history: google.api.ResourceDescriptor.History; + public history: (google.api.ResourceDescriptor.History|keyof typeof google.api.ResourceDescriptor.History); /** ResourceDescriptor plural. */ public plural: string; @@ -8870,10 +8870,10 @@ export namespace google { number?: (number|null); /** FieldDescriptorProto label */ - label?: (google.protobuf.FieldDescriptorProto.Label|null); + label?: (google.protobuf.FieldDescriptorProto.Label|keyof typeof google.protobuf.FieldDescriptorProto.Label|null); /** FieldDescriptorProto type */ - type?: (google.protobuf.FieldDescriptorProto.Type|null); + type?: (google.protobuf.FieldDescriptorProto.Type|keyof typeof google.protobuf.FieldDescriptorProto.Type|null); /** FieldDescriptorProto typeName */ typeName?: (string|null); @@ -8910,10 +8910,10 @@ export namespace google { public number: number; /** FieldDescriptorProto label. */ - public label: google.protobuf.FieldDescriptorProto.Label; + public label: (google.protobuf.FieldDescriptorProto.Label|keyof typeof google.protobuf.FieldDescriptorProto.Label); /** FieldDescriptorProto type. */ - public type: google.protobuf.FieldDescriptorProto.Type; + public type: (google.protobuf.FieldDescriptorProto.Type|keyof typeof google.protobuf.FieldDescriptorProto.Type); /** FieldDescriptorProto typeName. */ public typeName: string; @@ -9688,7 +9688,7 @@ export namespace google { javaStringCheckUtf8?: (boolean|null); /** FileOptions optimizeFor */ - optimizeFor?: (google.protobuf.FileOptions.OptimizeMode|null); + optimizeFor?: (google.protobuf.FileOptions.OptimizeMode|keyof typeof google.protobuf.FileOptions.OptimizeMode|null); /** FileOptions goPackage */ goPackage?: (string|null); @@ -9764,7 +9764,7 @@ export namespace google { public javaStringCheckUtf8: boolean; /** FileOptions optimizeFor. */ - public optimizeFor: google.protobuf.FileOptions.OptimizeMode; + public optimizeFor: (google.protobuf.FileOptions.OptimizeMode|keyof typeof google.protobuf.FileOptions.OptimizeMode); /** FileOptions goPackage. */ public goPackage: string; @@ -10013,13 +10013,13 @@ export namespace google { interface IFieldOptions { /** FieldOptions ctype */ - ctype?: (google.protobuf.FieldOptions.CType|null); + ctype?: (google.protobuf.FieldOptions.CType|keyof typeof google.protobuf.FieldOptions.CType|null); /** FieldOptions packed */ packed?: (boolean|null); /** FieldOptions jstype */ - jstype?: (google.protobuf.FieldOptions.JSType|null); + jstype?: (google.protobuf.FieldOptions.JSType|keyof typeof google.protobuf.FieldOptions.JSType|null); /** FieldOptions lazy */ lazy?: (boolean|null); @@ -10050,13 +10050,13 @@ export namespace google { constructor(properties?: google.protobuf.IFieldOptions); /** FieldOptions ctype. */ - public ctype: google.protobuf.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; + public jstype: (google.protobuf.FieldOptions.JSType|keyof typeof google.protobuf.FieldOptions.JSType); /** FieldOptions lazy. */ public lazy: boolean; @@ -10555,7 +10555,7 @@ export namespace google { deprecated?: (boolean|null); /** MethodOptions idempotencyLevel */ - idempotencyLevel?: (google.protobuf.MethodOptions.IdempotencyLevel|null); + idempotencyLevel?: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel|null); /** MethodOptions uninterpretedOption */ uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); @@ -10583,7 +10583,7 @@ export namespace google { public deprecated: boolean; /** MethodOptions idempotencyLevel. */ - public idempotencyLevel: google.protobuf.MethodOptions.IdempotencyLevel; + public idempotencyLevel: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel); /** MethodOptions uninterpretedOption. */ public uninterpretedOption: google.protobuf.IUninterpretedOption[]; @@ -10679,16 +10679,16 @@ export namespace google { identifierValue?: (string|null); /** UninterpretedOption positiveIntValue */ - positiveIntValue?: (number|Long|null); + positiveIntValue?: (number|Long|string|null); /** UninterpretedOption negativeIntValue */ - negativeIntValue?: (number|Long|null); + negativeIntValue?: (number|Long|string|null); /** UninterpretedOption doubleValue */ doubleValue?: (number|null); /** UninterpretedOption stringValue */ - stringValue?: (Uint8Array|null); + stringValue?: (Uint8Array|string|null); /** UninterpretedOption aggregateValue */ aggregateValue?: (string|null); @@ -10710,16 +10710,16 @@ export namespace google { public identifierValue: string; /** UninterpretedOption positiveIntValue. */ - public positiveIntValue: (number|Long); + public positiveIntValue: (number|Long|string); /** UninterpretedOption negativeIntValue. */ - public negativeIntValue: (number|Long); + public negativeIntValue: (number|Long|string); /** UninterpretedOption doubleValue. */ public doubleValue: number; /** UninterpretedOption stringValue. */ - public stringValue: Uint8Array; + public stringValue: (Uint8Array|string); /** UninterpretedOption aggregateValue. */ public aggregateValue: string; @@ -11396,7 +11396,7 @@ export namespace google { interface IValue { /** Value nullValue */ - nullValue?: (google.protobuf.NullValue|null); + nullValue?: (google.protobuf.NullValue|keyof typeof google.protobuf.NullValue|null); /** Value numberValue */ numberValue?: (number|null); @@ -11424,7 +11424,7 @@ export namespace google { constructor(properties?: google.protobuf.IValue); /** Value nullValue. */ - public nullValue: google.protobuf.NullValue; + public nullValue: (google.protobuf.NullValue|keyof typeof google.protobuf.NullValue); /** Value numberValue. */ public numberValue: number; @@ -11614,7 +11614,7 @@ export namespace google { interface ITimestamp { /** Timestamp seconds */ - seconds?: (number|Long|null); + seconds?: (number|Long|string|null); /** Timestamp nanos */ nanos?: (number|null); @@ -11630,7 +11630,7 @@ export namespace google { constructor(properties?: google.protobuf.ITimestamp); /** Timestamp seconds. */ - public seconds: (number|Long); + public seconds: (number|Long|string); /** Timestamp nanos. */ public nanos: number; @@ -11710,7 +11710,7 @@ export namespace google { interface IDuration { /** Duration seconds */ - seconds?: (number|Long|null); + seconds?: (number|Long|string|null); /** Duration nanos */ nanos?: (number|null); @@ -11726,7 +11726,7 @@ export namespace google { constructor(properties?: google.protobuf.IDuration); /** Duration seconds. */ - public seconds: (number|Long); + public seconds: (number|Long|string); /** Duration nanos. */ public nanos: number; @@ -11809,7 +11809,7 @@ export namespace google { type_url?: (string|null); /** Any value */ - value?: (Uint8Array|null); + value?: (Uint8Array|string|null); } /** Represents an Any. */ @@ -11825,7 +11825,7 @@ export namespace google { public type_url: string; /** Any value. */ - public value: Uint8Array; + public value: (Uint8Array|string); /** * Creates a new Any instance using the specified properties. @@ -12644,7 +12644,7 @@ export namespace google { bindings?: (google.iam.v1.IBinding[]|null); /** Policy etag */ - etag?: (Uint8Array|null); + etag?: (Uint8Array|string|null); } /** Represents a Policy. */ @@ -12663,7 +12663,7 @@ export namespace google { public bindings: google.iam.v1.IBinding[]; /** Policy etag. */ - public etag: Uint8Array; + public etag: (Uint8Array|string); /** * Creates a new Policy instance using the specified properties. @@ -12938,7 +12938,7 @@ export namespace google { interface IBindingDelta { /** BindingDelta action */ - action?: (google.iam.v1.BindingDelta.Action|null); + action?: (google.iam.v1.BindingDelta.Action|keyof typeof google.iam.v1.BindingDelta.Action|null); /** BindingDelta role */ role?: (string|null); @@ -12960,7 +12960,7 @@ export namespace google { constructor(properties?: google.iam.v1.IBindingDelta); /** BindingDelta action. */ - public action: google.iam.v1.BindingDelta.Action; + public action: (google.iam.v1.BindingDelta.Action|keyof typeof google.iam.v1.BindingDelta.Action); /** BindingDelta role. */ public role: string; @@ -13056,7 +13056,7 @@ export namespace google { interface IAuditConfigDelta { /** AuditConfigDelta action */ - action?: (google.iam.v1.AuditConfigDelta.Action|null); + action?: (google.iam.v1.AuditConfigDelta.Action|keyof typeof google.iam.v1.AuditConfigDelta.Action|null); /** AuditConfigDelta service */ service?: (string|null); @@ -13078,7 +13078,7 @@ export namespace google { constructor(properties?: google.iam.v1.IAuditConfigDelta); /** AuditConfigDelta action. */ - public action: google.iam.v1.AuditConfigDelta.Action; + public action: (google.iam.v1.AuditConfigDelta.Action|keyof typeof google.iam.v1.AuditConfigDelta.Action); /** AuditConfigDelta service. */ public service: string; diff --git a/packages/google-cloud-securitycenter/synth.metadata b/packages/google-cloud-securitycenter/synth.metadata index 3e2ffd3f739..14d21c73ad6 100644 --- a/packages/google-cloud-securitycenter/synth.metadata +++ b/packages/google-cloud-securitycenter/synth.metadata @@ -1,19 +1,20 @@ { - "updateTime": "2020-01-24T12:33:32.193979Z", + "updateTime": "2020-01-28T12:33:45.801692Z", "sources": [ { "generator": { "name": "artman", - "version": "0.44.1", - "dockerImage": "googleapis/artman@sha256:5599b61e56a372d21b671969ee915fbca0f6c3a0daaeb898d01f8f685f1bbc8b" + "version": "0.44.3", + "dockerImage": "googleapis/artman@sha256:62b8b29acaae54b06a4183aa772e65b106e92d4bc466eb4db07953ab78bdb90c" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "e26cab8afd19d396b929039dac5d874cf0b5336c", - "internalRef": "291240093" + "sha": "8e981acfd9b97ea2f312f11bbaa7b6c16e412dea", + "internalRef": "291821782", + "log": "8e981acfd9b97ea2f312f11bbaa7b6c16e412dea\nBeta launch for PersonDetection and FaceDetection features.\n\nPiperOrigin-RevId: 291821782\n\n994e067fae3b21e195f7da932b08fff806d70b5d\nasset: add annotations to v1p2beta1\n\nPiperOrigin-RevId: 291815259\n\n244e1d2c89346ca2e0701b39e65552330d68545a\nAdd Playable Locations service\n\nPiperOrigin-RevId: 291806349\n\n909f8f67963daf45dd88d020877fb9029b76788d\nasset: add annotations to v1beta2\n\nPiperOrigin-RevId: 291805301\n\n3c39a1d6e23c1ef63c7fba4019c25e76c40dfe19\nKMS: add file-level message for CryptoKeyPath, it is defined in gapic yaml but not\nin proto files.\n\nPiperOrigin-RevId: 291420695\n\nc6f3f350b8387f8d1b85ed4506f30187ebaaddc3\ncontaineranalysis: update v1beta1 and bazel build with annotations\n\nPiperOrigin-RevId: 291401900\n\n92887d74b44e4e636252b7b8477d0d2570cd82db\nfix: fix the location of grpc config file.\n\nPiperOrigin-RevId: 291396015\n\n" } }, { @@ -527,6 +528,9 @@ { "path": "src/v1beta1/security_center_proto_list.json" }, + { + "path": "synth.metadata" + }, { "path": "synth.py" }, From 26a2b07e3e7dc53984b418b6ad9ed8b2245c1365 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 29 Jan 2020 21:04:40 -0800 Subject: [PATCH 130/342] chore: release 2.3.2 (#200) * updated CHANGELOG.md [ci skip] * updated package.json [ci skip] * updated samples/package.json [ci skip] --- packages/google-cloud-securitycenter/CHANGELOG.md | 7 +++++++ packages/google-cloud-securitycenter/package.json | 2 +- packages/google-cloud-securitycenter/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-securitycenter/CHANGELOG.md b/packages/google-cloud-securitycenter/CHANGELOG.md index 9dcd93f998d..c46c18930b4 100644 --- a/packages/google-cloud-securitycenter/CHANGELOG.md +++ b/packages/google-cloud-securitycenter/CHANGELOG.md @@ -4,6 +4,13 @@ [1]: https://www.npmjs.com/package/@google-cloud/security-center?activeTab=versions +### [2.3.2](https://www.github.com/googleapis/nodejs-security-center/compare/v2.3.1...v2.3.2) (2020-01-28) + + +### Bug Fixes + +* enum, bytes, and Long types now accept strings ([be83dd6](https://www.github.com/googleapis/nodejs-security-center/commit/be83dd689fa51bd1dd0acce63a144e195a1b7688)) + ### [2.3.1](https://www.github.com/googleapis/nodejs-security-center/compare/v2.3.0...v2.3.1) (2020-01-05) diff --git a/packages/google-cloud-securitycenter/package.json b/packages/google-cloud-securitycenter/package.json index 31b827ec06e..5e11ca5a863 100644 --- a/packages/google-cloud-securitycenter/package.json +++ b/packages/google-cloud-securitycenter/package.json @@ -1,7 +1,7 @@ { "name": "@google-cloud/security-center", "description": "Cloud Security Command Center API client for Node.js", - "version": "2.3.1", + "version": "2.3.2", "license": "Apache-2.0", "author": "Google LLC", "engines": { diff --git a/packages/google-cloud-securitycenter/samples/package.json b/packages/google-cloud-securitycenter/samples/package.json index 773b9bd3637..7229bf7087d 100644 --- a/packages/google-cloud-securitycenter/samples/package.json +++ b/packages/google-cloud-securitycenter/samples/package.json @@ -13,7 +13,7 @@ }, "license": "Apache-2.0", "dependencies": { - "@google-cloud/security-center": "^2.3.1" + "@google-cloud/security-center": "^2.3.2" }, "devDependencies": { "chai": "^4.2.0", From faccb5c688c9f9bb990705063ceb397b2b15d9ee Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Fri, 31 Jan 2020 17:22:51 -0800 Subject: [PATCH 131/342] chore: skip img.shields.io in docs test --- packages/google-cloud-securitycenter/linkinator.config.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/google-cloud-securitycenter/linkinator.config.json b/packages/google-cloud-securitycenter/linkinator.config.json index d780d6bfff5..b555215ca02 100644 --- a/packages/google-cloud-securitycenter/linkinator.config.json +++ b/packages/google-cloud-securitycenter/linkinator.config.json @@ -2,6 +2,7 @@ "recurse": true, "skip": [ "https://codecov.io/gh/googleapis/", - "www.googleapis.com" + "www.googleapis.com", + "img.shields.io" ] } From 7a7faa1e154777ffa3892d215bbd8118aafb00b9 Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Fri, 31 Jan 2020 18:48:24 -0800 Subject: [PATCH 132/342] test: modernize mocha config (#202) --- packages/google-cloud-securitycenter/.mocharc.json | 5 +++++ packages/google-cloud-securitycenter/package.json | 2 -- packages/google-cloud-securitycenter/test/mocha.opts | 3 --- 3 files changed, 5 insertions(+), 5 deletions(-) create mode 100644 packages/google-cloud-securitycenter/.mocharc.json delete mode 100644 packages/google-cloud-securitycenter/test/mocha.opts diff --git a/packages/google-cloud-securitycenter/.mocharc.json b/packages/google-cloud-securitycenter/.mocharc.json new file mode 100644 index 00000000000..670c5e2c24b --- /dev/null +++ b/packages/google-cloud-securitycenter/.mocharc.json @@ -0,0 +1,5 @@ +{ + "enable-source-maps": true, + "throw-deprecation": true, + "timeout": 10000 +} diff --git a/packages/google-cloud-securitycenter/package.json b/packages/google-cloud-securitycenter/package.json index 5e11ca5a863..cb40da2f9e8 100644 --- a/packages/google-cloud-securitycenter/package.json +++ b/packages/google-cloud-securitycenter/package.json @@ -46,14 +46,12 @@ "eslint-config-prettier": "^6.0.0", "eslint-plugin-node": "^11.0.0", "eslint-plugin-prettier": "^3.0.0", - "intelli-espower-loader": "^1.0.1", "jsdoc": "^3.6.2", "jsdoc-fresh": "^1.0.1", "jsdoc-region-tag": "^1.0.2", "linkinator": "^1.5.0", "mocha": "^7.0.0", "c8": "^7.0.0", - "power-assert": "^1.4.4", "prettier": "^1.7.4" } } diff --git a/packages/google-cloud-securitycenter/test/mocha.opts b/packages/google-cloud-securitycenter/test/mocha.opts deleted file mode 100644 index 8751e7bae37..00000000000 --- a/packages/google-cloud-securitycenter/test/mocha.opts +++ /dev/null @@ -1,3 +0,0 @@ ---require intelli-espower-loader ---timeout 10000 ---throw-deprecation From 3a7c31c6eb5721e7976e4995cb1d8570580ad669 Mon Sep 17 00:00:00 2001 From: "Benjamin E. Coe" Date: Wed, 5 Feb 2020 10:53:02 -0800 Subject: [PATCH 133/342] feat!: convert library to TypeScript, adding v1p1beta1 import (#198) --- .../google-cloud-securitycenter/.gitignore | 4 +- .../google-cloud-securitycenter/.jsdoc.js | 2 +- .../google-cloud-securitycenter/package.json | 47 +- .../google/cloud/common_resources.proto | 52 + .../securitycenter/v1p1beta1/asset.proto | 119 + .../securitycenter/v1p1beta1/finding.proto | 111 + .../v1p1beta1/notification_config.proto | 112 + .../v1p1beta1/notification_message.proto | 42 + .../v1p1beta1/organization_settings.proto | 83 + .../run_asset_discovery_response.proto | 53 + .../v1p1beta1/security_marks.proto | 57 + .../v1p1beta1/securitycenter_service.proto | 1277 + .../securitycenter/v1p1beta1/source.proto | 60 + .../protos/protos.d.ts | 6436 ++- .../protos/protos.js | 32597 +++++++++++----- .../protos/protos.json | 1838 +- .../src/extra_proto_list.json | 14 - .../google-cloud-securitycenter/src/index.js | 104 - .../google-cloud-securitycenter/src/index.ts | 29 + .../cloud/securitycenter/v1/doc_asset.js | 133 - .../cloud/securitycenter/v1/doc_finding.js | 119 - .../v1/doc_organization_settings.js | 98 - .../securitycenter/v1/doc_security_marks.js | 47 - .../v1/doc_securitycenter_service.js | 1122 - .../cloud/securitycenter/v1/doc_source.js | 52 - .../v1/doc/google/iam/v1/doc_iam_policy.js | 96 - .../src/v1/doc/google/iam/v1/doc_options.js | 37 - .../src/v1/doc/google/iam/v1/doc_policy.js | 167 - .../doc/google/longrunning/doc_operations.js | 63 - .../src/v1/doc/google/protobuf/doc_any.js | 137 - .../v1/doc/google/protobuf/doc_duration.js | 97 - .../v1/doc/google/protobuf/doc_field_mask.js | 228 - .../src/v1/doc/google/protobuf/doc_struct.js | 112 - .../v1/doc/google/protobuf/doc_timestamp.js | 117 - .../src/v1/doc/google/rpc/doc_status.js | 47 - .../src/v1/doc/google/type/doc_expr.js | 51 - .../system.js => src/v1/index.ts} | 14 +- ...er_client.js => security_center_client.ts} | 3959 +- .../src/v1/security_center_client_config.json | 46 +- .../src/v1/security_center_proto_list.json | 8 +- .../cloud/securitycenter/v1beta1/doc_asset.js | 99 - .../securitycenter/v1beta1/doc_finding.js | 118 - .../v1beta1/doc_organization_settings.js | 98 - .../v1beta1/doc_security_marks.js | 47 - .../v1beta1/doc_securitycenter_service.js | 819 - .../securitycenter/v1beta1/doc_source.js | 51 - .../doc/google/iam/v1/doc_iam_policy.js | 96 - .../v1beta1/doc/google/iam/v1/doc_options.js | 37 - .../v1beta1/doc/google/iam/v1/doc_policy.js | 167 - .../doc/google/longrunning/doc_operations.js | 63 - .../v1beta1/doc/google/protobuf/doc_any.js | 137 - .../doc/google/protobuf/doc_duration.js | 97 - .../doc/google/protobuf/doc_field_mask.js | 228 - .../v1beta1/doc/google/protobuf/doc_struct.js | 112 - .../doc/google/protobuf/doc_timestamp.js | 117 - .../src/v1beta1/doc/google/rpc/doc_status.js | 47 - .../src/v1beta1/doc/google/type/doc_expr.js | 51 - .../src/{browser.js => v1beta1/index.ts} | 14 +- .../src/v1beta1/security_center_client.js | 2748 -- .../src/v1beta1/security_center_client.ts | 2821 ++ .../security_center_client_config.json | 46 +- .../v1beta1/security_center_proto_list.json | 8 +- .../{v1beta1/index.js => v1p1beta1/index.ts} | 12 +- .../src/v1p1beta1/security_center_client.ts | 3825 ++ .../security_center_client_config.json | 141 + .../v1p1beta1/security_center_proto_list.json | 11 + .../synth.metadata | 529 +- packages/google-cloud-securitycenter/synth.py | 74 +- .../system-test/fixtures/sample/src/index.js | 26 + .../fixtures/sample/src/index.ts} | 14 +- .../system-test/install.ts | 51 + .../test/gapic-security_center-v1.ts | 1055 + .../test/gapic-security_center-v1beta1.ts | 1055 + .../test/gapic-security_center-v1p1beta1.ts | 1320 + .../test/gapic-v1.js | 1319 - .../google-cloud-securitycenter/tsconfig.json | 19 + .../google-cloud-securitycenter/tslint.json | 3 + .../webpack.config.js | 32 +- 78 files changed, 43917 insertions(+), 23377 deletions(-) create mode 100644 packages/google-cloud-securitycenter/protos/google/cloud/common_resources.proto create mode 100644 packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/asset.proto create mode 100644 packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/finding.proto create mode 100644 packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/notification_config.proto create mode 100644 packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/notification_message.proto create mode 100644 packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/organization_settings.proto create mode 100644 packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/run_asset_discovery_response.proto create mode 100644 packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/security_marks.proto create mode 100644 packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/securitycenter_service.proto create mode 100644 packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/source.proto delete mode 100644 packages/google-cloud-securitycenter/src/extra_proto_list.json delete mode 100644 packages/google-cloud-securitycenter/src/index.js create mode 100644 packages/google-cloud-securitycenter/src/index.ts delete mode 100644 packages/google-cloud-securitycenter/src/v1/doc/google/cloud/securitycenter/v1/doc_asset.js delete mode 100644 packages/google-cloud-securitycenter/src/v1/doc/google/cloud/securitycenter/v1/doc_finding.js delete mode 100644 packages/google-cloud-securitycenter/src/v1/doc/google/cloud/securitycenter/v1/doc_organization_settings.js delete mode 100644 packages/google-cloud-securitycenter/src/v1/doc/google/cloud/securitycenter/v1/doc_security_marks.js delete mode 100644 packages/google-cloud-securitycenter/src/v1/doc/google/cloud/securitycenter/v1/doc_securitycenter_service.js delete mode 100644 packages/google-cloud-securitycenter/src/v1/doc/google/cloud/securitycenter/v1/doc_source.js delete mode 100644 packages/google-cloud-securitycenter/src/v1/doc/google/iam/v1/doc_iam_policy.js delete mode 100644 packages/google-cloud-securitycenter/src/v1/doc/google/iam/v1/doc_options.js delete mode 100644 packages/google-cloud-securitycenter/src/v1/doc/google/iam/v1/doc_policy.js delete mode 100644 packages/google-cloud-securitycenter/src/v1/doc/google/longrunning/doc_operations.js delete mode 100644 packages/google-cloud-securitycenter/src/v1/doc/google/protobuf/doc_any.js delete mode 100644 packages/google-cloud-securitycenter/src/v1/doc/google/protobuf/doc_duration.js delete mode 100644 packages/google-cloud-securitycenter/src/v1/doc/google/protobuf/doc_field_mask.js delete mode 100644 packages/google-cloud-securitycenter/src/v1/doc/google/protobuf/doc_struct.js delete mode 100644 packages/google-cloud-securitycenter/src/v1/doc/google/protobuf/doc_timestamp.js delete mode 100644 packages/google-cloud-securitycenter/src/v1/doc/google/rpc/doc_status.js delete mode 100644 packages/google-cloud-securitycenter/src/v1/doc/google/type/doc_expr.js rename packages/google-cloud-securitycenter/{system-test/system.js => src/v1/index.ts} (69%) rename packages/google-cloud-securitycenter/src/v1/{security_center_client.js => security_center_client.ts} (55%) delete mode 100644 packages/google-cloud-securitycenter/src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_asset.js delete mode 100644 packages/google-cloud-securitycenter/src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_finding.js delete mode 100644 packages/google-cloud-securitycenter/src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_organization_settings.js delete mode 100644 packages/google-cloud-securitycenter/src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_security_marks.js delete mode 100644 packages/google-cloud-securitycenter/src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_securitycenter_service.js delete mode 100644 packages/google-cloud-securitycenter/src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_source.js delete mode 100644 packages/google-cloud-securitycenter/src/v1beta1/doc/google/iam/v1/doc_iam_policy.js delete mode 100644 packages/google-cloud-securitycenter/src/v1beta1/doc/google/iam/v1/doc_options.js delete mode 100644 packages/google-cloud-securitycenter/src/v1beta1/doc/google/iam/v1/doc_policy.js delete mode 100644 packages/google-cloud-securitycenter/src/v1beta1/doc/google/longrunning/doc_operations.js delete mode 100644 packages/google-cloud-securitycenter/src/v1beta1/doc/google/protobuf/doc_any.js delete mode 100644 packages/google-cloud-securitycenter/src/v1beta1/doc/google/protobuf/doc_duration.js delete mode 100644 packages/google-cloud-securitycenter/src/v1beta1/doc/google/protobuf/doc_field_mask.js delete mode 100644 packages/google-cloud-securitycenter/src/v1beta1/doc/google/protobuf/doc_struct.js delete mode 100644 packages/google-cloud-securitycenter/src/v1beta1/doc/google/protobuf/doc_timestamp.js delete mode 100644 packages/google-cloud-securitycenter/src/v1beta1/doc/google/rpc/doc_status.js delete mode 100644 packages/google-cloud-securitycenter/src/v1beta1/doc/google/type/doc_expr.js rename packages/google-cloud-securitycenter/src/{browser.js => v1beta1/index.ts} (65%) delete mode 100644 packages/google-cloud-securitycenter/src/v1beta1/security_center_client.js create mode 100644 packages/google-cloud-securitycenter/src/v1beta1/security_center_client.ts rename packages/google-cloud-securitycenter/src/{v1beta1/index.js => v1p1beta1/index.ts} (65%) create mode 100644 packages/google-cloud-securitycenter/src/v1p1beta1/security_center_client.ts create mode 100644 packages/google-cloud-securitycenter/src/v1p1beta1/security_center_client_config.json create mode 100644 packages/google-cloud-securitycenter/src/v1p1beta1/security_center_proto_list.json create mode 100644 packages/google-cloud-securitycenter/system-test/fixtures/sample/src/index.js rename packages/google-cloud-securitycenter/{src/v1/index.js => system-test/fixtures/sample/src/index.ts} (59%) create mode 100644 packages/google-cloud-securitycenter/system-test/install.ts create mode 100644 packages/google-cloud-securitycenter/test/gapic-security_center-v1.ts create mode 100644 packages/google-cloud-securitycenter/test/gapic-security_center-v1beta1.ts create mode 100644 packages/google-cloud-securitycenter/test/gapic-security_center-v1p1beta1.ts delete mode 100644 packages/google-cloud-securitycenter/test/gapic-v1.js create mode 100644 packages/google-cloud-securitycenter/tsconfig.json create mode 100644 packages/google-cloud-securitycenter/tslint.json diff --git a/packages/google-cloud-securitycenter/.gitignore b/packages/google-cloud-securitycenter/.gitignore index 97cdf45ca3b..5d32b23782f 100644 --- a/packages/google-cloud-securitycenter/.gitignore +++ b/packages/google-cloud-securitycenter/.gitignore @@ -1,12 +1,14 @@ **/*.log **/node_modules .coverage +coverage .nyc_output docs/ +out/ build/ system-test/secrets.js system-test/*key.json *.lock -**/package-lock.json .DS_Store +package-lock.json __pycache__ diff --git a/packages/google-cloud-securitycenter/.jsdoc.js b/packages/google-cloud-securitycenter/.jsdoc.js index b95989459a1..003c8f9fc11 100644 --- a/packages/google-cloud-securitycenter/.jsdoc.js +++ b/packages/google-cloud-securitycenter/.jsdoc.js @@ -31,7 +31,7 @@ module.exports = { source: { excludePattern: '(^|\\/|\\\\)[._]', include: [ - 'src' + 'build/src' ], includePattern: '\\.js$' }, diff --git a/packages/google-cloud-securitycenter/package.json b/packages/google-cloud-securitycenter/package.json index cb40da2f9e8..a5e7bff7dc7 100644 --- a/packages/google-cloud-securitycenter/package.json +++ b/packages/google-cloud-securitycenter/package.json @@ -8,11 +8,24 @@ "node": ">=8.10.0" }, "repository": "googleapis/nodejs-security-center", - "main": "src/index.js", "files": [ - "protos", - "src" + "build/src", + "build/protos" ], + "main": "build/src/index.js", + "scripts": { + "clean": "gts clean", + "compile": "tsc -p . && cp -r protos build/", + "docs": "jsdoc -c .jsdoc.js", + "docs-test": "linkinator docs", + "fix": "gts fix && eslint --fix '**/*.js'", + "lint": "gts check && eslint '**/*.js'", + "predocs-test": "npm run docs", + "prepare": "npm run compile", + "system-test": "c8 mocha build/system-test", + "test": "c8 mocha build/test", + "samples-test": "cd samples/ && npm link ../ && npm test && cd ../" + }, "keywords": [ "google apis client", "google api client", @@ -26,32 +39,30 @@ "Security Center", "Security Command Center API" ], - "scripts": { - "docs": "jsdoc -c .jsdoc.js", - "lint": "eslint '**/*.js'", - "samples-test": "cd samples/ && npm link ../ && npm test && cd ../", - "system-test": "mocha system-test/*.js --timeout 600000", - "test": "c8 mocha", - "fix": "eslint --fix '**/*.js'", - "docs-test": "linkinator docs", - "predocs-test": "npm run docs" - }, "dependencies": { - "google-gax": "^1.7.5", - "protobufjs": "^6.8.0" + "google-gax": "^1.14.1" }, "devDependencies": { - "codecov": "^3.0.0", + "@types/mocha": "^5.2.5", + "@types/node": "^12.0.0", + "c8": "^7.0.0", "eslint": "^6.0.0", "eslint-config-prettier": "^6.0.0", "eslint-plugin-node": "^11.0.0", "eslint-plugin-prettier": "^3.0.0", + "gts": "^1.1.2", "jsdoc": "^3.6.2", "jsdoc-fresh": "^1.0.1", "jsdoc-region-tag": "^1.0.2", "linkinator": "^1.5.0", "mocha": "^7.0.0", - "c8": "^7.0.0", - "prettier": "^1.7.4" + "null-loader": "^3.0.0", + "pack-n-play": "^1.0.0-2", + "power-assert": "^1.4.4", + "prettier": "^1.7.4", + "ts-loader": "^6.2.1", + "typescript": "~3.6.4", + "webpack": "^4.41.2", + "webpack-cli": "^3.3.10" } } diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/common_resources.proto b/packages/google-cloud-securitycenter/protos/google/cloud/common_resources.proto new file mode 100644 index 00000000000..56c9f800d5e --- /dev/null +++ b/packages/google-cloud-securitycenter/protos/google/cloud/common_resources.proto @@ -0,0 +1,52 @@ +// Copyright 2019 Google LLC. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// This file contains stub messages for common resources in GCP. +// It is not intended to be directly generated, and is instead used by +// other tooling to be able to match common resource patterns. +syntax = "proto3"; + +package google.cloud; + +import "google/api/resource.proto"; + + +option (google.api.resource_definition) = { + type: "cloudresourcemanager.googleapis.com/Project" + pattern: "projects/{project}" +}; + + +option (google.api.resource_definition) = { + type: "cloudresourcemanager.googleapis.com/Organization" + pattern: "organizations/{organization}" +}; + + +option (google.api.resource_definition) = { + type: "cloudresourcemanager.googleapis.com/Folder" + pattern: "folders/{folder}" +}; + + +option (google.api.resource_definition) = { + type: "cloudbilling.googleapis.com/BillingAccount" + pattern: "billingAccounts/{billing_account}" +}; + +option (google.api.resource_definition) = { + type: "locations.googleapis.com/Location" + pattern: "projects/{project}/locations/{location}" +}; + diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/asset.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/asset.proto new file mode 100644 index 00000000000..d06a82bafca --- /dev/null +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/asset.proto @@ -0,0 +1,119 @@ +// Copyright 2019 Google LLC. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +syntax = "proto3"; + +package google.cloud.securitycenter.v1p1beta1; + +import "google/api/annotations.proto"; +import "google/api/resource.proto"; +import "google/cloud/securitycenter/v1p1beta1/security_marks.proto"; +import "google/protobuf/struct.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V1P1Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1p1beta1;securitycenter"; +option java_multiple_files = true; +option java_package = "com.google.cloud.securitycenter.v1p1beta1"; +option php_namespace = "Google\\Cloud\\SecurityCenter\\V1p1beta1"; +option ruby_package = "Google::Cloud::SecurityCenter::V1p1Beta1"; + +// Cloud Security Command Center's (Cloud SCC) representation of a Google Cloud +// Platform (GCP) resource. +// +// The Asset is a Cloud SCC resource that captures information about a single +// GCP resource. All modifications to an Asset are only within the context of +// Cloud SCC and don't affect the referenced GCP resource. +message Asset { + option (google.api.resource) = { + type: "securitycenter.googleapis.com/Asset" + pattern: "organizations/{organization}/assets/{asset}" + }; + + // Cloud SCC managed properties. These properties are managed by Cloud SCC and + // cannot be modified by the user. + message SecurityCenterProperties { + // The full resource name of the GCP resource this asset + // represents. This field is immutable after create time. See: + // https://cloud.google.com/apis/design/resource_names#full_resource_name + string resource_name = 1; + + // The type of the GCP resource. Examples include: APPLICATION, + // PROJECT, and ORGANIZATION. This is a case insensitive field defined by + // Cloud SCC and/or the producer of the resource and is immutable + // after create time. + string resource_type = 2; + + // The full resource name of the immediate parent of the resource. See: + // https://cloud.google.com/apis/design/resource_names#full_resource_name + string resource_parent = 3; + + // The full resource name of the project the resource belongs to. See: + // https://cloud.google.com/apis/design/resource_names#full_resource_name + string resource_project = 4; + + // Owners of the Google Cloud resource. + repeated string resource_owners = 5; + + // The user defined display name for this resource. + string resource_display_name = 6; + + // The user defined display name for the parent of this resource. + string resource_parent_display_name = 7; + + // The user defined display name for the project of this resource. + string resource_project_display_name = 8; + } + + // IAM Policy information associated with the GCP resource described by the + // Cloud SCC asset. This information is managed and defined by the GCP + // resource and cannot be modified by the user. + message IamPolicy { + // The JSON representation of the Policy associated with the asset. + // See https://cloud.google.com/iam/reference/rest/v1p1beta1/Policy for + // format details. + string policy_blob = 1; + } + + // The relative resource name of this asset. See: + // https://cloud.google.com/apis/design/resource_names#relative_resource_name + // Example: + // "organizations/{organization_id}/assets/{asset_id}". + string name = 1; + + // Cloud SCC managed properties. These properties are managed by + // Cloud SCC and cannot be modified by the user. + SecurityCenterProperties security_center_properties = 2; + + // Resource managed properties. These properties are managed and defined by + // the GCP resource and cannot be modified by the user. + map resource_properties = 7; + + // User specified security marks. These marks are entirely managed by the user + // and come from the SecurityMarks resource that belongs to the asset. + SecurityMarks security_marks = 8; + + // The time at which the asset was created in Cloud SCC. + google.protobuf.Timestamp create_time = 9; + + // The time at which the asset was last updated, added, or deleted in Cloud + // SCC. + google.protobuf.Timestamp update_time = 10; + + // IAM Policy information associated with the GCP resource described by the + // Cloud SCC asset. This information is managed and defined by the GCP + // resource and cannot be modified by the user. + IamPolicy iam_policy = 11; +} diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/finding.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/finding.proto new file mode 100644 index 00000000000..abd77df7d11 --- /dev/null +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/finding.proto @@ -0,0 +1,111 @@ +// Copyright 2019 Google LLC. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +syntax = "proto3"; + +package google.cloud.securitycenter.v1p1beta1; + +import "google/api/annotations.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/securitycenter/v1p1beta1/security_marks.proto"; +import "google/protobuf/struct.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V1P1Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1p1beta1;securitycenter"; +option java_multiple_files = true; +option java_package = "com.google.cloud.securitycenter.v1p1beta1"; +option php_namespace = "Google\\Cloud\\SecurityCenter\\V1p1beta1"; +option ruby_package = "Google::Cloud::SecurityCenter::V1p1Beta1"; + +// Cloud Security Command Center (Cloud SCC) finding. +// +// A finding is a record of assessment data (security, risk, health or privacy) +// ingested into Cloud SCC for presentation, notification, analysis, +// policy testing, and enforcement. For example, an XSS vulnerability in an +// App Engine application is a finding. +message Finding { + option (google.api.resource) = { + type: "securitycenter.googleapis.com/Finding" + pattern: "organizations/{organization}/sources/{source}/findings/{finding}" + }; + + // The state of the finding. + enum State { + // Unspecified state. + STATE_UNSPECIFIED = 0; + + // The finding requires attention and has not been addressed yet. + ACTIVE = 1; + + // The finding has been fixed, triaged as a non-issue or otherwise addressed + // and is no longer active. + INACTIVE = 2; + } + + // The relative resource name of this finding. See: + // https://cloud.google.com/apis/design/resource_names#relative_resource_name + // Example: + // "organizations/{organization_id}/sources/{source_id}/findings/{finding_id}" + string name = 1; + + // The relative resource name of the source the finding belongs to. See: + // https://cloud.google.com/apis/design/resource_names#relative_resource_name + // This field is immutable after creation time. + // For example: + // "organizations/{organization_id}/sources/{source_id}" + string parent = 2; + + // For findings on Google Cloud Platform (GCP) resources, the full resource + // name of the GCP resource this finding is for. See: + // https://cloud.google.com/apis/design/resource_names#full_resource_name + // When the finding is for a non-GCP resource, the resourceName can be a + // customer or partner defined string. + // This field is immutable after creation time. + string resource_name = 3; + + // The state of the finding. + State state = 4; + + // The additional taxonomy group within findings from a given source. + // This field is immutable after creation time. + // Example: "XSS_FLASH_INJECTION" + string category = 5; + + // The URI that, if available, points to a web page outside of Cloud SCC + // where additional information about the finding can be found. This field is + // guaranteed to be either empty or a well formed URL. + string external_uri = 6; + + // Source specific properties. These properties are managed by the source + // that writes the finding. The key names in the source_properties map must be + // between 1 and 255 characters, and must start with a letter and contain + // alphanumeric characters or underscores only. + map source_properties = 7; + + // Output only. User specified security marks. These marks are entirely + // managed by the user and come from the SecurityMarks resource that belongs + // to the finding. + SecurityMarks security_marks = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The time at which the event took place. For example, if the finding + // represents an open firewall it would capture the time the detector believes + // the firewall became open. The accuracy is determined by the detector. + google.protobuf.Timestamp event_time = 9; + + // The time at which the finding was created in Cloud SCC. + google.protobuf.Timestamp create_time = 10; +} diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/notification_config.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/notification_config.proto new file mode 100644 index 00000000000..c114e52c83e --- /dev/null +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/notification_config.proto @@ -0,0 +1,112 @@ +// Copyright 2019 Google LLC. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +syntax = "proto3"; + +package google.cloud.securitycenter.v1p1beta1; + +import "google/api/annotations.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V1P1Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1p1beta1;securitycenter"; +option java_multiple_files = true; +option java_package = "com.google.cloud.securitycenter.v1p1beta1"; +option php_namespace = "Google\\Cloud\\SecurityCenter\\V1p1beta1"; +option ruby_package = "Google::Cloud::SecurityCenter::V1p1Beta1"; + +// The Pub/Sub Topic resource definition is in google/cloud/pubsub/v1/, +// but we do not import that proto directly; therefore, we redefine the +// pattern here. +option (google.api.resource_definition) = { + type: "pubsub.googleapis.com/Topic" + pattern: "projects/{project}/topics/{topic}" +}; + +// Cloud Security Command Center (Cloud SCC) notification configs. +// +// A notification config is a Cloud SCC resource that contains the configuration +// to send notifications for create/update events of findings, assets and etc. +message NotificationConfig { + option (google.api.resource) = { + type: "securitycenter.googleapis.com/NotificationConfig" + pattern: "organizations/{organization}/notificationConfigs/{notification_config}" + }; + + // The config for streaming-based notifications, which send each event as soon + // as it is detected. + message StreamingConfig { + // Expression that defines the filter to apply across create/update events + // of assets or findings as specified by the event type. The expression is a + // list of zero or more restrictions combined via logical operators `AND` + // and `OR`. Parentheses are supported, and `OR` has higher precedence than + // `AND`. + // + // Restrictions have the form ` ` and may have a + // `-` character in front of them to indicate negation. The fields map to + // those defined in the corresponding resource. + // + // The supported operators are: + // + // * `=` for all value types. + // * `>`, `<`, `>=`, `<=` for integer values. + // * `:`, meaning substring matching, for strings. + // + // The supported value types are: + // + // * string literals in quotes. + // * integer literals without quotes. + // * boolean literals `true` and `false` without quotes. + string filter = 1; + } + + // The type of events. + enum EventType { + // Unspecified event type. + EVENT_TYPE_UNSPECIFIED = 0; + + // Events for findings. + FINDING = 1; + } + + // The relative resource name of this notification config. See: + // https://cloud.google.com/apis/design/resource_names#relative_resource_name + // Example: + // "organizations/{organization_id}/notificationConfigs/notify_public_bucket". + string name = 1; + + // The description of the notification config (max of 1024 characters). + string description = 2; + + // The type of events the config is for, e.g. FINDING. + EventType event_type = 3; + + // The PubSub topic to send notifications to. Its format is + // "projects/[project_id]/topics/[topic]". + string pubsub_topic = 4 [ + (google.api.resource_reference) = { type: "pubsub.googleapis.com/Topic" } + ]; + + // Output only. The service account that needs "pubsub.topics.publish" + // permission to publish to the PubSub topic. + string service_account = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The config for triggering notifications. + oneof notify_config { + // The config for triggering streaming-based notifications. + StreamingConfig streaming_config = 6; + } +} diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/notification_message.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/notification_message.proto new file mode 100644 index 00000000000..ad0c50a270a --- /dev/null +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/notification_message.proto @@ -0,0 +1,42 @@ +// Copyright 2019 Google LLC. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +syntax = "proto3"; + +package google.cloud.securitycenter.v1p1beta1; + +import "google/api/annotations.proto"; +import "google/cloud/securitycenter/v1p1beta1/asset.proto"; +import "google/cloud/securitycenter/v1p1beta1/finding.proto"; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V1P1Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1p1beta1;securitycenter"; +option java_multiple_files = true; +option java_package = "com.google.cloud.securitycenter.v1p1beta1"; +option php_namespace = "Google\\Cloud\\SecurityCenter\\V1p1beta1"; +option ruby_package = "Google::Cloud::SecurityCenter::V1p1Beta1"; + +// Cloud SCC's Notification +message NotificationMessage { + // Name of the notification config that generated current notification. + string notification_config_name = 1; + + // Notification Event. + oneof event { + // If it's a Finding based notification config, this field will be + // populated. + Finding finding = 2; + } +} diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/organization_settings.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/organization_settings.proto new file mode 100644 index 00000000000..325f5f34313 --- /dev/null +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/organization_settings.proto @@ -0,0 +1,83 @@ +// Copyright 2019 Google LLC. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +syntax = "proto3"; + +package google.cloud.securitycenter.v1p1beta1; + +import "google/api/annotations.proto"; +import "google/api/resource.proto"; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V1P1Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1p1beta1;securitycenter"; +option java_multiple_files = true; +option java_package = "com.google.cloud.securitycenter.v1p1beta1"; +option php_namespace = "Google\\Cloud\\SecurityCenter\\V1p1beta1"; +option ruby_package = "Google::Cloud::SecurityCenter::V1p1Beta1"; + +// User specified settings that are attached to the Cloud Security Command +// Center (Cloud SCC) organization. +message OrganizationSettings { + option (google.api.resource) = { + type: "securitycenter.googleapis.com/OrganizationSettings" + pattern: "organizations/{organization}/organizationSettings" + }; + + // The configuration used for Asset Discovery runs. + message AssetDiscoveryConfig { + // The mode of inclusion when running Asset Discovery. + // Asset discovery can be limited by explicitly identifying projects to be + // included or excluded. If INCLUDE_ONLY is set, then only those projects + // within the organization and their children are discovered during asset + // discovery. If EXCLUDE is set, then projects that don't match those + // projects are discovered during asset discovery. If neither are set, then + // all projects within the organization are discovered during asset + // discovery. + enum InclusionMode { + // Unspecified. Setting the mode with this value will disable + // inclusion/exclusion filtering for Asset Discovery. + INCLUSION_MODE_UNSPECIFIED = 0; + + // Asset Discovery will capture only the resources within the projects + // specified. All other resources will be ignored. + INCLUDE_ONLY = 1; + + // Asset Discovery will ignore all resources under the projects specified. + // All other resources will be retrieved. + EXCLUDE = 2; + } + + // The project ids to use for filtering asset discovery. + repeated string project_ids = 1; + + // The mode to use for filtering asset discovery. + InclusionMode inclusion_mode = 2; + } + + // The relative resource name of the settings. See: + // https://cloud.google.com/apis/design/resource_names#relative_resource_name + // Example: + // "organizations/{organization_id}/organizationSettings". + string name = 1; + + // A flag that indicates if Asset Discovery should be enabled. If the flag is + // set to `true`, then discovery of assets will occur. If it is set to `false, + // all historical assets will remain, but discovery of future assets will not + // occur. + bool enable_asset_discovery = 2; + + // The configuration used for Asset Discovery runs. + AssetDiscoveryConfig asset_discovery_config = 3; +} diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/run_asset_discovery_response.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/run_asset_discovery_response.proto new file mode 100644 index 00000000000..beff3d5e75d --- /dev/null +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/run_asset_discovery_response.proto @@ -0,0 +1,53 @@ +// Copyright 2019 Google LLC. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +syntax = "proto3"; + +package google.cloud.securitycenter.v1p1beta1; + +import "google/api/annotations.proto"; +import "google/protobuf/duration.proto"; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V1P1Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1p1beta1;securitycenter"; +option java_multiple_files = true; +option java_package = "com.google.cloud.securitycenter.v1p1beta1"; +option php_namespace = "Google\\Cloud\\SecurityCenter\\V1p1beta1"; +option ruby_package = "Google::Cloud::SecurityCenter::V1p1Beta1"; + +// Response of asset discovery run +message RunAssetDiscoveryResponse { + // The state of an asset discovery run. + enum State { + // Asset discovery run state was unspecified. + STATE_UNSPECIFIED = 0; + + // Asset discovery run completed successfully. + COMPLETED = 1; + + // Asset discovery run was cancelled with tasks still pending, as another + // run for the same organization was started with a higher priority. + SUPERSEDED = 2; + + // Asset discovery run was killed and terminated. + TERMINATED = 3; + } + + // The state of an asset discovery run. + State state = 1; + + // The duration between asset discovery run start and end + google.protobuf.Duration duration = 2; +} diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/security_marks.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/security_marks.proto new file mode 100644 index 00000000000..c6a721704ca --- /dev/null +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/security_marks.proto @@ -0,0 +1,57 @@ +// Copyright 2019 Google LLC. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +syntax = "proto3"; + +package google.cloud.securitycenter.v1p1beta1; + +import "google/api/annotations.proto"; +import "google/api/resource.proto"; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V1P1Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1p1beta1;securitycenter"; +option java_multiple_files = true; +option java_package = "com.google.cloud.securitycenter.v1p1beta1"; +option php_namespace = "Google\\Cloud\\SecurityCenter\\V1p1beta1"; +option ruby_package = "Google::Cloud::SecurityCenter::V1p1Beta1"; + +// User specified security marks that are attached to the parent Cloud Security +// Command Center (Cloud SCC) resource. Security marks are scoped within a Cloud +// SCC organization -- they can be modified and viewed by all users who have +// proper permissions on the organization. +message SecurityMarks { + option (google.api.resource) = { + type: "securitycenter.googleapis.com/SecurityMarks" + pattern: "organizations/{organization}/assets/{asset}/securityMarks" + pattern: "organizations/{organization}/sources/{source}/findings/{finding}/securityMarks" + }; + + // The relative resource name of the SecurityMarks. See: + // https://cloud.google.com/apis/design/resource_names#relative_resource_name + // Examples: + // "organizations/{organization_id}/assets/{asset_id}/securityMarks" + // "organizations/{organization_id}/sources/{source_id}/findings/{finding_id}/securityMarks". + string name = 1; + + // Mutable user specified security marks belonging to the parent resource. + // Constraints are as follows: + // + // * Keys and values are treated as case insensitive + // * Keys must be between 1 - 256 characters (inclusive) + // * Keys must be letters, numbers, underscores, or dashes + // * Values have leading and trailing whitespace trimmed, remaining + // characters must be between 1 - 4096 characters (inclusive) + map marks = 2; +} diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/securitycenter_service.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/securitycenter_service.proto new file mode 100644 index 00000000000..728213e2919 --- /dev/null +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/securitycenter_service.proto @@ -0,0 +1,1277 @@ +// Copyright 2019 Google LLC. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +syntax = "proto3"; + +package google.cloud.securitycenter.v1p1beta1; + +import public "google/cloud/securitycenter/v1p1beta1/run_asset_discovery_response.proto"; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/securitycenter/v1p1beta1/asset.proto"; +import "google/cloud/securitycenter/v1p1beta1/finding.proto"; +import "google/cloud/securitycenter/v1p1beta1/notification_config.proto"; +import "google/cloud/securitycenter/v1p1beta1/organization_settings.proto"; +import "google/cloud/securitycenter/v1p1beta1/security_marks.proto"; +import "google/cloud/securitycenter/v1p1beta1/source.proto"; +import "google/iam/v1/iam_policy.proto"; +import "google/iam/v1/policy.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/struct.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V1P1Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1p1beta1;securitycenter"; +option java_multiple_files = true; +option java_package = "com.google.cloud.securitycenter.v1p1beta1"; +option php_namespace = "Google\\Cloud\\SecurityCenter\\V1p1beta1"; +option ruby_package = "Google::Cloud::SecurityCenter::V1p1Beta1"; + +// V1p1Beta1 APIs for Security Center service. +service SecurityCenter { + option (google.api.default_host) = "securitycenter.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Creates a source. + rpc CreateSource(CreateSourceRequest) returns (Source) { + option (google.api.http) = { + post: "/v1p1beta1/{parent=organizations/*}/sources" + body: "source" + }; + option (google.api.method_signature) = "parent,source"; + } + + // + // Creates a finding. The corresponding source must exist for finding + // creation to succeed. + rpc CreateFinding(CreateFindingRequest) returns (Finding) { + option (google.api.http) = { + post: "/v1p1beta1/{parent=organizations/*/sources/*}/findings" + body: "finding" + }; + option (google.api.method_signature) = "parent,finding_id,finding"; + option (google.api.method_signature) = "parent,finding,finding_id"; + } + + // Creates a notification config. + rpc CreateNotificationConfig(CreateNotificationConfigRequest) + returns (NotificationConfig) { + option (google.api.http) = { + post: "/v1p1beta1/{parent=organizations/*}/notificationConfigs" + body: "notification_config" + }; + option (google.api.method_signature) = + "parent,config_id,notification_config"; + option (google.api.method_signature) = "parent,notification_config"; + } + + // Deletes a notification config. + rpc DeleteNotificationConfig(DeleteNotificationConfigRequest) + returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1p1beta1/{name=organizations/*/notificationConfigs/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Gets the access control policy on the specified Source. + rpc GetIamPolicy(google.iam.v1.GetIamPolicyRequest) + returns (google.iam.v1.Policy) { + option (google.api.http) = { + post: "/v1p1beta1/{resource=organizations/*/sources/*}:getIamPolicy" + body: "*" + }; + option (google.api.method_signature) = "resource"; + } + + // Gets a notification config. + rpc GetNotificationConfig(GetNotificationConfigRequest) + returns (NotificationConfig) { + option (google.api.http) = { + get: "/v1p1beta1/{name=organizations/*/notificationConfigs/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Gets the settings for an organization. + rpc GetOrganizationSettings(GetOrganizationSettingsRequest) + returns (OrganizationSettings) { + option (google.api.http) = { + get: "/v1p1beta1/{name=organizations/*/organizationSettings}" + }; + option (google.api.method_signature) = "name"; + } + + // Gets a source. + rpc GetSource(GetSourceRequest) returns (Source) { + option (google.api.http) = { + get: "/v1p1beta1/{name=organizations/*/sources/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Filters an organization's assets and groups them by their specified + // properties. + rpc GroupAssets(GroupAssetsRequest) returns (GroupAssetsResponse) { + option (google.api.http) = { + post: "/v1p1beta1/{parent=organizations/*}/assets:group" + body: "*" + }; + } + + // Filters an organization or source's findings and groups them by their + // specified properties. + // + // To group across all sources provide a `-` as the source id. + // Example: /v1p1beta1/organizations/{organization_id}/sources/-/findings + rpc GroupFindings(GroupFindingsRequest) returns (GroupFindingsResponse) { + option (google.api.http) = { + post: "/v1p1beta1/{parent=organizations/*/sources/*}/findings:group" + body: "*" + }; + option (google.api.method_signature) = "parent,group_by"; + } + + // Lists an organization's assets. + rpc ListAssets(ListAssetsRequest) returns (ListAssetsResponse) { + option (google.api.http) = { + get: "/v1p1beta1/{parent=organizations/*}/assets" + }; + option (google.api.method_signature) = "parent"; + } + + // Lists an organization or source's findings. + // + // To list across all sources provide a `-` as the source id. + // Example: /v1p1beta1/organizations/{organization_id}/sources/-/findings + rpc ListFindings(ListFindingsRequest) returns (ListFindingsResponse) { + option (google.api.http) = { + get: "/v1p1beta1/{parent=organizations/*/sources/*}/findings" + }; + option (google.api.method_signature) = "parent"; + } + + // Lists notification configs. + rpc ListNotificationConfigs(ListNotificationConfigsRequest) + returns (ListNotificationConfigsResponse) { + option (google.api.http) = { + get: "/v1p1beta1/{parent=organizations/*}/notificationConfigs" + }; + option (google.api.method_signature) = "parent"; + } + + // Lists all sources belonging to an organization. + rpc ListSources(ListSourcesRequest) returns (ListSourcesResponse) { + option (google.api.http) = { + get: "/v1p1beta1/{parent=organizations/*}/sources" + }; + option (google.api.method_signature) = "parent"; + } + + // Runs asset discovery. The discovery is tracked with a long-running + // operation. + // + // This API can only be called with limited frequency for an organization. If + // it is called too frequently the caller will receive a TOO_MANY_REQUESTS + // error. + rpc RunAssetDiscovery(RunAssetDiscoveryRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1p1beta1/{parent=organizations/*}/assets:runDiscovery" + body: "*" + }; + option (google.api.method_signature) = "parent"; + option (google.longrunning.operation_info) = { + response_type: "google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse" + metadata_type: "google.protobuf.Empty" + }; + } + + // + // Updates the state of a finding. + rpc SetFindingState(SetFindingStateRequest) returns (Finding) { + option (google.api.http) = { + post: "/v1p1beta1/{name=organizations/*/sources/*/findings/*}:setState" + body: "*" + }; + option (google.api.method_signature) = "name,state,start_time"; + } + + // Sets the access control policy on the specified Source. + rpc SetIamPolicy(google.iam.v1.SetIamPolicyRequest) + returns (google.iam.v1.Policy) { + option (google.api.http) = { + post: "/v1p1beta1/{resource=organizations/*/sources/*}:setIamPolicy" + body: "*" + }; + option (google.api.method_signature) = "resource,policy"; + } + + // Returns the permissions that a caller has on the specified source. + rpc TestIamPermissions(google.iam.v1.TestIamPermissionsRequest) + returns (google.iam.v1.TestIamPermissionsResponse) { + option (google.api.http) = { + post: "/v1p1beta1/{resource=organizations/*/sources/*}:testIamPermissions" + body: "*" + }; + option (google.api.method_signature) = "resource,permissions"; + } + + // + // Creates or updates a finding. The corresponding source must exist for a + // finding creation to succeed. + rpc UpdateFinding(UpdateFindingRequest) returns (Finding) { + option (google.api.http) = { + patch: "/v1p1beta1/{finding.name=organizations/*/sources/*/findings/*}" + body: "finding" + }; + option (google.api.method_signature) = "finding"; + option (google.api.method_signature) = "finding,update_mask"; + } + + // Updates a notification config. + rpc UpdateNotificationConfig(UpdateNotificationConfigRequest) + returns (NotificationConfig) { + option (google.api.http) = { + patch: "/v1p1beta1/{notification_config.name=organizations/*/notificationConfigs/*}" + body: "notification_config" + }; + option (google.api.method_signature) = "notification_config"; + option (google.api.method_signature) = "notification_config,update_mask"; + } + + // Updates an organization's settings. + rpc UpdateOrganizationSettings(UpdateOrganizationSettingsRequest) + returns (OrganizationSettings) { + option (google.api.http) = { + patch: "/v1p1beta1/{organization_settings.name=organizations/*/organizationSettings}" + body: "organization_settings" + }; + option (google.api.method_signature) = "organization_settings"; + } + + // Updates a source. + rpc UpdateSource(UpdateSourceRequest) returns (Source) { + option (google.api.http) = { + patch: "/v1p1beta1/{source.name=organizations/*/sources/*}" + body: "source" + }; + option (google.api.method_signature) = "source"; + option (google.api.method_signature) = "source,update_mask"; + } + + // Updates security marks. + rpc UpdateSecurityMarks(UpdateSecurityMarksRequest) returns (SecurityMarks) { + option (google.api.http) = { + patch: "/v1p1beta1/{security_marks.name=organizations/*/assets/*/securityMarks}" + body: "security_marks" + additional_bindings { + patch: "/v1p1beta1/{security_marks.name=organizations/*/sources/*/findings/*/securityMarks}" + body: "security_marks" + } + }; + option (google.api.method_signature) = "security_marks"; + option (google.api.method_signature) = "security_marks,update_mask"; + } +} + +// Request message for creating a finding. +message CreateFindingRequest { + // Required. Resource name of the new finding's parent. Its format should be + // "organizations/[organization_id]/sources/[source_id]". + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "securitycenter.googleapis.com/Source" + } + ]; + + // Required. Unique identifier provided by the client within the parent scope. + // It must be alphanumeric and less than or equal to 32 characters and + // greater than 0 characters in length. + string finding_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The Finding being created. The name and security_marks will be + // ignored as they are both output only fields on this resource. + Finding finding = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for creating a notification config. +message CreateNotificationConfigRequest { + // Required. Resource name of the new notification config's parent. Its format + // is "organizations/[organization_id]". + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudresourcemanager.googleapis.com/Organization" + } + ]; + + // Required. + // Unique identifier provided by the client within the parent scope. + // It must be between 1 and 128 characters, and contains alphanumeric + // characters, underscores or hyphens only. + string config_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The notification config being created. The name and the service + // account will be ignored as they are both output only fields on this + // resource. + NotificationConfig notification_config = 3 + [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for creating a source. +message CreateSourceRequest { + // Required. Resource name of the new source's parent. Its format should be + // "organizations/[organization_id]". + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudresourcemanager.googleapis.com/Organization" + } + ]; + + // Required. The Source being created, only the display_name and description + // will be used. All other fields will be ignored. + Source source = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for deleting a notification config. +message DeleteNotificationConfigRequest { + // Required. Name of the notification config to delete. Its format is + // "organizations/[organization_id]/notificationConfigs/[config_id]". + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "securitycenter.googleapis.com/NotificationConfig" + } + ]; +} + +// Request message for getting a notification config. +message GetNotificationConfigRequest { + // Required. Name of the notification config to get. Its format is + // "organizations/[organization_id]/notificationConfigs/[config_id]". + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "securitycenter.googleapis.com/NotificationConfig" + } + ]; +} + +// Request message for getting organization settings. +message GetOrganizationSettingsRequest { + // Required. Name of the organization to get organization settings for. Its + // format is "organizations/[organization_id]/organizationSettings". + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "securitycenter.googleapis.com/OrganizationSettings" + } + ]; +} + +// Request message for getting a source. +message GetSourceRequest { + // Required. Relative resource name of the source. Its format is + // "organizations/[organization_id]/source/[source_id]". + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "securitycenter.googleapis.com/Source" + } + ]; +} + +// Request message for grouping by assets. +message GroupAssetsRequest { + // Required. Name of the organization to groupBy. Its format is + // "organizations/[organization_id]". + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudresourcemanager.googleapis.com/Organization" + } + ]; + + // Expression that defines the filter to apply across assets. + // The expression is a list of zero or more restrictions combined via logical + // operators `AND` and `OR`. + // Parentheses are supported, and `OR` has higher precedence than `AND`. + // + // Restrictions have the form ` ` and may have a `-` + // character in front of them to indicate negation. The fields map to those + // defined in the Asset resource. Examples include: + // + // * name + // * security_center_properties.resource_name + // * resource_properties.a_property + // * security_marks.marks.marka + // + // The supported operators are: + // + // * `=` for all value types. + // * `>`, `<`, `>=`, `<=` for integer values. + // * `:`, meaning substring matching, for strings. + // + // The supported value types are: + // + // * string literals in quotes. + // * integer literals without quotes. + // * boolean literals `true` and `false` without quotes. + // + // The following field and operator combinations are supported: + // + // * name: `=` + // * update_time: `=`, `>`, `<`, `>=`, `<=` + // + // Usage: This should be milliseconds since epoch or an RFC3339 string. + // Examples: + // "update_time = \"2019-06-10T16:07:18-07:00\"" + // "update_time = 1560208038000" + // + // * create_time: `=`, `>`, `<`, `>=`, `<=` + // + // Usage: This should be milliseconds since epoch or an RFC3339 string. + // Examples: + // "create_time = \"2019-06-10T16:07:18-07:00\"" + // "create_time = 1560208038000" + // + // * iam_policy.policy_blob: `=`, `:` + // * resource_properties: `=`, `:`, `>`, `<`, `>=`, `<=` + // * security_marks.marks: `=`, `:` + // * security_center_properties.resource_name: `=`, `:` + // * security_center_properties.resource_name_display_name: `=`, `:` + // * security_center_properties.resource_type: `=`, `:` + // * security_center_properties.resource_parent: `=`, `:` + // * security_center_properties.resource_parent_display_name: `=`, `:` + // * security_center_properties.resource_project: `=`, `:` + // * security_center_properties.resource_project_display_name: `=`, `:` + // * security_center_properties.resource_owners: `=`, `:` + // + // For example, `resource_properties.size = 100` is a valid filter string. + string filter = 2; + + // Required. Expression that defines what assets fields to use for grouping. + // The string value should follow SQL syntax: comma separated list of fields. + // For example: + // "security_center_properties.resource_project,security_center_properties.project". + // + // The following fields are supported when compare_duration is not set: + // + // * security_center_properties.resource_project + // * security_center_properties.resource_project_display_name + // * security_center_properties.resource_type + // * security_center_properties.resource_parent + // * security_center_properties.resource_parent_display_name + // + // The following fields are supported when compare_duration is set: + // + // * security_center_properties.resource_type + // * security_center_properties.resource_project_display_name + // * security_center_properties.resource_parent_display_name + string group_by = 3 [(google.api.field_behavior) = REQUIRED]; + + // When compare_duration is set, the GroupResult's "state_change" property is + // updated to indicate whether the asset was added, removed, or remained + // present during the compare_duration period of time that precedes the + // read_time. This is the time between (read_time - compare_duration) and + // read_time. + // + // The state change value is derived based on the presence of the asset at the + // two points in time. Intermediate state changes between the two times don't + // affect the result. For example, the results aren't affected if the asset is + // removed and re-created again. + // + // Possible "state_change" values when compare_duration is specified: + // + // * "ADDED": indicates that the asset was not present at the start of + // compare_duration, but present at reference_time. + // * "REMOVED": indicates that the asset was present at the start of + // compare_duration, but not present at reference_time. + // * "ACTIVE": indicates that the asset was present at both the + // start and the end of the time period defined by + // compare_duration and reference_time. + // + // If compare_duration is not specified, then the only possible state_change + // is "UNUSED", which will be the state_change set for all assets present at + // read_time. + // + // If this field is set then `state_change` must be a specified field in + // `group_by`. + google.protobuf.Duration compare_duration = 4; + + // Time used as a reference point when filtering assets. The filter is limited + // to assets existing at the supplied time and their values are those at that + // specific time. Absence of this field will default to the API's version of + // NOW. + google.protobuf.Timestamp read_time = 5; + + // Filter that specifies what fields to further filter on *after* the query + // filter has been executed. Currently only `state_change` is supported and + // requires compare_duration to be specified. + string having = 6; + + // The value returned by the last `GroupAssetsResponse`; indicates + // that this is a continuation of a prior `GroupAssets` call, and that the + // system should return the next page of data. + string page_token = 7; + + // The maximum number of results to return in a single response. Default is + // 10, minimum is 1, maximum is 1000. + int32 page_size = 8; +} + +// Response message for grouping by assets. +message GroupAssetsResponse { + // Group results. There exists an element for each existing unique + // combination of property/values. The element contains a count for the number + // of times those specific property/values appear. + repeated GroupResult group_by_results = 1; + + // Time used for executing the groupBy request. + google.protobuf.Timestamp read_time = 2; + + // Token to retrieve the next page of results, or empty if there are no more + // results. + string next_page_token = 3; + + // The total number of results matching the query. + int32 total_size = 4; +} + +// Request message for grouping by findings. +message GroupFindingsRequest { + // Required. Name of the source to groupBy. Its format is + // "organizations/[organization_id]/sources/[source_id]". To groupBy across + // all sources provide a source_id of `-`. For example: + // organizations/{organization_id}/sources/- + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "securitycenter.googleapis.com/Source" + } + ]; + + // Expression that defines the filter to apply across findings. + // The expression is a list of one or more restrictions combined via logical + // operators `AND` and `OR`. + // Parentheses are supported, and `OR` has higher precedence than `AND`. + // + // Restrictions have the form ` ` and may have a `-` + // character in front of them to indicate negation. Examples include: + // + // * name + // * source_properties.a_property + // * security_marks.marks.marka + // + // The supported operators are: + // + // * `=` for all value types. + // * `>`, `<`, `>=`, `<=` for integer values. + // * `:`, meaning substring matching, for strings. + // + // The supported value types are: + // + // * string literals in quotes. + // * integer literals without quotes. + // * boolean literals `true` and `false` without quotes. + // + // The following field and operator combinations are supported: + // + // * name: `=` + // * parent: `=`, `:` + // * resource_name: `=`, `:` + // * state: `=`, `:` + // * category: `=`, `:` + // * external_uri: `=`, `:` + // * event_time: `=`, `>`, `<`, `>=`, `<=` + // + // Usage: This should be milliseconds since epoch or an RFC3339 string. + // Examples: + // "event_time = \"2019-06-10T16:07:18-07:00\"" + // "event_time = 1560208038000" + // + // * security_marks.marks: `=`, `:` + // * source_properties: `=`, `:`, `>`, `<`, `>=`, `<=` + // + // For example, `source_properties.size = 100` is a valid filter string. + string filter = 2; + + // Required. Expression that defines what assets fields to use for grouping + // (including `state_change`). The string value should follow SQL syntax: + // comma separated list of fields. For example: "parent,resource_name". + // + // The following fields are supported: + // + // * resource_name + // * category + // * state + // * parent + // + // The following fields are supported when compare_duration is set: + // + // * state_change + string group_by = 3 [(google.api.field_behavior) = REQUIRED]; + + // Time used as a reference point when filtering findings. The filter is + // limited to findings existing at the supplied time and their values are + // those at that specific time. Absence of this field will default to the + // API's version of NOW. + google.protobuf.Timestamp read_time = 4; + + // When compare_duration is set, the GroupResult's "state_change" attribute is + // updated to indicate whether the finding had its state changed, the + // finding's state remained unchanged, or if the finding was added during the + // compare_duration period of time that precedes the read_time. This is the + // time between (read_time - compare_duration) and read_time. + // + // The state_change value is derived based on the presence and state of the + // finding at the two points in time. Intermediate state changes between the + // two times don't affect the result. For example, the results aren't affected + // if the finding is made inactive and then active again. + // + // Possible "state_change" values when compare_duration is specified: + // + // * "CHANGED": indicates that the finding was present at the start of + // compare_duration, but changed its state at read_time. + // * "UNCHANGED": indicates that the finding was present at the start of + // compare_duration and did not change state at read_time. + // * "ADDED": indicates that the finding was not present at the start + // of compare_duration, but was present at read_time. + // + // If compare_duration is not specified, then the only possible state_change + // is "UNUSED", which will be the state_change set for all findings present + // at read_time. + // + // If this field is set then `state_change` must be a specified field in + // `group_by`. + google.protobuf.Duration compare_duration = 5; + + // Filter that specifies what fields to further filter on *after* the query + // filter has been executed. Currently only `finding.state` and `state_change` + // are supported and requires compare_duration to be specified. + string having = 6; + + // The value returned by the last `GroupFindingsResponse`; indicates + // that this is a continuation of a prior `GroupFindings` call, and + // that the system should return the next page of data. + string page_token = 7; + + // The maximum number of results to return in a single response. Default is + // 10, minimum is 1, maximum is 1000. + int32 page_size = 8; +} + +// Response message for group by findings. +message GroupFindingsResponse { + // Group results. There exists an element for each existing unique + // combination of property/values. The element contains a count for the number + // of times those specific property/values appear. + repeated GroupResult group_by_results = 1; + + // Time used for executing the groupBy request. + google.protobuf.Timestamp read_time = 2; + + // Token to retrieve the next page of results, or empty if there are no more + // results. + string next_page_token = 3; + + // The total number of results matching the query. + int32 total_size = 4; +} + +// Result containing the properties and count of a groupBy request. +message GroupResult { + // Properties matching the groupBy fields in the request. + map properties = 1; + + // Total count of resources for the given properties. + int64 count = 2; +} + +// Request message for listing notification configs. +message ListNotificationConfigsRequest { + // Required. Name of the organization to list notification configs. + // Its format is "organizations/[organization_id]". + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudresourcemanager.googleapis.com/Organization" + } + ]; + + // The value returned by the last `ListNotificationConfigsResponse`; indicates + // that this is a continuation of a prior `ListNotificationConfigs` call, and + // that the system should return the next page of data. + string page_token = 2; + + // The maximum number of results to return in a single response. Default is + // 10, minimum is 1, maximum is 1000. + int32 page_size = 3; +} + +// Response message for listing notification configs. +message ListNotificationConfigsResponse { + // Notification configs belonging to the requested parent. + repeated NotificationConfig notification_configs = 1; + + // Token to retrieve the next page of results, or empty if there are no more + // results. + string next_page_token = 2; +} + +// Request message for listing sources. +message ListSourcesRequest { + // Required. Resource name of the parent of sources to list. Its format should + // be "organizations/[organization_id]". + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudresourcemanager.googleapis.com/Organization" + } + ]; + + // The value returned by the last `ListSourcesResponse`; indicates + // that this is a continuation of a prior `ListSources` call, and + // that the system should return the next page of data. + string page_token = 2; + + // The maximum number of results to return in a single response. Default is + // 10, minimum is 1, maximum is 1000. + int32 page_size = 7; +} + +// Response message for listing sources. +message ListSourcesResponse { + // Sources belonging to the requested parent. + repeated Source sources = 1; + + // Token to retrieve the next page of results, or empty if there are no more + // results. + string next_page_token = 2; +} + +// Request message for listing assets. +message ListAssetsRequest { + // Required. Name of the organization assets should belong to. Its format is + // "organizations/[organization_id]". + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudresourcemanager.googleapis.com/Organization" + } + ]; + + // Expression that defines the filter to apply across assets. + // The expression is a list of zero or more restrictions combined via logical + // operators `AND` and `OR`. + // Parentheses are supported, and `OR` has higher precedence than `AND`. + // + // Restrictions have the form ` ` and may have a `-` + // character in front of them to indicate negation. The fields map to those + // defined in the Asset resource. Examples include: + // + // * name + // * security_center_properties.resource_name + // * resource_properties.a_property + // * security_marks.marks.marka + // + // The supported operators are: + // + // * `=` for all value types. + // * `>`, `<`, `>=`, `<=` for integer values. + // * `:`, meaning substring matching, for strings. + // + // The supported value types are: + // + // * string literals in quotes. + // * integer literals without quotes. + // * boolean literals `true` and `false` without quotes. + // + // The following are the allowed field and operator combinations: + // + // * name: `=` + // * update_time: `=`, `>`, `<`, `>=`, `<=` + // + // Usage: This should be milliseconds since epoch or an RFC3339 string. + // Examples: + // "update_time = \"2019-06-10T16:07:18-07:00\"" + // "update_time = 1560208038000" + // + // * create_time: `=`, `>`, `<`, `>=`, `<=` + // + // Usage: This should be milliseconds since epoch or an RFC3339 string. + // Examples: + // "create_time = \"2019-06-10T16:07:18-07:00\"" + // "create_time = 1560208038000" + // + // * iam_policy.policy_blob: `=`, `:` + // * resource_properties: `=`, `:`, `>`, `<`, `>=`, `<=` + // * security_marks.marks: `=`, `:` + // * security_center_properties.resource_name: `=`, `:` + // * security_center_properties.resource_display_name: `=`, `:` + // * security_center_properties.resource_type: `=`, `:` + // * security_center_properties.resource_parent: `=`, `:` + // * security_center_properties.resource_parent_display_name: `=`, `:` + // * security_center_properties.resource_project: `=`, `:` + // * security_center_properties.resource_project_display_name: `=`, `:` + // * security_center_properties.resource_owners: `=`, `:` + // + // For example, `resource_properties.size = 100` is a valid filter string. + string filter = 2; + + // Expression that defines what fields and order to use for sorting. The + // string value should follow SQL syntax: comma separated list of fields. For + // example: "name,resource_properties.a_property". The default sorting order + // is ascending. To specify descending order for a field, a suffix " desc" + // should be appended to the field name. For example: "name + // desc,resource_properties.a_property". Redundant space characters in the + // syntax are insignificant. "name desc,resource_properties.a_property" and " + // name desc , resource_properties.a_property " are equivalent. + // + // The following fields are supported: + // name + // update_time + // resource_properties + // security_marks.marks + // security_center_properties.resource_name + // security_center_properties.resource_display_name + // security_center_properties.resource_parent + // security_center_properties.resource_parent_display_name + // security_center_properties.resource_project + // security_center_properties.resource_project_display_name + // security_center_properties.resource_type + string order_by = 3; + + // Time used as a reference point when filtering assets. The filter is limited + // to assets existing at the supplied time and their values are those at that + // specific time. Absence of this field will default to the API's version of + // NOW. + google.protobuf.Timestamp read_time = 4; + + // When compare_duration is set, the ListAssetsResult's "state_change" + // attribute is updated to indicate whether the asset was added, removed, or + // remained present during the compare_duration period of time that precedes + // the read_time. This is the time between (read_time - compare_duration) and + // read_time. + // + // The state_change value is derived based on the presence of the asset at the + // two points in time. Intermediate state changes between the two times don't + // affect the result. For example, the results aren't affected if the asset is + // removed and re-created again. + // + // Possible "state_change" values when compare_duration is specified: + // + // * "ADDED": indicates that the asset was not present at the start of + // compare_duration, but present at read_time. + // * "REMOVED": indicates that the asset was present at the start of + // compare_duration, but not present at read_time. + // * "ACTIVE": indicates that the asset was present at both the + // start and the end of the time period defined by + // compare_duration and read_time. + // + // If compare_duration is not specified, then the only possible state_change + // is "UNUSED", which will be the state_change set for all assets present at + // read_time. + google.protobuf.Duration compare_duration = 5; + + // Filter that specifies what fields to further filter on *after* the query + // filter has been executed. Currently only `state_change` is supported and + // requires compare_duration to be specified. + string having = 6; + + // Optional. + // A field mask to specify the ListAssetsResult fields to be listed in the + // response. + // An empty field mask will list all fields. + google.protobuf.FieldMask field_mask = 7 + [(google.api.field_behavior) = OPTIONAL]; + + // The value returned by the last `ListAssetsResponse`; indicates + // that this is a continuation of a prior `ListAssets` call, and + // that the system should return the next page of data. + string page_token = 8; + + // The maximum number of results to return in a single response. Default is + // 10, minimum is 1, maximum is 1000. + int32 page_size = 9; +} + +// Response message for listing assets. +message ListAssetsResponse { + // Result containing the Asset and its State. + message ListAssetsResult { + // The change in state of the asset. + // + // When querying across two points in time this describes + // the change between the two points: ADDED, REMOVED, or ACTIVE. + // If there was no compare_duration supplied in the request the state change + // will be: UNUSED + enum StateChange { + // State change is unused, this is the canonical default for this enum. + UNUSED = 0; + + // Asset was added between the points in time. + ADDED = 1; + + // Asset was removed between the points in time. + REMOVED = 2; + + // Asset was present at both point(s) in time. + ACTIVE = 3; + } + + // Asset matching the search request. + Asset asset = 1; + + // State change of the asset between the points in time. + StateChange state_change = 2; + } + + // Assets matching the list request. + repeated ListAssetsResult list_assets_results = 1; + + // Time used for executing the list request. + google.protobuf.Timestamp read_time = 2; + + // Token to retrieve the next page of results, or empty if there are no more + // results. + string next_page_token = 3; + + // The total number of assets matching the query. + int32 total_size = 4; +} + +// Request message for listing findings. +message ListFindingsRequest { + // Required. Name of the source the findings belong to. Its format is + // "organizations/[organization_id]/sources/[source_id]". To list across all + // sources provide a source_id of `-`. For example: + // organizations/{organization_id}/sources/- + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "securitycenter.googleapis.com/Source" + } + ]; + + // Expression that defines the filter to apply across findings. + // The expression is a list of one or more restrictions combined via logical + // operators `AND` and `OR`. + // Parentheses are supported, and `OR` has higher precedence than `AND`. + // + // Restrictions have the form ` ` and may have a `-` + // character in front of them to indicate negation. Examples include: + // + // * name + // * source_properties.a_property + // * security_marks.marks.marka + // + // The supported operators are: + // + // * `=` for all value types. + // * `>`, `<`, `>=`, `<=` for integer values. + // * `:`, meaning substring matching, for strings. + // + // The supported value types are: + // + // * string literals in quotes. + // * integer literals without quotes. + // * boolean literals `true` and `false` without quotes. + // + // The following field and operator combinations are supported: + // + // name: `=` + // parent: `=`, `:` + // resource_name: `=`, `:` + // state: `=`, `:` + // category: `=`, `:` + // external_uri: `=`, `:` + // event_time: `=`, `>`, `<`, `>=`, `<=` + // + // Usage: This should be milliseconds since epoch or an RFC3339 string. + // Examples: + // "event_time = \"2019-06-10T16:07:18-07:00\"" + // "event_time = 1560208038000" + // + // security_marks.marks: `=`, `:` + // source_properties: `=`, `:`, `>`, `<`, `>=`, `<=` + // + // For example, `source_properties.size = 100` is a valid filter string. + string filter = 2; + + // Expression that defines what fields and order to use for sorting. The + // string value should follow SQL syntax: comma separated list of fields. For + // example: "name,resource_properties.a_property". The default sorting order + // is ascending. To specify descending order for a field, a suffix " desc" + // should be appended to the field name. For example: "name + // desc,source_properties.a_property". Redundant space characters in the + // syntax are insignificant. "name desc,source_properties.a_property" and " + // name desc , source_properties.a_property " are equivalent. + // + // The following fields are supported: + // name + // parent + // state + // category + // resource_name + // event_time + // source_properties + // security_marks.marks + string order_by = 3; + + // Time used as a reference point when filtering findings. The filter is + // limited to findings existing at the supplied time and their values are + // those at that specific time. Absence of this field will default to the + // API's version of NOW. + google.protobuf.Timestamp read_time = 4; + + // When compare_duration is set, the ListFindingsResult's "state_change" + // attribute is updated to indicate whether the finding had its state changed, + // the finding's state remained unchanged, or if the finding was added in any + // state during the compare_duration period of time that precedes the + // read_time. This is the time between (read_time - compare_duration) and + // read_time. + // + // The state_change value is derived based on the presence and state of the + // finding at the two points in time. Intermediate state changes between the + // two times don't affect the result. For example, the results aren't affected + // if the finding is made inactive and then active again. + // + // Possible "state_change" values when compare_duration is specified: + // + // * "CHANGED": indicates that the finding was present at the start of + // compare_duration, but changed its state at read_time. + // * "UNCHANGED": indicates that the finding was present at the start of + // compare_duration and did not change state at read_time. + // * "ADDED": indicates that the finding was not present at the start + // of compare_duration, but was present at read_time. + // + // If compare_duration is not specified, then the only possible state_change + // is "UNUSED", which will be the state_change set for all findings present at + // read_time. + google.protobuf.Duration compare_duration = 5; + + // Filter that specifies what fields to further filter on *after* the query + // filter has been executed. Currently only `finding.state` and `state_change` + // are supported and requires compare_duration to be specified. + string having = 6; + + // Optional. + // A field mask to specify the Finding fields to be listed in the response. + // An empty field mask will list all fields. + google.protobuf.FieldMask field_mask = 7 + [(google.api.field_behavior) = OPTIONAL]; + + // The value returned by the last `ListFindingsResponse`; indicates + // that this is a continuation of a prior `ListFindings` call, and + // that the system should return the next page of data. + string page_token = 8; + + // The maximum number of results to return in a single response. Default is + // 10, minimum is 1, maximum is 1000. + int32 page_size = 9; +} + +// Response message for listing findings. +message ListFindingsResponse { + // Result containing the Finding and its StateChange. + message ListFindingsResult { + // Information related to the Google Cloud Platform (GCP) resource that is + // associated with this finding. + message Resource { + // The full resource name of the resource. See: + // https://cloud.google.com/apis/design/resource_names#full_resource_name + string name = 1; + + // The full resource name of project that the resource belongs to. + string project_name = 2; + + // The human readable name of project that the resource belongs to. + string project_display_name = 3; + + // The full resource name of resource's parent. + string parent_name = 4; + + // The human readable name of resource's parent. + string parent_display_name = 5; + } + + // The change in state of the finding. + // + // When querying across two points in time this describes + // the change in the finding between the two points: CHANGED, UNCHANGED, + // ADDED, or REMOVED. Findings can not be deleted, so REMOVED implies that + // the finding at timestamp does not match the filter specified, but it did + // at timestamp - compare_duration. If there was no compare_duration + // supplied in the request the state change will be: UNUSED + enum StateChange { + // State change is unused, this is the canonical default for this enum. + UNUSED = 0; + + // The finding has changed state in some way between the points in time + // and existed at both points. + CHANGED = 1; + + // The finding has not changed state between the points in time and + // existed at both points. + UNCHANGED = 2; + + // The finding was created between the points in time. + ADDED = 3; + + // The finding at timestamp does not match the filter specified, but it + // did at timestamp - compare_duration. + REMOVED = 4; + } + + // Finding matching the search request. + Finding finding = 1; + + // State change of the finding between the points in time. + StateChange state_change = 2; + + // Output only. Resource that is associated with this finding. + Resource resource = 3; + } + + // Findings matching the list request. + repeated ListFindingsResult list_findings_results = 1; + + // Time used for executing the list request. + google.protobuf.Timestamp read_time = 2; + + // Token to retrieve the next page of results, or empty if there are no more + // results. + string next_page_token = 3; + + // The total number of findings matching the query. + int32 total_size = 4; +} + +// Request message for updating a finding's state. +message SetFindingStateRequest { + // Required. The relative resource name of the finding. See: + // https://cloud.google.com/apis/design/resource_names#relative_resource_name + // Example: + // "organizations/{organization_id}/sources/{source_id}/finding/{finding_id}". + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "securitycenter.googleapis.com/Finding" + } + ]; + + // Required. The desired State of the finding. + Finding.State state = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The time at which the updated state takes effect. + google.protobuf.Timestamp start_time = 3 + [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for running asset discovery for an organization. +message RunAssetDiscoveryRequest { + // Required. Name of the organization to run asset discovery for. Its format + // is "organizations/[organization_id]". + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudresourcemanager.googleapis.com/Organization" + } + ]; +} + +// Request message for updating or creating a finding. +message UpdateFindingRequest { + // Required. The finding resource to update or create if it does not already + // exist. parent, security_marks, and update_time will be ignored. + // + // In the case of creation, the finding id portion of the name must be + // alphanumeric and less than or equal to 32 characters and greater than 0 + // characters in length. + Finding finding = 1 [(google.api.field_behavior) = REQUIRED]; + + // The FieldMask to use when updating the finding resource. This field should + // not be specified when creating a finding. + // + // When updating a finding, an empty mask is treated as updating all mutable + // fields and replacing source_properties. Individual source_properties can + // be added/updated by using "source_properties." in the field + // mask. + google.protobuf.FieldMask update_mask = 2; +} + +// Request message for updating a notification config. +message UpdateNotificationConfigRequest { + // Required. The notification config to update. + NotificationConfig notification_config = 1 + [(google.api.field_behavior) = REQUIRED]; + + // The FieldMask to use when updating the notification config. + // + // If empty all mutable fields will be updated. + google.protobuf.FieldMask update_mask = 2; +} + +// Request message for updating an organization's settings. +message UpdateOrganizationSettingsRequest { + // Required. The organization settings resource to update. + OrganizationSettings organization_settings = 1 + [(google.api.field_behavior) = REQUIRED]; + + // The FieldMask to use when updating the settings resource. + // + // If empty all mutable fields will be updated. + google.protobuf.FieldMask update_mask = 2; +} + +// Request message for updating a source. +message UpdateSourceRequest { + // Required. The source resource to update. + Source source = 1 [(google.api.field_behavior) = REQUIRED]; + + // The FieldMask to use when updating the source resource. + // + // If empty all mutable fields will be updated. + google.protobuf.FieldMask update_mask = 2; +} + +// Request message for updating a SecurityMarks resource. +message UpdateSecurityMarksRequest { + // Required. The security marks resource to update. + SecurityMarks security_marks = 1 [(google.api.field_behavior) = REQUIRED]; + + // The FieldMask to use when updating the security marks resource. + // + // The field mask must not contain duplicate fields. + // If empty or set to "marks", all marks will be replaced. Individual + // marks can be updated using "marks.". + google.protobuf.FieldMask update_mask = 2; + + // The time at which the updated SecurityMarks take effect. + // If not set uses current server time. Updates will be applied to the + // SecurityMarks that are active immediately preceding this time. + google.protobuf.Timestamp start_time = 3; +} diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/source.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/source.proto new file mode 100644 index 00000000000..875c2433ef5 --- /dev/null +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/source.proto @@ -0,0 +1,60 @@ +// Copyright 2019 Google LLC. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +syntax = "proto3"; + +package google.cloud.securitycenter.v1p1beta1; + +import "google/api/annotations.proto"; +import "google/api/resource.proto"; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V1P1Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1p1beta1;securitycenter"; +option java_multiple_files = true; +option java_package = "com.google.cloud.securitycenter.v1p1beta1"; +option php_namespace = "Google\\Cloud\\SecurityCenter\\V1p1beta1"; +option ruby_package = "Google::Cloud::SecurityCenter::V1p1Beta1"; + +// Cloud Security Command Center's (Cloud SCC) finding source. A finding source +// is an entity or a mechanism that can produce a finding. A source is like a +// container of findings that come from the same scanner, logger, monitor, etc. +message Source { + option (google.api.resource) = { + type: "securitycenter.googleapis.com/Source" + pattern: "organizations/{organization}/sources/{source}" + }; + + // The relative resource name of this source. See: + // https://cloud.google.com/apis/design/resource_names#relative_resource_name + // Example: + // "organizations/{organization_id}/sources/{source_id}" + string name = 1; + + // The source's display name. + // A source's display name must be unique amongst its siblings, for example, + // two sources with the same parent can't share the same display name. + // The display name must have a length between 1 and 64 characters + // (inclusive). + string display_name = 2; + + // The description of the source (max of 1024 characters). + // Example: + // "Cloud Security Scanner is a web security scanner for common + // vulnerabilities in App Engine applications. It can automatically + // scan and detect four common vulnerabilities, including cross-site-scripting + // (XSS), Flash injection, mixed content (HTTP in HTTPS), and + // outdated/insecure libraries." + string description = 3; +} diff --git a/packages/google-cloud-securitycenter/protos/protos.d.ts b/packages/google-cloud-securitycenter/protos/protos.d.ts index 38d3f59845e..79b5a273bb8 100644 --- a/packages/google-cloud-securitycenter/protos/protos.d.ts +++ b/packages/google-cloud-securitycenter/protos/protos.d.ts @@ -26,256 +26,6 @@ export namespace google { /** Namespace v1. */ namespace v1 { - /** Properties of a Finding. */ - interface IFinding { - - /** Finding name */ - name?: (string|null); - - /** Finding parent */ - parent?: (string|null); - - /** Finding resourceName */ - resourceName?: (string|null); - - /** Finding state */ - state?: (google.cloud.securitycenter.v1.Finding.State|keyof typeof google.cloud.securitycenter.v1.Finding.State|null); - - /** Finding category */ - category?: (string|null); - - /** Finding externalUri */ - externalUri?: (string|null); - - /** Finding sourceProperties */ - sourceProperties?: ({ [k: string]: google.protobuf.IValue }|null); - - /** Finding securityMarks */ - securityMarks?: (google.cloud.securitycenter.v1.ISecurityMarks|null); - - /** Finding eventTime */ - eventTime?: (google.protobuf.ITimestamp|null); - - /** Finding createTime */ - createTime?: (google.protobuf.ITimestamp|null); - } - - /** Represents a Finding. */ - class Finding implements IFinding { - - /** - * Constructs a new Finding. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v1.IFinding); - - /** Finding name. */ - public name: string; - - /** Finding parent. */ - public parent: string; - - /** Finding resourceName. */ - public resourceName: string; - - /** Finding state. */ - public state: (google.cloud.securitycenter.v1.Finding.State|keyof typeof google.cloud.securitycenter.v1.Finding.State); - - /** Finding category. */ - public category: string; - - /** Finding externalUri. */ - public externalUri: string; - - /** Finding sourceProperties. */ - public sourceProperties: { [k: string]: google.protobuf.IValue }; - - /** Finding securityMarks. */ - public securityMarks?: (google.cloud.securitycenter.v1.ISecurityMarks|null); - - /** Finding eventTime. */ - public eventTime?: (google.protobuf.ITimestamp|null); - - /** Finding createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** - * Creates a new Finding instance using the specified properties. - * @param [properties] Properties to set - * @returns Finding instance - */ - public static create(properties?: google.cloud.securitycenter.v1.IFinding): google.cloud.securitycenter.v1.Finding; - - /** - * Encodes the specified Finding message. Does not implicitly {@link google.cloud.securitycenter.v1.Finding.verify|verify} messages. - * @param message Finding message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v1.IFinding, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Finding message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Finding.verify|verify} messages. - * @param message Finding message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v1.IFinding, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Finding message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Finding - * @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.cloud.securitycenter.v1.Finding; - - /** - * Decodes a Finding message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Finding - * @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.cloud.securitycenter.v1.Finding; - - /** - * Verifies a Finding 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 Finding message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Finding - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.Finding; - - /** - * Creates a plain object from a Finding message. Also converts values to other types if specified. - * @param message Finding - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v1.Finding, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Finding to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - namespace Finding { - - /** State enum. */ - enum State { - STATE_UNSPECIFIED = 0, - ACTIVE = 1, - INACTIVE = 2 - } - } - - /** Properties of a SecurityMarks. */ - interface ISecurityMarks { - - /** SecurityMarks name */ - name?: (string|null); - - /** SecurityMarks marks */ - marks?: ({ [k: string]: string }|null); - } - - /** Represents a SecurityMarks. */ - class SecurityMarks implements ISecurityMarks { - - /** - * Constructs a new SecurityMarks. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v1.ISecurityMarks); - - /** SecurityMarks name. */ - public name: string; - - /** SecurityMarks marks. */ - public marks: { [k: string]: string }; - - /** - * Creates a new SecurityMarks instance using the specified properties. - * @param [properties] Properties to set - * @returns SecurityMarks instance - */ - public static create(properties?: google.cloud.securitycenter.v1.ISecurityMarks): google.cloud.securitycenter.v1.SecurityMarks; - - /** - * Encodes the specified SecurityMarks message. Does not implicitly {@link google.cloud.securitycenter.v1.SecurityMarks.verify|verify} messages. - * @param message SecurityMarks message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v1.ISecurityMarks, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SecurityMarks message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.SecurityMarks.verify|verify} messages. - * @param message SecurityMarks message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v1.ISecurityMarks, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SecurityMarks message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SecurityMarks - * @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.cloud.securitycenter.v1.SecurityMarks; - - /** - * Decodes a SecurityMarks message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SecurityMarks - * @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.cloud.securitycenter.v1.SecurityMarks; - - /** - * Verifies a SecurityMarks 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 SecurityMarks message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SecurityMarks - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.SecurityMarks; - - /** - * Creates a plain object from a SecurityMarks message. Also converts values to other types if specified. - * @param message SecurityMarks - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v1.SecurityMarks, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SecurityMarks to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - /** Properties of an Asset. */ interface IAsset { @@ -627,212 +377,253 @@ export namespace google { } } - /** Properties of a Source. */ - interface ISource { + /** Properties of a SecurityMarks. */ + interface ISecurityMarks { - /** Source name */ + /** SecurityMarks name */ name?: (string|null); - /** Source displayName */ - displayName?: (string|null); - - /** Source description */ - description?: (string|null); + /** SecurityMarks marks */ + marks?: ({ [k: string]: string }|null); } - /** Represents a Source. */ - class Source implements ISource { + /** Represents a SecurityMarks. */ + class SecurityMarks implements ISecurityMarks { /** - * Constructs a new Source. + * Constructs a new SecurityMarks. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.securitycenter.v1.ISource); + constructor(properties?: google.cloud.securitycenter.v1.ISecurityMarks); - /** Source name. */ + /** SecurityMarks name. */ public name: string; - /** Source displayName. */ - public displayName: string; - - /** Source description. */ - public description: string; + /** SecurityMarks marks. */ + public marks: { [k: string]: string }; /** - * Creates a new Source instance using the specified properties. + * Creates a new SecurityMarks instance using the specified properties. * @param [properties] Properties to set - * @returns Source instance + * @returns SecurityMarks instance */ - public static create(properties?: google.cloud.securitycenter.v1.ISource): google.cloud.securitycenter.v1.Source; + public static create(properties?: google.cloud.securitycenter.v1.ISecurityMarks): google.cloud.securitycenter.v1.SecurityMarks; /** - * Encodes the specified Source message. Does not implicitly {@link google.cloud.securitycenter.v1.Source.verify|verify} messages. - * @param message Source message or plain object to encode + * Encodes the specified SecurityMarks message. Does not implicitly {@link google.cloud.securitycenter.v1.SecurityMarks.verify|verify} messages. + * @param message SecurityMarks message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.securitycenter.v1.ISource, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.securitycenter.v1.ISecurityMarks, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified Source message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Source.verify|verify} messages. - * @param message Source message or plain object to encode + * Encodes the specified SecurityMarks message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.SecurityMarks.verify|verify} messages. + * @param message SecurityMarks message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.securitycenter.v1.ISource, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.securitycenter.v1.ISecurityMarks, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a Source message from the specified reader or buffer. + * Decodes a SecurityMarks message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns Source + * @returns SecurityMarks * @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.cloud.securitycenter.v1.Source; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1.SecurityMarks; /** - * Decodes a Source message from the specified reader or buffer, length delimited. + * Decodes a SecurityMarks message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Source + * @returns SecurityMarks * @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.cloud.securitycenter.v1.Source; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1.SecurityMarks; /** - * Verifies a Source message. + * Verifies a SecurityMarks 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 Source message from a plain object. Also converts values to their respective internal types. + * Creates a SecurityMarks message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Source + * @returns SecurityMarks */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.Source; + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.SecurityMarks; /** - * Creates a plain object from a Source message. Also converts values to other types if specified. - * @param message Source + * Creates a plain object from a SecurityMarks message. Also converts values to other types if specified. + * @param message SecurityMarks * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.securitycenter.v1.Source, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.securitycenter.v1.SecurityMarks, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Source to JSON. + * Converts this SecurityMarks to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a RunAssetDiscoveryResponse. */ - interface IRunAssetDiscoveryResponse { + /** Properties of a Finding. */ + interface IFinding { - /** RunAssetDiscoveryResponse state */ - state?: (google.cloud.securitycenter.v1.RunAssetDiscoveryResponse.State|keyof typeof google.cloud.securitycenter.v1.RunAssetDiscoveryResponse.State|null); + /** Finding name */ + name?: (string|null); - /** RunAssetDiscoveryResponse duration */ - duration?: (google.protobuf.IDuration|null); + /** Finding parent */ + parent?: (string|null); + + /** Finding resourceName */ + resourceName?: (string|null); + + /** Finding state */ + state?: (google.cloud.securitycenter.v1.Finding.State|keyof typeof google.cloud.securitycenter.v1.Finding.State|null); + + /** Finding category */ + category?: (string|null); + + /** Finding externalUri */ + externalUri?: (string|null); + + /** Finding sourceProperties */ + sourceProperties?: ({ [k: string]: google.protobuf.IValue }|null); + + /** Finding securityMarks */ + securityMarks?: (google.cloud.securitycenter.v1.ISecurityMarks|null); + + /** Finding eventTime */ + eventTime?: (google.protobuf.ITimestamp|null); + + /** Finding createTime */ + createTime?: (google.protobuf.ITimestamp|null); } - /** Represents a RunAssetDiscoveryResponse. */ - class RunAssetDiscoveryResponse implements IRunAssetDiscoveryResponse { + /** Represents a Finding. */ + class Finding implements IFinding { /** - * Constructs a new RunAssetDiscoveryResponse. + * Constructs a new Finding. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.securitycenter.v1.IRunAssetDiscoveryResponse); + constructor(properties?: google.cloud.securitycenter.v1.IFinding); - /** RunAssetDiscoveryResponse state. */ - public state: (google.cloud.securitycenter.v1.RunAssetDiscoveryResponse.State|keyof typeof google.cloud.securitycenter.v1.RunAssetDiscoveryResponse.State); + /** Finding name. */ + public name: string; - /** RunAssetDiscoveryResponse duration. */ - public duration?: (google.protobuf.IDuration|null); + /** Finding parent. */ + public parent: string; + + /** Finding resourceName. */ + public resourceName: string; + + /** Finding state. */ + public state: (google.cloud.securitycenter.v1.Finding.State|keyof typeof google.cloud.securitycenter.v1.Finding.State); + + /** Finding category. */ + public category: string; + + /** Finding externalUri. */ + public externalUri: string; + + /** Finding sourceProperties. */ + public sourceProperties: { [k: string]: google.protobuf.IValue }; + + /** Finding securityMarks. */ + public securityMarks?: (google.cloud.securitycenter.v1.ISecurityMarks|null); + + /** Finding eventTime. */ + public eventTime?: (google.protobuf.ITimestamp|null); + + /** Finding createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); /** - * Creates a new RunAssetDiscoveryResponse instance using the specified properties. + * Creates a new Finding instance using the specified properties. * @param [properties] Properties to set - * @returns RunAssetDiscoveryResponse instance + * @returns Finding instance */ - public static create(properties?: google.cloud.securitycenter.v1.IRunAssetDiscoveryResponse): google.cloud.securitycenter.v1.RunAssetDiscoveryResponse; + public static create(properties?: google.cloud.securitycenter.v1.IFinding): google.cloud.securitycenter.v1.Finding; /** - * Encodes the specified RunAssetDiscoveryResponse message. Does not implicitly {@link google.cloud.securitycenter.v1.RunAssetDiscoveryResponse.verify|verify} messages. - * @param message RunAssetDiscoveryResponse message or plain object to encode + * Encodes the specified Finding message. Does not implicitly {@link google.cloud.securitycenter.v1.Finding.verify|verify} messages. + * @param message Finding message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.securitycenter.v1.IRunAssetDiscoveryResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.securitycenter.v1.IFinding, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified RunAssetDiscoveryResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.RunAssetDiscoveryResponse.verify|verify} messages. - * @param message RunAssetDiscoveryResponse message or plain object to encode + * Encodes the specified Finding message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Finding.verify|verify} messages. + * @param message Finding message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.securitycenter.v1.IRunAssetDiscoveryResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.securitycenter.v1.IFinding, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a RunAssetDiscoveryResponse message from the specified reader or buffer. + * Decodes a Finding message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns RunAssetDiscoveryResponse + * @returns Finding * @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.cloud.securitycenter.v1.RunAssetDiscoveryResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1.Finding; /** - * Decodes a RunAssetDiscoveryResponse message from the specified reader or buffer, length delimited. + * Decodes a Finding message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns RunAssetDiscoveryResponse + * @returns Finding * @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.cloud.securitycenter.v1.RunAssetDiscoveryResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1.Finding; /** - * Verifies a RunAssetDiscoveryResponse message. + * Verifies a Finding 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 RunAssetDiscoveryResponse message from a plain object. Also converts values to their respective internal types. + * Creates a Finding message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns RunAssetDiscoveryResponse + * @returns Finding */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.RunAssetDiscoveryResponse; + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.Finding; /** - * Creates a plain object from a RunAssetDiscoveryResponse message. Also converts values to other types if specified. - * @param message RunAssetDiscoveryResponse + * Creates a plain object from a Finding message. Also converts values to other types if specified. + * @param message Finding * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.securitycenter.v1.RunAssetDiscoveryResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.securitycenter.v1.Finding, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this RunAssetDiscoveryResponse to JSON. + * Converts this Finding to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - namespace RunAssetDiscoveryResponse { + namespace Finding { /** State enum. */ enum State { STATE_UNSPECIFIED = 0, - COMPLETED = 1, - SUPERSEDED = 2, - TERMINATED = 3 + ACTIVE = 1, + INACTIVE = 2 } } @@ -1047,42 +838,149 @@ export namespace google { } } - /** Represents a SecurityCenter */ - class SecurityCenter extends $protobuf.rpc.Service { + /** Properties of a RunAssetDiscoveryResponse. */ + interface IRunAssetDiscoveryResponse { + + /** RunAssetDiscoveryResponse state */ + state?: (google.cloud.securitycenter.v1.RunAssetDiscoveryResponse.State|keyof typeof google.cloud.securitycenter.v1.RunAssetDiscoveryResponse.State|null); + + /** RunAssetDiscoveryResponse duration */ + duration?: (google.protobuf.IDuration|null); + } + + /** Represents a RunAssetDiscoveryResponse. */ + class RunAssetDiscoveryResponse implements IRunAssetDiscoveryResponse { /** - * Constructs a new SecurityCenter service. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited + * Constructs a new RunAssetDiscoveryResponse. + * @param [properties] Properties to set */ - constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + constructor(properties?: google.cloud.securitycenter.v1.IRunAssetDiscoveryResponse); + + /** RunAssetDiscoveryResponse state. */ + public state: (google.cloud.securitycenter.v1.RunAssetDiscoveryResponse.State|keyof typeof google.cloud.securitycenter.v1.RunAssetDiscoveryResponse.State); + + /** RunAssetDiscoveryResponse duration. */ + public duration?: (google.protobuf.IDuration|null); /** - * Creates new SecurityCenter 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. + * Creates a new RunAssetDiscoveryResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns RunAssetDiscoveryResponse instance */ - public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): SecurityCenter; + public static create(properties?: google.cloud.securitycenter.v1.IRunAssetDiscoveryResponse): google.cloud.securitycenter.v1.RunAssetDiscoveryResponse; /** - * Calls CreateSource. - * @param request CreateSourceRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Source + * Encodes the specified RunAssetDiscoveryResponse message. Does not implicitly {@link google.cloud.securitycenter.v1.RunAssetDiscoveryResponse.verify|verify} messages. + * @param message RunAssetDiscoveryResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - public createSource(request: google.cloud.securitycenter.v1.ICreateSourceRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.CreateSourceCallback): void; + public static encode(message: google.cloud.securitycenter.v1.IRunAssetDiscoveryResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Calls CreateSource. - * @param request CreateSourceRequest message or plain object - * @returns Promise + * Encodes the specified RunAssetDiscoveryResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.RunAssetDiscoveryResponse.verify|verify} messages. + * @param message RunAssetDiscoveryResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - public createSource(request: google.cloud.securitycenter.v1.ICreateSourceRequest): Promise; + public static encodeDelimited(message: google.cloud.securitycenter.v1.IRunAssetDiscoveryResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Calls CreateFinding. + * Decodes a RunAssetDiscoveryResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RunAssetDiscoveryResponse + * @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.cloud.securitycenter.v1.RunAssetDiscoveryResponse; + + /** + * Decodes a RunAssetDiscoveryResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RunAssetDiscoveryResponse + * @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.cloud.securitycenter.v1.RunAssetDiscoveryResponse; + + /** + * Verifies a RunAssetDiscoveryResponse 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 RunAssetDiscoveryResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RunAssetDiscoveryResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.RunAssetDiscoveryResponse; + + /** + * Creates a plain object from a RunAssetDiscoveryResponse message. Also converts values to other types if specified. + * @param message RunAssetDiscoveryResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.RunAssetDiscoveryResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RunAssetDiscoveryResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace RunAssetDiscoveryResponse { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + COMPLETED = 1, + SUPERSEDED = 2, + TERMINATED = 3 + } + } + + /** Represents a SecurityCenter */ + class SecurityCenter extends $protobuf.rpc.Service { + + /** + * Constructs a new SecurityCenter 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 SecurityCenter 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): SecurityCenter; + + /** + * Calls CreateSource. + * @param request CreateSourceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Source + */ + public createSource(request: google.cloud.securitycenter.v1.ICreateSourceRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.CreateSourceCallback): void; + + /** + * Calls CreateSource. + * @param request CreateSourceRequest message or plain object + * @returns Promise + */ + public createSource(request: google.cloud.securitycenter.v1.ICreateSourceRequest): Promise; + + /** + * Calls CreateFinding. * @param request CreateFindingRequest message or plain object * @param callback Node-style callback called with the error, if any, and Finding */ @@ -3991,278 +3889,130 @@ export namespace google { */ public toJSON(): { [k: string]: any }; } - } - - /** Namespace v1beta1. */ - namespace v1beta1 { - /** Properties of a Finding. */ - interface IFinding { + /** Properties of a Source. */ + interface ISource { - /** Finding name */ + /** Source name */ name?: (string|null); - /** Finding parent */ - parent?: (string|null); - - /** Finding resourceName */ - resourceName?: (string|null); - - /** Finding state */ - state?: (google.cloud.securitycenter.v1beta1.Finding.State|keyof typeof google.cloud.securitycenter.v1beta1.Finding.State|null); - - /** Finding category */ - category?: (string|null); - - /** Finding externalUri */ - externalUri?: (string|null); - - /** Finding sourceProperties */ - sourceProperties?: ({ [k: string]: google.protobuf.IValue }|null); - - /** Finding securityMarks */ - securityMarks?: (google.cloud.securitycenter.v1beta1.ISecurityMarks|null); - - /** Finding eventTime */ - eventTime?: (google.protobuf.ITimestamp|null); + /** Source displayName */ + displayName?: (string|null); - /** Finding createTime */ - createTime?: (google.protobuf.ITimestamp|null); + /** Source description */ + description?: (string|null); } - /** Represents a Finding. */ - class Finding implements IFinding { + /** Represents a Source. */ + class Source implements ISource { /** - * Constructs a new Finding. + * Constructs a new Source. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.securitycenter.v1beta1.IFinding); + constructor(properties?: google.cloud.securitycenter.v1.ISource); - /** Finding name. */ + /** Source name. */ public name: string; - /** Finding parent. */ - public parent: string; - - /** Finding resourceName. */ - public resourceName: string; - - /** Finding state. */ - public state: (google.cloud.securitycenter.v1beta1.Finding.State|keyof typeof google.cloud.securitycenter.v1beta1.Finding.State); - - /** Finding category. */ - public category: string; - - /** Finding externalUri. */ - public externalUri: string; - - /** Finding sourceProperties. */ - public sourceProperties: { [k: string]: google.protobuf.IValue }; - - /** Finding securityMarks. */ - public securityMarks?: (google.cloud.securitycenter.v1beta1.ISecurityMarks|null); - - /** Finding eventTime. */ - public eventTime?: (google.protobuf.ITimestamp|null); + /** Source displayName. */ + public displayName: string; - /** Finding createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); + /** Source description. */ + public description: string; /** - * Creates a new Finding instance using the specified properties. + * Creates a new Source instance using the specified properties. * @param [properties] Properties to set - * @returns Finding instance + * @returns Source instance */ - public static create(properties?: google.cloud.securitycenter.v1beta1.IFinding): google.cloud.securitycenter.v1beta1.Finding; + public static create(properties?: google.cloud.securitycenter.v1.ISource): google.cloud.securitycenter.v1.Source; /** - * Encodes the specified Finding message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.Finding.verify|verify} messages. - * @param message Finding message or plain object to encode + * Encodes the specified Source message. Does not implicitly {@link google.cloud.securitycenter.v1.Source.verify|verify} messages. + * @param message Source message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.securitycenter.v1beta1.IFinding, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.securitycenter.v1.ISource, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified Finding message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.Finding.verify|verify} messages. - * @param message Finding message or plain object to encode + * Encodes the specified Source message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Source.verify|verify} messages. + * @param message Source message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.securitycenter.v1beta1.IFinding, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.securitycenter.v1.ISource, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a Finding message from the specified reader or buffer. + * Decodes a Source message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns Finding + * @returns Source * @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.cloud.securitycenter.v1beta1.Finding; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1.Source; /** - * Decodes a Finding message from the specified reader or buffer, length delimited. + * Decodes a Source message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Finding + * @returns Source * @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.cloud.securitycenter.v1beta1.Finding; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1.Source; /** - * Verifies a Finding message. + * Verifies a Source 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 Finding message from a plain object. Also converts values to their respective internal types. + * Creates a Source message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Finding + * @returns Source */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1beta1.Finding; + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.Source; /** - * Creates a plain object from a Finding message. Also converts values to other types if specified. - * @param message Finding + * Creates a plain object from a Source message. Also converts values to other types if specified. + * @param message Source * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.securitycenter.v1beta1.Finding, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.securitycenter.v1.Source, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Finding to JSON. + * Converts this Source to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } + } - namespace Finding { - - /** State enum. */ - enum State { - STATE_UNSPECIFIED = 0, - ACTIVE = 1, - INACTIVE = 2 - } - } + /** Namespace v1beta1. */ + namespace v1beta1 { - /** Properties of a SecurityMarks. */ - interface ISecurityMarks { + /** Properties of an Asset. */ + interface IAsset { - /** SecurityMarks name */ + /** Asset name */ name?: (string|null); - /** SecurityMarks marks */ - marks?: ({ [k: string]: string }|null); - } + /** Asset securityCenterProperties */ + securityCenterProperties?: (google.cloud.securitycenter.v1beta1.Asset.ISecurityCenterProperties|null); - /** Represents a SecurityMarks. */ - class SecurityMarks implements ISecurityMarks { + /** Asset resourceProperties */ + resourceProperties?: ({ [k: string]: google.protobuf.IValue }|null); - /** - * Constructs a new SecurityMarks. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v1beta1.ISecurityMarks); + /** Asset securityMarks */ + securityMarks?: (google.cloud.securitycenter.v1beta1.ISecurityMarks|null); - /** SecurityMarks name. */ - public name: string; - - /** SecurityMarks marks. */ - public marks: { [k: string]: string }; - - /** - * Creates a new SecurityMarks instance using the specified properties. - * @param [properties] Properties to set - * @returns SecurityMarks instance - */ - public static create(properties?: google.cloud.securitycenter.v1beta1.ISecurityMarks): google.cloud.securitycenter.v1beta1.SecurityMarks; - - /** - * Encodes the specified SecurityMarks message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.SecurityMarks.verify|verify} messages. - * @param message SecurityMarks message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.securitycenter.v1beta1.ISecurityMarks, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SecurityMarks message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.SecurityMarks.verify|verify} messages. - * @param message SecurityMarks message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.securitycenter.v1beta1.ISecurityMarks, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SecurityMarks message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SecurityMarks - * @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.cloud.securitycenter.v1beta1.SecurityMarks; - - /** - * Decodes a SecurityMarks message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SecurityMarks - * @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.cloud.securitycenter.v1beta1.SecurityMarks; - - /** - * Verifies a SecurityMarks 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 SecurityMarks message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SecurityMarks - */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1beta1.SecurityMarks; - - /** - * Creates a plain object from a SecurityMarks message. Also converts values to other types if specified. - * @param message SecurityMarks - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v1beta1.SecurityMarks, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SecurityMarks to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of an Asset. */ - interface IAsset { - - /** Asset name */ - name?: (string|null); - - /** Asset securityCenterProperties */ - securityCenterProperties?: (google.cloud.securitycenter.v1beta1.Asset.ISecurityCenterProperties|null); - - /** Asset resourceProperties */ - resourceProperties?: ({ [k: string]: google.protobuf.IValue }|null); - - /** Asset securityMarks */ - securityMarks?: (google.cloud.securitycenter.v1beta1.ISecurityMarks|null); - - /** Asset createTime */ - createTime?: (google.protobuf.ITimestamp|null); + /** Asset createTime */ + createTime?: (google.protobuf.ITimestamp|null); /** Asset updateTime */ updateTime?: (google.protobuf.ITimestamp|null); @@ -4483,212 +4233,253 @@ export namespace google { } } - /** Properties of a Source. */ - interface ISource { + /** Properties of a SecurityMarks. */ + interface ISecurityMarks { - /** Source name */ + /** SecurityMarks name */ name?: (string|null); - /** Source displayName */ - displayName?: (string|null); - - /** Source description */ - description?: (string|null); + /** SecurityMarks marks */ + marks?: ({ [k: string]: string }|null); } - /** Represents a Source. */ - class Source implements ISource { + /** Represents a SecurityMarks. */ + class SecurityMarks implements ISecurityMarks { /** - * Constructs a new Source. + * Constructs a new SecurityMarks. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.securitycenter.v1beta1.ISource); + constructor(properties?: google.cloud.securitycenter.v1beta1.ISecurityMarks); - /** Source name. */ + /** SecurityMarks name. */ public name: string; - /** Source displayName. */ - public displayName: string; - - /** Source description. */ - public description: string; + /** SecurityMarks marks. */ + public marks: { [k: string]: string }; /** - * Creates a new Source instance using the specified properties. + * Creates a new SecurityMarks instance using the specified properties. * @param [properties] Properties to set - * @returns Source instance + * @returns SecurityMarks instance */ - public static create(properties?: google.cloud.securitycenter.v1beta1.ISource): google.cloud.securitycenter.v1beta1.Source; + public static create(properties?: google.cloud.securitycenter.v1beta1.ISecurityMarks): google.cloud.securitycenter.v1beta1.SecurityMarks; /** - * Encodes the specified Source message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.Source.verify|verify} messages. - * @param message Source message or plain object to encode + * Encodes the specified SecurityMarks message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.SecurityMarks.verify|verify} messages. + * @param message SecurityMarks message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.securitycenter.v1beta1.ISource, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.securitycenter.v1beta1.ISecurityMarks, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified Source message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.Source.verify|verify} messages. - * @param message Source message or plain object to encode + * Encodes the specified SecurityMarks message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.SecurityMarks.verify|verify} messages. + * @param message SecurityMarks message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.securitycenter.v1beta1.ISource, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.securitycenter.v1beta1.ISecurityMarks, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a Source message from the specified reader or buffer. + * Decodes a SecurityMarks message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns Source + * @returns SecurityMarks * @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.cloud.securitycenter.v1beta1.Source; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1beta1.SecurityMarks; /** - * Decodes a Source message from the specified reader or buffer, length delimited. + * Decodes a SecurityMarks message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Source + * @returns SecurityMarks * @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.cloud.securitycenter.v1beta1.Source; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1beta1.SecurityMarks; /** - * Verifies a Source message. + * Verifies a SecurityMarks 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 Source message from a plain object. Also converts values to their respective internal types. + * Creates a SecurityMarks message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Source + * @returns SecurityMarks */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1beta1.Source; + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1beta1.SecurityMarks; /** - * Creates a plain object from a Source message. Also converts values to other types if specified. - * @param message Source + * Creates a plain object from a SecurityMarks message. Also converts values to other types if specified. + * @param message SecurityMarks * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.securitycenter.v1beta1.Source, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.securitycenter.v1beta1.SecurityMarks, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Source to JSON. + * Converts this SecurityMarks to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a RunAssetDiscoveryResponse. */ - interface IRunAssetDiscoveryResponse { + /** Properties of a Finding. */ + interface IFinding { - /** RunAssetDiscoveryResponse state */ - state?: (google.cloud.securitycenter.v1beta1.RunAssetDiscoveryResponse.State|keyof typeof google.cloud.securitycenter.v1beta1.RunAssetDiscoveryResponse.State|null); + /** Finding name */ + name?: (string|null); - /** RunAssetDiscoveryResponse duration */ - duration?: (google.protobuf.IDuration|null); + /** Finding parent */ + parent?: (string|null); + + /** Finding resourceName */ + resourceName?: (string|null); + + /** Finding state */ + state?: (google.cloud.securitycenter.v1beta1.Finding.State|keyof typeof google.cloud.securitycenter.v1beta1.Finding.State|null); + + /** Finding category */ + category?: (string|null); + + /** Finding externalUri */ + externalUri?: (string|null); + + /** Finding sourceProperties */ + sourceProperties?: ({ [k: string]: google.protobuf.IValue }|null); + + /** Finding securityMarks */ + securityMarks?: (google.cloud.securitycenter.v1beta1.ISecurityMarks|null); + + /** Finding eventTime */ + eventTime?: (google.protobuf.ITimestamp|null); + + /** Finding createTime */ + createTime?: (google.protobuf.ITimestamp|null); } - /** Represents a RunAssetDiscoveryResponse. */ - class RunAssetDiscoveryResponse implements IRunAssetDiscoveryResponse { + /** Represents a Finding. */ + class Finding implements IFinding { /** - * Constructs a new RunAssetDiscoveryResponse. + * Constructs a new Finding. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.securitycenter.v1beta1.IRunAssetDiscoveryResponse); + constructor(properties?: google.cloud.securitycenter.v1beta1.IFinding); - /** RunAssetDiscoveryResponse state. */ - public state: (google.cloud.securitycenter.v1beta1.RunAssetDiscoveryResponse.State|keyof typeof google.cloud.securitycenter.v1beta1.RunAssetDiscoveryResponse.State); + /** Finding name. */ + public name: string; - /** RunAssetDiscoveryResponse duration. */ - public duration?: (google.protobuf.IDuration|null); + /** Finding parent. */ + public parent: string; + + /** Finding resourceName. */ + public resourceName: string; + + /** Finding state. */ + public state: (google.cloud.securitycenter.v1beta1.Finding.State|keyof typeof google.cloud.securitycenter.v1beta1.Finding.State); + + /** Finding category. */ + public category: string; + + /** Finding externalUri. */ + public externalUri: string; + + /** Finding sourceProperties. */ + public sourceProperties: { [k: string]: google.protobuf.IValue }; + + /** Finding securityMarks. */ + public securityMarks?: (google.cloud.securitycenter.v1beta1.ISecurityMarks|null); + + /** Finding eventTime. */ + public eventTime?: (google.protobuf.ITimestamp|null); + + /** Finding createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); /** - * Creates a new RunAssetDiscoveryResponse instance using the specified properties. + * Creates a new Finding instance using the specified properties. * @param [properties] Properties to set - * @returns RunAssetDiscoveryResponse instance + * @returns Finding instance */ - public static create(properties?: google.cloud.securitycenter.v1beta1.IRunAssetDiscoveryResponse): google.cloud.securitycenter.v1beta1.RunAssetDiscoveryResponse; + public static create(properties?: google.cloud.securitycenter.v1beta1.IFinding): google.cloud.securitycenter.v1beta1.Finding; /** - * Encodes the specified RunAssetDiscoveryResponse message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.RunAssetDiscoveryResponse.verify|verify} messages. - * @param message RunAssetDiscoveryResponse message or plain object to encode + * Encodes the specified Finding message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.Finding.verify|verify} messages. + * @param message Finding message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.securitycenter.v1beta1.IRunAssetDiscoveryResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.securitycenter.v1beta1.IFinding, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified RunAssetDiscoveryResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.RunAssetDiscoveryResponse.verify|verify} messages. - * @param message RunAssetDiscoveryResponse message or plain object to encode + * Encodes the specified Finding message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.Finding.verify|verify} messages. + * @param message Finding message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.securitycenter.v1beta1.IRunAssetDiscoveryResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.securitycenter.v1beta1.IFinding, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a RunAssetDiscoveryResponse message from the specified reader or buffer. + * Decodes a Finding message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns RunAssetDiscoveryResponse + * @returns Finding * @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.cloud.securitycenter.v1beta1.RunAssetDiscoveryResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1beta1.Finding; /** - * Decodes a RunAssetDiscoveryResponse message from the specified reader or buffer, length delimited. + * Decodes a Finding message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns RunAssetDiscoveryResponse + * @returns Finding * @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.cloud.securitycenter.v1beta1.RunAssetDiscoveryResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1beta1.Finding; /** - * Verifies a RunAssetDiscoveryResponse message. + * Verifies a Finding 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 RunAssetDiscoveryResponse message from a plain object. Also converts values to their respective internal types. + * Creates a Finding message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns RunAssetDiscoveryResponse + * @returns Finding */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1beta1.RunAssetDiscoveryResponse; + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1beta1.Finding; /** - * Creates a plain object from a RunAssetDiscoveryResponse message. Also converts values to other types if specified. - * @param message RunAssetDiscoveryResponse + * Creates a plain object from a Finding message. Also converts values to other types if specified. + * @param message Finding * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.securitycenter.v1beta1.RunAssetDiscoveryResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.securitycenter.v1beta1.Finding, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this RunAssetDiscoveryResponse to JSON. + * Converts this Finding to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - namespace RunAssetDiscoveryResponse { + namespace Finding { /** State enum. */ enum State { STATE_UNSPECIFIED = 0, - COMPLETED = 1, - SUPERSEDED = 2, - TERMINATED = 3 + ACTIVE = 1, + INACTIVE = 2 } } @@ -4903,6 +4694,113 @@ export namespace google { } } + /** Properties of a RunAssetDiscoveryResponse. */ + interface IRunAssetDiscoveryResponse { + + /** RunAssetDiscoveryResponse state */ + state?: (google.cloud.securitycenter.v1beta1.RunAssetDiscoveryResponse.State|keyof typeof google.cloud.securitycenter.v1beta1.RunAssetDiscoveryResponse.State|null); + + /** RunAssetDiscoveryResponse duration */ + duration?: (google.protobuf.IDuration|null); + } + + /** Represents a RunAssetDiscoveryResponse. */ + class RunAssetDiscoveryResponse implements IRunAssetDiscoveryResponse { + + /** + * Constructs a new RunAssetDiscoveryResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1beta1.IRunAssetDiscoveryResponse); + + /** RunAssetDiscoveryResponse state. */ + public state: (google.cloud.securitycenter.v1beta1.RunAssetDiscoveryResponse.State|keyof typeof google.cloud.securitycenter.v1beta1.RunAssetDiscoveryResponse.State); + + /** RunAssetDiscoveryResponse duration. */ + public duration?: (google.protobuf.IDuration|null); + + /** + * Creates a new RunAssetDiscoveryResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns RunAssetDiscoveryResponse instance + */ + public static create(properties?: google.cloud.securitycenter.v1beta1.IRunAssetDiscoveryResponse): google.cloud.securitycenter.v1beta1.RunAssetDiscoveryResponse; + + /** + * Encodes the specified RunAssetDiscoveryResponse message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.RunAssetDiscoveryResponse.verify|verify} messages. + * @param message RunAssetDiscoveryResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1beta1.IRunAssetDiscoveryResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RunAssetDiscoveryResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.RunAssetDiscoveryResponse.verify|verify} messages. + * @param message RunAssetDiscoveryResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1beta1.IRunAssetDiscoveryResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RunAssetDiscoveryResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RunAssetDiscoveryResponse + * @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.cloud.securitycenter.v1beta1.RunAssetDiscoveryResponse; + + /** + * Decodes a RunAssetDiscoveryResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RunAssetDiscoveryResponse + * @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.cloud.securitycenter.v1beta1.RunAssetDiscoveryResponse; + + /** + * Verifies a RunAssetDiscoveryResponse 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 RunAssetDiscoveryResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RunAssetDiscoveryResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1beta1.RunAssetDiscoveryResponse; + + /** + * Creates a plain object from a RunAssetDiscoveryResponse message. Also converts values to other types if specified. + * @param message RunAssetDiscoveryResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1beta1.RunAssetDiscoveryResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RunAssetDiscoveryResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace RunAssetDiscoveryResponse { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + COMPLETED = 1, + SUPERSEDED = 2, + TERMINATED = 3 + } + } + /** Represents a SecurityCenter */ class SecurityCenter extends $protobuf.rpc.Service { @@ -7019,7 +6917,4907 @@ export namespace google { name?: (string|null); /** SetFindingStateRequest state */ - state?: (google.cloud.securitycenter.v1beta1.Finding.State|keyof typeof google.cloud.securitycenter.v1beta1.Finding.State|null); + state?: (google.cloud.securitycenter.v1beta1.Finding.State|keyof typeof google.cloud.securitycenter.v1beta1.Finding.State|null); + + /** SetFindingStateRequest startTime */ + startTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a SetFindingStateRequest. */ + class SetFindingStateRequest implements ISetFindingStateRequest { + + /** + * Constructs a new SetFindingStateRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1beta1.ISetFindingStateRequest); + + /** SetFindingStateRequest name. */ + public name: string; + + /** SetFindingStateRequest state. */ + public state: (google.cloud.securitycenter.v1beta1.Finding.State|keyof typeof google.cloud.securitycenter.v1beta1.Finding.State); + + /** SetFindingStateRequest startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new SetFindingStateRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns SetFindingStateRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v1beta1.ISetFindingStateRequest): google.cloud.securitycenter.v1beta1.SetFindingStateRequest; + + /** + * Encodes the specified SetFindingStateRequest message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.SetFindingStateRequest.verify|verify} messages. + * @param message SetFindingStateRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1beta1.ISetFindingStateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SetFindingStateRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.SetFindingStateRequest.verify|verify} messages. + * @param message SetFindingStateRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1beta1.ISetFindingStateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SetFindingStateRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SetFindingStateRequest + * @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.cloud.securitycenter.v1beta1.SetFindingStateRequest; + + /** + * Decodes a SetFindingStateRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SetFindingStateRequest + * @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.cloud.securitycenter.v1beta1.SetFindingStateRequest; + + /** + * Verifies a SetFindingStateRequest 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 SetFindingStateRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SetFindingStateRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1beta1.SetFindingStateRequest; + + /** + * Creates a plain object from a SetFindingStateRequest message. Also converts values to other types if specified. + * @param message SetFindingStateRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1beta1.SetFindingStateRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SetFindingStateRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a RunAssetDiscoveryRequest. */ + interface IRunAssetDiscoveryRequest { + + /** RunAssetDiscoveryRequest parent */ + parent?: (string|null); + } + + /** Represents a RunAssetDiscoveryRequest. */ + class RunAssetDiscoveryRequest implements IRunAssetDiscoveryRequest { + + /** + * Constructs a new RunAssetDiscoveryRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1beta1.IRunAssetDiscoveryRequest); + + /** RunAssetDiscoveryRequest parent. */ + public parent: string; + + /** + * Creates a new RunAssetDiscoveryRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns RunAssetDiscoveryRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v1beta1.IRunAssetDiscoveryRequest): google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest; + + /** + * Encodes the specified RunAssetDiscoveryRequest message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest.verify|verify} messages. + * @param message RunAssetDiscoveryRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1beta1.IRunAssetDiscoveryRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RunAssetDiscoveryRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest.verify|verify} messages. + * @param message RunAssetDiscoveryRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1beta1.IRunAssetDiscoveryRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RunAssetDiscoveryRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RunAssetDiscoveryRequest + * @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.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest; + + /** + * Decodes a RunAssetDiscoveryRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RunAssetDiscoveryRequest + * @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.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest; + + /** + * Verifies a RunAssetDiscoveryRequest 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 RunAssetDiscoveryRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RunAssetDiscoveryRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest; + + /** + * Creates a plain object from a RunAssetDiscoveryRequest message. Also converts values to other types if specified. + * @param message RunAssetDiscoveryRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RunAssetDiscoveryRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an UpdateFindingRequest. */ + interface IUpdateFindingRequest { + + /** UpdateFindingRequest finding */ + finding?: (google.cloud.securitycenter.v1beta1.IFinding|null); + + /** UpdateFindingRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateFindingRequest. */ + class UpdateFindingRequest implements IUpdateFindingRequest { + + /** + * Constructs a new UpdateFindingRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1beta1.IUpdateFindingRequest); + + /** UpdateFindingRequest finding. */ + public finding?: (google.cloud.securitycenter.v1beta1.IFinding|null); + + /** UpdateFindingRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateFindingRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateFindingRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v1beta1.IUpdateFindingRequest): google.cloud.securitycenter.v1beta1.UpdateFindingRequest; + + /** + * Encodes the specified UpdateFindingRequest message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.UpdateFindingRequest.verify|verify} messages. + * @param message UpdateFindingRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1beta1.IUpdateFindingRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateFindingRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.UpdateFindingRequest.verify|verify} messages. + * @param message UpdateFindingRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1beta1.IUpdateFindingRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateFindingRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateFindingRequest + * @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.cloud.securitycenter.v1beta1.UpdateFindingRequest; + + /** + * Decodes an UpdateFindingRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateFindingRequest + * @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.cloud.securitycenter.v1beta1.UpdateFindingRequest; + + /** + * Verifies an UpdateFindingRequest 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 UpdateFindingRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateFindingRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1beta1.UpdateFindingRequest; + + /** + * Creates a plain object from an UpdateFindingRequest message. Also converts values to other types if specified. + * @param message UpdateFindingRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1beta1.UpdateFindingRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateFindingRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an UpdateOrganizationSettingsRequest. */ + interface IUpdateOrganizationSettingsRequest { + + /** UpdateOrganizationSettingsRequest organizationSettings */ + organizationSettings?: (google.cloud.securitycenter.v1beta1.IOrganizationSettings|null); + + /** UpdateOrganizationSettingsRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateOrganizationSettingsRequest. */ + class UpdateOrganizationSettingsRequest implements IUpdateOrganizationSettingsRequest { + + /** + * Constructs a new UpdateOrganizationSettingsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1beta1.IUpdateOrganizationSettingsRequest); + + /** UpdateOrganizationSettingsRequest organizationSettings. */ + public organizationSettings?: (google.cloud.securitycenter.v1beta1.IOrganizationSettings|null); + + /** UpdateOrganizationSettingsRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateOrganizationSettingsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateOrganizationSettingsRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v1beta1.IUpdateOrganizationSettingsRequest): google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest; + + /** + * Encodes the specified UpdateOrganizationSettingsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest.verify|verify} messages. + * @param message UpdateOrganizationSettingsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1beta1.IUpdateOrganizationSettingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateOrganizationSettingsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest.verify|verify} messages. + * @param message UpdateOrganizationSettingsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1beta1.IUpdateOrganizationSettingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateOrganizationSettingsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateOrganizationSettingsRequest + * @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.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest; + + /** + * Decodes an UpdateOrganizationSettingsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateOrganizationSettingsRequest + * @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.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest; + + /** + * Verifies an UpdateOrganizationSettingsRequest 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 UpdateOrganizationSettingsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateOrganizationSettingsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest; + + /** + * Creates a plain object from an UpdateOrganizationSettingsRequest message. Also converts values to other types if specified. + * @param message UpdateOrganizationSettingsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateOrganizationSettingsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an UpdateSourceRequest. */ + interface IUpdateSourceRequest { + + /** UpdateSourceRequest source */ + source?: (google.cloud.securitycenter.v1beta1.ISource|null); + + /** UpdateSourceRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateSourceRequest. */ + class UpdateSourceRequest implements IUpdateSourceRequest { + + /** + * Constructs a new UpdateSourceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1beta1.IUpdateSourceRequest); + + /** UpdateSourceRequest source. */ + public source?: (google.cloud.securitycenter.v1beta1.ISource|null); + + /** UpdateSourceRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateSourceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateSourceRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v1beta1.IUpdateSourceRequest): google.cloud.securitycenter.v1beta1.UpdateSourceRequest; + + /** + * Encodes the specified UpdateSourceRequest message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.UpdateSourceRequest.verify|verify} messages. + * @param message UpdateSourceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1beta1.IUpdateSourceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateSourceRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.UpdateSourceRequest.verify|verify} messages. + * @param message UpdateSourceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1beta1.IUpdateSourceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateSourceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateSourceRequest + * @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.cloud.securitycenter.v1beta1.UpdateSourceRequest; + + /** + * Decodes an UpdateSourceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateSourceRequest + * @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.cloud.securitycenter.v1beta1.UpdateSourceRequest; + + /** + * Verifies an UpdateSourceRequest 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 UpdateSourceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateSourceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1beta1.UpdateSourceRequest; + + /** + * Creates a plain object from an UpdateSourceRequest message. Also converts values to other types if specified. + * @param message UpdateSourceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1beta1.UpdateSourceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateSourceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an UpdateSecurityMarksRequest. */ + interface IUpdateSecurityMarksRequest { + + /** UpdateSecurityMarksRequest securityMarks */ + securityMarks?: (google.cloud.securitycenter.v1beta1.ISecurityMarks|null); + + /** UpdateSecurityMarksRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateSecurityMarksRequest startTime */ + startTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents an UpdateSecurityMarksRequest. */ + class UpdateSecurityMarksRequest implements IUpdateSecurityMarksRequest { + + /** + * Constructs a new UpdateSecurityMarksRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1beta1.IUpdateSecurityMarksRequest); + + /** UpdateSecurityMarksRequest securityMarks. */ + public securityMarks?: (google.cloud.securitycenter.v1beta1.ISecurityMarks|null); + + /** UpdateSecurityMarksRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateSecurityMarksRequest startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new UpdateSecurityMarksRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateSecurityMarksRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v1beta1.IUpdateSecurityMarksRequest): google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest; + + /** + * Encodes the specified UpdateSecurityMarksRequest message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest.verify|verify} messages. + * @param message UpdateSecurityMarksRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1beta1.IUpdateSecurityMarksRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateSecurityMarksRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest.verify|verify} messages. + * @param message UpdateSecurityMarksRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1beta1.IUpdateSecurityMarksRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateSecurityMarksRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateSecurityMarksRequest + * @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.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest; + + /** + * Decodes an UpdateSecurityMarksRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateSecurityMarksRequest + * @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.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest; + + /** + * Verifies an UpdateSecurityMarksRequest 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 UpdateSecurityMarksRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateSecurityMarksRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest; + + /** + * Creates a plain object from an UpdateSecurityMarksRequest message. Also converts values to other types if specified. + * @param message UpdateSecurityMarksRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateSecurityMarksRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a Source. */ + interface ISource { + + /** Source name */ + name?: (string|null); + + /** Source displayName */ + displayName?: (string|null); + + /** Source description */ + description?: (string|null); + } + + /** Represents a Source. */ + class Source implements ISource { + + /** + * Constructs a new Source. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1beta1.ISource); + + /** Source name. */ + public name: string; + + /** Source displayName. */ + public displayName: string; + + /** Source description. */ + public description: string; + + /** + * Creates a new Source instance using the specified properties. + * @param [properties] Properties to set + * @returns Source instance + */ + public static create(properties?: google.cloud.securitycenter.v1beta1.ISource): google.cloud.securitycenter.v1beta1.Source; + + /** + * Encodes the specified Source message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.Source.verify|verify} messages. + * @param message Source message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1beta1.ISource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Source message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.Source.verify|verify} messages. + * @param message Source message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1beta1.ISource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Source message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Source + * @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.cloud.securitycenter.v1beta1.Source; + + /** + * Decodes a Source message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Source + * @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.cloud.securitycenter.v1beta1.Source; + + /** + * Verifies a Source 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 Source message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Source + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1beta1.Source; + + /** + * Creates a plain object from a Source message. Also converts values to other types if specified. + * @param message Source + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1beta1.Source, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Source to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** Namespace v1p1beta1. */ + namespace v1p1beta1 { + + /** Properties of an Asset. */ + interface IAsset { + + /** Asset name */ + name?: (string|null); + + /** Asset securityCenterProperties */ + securityCenterProperties?: (google.cloud.securitycenter.v1p1beta1.Asset.ISecurityCenterProperties|null); + + /** Asset resourceProperties */ + resourceProperties?: ({ [k: string]: google.protobuf.IValue }|null); + + /** Asset securityMarks */ + securityMarks?: (google.cloud.securitycenter.v1p1beta1.ISecurityMarks|null); + + /** Asset createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Asset updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** Asset iamPolicy */ + iamPolicy?: (google.cloud.securitycenter.v1p1beta1.Asset.IIamPolicy|null); + } + + /** Represents an Asset. */ + class Asset implements IAsset { + + /** + * Constructs a new Asset. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1p1beta1.IAsset); + + /** Asset name. */ + public name: string; + + /** Asset securityCenterProperties. */ + public securityCenterProperties?: (google.cloud.securitycenter.v1p1beta1.Asset.ISecurityCenterProperties|null); + + /** Asset resourceProperties. */ + public resourceProperties: { [k: string]: google.protobuf.IValue }; + + /** Asset securityMarks. */ + public securityMarks?: (google.cloud.securitycenter.v1p1beta1.ISecurityMarks|null); + + /** Asset createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Asset updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** Asset iamPolicy. */ + public iamPolicy?: (google.cloud.securitycenter.v1p1beta1.Asset.IIamPolicy|null); + + /** + * Creates a new Asset instance using the specified properties. + * @param [properties] Properties to set + * @returns Asset instance + */ + public static create(properties?: google.cloud.securitycenter.v1p1beta1.IAsset): google.cloud.securitycenter.v1p1beta1.Asset; + + /** + * Encodes the specified Asset message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.Asset.verify|verify} messages. + * @param message Asset message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1p1beta1.IAsset, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Asset message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.Asset.verify|verify} messages. + * @param message Asset message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1p1beta1.IAsset, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Asset message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Asset + * @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.cloud.securitycenter.v1p1beta1.Asset; + + /** + * Decodes an Asset message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Asset + * @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.cloud.securitycenter.v1p1beta1.Asset; + + /** + * Verifies an Asset 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 Asset message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Asset + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1p1beta1.Asset; + + /** + * Creates a plain object from an Asset message. Also converts values to other types if specified. + * @param message Asset + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1p1beta1.Asset, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Asset to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace Asset { + + /** Properties of a SecurityCenterProperties. */ + interface ISecurityCenterProperties { + + /** SecurityCenterProperties resourceName */ + resourceName?: (string|null); + + /** SecurityCenterProperties resourceType */ + resourceType?: (string|null); + + /** SecurityCenterProperties resourceParent */ + resourceParent?: (string|null); + + /** SecurityCenterProperties resourceProject */ + resourceProject?: (string|null); + + /** SecurityCenterProperties resourceOwners */ + resourceOwners?: (string[]|null); + + /** SecurityCenterProperties resourceDisplayName */ + resourceDisplayName?: (string|null); + + /** SecurityCenterProperties resourceParentDisplayName */ + resourceParentDisplayName?: (string|null); + + /** SecurityCenterProperties resourceProjectDisplayName */ + resourceProjectDisplayName?: (string|null); + } + + /** Represents a SecurityCenterProperties. */ + class SecurityCenterProperties implements ISecurityCenterProperties { + + /** + * Constructs a new SecurityCenterProperties. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1p1beta1.Asset.ISecurityCenterProperties); + + /** SecurityCenterProperties resourceName. */ + public resourceName: string; + + /** SecurityCenterProperties resourceType. */ + public resourceType: string; + + /** SecurityCenterProperties resourceParent. */ + public resourceParent: string; + + /** SecurityCenterProperties resourceProject. */ + public resourceProject: string; + + /** SecurityCenterProperties resourceOwners. */ + public resourceOwners: string[]; + + /** SecurityCenterProperties resourceDisplayName. */ + public resourceDisplayName: string; + + /** SecurityCenterProperties resourceParentDisplayName. */ + public resourceParentDisplayName: string; + + /** SecurityCenterProperties resourceProjectDisplayName. */ + public resourceProjectDisplayName: string; + + /** + * Creates a new SecurityCenterProperties instance using the specified properties. + * @param [properties] Properties to set + * @returns SecurityCenterProperties instance + */ + public static create(properties?: google.cloud.securitycenter.v1p1beta1.Asset.ISecurityCenterProperties): google.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterProperties; + + /** + * Encodes the specified SecurityCenterProperties message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterProperties.verify|verify} messages. + * @param message SecurityCenterProperties message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1p1beta1.Asset.ISecurityCenterProperties, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SecurityCenterProperties message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterProperties.verify|verify} messages. + * @param message SecurityCenterProperties message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1p1beta1.Asset.ISecurityCenterProperties, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SecurityCenterProperties message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SecurityCenterProperties + * @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.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterProperties; + + /** + * Decodes a SecurityCenterProperties message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SecurityCenterProperties + * @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.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterProperties; + + /** + * Verifies a SecurityCenterProperties 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 SecurityCenterProperties message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SecurityCenterProperties + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterProperties; + + /** + * Creates a plain object from a SecurityCenterProperties message. Also converts values to other types if specified. + * @param message SecurityCenterProperties + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterProperties, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SecurityCenterProperties to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an IamPolicy. */ + interface IIamPolicy { + + /** IamPolicy policyBlob */ + policyBlob?: (string|null); + } + + /** Represents an IamPolicy. */ + class IamPolicy implements IIamPolicy { + + /** + * Constructs a new IamPolicy. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1p1beta1.Asset.IIamPolicy); + + /** IamPolicy policyBlob. */ + public policyBlob: string; + + /** + * Creates a new IamPolicy instance using the specified properties. + * @param [properties] Properties to set + * @returns IamPolicy instance + */ + public static create(properties?: google.cloud.securitycenter.v1p1beta1.Asset.IIamPolicy): google.cloud.securitycenter.v1p1beta1.Asset.IamPolicy; + + /** + * Encodes the specified IamPolicy message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.Asset.IamPolicy.verify|verify} messages. + * @param message IamPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1p1beta1.Asset.IIamPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified IamPolicy message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.Asset.IamPolicy.verify|verify} messages. + * @param message IamPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1p1beta1.Asset.IIamPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an IamPolicy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns IamPolicy + * @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.cloud.securitycenter.v1p1beta1.Asset.IamPolicy; + + /** + * Decodes an IamPolicy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns IamPolicy + * @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.cloud.securitycenter.v1p1beta1.Asset.IamPolicy; + + /** + * Verifies an IamPolicy 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 IamPolicy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns IamPolicy + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1p1beta1.Asset.IamPolicy; + + /** + * Creates a plain object from an IamPolicy message. Also converts values to other types if specified. + * @param message IamPolicy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1p1beta1.Asset.IamPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this IamPolicy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** Properties of a SecurityMarks. */ + interface ISecurityMarks { + + /** SecurityMarks name */ + name?: (string|null); + + /** SecurityMarks marks */ + marks?: ({ [k: string]: string }|null); + } + + /** Represents a SecurityMarks. */ + class SecurityMarks implements ISecurityMarks { + + /** + * Constructs a new SecurityMarks. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1p1beta1.ISecurityMarks); + + /** SecurityMarks name. */ + public name: string; + + /** SecurityMarks marks. */ + public marks: { [k: string]: string }; + + /** + * Creates a new SecurityMarks instance using the specified properties. + * @param [properties] Properties to set + * @returns SecurityMarks instance + */ + public static create(properties?: google.cloud.securitycenter.v1p1beta1.ISecurityMarks): google.cloud.securitycenter.v1p1beta1.SecurityMarks; + + /** + * Encodes the specified SecurityMarks message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.SecurityMarks.verify|verify} messages. + * @param message SecurityMarks message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1p1beta1.ISecurityMarks, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SecurityMarks message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.SecurityMarks.verify|verify} messages. + * @param message SecurityMarks message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1p1beta1.ISecurityMarks, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SecurityMarks message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SecurityMarks + * @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.cloud.securitycenter.v1p1beta1.SecurityMarks; + + /** + * Decodes a SecurityMarks message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SecurityMarks + * @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.cloud.securitycenter.v1p1beta1.SecurityMarks; + + /** + * Verifies a SecurityMarks 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 SecurityMarks message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SecurityMarks + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1p1beta1.SecurityMarks; + + /** + * Creates a plain object from a SecurityMarks message. Also converts values to other types if specified. + * @param message SecurityMarks + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1p1beta1.SecurityMarks, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SecurityMarks to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a Finding. */ + interface IFinding { + + /** Finding name */ + name?: (string|null); + + /** Finding parent */ + parent?: (string|null); + + /** Finding resourceName */ + resourceName?: (string|null); + + /** Finding state */ + state?: (google.cloud.securitycenter.v1p1beta1.Finding.State|keyof typeof google.cloud.securitycenter.v1p1beta1.Finding.State|null); + + /** Finding category */ + category?: (string|null); + + /** Finding externalUri */ + externalUri?: (string|null); + + /** Finding sourceProperties */ + sourceProperties?: ({ [k: string]: google.protobuf.IValue }|null); + + /** Finding securityMarks */ + securityMarks?: (google.cloud.securitycenter.v1p1beta1.ISecurityMarks|null); + + /** Finding eventTime */ + eventTime?: (google.protobuf.ITimestamp|null); + + /** Finding createTime */ + createTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a Finding. */ + class Finding implements IFinding { + + /** + * Constructs a new Finding. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1p1beta1.IFinding); + + /** Finding name. */ + public name: string; + + /** Finding parent. */ + public parent: string; + + /** Finding resourceName. */ + public resourceName: string; + + /** Finding state. */ + public state: (google.cloud.securitycenter.v1p1beta1.Finding.State|keyof typeof google.cloud.securitycenter.v1p1beta1.Finding.State); + + /** Finding category. */ + public category: string; + + /** Finding externalUri. */ + public externalUri: string; + + /** Finding sourceProperties. */ + public sourceProperties: { [k: string]: google.protobuf.IValue }; + + /** Finding securityMarks. */ + public securityMarks?: (google.cloud.securitycenter.v1p1beta1.ISecurityMarks|null); + + /** Finding eventTime. */ + public eventTime?: (google.protobuf.ITimestamp|null); + + /** Finding createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new Finding instance using the specified properties. + * @param [properties] Properties to set + * @returns Finding instance + */ + public static create(properties?: google.cloud.securitycenter.v1p1beta1.IFinding): google.cloud.securitycenter.v1p1beta1.Finding; + + /** + * Encodes the specified Finding message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.Finding.verify|verify} messages. + * @param message Finding message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1p1beta1.IFinding, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Finding message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.Finding.verify|verify} messages. + * @param message Finding message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1p1beta1.IFinding, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Finding message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Finding + * @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.cloud.securitycenter.v1p1beta1.Finding; + + /** + * Decodes a Finding message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Finding + * @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.cloud.securitycenter.v1p1beta1.Finding; + + /** + * Verifies a Finding 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 Finding message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Finding + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1p1beta1.Finding; + + /** + * Creates a plain object from a Finding message. Also converts values to other types if specified. + * @param message Finding + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1p1beta1.Finding, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Finding to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace Finding { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + ACTIVE = 1, + INACTIVE = 2 + } + } + + /** Properties of a NotificationConfig. */ + interface INotificationConfig { + + /** NotificationConfig name */ + name?: (string|null); + + /** NotificationConfig description */ + description?: (string|null); + + /** NotificationConfig eventType */ + eventType?: (google.cloud.securitycenter.v1p1beta1.NotificationConfig.EventType|keyof typeof google.cloud.securitycenter.v1p1beta1.NotificationConfig.EventType|null); + + /** NotificationConfig pubsubTopic */ + pubsubTopic?: (string|null); + + /** NotificationConfig serviceAccount */ + serviceAccount?: (string|null); + + /** NotificationConfig streamingConfig */ + streamingConfig?: (google.cloud.securitycenter.v1p1beta1.NotificationConfig.IStreamingConfig|null); + } + + /** Represents a NotificationConfig. */ + class NotificationConfig implements INotificationConfig { + + /** + * Constructs a new NotificationConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1p1beta1.INotificationConfig); + + /** NotificationConfig name. */ + public name: string; + + /** NotificationConfig description. */ + public description: string; + + /** NotificationConfig eventType. */ + public eventType: (google.cloud.securitycenter.v1p1beta1.NotificationConfig.EventType|keyof typeof google.cloud.securitycenter.v1p1beta1.NotificationConfig.EventType); + + /** NotificationConfig pubsubTopic. */ + public pubsubTopic: string; + + /** NotificationConfig serviceAccount. */ + public serviceAccount: string; + + /** NotificationConfig streamingConfig. */ + public streamingConfig?: (google.cloud.securitycenter.v1p1beta1.NotificationConfig.IStreamingConfig|null); + + /** NotificationConfig notifyConfig. */ + public notifyConfig?: "streamingConfig"; + + /** + * Creates a new NotificationConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns NotificationConfig instance + */ + public static create(properties?: google.cloud.securitycenter.v1p1beta1.INotificationConfig): google.cloud.securitycenter.v1p1beta1.NotificationConfig; + + /** + * Encodes the specified NotificationConfig message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.NotificationConfig.verify|verify} messages. + * @param message NotificationConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1p1beta1.INotificationConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NotificationConfig message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.NotificationConfig.verify|verify} messages. + * @param message NotificationConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1p1beta1.INotificationConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NotificationConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NotificationConfig + * @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.cloud.securitycenter.v1p1beta1.NotificationConfig; + + /** + * Decodes a NotificationConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NotificationConfig + * @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.cloud.securitycenter.v1p1beta1.NotificationConfig; + + /** + * Verifies a NotificationConfig 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 NotificationConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NotificationConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1p1beta1.NotificationConfig; + + /** + * Creates a plain object from a NotificationConfig message. Also converts values to other types if specified. + * @param message NotificationConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1p1beta1.NotificationConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NotificationConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace NotificationConfig { + + /** Properties of a StreamingConfig. */ + interface IStreamingConfig { + + /** StreamingConfig filter */ + filter?: (string|null); + } + + /** Represents a StreamingConfig. */ + class StreamingConfig implements IStreamingConfig { + + /** + * Constructs a new StreamingConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1p1beta1.NotificationConfig.IStreamingConfig); + + /** StreamingConfig filter. */ + public filter: string; + + /** + * Creates a new StreamingConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns StreamingConfig instance + */ + public static create(properties?: google.cloud.securitycenter.v1p1beta1.NotificationConfig.IStreamingConfig): google.cloud.securitycenter.v1p1beta1.NotificationConfig.StreamingConfig; + + /** + * Encodes the specified StreamingConfig message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.NotificationConfig.StreamingConfig.verify|verify} messages. + * @param message StreamingConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1p1beta1.NotificationConfig.IStreamingConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StreamingConfig message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.NotificationConfig.StreamingConfig.verify|verify} messages. + * @param message StreamingConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1p1beta1.NotificationConfig.IStreamingConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StreamingConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StreamingConfig + * @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.cloud.securitycenter.v1p1beta1.NotificationConfig.StreamingConfig; + + /** + * Decodes a StreamingConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StreamingConfig + * @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.cloud.securitycenter.v1p1beta1.NotificationConfig.StreamingConfig; + + /** + * Verifies a StreamingConfig 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 StreamingConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StreamingConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1p1beta1.NotificationConfig.StreamingConfig; + + /** + * Creates a plain object from a StreamingConfig message. Also converts values to other types if specified. + * @param message StreamingConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1p1beta1.NotificationConfig.StreamingConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StreamingConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** EventType enum. */ + enum EventType { + EVENT_TYPE_UNSPECIFIED = 0, + FINDING = 1 + } + } + + /** Properties of a NotificationMessage. */ + interface INotificationMessage { + + /** NotificationMessage notificationConfigName */ + notificationConfigName?: (string|null); + + /** NotificationMessage finding */ + finding?: (google.cloud.securitycenter.v1p1beta1.IFinding|null); + } + + /** Represents a NotificationMessage. */ + class NotificationMessage implements INotificationMessage { + + /** + * Constructs a new NotificationMessage. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1p1beta1.INotificationMessage); + + /** NotificationMessage notificationConfigName. */ + public notificationConfigName: string; + + /** NotificationMessage finding. */ + public finding?: (google.cloud.securitycenter.v1p1beta1.IFinding|null); + + /** NotificationMessage event. */ + public event?: "finding"; + + /** + * Creates a new NotificationMessage instance using the specified properties. + * @param [properties] Properties to set + * @returns NotificationMessage instance + */ + public static create(properties?: google.cloud.securitycenter.v1p1beta1.INotificationMessage): google.cloud.securitycenter.v1p1beta1.NotificationMessage; + + /** + * Encodes the specified NotificationMessage message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.NotificationMessage.verify|verify} messages. + * @param message NotificationMessage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1p1beta1.INotificationMessage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NotificationMessage message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.NotificationMessage.verify|verify} messages. + * @param message NotificationMessage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1p1beta1.INotificationMessage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NotificationMessage message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NotificationMessage + * @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.cloud.securitycenter.v1p1beta1.NotificationMessage; + + /** + * Decodes a NotificationMessage message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NotificationMessage + * @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.cloud.securitycenter.v1p1beta1.NotificationMessage; + + /** + * Verifies a NotificationMessage 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 NotificationMessage message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NotificationMessage + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1p1beta1.NotificationMessage; + + /** + * Creates a plain object from a NotificationMessage message. Also converts values to other types if specified. + * @param message NotificationMessage + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1p1beta1.NotificationMessage, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NotificationMessage to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an OrganizationSettings. */ + interface IOrganizationSettings { + + /** OrganizationSettings name */ + name?: (string|null); + + /** OrganizationSettings enableAssetDiscovery */ + enableAssetDiscovery?: (boolean|null); + + /** OrganizationSettings assetDiscoveryConfig */ + assetDiscoveryConfig?: (google.cloud.securitycenter.v1p1beta1.OrganizationSettings.IAssetDiscoveryConfig|null); + } + + /** Represents an OrganizationSettings. */ + class OrganizationSettings implements IOrganizationSettings { + + /** + * Constructs a new OrganizationSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1p1beta1.IOrganizationSettings); + + /** OrganizationSettings name. */ + public name: string; + + /** OrganizationSettings enableAssetDiscovery. */ + public enableAssetDiscovery: boolean; + + /** OrganizationSettings assetDiscoveryConfig. */ + public assetDiscoveryConfig?: (google.cloud.securitycenter.v1p1beta1.OrganizationSettings.IAssetDiscoveryConfig|null); + + /** + * Creates a new OrganizationSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns OrganizationSettings instance + */ + public static create(properties?: google.cloud.securitycenter.v1p1beta1.IOrganizationSettings): google.cloud.securitycenter.v1p1beta1.OrganizationSettings; + + /** + * Encodes the specified OrganizationSettings message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.OrganizationSettings.verify|verify} messages. + * @param message OrganizationSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1p1beta1.IOrganizationSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OrganizationSettings message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.OrganizationSettings.verify|verify} messages. + * @param message OrganizationSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1p1beta1.IOrganizationSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OrganizationSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OrganizationSettings + * @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.cloud.securitycenter.v1p1beta1.OrganizationSettings; + + /** + * Decodes an OrganizationSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OrganizationSettings + * @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.cloud.securitycenter.v1p1beta1.OrganizationSettings; + + /** + * Verifies an OrganizationSettings 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 OrganizationSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OrganizationSettings + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1p1beta1.OrganizationSettings; + + /** + * Creates a plain object from an OrganizationSettings message. Also converts values to other types if specified. + * @param message OrganizationSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1p1beta1.OrganizationSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OrganizationSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace OrganizationSettings { + + /** Properties of an AssetDiscoveryConfig. */ + interface IAssetDiscoveryConfig { + + /** AssetDiscoveryConfig projectIds */ + projectIds?: (string[]|null); + + /** AssetDiscoveryConfig inclusionMode */ + inclusionMode?: (google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode|keyof typeof google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode|null); + } + + /** Represents an AssetDiscoveryConfig. */ + class AssetDiscoveryConfig implements IAssetDiscoveryConfig { + + /** + * Constructs a new AssetDiscoveryConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1p1beta1.OrganizationSettings.IAssetDiscoveryConfig); + + /** AssetDiscoveryConfig projectIds. */ + public projectIds: string[]; + + /** AssetDiscoveryConfig inclusionMode. */ + public inclusionMode: (google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode|keyof typeof google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode); + + /** + * Creates a new AssetDiscoveryConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns AssetDiscoveryConfig instance + */ + public static create(properties?: google.cloud.securitycenter.v1p1beta1.OrganizationSettings.IAssetDiscoveryConfig): google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig; + + /** + * Encodes the specified AssetDiscoveryConfig message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig.verify|verify} messages. + * @param message AssetDiscoveryConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1p1beta1.OrganizationSettings.IAssetDiscoveryConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AssetDiscoveryConfig message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig.verify|verify} messages. + * @param message AssetDiscoveryConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1p1beta1.OrganizationSettings.IAssetDiscoveryConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AssetDiscoveryConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AssetDiscoveryConfig + * @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.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig; + + /** + * Decodes an AssetDiscoveryConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AssetDiscoveryConfig + * @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.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig; + + /** + * Verifies an AssetDiscoveryConfig 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 AssetDiscoveryConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AssetDiscoveryConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig; + + /** + * Creates a plain object from an AssetDiscoveryConfig message. Also converts values to other types if specified. + * @param message AssetDiscoveryConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AssetDiscoveryConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace AssetDiscoveryConfig { + + /** InclusionMode enum. */ + enum InclusionMode { + INCLUSION_MODE_UNSPECIFIED = 0, + INCLUDE_ONLY = 1, + EXCLUDE = 2 + } + } + } + + /** Properties of a RunAssetDiscoveryResponse. */ + interface IRunAssetDiscoveryResponse { + + /** RunAssetDiscoveryResponse state */ + state?: (google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse.State|keyof typeof google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse.State|null); + + /** RunAssetDiscoveryResponse duration */ + duration?: (google.protobuf.IDuration|null); + } + + /** Represents a RunAssetDiscoveryResponse. */ + class RunAssetDiscoveryResponse implements IRunAssetDiscoveryResponse { + + /** + * Constructs a new RunAssetDiscoveryResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1p1beta1.IRunAssetDiscoveryResponse); + + /** RunAssetDiscoveryResponse state. */ + public state: (google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse.State|keyof typeof google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse.State); + + /** RunAssetDiscoveryResponse duration. */ + public duration?: (google.protobuf.IDuration|null); + + /** + * Creates a new RunAssetDiscoveryResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns RunAssetDiscoveryResponse instance + */ + public static create(properties?: google.cloud.securitycenter.v1p1beta1.IRunAssetDiscoveryResponse): google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse; + + /** + * Encodes the specified RunAssetDiscoveryResponse message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse.verify|verify} messages. + * @param message RunAssetDiscoveryResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1p1beta1.IRunAssetDiscoveryResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RunAssetDiscoveryResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse.verify|verify} messages. + * @param message RunAssetDiscoveryResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1p1beta1.IRunAssetDiscoveryResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RunAssetDiscoveryResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RunAssetDiscoveryResponse + * @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.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse; + + /** + * Decodes a RunAssetDiscoveryResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RunAssetDiscoveryResponse + * @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.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse; + + /** + * Verifies a RunAssetDiscoveryResponse 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 RunAssetDiscoveryResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RunAssetDiscoveryResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse; + + /** + * Creates a plain object from a RunAssetDiscoveryResponse message. Also converts values to other types if specified. + * @param message RunAssetDiscoveryResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RunAssetDiscoveryResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace RunAssetDiscoveryResponse { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + COMPLETED = 1, + SUPERSEDED = 2, + TERMINATED = 3 + } + } + + /** Represents a SecurityCenter */ + class SecurityCenter extends $protobuf.rpc.Service { + + /** + * Constructs a new SecurityCenter 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 SecurityCenter 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): SecurityCenter; + + /** + * Calls CreateSource. + * @param request CreateSourceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Source + */ + public createSource(request: google.cloud.securitycenter.v1p1beta1.ICreateSourceRequest, callback: google.cloud.securitycenter.v1p1beta1.SecurityCenter.CreateSourceCallback): void; + + /** + * Calls CreateSource. + * @param request CreateSourceRequest message or plain object + * @returns Promise + */ + public createSource(request: google.cloud.securitycenter.v1p1beta1.ICreateSourceRequest): Promise; + + /** + * Calls CreateFinding. + * @param request CreateFindingRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Finding + */ + public createFinding(request: google.cloud.securitycenter.v1p1beta1.ICreateFindingRequest, callback: google.cloud.securitycenter.v1p1beta1.SecurityCenter.CreateFindingCallback): void; + + /** + * Calls CreateFinding. + * @param request CreateFindingRequest message or plain object + * @returns Promise + */ + public createFinding(request: google.cloud.securitycenter.v1p1beta1.ICreateFindingRequest): Promise; + + /** + * Calls CreateNotificationConfig. + * @param request CreateNotificationConfigRequest message or plain object + * @param callback Node-style callback called with the error, if any, and NotificationConfig + */ + public createNotificationConfig(request: google.cloud.securitycenter.v1p1beta1.ICreateNotificationConfigRequest, callback: google.cloud.securitycenter.v1p1beta1.SecurityCenter.CreateNotificationConfigCallback): void; + + /** + * Calls CreateNotificationConfig. + * @param request CreateNotificationConfigRequest message or plain object + * @returns Promise + */ + public createNotificationConfig(request: google.cloud.securitycenter.v1p1beta1.ICreateNotificationConfigRequest): Promise; + + /** + * Calls DeleteNotificationConfig. + * @param request DeleteNotificationConfigRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteNotificationConfig(request: google.cloud.securitycenter.v1p1beta1.IDeleteNotificationConfigRequest, callback: google.cloud.securitycenter.v1p1beta1.SecurityCenter.DeleteNotificationConfigCallback): void; + + /** + * Calls DeleteNotificationConfig. + * @param request DeleteNotificationConfigRequest message or plain object + * @returns Promise + */ + public deleteNotificationConfig(request: google.cloud.securitycenter.v1p1beta1.IDeleteNotificationConfigRequest): Promise; + + /** + * Calls GetIamPolicy. + * @param request GetIamPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Policy + */ + public getIamPolicy(request: google.iam.v1.IGetIamPolicyRequest, callback: google.cloud.securitycenter.v1p1beta1.SecurityCenter.GetIamPolicyCallback): void; + + /** + * Calls GetIamPolicy. + * @param request GetIamPolicyRequest message or plain object + * @returns Promise + */ + public getIamPolicy(request: google.iam.v1.IGetIamPolicyRequest): Promise; + + /** + * Calls GetNotificationConfig. + * @param request GetNotificationConfigRequest message or plain object + * @param callback Node-style callback called with the error, if any, and NotificationConfig + */ + public getNotificationConfig(request: google.cloud.securitycenter.v1p1beta1.IGetNotificationConfigRequest, callback: google.cloud.securitycenter.v1p1beta1.SecurityCenter.GetNotificationConfigCallback): void; + + /** + * Calls GetNotificationConfig. + * @param request GetNotificationConfigRequest message or plain object + * @returns Promise + */ + public getNotificationConfig(request: google.cloud.securitycenter.v1p1beta1.IGetNotificationConfigRequest): Promise; + + /** + * Calls GetOrganizationSettings. + * @param request GetOrganizationSettingsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and OrganizationSettings + */ + public getOrganizationSettings(request: google.cloud.securitycenter.v1p1beta1.IGetOrganizationSettingsRequest, callback: google.cloud.securitycenter.v1p1beta1.SecurityCenter.GetOrganizationSettingsCallback): void; + + /** + * Calls GetOrganizationSettings. + * @param request GetOrganizationSettingsRequest message or plain object + * @returns Promise + */ + public getOrganizationSettings(request: google.cloud.securitycenter.v1p1beta1.IGetOrganizationSettingsRequest): Promise; + + /** + * Calls GetSource. + * @param request GetSourceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Source + */ + public getSource(request: google.cloud.securitycenter.v1p1beta1.IGetSourceRequest, callback: google.cloud.securitycenter.v1p1beta1.SecurityCenter.GetSourceCallback): void; + + /** + * Calls GetSource. + * @param request GetSourceRequest message or plain object + * @returns Promise + */ + public getSource(request: google.cloud.securitycenter.v1p1beta1.IGetSourceRequest): Promise; + + /** + * Calls GroupAssets. + * @param request GroupAssetsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and GroupAssetsResponse + */ + public groupAssets(request: google.cloud.securitycenter.v1p1beta1.IGroupAssetsRequest, callback: google.cloud.securitycenter.v1p1beta1.SecurityCenter.GroupAssetsCallback): void; + + /** + * Calls GroupAssets. + * @param request GroupAssetsRequest message or plain object + * @returns Promise + */ + public groupAssets(request: google.cloud.securitycenter.v1p1beta1.IGroupAssetsRequest): Promise; + + /** + * Calls GroupFindings. + * @param request GroupFindingsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and GroupFindingsResponse + */ + public groupFindings(request: google.cloud.securitycenter.v1p1beta1.IGroupFindingsRequest, callback: google.cloud.securitycenter.v1p1beta1.SecurityCenter.GroupFindingsCallback): void; + + /** + * Calls GroupFindings. + * @param request GroupFindingsRequest message or plain object + * @returns Promise + */ + public groupFindings(request: google.cloud.securitycenter.v1p1beta1.IGroupFindingsRequest): Promise; + + /** + * Calls ListAssets. + * @param request ListAssetsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListAssetsResponse + */ + public listAssets(request: google.cloud.securitycenter.v1p1beta1.IListAssetsRequest, callback: google.cloud.securitycenter.v1p1beta1.SecurityCenter.ListAssetsCallback): void; + + /** + * Calls ListAssets. + * @param request ListAssetsRequest message or plain object + * @returns Promise + */ + public listAssets(request: google.cloud.securitycenter.v1p1beta1.IListAssetsRequest): Promise; + + /** + * Calls ListFindings. + * @param request ListFindingsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListFindingsResponse + */ + public listFindings(request: google.cloud.securitycenter.v1p1beta1.IListFindingsRequest, callback: google.cloud.securitycenter.v1p1beta1.SecurityCenter.ListFindingsCallback): void; + + /** + * Calls ListFindings. + * @param request ListFindingsRequest message or plain object + * @returns Promise + */ + public listFindings(request: google.cloud.securitycenter.v1p1beta1.IListFindingsRequest): Promise; + + /** + * Calls ListNotificationConfigs. + * @param request ListNotificationConfigsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListNotificationConfigsResponse + */ + public listNotificationConfigs(request: google.cloud.securitycenter.v1p1beta1.IListNotificationConfigsRequest, callback: google.cloud.securitycenter.v1p1beta1.SecurityCenter.ListNotificationConfigsCallback): void; + + /** + * Calls ListNotificationConfigs. + * @param request ListNotificationConfigsRequest message or plain object + * @returns Promise + */ + public listNotificationConfigs(request: google.cloud.securitycenter.v1p1beta1.IListNotificationConfigsRequest): Promise; + + /** + * Calls ListSources. + * @param request ListSourcesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListSourcesResponse + */ + public listSources(request: google.cloud.securitycenter.v1p1beta1.IListSourcesRequest, callback: google.cloud.securitycenter.v1p1beta1.SecurityCenter.ListSourcesCallback): void; + + /** + * Calls ListSources. + * @param request ListSourcesRequest message or plain object + * @returns Promise + */ + public listSources(request: google.cloud.securitycenter.v1p1beta1.IListSourcesRequest): Promise; + + /** + * Calls RunAssetDiscovery. + * @param request RunAssetDiscoveryRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public runAssetDiscovery(request: google.cloud.securitycenter.v1p1beta1.IRunAssetDiscoveryRequest, callback: google.cloud.securitycenter.v1p1beta1.SecurityCenter.RunAssetDiscoveryCallback): void; + + /** + * Calls RunAssetDiscovery. + * @param request RunAssetDiscoveryRequest message or plain object + * @returns Promise + */ + public runAssetDiscovery(request: google.cloud.securitycenter.v1p1beta1.IRunAssetDiscoveryRequest): Promise; + + /** + * Calls SetFindingState. + * @param request SetFindingStateRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Finding + */ + public setFindingState(request: google.cloud.securitycenter.v1p1beta1.ISetFindingStateRequest, callback: google.cloud.securitycenter.v1p1beta1.SecurityCenter.SetFindingStateCallback): void; + + /** + * Calls SetFindingState. + * @param request SetFindingStateRequest message or plain object + * @returns Promise + */ + public setFindingState(request: google.cloud.securitycenter.v1p1beta1.ISetFindingStateRequest): Promise; + + /** + * Calls SetIamPolicy. + * @param request SetIamPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Policy + */ + public setIamPolicy(request: google.iam.v1.ISetIamPolicyRequest, callback: google.cloud.securitycenter.v1p1beta1.SecurityCenter.SetIamPolicyCallback): void; + + /** + * Calls SetIamPolicy. + * @param request SetIamPolicyRequest message or plain object + * @returns Promise + */ + public setIamPolicy(request: google.iam.v1.ISetIamPolicyRequest): Promise; + + /** + * Calls TestIamPermissions. + * @param request TestIamPermissionsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and TestIamPermissionsResponse + */ + public testIamPermissions(request: google.iam.v1.ITestIamPermissionsRequest, callback: google.cloud.securitycenter.v1p1beta1.SecurityCenter.TestIamPermissionsCallback): void; + + /** + * Calls TestIamPermissions. + * @param request TestIamPermissionsRequest message or plain object + * @returns Promise + */ + public testIamPermissions(request: google.iam.v1.ITestIamPermissionsRequest): Promise; + + /** + * Calls UpdateFinding. + * @param request UpdateFindingRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Finding + */ + public updateFinding(request: google.cloud.securitycenter.v1p1beta1.IUpdateFindingRequest, callback: google.cloud.securitycenter.v1p1beta1.SecurityCenter.UpdateFindingCallback): void; + + /** + * Calls UpdateFinding. + * @param request UpdateFindingRequest message or plain object + * @returns Promise + */ + public updateFinding(request: google.cloud.securitycenter.v1p1beta1.IUpdateFindingRequest): Promise; + + /** + * Calls UpdateNotificationConfig. + * @param request UpdateNotificationConfigRequest message or plain object + * @param callback Node-style callback called with the error, if any, and NotificationConfig + */ + public updateNotificationConfig(request: google.cloud.securitycenter.v1p1beta1.IUpdateNotificationConfigRequest, callback: google.cloud.securitycenter.v1p1beta1.SecurityCenter.UpdateNotificationConfigCallback): void; + + /** + * Calls UpdateNotificationConfig. + * @param request UpdateNotificationConfigRequest message or plain object + * @returns Promise + */ + public updateNotificationConfig(request: google.cloud.securitycenter.v1p1beta1.IUpdateNotificationConfigRequest): Promise; + + /** + * Calls UpdateOrganizationSettings. + * @param request UpdateOrganizationSettingsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and OrganizationSettings + */ + public updateOrganizationSettings(request: google.cloud.securitycenter.v1p1beta1.IUpdateOrganizationSettingsRequest, callback: google.cloud.securitycenter.v1p1beta1.SecurityCenter.UpdateOrganizationSettingsCallback): void; + + /** + * Calls UpdateOrganizationSettings. + * @param request UpdateOrganizationSettingsRequest message or plain object + * @returns Promise + */ + public updateOrganizationSettings(request: google.cloud.securitycenter.v1p1beta1.IUpdateOrganizationSettingsRequest): Promise; + + /** + * Calls UpdateSource. + * @param request UpdateSourceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Source + */ + public updateSource(request: google.cloud.securitycenter.v1p1beta1.IUpdateSourceRequest, callback: google.cloud.securitycenter.v1p1beta1.SecurityCenter.UpdateSourceCallback): void; + + /** + * Calls UpdateSource. + * @param request UpdateSourceRequest message or plain object + * @returns Promise + */ + public updateSource(request: google.cloud.securitycenter.v1p1beta1.IUpdateSourceRequest): Promise; + + /** + * Calls UpdateSecurityMarks. + * @param request UpdateSecurityMarksRequest message or plain object + * @param callback Node-style callback called with the error, if any, and SecurityMarks + */ + public updateSecurityMarks(request: google.cloud.securitycenter.v1p1beta1.IUpdateSecurityMarksRequest, callback: google.cloud.securitycenter.v1p1beta1.SecurityCenter.UpdateSecurityMarksCallback): void; + + /** + * Calls UpdateSecurityMarks. + * @param request UpdateSecurityMarksRequest message or plain object + * @returns Promise + */ + public updateSecurityMarks(request: google.cloud.securitycenter.v1p1beta1.IUpdateSecurityMarksRequest): Promise; + } + + namespace SecurityCenter { + + /** + * Callback as used by {@link google.cloud.securitycenter.v1p1beta1.SecurityCenter#createSource}. + * @param error Error, if any + * @param [response] Source + */ + type CreateSourceCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1p1beta1.Source) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v1p1beta1.SecurityCenter#createFinding}. + * @param error Error, if any + * @param [response] Finding + */ + type CreateFindingCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1p1beta1.Finding) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v1p1beta1.SecurityCenter#createNotificationConfig}. + * @param error Error, if any + * @param [response] NotificationConfig + */ + type CreateNotificationConfigCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1p1beta1.NotificationConfig) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v1p1beta1.SecurityCenter#deleteNotificationConfig}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteNotificationConfigCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v1p1beta1.SecurityCenter#getIamPolicy}. + * @param error Error, if any + * @param [response] Policy + */ + type GetIamPolicyCallback = (error: (Error|null), response?: google.iam.v1.Policy) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v1p1beta1.SecurityCenter#getNotificationConfig}. + * @param error Error, if any + * @param [response] NotificationConfig + */ + type GetNotificationConfigCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1p1beta1.NotificationConfig) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v1p1beta1.SecurityCenter#getOrganizationSettings}. + * @param error Error, if any + * @param [response] OrganizationSettings + */ + type GetOrganizationSettingsCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1p1beta1.OrganizationSettings) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v1p1beta1.SecurityCenter#getSource}. + * @param error Error, if any + * @param [response] Source + */ + type GetSourceCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1p1beta1.Source) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v1p1beta1.SecurityCenter#groupAssets}. + * @param error Error, if any + * @param [response] GroupAssetsResponse + */ + type GroupAssetsCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1p1beta1.GroupAssetsResponse) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v1p1beta1.SecurityCenter#groupFindings}. + * @param error Error, if any + * @param [response] GroupFindingsResponse + */ + type GroupFindingsCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1p1beta1.GroupFindingsResponse) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v1p1beta1.SecurityCenter#listAssets}. + * @param error Error, if any + * @param [response] ListAssetsResponse + */ + type ListAssetsCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1p1beta1.ListAssetsResponse) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v1p1beta1.SecurityCenter#listFindings}. + * @param error Error, if any + * @param [response] ListFindingsResponse + */ + type ListFindingsCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1p1beta1.ListFindingsResponse) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v1p1beta1.SecurityCenter#listNotificationConfigs}. + * @param error Error, if any + * @param [response] ListNotificationConfigsResponse + */ + type ListNotificationConfigsCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsResponse) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v1p1beta1.SecurityCenter#listSources}. + * @param error Error, if any + * @param [response] ListSourcesResponse + */ + type ListSourcesCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1p1beta1.ListSourcesResponse) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v1p1beta1.SecurityCenter#runAssetDiscovery}. + * @param error Error, if any + * @param [response] Operation + */ + type RunAssetDiscoveryCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v1p1beta1.SecurityCenter#setFindingState}. + * @param error Error, if any + * @param [response] Finding + */ + type SetFindingStateCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1p1beta1.Finding) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v1p1beta1.SecurityCenter#setIamPolicy}. + * @param error Error, if any + * @param [response] Policy + */ + type SetIamPolicyCallback = (error: (Error|null), response?: google.iam.v1.Policy) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v1p1beta1.SecurityCenter#testIamPermissions}. + * @param error Error, if any + * @param [response] TestIamPermissionsResponse + */ + type TestIamPermissionsCallback = (error: (Error|null), response?: google.iam.v1.TestIamPermissionsResponse) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v1p1beta1.SecurityCenter#updateFinding}. + * @param error Error, if any + * @param [response] Finding + */ + type UpdateFindingCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1p1beta1.Finding) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v1p1beta1.SecurityCenter#updateNotificationConfig}. + * @param error Error, if any + * @param [response] NotificationConfig + */ + type UpdateNotificationConfigCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1p1beta1.NotificationConfig) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v1p1beta1.SecurityCenter#updateOrganizationSettings}. + * @param error Error, if any + * @param [response] OrganizationSettings + */ + type UpdateOrganizationSettingsCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1p1beta1.OrganizationSettings) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v1p1beta1.SecurityCenter#updateSource}. + * @param error Error, if any + * @param [response] Source + */ + type UpdateSourceCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1p1beta1.Source) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v1p1beta1.SecurityCenter#updateSecurityMarks}. + * @param error Error, if any + * @param [response] SecurityMarks + */ + type UpdateSecurityMarksCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1p1beta1.SecurityMarks) => void; + } + + /** Properties of a CreateFindingRequest. */ + interface ICreateFindingRequest { + + /** CreateFindingRequest parent */ + parent?: (string|null); + + /** CreateFindingRequest findingId */ + findingId?: (string|null); + + /** CreateFindingRequest finding */ + finding?: (google.cloud.securitycenter.v1p1beta1.IFinding|null); + } + + /** Represents a CreateFindingRequest. */ + class CreateFindingRequest implements ICreateFindingRequest { + + /** + * Constructs a new CreateFindingRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1p1beta1.ICreateFindingRequest); + + /** CreateFindingRequest parent. */ + public parent: string; + + /** CreateFindingRequest findingId. */ + public findingId: string; + + /** CreateFindingRequest finding. */ + public finding?: (google.cloud.securitycenter.v1p1beta1.IFinding|null); + + /** + * Creates a new CreateFindingRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateFindingRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v1p1beta1.ICreateFindingRequest): google.cloud.securitycenter.v1p1beta1.CreateFindingRequest; + + /** + * Encodes the specified CreateFindingRequest message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.CreateFindingRequest.verify|verify} messages. + * @param message CreateFindingRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1p1beta1.ICreateFindingRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateFindingRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.CreateFindingRequest.verify|verify} messages. + * @param message CreateFindingRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1p1beta1.ICreateFindingRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateFindingRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateFindingRequest + * @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.cloud.securitycenter.v1p1beta1.CreateFindingRequest; + + /** + * Decodes a CreateFindingRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateFindingRequest + * @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.cloud.securitycenter.v1p1beta1.CreateFindingRequest; + + /** + * Verifies a CreateFindingRequest 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 CreateFindingRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateFindingRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1p1beta1.CreateFindingRequest; + + /** + * Creates a plain object from a CreateFindingRequest message. Also converts values to other types if specified. + * @param message CreateFindingRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1p1beta1.CreateFindingRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateFindingRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a CreateNotificationConfigRequest. */ + interface ICreateNotificationConfigRequest { + + /** CreateNotificationConfigRequest parent */ + parent?: (string|null); + + /** CreateNotificationConfigRequest configId */ + configId?: (string|null); + + /** CreateNotificationConfigRequest notificationConfig */ + notificationConfig?: (google.cloud.securitycenter.v1p1beta1.INotificationConfig|null); + } + + /** Represents a CreateNotificationConfigRequest. */ + class CreateNotificationConfigRequest implements ICreateNotificationConfigRequest { + + /** + * Constructs a new CreateNotificationConfigRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1p1beta1.ICreateNotificationConfigRequest); + + /** CreateNotificationConfigRequest parent. */ + public parent: string; + + /** CreateNotificationConfigRequest configId. */ + public configId: string; + + /** CreateNotificationConfigRequest notificationConfig. */ + public notificationConfig?: (google.cloud.securitycenter.v1p1beta1.INotificationConfig|null); + + /** + * Creates a new CreateNotificationConfigRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateNotificationConfigRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v1p1beta1.ICreateNotificationConfigRequest): google.cloud.securitycenter.v1p1beta1.CreateNotificationConfigRequest; + + /** + * Encodes the specified CreateNotificationConfigRequest message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.CreateNotificationConfigRequest.verify|verify} messages. + * @param message CreateNotificationConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1p1beta1.ICreateNotificationConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateNotificationConfigRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.CreateNotificationConfigRequest.verify|verify} messages. + * @param message CreateNotificationConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1p1beta1.ICreateNotificationConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateNotificationConfigRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateNotificationConfigRequest + * @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.cloud.securitycenter.v1p1beta1.CreateNotificationConfigRequest; + + /** + * Decodes a CreateNotificationConfigRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateNotificationConfigRequest + * @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.cloud.securitycenter.v1p1beta1.CreateNotificationConfigRequest; + + /** + * Verifies a CreateNotificationConfigRequest 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 CreateNotificationConfigRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateNotificationConfigRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1p1beta1.CreateNotificationConfigRequest; + + /** + * Creates a plain object from a CreateNotificationConfigRequest message. Also converts values to other types if specified. + * @param message CreateNotificationConfigRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1p1beta1.CreateNotificationConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateNotificationConfigRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a CreateSourceRequest. */ + interface ICreateSourceRequest { + + /** CreateSourceRequest parent */ + parent?: (string|null); + + /** CreateSourceRequest source */ + source?: (google.cloud.securitycenter.v1p1beta1.ISource|null); + } + + /** Represents a CreateSourceRequest. */ + class CreateSourceRequest implements ICreateSourceRequest { + + /** + * Constructs a new CreateSourceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1p1beta1.ICreateSourceRequest); + + /** CreateSourceRequest parent. */ + public parent: string; + + /** CreateSourceRequest source. */ + public source?: (google.cloud.securitycenter.v1p1beta1.ISource|null); + + /** + * Creates a new CreateSourceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateSourceRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v1p1beta1.ICreateSourceRequest): google.cloud.securitycenter.v1p1beta1.CreateSourceRequest; + + /** + * Encodes the specified CreateSourceRequest message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.CreateSourceRequest.verify|verify} messages. + * @param message CreateSourceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1p1beta1.ICreateSourceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateSourceRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.CreateSourceRequest.verify|verify} messages. + * @param message CreateSourceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1p1beta1.ICreateSourceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateSourceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateSourceRequest + * @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.cloud.securitycenter.v1p1beta1.CreateSourceRequest; + + /** + * Decodes a CreateSourceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateSourceRequest + * @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.cloud.securitycenter.v1p1beta1.CreateSourceRequest; + + /** + * Verifies a CreateSourceRequest 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 CreateSourceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateSourceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1p1beta1.CreateSourceRequest; + + /** + * Creates a plain object from a CreateSourceRequest message. Also converts values to other types if specified. + * @param message CreateSourceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1p1beta1.CreateSourceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateSourceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DeleteNotificationConfigRequest. */ + interface IDeleteNotificationConfigRequest { + + /** DeleteNotificationConfigRequest name */ + name?: (string|null); + } + + /** Represents a DeleteNotificationConfigRequest. */ + class DeleteNotificationConfigRequest implements IDeleteNotificationConfigRequest { + + /** + * Constructs a new DeleteNotificationConfigRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1p1beta1.IDeleteNotificationConfigRequest); + + /** DeleteNotificationConfigRequest name. */ + public name: string; + + /** + * Creates a new DeleteNotificationConfigRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteNotificationConfigRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v1p1beta1.IDeleteNotificationConfigRequest): google.cloud.securitycenter.v1p1beta1.DeleteNotificationConfigRequest; + + /** + * Encodes the specified DeleteNotificationConfigRequest message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.DeleteNotificationConfigRequest.verify|verify} messages. + * @param message DeleteNotificationConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1p1beta1.IDeleteNotificationConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteNotificationConfigRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.DeleteNotificationConfigRequest.verify|verify} messages. + * @param message DeleteNotificationConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1p1beta1.IDeleteNotificationConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteNotificationConfigRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteNotificationConfigRequest + * @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.cloud.securitycenter.v1p1beta1.DeleteNotificationConfigRequest; + + /** + * Decodes a DeleteNotificationConfigRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteNotificationConfigRequest + * @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.cloud.securitycenter.v1p1beta1.DeleteNotificationConfigRequest; + + /** + * Verifies a DeleteNotificationConfigRequest 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 DeleteNotificationConfigRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteNotificationConfigRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1p1beta1.DeleteNotificationConfigRequest; + + /** + * Creates a plain object from a DeleteNotificationConfigRequest message. Also converts values to other types if specified. + * @param message DeleteNotificationConfigRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1p1beta1.DeleteNotificationConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteNotificationConfigRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GetNotificationConfigRequest. */ + interface IGetNotificationConfigRequest { + + /** GetNotificationConfigRequest name */ + name?: (string|null); + } + + /** Represents a GetNotificationConfigRequest. */ + class GetNotificationConfigRequest implements IGetNotificationConfigRequest { + + /** + * Constructs a new GetNotificationConfigRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1p1beta1.IGetNotificationConfigRequest); + + /** GetNotificationConfigRequest name. */ + public name: string; + + /** + * Creates a new GetNotificationConfigRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetNotificationConfigRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v1p1beta1.IGetNotificationConfigRequest): google.cloud.securitycenter.v1p1beta1.GetNotificationConfigRequest; + + /** + * Encodes the specified GetNotificationConfigRequest message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.GetNotificationConfigRequest.verify|verify} messages. + * @param message GetNotificationConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1p1beta1.IGetNotificationConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetNotificationConfigRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.GetNotificationConfigRequest.verify|verify} messages. + * @param message GetNotificationConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1p1beta1.IGetNotificationConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetNotificationConfigRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetNotificationConfigRequest + * @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.cloud.securitycenter.v1p1beta1.GetNotificationConfigRequest; + + /** + * Decodes a GetNotificationConfigRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetNotificationConfigRequest + * @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.cloud.securitycenter.v1p1beta1.GetNotificationConfigRequest; + + /** + * Verifies a GetNotificationConfigRequest 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 GetNotificationConfigRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetNotificationConfigRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1p1beta1.GetNotificationConfigRequest; + + /** + * Creates a plain object from a GetNotificationConfigRequest message. Also converts values to other types if specified. + * @param message GetNotificationConfigRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1p1beta1.GetNotificationConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetNotificationConfigRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GetOrganizationSettingsRequest. */ + interface IGetOrganizationSettingsRequest { + + /** GetOrganizationSettingsRequest name */ + name?: (string|null); + } + + /** Represents a GetOrganizationSettingsRequest. */ + class GetOrganizationSettingsRequest implements IGetOrganizationSettingsRequest { + + /** + * Constructs a new GetOrganizationSettingsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1p1beta1.IGetOrganizationSettingsRequest); + + /** GetOrganizationSettingsRequest name. */ + public name: string; + + /** + * Creates a new GetOrganizationSettingsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetOrganizationSettingsRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v1p1beta1.IGetOrganizationSettingsRequest): google.cloud.securitycenter.v1p1beta1.GetOrganizationSettingsRequest; + + /** + * Encodes the specified GetOrganizationSettingsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.GetOrganizationSettingsRequest.verify|verify} messages. + * @param message GetOrganizationSettingsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1p1beta1.IGetOrganizationSettingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetOrganizationSettingsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.GetOrganizationSettingsRequest.verify|verify} messages. + * @param message GetOrganizationSettingsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1p1beta1.IGetOrganizationSettingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetOrganizationSettingsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetOrganizationSettingsRequest + * @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.cloud.securitycenter.v1p1beta1.GetOrganizationSettingsRequest; + + /** + * Decodes a GetOrganizationSettingsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetOrganizationSettingsRequest + * @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.cloud.securitycenter.v1p1beta1.GetOrganizationSettingsRequest; + + /** + * Verifies a GetOrganizationSettingsRequest 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 GetOrganizationSettingsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetOrganizationSettingsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1p1beta1.GetOrganizationSettingsRequest; + + /** + * Creates a plain object from a GetOrganizationSettingsRequest message. Also converts values to other types if specified. + * @param message GetOrganizationSettingsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1p1beta1.GetOrganizationSettingsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetOrganizationSettingsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GetSourceRequest. */ + interface IGetSourceRequest { + + /** GetSourceRequest name */ + name?: (string|null); + } + + /** Represents a GetSourceRequest. */ + class GetSourceRequest implements IGetSourceRequest { + + /** + * Constructs a new GetSourceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1p1beta1.IGetSourceRequest); + + /** GetSourceRequest name. */ + public name: string; + + /** + * Creates a new GetSourceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetSourceRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v1p1beta1.IGetSourceRequest): google.cloud.securitycenter.v1p1beta1.GetSourceRequest; + + /** + * Encodes the specified GetSourceRequest message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.GetSourceRequest.verify|verify} messages. + * @param message GetSourceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1p1beta1.IGetSourceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetSourceRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.GetSourceRequest.verify|verify} messages. + * @param message GetSourceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1p1beta1.IGetSourceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetSourceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetSourceRequest + * @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.cloud.securitycenter.v1p1beta1.GetSourceRequest; + + /** + * Decodes a GetSourceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetSourceRequest + * @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.cloud.securitycenter.v1p1beta1.GetSourceRequest; + + /** + * Verifies a GetSourceRequest 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 GetSourceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetSourceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1p1beta1.GetSourceRequest; + + /** + * Creates a plain object from a GetSourceRequest message. Also converts values to other types if specified. + * @param message GetSourceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1p1beta1.GetSourceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetSourceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GroupAssetsRequest. */ + interface IGroupAssetsRequest { + + /** GroupAssetsRequest parent */ + parent?: (string|null); + + /** GroupAssetsRequest filter */ + filter?: (string|null); + + /** GroupAssetsRequest groupBy */ + groupBy?: (string|null); + + /** GroupAssetsRequest compareDuration */ + compareDuration?: (google.protobuf.IDuration|null); + + /** GroupAssetsRequest readTime */ + readTime?: (google.protobuf.ITimestamp|null); + + /** GroupAssetsRequest having */ + having?: (string|null); + + /** GroupAssetsRequest pageToken */ + pageToken?: (string|null); + + /** GroupAssetsRequest pageSize */ + pageSize?: (number|null); + } + + /** Represents a GroupAssetsRequest. */ + class GroupAssetsRequest implements IGroupAssetsRequest { + + /** + * Constructs a new GroupAssetsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1p1beta1.IGroupAssetsRequest); + + /** GroupAssetsRequest parent. */ + public parent: string; + + /** GroupAssetsRequest filter. */ + public filter: string; + + /** GroupAssetsRequest groupBy. */ + public groupBy: string; + + /** GroupAssetsRequest compareDuration. */ + public compareDuration?: (google.protobuf.IDuration|null); + + /** GroupAssetsRequest readTime. */ + public readTime?: (google.protobuf.ITimestamp|null); + + /** GroupAssetsRequest having. */ + public having: string; + + /** GroupAssetsRequest pageToken. */ + public pageToken: string; + + /** GroupAssetsRequest pageSize. */ + public pageSize: number; + + /** + * Creates a new GroupAssetsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GroupAssetsRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v1p1beta1.IGroupAssetsRequest): google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest; + + /** + * Encodes the specified GroupAssetsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest.verify|verify} messages. + * @param message GroupAssetsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1p1beta1.IGroupAssetsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GroupAssetsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest.verify|verify} messages. + * @param message GroupAssetsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1p1beta1.IGroupAssetsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GroupAssetsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GroupAssetsRequest + * @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.cloud.securitycenter.v1p1beta1.GroupAssetsRequest; + + /** + * Decodes a GroupAssetsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GroupAssetsRequest + * @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.cloud.securitycenter.v1p1beta1.GroupAssetsRequest; + + /** + * Verifies a GroupAssetsRequest 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 GroupAssetsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GroupAssetsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest; + + /** + * Creates a plain object from a GroupAssetsRequest message. Also converts values to other types if specified. + * @param message GroupAssetsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GroupAssetsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GroupAssetsResponse. */ + interface IGroupAssetsResponse { + + /** GroupAssetsResponse groupByResults */ + groupByResults?: (google.cloud.securitycenter.v1p1beta1.IGroupResult[]|null); + + /** GroupAssetsResponse readTime */ + readTime?: (google.protobuf.ITimestamp|null); + + /** GroupAssetsResponse nextPageToken */ + nextPageToken?: (string|null); + + /** GroupAssetsResponse totalSize */ + totalSize?: (number|null); + } + + /** Represents a GroupAssetsResponse. */ + class GroupAssetsResponse implements IGroupAssetsResponse { + + /** + * Constructs a new GroupAssetsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1p1beta1.IGroupAssetsResponse); + + /** GroupAssetsResponse groupByResults. */ + public groupByResults: google.cloud.securitycenter.v1p1beta1.IGroupResult[]; + + /** GroupAssetsResponse readTime. */ + public readTime?: (google.protobuf.ITimestamp|null); + + /** GroupAssetsResponse nextPageToken. */ + public nextPageToken: string; + + /** GroupAssetsResponse totalSize. */ + public totalSize: number; + + /** + * Creates a new GroupAssetsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns GroupAssetsResponse instance + */ + public static create(properties?: google.cloud.securitycenter.v1p1beta1.IGroupAssetsResponse): google.cloud.securitycenter.v1p1beta1.GroupAssetsResponse; + + /** + * Encodes the specified GroupAssetsResponse message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.GroupAssetsResponse.verify|verify} messages. + * @param message GroupAssetsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1p1beta1.IGroupAssetsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GroupAssetsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.GroupAssetsResponse.verify|verify} messages. + * @param message GroupAssetsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1p1beta1.IGroupAssetsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GroupAssetsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GroupAssetsResponse + * @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.cloud.securitycenter.v1p1beta1.GroupAssetsResponse; + + /** + * Decodes a GroupAssetsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GroupAssetsResponse + * @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.cloud.securitycenter.v1p1beta1.GroupAssetsResponse; + + /** + * Verifies a GroupAssetsResponse 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 GroupAssetsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GroupAssetsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1p1beta1.GroupAssetsResponse; + + /** + * Creates a plain object from a GroupAssetsResponse message. Also converts values to other types if specified. + * @param message GroupAssetsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1p1beta1.GroupAssetsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GroupAssetsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GroupFindingsRequest. */ + interface IGroupFindingsRequest { + + /** GroupFindingsRequest parent */ + parent?: (string|null); + + /** GroupFindingsRequest filter */ + filter?: (string|null); + + /** GroupFindingsRequest groupBy */ + groupBy?: (string|null); + + /** GroupFindingsRequest readTime */ + readTime?: (google.protobuf.ITimestamp|null); + + /** GroupFindingsRequest compareDuration */ + compareDuration?: (google.protobuf.IDuration|null); + + /** GroupFindingsRequest having */ + having?: (string|null); + + /** GroupFindingsRequest pageToken */ + pageToken?: (string|null); + + /** GroupFindingsRequest pageSize */ + pageSize?: (number|null); + } + + /** Represents a GroupFindingsRequest. */ + class GroupFindingsRequest implements IGroupFindingsRequest { + + /** + * Constructs a new GroupFindingsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1p1beta1.IGroupFindingsRequest); + + /** GroupFindingsRequest parent. */ + public parent: string; + + /** GroupFindingsRequest filter. */ + public filter: string; + + /** GroupFindingsRequest groupBy. */ + public groupBy: string; + + /** GroupFindingsRequest readTime. */ + public readTime?: (google.protobuf.ITimestamp|null); + + /** GroupFindingsRequest compareDuration. */ + public compareDuration?: (google.protobuf.IDuration|null); + + /** GroupFindingsRequest having. */ + public having: string; + + /** GroupFindingsRequest pageToken. */ + public pageToken: string; + + /** GroupFindingsRequest pageSize. */ + public pageSize: number; + + /** + * Creates a new GroupFindingsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GroupFindingsRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v1p1beta1.IGroupFindingsRequest): google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest; + + /** + * Encodes the specified GroupFindingsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest.verify|verify} messages. + * @param message GroupFindingsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1p1beta1.IGroupFindingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GroupFindingsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest.verify|verify} messages. + * @param message GroupFindingsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1p1beta1.IGroupFindingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GroupFindingsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GroupFindingsRequest + * @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.cloud.securitycenter.v1p1beta1.GroupFindingsRequest; + + /** + * Decodes a GroupFindingsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GroupFindingsRequest + * @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.cloud.securitycenter.v1p1beta1.GroupFindingsRequest; + + /** + * Verifies a GroupFindingsRequest 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 GroupFindingsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GroupFindingsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest; + + /** + * Creates a plain object from a GroupFindingsRequest message. Also converts values to other types if specified. + * @param message GroupFindingsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GroupFindingsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GroupFindingsResponse. */ + interface IGroupFindingsResponse { + + /** GroupFindingsResponse groupByResults */ + groupByResults?: (google.cloud.securitycenter.v1p1beta1.IGroupResult[]|null); + + /** GroupFindingsResponse readTime */ + readTime?: (google.protobuf.ITimestamp|null); + + /** GroupFindingsResponse nextPageToken */ + nextPageToken?: (string|null); + + /** GroupFindingsResponse totalSize */ + totalSize?: (number|null); + } + + /** Represents a GroupFindingsResponse. */ + class GroupFindingsResponse implements IGroupFindingsResponse { + + /** + * Constructs a new GroupFindingsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1p1beta1.IGroupFindingsResponse); + + /** GroupFindingsResponse groupByResults. */ + public groupByResults: google.cloud.securitycenter.v1p1beta1.IGroupResult[]; + + /** GroupFindingsResponse readTime. */ + public readTime?: (google.protobuf.ITimestamp|null); + + /** GroupFindingsResponse nextPageToken. */ + public nextPageToken: string; + + /** GroupFindingsResponse totalSize. */ + public totalSize: number; + + /** + * Creates a new GroupFindingsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns GroupFindingsResponse instance + */ + public static create(properties?: google.cloud.securitycenter.v1p1beta1.IGroupFindingsResponse): google.cloud.securitycenter.v1p1beta1.GroupFindingsResponse; + + /** + * Encodes the specified GroupFindingsResponse message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.GroupFindingsResponse.verify|verify} messages. + * @param message GroupFindingsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1p1beta1.IGroupFindingsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GroupFindingsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.GroupFindingsResponse.verify|verify} messages. + * @param message GroupFindingsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1p1beta1.IGroupFindingsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GroupFindingsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GroupFindingsResponse + * @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.cloud.securitycenter.v1p1beta1.GroupFindingsResponse; + + /** + * Decodes a GroupFindingsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GroupFindingsResponse + * @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.cloud.securitycenter.v1p1beta1.GroupFindingsResponse; + + /** + * Verifies a GroupFindingsResponse 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 GroupFindingsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GroupFindingsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1p1beta1.GroupFindingsResponse; + + /** + * Creates a plain object from a GroupFindingsResponse message. Also converts values to other types if specified. + * @param message GroupFindingsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1p1beta1.GroupFindingsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GroupFindingsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GroupResult. */ + interface IGroupResult { + + /** GroupResult properties */ + properties?: ({ [k: string]: google.protobuf.IValue }|null); + + /** GroupResult count */ + count?: (number|Long|string|null); + } + + /** Represents a GroupResult. */ + class GroupResult implements IGroupResult { + + /** + * Constructs a new GroupResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1p1beta1.IGroupResult); + + /** GroupResult properties. */ + public properties: { [k: string]: google.protobuf.IValue }; + + /** GroupResult count. */ + public count: (number|Long|string); + + /** + * Creates a new GroupResult instance using the specified properties. + * @param [properties] Properties to set + * @returns GroupResult instance + */ + public static create(properties?: google.cloud.securitycenter.v1p1beta1.IGroupResult): google.cloud.securitycenter.v1p1beta1.GroupResult; + + /** + * Encodes the specified GroupResult message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.GroupResult.verify|verify} messages. + * @param message GroupResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1p1beta1.IGroupResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GroupResult message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.GroupResult.verify|verify} messages. + * @param message GroupResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1p1beta1.IGroupResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GroupResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GroupResult + * @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.cloud.securitycenter.v1p1beta1.GroupResult; + + /** + * Decodes a GroupResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GroupResult + * @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.cloud.securitycenter.v1p1beta1.GroupResult; + + /** + * Verifies a GroupResult 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 GroupResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GroupResult + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1p1beta1.GroupResult; + + /** + * Creates a plain object from a GroupResult message. Also converts values to other types if specified. + * @param message GroupResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1p1beta1.GroupResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GroupResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListNotificationConfigsRequest. */ + interface IListNotificationConfigsRequest { + + /** ListNotificationConfigsRequest parent */ + parent?: (string|null); + + /** ListNotificationConfigsRequest pageToken */ + pageToken?: (string|null); + + /** ListNotificationConfigsRequest pageSize */ + pageSize?: (number|null); + } + + /** Represents a ListNotificationConfigsRequest. */ + class ListNotificationConfigsRequest implements IListNotificationConfigsRequest { + + /** + * Constructs a new ListNotificationConfigsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1p1beta1.IListNotificationConfigsRequest); + + /** ListNotificationConfigsRequest parent. */ + public parent: string; + + /** ListNotificationConfigsRequest pageToken. */ + public pageToken: string; + + /** ListNotificationConfigsRequest pageSize. */ + public pageSize: number; + + /** + * Creates a new ListNotificationConfigsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListNotificationConfigsRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v1p1beta1.IListNotificationConfigsRequest): google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest; + + /** + * Encodes the specified ListNotificationConfigsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest.verify|verify} messages. + * @param message ListNotificationConfigsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1p1beta1.IListNotificationConfigsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListNotificationConfigsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest.verify|verify} messages. + * @param message ListNotificationConfigsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1p1beta1.IListNotificationConfigsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListNotificationConfigsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListNotificationConfigsRequest + * @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.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest; + + /** + * Decodes a ListNotificationConfigsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListNotificationConfigsRequest + * @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.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest; + + /** + * Verifies a ListNotificationConfigsRequest 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 ListNotificationConfigsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListNotificationConfigsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest; + + /** + * Creates a plain object from a ListNotificationConfigsRequest message. Also converts values to other types if specified. + * @param message ListNotificationConfigsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListNotificationConfigsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListNotificationConfigsResponse. */ + interface IListNotificationConfigsResponse { + + /** ListNotificationConfigsResponse notificationConfigs */ + notificationConfigs?: (google.cloud.securitycenter.v1p1beta1.INotificationConfig[]|null); + + /** ListNotificationConfigsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListNotificationConfigsResponse. */ + class ListNotificationConfigsResponse implements IListNotificationConfigsResponse { + + /** + * Constructs a new ListNotificationConfigsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1p1beta1.IListNotificationConfigsResponse); + + /** ListNotificationConfigsResponse notificationConfigs. */ + public notificationConfigs: google.cloud.securitycenter.v1p1beta1.INotificationConfig[]; + + /** ListNotificationConfigsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListNotificationConfigsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListNotificationConfigsResponse instance + */ + public static create(properties?: google.cloud.securitycenter.v1p1beta1.IListNotificationConfigsResponse): google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsResponse; + + /** + * Encodes the specified ListNotificationConfigsResponse message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsResponse.verify|verify} messages. + * @param message ListNotificationConfigsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1p1beta1.IListNotificationConfigsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListNotificationConfigsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsResponse.verify|verify} messages. + * @param message ListNotificationConfigsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1p1beta1.IListNotificationConfigsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListNotificationConfigsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListNotificationConfigsResponse + * @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.cloud.securitycenter.v1p1beta1.ListNotificationConfigsResponse; + + /** + * Decodes a ListNotificationConfigsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListNotificationConfigsResponse + * @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.cloud.securitycenter.v1p1beta1.ListNotificationConfigsResponse; + + /** + * Verifies a ListNotificationConfigsResponse 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 ListNotificationConfigsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListNotificationConfigsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsResponse; + + /** + * Creates a plain object from a ListNotificationConfigsResponse message. Also converts values to other types if specified. + * @param message ListNotificationConfigsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListNotificationConfigsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListSourcesRequest. */ + interface IListSourcesRequest { + + /** ListSourcesRequest parent */ + parent?: (string|null); + + /** ListSourcesRequest pageToken */ + pageToken?: (string|null); + + /** ListSourcesRequest pageSize */ + pageSize?: (number|null); + } + + /** Represents a ListSourcesRequest. */ + class ListSourcesRequest implements IListSourcesRequest { + + /** + * Constructs a new ListSourcesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1p1beta1.IListSourcesRequest); + + /** ListSourcesRequest parent. */ + public parent: string; + + /** ListSourcesRequest pageToken. */ + public pageToken: string; + + /** ListSourcesRequest pageSize. */ + public pageSize: number; + + /** + * Creates a new ListSourcesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListSourcesRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v1p1beta1.IListSourcesRequest): google.cloud.securitycenter.v1p1beta1.ListSourcesRequest; + + /** + * Encodes the specified ListSourcesRequest message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.ListSourcesRequest.verify|verify} messages. + * @param message ListSourcesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1p1beta1.IListSourcesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListSourcesRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.ListSourcesRequest.verify|verify} messages. + * @param message ListSourcesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1p1beta1.IListSourcesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListSourcesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListSourcesRequest + * @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.cloud.securitycenter.v1p1beta1.ListSourcesRequest; + + /** + * Decodes a ListSourcesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListSourcesRequest + * @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.cloud.securitycenter.v1p1beta1.ListSourcesRequest; + + /** + * Verifies a ListSourcesRequest 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 ListSourcesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListSourcesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1p1beta1.ListSourcesRequest; + + /** + * Creates a plain object from a ListSourcesRequest message. Also converts values to other types if specified. + * @param message ListSourcesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1p1beta1.ListSourcesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListSourcesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListSourcesResponse. */ + interface IListSourcesResponse { + + /** ListSourcesResponse sources */ + sources?: (google.cloud.securitycenter.v1p1beta1.ISource[]|null); + + /** ListSourcesResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListSourcesResponse. */ + class ListSourcesResponse implements IListSourcesResponse { + + /** + * Constructs a new ListSourcesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1p1beta1.IListSourcesResponse); + + /** ListSourcesResponse sources. */ + public sources: google.cloud.securitycenter.v1p1beta1.ISource[]; + + /** ListSourcesResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListSourcesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListSourcesResponse instance + */ + public static create(properties?: google.cloud.securitycenter.v1p1beta1.IListSourcesResponse): google.cloud.securitycenter.v1p1beta1.ListSourcesResponse; + + /** + * Encodes the specified ListSourcesResponse message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.ListSourcesResponse.verify|verify} messages. + * @param message ListSourcesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1p1beta1.IListSourcesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListSourcesResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.ListSourcesResponse.verify|verify} messages. + * @param message ListSourcesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1p1beta1.IListSourcesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListSourcesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListSourcesResponse + * @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.cloud.securitycenter.v1p1beta1.ListSourcesResponse; + + /** + * Decodes a ListSourcesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListSourcesResponse + * @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.cloud.securitycenter.v1p1beta1.ListSourcesResponse; + + /** + * Verifies a ListSourcesResponse 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 ListSourcesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListSourcesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1p1beta1.ListSourcesResponse; + + /** + * Creates a plain object from a ListSourcesResponse message. Also converts values to other types if specified. + * @param message ListSourcesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1p1beta1.ListSourcesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListSourcesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListAssetsRequest. */ + interface IListAssetsRequest { + + /** ListAssetsRequest parent */ + parent?: (string|null); + + /** ListAssetsRequest filter */ + filter?: (string|null); + + /** ListAssetsRequest orderBy */ + orderBy?: (string|null); + + /** ListAssetsRequest readTime */ + readTime?: (google.protobuf.ITimestamp|null); + + /** ListAssetsRequest compareDuration */ + compareDuration?: (google.protobuf.IDuration|null); + + /** ListAssetsRequest having */ + having?: (string|null); + + /** ListAssetsRequest fieldMask */ + fieldMask?: (google.protobuf.IFieldMask|null); + + /** ListAssetsRequest pageToken */ + pageToken?: (string|null); + + /** ListAssetsRequest pageSize */ + pageSize?: (number|null); + } + + /** Represents a ListAssetsRequest. */ + class ListAssetsRequest implements IListAssetsRequest { + + /** + * Constructs a new ListAssetsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1p1beta1.IListAssetsRequest); + + /** ListAssetsRequest parent. */ + public parent: string; + + /** ListAssetsRequest filter. */ + public filter: string; + + /** ListAssetsRequest orderBy. */ + public orderBy: string; + + /** ListAssetsRequest readTime. */ + public readTime?: (google.protobuf.ITimestamp|null); + + /** ListAssetsRequest compareDuration. */ + public compareDuration?: (google.protobuf.IDuration|null); + + /** ListAssetsRequest having. */ + public having: string; + + /** ListAssetsRequest fieldMask. */ + public fieldMask?: (google.protobuf.IFieldMask|null); + + /** ListAssetsRequest pageToken. */ + public pageToken: string; + + /** ListAssetsRequest pageSize. */ + public pageSize: number; + + /** + * Creates a new ListAssetsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListAssetsRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v1p1beta1.IListAssetsRequest): google.cloud.securitycenter.v1p1beta1.ListAssetsRequest; + + /** + * Encodes the specified ListAssetsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.ListAssetsRequest.verify|verify} messages. + * @param message ListAssetsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1p1beta1.IListAssetsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListAssetsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.ListAssetsRequest.verify|verify} messages. + * @param message ListAssetsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1p1beta1.IListAssetsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListAssetsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListAssetsRequest + * @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.cloud.securitycenter.v1p1beta1.ListAssetsRequest; + + /** + * Decodes a ListAssetsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListAssetsRequest + * @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.cloud.securitycenter.v1p1beta1.ListAssetsRequest; + + /** + * Verifies a ListAssetsRequest 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 ListAssetsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListAssetsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1p1beta1.ListAssetsRequest; + + /** + * Creates a plain object from a ListAssetsRequest message. Also converts values to other types if specified. + * @param message ListAssetsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1p1beta1.ListAssetsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListAssetsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListAssetsResponse. */ + interface IListAssetsResponse { + + /** ListAssetsResponse listAssetsResults */ + listAssetsResults?: (google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.IListAssetsResult[]|null); + + /** ListAssetsResponse readTime */ + readTime?: (google.protobuf.ITimestamp|null); + + /** ListAssetsResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListAssetsResponse totalSize */ + totalSize?: (number|null); + } + + /** Represents a ListAssetsResponse. */ + class ListAssetsResponse implements IListAssetsResponse { + + /** + * Constructs a new ListAssetsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1p1beta1.IListAssetsResponse); + + /** ListAssetsResponse listAssetsResults. */ + public listAssetsResults: google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.IListAssetsResult[]; + + /** ListAssetsResponse readTime. */ + public readTime?: (google.protobuf.ITimestamp|null); + + /** ListAssetsResponse nextPageToken. */ + public nextPageToken: string; + + /** ListAssetsResponse totalSize. */ + public totalSize: number; + + /** + * Creates a new ListAssetsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListAssetsResponse instance + */ + public static create(properties?: google.cloud.securitycenter.v1p1beta1.IListAssetsResponse): google.cloud.securitycenter.v1p1beta1.ListAssetsResponse; + + /** + * Encodes the specified ListAssetsResponse message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.verify|verify} messages. + * @param message ListAssetsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1p1beta1.IListAssetsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListAssetsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.verify|verify} messages. + * @param message ListAssetsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1p1beta1.IListAssetsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListAssetsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListAssetsResponse + * @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.cloud.securitycenter.v1p1beta1.ListAssetsResponse; + + /** + * Decodes a ListAssetsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListAssetsResponse + * @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.cloud.securitycenter.v1p1beta1.ListAssetsResponse; + + /** + * Verifies a ListAssetsResponse 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 ListAssetsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListAssetsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1p1beta1.ListAssetsResponse; + + /** + * Creates a plain object from a ListAssetsResponse message. Also converts values to other types if specified. + * @param message ListAssetsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1p1beta1.ListAssetsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListAssetsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace ListAssetsResponse { + + /** Properties of a ListAssetsResult. */ + interface IListAssetsResult { + + /** ListAssetsResult asset */ + asset?: (google.cloud.securitycenter.v1p1beta1.IAsset|null); + + /** ListAssetsResult stateChange */ + stateChange?: (google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult.StateChange|keyof typeof google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult.StateChange|null); + } + + /** Represents a ListAssetsResult. */ + class ListAssetsResult implements IListAssetsResult { + + /** + * Constructs a new ListAssetsResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.IListAssetsResult); + + /** ListAssetsResult asset. */ + public asset?: (google.cloud.securitycenter.v1p1beta1.IAsset|null); + + /** ListAssetsResult stateChange. */ + public stateChange: (google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult.StateChange|keyof typeof google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult.StateChange); + + /** + * Creates a new ListAssetsResult instance using the specified properties. + * @param [properties] Properties to set + * @returns ListAssetsResult instance + */ + public static create(properties?: google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.IListAssetsResult): google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult; + + /** + * Encodes the specified ListAssetsResult message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult.verify|verify} messages. + * @param message ListAssetsResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.IListAssetsResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListAssetsResult message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult.verify|verify} messages. + * @param message ListAssetsResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.IListAssetsResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListAssetsResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListAssetsResult + * @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.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult; + + /** + * Decodes a ListAssetsResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListAssetsResult + * @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.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult; + + /** + * Verifies a ListAssetsResult 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 ListAssetsResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListAssetsResult + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult; + + /** + * Creates a plain object from a ListAssetsResult message. Also converts values to other types if specified. + * @param message ListAssetsResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListAssetsResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace ListAssetsResult { + + /** StateChange enum. */ + enum StateChange { + UNUSED = 0, + ADDED = 1, + REMOVED = 2, + ACTIVE = 3 + } + } + } + + /** Properties of a ListFindingsRequest. */ + interface IListFindingsRequest { + + /** ListFindingsRequest parent */ + parent?: (string|null); + + /** ListFindingsRequest filter */ + filter?: (string|null); + + /** ListFindingsRequest orderBy */ + orderBy?: (string|null); + + /** ListFindingsRequest readTime */ + readTime?: (google.protobuf.ITimestamp|null); + + /** ListFindingsRequest compareDuration */ + compareDuration?: (google.protobuf.IDuration|null); + + /** ListFindingsRequest having */ + having?: (string|null); + + /** ListFindingsRequest fieldMask */ + fieldMask?: (google.protobuf.IFieldMask|null); + + /** ListFindingsRequest pageToken */ + pageToken?: (string|null); + + /** ListFindingsRequest pageSize */ + pageSize?: (number|null); + } + + /** Represents a ListFindingsRequest. */ + class ListFindingsRequest implements IListFindingsRequest { + + /** + * Constructs a new ListFindingsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1p1beta1.IListFindingsRequest); + + /** ListFindingsRequest parent. */ + public parent: string; + + /** ListFindingsRequest filter. */ + public filter: string; + + /** ListFindingsRequest orderBy. */ + public orderBy: string; + + /** ListFindingsRequest readTime. */ + public readTime?: (google.protobuf.ITimestamp|null); + + /** ListFindingsRequest compareDuration. */ + public compareDuration?: (google.protobuf.IDuration|null); + + /** ListFindingsRequest having. */ + public having: string; + + /** ListFindingsRequest fieldMask. */ + public fieldMask?: (google.protobuf.IFieldMask|null); + + /** ListFindingsRequest pageToken. */ + public pageToken: string; + + /** ListFindingsRequest pageSize. */ + public pageSize: number; + + /** + * Creates a new ListFindingsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListFindingsRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v1p1beta1.IListFindingsRequest): google.cloud.securitycenter.v1p1beta1.ListFindingsRequest; + + /** + * Encodes the specified ListFindingsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.ListFindingsRequest.verify|verify} messages. + * @param message ListFindingsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1p1beta1.IListFindingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListFindingsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.ListFindingsRequest.verify|verify} messages. + * @param message ListFindingsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1p1beta1.IListFindingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListFindingsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListFindingsRequest + * @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.cloud.securitycenter.v1p1beta1.ListFindingsRequest; + + /** + * Decodes a ListFindingsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListFindingsRequest + * @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.cloud.securitycenter.v1p1beta1.ListFindingsRequest; + + /** + * Verifies a ListFindingsRequest 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 ListFindingsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListFindingsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1p1beta1.ListFindingsRequest; + + /** + * Creates a plain object from a ListFindingsRequest message. Also converts values to other types if specified. + * @param message ListFindingsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1p1beta1.ListFindingsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListFindingsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListFindingsResponse. */ + interface IListFindingsResponse { + + /** ListFindingsResponse listFindingsResults */ + listFindingsResults?: (google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.IListFindingsResult[]|null); + + /** ListFindingsResponse readTime */ + readTime?: (google.protobuf.ITimestamp|null); + + /** ListFindingsResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListFindingsResponse totalSize */ + totalSize?: (number|null); + } + + /** Represents a ListFindingsResponse. */ + class ListFindingsResponse implements IListFindingsResponse { + + /** + * Constructs a new ListFindingsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1p1beta1.IListFindingsResponse); + + /** ListFindingsResponse listFindingsResults. */ + public listFindingsResults: google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.IListFindingsResult[]; + + /** ListFindingsResponse readTime. */ + public readTime?: (google.protobuf.ITimestamp|null); + + /** ListFindingsResponse nextPageToken. */ + public nextPageToken: string; + + /** ListFindingsResponse totalSize. */ + public totalSize: number; + + /** + * Creates a new ListFindingsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListFindingsResponse instance + */ + public static create(properties?: google.cloud.securitycenter.v1p1beta1.IListFindingsResponse): google.cloud.securitycenter.v1p1beta1.ListFindingsResponse; + + /** + * Encodes the specified ListFindingsResponse message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.verify|verify} messages. + * @param message ListFindingsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1p1beta1.IListFindingsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListFindingsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.verify|verify} messages. + * @param message ListFindingsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1p1beta1.IListFindingsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListFindingsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListFindingsResponse + * @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.cloud.securitycenter.v1p1beta1.ListFindingsResponse; + + /** + * Decodes a ListFindingsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListFindingsResponse + * @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.cloud.securitycenter.v1p1beta1.ListFindingsResponse; + + /** + * Verifies a ListFindingsResponse 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 ListFindingsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListFindingsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1p1beta1.ListFindingsResponse; + + /** + * Creates a plain object from a ListFindingsResponse message. Also converts values to other types if specified. + * @param message ListFindingsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1p1beta1.ListFindingsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListFindingsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace ListFindingsResponse { + + /** Properties of a ListFindingsResult. */ + interface IListFindingsResult { + + /** ListFindingsResult finding */ + finding?: (google.cloud.securitycenter.v1p1beta1.IFinding|null); + + /** ListFindingsResult stateChange */ + stateChange?: (google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.StateChange|keyof typeof google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.StateChange|null); + + /** ListFindingsResult resource */ + resource?: (google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.IResource|null); + } + + /** Represents a ListFindingsResult. */ + class ListFindingsResult implements IListFindingsResult { + + /** + * Constructs a new ListFindingsResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.IListFindingsResult); + + /** ListFindingsResult finding. */ + public finding?: (google.cloud.securitycenter.v1p1beta1.IFinding|null); + + /** ListFindingsResult stateChange. */ + public stateChange: (google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.StateChange|keyof typeof google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.StateChange); + + /** ListFindingsResult resource. */ + public resource?: (google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.IResource|null); + + /** + * Creates a new ListFindingsResult instance using the specified properties. + * @param [properties] Properties to set + * @returns ListFindingsResult instance + */ + public static create(properties?: google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.IListFindingsResult): google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult; + + /** + * Encodes the specified ListFindingsResult message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.verify|verify} messages. + * @param message ListFindingsResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.IListFindingsResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListFindingsResult message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.verify|verify} messages. + * @param message ListFindingsResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.IListFindingsResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListFindingsResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListFindingsResult + * @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.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult; + + /** + * Decodes a ListFindingsResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListFindingsResult + * @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.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult; + + /** + * Verifies a ListFindingsResult 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 ListFindingsResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListFindingsResult + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult; + + /** + * Creates a plain object from a ListFindingsResult message. Also converts values to other types if specified. + * @param message ListFindingsResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListFindingsResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace ListFindingsResult { + + /** Properties of a Resource. */ + interface IResource { + + /** Resource name */ + name?: (string|null); + + /** Resource projectName */ + projectName?: (string|null); + + /** Resource projectDisplayName */ + projectDisplayName?: (string|null); + + /** Resource parentName */ + parentName?: (string|null); + + /** Resource parentDisplayName */ + parentDisplayName?: (string|null); + } + + /** Represents a Resource. */ + class Resource implements IResource { + + /** + * Constructs a new Resource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.IResource); + + /** Resource name. */ + public name: string; + + /** Resource projectName. */ + public projectName: string; + + /** Resource projectDisplayName. */ + public projectDisplayName: string; + + /** Resource parentName. */ + public parentName: string; + + /** Resource parentDisplayName. */ + public parentDisplayName: string; + + /** + * Creates a new Resource instance using the specified properties. + * @param [properties] Properties to set + * @returns Resource instance + */ + public static create(properties?: google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.IResource): google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.Resource; + + /** + * Encodes the specified Resource message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.Resource.verify|verify} messages. + * @param message Resource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.IResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Resource message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.Resource.verify|verify} messages. + * @param message Resource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.IResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Resource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Resource + * @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.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.Resource; + + /** + * Decodes a Resource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Resource + * @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.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.Resource; + + /** + * Verifies a Resource 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 Resource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Resource + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.Resource; + + /** + * Creates a plain object from a Resource message. Also converts values to other types if specified. + * @param message Resource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.Resource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Resource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** StateChange enum. */ + enum StateChange { + UNUSED = 0, + CHANGED = 1, + UNCHANGED = 2, + ADDED = 3, + REMOVED = 4 + } + } + } + + /** Properties of a SetFindingStateRequest. */ + interface ISetFindingStateRequest { + + /** SetFindingStateRequest name */ + name?: (string|null); + + /** SetFindingStateRequest state */ + state?: (google.cloud.securitycenter.v1p1beta1.Finding.State|keyof typeof google.cloud.securitycenter.v1p1beta1.Finding.State|null); /** SetFindingStateRequest startTime */ startTime?: (google.protobuf.ITimestamp|null); @@ -7032,13 +11830,13 @@ export namespace google { * Constructs a new SetFindingStateRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.securitycenter.v1beta1.ISetFindingStateRequest); + constructor(properties?: google.cloud.securitycenter.v1p1beta1.ISetFindingStateRequest); /** SetFindingStateRequest name. */ public name: string; /** SetFindingStateRequest state. */ - public state: (google.cloud.securitycenter.v1beta1.Finding.State|keyof typeof google.cloud.securitycenter.v1beta1.Finding.State); + public state: (google.cloud.securitycenter.v1p1beta1.Finding.State|keyof typeof google.cloud.securitycenter.v1p1beta1.Finding.State); /** SetFindingStateRequest startTime. */ public startTime?: (google.protobuf.ITimestamp|null); @@ -7048,23 +11846,23 @@ export namespace google { * @param [properties] Properties to set * @returns SetFindingStateRequest instance */ - public static create(properties?: google.cloud.securitycenter.v1beta1.ISetFindingStateRequest): google.cloud.securitycenter.v1beta1.SetFindingStateRequest; + public static create(properties?: google.cloud.securitycenter.v1p1beta1.ISetFindingStateRequest): google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest; /** - * Encodes the specified SetFindingStateRequest message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.SetFindingStateRequest.verify|verify} messages. + * Encodes the specified SetFindingStateRequest message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest.verify|verify} messages. * @param message SetFindingStateRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.securitycenter.v1beta1.ISetFindingStateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.securitycenter.v1p1beta1.ISetFindingStateRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified SetFindingStateRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.SetFindingStateRequest.verify|verify} messages. + * Encodes the specified SetFindingStateRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest.verify|verify} messages. * @param message SetFindingStateRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.securitycenter.v1beta1.ISetFindingStateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.securitycenter.v1p1beta1.ISetFindingStateRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** * Decodes a SetFindingStateRequest message from the specified reader or buffer. @@ -7074,7 +11872,7 @@ export namespace google { * @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.cloud.securitycenter.v1beta1.SetFindingStateRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest; /** * Decodes a SetFindingStateRequest message from the specified reader or buffer, length delimited. @@ -7083,7 +11881,7 @@ export namespace google { * @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.cloud.securitycenter.v1beta1.SetFindingStateRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest; /** * Verifies a SetFindingStateRequest message. @@ -7097,7 +11895,7 @@ export namespace google { * @param object Plain object * @returns SetFindingStateRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1beta1.SetFindingStateRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest; /** * Creates a plain object from a SetFindingStateRequest message. Also converts values to other types if specified. @@ -7105,7 +11903,7 @@ export namespace google { * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.securitycenter.v1beta1.SetFindingStateRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** * Converts this SetFindingStateRequest to JSON. @@ -7128,7 +11926,7 @@ export namespace google { * Constructs a new RunAssetDiscoveryRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.securitycenter.v1beta1.IRunAssetDiscoveryRequest); + constructor(properties?: google.cloud.securitycenter.v1p1beta1.IRunAssetDiscoveryRequest); /** RunAssetDiscoveryRequest parent. */ public parent: string; @@ -7138,23 +11936,23 @@ export namespace google { * @param [properties] Properties to set * @returns RunAssetDiscoveryRequest instance */ - public static create(properties?: google.cloud.securitycenter.v1beta1.IRunAssetDiscoveryRequest): google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest; + public static create(properties?: google.cloud.securitycenter.v1p1beta1.IRunAssetDiscoveryRequest): google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryRequest; /** - * Encodes the specified RunAssetDiscoveryRequest message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest.verify|verify} messages. + * Encodes the specified RunAssetDiscoveryRequest message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryRequest.verify|verify} messages. * @param message RunAssetDiscoveryRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.securitycenter.v1beta1.IRunAssetDiscoveryRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.securitycenter.v1p1beta1.IRunAssetDiscoveryRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified RunAssetDiscoveryRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest.verify|verify} messages. + * Encodes the specified RunAssetDiscoveryRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryRequest.verify|verify} messages. * @param message RunAssetDiscoveryRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.securitycenter.v1beta1.IRunAssetDiscoveryRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.securitycenter.v1p1beta1.IRunAssetDiscoveryRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** * Decodes a RunAssetDiscoveryRequest message from the specified reader or buffer. @@ -7164,7 +11962,7 @@ export namespace google { * @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.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryRequest; /** * Decodes a RunAssetDiscoveryRequest message from the specified reader or buffer, length delimited. @@ -7173,7 +11971,7 @@ export namespace google { * @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.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryRequest; /** * Verifies a RunAssetDiscoveryRequest message. @@ -7187,7 +11985,7 @@ export namespace google { * @param object Plain object * @returns RunAssetDiscoveryRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryRequest; /** * Creates a plain object from a RunAssetDiscoveryRequest message. Also converts values to other types if specified. @@ -7195,7 +11993,7 @@ export namespace google { * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** * Converts this RunAssetDiscoveryRequest to JSON. @@ -7208,7 +12006,7 @@ export namespace google { interface IUpdateFindingRequest { /** UpdateFindingRequest finding */ - finding?: (google.cloud.securitycenter.v1beta1.IFinding|null); + finding?: (google.cloud.securitycenter.v1p1beta1.IFinding|null); /** UpdateFindingRequest updateMask */ updateMask?: (google.protobuf.IFieldMask|null); @@ -7221,10 +12019,10 @@ export namespace google { * Constructs a new UpdateFindingRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.securitycenter.v1beta1.IUpdateFindingRequest); + constructor(properties?: google.cloud.securitycenter.v1p1beta1.IUpdateFindingRequest); /** UpdateFindingRequest finding. */ - public finding?: (google.cloud.securitycenter.v1beta1.IFinding|null); + public finding?: (google.cloud.securitycenter.v1p1beta1.IFinding|null); /** UpdateFindingRequest updateMask. */ public updateMask?: (google.protobuf.IFieldMask|null); @@ -7234,23 +12032,23 @@ export namespace google { * @param [properties] Properties to set * @returns UpdateFindingRequest instance */ - public static create(properties?: google.cloud.securitycenter.v1beta1.IUpdateFindingRequest): google.cloud.securitycenter.v1beta1.UpdateFindingRequest; + public static create(properties?: google.cloud.securitycenter.v1p1beta1.IUpdateFindingRequest): google.cloud.securitycenter.v1p1beta1.UpdateFindingRequest; /** - * Encodes the specified UpdateFindingRequest message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.UpdateFindingRequest.verify|verify} messages. + * Encodes the specified UpdateFindingRequest message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.UpdateFindingRequest.verify|verify} messages. * @param message UpdateFindingRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.securitycenter.v1beta1.IUpdateFindingRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.securitycenter.v1p1beta1.IUpdateFindingRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified UpdateFindingRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.UpdateFindingRequest.verify|verify} messages. + * Encodes the specified UpdateFindingRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.UpdateFindingRequest.verify|verify} messages. * @param message UpdateFindingRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.securitycenter.v1beta1.IUpdateFindingRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.securitycenter.v1p1beta1.IUpdateFindingRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** * Decodes an UpdateFindingRequest message from the specified reader or buffer. @@ -7260,7 +12058,7 @@ export namespace google { * @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.cloud.securitycenter.v1beta1.UpdateFindingRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1p1beta1.UpdateFindingRequest; /** * Decodes an UpdateFindingRequest message from the specified reader or buffer, length delimited. @@ -7269,7 +12067,7 @@ export namespace google { * @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.cloud.securitycenter.v1beta1.UpdateFindingRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1p1beta1.UpdateFindingRequest; /** * Verifies an UpdateFindingRequest message. @@ -7283,7 +12081,7 @@ export namespace google { * @param object Plain object * @returns UpdateFindingRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1beta1.UpdateFindingRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1p1beta1.UpdateFindingRequest; /** * Creates a plain object from an UpdateFindingRequest message. Also converts values to other types if specified. @@ -7291,7 +12089,7 @@ export namespace google { * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.securitycenter.v1beta1.UpdateFindingRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.securitycenter.v1p1beta1.UpdateFindingRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** * Converts this UpdateFindingRequest to JSON. @@ -7300,11 +12098,107 @@ export namespace google { public toJSON(): { [k: string]: any }; } + /** Properties of an UpdateNotificationConfigRequest. */ + interface IUpdateNotificationConfigRequest { + + /** UpdateNotificationConfigRequest notificationConfig */ + notificationConfig?: (google.cloud.securitycenter.v1p1beta1.INotificationConfig|null); + + /** UpdateNotificationConfigRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateNotificationConfigRequest. */ + class UpdateNotificationConfigRequest implements IUpdateNotificationConfigRequest { + + /** + * Constructs a new UpdateNotificationConfigRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1p1beta1.IUpdateNotificationConfigRequest); + + /** UpdateNotificationConfigRequest notificationConfig. */ + public notificationConfig?: (google.cloud.securitycenter.v1p1beta1.INotificationConfig|null); + + /** UpdateNotificationConfigRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateNotificationConfigRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateNotificationConfigRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v1p1beta1.IUpdateNotificationConfigRequest): google.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest; + + /** + * Encodes the specified UpdateNotificationConfigRequest message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest.verify|verify} messages. + * @param message UpdateNotificationConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1p1beta1.IUpdateNotificationConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateNotificationConfigRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest.verify|verify} messages. + * @param message UpdateNotificationConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1p1beta1.IUpdateNotificationConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateNotificationConfigRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateNotificationConfigRequest + * @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.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest; + + /** + * Decodes an UpdateNotificationConfigRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateNotificationConfigRequest + * @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.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest; + + /** + * Verifies an UpdateNotificationConfigRequest 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 UpdateNotificationConfigRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateNotificationConfigRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest; + + /** + * Creates a plain object from an UpdateNotificationConfigRequest message. Also converts values to other types if specified. + * @param message UpdateNotificationConfigRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateNotificationConfigRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + /** Properties of an UpdateOrganizationSettingsRequest. */ interface IUpdateOrganizationSettingsRequest { /** UpdateOrganizationSettingsRequest organizationSettings */ - organizationSettings?: (google.cloud.securitycenter.v1beta1.IOrganizationSettings|null); + organizationSettings?: (google.cloud.securitycenter.v1p1beta1.IOrganizationSettings|null); /** UpdateOrganizationSettingsRequest updateMask */ updateMask?: (google.protobuf.IFieldMask|null); @@ -7317,10 +12211,10 @@ export namespace google { * Constructs a new UpdateOrganizationSettingsRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.securitycenter.v1beta1.IUpdateOrganizationSettingsRequest); + constructor(properties?: google.cloud.securitycenter.v1p1beta1.IUpdateOrganizationSettingsRequest); /** UpdateOrganizationSettingsRequest organizationSettings. */ - public organizationSettings?: (google.cloud.securitycenter.v1beta1.IOrganizationSettings|null); + public organizationSettings?: (google.cloud.securitycenter.v1p1beta1.IOrganizationSettings|null); /** UpdateOrganizationSettingsRequest updateMask. */ public updateMask?: (google.protobuf.IFieldMask|null); @@ -7330,23 +12224,23 @@ export namespace google { * @param [properties] Properties to set * @returns UpdateOrganizationSettingsRequest instance */ - public static create(properties?: google.cloud.securitycenter.v1beta1.IUpdateOrganizationSettingsRequest): google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest; + public static create(properties?: google.cloud.securitycenter.v1p1beta1.IUpdateOrganizationSettingsRequest): google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest; /** - * Encodes the specified UpdateOrganizationSettingsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest.verify|verify} messages. + * Encodes the specified UpdateOrganizationSettingsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest.verify|verify} messages. * @param message UpdateOrganizationSettingsRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.securitycenter.v1beta1.IUpdateOrganizationSettingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.securitycenter.v1p1beta1.IUpdateOrganizationSettingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified UpdateOrganizationSettingsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest.verify|verify} messages. + * Encodes the specified UpdateOrganizationSettingsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest.verify|verify} messages. * @param message UpdateOrganizationSettingsRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.securitycenter.v1beta1.IUpdateOrganizationSettingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.securitycenter.v1p1beta1.IUpdateOrganizationSettingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** * Decodes an UpdateOrganizationSettingsRequest message from the specified reader or buffer. @@ -7356,7 +12250,7 @@ export namespace google { * @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.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest; /** * Decodes an UpdateOrganizationSettingsRequest message from the specified reader or buffer, length delimited. @@ -7365,7 +12259,7 @@ export namespace google { * @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.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest; /** * Verifies an UpdateOrganizationSettingsRequest message. @@ -7379,7 +12273,7 @@ export namespace google { * @param object Plain object * @returns UpdateOrganizationSettingsRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest; /** * Creates a plain object from an UpdateOrganizationSettingsRequest message. Also converts values to other types if specified. @@ -7387,7 +12281,7 @@ export namespace google { * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** * Converts this UpdateOrganizationSettingsRequest to JSON. @@ -7400,7 +12294,7 @@ export namespace google { interface IUpdateSourceRequest { /** UpdateSourceRequest source */ - source?: (google.cloud.securitycenter.v1beta1.ISource|null); + source?: (google.cloud.securitycenter.v1p1beta1.ISource|null); /** UpdateSourceRequest updateMask */ updateMask?: (google.protobuf.IFieldMask|null); @@ -7413,10 +12307,10 @@ export namespace google { * Constructs a new UpdateSourceRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.securitycenter.v1beta1.IUpdateSourceRequest); + constructor(properties?: google.cloud.securitycenter.v1p1beta1.IUpdateSourceRequest); /** UpdateSourceRequest source. */ - public source?: (google.cloud.securitycenter.v1beta1.ISource|null); + public source?: (google.cloud.securitycenter.v1p1beta1.ISource|null); /** UpdateSourceRequest updateMask. */ public updateMask?: (google.protobuf.IFieldMask|null); @@ -7426,23 +12320,23 @@ export namespace google { * @param [properties] Properties to set * @returns UpdateSourceRequest instance */ - public static create(properties?: google.cloud.securitycenter.v1beta1.IUpdateSourceRequest): google.cloud.securitycenter.v1beta1.UpdateSourceRequest; + public static create(properties?: google.cloud.securitycenter.v1p1beta1.IUpdateSourceRequest): google.cloud.securitycenter.v1p1beta1.UpdateSourceRequest; /** - * Encodes the specified UpdateSourceRequest message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.UpdateSourceRequest.verify|verify} messages. + * Encodes the specified UpdateSourceRequest message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.UpdateSourceRequest.verify|verify} messages. * @param message UpdateSourceRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.securitycenter.v1beta1.IUpdateSourceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.securitycenter.v1p1beta1.IUpdateSourceRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified UpdateSourceRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.UpdateSourceRequest.verify|verify} messages. + * Encodes the specified UpdateSourceRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.UpdateSourceRequest.verify|verify} messages. * @param message UpdateSourceRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.securitycenter.v1beta1.IUpdateSourceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.securitycenter.v1p1beta1.IUpdateSourceRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** * Decodes an UpdateSourceRequest message from the specified reader or buffer. @@ -7452,7 +12346,7 @@ export namespace google { * @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.cloud.securitycenter.v1beta1.UpdateSourceRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1p1beta1.UpdateSourceRequest; /** * Decodes an UpdateSourceRequest message from the specified reader or buffer, length delimited. @@ -7461,7 +12355,7 @@ export namespace google { * @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.cloud.securitycenter.v1beta1.UpdateSourceRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1p1beta1.UpdateSourceRequest; /** * Verifies an UpdateSourceRequest message. @@ -7475,7 +12369,7 @@ export namespace google { * @param object Plain object * @returns UpdateSourceRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1beta1.UpdateSourceRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1p1beta1.UpdateSourceRequest; /** * Creates a plain object from an UpdateSourceRequest message. Also converts values to other types if specified. @@ -7483,7 +12377,7 @@ export namespace google { * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.securitycenter.v1beta1.UpdateSourceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.securitycenter.v1p1beta1.UpdateSourceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** * Converts this UpdateSourceRequest to JSON. @@ -7496,7 +12390,7 @@ export namespace google { interface IUpdateSecurityMarksRequest { /** UpdateSecurityMarksRequest securityMarks */ - securityMarks?: (google.cloud.securitycenter.v1beta1.ISecurityMarks|null); + securityMarks?: (google.cloud.securitycenter.v1p1beta1.ISecurityMarks|null); /** UpdateSecurityMarksRequest updateMask */ updateMask?: (google.protobuf.IFieldMask|null); @@ -7512,10 +12406,10 @@ export namespace google { * Constructs a new UpdateSecurityMarksRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.securitycenter.v1beta1.IUpdateSecurityMarksRequest); + constructor(properties?: google.cloud.securitycenter.v1p1beta1.IUpdateSecurityMarksRequest); /** UpdateSecurityMarksRequest securityMarks. */ - public securityMarks?: (google.cloud.securitycenter.v1beta1.ISecurityMarks|null); + public securityMarks?: (google.cloud.securitycenter.v1p1beta1.ISecurityMarks|null); /** UpdateSecurityMarksRequest updateMask. */ public updateMask?: (google.protobuf.IFieldMask|null); @@ -7528,23 +12422,23 @@ export namespace google { * @param [properties] Properties to set * @returns UpdateSecurityMarksRequest instance */ - public static create(properties?: google.cloud.securitycenter.v1beta1.IUpdateSecurityMarksRequest): google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest; + public static create(properties?: google.cloud.securitycenter.v1p1beta1.IUpdateSecurityMarksRequest): google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest; /** - * Encodes the specified UpdateSecurityMarksRequest message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest.verify|verify} messages. + * Encodes the specified UpdateSecurityMarksRequest message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest.verify|verify} messages. * @param message UpdateSecurityMarksRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.securitycenter.v1beta1.IUpdateSecurityMarksRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.securitycenter.v1p1beta1.IUpdateSecurityMarksRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified UpdateSecurityMarksRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest.verify|verify} messages. + * Encodes the specified UpdateSecurityMarksRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest.verify|verify} messages. * @param message UpdateSecurityMarksRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.securitycenter.v1beta1.IUpdateSecurityMarksRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.securitycenter.v1p1beta1.IUpdateSecurityMarksRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** * Decodes an UpdateSecurityMarksRequest message from the specified reader or buffer. @@ -7554,7 +12448,7 @@ export namespace google { * @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.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest; /** * Decodes an UpdateSecurityMarksRequest message from the specified reader or buffer, length delimited. @@ -7563,7 +12457,7 @@ export namespace google { * @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.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest; /** * Verifies an UpdateSecurityMarksRequest message. @@ -7577,7 +12471,7 @@ export namespace google { * @param object Plain object * @returns UpdateSecurityMarksRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest; /** * Creates a plain object from an UpdateSecurityMarksRequest message. Also converts values to other types if specified. @@ -7585,7 +12479,7 @@ export namespace google { * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** * Converts this UpdateSecurityMarksRequest to JSON. @@ -7593,6 +12487,108 @@ export namespace google { */ public toJSON(): { [k: string]: any }; } + + /** Properties of a Source. */ + interface ISource { + + /** Source name */ + name?: (string|null); + + /** Source displayName */ + displayName?: (string|null); + + /** Source description */ + description?: (string|null); + } + + /** Represents a Source. */ + class Source implements ISource { + + /** + * Constructs a new Source. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1p1beta1.ISource); + + /** Source name. */ + public name: string; + + /** Source displayName. */ + public displayName: string; + + /** Source description. */ + public description: string; + + /** + * Creates a new Source instance using the specified properties. + * @param [properties] Properties to set + * @returns Source instance + */ + public static create(properties?: google.cloud.securitycenter.v1p1beta1.ISource): google.cloud.securitycenter.v1p1beta1.Source; + + /** + * Encodes the specified Source message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.Source.verify|verify} messages. + * @param message Source message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1p1beta1.ISource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Source message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.Source.verify|verify} messages. + * @param message Source message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1p1beta1.ISource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Source message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Source + * @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.cloud.securitycenter.v1p1beta1.Source; + + /** + * Decodes a Source message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Source + * @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.cloud.securitycenter.v1p1beta1.Source; + + /** + * Verifies a Source 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 Source message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Source + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1p1beta1.Source; + + /** + * Creates a plain object from a Source message. Also converts values to other types if specified. + * @param message Source + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1p1beta1.Source, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Source to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } } } } @@ -7600,16 +12596,6 @@ export namespace google { /** Namespace api. */ namespace api { - /** FieldBehavior enum. */ - enum FieldBehavior { - FIELD_BEHAVIOR_UNSPECIFIED = 0, - OPTIONAL = 1, - REQUIRED = 2, - OUTPUT_ONLY = 3, - INPUT_ONLY = 4, - IMMUTABLE = 5 - } - /** Properties of a ResourceDescriptor. */ interface IResourceDescriptor { @@ -8174,6 +13160,16 @@ export namespace google { */ public toJSON(): { [k: string]: any }; } + + /** FieldBehavior enum. */ + enum FieldBehavior { + FIELD_BEHAVIOR_UNSPECIFIED = 0, + OPTIONAL = 1, + REQUIRED = 2, + OUTPUT_ONLY = 3, + INPUT_ONLY = 4, + IMMUTABLE = 5 + } } /** Namespace protobuf. */ @@ -10033,11 +15029,11 @@ export namespace google { /** 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); + + /** FieldOptions .google.api.fieldBehavior */ + ".google.api.fieldBehavior"?: (google.api.FieldBehavior[]|null); } /** Represents a FieldOptions. */ diff --git a/packages/google-cloud-securitycenter/protos/protos.js b/packages/google-cloud-securitycenter/protos/protos.js index 88c9349500e..9c04e7b3d0f 100644 --- a/packages/google-cloud-securitycenter/protos/protos.js +++ b/packages/google-cloud-securitycenter/protos/protos.js @@ -66,34 +66,31 @@ */ var v1 = {}; - v1.Finding = (function() { + v1.Asset = (function() { /** - * Properties of a Finding. + * Properties of an Asset. * @memberof google.cloud.securitycenter.v1 - * @interface IFinding - * @property {string|null} [name] Finding name - * @property {string|null} [parent] Finding parent - * @property {string|null} [resourceName] Finding resourceName - * @property {google.cloud.securitycenter.v1.Finding.State|null} [state] Finding state - * @property {string|null} [category] Finding category - * @property {string|null} [externalUri] Finding externalUri - * @property {Object.|null} [sourceProperties] Finding sourceProperties - * @property {google.cloud.securitycenter.v1.ISecurityMarks|null} [securityMarks] Finding securityMarks - * @property {google.protobuf.ITimestamp|null} [eventTime] Finding eventTime - * @property {google.protobuf.ITimestamp|null} [createTime] Finding createTime + * @interface IAsset + * @property {string|null} [name] Asset name + * @property {google.cloud.securitycenter.v1.Asset.ISecurityCenterProperties|null} [securityCenterProperties] Asset securityCenterProperties + * @property {Object.|null} [resourceProperties] Asset resourceProperties + * @property {google.cloud.securitycenter.v1.ISecurityMarks|null} [securityMarks] Asset securityMarks + * @property {google.protobuf.ITimestamp|null} [createTime] Asset createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Asset updateTime + * @property {google.cloud.securitycenter.v1.Asset.IIamPolicy|null} [iamPolicy] Asset iamPolicy */ /** - * Constructs a new Finding. + * Constructs a new Asset. * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents a Finding. - * @implements IFinding + * @classdesc Represents an Asset. + * @implements IAsset * @constructor - * @param {google.cloud.securitycenter.v1.IFinding=} [properties] Properties to set + * @param {google.cloud.securitycenter.v1.IAsset=} [properties] Properties to set */ - function Finding(properties) { - this.sourceProperties = {}; + function Asset(properties) { + this.resourceProperties = {}; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -101,163 +98,133 @@ } /** - * Finding name. + * Asset name. * @member {string} name - * @memberof google.cloud.securitycenter.v1.Finding - * @instance - */ - Finding.prototype.name = ""; - - /** - * Finding parent. - * @member {string} parent - * @memberof google.cloud.securitycenter.v1.Finding - * @instance - */ - Finding.prototype.parent = ""; - - /** - * Finding resourceName. - * @member {string} resourceName - * @memberof google.cloud.securitycenter.v1.Finding - * @instance - */ - Finding.prototype.resourceName = ""; - - /** - * Finding state. - * @member {google.cloud.securitycenter.v1.Finding.State} state - * @memberof google.cloud.securitycenter.v1.Finding + * @memberof google.cloud.securitycenter.v1.Asset * @instance */ - Finding.prototype.state = 0; + Asset.prototype.name = ""; /** - * Finding category. - * @member {string} category - * @memberof google.cloud.securitycenter.v1.Finding + * Asset securityCenterProperties. + * @member {google.cloud.securitycenter.v1.Asset.ISecurityCenterProperties|null|undefined} securityCenterProperties + * @memberof google.cloud.securitycenter.v1.Asset * @instance */ - Finding.prototype.category = ""; + Asset.prototype.securityCenterProperties = null; /** - * Finding externalUri. - * @member {string} externalUri - * @memberof google.cloud.securitycenter.v1.Finding + * Asset resourceProperties. + * @member {Object.} resourceProperties + * @memberof google.cloud.securitycenter.v1.Asset * @instance */ - Finding.prototype.externalUri = ""; + Asset.prototype.resourceProperties = $util.emptyObject; /** - * Finding sourceProperties. - * @member {Object.} sourceProperties - * @memberof google.cloud.securitycenter.v1.Finding + * Asset securityMarks. + * @member {google.cloud.securitycenter.v1.ISecurityMarks|null|undefined} securityMarks + * @memberof google.cloud.securitycenter.v1.Asset * @instance */ - Finding.prototype.sourceProperties = $util.emptyObject; + Asset.prototype.securityMarks = null; /** - * Finding securityMarks. - * @member {google.cloud.securitycenter.v1.ISecurityMarks|null|undefined} securityMarks - * @memberof google.cloud.securitycenter.v1.Finding + * Asset createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.securitycenter.v1.Asset * @instance */ - Finding.prototype.securityMarks = null; + Asset.prototype.createTime = null; /** - * Finding eventTime. - * @member {google.protobuf.ITimestamp|null|undefined} eventTime - * @memberof google.cloud.securitycenter.v1.Finding + * Asset updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.securitycenter.v1.Asset * @instance */ - Finding.prototype.eventTime = null; + Asset.prototype.updateTime = null; /** - * Finding createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.securitycenter.v1.Finding + * Asset iamPolicy. + * @member {google.cloud.securitycenter.v1.Asset.IIamPolicy|null|undefined} iamPolicy + * @memberof google.cloud.securitycenter.v1.Asset * @instance */ - Finding.prototype.createTime = null; + Asset.prototype.iamPolicy = null; /** - * Creates a new Finding instance using the specified properties. + * Creates a new Asset instance using the specified properties. * @function create - * @memberof google.cloud.securitycenter.v1.Finding + * @memberof google.cloud.securitycenter.v1.Asset * @static - * @param {google.cloud.securitycenter.v1.IFinding=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.Finding} Finding instance + * @param {google.cloud.securitycenter.v1.IAsset=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.Asset} Asset instance */ - Finding.create = function create(properties) { - return new Finding(properties); + Asset.create = function create(properties) { + return new Asset(properties); }; /** - * Encodes the specified Finding message. Does not implicitly {@link google.cloud.securitycenter.v1.Finding.verify|verify} messages. + * Encodes the specified Asset message. Does not implicitly {@link google.cloud.securitycenter.v1.Asset.verify|verify} messages. * @function encode - * @memberof google.cloud.securitycenter.v1.Finding + * @memberof google.cloud.securitycenter.v1.Asset * @static - * @param {google.cloud.securitycenter.v1.IFinding} message Finding message or plain object to encode + * @param {google.cloud.securitycenter.v1.IAsset} message Asset message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Finding.encode = function encode(message, writer) { + Asset.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.name != null && message.hasOwnProperty("name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.parent != null && message.hasOwnProperty("parent")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.parent); - if (message.resourceName != null && message.hasOwnProperty("resourceName")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.resourceName); - if (message.state != null && message.hasOwnProperty("state")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.state); - if (message.category != null && message.hasOwnProperty("category")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.category); - if (message.externalUri != null && message.hasOwnProperty("externalUri")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.externalUri); - if (message.sourceProperties != null && message.hasOwnProperty("sourceProperties")) - for (var keys = Object.keys(message.sourceProperties), i = 0; i < keys.length; ++i) { + if (message.securityCenterProperties != null && message.hasOwnProperty("securityCenterProperties")) + $root.google.cloud.securitycenter.v1.Asset.SecurityCenterProperties.encode(message.securityCenterProperties, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.resourceProperties != null && message.hasOwnProperty("resourceProperties")) + for (var keys = Object.keys(message.resourceProperties), i = 0; i < keys.length; ++i) { writer.uint32(/* id 7, wireType 2 =*/58).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); - $root.google.protobuf.Value.encode(message.sourceProperties[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + $root.google.protobuf.Value.encode(message.resourceProperties[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); } if (message.securityMarks != null && message.hasOwnProperty("securityMarks")) $root.google.cloud.securitycenter.v1.SecurityMarks.encode(message.securityMarks, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.eventTime != null && message.hasOwnProperty("eventTime")) - $root.google.protobuf.Timestamp.encode(message.eventTime, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); if (message.createTime != null && message.hasOwnProperty("createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.iamPolicy != null && message.hasOwnProperty("iamPolicy")) + $root.google.cloud.securitycenter.v1.Asset.IamPolicy.encode(message.iamPolicy, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); return writer; }; /** - * Encodes the specified Finding message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Finding.verify|verify} messages. + * Encodes the specified Asset message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Asset.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.Finding + * @memberof google.cloud.securitycenter.v1.Asset * @static - * @param {google.cloud.securitycenter.v1.IFinding} message Finding message or plain object to encode + * @param {google.cloud.securitycenter.v1.IAsset} message Asset message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Finding.encodeDelimited = function encodeDelimited(message, writer) { + Asset.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a Finding message from the specified reader or buffer. + * Decodes an Asset message from the specified reader or buffer. * @function decode - * @memberof google.cloud.securitycenter.v1.Finding + * @memberof google.cloud.securitycenter.v1.Asset * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.Finding} Finding + * @returns {google.cloud.securitycenter.v1.Asset} Asset * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Finding.decode = function decode(reader, length) { + Asset.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.cloud.securitycenter.v1.Finding(), key; + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.Asset(), key; while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -265,36 +232,27 @@ message.name = reader.string(); break; case 2: - message.parent = reader.string(); - break; - case 3: - message.resourceName = reader.string(); - break; - case 4: - message.state = reader.int32(); - break; - case 5: - message.category = reader.string(); - break; - case 6: - message.externalUri = reader.string(); + message.securityCenterProperties = $root.google.cloud.securitycenter.v1.Asset.SecurityCenterProperties.decode(reader, reader.uint32()); break; case 7: reader.skip().pos++; - if (message.sourceProperties === $util.emptyObject) - message.sourceProperties = {}; + if (message.resourceProperties === $util.emptyObject) + message.resourceProperties = {}; key = reader.string(); reader.pos++; - message.sourceProperties[key] = $root.google.protobuf.Value.decode(reader, reader.uint32()); + message.resourceProperties[key] = $root.google.protobuf.Value.decode(reader, reader.uint32()); break; case 8: message.securityMarks = $root.google.cloud.securitycenter.v1.SecurityMarks.decode(reader, reader.uint32()); break; case 9: - message.eventTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; case 10: - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 11: + message.iamPolicy = $root.google.cloud.securitycenter.v1.Asset.IamPolicy.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -305,64 +263,48 @@ }; /** - * Decodes a Finding message from the specified reader or buffer, length delimited. + * Decodes an Asset message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.Finding + * @memberof google.cloud.securitycenter.v1.Asset * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.Finding} Finding + * @returns {google.cloud.securitycenter.v1.Asset} Asset * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Finding.decodeDelimited = function decodeDelimited(reader) { + Asset.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a Finding message. + * Verifies an Asset message. * @function verify - * @memberof google.cloud.securitycenter.v1.Finding + * @memberof google.cloud.securitycenter.v1.Asset * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Finding.verify = function verify(message) { + Asset.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.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.resourceName != null && message.hasOwnProperty("resourceName")) - if (!$util.isString(message.resourceName)) - return "resourceName: string expected"; - if (message.state != null && message.hasOwnProperty("state")) - switch (message.state) { - default: - return "state: 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"; - if (message.externalUri != null && message.hasOwnProperty("externalUri")) - if (!$util.isString(message.externalUri)) - return "externalUri: string expected"; - if (message.sourceProperties != null && message.hasOwnProperty("sourceProperties")) { - if (!$util.isObject(message.sourceProperties)) - return "sourceProperties: object expected"; - var key = Object.keys(message.sourceProperties); + if (message.securityCenterProperties != null && message.hasOwnProperty("securityCenterProperties")) { + var error = $root.google.cloud.securitycenter.v1.Asset.SecurityCenterProperties.verify(message.securityCenterProperties); + if (error) + return "securityCenterProperties." + error; + } + if (message.resourceProperties != null && message.hasOwnProperty("resourceProperties")) { + if (!$util.isObject(message.resourceProperties)) + return "resourceProperties: object expected"; + var key = Object.keys(message.resourceProperties); for (var i = 0; i < key.length; ++i) { - var error = $root.google.protobuf.Value.verify(message.sourceProperties[key[i]]); + var error = $root.google.protobuf.Value.verify(message.resourceProperties[key[i]]); if (error) - return "sourceProperties." + error; + return "resourceProperties." + error; } } if (message.securityMarks != null && message.hasOwnProperty("securityMarks")) { @@ -370,556 +312,782 @@ if (error) return "securityMarks." + error; } - if (message.eventTime != null && message.hasOwnProperty("eventTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.eventTime); - if (error) - return "eventTime." + error; - } if (message.createTime != null && message.hasOwnProperty("createTime")) { var error = $root.google.protobuf.Timestamp.verify(message.createTime); if (error) return "createTime." + error; } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.iamPolicy != null && message.hasOwnProperty("iamPolicy")) { + var error = $root.google.cloud.securitycenter.v1.Asset.IamPolicy.verify(message.iamPolicy); + if (error) + return "iamPolicy." + error; + } return null; }; /** - * Creates a Finding message from a plain object. Also converts values to their respective internal types. + * Creates an Asset message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.securitycenter.v1.Finding + * @memberof google.cloud.securitycenter.v1.Asset * @static * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.Finding} Finding + * @returns {google.cloud.securitycenter.v1.Asset} Asset */ - Finding.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.Finding) + Asset.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.Asset) return object; - var message = new $root.google.cloud.securitycenter.v1.Finding(); + var message = new $root.google.cloud.securitycenter.v1.Asset(); if (object.name != null) message.name = String(object.name); - if (object.parent != null) - message.parent = String(object.parent); - if (object.resourceName != null) - message.resourceName = String(object.resourceName); - switch (object.state) { - case "STATE_UNSPECIFIED": - case 0: - message.state = 0; - break; - case "ACTIVE": - case 1: - message.state = 1; - break; - case "INACTIVE": - case 2: - message.state = 2; - break; + if (object.securityCenterProperties != null) { + if (typeof object.securityCenterProperties !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Asset.securityCenterProperties: object expected"); + message.securityCenterProperties = $root.google.cloud.securitycenter.v1.Asset.SecurityCenterProperties.fromObject(object.securityCenterProperties); } - if (object.category != null) - message.category = String(object.category); - if (object.externalUri != null) - message.externalUri = String(object.externalUri); - if (object.sourceProperties) { - if (typeof object.sourceProperties !== "object") - throw TypeError(".google.cloud.securitycenter.v1.Finding.sourceProperties: object expected"); - message.sourceProperties = {}; - for (var keys = Object.keys(object.sourceProperties), i = 0; i < keys.length; ++i) { - if (typeof object.sourceProperties[keys[i]] !== "object") - throw TypeError(".google.cloud.securitycenter.v1.Finding.sourceProperties: object expected"); - message.sourceProperties[keys[i]] = $root.google.protobuf.Value.fromObject(object.sourceProperties[keys[i]]); + if (object.resourceProperties) { + if (typeof object.resourceProperties !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Asset.resourceProperties: object expected"); + message.resourceProperties = {}; + for (var keys = Object.keys(object.resourceProperties), i = 0; i < keys.length; ++i) { + if (typeof object.resourceProperties[keys[i]] !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Asset.resourceProperties: object expected"); + message.resourceProperties[keys[i]] = $root.google.protobuf.Value.fromObject(object.resourceProperties[keys[i]]); } } if (object.securityMarks != null) { if (typeof object.securityMarks !== "object") - throw TypeError(".google.cloud.securitycenter.v1.Finding.securityMarks: object expected"); + throw TypeError(".google.cloud.securitycenter.v1.Asset.securityMarks: object expected"); message.securityMarks = $root.google.cloud.securitycenter.v1.SecurityMarks.fromObject(object.securityMarks); } - if (object.eventTime != null) { - if (typeof object.eventTime !== "object") - throw TypeError(".google.cloud.securitycenter.v1.Finding.eventTime: object expected"); - message.eventTime = $root.google.protobuf.Timestamp.fromObject(object.eventTime); - } if (object.createTime != null) { if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.securitycenter.v1.Finding.createTime: object expected"); + throw TypeError(".google.cloud.securitycenter.v1.Asset.createTime: object expected"); message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Asset.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.iamPolicy != null) { + if (typeof object.iamPolicy !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Asset.iamPolicy: object expected"); + message.iamPolicy = $root.google.cloud.securitycenter.v1.Asset.IamPolicy.fromObject(object.iamPolicy); + } return message; }; /** - * Creates a plain object from a Finding message. Also converts values to other types if specified. + * Creates a plain object from an Asset message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.securitycenter.v1.Finding + * @memberof google.cloud.securitycenter.v1.Asset * @static - * @param {google.cloud.securitycenter.v1.Finding} message Finding + * @param {google.cloud.securitycenter.v1.Asset} message Asset * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Finding.toObject = function toObject(message, options) { + Asset.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.objects || options.defaults) - object.sourceProperties = {}; + object.resourceProperties = {}; if (options.defaults) { object.name = ""; - object.parent = ""; - object.resourceName = ""; - object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; - object.category = ""; - object.externalUri = ""; + object.securityCenterProperties = null; object.securityMarks = null; - object.eventTime = null; object.createTime = null; + object.updateTime = null; + object.iamPolicy = null; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.resourceName != null && message.hasOwnProperty("resourceName")) - object.resourceName = message.resourceName; - if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.securitycenter.v1.Finding.State[message.state] : message.state; - if (message.category != null && message.hasOwnProperty("category")) - object.category = message.category; - if (message.externalUri != null && message.hasOwnProperty("externalUri")) - object.externalUri = message.externalUri; + if (message.securityCenterProperties != null && message.hasOwnProperty("securityCenterProperties")) + object.securityCenterProperties = $root.google.cloud.securitycenter.v1.Asset.SecurityCenterProperties.toObject(message.securityCenterProperties, options); var keys2; - if (message.sourceProperties && (keys2 = Object.keys(message.sourceProperties)).length) { - object.sourceProperties = {}; + if (message.resourceProperties && (keys2 = Object.keys(message.resourceProperties)).length) { + object.resourceProperties = {}; for (var j = 0; j < keys2.length; ++j) - object.sourceProperties[keys2[j]] = $root.google.protobuf.Value.toObject(message.sourceProperties[keys2[j]], options); + object.resourceProperties[keys2[j]] = $root.google.protobuf.Value.toObject(message.resourceProperties[keys2[j]], options); } if (message.securityMarks != null && message.hasOwnProperty("securityMarks")) object.securityMarks = $root.google.cloud.securitycenter.v1.SecurityMarks.toObject(message.securityMarks, options); - if (message.eventTime != null && message.hasOwnProperty("eventTime")) - object.eventTime = $root.google.protobuf.Timestamp.toObject(message.eventTime, options); if (message.createTime != null && message.hasOwnProperty("createTime")) object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.iamPolicy != null && message.hasOwnProperty("iamPolicy")) + object.iamPolicy = $root.google.cloud.securitycenter.v1.Asset.IamPolicy.toObject(message.iamPolicy, options); return object; }; /** - * Converts this Finding to JSON. + * Converts this Asset to JSON. * @function toJSON - * @memberof google.cloud.securitycenter.v1.Finding + * @memberof google.cloud.securitycenter.v1.Asset * @instance * @returns {Object.} JSON object */ - Finding.prototype.toJSON = function toJSON() { + Asset.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - /** - * State enum. - * @name google.cloud.securitycenter.v1.Finding.State - * @enum {string} - * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value - * @property {number} ACTIVE=1 ACTIVE value - * @property {number} INACTIVE=2 INACTIVE value - */ - Finding.State = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; - values[valuesById[1] = "ACTIVE"] = 1; - values[valuesById[2] = "INACTIVE"] = 2; - return values; - })(); + Asset.SecurityCenterProperties = (function() { - return Finding; - })(); + /** + * Properties of a SecurityCenterProperties. + * @memberof google.cloud.securitycenter.v1.Asset + * @interface ISecurityCenterProperties + * @property {string|null} [resourceName] SecurityCenterProperties resourceName + * @property {string|null} [resourceType] SecurityCenterProperties resourceType + * @property {string|null} [resourceParent] SecurityCenterProperties resourceParent + * @property {string|null} [resourceProject] SecurityCenterProperties resourceProject + * @property {Array.|null} [resourceOwners] SecurityCenterProperties resourceOwners + * @property {string|null} [resourceDisplayName] SecurityCenterProperties resourceDisplayName + * @property {string|null} [resourceParentDisplayName] SecurityCenterProperties resourceParentDisplayName + * @property {string|null} [resourceProjectDisplayName] SecurityCenterProperties resourceProjectDisplayName + */ - v1.SecurityMarks = (function() { + /** + * Constructs a new SecurityCenterProperties. + * @memberof google.cloud.securitycenter.v1.Asset + * @classdesc Represents a SecurityCenterProperties. + * @implements ISecurityCenterProperties + * @constructor + * @param {google.cloud.securitycenter.v1.Asset.ISecurityCenterProperties=} [properties] Properties to set + */ + function SecurityCenterProperties(properties) { + this.resourceOwners = []; + 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]]; + } - /** - * Properties of a SecurityMarks. - * @memberof google.cloud.securitycenter.v1 - * @interface ISecurityMarks - * @property {string|null} [name] SecurityMarks name - * @property {Object.|null} [marks] SecurityMarks marks - */ + /** + * SecurityCenterProperties resourceName. + * @member {string} resourceName + * @memberof google.cloud.securitycenter.v1.Asset.SecurityCenterProperties + * @instance + */ + SecurityCenterProperties.prototype.resourceName = ""; - /** - * Constructs a new SecurityMarks. - * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents a SecurityMarks. - * @implements ISecurityMarks - * @constructor - * @param {google.cloud.securitycenter.v1.ISecurityMarks=} [properties] Properties to set - */ - function SecurityMarks(properties) { - this.marks = {}; - 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]]; - } + /** + * SecurityCenterProperties resourceType. + * @member {string} resourceType + * @memberof google.cloud.securitycenter.v1.Asset.SecurityCenterProperties + * @instance + */ + SecurityCenterProperties.prototype.resourceType = ""; - /** - * SecurityMarks name. - * @member {string} name - * @memberof google.cloud.securitycenter.v1.SecurityMarks - * @instance - */ - SecurityMarks.prototype.name = ""; + /** + * SecurityCenterProperties resourceParent. + * @member {string} resourceParent + * @memberof google.cloud.securitycenter.v1.Asset.SecurityCenterProperties + * @instance + */ + SecurityCenterProperties.prototype.resourceParent = ""; - /** - * SecurityMarks marks. - * @member {Object.} marks - * @memberof google.cloud.securitycenter.v1.SecurityMarks - * @instance - */ - SecurityMarks.prototype.marks = $util.emptyObject; + /** + * SecurityCenterProperties resourceProject. + * @member {string} resourceProject + * @memberof google.cloud.securitycenter.v1.Asset.SecurityCenterProperties + * @instance + */ + SecurityCenterProperties.prototype.resourceProject = ""; - /** - * Creates a new SecurityMarks instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v1.SecurityMarks - * @static - * @param {google.cloud.securitycenter.v1.ISecurityMarks=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.SecurityMarks} SecurityMarks instance - */ - SecurityMarks.create = function create(properties) { - return new SecurityMarks(properties); - }; - - /** - * Encodes the specified SecurityMarks message. Does not implicitly {@link google.cloud.securitycenter.v1.SecurityMarks.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1.SecurityMarks - * @static - * @param {google.cloud.securitycenter.v1.ISecurityMarks} message SecurityMarks message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SecurityMarks.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.marks != null && message.hasOwnProperty("marks")) - for (var keys = Object.keys(message.marks), i = 0; i < keys.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.marks[keys[i]]).ldelim(); - return writer; - }; - - /** - * Encodes the specified SecurityMarks message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.SecurityMarks.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.SecurityMarks - * @static - * @param {google.cloud.securitycenter.v1.ISecurityMarks} message SecurityMarks message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SecurityMarks.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SecurityMarks message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v1.SecurityMarks - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.SecurityMarks} SecurityMarks - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SecurityMarks.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.cloud.securitycenter.v1.SecurityMarks(), key; - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - reader.skip().pos++; - if (message.marks === $util.emptyObject) - message.marks = {}; - key = reader.string(); - reader.pos++; - message.marks[key] = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * SecurityCenterProperties resourceOwners. + * @member {Array.} resourceOwners + * @memberof google.cloud.securitycenter.v1.Asset.SecurityCenterProperties + * @instance + */ + SecurityCenterProperties.prototype.resourceOwners = $util.emptyArray; - /** - * Decodes a SecurityMarks message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.SecurityMarks - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.SecurityMarks} SecurityMarks - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SecurityMarks.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * SecurityCenterProperties resourceDisplayName. + * @member {string} resourceDisplayName + * @memberof google.cloud.securitycenter.v1.Asset.SecurityCenterProperties + * @instance + */ + SecurityCenterProperties.prototype.resourceDisplayName = ""; - /** - * Verifies a SecurityMarks message. - * @function verify - * @memberof google.cloud.securitycenter.v1.SecurityMarks - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SecurityMarks.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.marks != null && message.hasOwnProperty("marks")) { - if (!$util.isObject(message.marks)) - return "marks: object expected"; - var key = Object.keys(message.marks); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.marks[key[i]])) - return "marks: string{k:string} expected"; - } - return null; - }; + /** + * SecurityCenterProperties resourceParentDisplayName. + * @member {string} resourceParentDisplayName + * @memberof google.cloud.securitycenter.v1.Asset.SecurityCenterProperties + * @instance + */ + SecurityCenterProperties.prototype.resourceParentDisplayName = ""; - /** - * Creates a SecurityMarks message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v1.SecurityMarks - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.SecurityMarks} SecurityMarks - */ - SecurityMarks.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.SecurityMarks) - return object; - var message = new $root.google.cloud.securitycenter.v1.SecurityMarks(); - if (object.name != null) - message.name = String(object.name); - if (object.marks) { - if (typeof object.marks !== "object") - throw TypeError(".google.cloud.securitycenter.v1.SecurityMarks.marks: object expected"); - message.marks = {}; - for (var keys = Object.keys(object.marks), i = 0; i < keys.length; ++i) - message.marks[keys[i]] = String(object.marks[keys[i]]); - } - return message; - }; + /** + * SecurityCenterProperties resourceProjectDisplayName. + * @member {string} resourceProjectDisplayName + * @memberof google.cloud.securitycenter.v1.Asset.SecurityCenterProperties + * @instance + */ + SecurityCenterProperties.prototype.resourceProjectDisplayName = ""; - /** - * Creates a plain object from a SecurityMarks message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v1.SecurityMarks - * @static - * @param {google.cloud.securitycenter.v1.SecurityMarks} message SecurityMarks - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SecurityMarks.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.objects || options.defaults) - object.marks = {}; - if (options.defaults) - object.name = ""; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - var keys2; - if (message.marks && (keys2 = Object.keys(message.marks)).length) { - object.marks = {}; - for (var j = 0; j < keys2.length; ++j) - object.marks[keys2[j]] = message.marks[keys2[j]]; - } - return object; - }; + /** + * Creates a new SecurityCenterProperties instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.Asset.SecurityCenterProperties + * @static + * @param {google.cloud.securitycenter.v1.Asset.ISecurityCenterProperties=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.Asset.SecurityCenterProperties} SecurityCenterProperties instance + */ + SecurityCenterProperties.create = function create(properties) { + return new SecurityCenterProperties(properties); + }; - /** - * Converts this SecurityMarks to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1.SecurityMarks - * @instance - * @returns {Object.} JSON object - */ - SecurityMarks.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Encodes the specified SecurityCenterProperties message. Does not implicitly {@link google.cloud.securitycenter.v1.Asset.SecurityCenterProperties.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.Asset.SecurityCenterProperties + * @static + * @param {google.cloud.securitycenter.v1.Asset.ISecurityCenterProperties} message SecurityCenterProperties message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SecurityCenterProperties.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.resourceName != null && message.hasOwnProperty("resourceName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.resourceName); + if (message.resourceType != null && message.hasOwnProperty("resourceType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.resourceType); + if (message.resourceParent != null && message.hasOwnProperty("resourceParent")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.resourceParent); + if (message.resourceProject != null && message.hasOwnProperty("resourceProject")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.resourceProject); + if (message.resourceOwners != null && message.resourceOwners.length) + for (var i = 0; i < message.resourceOwners.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.resourceOwners[i]); + if (message.resourceDisplayName != null && message.hasOwnProperty("resourceDisplayName")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.resourceDisplayName); + if (message.resourceParentDisplayName != null && message.hasOwnProperty("resourceParentDisplayName")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.resourceParentDisplayName); + if (message.resourceProjectDisplayName != null && message.hasOwnProperty("resourceProjectDisplayName")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.resourceProjectDisplayName); + return writer; + }; - return SecurityMarks; - })(); + /** + * Encodes the specified SecurityCenterProperties message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Asset.SecurityCenterProperties.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.Asset.SecurityCenterProperties + * @static + * @param {google.cloud.securitycenter.v1.Asset.ISecurityCenterProperties} message SecurityCenterProperties message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SecurityCenterProperties.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - v1.Asset = (function() { + /** + * Decodes a SecurityCenterProperties message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.Asset.SecurityCenterProperties + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.Asset.SecurityCenterProperties} SecurityCenterProperties + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SecurityCenterProperties.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.cloud.securitycenter.v1.Asset.SecurityCenterProperties(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.resourceName = reader.string(); + break; + case 2: + message.resourceType = reader.string(); + break; + case 3: + message.resourceParent = reader.string(); + break; + case 4: + message.resourceProject = reader.string(); + break; + case 5: + if (!(message.resourceOwners && message.resourceOwners.length)) + message.resourceOwners = []; + message.resourceOwners.push(reader.string()); + break; + case 6: + message.resourceDisplayName = reader.string(); + break; + case 7: + message.resourceParentDisplayName = reader.string(); + break; + case 8: + message.resourceProjectDisplayName = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Properties of an Asset. - * @memberof google.cloud.securitycenter.v1 - * @interface IAsset - * @property {string|null} [name] Asset name - * @property {google.cloud.securitycenter.v1.Asset.ISecurityCenterProperties|null} [securityCenterProperties] Asset securityCenterProperties - * @property {Object.|null} [resourceProperties] Asset resourceProperties - * @property {google.cloud.securitycenter.v1.ISecurityMarks|null} [securityMarks] Asset securityMarks - * @property {google.protobuf.ITimestamp|null} [createTime] Asset createTime - * @property {google.protobuf.ITimestamp|null} [updateTime] Asset updateTime - * @property {google.cloud.securitycenter.v1.Asset.IIamPolicy|null} [iamPolicy] Asset iamPolicy - */ + /** + * Decodes a SecurityCenterProperties message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.Asset.SecurityCenterProperties + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.Asset.SecurityCenterProperties} SecurityCenterProperties + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SecurityCenterProperties.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Constructs a new Asset. - * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents an Asset. - * @implements IAsset - * @constructor - * @param {google.cloud.securitycenter.v1.IAsset=} [properties] Properties to set - */ - function Asset(properties) { - this.resourceProperties = {}; - 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]]; - } + /** + * Verifies a SecurityCenterProperties message. + * @function verify + * @memberof google.cloud.securitycenter.v1.Asset.SecurityCenterProperties + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SecurityCenterProperties.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.resourceName != null && message.hasOwnProperty("resourceName")) + if (!$util.isString(message.resourceName)) + return "resourceName: string expected"; + if (message.resourceType != null && message.hasOwnProperty("resourceType")) + if (!$util.isString(message.resourceType)) + return "resourceType: string expected"; + if (message.resourceParent != null && message.hasOwnProperty("resourceParent")) + if (!$util.isString(message.resourceParent)) + return "resourceParent: string expected"; + if (message.resourceProject != null && message.hasOwnProperty("resourceProject")) + if (!$util.isString(message.resourceProject)) + return "resourceProject: string expected"; + if (message.resourceOwners != null && message.hasOwnProperty("resourceOwners")) { + if (!Array.isArray(message.resourceOwners)) + return "resourceOwners: array expected"; + for (var i = 0; i < message.resourceOwners.length; ++i) + if (!$util.isString(message.resourceOwners[i])) + return "resourceOwners: string[] expected"; + } + if (message.resourceDisplayName != null && message.hasOwnProperty("resourceDisplayName")) + if (!$util.isString(message.resourceDisplayName)) + return "resourceDisplayName: string expected"; + if (message.resourceParentDisplayName != null && message.hasOwnProperty("resourceParentDisplayName")) + if (!$util.isString(message.resourceParentDisplayName)) + return "resourceParentDisplayName: string expected"; + if (message.resourceProjectDisplayName != null && message.hasOwnProperty("resourceProjectDisplayName")) + if (!$util.isString(message.resourceProjectDisplayName)) + return "resourceProjectDisplayName: string expected"; + return null; + }; - /** - * Asset name. - * @member {string} name - * @memberof google.cloud.securitycenter.v1.Asset - * @instance - */ - Asset.prototype.name = ""; + /** + * Creates a SecurityCenterProperties message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.Asset.SecurityCenterProperties + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.Asset.SecurityCenterProperties} SecurityCenterProperties + */ + SecurityCenterProperties.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.Asset.SecurityCenterProperties) + return object; + var message = new $root.google.cloud.securitycenter.v1.Asset.SecurityCenterProperties(); + if (object.resourceName != null) + message.resourceName = String(object.resourceName); + if (object.resourceType != null) + message.resourceType = String(object.resourceType); + if (object.resourceParent != null) + message.resourceParent = String(object.resourceParent); + if (object.resourceProject != null) + message.resourceProject = String(object.resourceProject); + if (object.resourceOwners) { + if (!Array.isArray(object.resourceOwners)) + throw TypeError(".google.cloud.securitycenter.v1.Asset.SecurityCenterProperties.resourceOwners: array expected"); + message.resourceOwners = []; + for (var i = 0; i < object.resourceOwners.length; ++i) + message.resourceOwners[i] = String(object.resourceOwners[i]); + } + if (object.resourceDisplayName != null) + message.resourceDisplayName = String(object.resourceDisplayName); + if (object.resourceParentDisplayName != null) + message.resourceParentDisplayName = String(object.resourceParentDisplayName); + if (object.resourceProjectDisplayName != null) + message.resourceProjectDisplayName = String(object.resourceProjectDisplayName); + return message; + }; - /** - * Asset securityCenterProperties. - * @member {google.cloud.securitycenter.v1.Asset.ISecurityCenterProperties|null|undefined} securityCenterProperties - * @memberof google.cloud.securitycenter.v1.Asset - * @instance - */ - Asset.prototype.securityCenterProperties = null; + /** + * Creates a plain object from a SecurityCenterProperties message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.Asset.SecurityCenterProperties + * @static + * @param {google.cloud.securitycenter.v1.Asset.SecurityCenterProperties} message SecurityCenterProperties + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SecurityCenterProperties.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.resourceOwners = []; + if (options.defaults) { + object.resourceName = ""; + object.resourceType = ""; + object.resourceParent = ""; + object.resourceProject = ""; + object.resourceDisplayName = ""; + object.resourceParentDisplayName = ""; + object.resourceProjectDisplayName = ""; + } + if (message.resourceName != null && message.hasOwnProperty("resourceName")) + object.resourceName = message.resourceName; + if (message.resourceType != null && message.hasOwnProperty("resourceType")) + object.resourceType = message.resourceType; + if (message.resourceParent != null && message.hasOwnProperty("resourceParent")) + object.resourceParent = message.resourceParent; + if (message.resourceProject != null && message.hasOwnProperty("resourceProject")) + object.resourceProject = message.resourceProject; + if (message.resourceOwners && message.resourceOwners.length) { + object.resourceOwners = []; + for (var j = 0; j < message.resourceOwners.length; ++j) + object.resourceOwners[j] = message.resourceOwners[j]; + } + if (message.resourceDisplayName != null && message.hasOwnProperty("resourceDisplayName")) + object.resourceDisplayName = message.resourceDisplayName; + if (message.resourceParentDisplayName != null && message.hasOwnProperty("resourceParentDisplayName")) + object.resourceParentDisplayName = message.resourceParentDisplayName; + if (message.resourceProjectDisplayName != null && message.hasOwnProperty("resourceProjectDisplayName")) + object.resourceProjectDisplayName = message.resourceProjectDisplayName; + return object; + }; - /** - * Asset resourceProperties. - * @member {Object.} resourceProperties - * @memberof google.cloud.securitycenter.v1.Asset - * @instance - */ - Asset.prototype.resourceProperties = $util.emptyObject; + /** + * Converts this SecurityCenterProperties to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.Asset.SecurityCenterProperties + * @instance + * @returns {Object.} JSON object + */ + SecurityCenterProperties.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Asset securityMarks. - * @member {google.cloud.securitycenter.v1.ISecurityMarks|null|undefined} securityMarks - * @memberof google.cloud.securitycenter.v1.Asset - * @instance - */ - Asset.prototype.securityMarks = null; + return SecurityCenterProperties; + })(); - /** - * Asset createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.securitycenter.v1.Asset - * @instance + Asset.IamPolicy = (function() { + + /** + * Properties of an IamPolicy. + * @memberof google.cloud.securitycenter.v1.Asset + * @interface IIamPolicy + * @property {string|null} [policyBlob] IamPolicy policyBlob + */ + + /** + * Constructs a new IamPolicy. + * @memberof google.cloud.securitycenter.v1.Asset + * @classdesc Represents an IamPolicy. + * @implements IIamPolicy + * @constructor + * @param {google.cloud.securitycenter.v1.Asset.IIamPolicy=} [properties] Properties to set + */ + function IamPolicy(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]]; + } + + /** + * IamPolicy policyBlob. + * @member {string} policyBlob + * @memberof google.cloud.securitycenter.v1.Asset.IamPolicy + * @instance + */ + IamPolicy.prototype.policyBlob = ""; + + /** + * Creates a new IamPolicy instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.Asset.IamPolicy + * @static + * @param {google.cloud.securitycenter.v1.Asset.IIamPolicy=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.Asset.IamPolicy} IamPolicy instance + */ + IamPolicy.create = function create(properties) { + return new IamPolicy(properties); + }; + + /** + * Encodes the specified IamPolicy message. Does not implicitly {@link google.cloud.securitycenter.v1.Asset.IamPolicy.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.Asset.IamPolicy + * @static + * @param {google.cloud.securitycenter.v1.Asset.IIamPolicy} message IamPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IamPolicy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.policyBlob != null && message.hasOwnProperty("policyBlob")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.policyBlob); + return writer; + }; + + /** + * Encodes the specified IamPolicy message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Asset.IamPolicy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.Asset.IamPolicy + * @static + * @param {google.cloud.securitycenter.v1.Asset.IIamPolicy} message IamPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IamPolicy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an IamPolicy message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.Asset.IamPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.Asset.IamPolicy} IamPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IamPolicy.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.cloud.securitycenter.v1.Asset.IamPolicy(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.policyBlob = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an IamPolicy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.Asset.IamPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.Asset.IamPolicy} IamPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IamPolicy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an IamPolicy message. + * @function verify + * @memberof google.cloud.securitycenter.v1.Asset.IamPolicy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IamPolicy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.policyBlob != null && message.hasOwnProperty("policyBlob")) + if (!$util.isString(message.policyBlob)) + return "policyBlob: string expected"; + return null; + }; + + /** + * Creates an IamPolicy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.Asset.IamPolicy + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.Asset.IamPolicy} IamPolicy + */ + IamPolicy.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.Asset.IamPolicy) + return object; + var message = new $root.google.cloud.securitycenter.v1.Asset.IamPolicy(); + if (object.policyBlob != null) + message.policyBlob = String(object.policyBlob); + return message; + }; + + /** + * Creates a plain object from an IamPolicy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.Asset.IamPolicy + * @static + * @param {google.cloud.securitycenter.v1.Asset.IamPolicy} message IamPolicy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IamPolicy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.policyBlob = ""; + if (message.policyBlob != null && message.hasOwnProperty("policyBlob")) + object.policyBlob = message.policyBlob; + return object; + }; + + /** + * Converts this IamPolicy to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.Asset.IamPolicy + * @instance + * @returns {Object.} JSON object + */ + IamPolicy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return IamPolicy; + })(); + + return Asset; + })(); + + v1.SecurityMarks = (function() { + + /** + * Properties of a SecurityMarks. + * @memberof google.cloud.securitycenter.v1 + * @interface ISecurityMarks + * @property {string|null} [name] SecurityMarks name + * @property {Object.|null} [marks] SecurityMarks marks */ - Asset.prototype.createTime = null; /** - * Asset updateTime. - * @member {google.protobuf.ITimestamp|null|undefined} updateTime - * @memberof google.cloud.securitycenter.v1.Asset + * Constructs a new SecurityMarks. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a SecurityMarks. + * @implements ISecurityMarks + * @constructor + * @param {google.cloud.securitycenter.v1.ISecurityMarks=} [properties] Properties to set + */ + function SecurityMarks(properties) { + this.marks = {}; + 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]]; + } + + /** + * SecurityMarks name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1.SecurityMarks * @instance */ - Asset.prototype.updateTime = null; + SecurityMarks.prototype.name = ""; /** - * Asset iamPolicy. - * @member {google.cloud.securitycenter.v1.Asset.IIamPolicy|null|undefined} iamPolicy - * @memberof google.cloud.securitycenter.v1.Asset + * SecurityMarks marks. + * @member {Object.} marks + * @memberof google.cloud.securitycenter.v1.SecurityMarks * @instance */ - Asset.prototype.iamPolicy = null; + SecurityMarks.prototype.marks = $util.emptyObject; /** - * Creates a new Asset instance using the specified properties. + * Creates a new SecurityMarks instance using the specified properties. * @function create - * @memberof google.cloud.securitycenter.v1.Asset + * @memberof google.cloud.securitycenter.v1.SecurityMarks * @static - * @param {google.cloud.securitycenter.v1.IAsset=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.Asset} Asset instance + * @param {google.cloud.securitycenter.v1.ISecurityMarks=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.SecurityMarks} SecurityMarks instance */ - Asset.create = function create(properties) { - return new Asset(properties); + SecurityMarks.create = function create(properties) { + return new SecurityMarks(properties); }; /** - * Encodes the specified Asset message. Does not implicitly {@link google.cloud.securitycenter.v1.Asset.verify|verify} messages. + * Encodes the specified SecurityMarks message. Does not implicitly {@link google.cloud.securitycenter.v1.SecurityMarks.verify|verify} messages. * @function encode - * @memberof google.cloud.securitycenter.v1.Asset + * @memberof google.cloud.securitycenter.v1.SecurityMarks * @static - * @param {google.cloud.securitycenter.v1.IAsset} message Asset message or plain object to encode + * @param {google.cloud.securitycenter.v1.ISecurityMarks} message SecurityMarks message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Asset.encode = function encode(message, writer) { + SecurityMarks.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.name != null && message.hasOwnProperty("name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.securityCenterProperties != null && message.hasOwnProperty("securityCenterProperties")) - $root.google.cloud.securitycenter.v1.Asset.SecurityCenterProperties.encode(message.securityCenterProperties, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.resourceProperties != null && message.hasOwnProperty("resourceProperties")) - for (var keys = Object.keys(message.resourceProperties), i = 0; i < keys.length; ++i) { - writer.uint32(/* id 7, wireType 2 =*/58).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); - $root.google.protobuf.Value.encode(message.resourceProperties[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); - } - if (message.securityMarks != null && message.hasOwnProperty("securityMarks")) - $root.google.cloud.securitycenter.v1.SecurityMarks.encode(message.securityMarks, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.createTime != null && message.hasOwnProperty("createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.updateTime != null && message.hasOwnProperty("updateTime")) - $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); - if (message.iamPolicy != null && message.hasOwnProperty("iamPolicy")) - $root.google.cloud.securitycenter.v1.Asset.IamPolicy.encode(message.iamPolicy, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.marks != null && message.hasOwnProperty("marks")) + for (var keys = Object.keys(message.marks), i = 0; i < keys.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.marks[keys[i]]).ldelim(); return writer; }; /** - * Encodes the specified Asset message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Asset.verify|verify} messages. + * Encodes the specified SecurityMarks message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.SecurityMarks.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.Asset + * @memberof google.cloud.securitycenter.v1.SecurityMarks * @static - * @param {google.cloud.securitycenter.v1.IAsset} message Asset message or plain object to encode + * @param {google.cloud.securitycenter.v1.ISecurityMarks} message SecurityMarks message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Asset.encodeDelimited = function encodeDelimited(message, writer) { + SecurityMarks.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an Asset message from the specified reader or buffer. + * Decodes a SecurityMarks message from the specified reader or buffer. * @function decode - * @memberof google.cloud.securitycenter.v1.Asset + * @memberof google.cloud.securitycenter.v1.SecurityMarks * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.Asset} Asset + * @returns {google.cloud.securitycenter.v1.SecurityMarks} SecurityMarks * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Asset.decode = function decode(reader, length) { + SecurityMarks.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.cloud.securitycenter.v1.Asset(), key; + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.SecurityMarks(), key; while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -927,27 +1095,12 @@ message.name = reader.string(); break; case 2: - message.securityCenterProperties = $root.google.cloud.securitycenter.v1.Asset.SecurityCenterProperties.decode(reader, reader.uint32()); - break; - case 7: reader.skip().pos++; - if (message.resourceProperties === $util.emptyObject) - message.resourceProperties = {}; + if (message.marks === $util.emptyObject) + message.marks = {}; key = reader.string(); reader.pos++; - message.resourceProperties[key] = $root.google.protobuf.Value.decode(reader, reader.uint32()); - break; - case 8: - message.securityMarks = $root.google.cloud.securitycenter.v1.SecurityMarks.decode(reader, reader.uint32()); - break; - case 9: - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 10: - message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 11: - message.iamPolicy = $root.google.cloud.securitycenter.v1.Asset.IamPolicy.decode(reader, reader.uint32()); + message.marks[key] = reader.string(); break; default: reader.skipType(tag & 7); @@ -958,557 +1111,10001 @@ }; /** - * Decodes an Asset message from the specified reader or buffer, length delimited. + * Decodes a SecurityMarks message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.Asset + * @memberof google.cloud.securitycenter.v1.SecurityMarks * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.Asset} Asset + * @returns {google.cloud.securitycenter.v1.SecurityMarks} SecurityMarks * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Asset.decodeDelimited = function decodeDelimited(reader) { + SecurityMarks.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an Asset message. + * Verifies a SecurityMarks message. * @function verify - * @memberof google.cloud.securitycenter.v1.Asset + * @memberof google.cloud.securitycenter.v1.SecurityMarks * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Asset.verify = function verify(message) { + SecurityMarks.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.securityCenterProperties != null && message.hasOwnProperty("securityCenterProperties")) { - var error = $root.google.cloud.securitycenter.v1.Asset.SecurityCenterProperties.verify(message.securityCenterProperties); - if (error) - return "securityCenterProperties." + error; - } - if (message.resourceProperties != null && message.hasOwnProperty("resourceProperties")) { - if (!$util.isObject(message.resourceProperties)) - return "resourceProperties: object expected"; - var key = Object.keys(message.resourceProperties); - for (var i = 0; i < key.length; ++i) { - var error = $root.google.protobuf.Value.verify(message.resourceProperties[key[i]]); - if (error) - return "resourceProperties." + error; - } - } - if (message.securityMarks != null && message.hasOwnProperty("securityMarks")) { - var error = $root.google.cloud.securitycenter.v1.SecurityMarks.verify(message.securityMarks); - if (error) - return "securityMarks." + error; - } - if (message.createTime != null && message.hasOwnProperty("createTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.createTime); - if (error) - return "createTime." + error; - } - if (message.updateTime != null && message.hasOwnProperty("updateTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.updateTime); - if (error) - return "updateTime." + error; - } - if (message.iamPolicy != null && message.hasOwnProperty("iamPolicy")) { - var error = $root.google.cloud.securitycenter.v1.Asset.IamPolicy.verify(message.iamPolicy); - if (error) - return "iamPolicy." + error; + if (message.marks != null && message.hasOwnProperty("marks")) { + if (!$util.isObject(message.marks)) + return "marks: object expected"; + var key = Object.keys(message.marks); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.marks[key[i]])) + return "marks: string{k:string} expected"; } return null; }; /** - * Creates an Asset message from a plain object. Also converts values to their respective internal types. + * Creates a SecurityMarks message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.securitycenter.v1.Asset + * @memberof google.cloud.securitycenter.v1.SecurityMarks * @static * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.Asset} Asset + * @returns {google.cloud.securitycenter.v1.SecurityMarks} SecurityMarks */ - Asset.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.Asset) + SecurityMarks.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.SecurityMarks) return object; - var message = new $root.google.cloud.securitycenter.v1.Asset(); + var message = new $root.google.cloud.securitycenter.v1.SecurityMarks(); if (object.name != null) message.name = String(object.name); - if (object.securityCenterProperties != null) { - if (typeof object.securityCenterProperties !== "object") - throw TypeError(".google.cloud.securitycenter.v1.Asset.securityCenterProperties: object expected"); - message.securityCenterProperties = $root.google.cloud.securitycenter.v1.Asset.SecurityCenterProperties.fromObject(object.securityCenterProperties); - } - if (object.resourceProperties) { - if (typeof object.resourceProperties !== "object") - throw TypeError(".google.cloud.securitycenter.v1.Asset.resourceProperties: object expected"); - message.resourceProperties = {}; - for (var keys = Object.keys(object.resourceProperties), i = 0; i < keys.length; ++i) { - if (typeof object.resourceProperties[keys[i]] !== "object") - throw TypeError(".google.cloud.securitycenter.v1.Asset.resourceProperties: object expected"); - message.resourceProperties[keys[i]] = $root.google.protobuf.Value.fromObject(object.resourceProperties[keys[i]]); - } - } - if (object.securityMarks != null) { - if (typeof object.securityMarks !== "object") - throw TypeError(".google.cloud.securitycenter.v1.Asset.securityMarks: object expected"); - message.securityMarks = $root.google.cloud.securitycenter.v1.SecurityMarks.fromObject(object.securityMarks); - } - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.securitycenter.v1.Asset.createTime: object expected"); - message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); - } - if (object.updateTime != null) { - if (typeof object.updateTime !== "object") - throw TypeError(".google.cloud.securitycenter.v1.Asset.updateTime: object expected"); - message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); - } - if (object.iamPolicy != null) { - if (typeof object.iamPolicy !== "object") - throw TypeError(".google.cloud.securitycenter.v1.Asset.iamPolicy: object expected"); - message.iamPolicy = $root.google.cloud.securitycenter.v1.Asset.IamPolicy.fromObject(object.iamPolicy); + if (object.marks) { + if (typeof object.marks !== "object") + throw TypeError(".google.cloud.securitycenter.v1.SecurityMarks.marks: object expected"); + message.marks = {}; + for (var keys = Object.keys(object.marks), i = 0; i < keys.length; ++i) + message.marks[keys[i]] = String(object.marks[keys[i]]); } return message; }; /** - * Creates a plain object from an Asset message. Also converts values to other types if specified. + * Creates a plain object from a SecurityMarks message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.securitycenter.v1.Asset + * @memberof google.cloud.securitycenter.v1.SecurityMarks * @static - * @param {google.cloud.securitycenter.v1.Asset} message Asset + * @param {google.cloud.securitycenter.v1.SecurityMarks} message SecurityMarks * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Asset.toObject = function toObject(message, options) { + SecurityMarks.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.objects || options.defaults) - object.resourceProperties = {}; - if (options.defaults) { + object.marks = {}; + if (options.defaults) object.name = ""; - object.securityCenterProperties = null; - object.securityMarks = null; - object.createTime = null; - object.updateTime = null; - object.iamPolicy = null; - } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; - if (message.securityCenterProperties != null && message.hasOwnProperty("securityCenterProperties")) - object.securityCenterProperties = $root.google.cloud.securitycenter.v1.Asset.SecurityCenterProperties.toObject(message.securityCenterProperties, options); var keys2; - if (message.resourceProperties && (keys2 = Object.keys(message.resourceProperties)).length) { - object.resourceProperties = {}; + if (message.marks && (keys2 = Object.keys(message.marks)).length) { + object.marks = {}; for (var j = 0; j < keys2.length; ++j) - object.resourceProperties[keys2[j]] = $root.google.protobuf.Value.toObject(message.resourceProperties[keys2[j]], options); + object.marks[keys2[j]] = message.marks[keys2[j]]; } - if (message.securityMarks != null && message.hasOwnProperty("securityMarks")) - object.securityMarks = $root.google.cloud.securitycenter.v1.SecurityMarks.toObject(message.securityMarks, options); - if (message.createTime != null && message.hasOwnProperty("createTime")) - object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); - if (message.updateTime != null && message.hasOwnProperty("updateTime")) - object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); - if (message.iamPolicy != null && message.hasOwnProperty("iamPolicy")) - object.iamPolicy = $root.google.cloud.securitycenter.v1.Asset.IamPolicy.toObject(message.iamPolicy, options); return object; }; /** - * Converts this Asset to JSON. + * Converts this SecurityMarks to JSON. * @function toJSON - * @memberof google.cloud.securitycenter.v1.Asset + * @memberof google.cloud.securitycenter.v1.SecurityMarks * @instance * @returns {Object.} JSON object */ - Asset.prototype.toJSON = function toJSON() { + SecurityMarks.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - Asset.SecurityCenterProperties = (function() { + return SecurityMarks; + })(); - /** - * Properties of a SecurityCenterProperties. - * @memberof google.cloud.securitycenter.v1.Asset - * @interface ISecurityCenterProperties - * @property {string|null} [resourceName] SecurityCenterProperties resourceName - * @property {string|null} [resourceType] SecurityCenterProperties resourceType - * @property {string|null} [resourceParent] SecurityCenterProperties resourceParent - * @property {string|null} [resourceProject] SecurityCenterProperties resourceProject - * @property {Array.|null} [resourceOwners] SecurityCenterProperties resourceOwners - * @property {string|null} [resourceDisplayName] SecurityCenterProperties resourceDisplayName - * @property {string|null} [resourceParentDisplayName] SecurityCenterProperties resourceParentDisplayName - * @property {string|null} [resourceProjectDisplayName] SecurityCenterProperties resourceProjectDisplayName - */ + v1.Finding = (function() { - /** - * Constructs a new SecurityCenterProperties. - * @memberof google.cloud.securitycenter.v1.Asset - * @classdesc Represents a SecurityCenterProperties. - * @implements ISecurityCenterProperties - * @constructor - * @param {google.cloud.securitycenter.v1.Asset.ISecurityCenterProperties=} [properties] Properties to set - */ - function SecurityCenterProperties(properties) { - this.resourceOwners = []; - 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]]; - } + /** + * Properties of a Finding. + * @memberof google.cloud.securitycenter.v1 + * @interface IFinding + * @property {string|null} [name] Finding name + * @property {string|null} [parent] Finding parent + * @property {string|null} [resourceName] Finding resourceName + * @property {google.cloud.securitycenter.v1.Finding.State|null} [state] Finding state + * @property {string|null} [category] Finding category + * @property {string|null} [externalUri] Finding externalUri + * @property {Object.|null} [sourceProperties] Finding sourceProperties + * @property {google.cloud.securitycenter.v1.ISecurityMarks|null} [securityMarks] Finding securityMarks + * @property {google.protobuf.ITimestamp|null} [eventTime] Finding eventTime + * @property {google.protobuf.ITimestamp|null} [createTime] Finding createTime + */ - /** - * SecurityCenterProperties resourceName. - * @member {string} resourceName - * @memberof google.cloud.securitycenter.v1.Asset.SecurityCenterProperties - * @instance - */ - SecurityCenterProperties.prototype.resourceName = ""; + /** + * Constructs a new Finding. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a Finding. + * @implements IFinding + * @constructor + * @param {google.cloud.securitycenter.v1.IFinding=} [properties] Properties to set + */ + function Finding(properties) { + this.sourceProperties = {}; + 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]]; + } - /** - * SecurityCenterProperties resourceType. - * @member {string} resourceType - * @memberof google.cloud.securitycenter.v1.Asset.SecurityCenterProperties - * @instance - */ - SecurityCenterProperties.prototype.resourceType = ""; + /** + * Finding name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1.Finding + * @instance + */ + Finding.prototype.name = ""; - /** - * SecurityCenterProperties resourceParent. - * @member {string} resourceParent - * @memberof google.cloud.securitycenter.v1.Asset.SecurityCenterProperties - * @instance - */ - SecurityCenterProperties.prototype.resourceParent = ""; + /** + * Finding parent. + * @member {string} parent + * @memberof google.cloud.securitycenter.v1.Finding + * @instance + */ + Finding.prototype.parent = ""; - /** - * SecurityCenterProperties resourceProject. - * @member {string} resourceProject - * @memberof google.cloud.securitycenter.v1.Asset.SecurityCenterProperties - * @instance - */ - SecurityCenterProperties.prototype.resourceProject = ""; + /** + * Finding resourceName. + * @member {string} resourceName + * @memberof google.cloud.securitycenter.v1.Finding + * @instance + */ + Finding.prototype.resourceName = ""; - /** - * SecurityCenterProperties resourceOwners. - * @member {Array.} resourceOwners - * @memberof google.cloud.securitycenter.v1.Asset.SecurityCenterProperties - * @instance - */ - SecurityCenterProperties.prototype.resourceOwners = $util.emptyArray; + /** + * Finding state. + * @member {google.cloud.securitycenter.v1.Finding.State} state + * @memberof google.cloud.securitycenter.v1.Finding + * @instance + */ + Finding.prototype.state = 0; - /** - * SecurityCenterProperties resourceDisplayName. - * @member {string} resourceDisplayName - * @memberof google.cloud.securitycenter.v1.Asset.SecurityCenterProperties - * @instance - */ - SecurityCenterProperties.prototype.resourceDisplayName = ""; + /** + * Finding category. + * @member {string} category + * @memberof google.cloud.securitycenter.v1.Finding + * @instance + */ + Finding.prototype.category = ""; - /** - * SecurityCenterProperties resourceParentDisplayName. - * @member {string} resourceParentDisplayName - * @memberof google.cloud.securitycenter.v1.Asset.SecurityCenterProperties - * @instance - */ - SecurityCenterProperties.prototype.resourceParentDisplayName = ""; + /** + * Finding externalUri. + * @member {string} externalUri + * @memberof google.cloud.securitycenter.v1.Finding + * @instance + */ + Finding.prototype.externalUri = ""; - /** - * SecurityCenterProperties resourceProjectDisplayName. - * @member {string} resourceProjectDisplayName - * @memberof google.cloud.securitycenter.v1.Asset.SecurityCenterProperties - * @instance - */ - SecurityCenterProperties.prototype.resourceProjectDisplayName = ""; + /** + * Finding sourceProperties. + * @member {Object.} sourceProperties + * @memberof google.cloud.securitycenter.v1.Finding + * @instance + */ + Finding.prototype.sourceProperties = $util.emptyObject; - /** - * Creates a new SecurityCenterProperties instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v1.Asset.SecurityCenterProperties - * @static - * @param {google.cloud.securitycenter.v1.Asset.ISecurityCenterProperties=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.Asset.SecurityCenterProperties} SecurityCenterProperties instance - */ - SecurityCenterProperties.create = function create(properties) { - return new SecurityCenterProperties(properties); - }; + /** + * Finding securityMarks. + * @member {google.cloud.securitycenter.v1.ISecurityMarks|null|undefined} securityMarks + * @memberof google.cloud.securitycenter.v1.Finding + * @instance + */ + Finding.prototype.securityMarks = null; - /** - * Encodes the specified SecurityCenterProperties message. Does not implicitly {@link google.cloud.securitycenter.v1.Asset.SecurityCenterProperties.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1.Asset.SecurityCenterProperties - * @static - * @param {google.cloud.securitycenter.v1.Asset.ISecurityCenterProperties} message SecurityCenterProperties message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SecurityCenterProperties.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.resourceName != null && message.hasOwnProperty("resourceName")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.resourceName); - if (message.resourceType != null && message.hasOwnProperty("resourceType")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.resourceType); - if (message.resourceParent != null && message.hasOwnProperty("resourceParent")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.resourceParent); - if (message.resourceProject != null && message.hasOwnProperty("resourceProject")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.resourceProject); - if (message.resourceOwners != null && message.resourceOwners.length) - for (var i = 0; i < message.resourceOwners.length; ++i) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.resourceOwners[i]); - if (message.resourceDisplayName != null && message.hasOwnProperty("resourceDisplayName")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.resourceDisplayName); - if (message.resourceParentDisplayName != null && message.hasOwnProperty("resourceParentDisplayName")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.resourceParentDisplayName); - if (message.resourceProjectDisplayName != null && message.hasOwnProperty("resourceProjectDisplayName")) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.resourceProjectDisplayName); - return writer; - }; + /** + * Finding eventTime. + * @member {google.protobuf.ITimestamp|null|undefined} eventTime + * @memberof google.cloud.securitycenter.v1.Finding + * @instance + */ + Finding.prototype.eventTime = null; - /** - * Encodes the specified SecurityCenterProperties message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Asset.SecurityCenterProperties.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.Asset.SecurityCenterProperties - * @static - * @param {google.cloud.securitycenter.v1.Asset.ISecurityCenterProperties} message SecurityCenterProperties message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SecurityCenterProperties.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Finding createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.securitycenter.v1.Finding + * @instance + */ + Finding.prototype.createTime = null; - /** - * Decodes a SecurityCenterProperties message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v1.Asset.SecurityCenterProperties - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.Asset.SecurityCenterProperties} SecurityCenterProperties - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SecurityCenterProperties.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.cloud.securitycenter.v1.Asset.SecurityCenterProperties(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.resourceName = reader.string(); - break; - case 2: - message.resourceType = reader.string(); - break; - case 3: - message.resourceParent = reader.string(); - break; - case 4: - message.resourceProject = reader.string(); - break; - case 5: - if (!(message.resourceOwners && message.resourceOwners.length)) - message.resourceOwners = []; - message.resourceOwners.push(reader.string()); - break; - case 6: - message.resourceDisplayName = reader.string(); - break; - case 7: - message.resourceParentDisplayName = reader.string(); - break; - case 8: - message.resourceProjectDisplayName = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Creates a new Finding instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.Finding + * @static + * @param {google.cloud.securitycenter.v1.IFinding=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.Finding} Finding instance + */ + Finding.create = function create(properties) { + return new Finding(properties); + }; - /** - * Decodes a SecurityCenterProperties message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.Asset.SecurityCenterProperties - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.Asset.SecurityCenterProperties} SecurityCenterProperties - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SecurityCenterProperties.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Encodes the specified Finding message. Does not implicitly {@link google.cloud.securitycenter.v1.Finding.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.Finding + * @static + * @param {google.cloud.securitycenter.v1.IFinding} message Finding message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Finding.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.parent != null && message.hasOwnProperty("parent")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.parent); + if (message.resourceName != null && message.hasOwnProperty("resourceName")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.resourceName); + if (message.state != null && message.hasOwnProperty("state")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.state); + if (message.category != null && message.hasOwnProperty("category")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.category); + if (message.externalUri != null && message.hasOwnProperty("externalUri")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.externalUri); + if (message.sourceProperties != null && message.hasOwnProperty("sourceProperties")) + for (var keys = Object.keys(message.sourceProperties), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 7, wireType 2 =*/58).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.protobuf.Value.encode(message.sourceProperties[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.securityMarks != null && message.hasOwnProperty("securityMarks")) + $root.google.cloud.securitycenter.v1.SecurityMarks.encode(message.securityMarks, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.eventTime != null && message.hasOwnProperty("eventTime")) + $root.google.protobuf.Timestamp.encode(message.eventTime, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.createTime != null && message.hasOwnProperty("createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + return writer; + }; - /** - * Verifies a SecurityCenterProperties message. - * @function verify - * @memberof google.cloud.securitycenter.v1.Asset.SecurityCenterProperties - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SecurityCenterProperties.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.resourceName != null && message.hasOwnProperty("resourceName")) - if (!$util.isString(message.resourceName)) - return "resourceName: string expected"; - if (message.resourceType != null && message.hasOwnProperty("resourceType")) - if (!$util.isString(message.resourceType)) - return "resourceType: string expected"; - if (message.resourceParent != null && message.hasOwnProperty("resourceParent")) - if (!$util.isString(message.resourceParent)) - return "resourceParent: string expected"; - if (message.resourceProject != null && message.hasOwnProperty("resourceProject")) - if (!$util.isString(message.resourceProject)) - return "resourceProject: string expected"; - if (message.resourceOwners != null && message.hasOwnProperty("resourceOwners")) { - if (!Array.isArray(message.resourceOwners)) - return "resourceOwners: array expected"; - for (var i = 0; i < message.resourceOwners.length; ++i) - if (!$util.isString(message.resourceOwners[i])) - return "resourceOwners: string[] expected"; + /** + * Encodes the specified Finding message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Finding.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.Finding + * @static + * @param {google.cloud.securitycenter.v1.IFinding} message Finding message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Finding.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Finding message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.Finding + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.Finding} Finding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Finding.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.cloud.securitycenter.v1.Finding(), key; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.parent = reader.string(); + break; + case 3: + message.resourceName = reader.string(); + break; + case 4: + message.state = reader.int32(); + break; + case 5: + message.category = reader.string(); + break; + case 6: + message.externalUri = reader.string(); + break; + case 7: + reader.skip().pos++; + if (message.sourceProperties === $util.emptyObject) + message.sourceProperties = {}; + key = reader.string(); + reader.pos++; + message.sourceProperties[key] = $root.google.protobuf.Value.decode(reader, reader.uint32()); + break; + case 8: + message.securityMarks = $root.google.cloud.securitycenter.v1.SecurityMarks.decode(reader, reader.uint32()); + break; + case 9: + message.eventTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 10: + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; } - if (message.resourceDisplayName != null && message.hasOwnProperty("resourceDisplayName")) - if (!$util.isString(message.resourceDisplayName)) - return "resourceDisplayName: string expected"; - if (message.resourceParentDisplayName != null && message.hasOwnProperty("resourceParentDisplayName")) - if (!$util.isString(message.resourceParentDisplayName)) - return "resourceParentDisplayName: string expected"; - if (message.resourceProjectDisplayName != null && message.hasOwnProperty("resourceProjectDisplayName")) - if (!$util.isString(message.resourceProjectDisplayName)) - return "resourceProjectDisplayName: string expected"; - return null; - }; + } + return message; + }; + + /** + * Decodes a Finding message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.Finding + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.Finding} Finding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Finding.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Finding message. + * @function verify + * @memberof google.cloud.securitycenter.v1.Finding + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Finding.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.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.resourceName != null && message.hasOwnProperty("resourceName")) + if (!$util.isString(message.resourceName)) + return "resourceName: string expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: 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"; + if (message.externalUri != null && message.hasOwnProperty("externalUri")) + if (!$util.isString(message.externalUri)) + return "externalUri: string expected"; + if (message.sourceProperties != null && message.hasOwnProperty("sourceProperties")) { + if (!$util.isObject(message.sourceProperties)) + return "sourceProperties: object expected"; + var key = Object.keys(message.sourceProperties); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.protobuf.Value.verify(message.sourceProperties[key[i]]); + if (error) + return "sourceProperties." + error; + } + } + if (message.securityMarks != null && message.hasOwnProperty("securityMarks")) { + var error = $root.google.cloud.securitycenter.v1.SecurityMarks.verify(message.securityMarks); + if (error) + return "securityMarks." + error; + } + if (message.eventTime != null && message.hasOwnProperty("eventTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.eventTime); + if (error) + return "eventTime." + error; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + return null; + }; + + /** + * Creates a Finding message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.Finding + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.Finding} Finding + */ + Finding.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.Finding) + return object; + var message = new $root.google.cloud.securitycenter.v1.Finding(); + if (object.name != null) + message.name = String(object.name); + if (object.parent != null) + message.parent = String(object.parent); + if (object.resourceName != null) + message.resourceName = String(object.resourceName); + switch (object.state) { + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "ACTIVE": + case 1: + message.state = 1; + break; + case "INACTIVE": + case 2: + message.state = 2; + break; + } + if (object.category != null) + message.category = String(object.category); + if (object.externalUri != null) + message.externalUri = String(object.externalUri); + if (object.sourceProperties) { + if (typeof object.sourceProperties !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Finding.sourceProperties: object expected"); + message.sourceProperties = {}; + for (var keys = Object.keys(object.sourceProperties), i = 0; i < keys.length; ++i) { + if (typeof object.sourceProperties[keys[i]] !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Finding.sourceProperties: object expected"); + message.sourceProperties[keys[i]] = $root.google.protobuf.Value.fromObject(object.sourceProperties[keys[i]]); + } + } + if (object.securityMarks != null) { + if (typeof object.securityMarks !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Finding.securityMarks: object expected"); + message.securityMarks = $root.google.cloud.securitycenter.v1.SecurityMarks.fromObject(object.securityMarks); + } + if (object.eventTime != null) { + if (typeof object.eventTime !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Finding.eventTime: object expected"); + message.eventTime = $root.google.protobuf.Timestamp.fromObject(object.eventTime); + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Finding.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + return message; + }; + + /** + * Creates a plain object from a Finding message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.Finding + * @static + * @param {google.cloud.securitycenter.v1.Finding} message Finding + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Finding.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.sourceProperties = {}; + if (options.defaults) { + object.name = ""; + object.parent = ""; + object.resourceName = ""; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.category = ""; + object.externalUri = ""; + object.securityMarks = null; + object.eventTime = null; + object.createTime = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.resourceName != null && message.hasOwnProperty("resourceName")) + object.resourceName = message.resourceName; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.securitycenter.v1.Finding.State[message.state] : message.state; + if (message.category != null && message.hasOwnProperty("category")) + object.category = message.category; + if (message.externalUri != null && message.hasOwnProperty("externalUri")) + object.externalUri = message.externalUri; + var keys2; + if (message.sourceProperties && (keys2 = Object.keys(message.sourceProperties)).length) { + object.sourceProperties = {}; + for (var j = 0; j < keys2.length; ++j) + object.sourceProperties[keys2[j]] = $root.google.protobuf.Value.toObject(message.sourceProperties[keys2[j]], options); + } + if (message.securityMarks != null && message.hasOwnProperty("securityMarks")) + object.securityMarks = $root.google.cloud.securitycenter.v1.SecurityMarks.toObject(message.securityMarks, options); + if (message.eventTime != null && message.hasOwnProperty("eventTime")) + object.eventTime = $root.google.protobuf.Timestamp.toObject(message.eventTime, options); + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + return object; + }; + + /** + * Converts this Finding to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.Finding + * @instance + * @returns {Object.} JSON object + */ + Finding.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * State enum. + * @name google.cloud.securitycenter.v1.Finding.State + * @enum {string} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} ACTIVE=1 ACTIVE value + * @property {number} INACTIVE=2 INACTIVE value + */ + Finding.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ACTIVE"] = 1; + values[valuesById[2] = "INACTIVE"] = 2; + return values; + })(); + + return Finding; + })(); + + v1.OrganizationSettings = (function() { + + /** + * Properties of an OrganizationSettings. + * @memberof google.cloud.securitycenter.v1 + * @interface IOrganizationSettings + * @property {string|null} [name] OrganizationSettings name + * @property {boolean|null} [enableAssetDiscovery] OrganizationSettings enableAssetDiscovery + * @property {google.cloud.securitycenter.v1.OrganizationSettings.IAssetDiscoveryConfig|null} [assetDiscoveryConfig] OrganizationSettings assetDiscoveryConfig + */ + + /** + * Constructs a new OrganizationSettings. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents an OrganizationSettings. + * @implements IOrganizationSettings + * @constructor + * @param {google.cloud.securitycenter.v1.IOrganizationSettings=} [properties] Properties to set + */ + function OrganizationSettings(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]]; + } + + /** + * OrganizationSettings name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1.OrganizationSettings + * @instance + */ + OrganizationSettings.prototype.name = ""; + + /** + * OrganizationSettings enableAssetDiscovery. + * @member {boolean} enableAssetDiscovery + * @memberof google.cloud.securitycenter.v1.OrganizationSettings + * @instance + */ + OrganizationSettings.prototype.enableAssetDiscovery = false; + + /** + * OrganizationSettings assetDiscoveryConfig. + * @member {google.cloud.securitycenter.v1.OrganizationSettings.IAssetDiscoveryConfig|null|undefined} assetDiscoveryConfig + * @memberof google.cloud.securitycenter.v1.OrganizationSettings + * @instance + */ + OrganizationSettings.prototype.assetDiscoveryConfig = null; + + /** + * Creates a new OrganizationSettings instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.OrganizationSettings + * @static + * @param {google.cloud.securitycenter.v1.IOrganizationSettings=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.OrganizationSettings} OrganizationSettings instance + */ + OrganizationSettings.create = function create(properties) { + return new OrganizationSettings(properties); + }; + + /** + * Encodes the specified OrganizationSettings message. Does not implicitly {@link google.cloud.securitycenter.v1.OrganizationSettings.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.OrganizationSettings + * @static + * @param {google.cloud.securitycenter.v1.IOrganizationSettings} message OrganizationSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OrganizationSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.enableAssetDiscovery != null && message.hasOwnProperty("enableAssetDiscovery")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.enableAssetDiscovery); + if (message.assetDiscoveryConfig != null && message.hasOwnProperty("assetDiscoveryConfig")) + $root.google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.encode(message.assetDiscoveryConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OrganizationSettings message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.OrganizationSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.OrganizationSettings + * @static + * @param {google.cloud.securitycenter.v1.IOrganizationSettings} message OrganizationSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OrganizationSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OrganizationSettings message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.OrganizationSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.OrganizationSettings} OrganizationSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OrganizationSettings.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.cloud.securitycenter.v1.OrganizationSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.enableAssetDiscovery = reader.bool(); + break; + case 3: + message.assetDiscoveryConfig = $root.google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OrganizationSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.OrganizationSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.OrganizationSettings} OrganizationSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OrganizationSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OrganizationSettings message. + * @function verify + * @memberof google.cloud.securitycenter.v1.OrganizationSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OrganizationSettings.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.enableAssetDiscovery != null && message.hasOwnProperty("enableAssetDiscovery")) + if (typeof message.enableAssetDiscovery !== "boolean") + return "enableAssetDiscovery: boolean expected"; + if (message.assetDiscoveryConfig != null && message.hasOwnProperty("assetDiscoveryConfig")) { + var error = $root.google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.verify(message.assetDiscoveryConfig); + if (error) + return "assetDiscoveryConfig." + error; + } + return null; + }; + + /** + * Creates an OrganizationSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.OrganizationSettings + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.OrganizationSettings} OrganizationSettings + */ + OrganizationSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.OrganizationSettings) + return object; + var message = new $root.google.cloud.securitycenter.v1.OrganizationSettings(); + if (object.name != null) + message.name = String(object.name); + if (object.enableAssetDiscovery != null) + message.enableAssetDiscovery = Boolean(object.enableAssetDiscovery); + if (object.assetDiscoveryConfig != null) { + if (typeof object.assetDiscoveryConfig !== "object") + throw TypeError(".google.cloud.securitycenter.v1.OrganizationSettings.assetDiscoveryConfig: object expected"); + message.assetDiscoveryConfig = $root.google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.fromObject(object.assetDiscoveryConfig); + } + return message; + }; + + /** + * Creates a plain object from an OrganizationSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.OrganizationSettings + * @static + * @param {google.cloud.securitycenter.v1.OrganizationSettings} message OrganizationSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OrganizationSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.enableAssetDiscovery = false; + object.assetDiscoveryConfig = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.enableAssetDiscovery != null && message.hasOwnProperty("enableAssetDiscovery")) + object.enableAssetDiscovery = message.enableAssetDiscovery; + if (message.assetDiscoveryConfig != null && message.hasOwnProperty("assetDiscoveryConfig")) + object.assetDiscoveryConfig = $root.google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.toObject(message.assetDiscoveryConfig, options); + return object; + }; + + /** + * Converts this OrganizationSettings to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.OrganizationSettings + * @instance + * @returns {Object.} JSON object + */ + OrganizationSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + OrganizationSettings.AssetDiscoveryConfig = (function() { + + /** + * Properties of an AssetDiscoveryConfig. + * @memberof google.cloud.securitycenter.v1.OrganizationSettings + * @interface IAssetDiscoveryConfig + * @property {Array.|null} [projectIds] AssetDiscoveryConfig projectIds + * @property {google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode|null} [inclusionMode] AssetDiscoveryConfig inclusionMode + */ + + /** + * Constructs a new AssetDiscoveryConfig. + * @memberof google.cloud.securitycenter.v1.OrganizationSettings + * @classdesc Represents an AssetDiscoveryConfig. + * @implements IAssetDiscoveryConfig + * @constructor + * @param {google.cloud.securitycenter.v1.OrganizationSettings.IAssetDiscoveryConfig=} [properties] Properties to set + */ + function AssetDiscoveryConfig(properties) { + this.projectIds = []; + 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]]; + } + + /** + * AssetDiscoveryConfig projectIds. + * @member {Array.} projectIds + * @memberof google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig + * @instance + */ + AssetDiscoveryConfig.prototype.projectIds = $util.emptyArray; + + /** + * AssetDiscoveryConfig inclusionMode. + * @member {google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode} inclusionMode + * @memberof google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig + * @instance + */ + AssetDiscoveryConfig.prototype.inclusionMode = 0; + + /** + * Creates a new AssetDiscoveryConfig instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig + * @static + * @param {google.cloud.securitycenter.v1.OrganizationSettings.IAssetDiscoveryConfig=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig} AssetDiscoveryConfig instance + */ + AssetDiscoveryConfig.create = function create(properties) { + return new AssetDiscoveryConfig(properties); + }; + + /** + * Encodes the specified AssetDiscoveryConfig message. Does not implicitly {@link google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig + * @static + * @param {google.cloud.securitycenter.v1.OrganizationSettings.IAssetDiscoveryConfig} message AssetDiscoveryConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AssetDiscoveryConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.projectIds != null && message.projectIds.length) + for (var i = 0; i < message.projectIds.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectIds[i]); + if (message.inclusionMode != null && message.hasOwnProperty("inclusionMode")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.inclusionMode); + return writer; + }; + + /** + * Encodes the specified AssetDiscoveryConfig message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig + * @static + * @param {google.cloud.securitycenter.v1.OrganizationSettings.IAssetDiscoveryConfig} message AssetDiscoveryConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AssetDiscoveryConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AssetDiscoveryConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig} AssetDiscoveryConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AssetDiscoveryConfig.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.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.projectIds && message.projectIds.length)) + message.projectIds = []; + message.projectIds.push(reader.string()); + break; + case 2: + message.inclusionMode = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AssetDiscoveryConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig} AssetDiscoveryConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AssetDiscoveryConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AssetDiscoveryConfig message. + * @function verify + * @memberof google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AssetDiscoveryConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.projectIds != null && message.hasOwnProperty("projectIds")) { + if (!Array.isArray(message.projectIds)) + return "projectIds: array expected"; + for (var i = 0; i < message.projectIds.length; ++i) + if (!$util.isString(message.projectIds[i])) + return "projectIds: string[] expected"; + } + if (message.inclusionMode != null && message.hasOwnProperty("inclusionMode")) + switch (message.inclusionMode) { + default: + return "inclusionMode: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates an AssetDiscoveryConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig} AssetDiscoveryConfig + */ + AssetDiscoveryConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig) + return object; + var message = new $root.google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig(); + if (object.projectIds) { + if (!Array.isArray(object.projectIds)) + throw TypeError(".google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.projectIds: array expected"); + message.projectIds = []; + for (var i = 0; i < object.projectIds.length; ++i) + message.projectIds[i] = String(object.projectIds[i]); + } + switch (object.inclusionMode) { + case "INCLUSION_MODE_UNSPECIFIED": + case 0: + message.inclusionMode = 0; + break; + case "INCLUDE_ONLY": + case 1: + message.inclusionMode = 1; + break; + case "EXCLUDE": + case 2: + message.inclusionMode = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from an AssetDiscoveryConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig + * @static + * @param {google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig} message AssetDiscoveryConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AssetDiscoveryConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.projectIds = []; + if (options.defaults) + object.inclusionMode = options.enums === String ? "INCLUSION_MODE_UNSPECIFIED" : 0; + if (message.projectIds && message.projectIds.length) { + object.projectIds = []; + for (var j = 0; j < message.projectIds.length; ++j) + object.projectIds[j] = message.projectIds[j]; + } + if (message.inclusionMode != null && message.hasOwnProperty("inclusionMode")) + object.inclusionMode = options.enums === String ? $root.google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode[message.inclusionMode] : message.inclusionMode; + return object; + }; + + /** + * Converts this AssetDiscoveryConfig to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig + * @instance + * @returns {Object.} JSON object + */ + AssetDiscoveryConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * InclusionMode enum. + * @name google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode + * @enum {string} + * @property {number} INCLUSION_MODE_UNSPECIFIED=0 INCLUSION_MODE_UNSPECIFIED value + * @property {number} INCLUDE_ONLY=1 INCLUDE_ONLY value + * @property {number} EXCLUDE=2 EXCLUDE value + */ + AssetDiscoveryConfig.InclusionMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "INCLUSION_MODE_UNSPECIFIED"] = 0; + values[valuesById[1] = "INCLUDE_ONLY"] = 1; + values[valuesById[2] = "EXCLUDE"] = 2; + return values; + })(); + + return AssetDiscoveryConfig; + })(); + + return OrganizationSettings; + })(); + + v1.RunAssetDiscoveryResponse = (function() { + + /** + * Properties of a RunAssetDiscoveryResponse. + * @memberof google.cloud.securitycenter.v1 + * @interface IRunAssetDiscoveryResponse + * @property {google.cloud.securitycenter.v1.RunAssetDiscoveryResponse.State|null} [state] RunAssetDiscoveryResponse state + * @property {google.protobuf.IDuration|null} [duration] RunAssetDiscoveryResponse duration + */ + + /** + * Constructs a new RunAssetDiscoveryResponse. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a RunAssetDiscoveryResponse. + * @implements IRunAssetDiscoveryResponse + * @constructor + * @param {google.cloud.securitycenter.v1.IRunAssetDiscoveryResponse=} [properties] Properties to set + */ + function RunAssetDiscoveryResponse(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]]; + } + + /** + * RunAssetDiscoveryResponse state. + * @member {google.cloud.securitycenter.v1.RunAssetDiscoveryResponse.State} state + * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryResponse + * @instance + */ + RunAssetDiscoveryResponse.prototype.state = 0; + + /** + * RunAssetDiscoveryResponse duration. + * @member {google.protobuf.IDuration|null|undefined} duration + * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryResponse + * @instance + */ + RunAssetDiscoveryResponse.prototype.duration = null; + + /** + * Creates a new RunAssetDiscoveryResponse instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryResponse + * @static + * @param {google.cloud.securitycenter.v1.IRunAssetDiscoveryResponse=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.RunAssetDiscoveryResponse} RunAssetDiscoveryResponse instance + */ + RunAssetDiscoveryResponse.create = function create(properties) { + return new RunAssetDiscoveryResponse(properties); + }; + + /** + * Encodes the specified RunAssetDiscoveryResponse message. Does not implicitly {@link google.cloud.securitycenter.v1.RunAssetDiscoveryResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryResponse + * @static + * @param {google.cloud.securitycenter.v1.IRunAssetDiscoveryResponse} message RunAssetDiscoveryResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RunAssetDiscoveryResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.state != null && message.hasOwnProperty("state")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.state); + if (message.duration != null && message.hasOwnProperty("duration")) + $root.google.protobuf.Duration.encode(message.duration, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RunAssetDiscoveryResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.RunAssetDiscoveryResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryResponse + * @static + * @param {google.cloud.securitycenter.v1.IRunAssetDiscoveryResponse} message RunAssetDiscoveryResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RunAssetDiscoveryResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RunAssetDiscoveryResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.RunAssetDiscoveryResponse} RunAssetDiscoveryResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RunAssetDiscoveryResponse.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.cloud.securitycenter.v1.RunAssetDiscoveryResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.state = reader.int32(); + break; + case 2: + message.duration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RunAssetDiscoveryResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.RunAssetDiscoveryResponse} RunAssetDiscoveryResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RunAssetDiscoveryResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RunAssetDiscoveryResponse message. + * @function verify + * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RunAssetDiscoveryResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.duration != null && message.hasOwnProperty("duration")) { + var error = $root.google.protobuf.Duration.verify(message.duration); + if (error) + return "duration." + error; + } + return null; + }; + + /** + * Creates a RunAssetDiscoveryResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.RunAssetDiscoveryResponse} RunAssetDiscoveryResponse + */ + RunAssetDiscoveryResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.RunAssetDiscoveryResponse) + return object; + var message = new $root.google.cloud.securitycenter.v1.RunAssetDiscoveryResponse(); + switch (object.state) { + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "COMPLETED": + case 1: + message.state = 1; + break; + case "SUPERSEDED": + case 2: + message.state = 2; + break; + case "TERMINATED": + case 3: + message.state = 3; + break; + } + if (object.duration != null) { + if (typeof object.duration !== "object") + throw TypeError(".google.cloud.securitycenter.v1.RunAssetDiscoveryResponse.duration: object expected"); + message.duration = $root.google.protobuf.Duration.fromObject(object.duration); + } + return message; + }; + + /** + * Creates a plain object from a RunAssetDiscoveryResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryResponse + * @static + * @param {google.cloud.securitycenter.v1.RunAssetDiscoveryResponse} message RunAssetDiscoveryResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RunAssetDiscoveryResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.duration = null; + } + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.securitycenter.v1.RunAssetDiscoveryResponse.State[message.state] : message.state; + if (message.duration != null && message.hasOwnProperty("duration")) + object.duration = $root.google.protobuf.Duration.toObject(message.duration, options); + return object; + }; + + /** + * Converts this RunAssetDiscoveryResponse to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryResponse + * @instance + * @returns {Object.} JSON object + */ + RunAssetDiscoveryResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * State enum. + * @name google.cloud.securitycenter.v1.RunAssetDiscoveryResponse.State + * @enum {string} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} COMPLETED=1 COMPLETED value + * @property {number} SUPERSEDED=2 SUPERSEDED value + * @property {number} TERMINATED=3 TERMINATED value + */ + RunAssetDiscoveryResponse.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "COMPLETED"] = 1; + values[valuesById[2] = "SUPERSEDED"] = 2; + values[valuesById[3] = "TERMINATED"] = 3; + return values; + })(); + + return RunAssetDiscoveryResponse; + })(); + + v1.SecurityCenter = (function() { + + /** + * Constructs a new SecurityCenter service. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a SecurityCenter + * @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 SecurityCenter(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (SecurityCenter.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = SecurityCenter; + + /** + * Creates new SecurityCenter service using the specified rpc implementation. + * @function create + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @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 {SecurityCenter} RPC service. Useful where requests and/or responses are streamed. + */ + SecurityCenter.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#createSource}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef CreateSourceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1.Source} [response] Source + */ + + /** + * Calls CreateSource. + * @function createSource + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.ICreateSourceRequest} request CreateSourceRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.CreateSourceCallback} callback Node-style callback called with the error, if any, and Source + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.createSource = function createSource(request, callback) { + return this.rpcCall(createSource, $root.google.cloud.securitycenter.v1.CreateSourceRequest, $root.google.cloud.securitycenter.v1.Source, request, callback); + }, "name", { value: "CreateSource" }); + + /** + * Calls CreateSource. + * @function createSource + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.ICreateSourceRequest} request CreateSourceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#createFinding}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef CreateFindingCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1.Finding} [response] Finding + */ + + /** + * Calls CreateFinding. + * @function createFinding + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.ICreateFindingRequest} request CreateFindingRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.CreateFindingCallback} callback Node-style callback called with the error, if any, and Finding + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.createFinding = function createFinding(request, callback) { + return this.rpcCall(createFinding, $root.google.cloud.securitycenter.v1.CreateFindingRequest, $root.google.cloud.securitycenter.v1.Finding, request, callback); + }, "name", { value: "CreateFinding" }); + + /** + * Calls CreateFinding. + * @function createFinding + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.ICreateFindingRequest} request CreateFindingRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#getIamPolicy}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef GetIamPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.iam.v1.Policy} [response] Policy + */ + + /** + * Calls GetIamPolicy. + * @function getIamPolicy + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.iam.v1.IGetIamPolicyRequest} request GetIamPolicyRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.GetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.getIamPolicy = function getIamPolicy(request, callback) { + return this.rpcCall(getIamPolicy, $root.google.iam.v1.GetIamPolicyRequest, $root.google.iam.v1.Policy, request, callback); + }, "name", { value: "GetIamPolicy" }); + + /** + * Calls GetIamPolicy. + * @function getIamPolicy + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.iam.v1.IGetIamPolicyRequest} request GetIamPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#getOrganizationSettings}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef GetOrganizationSettingsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1.OrganizationSettings} [response] OrganizationSettings + */ + + /** + * Calls GetOrganizationSettings. + * @function getOrganizationSettings + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IGetOrganizationSettingsRequest} request GetOrganizationSettingsRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.GetOrganizationSettingsCallback} callback Node-style callback called with the error, if any, and OrganizationSettings + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.getOrganizationSettings = function getOrganizationSettings(request, callback) { + return this.rpcCall(getOrganizationSettings, $root.google.cloud.securitycenter.v1.GetOrganizationSettingsRequest, $root.google.cloud.securitycenter.v1.OrganizationSettings, request, callback); + }, "name", { value: "GetOrganizationSettings" }); + + /** + * Calls GetOrganizationSettings. + * @function getOrganizationSettings + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IGetOrganizationSettingsRequest} request GetOrganizationSettingsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#getSource}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef GetSourceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1.Source} [response] Source + */ + + /** + * Calls GetSource. + * @function getSource + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IGetSourceRequest} request GetSourceRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.GetSourceCallback} callback Node-style callback called with the error, if any, and Source + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.getSource = function getSource(request, callback) { + return this.rpcCall(getSource, $root.google.cloud.securitycenter.v1.GetSourceRequest, $root.google.cloud.securitycenter.v1.Source, request, callback); + }, "name", { value: "GetSource" }); + + /** + * Calls GetSource. + * @function getSource + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IGetSourceRequest} request GetSourceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#groupAssets}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef GroupAssetsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1.GroupAssetsResponse} [response] GroupAssetsResponse + */ + + /** + * Calls GroupAssets. + * @function groupAssets + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IGroupAssetsRequest} request GroupAssetsRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.GroupAssetsCallback} callback Node-style callback called with the error, if any, and GroupAssetsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.groupAssets = function groupAssets(request, callback) { + return this.rpcCall(groupAssets, $root.google.cloud.securitycenter.v1.GroupAssetsRequest, $root.google.cloud.securitycenter.v1.GroupAssetsResponse, request, callback); + }, "name", { value: "GroupAssets" }); + + /** + * Calls GroupAssets. + * @function groupAssets + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IGroupAssetsRequest} request GroupAssetsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#groupFindings}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef GroupFindingsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1.GroupFindingsResponse} [response] GroupFindingsResponse + */ + + /** + * Calls GroupFindings. + * @function groupFindings + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IGroupFindingsRequest} request GroupFindingsRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.GroupFindingsCallback} callback Node-style callback called with the error, if any, and GroupFindingsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.groupFindings = function groupFindings(request, callback) { + return this.rpcCall(groupFindings, $root.google.cloud.securitycenter.v1.GroupFindingsRequest, $root.google.cloud.securitycenter.v1.GroupFindingsResponse, request, callback); + }, "name", { value: "GroupFindings" }); + + /** + * Calls GroupFindings. + * @function groupFindings + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IGroupFindingsRequest} request GroupFindingsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#listAssets}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef ListAssetsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1.ListAssetsResponse} [response] ListAssetsResponse + */ + + /** + * Calls ListAssets. + * @function listAssets + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IListAssetsRequest} request ListAssetsRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.ListAssetsCallback} callback Node-style callback called with the error, if any, and ListAssetsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.listAssets = function listAssets(request, callback) { + return this.rpcCall(listAssets, $root.google.cloud.securitycenter.v1.ListAssetsRequest, $root.google.cloud.securitycenter.v1.ListAssetsResponse, request, callback); + }, "name", { value: "ListAssets" }); + + /** + * Calls ListAssets. + * @function listAssets + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IListAssetsRequest} request ListAssetsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#listFindings}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef ListFindingsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1.ListFindingsResponse} [response] ListFindingsResponse + */ + + /** + * Calls ListFindings. + * @function listFindings + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IListFindingsRequest} request ListFindingsRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.ListFindingsCallback} callback Node-style callback called with the error, if any, and ListFindingsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.listFindings = function listFindings(request, callback) { + return this.rpcCall(listFindings, $root.google.cloud.securitycenter.v1.ListFindingsRequest, $root.google.cloud.securitycenter.v1.ListFindingsResponse, request, callback); + }, "name", { value: "ListFindings" }); + + /** + * Calls ListFindings. + * @function listFindings + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IListFindingsRequest} request ListFindingsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#listSources}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef ListSourcesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1.ListSourcesResponse} [response] ListSourcesResponse + */ + + /** + * Calls ListSources. + * @function listSources + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IListSourcesRequest} request ListSourcesRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.ListSourcesCallback} callback Node-style callback called with the error, if any, and ListSourcesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.listSources = function listSources(request, callback) { + return this.rpcCall(listSources, $root.google.cloud.securitycenter.v1.ListSourcesRequest, $root.google.cloud.securitycenter.v1.ListSourcesResponse, request, callback); + }, "name", { value: "ListSources" }); + + /** + * Calls ListSources. + * @function listSources + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IListSourcesRequest} request ListSourcesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#runAssetDiscovery}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef RunAssetDiscoveryCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls RunAssetDiscovery. + * @function runAssetDiscovery + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IRunAssetDiscoveryRequest} request RunAssetDiscoveryRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.RunAssetDiscoveryCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.runAssetDiscovery = function runAssetDiscovery(request, callback) { + return this.rpcCall(runAssetDiscovery, $root.google.cloud.securitycenter.v1.RunAssetDiscoveryRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "RunAssetDiscovery" }); + + /** + * Calls RunAssetDiscovery. + * @function runAssetDiscovery + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IRunAssetDiscoveryRequest} request RunAssetDiscoveryRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#setFindingState}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef SetFindingStateCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1.Finding} [response] Finding + */ + + /** + * Calls SetFindingState. + * @function setFindingState + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.ISetFindingStateRequest} request SetFindingStateRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.SetFindingStateCallback} callback Node-style callback called with the error, if any, and Finding + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.setFindingState = function setFindingState(request, callback) { + return this.rpcCall(setFindingState, $root.google.cloud.securitycenter.v1.SetFindingStateRequest, $root.google.cloud.securitycenter.v1.Finding, request, callback); + }, "name", { value: "SetFindingState" }); + + /** + * Calls SetFindingState. + * @function setFindingState + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.ISetFindingStateRequest} request SetFindingStateRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#setIamPolicy}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef SetIamPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.iam.v1.Policy} [response] Policy + */ + + /** + * Calls SetIamPolicy. + * @function setIamPolicy + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.iam.v1.ISetIamPolicyRequest} request SetIamPolicyRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.SetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.setIamPolicy = function setIamPolicy(request, callback) { + return this.rpcCall(setIamPolicy, $root.google.iam.v1.SetIamPolicyRequest, $root.google.iam.v1.Policy, request, callback); + }, "name", { value: "SetIamPolicy" }); + + /** + * Calls SetIamPolicy. + * @function setIamPolicy + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.iam.v1.ISetIamPolicyRequest} request SetIamPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#testIamPermissions}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef TestIamPermissionsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.iam.v1.TestIamPermissionsResponse} [response] TestIamPermissionsResponse + */ + + /** + * Calls TestIamPermissions. + * @function testIamPermissions + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.iam.v1.ITestIamPermissionsRequest} request TestIamPermissionsRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.TestIamPermissionsCallback} callback Node-style callback called with the error, if any, and TestIamPermissionsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.testIamPermissions = function testIamPermissions(request, callback) { + return this.rpcCall(testIamPermissions, $root.google.iam.v1.TestIamPermissionsRequest, $root.google.iam.v1.TestIamPermissionsResponse, request, callback); + }, "name", { value: "TestIamPermissions" }); + + /** + * Calls TestIamPermissions. + * @function testIamPermissions + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.iam.v1.ITestIamPermissionsRequest} request TestIamPermissionsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#updateFinding}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef UpdateFindingCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1.Finding} [response] Finding + */ + + /** + * Calls UpdateFinding. + * @function updateFinding + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IUpdateFindingRequest} request UpdateFindingRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.UpdateFindingCallback} callback Node-style callback called with the error, if any, and Finding + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.updateFinding = function updateFinding(request, callback) { + return this.rpcCall(updateFinding, $root.google.cloud.securitycenter.v1.UpdateFindingRequest, $root.google.cloud.securitycenter.v1.Finding, request, callback); + }, "name", { value: "UpdateFinding" }); + + /** + * Calls UpdateFinding. + * @function updateFinding + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IUpdateFindingRequest} request UpdateFindingRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#updateOrganizationSettings}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef UpdateOrganizationSettingsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1.OrganizationSettings} [response] OrganizationSettings + */ + + /** + * Calls UpdateOrganizationSettings. + * @function updateOrganizationSettings + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IUpdateOrganizationSettingsRequest} request UpdateOrganizationSettingsRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.UpdateOrganizationSettingsCallback} callback Node-style callback called with the error, if any, and OrganizationSettings + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.updateOrganizationSettings = function updateOrganizationSettings(request, callback) { + return this.rpcCall(updateOrganizationSettings, $root.google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest, $root.google.cloud.securitycenter.v1.OrganizationSettings, request, callback); + }, "name", { value: "UpdateOrganizationSettings" }); + + /** + * Calls UpdateOrganizationSettings. + * @function updateOrganizationSettings + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IUpdateOrganizationSettingsRequest} request UpdateOrganizationSettingsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#updateSource}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef UpdateSourceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1.Source} [response] Source + */ + + /** + * Calls UpdateSource. + * @function updateSource + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IUpdateSourceRequest} request UpdateSourceRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.UpdateSourceCallback} callback Node-style callback called with the error, if any, and Source + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.updateSource = function updateSource(request, callback) { + return this.rpcCall(updateSource, $root.google.cloud.securitycenter.v1.UpdateSourceRequest, $root.google.cloud.securitycenter.v1.Source, request, callback); + }, "name", { value: "UpdateSource" }); + + /** + * Calls UpdateSource. + * @function updateSource + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IUpdateSourceRequest} request UpdateSourceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#updateSecurityMarks}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef UpdateSecurityMarksCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1.SecurityMarks} [response] SecurityMarks + */ + + /** + * Calls UpdateSecurityMarks. + * @function updateSecurityMarks + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IUpdateSecurityMarksRequest} request UpdateSecurityMarksRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.UpdateSecurityMarksCallback} callback Node-style callback called with the error, if any, and SecurityMarks + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.updateSecurityMarks = function updateSecurityMarks(request, callback) { + return this.rpcCall(updateSecurityMarks, $root.google.cloud.securitycenter.v1.UpdateSecurityMarksRequest, $root.google.cloud.securitycenter.v1.SecurityMarks, request, callback); + }, "name", { value: "UpdateSecurityMarks" }); + + /** + * Calls UpdateSecurityMarks. + * @function updateSecurityMarks + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IUpdateSecurityMarksRequest} request UpdateSecurityMarksRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return SecurityCenter; + })(); + + v1.CreateFindingRequest = (function() { + + /** + * Properties of a CreateFindingRequest. + * @memberof google.cloud.securitycenter.v1 + * @interface ICreateFindingRequest + * @property {string|null} [parent] CreateFindingRequest parent + * @property {string|null} [findingId] CreateFindingRequest findingId + * @property {google.cloud.securitycenter.v1.IFinding|null} [finding] CreateFindingRequest finding + */ + + /** + * Constructs a new CreateFindingRequest. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a CreateFindingRequest. + * @implements ICreateFindingRequest + * @constructor + * @param {google.cloud.securitycenter.v1.ICreateFindingRequest=} [properties] Properties to set + */ + function CreateFindingRequest(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]]; + } + + /** + * CreateFindingRequest parent. + * @member {string} parent + * @memberof google.cloud.securitycenter.v1.CreateFindingRequest + * @instance + */ + CreateFindingRequest.prototype.parent = ""; + + /** + * CreateFindingRequest findingId. + * @member {string} findingId + * @memberof google.cloud.securitycenter.v1.CreateFindingRequest + * @instance + */ + CreateFindingRequest.prototype.findingId = ""; + + /** + * CreateFindingRequest finding. + * @member {google.cloud.securitycenter.v1.IFinding|null|undefined} finding + * @memberof google.cloud.securitycenter.v1.CreateFindingRequest + * @instance + */ + CreateFindingRequest.prototype.finding = null; + + /** + * Creates a new CreateFindingRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.CreateFindingRequest + * @static + * @param {google.cloud.securitycenter.v1.ICreateFindingRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.CreateFindingRequest} CreateFindingRequest instance + */ + CreateFindingRequest.create = function create(properties) { + return new CreateFindingRequest(properties); + }; + + /** + * Encodes the specified CreateFindingRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.CreateFindingRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.CreateFindingRequest + * @static + * @param {google.cloud.securitycenter.v1.ICreateFindingRequest} message CreateFindingRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateFindingRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && message.hasOwnProperty("parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.findingId != null && message.hasOwnProperty("findingId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.findingId); + if (message.finding != null && message.hasOwnProperty("finding")) + $root.google.cloud.securitycenter.v1.Finding.encode(message.finding, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateFindingRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.CreateFindingRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.CreateFindingRequest + * @static + * @param {google.cloud.securitycenter.v1.ICreateFindingRequest} message CreateFindingRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateFindingRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateFindingRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.CreateFindingRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.CreateFindingRequest} CreateFindingRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateFindingRequest.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.cloud.securitycenter.v1.CreateFindingRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.findingId = reader.string(); + break; + case 3: + message.finding = $root.google.cloud.securitycenter.v1.Finding.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateFindingRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.CreateFindingRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.CreateFindingRequest} CreateFindingRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateFindingRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateFindingRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1.CreateFindingRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateFindingRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.findingId != null && message.hasOwnProperty("findingId")) + if (!$util.isString(message.findingId)) + return "findingId: string expected"; + if (message.finding != null && message.hasOwnProperty("finding")) { + var error = $root.google.cloud.securitycenter.v1.Finding.verify(message.finding); + if (error) + return "finding." + error; + } + return null; + }; + + /** + * Creates a CreateFindingRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.CreateFindingRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.CreateFindingRequest} CreateFindingRequest + */ + CreateFindingRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.CreateFindingRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1.CreateFindingRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.findingId != null) + message.findingId = String(object.findingId); + if (object.finding != null) { + if (typeof object.finding !== "object") + throw TypeError(".google.cloud.securitycenter.v1.CreateFindingRequest.finding: object expected"); + message.finding = $root.google.cloud.securitycenter.v1.Finding.fromObject(object.finding); + } + return message; + }; + + /** + * Creates a plain object from a CreateFindingRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.CreateFindingRequest + * @static + * @param {google.cloud.securitycenter.v1.CreateFindingRequest} message CreateFindingRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateFindingRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.findingId = ""; + object.finding = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.findingId != null && message.hasOwnProperty("findingId")) + object.findingId = message.findingId; + if (message.finding != null && message.hasOwnProperty("finding")) + object.finding = $root.google.cloud.securitycenter.v1.Finding.toObject(message.finding, options); + return object; + }; + + /** + * Converts this CreateFindingRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.CreateFindingRequest + * @instance + * @returns {Object.} JSON object + */ + CreateFindingRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return CreateFindingRequest; + })(); + + v1.CreateSourceRequest = (function() { + + /** + * Properties of a CreateSourceRequest. + * @memberof google.cloud.securitycenter.v1 + * @interface ICreateSourceRequest + * @property {string|null} [parent] CreateSourceRequest parent + * @property {google.cloud.securitycenter.v1.ISource|null} [source] CreateSourceRequest source + */ + + /** + * Constructs a new CreateSourceRequest. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a CreateSourceRequest. + * @implements ICreateSourceRequest + * @constructor + * @param {google.cloud.securitycenter.v1.ICreateSourceRequest=} [properties] Properties to set + */ + function CreateSourceRequest(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]]; + } + + /** + * CreateSourceRequest parent. + * @member {string} parent + * @memberof google.cloud.securitycenter.v1.CreateSourceRequest + * @instance + */ + CreateSourceRequest.prototype.parent = ""; + + /** + * CreateSourceRequest source. + * @member {google.cloud.securitycenter.v1.ISource|null|undefined} source + * @memberof google.cloud.securitycenter.v1.CreateSourceRequest + * @instance + */ + CreateSourceRequest.prototype.source = null; + + /** + * Creates a new CreateSourceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.CreateSourceRequest + * @static + * @param {google.cloud.securitycenter.v1.ICreateSourceRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.CreateSourceRequest} CreateSourceRequest instance + */ + CreateSourceRequest.create = function create(properties) { + return new CreateSourceRequest(properties); + }; + + /** + * Encodes the specified CreateSourceRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.CreateSourceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.CreateSourceRequest + * @static + * @param {google.cloud.securitycenter.v1.ICreateSourceRequest} message CreateSourceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateSourceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && message.hasOwnProperty("parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.source != null && message.hasOwnProperty("source")) + $root.google.cloud.securitycenter.v1.Source.encode(message.source, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateSourceRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.CreateSourceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.CreateSourceRequest + * @static + * @param {google.cloud.securitycenter.v1.ICreateSourceRequest} message CreateSourceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateSourceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateSourceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.CreateSourceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.CreateSourceRequest} CreateSourceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateSourceRequest.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.cloud.securitycenter.v1.CreateSourceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.source = $root.google.cloud.securitycenter.v1.Source.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateSourceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.CreateSourceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.CreateSourceRequest} CreateSourceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateSourceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateSourceRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1.CreateSourceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateSourceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.source != null && message.hasOwnProperty("source")) { + var error = $root.google.cloud.securitycenter.v1.Source.verify(message.source); + if (error) + return "source." + error; + } + return null; + }; + + /** + * Creates a CreateSourceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.CreateSourceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.CreateSourceRequest} CreateSourceRequest + */ + CreateSourceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.CreateSourceRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1.CreateSourceRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.source != null) { + if (typeof object.source !== "object") + throw TypeError(".google.cloud.securitycenter.v1.CreateSourceRequest.source: object expected"); + message.source = $root.google.cloud.securitycenter.v1.Source.fromObject(object.source); + } + return message; + }; + + /** + * Creates a plain object from a CreateSourceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.CreateSourceRequest + * @static + * @param {google.cloud.securitycenter.v1.CreateSourceRequest} message CreateSourceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateSourceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.source = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.source != null && message.hasOwnProperty("source")) + object.source = $root.google.cloud.securitycenter.v1.Source.toObject(message.source, options); + return object; + }; + + /** + * Converts this CreateSourceRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.CreateSourceRequest + * @instance + * @returns {Object.} JSON object + */ + CreateSourceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return CreateSourceRequest; + })(); + + v1.GetOrganizationSettingsRequest = (function() { + + /** + * Properties of a GetOrganizationSettingsRequest. + * @memberof google.cloud.securitycenter.v1 + * @interface IGetOrganizationSettingsRequest + * @property {string|null} [name] GetOrganizationSettingsRequest name + */ + + /** + * Constructs a new GetOrganizationSettingsRequest. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a GetOrganizationSettingsRequest. + * @implements IGetOrganizationSettingsRequest + * @constructor + * @param {google.cloud.securitycenter.v1.IGetOrganizationSettingsRequest=} [properties] Properties to set + */ + function GetOrganizationSettingsRequest(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]]; + } + + /** + * GetOrganizationSettingsRequest name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1.GetOrganizationSettingsRequest + * @instance + */ + GetOrganizationSettingsRequest.prototype.name = ""; + + /** + * Creates a new GetOrganizationSettingsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.GetOrganizationSettingsRequest + * @static + * @param {google.cloud.securitycenter.v1.IGetOrganizationSettingsRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.GetOrganizationSettingsRequest} GetOrganizationSettingsRequest instance + */ + GetOrganizationSettingsRequest.create = function create(properties) { + return new GetOrganizationSettingsRequest(properties); + }; + + /** + * Encodes the specified GetOrganizationSettingsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.GetOrganizationSettingsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.GetOrganizationSettingsRequest + * @static + * @param {google.cloud.securitycenter.v1.IGetOrganizationSettingsRequest} message GetOrganizationSettingsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetOrganizationSettingsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetOrganizationSettingsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.GetOrganizationSettingsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.GetOrganizationSettingsRequest + * @static + * @param {google.cloud.securitycenter.v1.IGetOrganizationSettingsRequest} message GetOrganizationSettingsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetOrganizationSettingsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetOrganizationSettingsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.GetOrganizationSettingsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.GetOrganizationSettingsRequest} GetOrganizationSettingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetOrganizationSettingsRequest.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.cloud.securitycenter.v1.GetOrganizationSettingsRequest(); + 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 GetOrganizationSettingsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.GetOrganizationSettingsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.GetOrganizationSettingsRequest} GetOrganizationSettingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetOrganizationSettingsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetOrganizationSettingsRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1.GetOrganizationSettingsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetOrganizationSettingsRequest.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 GetOrganizationSettingsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.GetOrganizationSettingsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.GetOrganizationSettingsRequest} GetOrganizationSettingsRequest + */ + GetOrganizationSettingsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.GetOrganizationSettingsRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1.GetOrganizationSettingsRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetOrganizationSettingsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.GetOrganizationSettingsRequest + * @static + * @param {google.cloud.securitycenter.v1.GetOrganizationSettingsRequest} message GetOrganizationSettingsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetOrganizationSettingsRequest.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 GetOrganizationSettingsRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.GetOrganizationSettingsRequest + * @instance + * @returns {Object.} JSON object + */ + GetOrganizationSettingsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetOrganizationSettingsRequest; + })(); + + v1.GetSourceRequest = (function() { + + /** + * Properties of a GetSourceRequest. + * @memberof google.cloud.securitycenter.v1 + * @interface IGetSourceRequest + * @property {string|null} [name] GetSourceRequest name + */ + + /** + * Constructs a new GetSourceRequest. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a GetSourceRequest. + * @implements IGetSourceRequest + * @constructor + * @param {google.cloud.securitycenter.v1.IGetSourceRequest=} [properties] Properties to set + */ + function GetSourceRequest(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]]; + } + + /** + * GetSourceRequest name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1.GetSourceRequest + * @instance + */ + GetSourceRequest.prototype.name = ""; + + /** + * Creates a new GetSourceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.GetSourceRequest + * @static + * @param {google.cloud.securitycenter.v1.IGetSourceRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.GetSourceRequest} GetSourceRequest instance + */ + GetSourceRequest.create = function create(properties) { + return new GetSourceRequest(properties); + }; + + /** + * Encodes the specified GetSourceRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.GetSourceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.GetSourceRequest + * @static + * @param {google.cloud.securitycenter.v1.IGetSourceRequest} message GetSourceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetSourceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetSourceRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.GetSourceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.GetSourceRequest + * @static + * @param {google.cloud.securitycenter.v1.IGetSourceRequest} message GetSourceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetSourceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetSourceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.GetSourceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.GetSourceRequest} GetSourceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetSourceRequest.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.cloud.securitycenter.v1.GetSourceRequest(); + 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 GetSourceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.GetSourceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.GetSourceRequest} GetSourceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetSourceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetSourceRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1.GetSourceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetSourceRequest.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 GetSourceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.GetSourceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.GetSourceRequest} GetSourceRequest + */ + GetSourceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.GetSourceRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1.GetSourceRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetSourceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.GetSourceRequest + * @static + * @param {google.cloud.securitycenter.v1.GetSourceRequest} message GetSourceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetSourceRequest.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 GetSourceRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.GetSourceRequest + * @instance + * @returns {Object.} JSON object + */ + GetSourceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetSourceRequest; + })(); + + v1.GroupAssetsRequest = (function() { + + /** + * Properties of a GroupAssetsRequest. + * @memberof google.cloud.securitycenter.v1 + * @interface IGroupAssetsRequest + * @property {string|null} [parent] GroupAssetsRequest parent + * @property {string|null} [filter] GroupAssetsRequest filter + * @property {string|null} [groupBy] GroupAssetsRequest groupBy + * @property {google.protobuf.IDuration|null} [compareDuration] GroupAssetsRequest compareDuration + * @property {google.protobuf.ITimestamp|null} [readTime] GroupAssetsRequest readTime + * @property {string|null} [pageToken] GroupAssetsRequest pageToken + * @property {number|null} [pageSize] GroupAssetsRequest pageSize + */ + + /** + * Constructs a new GroupAssetsRequest. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a GroupAssetsRequest. + * @implements IGroupAssetsRequest + * @constructor + * @param {google.cloud.securitycenter.v1.IGroupAssetsRequest=} [properties] Properties to set + */ + function GroupAssetsRequest(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]]; + } + + /** + * GroupAssetsRequest parent. + * @member {string} parent + * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest + * @instance + */ + GroupAssetsRequest.prototype.parent = ""; + + /** + * GroupAssetsRequest filter. + * @member {string} filter + * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest + * @instance + */ + GroupAssetsRequest.prototype.filter = ""; + + /** + * GroupAssetsRequest groupBy. + * @member {string} groupBy + * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest + * @instance + */ + GroupAssetsRequest.prototype.groupBy = ""; + + /** + * GroupAssetsRequest compareDuration. + * @member {google.protobuf.IDuration|null|undefined} compareDuration + * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest + * @instance + */ + GroupAssetsRequest.prototype.compareDuration = null; + + /** + * GroupAssetsRequest readTime. + * @member {google.protobuf.ITimestamp|null|undefined} readTime + * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest + * @instance + */ + GroupAssetsRequest.prototype.readTime = null; + + /** + * GroupAssetsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest + * @instance + */ + GroupAssetsRequest.prototype.pageToken = ""; + + /** + * GroupAssetsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest + * @instance + */ + GroupAssetsRequest.prototype.pageSize = 0; + + /** + * Creates a new GroupAssetsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest + * @static + * @param {google.cloud.securitycenter.v1.IGroupAssetsRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.GroupAssetsRequest} GroupAssetsRequest instance + */ + GroupAssetsRequest.create = function create(properties) { + return new GroupAssetsRequest(properties); + }; + + /** + * Encodes the specified GroupAssetsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.GroupAssetsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest + * @static + * @param {google.cloud.securitycenter.v1.IGroupAssetsRequest} message GroupAssetsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroupAssetsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && message.hasOwnProperty("parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.filter != null && message.hasOwnProperty("filter")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); + if (message.groupBy != null && message.hasOwnProperty("groupBy")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.groupBy); + if (message.compareDuration != null && message.hasOwnProperty("compareDuration")) + $root.google.protobuf.Duration.encode(message.compareDuration, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.readTime != null && message.hasOwnProperty("readTime")) + $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.pageToken); + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.pageSize); + return writer; + }; + + /** + * Encodes the specified GroupAssetsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.GroupAssetsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest + * @static + * @param {google.cloud.securitycenter.v1.IGroupAssetsRequest} message GroupAssetsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroupAssetsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GroupAssetsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.GroupAssetsRequest} GroupAssetsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GroupAssetsRequest.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.cloud.securitycenter.v1.GroupAssetsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.filter = reader.string(); + break; + case 3: + message.groupBy = reader.string(); + break; + case 4: + message.compareDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + case 5: + message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 7: + message.pageToken = reader.string(); + break; + case 8: + message.pageSize = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GroupAssetsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.GroupAssetsRequest} GroupAssetsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GroupAssetsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GroupAssetsRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GroupAssetsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.groupBy != null && message.hasOwnProperty("groupBy")) + if (!$util.isString(message.groupBy)) + return "groupBy: string expected"; + if (message.compareDuration != null && message.hasOwnProperty("compareDuration")) { + var error = $root.google.protobuf.Duration.verify(message.compareDuration); + if (error) + return "compareDuration." + error; + } + if (message.readTime != null && message.hasOwnProperty("readTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.readTime); + if (error) + return "readTime." + error; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + return null; + }; + + /** + * Creates a GroupAssetsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.GroupAssetsRequest} GroupAssetsRequest + */ + GroupAssetsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.GroupAssetsRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1.GroupAssetsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.filter != null) + message.filter = String(object.filter); + if (object.groupBy != null) + message.groupBy = String(object.groupBy); + if (object.compareDuration != null) { + if (typeof object.compareDuration !== "object") + throw TypeError(".google.cloud.securitycenter.v1.GroupAssetsRequest.compareDuration: object expected"); + message.compareDuration = $root.google.protobuf.Duration.fromObject(object.compareDuration); + } + if (object.readTime != null) { + if (typeof object.readTime !== "object") + throw TypeError(".google.cloud.securitycenter.v1.GroupAssetsRequest.readTime: object expected"); + message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); + } + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + return message; + }; + + /** + * Creates a plain object from a GroupAssetsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest + * @static + * @param {google.cloud.securitycenter.v1.GroupAssetsRequest} message GroupAssetsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GroupAssetsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.filter = ""; + object.groupBy = ""; + object.compareDuration = null; + object.readTime = null; + object.pageToken = ""; + object.pageSize = 0; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.groupBy != null && message.hasOwnProperty("groupBy")) + object.groupBy = message.groupBy; + if (message.compareDuration != null && message.hasOwnProperty("compareDuration")) + object.compareDuration = $root.google.protobuf.Duration.toObject(message.compareDuration, options); + if (message.readTime != null && message.hasOwnProperty("readTime")) + object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + return object; + }; + + /** + * Converts this GroupAssetsRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest + * @instance + * @returns {Object.} JSON object + */ + GroupAssetsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GroupAssetsRequest; + })(); + + v1.GroupAssetsResponse = (function() { + + /** + * Properties of a GroupAssetsResponse. + * @memberof google.cloud.securitycenter.v1 + * @interface IGroupAssetsResponse + * @property {Array.|null} [groupByResults] GroupAssetsResponse groupByResults + * @property {google.protobuf.ITimestamp|null} [readTime] GroupAssetsResponse readTime + * @property {string|null} [nextPageToken] GroupAssetsResponse nextPageToken + * @property {number|null} [totalSize] GroupAssetsResponse totalSize + */ + + /** + * Constructs a new GroupAssetsResponse. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a GroupAssetsResponse. + * @implements IGroupAssetsResponse + * @constructor + * @param {google.cloud.securitycenter.v1.IGroupAssetsResponse=} [properties] Properties to set + */ + function GroupAssetsResponse(properties) { + this.groupByResults = []; + 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]]; + } + + /** + * GroupAssetsResponse groupByResults. + * @member {Array.} groupByResults + * @memberof google.cloud.securitycenter.v1.GroupAssetsResponse + * @instance + */ + GroupAssetsResponse.prototype.groupByResults = $util.emptyArray; + + /** + * GroupAssetsResponse readTime. + * @member {google.protobuf.ITimestamp|null|undefined} readTime + * @memberof google.cloud.securitycenter.v1.GroupAssetsResponse + * @instance + */ + GroupAssetsResponse.prototype.readTime = null; + + /** + * GroupAssetsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.securitycenter.v1.GroupAssetsResponse + * @instance + */ + GroupAssetsResponse.prototype.nextPageToken = ""; + + /** + * GroupAssetsResponse totalSize. + * @member {number} totalSize + * @memberof google.cloud.securitycenter.v1.GroupAssetsResponse + * @instance + */ + GroupAssetsResponse.prototype.totalSize = 0; + + /** + * Creates a new GroupAssetsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.GroupAssetsResponse + * @static + * @param {google.cloud.securitycenter.v1.IGroupAssetsResponse=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.GroupAssetsResponse} GroupAssetsResponse instance + */ + GroupAssetsResponse.create = function create(properties) { + return new GroupAssetsResponse(properties); + }; + + /** + * Encodes the specified GroupAssetsResponse message. Does not implicitly {@link google.cloud.securitycenter.v1.GroupAssetsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.GroupAssetsResponse + * @static + * @param {google.cloud.securitycenter.v1.IGroupAssetsResponse} message GroupAssetsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroupAssetsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.groupByResults != null && message.groupByResults.length) + for (var i = 0; i < message.groupByResults.length; ++i) + $root.google.cloud.securitycenter.v1.GroupResult.encode(message.groupByResults[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.readTime != null && message.hasOwnProperty("readTime")) + $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.nextPageToken); + if (message.totalSize != null && message.hasOwnProperty("totalSize")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.totalSize); + return writer; + }; + + /** + * Encodes the specified GroupAssetsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.GroupAssetsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.GroupAssetsResponse + * @static + * @param {google.cloud.securitycenter.v1.IGroupAssetsResponse} message GroupAssetsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroupAssetsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GroupAssetsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.GroupAssetsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.GroupAssetsResponse} GroupAssetsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GroupAssetsResponse.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.cloud.securitycenter.v1.GroupAssetsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.groupByResults && message.groupByResults.length)) + message.groupByResults = []; + message.groupByResults.push($root.google.cloud.securitycenter.v1.GroupResult.decode(reader, reader.uint32())); + break; + case 2: + message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 3: + message.nextPageToken = reader.string(); + break; + case 4: + message.totalSize = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GroupAssetsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.GroupAssetsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.GroupAssetsResponse} GroupAssetsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GroupAssetsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GroupAssetsResponse message. + * @function verify + * @memberof google.cloud.securitycenter.v1.GroupAssetsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GroupAssetsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.groupByResults != null && message.hasOwnProperty("groupByResults")) { + if (!Array.isArray(message.groupByResults)) + return "groupByResults: array expected"; + for (var i = 0; i < message.groupByResults.length; ++i) { + var error = $root.google.cloud.securitycenter.v1.GroupResult.verify(message.groupByResults[i]); + if (error) + return "groupByResults." + error; + } + } + if (message.readTime != null && message.hasOwnProperty("readTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.readTime); + if (error) + return "readTime." + error; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.totalSize != null && message.hasOwnProperty("totalSize")) + if (!$util.isInteger(message.totalSize)) + return "totalSize: integer expected"; + return null; + }; + + /** + * Creates a GroupAssetsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.GroupAssetsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.GroupAssetsResponse} GroupAssetsResponse + */ + GroupAssetsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.GroupAssetsResponse) + return object; + var message = new $root.google.cloud.securitycenter.v1.GroupAssetsResponse(); + if (object.groupByResults) { + if (!Array.isArray(object.groupByResults)) + throw TypeError(".google.cloud.securitycenter.v1.GroupAssetsResponse.groupByResults: array expected"); + message.groupByResults = []; + for (var i = 0; i < object.groupByResults.length; ++i) { + if (typeof object.groupByResults[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v1.GroupAssetsResponse.groupByResults: object expected"); + message.groupByResults[i] = $root.google.cloud.securitycenter.v1.GroupResult.fromObject(object.groupByResults[i]); + } + } + if (object.readTime != null) { + if (typeof object.readTime !== "object") + throw TypeError(".google.cloud.securitycenter.v1.GroupAssetsResponse.readTime: object expected"); + message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.totalSize != null) + message.totalSize = object.totalSize | 0; + return message; + }; + + /** + * Creates a plain object from a GroupAssetsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.GroupAssetsResponse + * @static + * @param {google.cloud.securitycenter.v1.GroupAssetsResponse} message GroupAssetsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GroupAssetsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.groupByResults = []; + if (options.defaults) { + object.readTime = null; + object.nextPageToken = ""; + object.totalSize = 0; + } + if (message.groupByResults && message.groupByResults.length) { + object.groupByResults = []; + for (var j = 0; j < message.groupByResults.length; ++j) + object.groupByResults[j] = $root.google.cloud.securitycenter.v1.GroupResult.toObject(message.groupByResults[j], options); + } + if (message.readTime != null && message.hasOwnProperty("readTime")) + object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.totalSize != null && message.hasOwnProperty("totalSize")) + object.totalSize = message.totalSize; + return object; + }; + + /** + * Converts this GroupAssetsResponse to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.GroupAssetsResponse + * @instance + * @returns {Object.} JSON object + */ + GroupAssetsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GroupAssetsResponse; + })(); + + v1.GroupFindingsRequest = (function() { + + /** + * Properties of a GroupFindingsRequest. + * @memberof google.cloud.securitycenter.v1 + * @interface IGroupFindingsRequest + * @property {string|null} [parent] GroupFindingsRequest parent + * @property {string|null} [filter] GroupFindingsRequest filter + * @property {string|null} [groupBy] GroupFindingsRequest groupBy + * @property {google.protobuf.ITimestamp|null} [readTime] GroupFindingsRequest readTime + * @property {google.protobuf.IDuration|null} [compareDuration] GroupFindingsRequest compareDuration + * @property {string|null} [pageToken] GroupFindingsRequest pageToken + * @property {number|null} [pageSize] GroupFindingsRequest pageSize + */ + + /** + * Constructs a new GroupFindingsRequest. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a GroupFindingsRequest. + * @implements IGroupFindingsRequest + * @constructor + * @param {google.cloud.securitycenter.v1.IGroupFindingsRequest=} [properties] Properties to set + */ + function GroupFindingsRequest(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]]; + } + + /** + * GroupFindingsRequest parent. + * @member {string} parent + * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest + * @instance + */ + GroupFindingsRequest.prototype.parent = ""; + + /** + * GroupFindingsRequest filter. + * @member {string} filter + * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest + * @instance + */ + GroupFindingsRequest.prototype.filter = ""; + + /** + * GroupFindingsRequest groupBy. + * @member {string} groupBy + * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest + * @instance + */ + GroupFindingsRequest.prototype.groupBy = ""; + + /** + * GroupFindingsRequest readTime. + * @member {google.protobuf.ITimestamp|null|undefined} readTime + * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest + * @instance + */ + GroupFindingsRequest.prototype.readTime = null; + + /** + * GroupFindingsRequest compareDuration. + * @member {google.protobuf.IDuration|null|undefined} compareDuration + * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest + * @instance + */ + GroupFindingsRequest.prototype.compareDuration = null; + + /** + * GroupFindingsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest + * @instance + */ + GroupFindingsRequest.prototype.pageToken = ""; + + /** + * GroupFindingsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest + * @instance + */ + GroupFindingsRequest.prototype.pageSize = 0; + + /** + * Creates a new GroupFindingsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest + * @static + * @param {google.cloud.securitycenter.v1.IGroupFindingsRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.GroupFindingsRequest} GroupFindingsRequest instance + */ + GroupFindingsRequest.create = function create(properties) { + return new GroupFindingsRequest(properties); + }; + + /** + * Encodes the specified GroupFindingsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.GroupFindingsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest + * @static + * @param {google.cloud.securitycenter.v1.IGroupFindingsRequest} message GroupFindingsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroupFindingsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && message.hasOwnProperty("parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.filter != null && message.hasOwnProperty("filter")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); + if (message.groupBy != null && message.hasOwnProperty("groupBy")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.groupBy); + if (message.readTime != null && message.hasOwnProperty("readTime")) + $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.compareDuration != null && message.hasOwnProperty("compareDuration")) + $root.google.protobuf.Duration.encode(message.compareDuration, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.pageToken); + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.pageSize); + return writer; + }; + + /** + * Encodes the specified GroupFindingsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.GroupFindingsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest + * @static + * @param {google.cloud.securitycenter.v1.IGroupFindingsRequest} message GroupFindingsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroupFindingsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GroupFindingsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.GroupFindingsRequest} GroupFindingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GroupFindingsRequest.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.cloud.securitycenter.v1.GroupFindingsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.filter = reader.string(); + break; + case 3: + message.groupBy = reader.string(); + break; + case 4: + message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 5: + message.compareDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + case 7: + message.pageToken = reader.string(); + break; + case 8: + message.pageSize = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GroupFindingsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.GroupFindingsRequest} GroupFindingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GroupFindingsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GroupFindingsRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GroupFindingsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.groupBy != null && message.hasOwnProperty("groupBy")) + if (!$util.isString(message.groupBy)) + return "groupBy: string expected"; + if (message.readTime != null && message.hasOwnProperty("readTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.readTime); + if (error) + return "readTime." + error; + } + if (message.compareDuration != null && message.hasOwnProperty("compareDuration")) { + var error = $root.google.protobuf.Duration.verify(message.compareDuration); + if (error) + return "compareDuration." + error; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + return null; + }; + + /** + * Creates a GroupFindingsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.GroupFindingsRequest} GroupFindingsRequest + */ + GroupFindingsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.GroupFindingsRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1.GroupFindingsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.filter != null) + message.filter = String(object.filter); + if (object.groupBy != null) + message.groupBy = String(object.groupBy); + if (object.readTime != null) { + if (typeof object.readTime !== "object") + throw TypeError(".google.cloud.securitycenter.v1.GroupFindingsRequest.readTime: object expected"); + message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); + } + if (object.compareDuration != null) { + if (typeof object.compareDuration !== "object") + throw TypeError(".google.cloud.securitycenter.v1.GroupFindingsRequest.compareDuration: object expected"); + message.compareDuration = $root.google.protobuf.Duration.fromObject(object.compareDuration); + } + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + return message; + }; + + /** + * Creates a plain object from a GroupFindingsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest + * @static + * @param {google.cloud.securitycenter.v1.GroupFindingsRequest} message GroupFindingsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GroupFindingsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.filter = ""; + object.groupBy = ""; + object.readTime = null; + object.compareDuration = null; + object.pageToken = ""; + object.pageSize = 0; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.groupBy != null && message.hasOwnProperty("groupBy")) + object.groupBy = message.groupBy; + if (message.readTime != null && message.hasOwnProperty("readTime")) + object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); + if (message.compareDuration != null && message.hasOwnProperty("compareDuration")) + object.compareDuration = $root.google.protobuf.Duration.toObject(message.compareDuration, options); + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + return object; + }; + + /** + * Converts this GroupFindingsRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest + * @instance + * @returns {Object.} JSON object + */ + GroupFindingsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GroupFindingsRequest; + })(); + + v1.GroupFindingsResponse = (function() { + + /** + * Properties of a GroupFindingsResponse. + * @memberof google.cloud.securitycenter.v1 + * @interface IGroupFindingsResponse + * @property {Array.|null} [groupByResults] GroupFindingsResponse groupByResults + * @property {google.protobuf.ITimestamp|null} [readTime] GroupFindingsResponse readTime + * @property {string|null} [nextPageToken] GroupFindingsResponse nextPageToken + * @property {number|null} [totalSize] GroupFindingsResponse totalSize + */ + + /** + * Constructs a new GroupFindingsResponse. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a GroupFindingsResponse. + * @implements IGroupFindingsResponse + * @constructor + * @param {google.cloud.securitycenter.v1.IGroupFindingsResponse=} [properties] Properties to set + */ + function GroupFindingsResponse(properties) { + this.groupByResults = []; + 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]]; + } + + /** + * GroupFindingsResponse groupByResults. + * @member {Array.} groupByResults + * @memberof google.cloud.securitycenter.v1.GroupFindingsResponse + * @instance + */ + GroupFindingsResponse.prototype.groupByResults = $util.emptyArray; + + /** + * GroupFindingsResponse readTime. + * @member {google.protobuf.ITimestamp|null|undefined} readTime + * @memberof google.cloud.securitycenter.v1.GroupFindingsResponse + * @instance + */ + GroupFindingsResponse.prototype.readTime = null; + + /** + * GroupFindingsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.securitycenter.v1.GroupFindingsResponse + * @instance + */ + GroupFindingsResponse.prototype.nextPageToken = ""; + + /** + * GroupFindingsResponse totalSize. + * @member {number} totalSize + * @memberof google.cloud.securitycenter.v1.GroupFindingsResponse + * @instance + */ + GroupFindingsResponse.prototype.totalSize = 0; + + /** + * Creates a new GroupFindingsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.GroupFindingsResponse + * @static + * @param {google.cloud.securitycenter.v1.IGroupFindingsResponse=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.GroupFindingsResponse} GroupFindingsResponse instance + */ + GroupFindingsResponse.create = function create(properties) { + return new GroupFindingsResponse(properties); + }; + + /** + * Encodes the specified GroupFindingsResponse message. Does not implicitly {@link google.cloud.securitycenter.v1.GroupFindingsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.GroupFindingsResponse + * @static + * @param {google.cloud.securitycenter.v1.IGroupFindingsResponse} message GroupFindingsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroupFindingsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.groupByResults != null && message.groupByResults.length) + for (var i = 0; i < message.groupByResults.length; ++i) + $root.google.cloud.securitycenter.v1.GroupResult.encode(message.groupByResults[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.readTime != null && message.hasOwnProperty("readTime")) + $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.nextPageToken); + if (message.totalSize != null && message.hasOwnProperty("totalSize")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.totalSize); + return writer; + }; + + /** + * Encodes the specified GroupFindingsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.GroupFindingsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.GroupFindingsResponse + * @static + * @param {google.cloud.securitycenter.v1.IGroupFindingsResponse} message GroupFindingsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroupFindingsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GroupFindingsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.GroupFindingsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.GroupFindingsResponse} GroupFindingsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GroupFindingsResponse.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.cloud.securitycenter.v1.GroupFindingsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.groupByResults && message.groupByResults.length)) + message.groupByResults = []; + message.groupByResults.push($root.google.cloud.securitycenter.v1.GroupResult.decode(reader, reader.uint32())); + break; + case 2: + message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 3: + message.nextPageToken = reader.string(); + break; + case 4: + message.totalSize = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GroupFindingsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.GroupFindingsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.GroupFindingsResponse} GroupFindingsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GroupFindingsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GroupFindingsResponse message. + * @function verify + * @memberof google.cloud.securitycenter.v1.GroupFindingsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GroupFindingsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.groupByResults != null && message.hasOwnProperty("groupByResults")) { + if (!Array.isArray(message.groupByResults)) + return "groupByResults: array expected"; + for (var i = 0; i < message.groupByResults.length; ++i) { + var error = $root.google.cloud.securitycenter.v1.GroupResult.verify(message.groupByResults[i]); + if (error) + return "groupByResults." + error; + } + } + if (message.readTime != null && message.hasOwnProperty("readTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.readTime); + if (error) + return "readTime." + error; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.totalSize != null && message.hasOwnProperty("totalSize")) + if (!$util.isInteger(message.totalSize)) + return "totalSize: integer expected"; + return null; + }; + + /** + * Creates a GroupFindingsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.GroupFindingsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.GroupFindingsResponse} GroupFindingsResponse + */ + GroupFindingsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.GroupFindingsResponse) + return object; + var message = new $root.google.cloud.securitycenter.v1.GroupFindingsResponse(); + if (object.groupByResults) { + if (!Array.isArray(object.groupByResults)) + throw TypeError(".google.cloud.securitycenter.v1.GroupFindingsResponse.groupByResults: array expected"); + message.groupByResults = []; + for (var i = 0; i < object.groupByResults.length; ++i) { + if (typeof object.groupByResults[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v1.GroupFindingsResponse.groupByResults: object expected"); + message.groupByResults[i] = $root.google.cloud.securitycenter.v1.GroupResult.fromObject(object.groupByResults[i]); + } + } + if (object.readTime != null) { + if (typeof object.readTime !== "object") + throw TypeError(".google.cloud.securitycenter.v1.GroupFindingsResponse.readTime: object expected"); + message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.totalSize != null) + message.totalSize = object.totalSize | 0; + return message; + }; + + /** + * Creates a plain object from a GroupFindingsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.GroupFindingsResponse + * @static + * @param {google.cloud.securitycenter.v1.GroupFindingsResponse} message GroupFindingsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GroupFindingsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.groupByResults = []; + if (options.defaults) { + object.readTime = null; + object.nextPageToken = ""; + object.totalSize = 0; + } + if (message.groupByResults && message.groupByResults.length) { + object.groupByResults = []; + for (var j = 0; j < message.groupByResults.length; ++j) + object.groupByResults[j] = $root.google.cloud.securitycenter.v1.GroupResult.toObject(message.groupByResults[j], options); + } + if (message.readTime != null && message.hasOwnProperty("readTime")) + object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.totalSize != null && message.hasOwnProperty("totalSize")) + object.totalSize = message.totalSize; + return object; + }; + + /** + * Converts this GroupFindingsResponse to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.GroupFindingsResponse + * @instance + * @returns {Object.} JSON object + */ + GroupFindingsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GroupFindingsResponse; + })(); + + v1.GroupResult = (function() { + + /** + * Properties of a GroupResult. + * @memberof google.cloud.securitycenter.v1 + * @interface IGroupResult + * @property {Object.|null} [properties] GroupResult properties + * @property {number|Long|null} [count] GroupResult count + */ + + /** + * Constructs a new GroupResult. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a GroupResult. + * @implements IGroupResult + * @constructor + * @param {google.cloud.securitycenter.v1.IGroupResult=} [properties] Properties to set + */ + function GroupResult(properties) { + this.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]]; + } + + /** + * GroupResult properties. + * @member {Object.} properties + * @memberof google.cloud.securitycenter.v1.GroupResult + * @instance + */ + GroupResult.prototype.properties = $util.emptyObject; + + /** + * GroupResult count. + * @member {number|Long} count + * @memberof google.cloud.securitycenter.v1.GroupResult + * @instance + */ + GroupResult.prototype.count = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new GroupResult instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.GroupResult + * @static + * @param {google.cloud.securitycenter.v1.IGroupResult=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.GroupResult} GroupResult instance + */ + GroupResult.create = function create(properties) { + return new GroupResult(properties); + }; + + /** + * Encodes the specified GroupResult message. Does not implicitly {@link google.cloud.securitycenter.v1.GroupResult.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.GroupResult + * @static + * @param {google.cloud.securitycenter.v1.IGroupResult} message GroupResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroupResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.properties != null && message.hasOwnProperty("properties")) + for (var keys = Object.keys(message.properties), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.protobuf.Value.encode(message.properties[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.count != null && message.hasOwnProperty("count")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.count); + return writer; + }; + + /** + * Encodes the specified GroupResult message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.GroupResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.GroupResult + * @static + * @param {google.cloud.securitycenter.v1.IGroupResult} message GroupResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroupResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GroupResult message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.GroupResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.GroupResult} GroupResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GroupResult.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.cloud.securitycenter.v1.GroupResult(), key; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + reader.skip().pos++; + if (message.properties === $util.emptyObject) + message.properties = {}; + key = reader.string(); + reader.pos++; + message.properties[key] = $root.google.protobuf.Value.decode(reader, reader.uint32()); + break; + case 2: + message.count = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GroupResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.GroupResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.GroupResult} GroupResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GroupResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GroupResult message. + * @function verify + * @memberof google.cloud.securitycenter.v1.GroupResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GroupResult.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.properties != null && message.hasOwnProperty("properties")) { + if (!$util.isObject(message.properties)) + return "properties: object expected"; + var key = Object.keys(message.properties); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.protobuf.Value.verify(message.properties[key[i]]); + if (error) + return "properties." + error; + } + } + if (message.count != null && message.hasOwnProperty("count")) + if (!$util.isInteger(message.count) && !(message.count && $util.isInteger(message.count.low) && $util.isInteger(message.count.high))) + return "count: integer|Long expected"; + return null; + }; + + /** + * Creates a GroupResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.GroupResult + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.GroupResult} GroupResult + */ + GroupResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.GroupResult) + return object; + var message = new $root.google.cloud.securitycenter.v1.GroupResult(); + if (object.properties) { + if (typeof object.properties !== "object") + throw TypeError(".google.cloud.securitycenter.v1.GroupResult.properties: object expected"); + message.properties = {}; + for (var keys = Object.keys(object.properties), i = 0; i < keys.length; ++i) { + if (typeof object.properties[keys[i]] !== "object") + throw TypeError(".google.cloud.securitycenter.v1.GroupResult.properties: object expected"); + message.properties[keys[i]] = $root.google.protobuf.Value.fromObject(object.properties[keys[i]]); + } + } + if (object.count != null) + if ($util.Long) + (message.count = $util.Long.fromValue(object.count)).unsigned = false; + else if (typeof object.count === "string") + message.count = parseInt(object.count, 10); + else if (typeof object.count === "number") + message.count = object.count; + else if (typeof object.count === "object") + message.count = new $util.LongBits(object.count.low >>> 0, object.count.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a GroupResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.GroupResult + * @static + * @param {google.cloud.securitycenter.v1.GroupResult} message GroupResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GroupResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.properties = {}; + if (options.defaults) + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.count = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.count = options.longs === String ? "0" : 0; + var keys2; + if (message.properties && (keys2 = Object.keys(message.properties)).length) { + object.properties = {}; + for (var j = 0; j < keys2.length; ++j) + object.properties[keys2[j]] = $root.google.protobuf.Value.toObject(message.properties[keys2[j]], options); + } + if (message.count != null && message.hasOwnProperty("count")) + if (typeof message.count === "number") + object.count = options.longs === String ? String(message.count) : message.count; + else + object.count = options.longs === String ? $util.Long.prototype.toString.call(message.count) : options.longs === Number ? new $util.LongBits(message.count.low >>> 0, message.count.high >>> 0).toNumber() : message.count; + return object; + }; + + /** + * Converts this GroupResult to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.GroupResult + * @instance + * @returns {Object.} JSON object + */ + GroupResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GroupResult; + })(); + + v1.ListSourcesRequest = (function() { + + /** + * Properties of a ListSourcesRequest. + * @memberof google.cloud.securitycenter.v1 + * @interface IListSourcesRequest + * @property {string|null} [parent] ListSourcesRequest parent + * @property {string|null} [pageToken] ListSourcesRequest pageToken + * @property {number|null} [pageSize] ListSourcesRequest pageSize + */ + + /** + * Constructs a new ListSourcesRequest. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a ListSourcesRequest. + * @implements IListSourcesRequest + * @constructor + * @param {google.cloud.securitycenter.v1.IListSourcesRequest=} [properties] Properties to set + */ + function ListSourcesRequest(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]]; + } + + /** + * ListSourcesRequest parent. + * @member {string} parent + * @memberof google.cloud.securitycenter.v1.ListSourcesRequest + * @instance + */ + ListSourcesRequest.prototype.parent = ""; + + /** + * ListSourcesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.securitycenter.v1.ListSourcesRequest + * @instance + */ + ListSourcesRequest.prototype.pageToken = ""; + + /** + * ListSourcesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.securitycenter.v1.ListSourcesRequest + * @instance + */ + ListSourcesRequest.prototype.pageSize = 0; + + /** + * Creates a new ListSourcesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.ListSourcesRequest + * @static + * @param {google.cloud.securitycenter.v1.IListSourcesRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.ListSourcesRequest} ListSourcesRequest instance + */ + ListSourcesRequest.create = function create(properties) { + return new ListSourcesRequest(properties); + }; + + /** + * Encodes the specified ListSourcesRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.ListSourcesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.ListSourcesRequest + * @static + * @param {google.cloud.securitycenter.v1.IListSourcesRequest} message ListSourcesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSourcesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && message.hasOwnProperty("parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.pageToken); + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.pageSize); + return writer; + }; + + /** + * Encodes the specified ListSourcesRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListSourcesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.ListSourcesRequest + * @static + * @param {google.cloud.securitycenter.v1.IListSourcesRequest} message ListSourcesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSourcesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListSourcesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.ListSourcesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.ListSourcesRequest} ListSourcesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSourcesRequest.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.cloud.securitycenter.v1.ListSourcesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.pageToken = reader.string(); + break; + case 7: + message.pageSize = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListSourcesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.ListSourcesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.ListSourcesRequest} ListSourcesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSourcesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListSourcesRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1.ListSourcesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListSourcesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + return null; + }; + + /** + * Creates a ListSourcesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.ListSourcesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.ListSourcesRequest} ListSourcesRequest + */ + ListSourcesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.ListSourcesRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1.ListSourcesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + return message; + }; + + /** + * Creates a plain object from a ListSourcesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.ListSourcesRequest + * @static + * @param {google.cloud.securitycenter.v1.ListSourcesRequest} message ListSourcesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListSourcesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageToken = ""; + object.pageSize = 0; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + return object; + }; + + /** + * Converts this ListSourcesRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.ListSourcesRequest + * @instance + * @returns {Object.} JSON object + */ + ListSourcesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListSourcesRequest; + })(); + + v1.ListSourcesResponse = (function() { + + /** + * Properties of a ListSourcesResponse. + * @memberof google.cloud.securitycenter.v1 + * @interface IListSourcesResponse + * @property {Array.|null} [sources] ListSourcesResponse sources + * @property {string|null} [nextPageToken] ListSourcesResponse nextPageToken + */ + + /** + * Constructs a new ListSourcesResponse. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a ListSourcesResponse. + * @implements IListSourcesResponse + * @constructor + * @param {google.cloud.securitycenter.v1.IListSourcesResponse=} [properties] Properties to set + */ + function ListSourcesResponse(properties) { + this.sources = []; + 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]]; + } + + /** + * ListSourcesResponse sources. + * @member {Array.} sources + * @memberof google.cloud.securitycenter.v1.ListSourcesResponse + * @instance + */ + ListSourcesResponse.prototype.sources = $util.emptyArray; + + /** + * ListSourcesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.securitycenter.v1.ListSourcesResponse + * @instance + */ + ListSourcesResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListSourcesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.ListSourcesResponse + * @static + * @param {google.cloud.securitycenter.v1.IListSourcesResponse=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.ListSourcesResponse} ListSourcesResponse instance + */ + ListSourcesResponse.create = function create(properties) { + return new ListSourcesResponse(properties); + }; + + /** + * Encodes the specified ListSourcesResponse message. Does not implicitly {@link google.cloud.securitycenter.v1.ListSourcesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.ListSourcesResponse + * @static + * @param {google.cloud.securitycenter.v1.IListSourcesResponse} message ListSourcesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSourcesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.sources != null && message.sources.length) + for (var i = 0; i < message.sources.length; ++i) + $root.google.cloud.securitycenter.v1.Source.encode(message.sources[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListSourcesResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListSourcesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.ListSourcesResponse + * @static + * @param {google.cloud.securitycenter.v1.IListSourcesResponse} message ListSourcesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSourcesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListSourcesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.ListSourcesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.ListSourcesResponse} ListSourcesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSourcesResponse.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.cloud.securitycenter.v1.ListSourcesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.sources && message.sources.length)) + message.sources = []; + message.sources.push($root.google.cloud.securitycenter.v1.Source.decode(reader, reader.uint32())); + break; + case 2: + message.nextPageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListSourcesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.ListSourcesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.ListSourcesResponse} ListSourcesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSourcesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListSourcesResponse message. + * @function verify + * @memberof google.cloud.securitycenter.v1.ListSourcesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListSourcesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.sources != null && message.hasOwnProperty("sources")) { + if (!Array.isArray(message.sources)) + return "sources: array expected"; + for (var i = 0; i < message.sources.length; ++i) { + var error = $root.google.cloud.securitycenter.v1.Source.verify(message.sources[i]); + if (error) + return "sources." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListSourcesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.ListSourcesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.ListSourcesResponse} ListSourcesResponse + */ + ListSourcesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.ListSourcesResponse) + return object; + var message = new $root.google.cloud.securitycenter.v1.ListSourcesResponse(); + if (object.sources) { + if (!Array.isArray(object.sources)) + throw TypeError(".google.cloud.securitycenter.v1.ListSourcesResponse.sources: array expected"); + message.sources = []; + for (var i = 0; i < object.sources.length; ++i) { + if (typeof object.sources[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v1.ListSourcesResponse.sources: object expected"); + message.sources[i] = $root.google.cloud.securitycenter.v1.Source.fromObject(object.sources[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListSourcesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.ListSourcesResponse + * @static + * @param {google.cloud.securitycenter.v1.ListSourcesResponse} message ListSourcesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListSourcesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.sources = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.sources && message.sources.length) { + object.sources = []; + for (var j = 0; j < message.sources.length; ++j) + object.sources[j] = $root.google.cloud.securitycenter.v1.Source.toObject(message.sources[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListSourcesResponse to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.ListSourcesResponse + * @instance + * @returns {Object.} JSON object + */ + ListSourcesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListSourcesResponse; + })(); + + v1.ListAssetsRequest = (function() { + + /** + * Properties of a ListAssetsRequest. + * @memberof google.cloud.securitycenter.v1 + * @interface IListAssetsRequest + * @property {string|null} [parent] ListAssetsRequest parent + * @property {string|null} [filter] ListAssetsRequest filter + * @property {string|null} [orderBy] ListAssetsRequest orderBy + * @property {google.protobuf.ITimestamp|null} [readTime] ListAssetsRequest readTime + * @property {google.protobuf.IDuration|null} [compareDuration] ListAssetsRequest compareDuration + * @property {google.protobuf.IFieldMask|null} [fieldMask] ListAssetsRequest fieldMask + * @property {string|null} [pageToken] ListAssetsRequest pageToken + * @property {number|null} [pageSize] ListAssetsRequest pageSize + */ + + /** + * Constructs a new ListAssetsRequest. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a ListAssetsRequest. + * @implements IListAssetsRequest + * @constructor + * @param {google.cloud.securitycenter.v1.IListAssetsRequest=} [properties] Properties to set + */ + function ListAssetsRequest(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]]; + } + + /** + * ListAssetsRequest parent. + * @member {string} parent + * @memberof google.cloud.securitycenter.v1.ListAssetsRequest + * @instance + */ + ListAssetsRequest.prototype.parent = ""; + + /** + * ListAssetsRequest filter. + * @member {string} filter + * @memberof google.cloud.securitycenter.v1.ListAssetsRequest + * @instance + */ + ListAssetsRequest.prototype.filter = ""; + + /** + * ListAssetsRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.securitycenter.v1.ListAssetsRequest + * @instance + */ + ListAssetsRequest.prototype.orderBy = ""; + + /** + * ListAssetsRequest readTime. + * @member {google.protobuf.ITimestamp|null|undefined} readTime + * @memberof google.cloud.securitycenter.v1.ListAssetsRequest + * @instance + */ + ListAssetsRequest.prototype.readTime = null; + + /** + * ListAssetsRequest compareDuration. + * @member {google.protobuf.IDuration|null|undefined} compareDuration + * @memberof google.cloud.securitycenter.v1.ListAssetsRequest + * @instance + */ + ListAssetsRequest.prototype.compareDuration = null; + + /** + * ListAssetsRequest fieldMask. + * @member {google.protobuf.IFieldMask|null|undefined} fieldMask + * @memberof google.cloud.securitycenter.v1.ListAssetsRequest + * @instance + */ + ListAssetsRequest.prototype.fieldMask = null; + + /** + * ListAssetsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.securitycenter.v1.ListAssetsRequest + * @instance + */ + ListAssetsRequest.prototype.pageToken = ""; + + /** + * ListAssetsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.securitycenter.v1.ListAssetsRequest + * @instance + */ + ListAssetsRequest.prototype.pageSize = 0; + + /** + * Creates a new ListAssetsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.ListAssetsRequest + * @static + * @param {google.cloud.securitycenter.v1.IListAssetsRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.ListAssetsRequest} ListAssetsRequest instance + */ + ListAssetsRequest.create = function create(properties) { + return new ListAssetsRequest(properties); + }; + + /** + * Encodes the specified ListAssetsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.ListAssetsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.ListAssetsRequest + * @static + * @param {google.cloud.securitycenter.v1.IListAssetsRequest} message ListAssetsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAssetsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && message.hasOwnProperty("parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.filter != null && message.hasOwnProperty("filter")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.orderBy); + if (message.readTime != null && message.hasOwnProperty("readTime")) + $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.compareDuration != null && message.hasOwnProperty("compareDuration")) + $root.google.protobuf.Duration.encode(message.compareDuration, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.fieldMask != null && message.hasOwnProperty("fieldMask")) + $root.google.protobuf.FieldMask.encode(message.fieldMask, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.pageToken); + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.pageSize); + return writer; + }; + + /** + * Encodes the specified ListAssetsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListAssetsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.ListAssetsRequest + * @static + * @param {google.cloud.securitycenter.v1.IListAssetsRequest} message ListAssetsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAssetsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListAssetsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.ListAssetsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.ListAssetsRequest} ListAssetsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAssetsRequest.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.cloud.securitycenter.v1.ListAssetsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.filter = reader.string(); + break; + case 3: + message.orderBy = reader.string(); + break; + case 4: + message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 5: + message.compareDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + case 7: + message.fieldMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + case 8: + message.pageToken = reader.string(); + break; + case 9: + message.pageSize = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListAssetsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.ListAssetsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.ListAssetsRequest} ListAssetsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAssetsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListAssetsRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1.ListAssetsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListAssetsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + if (message.readTime != null && message.hasOwnProperty("readTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.readTime); + if (error) + return "readTime." + error; + } + if (message.compareDuration != null && message.hasOwnProperty("compareDuration")) { + var error = $root.google.protobuf.Duration.verify(message.compareDuration); + if (error) + return "compareDuration." + error; + } + if (message.fieldMask != null && message.hasOwnProperty("fieldMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.fieldMask); + if (error) + return "fieldMask." + error; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + return null; + }; + + /** + * Creates a ListAssetsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.ListAssetsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.ListAssetsRequest} ListAssetsRequest + */ + ListAssetsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.ListAssetsRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1.ListAssetsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.filter != null) + message.filter = String(object.filter); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.readTime != null) { + if (typeof object.readTime !== "object") + throw TypeError(".google.cloud.securitycenter.v1.ListAssetsRequest.readTime: object expected"); + message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); + } + if (object.compareDuration != null) { + if (typeof object.compareDuration !== "object") + throw TypeError(".google.cloud.securitycenter.v1.ListAssetsRequest.compareDuration: object expected"); + message.compareDuration = $root.google.protobuf.Duration.fromObject(object.compareDuration); + } + if (object.fieldMask != null) { + if (typeof object.fieldMask !== "object") + throw TypeError(".google.cloud.securitycenter.v1.ListAssetsRequest.fieldMask: object expected"); + message.fieldMask = $root.google.protobuf.FieldMask.fromObject(object.fieldMask); + } + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + return message; + }; + + /** + * Creates a plain object from a ListAssetsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.ListAssetsRequest + * @static + * @param {google.cloud.securitycenter.v1.ListAssetsRequest} message ListAssetsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListAssetsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.filter = ""; + object.orderBy = ""; + object.readTime = null; + object.compareDuration = null; + object.fieldMask = null; + object.pageToken = ""; + object.pageSize = 0; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; + if (message.readTime != null && message.hasOwnProperty("readTime")) + object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); + if (message.compareDuration != null && message.hasOwnProperty("compareDuration")) + object.compareDuration = $root.google.protobuf.Duration.toObject(message.compareDuration, options); + if (message.fieldMask != null && message.hasOwnProperty("fieldMask")) + object.fieldMask = $root.google.protobuf.FieldMask.toObject(message.fieldMask, options); + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + return object; + }; + + /** + * Converts this ListAssetsRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.ListAssetsRequest + * @instance + * @returns {Object.} JSON object + */ + ListAssetsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListAssetsRequest; + })(); + + v1.ListAssetsResponse = (function() { + + /** + * Properties of a ListAssetsResponse. + * @memberof google.cloud.securitycenter.v1 + * @interface IListAssetsResponse + * @property {Array.|null} [listAssetsResults] ListAssetsResponse listAssetsResults + * @property {google.protobuf.ITimestamp|null} [readTime] ListAssetsResponse readTime + * @property {string|null} [nextPageToken] ListAssetsResponse nextPageToken + * @property {number|null} [totalSize] ListAssetsResponse totalSize + */ + + /** + * Constructs a new ListAssetsResponse. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a ListAssetsResponse. + * @implements IListAssetsResponse + * @constructor + * @param {google.cloud.securitycenter.v1.IListAssetsResponse=} [properties] Properties to set + */ + function ListAssetsResponse(properties) { + this.listAssetsResults = []; + 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]]; + } + + /** + * ListAssetsResponse listAssetsResults. + * @member {Array.} listAssetsResults + * @memberof google.cloud.securitycenter.v1.ListAssetsResponse + * @instance + */ + ListAssetsResponse.prototype.listAssetsResults = $util.emptyArray; + + /** + * ListAssetsResponse readTime. + * @member {google.protobuf.ITimestamp|null|undefined} readTime + * @memberof google.cloud.securitycenter.v1.ListAssetsResponse + * @instance + */ + ListAssetsResponse.prototype.readTime = null; + + /** + * ListAssetsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.securitycenter.v1.ListAssetsResponse + * @instance + */ + ListAssetsResponse.prototype.nextPageToken = ""; + + /** + * ListAssetsResponse totalSize. + * @member {number} totalSize + * @memberof google.cloud.securitycenter.v1.ListAssetsResponse + * @instance + */ + ListAssetsResponse.prototype.totalSize = 0; + + /** + * Creates a new ListAssetsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.ListAssetsResponse + * @static + * @param {google.cloud.securitycenter.v1.IListAssetsResponse=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.ListAssetsResponse} ListAssetsResponse instance + */ + ListAssetsResponse.create = function create(properties) { + return new ListAssetsResponse(properties); + }; + + /** + * Encodes the specified ListAssetsResponse message. Does not implicitly {@link google.cloud.securitycenter.v1.ListAssetsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.ListAssetsResponse + * @static + * @param {google.cloud.securitycenter.v1.IListAssetsResponse} message ListAssetsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAssetsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.listAssetsResults != null && message.listAssetsResults.length) + for (var i = 0; i < message.listAssetsResults.length; ++i) + $root.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult.encode(message.listAssetsResults[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.readTime != null && message.hasOwnProperty("readTime")) + $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.nextPageToken); + if (message.totalSize != null && message.hasOwnProperty("totalSize")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.totalSize); + return writer; + }; + + /** + * Encodes the specified ListAssetsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListAssetsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.ListAssetsResponse + * @static + * @param {google.cloud.securitycenter.v1.IListAssetsResponse} message ListAssetsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAssetsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListAssetsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.ListAssetsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.ListAssetsResponse} ListAssetsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAssetsResponse.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.cloud.securitycenter.v1.ListAssetsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.listAssetsResults && message.listAssetsResults.length)) + message.listAssetsResults = []; + message.listAssetsResults.push($root.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult.decode(reader, reader.uint32())); + break; + case 2: + message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 3: + message.nextPageToken = reader.string(); + break; + case 4: + message.totalSize = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListAssetsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.ListAssetsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.ListAssetsResponse} ListAssetsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAssetsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListAssetsResponse message. + * @function verify + * @memberof google.cloud.securitycenter.v1.ListAssetsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListAssetsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.listAssetsResults != null && message.hasOwnProperty("listAssetsResults")) { + if (!Array.isArray(message.listAssetsResults)) + return "listAssetsResults: array expected"; + for (var i = 0; i < message.listAssetsResults.length; ++i) { + var error = $root.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult.verify(message.listAssetsResults[i]); + if (error) + return "listAssetsResults." + error; + } + } + if (message.readTime != null && message.hasOwnProperty("readTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.readTime); + if (error) + return "readTime." + error; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.totalSize != null && message.hasOwnProperty("totalSize")) + if (!$util.isInteger(message.totalSize)) + return "totalSize: integer expected"; + return null; + }; + + /** + * Creates a ListAssetsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.ListAssetsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.ListAssetsResponse} ListAssetsResponse + */ + ListAssetsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.ListAssetsResponse) + return object; + var message = new $root.google.cloud.securitycenter.v1.ListAssetsResponse(); + if (object.listAssetsResults) { + if (!Array.isArray(object.listAssetsResults)) + throw TypeError(".google.cloud.securitycenter.v1.ListAssetsResponse.listAssetsResults: array expected"); + message.listAssetsResults = []; + for (var i = 0; i < object.listAssetsResults.length; ++i) { + if (typeof object.listAssetsResults[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v1.ListAssetsResponse.listAssetsResults: object expected"); + message.listAssetsResults[i] = $root.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult.fromObject(object.listAssetsResults[i]); + } + } + if (object.readTime != null) { + if (typeof object.readTime !== "object") + throw TypeError(".google.cloud.securitycenter.v1.ListAssetsResponse.readTime: object expected"); + message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.totalSize != null) + message.totalSize = object.totalSize | 0; + return message; + }; + + /** + * Creates a plain object from a ListAssetsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.ListAssetsResponse + * @static + * @param {google.cloud.securitycenter.v1.ListAssetsResponse} message ListAssetsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListAssetsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.listAssetsResults = []; + if (options.defaults) { + object.readTime = null; + object.nextPageToken = ""; + object.totalSize = 0; + } + if (message.listAssetsResults && message.listAssetsResults.length) { + object.listAssetsResults = []; + for (var j = 0; j < message.listAssetsResults.length; ++j) + object.listAssetsResults[j] = $root.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult.toObject(message.listAssetsResults[j], options); + } + if (message.readTime != null && message.hasOwnProperty("readTime")) + object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.totalSize != null && message.hasOwnProperty("totalSize")) + object.totalSize = message.totalSize; + return object; + }; + + /** + * Converts this ListAssetsResponse to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.ListAssetsResponse + * @instance + * @returns {Object.} JSON object + */ + ListAssetsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + ListAssetsResponse.ListAssetsResult = (function() { + + /** + * Properties of a ListAssetsResult. + * @memberof google.cloud.securitycenter.v1.ListAssetsResponse + * @interface IListAssetsResult + * @property {google.cloud.securitycenter.v1.IAsset|null} [asset] ListAssetsResult asset + * @property {google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult.StateChange|null} [stateChange] ListAssetsResult stateChange + */ + + /** + * Constructs a new ListAssetsResult. + * @memberof google.cloud.securitycenter.v1.ListAssetsResponse + * @classdesc Represents a ListAssetsResult. + * @implements IListAssetsResult + * @constructor + * @param {google.cloud.securitycenter.v1.ListAssetsResponse.IListAssetsResult=} [properties] Properties to set + */ + function ListAssetsResult(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]]; + } + + /** + * ListAssetsResult asset. + * @member {google.cloud.securitycenter.v1.IAsset|null|undefined} asset + * @memberof google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult + * @instance + */ + ListAssetsResult.prototype.asset = null; + + /** + * ListAssetsResult stateChange. + * @member {google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult.StateChange} stateChange + * @memberof google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult + * @instance + */ + ListAssetsResult.prototype.stateChange = 0; + + /** + * Creates a new ListAssetsResult instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult + * @static + * @param {google.cloud.securitycenter.v1.ListAssetsResponse.IListAssetsResult=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult} ListAssetsResult instance + */ + ListAssetsResult.create = function create(properties) { + return new ListAssetsResult(properties); + }; + + /** + * Encodes the specified ListAssetsResult message. Does not implicitly {@link google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult + * @static + * @param {google.cloud.securitycenter.v1.ListAssetsResponse.IListAssetsResult} message ListAssetsResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAssetsResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.asset != null && message.hasOwnProperty("asset")) + $root.google.cloud.securitycenter.v1.Asset.encode(message.asset, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.stateChange != null && message.hasOwnProperty("stateChange")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.stateChange); + return writer; + }; + + /** + * Encodes the specified ListAssetsResult message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult + * @static + * @param {google.cloud.securitycenter.v1.ListAssetsResponse.IListAssetsResult} message ListAssetsResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAssetsResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListAssetsResult message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult} ListAssetsResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAssetsResult.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.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.asset = $root.google.cloud.securitycenter.v1.Asset.decode(reader, reader.uint32()); + break; + case 2: + message.stateChange = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListAssetsResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult} ListAssetsResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAssetsResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListAssetsResult message. + * @function verify + * @memberof google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListAssetsResult.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.asset != null && message.hasOwnProperty("asset")) { + var error = $root.google.cloud.securitycenter.v1.Asset.verify(message.asset); + if (error) + return "asset." + error; + } + if (message.stateChange != null && message.hasOwnProperty("stateChange")) + switch (message.stateChange) { + default: + return "stateChange: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + return null; + }; + + /** + * Creates a ListAssetsResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult} ListAssetsResult + */ + ListAssetsResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult) + return object; + var message = new $root.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult(); + if (object.asset != null) { + if (typeof object.asset !== "object") + throw TypeError(".google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult.asset: object expected"); + message.asset = $root.google.cloud.securitycenter.v1.Asset.fromObject(object.asset); + } + switch (object.stateChange) { + case "UNUSED": + case 0: + message.stateChange = 0; + break; + case "ADDED": + case 1: + message.stateChange = 1; + break; + case "REMOVED": + case 2: + message.stateChange = 2; + break; + case "ACTIVE": + case 3: + message.stateChange = 3; + break; + } + return message; + }; + + /** + * Creates a plain object from a ListAssetsResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult + * @static + * @param {google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult} message ListAssetsResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListAssetsResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.asset = null; + object.stateChange = options.enums === String ? "UNUSED" : 0; + } + if (message.asset != null && message.hasOwnProperty("asset")) + object.asset = $root.google.cloud.securitycenter.v1.Asset.toObject(message.asset, options); + if (message.stateChange != null && message.hasOwnProperty("stateChange")) + object.stateChange = options.enums === String ? $root.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult.StateChange[message.stateChange] : message.stateChange; + return object; + }; + + /** + * Converts this ListAssetsResult to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult + * @instance + * @returns {Object.} JSON object + */ + ListAssetsResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * StateChange enum. + * @name google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult.StateChange + * @enum {string} + * @property {number} UNUSED=0 UNUSED value + * @property {number} ADDED=1 ADDED value + * @property {number} REMOVED=2 REMOVED value + * @property {number} ACTIVE=3 ACTIVE value + */ + ListAssetsResult.StateChange = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNUSED"] = 0; + values[valuesById[1] = "ADDED"] = 1; + values[valuesById[2] = "REMOVED"] = 2; + values[valuesById[3] = "ACTIVE"] = 3; + return values; + })(); + + return ListAssetsResult; + })(); + + return ListAssetsResponse; + })(); + + v1.ListFindingsRequest = (function() { + + /** + * Properties of a ListFindingsRequest. + * @memberof google.cloud.securitycenter.v1 + * @interface IListFindingsRequest + * @property {string|null} [parent] ListFindingsRequest parent + * @property {string|null} [filter] ListFindingsRequest filter + * @property {string|null} [orderBy] ListFindingsRequest orderBy + * @property {google.protobuf.ITimestamp|null} [readTime] ListFindingsRequest readTime + * @property {google.protobuf.IDuration|null} [compareDuration] ListFindingsRequest compareDuration + * @property {google.protobuf.IFieldMask|null} [fieldMask] ListFindingsRequest fieldMask + * @property {string|null} [pageToken] ListFindingsRequest pageToken + * @property {number|null} [pageSize] ListFindingsRequest pageSize + */ + + /** + * Constructs a new ListFindingsRequest. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a ListFindingsRequest. + * @implements IListFindingsRequest + * @constructor + * @param {google.cloud.securitycenter.v1.IListFindingsRequest=} [properties] Properties to set + */ + function ListFindingsRequest(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]]; + } + + /** + * ListFindingsRequest parent. + * @member {string} parent + * @memberof google.cloud.securitycenter.v1.ListFindingsRequest + * @instance + */ + ListFindingsRequest.prototype.parent = ""; + + /** + * ListFindingsRequest filter. + * @member {string} filter + * @memberof google.cloud.securitycenter.v1.ListFindingsRequest + * @instance + */ + ListFindingsRequest.prototype.filter = ""; + + /** + * ListFindingsRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.securitycenter.v1.ListFindingsRequest + * @instance + */ + ListFindingsRequest.prototype.orderBy = ""; + + /** + * ListFindingsRequest readTime. + * @member {google.protobuf.ITimestamp|null|undefined} readTime + * @memberof google.cloud.securitycenter.v1.ListFindingsRequest + * @instance + */ + ListFindingsRequest.prototype.readTime = null; + + /** + * ListFindingsRequest compareDuration. + * @member {google.protobuf.IDuration|null|undefined} compareDuration + * @memberof google.cloud.securitycenter.v1.ListFindingsRequest + * @instance + */ + ListFindingsRequest.prototype.compareDuration = null; + + /** + * ListFindingsRequest fieldMask. + * @member {google.protobuf.IFieldMask|null|undefined} fieldMask + * @memberof google.cloud.securitycenter.v1.ListFindingsRequest + * @instance + */ + ListFindingsRequest.prototype.fieldMask = null; + + /** + * ListFindingsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.securitycenter.v1.ListFindingsRequest + * @instance + */ + ListFindingsRequest.prototype.pageToken = ""; + + /** + * ListFindingsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.securitycenter.v1.ListFindingsRequest + * @instance + */ + ListFindingsRequest.prototype.pageSize = 0; + + /** + * Creates a new ListFindingsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.ListFindingsRequest + * @static + * @param {google.cloud.securitycenter.v1.IListFindingsRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.ListFindingsRequest} ListFindingsRequest instance + */ + ListFindingsRequest.create = function create(properties) { + return new ListFindingsRequest(properties); + }; + + /** + * Encodes the specified ListFindingsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.ListFindingsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.ListFindingsRequest + * @static + * @param {google.cloud.securitycenter.v1.IListFindingsRequest} message ListFindingsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListFindingsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && message.hasOwnProperty("parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.filter != null && message.hasOwnProperty("filter")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.orderBy); + if (message.readTime != null && message.hasOwnProperty("readTime")) + $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.compareDuration != null && message.hasOwnProperty("compareDuration")) + $root.google.protobuf.Duration.encode(message.compareDuration, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.fieldMask != null && message.hasOwnProperty("fieldMask")) + $root.google.protobuf.FieldMask.encode(message.fieldMask, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.pageToken); + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.pageSize); + return writer; + }; + + /** + * Encodes the specified ListFindingsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListFindingsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.ListFindingsRequest + * @static + * @param {google.cloud.securitycenter.v1.IListFindingsRequest} message ListFindingsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListFindingsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListFindingsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.ListFindingsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.ListFindingsRequest} ListFindingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListFindingsRequest.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.cloud.securitycenter.v1.ListFindingsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.filter = reader.string(); + break; + case 3: + message.orderBy = reader.string(); + break; + case 4: + message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 5: + message.compareDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + case 7: + message.fieldMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + case 8: + message.pageToken = reader.string(); + break; + case 9: + message.pageSize = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListFindingsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.ListFindingsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.ListFindingsRequest} ListFindingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListFindingsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListFindingsRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1.ListFindingsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListFindingsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + if (message.readTime != null && message.hasOwnProperty("readTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.readTime); + if (error) + return "readTime." + error; + } + if (message.compareDuration != null && message.hasOwnProperty("compareDuration")) { + var error = $root.google.protobuf.Duration.verify(message.compareDuration); + if (error) + return "compareDuration." + error; + } + if (message.fieldMask != null && message.hasOwnProperty("fieldMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.fieldMask); + if (error) + return "fieldMask." + error; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + return null; + }; + + /** + * Creates a ListFindingsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.ListFindingsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.ListFindingsRequest} ListFindingsRequest + */ + ListFindingsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.ListFindingsRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1.ListFindingsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.filter != null) + message.filter = String(object.filter); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.readTime != null) { + if (typeof object.readTime !== "object") + throw TypeError(".google.cloud.securitycenter.v1.ListFindingsRequest.readTime: object expected"); + message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); + } + if (object.compareDuration != null) { + if (typeof object.compareDuration !== "object") + throw TypeError(".google.cloud.securitycenter.v1.ListFindingsRequest.compareDuration: object expected"); + message.compareDuration = $root.google.protobuf.Duration.fromObject(object.compareDuration); + } + if (object.fieldMask != null) { + if (typeof object.fieldMask !== "object") + throw TypeError(".google.cloud.securitycenter.v1.ListFindingsRequest.fieldMask: object expected"); + message.fieldMask = $root.google.protobuf.FieldMask.fromObject(object.fieldMask); + } + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + return message; + }; + + /** + * Creates a plain object from a ListFindingsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.ListFindingsRequest + * @static + * @param {google.cloud.securitycenter.v1.ListFindingsRequest} message ListFindingsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListFindingsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.filter = ""; + object.orderBy = ""; + object.readTime = null; + object.compareDuration = null; + object.fieldMask = null; + object.pageToken = ""; + object.pageSize = 0; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; + if (message.readTime != null && message.hasOwnProperty("readTime")) + object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); + if (message.compareDuration != null && message.hasOwnProperty("compareDuration")) + object.compareDuration = $root.google.protobuf.Duration.toObject(message.compareDuration, options); + if (message.fieldMask != null && message.hasOwnProperty("fieldMask")) + object.fieldMask = $root.google.protobuf.FieldMask.toObject(message.fieldMask, options); + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + return object; + }; + + /** + * Converts this ListFindingsRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.ListFindingsRequest + * @instance + * @returns {Object.} JSON object + */ + ListFindingsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListFindingsRequest; + })(); + + v1.ListFindingsResponse = (function() { + + /** + * Properties of a ListFindingsResponse. + * @memberof google.cloud.securitycenter.v1 + * @interface IListFindingsResponse + * @property {Array.|null} [listFindingsResults] ListFindingsResponse listFindingsResults + * @property {google.protobuf.ITimestamp|null} [readTime] ListFindingsResponse readTime + * @property {string|null} [nextPageToken] ListFindingsResponse nextPageToken + * @property {number|null} [totalSize] ListFindingsResponse totalSize + */ + + /** + * Constructs a new ListFindingsResponse. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a ListFindingsResponse. + * @implements IListFindingsResponse + * @constructor + * @param {google.cloud.securitycenter.v1.IListFindingsResponse=} [properties] Properties to set + */ + function ListFindingsResponse(properties) { + this.listFindingsResults = []; + 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]]; + } + + /** + * ListFindingsResponse listFindingsResults. + * @member {Array.} listFindingsResults + * @memberof google.cloud.securitycenter.v1.ListFindingsResponse + * @instance + */ + ListFindingsResponse.prototype.listFindingsResults = $util.emptyArray; + + /** + * ListFindingsResponse readTime. + * @member {google.protobuf.ITimestamp|null|undefined} readTime + * @memberof google.cloud.securitycenter.v1.ListFindingsResponse + * @instance + */ + ListFindingsResponse.prototype.readTime = null; + + /** + * ListFindingsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.securitycenter.v1.ListFindingsResponse + * @instance + */ + ListFindingsResponse.prototype.nextPageToken = ""; + + /** + * ListFindingsResponse totalSize. + * @member {number} totalSize + * @memberof google.cloud.securitycenter.v1.ListFindingsResponse + * @instance + */ + ListFindingsResponse.prototype.totalSize = 0; + + /** + * Creates a new ListFindingsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.ListFindingsResponse + * @static + * @param {google.cloud.securitycenter.v1.IListFindingsResponse=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.ListFindingsResponse} ListFindingsResponse instance + */ + ListFindingsResponse.create = function create(properties) { + return new ListFindingsResponse(properties); + }; + + /** + * Encodes the specified ListFindingsResponse message. Does not implicitly {@link google.cloud.securitycenter.v1.ListFindingsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.ListFindingsResponse + * @static + * @param {google.cloud.securitycenter.v1.IListFindingsResponse} message ListFindingsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListFindingsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.listFindingsResults != null && message.listFindingsResults.length) + for (var i = 0; i < message.listFindingsResults.length; ++i) + $root.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.encode(message.listFindingsResults[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.readTime != null && message.hasOwnProperty("readTime")) + $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.nextPageToken); + if (message.totalSize != null && message.hasOwnProperty("totalSize")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.totalSize); + return writer; + }; + + /** + * Encodes the specified ListFindingsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListFindingsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.ListFindingsResponse + * @static + * @param {google.cloud.securitycenter.v1.IListFindingsResponse} message ListFindingsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListFindingsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListFindingsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.ListFindingsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.ListFindingsResponse} ListFindingsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListFindingsResponse.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.cloud.securitycenter.v1.ListFindingsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.listFindingsResults && message.listFindingsResults.length)) + message.listFindingsResults = []; + message.listFindingsResults.push($root.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.decode(reader, reader.uint32())); + break; + case 2: + message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 3: + message.nextPageToken = reader.string(); + break; + case 4: + message.totalSize = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListFindingsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.ListFindingsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.ListFindingsResponse} ListFindingsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListFindingsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListFindingsResponse message. + * @function verify + * @memberof google.cloud.securitycenter.v1.ListFindingsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListFindingsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.listFindingsResults != null && message.hasOwnProperty("listFindingsResults")) { + if (!Array.isArray(message.listFindingsResults)) + return "listFindingsResults: array expected"; + for (var i = 0; i < message.listFindingsResults.length; ++i) { + var error = $root.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.verify(message.listFindingsResults[i]); + if (error) + return "listFindingsResults." + error; + } + } + if (message.readTime != null && message.hasOwnProperty("readTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.readTime); + if (error) + return "readTime." + error; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.totalSize != null && message.hasOwnProperty("totalSize")) + if (!$util.isInteger(message.totalSize)) + return "totalSize: integer expected"; + return null; + }; + + /** + * Creates a ListFindingsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.ListFindingsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.ListFindingsResponse} ListFindingsResponse + */ + ListFindingsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.ListFindingsResponse) + return object; + var message = new $root.google.cloud.securitycenter.v1.ListFindingsResponse(); + if (object.listFindingsResults) { + if (!Array.isArray(object.listFindingsResults)) + throw TypeError(".google.cloud.securitycenter.v1.ListFindingsResponse.listFindingsResults: array expected"); + message.listFindingsResults = []; + for (var i = 0; i < object.listFindingsResults.length; ++i) { + if (typeof object.listFindingsResults[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v1.ListFindingsResponse.listFindingsResults: object expected"); + message.listFindingsResults[i] = $root.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.fromObject(object.listFindingsResults[i]); + } + } + if (object.readTime != null) { + if (typeof object.readTime !== "object") + throw TypeError(".google.cloud.securitycenter.v1.ListFindingsResponse.readTime: object expected"); + message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.totalSize != null) + message.totalSize = object.totalSize | 0; + return message; + }; + + /** + * Creates a plain object from a ListFindingsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.ListFindingsResponse + * @static + * @param {google.cloud.securitycenter.v1.ListFindingsResponse} message ListFindingsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListFindingsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.listFindingsResults = []; + if (options.defaults) { + object.readTime = null; + object.nextPageToken = ""; + object.totalSize = 0; + } + if (message.listFindingsResults && message.listFindingsResults.length) { + object.listFindingsResults = []; + for (var j = 0; j < message.listFindingsResults.length; ++j) + object.listFindingsResults[j] = $root.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.toObject(message.listFindingsResults[j], options); + } + if (message.readTime != null && message.hasOwnProperty("readTime")) + object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.totalSize != null && message.hasOwnProperty("totalSize")) + object.totalSize = message.totalSize; + return object; + }; + + /** + * Converts this ListFindingsResponse to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.ListFindingsResponse + * @instance + * @returns {Object.} JSON object + */ + ListFindingsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + ListFindingsResponse.ListFindingsResult = (function() { + + /** + * Properties of a ListFindingsResult. + * @memberof google.cloud.securitycenter.v1.ListFindingsResponse + * @interface IListFindingsResult + * @property {google.cloud.securitycenter.v1.IFinding|null} [finding] ListFindingsResult finding + * @property {google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.StateChange|null} [stateChange] ListFindingsResult stateChange + * @property {google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.IResource|null} [resource] ListFindingsResult resource + */ + + /** + * Constructs a new ListFindingsResult. + * @memberof google.cloud.securitycenter.v1.ListFindingsResponse + * @classdesc Represents a ListFindingsResult. + * @implements IListFindingsResult + * @constructor + * @param {google.cloud.securitycenter.v1.ListFindingsResponse.IListFindingsResult=} [properties] Properties to set + */ + function ListFindingsResult(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]]; + } + + /** + * ListFindingsResult finding. + * @member {google.cloud.securitycenter.v1.IFinding|null|undefined} finding + * @memberof google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult + * @instance + */ + ListFindingsResult.prototype.finding = null; + + /** + * ListFindingsResult stateChange. + * @member {google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.StateChange} stateChange + * @memberof google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult + * @instance + */ + ListFindingsResult.prototype.stateChange = 0; + + /** + * ListFindingsResult resource. + * @member {google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.IResource|null|undefined} resource + * @memberof google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult + * @instance + */ + ListFindingsResult.prototype.resource = null; + + /** + * Creates a new ListFindingsResult instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult + * @static + * @param {google.cloud.securitycenter.v1.ListFindingsResponse.IListFindingsResult=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult} ListFindingsResult instance + */ + ListFindingsResult.create = function create(properties) { + return new ListFindingsResult(properties); + }; + + /** + * Encodes the specified ListFindingsResult message. Does not implicitly {@link google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult + * @static + * @param {google.cloud.securitycenter.v1.ListFindingsResponse.IListFindingsResult} message ListFindingsResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListFindingsResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.finding != null && message.hasOwnProperty("finding")) + $root.google.cloud.securitycenter.v1.Finding.encode(message.finding, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.stateChange != null && message.hasOwnProperty("stateChange")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.stateChange); + if (message.resource != null && message.hasOwnProperty("resource")) + $root.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource.encode(message.resource, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ListFindingsResult message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult + * @static + * @param {google.cloud.securitycenter.v1.ListFindingsResponse.IListFindingsResult} message ListFindingsResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListFindingsResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListFindingsResult message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult} ListFindingsResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListFindingsResult.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.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.finding = $root.google.cloud.securitycenter.v1.Finding.decode(reader, reader.uint32()); + break; + case 2: + message.stateChange = reader.int32(); + break; + case 3: + message.resource = $root.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListFindingsResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult} ListFindingsResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListFindingsResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListFindingsResult message. + * @function verify + * @memberof google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListFindingsResult.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.finding != null && message.hasOwnProperty("finding")) { + var error = $root.google.cloud.securitycenter.v1.Finding.verify(message.finding); + if (error) + return "finding." + error; + } + if (message.stateChange != null && message.hasOwnProperty("stateChange")) + switch (message.stateChange) { + default: + return "stateChange: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.resource != null && message.hasOwnProperty("resource")) { + var error = $root.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource.verify(message.resource); + if (error) + return "resource." + error; + } + return null; + }; + + /** + * Creates a ListFindingsResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult} ListFindingsResult + */ + ListFindingsResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult) + return object; + var message = new $root.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult(); + if (object.finding != null) { + if (typeof object.finding !== "object") + throw TypeError(".google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.finding: object expected"); + message.finding = $root.google.cloud.securitycenter.v1.Finding.fromObject(object.finding); + } + switch (object.stateChange) { + case "UNUSED": + case 0: + message.stateChange = 0; + break; + case "CHANGED": + case 1: + message.stateChange = 1; + break; + case "UNCHANGED": + case 2: + message.stateChange = 2; + break; + case "ADDED": + case 3: + message.stateChange = 3; + break; + case "REMOVED": + case 4: + message.stateChange = 4; + break; + } + if (object.resource != null) { + if (typeof object.resource !== "object") + throw TypeError(".google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.resource: object expected"); + message.resource = $root.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource.fromObject(object.resource); + } + return message; + }; + + /** + * Creates a plain object from a ListFindingsResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult + * @static + * @param {google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult} message ListFindingsResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListFindingsResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.finding = null; + object.stateChange = options.enums === String ? "UNUSED" : 0; + object.resource = null; + } + if (message.finding != null && message.hasOwnProperty("finding")) + object.finding = $root.google.cloud.securitycenter.v1.Finding.toObject(message.finding, options); + if (message.stateChange != null && message.hasOwnProperty("stateChange")) + object.stateChange = options.enums === String ? $root.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.StateChange[message.stateChange] : message.stateChange; + if (message.resource != null && message.hasOwnProperty("resource")) + object.resource = $root.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource.toObject(message.resource, options); + return object; + }; + + /** + * Converts this ListFindingsResult to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult + * @instance + * @returns {Object.} JSON object + */ + ListFindingsResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + ListFindingsResult.Resource = (function() { + + /** + * Properties of a Resource. + * @memberof google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult + * @interface IResource + * @property {string|null} [name] Resource name + * @property {string|null} [projectName] Resource projectName + * @property {string|null} [projectDisplayName] Resource projectDisplayName + * @property {string|null} [parentName] Resource parentName + * @property {string|null} [parentDisplayName] Resource parentDisplayName + */ + + /** + * Constructs a new Resource. + * @memberof google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult + * @classdesc Represents a Resource. + * @implements IResource + * @constructor + * @param {google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.IResource=} [properties] Properties to set + */ + function Resource(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]]; + } + + /** + * Resource name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource + * @instance + */ + Resource.prototype.name = ""; + + /** + * Resource projectName. + * @member {string} projectName + * @memberof google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource + * @instance + */ + Resource.prototype.projectName = ""; + + /** + * Resource projectDisplayName. + * @member {string} projectDisplayName + * @memberof google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource + * @instance + */ + Resource.prototype.projectDisplayName = ""; + + /** + * Resource parentName. + * @member {string} parentName + * @memberof google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource + * @instance + */ + Resource.prototype.parentName = ""; + + /** + * Resource parentDisplayName. + * @member {string} parentDisplayName + * @memberof google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource + * @instance + */ + Resource.prototype.parentDisplayName = ""; + + /** + * Creates a new Resource instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource + * @static + * @param {google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.IResource=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource} Resource instance + */ + Resource.create = function create(properties) { + return new Resource(properties); + }; + + /** + * Encodes the specified Resource message. Does not implicitly {@link google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource + * @static + * @param {google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.IResource} message Resource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Resource.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.projectName != null && message.hasOwnProperty("projectName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.projectName); + if (message.projectDisplayName != null && message.hasOwnProperty("projectDisplayName")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.projectDisplayName); + if (message.parentName != null && message.hasOwnProperty("parentName")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.parentName); + if (message.parentDisplayName != null && message.hasOwnProperty("parentDisplayName")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.parentDisplayName); + return writer; + }; + + /** + * Encodes the specified Resource message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource + * @static + * @param {google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.IResource} message Resource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Resource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Resource message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource} Resource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Resource.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.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.projectName = reader.string(); + break; + case 3: + message.projectDisplayName = reader.string(); + break; + case 4: + message.parentName = reader.string(); + break; + case 5: + message.parentDisplayName = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Resource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource} Resource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Resource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Resource message. + * @function verify + * @memberof google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Resource.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.projectName != null && message.hasOwnProperty("projectName")) + if (!$util.isString(message.projectName)) + return "projectName: string expected"; + if (message.projectDisplayName != null && message.hasOwnProperty("projectDisplayName")) + if (!$util.isString(message.projectDisplayName)) + return "projectDisplayName: string expected"; + if (message.parentName != null && message.hasOwnProperty("parentName")) + if (!$util.isString(message.parentName)) + return "parentName: string expected"; + if (message.parentDisplayName != null && message.hasOwnProperty("parentDisplayName")) + if (!$util.isString(message.parentDisplayName)) + return "parentDisplayName: string expected"; + return null; + }; + + /** + * Creates a Resource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource} Resource + */ + Resource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource) + return object; + var message = new $root.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource(); + if (object.name != null) + message.name = String(object.name); + if (object.projectName != null) + message.projectName = String(object.projectName); + if (object.projectDisplayName != null) + message.projectDisplayName = String(object.projectDisplayName); + if (object.parentName != null) + message.parentName = String(object.parentName); + if (object.parentDisplayName != null) + message.parentDisplayName = String(object.parentDisplayName); + return message; + }; + + /** + * Creates a plain object from a Resource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource + * @static + * @param {google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource} message Resource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Resource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.projectName = ""; + object.projectDisplayName = ""; + object.parentName = ""; + object.parentDisplayName = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.projectName != null && message.hasOwnProperty("projectName")) + object.projectName = message.projectName; + if (message.projectDisplayName != null && message.hasOwnProperty("projectDisplayName")) + object.projectDisplayName = message.projectDisplayName; + if (message.parentName != null && message.hasOwnProperty("parentName")) + object.parentName = message.parentName; + if (message.parentDisplayName != null && message.hasOwnProperty("parentDisplayName")) + object.parentDisplayName = message.parentDisplayName; + return object; + }; + + /** + * Converts this Resource to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource + * @instance + * @returns {Object.} JSON object + */ + Resource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Resource; + })(); + + /** + * StateChange enum. + * @name google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.StateChange + * @enum {string} + * @property {number} UNUSED=0 UNUSED value + * @property {number} CHANGED=1 CHANGED value + * @property {number} UNCHANGED=2 UNCHANGED value + * @property {number} ADDED=3 ADDED value + * @property {number} REMOVED=4 REMOVED value + */ + ListFindingsResult.StateChange = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNUSED"] = 0; + values[valuesById[1] = "CHANGED"] = 1; + values[valuesById[2] = "UNCHANGED"] = 2; + values[valuesById[3] = "ADDED"] = 3; + values[valuesById[4] = "REMOVED"] = 4; + return values; + })(); + + return ListFindingsResult; + })(); + + return ListFindingsResponse; + })(); + + v1.SetFindingStateRequest = (function() { + + /** + * Properties of a SetFindingStateRequest. + * @memberof google.cloud.securitycenter.v1 + * @interface ISetFindingStateRequest + * @property {string|null} [name] SetFindingStateRequest name + * @property {google.cloud.securitycenter.v1.Finding.State|null} [state] SetFindingStateRequest state + * @property {google.protobuf.ITimestamp|null} [startTime] SetFindingStateRequest startTime + */ + + /** + * Constructs a new SetFindingStateRequest. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a SetFindingStateRequest. + * @implements ISetFindingStateRequest + * @constructor + * @param {google.cloud.securitycenter.v1.ISetFindingStateRequest=} [properties] Properties to set + */ + function SetFindingStateRequest(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]]; + } + + /** + * SetFindingStateRequest name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1.SetFindingStateRequest + * @instance + */ + SetFindingStateRequest.prototype.name = ""; + + /** + * SetFindingStateRequest state. + * @member {google.cloud.securitycenter.v1.Finding.State} state + * @memberof google.cloud.securitycenter.v1.SetFindingStateRequest + * @instance + */ + SetFindingStateRequest.prototype.state = 0; + + /** + * SetFindingStateRequest startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.cloud.securitycenter.v1.SetFindingStateRequest + * @instance + */ + SetFindingStateRequest.prototype.startTime = null; + + /** + * Creates a new SetFindingStateRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.SetFindingStateRequest + * @static + * @param {google.cloud.securitycenter.v1.ISetFindingStateRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.SetFindingStateRequest} SetFindingStateRequest instance + */ + SetFindingStateRequest.create = function create(properties) { + return new SetFindingStateRequest(properties); + }; + + /** + * Encodes the specified SetFindingStateRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.SetFindingStateRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.SetFindingStateRequest + * @static + * @param {google.cloud.securitycenter.v1.ISetFindingStateRequest} message SetFindingStateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetFindingStateRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.state != null && message.hasOwnProperty("state")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.state); + if (message.startTime != null && message.hasOwnProperty("startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SetFindingStateRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.SetFindingStateRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.SetFindingStateRequest + * @static + * @param {google.cloud.securitycenter.v1.ISetFindingStateRequest} message SetFindingStateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetFindingStateRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SetFindingStateRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.SetFindingStateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.SetFindingStateRequest} SetFindingStateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetFindingStateRequest.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.cloud.securitycenter.v1.SetFindingStateRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.state = reader.int32(); + break; + case 3: + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SetFindingStateRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.SetFindingStateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.SetFindingStateRequest} SetFindingStateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetFindingStateRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SetFindingStateRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1.SetFindingStateRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SetFindingStateRequest.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.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.startTime != null && message.hasOwnProperty("startTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.startTime); + if (error) + return "startTime." + error; + } + return null; + }; + + /** + * Creates a SetFindingStateRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.SetFindingStateRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.SetFindingStateRequest} SetFindingStateRequest + */ + SetFindingStateRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.SetFindingStateRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1.SetFindingStateRequest(); + if (object.name != null) + message.name = String(object.name); + switch (object.state) { + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "ACTIVE": + case 1: + message.state = 1; + break; + case "INACTIVE": + case 2: + message.state = 2; + break; + } + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.cloud.securitycenter.v1.SetFindingStateRequest.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); + } + return message; + }; + + /** + * Creates a plain object from a SetFindingStateRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.SetFindingStateRequest + * @static + * @param {google.cloud.securitycenter.v1.SetFindingStateRequest} message SetFindingStateRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SetFindingStateRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.startTime = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.securitycenter.v1.Finding.State[message.state] : message.state; + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); + return object; + }; + + /** + * Converts this SetFindingStateRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.SetFindingStateRequest + * @instance + * @returns {Object.} JSON object + */ + SetFindingStateRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SetFindingStateRequest; + })(); + + v1.RunAssetDiscoveryRequest = (function() { + + /** + * Properties of a RunAssetDiscoveryRequest. + * @memberof google.cloud.securitycenter.v1 + * @interface IRunAssetDiscoveryRequest + * @property {string|null} [parent] RunAssetDiscoveryRequest parent + */ + + /** + * Constructs a new RunAssetDiscoveryRequest. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a RunAssetDiscoveryRequest. + * @implements IRunAssetDiscoveryRequest + * @constructor + * @param {google.cloud.securitycenter.v1.IRunAssetDiscoveryRequest=} [properties] Properties to set + */ + function RunAssetDiscoveryRequest(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]]; + } + + /** + * RunAssetDiscoveryRequest parent. + * @member {string} parent + * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryRequest + * @instance + */ + RunAssetDiscoveryRequest.prototype.parent = ""; + + /** + * Creates a new RunAssetDiscoveryRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryRequest + * @static + * @param {google.cloud.securitycenter.v1.IRunAssetDiscoveryRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.RunAssetDiscoveryRequest} RunAssetDiscoveryRequest instance + */ + RunAssetDiscoveryRequest.create = function create(properties) { + return new RunAssetDiscoveryRequest(properties); + }; + + /** + * Encodes the specified RunAssetDiscoveryRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.RunAssetDiscoveryRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryRequest + * @static + * @param {google.cloud.securitycenter.v1.IRunAssetDiscoveryRequest} message RunAssetDiscoveryRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RunAssetDiscoveryRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && message.hasOwnProperty("parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + return writer; + }; + + /** + * Encodes the specified RunAssetDiscoveryRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.RunAssetDiscoveryRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryRequest + * @static + * @param {google.cloud.securitycenter.v1.IRunAssetDiscoveryRequest} message RunAssetDiscoveryRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RunAssetDiscoveryRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RunAssetDiscoveryRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.RunAssetDiscoveryRequest} RunAssetDiscoveryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RunAssetDiscoveryRequest.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.cloud.securitycenter.v1.RunAssetDiscoveryRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RunAssetDiscoveryRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.RunAssetDiscoveryRequest} RunAssetDiscoveryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RunAssetDiscoveryRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RunAssetDiscoveryRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RunAssetDiscoveryRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + return null; + }; + + /** + * Creates a RunAssetDiscoveryRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.RunAssetDiscoveryRequest} RunAssetDiscoveryRequest + */ + RunAssetDiscoveryRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.RunAssetDiscoveryRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1.RunAssetDiscoveryRequest(); + if (object.parent != null) + message.parent = String(object.parent); + return message; + }; + + /** + * Creates a plain object from a RunAssetDiscoveryRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryRequest + * @static + * @param {google.cloud.securitycenter.v1.RunAssetDiscoveryRequest} message RunAssetDiscoveryRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RunAssetDiscoveryRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.parent = ""; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + return object; + }; + + /** + * Converts this RunAssetDiscoveryRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryRequest + * @instance + * @returns {Object.} JSON object + */ + RunAssetDiscoveryRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return RunAssetDiscoveryRequest; + })(); + + v1.UpdateFindingRequest = (function() { + + /** + * Properties of an UpdateFindingRequest. + * @memberof google.cloud.securitycenter.v1 + * @interface IUpdateFindingRequest + * @property {google.cloud.securitycenter.v1.IFinding|null} [finding] UpdateFindingRequest finding + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateFindingRequest updateMask + */ + + /** + * Constructs a new UpdateFindingRequest. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents an UpdateFindingRequest. + * @implements IUpdateFindingRequest + * @constructor + * @param {google.cloud.securitycenter.v1.IUpdateFindingRequest=} [properties] Properties to set + */ + function UpdateFindingRequest(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]]; + } + + /** + * UpdateFindingRequest finding. + * @member {google.cloud.securitycenter.v1.IFinding|null|undefined} finding + * @memberof google.cloud.securitycenter.v1.UpdateFindingRequest + * @instance + */ + UpdateFindingRequest.prototype.finding = null; + + /** + * UpdateFindingRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.securitycenter.v1.UpdateFindingRequest + * @instance + */ + UpdateFindingRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateFindingRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.UpdateFindingRequest + * @static + * @param {google.cloud.securitycenter.v1.IUpdateFindingRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.UpdateFindingRequest} UpdateFindingRequest instance + */ + UpdateFindingRequest.create = function create(properties) { + return new UpdateFindingRequest(properties); + }; + + /** + * Encodes the specified UpdateFindingRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.UpdateFindingRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.UpdateFindingRequest + * @static + * @param {google.cloud.securitycenter.v1.IUpdateFindingRequest} message UpdateFindingRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateFindingRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.finding != null && message.hasOwnProperty("finding")) + $root.google.cloud.securitycenter.v1.Finding.encode(message.finding, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateFindingRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.UpdateFindingRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.UpdateFindingRequest + * @static + * @param {google.cloud.securitycenter.v1.IUpdateFindingRequest} message UpdateFindingRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateFindingRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateFindingRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.UpdateFindingRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.UpdateFindingRequest} UpdateFindingRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateFindingRequest.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.cloud.securitycenter.v1.UpdateFindingRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.finding = $root.google.cloud.securitycenter.v1.Finding.decode(reader, reader.uint32()); + break; + case 2: + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateFindingRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.UpdateFindingRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.UpdateFindingRequest} UpdateFindingRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateFindingRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateFindingRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1.UpdateFindingRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateFindingRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.finding != null && message.hasOwnProperty("finding")) { + var error = $root.google.cloud.securitycenter.v1.Finding.verify(message.finding); + if (error) + return "finding." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + return null; + }; + + /** + * Creates an UpdateFindingRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.UpdateFindingRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.UpdateFindingRequest} UpdateFindingRequest + */ + UpdateFindingRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.UpdateFindingRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1.UpdateFindingRequest(); + if (object.finding != null) { + if (typeof object.finding !== "object") + throw TypeError(".google.cloud.securitycenter.v1.UpdateFindingRequest.finding: object expected"); + message.finding = $root.google.cloud.securitycenter.v1.Finding.fromObject(object.finding); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.securitycenter.v1.UpdateFindingRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateFindingRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.UpdateFindingRequest + * @static + * @param {google.cloud.securitycenter.v1.UpdateFindingRequest} message UpdateFindingRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateFindingRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.finding = null; + object.updateMask = null; + } + if (message.finding != null && message.hasOwnProperty("finding")) + object.finding = $root.google.cloud.securitycenter.v1.Finding.toObject(message.finding, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateFindingRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.UpdateFindingRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateFindingRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return UpdateFindingRequest; + })(); + + v1.UpdateOrganizationSettingsRequest = (function() { + + /** + * Properties of an UpdateOrganizationSettingsRequest. + * @memberof google.cloud.securitycenter.v1 + * @interface IUpdateOrganizationSettingsRequest + * @property {google.cloud.securitycenter.v1.IOrganizationSettings|null} [organizationSettings] UpdateOrganizationSettingsRequest organizationSettings + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateOrganizationSettingsRequest updateMask + */ + + /** + * Constructs a new UpdateOrganizationSettingsRequest. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents an UpdateOrganizationSettingsRequest. + * @implements IUpdateOrganizationSettingsRequest + * @constructor + * @param {google.cloud.securitycenter.v1.IUpdateOrganizationSettingsRequest=} [properties] Properties to set + */ + function UpdateOrganizationSettingsRequest(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]]; + } + + /** + * UpdateOrganizationSettingsRequest organizationSettings. + * @member {google.cloud.securitycenter.v1.IOrganizationSettings|null|undefined} organizationSettings + * @memberof google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest + * @instance + */ + UpdateOrganizationSettingsRequest.prototype.organizationSettings = null; + + /** + * UpdateOrganizationSettingsRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest + * @instance + */ + UpdateOrganizationSettingsRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateOrganizationSettingsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest + * @static + * @param {google.cloud.securitycenter.v1.IUpdateOrganizationSettingsRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest} UpdateOrganizationSettingsRequest instance + */ + UpdateOrganizationSettingsRequest.create = function create(properties) { + return new UpdateOrganizationSettingsRequest(properties); + }; + + /** + * Encodes the specified UpdateOrganizationSettingsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest + * @static + * @param {google.cloud.securitycenter.v1.IUpdateOrganizationSettingsRequest} message UpdateOrganizationSettingsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateOrganizationSettingsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.organizationSettings != null && message.hasOwnProperty("organizationSettings")) + $root.google.cloud.securitycenter.v1.OrganizationSettings.encode(message.organizationSettings, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateOrganizationSettingsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest + * @static + * @param {google.cloud.securitycenter.v1.IUpdateOrganizationSettingsRequest} message UpdateOrganizationSettingsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateOrganizationSettingsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateOrganizationSettingsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest} UpdateOrganizationSettingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateOrganizationSettingsRequest.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.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.organizationSettings = $root.google.cloud.securitycenter.v1.OrganizationSettings.decode(reader, reader.uint32()); + break; + case 2: + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateOrganizationSettingsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest} UpdateOrganizationSettingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateOrganizationSettingsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateOrganizationSettingsRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateOrganizationSettingsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.organizationSettings != null && message.hasOwnProperty("organizationSettings")) { + var error = $root.google.cloud.securitycenter.v1.OrganizationSettings.verify(message.organizationSettings); + if (error) + return "organizationSettings." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + return null; + }; + + /** + * Creates an UpdateOrganizationSettingsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest} UpdateOrganizationSettingsRequest + */ + UpdateOrganizationSettingsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest(); + if (object.organizationSettings != null) { + if (typeof object.organizationSettings !== "object") + throw TypeError(".google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest.organizationSettings: object expected"); + message.organizationSettings = $root.google.cloud.securitycenter.v1.OrganizationSettings.fromObject(object.organizationSettings); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateOrganizationSettingsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest + * @static + * @param {google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest} message UpdateOrganizationSettingsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateOrganizationSettingsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.organizationSettings = null; + object.updateMask = null; + } + if (message.organizationSettings != null && message.hasOwnProperty("organizationSettings")) + object.organizationSettings = $root.google.cloud.securitycenter.v1.OrganizationSettings.toObject(message.organizationSettings, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateOrganizationSettingsRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateOrganizationSettingsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return UpdateOrganizationSettingsRequest; + })(); + + v1.UpdateSourceRequest = (function() { + + /** + * Properties of an UpdateSourceRequest. + * @memberof google.cloud.securitycenter.v1 + * @interface IUpdateSourceRequest + * @property {google.cloud.securitycenter.v1.ISource|null} [source] UpdateSourceRequest source + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateSourceRequest updateMask + */ + + /** + * Constructs a new UpdateSourceRequest. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents an UpdateSourceRequest. + * @implements IUpdateSourceRequest + * @constructor + * @param {google.cloud.securitycenter.v1.IUpdateSourceRequest=} [properties] Properties to set + */ + function UpdateSourceRequest(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]]; + } + + /** + * UpdateSourceRequest source. + * @member {google.cloud.securitycenter.v1.ISource|null|undefined} source + * @memberof google.cloud.securitycenter.v1.UpdateSourceRequest + * @instance + */ + UpdateSourceRequest.prototype.source = null; + + /** + * UpdateSourceRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.securitycenter.v1.UpdateSourceRequest + * @instance + */ + UpdateSourceRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateSourceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.UpdateSourceRequest + * @static + * @param {google.cloud.securitycenter.v1.IUpdateSourceRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.UpdateSourceRequest} UpdateSourceRequest instance + */ + UpdateSourceRequest.create = function create(properties) { + return new UpdateSourceRequest(properties); + }; + + /** + * Encodes the specified UpdateSourceRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.UpdateSourceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.UpdateSourceRequest + * @static + * @param {google.cloud.securitycenter.v1.IUpdateSourceRequest} message UpdateSourceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateSourceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.source != null && message.hasOwnProperty("source")) + $root.google.cloud.securitycenter.v1.Source.encode(message.source, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateSourceRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.UpdateSourceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.UpdateSourceRequest + * @static + * @param {google.cloud.securitycenter.v1.IUpdateSourceRequest} message UpdateSourceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateSourceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateSourceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.UpdateSourceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.UpdateSourceRequest} UpdateSourceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateSourceRequest.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.cloud.securitycenter.v1.UpdateSourceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.source = $root.google.cloud.securitycenter.v1.Source.decode(reader, reader.uint32()); + break; + case 2: + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateSourceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.UpdateSourceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.UpdateSourceRequest} UpdateSourceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateSourceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateSourceRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1.UpdateSourceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateSourceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.source != null && message.hasOwnProperty("source")) { + var error = $root.google.cloud.securitycenter.v1.Source.verify(message.source); + if (error) + return "source." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + return null; + }; + + /** + * Creates an UpdateSourceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.UpdateSourceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.UpdateSourceRequest} UpdateSourceRequest + */ + UpdateSourceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.UpdateSourceRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1.UpdateSourceRequest(); + if (object.source != null) { + if (typeof object.source !== "object") + throw TypeError(".google.cloud.securitycenter.v1.UpdateSourceRequest.source: object expected"); + message.source = $root.google.cloud.securitycenter.v1.Source.fromObject(object.source); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.securitycenter.v1.UpdateSourceRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateSourceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.UpdateSourceRequest + * @static + * @param {google.cloud.securitycenter.v1.UpdateSourceRequest} message UpdateSourceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateSourceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.source = null; + object.updateMask = null; + } + if (message.source != null && message.hasOwnProperty("source")) + object.source = $root.google.cloud.securitycenter.v1.Source.toObject(message.source, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateSourceRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.UpdateSourceRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateSourceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return UpdateSourceRequest; + })(); + + v1.UpdateSecurityMarksRequest = (function() { + + /** + * Properties of an UpdateSecurityMarksRequest. + * @memberof google.cloud.securitycenter.v1 + * @interface IUpdateSecurityMarksRequest + * @property {google.cloud.securitycenter.v1.ISecurityMarks|null} [securityMarks] UpdateSecurityMarksRequest securityMarks + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateSecurityMarksRequest updateMask + * @property {google.protobuf.ITimestamp|null} [startTime] UpdateSecurityMarksRequest startTime + */ + + /** + * Constructs a new UpdateSecurityMarksRequest. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents an UpdateSecurityMarksRequest. + * @implements IUpdateSecurityMarksRequest + * @constructor + * @param {google.cloud.securitycenter.v1.IUpdateSecurityMarksRequest=} [properties] Properties to set + */ + function UpdateSecurityMarksRequest(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]]; + } + + /** + * UpdateSecurityMarksRequest securityMarks. + * @member {google.cloud.securitycenter.v1.ISecurityMarks|null|undefined} securityMarks + * @memberof google.cloud.securitycenter.v1.UpdateSecurityMarksRequest + * @instance + */ + UpdateSecurityMarksRequest.prototype.securityMarks = null; + + /** + * UpdateSecurityMarksRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.securitycenter.v1.UpdateSecurityMarksRequest + * @instance + */ + UpdateSecurityMarksRequest.prototype.updateMask = null; + + /** + * UpdateSecurityMarksRequest startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.cloud.securitycenter.v1.UpdateSecurityMarksRequest + * @instance + */ + UpdateSecurityMarksRequest.prototype.startTime = null; + + /** + * Creates a new UpdateSecurityMarksRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.UpdateSecurityMarksRequest + * @static + * @param {google.cloud.securitycenter.v1.IUpdateSecurityMarksRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.UpdateSecurityMarksRequest} UpdateSecurityMarksRequest instance + */ + UpdateSecurityMarksRequest.create = function create(properties) { + return new UpdateSecurityMarksRequest(properties); + }; + + /** + * Encodes the specified UpdateSecurityMarksRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.UpdateSecurityMarksRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.UpdateSecurityMarksRequest + * @static + * @param {google.cloud.securitycenter.v1.IUpdateSecurityMarksRequest} message UpdateSecurityMarksRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateSecurityMarksRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.securityMarks != null && message.hasOwnProperty("securityMarks")) + $root.google.cloud.securitycenter.v1.SecurityMarks.encode(message.securityMarks, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.startTime != null && message.hasOwnProperty("startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateSecurityMarksRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.UpdateSecurityMarksRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.UpdateSecurityMarksRequest + * @static + * @param {google.cloud.securitycenter.v1.IUpdateSecurityMarksRequest} message UpdateSecurityMarksRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateSecurityMarksRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateSecurityMarksRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.UpdateSecurityMarksRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.UpdateSecurityMarksRequest} UpdateSecurityMarksRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateSecurityMarksRequest.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.cloud.securitycenter.v1.UpdateSecurityMarksRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.securityMarks = $root.google.cloud.securitycenter.v1.SecurityMarks.decode(reader, reader.uint32()); + break; + case 2: + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + case 3: + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateSecurityMarksRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.UpdateSecurityMarksRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.UpdateSecurityMarksRequest} UpdateSecurityMarksRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateSecurityMarksRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateSecurityMarksRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1.UpdateSecurityMarksRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateSecurityMarksRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.securityMarks != null && message.hasOwnProperty("securityMarks")) { + var error = $root.google.cloud.securitycenter.v1.SecurityMarks.verify(message.securityMarks); + if (error) + return "securityMarks." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + if (message.startTime != null && message.hasOwnProperty("startTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.startTime); + if (error) + return "startTime." + error; + } + return null; + }; + + /** + * Creates an UpdateSecurityMarksRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.UpdateSecurityMarksRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.UpdateSecurityMarksRequest} UpdateSecurityMarksRequest + */ + UpdateSecurityMarksRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.UpdateSecurityMarksRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1.UpdateSecurityMarksRequest(); + if (object.securityMarks != null) { + if (typeof object.securityMarks !== "object") + throw TypeError(".google.cloud.securitycenter.v1.UpdateSecurityMarksRequest.securityMarks: object expected"); + message.securityMarks = $root.google.cloud.securitycenter.v1.SecurityMarks.fromObject(object.securityMarks); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.securitycenter.v1.UpdateSecurityMarksRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.cloud.securitycenter.v1.UpdateSecurityMarksRequest.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); + } + return message; + }; + + /** + * Creates a plain object from an UpdateSecurityMarksRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.UpdateSecurityMarksRequest + * @static + * @param {google.cloud.securitycenter.v1.UpdateSecurityMarksRequest} message UpdateSecurityMarksRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateSecurityMarksRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.securityMarks = null; + object.updateMask = null; + object.startTime = null; + } + if (message.securityMarks != null && message.hasOwnProperty("securityMarks")) + object.securityMarks = $root.google.cloud.securitycenter.v1.SecurityMarks.toObject(message.securityMarks, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); + return object; + }; + + /** + * Converts this UpdateSecurityMarksRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.UpdateSecurityMarksRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateSecurityMarksRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return UpdateSecurityMarksRequest; + })(); + + v1.Source = (function() { + + /** + * Properties of a Source. + * @memberof google.cloud.securitycenter.v1 + * @interface ISource + * @property {string|null} [name] Source name + * @property {string|null} [displayName] Source displayName + * @property {string|null} [description] Source description + */ + + /** + * Constructs a new Source. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a Source. + * @implements ISource + * @constructor + * @param {google.cloud.securitycenter.v1.ISource=} [properties] Properties to set + */ + function Source(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]]; + } + + /** + * Source name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1.Source + * @instance + */ + Source.prototype.name = ""; + + /** + * Source displayName. + * @member {string} displayName + * @memberof google.cloud.securitycenter.v1.Source + * @instance + */ + Source.prototype.displayName = ""; + + /** + * Source description. + * @member {string} description + * @memberof google.cloud.securitycenter.v1.Source + * @instance + */ + Source.prototype.description = ""; + + /** + * Creates a new Source instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.Source + * @static + * @param {google.cloud.securitycenter.v1.ISource=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.Source} Source instance + */ + Source.create = function create(properties) { + return new Source(properties); + }; + + /** + * Encodes the specified Source message. Does not implicitly {@link google.cloud.securitycenter.v1.Source.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.Source + * @static + * @param {google.cloud.securitycenter.v1.ISource} message Source message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Source.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.displayName != null && message.hasOwnProperty("displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + if (message.description != null && message.hasOwnProperty("description")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + return writer; + }; + + /** + * Encodes the specified Source message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Source.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.Source + * @static + * @param {google.cloud.securitycenter.v1.ISource} message Source message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Source.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Source message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.Source + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.Source} Source + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Source.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.cloud.securitycenter.v1.Source(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.displayName = reader.string(); + break; + case 3: + message.description = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Source message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.Source + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.Source} Source + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Source.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Source message. + * @function verify + * @memberof google.cloud.securitycenter.v1.Source + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Source.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.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + return null; + }; + + /** + * Creates a Source message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.Source + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.Source} Source + */ + Source.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.Source) + return object; + var message = new $root.google.cloud.securitycenter.v1.Source(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.description != null) + message.description = String(object.description); + return message; + }; + + /** + * Creates a plain object from a Source message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.Source + * @static + * @param {google.cloud.securitycenter.v1.Source} message Source + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Source.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.description = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + return object; + }; + + /** + * Converts this Source to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.Source + * @instance + * @returns {Object.} JSON object + */ + Source.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Source; + })(); + + return v1; + })(); + + securitycenter.v1beta1 = (function() { + + /** + * Namespace v1beta1. + * @memberof google.cloud.securitycenter + * @namespace + */ + var v1beta1 = {}; + + v1beta1.Asset = (function() { + + /** + * Properties of an Asset. + * @memberof google.cloud.securitycenter.v1beta1 + * @interface IAsset + * @property {string|null} [name] Asset name + * @property {google.cloud.securitycenter.v1beta1.Asset.ISecurityCenterProperties|null} [securityCenterProperties] Asset securityCenterProperties + * @property {Object.|null} [resourceProperties] Asset resourceProperties + * @property {google.cloud.securitycenter.v1beta1.ISecurityMarks|null} [securityMarks] Asset securityMarks + * @property {google.protobuf.ITimestamp|null} [createTime] Asset createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Asset updateTime + */ + + /** + * Constructs a new Asset. + * @memberof google.cloud.securitycenter.v1beta1 + * @classdesc Represents an Asset. + * @implements IAsset + * @constructor + * @param {google.cloud.securitycenter.v1beta1.IAsset=} [properties] Properties to set + */ + function Asset(properties) { + this.resourceProperties = {}; + 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]]; + } + + /** + * Asset name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1beta1.Asset + * @instance + */ + Asset.prototype.name = ""; + + /** + * Asset securityCenterProperties. + * @member {google.cloud.securitycenter.v1beta1.Asset.ISecurityCenterProperties|null|undefined} securityCenterProperties + * @memberof google.cloud.securitycenter.v1beta1.Asset + * @instance + */ + Asset.prototype.securityCenterProperties = null; + + /** + * Asset resourceProperties. + * @member {Object.} resourceProperties + * @memberof google.cloud.securitycenter.v1beta1.Asset + * @instance + */ + Asset.prototype.resourceProperties = $util.emptyObject; + + /** + * Asset securityMarks. + * @member {google.cloud.securitycenter.v1beta1.ISecurityMarks|null|undefined} securityMarks + * @memberof google.cloud.securitycenter.v1beta1.Asset + * @instance + */ + Asset.prototype.securityMarks = null; + + /** + * Asset createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.securitycenter.v1beta1.Asset + * @instance + */ + Asset.prototype.createTime = null; + + /** + * Asset updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.securitycenter.v1beta1.Asset + * @instance + */ + Asset.prototype.updateTime = null; + + /** + * Creates a new Asset instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1beta1.Asset + * @static + * @param {google.cloud.securitycenter.v1beta1.IAsset=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1beta1.Asset} Asset instance + */ + Asset.create = function create(properties) { + return new Asset(properties); + }; + + /** + * Encodes the specified Asset message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.Asset.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1beta1.Asset + * @static + * @param {google.cloud.securitycenter.v1beta1.IAsset} message Asset message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Asset.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.securityCenterProperties != null && message.hasOwnProperty("securityCenterProperties")) + $root.google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties.encode(message.securityCenterProperties, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.resourceProperties != null && message.hasOwnProperty("resourceProperties")) + for (var keys = Object.keys(message.resourceProperties), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 7, wireType 2 =*/58).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.protobuf.Value.encode(message.resourceProperties[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.securityMarks != null && message.hasOwnProperty("securityMarks")) + $root.google.cloud.securitycenter.v1beta1.SecurityMarks.encode(message.securityMarks, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.createTime != null && message.hasOwnProperty("createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Asset message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.Asset.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1beta1.Asset + * @static + * @param {google.cloud.securitycenter.v1beta1.IAsset} message Asset message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Asset.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Asset message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1beta1.Asset + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1beta1.Asset} Asset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Asset.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.cloud.securitycenter.v1beta1.Asset(), key; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.securityCenterProperties = $root.google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties.decode(reader, reader.uint32()); + break; + case 7: + reader.skip().pos++; + if (message.resourceProperties === $util.emptyObject) + message.resourceProperties = {}; + key = reader.string(); + reader.pos++; + message.resourceProperties[key] = $root.google.protobuf.Value.decode(reader, reader.uint32()); + break; + case 8: + message.securityMarks = $root.google.cloud.securitycenter.v1beta1.SecurityMarks.decode(reader, reader.uint32()); + break; + case 9: + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 10: + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Asset message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1beta1.Asset + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1beta1.Asset} Asset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Asset.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Asset message. + * @function verify + * @memberof google.cloud.securitycenter.v1beta1.Asset + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Asset.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.securityCenterProperties != null && message.hasOwnProperty("securityCenterProperties")) { + var error = $root.google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties.verify(message.securityCenterProperties); + if (error) + return "securityCenterProperties." + error; + } + if (message.resourceProperties != null && message.hasOwnProperty("resourceProperties")) { + if (!$util.isObject(message.resourceProperties)) + return "resourceProperties: object expected"; + var key = Object.keys(message.resourceProperties); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.protobuf.Value.verify(message.resourceProperties[key[i]]); + if (error) + return "resourceProperties." + error; + } + } + if (message.securityMarks != null && message.hasOwnProperty("securityMarks")) { + var error = $root.google.cloud.securitycenter.v1beta1.SecurityMarks.verify(message.securityMarks); + if (error) + return "securityMarks." + error; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + return null; + }; + + /** + * Creates an Asset message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1beta1.Asset + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1beta1.Asset} Asset + */ + Asset.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1beta1.Asset) + return object; + var message = new $root.google.cloud.securitycenter.v1beta1.Asset(); + if (object.name != null) + message.name = String(object.name); + if (object.securityCenterProperties != null) { + if (typeof object.securityCenterProperties !== "object") + throw TypeError(".google.cloud.securitycenter.v1beta1.Asset.securityCenterProperties: object expected"); + message.securityCenterProperties = $root.google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties.fromObject(object.securityCenterProperties); + } + if (object.resourceProperties) { + if (typeof object.resourceProperties !== "object") + throw TypeError(".google.cloud.securitycenter.v1beta1.Asset.resourceProperties: object expected"); + message.resourceProperties = {}; + for (var keys = Object.keys(object.resourceProperties), i = 0; i < keys.length; ++i) { + if (typeof object.resourceProperties[keys[i]] !== "object") + throw TypeError(".google.cloud.securitycenter.v1beta1.Asset.resourceProperties: object expected"); + message.resourceProperties[keys[i]] = $root.google.protobuf.Value.fromObject(object.resourceProperties[keys[i]]); + } + } + if (object.securityMarks != null) { + if (typeof object.securityMarks !== "object") + throw TypeError(".google.cloud.securitycenter.v1beta1.Asset.securityMarks: object expected"); + message.securityMarks = $root.google.cloud.securitycenter.v1beta1.SecurityMarks.fromObject(object.securityMarks); + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.securitycenter.v1beta1.Asset.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.securitycenter.v1beta1.Asset.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + return message; + }; + + /** + * Creates a plain object from an Asset message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1beta1.Asset + * @static + * @param {google.cloud.securitycenter.v1beta1.Asset} message Asset + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Asset.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.resourceProperties = {}; + if (options.defaults) { + object.name = ""; + object.securityCenterProperties = null; + object.securityMarks = null; + object.createTime = null; + object.updateTime = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.securityCenterProperties != null && message.hasOwnProperty("securityCenterProperties")) + object.securityCenterProperties = $root.google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties.toObject(message.securityCenterProperties, options); + var keys2; + if (message.resourceProperties && (keys2 = Object.keys(message.resourceProperties)).length) { + object.resourceProperties = {}; + for (var j = 0; j < keys2.length; ++j) + object.resourceProperties[keys2[j]] = $root.google.protobuf.Value.toObject(message.resourceProperties[keys2[j]], options); + } + if (message.securityMarks != null && message.hasOwnProperty("securityMarks")) + object.securityMarks = $root.google.cloud.securitycenter.v1beta1.SecurityMarks.toObject(message.securityMarks, options); + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + return object; + }; + + /** + * Converts this Asset to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1beta1.Asset + * @instance + * @returns {Object.} JSON object + */ + Asset.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + Asset.SecurityCenterProperties = (function() { + + /** + * Properties of a SecurityCenterProperties. + * @memberof google.cloud.securitycenter.v1beta1.Asset + * @interface ISecurityCenterProperties + * @property {string|null} [resourceName] SecurityCenterProperties resourceName + * @property {string|null} [resourceType] SecurityCenterProperties resourceType + * @property {string|null} [resourceParent] SecurityCenterProperties resourceParent + * @property {string|null} [resourceProject] SecurityCenterProperties resourceProject + * @property {Array.|null} [resourceOwners] SecurityCenterProperties resourceOwners + */ + + /** + * Constructs a new SecurityCenterProperties. + * @memberof google.cloud.securitycenter.v1beta1.Asset + * @classdesc Represents a SecurityCenterProperties. + * @implements ISecurityCenterProperties + * @constructor + * @param {google.cloud.securitycenter.v1beta1.Asset.ISecurityCenterProperties=} [properties] Properties to set + */ + function SecurityCenterProperties(properties) { + this.resourceOwners = []; + 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]]; + } + + /** + * SecurityCenterProperties resourceName. + * @member {string} resourceName + * @memberof google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties + * @instance + */ + SecurityCenterProperties.prototype.resourceName = ""; + + /** + * SecurityCenterProperties resourceType. + * @member {string} resourceType + * @memberof google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties + * @instance + */ + SecurityCenterProperties.prototype.resourceType = ""; + + /** + * SecurityCenterProperties resourceParent. + * @member {string} resourceParent + * @memberof google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties + * @instance + */ + SecurityCenterProperties.prototype.resourceParent = ""; + + /** + * SecurityCenterProperties resourceProject. + * @member {string} resourceProject + * @memberof google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties + * @instance + */ + SecurityCenterProperties.prototype.resourceProject = ""; + + /** + * SecurityCenterProperties resourceOwners. + * @member {Array.} resourceOwners + * @memberof google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties + * @instance + */ + SecurityCenterProperties.prototype.resourceOwners = $util.emptyArray; + + /** + * Creates a new SecurityCenterProperties instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties + * @static + * @param {google.cloud.securitycenter.v1beta1.Asset.ISecurityCenterProperties=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties} SecurityCenterProperties instance + */ + SecurityCenterProperties.create = function create(properties) { + return new SecurityCenterProperties(properties); + }; + + /** + * Encodes the specified SecurityCenterProperties message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties + * @static + * @param {google.cloud.securitycenter.v1beta1.Asset.ISecurityCenterProperties} message SecurityCenterProperties message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SecurityCenterProperties.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.resourceName != null && message.hasOwnProperty("resourceName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.resourceName); + if (message.resourceType != null && message.hasOwnProperty("resourceType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.resourceType); + if (message.resourceParent != null && message.hasOwnProperty("resourceParent")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.resourceParent); + if (message.resourceProject != null && message.hasOwnProperty("resourceProject")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.resourceProject); + if (message.resourceOwners != null && message.resourceOwners.length) + for (var i = 0; i < message.resourceOwners.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.resourceOwners[i]); + return writer; + }; + + /** + * Encodes the specified SecurityCenterProperties message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties + * @static + * @param {google.cloud.securitycenter.v1beta1.Asset.ISecurityCenterProperties} message SecurityCenterProperties message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SecurityCenterProperties.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SecurityCenterProperties message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties} SecurityCenterProperties + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SecurityCenterProperties.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.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.resourceName = reader.string(); + break; + case 2: + message.resourceType = reader.string(); + break; + case 3: + message.resourceParent = reader.string(); + break; + case 4: + message.resourceProject = reader.string(); + break; + case 5: + if (!(message.resourceOwners && message.resourceOwners.length)) + message.resourceOwners = []; + message.resourceOwners.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SecurityCenterProperties message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties} SecurityCenterProperties + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SecurityCenterProperties.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SecurityCenterProperties message. + * @function verify + * @memberof google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SecurityCenterProperties.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.resourceName != null && message.hasOwnProperty("resourceName")) + if (!$util.isString(message.resourceName)) + return "resourceName: string expected"; + if (message.resourceType != null && message.hasOwnProperty("resourceType")) + if (!$util.isString(message.resourceType)) + return "resourceType: string expected"; + if (message.resourceParent != null && message.hasOwnProperty("resourceParent")) + if (!$util.isString(message.resourceParent)) + return "resourceParent: string expected"; + if (message.resourceProject != null && message.hasOwnProperty("resourceProject")) + if (!$util.isString(message.resourceProject)) + return "resourceProject: string expected"; + if (message.resourceOwners != null && message.hasOwnProperty("resourceOwners")) { + if (!Array.isArray(message.resourceOwners)) + return "resourceOwners: array expected"; + for (var i = 0; i < message.resourceOwners.length; ++i) + if (!$util.isString(message.resourceOwners[i])) + return "resourceOwners: string[] expected"; + } + return null; + }; + + /** + * Creates a SecurityCenterProperties message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties} SecurityCenterProperties + */ + SecurityCenterProperties.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties) + return object; + var message = new $root.google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties(); + if (object.resourceName != null) + message.resourceName = String(object.resourceName); + if (object.resourceType != null) + message.resourceType = String(object.resourceType); + if (object.resourceParent != null) + message.resourceParent = String(object.resourceParent); + if (object.resourceProject != null) + message.resourceProject = String(object.resourceProject); + if (object.resourceOwners) { + if (!Array.isArray(object.resourceOwners)) + throw TypeError(".google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties.resourceOwners: array expected"); + message.resourceOwners = []; + for (var i = 0; i < object.resourceOwners.length; ++i) + message.resourceOwners[i] = String(object.resourceOwners[i]); + } + return message; + }; + + /** + * Creates a plain object from a SecurityCenterProperties message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties + * @static + * @param {google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties} message SecurityCenterProperties + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SecurityCenterProperties.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.resourceOwners = []; + if (options.defaults) { + object.resourceName = ""; + object.resourceType = ""; + object.resourceParent = ""; + object.resourceProject = ""; + } + if (message.resourceName != null && message.hasOwnProperty("resourceName")) + object.resourceName = message.resourceName; + if (message.resourceType != null && message.hasOwnProperty("resourceType")) + object.resourceType = message.resourceType; + if (message.resourceParent != null && message.hasOwnProperty("resourceParent")) + object.resourceParent = message.resourceParent; + if (message.resourceProject != null && message.hasOwnProperty("resourceProject")) + object.resourceProject = message.resourceProject; + if (message.resourceOwners && message.resourceOwners.length) { + object.resourceOwners = []; + for (var j = 0; j < message.resourceOwners.length; ++j) + object.resourceOwners[j] = message.resourceOwners[j]; + } + return object; + }; + + /** + * Converts this SecurityCenterProperties to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties + * @instance + * @returns {Object.} JSON object + */ + SecurityCenterProperties.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SecurityCenterProperties; + })(); + + return Asset; + })(); + + v1beta1.SecurityMarks = (function() { + + /** + * Properties of a SecurityMarks. + * @memberof google.cloud.securitycenter.v1beta1 + * @interface ISecurityMarks + * @property {string|null} [name] SecurityMarks name + * @property {Object.|null} [marks] SecurityMarks marks + */ + + /** + * Constructs a new SecurityMarks. + * @memberof google.cloud.securitycenter.v1beta1 + * @classdesc Represents a SecurityMarks. + * @implements ISecurityMarks + * @constructor + * @param {google.cloud.securitycenter.v1beta1.ISecurityMarks=} [properties] Properties to set + */ + function SecurityMarks(properties) { + this.marks = {}; + 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]]; + } + + /** + * SecurityMarks name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1beta1.SecurityMarks + * @instance + */ + SecurityMarks.prototype.name = ""; + + /** + * SecurityMarks marks. + * @member {Object.} marks + * @memberof google.cloud.securitycenter.v1beta1.SecurityMarks + * @instance + */ + SecurityMarks.prototype.marks = $util.emptyObject; + + /** + * Creates a new SecurityMarks instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1beta1.SecurityMarks + * @static + * @param {google.cloud.securitycenter.v1beta1.ISecurityMarks=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1beta1.SecurityMarks} SecurityMarks instance + */ + SecurityMarks.create = function create(properties) { + return new SecurityMarks(properties); + }; + + /** + * Encodes the specified SecurityMarks message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.SecurityMarks.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1beta1.SecurityMarks + * @static + * @param {google.cloud.securitycenter.v1beta1.ISecurityMarks} message SecurityMarks message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SecurityMarks.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.marks != null && message.hasOwnProperty("marks")) + for (var keys = Object.keys(message.marks), i = 0; i < keys.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.marks[keys[i]]).ldelim(); + return writer; + }; + + /** + * Encodes the specified SecurityMarks message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.SecurityMarks.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1beta1.SecurityMarks + * @static + * @param {google.cloud.securitycenter.v1beta1.ISecurityMarks} message SecurityMarks message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SecurityMarks.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SecurityMarks message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1beta1.SecurityMarks + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1beta1.SecurityMarks} SecurityMarks + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SecurityMarks.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.cloud.securitycenter.v1beta1.SecurityMarks(), key; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + reader.skip().pos++; + if (message.marks === $util.emptyObject) + message.marks = {}; + key = reader.string(); + reader.pos++; + message.marks[key] = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SecurityMarks message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1beta1.SecurityMarks + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1beta1.SecurityMarks} SecurityMarks + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SecurityMarks.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SecurityMarks message. + * @function verify + * @memberof google.cloud.securitycenter.v1beta1.SecurityMarks + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SecurityMarks.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.marks != null && message.hasOwnProperty("marks")) { + if (!$util.isObject(message.marks)) + return "marks: object expected"; + var key = Object.keys(message.marks); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.marks[key[i]])) + return "marks: string{k:string} expected"; + } + return null; + }; + + /** + * Creates a SecurityMarks message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1beta1.SecurityMarks + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1beta1.SecurityMarks} SecurityMarks + */ + SecurityMarks.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1beta1.SecurityMarks) + return object; + var message = new $root.google.cloud.securitycenter.v1beta1.SecurityMarks(); + if (object.name != null) + message.name = String(object.name); + if (object.marks) { + if (typeof object.marks !== "object") + throw TypeError(".google.cloud.securitycenter.v1beta1.SecurityMarks.marks: object expected"); + message.marks = {}; + for (var keys = Object.keys(object.marks), i = 0; i < keys.length; ++i) + message.marks[keys[i]] = String(object.marks[keys[i]]); + } + return message; + }; + + /** + * Creates a plain object from a SecurityMarks message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1beta1.SecurityMarks + * @static + * @param {google.cloud.securitycenter.v1beta1.SecurityMarks} message SecurityMarks + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SecurityMarks.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.marks = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + var keys2; + if (message.marks && (keys2 = Object.keys(message.marks)).length) { + object.marks = {}; + for (var j = 0; j < keys2.length; ++j) + object.marks[keys2[j]] = message.marks[keys2[j]]; + } + return object; + }; + + /** + * Converts this SecurityMarks to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1beta1.SecurityMarks + * @instance + * @returns {Object.} JSON object + */ + SecurityMarks.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SecurityMarks; + })(); + + v1beta1.Finding = (function() { + + /** + * Properties of a Finding. + * @memberof google.cloud.securitycenter.v1beta1 + * @interface IFinding + * @property {string|null} [name] Finding name + * @property {string|null} [parent] Finding parent + * @property {string|null} [resourceName] Finding resourceName + * @property {google.cloud.securitycenter.v1beta1.Finding.State|null} [state] Finding state + * @property {string|null} [category] Finding category + * @property {string|null} [externalUri] Finding externalUri + * @property {Object.|null} [sourceProperties] Finding sourceProperties + * @property {google.cloud.securitycenter.v1beta1.ISecurityMarks|null} [securityMarks] Finding securityMarks + * @property {google.protobuf.ITimestamp|null} [eventTime] Finding eventTime + * @property {google.protobuf.ITimestamp|null} [createTime] Finding createTime + */ + + /** + * Constructs a new Finding. + * @memberof google.cloud.securitycenter.v1beta1 + * @classdesc Represents a Finding. + * @implements IFinding + * @constructor + * @param {google.cloud.securitycenter.v1beta1.IFinding=} [properties] Properties to set + */ + function Finding(properties) { + this.sourceProperties = {}; + 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]]; + } + + /** + * Finding name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1beta1.Finding + * @instance + */ + Finding.prototype.name = ""; + + /** + * Finding parent. + * @member {string} parent + * @memberof google.cloud.securitycenter.v1beta1.Finding + * @instance + */ + Finding.prototype.parent = ""; + + /** + * Finding resourceName. + * @member {string} resourceName + * @memberof google.cloud.securitycenter.v1beta1.Finding + * @instance + */ + Finding.prototype.resourceName = ""; + + /** + * Finding state. + * @member {google.cloud.securitycenter.v1beta1.Finding.State} state + * @memberof google.cloud.securitycenter.v1beta1.Finding + * @instance + */ + Finding.prototype.state = 0; + + /** + * Finding category. + * @member {string} category + * @memberof google.cloud.securitycenter.v1beta1.Finding + * @instance + */ + Finding.prototype.category = ""; + + /** + * Finding externalUri. + * @member {string} externalUri + * @memberof google.cloud.securitycenter.v1beta1.Finding + * @instance + */ + Finding.prototype.externalUri = ""; + + /** + * Finding sourceProperties. + * @member {Object.} sourceProperties + * @memberof google.cloud.securitycenter.v1beta1.Finding + * @instance + */ + Finding.prototype.sourceProperties = $util.emptyObject; + + /** + * Finding securityMarks. + * @member {google.cloud.securitycenter.v1beta1.ISecurityMarks|null|undefined} securityMarks + * @memberof google.cloud.securitycenter.v1beta1.Finding + * @instance + */ + Finding.prototype.securityMarks = null; + + /** + * Finding eventTime. + * @member {google.protobuf.ITimestamp|null|undefined} eventTime + * @memberof google.cloud.securitycenter.v1beta1.Finding + * @instance + */ + Finding.prototype.eventTime = null; + + /** + * Finding createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.securitycenter.v1beta1.Finding + * @instance + */ + Finding.prototype.createTime = null; + + /** + * Creates a new Finding instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1beta1.Finding + * @static + * @param {google.cloud.securitycenter.v1beta1.IFinding=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1beta1.Finding} Finding instance + */ + Finding.create = function create(properties) { + return new Finding(properties); + }; + + /** + * Encodes the specified Finding message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.Finding.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1beta1.Finding + * @static + * @param {google.cloud.securitycenter.v1beta1.IFinding} message Finding message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Finding.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.parent != null && message.hasOwnProperty("parent")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.parent); + if (message.resourceName != null && message.hasOwnProperty("resourceName")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.resourceName); + if (message.state != null && message.hasOwnProperty("state")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.state); + if (message.category != null && message.hasOwnProperty("category")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.category); + if (message.externalUri != null && message.hasOwnProperty("externalUri")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.externalUri); + if (message.sourceProperties != null && message.hasOwnProperty("sourceProperties")) + for (var keys = Object.keys(message.sourceProperties), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 7, wireType 2 =*/58).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.protobuf.Value.encode(message.sourceProperties[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.securityMarks != null && message.hasOwnProperty("securityMarks")) + $root.google.cloud.securitycenter.v1beta1.SecurityMarks.encode(message.securityMarks, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.eventTime != null && message.hasOwnProperty("eventTime")) + $root.google.protobuf.Timestamp.encode(message.eventTime, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.createTime != null && message.hasOwnProperty("createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Finding message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.Finding.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1beta1.Finding + * @static + * @param {google.cloud.securitycenter.v1beta1.IFinding} message Finding message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Finding.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Finding message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1beta1.Finding + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1beta1.Finding} Finding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Finding.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.cloud.securitycenter.v1beta1.Finding(), key; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.parent = reader.string(); + break; + case 3: + message.resourceName = reader.string(); + break; + case 4: + message.state = reader.int32(); + break; + case 5: + message.category = reader.string(); + break; + case 6: + message.externalUri = reader.string(); + break; + case 7: + reader.skip().pos++; + if (message.sourceProperties === $util.emptyObject) + message.sourceProperties = {}; + key = reader.string(); + reader.pos++; + message.sourceProperties[key] = $root.google.protobuf.Value.decode(reader, reader.uint32()); + break; + case 8: + message.securityMarks = $root.google.cloud.securitycenter.v1beta1.SecurityMarks.decode(reader, reader.uint32()); + break; + case 9: + message.eventTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 10: + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Finding message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1beta1.Finding + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1beta1.Finding} Finding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Finding.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Finding message. + * @function verify + * @memberof google.cloud.securitycenter.v1beta1.Finding + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Finding.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.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.resourceName != null && message.hasOwnProperty("resourceName")) + if (!$util.isString(message.resourceName)) + return "resourceName: string expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: 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"; + if (message.externalUri != null && message.hasOwnProperty("externalUri")) + if (!$util.isString(message.externalUri)) + return "externalUri: string expected"; + if (message.sourceProperties != null && message.hasOwnProperty("sourceProperties")) { + if (!$util.isObject(message.sourceProperties)) + return "sourceProperties: object expected"; + var key = Object.keys(message.sourceProperties); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.protobuf.Value.verify(message.sourceProperties[key[i]]); + if (error) + return "sourceProperties." + error; + } + } + if (message.securityMarks != null && message.hasOwnProperty("securityMarks")) { + var error = $root.google.cloud.securitycenter.v1beta1.SecurityMarks.verify(message.securityMarks); + if (error) + return "securityMarks." + error; + } + if (message.eventTime != null && message.hasOwnProperty("eventTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.eventTime); + if (error) + return "eventTime." + error; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + return null; + }; + + /** + * Creates a Finding message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1beta1.Finding + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1beta1.Finding} Finding + */ + Finding.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1beta1.Finding) + return object; + var message = new $root.google.cloud.securitycenter.v1beta1.Finding(); + if (object.name != null) + message.name = String(object.name); + if (object.parent != null) + message.parent = String(object.parent); + if (object.resourceName != null) + message.resourceName = String(object.resourceName); + switch (object.state) { + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "ACTIVE": + case 1: + message.state = 1; + break; + case "INACTIVE": + case 2: + message.state = 2; + break; + } + if (object.category != null) + message.category = String(object.category); + if (object.externalUri != null) + message.externalUri = String(object.externalUri); + if (object.sourceProperties) { + if (typeof object.sourceProperties !== "object") + throw TypeError(".google.cloud.securitycenter.v1beta1.Finding.sourceProperties: object expected"); + message.sourceProperties = {}; + for (var keys = Object.keys(object.sourceProperties), i = 0; i < keys.length; ++i) { + if (typeof object.sourceProperties[keys[i]] !== "object") + throw TypeError(".google.cloud.securitycenter.v1beta1.Finding.sourceProperties: object expected"); + message.sourceProperties[keys[i]] = $root.google.protobuf.Value.fromObject(object.sourceProperties[keys[i]]); + } + } + if (object.securityMarks != null) { + if (typeof object.securityMarks !== "object") + throw TypeError(".google.cloud.securitycenter.v1beta1.Finding.securityMarks: object expected"); + message.securityMarks = $root.google.cloud.securitycenter.v1beta1.SecurityMarks.fromObject(object.securityMarks); + } + if (object.eventTime != null) { + if (typeof object.eventTime !== "object") + throw TypeError(".google.cloud.securitycenter.v1beta1.Finding.eventTime: object expected"); + message.eventTime = $root.google.protobuf.Timestamp.fromObject(object.eventTime); + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.securitycenter.v1beta1.Finding.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + return message; + }; + + /** + * Creates a plain object from a Finding message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1beta1.Finding + * @static + * @param {google.cloud.securitycenter.v1beta1.Finding} message Finding + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Finding.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.sourceProperties = {}; + if (options.defaults) { + object.name = ""; + object.parent = ""; + object.resourceName = ""; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.category = ""; + object.externalUri = ""; + object.securityMarks = null; + object.eventTime = null; + object.createTime = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.resourceName != null && message.hasOwnProperty("resourceName")) + object.resourceName = message.resourceName; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.securitycenter.v1beta1.Finding.State[message.state] : message.state; + if (message.category != null && message.hasOwnProperty("category")) + object.category = message.category; + if (message.externalUri != null && message.hasOwnProperty("externalUri")) + object.externalUri = message.externalUri; + var keys2; + if (message.sourceProperties && (keys2 = Object.keys(message.sourceProperties)).length) { + object.sourceProperties = {}; + for (var j = 0; j < keys2.length; ++j) + object.sourceProperties[keys2[j]] = $root.google.protobuf.Value.toObject(message.sourceProperties[keys2[j]], options); + } + if (message.securityMarks != null && message.hasOwnProperty("securityMarks")) + object.securityMarks = $root.google.cloud.securitycenter.v1beta1.SecurityMarks.toObject(message.securityMarks, options); + if (message.eventTime != null && message.hasOwnProperty("eventTime")) + object.eventTime = $root.google.protobuf.Timestamp.toObject(message.eventTime, options); + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + return object; + }; + + /** + * Converts this Finding to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1beta1.Finding + * @instance + * @returns {Object.} JSON object + */ + Finding.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * State enum. + * @name google.cloud.securitycenter.v1beta1.Finding.State + * @enum {string} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} ACTIVE=1 ACTIVE value + * @property {number} INACTIVE=2 INACTIVE value + */ + Finding.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ACTIVE"] = 1; + values[valuesById[2] = "INACTIVE"] = 2; + return values; + })(); + + return Finding; + })(); + + v1beta1.OrganizationSettings = (function() { + + /** + * Properties of an OrganizationSettings. + * @memberof google.cloud.securitycenter.v1beta1 + * @interface IOrganizationSettings + * @property {string|null} [name] OrganizationSettings name + * @property {boolean|null} [enableAssetDiscovery] OrganizationSettings enableAssetDiscovery + * @property {google.cloud.securitycenter.v1beta1.OrganizationSettings.IAssetDiscoveryConfig|null} [assetDiscoveryConfig] OrganizationSettings assetDiscoveryConfig + */ + + /** + * Constructs a new OrganizationSettings. + * @memberof google.cloud.securitycenter.v1beta1 + * @classdesc Represents an OrganizationSettings. + * @implements IOrganizationSettings + * @constructor + * @param {google.cloud.securitycenter.v1beta1.IOrganizationSettings=} [properties] Properties to set + */ + function OrganizationSettings(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]]; + } + + /** + * OrganizationSettings name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1beta1.OrganizationSettings + * @instance + */ + OrganizationSettings.prototype.name = ""; + + /** + * OrganizationSettings enableAssetDiscovery. + * @member {boolean} enableAssetDiscovery + * @memberof google.cloud.securitycenter.v1beta1.OrganizationSettings + * @instance + */ + OrganizationSettings.prototype.enableAssetDiscovery = false; + + /** + * OrganizationSettings assetDiscoveryConfig. + * @member {google.cloud.securitycenter.v1beta1.OrganizationSettings.IAssetDiscoveryConfig|null|undefined} assetDiscoveryConfig + * @memberof google.cloud.securitycenter.v1beta1.OrganizationSettings + * @instance + */ + OrganizationSettings.prototype.assetDiscoveryConfig = null; + + /** + * Creates a new OrganizationSettings instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1beta1.OrganizationSettings + * @static + * @param {google.cloud.securitycenter.v1beta1.IOrganizationSettings=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1beta1.OrganizationSettings} OrganizationSettings instance + */ + OrganizationSettings.create = function create(properties) { + return new OrganizationSettings(properties); + }; + + /** + * Encodes the specified OrganizationSettings message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.OrganizationSettings.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1beta1.OrganizationSettings + * @static + * @param {google.cloud.securitycenter.v1beta1.IOrganizationSettings} message OrganizationSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OrganizationSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.enableAssetDiscovery != null && message.hasOwnProperty("enableAssetDiscovery")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.enableAssetDiscovery); + if (message.assetDiscoveryConfig != null && message.hasOwnProperty("assetDiscoveryConfig")) + $root.google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig.encode(message.assetDiscoveryConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; - /** - * Creates a SecurityCenterProperties message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v1.Asset.SecurityCenterProperties - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.Asset.SecurityCenterProperties} SecurityCenterProperties - */ - SecurityCenterProperties.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.Asset.SecurityCenterProperties) - return object; - var message = new $root.google.cloud.securitycenter.v1.Asset.SecurityCenterProperties(); - if (object.resourceName != null) - message.resourceName = String(object.resourceName); - if (object.resourceType != null) - message.resourceType = String(object.resourceType); - if (object.resourceParent != null) - message.resourceParent = String(object.resourceParent); - if (object.resourceProject != null) - message.resourceProject = String(object.resourceProject); - if (object.resourceOwners) { - if (!Array.isArray(object.resourceOwners)) - throw TypeError(".google.cloud.securitycenter.v1.Asset.SecurityCenterProperties.resourceOwners: array expected"); - message.resourceOwners = []; - for (var i = 0; i < object.resourceOwners.length; ++i) - message.resourceOwners[i] = String(object.resourceOwners[i]); - } - if (object.resourceDisplayName != null) - message.resourceDisplayName = String(object.resourceDisplayName); - if (object.resourceParentDisplayName != null) - message.resourceParentDisplayName = String(object.resourceParentDisplayName); - if (object.resourceProjectDisplayName != null) - message.resourceProjectDisplayName = String(object.resourceProjectDisplayName); - return message; - }; + /** + * Encodes the specified OrganizationSettings message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.OrganizationSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1beta1.OrganizationSettings + * @static + * @param {google.cloud.securitycenter.v1beta1.IOrganizationSettings} message OrganizationSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OrganizationSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Creates a plain object from a SecurityCenterProperties message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v1.Asset.SecurityCenterProperties - * @static - * @param {google.cloud.securitycenter.v1.Asset.SecurityCenterProperties} message SecurityCenterProperties - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SecurityCenterProperties.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.resourceOwners = []; - if (options.defaults) { - object.resourceName = ""; - object.resourceType = ""; - object.resourceParent = ""; - object.resourceProject = ""; - object.resourceDisplayName = ""; - object.resourceParentDisplayName = ""; - object.resourceProjectDisplayName = ""; - } - if (message.resourceName != null && message.hasOwnProperty("resourceName")) - object.resourceName = message.resourceName; - if (message.resourceType != null && message.hasOwnProperty("resourceType")) - object.resourceType = message.resourceType; - if (message.resourceParent != null && message.hasOwnProperty("resourceParent")) - object.resourceParent = message.resourceParent; - if (message.resourceProject != null && message.hasOwnProperty("resourceProject")) - object.resourceProject = message.resourceProject; - if (message.resourceOwners && message.resourceOwners.length) { - object.resourceOwners = []; - for (var j = 0; j < message.resourceOwners.length; ++j) - object.resourceOwners[j] = message.resourceOwners[j]; + /** + * Decodes an OrganizationSettings message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1beta1.OrganizationSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1beta1.OrganizationSettings} OrganizationSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OrganizationSettings.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.cloud.securitycenter.v1beta1.OrganizationSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.enableAssetDiscovery = reader.bool(); + break; + case 3: + message.assetDiscoveryConfig = $root.google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; } - if (message.resourceDisplayName != null && message.hasOwnProperty("resourceDisplayName")) - object.resourceDisplayName = message.resourceDisplayName; - if (message.resourceParentDisplayName != null && message.hasOwnProperty("resourceParentDisplayName")) - object.resourceParentDisplayName = message.resourceParentDisplayName; - if (message.resourceProjectDisplayName != null && message.hasOwnProperty("resourceProjectDisplayName")) - object.resourceProjectDisplayName = message.resourceProjectDisplayName; + } + return message; + }; + + /** + * Decodes an OrganizationSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1beta1.OrganizationSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1beta1.OrganizationSettings} OrganizationSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OrganizationSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OrganizationSettings message. + * @function verify + * @memberof google.cloud.securitycenter.v1beta1.OrganizationSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OrganizationSettings.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.enableAssetDiscovery != null && message.hasOwnProperty("enableAssetDiscovery")) + if (typeof message.enableAssetDiscovery !== "boolean") + return "enableAssetDiscovery: boolean expected"; + if (message.assetDiscoveryConfig != null && message.hasOwnProperty("assetDiscoveryConfig")) { + var error = $root.google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig.verify(message.assetDiscoveryConfig); + if (error) + return "assetDiscoveryConfig." + error; + } + return null; + }; + + /** + * Creates an OrganizationSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1beta1.OrganizationSettings + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1beta1.OrganizationSettings} OrganizationSettings + */ + OrganizationSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1beta1.OrganizationSettings) return object; - }; + var message = new $root.google.cloud.securitycenter.v1beta1.OrganizationSettings(); + if (object.name != null) + message.name = String(object.name); + if (object.enableAssetDiscovery != null) + message.enableAssetDiscovery = Boolean(object.enableAssetDiscovery); + if (object.assetDiscoveryConfig != null) { + if (typeof object.assetDiscoveryConfig !== "object") + throw TypeError(".google.cloud.securitycenter.v1beta1.OrganizationSettings.assetDiscoveryConfig: object expected"); + message.assetDiscoveryConfig = $root.google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig.fromObject(object.assetDiscoveryConfig); + } + return message; + }; - /** - * Converts this SecurityCenterProperties to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1.Asset.SecurityCenterProperties - * @instance - * @returns {Object.} JSON object - */ - SecurityCenterProperties.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Creates a plain object from an OrganizationSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1beta1.OrganizationSettings + * @static + * @param {google.cloud.securitycenter.v1beta1.OrganizationSettings} message OrganizationSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OrganizationSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.enableAssetDiscovery = false; + object.assetDiscoveryConfig = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.enableAssetDiscovery != null && message.hasOwnProperty("enableAssetDiscovery")) + object.enableAssetDiscovery = message.enableAssetDiscovery; + if (message.assetDiscoveryConfig != null && message.hasOwnProperty("assetDiscoveryConfig")) + object.assetDiscoveryConfig = $root.google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig.toObject(message.assetDiscoveryConfig, options); + return object; + }; - return SecurityCenterProperties; - })(); + /** + * Converts this OrganizationSettings to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1beta1.OrganizationSettings + * @instance + * @returns {Object.} JSON object + */ + OrganizationSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - Asset.IamPolicy = (function() { + OrganizationSettings.AssetDiscoveryConfig = (function() { /** - * Properties of an IamPolicy. - * @memberof google.cloud.securitycenter.v1.Asset - * @interface IIamPolicy - * @property {string|null} [policyBlob] IamPolicy policyBlob + * Properties of an AssetDiscoveryConfig. + * @memberof google.cloud.securitycenter.v1beta1.OrganizationSettings + * @interface IAssetDiscoveryConfig + * @property {Array.|null} [projectIds] AssetDiscoveryConfig projectIds + * @property {google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode|null} [inclusionMode] AssetDiscoveryConfig inclusionMode */ /** - * Constructs a new IamPolicy. - * @memberof google.cloud.securitycenter.v1.Asset - * @classdesc Represents an IamPolicy. - * @implements IIamPolicy + * Constructs a new AssetDiscoveryConfig. + * @memberof google.cloud.securitycenter.v1beta1.OrganizationSettings + * @classdesc Represents an AssetDiscoveryConfig. + * @implements IAssetDiscoveryConfig * @constructor - * @param {google.cloud.securitycenter.v1.Asset.IIamPolicy=} [properties] Properties to set + * @param {google.cloud.securitycenter.v1beta1.OrganizationSettings.IAssetDiscoveryConfig=} [properties] Properties to set */ - function IamPolicy(properties) { + function AssetDiscoveryConfig(properties) { + this.projectIds = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -1516,75 +11113,91 @@ } /** - * IamPolicy policyBlob. - * @member {string} policyBlob - * @memberof google.cloud.securitycenter.v1.Asset.IamPolicy + * AssetDiscoveryConfig projectIds. + * @member {Array.} projectIds + * @memberof google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig * @instance */ - IamPolicy.prototype.policyBlob = ""; + AssetDiscoveryConfig.prototype.projectIds = $util.emptyArray; /** - * Creates a new IamPolicy instance using the specified properties. + * AssetDiscoveryConfig inclusionMode. + * @member {google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode} inclusionMode + * @memberof google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig + * @instance + */ + AssetDiscoveryConfig.prototype.inclusionMode = 0; + + /** + * Creates a new AssetDiscoveryConfig instance using the specified properties. * @function create - * @memberof google.cloud.securitycenter.v1.Asset.IamPolicy + * @memberof google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig * @static - * @param {google.cloud.securitycenter.v1.Asset.IIamPolicy=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.Asset.IamPolicy} IamPolicy instance + * @param {google.cloud.securitycenter.v1beta1.OrganizationSettings.IAssetDiscoveryConfig=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig} AssetDiscoveryConfig instance */ - IamPolicy.create = function create(properties) { - return new IamPolicy(properties); + AssetDiscoveryConfig.create = function create(properties) { + return new AssetDiscoveryConfig(properties); }; /** - * Encodes the specified IamPolicy message. Does not implicitly {@link google.cloud.securitycenter.v1.Asset.IamPolicy.verify|verify} messages. + * Encodes the specified AssetDiscoveryConfig message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig.verify|verify} messages. * @function encode - * @memberof google.cloud.securitycenter.v1.Asset.IamPolicy + * @memberof google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig * @static - * @param {google.cloud.securitycenter.v1.Asset.IIamPolicy} message IamPolicy message or plain object to encode + * @param {google.cloud.securitycenter.v1beta1.OrganizationSettings.IAssetDiscoveryConfig} message AssetDiscoveryConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - IamPolicy.encode = function encode(message, writer) { + AssetDiscoveryConfig.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.policyBlob != null && message.hasOwnProperty("policyBlob")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.policyBlob); + if (message.projectIds != null && message.projectIds.length) + for (var i = 0; i < message.projectIds.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectIds[i]); + if (message.inclusionMode != null && message.hasOwnProperty("inclusionMode")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.inclusionMode); return writer; }; /** - * Encodes the specified IamPolicy message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Asset.IamPolicy.verify|verify} messages. + * Encodes the specified AssetDiscoveryConfig message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.Asset.IamPolicy + * @memberof google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig * @static - * @param {google.cloud.securitycenter.v1.Asset.IIamPolicy} message IamPolicy message or plain object to encode + * @param {google.cloud.securitycenter.v1beta1.OrganizationSettings.IAssetDiscoveryConfig} message AssetDiscoveryConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - IamPolicy.encodeDelimited = function encodeDelimited(message, writer) { + AssetDiscoveryConfig.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an IamPolicy message from the specified reader or buffer. + * Decodes an AssetDiscoveryConfig message from the specified reader or buffer. * @function decode - * @memberof google.cloud.securitycenter.v1.Asset.IamPolicy + * @memberof google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.Asset.IamPolicy} IamPolicy + * @returns {google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig} AssetDiscoveryConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - IamPolicy.decode = function decode(reader, length) { + AssetDiscoveryConfig.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.cloud.securitycenter.v1.Asset.IamPolicy(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.policyBlob = reader.string(); + if (!(message.projectIds && message.projectIds.length)) + message.projectIds = []; + message.projectIds.push(reader.string()); + break; + case 2: + message.inclusionMode = reader.int32(); break; default: reader.skipType(tag & 7); @@ -1595,341 +11208,164 @@ }; /** - * Decodes an IamPolicy message from the specified reader or buffer, length delimited. + * Decodes an AssetDiscoveryConfig message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.Asset.IamPolicy + * @memberof google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.Asset.IamPolicy} IamPolicy + * @returns {google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig} AssetDiscoveryConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - IamPolicy.decodeDelimited = function decodeDelimited(reader) { + AssetDiscoveryConfig.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an IamPolicy message. + * Verifies an AssetDiscoveryConfig message. * @function verify - * @memberof google.cloud.securitycenter.v1.Asset.IamPolicy + * @memberof google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - IamPolicy.verify = function verify(message) { + AssetDiscoveryConfig.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.policyBlob != null && message.hasOwnProperty("policyBlob")) - if (!$util.isString(message.policyBlob)) - return "policyBlob: string expected"; - return null; - }; - - /** - * Creates an IamPolicy message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v1.Asset.IamPolicy - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.Asset.IamPolicy} IamPolicy - */ - IamPolicy.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.Asset.IamPolicy) - return object; - var message = new $root.google.cloud.securitycenter.v1.Asset.IamPolicy(); - if (object.policyBlob != null) - message.policyBlob = String(object.policyBlob); - return message; - }; - - /** - * Creates a plain object from an IamPolicy message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v1.Asset.IamPolicy - * @static - * @param {google.cloud.securitycenter.v1.Asset.IamPolicy} message IamPolicy - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - IamPolicy.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.policyBlob = ""; - if (message.policyBlob != null && message.hasOwnProperty("policyBlob")) - object.policyBlob = message.policyBlob; - return object; - }; - - /** - * Converts this IamPolicy to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1.Asset.IamPolicy - * @instance - * @returns {Object.} JSON object - */ - IamPolicy.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return IamPolicy; - })(); - - return Asset; - })(); - - v1.Source = (function() { - - /** - * Properties of a Source. - * @memberof google.cloud.securitycenter.v1 - * @interface ISource - * @property {string|null} [name] Source name - * @property {string|null} [displayName] Source displayName - * @property {string|null} [description] Source description - */ - - /** - * Constructs a new Source. - * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents a Source. - * @implements ISource - * @constructor - * @param {google.cloud.securitycenter.v1.ISource=} [properties] Properties to set - */ - function Source(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]]; - } - - /** - * Source name. - * @member {string} name - * @memberof google.cloud.securitycenter.v1.Source - * @instance - */ - Source.prototype.name = ""; - - /** - * Source displayName. - * @member {string} displayName - * @memberof google.cloud.securitycenter.v1.Source - * @instance - */ - Source.prototype.displayName = ""; - - /** - * Source description. - * @member {string} description - * @memberof google.cloud.securitycenter.v1.Source - * @instance - */ - Source.prototype.description = ""; - - /** - * Creates a new Source instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v1.Source - * @static - * @param {google.cloud.securitycenter.v1.ISource=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.Source} Source instance - */ - Source.create = function create(properties) { - return new Source(properties); - }; - - /** - * Encodes the specified Source message. Does not implicitly {@link google.cloud.securitycenter.v1.Source.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1.Source - * @static - * @param {google.cloud.securitycenter.v1.ISource} message Source message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Source.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.displayName != null && message.hasOwnProperty("displayName")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); - if (message.description != null && message.hasOwnProperty("description")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); - return writer; - }; - - /** - * Encodes the specified Source message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Source.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.Source - * @static - * @param {google.cloud.securitycenter.v1.ISource} message Source message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Source.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + if (message.projectIds != null && message.hasOwnProperty("projectIds")) { + if (!Array.isArray(message.projectIds)) + return "projectIds: array expected"; + for (var i = 0; i < message.projectIds.length; ++i) + if (!$util.isString(message.projectIds[i])) + return "projectIds: string[] expected"; + } + if (message.inclusionMode != null && message.hasOwnProperty("inclusionMode")) + switch (message.inclusionMode) { + default: + return "inclusionMode: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; - /** - * Decodes a Source message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v1.Source - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.Source} Source - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Source.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.cloud.securitycenter.v1.Source(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { + /** + * Creates an AssetDiscoveryConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig} AssetDiscoveryConfig + */ + AssetDiscoveryConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig) + return object; + var message = new $root.google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig(); + if (object.projectIds) { + if (!Array.isArray(object.projectIds)) + throw TypeError(".google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig.projectIds: array expected"); + message.projectIds = []; + for (var i = 0; i < object.projectIds.length; ++i) + message.projectIds[i] = String(object.projectIds[i]); + } + switch (object.inclusionMode) { + case "INCLUSION_MODE_UNSPECIFIED": + case 0: + message.inclusionMode = 0; + break; + case "INCLUDE_ONLY": case 1: - message.name = reader.string(); + message.inclusionMode = 1; break; + case "EXCLUDE": case 2: - message.displayName = reader.string(); - break; - case 3: - message.description = reader.string(); - break; - default: - reader.skipType(tag & 7); + message.inclusionMode = 2; break; } - } - return message; - }; - - /** - * Decodes a Source message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.Source - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.Source} Source - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Source.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Source message. - * @function verify - * @memberof google.cloud.securitycenter.v1.Source - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Source.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.displayName != null && message.hasOwnProperty("displayName")) - if (!$util.isString(message.displayName)) - return "displayName: string expected"; - if (message.description != null && message.hasOwnProperty("description")) - if (!$util.isString(message.description)) - return "description: string expected"; - return null; - }; + return message; + }; - /** - * Creates a Source message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v1.Source - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.Source} Source - */ - Source.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.Source) + /** + * Creates a plain object from an AssetDiscoveryConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig + * @static + * @param {google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig} message AssetDiscoveryConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AssetDiscoveryConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.projectIds = []; + if (options.defaults) + object.inclusionMode = options.enums === String ? "INCLUSION_MODE_UNSPECIFIED" : 0; + if (message.projectIds && message.projectIds.length) { + object.projectIds = []; + for (var j = 0; j < message.projectIds.length; ++j) + object.projectIds[j] = message.projectIds[j]; + } + if (message.inclusionMode != null && message.hasOwnProperty("inclusionMode")) + object.inclusionMode = options.enums === String ? $root.google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode[message.inclusionMode] : message.inclusionMode; return object; - var message = new $root.google.cloud.securitycenter.v1.Source(); - if (object.name != null) - message.name = String(object.name); - if (object.displayName != null) - message.displayName = String(object.displayName); - if (object.description != null) - message.description = String(object.description); - return message; - }; + }; - /** - * Creates a plain object from a Source message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v1.Source - * @static - * @param {google.cloud.securitycenter.v1.Source} message Source - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Source.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.displayName = ""; - object.description = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.displayName != null && message.hasOwnProperty("displayName")) - object.displayName = message.displayName; - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; - return object; - }; + /** + * Converts this AssetDiscoveryConfig to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig + * @instance + * @returns {Object.} JSON object + */ + AssetDiscoveryConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Converts this Source to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1.Source - * @instance - * @returns {Object.} JSON object - */ - Source.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * InclusionMode enum. + * @name google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode + * @enum {string} + * @property {number} INCLUSION_MODE_UNSPECIFIED=0 INCLUSION_MODE_UNSPECIFIED value + * @property {number} INCLUDE_ONLY=1 INCLUDE_ONLY value + * @property {number} EXCLUDE=2 EXCLUDE value + */ + AssetDiscoveryConfig.InclusionMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "INCLUSION_MODE_UNSPECIFIED"] = 0; + values[valuesById[1] = "INCLUDE_ONLY"] = 1; + values[valuesById[2] = "EXCLUDE"] = 2; + return values; + })(); - return Source; + return AssetDiscoveryConfig; + })(); + + return OrganizationSettings; })(); - v1.RunAssetDiscoveryResponse = (function() { + v1beta1.RunAssetDiscoveryResponse = (function() { /** * Properties of a RunAssetDiscoveryResponse. - * @memberof google.cloud.securitycenter.v1 + * @memberof google.cloud.securitycenter.v1beta1 * @interface IRunAssetDiscoveryResponse - * @property {google.cloud.securitycenter.v1.RunAssetDiscoveryResponse.State|null} [state] RunAssetDiscoveryResponse state + * @property {google.cloud.securitycenter.v1beta1.RunAssetDiscoveryResponse.State|null} [state] RunAssetDiscoveryResponse state * @property {google.protobuf.IDuration|null} [duration] RunAssetDiscoveryResponse duration */ /** * Constructs a new RunAssetDiscoveryResponse. - * @memberof google.cloud.securitycenter.v1 + * @memberof google.cloud.securitycenter.v1beta1 * @classdesc Represents a RunAssetDiscoveryResponse. * @implements IRunAssetDiscoveryResponse * @constructor - * @param {google.cloud.securitycenter.v1.IRunAssetDiscoveryResponse=} [properties] Properties to set + * @param {google.cloud.securitycenter.v1beta1.IRunAssetDiscoveryResponse=} [properties] Properties to set */ function RunAssetDiscoveryResponse(properties) { if (properties) @@ -1940,8 +11376,8 @@ /** * RunAssetDiscoveryResponse state. - * @member {google.cloud.securitycenter.v1.RunAssetDiscoveryResponse.State} state - * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryResponse + * @member {google.cloud.securitycenter.v1beta1.RunAssetDiscoveryResponse.State} state + * @memberof google.cloud.securitycenter.v1beta1.RunAssetDiscoveryResponse * @instance */ RunAssetDiscoveryResponse.prototype.state = 0; @@ -1949,7 +11385,7 @@ /** * RunAssetDiscoveryResponse duration. * @member {google.protobuf.IDuration|null|undefined} duration - * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryResponse + * @memberof google.cloud.securitycenter.v1beta1.RunAssetDiscoveryResponse * @instance */ RunAssetDiscoveryResponse.prototype.duration = null; @@ -1957,21 +11393,21 @@ /** * Creates a new RunAssetDiscoveryResponse instance using the specified properties. * @function create - * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryResponse + * @memberof google.cloud.securitycenter.v1beta1.RunAssetDiscoveryResponse * @static - * @param {google.cloud.securitycenter.v1.IRunAssetDiscoveryResponse=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.RunAssetDiscoveryResponse} RunAssetDiscoveryResponse instance + * @param {google.cloud.securitycenter.v1beta1.IRunAssetDiscoveryResponse=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1beta1.RunAssetDiscoveryResponse} RunAssetDiscoveryResponse instance */ RunAssetDiscoveryResponse.create = function create(properties) { return new RunAssetDiscoveryResponse(properties); }; /** - * Encodes the specified RunAssetDiscoveryResponse message. Does not implicitly {@link google.cloud.securitycenter.v1.RunAssetDiscoveryResponse.verify|verify} messages. + * Encodes the specified RunAssetDiscoveryResponse message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.RunAssetDiscoveryResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryResponse + * @memberof google.cloud.securitycenter.v1beta1.RunAssetDiscoveryResponse * @static - * @param {google.cloud.securitycenter.v1.IRunAssetDiscoveryResponse} message RunAssetDiscoveryResponse message or plain object to encode + * @param {google.cloud.securitycenter.v1beta1.IRunAssetDiscoveryResponse} message RunAssetDiscoveryResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -1986,11 +11422,11 @@ }; /** - * Encodes the specified RunAssetDiscoveryResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.RunAssetDiscoveryResponse.verify|verify} messages. + * Encodes the specified RunAssetDiscoveryResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.RunAssetDiscoveryResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryResponse + * @memberof google.cloud.securitycenter.v1beta1.RunAssetDiscoveryResponse * @static - * @param {google.cloud.securitycenter.v1.IRunAssetDiscoveryResponse} message RunAssetDiscoveryResponse message or plain object to encode + * @param {google.cloud.securitycenter.v1beta1.IRunAssetDiscoveryResponse} message RunAssetDiscoveryResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -2001,18 +11437,18 @@ /** * Decodes a RunAssetDiscoveryResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryResponse + * @memberof google.cloud.securitycenter.v1beta1.RunAssetDiscoveryResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.RunAssetDiscoveryResponse} RunAssetDiscoveryResponse + * @returns {google.cloud.securitycenter.v1beta1.RunAssetDiscoveryResponse} RunAssetDiscoveryResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ RunAssetDiscoveryResponse.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.cloud.securitycenter.v1.RunAssetDiscoveryResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1beta1.RunAssetDiscoveryResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -2033,10 +11469,10 @@ /** * Decodes a RunAssetDiscoveryResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryResponse + * @memberof google.cloud.securitycenter.v1beta1.RunAssetDiscoveryResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.RunAssetDiscoveryResponse} RunAssetDiscoveryResponse + * @returns {google.cloud.securitycenter.v1beta1.RunAssetDiscoveryResponse} RunAssetDiscoveryResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ @@ -2049,7 +11485,7 @@ /** * Verifies a RunAssetDiscoveryResponse message. * @function verify - * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryResponse + * @memberof google.cloud.securitycenter.v1beta1.RunAssetDiscoveryResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not @@ -2078,15 +11514,15 @@ /** * Creates a RunAssetDiscoveryResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryResponse + * @memberof google.cloud.securitycenter.v1beta1.RunAssetDiscoveryResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.RunAssetDiscoveryResponse} RunAssetDiscoveryResponse + * @returns {google.cloud.securitycenter.v1beta1.RunAssetDiscoveryResponse} RunAssetDiscoveryResponse */ RunAssetDiscoveryResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.RunAssetDiscoveryResponse) + if (object instanceof $root.google.cloud.securitycenter.v1beta1.RunAssetDiscoveryResponse) return object; - var message = new $root.google.cloud.securitycenter.v1.RunAssetDiscoveryResponse(); + var message = new $root.google.cloud.securitycenter.v1beta1.RunAssetDiscoveryResponse(); switch (object.state) { case "STATE_UNSPECIFIED": case 0: @@ -2107,7 +11543,7 @@ } if (object.duration != null) { if (typeof object.duration !== "object") - throw TypeError(".google.cloud.securitycenter.v1.RunAssetDiscoveryResponse.duration: object expected"); + throw TypeError(".google.cloud.securitycenter.v1beta1.RunAssetDiscoveryResponse.duration: object expected"); message.duration = $root.google.protobuf.Duration.fromObject(object.duration); } return message; @@ -2116,9 +11552,9 @@ /** * Creates a plain object from a RunAssetDiscoveryResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryResponse + * @memberof google.cloud.securitycenter.v1beta1.RunAssetDiscoveryResponse * @static - * @param {google.cloud.securitycenter.v1.RunAssetDiscoveryResponse} message RunAssetDiscoveryResponse + * @param {google.cloud.securitycenter.v1beta1.RunAssetDiscoveryResponse} message RunAssetDiscoveryResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ @@ -2131,7 +11567,7 @@ object.duration = null; } if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.securitycenter.v1.RunAssetDiscoveryResponse.State[message.state] : message.state; + object.state = options.enums === String ? $root.google.cloud.securitycenter.v1beta1.RunAssetDiscoveryResponse.State[message.state] : message.state; if (message.duration != null && message.hasOwnProperty("duration")) object.duration = $root.google.protobuf.Duration.toObject(message.duration, options); return object; @@ -2140,7 +11576,7 @@ /** * Converts this RunAssetDiscoveryResponse to JSON. * @function toJSON - * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryResponse + * @memberof google.cloud.securitycenter.v1beta1.RunAssetDiscoveryResponse * @instance * @returns {Object.} JSON object */ @@ -2150,7 +11586,7 @@ /** * State enum. - * @name google.cloud.securitycenter.v1.RunAssetDiscoveryResponse.State + * @name google.cloud.securitycenter.v1beta1.RunAssetDiscoveryResponse.State * @enum {string} * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value * @property {number} COMPLETED=1 COMPLETED value @@ -2169,1152 +11605,1292 @@ return RunAssetDiscoveryResponse; })(); - v1.OrganizationSettings = (function() { + v1beta1.SecurityCenter = (function() { /** - * Properties of an OrganizationSettings. - * @memberof google.cloud.securitycenter.v1 - * @interface IOrganizationSettings - * @property {string|null} [name] OrganizationSettings name - * @property {boolean|null} [enableAssetDiscovery] OrganizationSettings enableAssetDiscovery - * @property {google.cloud.securitycenter.v1.OrganizationSettings.IAssetDiscoveryConfig|null} [assetDiscoveryConfig] OrganizationSettings assetDiscoveryConfig + * Constructs a new SecurityCenter service. + * @memberof google.cloud.securitycenter.v1beta1 + * @classdesc Represents a SecurityCenter + * @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 SecurityCenter(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (SecurityCenter.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = SecurityCenter; /** - * Constructs a new OrganizationSettings. - * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents an OrganizationSettings. - * @implements IOrganizationSettings - * @constructor - * @param {google.cloud.securitycenter.v1.IOrganizationSettings=} [properties] Properties to set + * Creates new SecurityCenter service using the specified rpc implementation. + * @function create + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @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 {SecurityCenter} RPC service. Useful where requests and/or responses are streamed. */ - function OrganizationSettings(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]]; - } + SecurityCenter.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; /** - * OrganizationSettings name. - * @member {string} name - * @memberof google.cloud.securitycenter.v1.OrganizationSettings + * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter#createSource}. + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @typedef CreateSourceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1beta1.Source} [response] Source + */ + + /** + * Calls CreateSource. + * @function createSource + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter * @instance + * @param {google.cloud.securitycenter.v1beta1.ICreateSourceRequest} request CreateSourceRequest message or plain object + * @param {google.cloud.securitycenter.v1beta1.SecurityCenter.CreateSourceCallback} callback Node-style callback called with the error, if any, and Source + * @returns {undefined} + * @variation 1 */ - OrganizationSettings.prototype.name = ""; + Object.defineProperty(SecurityCenter.prototype.createSource = function createSource(request, callback) { + return this.rpcCall(createSource, $root.google.cloud.securitycenter.v1beta1.CreateSourceRequest, $root.google.cloud.securitycenter.v1beta1.Source, request, callback); + }, "name", { value: "CreateSource" }); /** - * OrganizationSettings enableAssetDiscovery. - * @member {boolean} enableAssetDiscovery - * @memberof google.cloud.securitycenter.v1.OrganizationSettings + * Calls CreateSource. + * @function createSource + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter * @instance + * @param {google.cloud.securitycenter.v1beta1.ICreateSourceRequest} request CreateSourceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - OrganizationSettings.prototype.enableAssetDiscovery = false; /** - * OrganizationSettings assetDiscoveryConfig. - * @member {google.cloud.securitycenter.v1.OrganizationSettings.IAssetDiscoveryConfig|null|undefined} assetDiscoveryConfig - * @memberof google.cloud.securitycenter.v1.OrganizationSettings + * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter#createFinding}. + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @typedef CreateFindingCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1beta1.Finding} [response] Finding + */ + + /** + * Calls CreateFinding. + * @function createFinding + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter * @instance + * @param {google.cloud.securitycenter.v1beta1.ICreateFindingRequest} request CreateFindingRequest message or plain object + * @param {google.cloud.securitycenter.v1beta1.SecurityCenter.CreateFindingCallback} callback Node-style callback called with the error, if any, and Finding + * @returns {undefined} + * @variation 1 */ - OrganizationSettings.prototype.assetDiscoveryConfig = null; + Object.defineProperty(SecurityCenter.prototype.createFinding = function createFinding(request, callback) { + return this.rpcCall(createFinding, $root.google.cloud.securitycenter.v1beta1.CreateFindingRequest, $root.google.cloud.securitycenter.v1beta1.Finding, request, callback); + }, "name", { value: "CreateFinding" }); /** - * Creates a new OrganizationSettings instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v1.OrganizationSettings - * @static - * @param {google.cloud.securitycenter.v1.IOrganizationSettings=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.OrganizationSettings} OrganizationSettings instance + * Calls CreateFinding. + * @function createFinding + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1beta1.ICreateFindingRequest} request CreateFindingRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - OrganizationSettings.create = function create(properties) { - return new OrganizationSettings(properties); - }; /** - * Encodes the specified OrganizationSettings message. Does not implicitly {@link google.cloud.securitycenter.v1.OrganizationSettings.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1.OrganizationSettings - * @static - * @param {google.cloud.securitycenter.v1.IOrganizationSettings} message OrganizationSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter#getIamPolicy}. + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @typedef GetIamPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.iam.v1.Policy} [response] Policy */ - OrganizationSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.enableAssetDiscovery != null && message.hasOwnProperty("enableAssetDiscovery")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.enableAssetDiscovery); - if (message.assetDiscoveryConfig != null && message.hasOwnProperty("assetDiscoveryConfig")) - $root.google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.encode(message.assetDiscoveryConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; /** - * Encodes the specified OrganizationSettings message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.OrganizationSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.OrganizationSettings - * @static - * @param {google.cloud.securitycenter.v1.IOrganizationSettings} message OrganizationSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * Calls GetIamPolicy. + * @function getIamPolicy + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @instance + * @param {google.iam.v1.IGetIamPolicyRequest} request GetIamPolicyRequest message or plain object + * @param {google.cloud.securitycenter.v1beta1.SecurityCenter.GetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy + * @returns {undefined} + * @variation 1 */ - OrganizationSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + Object.defineProperty(SecurityCenter.prototype.getIamPolicy = function getIamPolicy(request, callback) { + return this.rpcCall(getIamPolicy, $root.google.iam.v1.GetIamPolicyRequest, $root.google.iam.v1.Policy, request, callback); + }, "name", { value: "GetIamPolicy" }); /** - * Decodes an OrganizationSettings message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v1.OrganizationSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.OrganizationSettings} OrganizationSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Calls GetIamPolicy. + * @function getIamPolicy + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @instance + * @param {google.iam.v1.IGetIamPolicyRequest} request GetIamPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter#getOrganizationSettings}. + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @typedef GetOrganizationSettingsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1beta1.OrganizationSettings} [response] OrganizationSettings + */ + + /** + * Calls GetOrganizationSettings. + * @function getOrganizationSettings + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1beta1.IGetOrganizationSettingsRequest} request GetOrganizationSettingsRequest message or plain object + * @param {google.cloud.securitycenter.v1beta1.SecurityCenter.GetOrganizationSettingsCallback} callback Node-style callback called with the error, if any, and OrganizationSettings + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.getOrganizationSettings = function getOrganizationSettings(request, callback) { + return this.rpcCall(getOrganizationSettings, $root.google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest, $root.google.cloud.securitycenter.v1beta1.OrganizationSettings, request, callback); + }, "name", { value: "GetOrganizationSettings" }); + + /** + * Calls GetOrganizationSettings. + * @function getOrganizationSettings + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1beta1.IGetOrganizationSettingsRequest} request GetOrganizationSettingsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - OrganizationSettings.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.cloud.securitycenter.v1.OrganizationSettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.enableAssetDiscovery = reader.bool(); - break; - case 3: - message.assetDiscoveryConfig = $root.google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; /** - * Decodes an OrganizationSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.OrganizationSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.OrganizationSettings} OrganizationSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter#getSource}. + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @typedef GetSourceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1beta1.Source} [response] Source */ - OrganizationSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; /** - * Verifies an OrganizationSettings message. - * @function verify - * @memberof google.cloud.securitycenter.v1.OrganizationSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not + * Calls GetSource. + * @function getSource + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1beta1.IGetSourceRequest} request GetSourceRequest message or plain object + * @param {google.cloud.securitycenter.v1beta1.SecurityCenter.GetSourceCallback} callback Node-style callback called with the error, if any, and Source + * @returns {undefined} + * @variation 1 */ - OrganizationSettings.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.enableAssetDiscovery != null && message.hasOwnProperty("enableAssetDiscovery")) - if (typeof message.enableAssetDiscovery !== "boolean") - return "enableAssetDiscovery: boolean expected"; - if (message.assetDiscoveryConfig != null && message.hasOwnProperty("assetDiscoveryConfig")) { - var error = $root.google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.verify(message.assetDiscoveryConfig); - if (error) - return "assetDiscoveryConfig." + error; - } - return null; - }; + Object.defineProperty(SecurityCenter.prototype.getSource = function getSource(request, callback) { + return this.rpcCall(getSource, $root.google.cloud.securitycenter.v1beta1.GetSourceRequest, $root.google.cloud.securitycenter.v1beta1.Source, request, callback); + }, "name", { value: "GetSource" }); /** - * Creates an OrganizationSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v1.OrganizationSettings - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.OrganizationSettings} OrganizationSettings + * Calls GetSource. + * @function getSource + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1beta1.IGetSourceRequest} request GetSourceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - OrganizationSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.OrganizationSettings) - return object; - var message = new $root.google.cloud.securitycenter.v1.OrganizationSettings(); - if (object.name != null) - message.name = String(object.name); - if (object.enableAssetDiscovery != null) - message.enableAssetDiscovery = Boolean(object.enableAssetDiscovery); - if (object.assetDiscoveryConfig != null) { - if (typeof object.assetDiscoveryConfig !== "object") - throw TypeError(".google.cloud.securitycenter.v1.OrganizationSettings.assetDiscoveryConfig: object expected"); - message.assetDiscoveryConfig = $root.google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.fromObject(object.assetDiscoveryConfig); - } - return message; - }; /** - * Creates a plain object from an OrganizationSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v1.OrganizationSettings - * @static - * @param {google.cloud.securitycenter.v1.OrganizationSettings} message OrganizationSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object + * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter#groupAssets}. + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @typedef GroupAssetsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1beta1.GroupAssetsResponse} [response] GroupAssetsResponse */ - OrganizationSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.enableAssetDiscovery = false; - object.assetDiscoveryConfig = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.enableAssetDiscovery != null && message.hasOwnProperty("enableAssetDiscovery")) - object.enableAssetDiscovery = message.enableAssetDiscovery; - if (message.assetDiscoveryConfig != null && message.hasOwnProperty("assetDiscoveryConfig")) - object.assetDiscoveryConfig = $root.google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.toObject(message.assetDiscoveryConfig, options); - return object; - }; /** - * Converts this OrganizationSettings to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1.OrganizationSettings + * Calls GroupAssets. + * @function groupAssets + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter * @instance - * @returns {Object.} JSON object + * @param {google.cloud.securitycenter.v1beta1.IGroupAssetsRequest} request GroupAssetsRequest message or plain object + * @param {google.cloud.securitycenter.v1beta1.SecurityCenter.GroupAssetsCallback} callback Node-style callback called with the error, if any, and GroupAssetsResponse + * @returns {undefined} + * @variation 1 */ - OrganizationSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + Object.defineProperty(SecurityCenter.prototype.groupAssets = function groupAssets(request, callback) { + return this.rpcCall(groupAssets, $root.google.cloud.securitycenter.v1beta1.GroupAssetsRequest, $root.google.cloud.securitycenter.v1beta1.GroupAssetsResponse, request, callback); + }, "name", { value: "GroupAssets" }); - OrganizationSettings.AssetDiscoveryConfig = (function() { + /** + * Calls GroupAssets. + * @function groupAssets + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1beta1.IGroupAssetsRequest} request GroupAssetsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ - /** - * Properties of an AssetDiscoveryConfig. - * @memberof google.cloud.securitycenter.v1.OrganizationSettings - * @interface IAssetDiscoveryConfig - * @property {Array.|null} [projectIds] AssetDiscoveryConfig projectIds - * @property {google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode|null} [inclusionMode] AssetDiscoveryConfig inclusionMode - */ + /** + * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter#groupFindings}. + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @typedef GroupFindingsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1beta1.GroupFindingsResponse} [response] GroupFindingsResponse + */ - /** - * Constructs a new AssetDiscoveryConfig. - * @memberof google.cloud.securitycenter.v1.OrganizationSettings - * @classdesc Represents an AssetDiscoveryConfig. - * @implements IAssetDiscoveryConfig - * @constructor - * @param {google.cloud.securitycenter.v1.OrganizationSettings.IAssetDiscoveryConfig=} [properties] Properties to set - */ - function AssetDiscoveryConfig(properties) { - this.projectIds = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Calls GroupFindings. + * @function groupFindings + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1beta1.IGroupFindingsRequest} request GroupFindingsRequest message or plain object + * @param {google.cloud.securitycenter.v1beta1.SecurityCenter.GroupFindingsCallback} callback Node-style callback called with the error, if any, and GroupFindingsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.groupFindings = function groupFindings(request, callback) { + return this.rpcCall(groupFindings, $root.google.cloud.securitycenter.v1beta1.GroupFindingsRequest, $root.google.cloud.securitycenter.v1beta1.GroupFindingsResponse, request, callback); + }, "name", { value: "GroupFindings" }); - /** - * AssetDiscoveryConfig projectIds. - * @member {Array.} projectIds - * @memberof google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig - * @instance - */ - AssetDiscoveryConfig.prototype.projectIds = $util.emptyArray; + /** + * Calls GroupFindings. + * @function groupFindings + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1beta1.IGroupFindingsRequest} request GroupFindingsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ - /** - * AssetDiscoveryConfig inclusionMode. - * @member {google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode} inclusionMode - * @memberof google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig - * @instance - */ - AssetDiscoveryConfig.prototype.inclusionMode = 0; + /** + * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter#listAssets}. + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @typedef ListAssetsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1beta1.ListAssetsResponse} [response] ListAssetsResponse + */ - /** - * Creates a new AssetDiscoveryConfig instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig - * @static - * @param {google.cloud.securitycenter.v1.OrganizationSettings.IAssetDiscoveryConfig=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig} AssetDiscoveryConfig instance - */ - AssetDiscoveryConfig.create = function create(properties) { - return new AssetDiscoveryConfig(properties); - }; + /** + * Calls ListAssets. + * @function listAssets + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1beta1.IListAssetsRequest} request ListAssetsRequest message or plain object + * @param {google.cloud.securitycenter.v1beta1.SecurityCenter.ListAssetsCallback} callback Node-style callback called with the error, if any, and ListAssetsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.listAssets = function listAssets(request, callback) { + return this.rpcCall(listAssets, $root.google.cloud.securitycenter.v1beta1.ListAssetsRequest, $root.google.cloud.securitycenter.v1beta1.ListAssetsResponse, request, callback); + }, "name", { value: "ListAssets" }); - /** - * Encodes the specified AssetDiscoveryConfig message. Does not implicitly {@link google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig - * @static - * @param {google.cloud.securitycenter.v1.OrganizationSettings.IAssetDiscoveryConfig} message AssetDiscoveryConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AssetDiscoveryConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.projectIds != null && message.projectIds.length) - for (var i = 0; i < message.projectIds.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectIds[i]); - if (message.inclusionMode != null && message.hasOwnProperty("inclusionMode")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.inclusionMode); - return writer; - }; + /** + * Calls ListAssets. + * @function listAssets + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1beta1.IListAssetsRequest} request ListAssetsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ - /** - * Encodes the specified AssetDiscoveryConfig message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig - * @static - * @param {google.cloud.securitycenter.v1.OrganizationSettings.IAssetDiscoveryConfig} message AssetDiscoveryConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AssetDiscoveryConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter#listFindings}. + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @typedef ListFindingsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1beta1.ListFindingsResponse} [response] ListFindingsResponse + */ - /** - * Decodes an AssetDiscoveryConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig} AssetDiscoveryConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AssetDiscoveryConfig.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.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.projectIds && message.projectIds.length)) - message.projectIds = []; - message.projectIds.push(reader.string()); - break; - case 2: - message.inclusionMode = reader.int32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Calls ListFindings. + * @function listFindings + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1beta1.IListFindingsRequest} request ListFindingsRequest message or plain object + * @param {google.cloud.securitycenter.v1beta1.SecurityCenter.ListFindingsCallback} callback Node-style callback called with the error, if any, and ListFindingsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.listFindings = function listFindings(request, callback) { + return this.rpcCall(listFindings, $root.google.cloud.securitycenter.v1beta1.ListFindingsRequest, $root.google.cloud.securitycenter.v1beta1.ListFindingsResponse, request, callback); + }, "name", { value: "ListFindings" }); - /** - * Decodes an AssetDiscoveryConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig} AssetDiscoveryConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AssetDiscoveryConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Calls ListFindings. + * @function listFindings + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1beta1.IListFindingsRequest} request ListFindingsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ - /** - * Verifies an AssetDiscoveryConfig message. - * @function verify - * @memberof google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AssetDiscoveryConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.projectIds != null && message.hasOwnProperty("projectIds")) { - if (!Array.isArray(message.projectIds)) - return "projectIds: array expected"; - for (var i = 0; i < message.projectIds.length; ++i) - if (!$util.isString(message.projectIds[i])) - return "projectIds: string[] expected"; - } - if (message.inclusionMode != null && message.hasOwnProperty("inclusionMode")) - switch (message.inclusionMode) { - default: - return "inclusionMode: enum value expected"; - case 0: - case 1: - case 2: - break; - } - return null; - }; + /** + * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter#listSources}. + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @typedef ListSourcesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1beta1.ListSourcesResponse} [response] ListSourcesResponse + */ - /** - * Creates an AssetDiscoveryConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig} AssetDiscoveryConfig - */ - AssetDiscoveryConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig) - return object; - var message = new $root.google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig(); - if (object.projectIds) { - if (!Array.isArray(object.projectIds)) - throw TypeError(".google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.projectIds: array expected"); - message.projectIds = []; - for (var i = 0; i < object.projectIds.length; ++i) - message.projectIds[i] = String(object.projectIds[i]); - } - switch (object.inclusionMode) { - case "INCLUSION_MODE_UNSPECIFIED": - case 0: - message.inclusionMode = 0; - break; - case "INCLUDE_ONLY": - case 1: - message.inclusionMode = 1; - break; - case "EXCLUDE": - case 2: - message.inclusionMode = 2; - break; - } - return message; - }; + /** + * Calls ListSources. + * @function listSources + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1beta1.IListSourcesRequest} request ListSourcesRequest message or plain object + * @param {google.cloud.securitycenter.v1beta1.SecurityCenter.ListSourcesCallback} callback Node-style callback called with the error, if any, and ListSourcesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.listSources = function listSources(request, callback) { + return this.rpcCall(listSources, $root.google.cloud.securitycenter.v1beta1.ListSourcesRequest, $root.google.cloud.securitycenter.v1beta1.ListSourcesResponse, request, callback); + }, "name", { value: "ListSources" }); - /** - * Creates a plain object from an AssetDiscoveryConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig - * @static - * @param {google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig} message AssetDiscoveryConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AssetDiscoveryConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.projectIds = []; - if (options.defaults) - object.inclusionMode = options.enums === String ? "INCLUSION_MODE_UNSPECIFIED" : 0; - if (message.projectIds && message.projectIds.length) { - object.projectIds = []; - for (var j = 0; j < message.projectIds.length; ++j) - object.projectIds[j] = message.projectIds[j]; - } - if (message.inclusionMode != null && message.hasOwnProperty("inclusionMode")) - object.inclusionMode = options.enums === String ? $root.google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode[message.inclusionMode] : message.inclusionMode; - return object; - }; + /** + * Calls ListSources. + * @function listSources + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1beta1.IListSourcesRequest} request ListSourcesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ - /** - * Converts this AssetDiscoveryConfig to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig - * @instance - * @returns {Object.} JSON object - */ - AssetDiscoveryConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter#runAssetDiscovery}. + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @typedef RunAssetDiscoveryCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ - /** - * InclusionMode enum. - * @name google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode - * @enum {string} - * @property {number} INCLUSION_MODE_UNSPECIFIED=0 INCLUSION_MODE_UNSPECIFIED value - * @property {number} INCLUDE_ONLY=1 INCLUDE_ONLY value - * @property {number} EXCLUDE=2 EXCLUDE value - */ - AssetDiscoveryConfig.InclusionMode = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "INCLUSION_MODE_UNSPECIFIED"] = 0; - values[valuesById[1] = "INCLUDE_ONLY"] = 1; - values[valuesById[2] = "EXCLUDE"] = 2; - return values; - })(); + /** + * Calls RunAssetDiscovery. + * @function runAssetDiscovery + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1beta1.IRunAssetDiscoveryRequest} request RunAssetDiscoveryRequest message or plain object + * @param {google.cloud.securitycenter.v1beta1.SecurityCenter.RunAssetDiscoveryCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.runAssetDiscovery = function runAssetDiscovery(request, callback) { + return this.rpcCall(runAssetDiscovery, $root.google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "RunAssetDiscovery" }); - return AssetDiscoveryConfig; - })(); + /** + * Calls RunAssetDiscovery. + * @function runAssetDiscovery + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1beta1.IRunAssetDiscoveryRequest} request RunAssetDiscoveryRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ - return OrganizationSettings; - })(); + /** + * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter#setFindingState}. + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @typedef SetFindingStateCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1beta1.Finding} [response] Finding + */ - v1.SecurityCenter = (function() { + /** + * Calls SetFindingState. + * @function setFindingState + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1beta1.ISetFindingStateRequest} request SetFindingStateRequest message or plain object + * @param {google.cloud.securitycenter.v1beta1.SecurityCenter.SetFindingStateCallback} callback Node-style callback called with the error, if any, and Finding + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.setFindingState = function setFindingState(request, callback) { + return this.rpcCall(setFindingState, $root.google.cloud.securitycenter.v1beta1.SetFindingStateRequest, $root.google.cloud.securitycenter.v1beta1.Finding, request, callback); + }, "name", { value: "SetFindingState" }); /** - * Constructs a new SecurityCenter service. - * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents a SecurityCenter - * @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 + * Calls SetFindingState. + * @function setFindingState + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1beta1.ISetFindingStateRequest} request SetFindingStateRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - function SecurityCenter(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - (SecurityCenter.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = SecurityCenter; + /** + * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter#setIamPolicy}. + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @typedef SetIamPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.iam.v1.Policy} [response] Policy + */ /** - * Creates new SecurityCenter service using the specified rpc implementation. - * @function create - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @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 {SecurityCenter} RPC service. Useful where requests and/or responses are streamed. + * Calls SetIamPolicy. + * @function setIamPolicy + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @instance + * @param {google.iam.v1.ISetIamPolicyRequest} request SetIamPolicyRequest message or plain object + * @param {google.cloud.securitycenter.v1beta1.SecurityCenter.SetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy + * @returns {undefined} + * @variation 1 */ - SecurityCenter.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; + Object.defineProperty(SecurityCenter.prototype.setIamPolicy = function setIamPolicy(request, callback) { + return this.rpcCall(setIamPolicy, $root.google.iam.v1.SetIamPolicyRequest, $root.google.iam.v1.Policy, request, callback); + }, "name", { value: "SetIamPolicy" }); /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#createSource}. - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @typedef CreateSourceCallback + * Calls SetIamPolicy. + * @function setIamPolicy + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @instance + * @param {google.iam.v1.ISetIamPolicyRequest} request SetIamPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter#testIamPermissions}. + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @typedef TestIamPermissionsCallback * @type {function} * @param {Error|null} error Error, if any - * @param {google.cloud.securitycenter.v1.Source} [response] Source + * @param {google.iam.v1.TestIamPermissionsResponse} [response] TestIamPermissionsResponse */ /** - * Calls CreateSource. - * @function createSource - * @memberof google.cloud.securitycenter.v1.SecurityCenter + * Calls TestIamPermissions. + * @function testIamPermissions + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter * @instance - * @param {google.cloud.securitycenter.v1.ICreateSourceRequest} request CreateSourceRequest message or plain object - * @param {google.cloud.securitycenter.v1.SecurityCenter.CreateSourceCallback} callback Node-style callback called with the error, if any, and Source + * @param {google.iam.v1.ITestIamPermissionsRequest} request TestIamPermissionsRequest message or plain object + * @param {google.cloud.securitycenter.v1beta1.SecurityCenter.TestIamPermissionsCallback} callback Node-style callback called with the error, if any, and TestIamPermissionsResponse * @returns {undefined} * @variation 1 */ - Object.defineProperty(SecurityCenter.prototype.createSource = function createSource(request, callback) { - return this.rpcCall(createSource, $root.google.cloud.securitycenter.v1.CreateSourceRequest, $root.google.cloud.securitycenter.v1.Source, request, callback); - }, "name", { value: "CreateSource" }); + Object.defineProperty(SecurityCenter.prototype.testIamPermissions = function testIamPermissions(request, callback) { + return this.rpcCall(testIamPermissions, $root.google.iam.v1.TestIamPermissionsRequest, $root.google.iam.v1.TestIamPermissionsResponse, request, callback); + }, "name", { value: "TestIamPermissions" }); /** - * Calls CreateSource. - * @function createSource - * @memberof google.cloud.securitycenter.v1.SecurityCenter + * Calls TestIamPermissions. + * @function testIamPermissions + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter * @instance - * @param {google.cloud.securitycenter.v1.ICreateSourceRequest} request CreateSourceRequest message or plain object - * @returns {Promise} Promise + * @param {google.iam.v1.ITestIamPermissionsRequest} request TestIamPermissionsRequest message or plain object + * @returns {Promise} Promise * @variation 2 */ /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#createFinding}. - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @typedef CreateFindingCallback + * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter#updateFinding}. + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @typedef UpdateFindingCallback * @type {function} * @param {Error|null} error Error, if any - * @param {google.cloud.securitycenter.v1.Finding} [response] Finding + * @param {google.cloud.securitycenter.v1beta1.Finding} [response] Finding */ /** - * Calls CreateFinding. - * @function createFinding - * @memberof google.cloud.securitycenter.v1.SecurityCenter + * Calls UpdateFinding. + * @function updateFinding + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter * @instance - * @param {google.cloud.securitycenter.v1.ICreateFindingRequest} request CreateFindingRequest message or plain object - * @param {google.cloud.securitycenter.v1.SecurityCenter.CreateFindingCallback} callback Node-style callback called with the error, if any, and Finding + * @param {google.cloud.securitycenter.v1beta1.IUpdateFindingRequest} request UpdateFindingRequest message or plain object + * @param {google.cloud.securitycenter.v1beta1.SecurityCenter.UpdateFindingCallback} callback Node-style callback called with the error, if any, and Finding * @returns {undefined} * @variation 1 */ - Object.defineProperty(SecurityCenter.prototype.createFinding = function createFinding(request, callback) { - return this.rpcCall(createFinding, $root.google.cloud.securitycenter.v1.CreateFindingRequest, $root.google.cloud.securitycenter.v1.Finding, request, callback); - }, "name", { value: "CreateFinding" }); + Object.defineProperty(SecurityCenter.prototype.updateFinding = function updateFinding(request, callback) { + return this.rpcCall(updateFinding, $root.google.cloud.securitycenter.v1beta1.UpdateFindingRequest, $root.google.cloud.securitycenter.v1beta1.Finding, request, callback); + }, "name", { value: "UpdateFinding" }); /** - * Calls CreateFinding. - * @function createFinding - * @memberof google.cloud.securitycenter.v1.SecurityCenter + * Calls UpdateFinding. + * @function updateFinding + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter * @instance - * @param {google.cloud.securitycenter.v1.ICreateFindingRequest} request CreateFindingRequest message or plain object - * @returns {Promise} Promise + * @param {google.cloud.securitycenter.v1beta1.IUpdateFindingRequest} request UpdateFindingRequest message or plain object + * @returns {Promise} Promise * @variation 2 */ /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#getIamPolicy}. - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @typedef GetIamPolicyCallback + * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter#updateOrganizationSettings}. + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @typedef UpdateOrganizationSettingsCallback * @type {function} * @param {Error|null} error Error, if any - * @param {google.iam.v1.Policy} [response] Policy + * @param {google.cloud.securitycenter.v1beta1.OrganizationSettings} [response] OrganizationSettings */ /** - * Calls GetIamPolicy. - * @function getIamPolicy - * @memberof google.cloud.securitycenter.v1.SecurityCenter + * Calls UpdateOrganizationSettings. + * @function updateOrganizationSettings + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter * @instance - * @param {google.iam.v1.IGetIamPolicyRequest} request GetIamPolicyRequest message or plain object - * @param {google.cloud.securitycenter.v1.SecurityCenter.GetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy + * @param {google.cloud.securitycenter.v1beta1.IUpdateOrganizationSettingsRequest} request UpdateOrganizationSettingsRequest message or plain object + * @param {google.cloud.securitycenter.v1beta1.SecurityCenter.UpdateOrganizationSettingsCallback} callback Node-style callback called with the error, if any, and OrganizationSettings * @returns {undefined} * @variation 1 */ - Object.defineProperty(SecurityCenter.prototype.getIamPolicy = function getIamPolicy(request, callback) { - return this.rpcCall(getIamPolicy, $root.google.iam.v1.GetIamPolicyRequest, $root.google.iam.v1.Policy, request, callback); - }, "name", { value: "GetIamPolicy" }); + Object.defineProperty(SecurityCenter.prototype.updateOrganizationSettings = function updateOrganizationSettings(request, callback) { + return this.rpcCall(updateOrganizationSettings, $root.google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest, $root.google.cloud.securitycenter.v1beta1.OrganizationSettings, request, callback); + }, "name", { value: "UpdateOrganizationSettings" }); /** - * Calls GetIamPolicy. - * @function getIamPolicy - * @memberof google.cloud.securitycenter.v1.SecurityCenter + * Calls UpdateOrganizationSettings. + * @function updateOrganizationSettings + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter * @instance - * @param {google.iam.v1.IGetIamPolicyRequest} request GetIamPolicyRequest message or plain object - * @returns {Promise} Promise + * @param {google.cloud.securitycenter.v1beta1.IUpdateOrganizationSettingsRequest} request UpdateOrganizationSettingsRequest message or plain object + * @returns {Promise} Promise * @variation 2 */ /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#getOrganizationSettings}. - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @typedef GetOrganizationSettingsCallback + * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter#updateSource}. + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @typedef UpdateSourceCallback * @type {function} * @param {Error|null} error Error, if any - * @param {google.cloud.securitycenter.v1.OrganizationSettings} [response] OrganizationSettings + * @param {google.cloud.securitycenter.v1beta1.Source} [response] Source */ /** - * Calls GetOrganizationSettings. - * @function getOrganizationSettings - * @memberof google.cloud.securitycenter.v1.SecurityCenter + * Calls UpdateSource. + * @function updateSource + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter * @instance - * @param {google.cloud.securitycenter.v1.IGetOrganizationSettingsRequest} request GetOrganizationSettingsRequest message or plain object - * @param {google.cloud.securitycenter.v1.SecurityCenter.GetOrganizationSettingsCallback} callback Node-style callback called with the error, if any, and OrganizationSettings + * @param {google.cloud.securitycenter.v1beta1.IUpdateSourceRequest} request UpdateSourceRequest message or plain object + * @param {google.cloud.securitycenter.v1beta1.SecurityCenter.UpdateSourceCallback} callback Node-style callback called with the error, if any, and Source * @returns {undefined} * @variation 1 */ - Object.defineProperty(SecurityCenter.prototype.getOrganizationSettings = function getOrganizationSettings(request, callback) { - return this.rpcCall(getOrganizationSettings, $root.google.cloud.securitycenter.v1.GetOrganizationSettingsRequest, $root.google.cloud.securitycenter.v1.OrganizationSettings, request, callback); - }, "name", { value: "GetOrganizationSettings" }); + Object.defineProperty(SecurityCenter.prototype.updateSource = function updateSource(request, callback) { + return this.rpcCall(updateSource, $root.google.cloud.securitycenter.v1beta1.UpdateSourceRequest, $root.google.cloud.securitycenter.v1beta1.Source, request, callback); + }, "name", { value: "UpdateSource" }); /** - * Calls GetOrganizationSettings. - * @function getOrganizationSettings - * @memberof google.cloud.securitycenter.v1.SecurityCenter + * Calls UpdateSource. + * @function updateSource + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter * @instance - * @param {google.cloud.securitycenter.v1.IGetOrganizationSettingsRequest} request GetOrganizationSettingsRequest message or plain object - * @returns {Promise} Promise + * @param {google.cloud.securitycenter.v1beta1.IUpdateSourceRequest} request UpdateSourceRequest message or plain object + * @returns {Promise} Promise * @variation 2 */ /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#getSource}. - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @typedef GetSourceCallback + * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter#updateSecurityMarks}. + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @typedef UpdateSecurityMarksCallback * @type {function} * @param {Error|null} error Error, if any - * @param {google.cloud.securitycenter.v1.Source} [response] Source + * @param {google.cloud.securitycenter.v1beta1.SecurityMarks} [response] SecurityMarks */ /** - * Calls GetSource. - * @function getSource - * @memberof google.cloud.securitycenter.v1.SecurityCenter + * Calls UpdateSecurityMarks. + * @function updateSecurityMarks + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter * @instance - * @param {google.cloud.securitycenter.v1.IGetSourceRequest} request GetSourceRequest message or plain object - * @param {google.cloud.securitycenter.v1.SecurityCenter.GetSourceCallback} callback Node-style callback called with the error, if any, and Source + * @param {google.cloud.securitycenter.v1beta1.IUpdateSecurityMarksRequest} request UpdateSecurityMarksRequest message or plain object + * @param {google.cloud.securitycenter.v1beta1.SecurityCenter.UpdateSecurityMarksCallback} callback Node-style callback called with the error, if any, and SecurityMarks * @returns {undefined} * @variation 1 */ - Object.defineProperty(SecurityCenter.prototype.getSource = function getSource(request, callback) { - return this.rpcCall(getSource, $root.google.cloud.securitycenter.v1.GetSourceRequest, $root.google.cloud.securitycenter.v1.Source, request, callback); - }, "name", { value: "GetSource" }); + Object.defineProperty(SecurityCenter.prototype.updateSecurityMarks = function updateSecurityMarks(request, callback) { + return this.rpcCall(updateSecurityMarks, $root.google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest, $root.google.cloud.securitycenter.v1beta1.SecurityMarks, request, callback); + }, "name", { value: "UpdateSecurityMarks" }); /** - * Calls GetSource. - * @function getSource - * @memberof google.cloud.securitycenter.v1.SecurityCenter + * Calls UpdateSecurityMarks. + * @function updateSecurityMarks + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter * @instance - * @param {google.cloud.securitycenter.v1.IGetSourceRequest} request GetSourceRequest message or plain object - * @returns {Promise} Promise + * @param {google.cloud.securitycenter.v1beta1.IUpdateSecurityMarksRequest} request UpdateSecurityMarksRequest message or plain object + * @returns {Promise} Promise * @variation 2 */ + return SecurityCenter; + })(); + + v1beta1.CreateFindingRequest = (function() { + /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#groupAssets}. - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @typedef GroupAssetsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.securitycenter.v1.GroupAssetsResponse} [response] GroupAssetsResponse + * Properties of a CreateFindingRequest. + * @memberof google.cloud.securitycenter.v1beta1 + * @interface ICreateFindingRequest + * @property {string|null} [parent] CreateFindingRequest parent + * @property {string|null} [findingId] CreateFindingRequest findingId + * @property {google.cloud.securitycenter.v1beta1.IFinding|null} [finding] CreateFindingRequest finding */ /** - * Calls GroupAssets. - * @function groupAssets - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1.IGroupAssetsRequest} request GroupAssetsRequest message or plain object - * @param {google.cloud.securitycenter.v1.SecurityCenter.GroupAssetsCallback} callback Node-style callback called with the error, if any, and GroupAssetsResponse - * @returns {undefined} - * @variation 1 + * Constructs a new CreateFindingRequest. + * @memberof google.cloud.securitycenter.v1beta1 + * @classdesc Represents a CreateFindingRequest. + * @implements ICreateFindingRequest + * @constructor + * @param {google.cloud.securitycenter.v1beta1.ICreateFindingRequest=} [properties] Properties to set */ - Object.defineProperty(SecurityCenter.prototype.groupAssets = function groupAssets(request, callback) { - return this.rpcCall(groupAssets, $root.google.cloud.securitycenter.v1.GroupAssetsRequest, $root.google.cloud.securitycenter.v1.GroupAssetsResponse, request, callback); - }, "name", { value: "GroupAssets" }); + function CreateFindingRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } /** - * Calls GroupAssets. - * @function groupAssets - * @memberof google.cloud.securitycenter.v1.SecurityCenter + * CreateFindingRequest parent. + * @member {string} parent + * @memberof google.cloud.securitycenter.v1beta1.CreateFindingRequest * @instance - * @param {google.cloud.securitycenter.v1.IGroupAssetsRequest} request GroupAssetsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 */ + CreateFindingRequest.prototype.parent = ""; /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#groupFindings}. - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @typedef GroupFindingsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.securitycenter.v1.GroupFindingsResponse} [response] GroupFindingsResponse + * CreateFindingRequest findingId. + * @member {string} findingId + * @memberof google.cloud.securitycenter.v1beta1.CreateFindingRequest + * @instance */ + CreateFindingRequest.prototype.findingId = ""; /** - * Calls GroupFindings. - * @function groupFindings - * @memberof google.cloud.securitycenter.v1.SecurityCenter + * CreateFindingRequest finding. + * @member {google.cloud.securitycenter.v1beta1.IFinding|null|undefined} finding + * @memberof google.cloud.securitycenter.v1beta1.CreateFindingRequest * @instance - * @param {google.cloud.securitycenter.v1.IGroupFindingsRequest} request GroupFindingsRequest message or plain object - * @param {google.cloud.securitycenter.v1.SecurityCenter.GroupFindingsCallback} callback Node-style callback called with the error, if any, and GroupFindingsResponse - * @returns {undefined} - * @variation 1 */ - Object.defineProperty(SecurityCenter.prototype.groupFindings = function groupFindings(request, callback) { - return this.rpcCall(groupFindings, $root.google.cloud.securitycenter.v1.GroupFindingsRequest, $root.google.cloud.securitycenter.v1.GroupFindingsResponse, request, callback); - }, "name", { value: "GroupFindings" }); + CreateFindingRequest.prototype.finding = null; /** - * Calls GroupFindings. - * @function groupFindings - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1.IGroupFindingsRequest} request GroupFindingsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Creates a new CreateFindingRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1beta1.CreateFindingRequest + * @static + * @param {google.cloud.securitycenter.v1beta1.ICreateFindingRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1beta1.CreateFindingRequest} CreateFindingRequest instance */ + CreateFindingRequest.create = function create(properties) { + return new CreateFindingRequest(properties); + }; /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#listAssets}. - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @typedef ListAssetsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.securitycenter.v1.ListAssetsResponse} [response] ListAssetsResponse + * Encodes the specified CreateFindingRequest message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.CreateFindingRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1beta1.CreateFindingRequest + * @static + * @param {google.cloud.securitycenter.v1beta1.ICreateFindingRequest} message CreateFindingRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateFindingRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && message.hasOwnProperty("parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.findingId != null && message.hasOwnProperty("findingId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.findingId); + if (message.finding != null && message.hasOwnProperty("finding")) + $root.google.cloud.securitycenter.v1beta1.Finding.encode(message.finding, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateFindingRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.CreateFindingRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1beta1.CreateFindingRequest + * @static + * @param {google.cloud.securitycenter.v1beta1.ICreateFindingRequest} message CreateFindingRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ + CreateFindingRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; /** - * Calls ListAssets. - * @function listAssets - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1.IListAssetsRequest} request ListAssetsRequest message or plain object - * @param {google.cloud.securitycenter.v1.SecurityCenter.ListAssetsCallback} callback Node-style callback called with the error, if any, and ListAssetsResponse - * @returns {undefined} - * @variation 1 + * Decodes a CreateFindingRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1beta1.CreateFindingRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1beta1.CreateFindingRequest} CreateFindingRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Object.defineProperty(SecurityCenter.prototype.listAssets = function listAssets(request, callback) { - return this.rpcCall(listAssets, $root.google.cloud.securitycenter.v1.ListAssetsRequest, $root.google.cloud.securitycenter.v1.ListAssetsResponse, request, callback); - }, "name", { value: "ListAssets" }); + CreateFindingRequest.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.cloud.securitycenter.v1beta1.CreateFindingRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.findingId = reader.string(); + break; + case 3: + message.finding = $root.google.cloud.securitycenter.v1beta1.Finding.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; /** - * Calls ListAssets. - * @function listAssets - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1.IListAssetsRequest} request ListAssetsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Decodes a CreateFindingRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1beta1.CreateFindingRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1beta1.CreateFindingRequest} CreateFindingRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ + CreateFindingRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#listFindings}. - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @typedef ListFindingsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.securitycenter.v1.ListFindingsResponse} [response] ListFindingsResponse + * Verifies a CreateFindingRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1beta1.CreateFindingRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateFindingRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.findingId != null && message.hasOwnProperty("findingId")) + if (!$util.isString(message.findingId)) + return "findingId: string expected"; + if (message.finding != null && message.hasOwnProperty("finding")) { + var error = $root.google.cloud.securitycenter.v1beta1.Finding.verify(message.finding); + if (error) + return "finding." + error; + } + return null; + }; + + /** + * Creates a CreateFindingRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1beta1.CreateFindingRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1beta1.CreateFindingRequest} CreateFindingRequest */ + CreateFindingRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1beta1.CreateFindingRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1beta1.CreateFindingRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.findingId != null) + message.findingId = String(object.findingId); + if (object.finding != null) { + if (typeof object.finding !== "object") + throw TypeError(".google.cloud.securitycenter.v1beta1.CreateFindingRequest.finding: object expected"); + message.finding = $root.google.cloud.securitycenter.v1beta1.Finding.fromObject(object.finding); + } + return message; + }; /** - * Calls ListFindings. - * @function listFindings - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1.IListFindingsRequest} request ListFindingsRequest message or plain object - * @param {google.cloud.securitycenter.v1.SecurityCenter.ListFindingsCallback} callback Node-style callback called with the error, if any, and ListFindingsResponse - * @returns {undefined} - * @variation 1 + * Creates a plain object from a CreateFindingRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1beta1.CreateFindingRequest + * @static + * @param {google.cloud.securitycenter.v1beta1.CreateFindingRequest} message CreateFindingRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object */ - Object.defineProperty(SecurityCenter.prototype.listFindings = function listFindings(request, callback) { - return this.rpcCall(listFindings, $root.google.cloud.securitycenter.v1.ListFindingsRequest, $root.google.cloud.securitycenter.v1.ListFindingsResponse, request, callback); - }, "name", { value: "ListFindings" }); + CreateFindingRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.findingId = ""; + object.finding = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.findingId != null && message.hasOwnProperty("findingId")) + object.findingId = message.findingId; + if (message.finding != null && message.hasOwnProperty("finding")) + object.finding = $root.google.cloud.securitycenter.v1beta1.Finding.toObject(message.finding, options); + return object; + }; /** - * Calls ListFindings. - * @function listFindings - * @memberof google.cloud.securitycenter.v1.SecurityCenter + * Converts this CreateFindingRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1beta1.CreateFindingRequest * @instance - * @param {google.cloud.securitycenter.v1.IListFindingsRequest} request ListFindingsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * @returns {Object.} JSON object */ + CreateFindingRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#listSources}. - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @typedef ListSourcesCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.securitycenter.v1.ListSourcesResponse} [response] ListSourcesResponse - */ + return CreateFindingRequest; + })(); - /** - * Calls ListSources. - * @function listSources - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1.IListSourcesRequest} request ListSourcesRequest message or plain object - * @param {google.cloud.securitycenter.v1.SecurityCenter.ListSourcesCallback} callback Node-style callback called with the error, if any, and ListSourcesResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(SecurityCenter.prototype.listSources = function listSources(request, callback) { - return this.rpcCall(listSources, $root.google.cloud.securitycenter.v1.ListSourcesRequest, $root.google.cloud.securitycenter.v1.ListSourcesResponse, request, callback); - }, "name", { value: "ListSources" }); + v1beta1.CreateSourceRequest = (function() { /** - * Calls ListSources. - * @function listSources - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1.IListSourcesRequest} request ListSourcesRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Properties of a CreateSourceRequest. + * @memberof google.cloud.securitycenter.v1beta1 + * @interface ICreateSourceRequest + * @property {string|null} [parent] CreateSourceRequest parent + * @property {google.cloud.securitycenter.v1beta1.ISource|null} [source] CreateSourceRequest source */ /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#runAssetDiscovery}. - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @typedef RunAssetDiscoveryCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation + * Constructs a new CreateSourceRequest. + * @memberof google.cloud.securitycenter.v1beta1 + * @classdesc Represents a CreateSourceRequest. + * @implements ICreateSourceRequest + * @constructor + * @param {google.cloud.securitycenter.v1beta1.ICreateSourceRequest=} [properties] Properties to set */ + function CreateSourceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } /** - * Calls RunAssetDiscovery. - * @function runAssetDiscovery - * @memberof google.cloud.securitycenter.v1.SecurityCenter + * CreateSourceRequest parent. + * @member {string} parent + * @memberof google.cloud.securitycenter.v1beta1.CreateSourceRequest * @instance - * @param {google.cloud.securitycenter.v1.IRunAssetDiscoveryRequest} request RunAssetDiscoveryRequest message or plain object - * @param {google.cloud.securitycenter.v1.SecurityCenter.RunAssetDiscoveryCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 */ - Object.defineProperty(SecurityCenter.prototype.runAssetDiscovery = function runAssetDiscovery(request, callback) { - return this.rpcCall(runAssetDiscovery, $root.google.cloud.securitycenter.v1.RunAssetDiscoveryRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "RunAssetDiscovery" }); + CreateSourceRequest.prototype.parent = ""; /** - * Calls RunAssetDiscovery. - * @function runAssetDiscovery - * @memberof google.cloud.securitycenter.v1.SecurityCenter + * CreateSourceRequest source. + * @member {google.cloud.securitycenter.v1beta1.ISource|null|undefined} source + * @memberof google.cloud.securitycenter.v1beta1.CreateSourceRequest * @instance - * @param {google.cloud.securitycenter.v1.IRunAssetDiscoveryRequest} request RunAssetDiscoveryRequest message or plain object - * @returns {Promise} Promise - * @variation 2 */ + CreateSourceRequest.prototype.source = null; /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#setFindingState}. - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @typedef SetFindingStateCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.securitycenter.v1.Finding} [response] Finding + * Creates a new CreateSourceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1beta1.CreateSourceRequest + * @static + * @param {google.cloud.securitycenter.v1beta1.ICreateSourceRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1beta1.CreateSourceRequest} CreateSourceRequest instance */ + CreateSourceRequest.create = function create(properties) { + return new CreateSourceRequest(properties); + }; /** - * Calls SetFindingState. - * @function setFindingState - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1.ISetFindingStateRequest} request SetFindingStateRequest message or plain object - * @param {google.cloud.securitycenter.v1.SecurityCenter.SetFindingStateCallback} callback Node-style callback called with the error, if any, and Finding - * @returns {undefined} - * @variation 1 + * Encodes the specified CreateSourceRequest message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.CreateSourceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1beta1.CreateSourceRequest + * @static + * @param {google.cloud.securitycenter.v1beta1.ICreateSourceRequest} message CreateSourceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - Object.defineProperty(SecurityCenter.prototype.setFindingState = function setFindingState(request, callback) { - return this.rpcCall(setFindingState, $root.google.cloud.securitycenter.v1.SetFindingStateRequest, $root.google.cloud.securitycenter.v1.Finding, request, callback); - }, "name", { value: "SetFindingState" }); + CreateSourceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && message.hasOwnProperty("parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.source != null && message.hasOwnProperty("source")) + $root.google.cloud.securitycenter.v1beta1.Source.encode(message.source, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; /** - * Calls SetFindingState. - * @function setFindingState - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1.ISetFindingStateRequest} request SetFindingStateRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Encodes the specified CreateSourceRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.CreateSourceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1beta1.CreateSourceRequest + * @static + * @param {google.cloud.securitycenter.v1beta1.ICreateSourceRequest} message CreateSourceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ + CreateSourceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#setIamPolicy}. - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @typedef SetIamPolicyCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.iam.v1.Policy} [response] Policy + * Decodes a CreateSourceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1beta1.CreateSourceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1beta1.CreateSourceRequest} CreateSourceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ + CreateSourceRequest.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.cloud.securitycenter.v1beta1.CreateSourceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.source = $root.google.cloud.securitycenter.v1beta1.Source.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; /** - * Calls SetIamPolicy. - * @function setIamPolicy - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @instance - * @param {google.iam.v1.ISetIamPolicyRequest} request SetIamPolicyRequest message or plain object - * @param {google.cloud.securitycenter.v1.SecurityCenter.SetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy - * @returns {undefined} - * @variation 1 + * Decodes a CreateSourceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1beta1.CreateSourceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1beta1.CreateSourceRequest} CreateSourceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Object.defineProperty(SecurityCenter.prototype.setIamPolicy = function setIamPolicy(request, callback) { - return this.rpcCall(setIamPolicy, $root.google.iam.v1.SetIamPolicyRequest, $root.google.iam.v1.Policy, request, callback); - }, "name", { value: "SetIamPolicy" }); + CreateSourceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; /** - * Calls SetIamPolicy. - * @function setIamPolicy - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @instance - * @param {google.iam.v1.ISetIamPolicyRequest} request SetIamPolicyRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Verifies a CreateSourceRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1beta1.CreateSourceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not */ + CreateSourceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.source != null && message.hasOwnProperty("source")) { + var error = $root.google.cloud.securitycenter.v1beta1.Source.verify(message.source); + if (error) + return "source." + error; + } + return null; + }; /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#testIamPermissions}. - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @typedef TestIamPermissionsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.iam.v1.TestIamPermissionsResponse} [response] TestIamPermissionsResponse + * Creates a CreateSourceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1beta1.CreateSourceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1beta1.CreateSourceRequest} CreateSourceRequest */ + CreateSourceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1beta1.CreateSourceRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1beta1.CreateSourceRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.source != null) { + if (typeof object.source !== "object") + throw TypeError(".google.cloud.securitycenter.v1beta1.CreateSourceRequest.source: object expected"); + message.source = $root.google.cloud.securitycenter.v1beta1.Source.fromObject(object.source); + } + return message; + }; /** - * Calls TestIamPermissions. - * @function testIamPermissions - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @instance - * @param {google.iam.v1.ITestIamPermissionsRequest} request TestIamPermissionsRequest message or plain object - * @param {google.cloud.securitycenter.v1.SecurityCenter.TestIamPermissionsCallback} callback Node-style callback called with the error, if any, and TestIamPermissionsResponse - * @returns {undefined} - * @variation 1 + * Creates a plain object from a CreateSourceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1beta1.CreateSourceRequest + * @static + * @param {google.cloud.securitycenter.v1beta1.CreateSourceRequest} message CreateSourceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object */ - Object.defineProperty(SecurityCenter.prototype.testIamPermissions = function testIamPermissions(request, callback) { - return this.rpcCall(testIamPermissions, $root.google.iam.v1.TestIamPermissionsRequest, $root.google.iam.v1.TestIamPermissionsResponse, request, callback); - }, "name", { value: "TestIamPermissions" }); + CreateSourceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.source = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.source != null && message.hasOwnProperty("source")) + object.source = $root.google.cloud.securitycenter.v1beta1.Source.toObject(message.source, options); + return object; + }; /** - * Calls TestIamPermissions. - * @function testIamPermissions - * @memberof google.cloud.securitycenter.v1.SecurityCenter + * Converts this CreateSourceRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1beta1.CreateSourceRequest * @instance - * @param {google.iam.v1.ITestIamPermissionsRequest} request TestIamPermissionsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * @returns {Object.} JSON object */ + CreateSourceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return CreateSourceRequest; + })(); + + v1beta1.GetOrganizationSettingsRequest = (function() { /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#updateFinding}. - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @typedef UpdateFindingCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.securitycenter.v1.Finding} [response] Finding + * Properties of a GetOrganizationSettingsRequest. + * @memberof google.cloud.securitycenter.v1beta1 + * @interface IGetOrganizationSettingsRequest + * @property {string|null} [name] GetOrganizationSettingsRequest name */ /** - * Calls UpdateFinding. - * @function updateFinding - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1.IUpdateFindingRequest} request UpdateFindingRequest message or plain object - * @param {google.cloud.securitycenter.v1.SecurityCenter.UpdateFindingCallback} callback Node-style callback called with the error, if any, and Finding - * @returns {undefined} - * @variation 1 + * Constructs a new GetOrganizationSettingsRequest. + * @memberof google.cloud.securitycenter.v1beta1 + * @classdesc Represents a GetOrganizationSettingsRequest. + * @implements IGetOrganizationSettingsRequest + * @constructor + * @param {google.cloud.securitycenter.v1beta1.IGetOrganizationSettingsRequest=} [properties] Properties to set */ - Object.defineProperty(SecurityCenter.prototype.updateFinding = function updateFinding(request, callback) { - return this.rpcCall(updateFinding, $root.google.cloud.securitycenter.v1.UpdateFindingRequest, $root.google.cloud.securitycenter.v1.Finding, request, callback); - }, "name", { value: "UpdateFinding" }); + function GetOrganizationSettingsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } /** - * Calls UpdateFinding. - * @function updateFinding - * @memberof google.cloud.securitycenter.v1.SecurityCenter + * GetOrganizationSettingsRequest name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest * @instance - * @param {google.cloud.securitycenter.v1.IUpdateFindingRequest} request UpdateFindingRequest message or plain object - * @returns {Promise} Promise - * @variation 2 */ + GetOrganizationSettingsRequest.prototype.name = ""; /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#updateOrganizationSettings}. - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @typedef UpdateOrganizationSettingsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.securitycenter.v1.OrganizationSettings} [response] OrganizationSettings + * Creates a new GetOrganizationSettingsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest + * @static + * @param {google.cloud.securitycenter.v1beta1.IGetOrganizationSettingsRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest} GetOrganizationSettingsRequest instance */ + GetOrganizationSettingsRequest.create = function create(properties) { + return new GetOrganizationSettingsRequest(properties); + }; /** - * Calls UpdateOrganizationSettings. - * @function updateOrganizationSettings - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1.IUpdateOrganizationSettingsRequest} request UpdateOrganizationSettingsRequest message or plain object - * @param {google.cloud.securitycenter.v1.SecurityCenter.UpdateOrganizationSettingsCallback} callback Node-style callback called with the error, if any, and OrganizationSettings - * @returns {undefined} - * @variation 1 + * Encodes the specified GetOrganizationSettingsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest + * @static + * @param {google.cloud.securitycenter.v1beta1.IGetOrganizationSettingsRequest} message GetOrganizationSettingsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - Object.defineProperty(SecurityCenter.prototype.updateOrganizationSettings = function updateOrganizationSettings(request, callback) { - return this.rpcCall(updateOrganizationSettings, $root.google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest, $root.google.cloud.securitycenter.v1.OrganizationSettings, request, callback); - }, "name", { value: "UpdateOrganizationSettings" }); + GetOrganizationSettingsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; /** - * Calls UpdateOrganizationSettings. - * @function updateOrganizationSettings - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1.IUpdateOrganizationSettingsRequest} request UpdateOrganizationSettingsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Encodes the specified GetOrganizationSettingsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest + * @static + * @param {google.cloud.securitycenter.v1beta1.IGetOrganizationSettingsRequest} message GetOrganizationSettingsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ + GetOrganizationSettingsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#updateSource}. - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @typedef UpdateSourceCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.securitycenter.v1.Source} [response] Source + * Decodes a GetOrganizationSettingsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest} GetOrganizationSettingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ + GetOrganizationSettingsRequest.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.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest(); + 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; + }; /** - * Calls UpdateSource. - * @function updateSource - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1.IUpdateSourceRequest} request UpdateSourceRequest message or plain object - * @param {google.cloud.securitycenter.v1.SecurityCenter.UpdateSourceCallback} callback Node-style callback called with the error, if any, and Source - * @returns {undefined} - * @variation 1 + * Decodes a GetOrganizationSettingsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest} GetOrganizationSettingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Object.defineProperty(SecurityCenter.prototype.updateSource = function updateSource(request, callback) { - return this.rpcCall(updateSource, $root.google.cloud.securitycenter.v1.UpdateSourceRequest, $root.google.cloud.securitycenter.v1.Source, request, callback); - }, "name", { value: "UpdateSource" }); - - /** - * Calls UpdateSource. - * @function updateSource - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1.IUpdateSourceRequest} request UpdateSourceRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + GetOrganizationSettingsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetOrganizationSettingsRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not */ + GetOrganizationSettingsRequest.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; + }; /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#updateSecurityMarks}. - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @typedef UpdateSecurityMarksCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.securitycenter.v1.SecurityMarks} [response] SecurityMarks + * Creates a GetOrganizationSettingsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest} GetOrganizationSettingsRequest */ + GetOrganizationSettingsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; /** - * Calls UpdateSecurityMarks. - * @function updateSecurityMarks - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1.IUpdateSecurityMarksRequest} request UpdateSecurityMarksRequest message or plain object - * @param {google.cloud.securitycenter.v1.SecurityCenter.UpdateSecurityMarksCallback} callback Node-style callback called with the error, if any, and SecurityMarks - * @returns {undefined} - * @variation 1 + * Creates a plain object from a GetOrganizationSettingsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest + * @static + * @param {google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest} message GetOrganizationSettingsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object */ - Object.defineProperty(SecurityCenter.prototype.updateSecurityMarks = function updateSecurityMarks(request, callback) { - return this.rpcCall(updateSecurityMarks, $root.google.cloud.securitycenter.v1.UpdateSecurityMarksRequest, $root.google.cloud.securitycenter.v1.SecurityMarks, request, callback); - }, "name", { value: "UpdateSecurityMarks" }); + GetOrganizationSettingsRequest.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; + }; /** - * Calls UpdateSecurityMarks. - * @function updateSecurityMarks - * @memberof google.cloud.securitycenter.v1.SecurityCenter + * Converts this GetOrganizationSettingsRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest * @instance - * @param {google.cloud.securitycenter.v1.IUpdateSecurityMarksRequest} request UpdateSecurityMarksRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * @returns {Object.} JSON object */ + GetOrganizationSettingsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - return SecurityCenter; + return GetOrganizationSettingsRequest; })(); - v1.CreateFindingRequest = (function() { + v1beta1.GetSourceRequest = (function() { /** - * Properties of a CreateFindingRequest. - * @memberof google.cloud.securitycenter.v1 - * @interface ICreateFindingRequest - * @property {string|null} [parent] CreateFindingRequest parent - * @property {string|null} [findingId] CreateFindingRequest findingId - * @property {google.cloud.securitycenter.v1.IFinding|null} [finding] CreateFindingRequest finding + * Properties of a GetSourceRequest. + * @memberof google.cloud.securitycenter.v1beta1 + * @interface IGetSourceRequest + * @property {string|null} [name] GetSourceRequest name */ /** - * Constructs a new CreateFindingRequest. - * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents a CreateFindingRequest. - * @implements ICreateFindingRequest + * Constructs a new GetSourceRequest. + * @memberof google.cloud.securitycenter.v1beta1 + * @classdesc Represents a GetSourceRequest. + * @implements IGetSourceRequest * @constructor - * @param {google.cloud.securitycenter.v1.ICreateFindingRequest=} [properties] Properties to set + * @param {google.cloud.securitycenter.v1beta1.IGetSourceRequest=} [properties] Properties to set */ - function CreateFindingRequest(properties) { + function GetSourceRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -3322,101 +12898,75 @@ } /** - * CreateFindingRequest parent. - * @member {string} parent - * @memberof google.cloud.securitycenter.v1.CreateFindingRequest - * @instance - */ - CreateFindingRequest.prototype.parent = ""; - - /** - * CreateFindingRequest findingId. - * @member {string} findingId - * @memberof google.cloud.securitycenter.v1.CreateFindingRequest - * @instance - */ - CreateFindingRequest.prototype.findingId = ""; - - /** - * CreateFindingRequest finding. - * @member {google.cloud.securitycenter.v1.IFinding|null|undefined} finding - * @memberof google.cloud.securitycenter.v1.CreateFindingRequest + * GetSourceRequest name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1beta1.GetSourceRequest * @instance */ - CreateFindingRequest.prototype.finding = null; + GetSourceRequest.prototype.name = ""; /** - * Creates a new CreateFindingRequest instance using the specified properties. + * Creates a new GetSourceRequest instance using the specified properties. * @function create - * @memberof google.cloud.securitycenter.v1.CreateFindingRequest + * @memberof google.cloud.securitycenter.v1beta1.GetSourceRequest * @static - * @param {google.cloud.securitycenter.v1.ICreateFindingRequest=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.CreateFindingRequest} CreateFindingRequest instance + * @param {google.cloud.securitycenter.v1beta1.IGetSourceRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1beta1.GetSourceRequest} GetSourceRequest instance */ - CreateFindingRequest.create = function create(properties) { - return new CreateFindingRequest(properties); + GetSourceRequest.create = function create(properties) { + return new GetSourceRequest(properties); }; /** - * Encodes the specified CreateFindingRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.CreateFindingRequest.verify|verify} messages. + * Encodes the specified GetSourceRequest message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.GetSourceRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.securitycenter.v1.CreateFindingRequest + * @memberof google.cloud.securitycenter.v1beta1.GetSourceRequest * @static - * @param {google.cloud.securitycenter.v1.ICreateFindingRequest} message CreateFindingRequest message or plain object to encode + * @param {google.cloud.securitycenter.v1beta1.IGetSourceRequest} message GetSourceRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateFindingRequest.encode = function encode(message, writer) { + GetSourceRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && message.hasOwnProperty("parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.findingId != null && message.hasOwnProperty("findingId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.findingId); - if (message.finding != null && message.hasOwnProperty("finding")) - $root.google.cloud.securitycenter.v1.Finding.encode(message.finding, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; /** - * Encodes the specified CreateFindingRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.CreateFindingRequest.verify|verify} messages. + * Encodes the specified GetSourceRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.GetSourceRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.CreateFindingRequest + * @memberof google.cloud.securitycenter.v1beta1.GetSourceRequest * @static - * @param {google.cloud.securitycenter.v1.ICreateFindingRequest} message CreateFindingRequest message or plain object to encode + * @param {google.cloud.securitycenter.v1beta1.IGetSourceRequest} message GetSourceRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateFindingRequest.encodeDelimited = function encodeDelimited(message, writer) { + GetSourceRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a CreateFindingRequest message from the specified reader or buffer. + * Decodes a GetSourceRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.securitycenter.v1.CreateFindingRequest + * @memberof google.cloud.securitycenter.v1beta1.GetSourceRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.CreateFindingRequest} CreateFindingRequest + * @returns {google.cloud.securitycenter.v1beta1.GetSourceRequest} GetSourceRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateFindingRequest.decode = function decode(reader, length) { + GetSourceRequest.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.cloud.securitycenter.v1.CreateFindingRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1beta1.GetSourceRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.parent = reader.string(); - break; - case 2: - message.findingId = reader.string(); - break; - case 3: - message.finding = $root.google.cloud.securitycenter.v1.Finding.decode(reader, reader.uint32()); + message.name = reader.string(); break; default: reader.skipType(tag & 7); @@ -3427,130 +12977,113 @@ }; /** - * Decodes a CreateFindingRequest message from the specified reader or buffer, length delimited. + * Decodes a GetSourceRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.CreateFindingRequest + * @memberof google.cloud.securitycenter.v1beta1.GetSourceRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.CreateFindingRequest} CreateFindingRequest + * @returns {google.cloud.securitycenter.v1beta1.GetSourceRequest} GetSourceRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateFindingRequest.decodeDelimited = function decodeDelimited(reader) { + GetSourceRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a CreateFindingRequest message. + * Verifies a GetSourceRequest message. * @function verify - * @memberof google.cloud.securitycenter.v1.CreateFindingRequest + * @memberof google.cloud.securitycenter.v1beta1.GetSourceRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - CreateFindingRequest.verify = function verify(message) { + GetSourceRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.findingId != null && message.hasOwnProperty("findingId")) - if (!$util.isString(message.findingId)) - return "findingId: string expected"; - if (message.finding != null && message.hasOwnProperty("finding")) { - var error = $root.google.cloud.securitycenter.v1.Finding.verify(message.finding); - if (error) - return "finding." + error; - } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; return null; }; /** - * Creates a CreateFindingRequest message from a plain object. Also converts values to their respective internal types. + * Creates a GetSourceRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.securitycenter.v1.CreateFindingRequest + * @memberof google.cloud.securitycenter.v1beta1.GetSourceRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.CreateFindingRequest} CreateFindingRequest + * @returns {google.cloud.securitycenter.v1beta1.GetSourceRequest} GetSourceRequest */ - CreateFindingRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.CreateFindingRequest) + GetSourceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1beta1.GetSourceRequest) return object; - var message = new $root.google.cloud.securitycenter.v1.CreateFindingRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.findingId != null) - message.findingId = String(object.findingId); - if (object.finding != null) { - if (typeof object.finding !== "object") - throw TypeError(".google.cloud.securitycenter.v1.CreateFindingRequest.finding: object expected"); - message.finding = $root.google.cloud.securitycenter.v1.Finding.fromObject(object.finding); - } + var message = new $root.google.cloud.securitycenter.v1beta1.GetSourceRequest(); + if (object.name != null) + message.name = String(object.name); return message; }; /** - * Creates a plain object from a CreateFindingRequest message. Also converts values to other types if specified. + * Creates a plain object from a GetSourceRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.securitycenter.v1.CreateFindingRequest + * @memberof google.cloud.securitycenter.v1beta1.GetSourceRequest * @static - * @param {google.cloud.securitycenter.v1.CreateFindingRequest} message CreateFindingRequest + * @param {google.cloud.securitycenter.v1beta1.GetSourceRequest} message GetSourceRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CreateFindingRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.findingId = ""; - object.finding = null; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.findingId != null && message.hasOwnProperty("findingId")) - object.findingId = message.findingId; - if (message.finding != null && message.hasOwnProperty("finding")) - object.finding = $root.google.cloud.securitycenter.v1.Finding.toObject(message.finding, options); + GetSourceRequest.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 CreateFindingRequest to JSON. + * Converts this GetSourceRequest to JSON. * @function toJSON - * @memberof google.cloud.securitycenter.v1.CreateFindingRequest + * @memberof google.cloud.securitycenter.v1beta1.GetSourceRequest * @instance * @returns {Object.} JSON object */ - CreateFindingRequest.prototype.toJSON = function toJSON() { + GetSourceRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return CreateFindingRequest; + return GetSourceRequest; })(); - v1.CreateSourceRequest = (function() { + v1beta1.GroupAssetsRequest = (function() { /** - * Properties of a CreateSourceRequest. - * @memberof google.cloud.securitycenter.v1 - * @interface ICreateSourceRequest - * @property {string|null} [parent] CreateSourceRequest parent - * @property {google.cloud.securitycenter.v1.ISource|null} [source] CreateSourceRequest source + * Properties of a GroupAssetsRequest. + * @memberof google.cloud.securitycenter.v1beta1 + * @interface IGroupAssetsRequest + * @property {string|null} [parent] GroupAssetsRequest parent + * @property {string|null} [filter] GroupAssetsRequest filter + * @property {string|null} [groupBy] GroupAssetsRequest groupBy + * @property {google.protobuf.IDuration|null} [compareDuration] GroupAssetsRequest compareDuration + * @property {google.protobuf.ITimestamp|null} [readTime] GroupAssetsRequest readTime + * @property {string|null} [pageToken] GroupAssetsRequest pageToken + * @property {number|null} [pageSize] GroupAssetsRequest pageSize */ /** - * Constructs a new CreateSourceRequest. - * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents a CreateSourceRequest. - * @implements ICreateSourceRequest + * Constructs a new GroupAssetsRequest. + * @memberof google.cloud.securitycenter.v1beta1 + * @classdesc Represents a GroupAssetsRequest. + * @implements IGroupAssetsRequest * @constructor - * @param {google.cloud.securitycenter.v1.ICreateSourceRequest=} [properties] Properties to set + * @param {google.cloud.securitycenter.v1beta1.IGroupAssetsRequest=} [properties] Properties to set */ - function CreateSourceRequest(properties) { + function GroupAssetsRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -3558,80 +13091,130 @@ } /** - * CreateSourceRequest parent. + * GroupAssetsRequest parent. * @member {string} parent - * @memberof google.cloud.securitycenter.v1.CreateSourceRequest + * @memberof google.cloud.securitycenter.v1beta1.GroupAssetsRequest * @instance */ - CreateSourceRequest.prototype.parent = ""; + GroupAssetsRequest.prototype.parent = ""; /** - * CreateSourceRequest source. - * @member {google.cloud.securitycenter.v1.ISource|null|undefined} source - * @memberof google.cloud.securitycenter.v1.CreateSourceRequest + * GroupAssetsRequest filter. + * @member {string} filter + * @memberof google.cloud.securitycenter.v1beta1.GroupAssetsRequest * @instance */ - CreateSourceRequest.prototype.source = null; + GroupAssetsRequest.prototype.filter = ""; /** - * Creates a new CreateSourceRequest instance using the specified properties. + * GroupAssetsRequest groupBy. + * @member {string} groupBy + * @memberof google.cloud.securitycenter.v1beta1.GroupAssetsRequest + * @instance + */ + GroupAssetsRequest.prototype.groupBy = ""; + + /** + * GroupAssetsRequest compareDuration. + * @member {google.protobuf.IDuration|null|undefined} compareDuration + * @memberof google.cloud.securitycenter.v1beta1.GroupAssetsRequest + * @instance + */ + GroupAssetsRequest.prototype.compareDuration = null; + + /** + * GroupAssetsRequest readTime. + * @member {google.protobuf.ITimestamp|null|undefined} readTime + * @memberof google.cloud.securitycenter.v1beta1.GroupAssetsRequest + * @instance + */ + GroupAssetsRequest.prototype.readTime = null; + + /** + * GroupAssetsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.securitycenter.v1beta1.GroupAssetsRequest + * @instance + */ + GroupAssetsRequest.prototype.pageToken = ""; + + /** + * GroupAssetsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.securitycenter.v1beta1.GroupAssetsRequest + * @instance + */ + GroupAssetsRequest.prototype.pageSize = 0; + + /** + * Creates a new GroupAssetsRequest instance using the specified properties. * @function create - * @memberof google.cloud.securitycenter.v1.CreateSourceRequest + * @memberof google.cloud.securitycenter.v1beta1.GroupAssetsRequest * @static - * @param {google.cloud.securitycenter.v1.ICreateSourceRequest=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.CreateSourceRequest} CreateSourceRequest instance + * @param {google.cloud.securitycenter.v1beta1.IGroupAssetsRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1beta1.GroupAssetsRequest} GroupAssetsRequest instance */ - CreateSourceRequest.create = function create(properties) { - return new CreateSourceRequest(properties); + GroupAssetsRequest.create = function create(properties) { + return new GroupAssetsRequest(properties); }; /** - * Encodes the specified CreateSourceRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.CreateSourceRequest.verify|verify} messages. + * Encodes the specified GroupAssetsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.GroupAssetsRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.securitycenter.v1.CreateSourceRequest + * @memberof google.cloud.securitycenter.v1beta1.GroupAssetsRequest * @static - * @param {google.cloud.securitycenter.v1.ICreateSourceRequest} message CreateSourceRequest message or plain object to encode + * @param {google.cloud.securitycenter.v1beta1.IGroupAssetsRequest} message GroupAssetsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateSourceRequest.encode = function encode(message, writer) { + GroupAssetsRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.parent != null && message.hasOwnProperty("parent")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.source != null && message.hasOwnProperty("source")) - $root.google.cloud.securitycenter.v1.Source.encode(message.source, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.filter != null && message.hasOwnProperty("filter")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); + if (message.groupBy != null && message.hasOwnProperty("groupBy")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.groupBy); + if (message.compareDuration != null && message.hasOwnProperty("compareDuration")) + $root.google.protobuf.Duration.encode(message.compareDuration, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.readTime != null && message.hasOwnProperty("readTime")) + $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.pageToken); + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.pageSize); return writer; }; /** - * Encodes the specified CreateSourceRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.CreateSourceRequest.verify|verify} messages. + * Encodes the specified GroupAssetsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.GroupAssetsRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.CreateSourceRequest + * @memberof google.cloud.securitycenter.v1beta1.GroupAssetsRequest * @static - * @param {google.cloud.securitycenter.v1.ICreateSourceRequest} message CreateSourceRequest message or plain object to encode + * @param {google.cloud.securitycenter.v1beta1.IGroupAssetsRequest} message GroupAssetsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateSourceRequest.encodeDelimited = function encodeDelimited(message, writer) { + GroupAssetsRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a CreateSourceRequest message from the specified reader or buffer. + * Decodes a GroupAssetsRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.securitycenter.v1.CreateSourceRequest + * @memberof google.cloud.securitycenter.v1beta1.GroupAssetsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.CreateSourceRequest} CreateSourceRequest + * @returns {google.cloud.securitycenter.v1beta1.GroupAssetsRequest} GroupAssetsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateSourceRequest.decode = function decode(reader, length) { + GroupAssetsRequest.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.cloud.securitycenter.v1.CreateSourceRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1beta1.GroupAssetsRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -3639,7 +13222,22 @@ message.parent = reader.string(); break; case 2: - message.source = $root.google.cloud.securitycenter.v1.Source.decode(reader, reader.uint32()); + message.filter = reader.string(); + break; + case 3: + message.groupBy = reader.string(); + break; + case 4: + message.compareDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + case 5: + message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 7: + message.pageToken = reader.string(); + break; + case 8: + message.pageSize = reader.int32(); break; default: reader.skipType(tag & 7); @@ -3650,121 +13248,169 @@ }; /** - * Decodes a CreateSourceRequest message from the specified reader or buffer, length delimited. + * Decodes a GroupAssetsRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.CreateSourceRequest + * @memberof google.cloud.securitycenter.v1beta1.GroupAssetsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.CreateSourceRequest} CreateSourceRequest + * @returns {google.cloud.securitycenter.v1beta1.GroupAssetsRequest} GroupAssetsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateSourceRequest.decodeDelimited = function decodeDelimited(reader) { + GroupAssetsRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a CreateSourceRequest message. + * Verifies a GroupAssetsRequest message. * @function verify - * @memberof google.cloud.securitycenter.v1.CreateSourceRequest + * @memberof google.cloud.securitycenter.v1beta1.GroupAssetsRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - CreateSourceRequest.verify = function verify(message) { + GroupAssetsRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.parent != null && message.hasOwnProperty("parent")) if (!$util.isString(message.parent)) return "parent: string expected"; - if (message.source != null && message.hasOwnProperty("source")) { - var error = $root.google.cloud.securitycenter.v1.Source.verify(message.source); + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.groupBy != null && message.hasOwnProperty("groupBy")) + if (!$util.isString(message.groupBy)) + return "groupBy: string expected"; + if (message.compareDuration != null && message.hasOwnProperty("compareDuration")) { + var error = $root.google.protobuf.Duration.verify(message.compareDuration); if (error) - return "source." + error; + return "compareDuration." + error; + } + if (message.readTime != null && message.hasOwnProperty("readTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.readTime); + if (error) + return "readTime." + error; } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; return null; }; /** - * Creates a CreateSourceRequest message from a plain object. Also converts values to their respective internal types. + * Creates a GroupAssetsRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.securitycenter.v1.CreateSourceRequest + * @memberof google.cloud.securitycenter.v1beta1.GroupAssetsRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.CreateSourceRequest} CreateSourceRequest + * @returns {google.cloud.securitycenter.v1beta1.GroupAssetsRequest} GroupAssetsRequest */ - CreateSourceRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.CreateSourceRequest) + GroupAssetsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1beta1.GroupAssetsRequest) return object; - var message = new $root.google.cloud.securitycenter.v1.CreateSourceRequest(); + var message = new $root.google.cloud.securitycenter.v1beta1.GroupAssetsRequest(); if (object.parent != null) message.parent = String(object.parent); - if (object.source != null) { - if (typeof object.source !== "object") - throw TypeError(".google.cloud.securitycenter.v1.CreateSourceRequest.source: object expected"); - message.source = $root.google.cloud.securitycenter.v1.Source.fromObject(object.source); + if (object.filter != null) + message.filter = String(object.filter); + if (object.groupBy != null) + message.groupBy = String(object.groupBy); + if (object.compareDuration != null) { + if (typeof object.compareDuration !== "object") + throw TypeError(".google.cloud.securitycenter.v1beta1.GroupAssetsRequest.compareDuration: object expected"); + message.compareDuration = $root.google.protobuf.Duration.fromObject(object.compareDuration); + } + if (object.readTime != null) { + if (typeof object.readTime !== "object") + throw TypeError(".google.cloud.securitycenter.v1beta1.GroupAssetsRequest.readTime: object expected"); + message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); } + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; return message; }; /** - * Creates a plain object from a CreateSourceRequest message. Also converts values to other types if specified. + * Creates a plain object from a GroupAssetsRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.securitycenter.v1.CreateSourceRequest + * @memberof google.cloud.securitycenter.v1beta1.GroupAssetsRequest * @static - * @param {google.cloud.securitycenter.v1.CreateSourceRequest} message CreateSourceRequest + * @param {google.cloud.securitycenter.v1beta1.GroupAssetsRequest} message GroupAssetsRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CreateSourceRequest.toObject = function toObject(message, options) { + GroupAssetsRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { object.parent = ""; - object.source = null; + object.filter = ""; + object.groupBy = ""; + object.compareDuration = null; + object.readTime = null; + object.pageToken = ""; + object.pageSize = 0; } if (message.parent != null && message.hasOwnProperty("parent")) object.parent = message.parent; - if (message.source != null && message.hasOwnProperty("source")) - object.source = $root.google.cloud.securitycenter.v1.Source.toObject(message.source, options); + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.groupBy != null && message.hasOwnProperty("groupBy")) + object.groupBy = message.groupBy; + if (message.compareDuration != null && message.hasOwnProperty("compareDuration")) + object.compareDuration = $root.google.protobuf.Duration.toObject(message.compareDuration, options); + if (message.readTime != null && message.hasOwnProperty("readTime")) + object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; return object; }; /** - * Converts this CreateSourceRequest to JSON. + * Converts this GroupAssetsRequest to JSON. * @function toJSON - * @memberof google.cloud.securitycenter.v1.CreateSourceRequest + * @memberof google.cloud.securitycenter.v1beta1.GroupAssetsRequest * @instance * @returns {Object.} JSON object */ - CreateSourceRequest.prototype.toJSON = function toJSON() { + GroupAssetsRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return CreateSourceRequest; + return GroupAssetsRequest; })(); - v1.GetOrganizationSettingsRequest = (function() { + v1beta1.GroupAssetsResponse = (function() { /** - * Properties of a GetOrganizationSettingsRequest. - * @memberof google.cloud.securitycenter.v1 - * @interface IGetOrganizationSettingsRequest - * @property {string|null} [name] GetOrganizationSettingsRequest name + * Properties of a GroupAssetsResponse. + * @memberof google.cloud.securitycenter.v1beta1 + * @interface IGroupAssetsResponse + * @property {Array.|null} [groupByResults] GroupAssetsResponse groupByResults + * @property {google.protobuf.ITimestamp|null} [readTime] GroupAssetsResponse readTime + * @property {string|null} [nextPageToken] GroupAssetsResponse nextPageToken */ /** - * Constructs a new GetOrganizationSettingsRequest. - * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents a GetOrganizationSettingsRequest. - * @implements IGetOrganizationSettingsRequest + * Constructs a new GroupAssetsResponse. + * @memberof google.cloud.securitycenter.v1beta1 + * @classdesc Represents a GroupAssetsResponse. + * @implements IGroupAssetsResponse * @constructor - * @param {google.cloud.securitycenter.v1.IGetOrganizationSettingsRequest=} [properties] Properties to set + * @param {google.cloud.securitycenter.v1beta1.IGroupAssetsResponse=} [properties] Properties to set */ - function GetOrganizationSettingsRequest(properties) { + function GroupAssetsResponse(properties) { + this.groupByResults = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -3772,75 +13418,104 @@ } /** - * GetOrganizationSettingsRequest name. - * @member {string} name - * @memberof google.cloud.securitycenter.v1.GetOrganizationSettingsRequest + * GroupAssetsResponse groupByResults. + * @member {Array.} groupByResults + * @memberof google.cloud.securitycenter.v1beta1.GroupAssetsResponse * @instance */ - GetOrganizationSettingsRequest.prototype.name = ""; + GroupAssetsResponse.prototype.groupByResults = $util.emptyArray; /** - * Creates a new GetOrganizationSettingsRequest instance using the specified properties. + * GroupAssetsResponse readTime. + * @member {google.protobuf.ITimestamp|null|undefined} readTime + * @memberof google.cloud.securitycenter.v1beta1.GroupAssetsResponse + * @instance + */ + GroupAssetsResponse.prototype.readTime = null; + + /** + * GroupAssetsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.securitycenter.v1beta1.GroupAssetsResponse + * @instance + */ + GroupAssetsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new GroupAssetsResponse instance using the specified properties. * @function create - * @memberof google.cloud.securitycenter.v1.GetOrganizationSettingsRequest + * @memberof google.cloud.securitycenter.v1beta1.GroupAssetsResponse * @static - * @param {google.cloud.securitycenter.v1.IGetOrganizationSettingsRequest=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.GetOrganizationSettingsRequest} GetOrganizationSettingsRequest instance + * @param {google.cloud.securitycenter.v1beta1.IGroupAssetsResponse=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1beta1.GroupAssetsResponse} GroupAssetsResponse instance */ - GetOrganizationSettingsRequest.create = function create(properties) { - return new GetOrganizationSettingsRequest(properties); + GroupAssetsResponse.create = function create(properties) { + return new GroupAssetsResponse(properties); }; /** - * Encodes the specified GetOrganizationSettingsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.GetOrganizationSettingsRequest.verify|verify} messages. + * Encodes the specified GroupAssetsResponse message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.GroupAssetsResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.securitycenter.v1.GetOrganizationSettingsRequest + * @memberof google.cloud.securitycenter.v1beta1.GroupAssetsResponse * @static - * @param {google.cloud.securitycenter.v1.IGetOrganizationSettingsRequest} message GetOrganizationSettingsRequest message or plain object to encode + * @param {google.cloud.securitycenter.v1beta1.IGroupAssetsResponse} message GroupAssetsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetOrganizationSettingsRequest.encode = function encode(message, writer) { + GroupAssetsResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.groupByResults != null && message.groupByResults.length) + for (var i = 0; i < message.groupByResults.length; ++i) + $root.google.cloud.securitycenter.v1beta1.GroupResult.encode(message.groupByResults[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.readTime != null && message.hasOwnProperty("readTime")) + $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.nextPageToken); return writer; }; /** - * Encodes the specified GetOrganizationSettingsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.GetOrganizationSettingsRequest.verify|verify} messages. + * Encodes the specified GroupAssetsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.GroupAssetsResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.GetOrganizationSettingsRequest + * @memberof google.cloud.securitycenter.v1beta1.GroupAssetsResponse * @static - * @param {google.cloud.securitycenter.v1.IGetOrganizationSettingsRequest} message GetOrganizationSettingsRequest message or plain object to encode + * @param {google.cloud.securitycenter.v1beta1.IGroupAssetsResponse} message GroupAssetsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetOrganizationSettingsRequest.encodeDelimited = function encodeDelimited(message, writer) { + GroupAssetsResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GetOrganizationSettingsRequest message from the specified reader or buffer. + * Decodes a GroupAssetsResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.securitycenter.v1.GetOrganizationSettingsRequest + * @memberof google.cloud.securitycenter.v1beta1.GroupAssetsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.GetOrganizationSettingsRequest} GetOrganizationSettingsRequest + * @returns {google.cloud.securitycenter.v1beta1.GroupAssetsResponse} GroupAssetsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetOrganizationSettingsRequest.decode = function decode(reader, length) { + GroupAssetsResponse.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.cloud.securitycenter.v1.GetOrganizationSettingsRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1beta1.GroupAssetsResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.name = reader.string(); + if (!(message.groupByResults && message.groupByResults.length)) + message.groupByResults = []; + message.groupByResults.push($root.google.cloud.securitycenter.v1beta1.GroupResult.decode(reader, reader.uint32())); + break; + case 2: + message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 3: + message.nextPageToken = reader.string(); break; default: reader.skipType(tag & 7); @@ -3851,183 +13526,293 @@ }; /** - * Decodes a GetOrganizationSettingsRequest message from the specified reader or buffer, length delimited. + * Decodes a GroupAssetsResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.GetOrganizationSettingsRequest + * @memberof google.cloud.securitycenter.v1beta1.GroupAssetsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.GetOrganizationSettingsRequest} GetOrganizationSettingsRequest + * @returns {google.cloud.securitycenter.v1beta1.GroupAssetsResponse} GroupAssetsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetOrganizationSettingsRequest.decodeDelimited = function decodeDelimited(reader) { + GroupAssetsResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GetOrganizationSettingsRequest message. + * Verifies a GroupAssetsResponse message. * @function verify - * @memberof google.cloud.securitycenter.v1.GetOrganizationSettingsRequest + * @memberof google.cloud.securitycenter.v1beta1.GroupAssetsResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GetOrganizationSettingsRequest.verify = function verify(message) { + GroupAssetsResponse.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.groupByResults != null && message.hasOwnProperty("groupByResults")) { + if (!Array.isArray(message.groupByResults)) + return "groupByResults: array expected"; + for (var i = 0; i < message.groupByResults.length; ++i) { + var error = $root.google.cloud.securitycenter.v1beta1.GroupResult.verify(message.groupByResults[i]); + if (error) + return "groupByResults." + error; + } + } + if (message.readTime != null && message.hasOwnProperty("readTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.readTime); + if (error) + return "readTime." + error; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; return null; }; /** - * Creates a GetOrganizationSettingsRequest message from a plain object. Also converts values to their respective internal types. + * Creates a GroupAssetsResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.securitycenter.v1.GetOrganizationSettingsRequest + * @memberof google.cloud.securitycenter.v1beta1.GroupAssetsResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.GetOrganizationSettingsRequest} GetOrganizationSettingsRequest + * @returns {google.cloud.securitycenter.v1beta1.GroupAssetsResponse} GroupAssetsResponse */ - GetOrganizationSettingsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.GetOrganizationSettingsRequest) + GroupAssetsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1beta1.GroupAssetsResponse) return object; - var message = new $root.google.cloud.securitycenter.v1.GetOrganizationSettingsRequest(); - if (object.name != null) - message.name = String(object.name); + var message = new $root.google.cloud.securitycenter.v1beta1.GroupAssetsResponse(); + if (object.groupByResults) { + if (!Array.isArray(object.groupByResults)) + throw TypeError(".google.cloud.securitycenter.v1beta1.GroupAssetsResponse.groupByResults: array expected"); + message.groupByResults = []; + for (var i = 0; i < object.groupByResults.length; ++i) { + if (typeof object.groupByResults[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v1beta1.GroupAssetsResponse.groupByResults: object expected"); + message.groupByResults[i] = $root.google.cloud.securitycenter.v1beta1.GroupResult.fromObject(object.groupByResults[i]); + } + } + if (object.readTime != null) { + if (typeof object.readTime !== "object") + throw TypeError(".google.cloud.securitycenter.v1beta1.GroupAssetsResponse.readTime: object expected"); + message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); return message; }; /** - * Creates a plain object from a GetOrganizationSettingsRequest message. Also converts values to other types if specified. + * Creates a plain object from a GroupAssetsResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.securitycenter.v1.GetOrganizationSettingsRequest + * @memberof google.cloud.securitycenter.v1beta1.GroupAssetsResponse * @static - * @param {google.cloud.securitycenter.v1.GetOrganizationSettingsRequest} message GetOrganizationSettingsRequest + * @param {google.cloud.securitycenter.v1beta1.GroupAssetsResponse} message GroupAssetsResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GetOrganizationSettingsRequest.toObject = function toObject(message, options) { + GroupAssetsResponse.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 (options.arrays || options.defaults) + object.groupByResults = []; + if (options.defaults) { + object.readTime = null; + object.nextPageToken = ""; + } + if (message.groupByResults && message.groupByResults.length) { + object.groupByResults = []; + for (var j = 0; j < message.groupByResults.length; ++j) + object.groupByResults[j] = $root.google.cloud.securitycenter.v1beta1.GroupResult.toObject(message.groupByResults[j], options); + } + if (message.readTime != null && message.hasOwnProperty("readTime")) + object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; return object; }; /** - * Converts this GetOrganizationSettingsRequest to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1.GetOrganizationSettingsRequest + * Converts this GroupAssetsResponse to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1beta1.GroupAssetsResponse + * @instance + * @returns {Object.} JSON object + */ + GroupAssetsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GroupAssetsResponse; + })(); + + v1beta1.GroupFindingsRequest = (function() { + + /** + * Properties of a GroupFindingsRequest. + * @memberof google.cloud.securitycenter.v1beta1 + * @interface IGroupFindingsRequest + * @property {string|null} [parent] GroupFindingsRequest parent + * @property {string|null} [filter] GroupFindingsRequest filter + * @property {string|null} [groupBy] GroupFindingsRequest groupBy + * @property {google.protobuf.ITimestamp|null} [readTime] GroupFindingsRequest readTime + * @property {string|null} [pageToken] GroupFindingsRequest pageToken + * @property {number|null} [pageSize] GroupFindingsRequest pageSize + */ + + /** + * Constructs a new GroupFindingsRequest. + * @memberof google.cloud.securitycenter.v1beta1 + * @classdesc Represents a GroupFindingsRequest. + * @implements IGroupFindingsRequest + * @constructor + * @param {google.cloud.securitycenter.v1beta1.IGroupFindingsRequest=} [properties] Properties to set + */ + function GroupFindingsRequest(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]]; + } + + /** + * GroupFindingsRequest parent. + * @member {string} parent + * @memberof google.cloud.securitycenter.v1beta1.GroupFindingsRequest * @instance - * @returns {Object.} JSON object */ - GetOrganizationSettingsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + GroupFindingsRequest.prototype.parent = ""; - return GetOrganizationSettingsRequest; - })(); + /** + * GroupFindingsRequest filter. + * @member {string} filter + * @memberof google.cloud.securitycenter.v1beta1.GroupFindingsRequest + * @instance + */ + GroupFindingsRequest.prototype.filter = ""; - v1.GetSourceRequest = (function() { + /** + * GroupFindingsRequest groupBy. + * @member {string} groupBy + * @memberof google.cloud.securitycenter.v1beta1.GroupFindingsRequest + * @instance + */ + GroupFindingsRequest.prototype.groupBy = ""; /** - * Properties of a GetSourceRequest. - * @memberof google.cloud.securitycenter.v1 - * @interface IGetSourceRequest - * @property {string|null} [name] GetSourceRequest name + * GroupFindingsRequest readTime. + * @member {google.protobuf.ITimestamp|null|undefined} readTime + * @memberof google.cloud.securitycenter.v1beta1.GroupFindingsRequest + * @instance */ + GroupFindingsRequest.prototype.readTime = null; /** - * Constructs a new GetSourceRequest. - * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents a GetSourceRequest. - * @implements IGetSourceRequest - * @constructor - * @param {google.cloud.securitycenter.v1.IGetSourceRequest=} [properties] Properties to set + * GroupFindingsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.securitycenter.v1beta1.GroupFindingsRequest + * @instance */ - function GetSourceRequest(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]]; - } + GroupFindingsRequest.prototype.pageToken = ""; /** - * GetSourceRequest name. - * @member {string} name - * @memberof google.cloud.securitycenter.v1.GetSourceRequest + * GroupFindingsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.securitycenter.v1beta1.GroupFindingsRequest * @instance */ - GetSourceRequest.prototype.name = ""; + GroupFindingsRequest.prototype.pageSize = 0; /** - * Creates a new GetSourceRequest instance using the specified properties. + * Creates a new GroupFindingsRequest instance using the specified properties. * @function create - * @memberof google.cloud.securitycenter.v1.GetSourceRequest + * @memberof google.cloud.securitycenter.v1beta1.GroupFindingsRequest * @static - * @param {google.cloud.securitycenter.v1.IGetSourceRequest=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.GetSourceRequest} GetSourceRequest instance + * @param {google.cloud.securitycenter.v1beta1.IGroupFindingsRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1beta1.GroupFindingsRequest} GroupFindingsRequest instance */ - GetSourceRequest.create = function create(properties) { - return new GetSourceRequest(properties); + GroupFindingsRequest.create = function create(properties) { + return new GroupFindingsRequest(properties); }; /** - * Encodes the specified GetSourceRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.GetSourceRequest.verify|verify} messages. + * Encodes the specified GroupFindingsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.GroupFindingsRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.securitycenter.v1.GetSourceRequest + * @memberof google.cloud.securitycenter.v1beta1.GroupFindingsRequest * @static - * @param {google.cloud.securitycenter.v1.IGetSourceRequest} message GetSourceRequest message or plain object to encode + * @param {google.cloud.securitycenter.v1beta1.IGroupFindingsRequest} message GroupFindingsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetSourceRequest.encode = function encode(message, writer) { + GroupFindingsRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.parent != null && message.hasOwnProperty("parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.filter != null && message.hasOwnProperty("filter")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); + if (message.groupBy != null && message.hasOwnProperty("groupBy")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.groupBy); + if (message.readTime != null && message.hasOwnProperty("readTime")) + $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.pageToken); + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.pageSize); return writer; }; /** - * Encodes the specified GetSourceRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.GetSourceRequest.verify|verify} messages. + * Encodes the specified GroupFindingsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.GroupFindingsRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.GetSourceRequest + * @memberof google.cloud.securitycenter.v1beta1.GroupFindingsRequest * @static - * @param {google.cloud.securitycenter.v1.IGetSourceRequest} message GetSourceRequest message or plain object to encode + * @param {google.cloud.securitycenter.v1beta1.IGroupFindingsRequest} message GroupFindingsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetSourceRequest.encodeDelimited = function encodeDelimited(message, writer) { + GroupFindingsRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GetSourceRequest message from the specified reader or buffer. + * Decodes a GroupFindingsRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.securitycenter.v1.GetSourceRequest + * @memberof google.cloud.securitycenter.v1beta1.GroupFindingsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.GetSourceRequest} GetSourceRequest + * @returns {google.cloud.securitycenter.v1beta1.GroupFindingsRequest} GroupFindingsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetSourceRequest.decode = function decode(reader, length) { + GroupFindingsRequest.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.cloud.securitycenter.v1.GetSourceRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1beta1.GroupFindingsRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.name = reader.string(); + message.parent = reader.string(); + break; + case 2: + message.filter = reader.string(); + break; + case 3: + message.groupBy = reader.string(); + break; + case 4: + message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 5: + message.pageToken = reader.string(); + break; + case 6: + message.pageSize = reader.int32(); break; default: reader.skipType(tag & 7); @@ -4038,113 +13823,156 @@ }; /** - * Decodes a GetSourceRequest message from the specified reader or buffer, length delimited. + * Decodes a GroupFindingsRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.GetSourceRequest + * @memberof google.cloud.securitycenter.v1beta1.GroupFindingsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.GetSourceRequest} GetSourceRequest + * @returns {google.cloud.securitycenter.v1beta1.GroupFindingsRequest} GroupFindingsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetSourceRequest.decodeDelimited = function decodeDelimited(reader) { + GroupFindingsRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GetSourceRequest message. + * Verifies a GroupFindingsRequest message. * @function verify - * @memberof google.cloud.securitycenter.v1.GetSourceRequest + * @memberof google.cloud.securitycenter.v1beta1.GroupFindingsRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GetSourceRequest.verify = function verify(message) { + GroupFindingsRequest.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.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.groupBy != null && message.hasOwnProperty("groupBy")) + if (!$util.isString(message.groupBy)) + return "groupBy: string expected"; + if (message.readTime != null && message.hasOwnProperty("readTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.readTime); + if (error) + return "readTime." + error; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; return null; }; /** - * Creates a GetSourceRequest message from a plain object. Also converts values to their respective internal types. + * Creates a GroupFindingsRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.securitycenter.v1.GetSourceRequest + * @memberof google.cloud.securitycenter.v1beta1.GroupFindingsRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.GetSourceRequest} GetSourceRequest + * @returns {google.cloud.securitycenter.v1beta1.GroupFindingsRequest} GroupFindingsRequest */ - GetSourceRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.GetSourceRequest) + GroupFindingsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1beta1.GroupFindingsRequest) return object; - var message = new $root.google.cloud.securitycenter.v1.GetSourceRequest(); - if (object.name != null) - message.name = String(object.name); + var message = new $root.google.cloud.securitycenter.v1beta1.GroupFindingsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.filter != null) + message.filter = String(object.filter); + if (object.groupBy != null) + message.groupBy = String(object.groupBy); + if (object.readTime != null) { + if (typeof object.readTime !== "object") + throw TypeError(".google.cloud.securitycenter.v1beta1.GroupFindingsRequest.readTime: object expected"); + message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); + } + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; return message; }; /** - * Creates a plain object from a GetSourceRequest message. Also converts values to other types if specified. + * Creates a plain object from a GroupFindingsRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.securitycenter.v1.GetSourceRequest + * @memberof google.cloud.securitycenter.v1beta1.GroupFindingsRequest * @static - * @param {google.cloud.securitycenter.v1.GetSourceRequest} message GetSourceRequest + * @param {google.cloud.securitycenter.v1beta1.GroupFindingsRequest} message GroupFindingsRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GetSourceRequest.toObject = function toObject(message, options) { + GroupFindingsRequest.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 (options.defaults) { + object.parent = ""; + object.filter = ""; + object.groupBy = ""; + object.readTime = null; + object.pageToken = ""; + object.pageSize = 0; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.groupBy != null && message.hasOwnProperty("groupBy")) + object.groupBy = message.groupBy; + if (message.readTime != null && message.hasOwnProperty("readTime")) + object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; return object; }; /** - * Converts this GetSourceRequest to JSON. + * Converts this GroupFindingsRequest to JSON. * @function toJSON - * @memberof google.cloud.securitycenter.v1.GetSourceRequest + * @memberof google.cloud.securitycenter.v1beta1.GroupFindingsRequest * @instance * @returns {Object.} JSON object */ - GetSourceRequest.prototype.toJSON = function toJSON() { + GroupFindingsRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return GetSourceRequest; + return GroupFindingsRequest; })(); - v1.GroupAssetsRequest = (function() { + v1beta1.GroupFindingsResponse = (function() { /** - * Properties of a GroupAssetsRequest. - * @memberof google.cloud.securitycenter.v1 - * @interface IGroupAssetsRequest - * @property {string|null} [parent] GroupAssetsRequest parent - * @property {string|null} [filter] GroupAssetsRequest filter - * @property {string|null} [groupBy] GroupAssetsRequest groupBy - * @property {google.protobuf.IDuration|null} [compareDuration] GroupAssetsRequest compareDuration - * @property {google.protobuf.ITimestamp|null} [readTime] GroupAssetsRequest readTime - * @property {string|null} [pageToken] GroupAssetsRequest pageToken - * @property {number|null} [pageSize] GroupAssetsRequest pageSize + * Properties of a GroupFindingsResponse. + * @memberof google.cloud.securitycenter.v1beta1 + * @interface IGroupFindingsResponse + * @property {Array.|null} [groupByResults] GroupFindingsResponse groupByResults + * @property {google.protobuf.ITimestamp|null} [readTime] GroupFindingsResponse readTime + * @property {string|null} [nextPageToken] GroupFindingsResponse nextPageToken */ /** - * Constructs a new GroupAssetsRequest. - * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents a GroupAssetsRequest. - * @implements IGroupAssetsRequest + * Constructs a new GroupFindingsResponse. + * @memberof google.cloud.securitycenter.v1beta1 + * @classdesc Represents a GroupFindingsResponse. + * @implements IGroupFindingsResponse * @constructor - * @param {google.cloud.securitycenter.v1.IGroupAssetsRequest=} [properties] Properties to set + * @param {google.cloud.securitycenter.v1beta1.IGroupFindingsResponse=} [properties] Properties to set */ - function GroupAssetsRequest(properties) { + function GroupFindingsResponse(properties) { + this.groupByResults = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -4152,153 +13980,104 @@ } /** - * GroupAssetsRequest parent. - * @member {string} parent - * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest - * @instance - */ - GroupAssetsRequest.prototype.parent = ""; - - /** - * GroupAssetsRequest filter. - * @member {string} filter - * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest - * @instance - */ - GroupAssetsRequest.prototype.filter = ""; - - /** - * GroupAssetsRequest groupBy. - * @member {string} groupBy - * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest - * @instance - */ - GroupAssetsRequest.prototype.groupBy = ""; - - /** - * GroupAssetsRequest compareDuration. - * @member {google.protobuf.IDuration|null|undefined} compareDuration - * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest + * GroupFindingsResponse groupByResults. + * @member {Array.} groupByResults + * @memberof google.cloud.securitycenter.v1beta1.GroupFindingsResponse * @instance */ - GroupAssetsRequest.prototype.compareDuration = null; + GroupFindingsResponse.prototype.groupByResults = $util.emptyArray; /** - * GroupAssetsRequest readTime. + * GroupFindingsResponse readTime. * @member {google.protobuf.ITimestamp|null|undefined} readTime - * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest - * @instance - */ - GroupAssetsRequest.prototype.readTime = null; - - /** - * GroupAssetsRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest + * @memberof google.cloud.securitycenter.v1beta1.GroupFindingsResponse * @instance */ - GroupAssetsRequest.prototype.pageToken = ""; + GroupFindingsResponse.prototype.readTime = null; /** - * GroupAssetsRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest + * GroupFindingsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.securitycenter.v1beta1.GroupFindingsResponse * @instance */ - GroupAssetsRequest.prototype.pageSize = 0; + GroupFindingsResponse.prototype.nextPageToken = ""; /** - * Creates a new GroupAssetsRequest instance using the specified properties. + * Creates a new GroupFindingsResponse instance using the specified properties. * @function create - * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest + * @memberof google.cloud.securitycenter.v1beta1.GroupFindingsResponse * @static - * @param {google.cloud.securitycenter.v1.IGroupAssetsRequest=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.GroupAssetsRequest} GroupAssetsRequest instance + * @param {google.cloud.securitycenter.v1beta1.IGroupFindingsResponse=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1beta1.GroupFindingsResponse} GroupFindingsResponse instance */ - GroupAssetsRequest.create = function create(properties) { - return new GroupAssetsRequest(properties); + GroupFindingsResponse.create = function create(properties) { + return new GroupFindingsResponse(properties); }; /** - * Encodes the specified GroupAssetsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.GroupAssetsRequest.verify|verify} messages. + * Encodes the specified GroupFindingsResponse message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.GroupFindingsResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest + * @memberof google.cloud.securitycenter.v1beta1.GroupFindingsResponse * @static - * @param {google.cloud.securitycenter.v1.IGroupAssetsRequest} message GroupAssetsRequest message or plain object to encode + * @param {google.cloud.securitycenter.v1beta1.IGroupFindingsResponse} message GroupFindingsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GroupAssetsRequest.encode = function encode(message, writer) { + GroupFindingsResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && message.hasOwnProperty("parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.filter != null && message.hasOwnProperty("filter")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); - if (message.groupBy != null && message.hasOwnProperty("groupBy")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.groupBy); - if (message.compareDuration != null && message.hasOwnProperty("compareDuration")) - $root.google.protobuf.Duration.encode(message.compareDuration, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.groupByResults != null && message.groupByResults.length) + for (var i = 0; i < message.groupByResults.length; ++i) + $root.google.cloud.securitycenter.v1beta1.GroupResult.encode(message.groupByResults[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); if (message.readTime != null && message.hasOwnProperty("readTime")) - $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.pageToken); - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - writer.uint32(/* id 8, wireType 0 =*/64).int32(message.pageSize); + $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.nextPageToken); return writer; }; /** - * Encodes the specified GroupAssetsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.GroupAssetsRequest.verify|verify} messages. + * Encodes the specified GroupFindingsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.GroupFindingsResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest + * @memberof google.cloud.securitycenter.v1beta1.GroupFindingsResponse * @static - * @param {google.cloud.securitycenter.v1.IGroupAssetsRequest} message GroupAssetsRequest message or plain object to encode + * @param {google.cloud.securitycenter.v1beta1.IGroupFindingsResponse} message GroupFindingsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GroupAssetsRequest.encodeDelimited = function encodeDelimited(message, writer) { + GroupFindingsResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GroupAssetsRequest message from the specified reader or buffer. + * Decodes a GroupFindingsResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest + * @memberof google.cloud.securitycenter.v1beta1.GroupFindingsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.GroupAssetsRequest} GroupAssetsRequest + * @returns {google.cloud.securitycenter.v1beta1.GroupFindingsResponse} GroupFindingsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GroupAssetsRequest.decode = function decode(reader, length) { + GroupFindingsResponse.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.cloud.securitycenter.v1.GroupAssetsRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1beta1.GroupFindingsResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.parent = reader.string(); + if (!(message.groupByResults && message.groupByResults.length)) + message.groupByResults = []; + message.groupByResults.push($root.google.cloud.securitycenter.v1beta1.GroupResult.decode(reader, reader.uint32())); break; case 2: - message.filter = reader.string(); - break; - case 3: - message.groupBy = reader.string(); - break; - case 4: - message.compareDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - case 5: message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; - case 7: - message.pageToken = reader.string(); - break; - case 8: - message.pageSize = reader.int32(); + case 3: + message.nextPageToken = reader.string(); break; default: reader.skipType(tag & 7); @@ -4309,170 +14088,149 @@ }; /** - * Decodes a GroupAssetsRequest message from the specified reader or buffer, length delimited. + * Decodes a GroupFindingsResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest + * @memberof google.cloud.securitycenter.v1beta1.GroupFindingsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.GroupAssetsRequest} GroupAssetsRequest + * @returns {google.cloud.securitycenter.v1beta1.GroupFindingsResponse} GroupFindingsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GroupAssetsRequest.decodeDelimited = function decodeDelimited(reader) { + GroupFindingsResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GroupAssetsRequest message. + * Verifies a GroupFindingsResponse message. * @function verify - * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest + * @memberof google.cloud.securitycenter.v1beta1.GroupFindingsResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GroupAssetsRequest.verify = function verify(message) { + GroupFindingsResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.filter != null && message.hasOwnProperty("filter")) - if (!$util.isString(message.filter)) - return "filter: string expected"; - if (message.groupBy != null && message.hasOwnProperty("groupBy")) - if (!$util.isString(message.groupBy)) - return "groupBy: string expected"; - if (message.compareDuration != null && message.hasOwnProperty("compareDuration")) { - var error = $root.google.protobuf.Duration.verify(message.compareDuration); - if (error) - return "compareDuration." + error; + if (message.groupByResults != null && message.hasOwnProperty("groupByResults")) { + if (!Array.isArray(message.groupByResults)) + return "groupByResults: array expected"; + for (var i = 0; i < message.groupByResults.length; ++i) { + var error = $root.google.cloud.securitycenter.v1beta1.GroupResult.verify(message.groupByResults[i]); + if (error) + return "groupByResults." + error; + } } if (message.readTime != null && message.hasOwnProperty("readTime")) { var error = $root.google.protobuf.Timestamp.verify(message.readTime); if (error) return "readTime." + error; } - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; return null; }; /** - * Creates a GroupAssetsRequest message from a plain object. Also converts values to their respective internal types. + * Creates a GroupFindingsResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest + * @memberof google.cloud.securitycenter.v1beta1.GroupFindingsResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.GroupAssetsRequest} GroupAssetsRequest + * @returns {google.cloud.securitycenter.v1beta1.GroupFindingsResponse} GroupFindingsResponse */ - GroupAssetsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.GroupAssetsRequest) + GroupFindingsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1beta1.GroupFindingsResponse) return object; - var message = new $root.google.cloud.securitycenter.v1.GroupAssetsRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.filter != null) - message.filter = String(object.filter); - if (object.groupBy != null) - message.groupBy = String(object.groupBy); - if (object.compareDuration != null) { - if (typeof object.compareDuration !== "object") - throw TypeError(".google.cloud.securitycenter.v1.GroupAssetsRequest.compareDuration: object expected"); - message.compareDuration = $root.google.protobuf.Duration.fromObject(object.compareDuration); + var message = new $root.google.cloud.securitycenter.v1beta1.GroupFindingsResponse(); + if (object.groupByResults) { + if (!Array.isArray(object.groupByResults)) + throw TypeError(".google.cloud.securitycenter.v1beta1.GroupFindingsResponse.groupByResults: array expected"); + message.groupByResults = []; + for (var i = 0; i < object.groupByResults.length; ++i) { + if (typeof object.groupByResults[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v1beta1.GroupFindingsResponse.groupByResults: object expected"); + message.groupByResults[i] = $root.google.cloud.securitycenter.v1beta1.GroupResult.fromObject(object.groupByResults[i]); + } } if (object.readTime != null) { if (typeof object.readTime !== "object") - throw TypeError(".google.cloud.securitycenter.v1.GroupAssetsRequest.readTime: object expected"); + throw TypeError(".google.cloud.securitycenter.v1beta1.GroupFindingsResponse.readTime: object expected"); message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); } - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); return message; }; /** - * Creates a plain object from a GroupAssetsRequest message. Also converts values to other types if specified. + * Creates a plain object from a GroupFindingsResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest + * @memberof google.cloud.securitycenter.v1beta1.GroupFindingsResponse * @static - * @param {google.cloud.securitycenter.v1.GroupAssetsRequest} message GroupAssetsRequest + * @param {google.cloud.securitycenter.v1beta1.GroupFindingsResponse} message GroupFindingsResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GroupAssetsRequest.toObject = function toObject(message, options) { + GroupFindingsResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) + object.groupByResults = []; if (options.defaults) { - object.parent = ""; - object.filter = ""; - object.groupBy = ""; - object.compareDuration = null; object.readTime = null; - object.pageToken = ""; - object.pageSize = 0; + object.nextPageToken = ""; + } + if (message.groupByResults && message.groupByResults.length) { + object.groupByResults = []; + for (var j = 0; j < message.groupByResults.length; ++j) + object.groupByResults[j] = $root.google.cloud.securitycenter.v1beta1.GroupResult.toObject(message.groupByResults[j], options); } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.filter != null && message.hasOwnProperty("filter")) - object.filter = message.filter; - if (message.groupBy != null && message.hasOwnProperty("groupBy")) - object.groupBy = message.groupBy; - if (message.compareDuration != null && message.hasOwnProperty("compareDuration")) - object.compareDuration = $root.google.protobuf.Duration.toObject(message.compareDuration, options); if (message.readTime != null && message.hasOwnProperty("readTime")) object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; return object; }; /** - * Converts this GroupAssetsRequest to JSON. + * Converts this GroupFindingsResponse to JSON. * @function toJSON - * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest + * @memberof google.cloud.securitycenter.v1beta1.GroupFindingsResponse * @instance * @returns {Object.} JSON object */ - GroupAssetsRequest.prototype.toJSON = function toJSON() { + GroupFindingsResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return GroupAssetsRequest; + return GroupFindingsResponse; })(); - v1.GroupAssetsResponse = (function() { + v1beta1.GroupResult = (function() { /** - * Properties of a GroupAssetsResponse. - * @memberof google.cloud.securitycenter.v1 - * @interface IGroupAssetsResponse - * @property {Array.|null} [groupByResults] GroupAssetsResponse groupByResults - * @property {google.protobuf.ITimestamp|null} [readTime] GroupAssetsResponse readTime - * @property {string|null} [nextPageToken] GroupAssetsResponse nextPageToken - * @property {number|null} [totalSize] GroupAssetsResponse totalSize + * Properties of a GroupResult. + * @memberof google.cloud.securitycenter.v1beta1 + * @interface IGroupResult + * @property {Object.|null} [properties] GroupResult properties + * @property {number|Long|null} [count] GroupResult count */ /** - * Constructs a new GroupAssetsResponse. - * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents a GroupAssetsResponse. - * @implements IGroupAssetsResponse + * Constructs a new GroupResult. + * @memberof google.cloud.securitycenter.v1beta1 + * @classdesc Represents a GroupResult. + * @implements IGroupResult * @constructor - * @param {google.cloud.securitycenter.v1.IGroupAssetsResponse=} [properties] Properties to set + * @param {google.cloud.securitycenter.v1beta1.IGroupResult=} [properties] Properties to set */ - function GroupAssetsResponse(properties) { - this.groupByResults = []; + function GroupResult(properties) { + this.properties = {}; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -4480,117 +14238,96 @@ } /** - * GroupAssetsResponse groupByResults. - * @member {Array.} groupByResults - * @memberof google.cloud.securitycenter.v1.GroupAssetsResponse - * @instance - */ - GroupAssetsResponse.prototype.groupByResults = $util.emptyArray; - - /** - * GroupAssetsResponse readTime. - * @member {google.protobuf.ITimestamp|null|undefined} readTime - * @memberof google.cloud.securitycenter.v1.GroupAssetsResponse - * @instance - */ - GroupAssetsResponse.prototype.readTime = null; - - /** - * GroupAssetsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.securitycenter.v1.GroupAssetsResponse + * GroupResult properties. + * @member {Object.} properties + * @memberof google.cloud.securitycenter.v1beta1.GroupResult * @instance */ - GroupAssetsResponse.prototype.nextPageToken = ""; + GroupResult.prototype.properties = $util.emptyObject; /** - * GroupAssetsResponse totalSize. - * @member {number} totalSize - * @memberof google.cloud.securitycenter.v1.GroupAssetsResponse + * GroupResult count. + * @member {number|Long} count + * @memberof google.cloud.securitycenter.v1beta1.GroupResult * @instance */ - GroupAssetsResponse.prototype.totalSize = 0; + GroupResult.prototype.count = $util.Long ? $util.Long.fromBits(0,0,false) : 0; /** - * Creates a new GroupAssetsResponse instance using the specified properties. + * Creates a new GroupResult instance using the specified properties. * @function create - * @memberof google.cloud.securitycenter.v1.GroupAssetsResponse + * @memberof google.cloud.securitycenter.v1beta1.GroupResult * @static - * @param {google.cloud.securitycenter.v1.IGroupAssetsResponse=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.GroupAssetsResponse} GroupAssetsResponse instance + * @param {google.cloud.securitycenter.v1beta1.IGroupResult=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1beta1.GroupResult} GroupResult instance */ - GroupAssetsResponse.create = function create(properties) { - return new GroupAssetsResponse(properties); + GroupResult.create = function create(properties) { + return new GroupResult(properties); }; /** - * Encodes the specified GroupAssetsResponse message. Does not implicitly {@link google.cloud.securitycenter.v1.GroupAssetsResponse.verify|verify} messages. + * Encodes the specified GroupResult message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.GroupResult.verify|verify} messages. * @function encode - * @memberof google.cloud.securitycenter.v1.GroupAssetsResponse + * @memberof google.cloud.securitycenter.v1beta1.GroupResult * @static - * @param {google.cloud.securitycenter.v1.IGroupAssetsResponse} message GroupAssetsResponse message or plain object to encode + * @param {google.cloud.securitycenter.v1beta1.IGroupResult} message GroupResult message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GroupAssetsResponse.encode = function encode(message, writer) { + GroupResult.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.groupByResults != null && message.groupByResults.length) - for (var i = 0; i < message.groupByResults.length; ++i) - $root.google.cloud.securitycenter.v1.GroupResult.encode(message.groupByResults[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.readTime != null && message.hasOwnProperty("readTime")) - $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.nextPageToken); - if (message.totalSize != null && message.hasOwnProperty("totalSize")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.totalSize); + if (message.properties != null && message.hasOwnProperty("properties")) + for (var keys = Object.keys(message.properties), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.protobuf.Value.encode(message.properties[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.count != null && message.hasOwnProperty("count")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.count); return writer; }; /** - * Encodes the specified GroupAssetsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.GroupAssetsResponse.verify|verify} messages. + * Encodes the specified GroupResult message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.GroupResult.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.GroupAssetsResponse + * @memberof google.cloud.securitycenter.v1beta1.GroupResult * @static - * @param {google.cloud.securitycenter.v1.IGroupAssetsResponse} message GroupAssetsResponse message or plain object to encode + * @param {google.cloud.securitycenter.v1beta1.IGroupResult} message GroupResult message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GroupAssetsResponse.encodeDelimited = function encodeDelimited(message, writer) { + GroupResult.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GroupAssetsResponse message from the specified reader or buffer. + * Decodes a GroupResult message from the specified reader or buffer. * @function decode - * @memberof google.cloud.securitycenter.v1.GroupAssetsResponse + * @memberof google.cloud.securitycenter.v1beta1.GroupResult * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.GroupAssetsResponse} GroupAssetsResponse + * @returns {google.cloud.securitycenter.v1beta1.GroupResult} GroupResult * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GroupAssetsResponse.decode = function decode(reader, length) { + GroupResult.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.cloud.securitycenter.v1.GroupAssetsResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1beta1.GroupResult(), key; while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - if (!(message.groupByResults && message.groupByResults.length)) - message.groupByResults = []; - message.groupByResults.push($root.google.cloud.securitycenter.v1.GroupResult.decode(reader, reader.uint32())); + reader.skip().pos++; + if (message.properties === $util.emptyObject) + message.properties = {}; + key = reader.string(); + reader.pos++; + message.properties[key] = $root.google.protobuf.Value.decode(reader, reader.uint32()); break; case 2: - message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 3: - message.nextPageToken = reader.string(); - break; - case 4: - message.totalSize = reader.int32(); + message.count = reader.int64(); break; default: reader.skipType(tag & 7); @@ -4601,161 +14338,151 @@ }; /** - * Decodes a GroupAssetsResponse message from the specified reader or buffer, length delimited. + * Decodes a GroupResult message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.GroupAssetsResponse + * @memberof google.cloud.securitycenter.v1beta1.GroupResult * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.GroupAssetsResponse} GroupAssetsResponse + * @returns {google.cloud.securitycenter.v1beta1.GroupResult} GroupResult * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GroupAssetsResponse.decodeDelimited = function decodeDelimited(reader) { + GroupResult.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GroupAssetsResponse message. + * Verifies a GroupResult message. * @function verify - * @memberof google.cloud.securitycenter.v1.GroupAssetsResponse + * @memberof google.cloud.securitycenter.v1beta1.GroupResult * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GroupAssetsResponse.verify = function verify(message) { + GroupResult.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.groupByResults != null && message.hasOwnProperty("groupByResults")) { - if (!Array.isArray(message.groupByResults)) - return "groupByResults: array expected"; - for (var i = 0; i < message.groupByResults.length; ++i) { - var error = $root.google.cloud.securitycenter.v1.GroupResult.verify(message.groupByResults[i]); + if (message.properties != null && message.hasOwnProperty("properties")) { + if (!$util.isObject(message.properties)) + return "properties: object expected"; + var key = Object.keys(message.properties); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.protobuf.Value.verify(message.properties[key[i]]); if (error) - return "groupByResults." + error; + return "properties." + error; } } - if (message.readTime != null && message.hasOwnProperty("readTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.readTime); - if (error) - return "readTime." + error; - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - if (message.totalSize != null && message.hasOwnProperty("totalSize")) - if (!$util.isInteger(message.totalSize)) - return "totalSize: integer expected"; + if (message.count != null && message.hasOwnProperty("count")) + if (!$util.isInteger(message.count) && !(message.count && $util.isInteger(message.count.low) && $util.isInteger(message.count.high))) + return "count: integer|Long expected"; return null; }; /** - * Creates a GroupAssetsResponse message from a plain object. Also converts values to their respective internal types. + * Creates a GroupResult message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.securitycenter.v1.GroupAssetsResponse + * @memberof google.cloud.securitycenter.v1beta1.GroupResult * @static * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.GroupAssetsResponse} GroupAssetsResponse + * @returns {google.cloud.securitycenter.v1beta1.GroupResult} GroupResult */ - GroupAssetsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.GroupAssetsResponse) + GroupResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1beta1.GroupResult) return object; - var message = new $root.google.cloud.securitycenter.v1.GroupAssetsResponse(); - if (object.groupByResults) { - if (!Array.isArray(object.groupByResults)) - throw TypeError(".google.cloud.securitycenter.v1.GroupAssetsResponse.groupByResults: array expected"); - message.groupByResults = []; - for (var i = 0; i < object.groupByResults.length; ++i) { - if (typeof object.groupByResults[i] !== "object") - throw TypeError(".google.cloud.securitycenter.v1.GroupAssetsResponse.groupByResults: object expected"); - message.groupByResults[i] = $root.google.cloud.securitycenter.v1.GroupResult.fromObject(object.groupByResults[i]); + var message = new $root.google.cloud.securitycenter.v1beta1.GroupResult(); + if (object.properties) { + if (typeof object.properties !== "object") + throw TypeError(".google.cloud.securitycenter.v1beta1.GroupResult.properties: object expected"); + message.properties = {}; + for (var keys = Object.keys(object.properties), i = 0; i < keys.length; ++i) { + if (typeof object.properties[keys[i]] !== "object") + throw TypeError(".google.cloud.securitycenter.v1beta1.GroupResult.properties: object expected"); + message.properties[keys[i]] = $root.google.protobuf.Value.fromObject(object.properties[keys[i]]); } } - if (object.readTime != null) { - if (typeof object.readTime !== "object") - throw TypeError(".google.cloud.securitycenter.v1.GroupAssetsResponse.readTime: object expected"); - message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - if (object.totalSize != null) - message.totalSize = object.totalSize | 0; + if (object.count != null) + if ($util.Long) + (message.count = $util.Long.fromValue(object.count)).unsigned = false; + else if (typeof object.count === "string") + message.count = parseInt(object.count, 10); + else if (typeof object.count === "number") + message.count = object.count; + else if (typeof object.count === "object") + message.count = new $util.LongBits(object.count.low >>> 0, object.count.high >>> 0).toNumber(); return message; }; /** - * Creates a plain object from a GroupAssetsResponse message. Also converts values to other types if specified. + * Creates a plain object from a GroupResult message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.securitycenter.v1.GroupAssetsResponse + * @memberof google.cloud.securitycenter.v1beta1.GroupResult * @static - * @param {google.cloud.securitycenter.v1.GroupAssetsResponse} message GroupAssetsResponse + * @param {google.cloud.securitycenter.v1beta1.GroupResult} message GroupResult * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GroupAssetsResponse.toObject = function toObject(message, options) { + GroupResult.toObject = function toObject(message, options) { if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.groupByResults = []; - if (options.defaults) { - object.readTime = null; - object.nextPageToken = ""; - object.totalSize = 0; - } - if (message.groupByResults && message.groupByResults.length) { - object.groupByResults = []; - for (var j = 0; j < message.groupByResults.length; ++j) - object.groupByResults[j] = $root.google.cloud.securitycenter.v1.GroupResult.toObject(message.groupByResults[j], options); + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.properties = {}; + if (options.defaults) + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.count = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.count = options.longs === String ? "0" : 0; + var keys2; + if (message.properties && (keys2 = Object.keys(message.properties)).length) { + object.properties = {}; + for (var j = 0; j < keys2.length; ++j) + object.properties[keys2[j]] = $root.google.protobuf.Value.toObject(message.properties[keys2[j]], options); } - if (message.readTime != null && message.hasOwnProperty("readTime")) - object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - if (message.totalSize != null && message.hasOwnProperty("totalSize")) - object.totalSize = message.totalSize; + if (message.count != null && message.hasOwnProperty("count")) + if (typeof message.count === "number") + object.count = options.longs === String ? String(message.count) : message.count; + else + object.count = options.longs === String ? $util.Long.prototype.toString.call(message.count) : options.longs === Number ? new $util.LongBits(message.count.low >>> 0, message.count.high >>> 0).toNumber() : message.count; return object; }; /** - * Converts this GroupAssetsResponse to JSON. + * Converts this GroupResult to JSON. * @function toJSON - * @memberof google.cloud.securitycenter.v1.GroupAssetsResponse + * @memberof google.cloud.securitycenter.v1beta1.GroupResult * @instance * @returns {Object.} JSON object */ - GroupAssetsResponse.prototype.toJSON = function toJSON() { + GroupResult.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return GroupAssetsResponse; + return GroupResult; })(); - v1.GroupFindingsRequest = (function() { + v1beta1.ListSourcesRequest = (function() { /** - * Properties of a GroupFindingsRequest. - * @memberof google.cloud.securitycenter.v1 - * @interface IGroupFindingsRequest - * @property {string|null} [parent] GroupFindingsRequest parent - * @property {string|null} [filter] GroupFindingsRequest filter - * @property {string|null} [groupBy] GroupFindingsRequest groupBy - * @property {google.protobuf.ITimestamp|null} [readTime] GroupFindingsRequest readTime - * @property {google.protobuf.IDuration|null} [compareDuration] GroupFindingsRequest compareDuration - * @property {string|null} [pageToken] GroupFindingsRequest pageToken - * @property {number|null} [pageSize] GroupFindingsRequest pageSize + * Properties of a ListSourcesRequest. + * @memberof google.cloud.securitycenter.v1beta1 + * @interface IListSourcesRequest + * @property {string|null} [parent] ListSourcesRequest parent + * @property {string|null} [pageToken] ListSourcesRequest pageToken + * @property {number|null} [pageSize] ListSourcesRequest pageSize */ /** - * Constructs a new GroupFindingsRequest. - * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents a GroupFindingsRequest. - * @implements IGroupFindingsRequest + * Constructs a new ListSourcesRequest. + * @memberof google.cloud.securitycenter.v1beta1 + * @classdesc Represents a ListSourcesRequest. + * @implements IListSourcesRequest * @constructor - * @param {google.cloud.securitycenter.v1.IGroupFindingsRequest=} [properties] Properties to set + * @param {google.cloud.securitycenter.v1beta1.IListSourcesRequest=} [properties] Properties to set */ - function GroupFindingsRequest(properties) { + function ListSourcesRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -4763,130 +14490,90 @@ } /** - * GroupFindingsRequest parent. + * ListSourcesRequest parent. * @member {string} parent - * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest - * @instance - */ - GroupFindingsRequest.prototype.parent = ""; - - /** - * GroupFindingsRequest filter. - * @member {string} filter - * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest - * @instance - */ - GroupFindingsRequest.prototype.filter = ""; - - /** - * GroupFindingsRequest groupBy. - * @member {string} groupBy - * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest - * @instance - */ - GroupFindingsRequest.prototype.groupBy = ""; - - /** - * GroupFindingsRequest readTime. - * @member {google.protobuf.ITimestamp|null|undefined} readTime - * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest - * @instance - */ - GroupFindingsRequest.prototype.readTime = null; - - /** - * GroupFindingsRequest compareDuration. - * @member {google.protobuf.IDuration|null|undefined} compareDuration - * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest + * @memberof google.cloud.securitycenter.v1beta1.ListSourcesRequest * @instance */ - GroupFindingsRequest.prototype.compareDuration = null; + ListSourcesRequest.prototype.parent = ""; /** - * GroupFindingsRequest pageToken. + * ListSourcesRequest pageToken. * @member {string} pageToken - * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest + * @memberof google.cloud.securitycenter.v1beta1.ListSourcesRequest * @instance */ - GroupFindingsRequest.prototype.pageToken = ""; + ListSourcesRequest.prototype.pageToken = ""; /** - * GroupFindingsRequest pageSize. + * ListSourcesRequest pageSize. * @member {number} pageSize - * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest + * @memberof google.cloud.securitycenter.v1beta1.ListSourcesRequest * @instance */ - GroupFindingsRequest.prototype.pageSize = 0; + ListSourcesRequest.prototype.pageSize = 0; /** - * Creates a new GroupFindingsRequest instance using the specified properties. + * Creates a new ListSourcesRequest instance using the specified properties. * @function create - * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest + * @memberof google.cloud.securitycenter.v1beta1.ListSourcesRequest * @static - * @param {google.cloud.securitycenter.v1.IGroupFindingsRequest=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.GroupFindingsRequest} GroupFindingsRequest instance + * @param {google.cloud.securitycenter.v1beta1.IListSourcesRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1beta1.ListSourcesRequest} ListSourcesRequest instance */ - GroupFindingsRequest.create = function create(properties) { - return new GroupFindingsRequest(properties); + ListSourcesRequest.create = function create(properties) { + return new ListSourcesRequest(properties); }; /** - * Encodes the specified GroupFindingsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.GroupFindingsRequest.verify|verify} messages. + * Encodes the specified ListSourcesRequest message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.ListSourcesRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest + * @memberof google.cloud.securitycenter.v1beta1.ListSourcesRequest * @static - * @param {google.cloud.securitycenter.v1.IGroupFindingsRequest} message GroupFindingsRequest message or plain object to encode + * @param {google.cloud.securitycenter.v1beta1.IListSourcesRequest} message ListSourcesRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GroupFindingsRequest.encode = function encode(message, writer) { + ListSourcesRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.parent != null && message.hasOwnProperty("parent")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.filter != null && message.hasOwnProperty("filter")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); - if (message.groupBy != null && message.hasOwnProperty("groupBy")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.groupBy); - if (message.readTime != null && message.hasOwnProperty("readTime")) - $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.compareDuration != null && message.hasOwnProperty("compareDuration")) - $root.google.protobuf.Duration.encode(message.compareDuration, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); if (message.pageToken != null && message.hasOwnProperty("pageToken")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.pageToken); + writer.uint32(/* id 2, wireType 2 =*/18).string(message.pageToken); if (message.pageSize != null && message.hasOwnProperty("pageSize")) - writer.uint32(/* id 8, wireType 0 =*/64).int32(message.pageSize); + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.pageSize); return writer; }; /** - * Encodes the specified GroupFindingsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.GroupFindingsRequest.verify|verify} messages. + * Encodes the specified ListSourcesRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.ListSourcesRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest + * @memberof google.cloud.securitycenter.v1beta1.ListSourcesRequest * @static - * @param {google.cloud.securitycenter.v1.IGroupFindingsRequest} message GroupFindingsRequest message or plain object to encode + * @param {google.cloud.securitycenter.v1beta1.IListSourcesRequest} message ListSourcesRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GroupFindingsRequest.encodeDelimited = function encodeDelimited(message, writer) { + ListSourcesRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GroupFindingsRequest message from the specified reader or buffer. + * Decodes a ListSourcesRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest + * @memberof google.cloud.securitycenter.v1beta1.ListSourcesRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.GroupFindingsRequest} GroupFindingsRequest + * @returns {google.cloud.securitycenter.v1beta1.ListSourcesRequest} ListSourcesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GroupFindingsRequest.decode = function decode(reader, length) { + ListSourcesRequest.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.cloud.securitycenter.v1.GroupFindingsRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1beta1.ListSourcesRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -4894,21 +14581,9 @@ message.parent = reader.string(); break; case 2: - message.filter = reader.string(); - break; - case 3: - message.groupBy = reader.string(); - break; - case 4: - message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 5: - message.compareDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - case 7: message.pageToken = reader.string(); break; - case 8: + case 7: message.pageSize = reader.int32(); break; default: @@ -4920,51 +14595,35 @@ }; /** - * Decodes a GroupFindingsRequest message from the specified reader or buffer, length delimited. + * Decodes a ListSourcesRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest + * @memberof google.cloud.securitycenter.v1beta1.ListSourcesRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.GroupFindingsRequest} GroupFindingsRequest + * @returns {google.cloud.securitycenter.v1beta1.ListSourcesRequest} ListSourcesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GroupFindingsRequest.decodeDelimited = function decodeDelimited(reader) { + ListSourcesRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GroupFindingsRequest message. + * Verifies a ListSourcesRequest message. * @function verify - * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest + * @memberof google.cloud.securitycenter.v1beta1.ListSourcesRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GroupFindingsRequest.verify = function verify(message) { + ListSourcesRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.parent != null && message.hasOwnProperty("parent")) if (!$util.isString(message.parent)) return "parent: string expected"; - if (message.filter != null && message.hasOwnProperty("filter")) - if (!$util.isString(message.filter)) - return "filter: string expected"; - if (message.groupBy != null && message.hasOwnProperty("groupBy")) - if (!$util.isString(message.groupBy)) - return "groupBy: string expected"; - if (message.readTime != null && message.hasOwnProperty("readTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.readTime); - if (error) - return "readTime." + error; - } - if (message.compareDuration != null && message.hasOwnProperty("compareDuration")) { - var error = $root.google.protobuf.Duration.verify(message.compareDuration); - if (error) - return "compareDuration." + error; - } if (message.pageToken != null && message.hasOwnProperty("pageToken")) if (!$util.isString(message.pageToken)) return "pageToken: string expected"; @@ -4975,33 +14634,19 @@ }; /** - * Creates a GroupFindingsRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ListSourcesRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest + * @memberof google.cloud.securitycenter.v1beta1.ListSourcesRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.GroupFindingsRequest} GroupFindingsRequest + * @returns {google.cloud.securitycenter.v1beta1.ListSourcesRequest} ListSourcesRequest */ - GroupFindingsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.GroupFindingsRequest) + ListSourcesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1beta1.ListSourcesRequest) return object; - var message = new $root.google.cloud.securitycenter.v1.GroupFindingsRequest(); + var message = new $root.google.cloud.securitycenter.v1beta1.ListSourcesRequest(); if (object.parent != null) message.parent = String(object.parent); - if (object.filter != null) - message.filter = String(object.filter); - if (object.groupBy != null) - message.groupBy = String(object.groupBy); - if (object.readTime != null) { - if (typeof object.readTime !== "object") - throw TypeError(".google.cloud.securitycenter.v1.GroupFindingsRequest.readTime: object expected"); - message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); - } - if (object.compareDuration != null) { - if (typeof object.compareDuration !== "object") - throw TypeError(".google.cloud.securitycenter.v1.GroupFindingsRequest.compareDuration: object expected"); - message.compareDuration = $root.google.protobuf.Duration.fromObject(object.compareDuration); - } if (object.pageToken != null) message.pageToken = String(object.pageToken); if (object.pageSize != null) @@ -5010,37 +14655,25 @@ }; /** - * Creates a plain object from a GroupFindingsRequest message. Also converts values to other types if specified. + * Creates a plain object from a ListSourcesRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest + * @memberof google.cloud.securitycenter.v1beta1.ListSourcesRequest * @static - * @param {google.cloud.securitycenter.v1.GroupFindingsRequest} message GroupFindingsRequest + * @param {google.cloud.securitycenter.v1beta1.ListSourcesRequest} message ListSourcesRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GroupFindingsRequest.toObject = function toObject(message, options) { + ListSourcesRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { object.parent = ""; - object.filter = ""; - object.groupBy = ""; - object.readTime = null; - object.compareDuration = null; object.pageToken = ""; object.pageSize = 0; } if (message.parent != null && message.hasOwnProperty("parent")) object.parent = message.parent; - if (message.filter != null && message.hasOwnProperty("filter")) - object.filter = message.filter; - if (message.groupBy != null && message.hasOwnProperty("groupBy")) - object.groupBy = message.groupBy; - if (message.readTime != null && message.hasOwnProperty("readTime")) - object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); - if (message.compareDuration != null && message.hasOwnProperty("compareDuration")) - object.compareDuration = $root.google.protobuf.Duration.toObject(message.compareDuration, options); if (message.pageToken != null && message.hasOwnProperty("pageToken")) object.pageToken = message.pageToken; if (message.pageSize != null && message.hasOwnProperty("pageSize")) @@ -5049,41 +14682,39 @@ }; /** - * Converts this GroupFindingsRequest to JSON. + * Converts this ListSourcesRequest to JSON. * @function toJSON - * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest + * @memberof google.cloud.securitycenter.v1beta1.ListSourcesRequest * @instance * @returns {Object.} JSON object */ - GroupFindingsRequest.prototype.toJSON = function toJSON() { + ListSourcesRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return GroupFindingsRequest; + return ListSourcesRequest; })(); - v1.GroupFindingsResponse = (function() { + v1beta1.ListSourcesResponse = (function() { /** - * Properties of a GroupFindingsResponse. - * @memberof google.cloud.securitycenter.v1 - * @interface IGroupFindingsResponse - * @property {Array.|null} [groupByResults] GroupFindingsResponse groupByResults - * @property {google.protobuf.ITimestamp|null} [readTime] GroupFindingsResponse readTime - * @property {string|null} [nextPageToken] GroupFindingsResponse nextPageToken - * @property {number|null} [totalSize] GroupFindingsResponse totalSize + * Properties of a ListSourcesResponse. + * @memberof google.cloud.securitycenter.v1beta1 + * @interface IListSourcesResponse + * @property {Array.|null} [sources] ListSourcesResponse sources + * @property {string|null} [nextPageToken] ListSourcesResponse nextPageToken */ /** - * Constructs a new GroupFindingsResponse. - * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents a GroupFindingsResponse. - * @implements IGroupFindingsResponse + * Constructs a new ListSourcesResponse. + * @memberof google.cloud.securitycenter.v1beta1 + * @classdesc Represents a ListSourcesResponse. + * @implements IListSourcesResponse * @constructor - * @param {google.cloud.securitycenter.v1.IGroupFindingsResponse=} [properties] Properties to set + * @param {google.cloud.securitycenter.v1beta1.IListSourcesResponse=} [properties] Properties to set */ - function GroupFindingsResponse(properties) { - this.groupByResults = []; + function ListSourcesResponse(properties) { + this.sources = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -5091,118 +14722,92 @@ } /** - * GroupFindingsResponse groupByResults. - * @member {Array.} groupByResults - * @memberof google.cloud.securitycenter.v1.GroupFindingsResponse - * @instance - */ - GroupFindingsResponse.prototype.groupByResults = $util.emptyArray; - - /** - * GroupFindingsResponse readTime. - * @member {google.protobuf.ITimestamp|null|undefined} readTime - * @memberof google.cloud.securitycenter.v1.GroupFindingsResponse + * ListSourcesResponse sources. + * @member {Array.} sources + * @memberof google.cloud.securitycenter.v1beta1.ListSourcesResponse * @instance */ - GroupFindingsResponse.prototype.readTime = null; + ListSourcesResponse.prototype.sources = $util.emptyArray; /** - * GroupFindingsResponse nextPageToken. + * ListSourcesResponse nextPageToken. * @member {string} nextPageToken - * @memberof google.cloud.securitycenter.v1.GroupFindingsResponse - * @instance - */ - GroupFindingsResponse.prototype.nextPageToken = ""; - - /** - * GroupFindingsResponse totalSize. - * @member {number} totalSize - * @memberof google.cloud.securitycenter.v1.GroupFindingsResponse + * @memberof google.cloud.securitycenter.v1beta1.ListSourcesResponse * @instance */ - GroupFindingsResponse.prototype.totalSize = 0; + ListSourcesResponse.prototype.nextPageToken = ""; /** - * Creates a new GroupFindingsResponse instance using the specified properties. + * Creates a new ListSourcesResponse instance using the specified properties. * @function create - * @memberof google.cloud.securitycenter.v1.GroupFindingsResponse + * @memberof google.cloud.securitycenter.v1beta1.ListSourcesResponse * @static - * @param {google.cloud.securitycenter.v1.IGroupFindingsResponse=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.GroupFindingsResponse} GroupFindingsResponse instance + * @param {google.cloud.securitycenter.v1beta1.IListSourcesResponse=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1beta1.ListSourcesResponse} ListSourcesResponse instance */ - GroupFindingsResponse.create = function create(properties) { - return new GroupFindingsResponse(properties); + ListSourcesResponse.create = function create(properties) { + return new ListSourcesResponse(properties); }; /** - * Encodes the specified GroupFindingsResponse message. Does not implicitly {@link google.cloud.securitycenter.v1.GroupFindingsResponse.verify|verify} messages. + * Encodes the specified ListSourcesResponse message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.ListSourcesResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.securitycenter.v1.GroupFindingsResponse + * @memberof google.cloud.securitycenter.v1beta1.ListSourcesResponse * @static - * @param {google.cloud.securitycenter.v1.IGroupFindingsResponse} message GroupFindingsResponse message or plain object to encode + * @param {google.cloud.securitycenter.v1beta1.IListSourcesResponse} message ListSourcesResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GroupFindingsResponse.encode = function encode(message, writer) { + ListSourcesResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.groupByResults != null && message.groupByResults.length) - for (var i = 0; i < message.groupByResults.length; ++i) - $root.google.cloud.securitycenter.v1.GroupResult.encode(message.groupByResults[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.readTime != null && message.hasOwnProperty("readTime")) - $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.sources != null && message.sources.length) + for (var i = 0; i < message.sources.length; ++i) + $root.google.cloud.securitycenter.v1beta1.Source.encode(message.sources[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.nextPageToken); - if (message.totalSize != null && message.hasOwnProperty("totalSize")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.totalSize); + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); return writer; }; /** - * Encodes the specified GroupFindingsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.GroupFindingsResponse.verify|verify} messages. + * Encodes the specified ListSourcesResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.ListSourcesResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.GroupFindingsResponse + * @memberof google.cloud.securitycenter.v1beta1.ListSourcesResponse * @static - * @param {google.cloud.securitycenter.v1.IGroupFindingsResponse} message GroupFindingsResponse message or plain object to encode + * @param {google.cloud.securitycenter.v1beta1.IListSourcesResponse} message ListSourcesResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GroupFindingsResponse.encodeDelimited = function encodeDelimited(message, writer) { + ListSourcesResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GroupFindingsResponse message from the specified reader or buffer. + * Decodes a ListSourcesResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.securitycenter.v1.GroupFindingsResponse + * @memberof google.cloud.securitycenter.v1beta1.ListSourcesResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.GroupFindingsResponse} GroupFindingsResponse + * @returns {google.cloud.securitycenter.v1beta1.ListSourcesResponse} ListSourcesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GroupFindingsResponse.decode = function decode(reader, length) { + ListSourcesResponse.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.cloud.securitycenter.v1.GroupFindingsResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1beta1.ListSourcesResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - if (!(message.groupByResults && message.groupByResults.length)) - message.groupByResults = []; - message.groupByResults.push($root.google.cloud.securitycenter.v1.GroupResult.decode(reader, reader.uint32())); + if (!(message.sources && message.sources.length)) + message.sources = []; + message.sources.push($root.google.cloud.securitycenter.v1beta1.Source.decode(reader, reader.uint32())); break; case 2: - message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 3: message.nextPageToken = reader.string(); break; - case 4: - message.totalSize = reader.int32(); - break; default: reader.skipType(tag & 7); break; @@ -5212,254 +14817,307 @@ }; /** - * Decodes a GroupFindingsResponse message from the specified reader or buffer, length delimited. + * Decodes a ListSourcesResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.GroupFindingsResponse + * @memberof google.cloud.securitycenter.v1beta1.ListSourcesResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.GroupFindingsResponse} GroupFindingsResponse + * @returns {google.cloud.securitycenter.v1beta1.ListSourcesResponse} ListSourcesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GroupFindingsResponse.decodeDelimited = function decodeDelimited(reader) { + ListSourcesResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GroupFindingsResponse message. + * Verifies a ListSourcesResponse message. * @function verify - * @memberof google.cloud.securitycenter.v1.GroupFindingsResponse + * @memberof google.cloud.securitycenter.v1beta1.ListSourcesResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GroupFindingsResponse.verify = function verify(message) { + ListSourcesResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.groupByResults != null && message.hasOwnProperty("groupByResults")) { - if (!Array.isArray(message.groupByResults)) - return "groupByResults: array expected"; - for (var i = 0; i < message.groupByResults.length; ++i) { - var error = $root.google.cloud.securitycenter.v1.GroupResult.verify(message.groupByResults[i]); + if (message.sources != null && message.hasOwnProperty("sources")) { + if (!Array.isArray(message.sources)) + return "sources: array expected"; + for (var i = 0; i < message.sources.length; ++i) { + var error = $root.google.cloud.securitycenter.v1beta1.Source.verify(message.sources[i]); if (error) - return "groupByResults." + error; + return "sources." + error; } } - if (message.readTime != null && message.hasOwnProperty("readTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.readTime); - if (error) - return "readTime." + error; - } if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) if (!$util.isString(message.nextPageToken)) return "nextPageToken: string expected"; - if (message.totalSize != null && message.hasOwnProperty("totalSize")) - if (!$util.isInteger(message.totalSize)) - return "totalSize: integer expected"; return null; }; /** - * Creates a GroupFindingsResponse message from a plain object. Also converts values to their respective internal types. + * Creates a ListSourcesResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.securitycenter.v1.GroupFindingsResponse + * @memberof google.cloud.securitycenter.v1beta1.ListSourcesResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.GroupFindingsResponse} GroupFindingsResponse + * @returns {google.cloud.securitycenter.v1beta1.ListSourcesResponse} ListSourcesResponse */ - GroupFindingsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.GroupFindingsResponse) + ListSourcesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1beta1.ListSourcesResponse) return object; - var message = new $root.google.cloud.securitycenter.v1.GroupFindingsResponse(); - if (object.groupByResults) { - if (!Array.isArray(object.groupByResults)) - throw TypeError(".google.cloud.securitycenter.v1.GroupFindingsResponse.groupByResults: array expected"); - message.groupByResults = []; - for (var i = 0; i < object.groupByResults.length; ++i) { - if (typeof object.groupByResults[i] !== "object") - throw TypeError(".google.cloud.securitycenter.v1.GroupFindingsResponse.groupByResults: object expected"); - message.groupByResults[i] = $root.google.cloud.securitycenter.v1.GroupResult.fromObject(object.groupByResults[i]); + var message = new $root.google.cloud.securitycenter.v1beta1.ListSourcesResponse(); + if (object.sources) { + if (!Array.isArray(object.sources)) + throw TypeError(".google.cloud.securitycenter.v1beta1.ListSourcesResponse.sources: array expected"); + message.sources = []; + for (var i = 0; i < object.sources.length; ++i) { + if (typeof object.sources[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v1beta1.ListSourcesResponse.sources: object expected"); + message.sources[i] = $root.google.cloud.securitycenter.v1beta1.Source.fromObject(object.sources[i]); } } - if (object.readTime != null) { - if (typeof object.readTime !== "object") - throw TypeError(".google.cloud.securitycenter.v1.GroupFindingsResponse.readTime: object expected"); - message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); - } if (object.nextPageToken != null) message.nextPageToken = String(object.nextPageToken); - if (object.totalSize != null) - message.totalSize = object.totalSize | 0; return message; }; /** - * Creates a plain object from a GroupFindingsResponse message. Also converts values to other types if specified. + * Creates a plain object from a ListSourcesResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.securitycenter.v1.GroupFindingsResponse + * @memberof google.cloud.securitycenter.v1beta1.ListSourcesResponse * @static - * @param {google.cloud.securitycenter.v1.GroupFindingsResponse} message GroupFindingsResponse + * @param {google.cloud.securitycenter.v1beta1.ListSourcesResponse} message ListSourcesResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GroupFindingsResponse.toObject = function toObject(message, options) { + ListSourcesResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) - object.groupByResults = []; - if (options.defaults) { - object.readTime = null; + object.sources = []; + if (options.defaults) object.nextPageToken = ""; - object.totalSize = 0; - } - if (message.groupByResults && message.groupByResults.length) { - object.groupByResults = []; - for (var j = 0; j < message.groupByResults.length; ++j) - object.groupByResults[j] = $root.google.cloud.securitycenter.v1.GroupResult.toObject(message.groupByResults[j], options); + if (message.sources && message.sources.length) { + object.sources = []; + for (var j = 0; j < message.sources.length; ++j) + object.sources[j] = $root.google.cloud.securitycenter.v1beta1.Source.toObject(message.sources[j], options); } - if (message.readTime != null && message.hasOwnProperty("readTime")) - object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) object.nextPageToken = message.nextPageToken; - if (message.totalSize != null && message.hasOwnProperty("totalSize")) - object.totalSize = message.totalSize; return object; }; /** - * Converts this GroupFindingsResponse to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1.GroupFindingsResponse + * Converts this ListSourcesResponse to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1beta1.ListSourcesResponse + * @instance + * @returns {Object.} JSON object + */ + ListSourcesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListSourcesResponse; + })(); + + v1beta1.ListAssetsRequest = (function() { + + /** + * Properties of a ListAssetsRequest. + * @memberof google.cloud.securitycenter.v1beta1 + * @interface IListAssetsRequest + * @property {string|null} [parent] ListAssetsRequest parent + * @property {string|null} [filter] ListAssetsRequest filter + * @property {string|null} [orderBy] ListAssetsRequest orderBy + * @property {google.protobuf.ITimestamp|null} [readTime] ListAssetsRequest readTime + * @property {google.protobuf.IDuration|null} [compareDuration] ListAssetsRequest compareDuration + * @property {google.protobuf.IFieldMask|null} [fieldMask] ListAssetsRequest fieldMask + * @property {string|null} [pageToken] ListAssetsRequest pageToken + * @property {number|null} [pageSize] ListAssetsRequest pageSize + */ + + /** + * Constructs a new ListAssetsRequest. + * @memberof google.cloud.securitycenter.v1beta1 + * @classdesc Represents a ListAssetsRequest. + * @implements IListAssetsRequest + * @constructor + * @param {google.cloud.securitycenter.v1beta1.IListAssetsRequest=} [properties] Properties to set + */ + function ListAssetsRequest(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]]; + } + + /** + * ListAssetsRequest parent. + * @member {string} parent + * @memberof google.cloud.securitycenter.v1beta1.ListAssetsRequest * @instance - * @returns {Object.} JSON object */ - GroupFindingsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + ListAssetsRequest.prototype.parent = ""; - return GroupFindingsResponse; - })(); + /** + * ListAssetsRequest filter. + * @member {string} filter + * @memberof google.cloud.securitycenter.v1beta1.ListAssetsRequest + * @instance + */ + ListAssetsRequest.prototype.filter = ""; - v1.GroupResult = (function() { + /** + * ListAssetsRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.securitycenter.v1beta1.ListAssetsRequest + * @instance + */ + ListAssetsRequest.prototype.orderBy = ""; /** - * Properties of a GroupResult. - * @memberof google.cloud.securitycenter.v1 - * @interface IGroupResult - * @property {Object.|null} [properties] GroupResult properties - * @property {number|Long|null} [count] GroupResult count + * ListAssetsRequest readTime. + * @member {google.protobuf.ITimestamp|null|undefined} readTime + * @memberof google.cloud.securitycenter.v1beta1.ListAssetsRequest + * @instance */ + ListAssetsRequest.prototype.readTime = null; /** - * Constructs a new GroupResult. - * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents a GroupResult. - * @implements IGroupResult - * @constructor - * @param {google.cloud.securitycenter.v1.IGroupResult=} [properties] Properties to set + * ListAssetsRequest compareDuration. + * @member {google.protobuf.IDuration|null|undefined} compareDuration + * @memberof google.cloud.securitycenter.v1beta1.ListAssetsRequest + * @instance */ - function GroupResult(properties) { - this.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]]; - } + ListAssetsRequest.prototype.compareDuration = null; /** - * GroupResult properties. - * @member {Object.} properties - * @memberof google.cloud.securitycenter.v1.GroupResult + * ListAssetsRequest fieldMask. + * @member {google.protobuf.IFieldMask|null|undefined} fieldMask + * @memberof google.cloud.securitycenter.v1beta1.ListAssetsRequest * @instance */ - GroupResult.prototype.properties = $util.emptyObject; + ListAssetsRequest.prototype.fieldMask = null; /** - * GroupResult count. - * @member {number|Long} count - * @memberof google.cloud.securitycenter.v1.GroupResult + * ListAssetsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.securitycenter.v1beta1.ListAssetsRequest * @instance */ - GroupResult.prototype.count = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + ListAssetsRequest.prototype.pageToken = ""; /** - * Creates a new GroupResult instance using the specified properties. + * ListAssetsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.securitycenter.v1beta1.ListAssetsRequest + * @instance + */ + ListAssetsRequest.prototype.pageSize = 0; + + /** + * Creates a new ListAssetsRequest instance using the specified properties. * @function create - * @memberof google.cloud.securitycenter.v1.GroupResult + * @memberof google.cloud.securitycenter.v1beta1.ListAssetsRequest * @static - * @param {google.cloud.securitycenter.v1.IGroupResult=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.GroupResult} GroupResult instance + * @param {google.cloud.securitycenter.v1beta1.IListAssetsRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1beta1.ListAssetsRequest} ListAssetsRequest instance */ - GroupResult.create = function create(properties) { - return new GroupResult(properties); + ListAssetsRequest.create = function create(properties) { + return new ListAssetsRequest(properties); }; /** - * Encodes the specified GroupResult message. Does not implicitly {@link google.cloud.securitycenter.v1.GroupResult.verify|verify} messages. + * Encodes the specified ListAssetsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.ListAssetsRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.securitycenter.v1.GroupResult + * @memberof google.cloud.securitycenter.v1beta1.ListAssetsRequest * @static - * @param {google.cloud.securitycenter.v1.IGroupResult} message GroupResult message or plain object to encode + * @param {google.cloud.securitycenter.v1beta1.IListAssetsRequest} message ListAssetsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GroupResult.encode = function encode(message, writer) { + ListAssetsRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.properties != null && message.hasOwnProperty("properties")) - for (var keys = Object.keys(message.properties), i = 0; i < keys.length; ++i) { - writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); - $root.google.protobuf.Value.encode(message.properties[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); - } - if (message.count != null && message.hasOwnProperty("count")) - writer.uint32(/* id 2, wireType 0 =*/16).int64(message.count); + if (message.parent != null && message.hasOwnProperty("parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.filter != null && message.hasOwnProperty("filter")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.orderBy); + if (message.readTime != null && message.hasOwnProperty("readTime")) + $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.compareDuration != null && message.hasOwnProperty("compareDuration")) + $root.google.protobuf.Duration.encode(message.compareDuration, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.fieldMask != null && message.hasOwnProperty("fieldMask")) + $root.google.protobuf.FieldMask.encode(message.fieldMask, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.pageToken); + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.pageSize); return writer; }; /** - * Encodes the specified GroupResult message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.GroupResult.verify|verify} messages. + * Encodes the specified ListAssetsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.ListAssetsRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.GroupResult + * @memberof google.cloud.securitycenter.v1beta1.ListAssetsRequest * @static - * @param {google.cloud.securitycenter.v1.IGroupResult} message GroupResult message or plain object to encode + * @param {google.cloud.securitycenter.v1beta1.IListAssetsRequest} message ListAssetsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GroupResult.encodeDelimited = function encodeDelimited(message, writer) { + ListAssetsRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GroupResult message from the specified reader or buffer. + * Decodes a ListAssetsRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.securitycenter.v1.GroupResult + * @memberof google.cloud.securitycenter.v1beta1.ListAssetsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.GroupResult} GroupResult + * @returns {google.cloud.securitycenter.v1beta1.ListAssetsRequest} ListAssetsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GroupResult.decode = function decode(reader, length) { + ListAssetsRequest.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.cloud.securitycenter.v1.GroupResult(), key; + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1beta1.ListAssetsRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - reader.skip().pos++; - if (message.properties === $util.emptyObject) - message.properties = {}; - key = reader.string(); - reader.pos++; - message.properties[key] = $root.google.protobuf.Value.decode(reader, reader.uint32()); + message.parent = reader.string(); break; case 2: - message.count = reader.int64(); + message.filter = reader.string(); + break; + case 3: + message.orderBy = reader.string(); + break; + case 4: + message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 5: + message.compareDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + case 7: + message.fieldMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + case 8: + message.pageToken = reader.string(); + break; + case 9: + message.pageSize = reader.int32(); break; default: reader.skipType(tag & 7); @@ -5470,151 +15128,183 @@ }; /** - * Decodes a GroupResult message from the specified reader or buffer, length delimited. + * Decodes a ListAssetsRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.GroupResult + * @memberof google.cloud.securitycenter.v1beta1.ListAssetsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.GroupResult} GroupResult + * @returns {google.cloud.securitycenter.v1beta1.ListAssetsRequest} ListAssetsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GroupResult.decodeDelimited = function decodeDelimited(reader) { + ListAssetsRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GroupResult message. + * Verifies a ListAssetsRequest message. * @function verify - * @memberof google.cloud.securitycenter.v1.GroupResult + * @memberof google.cloud.securitycenter.v1beta1.ListAssetsRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GroupResult.verify = function verify(message) { + ListAssetsRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.properties != null && message.hasOwnProperty("properties")) { - if (!$util.isObject(message.properties)) - return "properties: object expected"; - var key = Object.keys(message.properties); - for (var i = 0; i < key.length; ++i) { - var error = $root.google.protobuf.Value.verify(message.properties[key[i]]); - if (error) - return "properties." + error; - } + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + if (message.readTime != null && message.hasOwnProperty("readTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.readTime); + if (error) + return "readTime." + error; } - if (message.count != null && message.hasOwnProperty("count")) - if (!$util.isInteger(message.count) && !(message.count && $util.isInteger(message.count.low) && $util.isInteger(message.count.high))) - return "count: integer|Long expected"; + if (message.compareDuration != null && message.hasOwnProperty("compareDuration")) { + var error = $root.google.protobuf.Duration.verify(message.compareDuration); + if (error) + return "compareDuration." + error; + } + if (message.fieldMask != null && message.hasOwnProperty("fieldMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.fieldMask); + if (error) + return "fieldMask." + error; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; return null; }; /** - * Creates a GroupResult message from a plain object. Also converts values to their respective internal types. + * Creates a ListAssetsRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.securitycenter.v1.GroupResult + * @memberof google.cloud.securitycenter.v1beta1.ListAssetsRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.GroupResult} GroupResult + * @returns {google.cloud.securitycenter.v1beta1.ListAssetsRequest} ListAssetsRequest */ - GroupResult.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.GroupResult) + ListAssetsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1beta1.ListAssetsRequest) return object; - var message = new $root.google.cloud.securitycenter.v1.GroupResult(); - if (object.properties) { - if (typeof object.properties !== "object") - throw TypeError(".google.cloud.securitycenter.v1.GroupResult.properties: object expected"); - message.properties = {}; - for (var keys = Object.keys(object.properties), i = 0; i < keys.length; ++i) { - if (typeof object.properties[keys[i]] !== "object") - throw TypeError(".google.cloud.securitycenter.v1.GroupResult.properties: object expected"); - message.properties[keys[i]] = $root.google.protobuf.Value.fromObject(object.properties[keys[i]]); - } + var message = new $root.google.cloud.securitycenter.v1beta1.ListAssetsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.filter != null) + message.filter = String(object.filter); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.readTime != null) { + if (typeof object.readTime !== "object") + throw TypeError(".google.cloud.securitycenter.v1beta1.ListAssetsRequest.readTime: object expected"); + message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); } - if (object.count != null) - if ($util.Long) - (message.count = $util.Long.fromValue(object.count)).unsigned = false; - else if (typeof object.count === "string") - message.count = parseInt(object.count, 10); - else if (typeof object.count === "number") - message.count = object.count; - else if (typeof object.count === "object") - message.count = new $util.LongBits(object.count.low >>> 0, object.count.high >>> 0).toNumber(); + if (object.compareDuration != null) { + if (typeof object.compareDuration !== "object") + throw TypeError(".google.cloud.securitycenter.v1beta1.ListAssetsRequest.compareDuration: object expected"); + message.compareDuration = $root.google.protobuf.Duration.fromObject(object.compareDuration); + } + if (object.fieldMask != null) { + if (typeof object.fieldMask !== "object") + throw TypeError(".google.cloud.securitycenter.v1beta1.ListAssetsRequest.fieldMask: object expected"); + message.fieldMask = $root.google.protobuf.FieldMask.fromObject(object.fieldMask); + } + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; return message; }; /** - * Creates a plain object from a GroupResult message. Also converts values to other types if specified. + * Creates a plain object from a ListAssetsRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.securitycenter.v1.GroupResult + * @memberof google.cloud.securitycenter.v1beta1.ListAssetsRequest * @static - * @param {google.cloud.securitycenter.v1.GroupResult} message GroupResult + * @param {google.cloud.securitycenter.v1beta1.ListAssetsRequest} message ListAssetsRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GroupResult.toObject = function toObject(message, options) { + ListAssetsRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.objects || options.defaults) - object.properties = {}; - if (options.defaults) - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.count = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.count = options.longs === String ? "0" : 0; - var keys2; - if (message.properties && (keys2 = Object.keys(message.properties)).length) { - object.properties = {}; - for (var j = 0; j < keys2.length; ++j) - object.properties[keys2[j]] = $root.google.protobuf.Value.toObject(message.properties[keys2[j]], options); + if (options.defaults) { + object.parent = ""; + object.filter = ""; + object.orderBy = ""; + object.readTime = null; + object.compareDuration = null; + object.fieldMask = null; + object.pageToken = ""; + object.pageSize = 0; } - if (message.count != null && message.hasOwnProperty("count")) - if (typeof message.count === "number") - object.count = options.longs === String ? String(message.count) : message.count; - else - object.count = options.longs === String ? $util.Long.prototype.toString.call(message.count) : options.longs === Number ? new $util.LongBits(message.count.low >>> 0, message.count.high >>> 0).toNumber() : message.count; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; + if (message.readTime != null && message.hasOwnProperty("readTime")) + object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); + if (message.compareDuration != null && message.hasOwnProperty("compareDuration")) + object.compareDuration = $root.google.protobuf.Duration.toObject(message.compareDuration, options); + if (message.fieldMask != null && message.hasOwnProperty("fieldMask")) + object.fieldMask = $root.google.protobuf.FieldMask.toObject(message.fieldMask, options); + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; return object; }; /** - * Converts this GroupResult to JSON. + * Converts this ListAssetsRequest to JSON. * @function toJSON - * @memberof google.cloud.securitycenter.v1.GroupResult + * @memberof google.cloud.securitycenter.v1beta1.ListAssetsRequest * @instance * @returns {Object.} JSON object */ - GroupResult.prototype.toJSON = function toJSON() { + ListAssetsRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return GroupResult; + return ListAssetsRequest; })(); - v1.ListSourcesRequest = (function() { + v1beta1.ListAssetsResponse = (function() { /** - * Properties of a ListSourcesRequest. - * @memberof google.cloud.securitycenter.v1 - * @interface IListSourcesRequest - * @property {string|null} [parent] ListSourcesRequest parent - * @property {string|null} [pageToken] ListSourcesRequest pageToken - * @property {number|null} [pageSize] ListSourcesRequest pageSize + * Properties of a ListAssetsResponse. + * @memberof google.cloud.securitycenter.v1beta1 + * @interface IListAssetsResponse + * @property {Array.|null} [listAssetsResults] ListAssetsResponse listAssetsResults + * @property {google.protobuf.ITimestamp|null} [readTime] ListAssetsResponse readTime + * @property {string|null} [nextPageToken] ListAssetsResponse nextPageToken + * @property {number|null} [totalSize] ListAssetsResponse totalSize */ /** - * Constructs a new ListSourcesRequest. - * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents a ListSourcesRequest. - * @implements IListSourcesRequest + * Constructs a new ListAssetsResponse. + * @memberof google.cloud.securitycenter.v1beta1 + * @classdesc Represents a ListAssetsResponse. + * @implements IListAssetsResponse * @constructor - * @param {google.cloud.securitycenter.v1.IListSourcesRequest=} [properties] Properties to set + * @param {google.cloud.securitycenter.v1beta1.IListAssetsResponse=} [properties] Properties to set */ - function ListSourcesRequest(properties) { + function ListAssetsResponse(properties) { + this.listAssetsResults = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -5622,101 +15312,117 @@ } /** - * ListSourcesRequest parent. - * @member {string} parent - * @memberof google.cloud.securitycenter.v1.ListSourcesRequest + * ListAssetsResponse listAssetsResults. + * @member {Array.} listAssetsResults + * @memberof google.cloud.securitycenter.v1beta1.ListAssetsResponse * @instance */ - ListSourcesRequest.prototype.parent = ""; + ListAssetsResponse.prototype.listAssetsResults = $util.emptyArray; /** - * ListSourcesRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.securitycenter.v1.ListSourcesRequest + * ListAssetsResponse readTime. + * @member {google.protobuf.ITimestamp|null|undefined} readTime + * @memberof google.cloud.securitycenter.v1beta1.ListAssetsResponse * @instance */ - ListSourcesRequest.prototype.pageToken = ""; + ListAssetsResponse.prototype.readTime = null; /** - * ListSourcesRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.securitycenter.v1.ListSourcesRequest + * ListAssetsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.securitycenter.v1beta1.ListAssetsResponse * @instance */ - ListSourcesRequest.prototype.pageSize = 0; + ListAssetsResponse.prototype.nextPageToken = ""; /** - * Creates a new ListSourcesRequest instance using the specified properties. + * ListAssetsResponse totalSize. + * @member {number} totalSize + * @memberof google.cloud.securitycenter.v1beta1.ListAssetsResponse + * @instance + */ + ListAssetsResponse.prototype.totalSize = 0; + + /** + * Creates a new ListAssetsResponse instance using the specified properties. * @function create - * @memberof google.cloud.securitycenter.v1.ListSourcesRequest + * @memberof google.cloud.securitycenter.v1beta1.ListAssetsResponse * @static - * @param {google.cloud.securitycenter.v1.IListSourcesRequest=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.ListSourcesRequest} ListSourcesRequest instance + * @param {google.cloud.securitycenter.v1beta1.IListAssetsResponse=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1beta1.ListAssetsResponse} ListAssetsResponse instance */ - ListSourcesRequest.create = function create(properties) { - return new ListSourcesRequest(properties); + ListAssetsResponse.create = function create(properties) { + return new ListAssetsResponse(properties); }; /** - * Encodes the specified ListSourcesRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.ListSourcesRequest.verify|verify} messages. + * Encodes the specified ListAssetsResponse message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.ListAssetsResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.securitycenter.v1.ListSourcesRequest + * @memberof google.cloud.securitycenter.v1beta1.ListAssetsResponse * @static - * @param {google.cloud.securitycenter.v1.IListSourcesRequest} message ListSourcesRequest message or plain object to encode + * @param {google.cloud.securitycenter.v1beta1.IListAssetsResponse} message ListAssetsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListSourcesRequest.encode = function encode(message, writer) { + ListAssetsResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && message.hasOwnProperty("parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.pageToken); - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - writer.uint32(/* id 7, wireType 0 =*/56).int32(message.pageSize); + if (message.listAssetsResults != null && message.listAssetsResults.length) + for (var i = 0; i < message.listAssetsResults.length; ++i) + $root.google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult.encode(message.listAssetsResults[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.readTime != null && message.hasOwnProperty("readTime")) + $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.nextPageToken); + if (message.totalSize != null && message.hasOwnProperty("totalSize")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.totalSize); return writer; }; /** - * Encodes the specified ListSourcesRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListSourcesRequest.verify|verify} messages. + * Encodes the specified ListAssetsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.ListAssetsResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.ListSourcesRequest + * @memberof google.cloud.securitycenter.v1beta1.ListAssetsResponse * @static - * @param {google.cloud.securitycenter.v1.IListSourcesRequest} message ListSourcesRequest message or plain object to encode + * @param {google.cloud.securitycenter.v1beta1.IListAssetsResponse} message ListAssetsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListSourcesRequest.encodeDelimited = function encodeDelimited(message, writer) { + ListAssetsResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListSourcesRequest message from the specified reader or buffer. + * Decodes a ListAssetsResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.securitycenter.v1.ListSourcesRequest + * @memberof google.cloud.securitycenter.v1beta1.ListAssetsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.ListSourcesRequest} ListSourcesRequest + * @returns {google.cloud.securitycenter.v1beta1.ListAssetsResponse} ListAssetsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListSourcesRequest.decode = function decode(reader, length) { + ListAssetsResponse.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.cloud.securitycenter.v1.ListSourcesRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1beta1.ListAssetsResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.parent = reader.string(); + if (!(message.listAssetsResults && message.listAssetsResults.length)) + message.listAssetsResults = []; + message.listAssetsResults.push($root.google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult.decode(reader, reader.uint32())); break; case 2: - message.pageToken = reader.string(); + message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; - case 7: - message.pageSize = reader.int32(); + case 3: + message.nextPageToken = reader.string(); + break; + case 4: + message.totalSize = reader.int32(); break; default: reader.skipType(tag & 7); @@ -5727,362 +15433,424 @@ }; /** - * Decodes a ListSourcesRequest message from the specified reader or buffer, length delimited. + * Decodes a ListAssetsResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.ListSourcesRequest + * @memberof google.cloud.securitycenter.v1beta1.ListAssetsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.ListSourcesRequest} ListSourcesRequest + * @returns {google.cloud.securitycenter.v1beta1.ListAssetsResponse} ListAssetsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListSourcesRequest.decodeDelimited = function decodeDelimited(reader) { + ListAssetsResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListSourcesRequest message. + * Verifies a ListAssetsResponse message. * @function verify - * @memberof google.cloud.securitycenter.v1.ListSourcesRequest + * @memberof google.cloud.securitycenter.v1beta1.ListAssetsResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListSourcesRequest.verify = function verify(message) { + ListAssetsResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; + if (message.listAssetsResults != null && message.hasOwnProperty("listAssetsResults")) { + if (!Array.isArray(message.listAssetsResults)) + return "listAssetsResults: array expected"; + for (var i = 0; i < message.listAssetsResults.length; ++i) { + var error = $root.google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult.verify(message.listAssetsResults[i]); + if (error) + return "listAssetsResults." + error; + } + } + if (message.readTime != null && message.hasOwnProperty("readTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.readTime); + if (error) + return "readTime." + error; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.totalSize != null && message.hasOwnProperty("totalSize")) + if (!$util.isInteger(message.totalSize)) + return "totalSize: integer expected"; return null; }; /** - * Creates a ListSourcesRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ListAssetsResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.securitycenter.v1.ListSourcesRequest + * @memberof google.cloud.securitycenter.v1beta1.ListAssetsResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.ListSourcesRequest} ListSourcesRequest + * @returns {google.cloud.securitycenter.v1beta1.ListAssetsResponse} ListAssetsResponse */ - ListSourcesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.ListSourcesRequest) + ListAssetsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1beta1.ListAssetsResponse) return object; - var message = new $root.google.cloud.securitycenter.v1.ListSourcesRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; + var message = new $root.google.cloud.securitycenter.v1beta1.ListAssetsResponse(); + if (object.listAssetsResults) { + if (!Array.isArray(object.listAssetsResults)) + throw TypeError(".google.cloud.securitycenter.v1beta1.ListAssetsResponse.listAssetsResults: array expected"); + message.listAssetsResults = []; + for (var i = 0; i < object.listAssetsResults.length; ++i) { + if (typeof object.listAssetsResults[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v1beta1.ListAssetsResponse.listAssetsResults: object expected"); + message.listAssetsResults[i] = $root.google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult.fromObject(object.listAssetsResults[i]); + } + } + if (object.readTime != null) { + if (typeof object.readTime !== "object") + throw TypeError(".google.cloud.securitycenter.v1beta1.ListAssetsResponse.readTime: object expected"); + message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.totalSize != null) + message.totalSize = object.totalSize | 0; return message; }; /** - * Creates a plain object from a ListSourcesRequest message. Also converts values to other types if specified. + * Creates a plain object from a ListAssetsResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.securitycenter.v1.ListSourcesRequest + * @memberof google.cloud.securitycenter.v1beta1.ListAssetsResponse * @static - * @param {google.cloud.securitycenter.v1.ListSourcesRequest} message ListSourcesRequest + * @param {google.cloud.securitycenter.v1beta1.ListAssetsResponse} message ListAssetsResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListSourcesRequest.toObject = function toObject(message, options) { + ListAssetsResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) + object.listAssetsResults = []; if (options.defaults) { - object.parent = ""; - object.pageToken = ""; - object.pageSize = 0; + object.readTime = null; + object.nextPageToken = ""; + object.totalSize = 0; } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; + if (message.listAssetsResults && message.listAssetsResults.length) { + object.listAssetsResults = []; + for (var j = 0; j < message.listAssetsResults.length; ++j) + object.listAssetsResults[j] = $root.google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult.toObject(message.listAssetsResults[j], options); + } + if (message.readTime != null && message.hasOwnProperty("readTime")) + object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.totalSize != null && message.hasOwnProperty("totalSize")) + object.totalSize = message.totalSize; return object; }; /** - * Converts this ListSourcesRequest to JSON. + * Converts this ListAssetsResponse to JSON. * @function toJSON - * @memberof google.cloud.securitycenter.v1.ListSourcesRequest + * @memberof google.cloud.securitycenter.v1beta1.ListAssetsResponse * @instance * @returns {Object.} JSON object */ - ListSourcesRequest.prototype.toJSON = function toJSON() { + ListAssetsResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ListSourcesRequest; - })(); + ListAssetsResponse.ListAssetsResult = (function() { - v1.ListSourcesResponse = (function() { + /** + * Properties of a ListAssetsResult. + * @memberof google.cloud.securitycenter.v1beta1.ListAssetsResponse + * @interface IListAssetsResult + * @property {google.cloud.securitycenter.v1beta1.IAsset|null} [asset] ListAssetsResult asset + * @property {google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult.State|null} [state] ListAssetsResult state + */ - /** - * Properties of a ListSourcesResponse. - * @memberof google.cloud.securitycenter.v1 - * @interface IListSourcesResponse - * @property {Array.|null} [sources] ListSourcesResponse sources - * @property {string|null} [nextPageToken] ListSourcesResponse nextPageToken - */ + /** + * Constructs a new ListAssetsResult. + * @memberof google.cloud.securitycenter.v1beta1.ListAssetsResponse + * @classdesc Represents a ListAssetsResult. + * @implements IListAssetsResult + * @constructor + * @param {google.cloud.securitycenter.v1beta1.ListAssetsResponse.IListAssetsResult=} [properties] Properties to set + */ + function ListAssetsResult(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]]; + } - /** - * Constructs a new ListSourcesResponse. - * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents a ListSourcesResponse. - * @implements IListSourcesResponse - * @constructor - * @param {google.cloud.securitycenter.v1.IListSourcesResponse=} [properties] Properties to set - */ - function ListSourcesResponse(properties) { - this.sources = []; - 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]]; - } + /** + * ListAssetsResult asset. + * @member {google.cloud.securitycenter.v1beta1.IAsset|null|undefined} asset + * @memberof google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult + * @instance + */ + ListAssetsResult.prototype.asset = null; - /** - * ListSourcesResponse sources. - * @member {Array.} sources - * @memberof google.cloud.securitycenter.v1.ListSourcesResponse - * @instance - */ - ListSourcesResponse.prototype.sources = $util.emptyArray; + /** + * ListAssetsResult state. + * @member {google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult.State} state + * @memberof google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult + * @instance + */ + ListAssetsResult.prototype.state = 0; - /** - * ListSourcesResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.securitycenter.v1.ListSourcesResponse - * @instance - */ - ListSourcesResponse.prototype.nextPageToken = ""; + /** + * Creates a new ListAssetsResult instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult + * @static + * @param {google.cloud.securitycenter.v1beta1.ListAssetsResponse.IListAssetsResult=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult} ListAssetsResult instance + */ + ListAssetsResult.create = function create(properties) { + return new ListAssetsResult(properties); + }; - /** - * Creates a new ListSourcesResponse instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v1.ListSourcesResponse - * @static - * @param {google.cloud.securitycenter.v1.IListSourcesResponse=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.ListSourcesResponse} ListSourcesResponse instance - */ - ListSourcesResponse.create = function create(properties) { - return new ListSourcesResponse(properties); - }; + /** + * Encodes the specified ListAssetsResult message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult + * @static + * @param {google.cloud.securitycenter.v1beta1.ListAssetsResponse.IListAssetsResult} message ListAssetsResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAssetsResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.asset != null && message.hasOwnProperty("asset")) + $root.google.cloud.securitycenter.v1beta1.Asset.encode(message.asset, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.state != null && message.hasOwnProperty("state")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.state); + return writer; + }; - /** - * Encodes the specified ListSourcesResponse message. Does not implicitly {@link google.cloud.securitycenter.v1.ListSourcesResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1.ListSourcesResponse - * @static - * @param {google.cloud.securitycenter.v1.IListSourcesResponse} message ListSourcesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListSourcesResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.sources != null && message.sources.length) - for (var i = 0; i < message.sources.length; ++i) - $root.google.cloud.securitycenter.v1.Source.encode(message.sources[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); - return writer; - }; + /** + * Encodes the specified ListAssetsResult message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult + * @static + * @param {google.cloud.securitycenter.v1beta1.ListAssetsResponse.IListAssetsResult} message ListAssetsResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAssetsResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListAssetsResult message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult} ListAssetsResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAssetsResult.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.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.asset = $root.google.cloud.securitycenter.v1beta1.Asset.decode(reader, reader.uint32()); + break; + case 2: + message.state = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Encodes the specified ListSourcesResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListSourcesResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.ListSourcesResponse - * @static - * @param {google.cloud.securitycenter.v1.IListSourcesResponse} message ListSourcesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListSourcesResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Decodes a ListAssetsResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult} ListAssetsResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAssetsResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Decodes a ListSourcesResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v1.ListSourcesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.ListSourcesResponse} ListSourcesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListSourcesResponse.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.cloud.securitycenter.v1.ListSourcesResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { + /** + * Verifies a ListAssetsResult message. + * @function verify + * @memberof google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListAssetsResult.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.asset != null && message.hasOwnProperty("asset")) { + var error = $root.google.cloud.securitycenter.v1beta1.Asset.verify(message.asset); + if (error) + return "asset." + error; + } + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + return null; + }; + + /** + * Creates a ListAssetsResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult} ListAssetsResult + */ + ListAssetsResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult) + return object; + var message = new $root.google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult(); + if (object.asset != null) { + if (typeof object.asset !== "object") + throw TypeError(".google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult.asset: object expected"); + message.asset = $root.google.cloud.securitycenter.v1beta1.Asset.fromObject(object.asset); + } + switch (object.state) { + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "UNUSED": case 1: - if (!(message.sources && message.sources.length)) - message.sources = []; - message.sources.push($root.google.cloud.securitycenter.v1.Source.decode(reader, reader.uint32())); + message.state = 1; break; + case "ADDED": case 2: - message.nextPageToken = reader.string(); + message.state = 2; break; - default: - reader.skipType(tag & 7); + case "REMOVED": + case 3: + message.state = 3; + break; + case "ACTIVE": + case 4: + message.state = 4; break; } - } - return message; - }; - - /** - * Decodes a ListSourcesResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.ListSourcesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.ListSourcesResponse} ListSourcesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListSourcesResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + return message; + }; - /** - * Verifies a ListSourcesResponse message. - * @function verify - * @memberof google.cloud.securitycenter.v1.ListSourcesResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListSourcesResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.sources != null && message.hasOwnProperty("sources")) { - if (!Array.isArray(message.sources)) - return "sources: array expected"; - for (var i = 0; i < message.sources.length; ++i) { - var error = $root.google.cloud.securitycenter.v1.Source.verify(message.sources[i]); - if (error) - return "sources." + error; + /** + * Creates a plain object from a ListAssetsResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult + * @static + * @param {google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult} message ListAssetsResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListAssetsResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.asset = null; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - return null; - }; - - /** - * Creates a ListSourcesResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v1.ListSourcesResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.ListSourcesResponse} ListSourcesResponse - */ - ListSourcesResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.ListSourcesResponse) + if (message.asset != null && message.hasOwnProperty("asset")) + object.asset = $root.google.cloud.securitycenter.v1beta1.Asset.toObject(message.asset, options); + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult.State[message.state] : message.state; return object; - var message = new $root.google.cloud.securitycenter.v1.ListSourcesResponse(); - if (object.sources) { - if (!Array.isArray(object.sources)) - throw TypeError(".google.cloud.securitycenter.v1.ListSourcesResponse.sources: array expected"); - message.sources = []; - for (var i = 0; i < object.sources.length; ++i) { - if (typeof object.sources[i] !== "object") - throw TypeError(".google.cloud.securitycenter.v1.ListSourcesResponse.sources: object expected"); - message.sources[i] = $root.google.cloud.securitycenter.v1.Source.fromObject(object.sources[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - return message; - }; + }; - /** - * Creates a plain object from a ListSourcesResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v1.ListSourcesResponse - * @static - * @param {google.cloud.securitycenter.v1.ListSourcesResponse} message ListSourcesResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListSourcesResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.sources = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.sources && message.sources.length) { - object.sources = []; - for (var j = 0; j < message.sources.length; ++j) - object.sources[j] = $root.google.cloud.securitycenter.v1.Source.toObject(message.sources[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - return object; - }; + /** + * Converts this ListAssetsResult to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult + * @instance + * @returns {Object.} JSON object + */ + ListAssetsResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * State enum. + * @name google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult.State + * @enum {string} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} UNUSED=1 UNUSED value + * @property {number} ADDED=2 ADDED value + * @property {number} REMOVED=3 REMOVED value + * @property {number} ACTIVE=4 ACTIVE value + */ + ListAssetsResult.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "UNUSED"] = 1; + values[valuesById[2] = "ADDED"] = 2; + values[valuesById[3] = "REMOVED"] = 3; + values[valuesById[4] = "ACTIVE"] = 4; + return values; + })(); - /** - * Converts this ListSourcesResponse to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1.ListSourcesResponse - * @instance - * @returns {Object.} JSON object - */ - ListSourcesResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + return ListAssetsResult; + })(); - return ListSourcesResponse; + return ListAssetsResponse; })(); - v1.ListAssetsRequest = (function() { + v1beta1.ListFindingsRequest = (function() { /** - * Properties of a ListAssetsRequest. - * @memberof google.cloud.securitycenter.v1 - * @interface IListAssetsRequest - * @property {string|null} [parent] ListAssetsRequest parent - * @property {string|null} [filter] ListAssetsRequest filter - * @property {string|null} [orderBy] ListAssetsRequest orderBy - * @property {google.protobuf.ITimestamp|null} [readTime] ListAssetsRequest readTime - * @property {google.protobuf.IDuration|null} [compareDuration] ListAssetsRequest compareDuration - * @property {google.protobuf.IFieldMask|null} [fieldMask] ListAssetsRequest fieldMask - * @property {string|null} [pageToken] ListAssetsRequest pageToken - * @property {number|null} [pageSize] ListAssetsRequest pageSize + * Properties of a ListFindingsRequest. + * @memberof google.cloud.securitycenter.v1beta1 + * @interface IListFindingsRequest + * @property {string|null} [parent] ListFindingsRequest parent + * @property {string|null} [filter] ListFindingsRequest filter + * @property {string|null} [orderBy] ListFindingsRequest orderBy + * @property {google.protobuf.ITimestamp|null} [readTime] ListFindingsRequest readTime + * @property {google.protobuf.IFieldMask|null} [fieldMask] ListFindingsRequest fieldMask + * @property {string|null} [pageToken] ListFindingsRequest pageToken + * @property {number|null} [pageSize] ListFindingsRequest pageSize */ /** - * Constructs a new ListAssetsRequest. - * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents a ListAssetsRequest. - * @implements IListAssetsRequest + * Constructs a new ListFindingsRequest. + * @memberof google.cloud.securitycenter.v1beta1 + * @classdesc Represents a ListFindingsRequest. + * @implements IListFindingsRequest * @constructor - * @param {google.cloud.securitycenter.v1.IListAssetsRequest=} [properties] Properties to set + * @param {google.cloud.securitycenter.v1beta1.IListFindingsRequest=} [properties] Properties to set */ - function ListAssetsRequest(properties) { + function ListFindingsRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -6090,91 +15858,83 @@ } /** - * ListAssetsRequest parent. + * ListFindingsRequest parent. * @member {string} parent - * @memberof google.cloud.securitycenter.v1.ListAssetsRequest + * @memberof google.cloud.securitycenter.v1beta1.ListFindingsRequest * @instance */ - ListAssetsRequest.prototype.parent = ""; + ListFindingsRequest.prototype.parent = ""; /** - * ListAssetsRequest filter. + * ListFindingsRequest filter. * @member {string} filter - * @memberof google.cloud.securitycenter.v1.ListAssetsRequest + * @memberof google.cloud.securitycenter.v1beta1.ListFindingsRequest * @instance */ - ListAssetsRequest.prototype.filter = ""; + ListFindingsRequest.prototype.filter = ""; /** - * ListAssetsRequest orderBy. + * ListFindingsRequest orderBy. * @member {string} orderBy - * @memberof google.cloud.securitycenter.v1.ListAssetsRequest + * @memberof google.cloud.securitycenter.v1beta1.ListFindingsRequest * @instance */ - ListAssetsRequest.prototype.orderBy = ""; + ListFindingsRequest.prototype.orderBy = ""; /** - * ListAssetsRequest readTime. + * ListFindingsRequest readTime. * @member {google.protobuf.ITimestamp|null|undefined} readTime - * @memberof google.cloud.securitycenter.v1.ListAssetsRequest - * @instance - */ - ListAssetsRequest.prototype.readTime = null; - - /** - * ListAssetsRequest compareDuration. - * @member {google.protobuf.IDuration|null|undefined} compareDuration - * @memberof google.cloud.securitycenter.v1.ListAssetsRequest + * @memberof google.cloud.securitycenter.v1beta1.ListFindingsRequest * @instance */ - ListAssetsRequest.prototype.compareDuration = null; + ListFindingsRequest.prototype.readTime = null; /** - * ListAssetsRequest fieldMask. + * ListFindingsRequest fieldMask. * @member {google.protobuf.IFieldMask|null|undefined} fieldMask - * @memberof google.cloud.securitycenter.v1.ListAssetsRequest + * @memberof google.cloud.securitycenter.v1beta1.ListFindingsRequest * @instance */ - ListAssetsRequest.prototype.fieldMask = null; + ListFindingsRequest.prototype.fieldMask = null; /** - * ListAssetsRequest pageToken. + * ListFindingsRequest pageToken. * @member {string} pageToken - * @memberof google.cloud.securitycenter.v1.ListAssetsRequest + * @memberof google.cloud.securitycenter.v1beta1.ListFindingsRequest * @instance */ - ListAssetsRequest.prototype.pageToken = ""; + ListFindingsRequest.prototype.pageToken = ""; /** - * ListAssetsRequest pageSize. + * ListFindingsRequest pageSize. * @member {number} pageSize - * @memberof google.cloud.securitycenter.v1.ListAssetsRequest + * @memberof google.cloud.securitycenter.v1beta1.ListFindingsRequest * @instance */ - ListAssetsRequest.prototype.pageSize = 0; + ListFindingsRequest.prototype.pageSize = 0; /** - * Creates a new ListAssetsRequest instance using the specified properties. + * Creates a new ListFindingsRequest instance using the specified properties. * @function create - * @memberof google.cloud.securitycenter.v1.ListAssetsRequest + * @memberof google.cloud.securitycenter.v1beta1.ListFindingsRequest * @static - * @param {google.cloud.securitycenter.v1.IListAssetsRequest=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.ListAssetsRequest} ListAssetsRequest instance + * @param {google.cloud.securitycenter.v1beta1.IListFindingsRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1beta1.ListFindingsRequest} ListFindingsRequest instance */ - ListAssetsRequest.create = function create(properties) { - return new ListAssetsRequest(properties); + ListFindingsRequest.create = function create(properties) { + return new ListFindingsRequest(properties); }; /** - * Encodes the specified ListAssetsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.ListAssetsRequest.verify|verify} messages. + * Encodes the specified ListFindingsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.ListFindingsRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.securitycenter.v1.ListAssetsRequest + * @memberof google.cloud.securitycenter.v1beta1.ListFindingsRequest * @static - * @param {google.cloud.securitycenter.v1.IListAssetsRequest} message ListAssetsRequest message or plain object to encode + * @param {google.cloud.securitycenter.v1beta1.IListFindingsRequest} message ListFindingsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListAssetsRequest.encode = function encode(message, writer) { + ListFindingsRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.parent != null && message.hasOwnProperty("parent")) @@ -6185,45 +15945,43 @@ writer.uint32(/* id 3, wireType 2 =*/26).string(message.orderBy); if (message.readTime != null && message.hasOwnProperty("readTime")) $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.compareDuration != null && message.hasOwnProperty("compareDuration")) - $root.google.protobuf.Duration.encode(message.compareDuration, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); if (message.fieldMask != null && message.hasOwnProperty("fieldMask")) - $root.google.protobuf.FieldMask.encode(message.fieldMask, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + $root.google.protobuf.FieldMask.encode(message.fieldMask, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); if (message.pageToken != null && message.hasOwnProperty("pageToken")) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.pageToken); + writer.uint32(/* id 6, wireType 2 =*/50).string(message.pageToken); if (message.pageSize != null && message.hasOwnProperty("pageSize")) - writer.uint32(/* id 9, wireType 0 =*/72).int32(message.pageSize); + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.pageSize); return writer; }; /** - * Encodes the specified ListAssetsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListAssetsRequest.verify|verify} messages. + * Encodes the specified ListFindingsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.ListFindingsRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.ListAssetsRequest + * @memberof google.cloud.securitycenter.v1beta1.ListFindingsRequest * @static - * @param {google.cloud.securitycenter.v1.IListAssetsRequest} message ListAssetsRequest message or plain object to encode + * @param {google.cloud.securitycenter.v1beta1.IListFindingsRequest} message ListFindingsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListAssetsRequest.encodeDelimited = function encodeDelimited(message, writer) { + ListFindingsRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListAssetsRequest message from the specified reader or buffer. + * Decodes a ListFindingsRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.securitycenter.v1.ListAssetsRequest + * @memberof google.cloud.securitycenter.v1beta1.ListFindingsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.ListAssetsRequest} ListAssetsRequest + * @returns {google.cloud.securitycenter.v1beta1.ListFindingsRequest} ListFindingsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListAssetsRequest.decode = function decode(reader, length) { + ListFindingsRequest.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.cloud.securitycenter.v1.ListAssetsRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1beta1.ListFindingsRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -6240,15 +15998,12 @@ message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; case 5: - message.compareDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - case 7: message.fieldMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); break; - case 8: + case 6: message.pageToken = reader.string(); break; - case 9: + case 7: message.pageSize = reader.int32(); break; default: @@ -6260,30 +16015,30 @@ }; /** - * Decodes a ListAssetsRequest message from the specified reader or buffer, length delimited. + * Decodes a ListFindingsRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.ListAssetsRequest + * @memberof google.cloud.securitycenter.v1beta1.ListFindingsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.ListAssetsRequest} ListAssetsRequest + * @returns {google.cloud.securitycenter.v1beta1.ListFindingsRequest} ListFindingsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListAssetsRequest.decodeDelimited = function decodeDelimited(reader) { + ListFindingsRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListAssetsRequest message. + * Verifies a ListFindingsRequest message. * @function verify - * @memberof google.cloud.securitycenter.v1.ListAssetsRequest + * @memberof google.cloud.securitycenter.v1beta1.ListFindingsRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListAssetsRequest.verify = function verify(message) { + ListFindingsRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.parent != null && message.hasOwnProperty("parent")) @@ -6300,11 +16055,6 @@ if (error) return "readTime." + error; } - if (message.compareDuration != null && message.hasOwnProperty("compareDuration")) { - var error = $root.google.protobuf.Duration.verify(message.compareDuration); - if (error) - return "compareDuration." + error; - } if (message.fieldMask != null && message.hasOwnProperty("fieldMask")) { var error = $root.google.protobuf.FieldMask.verify(message.fieldMask); if (error) @@ -6320,17 +16070,17 @@ }; /** - * Creates a ListAssetsRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ListFindingsRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.securitycenter.v1.ListAssetsRequest + * @memberof google.cloud.securitycenter.v1beta1.ListFindingsRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.ListAssetsRequest} ListAssetsRequest + * @returns {google.cloud.securitycenter.v1beta1.ListFindingsRequest} ListFindingsRequest */ - ListAssetsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.ListAssetsRequest) + ListFindingsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1beta1.ListFindingsRequest) return object; - var message = new $root.google.cloud.securitycenter.v1.ListAssetsRequest(); + var message = new $root.google.cloud.securitycenter.v1beta1.ListFindingsRequest(); if (object.parent != null) message.parent = String(object.parent); if (object.filter != null) @@ -6339,17 +16089,12 @@ message.orderBy = String(object.orderBy); if (object.readTime != null) { if (typeof object.readTime !== "object") - throw TypeError(".google.cloud.securitycenter.v1.ListAssetsRequest.readTime: object expected"); + throw TypeError(".google.cloud.securitycenter.v1beta1.ListFindingsRequest.readTime: object expected"); message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); } - if (object.compareDuration != null) { - if (typeof object.compareDuration !== "object") - throw TypeError(".google.cloud.securitycenter.v1.ListAssetsRequest.compareDuration: object expected"); - message.compareDuration = $root.google.protobuf.Duration.fromObject(object.compareDuration); - } if (object.fieldMask != null) { if (typeof object.fieldMask !== "object") - throw TypeError(".google.cloud.securitycenter.v1.ListAssetsRequest.fieldMask: object expected"); + throw TypeError(".google.cloud.securitycenter.v1beta1.ListFindingsRequest.fieldMask: object expected"); message.fieldMask = $root.google.protobuf.FieldMask.fromObject(object.fieldMask); } if (object.pageToken != null) @@ -6360,15 +16105,15 @@ }; /** - * Creates a plain object from a ListAssetsRequest message. Also converts values to other types if specified. + * Creates a plain object from a ListFindingsRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.securitycenter.v1.ListAssetsRequest + * @memberof google.cloud.securitycenter.v1beta1.ListFindingsRequest * @static - * @param {google.cloud.securitycenter.v1.ListAssetsRequest} message ListAssetsRequest + * @param {google.cloud.securitycenter.v1beta1.ListFindingsRequest} message ListFindingsRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListAssetsRequest.toObject = function toObject(message, options) { + ListFindingsRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; @@ -6377,7 +16122,6 @@ object.filter = ""; object.orderBy = ""; object.readTime = null; - object.compareDuration = null; object.fieldMask = null; object.pageToken = ""; object.pageSize = 0; @@ -6390,8 +16134,6 @@ object.orderBy = message.orderBy; if (message.readTime != null && message.hasOwnProperty("readTime")) object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); - if (message.compareDuration != null && message.hasOwnProperty("compareDuration")) - object.compareDuration = $root.google.protobuf.Duration.toObject(message.compareDuration, options); if (message.fieldMask != null && message.hasOwnProperty("fieldMask")) object.fieldMask = $root.google.protobuf.FieldMask.toObject(message.fieldMask, options); if (message.pageToken != null && message.hasOwnProperty("pageToken")) @@ -6402,41 +16144,41 @@ }; /** - * Converts this ListAssetsRequest to JSON. + * Converts this ListFindingsRequest to JSON. * @function toJSON - * @memberof google.cloud.securitycenter.v1.ListAssetsRequest + * @memberof google.cloud.securitycenter.v1beta1.ListFindingsRequest * @instance * @returns {Object.} JSON object */ - ListAssetsRequest.prototype.toJSON = function toJSON() { + ListFindingsRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ListAssetsRequest; + return ListFindingsRequest; })(); - v1.ListAssetsResponse = (function() { + v1beta1.ListFindingsResponse = (function() { /** - * Properties of a ListAssetsResponse. - * @memberof google.cloud.securitycenter.v1 - * @interface IListAssetsResponse - * @property {Array.|null} [listAssetsResults] ListAssetsResponse listAssetsResults - * @property {google.protobuf.ITimestamp|null} [readTime] ListAssetsResponse readTime - * @property {string|null} [nextPageToken] ListAssetsResponse nextPageToken - * @property {number|null} [totalSize] ListAssetsResponse totalSize + * Properties of a ListFindingsResponse. + * @memberof google.cloud.securitycenter.v1beta1 + * @interface IListFindingsResponse + * @property {Array.|null} [findings] ListFindingsResponse findings + * @property {google.protobuf.ITimestamp|null} [readTime] ListFindingsResponse readTime + * @property {string|null} [nextPageToken] ListFindingsResponse nextPageToken + * @property {number|null} [totalSize] ListFindingsResponse totalSize */ /** - * Constructs a new ListAssetsResponse. - * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents a ListAssetsResponse. - * @implements IListAssetsResponse + * Constructs a new ListFindingsResponse. + * @memberof google.cloud.securitycenter.v1beta1 + * @classdesc Represents a ListFindingsResponse. + * @implements IListFindingsResponse * @constructor - * @param {google.cloud.securitycenter.v1.IListAssetsResponse=} [properties] Properties to set + * @param {google.cloud.securitycenter.v1beta1.IListFindingsResponse=} [properties] Properties to set */ - function ListAssetsResponse(properties) { - this.listAssetsResults = []; + function ListFindingsResponse(properties) { + this.findings = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -6444,64 +16186,64 @@ } /** - * ListAssetsResponse listAssetsResults. - * @member {Array.} listAssetsResults - * @memberof google.cloud.securitycenter.v1.ListAssetsResponse + * ListFindingsResponse findings. + * @member {Array.} findings + * @memberof google.cloud.securitycenter.v1beta1.ListFindingsResponse * @instance */ - ListAssetsResponse.prototype.listAssetsResults = $util.emptyArray; + ListFindingsResponse.prototype.findings = $util.emptyArray; /** - * ListAssetsResponse readTime. + * ListFindingsResponse readTime. * @member {google.protobuf.ITimestamp|null|undefined} readTime - * @memberof google.cloud.securitycenter.v1.ListAssetsResponse + * @memberof google.cloud.securitycenter.v1beta1.ListFindingsResponse * @instance */ - ListAssetsResponse.prototype.readTime = null; + ListFindingsResponse.prototype.readTime = null; /** - * ListAssetsResponse nextPageToken. + * ListFindingsResponse nextPageToken. * @member {string} nextPageToken - * @memberof google.cloud.securitycenter.v1.ListAssetsResponse + * @memberof google.cloud.securitycenter.v1beta1.ListFindingsResponse * @instance */ - ListAssetsResponse.prototype.nextPageToken = ""; + ListFindingsResponse.prototype.nextPageToken = ""; /** - * ListAssetsResponse totalSize. + * ListFindingsResponse totalSize. * @member {number} totalSize - * @memberof google.cloud.securitycenter.v1.ListAssetsResponse + * @memberof google.cloud.securitycenter.v1beta1.ListFindingsResponse * @instance */ - ListAssetsResponse.prototype.totalSize = 0; + ListFindingsResponse.prototype.totalSize = 0; /** - * Creates a new ListAssetsResponse instance using the specified properties. + * Creates a new ListFindingsResponse instance using the specified properties. * @function create - * @memberof google.cloud.securitycenter.v1.ListAssetsResponse + * @memberof google.cloud.securitycenter.v1beta1.ListFindingsResponse * @static - * @param {google.cloud.securitycenter.v1.IListAssetsResponse=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.ListAssetsResponse} ListAssetsResponse instance + * @param {google.cloud.securitycenter.v1beta1.IListFindingsResponse=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1beta1.ListFindingsResponse} ListFindingsResponse instance */ - ListAssetsResponse.create = function create(properties) { - return new ListAssetsResponse(properties); + ListFindingsResponse.create = function create(properties) { + return new ListFindingsResponse(properties); }; /** - * Encodes the specified ListAssetsResponse message. Does not implicitly {@link google.cloud.securitycenter.v1.ListAssetsResponse.verify|verify} messages. + * Encodes the specified ListFindingsResponse message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.ListFindingsResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.securitycenter.v1.ListAssetsResponse + * @memberof google.cloud.securitycenter.v1beta1.ListFindingsResponse * @static - * @param {google.cloud.securitycenter.v1.IListAssetsResponse} message ListAssetsResponse message or plain object to encode + * @param {google.cloud.securitycenter.v1beta1.IListFindingsResponse} message ListFindingsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListAssetsResponse.encode = function encode(message, writer) { + ListFindingsResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.listAssetsResults != null && message.listAssetsResults.length) - for (var i = 0; i < message.listAssetsResults.length; ++i) - $root.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult.encode(message.listAssetsResults[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.findings != null && message.findings.length) + for (var i = 0; i < message.findings.length; ++i) + $root.google.cloud.securitycenter.v1beta1.Finding.encode(message.findings[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); if (message.readTime != null && message.hasOwnProperty("readTime")) $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) @@ -6512,40 +16254,40 @@ }; /** - * Encodes the specified ListAssetsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListAssetsResponse.verify|verify} messages. + * Encodes the specified ListFindingsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.ListFindingsResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.ListAssetsResponse + * @memberof google.cloud.securitycenter.v1beta1.ListFindingsResponse * @static - * @param {google.cloud.securitycenter.v1.IListAssetsResponse} message ListAssetsResponse message or plain object to encode + * @param {google.cloud.securitycenter.v1beta1.IListFindingsResponse} message ListFindingsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListAssetsResponse.encodeDelimited = function encodeDelimited(message, writer) { + ListFindingsResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListAssetsResponse message from the specified reader or buffer. + * Decodes a ListFindingsResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.securitycenter.v1.ListAssetsResponse + * @memberof google.cloud.securitycenter.v1beta1.ListFindingsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.ListAssetsResponse} ListAssetsResponse + * @returns {google.cloud.securitycenter.v1beta1.ListFindingsResponse} ListFindingsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListAssetsResponse.decode = function decode(reader, length) { + ListFindingsResponse.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.cloud.securitycenter.v1.ListAssetsResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1beta1.ListFindingsResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - if (!(message.listAssetsResults && message.listAssetsResults.length)) - message.listAssetsResults = []; - message.listAssetsResults.push($root.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult.decode(reader, reader.uint32())); + if (!(message.findings && message.findings.length)) + message.findings = []; + message.findings.push($root.google.cloud.securitycenter.v1beta1.Finding.decode(reader, reader.uint32())); break; case 2: message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); @@ -6565,39 +16307,39 @@ }; /** - * Decodes a ListAssetsResponse message from the specified reader or buffer, length delimited. + * Decodes a ListFindingsResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.ListAssetsResponse + * @memberof google.cloud.securitycenter.v1beta1.ListFindingsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.ListAssetsResponse} ListAssetsResponse + * @returns {google.cloud.securitycenter.v1beta1.ListFindingsResponse} ListFindingsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListAssetsResponse.decodeDelimited = function decodeDelimited(reader) { + ListFindingsResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListAssetsResponse message. + * Verifies a ListFindingsResponse message. * @function verify - * @memberof google.cloud.securitycenter.v1.ListAssetsResponse + * @memberof google.cloud.securitycenter.v1beta1.ListFindingsResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListAssetsResponse.verify = function verify(message) { + ListFindingsResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.listAssetsResults != null && message.hasOwnProperty("listAssetsResults")) { - if (!Array.isArray(message.listAssetsResults)) - return "listAssetsResults: array expected"; - for (var i = 0; i < message.listAssetsResults.length; ++i) { - var error = $root.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult.verify(message.listAssetsResults[i]); + if (message.findings != null && message.hasOwnProperty("findings")) { + if (!Array.isArray(message.findings)) + return "findings: array expected"; + for (var i = 0; i < message.findings.length; ++i) { + var error = $root.google.cloud.securitycenter.v1beta1.Finding.verify(message.findings[i]); if (error) - return "listAssetsResults." + error; + return "findings." + error; } } if (message.readTime != null && message.hasOwnProperty("readTime")) { @@ -6615,30 +16357,30 @@ }; /** - * Creates a ListAssetsResponse message from a plain object. Also converts values to their respective internal types. + * Creates a ListFindingsResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.securitycenter.v1.ListAssetsResponse + * @memberof google.cloud.securitycenter.v1beta1.ListFindingsResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.ListAssetsResponse} ListAssetsResponse + * @returns {google.cloud.securitycenter.v1beta1.ListFindingsResponse} ListFindingsResponse */ - ListAssetsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.ListAssetsResponse) + ListFindingsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1beta1.ListFindingsResponse) return object; - var message = new $root.google.cloud.securitycenter.v1.ListAssetsResponse(); - if (object.listAssetsResults) { - if (!Array.isArray(object.listAssetsResults)) - throw TypeError(".google.cloud.securitycenter.v1.ListAssetsResponse.listAssetsResults: array expected"); - message.listAssetsResults = []; - for (var i = 0; i < object.listAssetsResults.length; ++i) { - if (typeof object.listAssetsResults[i] !== "object") - throw TypeError(".google.cloud.securitycenter.v1.ListAssetsResponse.listAssetsResults: object expected"); - message.listAssetsResults[i] = $root.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult.fromObject(object.listAssetsResults[i]); + var message = new $root.google.cloud.securitycenter.v1beta1.ListFindingsResponse(); + if (object.findings) { + if (!Array.isArray(object.findings)) + throw TypeError(".google.cloud.securitycenter.v1beta1.ListFindingsResponse.findings: array expected"); + message.findings = []; + for (var i = 0; i < object.findings.length; ++i) { + if (typeof object.findings[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v1beta1.ListFindingsResponse.findings: object expected"); + message.findings[i] = $root.google.cloud.securitycenter.v1beta1.Finding.fromObject(object.findings[i]); } } if (object.readTime != null) { if (typeof object.readTime !== "object") - throw TypeError(".google.cloud.securitycenter.v1.ListAssetsResponse.readTime: object expected"); + throw TypeError(".google.cloud.securitycenter.v1beta1.ListFindingsResponse.readTime: object expected"); message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); } if (object.nextPageToken != null) @@ -6649,501 +16391,603 @@ }; /** - * Creates a plain object from a ListAssetsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v1.ListAssetsResponse + * Creates a plain object from a ListFindingsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1beta1.ListFindingsResponse + * @static + * @param {google.cloud.securitycenter.v1beta1.ListFindingsResponse} message ListFindingsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListFindingsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.findings = []; + if (options.defaults) { + object.readTime = null; + object.nextPageToken = ""; + object.totalSize = 0; + } + if (message.findings && message.findings.length) { + object.findings = []; + for (var j = 0; j < message.findings.length; ++j) + object.findings[j] = $root.google.cloud.securitycenter.v1beta1.Finding.toObject(message.findings[j], options); + } + if (message.readTime != null && message.hasOwnProperty("readTime")) + object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.totalSize != null && message.hasOwnProperty("totalSize")) + object.totalSize = message.totalSize; + return object; + }; + + /** + * Converts this ListFindingsResponse to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1beta1.ListFindingsResponse + * @instance + * @returns {Object.} JSON object + */ + ListFindingsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListFindingsResponse; + })(); + + v1beta1.SetFindingStateRequest = (function() { + + /** + * Properties of a SetFindingStateRequest. + * @memberof google.cloud.securitycenter.v1beta1 + * @interface ISetFindingStateRequest + * @property {string|null} [name] SetFindingStateRequest name + * @property {google.cloud.securitycenter.v1beta1.Finding.State|null} [state] SetFindingStateRequest state + * @property {google.protobuf.ITimestamp|null} [startTime] SetFindingStateRequest startTime + */ + + /** + * Constructs a new SetFindingStateRequest. + * @memberof google.cloud.securitycenter.v1beta1 + * @classdesc Represents a SetFindingStateRequest. + * @implements ISetFindingStateRequest + * @constructor + * @param {google.cloud.securitycenter.v1beta1.ISetFindingStateRequest=} [properties] Properties to set + */ + function SetFindingStateRequest(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]]; + } + + /** + * SetFindingStateRequest name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1beta1.SetFindingStateRequest + * @instance + */ + SetFindingStateRequest.prototype.name = ""; + + /** + * SetFindingStateRequest state. + * @member {google.cloud.securitycenter.v1beta1.Finding.State} state + * @memberof google.cloud.securitycenter.v1beta1.SetFindingStateRequest + * @instance + */ + SetFindingStateRequest.prototype.state = 0; + + /** + * SetFindingStateRequest startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.cloud.securitycenter.v1beta1.SetFindingStateRequest + * @instance + */ + SetFindingStateRequest.prototype.startTime = null; + + /** + * Creates a new SetFindingStateRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1beta1.SetFindingStateRequest + * @static + * @param {google.cloud.securitycenter.v1beta1.ISetFindingStateRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1beta1.SetFindingStateRequest} SetFindingStateRequest instance + */ + SetFindingStateRequest.create = function create(properties) { + return new SetFindingStateRequest(properties); + }; + + /** + * Encodes the specified SetFindingStateRequest message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.SetFindingStateRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1beta1.SetFindingStateRequest + * @static + * @param {google.cloud.securitycenter.v1beta1.ISetFindingStateRequest} message SetFindingStateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetFindingStateRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.state != null && message.hasOwnProperty("state")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.state); + if (message.startTime != null && message.hasOwnProperty("startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SetFindingStateRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.SetFindingStateRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1beta1.SetFindingStateRequest * @static - * @param {google.cloud.securitycenter.v1.ListAssetsResponse} message ListAssetsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object + * @param {google.cloud.securitycenter.v1beta1.ISetFindingStateRequest} message SetFindingStateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - ListAssetsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.listAssetsResults = []; - if (options.defaults) { - object.readTime = null; - object.nextPageToken = ""; - object.totalSize = 0; - } - if (message.listAssetsResults && message.listAssetsResults.length) { - object.listAssetsResults = []; - for (var j = 0; j < message.listAssetsResults.length; ++j) - object.listAssetsResults[j] = $root.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult.toObject(message.listAssetsResults[j], options); - } - if (message.readTime != null && message.hasOwnProperty("readTime")) - object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - if (message.totalSize != null && message.hasOwnProperty("totalSize")) - object.totalSize = message.totalSize; - return object; + SetFindingStateRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); }; /** - * Converts this ListAssetsResponse to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1.ListAssetsResponse - * @instance - * @returns {Object.} JSON object + * Decodes a SetFindingStateRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1beta1.SetFindingStateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1beta1.SetFindingStateRequest} SetFindingStateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListAssetsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - ListAssetsResponse.ListAssetsResult = (function() { - - /** - * Properties of a ListAssetsResult. - * @memberof google.cloud.securitycenter.v1.ListAssetsResponse - * @interface IListAssetsResult - * @property {google.cloud.securitycenter.v1.IAsset|null} [asset] ListAssetsResult asset - * @property {google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult.StateChange|null} [stateChange] ListAssetsResult stateChange - */ - - /** - * Constructs a new ListAssetsResult. - * @memberof google.cloud.securitycenter.v1.ListAssetsResponse - * @classdesc Represents a ListAssetsResult. - * @implements IListAssetsResult - * @constructor - * @param {google.cloud.securitycenter.v1.ListAssetsResponse.IListAssetsResult=} [properties] Properties to set - */ - function ListAssetsResult(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]]; - } - - /** - * ListAssetsResult asset. - * @member {google.cloud.securitycenter.v1.IAsset|null|undefined} asset - * @memberof google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult - * @instance - */ - ListAssetsResult.prototype.asset = null; - - /** - * ListAssetsResult stateChange. - * @member {google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult.StateChange} stateChange - * @memberof google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult - * @instance - */ - ListAssetsResult.prototype.stateChange = 0; - - /** - * Creates a new ListAssetsResult instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult - * @static - * @param {google.cloud.securitycenter.v1.ListAssetsResponse.IListAssetsResult=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult} ListAssetsResult instance - */ - ListAssetsResult.create = function create(properties) { - return new ListAssetsResult(properties); - }; - - /** - * Encodes the specified ListAssetsResult message. Does not implicitly {@link google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult - * @static - * @param {google.cloud.securitycenter.v1.ListAssetsResponse.IListAssetsResult} message ListAssetsResult message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListAssetsResult.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.asset != null && message.hasOwnProperty("asset")) - $root.google.cloud.securitycenter.v1.Asset.encode(message.asset, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.stateChange != null && message.hasOwnProperty("stateChange")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.stateChange); - return writer; - }; - - /** - * Encodes the specified ListAssetsResult message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult - * @static - * @param {google.cloud.securitycenter.v1.ListAssetsResponse.IListAssetsResult} message ListAssetsResult message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListAssetsResult.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListAssetsResult message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult} ListAssetsResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListAssetsResult.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.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.asset = $root.google.cloud.securitycenter.v1.Asset.decode(reader, reader.uint32()); - break; - case 2: - message.stateChange = reader.int32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListAssetsResult message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult} ListAssetsResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListAssetsResult.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListAssetsResult message. - * @function verify - * @memberof google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListAssetsResult.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.asset != null && message.hasOwnProperty("asset")) { - var error = $root.google.cloud.securitycenter.v1.Asset.verify(message.asset); - if (error) - return "asset." + error; + SetFindingStateRequest.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.cloud.securitycenter.v1beta1.SetFindingStateRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.state = reader.int32(); + break; + case 3: + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; } - if (message.stateChange != null && message.hasOwnProperty("stateChange")) - switch (message.stateChange) { - default: - return "stateChange: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - return null; - }; + } + return message; + }; - /** - * Creates a ListAssetsResult message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult} ListAssetsResult - */ - ListAssetsResult.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult) - return object; - var message = new $root.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult(); - if (object.asset != null) { - if (typeof object.asset !== "object") - throw TypeError(".google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult.asset: object expected"); - message.asset = $root.google.cloud.securitycenter.v1.Asset.fromObject(object.asset); - } - switch (object.stateChange) { - case "UNUSED": + /** + * Decodes a SetFindingStateRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1beta1.SetFindingStateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1beta1.SetFindingStateRequest} SetFindingStateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetFindingStateRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SetFindingStateRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1beta1.SetFindingStateRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SetFindingStateRequest.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.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; case 0: - message.stateChange = 0; - break; - case "ADDED": case 1: - message.stateChange = 1; - break; - case "REMOVED": case 2: - message.stateChange = 2; - break; - case "ACTIVE": - case 3: - message.stateChange = 3; break; } - return message; - }; + if (message.startTime != null && message.hasOwnProperty("startTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.startTime); + if (error) + return "startTime." + error; + } + return null; + }; - /** - * Creates a plain object from a ListAssetsResult message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult - * @static - * @param {google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult} message ListAssetsResult - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListAssetsResult.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.asset = null; - object.stateChange = options.enums === String ? "UNUSED" : 0; - } - if (message.asset != null && message.hasOwnProperty("asset")) - object.asset = $root.google.cloud.securitycenter.v1.Asset.toObject(message.asset, options); - if (message.stateChange != null && message.hasOwnProperty("stateChange")) - object.stateChange = options.enums === String ? $root.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult.StateChange[message.stateChange] : message.stateChange; + /** + * Creates a SetFindingStateRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1beta1.SetFindingStateRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1beta1.SetFindingStateRequest} SetFindingStateRequest + */ + SetFindingStateRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1beta1.SetFindingStateRequest) return object; - }; - - /** - * Converts this ListAssetsResult to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult - * @instance - * @returns {Object.} JSON object - */ - ListAssetsResult.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + var message = new $root.google.cloud.securitycenter.v1beta1.SetFindingStateRequest(); + if (object.name != null) + message.name = String(object.name); + switch (object.state) { + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "ACTIVE": + case 1: + message.state = 1; + break; + case "INACTIVE": + case 2: + message.state = 2; + break; + } + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.cloud.securitycenter.v1beta1.SetFindingStateRequest.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); + } + return message; + }; - /** - * StateChange enum. - * @name google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult.StateChange - * @enum {string} - * @property {number} UNUSED=0 UNUSED value - * @property {number} ADDED=1 ADDED value - * @property {number} REMOVED=2 REMOVED value - * @property {number} ACTIVE=3 ACTIVE value - */ - ListAssetsResult.StateChange = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "UNUSED"] = 0; - values[valuesById[1] = "ADDED"] = 1; - values[valuesById[2] = "REMOVED"] = 2; - values[valuesById[3] = "ACTIVE"] = 3; - return values; - })(); + /** + * Creates a plain object from a SetFindingStateRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1beta1.SetFindingStateRequest + * @static + * @param {google.cloud.securitycenter.v1beta1.SetFindingStateRequest} message SetFindingStateRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SetFindingStateRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.startTime = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.securitycenter.v1beta1.Finding.State[message.state] : message.state; + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); + return object; + }; - return ListAssetsResult; - })(); + /** + * Converts this SetFindingStateRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1beta1.SetFindingStateRequest + * @instance + * @returns {Object.} JSON object + */ + SetFindingStateRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - return ListAssetsResponse; + return SetFindingStateRequest; })(); - v1.ListFindingsRequest = (function() { + v1beta1.RunAssetDiscoveryRequest = (function() { /** - * Properties of a ListFindingsRequest. - * @memberof google.cloud.securitycenter.v1 - * @interface IListFindingsRequest - * @property {string|null} [parent] ListFindingsRequest parent - * @property {string|null} [filter] ListFindingsRequest filter - * @property {string|null} [orderBy] ListFindingsRequest orderBy - * @property {google.protobuf.ITimestamp|null} [readTime] ListFindingsRequest readTime - * @property {google.protobuf.IDuration|null} [compareDuration] ListFindingsRequest compareDuration - * @property {google.protobuf.IFieldMask|null} [fieldMask] ListFindingsRequest fieldMask - * @property {string|null} [pageToken] ListFindingsRequest pageToken - * @property {number|null} [pageSize] ListFindingsRequest pageSize + * Properties of a RunAssetDiscoveryRequest. + * @memberof google.cloud.securitycenter.v1beta1 + * @interface IRunAssetDiscoveryRequest + * @property {string|null} [parent] RunAssetDiscoveryRequest parent + */ + + /** + * Constructs a new RunAssetDiscoveryRequest. + * @memberof google.cloud.securitycenter.v1beta1 + * @classdesc Represents a RunAssetDiscoveryRequest. + * @implements IRunAssetDiscoveryRequest + * @constructor + * @param {google.cloud.securitycenter.v1beta1.IRunAssetDiscoveryRequest=} [properties] Properties to set + */ + function RunAssetDiscoveryRequest(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]]; + } + + /** + * RunAssetDiscoveryRequest parent. + * @member {string} parent + * @memberof google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest + * @instance + */ + RunAssetDiscoveryRequest.prototype.parent = ""; + + /** + * Creates a new RunAssetDiscoveryRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest + * @static + * @param {google.cloud.securitycenter.v1beta1.IRunAssetDiscoveryRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest} RunAssetDiscoveryRequest instance + */ + RunAssetDiscoveryRequest.create = function create(properties) { + return new RunAssetDiscoveryRequest(properties); + }; + + /** + * Encodes the specified RunAssetDiscoveryRequest message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest + * @static + * @param {google.cloud.securitycenter.v1beta1.IRunAssetDiscoveryRequest} message RunAssetDiscoveryRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RunAssetDiscoveryRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && message.hasOwnProperty("parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + return writer; + }; + + /** + * Encodes the specified RunAssetDiscoveryRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest + * @static + * @param {google.cloud.securitycenter.v1beta1.IRunAssetDiscoveryRequest} message RunAssetDiscoveryRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ + RunAssetDiscoveryRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; /** - * Constructs a new ListFindingsRequest. - * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents a ListFindingsRequest. - * @implements IListFindingsRequest - * @constructor - * @param {google.cloud.securitycenter.v1.IListFindingsRequest=} [properties] Properties to set + * Decodes a RunAssetDiscoveryRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest} RunAssetDiscoveryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - function ListFindingsRequest(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]]; - } + RunAssetDiscoveryRequest.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.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; /** - * ListFindingsRequest parent. - * @member {string} parent - * @memberof google.cloud.securitycenter.v1.ListFindingsRequest - * @instance + * Decodes a RunAssetDiscoveryRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest} RunAssetDiscoveryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListFindingsRequest.prototype.parent = ""; + RunAssetDiscoveryRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; /** - * ListFindingsRequest filter. - * @member {string} filter - * @memberof google.cloud.securitycenter.v1.ListFindingsRequest - * @instance + * Verifies a RunAssetDiscoveryRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListFindingsRequest.prototype.filter = ""; + RunAssetDiscoveryRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + return null; + }; /** - * ListFindingsRequest orderBy. - * @member {string} orderBy - * @memberof google.cloud.securitycenter.v1.ListFindingsRequest - * @instance + * Creates a RunAssetDiscoveryRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest} RunAssetDiscoveryRequest */ - ListFindingsRequest.prototype.orderBy = ""; + RunAssetDiscoveryRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest(); + if (object.parent != null) + message.parent = String(object.parent); + return message; + }; /** - * ListFindingsRequest readTime. - * @member {google.protobuf.ITimestamp|null|undefined} readTime - * @memberof google.cloud.securitycenter.v1.ListFindingsRequest - * @instance + * Creates a plain object from a RunAssetDiscoveryRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest + * @static + * @param {google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest} message RunAssetDiscoveryRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object */ - ListFindingsRequest.prototype.readTime = null; + RunAssetDiscoveryRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.parent = ""; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + return object; + }; /** - * ListFindingsRequest compareDuration. - * @member {google.protobuf.IDuration|null|undefined} compareDuration - * @memberof google.cloud.securitycenter.v1.ListFindingsRequest + * Converts this RunAssetDiscoveryRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest * @instance + * @returns {Object.} JSON object */ - ListFindingsRequest.prototype.compareDuration = null; + RunAssetDiscoveryRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return RunAssetDiscoveryRequest; + })(); + + v1beta1.UpdateFindingRequest = (function() { /** - * ListFindingsRequest fieldMask. - * @member {google.protobuf.IFieldMask|null|undefined} fieldMask - * @memberof google.cloud.securitycenter.v1.ListFindingsRequest - * @instance + * Properties of an UpdateFindingRequest. + * @memberof google.cloud.securitycenter.v1beta1 + * @interface IUpdateFindingRequest + * @property {google.cloud.securitycenter.v1beta1.IFinding|null} [finding] UpdateFindingRequest finding + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateFindingRequest updateMask */ - ListFindingsRequest.prototype.fieldMask = null; /** - * ListFindingsRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.securitycenter.v1.ListFindingsRequest + * Constructs a new UpdateFindingRequest. + * @memberof google.cloud.securitycenter.v1beta1 + * @classdesc Represents an UpdateFindingRequest. + * @implements IUpdateFindingRequest + * @constructor + * @param {google.cloud.securitycenter.v1beta1.IUpdateFindingRequest=} [properties] Properties to set + */ + function UpdateFindingRequest(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]]; + } + + /** + * UpdateFindingRequest finding. + * @member {google.cloud.securitycenter.v1beta1.IFinding|null|undefined} finding + * @memberof google.cloud.securitycenter.v1beta1.UpdateFindingRequest * @instance */ - ListFindingsRequest.prototype.pageToken = ""; + UpdateFindingRequest.prototype.finding = null; /** - * ListFindingsRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.securitycenter.v1.ListFindingsRequest + * UpdateFindingRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.securitycenter.v1beta1.UpdateFindingRequest * @instance */ - ListFindingsRequest.prototype.pageSize = 0; + UpdateFindingRequest.prototype.updateMask = null; /** - * Creates a new ListFindingsRequest instance using the specified properties. + * Creates a new UpdateFindingRequest instance using the specified properties. * @function create - * @memberof google.cloud.securitycenter.v1.ListFindingsRequest + * @memberof google.cloud.securitycenter.v1beta1.UpdateFindingRequest * @static - * @param {google.cloud.securitycenter.v1.IListFindingsRequest=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.ListFindingsRequest} ListFindingsRequest instance + * @param {google.cloud.securitycenter.v1beta1.IUpdateFindingRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1beta1.UpdateFindingRequest} UpdateFindingRequest instance */ - ListFindingsRequest.create = function create(properties) { - return new ListFindingsRequest(properties); + UpdateFindingRequest.create = function create(properties) { + return new UpdateFindingRequest(properties); }; /** - * Encodes the specified ListFindingsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.ListFindingsRequest.verify|verify} messages. + * Encodes the specified UpdateFindingRequest message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.UpdateFindingRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.securitycenter.v1.ListFindingsRequest + * @memberof google.cloud.securitycenter.v1beta1.UpdateFindingRequest * @static - * @param {google.cloud.securitycenter.v1.IListFindingsRequest} message ListFindingsRequest message or plain object to encode + * @param {google.cloud.securitycenter.v1beta1.IUpdateFindingRequest} message UpdateFindingRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListFindingsRequest.encode = function encode(message, writer) { + UpdateFindingRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && message.hasOwnProperty("parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.filter != null && message.hasOwnProperty("filter")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); - if (message.orderBy != null && message.hasOwnProperty("orderBy")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.orderBy); - if (message.readTime != null && message.hasOwnProperty("readTime")) - $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.compareDuration != null && message.hasOwnProperty("compareDuration")) - $root.google.protobuf.Duration.encode(message.compareDuration, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.fieldMask != null && message.hasOwnProperty("fieldMask")) - $root.google.protobuf.FieldMask.encode(message.fieldMask, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.pageToken); - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - writer.uint32(/* id 9, wireType 0 =*/72).int32(message.pageSize); + if (message.finding != null && message.hasOwnProperty("finding")) + $root.google.cloud.securitycenter.v1beta1.Finding.encode(message.finding, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** - * Encodes the specified ListFindingsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListFindingsRequest.verify|verify} messages. + * Encodes the specified UpdateFindingRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.UpdateFindingRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.ListFindingsRequest + * @memberof google.cloud.securitycenter.v1beta1.UpdateFindingRequest * @static - * @param {google.cloud.securitycenter.v1.IListFindingsRequest} message ListFindingsRequest message or plain object to encode + * @param {google.cloud.securitycenter.v1beta1.IUpdateFindingRequest} message UpdateFindingRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListFindingsRequest.encodeDelimited = function encodeDelimited(message, writer) { + UpdateFindingRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListFindingsRequest message from the specified reader or buffer. + * Decodes an UpdateFindingRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.securitycenter.v1.ListFindingsRequest + * @memberof google.cloud.securitycenter.v1beta1.UpdateFindingRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.ListFindingsRequest} ListFindingsRequest + * @returns {google.cloud.securitycenter.v1beta1.UpdateFindingRequest} UpdateFindingRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListFindingsRequest.decode = function decode(reader, length) { + UpdateFindingRequest.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.cloud.securitycenter.v1.ListFindingsRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1beta1.UpdateFindingRequest(); while (reader.pos < end) { var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.parent = reader.string(); - break; - case 2: - message.filter = reader.string(); - break; - case 3: - message.orderBy = reader.string(); - break; - case 4: - message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 5: - message.compareDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - case 7: - message.fieldMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - break; - case 8: - message.pageToken = reader.string(); + switch (tag >>> 3) { + case 1: + message.finding = $root.google.cloud.securitycenter.v1beta1.Finding.decode(reader, reader.uint32()); break; - case 9: - message.pageSize = reader.int32(); + case 2: + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -7154,183 +16998,127 @@ }; /** - * Decodes a ListFindingsRequest message from the specified reader or buffer, length delimited. + * Decodes an UpdateFindingRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.ListFindingsRequest + * @memberof google.cloud.securitycenter.v1beta1.UpdateFindingRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.ListFindingsRequest} ListFindingsRequest + * @returns {google.cloud.securitycenter.v1beta1.UpdateFindingRequest} UpdateFindingRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListFindingsRequest.decodeDelimited = function decodeDelimited(reader) { + UpdateFindingRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListFindingsRequest message. + * Verifies an UpdateFindingRequest message. * @function verify - * @memberof google.cloud.securitycenter.v1.ListFindingsRequest + * @memberof google.cloud.securitycenter.v1beta1.UpdateFindingRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListFindingsRequest.verify = function verify(message) { + UpdateFindingRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.filter != null && message.hasOwnProperty("filter")) - if (!$util.isString(message.filter)) - return "filter: string expected"; - if (message.orderBy != null && message.hasOwnProperty("orderBy")) - if (!$util.isString(message.orderBy)) - return "orderBy: string expected"; - if (message.readTime != null && message.hasOwnProperty("readTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.readTime); - if (error) - return "readTime." + error; - } - if (message.compareDuration != null && message.hasOwnProperty("compareDuration")) { - var error = $root.google.protobuf.Duration.verify(message.compareDuration); + if (message.finding != null && message.hasOwnProperty("finding")) { + var error = $root.google.cloud.securitycenter.v1beta1.Finding.verify(message.finding); if (error) - return "compareDuration." + error; + return "finding." + error; } - if (message.fieldMask != null && message.hasOwnProperty("fieldMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.fieldMask); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); if (error) - return "fieldMask." + error; + return "updateMask." + error; } - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; return null; }; /** - * Creates a ListFindingsRequest message from a plain object. Also converts values to their respective internal types. + * Creates an UpdateFindingRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.securitycenter.v1.ListFindingsRequest + * @memberof google.cloud.securitycenter.v1beta1.UpdateFindingRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.ListFindingsRequest} ListFindingsRequest + * @returns {google.cloud.securitycenter.v1beta1.UpdateFindingRequest} UpdateFindingRequest */ - ListFindingsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.ListFindingsRequest) + UpdateFindingRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1beta1.UpdateFindingRequest) return object; - var message = new $root.google.cloud.securitycenter.v1.ListFindingsRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.filter != null) - message.filter = String(object.filter); - if (object.orderBy != null) - message.orderBy = String(object.orderBy); - if (object.readTime != null) { - if (typeof object.readTime !== "object") - throw TypeError(".google.cloud.securitycenter.v1.ListFindingsRequest.readTime: object expected"); - message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); - } - if (object.compareDuration != null) { - if (typeof object.compareDuration !== "object") - throw TypeError(".google.cloud.securitycenter.v1.ListFindingsRequest.compareDuration: object expected"); - message.compareDuration = $root.google.protobuf.Duration.fromObject(object.compareDuration); + var message = new $root.google.cloud.securitycenter.v1beta1.UpdateFindingRequest(); + if (object.finding != null) { + if (typeof object.finding !== "object") + throw TypeError(".google.cloud.securitycenter.v1beta1.UpdateFindingRequest.finding: object expected"); + message.finding = $root.google.cloud.securitycenter.v1beta1.Finding.fromObject(object.finding); } - if (object.fieldMask != null) { - if (typeof object.fieldMask !== "object") - throw TypeError(".google.cloud.securitycenter.v1.ListFindingsRequest.fieldMask: object expected"); - message.fieldMask = $root.google.protobuf.FieldMask.fromObject(object.fieldMask); + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.securitycenter.v1beta1.UpdateFindingRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); } - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; return message; }; /** - * Creates a plain object from a ListFindingsRequest message. Also converts values to other types if specified. + * Creates a plain object from an UpdateFindingRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.securitycenter.v1.ListFindingsRequest + * @memberof google.cloud.securitycenter.v1beta1.UpdateFindingRequest * @static - * @param {google.cloud.securitycenter.v1.ListFindingsRequest} message ListFindingsRequest + * @param {google.cloud.securitycenter.v1beta1.UpdateFindingRequest} message UpdateFindingRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListFindingsRequest.toObject = function toObject(message, options) { + UpdateFindingRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.parent = ""; - object.filter = ""; - object.orderBy = ""; - object.readTime = null; - object.compareDuration = null; - object.fieldMask = null; - object.pageToken = ""; - object.pageSize = 0; + object.finding = null; + object.updateMask = null; } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.filter != null && message.hasOwnProperty("filter")) - object.filter = message.filter; - if (message.orderBy != null && message.hasOwnProperty("orderBy")) - object.orderBy = message.orderBy; - if (message.readTime != null && message.hasOwnProperty("readTime")) - object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); - if (message.compareDuration != null && message.hasOwnProperty("compareDuration")) - object.compareDuration = $root.google.protobuf.Duration.toObject(message.compareDuration, options); - if (message.fieldMask != null && message.hasOwnProperty("fieldMask")) - object.fieldMask = $root.google.protobuf.FieldMask.toObject(message.fieldMask, options); - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; + if (message.finding != null && message.hasOwnProperty("finding")) + object.finding = $root.google.cloud.securitycenter.v1beta1.Finding.toObject(message.finding, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); return object; }; /** - * Converts this ListFindingsRequest to JSON. + * Converts this UpdateFindingRequest to JSON. * @function toJSON - * @memberof google.cloud.securitycenter.v1.ListFindingsRequest + * @memberof google.cloud.securitycenter.v1beta1.UpdateFindingRequest * @instance * @returns {Object.} JSON object */ - ListFindingsRequest.prototype.toJSON = function toJSON() { + UpdateFindingRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ListFindingsRequest; + return UpdateFindingRequest; })(); - v1.ListFindingsResponse = (function() { + v1beta1.UpdateOrganizationSettingsRequest = (function() { /** - * Properties of a ListFindingsResponse. - * @memberof google.cloud.securitycenter.v1 - * @interface IListFindingsResponse - * @property {Array.|null} [listFindingsResults] ListFindingsResponse listFindingsResults - * @property {google.protobuf.ITimestamp|null} [readTime] ListFindingsResponse readTime - * @property {string|null} [nextPageToken] ListFindingsResponse nextPageToken - * @property {number|null} [totalSize] ListFindingsResponse totalSize + * Properties of an UpdateOrganizationSettingsRequest. + * @memberof google.cloud.securitycenter.v1beta1 + * @interface IUpdateOrganizationSettingsRequest + * @property {google.cloud.securitycenter.v1beta1.IOrganizationSettings|null} [organizationSettings] UpdateOrganizationSettingsRequest organizationSettings + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateOrganizationSettingsRequest updateMask */ /** - * Constructs a new ListFindingsResponse. - * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents a ListFindingsResponse. - * @implements IListFindingsResponse + * Constructs a new UpdateOrganizationSettingsRequest. + * @memberof google.cloud.securitycenter.v1beta1 + * @classdesc Represents an UpdateOrganizationSettingsRequest. + * @implements IUpdateOrganizationSettingsRequest * @constructor - * @param {google.cloud.securitycenter.v1.IListFindingsResponse=} [properties] Properties to set + * @param {google.cloud.securitycenter.v1beta1.IUpdateOrganizationSettingsRequest=} [properties] Properties to set */ - function ListFindingsResponse(properties) { - this.listFindingsResults = []; + function UpdateOrganizationSettingsRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -7338,117 +17126,88 @@ } /** - * ListFindingsResponse listFindingsResults. - * @member {Array.} listFindingsResults - * @memberof google.cloud.securitycenter.v1.ListFindingsResponse - * @instance - */ - ListFindingsResponse.prototype.listFindingsResults = $util.emptyArray; - - /** - * ListFindingsResponse readTime. - * @member {google.protobuf.ITimestamp|null|undefined} readTime - * @memberof google.cloud.securitycenter.v1.ListFindingsResponse - * @instance - */ - ListFindingsResponse.prototype.readTime = null; - - /** - * ListFindingsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.securitycenter.v1.ListFindingsResponse + * UpdateOrganizationSettingsRequest organizationSettings. + * @member {google.cloud.securitycenter.v1beta1.IOrganizationSettings|null|undefined} organizationSettings + * @memberof google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest * @instance */ - ListFindingsResponse.prototype.nextPageToken = ""; + UpdateOrganizationSettingsRequest.prototype.organizationSettings = null; /** - * ListFindingsResponse totalSize. - * @member {number} totalSize - * @memberof google.cloud.securitycenter.v1.ListFindingsResponse + * UpdateOrganizationSettingsRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest * @instance */ - ListFindingsResponse.prototype.totalSize = 0; + UpdateOrganizationSettingsRequest.prototype.updateMask = null; /** - * Creates a new ListFindingsResponse instance using the specified properties. + * Creates a new UpdateOrganizationSettingsRequest instance using the specified properties. * @function create - * @memberof google.cloud.securitycenter.v1.ListFindingsResponse + * @memberof google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest * @static - * @param {google.cloud.securitycenter.v1.IListFindingsResponse=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.ListFindingsResponse} ListFindingsResponse instance + * @param {google.cloud.securitycenter.v1beta1.IUpdateOrganizationSettingsRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest} UpdateOrganizationSettingsRequest instance */ - ListFindingsResponse.create = function create(properties) { - return new ListFindingsResponse(properties); + UpdateOrganizationSettingsRequest.create = function create(properties) { + return new UpdateOrganizationSettingsRequest(properties); }; /** - * Encodes the specified ListFindingsResponse message. Does not implicitly {@link google.cloud.securitycenter.v1.ListFindingsResponse.verify|verify} messages. + * Encodes the specified UpdateOrganizationSettingsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.securitycenter.v1.ListFindingsResponse + * @memberof google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest * @static - * @param {google.cloud.securitycenter.v1.IListFindingsResponse} message ListFindingsResponse message or plain object to encode + * @param {google.cloud.securitycenter.v1beta1.IUpdateOrganizationSettingsRequest} message UpdateOrganizationSettingsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListFindingsResponse.encode = function encode(message, writer) { + UpdateOrganizationSettingsRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.listFindingsResults != null && message.listFindingsResults.length) - for (var i = 0; i < message.listFindingsResults.length; ++i) - $root.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.encode(message.listFindingsResults[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.readTime != null && message.hasOwnProperty("readTime")) - $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.nextPageToken); - if (message.totalSize != null && message.hasOwnProperty("totalSize")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.totalSize); + if (message.organizationSettings != null && message.hasOwnProperty("organizationSettings")) + $root.google.cloud.securitycenter.v1beta1.OrganizationSettings.encode(message.organizationSettings, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** - * Encodes the specified ListFindingsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListFindingsResponse.verify|verify} messages. + * Encodes the specified UpdateOrganizationSettingsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.ListFindingsResponse + * @memberof google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest * @static - * @param {google.cloud.securitycenter.v1.IListFindingsResponse} message ListFindingsResponse message or plain object to encode + * @param {google.cloud.securitycenter.v1beta1.IUpdateOrganizationSettingsRequest} message UpdateOrganizationSettingsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListFindingsResponse.encodeDelimited = function encodeDelimited(message, writer) { + UpdateOrganizationSettingsRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListFindingsResponse message from the specified reader or buffer. + * Decodes an UpdateOrganizationSettingsRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.securitycenter.v1.ListFindingsResponse + * @memberof google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.ListFindingsResponse} ListFindingsResponse + * @returns {google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest} UpdateOrganizationSettingsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListFindingsResponse.decode = function decode(reader, length) { + UpdateOrganizationSettingsRequest.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.cloud.securitycenter.v1.ListFindingsResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - if (!(message.listFindingsResults && message.listFindingsResults.length)) - message.listFindingsResults = []; - message.listFindingsResults.push($root.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.decode(reader, reader.uint32())); + case 1: + message.organizationSettings = $root.google.cloud.securitycenter.v1beta1.OrganizationSettings.decode(reader, reader.uint32()); break; case 2: - message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 3: - message.nextPageToken = reader.string(); - break; - case 4: - message.totalSize = reader.int32(); + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -7459,723 +17218,595 @@ }; /** - * Decodes a ListFindingsResponse message from the specified reader or buffer, length delimited. + * Decodes an UpdateOrganizationSettingsRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.ListFindingsResponse + * @memberof google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.ListFindingsResponse} ListFindingsResponse + * @returns {google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest} UpdateOrganizationSettingsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListFindingsResponse.decodeDelimited = function decodeDelimited(reader) { + UpdateOrganizationSettingsRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListFindingsResponse message. + * Verifies an UpdateOrganizationSettingsRequest message. * @function verify - * @memberof google.cloud.securitycenter.v1.ListFindingsResponse + * @memberof google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListFindingsResponse.verify = function verify(message) { + UpdateOrganizationSettingsRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.listFindingsResults != null && message.hasOwnProperty("listFindingsResults")) { - if (!Array.isArray(message.listFindingsResults)) - return "listFindingsResults: array expected"; - for (var i = 0; i < message.listFindingsResults.length; ++i) { - var error = $root.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.verify(message.listFindingsResults[i]); - if (error) - return "listFindingsResults." + error; - } + if (message.organizationSettings != null && message.hasOwnProperty("organizationSettings")) { + var error = $root.google.cloud.securitycenter.v1beta1.OrganizationSettings.verify(message.organizationSettings); + if (error) + return "organizationSettings." + error; } - if (message.readTime != null && message.hasOwnProperty("readTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.readTime); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); if (error) - return "readTime." + error; + return "updateMask." + error; } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - if (message.totalSize != null && message.hasOwnProperty("totalSize")) - if (!$util.isInteger(message.totalSize)) - return "totalSize: integer expected"; return null; }; /** - * Creates a ListFindingsResponse message from a plain object. Also converts values to their respective internal types. + * Creates an UpdateOrganizationSettingsRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.securitycenter.v1.ListFindingsResponse + * @memberof google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.ListFindingsResponse} ListFindingsResponse + * @returns {google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest} UpdateOrganizationSettingsRequest */ - ListFindingsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.ListFindingsResponse) + UpdateOrganizationSettingsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest) return object; - var message = new $root.google.cloud.securitycenter.v1.ListFindingsResponse(); - if (object.listFindingsResults) { - if (!Array.isArray(object.listFindingsResults)) - throw TypeError(".google.cloud.securitycenter.v1.ListFindingsResponse.listFindingsResults: array expected"); - message.listFindingsResults = []; - for (var i = 0; i < object.listFindingsResults.length; ++i) { - if (typeof object.listFindingsResults[i] !== "object") - throw TypeError(".google.cloud.securitycenter.v1.ListFindingsResponse.listFindingsResults: object expected"); - message.listFindingsResults[i] = $root.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.fromObject(object.listFindingsResults[i]); - } + var message = new $root.google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest(); + if (object.organizationSettings != null) { + if (typeof object.organizationSettings !== "object") + throw TypeError(".google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest.organizationSettings: object expected"); + message.organizationSettings = $root.google.cloud.securitycenter.v1beta1.OrganizationSettings.fromObject(object.organizationSettings); } - if (object.readTime != null) { - if (typeof object.readTime !== "object") - throw TypeError(".google.cloud.securitycenter.v1.ListFindingsResponse.readTime: object expected"); - message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - if (object.totalSize != null) - message.totalSize = object.totalSize | 0; return message; }; /** - * Creates a plain object from a ListFindingsResponse message. Also converts values to other types if specified. + * Creates a plain object from an UpdateOrganizationSettingsRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.securitycenter.v1.ListFindingsResponse + * @memberof google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest * @static - * @param {google.cloud.securitycenter.v1.ListFindingsResponse} message ListFindingsResponse + * @param {google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest} message UpdateOrganizationSettingsRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListFindingsResponse.toObject = function toObject(message, options) { + UpdateOrganizationSettingsRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.listFindingsResults = []; if (options.defaults) { - object.readTime = null; - object.nextPageToken = ""; - object.totalSize = 0; - } - if (message.listFindingsResults && message.listFindingsResults.length) { - object.listFindingsResults = []; - for (var j = 0; j < message.listFindingsResults.length; ++j) - object.listFindingsResults[j] = $root.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.toObject(message.listFindingsResults[j], options); + object.organizationSettings = null; + object.updateMask = null; } - if (message.readTime != null && message.hasOwnProperty("readTime")) - object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - if (message.totalSize != null && message.hasOwnProperty("totalSize")) - object.totalSize = message.totalSize; + if (message.organizationSettings != null && message.hasOwnProperty("organizationSettings")) + object.organizationSettings = $root.google.cloud.securitycenter.v1beta1.OrganizationSettings.toObject(message.organizationSettings, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); return object; }; /** - * Converts this ListFindingsResponse to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1.ListFindingsResponse - * @instance - * @returns {Object.} JSON object - */ - ListFindingsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - ListFindingsResponse.ListFindingsResult = (function() { - - /** - * Properties of a ListFindingsResult. - * @memberof google.cloud.securitycenter.v1.ListFindingsResponse - * @interface IListFindingsResult - * @property {google.cloud.securitycenter.v1.IFinding|null} [finding] ListFindingsResult finding - * @property {google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.StateChange|null} [stateChange] ListFindingsResult stateChange - * @property {google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.IResource|null} [resource] ListFindingsResult resource - */ - - /** - * Constructs a new ListFindingsResult. - * @memberof google.cloud.securitycenter.v1.ListFindingsResponse - * @classdesc Represents a ListFindingsResult. - * @implements IListFindingsResult - * @constructor - * @param {google.cloud.securitycenter.v1.ListFindingsResponse.IListFindingsResult=} [properties] Properties to set - */ - function ListFindingsResult(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]]; - } - - /** - * ListFindingsResult finding. - * @member {google.cloud.securitycenter.v1.IFinding|null|undefined} finding - * @memberof google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult - * @instance - */ - ListFindingsResult.prototype.finding = null; - - /** - * ListFindingsResult stateChange. - * @member {google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.StateChange} stateChange - * @memberof google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult - * @instance - */ - ListFindingsResult.prototype.stateChange = 0; - - /** - * ListFindingsResult resource. - * @member {google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.IResource|null|undefined} resource - * @memberof google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult - * @instance - */ - ListFindingsResult.prototype.resource = null; - - /** - * Creates a new ListFindingsResult instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult - * @static - * @param {google.cloud.securitycenter.v1.ListFindingsResponse.IListFindingsResult=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult} ListFindingsResult instance - */ - ListFindingsResult.create = function create(properties) { - return new ListFindingsResult(properties); - }; - - /** - * Encodes the specified ListFindingsResult message. Does not implicitly {@link google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult - * @static - * @param {google.cloud.securitycenter.v1.ListFindingsResponse.IListFindingsResult} message ListFindingsResult message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListFindingsResult.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.finding != null && message.hasOwnProperty("finding")) - $root.google.cloud.securitycenter.v1.Finding.encode(message.finding, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.stateChange != null && message.hasOwnProperty("stateChange")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.stateChange); - if (message.resource != null && message.hasOwnProperty("resource")) - $root.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource.encode(message.resource, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ListFindingsResult message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult - * @static - * @param {google.cloud.securitycenter.v1.ListFindingsResponse.IListFindingsResult} message ListFindingsResult message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListFindingsResult.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListFindingsResult message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult} ListFindingsResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListFindingsResult.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.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.finding = $root.google.cloud.securitycenter.v1.Finding.decode(reader, reader.uint32()); - break; - case 2: - message.stateChange = reader.int32(); - break; - case 3: - message.resource = $root.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + * Converts this UpdateOrganizationSettingsRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateOrganizationSettingsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Decodes a ListFindingsResult message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult} ListFindingsResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListFindingsResult.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + return UpdateOrganizationSettingsRequest; + })(); - /** - * Verifies a ListFindingsResult message. - * @function verify - * @memberof google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListFindingsResult.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.finding != null && message.hasOwnProperty("finding")) { - var error = $root.google.cloud.securitycenter.v1.Finding.verify(message.finding); - if (error) - return "finding." + error; - } - if (message.stateChange != null && message.hasOwnProperty("stateChange")) - switch (message.stateChange) { - default: - return "stateChange: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - break; - } - if (message.resource != null && message.hasOwnProperty("resource")) { - var error = $root.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource.verify(message.resource); - if (error) - return "resource." + error; - } - return null; - }; + v1beta1.UpdateSourceRequest = (function() { - /** - * Creates a ListFindingsResult message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult} ListFindingsResult - */ - ListFindingsResult.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult) - return object; - var message = new $root.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult(); - if (object.finding != null) { - if (typeof object.finding !== "object") - throw TypeError(".google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.finding: object expected"); - message.finding = $root.google.cloud.securitycenter.v1.Finding.fromObject(object.finding); - } - switch (object.stateChange) { - case "UNUSED": - case 0: - message.stateChange = 0; - break; - case "CHANGED": - case 1: - message.stateChange = 1; - break; - case "UNCHANGED": - case 2: - message.stateChange = 2; - break; - case "ADDED": - case 3: - message.stateChange = 3; - break; - case "REMOVED": - case 4: - message.stateChange = 4; - break; - } - if (object.resource != null) { - if (typeof object.resource !== "object") - throw TypeError(".google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.resource: object expected"); - message.resource = $root.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource.fromObject(object.resource); - } - return message; - }; + /** + * Properties of an UpdateSourceRequest. + * @memberof google.cloud.securitycenter.v1beta1 + * @interface IUpdateSourceRequest + * @property {google.cloud.securitycenter.v1beta1.ISource|null} [source] UpdateSourceRequest source + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateSourceRequest updateMask + */ - /** - * Creates a plain object from a ListFindingsResult message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult - * @static - * @param {google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult} message ListFindingsResult - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListFindingsResult.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.finding = null; - object.stateChange = options.enums === String ? "UNUSED" : 0; - object.resource = null; - } - if (message.finding != null && message.hasOwnProperty("finding")) - object.finding = $root.google.cloud.securitycenter.v1.Finding.toObject(message.finding, options); - if (message.stateChange != null && message.hasOwnProperty("stateChange")) - object.stateChange = options.enums === String ? $root.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.StateChange[message.stateChange] : message.stateChange; - if (message.resource != null && message.hasOwnProperty("resource")) - object.resource = $root.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource.toObject(message.resource, options); - return object; - }; + /** + * Constructs a new UpdateSourceRequest. + * @memberof google.cloud.securitycenter.v1beta1 + * @classdesc Represents an UpdateSourceRequest. + * @implements IUpdateSourceRequest + * @constructor + * @param {google.cloud.securitycenter.v1beta1.IUpdateSourceRequest=} [properties] Properties to set + */ + function UpdateSourceRequest(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]]; + } - /** - * Converts this ListFindingsResult to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult - * @instance - * @returns {Object.} JSON object - */ - ListFindingsResult.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * UpdateSourceRequest source. + * @member {google.cloud.securitycenter.v1beta1.ISource|null|undefined} source + * @memberof google.cloud.securitycenter.v1beta1.UpdateSourceRequest + * @instance + */ + UpdateSourceRequest.prototype.source = null; - ListFindingsResult.Resource = (function() { + /** + * UpdateSourceRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.securitycenter.v1beta1.UpdateSourceRequest + * @instance + */ + UpdateSourceRequest.prototype.updateMask = null; - /** - * Properties of a Resource. - * @memberof google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult - * @interface IResource - * @property {string|null} [name] Resource name - * @property {string|null} [projectName] Resource projectName - * @property {string|null} [projectDisplayName] Resource projectDisplayName - * @property {string|null} [parentName] Resource parentName - * @property {string|null} [parentDisplayName] Resource parentDisplayName - */ + /** + * Creates a new UpdateSourceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1beta1.UpdateSourceRequest + * @static + * @param {google.cloud.securitycenter.v1beta1.IUpdateSourceRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1beta1.UpdateSourceRequest} UpdateSourceRequest instance + */ + UpdateSourceRequest.create = function create(properties) { + return new UpdateSourceRequest(properties); + }; - /** - * Constructs a new Resource. - * @memberof google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult - * @classdesc Represents a Resource. - * @implements IResource - * @constructor - * @param {google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.IResource=} [properties] Properties to set - */ - function Resource(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]]; + /** + * Encodes the specified UpdateSourceRequest message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.UpdateSourceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1beta1.UpdateSourceRequest + * @static + * @param {google.cloud.securitycenter.v1beta1.IUpdateSourceRequest} message UpdateSourceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateSourceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.source != null && message.hasOwnProperty("source")) + $root.google.cloud.securitycenter.v1beta1.Source.encode(message.source, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateSourceRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.UpdateSourceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1beta1.UpdateSourceRequest + * @static + * @param {google.cloud.securitycenter.v1beta1.IUpdateSourceRequest} message UpdateSourceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateSourceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateSourceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1beta1.UpdateSourceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1beta1.UpdateSourceRequest} UpdateSourceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateSourceRequest.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.cloud.securitycenter.v1beta1.UpdateSourceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.source = $root.google.cloud.securitycenter.v1beta1.Source.decode(reader, reader.uint32()); + break; + case 2: + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; } + } + return message; + }; - /** - * Resource name. - * @member {string} name - * @memberof google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource - * @instance - */ - Resource.prototype.name = ""; + /** + * Decodes an UpdateSourceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1beta1.UpdateSourceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1beta1.UpdateSourceRequest} UpdateSourceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateSourceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Resource projectName. - * @member {string} projectName - * @memberof google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource - * @instance - */ - Resource.prototype.projectName = ""; + /** + * Verifies an UpdateSourceRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1beta1.UpdateSourceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateSourceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.source != null && message.hasOwnProperty("source")) { + var error = $root.google.cloud.securitycenter.v1beta1.Source.verify(message.source); + if (error) + return "source." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + return null; + }; - /** - * Resource projectDisplayName. - * @member {string} projectDisplayName - * @memberof google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource - * @instance - */ - Resource.prototype.projectDisplayName = ""; + /** + * Creates an UpdateSourceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1beta1.UpdateSourceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1beta1.UpdateSourceRequest} UpdateSourceRequest + */ + UpdateSourceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1beta1.UpdateSourceRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1beta1.UpdateSourceRequest(); + if (object.source != null) { + if (typeof object.source !== "object") + throw TypeError(".google.cloud.securitycenter.v1beta1.UpdateSourceRequest.source: object expected"); + message.source = $root.google.cloud.securitycenter.v1beta1.Source.fromObject(object.source); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.securitycenter.v1beta1.UpdateSourceRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; - /** - * Resource parentName. - * @member {string} parentName - * @memberof google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource - * @instance - */ - Resource.prototype.parentName = ""; + /** + * Creates a plain object from an UpdateSourceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1beta1.UpdateSourceRequest + * @static + * @param {google.cloud.securitycenter.v1beta1.UpdateSourceRequest} message UpdateSourceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateSourceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.source = null; + object.updateMask = null; + } + if (message.source != null && message.hasOwnProperty("source")) + object.source = $root.google.cloud.securitycenter.v1beta1.Source.toObject(message.source, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; - /** - * Resource parentDisplayName. - * @member {string} parentDisplayName - * @memberof google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource - * @instance - */ - Resource.prototype.parentDisplayName = ""; + /** + * Converts this UpdateSourceRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1beta1.UpdateSourceRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateSourceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Creates a new Resource instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource - * @static - * @param {google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.IResource=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource} Resource instance - */ - Resource.create = function create(properties) { - return new Resource(properties); - }; + return UpdateSourceRequest; + })(); - /** - * Encodes the specified Resource message. Does not implicitly {@link google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource - * @static - * @param {google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.IResource} message Resource message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Resource.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.projectName != null && message.hasOwnProperty("projectName")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.projectName); - if (message.projectDisplayName != null && message.hasOwnProperty("projectDisplayName")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.projectDisplayName); - if (message.parentName != null && message.hasOwnProperty("parentName")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.parentName); - if (message.parentDisplayName != null && message.hasOwnProperty("parentDisplayName")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.parentDisplayName); - return writer; - }; + v1beta1.UpdateSecurityMarksRequest = (function() { - /** - * Encodes the specified Resource message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource - * @static - * @param {google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.IResource} message Resource message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Resource.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Properties of an UpdateSecurityMarksRequest. + * @memberof google.cloud.securitycenter.v1beta1 + * @interface IUpdateSecurityMarksRequest + * @property {google.cloud.securitycenter.v1beta1.ISecurityMarks|null} [securityMarks] UpdateSecurityMarksRequest securityMarks + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateSecurityMarksRequest updateMask + * @property {google.protobuf.ITimestamp|null} [startTime] UpdateSecurityMarksRequest startTime + */ - /** - * Decodes a Resource message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource} Resource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Resource.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.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.projectName = reader.string(); - break; - case 3: - message.projectDisplayName = reader.string(); - break; - case 4: - message.parentName = reader.string(); - break; - case 5: - message.parentDisplayName = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Constructs a new UpdateSecurityMarksRequest. + * @memberof google.cloud.securitycenter.v1beta1 + * @classdesc Represents an UpdateSecurityMarksRequest. + * @implements IUpdateSecurityMarksRequest + * @constructor + * @param {google.cloud.securitycenter.v1beta1.IUpdateSecurityMarksRequest=} [properties] Properties to set + */ + function UpdateSecurityMarksRequest(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]]; + } - /** - * Decodes a Resource message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource} Resource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Resource.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * UpdateSecurityMarksRequest securityMarks. + * @member {google.cloud.securitycenter.v1beta1.ISecurityMarks|null|undefined} securityMarks + * @memberof google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest + * @instance + */ + UpdateSecurityMarksRequest.prototype.securityMarks = null; - /** - * Verifies a Resource message. - * @function verify - * @memberof google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Resource.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.projectName != null && message.hasOwnProperty("projectName")) - if (!$util.isString(message.projectName)) - return "projectName: string expected"; - if (message.projectDisplayName != null && message.hasOwnProperty("projectDisplayName")) - if (!$util.isString(message.projectDisplayName)) - return "projectDisplayName: string expected"; - if (message.parentName != null && message.hasOwnProperty("parentName")) - if (!$util.isString(message.parentName)) - return "parentName: string expected"; - if (message.parentDisplayName != null && message.hasOwnProperty("parentDisplayName")) - if (!$util.isString(message.parentDisplayName)) - return "parentDisplayName: string expected"; - return null; - }; + /** + * UpdateSecurityMarksRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest + * @instance + */ + UpdateSecurityMarksRequest.prototype.updateMask = null; - /** - * Creates a Resource message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource} Resource - */ - Resource.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource) - return object; - var message = new $root.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource(); - if (object.name != null) - message.name = String(object.name); - if (object.projectName != null) - message.projectName = String(object.projectName); - if (object.projectDisplayName != null) - message.projectDisplayName = String(object.projectDisplayName); - if (object.parentName != null) - message.parentName = String(object.parentName); - if (object.parentDisplayName != null) - message.parentDisplayName = String(object.parentDisplayName); - return message; - }; + /** + * UpdateSecurityMarksRequest startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest + * @instance + */ + UpdateSecurityMarksRequest.prototype.startTime = null; - /** - * Creates a plain object from a Resource message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource - * @static - * @param {google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource} message Resource - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Resource.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.projectName = ""; - object.projectDisplayName = ""; - object.parentName = ""; - object.parentDisplayName = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.projectName != null && message.hasOwnProperty("projectName")) - object.projectName = message.projectName; - if (message.projectDisplayName != null && message.hasOwnProperty("projectDisplayName")) - object.projectDisplayName = message.projectDisplayName; - if (message.parentName != null && message.hasOwnProperty("parentName")) - object.parentName = message.parentName; - if (message.parentDisplayName != null && message.hasOwnProperty("parentDisplayName")) - object.parentDisplayName = message.parentDisplayName; - return object; - }; + /** + * Creates a new UpdateSecurityMarksRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest + * @static + * @param {google.cloud.securitycenter.v1beta1.IUpdateSecurityMarksRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest} UpdateSecurityMarksRequest instance + */ + UpdateSecurityMarksRequest.create = function create(properties) { + return new UpdateSecurityMarksRequest(properties); + }; - /** - * Converts this Resource to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource - * @instance - * @returns {Object.} JSON object - */ - Resource.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Encodes the specified UpdateSecurityMarksRequest message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest + * @static + * @param {google.cloud.securitycenter.v1beta1.IUpdateSecurityMarksRequest} message UpdateSecurityMarksRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateSecurityMarksRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.securityMarks != null && message.hasOwnProperty("securityMarks")) + $root.google.cloud.securitycenter.v1beta1.SecurityMarks.encode(message.securityMarks, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.startTime != null && message.hasOwnProperty("startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateSecurityMarksRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest + * @static + * @param {google.cloud.securitycenter.v1beta1.IUpdateSecurityMarksRequest} message UpdateSecurityMarksRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateSecurityMarksRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateSecurityMarksRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest} UpdateSecurityMarksRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateSecurityMarksRequest.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.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.securityMarks = $root.google.cloud.securitycenter.v1beta1.SecurityMarks.decode(reader, reader.uint32()); + break; + case 2: + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + case 3: + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateSecurityMarksRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest} UpdateSecurityMarksRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateSecurityMarksRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateSecurityMarksRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateSecurityMarksRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.securityMarks != null && message.hasOwnProperty("securityMarks")) { + var error = $root.google.cloud.securitycenter.v1beta1.SecurityMarks.verify(message.securityMarks); + if (error) + return "securityMarks." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + if (message.startTime != null && message.hasOwnProperty("startTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.startTime); + if (error) + return "startTime." + error; + } + return null; + }; - return Resource; - })(); + /** + * Creates an UpdateSecurityMarksRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest} UpdateSecurityMarksRequest + */ + UpdateSecurityMarksRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest(); + if (object.securityMarks != null) { + if (typeof object.securityMarks !== "object") + throw TypeError(".google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest.securityMarks: object expected"); + message.securityMarks = $root.google.cloud.securitycenter.v1beta1.SecurityMarks.fromObject(object.securityMarks); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); + } + return message; + }; - /** - * StateChange enum. - * @name google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.StateChange - * @enum {string} - * @property {number} UNUSED=0 UNUSED value - * @property {number} CHANGED=1 CHANGED value - * @property {number} UNCHANGED=2 UNCHANGED value - * @property {number} ADDED=3 ADDED value - * @property {number} REMOVED=4 REMOVED value - */ - ListFindingsResult.StateChange = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "UNUSED"] = 0; - values[valuesById[1] = "CHANGED"] = 1; - values[valuesById[2] = "UNCHANGED"] = 2; - values[valuesById[3] = "ADDED"] = 3; - values[valuesById[4] = "REMOVED"] = 4; - return values; - })(); + /** + * Creates a plain object from an UpdateSecurityMarksRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest + * @static + * @param {google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest} message UpdateSecurityMarksRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateSecurityMarksRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.securityMarks = null; + object.updateMask = null; + object.startTime = null; + } + if (message.securityMarks != null && message.hasOwnProperty("securityMarks")) + object.securityMarks = $root.google.cloud.securitycenter.v1beta1.SecurityMarks.toObject(message.securityMarks, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); + return object; + }; - return ListFindingsResult; - })(); + /** + * Converts this UpdateSecurityMarksRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateSecurityMarksRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - return ListFindingsResponse; + return UpdateSecurityMarksRequest; })(); - v1.SetFindingStateRequest = (function() { + v1beta1.Source = (function() { /** - * Properties of a SetFindingStateRequest. - * @memberof google.cloud.securitycenter.v1 - * @interface ISetFindingStateRequest - * @property {string|null} [name] SetFindingStateRequest name - * @property {google.cloud.securitycenter.v1.Finding.State|null} [state] SetFindingStateRequest state - * @property {google.protobuf.ITimestamp|null} [startTime] SetFindingStateRequest startTime + * Properties of a Source. + * @memberof google.cloud.securitycenter.v1beta1 + * @interface ISource + * @property {string|null} [name] Source name + * @property {string|null} [displayName] Source displayName + * @property {string|null} [description] Source description */ /** - * Constructs a new SetFindingStateRequest. - * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents a SetFindingStateRequest. - * @implements ISetFindingStateRequest + * Constructs a new Source. + * @memberof google.cloud.securitycenter.v1beta1 + * @classdesc Represents a Source. + * @implements ISource * @constructor - * @param {google.cloud.securitycenter.v1.ISetFindingStateRequest=} [properties] Properties to set + * @param {google.cloud.securitycenter.v1beta1.ISource=} [properties] Properties to set */ - function SetFindingStateRequest(properties) { + function Source(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -8183,90 +17814,90 @@ } /** - * SetFindingStateRequest name. + * Source name. * @member {string} name - * @memberof google.cloud.securitycenter.v1.SetFindingStateRequest + * @memberof google.cloud.securitycenter.v1beta1.Source * @instance */ - SetFindingStateRequest.prototype.name = ""; + Source.prototype.name = ""; /** - * SetFindingStateRequest state. - * @member {google.cloud.securitycenter.v1.Finding.State} state - * @memberof google.cloud.securitycenter.v1.SetFindingStateRequest + * Source displayName. + * @member {string} displayName + * @memberof google.cloud.securitycenter.v1beta1.Source * @instance */ - SetFindingStateRequest.prototype.state = 0; + Source.prototype.displayName = ""; /** - * SetFindingStateRequest startTime. - * @member {google.protobuf.ITimestamp|null|undefined} startTime - * @memberof google.cloud.securitycenter.v1.SetFindingStateRequest + * Source description. + * @member {string} description + * @memberof google.cloud.securitycenter.v1beta1.Source * @instance */ - SetFindingStateRequest.prototype.startTime = null; + Source.prototype.description = ""; /** - * Creates a new SetFindingStateRequest instance using the specified properties. + * Creates a new Source instance using the specified properties. * @function create - * @memberof google.cloud.securitycenter.v1.SetFindingStateRequest + * @memberof google.cloud.securitycenter.v1beta1.Source * @static - * @param {google.cloud.securitycenter.v1.ISetFindingStateRequest=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.SetFindingStateRequest} SetFindingStateRequest instance + * @param {google.cloud.securitycenter.v1beta1.ISource=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1beta1.Source} Source instance */ - SetFindingStateRequest.create = function create(properties) { - return new SetFindingStateRequest(properties); + Source.create = function create(properties) { + return new Source(properties); }; /** - * Encodes the specified SetFindingStateRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.SetFindingStateRequest.verify|verify} messages. + * Encodes the specified Source message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.Source.verify|verify} messages. * @function encode - * @memberof google.cloud.securitycenter.v1.SetFindingStateRequest + * @memberof google.cloud.securitycenter.v1beta1.Source * @static - * @param {google.cloud.securitycenter.v1.ISetFindingStateRequest} message SetFindingStateRequest message or plain object to encode + * @param {google.cloud.securitycenter.v1beta1.ISource} message Source message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SetFindingStateRequest.encode = function encode(message, writer) { + Source.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.name != null && message.hasOwnProperty("name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.state != null && message.hasOwnProperty("state")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.state); - if (message.startTime != null && message.hasOwnProperty("startTime")) - $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.displayName != null && message.hasOwnProperty("displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + if (message.description != null && message.hasOwnProperty("description")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); return writer; }; /** - * Encodes the specified SetFindingStateRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.SetFindingStateRequest.verify|verify} messages. + * Encodes the specified Source message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.Source.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.SetFindingStateRequest + * @memberof google.cloud.securitycenter.v1beta1.Source * @static - * @param {google.cloud.securitycenter.v1.ISetFindingStateRequest} message SetFindingStateRequest message or plain object to encode + * @param {google.cloud.securitycenter.v1beta1.ISource} message Source message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SetFindingStateRequest.encodeDelimited = function encodeDelimited(message, writer) { + Source.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a SetFindingStateRequest message from the specified reader or buffer. + * Decodes a Source message from the specified reader or buffer. * @function decode - * @memberof google.cloud.securitycenter.v1.SetFindingStateRequest + * @memberof google.cloud.securitycenter.v1beta1.Source * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.SetFindingStateRequest} SetFindingStateRequest + * @returns {google.cloud.securitycenter.v1beta1.Source} Source * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SetFindingStateRequest.decode = function decode(reader, length) { + Source.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.cloud.securitycenter.v1.SetFindingStateRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1beta1.Source(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -8274,10 +17905,10 @@ message.name = reader.string(); break; case 2: - message.state = reader.int32(); + message.displayName = reader.string(); break; case 3: - message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + message.description = reader.string(); break; default: reader.skipType(tag & 7); @@ -8288,147 +17919,143 @@ }; /** - * Decodes a SetFindingStateRequest message from the specified reader or buffer, length delimited. + * Decodes a Source message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.SetFindingStateRequest + * @memberof google.cloud.securitycenter.v1beta1.Source * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.SetFindingStateRequest} SetFindingStateRequest + * @returns {google.cloud.securitycenter.v1beta1.Source} Source * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SetFindingStateRequest.decodeDelimited = function decodeDelimited(reader) { + Source.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a SetFindingStateRequest message. + * Verifies a Source message. * @function verify - * @memberof google.cloud.securitycenter.v1.SetFindingStateRequest + * @memberof google.cloud.securitycenter.v1beta1.Source * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - SetFindingStateRequest.verify = function verify(message) { + Source.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.state != null && message.hasOwnProperty("state")) - switch (message.state) { - default: - return "state: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.startTime != null && message.hasOwnProperty("startTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.startTime); - if (error) - return "startTime." + error; - } + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; return null; }; /** - * Creates a SetFindingStateRequest message from a plain object. Also converts values to their respective internal types. + * Creates a Source message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.securitycenter.v1.SetFindingStateRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.SetFindingStateRequest} SetFindingStateRequest - */ - SetFindingStateRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.SetFindingStateRequest) - return object; - var message = new $root.google.cloud.securitycenter.v1.SetFindingStateRequest(); - if (object.name != null) - message.name = String(object.name); - switch (object.state) { - case "STATE_UNSPECIFIED": - case 0: - message.state = 0; - break; - case "ACTIVE": - case 1: - message.state = 1; - break; - case "INACTIVE": - case 2: - message.state = 2; - break; - } - if (object.startTime != null) { - if (typeof object.startTime !== "object") - throw TypeError(".google.cloud.securitycenter.v1.SetFindingStateRequest.startTime: object expected"); - message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); - } + * @memberof google.cloud.securitycenter.v1beta1.Source + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1beta1.Source} Source + */ + Source.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1beta1.Source) + return object; + var message = new $root.google.cloud.securitycenter.v1beta1.Source(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.description != null) + message.description = String(object.description); return message; }; /** - * Creates a plain object from a SetFindingStateRequest message. Also converts values to other types if specified. + * Creates a plain object from a Source message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.securitycenter.v1.SetFindingStateRequest + * @memberof google.cloud.securitycenter.v1beta1.Source * @static - * @param {google.cloud.securitycenter.v1.SetFindingStateRequest} message SetFindingStateRequest + * @param {google.cloud.securitycenter.v1beta1.Source} message Source * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SetFindingStateRequest.toObject = function toObject(message, options) { + Source.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { object.name = ""; - object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; - object.startTime = null; + object.displayName = ""; + object.description = ""; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; - if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.securitycenter.v1.Finding.State[message.state] : message.state; - if (message.startTime != null && message.hasOwnProperty("startTime")) - object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; return object; }; /** - * Converts this SetFindingStateRequest to JSON. + * Converts this Source to JSON. * @function toJSON - * @memberof google.cloud.securitycenter.v1.SetFindingStateRequest + * @memberof google.cloud.securitycenter.v1beta1.Source * @instance * @returns {Object.} JSON object */ - SetFindingStateRequest.prototype.toJSON = function toJSON() { + Source.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return SetFindingStateRequest; + return Source; })(); - v1.RunAssetDiscoveryRequest = (function() { + return v1beta1; + })(); + + securitycenter.v1p1beta1 = (function() { + + /** + * Namespace v1p1beta1. + * @memberof google.cloud.securitycenter + * @namespace + */ + var v1p1beta1 = {}; + + v1p1beta1.Asset = (function() { /** - * Properties of a RunAssetDiscoveryRequest. - * @memberof google.cloud.securitycenter.v1 - * @interface IRunAssetDiscoveryRequest - * @property {string|null} [parent] RunAssetDiscoveryRequest parent + * Properties of an Asset. + * @memberof google.cloud.securitycenter.v1p1beta1 + * @interface IAsset + * @property {string|null} [name] Asset name + * @property {google.cloud.securitycenter.v1p1beta1.Asset.ISecurityCenterProperties|null} [securityCenterProperties] Asset securityCenterProperties + * @property {Object.|null} [resourceProperties] Asset resourceProperties + * @property {google.cloud.securitycenter.v1p1beta1.ISecurityMarks|null} [securityMarks] Asset securityMarks + * @property {google.protobuf.ITimestamp|null} [createTime] Asset createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Asset updateTime + * @property {google.cloud.securitycenter.v1p1beta1.Asset.IIamPolicy|null} [iamPolicy] Asset iamPolicy */ /** - * Constructs a new RunAssetDiscoveryRequest. - * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents a RunAssetDiscoveryRequest. - * @implements IRunAssetDiscoveryRequest + * Constructs a new Asset. + * @memberof google.cloud.securitycenter.v1p1beta1 + * @classdesc Represents an Asset. + * @implements IAsset * @constructor - * @param {google.cloud.securitycenter.v1.IRunAssetDiscoveryRequest=} [properties] Properties to set + * @param {google.cloud.securitycenter.v1p1beta1.IAsset=} [properties] Properties to set */ - function RunAssetDiscoveryRequest(properties) { + function Asset(properties) { + this.resourceProperties = {}; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -8436,75 +18063,161 @@ } /** - * RunAssetDiscoveryRequest parent. - * @member {string} parent - * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryRequest + * Asset name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1p1beta1.Asset * @instance */ - RunAssetDiscoveryRequest.prototype.parent = ""; + Asset.prototype.name = ""; /** - * Creates a new RunAssetDiscoveryRequest instance using the specified properties. + * Asset securityCenterProperties. + * @member {google.cloud.securitycenter.v1p1beta1.Asset.ISecurityCenterProperties|null|undefined} securityCenterProperties + * @memberof google.cloud.securitycenter.v1p1beta1.Asset + * @instance + */ + Asset.prototype.securityCenterProperties = null; + + /** + * Asset resourceProperties. + * @member {Object.} resourceProperties + * @memberof google.cloud.securitycenter.v1p1beta1.Asset + * @instance + */ + Asset.prototype.resourceProperties = $util.emptyObject; + + /** + * Asset securityMarks. + * @member {google.cloud.securitycenter.v1p1beta1.ISecurityMarks|null|undefined} securityMarks + * @memberof google.cloud.securitycenter.v1p1beta1.Asset + * @instance + */ + Asset.prototype.securityMarks = null; + + /** + * Asset createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.securitycenter.v1p1beta1.Asset + * @instance + */ + Asset.prototype.createTime = null; + + /** + * Asset updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.securitycenter.v1p1beta1.Asset + * @instance + */ + Asset.prototype.updateTime = null; + + /** + * Asset iamPolicy. + * @member {google.cloud.securitycenter.v1p1beta1.Asset.IIamPolicy|null|undefined} iamPolicy + * @memberof google.cloud.securitycenter.v1p1beta1.Asset + * @instance + */ + Asset.prototype.iamPolicy = null; + + /** + * Creates a new Asset instance using the specified properties. * @function create - * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryRequest + * @memberof google.cloud.securitycenter.v1p1beta1.Asset * @static - * @param {google.cloud.securitycenter.v1.IRunAssetDiscoveryRequest=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.RunAssetDiscoveryRequest} RunAssetDiscoveryRequest instance + * @param {google.cloud.securitycenter.v1p1beta1.IAsset=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1p1beta1.Asset} Asset instance */ - RunAssetDiscoveryRequest.create = function create(properties) { - return new RunAssetDiscoveryRequest(properties); + Asset.create = function create(properties) { + return new Asset(properties); }; /** - * Encodes the specified RunAssetDiscoveryRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.RunAssetDiscoveryRequest.verify|verify} messages. + * Encodes the specified Asset message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.Asset.verify|verify} messages. * @function encode - * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryRequest + * @memberof google.cloud.securitycenter.v1p1beta1.Asset * @static - * @param {google.cloud.securitycenter.v1.IRunAssetDiscoveryRequest} message RunAssetDiscoveryRequest message or plain object to encode + * @param {google.cloud.securitycenter.v1p1beta1.IAsset} message Asset message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - RunAssetDiscoveryRequest.encode = function encode(message, writer) { + Asset.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && message.hasOwnProperty("parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.securityCenterProperties != null && message.hasOwnProperty("securityCenterProperties")) + $root.google.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterProperties.encode(message.securityCenterProperties, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.resourceProperties != null && message.hasOwnProperty("resourceProperties")) + for (var keys = Object.keys(message.resourceProperties), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 7, wireType 2 =*/58).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.protobuf.Value.encode(message.resourceProperties[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.securityMarks != null && message.hasOwnProperty("securityMarks")) + $root.google.cloud.securitycenter.v1p1beta1.SecurityMarks.encode(message.securityMarks, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.createTime != null && message.hasOwnProperty("createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.iamPolicy != null && message.hasOwnProperty("iamPolicy")) + $root.google.cloud.securitycenter.v1p1beta1.Asset.IamPolicy.encode(message.iamPolicy, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); return writer; }; /** - * Encodes the specified RunAssetDiscoveryRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.RunAssetDiscoveryRequest.verify|verify} messages. + * Encodes the specified Asset message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.Asset.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryRequest + * @memberof google.cloud.securitycenter.v1p1beta1.Asset * @static - * @param {google.cloud.securitycenter.v1.IRunAssetDiscoveryRequest} message RunAssetDiscoveryRequest message or plain object to encode + * @param {google.cloud.securitycenter.v1p1beta1.IAsset} message Asset message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - RunAssetDiscoveryRequest.encodeDelimited = function encodeDelimited(message, writer) { + Asset.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a RunAssetDiscoveryRequest message from the specified reader or buffer. + * Decodes an Asset message from the specified reader or buffer. * @function decode - * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryRequest + * @memberof google.cloud.securitycenter.v1p1beta1.Asset * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.RunAssetDiscoveryRequest} RunAssetDiscoveryRequest + * @returns {google.cloud.securitycenter.v1p1beta1.Asset} Asset * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - RunAssetDiscoveryRequest.decode = function decode(reader, length) { + Asset.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.cloud.securitycenter.v1.RunAssetDiscoveryRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1p1beta1.Asset(), key; while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.parent = reader.string(); + message.name = reader.string(); + break; + case 2: + message.securityCenterProperties = $root.google.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterProperties.decode(reader, reader.uint32()); + break; + case 7: + reader.skip().pos++; + if (message.resourceProperties === $util.emptyObject) + message.resourceProperties = {}; + key = reader.string(); + reader.pos++; + message.resourceProperties[key] = $root.google.protobuf.Value.decode(reader, reader.uint32()); + break; + case 8: + message.securityMarks = $root.google.cloud.securitycenter.v1p1beta1.SecurityMarks.decode(reader, reader.uint32()); + break; + case 9: + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 10: + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 11: + message.iamPolicy = $root.google.cloud.securitycenter.v1p1beta1.Asset.IamPolicy.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -8515,328 +18228,749 @@ }; /** - * Decodes a RunAssetDiscoveryRequest message from the specified reader or buffer, length delimited. + * Decodes an Asset message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryRequest + * @memberof google.cloud.securitycenter.v1p1beta1.Asset * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.RunAssetDiscoveryRequest} RunAssetDiscoveryRequest + * @returns {google.cloud.securitycenter.v1p1beta1.Asset} Asset * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - RunAssetDiscoveryRequest.decodeDelimited = function decodeDelimited(reader) { + Asset.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a RunAssetDiscoveryRequest message. + * Verifies an Asset message. * @function verify - * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryRequest + * @memberof google.cloud.securitycenter.v1p1beta1.Asset * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - RunAssetDiscoveryRequest.verify = function verify(message) { + Asset.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.securityCenterProperties != null && message.hasOwnProperty("securityCenterProperties")) { + var error = $root.google.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterProperties.verify(message.securityCenterProperties); + if (error) + return "securityCenterProperties." + error; + } + if (message.resourceProperties != null && message.hasOwnProperty("resourceProperties")) { + if (!$util.isObject(message.resourceProperties)) + return "resourceProperties: object expected"; + var key = Object.keys(message.resourceProperties); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.protobuf.Value.verify(message.resourceProperties[key[i]]); + if (error) + return "resourceProperties." + error; + } + } + if (message.securityMarks != null && message.hasOwnProperty("securityMarks")) { + var error = $root.google.cloud.securitycenter.v1p1beta1.SecurityMarks.verify(message.securityMarks); + if (error) + return "securityMarks." + error; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.iamPolicy != null && message.hasOwnProperty("iamPolicy")) { + var error = $root.google.cloud.securitycenter.v1p1beta1.Asset.IamPolicy.verify(message.iamPolicy); + if (error) + return "iamPolicy." + error; + } return null; }; /** - * Creates a RunAssetDiscoveryRequest message from a plain object. Also converts values to their respective internal types. + * Creates an Asset message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryRequest + * @memberof google.cloud.securitycenter.v1p1beta1.Asset * @static * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.RunAssetDiscoveryRequest} RunAssetDiscoveryRequest + * @returns {google.cloud.securitycenter.v1p1beta1.Asset} Asset */ - RunAssetDiscoveryRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.RunAssetDiscoveryRequest) + Asset.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1p1beta1.Asset) return object; - var message = new $root.google.cloud.securitycenter.v1.RunAssetDiscoveryRequest(); - if (object.parent != null) - message.parent = String(object.parent); + var message = new $root.google.cloud.securitycenter.v1p1beta1.Asset(); + if (object.name != null) + message.name = String(object.name); + if (object.securityCenterProperties != null) { + if (typeof object.securityCenterProperties !== "object") + throw TypeError(".google.cloud.securitycenter.v1p1beta1.Asset.securityCenterProperties: object expected"); + message.securityCenterProperties = $root.google.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterProperties.fromObject(object.securityCenterProperties); + } + if (object.resourceProperties) { + if (typeof object.resourceProperties !== "object") + throw TypeError(".google.cloud.securitycenter.v1p1beta1.Asset.resourceProperties: object expected"); + message.resourceProperties = {}; + for (var keys = Object.keys(object.resourceProperties), i = 0; i < keys.length; ++i) { + if (typeof object.resourceProperties[keys[i]] !== "object") + throw TypeError(".google.cloud.securitycenter.v1p1beta1.Asset.resourceProperties: object expected"); + message.resourceProperties[keys[i]] = $root.google.protobuf.Value.fromObject(object.resourceProperties[keys[i]]); + } + } + if (object.securityMarks != null) { + if (typeof object.securityMarks !== "object") + throw TypeError(".google.cloud.securitycenter.v1p1beta1.Asset.securityMarks: object expected"); + message.securityMarks = $root.google.cloud.securitycenter.v1p1beta1.SecurityMarks.fromObject(object.securityMarks); + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.securitycenter.v1p1beta1.Asset.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.securitycenter.v1p1beta1.Asset.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.iamPolicy != null) { + if (typeof object.iamPolicy !== "object") + throw TypeError(".google.cloud.securitycenter.v1p1beta1.Asset.iamPolicy: object expected"); + message.iamPolicy = $root.google.cloud.securitycenter.v1p1beta1.Asset.IamPolicy.fromObject(object.iamPolicy); + } return message; }; /** - * Creates a plain object from a RunAssetDiscoveryRequest message. Also converts values to other types if specified. + * Creates a plain object from an Asset message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryRequest + * @memberof google.cloud.securitycenter.v1p1beta1.Asset * @static - * @param {google.cloud.securitycenter.v1.RunAssetDiscoveryRequest} message RunAssetDiscoveryRequest + * @param {google.cloud.securitycenter.v1p1beta1.Asset} message Asset * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - RunAssetDiscoveryRequest.toObject = function toObject(message, options) { + Asset.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) - object.parent = ""; - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; + if (options.objects || options.defaults) + object.resourceProperties = {}; + if (options.defaults) { + object.name = ""; + object.securityCenterProperties = null; + object.securityMarks = null; + object.createTime = null; + object.updateTime = null; + object.iamPolicy = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.securityCenterProperties != null && message.hasOwnProperty("securityCenterProperties")) + object.securityCenterProperties = $root.google.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterProperties.toObject(message.securityCenterProperties, options); + var keys2; + if (message.resourceProperties && (keys2 = Object.keys(message.resourceProperties)).length) { + object.resourceProperties = {}; + for (var j = 0; j < keys2.length; ++j) + object.resourceProperties[keys2[j]] = $root.google.protobuf.Value.toObject(message.resourceProperties[keys2[j]], options); + } + if (message.securityMarks != null && message.hasOwnProperty("securityMarks")) + object.securityMarks = $root.google.cloud.securitycenter.v1p1beta1.SecurityMarks.toObject(message.securityMarks, options); + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.iamPolicy != null && message.hasOwnProperty("iamPolicy")) + object.iamPolicy = $root.google.cloud.securitycenter.v1p1beta1.Asset.IamPolicy.toObject(message.iamPolicy, options); return object; }; - /** - * Converts this RunAssetDiscoveryRequest to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryRequest - * @instance - * @returns {Object.} JSON object - */ - RunAssetDiscoveryRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Converts this Asset to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1p1beta1.Asset + * @instance + * @returns {Object.} JSON object + */ + Asset.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + Asset.SecurityCenterProperties = (function() { + + /** + * Properties of a SecurityCenterProperties. + * @memberof google.cloud.securitycenter.v1p1beta1.Asset + * @interface ISecurityCenterProperties + * @property {string|null} [resourceName] SecurityCenterProperties resourceName + * @property {string|null} [resourceType] SecurityCenterProperties resourceType + * @property {string|null} [resourceParent] SecurityCenterProperties resourceParent + * @property {string|null} [resourceProject] SecurityCenterProperties resourceProject + * @property {Array.|null} [resourceOwners] SecurityCenterProperties resourceOwners + * @property {string|null} [resourceDisplayName] SecurityCenterProperties resourceDisplayName + * @property {string|null} [resourceParentDisplayName] SecurityCenterProperties resourceParentDisplayName + * @property {string|null} [resourceProjectDisplayName] SecurityCenterProperties resourceProjectDisplayName + */ + + /** + * Constructs a new SecurityCenterProperties. + * @memberof google.cloud.securitycenter.v1p1beta1.Asset + * @classdesc Represents a SecurityCenterProperties. + * @implements ISecurityCenterProperties + * @constructor + * @param {google.cloud.securitycenter.v1p1beta1.Asset.ISecurityCenterProperties=} [properties] Properties to set + */ + function SecurityCenterProperties(properties) { + this.resourceOwners = []; + 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]]; + } + + /** + * SecurityCenterProperties resourceName. + * @member {string} resourceName + * @memberof google.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterProperties + * @instance + */ + SecurityCenterProperties.prototype.resourceName = ""; + + /** + * SecurityCenterProperties resourceType. + * @member {string} resourceType + * @memberof google.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterProperties + * @instance + */ + SecurityCenterProperties.prototype.resourceType = ""; + + /** + * SecurityCenterProperties resourceParent. + * @member {string} resourceParent + * @memberof google.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterProperties + * @instance + */ + SecurityCenterProperties.prototype.resourceParent = ""; + + /** + * SecurityCenterProperties resourceProject. + * @member {string} resourceProject + * @memberof google.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterProperties + * @instance + */ + SecurityCenterProperties.prototype.resourceProject = ""; + + /** + * SecurityCenterProperties resourceOwners. + * @member {Array.} resourceOwners + * @memberof google.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterProperties + * @instance + */ + SecurityCenterProperties.prototype.resourceOwners = $util.emptyArray; + + /** + * SecurityCenterProperties resourceDisplayName. + * @member {string} resourceDisplayName + * @memberof google.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterProperties + * @instance + */ + SecurityCenterProperties.prototype.resourceDisplayName = ""; + + /** + * SecurityCenterProperties resourceParentDisplayName. + * @member {string} resourceParentDisplayName + * @memberof google.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterProperties + * @instance + */ + SecurityCenterProperties.prototype.resourceParentDisplayName = ""; + + /** + * SecurityCenterProperties resourceProjectDisplayName. + * @member {string} resourceProjectDisplayName + * @memberof google.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterProperties + * @instance + */ + SecurityCenterProperties.prototype.resourceProjectDisplayName = ""; + + /** + * Creates a new SecurityCenterProperties instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterProperties + * @static + * @param {google.cloud.securitycenter.v1p1beta1.Asset.ISecurityCenterProperties=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterProperties} SecurityCenterProperties instance + */ + SecurityCenterProperties.create = function create(properties) { + return new SecurityCenterProperties(properties); + }; + + /** + * Encodes the specified SecurityCenterProperties message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterProperties.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterProperties + * @static + * @param {google.cloud.securitycenter.v1p1beta1.Asset.ISecurityCenterProperties} message SecurityCenterProperties message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SecurityCenterProperties.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.resourceName != null && message.hasOwnProperty("resourceName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.resourceName); + if (message.resourceType != null && message.hasOwnProperty("resourceType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.resourceType); + if (message.resourceParent != null && message.hasOwnProperty("resourceParent")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.resourceParent); + if (message.resourceProject != null && message.hasOwnProperty("resourceProject")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.resourceProject); + if (message.resourceOwners != null && message.resourceOwners.length) + for (var i = 0; i < message.resourceOwners.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.resourceOwners[i]); + if (message.resourceDisplayName != null && message.hasOwnProperty("resourceDisplayName")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.resourceDisplayName); + if (message.resourceParentDisplayName != null && message.hasOwnProperty("resourceParentDisplayName")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.resourceParentDisplayName); + if (message.resourceProjectDisplayName != null && message.hasOwnProperty("resourceProjectDisplayName")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.resourceProjectDisplayName); + return writer; + }; + + /** + * Encodes the specified SecurityCenterProperties message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterProperties.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterProperties + * @static + * @param {google.cloud.securitycenter.v1p1beta1.Asset.ISecurityCenterProperties} message SecurityCenterProperties message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SecurityCenterProperties.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SecurityCenterProperties message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterProperties + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterProperties} SecurityCenterProperties + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SecurityCenterProperties.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.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterProperties(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.resourceName = reader.string(); + break; + case 2: + message.resourceType = reader.string(); + break; + case 3: + message.resourceParent = reader.string(); + break; + case 4: + message.resourceProject = reader.string(); + break; + case 5: + if (!(message.resourceOwners && message.resourceOwners.length)) + message.resourceOwners = []; + message.resourceOwners.push(reader.string()); + break; + case 6: + message.resourceDisplayName = reader.string(); + break; + case 7: + message.resourceParentDisplayName = reader.string(); + break; + case 8: + message.resourceProjectDisplayName = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SecurityCenterProperties message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterProperties + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterProperties} SecurityCenterProperties + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SecurityCenterProperties.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SecurityCenterProperties message. + * @function verify + * @memberof google.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterProperties + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SecurityCenterProperties.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.resourceName != null && message.hasOwnProperty("resourceName")) + if (!$util.isString(message.resourceName)) + return "resourceName: string expected"; + if (message.resourceType != null && message.hasOwnProperty("resourceType")) + if (!$util.isString(message.resourceType)) + return "resourceType: string expected"; + if (message.resourceParent != null && message.hasOwnProperty("resourceParent")) + if (!$util.isString(message.resourceParent)) + return "resourceParent: string expected"; + if (message.resourceProject != null && message.hasOwnProperty("resourceProject")) + if (!$util.isString(message.resourceProject)) + return "resourceProject: string expected"; + if (message.resourceOwners != null && message.hasOwnProperty("resourceOwners")) { + if (!Array.isArray(message.resourceOwners)) + return "resourceOwners: array expected"; + for (var i = 0; i < message.resourceOwners.length; ++i) + if (!$util.isString(message.resourceOwners[i])) + return "resourceOwners: string[] expected"; + } + if (message.resourceDisplayName != null && message.hasOwnProperty("resourceDisplayName")) + if (!$util.isString(message.resourceDisplayName)) + return "resourceDisplayName: string expected"; + if (message.resourceParentDisplayName != null && message.hasOwnProperty("resourceParentDisplayName")) + if (!$util.isString(message.resourceParentDisplayName)) + return "resourceParentDisplayName: string expected"; + if (message.resourceProjectDisplayName != null && message.hasOwnProperty("resourceProjectDisplayName")) + if (!$util.isString(message.resourceProjectDisplayName)) + return "resourceProjectDisplayName: string expected"; + return null; + }; + + /** + * Creates a SecurityCenterProperties message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterProperties + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterProperties} SecurityCenterProperties + */ + SecurityCenterProperties.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterProperties) + return object; + var message = new $root.google.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterProperties(); + if (object.resourceName != null) + message.resourceName = String(object.resourceName); + if (object.resourceType != null) + message.resourceType = String(object.resourceType); + if (object.resourceParent != null) + message.resourceParent = String(object.resourceParent); + if (object.resourceProject != null) + message.resourceProject = String(object.resourceProject); + if (object.resourceOwners) { + if (!Array.isArray(object.resourceOwners)) + throw TypeError(".google.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterProperties.resourceOwners: array expected"); + message.resourceOwners = []; + for (var i = 0; i < object.resourceOwners.length; ++i) + message.resourceOwners[i] = String(object.resourceOwners[i]); + } + if (object.resourceDisplayName != null) + message.resourceDisplayName = String(object.resourceDisplayName); + if (object.resourceParentDisplayName != null) + message.resourceParentDisplayName = String(object.resourceParentDisplayName); + if (object.resourceProjectDisplayName != null) + message.resourceProjectDisplayName = String(object.resourceProjectDisplayName); + return message; + }; - return RunAssetDiscoveryRequest; - })(); + /** + * Creates a plain object from a SecurityCenterProperties message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterProperties + * @static + * @param {google.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterProperties} message SecurityCenterProperties + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SecurityCenterProperties.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.resourceOwners = []; + if (options.defaults) { + object.resourceName = ""; + object.resourceType = ""; + object.resourceParent = ""; + object.resourceProject = ""; + object.resourceDisplayName = ""; + object.resourceParentDisplayName = ""; + object.resourceProjectDisplayName = ""; + } + if (message.resourceName != null && message.hasOwnProperty("resourceName")) + object.resourceName = message.resourceName; + if (message.resourceType != null && message.hasOwnProperty("resourceType")) + object.resourceType = message.resourceType; + if (message.resourceParent != null && message.hasOwnProperty("resourceParent")) + object.resourceParent = message.resourceParent; + if (message.resourceProject != null && message.hasOwnProperty("resourceProject")) + object.resourceProject = message.resourceProject; + if (message.resourceOwners && message.resourceOwners.length) { + object.resourceOwners = []; + for (var j = 0; j < message.resourceOwners.length; ++j) + object.resourceOwners[j] = message.resourceOwners[j]; + } + if (message.resourceDisplayName != null && message.hasOwnProperty("resourceDisplayName")) + object.resourceDisplayName = message.resourceDisplayName; + if (message.resourceParentDisplayName != null && message.hasOwnProperty("resourceParentDisplayName")) + object.resourceParentDisplayName = message.resourceParentDisplayName; + if (message.resourceProjectDisplayName != null && message.hasOwnProperty("resourceProjectDisplayName")) + object.resourceProjectDisplayName = message.resourceProjectDisplayName; + return object; + }; - v1.UpdateFindingRequest = (function() { + /** + * Converts this SecurityCenterProperties to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterProperties + * @instance + * @returns {Object.} JSON object + */ + SecurityCenterProperties.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Properties of an UpdateFindingRequest. - * @memberof google.cloud.securitycenter.v1 - * @interface IUpdateFindingRequest - * @property {google.cloud.securitycenter.v1.IFinding|null} [finding] UpdateFindingRequest finding - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateFindingRequest updateMask - */ + return SecurityCenterProperties; + })(); - /** - * Constructs a new UpdateFindingRequest. - * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents an UpdateFindingRequest. - * @implements IUpdateFindingRequest - * @constructor - * @param {google.cloud.securitycenter.v1.IUpdateFindingRequest=} [properties] Properties to set - */ - function UpdateFindingRequest(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]]; - } + Asset.IamPolicy = (function() { - /** - * UpdateFindingRequest finding. - * @member {google.cloud.securitycenter.v1.IFinding|null|undefined} finding - * @memberof google.cloud.securitycenter.v1.UpdateFindingRequest - * @instance - */ - UpdateFindingRequest.prototype.finding = null; + /** + * Properties of an IamPolicy. + * @memberof google.cloud.securitycenter.v1p1beta1.Asset + * @interface IIamPolicy + * @property {string|null} [policyBlob] IamPolicy policyBlob + */ - /** - * UpdateFindingRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.cloud.securitycenter.v1.UpdateFindingRequest - * @instance - */ - UpdateFindingRequest.prototype.updateMask = null; + /** + * Constructs a new IamPolicy. + * @memberof google.cloud.securitycenter.v1p1beta1.Asset + * @classdesc Represents an IamPolicy. + * @implements IIamPolicy + * @constructor + * @param {google.cloud.securitycenter.v1p1beta1.Asset.IIamPolicy=} [properties] Properties to set + */ + function IamPolicy(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]]; + } - /** - * Creates a new UpdateFindingRequest instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v1.UpdateFindingRequest - * @static - * @param {google.cloud.securitycenter.v1.IUpdateFindingRequest=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.UpdateFindingRequest} UpdateFindingRequest instance - */ - UpdateFindingRequest.create = function create(properties) { - return new UpdateFindingRequest(properties); - }; + /** + * IamPolicy policyBlob. + * @member {string} policyBlob + * @memberof google.cloud.securitycenter.v1p1beta1.Asset.IamPolicy + * @instance + */ + IamPolicy.prototype.policyBlob = ""; - /** - * Encodes the specified UpdateFindingRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.UpdateFindingRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1.UpdateFindingRequest - * @static - * @param {google.cloud.securitycenter.v1.IUpdateFindingRequest} message UpdateFindingRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateFindingRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.finding != null && message.hasOwnProperty("finding")) - $root.google.cloud.securitycenter.v1.Finding.encode(message.finding, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; + /** + * Creates a new IamPolicy instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1p1beta1.Asset.IamPolicy + * @static + * @param {google.cloud.securitycenter.v1p1beta1.Asset.IIamPolicy=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1p1beta1.Asset.IamPolicy} IamPolicy instance + */ + IamPolicy.create = function create(properties) { + return new IamPolicy(properties); + }; - /** - * Encodes the specified UpdateFindingRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.UpdateFindingRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.UpdateFindingRequest - * @static - * @param {google.cloud.securitycenter.v1.IUpdateFindingRequest} message UpdateFindingRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateFindingRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Encodes the specified IamPolicy message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.Asset.IamPolicy.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1p1beta1.Asset.IamPolicy + * @static + * @param {google.cloud.securitycenter.v1p1beta1.Asset.IIamPolicy} message IamPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IamPolicy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.policyBlob != null && message.hasOwnProperty("policyBlob")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.policyBlob); + return writer; + }; - /** - * Decodes an UpdateFindingRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v1.UpdateFindingRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.UpdateFindingRequest} UpdateFindingRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateFindingRequest.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.cloud.securitycenter.v1.UpdateFindingRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.finding = $root.google.cloud.securitycenter.v1.Finding.decode(reader, reader.uint32()); - break; - case 2: - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; + /** + * Encodes the specified IamPolicy message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.Asset.IamPolicy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1p1beta1.Asset.IamPolicy + * @static + * @param {google.cloud.securitycenter.v1p1beta1.Asset.IIamPolicy} message IamPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IamPolicy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an IamPolicy message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1p1beta1.Asset.IamPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1p1beta1.Asset.IamPolicy} IamPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IamPolicy.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.cloud.securitycenter.v1p1beta1.Asset.IamPolicy(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.policyBlob = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } } - } - return message; - }; + return message; + }; - /** - * Decodes an UpdateFindingRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.UpdateFindingRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.UpdateFindingRequest} UpdateFindingRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateFindingRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Decodes an IamPolicy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1p1beta1.Asset.IamPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1p1beta1.Asset.IamPolicy} IamPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IamPolicy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Verifies an UpdateFindingRequest message. - * @function verify - * @memberof google.cloud.securitycenter.v1.UpdateFindingRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UpdateFindingRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.finding != null && message.hasOwnProperty("finding")) { - var error = $root.google.cloud.securitycenter.v1.Finding.verify(message.finding); - if (error) - return "finding." + error; - } - if (message.updateMask != null && message.hasOwnProperty("updateMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.updateMask); - if (error) - return "updateMask." + error; - } - return null; - }; + /** + * Verifies an IamPolicy message. + * @function verify + * @memberof google.cloud.securitycenter.v1p1beta1.Asset.IamPolicy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IamPolicy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.policyBlob != null && message.hasOwnProperty("policyBlob")) + if (!$util.isString(message.policyBlob)) + return "policyBlob: string expected"; + return null; + }; - /** - * Creates an UpdateFindingRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v1.UpdateFindingRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.UpdateFindingRequest} UpdateFindingRequest - */ - UpdateFindingRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.UpdateFindingRequest) + /** + * Creates an IamPolicy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1p1beta1.Asset.IamPolicy + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1p1beta1.Asset.IamPolicy} IamPolicy + */ + IamPolicy.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1p1beta1.Asset.IamPolicy) + return object; + var message = new $root.google.cloud.securitycenter.v1p1beta1.Asset.IamPolicy(); + if (object.policyBlob != null) + message.policyBlob = String(object.policyBlob); + return message; + }; + + /** + * Creates a plain object from an IamPolicy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1p1beta1.Asset.IamPolicy + * @static + * @param {google.cloud.securitycenter.v1p1beta1.Asset.IamPolicy} message IamPolicy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IamPolicy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.policyBlob = ""; + if (message.policyBlob != null && message.hasOwnProperty("policyBlob")) + object.policyBlob = message.policyBlob; return object; - var message = new $root.google.cloud.securitycenter.v1.UpdateFindingRequest(); - if (object.finding != null) { - if (typeof object.finding !== "object") - throw TypeError(".google.cloud.securitycenter.v1.UpdateFindingRequest.finding: object expected"); - message.finding = $root.google.cloud.securitycenter.v1.Finding.fromObject(object.finding); - } - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.cloud.securitycenter.v1.UpdateFindingRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); - } - return message; - }; + }; - /** - * Creates a plain object from an UpdateFindingRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v1.UpdateFindingRequest - * @static - * @param {google.cloud.securitycenter.v1.UpdateFindingRequest} message UpdateFindingRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UpdateFindingRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.finding = null; - object.updateMask = null; - } - if (message.finding != null && message.hasOwnProperty("finding")) - object.finding = $root.google.cloud.securitycenter.v1.Finding.toObject(message.finding, options); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); - return object; - }; + /** + * Converts this IamPolicy to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1p1beta1.Asset.IamPolicy + * @instance + * @returns {Object.} JSON object + */ + IamPolicy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Converts this UpdateFindingRequest to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1.UpdateFindingRequest - * @instance - * @returns {Object.} JSON object - */ - UpdateFindingRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + return IamPolicy; + })(); - return UpdateFindingRequest; + return Asset; })(); - v1.UpdateOrganizationSettingsRequest = (function() { + v1p1beta1.SecurityMarks = (function() { /** - * Properties of an UpdateOrganizationSettingsRequest. - * @memberof google.cloud.securitycenter.v1 - * @interface IUpdateOrganizationSettingsRequest - * @property {google.cloud.securitycenter.v1.IOrganizationSettings|null} [organizationSettings] UpdateOrganizationSettingsRequest organizationSettings - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateOrganizationSettingsRequest updateMask + * Properties of a SecurityMarks. + * @memberof google.cloud.securitycenter.v1p1beta1 + * @interface ISecurityMarks + * @property {string|null} [name] SecurityMarks name + * @property {Object.|null} [marks] SecurityMarks marks */ /** - * Constructs a new UpdateOrganizationSettingsRequest. - * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents an UpdateOrganizationSettingsRequest. - * @implements IUpdateOrganizationSettingsRequest + * Constructs a new SecurityMarks. + * @memberof google.cloud.securitycenter.v1p1beta1 + * @classdesc Represents a SecurityMarks. + * @implements ISecurityMarks * @constructor - * @param {google.cloud.securitycenter.v1.IUpdateOrganizationSettingsRequest=} [properties] Properties to set + * @param {google.cloud.securitycenter.v1p1beta1.ISecurityMarks=} [properties] Properties to set */ - function UpdateOrganizationSettingsRequest(properties) { + function SecurityMarks(properties) { + this.marks = {}; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -8844,88 +18978,94 @@ } /** - * UpdateOrganizationSettingsRequest organizationSettings. - * @member {google.cloud.securitycenter.v1.IOrganizationSettings|null|undefined} organizationSettings - * @memberof google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest + * SecurityMarks name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1p1beta1.SecurityMarks * @instance */ - UpdateOrganizationSettingsRequest.prototype.organizationSettings = null; + SecurityMarks.prototype.name = ""; /** - * UpdateOrganizationSettingsRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest + * SecurityMarks marks. + * @member {Object.} marks + * @memberof google.cloud.securitycenter.v1p1beta1.SecurityMarks * @instance */ - UpdateOrganizationSettingsRequest.prototype.updateMask = null; + SecurityMarks.prototype.marks = $util.emptyObject; /** - * Creates a new UpdateOrganizationSettingsRequest instance using the specified properties. + * Creates a new SecurityMarks instance using the specified properties. * @function create - * @memberof google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest + * @memberof google.cloud.securitycenter.v1p1beta1.SecurityMarks * @static - * @param {google.cloud.securitycenter.v1.IUpdateOrganizationSettingsRequest=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest} UpdateOrganizationSettingsRequest instance + * @param {google.cloud.securitycenter.v1p1beta1.ISecurityMarks=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1p1beta1.SecurityMarks} SecurityMarks instance */ - UpdateOrganizationSettingsRequest.create = function create(properties) { - return new UpdateOrganizationSettingsRequest(properties); + SecurityMarks.create = function create(properties) { + return new SecurityMarks(properties); }; /** - * Encodes the specified UpdateOrganizationSettingsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest.verify|verify} messages. + * Encodes the specified SecurityMarks message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.SecurityMarks.verify|verify} messages. * @function encode - * @memberof google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest + * @memberof google.cloud.securitycenter.v1p1beta1.SecurityMarks * @static - * @param {google.cloud.securitycenter.v1.IUpdateOrganizationSettingsRequest} message UpdateOrganizationSettingsRequest message or plain object to encode + * @param {google.cloud.securitycenter.v1p1beta1.ISecurityMarks} message SecurityMarks message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateOrganizationSettingsRequest.encode = function encode(message, writer) { + SecurityMarks.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.organizationSettings != null && message.hasOwnProperty("organizationSettings")) - $root.google.cloud.securitycenter.v1.OrganizationSettings.encode(message.organizationSettings, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.marks != null && message.hasOwnProperty("marks")) + for (var keys = Object.keys(message.marks), i = 0; i < keys.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.marks[keys[i]]).ldelim(); return writer; }; /** - * Encodes the specified UpdateOrganizationSettingsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest.verify|verify} messages. + * Encodes the specified SecurityMarks message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.SecurityMarks.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest + * @memberof google.cloud.securitycenter.v1p1beta1.SecurityMarks * @static - * @param {google.cloud.securitycenter.v1.IUpdateOrganizationSettingsRequest} message UpdateOrganizationSettingsRequest message or plain object to encode + * @param {google.cloud.securitycenter.v1p1beta1.ISecurityMarks} message SecurityMarks message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateOrganizationSettingsRequest.encodeDelimited = function encodeDelimited(message, writer) { + SecurityMarks.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an UpdateOrganizationSettingsRequest message from the specified reader or buffer. + * Decodes a SecurityMarks message from the specified reader or buffer. * @function decode - * @memberof google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest + * @memberof google.cloud.securitycenter.v1p1beta1.SecurityMarks * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest} UpdateOrganizationSettingsRequest + * @returns {google.cloud.securitycenter.v1p1beta1.SecurityMarks} SecurityMarks * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UpdateOrganizationSettingsRequest.decode = function decode(reader, length) { + SecurityMarks.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.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1p1beta1.SecurityMarks(), key; while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.organizationSettings = $root.google.cloud.securitycenter.v1.OrganizationSettings.decode(reader, reader.uint32()); + message.name = reader.string(); break; case 2: - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + reader.skip().pos++; + if (message.marks === $util.emptyObject) + message.marks = {}; + key = reader.string(); + reader.pos++; + message.marks[key] = reader.string(); break; default: reader.skipType(tag & 7); @@ -8936,127 +19076,140 @@ }; /** - * Decodes an UpdateOrganizationSettingsRequest message from the specified reader or buffer, length delimited. + * Decodes a SecurityMarks message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest + * @memberof google.cloud.securitycenter.v1p1beta1.SecurityMarks * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest} UpdateOrganizationSettingsRequest + * @returns {google.cloud.securitycenter.v1p1beta1.SecurityMarks} SecurityMarks * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UpdateOrganizationSettingsRequest.decodeDelimited = function decodeDelimited(reader) { + SecurityMarks.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an UpdateOrganizationSettingsRequest message. + * Verifies a SecurityMarks message. * @function verify - * @memberof google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest + * @memberof google.cloud.securitycenter.v1p1beta1.SecurityMarks * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - UpdateOrganizationSettingsRequest.verify = function verify(message) { + SecurityMarks.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.organizationSettings != null && message.hasOwnProperty("organizationSettings")) { - var error = $root.google.cloud.securitycenter.v1.OrganizationSettings.verify(message.organizationSettings); - if (error) - return "organizationSettings." + error; - } - if (message.updateMask != null && message.hasOwnProperty("updateMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.updateMask); - if (error) - return "updateMask." + error; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.marks != null && message.hasOwnProperty("marks")) { + if (!$util.isObject(message.marks)) + return "marks: object expected"; + var key = Object.keys(message.marks); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.marks[key[i]])) + return "marks: string{k:string} expected"; } return null; }; /** - * Creates an UpdateOrganizationSettingsRequest message from a plain object. Also converts values to their respective internal types. + * Creates a SecurityMarks message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest + * @memberof google.cloud.securitycenter.v1p1beta1.SecurityMarks * @static * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest} UpdateOrganizationSettingsRequest + * @returns {google.cloud.securitycenter.v1p1beta1.SecurityMarks} SecurityMarks */ - UpdateOrganizationSettingsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest) + SecurityMarks.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1p1beta1.SecurityMarks) return object; - var message = new $root.google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest(); - if (object.organizationSettings != null) { - if (typeof object.organizationSettings !== "object") - throw TypeError(".google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest.organizationSettings: object expected"); - message.organizationSettings = $root.google.cloud.securitycenter.v1.OrganizationSettings.fromObject(object.organizationSettings); - } - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + var message = new $root.google.cloud.securitycenter.v1p1beta1.SecurityMarks(); + if (object.name != null) + message.name = String(object.name); + if (object.marks) { + if (typeof object.marks !== "object") + throw TypeError(".google.cloud.securitycenter.v1p1beta1.SecurityMarks.marks: object expected"); + message.marks = {}; + for (var keys = Object.keys(object.marks), i = 0; i < keys.length; ++i) + message.marks[keys[i]] = String(object.marks[keys[i]]); } return message; }; /** - * Creates a plain object from an UpdateOrganizationSettingsRequest message. Also converts values to other types if specified. + * Creates a plain object from a SecurityMarks message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest + * @memberof google.cloud.securitycenter.v1p1beta1.SecurityMarks * @static - * @param {google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest} message UpdateOrganizationSettingsRequest + * @param {google.cloud.securitycenter.v1p1beta1.SecurityMarks} message SecurityMarks * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - UpdateOrganizationSettingsRequest.toObject = function toObject(message, options) { + SecurityMarks.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.organizationSettings = null; - object.updateMask = null; + if (options.objects || options.defaults) + object.marks = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + var keys2; + if (message.marks && (keys2 = Object.keys(message.marks)).length) { + object.marks = {}; + for (var j = 0; j < keys2.length; ++j) + object.marks[keys2[j]] = message.marks[keys2[j]]; } - if (message.organizationSettings != null && message.hasOwnProperty("organizationSettings")) - object.organizationSettings = $root.google.cloud.securitycenter.v1.OrganizationSettings.toObject(message.organizationSettings, options); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); return object; }; /** - * Converts this UpdateOrganizationSettingsRequest to JSON. + * Converts this SecurityMarks to JSON. * @function toJSON - * @memberof google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest + * @memberof google.cloud.securitycenter.v1p1beta1.SecurityMarks * @instance * @returns {Object.} JSON object */ - UpdateOrganizationSettingsRequest.prototype.toJSON = function toJSON() { + SecurityMarks.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return UpdateOrganizationSettingsRequest; + return SecurityMarks; })(); - v1.UpdateSourceRequest = (function() { + v1p1beta1.Finding = (function() { /** - * Properties of an UpdateSourceRequest. - * @memberof google.cloud.securitycenter.v1 - * @interface IUpdateSourceRequest - * @property {google.cloud.securitycenter.v1.ISource|null} [source] UpdateSourceRequest source - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateSourceRequest updateMask + * Properties of a Finding. + * @memberof google.cloud.securitycenter.v1p1beta1 + * @interface IFinding + * @property {string|null} [name] Finding name + * @property {string|null} [parent] Finding parent + * @property {string|null} [resourceName] Finding resourceName + * @property {google.cloud.securitycenter.v1p1beta1.Finding.State|null} [state] Finding state + * @property {string|null} [category] Finding category + * @property {string|null} [externalUri] Finding externalUri + * @property {Object.|null} [sourceProperties] Finding sourceProperties + * @property {google.cloud.securitycenter.v1p1beta1.ISecurityMarks|null} [securityMarks] Finding securityMarks + * @property {google.protobuf.ITimestamp|null} [eventTime] Finding eventTime + * @property {google.protobuf.ITimestamp|null} [createTime] Finding createTime */ /** - * Constructs a new UpdateSourceRequest. - * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents an UpdateSourceRequest. - * @implements IUpdateSourceRequest + * Constructs a new Finding. + * @memberof google.cloud.securitycenter.v1p1beta1 + * @classdesc Represents a Finding. + * @implements IFinding * @constructor - * @param {google.cloud.securitycenter.v1.IUpdateSourceRequest=} [properties] Properties to set + * @param {google.cloud.securitycenter.v1p1beta1.IFinding=} [properties] Properties to set */ - function UpdateSourceRequest(properties) { + function Finding(properties) { + this.sourceProperties = {}; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -9064,88 +19217,200 @@ } /** - * UpdateSourceRequest source. - * @member {google.cloud.securitycenter.v1.ISource|null|undefined} source - * @memberof google.cloud.securitycenter.v1.UpdateSourceRequest + * Finding name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1p1beta1.Finding * @instance */ - UpdateSourceRequest.prototype.source = null; + Finding.prototype.name = ""; /** - * UpdateSourceRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.cloud.securitycenter.v1.UpdateSourceRequest + * Finding parent. + * @member {string} parent + * @memberof google.cloud.securitycenter.v1p1beta1.Finding * @instance */ - UpdateSourceRequest.prototype.updateMask = null; + Finding.prototype.parent = ""; /** - * Creates a new UpdateSourceRequest instance using the specified properties. + * Finding resourceName. + * @member {string} resourceName + * @memberof google.cloud.securitycenter.v1p1beta1.Finding + * @instance + */ + Finding.prototype.resourceName = ""; + + /** + * Finding state. + * @member {google.cloud.securitycenter.v1p1beta1.Finding.State} state + * @memberof google.cloud.securitycenter.v1p1beta1.Finding + * @instance + */ + Finding.prototype.state = 0; + + /** + * Finding category. + * @member {string} category + * @memberof google.cloud.securitycenter.v1p1beta1.Finding + * @instance + */ + Finding.prototype.category = ""; + + /** + * Finding externalUri. + * @member {string} externalUri + * @memberof google.cloud.securitycenter.v1p1beta1.Finding + * @instance + */ + Finding.prototype.externalUri = ""; + + /** + * Finding sourceProperties. + * @member {Object.} sourceProperties + * @memberof google.cloud.securitycenter.v1p1beta1.Finding + * @instance + */ + Finding.prototype.sourceProperties = $util.emptyObject; + + /** + * Finding securityMarks. + * @member {google.cloud.securitycenter.v1p1beta1.ISecurityMarks|null|undefined} securityMarks + * @memberof google.cloud.securitycenter.v1p1beta1.Finding + * @instance + */ + Finding.prototype.securityMarks = null; + + /** + * Finding eventTime. + * @member {google.protobuf.ITimestamp|null|undefined} eventTime + * @memberof google.cloud.securitycenter.v1p1beta1.Finding + * @instance + */ + Finding.prototype.eventTime = null; + + /** + * Finding createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.securitycenter.v1p1beta1.Finding + * @instance + */ + Finding.prototype.createTime = null; + + /** + * Creates a new Finding instance using the specified properties. * @function create - * @memberof google.cloud.securitycenter.v1.UpdateSourceRequest + * @memberof google.cloud.securitycenter.v1p1beta1.Finding * @static - * @param {google.cloud.securitycenter.v1.IUpdateSourceRequest=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.UpdateSourceRequest} UpdateSourceRequest instance + * @param {google.cloud.securitycenter.v1p1beta1.IFinding=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1p1beta1.Finding} Finding instance */ - UpdateSourceRequest.create = function create(properties) { - return new UpdateSourceRequest(properties); + Finding.create = function create(properties) { + return new Finding(properties); }; /** - * Encodes the specified UpdateSourceRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.UpdateSourceRequest.verify|verify} messages. + * Encodes the specified Finding message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.Finding.verify|verify} messages. * @function encode - * @memberof google.cloud.securitycenter.v1.UpdateSourceRequest + * @memberof google.cloud.securitycenter.v1p1beta1.Finding * @static - * @param {google.cloud.securitycenter.v1.IUpdateSourceRequest} message UpdateSourceRequest message or plain object to encode + * @param {google.cloud.securitycenter.v1p1beta1.IFinding} message Finding message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateSourceRequest.encode = function encode(message, writer) { + Finding.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.source != null && message.hasOwnProperty("source")) - $root.google.cloud.securitycenter.v1.Source.encode(message.source, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.parent != null && message.hasOwnProperty("parent")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.parent); + if (message.resourceName != null && message.hasOwnProperty("resourceName")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.resourceName); + if (message.state != null && message.hasOwnProperty("state")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.state); + if (message.category != null && message.hasOwnProperty("category")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.category); + if (message.externalUri != null && message.hasOwnProperty("externalUri")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.externalUri); + if (message.sourceProperties != null && message.hasOwnProperty("sourceProperties")) + for (var keys = Object.keys(message.sourceProperties), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 7, wireType 2 =*/58).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.protobuf.Value.encode(message.sourceProperties[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.securityMarks != null && message.hasOwnProperty("securityMarks")) + $root.google.cloud.securitycenter.v1p1beta1.SecurityMarks.encode(message.securityMarks, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.eventTime != null && message.hasOwnProperty("eventTime")) + $root.google.protobuf.Timestamp.encode(message.eventTime, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.createTime != null && message.hasOwnProperty("createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); return writer; }; /** - * Encodes the specified UpdateSourceRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.UpdateSourceRequest.verify|verify} messages. + * Encodes the specified Finding message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.Finding.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.UpdateSourceRequest + * @memberof google.cloud.securitycenter.v1p1beta1.Finding * @static - * @param {google.cloud.securitycenter.v1.IUpdateSourceRequest} message UpdateSourceRequest message or plain object to encode + * @param {google.cloud.securitycenter.v1p1beta1.IFinding} message Finding message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateSourceRequest.encodeDelimited = function encodeDelimited(message, writer) { + Finding.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an UpdateSourceRequest message from the specified reader or buffer. + * Decodes a Finding message from the specified reader or buffer. * @function decode - * @memberof google.cloud.securitycenter.v1.UpdateSourceRequest + * @memberof google.cloud.securitycenter.v1p1beta1.Finding * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.UpdateSourceRequest} UpdateSourceRequest + * @returns {google.cloud.securitycenter.v1p1beta1.Finding} Finding * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UpdateSourceRequest.decode = function decode(reader, length) { + Finding.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.cloud.securitycenter.v1.UpdateSourceRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1p1beta1.Finding(), key; while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.source = $root.google.cloud.securitycenter.v1.Source.decode(reader, reader.uint32()); + message.name = reader.string(); break; case 2: - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + message.parent = reader.string(); + break; + case 3: + message.resourceName = reader.string(); + break; + case 4: + message.state = reader.int32(); + break; + case 5: + message.category = reader.string(); + break; + case 6: + message.externalUri = reader.string(); + break; + case 7: + reader.skip().pos++; + if (message.sourceProperties === $util.emptyObject) + message.sourceProperties = {}; + key = reader.string(); + reader.pos++; + message.sourceProperties[key] = $root.google.protobuf.Value.decode(reader, reader.uint32()); + break; + case 8: + message.securityMarks = $root.google.cloud.securitycenter.v1p1beta1.SecurityMarks.decode(reader, reader.uint32()); + break; + case 9: + message.eventTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 10: + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -9156,128 +19421,254 @@ }; /** - * Decodes an UpdateSourceRequest message from the specified reader or buffer, length delimited. + * Decodes a Finding message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.UpdateSourceRequest + * @memberof google.cloud.securitycenter.v1p1beta1.Finding * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.UpdateSourceRequest} UpdateSourceRequest + * @returns {google.cloud.securitycenter.v1p1beta1.Finding} Finding * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UpdateSourceRequest.decodeDelimited = function decodeDelimited(reader) { + Finding.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an UpdateSourceRequest message. + * Verifies a Finding message. * @function verify - * @memberof google.cloud.securitycenter.v1.UpdateSourceRequest + * @memberof google.cloud.securitycenter.v1p1beta1.Finding * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - UpdateSourceRequest.verify = function verify(message) { + Finding.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.source != null && message.hasOwnProperty("source")) { - var error = $root.google.cloud.securitycenter.v1.Source.verify(message.source); + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.resourceName != null && message.hasOwnProperty("resourceName")) + if (!$util.isString(message.resourceName)) + return "resourceName: string expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: 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"; + if (message.externalUri != null && message.hasOwnProperty("externalUri")) + if (!$util.isString(message.externalUri)) + return "externalUri: string expected"; + if (message.sourceProperties != null && message.hasOwnProperty("sourceProperties")) { + if (!$util.isObject(message.sourceProperties)) + return "sourceProperties: object expected"; + var key = Object.keys(message.sourceProperties); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.protobuf.Value.verify(message.sourceProperties[key[i]]); + if (error) + return "sourceProperties." + error; + } + } + if (message.securityMarks != null && message.hasOwnProperty("securityMarks")) { + var error = $root.google.cloud.securitycenter.v1p1beta1.SecurityMarks.verify(message.securityMarks); if (error) - return "source." + error; + return "securityMarks." + error; } - if (message.updateMask != null && message.hasOwnProperty("updateMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (message.eventTime != null && message.hasOwnProperty("eventTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.eventTime); if (error) - return "updateMask." + error; + return "eventTime." + error; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; } return null; }; /** - * Creates an UpdateSourceRequest message from a plain object. Also converts values to their respective internal types. + * Creates a Finding message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.securitycenter.v1.UpdateSourceRequest + * @memberof google.cloud.securitycenter.v1p1beta1.Finding * @static * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.UpdateSourceRequest} UpdateSourceRequest + * @returns {google.cloud.securitycenter.v1p1beta1.Finding} Finding */ - UpdateSourceRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.UpdateSourceRequest) + Finding.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1p1beta1.Finding) return object; - var message = new $root.google.cloud.securitycenter.v1.UpdateSourceRequest(); - if (object.source != null) { - if (typeof object.source !== "object") - throw TypeError(".google.cloud.securitycenter.v1.UpdateSourceRequest.source: object expected"); - message.source = $root.google.cloud.securitycenter.v1.Source.fromObject(object.source); + var message = new $root.google.cloud.securitycenter.v1p1beta1.Finding(); + if (object.name != null) + message.name = String(object.name); + if (object.parent != null) + message.parent = String(object.parent); + if (object.resourceName != null) + message.resourceName = String(object.resourceName); + switch (object.state) { + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "ACTIVE": + case 1: + message.state = 1; + break; + case "INACTIVE": + case 2: + message.state = 2; + break; } - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.cloud.securitycenter.v1.UpdateSourceRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + if (object.category != null) + message.category = String(object.category); + if (object.externalUri != null) + message.externalUri = String(object.externalUri); + if (object.sourceProperties) { + if (typeof object.sourceProperties !== "object") + throw TypeError(".google.cloud.securitycenter.v1p1beta1.Finding.sourceProperties: object expected"); + message.sourceProperties = {}; + for (var keys = Object.keys(object.sourceProperties), i = 0; i < keys.length; ++i) { + if (typeof object.sourceProperties[keys[i]] !== "object") + throw TypeError(".google.cloud.securitycenter.v1p1beta1.Finding.sourceProperties: object expected"); + message.sourceProperties[keys[i]] = $root.google.protobuf.Value.fromObject(object.sourceProperties[keys[i]]); + } + } + if (object.securityMarks != null) { + if (typeof object.securityMarks !== "object") + throw TypeError(".google.cloud.securitycenter.v1p1beta1.Finding.securityMarks: object expected"); + message.securityMarks = $root.google.cloud.securitycenter.v1p1beta1.SecurityMarks.fromObject(object.securityMarks); + } + if (object.eventTime != null) { + if (typeof object.eventTime !== "object") + throw TypeError(".google.cloud.securitycenter.v1p1beta1.Finding.eventTime: object expected"); + message.eventTime = $root.google.protobuf.Timestamp.fromObject(object.eventTime); + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.securitycenter.v1p1beta1.Finding.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); } return message; }; /** - * Creates a plain object from an UpdateSourceRequest message. Also converts values to other types if specified. + * Creates a plain object from a Finding message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.securitycenter.v1.UpdateSourceRequest + * @memberof google.cloud.securitycenter.v1p1beta1.Finding * @static - * @param {google.cloud.securitycenter.v1.UpdateSourceRequest} message UpdateSourceRequest + * @param {google.cloud.securitycenter.v1p1beta1.Finding} message Finding * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - UpdateSourceRequest.toObject = function toObject(message, options) { + Finding.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; + if (options.objects || options.defaults) + object.sourceProperties = {}; if (options.defaults) { - object.source = null; - object.updateMask = null; + object.name = ""; + object.parent = ""; + object.resourceName = ""; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.category = ""; + object.externalUri = ""; + object.securityMarks = null; + object.eventTime = null; + object.createTime = null; } - if (message.source != null && message.hasOwnProperty("source")) - object.source = $root.google.cloud.securitycenter.v1.Source.toObject(message.source, options); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.resourceName != null && message.hasOwnProperty("resourceName")) + object.resourceName = message.resourceName; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.securitycenter.v1p1beta1.Finding.State[message.state] : message.state; + if (message.category != null && message.hasOwnProperty("category")) + object.category = message.category; + if (message.externalUri != null && message.hasOwnProperty("externalUri")) + object.externalUri = message.externalUri; + var keys2; + if (message.sourceProperties && (keys2 = Object.keys(message.sourceProperties)).length) { + object.sourceProperties = {}; + for (var j = 0; j < keys2.length; ++j) + object.sourceProperties[keys2[j]] = $root.google.protobuf.Value.toObject(message.sourceProperties[keys2[j]], options); + } + if (message.securityMarks != null && message.hasOwnProperty("securityMarks")) + object.securityMarks = $root.google.cloud.securitycenter.v1p1beta1.SecurityMarks.toObject(message.securityMarks, options); + if (message.eventTime != null && message.hasOwnProperty("eventTime")) + object.eventTime = $root.google.protobuf.Timestamp.toObject(message.eventTime, options); + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); return object; }; /** - * Converts this UpdateSourceRequest to JSON. + * Converts this Finding to JSON. * @function toJSON - * @memberof google.cloud.securitycenter.v1.UpdateSourceRequest + * @memberof google.cloud.securitycenter.v1p1beta1.Finding * @instance * @returns {Object.} JSON object */ - UpdateSourceRequest.prototype.toJSON = function toJSON() { + Finding.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return UpdateSourceRequest; - })(); - - v1.UpdateSecurityMarksRequest = (function() { - /** - * Properties of an UpdateSecurityMarksRequest. - * @memberof google.cloud.securitycenter.v1 - * @interface IUpdateSecurityMarksRequest - * @property {google.cloud.securitycenter.v1.ISecurityMarks|null} [securityMarks] UpdateSecurityMarksRequest securityMarks - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateSecurityMarksRequest updateMask - * @property {google.protobuf.ITimestamp|null} [startTime] UpdateSecurityMarksRequest startTime + * State enum. + * @name google.cloud.securitycenter.v1p1beta1.Finding.State + * @enum {string} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} ACTIVE=1 ACTIVE value + * @property {number} INACTIVE=2 INACTIVE value + */ + Finding.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ACTIVE"] = 1; + values[valuesById[2] = "INACTIVE"] = 2; + return values; + })(); + + return Finding; + })(); + + v1p1beta1.NotificationConfig = (function() { + + /** + * Properties of a NotificationConfig. + * @memberof google.cloud.securitycenter.v1p1beta1 + * @interface INotificationConfig + * @property {string|null} [name] NotificationConfig name + * @property {string|null} [description] NotificationConfig description + * @property {google.cloud.securitycenter.v1p1beta1.NotificationConfig.EventType|null} [eventType] NotificationConfig eventType + * @property {string|null} [pubsubTopic] NotificationConfig pubsubTopic + * @property {string|null} [serviceAccount] NotificationConfig serviceAccount + * @property {google.cloud.securitycenter.v1p1beta1.NotificationConfig.IStreamingConfig|null} [streamingConfig] NotificationConfig streamingConfig */ /** - * Constructs a new UpdateSecurityMarksRequest. - * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents an UpdateSecurityMarksRequest. - * @implements IUpdateSecurityMarksRequest + * Constructs a new NotificationConfig. + * @memberof google.cloud.securitycenter.v1p1beta1 + * @classdesc Represents a NotificationConfig. + * @implements INotificationConfig * @constructor - * @param {google.cloud.securitycenter.v1.IUpdateSecurityMarksRequest=} [properties] Properties to set + * @param {google.cloud.securitycenter.v1p1beta1.INotificationConfig=} [properties] Properties to set */ - function UpdateSecurityMarksRequest(properties) { + function NotificationConfig(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -9285,101 +19676,154 @@ } /** - * UpdateSecurityMarksRequest securityMarks. - * @member {google.cloud.securitycenter.v1.ISecurityMarks|null|undefined} securityMarks - * @memberof google.cloud.securitycenter.v1.UpdateSecurityMarksRequest + * NotificationConfig name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1p1beta1.NotificationConfig * @instance */ - UpdateSecurityMarksRequest.prototype.securityMarks = null; + NotificationConfig.prototype.name = ""; /** - * UpdateSecurityMarksRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.cloud.securitycenter.v1.UpdateSecurityMarksRequest + * NotificationConfig description. + * @member {string} description + * @memberof google.cloud.securitycenter.v1p1beta1.NotificationConfig * @instance */ - UpdateSecurityMarksRequest.prototype.updateMask = null; + NotificationConfig.prototype.description = ""; /** - * UpdateSecurityMarksRequest startTime. - * @member {google.protobuf.ITimestamp|null|undefined} startTime - * @memberof google.cloud.securitycenter.v1.UpdateSecurityMarksRequest + * NotificationConfig eventType. + * @member {google.cloud.securitycenter.v1p1beta1.NotificationConfig.EventType} eventType + * @memberof google.cloud.securitycenter.v1p1beta1.NotificationConfig * @instance */ - UpdateSecurityMarksRequest.prototype.startTime = null; + NotificationConfig.prototype.eventType = 0; /** - * Creates a new UpdateSecurityMarksRequest instance using the specified properties. + * NotificationConfig pubsubTopic. + * @member {string} pubsubTopic + * @memberof google.cloud.securitycenter.v1p1beta1.NotificationConfig + * @instance + */ + NotificationConfig.prototype.pubsubTopic = ""; + + /** + * NotificationConfig serviceAccount. + * @member {string} serviceAccount + * @memberof google.cloud.securitycenter.v1p1beta1.NotificationConfig + * @instance + */ + NotificationConfig.prototype.serviceAccount = ""; + + /** + * NotificationConfig streamingConfig. + * @member {google.cloud.securitycenter.v1p1beta1.NotificationConfig.IStreamingConfig|null|undefined} streamingConfig + * @memberof google.cloud.securitycenter.v1p1beta1.NotificationConfig + * @instance + */ + NotificationConfig.prototype.streamingConfig = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * NotificationConfig notifyConfig. + * @member {"streamingConfig"|undefined} notifyConfig + * @memberof google.cloud.securitycenter.v1p1beta1.NotificationConfig + * @instance + */ + Object.defineProperty(NotificationConfig.prototype, "notifyConfig", { + get: $util.oneOfGetter($oneOfFields = ["streamingConfig"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new NotificationConfig instance using the specified properties. * @function create - * @memberof google.cloud.securitycenter.v1.UpdateSecurityMarksRequest + * @memberof google.cloud.securitycenter.v1p1beta1.NotificationConfig * @static - * @param {google.cloud.securitycenter.v1.IUpdateSecurityMarksRequest=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.UpdateSecurityMarksRequest} UpdateSecurityMarksRequest instance + * @param {google.cloud.securitycenter.v1p1beta1.INotificationConfig=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1p1beta1.NotificationConfig} NotificationConfig instance */ - UpdateSecurityMarksRequest.create = function create(properties) { - return new UpdateSecurityMarksRequest(properties); + NotificationConfig.create = function create(properties) { + return new NotificationConfig(properties); }; /** - * Encodes the specified UpdateSecurityMarksRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.UpdateSecurityMarksRequest.verify|verify} messages. + * Encodes the specified NotificationConfig message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.NotificationConfig.verify|verify} messages. * @function encode - * @memberof google.cloud.securitycenter.v1.UpdateSecurityMarksRequest + * @memberof google.cloud.securitycenter.v1p1beta1.NotificationConfig * @static - * @param {google.cloud.securitycenter.v1.IUpdateSecurityMarksRequest} message UpdateSecurityMarksRequest message or plain object to encode + * @param {google.cloud.securitycenter.v1p1beta1.INotificationConfig} message NotificationConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateSecurityMarksRequest.encode = function encode(message, writer) { + NotificationConfig.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.securityMarks != null && message.hasOwnProperty("securityMarks")) - $root.google.cloud.securitycenter.v1.SecurityMarks.encode(message.securityMarks, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.startTime != null && message.hasOwnProperty("startTime")) - $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.description != null && message.hasOwnProperty("description")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); + if (message.eventType != null && message.hasOwnProperty("eventType")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.eventType); + if (message.pubsubTopic != null && message.hasOwnProperty("pubsubTopic")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.pubsubTopic); + if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.serviceAccount); + if (message.streamingConfig != null && message.hasOwnProperty("streamingConfig")) + $root.google.cloud.securitycenter.v1p1beta1.NotificationConfig.StreamingConfig.encode(message.streamingConfig, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); return writer; }; /** - * Encodes the specified UpdateSecurityMarksRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.UpdateSecurityMarksRequest.verify|verify} messages. + * Encodes the specified NotificationConfig message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.NotificationConfig.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.UpdateSecurityMarksRequest + * @memberof google.cloud.securitycenter.v1p1beta1.NotificationConfig * @static - * @param {google.cloud.securitycenter.v1.IUpdateSecurityMarksRequest} message UpdateSecurityMarksRequest message or plain object to encode + * @param {google.cloud.securitycenter.v1p1beta1.INotificationConfig} message NotificationConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateSecurityMarksRequest.encodeDelimited = function encodeDelimited(message, writer) { + NotificationConfig.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an UpdateSecurityMarksRequest message from the specified reader or buffer. + * Decodes a NotificationConfig message from the specified reader or buffer. * @function decode - * @memberof google.cloud.securitycenter.v1.UpdateSecurityMarksRequest + * @memberof google.cloud.securitycenter.v1p1beta1.NotificationConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.UpdateSecurityMarksRequest} UpdateSecurityMarksRequest + * @returns {google.cloud.securitycenter.v1p1beta1.NotificationConfig} NotificationConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UpdateSecurityMarksRequest.decode = function decode(reader, length) { + NotificationConfig.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.cloud.securitycenter.v1.UpdateSecurityMarksRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1p1beta1.NotificationConfig(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.securityMarks = $root.google.cloud.securitycenter.v1.SecurityMarks.decode(reader, reader.uint32()); + message.name = reader.string(); break; case 2: - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + message.description = reader.string(); break; case 3: - message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + message.eventType = reader.int32(); + break; + case 4: + message.pubsubTopic = reader.string(); + break; + case 5: + message.serviceAccount = reader.string(); + break; + case 6: + message.streamingConfig = $root.google.cloud.securitycenter.v1p1beta1.NotificationConfig.StreamingConfig.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -9390,161 +19834,374 @@ }; /** - * Decodes an UpdateSecurityMarksRequest message from the specified reader or buffer, length delimited. + * Decodes a NotificationConfig message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.UpdateSecurityMarksRequest + * @memberof google.cloud.securitycenter.v1p1beta1.NotificationConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.UpdateSecurityMarksRequest} UpdateSecurityMarksRequest + * @returns {google.cloud.securitycenter.v1p1beta1.NotificationConfig} NotificationConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UpdateSecurityMarksRequest.decodeDelimited = function decodeDelimited(reader) { + NotificationConfig.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an UpdateSecurityMarksRequest message. + * Verifies a NotificationConfig message. * @function verify - * @memberof google.cloud.securitycenter.v1.UpdateSecurityMarksRequest + * @memberof google.cloud.securitycenter.v1p1beta1.NotificationConfig * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - UpdateSecurityMarksRequest.verify = function verify(message) { + NotificationConfig.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.securityMarks != null && message.hasOwnProperty("securityMarks")) { - var error = $root.google.cloud.securitycenter.v1.SecurityMarks.verify(message.securityMarks); - if (error) - return "securityMarks." + error; - } - if (message.updateMask != null && message.hasOwnProperty("updateMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.updateMask); - if (error) - return "updateMask." + error; - } - if (message.startTime != null && message.hasOwnProperty("startTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.startTime); - if (error) - return "startTime." + error; + var properties = {}; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.eventType != null && message.hasOwnProperty("eventType")) + switch (message.eventType) { + default: + return "eventType: enum value expected"; + case 0: + case 1: + break; + } + if (message.pubsubTopic != null && message.hasOwnProperty("pubsubTopic")) + if (!$util.isString(message.pubsubTopic)) + return "pubsubTopic: string expected"; + if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) + if (!$util.isString(message.serviceAccount)) + return "serviceAccount: string expected"; + if (message.streamingConfig != null && message.hasOwnProperty("streamingConfig")) { + properties.notifyConfig = 1; + { + var error = $root.google.cloud.securitycenter.v1p1beta1.NotificationConfig.StreamingConfig.verify(message.streamingConfig); + if (error) + return "streamingConfig." + error; + } } return null; }; /** - * Creates an UpdateSecurityMarksRequest message from a plain object. Also converts values to their respective internal types. + * Creates a NotificationConfig message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.securitycenter.v1.UpdateSecurityMarksRequest + * @memberof google.cloud.securitycenter.v1p1beta1.NotificationConfig * @static * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.UpdateSecurityMarksRequest} UpdateSecurityMarksRequest + * @returns {google.cloud.securitycenter.v1p1beta1.NotificationConfig} NotificationConfig */ - UpdateSecurityMarksRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.UpdateSecurityMarksRequest) + NotificationConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1p1beta1.NotificationConfig) + return object; + var message = new $root.google.cloud.securitycenter.v1p1beta1.NotificationConfig(); + if (object.name != null) + message.name = String(object.name); + if (object.description != null) + message.description = String(object.description); + switch (object.eventType) { + case "EVENT_TYPE_UNSPECIFIED": + case 0: + message.eventType = 0; + break; + case "FINDING": + case 1: + message.eventType = 1; + break; + } + if (object.pubsubTopic != null) + message.pubsubTopic = String(object.pubsubTopic); + if (object.serviceAccount != null) + message.serviceAccount = String(object.serviceAccount); + if (object.streamingConfig != null) { + if (typeof object.streamingConfig !== "object") + throw TypeError(".google.cloud.securitycenter.v1p1beta1.NotificationConfig.streamingConfig: object expected"); + message.streamingConfig = $root.google.cloud.securitycenter.v1p1beta1.NotificationConfig.StreamingConfig.fromObject(object.streamingConfig); + } + return message; + }; + + /** + * Creates a plain object from a NotificationConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1p1beta1.NotificationConfig + * @static + * @param {google.cloud.securitycenter.v1p1beta1.NotificationConfig} message NotificationConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NotificationConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.description = ""; + object.eventType = options.enums === String ? "EVENT_TYPE_UNSPECIFIED" : 0; + object.pubsubTopic = ""; + object.serviceAccount = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.eventType != null && message.hasOwnProperty("eventType")) + object.eventType = options.enums === String ? $root.google.cloud.securitycenter.v1p1beta1.NotificationConfig.EventType[message.eventType] : message.eventType; + if (message.pubsubTopic != null && message.hasOwnProperty("pubsubTopic")) + object.pubsubTopic = message.pubsubTopic; + if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) + object.serviceAccount = message.serviceAccount; + if (message.streamingConfig != null && message.hasOwnProperty("streamingConfig")) { + object.streamingConfig = $root.google.cloud.securitycenter.v1p1beta1.NotificationConfig.StreamingConfig.toObject(message.streamingConfig, options); + if (options.oneofs) + object.notifyConfig = "streamingConfig"; + } + return object; + }; + + /** + * Converts this NotificationConfig to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1p1beta1.NotificationConfig + * @instance + * @returns {Object.} JSON object + */ + NotificationConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + NotificationConfig.StreamingConfig = (function() { + + /** + * Properties of a StreamingConfig. + * @memberof google.cloud.securitycenter.v1p1beta1.NotificationConfig + * @interface IStreamingConfig + * @property {string|null} [filter] StreamingConfig filter + */ + + /** + * Constructs a new StreamingConfig. + * @memberof google.cloud.securitycenter.v1p1beta1.NotificationConfig + * @classdesc Represents a StreamingConfig. + * @implements IStreamingConfig + * @constructor + * @param {google.cloud.securitycenter.v1p1beta1.NotificationConfig.IStreamingConfig=} [properties] Properties to set + */ + function StreamingConfig(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]]; + } + + /** + * StreamingConfig filter. + * @member {string} filter + * @memberof google.cloud.securitycenter.v1p1beta1.NotificationConfig.StreamingConfig + * @instance + */ + StreamingConfig.prototype.filter = ""; + + /** + * Creates a new StreamingConfig instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1p1beta1.NotificationConfig.StreamingConfig + * @static + * @param {google.cloud.securitycenter.v1p1beta1.NotificationConfig.IStreamingConfig=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1p1beta1.NotificationConfig.StreamingConfig} StreamingConfig instance + */ + StreamingConfig.create = function create(properties) { + return new StreamingConfig(properties); + }; + + /** + * Encodes the specified StreamingConfig message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.NotificationConfig.StreamingConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1p1beta1.NotificationConfig.StreamingConfig + * @static + * @param {google.cloud.securitycenter.v1p1beta1.NotificationConfig.IStreamingConfig} message StreamingConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StreamingConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.filter != null && message.hasOwnProperty("filter")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.filter); + return writer; + }; + + /** + * Encodes the specified StreamingConfig message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.NotificationConfig.StreamingConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1p1beta1.NotificationConfig.StreamingConfig + * @static + * @param {google.cloud.securitycenter.v1p1beta1.NotificationConfig.IStreamingConfig} message StreamingConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StreamingConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StreamingConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1p1beta1.NotificationConfig.StreamingConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1p1beta1.NotificationConfig.StreamingConfig} StreamingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StreamingConfig.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.cloud.securitycenter.v1p1beta1.NotificationConfig.StreamingConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.filter = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StreamingConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1p1beta1.NotificationConfig.StreamingConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1p1beta1.NotificationConfig.StreamingConfig} StreamingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StreamingConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StreamingConfig message. + * @function verify + * @memberof google.cloud.securitycenter.v1p1beta1.NotificationConfig.StreamingConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StreamingConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + return null; + }; + + /** + * Creates a StreamingConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1p1beta1.NotificationConfig.StreamingConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1p1beta1.NotificationConfig.StreamingConfig} StreamingConfig + */ + StreamingConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1p1beta1.NotificationConfig.StreamingConfig) + return object; + var message = new $root.google.cloud.securitycenter.v1p1beta1.NotificationConfig.StreamingConfig(); + if (object.filter != null) + message.filter = String(object.filter); + return message; + }; + + /** + * Creates a plain object from a StreamingConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1p1beta1.NotificationConfig.StreamingConfig + * @static + * @param {google.cloud.securitycenter.v1p1beta1.NotificationConfig.StreamingConfig} message StreamingConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StreamingConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.filter = ""; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; return object; - var message = new $root.google.cloud.securitycenter.v1.UpdateSecurityMarksRequest(); - if (object.securityMarks != null) { - if (typeof object.securityMarks !== "object") - throw TypeError(".google.cloud.securitycenter.v1.UpdateSecurityMarksRequest.securityMarks: object expected"); - message.securityMarks = $root.google.cloud.securitycenter.v1.SecurityMarks.fromObject(object.securityMarks); - } - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.cloud.securitycenter.v1.UpdateSecurityMarksRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); - } - if (object.startTime != null) { - if (typeof object.startTime !== "object") - throw TypeError(".google.cloud.securitycenter.v1.UpdateSecurityMarksRequest.startTime: object expected"); - message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); - } - return message; - }; + }; - /** - * Creates a plain object from an UpdateSecurityMarksRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v1.UpdateSecurityMarksRequest - * @static - * @param {google.cloud.securitycenter.v1.UpdateSecurityMarksRequest} message UpdateSecurityMarksRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UpdateSecurityMarksRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.securityMarks = null; - object.updateMask = null; - object.startTime = null; - } - if (message.securityMarks != null && message.hasOwnProperty("securityMarks")) - object.securityMarks = $root.google.cloud.securitycenter.v1.SecurityMarks.toObject(message.securityMarks, options); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); - if (message.startTime != null && message.hasOwnProperty("startTime")) - object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); - return object; - }; + /** + * Converts this StreamingConfig to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1p1beta1.NotificationConfig.StreamingConfig + * @instance + * @returns {Object.} JSON object + */ + StreamingConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return StreamingConfig; + })(); /** - * Converts this UpdateSecurityMarksRequest to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1.UpdateSecurityMarksRequest - * @instance - * @returns {Object.} JSON object + * EventType enum. + * @name google.cloud.securitycenter.v1p1beta1.NotificationConfig.EventType + * @enum {string} + * @property {number} EVENT_TYPE_UNSPECIFIED=0 EVENT_TYPE_UNSPECIFIED value + * @property {number} FINDING=1 FINDING value */ - UpdateSecurityMarksRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + NotificationConfig.EventType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "EVENT_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "FINDING"] = 1; + return values; + })(); - return UpdateSecurityMarksRequest; + return NotificationConfig; })(); - return v1; - })(); - - securitycenter.v1beta1 = (function() { - - /** - * Namespace v1beta1. - * @memberof google.cloud.securitycenter - * @namespace - */ - var v1beta1 = {}; - - v1beta1.Finding = (function() { + v1p1beta1.NotificationMessage = (function() { /** - * Properties of a Finding. - * @memberof google.cloud.securitycenter.v1beta1 - * @interface IFinding - * @property {string|null} [name] Finding name - * @property {string|null} [parent] Finding parent - * @property {string|null} [resourceName] Finding resourceName - * @property {google.cloud.securitycenter.v1beta1.Finding.State|null} [state] Finding state - * @property {string|null} [category] Finding category - * @property {string|null} [externalUri] Finding externalUri - * @property {Object.|null} [sourceProperties] Finding sourceProperties - * @property {google.cloud.securitycenter.v1beta1.ISecurityMarks|null} [securityMarks] Finding securityMarks - * @property {google.protobuf.ITimestamp|null} [eventTime] Finding eventTime - * @property {google.protobuf.ITimestamp|null} [createTime] Finding createTime + * Properties of a NotificationMessage. + * @memberof google.cloud.securitycenter.v1p1beta1 + * @interface INotificationMessage + * @property {string|null} [notificationConfigName] NotificationMessage notificationConfigName + * @property {google.cloud.securitycenter.v1p1beta1.IFinding|null} [finding] NotificationMessage finding */ /** - * Constructs a new Finding. - * @memberof google.cloud.securitycenter.v1beta1 - * @classdesc Represents a Finding. - * @implements IFinding + * Constructs a new NotificationMessage. + * @memberof google.cloud.securitycenter.v1p1beta1 + * @classdesc Represents a NotificationMessage. + * @implements INotificationMessage * @constructor - * @param {google.cloud.securitycenter.v1beta1.IFinding=} [properties] Properties to set + * @param {google.cloud.securitycenter.v1p1beta1.INotificationMessage=} [properties] Properties to set */ - function Finding(properties) { - this.sourceProperties = {}; + function NotificationMessage(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -9552,200 +20209,102 @@ } /** - * Finding name. - * @member {string} name - * @memberof google.cloud.securitycenter.v1beta1.Finding - * @instance - */ - Finding.prototype.name = ""; - - /** - * Finding parent. - * @member {string} parent - * @memberof google.cloud.securitycenter.v1beta1.Finding - * @instance - */ - Finding.prototype.parent = ""; - - /** - * Finding resourceName. - * @member {string} resourceName - * @memberof google.cloud.securitycenter.v1beta1.Finding - * @instance - */ - Finding.prototype.resourceName = ""; - - /** - * Finding state. - * @member {google.cloud.securitycenter.v1beta1.Finding.State} state - * @memberof google.cloud.securitycenter.v1beta1.Finding - * @instance - */ - Finding.prototype.state = 0; - - /** - * Finding category. - * @member {string} category - * @memberof google.cloud.securitycenter.v1beta1.Finding - * @instance - */ - Finding.prototype.category = ""; - - /** - * Finding externalUri. - * @member {string} externalUri - * @memberof google.cloud.securitycenter.v1beta1.Finding - * @instance - */ - Finding.prototype.externalUri = ""; - - /** - * Finding sourceProperties. - * @member {Object.} sourceProperties - * @memberof google.cloud.securitycenter.v1beta1.Finding + * NotificationMessage notificationConfigName. + * @member {string} notificationConfigName + * @memberof google.cloud.securitycenter.v1p1beta1.NotificationMessage * @instance */ - Finding.prototype.sourceProperties = $util.emptyObject; + NotificationMessage.prototype.notificationConfigName = ""; /** - * Finding securityMarks. - * @member {google.cloud.securitycenter.v1beta1.ISecurityMarks|null|undefined} securityMarks - * @memberof google.cloud.securitycenter.v1beta1.Finding + * NotificationMessage finding. + * @member {google.cloud.securitycenter.v1p1beta1.IFinding|null|undefined} finding + * @memberof google.cloud.securitycenter.v1p1beta1.NotificationMessage * @instance */ - Finding.prototype.securityMarks = null; + NotificationMessage.prototype.finding = null; - /** - * Finding eventTime. - * @member {google.protobuf.ITimestamp|null|undefined} eventTime - * @memberof google.cloud.securitycenter.v1beta1.Finding - * @instance - */ - Finding.prototype.eventTime = null; + // OneOf field names bound to virtual getters and setters + var $oneOfFields; /** - * Finding createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.securitycenter.v1beta1.Finding + * NotificationMessage event. + * @member {"finding"|undefined} event + * @memberof google.cloud.securitycenter.v1p1beta1.NotificationMessage * @instance */ - Finding.prototype.createTime = null; + Object.defineProperty(NotificationMessage.prototype, "event", { + get: $util.oneOfGetter($oneOfFields = ["finding"]), + set: $util.oneOfSetter($oneOfFields) + }); /** - * Creates a new Finding instance using the specified properties. + * Creates a new NotificationMessage instance using the specified properties. * @function create - * @memberof google.cloud.securitycenter.v1beta1.Finding + * @memberof google.cloud.securitycenter.v1p1beta1.NotificationMessage * @static - * @param {google.cloud.securitycenter.v1beta1.IFinding=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1beta1.Finding} Finding instance + * @param {google.cloud.securitycenter.v1p1beta1.INotificationMessage=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1p1beta1.NotificationMessage} NotificationMessage instance */ - Finding.create = function create(properties) { - return new Finding(properties); + NotificationMessage.create = function create(properties) { + return new NotificationMessage(properties); }; /** - * Encodes the specified Finding message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.Finding.verify|verify} messages. + * Encodes the specified NotificationMessage message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.NotificationMessage.verify|verify} messages. * @function encode - * @memberof google.cloud.securitycenter.v1beta1.Finding + * @memberof google.cloud.securitycenter.v1p1beta1.NotificationMessage * @static - * @param {google.cloud.securitycenter.v1beta1.IFinding} message Finding message or plain object to encode + * @param {google.cloud.securitycenter.v1p1beta1.INotificationMessage} message NotificationMessage message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Finding.encode = function encode(message, writer) { + NotificationMessage.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.parent != null && message.hasOwnProperty("parent")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.parent); - if (message.resourceName != null && message.hasOwnProperty("resourceName")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.resourceName); - if (message.state != null && message.hasOwnProperty("state")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.state); - if (message.category != null && message.hasOwnProperty("category")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.category); - if (message.externalUri != null && message.hasOwnProperty("externalUri")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.externalUri); - if (message.sourceProperties != null && message.hasOwnProperty("sourceProperties")) - for (var keys = Object.keys(message.sourceProperties), i = 0; i < keys.length; ++i) { - writer.uint32(/* id 7, wireType 2 =*/58).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); - $root.google.protobuf.Value.encode(message.sourceProperties[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); - } - if (message.securityMarks != null && message.hasOwnProperty("securityMarks")) - $root.google.cloud.securitycenter.v1beta1.SecurityMarks.encode(message.securityMarks, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.eventTime != null && message.hasOwnProperty("eventTime")) - $root.google.protobuf.Timestamp.encode(message.eventTime, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.createTime != null && message.hasOwnProperty("createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.notificationConfigName != null && message.hasOwnProperty("notificationConfigName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.notificationConfigName); + if (message.finding != null && message.hasOwnProperty("finding")) + $root.google.cloud.securitycenter.v1p1beta1.Finding.encode(message.finding, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** - * Encodes the specified Finding message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.Finding.verify|verify} messages. + * Encodes the specified NotificationMessage message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.NotificationMessage.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1beta1.Finding + * @memberof google.cloud.securitycenter.v1p1beta1.NotificationMessage * @static - * @param {google.cloud.securitycenter.v1beta1.IFinding} message Finding message or plain object to encode + * @param {google.cloud.securitycenter.v1p1beta1.INotificationMessage} message NotificationMessage message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Finding.encodeDelimited = function encodeDelimited(message, writer) { + NotificationMessage.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a Finding message from the specified reader or buffer. + * Decodes a NotificationMessage message from the specified reader or buffer. * @function decode - * @memberof google.cloud.securitycenter.v1beta1.Finding + * @memberof google.cloud.securitycenter.v1p1beta1.NotificationMessage * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1beta1.Finding} Finding + * @returns {google.cloud.securitycenter.v1p1beta1.NotificationMessage} NotificationMessage * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Finding.decode = function decode(reader, length) { + NotificationMessage.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.cloud.securitycenter.v1beta1.Finding(), key; + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1p1beta1.NotificationMessage(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.name = reader.string(); - break; - case 2: - message.parent = reader.string(); - break; - case 3: - message.resourceName = reader.string(); - break; - case 4: - message.state = reader.int32(); - break; - case 5: - message.category = reader.string(); - break; - case 6: - message.externalUri = reader.string(); - break; - case 7: - reader.skip().pos++; - if (message.sourceProperties === $util.emptyObject) - message.sourceProperties = {}; - key = reader.string(); - reader.pos++; - message.sourceProperties[key] = $root.google.protobuf.Value.decode(reader, reader.uint32()); - break; - case 8: - message.securityMarks = $root.google.cloud.securitycenter.v1beta1.SecurityMarks.decode(reader, reader.uint32()); - break; - case 9: - message.eventTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 10: - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + message.notificationConfigName = reader.string(); + break; + case 2: + message.finding = $root.google.cloud.securitycenter.v1p1beta1.Finding.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -9756,251 +20315,128 @@ }; /** - * Decodes a Finding message from the specified reader or buffer, length delimited. + * Decodes a NotificationMessage message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1beta1.Finding + * @memberof google.cloud.securitycenter.v1p1beta1.NotificationMessage * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1beta1.Finding} Finding + * @returns {google.cloud.securitycenter.v1p1beta1.NotificationMessage} NotificationMessage * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Finding.decodeDelimited = function decodeDelimited(reader) { + NotificationMessage.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a Finding message. + * Verifies a NotificationMessage message. * @function verify - * @memberof google.cloud.securitycenter.v1beta1.Finding + * @memberof google.cloud.securitycenter.v1p1beta1.NotificationMessage * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Finding.verify = function verify(message) { + NotificationMessage.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.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.resourceName != null && message.hasOwnProperty("resourceName")) - if (!$util.isString(message.resourceName)) - return "resourceName: string expected"; - if (message.state != null && message.hasOwnProperty("state")) - switch (message.state) { - default: - return "state: 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"; - if (message.externalUri != null && message.hasOwnProperty("externalUri")) - if (!$util.isString(message.externalUri)) - return "externalUri: string expected"; - if (message.sourceProperties != null && message.hasOwnProperty("sourceProperties")) { - if (!$util.isObject(message.sourceProperties)) - return "sourceProperties: object expected"; - var key = Object.keys(message.sourceProperties); - for (var i = 0; i < key.length; ++i) { - var error = $root.google.protobuf.Value.verify(message.sourceProperties[key[i]]); + var properties = {}; + if (message.notificationConfigName != null && message.hasOwnProperty("notificationConfigName")) + if (!$util.isString(message.notificationConfigName)) + return "notificationConfigName: string expected"; + if (message.finding != null && message.hasOwnProperty("finding")) { + properties.event = 1; + { + var error = $root.google.cloud.securitycenter.v1p1beta1.Finding.verify(message.finding); if (error) - return "sourceProperties." + error; + return "finding." + error; } } - if (message.securityMarks != null && message.hasOwnProperty("securityMarks")) { - var error = $root.google.cloud.securitycenter.v1beta1.SecurityMarks.verify(message.securityMarks); - if (error) - return "securityMarks." + error; - } - if (message.eventTime != null && message.hasOwnProperty("eventTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.eventTime); - if (error) - return "eventTime." + error; - } - if (message.createTime != null && message.hasOwnProperty("createTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.createTime); - if (error) - return "createTime." + error; - } return null; }; /** - * Creates a Finding message from a plain object. Also converts values to their respective internal types. + * Creates a NotificationMessage message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.securitycenter.v1beta1.Finding + * @memberof google.cloud.securitycenter.v1p1beta1.NotificationMessage * @static * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1beta1.Finding} Finding + * @returns {google.cloud.securitycenter.v1p1beta1.NotificationMessage} NotificationMessage */ - Finding.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1beta1.Finding) + NotificationMessage.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1p1beta1.NotificationMessage) return object; - var message = new $root.google.cloud.securitycenter.v1beta1.Finding(); - if (object.name != null) - message.name = String(object.name); - if (object.parent != null) - message.parent = String(object.parent); - if (object.resourceName != null) - message.resourceName = String(object.resourceName); - switch (object.state) { - case "STATE_UNSPECIFIED": - case 0: - message.state = 0; - break; - case "ACTIVE": - case 1: - message.state = 1; - break; - case "INACTIVE": - case 2: - message.state = 2; - break; - } - if (object.category != null) - message.category = String(object.category); - if (object.externalUri != null) - message.externalUri = String(object.externalUri); - if (object.sourceProperties) { - if (typeof object.sourceProperties !== "object") - throw TypeError(".google.cloud.securitycenter.v1beta1.Finding.sourceProperties: object expected"); - message.sourceProperties = {}; - for (var keys = Object.keys(object.sourceProperties), i = 0; i < keys.length; ++i) { - if (typeof object.sourceProperties[keys[i]] !== "object") - throw TypeError(".google.cloud.securitycenter.v1beta1.Finding.sourceProperties: object expected"); - message.sourceProperties[keys[i]] = $root.google.protobuf.Value.fromObject(object.sourceProperties[keys[i]]); - } - } - if (object.securityMarks != null) { - if (typeof object.securityMarks !== "object") - throw TypeError(".google.cloud.securitycenter.v1beta1.Finding.securityMarks: object expected"); - message.securityMarks = $root.google.cloud.securitycenter.v1beta1.SecurityMarks.fromObject(object.securityMarks); - } - if (object.eventTime != null) { - if (typeof object.eventTime !== "object") - throw TypeError(".google.cloud.securitycenter.v1beta1.Finding.eventTime: object expected"); - message.eventTime = $root.google.protobuf.Timestamp.fromObject(object.eventTime); - } - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.securitycenter.v1beta1.Finding.createTime: object expected"); - message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + var message = new $root.google.cloud.securitycenter.v1p1beta1.NotificationMessage(); + if (object.notificationConfigName != null) + message.notificationConfigName = String(object.notificationConfigName); + if (object.finding != null) { + if (typeof object.finding !== "object") + throw TypeError(".google.cloud.securitycenter.v1p1beta1.NotificationMessage.finding: object expected"); + message.finding = $root.google.cloud.securitycenter.v1p1beta1.Finding.fromObject(object.finding); } return message; }; /** - * Creates a plain object from a Finding message. Also converts values to other types if specified. + * Creates a plain object from a NotificationMessage message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.securitycenter.v1beta1.Finding + * @memberof google.cloud.securitycenter.v1p1beta1.NotificationMessage * @static - * @param {google.cloud.securitycenter.v1beta1.Finding} message Finding + * @param {google.cloud.securitycenter.v1p1beta1.NotificationMessage} message NotificationMessage * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Finding.toObject = function toObject(message, options) { + NotificationMessage.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.objects || options.defaults) - object.sourceProperties = {}; - if (options.defaults) { - object.name = ""; - object.parent = ""; - object.resourceName = ""; - object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; - object.category = ""; - object.externalUri = ""; - object.securityMarks = null; - object.eventTime = null; - object.createTime = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.resourceName != null && message.hasOwnProperty("resourceName")) - object.resourceName = message.resourceName; - if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.securitycenter.v1beta1.Finding.State[message.state] : message.state; - if (message.category != null && message.hasOwnProperty("category")) - object.category = message.category; - if (message.externalUri != null && message.hasOwnProperty("externalUri")) - object.externalUri = message.externalUri; - var keys2; - if (message.sourceProperties && (keys2 = Object.keys(message.sourceProperties)).length) { - object.sourceProperties = {}; - for (var j = 0; j < keys2.length; ++j) - object.sourceProperties[keys2[j]] = $root.google.protobuf.Value.toObject(message.sourceProperties[keys2[j]], options); + if (options.defaults) + object.notificationConfigName = ""; + if (message.notificationConfigName != null && message.hasOwnProperty("notificationConfigName")) + object.notificationConfigName = message.notificationConfigName; + if (message.finding != null && message.hasOwnProperty("finding")) { + object.finding = $root.google.cloud.securitycenter.v1p1beta1.Finding.toObject(message.finding, options); + if (options.oneofs) + object.event = "finding"; } - if (message.securityMarks != null && message.hasOwnProperty("securityMarks")) - object.securityMarks = $root.google.cloud.securitycenter.v1beta1.SecurityMarks.toObject(message.securityMarks, options); - if (message.eventTime != null && message.hasOwnProperty("eventTime")) - object.eventTime = $root.google.protobuf.Timestamp.toObject(message.eventTime, options); - if (message.createTime != null && message.hasOwnProperty("createTime")) - object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); return object; }; /** - * Converts this Finding to JSON. + * Converts this NotificationMessage to JSON. * @function toJSON - * @memberof google.cloud.securitycenter.v1beta1.Finding + * @memberof google.cloud.securitycenter.v1p1beta1.NotificationMessage * @instance * @returns {Object.} JSON object */ - Finding.prototype.toJSON = function toJSON() { + NotificationMessage.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - /** - * State enum. - * @name google.cloud.securitycenter.v1beta1.Finding.State - * @enum {string} - * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value - * @property {number} ACTIVE=1 ACTIVE value - * @property {number} INACTIVE=2 INACTIVE value - */ - Finding.State = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; - values[valuesById[1] = "ACTIVE"] = 1; - values[valuesById[2] = "INACTIVE"] = 2; - return values; - })(); - - return Finding; + return NotificationMessage; })(); - v1beta1.SecurityMarks = (function() { + v1p1beta1.OrganizationSettings = (function() { /** - * Properties of a SecurityMarks. - * @memberof google.cloud.securitycenter.v1beta1 - * @interface ISecurityMarks - * @property {string|null} [name] SecurityMarks name - * @property {Object.|null} [marks] SecurityMarks marks + * Properties of an OrganizationSettings. + * @memberof google.cloud.securitycenter.v1p1beta1 + * @interface IOrganizationSettings + * @property {string|null} [name] OrganizationSettings name + * @property {boolean|null} [enableAssetDiscovery] OrganizationSettings enableAssetDiscovery + * @property {google.cloud.securitycenter.v1p1beta1.OrganizationSettings.IAssetDiscoveryConfig|null} [assetDiscoveryConfig] OrganizationSettings assetDiscoveryConfig */ /** - * Constructs a new SecurityMarks. - * @memberof google.cloud.securitycenter.v1beta1 - * @classdesc Represents a SecurityMarks. - * @implements ISecurityMarks + * Constructs a new OrganizationSettings. + * @memberof google.cloud.securitycenter.v1p1beta1 + * @classdesc Represents an OrganizationSettings. + * @implements IOrganizationSettings * @constructor - * @param {google.cloud.securitycenter.v1beta1.ISecurityMarks=} [properties] Properties to set + * @param {google.cloud.securitycenter.v1p1beta1.IOrganizationSettings=} [properties] Properties to set */ - function SecurityMarks(properties) { - this.marks = {}; + function OrganizationSettings(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -10008,94 +20444,101 @@ } /** - * SecurityMarks name. + * OrganizationSettings name. * @member {string} name - * @memberof google.cloud.securitycenter.v1beta1.SecurityMarks + * @memberof google.cloud.securitycenter.v1p1beta1.OrganizationSettings * @instance */ - SecurityMarks.prototype.name = ""; + OrganizationSettings.prototype.name = ""; /** - * SecurityMarks marks. - * @member {Object.} marks - * @memberof google.cloud.securitycenter.v1beta1.SecurityMarks + * OrganizationSettings enableAssetDiscovery. + * @member {boolean} enableAssetDiscovery + * @memberof google.cloud.securitycenter.v1p1beta1.OrganizationSettings * @instance */ - SecurityMarks.prototype.marks = $util.emptyObject; + OrganizationSettings.prototype.enableAssetDiscovery = false; /** - * Creates a new SecurityMarks instance using the specified properties. + * OrganizationSettings assetDiscoveryConfig. + * @member {google.cloud.securitycenter.v1p1beta1.OrganizationSettings.IAssetDiscoveryConfig|null|undefined} assetDiscoveryConfig + * @memberof google.cloud.securitycenter.v1p1beta1.OrganizationSettings + * @instance + */ + OrganizationSettings.prototype.assetDiscoveryConfig = null; + + /** + * Creates a new OrganizationSettings instance using the specified properties. * @function create - * @memberof google.cloud.securitycenter.v1beta1.SecurityMarks + * @memberof google.cloud.securitycenter.v1p1beta1.OrganizationSettings * @static - * @param {google.cloud.securitycenter.v1beta1.ISecurityMarks=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1beta1.SecurityMarks} SecurityMarks instance + * @param {google.cloud.securitycenter.v1p1beta1.IOrganizationSettings=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1p1beta1.OrganizationSettings} OrganizationSettings instance */ - SecurityMarks.create = function create(properties) { - return new SecurityMarks(properties); + OrganizationSettings.create = function create(properties) { + return new OrganizationSettings(properties); }; /** - * Encodes the specified SecurityMarks message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.SecurityMarks.verify|verify} messages. + * Encodes the specified OrganizationSettings message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.OrganizationSettings.verify|verify} messages. * @function encode - * @memberof google.cloud.securitycenter.v1beta1.SecurityMarks + * @memberof google.cloud.securitycenter.v1p1beta1.OrganizationSettings * @static - * @param {google.cloud.securitycenter.v1beta1.ISecurityMarks} message SecurityMarks message or plain object to encode + * @param {google.cloud.securitycenter.v1p1beta1.IOrganizationSettings} message OrganizationSettings message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SecurityMarks.encode = function encode(message, writer) { + OrganizationSettings.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.name != null && message.hasOwnProperty("name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.marks != null && message.hasOwnProperty("marks")) - for (var keys = Object.keys(message.marks), i = 0; i < keys.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.marks[keys[i]]).ldelim(); + if (message.enableAssetDiscovery != null && message.hasOwnProperty("enableAssetDiscovery")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.enableAssetDiscovery); + if (message.assetDiscoveryConfig != null && message.hasOwnProperty("assetDiscoveryConfig")) + $root.google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig.encode(message.assetDiscoveryConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; /** - * Encodes the specified SecurityMarks message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.SecurityMarks.verify|verify} messages. + * Encodes the specified OrganizationSettings message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.OrganizationSettings.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1beta1.SecurityMarks + * @memberof google.cloud.securitycenter.v1p1beta1.OrganizationSettings * @static - * @param {google.cloud.securitycenter.v1beta1.ISecurityMarks} message SecurityMarks message or plain object to encode + * @param {google.cloud.securitycenter.v1p1beta1.IOrganizationSettings} message OrganizationSettings message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SecurityMarks.encodeDelimited = function encodeDelimited(message, writer) { + OrganizationSettings.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a SecurityMarks message from the specified reader or buffer. + * Decodes an OrganizationSettings message from the specified reader or buffer. * @function decode - * @memberof google.cloud.securitycenter.v1beta1.SecurityMarks + * @memberof google.cloud.securitycenter.v1p1beta1.OrganizationSettings * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1beta1.SecurityMarks} SecurityMarks + * @returns {google.cloud.securitycenter.v1p1beta1.OrganizationSettings} OrganizationSettings * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SecurityMarks.decode = function decode(reader, length) { + OrganizationSettings.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.cloud.securitycenter.v1beta1.SecurityMarks(), key; + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1p1beta1.OrganizationSettings(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - reader.skip().pos++; - if (message.marks === $util.emptyObject) - message.marks = {}; - key = reader.string(); - reader.pos++; - message.marks[key] = reader.string(); + case 1: + message.name = reader.string(); + break; + case 2: + message.enableAssetDiscovery = reader.bool(); + break; + case 3: + message.assetDiscoveryConfig = $root.google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -10106,136 +20549,390 @@ }; /** - * Decodes a SecurityMarks message from the specified reader or buffer, length delimited. + * Decodes an OrganizationSettings message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1beta1.SecurityMarks + * @memberof google.cloud.securitycenter.v1p1beta1.OrganizationSettings * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1beta1.SecurityMarks} SecurityMarks + * @returns {google.cloud.securitycenter.v1p1beta1.OrganizationSettings} OrganizationSettings * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SecurityMarks.decodeDelimited = function decodeDelimited(reader) { + OrganizationSettings.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a SecurityMarks message. + * Verifies an OrganizationSettings message. * @function verify - * @memberof google.cloud.securitycenter.v1beta1.SecurityMarks + * @memberof google.cloud.securitycenter.v1p1beta1.OrganizationSettings * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - SecurityMarks.verify = function verify(message) { + OrganizationSettings.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.marks != null && message.hasOwnProperty("marks")) { - if (!$util.isObject(message.marks)) - return "marks: object expected"; - var key = Object.keys(message.marks); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.marks[key[i]])) - return "marks: string{k:string} expected"; + if (message.enableAssetDiscovery != null && message.hasOwnProperty("enableAssetDiscovery")) + if (typeof message.enableAssetDiscovery !== "boolean") + return "enableAssetDiscovery: boolean expected"; + if (message.assetDiscoveryConfig != null && message.hasOwnProperty("assetDiscoveryConfig")) { + var error = $root.google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig.verify(message.assetDiscoveryConfig); + if (error) + return "assetDiscoveryConfig." + error; } return null; }; - /** - * Creates a SecurityMarks message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v1beta1.SecurityMarks - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1beta1.SecurityMarks} SecurityMarks - */ - SecurityMarks.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1beta1.SecurityMarks) + /** + * Creates an OrganizationSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1p1beta1.OrganizationSettings + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1p1beta1.OrganizationSettings} OrganizationSettings + */ + OrganizationSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1p1beta1.OrganizationSettings) + return object; + var message = new $root.google.cloud.securitycenter.v1p1beta1.OrganizationSettings(); + if (object.name != null) + message.name = String(object.name); + if (object.enableAssetDiscovery != null) + message.enableAssetDiscovery = Boolean(object.enableAssetDiscovery); + if (object.assetDiscoveryConfig != null) { + if (typeof object.assetDiscoveryConfig !== "object") + throw TypeError(".google.cloud.securitycenter.v1p1beta1.OrganizationSettings.assetDiscoveryConfig: object expected"); + message.assetDiscoveryConfig = $root.google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig.fromObject(object.assetDiscoveryConfig); + } + return message; + }; + + /** + * Creates a plain object from an OrganizationSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1p1beta1.OrganizationSettings + * @static + * @param {google.cloud.securitycenter.v1p1beta1.OrganizationSettings} message OrganizationSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OrganizationSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.enableAssetDiscovery = false; + object.assetDiscoveryConfig = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.enableAssetDiscovery != null && message.hasOwnProperty("enableAssetDiscovery")) + object.enableAssetDiscovery = message.enableAssetDiscovery; + if (message.assetDiscoveryConfig != null && message.hasOwnProperty("assetDiscoveryConfig")) + object.assetDiscoveryConfig = $root.google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig.toObject(message.assetDiscoveryConfig, options); + return object; + }; + + /** + * Converts this OrganizationSettings to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1p1beta1.OrganizationSettings + * @instance + * @returns {Object.} JSON object + */ + OrganizationSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + OrganizationSettings.AssetDiscoveryConfig = (function() { + + /** + * Properties of an AssetDiscoveryConfig. + * @memberof google.cloud.securitycenter.v1p1beta1.OrganizationSettings + * @interface IAssetDiscoveryConfig + * @property {Array.|null} [projectIds] AssetDiscoveryConfig projectIds + * @property {google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode|null} [inclusionMode] AssetDiscoveryConfig inclusionMode + */ + + /** + * Constructs a new AssetDiscoveryConfig. + * @memberof google.cloud.securitycenter.v1p1beta1.OrganizationSettings + * @classdesc Represents an AssetDiscoveryConfig. + * @implements IAssetDiscoveryConfig + * @constructor + * @param {google.cloud.securitycenter.v1p1beta1.OrganizationSettings.IAssetDiscoveryConfig=} [properties] Properties to set + */ + function AssetDiscoveryConfig(properties) { + this.projectIds = []; + 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]]; + } + + /** + * AssetDiscoveryConfig projectIds. + * @member {Array.} projectIds + * @memberof google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig + * @instance + */ + AssetDiscoveryConfig.prototype.projectIds = $util.emptyArray; + + /** + * AssetDiscoveryConfig inclusionMode. + * @member {google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode} inclusionMode + * @memberof google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig + * @instance + */ + AssetDiscoveryConfig.prototype.inclusionMode = 0; + + /** + * Creates a new AssetDiscoveryConfig instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig + * @static + * @param {google.cloud.securitycenter.v1p1beta1.OrganizationSettings.IAssetDiscoveryConfig=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig} AssetDiscoveryConfig instance + */ + AssetDiscoveryConfig.create = function create(properties) { + return new AssetDiscoveryConfig(properties); + }; + + /** + * Encodes the specified AssetDiscoveryConfig message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig + * @static + * @param {google.cloud.securitycenter.v1p1beta1.OrganizationSettings.IAssetDiscoveryConfig} message AssetDiscoveryConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AssetDiscoveryConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.projectIds != null && message.projectIds.length) + for (var i = 0; i < message.projectIds.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectIds[i]); + if (message.inclusionMode != null && message.hasOwnProperty("inclusionMode")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.inclusionMode); + return writer; + }; + + /** + * Encodes the specified AssetDiscoveryConfig message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig + * @static + * @param {google.cloud.securitycenter.v1p1beta1.OrganizationSettings.IAssetDiscoveryConfig} message AssetDiscoveryConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AssetDiscoveryConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AssetDiscoveryConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig} AssetDiscoveryConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AssetDiscoveryConfig.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.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.projectIds && message.projectIds.length)) + message.projectIds = []; + message.projectIds.push(reader.string()); + break; + case 2: + message.inclusionMode = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AssetDiscoveryConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig} AssetDiscoveryConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AssetDiscoveryConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AssetDiscoveryConfig message. + * @function verify + * @memberof google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AssetDiscoveryConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.projectIds != null && message.hasOwnProperty("projectIds")) { + if (!Array.isArray(message.projectIds)) + return "projectIds: array expected"; + for (var i = 0; i < message.projectIds.length; ++i) + if (!$util.isString(message.projectIds[i])) + return "projectIds: string[] expected"; + } + if (message.inclusionMode != null && message.hasOwnProperty("inclusionMode")) + switch (message.inclusionMode) { + default: + return "inclusionMode: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates an AssetDiscoveryConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig} AssetDiscoveryConfig + */ + AssetDiscoveryConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig) + return object; + var message = new $root.google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig(); + if (object.projectIds) { + if (!Array.isArray(object.projectIds)) + throw TypeError(".google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig.projectIds: array expected"); + message.projectIds = []; + for (var i = 0; i < object.projectIds.length; ++i) + message.projectIds[i] = String(object.projectIds[i]); + } + switch (object.inclusionMode) { + case "INCLUSION_MODE_UNSPECIFIED": + case 0: + message.inclusionMode = 0; + break; + case "INCLUDE_ONLY": + case 1: + message.inclusionMode = 1; + break; + case "EXCLUDE": + case 2: + message.inclusionMode = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from an AssetDiscoveryConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig + * @static + * @param {google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig} message AssetDiscoveryConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AssetDiscoveryConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.projectIds = []; + if (options.defaults) + object.inclusionMode = options.enums === String ? "INCLUSION_MODE_UNSPECIFIED" : 0; + if (message.projectIds && message.projectIds.length) { + object.projectIds = []; + for (var j = 0; j < message.projectIds.length; ++j) + object.projectIds[j] = message.projectIds[j]; + } + if (message.inclusionMode != null && message.hasOwnProperty("inclusionMode")) + object.inclusionMode = options.enums === String ? $root.google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode[message.inclusionMode] : message.inclusionMode; return object; - var message = new $root.google.cloud.securitycenter.v1beta1.SecurityMarks(); - if (object.name != null) - message.name = String(object.name); - if (object.marks) { - if (typeof object.marks !== "object") - throw TypeError(".google.cloud.securitycenter.v1beta1.SecurityMarks.marks: object expected"); - message.marks = {}; - for (var keys = Object.keys(object.marks), i = 0; i < keys.length; ++i) - message.marks[keys[i]] = String(object.marks[keys[i]]); - } - return message; - }; + }; - /** - * Creates a plain object from a SecurityMarks message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v1beta1.SecurityMarks - * @static - * @param {google.cloud.securitycenter.v1beta1.SecurityMarks} message SecurityMarks - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SecurityMarks.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.objects || options.defaults) - object.marks = {}; - if (options.defaults) - object.name = ""; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - var keys2; - if (message.marks && (keys2 = Object.keys(message.marks)).length) { - object.marks = {}; - for (var j = 0; j < keys2.length; ++j) - object.marks[keys2[j]] = message.marks[keys2[j]]; - } - return object; - }; + /** + * Converts this AssetDiscoveryConfig to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig + * @instance + * @returns {Object.} JSON object + */ + AssetDiscoveryConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Converts this SecurityMarks to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1beta1.SecurityMarks - * @instance - * @returns {Object.} JSON object - */ - SecurityMarks.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * InclusionMode enum. + * @name google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode + * @enum {string} + * @property {number} INCLUSION_MODE_UNSPECIFIED=0 INCLUSION_MODE_UNSPECIFIED value + * @property {number} INCLUDE_ONLY=1 INCLUDE_ONLY value + * @property {number} EXCLUDE=2 EXCLUDE value + */ + AssetDiscoveryConfig.InclusionMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "INCLUSION_MODE_UNSPECIFIED"] = 0; + values[valuesById[1] = "INCLUDE_ONLY"] = 1; + values[valuesById[2] = "EXCLUDE"] = 2; + return values; + })(); - return SecurityMarks; + return AssetDiscoveryConfig; + })(); + + return OrganizationSettings; })(); - v1beta1.Asset = (function() { + v1p1beta1.RunAssetDiscoveryResponse = (function() { /** - * Properties of an Asset. - * @memberof google.cloud.securitycenter.v1beta1 - * @interface IAsset - * @property {string|null} [name] Asset name - * @property {google.cloud.securitycenter.v1beta1.Asset.ISecurityCenterProperties|null} [securityCenterProperties] Asset securityCenterProperties - * @property {Object.|null} [resourceProperties] Asset resourceProperties - * @property {google.cloud.securitycenter.v1beta1.ISecurityMarks|null} [securityMarks] Asset securityMarks - * @property {google.protobuf.ITimestamp|null} [createTime] Asset createTime - * @property {google.protobuf.ITimestamp|null} [updateTime] Asset updateTime + * Properties of a RunAssetDiscoveryResponse. + * @memberof google.cloud.securitycenter.v1p1beta1 + * @interface IRunAssetDiscoveryResponse + * @property {google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse.State|null} [state] RunAssetDiscoveryResponse state + * @property {google.protobuf.IDuration|null} [duration] RunAssetDiscoveryResponse duration */ /** - * Constructs a new Asset. - * @memberof google.cloud.securitycenter.v1beta1 - * @classdesc Represents an Asset. - * @implements IAsset + * Constructs a new RunAssetDiscoveryResponse. + * @memberof google.cloud.securitycenter.v1p1beta1 + * @classdesc Represents a RunAssetDiscoveryResponse. + * @implements IRunAssetDiscoveryResponse * @constructor - * @param {google.cloud.securitycenter.v1beta1.IAsset=} [properties] Properties to set + * @param {google.cloud.securitycenter.v1p1beta1.IRunAssetDiscoveryResponse=} [properties] Properties to set */ - function Asset(properties) { - this.resourceProperties = {}; + function RunAssetDiscoveryResponse(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -10243,148 +20940,88 @@ } /** - * Asset name. - * @member {string} name - * @memberof google.cloud.securitycenter.v1beta1.Asset - * @instance - */ - Asset.prototype.name = ""; - - /** - * Asset securityCenterProperties. - * @member {google.cloud.securitycenter.v1beta1.Asset.ISecurityCenterProperties|null|undefined} securityCenterProperties - * @memberof google.cloud.securitycenter.v1beta1.Asset - * @instance - */ - Asset.prototype.securityCenterProperties = null; - - /** - * Asset resourceProperties. - * @member {Object.} resourceProperties - * @memberof google.cloud.securitycenter.v1beta1.Asset - * @instance - */ - Asset.prototype.resourceProperties = $util.emptyObject; - - /** - * Asset securityMarks. - * @member {google.cloud.securitycenter.v1beta1.ISecurityMarks|null|undefined} securityMarks - * @memberof google.cloud.securitycenter.v1beta1.Asset - * @instance - */ - Asset.prototype.securityMarks = null; - - /** - * Asset createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.securitycenter.v1beta1.Asset + * RunAssetDiscoveryResponse state. + * @member {google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse.State} state + * @memberof google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse * @instance */ - Asset.prototype.createTime = null; + RunAssetDiscoveryResponse.prototype.state = 0; /** - * Asset updateTime. - * @member {google.protobuf.ITimestamp|null|undefined} updateTime - * @memberof google.cloud.securitycenter.v1beta1.Asset + * RunAssetDiscoveryResponse duration. + * @member {google.protobuf.IDuration|null|undefined} duration + * @memberof google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse * @instance */ - Asset.prototype.updateTime = null; + RunAssetDiscoveryResponse.prototype.duration = null; /** - * Creates a new Asset instance using the specified properties. + * Creates a new RunAssetDiscoveryResponse instance using the specified properties. * @function create - * @memberof google.cloud.securitycenter.v1beta1.Asset + * @memberof google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse * @static - * @param {google.cloud.securitycenter.v1beta1.IAsset=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1beta1.Asset} Asset instance + * @param {google.cloud.securitycenter.v1p1beta1.IRunAssetDiscoveryResponse=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse} RunAssetDiscoveryResponse instance */ - Asset.create = function create(properties) { - return new Asset(properties); + RunAssetDiscoveryResponse.create = function create(properties) { + return new RunAssetDiscoveryResponse(properties); }; /** - * Encodes the specified Asset message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.Asset.verify|verify} messages. + * Encodes the specified RunAssetDiscoveryResponse message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.securitycenter.v1beta1.Asset + * @memberof google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse * @static - * @param {google.cloud.securitycenter.v1beta1.IAsset} message Asset message or plain object to encode + * @param {google.cloud.securitycenter.v1p1beta1.IRunAssetDiscoveryResponse} message RunAssetDiscoveryResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Asset.encode = function encode(message, writer) { + RunAssetDiscoveryResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.securityCenterProperties != null && message.hasOwnProperty("securityCenterProperties")) - $root.google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties.encode(message.securityCenterProperties, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.resourceProperties != null && message.hasOwnProperty("resourceProperties")) - for (var keys = Object.keys(message.resourceProperties), i = 0; i < keys.length; ++i) { - writer.uint32(/* id 7, wireType 2 =*/58).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); - $root.google.protobuf.Value.encode(message.resourceProperties[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); - } - if (message.securityMarks != null && message.hasOwnProperty("securityMarks")) - $root.google.cloud.securitycenter.v1beta1.SecurityMarks.encode(message.securityMarks, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.createTime != null && message.hasOwnProperty("createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.updateTime != null && message.hasOwnProperty("updateTime")) - $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.state != null && message.hasOwnProperty("state")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.state); + if (message.duration != null && message.hasOwnProperty("duration")) + $root.google.protobuf.Duration.encode(message.duration, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** - * Encodes the specified Asset message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.Asset.verify|verify} messages. + * Encodes the specified RunAssetDiscoveryResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1beta1.Asset + * @memberof google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse * @static - * @param {google.cloud.securitycenter.v1beta1.IAsset} message Asset message or plain object to encode + * @param {google.cloud.securitycenter.v1p1beta1.IRunAssetDiscoveryResponse} message RunAssetDiscoveryResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Asset.encodeDelimited = function encodeDelimited(message, writer) { + RunAssetDiscoveryResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an Asset message from the specified reader or buffer. + * Decodes a RunAssetDiscoveryResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.securitycenter.v1beta1.Asset + * @memberof google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1beta1.Asset} Asset + * @returns {google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse} RunAssetDiscoveryResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Asset.decode = function decode(reader, length) { + RunAssetDiscoveryResponse.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.cloud.securitycenter.v1beta1.Asset(), key; + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.name = reader.string(); + message.state = reader.int32(); break; case 2: - message.securityCenterProperties = $root.google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties.decode(reader, reader.uint32()); - break; - case 7: - reader.skip().pos++; - if (message.resourceProperties === $util.emptyObject) - message.resourceProperties = {}; - key = reader.string(); - reader.pos++; - message.resourceProperties[key] = $root.google.protobuf.Value.decode(reader, reader.uint32()); - break; - case 8: - message.securityMarks = $root.google.cloud.securitycenter.v1beta1.SecurityMarks.decode(reader, reader.uint32()); - break; - case 9: - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 10: - message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + message.duration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -10395,971 +21032,958 @@ }; /** - * Decodes an Asset message from the specified reader or buffer, length delimited. + * Decodes a RunAssetDiscoveryResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1beta1.Asset + * @memberof google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1beta1.Asset} Asset + * @returns {google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse} RunAssetDiscoveryResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Asset.decodeDelimited = function decodeDelimited(reader) { + RunAssetDiscoveryResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an Asset message. + * Verifies a RunAssetDiscoveryResponse message. * @function verify - * @memberof google.cloud.securitycenter.v1beta1.Asset + * @memberof google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Asset.verify = function verify(message) { + RunAssetDiscoveryResponse.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.securityCenterProperties != null && message.hasOwnProperty("securityCenterProperties")) { - var error = $root.google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties.verify(message.securityCenterProperties); - if (error) - return "securityCenterProperties." + error; - } - if (message.resourceProperties != null && message.hasOwnProperty("resourceProperties")) { - if (!$util.isObject(message.resourceProperties)) - return "resourceProperties: object expected"; - var key = Object.keys(message.resourceProperties); - for (var i = 0; i < key.length; ++i) { - var error = $root.google.protobuf.Value.verify(message.resourceProperties[key[i]]); - if (error) - return "resourceProperties." + error; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; } - } - if (message.securityMarks != null && message.hasOwnProperty("securityMarks")) { - var error = $root.google.cloud.securitycenter.v1beta1.SecurityMarks.verify(message.securityMarks); - if (error) - return "securityMarks." + error; - } - if (message.createTime != null && message.hasOwnProperty("createTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.createTime); - if (error) - return "createTime." + error; - } - if (message.updateTime != null && message.hasOwnProperty("updateTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (message.duration != null && message.hasOwnProperty("duration")) { + var error = $root.google.protobuf.Duration.verify(message.duration); if (error) - return "updateTime." + error; + return "duration." + error; } return null; }; /** - * Creates an Asset message from a plain object. Also converts values to their respective internal types. + * Creates a RunAssetDiscoveryResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.securitycenter.v1beta1.Asset + * @memberof google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1beta1.Asset} Asset + * @returns {google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse} RunAssetDiscoveryResponse */ - Asset.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1beta1.Asset) + RunAssetDiscoveryResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse) return object; - var message = new $root.google.cloud.securitycenter.v1beta1.Asset(); - if (object.name != null) - message.name = String(object.name); - if (object.securityCenterProperties != null) { - if (typeof object.securityCenterProperties !== "object") - throw TypeError(".google.cloud.securitycenter.v1beta1.Asset.securityCenterProperties: object expected"); - message.securityCenterProperties = $root.google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties.fromObject(object.securityCenterProperties); - } - if (object.resourceProperties) { - if (typeof object.resourceProperties !== "object") - throw TypeError(".google.cloud.securitycenter.v1beta1.Asset.resourceProperties: object expected"); - message.resourceProperties = {}; - for (var keys = Object.keys(object.resourceProperties), i = 0; i < keys.length; ++i) { - if (typeof object.resourceProperties[keys[i]] !== "object") - throw TypeError(".google.cloud.securitycenter.v1beta1.Asset.resourceProperties: object expected"); - message.resourceProperties[keys[i]] = $root.google.protobuf.Value.fromObject(object.resourceProperties[keys[i]]); - } - } - if (object.securityMarks != null) { - if (typeof object.securityMarks !== "object") - throw TypeError(".google.cloud.securitycenter.v1beta1.Asset.securityMarks: object expected"); - message.securityMarks = $root.google.cloud.securitycenter.v1beta1.SecurityMarks.fromObject(object.securityMarks); - } - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.securitycenter.v1beta1.Asset.createTime: object expected"); - message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + var message = new $root.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse(); + switch (object.state) { + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "COMPLETED": + case 1: + message.state = 1; + break; + case "SUPERSEDED": + case 2: + message.state = 2; + break; + case "TERMINATED": + case 3: + message.state = 3; + break; } - if (object.updateTime != null) { - if (typeof object.updateTime !== "object") - throw TypeError(".google.cloud.securitycenter.v1beta1.Asset.updateTime: object expected"); - message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + if (object.duration != null) { + if (typeof object.duration !== "object") + throw TypeError(".google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse.duration: object expected"); + message.duration = $root.google.protobuf.Duration.fromObject(object.duration); } return message; }; /** - * Creates a plain object from an Asset message. Also converts values to other types if specified. + * Creates a plain object from a RunAssetDiscoveryResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.securitycenter.v1beta1.Asset + * @memberof google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse * @static - * @param {google.cloud.securitycenter.v1beta1.Asset} message Asset + * @param {google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse} message RunAssetDiscoveryResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Asset.toObject = function toObject(message, options) { + RunAssetDiscoveryResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.objects || options.defaults) - object.resourceProperties = {}; if (options.defaults) { - object.name = ""; - object.securityCenterProperties = null; - object.securityMarks = null; - object.createTime = null; - object.updateTime = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.securityCenterProperties != null && message.hasOwnProperty("securityCenterProperties")) - object.securityCenterProperties = $root.google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties.toObject(message.securityCenterProperties, options); - var keys2; - if (message.resourceProperties && (keys2 = Object.keys(message.resourceProperties)).length) { - object.resourceProperties = {}; - for (var j = 0; j < keys2.length; ++j) - object.resourceProperties[keys2[j]] = $root.google.protobuf.Value.toObject(message.resourceProperties[keys2[j]], options); + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.duration = null; } - if (message.securityMarks != null && message.hasOwnProperty("securityMarks")) - object.securityMarks = $root.google.cloud.securitycenter.v1beta1.SecurityMarks.toObject(message.securityMarks, options); - if (message.createTime != null && message.hasOwnProperty("createTime")) - object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); - if (message.updateTime != null && message.hasOwnProperty("updateTime")) - object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse.State[message.state] : message.state; + if (message.duration != null && message.hasOwnProperty("duration")) + object.duration = $root.google.protobuf.Duration.toObject(message.duration, options); return object; }; /** - * Converts this Asset to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1beta1.Asset + * Converts this RunAssetDiscoveryResponse to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse + * @instance + * @returns {Object.} JSON object + */ + RunAssetDiscoveryResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * State enum. + * @name google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse.State + * @enum {string} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} COMPLETED=1 COMPLETED value + * @property {number} SUPERSEDED=2 SUPERSEDED value + * @property {number} TERMINATED=3 TERMINATED value + */ + RunAssetDiscoveryResponse.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "COMPLETED"] = 1; + values[valuesById[2] = "SUPERSEDED"] = 2; + values[valuesById[3] = "TERMINATED"] = 3; + return values; + })(); + + return RunAssetDiscoveryResponse; + })(); + + v1p1beta1.SecurityCenter = (function() { + + /** + * Constructs a new SecurityCenter service. + * @memberof google.cloud.securitycenter.v1p1beta1 + * @classdesc Represents a SecurityCenter + * @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 SecurityCenter(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (SecurityCenter.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = SecurityCenter; + + /** + * Creates new SecurityCenter service using the specified rpc implementation. + * @function create + * @memberof google.cloud.securitycenter.v1p1beta1.SecurityCenter + * @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 {SecurityCenter} RPC service. Useful where requests and/or responses are streamed. + */ + SecurityCenter.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.securitycenter.v1p1beta1.SecurityCenter#createSource}. + * @memberof google.cloud.securitycenter.v1p1beta1.SecurityCenter + * @typedef CreateSourceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1p1beta1.Source} [response] Source + */ + + /** + * Calls CreateSource. + * @function createSource + * @memberof google.cloud.securitycenter.v1p1beta1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1p1beta1.ICreateSourceRequest} request CreateSourceRequest message or plain object + * @param {google.cloud.securitycenter.v1p1beta1.SecurityCenter.CreateSourceCallback} callback Node-style callback called with the error, if any, and Source + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.createSource = function createSource(request, callback) { + return this.rpcCall(createSource, $root.google.cloud.securitycenter.v1p1beta1.CreateSourceRequest, $root.google.cloud.securitycenter.v1p1beta1.Source, request, callback); + }, "name", { value: "CreateSource" }); + + /** + * Calls CreateSource. + * @function createSource + * @memberof google.cloud.securitycenter.v1p1beta1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1p1beta1.ICreateSourceRequest} request CreateSourceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1p1beta1.SecurityCenter#createFinding}. + * @memberof google.cloud.securitycenter.v1p1beta1.SecurityCenter + * @typedef CreateFindingCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1p1beta1.Finding} [response] Finding + */ + + /** + * Calls CreateFinding. + * @function createFinding + * @memberof google.cloud.securitycenter.v1p1beta1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1p1beta1.ICreateFindingRequest} request CreateFindingRequest message or plain object + * @param {google.cloud.securitycenter.v1p1beta1.SecurityCenter.CreateFindingCallback} callback Node-style callback called with the error, if any, and Finding + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.createFinding = function createFinding(request, callback) { + return this.rpcCall(createFinding, $root.google.cloud.securitycenter.v1p1beta1.CreateFindingRequest, $root.google.cloud.securitycenter.v1p1beta1.Finding, request, callback); + }, "name", { value: "CreateFinding" }); + + /** + * Calls CreateFinding. + * @function createFinding + * @memberof google.cloud.securitycenter.v1p1beta1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1p1beta1.ICreateFindingRequest} request CreateFindingRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1p1beta1.SecurityCenter#createNotificationConfig}. + * @memberof google.cloud.securitycenter.v1p1beta1.SecurityCenter + * @typedef CreateNotificationConfigCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1p1beta1.NotificationConfig} [response] NotificationConfig + */ + + /** + * Calls CreateNotificationConfig. + * @function createNotificationConfig + * @memberof google.cloud.securitycenter.v1p1beta1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1p1beta1.ICreateNotificationConfigRequest} request CreateNotificationConfigRequest message or plain object + * @param {google.cloud.securitycenter.v1p1beta1.SecurityCenter.CreateNotificationConfigCallback} callback Node-style callback called with the error, if any, and NotificationConfig + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.createNotificationConfig = function createNotificationConfig(request, callback) { + return this.rpcCall(createNotificationConfig, $root.google.cloud.securitycenter.v1p1beta1.CreateNotificationConfigRequest, $root.google.cloud.securitycenter.v1p1beta1.NotificationConfig, request, callback); + }, "name", { value: "CreateNotificationConfig" }); + + /** + * Calls CreateNotificationConfig. + * @function createNotificationConfig + * @memberof google.cloud.securitycenter.v1p1beta1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1p1beta1.ICreateNotificationConfigRequest} request CreateNotificationConfigRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1p1beta1.SecurityCenter#deleteNotificationConfig}. + * @memberof google.cloud.securitycenter.v1p1beta1.SecurityCenter + * @typedef DeleteNotificationConfigCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteNotificationConfig. + * @function deleteNotificationConfig + * @memberof google.cloud.securitycenter.v1p1beta1.SecurityCenter * @instance - * @returns {Object.} JSON object + * @param {google.cloud.securitycenter.v1p1beta1.IDeleteNotificationConfigRequest} request DeleteNotificationConfigRequest message or plain object + * @param {google.cloud.securitycenter.v1p1beta1.SecurityCenter.DeleteNotificationConfigCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 */ - Asset.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + Object.defineProperty(SecurityCenter.prototype.deleteNotificationConfig = function deleteNotificationConfig(request, callback) { + return this.rpcCall(deleteNotificationConfig, $root.google.cloud.securitycenter.v1p1beta1.DeleteNotificationConfigRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteNotificationConfig" }); - Asset.SecurityCenterProperties = (function() { + /** + * Calls DeleteNotificationConfig. + * @function deleteNotificationConfig + * @memberof google.cloud.securitycenter.v1p1beta1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1p1beta1.IDeleteNotificationConfigRequest} request DeleteNotificationConfigRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ - /** - * Properties of a SecurityCenterProperties. - * @memberof google.cloud.securitycenter.v1beta1.Asset - * @interface ISecurityCenterProperties - * @property {string|null} [resourceName] SecurityCenterProperties resourceName - * @property {string|null} [resourceType] SecurityCenterProperties resourceType - * @property {string|null} [resourceParent] SecurityCenterProperties resourceParent - * @property {string|null} [resourceProject] SecurityCenterProperties resourceProject - * @property {Array.|null} [resourceOwners] SecurityCenterProperties resourceOwners - */ + /** + * Callback as used by {@link google.cloud.securitycenter.v1p1beta1.SecurityCenter#getIamPolicy}. + * @memberof google.cloud.securitycenter.v1p1beta1.SecurityCenter + * @typedef GetIamPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.iam.v1.Policy} [response] Policy + */ - /** - * Constructs a new SecurityCenterProperties. - * @memberof google.cloud.securitycenter.v1beta1.Asset - * @classdesc Represents a SecurityCenterProperties. - * @implements ISecurityCenterProperties - * @constructor - * @param {google.cloud.securitycenter.v1beta1.Asset.ISecurityCenterProperties=} [properties] Properties to set - */ - function SecurityCenterProperties(properties) { - this.resourceOwners = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Calls GetIamPolicy. + * @function getIamPolicy + * @memberof google.cloud.securitycenter.v1p1beta1.SecurityCenter + * @instance + * @param {google.iam.v1.IGetIamPolicyRequest} request GetIamPolicyRequest message or plain object + * @param {google.cloud.securitycenter.v1p1beta1.SecurityCenter.GetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.getIamPolicy = function getIamPolicy(request, callback) { + return this.rpcCall(getIamPolicy, $root.google.iam.v1.GetIamPolicyRequest, $root.google.iam.v1.Policy, request, callback); + }, "name", { value: "GetIamPolicy" }); - /** - * SecurityCenterProperties resourceName. - * @member {string} resourceName - * @memberof google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties - * @instance - */ - SecurityCenterProperties.prototype.resourceName = ""; + /** + * Calls GetIamPolicy. + * @function getIamPolicy + * @memberof google.cloud.securitycenter.v1p1beta1.SecurityCenter + * @instance + * @param {google.iam.v1.IGetIamPolicyRequest} request GetIamPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ - /** - * SecurityCenterProperties resourceType. - * @member {string} resourceType - * @memberof google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties - * @instance - */ - SecurityCenterProperties.prototype.resourceType = ""; + /** + * Callback as used by {@link google.cloud.securitycenter.v1p1beta1.SecurityCenter#getNotificationConfig}. + * @memberof google.cloud.securitycenter.v1p1beta1.SecurityCenter + * @typedef GetNotificationConfigCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1p1beta1.NotificationConfig} [response] NotificationConfig + */ - /** - * SecurityCenterProperties resourceParent. - * @member {string} resourceParent - * @memberof google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties - * @instance - */ - SecurityCenterProperties.prototype.resourceParent = ""; + /** + * Calls GetNotificationConfig. + * @function getNotificationConfig + * @memberof google.cloud.securitycenter.v1p1beta1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1p1beta1.IGetNotificationConfigRequest} request GetNotificationConfigRequest message or plain object + * @param {google.cloud.securitycenter.v1p1beta1.SecurityCenter.GetNotificationConfigCallback} callback Node-style callback called with the error, if any, and NotificationConfig + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.getNotificationConfig = function getNotificationConfig(request, callback) { + return this.rpcCall(getNotificationConfig, $root.google.cloud.securitycenter.v1p1beta1.GetNotificationConfigRequest, $root.google.cloud.securitycenter.v1p1beta1.NotificationConfig, request, callback); + }, "name", { value: "GetNotificationConfig" }); - /** - * SecurityCenterProperties resourceProject. - * @member {string} resourceProject - * @memberof google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties - * @instance - */ - SecurityCenterProperties.prototype.resourceProject = ""; + /** + * Calls GetNotificationConfig. + * @function getNotificationConfig + * @memberof google.cloud.securitycenter.v1p1beta1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1p1beta1.IGetNotificationConfigRequest} request GetNotificationConfigRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ - /** - * SecurityCenterProperties resourceOwners. - * @member {Array.} resourceOwners - * @memberof google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties - * @instance - */ - SecurityCenterProperties.prototype.resourceOwners = $util.emptyArray; + /** + * Callback as used by {@link google.cloud.securitycenter.v1p1beta1.SecurityCenter#getOrganizationSettings}. + * @memberof google.cloud.securitycenter.v1p1beta1.SecurityCenter + * @typedef GetOrganizationSettingsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1p1beta1.OrganizationSettings} [response] OrganizationSettings + */ - /** - * Creates a new SecurityCenterProperties instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties - * @static - * @param {google.cloud.securitycenter.v1beta1.Asset.ISecurityCenterProperties=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties} SecurityCenterProperties instance - */ - SecurityCenterProperties.create = function create(properties) { - return new SecurityCenterProperties(properties); - }; + /** + * Calls GetOrganizationSettings. + * @function getOrganizationSettings + * @memberof google.cloud.securitycenter.v1p1beta1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1p1beta1.IGetOrganizationSettingsRequest} request GetOrganizationSettingsRequest message or plain object + * @param {google.cloud.securitycenter.v1p1beta1.SecurityCenter.GetOrganizationSettingsCallback} callback Node-style callback called with the error, if any, and OrganizationSettings + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.getOrganizationSettings = function getOrganizationSettings(request, callback) { + return this.rpcCall(getOrganizationSettings, $root.google.cloud.securitycenter.v1p1beta1.GetOrganizationSettingsRequest, $root.google.cloud.securitycenter.v1p1beta1.OrganizationSettings, request, callback); + }, "name", { value: "GetOrganizationSettings" }); - /** - * Encodes the specified SecurityCenterProperties message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties - * @static - * @param {google.cloud.securitycenter.v1beta1.Asset.ISecurityCenterProperties} message SecurityCenterProperties message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SecurityCenterProperties.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.resourceName != null && message.hasOwnProperty("resourceName")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.resourceName); - if (message.resourceType != null && message.hasOwnProperty("resourceType")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.resourceType); - if (message.resourceParent != null && message.hasOwnProperty("resourceParent")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.resourceParent); - if (message.resourceProject != null && message.hasOwnProperty("resourceProject")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.resourceProject); - if (message.resourceOwners != null && message.resourceOwners.length) - for (var i = 0; i < message.resourceOwners.length; ++i) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.resourceOwners[i]); - return writer; - }; + /** + * Calls GetOrganizationSettings. + * @function getOrganizationSettings + * @memberof google.cloud.securitycenter.v1p1beta1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1p1beta1.IGetOrganizationSettingsRequest} request GetOrganizationSettingsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ - /** - * Encodes the specified SecurityCenterProperties message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties - * @static - * @param {google.cloud.securitycenter.v1beta1.Asset.ISecurityCenterProperties} message SecurityCenterProperties message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SecurityCenterProperties.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Callback as used by {@link google.cloud.securitycenter.v1p1beta1.SecurityCenter#getSource}. + * @memberof google.cloud.securitycenter.v1p1beta1.SecurityCenter + * @typedef GetSourceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1p1beta1.Source} [response] Source + */ - /** - * Decodes a SecurityCenterProperties message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties} SecurityCenterProperties - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SecurityCenterProperties.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.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.resourceName = reader.string(); - break; - case 2: - message.resourceType = reader.string(); - break; - case 3: - message.resourceParent = reader.string(); - break; - case 4: - message.resourceProject = reader.string(); - break; - case 5: - if (!(message.resourceOwners && message.resourceOwners.length)) - message.resourceOwners = []; - message.resourceOwners.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Calls GetSource. + * @function getSource + * @memberof google.cloud.securitycenter.v1p1beta1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1p1beta1.IGetSourceRequest} request GetSourceRequest message or plain object + * @param {google.cloud.securitycenter.v1p1beta1.SecurityCenter.GetSourceCallback} callback Node-style callback called with the error, if any, and Source + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.getSource = function getSource(request, callback) { + return this.rpcCall(getSource, $root.google.cloud.securitycenter.v1p1beta1.GetSourceRequest, $root.google.cloud.securitycenter.v1p1beta1.Source, request, callback); + }, "name", { value: "GetSource" }); + + /** + * Calls GetSource. + * @function getSource + * @memberof google.cloud.securitycenter.v1p1beta1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1p1beta1.IGetSourceRequest} request GetSourceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1p1beta1.SecurityCenter#groupAssets}. + * @memberof google.cloud.securitycenter.v1p1beta1.SecurityCenter + * @typedef GroupAssetsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1p1beta1.GroupAssetsResponse} [response] GroupAssetsResponse + */ + + /** + * Calls GroupAssets. + * @function groupAssets + * @memberof google.cloud.securitycenter.v1p1beta1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1p1beta1.IGroupAssetsRequest} request GroupAssetsRequest message or plain object + * @param {google.cloud.securitycenter.v1p1beta1.SecurityCenter.GroupAssetsCallback} callback Node-style callback called with the error, if any, and GroupAssetsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.groupAssets = function groupAssets(request, callback) { + return this.rpcCall(groupAssets, $root.google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest, $root.google.cloud.securitycenter.v1p1beta1.GroupAssetsResponse, request, callback); + }, "name", { value: "GroupAssets" }); - /** - * Decodes a SecurityCenterProperties message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties} SecurityCenterProperties - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SecurityCenterProperties.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Calls GroupAssets. + * @function groupAssets + * @memberof google.cloud.securitycenter.v1p1beta1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1p1beta1.IGroupAssetsRequest} request GroupAssetsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ - /** - * Verifies a SecurityCenterProperties message. - * @function verify - * @memberof google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SecurityCenterProperties.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.resourceName != null && message.hasOwnProperty("resourceName")) - if (!$util.isString(message.resourceName)) - return "resourceName: string expected"; - if (message.resourceType != null && message.hasOwnProperty("resourceType")) - if (!$util.isString(message.resourceType)) - return "resourceType: string expected"; - if (message.resourceParent != null && message.hasOwnProperty("resourceParent")) - if (!$util.isString(message.resourceParent)) - return "resourceParent: string expected"; - if (message.resourceProject != null && message.hasOwnProperty("resourceProject")) - if (!$util.isString(message.resourceProject)) - return "resourceProject: string expected"; - if (message.resourceOwners != null && message.hasOwnProperty("resourceOwners")) { - if (!Array.isArray(message.resourceOwners)) - return "resourceOwners: array expected"; - for (var i = 0; i < message.resourceOwners.length; ++i) - if (!$util.isString(message.resourceOwners[i])) - return "resourceOwners: string[] expected"; - } - return null; - }; + /** + * Callback as used by {@link google.cloud.securitycenter.v1p1beta1.SecurityCenter#groupFindings}. + * @memberof google.cloud.securitycenter.v1p1beta1.SecurityCenter + * @typedef GroupFindingsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1p1beta1.GroupFindingsResponse} [response] GroupFindingsResponse + */ - /** - * Creates a SecurityCenterProperties message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties} SecurityCenterProperties - */ - SecurityCenterProperties.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties) - return object; - var message = new $root.google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties(); - if (object.resourceName != null) - message.resourceName = String(object.resourceName); - if (object.resourceType != null) - message.resourceType = String(object.resourceType); - if (object.resourceParent != null) - message.resourceParent = String(object.resourceParent); - if (object.resourceProject != null) - message.resourceProject = String(object.resourceProject); - if (object.resourceOwners) { - if (!Array.isArray(object.resourceOwners)) - throw TypeError(".google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties.resourceOwners: array expected"); - message.resourceOwners = []; - for (var i = 0; i < object.resourceOwners.length; ++i) - message.resourceOwners[i] = String(object.resourceOwners[i]); - } - return message; - }; + /** + * Calls GroupFindings. + * @function groupFindings + * @memberof google.cloud.securitycenter.v1p1beta1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1p1beta1.IGroupFindingsRequest} request GroupFindingsRequest message or plain object + * @param {google.cloud.securitycenter.v1p1beta1.SecurityCenter.GroupFindingsCallback} callback Node-style callback called with the error, if any, and GroupFindingsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.groupFindings = function groupFindings(request, callback) { + return this.rpcCall(groupFindings, $root.google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest, $root.google.cloud.securitycenter.v1p1beta1.GroupFindingsResponse, request, callback); + }, "name", { value: "GroupFindings" }); - /** - * Creates a plain object from a SecurityCenterProperties message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties - * @static - * @param {google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties} message SecurityCenterProperties - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SecurityCenterProperties.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.resourceOwners = []; - if (options.defaults) { - object.resourceName = ""; - object.resourceType = ""; - object.resourceParent = ""; - object.resourceProject = ""; - } - if (message.resourceName != null && message.hasOwnProperty("resourceName")) - object.resourceName = message.resourceName; - if (message.resourceType != null && message.hasOwnProperty("resourceType")) - object.resourceType = message.resourceType; - if (message.resourceParent != null && message.hasOwnProperty("resourceParent")) - object.resourceParent = message.resourceParent; - if (message.resourceProject != null && message.hasOwnProperty("resourceProject")) - object.resourceProject = message.resourceProject; - if (message.resourceOwners && message.resourceOwners.length) { - object.resourceOwners = []; - for (var j = 0; j < message.resourceOwners.length; ++j) - object.resourceOwners[j] = message.resourceOwners[j]; - } - return object; - }; + /** + * Calls GroupFindings. + * @function groupFindings + * @memberof google.cloud.securitycenter.v1p1beta1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1p1beta1.IGroupFindingsRequest} request GroupFindingsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ - /** - * Converts this SecurityCenterProperties to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties - * @instance - * @returns {Object.} JSON object - */ - SecurityCenterProperties.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Callback as used by {@link google.cloud.securitycenter.v1p1beta1.SecurityCenter#listAssets}. + * @memberof google.cloud.securitycenter.v1p1beta1.SecurityCenter + * @typedef ListAssetsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1p1beta1.ListAssetsResponse} [response] ListAssetsResponse + */ - return SecurityCenterProperties; - })(); + /** + * Calls ListAssets. + * @function listAssets + * @memberof google.cloud.securitycenter.v1p1beta1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1p1beta1.IListAssetsRequest} request ListAssetsRequest message or plain object + * @param {google.cloud.securitycenter.v1p1beta1.SecurityCenter.ListAssetsCallback} callback Node-style callback called with the error, if any, and ListAssetsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.listAssets = function listAssets(request, callback) { + return this.rpcCall(listAssets, $root.google.cloud.securitycenter.v1p1beta1.ListAssetsRequest, $root.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse, request, callback); + }, "name", { value: "ListAssets" }); - return Asset; - })(); + /** + * Calls ListAssets. + * @function listAssets + * @memberof google.cloud.securitycenter.v1p1beta1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1p1beta1.IListAssetsRequest} request ListAssetsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ - v1beta1.Source = (function() { + /** + * Callback as used by {@link google.cloud.securitycenter.v1p1beta1.SecurityCenter#listFindings}. + * @memberof google.cloud.securitycenter.v1p1beta1.SecurityCenter + * @typedef ListFindingsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1p1beta1.ListFindingsResponse} [response] ListFindingsResponse + */ /** - * Properties of a Source. - * @memberof google.cloud.securitycenter.v1beta1 - * @interface ISource - * @property {string|null} [name] Source name - * @property {string|null} [displayName] Source displayName - * @property {string|null} [description] Source description + * Calls ListFindings. + * @function listFindings + * @memberof google.cloud.securitycenter.v1p1beta1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1p1beta1.IListFindingsRequest} request ListFindingsRequest message or plain object + * @param {google.cloud.securitycenter.v1p1beta1.SecurityCenter.ListFindingsCallback} callback Node-style callback called with the error, if any, and ListFindingsResponse + * @returns {undefined} + * @variation 1 */ + Object.defineProperty(SecurityCenter.prototype.listFindings = function listFindings(request, callback) { + return this.rpcCall(listFindings, $root.google.cloud.securitycenter.v1p1beta1.ListFindingsRequest, $root.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse, request, callback); + }, "name", { value: "ListFindings" }); /** - * Constructs a new Source. - * @memberof google.cloud.securitycenter.v1beta1 - * @classdesc Represents a Source. - * @implements ISource - * @constructor - * @param {google.cloud.securitycenter.v1beta1.ISource=} [properties] Properties to set + * Calls ListFindings. + * @function listFindings + * @memberof google.cloud.securitycenter.v1p1beta1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1p1beta1.IListFindingsRequest} request ListFindingsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - function Source(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]]; - } /** - * Source name. - * @member {string} name - * @memberof google.cloud.securitycenter.v1beta1.Source + * Callback as used by {@link google.cloud.securitycenter.v1p1beta1.SecurityCenter#listNotificationConfigs}. + * @memberof google.cloud.securitycenter.v1p1beta1.SecurityCenter + * @typedef ListNotificationConfigsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsResponse} [response] ListNotificationConfigsResponse + */ + + /** + * Calls ListNotificationConfigs. + * @function listNotificationConfigs + * @memberof google.cloud.securitycenter.v1p1beta1.SecurityCenter * @instance + * @param {google.cloud.securitycenter.v1p1beta1.IListNotificationConfigsRequest} request ListNotificationConfigsRequest message or plain object + * @param {google.cloud.securitycenter.v1p1beta1.SecurityCenter.ListNotificationConfigsCallback} callback Node-style callback called with the error, if any, and ListNotificationConfigsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.listNotificationConfigs = function listNotificationConfigs(request, callback) { + return this.rpcCall(listNotificationConfigs, $root.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest, $root.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsResponse, request, callback); + }, "name", { value: "ListNotificationConfigs" }); + + /** + * Calls ListNotificationConfigs. + * @function listNotificationConfigs + * @memberof google.cloud.securitycenter.v1p1beta1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1p1beta1.IListNotificationConfigsRequest} request ListNotificationConfigsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1p1beta1.SecurityCenter#listSources}. + * @memberof google.cloud.securitycenter.v1p1beta1.SecurityCenter + * @typedef ListSourcesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1p1beta1.ListSourcesResponse} [response] ListSourcesResponse + */ + + /** + * Calls ListSources. + * @function listSources + * @memberof google.cloud.securitycenter.v1p1beta1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1p1beta1.IListSourcesRequest} request ListSourcesRequest message or plain object + * @param {google.cloud.securitycenter.v1p1beta1.SecurityCenter.ListSourcesCallback} callback Node-style callback called with the error, if any, and ListSourcesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.listSources = function listSources(request, callback) { + return this.rpcCall(listSources, $root.google.cloud.securitycenter.v1p1beta1.ListSourcesRequest, $root.google.cloud.securitycenter.v1p1beta1.ListSourcesResponse, request, callback); + }, "name", { value: "ListSources" }); + + /** + * Calls ListSources. + * @function listSources + * @memberof google.cloud.securitycenter.v1p1beta1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1p1beta1.IListSourcesRequest} request ListSourcesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1p1beta1.SecurityCenter#runAssetDiscovery}. + * @memberof google.cloud.securitycenter.v1p1beta1.SecurityCenter + * @typedef RunAssetDiscoveryCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation */ - Source.prototype.name = ""; /** - * Source displayName. - * @member {string} displayName - * @memberof google.cloud.securitycenter.v1beta1.Source + * Calls RunAssetDiscovery. + * @function runAssetDiscovery + * @memberof google.cloud.securitycenter.v1p1beta1.SecurityCenter * @instance + * @param {google.cloud.securitycenter.v1p1beta1.IRunAssetDiscoveryRequest} request RunAssetDiscoveryRequest message or plain object + * @param {google.cloud.securitycenter.v1p1beta1.SecurityCenter.RunAssetDiscoveryCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 */ - Source.prototype.displayName = ""; + Object.defineProperty(SecurityCenter.prototype.runAssetDiscovery = function runAssetDiscovery(request, callback) { + return this.rpcCall(runAssetDiscovery, $root.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "RunAssetDiscovery" }); /** - * Source description. - * @member {string} description - * @memberof google.cloud.securitycenter.v1beta1.Source + * Calls RunAssetDiscovery. + * @function runAssetDiscovery + * @memberof google.cloud.securitycenter.v1p1beta1.SecurityCenter * @instance + * @param {google.cloud.securitycenter.v1p1beta1.IRunAssetDiscoveryRequest} request RunAssetDiscoveryRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - Source.prototype.description = ""; /** - * Creates a new Source instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v1beta1.Source - * @static - * @param {google.cloud.securitycenter.v1beta1.ISource=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1beta1.Source} Source instance + * Callback as used by {@link google.cloud.securitycenter.v1p1beta1.SecurityCenter#setFindingState}. + * @memberof google.cloud.securitycenter.v1p1beta1.SecurityCenter + * @typedef SetFindingStateCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1p1beta1.Finding} [response] Finding */ - Source.create = function create(properties) { - return new Source(properties); - }; /** - * Encodes the specified Source message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.Source.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1beta1.Source - * @static - * @param {google.cloud.securitycenter.v1beta1.ISource} message Source message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * Calls SetFindingState. + * @function setFindingState + * @memberof google.cloud.securitycenter.v1p1beta1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1p1beta1.ISetFindingStateRequest} request SetFindingStateRequest message or plain object + * @param {google.cloud.securitycenter.v1p1beta1.SecurityCenter.SetFindingStateCallback} callback Node-style callback called with the error, if any, and Finding + * @returns {undefined} + * @variation 1 */ - Source.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.displayName != null && message.hasOwnProperty("displayName")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); - if (message.description != null && message.hasOwnProperty("description")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); - return writer; - }; + Object.defineProperty(SecurityCenter.prototype.setFindingState = function setFindingState(request, callback) { + return this.rpcCall(setFindingState, $root.google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest, $root.google.cloud.securitycenter.v1p1beta1.Finding, request, callback); + }, "name", { value: "SetFindingState" }); /** - * Encodes the specified Source message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.Source.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1beta1.Source - * @static - * @param {google.cloud.securitycenter.v1beta1.ISource} message Source message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * Calls SetFindingState. + * @function setFindingState + * @memberof google.cloud.securitycenter.v1p1beta1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1p1beta1.ISetFindingStateRequest} request SetFindingStateRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - Source.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; /** - * Decodes a Source message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v1beta1.Source - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1beta1.Source} Source - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Callback as used by {@link google.cloud.securitycenter.v1p1beta1.SecurityCenter#setIamPolicy}. + * @memberof google.cloud.securitycenter.v1p1beta1.SecurityCenter + * @typedef SetIamPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.iam.v1.Policy} [response] Policy */ - Source.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.cloud.securitycenter.v1beta1.Source(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.displayName = reader.string(); - break; - case 3: - message.description = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; /** - * Decodes a Source message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1beta1.Source - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1beta1.Source} Source - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Calls SetIamPolicy. + * @function setIamPolicy + * @memberof google.cloud.securitycenter.v1p1beta1.SecurityCenter + * @instance + * @param {google.iam.v1.ISetIamPolicyRequest} request SetIamPolicyRequest message or plain object + * @param {google.cloud.securitycenter.v1p1beta1.SecurityCenter.SetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy + * @returns {undefined} + * @variation 1 */ - Source.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + Object.defineProperty(SecurityCenter.prototype.setIamPolicy = function setIamPolicy(request, callback) { + return this.rpcCall(setIamPolicy, $root.google.iam.v1.SetIamPolicyRequest, $root.google.iam.v1.Policy, request, callback); + }, "name", { value: "SetIamPolicy" }); /** - * Verifies a Source message. - * @function verify - * @memberof google.cloud.securitycenter.v1beta1.Source - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not + * Calls SetIamPolicy. + * @function setIamPolicy + * @memberof google.cloud.securitycenter.v1p1beta1.SecurityCenter + * @instance + * @param {google.iam.v1.ISetIamPolicyRequest} request SetIamPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - Source.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.displayName != null && message.hasOwnProperty("displayName")) - if (!$util.isString(message.displayName)) - return "displayName: string expected"; - if (message.description != null && message.hasOwnProperty("description")) - if (!$util.isString(message.description)) - return "description: string expected"; - return null; - }; /** - * Creates a Source message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v1beta1.Source - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1beta1.Source} Source + * Callback as used by {@link google.cloud.securitycenter.v1p1beta1.SecurityCenter#testIamPermissions}. + * @memberof google.cloud.securitycenter.v1p1beta1.SecurityCenter + * @typedef TestIamPermissionsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.iam.v1.TestIamPermissionsResponse} [response] TestIamPermissionsResponse */ - Source.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1beta1.Source) - return object; - var message = new $root.google.cloud.securitycenter.v1beta1.Source(); - if (object.name != null) - message.name = String(object.name); - if (object.displayName != null) - message.displayName = String(object.displayName); - if (object.description != null) - message.description = String(object.description); - return message; - }; /** - * Creates a plain object from a Source message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v1beta1.Source - * @static - * @param {google.cloud.securitycenter.v1beta1.Source} message Source - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object + * Calls TestIamPermissions. + * @function testIamPermissions + * @memberof google.cloud.securitycenter.v1p1beta1.SecurityCenter + * @instance + * @param {google.iam.v1.ITestIamPermissionsRequest} request TestIamPermissionsRequest message or plain object + * @param {google.cloud.securitycenter.v1p1beta1.SecurityCenter.TestIamPermissionsCallback} callback Node-style callback called with the error, if any, and TestIamPermissionsResponse + * @returns {undefined} + * @variation 1 */ - Source.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.displayName = ""; - object.description = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.displayName != null && message.hasOwnProperty("displayName")) - object.displayName = message.displayName; - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; - return object; - }; + Object.defineProperty(SecurityCenter.prototype.testIamPermissions = function testIamPermissions(request, callback) { + return this.rpcCall(testIamPermissions, $root.google.iam.v1.TestIamPermissionsRequest, $root.google.iam.v1.TestIamPermissionsResponse, request, callback); + }, "name", { value: "TestIamPermissions" }); /** - * Converts this Source to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1beta1.Source + * Calls TestIamPermissions. + * @function testIamPermissions + * @memberof google.cloud.securitycenter.v1p1beta1.SecurityCenter * @instance - * @returns {Object.} JSON object + * @param {google.iam.v1.ITestIamPermissionsRequest} request TestIamPermissionsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - Source.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Source; - })(); - - v1beta1.RunAssetDiscoveryResponse = (function() { /** - * Properties of a RunAssetDiscoveryResponse. - * @memberof google.cloud.securitycenter.v1beta1 - * @interface IRunAssetDiscoveryResponse - * @property {google.cloud.securitycenter.v1beta1.RunAssetDiscoveryResponse.State|null} [state] RunAssetDiscoveryResponse state - * @property {google.protobuf.IDuration|null} [duration] RunAssetDiscoveryResponse duration + * Callback as used by {@link google.cloud.securitycenter.v1p1beta1.SecurityCenter#updateFinding}. + * @memberof google.cloud.securitycenter.v1p1beta1.SecurityCenter + * @typedef UpdateFindingCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1p1beta1.Finding} [response] Finding */ /** - * Constructs a new RunAssetDiscoveryResponse. - * @memberof google.cloud.securitycenter.v1beta1 - * @classdesc Represents a RunAssetDiscoveryResponse. - * @implements IRunAssetDiscoveryResponse - * @constructor - * @param {google.cloud.securitycenter.v1beta1.IRunAssetDiscoveryResponse=} [properties] Properties to set + * Calls UpdateFinding. + * @function updateFinding + * @memberof google.cloud.securitycenter.v1p1beta1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1p1beta1.IUpdateFindingRequest} request UpdateFindingRequest message or plain object + * @param {google.cloud.securitycenter.v1p1beta1.SecurityCenter.UpdateFindingCallback} callback Node-style callback called with the error, if any, and Finding + * @returns {undefined} + * @variation 1 */ - function RunAssetDiscoveryResponse(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]]; - } + Object.defineProperty(SecurityCenter.prototype.updateFinding = function updateFinding(request, callback) { + return this.rpcCall(updateFinding, $root.google.cloud.securitycenter.v1p1beta1.UpdateFindingRequest, $root.google.cloud.securitycenter.v1p1beta1.Finding, request, callback); + }, "name", { value: "UpdateFinding" }); /** - * RunAssetDiscoveryResponse state. - * @member {google.cloud.securitycenter.v1beta1.RunAssetDiscoveryResponse.State} state - * @memberof google.cloud.securitycenter.v1beta1.RunAssetDiscoveryResponse + * Calls UpdateFinding. + * @function updateFinding + * @memberof google.cloud.securitycenter.v1p1beta1.SecurityCenter * @instance + * @param {google.cloud.securitycenter.v1p1beta1.IUpdateFindingRequest} request UpdateFindingRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - RunAssetDiscoveryResponse.prototype.state = 0; /** - * RunAssetDiscoveryResponse duration. - * @member {google.protobuf.IDuration|null|undefined} duration - * @memberof google.cloud.securitycenter.v1beta1.RunAssetDiscoveryResponse + * Callback as used by {@link google.cloud.securitycenter.v1p1beta1.SecurityCenter#updateNotificationConfig}. + * @memberof google.cloud.securitycenter.v1p1beta1.SecurityCenter + * @typedef UpdateNotificationConfigCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1p1beta1.NotificationConfig} [response] NotificationConfig + */ + + /** + * Calls UpdateNotificationConfig. + * @function updateNotificationConfig + * @memberof google.cloud.securitycenter.v1p1beta1.SecurityCenter * @instance + * @param {google.cloud.securitycenter.v1p1beta1.IUpdateNotificationConfigRequest} request UpdateNotificationConfigRequest message or plain object + * @param {google.cloud.securitycenter.v1p1beta1.SecurityCenter.UpdateNotificationConfigCallback} callback Node-style callback called with the error, if any, and NotificationConfig + * @returns {undefined} + * @variation 1 */ - RunAssetDiscoveryResponse.prototype.duration = null; + Object.defineProperty(SecurityCenter.prototype.updateNotificationConfig = function updateNotificationConfig(request, callback) { + return this.rpcCall(updateNotificationConfig, $root.google.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest, $root.google.cloud.securitycenter.v1p1beta1.NotificationConfig, request, callback); + }, "name", { value: "UpdateNotificationConfig" }); /** - * Creates a new RunAssetDiscoveryResponse instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v1beta1.RunAssetDiscoveryResponse - * @static - * @param {google.cloud.securitycenter.v1beta1.IRunAssetDiscoveryResponse=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1beta1.RunAssetDiscoveryResponse} RunAssetDiscoveryResponse instance + * Calls UpdateNotificationConfig. + * @function updateNotificationConfig + * @memberof google.cloud.securitycenter.v1p1beta1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1p1beta1.IUpdateNotificationConfigRequest} request UpdateNotificationConfigRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - RunAssetDiscoveryResponse.create = function create(properties) { - return new RunAssetDiscoveryResponse(properties); - }; /** - * Encodes the specified RunAssetDiscoveryResponse message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.RunAssetDiscoveryResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1beta1.RunAssetDiscoveryResponse - * @static - * @param {google.cloud.securitycenter.v1beta1.IRunAssetDiscoveryResponse} message RunAssetDiscoveryResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * Callback as used by {@link google.cloud.securitycenter.v1p1beta1.SecurityCenter#updateOrganizationSettings}. + * @memberof google.cloud.securitycenter.v1p1beta1.SecurityCenter + * @typedef UpdateOrganizationSettingsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1p1beta1.OrganizationSettings} [response] OrganizationSettings */ - RunAssetDiscoveryResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.state != null && message.hasOwnProperty("state")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.state); - if (message.duration != null && message.hasOwnProperty("duration")) - $root.google.protobuf.Duration.encode(message.duration, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; /** - * Encodes the specified RunAssetDiscoveryResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.RunAssetDiscoveryResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1beta1.RunAssetDiscoveryResponse - * @static - * @param {google.cloud.securitycenter.v1beta1.IRunAssetDiscoveryResponse} message RunAssetDiscoveryResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * Calls UpdateOrganizationSettings. + * @function updateOrganizationSettings + * @memberof google.cloud.securitycenter.v1p1beta1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1p1beta1.IUpdateOrganizationSettingsRequest} request UpdateOrganizationSettingsRequest message or plain object + * @param {google.cloud.securitycenter.v1p1beta1.SecurityCenter.UpdateOrganizationSettingsCallback} callback Node-style callback called with the error, if any, and OrganizationSettings + * @returns {undefined} + * @variation 1 */ - RunAssetDiscoveryResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + Object.defineProperty(SecurityCenter.prototype.updateOrganizationSettings = function updateOrganizationSettings(request, callback) { + return this.rpcCall(updateOrganizationSettings, $root.google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest, $root.google.cloud.securitycenter.v1p1beta1.OrganizationSettings, request, callback); + }, "name", { value: "UpdateOrganizationSettings" }); /** - * Decodes a RunAssetDiscoveryResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v1beta1.RunAssetDiscoveryResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1beta1.RunAssetDiscoveryResponse} RunAssetDiscoveryResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Calls UpdateOrganizationSettings. + * @function updateOrganizationSettings + * @memberof google.cloud.securitycenter.v1p1beta1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1p1beta1.IUpdateOrganizationSettingsRequest} request UpdateOrganizationSettingsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - RunAssetDiscoveryResponse.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.cloud.securitycenter.v1beta1.RunAssetDiscoveryResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.state = reader.int32(); - break; - case 2: - message.duration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; /** - * Decodes a RunAssetDiscoveryResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1beta1.RunAssetDiscoveryResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1beta1.RunAssetDiscoveryResponse} RunAssetDiscoveryResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Callback as used by {@link google.cloud.securitycenter.v1p1beta1.SecurityCenter#updateSource}. + * @memberof google.cloud.securitycenter.v1p1beta1.SecurityCenter + * @typedef UpdateSourceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1p1beta1.Source} [response] Source */ - RunAssetDiscoveryResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; /** - * Verifies a RunAssetDiscoveryResponse message. - * @function verify - * @memberof google.cloud.securitycenter.v1beta1.RunAssetDiscoveryResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not + * Calls UpdateSource. + * @function updateSource + * @memberof google.cloud.securitycenter.v1p1beta1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1p1beta1.IUpdateSourceRequest} request UpdateSourceRequest message or plain object + * @param {google.cloud.securitycenter.v1p1beta1.SecurityCenter.UpdateSourceCallback} callback Node-style callback called with the error, if any, and Source + * @returns {undefined} + * @variation 1 */ - RunAssetDiscoveryResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.state != null && message.hasOwnProperty("state")) - switch (message.state) { - default: - return "state: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.duration != null && message.hasOwnProperty("duration")) { - var error = $root.google.protobuf.Duration.verify(message.duration); - if (error) - return "duration." + error; - } - return null; - }; + Object.defineProperty(SecurityCenter.prototype.updateSource = function updateSource(request, callback) { + return this.rpcCall(updateSource, $root.google.cloud.securitycenter.v1p1beta1.UpdateSourceRequest, $root.google.cloud.securitycenter.v1p1beta1.Source, request, callback); + }, "name", { value: "UpdateSource" }); /** - * Creates a RunAssetDiscoveryResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v1beta1.RunAssetDiscoveryResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1beta1.RunAssetDiscoveryResponse} RunAssetDiscoveryResponse + * Calls UpdateSource. + * @function updateSource + * @memberof google.cloud.securitycenter.v1p1beta1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1p1beta1.IUpdateSourceRequest} request UpdateSourceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - RunAssetDiscoveryResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1beta1.RunAssetDiscoveryResponse) - return object; - var message = new $root.google.cloud.securitycenter.v1beta1.RunAssetDiscoveryResponse(); - switch (object.state) { - case "STATE_UNSPECIFIED": - case 0: - message.state = 0; - break; - case "COMPLETED": - case 1: - message.state = 1; - break; - case "SUPERSEDED": - case 2: - message.state = 2; - break; - case "TERMINATED": - case 3: - message.state = 3; - break; - } - if (object.duration != null) { - if (typeof object.duration !== "object") - throw TypeError(".google.cloud.securitycenter.v1beta1.RunAssetDiscoveryResponse.duration: object expected"); - message.duration = $root.google.protobuf.Duration.fromObject(object.duration); - } - return message; - }; /** - * Creates a plain object from a RunAssetDiscoveryResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v1beta1.RunAssetDiscoveryResponse - * @static - * @param {google.cloud.securitycenter.v1beta1.RunAssetDiscoveryResponse} message RunAssetDiscoveryResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object + * Callback as used by {@link google.cloud.securitycenter.v1p1beta1.SecurityCenter#updateSecurityMarks}. + * @memberof google.cloud.securitycenter.v1p1beta1.SecurityCenter + * @typedef UpdateSecurityMarksCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1p1beta1.SecurityMarks} [response] SecurityMarks */ - RunAssetDiscoveryResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; - object.duration = null; - } - if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.securitycenter.v1beta1.RunAssetDiscoveryResponse.State[message.state] : message.state; - if (message.duration != null && message.hasOwnProperty("duration")) - object.duration = $root.google.protobuf.Duration.toObject(message.duration, options); - return object; - }; /** - * Converts this RunAssetDiscoveryResponse to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1beta1.RunAssetDiscoveryResponse + * Calls UpdateSecurityMarks. + * @function updateSecurityMarks + * @memberof google.cloud.securitycenter.v1p1beta1.SecurityCenter * @instance - * @returns {Object.} JSON object + * @param {google.cloud.securitycenter.v1p1beta1.IUpdateSecurityMarksRequest} request UpdateSecurityMarksRequest message or plain object + * @param {google.cloud.securitycenter.v1p1beta1.SecurityCenter.UpdateSecurityMarksCallback} callback Node-style callback called with the error, if any, and SecurityMarks + * @returns {undefined} + * @variation 1 */ - RunAssetDiscoveryResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + Object.defineProperty(SecurityCenter.prototype.updateSecurityMarks = function updateSecurityMarks(request, callback) { + return this.rpcCall(updateSecurityMarks, $root.google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest, $root.google.cloud.securitycenter.v1p1beta1.SecurityMarks, request, callback); + }, "name", { value: "UpdateSecurityMarks" }); /** - * State enum. - * @name google.cloud.securitycenter.v1beta1.RunAssetDiscoveryResponse.State - * @enum {string} - * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value - * @property {number} COMPLETED=1 COMPLETED value - * @property {number} SUPERSEDED=2 SUPERSEDED value - * @property {number} TERMINATED=3 TERMINATED value + * Calls UpdateSecurityMarks. + * @function updateSecurityMarks + * @memberof google.cloud.securitycenter.v1p1beta1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1p1beta1.IUpdateSecurityMarksRequest} request UpdateSecurityMarksRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - RunAssetDiscoveryResponse.State = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; - values[valuesById[1] = "COMPLETED"] = 1; - values[valuesById[2] = "SUPERSEDED"] = 2; - values[valuesById[3] = "TERMINATED"] = 3; - return values; - })(); - return RunAssetDiscoveryResponse; + return SecurityCenter; })(); - - v1beta1.OrganizationSettings = (function() { - - /** - * Properties of an OrganizationSettings. - * @memberof google.cloud.securitycenter.v1beta1 - * @interface IOrganizationSettings - * @property {string|null} [name] OrganizationSettings name - * @property {boolean|null} [enableAssetDiscovery] OrganizationSettings enableAssetDiscovery - * @property {google.cloud.securitycenter.v1beta1.OrganizationSettings.IAssetDiscoveryConfig|null} [assetDiscoveryConfig] OrganizationSettings assetDiscoveryConfig + + v1p1beta1.CreateFindingRequest = (function() { + + /** + * Properties of a CreateFindingRequest. + * @memberof google.cloud.securitycenter.v1p1beta1 + * @interface ICreateFindingRequest + * @property {string|null} [parent] CreateFindingRequest parent + * @property {string|null} [findingId] CreateFindingRequest findingId + * @property {google.cloud.securitycenter.v1p1beta1.IFinding|null} [finding] CreateFindingRequest finding */ /** - * Constructs a new OrganizationSettings. - * @memberof google.cloud.securitycenter.v1beta1 - * @classdesc Represents an OrganizationSettings. - * @implements IOrganizationSettings + * Constructs a new CreateFindingRequest. + * @memberof google.cloud.securitycenter.v1p1beta1 + * @classdesc Represents a CreateFindingRequest. + * @implements ICreateFindingRequest * @constructor - * @param {google.cloud.securitycenter.v1beta1.IOrganizationSettings=} [properties] Properties to set + * @param {google.cloud.securitycenter.v1p1beta1.ICreateFindingRequest=} [properties] Properties to set */ - function OrganizationSettings(properties) { + function CreateFindingRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -11367,101 +21991,101 @@ } /** - * OrganizationSettings name. - * @member {string} name - * @memberof google.cloud.securitycenter.v1beta1.OrganizationSettings + * CreateFindingRequest parent. + * @member {string} parent + * @memberof google.cloud.securitycenter.v1p1beta1.CreateFindingRequest * @instance */ - OrganizationSettings.prototype.name = ""; + CreateFindingRequest.prototype.parent = ""; /** - * OrganizationSettings enableAssetDiscovery. - * @member {boolean} enableAssetDiscovery - * @memberof google.cloud.securitycenter.v1beta1.OrganizationSettings + * CreateFindingRequest findingId. + * @member {string} findingId + * @memberof google.cloud.securitycenter.v1p1beta1.CreateFindingRequest * @instance */ - OrganizationSettings.prototype.enableAssetDiscovery = false; + CreateFindingRequest.prototype.findingId = ""; /** - * OrganizationSettings assetDiscoveryConfig. - * @member {google.cloud.securitycenter.v1beta1.OrganizationSettings.IAssetDiscoveryConfig|null|undefined} assetDiscoveryConfig - * @memberof google.cloud.securitycenter.v1beta1.OrganizationSettings + * CreateFindingRequest finding. + * @member {google.cloud.securitycenter.v1p1beta1.IFinding|null|undefined} finding + * @memberof google.cloud.securitycenter.v1p1beta1.CreateFindingRequest * @instance */ - OrganizationSettings.prototype.assetDiscoveryConfig = null; + CreateFindingRequest.prototype.finding = null; /** - * Creates a new OrganizationSettings instance using the specified properties. + * Creates a new CreateFindingRequest instance using the specified properties. * @function create - * @memberof google.cloud.securitycenter.v1beta1.OrganizationSettings + * @memberof google.cloud.securitycenter.v1p1beta1.CreateFindingRequest * @static - * @param {google.cloud.securitycenter.v1beta1.IOrganizationSettings=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1beta1.OrganizationSettings} OrganizationSettings instance + * @param {google.cloud.securitycenter.v1p1beta1.ICreateFindingRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1p1beta1.CreateFindingRequest} CreateFindingRequest instance */ - OrganizationSettings.create = function create(properties) { - return new OrganizationSettings(properties); + CreateFindingRequest.create = function create(properties) { + return new CreateFindingRequest(properties); }; /** - * Encodes the specified OrganizationSettings message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.OrganizationSettings.verify|verify} messages. + * Encodes the specified CreateFindingRequest message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.CreateFindingRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.securitycenter.v1beta1.OrganizationSettings + * @memberof google.cloud.securitycenter.v1p1beta1.CreateFindingRequest * @static - * @param {google.cloud.securitycenter.v1beta1.IOrganizationSettings} message OrganizationSettings message or plain object to encode + * @param {google.cloud.securitycenter.v1p1beta1.ICreateFindingRequest} message CreateFindingRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - OrganizationSettings.encode = function encode(message, writer) { + CreateFindingRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.enableAssetDiscovery != null && message.hasOwnProperty("enableAssetDiscovery")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.enableAssetDiscovery); - if (message.assetDiscoveryConfig != null && message.hasOwnProperty("assetDiscoveryConfig")) - $root.google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig.encode(message.assetDiscoveryConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.parent != null && message.hasOwnProperty("parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.findingId != null && message.hasOwnProperty("findingId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.findingId); + if (message.finding != null && message.hasOwnProperty("finding")) + $root.google.cloud.securitycenter.v1p1beta1.Finding.encode(message.finding, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; /** - * Encodes the specified OrganizationSettings message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.OrganizationSettings.verify|verify} messages. + * Encodes the specified CreateFindingRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.CreateFindingRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1beta1.OrganizationSettings + * @memberof google.cloud.securitycenter.v1p1beta1.CreateFindingRequest * @static - * @param {google.cloud.securitycenter.v1beta1.IOrganizationSettings} message OrganizationSettings message or plain object to encode + * @param {google.cloud.securitycenter.v1p1beta1.ICreateFindingRequest} message CreateFindingRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - OrganizationSettings.encodeDelimited = function encodeDelimited(message, writer) { + CreateFindingRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an OrganizationSettings message from the specified reader or buffer. + * Decodes a CreateFindingRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.securitycenter.v1beta1.OrganizationSettings + * @memberof google.cloud.securitycenter.v1p1beta1.CreateFindingRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1beta1.OrganizationSettings} OrganizationSettings + * @returns {google.cloud.securitycenter.v1p1beta1.CreateFindingRequest} CreateFindingRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - OrganizationSettings.decode = function decode(reader, length) { + CreateFindingRequest.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.cloud.securitycenter.v1beta1.OrganizationSettings(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1p1beta1.CreateFindingRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.name = reader.string(); + message.parent = reader.string(); break; case 2: - message.enableAssetDiscovery = reader.bool(); + message.findingId = reader.string(); break; case 3: - message.assetDiscoveryConfig = $root.google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig.decode(reader, reader.uint32()); + message.finding = $root.google.cloud.securitycenter.v1p1beta1.Finding.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -11472,1020 +22096,1336 @@ }; /** - * Decodes an OrganizationSettings message from the specified reader or buffer, length delimited. + * Decodes a CreateFindingRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1beta1.OrganizationSettings + * @memberof google.cloud.securitycenter.v1p1beta1.CreateFindingRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1beta1.OrganizationSettings} OrganizationSettings + * @returns {google.cloud.securitycenter.v1p1beta1.CreateFindingRequest} CreateFindingRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - OrganizationSettings.decodeDelimited = function decodeDelimited(reader) { + CreateFindingRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an OrganizationSettings message. + * Verifies a CreateFindingRequest message. * @function verify - * @memberof google.cloud.securitycenter.v1beta1.OrganizationSettings + * @memberof google.cloud.securitycenter.v1p1beta1.CreateFindingRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - OrganizationSettings.verify = function verify(message) { + CreateFindingRequest.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.enableAssetDiscovery != null && message.hasOwnProperty("enableAssetDiscovery")) - if (typeof message.enableAssetDiscovery !== "boolean") - return "enableAssetDiscovery: boolean expected"; - if (message.assetDiscoveryConfig != null && message.hasOwnProperty("assetDiscoveryConfig")) { - var error = $root.google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig.verify(message.assetDiscoveryConfig); + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.findingId != null && message.hasOwnProperty("findingId")) + if (!$util.isString(message.findingId)) + return "findingId: string expected"; + if (message.finding != null && message.hasOwnProperty("finding")) { + var error = $root.google.cloud.securitycenter.v1p1beta1.Finding.verify(message.finding); if (error) - return "assetDiscoveryConfig." + error; + return "finding." + error; } return null; }; /** - * Creates an OrganizationSettings message from a plain object. Also converts values to their respective internal types. + * Creates a CreateFindingRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.securitycenter.v1beta1.OrganizationSettings + * @memberof google.cloud.securitycenter.v1p1beta1.CreateFindingRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1beta1.OrganizationSettings} OrganizationSettings + * @returns {google.cloud.securitycenter.v1p1beta1.CreateFindingRequest} CreateFindingRequest */ - OrganizationSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1beta1.OrganizationSettings) + CreateFindingRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1p1beta1.CreateFindingRequest) return object; - var message = new $root.google.cloud.securitycenter.v1beta1.OrganizationSettings(); - if (object.name != null) - message.name = String(object.name); - if (object.enableAssetDiscovery != null) - message.enableAssetDiscovery = Boolean(object.enableAssetDiscovery); - if (object.assetDiscoveryConfig != null) { - if (typeof object.assetDiscoveryConfig !== "object") - throw TypeError(".google.cloud.securitycenter.v1beta1.OrganizationSettings.assetDiscoveryConfig: object expected"); - message.assetDiscoveryConfig = $root.google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig.fromObject(object.assetDiscoveryConfig); + var message = new $root.google.cloud.securitycenter.v1p1beta1.CreateFindingRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.findingId != null) + message.findingId = String(object.findingId); + if (object.finding != null) { + if (typeof object.finding !== "object") + throw TypeError(".google.cloud.securitycenter.v1p1beta1.CreateFindingRequest.finding: object expected"); + message.finding = $root.google.cloud.securitycenter.v1p1beta1.Finding.fromObject(object.finding); } return message; }; /** - * Creates a plain object from an OrganizationSettings message. Also converts values to other types if specified. + * Creates a plain object from a CreateFindingRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.securitycenter.v1beta1.OrganizationSettings + * @memberof google.cloud.securitycenter.v1p1beta1.CreateFindingRequest * @static - * @param {google.cloud.securitycenter.v1beta1.OrganizationSettings} message OrganizationSettings + * @param {google.cloud.securitycenter.v1p1beta1.CreateFindingRequest} message CreateFindingRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - OrganizationSettings.toObject = function toObject(message, options) { + CreateFindingRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.name = ""; - object.enableAssetDiscovery = false; - object.assetDiscoveryConfig = null; + object.parent = ""; + object.findingId = ""; + object.finding = null; } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.enableAssetDiscovery != null && message.hasOwnProperty("enableAssetDiscovery")) - object.enableAssetDiscovery = message.enableAssetDiscovery; - if (message.assetDiscoveryConfig != null && message.hasOwnProperty("assetDiscoveryConfig")) - object.assetDiscoveryConfig = $root.google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig.toObject(message.assetDiscoveryConfig, options); + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.findingId != null && message.hasOwnProperty("findingId")) + object.findingId = message.findingId; + if (message.finding != null && message.hasOwnProperty("finding")) + object.finding = $root.google.cloud.securitycenter.v1p1beta1.Finding.toObject(message.finding, options); return object; }; /** - * Converts this OrganizationSettings to JSON. + * Converts this CreateFindingRequest to JSON. * @function toJSON - * @memberof google.cloud.securitycenter.v1beta1.OrganizationSettings + * @memberof google.cloud.securitycenter.v1p1beta1.CreateFindingRequest * @instance * @returns {Object.} JSON object */ - OrganizationSettings.prototype.toJSON = function toJSON() { + CreateFindingRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - OrganizationSettings.AssetDiscoveryConfig = (function() { - - /** - * Properties of an AssetDiscoveryConfig. - * @memberof google.cloud.securitycenter.v1beta1.OrganizationSettings - * @interface IAssetDiscoveryConfig - * @property {Array.|null} [projectIds] AssetDiscoveryConfig projectIds - * @property {google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode|null} [inclusionMode] AssetDiscoveryConfig inclusionMode - */ + return CreateFindingRequest; + })(); - /** - * Constructs a new AssetDiscoveryConfig. - * @memberof google.cloud.securitycenter.v1beta1.OrganizationSettings - * @classdesc Represents an AssetDiscoveryConfig. - * @implements IAssetDiscoveryConfig - * @constructor - * @param {google.cloud.securitycenter.v1beta1.OrganizationSettings.IAssetDiscoveryConfig=} [properties] Properties to set - */ - function AssetDiscoveryConfig(properties) { - this.projectIds = []; - 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]]; - } + v1p1beta1.CreateNotificationConfigRequest = (function() { - /** - * AssetDiscoveryConfig projectIds. - * @member {Array.} projectIds - * @memberof google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig - * @instance - */ - AssetDiscoveryConfig.prototype.projectIds = $util.emptyArray; + /** + * Properties of a CreateNotificationConfigRequest. + * @memberof google.cloud.securitycenter.v1p1beta1 + * @interface ICreateNotificationConfigRequest + * @property {string|null} [parent] CreateNotificationConfigRequest parent + * @property {string|null} [configId] CreateNotificationConfigRequest configId + * @property {google.cloud.securitycenter.v1p1beta1.INotificationConfig|null} [notificationConfig] CreateNotificationConfigRequest notificationConfig + */ - /** - * AssetDiscoveryConfig inclusionMode. - * @member {google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode} inclusionMode - * @memberof google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig - * @instance - */ - AssetDiscoveryConfig.prototype.inclusionMode = 0; + /** + * Constructs a new CreateNotificationConfigRequest. + * @memberof google.cloud.securitycenter.v1p1beta1 + * @classdesc Represents a CreateNotificationConfigRequest. + * @implements ICreateNotificationConfigRequest + * @constructor + * @param {google.cloud.securitycenter.v1p1beta1.ICreateNotificationConfigRequest=} [properties] Properties to set + */ + function CreateNotificationConfigRequest(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]]; + } - /** - * Creates a new AssetDiscoveryConfig instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig - * @static - * @param {google.cloud.securitycenter.v1beta1.OrganizationSettings.IAssetDiscoveryConfig=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig} AssetDiscoveryConfig instance - */ - AssetDiscoveryConfig.create = function create(properties) { - return new AssetDiscoveryConfig(properties); - }; + /** + * CreateNotificationConfigRequest parent. + * @member {string} parent + * @memberof google.cloud.securitycenter.v1p1beta1.CreateNotificationConfigRequest + * @instance + */ + CreateNotificationConfigRequest.prototype.parent = ""; - /** - * Encodes the specified AssetDiscoveryConfig message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig - * @static - * @param {google.cloud.securitycenter.v1beta1.OrganizationSettings.IAssetDiscoveryConfig} message AssetDiscoveryConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AssetDiscoveryConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.projectIds != null && message.projectIds.length) - for (var i = 0; i < message.projectIds.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectIds[i]); - if (message.inclusionMode != null && message.hasOwnProperty("inclusionMode")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.inclusionMode); - return writer; - }; + /** + * CreateNotificationConfigRequest configId. + * @member {string} configId + * @memberof google.cloud.securitycenter.v1p1beta1.CreateNotificationConfigRequest + * @instance + */ + CreateNotificationConfigRequest.prototype.configId = ""; - /** - * Encodes the specified AssetDiscoveryConfig message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig - * @static - * @param {google.cloud.securitycenter.v1beta1.OrganizationSettings.IAssetDiscoveryConfig} message AssetDiscoveryConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AssetDiscoveryConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * CreateNotificationConfigRequest notificationConfig. + * @member {google.cloud.securitycenter.v1p1beta1.INotificationConfig|null|undefined} notificationConfig + * @memberof google.cloud.securitycenter.v1p1beta1.CreateNotificationConfigRequest + * @instance + */ + CreateNotificationConfigRequest.prototype.notificationConfig = null; - /** - * Decodes an AssetDiscoveryConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig} AssetDiscoveryConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AssetDiscoveryConfig.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.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.projectIds && message.projectIds.length)) - message.projectIds = []; - message.projectIds.push(reader.string()); - break; - case 2: - message.inclusionMode = reader.int32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Creates a new CreateNotificationConfigRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1p1beta1.CreateNotificationConfigRequest + * @static + * @param {google.cloud.securitycenter.v1p1beta1.ICreateNotificationConfigRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1p1beta1.CreateNotificationConfigRequest} CreateNotificationConfigRequest instance + */ + CreateNotificationConfigRequest.create = function create(properties) { + return new CreateNotificationConfigRequest(properties); + }; - /** - * Decodes an AssetDiscoveryConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig} AssetDiscoveryConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AssetDiscoveryConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Encodes the specified CreateNotificationConfigRequest message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.CreateNotificationConfigRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1p1beta1.CreateNotificationConfigRequest + * @static + * @param {google.cloud.securitycenter.v1p1beta1.ICreateNotificationConfigRequest} message CreateNotificationConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateNotificationConfigRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && message.hasOwnProperty("parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.configId != null && message.hasOwnProperty("configId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.configId); + if (message.notificationConfig != null && message.hasOwnProperty("notificationConfig")) + $root.google.cloud.securitycenter.v1p1beta1.NotificationConfig.encode(message.notificationConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; - /** - * Verifies an AssetDiscoveryConfig message. - * @function verify - * @memberof google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AssetDiscoveryConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.projectIds != null && message.hasOwnProperty("projectIds")) { - if (!Array.isArray(message.projectIds)) - return "projectIds: array expected"; - for (var i = 0; i < message.projectIds.length; ++i) - if (!$util.isString(message.projectIds[i])) - return "projectIds: string[] expected"; - } - if (message.inclusionMode != null && message.hasOwnProperty("inclusionMode")) - switch (message.inclusionMode) { - default: - return "inclusionMode: enum value expected"; - case 0: - case 1: - case 2: - break; - } - return null; - }; + /** + * Encodes the specified CreateNotificationConfigRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.CreateNotificationConfigRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1p1beta1.CreateNotificationConfigRequest + * @static + * @param {google.cloud.securitycenter.v1p1beta1.ICreateNotificationConfigRequest} message CreateNotificationConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateNotificationConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Creates an AssetDiscoveryConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig} AssetDiscoveryConfig - */ - AssetDiscoveryConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig) - return object; - var message = new $root.google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig(); - if (object.projectIds) { - if (!Array.isArray(object.projectIds)) - throw TypeError(".google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig.projectIds: array expected"); - message.projectIds = []; - for (var i = 0; i < object.projectIds.length; ++i) - message.projectIds[i] = String(object.projectIds[i]); - } - switch (object.inclusionMode) { - case "INCLUSION_MODE_UNSPECIFIED": - case 0: - message.inclusionMode = 0; - break; - case "INCLUDE_ONLY": + /** + * Decodes a CreateNotificationConfigRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1p1beta1.CreateNotificationConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1p1beta1.CreateNotificationConfigRequest} CreateNotificationConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateNotificationConfigRequest.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.cloud.securitycenter.v1p1beta1.CreateNotificationConfigRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { case 1: - message.inclusionMode = 1; + message.parent = reader.string(); break; - case "EXCLUDE": case 2: - message.inclusionMode = 2; + message.configId = reader.string(); + break; + case 3: + message.notificationConfig = $root.google.cloud.securitycenter.v1p1beta1.NotificationConfig.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); break; } - return message; - }; + } + return message; + }; - /** - * Creates a plain object from an AssetDiscoveryConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig - * @static - * @param {google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig} message AssetDiscoveryConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AssetDiscoveryConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.projectIds = []; - if (options.defaults) - object.inclusionMode = options.enums === String ? "INCLUSION_MODE_UNSPECIFIED" : 0; - if (message.projectIds && message.projectIds.length) { - object.projectIds = []; - for (var j = 0; j < message.projectIds.length; ++j) - object.projectIds[j] = message.projectIds[j]; - } - if (message.inclusionMode != null && message.hasOwnProperty("inclusionMode")) - object.inclusionMode = options.enums === String ? $root.google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode[message.inclusionMode] : message.inclusionMode; - return object; - }; + /** + * Decodes a CreateNotificationConfigRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1p1beta1.CreateNotificationConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1p1beta1.CreateNotificationConfigRequest} CreateNotificationConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateNotificationConfigRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Converts this AssetDiscoveryConfig to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig - * @instance - * @returns {Object.} JSON object - */ - AssetDiscoveryConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Verifies a CreateNotificationConfigRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1p1beta1.CreateNotificationConfigRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateNotificationConfigRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.configId != null && message.hasOwnProperty("configId")) + if (!$util.isString(message.configId)) + return "configId: string expected"; + if (message.notificationConfig != null && message.hasOwnProperty("notificationConfig")) { + var error = $root.google.cloud.securitycenter.v1p1beta1.NotificationConfig.verify(message.notificationConfig); + if (error) + return "notificationConfig." + error; + } + return null; + }; - /** - * InclusionMode enum. - * @name google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode - * @enum {string} - * @property {number} INCLUSION_MODE_UNSPECIFIED=0 INCLUSION_MODE_UNSPECIFIED value - * @property {number} INCLUDE_ONLY=1 INCLUDE_ONLY value - * @property {number} EXCLUDE=2 EXCLUDE value - */ - AssetDiscoveryConfig.InclusionMode = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "INCLUSION_MODE_UNSPECIFIED"] = 0; - values[valuesById[1] = "INCLUDE_ONLY"] = 1; - values[valuesById[2] = "EXCLUDE"] = 2; - return values; - })(); + /** + * Creates a CreateNotificationConfigRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1p1beta1.CreateNotificationConfigRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1p1beta1.CreateNotificationConfigRequest} CreateNotificationConfigRequest + */ + CreateNotificationConfigRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1p1beta1.CreateNotificationConfigRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1p1beta1.CreateNotificationConfigRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.configId != null) + message.configId = String(object.configId); + if (object.notificationConfig != null) { + if (typeof object.notificationConfig !== "object") + throw TypeError(".google.cloud.securitycenter.v1p1beta1.CreateNotificationConfigRequest.notificationConfig: object expected"); + message.notificationConfig = $root.google.cloud.securitycenter.v1p1beta1.NotificationConfig.fromObject(object.notificationConfig); + } + return message; + }; + + /** + * Creates a plain object from a CreateNotificationConfigRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1p1beta1.CreateNotificationConfigRequest + * @static + * @param {google.cloud.securitycenter.v1p1beta1.CreateNotificationConfigRequest} message CreateNotificationConfigRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateNotificationConfigRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.configId = ""; + object.notificationConfig = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.configId != null && message.hasOwnProperty("configId")) + object.configId = message.configId; + if (message.notificationConfig != null && message.hasOwnProperty("notificationConfig")) + object.notificationConfig = $root.google.cloud.securitycenter.v1p1beta1.NotificationConfig.toObject(message.notificationConfig, options); + return object; + }; - return AssetDiscoveryConfig; - })(); + /** + * Converts this CreateNotificationConfigRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1p1beta1.CreateNotificationConfigRequest + * @instance + * @returns {Object.} JSON object + */ + CreateNotificationConfigRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - return OrganizationSettings; + return CreateNotificationConfigRequest; })(); - v1beta1.SecurityCenter = (function() { + v1p1beta1.CreateSourceRequest = (function() { /** - * Constructs a new SecurityCenter service. - * @memberof google.cloud.securitycenter.v1beta1 - * @classdesc Represents a SecurityCenter - * @extends $protobuf.rpc.Service + * Properties of a CreateSourceRequest. + * @memberof google.cloud.securitycenter.v1p1beta1 + * @interface ICreateSourceRequest + * @property {string|null} [parent] CreateSourceRequest parent + * @property {google.cloud.securitycenter.v1p1beta1.ISource|null} [source] CreateSourceRequest source + */ + + /** + * Constructs a new CreateSourceRequest. + * @memberof google.cloud.securitycenter.v1p1beta1 + * @classdesc Represents a CreateSourceRequest. + * @implements ICreateSourceRequest * @constructor - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @param {google.cloud.securitycenter.v1p1beta1.ICreateSourceRequest=} [properties] Properties to set */ - function SecurityCenter(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + function CreateSourceRequest(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]]; } - (SecurityCenter.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = SecurityCenter; + /** + * CreateSourceRequest parent. + * @member {string} parent + * @memberof google.cloud.securitycenter.v1p1beta1.CreateSourceRequest + * @instance + */ + CreateSourceRequest.prototype.parent = ""; /** - * Creates new SecurityCenter service using the specified rpc implementation. + * CreateSourceRequest source. + * @member {google.cloud.securitycenter.v1p1beta1.ISource|null|undefined} source + * @memberof google.cloud.securitycenter.v1p1beta1.CreateSourceRequest + * @instance + */ + CreateSourceRequest.prototype.source = null; + + /** + * Creates a new CreateSourceRequest instance using the specified properties. * @function create - * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @memberof google.cloud.securitycenter.v1p1beta1.CreateSourceRequest * @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 {SecurityCenter} RPC service. Useful where requests and/or responses are streamed. + * @param {google.cloud.securitycenter.v1p1beta1.ICreateSourceRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1p1beta1.CreateSourceRequest} CreateSourceRequest instance */ - SecurityCenter.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); + CreateSourceRequest.create = function create(properties) { + return new CreateSourceRequest(properties); }; /** - * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter#createSource}. - * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter - * @typedef CreateSourceCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.securitycenter.v1beta1.Source} [response] Source + * Encodes the specified CreateSourceRequest message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.CreateSourceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1p1beta1.CreateSourceRequest + * @static + * @param {google.cloud.securitycenter.v1p1beta1.ICreateSourceRequest} message CreateSourceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ + CreateSourceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && message.hasOwnProperty("parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.source != null && message.hasOwnProperty("source")) + $root.google.cloud.securitycenter.v1p1beta1.Source.encode(message.source, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; /** - * Calls CreateSource. - * @function createSource - * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1beta1.ICreateSourceRequest} request CreateSourceRequest message or plain object - * @param {google.cloud.securitycenter.v1beta1.SecurityCenter.CreateSourceCallback} callback Node-style callback called with the error, if any, and Source - * @returns {undefined} - * @variation 1 + * Encodes the specified CreateSourceRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.CreateSourceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1p1beta1.CreateSourceRequest + * @static + * @param {google.cloud.securitycenter.v1p1beta1.ICreateSourceRequest} message CreateSourceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - Object.defineProperty(SecurityCenter.prototype.createSource = function createSource(request, callback) { - return this.rpcCall(createSource, $root.google.cloud.securitycenter.v1beta1.CreateSourceRequest, $root.google.cloud.securitycenter.v1beta1.Source, request, callback); - }, "name", { value: "CreateSource" }); + CreateSourceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; /** - * Calls CreateSource. - * @function createSource - * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1beta1.ICreateSourceRequest} request CreateSourceRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Decodes a CreateSourceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1p1beta1.CreateSourceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1p1beta1.CreateSourceRequest} CreateSourceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateSourceRequest.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.cloud.securitycenter.v1p1beta1.CreateSourceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.source = $root.google.cloud.securitycenter.v1p1beta1.Source.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateSourceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1p1beta1.CreateSourceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1p1beta1.CreateSourceRequest} CreateSourceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ + CreateSourceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; /** - * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter#createFinding}. - * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter - * @typedef CreateFindingCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.securitycenter.v1beta1.Finding} [response] Finding + * Verifies a CreateSourceRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1p1beta1.CreateSourceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not */ + CreateSourceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.source != null && message.hasOwnProperty("source")) { + var error = $root.google.cloud.securitycenter.v1p1beta1.Source.verify(message.source); + if (error) + return "source." + error; + } + return null; + }; /** - * Calls CreateFinding. - * @function createFinding - * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1beta1.ICreateFindingRequest} request CreateFindingRequest message or plain object - * @param {google.cloud.securitycenter.v1beta1.SecurityCenter.CreateFindingCallback} callback Node-style callback called with the error, if any, and Finding - * @returns {undefined} - * @variation 1 + * Creates a CreateSourceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1p1beta1.CreateSourceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1p1beta1.CreateSourceRequest} CreateSourceRequest */ - Object.defineProperty(SecurityCenter.prototype.createFinding = function createFinding(request, callback) { - return this.rpcCall(createFinding, $root.google.cloud.securitycenter.v1beta1.CreateFindingRequest, $root.google.cloud.securitycenter.v1beta1.Finding, request, callback); - }, "name", { value: "CreateFinding" }); + CreateSourceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1p1beta1.CreateSourceRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1p1beta1.CreateSourceRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.source != null) { + if (typeof object.source !== "object") + throw TypeError(".google.cloud.securitycenter.v1p1beta1.CreateSourceRequest.source: object expected"); + message.source = $root.google.cloud.securitycenter.v1p1beta1.Source.fromObject(object.source); + } + return message; + }; /** - * Calls CreateFinding. - * @function createFinding - * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * Creates a plain object from a CreateSourceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1p1beta1.CreateSourceRequest + * @static + * @param {google.cloud.securitycenter.v1p1beta1.CreateSourceRequest} message CreateSourceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateSourceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.source = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.source != null && message.hasOwnProperty("source")) + object.source = $root.google.cloud.securitycenter.v1p1beta1.Source.toObject(message.source, options); + return object; + }; + + /** + * Converts this CreateSourceRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1p1beta1.CreateSourceRequest * @instance - * @param {google.cloud.securitycenter.v1beta1.ICreateFindingRequest} request CreateFindingRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * @returns {Object.} JSON object + */ + CreateSourceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return CreateSourceRequest; + })(); + + v1p1beta1.DeleteNotificationConfigRequest = (function() { + + /** + * Properties of a DeleteNotificationConfigRequest. + * @memberof google.cloud.securitycenter.v1p1beta1 + * @interface IDeleteNotificationConfigRequest + * @property {string|null} [name] DeleteNotificationConfigRequest name */ /** - * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter#getIamPolicy}. - * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter - * @typedef GetIamPolicyCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.iam.v1.Policy} [response] Policy + * Constructs a new DeleteNotificationConfigRequest. + * @memberof google.cloud.securitycenter.v1p1beta1 + * @classdesc Represents a DeleteNotificationConfigRequest. + * @implements IDeleteNotificationConfigRequest + * @constructor + * @param {google.cloud.securitycenter.v1p1beta1.IDeleteNotificationConfigRequest=} [properties] Properties to set */ + function DeleteNotificationConfigRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } /** - * Calls GetIamPolicy. - * @function getIamPolicy - * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * DeleteNotificationConfigRequest name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1p1beta1.DeleteNotificationConfigRequest * @instance - * @param {google.iam.v1.IGetIamPolicyRequest} request GetIamPolicyRequest message or plain object - * @param {google.cloud.securitycenter.v1beta1.SecurityCenter.GetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy - * @returns {undefined} - * @variation 1 */ - Object.defineProperty(SecurityCenter.prototype.getIamPolicy = function getIamPolicy(request, callback) { - return this.rpcCall(getIamPolicy, $root.google.iam.v1.GetIamPolicyRequest, $root.google.iam.v1.Policy, request, callback); - }, "name", { value: "GetIamPolicy" }); + DeleteNotificationConfigRequest.prototype.name = ""; /** - * Calls GetIamPolicy. - * @function getIamPolicy - * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter - * @instance - * @param {google.iam.v1.IGetIamPolicyRequest} request GetIamPolicyRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Creates a new DeleteNotificationConfigRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1p1beta1.DeleteNotificationConfigRequest + * @static + * @param {google.cloud.securitycenter.v1p1beta1.IDeleteNotificationConfigRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1p1beta1.DeleteNotificationConfigRequest} DeleteNotificationConfigRequest instance */ + DeleteNotificationConfigRequest.create = function create(properties) { + return new DeleteNotificationConfigRequest(properties); + }; /** - * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter#getOrganizationSettings}. - * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter - * @typedef GetOrganizationSettingsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.securitycenter.v1beta1.OrganizationSettings} [response] OrganizationSettings + * Encodes the specified DeleteNotificationConfigRequest message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.DeleteNotificationConfigRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1p1beta1.DeleteNotificationConfigRequest + * @static + * @param {google.cloud.securitycenter.v1p1beta1.IDeleteNotificationConfigRequest} message DeleteNotificationConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ + DeleteNotificationConfigRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; /** - * Calls GetOrganizationSettings. - * @function getOrganizationSettings - * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1beta1.IGetOrganizationSettingsRequest} request GetOrganizationSettingsRequest message or plain object - * @param {google.cloud.securitycenter.v1beta1.SecurityCenter.GetOrganizationSettingsCallback} callback Node-style callback called with the error, if any, and OrganizationSettings - * @returns {undefined} - * @variation 1 + * Encodes the specified DeleteNotificationConfigRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.DeleteNotificationConfigRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1p1beta1.DeleteNotificationConfigRequest + * @static + * @param {google.cloud.securitycenter.v1p1beta1.IDeleteNotificationConfigRequest} message DeleteNotificationConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - Object.defineProperty(SecurityCenter.prototype.getOrganizationSettings = function getOrganizationSettings(request, callback) { - return this.rpcCall(getOrganizationSettings, $root.google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest, $root.google.cloud.securitycenter.v1beta1.OrganizationSettings, request, callback); - }, "name", { value: "GetOrganizationSettings" }); + DeleteNotificationConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; /** - * Calls GetOrganizationSettings. - * @function getOrganizationSettings - * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1beta1.IGetOrganizationSettingsRequest} request GetOrganizationSettingsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Decodes a DeleteNotificationConfigRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1p1beta1.DeleteNotificationConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1p1beta1.DeleteNotificationConfigRequest} DeleteNotificationConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ + DeleteNotificationConfigRequest.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.cloud.securitycenter.v1p1beta1.DeleteNotificationConfigRequest(); + 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; + }; /** - * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter#getSource}. - * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter - * @typedef GetSourceCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.securitycenter.v1beta1.Source} [response] Source + * Decodes a DeleteNotificationConfigRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1p1beta1.DeleteNotificationConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1p1beta1.DeleteNotificationConfigRequest} DeleteNotificationConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ + DeleteNotificationConfigRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; /** - * Calls GetSource. - * @function getSource - * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1beta1.IGetSourceRequest} request GetSourceRequest message or plain object - * @param {google.cloud.securitycenter.v1beta1.SecurityCenter.GetSourceCallback} callback Node-style callback called with the error, if any, and Source - * @returns {undefined} - * @variation 1 + * Verifies a DeleteNotificationConfigRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1p1beta1.DeleteNotificationConfigRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Object.defineProperty(SecurityCenter.prototype.getSource = function getSource(request, callback) { - return this.rpcCall(getSource, $root.google.cloud.securitycenter.v1beta1.GetSourceRequest, $root.google.cloud.securitycenter.v1beta1.Source, request, callback); - }, "name", { value: "GetSource" }); + DeleteNotificationConfigRequest.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; + }; /** - * Calls GetSource. - * @function getSource - * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1beta1.IGetSourceRequest} request GetSourceRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Creates a DeleteNotificationConfigRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1p1beta1.DeleteNotificationConfigRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1p1beta1.DeleteNotificationConfigRequest} DeleteNotificationConfigRequest */ + DeleteNotificationConfigRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1p1beta1.DeleteNotificationConfigRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1p1beta1.DeleteNotificationConfigRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; /** - * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter#groupAssets}. - * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter - * @typedef GroupAssetsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.securitycenter.v1beta1.GroupAssetsResponse} [response] GroupAssetsResponse + * Creates a plain object from a DeleteNotificationConfigRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1p1beta1.DeleteNotificationConfigRequest + * @static + * @param {google.cloud.securitycenter.v1p1beta1.DeleteNotificationConfigRequest} message DeleteNotificationConfigRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object */ + DeleteNotificationConfigRequest.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; + }; /** - * Calls GroupAssets. - * @function groupAssets - * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * Converts this DeleteNotificationConfigRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1p1beta1.DeleteNotificationConfigRequest * @instance - * @param {google.cloud.securitycenter.v1beta1.IGroupAssetsRequest} request GroupAssetsRequest message or plain object - * @param {google.cloud.securitycenter.v1beta1.SecurityCenter.GroupAssetsCallback} callback Node-style callback called with the error, if any, and GroupAssetsResponse - * @returns {undefined} - * @variation 1 + * @returns {Object.} JSON object */ - Object.defineProperty(SecurityCenter.prototype.groupAssets = function groupAssets(request, callback) { - return this.rpcCall(groupAssets, $root.google.cloud.securitycenter.v1beta1.GroupAssetsRequest, $root.google.cloud.securitycenter.v1beta1.GroupAssetsResponse, request, callback); - }, "name", { value: "GroupAssets" }); + DeleteNotificationConfigRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DeleteNotificationConfigRequest; + })(); + + v1p1beta1.GetNotificationConfigRequest = (function() { /** - * Calls GroupAssets. - * @function groupAssets - * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1beta1.IGroupAssetsRequest} request GroupAssetsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Properties of a GetNotificationConfigRequest. + * @memberof google.cloud.securitycenter.v1p1beta1 + * @interface IGetNotificationConfigRequest + * @property {string|null} [name] GetNotificationConfigRequest name */ /** - * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter#groupFindings}. - * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter - * @typedef GroupFindingsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.securitycenter.v1beta1.GroupFindingsResponse} [response] GroupFindingsResponse + * Constructs a new GetNotificationConfigRequest. + * @memberof google.cloud.securitycenter.v1p1beta1 + * @classdesc Represents a GetNotificationConfigRequest. + * @implements IGetNotificationConfigRequest + * @constructor + * @param {google.cloud.securitycenter.v1p1beta1.IGetNotificationConfigRequest=} [properties] Properties to set */ + function GetNotificationConfigRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } /** - * Calls GroupFindings. - * @function groupFindings - * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * GetNotificationConfigRequest name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1p1beta1.GetNotificationConfigRequest * @instance - * @param {google.cloud.securitycenter.v1beta1.IGroupFindingsRequest} request GroupFindingsRequest message or plain object - * @param {google.cloud.securitycenter.v1beta1.SecurityCenter.GroupFindingsCallback} callback Node-style callback called with the error, if any, and GroupFindingsResponse - * @returns {undefined} - * @variation 1 */ - Object.defineProperty(SecurityCenter.prototype.groupFindings = function groupFindings(request, callback) { - return this.rpcCall(groupFindings, $root.google.cloud.securitycenter.v1beta1.GroupFindingsRequest, $root.google.cloud.securitycenter.v1beta1.GroupFindingsResponse, request, callback); - }, "name", { value: "GroupFindings" }); + GetNotificationConfigRequest.prototype.name = ""; /** - * Calls GroupFindings. - * @function groupFindings - * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1beta1.IGroupFindingsRequest} request GroupFindingsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Creates a new GetNotificationConfigRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1p1beta1.GetNotificationConfigRequest + * @static + * @param {google.cloud.securitycenter.v1p1beta1.IGetNotificationConfigRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1p1beta1.GetNotificationConfigRequest} GetNotificationConfigRequest instance */ + GetNotificationConfigRequest.create = function create(properties) { + return new GetNotificationConfigRequest(properties); + }; /** - * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter#listAssets}. - * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter - * @typedef ListAssetsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.securitycenter.v1beta1.ListAssetsResponse} [response] ListAssetsResponse + * Encodes the specified GetNotificationConfigRequest message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.GetNotificationConfigRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1p1beta1.GetNotificationConfigRequest + * @static + * @param {google.cloud.securitycenter.v1p1beta1.IGetNotificationConfigRequest} message GetNotificationConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ + GetNotificationConfigRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; /** - * Calls ListAssets. - * @function listAssets - * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1beta1.IListAssetsRequest} request ListAssetsRequest message or plain object - * @param {google.cloud.securitycenter.v1beta1.SecurityCenter.ListAssetsCallback} callback Node-style callback called with the error, if any, and ListAssetsResponse - * @returns {undefined} - * @variation 1 + * Encodes the specified GetNotificationConfigRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.GetNotificationConfigRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1p1beta1.GetNotificationConfigRequest + * @static + * @param {google.cloud.securitycenter.v1p1beta1.IGetNotificationConfigRequest} message GetNotificationConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - Object.defineProperty(SecurityCenter.prototype.listAssets = function listAssets(request, callback) { - return this.rpcCall(listAssets, $root.google.cloud.securitycenter.v1beta1.ListAssetsRequest, $root.google.cloud.securitycenter.v1beta1.ListAssetsResponse, request, callback); - }, "name", { value: "ListAssets" }); + GetNotificationConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; /** - * Calls ListAssets. - * @function listAssets - * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1beta1.IListAssetsRequest} request ListAssetsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Decodes a GetNotificationConfigRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1p1beta1.GetNotificationConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1p1beta1.GetNotificationConfigRequest} GetNotificationConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ + GetNotificationConfigRequest.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.cloud.securitycenter.v1p1beta1.GetNotificationConfigRequest(); + 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; + }; /** - * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter#listFindings}. - * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter - * @typedef ListFindingsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.securitycenter.v1beta1.ListFindingsResponse} [response] ListFindingsResponse + * Decodes a GetNotificationConfigRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1p1beta1.GetNotificationConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1p1beta1.GetNotificationConfigRequest} GetNotificationConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ + GetNotificationConfigRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; /** - * Calls ListFindings. - * @function listFindings - * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1beta1.IListFindingsRequest} request ListFindingsRequest message or plain object - * @param {google.cloud.securitycenter.v1beta1.SecurityCenter.ListFindingsCallback} callback Node-style callback called with the error, if any, and ListFindingsResponse - * @returns {undefined} - * @variation 1 + * Verifies a GetNotificationConfigRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1p1beta1.GetNotificationConfigRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Object.defineProperty(SecurityCenter.prototype.listFindings = function listFindings(request, callback) { - return this.rpcCall(listFindings, $root.google.cloud.securitycenter.v1beta1.ListFindingsRequest, $root.google.cloud.securitycenter.v1beta1.ListFindingsResponse, request, callback); - }, "name", { value: "ListFindings" }); + GetNotificationConfigRequest.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; + }; /** - * Calls ListFindings. - * @function listFindings - * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1beta1.IListFindingsRequest} request ListFindingsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Creates a GetNotificationConfigRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1p1beta1.GetNotificationConfigRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1p1beta1.GetNotificationConfigRequest} GetNotificationConfigRequest */ + GetNotificationConfigRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1p1beta1.GetNotificationConfigRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1p1beta1.GetNotificationConfigRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; /** - * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter#listSources}. - * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter - * @typedef ListSourcesCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.securitycenter.v1beta1.ListSourcesResponse} [response] ListSourcesResponse + * Creates a plain object from a GetNotificationConfigRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1p1beta1.GetNotificationConfigRequest + * @static + * @param {google.cloud.securitycenter.v1p1beta1.GetNotificationConfigRequest} message GetNotificationConfigRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object */ + GetNotificationConfigRequest.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; + }; /** - * Calls ListSources. - * @function listSources - * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * Converts this GetNotificationConfigRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1p1beta1.GetNotificationConfigRequest * @instance - * @param {google.cloud.securitycenter.v1beta1.IListSourcesRequest} request ListSourcesRequest message or plain object - * @param {google.cloud.securitycenter.v1beta1.SecurityCenter.ListSourcesCallback} callback Node-style callback called with the error, if any, and ListSourcesResponse - * @returns {undefined} - * @variation 1 + * @returns {Object.} JSON object */ - Object.defineProperty(SecurityCenter.prototype.listSources = function listSources(request, callback) { - return this.rpcCall(listSources, $root.google.cloud.securitycenter.v1beta1.ListSourcesRequest, $root.google.cloud.securitycenter.v1beta1.ListSourcesResponse, request, callback); - }, "name", { value: "ListSources" }); + GetNotificationConfigRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Calls ListSources. - * @function listSources - * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1beta1.IListSourcesRequest} request ListSourcesRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ + return GetNotificationConfigRequest; + })(); + + v1p1beta1.GetOrganizationSettingsRequest = (function() { /** - * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter#runAssetDiscovery}. - * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter - * @typedef RunAssetDiscoveryCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation + * Properties of a GetOrganizationSettingsRequest. + * @memberof google.cloud.securitycenter.v1p1beta1 + * @interface IGetOrganizationSettingsRequest + * @property {string|null} [name] GetOrganizationSettingsRequest name */ /** - * Calls RunAssetDiscovery. - * @function runAssetDiscovery - * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1beta1.IRunAssetDiscoveryRequest} request RunAssetDiscoveryRequest message or plain object - * @param {google.cloud.securitycenter.v1beta1.SecurityCenter.RunAssetDiscoveryCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 + * Constructs a new GetOrganizationSettingsRequest. + * @memberof google.cloud.securitycenter.v1p1beta1 + * @classdesc Represents a GetOrganizationSettingsRequest. + * @implements IGetOrganizationSettingsRequest + * @constructor + * @param {google.cloud.securitycenter.v1p1beta1.IGetOrganizationSettingsRequest=} [properties] Properties to set */ - Object.defineProperty(SecurityCenter.prototype.runAssetDiscovery = function runAssetDiscovery(request, callback) { - return this.rpcCall(runAssetDiscovery, $root.google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "RunAssetDiscovery" }); + function GetOrganizationSettingsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } /** - * Calls RunAssetDiscovery. - * @function runAssetDiscovery - * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * GetOrganizationSettingsRequest name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1p1beta1.GetOrganizationSettingsRequest * @instance - * @param {google.cloud.securitycenter.v1beta1.IRunAssetDiscoveryRequest} request RunAssetDiscoveryRequest message or plain object - * @returns {Promise} Promise - * @variation 2 */ + GetOrganizationSettingsRequest.prototype.name = ""; /** - * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter#setFindingState}. - * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter - * @typedef SetFindingStateCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.securitycenter.v1beta1.Finding} [response] Finding + * Creates a new GetOrganizationSettingsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1p1beta1.GetOrganizationSettingsRequest + * @static + * @param {google.cloud.securitycenter.v1p1beta1.IGetOrganizationSettingsRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1p1beta1.GetOrganizationSettingsRequest} GetOrganizationSettingsRequest instance */ + GetOrganizationSettingsRequest.create = function create(properties) { + return new GetOrganizationSettingsRequest(properties); + }; /** - * Calls SetFindingState. - * @function setFindingState - * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1beta1.ISetFindingStateRequest} request SetFindingStateRequest message or plain object - * @param {google.cloud.securitycenter.v1beta1.SecurityCenter.SetFindingStateCallback} callback Node-style callback called with the error, if any, and Finding - * @returns {undefined} - * @variation 1 + * Encodes the specified GetOrganizationSettingsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.GetOrganizationSettingsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1p1beta1.GetOrganizationSettingsRequest + * @static + * @param {google.cloud.securitycenter.v1p1beta1.IGetOrganizationSettingsRequest} message GetOrganizationSettingsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - Object.defineProperty(SecurityCenter.prototype.setFindingState = function setFindingState(request, callback) { - return this.rpcCall(setFindingState, $root.google.cloud.securitycenter.v1beta1.SetFindingStateRequest, $root.google.cloud.securitycenter.v1beta1.Finding, request, callback); - }, "name", { value: "SetFindingState" }); + GetOrganizationSettingsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; /** - * Calls SetFindingState. - * @function setFindingState - * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1beta1.ISetFindingStateRequest} request SetFindingStateRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Encodes the specified GetOrganizationSettingsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.GetOrganizationSettingsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1p1beta1.GetOrganizationSettingsRequest + * @static + * @param {google.cloud.securitycenter.v1p1beta1.IGetOrganizationSettingsRequest} message GetOrganizationSettingsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ + GetOrganizationSettingsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; /** - * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter#setIamPolicy}. - * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter - * @typedef SetIamPolicyCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.iam.v1.Policy} [response] Policy + * Decodes a GetOrganizationSettingsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1p1beta1.GetOrganizationSettingsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1p1beta1.GetOrganizationSettingsRequest} GetOrganizationSettingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ + GetOrganizationSettingsRequest.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.cloud.securitycenter.v1p1beta1.GetOrganizationSettingsRequest(); + 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; + }; /** - * Calls SetIamPolicy. - * @function setIamPolicy - * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter - * @instance - * @param {google.iam.v1.ISetIamPolicyRequest} request SetIamPolicyRequest message or plain object - * @param {google.cloud.securitycenter.v1beta1.SecurityCenter.SetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy - * @returns {undefined} - * @variation 1 + * Decodes a GetOrganizationSettingsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1p1beta1.GetOrganizationSettingsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1p1beta1.GetOrganizationSettingsRequest} GetOrganizationSettingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Object.defineProperty(SecurityCenter.prototype.setIamPolicy = function setIamPolicy(request, callback) { - return this.rpcCall(setIamPolicy, $root.google.iam.v1.SetIamPolicyRequest, $root.google.iam.v1.Policy, request, callback); - }, "name", { value: "SetIamPolicy" }); + GetOrganizationSettingsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; /** - * Calls SetIamPolicy. - * @function setIamPolicy - * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter - * @instance - * @param {google.iam.v1.ISetIamPolicyRequest} request SetIamPolicyRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Verifies a GetOrganizationSettingsRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1p1beta1.GetOrganizationSettingsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not */ + GetOrganizationSettingsRequest.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; + }; /** - * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter#testIamPermissions}. - * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter - * @typedef TestIamPermissionsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.iam.v1.TestIamPermissionsResponse} [response] TestIamPermissionsResponse + * Creates a GetOrganizationSettingsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1p1beta1.GetOrganizationSettingsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1p1beta1.GetOrganizationSettingsRequest} GetOrganizationSettingsRequest */ + GetOrganizationSettingsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1p1beta1.GetOrganizationSettingsRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1p1beta1.GetOrganizationSettingsRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; /** - * Calls TestIamPermissions. - * @function testIamPermissions - * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter - * @instance - * @param {google.iam.v1.ITestIamPermissionsRequest} request TestIamPermissionsRequest message or plain object - * @param {google.cloud.securitycenter.v1beta1.SecurityCenter.TestIamPermissionsCallback} callback Node-style callback called with the error, if any, and TestIamPermissionsResponse - * @returns {undefined} - * @variation 1 + * Creates a plain object from a GetOrganizationSettingsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1p1beta1.GetOrganizationSettingsRequest + * @static + * @param {google.cloud.securitycenter.v1p1beta1.GetOrganizationSettingsRequest} message GetOrganizationSettingsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object */ - Object.defineProperty(SecurityCenter.prototype.testIamPermissions = function testIamPermissions(request, callback) { - return this.rpcCall(testIamPermissions, $root.google.iam.v1.TestIamPermissionsRequest, $root.google.iam.v1.TestIamPermissionsResponse, request, callback); - }, "name", { value: "TestIamPermissions" }); + GetOrganizationSettingsRequest.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; + }; /** - * Calls TestIamPermissions. - * @function testIamPermissions - * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * Converts this GetOrganizationSettingsRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1p1beta1.GetOrganizationSettingsRequest * @instance - * @param {google.iam.v1.ITestIamPermissionsRequest} request TestIamPermissionsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * @returns {Object.} JSON object */ + GetOrganizationSettingsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetOrganizationSettingsRequest; + })(); + + v1p1beta1.GetSourceRequest = (function() { /** - * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter#updateFinding}. - * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter - * @typedef UpdateFindingCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.securitycenter.v1beta1.Finding} [response] Finding + * Properties of a GetSourceRequest. + * @memberof google.cloud.securitycenter.v1p1beta1 + * @interface IGetSourceRequest + * @property {string|null} [name] GetSourceRequest name */ /** - * Calls UpdateFinding. - * @function updateFinding - * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1beta1.IUpdateFindingRequest} request UpdateFindingRequest message or plain object - * @param {google.cloud.securitycenter.v1beta1.SecurityCenter.UpdateFindingCallback} callback Node-style callback called with the error, if any, and Finding - * @returns {undefined} - * @variation 1 + * Constructs a new GetSourceRequest. + * @memberof google.cloud.securitycenter.v1p1beta1 + * @classdesc Represents a GetSourceRequest. + * @implements IGetSourceRequest + * @constructor + * @param {google.cloud.securitycenter.v1p1beta1.IGetSourceRequest=} [properties] Properties to set */ - Object.defineProperty(SecurityCenter.prototype.updateFinding = function updateFinding(request, callback) { - return this.rpcCall(updateFinding, $root.google.cloud.securitycenter.v1beta1.UpdateFindingRequest, $root.google.cloud.securitycenter.v1beta1.Finding, request, callback); - }, "name", { value: "UpdateFinding" }); + function GetSourceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } /** - * Calls UpdateFinding. - * @function updateFinding - * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * GetSourceRequest name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1p1beta1.GetSourceRequest * @instance - * @param {google.cloud.securitycenter.v1beta1.IUpdateFindingRequest} request UpdateFindingRequest message or plain object - * @returns {Promise} Promise - * @variation 2 */ + GetSourceRequest.prototype.name = ""; /** - * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter#updateOrganizationSettings}. - * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter - * @typedef UpdateOrganizationSettingsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.securitycenter.v1beta1.OrganizationSettings} [response] OrganizationSettings + * Creates a new GetSourceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1p1beta1.GetSourceRequest + * @static + * @param {google.cloud.securitycenter.v1p1beta1.IGetSourceRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1p1beta1.GetSourceRequest} GetSourceRequest instance */ + GetSourceRequest.create = function create(properties) { + return new GetSourceRequest(properties); + }; /** - * Calls UpdateOrganizationSettings. - * @function updateOrganizationSettings - * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1beta1.IUpdateOrganizationSettingsRequest} request UpdateOrganizationSettingsRequest message or plain object - * @param {google.cloud.securitycenter.v1beta1.SecurityCenter.UpdateOrganizationSettingsCallback} callback Node-style callback called with the error, if any, and OrganizationSettings - * @returns {undefined} - * @variation 1 + * Encodes the specified GetSourceRequest message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.GetSourceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1p1beta1.GetSourceRequest + * @static + * @param {google.cloud.securitycenter.v1p1beta1.IGetSourceRequest} message GetSourceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - Object.defineProperty(SecurityCenter.prototype.updateOrganizationSettings = function updateOrganizationSettings(request, callback) { - return this.rpcCall(updateOrganizationSettings, $root.google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest, $root.google.cloud.securitycenter.v1beta1.OrganizationSettings, request, callback); - }, "name", { value: "UpdateOrganizationSettings" }); + GetSourceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; /** - * Calls UpdateOrganizationSettings. - * @function updateOrganizationSettings - * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1beta1.IUpdateOrganizationSettingsRequest} request UpdateOrganizationSettingsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Encodes the specified GetSourceRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.GetSourceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1p1beta1.GetSourceRequest + * @static + * @param {google.cloud.securitycenter.v1p1beta1.IGetSourceRequest} message GetSourceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ + GetSourceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; /** - * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter#updateSource}. - * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter - * @typedef UpdateSourceCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.securitycenter.v1beta1.Source} [response] Source + * Decodes a GetSourceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1p1beta1.GetSourceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1p1beta1.GetSourceRequest} GetSourceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ + GetSourceRequest.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.cloud.securitycenter.v1p1beta1.GetSourceRequest(); + 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; + }; /** - * Calls UpdateSource. - * @function updateSource - * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1beta1.IUpdateSourceRequest} request UpdateSourceRequest message or plain object - * @param {google.cloud.securitycenter.v1beta1.SecurityCenter.UpdateSourceCallback} callback Node-style callback called with the error, if any, and Source - * @returns {undefined} - * @variation 1 + * Decodes a GetSourceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1p1beta1.GetSourceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1p1beta1.GetSourceRequest} GetSourceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Object.defineProperty(SecurityCenter.prototype.updateSource = function updateSource(request, callback) { - return this.rpcCall(updateSource, $root.google.cloud.securitycenter.v1beta1.UpdateSourceRequest, $root.google.cloud.securitycenter.v1beta1.Source, request, callback); - }, "name", { value: "UpdateSource" }); + GetSourceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; /** - * Calls UpdateSource. - * @function updateSource - * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1beta1.IUpdateSourceRequest} request UpdateSourceRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Verifies a GetSourceRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1p1beta1.GetSourceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not */ + GetSourceRequest.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; + }; /** - * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter#updateSecurityMarks}. - * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter - * @typedef UpdateSecurityMarksCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.securitycenter.v1beta1.SecurityMarks} [response] SecurityMarks + * Creates a GetSourceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1p1beta1.GetSourceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1p1beta1.GetSourceRequest} GetSourceRequest */ + GetSourceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1p1beta1.GetSourceRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1p1beta1.GetSourceRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; /** - * Calls UpdateSecurityMarks. - * @function updateSecurityMarks - * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1beta1.IUpdateSecurityMarksRequest} request UpdateSecurityMarksRequest message or plain object - * @param {google.cloud.securitycenter.v1beta1.SecurityCenter.UpdateSecurityMarksCallback} callback Node-style callback called with the error, if any, and SecurityMarks - * @returns {undefined} - * @variation 1 + * Creates a plain object from a GetSourceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1p1beta1.GetSourceRequest + * @static + * @param {google.cloud.securitycenter.v1p1beta1.GetSourceRequest} message GetSourceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object */ - Object.defineProperty(SecurityCenter.prototype.updateSecurityMarks = function updateSecurityMarks(request, callback) { - return this.rpcCall(updateSecurityMarks, $root.google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest, $root.google.cloud.securitycenter.v1beta1.SecurityMarks, request, callback); - }, "name", { value: "UpdateSecurityMarks" }); + GetSourceRequest.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; + }; /** - * Calls UpdateSecurityMarks. - * @function updateSecurityMarks - * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * Converts this GetSourceRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1p1beta1.GetSourceRequest * @instance - * @param {google.cloud.securitycenter.v1beta1.IUpdateSecurityMarksRequest} request UpdateSecurityMarksRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * @returns {Object.} JSON object */ + GetSourceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - return SecurityCenter; + return GetSourceRequest; })(); - v1beta1.CreateFindingRequest = (function() { + v1p1beta1.GroupAssetsRequest = (function() { /** - * Properties of a CreateFindingRequest. - * @memberof google.cloud.securitycenter.v1beta1 - * @interface ICreateFindingRequest - * @property {string|null} [parent] CreateFindingRequest parent - * @property {string|null} [findingId] CreateFindingRequest findingId - * @property {google.cloud.securitycenter.v1beta1.IFinding|null} [finding] CreateFindingRequest finding + * Properties of a GroupAssetsRequest. + * @memberof google.cloud.securitycenter.v1p1beta1 + * @interface IGroupAssetsRequest + * @property {string|null} [parent] GroupAssetsRequest parent + * @property {string|null} [filter] GroupAssetsRequest filter + * @property {string|null} [groupBy] GroupAssetsRequest groupBy + * @property {google.protobuf.IDuration|null} [compareDuration] GroupAssetsRequest compareDuration + * @property {google.protobuf.ITimestamp|null} [readTime] GroupAssetsRequest readTime + * @property {string|null} [having] GroupAssetsRequest having + * @property {string|null} [pageToken] GroupAssetsRequest pageToken + * @property {number|null} [pageSize] GroupAssetsRequest pageSize */ /** - * Constructs a new CreateFindingRequest. - * @memberof google.cloud.securitycenter.v1beta1 - * @classdesc Represents a CreateFindingRequest. - * @implements ICreateFindingRequest + * Constructs a new GroupAssetsRequest. + * @memberof google.cloud.securitycenter.v1p1beta1 + * @classdesc Represents a GroupAssetsRequest. + * @implements IGroupAssetsRequest * @constructor - * @param {google.cloud.securitycenter.v1beta1.ICreateFindingRequest=} [properties] Properties to set + * @param {google.cloud.securitycenter.v1p1beta1.IGroupAssetsRequest=} [properties] Properties to set */ - function CreateFindingRequest(properties) { + function GroupAssetsRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -12493,90 +23433,140 @@ } /** - * CreateFindingRequest parent. + * GroupAssetsRequest parent. * @member {string} parent - * @memberof google.cloud.securitycenter.v1beta1.CreateFindingRequest + * @memberof google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest * @instance */ - CreateFindingRequest.prototype.parent = ""; + GroupAssetsRequest.prototype.parent = ""; /** - * CreateFindingRequest findingId. - * @member {string} findingId - * @memberof google.cloud.securitycenter.v1beta1.CreateFindingRequest + * GroupAssetsRequest filter. + * @member {string} filter + * @memberof google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest * @instance */ - CreateFindingRequest.prototype.findingId = ""; + GroupAssetsRequest.prototype.filter = ""; /** - * CreateFindingRequest finding. - * @member {google.cloud.securitycenter.v1beta1.IFinding|null|undefined} finding - * @memberof google.cloud.securitycenter.v1beta1.CreateFindingRequest + * GroupAssetsRequest groupBy. + * @member {string} groupBy + * @memberof google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest * @instance */ - CreateFindingRequest.prototype.finding = null; + GroupAssetsRequest.prototype.groupBy = ""; /** - * Creates a new CreateFindingRequest instance using the specified properties. + * GroupAssetsRequest compareDuration. + * @member {google.protobuf.IDuration|null|undefined} compareDuration + * @memberof google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest + * @instance + */ + GroupAssetsRequest.prototype.compareDuration = null; + + /** + * GroupAssetsRequest readTime. + * @member {google.protobuf.ITimestamp|null|undefined} readTime + * @memberof google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest + * @instance + */ + GroupAssetsRequest.prototype.readTime = null; + + /** + * GroupAssetsRequest having. + * @member {string} having + * @memberof google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest + * @instance + */ + GroupAssetsRequest.prototype.having = ""; + + /** + * GroupAssetsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest + * @instance + */ + GroupAssetsRequest.prototype.pageToken = ""; + + /** + * GroupAssetsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest + * @instance + */ + GroupAssetsRequest.prototype.pageSize = 0; + + /** + * Creates a new GroupAssetsRequest instance using the specified properties. * @function create - * @memberof google.cloud.securitycenter.v1beta1.CreateFindingRequest + * @memberof google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest * @static - * @param {google.cloud.securitycenter.v1beta1.ICreateFindingRequest=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1beta1.CreateFindingRequest} CreateFindingRequest instance + * @param {google.cloud.securitycenter.v1p1beta1.IGroupAssetsRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest} GroupAssetsRequest instance */ - CreateFindingRequest.create = function create(properties) { - return new CreateFindingRequest(properties); + GroupAssetsRequest.create = function create(properties) { + return new GroupAssetsRequest(properties); }; /** - * Encodes the specified CreateFindingRequest message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.CreateFindingRequest.verify|verify} messages. + * Encodes the specified GroupAssetsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.securitycenter.v1beta1.CreateFindingRequest + * @memberof google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest * @static - * @param {google.cloud.securitycenter.v1beta1.ICreateFindingRequest} message CreateFindingRequest message or plain object to encode + * @param {google.cloud.securitycenter.v1p1beta1.IGroupAssetsRequest} message GroupAssetsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateFindingRequest.encode = function encode(message, writer) { + GroupAssetsRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.parent != null && message.hasOwnProperty("parent")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.findingId != null && message.hasOwnProperty("findingId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.findingId); - if (message.finding != null && message.hasOwnProperty("finding")) - $root.google.cloud.securitycenter.v1beta1.Finding.encode(message.finding, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.filter != null && message.hasOwnProperty("filter")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); + if (message.groupBy != null && message.hasOwnProperty("groupBy")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.groupBy); + if (message.compareDuration != null && message.hasOwnProperty("compareDuration")) + $root.google.protobuf.Duration.encode(message.compareDuration, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.readTime != null && message.hasOwnProperty("readTime")) + $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.having != null && message.hasOwnProperty("having")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.having); + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.pageToken); + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.pageSize); return writer; }; /** - * Encodes the specified CreateFindingRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.CreateFindingRequest.verify|verify} messages. + * Encodes the specified GroupAssetsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1beta1.CreateFindingRequest + * @memberof google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest * @static - * @param {google.cloud.securitycenter.v1beta1.ICreateFindingRequest} message CreateFindingRequest message or plain object to encode + * @param {google.cloud.securitycenter.v1p1beta1.IGroupAssetsRequest} message GroupAssetsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateFindingRequest.encodeDelimited = function encodeDelimited(message, writer) { + GroupAssetsRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a CreateFindingRequest message from the specified reader or buffer. + * Decodes a GroupAssetsRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.securitycenter.v1beta1.CreateFindingRequest + * @memberof google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1beta1.CreateFindingRequest} CreateFindingRequest + * @returns {google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest} GroupAssetsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateFindingRequest.decode = function decode(reader, length) { + GroupAssetsRequest.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.cloud.securitycenter.v1beta1.CreateFindingRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -12584,10 +23574,25 @@ message.parent = reader.string(); break; case 2: - message.findingId = reader.string(); + message.filter = reader.string(); break; case 3: - message.finding = $root.google.cloud.securitycenter.v1beta1.Finding.decode(reader, reader.uint32()); + message.groupBy = reader.string(); + break; + case 4: + message.compareDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + case 5: + message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 6: + message.having = reader.string(); + break; + case 7: + message.pageToken = reader.string(); + break; + case 8: + message.pageSize = reader.int32(); break; default: reader.skipType(tag & 7); @@ -12598,130 +23603,178 @@ }; /** - * Decodes a CreateFindingRequest message from the specified reader or buffer, length delimited. + * Decodes a GroupAssetsRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1beta1.CreateFindingRequest + * @memberof google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1beta1.CreateFindingRequest} CreateFindingRequest + * @returns {google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest} GroupAssetsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateFindingRequest.decodeDelimited = function decodeDelimited(reader) { + GroupAssetsRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a CreateFindingRequest message. + * Verifies a GroupAssetsRequest message. * @function verify - * @memberof google.cloud.securitycenter.v1beta1.CreateFindingRequest + * @memberof google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - CreateFindingRequest.verify = function verify(message) { + GroupAssetsRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.parent != null && message.hasOwnProperty("parent")) if (!$util.isString(message.parent)) return "parent: string expected"; - if (message.findingId != null && message.hasOwnProperty("findingId")) - if (!$util.isString(message.findingId)) - return "findingId: string expected"; - if (message.finding != null && message.hasOwnProperty("finding")) { - var error = $root.google.cloud.securitycenter.v1beta1.Finding.verify(message.finding); + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.groupBy != null && message.hasOwnProperty("groupBy")) + if (!$util.isString(message.groupBy)) + return "groupBy: string expected"; + if (message.compareDuration != null && message.hasOwnProperty("compareDuration")) { + var error = $root.google.protobuf.Duration.verify(message.compareDuration); if (error) - return "finding." + error; + return "compareDuration." + error; + } + if (message.readTime != null && message.hasOwnProperty("readTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.readTime); + if (error) + return "readTime." + error; } + if (message.having != null && message.hasOwnProperty("having")) + if (!$util.isString(message.having)) + return "having: string expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; return null; }; /** - * Creates a CreateFindingRequest message from a plain object. Also converts values to their respective internal types. + * Creates a GroupAssetsRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.securitycenter.v1beta1.CreateFindingRequest + * @memberof google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1beta1.CreateFindingRequest} CreateFindingRequest + * @returns {google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest} GroupAssetsRequest */ - CreateFindingRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1beta1.CreateFindingRequest) + GroupAssetsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest) return object; - var message = new $root.google.cloud.securitycenter.v1beta1.CreateFindingRequest(); + var message = new $root.google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest(); if (object.parent != null) message.parent = String(object.parent); - if (object.findingId != null) - message.findingId = String(object.findingId); - if (object.finding != null) { - if (typeof object.finding !== "object") - throw TypeError(".google.cloud.securitycenter.v1beta1.CreateFindingRequest.finding: object expected"); - message.finding = $root.google.cloud.securitycenter.v1beta1.Finding.fromObject(object.finding); + if (object.filter != null) + message.filter = String(object.filter); + if (object.groupBy != null) + message.groupBy = String(object.groupBy); + if (object.compareDuration != null) { + if (typeof object.compareDuration !== "object") + throw TypeError(".google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest.compareDuration: object expected"); + message.compareDuration = $root.google.protobuf.Duration.fromObject(object.compareDuration); + } + if (object.readTime != null) { + if (typeof object.readTime !== "object") + throw TypeError(".google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest.readTime: object expected"); + message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); } + if (object.having != null) + message.having = String(object.having); + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; return message; }; /** - * Creates a plain object from a CreateFindingRequest message. Also converts values to other types if specified. + * Creates a plain object from a GroupAssetsRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.securitycenter.v1beta1.CreateFindingRequest + * @memberof google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest * @static - * @param {google.cloud.securitycenter.v1beta1.CreateFindingRequest} message CreateFindingRequest + * @param {google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest} message GroupAssetsRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CreateFindingRequest.toObject = function toObject(message, options) { + GroupAssetsRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { object.parent = ""; - object.findingId = ""; - object.finding = null; + object.filter = ""; + object.groupBy = ""; + object.compareDuration = null; + object.readTime = null; + object.having = ""; + object.pageToken = ""; + object.pageSize = 0; } if (message.parent != null && message.hasOwnProperty("parent")) object.parent = message.parent; - if (message.findingId != null && message.hasOwnProperty("findingId")) - object.findingId = message.findingId; - if (message.finding != null && message.hasOwnProperty("finding")) - object.finding = $root.google.cloud.securitycenter.v1beta1.Finding.toObject(message.finding, options); + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.groupBy != null && message.hasOwnProperty("groupBy")) + object.groupBy = message.groupBy; + if (message.compareDuration != null && message.hasOwnProperty("compareDuration")) + object.compareDuration = $root.google.protobuf.Duration.toObject(message.compareDuration, options); + if (message.readTime != null && message.hasOwnProperty("readTime")) + object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); + if (message.having != null && message.hasOwnProperty("having")) + object.having = message.having; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; return object; }; /** - * Converts this CreateFindingRequest to JSON. + * Converts this GroupAssetsRequest to JSON. * @function toJSON - * @memberof google.cloud.securitycenter.v1beta1.CreateFindingRequest + * @memberof google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest * @instance * @returns {Object.} JSON object */ - CreateFindingRequest.prototype.toJSON = function toJSON() { + GroupAssetsRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return CreateFindingRequest; + return GroupAssetsRequest; })(); - v1beta1.CreateSourceRequest = (function() { + v1p1beta1.GroupAssetsResponse = (function() { /** - * Properties of a CreateSourceRequest. - * @memberof google.cloud.securitycenter.v1beta1 - * @interface ICreateSourceRequest - * @property {string|null} [parent] CreateSourceRequest parent - * @property {google.cloud.securitycenter.v1beta1.ISource|null} [source] CreateSourceRequest source + * Properties of a GroupAssetsResponse. + * @memberof google.cloud.securitycenter.v1p1beta1 + * @interface IGroupAssetsResponse + * @property {Array.|null} [groupByResults] GroupAssetsResponse groupByResults + * @property {google.protobuf.ITimestamp|null} [readTime] GroupAssetsResponse readTime + * @property {string|null} [nextPageToken] GroupAssetsResponse nextPageToken + * @property {number|null} [totalSize] GroupAssetsResponse totalSize */ /** - * Constructs a new CreateSourceRequest. - * @memberof google.cloud.securitycenter.v1beta1 - * @classdesc Represents a CreateSourceRequest. - * @implements ICreateSourceRequest + * Constructs a new GroupAssetsResponse. + * @memberof google.cloud.securitycenter.v1p1beta1 + * @classdesc Represents a GroupAssetsResponse. + * @implements IGroupAssetsResponse * @constructor - * @param {google.cloud.securitycenter.v1beta1.ICreateSourceRequest=} [properties] Properties to set + * @param {google.cloud.securitycenter.v1p1beta1.IGroupAssetsResponse=} [properties] Properties to set */ - function CreateSourceRequest(properties) { + function GroupAssetsResponse(properties) { + this.groupByResults = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -12729,88 +23782,117 @@ } /** - * CreateSourceRequest parent. - * @member {string} parent - * @memberof google.cloud.securitycenter.v1beta1.CreateSourceRequest + * GroupAssetsResponse groupByResults. + * @member {Array.} groupByResults + * @memberof google.cloud.securitycenter.v1p1beta1.GroupAssetsResponse * @instance */ - CreateSourceRequest.prototype.parent = ""; + GroupAssetsResponse.prototype.groupByResults = $util.emptyArray; /** - * CreateSourceRequest source. - * @member {google.cloud.securitycenter.v1beta1.ISource|null|undefined} source - * @memberof google.cloud.securitycenter.v1beta1.CreateSourceRequest + * GroupAssetsResponse readTime. + * @member {google.protobuf.ITimestamp|null|undefined} readTime + * @memberof google.cloud.securitycenter.v1p1beta1.GroupAssetsResponse * @instance */ - CreateSourceRequest.prototype.source = null; + GroupAssetsResponse.prototype.readTime = null; /** - * Creates a new CreateSourceRequest instance using the specified properties. + * GroupAssetsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.securitycenter.v1p1beta1.GroupAssetsResponse + * @instance + */ + GroupAssetsResponse.prototype.nextPageToken = ""; + + /** + * GroupAssetsResponse totalSize. + * @member {number} totalSize + * @memberof google.cloud.securitycenter.v1p1beta1.GroupAssetsResponse + * @instance + */ + GroupAssetsResponse.prototype.totalSize = 0; + + /** + * Creates a new GroupAssetsResponse instance using the specified properties. * @function create - * @memberof google.cloud.securitycenter.v1beta1.CreateSourceRequest + * @memberof google.cloud.securitycenter.v1p1beta1.GroupAssetsResponse * @static - * @param {google.cloud.securitycenter.v1beta1.ICreateSourceRequest=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1beta1.CreateSourceRequest} CreateSourceRequest instance + * @param {google.cloud.securitycenter.v1p1beta1.IGroupAssetsResponse=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1p1beta1.GroupAssetsResponse} GroupAssetsResponse instance */ - CreateSourceRequest.create = function create(properties) { - return new CreateSourceRequest(properties); + GroupAssetsResponse.create = function create(properties) { + return new GroupAssetsResponse(properties); }; /** - * Encodes the specified CreateSourceRequest message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.CreateSourceRequest.verify|verify} messages. + * Encodes the specified GroupAssetsResponse message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.GroupAssetsResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.securitycenter.v1beta1.CreateSourceRequest + * @memberof google.cloud.securitycenter.v1p1beta1.GroupAssetsResponse * @static - * @param {google.cloud.securitycenter.v1beta1.ICreateSourceRequest} message CreateSourceRequest message or plain object to encode + * @param {google.cloud.securitycenter.v1p1beta1.IGroupAssetsResponse} message GroupAssetsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateSourceRequest.encode = function encode(message, writer) { + GroupAssetsResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && message.hasOwnProperty("parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.source != null && message.hasOwnProperty("source")) - $root.google.cloud.securitycenter.v1beta1.Source.encode(message.source, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.groupByResults != null && message.groupByResults.length) + for (var i = 0; i < message.groupByResults.length; ++i) + $root.google.cloud.securitycenter.v1p1beta1.GroupResult.encode(message.groupByResults[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.readTime != null && message.hasOwnProperty("readTime")) + $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.nextPageToken); + if (message.totalSize != null && message.hasOwnProperty("totalSize")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.totalSize); return writer; }; /** - * Encodes the specified CreateSourceRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.CreateSourceRequest.verify|verify} messages. + * Encodes the specified GroupAssetsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.GroupAssetsResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1beta1.CreateSourceRequest + * @memberof google.cloud.securitycenter.v1p1beta1.GroupAssetsResponse * @static - * @param {google.cloud.securitycenter.v1beta1.ICreateSourceRequest} message CreateSourceRequest message or plain object to encode + * @param {google.cloud.securitycenter.v1p1beta1.IGroupAssetsResponse} message GroupAssetsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateSourceRequest.encodeDelimited = function encodeDelimited(message, writer) { + GroupAssetsResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a CreateSourceRequest message from the specified reader or buffer. + * Decodes a GroupAssetsResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.securitycenter.v1beta1.CreateSourceRequest + * @memberof google.cloud.securitycenter.v1p1beta1.GroupAssetsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1beta1.CreateSourceRequest} CreateSourceRequest + * @returns {google.cloud.securitycenter.v1p1beta1.GroupAssetsResponse} GroupAssetsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateSourceRequest.decode = function decode(reader, length) { + GroupAssetsResponse.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.cloud.securitycenter.v1beta1.CreateSourceRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1p1beta1.GroupAssetsResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.parent = reader.string(); + if (!(message.groupByResults && message.groupByResults.length)) + message.groupByResults = []; + message.groupByResults.push($root.google.cloud.securitycenter.v1p1beta1.GroupResult.decode(reader, reader.uint32())); break; case 2: - message.source = $root.google.cloud.securitycenter.v1beta1.Source.decode(reader, reader.uint32()); + message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 3: + message.nextPageToken = reader.string(); + break; + case 4: + message.totalSize = reader.int32(); break; default: reader.skipType(tag & 7); @@ -12821,197 +23903,329 @@ }; /** - * Decodes a CreateSourceRequest message from the specified reader or buffer, length delimited. + * Decodes a GroupAssetsResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1beta1.CreateSourceRequest + * @memberof google.cloud.securitycenter.v1p1beta1.GroupAssetsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1beta1.CreateSourceRequest} CreateSourceRequest + * @returns {google.cloud.securitycenter.v1p1beta1.GroupAssetsResponse} GroupAssetsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateSourceRequest.decodeDelimited = function decodeDelimited(reader) { + GroupAssetsResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a CreateSourceRequest message. + * Verifies a GroupAssetsResponse message. * @function verify - * @memberof google.cloud.securitycenter.v1beta1.CreateSourceRequest + * @memberof google.cloud.securitycenter.v1p1beta1.GroupAssetsResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - CreateSourceRequest.verify = function verify(message) { + GroupAssetsResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.source != null && message.hasOwnProperty("source")) { - var error = $root.google.cloud.securitycenter.v1beta1.Source.verify(message.source); + if (message.groupByResults != null && message.hasOwnProperty("groupByResults")) { + if (!Array.isArray(message.groupByResults)) + return "groupByResults: array expected"; + for (var i = 0; i < message.groupByResults.length; ++i) { + var error = $root.google.cloud.securitycenter.v1p1beta1.GroupResult.verify(message.groupByResults[i]); + if (error) + return "groupByResults." + error; + } + } + if (message.readTime != null && message.hasOwnProperty("readTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.readTime); if (error) - return "source." + error; + return "readTime." + error; } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.totalSize != null && message.hasOwnProperty("totalSize")) + if (!$util.isInteger(message.totalSize)) + return "totalSize: integer expected"; return null; }; /** - * Creates a CreateSourceRequest message from a plain object. Also converts values to their respective internal types. + * Creates a GroupAssetsResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.securitycenter.v1beta1.CreateSourceRequest + * @memberof google.cloud.securitycenter.v1p1beta1.GroupAssetsResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1beta1.CreateSourceRequest} CreateSourceRequest + * @returns {google.cloud.securitycenter.v1p1beta1.GroupAssetsResponse} GroupAssetsResponse */ - CreateSourceRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1beta1.CreateSourceRequest) + GroupAssetsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1p1beta1.GroupAssetsResponse) return object; - var message = new $root.google.cloud.securitycenter.v1beta1.CreateSourceRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.source != null) { - if (typeof object.source !== "object") - throw TypeError(".google.cloud.securitycenter.v1beta1.CreateSourceRequest.source: object expected"); - message.source = $root.google.cloud.securitycenter.v1beta1.Source.fromObject(object.source); + var message = new $root.google.cloud.securitycenter.v1p1beta1.GroupAssetsResponse(); + if (object.groupByResults) { + if (!Array.isArray(object.groupByResults)) + throw TypeError(".google.cloud.securitycenter.v1p1beta1.GroupAssetsResponse.groupByResults: array expected"); + message.groupByResults = []; + for (var i = 0; i < object.groupByResults.length; ++i) { + if (typeof object.groupByResults[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v1p1beta1.GroupAssetsResponse.groupByResults: object expected"); + message.groupByResults[i] = $root.google.cloud.securitycenter.v1p1beta1.GroupResult.fromObject(object.groupByResults[i]); + } + } + if (object.readTime != null) { + if (typeof object.readTime !== "object") + throw TypeError(".google.cloud.securitycenter.v1p1beta1.GroupAssetsResponse.readTime: object expected"); + message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.totalSize != null) + message.totalSize = object.totalSize | 0; return message; }; /** - * Creates a plain object from a CreateSourceRequest message. Also converts values to other types if specified. + * Creates a plain object from a GroupAssetsResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.securitycenter.v1beta1.CreateSourceRequest + * @memberof google.cloud.securitycenter.v1p1beta1.GroupAssetsResponse * @static - * @param {google.cloud.securitycenter.v1beta1.CreateSourceRequest} message CreateSourceRequest + * @param {google.cloud.securitycenter.v1p1beta1.GroupAssetsResponse} message GroupAssetsResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CreateSourceRequest.toObject = function toObject(message, options) { + GroupAssetsResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) + object.groupByResults = []; if (options.defaults) { - object.parent = ""; - object.source = null; + object.readTime = null; + object.nextPageToken = ""; + object.totalSize = 0; } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.source != null && message.hasOwnProperty("source")) - object.source = $root.google.cloud.securitycenter.v1beta1.Source.toObject(message.source, options); + if (message.groupByResults && message.groupByResults.length) { + object.groupByResults = []; + for (var j = 0; j < message.groupByResults.length; ++j) + object.groupByResults[j] = $root.google.cloud.securitycenter.v1p1beta1.GroupResult.toObject(message.groupByResults[j], options); + } + if (message.readTime != null && message.hasOwnProperty("readTime")) + object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.totalSize != null && message.hasOwnProperty("totalSize")) + object.totalSize = message.totalSize; return object; }; /** - * Converts this CreateSourceRequest to JSON. + * Converts this GroupAssetsResponse to JSON. * @function toJSON - * @memberof google.cloud.securitycenter.v1beta1.CreateSourceRequest + * @memberof google.cloud.securitycenter.v1p1beta1.GroupAssetsResponse + * @instance + * @returns {Object.} JSON object + */ + GroupAssetsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GroupAssetsResponse; + })(); + + v1p1beta1.GroupFindingsRequest = (function() { + + /** + * Properties of a GroupFindingsRequest. + * @memberof google.cloud.securitycenter.v1p1beta1 + * @interface IGroupFindingsRequest + * @property {string|null} [parent] GroupFindingsRequest parent + * @property {string|null} [filter] GroupFindingsRequest filter + * @property {string|null} [groupBy] GroupFindingsRequest groupBy + * @property {google.protobuf.ITimestamp|null} [readTime] GroupFindingsRequest readTime + * @property {google.protobuf.IDuration|null} [compareDuration] GroupFindingsRequest compareDuration + * @property {string|null} [having] GroupFindingsRequest having + * @property {string|null} [pageToken] GroupFindingsRequest pageToken + * @property {number|null} [pageSize] GroupFindingsRequest pageSize + */ + + /** + * Constructs a new GroupFindingsRequest. + * @memberof google.cloud.securitycenter.v1p1beta1 + * @classdesc Represents a GroupFindingsRequest. + * @implements IGroupFindingsRequest + * @constructor + * @param {google.cloud.securitycenter.v1p1beta1.IGroupFindingsRequest=} [properties] Properties to set + */ + function GroupFindingsRequest(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]]; + } + + /** + * GroupFindingsRequest parent. + * @member {string} parent + * @memberof google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest + * @instance + */ + GroupFindingsRequest.prototype.parent = ""; + + /** + * GroupFindingsRequest filter. + * @member {string} filter + * @memberof google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest + * @instance + */ + GroupFindingsRequest.prototype.filter = ""; + + /** + * GroupFindingsRequest groupBy. + * @member {string} groupBy + * @memberof google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest + * @instance + */ + GroupFindingsRequest.prototype.groupBy = ""; + + /** + * GroupFindingsRequest readTime. + * @member {google.protobuf.ITimestamp|null|undefined} readTime + * @memberof google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest + * @instance + */ + GroupFindingsRequest.prototype.readTime = null; + + /** + * GroupFindingsRequest compareDuration. + * @member {google.protobuf.IDuration|null|undefined} compareDuration + * @memberof google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest * @instance - * @returns {Object.} JSON object */ - CreateSourceRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return CreateSourceRequest; - })(); - - v1beta1.GetOrganizationSettingsRequest = (function() { + GroupFindingsRequest.prototype.compareDuration = null; /** - * Properties of a GetOrganizationSettingsRequest. - * @memberof google.cloud.securitycenter.v1beta1 - * @interface IGetOrganizationSettingsRequest - * @property {string|null} [name] GetOrganizationSettingsRequest name + * GroupFindingsRequest having. + * @member {string} having + * @memberof google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest + * @instance */ + GroupFindingsRequest.prototype.having = ""; /** - * Constructs a new GetOrganizationSettingsRequest. - * @memberof google.cloud.securitycenter.v1beta1 - * @classdesc Represents a GetOrganizationSettingsRequest. - * @implements IGetOrganizationSettingsRequest - * @constructor - * @param {google.cloud.securitycenter.v1beta1.IGetOrganizationSettingsRequest=} [properties] Properties to set + * GroupFindingsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest + * @instance */ - function GetOrganizationSettingsRequest(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]]; - } + GroupFindingsRequest.prototype.pageToken = ""; /** - * GetOrganizationSettingsRequest name. - * @member {string} name - * @memberof google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest + * GroupFindingsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest * @instance */ - GetOrganizationSettingsRequest.prototype.name = ""; + GroupFindingsRequest.prototype.pageSize = 0; /** - * Creates a new GetOrganizationSettingsRequest instance using the specified properties. + * Creates a new GroupFindingsRequest instance using the specified properties. * @function create - * @memberof google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest + * @memberof google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest * @static - * @param {google.cloud.securitycenter.v1beta1.IGetOrganizationSettingsRequest=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest} GetOrganizationSettingsRequest instance + * @param {google.cloud.securitycenter.v1p1beta1.IGroupFindingsRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest} GroupFindingsRequest instance */ - GetOrganizationSettingsRequest.create = function create(properties) { - return new GetOrganizationSettingsRequest(properties); + GroupFindingsRequest.create = function create(properties) { + return new GroupFindingsRequest(properties); }; /** - * Encodes the specified GetOrganizationSettingsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest.verify|verify} messages. + * Encodes the specified GroupFindingsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest + * @memberof google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest * @static - * @param {google.cloud.securitycenter.v1beta1.IGetOrganizationSettingsRequest} message GetOrganizationSettingsRequest message or plain object to encode + * @param {google.cloud.securitycenter.v1p1beta1.IGroupFindingsRequest} message GroupFindingsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetOrganizationSettingsRequest.encode = function encode(message, writer) { + GroupFindingsRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.parent != null && message.hasOwnProperty("parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.filter != null && message.hasOwnProperty("filter")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); + if (message.groupBy != null && message.hasOwnProperty("groupBy")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.groupBy); + if (message.readTime != null && message.hasOwnProperty("readTime")) + $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.compareDuration != null && message.hasOwnProperty("compareDuration")) + $root.google.protobuf.Duration.encode(message.compareDuration, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.having != null && message.hasOwnProperty("having")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.having); + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.pageToken); + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.pageSize); return writer; }; /** - * Encodes the specified GetOrganizationSettingsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest.verify|verify} messages. + * Encodes the specified GroupFindingsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest + * @memberof google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest * @static - * @param {google.cloud.securitycenter.v1beta1.IGetOrganizationSettingsRequest} message GetOrganizationSettingsRequest message or plain object to encode + * @param {google.cloud.securitycenter.v1p1beta1.IGroupFindingsRequest} message GroupFindingsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetOrganizationSettingsRequest.encodeDelimited = function encodeDelimited(message, writer) { + GroupFindingsRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GetOrganizationSettingsRequest message from the specified reader or buffer. + * Decodes a GroupFindingsRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest + * @memberof google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest} GetOrganizationSettingsRequest + * @returns {google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest} GroupFindingsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetOrganizationSettingsRequest.decode = function decode(reader, length) { + GroupFindingsRequest.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.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.name = reader.string(); + message.parent = reader.string(); + break; + case 2: + message.filter = reader.string(); + break; + case 3: + message.groupBy = reader.string(); + break; + case 4: + message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 5: + message.compareDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + case 6: + message.having = reader.string(); + break; + case 7: + message.pageToken = reader.string(); + break; + case 8: + message.pageSize = reader.int32(); break; default: reader.skipType(tag & 7); @@ -13022,107 +24236,178 @@ }; /** - * Decodes a GetOrganizationSettingsRequest message from the specified reader or buffer, length delimited. + * Decodes a GroupFindingsRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest + * @memberof google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest} GetOrganizationSettingsRequest + * @returns {google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest} GroupFindingsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetOrganizationSettingsRequest.decodeDelimited = function decodeDelimited(reader) { + GroupFindingsRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GetOrganizationSettingsRequest message. + * Verifies a GroupFindingsRequest message. * @function verify - * @memberof google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest + * @memberof google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GetOrganizationSettingsRequest.verify = function verify(message) { + GroupFindingsRequest.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.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.groupBy != null && message.hasOwnProperty("groupBy")) + if (!$util.isString(message.groupBy)) + return "groupBy: string expected"; + if (message.readTime != null && message.hasOwnProperty("readTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.readTime); + if (error) + return "readTime." + error; + } + if (message.compareDuration != null && message.hasOwnProperty("compareDuration")) { + var error = $root.google.protobuf.Duration.verify(message.compareDuration); + if (error) + return "compareDuration." + error; + } + if (message.having != null && message.hasOwnProperty("having")) + if (!$util.isString(message.having)) + return "having: string expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; return null; }; /** - * Creates a GetOrganizationSettingsRequest message from a plain object. Also converts values to their respective internal types. + * Creates a GroupFindingsRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest + * @memberof google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest} GetOrganizationSettingsRequest + * @returns {google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest} GroupFindingsRequest */ - GetOrganizationSettingsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest) + GroupFindingsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest) return object; - var message = new $root.google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest(); - if (object.name != null) - message.name = String(object.name); + var message = new $root.google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.filter != null) + message.filter = String(object.filter); + if (object.groupBy != null) + message.groupBy = String(object.groupBy); + if (object.readTime != null) { + if (typeof object.readTime !== "object") + throw TypeError(".google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest.readTime: object expected"); + message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); + } + if (object.compareDuration != null) { + if (typeof object.compareDuration !== "object") + throw TypeError(".google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest.compareDuration: object expected"); + message.compareDuration = $root.google.protobuf.Duration.fromObject(object.compareDuration); + } + if (object.having != null) + message.having = String(object.having); + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; return message; }; /** - * Creates a plain object from a GetOrganizationSettingsRequest message. Also converts values to other types if specified. + * Creates a plain object from a GroupFindingsRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest + * @memberof google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest * @static - * @param {google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest} message GetOrganizationSettingsRequest + * @param {google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest} message GroupFindingsRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GetOrganizationSettingsRequest.toObject = function toObject(message, options) { + GroupFindingsRequest.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 (options.defaults) { + object.parent = ""; + object.filter = ""; + object.groupBy = ""; + object.readTime = null; + object.compareDuration = null; + object.having = ""; + object.pageToken = ""; + object.pageSize = 0; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.groupBy != null && message.hasOwnProperty("groupBy")) + object.groupBy = message.groupBy; + if (message.readTime != null && message.hasOwnProperty("readTime")) + object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); + if (message.compareDuration != null && message.hasOwnProperty("compareDuration")) + object.compareDuration = $root.google.protobuf.Duration.toObject(message.compareDuration, options); + if (message.having != null && message.hasOwnProperty("having")) + object.having = message.having; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; return object; }; /** - * Converts this GetOrganizationSettingsRequest to JSON. + * Converts this GroupFindingsRequest to JSON. * @function toJSON - * @memberof google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest + * @memberof google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest * @instance * @returns {Object.} JSON object */ - GetOrganizationSettingsRequest.prototype.toJSON = function toJSON() { + GroupFindingsRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return GetOrganizationSettingsRequest; + return GroupFindingsRequest; })(); - v1beta1.GetSourceRequest = (function() { + v1p1beta1.GroupFindingsResponse = (function() { /** - * Properties of a GetSourceRequest. - * @memberof google.cloud.securitycenter.v1beta1 - * @interface IGetSourceRequest - * @property {string|null} [name] GetSourceRequest name + * Properties of a GroupFindingsResponse. + * @memberof google.cloud.securitycenter.v1p1beta1 + * @interface IGroupFindingsResponse + * @property {Array.|null} [groupByResults] GroupFindingsResponse groupByResults + * @property {google.protobuf.ITimestamp|null} [readTime] GroupFindingsResponse readTime + * @property {string|null} [nextPageToken] GroupFindingsResponse nextPageToken + * @property {number|null} [totalSize] GroupFindingsResponse totalSize */ /** - * Constructs a new GetSourceRequest. - * @memberof google.cloud.securitycenter.v1beta1 - * @classdesc Represents a GetSourceRequest. - * @implements IGetSourceRequest + * Constructs a new GroupFindingsResponse. + * @memberof google.cloud.securitycenter.v1p1beta1 + * @classdesc Represents a GroupFindingsResponse. + * @implements IGroupFindingsResponse * @constructor - * @param {google.cloud.securitycenter.v1beta1.IGetSourceRequest=} [properties] Properties to set + * @param {google.cloud.securitycenter.v1p1beta1.IGroupFindingsResponse=} [properties] Properties to set */ - function GetSourceRequest(properties) { + function GroupFindingsResponse(properties) { + this.groupByResults = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -13130,75 +24415,117 @@ } /** - * GetSourceRequest name. - * @member {string} name - * @memberof google.cloud.securitycenter.v1beta1.GetSourceRequest + * GroupFindingsResponse groupByResults. + * @member {Array.} groupByResults + * @memberof google.cloud.securitycenter.v1p1beta1.GroupFindingsResponse + * @instance + */ + GroupFindingsResponse.prototype.groupByResults = $util.emptyArray; + + /** + * GroupFindingsResponse readTime. + * @member {google.protobuf.ITimestamp|null|undefined} readTime + * @memberof google.cloud.securitycenter.v1p1beta1.GroupFindingsResponse + * @instance + */ + GroupFindingsResponse.prototype.readTime = null; + + /** + * GroupFindingsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.securitycenter.v1p1beta1.GroupFindingsResponse + * @instance + */ + GroupFindingsResponse.prototype.nextPageToken = ""; + + /** + * GroupFindingsResponse totalSize. + * @member {number} totalSize + * @memberof google.cloud.securitycenter.v1p1beta1.GroupFindingsResponse * @instance */ - GetSourceRequest.prototype.name = ""; + GroupFindingsResponse.prototype.totalSize = 0; /** - * Creates a new GetSourceRequest instance using the specified properties. + * Creates a new GroupFindingsResponse instance using the specified properties. * @function create - * @memberof google.cloud.securitycenter.v1beta1.GetSourceRequest + * @memberof google.cloud.securitycenter.v1p1beta1.GroupFindingsResponse * @static - * @param {google.cloud.securitycenter.v1beta1.IGetSourceRequest=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1beta1.GetSourceRequest} GetSourceRequest instance + * @param {google.cloud.securitycenter.v1p1beta1.IGroupFindingsResponse=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1p1beta1.GroupFindingsResponse} GroupFindingsResponse instance */ - GetSourceRequest.create = function create(properties) { - return new GetSourceRequest(properties); + GroupFindingsResponse.create = function create(properties) { + return new GroupFindingsResponse(properties); }; /** - * Encodes the specified GetSourceRequest message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.GetSourceRequest.verify|verify} messages. + * Encodes the specified GroupFindingsResponse message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.GroupFindingsResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.securitycenter.v1beta1.GetSourceRequest + * @memberof google.cloud.securitycenter.v1p1beta1.GroupFindingsResponse * @static - * @param {google.cloud.securitycenter.v1beta1.IGetSourceRequest} message GetSourceRequest message or plain object to encode + * @param {google.cloud.securitycenter.v1p1beta1.IGroupFindingsResponse} message GroupFindingsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetSourceRequest.encode = function encode(message, writer) { + GroupFindingsResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.groupByResults != null && message.groupByResults.length) + for (var i = 0; i < message.groupByResults.length; ++i) + $root.google.cloud.securitycenter.v1p1beta1.GroupResult.encode(message.groupByResults[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.readTime != null && message.hasOwnProperty("readTime")) + $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.nextPageToken); + if (message.totalSize != null && message.hasOwnProperty("totalSize")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.totalSize); return writer; }; /** - * Encodes the specified GetSourceRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.GetSourceRequest.verify|verify} messages. + * Encodes the specified GroupFindingsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.GroupFindingsResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1beta1.GetSourceRequest + * @memberof google.cloud.securitycenter.v1p1beta1.GroupFindingsResponse * @static - * @param {google.cloud.securitycenter.v1beta1.IGetSourceRequest} message GetSourceRequest message or plain object to encode + * @param {google.cloud.securitycenter.v1p1beta1.IGroupFindingsResponse} message GroupFindingsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetSourceRequest.encodeDelimited = function encodeDelimited(message, writer) { + GroupFindingsResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GetSourceRequest message from the specified reader or buffer. + * Decodes a GroupFindingsResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.securitycenter.v1beta1.GetSourceRequest + * @memberof google.cloud.securitycenter.v1p1beta1.GroupFindingsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1beta1.GetSourceRequest} GetSourceRequest + * @returns {google.cloud.securitycenter.v1p1beta1.GroupFindingsResponse} GroupFindingsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetSourceRequest.decode = function decode(reader, length) { + GroupFindingsResponse.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.cloud.securitycenter.v1beta1.GetSourceRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1p1beta1.GroupFindingsResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.name = reader.string(); + if (!(message.groupByResults && message.groupByResults.length)) + message.groupByResults = []; + message.groupByResults.push($root.google.cloud.securitycenter.v1p1beta1.GroupResult.decode(reader, reader.uint32())); + break; + case 2: + message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 3: + message.nextPageToken = reader.string(); + break; + case 4: + message.totalSize = reader.int32(); break; default: reader.skipType(tag & 7); @@ -13209,113 +24536,157 @@ }; /** - * Decodes a GetSourceRequest message from the specified reader or buffer, length delimited. + * Decodes a GroupFindingsResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1beta1.GetSourceRequest + * @memberof google.cloud.securitycenter.v1p1beta1.GroupFindingsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1beta1.GetSourceRequest} GetSourceRequest + * @returns {google.cloud.securitycenter.v1p1beta1.GroupFindingsResponse} GroupFindingsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetSourceRequest.decodeDelimited = function decodeDelimited(reader) { + GroupFindingsResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GetSourceRequest message. + * Verifies a GroupFindingsResponse message. * @function verify - * @memberof google.cloud.securitycenter.v1beta1.GetSourceRequest + * @memberof google.cloud.securitycenter.v1p1beta1.GroupFindingsResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GetSourceRequest.verify = function verify(message) { + GroupFindingsResponse.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.groupByResults != null && message.hasOwnProperty("groupByResults")) { + if (!Array.isArray(message.groupByResults)) + return "groupByResults: array expected"; + for (var i = 0; i < message.groupByResults.length; ++i) { + var error = $root.google.cloud.securitycenter.v1p1beta1.GroupResult.verify(message.groupByResults[i]); + if (error) + return "groupByResults." + error; + } + } + if (message.readTime != null && message.hasOwnProperty("readTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.readTime); + if (error) + return "readTime." + error; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.totalSize != null && message.hasOwnProperty("totalSize")) + if (!$util.isInteger(message.totalSize)) + return "totalSize: integer expected"; return null; }; /** - * Creates a GetSourceRequest message from a plain object. Also converts values to their respective internal types. + * Creates a GroupFindingsResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.securitycenter.v1beta1.GetSourceRequest + * @memberof google.cloud.securitycenter.v1p1beta1.GroupFindingsResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1beta1.GetSourceRequest} GetSourceRequest + * @returns {google.cloud.securitycenter.v1p1beta1.GroupFindingsResponse} GroupFindingsResponse */ - GetSourceRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1beta1.GetSourceRequest) + GroupFindingsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1p1beta1.GroupFindingsResponse) return object; - var message = new $root.google.cloud.securitycenter.v1beta1.GetSourceRequest(); - if (object.name != null) - message.name = String(object.name); + var message = new $root.google.cloud.securitycenter.v1p1beta1.GroupFindingsResponse(); + if (object.groupByResults) { + if (!Array.isArray(object.groupByResults)) + throw TypeError(".google.cloud.securitycenter.v1p1beta1.GroupFindingsResponse.groupByResults: array expected"); + message.groupByResults = []; + for (var i = 0; i < object.groupByResults.length; ++i) { + if (typeof object.groupByResults[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v1p1beta1.GroupFindingsResponse.groupByResults: object expected"); + message.groupByResults[i] = $root.google.cloud.securitycenter.v1p1beta1.GroupResult.fromObject(object.groupByResults[i]); + } + } + if (object.readTime != null) { + if (typeof object.readTime !== "object") + throw TypeError(".google.cloud.securitycenter.v1p1beta1.GroupFindingsResponse.readTime: object expected"); + message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.totalSize != null) + message.totalSize = object.totalSize | 0; return message; }; /** - * Creates a plain object from a GetSourceRequest message. Also converts values to other types if specified. + * Creates a plain object from a GroupFindingsResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.securitycenter.v1beta1.GetSourceRequest + * @memberof google.cloud.securitycenter.v1p1beta1.GroupFindingsResponse * @static - * @param {google.cloud.securitycenter.v1beta1.GetSourceRequest} message GetSourceRequest + * @param {google.cloud.securitycenter.v1p1beta1.GroupFindingsResponse} message GroupFindingsResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GetSourceRequest.toObject = function toObject(message, options) { + GroupFindingsResponse.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 (options.arrays || options.defaults) + object.groupByResults = []; + if (options.defaults) { + object.readTime = null; + object.nextPageToken = ""; + object.totalSize = 0; + } + if (message.groupByResults && message.groupByResults.length) { + object.groupByResults = []; + for (var j = 0; j < message.groupByResults.length; ++j) + object.groupByResults[j] = $root.google.cloud.securitycenter.v1p1beta1.GroupResult.toObject(message.groupByResults[j], options); + } + if (message.readTime != null && message.hasOwnProperty("readTime")) + object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.totalSize != null && message.hasOwnProperty("totalSize")) + object.totalSize = message.totalSize; return object; }; /** - * Converts this GetSourceRequest to JSON. + * Converts this GroupFindingsResponse to JSON. * @function toJSON - * @memberof google.cloud.securitycenter.v1beta1.GetSourceRequest + * @memberof google.cloud.securitycenter.v1p1beta1.GroupFindingsResponse * @instance * @returns {Object.} JSON object */ - GetSourceRequest.prototype.toJSON = function toJSON() { + GroupFindingsResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return GetSourceRequest; + return GroupFindingsResponse; })(); - v1beta1.GroupAssetsRequest = (function() { + v1p1beta1.GroupResult = (function() { /** - * Properties of a GroupAssetsRequest. - * @memberof google.cloud.securitycenter.v1beta1 - * @interface IGroupAssetsRequest - * @property {string|null} [parent] GroupAssetsRequest parent - * @property {string|null} [filter] GroupAssetsRequest filter - * @property {string|null} [groupBy] GroupAssetsRequest groupBy - * @property {google.protobuf.IDuration|null} [compareDuration] GroupAssetsRequest compareDuration - * @property {google.protobuf.ITimestamp|null} [readTime] GroupAssetsRequest readTime - * @property {string|null} [pageToken] GroupAssetsRequest pageToken - * @property {number|null} [pageSize] GroupAssetsRequest pageSize + * Properties of a GroupResult. + * @memberof google.cloud.securitycenter.v1p1beta1 + * @interface IGroupResult + * @property {Object.|null} [properties] GroupResult properties + * @property {number|Long|null} [count] GroupResult count */ /** - * Constructs a new GroupAssetsRequest. - * @memberof google.cloud.securitycenter.v1beta1 - * @classdesc Represents a GroupAssetsRequest. - * @implements IGroupAssetsRequest + * Constructs a new GroupResult. + * @memberof google.cloud.securitycenter.v1p1beta1 + * @classdesc Represents a GroupResult. + * @implements IGroupResult * @constructor - * @param {google.cloud.securitycenter.v1beta1.IGroupAssetsRequest=} [properties] Properties to set + * @param {google.cloud.securitycenter.v1p1beta1.IGroupResult=} [properties] Properties to set */ - function GroupAssetsRequest(properties) { + function GroupResult(properties) { + this.properties = {}; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -13323,153 +24694,96 @@ } /** - * GroupAssetsRequest parent. - * @member {string} parent - * @memberof google.cloud.securitycenter.v1beta1.GroupAssetsRequest - * @instance - */ - GroupAssetsRequest.prototype.parent = ""; - - /** - * GroupAssetsRequest filter. - * @member {string} filter - * @memberof google.cloud.securitycenter.v1beta1.GroupAssetsRequest - * @instance - */ - GroupAssetsRequest.prototype.filter = ""; - - /** - * GroupAssetsRequest groupBy. - * @member {string} groupBy - * @memberof google.cloud.securitycenter.v1beta1.GroupAssetsRequest - * @instance - */ - GroupAssetsRequest.prototype.groupBy = ""; - - /** - * GroupAssetsRequest compareDuration. - * @member {google.protobuf.IDuration|null|undefined} compareDuration - * @memberof google.cloud.securitycenter.v1beta1.GroupAssetsRequest - * @instance - */ - GroupAssetsRequest.prototype.compareDuration = null; - - /** - * GroupAssetsRequest readTime. - * @member {google.protobuf.ITimestamp|null|undefined} readTime - * @memberof google.cloud.securitycenter.v1beta1.GroupAssetsRequest - * @instance - */ - GroupAssetsRequest.prototype.readTime = null; - - /** - * GroupAssetsRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.securitycenter.v1beta1.GroupAssetsRequest + * GroupResult properties. + * @member {Object.} properties + * @memberof google.cloud.securitycenter.v1p1beta1.GroupResult * @instance */ - GroupAssetsRequest.prototype.pageToken = ""; + GroupResult.prototype.properties = $util.emptyObject; /** - * GroupAssetsRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.securitycenter.v1beta1.GroupAssetsRequest + * GroupResult count. + * @member {number|Long} count + * @memberof google.cloud.securitycenter.v1p1beta1.GroupResult * @instance */ - GroupAssetsRequest.prototype.pageSize = 0; + GroupResult.prototype.count = $util.Long ? $util.Long.fromBits(0,0,false) : 0; /** - * Creates a new GroupAssetsRequest instance using the specified properties. + * Creates a new GroupResult instance using the specified properties. * @function create - * @memberof google.cloud.securitycenter.v1beta1.GroupAssetsRequest + * @memberof google.cloud.securitycenter.v1p1beta1.GroupResult * @static - * @param {google.cloud.securitycenter.v1beta1.IGroupAssetsRequest=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1beta1.GroupAssetsRequest} GroupAssetsRequest instance + * @param {google.cloud.securitycenter.v1p1beta1.IGroupResult=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1p1beta1.GroupResult} GroupResult instance */ - GroupAssetsRequest.create = function create(properties) { - return new GroupAssetsRequest(properties); + GroupResult.create = function create(properties) { + return new GroupResult(properties); }; /** - * Encodes the specified GroupAssetsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.GroupAssetsRequest.verify|verify} messages. + * Encodes the specified GroupResult message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.GroupResult.verify|verify} messages. * @function encode - * @memberof google.cloud.securitycenter.v1beta1.GroupAssetsRequest + * @memberof google.cloud.securitycenter.v1p1beta1.GroupResult * @static - * @param {google.cloud.securitycenter.v1beta1.IGroupAssetsRequest} message GroupAssetsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GroupAssetsRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && message.hasOwnProperty("parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.filter != null && message.hasOwnProperty("filter")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); - if (message.groupBy != null && message.hasOwnProperty("groupBy")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.groupBy); - if (message.compareDuration != null && message.hasOwnProperty("compareDuration")) - $root.google.protobuf.Duration.encode(message.compareDuration, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.readTime != null && message.hasOwnProperty("readTime")) - $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.pageToken); - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - writer.uint32(/* id 8, wireType 0 =*/64).int32(message.pageSize); + * @param {google.cloud.securitycenter.v1p1beta1.IGroupResult} message GroupResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroupResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.properties != null && message.hasOwnProperty("properties")) + for (var keys = Object.keys(message.properties), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.protobuf.Value.encode(message.properties[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.count != null && message.hasOwnProperty("count")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.count); return writer; }; /** - * Encodes the specified GroupAssetsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.GroupAssetsRequest.verify|verify} messages. + * Encodes the specified GroupResult message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.GroupResult.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1beta1.GroupAssetsRequest + * @memberof google.cloud.securitycenter.v1p1beta1.GroupResult * @static - * @param {google.cloud.securitycenter.v1beta1.IGroupAssetsRequest} message GroupAssetsRequest message or plain object to encode + * @param {google.cloud.securitycenter.v1p1beta1.IGroupResult} message GroupResult message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GroupAssetsRequest.encodeDelimited = function encodeDelimited(message, writer) { + GroupResult.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GroupAssetsRequest message from the specified reader or buffer. + * Decodes a GroupResult message from the specified reader or buffer. * @function decode - * @memberof google.cloud.securitycenter.v1beta1.GroupAssetsRequest + * @memberof google.cloud.securitycenter.v1p1beta1.GroupResult * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1beta1.GroupAssetsRequest} GroupAssetsRequest + * @returns {google.cloud.securitycenter.v1p1beta1.GroupResult} GroupResult * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GroupAssetsRequest.decode = function decode(reader, length) { + GroupResult.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.cloud.securitycenter.v1beta1.GroupAssetsRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1p1beta1.GroupResult(), key; while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.parent = reader.string(); + reader.skip().pos++; + if (message.properties === $util.emptyObject) + message.properties = {}; + key = reader.string(); + reader.pos++; + message.properties[key] = $root.google.protobuf.Value.decode(reader, reader.uint32()); break; case 2: - message.filter = reader.string(); - break; - case 3: - message.groupBy = reader.string(); - break; - case 4: - message.compareDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - case 5: - message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 7: - message.pageToken = reader.string(); - break; - case 8: - message.pageSize = reader.int32(); + message.count = reader.int64(); break; default: reader.skipType(tag & 7); @@ -13480,169 +24794,151 @@ }; /** - * Decodes a GroupAssetsRequest message from the specified reader or buffer, length delimited. + * Decodes a GroupResult message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1beta1.GroupAssetsRequest + * @memberof google.cloud.securitycenter.v1p1beta1.GroupResult * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1beta1.GroupAssetsRequest} GroupAssetsRequest + * @returns {google.cloud.securitycenter.v1p1beta1.GroupResult} GroupResult * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GroupAssetsRequest.decodeDelimited = function decodeDelimited(reader) { + GroupResult.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GroupAssetsRequest message. + * Verifies a GroupResult message. * @function verify - * @memberof google.cloud.securitycenter.v1beta1.GroupAssetsRequest + * @memberof google.cloud.securitycenter.v1p1beta1.GroupResult * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GroupAssetsRequest.verify = function verify(message) { + GroupResult.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.filter != null && message.hasOwnProperty("filter")) - if (!$util.isString(message.filter)) - return "filter: string expected"; - if (message.groupBy != null && message.hasOwnProperty("groupBy")) - if (!$util.isString(message.groupBy)) - return "groupBy: string expected"; - if (message.compareDuration != null && message.hasOwnProperty("compareDuration")) { - var error = $root.google.protobuf.Duration.verify(message.compareDuration); - if (error) - return "compareDuration." + error; - } - if (message.readTime != null && message.hasOwnProperty("readTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.readTime); - if (error) - return "readTime." + error; + if (message.properties != null && message.hasOwnProperty("properties")) { + if (!$util.isObject(message.properties)) + return "properties: object expected"; + var key = Object.keys(message.properties); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.protobuf.Value.verify(message.properties[key[i]]); + if (error) + return "properties." + error; + } } - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; + if (message.count != null && message.hasOwnProperty("count")) + if (!$util.isInteger(message.count) && !(message.count && $util.isInteger(message.count.low) && $util.isInteger(message.count.high))) + return "count: integer|Long expected"; return null; }; /** - * Creates a GroupAssetsRequest message from a plain object. Also converts values to their respective internal types. + * Creates a GroupResult message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.securitycenter.v1beta1.GroupAssetsRequest + * @memberof google.cloud.securitycenter.v1p1beta1.GroupResult * @static * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1beta1.GroupAssetsRequest} GroupAssetsRequest + * @returns {google.cloud.securitycenter.v1p1beta1.GroupResult} GroupResult */ - GroupAssetsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1beta1.GroupAssetsRequest) + GroupResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1p1beta1.GroupResult) return object; - var message = new $root.google.cloud.securitycenter.v1beta1.GroupAssetsRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.filter != null) - message.filter = String(object.filter); - if (object.groupBy != null) - message.groupBy = String(object.groupBy); - if (object.compareDuration != null) { - if (typeof object.compareDuration !== "object") - throw TypeError(".google.cloud.securitycenter.v1beta1.GroupAssetsRequest.compareDuration: object expected"); - message.compareDuration = $root.google.protobuf.Duration.fromObject(object.compareDuration); - } - if (object.readTime != null) { - if (typeof object.readTime !== "object") - throw TypeError(".google.cloud.securitycenter.v1beta1.GroupAssetsRequest.readTime: object expected"); - message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); + var message = new $root.google.cloud.securitycenter.v1p1beta1.GroupResult(); + if (object.properties) { + if (typeof object.properties !== "object") + throw TypeError(".google.cloud.securitycenter.v1p1beta1.GroupResult.properties: object expected"); + message.properties = {}; + for (var keys = Object.keys(object.properties), i = 0; i < keys.length; ++i) { + if (typeof object.properties[keys[i]] !== "object") + throw TypeError(".google.cloud.securitycenter.v1p1beta1.GroupResult.properties: object expected"); + message.properties[keys[i]] = $root.google.protobuf.Value.fromObject(object.properties[keys[i]]); + } } - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; + if (object.count != null) + if ($util.Long) + (message.count = $util.Long.fromValue(object.count)).unsigned = false; + else if (typeof object.count === "string") + message.count = parseInt(object.count, 10); + else if (typeof object.count === "number") + message.count = object.count; + else if (typeof object.count === "object") + message.count = new $util.LongBits(object.count.low >>> 0, object.count.high >>> 0).toNumber(); return message; }; /** - * Creates a plain object from a GroupAssetsRequest message. Also converts values to other types if specified. + * Creates a plain object from a GroupResult message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.securitycenter.v1beta1.GroupAssetsRequest + * @memberof google.cloud.securitycenter.v1p1beta1.GroupResult * @static - * @param {google.cloud.securitycenter.v1beta1.GroupAssetsRequest} message GroupAssetsRequest + * @param {google.cloud.securitycenter.v1p1beta1.GroupResult} message GroupResult * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GroupAssetsRequest.toObject = function toObject(message, options) { + GroupResult.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.parent = ""; - object.filter = ""; - object.groupBy = ""; - object.compareDuration = null; - object.readTime = null; - object.pageToken = ""; - object.pageSize = 0; + if (options.objects || options.defaults) + object.properties = {}; + if (options.defaults) + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.count = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.count = options.longs === String ? "0" : 0; + var keys2; + if (message.properties && (keys2 = Object.keys(message.properties)).length) { + object.properties = {}; + for (var j = 0; j < keys2.length; ++j) + object.properties[keys2[j]] = $root.google.protobuf.Value.toObject(message.properties[keys2[j]], options); } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.filter != null && message.hasOwnProperty("filter")) - object.filter = message.filter; - if (message.groupBy != null && message.hasOwnProperty("groupBy")) - object.groupBy = message.groupBy; - if (message.compareDuration != null && message.hasOwnProperty("compareDuration")) - object.compareDuration = $root.google.protobuf.Duration.toObject(message.compareDuration, options); - if (message.readTime != null && message.hasOwnProperty("readTime")) - object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; + if (message.count != null && message.hasOwnProperty("count")) + if (typeof message.count === "number") + object.count = options.longs === String ? String(message.count) : message.count; + else + object.count = options.longs === String ? $util.Long.prototype.toString.call(message.count) : options.longs === Number ? new $util.LongBits(message.count.low >>> 0, message.count.high >>> 0).toNumber() : message.count; return object; }; /** - * Converts this GroupAssetsRequest to JSON. + * Converts this GroupResult to JSON. * @function toJSON - * @memberof google.cloud.securitycenter.v1beta1.GroupAssetsRequest + * @memberof google.cloud.securitycenter.v1p1beta1.GroupResult * @instance * @returns {Object.} JSON object */ - GroupAssetsRequest.prototype.toJSON = function toJSON() { + GroupResult.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return GroupAssetsRequest; + return GroupResult; })(); - v1beta1.GroupAssetsResponse = (function() { + v1p1beta1.ListNotificationConfigsRequest = (function() { /** - * Properties of a GroupAssetsResponse. - * @memberof google.cloud.securitycenter.v1beta1 - * @interface IGroupAssetsResponse - * @property {Array.|null} [groupByResults] GroupAssetsResponse groupByResults - * @property {google.protobuf.ITimestamp|null} [readTime] GroupAssetsResponse readTime - * @property {string|null} [nextPageToken] GroupAssetsResponse nextPageToken + * Properties of a ListNotificationConfigsRequest. + * @memberof google.cloud.securitycenter.v1p1beta1 + * @interface IListNotificationConfigsRequest + * @property {string|null} [parent] ListNotificationConfigsRequest parent + * @property {string|null} [pageToken] ListNotificationConfigsRequest pageToken + * @property {number|null} [pageSize] ListNotificationConfigsRequest pageSize */ /** - * Constructs a new GroupAssetsResponse. - * @memberof google.cloud.securitycenter.v1beta1 - * @classdesc Represents a GroupAssetsResponse. - * @implements IGroupAssetsResponse + * Constructs a new ListNotificationConfigsRequest. + * @memberof google.cloud.securitycenter.v1p1beta1 + * @classdesc Represents a ListNotificationConfigsRequest. + * @implements IListNotificationConfigsRequest * @constructor - * @param {google.cloud.securitycenter.v1beta1.IGroupAssetsResponse=} [properties] Properties to set + * @param {google.cloud.securitycenter.v1p1beta1.IListNotificationConfigsRequest=} [properties] Properties to set */ - function GroupAssetsResponse(properties) { - this.groupByResults = []; + function ListNotificationConfigsRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -13650,104 +24946,101 @@ } /** - * GroupAssetsResponse groupByResults. - * @member {Array.} groupByResults - * @memberof google.cloud.securitycenter.v1beta1.GroupAssetsResponse + * ListNotificationConfigsRequest parent. + * @member {string} parent + * @memberof google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest * @instance */ - GroupAssetsResponse.prototype.groupByResults = $util.emptyArray; + ListNotificationConfigsRequest.prototype.parent = ""; /** - * GroupAssetsResponse readTime. - * @member {google.protobuf.ITimestamp|null|undefined} readTime - * @memberof google.cloud.securitycenter.v1beta1.GroupAssetsResponse + * ListNotificationConfigsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest * @instance */ - GroupAssetsResponse.prototype.readTime = null; + ListNotificationConfigsRequest.prototype.pageToken = ""; /** - * GroupAssetsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.securitycenter.v1beta1.GroupAssetsResponse + * ListNotificationConfigsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest * @instance */ - GroupAssetsResponse.prototype.nextPageToken = ""; + ListNotificationConfigsRequest.prototype.pageSize = 0; /** - * Creates a new GroupAssetsResponse instance using the specified properties. + * Creates a new ListNotificationConfigsRequest instance using the specified properties. * @function create - * @memberof google.cloud.securitycenter.v1beta1.GroupAssetsResponse + * @memberof google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest * @static - * @param {google.cloud.securitycenter.v1beta1.IGroupAssetsResponse=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1beta1.GroupAssetsResponse} GroupAssetsResponse instance + * @param {google.cloud.securitycenter.v1p1beta1.IListNotificationConfigsRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest} ListNotificationConfigsRequest instance */ - GroupAssetsResponse.create = function create(properties) { - return new GroupAssetsResponse(properties); + ListNotificationConfigsRequest.create = function create(properties) { + return new ListNotificationConfigsRequest(properties); }; /** - * Encodes the specified GroupAssetsResponse message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.GroupAssetsResponse.verify|verify} messages. + * Encodes the specified ListNotificationConfigsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.securitycenter.v1beta1.GroupAssetsResponse + * @memberof google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest * @static - * @param {google.cloud.securitycenter.v1beta1.IGroupAssetsResponse} message GroupAssetsResponse message or plain object to encode + * @param {google.cloud.securitycenter.v1p1beta1.IListNotificationConfigsRequest} message ListNotificationConfigsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GroupAssetsResponse.encode = function encode(message, writer) { + ListNotificationConfigsRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.groupByResults != null && message.groupByResults.length) - for (var i = 0; i < message.groupByResults.length; ++i) - $root.google.cloud.securitycenter.v1beta1.GroupResult.encode(message.groupByResults[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.readTime != null && message.hasOwnProperty("readTime")) - $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.nextPageToken); + if (message.parent != null && message.hasOwnProperty("parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.pageToken); + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); return writer; }; /** - * Encodes the specified GroupAssetsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.GroupAssetsResponse.verify|verify} messages. + * Encodes the specified ListNotificationConfigsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1beta1.GroupAssetsResponse + * @memberof google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest * @static - * @param {google.cloud.securitycenter.v1beta1.IGroupAssetsResponse} message GroupAssetsResponse message or plain object to encode + * @param {google.cloud.securitycenter.v1p1beta1.IListNotificationConfigsRequest} message ListNotificationConfigsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GroupAssetsResponse.encodeDelimited = function encodeDelimited(message, writer) { + ListNotificationConfigsRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GroupAssetsResponse message from the specified reader or buffer. + * Decodes a ListNotificationConfigsRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.securitycenter.v1beta1.GroupAssetsResponse + * @memberof google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1beta1.GroupAssetsResponse} GroupAssetsResponse + * @returns {google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest} ListNotificationConfigsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GroupAssetsResponse.decode = function decode(reader, length) { + ListNotificationConfigsRequest.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.cloud.securitycenter.v1beta1.GroupAssetsResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - if (!(message.groupByResults && message.groupByResults.length)) - message.groupByResults = []; - message.groupByResults.push($root.google.cloud.securitycenter.v1beta1.GroupResult.decode(reader, reader.uint32())); + case 1: + message.parent = reader.string(); break; case 2: - message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + message.pageToken = reader.string(); break; case 3: - message.nextPageToken = reader.string(); + message.pageSize = reader.int32(); break; default: reader.skipType(tag & 7); @@ -13758,152 +25051,126 @@ }; /** - * Decodes a GroupAssetsResponse message from the specified reader or buffer, length delimited. + * Decodes a ListNotificationConfigsRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1beta1.GroupAssetsResponse + * @memberof google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1beta1.GroupAssetsResponse} GroupAssetsResponse + * @returns {google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest} ListNotificationConfigsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GroupAssetsResponse.decodeDelimited = function decodeDelimited(reader) { + ListNotificationConfigsRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GroupAssetsResponse message. + * Verifies a ListNotificationConfigsRequest message. * @function verify - * @memberof google.cloud.securitycenter.v1beta1.GroupAssetsResponse + * @memberof google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GroupAssetsResponse.verify = function verify(message) { + ListNotificationConfigsRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.groupByResults != null && message.hasOwnProperty("groupByResults")) { - if (!Array.isArray(message.groupByResults)) - return "groupByResults: array expected"; - for (var i = 0; i < message.groupByResults.length; ++i) { - var error = $root.google.cloud.securitycenter.v1beta1.GroupResult.verify(message.groupByResults[i]); - if (error) - return "groupByResults." + error; - } - } - if (message.readTime != null && message.hasOwnProperty("readTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.readTime); - if (error) - return "readTime." + error; - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; return null; }; /** - * Creates a GroupAssetsResponse message from a plain object. Also converts values to their respective internal types. + * Creates a ListNotificationConfigsRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.securitycenter.v1beta1.GroupAssetsResponse + * @memberof google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1beta1.GroupAssetsResponse} GroupAssetsResponse + * @returns {google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest} ListNotificationConfigsRequest */ - GroupAssetsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1beta1.GroupAssetsResponse) + ListNotificationConfigsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest) return object; - var message = new $root.google.cloud.securitycenter.v1beta1.GroupAssetsResponse(); - if (object.groupByResults) { - if (!Array.isArray(object.groupByResults)) - throw TypeError(".google.cloud.securitycenter.v1beta1.GroupAssetsResponse.groupByResults: array expected"); - message.groupByResults = []; - for (var i = 0; i < object.groupByResults.length; ++i) { - if (typeof object.groupByResults[i] !== "object") - throw TypeError(".google.cloud.securitycenter.v1beta1.GroupAssetsResponse.groupByResults: object expected"); - message.groupByResults[i] = $root.google.cloud.securitycenter.v1beta1.GroupResult.fromObject(object.groupByResults[i]); - } - } - if (object.readTime != null) { - if (typeof object.readTime !== "object") - throw TypeError(".google.cloud.securitycenter.v1beta1.GroupAssetsResponse.readTime: object expected"); - message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); + var message = new $root.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; return message; }; /** - * Creates a plain object from a GroupAssetsResponse message. Also converts values to other types if specified. + * Creates a plain object from a ListNotificationConfigsRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.securitycenter.v1beta1.GroupAssetsResponse + * @memberof google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest * @static - * @param {google.cloud.securitycenter.v1beta1.GroupAssetsResponse} message GroupAssetsResponse + * @param {google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest} message ListNotificationConfigsRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GroupAssetsResponse.toObject = function toObject(message, options) { + ListNotificationConfigsRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.groupByResults = []; if (options.defaults) { - object.readTime = null; - object.nextPageToken = ""; - } - if (message.groupByResults && message.groupByResults.length) { - object.groupByResults = []; - for (var j = 0; j < message.groupByResults.length; ++j) - object.groupByResults[j] = $root.google.cloud.securitycenter.v1beta1.GroupResult.toObject(message.groupByResults[j], options); + object.parent = ""; + object.pageToken = ""; + object.pageSize = 0; } - if (message.readTime != null && message.hasOwnProperty("readTime")) - object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; return object; }; /** - * Converts this GroupAssetsResponse to JSON. + * Converts this ListNotificationConfigsRequest to JSON. * @function toJSON - * @memberof google.cloud.securitycenter.v1beta1.GroupAssetsResponse + * @memberof google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest * @instance * @returns {Object.} JSON object */ - GroupAssetsResponse.prototype.toJSON = function toJSON() { + ListNotificationConfigsRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return GroupAssetsResponse; + return ListNotificationConfigsRequest; })(); - v1beta1.GroupFindingsRequest = (function() { + v1p1beta1.ListNotificationConfigsResponse = (function() { /** - * Properties of a GroupFindingsRequest. - * @memberof google.cloud.securitycenter.v1beta1 - * @interface IGroupFindingsRequest - * @property {string|null} [parent] GroupFindingsRequest parent - * @property {string|null} [filter] GroupFindingsRequest filter - * @property {string|null} [groupBy] GroupFindingsRequest groupBy - * @property {google.protobuf.ITimestamp|null} [readTime] GroupFindingsRequest readTime - * @property {string|null} [pageToken] GroupFindingsRequest pageToken - * @property {number|null} [pageSize] GroupFindingsRequest pageSize + * Properties of a ListNotificationConfigsResponse. + * @memberof google.cloud.securitycenter.v1p1beta1 + * @interface IListNotificationConfigsResponse + * @property {Array.|null} [notificationConfigs] ListNotificationConfigsResponse notificationConfigs + * @property {string|null} [nextPageToken] ListNotificationConfigsResponse nextPageToken */ /** - * Constructs a new GroupFindingsRequest. - * @memberof google.cloud.securitycenter.v1beta1 - * @classdesc Represents a GroupFindingsRequest. - * @implements IGroupFindingsRequest + * Constructs a new ListNotificationConfigsResponse. + * @memberof google.cloud.securitycenter.v1p1beta1 + * @classdesc Represents a ListNotificationConfigsResponse. + * @implements IListNotificationConfigsResponse * @constructor - * @param {google.cloud.securitycenter.v1beta1.IGroupFindingsRequest=} [properties] Properties to set + * @param {google.cloud.securitycenter.v1p1beta1.IListNotificationConfigsResponse=} [properties] Properties to set */ - function GroupFindingsRequest(properties) { + function ListNotificationConfigsResponse(properties) { + this.notificationConfigs = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -13911,140 +25178,91 @@ } /** - * GroupFindingsRequest parent. - * @member {string} parent - * @memberof google.cloud.securitycenter.v1beta1.GroupFindingsRequest - * @instance - */ - GroupFindingsRequest.prototype.parent = ""; - - /** - * GroupFindingsRequest filter. - * @member {string} filter - * @memberof google.cloud.securitycenter.v1beta1.GroupFindingsRequest - * @instance - */ - GroupFindingsRequest.prototype.filter = ""; - - /** - * GroupFindingsRequest groupBy. - * @member {string} groupBy - * @memberof google.cloud.securitycenter.v1beta1.GroupFindingsRequest - * @instance - */ - GroupFindingsRequest.prototype.groupBy = ""; - - /** - * GroupFindingsRequest readTime. - * @member {google.protobuf.ITimestamp|null|undefined} readTime - * @memberof google.cloud.securitycenter.v1beta1.GroupFindingsRequest - * @instance - */ - GroupFindingsRequest.prototype.readTime = null; - - /** - * GroupFindingsRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.securitycenter.v1beta1.GroupFindingsRequest + * ListNotificationConfigsResponse notificationConfigs. + * @member {Array.} notificationConfigs + * @memberof google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsResponse * @instance */ - GroupFindingsRequest.prototype.pageToken = ""; + ListNotificationConfigsResponse.prototype.notificationConfigs = $util.emptyArray; /** - * GroupFindingsRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.securitycenter.v1beta1.GroupFindingsRequest + * ListNotificationConfigsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsResponse * @instance */ - GroupFindingsRequest.prototype.pageSize = 0; + ListNotificationConfigsResponse.prototype.nextPageToken = ""; /** - * Creates a new GroupFindingsRequest instance using the specified properties. + * Creates a new ListNotificationConfigsResponse instance using the specified properties. * @function create - * @memberof google.cloud.securitycenter.v1beta1.GroupFindingsRequest + * @memberof google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsResponse * @static - * @param {google.cloud.securitycenter.v1beta1.IGroupFindingsRequest=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1beta1.GroupFindingsRequest} GroupFindingsRequest instance + * @param {google.cloud.securitycenter.v1p1beta1.IListNotificationConfigsResponse=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsResponse} ListNotificationConfigsResponse instance */ - GroupFindingsRequest.create = function create(properties) { - return new GroupFindingsRequest(properties); + ListNotificationConfigsResponse.create = function create(properties) { + return new ListNotificationConfigsResponse(properties); }; /** - * Encodes the specified GroupFindingsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.GroupFindingsRequest.verify|verify} messages. + * Encodes the specified ListNotificationConfigsResponse message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.securitycenter.v1beta1.GroupFindingsRequest + * @memberof google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsResponse * @static - * @param {google.cloud.securitycenter.v1beta1.IGroupFindingsRequest} message GroupFindingsRequest message or plain object to encode + * @param {google.cloud.securitycenter.v1p1beta1.IListNotificationConfigsResponse} message ListNotificationConfigsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GroupFindingsRequest.encode = function encode(message, writer) { + ListNotificationConfigsResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && message.hasOwnProperty("parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.filter != null && message.hasOwnProperty("filter")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); - if (message.groupBy != null && message.hasOwnProperty("groupBy")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.groupBy); - if (message.readTime != null && message.hasOwnProperty("readTime")) - $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.pageToken); - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - writer.uint32(/* id 6, wireType 0 =*/48).int32(message.pageSize); + if (message.notificationConfigs != null && message.notificationConfigs.length) + for (var i = 0; i < message.notificationConfigs.length; ++i) + $root.google.cloud.securitycenter.v1p1beta1.NotificationConfig.encode(message.notificationConfigs[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); return writer; }; /** - * Encodes the specified GroupFindingsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.GroupFindingsRequest.verify|verify} messages. + * Encodes the specified ListNotificationConfigsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1beta1.GroupFindingsRequest + * @memberof google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsResponse * @static - * @param {google.cloud.securitycenter.v1beta1.IGroupFindingsRequest} message GroupFindingsRequest message or plain object to encode + * @param {google.cloud.securitycenter.v1p1beta1.IListNotificationConfigsResponse} message ListNotificationConfigsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GroupFindingsRequest.encodeDelimited = function encodeDelimited(message, writer) { + ListNotificationConfigsResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GroupFindingsRequest message from the specified reader or buffer. + * Decodes a ListNotificationConfigsResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.securitycenter.v1beta1.GroupFindingsRequest + * @memberof google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1beta1.GroupFindingsRequest} GroupFindingsRequest + * @returns {google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsResponse} ListNotificationConfigsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GroupFindingsRequest.decode = function decode(reader, length) { + ListNotificationConfigsResponse.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.cloud.securitycenter.v1beta1.GroupFindingsRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.parent = reader.string(); + if (!(message.notificationConfigs && message.notificationConfigs.length)) + message.notificationConfigs = []; + message.notificationConfigs.push($root.google.cloud.securitycenter.v1p1beta1.NotificationConfig.decode(reader, reader.uint32())); break; case 2: - message.filter = reader.string(); - break; - case 3: - message.groupBy = reader.string(); - break; - case 4: - message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 5: - message.pageToken = reader.string(); - break; - case 6: - message.pageSize = reader.int32(); + message.nextPageToken = reader.string(); break; default: reader.skipType(tag & 7); @@ -14055,156 +25273,135 @@ }; /** - * Decodes a GroupFindingsRequest message from the specified reader or buffer, length delimited. + * Decodes a ListNotificationConfigsResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1beta1.GroupFindingsRequest + * @memberof google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1beta1.GroupFindingsRequest} GroupFindingsRequest + * @returns {google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsResponse} ListNotificationConfigsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GroupFindingsRequest.decodeDelimited = function decodeDelimited(reader) { + ListNotificationConfigsResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GroupFindingsRequest message. + * Verifies a ListNotificationConfigsResponse message. * @function verify - * @memberof google.cloud.securitycenter.v1beta1.GroupFindingsRequest + * @memberof google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GroupFindingsRequest.verify = function verify(message) { + ListNotificationConfigsResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.filter != null && message.hasOwnProperty("filter")) - if (!$util.isString(message.filter)) - return "filter: string expected"; - if (message.groupBy != null && message.hasOwnProperty("groupBy")) - if (!$util.isString(message.groupBy)) - return "groupBy: string expected"; - if (message.readTime != null && message.hasOwnProperty("readTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.readTime); - if (error) - return "readTime." + error; + if (message.notificationConfigs != null && message.hasOwnProperty("notificationConfigs")) { + if (!Array.isArray(message.notificationConfigs)) + return "notificationConfigs: array expected"; + for (var i = 0; i < message.notificationConfigs.length; ++i) { + var error = $root.google.cloud.securitycenter.v1p1beta1.NotificationConfig.verify(message.notificationConfigs[i]); + if (error) + return "notificationConfigs." + error; + } } - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; return null; }; - /** - * Creates a GroupFindingsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v1beta1.GroupFindingsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1beta1.GroupFindingsRequest} GroupFindingsRequest - */ - GroupFindingsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1beta1.GroupFindingsRequest) - return object; - var message = new $root.google.cloud.securitycenter.v1beta1.GroupFindingsRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.filter != null) - message.filter = String(object.filter); - if (object.groupBy != null) - message.groupBy = String(object.groupBy); - if (object.readTime != null) { - if (typeof object.readTime !== "object") - throw TypeError(".google.cloud.securitycenter.v1beta1.GroupFindingsRequest.readTime: object expected"); - message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); + /** + * Creates a ListNotificationConfigsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsResponse} ListNotificationConfigsResponse + */ + ListNotificationConfigsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsResponse) + return object; + var message = new $root.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsResponse(); + if (object.notificationConfigs) { + if (!Array.isArray(object.notificationConfigs)) + throw TypeError(".google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsResponse.notificationConfigs: array expected"); + message.notificationConfigs = []; + for (var i = 0; i < object.notificationConfigs.length; ++i) { + if (typeof object.notificationConfigs[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsResponse.notificationConfigs: object expected"); + message.notificationConfigs[i] = $root.google.cloud.securitycenter.v1p1beta1.NotificationConfig.fromObject(object.notificationConfigs[i]); + } } - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); return message; }; /** - * Creates a plain object from a GroupFindingsRequest message. Also converts values to other types if specified. + * Creates a plain object from a ListNotificationConfigsResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.securitycenter.v1beta1.GroupFindingsRequest + * @memberof google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsResponse * @static - * @param {google.cloud.securitycenter.v1beta1.GroupFindingsRequest} message GroupFindingsRequest + * @param {google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsResponse} message ListNotificationConfigsResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GroupFindingsRequest.toObject = function toObject(message, options) { + ListNotificationConfigsResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.parent = ""; - object.filter = ""; - object.groupBy = ""; - object.readTime = null; - object.pageToken = ""; - object.pageSize = 0; + if (options.arrays || options.defaults) + object.notificationConfigs = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.notificationConfigs && message.notificationConfigs.length) { + object.notificationConfigs = []; + for (var j = 0; j < message.notificationConfigs.length; ++j) + object.notificationConfigs[j] = $root.google.cloud.securitycenter.v1p1beta1.NotificationConfig.toObject(message.notificationConfigs[j], options); } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.filter != null && message.hasOwnProperty("filter")) - object.filter = message.filter; - if (message.groupBy != null && message.hasOwnProperty("groupBy")) - object.groupBy = message.groupBy; - if (message.readTime != null && message.hasOwnProperty("readTime")) - object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; return object; }; /** - * Converts this GroupFindingsRequest to JSON. + * Converts this ListNotificationConfigsResponse to JSON. * @function toJSON - * @memberof google.cloud.securitycenter.v1beta1.GroupFindingsRequest + * @memberof google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsResponse * @instance * @returns {Object.} JSON object */ - GroupFindingsRequest.prototype.toJSON = function toJSON() { + ListNotificationConfigsResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return GroupFindingsRequest; + return ListNotificationConfigsResponse; })(); - v1beta1.GroupFindingsResponse = (function() { + v1p1beta1.ListSourcesRequest = (function() { /** - * Properties of a GroupFindingsResponse. - * @memberof google.cloud.securitycenter.v1beta1 - * @interface IGroupFindingsResponse - * @property {Array.|null} [groupByResults] GroupFindingsResponse groupByResults - * @property {google.protobuf.ITimestamp|null} [readTime] GroupFindingsResponse readTime - * @property {string|null} [nextPageToken] GroupFindingsResponse nextPageToken + * Properties of a ListSourcesRequest. + * @memberof google.cloud.securitycenter.v1p1beta1 + * @interface IListSourcesRequest + * @property {string|null} [parent] ListSourcesRequest parent + * @property {string|null} [pageToken] ListSourcesRequest pageToken + * @property {number|null} [pageSize] ListSourcesRequest pageSize */ /** - * Constructs a new GroupFindingsResponse. - * @memberof google.cloud.securitycenter.v1beta1 - * @classdesc Represents a GroupFindingsResponse. - * @implements IGroupFindingsResponse + * Constructs a new ListSourcesRequest. + * @memberof google.cloud.securitycenter.v1p1beta1 + * @classdesc Represents a ListSourcesRequest. + * @implements IListSourcesRequest * @constructor - * @param {google.cloud.securitycenter.v1beta1.IGroupFindingsResponse=} [properties] Properties to set + * @param {google.cloud.securitycenter.v1p1beta1.IListSourcesRequest=} [properties] Properties to set */ - function GroupFindingsResponse(properties) { - this.groupByResults = []; + function ListSourcesRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -14212,104 +25409,101 @@ } /** - * GroupFindingsResponse groupByResults. - * @member {Array.} groupByResults - * @memberof google.cloud.securitycenter.v1beta1.GroupFindingsResponse + * ListSourcesRequest parent. + * @member {string} parent + * @memberof google.cloud.securitycenter.v1p1beta1.ListSourcesRequest * @instance */ - GroupFindingsResponse.prototype.groupByResults = $util.emptyArray; + ListSourcesRequest.prototype.parent = ""; /** - * GroupFindingsResponse readTime. - * @member {google.protobuf.ITimestamp|null|undefined} readTime - * @memberof google.cloud.securitycenter.v1beta1.GroupFindingsResponse + * ListSourcesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.securitycenter.v1p1beta1.ListSourcesRequest * @instance */ - GroupFindingsResponse.prototype.readTime = null; + ListSourcesRequest.prototype.pageToken = ""; /** - * GroupFindingsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.securitycenter.v1beta1.GroupFindingsResponse + * ListSourcesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.securitycenter.v1p1beta1.ListSourcesRequest * @instance */ - GroupFindingsResponse.prototype.nextPageToken = ""; + ListSourcesRequest.prototype.pageSize = 0; /** - * Creates a new GroupFindingsResponse instance using the specified properties. + * Creates a new ListSourcesRequest instance using the specified properties. * @function create - * @memberof google.cloud.securitycenter.v1beta1.GroupFindingsResponse + * @memberof google.cloud.securitycenter.v1p1beta1.ListSourcesRequest * @static - * @param {google.cloud.securitycenter.v1beta1.IGroupFindingsResponse=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1beta1.GroupFindingsResponse} GroupFindingsResponse instance + * @param {google.cloud.securitycenter.v1p1beta1.IListSourcesRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1p1beta1.ListSourcesRequest} ListSourcesRequest instance */ - GroupFindingsResponse.create = function create(properties) { - return new GroupFindingsResponse(properties); + ListSourcesRequest.create = function create(properties) { + return new ListSourcesRequest(properties); }; /** - * Encodes the specified GroupFindingsResponse message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.GroupFindingsResponse.verify|verify} messages. + * Encodes the specified ListSourcesRequest message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.ListSourcesRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.securitycenter.v1beta1.GroupFindingsResponse + * @memberof google.cloud.securitycenter.v1p1beta1.ListSourcesRequest * @static - * @param {google.cloud.securitycenter.v1beta1.IGroupFindingsResponse} message GroupFindingsResponse message or plain object to encode + * @param {google.cloud.securitycenter.v1p1beta1.IListSourcesRequest} message ListSourcesRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GroupFindingsResponse.encode = function encode(message, writer) { + ListSourcesRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.groupByResults != null && message.groupByResults.length) - for (var i = 0; i < message.groupByResults.length; ++i) - $root.google.cloud.securitycenter.v1beta1.GroupResult.encode(message.groupByResults[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.readTime != null && message.hasOwnProperty("readTime")) - $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.nextPageToken); + if (message.parent != null && message.hasOwnProperty("parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.pageToken); + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.pageSize); return writer; }; /** - * Encodes the specified GroupFindingsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.GroupFindingsResponse.verify|verify} messages. + * Encodes the specified ListSourcesRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.ListSourcesRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1beta1.GroupFindingsResponse + * @memberof google.cloud.securitycenter.v1p1beta1.ListSourcesRequest * @static - * @param {google.cloud.securitycenter.v1beta1.IGroupFindingsResponse} message GroupFindingsResponse message or plain object to encode + * @param {google.cloud.securitycenter.v1p1beta1.IListSourcesRequest} message ListSourcesRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GroupFindingsResponse.encodeDelimited = function encodeDelimited(message, writer) { + ListSourcesRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GroupFindingsResponse message from the specified reader or buffer. + * Decodes a ListSourcesRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.securitycenter.v1beta1.GroupFindingsResponse + * @memberof google.cloud.securitycenter.v1p1beta1.ListSourcesRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1beta1.GroupFindingsResponse} GroupFindingsResponse + * @returns {google.cloud.securitycenter.v1p1beta1.ListSourcesRequest} ListSourcesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GroupFindingsResponse.decode = function decode(reader, length) { + ListSourcesRequest.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.cloud.securitycenter.v1beta1.GroupFindingsResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1p1beta1.ListSourcesRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - if (!(message.groupByResults && message.groupByResults.length)) - message.groupByResults = []; - message.groupByResults.push($root.google.cloud.securitycenter.v1beta1.GroupResult.decode(reader, reader.uint32())); + message.parent = reader.string(); break; case 2: - message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + message.pageToken = reader.string(); break; - case 3: - message.nextPageToken = reader.string(); + case 7: + message.pageSize = reader.int32(); break; default: reader.skipType(tag & 7); @@ -14320,149 +25514,126 @@ }; /** - * Decodes a GroupFindingsResponse message from the specified reader or buffer, length delimited. + * Decodes a ListSourcesRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1beta1.GroupFindingsResponse + * @memberof google.cloud.securitycenter.v1p1beta1.ListSourcesRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1beta1.GroupFindingsResponse} GroupFindingsResponse + * @returns {google.cloud.securitycenter.v1p1beta1.ListSourcesRequest} ListSourcesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GroupFindingsResponse.decodeDelimited = function decodeDelimited(reader) { + ListSourcesRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GroupFindingsResponse message. + * Verifies a ListSourcesRequest message. * @function verify - * @memberof google.cloud.securitycenter.v1beta1.GroupFindingsResponse + * @memberof google.cloud.securitycenter.v1p1beta1.ListSourcesRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GroupFindingsResponse.verify = function verify(message) { + ListSourcesRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.groupByResults != null && message.hasOwnProperty("groupByResults")) { - if (!Array.isArray(message.groupByResults)) - return "groupByResults: array expected"; - for (var i = 0; i < message.groupByResults.length; ++i) { - var error = $root.google.cloud.securitycenter.v1beta1.GroupResult.verify(message.groupByResults[i]); - if (error) - return "groupByResults." + error; - } - } - if (message.readTime != null && message.hasOwnProperty("readTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.readTime); - if (error) - return "readTime." + error; - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; return null; }; /** - * Creates a GroupFindingsResponse message from a plain object. Also converts values to their respective internal types. + * Creates a ListSourcesRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.securitycenter.v1beta1.GroupFindingsResponse + * @memberof google.cloud.securitycenter.v1p1beta1.ListSourcesRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1beta1.GroupFindingsResponse} GroupFindingsResponse + * @returns {google.cloud.securitycenter.v1p1beta1.ListSourcesRequest} ListSourcesRequest */ - GroupFindingsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1beta1.GroupFindingsResponse) + ListSourcesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1p1beta1.ListSourcesRequest) return object; - var message = new $root.google.cloud.securitycenter.v1beta1.GroupFindingsResponse(); - if (object.groupByResults) { - if (!Array.isArray(object.groupByResults)) - throw TypeError(".google.cloud.securitycenter.v1beta1.GroupFindingsResponse.groupByResults: array expected"); - message.groupByResults = []; - for (var i = 0; i < object.groupByResults.length; ++i) { - if (typeof object.groupByResults[i] !== "object") - throw TypeError(".google.cloud.securitycenter.v1beta1.GroupFindingsResponse.groupByResults: object expected"); - message.groupByResults[i] = $root.google.cloud.securitycenter.v1beta1.GroupResult.fromObject(object.groupByResults[i]); - } - } - if (object.readTime != null) { - if (typeof object.readTime !== "object") - throw TypeError(".google.cloud.securitycenter.v1beta1.GroupFindingsResponse.readTime: object expected"); - message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); + var message = new $root.google.cloud.securitycenter.v1p1beta1.ListSourcesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; return message; }; /** - * Creates a plain object from a GroupFindingsResponse message. Also converts values to other types if specified. + * Creates a plain object from a ListSourcesRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.securitycenter.v1beta1.GroupFindingsResponse + * @memberof google.cloud.securitycenter.v1p1beta1.ListSourcesRequest * @static - * @param {google.cloud.securitycenter.v1beta1.GroupFindingsResponse} message GroupFindingsResponse + * @param {google.cloud.securitycenter.v1p1beta1.ListSourcesRequest} message ListSourcesRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GroupFindingsResponse.toObject = function toObject(message, options) { + ListSourcesRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.groupByResults = []; if (options.defaults) { - object.readTime = null; - object.nextPageToken = ""; - } - if (message.groupByResults && message.groupByResults.length) { - object.groupByResults = []; - for (var j = 0; j < message.groupByResults.length; ++j) - object.groupByResults[j] = $root.google.cloud.securitycenter.v1beta1.GroupResult.toObject(message.groupByResults[j], options); + object.parent = ""; + object.pageToken = ""; + object.pageSize = 0; } - if (message.readTime != null && message.hasOwnProperty("readTime")) - object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; return object; }; /** - * Converts this GroupFindingsResponse to JSON. + * Converts this ListSourcesRequest to JSON. * @function toJSON - * @memberof google.cloud.securitycenter.v1beta1.GroupFindingsResponse + * @memberof google.cloud.securitycenter.v1p1beta1.ListSourcesRequest * @instance * @returns {Object.} JSON object */ - GroupFindingsResponse.prototype.toJSON = function toJSON() { + ListSourcesRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return GroupFindingsResponse; + return ListSourcesRequest; })(); - v1beta1.GroupResult = (function() { + v1p1beta1.ListSourcesResponse = (function() { /** - * Properties of a GroupResult. - * @memberof google.cloud.securitycenter.v1beta1 - * @interface IGroupResult - * @property {Object.|null} [properties] GroupResult properties - * @property {number|Long|null} [count] GroupResult count + * Properties of a ListSourcesResponse. + * @memberof google.cloud.securitycenter.v1p1beta1 + * @interface IListSourcesResponse + * @property {Array.|null} [sources] ListSourcesResponse sources + * @property {string|null} [nextPageToken] ListSourcesResponse nextPageToken */ - - /** - * Constructs a new GroupResult. - * @memberof google.cloud.securitycenter.v1beta1 - * @classdesc Represents a GroupResult. - * @implements IGroupResult + + /** + * Constructs a new ListSourcesResponse. + * @memberof google.cloud.securitycenter.v1p1beta1 + * @classdesc Represents a ListSourcesResponse. + * @implements IListSourcesResponse * @constructor - * @param {google.cloud.securitycenter.v1beta1.IGroupResult=} [properties] Properties to set + * @param {google.cloud.securitycenter.v1p1beta1.IListSourcesResponse=} [properties] Properties to set */ - function GroupResult(properties) { - this.properties = {}; + function ListSourcesResponse(properties) { + this.sources = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -14470,96 +25641,91 @@ } /** - * GroupResult properties. - * @member {Object.} properties - * @memberof google.cloud.securitycenter.v1beta1.GroupResult + * ListSourcesResponse sources. + * @member {Array.} sources + * @memberof google.cloud.securitycenter.v1p1beta1.ListSourcesResponse * @instance */ - GroupResult.prototype.properties = $util.emptyObject; + ListSourcesResponse.prototype.sources = $util.emptyArray; /** - * GroupResult count. - * @member {number|Long} count - * @memberof google.cloud.securitycenter.v1beta1.GroupResult + * ListSourcesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.securitycenter.v1p1beta1.ListSourcesResponse * @instance */ - GroupResult.prototype.count = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + ListSourcesResponse.prototype.nextPageToken = ""; /** - * Creates a new GroupResult instance using the specified properties. + * Creates a new ListSourcesResponse instance using the specified properties. * @function create - * @memberof google.cloud.securitycenter.v1beta1.GroupResult + * @memberof google.cloud.securitycenter.v1p1beta1.ListSourcesResponse * @static - * @param {google.cloud.securitycenter.v1beta1.IGroupResult=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1beta1.GroupResult} GroupResult instance + * @param {google.cloud.securitycenter.v1p1beta1.IListSourcesResponse=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1p1beta1.ListSourcesResponse} ListSourcesResponse instance */ - GroupResult.create = function create(properties) { - return new GroupResult(properties); + ListSourcesResponse.create = function create(properties) { + return new ListSourcesResponse(properties); }; /** - * Encodes the specified GroupResult message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.GroupResult.verify|verify} messages. + * Encodes the specified ListSourcesResponse message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.ListSourcesResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.securitycenter.v1beta1.GroupResult + * @memberof google.cloud.securitycenter.v1p1beta1.ListSourcesResponse * @static - * @param {google.cloud.securitycenter.v1beta1.IGroupResult} message GroupResult message or plain object to encode + * @param {google.cloud.securitycenter.v1p1beta1.IListSourcesResponse} message ListSourcesResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GroupResult.encode = function encode(message, writer) { + ListSourcesResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.properties != null && message.hasOwnProperty("properties")) - for (var keys = Object.keys(message.properties), i = 0; i < keys.length; ++i) { - writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); - $root.google.protobuf.Value.encode(message.properties[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); - } - if (message.count != null && message.hasOwnProperty("count")) - writer.uint32(/* id 2, wireType 0 =*/16).int64(message.count); + if (message.sources != null && message.sources.length) + for (var i = 0; i < message.sources.length; ++i) + $root.google.cloud.securitycenter.v1p1beta1.Source.encode(message.sources[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); return writer; }; /** - * Encodes the specified GroupResult message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.GroupResult.verify|verify} messages. + * Encodes the specified ListSourcesResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.ListSourcesResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1beta1.GroupResult + * @memberof google.cloud.securitycenter.v1p1beta1.ListSourcesResponse * @static - * @param {google.cloud.securitycenter.v1beta1.IGroupResult} message GroupResult message or plain object to encode + * @param {google.cloud.securitycenter.v1p1beta1.IListSourcesResponse} message ListSourcesResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GroupResult.encodeDelimited = function encodeDelimited(message, writer) { + ListSourcesResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GroupResult message from the specified reader or buffer. + * Decodes a ListSourcesResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.securitycenter.v1beta1.GroupResult + * @memberof google.cloud.securitycenter.v1p1beta1.ListSourcesResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1beta1.GroupResult} GroupResult + * @returns {google.cloud.securitycenter.v1p1beta1.ListSourcesResponse} ListSourcesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GroupResult.decode = function decode(reader, length) { + ListSourcesResponse.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.cloud.securitycenter.v1beta1.GroupResult(), key; + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1p1beta1.ListSourcesResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - reader.skip().pos++; - if (message.properties === $util.emptyObject) - message.properties = {}; - key = reader.string(); - reader.pos++; - message.properties[key] = $root.google.protobuf.Value.decode(reader, reader.uint32()); + if (!(message.sources && message.sources.length)) + message.sources = []; + message.sources.push($root.google.cloud.securitycenter.v1p1beta1.Source.decode(reader, reader.uint32())); break; case 2: - message.count = reader.int64(); + message.nextPageToken = reader.string(); break; default: reader.skipType(tag & 7); @@ -14570,151 +25736,141 @@ }; /** - * Decodes a GroupResult message from the specified reader or buffer, length delimited. + * Decodes a ListSourcesResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1beta1.GroupResult + * @memberof google.cloud.securitycenter.v1p1beta1.ListSourcesResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1beta1.GroupResult} GroupResult + * @returns {google.cloud.securitycenter.v1p1beta1.ListSourcesResponse} ListSourcesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GroupResult.decodeDelimited = function decodeDelimited(reader) { + ListSourcesResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GroupResult message. + * Verifies a ListSourcesResponse message. * @function verify - * @memberof google.cloud.securitycenter.v1beta1.GroupResult + * @memberof google.cloud.securitycenter.v1p1beta1.ListSourcesResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GroupResult.verify = function verify(message) { + ListSourcesResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.properties != null && message.hasOwnProperty("properties")) { - if (!$util.isObject(message.properties)) - return "properties: object expected"; - var key = Object.keys(message.properties); - for (var i = 0; i < key.length; ++i) { - var error = $root.google.protobuf.Value.verify(message.properties[key[i]]); + if (message.sources != null && message.hasOwnProperty("sources")) { + if (!Array.isArray(message.sources)) + return "sources: array expected"; + for (var i = 0; i < message.sources.length; ++i) { + var error = $root.google.cloud.securitycenter.v1p1beta1.Source.verify(message.sources[i]); if (error) - return "properties." + error; + return "sources." + error; } } - if (message.count != null && message.hasOwnProperty("count")) - if (!$util.isInteger(message.count) && !(message.count && $util.isInteger(message.count.low) && $util.isInteger(message.count.high))) - return "count: integer|Long expected"; + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; return null; }; /** - * Creates a GroupResult message from a plain object. Also converts values to their respective internal types. + * Creates a ListSourcesResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.securitycenter.v1beta1.GroupResult + * @memberof google.cloud.securitycenter.v1p1beta1.ListSourcesResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1beta1.GroupResult} GroupResult + * @returns {google.cloud.securitycenter.v1p1beta1.ListSourcesResponse} ListSourcesResponse */ - GroupResult.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1beta1.GroupResult) + ListSourcesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1p1beta1.ListSourcesResponse) return object; - var message = new $root.google.cloud.securitycenter.v1beta1.GroupResult(); - if (object.properties) { - if (typeof object.properties !== "object") - throw TypeError(".google.cloud.securitycenter.v1beta1.GroupResult.properties: object expected"); - message.properties = {}; - for (var keys = Object.keys(object.properties), i = 0; i < keys.length; ++i) { - if (typeof object.properties[keys[i]] !== "object") - throw TypeError(".google.cloud.securitycenter.v1beta1.GroupResult.properties: object expected"); - message.properties[keys[i]] = $root.google.protobuf.Value.fromObject(object.properties[keys[i]]); + var message = new $root.google.cloud.securitycenter.v1p1beta1.ListSourcesResponse(); + if (object.sources) { + if (!Array.isArray(object.sources)) + throw TypeError(".google.cloud.securitycenter.v1p1beta1.ListSourcesResponse.sources: array expected"); + message.sources = []; + for (var i = 0; i < object.sources.length; ++i) { + if (typeof object.sources[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v1p1beta1.ListSourcesResponse.sources: object expected"); + message.sources[i] = $root.google.cloud.securitycenter.v1p1beta1.Source.fromObject(object.sources[i]); } } - if (object.count != null) - if ($util.Long) - (message.count = $util.Long.fromValue(object.count)).unsigned = false; - else if (typeof object.count === "string") - message.count = parseInt(object.count, 10); - else if (typeof object.count === "number") - message.count = object.count; - else if (typeof object.count === "object") - message.count = new $util.LongBits(object.count.low >>> 0, object.count.high >>> 0).toNumber(); + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); return message; }; /** - * Creates a plain object from a GroupResult message. Also converts values to other types if specified. + * Creates a plain object from a ListSourcesResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.securitycenter.v1beta1.GroupResult + * @memberof google.cloud.securitycenter.v1p1beta1.ListSourcesResponse * @static - * @param {google.cloud.securitycenter.v1beta1.GroupResult} message GroupResult + * @param {google.cloud.securitycenter.v1p1beta1.ListSourcesResponse} message ListSourcesResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GroupResult.toObject = function toObject(message, options) { + ListSourcesResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.objects || options.defaults) - object.properties = {}; + if (options.arrays || options.defaults) + object.sources = []; if (options.defaults) - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.count = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.count = options.longs === String ? "0" : 0; - var keys2; - if (message.properties && (keys2 = Object.keys(message.properties)).length) { - object.properties = {}; - for (var j = 0; j < keys2.length; ++j) - object.properties[keys2[j]] = $root.google.protobuf.Value.toObject(message.properties[keys2[j]], options); + object.nextPageToken = ""; + if (message.sources && message.sources.length) { + object.sources = []; + for (var j = 0; j < message.sources.length; ++j) + object.sources[j] = $root.google.cloud.securitycenter.v1p1beta1.Source.toObject(message.sources[j], options); } - if (message.count != null && message.hasOwnProperty("count")) - if (typeof message.count === "number") - object.count = options.longs === String ? String(message.count) : message.count; - else - object.count = options.longs === String ? $util.Long.prototype.toString.call(message.count) : options.longs === Number ? new $util.LongBits(message.count.low >>> 0, message.count.high >>> 0).toNumber() : message.count; + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; return object; }; /** - * Converts this GroupResult to JSON. + * Converts this ListSourcesResponse to JSON. * @function toJSON - * @memberof google.cloud.securitycenter.v1beta1.GroupResult + * @memberof google.cloud.securitycenter.v1p1beta1.ListSourcesResponse * @instance * @returns {Object.} JSON object */ - GroupResult.prototype.toJSON = function toJSON() { + ListSourcesResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return GroupResult; + return ListSourcesResponse; })(); - v1beta1.ListSourcesRequest = (function() { + v1p1beta1.ListAssetsRequest = (function() { /** - * Properties of a ListSourcesRequest. - * @memberof google.cloud.securitycenter.v1beta1 - * @interface IListSourcesRequest - * @property {string|null} [parent] ListSourcesRequest parent - * @property {string|null} [pageToken] ListSourcesRequest pageToken - * @property {number|null} [pageSize] ListSourcesRequest pageSize + * Properties of a ListAssetsRequest. + * @memberof google.cloud.securitycenter.v1p1beta1 + * @interface IListAssetsRequest + * @property {string|null} [parent] ListAssetsRequest parent + * @property {string|null} [filter] ListAssetsRequest filter + * @property {string|null} [orderBy] ListAssetsRequest orderBy + * @property {google.protobuf.ITimestamp|null} [readTime] ListAssetsRequest readTime + * @property {google.protobuf.IDuration|null} [compareDuration] ListAssetsRequest compareDuration + * @property {string|null} [having] ListAssetsRequest having + * @property {google.protobuf.IFieldMask|null} [fieldMask] ListAssetsRequest fieldMask + * @property {string|null} [pageToken] ListAssetsRequest pageToken + * @property {number|null} [pageSize] ListAssetsRequest pageSize */ /** - * Constructs a new ListSourcesRequest. - * @memberof google.cloud.securitycenter.v1beta1 - * @classdesc Represents a ListSourcesRequest. - * @implements IListSourcesRequest + * Constructs a new ListAssetsRequest. + * @memberof google.cloud.securitycenter.v1p1beta1 + * @classdesc Represents a ListAssetsRequest. + * @implements IListAssetsRequest * @constructor - * @param {google.cloud.securitycenter.v1beta1.IListSourcesRequest=} [properties] Properties to set + * @param {google.cloud.securitycenter.v1p1beta1.IListAssetsRequest=} [properties] Properties to set */ - function ListSourcesRequest(properties) { + function ListAssetsRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -14722,90 +25878,150 @@ } /** - * ListSourcesRequest parent. + * ListAssetsRequest parent. * @member {string} parent - * @memberof google.cloud.securitycenter.v1beta1.ListSourcesRequest + * @memberof google.cloud.securitycenter.v1p1beta1.ListAssetsRequest * @instance */ - ListSourcesRequest.prototype.parent = ""; + ListAssetsRequest.prototype.parent = ""; /** - * ListSourcesRequest pageToken. + * ListAssetsRequest filter. + * @member {string} filter + * @memberof google.cloud.securitycenter.v1p1beta1.ListAssetsRequest + * @instance + */ + ListAssetsRequest.prototype.filter = ""; + + /** + * ListAssetsRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.securitycenter.v1p1beta1.ListAssetsRequest + * @instance + */ + ListAssetsRequest.prototype.orderBy = ""; + + /** + * ListAssetsRequest readTime. + * @member {google.protobuf.ITimestamp|null|undefined} readTime + * @memberof google.cloud.securitycenter.v1p1beta1.ListAssetsRequest + * @instance + */ + ListAssetsRequest.prototype.readTime = null; + + /** + * ListAssetsRequest compareDuration. + * @member {google.protobuf.IDuration|null|undefined} compareDuration + * @memberof google.cloud.securitycenter.v1p1beta1.ListAssetsRequest + * @instance + */ + ListAssetsRequest.prototype.compareDuration = null; + + /** + * ListAssetsRequest having. + * @member {string} having + * @memberof google.cloud.securitycenter.v1p1beta1.ListAssetsRequest + * @instance + */ + ListAssetsRequest.prototype.having = ""; + + /** + * ListAssetsRequest fieldMask. + * @member {google.protobuf.IFieldMask|null|undefined} fieldMask + * @memberof google.cloud.securitycenter.v1p1beta1.ListAssetsRequest + * @instance + */ + ListAssetsRequest.prototype.fieldMask = null; + + /** + * ListAssetsRequest pageToken. * @member {string} pageToken - * @memberof google.cloud.securitycenter.v1beta1.ListSourcesRequest + * @memberof google.cloud.securitycenter.v1p1beta1.ListAssetsRequest * @instance */ - ListSourcesRequest.prototype.pageToken = ""; + ListAssetsRequest.prototype.pageToken = ""; /** - * ListSourcesRequest pageSize. + * ListAssetsRequest pageSize. * @member {number} pageSize - * @memberof google.cloud.securitycenter.v1beta1.ListSourcesRequest + * @memberof google.cloud.securitycenter.v1p1beta1.ListAssetsRequest * @instance */ - ListSourcesRequest.prototype.pageSize = 0; + ListAssetsRequest.prototype.pageSize = 0; /** - * Creates a new ListSourcesRequest instance using the specified properties. + * Creates a new ListAssetsRequest instance using the specified properties. * @function create - * @memberof google.cloud.securitycenter.v1beta1.ListSourcesRequest - * @static - * @param {google.cloud.securitycenter.v1beta1.IListSourcesRequest=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1beta1.ListSourcesRequest} ListSourcesRequest instance + * @memberof google.cloud.securitycenter.v1p1beta1.ListAssetsRequest + * @static + * @param {google.cloud.securitycenter.v1p1beta1.IListAssetsRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1p1beta1.ListAssetsRequest} ListAssetsRequest instance */ - ListSourcesRequest.create = function create(properties) { - return new ListSourcesRequest(properties); + ListAssetsRequest.create = function create(properties) { + return new ListAssetsRequest(properties); }; /** - * Encodes the specified ListSourcesRequest message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.ListSourcesRequest.verify|verify} messages. + * Encodes the specified ListAssetsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.ListAssetsRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.securitycenter.v1beta1.ListSourcesRequest + * @memberof google.cloud.securitycenter.v1p1beta1.ListAssetsRequest * @static - * @param {google.cloud.securitycenter.v1beta1.IListSourcesRequest} message ListSourcesRequest message or plain object to encode + * @param {google.cloud.securitycenter.v1p1beta1.IListAssetsRequest} message ListAssetsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListSourcesRequest.encode = function encode(message, writer) { + ListAssetsRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.parent != null && message.hasOwnProperty("parent")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.filter != null && message.hasOwnProperty("filter")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.orderBy); + if (message.readTime != null && message.hasOwnProperty("readTime")) + $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.compareDuration != null && message.hasOwnProperty("compareDuration")) + $root.google.protobuf.Duration.encode(message.compareDuration, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.having != null && message.hasOwnProperty("having")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.having); + if (message.fieldMask != null && message.hasOwnProperty("fieldMask")) + $root.google.protobuf.FieldMask.encode(message.fieldMask, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); if (message.pageToken != null && message.hasOwnProperty("pageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.pageToken); + writer.uint32(/* id 8, wireType 2 =*/66).string(message.pageToken); if (message.pageSize != null && message.hasOwnProperty("pageSize")) - writer.uint32(/* id 7, wireType 0 =*/56).int32(message.pageSize); + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.pageSize); return writer; }; /** - * Encodes the specified ListSourcesRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.ListSourcesRequest.verify|verify} messages. + * Encodes the specified ListAssetsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.ListAssetsRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1beta1.ListSourcesRequest + * @memberof google.cloud.securitycenter.v1p1beta1.ListAssetsRequest * @static - * @param {google.cloud.securitycenter.v1beta1.IListSourcesRequest} message ListSourcesRequest message or plain object to encode + * @param {google.cloud.securitycenter.v1p1beta1.IListAssetsRequest} message ListAssetsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListSourcesRequest.encodeDelimited = function encodeDelimited(message, writer) { + ListAssetsRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListSourcesRequest message from the specified reader or buffer. + * Decodes a ListAssetsRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.securitycenter.v1beta1.ListSourcesRequest + * @memberof google.cloud.securitycenter.v1p1beta1.ListAssetsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1beta1.ListSourcesRequest} ListSourcesRequest + * @returns {google.cloud.securitycenter.v1p1beta1.ListAssetsRequest} ListAssetsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListSourcesRequest.decode = function decode(reader, length) { + ListAssetsRequest.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.cloud.securitycenter.v1beta1.ListSourcesRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1p1beta1.ListAssetsRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -14813,9 +26029,27 @@ message.parent = reader.string(); break; case 2: - message.pageToken = reader.string(); + message.filter = reader.string(); + break; + case 3: + message.orderBy = reader.string(); + break; + case 4: + message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 5: + message.compareDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + case 6: + message.having = reader.string(); break; case 7: + message.fieldMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + case 8: + message.pageToken = reader.string(); + break; + case 9: message.pageSize = reader.int32(); break; default: @@ -14827,35 +26061,59 @@ }; /** - * Decodes a ListSourcesRequest message from the specified reader or buffer, length delimited. + * Decodes a ListAssetsRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1beta1.ListSourcesRequest + * @memberof google.cloud.securitycenter.v1p1beta1.ListAssetsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1beta1.ListSourcesRequest} ListSourcesRequest + * @returns {google.cloud.securitycenter.v1p1beta1.ListAssetsRequest} ListAssetsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListSourcesRequest.decodeDelimited = function decodeDelimited(reader) { + ListAssetsRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListSourcesRequest message. + * Verifies a ListAssetsRequest message. * @function verify - * @memberof google.cloud.securitycenter.v1beta1.ListSourcesRequest + * @memberof google.cloud.securitycenter.v1p1beta1.ListAssetsRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListSourcesRequest.verify = function verify(message) { + ListAssetsRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.parent != null && message.hasOwnProperty("parent")) if (!$util.isString(message.parent)) return "parent: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + if (message.readTime != null && message.hasOwnProperty("readTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.readTime); + if (error) + return "readTime." + error; + } + if (message.compareDuration != null && message.hasOwnProperty("compareDuration")) { + var error = $root.google.protobuf.Duration.verify(message.compareDuration); + if (error) + return "compareDuration." + error; + } + if (message.having != null && message.hasOwnProperty("having")) + if (!$util.isString(message.having)) + return "having: string expected"; + if (message.fieldMask != null && message.hasOwnProperty("fieldMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.fieldMask); + if (error) + return "fieldMask." + error; + } if (message.pageToken != null && message.hasOwnProperty("pageToken")) if (!$util.isString(message.pageToken)) return "pageToken: string expected"; @@ -14866,19 +26124,40 @@ }; /** - * Creates a ListSourcesRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ListAssetsRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.securitycenter.v1beta1.ListSourcesRequest + * @memberof google.cloud.securitycenter.v1p1beta1.ListAssetsRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1beta1.ListSourcesRequest} ListSourcesRequest + * @returns {google.cloud.securitycenter.v1p1beta1.ListAssetsRequest} ListAssetsRequest */ - ListSourcesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1beta1.ListSourcesRequest) + ListAssetsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1p1beta1.ListAssetsRequest) return object; - var message = new $root.google.cloud.securitycenter.v1beta1.ListSourcesRequest(); + var message = new $root.google.cloud.securitycenter.v1p1beta1.ListAssetsRequest(); if (object.parent != null) message.parent = String(object.parent); + if (object.filter != null) + message.filter = String(object.filter); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.readTime != null) { + if (typeof object.readTime !== "object") + throw TypeError(".google.cloud.securitycenter.v1p1beta1.ListAssetsRequest.readTime: object expected"); + message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); + } + if (object.compareDuration != null) { + if (typeof object.compareDuration !== "object") + throw TypeError(".google.cloud.securitycenter.v1p1beta1.ListAssetsRequest.compareDuration: object expected"); + message.compareDuration = $root.google.protobuf.Duration.fromObject(object.compareDuration); + } + if (object.having != null) + message.having = String(object.having); + if (object.fieldMask != null) { + if (typeof object.fieldMask !== "object") + throw TypeError(".google.cloud.securitycenter.v1p1beta1.ListAssetsRequest.fieldMask: object expected"); + message.fieldMask = $root.google.protobuf.FieldMask.fromObject(object.fieldMask); + } if (object.pageToken != null) message.pageToken = String(object.pageToken); if (object.pageSize != null) @@ -14887,25 +26166,43 @@ }; /** - * Creates a plain object from a ListSourcesRequest message. Also converts values to other types if specified. + * Creates a plain object from a ListAssetsRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.securitycenter.v1beta1.ListSourcesRequest + * @memberof google.cloud.securitycenter.v1p1beta1.ListAssetsRequest * @static - * @param {google.cloud.securitycenter.v1beta1.ListSourcesRequest} message ListSourcesRequest + * @param {google.cloud.securitycenter.v1p1beta1.ListAssetsRequest} message ListAssetsRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListSourcesRequest.toObject = function toObject(message, options) { + ListAssetsRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { object.parent = ""; + object.filter = ""; + object.orderBy = ""; + object.readTime = null; + object.compareDuration = null; + object.having = ""; + object.fieldMask = null; object.pageToken = ""; object.pageSize = 0; } if (message.parent != null && message.hasOwnProperty("parent")) object.parent = message.parent; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; + if (message.readTime != null && message.hasOwnProperty("readTime")) + object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); + if (message.compareDuration != null && message.hasOwnProperty("compareDuration")) + object.compareDuration = $root.google.protobuf.Duration.toObject(message.compareDuration, options); + if (message.having != null && message.hasOwnProperty("having")) + object.having = message.having; + if (message.fieldMask != null && message.hasOwnProperty("fieldMask")) + object.fieldMask = $root.google.protobuf.FieldMask.toObject(message.fieldMask, options); if (message.pageToken != null && message.hasOwnProperty("pageToken")) object.pageToken = message.pageToken; if (message.pageSize != null && message.hasOwnProperty("pageSize")) @@ -14914,39 +26211,41 @@ }; /** - * Converts this ListSourcesRequest to JSON. + * Converts this ListAssetsRequest to JSON. * @function toJSON - * @memberof google.cloud.securitycenter.v1beta1.ListSourcesRequest + * @memberof google.cloud.securitycenter.v1p1beta1.ListAssetsRequest * @instance * @returns {Object.} JSON object */ - ListSourcesRequest.prototype.toJSON = function toJSON() { + ListAssetsRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ListSourcesRequest; + return ListAssetsRequest; })(); - v1beta1.ListSourcesResponse = (function() { + v1p1beta1.ListAssetsResponse = (function() { /** - * Properties of a ListSourcesResponse. - * @memberof google.cloud.securitycenter.v1beta1 - * @interface IListSourcesResponse - * @property {Array.|null} [sources] ListSourcesResponse sources - * @property {string|null} [nextPageToken] ListSourcesResponse nextPageToken + * Properties of a ListAssetsResponse. + * @memberof google.cloud.securitycenter.v1p1beta1 + * @interface IListAssetsResponse + * @property {Array.|null} [listAssetsResults] ListAssetsResponse listAssetsResults + * @property {google.protobuf.ITimestamp|null} [readTime] ListAssetsResponse readTime + * @property {string|null} [nextPageToken] ListAssetsResponse nextPageToken + * @property {number|null} [totalSize] ListAssetsResponse totalSize */ /** - * Constructs a new ListSourcesResponse. - * @memberof google.cloud.securitycenter.v1beta1 - * @classdesc Represents a ListSourcesResponse. - * @implements IListSourcesResponse + * Constructs a new ListAssetsResponse. + * @memberof google.cloud.securitycenter.v1p1beta1 + * @classdesc Represents a ListAssetsResponse. + * @implements IListAssetsResponse * @constructor - * @param {google.cloud.securitycenter.v1beta1.IListSourcesResponse=} [properties] Properties to set + * @param {google.cloud.securitycenter.v1p1beta1.IListAssetsResponse=} [properties] Properties to set */ - function ListSourcesResponse(properties) { - this.sources = []; + function ListAssetsResponse(properties) { + this.listAssetsResults = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -14954,92 +26253,118 @@ } /** - * ListSourcesResponse sources. - * @member {Array.} sources - * @memberof google.cloud.securitycenter.v1beta1.ListSourcesResponse + * ListAssetsResponse listAssetsResults. + * @member {Array.} listAssetsResults + * @memberof google.cloud.securitycenter.v1p1beta1.ListAssetsResponse * @instance */ - ListSourcesResponse.prototype.sources = $util.emptyArray; + ListAssetsResponse.prototype.listAssetsResults = $util.emptyArray; /** - * ListSourcesResponse nextPageToken. + * ListAssetsResponse readTime. + * @member {google.protobuf.ITimestamp|null|undefined} readTime + * @memberof google.cloud.securitycenter.v1p1beta1.ListAssetsResponse + * @instance + */ + ListAssetsResponse.prototype.readTime = null; + + /** + * ListAssetsResponse nextPageToken. * @member {string} nextPageToken - * @memberof google.cloud.securitycenter.v1beta1.ListSourcesResponse + * @memberof google.cloud.securitycenter.v1p1beta1.ListAssetsResponse * @instance */ - ListSourcesResponse.prototype.nextPageToken = ""; + ListAssetsResponse.prototype.nextPageToken = ""; /** - * Creates a new ListSourcesResponse instance using the specified properties. + * ListAssetsResponse totalSize. + * @member {number} totalSize + * @memberof google.cloud.securitycenter.v1p1beta1.ListAssetsResponse + * @instance + */ + ListAssetsResponse.prototype.totalSize = 0; + + /** + * Creates a new ListAssetsResponse instance using the specified properties. * @function create - * @memberof google.cloud.securitycenter.v1beta1.ListSourcesResponse + * @memberof google.cloud.securitycenter.v1p1beta1.ListAssetsResponse * @static - * @param {google.cloud.securitycenter.v1beta1.IListSourcesResponse=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1beta1.ListSourcesResponse} ListSourcesResponse instance + * @param {google.cloud.securitycenter.v1p1beta1.IListAssetsResponse=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1p1beta1.ListAssetsResponse} ListAssetsResponse instance */ - ListSourcesResponse.create = function create(properties) { - return new ListSourcesResponse(properties); + ListAssetsResponse.create = function create(properties) { + return new ListAssetsResponse(properties); }; /** - * Encodes the specified ListSourcesResponse message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.ListSourcesResponse.verify|verify} messages. + * Encodes the specified ListAssetsResponse message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.securitycenter.v1beta1.ListSourcesResponse + * @memberof google.cloud.securitycenter.v1p1beta1.ListAssetsResponse * @static - * @param {google.cloud.securitycenter.v1beta1.IListSourcesResponse} message ListSourcesResponse message or plain object to encode + * @param {google.cloud.securitycenter.v1p1beta1.IListAssetsResponse} message ListAssetsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListSourcesResponse.encode = function encode(message, writer) { + ListAssetsResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.sources != null && message.sources.length) - for (var i = 0; i < message.sources.length; ++i) - $root.google.cloud.securitycenter.v1beta1.Source.encode(message.sources[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.listAssetsResults != null && message.listAssetsResults.length) + for (var i = 0; i < message.listAssetsResults.length; ++i) + $root.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult.encode(message.listAssetsResults[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.readTime != null && message.hasOwnProperty("readTime")) + $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + writer.uint32(/* id 3, wireType 2 =*/26).string(message.nextPageToken); + if (message.totalSize != null && message.hasOwnProperty("totalSize")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.totalSize); return writer; }; /** - * Encodes the specified ListSourcesResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.ListSourcesResponse.verify|verify} messages. + * Encodes the specified ListAssetsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1beta1.ListSourcesResponse + * @memberof google.cloud.securitycenter.v1p1beta1.ListAssetsResponse * @static - * @param {google.cloud.securitycenter.v1beta1.IListSourcesResponse} message ListSourcesResponse message or plain object to encode + * @param {google.cloud.securitycenter.v1p1beta1.IListAssetsResponse} message ListAssetsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListSourcesResponse.encodeDelimited = function encodeDelimited(message, writer) { + ListAssetsResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListSourcesResponse message from the specified reader or buffer. + * Decodes a ListAssetsResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.securitycenter.v1beta1.ListSourcesResponse + * @memberof google.cloud.securitycenter.v1p1beta1.ListAssetsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1beta1.ListSourcesResponse} ListSourcesResponse + * @returns {google.cloud.securitycenter.v1p1beta1.ListAssetsResponse} ListAssetsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListSourcesResponse.decode = function decode(reader, length) { + ListAssetsResponse.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.cloud.securitycenter.v1beta1.ListSourcesResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - if (!(message.sources && message.sources.length)) - message.sources = []; - message.sources.push($root.google.cloud.securitycenter.v1beta1.Source.decode(reader, reader.uint32())); + if (!(message.listAssetsResults && message.listAssetsResults.length)) + message.listAssetsResults = []; + message.listAssetsResults.push($root.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult.decode(reader, reader.uint32())); break; case 2: + message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 3: message.nextPageToken = reader.string(); break; + case 4: + message.totalSize = reader.int32(); + break; default: reader.skipType(tag & 7); break; @@ -15049,140 +26374,419 @@ }; /** - * Decodes a ListSourcesResponse message from the specified reader or buffer, length delimited. + * Decodes a ListAssetsResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1beta1.ListSourcesResponse + * @memberof google.cloud.securitycenter.v1p1beta1.ListAssetsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1beta1.ListSourcesResponse} ListSourcesResponse + * @returns {google.cloud.securitycenter.v1p1beta1.ListAssetsResponse} ListAssetsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListSourcesResponse.decodeDelimited = function decodeDelimited(reader) { + ListAssetsResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListSourcesResponse message. + * Verifies a ListAssetsResponse message. * @function verify - * @memberof google.cloud.securitycenter.v1beta1.ListSourcesResponse + * @memberof google.cloud.securitycenter.v1p1beta1.ListAssetsResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListSourcesResponse.verify = function verify(message) { + ListAssetsResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.sources != null && message.hasOwnProperty("sources")) { - if (!Array.isArray(message.sources)) - return "sources: array expected"; - for (var i = 0; i < message.sources.length; ++i) { - var error = $root.google.cloud.securitycenter.v1beta1.Source.verify(message.sources[i]); + if (message.listAssetsResults != null && message.hasOwnProperty("listAssetsResults")) { + if (!Array.isArray(message.listAssetsResults)) + return "listAssetsResults: array expected"; + for (var i = 0; i < message.listAssetsResults.length; ++i) { + var error = $root.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult.verify(message.listAssetsResults[i]); if (error) - return "sources." + error; + return "listAssetsResults." + error; } } + if (message.readTime != null && message.hasOwnProperty("readTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.readTime); + if (error) + return "readTime." + error; + } if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) if (!$util.isString(message.nextPageToken)) return "nextPageToken: string expected"; + if (message.totalSize != null && message.hasOwnProperty("totalSize")) + if (!$util.isInteger(message.totalSize)) + return "totalSize: integer expected"; return null; }; /** - * Creates a ListSourcesResponse message from a plain object. Also converts values to their respective internal types. + * Creates a ListAssetsResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.securitycenter.v1beta1.ListSourcesResponse + * @memberof google.cloud.securitycenter.v1p1beta1.ListAssetsResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1beta1.ListSourcesResponse} ListSourcesResponse + * @returns {google.cloud.securitycenter.v1p1beta1.ListAssetsResponse} ListAssetsResponse */ - ListSourcesResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1beta1.ListSourcesResponse) + ListAssetsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse) return object; - var message = new $root.google.cloud.securitycenter.v1beta1.ListSourcesResponse(); - if (object.sources) { - if (!Array.isArray(object.sources)) - throw TypeError(".google.cloud.securitycenter.v1beta1.ListSourcesResponse.sources: array expected"); - message.sources = []; - for (var i = 0; i < object.sources.length; ++i) { - if (typeof object.sources[i] !== "object") - throw TypeError(".google.cloud.securitycenter.v1beta1.ListSourcesResponse.sources: object expected"); - message.sources[i] = $root.google.cloud.securitycenter.v1beta1.Source.fromObject(object.sources[i]); + var message = new $root.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse(); + if (object.listAssetsResults) { + if (!Array.isArray(object.listAssetsResults)) + throw TypeError(".google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.listAssetsResults: array expected"); + message.listAssetsResults = []; + for (var i = 0; i < object.listAssetsResults.length; ++i) { + if (typeof object.listAssetsResults[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.listAssetsResults: object expected"); + message.listAssetsResults[i] = $root.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult.fromObject(object.listAssetsResults[i]); + } + } + if (object.readTime != null) { + if (typeof object.readTime !== "object") + throw TypeError(".google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.readTime: object expected"); + message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.totalSize != null) + message.totalSize = object.totalSize | 0; + return message; + }; + + /** + * Creates a plain object from a ListAssetsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1p1beta1.ListAssetsResponse + * @static + * @param {google.cloud.securitycenter.v1p1beta1.ListAssetsResponse} message ListAssetsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListAssetsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.listAssetsResults = []; + if (options.defaults) { + object.readTime = null; + object.nextPageToken = ""; + object.totalSize = 0; + } + if (message.listAssetsResults && message.listAssetsResults.length) { + object.listAssetsResults = []; + for (var j = 0; j < message.listAssetsResults.length; ++j) + object.listAssetsResults[j] = $root.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult.toObject(message.listAssetsResults[j], options); + } + if (message.readTime != null && message.hasOwnProperty("readTime")) + object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.totalSize != null && message.hasOwnProperty("totalSize")) + object.totalSize = message.totalSize; + return object; + }; + + /** + * Converts this ListAssetsResponse to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1p1beta1.ListAssetsResponse + * @instance + * @returns {Object.} JSON object + */ + ListAssetsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + ListAssetsResponse.ListAssetsResult = (function() { + + /** + * Properties of a ListAssetsResult. + * @memberof google.cloud.securitycenter.v1p1beta1.ListAssetsResponse + * @interface IListAssetsResult + * @property {google.cloud.securitycenter.v1p1beta1.IAsset|null} [asset] ListAssetsResult asset + * @property {google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult.StateChange|null} [stateChange] ListAssetsResult stateChange + */ + + /** + * Constructs a new ListAssetsResult. + * @memberof google.cloud.securitycenter.v1p1beta1.ListAssetsResponse + * @classdesc Represents a ListAssetsResult. + * @implements IListAssetsResult + * @constructor + * @param {google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.IListAssetsResult=} [properties] Properties to set + */ + function ListAssetsResult(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]]; + } + + /** + * ListAssetsResult asset. + * @member {google.cloud.securitycenter.v1p1beta1.IAsset|null|undefined} asset + * @memberof google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult + * @instance + */ + ListAssetsResult.prototype.asset = null; + + /** + * ListAssetsResult stateChange. + * @member {google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult.StateChange} stateChange + * @memberof google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult + * @instance + */ + ListAssetsResult.prototype.stateChange = 0; + + /** + * Creates a new ListAssetsResult instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult + * @static + * @param {google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.IListAssetsResult=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult} ListAssetsResult instance + */ + ListAssetsResult.create = function create(properties) { + return new ListAssetsResult(properties); + }; + + /** + * Encodes the specified ListAssetsResult message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult + * @static + * @param {google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.IListAssetsResult} message ListAssetsResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAssetsResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.asset != null && message.hasOwnProperty("asset")) + $root.google.cloud.securitycenter.v1p1beta1.Asset.encode(message.asset, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.stateChange != null && message.hasOwnProperty("stateChange")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.stateChange); + return writer; + }; + + /** + * Encodes the specified ListAssetsResult message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult + * @static + * @param {google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.IListAssetsResult} message ListAssetsResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAssetsResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListAssetsResult message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult} ListAssetsResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAssetsResult.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.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.asset = $root.google.cloud.securitycenter.v1p1beta1.Asset.decode(reader, reader.uint32()); + break; + case 2: + message.stateChange = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListAssetsResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult} ListAssetsResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAssetsResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListAssetsResult message. + * @function verify + * @memberof google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListAssetsResult.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.asset != null && message.hasOwnProperty("asset")) { + var error = $root.google.cloud.securitycenter.v1p1beta1.Asset.verify(message.asset); + if (error) + return "asset." + error; + } + if (message.stateChange != null && message.hasOwnProperty("stateChange")) + switch (message.stateChange) { + default: + return "stateChange: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + return null; + }; + + /** + * Creates a ListAssetsResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult} ListAssetsResult + */ + ListAssetsResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult) + return object; + var message = new $root.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult(); + if (object.asset != null) { + if (typeof object.asset !== "object") + throw TypeError(".google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult.asset: object expected"); + message.asset = $root.google.cloud.securitycenter.v1p1beta1.Asset.fromObject(object.asset); + } + switch (object.stateChange) { + case "UNUSED": + case 0: + message.stateChange = 0; + break; + case "ADDED": + case 1: + message.stateChange = 1; + break; + case "REMOVED": + case 2: + message.stateChange = 2; + break; + case "ACTIVE": + case 3: + message.stateChange = 3; + break; + } + return message; + }; + + /** + * Creates a plain object from a ListAssetsResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult + * @static + * @param {google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult} message ListAssetsResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListAssetsResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.asset = null; + object.stateChange = options.enums === String ? "UNUSED" : 0; } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - return message; - }; + if (message.asset != null && message.hasOwnProperty("asset")) + object.asset = $root.google.cloud.securitycenter.v1p1beta1.Asset.toObject(message.asset, options); + if (message.stateChange != null && message.hasOwnProperty("stateChange")) + object.stateChange = options.enums === String ? $root.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult.StateChange[message.stateChange] : message.stateChange; + return object; + }; - /** - * Creates a plain object from a ListSourcesResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v1beta1.ListSourcesResponse - * @static - * @param {google.cloud.securitycenter.v1beta1.ListSourcesResponse} message ListSourcesResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListSourcesResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.sources = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.sources && message.sources.length) { - object.sources = []; - for (var j = 0; j < message.sources.length; ++j) - object.sources[j] = $root.google.cloud.securitycenter.v1beta1.Source.toObject(message.sources[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - return object; - }; + /** + * Converts this ListAssetsResult to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult + * @instance + * @returns {Object.} JSON object + */ + ListAssetsResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Converts this ListSourcesResponse to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1beta1.ListSourcesResponse - * @instance - * @returns {Object.} JSON object - */ - ListSourcesResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * StateChange enum. + * @name google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult.StateChange + * @enum {string} + * @property {number} UNUSED=0 UNUSED value + * @property {number} ADDED=1 ADDED value + * @property {number} REMOVED=2 REMOVED value + * @property {number} ACTIVE=3 ACTIVE value + */ + ListAssetsResult.StateChange = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNUSED"] = 0; + values[valuesById[1] = "ADDED"] = 1; + values[valuesById[2] = "REMOVED"] = 2; + values[valuesById[3] = "ACTIVE"] = 3; + return values; + })(); - return ListSourcesResponse; + return ListAssetsResult; + })(); + + return ListAssetsResponse; })(); - v1beta1.ListAssetsRequest = (function() { + v1p1beta1.ListFindingsRequest = (function() { /** - * Properties of a ListAssetsRequest. - * @memberof google.cloud.securitycenter.v1beta1 - * @interface IListAssetsRequest - * @property {string|null} [parent] ListAssetsRequest parent - * @property {string|null} [filter] ListAssetsRequest filter - * @property {string|null} [orderBy] ListAssetsRequest orderBy - * @property {google.protobuf.ITimestamp|null} [readTime] ListAssetsRequest readTime - * @property {google.protobuf.IDuration|null} [compareDuration] ListAssetsRequest compareDuration - * @property {google.protobuf.IFieldMask|null} [fieldMask] ListAssetsRequest fieldMask - * @property {string|null} [pageToken] ListAssetsRequest pageToken - * @property {number|null} [pageSize] ListAssetsRequest pageSize + * Properties of a ListFindingsRequest. + * @memberof google.cloud.securitycenter.v1p1beta1 + * @interface IListFindingsRequest + * @property {string|null} [parent] ListFindingsRequest parent + * @property {string|null} [filter] ListFindingsRequest filter + * @property {string|null} [orderBy] ListFindingsRequest orderBy + * @property {google.protobuf.ITimestamp|null} [readTime] ListFindingsRequest readTime + * @property {google.protobuf.IDuration|null} [compareDuration] ListFindingsRequest compareDuration + * @property {string|null} [having] ListFindingsRequest having + * @property {google.protobuf.IFieldMask|null} [fieldMask] ListFindingsRequest fieldMask + * @property {string|null} [pageToken] ListFindingsRequest pageToken + * @property {number|null} [pageSize] ListFindingsRequest pageSize */ /** - * Constructs a new ListAssetsRequest. - * @memberof google.cloud.securitycenter.v1beta1 - * @classdesc Represents a ListAssetsRequest. - * @implements IListAssetsRequest + * Constructs a new ListFindingsRequest. + * @memberof google.cloud.securitycenter.v1p1beta1 + * @classdesc Represents a ListFindingsRequest. + * @implements IListFindingsRequest * @constructor - * @param {google.cloud.securitycenter.v1beta1.IListAssetsRequest=} [properties] Properties to set + * @param {google.cloud.securitycenter.v1p1beta1.IListFindingsRequest=} [properties] Properties to set */ - function ListAssetsRequest(properties) { + function ListFindingsRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -15190,91 +26794,99 @@ } /** - * ListAssetsRequest parent. + * ListFindingsRequest parent. * @member {string} parent - * @memberof google.cloud.securitycenter.v1beta1.ListAssetsRequest + * @memberof google.cloud.securitycenter.v1p1beta1.ListFindingsRequest * @instance */ - ListAssetsRequest.prototype.parent = ""; + ListFindingsRequest.prototype.parent = ""; /** - * ListAssetsRequest filter. + * ListFindingsRequest filter. * @member {string} filter - * @memberof google.cloud.securitycenter.v1beta1.ListAssetsRequest + * @memberof google.cloud.securitycenter.v1p1beta1.ListFindingsRequest * @instance */ - ListAssetsRequest.prototype.filter = ""; + ListFindingsRequest.prototype.filter = ""; /** - * ListAssetsRequest orderBy. + * ListFindingsRequest orderBy. * @member {string} orderBy - * @memberof google.cloud.securitycenter.v1beta1.ListAssetsRequest + * @memberof google.cloud.securitycenter.v1p1beta1.ListFindingsRequest * @instance */ - ListAssetsRequest.prototype.orderBy = ""; + ListFindingsRequest.prototype.orderBy = ""; /** - * ListAssetsRequest readTime. + * ListFindingsRequest readTime. * @member {google.protobuf.ITimestamp|null|undefined} readTime - * @memberof google.cloud.securitycenter.v1beta1.ListAssetsRequest + * @memberof google.cloud.securitycenter.v1p1beta1.ListFindingsRequest * @instance */ - ListAssetsRequest.prototype.readTime = null; + ListFindingsRequest.prototype.readTime = null; /** - * ListAssetsRequest compareDuration. + * ListFindingsRequest compareDuration. * @member {google.protobuf.IDuration|null|undefined} compareDuration - * @memberof google.cloud.securitycenter.v1beta1.ListAssetsRequest + * @memberof google.cloud.securitycenter.v1p1beta1.ListFindingsRequest * @instance */ - ListAssetsRequest.prototype.compareDuration = null; + ListFindingsRequest.prototype.compareDuration = null; /** - * ListAssetsRequest fieldMask. + * ListFindingsRequest having. + * @member {string} having + * @memberof google.cloud.securitycenter.v1p1beta1.ListFindingsRequest + * @instance + */ + ListFindingsRequest.prototype.having = ""; + + /** + * ListFindingsRequest fieldMask. * @member {google.protobuf.IFieldMask|null|undefined} fieldMask - * @memberof google.cloud.securitycenter.v1beta1.ListAssetsRequest + * @memberof google.cloud.securitycenter.v1p1beta1.ListFindingsRequest * @instance */ - ListAssetsRequest.prototype.fieldMask = null; + ListFindingsRequest.prototype.fieldMask = null; /** - * ListAssetsRequest pageToken. + * ListFindingsRequest pageToken. * @member {string} pageToken - * @memberof google.cloud.securitycenter.v1beta1.ListAssetsRequest + * @memberof google.cloud.securitycenter.v1p1beta1.ListFindingsRequest * @instance */ - ListAssetsRequest.prototype.pageToken = ""; + ListFindingsRequest.prototype.pageToken = ""; /** - * ListAssetsRequest pageSize. + * ListFindingsRequest pageSize. * @member {number} pageSize - * @memberof google.cloud.securitycenter.v1beta1.ListAssetsRequest + * @memberof google.cloud.securitycenter.v1p1beta1.ListFindingsRequest * @instance */ - ListAssetsRequest.prototype.pageSize = 0; + ListFindingsRequest.prototype.pageSize = 0; /** - * Creates a new ListAssetsRequest instance using the specified properties. + * Creates a new ListFindingsRequest instance using the specified properties. * @function create - * @memberof google.cloud.securitycenter.v1beta1.ListAssetsRequest + * @memberof google.cloud.securitycenter.v1p1beta1.ListFindingsRequest * @static - * @param {google.cloud.securitycenter.v1beta1.IListAssetsRequest=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1beta1.ListAssetsRequest} ListAssetsRequest instance + * @param {google.cloud.securitycenter.v1p1beta1.IListFindingsRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1p1beta1.ListFindingsRequest} ListFindingsRequest instance */ - ListAssetsRequest.create = function create(properties) { - return new ListAssetsRequest(properties); + ListFindingsRequest.create = function create(properties) { + return new ListFindingsRequest(properties); }; /** - * Encodes the specified ListAssetsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.ListAssetsRequest.verify|verify} messages. + * Encodes the specified ListFindingsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.ListFindingsRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.securitycenter.v1beta1.ListAssetsRequest + * @memberof google.cloud.securitycenter.v1p1beta1.ListFindingsRequest * @static - * @param {google.cloud.securitycenter.v1beta1.IListAssetsRequest} message ListAssetsRequest message or plain object to encode + * @param {google.cloud.securitycenter.v1p1beta1.IListFindingsRequest} message ListFindingsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListAssetsRequest.encode = function encode(message, writer) { + ListFindingsRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.parent != null && message.hasOwnProperty("parent")) @@ -15287,6 +26899,8 @@ $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); if (message.compareDuration != null && message.hasOwnProperty("compareDuration")) $root.google.protobuf.Duration.encode(message.compareDuration, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.having != null && message.hasOwnProperty("having")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.having); if (message.fieldMask != null && message.hasOwnProperty("fieldMask")) $root.google.protobuf.FieldMask.encode(message.fieldMask, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); if (message.pageToken != null && message.hasOwnProperty("pageToken")) @@ -15297,33 +26911,33 @@ }; /** - * Encodes the specified ListAssetsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.ListAssetsRequest.verify|verify} messages. + * Encodes the specified ListFindingsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.ListFindingsRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1beta1.ListAssetsRequest + * @memberof google.cloud.securitycenter.v1p1beta1.ListFindingsRequest * @static - * @param {google.cloud.securitycenter.v1beta1.IListAssetsRequest} message ListAssetsRequest message or plain object to encode + * @param {google.cloud.securitycenter.v1p1beta1.IListFindingsRequest} message ListFindingsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListAssetsRequest.encodeDelimited = function encodeDelimited(message, writer) { + ListFindingsRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListAssetsRequest message from the specified reader or buffer. + * Decodes a ListFindingsRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.securitycenter.v1beta1.ListAssetsRequest + * @memberof google.cloud.securitycenter.v1p1beta1.ListFindingsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1beta1.ListAssetsRequest} ListAssetsRequest + * @returns {google.cloud.securitycenter.v1p1beta1.ListFindingsRequest} ListFindingsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListAssetsRequest.decode = function decode(reader, length) { + ListFindingsRequest.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.cloud.securitycenter.v1beta1.ListAssetsRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1p1beta1.ListFindingsRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -15342,6 +26956,9 @@ case 5: message.compareDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); break; + case 6: + message.having = reader.string(); + break; case 7: message.fieldMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); break; @@ -15360,30 +26977,30 @@ }; /** - * Decodes a ListAssetsRequest message from the specified reader or buffer, length delimited. + * Decodes a ListFindingsRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1beta1.ListAssetsRequest + * @memberof google.cloud.securitycenter.v1p1beta1.ListFindingsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1beta1.ListAssetsRequest} ListAssetsRequest + * @returns {google.cloud.securitycenter.v1p1beta1.ListFindingsRequest} ListFindingsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListAssetsRequest.decodeDelimited = function decodeDelimited(reader) { + ListFindingsRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListAssetsRequest message. + * Verifies a ListFindingsRequest message. * @function verify - * @memberof google.cloud.securitycenter.v1beta1.ListAssetsRequest + * @memberof google.cloud.securitycenter.v1p1beta1.ListFindingsRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListAssetsRequest.verify = function verify(message) { + ListFindingsRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.parent != null && message.hasOwnProperty("parent")) @@ -15405,6 +27022,9 @@ if (error) return "compareDuration." + error; } + if (message.having != null && message.hasOwnProperty("having")) + if (!$util.isString(message.having)) + return "having: string expected"; if (message.fieldMask != null && message.hasOwnProperty("fieldMask")) { var error = $root.google.protobuf.FieldMask.verify(message.fieldMask); if (error) @@ -15420,17 +27040,17 @@ }; /** - * Creates a ListAssetsRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ListFindingsRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.securitycenter.v1beta1.ListAssetsRequest + * @memberof google.cloud.securitycenter.v1p1beta1.ListFindingsRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1beta1.ListAssetsRequest} ListAssetsRequest + * @returns {google.cloud.securitycenter.v1p1beta1.ListFindingsRequest} ListFindingsRequest */ - ListAssetsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1beta1.ListAssetsRequest) + ListFindingsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1p1beta1.ListFindingsRequest) return object; - var message = new $root.google.cloud.securitycenter.v1beta1.ListAssetsRequest(); + var message = new $root.google.cloud.securitycenter.v1p1beta1.ListFindingsRequest(); if (object.parent != null) message.parent = String(object.parent); if (object.filter != null) @@ -15439,17 +27059,19 @@ message.orderBy = String(object.orderBy); if (object.readTime != null) { if (typeof object.readTime !== "object") - throw TypeError(".google.cloud.securitycenter.v1beta1.ListAssetsRequest.readTime: object expected"); + throw TypeError(".google.cloud.securitycenter.v1p1beta1.ListFindingsRequest.readTime: object expected"); message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); } if (object.compareDuration != null) { if (typeof object.compareDuration !== "object") - throw TypeError(".google.cloud.securitycenter.v1beta1.ListAssetsRequest.compareDuration: object expected"); + throw TypeError(".google.cloud.securitycenter.v1p1beta1.ListFindingsRequest.compareDuration: object expected"); message.compareDuration = $root.google.protobuf.Duration.fromObject(object.compareDuration); } + if (object.having != null) + message.having = String(object.having); if (object.fieldMask != null) { if (typeof object.fieldMask !== "object") - throw TypeError(".google.cloud.securitycenter.v1beta1.ListAssetsRequest.fieldMask: object expected"); + throw TypeError(".google.cloud.securitycenter.v1p1beta1.ListFindingsRequest.fieldMask: object expected"); message.fieldMask = $root.google.protobuf.FieldMask.fromObject(object.fieldMask); } if (object.pageToken != null) @@ -15460,15 +27082,15 @@ }; /** - * Creates a plain object from a ListAssetsRequest message. Also converts values to other types if specified. + * Creates a plain object from a ListFindingsRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.securitycenter.v1beta1.ListAssetsRequest + * @memberof google.cloud.securitycenter.v1p1beta1.ListFindingsRequest * @static - * @param {google.cloud.securitycenter.v1beta1.ListAssetsRequest} message ListAssetsRequest + * @param {google.cloud.securitycenter.v1p1beta1.ListFindingsRequest} message ListFindingsRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListAssetsRequest.toObject = function toObject(message, options) { + ListFindingsRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; @@ -15478,6 +27100,7 @@ object.orderBy = ""; object.readTime = null; object.compareDuration = null; + object.having = ""; object.fieldMask = null; object.pageToken = ""; object.pageSize = 0; @@ -15492,6 +27115,8 @@ object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); if (message.compareDuration != null && message.hasOwnProperty("compareDuration")) object.compareDuration = $root.google.protobuf.Duration.toObject(message.compareDuration, options); + if (message.having != null && message.hasOwnProperty("having")) + object.having = message.having; if (message.fieldMask != null && message.hasOwnProperty("fieldMask")) object.fieldMask = $root.google.protobuf.FieldMask.toObject(message.fieldMask, options); if (message.pageToken != null && message.hasOwnProperty("pageToken")) @@ -15502,41 +27127,41 @@ }; /** - * Converts this ListAssetsRequest to JSON. + * Converts this ListFindingsRequest to JSON. * @function toJSON - * @memberof google.cloud.securitycenter.v1beta1.ListAssetsRequest + * @memberof google.cloud.securitycenter.v1p1beta1.ListFindingsRequest * @instance * @returns {Object.} JSON object */ - ListAssetsRequest.prototype.toJSON = function toJSON() { + ListFindingsRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ListAssetsRequest; + return ListFindingsRequest; })(); - v1beta1.ListAssetsResponse = (function() { + v1p1beta1.ListFindingsResponse = (function() { /** - * Properties of a ListAssetsResponse. - * @memberof google.cloud.securitycenter.v1beta1 - * @interface IListAssetsResponse - * @property {Array.|null} [listAssetsResults] ListAssetsResponse listAssetsResults - * @property {google.protobuf.ITimestamp|null} [readTime] ListAssetsResponse readTime - * @property {string|null} [nextPageToken] ListAssetsResponse nextPageToken - * @property {number|null} [totalSize] ListAssetsResponse totalSize + * Properties of a ListFindingsResponse. + * @memberof google.cloud.securitycenter.v1p1beta1 + * @interface IListFindingsResponse + * @property {Array.|null} [listFindingsResults] ListFindingsResponse listFindingsResults + * @property {google.protobuf.ITimestamp|null} [readTime] ListFindingsResponse readTime + * @property {string|null} [nextPageToken] ListFindingsResponse nextPageToken + * @property {number|null} [totalSize] ListFindingsResponse totalSize */ /** - * Constructs a new ListAssetsResponse. - * @memberof google.cloud.securitycenter.v1beta1 - * @classdesc Represents a ListAssetsResponse. - * @implements IListAssetsResponse + * Constructs a new ListFindingsResponse. + * @memberof google.cloud.securitycenter.v1p1beta1 + * @classdesc Represents a ListFindingsResponse. + * @implements IListFindingsResponse * @constructor - * @param {google.cloud.securitycenter.v1beta1.IListAssetsResponse=} [properties] Properties to set + * @param {google.cloud.securitycenter.v1p1beta1.IListFindingsResponse=} [properties] Properties to set */ - function ListAssetsResponse(properties) { - this.listAssetsResults = []; + function ListFindingsResponse(properties) { + this.listFindingsResults = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -15544,64 +27169,64 @@ } /** - * ListAssetsResponse listAssetsResults. - * @member {Array.} listAssetsResults - * @memberof google.cloud.securitycenter.v1beta1.ListAssetsResponse + * ListFindingsResponse listFindingsResults. + * @member {Array.} listFindingsResults + * @memberof google.cloud.securitycenter.v1p1beta1.ListFindingsResponse * @instance */ - ListAssetsResponse.prototype.listAssetsResults = $util.emptyArray; + ListFindingsResponse.prototype.listFindingsResults = $util.emptyArray; /** - * ListAssetsResponse readTime. + * ListFindingsResponse readTime. * @member {google.protobuf.ITimestamp|null|undefined} readTime - * @memberof google.cloud.securitycenter.v1beta1.ListAssetsResponse + * @memberof google.cloud.securitycenter.v1p1beta1.ListFindingsResponse * @instance */ - ListAssetsResponse.prototype.readTime = null; + ListFindingsResponse.prototype.readTime = null; /** - * ListAssetsResponse nextPageToken. + * ListFindingsResponse nextPageToken. * @member {string} nextPageToken - * @memberof google.cloud.securitycenter.v1beta1.ListAssetsResponse + * @memberof google.cloud.securitycenter.v1p1beta1.ListFindingsResponse * @instance */ - ListAssetsResponse.prototype.nextPageToken = ""; + ListFindingsResponse.prototype.nextPageToken = ""; /** - * ListAssetsResponse totalSize. + * ListFindingsResponse totalSize. * @member {number} totalSize - * @memberof google.cloud.securitycenter.v1beta1.ListAssetsResponse + * @memberof google.cloud.securitycenter.v1p1beta1.ListFindingsResponse * @instance */ - ListAssetsResponse.prototype.totalSize = 0; + ListFindingsResponse.prototype.totalSize = 0; /** - * Creates a new ListAssetsResponse instance using the specified properties. + * Creates a new ListFindingsResponse instance using the specified properties. * @function create - * @memberof google.cloud.securitycenter.v1beta1.ListAssetsResponse + * @memberof google.cloud.securitycenter.v1p1beta1.ListFindingsResponse * @static - * @param {google.cloud.securitycenter.v1beta1.IListAssetsResponse=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1beta1.ListAssetsResponse} ListAssetsResponse instance + * @param {google.cloud.securitycenter.v1p1beta1.IListFindingsResponse=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1p1beta1.ListFindingsResponse} ListFindingsResponse instance */ - ListAssetsResponse.create = function create(properties) { - return new ListAssetsResponse(properties); + ListFindingsResponse.create = function create(properties) { + return new ListFindingsResponse(properties); }; /** - * Encodes the specified ListAssetsResponse message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.ListAssetsResponse.verify|verify} messages. + * Encodes the specified ListFindingsResponse message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.securitycenter.v1beta1.ListAssetsResponse + * @memberof google.cloud.securitycenter.v1p1beta1.ListFindingsResponse * @static - * @param {google.cloud.securitycenter.v1beta1.IListAssetsResponse} message ListAssetsResponse message or plain object to encode + * @param {google.cloud.securitycenter.v1p1beta1.IListFindingsResponse} message ListFindingsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListAssetsResponse.encode = function encode(message, writer) { + ListFindingsResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.listAssetsResults != null && message.listAssetsResults.length) - for (var i = 0; i < message.listAssetsResults.length; ++i) - $root.google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult.encode(message.listAssetsResults[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.listFindingsResults != null && message.listFindingsResults.length) + for (var i = 0; i < message.listFindingsResults.length; ++i) + $root.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.encode(message.listFindingsResults[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); if (message.readTime != null && message.hasOwnProperty("readTime")) $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) @@ -15612,40 +27237,40 @@ }; /** - * Encodes the specified ListAssetsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.ListAssetsResponse.verify|verify} messages. + * Encodes the specified ListFindingsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1beta1.ListAssetsResponse + * @memberof google.cloud.securitycenter.v1p1beta1.ListFindingsResponse * @static - * @param {google.cloud.securitycenter.v1beta1.IListAssetsResponse} message ListAssetsResponse message or plain object to encode + * @param {google.cloud.securitycenter.v1p1beta1.IListFindingsResponse} message ListFindingsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListAssetsResponse.encodeDelimited = function encodeDelimited(message, writer) { + ListFindingsResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListAssetsResponse message from the specified reader or buffer. + * Decodes a ListFindingsResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.securitycenter.v1beta1.ListAssetsResponse + * @memberof google.cloud.securitycenter.v1p1beta1.ListFindingsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1beta1.ListAssetsResponse} ListAssetsResponse + * @returns {google.cloud.securitycenter.v1p1beta1.ListFindingsResponse} ListFindingsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListAssetsResponse.decode = function decode(reader, length) { + ListFindingsResponse.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.cloud.securitycenter.v1beta1.ListAssetsResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - if (!(message.listAssetsResults && message.listAssetsResults.length)) - message.listAssetsResults = []; - message.listAssetsResults.push($root.google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult.decode(reader, reader.uint32())); + if (!(message.listFindingsResults && message.listFindingsResults.length)) + message.listFindingsResults = []; + message.listFindingsResults.push($root.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.decode(reader, reader.uint32())); break; case 2: message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); @@ -15665,39 +27290,39 @@ }; /** - * Decodes a ListAssetsResponse message from the specified reader or buffer, length delimited. + * Decodes a ListFindingsResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1beta1.ListAssetsResponse + * @memberof google.cloud.securitycenter.v1p1beta1.ListFindingsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1beta1.ListAssetsResponse} ListAssetsResponse + * @returns {google.cloud.securitycenter.v1p1beta1.ListFindingsResponse} ListFindingsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListAssetsResponse.decodeDelimited = function decodeDelimited(reader) { + ListFindingsResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListAssetsResponse message. + * Verifies a ListFindingsResponse message. * @function verify - * @memberof google.cloud.securitycenter.v1beta1.ListAssetsResponse + * @memberof google.cloud.securitycenter.v1p1beta1.ListFindingsResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListAssetsResponse.verify = function verify(message) { + ListFindingsResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.listAssetsResults != null && message.hasOwnProperty("listAssetsResults")) { - if (!Array.isArray(message.listAssetsResults)) - return "listAssetsResults: array expected"; - for (var i = 0; i < message.listAssetsResults.length; ++i) { - var error = $root.google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult.verify(message.listAssetsResults[i]); + if (message.listFindingsResults != null && message.hasOwnProperty("listFindingsResults")) { + if (!Array.isArray(message.listFindingsResults)) + return "listFindingsResults: array expected"; + for (var i = 0; i < message.listFindingsResults.length; ++i) { + var error = $root.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.verify(message.listFindingsResults[i]); if (error) - return "listAssetsResults." + error; + return "listFindingsResults." + error; } } if (message.readTime != null && message.hasOwnProperty("readTime")) { @@ -15715,30 +27340,30 @@ }; /** - * Creates a ListAssetsResponse message from a plain object. Also converts values to their respective internal types. + * Creates a ListFindingsResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.securitycenter.v1beta1.ListAssetsResponse + * @memberof google.cloud.securitycenter.v1p1beta1.ListFindingsResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1beta1.ListAssetsResponse} ListAssetsResponse + * @returns {google.cloud.securitycenter.v1p1beta1.ListFindingsResponse} ListFindingsResponse */ - ListAssetsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1beta1.ListAssetsResponse) + ListFindingsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse) return object; - var message = new $root.google.cloud.securitycenter.v1beta1.ListAssetsResponse(); - if (object.listAssetsResults) { - if (!Array.isArray(object.listAssetsResults)) - throw TypeError(".google.cloud.securitycenter.v1beta1.ListAssetsResponse.listAssetsResults: array expected"); - message.listAssetsResults = []; - for (var i = 0; i < object.listAssetsResults.length; ++i) { - if (typeof object.listAssetsResults[i] !== "object") - throw TypeError(".google.cloud.securitycenter.v1beta1.ListAssetsResponse.listAssetsResults: object expected"); - message.listAssetsResults[i] = $root.google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult.fromObject(object.listAssetsResults[i]); + var message = new $root.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse(); + if (object.listFindingsResults) { + if (!Array.isArray(object.listFindingsResults)) + throw TypeError(".google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.listFindingsResults: array expected"); + message.listFindingsResults = []; + for (var i = 0; i < object.listFindingsResults.length; ++i) { + if (typeof object.listFindingsResults[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.listFindingsResults: object expected"); + message.listFindingsResults[i] = $root.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.fromObject(object.listFindingsResults[i]); } } if (object.readTime != null) { if (typeof object.readTime !== "object") - throw TypeError(".google.cloud.securitycenter.v1beta1.ListAssetsResponse.readTime: object expected"); + throw TypeError(".google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.readTime: object expected"); message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); } if (object.nextPageToken != null) @@ -15749,29 +27374,29 @@ }; /** - * Creates a plain object from a ListAssetsResponse message. Also converts values to other types if specified. + * Creates a plain object from a ListFindingsResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.securitycenter.v1beta1.ListAssetsResponse + * @memberof google.cloud.securitycenter.v1p1beta1.ListFindingsResponse * @static - * @param {google.cloud.securitycenter.v1beta1.ListAssetsResponse} message ListAssetsResponse + * @param {google.cloud.securitycenter.v1p1beta1.ListFindingsResponse} message ListFindingsResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListAssetsResponse.toObject = function toObject(message, options) { + ListFindingsResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) - object.listAssetsResults = []; + object.listFindingsResults = []; if (options.defaults) { object.readTime = null; object.nextPageToken = ""; object.totalSize = 0; } - if (message.listAssetsResults && message.listAssetsResults.length) { - object.listAssetsResults = []; - for (var j = 0; j < message.listAssetsResults.length; ++j) - object.listAssetsResults[j] = $root.google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult.toObject(message.listAssetsResults[j], options); + if (message.listFindingsResults && message.listFindingsResults.length) { + object.listFindingsResults = []; + for (var j = 0; j < message.listFindingsResults.length; ++j) + object.listFindingsResults[j] = $root.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.toObject(message.listFindingsResults[j], options); } if (message.readTime != null && message.hasOwnProperty("readTime")) object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); @@ -15783,35 +27408,36 @@ }; /** - * Converts this ListAssetsResponse to JSON. + * Converts this ListFindingsResponse to JSON. * @function toJSON - * @memberof google.cloud.securitycenter.v1beta1.ListAssetsResponse + * @memberof google.cloud.securitycenter.v1p1beta1.ListFindingsResponse * @instance * @returns {Object.} JSON object */ - ListAssetsResponse.prototype.toJSON = function toJSON() { + ListFindingsResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - ListAssetsResponse.ListAssetsResult = (function() { + ListFindingsResponse.ListFindingsResult = (function() { /** - * Properties of a ListAssetsResult. - * @memberof google.cloud.securitycenter.v1beta1.ListAssetsResponse - * @interface IListAssetsResult - * @property {google.cloud.securitycenter.v1beta1.IAsset|null} [asset] ListAssetsResult asset - * @property {google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult.State|null} [state] ListAssetsResult state + * Properties of a ListFindingsResult. + * @memberof google.cloud.securitycenter.v1p1beta1.ListFindingsResponse + * @interface IListFindingsResult + * @property {google.cloud.securitycenter.v1p1beta1.IFinding|null} [finding] ListFindingsResult finding + * @property {google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.StateChange|null} [stateChange] ListFindingsResult stateChange + * @property {google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.IResource|null} [resource] ListFindingsResult resource */ /** - * Constructs a new ListAssetsResult. - * @memberof google.cloud.securitycenter.v1beta1.ListAssetsResponse - * @classdesc Represents a ListAssetsResult. - * @implements IListAssetsResult + * Constructs a new ListFindingsResult. + * @memberof google.cloud.securitycenter.v1p1beta1.ListFindingsResponse + * @classdesc Represents a ListFindingsResult. + * @implements IListFindingsResult * @constructor - * @param {google.cloud.securitycenter.v1beta1.ListAssetsResponse.IListAssetsResult=} [properties] Properties to set + * @param {google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.IListFindingsResult=} [properties] Properties to set */ - function ListAssetsResult(properties) { + function ListFindingsResult(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -15819,88 +27445,101 @@ } /** - * ListAssetsResult asset. - * @member {google.cloud.securitycenter.v1beta1.IAsset|null|undefined} asset - * @memberof google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult + * ListFindingsResult finding. + * @member {google.cloud.securitycenter.v1p1beta1.IFinding|null|undefined} finding + * @memberof google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult * @instance */ - ListAssetsResult.prototype.asset = null; + ListFindingsResult.prototype.finding = null; /** - * ListAssetsResult state. - * @member {google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult.State} state - * @memberof google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult + * ListFindingsResult stateChange. + * @member {google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.StateChange} stateChange + * @memberof google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult * @instance */ - ListAssetsResult.prototype.state = 0; + ListFindingsResult.prototype.stateChange = 0; /** - * Creates a new ListAssetsResult instance using the specified properties. + * ListFindingsResult resource. + * @member {google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.IResource|null|undefined} resource + * @memberof google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult + * @instance + */ + ListFindingsResult.prototype.resource = null; + + /** + * Creates a new ListFindingsResult instance using the specified properties. * @function create - * @memberof google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult + * @memberof google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult * @static - * @param {google.cloud.securitycenter.v1beta1.ListAssetsResponse.IListAssetsResult=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult} ListAssetsResult instance + * @param {google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.IListFindingsResult=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult} ListFindingsResult instance */ - ListAssetsResult.create = function create(properties) { - return new ListAssetsResult(properties); + ListFindingsResult.create = function create(properties) { + return new ListFindingsResult(properties); }; /** - * Encodes the specified ListAssetsResult message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult.verify|verify} messages. + * Encodes the specified ListFindingsResult message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.verify|verify} messages. * @function encode - * @memberof google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult + * @memberof google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult * @static - * @param {google.cloud.securitycenter.v1beta1.ListAssetsResponse.IListAssetsResult} message ListAssetsResult message or plain object to encode + * @param {google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.IListFindingsResult} message ListFindingsResult message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListAssetsResult.encode = function encode(message, writer) { + ListFindingsResult.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.asset != null && message.hasOwnProperty("asset")) - $root.google.cloud.securitycenter.v1beta1.Asset.encode(message.asset, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.state != null && message.hasOwnProperty("state")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.state); + if (message.finding != null && message.hasOwnProperty("finding")) + $root.google.cloud.securitycenter.v1p1beta1.Finding.encode(message.finding, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.stateChange != null && message.hasOwnProperty("stateChange")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.stateChange); + if (message.resource != null && message.hasOwnProperty("resource")) + $root.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.Resource.encode(message.resource, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; /** - * Encodes the specified ListAssetsResult message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult.verify|verify} messages. + * Encodes the specified ListFindingsResult message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult + * @memberof google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult * @static - * @param {google.cloud.securitycenter.v1beta1.ListAssetsResponse.IListAssetsResult} message ListAssetsResult message or plain object to encode + * @param {google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.IListFindingsResult} message ListFindingsResult message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListAssetsResult.encodeDelimited = function encodeDelimited(message, writer) { + ListFindingsResult.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListAssetsResult message from the specified reader or buffer. + * Decodes a ListFindingsResult message from the specified reader or buffer. * @function decode - * @memberof google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult + * @memberof google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult} ListAssetsResult + * @returns {google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult} ListFindingsResult * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListAssetsResult.decode = function decode(reader, length) { + ListFindingsResult.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.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.asset = $root.google.cloud.securitycenter.v1beta1.Asset.decode(reader, reader.uint32()); + message.finding = $root.google.cloud.securitycenter.v1p1beta1.Finding.decode(reader, reader.uint32()); break; case 2: - message.state = reader.int32(); + message.stateChange = reader.int32(); + break; + case 3: + message.resource = $root.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.Resource.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -15911,178 +27550,463 @@ }; /** - * Decodes a ListAssetsResult message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult + * Decodes a ListFindingsResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult} ListFindingsResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListFindingsResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListFindingsResult message. + * @function verify + * @memberof google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListFindingsResult.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.finding != null && message.hasOwnProperty("finding")) { + var error = $root.google.cloud.securitycenter.v1p1beta1.Finding.verify(message.finding); + if (error) + return "finding." + error; + } + if (message.stateChange != null && message.hasOwnProperty("stateChange")) + switch (message.stateChange) { + default: + return "stateChange: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.resource != null && message.hasOwnProperty("resource")) { + var error = $root.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.Resource.verify(message.resource); + if (error) + return "resource." + error; + } + return null; + }; + + /** + * Creates a ListFindingsResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult} ListFindingsResult + */ + ListFindingsResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult) + return object; + var message = new $root.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult(); + if (object.finding != null) { + if (typeof object.finding !== "object") + throw TypeError(".google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.finding: object expected"); + message.finding = $root.google.cloud.securitycenter.v1p1beta1.Finding.fromObject(object.finding); + } + switch (object.stateChange) { + case "UNUSED": + case 0: + message.stateChange = 0; + break; + case "CHANGED": + case 1: + message.stateChange = 1; + break; + case "UNCHANGED": + case 2: + message.stateChange = 2; + break; + case "ADDED": + case 3: + message.stateChange = 3; + break; + case "REMOVED": + case 4: + message.stateChange = 4; + break; + } + if (object.resource != null) { + if (typeof object.resource !== "object") + throw TypeError(".google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.resource: object expected"); + message.resource = $root.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.Resource.fromObject(object.resource); + } + return message; + }; + + /** + * Creates a plain object from a ListFindingsResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult} ListAssetsResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * @param {google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult} message ListFindingsResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object */ - ListAssetsResult.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); + ListFindingsResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.finding = null; + object.stateChange = options.enums === String ? "UNUSED" : 0; + object.resource = null; + } + if (message.finding != null && message.hasOwnProperty("finding")) + object.finding = $root.google.cloud.securitycenter.v1p1beta1.Finding.toObject(message.finding, options); + if (message.stateChange != null && message.hasOwnProperty("stateChange")) + object.stateChange = options.enums === String ? $root.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.StateChange[message.stateChange] : message.stateChange; + if (message.resource != null && message.hasOwnProperty("resource")) + object.resource = $root.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.Resource.toObject(message.resource, options); + return object; + }; + + /** + * Converts this ListFindingsResult to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult + * @instance + * @returns {Object.} JSON object + */ + ListFindingsResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - /** - * Verifies a ListAssetsResult message. - * @function verify - * @memberof google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListAssetsResult.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.asset != null && message.hasOwnProperty("asset")) { - var error = $root.google.cloud.securitycenter.v1beta1.Asset.verify(message.asset); - if (error) - return "asset." + error; - } - if (message.state != null && message.hasOwnProperty("state")) - switch (message.state) { - default: - return "state: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - break; + ListFindingsResult.Resource = (function() { + + /** + * Properties of a Resource. + * @memberof google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult + * @interface IResource + * @property {string|null} [name] Resource name + * @property {string|null} [projectName] Resource projectName + * @property {string|null} [projectDisplayName] Resource projectDisplayName + * @property {string|null} [parentName] Resource parentName + * @property {string|null} [parentDisplayName] Resource parentDisplayName + */ + + /** + * Constructs a new Resource. + * @memberof google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult + * @classdesc Represents a Resource. + * @implements IResource + * @constructor + * @param {google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.IResource=} [properties] Properties to set + */ + function Resource(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]]; + } + + /** + * Resource name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.Resource + * @instance + */ + Resource.prototype.name = ""; + + /** + * Resource projectName. + * @member {string} projectName + * @memberof google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.Resource + * @instance + */ + Resource.prototype.projectName = ""; + + /** + * Resource projectDisplayName. + * @member {string} projectDisplayName + * @memberof google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.Resource + * @instance + */ + Resource.prototype.projectDisplayName = ""; + + /** + * Resource parentName. + * @member {string} parentName + * @memberof google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.Resource + * @instance + */ + Resource.prototype.parentName = ""; + + /** + * Resource parentDisplayName. + * @member {string} parentDisplayName + * @memberof google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.Resource + * @instance + */ + Resource.prototype.parentDisplayName = ""; + + /** + * Creates a new Resource instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.Resource + * @static + * @param {google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.IResource=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.Resource} Resource instance + */ + Resource.create = function create(properties) { + return new Resource(properties); + }; + + /** + * Encodes the specified Resource message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.Resource.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.Resource + * @static + * @param {google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.IResource} message Resource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Resource.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.projectName != null && message.hasOwnProperty("projectName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.projectName); + if (message.projectDisplayName != null && message.hasOwnProperty("projectDisplayName")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.projectDisplayName); + if (message.parentName != null && message.hasOwnProperty("parentName")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.parentName); + if (message.parentDisplayName != null && message.hasOwnProperty("parentDisplayName")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.parentDisplayName); + return writer; + }; + + /** + * Encodes the specified Resource message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.Resource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.Resource + * @static + * @param {google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.IResource} message Resource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Resource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Resource message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.Resource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.Resource} Resource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Resource.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.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.Resource(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.projectName = reader.string(); + break; + case 3: + message.projectDisplayName = reader.string(); + break; + case 4: + message.parentName = reader.string(); + break; + case 5: + message.parentDisplayName = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Resource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.Resource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.Resource} Resource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Resource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Resource message. + * @function verify + * @memberof google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.Resource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Resource.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.projectName != null && message.hasOwnProperty("projectName")) + if (!$util.isString(message.projectName)) + return "projectName: string expected"; + if (message.projectDisplayName != null && message.hasOwnProperty("projectDisplayName")) + if (!$util.isString(message.projectDisplayName)) + return "projectDisplayName: string expected"; + if (message.parentName != null && message.hasOwnProperty("parentName")) + if (!$util.isString(message.parentName)) + return "parentName: string expected"; + if (message.parentDisplayName != null && message.hasOwnProperty("parentDisplayName")) + if (!$util.isString(message.parentDisplayName)) + return "parentDisplayName: string expected"; + return null; + }; + + /** + * Creates a Resource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.Resource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.Resource} Resource + */ + Resource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.Resource) + return object; + var message = new $root.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.Resource(); + if (object.name != null) + message.name = String(object.name); + if (object.projectName != null) + message.projectName = String(object.projectName); + if (object.projectDisplayName != null) + message.projectDisplayName = String(object.projectDisplayName); + if (object.parentName != null) + message.parentName = String(object.parentName); + if (object.parentDisplayName != null) + message.parentDisplayName = String(object.parentDisplayName); + return message; + }; + + /** + * Creates a plain object from a Resource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.Resource + * @static + * @param {google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.Resource} message Resource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Resource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.projectName = ""; + object.projectDisplayName = ""; + object.parentName = ""; + object.parentDisplayName = ""; } - return null; - }; - - /** - * Creates a ListAssetsResult message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult} ListAssetsResult - */ - ListAssetsResult.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult) + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.projectName != null && message.hasOwnProperty("projectName")) + object.projectName = message.projectName; + if (message.projectDisplayName != null && message.hasOwnProperty("projectDisplayName")) + object.projectDisplayName = message.projectDisplayName; + if (message.parentName != null && message.hasOwnProperty("parentName")) + object.parentName = message.parentName; + if (message.parentDisplayName != null && message.hasOwnProperty("parentDisplayName")) + object.parentDisplayName = message.parentDisplayName; return object; - var message = new $root.google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult(); - if (object.asset != null) { - if (typeof object.asset !== "object") - throw TypeError(".google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult.asset: object expected"); - message.asset = $root.google.cloud.securitycenter.v1beta1.Asset.fromObject(object.asset); - } - switch (object.state) { - case "STATE_UNSPECIFIED": - case 0: - message.state = 0; - break; - case "UNUSED": - case 1: - message.state = 1; - break; - case "ADDED": - case 2: - message.state = 2; - break; - case "REMOVED": - case 3: - message.state = 3; - break; - case "ACTIVE": - case 4: - message.state = 4; - break; - } - return message; - }; + }; - /** - * Creates a plain object from a ListAssetsResult message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult - * @static - * @param {google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult} message ListAssetsResult - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListAssetsResult.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.asset = null; - object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; - } - if (message.asset != null && message.hasOwnProperty("asset")) - object.asset = $root.google.cloud.securitycenter.v1beta1.Asset.toObject(message.asset, options); - if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult.State[message.state] : message.state; - return object; - }; + /** + * Converts this Resource to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.Resource + * @instance + * @returns {Object.} JSON object + */ + Resource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Converts this ListAssetsResult to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult - * @instance - * @returns {Object.} JSON object - */ - ListAssetsResult.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + return Resource; + })(); /** - * State enum. - * @name google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult.State + * StateChange enum. + * @name google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.StateChange * @enum {string} - * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value - * @property {number} UNUSED=1 UNUSED value - * @property {number} ADDED=2 ADDED value - * @property {number} REMOVED=3 REMOVED value - * @property {number} ACTIVE=4 ACTIVE value + * @property {number} UNUSED=0 UNUSED value + * @property {number} CHANGED=1 CHANGED value + * @property {number} UNCHANGED=2 UNCHANGED value + * @property {number} ADDED=3 ADDED value + * @property {number} REMOVED=4 REMOVED value */ - ListAssetsResult.State = (function() { + ListFindingsResult.StateChange = (function() { var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; - values[valuesById[1] = "UNUSED"] = 1; - values[valuesById[2] = "ADDED"] = 2; - values[valuesById[3] = "REMOVED"] = 3; - values[valuesById[4] = "ACTIVE"] = 4; + values[valuesById[0] = "UNUSED"] = 0; + values[valuesById[1] = "CHANGED"] = 1; + values[valuesById[2] = "UNCHANGED"] = 2; + values[valuesById[3] = "ADDED"] = 3; + values[valuesById[4] = "REMOVED"] = 4; return values; })(); - return ListAssetsResult; + return ListFindingsResult; })(); - return ListAssetsResponse; + return ListFindingsResponse; })(); - v1beta1.ListFindingsRequest = (function() { + v1p1beta1.SetFindingStateRequest = (function() { /** - * Properties of a ListFindingsRequest. - * @memberof google.cloud.securitycenter.v1beta1 - * @interface IListFindingsRequest - * @property {string|null} [parent] ListFindingsRequest parent - * @property {string|null} [filter] ListFindingsRequest filter - * @property {string|null} [orderBy] ListFindingsRequest orderBy - * @property {google.protobuf.ITimestamp|null} [readTime] ListFindingsRequest readTime - * @property {google.protobuf.IFieldMask|null} [fieldMask] ListFindingsRequest fieldMask - * @property {string|null} [pageToken] ListFindingsRequest pageToken - * @property {number|null} [pageSize] ListFindingsRequest pageSize + * Properties of a SetFindingStateRequest. + * @memberof google.cloud.securitycenter.v1p1beta1 + * @interface ISetFindingStateRequest + * @property {string|null} [name] SetFindingStateRequest name + * @property {google.cloud.securitycenter.v1p1beta1.Finding.State|null} [state] SetFindingStateRequest state + * @property {google.protobuf.ITimestamp|null} [startTime] SetFindingStateRequest startTime */ /** - * Constructs a new ListFindingsRequest. - * @memberof google.cloud.securitycenter.v1beta1 - * @classdesc Represents a ListFindingsRequest. - * @implements IListFindingsRequest + * Constructs a new SetFindingStateRequest. + * @memberof google.cloud.securitycenter.v1p1beta1 + * @classdesc Represents a SetFindingStateRequest. + * @implements ISetFindingStateRequest * @constructor - * @param {google.cloud.securitycenter.v1beta1.IListFindingsRequest=} [properties] Properties to set + * @param {google.cloud.securitycenter.v1p1beta1.ISetFindingStateRequest=} [properties] Properties to set */ - function ListFindingsRequest(properties) { + function SetFindingStateRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -16090,153 +28014,101 @@ } /** - * ListFindingsRequest parent. - * @member {string} parent - * @memberof google.cloud.securitycenter.v1beta1.ListFindingsRequest - * @instance - */ - ListFindingsRequest.prototype.parent = ""; - - /** - * ListFindingsRequest filter. - * @member {string} filter - * @memberof google.cloud.securitycenter.v1beta1.ListFindingsRequest - * @instance - */ - ListFindingsRequest.prototype.filter = ""; - - /** - * ListFindingsRequest orderBy. - * @member {string} orderBy - * @memberof google.cloud.securitycenter.v1beta1.ListFindingsRequest - * @instance - */ - ListFindingsRequest.prototype.orderBy = ""; - - /** - * ListFindingsRequest readTime. - * @member {google.protobuf.ITimestamp|null|undefined} readTime - * @memberof google.cloud.securitycenter.v1beta1.ListFindingsRequest - * @instance - */ - ListFindingsRequest.prototype.readTime = null; - - /** - * ListFindingsRequest fieldMask. - * @member {google.protobuf.IFieldMask|null|undefined} fieldMask - * @memberof google.cloud.securitycenter.v1beta1.ListFindingsRequest + * SetFindingStateRequest name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest * @instance */ - ListFindingsRequest.prototype.fieldMask = null; + SetFindingStateRequest.prototype.name = ""; /** - * ListFindingsRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.securitycenter.v1beta1.ListFindingsRequest + * SetFindingStateRequest state. + * @member {google.cloud.securitycenter.v1p1beta1.Finding.State} state + * @memberof google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest * @instance */ - ListFindingsRequest.prototype.pageToken = ""; + SetFindingStateRequest.prototype.state = 0; /** - * ListFindingsRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.securitycenter.v1beta1.ListFindingsRequest + * SetFindingStateRequest startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest * @instance */ - ListFindingsRequest.prototype.pageSize = 0; + SetFindingStateRequest.prototype.startTime = null; /** - * Creates a new ListFindingsRequest instance using the specified properties. + * Creates a new SetFindingStateRequest instance using the specified properties. * @function create - * @memberof google.cloud.securitycenter.v1beta1.ListFindingsRequest + * @memberof google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest * @static - * @param {google.cloud.securitycenter.v1beta1.IListFindingsRequest=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1beta1.ListFindingsRequest} ListFindingsRequest instance + * @param {google.cloud.securitycenter.v1p1beta1.ISetFindingStateRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest} SetFindingStateRequest instance */ - ListFindingsRequest.create = function create(properties) { - return new ListFindingsRequest(properties); + SetFindingStateRequest.create = function create(properties) { + return new SetFindingStateRequest(properties); }; /** - * Encodes the specified ListFindingsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.ListFindingsRequest.verify|verify} messages. + * Encodes the specified SetFindingStateRequest message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.securitycenter.v1beta1.ListFindingsRequest + * @memberof google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest * @static - * @param {google.cloud.securitycenter.v1beta1.IListFindingsRequest} message ListFindingsRequest message or plain object to encode + * @param {google.cloud.securitycenter.v1p1beta1.ISetFindingStateRequest} message SetFindingStateRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListFindingsRequest.encode = function encode(message, writer) { + SetFindingStateRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && message.hasOwnProperty("parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.filter != null && message.hasOwnProperty("filter")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); - if (message.orderBy != null && message.hasOwnProperty("orderBy")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.orderBy); - if (message.readTime != null && message.hasOwnProperty("readTime")) - $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.fieldMask != null && message.hasOwnProperty("fieldMask")) - $root.google.protobuf.FieldMask.encode(message.fieldMask, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.pageToken); - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - writer.uint32(/* id 7, wireType 0 =*/56).int32(message.pageSize); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.state != null && message.hasOwnProperty("state")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.state); + if (message.startTime != null && message.hasOwnProperty("startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; /** - * Encodes the specified ListFindingsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.ListFindingsRequest.verify|verify} messages. + * Encodes the specified SetFindingStateRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1beta1.ListFindingsRequest + * @memberof google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest * @static - * @param {google.cloud.securitycenter.v1beta1.IListFindingsRequest} message ListFindingsRequest message or plain object to encode + * @param {google.cloud.securitycenter.v1p1beta1.ISetFindingStateRequest} message SetFindingStateRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListFindingsRequest.encodeDelimited = function encodeDelimited(message, writer) { + SetFindingStateRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListFindingsRequest message from the specified reader or buffer. + * Decodes a SetFindingStateRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.securitycenter.v1beta1.ListFindingsRequest + * @memberof google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1beta1.ListFindingsRequest} ListFindingsRequest + * @returns {google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest} SetFindingStateRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListFindingsRequest.decode = function decode(reader, length) { + SetFindingStateRequest.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.cloud.securitycenter.v1beta1.ListFindingsRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.parent = reader.string(); + message.name = reader.string(); break; case 2: - message.filter = reader.string(); + message.state = reader.int32(); break; case 3: - message.orderBy = reader.string(); - break; - case 4: - message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 5: - message.fieldMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - break; - case 6: - message.pageToken = reader.string(); - break; - case 7: - message.pageSize = reader.int32(); + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -16247,170 +28119,147 @@ }; /** - * Decodes a ListFindingsRequest message from the specified reader or buffer, length delimited. + * Decodes a SetFindingStateRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1beta1.ListFindingsRequest + * @memberof google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1beta1.ListFindingsRequest} ListFindingsRequest + * @returns {google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest} SetFindingStateRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListFindingsRequest.decodeDelimited = function decodeDelimited(reader) { + SetFindingStateRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListFindingsRequest message. + * Verifies a SetFindingStateRequest message. * @function verify - * @memberof google.cloud.securitycenter.v1beta1.ListFindingsRequest + * @memberof google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListFindingsRequest.verify = function verify(message) { + SetFindingStateRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.filter != null && message.hasOwnProperty("filter")) - if (!$util.isString(message.filter)) - return "filter: string expected"; - if (message.orderBy != null && message.hasOwnProperty("orderBy")) - if (!$util.isString(message.orderBy)) - return "orderBy: string expected"; - if (message.readTime != null && message.hasOwnProperty("readTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.readTime); - if (error) - return "readTime." + error; - } - if (message.fieldMask != null && message.hasOwnProperty("fieldMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.fieldMask); + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.startTime != null && message.hasOwnProperty("startTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.startTime); if (error) - return "fieldMask." + error; + return "startTime." + error; } - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; return null; }; /** - * Creates a ListFindingsRequest message from a plain object. Also converts values to their respective internal types. + * Creates a SetFindingStateRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.securitycenter.v1beta1.ListFindingsRequest + * @memberof google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1beta1.ListFindingsRequest} ListFindingsRequest + * @returns {google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest} SetFindingStateRequest */ - ListFindingsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1beta1.ListFindingsRequest) + SetFindingStateRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest) return object; - var message = new $root.google.cloud.securitycenter.v1beta1.ListFindingsRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.filter != null) - message.filter = String(object.filter); - if (object.orderBy != null) - message.orderBy = String(object.orderBy); - if (object.readTime != null) { - if (typeof object.readTime !== "object") - throw TypeError(".google.cloud.securitycenter.v1beta1.ListFindingsRequest.readTime: object expected"); - message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); + var message = new $root.google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest(); + if (object.name != null) + message.name = String(object.name); + switch (object.state) { + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "ACTIVE": + case 1: + message.state = 1; + break; + case "INACTIVE": + case 2: + message.state = 2; + break; } - if (object.fieldMask != null) { - if (typeof object.fieldMask !== "object") - throw TypeError(".google.cloud.securitycenter.v1beta1.ListFindingsRequest.fieldMask: object expected"); - message.fieldMask = $root.google.protobuf.FieldMask.fromObject(object.fieldMask); + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); } - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; return message; }; /** - * Creates a plain object from a ListFindingsRequest message. Also converts values to other types if specified. + * Creates a plain object from a SetFindingStateRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.securitycenter.v1beta1.ListFindingsRequest + * @memberof google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest * @static - * @param {google.cloud.securitycenter.v1beta1.ListFindingsRequest} message ListFindingsRequest + * @param {google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest} message SetFindingStateRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListFindingsRequest.toObject = function toObject(message, options) { + SetFindingStateRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.parent = ""; - object.filter = ""; - object.orderBy = ""; - object.readTime = null; - object.fieldMask = null; - object.pageToken = ""; - object.pageSize = 0; + object.name = ""; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.startTime = null; } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.filter != null && message.hasOwnProperty("filter")) - object.filter = message.filter; - if (message.orderBy != null && message.hasOwnProperty("orderBy")) - object.orderBy = message.orderBy; - if (message.readTime != null && message.hasOwnProperty("readTime")) - object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); - if (message.fieldMask != null && message.hasOwnProperty("fieldMask")) - object.fieldMask = $root.google.protobuf.FieldMask.toObject(message.fieldMask, options); - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.securitycenter.v1p1beta1.Finding.State[message.state] : message.state; + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); return object; }; /** - * Converts this ListFindingsRequest to JSON. + * Converts this SetFindingStateRequest to JSON. * @function toJSON - * @memberof google.cloud.securitycenter.v1beta1.ListFindingsRequest + * @memberof google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest * @instance * @returns {Object.} JSON object */ - ListFindingsRequest.prototype.toJSON = function toJSON() { + SetFindingStateRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ListFindingsRequest; + return SetFindingStateRequest; })(); - v1beta1.ListFindingsResponse = (function() { + v1p1beta1.RunAssetDiscoveryRequest = (function() { /** - * Properties of a ListFindingsResponse. - * @memberof google.cloud.securitycenter.v1beta1 - * @interface IListFindingsResponse - * @property {Array.|null} [findings] ListFindingsResponse findings - * @property {google.protobuf.ITimestamp|null} [readTime] ListFindingsResponse readTime - * @property {string|null} [nextPageToken] ListFindingsResponse nextPageToken - * @property {number|null} [totalSize] ListFindingsResponse totalSize + * Properties of a RunAssetDiscoveryRequest. + * @memberof google.cloud.securitycenter.v1p1beta1 + * @interface IRunAssetDiscoveryRequest + * @property {string|null} [parent] RunAssetDiscoveryRequest parent */ /** - * Constructs a new ListFindingsResponse. - * @memberof google.cloud.securitycenter.v1beta1 - * @classdesc Represents a ListFindingsResponse. - * @implements IListFindingsResponse + * Constructs a new RunAssetDiscoveryRequest. + * @memberof google.cloud.securitycenter.v1p1beta1 + * @classdesc Represents a RunAssetDiscoveryRequest. + * @implements IRunAssetDiscoveryRequest * @constructor - * @param {google.cloud.securitycenter.v1beta1.IListFindingsResponse=} [properties] Properties to set + * @param {google.cloud.securitycenter.v1p1beta1.IRunAssetDiscoveryRequest=} [properties] Properties to set */ - function ListFindingsResponse(properties) { - this.findings = []; + function RunAssetDiscoveryRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -16418,117 +28267,75 @@ } /** - * ListFindingsResponse findings. - * @member {Array.} findings - * @memberof google.cloud.securitycenter.v1beta1.ListFindingsResponse - * @instance - */ - ListFindingsResponse.prototype.findings = $util.emptyArray; - - /** - * ListFindingsResponse readTime. - * @member {google.protobuf.ITimestamp|null|undefined} readTime - * @memberof google.cloud.securitycenter.v1beta1.ListFindingsResponse - * @instance - */ - ListFindingsResponse.prototype.readTime = null; - - /** - * ListFindingsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.securitycenter.v1beta1.ListFindingsResponse - * @instance - */ - ListFindingsResponse.prototype.nextPageToken = ""; - - /** - * ListFindingsResponse totalSize. - * @member {number} totalSize - * @memberof google.cloud.securitycenter.v1beta1.ListFindingsResponse + * RunAssetDiscoveryRequest parent. + * @member {string} parent + * @memberof google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryRequest * @instance */ - ListFindingsResponse.prototype.totalSize = 0; + RunAssetDiscoveryRequest.prototype.parent = ""; /** - * Creates a new ListFindingsResponse instance using the specified properties. + * Creates a new RunAssetDiscoveryRequest instance using the specified properties. * @function create - * @memberof google.cloud.securitycenter.v1beta1.ListFindingsResponse + * @memberof google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryRequest * @static - * @param {google.cloud.securitycenter.v1beta1.IListFindingsResponse=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1beta1.ListFindingsResponse} ListFindingsResponse instance + * @param {google.cloud.securitycenter.v1p1beta1.IRunAssetDiscoveryRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryRequest} RunAssetDiscoveryRequest instance */ - ListFindingsResponse.create = function create(properties) { - return new ListFindingsResponse(properties); + RunAssetDiscoveryRequest.create = function create(properties) { + return new RunAssetDiscoveryRequest(properties); }; /** - * Encodes the specified ListFindingsResponse message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.ListFindingsResponse.verify|verify} messages. + * Encodes the specified RunAssetDiscoveryRequest message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.securitycenter.v1beta1.ListFindingsResponse + * @memberof google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryRequest * @static - * @param {google.cloud.securitycenter.v1beta1.IListFindingsResponse} message ListFindingsResponse message or plain object to encode + * @param {google.cloud.securitycenter.v1p1beta1.IRunAssetDiscoveryRequest} message RunAssetDiscoveryRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListFindingsResponse.encode = function encode(message, writer) { + RunAssetDiscoveryRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.findings != null && message.findings.length) - for (var i = 0; i < message.findings.length; ++i) - $root.google.cloud.securitycenter.v1beta1.Finding.encode(message.findings[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.readTime != null && message.hasOwnProperty("readTime")) - $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.nextPageToken); - if (message.totalSize != null && message.hasOwnProperty("totalSize")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.totalSize); + if (message.parent != null && message.hasOwnProperty("parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); return writer; }; /** - * Encodes the specified ListFindingsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.ListFindingsResponse.verify|verify} messages. + * Encodes the specified RunAssetDiscoveryRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1beta1.ListFindingsResponse + * @memberof google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryRequest * @static - * @param {google.cloud.securitycenter.v1beta1.IListFindingsResponse} message ListFindingsResponse message or plain object to encode + * @param {google.cloud.securitycenter.v1p1beta1.IRunAssetDiscoveryRequest} message RunAssetDiscoveryRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListFindingsResponse.encodeDelimited = function encodeDelimited(message, writer) { + RunAssetDiscoveryRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListFindingsResponse message from the specified reader or buffer. + * Decodes a RunAssetDiscoveryRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.securitycenter.v1beta1.ListFindingsResponse + * @memberof google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1beta1.ListFindingsResponse} ListFindingsResponse + * @returns {google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryRequest} RunAssetDiscoveryRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListFindingsResponse.decode = function decode(reader, length) { + RunAssetDiscoveryRequest.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.cloud.securitycenter.v1beta1.ListFindingsResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - if (!(message.findings && message.findings.length)) - message.findings = []; - message.findings.push($root.google.cloud.securitycenter.v1beta1.Finding.decode(reader, reader.uint32())); - break; - case 2: - message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 3: - message.nextPageToken = reader.string(); - break; - case 4: - message.totalSize = reader.int32(); + message.parent = reader.string(); break; default: reader.skipType(tag & 7); @@ -16539,157 +28346,108 @@ }; /** - * Decodes a ListFindingsResponse message from the specified reader or buffer, length delimited. + * Decodes a RunAssetDiscoveryRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1beta1.ListFindingsResponse + * @memberof google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1beta1.ListFindingsResponse} ListFindingsResponse + * @returns {google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryRequest} RunAssetDiscoveryRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListFindingsResponse.decodeDelimited = function decodeDelimited(reader) { + RunAssetDiscoveryRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListFindingsResponse message. + * Verifies a RunAssetDiscoveryRequest message. * @function verify - * @memberof google.cloud.securitycenter.v1beta1.ListFindingsResponse + * @memberof google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListFindingsResponse.verify = function verify(message) { + RunAssetDiscoveryRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.findings != null && message.hasOwnProperty("findings")) { - if (!Array.isArray(message.findings)) - return "findings: array expected"; - for (var i = 0; i < message.findings.length; ++i) { - var error = $root.google.cloud.securitycenter.v1beta1.Finding.verify(message.findings[i]); - if (error) - return "findings." + error; - } - } - if (message.readTime != null && message.hasOwnProperty("readTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.readTime); - if (error) - return "readTime." + error; - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - if (message.totalSize != null && message.hasOwnProperty("totalSize")) - if (!$util.isInteger(message.totalSize)) - return "totalSize: integer expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; return null; }; /** - * Creates a ListFindingsResponse message from a plain object. Also converts values to their respective internal types. + * Creates a RunAssetDiscoveryRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.securitycenter.v1beta1.ListFindingsResponse + * @memberof google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1beta1.ListFindingsResponse} ListFindingsResponse + * @returns {google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryRequest} RunAssetDiscoveryRequest */ - ListFindingsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1beta1.ListFindingsResponse) + RunAssetDiscoveryRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryRequest) return object; - var message = new $root.google.cloud.securitycenter.v1beta1.ListFindingsResponse(); - if (object.findings) { - if (!Array.isArray(object.findings)) - throw TypeError(".google.cloud.securitycenter.v1beta1.ListFindingsResponse.findings: array expected"); - message.findings = []; - for (var i = 0; i < object.findings.length; ++i) { - if (typeof object.findings[i] !== "object") - throw TypeError(".google.cloud.securitycenter.v1beta1.ListFindingsResponse.findings: object expected"); - message.findings[i] = $root.google.cloud.securitycenter.v1beta1.Finding.fromObject(object.findings[i]); - } - } - if (object.readTime != null) { - if (typeof object.readTime !== "object") - throw TypeError(".google.cloud.securitycenter.v1beta1.ListFindingsResponse.readTime: object expected"); - message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - if (object.totalSize != null) - message.totalSize = object.totalSize | 0; + var message = new $root.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryRequest(); + if (object.parent != null) + message.parent = String(object.parent); return message; }; /** - * Creates a plain object from a ListFindingsResponse message. Also converts values to other types if specified. + * Creates a plain object from a RunAssetDiscoveryRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.securitycenter.v1beta1.ListFindingsResponse + * @memberof google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryRequest * @static - * @param {google.cloud.securitycenter.v1beta1.ListFindingsResponse} message ListFindingsResponse + * @param {google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryRequest} message RunAssetDiscoveryRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListFindingsResponse.toObject = function toObject(message, options) { + RunAssetDiscoveryRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.findings = []; - if (options.defaults) { - object.readTime = null; - object.nextPageToken = ""; - object.totalSize = 0; - } - if (message.findings && message.findings.length) { - object.findings = []; - for (var j = 0; j < message.findings.length; ++j) - object.findings[j] = $root.google.cloud.securitycenter.v1beta1.Finding.toObject(message.findings[j], options); - } - if (message.readTime != null && message.hasOwnProperty("readTime")) - object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - if (message.totalSize != null && message.hasOwnProperty("totalSize")) - object.totalSize = message.totalSize; + if (options.defaults) + object.parent = ""; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; return object; }; /** - * Converts this ListFindingsResponse to JSON. + * Converts this RunAssetDiscoveryRequest to JSON. * @function toJSON - * @memberof google.cloud.securitycenter.v1beta1.ListFindingsResponse + * @memberof google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryRequest * @instance * @returns {Object.} JSON object */ - ListFindingsResponse.prototype.toJSON = function toJSON() { + RunAssetDiscoveryRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ListFindingsResponse; + return RunAssetDiscoveryRequest; })(); - v1beta1.SetFindingStateRequest = (function() { + v1p1beta1.UpdateFindingRequest = (function() { /** - * Properties of a SetFindingStateRequest. - * @memberof google.cloud.securitycenter.v1beta1 - * @interface ISetFindingStateRequest - * @property {string|null} [name] SetFindingStateRequest name - * @property {google.cloud.securitycenter.v1beta1.Finding.State|null} [state] SetFindingStateRequest state - * @property {google.protobuf.ITimestamp|null} [startTime] SetFindingStateRequest startTime + * Properties of an UpdateFindingRequest. + * @memberof google.cloud.securitycenter.v1p1beta1 + * @interface IUpdateFindingRequest + * @property {google.cloud.securitycenter.v1p1beta1.IFinding|null} [finding] UpdateFindingRequest finding + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateFindingRequest updateMask */ /** - * Constructs a new SetFindingStateRequest. - * @memberof google.cloud.securitycenter.v1beta1 - * @classdesc Represents a SetFindingStateRequest. - * @implements ISetFindingStateRequest + * Constructs a new UpdateFindingRequest. + * @memberof google.cloud.securitycenter.v1p1beta1 + * @classdesc Represents an UpdateFindingRequest. + * @implements IUpdateFindingRequest * @constructor - * @param {google.cloud.securitycenter.v1beta1.ISetFindingStateRequest=} [properties] Properties to set + * @param {google.cloud.securitycenter.v1p1beta1.IUpdateFindingRequest=} [properties] Properties to set */ - function SetFindingStateRequest(properties) { + function UpdateFindingRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -16697,101 +28455,88 @@ } /** - * SetFindingStateRequest name. - * @member {string} name - * @memberof google.cloud.securitycenter.v1beta1.SetFindingStateRequest - * @instance - */ - SetFindingStateRequest.prototype.name = ""; - - /** - * SetFindingStateRequest state. - * @member {google.cloud.securitycenter.v1beta1.Finding.State} state - * @memberof google.cloud.securitycenter.v1beta1.SetFindingStateRequest + * UpdateFindingRequest finding. + * @member {google.cloud.securitycenter.v1p1beta1.IFinding|null|undefined} finding + * @memberof google.cloud.securitycenter.v1p1beta1.UpdateFindingRequest * @instance */ - SetFindingStateRequest.prototype.state = 0; + UpdateFindingRequest.prototype.finding = null; /** - * SetFindingStateRequest startTime. - * @member {google.protobuf.ITimestamp|null|undefined} startTime - * @memberof google.cloud.securitycenter.v1beta1.SetFindingStateRequest + * UpdateFindingRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.securitycenter.v1p1beta1.UpdateFindingRequest * @instance */ - SetFindingStateRequest.prototype.startTime = null; + UpdateFindingRequest.prototype.updateMask = null; /** - * Creates a new SetFindingStateRequest instance using the specified properties. + * Creates a new UpdateFindingRequest instance using the specified properties. * @function create - * @memberof google.cloud.securitycenter.v1beta1.SetFindingStateRequest + * @memberof google.cloud.securitycenter.v1p1beta1.UpdateFindingRequest * @static - * @param {google.cloud.securitycenter.v1beta1.ISetFindingStateRequest=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1beta1.SetFindingStateRequest} SetFindingStateRequest instance + * @param {google.cloud.securitycenter.v1p1beta1.IUpdateFindingRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1p1beta1.UpdateFindingRequest} UpdateFindingRequest instance */ - SetFindingStateRequest.create = function create(properties) { - return new SetFindingStateRequest(properties); + UpdateFindingRequest.create = function create(properties) { + return new UpdateFindingRequest(properties); }; /** - * Encodes the specified SetFindingStateRequest message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.SetFindingStateRequest.verify|verify} messages. + * Encodes the specified UpdateFindingRequest message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.UpdateFindingRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.securitycenter.v1beta1.SetFindingStateRequest + * @memberof google.cloud.securitycenter.v1p1beta1.UpdateFindingRequest * @static - * @param {google.cloud.securitycenter.v1beta1.ISetFindingStateRequest} message SetFindingStateRequest message or plain object to encode + * @param {google.cloud.securitycenter.v1p1beta1.IUpdateFindingRequest} message UpdateFindingRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SetFindingStateRequest.encode = function encode(message, writer) { + UpdateFindingRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.state != null && message.hasOwnProperty("state")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.state); - if (message.startTime != null && message.hasOwnProperty("startTime")) - $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.finding != null && message.hasOwnProperty("finding")) + $root.google.cloud.securitycenter.v1p1beta1.Finding.encode(message.finding, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** - * Encodes the specified SetFindingStateRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.SetFindingStateRequest.verify|verify} messages. + * Encodes the specified UpdateFindingRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.UpdateFindingRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1beta1.SetFindingStateRequest + * @memberof google.cloud.securitycenter.v1p1beta1.UpdateFindingRequest * @static - * @param {google.cloud.securitycenter.v1beta1.ISetFindingStateRequest} message SetFindingStateRequest message or plain object to encode + * @param {google.cloud.securitycenter.v1p1beta1.IUpdateFindingRequest} message UpdateFindingRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SetFindingStateRequest.encodeDelimited = function encodeDelimited(message, writer) { + UpdateFindingRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a SetFindingStateRequest message from the specified reader or buffer. + * Decodes an UpdateFindingRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.securitycenter.v1beta1.SetFindingStateRequest + * @memberof google.cloud.securitycenter.v1p1beta1.UpdateFindingRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1beta1.SetFindingStateRequest} SetFindingStateRequest + * @returns {google.cloud.securitycenter.v1p1beta1.UpdateFindingRequest} UpdateFindingRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SetFindingStateRequest.decode = function decode(reader, length) { + UpdateFindingRequest.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.cloud.securitycenter.v1beta1.SetFindingStateRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1p1beta1.UpdateFindingRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.name = reader.string(); + message.finding = $root.google.cloud.securitycenter.v1p1beta1.Finding.decode(reader, reader.uint32()); break; case 2: - message.state = reader.int32(); - break; - case 3: - message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -16802,147 +28547,127 @@ }; /** - * Decodes a SetFindingStateRequest message from the specified reader or buffer, length delimited. + * Decodes an UpdateFindingRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1beta1.SetFindingStateRequest + * @memberof google.cloud.securitycenter.v1p1beta1.UpdateFindingRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1beta1.SetFindingStateRequest} SetFindingStateRequest + * @returns {google.cloud.securitycenter.v1p1beta1.UpdateFindingRequest} UpdateFindingRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SetFindingStateRequest.decodeDelimited = function decodeDelimited(reader) { + UpdateFindingRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a SetFindingStateRequest message. + * Verifies an UpdateFindingRequest message. * @function verify - * @memberof google.cloud.securitycenter.v1beta1.SetFindingStateRequest + * @memberof google.cloud.securitycenter.v1p1beta1.UpdateFindingRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - SetFindingStateRequest.verify = function verify(message) { + UpdateFindingRequest.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.state != null && message.hasOwnProperty("state")) - switch (message.state) { - default: - return "state: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.startTime != null && message.hasOwnProperty("startTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.startTime); + if (message.finding != null && message.hasOwnProperty("finding")) { + var error = $root.google.cloud.securitycenter.v1p1beta1.Finding.verify(message.finding); if (error) - return "startTime." + error; + return "finding." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; } return null; }; /** - * Creates a SetFindingStateRequest message from a plain object. Also converts values to their respective internal types. + * Creates an UpdateFindingRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.securitycenter.v1beta1.SetFindingStateRequest + * @memberof google.cloud.securitycenter.v1p1beta1.UpdateFindingRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1beta1.SetFindingStateRequest} SetFindingStateRequest + * @returns {google.cloud.securitycenter.v1p1beta1.UpdateFindingRequest} UpdateFindingRequest */ - SetFindingStateRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1beta1.SetFindingStateRequest) + UpdateFindingRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1p1beta1.UpdateFindingRequest) return object; - var message = new $root.google.cloud.securitycenter.v1beta1.SetFindingStateRequest(); - if (object.name != null) - message.name = String(object.name); - switch (object.state) { - case "STATE_UNSPECIFIED": - case 0: - message.state = 0; - break; - case "ACTIVE": - case 1: - message.state = 1; - break; - case "INACTIVE": - case 2: - message.state = 2; - break; + var message = new $root.google.cloud.securitycenter.v1p1beta1.UpdateFindingRequest(); + if (object.finding != null) { + if (typeof object.finding !== "object") + throw TypeError(".google.cloud.securitycenter.v1p1beta1.UpdateFindingRequest.finding: object expected"); + message.finding = $root.google.cloud.securitycenter.v1p1beta1.Finding.fromObject(object.finding); } - if (object.startTime != null) { - if (typeof object.startTime !== "object") - throw TypeError(".google.cloud.securitycenter.v1beta1.SetFindingStateRequest.startTime: object expected"); - message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.securitycenter.v1p1beta1.UpdateFindingRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); } return message; }; /** - * Creates a plain object from a SetFindingStateRequest message. Also converts values to other types if specified. + * Creates a plain object from an UpdateFindingRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.securitycenter.v1beta1.SetFindingStateRequest + * @memberof google.cloud.securitycenter.v1p1beta1.UpdateFindingRequest * @static - * @param {google.cloud.securitycenter.v1beta1.SetFindingStateRequest} message SetFindingStateRequest + * @param {google.cloud.securitycenter.v1p1beta1.UpdateFindingRequest} message UpdateFindingRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SetFindingStateRequest.toObject = function toObject(message, options) { + UpdateFindingRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.name = ""; - object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; - object.startTime = null; + object.finding = null; + object.updateMask = null; } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.securitycenter.v1beta1.Finding.State[message.state] : message.state; - if (message.startTime != null && message.hasOwnProperty("startTime")) - object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); + if (message.finding != null && message.hasOwnProperty("finding")) + object.finding = $root.google.cloud.securitycenter.v1p1beta1.Finding.toObject(message.finding, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); return object; }; /** - * Converts this SetFindingStateRequest to JSON. + * Converts this UpdateFindingRequest to JSON. * @function toJSON - * @memberof google.cloud.securitycenter.v1beta1.SetFindingStateRequest + * @memberof google.cloud.securitycenter.v1p1beta1.UpdateFindingRequest * @instance * @returns {Object.} JSON object */ - SetFindingStateRequest.prototype.toJSON = function toJSON() { + UpdateFindingRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return SetFindingStateRequest; + return UpdateFindingRequest; })(); - v1beta1.RunAssetDiscoveryRequest = (function() { + v1p1beta1.UpdateNotificationConfigRequest = (function() { /** - * Properties of a RunAssetDiscoveryRequest. - * @memberof google.cloud.securitycenter.v1beta1 - * @interface IRunAssetDiscoveryRequest - * @property {string|null} [parent] RunAssetDiscoveryRequest parent + * Properties of an UpdateNotificationConfigRequest. + * @memberof google.cloud.securitycenter.v1p1beta1 + * @interface IUpdateNotificationConfigRequest + * @property {google.cloud.securitycenter.v1p1beta1.INotificationConfig|null} [notificationConfig] UpdateNotificationConfigRequest notificationConfig + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateNotificationConfigRequest updateMask */ /** - * Constructs a new RunAssetDiscoveryRequest. - * @memberof google.cloud.securitycenter.v1beta1 - * @classdesc Represents a RunAssetDiscoveryRequest. - * @implements IRunAssetDiscoveryRequest + * Constructs a new UpdateNotificationConfigRequest. + * @memberof google.cloud.securitycenter.v1p1beta1 + * @classdesc Represents an UpdateNotificationConfigRequest. + * @implements IUpdateNotificationConfigRequest * @constructor - * @param {google.cloud.securitycenter.v1beta1.IRunAssetDiscoveryRequest=} [properties] Properties to set + * @param {google.cloud.securitycenter.v1p1beta1.IUpdateNotificationConfigRequest=} [properties] Properties to set */ - function RunAssetDiscoveryRequest(properties) { + function UpdateNotificationConfigRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -16950,75 +28675,88 @@ } /** - * RunAssetDiscoveryRequest parent. - * @member {string} parent - * @memberof google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest + * UpdateNotificationConfigRequest notificationConfig. + * @member {google.cloud.securitycenter.v1p1beta1.INotificationConfig|null|undefined} notificationConfig + * @memberof google.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest * @instance */ - RunAssetDiscoveryRequest.prototype.parent = ""; + UpdateNotificationConfigRequest.prototype.notificationConfig = null; /** - * Creates a new RunAssetDiscoveryRequest instance using the specified properties. + * UpdateNotificationConfigRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest + * @instance + */ + UpdateNotificationConfigRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateNotificationConfigRequest instance using the specified properties. * @function create - * @memberof google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest + * @memberof google.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest * @static - * @param {google.cloud.securitycenter.v1beta1.IRunAssetDiscoveryRequest=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest} RunAssetDiscoveryRequest instance + * @param {google.cloud.securitycenter.v1p1beta1.IUpdateNotificationConfigRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest} UpdateNotificationConfigRequest instance */ - RunAssetDiscoveryRequest.create = function create(properties) { - return new RunAssetDiscoveryRequest(properties); + UpdateNotificationConfigRequest.create = function create(properties) { + return new UpdateNotificationConfigRequest(properties); }; /** - * Encodes the specified RunAssetDiscoveryRequest message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest.verify|verify} messages. + * Encodes the specified UpdateNotificationConfigRequest message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest + * @memberof google.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest * @static - * @param {google.cloud.securitycenter.v1beta1.IRunAssetDiscoveryRequest} message RunAssetDiscoveryRequest message or plain object to encode + * @param {google.cloud.securitycenter.v1p1beta1.IUpdateNotificationConfigRequest} message UpdateNotificationConfigRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - RunAssetDiscoveryRequest.encode = function encode(message, writer) { + UpdateNotificationConfigRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && message.hasOwnProperty("parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.notificationConfig != null && message.hasOwnProperty("notificationConfig")) + $root.google.cloud.securitycenter.v1p1beta1.NotificationConfig.encode(message.notificationConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** - * Encodes the specified RunAssetDiscoveryRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest.verify|verify} messages. + * Encodes the specified UpdateNotificationConfigRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest + * @memberof google.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest * @static - * @param {google.cloud.securitycenter.v1beta1.IRunAssetDiscoveryRequest} message RunAssetDiscoveryRequest message or plain object to encode + * @param {google.cloud.securitycenter.v1p1beta1.IUpdateNotificationConfigRequest} message UpdateNotificationConfigRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - RunAssetDiscoveryRequest.encodeDelimited = function encodeDelimited(message, writer) { + UpdateNotificationConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a RunAssetDiscoveryRequest message from the specified reader or buffer. + * Decodes an UpdateNotificationConfigRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest + * @memberof google.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest} RunAssetDiscoveryRequest + * @returns {google.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest} UpdateNotificationConfigRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - RunAssetDiscoveryRequest.decode = function decode(reader, length) { + UpdateNotificationConfigRequest.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.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.parent = reader.string(); + message.notificationConfig = $root.google.cloud.securitycenter.v1p1beta1.NotificationConfig.decode(reader, reader.uint32()); + break; + case 2: + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -17029,108 +28767,127 @@ }; /** - * Decodes a RunAssetDiscoveryRequest message from the specified reader or buffer, length delimited. + * Decodes an UpdateNotificationConfigRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest + * @memberof google.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest} RunAssetDiscoveryRequest + * @returns {google.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest} UpdateNotificationConfigRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - RunAssetDiscoveryRequest.decodeDelimited = function decodeDelimited(reader) { + UpdateNotificationConfigRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a RunAssetDiscoveryRequest message. + * Verifies an UpdateNotificationConfigRequest message. * @function verify - * @memberof google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest + * @memberof google.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - RunAssetDiscoveryRequest.verify = function verify(message) { + UpdateNotificationConfigRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; + if (message.notificationConfig != null && message.hasOwnProperty("notificationConfig")) { + var error = $root.google.cloud.securitycenter.v1p1beta1.NotificationConfig.verify(message.notificationConfig); + if (error) + return "notificationConfig." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } return null; }; /** - * Creates a RunAssetDiscoveryRequest message from a plain object. Also converts values to their respective internal types. + * Creates an UpdateNotificationConfigRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest + * @memberof google.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest} RunAssetDiscoveryRequest + * @returns {google.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest} UpdateNotificationConfigRequest */ - RunAssetDiscoveryRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest) + UpdateNotificationConfigRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest) return object; - var message = new $root.google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest(); - if (object.parent != null) - message.parent = String(object.parent); + var message = new $root.google.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest(); + if (object.notificationConfig != null) { + if (typeof object.notificationConfig !== "object") + throw TypeError(".google.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest.notificationConfig: object expected"); + message.notificationConfig = $root.google.cloud.securitycenter.v1p1beta1.NotificationConfig.fromObject(object.notificationConfig); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } return message; }; /** - * Creates a plain object from a RunAssetDiscoveryRequest message. Also converts values to other types if specified. + * Creates a plain object from an UpdateNotificationConfigRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest + * @memberof google.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest * @static - * @param {google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest} message RunAssetDiscoveryRequest + * @param {google.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest} message UpdateNotificationConfigRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - RunAssetDiscoveryRequest.toObject = function toObject(message, options) { + UpdateNotificationConfigRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) - object.parent = ""; - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; + if (options.defaults) { + object.notificationConfig = null; + object.updateMask = null; + } + if (message.notificationConfig != null && message.hasOwnProperty("notificationConfig")) + object.notificationConfig = $root.google.cloud.securitycenter.v1p1beta1.NotificationConfig.toObject(message.notificationConfig, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); return object; }; /** - * Converts this RunAssetDiscoveryRequest to JSON. + * Converts this UpdateNotificationConfigRequest to JSON. * @function toJSON - * @memberof google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest + * @memberof google.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest * @instance * @returns {Object.} JSON object */ - RunAssetDiscoveryRequest.prototype.toJSON = function toJSON() { + UpdateNotificationConfigRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return RunAssetDiscoveryRequest; + return UpdateNotificationConfigRequest; })(); - v1beta1.UpdateFindingRequest = (function() { + v1p1beta1.UpdateOrganizationSettingsRequest = (function() { /** - * Properties of an UpdateFindingRequest. - * @memberof google.cloud.securitycenter.v1beta1 - * @interface IUpdateFindingRequest - * @property {google.cloud.securitycenter.v1beta1.IFinding|null} [finding] UpdateFindingRequest finding - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateFindingRequest updateMask + * Properties of an UpdateOrganizationSettingsRequest. + * @memberof google.cloud.securitycenter.v1p1beta1 + * @interface IUpdateOrganizationSettingsRequest + * @property {google.cloud.securitycenter.v1p1beta1.IOrganizationSettings|null} [organizationSettings] UpdateOrganizationSettingsRequest organizationSettings + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateOrganizationSettingsRequest updateMask */ /** - * Constructs a new UpdateFindingRequest. - * @memberof google.cloud.securitycenter.v1beta1 - * @classdesc Represents an UpdateFindingRequest. - * @implements IUpdateFindingRequest + * Constructs a new UpdateOrganizationSettingsRequest. + * @memberof google.cloud.securitycenter.v1p1beta1 + * @classdesc Represents an UpdateOrganizationSettingsRequest. + * @implements IUpdateOrganizationSettingsRequest * @constructor - * @param {google.cloud.securitycenter.v1beta1.IUpdateFindingRequest=} [properties] Properties to set + * @param {google.cloud.securitycenter.v1p1beta1.IUpdateOrganizationSettingsRequest=} [properties] Properties to set */ - function UpdateFindingRequest(properties) { + function UpdateOrganizationSettingsRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -17138,85 +28895,85 @@ } /** - * UpdateFindingRequest finding. - * @member {google.cloud.securitycenter.v1beta1.IFinding|null|undefined} finding - * @memberof google.cloud.securitycenter.v1beta1.UpdateFindingRequest + * UpdateOrganizationSettingsRequest organizationSettings. + * @member {google.cloud.securitycenter.v1p1beta1.IOrganizationSettings|null|undefined} organizationSettings + * @memberof google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest * @instance */ - UpdateFindingRequest.prototype.finding = null; + UpdateOrganizationSettingsRequest.prototype.organizationSettings = null; /** - * UpdateFindingRequest updateMask. + * UpdateOrganizationSettingsRequest updateMask. * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.cloud.securitycenter.v1beta1.UpdateFindingRequest + * @memberof google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest * @instance */ - UpdateFindingRequest.prototype.updateMask = null; + UpdateOrganizationSettingsRequest.prototype.updateMask = null; /** - * Creates a new UpdateFindingRequest instance using the specified properties. + * Creates a new UpdateOrganizationSettingsRequest instance using the specified properties. * @function create - * @memberof google.cloud.securitycenter.v1beta1.UpdateFindingRequest + * @memberof google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest * @static - * @param {google.cloud.securitycenter.v1beta1.IUpdateFindingRequest=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1beta1.UpdateFindingRequest} UpdateFindingRequest instance + * @param {google.cloud.securitycenter.v1p1beta1.IUpdateOrganizationSettingsRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest} UpdateOrganizationSettingsRequest instance */ - UpdateFindingRequest.create = function create(properties) { - return new UpdateFindingRequest(properties); + UpdateOrganizationSettingsRequest.create = function create(properties) { + return new UpdateOrganizationSettingsRequest(properties); }; /** - * Encodes the specified UpdateFindingRequest message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.UpdateFindingRequest.verify|verify} messages. + * Encodes the specified UpdateOrganizationSettingsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.securitycenter.v1beta1.UpdateFindingRequest + * @memberof google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest * @static - * @param {google.cloud.securitycenter.v1beta1.IUpdateFindingRequest} message UpdateFindingRequest message or plain object to encode + * @param {google.cloud.securitycenter.v1p1beta1.IUpdateOrganizationSettingsRequest} message UpdateOrganizationSettingsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateFindingRequest.encode = function encode(message, writer) { + UpdateOrganizationSettingsRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.finding != null && message.hasOwnProperty("finding")) - $root.google.cloud.securitycenter.v1beta1.Finding.encode(message.finding, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.organizationSettings != null && message.hasOwnProperty("organizationSettings")) + $root.google.cloud.securitycenter.v1p1beta1.OrganizationSettings.encode(message.organizationSettings, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); if (message.updateMask != null && message.hasOwnProperty("updateMask")) $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** - * Encodes the specified UpdateFindingRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.UpdateFindingRequest.verify|verify} messages. + * Encodes the specified UpdateOrganizationSettingsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1beta1.UpdateFindingRequest + * @memberof google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest * @static - * @param {google.cloud.securitycenter.v1beta1.IUpdateFindingRequest} message UpdateFindingRequest message or plain object to encode + * @param {google.cloud.securitycenter.v1p1beta1.IUpdateOrganizationSettingsRequest} message UpdateOrganizationSettingsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateFindingRequest.encodeDelimited = function encodeDelimited(message, writer) { + UpdateOrganizationSettingsRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an UpdateFindingRequest message from the specified reader or buffer. + * Decodes an UpdateOrganizationSettingsRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.securitycenter.v1beta1.UpdateFindingRequest + * @memberof google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1beta1.UpdateFindingRequest} UpdateFindingRequest + * @returns {google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest} UpdateOrganizationSettingsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UpdateFindingRequest.decode = function decode(reader, length) { + UpdateOrganizationSettingsRequest.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.cloud.securitycenter.v1beta1.UpdateFindingRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.finding = $root.google.cloud.securitycenter.v1beta1.Finding.decode(reader, reader.uint32()); + message.organizationSettings = $root.google.cloud.securitycenter.v1p1beta1.OrganizationSettings.decode(reader, reader.uint32()); break; case 2: message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); @@ -17230,36 +28987,36 @@ }; /** - * Decodes an UpdateFindingRequest message from the specified reader or buffer, length delimited. + * Decodes an UpdateOrganizationSettingsRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1beta1.UpdateFindingRequest + * @memberof google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1beta1.UpdateFindingRequest} UpdateFindingRequest + * @returns {google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest} UpdateOrganizationSettingsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UpdateFindingRequest.decodeDelimited = function decodeDelimited(reader) { + UpdateOrganizationSettingsRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an UpdateFindingRequest message. + * Verifies an UpdateOrganizationSettingsRequest message. * @function verify - * @memberof google.cloud.securitycenter.v1beta1.UpdateFindingRequest + * @memberof google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - UpdateFindingRequest.verify = function verify(message) { + UpdateOrganizationSettingsRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.finding != null && message.hasOwnProperty("finding")) { - var error = $root.google.cloud.securitycenter.v1beta1.Finding.verify(message.finding); + if (message.organizationSettings != null && message.hasOwnProperty("organizationSettings")) { + var error = $root.google.cloud.securitycenter.v1p1beta1.OrganizationSettings.verify(message.organizationSettings); if (error) - return "finding." + error; + return "organizationSettings." + error; } if (message.updateMask != null && message.hasOwnProperty("updateMask")) { var error = $root.google.protobuf.FieldMask.verify(message.updateMask); @@ -17270,87 +29027,87 @@ }; /** - * Creates an UpdateFindingRequest message from a plain object. Also converts values to their respective internal types. + * Creates an UpdateOrganizationSettingsRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.securitycenter.v1beta1.UpdateFindingRequest + * @memberof google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1beta1.UpdateFindingRequest} UpdateFindingRequest + * @returns {google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest} UpdateOrganizationSettingsRequest */ - UpdateFindingRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1beta1.UpdateFindingRequest) + UpdateOrganizationSettingsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest) return object; - var message = new $root.google.cloud.securitycenter.v1beta1.UpdateFindingRequest(); - if (object.finding != null) { - if (typeof object.finding !== "object") - throw TypeError(".google.cloud.securitycenter.v1beta1.UpdateFindingRequest.finding: object expected"); - message.finding = $root.google.cloud.securitycenter.v1beta1.Finding.fromObject(object.finding); + var message = new $root.google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest(); + if (object.organizationSettings != null) { + if (typeof object.organizationSettings !== "object") + throw TypeError(".google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest.organizationSettings: object expected"); + message.organizationSettings = $root.google.cloud.securitycenter.v1p1beta1.OrganizationSettings.fromObject(object.organizationSettings); } if (object.updateMask != null) { if (typeof object.updateMask !== "object") - throw TypeError(".google.cloud.securitycenter.v1beta1.UpdateFindingRequest.updateMask: object expected"); + throw TypeError(".google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest.updateMask: object expected"); message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); } return message; }; /** - * Creates a plain object from an UpdateFindingRequest message. Also converts values to other types if specified. + * Creates a plain object from an UpdateOrganizationSettingsRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.securitycenter.v1beta1.UpdateFindingRequest + * @memberof google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest * @static - * @param {google.cloud.securitycenter.v1beta1.UpdateFindingRequest} message UpdateFindingRequest + * @param {google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest} message UpdateOrganizationSettingsRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - UpdateFindingRequest.toObject = function toObject(message, options) { + UpdateOrganizationSettingsRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.finding = null; + object.organizationSettings = null; object.updateMask = null; } - if (message.finding != null && message.hasOwnProperty("finding")) - object.finding = $root.google.cloud.securitycenter.v1beta1.Finding.toObject(message.finding, options); + if (message.organizationSettings != null && message.hasOwnProperty("organizationSettings")) + object.organizationSettings = $root.google.cloud.securitycenter.v1p1beta1.OrganizationSettings.toObject(message.organizationSettings, options); if (message.updateMask != null && message.hasOwnProperty("updateMask")) object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); return object; }; /** - * Converts this UpdateFindingRequest to JSON. + * Converts this UpdateOrganizationSettingsRequest to JSON. * @function toJSON - * @memberof google.cloud.securitycenter.v1beta1.UpdateFindingRequest + * @memberof google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest * @instance * @returns {Object.} JSON object */ - UpdateFindingRequest.prototype.toJSON = function toJSON() { + UpdateOrganizationSettingsRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return UpdateFindingRequest; + return UpdateOrganizationSettingsRequest; })(); - v1beta1.UpdateOrganizationSettingsRequest = (function() { + v1p1beta1.UpdateSourceRequest = (function() { /** - * Properties of an UpdateOrganizationSettingsRequest. - * @memberof google.cloud.securitycenter.v1beta1 - * @interface IUpdateOrganizationSettingsRequest - * @property {google.cloud.securitycenter.v1beta1.IOrganizationSettings|null} [organizationSettings] UpdateOrganizationSettingsRequest organizationSettings - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateOrganizationSettingsRequest updateMask + * Properties of an UpdateSourceRequest. + * @memberof google.cloud.securitycenter.v1p1beta1 + * @interface IUpdateSourceRequest + * @property {google.cloud.securitycenter.v1p1beta1.ISource|null} [source] UpdateSourceRequest source + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateSourceRequest updateMask */ /** - * Constructs a new UpdateOrganizationSettingsRequest. - * @memberof google.cloud.securitycenter.v1beta1 - * @classdesc Represents an UpdateOrganizationSettingsRequest. - * @implements IUpdateOrganizationSettingsRequest + * Constructs a new UpdateSourceRequest. + * @memberof google.cloud.securitycenter.v1p1beta1 + * @classdesc Represents an UpdateSourceRequest. + * @implements IUpdateSourceRequest * @constructor - * @param {google.cloud.securitycenter.v1beta1.IUpdateOrganizationSettingsRequest=} [properties] Properties to set + * @param {google.cloud.securitycenter.v1p1beta1.IUpdateSourceRequest=} [properties] Properties to set */ - function UpdateOrganizationSettingsRequest(properties) { + function UpdateSourceRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -17358,85 +29115,85 @@ } /** - * UpdateOrganizationSettingsRequest organizationSettings. - * @member {google.cloud.securitycenter.v1beta1.IOrganizationSettings|null|undefined} organizationSettings - * @memberof google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest + * UpdateSourceRequest source. + * @member {google.cloud.securitycenter.v1p1beta1.ISource|null|undefined} source + * @memberof google.cloud.securitycenter.v1p1beta1.UpdateSourceRequest * @instance */ - UpdateOrganizationSettingsRequest.prototype.organizationSettings = null; + UpdateSourceRequest.prototype.source = null; /** - * UpdateOrganizationSettingsRequest updateMask. + * UpdateSourceRequest updateMask. * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest + * @memberof google.cloud.securitycenter.v1p1beta1.UpdateSourceRequest * @instance */ - UpdateOrganizationSettingsRequest.prototype.updateMask = null; + UpdateSourceRequest.prototype.updateMask = null; /** - * Creates a new UpdateOrganizationSettingsRequest instance using the specified properties. + * Creates a new UpdateSourceRequest instance using the specified properties. * @function create - * @memberof google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest + * @memberof google.cloud.securitycenter.v1p1beta1.UpdateSourceRequest * @static - * @param {google.cloud.securitycenter.v1beta1.IUpdateOrganizationSettingsRequest=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest} UpdateOrganizationSettingsRequest instance + * @param {google.cloud.securitycenter.v1p1beta1.IUpdateSourceRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1p1beta1.UpdateSourceRequest} UpdateSourceRequest instance */ - UpdateOrganizationSettingsRequest.create = function create(properties) { - return new UpdateOrganizationSettingsRequest(properties); + UpdateSourceRequest.create = function create(properties) { + return new UpdateSourceRequest(properties); }; /** - * Encodes the specified UpdateOrganizationSettingsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest.verify|verify} messages. + * Encodes the specified UpdateSourceRequest message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.UpdateSourceRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest + * @memberof google.cloud.securitycenter.v1p1beta1.UpdateSourceRequest * @static - * @param {google.cloud.securitycenter.v1beta1.IUpdateOrganizationSettingsRequest} message UpdateOrganizationSettingsRequest message or plain object to encode + * @param {google.cloud.securitycenter.v1p1beta1.IUpdateSourceRequest} message UpdateSourceRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateOrganizationSettingsRequest.encode = function encode(message, writer) { + UpdateSourceRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.organizationSettings != null && message.hasOwnProperty("organizationSettings")) - $root.google.cloud.securitycenter.v1beta1.OrganizationSettings.encode(message.organizationSettings, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.source != null && message.hasOwnProperty("source")) + $root.google.cloud.securitycenter.v1p1beta1.Source.encode(message.source, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); if (message.updateMask != null && message.hasOwnProperty("updateMask")) $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** - * Encodes the specified UpdateOrganizationSettingsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest.verify|verify} messages. + * Encodes the specified UpdateSourceRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.UpdateSourceRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest + * @memberof google.cloud.securitycenter.v1p1beta1.UpdateSourceRequest * @static - * @param {google.cloud.securitycenter.v1beta1.IUpdateOrganizationSettingsRequest} message UpdateOrganizationSettingsRequest message or plain object to encode + * @param {google.cloud.securitycenter.v1p1beta1.IUpdateSourceRequest} message UpdateSourceRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateOrganizationSettingsRequest.encodeDelimited = function encodeDelimited(message, writer) { + UpdateSourceRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an UpdateOrganizationSettingsRequest message from the specified reader or buffer. + * Decodes an UpdateSourceRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest + * @memberof google.cloud.securitycenter.v1p1beta1.UpdateSourceRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest} UpdateOrganizationSettingsRequest + * @returns {google.cloud.securitycenter.v1p1beta1.UpdateSourceRequest} UpdateSourceRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UpdateOrganizationSettingsRequest.decode = function decode(reader, length) { + UpdateSourceRequest.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.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1p1beta1.UpdateSourceRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.organizationSettings = $root.google.cloud.securitycenter.v1beta1.OrganizationSettings.decode(reader, reader.uint32()); + message.source = $root.google.cloud.securitycenter.v1p1beta1.Source.decode(reader, reader.uint32()); break; case 2: message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); @@ -17450,36 +29207,36 @@ }; /** - * Decodes an UpdateOrganizationSettingsRequest message from the specified reader or buffer, length delimited. + * Decodes an UpdateSourceRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest + * @memberof google.cloud.securitycenter.v1p1beta1.UpdateSourceRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest} UpdateOrganizationSettingsRequest + * @returns {google.cloud.securitycenter.v1p1beta1.UpdateSourceRequest} UpdateSourceRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UpdateOrganizationSettingsRequest.decodeDelimited = function decodeDelimited(reader) { + UpdateSourceRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an UpdateOrganizationSettingsRequest message. + * Verifies an UpdateSourceRequest message. * @function verify - * @memberof google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest + * @memberof google.cloud.securitycenter.v1p1beta1.UpdateSourceRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - UpdateOrganizationSettingsRequest.verify = function verify(message) { + UpdateSourceRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.organizationSettings != null && message.hasOwnProperty("organizationSettings")) { - var error = $root.google.cloud.securitycenter.v1beta1.OrganizationSettings.verify(message.organizationSettings); + if (message.source != null && message.hasOwnProperty("source")) { + var error = $root.google.cloud.securitycenter.v1p1beta1.Source.verify(message.source); if (error) - return "organizationSettings." + error; + return "source." + error; } if (message.updateMask != null && message.hasOwnProperty("updateMask")) { var error = $root.google.protobuf.FieldMask.verify(message.updateMask); @@ -17490,87 +29247,88 @@ }; /** - * Creates an UpdateOrganizationSettingsRequest message from a plain object. Also converts values to their respective internal types. + * Creates an UpdateSourceRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest + * @memberof google.cloud.securitycenter.v1p1beta1.UpdateSourceRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest} UpdateOrganizationSettingsRequest + * @returns {google.cloud.securitycenter.v1p1beta1.UpdateSourceRequest} UpdateSourceRequest */ - UpdateOrganizationSettingsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest) + UpdateSourceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1p1beta1.UpdateSourceRequest) return object; - var message = new $root.google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest(); - if (object.organizationSettings != null) { - if (typeof object.organizationSettings !== "object") - throw TypeError(".google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest.organizationSettings: object expected"); - message.organizationSettings = $root.google.cloud.securitycenter.v1beta1.OrganizationSettings.fromObject(object.organizationSettings); + var message = new $root.google.cloud.securitycenter.v1p1beta1.UpdateSourceRequest(); + if (object.source != null) { + if (typeof object.source !== "object") + throw TypeError(".google.cloud.securitycenter.v1p1beta1.UpdateSourceRequest.source: object expected"); + message.source = $root.google.cloud.securitycenter.v1p1beta1.Source.fromObject(object.source); } if (object.updateMask != null) { if (typeof object.updateMask !== "object") - throw TypeError(".google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest.updateMask: object expected"); + throw TypeError(".google.cloud.securitycenter.v1p1beta1.UpdateSourceRequest.updateMask: object expected"); message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); } return message; }; /** - * Creates a plain object from an UpdateOrganizationSettingsRequest message. Also converts values to other types if specified. + * Creates a plain object from an UpdateSourceRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest + * @memberof google.cloud.securitycenter.v1p1beta1.UpdateSourceRequest * @static - * @param {google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest} message UpdateOrganizationSettingsRequest + * @param {google.cloud.securitycenter.v1p1beta1.UpdateSourceRequest} message UpdateSourceRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - UpdateOrganizationSettingsRequest.toObject = function toObject(message, options) { + UpdateSourceRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.organizationSettings = null; + object.source = null; object.updateMask = null; } - if (message.organizationSettings != null && message.hasOwnProperty("organizationSettings")) - object.organizationSettings = $root.google.cloud.securitycenter.v1beta1.OrganizationSettings.toObject(message.organizationSettings, options); + if (message.source != null && message.hasOwnProperty("source")) + object.source = $root.google.cloud.securitycenter.v1p1beta1.Source.toObject(message.source, options); if (message.updateMask != null && message.hasOwnProperty("updateMask")) object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); return object; }; /** - * Converts this UpdateOrganizationSettingsRequest to JSON. + * Converts this UpdateSourceRequest to JSON. * @function toJSON - * @memberof google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest + * @memberof google.cloud.securitycenter.v1p1beta1.UpdateSourceRequest * @instance * @returns {Object.} JSON object */ - UpdateOrganizationSettingsRequest.prototype.toJSON = function toJSON() { + UpdateSourceRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return UpdateOrganizationSettingsRequest; + return UpdateSourceRequest; })(); - v1beta1.UpdateSourceRequest = (function() { + v1p1beta1.UpdateSecurityMarksRequest = (function() { /** - * Properties of an UpdateSourceRequest. - * @memberof google.cloud.securitycenter.v1beta1 - * @interface IUpdateSourceRequest - * @property {google.cloud.securitycenter.v1beta1.ISource|null} [source] UpdateSourceRequest source - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateSourceRequest updateMask + * Properties of an UpdateSecurityMarksRequest. + * @memberof google.cloud.securitycenter.v1p1beta1 + * @interface IUpdateSecurityMarksRequest + * @property {google.cloud.securitycenter.v1p1beta1.ISecurityMarks|null} [securityMarks] UpdateSecurityMarksRequest securityMarks + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateSecurityMarksRequest updateMask + * @property {google.protobuf.ITimestamp|null} [startTime] UpdateSecurityMarksRequest startTime */ /** - * Constructs a new UpdateSourceRequest. - * @memberof google.cloud.securitycenter.v1beta1 - * @classdesc Represents an UpdateSourceRequest. - * @implements IUpdateSourceRequest + * Constructs a new UpdateSecurityMarksRequest. + * @memberof google.cloud.securitycenter.v1p1beta1 + * @classdesc Represents an UpdateSecurityMarksRequest. + * @implements IUpdateSecurityMarksRequest * @constructor - * @param {google.cloud.securitycenter.v1beta1.IUpdateSourceRequest=} [properties] Properties to set + * @param {google.cloud.securitycenter.v1p1beta1.IUpdateSecurityMarksRequest=} [properties] Properties to set */ - function UpdateSourceRequest(properties) { + function UpdateSecurityMarksRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -17578,89 +29336,102 @@ } /** - * UpdateSourceRequest source. - * @member {google.cloud.securitycenter.v1beta1.ISource|null|undefined} source - * @memberof google.cloud.securitycenter.v1beta1.UpdateSourceRequest + * UpdateSecurityMarksRequest securityMarks. + * @member {google.cloud.securitycenter.v1p1beta1.ISecurityMarks|null|undefined} securityMarks + * @memberof google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest * @instance */ - UpdateSourceRequest.prototype.source = null; + UpdateSecurityMarksRequest.prototype.securityMarks = null; /** - * UpdateSourceRequest updateMask. + * UpdateSecurityMarksRequest updateMask. * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.cloud.securitycenter.v1beta1.UpdateSourceRequest + * @memberof google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest * @instance */ - UpdateSourceRequest.prototype.updateMask = null; + UpdateSecurityMarksRequest.prototype.updateMask = null; /** - * Creates a new UpdateSourceRequest instance using the specified properties. + * UpdateSecurityMarksRequest startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest + * @instance + */ + UpdateSecurityMarksRequest.prototype.startTime = null; + + /** + * Creates a new UpdateSecurityMarksRequest instance using the specified properties. * @function create - * @memberof google.cloud.securitycenter.v1beta1.UpdateSourceRequest + * @memberof google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest * @static - * @param {google.cloud.securitycenter.v1beta1.IUpdateSourceRequest=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1beta1.UpdateSourceRequest} UpdateSourceRequest instance + * @param {google.cloud.securitycenter.v1p1beta1.IUpdateSecurityMarksRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest} UpdateSecurityMarksRequest instance */ - UpdateSourceRequest.create = function create(properties) { - return new UpdateSourceRequest(properties); + UpdateSecurityMarksRequest.create = function create(properties) { + return new UpdateSecurityMarksRequest(properties); }; /** - * Encodes the specified UpdateSourceRequest message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.UpdateSourceRequest.verify|verify} messages. + * Encodes the specified UpdateSecurityMarksRequest message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.securitycenter.v1beta1.UpdateSourceRequest + * @memberof google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest * @static - * @param {google.cloud.securitycenter.v1beta1.IUpdateSourceRequest} message UpdateSourceRequest message or plain object to encode + * @param {google.cloud.securitycenter.v1p1beta1.IUpdateSecurityMarksRequest} message UpdateSecurityMarksRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateSourceRequest.encode = function encode(message, writer) { + UpdateSecurityMarksRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.source != null && message.hasOwnProperty("source")) - $root.google.cloud.securitycenter.v1beta1.Source.encode(message.source, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.securityMarks != null && message.hasOwnProperty("securityMarks")) + $root.google.cloud.securitycenter.v1p1beta1.SecurityMarks.encode(message.securityMarks, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); if (message.updateMask != null && message.hasOwnProperty("updateMask")) $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.startTime != null && message.hasOwnProperty("startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; /** - * Encodes the specified UpdateSourceRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.UpdateSourceRequest.verify|verify} messages. + * Encodes the specified UpdateSecurityMarksRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1beta1.UpdateSourceRequest + * @memberof google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest * @static - * @param {google.cloud.securitycenter.v1beta1.IUpdateSourceRequest} message UpdateSourceRequest message or plain object to encode + * @param {google.cloud.securitycenter.v1p1beta1.IUpdateSecurityMarksRequest} message UpdateSecurityMarksRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateSourceRequest.encodeDelimited = function encodeDelimited(message, writer) { + UpdateSecurityMarksRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an UpdateSourceRequest message from the specified reader or buffer. + * Decodes an UpdateSecurityMarksRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.securitycenter.v1beta1.UpdateSourceRequest + * @memberof google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1beta1.UpdateSourceRequest} UpdateSourceRequest + * @returns {google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest} UpdateSecurityMarksRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UpdateSourceRequest.decode = function decode(reader, length) { + UpdateSecurityMarksRequest.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.cloud.securitycenter.v1beta1.UpdateSourceRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.source = $root.google.cloud.securitycenter.v1beta1.Source.decode(reader, reader.uint32()); + message.securityMarks = $root.google.cloud.securitycenter.v1p1beta1.SecurityMarks.decode(reader, reader.uint32()); break; case 2: message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); break; + case 3: + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; default: reader.skipType(tag & 7); break; @@ -17670,128 +29441,141 @@ }; /** - * Decodes an UpdateSourceRequest message from the specified reader or buffer, length delimited. + * Decodes an UpdateSecurityMarksRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1beta1.UpdateSourceRequest + * @memberof google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1beta1.UpdateSourceRequest} UpdateSourceRequest + * @returns {google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest} UpdateSecurityMarksRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UpdateSourceRequest.decodeDelimited = function decodeDelimited(reader) { + UpdateSecurityMarksRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an UpdateSourceRequest message. + * Verifies an UpdateSecurityMarksRequest message. * @function verify - * @memberof google.cloud.securitycenter.v1beta1.UpdateSourceRequest + * @memberof google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - UpdateSourceRequest.verify = function verify(message) { + UpdateSecurityMarksRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.source != null && message.hasOwnProperty("source")) { - var error = $root.google.cloud.securitycenter.v1beta1.Source.verify(message.source); + if (message.securityMarks != null && message.hasOwnProperty("securityMarks")) { + var error = $root.google.cloud.securitycenter.v1p1beta1.SecurityMarks.verify(message.securityMarks); if (error) - return "source." + error; + return "securityMarks." + error; } if (message.updateMask != null && message.hasOwnProperty("updateMask")) { var error = $root.google.protobuf.FieldMask.verify(message.updateMask); if (error) return "updateMask." + error; } + if (message.startTime != null && message.hasOwnProperty("startTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.startTime); + if (error) + return "startTime." + error; + } return null; }; /** - * Creates an UpdateSourceRequest message from a plain object. Also converts values to their respective internal types. + * Creates an UpdateSecurityMarksRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.securitycenter.v1beta1.UpdateSourceRequest + * @memberof google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1beta1.UpdateSourceRequest} UpdateSourceRequest + * @returns {google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest} UpdateSecurityMarksRequest */ - UpdateSourceRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1beta1.UpdateSourceRequest) + UpdateSecurityMarksRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest) return object; - var message = new $root.google.cloud.securitycenter.v1beta1.UpdateSourceRequest(); - if (object.source != null) { - if (typeof object.source !== "object") - throw TypeError(".google.cloud.securitycenter.v1beta1.UpdateSourceRequest.source: object expected"); - message.source = $root.google.cloud.securitycenter.v1beta1.Source.fromObject(object.source); + var message = new $root.google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest(); + if (object.securityMarks != null) { + if (typeof object.securityMarks !== "object") + throw TypeError(".google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest.securityMarks: object expected"); + message.securityMarks = $root.google.cloud.securitycenter.v1p1beta1.SecurityMarks.fromObject(object.securityMarks); } if (object.updateMask != null) { if (typeof object.updateMask !== "object") - throw TypeError(".google.cloud.securitycenter.v1beta1.UpdateSourceRequest.updateMask: object expected"); + throw TypeError(".google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest.updateMask: object expected"); message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); } + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); + } return message; }; /** - * Creates a plain object from an UpdateSourceRequest message. Also converts values to other types if specified. + * Creates a plain object from an UpdateSecurityMarksRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.securitycenter.v1beta1.UpdateSourceRequest + * @memberof google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest * @static - * @param {google.cloud.securitycenter.v1beta1.UpdateSourceRequest} message UpdateSourceRequest + * @param {google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest} message UpdateSecurityMarksRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - UpdateSourceRequest.toObject = function toObject(message, options) { + UpdateSecurityMarksRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.source = null; + object.securityMarks = null; object.updateMask = null; + object.startTime = null; } - if (message.source != null && message.hasOwnProperty("source")) - object.source = $root.google.cloud.securitycenter.v1beta1.Source.toObject(message.source, options); + if (message.securityMarks != null && message.hasOwnProperty("securityMarks")) + object.securityMarks = $root.google.cloud.securitycenter.v1p1beta1.SecurityMarks.toObject(message.securityMarks, options); if (message.updateMask != null && message.hasOwnProperty("updateMask")) object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); return object; }; /** - * Converts this UpdateSourceRequest to JSON. + * Converts this UpdateSecurityMarksRequest to JSON. * @function toJSON - * @memberof google.cloud.securitycenter.v1beta1.UpdateSourceRequest + * @memberof google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest * @instance * @returns {Object.} JSON object */ - UpdateSourceRequest.prototype.toJSON = function toJSON() { + UpdateSecurityMarksRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return UpdateSourceRequest; + return UpdateSecurityMarksRequest; })(); - v1beta1.UpdateSecurityMarksRequest = (function() { + v1p1beta1.Source = (function() { /** - * Properties of an UpdateSecurityMarksRequest. - * @memberof google.cloud.securitycenter.v1beta1 - * @interface IUpdateSecurityMarksRequest - * @property {google.cloud.securitycenter.v1beta1.ISecurityMarks|null} [securityMarks] UpdateSecurityMarksRequest securityMarks - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateSecurityMarksRequest updateMask - * @property {google.protobuf.ITimestamp|null} [startTime] UpdateSecurityMarksRequest startTime + * Properties of a Source. + * @memberof google.cloud.securitycenter.v1p1beta1 + * @interface ISource + * @property {string|null} [name] Source name + * @property {string|null} [displayName] Source displayName + * @property {string|null} [description] Source description */ /** - * Constructs a new UpdateSecurityMarksRequest. - * @memberof google.cloud.securitycenter.v1beta1 - * @classdesc Represents an UpdateSecurityMarksRequest. - * @implements IUpdateSecurityMarksRequest + * Constructs a new Source. + * @memberof google.cloud.securitycenter.v1p1beta1 + * @classdesc Represents a Source. + * @implements ISource * @constructor - * @param {google.cloud.securitycenter.v1beta1.IUpdateSecurityMarksRequest=} [properties] Properties to set + * @param {google.cloud.securitycenter.v1p1beta1.ISource=} [properties] Properties to set */ - function UpdateSecurityMarksRequest(properties) { + function Source(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -17799,101 +29583,101 @@ } /** - * UpdateSecurityMarksRequest securityMarks. - * @member {google.cloud.securitycenter.v1beta1.ISecurityMarks|null|undefined} securityMarks - * @memberof google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest + * Source name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1p1beta1.Source * @instance */ - UpdateSecurityMarksRequest.prototype.securityMarks = null; + Source.prototype.name = ""; /** - * UpdateSecurityMarksRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest + * Source displayName. + * @member {string} displayName + * @memberof google.cloud.securitycenter.v1p1beta1.Source * @instance */ - UpdateSecurityMarksRequest.prototype.updateMask = null; + Source.prototype.displayName = ""; /** - * UpdateSecurityMarksRequest startTime. - * @member {google.protobuf.ITimestamp|null|undefined} startTime - * @memberof google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest + * Source description. + * @member {string} description + * @memberof google.cloud.securitycenter.v1p1beta1.Source * @instance */ - UpdateSecurityMarksRequest.prototype.startTime = null; + Source.prototype.description = ""; /** - * Creates a new UpdateSecurityMarksRequest instance using the specified properties. + * Creates a new Source instance using the specified properties. * @function create - * @memberof google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest + * @memberof google.cloud.securitycenter.v1p1beta1.Source * @static - * @param {google.cloud.securitycenter.v1beta1.IUpdateSecurityMarksRequest=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest} UpdateSecurityMarksRequest instance + * @param {google.cloud.securitycenter.v1p1beta1.ISource=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1p1beta1.Source} Source instance */ - UpdateSecurityMarksRequest.create = function create(properties) { - return new UpdateSecurityMarksRequest(properties); + Source.create = function create(properties) { + return new Source(properties); }; /** - * Encodes the specified UpdateSecurityMarksRequest message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest.verify|verify} messages. + * Encodes the specified Source message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.Source.verify|verify} messages. * @function encode - * @memberof google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest + * @memberof google.cloud.securitycenter.v1p1beta1.Source * @static - * @param {google.cloud.securitycenter.v1beta1.IUpdateSecurityMarksRequest} message UpdateSecurityMarksRequest message or plain object to encode + * @param {google.cloud.securitycenter.v1p1beta1.ISource} message Source message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateSecurityMarksRequest.encode = function encode(message, writer) { + Source.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.securityMarks != null && message.hasOwnProperty("securityMarks")) - $root.google.cloud.securitycenter.v1beta1.SecurityMarks.encode(message.securityMarks, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.startTime != null && message.hasOwnProperty("startTime")) - $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.displayName != null && message.hasOwnProperty("displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + if (message.description != null && message.hasOwnProperty("description")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); return writer; }; /** - * Encodes the specified UpdateSecurityMarksRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest.verify|verify} messages. + * Encodes the specified Source message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.Source.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest + * @memberof google.cloud.securitycenter.v1p1beta1.Source * @static - * @param {google.cloud.securitycenter.v1beta1.IUpdateSecurityMarksRequest} message UpdateSecurityMarksRequest message or plain object to encode + * @param {google.cloud.securitycenter.v1p1beta1.ISource} message Source message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateSecurityMarksRequest.encodeDelimited = function encodeDelimited(message, writer) { + Source.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an UpdateSecurityMarksRequest message from the specified reader or buffer. + * Decodes a Source message from the specified reader or buffer. * @function decode - * @memberof google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest + * @memberof google.cloud.securitycenter.v1p1beta1.Source * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest} UpdateSecurityMarksRequest + * @returns {google.cloud.securitycenter.v1p1beta1.Source} Source * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UpdateSecurityMarksRequest.decode = function decode(reader, length) { + Source.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.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1p1beta1.Source(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.securityMarks = $root.google.cloud.securitycenter.v1beta1.SecurityMarks.decode(reader, reader.uint32()); + message.name = reader.string(); break; case 2: - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + message.displayName = reader.string(); break; case 3: - message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + message.description = reader.string(); break; default: reader.skipType(tag & 7); @@ -17904,122 +29688,107 @@ }; /** - * Decodes an UpdateSecurityMarksRequest message from the specified reader or buffer, length delimited. + * Decodes a Source message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest + * @memberof google.cloud.securitycenter.v1p1beta1.Source * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest} UpdateSecurityMarksRequest + * @returns {google.cloud.securitycenter.v1p1beta1.Source} Source * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UpdateSecurityMarksRequest.decodeDelimited = function decodeDelimited(reader) { + Source.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an UpdateSecurityMarksRequest message. + * Verifies a Source message. * @function verify - * @memberof google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest + * @memberof google.cloud.securitycenter.v1p1beta1.Source * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - UpdateSecurityMarksRequest.verify = function verify(message) { + Source.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.securityMarks != null && message.hasOwnProperty("securityMarks")) { - var error = $root.google.cloud.securitycenter.v1beta1.SecurityMarks.verify(message.securityMarks); - if (error) - return "securityMarks." + error; - } - if (message.updateMask != null && message.hasOwnProperty("updateMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.updateMask); - if (error) - return "updateMask." + error; - } - if (message.startTime != null && message.hasOwnProperty("startTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.startTime); - if (error) - return "startTime." + error; - } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; return null; }; /** - * Creates an UpdateSecurityMarksRequest message from a plain object. Also converts values to their respective internal types. + * Creates a Source message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest + * @memberof google.cloud.securitycenter.v1p1beta1.Source * @static * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest} UpdateSecurityMarksRequest + * @returns {google.cloud.securitycenter.v1p1beta1.Source} Source */ - UpdateSecurityMarksRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest) + Source.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1p1beta1.Source) return object; - var message = new $root.google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest(); - if (object.securityMarks != null) { - if (typeof object.securityMarks !== "object") - throw TypeError(".google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest.securityMarks: object expected"); - message.securityMarks = $root.google.cloud.securitycenter.v1beta1.SecurityMarks.fromObject(object.securityMarks); - } - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); - } - if (object.startTime != null) { - if (typeof object.startTime !== "object") - throw TypeError(".google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest.startTime: object expected"); - message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); - } + var message = new $root.google.cloud.securitycenter.v1p1beta1.Source(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.description != null) + message.description = String(object.description); return message; }; /** - * Creates a plain object from an UpdateSecurityMarksRequest message. Also converts values to other types if specified. + * Creates a plain object from a Source message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest + * @memberof google.cloud.securitycenter.v1p1beta1.Source * @static - * @param {google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest} message UpdateSecurityMarksRequest + * @param {google.cloud.securitycenter.v1p1beta1.Source} message Source * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - UpdateSecurityMarksRequest.toObject = function toObject(message, options) { + Source.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.securityMarks = null; - object.updateMask = null; - object.startTime = null; + object.name = ""; + object.displayName = ""; + object.description = ""; } - if (message.securityMarks != null && message.hasOwnProperty("securityMarks")) - object.securityMarks = $root.google.cloud.securitycenter.v1beta1.SecurityMarks.toObject(message.securityMarks, options); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); - if (message.startTime != null && message.hasOwnProperty("startTime")) - object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; return object; }; /** - * Converts this UpdateSecurityMarksRequest to JSON. + * Converts this Source to JSON. * @function toJSON - * @memberof google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest + * @memberof google.cloud.securitycenter.v1p1beta1.Source * @instance * @returns {Object.} JSON object */ - UpdateSecurityMarksRequest.prototype.toJSON = function toJSON() { + Source.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return UpdateSecurityMarksRequest; + return Source; })(); - return v1beta1; + return v1p1beta1; })(); return securitycenter; @@ -18037,28 +29806,6 @@ */ var api = {}; - /** - * FieldBehavior enum. - * @name google.api.FieldBehavior - * @enum {string} - * @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 - */ - 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; - return values; - })(); - api.ResourceDescriptor = (function() { /** @@ -19522,6 +31269,28 @@ return CustomHttpPattern; })(); + /** + * FieldBehavior enum. + * @name google.api.FieldBehavior + * @enum {string} + * @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 + */ + 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; + return values; + })(); + return api; })(); @@ -24732,8 +36501,8 @@ * @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 + * @property {Array.|null} [".google.api.fieldBehavior"] FieldOptions .google.api.fieldBehavior */ /** @@ -24810,20 +36579,20 @@ FieldOptions.prototype.uninterpretedOption = $util.emptyArray; /** - * FieldOptions .google.api.fieldBehavior. - * @member {Array.} .google.api.fieldBehavior + * FieldOptions .google.api.resourceReference. + * @member {google.api.IResourceReference|null|undefined} .google.api.resourceReference * @memberof google.protobuf.FieldOptions * @instance */ - FieldOptions.prototype[".google.api.fieldBehavior"] = $util.emptyArray; + FieldOptions.prototype[".google.api.resourceReference"] = null; /** - * FieldOptions .google.api.resourceReference. - * @member {google.api.IResourceReference|null|undefined} .google.api.resourceReference + * FieldOptions .google.api.fieldBehavior. + * @member {Array.} .google.api.fieldBehavior * @memberof google.protobuf.FieldOptions * @instance */ - FieldOptions.prototype[".google.api.resourceReference"] = null; + FieldOptions.prototype[".google.api.fieldBehavior"] = $util.emptyArray; /** * Creates a new FieldOptions instance using the specified properties. @@ -24929,6 +36698,9 @@ message.uninterpretedOption = []; message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); break; + case 1055: + message[".google.api.resourceReference"] = $root.google.api.ResourceReference.decode(reader, reader.uint32()); + break; case 1052: if (!(message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length)) message[".google.api.fieldBehavior"] = []; @@ -24939,9 +36711,6 @@ } 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; @@ -25016,6 +36785,11 @@ return "uninterpretedOption." + error; } } + 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; + } if (message[".google.api.fieldBehavior"] != null && message.hasOwnProperty(".google.api.fieldBehavior")) { if (!Array.isArray(message[".google.api.fieldBehavior"])) return ".google.api.fieldBehavior: array expected"; @@ -25032,11 +36806,6 @@ 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; }; @@ -25098,6 +36867,11 @@ message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); } } + 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"]); + } if (object[".google.api.fieldBehavior"]) { if (!Array.isArray(object[".google.api.fieldBehavior"])) throw TypeError(".google.protobuf.FieldOptions..google.api.fieldBehavior: array expected"); @@ -25131,11 +36905,6 @@ 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; }; diff --git a/packages/google-cloud-securitycenter/protos/protos.json b/packages/google-cloud-securitycenter/protos/protos.json index da9b155d045..710bd97d120 100644 --- a/packages/google-cloud-securitycenter/protos/protos.json +++ b/packages/google-cloud-securitycenter/protos/protos.json @@ -16,84 +16,6 @@ "ruby_package": "Google::Cloud::SecurityCenter::V1" }, "nested": { - "Finding": { - "options": { - "(google.api.resource).type": "securitycenter.googleapis.com/Finding", - "(google.api.resource).pattern": "organizations/{organization}/sources/{source}/findings/{finding}" - }, - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "parent": { - "type": "string", - "id": 2 - }, - "resourceName": { - "type": "string", - "id": 3 - }, - "state": { - "type": "State", - "id": 4 - }, - "category": { - "type": "string", - "id": 5 - }, - "externalUri": { - "type": "string", - "id": 6 - }, - "sourceProperties": { - "keyType": "string", - "type": "google.protobuf.Value", - "id": 7 - }, - "securityMarks": { - "type": "SecurityMarks", - "id": 8, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "eventTime": { - "type": "google.protobuf.Timestamp", - "id": 9 - }, - "createTime": { - "type": "google.protobuf.Timestamp", - "id": 10 - } - }, - "nested": { - "State": { - "values": { - "STATE_UNSPECIFIED": 0, - "ACTIVE": 1, - "INACTIVE": 2 - } - } - } - }, - "SecurityMarks": { - "options": { - "(google.api.resource).type": "securitycenter.googleapis.com/SecurityMarks", - "(google.api.resource).pattern": "organizations/{organization}/sources/{source}/findings/{finding}/securityMarks" - }, - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "marks": { - "keyType": "string", - "type": "string", - "id": 2 - } - } - }, "Asset": { "options": { "(google.api.resource).type": "securitycenter.googleapis.com/Asset", @@ -178,44 +100,80 @@ } } }, - "Source": { + "SecurityMarks": { "options": { - "(google.api.resource).type": "securitycenter.googleapis.com/Source", - "(google.api.resource).pattern": "organizations/{organization}/sources/{source}" + "(google.api.resource).type": "securitycenter.googleapis.com/SecurityMarks", + "(google.api.resource).pattern": "organizations/{organization}/sources/{source}/findings/{finding}/securityMarks" }, "fields": { "name": { "type": "string", "id": 1 }, - "displayName": { + "marks": { + "keyType": "string", "type": "string", "id": 2 - }, - "description": { - "type": "string", - "id": 3 } } }, - "RunAssetDiscoveryResponse": { + "Finding": { + "options": { + "(google.api.resource).type": "securitycenter.googleapis.com/Finding", + "(google.api.resource).pattern": "organizations/{organization}/sources/{source}/findings/{finding}" + }, "fields": { - "state": { - "type": "State", + "name": { + "type": "string", "id": 1 }, - "duration": { - "type": "google.protobuf.Duration", + "parent": { + "type": "string", "id": 2 + }, + "resourceName": { + "type": "string", + "id": 3 + }, + "state": { + "type": "State", + "id": 4 + }, + "category": { + "type": "string", + "id": 5 + }, + "externalUri": { + "type": "string", + "id": 6 + }, + "sourceProperties": { + "keyType": "string", + "type": "google.protobuf.Value", + "id": 7 + }, + "securityMarks": { + "type": "SecurityMarks", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "eventTime": { + "type": "google.protobuf.Timestamp", + "id": 9 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 10 } }, "nested": { "State": { "values": { "STATE_UNSPECIFIED": 0, - "COMPLETED": 1, - "SUPERSEDED": 2, - "TERMINATED": 3 + "ACTIVE": 1, + "INACTIVE": 2 } } } @@ -264,6 +222,28 @@ } } }, + "RunAssetDiscoveryResponse": { + "fields": { + "state": { + "type": "State", + "id": 1 + }, + "duration": { + "type": "google.protobuf.Duration", + "id": 2 + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "COMPLETED": 1, + "SUPERSEDED": 2, + "TERMINATED": 3 + } + } + } + }, "SecurityCenter": { "options": { "(google.api.default_host)": "securitycenter.googleapis.com", @@ -971,6 +951,26 @@ "id": 3 } } + }, + "Source": { + "options": { + "(google.api.resource).type": "securitycenter.googleapis.com/Source", + "(google.api.resource).pattern": "organizations/{organization}/sources/{source}" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "displayName": { + "type": "string", + "id": 2 + }, + "description": { + "type": "string", + "id": 3 + } + } } } }, @@ -981,111 +981,30 @@ "java_package": "com.google.cloud.securitycenter.v1beta1" }, "nested": { - "Finding": { - "options": { - "(google.api.resource).type": "securitycenter.googleapis.com/Finding", - "(google.api.resource).pattern": "organizations/{organization}/sources/{source}/findings/{finding}" - }, + "Asset": { "fields": { "name": { "type": "string", "id": 1 }, - "parent": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "IMMUTABLE" - } - }, - "resourceName": { - "type": "string", - "id": 3 - }, - "state": { - "type": "State", - "id": 4 - }, - "category": { - "type": "string", - "id": 5 - }, - "externalUri": { - "type": "string", - "id": 6 + "securityCenterProperties": { + "type": "SecurityCenterProperties", + "id": 2 }, - "sourceProperties": { + "resourceProperties": { "keyType": "string", "type": "google.protobuf.Value", "id": 7 }, "securityMarks": { "type": "SecurityMarks", - "id": 8, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } + "id": 8 }, - "eventTime": { + "createTime": { "type": "google.protobuf.Timestamp", "id": 9 }, - "createTime": { - "type": "google.protobuf.Timestamp", - "id": 10 - } - }, - "nested": { - "State": { - "values": { - "STATE_UNSPECIFIED": 0, - "ACTIVE": 1, - "INACTIVE": 2 - } - } - } - }, - "SecurityMarks": { - "options": { - "(google.api.resource).type": "securitycenter.googleapis.com/SecurityMarks", - "(google.api.resource).pattern": "organizations/{organization}/sources/{source}/findings/{finding}/securityMarks" - }, - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "marks": { - "keyType": "string", - "type": "string", - "id": 2 - } - } - }, - "Asset": { - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "securityCenterProperties": { - "type": "SecurityCenterProperties", - "id": 2 - }, - "resourceProperties": { - "keyType": "string", - "type": "google.protobuf.Value", - "id": 7 - }, - "securityMarks": { - "type": "SecurityMarks", - "id": 8 - }, - "createTime": { - "type": "google.protobuf.Timestamp", - "id": 9 - }, - "updateTime": { + "updateTime": { "type": "google.protobuf.Timestamp", "id": 10 } @@ -1121,44 +1040,83 @@ } } }, - "Source": { + "SecurityMarks": { "options": { - "(google.api.resource).type": "securitycenter.googleapis.com/Source", - "(google.api.resource).pattern": "organizations/{organization}/sources/{source}" + "(google.api.resource).type": "securitycenter.googleapis.com/SecurityMarks", + "(google.api.resource).pattern": "organizations/{organization}/sources/{source}/findings/{finding}/securityMarks" }, "fields": { "name": { "type": "string", "id": 1 }, - "displayName": { + "marks": { + "keyType": "string", "type": "string", "id": 2 - }, - "description": { - "type": "string", - "id": 3 } } }, - "RunAssetDiscoveryResponse": { + "Finding": { + "options": { + "(google.api.resource).type": "securitycenter.googleapis.com/Finding", + "(google.api.resource).pattern": "organizations/{organization}/sources/{source}/findings/{finding}" + }, "fields": { + "name": { + "type": "string", + "id": 1 + }, + "parent": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } + }, + "resourceName": { + "type": "string", + "id": 3 + }, "state": { "type": "State", - "id": 1 + "id": 4 }, - "duration": { - "type": "google.protobuf.Duration", - "id": 2 + "category": { + "type": "string", + "id": 5 + }, + "externalUri": { + "type": "string", + "id": 6 + }, + "sourceProperties": { + "keyType": "string", + "type": "google.protobuf.Value", + "id": 7 + }, + "securityMarks": { + "type": "SecurityMarks", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "eventTime": { + "type": "google.protobuf.Timestamp", + "id": 9 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 10 } }, "nested": { "State": { "values": { "STATE_UNSPECIFIED": 0, - "COMPLETED": 1, - "SUPERSEDED": 2, - "TERMINATED": 3 + "ACTIVE": 1, + "INACTIVE": 2 } } } @@ -1207,6 +1165,28 @@ } } }, + "RunAssetDiscoveryResponse": { + "fields": { + "state": { + "type": "State", + "id": 1 + }, + "duration": { + "type": "google.protobuf.Duration", + "id": 2 + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "COMPLETED": 1, + "SUPERSEDED": 2, + "TERMINATED": 3 + } + } + } + }, "SecurityCenter": { "options": { "(google.api.default_host)": "securitycenter.googleapis.com", @@ -1846,125 +1826,1337 @@ "id": 3 } } + }, + "Source": { + "options": { + "(google.api.resource).type": "securitycenter.googleapis.com/Source", + "(google.api.resource).pattern": "organizations/{organization}/sources/{source}" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "displayName": { + "type": "string", + "id": 2 + }, + "description": { + "type": "string", + "id": 3 + } + } } } - } - } - } - } - }, - "api": { - "options": { - "go_package": "google.golang.org/genproto/googleapis/api/annotations;annotations", - "java_multiple_files": true, - "java_outer_classname": "ClientProto", - "java_package": "com.google.api", - "objc_class_prefix": "GAPI", - "cc_enable_arenas": true - }, - "nested": { - "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 - } - }, - "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 - } - }, - "nested": { - "History": { - "values": { - "HISTORY_UNSPECIFIED": 0, - "ORIGINALLY_SINGLE_PATTERN": 1, - "FUTURE_MULTI_PATTERN": 2 - } - } - } - }, - "ResourceReference": { - "fields": { - "type": { - "type": "string", - "id": 1 - }, - "childType": { - "type": "string", - "id": 2 - } - } - }, - "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": { + "v1p1beta1": { + "options": { + "csharp_namespace": "Google.Cloud.SecurityCenter.V1P1Beta1", + "go_package": "google.golang.org/genproto/googleapis/cloud/securitycenter/v1p1beta1;securitycenter", + "java_multiple_files": true, + "java_package": "com.google.cloud.securitycenter.v1p1beta1", + "php_namespace": "Google\\Cloud\\SecurityCenter\\V1p1beta1", + "ruby_package": "Google::Cloud::SecurityCenter::V1p1Beta1", + "(google.api.resource_definition).type": "pubsub.googleapis.com/Topic", + "(google.api.resource_definition).pattern": "projects/{project}/topics/{topic}" + }, + "nested": { + "Asset": { + "options": { + "(google.api.resource).type": "securitycenter.googleapis.com/Asset", + "(google.api.resource).pattern": "organizations/{organization}/assets/{asset}" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "securityCenterProperties": { + "type": "SecurityCenterProperties", + "id": 2 + }, + "resourceProperties": { + "keyType": "string", + "type": "google.protobuf.Value", + "id": 7 + }, + "securityMarks": { + "type": "SecurityMarks", + "id": 8 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 9 + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 10 + }, + "iamPolicy": { + "type": "IamPolicy", + "id": 11 + } + }, + "nested": { + "SecurityCenterProperties": { + "fields": { + "resourceName": { + "type": "string", + "id": 1 + }, + "resourceType": { + "type": "string", + "id": 2 + }, + "resourceParent": { + "type": "string", + "id": 3 + }, + "resourceProject": { + "type": "string", + "id": 4 + }, + "resourceOwners": { + "rule": "repeated", + "type": "string", + "id": 5 + }, + "resourceDisplayName": { + "type": "string", + "id": 6 + }, + "resourceParentDisplayName": { + "type": "string", + "id": 7 + }, + "resourceProjectDisplayName": { + "type": "string", + "id": 8 + } + } + }, + "IamPolicy": { + "fields": { + "policyBlob": { + "type": "string", + "id": 1 + } + } + } + } + }, + "SecurityMarks": { + "options": { + "(google.api.resource).type": "securitycenter.googleapis.com/SecurityMarks", + "(google.api.resource).pattern": "organizations/{organization}/sources/{source}/findings/{finding}/securityMarks" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "marks": { + "keyType": "string", + "type": "string", + "id": 2 + } + } + }, + "Finding": { + "options": { + "(google.api.resource).type": "securitycenter.googleapis.com/Finding", + "(google.api.resource).pattern": "organizations/{organization}/sources/{source}/findings/{finding}" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "parent": { + "type": "string", + "id": 2 + }, + "resourceName": { + "type": "string", + "id": 3 + }, + "state": { + "type": "State", + "id": 4 + }, + "category": { + "type": "string", + "id": 5 + }, + "externalUri": { + "type": "string", + "id": 6 + }, + "sourceProperties": { + "keyType": "string", + "type": "google.protobuf.Value", + "id": 7 + }, + "securityMarks": { + "type": "SecurityMarks", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "eventTime": { + "type": "google.protobuf.Timestamp", + "id": 9 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 10 + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "ACTIVE": 1, + "INACTIVE": 2 + } + } + } + }, + "NotificationConfig": { + "options": { + "(google.api.resource).type": "securitycenter.googleapis.com/NotificationConfig", + "(google.api.resource).pattern": "organizations/{organization}/notificationConfigs/{notification_config}" + }, + "oneofs": { + "notifyConfig": { + "oneof": [ + "streamingConfig" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "description": { + "type": "string", + "id": 2 + }, + "eventType": { + "type": "EventType", + "id": 3 + }, + "pubsubTopic": { + "type": "string", + "id": 4, + "options": { + "(google.api.resource_reference).type": "pubsub.googleapis.com/Topic" + } + }, + "serviceAccount": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "streamingConfig": { + "type": "StreamingConfig", + "id": 6 + } + }, + "nested": { + "StreamingConfig": { + "fields": { + "filter": { + "type": "string", + "id": 1 + } + } + }, + "EventType": { + "values": { + "EVENT_TYPE_UNSPECIFIED": 0, + "FINDING": 1 + } + } + } + }, + "NotificationMessage": { + "oneofs": { + "event": { + "oneof": [ + "finding" + ] + } + }, + "fields": { + "notificationConfigName": { + "type": "string", + "id": 1 + }, + "finding": { + "type": "Finding", + "id": 2 + } + } + }, + "OrganizationSettings": { + "options": { + "(google.api.resource).type": "securitycenter.googleapis.com/OrganizationSettings", + "(google.api.resource).pattern": "organizations/{organization}/organizationSettings" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "enableAssetDiscovery": { + "type": "bool", + "id": 2 + }, + "assetDiscoveryConfig": { + "type": "AssetDiscoveryConfig", + "id": 3 + } + }, + "nested": { + "AssetDiscoveryConfig": { + "fields": { + "projectIds": { + "rule": "repeated", + "type": "string", + "id": 1 + }, + "inclusionMode": { + "type": "InclusionMode", + "id": 2 + } + }, + "nested": { + "InclusionMode": { + "values": { + "INCLUSION_MODE_UNSPECIFIED": 0, + "INCLUDE_ONLY": 1, + "EXCLUDE": 2 + } + } + } + } + } + }, + "RunAssetDiscoveryResponse": { + "fields": { + "state": { + "type": "State", + "id": 1 + }, + "duration": { + "type": "google.protobuf.Duration", + "id": 2 + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "COMPLETED": 1, + "SUPERSEDED": 2, + "TERMINATED": 3 + } + } + } + }, + "SecurityCenter": { + "options": { + "(google.api.default_host)": "securitycenter.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "CreateSource": { + "requestType": "CreateSourceRequest", + "responseType": "Source", + "options": { + "(google.api.http).post": "/v1p1beta1/{parent=organizations/*}/sources", + "(google.api.http).body": "source", + "(google.api.method_signature)": "parent,source" + } + }, + "CreateFinding": { + "requestType": "CreateFindingRequest", + "responseType": "Finding", + "options": { + "(google.api.http).post": "/v1p1beta1/{parent=organizations/*/sources/*}/findings", + "(google.api.http).body": "finding", + "(google.api.method_signature)": "parent,finding,finding_id" + } + }, + "CreateNotificationConfig": { + "requestType": "CreateNotificationConfigRequest", + "responseType": "NotificationConfig", + "options": { + "(google.api.http).post": "/v1p1beta1/{parent=organizations/*}/notificationConfigs", + "(google.api.http).body": "notification_config", + "(google.api.method_signature)": "parent,notification_config" + } + }, + "DeleteNotificationConfig": { + "requestType": "DeleteNotificationConfigRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1p1beta1/{name=organizations/*/notificationConfigs/*}", + "(google.api.method_signature)": "name" + } + }, + "GetIamPolicy": { + "requestType": "google.iam.v1.GetIamPolicyRequest", + "responseType": "google.iam.v1.Policy", + "options": { + "(google.api.http).post": "/v1p1beta1/{resource=organizations/*/sources/*}:getIamPolicy", + "(google.api.http).body": "*", + "(google.api.method_signature)": "resource" + } + }, + "GetNotificationConfig": { + "requestType": "GetNotificationConfigRequest", + "responseType": "NotificationConfig", + "options": { + "(google.api.http).get": "/v1p1beta1/{name=organizations/*/notificationConfigs/*}", + "(google.api.method_signature)": "name" + } + }, + "GetOrganizationSettings": { + "requestType": "GetOrganizationSettingsRequest", + "responseType": "OrganizationSettings", + "options": { + "(google.api.http).get": "/v1p1beta1/{name=organizations/*/organizationSettings}", + "(google.api.method_signature)": "name" + } + }, + "GetSource": { + "requestType": "GetSourceRequest", + "responseType": "Source", + "options": { + "(google.api.http).get": "/v1p1beta1/{name=organizations/*/sources/*}", + "(google.api.method_signature)": "name" + } + }, + "GroupAssets": { + "requestType": "GroupAssetsRequest", + "responseType": "GroupAssetsResponse", + "options": { + "(google.api.http).post": "/v1p1beta1/{parent=organizations/*}/assets:group", + "(google.api.http).body": "*" + } + }, + "GroupFindings": { + "requestType": "GroupFindingsRequest", + "responseType": "GroupFindingsResponse", + "options": { + "(google.api.http).post": "/v1p1beta1/{parent=organizations/*/sources/*}/findings:group", + "(google.api.http).body": "*", + "(google.api.method_signature)": "parent,group_by" + } + }, + "ListAssets": { + "requestType": "ListAssetsRequest", + "responseType": "ListAssetsResponse", + "options": { + "(google.api.http).get": "/v1p1beta1/{parent=organizations/*}/assets", + "(google.api.method_signature)": "parent" + } + }, + "ListFindings": { + "requestType": "ListFindingsRequest", + "responseType": "ListFindingsResponse", + "options": { + "(google.api.http).get": "/v1p1beta1/{parent=organizations/*/sources/*}/findings", + "(google.api.method_signature)": "parent" + } + }, + "ListNotificationConfigs": { + "requestType": "ListNotificationConfigsRequest", + "responseType": "ListNotificationConfigsResponse", + "options": { + "(google.api.http).get": "/v1p1beta1/{parent=organizations/*}/notificationConfigs", + "(google.api.method_signature)": "parent" + } + }, + "ListSources": { + "requestType": "ListSourcesRequest", + "responseType": "ListSourcesResponse", + "options": { + "(google.api.http).get": "/v1p1beta1/{parent=organizations/*}/sources", + "(google.api.method_signature)": "parent" + } + }, + "RunAssetDiscovery": { + "requestType": "RunAssetDiscoveryRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1p1beta1/{parent=organizations/*}/assets:runDiscovery", + "(google.api.http).body": "*", + "(google.api.method_signature)": "parent", + "(google.longrunning.operation_info).response_type": "google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse", + "(google.longrunning.operation_info).metadata_type": "google.protobuf.Empty" + } + }, + "SetFindingState": { + "requestType": "SetFindingStateRequest", + "responseType": "Finding", + "options": { + "(google.api.http).post": "/v1p1beta1/{name=organizations/*/sources/*/findings/*}:setState", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name,state,start_time" + } + }, + "SetIamPolicy": { + "requestType": "google.iam.v1.SetIamPolicyRequest", + "responseType": "google.iam.v1.Policy", + "options": { + "(google.api.http).post": "/v1p1beta1/{resource=organizations/*/sources/*}:setIamPolicy", + "(google.api.http).body": "*", + "(google.api.method_signature)": "resource,policy" + } + }, + "TestIamPermissions": { + "requestType": "google.iam.v1.TestIamPermissionsRequest", + "responseType": "google.iam.v1.TestIamPermissionsResponse", + "options": { + "(google.api.http).post": "/v1p1beta1/{resource=organizations/*/sources/*}:testIamPermissions", + "(google.api.http).body": "*", + "(google.api.method_signature)": "resource,permissions" + } + }, + "UpdateFinding": { + "requestType": "UpdateFindingRequest", + "responseType": "Finding", + "options": { + "(google.api.http).patch": "/v1p1beta1/{finding.name=organizations/*/sources/*/findings/*}", + "(google.api.http).body": "finding", + "(google.api.method_signature)": "finding,update_mask" + } + }, + "UpdateNotificationConfig": { + "requestType": "UpdateNotificationConfigRequest", + "responseType": "NotificationConfig", + "options": { + "(google.api.http).patch": "/v1p1beta1/{notification_config.name=organizations/*/notificationConfigs/*}", + "(google.api.http).body": "notification_config", + "(google.api.method_signature)": "notification_config,update_mask" + } + }, + "UpdateOrganizationSettings": { + "requestType": "UpdateOrganizationSettingsRequest", + "responseType": "OrganizationSettings", + "options": { + "(google.api.http).patch": "/v1p1beta1/{organization_settings.name=organizations/*/organizationSettings}", + "(google.api.http).body": "organization_settings", + "(google.api.method_signature)": "organization_settings" + } + }, + "UpdateSource": { + "requestType": "UpdateSourceRequest", + "responseType": "Source", + "options": { + "(google.api.http).patch": "/v1p1beta1/{source.name=organizations/*/sources/*}", + "(google.api.http).body": "source", + "(google.api.method_signature)": "source,update_mask" + } + }, + "UpdateSecurityMarks": { + "requestType": "UpdateSecurityMarksRequest", + "responseType": "SecurityMarks", + "options": { + "(google.api.http).patch": "/v1p1beta1/{security_marks.name=organizations/*/assets/*/securityMarks}", + "(google.api.http).body": "security_marks", + "(google.api.http).additional_bindings.patch": "/v1p1beta1/{security_marks.name=organizations/*/sources/*/findings/*/securityMarks}", + "(google.api.http).additional_bindings.body": "security_marks", + "(google.api.method_signature)": "security_marks,update_mask" + } + } + } + }, + "CreateFindingRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "securitycenter.googleapis.com/Source" + } + }, + "findingId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "finding": { + "type": "Finding", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "CreateNotificationConfigRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudresourcemanager.googleapis.com/Organization" + } + }, + "configId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "notificationConfig": { + "type": "NotificationConfig", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "CreateSourceRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudresourcemanager.googleapis.com/Organization" + } + }, + "source": { + "type": "Source", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "DeleteNotificationConfigRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "securitycenter.googleapis.com/NotificationConfig" + } + } + } + }, + "GetNotificationConfigRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "securitycenter.googleapis.com/NotificationConfig" + } + } + } + }, + "GetOrganizationSettingsRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "securitycenter.googleapis.com/OrganizationSettings" + } + } + } + }, + "GetSourceRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "securitycenter.googleapis.com/Source" + } + } + } + }, + "GroupAssetsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudresourcemanager.googleapis.com/Organization" + } + }, + "filter": { + "type": "string", + "id": 2 + }, + "groupBy": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "compareDuration": { + "type": "google.protobuf.Duration", + "id": 4 + }, + "readTime": { + "type": "google.protobuf.Timestamp", + "id": 5 + }, + "having": { + "type": "string", + "id": 6 + }, + "pageToken": { + "type": "string", + "id": 7 + }, + "pageSize": { + "type": "int32", + "id": 8 + } + } + }, + "GroupAssetsResponse": { + "fields": { + "groupByResults": { + "rule": "repeated", + "type": "GroupResult", + "id": 1 + }, + "readTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + }, + "nextPageToken": { + "type": "string", + "id": 3 + }, + "totalSize": { + "type": "int32", + "id": 4 + } + } + }, + "GroupFindingsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "securitycenter.googleapis.com/Source" + } + }, + "filter": { + "type": "string", + "id": 2 + }, + "groupBy": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "readTime": { + "type": "google.protobuf.Timestamp", + "id": 4 + }, + "compareDuration": { + "type": "google.protobuf.Duration", + "id": 5 + }, + "having": { + "type": "string", + "id": 6 + }, + "pageToken": { + "type": "string", + "id": 7 + }, + "pageSize": { + "type": "int32", + "id": 8 + } + } + }, + "GroupFindingsResponse": { + "fields": { + "groupByResults": { + "rule": "repeated", + "type": "GroupResult", + "id": 1 + }, + "readTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + }, + "nextPageToken": { + "type": "string", + "id": 3 + }, + "totalSize": { + "type": "int32", + "id": 4 + } + } + }, + "GroupResult": { + "fields": { + "properties": { + "keyType": "string", + "type": "google.protobuf.Value", + "id": 1 + }, + "count": { + "type": "int64", + "id": 2 + } + } + }, + "ListNotificationConfigsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudresourcemanager.googleapis.com/Organization" + } + }, + "pageToken": { + "type": "string", + "id": 2 + }, + "pageSize": { + "type": "int32", + "id": 3 + } + } + }, + "ListNotificationConfigsResponse": { + "fields": { + "notificationConfigs": { + "rule": "repeated", + "type": "NotificationConfig", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "ListSourcesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudresourcemanager.googleapis.com/Organization" + } + }, + "pageToken": { + "type": "string", + "id": 2 + }, + "pageSize": { + "type": "int32", + "id": 7 + } + } + }, + "ListSourcesResponse": { + "fields": { + "sources": { + "rule": "repeated", + "type": "Source", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "ListAssetsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudresourcemanager.googleapis.com/Organization" + } + }, + "filter": { + "type": "string", + "id": 2 + }, + "orderBy": { + "type": "string", + "id": 3 + }, + "readTime": { + "type": "google.protobuf.Timestamp", + "id": 4 + }, + "compareDuration": { + "type": "google.protobuf.Duration", + "id": 5 + }, + "having": { + "type": "string", + "id": 6 + }, + "fieldMask": { + "type": "google.protobuf.FieldMask", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 8 + }, + "pageSize": { + "type": "int32", + "id": 9 + } + } + }, + "ListAssetsResponse": { + "fields": { + "listAssetsResults": { + "rule": "repeated", + "type": "ListAssetsResult", + "id": 1 + }, + "readTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + }, + "nextPageToken": { + "type": "string", + "id": 3 + }, + "totalSize": { + "type": "int32", + "id": 4 + } + }, + "nested": { + "ListAssetsResult": { + "fields": { + "asset": { + "type": "Asset", + "id": 1 + }, + "stateChange": { + "type": "StateChange", + "id": 2 + } + }, + "nested": { + "StateChange": { + "values": { + "UNUSED": 0, + "ADDED": 1, + "REMOVED": 2, + "ACTIVE": 3 + } + } + } + } + } + }, + "ListFindingsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "securitycenter.googleapis.com/Source" + } + }, + "filter": { + "type": "string", + "id": 2 + }, + "orderBy": { + "type": "string", + "id": 3 + }, + "readTime": { + "type": "google.protobuf.Timestamp", + "id": 4 + }, + "compareDuration": { + "type": "google.protobuf.Duration", + "id": 5 + }, + "having": { + "type": "string", + "id": 6 + }, + "fieldMask": { + "type": "google.protobuf.FieldMask", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 8 + }, + "pageSize": { + "type": "int32", + "id": 9 + } + } + }, + "ListFindingsResponse": { + "fields": { + "listFindingsResults": { + "rule": "repeated", + "type": "ListFindingsResult", + "id": 1 + }, + "readTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + }, + "nextPageToken": { + "type": "string", + "id": 3 + }, + "totalSize": { + "type": "int32", + "id": 4 + } + }, + "nested": { + "ListFindingsResult": { + "fields": { + "finding": { + "type": "Finding", + "id": 1 + }, + "stateChange": { + "type": "StateChange", + "id": 2 + }, + "resource": { + "type": "Resource", + "id": 3 + } + }, + "nested": { + "Resource": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "projectName": { + "type": "string", + "id": 2 + }, + "projectDisplayName": { + "type": "string", + "id": 3 + }, + "parentName": { + "type": "string", + "id": 4 + }, + "parentDisplayName": { + "type": "string", + "id": 5 + } + } + }, + "StateChange": { + "values": { + "UNUSED": 0, + "CHANGED": 1, + "UNCHANGED": 2, + "ADDED": 3, + "REMOVED": 4 + } + } + } + } + } + }, + "SetFindingStateRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "securitycenter.googleapis.com/Finding" + } + }, + "state": { + "type": "Finding.State", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "RunAssetDiscoveryRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudresourcemanager.googleapis.com/Organization" + } + } + } + }, + "UpdateFindingRequest": { + "fields": { + "finding": { + "type": "Finding", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2 + } + } + }, + "UpdateNotificationConfigRequest": { + "fields": { + "notificationConfig": { + "type": "NotificationConfig", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2 + } + } + }, + "UpdateOrganizationSettingsRequest": { + "fields": { + "organizationSettings": { + "type": "OrganizationSettings", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2 + } + } + }, + "UpdateSourceRequest": { + "fields": { + "source": { + "type": "Source", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2 + } + } + }, + "UpdateSecurityMarksRequest": { + "fields": { + "securityMarks": { + "type": "SecurityMarks", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2 + }, + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 3 + } + } + }, + "Source": { + "options": { + "(google.api.resource).type": "securitycenter.googleapis.com/Source", + "(google.api.resource).pattern": "organizations/{organization}/sources/{source}" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "displayName": { + "type": "string", + "id": 2 + }, + "description": { + "type": "string", + "id": 3 + } + } + } + } + } + } + } + } + }, + "api": { + "options": { + "cc_enable_arenas": true, + "go_package": "google.golang.org/genproto/googleapis/api/annotations;annotations", + "java_multiple_files": true, + "java_outer_classname": "ClientProto", + "java_package": "com.google.api", + "objc_class_prefix": "GAPI" + }, + "nested": { + "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 + } + }, + "nested": { + "History": { + "values": { + "HISTORY_UNSPECIFIED": 0, + "ORIGINALLY_SINGLE_PATTERN": 1, + "FUTURE_MULTI_PATTERN": 2 + } + } + } + }, + "ResourceReference": { + "fields": { + "type": { + "type": "string", + "id": 1 + }, + "childType": { + "type": "string", + "id": 2 + } + } + }, + "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", @@ -2032,6 +3224,22 @@ } } }, + "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 + } + }, "methodSignature": { "rule": "repeated", "type": "string", diff --git a/packages/google-cloud-securitycenter/src/extra_proto_list.json b/packages/google-cloud-securitycenter/src/extra_proto_list.json deleted file mode 100644 index e7ad9a63718..00000000000 --- a/packages/google-cloud-securitycenter/src/extra_proto_list.json +++ /dev/null @@ -1,14 +0,0 @@ -[ - "../../protos/google/cloud/securitycenter/v1/finding.proto", - "../../protos/google/cloud/securitycenter/v1/asset.proto", - "../../protos/google/cloud/securitycenter/v1/source.proto", - "../../protos/google/cloud/securitycenter/v1/security_marks.proto", - "../../protos/google/cloud/securitycenter/v1/run_asset_discovery_response.proto", - "../../protos/google/cloud/securitycenter/v1/organization_settings.proto", - "../../protos/google/cloud/securitycenter/v1beta1/finding.proto", - "../../protos/google/cloud/securitycenter/v1beta1/asset.proto", - "../../protos/google/cloud/securitycenter/v1beta1/source.proto", - "../../protos/google/cloud/securitycenter/v1beta1/security_marks.proto", - "../../protos/google/cloud/securitycenter/v1beta1/run_asset_discovery_response.proto", - "../../protos/google/cloud/securitycenter/v1beta1/organization_settings.proto" -] diff --git a/packages/google-cloud-securitycenter/src/index.js b/packages/google-cloud-securitycenter/src/index.js deleted file mode 100644 index fb65485f03b..00000000000 --- a/packages/google-cloud-securitycenter/src/index.js +++ /dev/null @@ -1,104 +0,0 @@ -// 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. - -/** - * @namespace google - */ -/** - * @namespace google.type - */ -/** - * @namespace google.longrunning - */ -/** - * @namespace google.protobuf - */ -/** - * @namespace google.type - */ -/** - * @namespace google.rpc - */ -/** - * @namespace google.cloud.securitycenter.v1 - */ -/** - * @namespace google.cloud.securitycenter.v1beta1 - */ -/** - * @namespace google.iam.v1 - */ - -/** - * @namespace google.cloud - */ -/** - * @namespace google.cloud.security-center - */ -/** - * @namespace google.cloud.security-center.v1 - */ - -'use strict'; - -// Import the clients for each version supported by this package. -const gapic = Object.freeze({ - v1: require('./v1'), -}); - -/** - * The `@google-cloud/security-center` package has the following named exports: - * - * - `SecurityCenterClient` - Reference to - * {@link v1.SecurityCenterClient} - * - `v1` - This is used for selecting or pinning a - * particular backend service version. It exports: - * - `SecurityCenterClient` - Reference to - * {@link v1.SecurityCenterClient} - * - * @module {object} @google-cloud/security-center - * @alias nodejs-security-center - * - * @example Install the client library with npm: - * npm install --save @google-cloud/security-center - * - * @example Import the client library: - * const security-center = require('@google-cloud/security-center'); - * - * @example Create a client that uses Application Default Credentials (ADC): - * const client = new security-center.SecurityCenterClient(); - * - * @example Create a client with explicit credentials: - * const client = new security-center.SecurityCenterClient({ - * projectId: 'your-project-id', - * keyFilename: '/path/to/keyfile.json', - * }); - */ - -/** - * @type {object} - * @property {constructor} SecurityCenterClient - * Reference to {@link v1.SecurityCenterClient} - */ -module.exports = gapic.v1; - -/** - * @type {object} - * @property {constructor} SecurityCenterClient - * Reference to {@link v1.SecurityCenterClient} - */ -module.exports.v1 = gapic.v1; - -// Alias `module.exports` as `module.exports.default`, for future-proofing. -module.exports.default = Object.assign({}, module.exports); diff --git a/packages/google-cloud-securitycenter/src/index.ts b/packages/google-cloud-securitycenter/src/index.ts new file mode 100644 index 00000000000..00c5d09fec7 --- /dev/null +++ b/packages/google-cloud-securitycenter/src/index.ts @@ -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 +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIEscS OR CONDITIONS OF ANY KIND, either express or implied. +// See the License fscor the specific language governing permissions and +// limitations undersc the License. +// +// ** 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 v1 from './v1'; +import * as v1beta1 from './v1beta1'; +import * as v1p1beta1 from './v1p1beta1'; + +export {v1, v1beta1, v1p1beta1, SecurityCenterClient}; + +const SecurityCenterClient = v1.SecurityCenterClient; + +// For compatibility with JavaScript libraries we need to provide this default export: +// tslint:disable-next-line no-default-export +export default {v1, v1beta1, v1p1beta1, SecurityCenterClient}; diff --git a/packages/google-cloud-securitycenter/src/v1/doc/google/cloud/securitycenter/v1/doc_asset.js b/packages/google-cloud-securitycenter/src/v1/doc/google/cloud/securitycenter/v1/doc_asset.js deleted file mode 100644 index aef0418e6fa..00000000000 --- a/packages/google-cloud-securitycenter/src/v1/doc/google/cloud/securitycenter/v1/doc_asset.js +++ /dev/null @@ -1,133 +0,0 @@ -// 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. - -// Note: this file is purely for documentation. Any contents are not expected -// to be loaded as the JS file. - -/** - * Cloud Security Command Center's (Cloud SCC) representation of a Google Cloud - * Platform (GCP) resource. - * - * The Asset is a Cloud SCC resource that captures information about a single - * GCP resource. All modifications to an Asset are only within the context of - * Cloud SCC and don't affect the referenced GCP resource. - * - * @property {string} name - * The relative resource name of this asset. See: - * https://cloud.google.com/apis/design/resource_names#relative_resource_name - * Example: - * "organizations/{organization_id}/assets/{asset_id}". - * - * @property {Object} securityCenterProperties - * Cloud SCC managed properties. These properties are managed by - * Cloud SCC and cannot be modified by the user. - * - * This object should have the same structure as [SecurityCenterProperties]{@link google.cloud.securitycenter.v1.SecurityCenterProperties} - * - * @property {Object.} resourceProperties - * Resource managed properties. These properties are managed and defined by - * the GCP resource and cannot be modified by the user. - * - * @property {Object} securityMarks - * User specified security marks. These marks are entirely managed by the user - * and come from the SecurityMarks resource that belongs to the asset. - * - * This object should have the same structure as [SecurityMarks]{@link google.cloud.securitycenter.v1.SecurityMarks} - * - * @property {Object} createTime - * The time at which the asset was created in Cloud SCC. - * - * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} - * - * @property {Object} updateTime - * The time at which the asset was last updated, added, or deleted in Cloud - * SCC. - * - * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} - * - * @property {Object} iamPolicy - * IAM Policy information associated with the GCP resource described by the - * Cloud SCC asset. This information is managed and defined by the GCP - * resource and cannot be modified by the user. - * - * This object should have the same structure as [IamPolicy]{@link google.cloud.securitycenter.v1.IamPolicy} - * - * @typedef Asset - * @memberof google.cloud.securitycenter.v1 - * @see [google.cloud.securitycenter.v1.Asset definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/securitycenter/v1/asset.proto} - */ -const Asset = { - // This is for documentation. Actual contents will be loaded by gRPC. - - /** - * Cloud SCC managed properties. These properties are managed by Cloud SCC and - * cannot be modified by the user. - * - * @property {string} resourceName - * The full resource name of the GCP resource this asset - * represents. This field is immutable after create time. See: - * https://cloud.google.com/apis/design/resource_names#full_resource_name - * - * @property {string} resourceType - * The type of the GCP resource. Examples include: APPLICATION, - * PROJECT, and ORGANIZATION. This is a case insensitive field defined by - * Cloud SCC and/or the producer of the resource and is immutable - * after create time. - * - * @property {string} resourceParent - * The full resource name of the immediate parent of the resource. See: - * https://cloud.google.com/apis/design/resource_names#full_resource_name - * - * @property {string} resourceProject - * The full resource name of the project the resource belongs to. See: - * https://cloud.google.com/apis/design/resource_names#full_resource_name - * - * @property {string[]} resourceOwners - * Owners of the Google Cloud resource. - * - * @property {string} resourceDisplayName - * The user defined display name for this resource. - * - * @property {string} resourceParentDisplayName - * The user defined display name for the parent of this resource. - * - * @property {string} resourceProjectDisplayName - * The user defined display name for the project of this resource. - * - * @typedef SecurityCenterProperties - * @memberof google.cloud.securitycenter.v1 - * @see [google.cloud.securitycenter.v1.Asset.SecurityCenterProperties definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/securitycenter/v1/asset.proto} - */ - SecurityCenterProperties: { - // This is for documentation. Actual contents will be loaded by gRPC. - }, - - /** - * IAM Policy information associated with the GCP resource described by the - * Cloud SCC asset. This information is managed and defined by the GCP - * resource and cannot be modified by the user. - * - * @property {string} policyBlob - * The JSON representation of the Policy associated with the asset. - * See https://cloud.google.com/iam/reference/rest/v1/Policy for format - * details. - * - * @typedef IamPolicy - * @memberof google.cloud.securitycenter.v1 - * @see [google.cloud.securitycenter.v1.Asset.IamPolicy definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/securitycenter/v1/asset.proto} - */ - IamPolicy: { - // This is for documentation. Actual contents will be loaded by gRPC. - } -}; \ No newline at end of file diff --git a/packages/google-cloud-securitycenter/src/v1/doc/google/cloud/securitycenter/v1/doc_finding.js b/packages/google-cloud-securitycenter/src/v1/doc/google/cloud/securitycenter/v1/doc_finding.js deleted file mode 100644 index ac7edb5fc80..00000000000 --- a/packages/google-cloud-securitycenter/src/v1/doc/google/cloud/securitycenter/v1/doc_finding.js +++ /dev/null @@ -1,119 +0,0 @@ -// 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. - -// Note: this file is purely for documentation. Any contents are not expected -// to be loaded as the JS file. - -/** - * Cloud Security Command Center (Cloud SCC) finding. - * - * A finding is a record of assessment data like security, risk, health, or - * privacy, that is ingested into Cloud SCC for presentation, notification, - * analysis, policy testing, and enforcement. For example, a - * cross-site scripting (XSS) vulnerability in an App Engine application is a - * finding. - * - * @property {string} name - * The relative resource name of this finding. See: - * https://cloud.google.com/apis/design/resource_names#relative_resource_name - * Example: - * "organizations/{organization_id}/sources/{source_id}/findings/{finding_id}" - * - * @property {string} parent - * The relative resource name of the source the finding belongs to. See: - * https://cloud.google.com/apis/design/resource_names#relative_resource_name - * This field is immutable after creation time. - * For example: - * "organizations/{organization_id}/sources/{source_id}" - * - * @property {string} resourceName - * For findings on Google Cloud Platform (GCP) resources, the full resource - * name of the GCP resource this finding is for. See: - * https://cloud.google.com/apis/design/resource_names#full_resource_name - * When the finding is for a non-GCP resource, the resourceName can be a - * customer or partner defined string. - * This field is immutable after creation time. - * - * @property {number} state - * The state of the finding. - * - * The number should be among the values of [State]{@link google.cloud.securitycenter.v1.State} - * - * @property {string} category - * The additional taxonomy group within findings from a given source. - * This field is immutable after creation time. - * Example: "XSS_FLASH_INJECTION" - * - * @property {string} externalUri - * The URI that, if available, points to a web page outside of Cloud SCC - * where additional information about the finding can be found. This field is - * guaranteed to be either empty or a well formed URL. - * - * @property {Object.} sourceProperties - * Source specific properties. These properties are managed by the source - * that writes the finding. The key names in the source_properties map must be - * between 1 and 255 characters, and must start with a letter and contain - * alphanumeric characters or underscores only. - * - * @property {Object} securityMarks - * Output only. User specified security marks. These marks are entirely - * managed by the user and come from the SecurityMarks resource that belongs - * to the finding. - * - * This object should have the same structure as [SecurityMarks]{@link google.cloud.securitycenter.v1.SecurityMarks} - * - * @property {Object} eventTime - * The time at which the event took place. For example, if the finding - * represents an open firewall it would capture the time the detector believes - * the firewall became open. The accuracy is determined by the detector. - * - * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} - * - * @property {Object} createTime - * The time at which the finding was created in Cloud SCC. - * - * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} - * - * @typedef Finding - * @memberof google.cloud.securitycenter.v1 - * @see [google.cloud.securitycenter.v1.Finding definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/securitycenter/v1/finding.proto} - */ -const Finding = { - // This is for documentation. Actual contents will be loaded by gRPC. - - /** - * The state of the finding. - * - * @enum {number} - * @memberof google.cloud.securitycenter.v1 - */ - State: { - - /** - * Unspecified state. - */ - STATE_UNSPECIFIED: 0, - - /** - * The finding requires attention and has not been addressed yet. - */ - ACTIVE: 1, - - /** - * The finding has been fixed, triaged as a non-issue or otherwise addressed - * and is no longer active. - */ - INACTIVE: 2 - } -}; \ No newline at end of file diff --git a/packages/google-cloud-securitycenter/src/v1/doc/google/cloud/securitycenter/v1/doc_organization_settings.js b/packages/google-cloud-securitycenter/src/v1/doc/google/cloud/securitycenter/v1/doc_organization_settings.js deleted file mode 100644 index 38f6bcacac6..00000000000 --- a/packages/google-cloud-securitycenter/src/v1/doc/google/cloud/securitycenter/v1/doc_organization_settings.js +++ /dev/null @@ -1,98 +0,0 @@ -// 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. - -// Note: this file is purely for documentation. Any contents are not expected -// to be loaded as the JS file. - -/** - * User specified settings that are attached to the Cloud Security Command - * Center (Cloud SCC) organization. - * - * @property {string} name - * The relative resource name of the settings. See: - * https://cloud.google.com/apis/design/resource_names#relative_resource_name - * Example: - * "organizations/{organization_id}/organizationSettings". - * - * @property {boolean} enableAssetDiscovery - * A flag that indicates if Asset Discovery should be enabled. If the flag is - * set to `true`, then discovery of assets will occur. If it is set to `false, - * all historical assets will remain, but discovery of future assets will not - * occur. - * - * @property {Object} assetDiscoveryConfig - * The configuration used for Asset Discovery runs. - * - * This object should have the same structure as [AssetDiscoveryConfig]{@link google.cloud.securitycenter.v1.AssetDiscoveryConfig} - * - * @typedef OrganizationSettings - * @memberof google.cloud.securitycenter.v1 - * @see [google.cloud.securitycenter.v1.OrganizationSettings definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/securitycenter/v1/organization_settings.proto} - */ -const OrganizationSettings = { - // This is for documentation. Actual contents will be loaded by gRPC. - - /** - * The configuration used for Asset Discovery runs. - * - * @property {string[]} projectIds - * The project ids to use for filtering asset discovery. - * - * @property {number} inclusionMode - * The mode to use for filtering asset discovery. - * - * The number should be among the values of [InclusionMode]{@link google.cloud.securitycenter.v1.InclusionMode} - * - * @typedef AssetDiscoveryConfig - * @memberof google.cloud.securitycenter.v1 - * @see [google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/securitycenter/v1/organization_settings.proto} - */ - AssetDiscoveryConfig: { - // This is for documentation. Actual contents will be loaded by gRPC. - - /** - * The mode of inclusion when running Asset Discovery. - * Asset discovery can be limited by explicitly identifying projects to be - * included or excluded. If INCLUDE_ONLY is set, then only those projects - * within the organization and their children are discovered during asset - * discovery. If EXCLUDE is set, then projects that don't match those - * projects are discovered during asset discovery. If neither are set, then - * all projects within the organization are discovered during asset - * discovery. - * - * @enum {number} - * @memberof google.cloud.securitycenter.v1 - */ - InclusionMode: { - - /** - * Unspecified. Setting the mode with this value will disable - * inclusion/exclusion filtering for Asset Discovery. - */ - INCLUSION_MODE_UNSPECIFIED: 0, - - /** - * Asset Discovery will capture only the resources within the projects - * specified. All other resources will be ignored. - */ - INCLUDE_ONLY: 1, - - /** - * Asset Discovery will ignore all resources under the projects specified. - * All other resources will be retrieved. - */ - EXCLUDE: 2 - } - } -}; \ No newline at end of file diff --git a/packages/google-cloud-securitycenter/src/v1/doc/google/cloud/securitycenter/v1/doc_security_marks.js b/packages/google-cloud-securitycenter/src/v1/doc/google/cloud/securitycenter/v1/doc_security_marks.js deleted file mode 100644 index 44bacf1b9c8..00000000000 --- a/packages/google-cloud-securitycenter/src/v1/doc/google/cloud/securitycenter/v1/doc_security_marks.js +++ /dev/null @@ -1,47 +0,0 @@ -// 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. - -// Note: this file is purely for documentation. Any contents are not expected -// to be loaded as the JS file. - -/** - * User specified security marks that are attached to the parent Cloud Security - * Command Center (Cloud SCC) resource. Security marks are scoped within a Cloud - * SCC organization -- they can be modified and viewed by all users who have - * proper permissions on the organization. - * - * @property {string} name - * The relative resource name of the SecurityMarks. See: - * https://cloud.google.com/apis/design/resource_names#relative_resource_name - * Examples: - * "organizations/{organization_id}/assets/{asset_id}/securityMarks" - * "organizations/{organization_id}/sources/{source_id}/findings/{finding_id}/securityMarks". - * - * @property {Object.} marks - * Mutable user specified security marks belonging to the parent resource. - * Constraints are as follows: - * - * * Keys and values are treated as case insensitive - * * Keys must be between 1 - 256 characters (inclusive) - * * Keys must be letters, numbers, underscores, or dashes - * * Values have leading and trailing whitespace trimmed, remaining - * characters must be between 1 - 4096 characters (inclusive) - * - * @typedef SecurityMarks - * @memberof google.cloud.securitycenter.v1 - * @see [google.cloud.securitycenter.v1.SecurityMarks definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/securitycenter/v1/security_marks.proto} - */ -const SecurityMarks = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; \ No newline at end of file diff --git a/packages/google-cloud-securitycenter/src/v1/doc/google/cloud/securitycenter/v1/doc_securitycenter_service.js b/packages/google-cloud-securitycenter/src/v1/doc/google/cloud/securitycenter/v1/doc_securitycenter_service.js deleted file mode 100644 index 15d56f9a2cb..00000000000 --- a/packages/google-cloud-securitycenter/src/v1/doc/google/cloud/securitycenter/v1/doc_securitycenter_service.js +++ /dev/null @@ -1,1122 +0,0 @@ -// 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. - -// Note: this file is purely for documentation. Any contents are not expected -// to be loaded as the JS file. - -/** - * Request message for creating a finding. - * - * @property {string} parent - * Required. Resource name of the new finding's parent. Its format should be - * "organizations/[organization_id]/sources/[source_id]". - * - * @property {string} findingId - * Required. Unique identifier provided by the client within the parent scope. - * It must be alphanumeric and less than or equal to 32 characters and - * greater than 0 characters in length. - * - * @property {Object} finding - * Required. The Finding being created. The name and security_marks will be ignored as - * they are both output only fields on this resource. - * - * This object should have the same structure as [Finding]{@link google.cloud.securitycenter.v1.Finding} - * - * @typedef CreateFindingRequest - * @memberof google.cloud.securitycenter.v1 - * @see [google.cloud.securitycenter.v1.CreateFindingRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/securitycenter/v1/securitycenter_service.proto} - */ -const CreateFindingRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Request message for creating a source. - * - * @property {string} parent - * Required. Resource name of the new source's parent. Its format should be - * "organizations/[organization_id]". - * - * @property {Object} source - * Required. The Source being created, only the display_name and description will be - * used. All other fields will be ignored. - * - * This object should have the same structure as [Source]{@link google.cloud.securitycenter.v1.Source} - * - * @typedef CreateSourceRequest - * @memberof google.cloud.securitycenter.v1 - * @see [google.cloud.securitycenter.v1.CreateSourceRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/securitycenter/v1/securitycenter_service.proto} - */ -const CreateSourceRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Request message for getting organization settings. - * - * @property {string} name - * Required. Name of the organization to get organization settings for. Its format is - * "organizations/[organization_id]/organizationSettings". - * - * @typedef GetOrganizationSettingsRequest - * @memberof google.cloud.securitycenter.v1 - * @see [google.cloud.securitycenter.v1.GetOrganizationSettingsRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/securitycenter/v1/securitycenter_service.proto} - */ -const GetOrganizationSettingsRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Request message for getting a source. - * - * @property {string} name - * Required. Relative resource name of the source. Its format is - * "organizations/[organization_id]/source/[source_id]". - * - * @typedef GetSourceRequest - * @memberof google.cloud.securitycenter.v1 - * @see [google.cloud.securitycenter.v1.GetSourceRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/securitycenter/v1/securitycenter_service.proto} - */ -const GetSourceRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Request message for grouping by assets. - * - * @property {string} parent - * Required. Name of the organization to groupBy. Its format is - * "organizations/[organization_id]". - * - * @property {string} filter - * Expression that defines the filter to apply across assets. - * The expression is a list of zero or more restrictions combined via logical - * operators `AND` and `OR`. - * Parentheses are supported, and `OR` has higher precedence than `AND`. - * - * Restrictions have the form ` ` and may have a `-` - * character in front of them to indicate negation. The fields map to those - * defined in the Asset resource. Examples include: - * - * * name - * * security_center_properties.resource_name - * * resource_properties.a_property - * * security_marks.marks.marka - * - * The supported operators are: - * - * * `=` for all value types. - * * `>`, `<`, `>=`, `<=` for integer values. - * * `:`, meaning substring matching, for strings. - * - * The supported value types are: - * - * * string literals in quotes. - * * integer literals without quotes. - * * boolean literals `true` and `false` without quotes. - * - * The following field and operator combinations are supported: - * - * * name: `=` - * * update_time: `=`, `>`, `<`, `>=`, `<=` - * - * Usage: This should be milliseconds since epoch or an RFC3339 string. - * Examples: - * "update_time = \"2019-06-10T16:07:18-07:00\"" - * "update_time = 1560208038000" - * - * * create_time: `=`, `>`, `<`, `>=`, `<=` - * - * Usage: This should be milliseconds since epoch or an RFC3339 string. - * Examples: - * "create_time = \"2019-06-10T16:07:18-07:00\"" - * "create_time = 1560208038000" - * - * * iam_policy.policy_blob: `=`, `:` - * * resource_properties: `=`, `:`, `>`, `<`, `>=`, `<=` - * * security_marks.marks: `=`, `:` - * * security_center_properties.resource_name: `=`, `:` - * * security_center_properties.resource_display_name: `=`, `:` - * * security_center_properties.resource_type: `=`, `:` - * * security_center_properties.resource_parent: `=`, `:` - * * security_center_properties.resource_parent_display_name: `=`, `:` - * * security_center_properties.resource_project: `=`, `:` - * * security_center_properties.resource_project_display_name: `=`, `:` - * * security_center_properties.resource_owners: `=`, `:` - * - * For example, `resource_properties.size = 100` is a valid filter string. - * - * @property {string} groupBy - * Required. Expression that defines what assets fields to use for grouping. The string - * value should follow SQL syntax: comma separated list of fields. For - * example: - * "security_center_properties.resource_project,security_center_properties.project". - * - * The following fields are supported when compare_duration is not set: - * - * * security_center_properties.resource_project - * * security_center_properties.resource_project_display_name - * * security_center_properties.resource_type - * * security_center_properties.resource_parent - * * security_center_properties.resource_parent_display_name - * - * The following fields are supported when compare_duration is set: - * - * * security_center_properties.resource_type - * * security_center_properties.resource_project_display_name - * * security_center_properties.resource_parent_display_name - * - * @property {Object} compareDuration - * When compare_duration is set, the GroupResult's "state_change" property is - * updated to indicate whether the asset was added, removed, or remained - * present during the compare_duration period of time that precedes the - * read_time. This is the time between (read_time - compare_duration) and - * read_time. - * - * The state change value is derived based on the presence of the asset at the - * two points in time. Intermediate state changes between the two times don't - * affect the result. For example, the results aren't affected if the asset is - * removed and re-created again. - * - * Possible "state_change" values when compare_duration is specified: - * - * * "ADDED": indicates that the asset was not present at the start of - * compare_duration, but present at reference_time. - * * "REMOVED": indicates that the asset was present at the start of - * compare_duration, but not present at reference_time. - * * "ACTIVE": indicates that the asset was present at both the - * start and the end of the time period defined by - * compare_duration and reference_time. - * - * If compare_duration is not specified, then the only possible state_change - * is "UNUSED", which will be the state_change set for all assets present at - * read_time. - * - * If this field is set then `state_change` must be a specified field in - * `group_by`. - * - * This object should have the same structure as [Duration]{@link google.protobuf.Duration} - * - * @property {Object} readTime - * Time used as a reference point when filtering assets. The filter is limited - * to assets existing at the supplied time and their values are those at that - * specific time. Absence of this field will default to the API's version of - * NOW. - * - * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} - * - * @property {string} pageToken - * The value returned by the last `GroupAssetsResponse`; indicates - * that this is a continuation of a prior `GroupAssets` call, and that the - * system should return the next page of data. - * - * @property {number} pageSize - * The maximum number of results to return in a single response. Default is - * 10, minimum is 1, maximum is 1000. - * - * @typedef GroupAssetsRequest - * @memberof google.cloud.securitycenter.v1 - * @see [google.cloud.securitycenter.v1.GroupAssetsRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/securitycenter/v1/securitycenter_service.proto} - */ -const GroupAssetsRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Response message for grouping by assets. - * - * @property {Object[]} groupByResults - * Group results. There exists an element for each existing unique - * combination of property/values. The element contains a count for the number - * of times those specific property/values appear. - * - * This object should have the same structure as [GroupResult]{@link google.cloud.securitycenter.v1.GroupResult} - * - * @property {Object} readTime - * Time used for executing the groupBy request. - * - * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} - * - * @property {string} nextPageToken - * Token to retrieve the next page of results, or empty if there are no more - * results. - * - * @property {number} totalSize - * The total number of results matching the query. - * - * @typedef GroupAssetsResponse - * @memberof google.cloud.securitycenter.v1 - * @see [google.cloud.securitycenter.v1.GroupAssetsResponse definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/securitycenter/v1/securitycenter_service.proto} - */ -const GroupAssetsResponse = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Request message for grouping by findings. - * - * @property {string} parent - * Required. Name of the source to groupBy. Its format is - * "organizations/[organization_id]/sources/[source_id]". To groupBy across - * all sources provide a source_id of `-`. For example: - * organizations/{organization_id}/sources/- - * - * @property {string} filter - * Expression that defines the filter to apply across findings. - * The expression is a list of one or more restrictions combined via logical - * operators `AND` and `OR`. - * Parentheses are supported, and `OR` has higher precedence than `AND`. - * - * Restrictions have the form ` ` and may have a `-` - * character in front of them to indicate negation. Examples include: - * - * * name - * * source_properties.a_property - * * security_marks.marks.marka - * - * The supported operators are: - * - * * `=` for all value types. - * * `>`, `<`, `>=`, `<=` for integer values. - * * `:`, meaning substring matching, for strings. - * - * The supported value types are: - * - * * string literals in quotes. - * * integer literals without quotes. - * * boolean literals `true` and `false` without quotes. - * - * The following field and operator combinations are supported: - * - * * name: `=` - * * parent: `=`, `:` - * * resource_name: `=`, `:` - * * state: `=`, `:` - * * category: `=`, `:` - * * external_uri: `=`, `:` - * * event_time: `=`, `>`, `<`, `>=`, `<=` - * - * Usage: This should be milliseconds since epoch or an RFC3339 string. - * Examples: - * "event_time = \"2019-06-10T16:07:18-07:00\"" - * "event_time = 1560208038000" - * - * * security_marks.marks: `=`, `:` - * * source_properties: `=`, `:`, `>`, `<`, `>=`, `<=` - * - * For example, `source_properties.size = 100` is a valid filter string. - * - * @property {string} groupBy - * Required. Expression that defines what assets fields to use for grouping (including - * `state_change`). The string value should follow SQL syntax: comma separated - * list of fields. For example: "parent,resource_name". - * - * The following fields are supported: - * - * * resource_name - * * category - * * state - * * parent - * - * The following fields are supported when compare_duration is set: - * - * * state_change - * - * @property {Object} readTime - * Time used as a reference point when filtering findings. The filter is - * limited to findings existing at the supplied time and their values are - * those at that specific time. Absence of this field will default to the - * API's version of NOW. - * - * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} - * - * @property {Object} compareDuration - * When compare_duration is set, the GroupResult's "state_change" attribute is - * updated to indicate whether the finding had its state changed, the - * finding's state remained unchanged, or if the finding was added during the - * compare_duration period of time that precedes the read_time. This is the - * time between (read_time - compare_duration) and read_time. - * - * The state_change value is derived based on the presence and state of the - * finding at the two points in time. Intermediate state changes between the - * two times don't affect the result. For example, the results aren't affected - * if the finding is made inactive and then active again. - * - * Possible "state_change" values when compare_duration is specified: - * - * * "CHANGED": indicates that the finding was present at the start of - * compare_duration, but changed its state at read_time. - * * "UNCHANGED": indicates that the finding was present at the start of - * compare_duration and did not change state at read_time. - * * "ADDED": indicates that the finding was not present at the start - * of compare_duration, but was present at read_time. - * - * If compare_duration is not specified, then the only possible state_change - * is "UNUSED", which will be the state_change set for all findings present - * at read_time. - * - * If this field is set then `state_change` must be a specified field in - * `group_by`. - * - * This object should have the same structure as [Duration]{@link google.protobuf.Duration} - * - * @property {string} pageToken - * The value returned by the last `GroupFindingsResponse`; indicates - * that this is a continuation of a prior `GroupFindings` call, and - * that the system should return the next page of data. - * - * @property {number} pageSize - * The maximum number of results to return in a single response. Default is - * 10, minimum is 1, maximum is 1000. - * - * @typedef GroupFindingsRequest - * @memberof google.cloud.securitycenter.v1 - * @see [google.cloud.securitycenter.v1.GroupFindingsRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/securitycenter/v1/securitycenter_service.proto} - */ -const GroupFindingsRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Response message for group by findings. - * - * @property {Object[]} groupByResults - * Group results. There exists an element for each existing unique - * combination of property/values. The element contains a count for the number - * of times those specific property/values appear. - * - * This object should have the same structure as [GroupResult]{@link google.cloud.securitycenter.v1.GroupResult} - * - * @property {Object} readTime - * Time used for executing the groupBy request. - * - * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} - * - * @property {string} nextPageToken - * Token to retrieve the next page of results, or empty if there are no more - * results. - * - * @property {number} totalSize - * The total number of results matching the query. - * - * @typedef GroupFindingsResponse - * @memberof google.cloud.securitycenter.v1 - * @see [google.cloud.securitycenter.v1.GroupFindingsResponse definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/securitycenter/v1/securitycenter_service.proto} - */ -const GroupFindingsResponse = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Result containing the properties and count of a groupBy request. - * - * @property {Object.} properties - * Properties matching the groupBy fields in the request. - * - * @property {number} count - * Total count of resources for the given properties. - * - * @typedef GroupResult - * @memberof google.cloud.securitycenter.v1 - * @see [google.cloud.securitycenter.v1.GroupResult definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/securitycenter/v1/securitycenter_service.proto} - */ -const GroupResult = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Request message for listing sources. - * - * @property {string} parent - * Required. Resource name of the parent of sources to list. Its format should be - * "organizations/[organization_id]". - * - * @property {string} pageToken - * The value returned by the last `ListSourcesResponse`; indicates - * that this is a continuation of a prior `ListSources` call, and - * that the system should return the next page of data. - * - * @property {number} pageSize - * The maximum number of results to return in a single response. Default is - * 10, minimum is 1, maximum is 1000. - * - * @typedef ListSourcesRequest - * @memberof google.cloud.securitycenter.v1 - * @see [google.cloud.securitycenter.v1.ListSourcesRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/securitycenter/v1/securitycenter_service.proto} - */ -const ListSourcesRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Response message for listing sources. - * - * @property {Object[]} sources - * Sources belonging to the requested parent. - * - * This object should have the same structure as [Source]{@link google.cloud.securitycenter.v1.Source} - * - * @property {string} nextPageToken - * Token to retrieve the next page of results, or empty if there are no more - * results. - * - * @typedef ListSourcesResponse - * @memberof google.cloud.securitycenter.v1 - * @see [google.cloud.securitycenter.v1.ListSourcesResponse definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/securitycenter/v1/securitycenter_service.proto} - */ -const ListSourcesResponse = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Request message for listing assets. - * - * @property {string} parent - * Required. Name of the organization assets should belong to. Its format is - * "organizations/[organization_id]". - * - * @property {string} filter - * Expression that defines the filter to apply across assets. - * The expression is a list of zero or more restrictions combined via logical - * operators `AND` and `OR`. - * Parentheses are supported, and `OR` has higher precedence than `AND`. - * - * Restrictions have the form ` ` and may have a `-` - * character in front of them to indicate negation. The fields map to those - * defined in the Asset resource. Examples include: - * - * * name - * * security_center_properties.resource_name - * * resource_properties.a_property - * * security_marks.marks.marka - * - * The supported operators are: - * - * * `=` for all value types. - * * `>`, `<`, `>=`, `<=` for integer values. - * * `:`, meaning substring matching, for strings. - * - * The supported value types are: - * - * * string literals in quotes. - * * integer literals without quotes. - * * boolean literals `true` and `false` without quotes. - * - * The following are the allowed field and operator combinations: - * - * * name: `=` - * * update_time: `=`, `>`, `<`, `>=`, `<=` - * - * Usage: This should be milliseconds since epoch or an RFC3339 string. - * Examples: - * "update_time = \"2019-06-10T16:07:18-07:00\"" - * "update_time = 1560208038000" - * - * * create_time: `=`, `>`, `<`, `>=`, `<=` - * - * Usage: This should be milliseconds since epoch or an RFC3339 string. - * Examples: - * "create_time = \"2019-06-10T16:07:18-07:00\"" - * "create_time = 1560208038000" - * - * * iam_policy.policy_blob: `=`, `:` - * * resource_properties: `=`, `:`, `>`, `<`, `>=`, `<=` - * * security_marks.marks: `=`, `:` - * * security_center_properties.resource_name: `=`, `:` - * * security_center_properties.resource_display_name: `=`, `:` - * * security_center_properties.resource_type: `=`, `:` - * * security_center_properties.resource_parent: `=`, `:` - * * security_center_properties.resource_parent_display_name: `=`, `:` - * * security_center_properties.resource_project: `=`, `:` - * * security_center_properties.resource_project_display_name: `=`, `:` - * * security_center_properties.resource_owners: `=`, `:` - * - * For example, `resource_properties.size = 100` is a valid filter string. - * - * @property {string} orderBy - * Expression that defines what fields and order to use for sorting. The - * string value should follow SQL syntax: comma separated list of fields. For - * example: "name,resource_properties.a_property". The default sorting order - * is ascending. To specify descending order for a field, a suffix " desc" - * should be appended to the field name. For example: "name - * desc,resource_properties.a_property". Redundant space characters in the - * syntax are insignificant. "name desc,resource_properties.a_property" and " - * name desc , resource_properties.a_property " are equivalent. - * - * The following fields are supported: - * name - * update_time - * resource_properties - * security_marks.marks - * security_center_properties.resource_name - * security_center_properties.resource_display_name - * security_center_properties.resource_parent - * security_center_properties.resource_parent_display_name - * security_center_properties.resource_project - * security_center_properties.resource_project_display_name - * security_center_properties.resource_type - * - * @property {Object} readTime - * Time used as a reference point when filtering assets. The filter is limited - * to assets existing at the supplied time and their values are those at that - * specific time. Absence of this field will default to the API's version of - * NOW. - * - * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} - * - * @property {Object} compareDuration - * When compare_duration is set, the ListAssetsResult's "state_change" - * attribute is updated to indicate whether the asset was added, removed, or - * remained present during the compare_duration period of time that precedes - * the read_time. This is the time between (read_time - compare_duration) and - * read_time. - * - * The state_change value is derived based on the presence of the asset at the - * two points in time. Intermediate state changes between the two times don't - * affect the result. For example, the results aren't affected if the asset is - * removed and re-created again. - * - * Possible "state_change" values when compare_duration is specified: - * - * * "ADDED": indicates that the asset was not present at the start of - * compare_duration, but present at read_time. - * * "REMOVED": indicates that the asset was present at the start of - * compare_duration, but not present at read_time. - * * "ACTIVE": indicates that the asset was present at both the - * start and the end of the time period defined by - * compare_duration and read_time. - * - * If compare_duration is not specified, then the only possible state_change - * is "UNUSED", which will be the state_change set for all assets present at - * read_time. - * - * This object should have the same structure as [Duration]{@link google.protobuf.Duration} - * - * @property {Object} fieldMask - * Optional. A field mask to specify the ListAssetsResult fields to be listed in the - * response. - * An empty field mask will list all fields. - * - * This object should have the same structure as [FieldMask]{@link google.protobuf.FieldMask} - * - * @property {string} pageToken - * The value returned by the last `ListAssetsResponse`; indicates - * that this is a continuation of a prior `ListAssets` call, and - * that the system should return the next page of data. - * - * @property {number} pageSize - * The maximum number of results to return in a single response. Default is - * 10, minimum is 1, maximum is 1000. - * - * @typedef ListAssetsRequest - * @memberof google.cloud.securitycenter.v1 - * @see [google.cloud.securitycenter.v1.ListAssetsRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/securitycenter/v1/securitycenter_service.proto} - */ -const ListAssetsRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Response message for listing assets. - * - * @property {Object[]} listAssetsResults - * Assets matching the list request. - * - * This object should have the same structure as [ListAssetsResult]{@link google.cloud.securitycenter.v1.ListAssetsResult} - * - * @property {Object} readTime - * Time used for executing the list request. - * - * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} - * - * @property {string} nextPageToken - * Token to retrieve the next page of results, or empty if there are no more - * results. - * - * @property {number} totalSize - * The total number of assets matching the query. - * - * @typedef ListAssetsResponse - * @memberof google.cloud.securitycenter.v1 - * @see [google.cloud.securitycenter.v1.ListAssetsResponse definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/securitycenter/v1/securitycenter_service.proto} - */ -const ListAssetsResponse = { - // This is for documentation. Actual contents will be loaded by gRPC. - - /** - * Result containing the Asset and its State. - * - * @property {Object} asset - * Asset matching the search request. - * - * This object should have the same structure as [Asset]{@link google.cloud.securitycenter.v1.Asset} - * - * @property {number} stateChange - * State change of the asset between the points in time. - * - * The number should be among the values of [StateChange]{@link google.cloud.securitycenter.v1.StateChange} - * - * @typedef ListAssetsResult - * @memberof google.cloud.securitycenter.v1 - * @see [google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/securitycenter/v1/securitycenter_service.proto} - */ - ListAssetsResult: { - // This is for documentation. Actual contents will be loaded by gRPC. - - /** - * The change in state of the asset. - * - * When querying across two points in time this describes - * the change between the two points: ADDED, REMOVED, or ACTIVE. - * If there was no compare_duration supplied in the request the state change - * will be: UNUSED - * - * @enum {number} - * @memberof google.cloud.securitycenter.v1 - */ - StateChange: { - - /** - * State change is unused, this is the canonical default for this enum. - */ - UNUSED: 0, - - /** - * Asset was added between the points in time. - */ - ADDED: 1, - - /** - * Asset was removed between the points in time. - */ - REMOVED: 2, - - /** - * Asset was present at both point(s) in time. - */ - ACTIVE: 3 - } - } -}; - -/** - * Request message for listing findings. - * - * @property {string} parent - * Required. Name of the source the findings belong to. Its format is - * "organizations/[organization_id]/sources/[source_id]". To list across all - * sources provide a source_id of `-`. For example: - * organizations/{organization_id}/sources/- - * - * @property {string} filter - * Expression that defines the filter to apply across findings. - * The expression is a list of one or more restrictions combined via logical - * operators `AND` and `OR`. - * Parentheses are supported, and `OR` has higher precedence than `AND`. - * - * Restrictions have the form ` ` and may have a `-` - * character in front of them to indicate negation. Examples include: - * - * * name - * * source_properties.a_property - * * security_marks.marks.marka - * - * The supported operators are: - * - * * `=` for all value types. - * * `>`, `<`, `>=`, `<=` for integer values. - * * `:`, meaning substring matching, for strings. - * - * The supported value types are: - * - * * string literals in quotes. - * * integer literals without quotes. - * * boolean literals `true` and `false` without quotes. - * - * The following field and operator combinations are supported: - * - * name: `=` - * parent: `=`, `:` - * resource_name: `=`, `:` - * state: `=`, `:` - * category: `=`, `:` - * external_uri: `=`, `:` - * event_time: `=`, `>`, `<`, `>=`, `<=` - * - * Usage: This should be milliseconds since epoch or an RFC3339 string. - * Examples: - * "event_time = \"2019-06-10T16:07:18-07:00\"" - * "event_time = 1560208038000" - * - * security_marks.marks: `=`, `:` - * source_properties: `=`, `:`, `>`, `<`, `>=`, `<=` - * - * For example, `source_properties.size = 100` is a valid filter string. - * - * @property {string} orderBy - * Expression that defines what fields and order to use for sorting. The - * string value should follow SQL syntax: comma separated list of fields. For - * example: "name,resource_properties.a_property". The default sorting order - * is ascending. To specify descending order for a field, a suffix " desc" - * should be appended to the field name. For example: "name - * desc,source_properties.a_property". Redundant space characters in the - * syntax are insignificant. "name desc,source_properties.a_property" and " - * name desc , source_properties.a_property " are equivalent. - * - * The following fields are supported: - * name - * parent - * state - * category - * resource_name - * event_time - * source_properties - * security_marks.marks - * - * @property {Object} readTime - * Time used as a reference point when filtering findings. The filter is - * limited to findings existing at the supplied time and their values are - * those at that specific time. Absence of this field will default to the - * API's version of NOW. - * - * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} - * - * @property {Object} compareDuration - * When compare_duration is set, the ListFindingsResult's "state_change" - * attribute is updated to indicate whether the finding had its state changed, - * the finding's state remained unchanged, or if the finding was added in any - * state during the compare_duration period of time that precedes the - * read_time. This is the time between (read_time - compare_duration) and - * read_time. - * - * The state_change value is derived based on the presence and state of the - * finding at the two points in time. Intermediate state changes between the - * two times don't affect the result. For example, the results aren't affected - * if the finding is made inactive and then active again. - * - * Possible "state_change" values when compare_duration is specified: - * - * * "CHANGED": indicates that the finding was present at the start of - * compare_duration, but changed its state at read_time. - * * "UNCHANGED": indicates that the finding was present at the start of - * compare_duration and did not change state at read_time. - * * "ADDED": indicates that the finding was not present at the start - * of compare_duration, but was present at read_time. - * - * If compare_duration is not specified, then the only possible state_change - * is "UNUSED", which will be the state_change set for all findings present at - * read_time. - * - * This object should have the same structure as [Duration]{@link google.protobuf.Duration} - * - * @property {Object} fieldMask - * Optional. A field mask to specify the Finding fields to be listed in the response. - * An empty field mask will list all fields. - * - * This object should have the same structure as [FieldMask]{@link google.protobuf.FieldMask} - * - * @property {string} pageToken - * The value returned by the last `ListFindingsResponse`; indicates - * that this is a continuation of a prior `ListFindings` call, and - * that the system should return the next page of data. - * - * @property {number} pageSize - * The maximum number of results to return in a single response. Default is - * 10, minimum is 1, maximum is 1000. - * - * @typedef ListFindingsRequest - * @memberof google.cloud.securitycenter.v1 - * @see [google.cloud.securitycenter.v1.ListFindingsRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/securitycenter/v1/securitycenter_service.proto} - */ -const ListFindingsRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Response message for listing findings. - * - * @property {Object[]} listFindingsResults - * Findings matching the list request. - * - * This object should have the same structure as [ListFindingsResult]{@link google.cloud.securitycenter.v1.ListFindingsResult} - * - * @property {Object} readTime - * Time used for executing the list request. - * - * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} - * - * @property {string} nextPageToken - * Token to retrieve the next page of results, or empty if there are no more - * results. - * - * @property {number} totalSize - * The total number of findings matching the query. - * - * @typedef ListFindingsResponse - * @memberof google.cloud.securitycenter.v1 - * @see [google.cloud.securitycenter.v1.ListFindingsResponse definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/securitycenter/v1/securitycenter_service.proto} - */ -const ListFindingsResponse = { - // This is for documentation. Actual contents will be loaded by gRPC. - - /** - * Result containing the Finding and its StateChange. - * - * @property {Object} finding - * Finding matching the search request. - * - * This object should have the same structure as [Finding]{@link google.cloud.securitycenter.v1.Finding} - * - * @property {number} stateChange - * State change of the finding between the points in time. - * - * The number should be among the values of [StateChange]{@link google.cloud.securitycenter.v1.StateChange} - * - * @property {Object} resource - * Output only. Resource that is associated with this finding. - * - * This object should have the same structure as [Resource]{@link google.cloud.securitycenter.v1.Resource} - * - * @typedef ListFindingsResult - * @memberof google.cloud.securitycenter.v1 - * @see [google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/securitycenter/v1/securitycenter_service.proto} - */ - ListFindingsResult: { - // This is for documentation. Actual contents will be loaded by gRPC. - - /** - * Information related to the Google Cloud Platform (GCP) resource that is - * associated with this finding. - * - * @property {string} name - * The full resource name of the resource. See: - * https://cloud.google.com/apis/design/resource_names#full_resource_name - * - * @property {string} projectName - * The full resource name of project that the resource belongs to. - * - * @property {string} projectDisplayName - * The human readable name of project that the resource belongs to. - * - * @property {string} parentName - * The full resource name of resource's parent. - * - * @property {string} parentDisplayName - * The human readable name of resource's parent. - * - * @typedef Resource - * @memberof google.cloud.securitycenter.v1 - * @see [google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/securitycenter/v1/securitycenter_service.proto} - */ - Resource: { - // This is for documentation. Actual contents will be loaded by gRPC. - }, - - /** - * The change in state of the finding. - * - * When querying across two points in time this describes - * the change in the finding between the two points: CHANGED, UNCHANGED, - * ADDED, or REMOVED. Findings can not be deleted, so REMOVED implies that - * the finding at timestamp does not match the filter specified, but it did - * at timestamp - compare_duration. If there was no compare_duration - * supplied in the request the state change will be: UNUSED - * - * @enum {number} - * @memberof google.cloud.securitycenter.v1 - */ - StateChange: { - - /** - * State change is unused, this is the canonical default for this enum. - */ - UNUSED: 0, - - /** - * The finding has changed state in some way between the points in time - * and existed at both points. - */ - CHANGED: 1, - - /** - * The finding has not changed state between the points in time and - * existed at both points. - */ - UNCHANGED: 2, - - /** - * The finding was created between the points in time. - */ - ADDED: 3, - - /** - * The finding at timestamp does not match the filter specified, but it - * did at timestamp - compare_duration. - */ - REMOVED: 4 - } - } -}; - -/** - * Request message for updating a finding's state. - * - * @property {string} name - * Required. The relative resource name of the finding. See: - * https://cloud.google.com/apis/design/resource_names#relative_resource_name - * Example: - * "organizations/{organization_id}/sources/{source_id}/finding/{finding_id}". - * - * @property {number} state - * Required. The desired State of the finding. - * - * The number should be among the values of [State]{@link google.cloud.securitycenter.v1.State} - * - * @property {Object} startTime - * Required. The time at which the updated state takes effect. - * - * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} - * - * @typedef SetFindingStateRequest - * @memberof google.cloud.securitycenter.v1 - * @see [google.cloud.securitycenter.v1.SetFindingStateRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/securitycenter/v1/securitycenter_service.proto} - */ -const SetFindingStateRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Request message for running asset discovery for an organization. - * - * @property {string} parent - * Required. Name of the organization to run asset discovery for. Its format is - * "organizations/[organization_id]". - * - * @typedef RunAssetDiscoveryRequest - * @memberof google.cloud.securitycenter.v1 - * @see [google.cloud.securitycenter.v1.RunAssetDiscoveryRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/securitycenter/v1/securitycenter_service.proto} - */ -const RunAssetDiscoveryRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Request message for updating or creating a finding. - * - * @property {Object} finding - * Required. The finding resource to update or create if it does not already exist. - * parent, security_marks, and update_time will be ignored. - * - * In the case of creation, the finding id portion of the name must be - * alphanumeric and less than or equal to 32 characters and greater than 0 - * characters in length. - * - * This object should have the same structure as [Finding]{@link google.cloud.securitycenter.v1.Finding} - * - * @property {Object} updateMask - * The FieldMask to use when updating the finding resource. This field should - * not be specified when creating a finding. - * - * When updating a finding, an empty mask is treated as updating all mutable - * fields and replacing source_properties. Individual source_properties can - * be added/updated by using "source_properties." in the field - * mask. - * - * This object should have the same structure as [FieldMask]{@link google.protobuf.FieldMask} - * - * @typedef UpdateFindingRequest - * @memberof google.cloud.securitycenter.v1 - * @see [google.cloud.securitycenter.v1.UpdateFindingRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/securitycenter/v1/securitycenter_service.proto} - */ -const UpdateFindingRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Request message for updating an organization's settings. - * - * @property {Object} organizationSettings - * Required. The organization settings resource to update. - * - * This object should have the same structure as [OrganizationSettings]{@link google.cloud.securitycenter.v1.OrganizationSettings} - * - * @property {Object} updateMask - * The FieldMask to use when updating the settings resource. - * - * If empty all mutable fields will be updated. - * - * This object should have the same structure as [FieldMask]{@link google.protobuf.FieldMask} - * - * @typedef UpdateOrganizationSettingsRequest - * @memberof google.cloud.securitycenter.v1 - * @see [google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/securitycenter/v1/securitycenter_service.proto} - */ -const UpdateOrganizationSettingsRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Request message for updating a source. - * - * @property {Object} source - * Required. The source resource to update. - * - * This object should have the same structure as [Source]{@link google.cloud.securitycenter.v1.Source} - * - * @property {Object} updateMask - * The FieldMask to use when updating the source resource. - * - * If empty all mutable fields will be updated. - * - * This object should have the same structure as [FieldMask]{@link google.protobuf.FieldMask} - * - * @typedef UpdateSourceRequest - * @memberof google.cloud.securitycenter.v1 - * @see [google.cloud.securitycenter.v1.UpdateSourceRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/securitycenter/v1/securitycenter_service.proto} - */ -const UpdateSourceRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Request message for updating a SecurityMarks resource. - * - * @property {Object} securityMarks - * Required. The security marks resource to update. - * - * This object should have the same structure as [SecurityMarks]{@link google.cloud.securitycenter.v1.SecurityMarks} - * - * @property {Object} updateMask - * The FieldMask to use when updating the security marks resource. - * - * The field mask must not contain duplicate fields. - * If empty or set to "marks", all marks will be replaced. Individual - * marks can be updated using "marks.". - * - * This object should have the same structure as [FieldMask]{@link google.protobuf.FieldMask} - * - * @property {Object} startTime - * The time at which the updated SecurityMarks take effect. - * If not set uses current server time. Updates will be applied to the - * SecurityMarks that are active immediately preceding this time. - * - * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} - * - * @typedef UpdateSecurityMarksRequest - * @memberof google.cloud.securitycenter.v1 - * @see [google.cloud.securitycenter.v1.UpdateSecurityMarksRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/securitycenter/v1/securitycenter_service.proto} - */ -const UpdateSecurityMarksRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; \ No newline at end of file diff --git a/packages/google-cloud-securitycenter/src/v1/doc/google/cloud/securitycenter/v1/doc_source.js b/packages/google-cloud-securitycenter/src/v1/doc/google/cloud/securitycenter/v1/doc_source.js deleted file mode 100644 index a150f5cfcef..00000000000 --- a/packages/google-cloud-securitycenter/src/v1/doc/google/cloud/securitycenter/v1/doc_source.js +++ /dev/null @@ -1,52 +0,0 @@ -// 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. - -// Note: this file is purely for documentation. Any contents are not expected -// to be loaded as the JS file. - -/** - * Cloud Security Command Center's (Cloud SCC) finding source. A finding source - * is an entity or a mechanism that can produce a finding. A source is like a - * container of findings that come from the same scanner, logger, monitor, and - * other tools. - * - * @property {string} name - * The relative resource name of this source. See: - * https://cloud.google.com/apis/design/resource_names#relative_resource_name - * Example: - * "organizations/{organization_id}/sources/{source_id}" - * - * @property {string} displayName - * The source's display name. - * A source's display name must be unique amongst its siblings, for example, - * two sources with the same parent can't share the same display name. - * The display name must have a length between 1 and 64 characters - * (inclusive). - * - * @property {string} description - * The description of the source (max of 1024 characters). - * Example: - * "Web Security Scanner is a web security scanner for common - * vulnerabilities in App Engine applications. It can automatically - * scan and detect four common vulnerabilities, including cross-site-scripting - * (XSS), Flash injection, mixed content (HTTP in HTTPS), and - * outdated or insecure libraries." - * - * @typedef Source - * @memberof google.cloud.securitycenter.v1 - * @see [google.cloud.securitycenter.v1.Source definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/securitycenter/v1/source.proto} - */ -const Source = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; \ No newline at end of file diff --git a/packages/google-cloud-securitycenter/src/v1/doc/google/iam/v1/doc_iam_policy.js b/packages/google-cloud-securitycenter/src/v1/doc/google/iam/v1/doc_iam_policy.js deleted file mode 100644 index 2a58fee6a13..00000000000 --- a/packages/google-cloud-securitycenter/src/v1/doc/google/iam/v1/doc_iam_policy.js +++ /dev/null @@ -1,96 +0,0 @@ -// 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. - -// Note: this file is purely for documentation. Any contents are not expected -// to be loaded as the JS file. - -/** - * Request message for `SetIamPolicy` method. - * - * @property {string} resource - * REQUIRED: The resource for which the policy is being specified. - * See the operation documentation for the appropriate value for this field. - * - * @property {Object} policy - * REQUIRED: The complete policy to be applied to the `resource`. The size of - * the policy is limited to a few 10s of KB. An empty policy is a - * valid policy but certain Cloud Platform services (such as Projects) - * might reject them. - * - * This object should have the same structure as [Policy]{@link google.iam.v1.Policy} - * - * @typedef SetIamPolicyRequest - * @memberof google.iam.v1 - * @see [google.iam.v1.SetIamPolicyRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/iam/v1/iam_policy.proto} - */ -const SetIamPolicyRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Request message for `GetIamPolicy` method. - * - * @property {string} resource - * REQUIRED: The resource for which the policy is being requested. - * See the operation documentation for the appropriate value for this field. - * - * @property {Object} options - * OPTIONAL: A `GetPolicyOptions` object for specifying options to - * `GetIamPolicy`. This field is only used by Cloud IAM. - * - * This object should have the same structure as [GetPolicyOptions]{@link google.iam.v1.GetPolicyOptions} - * - * @typedef GetIamPolicyRequest - * @memberof google.iam.v1 - * @see [google.iam.v1.GetIamPolicyRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/iam/v1/iam_policy.proto} - */ -const GetIamPolicyRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Request message for `TestIamPermissions` method. - * - * @property {string} resource - * REQUIRED: The resource for which the policy detail is being requested. - * See the operation documentation for the appropriate value for this field. - * - * @property {string[]} permissions - * The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For more - * information see - * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - * - * @typedef TestIamPermissionsRequest - * @memberof google.iam.v1 - * @see [google.iam.v1.TestIamPermissionsRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/iam/v1/iam_policy.proto} - */ -const TestIamPermissionsRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Response message for `TestIamPermissions` method. - * - * @property {string[]} permissions - * A subset of `TestPermissionsRequest.permissions` that the caller is - * allowed. - * - * @typedef TestIamPermissionsResponse - * @memberof google.iam.v1 - * @see [google.iam.v1.TestIamPermissionsResponse definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/iam/v1/iam_policy.proto} - */ -const TestIamPermissionsResponse = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; \ No newline at end of file diff --git a/packages/google-cloud-securitycenter/src/v1/doc/google/iam/v1/doc_options.js b/packages/google-cloud-securitycenter/src/v1/doc/google/iam/v1/doc_options.js deleted file mode 100644 index ed4e25db8cd..00000000000 --- a/packages/google-cloud-securitycenter/src/v1/doc/google/iam/v1/doc_options.js +++ /dev/null @@ -1,37 +0,0 @@ -// 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. - -// Note: this file is purely for documentation. Any contents are not expected -// to be loaded as the JS file. - -/** - * Encapsulates settings provided to GetIamPolicy. - * - * @property {number} requestedPolicyVersion - * Optional. The policy format version to be returned. - * - * Valid values are 0, 1, and 3. Requests specifying an invalid value will be - * rejected. - * - * Requests for policies with any conditional bindings must specify version 3. - * Policies without any conditional bindings may specify any valid value or - * leave the field unset. - * - * @typedef GetPolicyOptions - * @memberof google.iam.v1 - * @see [google.iam.v1.GetPolicyOptions definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/iam/v1/options.proto} - */ -const GetPolicyOptions = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; \ No newline at end of file diff --git a/packages/google-cloud-securitycenter/src/v1/doc/google/iam/v1/doc_policy.js b/packages/google-cloud-securitycenter/src/v1/doc/google/iam/v1/doc_policy.js deleted file mode 100644 index f2ac79a7afa..00000000000 --- a/packages/google-cloud-securitycenter/src/v1/doc/google/iam/v1/doc_policy.js +++ /dev/null @@ -1,167 +0,0 @@ -// 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. - -// Note: this file is purely for documentation. Any contents are not expected -// to be loaded as the JS file. - -/** - * Defines an Identity and Access Management (IAM) policy. It is used to - * specify access control policies for Cloud Platform resources. - * - * - * A `Policy` is a collection of `bindings`. A `binding` binds one or more - * `members` to a single `role`. Members can be user accounts, service accounts, - * Google groups, and domains (such as G Suite). A `role` is a named list of - * permissions (defined by IAM or configured by users). A `binding` can - * optionally specify a `condition`, which is a logic expression that further - * constrains the role binding based on attributes about the request and/or - * target resource. - * - * **JSON Example** - * - * { - * "bindings": [ - * { - * "role": "roles/resourcemanager.organizationAdmin", - * "members": [ - * "user:mike@example.com", - * "group:admins@example.com", - * "domain:google.com", - * "serviceAccount:my-project-id@appspot.gserviceaccount.com" - * ] - * }, - * { - * "role": "roles/resourcemanager.organizationViewer", - * "members": ["user:eve@example.com"], - * "condition": { - * "title": "expirable access", - * "description": "Does not grant access after Sep 2020", - * "expression": "request.time < - * timestamp('2020-10-01T00:00:00.000Z')", - * } - * } - * ] - * } - * - * **YAML Example** - * - * bindings: - * - members: - * - user:mike@example.com - * - group:admins@example.com - * - domain:google.com - * - serviceAccount:my-project-id@appspot.gserviceaccount.com - * role: roles/resourcemanager.organizationAdmin - * - members: - * - user:eve@example.com - * role: roles/resourcemanager.organizationViewer - * condition: - * title: expirable access - * description: Does not grant access after Sep 2020 - * expression: request.time < timestamp('2020-10-01T00:00:00.000Z') - * - * For a description of IAM and its features, see the - * [IAM developer's guide](https://cloud.google.com/iam/docs). - * - * @property {number} version - * Specifies the format of the policy. - * - * Valid values are 0, 1, and 3. Requests specifying an invalid value will be - * rejected. - * - * Operations affecting conditional bindings must specify version 3. This can - * be either setting a conditional policy, modifying a conditional binding, - * or removing a binding (conditional or unconditional) from the stored - * conditional policy. - * Operations on non-conditional policies may specify any valid value or - * leave the field unset. - * - * If no etag is provided in the call to `setIamPolicy`, version compliance - * checks against the stored policy is skipped. - * - * @property {Object[]} bindings - * Associates a list of `members` to a `role`. Optionally may specify a - * `condition` that determines when binding is in effect. - * `bindings` with no members will result in an error. - * - * This object should have the same structure as [Binding]{@link google.iam.v1.Binding} - * - * @property {Buffer} etag - * `etag` is used for optimistic concurrency control as a way to help - * prevent simultaneous updates of a policy from overwriting each other. - * It is strongly suggested that systems make use of the `etag` in the - * read-modify-write cycle to perform policy updates in order to avoid race - * conditions: An `etag` is returned in the response to `getIamPolicy`, and - * systems are expected to put that etag in the request to `setIamPolicy` to - * ensure that their change will be applied to the same version of the policy. - * - * If no `etag` is provided in the call to `setIamPolicy`, then the existing - * policy is overwritten. Due to blind-set semantics of an etag-less policy, - * 'setIamPolicy' will not fail even if the incoming policy version does not - * meet the requirements for modifying the stored policy. - * - * @typedef Policy - * @memberof google.iam.v1 - * @see [google.iam.v1.Policy definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/iam/v1/policy.proto} - */ -const Policy = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Associates `members` with a `role`. - * - * @property {string} role - * Role that is assigned to `members`. - * For example, `roles/viewer`, `roles/editor`, or `roles/owner`. - * - * @property {string[]} members - * Specifies the identities requesting access for a Cloud Platform resource. - * `members` can have the following values: - * - * * `allUsers`: A special identifier that represents anyone who is - * on the internet; with or without a Google account. - * - * * `allAuthenticatedUsers`: A special identifier that represents anyone - * who is authenticated with a Google account or a service account. - * - * * `user:{emailid}`: An email address that represents a specific Google - * account. For example, `alice@example.com` . - * - * - * * `serviceAccount:{emailid}`: An email address that represents a service - * account. For example, `my-other-app@appspot.gserviceaccount.com`. - * - * * `group:{emailid}`: An email address that represents a Google group. - * For example, `admins@example.com`. - * - * - * * `domain:{domain}`: The G Suite domain (primary) that represents all the - * users of that domain. For example, `google.com` or `example.com`. - * - * @property {Object} condition - * The condition that is associated with this binding. - * NOTE: An unsatisfied condition will not allow user access via current - * binding. Different bindings, including their conditions, are examined - * independently. - * - * This object should have the same structure as [Expr]{@link google.type.Expr} - * - * @typedef Binding - * @memberof google.iam.v1 - * @see [google.iam.v1.Binding definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/iam/v1/policy.proto} - */ -const Binding = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; \ No newline at end of file diff --git a/packages/google-cloud-securitycenter/src/v1/doc/google/longrunning/doc_operations.js b/packages/google-cloud-securitycenter/src/v1/doc/google/longrunning/doc_operations.js deleted file mode 100644 index 099e418d620..00000000000 --- a/packages/google-cloud-securitycenter/src/v1/doc/google/longrunning/doc_operations.js +++ /dev/null @@ -1,63 +0,0 @@ -// 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. - -// Note: this file is purely for documentation. Any contents are not expected -// to be loaded as the JS file. - -/** - * This resource represents a long-running operation that is the result of a - * network API call. - * - * @property {string} name - * The server-assigned name, which is only unique within the same service that - * originally returns it. If you use the default HTTP mapping, the - * `name` should be a resource name ending with `operations/{unique_id}`. - * - * @property {Object} metadata - * Service-specific metadata associated with the operation. It typically - * contains progress information and common metadata such as create time. - * Some services might not provide such metadata. Any method that returns a - * long-running operation should document the metadata type, if any. - * - * This object should have the same structure as [Any]{@link google.protobuf.Any} - * - * @property {boolean} done - * If the value is `false`, it means the operation is still in progress. - * If `true`, the operation is completed, and either `error` or `response` is - * available. - * - * @property {Object} error - * The error result of the operation in case of failure or cancellation. - * - * This object should have the same structure as [Status]{@link google.rpc.Status} - * - * @property {Object} response - * The normal response of the operation in case of success. If the original - * method returns no data on success, such as `Delete`, the response is - * `google.protobuf.Empty`. If the original method is standard - * `Get`/`Create`/`Update`, the response should be the resource. For other - * methods, the response should have the type `XxxResponse`, where `Xxx` - * is the original method name. For example, if the original method name - * is `TakeSnapshot()`, the inferred response type is - * `TakeSnapshotResponse`. - * - * This object should have the same structure as [Any]{@link google.protobuf.Any} - * - * @typedef Operation - * @memberof google.longrunning - * @see [google.longrunning.Operation definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/longrunning/operations.proto} - */ -const Operation = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; \ No newline at end of file diff --git a/packages/google-cloud-securitycenter/src/v1/doc/google/protobuf/doc_any.js b/packages/google-cloud-securitycenter/src/v1/doc/google/protobuf/doc_any.js deleted file mode 100644 index 813682aa336..00000000000 --- a/packages/google-cloud-securitycenter/src/v1/doc/google/protobuf/doc_any.js +++ /dev/null @@ -1,137 +0,0 @@ -// 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. - -// Note: this file is purely for documentation. Any contents are not expected -// to be loaded as the JS file. - -/** - * `Any` contains an arbitrary serialized protocol buffer message along with a - * URL that describes the type of the serialized message. - * - * Protobuf library provides support to pack/unpack Any values in the form - * of utility functions or additional generated methods of the Any type. - * - * Example 1: Pack and unpack a message in C++. - * - * Foo foo = ...; - * Any any; - * any.PackFrom(foo); - * ... - * if (any.UnpackTo(&foo)) { - * ... - * } - * - * Example 2: Pack and unpack a message in Java. - * - * Foo foo = ...; - * Any any = Any.pack(foo); - * ... - * if (any.is(Foo.class)) { - * foo = any.unpack(Foo.class); - * } - * - * Example 3: Pack and unpack a message in Python. - * - * foo = Foo(...) - * any = Any() - * any.Pack(foo) - * ... - * if any.Is(Foo.DESCRIPTOR): - * any.Unpack(foo) - * ... - * - * Example 4: Pack and unpack a message in Go - * - * foo := &pb.Foo{...} - * any, err := ptypes.MarshalAny(foo) - * ... - * foo := &pb.Foo{} - * if err := ptypes.UnmarshalAny(any, foo); err != nil { - * ... - * } - * - * The pack methods provided by protobuf library will by default use - * 'type.googleapis.com/full.type.name' as the type URL and the unpack - * methods only use the fully qualified type name after the last '/' - * in the type URL, for example "foo.bar.com/x/y.z" will yield type - * name "y.z". - * - * - * # JSON - * - * The JSON representation of an `Any` value uses the regular - * representation of the deserialized, embedded message, with an - * additional field `@type` which contains the type URL. Example: - * - * package google.profile; - * message Person { - * string first_name = 1; - * string last_name = 2; - * } - * - * { - * "@type": "type.googleapis.com/google.profile.Person", - * "firstName": , - * "lastName": - * } - * - * If the embedded message type is well-known and has a custom JSON - * representation, that representation will be embedded adding a field - * `value` which holds the custom JSON in addition to the `@type` - * field. Example (for message google.protobuf.Duration): - * - * { - * "@type": "type.googleapis.com/google.protobuf.Duration", - * "value": "1.212s" - * } - * - * @property {string} typeUrl - * A URL/resource name that uniquely identifies the type of the serialized - * protocol buffer message. This string must contain at least - * one "/" character. The last segment of the URL's path must represent - * the fully qualified name of the type (as in - * `path/google.protobuf.Duration`). The name should be in a canonical form - * (e.g., leading "." is not accepted). - * - * In practice, teams usually precompile into the binary all types that they - * expect it to use in the context of Any. However, for URLs which use the - * scheme `http`, `https`, or no scheme, one can optionally set up a type - * server that maps type URLs to message definitions as follows: - * - * * If no scheme is provided, `https` is assumed. - * * An HTTP GET on the URL must yield a google.protobuf.Type - * value in binary format, or produce an error. - * * Applications are allowed to cache lookup results based on the - * URL, or have them precompiled into a binary to avoid any - * lookup. Therefore, binary compatibility needs to be preserved - * on changes to types. (Use versioned type names to manage - * breaking changes.) - * - * Note: this functionality is not currently available in the official - * protobuf release, and it is not used for type URLs beginning with - * type.googleapis.com. - * - * Schemes other than `http`, `https` (or the empty scheme) might be - * used with implementation specific semantics. - * - * @property {Buffer} value - * Must be a valid serialized protocol buffer of the above specified type. - * - * @typedef Any - * @memberof google.protobuf - * @see [google.protobuf.Any definition in proto format]{@link https://github.com/google/protobuf/blob/master/src/google/protobuf/any.proto} - */ -const Any = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; \ No newline at end of file diff --git a/packages/google-cloud-securitycenter/src/v1/doc/google/protobuf/doc_duration.js b/packages/google-cloud-securitycenter/src/v1/doc/google/protobuf/doc_duration.js deleted file mode 100644 index bd4b4ee6067..00000000000 --- a/packages/google-cloud-securitycenter/src/v1/doc/google/protobuf/doc_duration.js +++ /dev/null @@ -1,97 +0,0 @@ -// 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. - -// Note: this file is purely for documentation. Any contents are not expected -// to be loaded as the JS file. - -/** - * A Duration represents a signed, fixed-length span of time represented - * as a count of seconds and fractions of seconds at nanosecond - * resolution. It is independent of any calendar and concepts like "day" - * or "month". It is related to Timestamp in that the difference between - * two Timestamp values is a Duration and it can be added or subtracted - * from a Timestamp. Range is approximately +-10,000 years. - * - * # Examples - * - * Example 1: Compute Duration from two Timestamps in pseudo code. - * - * Timestamp start = ...; - * Timestamp end = ...; - * Duration duration = ...; - * - * duration.seconds = end.seconds - start.seconds; - * duration.nanos = end.nanos - start.nanos; - * - * if (duration.seconds < 0 && duration.nanos > 0) { - * duration.seconds += 1; - * duration.nanos -= 1000000000; - * } else if (durations.seconds > 0 && duration.nanos < 0) { - * duration.seconds -= 1; - * duration.nanos += 1000000000; - * } - * - * Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. - * - * Timestamp start = ...; - * Duration duration = ...; - * Timestamp end = ...; - * - * end.seconds = start.seconds + duration.seconds; - * end.nanos = start.nanos + duration.nanos; - * - * if (end.nanos < 0) { - * end.seconds -= 1; - * end.nanos += 1000000000; - * } else if (end.nanos >= 1000000000) { - * end.seconds += 1; - * end.nanos -= 1000000000; - * } - * - * Example 3: Compute Duration from datetime.timedelta in Python. - * - * td = datetime.timedelta(days=3, minutes=10) - * duration = Duration() - * duration.FromTimedelta(td) - * - * # JSON Mapping - * - * In JSON format, the Duration type is encoded as a string rather than an - * object, where the string ends in the suffix "s" (indicating seconds) and - * is preceded by the number of seconds, with nanoseconds expressed as - * fractional seconds. For example, 3 seconds with 0 nanoseconds should be - * encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should - * be expressed in JSON format as "3.000000001s", and 3 seconds and 1 - * microsecond should be expressed in JSON format as "3.000001s". - * - * @property {number} seconds - * Signed seconds of the span of time. Must be from -315,576,000,000 - * to +315,576,000,000 inclusive. Note: these bounds are computed from: - * 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years - * - * @property {number} nanos - * Signed fractions of a second at nanosecond resolution of the span - * of time. Durations less than one second are represented with a 0 - * `seconds` field and a positive or negative `nanos` field. For durations - * of one second or more, a non-zero value for the `nanos` field must be - * of the same sign as the `seconds` field. Must be from -999,999,999 - * to +999,999,999 inclusive. - * - * @typedef Duration - * @memberof google.protobuf - * @see [google.protobuf.Duration definition in proto format]{@link https://github.com/google/protobuf/blob/master/src/google/protobuf/duration.proto} - */ -const Duration = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; \ No newline at end of file diff --git a/packages/google-cloud-securitycenter/src/v1/doc/google/protobuf/doc_field_mask.js b/packages/google-cloud-securitycenter/src/v1/doc/google/protobuf/doc_field_mask.js deleted file mode 100644 index 59e745f36c2..00000000000 --- a/packages/google-cloud-securitycenter/src/v1/doc/google/protobuf/doc_field_mask.js +++ /dev/null @@ -1,228 +0,0 @@ -// 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. - -// Note: this file is purely for documentation. Any contents are not expected -// to be loaded as the JS file. - -/** - * `FieldMask` represents a set of symbolic field paths, for example: - * - * paths: "f.a" - * paths: "f.b.d" - * - * Here `f` represents a field in some root message, `a` and `b` - * fields in the message found in `f`, and `d` a field found in the - * message in `f.b`. - * - * Field masks are used to specify a subset of fields that should be - * returned by a get operation or modified by an update operation. - * Field masks also have a custom JSON encoding (see below). - * - * # Field Masks in Projections - * - * When used in the context of a projection, a response message or - * sub-message is filtered by the API to only contain those fields as - * specified in the mask. For example, if the mask in the previous - * example is applied to a response message as follows: - * - * f { - * a : 22 - * b { - * d : 1 - * x : 2 - * } - * y : 13 - * } - * z: 8 - * - * The result will not contain specific values for fields x,y and z - * (their value will be set to the default, and omitted in proto text - * output): - * - * - * f { - * a : 22 - * b { - * d : 1 - * } - * } - * - * A repeated field is not allowed except at the last position of a - * paths string. - * - * If a FieldMask object is not present in a get operation, the - * operation applies to all fields (as if a FieldMask of all fields - * had been specified). - * - * Note that a field mask does not necessarily apply to the - * top-level response message. In case of a REST get operation, the - * field mask applies directly to the response, but in case of a REST - * list operation, the mask instead applies to each individual message - * in the returned resource list. In case of a REST custom method, - * other definitions may be used. Where the mask applies will be - * clearly documented together with its declaration in the API. In - * any case, the effect on the returned resource/resources is required - * behavior for APIs. - * - * # Field Masks in Update Operations - * - * A field mask in update operations specifies which fields of the - * targeted resource are going to be updated. The API is required - * to only change the values of the fields as specified in the mask - * and leave the others untouched. If a resource is passed in to - * describe the updated values, the API ignores the values of all - * fields not covered by the mask. - * - * If a repeated field is specified for an update operation, new values will - * be appended to the existing repeated field in the target resource. Note that - * a repeated field is only allowed in the last position of a `paths` string. - * - * If a sub-message is specified in the last position of the field mask for an - * update operation, then new value will be merged into the existing sub-message - * in the target resource. - * - * For example, given the target message: - * - * f { - * b { - * d: 1 - * x: 2 - * } - * c: [1] - * } - * - * And an update message: - * - * f { - * b { - * d: 10 - * } - * c: [2] - * } - * - * then if the field mask is: - * - * paths: ["f.b", "f.c"] - * - * then the result will be: - * - * f { - * b { - * d: 10 - * x: 2 - * } - * c: [1, 2] - * } - * - * An implementation may provide options to override this default behavior for - * repeated and message fields. - * - * In order to reset a field's value to the default, the field must - * be in the mask and set to the default value in the provided resource. - * Hence, in order to reset all fields of a resource, provide a default - * instance of the resource and set all fields in the mask, or do - * not provide a mask as described below. - * - * If a field mask is not present on update, the operation applies to - * all fields (as if a field mask of all fields has been specified). - * Note that in the presence of schema evolution, this may mean that - * fields the client does not know and has therefore not filled into - * the request will be reset to their default. If this is unwanted - * behavior, a specific service may require a client to always specify - * a field mask, producing an error if not. - * - * As with get operations, the location of the resource which - * describes the updated values in the request message depends on the - * operation kind. In any case, the effect of the field mask is - * required to be honored by the API. - * - * ## Considerations for HTTP REST - * - * The HTTP kind of an update operation which uses a field mask must - * be set to PATCH instead of PUT in order to satisfy HTTP semantics - * (PUT must only be used for full updates). - * - * # JSON Encoding of Field Masks - * - * In JSON, a field mask is encoded as a single string where paths are - * separated by a comma. Fields name in each path are converted - * to/from lower-camel naming conventions. - * - * As an example, consider the following message declarations: - * - * message Profile { - * User user = 1; - * Photo photo = 2; - * } - * message User { - * string display_name = 1; - * string address = 2; - * } - * - * In proto a field mask for `Profile` may look as such: - * - * mask { - * paths: "user.display_name" - * paths: "photo" - * } - * - * In JSON, the same mask is represented as below: - * - * { - * mask: "user.displayName,photo" - * } - * - * # Field Masks and Oneof Fields - * - * Field masks treat fields in oneofs just as regular fields. Consider the - * following message: - * - * message SampleMessage { - * oneof test_oneof { - * string name = 4; - * SubMessage sub_message = 9; - * } - * } - * - * The field mask can be: - * - * mask { - * paths: "name" - * } - * - * Or: - * - * mask { - * paths: "sub_message" - * } - * - * Note that oneof type names ("test_oneof" in this case) cannot be used in - * paths. - * - * ## Field Mask Verification - * - * The implementation of any API method which has a FieldMask type field in the - * request should verify the included field paths, and return an - * `INVALID_ARGUMENT` error if any path is duplicated or unmappable. - * - * @property {string[]} paths - * The set of field mask paths. - * - * @typedef FieldMask - * @memberof google.protobuf - * @see [google.protobuf.FieldMask definition in proto format]{@link https://github.com/google/protobuf/blob/master/src/google/protobuf/field_mask.proto} - */ -const FieldMask = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; \ No newline at end of file diff --git a/packages/google-cloud-securitycenter/src/v1/doc/google/protobuf/doc_struct.js b/packages/google-cloud-securitycenter/src/v1/doc/google/protobuf/doc_struct.js deleted file mode 100644 index a143b9a6d2d..00000000000 --- a/packages/google-cloud-securitycenter/src/v1/doc/google/protobuf/doc_struct.js +++ /dev/null @@ -1,112 +0,0 @@ -// 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. - -// Note: this file is purely for documentation. Any contents are not expected -// to be loaded as the JS file. - -/** - * `Struct` represents a structured data value, consisting of fields - * which map to dynamically typed values. In some languages, `Struct` - * might be supported by a native representation. For example, in - * scripting languages like JS a struct is represented as an - * object. The details of that representation are described together - * with the proto support for the language. - * - * The JSON representation for `Struct` is JSON object. - * - * @property {Object.} fields - * Unordered map of dynamically typed values. - * - * @typedef Struct - * @memberof google.protobuf - * @see [google.protobuf.Struct definition in proto format]{@link https://github.com/google/protobuf/blob/master/src/google/protobuf/struct.proto} - */ -const Struct = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * `Value` represents a dynamically typed value which can be either - * null, a number, a string, a boolean, a recursive struct value, or a - * list of values. A producer of value is expected to set one of that - * variants, absence of any variant indicates an error. - * - * The JSON representation for `Value` is JSON value. - * - * @property {number} nullValue - * Represents a null value. - * - * The number should be among the values of [NullValue]{@link google.protobuf.NullValue} - * - * @property {number} numberValue - * Represents a double value. - * - * @property {string} stringValue - * Represents a string value. - * - * @property {boolean} boolValue - * Represents a boolean value. - * - * @property {Object} structValue - * Represents a structured value. - * - * This object should have the same structure as [Struct]{@link google.protobuf.Struct} - * - * @property {Object} listValue - * Represents a repeated `Value`. - * - * This object should have the same structure as [ListValue]{@link google.protobuf.ListValue} - * - * @typedef Value - * @memberof google.protobuf - * @see [google.protobuf.Value definition in proto format]{@link https://github.com/google/protobuf/blob/master/src/google/protobuf/struct.proto} - */ -const Value = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * `ListValue` is a wrapper around a repeated field of values. - * - * The JSON representation for `ListValue` is JSON array. - * - * @property {Object[]} values - * Repeated field of dynamically typed values. - * - * This object should have the same structure as [Value]{@link google.protobuf.Value} - * - * @typedef ListValue - * @memberof google.protobuf - * @see [google.protobuf.ListValue definition in proto format]{@link https://github.com/google/protobuf/blob/master/src/google/protobuf/struct.proto} - */ -const ListValue = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * `NullValue` is a singleton enumeration to represent the null value for the - * `Value` type union. - * - * The JSON representation for `NullValue` is JSON `null`. - * - * @enum {number} - * @memberof google.protobuf - */ -const NullValue = { - - /** - * Null value. - */ - NULL_VALUE: 0 -}; \ No newline at end of file diff --git a/packages/google-cloud-securitycenter/src/v1/doc/google/protobuf/doc_timestamp.js b/packages/google-cloud-securitycenter/src/v1/doc/google/protobuf/doc_timestamp.js deleted file mode 100644 index ad801cc9a10..00000000000 --- a/packages/google-cloud-securitycenter/src/v1/doc/google/protobuf/doc_timestamp.js +++ /dev/null @@ -1,117 +0,0 @@ -// 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. - -// Note: this file is purely for documentation. Any contents are not expected -// to be loaded as the JS file. - -/** - * A Timestamp represents a point in time independent of any time zone or local - * calendar, encoded as a count of seconds and fractions of seconds at - * nanosecond resolution. The count is relative to an epoch at UTC midnight on - * January 1, 1970, in the proleptic Gregorian calendar which extends the - * Gregorian calendar backwards to year one. - * - * All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - * second table is needed for interpretation, using a [24-hour linear - * smear](https://developers.google.com/time/smear). - * - * The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - * restricting to that range, we ensure that we can convert to and from [RFC - * 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - * - * # Examples - * - * Example 1: Compute Timestamp from POSIX `time()`. - * - * Timestamp timestamp; - * timestamp.set_seconds(time(NULL)); - * timestamp.set_nanos(0); - * - * Example 2: Compute Timestamp from POSIX `gettimeofday()`. - * - * struct timeval tv; - * gettimeofday(&tv, NULL); - * - * Timestamp timestamp; - * timestamp.set_seconds(tv.tv_sec); - * timestamp.set_nanos(tv.tv_usec * 1000); - * - * Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - * - * FILETIME ft; - * GetSystemTimeAsFileTime(&ft); - * UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - * - * // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - * // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - * Timestamp timestamp; - * timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - * timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - * - * Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - * - * long millis = System.currentTimeMillis(); - * - * Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - * .setNanos((int) ((millis % 1000) * 1000000)).build(); - * - * - * Example 5: Compute Timestamp from current time in Python. - * - * timestamp = Timestamp() - * timestamp.GetCurrentTime() - * - * # JSON Mapping - * - * In JSON format, the Timestamp type is encoded as a string in the - * [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the - * format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" - * where {year} is always expressed using four digits while {month}, {day}, - * {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional - * seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), - * are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone - * is required. A proto3 JSON serializer should always use UTC (as indicated by - * "Z") when printing the Timestamp type and a proto3 JSON parser should be - * able to accept both UTC and other timezones (as indicated by an offset). - * - * For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past - * 01:30 UTC on January 15, 2017. - * - * In JavaScript, one can convert a Date object to this format using the - * standard - * [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - * method. In Python, a standard `datetime.datetime` object can be converted - * to this format using - * [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with - * the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use - * the Joda Time's [`ISODateTimeFormat.dateTime()`](https://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime%2D%2D) to obtain a formatter capable of generating timestamps in this format. - * - * @property {number} seconds - * Represents seconds of UTC time since Unix epoch - * 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to - * 9999-12-31T23:59:59Z inclusive. - * - * @property {number} nanos - * Non-negative fractions of a second at nanosecond resolution. Negative - * second values with fractions must still have non-negative nanos values - * that count forward in time. Must be from 0 to 999,999,999 - * inclusive. - * - * @typedef Timestamp - * @memberof google.protobuf - * @see [google.protobuf.Timestamp definition in proto format]{@link https://github.com/google/protobuf/blob/master/src/google/protobuf/timestamp.proto} - */ -const Timestamp = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; \ No newline at end of file diff --git a/packages/google-cloud-securitycenter/src/v1/doc/google/rpc/doc_status.js b/packages/google-cloud-securitycenter/src/v1/doc/google/rpc/doc_status.js deleted file mode 100644 index 750e0af7689..00000000000 --- a/packages/google-cloud-securitycenter/src/v1/doc/google/rpc/doc_status.js +++ /dev/null @@ -1,47 +0,0 @@ -// 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. - -// Note: this file is purely for documentation. Any contents are not expected -// to be loaded as the JS file. - -/** - * The `Status` type defines a logical error model that is suitable for - * different programming environments, including REST APIs and RPC APIs. It is - * used by [gRPC](https://github.com/grpc). Each `Status` message contains - * three pieces of data: error code, error message, and error details. - * - * You can find out more about this error model and how to work with it in the - * [API Design Guide](https://cloud.google.com/apis/design/errors). - * - * @property {number} code - * The status code, which should be an enum value of google.rpc.Code. - * - * @property {string} message - * A developer-facing error message, which should be in English. Any - * user-facing error message should be localized and sent in the - * google.rpc.Status.details field, or localized by the client. - * - * @property {Object[]} details - * A list of messages that carry the error details. There is a common set of - * message types for APIs to use. - * - * This object should have the same structure as [Any]{@link google.protobuf.Any} - * - * @typedef Status - * @memberof google.rpc - * @see [google.rpc.Status definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/rpc/status.proto} - */ -const Status = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; \ No newline at end of file diff --git a/packages/google-cloud-securitycenter/src/v1/doc/google/type/doc_expr.js b/packages/google-cloud-securitycenter/src/v1/doc/google/type/doc_expr.js deleted file mode 100644 index c185edde52f..00000000000 --- a/packages/google-cloud-securitycenter/src/v1/doc/google/type/doc_expr.js +++ /dev/null @@ -1,51 +0,0 @@ -// 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. - -// Note: this file is purely for documentation. Any contents are not expected -// to be loaded as the JS file. - -/** - * Represents an expression text. Example: - * - * title: "User account presence" - * description: "Determines whether the request has a user account" - * expression: "size(request.user) > 0" - * - * @property {string} expression - * Textual representation of an expression in - * Common Expression Language syntax. - * - * The application context of the containing message determines which - * well-known feature set of CEL is supported. - * - * @property {string} title - * An optional title for the expression, i.e. a short string describing - * its purpose. This can be used e.g. in UIs which allow to enter the - * expression. - * - * @property {string} description - * An optional description of the expression. This is a longer text which - * describes the expression, e.g. when hovered over it in a UI. - * - * @property {string} location - * An optional string indicating the location of the expression for error - * reporting, e.g. a file name and a position in the file. - * - * @typedef Expr - * @memberof google.type - * @see [google.type.Expr definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/type/expr.proto} - */ -const Expr = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; \ No newline at end of file diff --git a/packages/google-cloud-securitycenter/system-test/system.js b/packages/google-cloud-securitycenter/src/v1/index.ts similarity index 69% rename from packages/google-cloud-securitycenter/system-test/system.js rename to packages/google-cloud-securitycenter/src/v1/index.ts index 6a460f19c33..a44e8075d6f 100644 --- a/packages/google-cloud-securitycenter/system-test/system.js +++ b/packages/google-cloud-securitycenter/src/v1/index.ts @@ -11,13 +11,9 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file 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 {describe, it} = require('mocha'); - -describe('system tests', () => { - it('should have tests', done => { - done(); - }); -}); +export {SecurityCenterClient} from './security_center_client'; diff --git a/packages/google-cloud-securitycenter/src/v1/security_center_client.js b/packages/google-cloud-securitycenter/src/v1/security_center_client.ts similarity index 55% rename from packages/google-cloud-securitycenter/src/v1/security_center_client.js rename to packages/google-cloud-securitycenter/src/v1/security_center_client.ts index cf3b2d2f5bf..120c54cd8ae 100644 --- a/packages/google-cloud-securitycenter/src/v1/security_center_client.js +++ b/packages/google-cloud-securitycenter/src/v1/security_center_client.ts @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// Copyright 2019 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -11,22 +11,44 @@ // WITHOUT 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'; - -const gapicConfig = require('./security_center_client_config.json'); -const gax = require('google-gax'); -const path = require('path'); - -const VERSION = require('../../package.json').version; +// +// ** 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 gax from 'google-gax'; +import { + APICallback, + Callback, + CallOptions, + Descriptors, + ClientOptions, + LROperation, + PaginationCallback, + PaginationResponse, +} from 'google-gax'; +import * as path from 'path'; + +import {Transform} from 'stream'; +import * as protosTypes from '../../protos/protos'; +import * as gapicConfig from './security_center_client_config.json'; + +const version = require('../../../package.json').version; /** - * V1 APIs for Security Center service. - * + * V1 APIs for Security Center service. * @class * @memberof v1 */ -class SecurityCenterClient { +export class SecurityCenterClient { + private _descriptors: Descriptors = {page: {}, stream: {}, longrunning: {}}; + private _innerApiCalls: {[name: string]: Function}; + private _pathTemplates: {[name: string]: gax.PathTemplate}; + private _terminated = false; + auth: gax.GoogleAuth; + operationsClient: gax.OperationsClient; + securityCenterStub: Promise<{[name: string]: Function}>; + /** * Construct an instance of SecurityCenterClient. * @@ -54,58 +76,55 @@ class SecurityCenterClient { * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. */ - constructor(opts) { - opts = opts || {}; - this._descriptors = {}; - if (global.isBrowser) { - // If we're in browser, we use gRPC fallback. - opts.fallback = true; + constructor(opts?: ClientOptions) { + // Ensure that options include the service address and port. + const staticMembers = this.constructor as typeof SecurityCenterClient; + const servicePath = + opts && opts.servicePath + ? opts.servicePath + : opts && opts.apiEndpoint + ? opts.apiEndpoint + : staticMembers.servicePath; + const port = opts && opts.port ? opts.port : staticMembers.port; + + if (!opts) { + opts = {servicePath, port}; } + opts.servicePath = opts.servicePath || servicePath; + opts.port = opts.port || port; + opts.clientConfig = opts.clientConfig || {}; + const isBrowser = typeof window !== 'undefined'; + if (isBrowser) { + opts.fallback = true; + } // If we are in browser, we are already using fallback because of the // "browser" field in package.json. // But if we were explicitly requested to use fallback, let's do it now. - const gaxModule = !global.isBrowser && opts.fallback ? gax.fallback : gax; - - const servicePath = - opts.servicePath || opts.apiEndpoint || this.constructor.servicePath; - - // Ensure that options include the service address and port. - opts = Object.assign( - { - clientConfig: {}, - port: this.constructor.port, - servicePath, - }, - opts - ); + const gaxModule = !isBrowser && opts.fallback ? gax.fallback : gax; // Create a `gaxGrpc` object, with any grpc-specific options // sent to the client. - opts.scopes = this.constructor.scopes; + opts.scopes = (this.constructor as typeof SecurityCenterClient).scopes; const gaxGrpc = new gaxModule.GrpcClient(opts); // Save the auth object to the client, for use by other methods. - this.auth = gaxGrpc.auth; + this.auth = gaxGrpc.auth as gax.GoogleAuth; // Determine the client header string. - const clientHeader = []; - + const clientHeader = [`gax/${gaxModule.version}`, `gapic/${version}`]; if (typeof process !== 'undefined' && 'versions' in process) { clientHeader.push(`gl-node/${process.versions.node}`); - } - clientHeader.push(`gax/${gaxModule.version}`); - if (opts.fallback) { - clientHeader.push(`gl-web/${gaxModule.version}`); } else { + clientHeader.push(`gl-web/${gaxModule.version}`); + } + if (!opts.fallback) { clientHeader.push(`grpc/${gaxGrpc.grpcVersion}`); } - clientHeader.push(`gapic/${VERSION}`); if (opts.libName && opts.libVersion) { clientHeader.push(`${opts.libName}/${opts.libVersion}`); } - // Load the applicable protos. // For Node.js, pass the path to JSON proto file. // For browsers, pass the JSON content. @@ -125,29 +144,26 @@ class SecurityCenterClient { // identifiers to uniquely identify resources within the API. // Create useful helper objects for these. this._pathTemplates = { - assetPathTemplate: new gaxModule.PathTemplate( - 'organizations/{organization}/assets/{asset}' - ), - assetSecurityMarksPathTemplate: new gaxModule.PathTemplate( + organizationAssetPathTemplate: new gaxModule.PathTemplate( 'organizations/{organization}/assets/{asset}/securityMarks' ), + organizationSourceFindingPathTemplate: new gaxModule.PathTemplate( + 'organizations/{organization}/sources/{source}/findings/{finding}/securityMarks' + ), findingPathTemplate: new gaxModule.PathTemplate( 'organizations/{organization}/sources/{source}/findings/{finding}' ), - findingSecurityMarksPathTemplate: new gaxModule.PathTemplate( - 'organizations/{organization}/sources/{source}/findings/{finding}/securityMarks' + sourcePathTemplate: new gaxModule.PathTemplate( + 'organizations/{organization}/sources/{source}' ), - organizationPathTemplate: new gaxModule.PathTemplate( - 'organizations/{organization}' + assetPathTemplate: new gaxModule.PathTemplate( + 'organizations/{organization}/assets/{asset}' ), organizationSettingsPathTemplate: new gaxModule.PathTemplate( 'organizations/{organization}/organizationSettings' ), - organizationSourcesPathTemplate: new gaxModule.PathTemplate( - 'organizations/{organization}/sources/-' - ), - sourcePathTemplate: new gaxModule.PathTemplate( - 'organizations/{organization}/sources/{source}' + organizationPathTemplate: new gaxModule.PathTemplate( + 'organizations/{organization}' ), }; @@ -182,24 +198,25 @@ class SecurityCenterClient { ), }; - const protoFilesRoot = opts.fallback - ? gaxModule.protobuf.Root.fromJSON(require('../../protos/protos.json')) - : gaxModule.protobuf.loadSync(nodejsProtoPath); - // This API contains "long-running operations", which return a // an Operation object that allows for tracking of the operation, // rather than holding a request open. - this.operationsClient = new gaxModule.lro({ - auth: gaxGrpc.auth, - grpc: gaxGrpc.grpc, - }).operationsClient(opts); + const protoFilesRoot = opts.fallback + ? gaxModule.protobuf.Root.fromJSON(require('../../protos/protos.json')) + : gaxModule.protobuf.loadSync(nodejsProtoPath); + this.operationsClient = gaxModule + .lro({ + auth: this.auth, + grpc: 'grpc' in gaxGrpc ? gaxGrpc.grpc : undefined, + }) + .operationsClient(opts); const runAssetDiscoveryResponse = protoFilesRoot.lookup( - 'google.cloud.securitycenter.v1.RunAssetDiscoveryResponse' - ); + '.google.cloud.securitycenter.v1.RunAssetDiscoveryResponse' + ) as gax.protobuf.Type; const runAssetDiscoveryMetadata = protoFilesRoot.lookup( - 'google.protobuf.Empty' - ); + '.google.protobuf.Empty' + ) as gax.protobuf.Type; this._descriptors.longrunning = { runAssetDiscovery: new gaxModule.LongrunningDescriptor( @@ -212,8 +229,8 @@ class SecurityCenterClient { // Put together the default options sent with requests. const defaults = gaxGrpc.constructSettings( 'google.cloud.securitycenter.v1.SecurityCenter', - gapicConfig, - opts.clientConfig, + gapicConfig as gax.ClientConfig, + opts.clientConfig || {}, {'x-goog-api-client': clientHeader.join(' ')} ); @@ -224,12 +241,15 @@ class SecurityCenterClient { // Put together the "service stub" for // google.cloud.securitycenter.v1.SecurityCenter. - const securityCenterStub = gaxGrpc.createStub( + this.securityCenterStub = gaxGrpc.createStub( opts.fallback - ? protos.lookupService('google.cloud.securitycenter.v1.SecurityCenter') - : protos.google.cloud.securitycenter.v1.SecurityCenter, + ? (protos as protobuf.Root).lookupService( + 'google.cloud.securitycenter.v1.SecurityCenter' + ) + : // tslint:disable-next-line no-any + (protos as any).google.cloud.securitycenter.v1.SecurityCenter, opts - ); + ) as Promise<{[method: string]: Function}>; // Iterate over each of the methods that the service provides // and create an API call method for each. @@ -253,21 +273,35 @@ class SecurityCenterClient { 'updateSource', 'updateSecurityMarks', ]; + for (const methodName of securityCenterStubMethods) { - const innerCallPromise = securityCenterStub.then( - stub => (...args) => { + const innerCallPromise = this.securityCenterStub.then( + stub => (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } return stub[methodName].apply(stub, args); }, - err => () => { + (err: Error | null | undefined) => () => { throw err; } ); - this._innerApiCalls[methodName] = gaxModule.createApiCall( + + const apiCall = gaxModule.createApiCall( innerCallPromise, defaults[methodName], this._descriptors.page[methodName] || + this._descriptors.stream[methodName] || this._descriptors.longrunning[methodName] ); + + this._innerApiCalls[methodName] = ( + argument: {}, + callOptions?: CallOptions, + callback?: APICallback + ) => { + return apiCall(argument, callOptions, callback); + }; } } @@ -301,19 +335,49 @@ class SecurityCenterClient { return ['https://www.googleapis.com/auth/cloud-platform']; } + getProjectId(): Promise; + getProjectId(callback: Callback): void; /** * Return the project ID used by this class. * @param {function(Error, string)} callback - the callback to * be called with the current project Id. */ - getProjectId(callback) { - return this.auth.getProjectId(callback); + getProjectId( + callback?: Callback + ): Promise | void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); } // ------------------- // -- Service calls -- // ------------------- - + createSource( + request: protosTypes.google.cloud.securitycenter.v1.ICreateSourceRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.cloud.securitycenter.v1.ISource, + ( + | protosTypes.google.cloud.securitycenter.v1.ICreateSourceRequest + | undefined + ), + {} | undefined + ] + >; + createSource( + request: protosTypes.google.cloud.securitycenter.v1.ICreateSourceRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.cloud.securitycenter.v1.ISource, + | protosTypes.google.cloud.securitycenter.v1.ICreateSourceRequest + | undefined, + {} | undefined + > + ): void; /** * Creates a source. * @@ -322,63 +386,82 @@ class SecurityCenterClient { * @param {string} request.parent * Required. Resource name of the new source's parent. Its format should be * "organizations/[organization_id]". - * @param {Object} request.source + * @param {google.cloud.securitycenter.v1.Source} request.source * Required. The Source being created, only the display_name and description will be * used. All other fields will be ignored. - * - * This object should have the same structure as [Source]{@link google.cloud.securitycenter.v1.Source} - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [Source]{@link google.cloud.securitycenter.v1.Source}. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. * The first element of the array is an object representing [Source]{@link google.cloud.securitycenter.v1.Source}. * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const securityCenter = require('@google-cloud/security-center'); - * - * const client = new securityCenter.v1.SecurityCenterClient({ - * // optional auth parameters. - * }); - * - * const formattedParent = client.organizationPath('[ORGANIZATION]'); - * const source = {}; - * const request = { - * parent: formattedParent, - * source: source, - * }; - * client.createSource(request) - * .then(responses => { - * const response = responses[0]; - * // doThingsWith(response) - * }) - * .catch(err => { - * console.error(err); - * }); */ - createSource(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; + createSource( + request: protosTypes.google.cloud.securitycenter.v1.ICreateSourceRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.cloud.securitycenter.v1.ISource, + | protosTypes.google.cloud.securitycenter.v1.ICreateSourceRequest + | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.cloud.securitycenter.v1.ISource, + | protosTypes.google.cloud.securitycenter.v1.ICreateSourceRequest + | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.cloud.securitycenter.v1.ISource, + ( + | protosTypes.google.cloud.securitycenter.v1.ICreateSourceRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; } - request = request || {}; options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers[ 'x-goog-request-params' ] = gax.routingHeader.fromParams({ - parent: request.parent, + parent: request.parent || '', }); - return this._innerApiCalls.createSource(request, options, callback); } - + createFinding( + request: protosTypes.google.cloud.securitycenter.v1.ICreateFindingRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.cloud.securitycenter.v1.IFinding, + ( + | protosTypes.google.cloud.securitycenter.v1.ICreateFindingRequest + | undefined + ), + {} | undefined + ] + >; + createFinding( + request: protosTypes.google.cloud.securitycenter.v1.ICreateFindingRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.cloud.securitycenter.v1.IFinding, + | protosTypes.google.cloud.securitycenter.v1.ICreateFindingRequest + | undefined, + {} | undefined + > + ): void; /** * Creates a finding. The corresponding source must exist for finding creation * to succeed. @@ -392,125 +475,151 @@ class SecurityCenterClient { * Required. Unique identifier provided by the client within the parent scope. * It must be alphanumeric and less than or equal to 32 characters and * greater than 0 characters in length. - * @param {Object} request.finding + * @param {google.cloud.securitycenter.v1.Finding} request.finding * Required. The Finding being created. The name and security_marks will be ignored as * they are both output only fields on this resource. - * - * This object should have the same structure as [Finding]{@link google.cloud.securitycenter.v1.Finding} - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [Finding]{@link google.cloud.securitycenter.v1.Finding}. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. * The first element of the array is an object representing [Finding]{@link google.cloud.securitycenter.v1.Finding}. * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const securityCenter = require('@google-cloud/security-center'); - * - * const client = new securityCenter.v1.SecurityCenterClient({ - * // optional auth parameters. - * }); - * - * const formattedParent = client.sourcePath('[ORGANIZATION]', '[SOURCE]'); - * const findingId = ''; - * const finding = {}; - * const request = { - * parent: formattedParent, - * findingId: findingId, - * finding: finding, - * }; - * client.createFinding(request) - * .then(responses => { - * const response = responses[0]; - * // doThingsWith(response) - * }) - * .catch(err => { - * console.error(err); - * }); */ - createFinding(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; + createFinding( + request: protosTypes.google.cloud.securitycenter.v1.ICreateFindingRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.cloud.securitycenter.v1.IFinding, + | protosTypes.google.cloud.securitycenter.v1.ICreateFindingRequest + | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.cloud.securitycenter.v1.IFinding, + | protosTypes.google.cloud.securitycenter.v1.ICreateFindingRequest + | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.cloud.securitycenter.v1.IFinding, + ( + | protosTypes.google.cloud.securitycenter.v1.ICreateFindingRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; } - request = request || {}; options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers[ 'x-goog-request-params' ] = gax.routingHeader.fromParams({ - parent: request.parent, + parent: request.parent || '', }); - return this._innerApiCalls.createFinding(request, options, callback); } - + getIamPolicy( + request: protosTypes.google.iam.v1.IGetIamPolicyRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.iam.v1.IPolicy, + protosTypes.google.iam.v1.IGetIamPolicyRequest | undefined, + {} | undefined + ] + >; + getIamPolicy( + request: protosTypes.google.iam.v1.IGetIamPolicyRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.iam.v1.IPolicy, + protosTypes.google.iam.v1.IGetIamPolicyRequest | undefined, + {} | undefined + > + ): void; /** * Gets the access control policy on the specified Source. * * @param {Object} request * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy is being requested. - * See the operation documentation for the appropriate value for this field. - * @param {Object} [request.options] - * OPTIONAL: A `GetPolicyOptions` object for specifying options to - * `GetIamPolicy`. This field is only used by Cloud IAM. - * - * This object should have the same structure as [GetPolicyOptions]{@link google.iam.v1.GetPolicyOptions} - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [Policy]{@link google.iam.v1.Policy}. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. * The first element of the array is an object representing [Policy]{@link google.iam.v1.Policy}. * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const securityCenter = require('@google-cloud/security-center'); - * - * const client = new securityCenter.v1.SecurityCenterClient({ - * // optional auth parameters. - * }); - * - * const formattedResource = client.sourcePath('[ORGANIZATION]', '[SOURCE]'); - * client.getIamPolicy({resource: formattedResource}) - * .then(responses => { - * const response = responses[0]; - * // doThingsWith(response) - * }) - * .catch(err => { - * console.error(err); - * }); */ - getIamPolicy(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; + getIamPolicy( + request: protosTypes.google.iam.v1.IGetIamPolicyRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.iam.v1.IPolicy, + protosTypes.google.iam.v1.IGetIamPolicyRequest | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.iam.v1.IPolicy, + protosTypes.google.iam.v1.IGetIamPolicyRequest | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.iam.v1.IPolicy, + protosTypes.google.iam.v1.IGetIamPolicyRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; } - request = request || {}; options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers[ 'x-goog-request-params' ] = gax.routingHeader.fromParams({ - resource: request.resource, + resource: request.resource || '', }); - return this._innerApiCalls.getIamPolicy(request, options, callback); } - + getOrganizationSettings( + request: protosTypes.google.cloud.securitycenter.v1.IGetOrganizationSettingsRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.cloud.securitycenter.v1.IOrganizationSettings, + ( + | protosTypes.google.cloud.securitycenter.v1.IGetOrganizationSettingsRequest + | undefined + ), + {} | undefined + ] + >; + getOrganizationSettings( + request: protosTypes.google.cloud.securitycenter.v1.IGetOrganizationSettingsRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.cloud.securitycenter.v1.IOrganizationSettings, + | protosTypes.google.cloud.securitycenter.v1.IGetOrganizationSettingsRequest + | undefined, + {} | undefined + > + ): void; /** * Gets the settings for an organization. * @@ -519,57 +628,79 @@ class SecurityCenterClient { * @param {string} request.name * Required. Name of the organization to get organization settings for. Its format is * "organizations/[organization_id]/organizationSettings". - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [OrganizationSettings]{@link google.cloud.securitycenter.v1.OrganizationSettings}. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. * The first element of the array is an object representing [OrganizationSettings]{@link google.cloud.securitycenter.v1.OrganizationSettings}. * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const securityCenter = require('@google-cloud/security-center'); - * - * const client = new securityCenter.v1.SecurityCenterClient({ - * // optional auth parameters. - * }); - * - * const formattedName = client.organizationSettingsPath('[ORGANIZATION]'); - * client.getOrganizationSettings({name: formattedName}) - * .then(responses => { - * const response = responses[0]; - * // doThingsWith(response) - * }) - * .catch(err => { - * console.error(err); - * }); */ - getOrganizationSettings(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; + getOrganizationSettings( + request: protosTypes.google.cloud.securitycenter.v1.IGetOrganizationSettingsRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.cloud.securitycenter.v1.IOrganizationSettings, + | protosTypes.google.cloud.securitycenter.v1.IGetOrganizationSettingsRequest + | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.cloud.securitycenter.v1.IOrganizationSettings, + | protosTypes.google.cloud.securitycenter.v1.IGetOrganizationSettingsRequest + | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.cloud.securitycenter.v1.IOrganizationSettings, + ( + | protosTypes.google.cloud.securitycenter.v1.IGetOrganizationSettingsRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; } - request = request || {}; options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers[ 'x-goog-request-params' ] = gax.routingHeader.fromParams({ - name: request.name, + name: request.name || '', }); - return this._innerApiCalls.getOrganizationSettings( request, options, callback ); } - + getSource( + request: protosTypes.google.cloud.securitycenter.v1.IGetSourceRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.cloud.securitycenter.v1.ISource, + protosTypes.google.cloud.securitycenter.v1.IGetSourceRequest | undefined, + {} | undefined + ] + >; + getSource( + request: protosTypes.google.cloud.securitycenter.v1.IGetSourceRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.cloud.securitycenter.v1.ISource, + protosTypes.google.cloud.securitycenter.v1.IGetSourceRequest | undefined, + {} | undefined + > + ): void; /** * Gets a source. * @@ -578,318 +709,947 @@ class SecurityCenterClient { * @param {string} request.name * Required. Relative resource name of the source. Its format is * "organizations/[organization_id]/source/[source_id]". - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [Source]{@link google.cloud.securitycenter.v1.Source}. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. * The first element of the array is an object representing [Source]{@link google.cloud.securitycenter.v1.Source}. * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const securityCenter = require('@google-cloud/security-center'); - * - * const client = new securityCenter.v1.SecurityCenterClient({ - * // optional auth parameters. - * }); - * - * const formattedName = client.sourcePath('[ORGANIZATION]', '[SOURCE]'); - * client.getSource({name: formattedName}) - * .then(responses => { - * const response = responses[0]; - * // doThingsWith(response) - * }) - * .catch(err => { - * console.error(err); - * }); */ - getSource(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; + getSource( + request: protosTypes.google.cloud.securitycenter.v1.IGetSourceRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.cloud.securitycenter.v1.ISource, + | protosTypes.google.cloud.securitycenter.v1.IGetSourceRequest + | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.cloud.securitycenter.v1.ISource, + protosTypes.google.cloud.securitycenter.v1.IGetSourceRequest | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.cloud.securitycenter.v1.ISource, + protosTypes.google.cloud.securitycenter.v1.IGetSourceRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; } - request = request || {}; options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers[ 'x-goog-request-params' ] = gax.routingHeader.fromParams({ - name: request.name, + name: request.name || '', }); - return this._innerApiCalls.getSource(request, options, callback); } - + setFindingState( + request: protosTypes.google.cloud.securitycenter.v1.ISetFindingStateRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.cloud.securitycenter.v1.IFinding, + ( + | protosTypes.google.cloud.securitycenter.v1.ISetFindingStateRequest + | undefined + ), + {} | undefined + ] + >; + setFindingState( + request: protosTypes.google.cloud.securitycenter.v1.ISetFindingStateRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.cloud.securitycenter.v1.IFinding, + | protosTypes.google.cloud.securitycenter.v1.ISetFindingStateRequest + | undefined, + {} | undefined + > + ): void; /** - * Filters an organization's assets and groups them by their specified - * properties. + * Updates the state of a finding. * * @param {Object} request * The request object that will be sent. - * @param {string} request.parent - * Required. Name of the organization to groupBy. Its format is - * "organizations/[organization_id]". - * @param {string} request.groupBy - * Required. Expression that defines what assets fields to use for grouping. The string - * value should follow SQL syntax: comma separated list of fields. For - * example: - * "security_center_properties.resource_project,security_center_properties.project". - * - * The following fields are supported when compare_duration is not set: - * - * * security_center_properties.resource_project - * * security_center_properties.resource_project_display_name - * * security_center_properties.resource_type - * * security_center_properties.resource_parent - * * security_center_properties.resource_parent_display_name - * - * The following fields are supported when compare_duration is set: - * - * * security_center_properties.resource_type - * * security_center_properties.resource_project_display_name - * * security_center_properties.resource_parent_display_name - * @param {string} [request.filter] - * Expression that defines the filter to apply across assets. - * The expression is a list of zero or more restrictions combined via logical - * operators `AND` and `OR`. - * Parentheses are supported, and `OR` has higher precedence than `AND`. - * - * Restrictions have the form ` ` and may have a `-` - * character in front of them to indicate negation. The fields map to those - * defined in the Asset resource. Examples include: - * - * * name - * * security_center_properties.resource_name - * * resource_properties.a_property - * * security_marks.marks.marka - * - * The supported operators are: - * - * * `=` for all value types. - * * `>`, `<`, `>=`, `<=` for integer values. - * * `:`, meaning substring matching, for strings. - * - * The supported value types are: - * - * * string literals in quotes. - * * integer literals without quotes. - * * boolean literals `true` and `false` without quotes. - * - * The following field and operator combinations are supported: - * - * * name: `=` - * * update_time: `=`, `>`, `<`, `>=`, `<=` - * - * Usage: This should be milliseconds since epoch or an RFC3339 string. - * Examples: - * "update_time = \"2019-06-10T16:07:18-07:00\"" - * "update_time = 1560208038000" - * - * * create_time: `=`, `>`, `<`, `>=`, `<=` - * - * Usage: This should be milliseconds since epoch or an RFC3339 string. - * Examples: - * "create_time = \"2019-06-10T16:07:18-07:00\"" - * "create_time = 1560208038000" - * - * * iam_policy.policy_blob: `=`, `:` - * * resource_properties: `=`, `:`, `>`, `<`, `>=`, `<=` - * * security_marks.marks: `=`, `:` - * * security_center_properties.resource_name: `=`, `:` - * * security_center_properties.resource_display_name: `=`, `:` - * * security_center_properties.resource_type: `=`, `:` - * * security_center_properties.resource_parent: `=`, `:` - * * security_center_properties.resource_parent_display_name: `=`, `:` - * * security_center_properties.resource_project: `=`, `:` - * * security_center_properties.resource_project_display_name: `=`, `:` - * * security_center_properties.resource_owners: `=`, `:` - * - * For example, `resource_properties.size = 100` is a valid filter string. - * @param {Object} [request.compareDuration] - * When compare_duration is set, the GroupResult's "state_change" property is - * updated to indicate whether the asset was added, removed, or remained - * present during the compare_duration period of time that precedes the - * read_time. This is the time between (read_time - compare_duration) and - * read_time. - * - * The state change value is derived based on the presence of the asset at the - * two points in time. Intermediate state changes between the two times don't - * affect the result. For example, the results aren't affected if the asset is - * removed and re-created again. - * - * Possible "state_change" values when compare_duration is specified: - * - * * "ADDED": indicates that the asset was not present at the start of - * compare_duration, but present at reference_time. - * * "REMOVED": indicates that the asset was present at the start of - * compare_duration, but not present at reference_time. - * * "ACTIVE": indicates that the asset was present at both the - * start and the end of the time period defined by - * compare_duration and reference_time. - * - * If compare_duration is not specified, then the only possible state_change - * is "UNUSED", which will be the state_change set for all assets present at - * read_time. - * - * If this field is set then `state_change` must be a specified field in - * `group_by`. - * - * This object should have the same structure as [Duration]{@link google.protobuf.Duration} - * @param {Object} [request.readTime] - * Time used as a reference point when filtering assets. The filter is limited - * to assets existing at the supplied time and their values are those at that - * specific time. Absence of this field will default to the API's version of - * NOW. - * - * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} - * @param {number} [request.pageSize] - * The maximum number of resources contained in the underlying API - * response. If page streaming is performed per-resource, this - * parameter does not affect the return value. If page streaming is - * performed per-page, this determines the maximum number of - * resources in a page. - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Array, ?Object, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is Array of [GroupResult]{@link google.cloud.securitycenter.v1.GroupResult}. - * - * When autoPaginate: false is specified through options, it contains the result - * in a single response. If the response indicates the next page exists, the third - * parameter is set to be used for the next request object. The fourth parameter keeps - * the raw response object of an object representing [GroupAssetsResponse]{@link google.cloud.securitycenter.v1.GroupAssetsResponse}. + * @param {string} request.name + * Required. The relative resource name of the finding. See: + * https://cloud.google.com/apis/design/resource_names#relative_resource_name + * Example: + * "organizations/{organization_id}/sources/{source_id}/finding/{finding_id}". + * @param {google.cloud.securitycenter.v1.Finding.State} request.state + * Required. The desired State of the finding. + * @param {google.protobuf.Timestamp} request.startTime + * Required. The time at which the updated state takes effect. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of [GroupResult]{@link google.cloud.securitycenter.v1.GroupResult}. - * - * When autoPaginate: false is specified through options, the array has three elements. - * The first element is Array of [GroupResult]{@link google.cloud.securitycenter.v1.GroupResult} in a single response. - * The second element is the next request object if the response - * indicates the next page exists, or null. The third element is - * an object representing [GroupAssetsResponse]{@link google.cloud.securitycenter.v1.GroupAssetsResponse}. - * + * The first element of the array is an object representing [Finding]{@link google.cloud.securitycenter.v1.Finding}. * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const securityCenter = require('@google-cloud/security-center'); - * - * const client = new securityCenter.v1.SecurityCenterClient({ - * // optional auth parameters. - * }); - * - * // Iterate over all elements. - * const formattedParent = client.organizationPath('[ORGANIZATION]'); - * const groupBy = ''; - * const request = { - * parent: formattedParent, - * groupBy: groupBy, - * }; - * - * client.groupAssets(request) - * .then(responses => { - * const resources = responses[0]; - * for (const resource of resources) { - * // doThingsWith(resource) - * } - * }) - * .catch(err => { - * console.error(err); - * }); - * - * // Or obtain the paged response. - * const formattedParent = client.organizationPath('[ORGANIZATION]'); - * const groupBy = ''; - * const request = { - * parent: formattedParent, - * groupBy: groupBy, - * }; - * - * - * const options = {autoPaginate: false}; - * const callback = responses => { - * // The actual resources in a response. - * const resources = responses[0]; - * // The next request if the response shows that there are more responses. - * const nextRequest = responses[1]; - * // The actual response object, if necessary. - * // const rawResponse = responses[2]; - * for (const resource of resources) { - * // doThingsWith(resource); - * } - * if (nextRequest) { - * // Fetch the next page. - * return client.groupAssets(nextRequest, options).then(callback); - * } - * } - * client.groupAssets(request, options) - * .then(callback) - * .catch(err => { - * console.error(err); - * }); */ - groupAssets(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; + setFindingState( + request: protosTypes.google.cloud.securitycenter.v1.ISetFindingStateRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.cloud.securitycenter.v1.IFinding, + | protosTypes.google.cloud.securitycenter.v1.ISetFindingStateRequest + | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.cloud.securitycenter.v1.IFinding, + | protosTypes.google.cloud.securitycenter.v1.ISetFindingStateRequest + | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.cloud.securitycenter.v1.IFinding, + ( + | protosTypes.google.cloud.securitycenter.v1.ISetFindingStateRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; } - request = request || {}; options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers[ 'x-goog-request-params' ] = gax.routingHeader.fromParams({ - parent: request.parent, + name: request.name || '', }); - - return this._innerApiCalls.groupAssets(request, options, callback); + return this._innerApiCalls.setFindingState(request, options, callback); } - + setIamPolicy( + request: protosTypes.google.iam.v1.ISetIamPolicyRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.iam.v1.IPolicy, + protosTypes.google.iam.v1.ISetIamPolicyRequest | undefined, + {} | undefined + ] + >; + setIamPolicy( + request: protosTypes.google.iam.v1.ISetIamPolicyRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.iam.v1.IPolicy, + protosTypes.google.iam.v1.ISetIamPolicyRequest | undefined, + {} | undefined + > + ): void; /** - * Equivalent to {@link groupAssets}, but returns a NodeJS Stream object. - * - * This fetches the paged responses for {@link groupAssets} continuously - * and invokes the callback registered for 'data' event for each element in the - * responses. - * - * The returned object has 'end' method when no more elements are required. - * - * autoPaginate option will be ignored. - * - * @see {@link https://nodejs.org/api/stream.html} + * Sets the access control policy on the specified Source. * * @param {Object} request * The request object that will be sent. - * @param {string} request.parent - * Required. Name of the organization to groupBy. Its format is - * "organizations/[organization_id]". + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Policy]{@link google.iam.v1.Policy}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + setIamPolicy( + request: protosTypes.google.iam.v1.ISetIamPolicyRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.iam.v1.IPolicy, + protosTypes.google.iam.v1.ISetIamPolicyRequest | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.iam.v1.IPolicy, + protosTypes.google.iam.v1.ISetIamPolicyRequest | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.iam.v1.IPolicy, + protosTypes.google.iam.v1.ISetIamPolicyRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + resource: request.resource || '', + }); + return this._innerApiCalls.setIamPolicy(request, options, callback); + } + testIamPermissions( + request: protosTypes.google.iam.v1.ITestIamPermissionsRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.iam.v1.ITestIamPermissionsResponse, + protosTypes.google.iam.v1.ITestIamPermissionsRequest | undefined, + {} | undefined + ] + >; + testIamPermissions( + request: protosTypes.google.iam.v1.ITestIamPermissionsRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.iam.v1.ITestIamPermissionsResponse, + protosTypes.google.iam.v1.ITestIamPermissionsRequest | undefined, + {} | undefined + > + ): void; + /** + * Returns the permissions that a caller has on the specified source. + * + * @param {Object} request + * The request object that will be sent. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + testIamPermissions( + request: protosTypes.google.iam.v1.ITestIamPermissionsRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.iam.v1.ITestIamPermissionsResponse, + protosTypes.google.iam.v1.ITestIamPermissionsRequest | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.iam.v1.ITestIamPermissionsResponse, + protosTypes.google.iam.v1.ITestIamPermissionsRequest | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.iam.v1.ITestIamPermissionsResponse, + protosTypes.google.iam.v1.ITestIamPermissionsRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + resource: request.resource || '', + }); + return this._innerApiCalls.testIamPermissions(request, options, callback); + } + updateFinding( + request: protosTypes.google.cloud.securitycenter.v1.IUpdateFindingRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.cloud.securitycenter.v1.IFinding, + ( + | protosTypes.google.cloud.securitycenter.v1.IUpdateFindingRequest + | undefined + ), + {} | undefined + ] + >; + updateFinding( + request: protosTypes.google.cloud.securitycenter.v1.IUpdateFindingRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.cloud.securitycenter.v1.IFinding, + | protosTypes.google.cloud.securitycenter.v1.IUpdateFindingRequest + | undefined, + {} | undefined + > + ): void; + /** + * Creates or updates a finding. The corresponding source must exist for a + * finding creation to succeed. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.securitycenter.v1.Finding} request.finding + * Required. The finding resource to update or create if it does not already exist. + * parent, security_marks, and update_time will be ignored. + * + * In the case of creation, the finding id portion of the name must be + * alphanumeric and less than or equal to 32 characters and greater than 0 + * characters in length. + * @param {google.protobuf.FieldMask} request.updateMask + * The FieldMask to use when updating the finding resource. This field should + * not be specified when creating a finding. + * + * When updating a finding, an empty mask is treated as updating all mutable + * fields and replacing source_properties. Individual source_properties can + * be added/updated by using "source_properties." in the field + * mask. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Finding]{@link google.cloud.securitycenter.v1.Finding}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + updateFinding( + request: protosTypes.google.cloud.securitycenter.v1.IUpdateFindingRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.cloud.securitycenter.v1.IFinding, + | protosTypes.google.cloud.securitycenter.v1.IUpdateFindingRequest + | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.cloud.securitycenter.v1.IFinding, + | protosTypes.google.cloud.securitycenter.v1.IUpdateFindingRequest + | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.cloud.securitycenter.v1.IFinding, + ( + | protosTypes.google.cloud.securitycenter.v1.IUpdateFindingRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'finding.name': request.finding!.name || '', + }); + return this._innerApiCalls.updateFinding(request, options, callback); + } + updateOrganizationSettings( + request: protosTypes.google.cloud.securitycenter.v1.IUpdateOrganizationSettingsRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.cloud.securitycenter.v1.IOrganizationSettings, + ( + | protosTypes.google.cloud.securitycenter.v1.IUpdateOrganizationSettingsRequest + | undefined + ), + {} | undefined + ] + >; + updateOrganizationSettings( + request: protosTypes.google.cloud.securitycenter.v1.IUpdateOrganizationSettingsRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.cloud.securitycenter.v1.IOrganizationSettings, + | protosTypes.google.cloud.securitycenter.v1.IUpdateOrganizationSettingsRequest + | undefined, + {} | undefined + > + ): void; + /** + * Updates an organization's settings. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.securitycenter.v1.OrganizationSettings} request.organizationSettings + * Required. The organization settings resource to update. + * @param {google.protobuf.FieldMask} request.updateMask + * The FieldMask to use when updating the settings resource. + * + * If empty all mutable fields will be updated. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [OrganizationSettings]{@link google.cloud.securitycenter.v1.OrganizationSettings}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + updateOrganizationSettings( + request: protosTypes.google.cloud.securitycenter.v1.IUpdateOrganizationSettingsRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.cloud.securitycenter.v1.IOrganizationSettings, + | protosTypes.google.cloud.securitycenter.v1.IUpdateOrganizationSettingsRequest + | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.cloud.securitycenter.v1.IOrganizationSettings, + | protosTypes.google.cloud.securitycenter.v1.IUpdateOrganizationSettingsRequest + | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.cloud.securitycenter.v1.IOrganizationSettings, + ( + | protosTypes.google.cloud.securitycenter.v1.IUpdateOrganizationSettingsRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'organization_settings.name': request.organizationSettings!.name || '', + }); + return this._innerApiCalls.updateOrganizationSettings( + request, + options, + callback + ); + } + updateSource( + request: protosTypes.google.cloud.securitycenter.v1.IUpdateSourceRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.cloud.securitycenter.v1.ISource, + ( + | protosTypes.google.cloud.securitycenter.v1.IUpdateSourceRequest + | undefined + ), + {} | undefined + ] + >; + updateSource( + request: protosTypes.google.cloud.securitycenter.v1.IUpdateSourceRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.cloud.securitycenter.v1.ISource, + | protosTypes.google.cloud.securitycenter.v1.IUpdateSourceRequest + | undefined, + {} | undefined + > + ): void; + /** + * Updates a source. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.securitycenter.v1.Source} request.source + * Required. The source resource to update. + * @param {google.protobuf.FieldMask} request.updateMask + * The FieldMask to use when updating the source resource. + * + * If empty all mutable fields will be updated. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Source]{@link google.cloud.securitycenter.v1.Source}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + updateSource( + request: protosTypes.google.cloud.securitycenter.v1.IUpdateSourceRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.cloud.securitycenter.v1.ISource, + | protosTypes.google.cloud.securitycenter.v1.IUpdateSourceRequest + | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.cloud.securitycenter.v1.ISource, + | protosTypes.google.cloud.securitycenter.v1.IUpdateSourceRequest + | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.cloud.securitycenter.v1.ISource, + ( + | protosTypes.google.cloud.securitycenter.v1.IUpdateSourceRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'source.name': request.source!.name || '', + }); + return this._innerApiCalls.updateSource(request, options, callback); + } + updateSecurityMarks( + request: protosTypes.google.cloud.securitycenter.v1.IUpdateSecurityMarksRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.cloud.securitycenter.v1.ISecurityMarks, + ( + | protosTypes.google.cloud.securitycenter.v1.IUpdateSecurityMarksRequest + | undefined + ), + {} | undefined + ] + >; + updateSecurityMarks( + request: protosTypes.google.cloud.securitycenter.v1.IUpdateSecurityMarksRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.cloud.securitycenter.v1.ISecurityMarks, + | protosTypes.google.cloud.securitycenter.v1.IUpdateSecurityMarksRequest + | undefined, + {} | undefined + > + ): void; + /** + * Updates security marks. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.securitycenter.v1.SecurityMarks} request.securityMarks + * Required. The security marks resource to update. + * @param {google.protobuf.FieldMask} request.updateMask + * The FieldMask to use when updating the security marks resource. + * + * The field mask must not contain duplicate fields. + * If empty or set to "marks", all marks will be replaced. Individual + * marks can be updated using "marks.". + * @param {google.protobuf.Timestamp} request.startTime + * The time at which the updated SecurityMarks take effect. + * If not set uses current server time. Updates will be applied to the + * SecurityMarks that are active immediately preceding this time. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [SecurityMarks]{@link google.cloud.securitycenter.v1.SecurityMarks}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + updateSecurityMarks( + request: protosTypes.google.cloud.securitycenter.v1.IUpdateSecurityMarksRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.cloud.securitycenter.v1.ISecurityMarks, + | protosTypes.google.cloud.securitycenter.v1.IUpdateSecurityMarksRequest + | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.cloud.securitycenter.v1.ISecurityMarks, + | protosTypes.google.cloud.securitycenter.v1.IUpdateSecurityMarksRequest + | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.cloud.securitycenter.v1.ISecurityMarks, + ( + | protosTypes.google.cloud.securitycenter.v1.IUpdateSecurityMarksRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'security_marks.name': request.securityMarks!.name || '', + }); + return this._innerApiCalls.updateSecurityMarks(request, options, callback); + } + + runAssetDiscovery( + request: protosTypes.google.cloud.securitycenter.v1.IRunAssetDiscoveryRequest, + options?: gax.CallOptions + ): Promise< + [ + LROperation< + protosTypes.google.cloud.securitycenter.v1.IRunAssetDiscoveryResponse, + protosTypes.google.protobuf.IEmpty + >, + protosTypes.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + runAssetDiscovery( + request: protosTypes.google.cloud.securitycenter.v1.IRunAssetDiscoveryRequest, + options: gax.CallOptions, + callback: Callback< + LROperation< + protosTypes.google.cloud.securitycenter.v1.IRunAssetDiscoveryResponse, + protosTypes.google.protobuf.IEmpty + >, + protosTypes.google.longrunning.IOperation | undefined, + {} | undefined + > + ): void; + /** + * Runs asset discovery. The discovery is tracked with a long-running + * operation. + * + * This API can only be called with limited frequency for an organization. If + * it is called too frequently the caller will receive a TOO_MANY_REQUESTS + * error. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Name of the organization to run asset discovery for. Its format is + * "organizations/[organization_id]". + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.longrunning.Operation}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + runAssetDiscovery( + request: protosTypes.google.cloud.securitycenter.v1.IRunAssetDiscoveryRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + LROperation< + protosTypes.google.cloud.securitycenter.v1.IRunAssetDiscoveryResponse, + protosTypes.google.protobuf.IEmpty + >, + protosTypes.google.longrunning.IOperation | undefined, + {} | undefined + >, + callback?: Callback< + LROperation< + protosTypes.google.cloud.securitycenter.v1.IRunAssetDiscoveryResponse, + protosTypes.google.protobuf.IEmpty + >, + protosTypes.google.longrunning.IOperation | undefined, + {} | undefined + > + ): Promise< + [ + LROperation< + protosTypes.google.cloud.securitycenter.v1.IRunAssetDiscoveryResponse, + protosTypes.google.protobuf.IEmpty + >, + protosTypes.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + return this._innerApiCalls.runAssetDiscovery(request, options, callback); + } + groupAssets( + request: protosTypes.google.cloud.securitycenter.v1.IGroupAssetsRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.cloud.securitycenter.v1.IGroupResult[], + protosTypes.google.cloud.securitycenter.v1.IGroupAssetsRequest | null, + protosTypes.google.cloud.securitycenter.v1.IGroupAssetsResponse + ] + >; + groupAssets( + request: protosTypes.google.cloud.securitycenter.v1.IGroupAssetsRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.cloud.securitycenter.v1.IGroupResult[], + protosTypes.google.cloud.securitycenter.v1.IGroupAssetsRequest | null, + protosTypes.google.cloud.securitycenter.v1.IGroupAssetsResponse + > + ): void; + /** + * Filters an organization's assets and groups them by their specified + * properties. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Name of the organization to groupBy. Its format is + * "organizations/[organization_id]". + * @param {string} request.filter + * Expression that defines the filter to apply across assets. + * The expression is a list of zero or more restrictions combined via logical + * operators `AND` and `OR`. + * Parentheses are supported, and `OR` has higher precedence than `AND`. + * + * Restrictions have the form ` ` and may have a `-` + * character in front of them to indicate negation. The fields map to those + * defined in the Asset resource. Examples include: + * + * * name + * * security_center_properties.resource_name + * * resource_properties.a_property + * * security_marks.marks.marka + * + * The supported operators are: + * + * * `=` for all value types. + * * `>`, `<`, `>=`, `<=` for integer values. + * * `:`, meaning substring matching, for strings. + * + * The supported value types are: + * + * * string literals in quotes. + * * integer literals without quotes. + * * boolean literals `true` and `false` without quotes. + * + * The following field and operator combinations are supported: + * + * * name: `=` + * * update_time: `=`, `>`, `<`, `>=`, `<=` + * + * Usage: This should be milliseconds since epoch or an RFC3339 string. + * Examples: + * "update_time = \"2019-06-10T16:07:18-07:00\"" + * "update_time = 1560208038000" + * + * * create_time: `=`, `>`, `<`, `>=`, `<=` + * + * Usage: This should be milliseconds since epoch or an RFC3339 string. + * Examples: + * "create_time = \"2019-06-10T16:07:18-07:00\"" + * "create_time = 1560208038000" + * + * * iam_policy.policy_blob: `=`, `:` + * * resource_properties: `=`, `:`, `>`, `<`, `>=`, `<=` + * * security_marks.marks: `=`, `:` + * * security_center_properties.resource_name: `=`, `:` + * * security_center_properties.resource_display_name: `=`, `:` + * * security_center_properties.resource_type: `=`, `:` + * * security_center_properties.resource_parent: `=`, `:` + * * security_center_properties.resource_parent_display_name: `=`, `:` + * * security_center_properties.resource_project: `=`, `:` + * * security_center_properties.resource_project_display_name: `=`, `:` + * * security_center_properties.resource_owners: `=`, `:` + * + * For example, `resource_properties.size = 100` is a valid filter string. * @param {string} request.groupBy * Required. Expression that defines what assets fields to use for grouping. The string * value should follow SQL syntax: comma separated list of fields. For * example: * "security_center_properties.resource_project,security_center_properties.project". * - * The following fields are supported when compare_duration is not set: + * The following fields are supported when compare_duration is not set: + * + * * security_center_properties.resource_project + * * security_center_properties.resource_project_display_name + * * security_center_properties.resource_type + * * security_center_properties.resource_parent + * * security_center_properties.resource_parent_display_name + * + * The following fields are supported when compare_duration is set: + * + * * security_center_properties.resource_type + * * security_center_properties.resource_project_display_name + * * security_center_properties.resource_parent_display_name + * @param {google.protobuf.Duration} request.compareDuration + * When compare_duration is set, the GroupResult's "state_change" property is + * updated to indicate whether the asset was added, removed, or remained + * present during the compare_duration period of time that precedes the + * read_time. This is the time between (read_time - compare_duration) and + * read_time. + * + * The state change value is derived based on the presence of the asset at the + * two points in time. Intermediate state changes between the two times don't + * affect the result. For example, the results aren't affected if the asset is + * removed and re-created again. + * + * Possible "state_change" values when compare_duration is specified: + * + * * "ADDED": indicates that the asset was not present at the start of + * compare_duration, but present at reference_time. + * * "REMOVED": indicates that the asset was present at the start of + * compare_duration, but not present at reference_time. + * * "ACTIVE": indicates that the asset was present at both the + * start and the end of the time period defined by + * compare_duration and reference_time. + * + * If compare_duration is not specified, then the only possible state_change + * is "UNUSED", which will be the state_change set for all assets present at + * read_time. + * + * If this field is set then `state_change` must be a specified field in + * `group_by`. + * @param {google.protobuf.Timestamp} request.readTime + * Time used as a reference point when filtering assets. The filter is limited + * to assets existing at the supplied time and their values are those at that + * specific time. Absence of this field will default to the API's version of + * NOW. + * @param {string} request.pageToken + * The value returned by the last `GroupAssetsResponse`; indicates + * that this is a continuation of a prior `GroupAssets` call, and that the + * system should return the next page of data. + * @param {number} request.pageSize + * The maximum number of results to return in a single response. Default is + * 10, minimum is 1, maximum is 1000. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [GroupResult]{@link google.cloud.securitycenter.v1.GroupResult}. + * The client library support auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * + * When autoPaginate: false is specified through options, the array has three elements. + * The first element is Array of [GroupResult]{@link google.cloud.securitycenter.v1.GroupResult} that corresponds to + * the one page received from the API server. + * If the second element is not null it contains the request object of type [GroupAssetsRequest]{@link google.cloud.securitycenter.v1.GroupAssetsRequest} + * that can be used to obtain the next page of the results. + * If it is null, the next page does not exist. + * The third element contains the raw response received from the API server. Its type is + * [GroupAssetsResponse]{@link google.cloud.securitycenter.v1.GroupAssetsResponse}. + * + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + groupAssets( + request: protosTypes.google.cloud.securitycenter.v1.IGroupAssetsRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.cloud.securitycenter.v1.IGroupResult[], + protosTypes.google.cloud.securitycenter.v1.IGroupAssetsRequest | null, + protosTypes.google.cloud.securitycenter.v1.IGroupAssetsResponse + >, + callback?: Callback< + protosTypes.google.cloud.securitycenter.v1.IGroupResult[], + protosTypes.google.cloud.securitycenter.v1.IGroupAssetsRequest | null, + protosTypes.google.cloud.securitycenter.v1.IGroupAssetsResponse + > + ): Promise< + [ + protosTypes.google.cloud.securitycenter.v1.IGroupResult[], + protosTypes.google.cloud.securitycenter.v1.IGroupAssetsRequest | null, + protosTypes.google.cloud.securitycenter.v1.IGroupAssetsResponse + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + return this._innerApiCalls.groupAssets(request, options, callback); + } + + /** + * Equivalent to {@link groupAssets}, but returns a NodeJS Stream object. + * + * This fetches the paged responses for {@link groupAssets} continuously + * and invokes the callback registered for 'data' event for each element in the + * responses. + * + * The returned object has 'end' method when no more elements are required. * - * * security_center_properties.resource_project - * * security_center_properties.resource_project_display_name - * * security_center_properties.resource_type - * * security_center_properties.resource_parent - * * security_center_properties.resource_parent_display_name + * autoPaginate option will be ignored. * - * The following fields are supported when compare_duration is set: + * @see {@link https://nodejs.org/api/stream.html} * - * * security_center_properties.resource_type - * * security_center_properties.resource_project_display_name - * * security_center_properties.resource_parent_display_name - * @param {string} [request.filter] + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Name of the organization to groupBy. Its format is + * "organizations/[organization_id]". + * @param {string} request.filter * Expression that defines the filter to apply across assets. * The expression is a list of zero or more restrictions combined via logical * operators `AND` and `OR`. @@ -946,7 +1706,26 @@ class SecurityCenterClient { * * security_center_properties.resource_owners: `=`, `:` * * For example, `resource_properties.size = 100` is a valid filter string. - * @param {Object} [request.compareDuration] + * @param {string} request.groupBy + * Required. Expression that defines what assets fields to use for grouping. The string + * value should follow SQL syntax: comma separated list of fields. For + * example: + * "security_center_properties.resource_project,security_center_properties.project". + * + * The following fields are supported when compare_duration is not set: + * + * * security_center_properties.resource_project + * * security_center_properties.resource_project_display_name + * * security_center_properties.resource_type + * * security_center_properties.resource_parent + * * security_center_properties.resource_parent_display_name + * + * The following fields are supported when compare_duration is set: + * + * * security_center_properties.resource_type + * * security_center_properties.resource_project_display_name + * * security_center_properties.resource_parent_display_name + * @param {google.protobuf.Duration} request.compareDuration * When compare_duration is set, the GroupResult's "state_change" property is * updated to indicate whether the asset was added, removed, or remained * present during the compare_duration period of time that precedes the @@ -974,58 +1753,54 @@ class SecurityCenterClient { * * If this field is set then `state_change` must be a specified field in * `group_by`. - * - * This object should have the same structure as [Duration]{@link google.protobuf.Duration} - * @param {Object} [request.readTime] + * @param {google.protobuf.Timestamp} request.readTime * Time used as a reference point when filtering assets. The filter is limited * to assets existing at the supplied time and their values are those at that * specific time. Absence of this field will default to the API's version of * NOW. - * - * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} - * @param {number} [request.pageSize] - * The maximum number of resources contained in the underlying API - * response. If page streaming is performed per-resource, this - * parameter does not affect the return value. If page streaming is - * performed per-page, this determines the maximum number of - * resources in a page. - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. + * @param {string} request.pageToken + * The value returned by the last `GroupAssetsResponse`; indicates + * that this is a continuation of a prior `GroupAssets` call, and that the + * system should return the next page of data. + * @param {number} request.pageSize + * The maximum number of results to return in a single response. Default is + * 10, minimum is 1, maximum is 1000. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Stream} * An object stream which emits an object representing [GroupResult]{@link google.cloud.securitycenter.v1.GroupResult} on 'data' event. - * - * @example - * - * const securityCenter = require('@google-cloud/security-center'); - * - * const client = new securityCenter.v1.SecurityCenterClient({ - * // optional auth parameters. - * }); - * - * const formattedParent = client.organizationPath('[ORGANIZATION]'); - * const groupBy = ''; - * const request = { - * parent: formattedParent, - * groupBy: groupBy, - * }; - * client.groupAssetsStream(request) - * .on('data', element => { - * // doThingsWith(element) - * }).on('error', err => { - * console.log(err); - * }); */ - groupAssetsStream(request, options) { - options = options || {}; - + groupAssetsStream( + request?: protosTypes.google.cloud.securitycenter.v1.IGroupAssetsRequest, + options?: gax.CallOptions | {} + ): Transform { + request = request || {}; + const callSettings = new gax.CallSettings(options); return this._descriptors.page.groupAssets.createStream( - this._innerApiCalls.groupAssets, + this._innerApiCalls.groupAssets as gax.GaxCall, request, - options + callSettings ); } - + groupFindings( + request: protosTypes.google.cloud.securitycenter.v1.IGroupFindingsRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.cloud.securitycenter.v1.IGroupResult[], + protosTypes.google.cloud.securitycenter.v1.IGroupFindingsRequest | null, + protosTypes.google.cloud.securitycenter.v1.IGroupFindingsResponse + ] + >; + groupFindings( + request: protosTypes.google.cloud.securitycenter.v1.IGroupFindingsRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.cloud.securitycenter.v1.IGroupResult[], + protosTypes.google.cloud.securitycenter.v1.IGroupFindingsRequest | null, + protosTypes.google.cloud.securitycenter.v1.IGroupFindingsResponse + > + ): void; /** * Filters an organization or source's findings and groups them by their * specified properties. @@ -1040,22 +1815,7 @@ class SecurityCenterClient { * "organizations/[organization_id]/sources/[source_id]". To groupBy across * all sources provide a source_id of `-`. For example: * organizations/{organization_id}/sources/- - * @param {string} request.groupBy - * Required. Expression that defines what assets fields to use for grouping (including - * `state_change`). The string value should follow SQL syntax: comma separated - * list of fields. For example: "parent,resource_name". - * - * The following fields are supported: - * - * * resource_name - * * category - * * state - * * parent - * - * The following fields are supported when compare_duration is set: - * - * * state_change - * @param {string} [request.filter] + * @param {string} request.filter * Expression that defines the filter to apply across findings. * The expression is a list of one or more restrictions combined via logical * operators `AND` and `OR`. @@ -1099,14 +1859,27 @@ class SecurityCenterClient { * * source_properties: `=`, `:`, `>`, `<`, `>=`, `<=` * * For example, `source_properties.size = 100` is a valid filter string. - * @param {Object} [request.readTime] + * @param {string} request.groupBy + * Required. Expression that defines what assets fields to use for grouping (including + * `state_change`). The string value should follow SQL syntax: comma separated + * list of fields. For example: "parent,resource_name". + * + * The following fields are supported: + * + * * resource_name + * * category + * * state + * * parent + * + * The following fields are supported when compare_duration is set: + * + * * state_change + * @param {google.protobuf.Timestamp} request.readTime * Time used as a reference point when filtering findings. The filter is * limited to findings existing at the supplied time and their values are * those at that specific time. Absence of this field will default to the * API's version of NOW. - * - * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} - * @param {Object} [request.compareDuration] + * @param {google.protobuf.Duration} request.compareDuration * When compare_duration is set, the GroupResult's "state_change" attribute is * updated to indicate whether the finding had its state changed, the * finding's state remained unchanged, or if the finding was added during the @@ -1133,110 +1906,68 @@ class SecurityCenterClient { * * If this field is set then `state_change` must be a specified field in * `group_by`. - * - * This object should have the same structure as [Duration]{@link google.protobuf.Duration} - * @param {number} [request.pageSize] - * The maximum number of resources contained in the underlying API - * response. If page streaming is performed per-resource, this - * parameter does not affect the return value. If page streaming is - * performed per-page, this determines the maximum number of - * resources in a page. - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Array, ?Object, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is Array of [GroupResult]{@link google.cloud.securitycenter.v1.GroupResult}. - * - * When autoPaginate: false is specified through options, it contains the result - * in a single response. If the response indicates the next page exists, the third - * parameter is set to be used for the next request object. The fourth parameter keeps - * the raw response object of an object representing [GroupFindingsResponse]{@link google.cloud.securitycenter.v1.GroupFindingsResponse}. + * @param {string} request.pageToken + * The value returned by the last `GroupFindingsResponse`; indicates + * that this is a continuation of a prior `GroupFindings` call, and + * that the system should return the next page of data. + * @param {number} request.pageSize + * The maximum number of results to return in a single response. Default is + * 10, minimum is 1, maximum is 1000. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. * The first element of the array is Array of [GroupResult]{@link google.cloud.securitycenter.v1.GroupResult}. + * The client library support auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. * * When autoPaginate: false is specified through options, the array has three elements. - * The first element is Array of [GroupResult]{@link google.cloud.securitycenter.v1.GroupResult} in a single response. - * The second element is the next request object if the response - * indicates the next page exists, or null. The third element is - * an object representing [GroupFindingsResponse]{@link google.cloud.securitycenter.v1.GroupFindingsResponse}. + * The first element is Array of [GroupResult]{@link google.cloud.securitycenter.v1.GroupResult} that corresponds to + * the one page received from the API server. + * If the second element is not null it contains the request object of type [GroupFindingsRequest]{@link google.cloud.securitycenter.v1.GroupFindingsRequest} + * that can be used to obtain the next page of the results. + * If it is null, the next page does not exist. + * The third element contains the raw response received from the API server. Its type is + * [GroupFindingsResponse]{@link google.cloud.securitycenter.v1.GroupFindingsResponse}. * * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const securityCenter = require('@google-cloud/security-center'); - * - * const client = new securityCenter.v1.SecurityCenterClient({ - * // optional auth parameters. - * }); - * - * // Iterate over all elements. - * const formattedParent = client.sourcePath('[ORGANIZATION]', '[SOURCE]'); - * const groupBy = ''; - * const request = { - * parent: formattedParent, - * groupBy: groupBy, - * }; - * - * client.groupFindings(request) - * .then(responses => { - * const resources = responses[0]; - * for (const resource of resources) { - * // doThingsWith(resource) - * } - * }) - * .catch(err => { - * console.error(err); - * }); - * - * // Or obtain the paged response. - * const formattedParent = client.sourcePath('[ORGANIZATION]', '[SOURCE]'); - * const groupBy = ''; - * const request = { - * parent: formattedParent, - * groupBy: groupBy, - * }; - * - * - * const options = {autoPaginate: false}; - * const callback = responses => { - * // The actual resources in a response. - * const resources = responses[0]; - * // The next request if the response shows that there are more responses. - * const nextRequest = responses[1]; - * // The actual response object, if necessary. - * // const rawResponse = responses[2]; - * for (const resource of resources) { - * // doThingsWith(resource); - * } - * if (nextRequest) { - * // Fetch the next page. - * return client.groupFindings(nextRequest, options).then(callback); - * } - * } - * client.groupFindings(request, options) - * .then(callback) - * .catch(err => { - * console.error(err); - * }); */ - groupFindings(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; + groupFindings( + request: protosTypes.google.cloud.securitycenter.v1.IGroupFindingsRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.cloud.securitycenter.v1.IGroupResult[], + protosTypes.google.cloud.securitycenter.v1.IGroupFindingsRequest | null, + protosTypes.google.cloud.securitycenter.v1.IGroupFindingsResponse + >, + callback?: Callback< + protosTypes.google.cloud.securitycenter.v1.IGroupResult[], + protosTypes.google.cloud.securitycenter.v1.IGroupFindingsRequest | null, + protosTypes.google.cloud.securitycenter.v1.IGroupFindingsResponse + > + ): Promise< + [ + protosTypes.google.cloud.securitycenter.v1.IGroupResult[], + protosTypes.google.cloud.securitycenter.v1.IGroupFindingsRequest | null, + protosTypes.google.cloud.securitycenter.v1.IGroupFindingsResponse + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; } - request = request || {}; options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers[ 'x-goog-request-params' ] = gax.routingHeader.fromParams({ - parent: request.parent, + parent: request.parent || '', }); - return this._innerApiCalls.groupFindings(request, options, callback); } @@ -1260,22 +1991,7 @@ class SecurityCenterClient { * "organizations/[organization_id]/sources/[source_id]". To groupBy across * all sources provide a source_id of `-`. For example: * organizations/{organization_id}/sources/- - * @param {string} request.groupBy - * Required. Expression that defines what assets fields to use for grouping (including - * `state_change`). The string value should follow SQL syntax: comma separated - * list of fields. For example: "parent,resource_name". - * - * The following fields are supported: - * - * * resource_name - * * category - * * state - * * parent - * - * The following fields are supported when compare_duration is set: - * - * * state_change - * @param {string} [request.filter] + * @param {string} request.filter * Expression that defines the filter to apply across findings. * The expression is a list of one or more restrictions combined via logical * operators `AND` and `OR`. @@ -1319,14 +2035,27 @@ class SecurityCenterClient { * * source_properties: `=`, `:`, `>`, `<`, `>=`, `<=` * * For example, `source_properties.size = 100` is a valid filter string. - * @param {Object} [request.readTime] + * @param {string} request.groupBy + * Required. Expression that defines what assets fields to use for grouping (including + * `state_change`). The string value should follow SQL syntax: comma separated + * list of fields. For example: "parent,resource_name". + * + * The following fields are supported: + * + * * resource_name + * * category + * * state + * * parent + * + * The following fields are supported when compare_duration is set: + * + * * state_change + * @param {google.protobuf.Timestamp} request.readTime * Time used as a reference point when filtering findings. The filter is * limited to findings existing at the supplied time and their values are * those at that specific time. Absence of this field will default to the * API's version of NOW. - * - * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} - * @param {Object} [request.compareDuration] + * @param {google.protobuf.Duration} request.compareDuration * When compare_duration is set, the GroupResult's "state_change" attribute is * updated to indicate whether the finding had its state changed, the * finding's state remained unchanged, or if the finding was added during the @@ -1353,51 +2082,49 @@ class SecurityCenterClient { * * If this field is set then `state_change` must be a specified field in * `group_by`. - * - * This object should have the same structure as [Duration]{@link google.protobuf.Duration} - * @param {number} [request.pageSize] - * The maximum number of resources contained in the underlying API - * response. If page streaming is performed per-resource, this - * parameter does not affect the return value. If page streaming is - * performed per-page, this determines the maximum number of - * resources in a page. - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. + * @param {string} request.pageToken + * The value returned by the last `GroupFindingsResponse`; indicates + * that this is a continuation of a prior `GroupFindings` call, and + * that the system should return the next page of data. + * @param {number} request.pageSize + * The maximum number of results to return in a single response. Default is + * 10, minimum is 1, maximum is 1000. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Stream} * An object stream which emits an object representing [GroupResult]{@link google.cloud.securitycenter.v1.GroupResult} on 'data' event. - * - * @example - * - * const securityCenter = require('@google-cloud/security-center'); - * - * const client = new securityCenter.v1.SecurityCenterClient({ - * // optional auth parameters. - * }); - * - * const formattedParent = client.sourcePath('[ORGANIZATION]', '[SOURCE]'); - * const groupBy = ''; - * const request = { - * parent: formattedParent, - * groupBy: groupBy, - * }; - * client.groupFindingsStream(request) - * .on('data', element => { - * // doThingsWith(element) - * }).on('error', err => { - * console.log(err); - * }); */ - groupFindingsStream(request, options) { - options = options || {}; - + groupFindingsStream( + request?: protosTypes.google.cloud.securitycenter.v1.IGroupFindingsRequest, + options?: gax.CallOptions | {} + ): Transform { + request = request || {}; + const callSettings = new gax.CallSettings(options); return this._descriptors.page.groupFindings.createStream( - this._innerApiCalls.groupFindings, + this._innerApiCalls.groupFindings as gax.GaxCall, request, - options + callSettings ); } - + listAssets( + request: protosTypes.google.cloud.securitycenter.v1.IListAssetsRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.cloud.securitycenter.v1.ListAssetsResponse.IListAssetsResult[], + protosTypes.google.cloud.securitycenter.v1.IListAssetsRequest | null, + protosTypes.google.cloud.securitycenter.v1.IListAssetsResponse + ] + >; + listAssets( + request: protosTypes.google.cloud.securitycenter.v1.IListAssetsRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.cloud.securitycenter.v1.ListAssetsResponse.IListAssetsResult[], + protosTypes.google.cloud.securitycenter.v1.IListAssetsRequest | null, + protosTypes.google.cloud.securitycenter.v1.IListAssetsResponse + > + ): void; /** * Lists an organization's assets. * @@ -1406,7 +2133,7 @@ class SecurityCenterClient { * @param {string} request.parent * Required. Name of the organization assets should belong to. Its format is * "organizations/[organization_id]". - * @param {string} [request.filter] + * @param {string} request.filter * Expression that defines the filter to apply across assets. * The expression is a list of zero or more restrictions combined via logical * operators `AND` and `OR`. @@ -1463,7 +2190,7 @@ class SecurityCenterClient { * * security_center_properties.resource_owners: `=`, `:` * * For example, `resource_properties.size = 100` is a valid filter string. - * @param {string} [request.orderBy] + * @param {string} request.orderBy * Expression that defines what fields and order to use for sorting. The * string value should follow SQL syntax: comma separated list of fields. For * example: "name,resource_properties.a_property". The default sorting order @@ -1485,14 +2212,12 @@ class SecurityCenterClient { * security_center_properties.resource_project * security_center_properties.resource_project_display_name * security_center_properties.resource_type - * @param {Object} [request.readTime] + * @param {google.protobuf.Timestamp} request.readTime * Time used as a reference point when filtering assets. The filter is limited * to assets existing at the supplied time and their values are those at that * specific time. Absence of this field will default to the API's version of * NOW. - * - * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} - * @param {Object} [request.compareDuration] + * @param {google.protobuf.Duration} request.compareDuration * When compare_duration is set, the ListAssetsResult's "state_change" * attribute is updated to indicate whether the asset was added, removed, or * remained present during the compare_duration period of time that precedes @@ -1517,106 +2242,72 @@ class SecurityCenterClient { * If compare_duration is not specified, then the only possible state_change * is "UNUSED", which will be the state_change set for all assets present at * read_time. - * - * This object should have the same structure as [Duration]{@link google.protobuf.Duration} - * @param {Object} [request.fieldMask] + * @param {google.protobuf.FieldMask} [request.fieldMask] * Optional. A field mask to specify the ListAssetsResult fields to be listed in the * response. * An empty field mask will list all fields. - * - * This object should have the same structure as [FieldMask]{@link google.protobuf.FieldMask} - * @param {number} [request.pageSize] - * The maximum number of resources contained in the underlying API - * response. If page streaming is performed per-resource, this - * parameter does not affect the return value. If page streaming is - * performed per-page, this determines the maximum number of - * resources in a page. - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Array, ?Object, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is Array of [ListAssetsResult]{@link google.cloud.securitycenter.v1.ListAssetsResult}. - * - * When autoPaginate: false is specified through options, it contains the result - * in a single response. If the response indicates the next page exists, the third - * parameter is set to be used for the next request object. The fourth parameter keeps - * the raw response object of an object representing [ListAssetsResponse]{@link google.cloud.securitycenter.v1.ListAssetsResponse}. + * @param {string} request.pageToken + * The value returned by the last `ListAssetsResponse`; indicates + * that this is a continuation of a prior `ListAssets` call, and + * that the system should return the next page of data. + * @param {number} request.pageSize + * The maximum number of results to return in a single response. Default is + * 10, minimum is 1, maximum is 1000. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of [ListAssetsResult]{@link google.cloud.securitycenter.v1.ListAssetsResult}. + * The first element of the array is Array of [ListAssetsResult]{@link google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult}. + * The client library support auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. * * When autoPaginate: false is specified through options, the array has three elements. - * The first element is Array of [ListAssetsResult]{@link google.cloud.securitycenter.v1.ListAssetsResult} in a single response. - * The second element is the next request object if the response - * indicates the next page exists, or null. The third element is - * an object representing [ListAssetsResponse]{@link google.cloud.securitycenter.v1.ListAssetsResponse}. + * The first element is Array of [ListAssetsResult]{@link google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult} that corresponds to + * the one page received from the API server. + * If the second element is not null it contains the request object of type [ListAssetsRequest]{@link google.cloud.securitycenter.v1.ListAssetsRequest} + * that can be used to obtain the next page of the results. + * If it is null, the next page does not exist. + * The third element contains the raw response received from the API server. Its type is + * [ListAssetsResponse]{@link google.cloud.securitycenter.v1.ListAssetsResponse}. * * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const securityCenter = require('@google-cloud/security-center'); - * - * const client = new securityCenter.v1.SecurityCenterClient({ - * // optional auth parameters. - * }); - * - * // Iterate over all elements. - * const formattedParent = client.organizationPath('[ORGANIZATION]'); - * - * client.listAssets({parent: formattedParent}) - * .then(responses => { - * const resources = responses[0]; - * for (const resource of resources) { - * // doThingsWith(resource) - * } - * }) - * .catch(err => { - * console.error(err); - * }); - * - * // Or obtain the paged response. - * const formattedParent = client.organizationPath('[ORGANIZATION]'); - * - * - * const options = {autoPaginate: false}; - * const callback = responses => { - * // The actual resources in a response. - * const resources = responses[0]; - * // The next request if the response shows that there are more responses. - * const nextRequest = responses[1]; - * // The actual response object, if necessary. - * // const rawResponse = responses[2]; - * for (const resource of resources) { - * // doThingsWith(resource); - * } - * if (nextRequest) { - * // Fetch the next page. - * return client.listAssets(nextRequest, options).then(callback); - * } - * } - * client.listAssets({parent: formattedParent}, options) - * .then(callback) - * .catch(err => { - * console.error(err); - * }); */ - listAssets(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; + listAssets( + request: protosTypes.google.cloud.securitycenter.v1.IListAssetsRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.cloud.securitycenter.v1.ListAssetsResponse.IListAssetsResult[], + protosTypes.google.cloud.securitycenter.v1.IListAssetsRequest | null, + protosTypes.google.cloud.securitycenter.v1.IListAssetsResponse + >, + callback?: Callback< + protosTypes.google.cloud.securitycenter.v1.ListAssetsResponse.IListAssetsResult[], + protosTypes.google.cloud.securitycenter.v1.IListAssetsRequest | null, + protosTypes.google.cloud.securitycenter.v1.IListAssetsResponse + > + ): Promise< + [ + protosTypes.google.cloud.securitycenter.v1.ListAssetsResponse.IListAssetsResult[], + protosTypes.google.cloud.securitycenter.v1.IListAssetsRequest | null, + protosTypes.google.cloud.securitycenter.v1.IListAssetsResponse + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; } - request = request || {}; options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers[ 'x-goog-request-params' ] = gax.routingHeader.fromParams({ - parent: request.parent, + parent: request.parent || '', }); - return this._innerApiCalls.listAssets(request, options, callback); } @@ -1638,7 +2329,7 @@ class SecurityCenterClient { * @param {string} request.parent * Required. Name of the organization assets should belong to. Its format is * "organizations/[organization_id]". - * @param {string} [request.filter] + * @param {string} request.filter * Expression that defines the filter to apply across assets. * The expression is a list of zero or more restrictions combined via logical * operators `AND` and `OR`. @@ -1695,7 +2386,7 @@ class SecurityCenterClient { * * security_center_properties.resource_owners: `=`, `:` * * For example, `resource_properties.size = 100` is a valid filter string. - * @param {string} [request.orderBy] + * @param {string} request.orderBy * Expression that defines what fields and order to use for sorting. The * string value should follow SQL syntax: comma separated list of fields. For * example: "name,resource_properties.a_property". The default sorting order @@ -1717,306 +2408,88 @@ class SecurityCenterClient { * security_center_properties.resource_project * security_center_properties.resource_project_display_name * security_center_properties.resource_type - * @param {Object} [request.readTime] + * @param {google.protobuf.Timestamp} request.readTime * Time used as a reference point when filtering assets. The filter is limited * to assets existing at the supplied time and their values are those at that * specific time. Absence of this field will default to the API's version of - * NOW. - * - * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} - * @param {Object} [request.compareDuration] - * When compare_duration is set, the ListAssetsResult's "state_change" - * attribute is updated to indicate whether the asset was added, removed, or - * remained present during the compare_duration period of time that precedes - * the read_time. This is the time between (read_time - compare_duration) and - * read_time. - * - * The state_change value is derived based on the presence of the asset at the - * two points in time. Intermediate state changes between the two times don't - * affect the result. For example, the results aren't affected if the asset is - * removed and re-created again. - * - * Possible "state_change" values when compare_duration is specified: - * - * * "ADDED": indicates that the asset was not present at the start of - * compare_duration, but present at read_time. - * * "REMOVED": indicates that the asset was present at the start of - * compare_duration, but not present at read_time. - * * "ACTIVE": indicates that the asset was present at both the - * start and the end of the time period defined by - * compare_duration and read_time. - * - * If compare_duration is not specified, then the only possible state_change - * is "UNUSED", which will be the state_change set for all assets present at - * read_time. - * - * This object should have the same structure as [Duration]{@link google.protobuf.Duration} - * @param {Object} [request.fieldMask] - * Optional. A field mask to specify the ListAssetsResult fields to be listed in the - * response. - * An empty field mask will list all fields. - * - * This object should have the same structure as [FieldMask]{@link google.protobuf.FieldMask} - * @param {number} [request.pageSize] - * The maximum number of resources contained in the underlying API - * response. If page streaming is performed per-resource, this - * parameter does not affect the return value. If page streaming is - * performed per-page, this determines the maximum number of - * resources in a page. - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @returns {Stream} - * An object stream which emits an object representing [ListAssetsResult]{@link google.cloud.securitycenter.v1.ListAssetsResult} on 'data' event. - * - * @example - * - * const securityCenter = require('@google-cloud/security-center'); - * - * const client = new securityCenter.v1.SecurityCenterClient({ - * // optional auth parameters. - * }); - * - * const formattedParent = client.organizationPath('[ORGANIZATION]'); - * client.listAssetsStream({parent: formattedParent}) - * .on('data', element => { - * // doThingsWith(element) - * }).on('error', err => { - * console.log(err); - * }); - */ - listAssetsStream(request, options) { - options = options || {}; - - return this._descriptors.page.listAssets.createStream( - this._innerApiCalls.listAssets, - request, - options - ); - } - - /** - * Lists an organization or source's findings. - * - * To list across all sources provide a `-` as the source id. - * Example: /v1/organizations/{organization_id}/sources/-/findings - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Name of the source the findings belong to. Its format is - * "organizations/[organization_id]/sources/[source_id]". To list across all - * sources provide a source_id of `-`. For example: - * organizations/{organization_id}/sources/- - * @param {string} [request.filter] - * Expression that defines the filter to apply across findings. - * The expression is a list of one or more restrictions combined via logical - * operators `AND` and `OR`. - * Parentheses are supported, and `OR` has higher precedence than `AND`. - * - * Restrictions have the form ` ` and may have a `-` - * character in front of them to indicate negation. Examples include: - * - * * name - * * source_properties.a_property - * * security_marks.marks.marka - * - * The supported operators are: - * - * * `=` for all value types. - * * `>`, `<`, `>=`, `<=` for integer values. - * * `:`, meaning substring matching, for strings. - * - * The supported value types are: - * - * * string literals in quotes. - * * integer literals without quotes. - * * boolean literals `true` and `false` without quotes. - * - * The following field and operator combinations are supported: - * - * name: `=` - * parent: `=`, `:` - * resource_name: `=`, `:` - * state: `=`, `:` - * category: `=`, `:` - * external_uri: `=`, `:` - * event_time: `=`, `>`, `<`, `>=`, `<=` - * - * Usage: This should be milliseconds since epoch or an RFC3339 string. - * Examples: - * "event_time = \"2019-06-10T16:07:18-07:00\"" - * "event_time = 1560208038000" - * - * security_marks.marks: `=`, `:` - * source_properties: `=`, `:`, `>`, `<`, `>=`, `<=` - * - * For example, `source_properties.size = 100` is a valid filter string. - * @param {string} [request.orderBy] - * Expression that defines what fields and order to use for sorting. The - * string value should follow SQL syntax: comma separated list of fields. For - * example: "name,resource_properties.a_property". The default sorting order - * is ascending. To specify descending order for a field, a suffix " desc" - * should be appended to the field name. For example: "name - * desc,source_properties.a_property". Redundant space characters in the - * syntax are insignificant. "name desc,source_properties.a_property" and " - * name desc , source_properties.a_property " are equivalent. - * - * The following fields are supported: - * name - * parent - * state - * category - * resource_name - * event_time - * source_properties - * security_marks.marks - * @param {Object} [request.readTime] - * Time used as a reference point when filtering findings. The filter is - * limited to findings existing at the supplied time and their values are - * those at that specific time. Absence of this field will default to the - * API's version of NOW. - * - * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} - * @param {Object} [request.compareDuration] - * When compare_duration is set, the ListFindingsResult's "state_change" - * attribute is updated to indicate whether the finding had its state changed, - * the finding's state remained unchanged, or if the finding was added in any - * state during the compare_duration period of time that precedes the - * read_time. This is the time between (read_time - compare_duration) and + * NOW. + * @param {google.protobuf.Duration} request.compareDuration + * When compare_duration is set, the ListAssetsResult's "state_change" + * attribute is updated to indicate whether the asset was added, removed, or + * remained present during the compare_duration period of time that precedes + * the read_time. This is the time between (read_time - compare_duration) and * read_time. * - * The state_change value is derived based on the presence and state of the - * finding at the two points in time. Intermediate state changes between the - * two times don't affect the result. For example, the results aren't affected - * if the finding is made inactive and then active again. + * The state_change value is derived based on the presence of the asset at the + * two points in time. Intermediate state changes between the two times don't + * affect the result. For example, the results aren't affected if the asset is + * removed and re-created again. * * Possible "state_change" values when compare_duration is specified: * - * * "CHANGED": indicates that the finding was present at the start of - * compare_duration, but changed its state at read_time. - * * "UNCHANGED": indicates that the finding was present at the start of - * compare_duration and did not change state at read_time. - * * "ADDED": indicates that the finding was not present at the start - * of compare_duration, but was present at read_time. + * * "ADDED": indicates that the asset was not present at the start of + * compare_duration, but present at read_time. + * * "REMOVED": indicates that the asset was present at the start of + * compare_duration, but not present at read_time. + * * "ACTIVE": indicates that the asset was present at both the + * start and the end of the time period defined by + * compare_duration and read_time. * * If compare_duration is not specified, then the only possible state_change - * is "UNUSED", which will be the state_change set for all findings present at + * is "UNUSED", which will be the state_change set for all assets present at * read_time. - * - * This object should have the same structure as [Duration]{@link google.protobuf.Duration} - * @param {Object} [request.fieldMask] - * Optional. A field mask to specify the Finding fields to be listed in the response. + * @param {google.protobuf.FieldMask} [request.fieldMask] + * Optional. A field mask to specify the ListAssetsResult fields to be listed in the + * response. * An empty field mask will list all fields. - * - * This object should have the same structure as [FieldMask]{@link google.protobuf.FieldMask} - * @param {number} [request.pageSize] - * The maximum number of resources contained in the underlying API - * response. If page streaming is performed per-resource, this - * parameter does not affect the return value. If page streaming is - * performed per-page, this determines the maximum number of - * resources in a page. - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Array, ?Object, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is Array of [ListFindingsResult]{@link google.cloud.securitycenter.v1.ListFindingsResult}. - * - * When autoPaginate: false is specified through options, it contains the result - * in a single response. If the response indicates the next page exists, the third - * parameter is set to be used for the next request object. The fourth parameter keeps - * the raw response object of an object representing [ListFindingsResponse]{@link google.cloud.securitycenter.v1.ListFindingsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of [ListFindingsResult]{@link google.cloud.securitycenter.v1.ListFindingsResult}. - * - * When autoPaginate: false is specified through options, the array has three elements. - * The first element is Array of [ListFindingsResult]{@link google.cloud.securitycenter.v1.ListFindingsResult} in a single response. - * The second element is the next request object if the response - * indicates the next page exists, or null. The third element is - * an object representing [ListFindingsResponse]{@link google.cloud.securitycenter.v1.ListFindingsResponse}. - * - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const securityCenter = require('@google-cloud/security-center'); - * - * const client = new securityCenter.v1.SecurityCenterClient({ - * // optional auth parameters. - * }); - * - * // Iterate over all elements. - * const formattedParent = client.sourcePath('[ORGANIZATION]', '[SOURCE]'); - * - * client.listFindings({parent: formattedParent}) - * .then(responses => { - * const resources = responses[0]; - * for (const resource of resources) { - * // doThingsWith(resource) - * } - * }) - * .catch(err => { - * console.error(err); - * }); - * - * // Or obtain the paged response. - * const formattedParent = client.sourcePath('[ORGANIZATION]', '[SOURCE]'); - * - * - * const options = {autoPaginate: false}; - * const callback = responses => { - * // The actual resources in a response. - * const resources = responses[0]; - * // The next request if the response shows that there are more responses. - * const nextRequest = responses[1]; - * // The actual response object, if necessary. - * // const rawResponse = responses[2]; - * for (const resource of resources) { - * // doThingsWith(resource); - * } - * if (nextRequest) { - * // Fetch the next page. - * return client.listFindings(nextRequest, options).then(callback); - * } - * } - * client.listFindings({parent: formattedParent}, options) - * .then(callback) - * .catch(err => { - * console.error(err); - * }); + * @param {string} request.pageToken + * The value returned by the last `ListAssetsResponse`; indicates + * that this is a continuation of a prior `ListAssets` call, and + * that the system should return the next page of data. + * @param {number} request.pageSize + * The maximum number of results to return in a single response. Default is + * 10, minimum is 1, maximum is 1000. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [ListAssetsResult]{@link google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult} on 'data' event. */ - listFindings(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } + listAssetsStream( + request?: protosTypes.google.cloud.securitycenter.v1.IListAssetsRequest, + options?: gax.CallOptions | {} + ): Transform { request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent, - }); - - return this._innerApiCalls.listFindings(request, options, callback); + const callSettings = new gax.CallSettings(options); + return this._descriptors.page.listAssets.createStream( + this._innerApiCalls.listAssets as gax.GaxCall, + request, + callSettings + ); } - + listFindings( + request: protosTypes.google.cloud.securitycenter.v1.IListFindingsRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.cloud.securitycenter.v1.ListFindingsResponse.IListFindingsResult[], + protosTypes.google.cloud.securitycenter.v1.IListFindingsRequest | null, + protosTypes.google.cloud.securitycenter.v1.IListFindingsResponse + ] + >; + listFindings( + request: protosTypes.google.cloud.securitycenter.v1.IListFindingsRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.cloud.securitycenter.v1.ListFindingsResponse.IListFindingsResult[], + protosTypes.google.cloud.securitycenter.v1.IListFindingsRequest | null, + protosTypes.google.cloud.securitycenter.v1.IListFindingsResponse + > + ): void; /** - * Equivalent to {@link listFindings}, but returns a NodeJS Stream object. - * - * This fetches the paged responses for {@link listFindings} continuously - * and invokes the callback registered for 'data' event for each element in the - * responses. - * - * The returned object has 'end' method when no more elements are required. - * - * autoPaginate option will be ignored. + * Lists an organization or source's findings. * - * @see {@link https://nodejs.org/api/stream.html} + * To list across all sources provide a `-` as the source id. + * Example: /v1/organizations/{organization_id}/sources/-/findings * * @param {Object} request * The request object that will be sent. @@ -2025,7 +2498,7 @@ class SecurityCenterClient { * "organizations/[organization_id]/sources/[source_id]". To list across all * sources provide a source_id of `-`. For example: * organizations/{organization_id}/sources/- - * @param {string} [request.filter] + * @param {string} request.filter * Expression that defines the filter to apply across findings. * The expression is a list of one or more restrictions combined via logical * operators `AND` and `OR`. @@ -2069,7 +2542,7 @@ class SecurityCenterClient { * source_properties: `=`, `:`, `>`, `<`, `>=`, `<=` * * For example, `source_properties.size = 100` is a valid filter string. - * @param {string} [request.orderBy] + * @param {string} request.orderBy * Expression that defines what fields and order to use for sorting. The * string value should follow SQL syntax: comma separated list of fields. For * example: "name,resource_properties.a_property". The default sorting order @@ -2088,14 +2561,12 @@ class SecurityCenterClient { * event_time * source_properties * security_marks.marks - * @param {Object} [request.readTime] + * @param {google.protobuf.Timestamp} request.readTime * Time used as a reference point when filtering findings. The filter is * limited to findings existing at the supplied time and their values are * those at that specific time. Absence of this field will default to the * API's version of NOW. - * - * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} - * @param {Object} [request.compareDuration] + * @param {google.protobuf.Duration} request.compareDuration * When compare_duration is set, the ListFindingsResult's "state_change" * attribute is updated to indicate whether the finding had its state changed, * the finding's state remained unchanged, or if the finding was added in any @@ -2120,158 +2591,78 @@ class SecurityCenterClient { * If compare_duration is not specified, then the only possible state_change * is "UNUSED", which will be the state_change set for all findings present at * read_time. - * - * This object should have the same structure as [Duration]{@link google.protobuf.Duration} - * @param {Object} [request.fieldMask] + * @param {google.protobuf.FieldMask} [request.fieldMask] * Optional. A field mask to specify the Finding fields to be listed in the response. * An empty field mask will list all fields. - * - * This object should have the same structure as [FieldMask]{@link google.protobuf.FieldMask} - * @param {number} [request.pageSize] - * The maximum number of resources contained in the underlying API - * response. If page streaming is performed per-resource, this - * parameter does not affect the return value. If page streaming is - * performed per-page, this determines the maximum number of - * resources in a page. - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @returns {Stream} - * An object stream which emits an object representing [ListFindingsResult]{@link google.cloud.securitycenter.v1.ListFindingsResult} on 'data' event. - * - * @example - * - * const securityCenter = require('@google-cloud/security-center'); - * - * const client = new securityCenter.v1.SecurityCenterClient({ - * // optional auth parameters. - * }); - * - * const formattedParent = client.sourcePath('[ORGANIZATION]', '[SOURCE]'); - * client.listFindingsStream({parent: formattedParent}) - * .on('data', element => { - * // doThingsWith(element) - * }).on('error', err => { - * console.log(err); - * }); - */ - listFindingsStream(request, options) { - options = options || {}; - - return this._descriptors.page.listFindings.createStream( - this._innerApiCalls.listFindings, - request, - options - ); - } - - /** - * Lists all sources belonging to an organization. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Resource name of the parent of sources to list. Its format should be - * "organizations/[organization_id]". - * @param {number} [request.pageSize] - * The maximum number of resources contained in the underlying API - * response. If page streaming is performed per-resource, this - * parameter does not affect the return value. If page streaming is - * performed per-page, this determines the maximum number of - * resources in a page. - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Array, ?Object, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is Array of [Source]{@link google.cloud.securitycenter.v1.Source}. - * - * When autoPaginate: false is specified through options, it contains the result - * in a single response. If the response indicates the next page exists, the third - * parameter is set to be used for the next request object. The fourth parameter keeps - * the raw response object of an object representing [ListSourcesResponse]{@link google.cloud.securitycenter.v1.ListSourcesResponse}. + * @param {string} request.pageToken + * The value returned by the last `ListFindingsResponse`; indicates + * that this is a continuation of a prior `ListFindings` call, and + * that the system should return the next page of data. + * @param {number} request.pageSize + * The maximum number of results to return in a single response. Default is + * 10, minimum is 1, maximum is 1000. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of [Source]{@link google.cloud.securitycenter.v1.Source}. + * The first element of the array is Array of [ListFindingsResult]{@link google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult}. + * The client library support auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. * * When autoPaginate: false is specified through options, the array has three elements. - * The first element is Array of [Source]{@link google.cloud.securitycenter.v1.Source} in a single response. - * The second element is the next request object if the response - * indicates the next page exists, or null. The third element is - * an object representing [ListSourcesResponse]{@link google.cloud.securitycenter.v1.ListSourcesResponse}. + * The first element is Array of [ListFindingsResult]{@link google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult} that corresponds to + * the one page received from the API server. + * If the second element is not null it contains the request object of type [ListFindingsRequest]{@link google.cloud.securitycenter.v1.ListFindingsRequest} + * that can be used to obtain the next page of the results. + * If it is null, the next page does not exist. + * The third element contains the raw response received from the API server. Its type is + * [ListFindingsResponse]{@link google.cloud.securitycenter.v1.ListFindingsResponse}. * * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const securityCenter = require('@google-cloud/security-center'); - * - * const client = new securityCenter.v1.SecurityCenterClient({ - * // optional auth parameters. - * }); - * - * // Iterate over all elements. - * const formattedParent = client.organizationPath('[ORGANIZATION]'); - * - * client.listSources({parent: formattedParent}) - * .then(responses => { - * const resources = responses[0]; - * for (const resource of resources) { - * // doThingsWith(resource) - * } - * }) - * .catch(err => { - * console.error(err); - * }); - * - * // Or obtain the paged response. - * const formattedParent = client.organizationPath('[ORGANIZATION]'); - * - * - * const options = {autoPaginate: false}; - * const callback = responses => { - * // The actual resources in a response. - * const resources = responses[0]; - * // The next request if the response shows that there are more responses. - * const nextRequest = responses[1]; - * // The actual response object, if necessary. - * // const rawResponse = responses[2]; - * for (const resource of resources) { - * // doThingsWith(resource); - * } - * if (nextRequest) { - * // Fetch the next page. - * return client.listSources(nextRequest, options).then(callback); - * } - * } - * client.listSources({parent: formattedParent}, options) - * .then(callback) - * .catch(err => { - * console.error(err); - * }); */ - listSources(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; + listFindings( + request: protosTypes.google.cloud.securitycenter.v1.IListFindingsRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.cloud.securitycenter.v1.ListFindingsResponse.IListFindingsResult[], + protosTypes.google.cloud.securitycenter.v1.IListFindingsRequest | null, + protosTypes.google.cloud.securitycenter.v1.IListFindingsResponse + >, + callback?: Callback< + protosTypes.google.cloud.securitycenter.v1.ListFindingsResponse.IListFindingsResult[], + protosTypes.google.cloud.securitycenter.v1.IListFindingsRequest | null, + protosTypes.google.cloud.securitycenter.v1.IListFindingsResponse + > + ): Promise< + [ + protosTypes.google.cloud.securitycenter.v1.ListFindingsResponse.IListFindingsResult[], + protosTypes.google.cloud.securitycenter.v1.IListFindingsRequest | null, + protosTypes.google.cloud.securitycenter.v1.IListFindingsResponse + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; } - request = request || {}; options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers[ 'x-goog-request-params' ] = gax.routingHeader.fromParams({ - parent: request.parent, + parent: request.parent || '', }); - - return this._innerApiCalls.listSources(request, options, callback); + return this._innerApiCalls.listFindings(request, options, callback); } /** - * Equivalent to {@link listSources}, but returns a NodeJS Stream object. + * Equivalent to {@link listFindings}, but returns a NodeJS Stream object. * - * This fetches the paged responses for {@link listSources} continuously + * This fetches the paged responses for {@link listFindings} continuously * and invokes the callback registered for 'data' event for each element in the * responses. * @@ -2284,919 +2675,559 @@ class SecurityCenterClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. Resource name of the parent of sources to list. Its format should be - * "organizations/[organization_id]". - * @param {number} [request.pageSize] - * The maximum number of resources contained in the underlying API - * response. If page streaming is performed per-resource, this - * parameter does not affect the return value. If page streaming is - * performed per-page, this determines the maximum number of - * resources in a page. - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @returns {Stream} - * An object stream which emits an object representing [Source]{@link google.cloud.securitycenter.v1.Source} on 'data' event. - * - * @example - * - * const securityCenter = require('@google-cloud/security-center'); - * - * const client = new securityCenter.v1.SecurityCenterClient({ - * // optional auth parameters. - * }); - * - * const formattedParent = client.organizationPath('[ORGANIZATION]'); - * client.listSourcesStream({parent: formattedParent}) - * .on('data', element => { - * // doThingsWith(element) - * }).on('error', err => { - * console.log(err); - * }); - */ - listSourcesStream(request, options) { - options = options || {}; - - return this._descriptors.page.listSources.createStream( - this._innerApiCalls.listSources, - request, - options - ); - } - - /** - * Runs asset discovery. The discovery is tracked with a long-running - * operation. - * - * This API can only be called with limited frequency for an organization. If - * it is called too frequently the caller will receive a TOO_MANY_REQUESTS - * error. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Name of the organization to run asset discovery for. Its format is - * "organizations/[organization_id]". - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is a [gax.Operation]{@link https://googleapis.github.io/gax-nodejs/classes/Operation.html} object. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is a [gax.Operation]{@link https://googleapis.github.io/gax-nodejs/classes/Operation.html} object. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const securityCenter = require('@google-cloud/security-center'); - * - * const client = new securityCenter.v1.SecurityCenterClient({ - * // optional auth parameters. - * }); - * - * const formattedParent = client.organizationPath('[ORGANIZATION]'); - * - * // Handle the operation using the promise pattern. - * client.runAssetDiscovery({parent: formattedParent}) - * .then(responses => { - * const [operation, initialApiResponse] = responses; - * - * // Operation#promise starts polling for the completion of the LRO. - * return operation.promise(); - * }) - * .then(responses => { - * const result = responses[0]; - * const metadata = responses[1]; - * const finalApiResponse = responses[2]; - * }) - * .catch(err => { - * console.error(err); - * }); - * - * const formattedParent = client.organizationPath('[ORGANIZATION]'); - * - * // Handle the operation using the event emitter pattern. - * client.runAssetDiscovery({parent: formattedParent}) - * .then(responses => { - * const [operation, initialApiResponse] = responses; - * - * // Adding a listener for the "complete" event starts polling for the - * // completion of the operation. - * operation.on('complete', (result, metadata, finalApiResponse) => { - * // doSomethingWith(result); - * }); - * - * // Adding a listener for the "progress" event causes the callback to be - * // called on any change in metadata when the operation is polled. - * operation.on('progress', (metadata, apiResponse) => { - * // doSomethingWith(metadata) - * }); - * - * // Adding a listener for the "error" event handles any errors found during polling. - * operation.on('error', err => { - * // throw(err); - * }); - * }) - * .catch(err => { - * console.error(err); - * }); - * - * const formattedParent = client.organizationPath('[ORGANIZATION]'); - * - * // Handle the operation using the await pattern. - * const [operation] = await client.runAssetDiscovery({parent: formattedParent}); - * - * const [response] = await operation.promise(); - */ - runAssetDiscovery(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent, - }); - - return this._innerApiCalls.runAssetDiscovery(request, options, callback); - } - - /** - * Updates the state of a finding. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The relative resource name of the finding. See: - * https://cloud.google.com/apis/design/resource_names#relative_resource_name - * Example: - * "organizations/{organization_id}/sources/{source_id}/finding/{finding_id}". - * @param {number} request.state - * Required. The desired State of the finding. - * - * The number should be among the values of [State]{@link google.cloud.securitycenter.v1.State} - * @param {Object} request.startTime - * Required. The time at which the updated state takes effect. - * - * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [Finding]{@link google.cloud.securitycenter.v1.Finding}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Finding]{@link google.cloud.securitycenter.v1.Finding}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const securityCenter = require('@google-cloud/security-center'); - * - * const client = new securityCenter.v1.SecurityCenterClient({ - * // optional auth parameters. - * }); - * - * const formattedName = client.findingPath('[ORGANIZATION]', '[SOURCE]', '[FINDING]'); - * const state = 'STATE_UNSPECIFIED'; - * const startTime = {}; - * const request = { - * name: formattedName, - * state: state, - * startTime: startTime, - * }; - * client.setFindingState(request) - * .then(responses => { - * const response = responses[0]; - * // doThingsWith(response) - * }) - * .catch(err => { - * console.error(err); - * }); - */ - setFindingState(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - name: request.name, - }); - - return this._innerApiCalls.setFindingState(request, options, callback); - } - - /** - * Sets the access control policy on the specified Source. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy is being specified. - * See the operation documentation for the appropriate value for this field. - * @param {Object} request.policy - * REQUIRED: The complete policy to be applied to the `resource`. The size of - * the policy is limited to a few 10s of KB. An empty policy is a - * valid policy but certain Cloud Platform services (such as Projects) - * might reject them. - * - * This object should have the same structure as [Policy]{@link google.iam.v1.Policy} - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [Policy]{@link google.iam.v1.Policy}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Policy]{@link google.iam.v1.Policy}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const securityCenter = require('@google-cloud/security-center'); - * - * const client = new securityCenter.v1.SecurityCenterClient({ - * // optional auth parameters. - * }); - * - * const formattedResource = client.sourcePath('[ORGANIZATION]', '[SOURCE]'); - * const policy = {}; - * const request = { - * resource: formattedResource, - * policy: policy, - * }; - * client.setIamPolicy(request) - * .then(responses => { - * const response = responses[0]; - * // doThingsWith(response) - * }) - * .catch(err => { - * console.error(err); - * }); - */ - setIamPolicy(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - resource: request.resource, - }); - - return this._innerApiCalls.setIamPolicy(request, options, callback); - } - - /** - * Returns the permissions that a caller has on the specified source. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy detail is being requested. - * See the operation documentation for the appropriate value for this field. - * @param {string[]} request.permissions - * The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For more - * information see - * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const securityCenter = require('@google-cloud/security-center'); - * - * const client = new securityCenter.v1.SecurityCenterClient({ - * // optional auth parameters. - * }); - * - * const formattedResource = client.sourcePath('[ORGANIZATION]', '[SOURCE]'); - * const permissions = []; - * const request = { - * resource: formattedResource, - * permissions: permissions, - * }; - * client.testIamPermissions(request) - * .then(responses => { - * const response = responses[0]; - * // doThingsWith(response) - * }) - * .catch(err => { - * console.error(err); - * }); - */ - testIamPermissions(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - resource: request.resource, - }); - - return this._innerApiCalls.testIamPermissions(request, options, callback); - } - - /** - * Creates or updates a finding. The corresponding source must exist for a - * finding creation to succeed. - * - * @param {Object} request - * The request object that will be sent. - * @param {Object} request.finding - * Required. The finding resource to update or create if it does not already exist. - * parent, security_marks, and update_time will be ignored. - * - * In the case of creation, the finding id portion of the name must be - * alphanumeric and less than or equal to 32 characters and greater than 0 - * characters in length. - * - * This object should have the same structure as [Finding]{@link google.cloud.securitycenter.v1.Finding} - * @param {Object} [request.updateMask] - * The FieldMask to use when updating the finding resource. This field should - * not be specified when creating a finding. + * Required. Name of the source the findings belong to. Its format is + * "organizations/[organization_id]/sources/[source_id]". To list across all + * sources provide a source_id of `-`. For example: + * organizations/{organization_id}/sources/- + * @param {string} request.filter + * Expression that defines the filter to apply across findings. + * The expression is a list of one or more restrictions combined via logical + * operators `AND` and `OR`. + * Parentheses are supported, and `OR` has higher precedence than `AND`. * - * When updating a finding, an empty mask is treated as updating all mutable - * fields and replacing source_properties. Individual source_properties can - * be added/updated by using "source_properties." in the field - * mask. + * Restrictions have the form ` ` and may have a `-` + * character in front of them to indicate negation. Examples include: * - * This object should have the same structure as [FieldMask]{@link google.protobuf.FieldMask} - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. + * * name + * * source_properties.a_property + * * security_marks.marks.marka * - * The second parameter to the callback is an object representing [Finding]{@link google.cloud.securitycenter.v1.Finding}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Finding]{@link google.cloud.securitycenter.v1.Finding}. - * The promise has a method named "cancel" which cancels the ongoing API call. + * The supported operators are: * - * @example + * * `=` for all value types. + * * `>`, `<`, `>=`, `<=` for integer values. + * * `:`, meaning substring matching, for strings. * - * const securityCenter = require('@google-cloud/security-center'); + * The supported value types are: * - * const client = new securityCenter.v1.SecurityCenterClient({ - * // optional auth parameters. - * }); + * * string literals in quotes. + * * integer literals without quotes. + * * boolean literals `true` and `false` without quotes. * - * const finding = {}; - * client.updateFinding({finding: finding}) - * .then(responses => { - * const response = responses[0]; - * // doThingsWith(response) - * }) - * .catch(err => { - * console.error(err); - * }); - */ - updateFinding(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'finding.name': request.finding.name, - }); - - return this._innerApiCalls.updateFinding(request, options, callback); - } - - /** - * Updates an organization's settings. + * The following field and operator combinations are supported: * - * @param {Object} request - * The request object that will be sent. - * @param {Object} request.organizationSettings - * Required. The organization settings resource to update. + * name: `=` + * parent: `=`, `:` + * resource_name: `=`, `:` + * state: `=`, `:` + * category: `=`, `:` + * external_uri: `=`, `:` + * event_time: `=`, `>`, `<`, `>=`, `<=` * - * This object should have the same structure as [OrganizationSettings]{@link google.cloud.securitycenter.v1.OrganizationSettings} - * @param {Object} [request.updateMask] - * The FieldMask to use when updating the settings resource. + * Usage: This should be milliseconds since epoch or an RFC3339 string. + * Examples: + * "event_time = \"2019-06-10T16:07:18-07:00\"" + * "event_time = 1560208038000" * - * If empty all mutable fields will be updated. + * security_marks.marks: `=`, `:` + * source_properties: `=`, `:`, `>`, `<`, `>=`, `<=` * - * This object should have the same structure as [FieldMask]{@link google.protobuf.FieldMask} - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. + * For example, `source_properties.size = 100` is a valid filter string. + * @param {string} request.orderBy + * Expression that defines what fields and order to use for sorting. The + * string value should follow SQL syntax: comma separated list of fields. For + * example: "name,resource_properties.a_property". The default sorting order + * is ascending. To specify descending order for a field, a suffix " desc" + * should be appended to the field name. For example: "name + * desc,source_properties.a_property". Redundant space characters in the + * syntax are insignificant. "name desc,source_properties.a_property" and " + * name desc , source_properties.a_property " are equivalent. * - * The second parameter to the callback is an object representing [OrganizationSettings]{@link google.cloud.securitycenter.v1.OrganizationSettings}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [OrganizationSettings]{@link google.cloud.securitycenter.v1.OrganizationSettings}. - * The promise has a method named "cancel" which cancels the ongoing API call. + * The following fields are supported: + * name + * parent + * state + * category + * resource_name + * event_time + * source_properties + * security_marks.marks + * @param {google.protobuf.Timestamp} request.readTime + * Time used as a reference point when filtering findings. The filter is + * limited to findings existing at the supplied time and their values are + * those at that specific time. Absence of this field will default to the + * API's version of NOW. + * @param {google.protobuf.Duration} request.compareDuration + * When compare_duration is set, the ListFindingsResult's "state_change" + * attribute is updated to indicate whether the finding had its state changed, + * the finding's state remained unchanged, or if the finding was added in any + * state during the compare_duration period of time that precedes the + * read_time. This is the time between (read_time - compare_duration) and + * read_time. * - * @example + * The state_change value is derived based on the presence and state of the + * finding at the two points in time. Intermediate state changes between the + * two times don't affect the result. For example, the results aren't affected + * if the finding is made inactive and then active again. * - * const securityCenter = require('@google-cloud/security-center'); + * Possible "state_change" values when compare_duration is specified: * - * const client = new securityCenter.v1.SecurityCenterClient({ - * // optional auth parameters. - * }); + * * "CHANGED": indicates that the finding was present at the start of + * compare_duration, but changed its state at read_time. + * * "UNCHANGED": indicates that the finding was present at the start of + * compare_duration and did not change state at read_time. + * * "ADDED": indicates that the finding was not present at the start + * of compare_duration, but was present at read_time. * - * const organizationSettings = {}; - * client.updateOrganizationSettings({organizationSettings: organizationSettings}) - * .then(responses => { - * const response = responses[0]; - * // doThingsWith(response) - * }) - * .catch(err => { - * console.error(err); - * }); + * If compare_duration is not specified, then the only possible state_change + * is "UNUSED", which will be the state_change set for all findings present at + * read_time. + * @param {google.protobuf.FieldMask} [request.fieldMask] + * Optional. A field mask to specify the Finding fields to be listed in the response. + * An empty field mask will list all fields. + * @param {string} request.pageToken + * The value returned by the last `ListFindingsResponse`; indicates + * that this is a continuation of a prior `ListFindings` call, and + * that the system should return the next page of data. + * @param {number} request.pageSize + * The maximum number of results to return in a single response. Default is + * 10, minimum is 1, maximum is 1000. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [ListFindingsResult]{@link google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult} on 'data' event. */ - updateOrganizationSettings(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } + listFindingsStream( + request?: protosTypes.google.cloud.securitycenter.v1.IListFindingsRequest, + options?: gax.CallOptions | {} + ): Transform { request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'organization_settings.name': request.organizationSettings.name, - }); - - return this._innerApiCalls.updateOrganizationSettings( + const callSettings = new gax.CallSettings(options); + return this._descriptors.page.listFindings.createStream( + this._innerApiCalls.listFindings as gax.GaxCall, request, - options, - callback + callSettings ); } - + listSources( + request: protosTypes.google.cloud.securitycenter.v1.IListSourcesRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.cloud.securitycenter.v1.ISource[], + protosTypes.google.cloud.securitycenter.v1.IListSourcesRequest | null, + protosTypes.google.cloud.securitycenter.v1.IListSourcesResponse + ] + >; + listSources( + request: protosTypes.google.cloud.securitycenter.v1.IListSourcesRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.cloud.securitycenter.v1.ISource[], + protosTypes.google.cloud.securitycenter.v1.IListSourcesRequest | null, + protosTypes.google.cloud.securitycenter.v1.IListSourcesResponse + > + ): void; /** - * Updates a source. + * Lists all sources belonging to an organization. * * @param {Object} request * The request object that will be sent. - * @param {Object} request.source - * Required. The source resource to update. - * - * This object should have the same structure as [Source]{@link google.cloud.securitycenter.v1.Source} - * @param {Object} [request.updateMask] - * The FieldMask to use when updating the source resource. - * - * If empty all mutable fields will be updated. - * - * This object should have the same structure as [FieldMask]{@link google.protobuf.FieldMask} - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [Source]{@link google.cloud.securitycenter.v1.Source}. + * @param {string} request.parent + * Required. Resource name of the parent of sources to list. Its format should be + * "organizations/[organization_id]". + * @param {string} request.pageToken + * The value returned by the last `ListSourcesResponse`; indicates + * that this is a continuation of a prior `ListSources` call, and + * that the system should return the next page of data. + * @param {number} request.pageSize + * The maximum number of results to return in a single response. Default is + * 10, minimum is 1, maximum is 1000. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Source]{@link google.cloud.securitycenter.v1.Source}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const securityCenter = require('@google-cloud/security-center'); + * The first element of the array is Array of [Source]{@link google.cloud.securitycenter.v1.Source}. + * The client library support auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. * - * const client = new securityCenter.v1.SecurityCenterClient({ - * // optional auth parameters. - * }); + * When autoPaginate: false is specified through options, the array has three elements. + * The first element is Array of [Source]{@link google.cloud.securitycenter.v1.Source} that corresponds to + * the one page received from the API server. + * If the second element is not null it contains the request object of type [ListSourcesRequest]{@link google.cloud.securitycenter.v1.ListSourcesRequest} + * that can be used to obtain the next page of the results. + * If it is null, the next page does not exist. + * The third element contains the raw response received from the API server. Its type is + * [ListSourcesResponse]{@link google.cloud.securitycenter.v1.ListSourcesResponse}. * - * const source = {}; - * client.updateSource({source: source}) - * .then(responses => { - * const response = responses[0]; - * // doThingsWith(response) - * }) - * .catch(err => { - * console.error(err); - * }); + * The promise has a method named "cancel" which cancels the ongoing API call. */ - updateSource(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; + listSources( + request: protosTypes.google.cloud.securitycenter.v1.IListSourcesRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.cloud.securitycenter.v1.ISource[], + protosTypes.google.cloud.securitycenter.v1.IListSourcesRequest | null, + protosTypes.google.cloud.securitycenter.v1.IListSourcesResponse + >, + callback?: Callback< + protosTypes.google.cloud.securitycenter.v1.ISource[], + protosTypes.google.cloud.securitycenter.v1.IListSourcesRequest | null, + protosTypes.google.cloud.securitycenter.v1.IListSourcesResponse + > + ): Promise< + [ + protosTypes.google.cloud.securitycenter.v1.ISource[], + protosTypes.google.cloud.securitycenter.v1.IListSourcesRequest | null, + protosTypes.google.cloud.securitycenter.v1.IListSourcesResponse + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; } - request = request || {}; options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers[ 'x-goog-request-params' ] = gax.routingHeader.fromParams({ - 'source.name': request.source.name, + parent: request.parent || '', }); - - return this._innerApiCalls.updateSource(request, options, callback); + return this._innerApiCalls.listSources(request, options, callback); } /** - * Updates security marks. - * - * @param {Object} request - * The request object that will be sent. - * @param {Object} request.securityMarks - * Required. The security marks resource to update. - * - * This object should have the same structure as [SecurityMarks]{@link google.cloud.securitycenter.v1.SecurityMarks} - * @param {Object} [request.updateMask] - * The FieldMask to use when updating the security marks resource. - * - * The field mask must not contain duplicate fields. - * If empty or set to "marks", all marks will be replaced. Individual - * marks can be updated using "marks.". - * - * This object should have the same structure as [FieldMask]{@link google.protobuf.FieldMask} - * @param {Object} [request.startTime] - * The time at which the updated SecurityMarks take effect. - * If not set uses current server time. Updates will be applied to the - * SecurityMarks that are active immediately preceding this time. - * - * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. + * Equivalent to {@link listSources}, but returns a NodeJS Stream object. * - * The second parameter to the callback is an object representing [SecurityMarks]{@link google.cloud.securitycenter.v1.SecurityMarks}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [SecurityMarks]{@link google.cloud.securitycenter.v1.SecurityMarks}. - * The promise has a method named "cancel" which cancels the ongoing API call. + * This fetches the paged responses for {@link listSources} continuously + * and invokes the callback registered for 'data' event for each element in the + * responses. * - * @example + * The returned object has 'end' method when no more elements are required. * - * const securityCenter = require('@google-cloud/security-center'); + * autoPaginate option will be ignored. * - * const client = new securityCenter.v1.SecurityCenterClient({ - * // optional auth parameters. - * }); + * @see {@link https://nodejs.org/api/stream.html} * - * const securityMarks = {}; - * client.updateSecurityMarks({securityMarks: securityMarks}) - * .then(responses => { - * const response = responses[0]; - * // doThingsWith(response) - * }) - * .catch(err => { - * console.error(err); - * }); + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Resource name of the parent of sources to list. Its format should be + * "organizations/[organization_id]". + * @param {string} request.pageToken + * The value returned by the last `ListSourcesResponse`; indicates + * that this is a continuation of a prior `ListSources` call, and + * that the system should return the next page of data. + * @param {number} request.pageSize + * The maximum number of results to return in a single response. Default is + * 10, minimum is 1, maximum is 1000. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [Source]{@link google.cloud.securitycenter.v1.Source} on 'data' event. */ - updateSecurityMarks(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } + listSourcesStream( + request?: protosTypes.google.cloud.securitycenter.v1.IListSourcesRequest, + options?: gax.CallOptions | {} + ): Transform { request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'security_marks.name': request.securityMarks.name, - }); - - return this._innerApiCalls.updateSecurityMarks(request, options, callback); + const callSettings = new gax.CallSettings(options); + return this._descriptors.page.listSources.createStream( + this._innerApiCalls.listSources as gax.GaxCall, + request, + callSettings + ); } - // -------------------- // -- Path templates -- // -------------------- /** - * Return a fully-qualified asset resource name string. + * Return a fully-qualified organizationAsset resource name string. * - * @param {String} organization - * @param {String} asset - * @returns {String} + * @param {string} organization + * @param {string} asset + * @returns {string} Resource name string. */ - assetPath(organization, asset) { - return this._pathTemplates.assetPathTemplate.render({ - organization: organization, - asset: asset, + organizationAssetPath(organization: string, asset: string) { + return this._pathTemplates.organizationAssetPathTemplate.render({ + organization, + asset, }); } /** - * Return a fully-qualified asset_security_marks resource name string. + * Parse the organization from OrganizationAsset resource. * - * @param {String} organization - * @param {String} asset - * @returns {String} + * @param {string} organizationAssetName + * A fully-qualified path representing organization_asset resource. + * @returns {string} A string representing the organization. */ - assetSecurityMarksPath(organization, asset) { - return this._pathTemplates.assetSecurityMarksPathTemplate.render({ - organization: organization, - asset: asset, - }); + matchOrganizationFromOrganizationAssetName(organizationAssetName: string) { + return this._pathTemplates.organizationAssetPathTemplate.match( + organizationAssetName + ).organization; } /** - * Return a fully-qualified finding resource name string. + * Parse the asset from OrganizationAsset resource. * - * @param {String} organization - * @param {String} source - * @param {String} finding - * @returns {String} + * @param {string} organizationAssetName + * A fully-qualified path representing organization_asset resource. + * @returns {string} A string representing the asset. */ - findingPath(organization, source, finding) { - return this._pathTemplates.findingPathTemplate.render({ - organization: organization, - source: source, - finding: finding, - }); + matchAssetFromOrganizationAssetName(organizationAssetName: string) { + return this._pathTemplates.organizationAssetPathTemplate.match( + organizationAssetName + ).asset; } /** - * Return a fully-qualified finding_security_marks resource name string. + * Return a fully-qualified organizationSourceFinding resource name string. * - * @param {String} organization - * @param {String} source - * @param {String} finding - * @returns {String} + * @param {string} organization + * @param {string} source + * @param {string} finding + * @returns {string} Resource name string. */ - findingSecurityMarksPath(organization, source, finding) { - return this._pathTemplates.findingSecurityMarksPathTemplate.render({ - organization: organization, - source: source, - finding: finding, + organizationSourceFindingPath( + organization: string, + source: string, + finding: string + ) { + return this._pathTemplates.organizationSourceFindingPathTemplate.render({ + organization, + source, + finding, }); } /** - * Return a fully-qualified organization resource name string. + * Parse the organization from OrganizationSourceFinding resource. * - * @param {String} organization - * @returns {String} + * @param {string} organizationSourceFindingName + * A fully-qualified path representing organization_source_finding resource. + * @returns {string} A string representing the organization. */ - organizationPath(organization) { - return this._pathTemplates.organizationPathTemplate.render({ - organization: organization, - }); + matchOrganizationFromOrganizationSourceFindingName( + organizationSourceFindingName: string + ) { + return this._pathTemplates.organizationSourceFindingPathTemplate.match( + organizationSourceFindingName + ).organization; } /** - * Return a fully-qualified organization_settings resource name string. + * Parse the source from OrganizationSourceFinding resource. * - * @param {String} organization - * @returns {String} + * @param {string} organizationSourceFindingName + * A fully-qualified path representing organization_source_finding resource. + * @returns {string} A string representing the source. */ - organizationSettingsPath(organization) { - return this._pathTemplates.organizationSettingsPathTemplate.render({ - organization: organization, - }); + matchSourceFromOrganizationSourceFindingName( + organizationSourceFindingName: string + ) { + return this._pathTemplates.organizationSourceFindingPathTemplate.match( + organizationSourceFindingName + ).source; } /** - * Return a fully-qualified organization_sources resource name string. + * Parse the finding from OrganizationSourceFinding resource. * - * @param {String} organization - * @returns {String} + * @param {string} organizationSourceFindingName + * A fully-qualified path representing organization_source_finding resource. + * @returns {string} A string representing the finding. */ - organizationSourcesPath(organization) { - return this._pathTemplates.organizationSourcesPathTemplate.render({ - organization: organization, - }); + matchFindingFromOrganizationSourceFindingName( + organizationSourceFindingName: string + ) { + return this._pathTemplates.organizationSourceFindingPathTemplate.match( + organizationSourceFindingName + ).finding; } /** - * Return a fully-qualified source resource name string. + * Return a fully-qualified finding resource name string. * - * @param {String} organization - * @param {String} source - * @returns {String} + * @param {string} organization + * @param {string} source + * @param {string} finding + * @returns {string} Resource name string. */ - sourcePath(organization, source) { - return this._pathTemplates.sourcePathTemplate.render({ - organization: organization, - source: source, + findingPath(organization: string, source: string, finding: string) { + return this._pathTemplates.findingPathTemplate.render({ + organization, + source, + finding, }); } /** - * Parse the assetName from a asset resource. + * Parse the organization from Finding resource. * - * @param {String} assetName - * A fully-qualified path representing a asset resources. - * @returns {String} - A string representing the organization. + * @param {string} findingName + * A fully-qualified path representing Finding resource. + * @returns {string} A string representing the organization. */ - matchOrganizationFromAssetName(assetName) { - return this._pathTemplates.assetPathTemplate.match(assetName).organization; + matchOrganizationFromFindingName(findingName: string) { + return this._pathTemplates.findingPathTemplate.match(findingName) + .organization; } /** - * Parse the assetName from a asset resource. + * Parse the source from Finding resource. * - * @param {String} assetName - * A fully-qualified path representing a asset resources. - * @returns {String} - A string representing the asset. + * @param {string} findingName + * A fully-qualified path representing Finding resource. + * @returns {string} A string representing the source. */ - matchAssetFromAssetName(assetName) { - return this._pathTemplates.assetPathTemplate.match(assetName).asset; + matchSourceFromFindingName(findingName: string) { + return this._pathTemplates.findingPathTemplate.match(findingName).source; } /** - * Parse the assetSecurityMarksName from a asset_security_marks resource. + * Parse the finding from Finding resource. * - * @param {String} assetSecurityMarksName - * A fully-qualified path representing a asset_security_marks resources. - * @returns {String} - A string representing the organization. + * @param {string} findingName + * A fully-qualified path representing Finding resource. + * @returns {string} A string representing the finding. */ - matchOrganizationFromAssetSecurityMarksName(assetSecurityMarksName) { - return this._pathTemplates.assetSecurityMarksPathTemplate.match( - assetSecurityMarksName - ).organization; + matchFindingFromFindingName(findingName: string) { + return this._pathTemplates.findingPathTemplate.match(findingName).finding; } /** - * Parse the assetSecurityMarksName from a asset_security_marks resource. + * Return a fully-qualified source resource name string. * - * @param {String} assetSecurityMarksName - * A fully-qualified path representing a asset_security_marks resources. - * @returns {String} - A string representing the asset. + * @param {string} organization + * @param {string} source + * @returns {string} Resource name string. */ - matchAssetFromAssetSecurityMarksName(assetSecurityMarksName) { - return this._pathTemplates.assetSecurityMarksPathTemplate.match( - assetSecurityMarksName - ).asset; + sourcePath(organization: string, source: string) { + return this._pathTemplates.sourcePathTemplate.render({ + organization, + source, + }); } /** - * Parse the findingName from a finding resource. + * Parse the organization from Source resource. * - * @param {String} findingName - * A fully-qualified path representing a finding resources. - * @returns {String} - A string representing the organization. + * @param {string} sourceName + * A fully-qualified path representing Source resource. + * @returns {string} A string representing the organization. */ - matchOrganizationFromFindingName(findingName) { - return this._pathTemplates.findingPathTemplate.match(findingName) + matchOrganizationFromSourceName(sourceName: string) { + return this._pathTemplates.sourcePathTemplate.match(sourceName) .organization; } /** - * Parse the findingName from a finding resource. - * - * @param {String} findingName - * A fully-qualified path representing a finding resources. - * @returns {String} - A string representing the source. - */ - matchSourceFromFindingName(findingName) { - return this._pathTemplates.findingPathTemplate.match(findingName).source; - } - - /** - * Parse the findingName from a finding resource. + * Parse the source from Source resource. * - * @param {String} findingName - * A fully-qualified path representing a finding resources. - * @returns {String} - A string representing the finding. + * @param {string} sourceName + * A fully-qualified path representing Source resource. + * @returns {string} A string representing the source. */ - matchFindingFromFindingName(findingName) { - return this._pathTemplates.findingPathTemplate.match(findingName).finding; + matchSourceFromSourceName(sourceName: string) { + return this._pathTemplates.sourcePathTemplate.match(sourceName).source; } /** - * Parse the findingSecurityMarksName from a finding_security_marks resource. + * Return a fully-qualified asset resource name string. * - * @param {String} findingSecurityMarksName - * A fully-qualified path representing a finding_security_marks resources. - * @returns {String} - A string representing the organization. + * @param {string} organization + * @param {string} asset + * @returns {string} Resource name string. */ - matchOrganizationFromFindingSecurityMarksName(findingSecurityMarksName) { - return this._pathTemplates.findingSecurityMarksPathTemplate.match( - findingSecurityMarksName - ).organization; + assetPath(organization: string, asset: string) { + return this._pathTemplates.assetPathTemplate.render({ + organization, + asset, + }); } /** - * Parse the findingSecurityMarksName from a finding_security_marks resource. + * Parse the organization from Asset resource. * - * @param {String} findingSecurityMarksName - * A fully-qualified path representing a finding_security_marks resources. - * @returns {String} - A string representing the source. + * @param {string} assetName + * A fully-qualified path representing Asset resource. + * @returns {string} A string representing the organization. */ - matchSourceFromFindingSecurityMarksName(findingSecurityMarksName) { - return this._pathTemplates.findingSecurityMarksPathTemplate.match( - findingSecurityMarksName - ).source; + matchOrganizationFromAssetName(assetName: string) { + return this._pathTemplates.assetPathTemplate.match(assetName).organization; } /** - * Parse the findingSecurityMarksName from a finding_security_marks resource. + * Parse the asset from Asset resource. * - * @param {String} findingSecurityMarksName - * A fully-qualified path representing a finding_security_marks resources. - * @returns {String} - A string representing the finding. + * @param {string} assetName + * A fully-qualified path representing Asset resource. + * @returns {string} A string representing the asset. */ - matchFindingFromFindingSecurityMarksName(findingSecurityMarksName) { - return this._pathTemplates.findingSecurityMarksPathTemplate.match( - findingSecurityMarksName - ).finding; + matchAssetFromAssetName(assetName: string) { + return this._pathTemplates.assetPathTemplate.match(assetName).asset; } /** - * Parse the organizationName from a organization resource. + * Return a fully-qualified organizationSettings resource name string. * - * @param {String} organizationName - * A fully-qualified path representing a organization resources. - * @returns {String} - A string representing the organization. + * @param {string} organization + * @returns {string} Resource name string. */ - matchOrganizationFromOrganizationName(organizationName) { - return this._pathTemplates.organizationPathTemplate.match(organizationName) - .organization; + organizationSettingsPath(organization: string) { + return this._pathTemplates.organizationSettingsPathTemplate.render({ + organization, + }); } /** - * Parse the organizationSettingsName from a organization_settings resource. + * Parse the organization from OrganizationSettings resource. * - * @param {String} organizationSettingsName - * A fully-qualified path representing a organization_settings resources. - * @returns {String} - A string representing the organization. + * @param {string} organizationSettingsName + * A fully-qualified path representing OrganizationSettings resource. + * @returns {string} A string representing the organization. */ - matchOrganizationFromOrganizationSettingsName(organizationSettingsName) { + matchOrganizationFromOrganizationSettingsName( + organizationSettingsName: string + ) { return this._pathTemplates.organizationSettingsPathTemplate.match( organizationSettingsName ).organization; } /** - * Parse the organizationSourcesName from a organization_sources resource. + * Return a fully-qualified organization resource name string. * - * @param {String} organizationSourcesName - * A fully-qualified path representing a organization_sources resources. - * @returns {String} - A string representing the organization. + * @param {string} organization + * @returns {string} Resource name string. */ - matchOrganizationFromOrganizationSourcesName(organizationSourcesName) { - return this._pathTemplates.organizationSourcesPathTemplate.match( - organizationSourcesName - ).organization; + organizationPath(organization: string) { + return this._pathTemplates.organizationPathTemplate.render({ + organization, + }); } /** - * Parse the sourceName from a source resource. + * Parse the organization from Organization resource. * - * @param {String} sourceName - * A fully-qualified path representing a source resources. - * @returns {String} - A string representing the organization. + * @param {string} organizationName + * A fully-qualified path representing Organization resource. + * @returns {string} A string representing the organization. */ - matchOrganizationFromSourceName(sourceName) { - return this._pathTemplates.sourcePathTemplate.match(sourceName) + matchOrganizationFromOrganizationName(organizationName: string) { + return this._pathTemplates.organizationPathTemplate.match(organizationName) .organization; } /** - * Parse the sourceName from a source resource. + * Terminate the GRPC channel and close the client. * - * @param {String} sourceName - * A fully-qualified path representing a source resources. - * @returns {String} - A string representing the source. + * The client will no longer be usable and all future behavior is undefined. */ - matchSourceFromSourceName(sourceName) { - return this._pathTemplates.sourcePathTemplate.match(sourceName).source; + close(): Promise { + if (!this._terminated) { + return this.securityCenterStub.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); } } - -module.exports = SecurityCenterClient; diff --git a/packages/google-cloud-securitycenter/src/v1/security_center_client_config.json b/packages/google-cloud-securitycenter/src/v1/security_center_client_config.json index d2419f146a7..3f61d526acc 100644 --- a/packages/google-cloud-securitycenter/src/v1/security_center_client_config.json +++ b/packages/google-cloud-securitycenter/src/v1/security_center_client_config.json @@ -2,111 +2,111 @@ "interfaces": { "google.cloud.securitycenter.v1.SecurityCenter": { "retry_codes": { + "non_idempotent": [], "idempotent": [ "DEADLINE_EXCEEDED", "UNAVAILABLE" - ], - "non_idempotent": [] + ] }, "retry_params": { "default": { "initial_retry_delay_millis": 100, "retry_delay_multiplier": 1.3, "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 480000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 480000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, "total_timeout_millis": 600000 } }, "methods": { "CreateSource": { - "timeout_millis": 60000, + "timeout_millis": 600000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, "CreateFinding": { - "timeout_millis": 60000, + "timeout_millis": 600000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, "GetIamPolicy": { - "timeout_millis": 60000, + "timeout_millis": 600000, "retry_codes_name": "idempotent", "retry_params_name": "default" }, "GetOrganizationSettings": { - "timeout_millis": 60000, + "timeout_millis": 600000, "retry_codes_name": "idempotent", "retry_params_name": "default" }, "GetSource": { - "timeout_millis": 60000, + "timeout_millis": 600000, "retry_codes_name": "idempotent", "retry_params_name": "default" }, "GroupAssets": { - "timeout_millis": 60000, + "timeout_millis": 600000, "retry_codes_name": "idempotent", "retry_params_name": "default" }, "GroupFindings": { - "timeout_millis": 60000, + "timeout_millis": 600000, "retry_codes_name": "idempotent", "retry_params_name": "default" }, "ListAssets": { - "timeout_millis": 60000, + "timeout_millis": 600000, "retry_codes_name": "idempotent", "retry_params_name": "default" }, "ListFindings": { - "timeout_millis": 60000, + "timeout_millis": 600000, "retry_codes_name": "idempotent", "retry_params_name": "default" }, "ListSources": { - "timeout_millis": 60000, + "timeout_millis": 600000, "retry_codes_name": "idempotent", "retry_params_name": "default" }, "RunAssetDiscovery": { - "timeout_millis": 60000, + "timeout_millis": 600000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, "SetFindingState": { - "timeout_millis": 60000, + "timeout_millis": 600000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, "SetIamPolicy": { - "timeout_millis": 60000, + "timeout_millis": 600000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, "TestIamPermissions": { - "timeout_millis": 60000, + "timeout_millis": 600000, "retry_codes_name": "idempotent", "retry_params_name": "default" }, "UpdateFinding": { - "timeout_millis": 60000, + "timeout_millis": 600000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, "UpdateOrganizationSettings": { - "timeout_millis": 60000, + "timeout_millis": 600000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, "UpdateSource": { - "timeout_millis": 60000, + "timeout_millis": 600000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, "UpdateSecurityMarks": { - "timeout_millis": 60000, + "timeout_millis": 600000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" } diff --git a/packages/google-cloud-securitycenter/src/v1/security_center_proto_list.json b/packages/google-cloud-securitycenter/src/v1/security_center_proto_list.json index 684ca569657..37094e069a4 100644 --- a/packages/google-cloud-securitycenter/src/v1/security_center_proto_list.json +++ b/packages/google-cloud-securitycenter/src/v1/security_center_proto_list.json @@ -1,3 +1,9 @@ [ - "../../protos/google/cloud/securitycenter/v1/securitycenter_service.proto" + "../../protos/google/cloud/securitycenter/v1/asset.proto", + "../../protos/google/cloud/securitycenter/v1/finding.proto", + "../../protos/google/cloud/securitycenter/v1/organization_settings.proto", + "../../protos/google/cloud/securitycenter/v1/run_asset_discovery_response.proto", + "../../protos/google/cloud/securitycenter/v1/security_marks.proto", + "../../protos/google/cloud/securitycenter/v1/securitycenter_service.proto", + "../../protos/google/cloud/securitycenter/v1/source.proto" ] diff --git a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_asset.js b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_asset.js deleted file mode 100644 index b4060183881..00000000000 --- a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_asset.js +++ /dev/null @@ -1,99 +0,0 @@ -// 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. - -// Note: this file is purely for documentation. Any contents are not expected -// to be loaded as the JS file. - -/** - * Cloud Security Command Center's (Cloud SCC) representation of a Google Cloud - * Platform (GCP) resource. - * - * The Asset is a Cloud SCC resource that captures information about a single - * GCP resource. All modifications to an Asset are only within the context of - * Cloud SCC and don't affect the referenced GCP resource. - * - * @property {string} name - * The relative resource name of this asset. See: - * https://cloud.google.com/apis/design/resource_names#relative_resource_name - * Example: - * "organizations/{organization_id}/assets/{asset_id}". - * - * @property {Object} securityCenterProperties - * Cloud SCC managed properties. These properties are managed by - * Cloud SCC and cannot be modified by the user. - * - * This object should have the same structure as [SecurityCenterProperties]{@link google.cloud.securitycenter.v1beta1.SecurityCenterProperties} - * - * @property {Object.} resourceProperties - * Resource managed properties. These properties are managed and defined by - * the GCP resource and cannot be modified by the user. - * - * @property {Object} securityMarks - * User specified security marks. These marks are entirely managed by the user - * and come from the SecurityMarks resource that belongs to the asset. - * - * This object should have the same structure as [SecurityMarks]{@link google.cloud.securitycenter.v1beta1.SecurityMarks} - * - * @property {Object} createTime - * The time at which the asset was created in Cloud SCC. - * - * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} - * - * @property {Object} updateTime - * The time at which the asset was last updated, added, or deleted in Cloud - * SCC. - * - * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} - * - * @typedef Asset - * @memberof google.cloud.securitycenter.v1beta1 - * @see [google.cloud.securitycenter.v1beta1.Asset definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/securitycenter/v1beta1/asset.proto} - */ -const Asset = { - // This is for documentation. Actual contents will be loaded by gRPC. - - /** - * Cloud SCC managed properties. These properties are managed by Cloud SCC and - * cannot be modified by the user. - * - * @property {string} resourceName - * Immutable. The full resource name of the GCP resource this asset - * represents. This field is immutable after create time. See: - * https://cloud.google.com/apis/design/resource_names#full_resource_name - * - * @property {string} resourceType - * The type of the GCP resource. Examples include: APPLICATION, - * PROJECT, and ORGANIZATION. This is a case insensitive field defined by - * Cloud SCC and/or the producer of the resource and is immutable - * after create time. - * - * @property {string} resourceParent - * The full resource name of the immediate parent of the resource. See: - * https://cloud.google.com/apis/design/resource_names#full_resource_name - * - * @property {string} resourceProject - * The full resource name of the project the resource belongs to. See: - * https://cloud.google.com/apis/design/resource_names#full_resource_name - * - * @property {string[]} resourceOwners - * Owners of the Google Cloud resource. - * - * @typedef SecurityCenterProperties - * @memberof google.cloud.securitycenter.v1beta1 - * @see [google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/securitycenter/v1beta1/asset.proto} - */ - SecurityCenterProperties: { - // This is for documentation. Actual contents will be loaded by gRPC. - } -}; \ No newline at end of file diff --git a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_finding.js b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_finding.js deleted file mode 100644 index f5ddbd30abe..00000000000 --- a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_finding.js +++ /dev/null @@ -1,118 +0,0 @@ -// 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. - -// Note: this file is purely for documentation. Any contents are not expected -// to be loaded as the JS file. - -/** - * Cloud Security Command Center (Cloud SCC) finding. - * - * A finding is a record of assessment data (security, risk, health or privacy) - * ingested into Cloud SCC for presentation, notification, analysis, - * policy testing, and enforcement. For example, an XSS vulnerability in an - * App Engine application is a finding. - * - * @property {string} name - * The relative resource name of this finding. See: - * https://cloud.google.com/apis/design/resource_names#relative_resource_name - * Example: - * "organizations/{organization_id}/sources/{source_id}/findings/{finding_id}" - * - * @property {string} parent - * Immutable. The relative resource name of the source the finding belongs to. See: - * https://cloud.google.com/apis/design/resource_names#relative_resource_name - * This field is immutable after creation time. - * For example: - * "organizations/{organization_id}/sources/{source_id}" - * - * @property {string} resourceName - * For findings on Google Cloud Platform (GCP) resources, the full resource - * name of the GCP resource this finding is for. See: - * https://cloud.google.com/apis/design/resource_names#full_resource_name - * When the finding is for a non-GCP resource, the resourceName can be a - * customer or partner defined string. - * This field is immutable after creation time. - * - * @property {number} state - * The state of the finding. - * - * The number should be among the values of [State]{@link google.cloud.securitycenter.v1beta1.State} - * - * @property {string} category - * The additional taxonomy group within findings from a given source. - * This field is immutable after creation time. - * Example: "XSS_FLASH_INJECTION" - * - * @property {string} externalUri - * The URI that, if available, points to a web page outside of Cloud SCC - * where additional information about the finding can be found. This field is - * guaranteed to be either empty or a well formed URL. - * - * @property {Object.} sourceProperties - * Source specific properties. These properties are managed by the source - * that writes the finding. The key names in the source_properties map must be - * between 1 and 255 characters, and must start with a letter and contain - * alphanumeric characters or underscores only. - * - * @property {Object} securityMarks - * Output only. User specified security marks. These marks are entirely - * managed by the user and come from the SecurityMarks resource that belongs - * to the finding. - * - * This object should have the same structure as [SecurityMarks]{@link google.cloud.securitycenter.v1beta1.SecurityMarks} - * - * @property {Object} eventTime - * The time at which the event took place. For example, if the finding - * represents an open firewall it would capture the time the detector believes - * the firewall became open. The accuracy is determined by the detector. - * - * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} - * - * @property {Object} createTime - * The time at which the finding was created in Cloud SCC. - * - * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} - * - * @typedef Finding - * @memberof google.cloud.securitycenter.v1beta1 - * @see [google.cloud.securitycenter.v1beta1.Finding definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/securitycenter/v1beta1/finding.proto} - */ -const Finding = { - // This is for documentation. Actual contents will be loaded by gRPC. - - /** - * The state of the finding. - * - * @enum {number} - * @memberof google.cloud.securitycenter.v1beta1 - */ - State: { - - /** - * Unspecified state. - */ - STATE_UNSPECIFIED: 0, - - /** - * The finding requires attention and has not been addressed yet. - */ - ACTIVE: 1, - - /** - * The finding has been fixed, triaged as a non-issue or otherwise addressed - * and is no longer active. - */ - INACTIVE: 2 - } -}; \ No newline at end of file diff --git a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_organization_settings.js b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_organization_settings.js deleted file mode 100644 index 0e44f01785f..00000000000 --- a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_organization_settings.js +++ /dev/null @@ -1,98 +0,0 @@ -// 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. - -// Note: this file is purely for documentation. Any contents are not expected -// to be loaded as the JS file. - -/** - * User specified settings that are attached to the Cloud Security Command - * Center (Cloud SCC) organization. - * - * @property {string} name - * The relative resource name of the settings. See: - * https://cloud.google.com/apis/design/resource_names#relative_resource_name - * Example: - * "organizations/{organization_id}/organizationSettings". - * - * @property {boolean} enableAssetDiscovery - * A flag that indicates if Asset Discovery should be enabled. If the flag is - * set to `true`, then discovery of assets will occur. If it is set to `false, - * all historical assets will remain, but discovery of future assets will not - * occur. - * - * @property {Object} assetDiscoveryConfig - * The configuration used for Asset Discovery runs. - * - * This object should have the same structure as [AssetDiscoveryConfig]{@link google.cloud.securitycenter.v1beta1.AssetDiscoveryConfig} - * - * @typedef OrganizationSettings - * @memberof google.cloud.securitycenter.v1beta1 - * @see [google.cloud.securitycenter.v1beta1.OrganizationSettings definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/securitycenter/v1beta1/organization_settings.proto} - */ -const OrganizationSettings = { - // This is for documentation. Actual contents will be loaded by gRPC. - - /** - * The configuration used for Asset Discovery runs. - * - * @property {string[]} projectIds - * The project ids to use for filtering asset discovery. - * - * @property {number} inclusionMode - * The mode to use for filtering asset discovery. - * - * The number should be among the values of [InclusionMode]{@link google.cloud.securitycenter.v1beta1.InclusionMode} - * - * @typedef AssetDiscoveryConfig - * @memberof google.cloud.securitycenter.v1beta1 - * @see [google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/securitycenter/v1beta1/organization_settings.proto} - */ - AssetDiscoveryConfig: { - // This is for documentation. Actual contents will be loaded by gRPC. - - /** - * The mode of inclusion when running Asset Discovery. - * Asset discovery can be limited by explicitly identifying projects to be - * included or excluded. If INCLUDE_ONLY is set, then only those projects - * within the organization and their children are discovered during asset - * discovery. If EXCLUDE is set, then projects that don't match those - * projects are discovered during asset discovery. If neither are set, then - * all projects within the organization are discovered during asset - * discovery. - * - * @enum {number} - * @memberof google.cloud.securitycenter.v1beta1 - */ - InclusionMode: { - - /** - * Unspecified. Setting the mode with this value will disable - * inclusion/exclusion filtering for Asset Discovery. - */ - INCLUSION_MODE_UNSPECIFIED: 0, - - /** - * Asset Discovery will capture only the resources within the projects - * specified. All other resources will be ignored. - */ - INCLUDE_ONLY: 1, - - /** - * Asset Discovery will ignore all resources under the projects specified. - * All other resources will be retrieved. - */ - EXCLUDE: 2 - } - } -}; \ No newline at end of file diff --git a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_security_marks.js b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_security_marks.js deleted file mode 100644 index 18bac6d990d..00000000000 --- a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_security_marks.js +++ /dev/null @@ -1,47 +0,0 @@ -// 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. - -// Note: this file is purely for documentation. Any contents are not expected -// to be loaded as the JS file. - -/** - * User specified security marks that are attached to the parent Cloud Security - * Command Center (Cloud SCC) resource. Security marks are scoped within a Cloud - * SCC organization -- they can be modified and viewed by all users who have - * proper permissions on the organization. - * - * @property {string} name - * The relative resource name of the SecurityMarks. See: - * https://cloud.google.com/apis/design/resource_names#relative_resource_name - * Examples: - * "organizations/{organization_id}/assets/{asset_id}/securityMarks" - * "organizations/{organization_id}/sources/{source_id}/findings/{finding_id}/securityMarks". - * - * @property {Object.} marks - * Mutable user specified security marks belonging to the parent resource. - * Constraints are as follows: - * - * * Keys and values are treated as case insensitive - * * Keys must be between 1 - 256 characters (inclusive) - * * Keys must be letters, numbers, underscores, or dashes - * * Values have leading and trailing whitespace trimmed, remaining - * characters must be between 1 - 4096 characters (inclusive) - * - * @typedef SecurityMarks - * @memberof google.cloud.securitycenter.v1beta1 - * @see [google.cloud.securitycenter.v1beta1.SecurityMarks definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/securitycenter/v1beta1/security_marks.proto} - */ -const SecurityMarks = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; \ No newline at end of file diff --git a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_securitycenter_service.js b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_securitycenter_service.js deleted file mode 100644 index ba707d7a608..00000000000 --- a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_securitycenter_service.js +++ /dev/null @@ -1,819 +0,0 @@ -// 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. - -// Note: this file is purely for documentation. Any contents are not expected -// to be loaded as the JS file. - -/** - * Request message for creating a finding. - * - * @property {string} parent - * Required. Resource name of the new finding's parent. Its format should be - * "organizations/[organization_id]/sources/[source_id]". - * - * @property {string} findingId - * Required. Unique identifier provided by the client within the parent scope. - * It must be alphanumeric and less than or equal to 32 characters and - * greater than 0 characters in length. - * - * @property {Object} finding - * Required. The Finding being created. The name and security_marks will be ignored as - * they are both output only fields on this resource. - * - * This object should have the same structure as [Finding]{@link google.cloud.securitycenter.v1beta1.Finding} - * - * @typedef CreateFindingRequest - * @memberof google.cloud.securitycenter.v1beta1 - * @see [google.cloud.securitycenter.v1beta1.CreateFindingRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/securitycenter/v1beta1/securitycenter_service.proto} - */ -const CreateFindingRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Request message for creating a source. - * - * @property {string} parent - * Required. Resource name of the new source's parent. Its format should be - * "organizations/[organization_id]". - * - * @property {Object} source - * Required. The Source being created, only the display_name and description will be - * used. All other fields will be ignored. - * - * This object should have the same structure as [Source]{@link google.cloud.securitycenter.v1beta1.Source} - * - * @typedef CreateSourceRequest - * @memberof google.cloud.securitycenter.v1beta1 - * @see [google.cloud.securitycenter.v1beta1.CreateSourceRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/securitycenter/v1beta1/securitycenter_service.proto} - */ -const CreateSourceRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Request message for getting organization settings. - * - * @property {string} name - * Required. Name of the organization to get organization settings for. Its format is - * "organizations/[organization_id]/organizationSettings". - * - * @typedef GetOrganizationSettingsRequest - * @memberof google.cloud.securitycenter.v1beta1 - * @see [google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/securitycenter/v1beta1/securitycenter_service.proto} - */ -const GetOrganizationSettingsRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Request message for getting a source. - * - * @property {string} name - * Required. Relative resource name of the source. Its format is - * "organizations/[organization_id]/source/[source_id]". - * - * @typedef GetSourceRequest - * @memberof google.cloud.securitycenter.v1beta1 - * @see [google.cloud.securitycenter.v1beta1.GetSourceRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/securitycenter/v1beta1/securitycenter_service.proto} - */ -const GetSourceRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Request message for grouping by assets. - * - * @property {string} parent - * Required. Name of the organization to groupBy. Its format is - * "organizations/[organization_id]". - * - * @property {string} filter - * Expression that defines the filter to apply across assets. - * The expression is a list of zero or more restrictions combined via logical - * operators `AND` and `OR`. - * Parentheses are not supported, and `OR` has higher precedence than `AND`. - * - * Restrictions have the form ` ` and may have a `-` - * character in front of them to indicate negation. The fields map to those - * defined in the Asset resource. Examples include: - * - * * name - * * security_center_properties.resource_name - * * resource_properties.a_property - * * security_marks.marks.marka - * - * The supported operators are: - * - * * `=` for all value types. - * * `>`, `<`, `>=`, `<=` for integer values. - * * `:`, meaning substring matching, for strings. - * - * The supported value types are: - * - * * string literals in quotes. - * * integer literals without quotes. - * * boolean literals `true` and `false` without quotes. - * - * For example, `resource_properties.size = 100` is a valid filter string. - * - * @property {string} groupBy - * Required. Expression that defines what assets fields to use for grouping. The string - * value should follow SQL syntax: comma separated list of fields. For - * example: - * "security_center_properties.resource_project,security_center_properties.project". - * - * The following fields are supported when compare_duration is not set: - * - * * security_center_properties.resource_project - * * security_center_properties.resource_type - * * security_center_properties.resource_parent - * - * The following fields are supported when compare_duration is set: - * - * * security_center_properties.resource_type - * - * @property {Object} compareDuration - * When compare_duration is set, the Asset's "state" property is updated to - * indicate whether the asset was added, removed, or remained present during - * the compare_duration period of time that precedes the read_time. This is - * the time between (read_time - compare_duration) and read_time. - * - * The state value is derived based on the presence of the asset at the two - * points in time. Intermediate state changes between the two times don't - * affect the result. For example, the results aren't affected if the asset is - * removed and re-created again. - * - * Possible "state" values when compare_duration is specified: - * - * * "ADDED": indicates that the asset was not present before - * compare_duration, but present at reference_time. - * * "REMOVED": indicates that the asset was present at the start of - * compare_duration, but not present at reference_time. - * * "ACTIVE": indicates that the asset was present at both the - * start and the end of the time period defined by - * compare_duration and reference_time. - * - * This field is ignored if `state` is not a field in `group_by`. - * - * This object should have the same structure as [Duration]{@link google.protobuf.Duration} - * - * @property {Object} readTime - * Time used as a reference point when filtering assets. The filter is limited - * to assets existing at the supplied time and their values are those at that - * specific time. Absence of this field will default to the API's version of - * NOW. - * - * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} - * - * @property {string} pageToken - * The value returned by the last `GroupAssetsResponse`; indicates - * that this is a continuation of a prior `GroupAssets` call, and that the - * system should return the next page of data. - * - * @property {number} pageSize - * The maximum number of results to return in a single response. Default is - * 10, minimum is 1, maximum is 1000. - * - * @typedef GroupAssetsRequest - * @memberof google.cloud.securitycenter.v1beta1 - * @see [google.cloud.securitycenter.v1beta1.GroupAssetsRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/securitycenter/v1beta1/securitycenter_service.proto} - */ -const GroupAssetsRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Response message for grouping by assets. - * - * @property {Object[]} groupByResults - * Group results. There exists an element for each existing unique - * combination of property/values. The element contains a count for the number - * of times those specific property/values appear. - * - * This object should have the same structure as [GroupResult]{@link google.cloud.securitycenter.v1beta1.GroupResult} - * - * @property {Object} readTime - * Time used for executing the groupBy request. - * - * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} - * - * @property {string} nextPageToken - * Token to retrieve the next page of results, or empty if there are no more - * results. - * - * @typedef GroupAssetsResponse - * @memberof google.cloud.securitycenter.v1beta1 - * @see [google.cloud.securitycenter.v1beta1.GroupAssetsResponse definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/securitycenter/v1beta1/securitycenter_service.proto} - */ -const GroupAssetsResponse = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Request message for grouping by findings. - * - * @property {string} parent - * Required. Name of the source to groupBy. Its format is - * "organizations/[organization_id]/sources/[source_id]". To groupBy across - * all sources provide a source_id of `-`. For example: - * organizations/{organization_id}/sources/- - * - * @property {string} filter - * Expression that defines the filter to apply across findings. - * The expression is a list of one or more restrictions combined via logical - * operators `AND` and `OR`. - * Parentheses are not supported, and `OR` has higher precedence than `AND`. - * - * Restrictions have the form ` ` and may have a `-` - * character in front of them to indicate negation. Examples include: - * - * * name - * * source_properties.a_property - * * security_marks.marks.marka - * - * The supported operators are: - * - * * `=` for all value types. - * * `>`, `<`, `>=`, `<=` for integer values. - * * `:`, meaning substring matching, for strings. - * - * The supported value types are: - * - * * string literals in quotes. - * * integer literals without quotes. - * * boolean literals `true` and `false` without quotes. - * - * For example, `source_properties.size = 100` is a valid filter string. - * - * @property {string} groupBy - * Required. Expression that defines what assets fields to use for grouping (including - * `state`). The string value should follow SQL syntax: comma separated list - * of fields. For example: - * "parent,resource_name". - * - * The following fields are supported: - * - * * resource_name - * * category - * * state - * * parent - * - * @property {Object} readTime - * Time used as a reference point when filtering findings. The filter is - * limited to findings existing at the supplied time and their values are - * those at that specific time. Absence of this field will default to the - * API's version of NOW. - * - * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} - * - * @property {string} pageToken - * The value returned by the last `GroupFindingsResponse`; indicates - * that this is a continuation of a prior `GroupFindings` call, and - * that the system should return the next page of data. - * - * @property {number} pageSize - * The maximum number of results to return in a single response. Default is - * 10, minimum is 1, maximum is 1000. - * - * @typedef GroupFindingsRequest - * @memberof google.cloud.securitycenter.v1beta1 - * @see [google.cloud.securitycenter.v1beta1.GroupFindingsRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/securitycenter/v1beta1/securitycenter_service.proto} - */ -const GroupFindingsRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Response message for group by findings. - * - * @property {Object[]} groupByResults - * Group results. There exists an element for each existing unique - * combination of property/values. The element contains a count for the number - * of times those specific property/values appear. - * - * This object should have the same structure as [GroupResult]{@link google.cloud.securitycenter.v1beta1.GroupResult} - * - * @property {Object} readTime - * Time used for executing the groupBy request. - * - * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} - * - * @property {string} nextPageToken - * Token to retrieve the next page of results, or empty if there are no more - * results. - * - * @typedef GroupFindingsResponse - * @memberof google.cloud.securitycenter.v1beta1 - * @see [google.cloud.securitycenter.v1beta1.GroupFindingsResponse definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/securitycenter/v1beta1/securitycenter_service.proto} - */ -const GroupFindingsResponse = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Result containing the properties and count of a groupBy request. - * - * @property {Object.} properties - * Properties matching the groupBy fields in the request. - * - * @property {number} count - * Total count of resources for the given properties. - * - * @typedef GroupResult - * @memberof google.cloud.securitycenter.v1beta1 - * @see [google.cloud.securitycenter.v1beta1.GroupResult definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/securitycenter/v1beta1/securitycenter_service.proto} - */ -const GroupResult = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Request message for listing sources. - * - * @property {string} parent - * Required. Resource name of the parent of sources to list. Its format should be - * "organizations/[organization_id]". - * - * @property {string} pageToken - * The value returned by the last `ListSourcesResponse`; indicates - * that this is a continuation of a prior `ListSources` call, and - * that the system should return the next page of data. - * - * @property {number} pageSize - * The maximum number of results to return in a single response. Default is - * 10, minimum is 1, maximum is 1000. - * - * @typedef ListSourcesRequest - * @memberof google.cloud.securitycenter.v1beta1 - * @see [google.cloud.securitycenter.v1beta1.ListSourcesRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/securitycenter/v1beta1/securitycenter_service.proto} - */ -const ListSourcesRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Response message for listing sources. - * - * @property {Object[]} sources - * Sources belonging to the requested parent. - * - * This object should have the same structure as [Source]{@link google.cloud.securitycenter.v1beta1.Source} - * - * @property {string} nextPageToken - * Token to retrieve the next page of results, or empty if there are no more - * results. - * - * @typedef ListSourcesResponse - * @memberof google.cloud.securitycenter.v1beta1 - * @see [google.cloud.securitycenter.v1beta1.ListSourcesResponse definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/securitycenter/v1beta1/securitycenter_service.proto} - */ -const ListSourcesResponse = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Request message for listing assets. - * - * @property {string} parent - * Required. Name of the organization assets should belong to. Its format is - * "organizations/[organization_id]". - * - * @property {string} filter - * Expression that defines the filter to apply across assets. - * The expression is a list of zero or more restrictions combined via logical - * operators `AND` and `OR`. - * Parentheses are not supported, and `OR` has higher precedence than `AND`. - * - * Restrictions have the form ` ` and may have a `-` - * character in front of them to indicate negation. The fields map to those - * defined in the Asset resource. Examples include: - * - * * name - * * security_center_properties.resource_name - * * resource_properties.a_property - * * security_marks.marks.marka - * - * The supported operators are: - * - * * `=` for all value types. - * * `>`, `<`, `>=`, `<=` for integer values. - * * `:`, meaning substring matching, for strings. - * - * The supported value types are: - * - * * string literals in quotes. - * * integer literals without quotes. - * * boolean literals `true` and `false` without quotes. - * - * For example, `resource_properties.size = 100` is a valid filter string. - * - * @property {string} orderBy - * Expression that defines what fields and order to use for sorting. The - * string value should follow SQL syntax: comma separated list of fields. For - * example: "name,resource_properties.a_property". The default sorting order - * is ascending. To specify descending order for a field, a suffix " desc" - * should be appended to the field name. For example: "name - * desc,resource_properties.a_property". Redundant space characters in the - * syntax are insignificant. "name desc,resource_properties.a_property" and " - * name desc , resource_properties.a_property " are equivalent. - * - * @property {Object} readTime - * Time used as a reference point when filtering assets. The filter is limited - * to assets existing at the supplied time and their values are those at that - * specific time. Absence of this field will default to the API's version of - * NOW. - * - * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} - * - * @property {Object} compareDuration - * When compare_duration is set, the ListAssetResult's "state" attribute is - * updated to indicate whether the asset was added, removed, or remained - * present during the compare_duration period of time that precedes the - * read_time. This is the time between (read_time - - * compare_duration) and read_time. - * - * The state value is derived based on the presence of the asset at the two - * points in time. Intermediate state changes between the two times don't - * affect the result. For example, the results aren't affected if the asset is - * removed and re-created again. - * - * Possible "state" values when compare_duration is specified: - * - * * "ADDED": indicates that the asset was not present before - * compare_duration, but present at read_time. - * * "REMOVED": indicates that the asset was present at the start of - * compare_duration, but not present at read_time. - * * "ACTIVE": indicates that the asset was present at both the - * start and the end of the time period defined by - * compare_duration and read_time. - * - * If compare_duration is not specified, then the only possible state is - * "UNUSED", which indicates that the asset is present at read_time. - * - * This object should have the same structure as [Duration]{@link google.protobuf.Duration} - * - * @property {Object} fieldMask - * Optional. A field mask to specify the ListAssetsResult fields to be listed in the - * response. - * An empty field mask will list all fields. - * - * This object should have the same structure as [FieldMask]{@link google.protobuf.FieldMask} - * - * @property {string} pageToken - * The value returned by the last `ListAssetsResponse`; indicates - * that this is a continuation of a prior `ListAssets` call, and - * that the system should return the next page of data. - * - * @property {number} pageSize - * The maximum number of results to return in a single response. Default is - * 10, minimum is 1, maximum is 1000. - * - * @typedef ListAssetsRequest - * @memberof google.cloud.securitycenter.v1beta1 - * @see [google.cloud.securitycenter.v1beta1.ListAssetsRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/securitycenter/v1beta1/securitycenter_service.proto} - */ -const ListAssetsRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Response message for listing assets. - * - * @property {Object[]} listAssetsResults - * Assets matching the list request. - * - * This object should have the same structure as [ListAssetsResult]{@link google.cloud.securitycenter.v1beta1.ListAssetsResult} - * - * @property {Object} readTime - * Time used for executing the list request. - * - * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} - * - * @property {string} nextPageToken - * Token to retrieve the next page of results, or empty if there are no more - * results. - * - * @property {number} totalSize - * The total number of assets matching the query. - * - * @typedef ListAssetsResponse - * @memberof google.cloud.securitycenter.v1beta1 - * @see [google.cloud.securitycenter.v1beta1.ListAssetsResponse definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/securitycenter/v1beta1/securitycenter_service.proto} - */ -const ListAssetsResponse = { - // This is for documentation. Actual contents will be loaded by gRPC. - - /** - * Result containing the Asset and its State. - * - * @property {Object} asset - * Asset matching the search request. - * - * This object should have the same structure as [Asset]{@link google.cloud.securitycenter.v1beta1.Asset} - * - * @property {number} state - * State of the asset. - * - * The number should be among the values of [State]{@link google.cloud.securitycenter.v1beta1.State} - * - * @typedef ListAssetsResult - * @memberof google.cloud.securitycenter.v1beta1 - * @see [google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/securitycenter/v1beta1/securitycenter_service.proto} - */ - ListAssetsResult: { - // This is for documentation. Actual contents will be loaded by gRPC. - - /** - * State of the asset. - * - * When querying across two points in time this describes - * the change between the two points: ADDED, REMOVED, or ACTIVE. - * If there was no compare_duration supplied in the request the state should - * be: UNUSED - * - * @enum {number} - * @memberof google.cloud.securitycenter.v1beta1 - */ - State: { - - /** - * Unspecified state. - */ - STATE_UNSPECIFIED: 0, - - /** - * Request did not specify use of this field in the result. - */ - UNUSED: 1, - - /** - * Asset was added between the points in time. - */ - ADDED: 2, - - /** - * Asset was removed between the points in time. - */ - REMOVED: 3, - - /** - * Asset was active at both point(s) in time. - */ - ACTIVE: 4 - } - } -}; - -/** - * Request message for listing findings. - * - * @property {string} parent - * Required. Name of the source the findings belong to. Its format is - * "organizations/[organization_id]/sources/[source_id]". To list across all - * sources provide a source_id of `-`. For example: - * organizations/{organization_id}/sources/- - * - * @property {string} filter - * Expression that defines the filter to apply across findings. - * The expression is a list of one or more restrictions combined via logical - * operators `AND` and `OR`. - * Parentheses are not supported, and `OR` has higher precedence than `AND`. - * - * Restrictions have the form ` ` and may have a `-` - * character in front of them to indicate negation. Examples include: - * - * * name - * * source_properties.a_property - * * security_marks.marks.marka - * - * The supported operators are: - * - * * `=` for all value types. - * * `>`, `<`, `>=`, `<=` for integer values. - * * `:`, meaning substring matching, for strings. - * - * The supported value types are: - * - * * string literals in quotes. - * * integer literals without quotes. - * * boolean literals `true` and `false` without quotes. - * - * For example, `source_properties.size = 100` is a valid filter string. - * - * @property {string} orderBy - * Expression that defines what fields and order to use for sorting. The - * string value should follow SQL syntax: comma separated list of fields. For - * example: "name,resource_properties.a_property". The default sorting order - * is ascending. To specify descending order for a field, a suffix " desc" - * should be appended to the field name. For example: "name - * desc,source_properties.a_property". Redundant space characters in the - * syntax are insignificant. "name desc,source_properties.a_property" and " - * name desc , source_properties.a_property " are equivalent. - * - * @property {Object} readTime - * Time used as a reference point when filtering findings. The filter is - * limited to findings existing at the supplied time and their values are - * those at that specific time. Absence of this field will default to the - * API's version of NOW. - * - * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} - * - * @property {Object} fieldMask - * Optional. A field mask to specify the Finding fields to be listed in the response. - * An empty field mask will list all fields. - * - * This object should have the same structure as [FieldMask]{@link google.protobuf.FieldMask} - * - * @property {string} pageToken - * The value returned by the last `ListFindingsResponse`; indicates - * that this is a continuation of a prior `ListFindings` call, and - * that the system should return the next page of data. - * - * @property {number} pageSize - * The maximum number of results to return in a single response. Default is - * 10, minimum is 1, maximum is 1000. - * - * @typedef ListFindingsRequest - * @memberof google.cloud.securitycenter.v1beta1 - * @see [google.cloud.securitycenter.v1beta1.ListFindingsRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/securitycenter/v1beta1/securitycenter_service.proto} - */ -const ListFindingsRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Response message for listing findings. - * - * @property {Object[]} findings - * Findings matching the list request. - * - * This object should have the same structure as [Finding]{@link google.cloud.securitycenter.v1beta1.Finding} - * - * @property {Object} readTime - * Time used for executing the list request. - * - * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} - * - * @property {string} nextPageToken - * Token to retrieve the next page of results, or empty if there are no more - * results. - * - * @property {number} totalSize - * The total number of findings matching the query. - * - * @typedef ListFindingsResponse - * @memberof google.cloud.securitycenter.v1beta1 - * @see [google.cloud.securitycenter.v1beta1.ListFindingsResponse definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/securitycenter/v1beta1/securitycenter_service.proto} - */ -const ListFindingsResponse = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Request message for updating a finding's state. - * - * @property {string} name - * Required. The relative resource name of the finding. See: - * https://cloud.google.com/apis/design/resource_names#relative_resource_name - * Example: - * "organizations/{organization_id}/sources/{source_id}/finding/{finding_id}". - * - * @property {number} state - * Required. The desired State of the finding. - * - * The number should be among the values of [State]{@link google.cloud.securitycenter.v1beta1.State} - * - * @property {Object} startTime - * Required. The time at which the updated state takes effect. - * - * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} - * - * @typedef SetFindingStateRequest - * @memberof google.cloud.securitycenter.v1beta1 - * @see [google.cloud.securitycenter.v1beta1.SetFindingStateRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/securitycenter/v1beta1/securitycenter_service.proto} - */ -const SetFindingStateRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Request message for running asset discovery for an organization. - * - * @property {string} parent - * Required. Name of the organization to run asset discovery for. Its format is - * "organizations/[organization_id]". - * - * @typedef RunAssetDiscoveryRequest - * @memberof google.cloud.securitycenter.v1beta1 - * @see [google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/securitycenter/v1beta1/securitycenter_service.proto} - */ -const RunAssetDiscoveryRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Request message for updating or creating a finding. - * - * @property {Object} finding - * Required. The finding resource to update or create if it does not already exist. - * parent, security_marks, and update_time will be ignored. - * - * In the case of creation, the finding id portion of the name must - * alphanumeric and less than or equal to 32 characters and greater than 0 - * characters in length. - * - * This object should have the same structure as [Finding]{@link google.cloud.securitycenter.v1beta1.Finding} - * - * @property {Object} updateMask - * The FieldMask to use when updating the finding resource. This field should - * not be specified when creating a finding. - * - * This object should have the same structure as [FieldMask]{@link google.protobuf.FieldMask} - * - * @typedef UpdateFindingRequest - * @memberof google.cloud.securitycenter.v1beta1 - * @see [google.cloud.securitycenter.v1beta1.UpdateFindingRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/securitycenter/v1beta1/securitycenter_service.proto} - */ -const UpdateFindingRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Request message for updating an organization's settings. - * - * @property {Object} organizationSettings - * Required. The organization settings resource to update. - * - * This object should have the same structure as [OrganizationSettings]{@link google.cloud.securitycenter.v1beta1.OrganizationSettings} - * - * @property {Object} updateMask - * The FieldMask to use when updating the settings resource. - * - * This object should have the same structure as [FieldMask]{@link google.protobuf.FieldMask} - * - * @typedef UpdateOrganizationSettingsRequest - * @memberof google.cloud.securitycenter.v1beta1 - * @see [google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/securitycenter/v1beta1/securitycenter_service.proto} - */ -const UpdateOrganizationSettingsRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Request message for updating a source. - * - * @property {Object} source - * Required. The source resource to update. - * - * This object should have the same structure as [Source]{@link google.cloud.securitycenter.v1beta1.Source} - * - * @property {Object} updateMask - * The FieldMask to use when updating the source resource. - * - * This object should have the same structure as [FieldMask]{@link google.protobuf.FieldMask} - * - * @typedef UpdateSourceRequest - * @memberof google.cloud.securitycenter.v1beta1 - * @see [google.cloud.securitycenter.v1beta1.UpdateSourceRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/securitycenter/v1beta1/securitycenter_service.proto} - */ -const UpdateSourceRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Request message for updating a SecurityMarks resource. - * - * @property {Object} securityMarks - * Required. The security marks resource to update. - * - * This object should have the same structure as [SecurityMarks]{@link google.cloud.securitycenter.v1beta1.SecurityMarks} - * - * @property {Object} updateMask - * The FieldMask to use when updating the security marks resource. - * - * This object should have the same structure as [FieldMask]{@link google.protobuf.FieldMask} - * - * @property {Object} startTime - * The time at which the updated SecurityMarks take effect. - * - * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} - * - * @typedef UpdateSecurityMarksRequest - * @memberof google.cloud.securitycenter.v1beta1 - * @see [google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/securitycenter/v1beta1/securitycenter_service.proto} - */ -const UpdateSecurityMarksRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; \ No newline at end of file diff --git a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_source.js b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_source.js deleted file mode 100644 index 0f50da3d72b..00000000000 --- a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_source.js +++ /dev/null @@ -1,51 +0,0 @@ -// 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. - -// Note: this file is purely for documentation. Any contents are not expected -// to be loaded as the JS file. - -/** - * Cloud Security Command Center's (Cloud SCC) finding source. A finding source - * is an entity or a mechanism that can produce a finding. A source is like a - * container of findings that come from the same scanner, logger, monitor, etc. - * - * @property {string} name - * The relative resource name of this source. See: - * https://cloud.google.com/apis/design/resource_names#relative_resource_name - * Example: - * "organizations/{organization_id}/sources/{source_id}" - * - * @property {string} displayName - * The source's display name. - * A source's display name must be unique amongst its siblings, for example, - * two sources with the same parent can't share the same display name. - * The display name must have a length between 1 and 64 characters - * (inclusive). - * - * @property {string} description - * The description of the source (max of 1024 characters). - * Example: - * "Cloud Security Scanner is a web security scanner for common - * vulnerabilities in App Engine applications. It can automatically - * scan and detect four common vulnerabilities, including cross-site-scripting - * (XSS), Flash injection, mixed content (HTTP in HTTPS), and - * outdated/insecure libraries." - * - * @typedef Source - * @memberof google.cloud.securitycenter.v1beta1 - * @see [google.cloud.securitycenter.v1beta1.Source definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/securitycenter/v1beta1/source.proto} - */ -const Source = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; \ No newline at end of file diff --git a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/iam/v1/doc_iam_policy.js b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/iam/v1/doc_iam_policy.js deleted file mode 100644 index 2a58fee6a13..00000000000 --- a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/iam/v1/doc_iam_policy.js +++ /dev/null @@ -1,96 +0,0 @@ -// 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. - -// Note: this file is purely for documentation. Any contents are not expected -// to be loaded as the JS file. - -/** - * Request message for `SetIamPolicy` method. - * - * @property {string} resource - * REQUIRED: The resource for which the policy is being specified. - * See the operation documentation for the appropriate value for this field. - * - * @property {Object} policy - * REQUIRED: The complete policy to be applied to the `resource`. The size of - * the policy is limited to a few 10s of KB. An empty policy is a - * valid policy but certain Cloud Platform services (such as Projects) - * might reject them. - * - * This object should have the same structure as [Policy]{@link google.iam.v1.Policy} - * - * @typedef SetIamPolicyRequest - * @memberof google.iam.v1 - * @see [google.iam.v1.SetIamPolicyRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/iam/v1/iam_policy.proto} - */ -const SetIamPolicyRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Request message for `GetIamPolicy` method. - * - * @property {string} resource - * REQUIRED: The resource for which the policy is being requested. - * See the operation documentation for the appropriate value for this field. - * - * @property {Object} options - * OPTIONAL: A `GetPolicyOptions` object for specifying options to - * `GetIamPolicy`. This field is only used by Cloud IAM. - * - * This object should have the same structure as [GetPolicyOptions]{@link google.iam.v1.GetPolicyOptions} - * - * @typedef GetIamPolicyRequest - * @memberof google.iam.v1 - * @see [google.iam.v1.GetIamPolicyRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/iam/v1/iam_policy.proto} - */ -const GetIamPolicyRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Request message for `TestIamPermissions` method. - * - * @property {string} resource - * REQUIRED: The resource for which the policy detail is being requested. - * See the operation documentation for the appropriate value for this field. - * - * @property {string[]} permissions - * The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For more - * information see - * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - * - * @typedef TestIamPermissionsRequest - * @memberof google.iam.v1 - * @see [google.iam.v1.TestIamPermissionsRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/iam/v1/iam_policy.proto} - */ -const TestIamPermissionsRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Response message for `TestIamPermissions` method. - * - * @property {string[]} permissions - * A subset of `TestPermissionsRequest.permissions` that the caller is - * allowed. - * - * @typedef TestIamPermissionsResponse - * @memberof google.iam.v1 - * @see [google.iam.v1.TestIamPermissionsResponse definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/iam/v1/iam_policy.proto} - */ -const TestIamPermissionsResponse = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; \ No newline at end of file diff --git a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/iam/v1/doc_options.js b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/iam/v1/doc_options.js deleted file mode 100644 index ed4e25db8cd..00000000000 --- a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/iam/v1/doc_options.js +++ /dev/null @@ -1,37 +0,0 @@ -// 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. - -// Note: this file is purely for documentation. Any contents are not expected -// to be loaded as the JS file. - -/** - * Encapsulates settings provided to GetIamPolicy. - * - * @property {number} requestedPolicyVersion - * Optional. The policy format version to be returned. - * - * Valid values are 0, 1, and 3. Requests specifying an invalid value will be - * rejected. - * - * Requests for policies with any conditional bindings must specify version 3. - * Policies without any conditional bindings may specify any valid value or - * leave the field unset. - * - * @typedef GetPolicyOptions - * @memberof google.iam.v1 - * @see [google.iam.v1.GetPolicyOptions definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/iam/v1/options.proto} - */ -const GetPolicyOptions = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; \ No newline at end of file diff --git a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/iam/v1/doc_policy.js b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/iam/v1/doc_policy.js deleted file mode 100644 index f2ac79a7afa..00000000000 --- a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/iam/v1/doc_policy.js +++ /dev/null @@ -1,167 +0,0 @@ -// 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. - -// Note: this file is purely for documentation. Any contents are not expected -// to be loaded as the JS file. - -/** - * Defines an Identity and Access Management (IAM) policy. It is used to - * specify access control policies for Cloud Platform resources. - * - * - * A `Policy` is a collection of `bindings`. A `binding` binds one or more - * `members` to a single `role`. Members can be user accounts, service accounts, - * Google groups, and domains (such as G Suite). A `role` is a named list of - * permissions (defined by IAM or configured by users). A `binding` can - * optionally specify a `condition`, which is a logic expression that further - * constrains the role binding based on attributes about the request and/or - * target resource. - * - * **JSON Example** - * - * { - * "bindings": [ - * { - * "role": "roles/resourcemanager.organizationAdmin", - * "members": [ - * "user:mike@example.com", - * "group:admins@example.com", - * "domain:google.com", - * "serviceAccount:my-project-id@appspot.gserviceaccount.com" - * ] - * }, - * { - * "role": "roles/resourcemanager.organizationViewer", - * "members": ["user:eve@example.com"], - * "condition": { - * "title": "expirable access", - * "description": "Does not grant access after Sep 2020", - * "expression": "request.time < - * timestamp('2020-10-01T00:00:00.000Z')", - * } - * } - * ] - * } - * - * **YAML Example** - * - * bindings: - * - members: - * - user:mike@example.com - * - group:admins@example.com - * - domain:google.com - * - serviceAccount:my-project-id@appspot.gserviceaccount.com - * role: roles/resourcemanager.organizationAdmin - * - members: - * - user:eve@example.com - * role: roles/resourcemanager.organizationViewer - * condition: - * title: expirable access - * description: Does not grant access after Sep 2020 - * expression: request.time < timestamp('2020-10-01T00:00:00.000Z') - * - * For a description of IAM and its features, see the - * [IAM developer's guide](https://cloud.google.com/iam/docs). - * - * @property {number} version - * Specifies the format of the policy. - * - * Valid values are 0, 1, and 3. Requests specifying an invalid value will be - * rejected. - * - * Operations affecting conditional bindings must specify version 3. This can - * be either setting a conditional policy, modifying a conditional binding, - * or removing a binding (conditional or unconditional) from the stored - * conditional policy. - * Operations on non-conditional policies may specify any valid value or - * leave the field unset. - * - * If no etag is provided in the call to `setIamPolicy`, version compliance - * checks against the stored policy is skipped. - * - * @property {Object[]} bindings - * Associates a list of `members` to a `role`. Optionally may specify a - * `condition` that determines when binding is in effect. - * `bindings` with no members will result in an error. - * - * This object should have the same structure as [Binding]{@link google.iam.v1.Binding} - * - * @property {Buffer} etag - * `etag` is used for optimistic concurrency control as a way to help - * prevent simultaneous updates of a policy from overwriting each other. - * It is strongly suggested that systems make use of the `etag` in the - * read-modify-write cycle to perform policy updates in order to avoid race - * conditions: An `etag` is returned in the response to `getIamPolicy`, and - * systems are expected to put that etag in the request to `setIamPolicy` to - * ensure that their change will be applied to the same version of the policy. - * - * If no `etag` is provided in the call to `setIamPolicy`, then the existing - * policy is overwritten. Due to blind-set semantics of an etag-less policy, - * 'setIamPolicy' will not fail even if the incoming policy version does not - * meet the requirements for modifying the stored policy. - * - * @typedef Policy - * @memberof google.iam.v1 - * @see [google.iam.v1.Policy definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/iam/v1/policy.proto} - */ -const Policy = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Associates `members` with a `role`. - * - * @property {string} role - * Role that is assigned to `members`. - * For example, `roles/viewer`, `roles/editor`, or `roles/owner`. - * - * @property {string[]} members - * Specifies the identities requesting access for a Cloud Platform resource. - * `members` can have the following values: - * - * * `allUsers`: A special identifier that represents anyone who is - * on the internet; with or without a Google account. - * - * * `allAuthenticatedUsers`: A special identifier that represents anyone - * who is authenticated with a Google account or a service account. - * - * * `user:{emailid}`: An email address that represents a specific Google - * account. For example, `alice@example.com` . - * - * - * * `serviceAccount:{emailid}`: An email address that represents a service - * account. For example, `my-other-app@appspot.gserviceaccount.com`. - * - * * `group:{emailid}`: An email address that represents a Google group. - * For example, `admins@example.com`. - * - * - * * `domain:{domain}`: The G Suite domain (primary) that represents all the - * users of that domain. For example, `google.com` or `example.com`. - * - * @property {Object} condition - * The condition that is associated with this binding. - * NOTE: An unsatisfied condition will not allow user access via current - * binding. Different bindings, including their conditions, are examined - * independently. - * - * This object should have the same structure as [Expr]{@link google.type.Expr} - * - * @typedef Binding - * @memberof google.iam.v1 - * @see [google.iam.v1.Binding definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/iam/v1/policy.proto} - */ -const Binding = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; \ No newline at end of file diff --git a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/longrunning/doc_operations.js b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/longrunning/doc_operations.js deleted file mode 100644 index 099e418d620..00000000000 --- a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/longrunning/doc_operations.js +++ /dev/null @@ -1,63 +0,0 @@ -// 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. - -// Note: this file is purely for documentation. Any contents are not expected -// to be loaded as the JS file. - -/** - * This resource represents a long-running operation that is the result of a - * network API call. - * - * @property {string} name - * The server-assigned name, which is only unique within the same service that - * originally returns it. If you use the default HTTP mapping, the - * `name` should be a resource name ending with `operations/{unique_id}`. - * - * @property {Object} metadata - * Service-specific metadata associated with the operation. It typically - * contains progress information and common metadata such as create time. - * Some services might not provide such metadata. Any method that returns a - * long-running operation should document the metadata type, if any. - * - * This object should have the same structure as [Any]{@link google.protobuf.Any} - * - * @property {boolean} done - * If the value is `false`, it means the operation is still in progress. - * If `true`, the operation is completed, and either `error` or `response` is - * available. - * - * @property {Object} error - * The error result of the operation in case of failure or cancellation. - * - * This object should have the same structure as [Status]{@link google.rpc.Status} - * - * @property {Object} response - * The normal response of the operation in case of success. If the original - * method returns no data on success, such as `Delete`, the response is - * `google.protobuf.Empty`. If the original method is standard - * `Get`/`Create`/`Update`, the response should be the resource. For other - * methods, the response should have the type `XxxResponse`, where `Xxx` - * is the original method name. For example, if the original method name - * is `TakeSnapshot()`, the inferred response type is - * `TakeSnapshotResponse`. - * - * This object should have the same structure as [Any]{@link google.protobuf.Any} - * - * @typedef Operation - * @memberof google.longrunning - * @see [google.longrunning.Operation definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/longrunning/operations.proto} - */ -const Operation = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; \ No newline at end of file diff --git a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/protobuf/doc_any.js b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/protobuf/doc_any.js deleted file mode 100644 index 813682aa336..00000000000 --- a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/protobuf/doc_any.js +++ /dev/null @@ -1,137 +0,0 @@ -// 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. - -// Note: this file is purely for documentation. Any contents are not expected -// to be loaded as the JS file. - -/** - * `Any` contains an arbitrary serialized protocol buffer message along with a - * URL that describes the type of the serialized message. - * - * Protobuf library provides support to pack/unpack Any values in the form - * of utility functions or additional generated methods of the Any type. - * - * Example 1: Pack and unpack a message in C++. - * - * Foo foo = ...; - * Any any; - * any.PackFrom(foo); - * ... - * if (any.UnpackTo(&foo)) { - * ... - * } - * - * Example 2: Pack and unpack a message in Java. - * - * Foo foo = ...; - * Any any = Any.pack(foo); - * ... - * if (any.is(Foo.class)) { - * foo = any.unpack(Foo.class); - * } - * - * Example 3: Pack and unpack a message in Python. - * - * foo = Foo(...) - * any = Any() - * any.Pack(foo) - * ... - * if any.Is(Foo.DESCRIPTOR): - * any.Unpack(foo) - * ... - * - * Example 4: Pack and unpack a message in Go - * - * foo := &pb.Foo{...} - * any, err := ptypes.MarshalAny(foo) - * ... - * foo := &pb.Foo{} - * if err := ptypes.UnmarshalAny(any, foo); err != nil { - * ... - * } - * - * The pack methods provided by protobuf library will by default use - * 'type.googleapis.com/full.type.name' as the type URL and the unpack - * methods only use the fully qualified type name after the last '/' - * in the type URL, for example "foo.bar.com/x/y.z" will yield type - * name "y.z". - * - * - * # JSON - * - * The JSON representation of an `Any` value uses the regular - * representation of the deserialized, embedded message, with an - * additional field `@type` which contains the type URL. Example: - * - * package google.profile; - * message Person { - * string first_name = 1; - * string last_name = 2; - * } - * - * { - * "@type": "type.googleapis.com/google.profile.Person", - * "firstName": , - * "lastName": - * } - * - * If the embedded message type is well-known and has a custom JSON - * representation, that representation will be embedded adding a field - * `value` which holds the custom JSON in addition to the `@type` - * field. Example (for message google.protobuf.Duration): - * - * { - * "@type": "type.googleapis.com/google.protobuf.Duration", - * "value": "1.212s" - * } - * - * @property {string} typeUrl - * A URL/resource name that uniquely identifies the type of the serialized - * protocol buffer message. This string must contain at least - * one "/" character. The last segment of the URL's path must represent - * the fully qualified name of the type (as in - * `path/google.protobuf.Duration`). The name should be in a canonical form - * (e.g., leading "." is not accepted). - * - * In practice, teams usually precompile into the binary all types that they - * expect it to use in the context of Any. However, for URLs which use the - * scheme `http`, `https`, or no scheme, one can optionally set up a type - * server that maps type URLs to message definitions as follows: - * - * * If no scheme is provided, `https` is assumed. - * * An HTTP GET on the URL must yield a google.protobuf.Type - * value in binary format, or produce an error. - * * Applications are allowed to cache lookup results based on the - * URL, or have them precompiled into a binary to avoid any - * lookup. Therefore, binary compatibility needs to be preserved - * on changes to types. (Use versioned type names to manage - * breaking changes.) - * - * Note: this functionality is not currently available in the official - * protobuf release, and it is not used for type URLs beginning with - * type.googleapis.com. - * - * Schemes other than `http`, `https` (or the empty scheme) might be - * used with implementation specific semantics. - * - * @property {Buffer} value - * Must be a valid serialized protocol buffer of the above specified type. - * - * @typedef Any - * @memberof google.protobuf - * @see [google.protobuf.Any definition in proto format]{@link https://github.com/google/protobuf/blob/master/src/google/protobuf/any.proto} - */ -const Any = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; \ No newline at end of file diff --git a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/protobuf/doc_duration.js b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/protobuf/doc_duration.js deleted file mode 100644 index bd4b4ee6067..00000000000 --- a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/protobuf/doc_duration.js +++ /dev/null @@ -1,97 +0,0 @@ -// 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. - -// Note: this file is purely for documentation. Any contents are not expected -// to be loaded as the JS file. - -/** - * A Duration represents a signed, fixed-length span of time represented - * as a count of seconds and fractions of seconds at nanosecond - * resolution. It is independent of any calendar and concepts like "day" - * or "month". It is related to Timestamp in that the difference between - * two Timestamp values is a Duration and it can be added or subtracted - * from a Timestamp. Range is approximately +-10,000 years. - * - * # Examples - * - * Example 1: Compute Duration from two Timestamps in pseudo code. - * - * Timestamp start = ...; - * Timestamp end = ...; - * Duration duration = ...; - * - * duration.seconds = end.seconds - start.seconds; - * duration.nanos = end.nanos - start.nanos; - * - * if (duration.seconds < 0 && duration.nanos > 0) { - * duration.seconds += 1; - * duration.nanos -= 1000000000; - * } else if (durations.seconds > 0 && duration.nanos < 0) { - * duration.seconds -= 1; - * duration.nanos += 1000000000; - * } - * - * Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. - * - * Timestamp start = ...; - * Duration duration = ...; - * Timestamp end = ...; - * - * end.seconds = start.seconds + duration.seconds; - * end.nanos = start.nanos + duration.nanos; - * - * if (end.nanos < 0) { - * end.seconds -= 1; - * end.nanos += 1000000000; - * } else if (end.nanos >= 1000000000) { - * end.seconds += 1; - * end.nanos -= 1000000000; - * } - * - * Example 3: Compute Duration from datetime.timedelta in Python. - * - * td = datetime.timedelta(days=3, minutes=10) - * duration = Duration() - * duration.FromTimedelta(td) - * - * # JSON Mapping - * - * In JSON format, the Duration type is encoded as a string rather than an - * object, where the string ends in the suffix "s" (indicating seconds) and - * is preceded by the number of seconds, with nanoseconds expressed as - * fractional seconds. For example, 3 seconds with 0 nanoseconds should be - * encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should - * be expressed in JSON format as "3.000000001s", and 3 seconds and 1 - * microsecond should be expressed in JSON format as "3.000001s". - * - * @property {number} seconds - * Signed seconds of the span of time. Must be from -315,576,000,000 - * to +315,576,000,000 inclusive. Note: these bounds are computed from: - * 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years - * - * @property {number} nanos - * Signed fractions of a second at nanosecond resolution of the span - * of time. Durations less than one second are represented with a 0 - * `seconds` field and a positive or negative `nanos` field. For durations - * of one second or more, a non-zero value for the `nanos` field must be - * of the same sign as the `seconds` field. Must be from -999,999,999 - * to +999,999,999 inclusive. - * - * @typedef Duration - * @memberof google.protobuf - * @see [google.protobuf.Duration definition in proto format]{@link https://github.com/google/protobuf/blob/master/src/google/protobuf/duration.proto} - */ -const Duration = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; \ No newline at end of file diff --git a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/protobuf/doc_field_mask.js b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/protobuf/doc_field_mask.js deleted file mode 100644 index 59e745f36c2..00000000000 --- a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/protobuf/doc_field_mask.js +++ /dev/null @@ -1,228 +0,0 @@ -// 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. - -// Note: this file is purely for documentation. Any contents are not expected -// to be loaded as the JS file. - -/** - * `FieldMask` represents a set of symbolic field paths, for example: - * - * paths: "f.a" - * paths: "f.b.d" - * - * Here `f` represents a field in some root message, `a` and `b` - * fields in the message found in `f`, and `d` a field found in the - * message in `f.b`. - * - * Field masks are used to specify a subset of fields that should be - * returned by a get operation or modified by an update operation. - * Field masks also have a custom JSON encoding (see below). - * - * # Field Masks in Projections - * - * When used in the context of a projection, a response message or - * sub-message is filtered by the API to only contain those fields as - * specified in the mask. For example, if the mask in the previous - * example is applied to a response message as follows: - * - * f { - * a : 22 - * b { - * d : 1 - * x : 2 - * } - * y : 13 - * } - * z: 8 - * - * The result will not contain specific values for fields x,y and z - * (their value will be set to the default, and omitted in proto text - * output): - * - * - * f { - * a : 22 - * b { - * d : 1 - * } - * } - * - * A repeated field is not allowed except at the last position of a - * paths string. - * - * If a FieldMask object is not present in a get operation, the - * operation applies to all fields (as if a FieldMask of all fields - * had been specified). - * - * Note that a field mask does not necessarily apply to the - * top-level response message. In case of a REST get operation, the - * field mask applies directly to the response, but in case of a REST - * list operation, the mask instead applies to each individual message - * in the returned resource list. In case of a REST custom method, - * other definitions may be used. Where the mask applies will be - * clearly documented together with its declaration in the API. In - * any case, the effect on the returned resource/resources is required - * behavior for APIs. - * - * # Field Masks in Update Operations - * - * A field mask in update operations specifies which fields of the - * targeted resource are going to be updated. The API is required - * to only change the values of the fields as specified in the mask - * and leave the others untouched. If a resource is passed in to - * describe the updated values, the API ignores the values of all - * fields not covered by the mask. - * - * If a repeated field is specified for an update operation, new values will - * be appended to the existing repeated field in the target resource. Note that - * a repeated field is only allowed in the last position of a `paths` string. - * - * If a sub-message is specified in the last position of the field mask for an - * update operation, then new value will be merged into the existing sub-message - * in the target resource. - * - * For example, given the target message: - * - * f { - * b { - * d: 1 - * x: 2 - * } - * c: [1] - * } - * - * And an update message: - * - * f { - * b { - * d: 10 - * } - * c: [2] - * } - * - * then if the field mask is: - * - * paths: ["f.b", "f.c"] - * - * then the result will be: - * - * f { - * b { - * d: 10 - * x: 2 - * } - * c: [1, 2] - * } - * - * An implementation may provide options to override this default behavior for - * repeated and message fields. - * - * In order to reset a field's value to the default, the field must - * be in the mask and set to the default value in the provided resource. - * Hence, in order to reset all fields of a resource, provide a default - * instance of the resource and set all fields in the mask, or do - * not provide a mask as described below. - * - * If a field mask is not present on update, the operation applies to - * all fields (as if a field mask of all fields has been specified). - * Note that in the presence of schema evolution, this may mean that - * fields the client does not know and has therefore not filled into - * the request will be reset to their default. If this is unwanted - * behavior, a specific service may require a client to always specify - * a field mask, producing an error if not. - * - * As with get operations, the location of the resource which - * describes the updated values in the request message depends on the - * operation kind. In any case, the effect of the field mask is - * required to be honored by the API. - * - * ## Considerations for HTTP REST - * - * The HTTP kind of an update operation which uses a field mask must - * be set to PATCH instead of PUT in order to satisfy HTTP semantics - * (PUT must only be used for full updates). - * - * # JSON Encoding of Field Masks - * - * In JSON, a field mask is encoded as a single string where paths are - * separated by a comma. Fields name in each path are converted - * to/from lower-camel naming conventions. - * - * As an example, consider the following message declarations: - * - * message Profile { - * User user = 1; - * Photo photo = 2; - * } - * message User { - * string display_name = 1; - * string address = 2; - * } - * - * In proto a field mask for `Profile` may look as such: - * - * mask { - * paths: "user.display_name" - * paths: "photo" - * } - * - * In JSON, the same mask is represented as below: - * - * { - * mask: "user.displayName,photo" - * } - * - * # Field Masks and Oneof Fields - * - * Field masks treat fields in oneofs just as regular fields. Consider the - * following message: - * - * message SampleMessage { - * oneof test_oneof { - * string name = 4; - * SubMessage sub_message = 9; - * } - * } - * - * The field mask can be: - * - * mask { - * paths: "name" - * } - * - * Or: - * - * mask { - * paths: "sub_message" - * } - * - * Note that oneof type names ("test_oneof" in this case) cannot be used in - * paths. - * - * ## Field Mask Verification - * - * The implementation of any API method which has a FieldMask type field in the - * request should verify the included field paths, and return an - * `INVALID_ARGUMENT` error if any path is duplicated or unmappable. - * - * @property {string[]} paths - * The set of field mask paths. - * - * @typedef FieldMask - * @memberof google.protobuf - * @see [google.protobuf.FieldMask definition in proto format]{@link https://github.com/google/protobuf/blob/master/src/google/protobuf/field_mask.proto} - */ -const FieldMask = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; \ No newline at end of file diff --git a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/protobuf/doc_struct.js b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/protobuf/doc_struct.js deleted file mode 100644 index a143b9a6d2d..00000000000 --- a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/protobuf/doc_struct.js +++ /dev/null @@ -1,112 +0,0 @@ -// 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. - -// Note: this file is purely for documentation. Any contents are not expected -// to be loaded as the JS file. - -/** - * `Struct` represents a structured data value, consisting of fields - * which map to dynamically typed values. In some languages, `Struct` - * might be supported by a native representation. For example, in - * scripting languages like JS a struct is represented as an - * object. The details of that representation are described together - * with the proto support for the language. - * - * The JSON representation for `Struct` is JSON object. - * - * @property {Object.} fields - * Unordered map of dynamically typed values. - * - * @typedef Struct - * @memberof google.protobuf - * @see [google.protobuf.Struct definition in proto format]{@link https://github.com/google/protobuf/blob/master/src/google/protobuf/struct.proto} - */ -const Struct = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * `Value` represents a dynamically typed value which can be either - * null, a number, a string, a boolean, a recursive struct value, or a - * list of values. A producer of value is expected to set one of that - * variants, absence of any variant indicates an error. - * - * The JSON representation for `Value` is JSON value. - * - * @property {number} nullValue - * Represents a null value. - * - * The number should be among the values of [NullValue]{@link google.protobuf.NullValue} - * - * @property {number} numberValue - * Represents a double value. - * - * @property {string} stringValue - * Represents a string value. - * - * @property {boolean} boolValue - * Represents a boolean value. - * - * @property {Object} structValue - * Represents a structured value. - * - * This object should have the same structure as [Struct]{@link google.protobuf.Struct} - * - * @property {Object} listValue - * Represents a repeated `Value`. - * - * This object should have the same structure as [ListValue]{@link google.protobuf.ListValue} - * - * @typedef Value - * @memberof google.protobuf - * @see [google.protobuf.Value definition in proto format]{@link https://github.com/google/protobuf/blob/master/src/google/protobuf/struct.proto} - */ -const Value = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * `ListValue` is a wrapper around a repeated field of values. - * - * The JSON representation for `ListValue` is JSON array. - * - * @property {Object[]} values - * Repeated field of dynamically typed values. - * - * This object should have the same structure as [Value]{@link google.protobuf.Value} - * - * @typedef ListValue - * @memberof google.protobuf - * @see [google.protobuf.ListValue definition in proto format]{@link https://github.com/google/protobuf/blob/master/src/google/protobuf/struct.proto} - */ -const ListValue = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * `NullValue` is a singleton enumeration to represent the null value for the - * `Value` type union. - * - * The JSON representation for `NullValue` is JSON `null`. - * - * @enum {number} - * @memberof google.protobuf - */ -const NullValue = { - - /** - * Null value. - */ - NULL_VALUE: 0 -}; \ No newline at end of file diff --git a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/protobuf/doc_timestamp.js b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/protobuf/doc_timestamp.js deleted file mode 100644 index ad801cc9a10..00000000000 --- a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/protobuf/doc_timestamp.js +++ /dev/null @@ -1,117 +0,0 @@ -// 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. - -// Note: this file is purely for documentation. Any contents are not expected -// to be loaded as the JS file. - -/** - * A Timestamp represents a point in time independent of any time zone or local - * calendar, encoded as a count of seconds and fractions of seconds at - * nanosecond resolution. The count is relative to an epoch at UTC midnight on - * January 1, 1970, in the proleptic Gregorian calendar which extends the - * Gregorian calendar backwards to year one. - * - * All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - * second table is needed for interpretation, using a [24-hour linear - * smear](https://developers.google.com/time/smear). - * - * The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - * restricting to that range, we ensure that we can convert to and from [RFC - * 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - * - * # Examples - * - * Example 1: Compute Timestamp from POSIX `time()`. - * - * Timestamp timestamp; - * timestamp.set_seconds(time(NULL)); - * timestamp.set_nanos(0); - * - * Example 2: Compute Timestamp from POSIX `gettimeofday()`. - * - * struct timeval tv; - * gettimeofday(&tv, NULL); - * - * Timestamp timestamp; - * timestamp.set_seconds(tv.tv_sec); - * timestamp.set_nanos(tv.tv_usec * 1000); - * - * Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - * - * FILETIME ft; - * GetSystemTimeAsFileTime(&ft); - * UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - * - * // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - * // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - * Timestamp timestamp; - * timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - * timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - * - * Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - * - * long millis = System.currentTimeMillis(); - * - * Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - * .setNanos((int) ((millis % 1000) * 1000000)).build(); - * - * - * Example 5: Compute Timestamp from current time in Python. - * - * timestamp = Timestamp() - * timestamp.GetCurrentTime() - * - * # JSON Mapping - * - * In JSON format, the Timestamp type is encoded as a string in the - * [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the - * format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" - * where {year} is always expressed using four digits while {month}, {day}, - * {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional - * seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), - * are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone - * is required. A proto3 JSON serializer should always use UTC (as indicated by - * "Z") when printing the Timestamp type and a proto3 JSON parser should be - * able to accept both UTC and other timezones (as indicated by an offset). - * - * For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past - * 01:30 UTC on January 15, 2017. - * - * In JavaScript, one can convert a Date object to this format using the - * standard - * [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - * method. In Python, a standard `datetime.datetime` object can be converted - * to this format using - * [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with - * the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use - * the Joda Time's [`ISODateTimeFormat.dateTime()`](https://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime%2D%2D) to obtain a formatter capable of generating timestamps in this format. - * - * @property {number} seconds - * Represents seconds of UTC time since Unix epoch - * 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to - * 9999-12-31T23:59:59Z inclusive. - * - * @property {number} nanos - * Non-negative fractions of a second at nanosecond resolution. Negative - * second values with fractions must still have non-negative nanos values - * that count forward in time. Must be from 0 to 999,999,999 - * inclusive. - * - * @typedef Timestamp - * @memberof google.protobuf - * @see [google.protobuf.Timestamp definition in proto format]{@link https://github.com/google/protobuf/blob/master/src/google/protobuf/timestamp.proto} - */ -const Timestamp = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; \ No newline at end of file diff --git a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/rpc/doc_status.js b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/rpc/doc_status.js deleted file mode 100644 index 750e0af7689..00000000000 --- a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/rpc/doc_status.js +++ /dev/null @@ -1,47 +0,0 @@ -// 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. - -// Note: this file is purely for documentation. Any contents are not expected -// to be loaded as the JS file. - -/** - * The `Status` type defines a logical error model that is suitable for - * different programming environments, including REST APIs and RPC APIs. It is - * used by [gRPC](https://github.com/grpc). Each `Status` message contains - * three pieces of data: error code, error message, and error details. - * - * You can find out more about this error model and how to work with it in the - * [API Design Guide](https://cloud.google.com/apis/design/errors). - * - * @property {number} code - * The status code, which should be an enum value of google.rpc.Code. - * - * @property {string} message - * A developer-facing error message, which should be in English. Any - * user-facing error message should be localized and sent in the - * google.rpc.Status.details field, or localized by the client. - * - * @property {Object[]} details - * A list of messages that carry the error details. There is a common set of - * message types for APIs to use. - * - * This object should have the same structure as [Any]{@link google.protobuf.Any} - * - * @typedef Status - * @memberof google.rpc - * @see [google.rpc.Status definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/rpc/status.proto} - */ -const Status = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; \ No newline at end of file diff --git a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/type/doc_expr.js b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/type/doc_expr.js deleted file mode 100644 index c185edde52f..00000000000 --- a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/type/doc_expr.js +++ /dev/null @@ -1,51 +0,0 @@ -// 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. - -// Note: this file is purely for documentation. Any contents are not expected -// to be loaded as the JS file. - -/** - * Represents an expression text. Example: - * - * title: "User account presence" - * description: "Determines whether the request has a user account" - * expression: "size(request.user) > 0" - * - * @property {string} expression - * Textual representation of an expression in - * Common Expression Language syntax. - * - * The application context of the containing message determines which - * well-known feature set of CEL is supported. - * - * @property {string} title - * An optional title for the expression, i.e. a short string describing - * its purpose. This can be used e.g. in UIs which allow to enter the - * expression. - * - * @property {string} description - * An optional description of the expression. This is a longer text which - * describes the expression, e.g. when hovered over it in a UI. - * - * @property {string} location - * An optional string indicating the location of the expression for error - * reporting, e.g. a file name and a position in the file. - * - * @typedef Expr - * @memberof google.type - * @see [google.type.Expr definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/type/expr.proto} - */ -const Expr = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; \ No newline at end of file diff --git a/packages/google-cloud-securitycenter/src/browser.js b/packages/google-cloud-securitycenter/src/v1beta1/index.ts similarity index 65% rename from packages/google-cloud-securitycenter/src/browser.js rename to packages/google-cloud-securitycenter/src/v1beta1/index.ts index 68dc62d25d6..a44e8075d6f 100644 --- a/packages/google-cloud-securitycenter/src/browser.js +++ b/packages/google-cloud-securitycenter/src/v1beta1/index.ts @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// Copyright 2019 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -11,11 +11,9 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** -'use strict'; - -// Set a flag that we are running in a browser bundle. -global.isBrowser = true; - -// Re-export all exports from ./index.js. -module.exports = require('./index'); +export {SecurityCenterClient} from './security_center_client'; diff --git a/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.js b/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.js deleted file mode 100644 index 89eb48e9f6c..00000000000 --- a/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.js +++ /dev/null @@ -1,2748 +0,0 @@ -// 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. - -'use strict'; - -const gapicConfig = require('./security_center_client_config.json'); -const gax = require('google-gax'); -const path = require('path'); - -const VERSION = require('../../package.json').version; - -/** - * V1 Beta APIs for Security Center service. - * - * @class - * @memberof v1beta1 - */ -class SecurityCenterClient { - /** - * Construct an instance of SecurityCenterClient. - * - * @param {object} [options] - The configuration object. See the subsequent - * parameters for more details. - * @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 {function} [options.promise] - Custom promise module to use instead - * of native Promises. - * @param {string} [options.apiEndpoint] - The domain name of the - * API remote host. - */ - constructor(opts) { - opts = opts || {}; - this._descriptors = {}; - - if (global.isBrowser) { - // If we're in browser, we use gRPC fallback. - opts.fallback = true; - } - - // If we are in browser, we are already using fallback because of the - // "browser" field in package.json. - // But if we were explicitly requested to use fallback, let's do it now. - const gaxModule = !global.isBrowser && opts.fallback ? gax.fallback : gax; - - const servicePath = - opts.servicePath || opts.apiEndpoint || this.constructor.servicePath; - - // Ensure that options include the service address and port. - opts = Object.assign( - { - clientConfig: {}, - port: this.constructor.port, - servicePath, - }, - opts - ); - - // Create a `gaxGrpc` object, with any grpc-specific options - // sent to the client. - opts.scopes = this.constructor.scopes; - const gaxGrpc = new gaxModule.GrpcClient(opts); - - // Save the auth object to the client, for use by other methods. - this.auth = gaxGrpc.auth; - - // Determine the client header string. - const clientHeader = []; - - if (typeof process !== 'undefined' && 'versions' in process) { - clientHeader.push(`gl-node/${process.versions.node}`); - } - clientHeader.push(`gax/${gaxModule.version}`); - if (opts.fallback) { - clientHeader.push(`gl-web/${gaxModule.version}`); - } else { - clientHeader.push(`grpc/${gaxGrpc.grpcVersion}`); - } - clientHeader.push(`gapic/${VERSION}`); - if (opts.libName && opts.libVersion) { - clientHeader.push(`${opts.libName}/${opts.libVersion}`); - } - - // Load the applicable protos. - // For Node.js, pass the path to JSON proto file. - // For browsers, pass the JSON content. - - const nodejsProtoPath = path.join( - __dirname, - '..', - '..', - 'protos', - 'protos.json' - ); - const protos = gaxGrpc.loadProto( - opts.fallback ? require('../../protos/protos.json') : nodejsProtoPath - ); - - // This API contains "path templates"; forward-slash-separated - // identifiers to uniquely identify resources within the API. - // Create useful helper objects for these. - this._pathTemplates = { - assetSecurityMarksPathTemplate: new gaxModule.PathTemplate( - 'organizations/{organization}/assets/{asset}/securityMarks' - ), - findingPathTemplate: new gaxModule.PathTemplate( - 'organizations/{organization}/sources/{source}/findings/{finding}' - ), - findingSecurityMarksPathTemplate: new gaxModule.PathTemplate( - 'organizations/{organization}/sources/{source}/findings/{finding}/securityMarks' - ), - organizationPathTemplate: new gaxModule.PathTemplate( - 'organizations/{organization}' - ), - organizationSettingsPathTemplate: new gaxModule.PathTemplate( - 'organizations/{organization}/organizationSettings' - ), - sourcePathTemplate: new gaxModule.PathTemplate( - 'organizations/{organization}/sources/{source}' - ), - }; - - // Some of the methods on this service return "paged" results, - // (e.g. 50 results at a time, with tokens to get subsequent - // pages). Denote the keys used for pagination and results. - this._descriptors.page = { - groupAssets: new gaxModule.PageDescriptor( - 'pageToken', - 'nextPageToken', - 'groupByResults' - ), - groupFindings: new gaxModule.PageDescriptor( - 'pageToken', - 'nextPageToken', - 'groupByResults' - ), - listAssets: new gaxModule.PageDescriptor( - 'pageToken', - 'nextPageToken', - 'listAssetsResults' - ), - listFindings: new gaxModule.PageDescriptor( - 'pageToken', - 'nextPageToken', - 'findings' - ), - listSources: new gaxModule.PageDescriptor( - 'pageToken', - 'nextPageToken', - 'sources' - ), - }; - - const protoFilesRoot = opts.fallback - ? gaxModule.protobuf.Root.fromJSON(require('../../protos/protos.json')) - : gaxModule.protobuf.loadSync(nodejsProtoPath); - - // This API contains "long-running operations", which return a - // an Operation object that allows for tracking of the operation, - // rather than holding a request open. - this.operationsClient = new gaxModule.lro({ - auth: gaxGrpc.auth, - grpc: gaxGrpc.grpc, - }).operationsClient(opts); - - const runAssetDiscoveryResponse = protoFilesRoot.lookup( - 'google.protobuf.Empty' - ); - const runAssetDiscoveryMetadata = protoFilesRoot.lookup( - 'google.protobuf.Empty' - ); - - this._descriptors.longrunning = { - runAssetDiscovery: new gaxModule.LongrunningDescriptor( - this.operationsClient, - runAssetDiscoveryResponse.decode.bind(runAssetDiscoveryResponse), - runAssetDiscoveryMetadata.decode.bind(runAssetDiscoveryMetadata) - ), - }; - - // Put together the default options sent with requests. - const defaults = gaxGrpc.constructSettings( - 'google.cloud.securitycenter.v1beta1.SecurityCenter', - gapicConfig, - 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 = {}; - - // Put together the "service stub" for - // google.cloud.securitycenter.v1beta1.SecurityCenter. - const securityCenterStub = gaxGrpc.createStub( - opts.fallback - ? protos.lookupService( - 'google.cloud.securitycenter.v1beta1.SecurityCenter' - ) - : protos.google.cloud.securitycenter.v1beta1.SecurityCenter, - opts - ); - - // Iterate over each of the methods that the service provides - // and create an API call method for each. - const securityCenterStubMethods = [ - 'createSource', - 'createFinding', - 'getIamPolicy', - 'getOrganizationSettings', - 'getSource', - 'groupAssets', - 'groupFindings', - 'listAssets', - 'listFindings', - 'listSources', - 'runAssetDiscovery', - 'setFindingState', - 'setIamPolicy', - 'testIamPermissions', - 'updateFinding', - 'updateOrganizationSettings', - 'updateSource', - 'updateSecurityMarks', - ]; - for (const methodName of securityCenterStubMethods) { - const innerCallPromise = securityCenterStub.then( - stub => (...args) => { - return stub[methodName].apply(stub, args); - }, - err => () => { - throw err; - } - ); - this._innerApiCalls[methodName] = gaxModule.createApiCall( - innerCallPromise, - defaults[methodName], - this._descriptors.page[methodName] || - this._descriptors.longrunning[methodName] - ); - } - } - - /** - * The DNS address for this API service. - */ - static get servicePath() { - return 'securitycenter.googleapis.com'; - } - - /** - * The DNS address for this API service - same as servicePath(), - * exists for compatibility reasons. - */ - static get apiEndpoint() { - return 'securitycenter.googleapis.com'; - } - - /** - * The port for this API service. - */ - static get port() { - return 443; - } - - /** - * The scopes needed to make gRPC calls for every method defined - * in this service. - */ - static get scopes() { - return ['https://www.googleapis.com/auth/cloud-platform']; - } - - /** - * Return the project ID used by this class. - * @param {function(Error, string)} callback - the callback to - * be called with the current project Id. - */ - getProjectId(callback) { - return this.auth.getProjectId(callback); - } - - // ------------------- - // -- Service calls -- - // ------------------- - - /** - * Creates a source. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Resource name of the new source's parent. Its format should be - * "organizations/[organization_id]". - * @param {Object} request.source - * Required. The Source being created, only the display_name and description will be - * used. All other fields will be ignored. - * - * This object should have the same structure as [Source]{@link google.cloud.securitycenter.v1beta1.Source} - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [Source]{@link google.cloud.securitycenter.v1beta1.Source}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Source]{@link google.cloud.securitycenter.v1beta1.Source}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const securityCenter = require('@google-cloud/security-center'); - * - * const client = new securityCenter.v1beta1.SecurityCenterClient({ - * // optional auth parameters. - * }); - * - * const formattedParent = client.organizationPath('[ORGANIZATION]'); - * const source = {}; - * const request = { - * parent: formattedParent, - * source: source, - * }; - * client.createSource(request) - * .then(responses => { - * const response = responses[0]; - * // doThingsWith(response) - * }) - * .catch(err => { - * console.error(err); - * }); - */ - createSource(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent, - }); - - return this._innerApiCalls.createSource(request, options, callback); - } - - /** - * Creates a finding. The corresponding source must exist for finding creation - * to succeed. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Resource name of the new finding's parent. Its format should be - * "organizations/[organization_id]/sources/[source_id]". - * @param {string} request.findingId - * Required. Unique identifier provided by the client within the parent scope. - * It must be alphanumeric and less than or equal to 32 characters and - * greater than 0 characters in length. - * @param {Object} request.finding - * Required. The Finding being created. The name and security_marks will be ignored as - * they are both output only fields on this resource. - * - * This object should have the same structure as [Finding]{@link google.cloud.securitycenter.v1beta1.Finding} - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [Finding]{@link google.cloud.securitycenter.v1beta1.Finding}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Finding]{@link google.cloud.securitycenter.v1beta1.Finding}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const securityCenter = require('@google-cloud/security-center'); - * - * const client = new securityCenter.v1beta1.SecurityCenterClient({ - * // optional auth parameters. - * }); - * - * const formattedParent = client.sourcePath('[ORGANIZATION]', '[SOURCE]'); - * const findingId = ''; - * const finding = {}; - * const request = { - * parent: formattedParent, - * findingId: findingId, - * finding: finding, - * }; - * client.createFinding(request) - * .then(responses => { - * const response = responses[0]; - * // doThingsWith(response) - * }) - * .catch(err => { - * console.error(err); - * }); - */ - createFinding(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent, - }); - - return this._innerApiCalls.createFinding(request, options, callback); - } - - /** - * Gets the access control policy on the specified Source. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy is being requested. - * See the operation documentation for the appropriate value for this field. - * @param {Object} [request.options] - * OPTIONAL: A `GetPolicyOptions` object for specifying options to - * `GetIamPolicy`. This field is only used by Cloud IAM. - * - * This object should have the same structure as [GetPolicyOptions]{@link google.iam.v1.GetPolicyOptions} - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [Policy]{@link google.iam.v1.Policy}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Policy]{@link google.iam.v1.Policy}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const securityCenter = require('@google-cloud/security-center'); - * - * const client = new securityCenter.v1beta1.SecurityCenterClient({ - * // optional auth parameters. - * }); - * - * const formattedResource = client.sourcePath('[ORGANIZATION]', '[SOURCE]'); - * client.getIamPolicy({resource: formattedResource}) - * .then(responses => { - * const response = responses[0]; - * // doThingsWith(response) - * }) - * .catch(err => { - * console.error(err); - * }); - */ - getIamPolicy(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - resource: request.resource, - }); - - return this._innerApiCalls.getIamPolicy(request, options, callback); - } - - /** - * Gets the settings for an organization. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. Name of the organization to get organization settings for. Its format is - * "organizations/[organization_id]/organizationSettings". - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [OrganizationSettings]{@link google.cloud.securitycenter.v1beta1.OrganizationSettings}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [OrganizationSettings]{@link google.cloud.securitycenter.v1beta1.OrganizationSettings}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const securityCenter = require('@google-cloud/security-center'); - * - * const client = new securityCenter.v1beta1.SecurityCenterClient({ - * // optional auth parameters. - * }); - * - * const formattedName = client.organizationSettingsPath('[ORGANIZATION]'); - * client.getOrganizationSettings({name: formattedName}) - * .then(responses => { - * const response = responses[0]; - * // doThingsWith(response) - * }) - * .catch(err => { - * console.error(err); - * }); - */ - getOrganizationSettings(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - name: request.name, - }); - - return this._innerApiCalls.getOrganizationSettings( - request, - options, - callback - ); - } - - /** - * Gets a source. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. Relative resource name of the source. Its format is - * "organizations/[organization_id]/source/[source_id]". - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [Source]{@link google.cloud.securitycenter.v1beta1.Source}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Source]{@link google.cloud.securitycenter.v1beta1.Source}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const securityCenter = require('@google-cloud/security-center'); - * - * const client = new securityCenter.v1beta1.SecurityCenterClient({ - * // optional auth parameters. - * }); - * - * const formattedName = client.sourcePath('[ORGANIZATION]', '[SOURCE]'); - * client.getSource({name: formattedName}) - * .then(responses => { - * const response = responses[0]; - * // doThingsWith(response) - * }) - * .catch(err => { - * console.error(err); - * }); - */ - getSource(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - name: request.name, - }); - - return this._innerApiCalls.getSource(request, options, callback); - } - - /** - * Filters an organization's assets and groups them by their specified - * properties. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Name of the organization to groupBy. Its format is - * "organizations/[organization_id]". - * @param {string} request.groupBy - * Required. Expression that defines what assets fields to use for grouping. The string - * value should follow SQL syntax: comma separated list of fields. For - * example: - * "security_center_properties.resource_project,security_center_properties.project". - * - * The following fields are supported when compare_duration is not set: - * - * * security_center_properties.resource_project - * * security_center_properties.resource_type - * * security_center_properties.resource_parent - * - * The following fields are supported when compare_duration is set: - * - * * security_center_properties.resource_type - * @param {string} [request.filter] - * Expression that defines the filter to apply across assets. - * The expression is a list of zero or more restrictions combined via logical - * operators `AND` and `OR`. - * Parentheses are not supported, and `OR` has higher precedence than `AND`. - * - * Restrictions have the form ` ` and may have a `-` - * character in front of them to indicate negation. The fields map to those - * defined in the Asset resource. Examples include: - * - * * name - * * security_center_properties.resource_name - * * resource_properties.a_property - * * security_marks.marks.marka - * - * The supported operators are: - * - * * `=` for all value types. - * * `>`, `<`, `>=`, `<=` for integer values. - * * `:`, meaning substring matching, for strings. - * - * The supported value types are: - * - * * string literals in quotes. - * * integer literals without quotes. - * * boolean literals `true` and `false` without quotes. - * - * For example, `resource_properties.size = 100` is a valid filter string. - * @param {Object} [request.compareDuration] - * When compare_duration is set, the Asset's "state" property is updated to - * indicate whether the asset was added, removed, or remained present during - * the compare_duration period of time that precedes the read_time. This is - * the time between (read_time - compare_duration) and read_time. - * - * The state value is derived based on the presence of the asset at the two - * points in time. Intermediate state changes between the two times don't - * affect the result. For example, the results aren't affected if the asset is - * removed and re-created again. - * - * Possible "state" values when compare_duration is specified: - * - * * "ADDED": indicates that the asset was not present before - * compare_duration, but present at reference_time. - * * "REMOVED": indicates that the asset was present at the start of - * compare_duration, but not present at reference_time. - * * "ACTIVE": indicates that the asset was present at both the - * start and the end of the time period defined by - * compare_duration and reference_time. - * - * This field is ignored if `state` is not a field in `group_by`. - * - * This object should have the same structure as [Duration]{@link google.protobuf.Duration} - * @param {Object} [request.readTime] - * Time used as a reference point when filtering assets. The filter is limited - * to assets existing at the supplied time and their values are those at that - * specific time. Absence of this field will default to the API's version of - * NOW. - * - * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} - * @param {number} [request.pageSize] - * The maximum number of resources contained in the underlying API - * response. If page streaming is performed per-resource, this - * parameter does not affect the return value. If page streaming is - * performed per-page, this determines the maximum number of - * resources in a page. - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Array, ?Object, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is Array of [GroupResult]{@link google.cloud.securitycenter.v1beta1.GroupResult}. - * - * When autoPaginate: false is specified through options, it contains the result - * in a single response. If the response indicates the next page exists, the third - * parameter is set to be used for the next request object. The fourth parameter keeps - * the raw response object of an object representing [GroupAssetsResponse]{@link google.cloud.securitycenter.v1beta1.GroupAssetsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of [GroupResult]{@link google.cloud.securitycenter.v1beta1.GroupResult}. - * - * When autoPaginate: false is specified through options, the array has three elements. - * The first element is Array of [GroupResult]{@link google.cloud.securitycenter.v1beta1.GroupResult} in a single response. - * The second element is the next request object if the response - * indicates the next page exists, or null. The third element is - * an object representing [GroupAssetsResponse]{@link google.cloud.securitycenter.v1beta1.GroupAssetsResponse}. - * - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const securityCenter = require('@google-cloud/security-center'); - * - * const client = new securityCenter.v1beta1.SecurityCenterClient({ - * // optional auth parameters. - * }); - * - * // Iterate over all elements. - * const formattedParent = client.organizationPath('[ORGANIZATION]'); - * const groupBy = ''; - * const request = { - * parent: formattedParent, - * groupBy: groupBy, - * }; - * - * client.groupAssets(request) - * .then(responses => { - * const resources = responses[0]; - * for (const resource of resources) { - * // doThingsWith(resource) - * } - * }) - * .catch(err => { - * console.error(err); - * }); - * - * // Or obtain the paged response. - * const formattedParent = client.organizationPath('[ORGANIZATION]'); - * const groupBy = ''; - * const request = { - * parent: formattedParent, - * groupBy: groupBy, - * }; - * - * - * const options = {autoPaginate: false}; - * const callback = responses => { - * // The actual resources in a response. - * const resources = responses[0]; - * // The next request if the response shows that there are more responses. - * const nextRequest = responses[1]; - * // The actual response object, if necessary. - * // const rawResponse = responses[2]; - * for (const resource of resources) { - * // doThingsWith(resource); - * } - * if (nextRequest) { - * // Fetch the next page. - * return client.groupAssets(nextRequest, options).then(callback); - * } - * } - * client.groupAssets(request, options) - * .then(callback) - * .catch(err => { - * console.error(err); - * }); - */ - groupAssets(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent, - }); - - return this._innerApiCalls.groupAssets(request, options, callback); - } - - /** - * Equivalent to {@link groupAssets}, but returns a NodeJS Stream object. - * - * This fetches the paged responses for {@link groupAssets} continuously - * and invokes the callback registered for 'data' event for each element in the - * responses. - * - * The returned object has 'end' method when no more elements are required. - * - * autoPaginate option will be ignored. - * - * @see {@link https://nodejs.org/api/stream.html} - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Name of the organization to groupBy. Its format is - * "organizations/[organization_id]". - * @param {string} request.groupBy - * Required. Expression that defines what assets fields to use for grouping. The string - * value should follow SQL syntax: comma separated list of fields. For - * example: - * "security_center_properties.resource_project,security_center_properties.project". - * - * The following fields are supported when compare_duration is not set: - * - * * security_center_properties.resource_project - * * security_center_properties.resource_type - * * security_center_properties.resource_parent - * - * The following fields are supported when compare_duration is set: - * - * * security_center_properties.resource_type - * @param {string} [request.filter] - * Expression that defines the filter to apply across assets. - * The expression is a list of zero or more restrictions combined via logical - * operators `AND` and `OR`. - * Parentheses are not supported, and `OR` has higher precedence than `AND`. - * - * Restrictions have the form ` ` and may have a `-` - * character in front of them to indicate negation. The fields map to those - * defined in the Asset resource. Examples include: - * - * * name - * * security_center_properties.resource_name - * * resource_properties.a_property - * * security_marks.marks.marka - * - * The supported operators are: - * - * * `=` for all value types. - * * `>`, `<`, `>=`, `<=` for integer values. - * * `:`, meaning substring matching, for strings. - * - * The supported value types are: - * - * * string literals in quotes. - * * integer literals without quotes. - * * boolean literals `true` and `false` without quotes. - * - * For example, `resource_properties.size = 100` is a valid filter string. - * @param {Object} [request.compareDuration] - * When compare_duration is set, the Asset's "state" property is updated to - * indicate whether the asset was added, removed, or remained present during - * the compare_duration period of time that precedes the read_time. This is - * the time between (read_time - compare_duration) and read_time. - * - * The state value is derived based on the presence of the asset at the two - * points in time. Intermediate state changes between the two times don't - * affect the result. For example, the results aren't affected if the asset is - * removed and re-created again. - * - * Possible "state" values when compare_duration is specified: - * - * * "ADDED": indicates that the asset was not present before - * compare_duration, but present at reference_time. - * * "REMOVED": indicates that the asset was present at the start of - * compare_duration, but not present at reference_time. - * * "ACTIVE": indicates that the asset was present at both the - * start and the end of the time period defined by - * compare_duration and reference_time. - * - * This field is ignored if `state` is not a field in `group_by`. - * - * This object should have the same structure as [Duration]{@link google.protobuf.Duration} - * @param {Object} [request.readTime] - * Time used as a reference point when filtering assets. The filter is limited - * to assets existing at the supplied time and their values are those at that - * specific time. Absence of this field will default to the API's version of - * NOW. - * - * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} - * @param {number} [request.pageSize] - * The maximum number of resources contained in the underlying API - * response. If page streaming is performed per-resource, this - * parameter does not affect the return value. If page streaming is - * performed per-page, this determines the maximum number of - * resources in a page. - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @returns {Stream} - * An object stream which emits an object representing [GroupResult]{@link google.cloud.securitycenter.v1beta1.GroupResult} on 'data' event. - * - * @example - * - * const securityCenter = require('@google-cloud/security-center'); - * - * const client = new securityCenter.v1beta1.SecurityCenterClient({ - * // optional auth parameters. - * }); - * - * const formattedParent = client.organizationPath('[ORGANIZATION]'); - * const groupBy = ''; - * const request = { - * parent: formattedParent, - * groupBy: groupBy, - * }; - * client.groupAssetsStream(request) - * .on('data', element => { - * // doThingsWith(element) - * }).on('error', err => { - * console.log(err); - * }); - */ - groupAssetsStream(request, options) { - options = options || {}; - - return this._descriptors.page.groupAssets.createStream( - this._innerApiCalls.groupAssets, - request, - options - ); - } - - /** - * Filters an organization or source's findings and groups them by their - * specified properties. - * - * To group across all sources provide a `-` as the source id. - * Example: /v1beta1/organizations/{organization_id}/sources/-/findings - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Name of the source to groupBy. Its format is - * "organizations/[organization_id]/sources/[source_id]". To groupBy across - * all sources provide a source_id of `-`. For example: - * organizations/{organization_id}/sources/- - * @param {string} request.groupBy - * Required. Expression that defines what assets fields to use for grouping (including - * `state`). The string value should follow SQL syntax: comma separated list - * of fields. For example: - * "parent,resource_name". - * - * The following fields are supported: - * - * * resource_name - * * category - * * state - * * parent - * @param {string} [request.filter] - * Expression that defines the filter to apply across findings. - * The expression is a list of one or more restrictions combined via logical - * operators `AND` and `OR`. - * Parentheses are not supported, and `OR` has higher precedence than `AND`. - * - * Restrictions have the form ` ` and may have a `-` - * character in front of them to indicate negation. Examples include: - * - * * name - * * source_properties.a_property - * * security_marks.marks.marka - * - * The supported operators are: - * - * * `=` for all value types. - * * `>`, `<`, `>=`, `<=` for integer values. - * * `:`, meaning substring matching, for strings. - * - * The supported value types are: - * - * * string literals in quotes. - * * integer literals without quotes. - * * boolean literals `true` and `false` without quotes. - * - * For example, `source_properties.size = 100` is a valid filter string. - * @param {Object} [request.readTime] - * Time used as a reference point when filtering findings. The filter is - * limited to findings existing at the supplied time and their values are - * those at that specific time. Absence of this field will default to the - * API's version of NOW. - * - * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} - * @param {number} [request.pageSize] - * The maximum number of resources contained in the underlying API - * response. If page streaming is performed per-resource, this - * parameter does not affect the return value. If page streaming is - * performed per-page, this determines the maximum number of - * resources in a page. - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Array, ?Object, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is Array of [GroupResult]{@link google.cloud.securitycenter.v1beta1.GroupResult}. - * - * When autoPaginate: false is specified through options, it contains the result - * in a single response. If the response indicates the next page exists, the third - * parameter is set to be used for the next request object. The fourth parameter keeps - * the raw response object of an object representing [GroupFindingsResponse]{@link google.cloud.securitycenter.v1beta1.GroupFindingsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of [GroupResult]{@link google.cloud.securitycenter.v1beta1.GroupResult}. - * - * When autoPaginate: false is specified through options, the array has three elements. - * The first element is Array of [GroupResult]{@link google.cloud.securitycenter.v1beta1.GroupResult} in a single response. - * The second element is the next request object if the response - * indicates the next page exists, or null. The third element is - * an object representing [GroupFindingsResponse]{@link google.cloud.securitycenter.v1beta1.GroupFindingsResponse}. - * - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const securityCenter = require('@google-cloud/security-center'); - * - * const client = new securityCenter.v1beta1.SecurityCenterClient({ - * // optional auth parameters. - * }); - * - * // Iterate over all elements. - * const formattedParent = client.sourcePath('[ORGANIZATION]', '[SOURCE]'); - * const groupBy = ''; - * const request = { - * parent: formattedParent, - * groupBy: groupBy, - * }; - * - * client.groupFindings(request) - * .then(responses => { - * const resources = responses[0]; - * for (const resource of resources) { - * // doThingsWith(resource) - * } - * }) - * .catch(err => { - * console.error(err); - * }); - * - * // Or obtain the paged response. - * const formattedParent = client.sourcePath('[ORGANIZATION]', '[SOURCE]'); - * const groupBy = ''; - * const request = { - * parent: formattedParent, - * groupBy: groupBy, - * }; - * - * - * const options = {autoPaginate: false}; - * const callback = responses => { - * // The actual resources in a response. - * const resources = responses[0]; - * // The next request if the response shows that there are more responses. - * const nextRequest = responses[1]; - * // The actual response object, if necessary. - * // const rawResponse = responses[2]; - * for (const resource of resources) { - * // doThingsWith(resource); - * } - * if (nextRequest) { - * // Fetch the next page. - * return client.groupFindings(nextRequest, options).then(callback); - * } - * } - * client.groupFindings(request, options) - * .then(callback) - * .catch(err => { - * console.error(err); - * }); - */ - groupFindings(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent, - }); - - return this._innerApiCalls.groupFindings(request, options, callback); - } - - /** - * Equivalent to {@link groupFindings}, but returns a NodeJS Stream object. - * - * This fetches the paged responses for {@link groupFindings} continuously - * and invokes the callback registered for 'data' event for each element in the - * responses. - * - * The returned object has 'end' method when no more elements are required. - * - * autoPaginate option will be ignored. - * - * @see {@link https://nodejs.org/api/stream.html} - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Name of the source to groupBy. Its format is - * "organizations/[organization_id]/sources/[source_id]". To groupBy across - * all sources provide a source_id of `-`. For example: - * organizations/{organization_id}/sources/- - * @param {string} request.groupBy - * Required. Expression that defines what assets fields to use for grouping (including - * `state`). The string value should follow SQL syntax: comma separated list - * of fields. For example: - * "parent,resource_name". - * - * The following fields are supported: - * - * * resource_name - * * category - * * state - * * parent - * @param {string} [request.filter] - * Expression that defines the filter to apply across findings. - * The expression is a list of one or more restrictions combined via logical - * operators `AND` and `OR`. - * Parentheses are not supported, and `OR` has higher precedence than `AND`. - * - * Restrictions have the form ` ` and may have a `-` - * character in front of them to indicate negation. Examples include: - * - * * name - * * source_properties.a_property - * * security_marks.marks.marka - * - * The supported operators are: - * - * * `=` for all value types. - * * `>`, `<`, `>=`, `<=` for integer values. - * * `:`, meaning substring matching, for strings. - * - * The supported value types are: - * - * * string literals in quotes. - * * integer literals without quotes. - * * boolean literals `true` and `false` without quotes. - * - * For example, `source_properties.size = 100` is a valid filter string. - * @param {Object} [request.readTime] - * Time used as a reference point when filtering findings. The filter is - * limited to findings existing at the supplied time and their values are - * those at that specific time. Absence of this field will default to the - * API's version of NOW. - * - * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} - * @param {number} [request.pageSize] - * The maximum number of resources contained in the underlying API - * response. If page streaming is performed per-resource, this - * parameter does not affect the return value. If page streaming is - * performed per-page, this determines the maximum number of - * resources in a page. - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @returns {Stream} - * An object stream which emits an object representing [GroupResult]{@link google.cloud.securitycenter.v1beta1.GroupResult} on 'data' event. - * - * @example - * - * const securityCenter = require('@google-cloud/security-center'); - * - * const client = new securityCenter.v1beta1.SecurityCenterClient({ - * // optional auth parameters. - * }); - * - * const formattedParent = client.sourcePath('[ORGANIZATION]', '[SOURCE]'); - * const groupBy = ''; - * const request = { - * parent: formattedParent, - * groupBy: groupBy, - * }; - * client.groupFindingsStream(request) - * .on('data', element => { - * // doThingsWith(element) - * }).on('error', err => { - * console.log(err); - * }); - */ - groupFindingsStream(request, options) { - options = options || {}; - - return this._descriptors.page.groupFindings.createStream( - this._innerApiCalls.groupFindings, - request, - options - ); - } - - /** - * Lists an organization's assets. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Name of the organization assets should belong to. Its format is - * "organizations/[organization_id]". - * @param {string} [request.filter] - * Expression that defines the filter to apply across assets. - * The expression is a list of zero or more restrictions combined via logical - * operators `AND` and `OR`. - * Parentheses are not supported, and `OR` has higher precedence than `AND`. - * - * Restrictions have the form ` ` and may have a `-` - * character in front of them to indicate negation. The fields map to those - * defined in the Asset resource. Examples include: - * - * * name - * * security_center_properties.resource_name - * * resource_properties.a_property - * * security_marks.marks.marka - * - * The supported operators are: - * - * * `=` for all value types. - * * `>`, `<`, `>=`, `<=` for integer values. - * * `:`, meaning substring matching, for strings. - * - * The supported value types are: - * - * * string literals in quotes. - * * integer literals without quotes. - * * boolean literals `true` and `false` without quotes. - * - * For example, `resource_properties.size = 100` is a valid filter string. - * @param {string} [request.orderBy] - * Expression that defines what fields and order to use for sorting. The - * string value should follow SQL syntax: comma separated list of fields. For - * example: "name,resource_properties.a_property". The default sorting order - * is ascending. To specify descending order for a field, a suffix " desc" - * should be appended to the field name. For example: "name - * desc,resource_properties.a_property". Redundant space characters in the - * syntax are insignificant. "name desc,resource_properties.a_property" and " - * name desc , resource_properties.a_property " are equivalent. - * @param {Object} [request.readTime] - * Time used as a reference point when filtering assets. The filter is limited - * to assets existing at the supplied time and their values are those at that - * specific time. Absence of this field will default to the API's version of - * NOW. - * - * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} - * @param {Object} [request.compareDuration] - * When compare_duration is set, the ListAssetResult's "state" attribute is - * updated to indicate whether the asset was added, removed, or remained - * present during the compare_duration period of time that precedes the - * read_time. This is the time between (read_time - - * compare_duration) and read_time. - * - * The state value is derived based on the presence of the asset at the two - * points in time. Intermediate state changes between the two times don't - * affect the result. For example, the results aren't affected if the asset is - * removed and re-created again. - * - * Possible "state" values when compare_duration is specified: - * - * * "ADDED": indicates that the asset was not present before - * compare_duration, but present at read_time. - * * "REMOVED": indicates that the asset was present at the start of - * compare_duration, but not present at read_time. - * * "ACTIVE": indicates that the asset was present at both the - * start and the end of the time period defined by - * compare_duration and read_time. - * - * If compare_duration is not specified, then the only possible state is - * "UNUSED", which indicates that the asset is present at read_time. - * - * This object should have the same structure as [Duration]{@link google.protobuf.Duration} - * @param {Object} [request.fieldMask] - * Optional. A field mask to specify the ListAssetsResult fields to be listed in the - * response. - * An empty field mask will list all fields. - * - * This object should have the same structure as [FieldMask]{@link google.protobuf.FieldMask} - * @param {number} [request.pageSize] - * The maximum number of resources contained in the underlying API - * response. If page streaming is performed per-resource, this - * parameter does not affect the return value. If page streaming is - * performed per-page, this determines the maximum number of - * resources in a page. - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Array, ?Object, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is Array of [ListAssetsResult]{@link google.cloud.securitycenter.v1beta1.ListAssetsResult}. - * - * When autoPaginate: false is specified through options, it contains the result - * in a single response. If the response indicates the next page exists, the third - * parameter is set to be used for the next request object. The fourth parameter keeps - * the raw response object of an object representing [ListAssetsResponse]{@link google.cloud.securitycenter.v1beta1.ListAssetsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of [ListAssetsResult]{@link google.cloud.securitycenter.v1beta1.ListAssetsResult}. - * - * When autoPaginate: false is specified through options, the array has three elements. - * The first element is Array of [ListAssetsResult]{@link google.cloud.securitycenter.v1beta1.ListAssetsResult} in a single response. - * The second element is the next request object if the response - * indicates the next page exists, or null. The third element is - * an object representing [ListAssetsResponse]{@link google.cloud.securitycenter.v1beta1.ListAssetsResponse}. - * - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const securityCenter = require('@google-cloud/security-center'); - * - * const client = new securityCenter.v1beta1.SecurityCenterClient({ - * // optional auth parameters. - * }); - * - * // Iterate over all elements. - * const formattedParent = client.organizationPath('[ORGANIZATION]'); - * - * client.listAssets({parent: formattedParent}) - * .then(responses => { - * const resources = responses[0]; - * for (const resource of resources) { - * // doThingsWith(resource) - * } - * }) - * .catch(err => { - * console.error(err); - * }); - * - * // Or obtain the paged response. - * const formattedParent = client.organizationPath('[ORGANIZATION]'); - * - * - * const options = {autoPaginate: false}; - * const callback = responses => { - * // The actual resources in a response. - * const resources = responses[0]; - * // The next request if the response shows that there are more responses. - * const nextRequest = responses[1]; - * // The actual response object, if necessary. - * // const rawResponse = responses[2]; - * for (const resource of resources) { - * // doThingsWith(resource); - * } - * if (nextRequest) { - * // Fetch the next page. - * return client.listAssets(nextRequest, options).then(callback); - * } - * } - * client.listAssets({parent: formattedParent}, options) - * .then(callback) - * .catch(err => { - * console.error(err); - * }); - */ - listAssets(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent, - }); - - return this._innerApiCalls.listAssets(request, options, callback); - } - - /** - * Equivalent to {@link listAssets}, but returns a NodeJS Stream object. - * - * This fetches the paged responses for {@link listAssets} continuously - * and invokes the callback registered for 'data' event for each element in the - * responses. - * - * The returned object has 'end' method when no more elements are required. - * - * autoPaginate option will be ignored. - * - * @see {@link https://nodejs.org/api/stream.html} - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Name of the organization assets should belong to. Its format is - * "organizations/[organization_id]". - * @param {string} [request.filter] - * Expression that defines the filter to apply across assets. - * The expression is a list of zero or more restrictions combined via logical - * operators `AND` and `OR`. - * Parentheses are not supported, and `OR` has higher precedence than `AND`. - * - * Restrictions have the form ` ` and may have a `-` - * character in front of them to indicate negation. The fields map to those - * defined in the Asset resource. Examples include: - * - * * name - * * security_center_properties.resource_name - * * resource_properties.a_property - * * security_marks.marks.marka - * - * The supported operators are: - * - * * `=` for all value types. - * * `>`, `<`, `>=`, `<=` for integer values. - * * `:`, meaning substring matching, for strings. - * - * The supported value types are: - * - * * string literals in quotes. - * * integer literals without quotes. - * * boolean literals `true` and `false` without quotes. - * - * For example, `resource_properties.size = 100` is a valid filter string. - * @param {string} [request.orderBy] - * Expression that defines what fields and order to use for sorting. The - * string value should follow SQL syntax: comma separated list of fields. For - * example: "name,resource_properties.a_property". The default sorting order - * is ascending. To specify descending order for a field, a suffix " desc" - * should be appended to the field name. For example: "name - * desc,resource_properties.a_property". Redundant space characters in the - * syntax are insignificant. "name desc,resource_properties.a_property" and " - * name desc , resource_properties.a_property " are equivalent. - * @param {Object} [request.readTime] - * Time used as a reference point when filtering assets. The filter is limited - * to assets existing at the supplied time and their values are those at that - * specific time. Absence of this field will default to the API's version of - * NOW. - * - * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} - * @param {Object} [request.compareDuration] - * When compare_duration is set, the ListAssetResult's "state" attribute is - * updated to indicate whether the asset was added, removed, or remained - * present during the compare_duration period of time that precedes the - * read_time. This is the time between (read_time - - * compare_duration) and read_time. - * - * The state value is derived based on the presence of the asset at the two - * points in time. Intermediate state changes between the two times don't - * affect the result. For example, the results aren't affected if the asset is - * removed and re-created again. - * - * Possible "state" values when compare_duration is specified: - * - * * "ADDED": indicates that the asset was not present before - * compare_duration, but present at read_time. - * * "REMOVED": indicates that the asset was present at the start of - * compare_duration, but not present at read_time. - * * "ACTIVE": indicates that the asset was present at both the - * start and the end of the time period defined by - * compare_duration and read_time. - * - * If compare_duration is not specified, then the only possible state is - * "UNUSED", which indicates that the asset is present at read_time. - * - * This object should have the same structure as [Duration]{@link google.protobuf.Duration} - * @param {Object} [request.fieldMask] - * Optional. A field mask to specify the ListAssetsResult fields to be listed in the - * response. - * An empty field mask will list all fields. - * - * This object should have the same structure as [FieldMask]{@link google.protobuf.FieldMask} - * @param {number} [request.pageSize] - * The maximum number of resources contained in the underlying API - * response. If page streaming is performed per-resource, this - * parameter does not affect the return value. If page streaming is - * performed per-page, this determines the maximum number of - * resources in a page. - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @returns {Stream} - * An object stream which emits an object representing [ListAssetsResult]{@link google.cloud.securitycenter.v1beta1.ListAssetsResult} on 'data' event. - * - * @example - * - * const securityCenter = require('@google-cloud/security-center'); - * - * const client = new securityCenter.v1beta1.SecurityCenterClient({ - * // optional auth parameters. - * }); - * - * const formattedParent = client.organizationPath('[ORGANIZATION]'); - * client.listAssetsStream({parent: formattedParent}) - * .on('data', element => { - * // doThingsWith(element) - * }).on('error', err => { - * console.log(err); - * }); - */ - listAssetsStream(request, options) { - options = options || {}; - - return this._descriptors.page.listAssets.createStream( - this._innerApiCalls.listAssets, - request, - options - ); - } - - /** - * Lists an organization or source's findings. - * - * To list across all sources provide a `-` as the source id. - * Example: /v1beta1/organizations/{organization_id}/sources/-/findings - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Name of the source the findings belong to. Its format is - * "organizations/[organization_id]/sources/[source_id]". To list across all - * sources provide a source_id of `-`. For example: - * organizations/{organization_id}/sources/- - * @param {string} [request.filter] - * Expression that defines the filter to apply across findings. - * The expression is a list of one or more restrictions combined via logical - * operators `AND` and `OR`. - * Parentheses are not supported, and `OR` has higher precedence than `AND`. - * - * Restrictions have the form ` ` and may have a `-` - * character in front of them to indicate negation. Examples include: - * - * * name - * * source_properties.a_property - * * security_marks.marks.marka - * - * The supported operators are: - * - * * `=` for all value types. - * * `>`, `<`, `>=`, `<=` for integer values. - * * `:`, meaning substring matching, for strings. - * - * The supported value types are: - * - * * string literals in quotes. - * * integer literals without quotes. - * * boolean literals `true` and `false` without quotes. - * - * For example, `source_properties.size = 100` is a valid filter string. - * @param {string} [request.orderBy] - * Expression that defines what fields and order to use for sorting. The - * string value should follow SQL syntax: comma separated list of fields. For - * example: "name,resource_properties.a_property". The default sorting order - * is ascending. To specify descending order for a field, a suffix " desc" - * should be appended to the field name. For example: "name - * desc,source_properties.a_property". Redundant space characters in the - * syntax are insignificant. "name desc,source_properties.a_property" and " - * name desc , source_properties.a_property " are equivalent. - * @param {Object} [request.readTime] - * Time used as a reference point when filtering findings. The filter is - * limited to findings existing at the supplied time and their values are - * those at that specific time. Absence of this field will default to the - * API's version of NOW. - * - * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} - * @param {Object} [request.fieldMask] - * Optional. A field mask to specify the Finding fields to be listed in the response. - * An empty field mask will list all fields. - * - * This object should have the same structure as [FieldMask]{@link google.protobuf.FieldMask} - * @param {number} [request.pageSize] - * The maximum number of resources contained in the underlying API - * response. If page streaming is performed per-resource, this - * parameter does not affect the return value. If page streaming is - * performed per-page, this determines the maximum number of - * resources in a page. - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Array, ?Object, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is Array of [Finding]{@link google.cloud.securitycenter.v1beta1.Finding}. - * - * When autoPaginate: false is specified through options, it contains the result - * in a single response. If the response indicates the next page exists, the third - * parameter is set to be used for the next request object. The fourth parameter keeps - * the raw response object of an object representing [ListFindingsResponse]{@link google.cloud.securitycenter.v1beta1.ListFindingsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of [Finding]{@link google.cloud.securitycenter.v1beta1.Finding}. - * - * When autoPaginate: false is specified through options, the array has three elements. - * The first element is Array of [Finding]{@link google.cloud.securitycenter.v1beta1.Finding} in a single response. - * The second element is the next request object if the response - * indicates the next page exists, or null. The third element is - * an object representing [ListFindingsResponse]{@link google.cloud.securitycenter.v1beta1.ListFindingsResponse}. - * - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const securityCenter = require('@google-cloud/security-center'); - * - * const client = new securityCenter.v1beta1.SecurityCenterClient({ - * // optional auth parameters. - * }); - * - * // Iterate over all elements. - * const formattedParent = client.sourcePath('[ORGANIZATION]', '[SOURCE]'); - * - * client.listFindings({parent: formattedParent}) - * .then(responses => { - * const resources = responses[0]; - * for (const resource of resources) { - * // doThingsWith(resource) - * } - * }) - * .catch(err => { - * console.error(err); - * }); - * - * // Or obtain the paged response. - * const formattedParent = client.sourcePath('[ORGANIZATION]', '[SOURCE]'); - * - * - * const options = {autoPaginate: false}; - * const callback = responses => { - * // The actual resources in a response. - * const resources = responses[0]; - * // The next request if the response shows that there are more responses. - * const nextRequest = responses[1]; - * // The actual response object, if necessary. - * // const rawResponse = responses[2]; - * for (const resource of resources) { - * // doThingsWith(resource); - * } - * if (nextRequest) { - * // Fetch the next page. - * return client.listFindings(nextRequest, options).then(callback); - * } - * } - * client.listFindings({parent: formattedParent}, options) - * .then(callback) - * .catch(err => { - * console.error(err); - * }); - */ - listFindings(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent, - }); - - return this._innerApiCalls.listFindings(request, options, callback); - } - - /** - * Equivalent to {@link listFindings}, but returns a NodeJS Stream object. - * - * This fetches the paged responses for {@link listFindings} continuously - * and invokes the callback registered for 'data' event for each element in the - * responses. - * - * The returned object has 'end' method when no more elements are required. - * - * autoPaginate option will be ignored. - * - * @see {@link https://nodejs.org/api/stream.html} - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Name of the source the findings belong to. Its format is - * "organizations/[organization_id]/sources/[source_id]". To list across all - * sources provide a source_id of `-`. For example: - * organizations/{organization_id}/sources/- - * @param {string} [request.filter] - * Expression that defines the filter to apply across findings. - * The expression is a list of one or more restrictions combined via logical - * operators `AND` and `OR`. - * Parentheses are not supported, and `OR` has higher precedence than `AND`. - * - * Restrictions have the form ` ` and may have a `-` - * character in front of them to indicate negation. Examples include: - * - * * name - * * source_properties.a_property - * * security_marks.marks.marka - * - * The supported operators are: - * - * * `=` for all value types. - * * `>`, `<`, `>=`, `<=` for integer values. - * * `:`, meaning substring matching, for strings. - * - * The supported value types are: - * - * * string literals in quotes. - * * integer literals without quotes. - * * boolean literals `true` and `false` without quotes. - * - * For example, `source_properties.size = 100` is a valid filter string. - * @param {string} [request.orderBy] - * Expression that defines what fields and order to use for sorting. The - * string value should follow SQL syntax: comma separated list of fields. For - * example: "name,resource_properties.a_property". The default sorting order - * is ascending. To specify descending order for a field, a suffix " desc" - * should be appended to the field name. For example: "name - * desc,source_properties.a_property". Redundant space characters in the - * syntax are insignificant. "name desc,source_properties.a_property" and " - * name desc , source_properties.a_property " are equivalent. - * @param {Object} [request.readTime] - * Time used as a reference point when filtering findings. The filter is - * limited to findings existing at the supplied time and their values are - * those at that specific time. Absence of this field will default to the - * API's version of NOW. - * - * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} - * @param {Object} [request.fieldMask] - * Optional. A field mask to specify the Finding fields to be listed in the response. - * An empty field mask will list all fields. - * - * This object should have the same structure as [FieldMask]{@link google.protobuf.FieldMask} - * @param {number} [request.pageSize] - * The maximum number of resources contained in the underlying API - * response. If page streaming is performed per-resource, this - * parameter does not affect the return value. If page streaming is - * performed per-page, this determines the maximum number of - * resources in a page. - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @returns {Stream} - * An object stream which emits an object representing [Finding]{@link google.cloud.securitycenter.v1beta1.Finding} on 'data' event. - * - * @example - * - * const securityCenter = require('@google-cloud/security-center'); - * - * const client = new securityCenter.v1beta1.SecurityCenterClient({ - * // optional auth parameters. - * }); - * - * const formattedParent = client.sourcePath('[ORGANIZATION]', '[SOURCE]'); - * client.listFindingsStream({parent: formattedParent}) - * .on('data', element => { - * // doThingsWith(element) - * }).on('error', err => { - * console.log(err); - * }); - */ - listFindingsStream(request, options) { - options = options || {}; - - return this._descriptors.page.listFindings.createStream( - this._innerApiCalls.listFindings, - request, - options - ); - } - - /** - * Lists all sources belonging to an organization. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Resource name of the parent of sources to list. Its format should be - * "organizations/[organization_id]". - * @param {number} [request.pageSize] - * The maximum number of resources contained in the underlying API - * response. If page streaming is performed per-resource, this - * parameter does not affect the return value. If page streaming is - * performed per-page, this determines the maximum number of - * resources in a page. - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Array, ?Object, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is Array of [Source]{@link google.cloud.securitycenter.v1beta1.Source}. - * - * When autoPaginate: false is specified through options, it contains the result - * in a single response. If the response indicates the next page exists, the third - * parameter is set to be used for the next request object. The fourth parameter keeps - * the raw response object of an object representing [ListSourcesResponse]{@link google.cloud.securitycenter.v1beta1.ListSourcesResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of [Source]{@link google.cloud.securitycenter.v1beta1.Source}. - * - * When autoPaginate: false is specified through options, the array has three elements. - * The first element is Array of [Source]{@link google.cloud.securitycenter.v1beta1.Source} in a single response. - * The second element is the next request object if the response - * indicates the next page exists, or null. The third element is - * an object representing [ListSourcesResponse]{@link google.cloud.securitycenter.v1beta1.ListSourcesResponse}. - * - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const securityCenter = require('@google-cloud/security-center'); - * - * const client = new securityCenter.v1beta1.SecurityCenterClient({ - * // optional auth parameters. - * }); - * - * // Iterate over all elements. - * const formattedParent = client.organizationPath('[ORGANIZATION]'); - * - * client.listSources({parent: formattedParent}) - * .then(responses => { - * const resources = responses[0]; - * for (const resource of resources) { - * // doThingsWith(resource) - * } - * }) - * .catch(err => { - * console.error(err); - * }); - * - * // Or obtain the paged response. - * const formattedParent = client.organizationPath('[ORGANIZATION]'); - * - * - * const options = {autoPaginate: false}; - * const callback = responses => { - * // The actual resources in a response. - * const resources = responses[0]; - * // The next request if the response shows that there are more responses. - * const nextRequest = responses[1]; - * // The actual response object, if necessary. - * // const rawResponse = responses[2]; - * for (const resource of resources) { - * // doThingsWith(resource); - * } - * if (nextRequest) { - * // Fetch the next page. - * return client.listSources(nextRequest, options).then(callback); - * } - * } - * client.listSources({parent: formattedParent}, options) - * .then(callback) - * .catch(err => { - * console.error(err); - * }); - */ - listSources(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent, - }); - - return this._innerApiCalls.listSources(request, options, callback); - } - - /** - * Equivalent to {@link listSources}, but returns a NodeJS Stream object. - * - * This fetches the paged responses for {@link listSources} continuously - * and invokes the callback registered for 'data' event for each element in the - * responses. - * - * The returned object has 'end' method when no more elements are required. - * - * autoPaginate option will be ignored. - * - * @see {@link https://nodejs.org/api/stream.html} - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Resource name of the parent of sources to list. Its format should be - * "organizations/[organization_id]". - * @param {number} [request.pageSize] - * The maximum number of resources contained in the underlying API - * response. If page streaming is performed per-resource, this - * parameter does not affect the return value. If page streaming is - * performed per-page, this determines the maximum number of - * resources in a page. - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @returns {Stream} - * An object stream which emits an object representing [Source]{@link google.cloud.securitycenter.v1beta1.Source} on 'data' event. - * - * @example - * - * const securityCenter = require('@google-cloud/security-center'); - * - * const client = new securityCenter.v1beta1.SecurityCenterClient({ - * // optional auth parameters. - * }); - * - * const formattedParent = client.organizationPath('[ORGANIZATION]'); - * client.listSourcesStream({parent: formattedParent}) - * .on('data', element => { - * // doThingsWith(element) - * }).on('error', err => { - * console.log(err); - * }); - */ - listSourcesStream(request, options) { - options = options || {}; - - return this._descriptors.page.listSources.createStream( - this._innerApiCalls.listSources, - request, - options - ); - } - - /** - * Runs asset discovery. The discovery is tracked with a long-running - * operation. - * - * This API can only be called with limited frequency for an organization. If - * it is called too frequently the caller will receive a TOO_MANY_REQUESTS - * error. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Name of the organization to run asset discovery for. Its format is - * "organizations/[organization_id]". - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is a [gax.Operation]{@link https://googleapis.github.io/gax-nodejs/classes/Operation.html} object. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is a [gax.Operation]{@link https://googleapis.github.io/gax-nodejs/classes/Operation.html} object. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const securityCenter = require('@google-cloud/security-center'); - * - * const client = new securityCenter.v1beta1.SecurityCenterClient({ - * // optional auth parameters. - * }); - * - * const formattedParent = client.organizationPath('[ORGANIZATION]'); - * - * // Handle the operation using the promise pattern. - * client.runAssetDiscovery({parent: formattedParent}) - * .then(responses => { - * const [operation, initialApiResponse] = responses; - * - * // Operation#promise starts polling for the completion of the LRO. - * return operation.promise(); - * }) - * .then(responses => { - * const result = responses[0]; - * const metadata = responses[1]; - * const finalApiResponse = responses[2]; - * }) - * .catch(err => { - * console.error(err); - * }); - * - * const formattedParent = client.organizationPath('[ORGANIZATION]'); - * - * // Handle the operation using the event emitter pattern. - * client.runAssetDiscovery({parent: formattedParent}) - * .then(responses => { - * const [operation, initialApiResponse] = responses; - * - * // Adding a listener for the "complete" event starts polling for the - * // completion of the operation. - * operation.on('complete', (result, metadata, finalApiResponse) => { - * // doSomethingWith(result); - * }); - * - * // Adding a listener for the "progress" event causes the callback to be - * // called on any change in metadata when the operation is polled. - * operation.on('progress', (metadata, apiResponse) => { - * // doSomethingWith(metadata) - * }); - * - * // Adding a listener for the "error" event handles any errors found during polling. - * operation.on('error', err => { - * // throw(err); - * }); - * }) - * .catch(err => { - * console.error(err); - * }); - * - * const formattedParent = client.organizationPath('[ORGANIZATION]'); - * - * // Handle the operation using the await pattern. - * const [operation] = await client.runAssetDiscovery({parent: formattedParent}); - * - * const [response] = await operation.promise(); - */ - runAssetDiscovery(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent, - }); - - return this._innerApiCalls.runAssetDiscovery(request, options, callback); - } - - /** - * Updates the state of a finding. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The relative resource name of the finding. See: - * https://cloud.google.com/apis/design/resource_names#relative_resource_name - * Example: - * "organizations/{organization_id}/sources/{source_id}/finding/{finding_id}". - * @param {number} request.state - * Required. The desired State of the finding. - * - * The number should be among the values of [State]{@link google.cloud.securitycenter.v1beta1.State} - * @param {Object} request.startTime - * Required. The time at which the updated state takes effect. - * - * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [Finding]{@link google.cloud.securitycenter.v1beta1.Finding}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Finding]{@link google.cloud.securitycenter.v1beta1.Finding}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const securityCenter = require('@google-cloud/security-center'); - * - * const client = new securityCenter.v1beta1.SecurityCenterClient({ - * // optional auth parameters. - * }); - * - * const formattedName = client.findingPath('[ORGANIZATION]', '[SOURCE]', '[FINDING]'); - * const state = 'STATE_UNSPECIFIED'; - * const startTime = {}; - * const request = { - * name: formattedName, - * state: state, - * startTime: startTime, - * }; - * client.setFindingState(request) - * .then(responses => { - * const response = responses[0]; - * // doThingsWith(response) - * }) - * .catch(err => { - * console.error(err); - * }); - */ - setFindingState(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - name: request.name, - }); - - return this._innerApiCalls.setFindingState(request, options, callback); - } - - /** - * Sets the access control policy on the specified Source. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy is being specified. - * See the operation documentation for the appropriate value for this field. - * @param {Object} request.policy - * REQUIRED: The complete policy to be applied to the `resource`. The size of - * the policy is limited to a few 10s of KB. An empty policy is a - * valid policy but certain Cloud Platform services (such as Projects) - * might reject them. - * - * This object should have the same structure as [Policy]{@link google.iam.v1.Policy} - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [Policy]{@link google.iam.v1.Policy}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Policy]{@link google.iam.v1.Policy}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const securityCenter = require('@google-cloud/security-center'); - * - * const client = new securityCenter.v1beta1.SecurityCenterClient({ - * // optional auth parameters. - * }); - * - * const formattedResource = client.sourcePath('[ORGANIZATION]', '[SOURCE]'); - * const policy = {}; - * const request = { - * resource: formattedResource, - * policy: policy, - * }; - * client.setIamPolicy(request) - * .then(responses => { - * const response = responses[0]; - * // doThingsWith(response) - * }) - * .catch(err => { - * console.error(err); - * }); - */ - setIamPolicy(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - resource: request.resource, - }); - - return this._innerApiCalls.setIamPolicy(request, options, callback); - } - - /** - * Returns the permissions that a caller has on the specified source. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy detail is being requested. - * See the operation documentation for the appropriate value for this field. - * @param {string[]} request.permissions - * The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For more - * information see - * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const securityCenter = require('@google-cloud/security-center'); - * - * const client = new securityCenter.v1beta1.SecurityCenterClient({ - * // optional auth parameters. - * }); - * - * const formattedResource = client.sourcePath('[ORGANIZATION]', '[SOURCE]'); - * const permissions = []; - * const request = { - * resource: formattedResource, - * permissions: permissions, - * }; - * client.testIamPermissions(request) - * .then(responses => { - * const response = responses[0]; - * // doThingsWith(response) - * }) - * .catch(err => { - * console.error(err); - * }); - */ - testIamPermissions(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - resource: request.resource, - }); - - return this._innerApiCalls.testIamPermissions(request, options, callback); - } - - /** - * Creates or updates a finding. The corresponding source must exist for a - * finding creation to succeed. - * - * @param {Object} request - * The request object that will be sent. - * @param {Object} request.finding - * Required. The finding resource to update or create if it does not already exist. - * parent, security_marks, and update_time will be ignored. - * - * In the case of creation, the finding id portion of the name must - * alphanumeric and less than or equal to 32 characters and greater than 0 - * characters in length. - * - * This object should have the same structure as [Finding]{@link google.cloud.securitycenter.v1beta1.Finding} - * @param {Object} [request.updateMask] - * The FieldMask to use when updating the finding resource. This field should - * not be specified when creating a finding. - * - * This object should have the same structure as [FieldMask]{@link google.protobuf.FieldMask} - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [Finding]{@link google.cloud.securitycenter.v1beta1.Finding}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Finding]{@link google.cloud.securitycenter.v1beta1.Finding}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const securityCenter = require('@google-cloud/security-center'); - * - * const client = new securityCenter.v1beta1.SecurityCenterClient({ - * // optional auth parameters. - * }); - * - * const finding = {}; - * client.updateFinding({finding: finding}) - * .then(responses => { - * const response = responses[0]; - * // doThingsWith(response) - * }) - * .catch(err => { - * console.error(err); - * }); - */ - updateFinding(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'finding.name': request.finding.name, - }); - - return this._innerApiCalls.updateFinding(request, options, callback); - } - - /** - * Updates an organization's settings. - * - * @param {Object} request - * The request object that will be sent. - * @param {Object} request.organizationSettings - * Required. The organization settings resource to update. - * - * This object should have the same structure as [OrganizationSettings]{@link google.cloud.securitycenter.v1beta1.OrganizationSettings} - * @param {Object} [request.updateMask] - * The FieldMask to use when updating the settings resource. - * - * This object should have the same structure as [FieldMask]{@link google.protobuf.FieldMask} - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [OrganizationSettings]{@link google.cloud.securitycenter.v1beta1.OrganizationSettings}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [OrganizationSettings]{@link google.cloud.securitycenter.v1beta1.OrganizationSettings}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const securityCenter = require('@google-cloud/security-center'); - * - * const client = new securityCenter.v1beta1.SecurityCenterClient({ - * // optional auth parameters. - * }); - * - * const organizationSettings = {}; - * client.updateOrganizationSettings({organizationSettings: organizationSettings}) - * .then(responses => { - * const response = responses[0]; - * // doThingsWith(response) - * }) - * .catch(err => { - * console.error(err); - * }); - */ - updateOrganizationSettings(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'organization_settings.name': request.organizationSettings.name, - }); - - return this._innerApiCalls.updateOrganizationSettings( - request, - options, - callback - ); - } - - /** - * Updates a source. - * - * @param {Object} request - * The request object that will be sent. - * @param {Object} request.source - * Required. The source resource to update. - * - * This object should have the same structure as [Source]{@link google.cloud.securitycenter.v1beta1.Source} - * @param {Object} [request.updateMask] - * The FieldMask to use when updating the source resource. - * - * This object should have the same structure as [FieldMask]{@link google.protobuf.FieldMask} - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [Source]{@link google.cloud.securitycenter.v1beta1.Source}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Source]{@link google.cloud.securitycenter.v1beta1.Source}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const securityCenter = require('@google-cloud/security-center'); - * - * const client = new securityCenter.v1beta1.SecurityCenterClient({ - * // optional auth parameters. - * }); - * - * const source = {}; - * client.updateSource({source: source}) - * .then(responses => { - * const response = responses[0]; - * // doThingsWith(response) - * }) - * .catch(err => { - * console.error(err); - * }); - */ - updateSource(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'source.name': request.source.name, - }); - - return this._innerApiCalls.updateSource(request, options, callback); - } - - /** - * Updates security marks. - * - * @param {Object} request - * The request object that will be sent. - * @param {Object} request.securityMarks - * Required. The security marks resource to update. - * - * This object should have the same structure as [SecurityMarks]{@link google.cloud.securitycenter.v1beta1.SecurityMarks} - * @param {Object} [request.updateMask] - * The FieldMask to use when updating the security marks resource. - * - * This object should have the same structure as [FieldMask]{@link google.protobuf.FieldMask} - * @param {Object} [request.startTime] - * The time at which the updated SecurityMarks take effect. - * - * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [SecurityMarks]{@link google.cloud.securitycenter.v1beta1.SecurityMarks}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [SecurityMarks]{@link google.cloud.securitycenter.v1beta1.SecurityMarks}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const securityCenter = require('@google-cloud/security-center'); - * - * const client = new securityCenter.v1beta1.SecurityCenterClient({ - * // optional auth parameters. - * }); - * - * const securityMarks = {}; - * client.updateSecurityMarks({securityMarks: securityMarks}) - * .then(responses => { - * const response = responses[0]; - * // doThingsWith(response) - * }) - * .catch(err => { - * console.error(err); - * }); - */ - updateSecurityMarks(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'security_marks.name': request.securityMarks.name, - }); - - return this._innerApiCalls.updateSecurityMarks(request, options, callback); - } - - // -------------------- - // -- Path templates -- - // -------------------- - - /** - * Return a fully-qualified asset_security_marks resource name string. - * - * @param {String} organization - * @param {String} asset - * @returns {String} - */ - assetSecurityMarksPath(organization, asset) { - return this._pathTemplates.assetSecurityMarksPathTemplate.render({ - organization: organization, - asset: asset, - }); - } - - /** - * Return a fully-qualified finding resource name string. - * - * @param {String} organization - * @param {String} source - * @param {String} finding - * @returns {String} - */ - findingPath(organization, source, finding) { - return this._pathTemplates.findingPathTemplate.render({ - organization: organization, - source: source, - finding: finding, - }); - } - - /** - * Return a fully-qualified finding_security_marks resource name string. - * - * @param {String} organization - * @param {String} source - * @param {String} finding - * @returns {String} - */ - findingSecurityMarksPath(organization, source, finding) { - return this._pathTemplates.findingSecurityMarksPathTemplate.render({ - organization: organization, - source: source, - finding: finding, - }); - } - - /** - * Return a fully-qualified organization resource name string. - * - * @param {String} organization - * @returns {String} - */ - organizationPath(organization) { - return this._pathTemplates.organizationPathTemplate.render({ - organization: organization, - }); - } - - /** - * Return a fully-qualified organization_settings resource name string. - * - * @param {String} organization - * @returns {String} - */ - organizationSettingsPath(organization) { - return this._pathTemplates.organizationSettingsPathTemplate.render({ - organization: organization, - }); - } - - /** - * Return a fully-qualified source resource name string. - * - * @param {String} organization - * @param {String} source - * @returns {String} - */ - sourcePath(organization, source) { - return this._pathTemplates.sourcePathTemplate.render({ - organization: organization, - source: source, - }); - } - - /** - * Parse the assetSecurityMarksName from a asset_security_marks resource. - * - * @param {String} assetSecurityMarksName - * A fully-qualified path representing a asset_security_marks resources. - * @returns {String} - A string representing the organization. - */ - matchOrganizationFromAssetSecurityMarksName(assetSecurityMarksName) { - return this._pathTemplates.assetSecurityMarksPathTemplate.match( - assetSecurityMarksName - ).organization; - } - - /** - * Parse the assetSecurityMarksName from a asset_security_marks resource. - * - * @param {String} assetSecurityMarksName - * A fully-qualified path representing a asset_security_marks resources. - * @returns {String} - A string representing the asset. - */ - matchAssetFromAssetSecurityMarksName(assetSecurityMarksName) { - return this._pathTemplates.assetSecurityMarksPathTemplate.match( - assetSecurityMarksName - ).asset; - } - - /** - * Parse the findingName from a finding resource. - * - * @param {String} findingName - * A fully-qualified path representing a finding resources. - * @returns {String} - A string representing the organization. - */ - matchOrganizationFromFindingName(findingName) { - return this._pathTemplates.findingPathTemplate.match(findingName) - .organization; - } - - /** - * Parse the findingName from a finding resource. - * - * @param {String} findingName - * A fully-qualified path representing a finding resources. - * @returns {String} - A string representing the source. - */ - matchSourceFromFindingName(findingName) { - return this._pathTemplates.findingPathTemplate.match(findingName).source; - } - - /** - * Parse the findingName from a finding resource. - * - * @param {String} findingName - * A fully-qualified path representing a finding resources. - * @returns {String} - A string representing the finding. - */ - matchFindingFromFindingName(findingName) { - return this._pathTemplates.findingPathTemplate.match(findingName).finding; - } - - /** - * Parse the findingSecurityMarksName from a finding_security_marks resource. - * - * @param {String} findingSecurityMarksName - * A fully-qualified path representing a finding_security_marks resources. - * @returns {String} - A string representing the organization. - */ - matchOrganizationFromFindingSecurityMarksName(findingSecurityMarksName) { - return this._pathTemplates.findingSecurityMarksPathTemplate.match( - findingSecurityMarksName - ).organization; - } - - /** - * Parse the findingSecurityMarksName from a finding_security_marks resource. - * - * @param {String} findingSecurityMarksName - * A fully-qualified path representing a finding_security_marks resources. - * @returns {String} - A string representing the source. - */ - matchSourceFromFindingSecurityMarksName(findingSecurityMarksName) { - return this._pathTemplates.findingSecurityMarksPathTemplate.match( - findingSecurityMarksName - ).source; - } - - /** - * Parse the findingSecurityMarksName from a finding_security_marks resource. - * - * @param {String} findingSecurityMarksName - * A fully-qualified path representing a finding_security_marks resources. - * @returns {String} - A string representing the finding. - */ - matchFindingFromFindingSecurityMarksName(findingSecurityMarksName) { - return this._pathTemplates.findingSecurityMarksPathTemplate.match( - findingSecurityMarksName - ).finding; - } - - /** - * Parse the organizationName from a organization resource. - * - * @param {String} organizationName - * A fully-qualified path representing a organization resources. - * @returns {String} - A string representing the organization. - */ - matchOrganizationFromOrganizationName(organizationName) { - return this._pathTemplates.organizationPathTemplate.match(organizationName) - .organization; - } - - /** - * Parse the organizationSettingsName from a organization_settings resource. - * - * @param {String} organizationSettingsName - * A fully-qualified path representing a organization_settings resources. - * @returns {String} - A string representing the organization. - */ - matchOrganizationFromOrganizationSettingsName(organizationSettingsName) { - return this._pathTemplates.organizationSettingsPathTemplate.match( - organizationSettingsName - ).organization; - } - - /** - * Parse the sourceName from a source resource. - * - * @param {String} sourceName - * A fully-qualified path representing a source resources. - * @returns {String} - A string representing the organization. - */ - matchOrganizationFromSourceName(sourceName) { - return this._pathTemplates.sourcePathTemplate.match(sourceName) - .organization; - } - - /** - * Parse the sourceName from a source resource. - * - * @param {String} sourceName - * A fully-qualified path representing a source resources. - * @returns {String} - A string representing the source. - */ - matchSourceFromSourceName(sourceName) { - return this._pathTemplates.sourcePathTemplate.match(sourceName).source; - } -} - -module.exports = SecurityCenterClient; diff --git a/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.ts b/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.ts new file mode 100644 index 00000000000..4758d24a627 --- /dev/null +++ b/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.ts @@ -0,0 +1,2821 @@ +// Copyright 2019 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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 gax from 'google-gax'; +import { + APICallback, + Callback, + CallOptions, + Descriptors, + ClientOptions, + LROperation, + PaginationCallback, + PaginationResponse, +} from 'google-gax'; +import * as path from 'path'; + +import {Transform} from 'stream'; +import * as protosTypes from '../../protos/protos'; +import * as gapicConfig from './security_center_client_config.json'; + +const version = require('../../../package.json').version; + +/** + * V1 Beta APIs for Security Center service. + * @class + * @memberof v1beta1 + */ +export class SecurityCenterClient { + private _descriptors: Descriptors = {page: {}, stream: {}, longrunning: {}}; + private _innerApiCalls: {[name: string]: Function}; + private _pathTemplates: {[name: string]: gax.PathTemplate}; + private _terminated = false; + auth: gax.GoogleAuth; + operationsClient: gax.OperationsClient; + securityCenterStub: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of SecurityCenterClient. + * + * @param {object} [options] - The configuration object. See the subsequent + * parameters for more details. + * @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 {function} [options.promise] - Custom promise module to use instead + * of native Promises. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + */ + + constructor(opts?: ClientOptions) { + // Ensure that options include the service address and port. + const staticMembers = this.constructor as typeof SecurityCenterClient; + const servicePath = + opts && opts.servicePath + ? opts.servicePath + : opts && opts.apiEndpoint + ? opts.apiEndpoint + : staticMembers.servicePath; + const port = opts && opts.port ? opts.port : staticMembers.port; + + if (!opts) { + opts = {servicePath, port}; + } + opts.servicePath = opts.servicePath || servicePath; + opts.port = opts.port || port; + opts.clientConfig = opts.clientConfig || {}; + + const isBrowser = typeof window !== 'undefined'; + if (isBrowser) { + opts.fallback = true; + } + // If we are in browser, we are already using fallback because of the + // "browser" field in package.json. + // But if we were explicitly requested to use fallback, let's do it now. + const gaxModule = !isBrowser && opts.fallback ? gax.fallback : gax; + + // Create a `gaxGrpc` object, with any grpc-specific options + // sent to the client. + opts.scopes = (this.constructor as typeof SecurityCenterClient).scopes; + const gaxGrpc = new gaxModule.GrpcClient(opts); + + // Save the auth object to the client, for use by other methods. + this.auth = gaxGrpc.auth as gax.GoogleAuth; + + // Determine the client header string. + const clientHeader = [`gax/${gaxModule.version}`, `gapic/${version}`]; + if (typeof process !== 'undefined' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + // For Node.js, pass the path to JSON proto file. + // For browsers, pass the JSON content. + + const nodejsProtoPath = path.join( + __dirname, + '..', + '..', + 'protos', + 'protos.json' + ); + const protos = gaxGrpc.loadProto( + opts.fallback ? require('../../protos/protos.json') : nodejsProtoPath + ); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this._pathTemplates = { + organizationAssetPathTemplate: new gaxModule.PathTemplate( + 'organizations/{organization}/assets/{asset}/securityMarks' + ), + organizationSourceFindingPathTemplate: new gaxModule.PathTemplate( + 'organizations/{organization}/sources/{source}/findings/{finding}/securityMarks' + ), + findingPathTemplate: new gaxModule.PathTemplate( + 'organizations/{organization}/sources/{source}/findings/{finding}' + ), + sourcePathTemplate: new gaxModule.PathTemplate( + 'organizations/{organization}/sources/{source}' + ), + organizationSettingsPathTemplate: new gaxModule.PathTemplate( + 'organizations/{organization}/organizationSettings' + ), + organizationPathTemplate: new gaxModule.PathTemplate( + 'organizations/{organization}' + ), + }; + + // Some of the methods on this service return "paged" results, + // (e.g. 50 results at a time, with tokens to get subsequent + // pages). Denote the keys used for pagination and results. + this._descriptors.page = { + groupAssets: new gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'groupByResults' + ), + groupFindings: new gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'groupByResults' + ), + listAssets: new gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'listAssetsResults' + ), + listFindings: new gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'findings' + ), + listSources: new gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'sources' + ), + }; + + // This API contains "long-running operations", which return a + // an Operation object that allows for tracking of the operation, + // rather than holding a request open. + const protoFilesRoot = opts.fallback + ? gaxModule.protobuf.Root.fromJSON(require('../../protos/protos.json')) + : gaxModule.protobuf.loadSync(nodejsProtoPath); + + this.operationsClient = gaxModule + .lro({ + auth: this.auth, + grpc: 'grpc' in gaxGrpc ? gaxGrpc.grpc : undefined, + }) + .operationsClient(opts); + const runAssetDiscoveryResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty' + ) as gax.protobuf.Type; + const runAssetDiscoveryMetadata = protoFilesRoot.lookup( + '.google.protobuf.Empty' + ) as gax.protobuf.Type; + + this._descriptors.longrunning = { + runAssetDiscovery: new gaxModule.LongrunningDescriptor( + this.operationsClient, + runAssetDiscoveryResponse.decode.bind(runAssetDiscoveryResponse), + runAssetDiscoveryMetadata.decode.bind(runAssetDiscoveryMetadata) + ), + }; + + // Put together the default options sent with requests. + const defaults = gaxGrpc.constructSettings( + 'google.cloud.securitycenter.v1beta1.SecurityCenter', + 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 = {}; + + // Put together the "service stub" for + // google.cloud.securitycenter.v1beta1.SecurityCenter. + this.securityCenterStub = gaxGrpc.createStub( + opts.fallback + ? (protos as protobuf.Root).lookupService( + 'google.cloud.securitycenter.v1beta1.SecurityCenter' + ) + : // tslint:disable-next-line no-any + (protos as any).google.cloud.securitycenter.v1beta1.SecurityCenter, + opts + ) as Promise<{[method: string]: Function}>; + + // Iterate over each of the methods that the service provides + // and create an API call method for each. + const securityCenterStubMethods = [ + 'createSource', + 'createFinding', + 'getIamPolicy', + 'getOrganizationSettings', + 'getSource', + 'groupAssets', + 'groupFindings', + 'listAssets', + 'listFindings', + 'listSources', + 'runAssetDiscovery', + 'setFindingState', + 'setIamPolicy', + 'testIamPermissions', + 'updateFinding', + 'updateOrganizationSettings', + 'updateSource', + 'updateSecurityMarks', + ]; + + for (const methodName of securityCenterStubMethods) { + const innerCallPromise = this.securityCenterStub.then( + stub => (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + return stub[methodName].apply(stub, args); + }, + (err: Error | null | undefined) => () => { + throw err; + } + ); + + const apiCall = gaxModule.createApiCall( + innerCallPromise, + defaults[methodName], + this._descriptors.page[methodName] || + this._descriptors.stream[methodName] || + this._descriptors.longrunning[methodName] + ); + + this._innerApiCalls[methodName] = ( + argument: {}, + callOptions?: CallOptions, + callback?: APICallback + ) => { + return apiCall(argument, callOptions, callback); + }; + } + } + + /** + * The DNS address for this API service. + */ + static get servicePath() { + return 'securitycenter.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath(), + * exists for compatibility reasons. + */ + static get apiEndpoint() { + return 'securitycenter.googleapis.com'; + } + + /** + * The port for this API service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + */ + static get scopes() { + return ['https://www.googleapis.com/auth/cloud-platform']; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @param {function(Error, string)} callback - the callback to + * be called with the current project Id. + */ + getProjectId( + callback?: Callback + ): Promise | void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- + createSource( + request: protosTypes.google.cloud.securitycenter.v1beta1.ICreateSourceRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.cloud.securitycenter.v1beta1.ISource, + ( + | protosTypes.google.cloud.securitycenter.v1beta1.ICreateSourceRequest + | undefined + ), + {} | undefined + ] + >; + createSource( + request: protosTypes.google.cloud.securitycenter.v1beta1.ICreateSourceRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.cloud.securitycenter.v1beta1.ISource, + | protosTypes.google.cloud.securitycenter.v1beta1.ICreateSourceRequest + | undefined, + {} | undefined + > + ): void; + /** + * Creates a source. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Resource name of the new source's parent. Its format should be + * "organizations/[organization_id]". + * @param {google.cloud.securitycenter.v1beta1.Source} request.source + * Required. The Source being created, only the display_name and description will be + * used. All other fields will be ignored. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Source]{@link google.cloud.securitycenter.v1beta1.Source}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + createSource( + request: protosTypes.google.cloud.securitycenter.v1beta1.ICreateSourceRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.cloud.securitycenter.v1beta1.ISource, + | protosTypes.google.cloud.securitycenter.v1beta1.ICreateSourceRequest + | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.cloud.securitycenter.v1beta1.ISource, + | protosTypes.google.cloud.securitycenter.v1beta1.ICreateSourceRequest + | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.cloud.securitycenter.v1beta1.ISource, + ( + | protosTypes.google.cloud.securitycenter.v1beta1.ICreateSourceRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + return this._innerApiCalls.createSource(request, options, callback); + } + createFinding( + request: protosTypes.google.cloud.securitycenter.v1beta1.ICreateFindingRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.cloud.securitycenter.v1beta1.IFinding, + ( + | protosTypes.google.cloud.securitycenter.v1beta1.ICreateFindingRequest + | undefined + ), + {} | undefined + ] + >; + createFinding( + request: protosTypes.google.cloud.securitycenter.v1beta1.ICreateFindingRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.cloud.securitycenter.v1beta1.IFinding, + | protosTypes.google.cloud.securitycenter.v1beta1.ICreateFindingRequest + | undefined, + {} | undefined + > + ): void; + /** + * Creates a finding. The corresponding source must exist for finding creation + * to succeed. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Resource name of the new finding's parent. Its format should be + * "organizations/[organization_id]/sources/[source_id]". + * @param {string} request.findingId + * Required. Unique identifier provided by the client within the parent scope. + * It must be alphanumeric and less than or equal to 32 characters and + * greater than 0 characters in length. + * @param {google.cloud.securitycenter.v1beta1.Finding} request.finding + * Required. The Finding being created. The name and security_marks will be ignored as + * they are both output only fields on this resource. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Finding]{@link google.cloud.securitycenter.v1beta1.Finding}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + createFinding( + request: protosTypes.google.cloud.securitycenter.v1beta1.ICreateFindingRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.cloud.securitycenter.v1beta1.IFinding, + | protosTypes.google.cloud.securitycenter.v1beta1.ICreateFindingRequest + | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.cloud.securitycenter.v1beta1.IFinding, + | protosTypes.google.cloud.securitycenter.v1beta1.ICreateFindingRequest + | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.cloud.securitycenter.v1beta1.IFinding, + ( + | protosTypes.google.cloud.securitycenter.v1beta1.ICreateFindingRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + return this._innerApiCalls.createFinding(request, options, callback); + } + getIamPolicy( + request: protosTypes.google.iam.v1.IGetIamPolicyRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.iam.v1.IPolicy, + protosTypes.google.iam.v1.IGetIamPolicyRequest | undefined, + {} | undefined + ] + >; + getIamPolicy( + request: protosTypes.google.iam.v1.IGetIamPolicyRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.iam.v1.IPolicy, + protosTypes.google.iam.v1.IGetIamPolicyRequest | undefined, + {} | undefined + > + ): void; + /** + * Gets the access control policy on the specified Source. + * + * @param {Object} request + * The request object that will be sent. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Policy]{@link google.iam.v1.Policy}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + getIamPolicy( + request: protosTypes.google.iam.v1.IGetIamPolicyRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.iam.v1.IPolicy, + protosTypes.google.iam.v1.IGetIamPolicyRequest | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.iam.v1.IPolicy, + protosTypes.google.iam.v1.IGetIamPolicyRequest | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.iam.v1.IPolicy, + protosTypes.google.iam.v1.IGetIamPolicyRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + resource: request.resource || '', + }); + return this._innerApiCalls.getIamPolicy(request, options, callback); + } + getOrganizationSettings( + request: protosTypes.google.cloud.securitycenter.v1beta1.IGetOrganizationSettingsRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.cloud.securitycenter.v1beta1.IOrganizationSettings, + ( + | protosTypes.google.cloud.securitycenter.v1beta1.IGetOrganizationSettingsRequest + | undefined + ), + {} | undefined + ] + >; + getOrganizationSettings( + request: protosTypes.google.cloud.securitycenter.v1beta1.IGetOrganizationSettingsRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.cloud.securitycenter.v1beta1.IOrganizationSettings, + | protosTypes.google.cloud.securitycenter.v1beta1.IGetOrganizationSettingsRequest + | undefined, + {} | undefined + > + ): void; + /** + * Gets the settings for an organization. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the organization to get organization settings for. Its format is + * "organizations/[organization_id]/organizationSettings". + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [OrganizationSettings]{@link google.cloud.securitycenter.v1beta1.OrganizationSettings}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + getOrganizationSettings( + request: protosTypes.google.cloud.securitycenter.v1beta1.IGetOrganizationSettingsRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.cloud.securitycenter.v1beta1.IOrganizationSettings, + | protosTypes.google.cloud.securitycenter.v1beta1.IGetOrganizationSettingsRequest + | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.cloud.securitycenter.v1beta1.IOrganizationSettings, + | protosTypes.google.cloud.securitycenter.v1beta1.IGetOrganizationSettingsRequest + | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.cloud.securitycenter.v1beta1.IOrganizationSettings, + ( + | protosTypes.google.cloud.securitycenter.v1beta1.IGetOrganizationSettingsRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + name: request.name || '', + }); + return this._innerApiCalls.getOrganizationSettings( + request, + options, + callback + ); + } + getSource( + request: protosTypes.google.cloud.securitycenter.v1beta1.IGetSourceRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.cloud.securitycenter.v1beta1.ISource, + ( + | protosTypes.google.cloud.securitycenter.v1beta1.IGetSourceRequest + | undefined + ), + {} | undefined + ] + >; + getSource( + request: protosTypes.google.cloud.securitycenter.v1beta1.IGetSourceRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.cloud.securitycenter.v1beta1.ISource, + | protosTypes.google.cloud.securitycenter.v1beta1.IGetSourceRequest + | undefined, + {} | undefined + > + ): void; + /** + * Gets a source. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Relative resource name of the source. Its format is + * "organizations/[organization_id]/source/[source_id]". + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Source]{@link google.cloud.securitycenter.v1beta1.Source}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + getSource( + request: protosTypes.google.cloud.securitycenter.v1beta1.IGetSourceRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.cloud.securitycenter.v1beta1.ISource, + | protosTypes.google.cloud.securitycenter.v1beta1.IGetSourceRequest + | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.cloud.securitycenter.v1beta1.ISource, + | protosTypes.google.cloud.securitycenter.v1beta1.IGetSourceRequest + | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.cloud.securitycenter.v1beta1.ISource, + ( + | protosTypes.google.cloud.securitycenter.v1beta1.IGetSourceRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + name: request.name || '', + }); + return this._innerApiCalls.getSource(request, options, callback); + } + setFindingState( + request: protosTypes.google.cloud.securitycenter.v1beta1.ISetFindingStateRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.cloud.securitycenter.v1beta1.IFinding, + ( + | protosTypes.google.cloud.securitycenter.v1beta1.ISetFindingStateRequest + | undefined + ), + {} | undefined + ] + >; + setFindingState( + request: protosTypes.google.cloud.securitycenter.v1beta1.ISetFindingStateRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.cloud.securitycenter.v1beta1.IFinding, + | protosTypes.google.cloud.securitycenter.v1beta1.ISetFindingStateRequest + | undefined, + {} | undefined + > + ): void; + /** + * Updates the state of a finding. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The relative resource name of the finding. See: + * https://cloud.google.com/apis/design/resource_names#relative_resource_name + * Example: + * "organizations/{organization_id}/sources/{source_id}/finding/{finding_id}". + * @param {google.cloud.securitycenter.v1beta1.Finding.State} request.state + * Required. The desired State of the finding. + * @param {google.protobuf.Timestamp} request.startTime + * Required. The time at which the updated state takes effect. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Finding]{@link google.cloud.securitycenter.v1beta1.Finding}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + setFindingState( + request: protosTypes.google.cloud.securitycenter.v1beta1.ISetFindingStateRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.cloud.securitycenter.v1beta1.IFinding, + | protosTypes.google.cloud.securitycenter.v1beta1.ISetFindingStateRequest + | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.cloud.securitycenter.v1beta1.IFinding, + | protosTypes.google.cloud.securitycenter.v1beta1.ISetFindingStateRequest + | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.cloud.securitycenter.v1beta1.IFinding, + ( + | protosTypes.google.cloud.securitycenter.v1beta1.ISetFindingStateRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + name: request.name || '', + }); + return this._innerApiCalls.setFindingState(request, options, callback); + } + setIamPolicy( + request: protosTypes.google.iam.v1.ISetIamPolicyRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.iam.v1.IPolicy, + protosTypes.google.iam.v1.ISetIamPolicyRequest | undefined, + {} | undefined + ] + >; + setIamPolicy( + request: protosTypes.google.iam.v1.ISetIamPolicyRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.iam.v1.IPolicy, + protosTypes.google.iam.v1.ISetIamPolicyRequest | undefined, + {} | undefined + > + ): void; + /** + * Sets the access control policy on the specified Source. + * + * @param {Object} request + * The request object that will be sent. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Policy]{@link google.iam.v1.Policy}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + setIamPolicy( + request: protosTypes.google.iam.v1.ISetIamPolicyRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.iam.v1.IPolicy, + protosTypes.google.iam.v1.ISetIamPolicyRequest | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.iam.v1.IPolicy, + protosTypes.google.iam.v1.ISetIamPolicyRequest | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.iam.v1.IPolicy, + protosTypes.google.iam.v1.ISetIamPolicyRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + resource: request.resource || '', + }); + return this._innerApiCalls.setIamPolicy(request, options, callback); + } + testIamPermissions( + request: protosTypes.google.iam.v1.ITestIamPermissionsRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.iam.v1.ITestIamPermissionsResponse, + protosTypes.google.iam.v1.ITestIamPermissionsRequest | undefined, + {} | undefined + ] + >; + testIamPermissions( + request: protosTypes.google.iam.v1.ITestIamPermissionsRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.iam.v1.ITestIamPermissionsResponse, + protosTypes.google.iam.v1.ITestIamPermissionsRequest | undefined, + {} | undefined + > + ): void; + /** + * Returns the permissions that a caller has on the specified source. + * + * @param {Object} request + * The request object that will be sent. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + testIamPermissions( + request: protosTypes.google.iam.v1.ITestIamPermissionsRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.iam.v1.ITestIamPermissionsResponse, + protosTypes.google.iam.v1.ITestIamPermissionsRequest | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.iam.v1.ITestIamPermissionsResponse, + protosTypes.google.iam.v1.ITestIamPermissionsRequest | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.iam.v1.ITestIamPermissionsResponse, + protosTypes.google.iam.v1.ITestIamPermissionsRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + resource: request.resource || '', + }); + return this._innerApiCalls.testIamPermissions(request, options, callback); + } + updateFinding( + request: protosTypes.google.cloud.securitycenter.v1beta1.IUpdateFindingRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.cloud.securitycenter.v1beta1.IFinding, + ( + | protosTypes.google.cloud.securitycenter.v1beta1.IUpdateFindingRequest + | undefined + ), + {} | undefined + ] + >; + updateFinding( + request: protosTypes.google.cloud.securitycenter.v1beta1.IUpdateFindingRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.cloud.securitycenter.v1beta1.IFinding, + | protosTypes.google.cloud.securitycenter.v1beta1.IUpdateFindingRequest + | undefined, + {} | undefined + > + ): void; + /** + * Creates or updates a finding. The corresponding source must exist for a + * finding creation to succeed. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.securitycenter.v1beta1.Finding} request.finding + * Required. The finding resource to update or create if it does not already exist. + * parent, security_marks, and update_time will be ignored. + * + * In the case of creation, the finding id portion of the name must + * alphanumeric and less than or equal to 32 characters and greater than 0 + * characters in length. + * @param {google.protobuf.FieldMask} request.updateMask + * The FieldMask to use when updating the finding resource. This field should + * not be specified when creating a finding. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Finding]{@link google.cloud.securitycenter.v1beta1.Finding}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + updateFinding( + request: protosTypes.google.cloud.securitycenter.v1beta1.IUpdateFindingRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.cloud.securitycenter.v1beta1.IFinding, + | protosTypes.google.cloud.securitycenter.v1beta1.IUpdateFindingRequest + | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.cloud.securitycenter.v1beta1.IFinding, + | protosTypes.google.cloud.securitycenter.v1beta1.IUpdateFindingRequest + | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.cloud.securitycenter.v1beta1.IFinding, + ( + | protosTypes.google.cloud.securitycenter.v1beta1.IUpdateFindingRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'finding.name': request.finding!.name || '', + }); + return this._innerApiCalls.updateFinding(request, options, callback); + } + updateOrganizationSettings( + request: protosTypes.google.cloud.securitycenter.v1beta1.IUpdateOrganizationSettingsRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.cloud.securitycenter.v1beta1.IOrganizationSettings, + ( + | protosTypes.google.cloud.securitycenter.v1beta1.IUpdateOrganizationSettingsRequest + | undefined + ), + {} | undefined + ] + >; + updateOrganizationSettings( + request: protosTypes.google.cloud.securitycenter.v1beta1.IUpdateOrganizationSettingsRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.cloud.securitycenter.v1beta1.IOrganizationSettings, + | protosTypes.google.cloud.securitycenter.v1beta1.IUpdateOrganizationSettingsRequest + | undefined, + {} | undefined + > + ): void; + /** + * Updates an organization's settings. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.securitycenter.v1beta1.OrganizationSettings} request.organizationSettings + * Required. The organization settings resource to update. + * @param {google.protobuf.FieldMask} request.updateMask + * The FieldMask to use when updating the settings resource. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [OrganizationSettings]{@link google.cloud.securitycenter.v1beta1.OrganizationSettings}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + updateOrganizationSettings( + request: protosTypes.google.cloud.securitycenter.v1beta1.IUpdateOrganizationSettingsRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.cloud.securitycenter.v1beta1.IOrganizationSettings, + | protosTypes.google.cloud.securitycenter.v1beta1.IUpdateOrganizationSettingsRequest + | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.cloud.securitycenter.v1beta1.IOrganizationSettings, + | protosTypes.google.cloud.securitycenter.v1beta1.IUpdateOrganizationSettingsRequest + | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.cloud.securitycenter.v1beta1.IOrganizationSettings, + ( + | protosTypes.google.cloud.securitycenter.v1beta1.IUpdateOrganizationSettingsRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'organization_settings.name': request.organizationSettings!.name || '', + }); + return this._innerApiCalls.updateOrganizationSettings( + request, + options, + callback + ); + } + updateSource( + request: protosTypes.google.cloud.securitycenter.v1beta1.IUpdateSourceRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.cloud.securitycenter.v1beta1.ISource, + ( + | protosTypes.google.cloud.securitycenter.v1beta1.IUpdateSourceRequest + | undefined + ), + {} | undefined + ] + >; + updateSource( + request: protosTypes.google.cloud.securitycenter.v1beta1.IUpdateSourceRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.cloud.securitycenter.v1beta1.ISource, + | protosTypes.google.cloud.securitycenter.v1beta1.IUpdateSourceRequest + | undefined, + {} | undefined + > + ): void; + /** + * Updates a source. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.securitycenter.v1beta1.Source} request.source + * Required. The source resource to update. + * @param {google.protobuf.FieldMask} request.updateMask + * The FieldMask to use when updating the source resource. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Source]{@link google.cloud.securitycenter.v1beta1.Source}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + updateSource( + request: protosTypes.google.cloud.securitycenter.v1beta1.IUpdateSourceRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.cloud.securitycenter.v1beta1.ISource, + | protosTypes.google.cloud.securitycenter.v1beta1.IUpdateSourceRequest + | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.cloud.securitycenter.v1beta1.ISource, + | protosTypes.google.cloud.securitycenter.v1beta1.IUpdateSourceRequest + | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.cloud.securitycenter.v1beta1.ISource, + ( + | protosTypes.google.cloud.securitycenter.v1beta1.IUpdateSourceRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'source.name': request.source!.name || '', + }); + return this._innerApiCalls.updateSource(request, options, callback); + } + updateSecurityMarks( + request: protosTypes.google.cloud.securitycenter.v1beta1.IUpdateSecurityMarksRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.cloud.securitycenter.v1beta1.ISecurityMarks, + ( + | protosTypes.google.cloud.securitycenter.v1beta1.IUpdateSecurityMarksRequest + | undefined + ), + {} | undefined + ] + >; + updateSecurityMarks( + request: protosTypes.google.cloud.securitycenter.v1beta1.IUpdateSecurityMarksRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.cloud.securitycenter.v1beta1.ISecurityMarks, + | protosTypes.google.cloud.securitycenter.v1beta1.IUpdateSecurityMarksRequest + | undefined, + {} | undefined + > + ): void; + /** + * Updates security marks. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.securitycenter.v1beta1.SecurityMarks} request.securityMarks + * Required. The security marks resource to update. + * @param {google.protobuf.FieldMask} request.updateMask + * The FieldMask to use when updating the security marks resource. + * @param {google.protobuf.Timestamp} request.startTime + * The time at which the updated SecurityMarks take effect. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [SecurityMarks]{@link google.cloud.securitycenter.v1beta1.SecurityMarks}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + updateSecurityMarks( + request: protosTypes.google.cloud.securitycenter.v1beta1.IUpdateSecurityMarksRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.cloud.securitycenter.v1beta1.ISecurityMarks, + | protosTypes.google.cloud.securitycenter.v1beta1.IUpdateSecurityMarksRequest + | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.cloud.securitycenter.v1beta1.ISecurityMarks, + | protosTypes.google.cloud.securitycenter.v1beta1.IUpdateSecurityMarksRequest + | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.cloud.securitycenter.v1beta1.ISecurityMarks, + ( + | protosTypes.google.cloud.securitycenter.v1beta1.IUpdateSecurityMarksRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'security_marks.name': request.securityMarks!.name || '', + }); + return this._innerApiCalls.updateSecurityMarks(request, options, callback); + } + + runAssetDiscovery( + request: protosTypes.google.cloud.securitycenter.v1beta1.IRunAssetDiscoveryRequest, + options?: gax.CallOptions + ): Promise< + [ + LROperation< + protosTypes.google.protobuf.IEmpty, + protosTypes.google.protobuf.IEmpty + >, + protosTypes.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + runAssetDiscovery( + request: protosTypes.google.cloud.securitycenter.v1beta1.IRunAssetDiscoveryRequest, + options: gax.CallOptions, + callback: Callback< + LROperation< + protosTypes.google.protobuf.IEmpty, + protosTypes.google.protobuf.IEmpty + >, + protosTypes.google.longrunning.IOperation | undefined, + {} | undefined + > + ): void; + /** + * Runs asset discovery. The discovery is tracked with a long-running + * operation. + * + * This API can only be called with limited frequency for an organization. If + * it is called too frequently the caller will receive a TOO_MANY_REQUESTS + * error. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Name of the organization to run asset discovery for. Its format is + * "organizations/[organization_id]". + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.longrunning.Operation}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + runAssetDiscovery( + request: protosTypes.google.cloud.securitycenter.v1beta1.IRunAssetDiscoveryRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + LROperation< + protosTypes.google.protobuf.IEmpty, + protosTypes.google.protobuf.IEmpty + >, + protosTypes.google.longrunning.IOperation | undefined, + {} | undefined + >, + callback?: Callback< + LROperation< + protosTypes.google.protobuf.IEmpty, + protosTypes.google.protobuf.IEmpty + >, + protosTypes.google.longrunning.IOperation | undefined, + {} | undefined + > + ): Promise< + [ + LROperation< + protosTypes.google.protobuf.IEmpty, + protosTypes.google.protobuf.IEmpty + >, + protosTypes.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + return this._innerApiCalls.runAssetDiscovery(request, options, callback); + } + groupAssets( + request: protosTypes.google.cloud.securitycenter.v1beta1.IGroupAssetsRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.cloud.securitycenter.v1beta1.IGroupResult[], + protosTypes.google.cloud.securitycenter.v1beta1.IGroupAssetsRequest | null, + protosTypes.google.cloud.securitycenter.v1beta1.IGroupAssetsResponse + ] + >; + groupAssets( + request: protosTypes.google.cloud.securitycenter.v1beta1.IGroupAssetsRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.cloud.securitycenter.v1beta1.IGroupResult[], + protosTypes.google.cloud.securitycenter.v1beta1.IGroupAssetsRequest | null, + protosTypes.google.cloud.securitycenter.v1beta1.IGroupAssetsResponse + > + ): void; + /** + * Filters an organization's assets and groups them by their specified + * properties. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Name of the organization to groupBy. Its format is + * "organizations/[organization_id]". + * @param {string} request.filter + * Expression that defines the filter to apply across assets. + * The expression is a list of zero or more restrictions combined via logical + * operators `AND` and `OR`. + * Parentheses are not supported, and `OR` has higher precedence than `AND`. + * + * Restrictions have the form ` ` and may have a `-` + * character in front of them to indicate negation. The fields map to those + * defined in the Asset resource. Examples include: + * + * * name + * * security_center_properties.resource_name + * * resource_properties.a_property + * * security_marks.marks.marka + * + * The supported operators are: + * + * * `=` for all value types. + * * `>`, `<`, `>=`, `<=` for integer values. + * * `:`, meaning substring matching, for strings. + * + * The supported value types are: + * + * * string literals in quotes. + * * integer literals without quotes. + * * boolean literals `true` and `false` without quotes. + * + * For example, `resource_properties.size = 100` is a valid filter string. + * @param {string} request.groupBy + * Required. Expression that defines what assets fields to use for grouping. The string + * value should follow SQL syntax: comma separated list of fields. For + * example: + * "security_center_properties.resource_project,security_center_properties.project". + * + * The following fields are supported when compare_duration is not set: + * + * * security_center_properties.resource_project + * * security_center_properties.resource_type + * * security_center_properties.resource_parent + * + * The following fields are supported when compare_duration is set: + * + * * security_center_properties.resource_type + * @param {google.protobuf.Duration} request.compareDuration + * When compare_duration is set, the Asset's "state" property is updated to + * indicate whether the asset was added, removed, or remained present during + * the compare_duration period of time that precedes the read_time. This is + * the time between (read_time - compare_duration) and read_time. + * + * The state value is derived based on the presence of the asset at the two + * points in time. Intermediate state changes between the two times don't + * affect the result. For example, the results aren't affected if the asset is + * removed and re-created again. + * + * Possible "state" values when compare_duration is specified: + * + * * "ADDED": indicates that the asset was not present before + * compare_duration, but present at reference_time. + * * "REMOVED": indicates that the asset was present at the start of + * compare_duration, but not present at reference_time. + * * "ACTIVE": indicates that the asset was present at both the + * start and the end of the time period defined by + * compare_duration and reference_time. + * + * This field is ignored if `state` is not a field in `group_by`. + * @param {google.protobuf.Timestamp} request.readTime + * Time used as a reference point when filtering assets. The filter is limited + * to assets existing at the supplied time and their values are those at that + * specific time. Absence of this field will default to the API's version of + * NOW. + * @param {string} request.pageToken + * The value returned by the last `GroupAssetsResponse`; indicates + * that this is a continuation of a prior `GroupAssets` call, and that the + * system should return the next page of data. + * @param {number} request.pageSize + * The maximum number of results to return in a single response. Default is + * 10, minimum is 1, maximum is 1000. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [GroupResult]{@link google.cloud.securitycenter.v1beta1.GroupResult}. + * The client library support auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * + * When autoPaginate: false is specified through options, the array has three elements. + * The first element is Array of [GroupResult]{@link google.cloud.securitycenter.v1beta1.GroupResult} that corresponds to + * the one page received from the API server. + * If the second element is not null it contains the request object of type [GroupAssetsRequest]{@link google.cloud.securitycenter.v1beta1.GroupAssetsRequest} + * that can be used to obtain the next page of the results. + * If it is null, the next page does not exist. + * The third element contains the raw response received from the API server. Its type is + * [GroupAssetsResponse]{@link google.cloud.securitycenter.v1beta1.GroupAssetsResponse}. + * + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + groupAssets( + request: protosTypes.google.cloud.securitycenter.v1beta1.IGroupAssetsRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.cloud.securitycenter.v1beta1.IGroupResult[], + protosTypes.google.cloud.securitycenter.v1beta1.IGroupAssetsRequest | null, + protosTypes.google.cloud.securitycenter.v1beta1.IGroupAssetsResponse + >, + callback?: Callback< + protosTypes.google.cloud.securitycenter.v1beta1.IGroupResult[], + protosTypes.google.cloud.securitycenter.v1beta1.IGroupAssetsRequest | null, + protosTypes.google.cloud.securitycenter.v1beta1.IGroupAssetsResponse + > + ): Promise< + [ + protosTypes.google.cloud.securitycenter.v1beta1.IGroupResult[], + protosTypes.google.cloud.securitycenter.v1beta1.IGroupAssetsRequest | null, + protosTypes.google.cloud.securitycenter.v1beta1.IGroupAssetsResponse + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + return this._innerApiCalls.groupAssets(request, options, callback); + } + + /** + * Equivalent to {@link groupAssets}, but returns a NodeJS Stream object. + * + * This fetches the paged responses for {@link groupAssets} continuously + * and invokes the callback registered for 'data' event for each element in the + * responses. + * + * The returned object has 'end' method when no more elements are required. + * + * autoPaginate option will be ignored. + * + * @see {@link https://nodejs.org/api/stream.html} + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Name of the organization to groupBy. Its format is + * "organizations/[organization_id]". + * @param {string} request.filter + * Expression that defines the filter to apply across assets. + * The expression is a list of zero or more restrictions combined via logical + * operators `AND` and `OR`. + * Parentheses are not supported, and `OR` has higher precedence than `AND`. + * + * Restrictions have the form ` ` and may have a `-` + * character in front of them to indicate negation. The fields map to those + * defined in the Asset resource. Examples include: + * + * * name + * * security_center_properties.resource_name + * * resource_properties.a_property + * * security_marks.marks.marka + * + * The supported operators are: + * + * * `=` for all value types. + * * `>`, `<`, `>=`, `<=` for integer values. + * * `:`, meaning substring matching, for strings. + * + * The supported value types are: + * + * * string literals in quotes. + * * integer literals without quotes. + * * boolean literals `true` and `false` without quotes. + * + * For example, `resource_properties.size = 100` is a valid filter string. + * @param {string} request.groupBy + * Required. Expression that defines what assets fields to use for grouping. The string + * value should follow SQL syntax: comma separated list of fields. For + * example: + * "security_center_properties.resource_project,security_center_properties.project". + * + * The following fields are supported when compare_duration is not set: + * + * * security_center_properties.resource_project + * * security_center_properties.resource_type + * * security_center_properties.resource_parent + * + * The following fields are supported when compare_duration is set: + * + * * security_center_properties.resource_type + * @param {google.protobuf.Duration} request.compareDuration + * When compare_duration is set, the Asset's "state" property is updated to + * indicate whether the asset was added, removed, or remained present during + * the compare_duration period of time that precedes the read_time. This is + * the time between (read_time - compare_duration) and read_time. + * + * The state value is derived based on the presence of the asset at the two + * points in time. Intermediate state changes between the two times don't + * affect the result. For example, the results aren't affected if the asset is + * removed and re-created again. + * + * Possible "state" values when compare_duration is specified: + * + * * "ADDED": indicates that the asset was not present before + * compare_duration, but present at reference_time. + * * "REMOVED": indicates that the asset was present at the start of + * compare_duration, but not present at reference_time. + * * "ACTIVE": indicates that the asset was present at both the + * start and the end of the time period defined by + * compare_duration and reference_time. + * + * This field is ignored if `state` is not a field in `group_by`. + * @param {google.protobuf.Timestamp} request.readTime + * Time used as a reference point when filtering assets. The filter is limited + * to assets existing at the supplied time and their values are those at that + * specific time. Absence of this field will default to the API's version of + * NOW. + * @param {string} request.pageToken + * The value returned by the last `GroupAssetsResponse`; indicates + * that this is a continuation of a prior `GroupAssets` call, and that the + * system should return the next page of data. + * @param {number} request.pageSize + * The maximum number of results to return in a single response. Default is + * 10, minimum is 1, maximum is 1000. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [GroupResult]{@link google.cloud.securitycenter.v1beta1.GroupResult} on 'data' event. + */ + groupAssetsStream( + request?: protosTypes.google.cloud.securitycenter.v1beta1.IGroupAssetsRequest, + options?: gax.CallOptions | {} + ): Transform { + request = request || {}; + const callSettings = new gax.CallSettings(options); + return this._descriptors.page.groupAssets.createStream( + this._innerApiCalls.groupAssets as gax.GaxCall, + request, + callSettings + ); + } + groupFindings( + request: protosTypes.google.cloud.securitycenter.v1beta1.IGroupFindingsRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.cloud.securitycenter.v1beta1.IGroupResult[], + protosTypes.google.cloud.securitycenter.v1beta1.IGroupFindingsRequest | null, + protosTypes.google.cloud.securitycenter.v1beta1.IGroupFindingsResponse + ] + >; + groupFindings( + request: protosTypes.google.cloud.securitycenter.v1beta1.IGroupFindingsRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.cloud.securitycenter.v1beta1.IGroupResult[], + protosTypes.google.cloud.securitycenter.v1beta1.IGroupFindingsRequest | null, + protosTypes.google.cloud.securitycenter.v1beta1.IGroupFindingsResponse + > + ): void; + /** + * Filters an organization or source's findings and groups them by their + * specified properties. + * + * To group across all sources provide a `-` as the source id. + * Example: /v1beta1/organizations/{organization_id}/sources/-/findings + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Name of the source to groupBy. Its format is + * "organizations/[organization_id]/sources/[source_id]". To groupBy across + * all sources provide a source_id of `-`. For example: + * organizations/{organization_id}/sources/- + * @param {string} request.filter + * Expression that defines the filter to apply across findings. + * The expression is a list of one or more restrictions combined via logical + * operators `AND` and `OR`. + * Parentheses are not supported, and `OR` has higher precedence than `AND`. + * + * Restrictions have the form ` ` and may have a `-` + * character in front of them to indicate negation. Examples include: + * + * * name + * * source_properties.a_property + * * security_marks.marks.marka + * + * The supported operators are: + * + * * `=` for all value types. + * * `>`, `<`, `>=`, `<=` for integer values. + * * `:`, meaning substring matching, for strings. + * + * The supported value types are: + * + * * string literals in quotes. + * * integer literals without quotes. + * * boolean literals `true` and `false` without quotes. + * + * For example, `source_properties.size = 100` is a valid filter string. + * @param {string} request.groupBy + * Required. Expression that defines what assets fields to use for grouping (including + * `state`). The string value should follow SQL syntax: comma separated list + * of fields. For example: + * "parent,resource_name". + * + * The following fields are supported: + * + * * resource_name + * * category + * * state + * * parent + * @param {google.protobuf.Timestamp} request.readTime + * Time used as a reference point when filtering findings. The filter is + * limited to findings existing at the supplied time and their values are + * those at that specific time. Absence of this field will default to the + * API's version of NOW. + * @param {string} request.pageToken + * The value returned by the last `GroupFindingsResponse`; indicates + * that this is a continuation of a prior `GroupFindings` call, and + * that the system should return the next page of data. + * @param {number} request.pageSize + * The maximum number of results to return in a single response. Default is + * 10, minimum is 1, maximum is 1000. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [GroupResult]{@link google.cloud.securitycenter.v1beta1.GroupResult}. + * The client library support auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * + * When autoPaginate: false is specified through options, the array has three elements. + * The first element is Array of [GroupResult]{@link google.cloud.securitycenter.v1beta1.GroupResult} that corresponds to + * the one page received from the API server. + * If the second element is not null it contains the request object of type [GroupFindingsRequest]{@link google.cloud.securitycenter.v1beta1.GroupFindingsRequest} + * that can be used to obtain the next page of the results. + * If it is null, the next page does not exist. + * The third element contains the raw response received from the API server. Its type is + * [GroupFindingsResponse]{@link google.cloud.securitycenter.v1beta1.GroupFindingsResponse}. + * + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + groupFindings( + request: protosTypes.google.cloud.securitycenter.v1beta1.IGroupFindingsRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.cloud.securitycenter.v1beta1.IGroupResult[], + protosTypes.google.cloud.securitycenter.v1beta1.IGroupFindingsRequest | null, + protosTypes.google.cloud.securitycenter.v1beta1.IGroupFindingsResponse + >, + callback?: Callback< + protosTypes.google.cloud.securitycenter.v1beta1.IGroupResult[], + protosTypes.google.cloud.securitycenter.v1beta1.IGroupFindingsRequest | null, + protosTypes.google.cloud.securitycenter.v1beta1.IGroupFindingsResponse + > + ): Promise< + [ + protosTypes.google.cloud.securitycenter.v1beta1.IGroupResult[], + protosTypes.google.cloud.securitycenter.v1beta1.IGroupFindingsRequest | null, + protosTypes.google.cloud.securitycenter.v1beta1.IGroupFindingsResponse + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + return this._innerApiCalls.groupFindings(request, options, callback); + } + + /** + * Equivalent to {@link groupFindings}, but returns a NodeJS Stream object. + * + * This fetches the paged responses for {@link groupFindings} continuously + * and invokes the callback registered for 'data' event for each element in the + * responses. + * + * The returned object has 'end' method when no more elements are required. + * + * autoPaginate option will be ignored. + * + * @see {@link https://nodejs.org/api/stream.html} + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Name of the source to groupBy. Its format is + * "organizations/[organization_id]/sources/[source_id]". To groupBy across + * all sources provide a source_id of `-`. For example: + * organizations/{organization_id}/sources/- + * @param {string} request.filter + * Expression that defines the filter to apply across findings. + * The expression is a list of one or more restrictions combined via logical + * operators `AND` and `OR`. + * Parentheses are not supported, and `OR` has higher precedence than `AND`. + * + * Restrictions have the form ` ` and may have a `-` + * character in front of them to indicate negation. Examples include: + * + * * name + * * source_properties.a_property + * * security_marks.marks.marka + * + * The supported operators are: + * + * * `=` for all value types. + * * `>`, `<`, `>=`, `<=` for integer values. + * * `:`, meaning substring matching, for strings. + * + * The supported value types are: + * + * * string literals in quotes. + * * integer literals without quotes. + * * boolean literals `true` and `false` without quotes. + * + * For example, `source_properties.size = 100` is a valid filter string. + * @param {string} request.groupBy + * Required. Expression that defines what assets fields to use for grouping (including + * `state`). The string value should follow SQL syntax: comma separated list + * of fields. For example: + * "parent,resource_name". + * + * The following fields are supported: + * + * * resource_name + * * category + * * state + * * parent + * @param {google.protobuf.Timestamp} request.readTime + * Time used as a reference point when filtering findings. The filter is + * limited to findings existing at the supplied time and their values are + * those at that specific time. Absence of this field will default to the + * API's version of NOW. + * @param {string} request.pageToken + * The value returned by the last `GroupFindingsResponse`; indicates + * that this is a continuation of a prior `GroupFindings` call, and + * that the system should return the next page of data. + * @param {number} request.pageSize + * The maximum number of results to return in a single response. Default is + * 10, minimum is 1, maximum is 1000. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [GroupResult]{@link google.cloud.securitycenter.v1beta1.GroupResult} on 'data' event. + */ + groupFindingsStream( + request?: protosTypes.google.cloud.securitycenter.v1beta1.IGroupFindingsRequest, + options?: gax.CallOptions | {} + ): Transform { + request = request || {}; + const callSettings = new gax.CallSettings(options); + return this._descriptors.page.groupFindings.createStream( + this._innerApiCalls.groupFindings as gax.GaxCall, + request, + callSettings + ); + } + listAssets( + request: protosTypes.google.cloud.securitycenter.v1beta1.IListAssetsRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.cloud.securitycenter.v1beta1.ListAssetsResponse.IListAssetsResult[], + protosTypes.google.cloud.securitycenter.v1beta1.IListAssetsRequest | null, + protosTypes.google.cloud.securitycenter.v1beta1.IListAssetsResponse + ] + >; + listAssets( + request: protosTypes.google.cloud.securitycenter.v1beta1.IListAssetsRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.cloud.securitycenter.v1beta1.ListAssetsResponse.IListAssetsResult[], + protosTypes.google.cloud.securitycenter.v1beta1.IListAssetsRequest | null, + protosTypes.google.cloud.securitycenter.v1beta1.IListAssetsResponse + > + ): void; + /** + * Lists an organization's assets. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Name of the organization assets should belong to. Its format is + * "organizations/[organization_id]". + * @param {string} request.filter + * Expression that defines the filter to apply across assets. + * The expression is a list of zero or more restrictions combined via logical + * operators `AND` and `OR`. + * Parentheses are not supported, and `OR` has higher precedence than `AND`. + * + * Restrictions have the form ` ` and may have a `-` + * character in front of them to indicate negation. The fields map to those + * defined in the Asset resource. Examples include: + * + * * name + * * security_center_properties.resource_name + * * resource_properties.a_property + * * security_marks.marks.marka + * + * The supported operators are: + * + * * `=` for all value types. + * * `>`, `<`, `>=`, `<=` for integer values. + * * `:`, meaning substring matching, for strings. + * + * The supported value types are: + * + * * string literals in quotes. + * * integer literals without quotes. + * * boolean literals `true` and `false` without quotes. + * + * For example, `resource_properties.size = 100` is a valid filter string. + * @param {string} request.orderBy + * Expression that defines what fields and order to use for sorting. The + * string value should follow SQL syntax: comma separated list of fields. For + * example: "name,resource_properties.a_property". The default sorting order + * is ascending. To specify descending order for a field, a suffix " desc" + * should be appended to the field name. For example: "name + * desc,resource_properties.a_property". Redundant space characters in the + * syntax are insignificant. "name desc,resource_properties.a_property" and " + * name desc , resource_properties.a_property " are equivalent. + * @param {google.protobuf.Timestamp} request.readTime + * Time used as a reference point when filtering assets. The filter is limited + * to assets existing at the supplied time and their values are those at that + * specific time. Absence of this field will default to the API's version of + * NOW. + * @param {google.protobuf.Duration} request.compareDuration + * When compare_duration is set, the ListAssetResult's "state" attribute is + * updated to indicate whether the asset was added, removed, or remained + * present during the compare_duration period of time that precedes the + * read_time. This is the time between (read_time - + * compare_duration) and read_time. + * + * The state value is derived based on the presence of the asset at the two + * points in time. Intermediate state changes between the two times don't + * affect the result. For example, the results aren't affected if the asset is + * removed and re-created again. + * + * Possible "state" values when compare_duration is specified: + * + * * "ADDED": indicates that the asset was not present before + * compare_duration, but present at read_time. + * * "REMOVED": indicates that the asset was present at the start of + * compare_duration, but not present at read_time. + * * "ACTIVE": indicates that the asset was present at both the + * start and the end of the time period defined by + * compare_duration and read_time. + * + * If compare_duration is not specified, then the only possible state is + * "UNUSED", which indicates that the asset is present at read_time. + * @param {google.protobuf.FieldMask} [request.fieldMask] + * Optional. A field mask to specify the ListAssetsResult fields to be listed in the + * response. + * An empty field mask will list all fields. + * @param {string} request.pageToken + * The value returned by the last `ListAssetsResponse`; indicates + * that this is a continuation of a prior `ListAssets` call, and + * that the system should return the next page of data. + * @param {number} request.pageSize + * The maximum number of results to return in a single response. Default is + * 10, minimum is 1, maximum is 1000. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [ListAssetsResult]{@link google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult}. + * The client library support auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * + * When autoPaginate: false is specified through options, the array has three elements. + * The first element is Array of [ListAssetsResult]{@link google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult} that corresponds to + * the one page received from the API server. + * If the second element is not null it contains the request object of type [ListAssetsRequest]{@link google.cloud.securitycenter.v1beta1.ListAssetsRequest} + * that can be used to obtain the next page of the results. + * If it is null, the next page does not exist. + * The third element contains the raw response received from the API server. Its type is + * [ListAssetsResponse]{@link google.cloud.securitycenter.v1beta1.ListAssetsResponse}. + * + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + listAssets( + request: protosTypes.google.cloud.securitycenter.v1beta1.IListAssetsRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.cloud.securitycenter.v1beta1.ListAssetsResponse.IListAssetsResult[], + protosTypes.google.cloud.securitycenter.v1beta1.IListAssetsRequest | null, + protosTypes.google.cloud.securitycenter.v1beta1.IListAssetsResponse + >, + callback?: Callback< + protosTypes.google.cloud.securitycenter.v1beta1.ListAssetsResponse.IListAssetsResult[], + protosTypes.google.cloud.securitycenter.v1beta1.IListAssetsRequest | null, + protosTypes.google.cloud.securitycenter.v1beta1.IListAssetsResponse + > + ): Promise< + [ + protosTypes.google.cloud.securitycenter.v1beta1.ListAssetsResponse.IListAssetsResult[], + protosTypes.google.cloud.securitycenter.v1beta1.IListAssetsRequest | null, + protosTypes.google.cloud.securitycenter.v1beta1.IListAssetsResponse + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + return this._innerApiCalls.listAssets(request, options, callback); + } + + /** + * Equivalent to {@link listAssets}, but returns a NodeJS Stream object. + * + * This fetches the paged responses for {@link listAssets} continuously + * and invokes the callback registered for 'data' event for each element in the + * responses. + * + * The returned object has 'end' method when no more elements are required. + * + * autoPaginate option will be ignored. + * + * @see {@link https://nodejs.org/api/stream.html} + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Name of the organization assets should belong to. Its format is + * "organizations/[organization_id]". + * @param {string} request.filter + * Expression that defines the filter to apply across assets. + * The expression is a list of zero or more restrictions combined via logical + * operators `AND` and `OR`. + * Parentheses are not supported, and `OR` has higher precedence than `AND`. + * + * Restrictions have the form ` ` and may have a `-` + * character in front of them to indicate negation. The fields map to those + * defined in the Asset resource. Examples include: + * + * * name + * * security_center_properties.resource_name + * * resource_properties.a_property + * * security_marks.marks.marka + * + * The supported operators are: + * + * * `=` for all value types. + * * `>`, `<`, `>=`, `<=` for integer values. + * * `:`, meaning substring matching, for strings. + * + * The supported value types are: + * + * * string literals in quotes. + * * integer literals without quotes. + * * boolean literals `true` and `false` without quotes. + * + * For example, `resource_properties.size = 100` is a valid filter string. + * @param {string} request.orderBy + * Expression that defines what fields and order to use for sorting. The + * string value should follow SQL syntax: comma separated list of fields. For + * example: "name,resource_properties.a_property". The default sorting order + * is ascending. To specify descending order for a field, a suffix " desc" + * should be appended to the field name. For example: "name + * desc,resource_properties.a_property". Redundant space characters in the + * syntax are insignificant. "name desc,resource_properties.a_property" and " + * name desc , resource_properties.a_property " are equivalent. + * @param {google.protobuf.Timestamp} request.readTime + * Time used as a reference point when filtering assets. The filter is limited + * to assets existing at the supplied time and their values are those at that + * specific time. Absence of this field will default to the API's version of + * NOW. + * @param {google.protobuf.Duration} request.compareDuration + * When compare_duration is set, the ListAssetResult's "state" attribute is + * updated to indicate whether the asset was added, removed, or remained + * present during the compare_duration period of time that precedes the + * read_time. This is the time between (read_time - + * compare_duration) and read_time. + * + * The state value is derived based on the presence of the asset at the two + * points in time. Intermediate state changes between the two times don't + * affect the result. For example, the results aren't affected if the asset is + * removed and re-created again. + * + * Possible "state" values when compare_duration is specified: + * + * * "ADDED": indicates that the asset was not present before + * compare_duration, but present at read_time. + * * "REMOVED": indicates that the asset was present at the start of + * compare_duration, but not present at read_time. + * * "ACTIVE": indicates that the asset was present at both the + * start and the end of the time period defined by + * compare_duration and read_time. + * + * If compare_duration is not specified, then the only possible state is + * "UNUSED", which indicates that the asset is present at read_time. + * @param {google.protobuf.FieldMask} [request.fieldMask] + * Optional. A field mask to specify the ListAssetsResult fields to be listed in the + * response. + * An empty field mask will list all fields. + * @param {string} request.pageToken + * The value returned by the last `ListAssetsResponse`; indicates + * that this is a continuation of a prior `ListAssets` call, and + * that the system should return the next page of data. + * @param {number} request.pageSize + * The maximum number of results to return in a single response. Default is + * 10, minimum is 1, maximum is 1000. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [ListAssetsResult]{@link google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult} on 'data' event. + */ + listAssetsStream( + request?: protosTypes.google.cloud.securitycenter.v1beta1.IListAssetsRequest, + options?: gax.CallOptions | {} + ): Transform { + request = request || {}; + const callSettings = new gax.CallSettings(options); + return this._descriptors.page.listAssets.createStream( + this._innerApiCalls.listAssets as gax.GaxCall, + request, + callSettings + ); + } + listFindings( + request: protosTypes.google.cloud.securitycenter.v1beta1.IListFindingsRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.cloud.securitycenter.v1beta1.IFinding[], + protosTypes.google.cloud.securitycenter.v1beta1.IListFindingsRequest | null, + protosTypes.google.cloud.securitycenter.v1beta1.IListFindingsResponse + ] + >; + listFindings( + request: protosTypes.google.cloud.securitycenter.v1beta1.IListFindingsRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.cloud.securitycenter.v1beta1.IFinding[], + protosTypes.google.cloud.securitycenter.v1beta1.IListFindingsRequest | null, + protosTypes.google.cloud.securitycenter.v1beta1.IListFindingsResponse + > + ): void; + /** + * Lists an organization or source's findings. + * + * To list across all sources provide a `-` as the source id. + * Example: /v1beta1/organizations/{organization_id}/sources/-/findings + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Name of the source the findings belong to. Its format is + * "organizations/[organization_id]/sources/[source_id]". To list across all + * sources provide a source_id of `-`. For example: + * organizations/{organization_id}/sources/- + * @param {string} request.filter + * Expression that defines the filter to apply across findings. + * The expression is a list of one or more restrictions combined via logical + * operators `AND` and `OR`. + * Parentheses are not supported, and `OR` has higher precedence than `AND`. + * + * Restrictions have the form ` ` and may have a `-` + * character in front of them to indicate negation. Examples include: + * + * * name + * * source_properties.a_property + * * security_marks.marks.marka + * + * The supported operators are: + * + * * `=` for all value types. + * * `>`, `<`, `>=`, `<=` for integer values. + * * `:`, meaning substring matching, for strings. + * + * The supported value types are: + * + * * string literals in quotes. + * * integer literals without quotes. + * * boolean literals `true` and `false` without quotes. + * + * For example, `source_properties.size = 100` is a valid filter string. + * @param {string} request.orderBy + * Expression that defines what fields and order to use for sorting. The + * string value should follow SQL syntax: comma separated list of fields. For + * example: "name,resource_properties.a_property". The default sorting order + * is ascending. To specify descending order for a field, a suffix " desc" + * should be appended to the field name. For example: "name + * desc,source_properties.a_property". Redundant space characters in the + * syntax are insignificant. "name desc,source_properties.a_property" and " + * name desc , source_properties.a_property " are equivalent. + * @param {google.protobuf.Timestamp} request.readTime + * Time used as a reference point when filtering findings. The filter is + * limited to findings existing at the supplied time and their values are + * those at that specific time. Absence of this field will default to the + * API's version of NOW. + * @param {google.protobuf.FieldMask} [request.fieldMask] + * Optional. A field mask to specify the Finding fields to be listed in the response. + * An empty field mask will list all fields. + * @param {string} request.pageToken + * The value returned by the last `ListFindingsResponse`; indicates + * that this is a continuation of a prior `ListFindings` call, and + * that the system should return the next page of data. + * @param {number} request.pageSize + * The maximum number of results to return in a single response. Default is + * 10, minimum is 1, maximum is 1000. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [Finding]{@link google.cloud.securitycenter.v1beta1.Finding}. + * The client library support auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * + * When autoPaginate: false is specified through options, the array has three elements. + * The first element is Array of [Finding]{@link google.cloud.securitycenter.v1beta1.Finding} that corresponds to + * the one page received from the API server. + * If the second element is not null it contains the request object of type [ListFindingsRequest]{@link google.cloud.securitycenter.v1beta1.ListFindingsRequest} + * that can be used to obtain the next page of the results. + * If it is null, the next page does not exist. + * The third element contains the raw response received from the API server. Its type is + * [ListFindingsResponse]{@link google.cloud.securitycenter.v1beta1.ListFindingsResponse}. + * + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + listFindings( + request: protosTypes.google.cloud.securitycenter.v1beta1.IListFindingsRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.cloud.securitycenter.v1beta1.IFinding[], + protosTypes.google.cloud.securitycenter.v1beta1.IListFindingsRequest | null, + protosTypes.google.cloud.securitycenter.v1beta1.IListFindingsResponse + >, + callback?: Callback< + protosTypes.google.cloud.securitycenter.v1beta1.IFinding[], + protosTypes.google.cloud.securitycenter.v1beta1.IListFindingsRequest | null, + protosTypes.google.cloud.securitycenter.v1beta1.IListFindingsResponse + > + ): Promise< + [ + protosTypes.google.cloud.securitycenter.v1beta1.IFinding[], + protosTypes.google.cloud.securitycenter.v1beta1.IListFindingsRequest | null, + protosTypes.google.cloud.securitycenter.v1beta1.IListFindingsResponse + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + return this._innerApiCalls.listFindings(request, options, callback); + } + + /** + * Equivalent to {@link listFindings}, but returns a NodeJS Stream object. + * + * This fetches the paged responses for {@link listFindings} continuously + * and invokes the callback registered for 'data' event for each element in the + * responses. + * + * The returned object has 'end' method when no more elements are required. + * + * autoPaginate option will be ignored. + * + * @see {@link https://nodejs.org/api/stream.html} + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Name of the source the findings belong to. Its format is + * "organizations/[organization_id]/sources/[source_id]". To list across all + * sources provide a source_id of `-`. For example: + * organizations/{organization_id}/sources/- + * @param {string} request.filter + * Expression that defines the filter to apply across findings. + * The expression is a list of one or more restrictions combined via logical + * operators `AND` and `OR`. + * Parentheses are not supported, and `OR` has higher precedence than `AND`. + * + * Restrictions have the form ` ` and may have a `-` + * character in front of them to indicate negation. Examples include: + * + * * name + * * source_properties.a_property + * * security_marks.marks.marka + * + * The supported operators are: + * + * * `=` for all value types. + * * `>`, `<`, `>=`, `<=` for integer values. + * * `:`, meaning substring matching, for strings. + * + * The supported value types are: + * + * * string literals in quotes. + * * integer literals without quotes. + * * boolean literals `true` and `false` without quotes. + * + * For example, `source_properties.size = 100` is a valid filter string. + * @param {string} request.orderBy + * Expression that defines what fields and order to use for sorting. The + * string value should follow SQL syntax: comma separated list of fields. For + * example: "name,resource_properties.a_property". The default sorting order + * is ascending. To specify descending order for a field, a suffix " desc" + * should be appended to the field name. For example: "name + * desc,source_properties.a_property". Redundant space characters in the + * syntax are insignificant. "name desc,source_properties.a_property" and " + * name desc , source_properties.a_property " are equivalent. + * @param {google.protobuf.Timestamp} request.readTime + * Time used as a reference point when filtering findings. The filter is + * limited to findings existing at the supplied time and their values are + * those at that specific time. Absence of this field will default to the + * API's version of NOW. + * @param {google.protobuf.FieldMask} [request.fieldMask] + * Optional. A field mask to specify the Finding fields to be listed in the response. + * An empty field mask will list all fields. + * @param {string} request.pageToken + * The value returned by the last `ListFindingsResponse`; indicates + * that this is a continuation of a prior `ListFindings` call, and + * that the system should return the next page of data. + * @param {number} request.pageSize + * The maximum number of results to return in a single response. Default is + * 10, minimum is 1, maximum is 1000. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [Finding]{@link google.cloud.securitycenter.v1beta1.Finding} on 'data' event. + */ + listFindingsStream( + request?: protosTypes.google.cloud.securitycenter.v1beta1.IListFindingsRequest, + options?: gax.CallOptions | {} + ): Transform { + request = request || {}; + const callSettings = new gax.CallSettings(options); + return this._descriptors.page.listFindings.createStream( + this._innerApiCalls.listFindings as gax.GaxCall, + request, + callSettings + ); + } + listSources( + request: protosTypes.google.cloud.securitycenter.v1beta1.IListSourcesRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.cloud.securitycenter.v1beta1.ISource[], + protosTypes.google.cloud.securitycenter.v1beta1.IListSourcesRequest | null, + protosTypes.google.cloud.securitycenter.v1beta1.IListSourcesResponse + ] + >; + listSources( + request: protosTypes.google.cloud.securitycenter.v1beta1.IListSourcesRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.cloud.securitycenter.v1beta1.ISource[], + protosTypes.google.cloud.securitycenter.v1beta1.IListSourcesRequest | null, + protosTypes.google.cloud.securitycenter.v1beta1.IListSourcesResponse + > + ): void; + /** + * Lists all sources belonging to an organization. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Resource name of the parent of sources to list. Its format should be + * "organizations/[organization_id]". + * @param {string} request.pageToken + * The value returned by the last `ListSourcesResponse`; indicates + * that this is a continuation of a prior `ListSources` call, and + * that the system should return the next page of data. + * @param {number} request.pageSize + * The maximum number of results to return in a single response. Default is + * 10, minimum is 1, maximum is 1000. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [Source]{@link google.cloud.securitycenter.v1beta1.Source}. + * The client library support auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * + * When autoPaginate: false is specified through options, the array has three elements. + * The first element is Array of [Source]{@link google.cloud.securitycenter.v1beta1.Source} that corresponds to + * the one page received from the API server. + * If the second element is not null it contains the request object of type [ListSourcesRequest]{@link google.cloud.securitycenter.v1beta1.ListSourcesRequest} + * that can be used to obtain the next page of the results. + * If it is null, the next page does not exist. + * The third element contains the raw response received from the API server. Its type is + * [ListSourcesResponse]{@link google.cloud.securitycenter.v1beta1.ListSourcesResponse}. + * + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + listSources( + request: protosTypes.google.cloud.securitycenter.v1beta1.IListSourcesRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.cloud.securitycenter.v1beta1.ISource[], + protosTypes.google.cloud.securitycenter.v1beta1.IListSourcesRequest | null, + protosTypes.google.cloud.securitycenter.v1beta1.IListSourcesResponse + >, + callback?: Callback< + protosTypes.google.cloud.securitycenter.v1beta1.ISource[], + protosTypes.google.cloud.securitycenter.v1beta1.IListSourcesRequest | null, + protosTypes.google.cloud.securitycenter.v1beta1.IListSourcesResponse + > + ): Promise< + [ + protosTypes.google.cloud.securitycenter.v1beta1.ISource[], + protosTypes.google.cloud.securitycenter.v1beta1.IListSourcesRequest | null, + protosTypes.google.cloud.securitycenter.v1beta1.IListSourcesResponse + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + return this._innerApiCalls.listSources(request, options, callback); + } + + /** + * Equivalent to {@link listSources}, but returns a NodeJS Stream object. + * + * This fetches the paged responses for {@link listSources} continuously + * and invokes the callback registered for 'data' event for each element in the + * responses. + * + * The returned object has 'end' method when no more elements are required. + * + * autoPaginate option will be ignored. + * + * @see {@link https://nodejs.org/api/stream.html} + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Resource name of the parent of sources to list. Its format should be + * "organizations/[organization_id]". + * @param {string} request.pageToken + * The value returned by the last `ListSourcesResponse`; indicates + * that this is a continuation of a prior `ListSources` call, and + * that the system should return the next page of data. + * @param {number} request.pageSize + * The maximum number of results to return in a single response. Default is + * 10, minimum is 1, maximum is 1000. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [Source]{@link google.cloud.securitycenter.v1beta1.Source} on 'data' event. + */ + listSourcesStream( + request?: protosTypes.google.cloud.securitycenter.v1beta1.IListSourcesRequest, + options?: gax.CallOptions | {} + ): Transform { + request = request || {}; + const callSettings = new gax.CallSettings(options); + return this._descriptors.page.listSources.createStream( + this._innerApiCalls.listSources as gax.GaxCall, + request, + callSettings + ); + } + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified organizationAsset resource name string. + * + * @param {string} organization + * @param {string} asset + * @returns {string} Resource name string. + */ + organizationAssetPath(organization: string, asset: string) { + return this._pathTemplates.organizationAssetPathTemplate.render({ + organization, + asset, + }); + } + + /** + * Parse the organization from OrganizationAsset resource. + * + * @param {string} organizationAssetName + * A fully-qualified path representing organization_asset resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationAssetName(organizationAssetName: string) { + return this._pathTemplates.organizationAssetPathTemplate.match( + organizationAssetName + ).organization; + } + + /** + * Parse the asset from OrganizationAsset resource. + * + * @param {string} organizationAssetName + * A fully-qualified path representing organization_asset resource. + * @returns {string} A string representing the asset. + */ + matchAssetFromOrganizationAssetName(organizationAssetName: string) { + return this._pathTemplates.organizationAssetPathTemplate.match( + organizationAssetName + ).asset; + } + + /** + * Return a fully-qualified organizationSourceFinding resource name string. + * + * @param {string} organization + * @param {string} source + * @param {string} finding + * @returns {string} Resource name string. + */ + organizationSourceFindingPath( + organization: string, + source: string, + finding: string + ) { + return this._pathTemplates.organizationSourceFindingPathTemplate.render({ + organization, + source, + finding, + }); + } + + /** + * Parse the organization from OrganizationSourceFinding resource. + * + * @param {string} organizationSourceFindingName + * A fully-qualified path representing organization_source_finding resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationSourceFindingName( + organizationSourceFindingName: string + ) { + return this._pathTemplates.organizationSourceFindingPathTemplate.match( + organizationSourceFindingName + ).organization; + } + + /** + * Parse the source from OrganizationSourceFinding resource. + * + * @param {string} organizationSourceFindingName + * A fully-qualified path representing organization_source_finding resource. + * @returns {string} A string representing the source. + */ + matchSourceFromOrganizationSourceFindingName( + organizationSourceFindingName: string + ) { + return this._pathTemplates.organizationSourceFindingPathTemplate.match( + organizationSourceFindingName + ).source; + } + + /** + * Parse the finding from OrganizationSourceFinding resource. + * + * @param {string} organizationSourceFindingName + * A fully-qualified path representing organization_source_finding resource. + * @returns {string} A string representing the finding. + */ + matchFindingFromOrganizationSourceFindingName( + organizationSourceFindingName: string + ) { + return this._pathTemplates.organizationSourceFindingPathTemplate.match( + organizationSourceFindingName + ).finding; + } + + /** + * Return a fully-qualified finding resource name string. + * + * @param {string} organization + * @param {string} source + * @param {string} finding + * @returns {string} Resource name string. + */ + findingPath(organization: string, source: string, finding: string) { + return this._pathTemplates.findingPathTemplate.render({ + organization, + source, + finding, + }); + } + + /** + * Parse the organization from Finding resource. + * + * @param {string} findingName + * A fully-qualified path representing Finding resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromFindingName(findingName: string) { + return this._pathTemplates.findingPathTemplate.match(findingName) + .organization; + } + + /** + * Parse the source from Finding resource. + * + * @param {string} findingName + * A fully-qualified path representing Finding resource. + * @returns {string} A string representing the source. + */ + matchSourceFromFindingName(findingName: string) { + return this._pathTemplates.findingPathTemplate.match(findingName).source; + } + + /** + * Parse the finding from Finding resource. + * + * @param {string} findingName + * A fully-qualified path representing Finding resource. + * @returns {string} A string representing the finding. + */ + matchFindingFromFindingName(findingName: string) { + return this._pathTemplates.findingPathTemplate.match(findingName).finding; + } + + /** + * Return a fully-qualified source resource name string. + * + * @param {string} organization + * @param {string} source + * @returns {string} Resource name string. + */ + sourcePath(organization: string, source: string) { + return this._pathTemplates.sourcePathTemplate.render({ + organization, + source, + }); + } + + /** + * Parse the organization from Source resource. + * + * @param {string} sourceName + * A fully-qualified path representing Source resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromSourceName(sourceName: string) { + return this._pathTemplates.sourcePathTemplate.match(sourceName) + .organization; + } + + /** + * Parse the source from Source resource. + * + * @param {string} sourceName + * A fully-qualified path representing Source resource. + * @returns {string} A string representing the source. + */ + matchSourceFromSourceName(sourceName: string) { + return this._pathTemplates.sourcePathTemplate.match(sourceName).source; + } + + /** + * Return a fully-qualified organizationSettings resource name string. + * + * @param {string} organization + * @returns {string} Resource name string. + */ + organizationSettingsPath(organization: string) { + return this._pathTemplates.organizationSettingsPathTemplate.render({ + organization, + }); + } + + /** + * Parse the organization from OrganizationSettings resource. + * + * @param {string} organizationSettingsName + * A fully-qualified path representing OrganizationSettings resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationSettingsName( + organizationSettingsName: string + ) { + return this._pathTemplates.organizationSettingsPathTemplate.match( + organizationSettingsName + ).organization; + } + + /** + * Return a fully-qualified organization resource name string. + * + * @param {string} organization + * @returns {string} Resource name string. + */ + organizationPath(organization: string) { + return this._pathTemplates.organizationPathTemplate.render({ + organization, + }); + } + + /** + * Parse the organization from Organization resource. + * + * @param {string} organizationName + * A fully-qualified path representing Organization resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationName(organizationName: string) { + return this._pathTemplates.organizationPathTemplate.match(organizationName) + .organization; + } + + /** + * Terminate the GRPC channel and close the client. + * + * The client will no longer be usable and all future behavior is undefined. + */ + close(): Promise { + if (!this._terminated) { + return this.securityCenterStub.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-cloud-securitycenter/src/v1beta1/security_center_client_config.json b/packages/google-cloud-securitycenter/src/v1beta1/security_center_client_config.json index 3ddfa413fad..4a2e6c90fa1 100644 --- a/packages/google-cloud-securitycenter/src/v1beta1/security_center_client_config.json +++ b/packages/google-cloud-securitycenter/src/v1beta1/security_center_client_config.json @@ -2,111 +2,111 @@ "interfaces": { "google.cloud.securitycenter.v1beta1.SecurityCenter": { "retry_codes": { + "non_idempotent": [], "idempotent": [ "DEADLINE_EXCEEDED", "UNAVAILABLE" - ], - "non_idempotent": [] + ] }, "retry_params": { "default": { "initial_retry_delay_millis": 100, "retry_delay_multiplier": 1.3, "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 20000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 20000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, "total_timeout_millis": 600000 } }, "methods": { "CreateSource": { - "timeout_millis": 60000, + "timeout_millis": 600000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, "CreateFinding": { - "timeout_millis": 60000, + "timeout_millis": 600000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, "GetIamPolicy": { - "timeout_millis": 60000, + "timeout_millis": 600000, "retry_codes_name": "idempotent", "retry_params_name": "default" }, "GetOrganizationSettings": { - "timeout_millis": 60000, + "timeout_millis": 600000, "retry_codes_name": "idempotent", "retry_params_name": "default" }, "GetSource": { - "timeout_millis": 60000, + "timeout_millis": 600000, "retry_codes_name": "idempotent", "retry_params_name": "default" }, "GroupAssets": { - "timeout_millis": 60000, + "timeout_millis": 600000, "retry_codes_name": "idempotent", "retry_params_name": "default" }, "GroupFindings": { - "timeout_millis": 60000, + "timeout_millis": 600000, "retry_codes_name": "idempotent", "retry_params_name": "default" }, "ListAssets": { - "timeout_millis": 60000, + "timeout_millis": 600000, "retry_codes_name": "idempotent", "retry_params_name": "default" }, "ListFindings": { - "timeout_millis": 60000, + "timeout_millis": 600000, "retry_codes_name": "idempotent", "retry_params_name": "default" }, "ListSources": { - "timeout_millis": 60000, + "timeout_millis": 600000, "retry_codes_name": "idempotent", "retry_params_name": "default" }, "RunAssetDiscovery": { - "timeout_millis": 60000, + "timeout_millis": 600000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, "SetFindingState": { - "timeout_millis": 60000, + "timeout_millis": 600000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, "SetIamPolicy": { - "timeout_millis": 60000, + "timeout_millis": 600000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, "TestIamPermissions": { - "timeout_millis": 60000, + "timeout_millis": 600000, "retry_codes_name": "idempotent", "retry_params_name": "default" }, "UpdateFinding": { - "timeout_millis": 60000, + "timeout_millis": 600000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, "UpdateOrganizationSettings": { - "timeout_millis": 60000, + "timeout_millis": 600000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, "UpdateSource": { - "timeout_millis": 60000, + "timeout_millis": 600000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, "UpdateSecurityMarks": { - "timeout_millis": 60000, + "timeout_millis": 600000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" } diff --git a/packages/google-cloud-securitycenter/src/v1beta1/security_center_proto_list.json b/packages/google-cloud-securitycenter/src/v1beta1/security_center_proto_list.json index 24e63a24411..d10dce6c60d 100644 --- a/packages/google-cloud-securitycenter/src/v1beta1/security_center_proto_list.json +++ b/packages/google-cloud-securitycenter/src/v1beta1/security_center_proto_list.json @@ -1,3 +1,9 @@ [ - "../../protos/google/cloud/securitycenter/v1beta1/securitycenter_service.proto" + "../../protos/google/cloud/securitycenter/v1beta1/asset.proto", + "../../protos/google/cloud/securitycenter/v1beta1/finding.proto", + "../../protos/google/cloud/securitycenter/v1beta1/organization_settings.proto", + "../../protos/google/cloud/securitycenter/v1beta1/run_asset_discovery_response.proto", + "../../protos/google/cloud/securitycenter/v1beta1/security_marks.proto", + "../../protos/google/cloud/securitycenter/v1beta1/securitycenter_service.proto", + "../../protos/google/cloud/securitycenter/v1beta1/source.proto" ] diff --git a/packages/google-cloud-securitycenter/src/v1beta1/index.js b/packages/google-cloud-securitycenter/src/v1p1beta1/index.ts similarity index 65% rename from packages/google-cloud-securitycenter/src/v1beta1/index.js rename to packages/google-cloud-securitycenter/src/v1p1beta1/index.ts index 7624ae3951c..a44e8075d6f 100644 --- a/packages/google-cloud-securitycenter/src/v1beta1/index.js +++ b/packages/google-cloud-securitycenter/src/v1p1beta1/index.ts @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// Copyright 2019 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -11,9 +11,9 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file 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 SecurityCenterClient = require('./security_center_client'); - -module.exports.SecurityCenterClient = SecurityCenterClient; +export {SecurityCenterClient} from './security_center_client'; diff --git a/packages/google-cloud-securitycenter/src/v1p1beta1/security_center_client.ts b/packages/google-cloud-securitycenter/src/v1p1beta1/security_center_client.ts new file mode 100644 index 00000000000..13d3a8e785f --- /dev/null +++ b/packages/google-cloud-securitycenter/src/v1p1beta1/security_center_client.ts @@ -0,0 +1,3825 @@ +// Copyright 2019 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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 gax from 'google-gax'; +import { + APICallback, + Callback, + CallOptions, + Descriptors, + ClientOptions, + LROperation, + PaginationCallback, + PaginationResponse, +} from 'google-gax'; +import * as path from 'path'; + +import {Transform} from 'stream'; +import * as protosTypes from '../../protos/protos'; +import * as gapicConfig from './security_center_client_config.json'; + +const version = require('../../../package.json').version; + +/** + * V1p1Beta1 APIs for Security Center service. + * @class + * @memberof v1p1beta1 + */ +export class SecurityCenterClient { + private _descriptors: Descriptors = {page: {}, stream: {}, longrunning: {}}; + private _innerApiCalls: {[name: string]: Function}; + private _pathTemplates: {[name: string]: gax.PathTemplate}; + private _terminated = false; + auth: gax.GoogleAuth; + operationsClient: gax.OperationsClient; + securityCenterStub: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of SecurityCenterClient. + * + * @param {object} [options] - The configuration object. See the subsequent + * parameters for more details. + * @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 {function} [options.promise] - Custom promise module to use instead + * of native Promises. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + */ + + constructor(opts?: ClientOptions) { + // Ensure that options include the service address and port. + const staticMembers = this.constructor as typeof SecurityCenterClient; + const servicePath = + opts && opts.servicePath + ? opts.servicePath + : opts && opts.apiEndpoint + ? opts.apiEndpoint + : staticMembers.servicePath; + const port = opts && opts.port ? opts.port : staticMembers.port; + + if (!opts) { + opts = {servicePath, port}; + } + opts.servicePath = opts.servicePath || servicePath; + opts.port = opts.port || port; + opts.clientConfig = opts.clientConfig || {}; + + const isBrowser = typeof window !== 'undefined'; + if (isBrowser) { + opts.fallback = true; + } + // If we are in browser, we are already using fallback because of the + // "browser" field in package.json. + // But if we were explicitly requested to use fallback, let's do it now. + const gaxModule = !isBrowser && opts.fallback ? gax.fallback : gax; + + // Create a `gaxGrpc` object, with any grpc-specific options + // sent to the client. + opts.scopes = (this.constructor as typeof SecurityCenterClient).scopes; + const gaxGrpc = new gaxModule.GrpcClient(opts); + + // Save the auth object to the client, for use by other methods. + this.auth = gaxGrpc.auth as gax.GoogleAuth; + + // Determine the client header string. + const clientHeader = [`gax/${gaxModule.version}`, `gapic/${version}`]; + if (typeof process !== 'undefined' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + // For Node.js, pass the path to JSON proto file. + // For browsers, pass the JSON content. + + const nodejsProtoPath = path.join( + __dirname, + '..', + '..', + 'protos', + 'protos.json' + ); + const protos = gaxGrpc.loadProto( + opts.fallback ? require('../../protos/protos.json') : nodejsProtoPath + ); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this._pathTemplates = { + organizationAssetPathTemplate: new gaxModule.PathTemplate( + 'organizations/{organization}/assets/{asset}/securityMarks' + ), + organizationSourceFindingPathTemplate: new gaxModule.PathTemplate( + 'organizations/{organization}/sources/{source}/findings/{finding}/securityMarks' + ), + assetPathTemplate: new gaxModule.PathTemplate( + 'organizations/{organization}/assets/{asset}' + ), + findingPathTemplate: new gaxModule.PathTemplate( + 'organizations/{organization}/sources/{source}/findings/{finding}' + ), + sourcePathTemplate: new gaxModule.PathTemplate( + 'organizations/{organization}/sources/{source}' + ), + notificationConfigPathTemplate: new gaxModule.PathTemplate( + 'organizations/{organization}/notificationConfigs/{notification_config}' + ), + organizationSettingsPathTemplate: new gaxModule.PathTemplate( + 'organizations/{organization}/organizationSettings' + ), + organizationPathTemplate: new gaxModule.PathTemplate( + 'organizations/{organization}' + ), + }; + + // Some of the methods on this service return "paged" results, + // (e.g. 50 results at a time, with tokens to get subsequent + // pages). Denote the keys used for pagination and results. + this._descriptors.page = { + groupAssets: new gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'groupByResults' + ), + groupFindings: new gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'groupByResults' + ), + listAssets: new gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'listAssetsResults' + ), + listFindings: new gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'listFindingsResults' + ), + listNotificationConfigs: new gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'notificationConfigs' + ), + listSources: new gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'sources' + ), + }; + + // This API contains "long-running operations", which return a + // an Operation object that allows for tracking of the operation, + // rather than holding a request open. + const protoFilesRoot = opts.fallback + ? gaxModule.protobuf.Root.fromJSON(require('../../protos/protos.json')) + : gaxModule.protobuf.loadSync(nodejsProtoPath); + + this.operationsClient = gaxModule + .lro({ + auth: this.auth, + grpc: 'grpc' in gaxGrpc ? gaxGrpc.grpc : undefined, + }) + .operationsClient(opts); + const runAssetDiscoveryResponse = protoFilesRoot.lookup( + '.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse' + ) as gax.protobuf.Type; + const runAssetDiscoveryMetadata = protoFilesRoot.lookup( + '.google.protobuf.Empty' + ) as gax.protobuf.Type; + + this._descriptors.longrunning = { + runAssetDiscovery: new gaxModule.LongrunningDescriptor( + this.operationsClient, + runAssetDiscoveryResponse.decode.bind(runAssetDiscoveryResponse), + runAssetDiscoveryMetadata.decode.bind(runAssetDiscoveryMetadata) + ), + }; + + // Put together the default options sent with requests. + const defaults = gaxGrpc.constructSettings( + 'google.cloud.securitycenter.v1p1beta1.SecurityCenter', + 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 = {}; + + // Put together the "service stub" for + // google.cloud.securitycenter.v1p1beta1.SecurityCenter. + this.securityCenterStub = gaxGrpc.createStub( + opts.fallback + ? (protos as protobuf.Root).lookupService( + 'google.cloud.securitycenter.v1p1beta1.SecurityCenter' + ) + : // tslint:disable-next-line no-any + (protos as any).google.cloud.securitycenter.v1p1beta1.SecurityCenter, + opts + ) as Promise<{[method: string]: Function}>; + + // Iterate over each of the methods that the service provides + // and create an API call method for each. + const securityCenterStubMethods = [ + 'createSource', + 'createFinding', + 'createNotificationConfig', + 'deleteNotificationConfig', + 'getIamPolicy', + 'getNotificationConfig', + 'getOrganizationSettings', + 'getSource', + 'groupAssets', + 'groupFindings', + 'listAssets', + 'listFindings', + 'listNotificationConfigs', + 'listSources', + 'runAssetDiscovery', + 'setFindingState', + 'setIamPolicy', + 'testIamPermissions', + 'updateFinding', + 'updateNotificationConfig', + 'updateOrganizationSettings', + 'updateSource', + 'updateSecurityMarks', + ]; + + for (const methodName of securityCenterStubMethods) { + const innerCallPromise = this.securityCenterStub.then( + stub => (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + return stub[methodName].apply(stub, args); + }, + (err: Error | null | undefined) => () => { + throw err; + } + ); + + const apiCall = gaxModule.createApiCall( + innerCallPromise, + defaults[methodName], + this._descriptors.page[methodName] || + this._descriptors.stream[methodName] || + this._descriptors.longrunning[methodName] + ); + + this._innerApiCalls[methodName] = ( + argument: {}, + callOptions?: CallOptions, + callback?: APICallback + ) => { + return apiCall(argument, callOptions, callback); + }; + } + } + + /** + * The DNS address for this API service. + */ + static get servicePath() { + return 'securitycenter.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath(), + * exists for compatibility reasons. + */ + static get apiEndpoint() { + return 'securitycenter.googleapis.com'; + } + + /** + * The port for this API service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + */ + static get scopes() { + return ['https://www.googleapis.com/auth/cloud-platform']; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @param {function(Error, string)} callback - the callback to + * be called with the current project Id. + */ + getProjectId( + callback?: Callback + ): Promise | void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- + createSource( + request: protosTypes.google.cloud.securitycenter.v1p1beta1.ICreateSourceRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.cloud.securitycenter.v1p1beta1.ISource, + ( + | protosTypes.google.cloud.securitycenter.v1p1beta1.ICreateSourceRequest + | undefined + ), + {} | undefined + ] + >; + createSource( + request: protosTypes.google.cloud.securitycenter.v1p1beta1.ICreateSourceRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.cloud.securitycenter.v1p1beta1.ISource, + | protosTypes.google.cloud.securitycenter.v1p1beta1.ICreateSourceRequest + | undefined, + {} | undefined + > + ): void; + /** + * Creates a source. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Resource name of the new source's parent. Its format should be + * "organizations/[organization_id]". + * @param {google.cloud.securitycenter.v1p1beta1.Source} request.source + * Required. The Source being created, only the display_name and description + * will be used. All other fields will be ignored. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Source]{@link google.cloud.securitycenter.v1p1beta1.Source}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + createSource( + request: protosTypes.google.cloud.securitycenter.v1p1beta1.ICreateSourceRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.cloud.securitycenter.v1p1beta1.ISource, + | protosTypes.google.cloud.securitycenter.v1p1beta1.ICreateSourceRequest + | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.cloud.securitycenter.v1p1beta1.ISource, + | protosTypes.google.cloud.securitycenter.v1p1beta1.ICreateSourceRequest + | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.cloud.securitycenter.v1p1beta1.ISource, + ( + | protosTypes.google.cloud.securitycenter.v1p1beta1.ICreateSourceRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + return this._innerApiCalls.createSource(request, options, callback); + } + createFinding( + request: protosTypes.google.cloud.securitycenter.v1p1beta1.ICreateFindingRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.cloud.securitycenter.v1p1beta1.IFinding, + ( + | protosTypes.google.cloud.securitycenter.v1p1beta1.ICreateFindingRequest + | undefined + ), + {} | undefined + ] + >; + createFinding( + request: protosTypes.google.cloud.securitycenter.v1p1beta1.ICreateFindingRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.cloud.securitycenter.v1p1beta1.IFinding, + | protosTypes.google.cloud.securitycenter.v1p1beta1.ICreateFindingRequest + | undefined, + {} | undefined + > + ): void; + /** + * + * Creates a finding. The corresponding source must exist for finding + * creation to succeed. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Resource name of the new finding's parent. Its format should be + * "organizations/[organization_id]/sources/[source_id]". + * @param {string} request.findingId + * Required. Unique identifier provided by the client within the parent scope. + * It must be alphanumeric and less than or equal to 32 characters and + * greater than 0 characters in length. + * @param {google.cloud.securitycenter.v1p1beta1.Finding} request.finding + * Required. The Finding being created. The name and security_marks will be + * ignored as they are both output only fields on this resource. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Finding]{@link google.cloud.securitycenter.v1p1beta1.Finding}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + createFinding( + request: protosTypes.google.cloud.securitycenter.v1p1beta1.ICreateFindingRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.cloud.securitycenter.v1p1beta1.IFinding, + | protosTypes.google.cloud.securitycenter.v1p1beta1.ICreateFindingRequest + | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.cloud.securitycenter.v1p1beta1.IFinding, + | protosTypes.google.cloud.securitycenter.v1p1beta1.ICreateFindingRequest + | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.cloud.securitycenter.v1p1beta1.IFinding, + ( + | protosTypes.google.cloud.securitycenter.v1p1beta1.ICreateFindingRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + return this._innerApiCalls.createFinding(request, options, callback); + } + createNotificationConfig( + request: protosTypes.google.cloud.securitycenter.v1p1beta1.ICreateNotificationConfigRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.cloud.securitycenter.v1p1beta1.INotificationConfig, + ( + | protosTypes.google.cloud.securitycenter.v1p1beta1.ICreateNotificationConfigRequest + | undefined + ), + {} | undefined + ] + >; + createNotificationConfig( + request: protosTypes.google.cloud.securitycenter.v1p1beta1.ICreateNotificationConfigRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.cloud.securitycenter.v1p1beta1.INotificationConfig, + | protosTypes.google.cloud.securitycenter.v1p1beta1.ICreateNotificationConfigRequest + | undefined, + {} | undefined + > + ): void; + /** + * Creates a notification config. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Resource name of the new notification config's parent. Its format + * is "organizations/[organization_id]". + * @param {string} request.configId + * Required. + * Unique identifier provided by the client within the parent scope. + * It must be between 1 and 128 characters, and contains alphanumeric + * characters, underscores or hyphens only. + * @param {google.cloud.securitycenter.v1p1beta1.NotificationConfig} request.notificationConfig + * Required. The notification config being created. The name and the service + * account will be ignored as they are both output only fields on this + * resource. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [NotificationConfig]{@link google.cloud.securitycenter.v1p1beta1.NotificationConfig}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + createNotificationConfig( + request: protosTypes.google.cloud.securitycenter.v1p1beta1.ICreateNotificationConfigRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.cloud.securitycenter.v1p1beta1.INotificationConfig, + | protosTypes.google.cloud.securitycenter.v1p1beta1.ICreateNotificationConfigRequest + | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.cloud.securitycenter.v1p1beta1.INotificationConfig, + | protosTypes.google.cloud.securitycenter.v1p1beta1.ICreateNotificationConfigRequest + | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.cloud.securitycenter.v1p1beta1.INotificationConfig, + ( + | protosTypes.google.cloud.securitycenter.v1p1beta1.ICreateNotificationConfigRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + return this._innerApiCalls.createNotificationConfig( + request, + options, + callback + ); + } + deleteNotificationConfig( + request: protosTypes.google.cloud.securitycenter.v1p1beta1.IDeleteNotificationConfigRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.protobuf.IEmpty, + ( + | protosTypes.google.cloud.securitycenter.v1p1beta1.IDeleteNotificationConfigRequest + | undefined + ), + {} | undefined + ] + >; + deleteNotificationConfig( + request: protosTypes.google.cloud.securitycenter.v1p1beta1.IDeleteNotificationConfigRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.protobuf.IEmpty, + | protosTypes.google.cloud.securitycenter.v1p1beta1.IDeleteNotificationConfigRequest + | undefined, + {} | undefined + > + ): void; + /** + * Deletes a notification config. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the notification config to delete. Its format is + * "organizations/[organization_id]/notificationConfigs/[config_id]". + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + deleteNotificationConfig( + request: protosTypes.google.cloud.securitycenter.v1p1beta1.IDeleteNotificationConfigRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.protobuf.IEmpty, + | protosTypes.google.cloud.securitycenter.v1p1beta1.IDeleteNotificationConfigRequest + | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.protobuf.IEmpty, + | protosTypes.google.cloud.securitycenter.v1p1beta1.IDeleteNotificationConfigRequest + | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.protobuf.IEmpty, + ( + | protosTypes.google.cloud.securitycenter.v1p1beta1.IDeleteNotificationConfigRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + name: request.name || '', + }); + return this._innerApiCalls.deleteNotificationConfig( + request, + options, + callback + ); + } + getIamPolicy( + request: protosTypes.google.iam.v1.IGetIamPolicyRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.iam.v1.IPolicy, + protosTypes.google.iam.v1.IGetIamPolicyRequest | undefined, + {} | undefined + ] + >; + getIamPolicy( + request: protosTypes.google.iam.v1.IGetIamPolicyRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.iam.v1.IPolicy, + protosTypes.google.iam.v1.IGetIamPolicyRequest | undefined, + {} | undefined + > + ): void; + /** + * Gets the access control policy on the specified Source. + * + * @param {Object} request + * The request object that will be sent. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Policy]{@link google.iam.v1.Policy}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + getIamPolicy( + request: protosTypes.google.iam.v1.IGetIamPolicyRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.iam.v1.IPolicy, + protosTypes.google.iam.v1.IGetIamPolicyRequest | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.iam.v1.IPolicy, + protosTypes.google.iam.v1.IGetIamPolicyRequest | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.iam.v1.IPolicy, + protosTypes.google.iam.v1.IGetIamPolicyRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + resource: request.resource || '', + }); + return this._innerApiCalls.getIamPolicy(request, options, callback); + } + getNotificationConfig( + request: protosTypes.google.cloud.securitycenter.v1p1beta1.IGetNotificationConfigRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.cloud.securitycenter.v1p1beta1.INotificationConfig, + ( + | protosTypes.google.cloud.securitycenter.v1p1beta1.IGetNotificationConfigRequest + | undefined + ), + {} | undefined + ] + >; + getNotificationConfig( + request: protosTypes.google.cloud.securitycenter.v1p1beta1.IGetNotificationConfigRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.cloud.securitycenter.v1p1beta1.INotificationConfig, + | protosTypes.google.cloud.securitycenter.v1p1beta1.IGetNotificationConfigRequest + | undefined, + {} | undefined + > + ): void; + /** + * Gets a notification config. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the notification config to get. Its format is + * "organizations/[organization_id]/notificationConfigs/[config_id]". + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [NotificationConfig]{@link google.cloud.securitycenter.v1p1beta1.NotificationConfig}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + getNotificationConfig( + request: protosTypes.google.cloud.securitycenter.v1p1beta1.IGetNotificationConfigRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.cloud.securitycenter.v1p1beta1.INotificationConfig, + | protosTypes.google.cloud.securitycenter.v1p1beta1.IGetNotificationConfigRequest + | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.cloud.securitycenter.v1p1beta1.INotificationConfig, + | protosTypes.google.cloud.securitycenter.v1p1beta1.IGetNotificationConfigRequest + | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.cloud.securitycenter.v1p1beta1.INotificationConfig, + ( + | protosTypes.google.cloud.securitycenter.v1p1beta1.IGetNotificationConfigRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + name: request.name || '', + }); + return this._innerApiCalls.getNotificationConfig( + request, + options, + callback + ); + } + getOrganizationSettings( + request: protosTypes.google.cloud.securitycenter.v1p1beta1.IGetOrganizationSettingsRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.cloud.securitycenter.v1p1beta1.IOrganizationSettings, + ( + | protosTypes.google.cloud.securitycenter.v1p1beta1.IGetOrganizationSettingsRequest + | undefined + ), + {} | undefined + ] + >; + getOrganizationSettings( + request: protosTypes.google.cloud.securitycenter.v1p1beta1.IGetOrganizationSettingsRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.cloud.securitycenter.v1p1beta1.IOrganizationSettings, + | protosTypes.google.cloud.securitycenter.v1p1beta1.IGetOrganizationSettingsRequest + | undefined, + {} | undefined + > + ): void; + /** + * Gets the settings for an organization. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the organization to get organization settings for. Its + * format is "organizations/[organization_id]/organizationSettings". + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [OrganizationSettings]{@link google.cloud.securitycenter.v1p1beta1.OrganizationSettings}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + getOrganizationSettings( + request: protosTypes.google.cloud.securitycenter.v1p1beta1.IGetOrganizationSettingsRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.cloud.securitycenter.v1p1beta1.IOrganizationSettings, + | protosTypes.google.cloud.securitycenter.v1p1beta1.IGetOrganizationSettingsRequest + | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.cloud.securitycenter.v1p1beta1.IOrganizationSettings, + | protosTypes.google.cloud.securitycenter.v1p1beta1.IGetOrganizationSettingsRequest + | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.cloud.securitycenter.v1p1beta1.IOrganizationSettings, + ( + | protosTypes.google.cloud.securitycenter.v1p1beta1.IGetOrganizationSettingsRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + name: request.name || '', + }); + return this._innerApiCalls.getOrganizationSettings( + request, + options, + callback + ); + } + getSource( + request: protosTypes.google.cloud.securitycenter.v1p1beta1.IGetSourceRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.cloud.securitycenter.v1p1beta1.ISource, + ( + | protosTypes.google.cloud.securitycenter.v1p1beta1.IGetSourceRequest + | undefined + ), + {} | undefined + ] + >; + getSource( + request: protosTypes.google.cloud.securitycenter.v1p1beta1.IGetSourceRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.cloud.securitycenter.v1p1beta1.ISource, + | protosTypes.google.cloud.securitycenter.v1p1beta1.IGetSourceRequest + | undefined, + {} | undefined + > + ): void; + /** + * Gets a source. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Relative resource name of the source. Its format is + * "organizations/[organization_id]/source/[source_id]". + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Source]{@link google.cloud.securitycenter.v1p1beta1.Source}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + getSource( + request: protosTypes.google.cloud.securitycenter.v1p1beta1.IGetSourceRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.cloud.securitycenter.v1p1beta1.ISource, + | protosTypes.google.cloud.securitycenter.v1p1beta1.IGetSourceRequest + | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.cloud.securitycenter.v1p1beta1.ISource, + | protosTypes.google.cloud.securitycenter.v1p1beta1.IGetSourceRequest + | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.cloud.securitycenter.v1p1beta1.ISource, + ( + | protosTypes.google.cloud.securitycenter.v1p1beta1.IGetSourceRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + name: request.name || '', + }); + return this._innerApiCalls.getSource(request, options, callback); + } + setFindingState( + request: protosTypes.google.cloud.securitycenter.v1p1beta1.ISetFindingStateRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.cloud.securitycenter.v1p1beta1.IFinding, + ( + | protosTypes.google.cloud.securitycenter.v1p1beta1.ISetFindingStateRequest + | undefined + ), + {} | undefined + ] + >; + setFindingState( + request: protosTypes.google.cloud.securitycenter.v1p1beta1.ISetFindingStateRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.cloud.securitycenter.v1p1beta1.IFinding, + | protosTypes.google.cloud.securitycenter.v1p1beta1.ISetFindingStateRequest + | undefined, + {} | undefined + > + ): void; + /** + * + * Updates the state of a finding. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The relative resource name of the finding. See: + * https://cloud.google.com/apis/design/resource_names#relative_resource_name + * Example: + * "organizations/{organization_id}/sources/{source_id}/finding/{finding_id}". + * @param {google.cloud.securitycenter.v1p1beta1.Finding.State} request.state + * Required. The desired State of the finding. + * @param {google.protobuf.Timestamp} request.startTime + * Required. The time at which the updated state takes effect. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Finding]{@link google.cloud.securitycenter.v1p1beta1.Finding}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + setFindingState( + request: protosTypes.google.cloud.securitycenter.v1p1beta1.ISetFindingStateRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.cloud.securitycenter.v1p1beta1.IFinding, + | protosTypes.google.cloud.securitycenter.v1p1beta1.ISetFindingStateRequest + | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.cloud.securitycenter.v1p1beta1.IFinding, + | protosTypes.google.cloud.securitycenter.v1p1beta1.ISetFindingStateRequest + | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.cloud.securitycenter.v1p1beta1.IFinding, + ( + | protosTypes.google.cloud.securitycenter.v1p1beta1.ISetFindingStateRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + name: request.name || '', + }); + return this._innerApiCalls.setFindingState(request, options, callback); + } + setIamPolicy( + request: protosTypes.google.iam.v1.ISetIamPolicyRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.iam.v1.IPolicy, + protosTypes.google.iam.v1.ISetIamPolicyRequest | undefined, + {} | undefined + ] + >; + setIamPolicy( + request: protosTypes.google.iam.v1.ISetIamPolicyRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.iam.v1.IPolicy, + protosTypes.google.iam.v1.ISetIamPolicyRequest | undefined, + {} | undefined + > + ): void; + /** + * Sets the access control policy on the specified Source. + * + * @param {Object} request + * The request object that will be sent. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Policy]{@link google.iam.v1.Policy}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + setIamPolicy( + request: protosTypes.google.iam.v1.ISetIamPolicyRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.iam.v1.IPolicy, + protosTypes.google.iam.v1.ISetIamPolicyRequest | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.iam.v1.IPolicy, + protosTypes.google.iam.v1.ISetIamPolicyRequest | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.iam.v1.IPolicy, + protosTypes.google.iam.v1.ISetIamPolicyRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + resource: request.resource || '', + }); + return this._innerApiCalls.setIamPolicy(request, options, callback); + } + testIamPermissions( + request: protosTypes.google.iam.v1.ITestIamPermissionsRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.iam.v1.ITestIamPermissionsResponse, + protosTypes.google.iam.v1.ITestIamPermissionsRequest | undefined, + {} | undefined + ] + >; + testIamPermissions( + request: protosTypes.google.iam.v1.ITestIamPermissionsRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.iam.v1.ITestIamPermissionsResponse, + protosTypes.google.iam.v1.ITestIamPermissionsRequest | undefined, + {} | undefined + > + ): void; + /** + * Returns the permissions that a caller has on the specified source. + * + * @param {Object} request + * The request object that will be sent. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + testIamPermissions( + request: protosTypes.google.iam.v1.ITestIamPermissionsRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.iam.v1.ITestIamPermissionsResponse, + protosTypes.google.iam.v1.ITestIamPermissionsRequest | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.iam.v1.ITestIamPermissionsResponse, + protosTypes.google.iam.v1.ITestIamPermissionsRequest | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.iam.v1.ITestIamPermissionsResponse, + protosTypes.google.iam.v1.ITestIamPermissionsRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + resource: request.resource || '', + }); + return this._innerApiCalls.testIamPermissions(request, options, callback); + } + updateFinding( + request: protosTypes.google.cloud.securitycenter.v1p1beta1.IUpdateFindingRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.cloud.securitycenter.v1p1beta1.IFinding, + ( + | protosTypes.google.cloud.securitycenter.v1p1beta1.IUpdateFindingRequest + | undefined + ), + {} | undefined + ] + >; + updateFinding( + request: protosTypes.google.cloud.securitycenter.v1p1beta1.IUpdateFindingRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.cloud.securitycenter.v1p1beta1.IFinding, + | protosTypes.google.cloud.securitycenter.v1p1beta1.IUpdateFindingRequest + | undefined, + {} | undefined + > + ): void; + /** + * + * Creates or updates a finding. The corresponding source must exist for a + * finding creation to succeed. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.securitycenter.v1p1beta1.Finding} request.finding + * Required. The finding resource to update or create if it does not already + * exist. parent, security_marks, and update_time will be ignored. + * + * In the case of creation, the finding id portion of the name must be + * alphanumeric and less than or equal to 32 characters and greater than 0 + * characters in length. + * @param {google.protobuf.FieldMask} request.updateMask + * The FieldMask to use when updating the finding resource. This field should + * not be specified when creating a finding. + * + * When updating a finding, an empty mask is treated as updating all mutable + * fields and replacing source_properties. Individual source_properties can + * be added/updated by using "source_properties." in the field + * mask. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Finding]{@link google.cloud.securitycenter.v1p1beta1.Finding}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + updateFinding( + request: protosTypes.google.cloud.securitycenter.v1p1beta1.IUpdateFindingRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.cloud.securitycenter.v1p1beta1.IFinding, + | protosTypes.google.cloud.securitycenter.v1p1beta1.IUpdateFindingRequest + | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.cloud.securitycenter.v1p1beta1.IFinding, + | protosTypes.google.cloud.securitycenter.v1p1beta1.IUpdateFindingRequest + | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.cloud.securitycenter.v1p1beta1.IFinding, + ( + | protosTypes.google.cloud.securitycenter.v1p1beta1.IUpdateFindingRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'finding.name': request.finding!.name || '', + }); + return this._innerApiCalls.updateFinding(request, options, callback); + } + updateNotificationConfig( + request: protosTypes.google.cloud.securitycenter.v1p1beta1.IUpdateNotificationConfigRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.cloud.securitycenter.v1p1beta1.INotificationConfig, + ( + | protosTypes.google.cloud.securitycenter.v1p1beta1.IUpdateNotificationConfigRequest + | undefined + ), + {} | undefined + ] + >; + updateNotificationConfig( + request: protosTypes.google.cloud.securitycenter.v1p1beta1.IUpdateNotificationConfigRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.cloud.securitycenter.v1p1beta1.INotificationConfig, + | protosTypes.google.cloud.securitycenter.v1p1beta1.IUpdateNotificationConfigRequest + | undefined, + {} | undefined + > + ): void; + /** + * Updates a notification config. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.securitycenter.v1p1beta1.NotificationConfig} request.notificationConfig + * Required. The notification config to update. + * @param {google.protobuf.FieldMask} request.updateMask + * The FieldMask to use when updating the notification config. + * + * If empty all mutable fields will be updated. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [NotificationConfig]{@link google.cloud.securitycenter.v1p1beta1.NotificationConfig}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + updateNotificationConfig( + request: protosTypes.google.cloud.securitycenter.v1p1beta1.IUpdateNotificationConfigRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.cloud.securitycenter.v1p1beta1.INotificationConfig, + | protosTypes.google.cloud.securitycenter.v1p1beta1.IUpdateNotificationConfigRequest + | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.cloud.securitycenter.v1p1beta1.INotificationConfig, + | protosTypes.google.cloud.securitycenter.v1p1beta1.IUpdateNotificationConfigRequest + | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.cloud.securitycenter.v1p1beta1.INotificationConfig, + ( + | protosTypes.google.cloud.securitycenter.v1p1beta1.IUpdateNotificationConfigRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'notification_config.name': request.notificationConfig!.name || '', + }); + return this._innerApiCalls.updateNotificationConfig( + request, + options, + callback + ); + } + updateOrganizationSettings( + request: protosTypes.google.cloud.securitycenter.v1p1beta1.IUpdateOrganizationSettingsRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.cloud.securitycenter.v1p1beta1.IOrganizationSettings, + ( + | protosTypes.google.cloud.securitycenter.v1p1beta1.IUpdateOrganizationSettingsRequest + | undefined + ), + {} | undefined + ] + >; + updateOrganizationSettings( + request: protosTypes.google.cloud.securitycenter.v1p1beta1.IUpdateOrganizationSettingsRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.cloud.securitycenter.v1p1beta1.IOrganizationSettings, + | protosTypes.google.cloud.securitycenter.v1p1beta1.IUpdateOrganizationSettingsRequest + | undefined, + {} | undefined + > + ): void; + /** + * Updates an organization's settings. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.securitycenter.v1p1beta1.OrganizationSettings} request.organizationSettings + * Required. The organization settings resource to update. + * @param {google.protobuf.FieldMask} request.updateMask + * The FieldMask to use when updating the settings resource. + * + * If empty all mutable fields will be updated. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [OrganizationSettings]{@link google.cloud.securitycenter.v1p1beta1.OrganizationSettings}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + updateOrganizationSettings( + request: protosTypes.google.cloud.securitycenter.v1p1beta1.IUpdateOrganizationSettingsRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.cloud.securitycenter.v1p1beta1.IOrganizationSettings, + | protosTypes.google.cloud.securitycenter.v1p1beta1.IUpdateOrganizationSettingsRequest + | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.cloud.securitycenter.v1p1beta1.IOrganizationSettings, + | protosTypes.google.cloud.securitycenter.v1p1beta1.IUpdateOrganizationSettingsRequest + | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.cloud.securitycenter.v1p1beta1.IOrganizationSettings, + ( + | protosTypes.google.cloud.securitycenter.v1p1beta1.IUpdateOrganizationSettingsRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'organization_settings.name': request.organizationSettings!.name || '', + }); + return this._innerApiCalls.updateOrganizationSettings( + request, + options, + callback + ); + } + updateSource( + request: protosTypes.google.cloud.securitycenter.v1p1beta1.IUpdateSourceRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.cloud.securitycenter.v1p1beta1.ISource, + ( + | protosTypes.google.cloud.securitycenter.v1p1beta1.IUpdateSourceRequest + | undefined + ), + {} | undefined + ] + >; + updateSource( + request: protosTypes.google.cloud.securitycenter.v1p1beta1.IUpdateSourceRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.cloud.securitycenter.v1p1beta1.ISource, + | protosTypes.google.cloud.securitycenter.v1p1beta1.IUpdateSourceRequest + | undefined, + {} | undefined + > + ): void; + /** + * Updates a source. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.securitycenter.v1p1beta1.Source} request.source + * Required. The source resource to update. + * @param {google.protobuf.FieldMask} request.updateMask + * The FieldMask to use when updating the source resource. + * + * If empty all mutable fields will be updated. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Source]{@link google.cloud.securitycenter.v1p1beta1.Source}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + updateSource( + request: protosTypes.google.cloud.securitycenter.v1p1beta1.IUpdateSourceRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.cloud.securitycenter.v1p1beta1.ISource, + | protosTypes.google.cloud.securitycenter.v1p1beta1.IUpdateSourceRequest + | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.cloud.securitycenter.v1p1beta1.ISource, + | protosTypes.google.cloud.securitycenter.v1p1beta1.IUpdateSourceRequest + | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.cloud.securitycenter.v1p1beta1.ISource, + ( + | protosTypes.google.cloud.securitycenter.v1p1beta1.IUpdateSourceRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'source.name': request.source!.name || '', + }); + return this._innerApiCalls.updateSource(request, options, callback); + } + updateSecurityMarks( + request: protosTypes.google.cloud.securitycenter.v1p1beta1.IUpdateSecurityMarksRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.cloud.securitycenter.v1p1beta1.ISecurityMarks, + ( + | protosTypes.google.cloud.securitycenter.v1p1beta1.IUpdateSecurityMarksRequest + | undefined + ), + {} | undefined + ] + >; + updateSecurityMarks( + request: protosTypes.google.cloud.securitycenter.v1p1beta1.IUpdateSecurityMarksRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.cloud.securitycenter.v1p1beta1.ISecurityMarks, + | protosTypes.google.cloud.securitycenter.v1p1beta1.IUpdateSecurityMarksRequest + | undefined, + {} | undefined + > + ): void; + /** + * Updates security marks. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.securitycenter.v1p1beta1.SecurityMarks} request.securityMarks + * Required. The security marks resource to update. + * @param {google.protobuf.FieldMask} request.updateMask + * The FieldMask to use when updating the security marks resource. + * + * The field mask must not contain duplicate fields. + * If empty or set to "marks", all marks will be replaced. Individual + * marks can be updated using "marks.". + * @param {google.protobuf.Timestamp} request.startTime + * The time at which the updated SecurityMarks take effect. + * If not set uses current server time. Updates will be applied to the + * SecurityMarks that are active immediately preceding this time. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [SecurityMarks]{@link google.cloud.securitycenter.v1p1beta1.SecurityMarks}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + updateSecurityMarks( + request: protosTypes.google.cloud.securitycenter.v1p1beta1.IUpdateSecurityMarksRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.cloud.securitycenter.v1p1beta1.ISecurityMarks, + | protosTypes.google.cloud.securitycenter.v1p1beta1.IUpdateSecurityMarksRequest + | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.cloud.securitycenter.v1p1beta1.ISecurityMarks, + | protosTypes.google.cloud.securitycenter.v1p1beta1.IUpdateSecurityMarksRequest + | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.cloud.securitycenter.v1p1beta1.ISecurityMarks, + ( + | protosTypes.google.cloud.securitycenter.v1p1beta1.IUpdateSecurityMarksRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'security_marks.name': request.securityMarks!.name || '', + }); + return this._innerApiCalls.updateSecurityMarks(request, options, callback); + } + + runAssetDiscovery( + request: protosTypes.google.cloud.securitycenter.v1p1beta1.IRunAssetDiscoveryRequest, + options?: gax.CallOptions + ): Promise< + [ + LROperation< + protosTypes.google.cloud.securitycenter.v1p1beta1.IRunAssetDiscoveryResponse, + protosTypes.google.protobuf.IEmpty + >, + protosTypes.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + runAssetDiscovery( + request: protosTypes.google.cloud.securitycenter.v1p1beta1.IRunAssetDiscoveryRequest, + options: gax.CallOptions, + callback: Callback< + LROperation< + protosTypes.google.cloud.securitycenter.v1p1beta1.IRunAssetDiscoveryResponse, + protosTypes.google.protobuf.IEmpty + >, + protosTypes.google.longrunning.IOperation | undefined, + {} | undefined + > + ): void; + /** + * Runs asset discovery. The discovery is tracked with a long-running + * operation. + * + * This API can only be called with limited frequency for an organization. If + * it is called too frequently the caller will receive a TOO_MANY_REQUESTS + * error. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Name of the organization to run asset discovery for. Its format + * is "organizations/[organization_id]". + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.longrunning.Operation}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + runAssetDiscovery( + request: protosTypes.google.cloud.securitycenter.v1p1beta1.IRunAssetDiscoveryRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + LROperation< + protosTypes.google.cloud.securitycenter.v1p1beta1.IRunAssetDiscoveryResponse, + protosTypes.google.protobuf.IEmpty + >, + protosTypes.google.longrunning.IOperation | undefined, + {} | undefined + >, + callback?: Callback< + LROperation< + protosTypes.google.cloud.securitycenter.v1p1beta1.IRunAssetDiscoveryResponse, + protosTypes.google.protobuf.IEmpty + >, + protosTypes.google.longrunning.IOperation | undefined, + {} | undefined + > + ): Promise< + [ + LROperation< + protosTypes.google.cloud.securitycenter.v1p1beta1.IRunAssetDiscoveryResponse, + protosTypes.google.protobuf.IEmpty + >, + protosTypes.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + return this._innerApiCalls.runAssetDiscovery(request, options, callback); + } + groupAssets( + request: protosTypes.google.cloud.securitycenter.v1p1beta1.IGroupAssetsRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.cloud.securitycenter.v1p1beta1.IGroupResult[], + protosTypes.google.cloud.securitycenter.v1p1beta1.IGroupAssetsRequest | null, + protosTypes.google.cloud.securitycenter.v1p1beta1.IGroupAssetsResponse + ] + >; + groupAssets( + request: protosTypes.google.cloud.securitycenter.v1p1beta1.IGroupAssetsRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.cloud.securitycenter.v1p1beta1.IGroupResult[], + protosTypes.google.cloud.securitycenter.v1p1beta1.IGroupAssetsRequest | null, + protosTypes.google.cloud.securitycenter.v1p1beta1.IGroupAssetsResponse + > + ): void; + /** + * Filters an organization's assets and groups them by their specified + * properties. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Name of the organization to groupBy. Its format is + * "organizations/[organization_id]". + * @param {string} request.filter + * Expression that defines the filter to apply across assets. + * The expression is a list of zero or more restrictions combined via logical + * operators `AND` and `OR`. + * Parentheses are supported, and `OR` has higher precedence than `AND`. + * + * Restrictions have the form ` ` and may have a `-` + * character in front of them to indicate negation. The fields map to those + * defined in the Asset resource. Examples include: + * + * * name + * * security_center_properties.resource_name + * * resource_properties.a_property + * * security_marks.marks.marka + * + * The supported operators are: + * + * * `=` for all value types. + * * `>`, `<`, `>=`, `<=` for integer values. + * * `:`, meaning substring matching, for strings. + * + * The supported value types are: + * + * * string literals in quotes. + * * integer literals without quotes. + * * boolean literals `true` and `false` without quotes. + * + * The following field and operator combinations are supported: + * + * * name: `=` + * * update_time: `=`, `>`, `<`, `>=`, `<=` + * + * Usage: This should be milliseconds since epoch or an RFC3339 string. + * Examples: + * "update_time = \"2019-06-10T16:07:18-07:00\"" + * "update_time = 1560208038000" + * + * * create_time: `=`, `>`, `<`, `>=`, `<=` + * + * Usage: This should be milliseconds since epoch or an RFC3339 string. + * Examples: + * "create_time = \"2019-06-10T16:07:18-07:00\"" + * "create_time = 1560208038000" + * + * * iam_policy.policy_blob: `=`, `:` + * * resource_properties: `=`, `:`, `>`, `<`, `>=`, `<=` + * * security_marks.marks: `=`, `:` + * * security_center_properties.resource_name: `=`, `:` + * * security_center_properties.resource_name_display_name: `=`, `:` + * * security_center_properties.resource_type: `=`, `:` + * * security_center_properties.resource_parent: `=`, `:` + * * security_center_properties.resource_parent_display_name: `=`, `:` + * * security_center_properties.resource_project: `=`, `:` + * * security_center_properties.resource_project_display_name: `=`, `:` + * * security_center_properties.resource_owners: `=`, `:` + * + * For example, `resource_properties.size = 100` is a valid filter string. + * @param {string} request.groupBy + * Required. Expression that defines what assets fields to use for grouping. + * The string value should follow SQL syntax: comma separated list of fields. + * For example: + * "security_center_properties.resource_project,security_center_properties.project". + * + * The following fields are supported when compare_duration is not set: + * + * * security_center_properties.resource_project + * * security_center_properties.resource_project_display_name + * * security_center_properties.resource_type + * * security_center_properties.resource_parent + * * security_center_properties.resource_parent_display_name + * + * The following fields are supported when compare_duration is set: + * + * * security_center_properties.resource_type + * * security_center_properties.resource_project_display_name + * * security_center_properties.resource_parent_display_name + * @param {google.protobuf.Duration} request.compareDuration + * When compare_duration is set, the GroupResult's "state_change" property is + * updated to indicate whether the asset was added, removed, or remained + * present during the compare_duration period of time that precedes the + * read_time. This is the time between (read_time - compare_duration) and + * read_time. + * + * The state change value is derived based on the presence of the asset at the + * two points in time. Intermediate state changes between the two times don't + * affect the result. For example, the results aren't affected if the asset is + * removed and re-created again. + * + * Possible "state_change" values when compare_duration is specified: + * + * * "ADDED": indicates that the asset was not present at the start of + * compare_duration, but present at reference_time. + * * "REMOVED": indicates that the asset was present at the start of + * compare_duration, but not present at reference_time. + * * "ACTIVE": indicates that the asset was present at both the + * start and the end of the time period defined by + * compare_duration and reference_time. + * + * If compare_duration is not specified, then the only possible state_change + * is "UNUSED", which will be the state_change set for all assets present at + * read_time. + * + * If this field is set then `state_change` must be a specified field in + * `group_by`. + * @param {google.protobuf.Timestamp} request.readTime + * Time used as a reference point when filtering assets. The filter is limited + * to assets existing at the supplied time and their values are those at that + * specific time. Absence of this field will default to the API's version of + * NOW. + * @param {string} request.having + * Filter that specifies what fields to further filter on *after* the query + * filter has been executed. Currently only `state_change` is supported and + * requires compare_duration to be specified. + * @param {string} request.pageToken + * The value returned by the last `GroupAssetsResponse`; indicates + * that this is a continuation of a prior `GroupAssets` call, and that the + * system should return the next page of data. + * @param {number} request.pageSize + * The maximum number of results to return in a single response. Default is + * 10, minimum is 1, maximum is 1000. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [GroupResult]{@link google.cloud.securitycenter.v1p1beta1.GroupResult}. + * The client library support auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * + * When autoPaginate: false is specified through options, the array has three elements. + * The first element is Array of [GroupResult]{@link google.cloud.securitycenter.v1p1beta1.GroupResult} that corresponds to + * the one page received from the API server. + * If the second element is not null it contains the request object of type [GroupAssetsRequest]{@link google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest} + * that can be used to obtain the next page of the results. + * If it is null, the next page does not exist. + * The third element contains the raw response received from the API server. Its type is + * [GroupAssetsResponse]{@link google.cloud.securitycenter.v1p1beta1.GroupAssetsResponse}. + * + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + groupAssets( + request: protosTypes.google.cloud.securitycenter.v1p1beta1.IGroupAssetsRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.cloud.securitycenter.v1p1beta1.IGroupResult[], + protosTypes.google.cloud.securitycenter.v1p1beta1.IGroupAssetsRequest | null, + protosTypes.google.cloud.securitycenter.v1p1beta1.IGroupAssetsResponse + >, + callback?: Callback< + protosTypes.google.cloud.securitycenter.v1p1beta1.IGroupResult[], + protosTypes.google.cloud.securitycenter.v1p1beta1.IGroupAssetsRequest | null, + protosTypes.google.cloud.securitycenter.v1p1beta1.IGroupAssetsResponse + > + ): Promise< + [ + protosTypes.google.cloud.securitycenter.v1p1beta1.IGroupResult[], + protosTypes.google.cloud.securitycenter.v1p1beta1.IGroupAssetsRequest | null, + protosTypes.google.cloud.securitycenter.v1p1beta1.IGroupAssetsResponse + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + return this._innerApiCalls.groupAssets(request, options, callback); + } + + /** + * Equivalent to {@link groupAssets}, but returns a NodeJS Stream object. + * + * This fetches the paged responses for {@link groupAssets} continuously + * and invokes the callback registered for 'data' event for each element in the + * responses. + * + * The returned object has 'end' method when no more elements are required. + * + * autoPaginate option will be ignored. + * + * @see {@link https://nodejs.org/api/stream.html} + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Name of the organization to groupBy. Its format is + * "organizations/[organization_id]". + * @param {string} request.filter + * Expression that defines the filter to apply across assets. + * The expression is a list of zero or more restrictions combined via logical + * operators `AND` and `OR`. + * Parentheses are supported, and `OR` has higher precedence than `AND`. + * + * Restrictions have the form ` ` and may have a `-` + * character in front of them to indicate negation. The fields map to those + * defined in the Asset resource. Examples include: + * + * * name + * * security_center_properties.resource_name + * * resource_properties.a_property + * * security_marks.marks.marka + * + * The supported operators are: + * + * * `=` for all value types. + * * `>`, `<`, `>=`, `<=` for integer values. + * * `:`, meaning substring matching, for strings. + * + * The supported value types are: + * + * * string literals in quotes. + * * integer literals without quotes. + * * boolean literals `true` and `false` without quotes. + * + * The following field and operator combinations are supported: + * + * * name: `=` + * * update_time: `=`, `>`, `<`, `>=`, `<=` + * + * Usage: This should be milliseconds since epoch or an RFC3339 string. + * Examples: + * "update_time = \"2019-06-10T16:07:18-07:00\"" + * "update_time = 1560208038000" + * + * * create_time: `=`, `>`, `<`, `>=`, `<=` + * + * Usage: This should be milliseconds since epoch or an RFC3339 string. + * Examples: + * "create_time = \"2019-06-10T16:07:18-07:00\"" + * "create_time = 1560208038000" + * + * * iam_policy.policy_blob: `=`, `:` + * * resource_properties: `=`, `:`, `>`, `<`, `>=`, `<=` + * * security_marks.marks: `=`, `:` + * * security_center_properties.resource_name: `=`, `:` + * * security_center_properties.resource_name_display_name: `=`, `:` + * * security_center_properties.resource_type: `=`, `:` + * * security_center_properties.resource_parent: `=`, `:` + * * security_center_properties.resource_parent_display_name: `=`, `:` + * * security_center_properties.resource_project: `=`, `:` + * * security_center_properties.resource_project_display_name: `=`, `:` + * * security_center_properties.resource_owners: `=`, `:` + * + * For example, `resource_properties.size = 100` is a valid filter string. + * @param {string} request.groupBy + * Required. Expression that defines what assets fields to use for grouping. + * The string value should follow SQL syntax: comma separated list of fields. + * For example: + * "security_center_properties.resource_project,security_center_properties.project". + * + * The following fields are supported when compare_duration is not set: + * + * * security_center_properties.resource_project + * * security_center_properties.resource_project_display_name + * * security_center_properties.resource_type + * * security_center_properties.resource_parent + * * security_center_properties.resource_parent_display_name + * + * The following fields are supported when compare_duration is set: + * + * * security_center_properties.resource_type + * * security_center_properties.resource_project_display_name + * * security_center_properties.resource_parent_display_name + * @param {google.protobuf.Duration} request.compareDuration + * When compare_duration is set, the GroupResult's "state_change" property is + * updated to indicate whether the asset was added, removed, or remained + * present during the compare_duration period of time that precedes the + * read_time. This is the time between (read_time - compare_duration) and + * read_time. + * + * The state change value is derived based on the presence of the asset at the + * two points in time. Intermediate state changes between the two times don't + * affect the result. For example, the results aren't affected if the asset is + * removed and re-created again. + * + * Possible "state_change" values when compare_duration is specified: + * + * * "ADDED": indicates that the asset was not present at the start of + * compare_duration, but present at reference_time. + * * "REMOVED": indicates that the asset was present at the start of + * compare_duration, but not present at reference_time. + * * "ACTIVE": indicates that the asset was present at both the + * start and the end of the time period defined by + * compare_duration and reference_time. + * + * If compare_duration is not specified, then the only possible state_change + * is "UNUSED", which will be the state_change set for all assets present at + * read_time. + * + * If this field is set then `state_change` must be a specified field in + * `group_by`. + * @param {google.protobuf.Timestamp} request.readTime + * Time used as a reference point when filtering assets. The filter is limited + * to assets existing at the supplied time and their values are those at that + * specific time. Absence of this field will default to the API's version of + * NOW. + * @param {string} request.having + * Filter that specifies what fields to further filter on *after* the query + * filter has been executed. Currently only `state_change` is supported and + * requires compare_duration to be specified. + * @param {string} request.pageToken + * The value returned by the last `GroupAssetsResponse`; indicates + * that this is a continuation of a prior `GroupAssets` call, and that the + * system should return the next page of data. + * @param {number} request.pageSize + * The maximum number of results to return in a single response. Default is + * 10, minimum is 1, maximum is 1000. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [GroupResult]{@link google.cloud.securitycenter.v1p1beta1.GroupResult} on 'data' event. + */ + groupAssetsStream( + request?: protosTypes.google.cloud.securitycenter.v1p1beta1.IGroupAssetsRequest, + options?: gax.CallOptions | {} + ): Transform { + request = request || {}; + const callSettings = new gax.CallSettings(options); + return this._descriptors.page.groupAssets.createStream( + this._innerApiCalls.groupAssets as gax.GaxCall, + request, + callSettings + ); + } + groupFindings( + request: protosTypes.google.cloud.securitycenter.v1p1beta1.IGroupFindingsRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.cloud.securitycenter.v1p1beta1.IGroupResult[], + protosTypes.google.cloud.securitycenter.v1p1beta1.IGroupFindingsRequest | null, + protosTypes.google.cloud.securitycenter.v1p1beta1.IGroupFindingsResponse + ] + >; + groupFindings( + request: protosTypes.google.cloud.securitycenter.v1p1beta1.IGroupFindingsRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.cloud.securitycenter.v1p1beta1.IGroupResult[], + protosTypes.google.cloud.securitycenter.v1p1beta1.IGroupFindingsRequest | null, + protosTypes.google.cloud.securitycenter.v1p1beta1.IGroupFindingsResponse + > + ): void; + /** + * Filters an organization or source's findings and groups them by their + * specified properties. + * + * To group across all sources provide a `-` as the source id. + * Example: /v1p1beta1/organizations/{organization_id}/sources/-/findings + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Name of the source to groupBy. Its format is + * "organizations/[organization_id]/sources/[source_id]". To groupBy across + * all sources provide a source_id of `-`. For example: + * organizations/{organization_id}/sources/- + * @param {string} request.filter + * Expression that defines the filter to apply across findings. + * The expression is a list of one or more restrictions combined via logical + * operators `AND` and `OR`. + * Parentheses are supported, and `OR` has higher precedence than `AND`. + * + * Restrictions have the form ` ` and may have a `-` + * character in front of them to indicate negation. Examples include: + * + * * name + * * source_properties.a_property + * * security_marks.marks.marka + * + * The supported operators are: + * + * * `=` for all value types. + * * `>`, `<`, `>=`, `<=` for integer values. + * * `:`, meaning substring matching, for strings. + * + * The supported value types are: + * + * * string literals in quotes. + * * integer literals without quotes. + * * boolean literals `true` and `false` without quotes. + * + * The following field and operator combinations are supported: + * + * * name: `=` + * * parent: `=`, `:` + * * resource_name: `=`, `:` + * * state: `=`, `:` + * * category: `=`, `:` + * * external_uri: `=`, `:` + * * event_time: `=`, `>`, `<`, `>=`, `<=` + * + * Usage: This should be milliseconds since epoch or an RFC3339 string. + * Examples: + * "event_time = \"2019-06-10T16:07:18-07:00\"" + * "event_time = 1560208038000" + * + * * security_marks.marks: `=`, `:` + * * source_properties: `=`, `:`, `>`, `<`, `>=`, `<=` + * + * For example, `source_properties.size = 100` is a valid filter string. + * @param {string} request.groupBy + * Required. Expression that defines what assets fields to use for grouping + * (including `state_change`). The string value should follow SQL syntax: + * comma separated list of fields. For example: "parent,resource_name". + * + * The following fields are supported: + * + * * resource_name + * * category + * * state + * * parent + * + * The following fields are supported when compare_duration is set: + * + * * state_change + * @param {google.protobuf.Timestamp} request.readTime + * Time used as a reference point when filtering findings. The filter is + * limited to findings existing at the supplied time and their values are + * those at that specific time. Absence of this field will default to the + * API's version of NOW. + * @param {google.protobuf.Duration} request.compareDuration + * When compare_duration is set, the GroupResult's "state_change" attribute is + * updated to indicate whether the finding had its state changed, the + * finding's state remained unchanged, or if the finding was added during the + * compare_duration period of time that precedes the read_time. This is the + * time between (read_time - compare_duration) and read_time. + * + * The state_change value is derived based on the presence and state of the + * finding at the two points in time. Intermediate state changes between the + * two times don't affect the result. For example, the results aren't affected + * if the finding is made inactive and then active again. + * + * Possible "state_change" values when compare_duration is specified: + * + * * "CHANGED": indicates that the finding was present at the start of + * compare_duration, but changed its state at read_time. + * * "UNCHANGED": indicates that the finding was present at the start of + * compare_duration and did not change state at read_time. + * * "ADDED": indicates that the finding was not present at the start + * of compare_duration, but was present at read_time. + * + * If compare_duration is not specified, then the only possible state_change + * is "UNUSED", which will be the state_change set for all findings present + * at read_time. + * + * If this field is set then `state_change` must be a specified field in + * `group_by`. + * @param {string} request.having + * Filter that specifies what fields to further filter on *after* the query + * filter has been executed. Currently only `finding.state` and `state_change` + * are supported and requires compare_duration to be specified. + * @param {string} request.pageToken + * The value returned by the last `GroupFindingsResponse`; indicates + * that this is a continuation of a prior `GroupFindings` call, and + * that the system should return the next page of data. + * @param {number} request.pageSize + * The maximum number of results to return in a single response. Default is + * 10, minimum is 1, maximum is 1000. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [GroupResult]{@link google.cloud.securitycenter.v1p1beta1.GroupResult}. + * The client library support auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * + * When autoPaginate: false is specified through options, the array has three elements. + * The first element is Array of [GroupResult]{@link google.cloud.securitycenter.v1p1beta1.GroupResult} that corresponds to + * the one page received from the API server. + * If the second element is not null it contains the request object of type [GroupFindingsRequest]{@link google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest} + * that can be used to obtain the next page of the results. + * If it is null, the next page does not exist. + * The third element contains the raw response received from the API server. Its type is + * [GroupFindingsResponse]{@link google.cloud.securitycenter.v1p1beta1.GroupFindingsResponse}. + * + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + groupFindings( + request: protosTypes.google.cloud.securitycenter.v1p1beta1.IGroupFindingsRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.cloud.securitycenter.v1p1beta1.IGroupResult[], + protosTypes.google.cloud.securitycenter.v1p1beta1.IGroupFindingsRequest | null, + protosTypes.google.cloud.securitycenter.v1p1beta1.IGroupFindingsResponse + >, + callback?: Callback< + protosTypes.google.cloud.securitycenter.v1p1beta1.IGroupResult[], + protosTypes.google.cloud.securitycenter.v1p1beta1.IGroupFindingsRequest | null, + protosTypes.google.cloud.securitycenter.v1p1beta1.IGroupFindingsResponse + > + ): Promise< + [ + protosTypes.google.cloud.securitycenter.v1p1beta1.IGroupResult[], + protosTypes.google.cloud.securitycenter.v1p1beta1.IGroupFindingsRequest | null, + protosTypes.google.cloud.securitycenter.v1p1beta1.IGroupFindingsResponse + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + return this._innerApiCalls.groupFindings(request, options, callback); + } + + /** + * Equivalent to {@link groupFindings}, but returns a NodeJS Stream object. + * + * This fetches the paged responses for {@link groupFindings} continuously + * and invokes the callback registered for 'data' event for each element in the + * responses. + * + * The returned object has 'end' method when no more elements are required. + * + * autoPaginate option will be ignored. + * + * @see {@link https://nodejs.org/api/stream.html} + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Name of the source to groupBy. Its format is + * "organizations/[organization_id]/sources/[source_id]". To groupBy across + * all sources provide a source_id of `-`. For example: + * organizations/{organization_id}/sources/- + * @param {string} request.filter + * Expression that defines the filter to apply across findings. + * The expression is a list of one or more restrictions combined via logical + * operators `AND` and `OR`. + * Parentheses are supported, and `OR` has higher precedence than `AND`. + * + * Restrictions have the form ` ` and may have a `-` + * character in front of them to indicate negation. Examples include: + * + * * name + * * source_properties.a_property + * * security_marks.marks.marka + * + * The supported operators are: + * + * * `=` for all value types. + * * `>`, `<`, `>=`, `<=` for integer values. + * * `:`, meaning substring matching, for strings. + * + * The supported value types are: + * + * * string literals in quotes. + * * integer literals without quotes. + * * boolean literals `true` and `false` without quotes. + * + * The following field and operator combinations are supported: + * + * * name: `=` + * * parent: `=`, `:` + * * resource_name: `=`, `:` + * * state: `=`, `:` + * * category: `=`, `:` + * * external_uri: `=`, `:` + * * event_time: `=`, `>`, `<`, `>=`, `<=` + * + * Usage: This should be milliseconds since epoch or an RFC3339 string. + * Examples: + * "event_time = \"2019-06-10T16:07:18-07:00\"" + * "event_time = 1560208038000" + * + * * security_marks.marks: `=`, `:` + * * source_properties: `=`, `:`, `>`, `<`, `>=`, `<=` + * + * For example, `source_properties.size = 100` is a valid filter string. + * @param {string} request.groupBy + * Required. Expression that defines what assets fields to use for grouping + * (including `state_change`). The string value should follow SQL syntax: + * comma separated list of fields. For example: "parent,resource_name". + * + * The following fields are supported: + * + * * resource_name + * * category + * * state + * * parent + * + * The following fields are supported when compare_duration is set: + * + * * state_change + * @param {google.protobuf.Timestamp} request.readTime + * Time used as a reference point when filtering findings. The filter is + * limited to findings existing at the supplied time and their values are + * those at that specific time. Absence of this field will default to the + * API's version of NOW. + * @param {google.protobuf.Duration} request.compareDuration + * When compare_duration is set, the GroupResult's "state_change" attribute is + * updated to indicate whether the finding had its state changed, the + * finding's state remained unchanged, or if the finding was added during the + * compare_duration period of time that precedes the read_time. This is the + * time between (read_time - compare_duration) and read_time. + * + * The state_change value is derived based on the presence and state of the + * finding at the two points in time. Intermediate state changes between the + * two times don't affect the result. For example, the results aren't affected + * if the finding is made inactive and then active again. + * + * Possible "state_change" values when compare_duration is specified: + * + * * "CHANGED": indicates that the finding was present at the start of + * compare_duration, but changed its state at read_time. + * * "UNCHANGED": indicates that the finding was present at the start of + * compare_duration and did not change state at read_time. + * * "ADDED": indicates that the finding was not present at the start + * of compare_duration, but was present at read_time. + * + * If compare_duration is not specified, then the only possible state_change + * is "UNUSED", which will be the state_change set for all findings present + * at read_time. + * + * If this field is set then `state_change` must be a specified field in + * `group_by`. + * @param {string} request.having + * Filter that specifies what fields to further filter on *after* the query + * filter has been executed. Currently only `finding.state` and `state_change` + * are supported and requires compare_duration to be specified. + * @param {string} request.pageToken + * The value returned by the last `GroupFindingsResponse`; indicates + * that this is a continuation of a prior `GroupFindings` call, and + * that the system should return the next page of data. + * @param {number} request.pageSize + * The maximum number of results to return in a single response. Default is + * 10, minimum is 1, maximum is 1000. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [GroupResult]{@link google.cloud.securitycenter.v1p1beta1.GroupResult} on 'data' event. + */ + groupFindingsStream( + request?: protosTypes.google.cloud.securitycenter.v1p1beta1.IGroupFindingsRequest, + options?: gax.CallOptions | {} + ): Transform { + request = request || {}; + const callSettings = new gax.CallSettings(options); + return this._descriptors.page.groupFindings.createStream( + this._innerApiCalls.groupFindings as gax.GaxCall, + request, + callSettings + ); + } + listAssets( + request: protosTypes.google.cloud.securitycenter.v1p1beta1.IListAssetsRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.IListAssetsResult[], + protosTypes.google.cloud.securitycenter.v1p1beta1.IListAssetsRequest | null, + protosTypes.google.cloud.securitycenter.v1p1beta1.IListAssetsResponse + ] + >; + listAssets( + request: protosTypes.google.cloud.securitycenter.v1p1beta1.IListAssetsRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.IListAssetsResult[], + protosTypes.google.cloud.securitycenter.v1p1beta1.IListAssetsRequest | null, + protosTypes.google.cloud.securitycenter.v1p1beta1.IListAssetsResponse + > + ): void; + /** + * Lists an organization's assets. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Name of the organization assets should belong to. Its format is + * "organizations/[organization_id]". + * @param {string} request.filter + * Expression that defines the filter to apply across assets. + * The expression is a list of zero or more restrictions combined via logical + * operators `AND` and `OR`. + * Parentheses are supported, and `OR` has higher precedence than `AND`. + * + * Restrictions have the form ` ` and may have a `-` + * character in front of them to indicate negation. The fields map to those + * defined in the Asset resource. Examples include: + * + * * name + * * security_center_properties.resource_name + * * resource_properties.a_property + * * security_marks.marks.marka + * + * The supported operators are: + * + * * `=` for all value types. + * * `>`, `<`, `>=`, `<=` for integer values. + * * `:`, meaning substring matching, for strings. + * + * The supported value types are: + * + * * string literals in quotes. + * * integer literals without quotes. + * * boolean literals `true` and `false` without quotes. + * + * The following are the allowed field and operator combinations: + * + * * name: `=` + * * update_time: `=`, `>`, `<`, `>=`, `<=` + * + * Usage: This should be milliseconds since epoch or an RFC3339 string. + * Examples: + * "update_time = \"2019-06-10T16:07:18-07:00\"" + * "update_time = 1560208038000" + * + * * create_time: `=`, `>`, `<`, `>=`, `<=` + * + * Usage: This should be milliseconds since epoch or an RFC3339 string. + * Examples: + * "create_time = \"2019-06-10T16:07:18-07:00\"" + * "create_time = 1560208038000" + * + * * iam_policy.policy_blob: `=`, `:` + * * resource_properties: `=`, `:`, `>`, `<`, `>=`, `<=` + * * security_marks.marks: `=`, `:` + * * security_center_properties.resource_name: `=`, `:` + * * security_center_properties.resource_display_name: `=`, `:` + * * security_center_properties.resource_type: `=`, `:` + * * security_center_properties.resource_parent: `=`, `:` + * * security_center_properties.resource_parent_display_name: `=`, `:` + * * security_center_properties.resource_project: `=`, `:` + * * security_center_properties.resource_project_display_name: `=`, `:` + * * security_center_properties.resource_owners: `=`, `:` + * + * For example, `resource_properties.size = 100` is a valid filter string. + * @param {string} request.orderBy + * Expression that defines what fields and order to use for sorting. The + * string value should follow SQL syntax: comma separated list of fields. For + * example: "name,resource_properties.a_property". The default sorting order + * is ascending. To specify descending order for a field, a suffix " desc" + * should be appended to the field name. For example: "name + * desc,resource_properties.a_property". Redundant space characters in the + * syntax are insignificant. "name desc,resource_properties.a_property" and " + * name desc , resource_properties.a_property " are equivalent. + * + * The following fields are supported: + * name + * update_time + * resource_properties + * security_marks.marks + * security_center_properties.resource_name + * security_center_properties.resource_display_name + * security_center_properties.resource_parent + * security_center_properties.resource_parent_display_name + * security_center_properties.resource_project + * security_center_properties.resource_project_display_name + * security_center_properties.resource_type + * @param {google.protobuf.Timestamp} request.readTime + * Time used as a reference point when filtering assets. The filter is limited + * to assets existing at the supplied time and their values are those at that + * specific time. Absence of this field will default to the API's version of + * NOW. + * @param {google.protobuf.Duration} request.compareDuration + * When compare_duration is set, the ListAssetsResult's "state_change" + * attribute is updated to indicate whether the asset was added, removed, or + * remained present during the compare_duration period of time that precedes + * the read_time. This is the time between (read_time - compare_duration) and + * read_time. + * + * The state_change value is derived based on the presence of the asset at the + * two points in time. Intermediate state changes between the two times don't + * affect the result. For example, the results aren't affected if the asset is + * removed and re-created again. + * + * Possible "state_change" values when compare_duration is specified: + * + * * "ADDED": indicates that the asset was not present at the start of + * compare_duration, but present at read_time. + * * "REMOVED": indicates that the asset was present at the start of + * compare_duration, but not present at read_time. + * * "ACTIVE": indicates that the asset was present at both the + * start and the end of the time period defined by + * compare_duration and read_time. + * + * If compare_duration is not specified, then the only possible state_change + * is "UNUSED", which will be the state_change set for all assets present at + * read_time. + * @param {string} request.having + * Filter that specifies what fields to further filter on *after* the query + * filter has been executed. Currently only `state_change` is supported and + * requires compare_duration to be specified. + * @param {google.protobuf.FieldMask} [request.fieldMask] + * Optional. + * A field mask to specify the ListAssetsResult fields to be listed in the + * response. + * An empty field mask will list all fields. + * @param {string} request.pageToken + * The value returned by the last `ListAssetsResponse`; indicates + * that this is a continuation of a prior `ListAssets` call, and + * that the system should return the next page of data. + * @param {number} request.pageSize + * The maximum number of results to return in a single response. Default is + * 10, minimum is 1, maximum is 1000. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [ListAssetsResult]{@link google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult}. + * The client library support auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * + * When autoPaginate: false is specified through options, the array has three elements. + * The first element is Array of [ListAssetsResult]{@link google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult} that corresponds to + * the one page received from the API server. + * If the second element is not null it contains the request object of type [ListAssetsRequest]{@link google.cloud.securitycenter.v1p1beta1.ListAssetsRequest} + * that can be used to obtain the next page of the results. + * If it is null, the next page does not exist. + * The third element contains the raw response received from the API server. Its type is + * [ListAssetsResponse]{@link google.cloud.securitycenter.v1p1beta1.ListAssetsResponse}. + * + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + listAssets( + request: protosTypes.google.cloud.securitycenter.v1p1beta1.IListAssetsRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.IListAssetsResult[], + protosTypes.google.cloud.securitycenter.v1p1beta1.IListAssetsRequest | null, + protosTypes.google.cloud.securitycenter.v1p1beta1.IListAssetsResponse + >, + callback?: Callback< + protosTypes.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.IListAssetsResult[], + protosTypes.google.cloud.securitycenter.v1p1beta1.IListAssetsRequest | null, + protosTypes.google.cloud.securitycenter.v1p1beta1.IListAssetsResponse + > + ): Promise< + [ + protosTypes.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.IListAssetsResult[], + protosTypes.google.cloud.securitycenter.v1p1beta1.IListAssetsRequest | null, + protosTypes.google.cloud.securitycenter.v1p1beta1.IListAssetsResponse + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + return this._innerApiCalls.listAssets(request, options, callback); + } + + /** + * Equivalent to {@link listAssets}, but returns a NodeJS Stream object. + * + * This fetches the paged responses for {@link listAssets} continuously + * and invokes the callback registered for 'data' event for each element in the + * responses. + * + * The returned object has 'end' method when no more elements are required. + * + * autoPaginate option will be ignored. + * + * @see {@link https://nodejs.org/api/stream.html} + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Name of the organization assets should belong to. Its format is + * "organizations/[organization_id]". + * @param {string} request.filter + * Expression that defines the filter to apply across assets. + * The expression is a list of zero or more restrictions combined via logical + * operators `AND` and `OR`. + * Parentheses are supported, and `OR` has higher precedence than `AND`. + * + * Restrictions have the form ` ` and may have a `-` + * character in front of them to indicate negation. The fields map to those + * defined in the Asset resource. Examples include: + * + * * name + * * security_center_properties.resource_name + * * resource_properties.a_property + * * security_marks.marks.marka + * + * The supported operators are: + * + * * `=` for all value types. + * * `>`, `<`, `>=`, `<=` for integer values. + * * `:`, meaning substring matching, for strings. + * + * The supported value types are: + * + * * string literals in quotes. + * * integer literals without quotes. + * * boolean literals `true` and `false` without quotes. + * + * The following are the allowed field and operator combinations: + * + * * name: `=` + * * update_time: `=`, `>`, `<`, `>=`, `<=` + * + * Usage: This should be milliseconds since epoch or an RFC3339 string. + * Examples: + * "update_time = \"2019-06-10T16:07:18-07:00\"" + * "update_time = 1560208038000" + * + * * create_time: `=`, `>`, `<`, `>=`, `<=` + * + * Usage: This should be milliseconds since epoch or an RFC3339 string. + * Examples: + * "create_time = \"2019-06-10T16:07:18-07:00\"" + * "create_time = 1560208038000" + * + * * iam_policy.policy_blob: `=`, `:` + * * resource_properties: `=`, `:`, `>`, `<`, `>=`, `<=` + * * security_marks.marks: `=`, `:` + * * security_center_properties.resource_name: `=`, `:` + * * security_center_properties.resource_display_name: `=`, `:` + * * security_center_properties.resource_type: `=`, `:` + * * security_center_properties.resource_parent: `=`, `:` + * * security_center_properties.resource_parent_display_name: `=`, `:` + * * security_center_properties.resource_project: `=`, `:` + * * security_center_properties.resource_project_display_name: `=`, `:` + * * security_center_properties.resource_owners: `=`, `:` + * + * For example, `resource_properties.size = 100` is a valid filter string. + * @param {string} request.orderBy + * Expression that defines what fields and order to use for sorting. The + * string value should follow SQL syntax: comma separated list of fields. For + * example: "name,resource_properties.a_property". The default sorting order + * is ascending. To specify descending order for a field, a suffix " desc" + * should be appended to the field name. For example: "name + * desc,resource_properties.a_property". Redundant space characters in the + * syntax are insignificant. "name desc,resource_properties.a_property" and " + * name desc , resource_properties.a_property " are equivalent. + * + * The following fields are supported: + * name + * update_time + * resource_properties + * security_marks.marks + * security_center_properties.resource_name + * security_center_properties.resource_display_name + * security_center_properties.resource_parent + * security_center_properties.resource_parent_display_name + * security_center_properties.resource_project + * security_center_properties.resource_project_display_name + * security_center_properties.resource_type + * @param {google.protobuf.Timestamp} request.readTime + * Time used as a reference point when filtering assets. The filter is limited + * to assets existing at the supplied time and their values are those at that + * specific time. Absence of this field will default to the API's version of + * NOW. + * @param {google.protobuf.Duration} request.compareDuration + * When compare_duration is set, the ListAssetsResult's "state_change" + * attribute is updated to indicate whether the asset was added, removed, or + * remained present during the compare_duration period of time that precedes + * the read_time. This is the time between (read_time - compare_duration) and + * read_time. + * + * The state_change value is derived based on the presence of the asset at the + * two points in time. Intermediate state changes between the two times don't + * affect the result. For example, the results aren't affected if the asset is + * removed and re-created again. + * + * Possible "state_change" values when compare_duration is specified: + * + * * "ADDED": indicates that the asset was not present at the start of + * compare_duration, but present at read_time. + * * "REMOVED": indicates that the asset was present at the start of + * compare_duration, but not present at read_time. + * * "ACTIVE": indicates that the asset was present at both the + * start and the end of the time period defined by + * compare_duration and read_time. + * + * If compare_duration is not specified, then the only possible state_change + * is "UNUSED", which will be the state_change set for all assets present at + * read_time. + * @param {string} request.having + * Filter that specifies what fields to further filter on *after* the query + * filter has been executed. Currently only `state_change` is supported and + * requires compare_duration to be specified. + * @param {google.protobuf.FieldMask} [request.fieldMask] + * Optional. + * A field mask to specify the ListAssetsResult fields to be listed in the + * response. + * An empty field mask will list all fields. + * @param {string} request.pageToken + * The value returned by the last `ListAssetsResponse`; indicates + * that this is a continuation of a prior `ListAssets` call, and + * that the system should return the next page of data. + * @param {number} request.pageSize + * The maximum number of results to return in a single response. Default is + * 10, minimum is 1, maximum is 1000. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [ListAssetsResult]{@link google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult} on 'data' event. + */ + listAssetsStream( + request?: protosTypes.google.cloud.securitycenter.v1p1beta1.IListAssetsRequest, + options?: gax.CallOptions | {} + ): Transform { + request = request || {}; + const callSettings = new gax.CallSettings(options); + return this._descriptors.page.listAssets.createStream( + this._innerApiCalls.listAssets as gax.GaxCall, + request, + callSettings + ); + } + listFindings( + request: protosTypes.google.cloud.securitycenter.v1p1beta1.IListFindingsRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.IListFindingsResult[], + protosTypes.google.cloud.securitycenter.v1p1beta1.IListFindingsRequest | null, + protosTypes.google.cloud.securitycenter.v1p1beta1.IListFindingsResponse + ] + >; + listFindings( + request: protosTypes.google.cloud.securitycenter.v1p1beta1.IListFindingsRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.IListFindingsResult[], + protosTypes.google.cloud.securitycenter.v1p1beta1.IListFindingsRequest | null, + protosTypes.google.cloud.securitycenter.v1p1beta1.IListFindingsResponse + > + ): void; + /** + * Lists an organization or source's findings. + * + * To list across all sources provide a `-` as the source id. + * Example: /v1p1beta1/organizations/{organization_id}/sources/-/findings + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Name of the source the findings belong to. Its format is + * "organizations/[organization_id]/sources/[source_id]". To list across all + * sources provide a source_id of `-`. For example: + * organizations/{organization_id}/sources/- + * @param {string} request.filter + * Expression that defines the filter to apply across findings. + * The expression is a list of one or more restrictions combined via logical + * operators `AND` and `OR`. + * Parentheses are supported, and `OR` has higher precedence than `AND`. + * + * Restrictions have the form ` ` and may have a `-` + * character in front of them to indicate negation. Examples include: + * + * * name + * * source_properties.a_property + * * security_marks.marks.marka + * + * The supported operators are: + * + * * `=` for all value types. + * * `>`, `<`, `>=`, `<=` for integer values. + * * `:`, meaning substring matching, for strings. + * + * The supported value types are: + * + * * string literals in quotes. + * * integer literals without quotes. + * * boolean literals `true` and `false` without quotes. + * + * The following field and operator combinations are supported: + * + * name: `=` + * parent: `=`, `:` + * resource_name: `=`, `:` + * state: `=`, `:` + * category: `=`, `:` + * external_uri: `=`, `:` + * event_time: `=`, `>`, `<`, `>=`, `<=` + * + * Usage: This should be milliseconds since epoch or an RFC3339 string. + * Examples: + * "event_time = \"2019-06-10T16:07:18-07:00\"" + * "event_time = 1560208038000" + * + * security_marks.marks: `=`, `:` + * source_properties: `=`, `:`, `>`, `<`, `>=`, `<=` + * + * For example, `source_properties.size = 100` is a valid filter string. + * @param {string} request.orderBy + * Expression that defines what fields and order to use for sorting. The + * string value should follow SQL syntax: comma separated list of fields. For + * example: "name,resource_properties.a_property". The default sorting order + * is ascending. To specify descending order for a field, a suffix " desc" + * should be appended to the field name. For example: "name + * desc,source_properties.a_property". Redundant space characters in the + * syntax are insignificant. "name desc,source_properties.a_property" and " + * name desc , source_properties.a_property " are equivalent. + * + * The following fields are supported: + * name + * parent + * state + * category + * resource_name + * event_time + * source_properties + * security_marks.marks + * @param {google.protobuf.Timestamp} request.readTime + * Time used as a reference point when filtering findings. The filter is + * limited to findings existing at the supplied time and their values are + * those at that specific time. Absence of this field will default to the + * API's version of NOW. + * @param {google.protobuf.Duration} request.compareDuration + * When compare_duration is set, the ListFindingsResult's "state_change" + * attribute is updated to indicate whether the finding had its state changed, + * the finding's state remained unchanged, or if the finding was added in any + * state during the compare_duration period of time that precedes the + * read_time. This is the time between (read_time - compare_duration) and + * read_time. + * + * The state_change value is derived based on the presence and state of the + * finding at the two points in time. Intermediate state changes between the + * two times don't affect the result. For example, the results aren't affected + * if the finding is made inactive and then active again. + * + * Possible "state_change" values when compare_duration is specified: + * + * * "CHANGED": indicates that the finding was present at the start of + * compare_duration, but changed its state at read_time. + * * "UNCHANGED": indicates that the finding was present at the start of + * compare_duration and did not change state at read_time. + * * "ADDED": indicates that the finding was not present at the start + * of compare_duration, but was present at read_time. + * + * If compare_duration is not specified, then the only possible state_change + * is "UNUSED", which will be the state_change set for all findings present at + * read_time. + * @param {string} request.having + * Filter that specifies what fields to further filter on *after* the query + * filter has been executed. Currently only `finding.state` and `state_change` + * are supported and requires compare_duration to be specified. + * @param {google.protobuf.FieldMask} [request.fieldMask] + * Optional. + * A field mask to specify the Finding fields to be listed in the response. + * An empty field mask will list all fields. + * @param {string} request.pageToken + * The value returned by the last `ListFindingsResponse`; indicates + * that this is a continuation of a prior `ListFindings` call, and + * that the system should return the next page of data. + * @param {number} request.pageSize + * The maximum number of results to return in a single response. Default is + * 10, minimum is 1, maximum is 1000. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [ListFindingsResult]{@link google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult}. + * The client library support auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * + * When autoPaginate: false is specified through options, the array has three elements. + * The first element is Array of [ListFindingsResult]{@link google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult} that corresponds to + * the one page received from the API server. + * If the second element is not null it contains the request object of type [ListFindingsRequest]{@link google.cloud.securitycenter.v1p1beta1.ListFindingsRequest} + * that can be used to obtain the next page of the results. + * If it is null, the next page does not exist. + * The third element contains the raw response received from the API server. Its type is + * [ListFindingsResponse]{@link google.cloud.securitycenter.v1p1beta1.ListFindingsResponse}. + * + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + listFindings( + request: protosTypes.google.cloud.securitycenter.v1p1beta1.IListFindingsRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.IListFindingsResult[], + protosTypes.google.cloud.securitycenter.v1p1beta1.IListFindingsRequest | null, + protosTypes.google.cloud.securitycenter.v1p1beta1.IListFindingsResponse + >, + callback?: Callback< + protosTypes.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.IListFindingsResult[], + protosTypes.google.cloud.securitycenter.v1p1beta1.IListFindingsRequest | null, + protosTypes.google.cloud.securitycenter.v1p1beta1.IListFindingsResponse + > + ): Promise< + [ + protosTypes.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.IListFindingsResult[], + protosTypes.google.cloud.securitycenter.v1p1beta1.IListFindingsRequest | null, + protosTypes.google.cloud.securitycenter.v1p1beta1.IListFindingsResponse + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + return this._innerApiCalls.listFindings(request, options, callback); + } + + /** + * Equivalent to {@link listFindings}, but returns a NodeJS Stream object. + * + * This fetches the paged responses for {@link listFindings} continuously + * and invokes the callback registered for 'data' event for each element in the + * responses. + * + * The returned object has 'end' method when no more elements are required. + * + * autoPaginate option will be ignored. + * + * @see {@link https://nodejs.org/api/stream.html} + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Name of the source the findings belong to. Its format is + * "organizations/[organization_id]/sources/[source_id]". To list across all + * sources provide a source_id of `-`. For example: + * organizations/{organization_id}/sources/- + * @param {string} request.filter + * Expression that defines the filter to apply across findings. + * The expression is a list of one or more restrictions combined via logical + * operators `AND` and `OR`. + * Parentheses are supported, and `OR` has higher precedence than `AND`. + * + * Restrictions have the form ` ` and may have a `-` + * character in front of them to indicate negation. Examples include: + * + * * name + * * source_properties.a_property + * * security_marks.marks.marka + * + * The supported operators are: + * + * * `=` for all value types. + * * `>`, `<`, `>=`, `<=` for integer values. + * * `:`, meaning substring matching, for strings. + * + * The supported value types are: + * + * * string literals in quotes. + * * integer literals without quotes. + * * boolean literals `true` and `false` without quotes. + * + * The following field and operator combinations are supported: + * + * name: `=` + * parent: `=`, `:` + * resource_name: `=`, `:` + * state: `=`, `:` + * category: `=`, `:` + * external_uri: `=`, `:` + * event_time: `=`, `>`, `<`, `>=`, `<=` + * + * Usage: This should be milliseconds since epoch or an RFC3339 string. + * Examples: + * "event_time = \"2019-06-10T16:07:18-07:00\"" + * "event_time = 1560208038000" + * + * security_marks.marks: `=`, `:` + * source_properties: `=`, `:`, `>`, `<`, `>=`, `<=` + * + * For example, `source_properties.size = 100` is a valid filter string. + * @param {string} request.orderBy + * Expression that defines what fields and order to use for sorting. The + * string value should follow SQL syntax: comma separated list of fields. For + * example: "name,resource_properties.a_property". The default sorting order + * is ascending. To specify descending order for a field, a suffix " desc" + * should be appended to the field name. For example: "name + * desc,source_properties.a_property". Redundant space characters in the + * syntax are insignificant. "name desc,source_properties.a_property" and " + * name desc , source_properties.a_property " are equivalent. + * + * The following fields are supported: + * name + * parent + * state + * category + * resource_name + * event_time + * source_properties + * security_marks.marks + * @param {google.protobuf.Timestamp} request.readTime + * Time used as a reference point when filtering findings. The filter is + * limited to findings existing at the supplied time and their values are + * those at that specific time. Absence of this field will default to the + * API's version of NOW. + * @param {google.protobuf.Duration} request.compareDuration + * When compare_duration is set, the ListFindingsResult's "state_change" + * attribute is updated to indicate whether the finding had its state changed, + * the finding's state remained unchanged, or if the finding was added in any + * state during the compare_duration period of time that precedes the + * read_time. This is the time between (read_time - compare_duration) and + * read_time. + * + * The state_change value is derived based on the presence and state of the + * finding at the two points in time. Intermediate state changes between the + * two times don't affect the result. For example, the results aren't affected + * if the finding is made inactive and then active again. + * + * Possible "state_change" values when compare_duration is specified: + * + * * "CHANGED": indicates that the finding was present at the start of + * compare_duration, but changed its state at read_time. + * * "UNCHANGED": indicates that the finding was present at the start of + * compare_duration and did not change state at read_time. + * * "ADDED": indicates that the finding was not present at the start + * of compare_duration, but was present at read_time. + * + * If compare_duration is not specified, then the only possible state_change + * is "UNUSED", which will be the state_change set for all findings present at + * read_time. + * @param {string} request.having + * Filter that specifies what fields to further filter on *after* the query + * filter has been executed. Currently only `finding.state` and `state_change` + * are supported and requires compare_duration to be specified. + * @param {google.protobuf.FieldMask} [request.fieldMask] + * Optional. + * A field mask to specify the Finding fields to be listed in the response. + * An empty field mask will list all fields. + * @param {string} request.pageToken + * The value returned by the last `ListFindingsResponse`; indicates + * that this is a continuation of a prior `ListFindings` call, and + * that the system should return the next page of data. + * @param {number} request.pageSize + * The maximum number of results to return in a single response. Default is + * 10, minimum is 1, maximum is 1000. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [ListFindingsResult]{@link google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult} on 'data' event. + */ + listFindingsStream( + request?: protosTypes.google.cloud.securitycenter.v1p1beta1.IListFindingsRequest, + options?: gax.CallOptions | {} + ): Transform { + request = request || {}; + const callSettings = new gax.CallSettings(options); + return this._descriptors.page.listFindings.createStream( + this._innerApiCalls.listFindings as gax.GaxCall, + request, + callSettings + ); + } + listNotificationConfigs( + request: protosTypes.google.cloud.securitycenter.v1p1beta1.IListNotificationConfigsRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.cloud.securitycenter.v1p1beta1.INotificationConfig[], + protosTypes.google.cloud.securitycenter.v1p1beta1.IListNotificationConfigsRequest | null, + protosTypes.google.cloud.securitycenter.v1p1beta1.IListNotificationConfigsResponse + ] + >; + listNotificationConfigs( + request: protosTypes.google.cloud.securitycenter.v1p1beta1.IListNotificationConfigsRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.cloud.securitycenter.v1p1beta1.INotificationConfig[], + protosTypes.google.cloud.securitycenter.v1p1beta1.IListNotificationConfigsRequest | null, + protosTypes.google.cloud.securitycenter.v1p1beta1.IListNotificationConfigsResponse + > + ): void; + /** + * Lists notification configs. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Name of the organization to list notification configs. + * Its format is "organizations/[organization_id]". + * @param {string} request.pageToken + * The value returned by the last `ListNotificationConfigsResponse`; indicates + * that this is a continuation of a prior `ListNotificationConfigs` call, and + * that the system should return the next page of data. + * @param {number} request.pageSize + * The maximum number of results to return in a single response. Default is + * 10, minimum is 1, maximum is 1000. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [NotificationConfig]{@link google.cloud.securitycenter.v1p1beta1.NotificationConfig}. + * The client library support auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * + * When autoPaginate: false is specified through options, the array has three elements. + * The first element is Array of [NotificationConfig]{@link google.cloud.securitycenter.v1p1beta1.NotificationConfig} that corresponds to + * the one page received from the API server. + * If the second element is not null it contains the request object of type [ListNotificationConfigsRequest]{@link google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest} + * that can be used to obtain the next page of the results. + * If it is null, the next page does not exist. + * The third element contains the raw response received from the API server. Its type is + * [ListNotificationConfigsResponse]{@link google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsResponse}. + * + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + listNotificationConfigs( + request: protosTypes.google.cloud.securitycenter.v1p1beta1.IListNotificationConfigsRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.cloud.securitycenter.v1p1beta1.INotificationConfig[], + protosTypes.google.cloud.securitycenter.v1p1beta1.IListNotificationConfigsRequest | null, + protosTypes.google.cloud.securitycenter.v1p1beta1.IListNotificationConfigsResponse + >, + callback?: Callback< + protosTypes.google.cloud.securitycenter.v1p1beta1.INotificationConfig[], + protosTypes.google.cloud.securitycenter.v1p1beta1.IListNotificationConfigsRequest | null, + protosTypes.google.cloud.securitycenter.v1p1beta1.IListNotificationConfigsResponse + > + ): Promise< + [ + protosTypes.google.cloud.securitycenter.v1p1beta1.INotificationConfig[], + protosTypes.google.cloud.securitycenter.v1p1beta1.IListNotificationConfigsRequest | null, + protosTypes.google.cloud.securitycenter.v1p1beta1.IListNotificationConfigsResponse + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + return this._innerApiCalls.listNotificationConfigs( + request, + options, + callback + ); + } + + /** + * Equivalent to {@link listNotificationConfigs}, but returns a NodeJS Stream object. + * + * This fetches the paged responses for {@link listNotificationConfigs} continuously + * and invokes the callback registered for 'data' event for each element in the + * responses. + * + * The returned object has 'end' method when no more elements are required. + * + * autoPaginate option will be ignored. + * + * @see {@link https://nodejs.org/api/stream.html} + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Name of the organization to list notification configs. + * Its format is "organizations/[organization_id]". + * @param {string} request.pageToken + * The value returned by the last `ListNotificationConfigsResponse`; indicates + * that this is a continuation of a prior `ListNotificationConfigs` call, and + * that the system should return the next page of data. + * @param {number} request.pageSize + * The maximum number of results to return in a single response. Default is + * 10, minimum is 1, maximum is 1000. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [NotificationConfig]{@link google.cloud.securitycenter.v1p1beta1.NotificationConfig} on 'data' event. + */ + listNotificationConfigsStream( + request?: protosTypes.google.cloud.securitycenter.v1p1beta1.IListNotificationConfigsRequest, + options?: gax.CallOptions | {} + ): Transform { + request = request || {}; + const callSettings = new gax.CallSettings(options); + return this._descriptors.page.listNotificationConfigs.createStream( + this._innerApiCalls.listNotificationConfigs as gax.GaxCall, + request, + callSettings + ); + } + listSources( + request: protosTypes.google.cloud.securitycenter.v1p1beta1.IListSourcesRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.cloud.securitycenter.v1p1beta1.ISource[], + protosTypes.google.cloud.securitycenter.v1p1beta1.IListSourcesRequest | null, + protosTypes.google.cloud.securitycenter.v1p1beta1.IListSourcesResponse + ] + >; + listSources( + request: protosTypes.google.cloud.securitycenter.v1p1beta1.IListSourcesRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.cloud.securitycenter.v1p1beta1.ISource[], + protosTypes.google.cloud.securitycenter.v1p1beta1.IListSourcesRequest | null, + protosTypes.google.cloud.securitycenter.v1p1beta1.IListSourcesResponse + > + ): void; + /** + * Lists all sources belonging to an organization. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Resource name of the parent of sources to list. Its format should + * be "organizations/[organization_id]". + * @param {string} request.pageToken + * The value returned by the last `ListSourcesResponse`; indicates + * that this is a continuation of a prior `ListSources` call, and + * that the system should return the next page of data. + * @param {number} request.pageSize + * The maximum number of results to return in a single response. Default is + * 10, minimum is 1, maximum is 1000. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [Source]{@link google.cloud.securitycenter.v1p1beta1.Source}. + * The client library support auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * + * When autoPaginate: false is specified through options, the array has three elements. + * The first element is Array of [Source]{@link google.cloud.securitycenter.v1p1beta1.Source} that corresponds to + * the one page received from the API server. + * If the second element is not null it contains the request object of type [ListSourcesRequest]{@link google.cloud.securitycenter.v1p1beta1.ListSourcesRequest} + * that can be used to obtain the next page of the results. + * If it is null, the next page does not exist. + * The third element contains the raw response received from the API server. Its type is + * [ListSourcesResponse]{@link google.cloud.securitycenter.v1p1beta1.ListSourcesResponse}. + * + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + listSources( + request: protosTypes.google.cloud.securitycenter.v1p1beta1.IListSourcesRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.cloud.securitycenter.v1p1beta1.ISource[], + protosTypes.google.cloud.securitycenter.v1p1beta1.IListSourcesRequest | null, + protosTypes.google.cloud.securitycenter.v1p1beta1.IListSourcesResponse + >, + callback?: Callback< + protosTypes.google.cloud.securitycenter.v1p1beta1.ISource[], + protosTypes.google.cloud.securitycenter.v1p1beta1.IListSourcesRequest | null, + protosTypes.google.cloud.securitycenter.v1p1beta1.IListSourcesResponse + > + ): Promise< + [ + protosTypes.google.cloud.securitycenter.v1p1beta1.ISource[], + protosTypes.google.cloud.securitycenter.v1p1beta1.IListSourcesRequest | null, + protosTypes.google.cloud.securitycenter.v1p1beta1.IListSourcesResponse + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + return this._innerApiCalls.listSources(request, options, callback); + } + + /** + * Equivalent to {@link listSources}, but returns a NodeJS Stream object. + * + * This fetches the paged responses for {@link listSources} continuously + * and invokes the callback registered for 'data' event for each element in the + * responses. + * + * The returned object has 'end' method when no more elements are required. + * + * autoPaginate option will be ignored. + * + * @see {@link https://nodejs.org/api/stream.html} + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Resource name of the parent of sources to list. Its format should + * be "organizations/[organization_id]". + * @param {string} request.pageToken + * The value returned by the last `ListSourcesResponse`; indicates + * that this is a continuation of a prior `ListSources` call, and + * that the system should return the next page of data. + * @param {number} request.pageSize + * The maximum number of results to return in a single response. Default is + * 10, minimum is 1, maximum is 1000. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [Source]{@link google.cloud.securitycenter.v1p1beta1.Source} on 'data' event. + */ + listSourcesStream( + request?: protosTypes.google.cloud.securitycenter.v1p1beta1.IListSourcesRequest, + options?: gax.CallOptions | {} + ): Transform { + request = request || {}; + const callSettings = new gax.CallSettings(options); + return this._descriptors.page.listSources.createStream( + this._innerApiCalls.listSources as gax.GaxCall, + request, + callSettings + ); + } + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified organizationAsset resource name string. + * + * @param {string} organization + * @param {string} asset + * @returns {string} Resource name string. + */ + organizationAssetPath(organization: string, asset: string) { + return this._pathTemplates.organizationAssetPathTemplate.render({ + organization, + asset, + }); + } + + /** + * Parse the organization from OrganizationAsset resource. + * + * @param {string} organizationAssetName + * A fully-qualified path representing organization_asset resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationAssetName(organizationAssetName: string) { + return this._pathTemplates.organizationAssetPathTemplate.match( + organizationAssetName + ).organization; + } + + /** + * Parse the asset from OrganizationAsset resource. + * + * @param {string} organizationAssetName + * A fully-qualified path representing organization_asset resource. + * @returns {string} A string representing the asset. + */ + matchAssetFromOrganizationAssetName(organizationAssetName: string) { + return this._pathTemplates.organizationAssetPathTemplate.match( + organizationAssetName + ).asset; + } + + /** + * Return a fully-qualified organizationSourceFinding resource name string. + * + * @param {string} organization + * @param {string} source + * @param {string} finding + * @returns {string} Resource name string. + */ + organizationSourceFindingPath( + organization: string, + source: string, + finding: string + ) { + return this._pathTemplates.organizationSourceFindingPathTemplate.render({ + organization, + source, + finding, + }); + } + + /** + * Parse the organization from OrganizationSourceFinding resource. + * + * @param {string} organizationSourceFindingName + * A fully-qualified path representing organization_source_finding resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationSourceFindingName( + organizationSourceFindingName: string + ) { + return this._pathTemplates.organizationSourceFindingPathTemplate.match( + organizationSourceFindingName + ).organization; + } + + /** + * Parse the source from OrganizationSourceFinding resource. + * + * @param {string} organizationSourceFindingName + * A fully-qualified path representing organization_source_finding resource. + * @returns {string} A string representing the source. + */ + matchSourceFromOrganizationSourceFindingName( + organizationSourceFindingName: string + ) { + return this._pathTemplates.organizationSourceFindingPathTemplate.match( + organizationSourceFindingName + ).source; + } + + /** + * Parse the finding from OrganizationSourceFinding resource. + * + * @param {string} organizationSourceFindingName + * A fully-qualified path representing organization_source_finding resource. + * @returns {string} A string representing the finding. + */ + matchFindingFromOrganizationSourceFindingName( + organizationSourceFindingName: string + ) { + return this._pathTemplates.organizationSourceFindingPathTemplate.match( + organizationSourceFindingName + ).finding; + } + + /** + * Return a fully-qualified asset resource name string. + * + * @param {string} organization + * @param {string} asset + * @returns {string} Resource name string. + */ + assetPath(organization: string, asset: string) { + return this._pathTemplates.assetPathTemplate.render({ + organization, + asset, + }); + } + + /** + * Parse the organization from Asset resource. + * + * @param {string} assetName + * A fully-qualified path representing Asset resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromAssetName(assetName: string) { + return this._pathTemplates.assetPathTemplate.match(assetName).organization; + } + + /** + * Parse the asset from Asset resource. + * + * @param {string} assetName + * A fully-qualified path representing Asset resource. + * @returns {string} A string representing the asset. + */ + matchAssetFromAssetName(assetName: string) { + return this._pathTemplates.assetPathTemplate.match(assetName).asset; + } + + /** + * Return a fully-qualified finding resource name string. + * + * @param {string} organization + * @param {string} source + * @param {string} finding + * @returns {string} Resource name string. + */ + findingPath(organization: string, source: string, finding: string) { + return this._pathTemplates.findingPathTemplate.render({ + organization, + source, + finding, + }); + } + + /** + * Parse the organization from Finding resource. + * + * @param {string} findingName + * A fully-qualified path representing Finding resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromFindingName(findingName: string) { + return this._pathTemplates.findingPathTemplate.match(findingName) + .organization; + } + + /** + * Parse the source from Finding resource. + * + * @param {string} findingName + * A fully-qualified path representing Finding resource. + * @returns {string} A string representing the source. + */ + matchSourceFromFindingName(findingName: string) { + return this._pathTemplates.findingPathTemplate.match(findingName).source; + } + + /** + * Parse the finding from Finding resource. + * + * @param {string} findingName + * A fully-qualified path representing Finding resource. + * @returns {string} A string representing the finding. + */ + matchFindingFromFindingName(findingName: string) { + return this._pathTemplates.findingPathTemplate.match(findingName).finding; + } + + /** + * Return a fully-qualified source resource name string. + * + * @param {string} organization + * @param {string} source + * @returns {string} Resource name string. + */ + sourcePath(organization: string, source: string) { + return this._pathTemplates.sourcePathTemplate.render({ + organization, + source, + }); + } + + /** + * Parse the organization from Source resource. + * + * @param {string} sourceName + * A fully-qualified path representing Source resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromSourceName(sourceName: string) { + return this._pathTemplates.sourcePathTemplate.match(sourceName) + .organization; + } + + /** + * Parse the source from Source resource. + * + * @param {string} sourceName + * A fully-qualified path representing Source resource. + * @returns {string} A string representing the source. + */ + matchSourceFromSourceName(sourceName: string) { + return this._pathTemplates.sourcePathTemplate.match(sourceName).source; + } + + /** + * Return a fully-qualified notificationConfig resource name string. + * + * @param {string} organization + * @param {string} notification_config + * @returns {string} Resource name string. + */ + notificationConfigPath(organization: string, notificationConfig: string) { + return this._pathTemplates.notificationConfigPathTemplate.render({ + organization, + notification_config: notificationConfig, + }); + } + + /** + * Parse the organization from NotificationConfig resource. + * + * @param {string} notificationConfigName + * A fully-qualified path representing NotificationConfig resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromNotificationConfigName(notificationConfigName: string) { + return this._pathTemplates.notificationConfigPathTemplate.match( + notificationConfigName + ).organization; + } + + /** + * Parse the notification_config from NotificationConfig resource. + * + * @param {string} notificationConfigName + * A fully-qualified path representing NotificationConfig resource. + * @returns {string} A string representing the notification_config. + */ + matchNotificationConfigFromNotificationConfigName( + notificationConfigName: string + ) { + return this._pathTemplates.notificationConfigPathTemplate.match( + notificationConfigName + ).notification_config; + } + + /** + * Return a fully-qualified organizationSettings resource name string. + * + * @param {string} organization + * @returns {string} Resource name string. + */ + organizationSettingsPath(organization: string) { + return this._pathTemplates.organizationSettingsPathTemplate.render({ + organization, + }); + } + + /** + * Parse the organization from OrganizationSettings resource. + * + * @param {string} organizationSettingsName + * A fully-qualified path representing OrganizationSettings resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationSettingsName( + organizationSettingsName: string + ) { + return this._pathTemplates.organizationSettingsPathTemplate.match( + organizationSettingsName + ).organization; + } + + /** + * Return a fully-qualified organization resource name string. + * + * @param {string} organization + * @returns {string} Resource name string. + */ + organizationPath(organization: string) { + return this._pathTemplates.organizationPathTemplate.render({ + organization, + }); + } + + /** + * Parse the organization from Organization resource. + * + * @param {string} organizationName + * A fully-qualified path representing Organization resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationName(organizationName: string) { + return this._pathTemplates.organizationPathTemplate.match(organizationName) + .organization; + } + + /** + * Terminate the GRPC channel and close the client. + * + * The client will no longer be usable and all future behavior is undefined. + */ + close(): Promise { + if (!this._terminated) { + return this.securityCenterStub.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-cloud-securitycenter/src/v1p1beta1/security_center_client_config.json b/packages/google-cloud-securitycenter/src/v1p1beta1/security_center_client_config.json new file mode 100644 index 00000000000..3d47939eb43 --- /dev/null +++ b/packages/google-cloud-securitycenter/src/v1p1beta1/security_center_client_config.json @@ -0,0 +1,141 @@ +{ + "interfaces": { + "google.cloud.securitycenter.v1p1beta1.SecurityCenter": { + "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": { + "CreateSource": { + "timeout_millis": 600000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateFinding": { + "timeout_millis": 600000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateNotificationConfig": { + "timeout_millis": 600000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteNotificationConfig": { + "timeout_millis": 600000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetIamPolicy": { + "timeout_millis": 600000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "GetNotificationConfig": { + "timeout_millis": 600000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "GetOrganizationSettings": { + "timeout_millis": 600000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "GetSource": { + "timeout_millis": 600000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "GroupAssets": { + "timeout_millis": 600000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "GroupFindings": { + "timeout_millis": 600000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "ListAssets": { + "timeout_millis": 600000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "ListFindings": { + "timeout_millis": 600000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "ListNotificationConfigs": { + "timeout_millis": 600000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "ListSources": { + "timeout_millis": 600000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "RunAssetDiscovery": { + "timeout_millis": 600000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "SetFindingState": { + "timeout_millis": 600000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "SetIamPolicy": { + "timeout_millis": 600000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "TestIamPermissions": { + "timeout_millis": 600000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "UpdateFinding": { + "timeout_millis": 600000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateNotificationConfig": { + "timeout_millis": 600000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateOrganizationSettings": { + "timeout_millis": 600000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateSource": { + "timeout_millis": 600000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateSecurityMarks": { + "timeout_millis": 600000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-cloud-securitycenter/src/v1p1beta1/security_center_proto_list.json b/packages/google-cloud-securitycenter/src/v1p1beta1/security_center_proto_list.json new file mode 100644 index 00000000000..37f5aab1515 --- /dev/null +++ b/packages/google-cloud-securitycenter/src/v1p1beta1/security_center_proto_list.json @@ -0,0 +1,11 @@ +[ + "../../protos/google/cloud/securitycenter/v1p1beta1/asset.proto", + "../../protos/google/cloud/securitycenter/v1p1beta1/finding.proto", + "../../protos/google/cloud/securitycenter/v1p1beta1/notification_config.proto", + "../../protos/google/cloud/securitycenter/v1p1beta1/notification_message.proto", + "../../protos/google/cloud/securitycenter/v1p1beta1/organization_settings.proto", + "../../protos/google/cloud/securitycenter/v1p1beta1/run_asset_discovery_response.proto", + "../../protos/google/cloud/securitycenter/v1p1beta1/security_marks.proto", + "../../protos/google/cloud/securitycenter/v1p1beta1/securitycenter_service.proto", + "../../protos/google/cloud/securitycenter/v1p1beta1/source.proto" +] diff --git a/packages/google-cloud-securitycenter/synth.metadata b/packages/google-cloud-securitycenter/synth.metadata index 14d21c73ad6..907828fe4bb 100644 --- a/packages/google-cloud-securitycenter/synth.metadata +++ b/packages/google-cloud-securitycenter/synth.metadata @@ -1,20 +1,12 @@ { - "updateTime": "2020-01-28T12:33:45.801692Z", + "updateTime": "2020-02-05T17:41:36.417979Z", "sources": [ - { - "generator": { - "name": "artman", - "version": "0.44.3", - "dockerImage": "googleapis/artman@sha256:62b8b29acaae54b06a4183aa772e65b106e92d4bc466eb4db07953ab78bdb90c" - } - }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "8e981acfd9b97ea2f312f11bbaa7b6c16e412dea", - "internalRef": "291821782", - "log": "8e981acfd9b97ea2f312f11bbaa7b6c16e412dea\nBeta launch for PersonDetection and FaceDetection features.\n\nPiperOrigin-RevId: 291821782\n\n994e067fae3b21e195f7da932b08fff806d70b5d\nasset: add annotations to v1p2beta1\n\nPiperOrigin-RevId: 291815259\n\n244e1d2c89346ca2e0701b39e65552330d68545a\nAdd Playable Locations service\n\nPiperOrigin-RevId: 291806349\n\n909f8f67963daf45dd88d020877fb9029b76788d\nasset: add annotations to v1beta2\n\nPiperOrigin-RevId: 291805301\n\n3c39a1d6e23c1ef63c7fba4019c25e76c40dfe19\nKMS: add file-level message for CryptoKeyPath, it is defined in gapic yaml but not\nin proto files.\n\nPiperOrigin-RevId: 291420695\n\nc6f3f350b8387f8d1b85ed4506f30187ebaaddc3\ncontaineranalysis: update v1beta1 and bazel build with annotations\n\nPiperOrigin-RevId: 291401900\n\n92887d74b44e4e636252b7b8477d0d2570cd82db\nfix: fix the location of grpc config file.\n\nPiperOrigin-RevId: 291396015\n\n" + "sha": "a8ed9d921fdddc61d8467bfd7c1668f0ad90435c", + "internalRef": "293257997" } }, { @@ -31,9 +23,8 @@ "source": "googleapis", "apiName": "securitycenter", "apiVersion": "v1beta1", - "language": "nodejs", - "generator": "gapic", - "config": "google/cloud/securitycenter/artman_securitycenter_v1beta1.yaml" + "language": "typescript", + "generator": "gapic-generator-typescript" } }, { @@ -41,510 +32,18 @@ "source": "googleapis", "apiName": "securitycenter", "apiVersion": "v1", - "language": "nodejs", - "generator": "gapic", - "config": "google/cloud/securitycenter/artman_securitycenter_v1.yaml" + "language": "typescript", + "generator": "gapic-generator-typescript" } - } - ], - "newFiles": [ - { - "path": ".eslintignore" - }, - { - "path": ".eslintrc.yml" - }, - { - "path": ".github/ISSUE_TEMPLATE.md" - }, - { - "path": ".github/ISSUE_TEMPLATE/bug_report.md" - }, - { - "path": ".github/ISSUE_TEMPLATE/feature_request.md" - }, - { - "path": ".github/ISSUE_TEMPLATE/support_request.md" - }, - { - "path": ".github/PULL_REQUEST_TEMPLATE.md" - }, - { - "path": ".github/release-please.yml" - }, - { - "path": ".gitignore" - }, - { - "path": ".jsdoc.js" - }, - { - "path": ".kokoro/.gitattributes" - }, - { - "path": ".kokoro/common.cfg" - }, - { - "path": ".kokoro/continuous/node10/common.cfg" - }, - { - "path": ".kokoro/continuous/node10/docs.cfg" - }, - { - "path": ".kokoro/continuous/node10/lint.cfg" - }, - { - "path": ".kokoro/continuous/node10/samples-test.cfg" - }, - { - "path": ".kokoro/continuous/node10/system-test.cfg" - }, - { - "path": ".kokoro/continuous/node10/test.cfg" - }, - { - "path": ".kokoro/continuous/node12/common.cfg" - }, - { - "path": ".kokoro/continuous/node12/test.cfg" - }, - { - "path": ".kokoro/continuous/node8/common.cfg" - }, - { - "path": ".kokoro/continuous/node8/test.cfg" - }, - { - "path": ".kokoro/docs.sh" - }, - { - "path": ".kokoro/lint.sh" - }, - { - "path": ".kokoro/presubmit/node10/common.cfg" - }, - { - "path": ".kokoro/presubmit/node10/docs.cfg" - }, - { - "path": ".kokoro/presubmit/node10/lint.cfg" - }, - { - "path": ".kokoro/presubmit/node10/samples-test.cfg" - }, - { - "path": ".kokoro/presubmit/node10/system-test.cfg" - }, - { - "path": ".kokoro/presubmit/node10/test.cfg" - }, - { - "path": ".kokoro/presubmit/node12/common.cfg" - }, - { - "path": ".kokoro/presubmit/node12/test.cfg" - }, - { - "path": ".kokoro/presubmit/node8/common.cfg" - }, - { - "path": ".kokoro/presubmit/node8/test.cfg" - }, - { - "path": ".kokoro/presubmit/windows/common.cfg" - }, - { - "path": ".kokoro/presubmit/windows/test.cfg" - }, - { - "path": ".kokoro/publish.sh" - }, - { - "path": ".kokoro/release/common.cfg" - }, - { - "path": ".kokoro/release/docs.cfg" - }, - { - "path": ".kokoro/release/docs.sh" - }, - { - "path": ".kokoro/release/publish.cfg" - }, - { - "path": ".kokoro/samples-test.sh" - }, - { - "path": ".kokoro/system-test.sh" - }, - { - "path": ".kokoro/test.bat" - }, - { - "path": ".kokoro/test.sh" - }, - { - "path": ".kokoro/trampoline.sh" - }, - { - "path": ".nycrc" - }, - { - "path": ".prettierignore" - }, - { - "path": ".prettierrc" - }, - { - "path": ".readme-partials.yaml" - }, - { - "path": ".repo-metadata.json" - }, - { - "path": "CHANGELOG.md" - }, - { - "path": "CODE_OF_CONDUCT.md" - }, - { - "path": "CONTRIBUTING.md" - }, - { - "path": "LICENSE" - }, - { - "path": "README.md" - }, - { - "path": "codecov.yaml" - }, - { - "path": "linkinator.config.json" - }, - { - "path": "package.json" - }, - { - "path": "protos/google/cloud/securitycenter/v1/asset.proto" - }, - { - "path": "protos/google/cloud/securitycenter/v1/finding.proto" - }, - { - "path": "protos/google/cloud/securitycenter/v1/organization_settings.proto" - }, - { - "path": "protos/google/cloud/securitycenter/v1/run_asset_discovery_response.proto" - }, - { - "path": "protos/google/cloud/securitycenter/v1/security_marks.proto" - }, - { - "path": "protos/google/cloud/securitycenter/v1/securitycenter_service.proto" - }, - { - "path": "protos/google/cloud/securitycenter/v1/source.proto" - }, - { - "path": "protos/google/cloud/securitycenter/v1beta1/asset.proto" - }, - { - "path": "protos/google/cloud/securitycenter/v1beta1/finding.proto" - }, - { - "path": "protos/google/cloud/securitycenter/v1beta1/organization_settings.proto" - }, - { - "path": "protos/google/cloud/securitycenter/v1beta1/run_asset_discovery_response.proto" - }, - { - "path": "protos/google/cloud/securitycenter/v1beta1/security_marks.proto" - }, - { - "path": "protos/google/cloud/securitycenter/v1beta1/securitycenter_service.proto" - }, - { - "path": "protos/google/cloud/securitycenter/v1beta1/source.proto" - }, - { - "path": "protos/protos.d.ts" - }, - { - "path": "protos/protos.js" - }, - { - "path": "protos/protos.json" - }, - { - "path": "renovate.json" - }, - { - "path": "samples/.eslintrc.yml" - }, - { - "path": "samples/README.md" - }, - { - "path": "samples/package.json" - }, - { - "path": "samples/quickstart.js" - }, - { - "path": "samples/system-test/quickstart.test.js" - }, - { - "path": "samples/system-test/v1/assetSecurityMarks.test.js" - }, - { - "path": "samples/system-test/v1/findings.test.js" - }, - { - "path": "samples/system-test/v1/listAllAssets.test.js" - }, - { - "path": "samples/system-test/v1/listAssetsAndChanges.test.js" - }, - { - "path": "samples/system-test/v1/listAssetsAtTime.test.js" - }, - { - "path": "samples/system-test/v1/listFilteredAssets.test.js" - }, - { - "path": "samples/system-test/v1/orgSettings.test.js" - }, - { - "path": "samples/v1/addDeleteSecurityMarks.js" - }, - { - "path": "samples/v1/addFindingSecurityMarks.js" - }, - { - "path": "samples/v1/addSecurityMarks.js" - }, - { - "path": "samples/v1/createFinding.js" - }, - { - "path": "samples/v1/createFindingSourceProperties.js" - }, - { - "path": "samples/v1/createSource.js" - }, - { - "path": "samples/v1/deleteSecurityMarks.js" - }, - { - "path": "samples/v1/enableAssetDiscovery.js" - }, - { - "path": "samples/v1/getOrganizationSettings.js" - }, - { - "path": "samples/v1/getSource.js" - }, - { - "path": "samples/v1/getSourceIam.js" - }, - { - "path": "samples/v1/listAllAssets.js" - }, - { - "path": "samples/v1/listAllFindings.js" - }, - { - "path": "samples/v1/listAllSources.js" - }, - { - "path": "samples/v1/listAssetsAndChanges.js" - }, - { - "path": "samples/v1/listAssetsAtTime.js" - }, - { - "path": "samples/v1/listAssetsWithSecurityMarks.js" - }, - { - "path": "samples/v1/listFilteredAssets.js" - }, - { - "path": "samples/v1/listFilteredFindings.js" - }, - { - "path": "samples/v1/listFindingsAtTime.js" - }, - { - "path": "samples/v1/listFindingsWithSecurityMarks.js" - }, - { - "path": "samples/v1/setFindingState.js" - }, - { - "path": "samples/v1/setSourceIam.js" - }, - { - "path": "samples/v1/testIam.js" - }, - { - "path": "samples/v1/updateFindingSourceProperties.js" - }, - { - "path": "samples/v1/updateSource.js" - }, - { - "path": "src/browser.js" - }, - { - "path": "src/extra_proto_list.json" - }, - { - "path": "src/index.js" - }, - { - "path": "src/v1/doc/google/cloud/securitycenter/v1/doc_asset.js" - }, - { - "path": "src/v1/doc/google/cloud/securitycenter/v1/doc_finding.js" - }, - { - "path": "src/v1/doc/google/cloud/securitycenter/v1/doc_organization_settings.js" - }, - { - "path": "src/v1/doc/google/cloud/securitycenter/v1/doc_security_marks.js" - }, - { - "path": "src/v1/doc/google/cloud/securitycenter/v1/doc_securitycenter_service.js" - }, - { - "path": "src/v1/doc/google/cloud/securitycenter/v1/doc_source.js" - }, - { - "path": "src/v1/doc/google/iam/v1/doc_iam_policy.js" }, { - "path": "src/v1/doc/google/iam/v1/doc_options.js" - }, - { - "path": "src/v1/doc/google/iam/v1/doc_policy.js" - }, - { - "path": "src/v1/doc/google/longrunning/doc_operations.js" - }, - { - "path": "src/v1/doc/google/protobuf/doc_any.js" - }, - { - "path": "src/v1/doc/google/protobuf/doc_duration.js" - }, - { - "path": "src/v1/doc/google/protobuf/doc_field_mask.js" - }, - { - "path": "src/v1/doc/google/protobuf/doc_struct.js" - }, - { - "path": "src/v1/doc/google/protobuf/doc_timestamp.js" - }, - { - "path": "src/v1/doc/google/rpc/doc_status.js" - }, - { - "path": "src/v1/doc/google/type/doc_expr.js" - }, - { - "path": "src/v1/index.js" - }, - { - "path": "src/v1/security_center_client.js" - }, - { - "path": "src/v1/security_center_client_config.json" - }, - { - "path": "src/v1/security_center_proto_list.json" - }, - { - "path": "src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_asset.js" - }, - { - "path": "src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_finding.js" - }, - { - "path": "src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_organization_settings.js" - }, - { - "path": "src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_security_marks.js" - }, - { - "path": "src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_securitycenter_service.js" - }, - { - "path": "src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_source.js" - }, - { - "path": "src/v1beta1/doc/google/iam/v1/doc_iam_policy.js" - }, - { - "path": "src/v1beta1/doc/google/iam/v1/doc_options.js" - }, - { - "path": "src/v1beta1/doc/google/iam/v1/doc_policy.js" - }, - { - "path": "src/v1beta1/doc/google/longrunning/doc_operations.js" - }, - { - "path": "src/v1beta1/doc/google/protobuf/doc_any.js" - }, - { - "path": "src/v1beta1/doc/google/protobuf/doc_duration.js" - }, - { - "path": "src/v1beta1/doc/google/protobuf/doc_field_mask.js" - }, - { - "path": "src/v1beta1/doc/google/protobuf/doc_struct.js" - }, - { - "path": "src/v1beta1/doc/google/protobuf/doc_timestamp.js" - }, - { - "path": "src/v1beta1/doc/google/rpc/doc_status.js" - }, - { - "path": "src/v1beta1/doc/google/type/doc_expr.js" - }, - { - "path": "src/v1beta1/index.js" - }, - { - "path": "src/v1beta1/security_center_client.js" - }, - { - "path": "src/v1beta1/security_center_client_config.json" - }, - { - "path": "src/v1beta1/security_center_proto_list.json" - }, - { - "path": "synth.metadata" - }, - { - "path": "synth.py" - }, - { - "path": "system-test/system.js" - }, - { - "path": "test/gapic-v1.js" - }, - { - "path": "test/mocha.opts" - }, - { - "path": "webpack.config.js" + "client": { + "source": "googleapis", + "apiName": "securitycenter", + "apiVersion": "v1p1beta1", + "language": "typescript", + "generator": "gapic-generator-typescript" + } } ] } \ No newline at end of file diff --git a/packages/google-cloud-securitycenter/synth.py b/packages/google-cloud-securitycenter/synth.py index ffcd43df6b0..46260b1afc4 100644 --- a/packages/google-cloud-securitycenter/synth.py +++ b/packages/google-cloud-securitycenter/synth.py @@ -20,65 +20,29 @@ logging.basicConfig(level=logging.DEBUG) # Run the gapic generator -gapic = gcp.GAPICGenerator() -versions = ['v1beta1', 'v1'] +gapic = gcp.GAPICMicrogenerator() +versions = ['v1beta1', 'v1', 'v1p1beta1'] +name = 'securitycenter' for version in versions: - library = gapic.node_library('securitycenter', version) - s.copy(library, excludes=['README.md', 'package.json', 'test/gapic-v1beta1.js']) + library = gapic.typescript_library( + name, + proto_path=f'google/cloud/{name}/{version}', + generator_args={ + 'grpc-service-config': f'google/cloud/{name}/{version}/{name}_grpc_service_config.json', + 'package-name': f'@google-cloud/security-center', + }, + extra_proto_files=['google/cloud/common_resources.proto'], + version=version) + # skip index, protos, package.json, and README.md + s.copy( + library, + excludes=['package.json', 'src/index.ts', 'README.md'] + ) # Copy common templates common_templates = gcp.CommonTemplates() -templates = common_templates.node_library() -s.copy(templates, excludes=['.kokoro/samples-test.sh']) - -s.replace('src/v1*/doc/google/cloud/securitycenter/v1*/doc_source.js', - r"\[\\p\{L\}\\p\{N\}\]\(https:\/\/cloud\.google\.com\{\\p\{L\}\\p\{N\}_- \]\{0\,30\}\[\\p\{L\}\\p\{N\}\]\)\?", - r"`\[\p{L}\p{N}]({\p{L}\p{N}_- ]{0,30}[\p{L}\p{N}])?`") - -# cleanup some hiccups in jsdoc comments. -s.replace("src/index.js", -r"""\/\*\* - \* @namespace google - \*/""", -r""" -/** - * @namespace google - */ -/** - * @namespace google.type - */ -/** - * @namespace google.longrunning - */ -/** - * @namespace google.protobuf - */ -/** - * @namespace google.type - */ -/** - * @namespace google.rpc - */ -/** - * @namespace google.cloud.securitycenter.v1 - */ -/** - * @namespace google.cloud.securitycenter.v1beta1 - */ -/** - * @namespace google.iam.v1 - */ -""") - -# [START fix-dead-link] -s.replace('**/doc/google/protobuf/doc_timestamp.js', - 'https:\/\/cloud\.google\.com[\s\*]*http:\/\/(.*)[\s\*]*\)', - r"https://\1)") - -s.replace('**/doc/google/protobuf/doc_timestamp.js', - 'toISOString\]', - 'toISOString)') -# [END fix-dead-link] +templates = common_templates.node_library(source_location='build/src') +s.copy(templates, excludes=['.kokoro/samples-test.sh', '.kokoro/samples-test.sh']) # Node.js specific cleanup subprocess.run(['npm', 'install']) diff --git a/packages/google-cloud-securitycenter/system-test/fixtures/sample/src/index.js b/packages/google-cloud-securitycenter/system-test/fixtures/sample/src/index.js new file mode 100644 index 00000000000..ee34dad4972 --- /dev/null +++ b/packages/google-cloud-securitycenter/system-test/fixtures/sample/src/index.js @@ -0,0 +1,26 @@ +// Copyright 2019 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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 securitycenter = require('@google-cloud/security-center'); + +function main() { + const securityCenterClient = new securitycenter.SecurityCenterClient(); +} + +main(); diff --git a/packages/google-cloud-securitycenter/src/v1/index.js b/packages/google-cloud-securitycenter/system-test/fixtures/sample/src/index.ts similarity index 59% rename from packages/google-cloud-securitycenter/src/v1/index.js rename to packages/google-cloud-securitycenter/system-test/fixtures/sample/src/index.ts index 7624ae3951c..dd8b957e174 100644 --- a/packages/google-cloud-securitycenter/src/v1/index.js +++ b/packages/google-cloud-securitycenter/system-test/fixtures/sample/src/index.ts @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// Copyright 2019 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -11,9 +11,15 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** -'use strict'; +import {SecurityCenterClient} from '@google-cloud/security-center'; -const SecurityCenterClient = require('./security_center_client'); +function main() { + const securityCenterClient = new SecurityCenterClient(); +} -module.exports.SecurityCenterClient = SecurityCenterClient; +main(); diff --git a/packages/google-cloud-securitycenter/system-test/install.ts b/packages/google-cloud-securitycenter/system-test/install.ts new file mode 100644 index 00000000000..c9aa74ec221 --- /dev/null +++ b/packages/google-cloud-securitycenter/system-test/install.ts @@ -0,0 +1,51 @@ +// Copyright 2019 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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('typescript consumer tests', () => { + it('should have correct type signature for typescript users', async function() { + this.timeout(300000); + const options = { + packageDir: process.cwd(), // path to your module. + sample: { + description: 'typescript based user can use the type definitions', + ts: readFileSync( + './system-test/fixtures/sample/src/index.ts' + ).toString(), + }, + }; + await packNTest(options); // will throw upon error. + }); + + it('should have correct type signature for javascript users', async function() { + this.timeout(300000); + const options = { + packageDir: process.cwd(), // path to your module. + sample: { + description: 'typescript based user can use the type definitions', + ts: readFileSync( + './system-test/fixtures/sample/src/index.js' + ).toString(), + }, + }; + await packNTest(options); // will throw upon error. + }); +}); diff --git a/packages/google-cloud-securitycenter/test/gapic-security_center-v1.ts b/packages/google-cloud-securitycenter/test/gapic-security_center-v1.ts new file mode 100644 index 00000000000..d6c338fde1e --- /dev/null +++ b/packages/google-cloud-securitycenter/test/gapic-security_center-v1.ts @@ -0,0 +1,1055 @@ +// Copyright 2019 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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 protosTypes from '../protos/protos'; +import * as assert from 'assert'; +import {describe, it} from 'mocha'; +const securitycenterModule = require('../src'); + +const FAKE_STATUS_CODE = 1; +class FakeError { + name: string; + message: string; + code: number; + constructor(n: number) { + this.name = 'fakeName'; + this.message = 'fake message'; + this.code = n; + } +} +const error = new FakeError(FAKE_STATUS_CODE); +export interface Callback { + (err: FakeError | null, response?: {} | null): void; +} + +export class Operation { + constructor() {} + promise() {} +} +function mockSimpleGrpcMethod( + expectedRequest: {}, + response: {} | null, + error: FakeError | null +) { + return (actualRequest: {}, options: {}, callback: Callback) => { + assert.deepStrictEqual(actualRequest, expectedRequest); + if (error) { + callback(error); + } else if (response) { + callback(null, response); + } else { + callback(null); + } + }; +} +function mockLongRunningGrpcMethod( + expectedRequest: {}, + response: {} | null, + error?: {} | null +) { + return (request: {}) => { + assert.deepStrictEqual(request, expectedRequest); + const mockOperation = { + promise() { + return new Promise((resolve, reject) => { + if (error) { + reject(error); + } else { + resolve([response]); + } + }); + }, + }; + return Promise.resolve([mockOperation]); + }; +} +describe('v1.SecurityCenterClient', () => { + it('has servicePath', () => { + const servicePath = + securitycenterModule.v1.SecurityCenterClient.servicePath; + assert(servicePath); + }); + it('has apiEndpoint', () => { + const apiEndpoint = + securitycenterModule.v1.SecurityCenterClient.apiEndpoint; + assert(apiEndpoint); + }); + it('has port', () => { + const port = securitycenterModule.v1.SecurityCenterClient.port; + assert(port); + assert(typeof port === 'number'); + }); + it('should create a client with no option', () => { + const client = new securitycenterModule.v1.SecurityCenterClient(); + assert(client); + }); + it('should create a client with gRPC fallback', () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + fallback: true, + }); + assert(client); + }); + describe('createSource', () => { + it('invokes createSource without error', done => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.cloud.securitycenter.v1.ICreateSourceRequest = {}; + request.parent = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.createSource = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.createSource(request, (err: {}, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes createSource with error', done => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.cloud.securitycenter.v1.ICreateSourceRequest = {}; + request.parent = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.createSource = mockSimpleGrpcMethod( + request, + null, + error + ); + client.createSource(request, (err: FakeError, response: {}) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + describe('createFinding', () => { + it('invokes createFinding without error', done => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.cloud.securitycenter.v1.ICreateFindingRequest = {}; + request.parent = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.createFinding = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.createFinding(request, (err: {}, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes createFinding with error', done => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.cloud.securitycenter.v1.ICreateFindingRequest = {}; + request.parent = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.createFinding = mockSimpleGrpcMethod( + request, + null, + error + ); + client.createFinding(request, (err: FakeError, response: {}) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + describe('getIamPolicy', () => { + it('invokes getIamPolicy without error', done => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.iam.v1.IGetIamPolicyRequest = {}; + request.resource = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.getIamPolicy = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.getIamPolicy(request, (err: {}, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes getIamPolicy with error', done => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.iam.v1.IGetIamPolicyRequest = {}; + request.resource = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.getIamPolicy = mockSimpleGrpcMethod( + request, + null, + error + ); + client.getIamPolicy(request, (err: FakeError, response: {}) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + describe('getOrganizationSettings', () => { + it('invokes getOrganizationSettings without error', done => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.cloud.securitycenter.v1.IGetOrganizationSettingsRequest = {}; + request.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.getOrganizationSettings = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.getOrganizationSettings(request, (err: {}, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes getOrganizationSettings with error', done => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.cloud.securitycenter.v1.IGetOrganizationSettingsRequest = {}; + request.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.getOrganizationSettings = mockSimpleGrpcMethod( + request, + null, + error + ); + client.getOrganizationSettings( + request, + (err: FakeError, response: {}) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + } + ); + }); + }); + describe('getSource', () => { + it('invokes getSource without error', done => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.cloud.securitycenter.v1.IGetSourceRequest = {}; + request.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.getSource = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.getSource(request, (err: {}, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes getSource with error', done => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.cloud.securitycenter.v1.IGetSourceRequest = {}; + request.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.getSource = mockSimpleGrpcMethod( + request, + null, + error + ); + client.getSource(request, (err: FakeError, response: {}) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + describe('setFindingState', () => { + it('invokes setFindingState without error', done => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.cloud.securitycenter.v1.ISetFindingStateRequest = {}; + request.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.setFindingState = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.setFindingState(request, (err: {}, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes setFindingState with error', done => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.cloud.securitycenter.v1.ISetFindingStateRequest = {}; + request.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.setFindingState = mockSimpleGrpcMethod( + request, + null, + error + ); + client.setFindingState(request, (err: FakeError, response: {}) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + describe('setIamPolicy', () => { + it('invokes setIamPolicy without error', done => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.iam.v1.ISetIamPolicyRequest = {}; + request.resource = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.setIamPolicy = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.setIamPolicy(request, (err: {}, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes setIamPolicy with error', done => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.iam.v1.ISetIamPolicyRequest = {}; + request.resource = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.setIamPolicy = mockSimpleGrpcMethod( + request, + null, + error + ); + client.setIamPolicy(request, (err: FakeError, response: {}) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + describe('testIamPermissions', () => { + it('invokes testIamPermissions without error', done => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.iam.v1.ITestIamPermissionsRequest = {}; + request.resource = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.testIamPermissions = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.testIamPermissions(request, (err: {}, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes testIamPermissions with error', done => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.iam.v1.ITestIamPermissionsRequest = {}; + request.resource = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.testIamPermissions = mockSimpleGrpcMethod( + request, + null, + error + ); + client.testIamPermissions(request, (err: FakeError, response: {}) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + describe('updateFinding', () => { + it('invokes updateFinding without error', done => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.cloud.securitycenter.v1.IUpdateFindingRequest = {}; + request.finding = {}; + request.finding.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.updateFinding = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.updateFinding(request, (err: {}, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes updateFinding with error', done => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.cloud.securitycenter.v1.IUpdateFindingRequest = {}; + request.finding = {}; + request.finding.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.updateFinding = mockSimpleGrpcMethod( + request, + null, + error + ); + client.updateFinding(request, (err: FakeError, response: {}) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + describe('updateOrganizationSettings', () => { + it('invokes updateOrganizationSettings without error', done => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.cloud.securitycenter.v1.IUpdateOrganizationSettingsRequest = {}; + request.organizationSettings = {}; + request.organizationSettings.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.updateOrganizationSettings = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.updateOrganizationSettings(request, (err: {}, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes updateOrganizationSettings with error', done => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.cloud.securitycenter.v1.IUpdateOrganizationSettingsRequest = {}; + request.organizationSettings = {}; + request.organizationSettings.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.updateOrganizationSettings = mockSimpleGrpcMethod( + request, + null, + error + ); + client.updateOrganizationSettings( + request, + (err: FakeError, response: {}) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + } + ); + }); + }); + describe('updateSource', () => { + it('invokes updateSource without error', done => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.cloud.securitycenter.v1.IUpdateSourceRequest = {}; + request.source = {}; + request.source.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.updateSource = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.updateSource(request, (err: {}, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes updateSource with error', done => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.cloud.securitycenter.v1.IUpdateSourceRequest = {}; + request.source = {}; + request.source.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.updateSource = mockSimpleGrpcMethod( + request, + null, + error + ); + client.updateSource(request, (err: FakeError, response: {}) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + describe('updateSecurityMarks', () => { + it('invokes updateSecurityMarks without error', done => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.cloud.securitycenter.v1.IUpdateSecurityMarksRequest = {}; + request.securityMarks = {}; + request.securityMarks.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.updateSecurityMarks = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.updateSecurityMarks(request, (err: {}, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes updateSecurityMarks with error', done => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.cloud.securitycenter.v1.IUpdateSecurityMarksRequest = {}; + request.securityMarks = {}; + request.securityMarks.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.updateSecurityMarks = mockSimpleGrpcMethod( + request, + null, + error + ); + client.updateSecurityMarks(request, (err: FakeError, response: {}) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + describe('runAssetDiscovery', () => { + it('invokes runAssetDiscovery without error', done => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.cloud.securitycenter.v1.IRunAssetDiscoveryRequest = {}; + request.parent = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.runAssetDiscovery = mockLongRunningGrpcMethod( + request, + expectedResponse + ); + client + .runAssetDiscovery(request) + .then((responses: [Operation]) => { + const operation = responses[0]; + return operation ? operation.promise() : {}; + }) + .then((responses: [Operation]) => { + assert.deepStrictEqual(responses[0], expectedResponse); + done(); + }) + .catch((err: {}) => { + done(err); + }); + }); + + it('invokes runAssetDiscovery with error', done => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.cloud.securitycenter.v1.IRunAssetDiscoveryRequest = {}; + request.parent = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.runAssetDiscovery = mockLongRunningGrpcMethod( + request, + null, + error + ); + client + .runAssetDiscovery(request) + .then((responses: [Operation]) => { + const operation = responses[0]; + return operation ? operation.promise() : {}; + }) + .then(() => { + assert.fail(); + }) + .catch((err: FakeError) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + done(); + }); + }); + }); + describe('groupAssets', () => { + it('invokes groupAssets without error', done => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.cloud.securitycenter.v1.IGroupAssetsRequest = {}; + request.parent = ''; + // Mock response + const expectedResponse = {}; + // Mock Grpc layer + client._innerApiCalls.groupAssets = ( + actualRequest: {}, + options: {}, + callback: Callback + ) => { + assert.deepStrictEqual(actualRequest, request); + callback(null, expectedResponse); + }; + client.groupAssets(request, (err: FakeError, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + }); + describe('groupAssetsStream', () => { + it('invokes groupAssetsStream without error', done => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.cloud.securitycenter.v1.IGroupAssetsRequest = {}; + request.parent = ''; + // Mock response + const expectedResponse = {response: 'data'}; + // Mock Grpc layer + client._innerApiCalls.groupAssets = ( + actualRequest: {}, + options: {}, + callback: Callback + ) => { + assert.deepStrictEqual(actualRequest, request); + callback(null, expectedResponse); + }; + const stream = client + .groupAssetsStream(request, {}) + .on('data', (response: {}) => { + assert.deepStrictEqual(response, expectedResponse); + done(); + }) + .on('error', (err: FakeError) => { + done(err); + }); + stream.write(expectedResponse); + }); + }); + describe('groupFindings', () => { + it('invokes groupFindings without error', done => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.cloud.securitycenter.v1.IGroupFindingsRequest = {}; + request.parent = ''; + // Mock response + const expectedResponse = {}; + // Mock Grpc layer + client._innerApiCalls.groupFindings = ( + actualRequest: {}, + options: {}, + callback: Callback + ) => { + assert.deepStrictEqual(actualRequest, request); + callback(null, expectedResponse); + }; + client.groupFindings(request, (err: FakeError, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + }); + describe('groupFindingsStream', () => { + it('invokes groupFindingsStream without error', done => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.cloud.securitycenter.v1.IGroupFindingsRequest = {}; + request.parent = ''; + // Mock response + const expectedResponse = {response: 'data'}; + // Mock Grpc layer + client._innerApiCalls.groupFindings = ( + actualRequest: {}, + options: {}, + callback: Callback + ) => { + assert.deepStrictEqual(actualRequest, request); + callback(null, expectedResponse); + }; + const stream = client + .groupFindingsStream(request, {}) + .on('data', (response: {}) => { + assert.deepStrictEqual(response, expectedResponse); + done(); + }) + .on('error', (err: FakeError) => { + done(err); + }); + stream.write(expectedResponse); + }); + }); + describe('listAssets', () => { + it('invokes listAssets without error', done => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.cloud.securitycenter.v1.IListAssetsRequest = {}; + request.parent = ''; + // Mock response + const expectedResponse = {}; + // Mock Grpc layer + client._innerApiCalls.listAssets = ( + actualRequest: {}, + options: {}, + callback: Callback + ) => { + assert.deepStrictEqual(actualRequest, request); + callback(null, expectedResponse); + }; + client.listAssets(request, (err: FakeError, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + }); + describe('listAssetsStream', () => { + it('invokes listAssetsStream without error', done => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.cloud.securitycenter.v1.IListAssetsRequest = {}; + request.parent = ''; + // Mock response + const expectedResponse = {response: 'data'}; + // Mock Grpc layer + client._innerApiCalls.listAssets = ( + actualRequest: {}, + options: {}, + callback: Callback + ) => { + assert.deepStrictEqual(actualRequest, request); + callback(null, expectedResponse); + }; + const stream = client + .listAssetsStream(request, {}) + .on('data', (response: {}) => { + assert.deepStrictEqual(response, expectedResponse); + done(); + }) + .on('error', (err: FakeError) => { + done(err); + }); + stream.write(expectedResponse); + }); + }); + describe('listFindings', () => { + it('invokes listFindings without error', done => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.cloud.securitycenter.v1.IListFindingsRequest = {}; + request.parent = ''; + // Mock response + const expectedResponse = {}; + // Mock Grpc layer + client._innerApiCalls.listFindings = ( + actualRequest: {}, + options: {}, + callback: Callback + ) => { + assert.deepStrictEqual(actualRequest, request); + callback(null, expectedResponse); + }; + client.listFindings(request, (err: FakeError, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + }); + describe('listFindingsStream', () => { + it('invokes listFindingsStream without error', done => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.cloud.securitycenter.v1.IListFindingsRequest = {}; + request.parent = ''; + // Mock response + const expectedResponse = {response: 'data'}; + // Mock Grpc layer + client._innerApiCalls.listFindings = ( + actualRequest: {}, + options: {}, + callback: Callback + ) => { + assert.deepStrictEqual(actualRequest, request); + callback(null, expectedResponse); + }; + const stream = client + .listFindingsStream(request, {}) + .on('data', (response: {}) => { + assert.deepStrictEqual(response, expectedResponse); + done(); + }) + .on('error', (err: FakeError) => { + done(err); + }); + stream.write(expectedResponse); + }); + }); + describe('listSources', () => { + it('invokes listSources without error', done => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.cloud.securitycenter.v1.IListSourcesRequest = {}; + request.parent = ''; + // Mock response + const expectedResponse = {}; + // Mock Grpc layer + client._innerApiCalls.listSources = ( + actualRequest: {}, + options: {}, + callback: Callback + ) => { + assert.deepStrictEqual(actualRequest, request); + callback(null, expectedResponse); + }; + client.listSources(request, (err: FakeError, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + }); + describe('listSourcesStream', () => { + it('invokes listSourcesStream without error', done => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.cloud.securitycenter.v1.IListSourcesRequest = {}; + request.parent = ''; + // Mock response + const expectedResponse = {response: 'data'}; + // Mock Grpc layer + client._innerApiCalls.listSources = ( + actualRequest: {}, + options: {}, + callback: Callback + ) => { + assert.deepStrictEqual(actualRequest, request); + callback(null, expectedResponse); + }; + const stream = client + .listSourcesStream(request, {}) + .on('data', (response: {}) => { + assert.deepStrictEqual(response, expectedResponse); + done(); + }) + .on('error', (err: FakeError) => { + done(err); + }); + stream.write(expectedResponse); + }); + }); +}); diff --git a/packages/google-cloud-securitycenter/test/gapic-security_center-v1beta1.ts b/packages/google-cloud-securitycenter/test/gapic-security_center-v1beta1.ts new file mode 100644 index 00000000000..1425d84de26 --- /dev/null +++ b/packages/google-cloud-securitycenter/test/gapic-security_center-v1beta1.ts @@ -0,0 +1,1055 @@ +// Copyright 2019 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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 protosTypes from '../protos/protos'; +import * as assert from 'assert'; +import {describe, it} from 'mocha'; +const securitycenterModule = require('../src'); + +const FAKE_STATUS_CODE = 1; +class FakeError { + name: string; + message: string; + code: number; + constructor(n: number) { + this.name = 'fakeName'; + this.message = 'fake message'; + this.code = n; + } +} +const error = new FakeError(FAKE_STATUS_CODE); +export interface Callback { + (err: FakeError | null, response?: {} | null): void; +} + +export class Operation { + constructor() {} + promise() {} +} +function mockSimpleGrpcMethod( + expectedRequest: {}, + response: {} | null, + error: FakeError | null +) { + return (actualRequest: {}, options: {}, callback: Callback) => { + assert.deepStrictEqual(actualRequest, expectedRequest); + if (error) { + callback(error); + } else if (response) { + callback(null, response); + } else { + callback(null); + } + }; +} +function mockLongRunningGrpcMethod( + expectedRequest: {}, + response: {} | null, + error?: {} | null +) { + return (request: {}) => { + assert.deepStrictEqual(request, expectedRequest); + const mockOperation = { + promise() { + return new Promise((resolve, reject) => { + if (error) { + reject(error); + } else { + resolve([response]); + } + }); + }, + }; + return Promise.resolve([mockOperation]); + }; +} +describe('v1beta1.SecurityCenterClient', () => { + it('has servicePath', () => { + const servicePath = + securitycenterModule.v1beta1.SecurityCenterClient.servicePath; + assert(servicePath); + }); + it('has apiEndpoint', () => { + const apiEndpoint = + securitycenterModule.v1beta1.SecurityCenterClient.apiEndpoint; + assert(apiEndpoint); + }); + it('has port', () => { + const port = securitycenterModule.v1beta1.SecurityCenterClient.port; + assert(port); + assert(typeof port === 'number'); + }); + it('should create a client with no option', () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient(); + assert(client); + }); + it('should create a client with gRPC fallback', () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + fallback: true, + }); + assert(client); + }); + describe('createSource', () => { + it('invokes createSource without error', done => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.cloud.securitycenter.v1beta1.ICreateSourceRequest = {}; + request.parent = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.createSource = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.createSource(request, (err: {}, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes createSource with error', done => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.cloud.securitycenter.v1beta1.ICreateSourceRequest = {}; + request.parent = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.createSource = mockSimpleGrpcMethod( + request, + null, + error + ); + client.createSource(request, (err: FakeError, response: {}) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + describe('createFinding', () => { + it('invokes createFinding without error', done => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.cloud.securitycenter.v1beta1.ICreateFindingRequest = {}; + request.parent = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.createFinding = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.createFinding(request, (err: {}, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes createFinding with error', done => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.cloud.securitycenter.v1beta1.ICreateFindingRequest = {}; + request.parent = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.createFinding = mockSimpleGrpcMethod( + request, + null, + error + ); + client.createFinding(request, (err: FakeError, response: {}) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + describe('getIamPolicy', () => { + it('invokes getIamPolicy without error', done => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.iam.v1.IGetIamPolicyRequest = {}; + request.resource = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.getIamPolicy = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.getIamPolicy(request, (err: {}, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes getIamPolicy with error', done => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.iam.v1.IGetIamPolicyRequest = {}; + request.resource = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.getIamPolicy = mockSimpleGrpcMethod( + request, + null, + error + ); + client.getIamPolicy(request, (err: FakeError, response: {}) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + describe('getOrganizationSettings', () => { + it('invokes getOrganizationSettings without error', done => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.cloud.securitycenter.v1beta1.IGetOrganizationSettingsRequest = {}; + request.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.getOrganizationSettings = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.getOrganizationSettings(request, (err: {}, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes getOrganizationSettings with error', done => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.cloud.securitycenter.v1beta1.IGetOrganizationSettingsRequest = {}; + request.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.getOrganizationSettings = mockSimpleGrpcMethod( + request, + null, + error + ); + client.getOrganizationSettings( + request, + (err: FakeError, response: {}) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + } + ); + }); + }); + describe('getSource', () => { + it('invokes getSource without error', done => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.cloud.securitycenter.v1beta1.IGetSourceRequest = {}; + request.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.getSource = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.getSource(request, (err: {}, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes getSource with error', done => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.cloud.securitycenter.v1beta1.IGetSourceRequest = {}; + request.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.getSource = mockSimpleGrpcMethod( + request, + null, + error + ); + client.getSource(request, (err: FakeError, response: {}) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + describe('setFindingState', () => { + it('invokes setFindingState without error', done => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.cloud.securitycenter.v1beta1.ISetFindingStateRequest = {}; + request.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.setFindingState = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.setFindingState(request, (err: {}, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes setFindingState with error', done => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.cloud.securitycenter.v1beta1.ISetFindingStateRequest = {}; + request.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.setFindingState = mockSimpleGrpcMethod( + request, + null, + error + ); + client.setFindingState(request, (err: FakeError, response: {}) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + describe('setIamPolicy', () => { + it('invokes setIamPolicy without error', done => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.iam.v1.ISetIamPolicyRequest = {}; + request.resource = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.setIamPolicy = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.setIamPolicy(request, (err: {}, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes setIamPolicy with error', done => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.iam.v1.ISetIamPolicyRequest = {}; + request.resource = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.setIamPolicy = mockSimpleGrpcMethod( + request, + null, + error + ); + client.setIamPolicy(request, (err: FakeError, response: {}) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + describe('testIamPermissions', () => { + it('invokes testIamPermissions without error', done => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.iam.v1.ITestIamPermissionsRequest = {}; + request.resource = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.testIamPermissions = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.testIamPermissions(request, (err: {}, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes testIamPermissions with error', done => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.iam.v1.ITestIamPermissionsRequest = {}; + request.resource = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.testIamPermissions = mockSimpleGrpcMethod( + request, + null, + error + ); + client.testIamPermissions(request, (err: FakeError, response: {}) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + describe('updateFinding', () => { + it('invokes updateFinding without error', done => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.cloud.securitycenter.v1beta1.IUpdateFindingRequest = {}; + request.finding = {}; + request.finding.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.updateFinding = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.updateFinding(request, (err: {}, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes updateFinding with error', done => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.cloud.securitycenter.v1beta1.IUpdateFindingRequest = {}; + request.finding = {}; + request.finding.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.updateFinding = mockSimpleGrpcMethod( + request, + null, + error + ); + client.updateFinding(request, (err: FakeError, response: {}) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + describe('updateOrganizationSettings', () => { + it('invokes updateOrganizationSettings without error', done => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.cloud.securitycenter.v1beta1.IUpdateOrganizationSettingsRequest = {}; + request.organizationSettings = {}; + request.organizationSettings.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.updateOrganizationSettings = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.updateOrganizationSettings(request, (err: {}, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes updateOrganizationSettings with error', done => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.cloud.securitycenter.v1beta1.IUpdateOrganizationSettingsRequest = {}; + request.organizationSettings = {}; + request.organizationSettings.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.updateOrganizationSettings = mockSimpleGrpcMethod( + request, + null, + error + ); + client.updateOrganizationSettings( + request, + (err: FakeError, response: {}) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + } + ); + }); + }); + describe('updateSource', () => { + it('invokes updateSource without error', done => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.cloud.securitycenter.v1beta1.IUpdateSourceRequest = {}; + request.source = {}; + request.source.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.updateSource = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.updateSource(request, (err: {}, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes updateSource with error', done => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.cloud.securitycenter.v1beta1.IUpdateSourceRequest = {}; + request.source = {}; + request.source.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.updateSource = mockSimpleGrpcMethod( + request, + null, + error + ); + client.updateSource(request, (err: FakeError, response: {}) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + describe('updateSecurityMarks', () => { + it('invokes updateSecurityMarks without error', done => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.cloud.securitycenter.v1beta1.IUpdateSecurityMarksRequest = {}; + request.securityMarks = {}; + request.securityMarks.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.updateSecurityMarks = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.updateSecurityMarks(request, (err: {}, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes updateSecurityMarks with error', done => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.cloud.securitycenter.v1beta1.IUpdateSecurityMarksRequest = {}; + request.securityMarks = {}; + request.securityMarks.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.updateSecurityMarks = mockSimpleGrpcMethod( + request, + null, + error + ); + client.updateSecurityMarks(request, (err: FakeError, response: {}) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + describe('runAssetDiscovery', () => { + it('invokes runAssetDiscovery without error', done => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.cloud.securitycenter.v1beta1.IRunAssetDiscoveryRequest = {}; + request.parent = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.runAssetDiscovery = mockLongRunningGrpcMethod( + request, + expectedResponse + ); + client + .runAssetDiscovery(request) + .then((responses: [Operation]) => { + const operation = responses[0]; + return operation ? operation.promise() : {}; + }) + .then((responses: [Operation]) => { + assert.deepStrictEqual(responses[0], expectedResponse); + done(); + }) + .catch((err: {}) => { + done(err); + }); + }); + + it('invokes runAssetDiscovery with error', done => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.cloud.securitycenter.v1beta1.IRunAssetDiscoveryRequest = {}; + request.parent = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.runAssetDiscovery = mockLongRunningGrpcMethod( + request, + null, + error + ); + client + .runAssetDiscovery(request) + .then((responses: [Operation]) => { + const operation = responses[0]; + return operation ? operation.promise() : {}; + }) + .then(() => { + assert.fail(); + }) + .catch((err: FakeError) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + done(); + }); + }); + }); + describe('groupAssets', () => { + it('invokes groupAssets without error', done => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.cloud.securitycenter.v1beta1.IGroupAssetsRequest = {}; + request.parent = ''; + // Mock response + const expectedResponse = {}; + // Mock Grpc layer + client._innerApiCalls.groupAssets = ( + actualRequest: {}, + options: {}, + callback: Callback + ) => { + assert.deepStrictEqual(actualRequest, request); + callback(null, expectedResponse); + }; + client.groupAssets(request, (err: FakeError, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + }); + describe('groupAssetsStream', () => { + it('invokes groupAssetsStream without error', done => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.cloud.securitycenter.v1beta1.IGroupAssetsRequest = {}; + request.parent = ''; + // Mock response + const expectedResponse = {response: 'data'}; + // Mock Grpc layer + client._innerApiCalls.groupAssets = ( + actualRequest: {}, + options: {}, + callback: Callback + ) => { + assert.deepStrictEqual(actualRequest, request); + callback(null, expectedResponse); + }; + const stream = client + .groupAssetsStream(request, {}) + .on('data', (response: {}) => { + assert.deepStrictEqual(response, expectedResponse); + done(); + }) + .on('error', (err: FakeError) => { + done(err); + }); + stream.write(expectedResponse); + }); + }); + describe('groupFindings', () => { + it('invokes groupFindings without error', done => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.cloud.securitycenter.v1beta1.IGroupFindingsRequest = {}; + request.parent = ''; + // Mock response + const expectedResponse = {}; + // Mock Grpc layer + client._innerApiCalls.groupFindings = ( + actualRequest: {}, + options: {}, + callback: Callback + ) => { + assert.deepStrictEqual(actualRequest, request); + callback(null, expectedResponse); + }; + client.groupFindings(request, (err: FakeError, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + }); + describe('groupFindingsStream', () => { + it('invokes groupFindingsStream without error', done => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.cloud.securitycenter.v1beta1.IGroupFindingsRequest = {}; + request.parent = ''; + // Mock response + const expectedResponse = {response: 'data'}; + // Mock Grpc layer + client._innerApiCalls.groupFindings = ( + actualRequest: {}, + options: {}, + callback: Callback + ) => { + assert.deepStrictEqual(actualRequest, request); + callback(null, expectedResponse); + }; + const stream = client + .groupFindingsStream(request, {}) + .on('data', (response: {}) => { + assert.deepStrictEqual(response, expectedResponse); + done(); + }) + .on('error', (err: FakeError) => { + done(err); + }); + stream.write(expectedResponse); + }); + }); + describe('listAssets', () => { + it('invokes listAssets without error', done => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.cloud.securitycenter.v1beta1.IListAssetsRequest = {}; + request.parent = ''; + // Mock response + const expectedResponse = {}; + // Mock Grpc layer + client._innerApiCalls.listAssets = ( + actualRequest: {}, + options: {}, + callback: Callback + ) => { + assert.deepStrictEqual(actualRequest, request); + callback(null, expectedResponse); + }; + client.listAssets(request, (err: FakeError, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + }); + describe('listAssetsStream', () => { + it('invokes listAssetsStream without error', done => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.cloud.securitycenter.v1beta1.IListAssetsRequest = {}; + request.parent = ''; + // Mock response + const expectedResponse = {response: 'data'}; + // Mock Grpc layer + client._innerApiCalls.listAssets = ( + actualRequest: {}, + options: {}, + callback: Callback + ) => { + assert.deepStrictEqual(actualRequest, request); + callback(null, expectedResponse); + }; + const stream = client + .listAssetsStream(request, {}) + .on('data', (response: {}) => { + assert.deepStrictEqual(response, expectedResponse); + done(); + }) + .on('error', (err: FakeError) => { + done(err); + }); + stream.write(expectedResponse); + }); + }); + describe('listFindings', () => { + it('invokes listFindings without error', done => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.cloud.securitycenter.v1beta1.IListFindingsRequest = {}; + request.parent = ''; + // Mock response + const expectedResponse = {}; + // Mock Grpc layer + client._innerApiCalls.listFindings = ( + actualRequest: {}, + options: {}, + callback: Callback + ) => { + assert.deepStrictEqual(actualRequest, request); + callback(null, expectedResponse); + }; + client.listFindings(request, (err: FakeError, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + }); + describe('listFindingsStream', () => { + it('invokes listFindingsStream without error', done => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.cloud.securitycenter.v1beta1.IListFindingsRequest = {}; + request.parent = ''; + // Mock response + const expectedResponse = {response: 'data'}; + // Mock Grpc layer + client._innerApiCalls.listFindings = ( + actualRequest: {}, + options: {}, + callback: Callback + ) => { + assert.deepStrictEqual(actualRequest, request); + callback(null, expectedResponse); + }; + const stream = client + .listFindingsStream(request, {}) + .on('data', (response: {}) => { + assert.deepStrictEqual(response, expectedResponse); + done(); + }) + .on('error', (err: FakeError) => { + done(err); + }); + stream.write(expectedResponse); + }); + }); + describe('listSources', () => { + it('invokes listSources without error', done => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.cloud.securitycenter.v1beta1.IListSourcesRequest = {}; + request.parent = ''; + // Mock response + const expectedResponse = {}; + // Mock Grpc layer + client._innerApiCalls.listSources = ( + actualRequest: {}, + options: {}, + callback: Callback + ) => { + assert.deepStrictEqual(actualRequest, request); + callback(null, expectedResponse); + }; + client.listSources(request, (err: FakeError, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + }); + describe('listSourcesStream', () => { + it('invokes listSourcesStream without error', done => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.cloud.securitycenter.v1beta1.IListSourcesRequest = {}; + request.parent = ''; + // Mock response + const expectedResponse = {response: 'data'}; + // Mock Grpc layer + client._innerApiCalls.listSources = ( + actualRequest: {}, + options: {}, + callback: Callback + ) => { + assert.deepStrictEqual(actualRequest, request); + callback(null, expectedResponse); + }; + const stream = client + .listSourcesStream(request, {}) + .on('data', (response: {}) => { + assert.deepStrictEqual(response, expectedResponse); + done(); + }) + .on('error', (err: FakeError) => { + done(err); + }); + stream.write(expectedResponse); + }); + }); +}); diff --git a/packages/google-cloud-securitycenter/test/gapic-security_center-v1p1beta1.ts b/packages/google-cloud-securitycenter/test/gapic-security_center-v1p1beta1.ts new file mode 100644 index 00000000000..07995433eb0 --- /dev/null +++ b/packages/google-cloud-securitycenter/test/gapic-security_center-v1p1beta1.ts @@ -0,0 +1,1320 @@ +// Copyright 2019 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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 protosTypes from '../protos/protos'; +import * as assert from 'assert'; +import {describe, it} from 'mocha'; +const securitycenterModule = require('../src'); + +const FAKE_STATUS_CODE = 1; +class FakeError { + name: string; + message: string; + code: number; + constructor(n: number) { + this.name = 'fakeName'; + this.message = 'fake message'; + this.code = n; + } +} +const error = new FakeError(FAKE_STATUS_CODE); +export interface Callback { + (err: FakeError | null, response?: {} | null): void; +} + +export class Operation { + constructor() {} + promise() {} +} +function mockSimpleGrpcMethod( + expectedRequest: {}, + response: {} | null, + error: FakeError | null +) { + return (actualRequest: {}, options: {}, callback: Callback) => { + assert.deepStrictEqual(actualRequest, expectedRequest); + if (error) { + callback(error); + } else if (response) { + callback(null, response); + } else { + callback(null); + } + }; +} +function mockLongRunningGrpcMethod( + expectedRequest: {}, + response: {} | null, + error?: {} | null +) { + return (request: {}) => { + assert.deepStrictEqual(request, expectedRequest); + const mockOperation = { + promise() { + return new Promise((resolve, reject) => { + if (error) { + reject(error); + } else { + resolve([response]); + } + }); + }, + }; + return Promise.resolve([mockOperation]); + }; +} +describe('v1p1beta1.SecurityCenterClient', () => { + it('has servicePath', () => { + const servicePath = + securitycenterModule.v1p1beta1.SecurityCenterClient.servicePath; + assert(servicePath); + }); + it('has apiEndpoint', () => { + const apiEndpoint = + securitycenterModule.v1p1beta1.SecurityCenterClient.apiEndpoint; + assert(apiEndpoint); + }); + it('has port', () => { + const port = securitycenterModule.v1p1beta1.SecurityCenterClient.port; + assert(port); + assert(typeof port === 'number'); + }); + it('should create a client with no option', () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient(); + assert(client); + }); + it('should create a client with gRPC fallback', () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + fallback: true, + }); + assert(client); + }); + describe('createSource', () => { + it('invokes createSource without error', done => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.cloud.securitycenter.v1p1beta1.ICreateSourceRequest = {}; + request.parent = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.createSource = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.createSource(request, (err: {}, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes createSource with error', done => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.cloud.securitycenter.v1p1beta1.ICreateSourceRequest = {}; + request.parent = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.createSource = mockSimpleGrpcMethod( + request, + null, + error + ); + client.createSource(request, (err: FakeError, response: {}) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + describe('createFinding', () => { + it('invokes createFinding without error', done => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.cloud.securitycenter.v1p1beta1.ICreateFindingRequest = {}; + request.parent = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.createFinding = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.createFinding(request, (err: {}, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes createFinding with error', done => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.cloud.securitycenter.v1p1beta1.ICreateFindingRequest = {}; + request.parent = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.createFinding = mockSimpleGrpcMethod( + request, + null, + error + ); + client.createFinding(request, (err: FakeError, response: {}) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + describe('createNotificationConfig', () => { + it('invokes createNotificationConfig without error', done => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.cloud.securitycenter.v1p1beta1.ICreateNotificationConfigRequest = {}; + request.parent = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.createNotificationConfig = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.createNotificationConfig(request, (err: {}, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes createNotificationConfig with error', done => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.cloud.securitycenter.v1p1beta1.ICreateNotificationConfigRequest = {}; + request.parent = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.createNotificationConfig = mockSimpleGrpcMethod( + request, + null, + error + ); + client.createNotificationConfig( + request, + (err: FakeError, response: {}) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + } + ); + }); + }); + describe('deleteNotificationConfig', () => { + it('invokes deleteNotificationConfig without error', done => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.cloud.securitycenter.v1p1beta1.IDeleteNotificationConfigRequest = {}; + request.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.deleteNotificationConfig = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.deleteNotificationConfig(request, (err: {}, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes deleteNotificationConfig with error', done => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.cloud.securitycenter.v1p1beta1.IDeleteNotificationConfigRequest = {}; + request.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.deleteNotificationConfig = mockSimpleGrpcMethod( + request, + null, + error + ); + client.deleteNotificationConfig( + request, + (err: FakeError, response: {}) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + } + ); + }); + }); + describe('getIamPolicy', () => { + it('invokes getIamPolicy without error', done => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.iam.v1.IGetIamPolicyRequest = {}; + request.resource = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.getIamPolicy = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.getIamPolicy(request, (err: {}, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes getIamPolicy with error', done => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.iam.v1.IGetIamPolicyRequest = {}; + request.resource = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.getIamPolicy = mockSimpleGrpcMethod( + request, + null, + error + ); + client.getIamPolicy(request, (err: FakeError, response: {}) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + describe('getNotificationConfig', () => { + it('invokes getNotificationConfig without error', done => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.cloud.securitycenter.v1p1beta1.IGetNotificationConfigRequest = {}; + request.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.getNotificationConfig = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.getNotificationConfig(request, (err: {}, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes getNotificationConfig with error', done => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.cloud.securitycenter.v1p1beta1.IGetNotificationConfigRequest = {}; + request.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.getNotificationConfig = mockSimpleGrpcMethod( + request, + null, + error + ); + client.getNotificationConfig(request, (err: FakeError, response: {}) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + describe('getOrganizationSettings', () => { + it('invokes getOrganizationSettings without error', done => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.cloud.securitycenter.v1p1beta1.IGetOrganizationSettingsRequest = {}; + request.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.getOrganizationSettings = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.getOrganizationSettings(request, (err: {}, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes getOrganizationSettings with error', done => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.cloud.securitycenter.v1p1beta1.IGetOrganizationSettingsRequest = {}; + request.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.getOrganizationSettings = mockSimpleGrpcMethod( + request, + null, + error + ); + client.getOrganizationSettings( + request, + (err: FakeError, response: {}) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + } + ); + }); + }); + describe('getSource', () => { + it('invokes getSource without error', done => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.cloud.securitycenter.v1p1beta1.IGetSourceRequest = {}; + request.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.getSource = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.getSource(request, (err: {}, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes getSource with error', done => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.cloud.securitycenter.v1p1beta1.IGetSourceRequest = {}; + request.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.getSource = mockSimpleGrpcMethod( + request, + null, + error + ); + client.getSource(request, (err: FakeError, response: {}) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + describe('setFindingState', () => { + it('invokes setFindingState without error', done => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.cloud.securitycenter.v1p1beta1.ISetFindingStateRequest = {}; + request.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.setFindingState = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.setFindingState(request, (err: {}, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes setFindingState with error', done => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.cloud.securitycenter.v1p1beta1.ISetFindingStateRequest = {}; + request.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.setFindingState = mockSimpleGrpcMethod( + request, + null, + error + ); + client.setFindingState(request, (err: FakeError, response: {}) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + describe('setIamPolicy', () => { + it('invokes setIamPolicy without error', done => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.iam.v1.ISetIamPolicyRequest = {}; + request.resource = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.setIamPolicy = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.setIamPolicy(request, (err: {}, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes setIamPolicy with error', done => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.iam.v1.ISetIamPolicyRequest = {}; + request.resource = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.setIamPolicy = mockSimpleGrpcMethod( + request, + null, + error + ); + client.setIamPolicy(request, (err: FakeError, response: {}) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + describe('testIamPermissions', () => { + it('invokes testIamPermissions without error', done => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.iam.v1.ITestIamPermissionsRequest = {}; + request.resource = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.testIamPermissions = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.testIamPermissions(request, (err: {}, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes testIamPermissions with error', done => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.iam.v1.ITestIamPermissionsRequest = {}; + request.resource = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.testIamPermissions = mockSimpleGrpcMethod( + request, + null, + error + ); + client.testIamPermissions(request, (err: FakeError, response: {}) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + describe('updateFinding', () => { + it('invokes updateFinding without error', done => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.cloud.securitycenter.v1p1beta1.IUpdateFindingRequest = {}; + request.finding = {}; + request.finding.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.updateFinding = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.updateFinding(request, (err: {}, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes updateFinding with error', done => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.cloud.securitycenter.v1p1beta1.IUpdateFindingRequest = {}; + request.finding = {}; + request.finding.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.updateFinding = mockSimpleGrpcMethod( + request, + null, + error + ); + client.updateFinding(request, (err: FakeError, response: {}) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + describe('updateNotificationConfig', () => { + it('invokes updateNotificationConfig without error', done => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.cloud.securitycenter.v1p1beta1.IUpdateNotificationConfigRequest = {}; + request.notificationConfig = {}; + request.notificationConfig.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.updateNotificationConfig = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.updateNotificationConfig(request, (err: {}, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes updateNotificationConfig with error', done => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.cloud.securitycenter.v1p1beta1.IUpdateNotificationConfigRequest = {}; + request.notificationConfig = {}; + request.notificationConfig.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.updateNotificationConfig = mockSimpleGrpcMethod( + request, + null, + error + ); + client.updateNotificationConfig( + request, + (err: FakeError, response: {}) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + } + ); + }); + }); + describe('updateOrganizationSettings', () => { + it('invokes updateOrganizationSettings without error', done => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.cloud.securitycenter.v1p1beta1.IUpdateOrganizationSettingsRequest = {}; + request.organizationSettings = {}; + request.organizationSettings.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.updateOrganizationSettings = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.updateOrganizationSettings(request, (err: {}, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes updateOrganizationSettings with error', done => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.cloud.securitycenter.v1p1beta1.IUpdateOrganizationSettingsRequest = {}; + request.organizationSettings = {}; + request.organizationSettings.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.updateOrganizationSettings = mockSimpleGrpcMethod( + request, + null, + error + ); + client.updateOrganizationSettings( + request, + (err: FakeError, response: {}) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + } + ); + }); + }); + describe('updateSource', () => { + it('invokes updateSource without error', done => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.cloud.securitycenter.v1p1beta1.IUpdateSourceRequest = {}; + request.source = {}; + request.source.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.updateSource = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.updateSource(request, (err: {}, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes updateSource with error', done => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.cloud.securitycenter.v1p1beta1.IUpdateSourceRequest = {}; + request.source = {}; + request.source.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.updateSource = mockSimpleGrpcMethod( + request, + null, + error + ); + client.updateSource(request, (err: FakeError, response: {}) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + describe('updateSecurityMarks', () => { + it('invokes updateSecurityMarks without error', done => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.cloud.securitycenter.v1p1beta1.IUpdateSecurityMarksRequest = {}; + request.securityMarks = {}; + request.securityMarks.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.updateSecurityMarks = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.updateSecurityMarks(request, (err: {}, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes updateSecurityMarks with error', done => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.cloud.securitycenter.v1p1beta1.IUpdateSecurityMarksRequest = {}; + request.securityMarks = {}; + request.securityMarks.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.updateSecurityMarks = mockSimpleGrpcMethod( + request, + null, + error + ); + client.updateSecurityMarks(request, (err: FakeError, response: {}) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + describe('runAssetDiscovery', () => { + it('invokes runAssetDiscovery without error', done => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.cloud.securitycenter.v1p1beta1.IRunAssetDiscoveryRequest = {}; + request.parent = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.runAssetDiscovery = mockLongRunningGrpcMethod( + request, + expectedResponse + ); + client + .runAssetDiscovery(request) + .then((responses: [Operation]) => { + const operation = responses[0]; + return operation ? operation.promise() : {}; + }) + .then((responses: [Operation]) => { + assert.deepStrictEqual(responses[0], expectedResponse); + done(); + }) + .catch((err: {}) => { + done(err); + }); + }); + + it('invokes runAssetDiscovery with error', done => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.cloud.securitycenter.v1p1beta1.IRunAssetDiscoveryRequest = {}; + request.parent = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.runAssetDiscovery = mockLongRunningGrpcMethod( + request, + null, + error + ); + client + .runAssetDiscovery(request) + .then((responses: [Operation]) => { + const operation = responses[0]; + return operation ? operation.promise() : {}; + }) + .then(() => { + assert.fail(); + }) + .catch((err: FakeError) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + done(); + }); + }); + }); + describe('groupAssets', () => { + it('invokes groupAssets without error', done => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.cloud.securitycenter.v1p1beta1.IGroupAssetsRequest = {}; + request.parent = ''; + // Mock response + const expectedResponse = {}; + // Mock Grpc layer + client._innerApiCalls.groupAssets = ( + actualRequest: {}, + options: {}, + callback: Callback + ) => { + assert.deepStrictEqual(actualRequest, request); + callback(null, expectedResponse); + }; + client.groupAssets(request, (err: FakeError, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + }); + describe('groupAssetsStream', () => { + it('invokes groupAssetsStream without error', done => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.cloud.securitycenter.v1p1beta1.IGroupAssetsRequest = {}; + request.parent = ''; + // Mock response + const expectedResponse = {response: 'data'}; + // Mock Grpc layer + client._innerApiCalls.groupAssets = ( + actualRequest: {}, + options: {}, + callback: Callback + ) => { + assert.deepStrictEqual(actualRequest, request); + callback(null, expectedResponse); + }; + const stream = client + .groupAssetsStream(request, {}) + .on('data', (response: {}) => { + assert.deepStrictEqual(response, expectedResponse); + done(); + }) + .on('error', (err: FakeError) => { + done(err); + }); + stream.write(expectedResponse); + }); + }); + describe('groupFindings', () => { + it('invokes groupFindings without error', done => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.cloud.securitycenter.v1p1beta1.IGroupFindingsRequest = {}; + request.parent = ''; + // Mock response + const expectedResponse = {}; + // Mock Grpc layer + client._innerApiCalls.groupFindings = ( + actualRequest: {}, + options: {}, + callback: Callback + ) => { + assert.deepStrictEqual(actualRequest, request); + callback(null, expectedResponse); + }; + client.groupFindings(request, (err: FakeError, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + }); + describe('groupFindingsStream', () => { + it('invokes groupFindingsStream without error', done => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.cloud.securitycenter.v1p1beta1.IGroupFindingsRequest = {}; + request.parent = ''; + // Mock response + const expectedResponse = {response: 'data'}; + // Mock Grpc layer + client._innerApiCalls.groupFindings = ( + actualRequest: {}, + options: {}, + callback: Callback + ) => { + assert.deepStrictEqual(actualRequest, request); + callback(null, expectedResponse); + }; + const stream = client + .groupFindingsStream(request, {}) + .on('data', (response: {}) => { + assert.deepStrictEqual(response, expectedResponse); + done(); + }) + .on('error', (err: FakeError) => { + done(err); + }); + stream.write(expectedResponse); + }); + }); + describe('listAssets', () => { + it('invokes listAssets without error', done => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.cloud.securitycenter.v1p1beta1.IListAssetsRequest = {}; + request.parent = ''; + // Mock response + const expectedResponse = {}; + // Mock Grpc layer + client._innerApiCalls.listAssets = ( + actualRequest: {}, + options: {}, + callback: Callback + ) => { + assert.deepStrictEqual(actualRequest, request); + callback(null, expectedResponse); + }; + client.listAssets(request, (err: FakeError, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + }); + describe('listAssetsStream', () => { + it('invokes listAssetsStream without error', done => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.cloud.securitycenter.v1p1beta1.IListAssetsRequest = {}; + request.parent = ''; + // Mock response + const expectedResponse = {response: 'data'}; + // Mock Grpc layer + client._innerApiCalls.listAssets = ( + actualRequest: {}, + options: {}, + callback: Callback + ) => { + assert.deepStrictEqual(actualRequest, request); + callback(null, expectedResponse); + }; + const stream = client + .listAssetsStream(request, {}) + .on('data', (response: {}) => { + assert.deepStrictEqual(response, expectedResponse); + done(); + }) + .on('error', (err: FakeError) => { + done(err); + }); + stream.write(expectedResponse); + }); + }); + describe('listFindings', () => { + it('invokes listFindings without error', done => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.cloud.securitycenter.v1p1beta1.IListFindingsRequest = {}; + request.parent = ''; + // Mock response + const expectedResponse = {}; + // Mock Grpc layer + client._innerApiCalls.listFindings = ( + actualRequest: {}, + options: {}, + callback: Callback + ) => { + assert.deepStrictEqual(actualRequest, request); + callback(null, expectedResponse); + }; + client.listFindings(request, (err: FakeError, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + }); + describe('listFindingsStream', () => { + it('invokes listFindingsStream without error', done => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.cloud.securitycenter.v1p1beta1.IListFindingsRequest = {}; + request.parent = ''; + // Mock response + const expectedResponse = {response: 'data'}; + // Mock Grpc layer + client._innerApiCalls.listFindings = ( + actualRequest: {}, + options: {}, + callback: Callback + ) => { + assert.deepStrictEqual(actualRequest, request); + callback(null, expectedResponse); + }; + const stream = client + .listFindingsStream(request, {}) + .on('data', (response: {}) => { + assert.deepStrictEqual(response, expectedResponse); + done(); + }) + .on('error', (err: FakeError) => { + done(err); + }); + stream.write(expectedResponse); + }); + }); + describe('listNotificationConfigs', () => { + it('invokes listNotificationConfigs without error', done => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.cloud.securitycenter.v1p1beta1.IListNotificationConfigsRequest = {}; + request.parent = ''; + // Mock response + const expectedResponse = {}; + // Mock Grpc layer + client._innerApiCalls.listNotificationConfigs = ( + actualRequest: {}, + options: {}, + callback: Callback + ) => { + assert.deepStrictEqual(actualRequest, request); + callback(null, expectedResponse); + }; + client.listNotificationConfigs( + request, + (err: FakeError, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + } + ); + }); + }); + describe('listNotificationConfigsStream', () => { + it('invokes listNotificationConfigsStream without error', done => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.cloud.securitycenter.v1p1beta1.IListNotificationConfigsRequest = {}; + request.parent = ''; + // Mock response + const expectedResponse = {response: 'data'}; + // Mock Grpc layer + client._innerApiCalls.listNotificationConfigs = ( + actualRequest: {}, + options: {}, + callback: Callback + ) => { + assert.deepStrictEqual(actualRequest, request); + callback(null, expectedResponse); + }; + const stream = client + .listNotificationConfigsStream(request, {}) + .on('data', (response: {}) => { + assert.deepStrictEqual(response, expectedResponse); + done(); + }) + .on('error', (err: FakeError) => { + done(err); + }); + stream.write(expectedResponse); + }); + }); + describe('listSources', () => { + it('invokes listSources without error', done => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.cloud.securitycenter.v1p1beta1.IListSourcesRequest = {}; + request.parent = ''; + // Mock response + const expectedResponse = {}; + // Mock Grpc layer + client._innerApiCalls.listSources = ( + actualRequest: {}, + options: {}, + callback: Callback + ) => { + assert.deepStrictEqual(actualRequest, request); + callback(null, expectedResponse); + }; + client.listSources(request, (err: FakeError, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + }); + describe('listSourcesStream', () => { + it('invokes listSourcesStream without error', done => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.cloud.securitycenter.v1p1beta1.IListSourcesRequest = {}; + request.parent = ''; + // Mock response + const expectedResponse = {response: 'data'}; + // Mock Grpc layer + client._innerApiCalls.listSources = ( + actualRequest: {}, + options: {}, + callback: Callback + ) => { + assert.deepStrictEqual(actualRequest, request); + callback(null, expectedResponse); + }; + const stream = client + .listSourcesStream(request, {}) + .on('data', (response: {}) => { + assert.deepStrictEqual(response, expectedResponse); + done(); + }) + .on('error', (err: FakeError) => { + done(err); + }); + stream.write(expectedResponse); + }); + }); +}); diff --git a/packages/google-cloud-securitycenter/test/gapic-v1.js b/packages/google-cloud-securitycenter/test/gapic-v1.js deleted file mode 100644 index ce442873775..00000000000 --- a/packages/google-cloud-securitycenter/test/gapic-v1.js +++ /dev/null @@ -1,1319 +0,0 @@ -// 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. - -'use strict'; - -const assert = require('assert'); -const {describe, it} = require('mocha'); - -const securityCenterModule = require('../src'); - -const FAKE_STATUS_CODE = 1; -const error = new Error(); -error.code = FAKE_STATUS_CODE; - -describe('SecurityCenterClient', () => { - it('has servicePath', () => { - const servicePath = - securityCenterModule.v1.SecurityCenterClient.servicePath; - assert(servicePath); - }); - - it('has apiEndpoint', () => { - const apiEndpoint = - securityCenterModule.v1.SecurityCenterClient.apiEndpoint; - assert(apiEndpoint); - }); - - it('has port', () => { - const port = securityCenterModule.v1.SecurityCenterClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no options', () => { - const client = new securityCenterModule.v1.SecurityCenterClient(); - assert(client); - }); - - it('should create a client with gRPC fallback', () => { - const client = new securityCenterModule.v1.SecurityCenterClient({ - fallback: true, - }); - assert(client); - }); - - describe('createSource', () => { - it('invokes createSource without error', done => { - const client = new securityCenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedParent = client.organizationPath('[ORGANIZATION]'); - const source = {}; - const request = { - parent: formattedParent, - source: source, - }; - - // Mock response - const name = 'name3373707'; - const displayName = 'displayName1615086568'; - const description = 'description-1724546052'; - const expectedResponse = { - name: name, - displayName: displayName, - description: description, - }; - - // Mock Grpc layer - client._innerApiCalls.createSource = mockSimpleGrpcMethod( - request, - expectedResponse - ); - - client.createSource(request, (err, response) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes createSource with error', done => { - const client = new securityCenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedParent = client.organizationPath('[ORGANIZATION]'); - const source = {}; - const request = { - parent: formattedParent, - source: source, - }; - - // Mock Grpc layer - client._innerApiCalls.createSource = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.createSource(request, (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - - describe('createFinding', () => { - it('invokes createFinding without error', done => { - const client = new securityCenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedParent = client.sourcePath('[ORGANIZATION]', '[SOURCE]'); - const findingId = 'findingId728776081'; - const finding = {}; - const request = { - parent: formattedParent, - findingId: findingId, - finding: finding, - }; - - // Mock response - const name = 'name3373707'; - const parent2 = 'parent21175163357'; - const resourceName = 'resourceName979421212'; - const category = 'category50511102'; - const externalUri = 'externalUri-1385596168'; - const expectedResponse = { - name: name, - parent: parent2, - resourceName: resourceName, - category: category, - externalUri: externalUri, - }; - - // Mock Grpc layer - client._innerApiCalls.createFinding = mockSimpleGrpcMethod( - request, - expectedResponse - ); - - client.createFinding(request, (err, response) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes createFinding with error', done => { - const client = new securityCenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedParent = client.sourcePath('[ORGANIZATION]', '[SOURCE]'); - const findingId = 'findingId728776081'; - const finding = {}; - const request = { - parent: formattedParent, - findingId: findingId, - finding: finding, - }; - - // Mock Grpc layer - client._innerApiCalls.createFinding = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.createFinding(request, (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - - describe('getIamPolicy', () => { - it('invokes getIamPolicy without error', done => { - const client = new securityCenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedResource = client.sourcePath('[ORGANIZATION]', '[SOURCE]'); - const request = { - resource: formattedResource, - }; - - // Mock response - const version = 351608024; - const etag = '21'; - const expectedResponse = { - version: version, - etag: etag, - }; - - // Mock Grpc layer - client._innerApiCalls.getIamPolicy = mockSimpleGrpcMethod( - request, - expectedResponse - ); - - client.getIamPolicy(request, (err, response) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes getIamPolicy with error', done => { - const client = new securityCenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedResource = client.sourcePath('[ORGANIZATION]', '[SOURCE]'); - const request = { - resource: formattedResource, - }; - - // Mock Grpc layer - client._innerApiCalls.getIamPolicy = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.getIamPolicy(request, (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - - describe('getOrganizationSettings', () => { - it('invokes getOrganizationSettings without error', done => { - const client = new securityCenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedName = client.organizationSettingsPath('[ORGANIZATION]'); - const request = { - name: formattedName, - }; - - // Mock response - const name2 = 'name2-1052831874'; - const enableAssetDiscovery = false; - const expectedResponse = { - name: name2, - enableAssetDiscovery: enableAssetDiscovery, - }; - - // Mock Grpc layer - client._innerApiCalls.getOrganizationSettings = mockSimpleGrpcMethod( - request, - expectedResponse - ); - - client.getOrganizationSettings(request, (err, response) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes getOrganizationSettings with error', done => { - const client = new securityCenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedName = client.organizationSettingsPath('[ORGANIZATION]'); - const request = { - name: formattedName, - }; - - // Mock Grpc layer - client._innerApiCalls.getOrganizationSettings = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.getOrganizationSettings(request, (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - - describe('getSource', () => { - it('invokes getSource without error', done => { - const client = new securityCenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedName = client.sourcePath('[ORGANIZATION]', '[SOURCE]'); - const request = { - name: formattedName, - }; - - // Mock response - const name2 = 'name2-1052831874'; - const displayName = 'displayName1615086568'; - const description = 'description-1724546052'; - const expectedResponse = { - name: name2, - displayName: displayName, - description: description, - }; - - // Mock Grpc layer - client._innerApiCalls.getSource = mockSimpleGrpcMethod( - request, - expectedResponse - ); - - client.getSource(request, (err, response) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes getSource with error', done => { - const client = new securityCenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedName = client.sourcePath('[ORGANIZATION]', '[SOURCE]'); - const request = { - name: formattedName, - }; - - // Mock Grpc layer - client._innerApiCalls.getSource = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.getSource(request, (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - - describe('groupAssets', () => { - it('invokes groupAssets without error', done => { - const client = new securityCenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedParent = client.organizationPath('[ORGANIZATION]'); - const groupBy = 'groupBy506361367'; - const request = { - parent: formattedParent, - groupBy: groupBy, - }; - - // Mock response - const nextPageToken = ''; - const totalSize = 705419236; - const groupByResultsElement = {}; - const groupByResults = [groupByResultsElement]; - const expectedResponse = { - nextPageToken: nextPageToken, - totalSize: totalSize, - groupByResults: groupByResults, - }; - - // Mock Grpc layer - client._innerApiCalls.groupAssets = ( - actualRequest, - options, - callback - ) => { - assert.deepStrictEqual(actualRequest, request); - callback(null, expectedResponse.groupByResults); - }; - - client.groupAssets(request, (err, response) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse.groupByResults); - done(); - }); - }); - - it('invokes groupAssets with error', done => { - const client = new securityCenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedParent = client.organizationPath('[ORGANIZATION]'); - const groupBy = 'groupBy506361367'; - const request = { - parent: formattedParent, - groupBy: groupBy, - }; - - // Mock Grpc layer - client._innerApiCalls.groupAssets = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.groupAssets(request, (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - - describe('groupFindings', () => { - it('invokes groupFindings without error', done => { - const client = new securityCenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedParent = client.sourcePath('[ORGANIZATION]', '[SOURCE]'); - const groupBy = 'groupBy506361367'; - const request = { - parent: formattedParent, - groupBy: groupBy, - }; - - // Mock response - const nextPageToken = ''; - const totalSize = 705419236; - const groupByResultsElement = {}; - const groupByResults = [groupByResultsElement]; - const expectedResponse = { - nextPageToken: nextPageToken, - totalSize: totalSize, - groupByResults: groupByResults, - }; - - // Mock Grpc layer - client._innerApiCalls.groupFindings = ( - actualRequest, - options, - callback - ) => { - assert.deepStrictEqual(actualRequest, request); - callback(null, expectedResponse.groupByResults); - }; - - client.groupFindings(request, (err, response) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse.groupByResults); - done(); - }); - }); - - it('invokes groupFindings with error', done => { - const client = new securityCenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedParent = client.sourcePath('[ORGANIZATION]', '[SOURCE]'); - const groupBy = 'groupBy506361367'; - const request = { - parent: formattedParent, - groupBy: groupBy, - }; - - // Mock Grpc layer - client._innerApiCalls.groupFindings = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.groupFindings(request, (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - - describe('listAssets', () => { - it('invokes listAssets without error', done => { - const client = new securityCenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedParent = client.organizationPath('[ORGANIZATION]'); - const request = { - parent: formattedParent, - }; - - // Mock response - const nextPageToken = ''; - const totalSize = 705419236; - const listAssetsResultsElement = {}; - const listAssetsResults = [listAssetsResultsElement]; - const expectedResponse = { - nextPageToken: nextPageToken, - totalSize: totalSize, - listAssetsResults: listAssetsResults, - }; - - // Mock Grpc layer - client._innerApiCalls.listAssets = (actualRequest, options, callback) => { - assert.deepStrictEqual(actualRequest, request); - callback(null, expectedResponse.listAssetsResults); - }; - - client.listAssets(request, (err, response) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse.listAssetsResults); - done(); - }); - }); - - it('invokes listAssets with error', done => { - const client = new securityCenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedParent = client.organizationPath('[ORGANIZATION]'); - const request = { - parent: formattedParent, - }; - - // Mock Grpc layer - client._innerApiCalls.listAssets = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.listAssets(request, (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - - describe('listFindings', () => { - it('invokes listFindings without error', done => { - const client = new securityCenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedParent = client.sourcePath('[ORGANIZATION]', '[SOURCE]'); - const request = { - parent: formattedParent, - }; - - // Mock response - const nextPageToken = ''; - const totalSize = 705419236; - const listFindingsResultsElement = {}; - const listFindingsResults = [listFindingsResultsElement]; - const expectedResponse = { - nextPageToken: nextPageToken, - totalSize: totalSize, - listFindingsResults: listFindingsResults, - }; - - // Mock Grpc layer - client._innerApiCalls.listFindings = ( - actualRequest, - options, - callback - ) => { - assert.deepStrictEqual(actualRequest, request); - callback(null, expectedResponse.listFindingsResults); - }; - - client.listFindings(request, (err, response) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse.listFindingsResults); - done(); - }); - }); - - it('invokes listFindings with error', done => { - const client = new securityCenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedParent = client.sourcePath('[ORGANIZATION]', '[SOURCE]'); - const request = { - parent: formattedParent, - }; - - // Mock Grpc layer - client._innerApiCalls.listFindings = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.listFindings(request, (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - - describe('listSources', () => { - it('invokes listSources without error', done => { - const client = new securityCenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedParent = client.organizationPath('[ORGANIZATION]'); - const request = { - parent: formattedParent, - }; - - // Mock response - const nextPageToken = ''; - const sourcesElement = {}; - const sources = [sourcesElement]; - const expectedResponse = { - nextPageToken: nextPageToken, - sources: sources, - }; - - // Mock Grpc layer - client._innerApiCalls.listSources = ( - actualRequest, - options, - callback - ) => { - assert.deepStrictEqual(actualRequest, request); - callback(null, expectedResponse.sources); - }; - - client.listSources(request, (err, response) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse.sources); - done(); - }); - }); - - it('invokes listSources with error', done => { - const client = new securityCenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedParent = client.organizationPath('[ORGANIZATION]'); - const request = { - parent: formattedParent, - }; - - // Mock Grpc layer - client._innerApiCalls.listSources = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.listSources(request, (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - - describe('runAssetDiscovery', function() { - it('invokes runAssetDiscovery without error', done => { - const client = new securityCenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedParent = client.organizationPath('[ORGANIZATION]'); - const request = { - parent: formattedParent, - }; - - // Mock response - const expectedResponse = {}; - - // Mock Grpc layer - client._innerApiCalls.runAssetDiscovery = mockLongRunningGrpcMethod( - request, - expectedResponse - ); - - client - .runAssetDiscovery(request) - .then(responses => { - const operation = responses[0]; - return operation.promise(); - }) - .then(responses => { - assert.deepStrictEqual(responses[0], expectedResponse); - done(); - }) - .catch(err => { - done(err); - }); - }); - - it('invokes runAssetDiscovery with error', done => { - const client = new securityCenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedParent = client.organizationPath('[ORGANIZATION]'); - const request = { - parent: formattedParent, - }; - - // Mock Grpc layer - client._innerApiCalls.runAssetDiscovery = mockLongRunningGrpcMethod( - request, - null, - error - ); - - client - .runAssetDiscovery(request) - .then(responses => { - const operation = responses[0]; - return operation.promise(); - }) - .then(() => { - assert.fail(); - }) - .catch(err => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - done(); - }); - }); - - it('has longrunning decoder functions', () => { - const client = new securityCenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert( - client._descriptors.longrunning.runAssetDiscovery - .responseDecoder instanceof Function - ); - assert( - client._descriptors.longrunning.runAssetDiscovery - .metadataDecoder instanceof Function - ); - }); - }); - - describe('setFindingState', () => { - it('invokes setFindingState without error', done => { - const client = new securityCenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedName = client.findingPath( - '[ORGANIZATION]', - '[SOURCE]', - '[FINDING]' - ); - const state = 'STATE_UNSPECIFIED'; - const startTime = {}; - const request = { - name: formattedName, - state: state, - startTime: startTime, - }; - - // Mock response - const name2 = 'name2-1052831874'; - const parent = 'parent-995424086'; - const resourceName = 'resourceName979421212'; - const category = 'category50511102'; - const externalUri = 'externalUri-1385596168'; - const expectedResponse = { - name: name2, - parent: parent, - resourceName: resourceName, - category: category, - externalUri: externalUri, - }; - - // Mock Grpc layer - client._innerApiCalls.setFindingState = mockSimpleGrpcMethod( - request, - expectedResponse - ); - - client.setFindingState(request, (err, response) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes setFindingState with error', done => { - const client = new securityCenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedName = client.findingPath( - '[ORGANIZATION]', - '[SOURCE]', - '[FINDING]' - ); - const state = 'STATE_UNSPECIFIED'; - const startTime = {}; - const request = { - name: formattedName, - state: state, - startTime: startTime, - }; - - // Mock Grpc layer - client._innerApiCalls.setFindingState = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.setFindingState(request, (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - - describe('setIamPolicy', () => { - it('invokes setIamPolicy without error', done => { - const client = new securityCenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedResource = client.sourcePath('[ORGANIZATION]', '[SOURCE]'); - const policy = {}; - const request = { - resource: formattedResource, - policy: policy, - }; - - // Mock response - const version = 351608024; - const etag = '21'; - const expectedResponse = { - version: version, - etag: etag, - }; - - // Mock Grpc layer - client._innerApiCalls.setIamPolicy = mockSimpleGrpcMethod( - request, - expectedResponse - ); - - client.setIamPolicy(request, (err, response) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes setIamPolicy with error', done => { - const client = new securityCenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedResource = client.sourcePath('[ORGANIZATION]', '[SOURCE]'); - const policy = {}; - const request = { - resource: formattedResource, - policy: policy, - }; - - // Mock Grpc layer - client._innerApiCalls.setIamPolicy = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.setIamPolicy(request, (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - - describe('testIamPermissions', () => { - it('invokes testIamPermissions without error', done => { - const client = new securityCenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedResource = client.sourcePath('[ORGANIZATION]', '[SOURCE]'); - const permissions = []; - const request = { - resource: formattedResource, - permissions: permissions, - }; - - // Mock response - const expectedResponse = {}; - - // Mock Grpc layer - client._innerApiCalls.testIamPermissions = mockSimpleGrpcMethod( - request, - expectedResponse - ); - - client.testIamPermissions(request, (err, response) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes testIamPermissions with error', done => { - const client = new securityCenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedResource = client.sourcePath('[ORGANIZATION]', '[SOURCE]'); - const permissions = []; - const request = { - resource: formattedResource, - permissions: permissions, - }; - - // Mock Grpc layer - client._innerApiCalls.testIamPermissions = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.testIamPermissions(request, (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - - describe('updateFinding', () => { - it('invokes updateFinding without error', done => { - const client = new securityCenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const finding = {}; - const request = { - finding: finding, - }; - - // Mock response - const name = 'name3373707'; - const parent = 'parent-995424086'; - const resourceName = 'resourceName979421212'; - const category = 'category50511102'; - const externalUri = 'externalUri-1385596168'; - const expectedResponse = { - name: name, - parent: parent, - resourceName: resourceName, - category: category, - externalUri: externalUri, - }; - - // Mock Grpc layer - client._innerApiCalls.updateFinding = mockSimpleGrpcMethod( - request, - expectedResponse - ); - - client.updateFinding(request, (err, response) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes updateFinding with error', done => { - const client = new securityCenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const finding = {}; - const request = { - finding: finding, - }; - - // Mock Grpc layer - client._innerApiCalls.updateFinding = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.updateFinding(request, (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - - describe('updateOrganizationSettings', () => { - it('invokes updateOrganizationSettings without error', done => { - const client = new securityCenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const organizationSettings = {}; - const request = { - organizationSettings: organizationSettings, - }; - - // Mock response - const name = 'name3373707'; - const enableAssetDiscovery = false; - const expectedResponse = { - name: name, - enableAssetDiscovery: enableAssetDiscovery, - }; - - // Mock Grpc layer - client._innerApiCalls.updateOrganizationSettings = mockSimpleGrpcMethod( - request, - expectedResponse - ); - - client.updateOrganizationSettings(request, (err, response) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes updateOrganizationSettings with error', done => { - const client = new securityCenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const organizationSettings = {}; - const request = { - organizationSettings: organizationSettings, - }; - - // Mock Grpc layer - client._innerApiCalls.updateOrganizationSettings = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.updateOrganizationSettings(request, (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - - describe('updateSource', () => { - it('invokes updateSource without error', done => { - const client = new securityCenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const source = {}; - const request = { - source: source, - }; - - // Mock response - const name = 'name3373707'; - const displayName = 'displayName1615086568'; - const description = 'description-1724546052'; - const expectedResponse = { - name: name, - displayName: displayName, - description: description, - }; - - // Mock Grpc layer - client._innerApiCalls.updateSource = mockSimpleGrpcMethod( - request, - expectedResponse - ); - - client.updateSource(request, (err, response) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes updateSource with error', done => { - const client = new securityCenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const source = {}; - const request = { - source: source, - }; - - // Mock Grpc layer - client._innerApiCalls.updateSource = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.updateSource(request, (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - - describe('updateSecurityMarks', () => { - it('invokes updateSecurityMarks without error', done => { - const client = new securityCenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const securityMarks = {}; - const request = { - securityMarks: securityMarks, - }; - - // Mock response - const name = 'name3373707'; - const expectedResponse = { - name: name, - }; - - // Mock Grpc layer - client._innerApiCalls.updateSecurityMarks = mockSimpleGrpcMethod( - request, - expectedResponse - ); - - client.updateSecurityMarks(request, (err, response) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes updateSecurityMarks with error', done => { - const client = new securityCenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const securityMarks = {}; - const request = { - securityMarks: securityMarks, - }; - - // Mock Grpc layer - client._innerApiCalls.updateSecurityMarks = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.updateSecurityMarks(request, (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); -}); - -function mockSimpleGrpcMethod(expectedRequest, response, error) { - return function(actualRequest, options, callback) { - assert.deepStrictEqual(actualRequest, expectedRequest); - if (error) { - callback(error); - } else if (response) { - callback(null, response); - } else { - callback(null); - } - }; -} - -function mockLongRunningGrpcMethod(expectedRequest, response, error) { - return request => { - assert.deepStrictEqual(request, expectedRequest); - const mockOperation = { - promise: function() { - return new Promise((resolve, reject) => { - if (error) { - reject(error); - } else { - resolve([response]); - } - }); - }, - }; - return Promise.resolve([mockOperation]); - }; -} diff --git a/packages/google-cloud-securitycenter/tsconfig.json b/packages/google-cloud-securitycenter/tsconfig.json new file mode 100644 index 00000000000..613d35597b5 --- /dev/null +++ b/packages/google-cloud-securitycenter/tsconfig.json @@ -0,0 +1,19 @@ +{ + "extends": "./node_modules/gts/tsconfig-google.json", + "compilerOptions": { + "rootDir": ".", + "outDir": "build", + "resolveJsonModule": true, + "lib": [ + "es2016", + "dom" + ] + }, + "include": [ + "src/*.ts", + "src/**/*.ts", + "test/*.ts", + "test/**/*.ts", + "system-test/*.ts" + ] +} diff --git a/packages/google-cloud-securitycenter/tslint.json b/packages/google-cloud-securitycenter/tslint.json new file mode 100644 index 00000000000..617dc975bae --- /dev/null +++ b/packages/google-cloud-securitycenter/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "gts/tslint.json" +} diff --git a/packages/google-cloud-securitycenter/webpack.config.js b/packages/google-cloud-securitycenter/webpack.config.js index 287e48a6635..043de2c77cd 100644 --- a/packages/google-cloud-securitycenter/webpack.config.js +++ b/packages/google-cloud-securitycenter/webpack.config.js @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// Copyright 2019 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -12,10 +12,12 @@ // See the License for the specific language governing permissions and // limitations under the License. +const path = require('path'); + module.exports = { - entry: './src/browser.js', + entry: './src/index.ts', output: { - library: 'security-center', + library: 'SecurityCenter', filename: './security-center.js', }, node: { @@ -24,20 +26,36 @@ module.exports = { crypto: 'empty', }, resolve: { - extensions: ['.js', '.json'], + alias: { + '../../../package.json': path.resolve(__dirname, 'package.json'), + }, + extensions: ['.js', '.json', '.ts'], }, module: { rules: [ { - test: /node_modules[\\/]retry-request[\\/]/, + 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[\\/]/, + test: /node_modules[\\/]https?-proxy-agent/, use: 'null-loader', }, { - test: /node_modules[\\/]gtoken[\\/]/, + test: /node_modules[\\/]gtoken/, use: 'null-loader', }, ], From 5c73d096570b5b454dfd168877bc6a769bde4da9 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 5 Feb 2020 11:25:38 -0800 Subject: [PATCH 134/342] chore: release 3.0.0 (#204) --- packages/google-cloud-securitycenter/CHANGELOG.md | 11 +++++++++++ packages/google-cloud-securitycenter/package.json | 2 +- .../google-cloud-securitycenter/samples/package.json | 2 +- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-securitycenter/CHANGELOG.md b/packages/google-cloud-securitycenter/CHANGELOG.md index c46c18930b4..ee1a204b356 100644 --- a/packages/google-cloud-securitycenter/CHANGELOG.md +++ b/packages/google-cloud-securitycenter/CHANGELOG.md @@ -4,6 +4,17 @@ [1]: https://www.npmjs.com/package/@google-cloud/security-center?activeTab=versions +## [3.0.0](https://www.github.com/googleapis/nodejs-security-center/compare/v2.3.2...v3.0.0) (2020-02-05) + + +### ⚠ BREAKING CHANGES + +* convert library to TypeScript, adding v1p1beta1 import (#198) + +### Features + +* convert library to TypeScript, adding v1p1beta1 import ([#198](https://www.github.com/googleapis/nodejs-security-center/issues/198)) ([0adb7d0](https://www.github.com/googleapis/nodejs-security-center/commit/0adb7d0ea27a07ba0ad0ee235ddfde1f44cd3c24)) + ### [2.3.2](https://www.github.com/googleapis/nodejs-security-center/compare/v2.3.1...v2.3.2) (2020-01-28) diff --git a/packages/google-cloud-securitycenter/package.json b/packages/google-cloud-securitycenter/package.json index a5e7bff7dc7..379393c2908 100644 --- a/packages/google-cloud-securitycenter/package.json +++ b/packages/google-cloud-securitycenter/package.json @@ -1,7 +1,7 @@ { "name": "@google-cloud/security-center", "description": "Cloud Security Command Center API client for Node.js", - "version": "2.3.2", + "version": "3.0.0", "license": "Apache-2.0", "author": "Google LLC", "engines": { diff --git a/packages/google-cloud-securitycenter/samples/package.json b/packages/google-cloud-securitycenter/samples/package.json index 7229bf7087d..1a60ea610a8 100644 --- a/packages/google-cloud-securitycenter/samples/package.json +++ b/packages/google-cloud-securitycenter/samples/package.json @@ -13,7 +13,7 @@ }, "license": "Apache-2.0", "dependencies": { - "@google-cloud/security-center": "^2.3.2" + "@google-cloud/security-center": "^3.0.0" }, "devDependencies": { "chai": "^4.2.0", From fec27b5092fc206cf594522b901a5b08ccb5deec Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Fri, 7 Feb 2020 10:31:42 -0800 Subject: [PATCH 135/342] fix: pass x-goog-request-params header for streaming calls --- .../src/v1/security_center_client.ts | 320 ++++++++------- .../src/v1beta1/security_center_client.ts | 270 +++++++------ .../src/v1p1beta1/security_center_client.ts | 382 ++++++++++-------- .../synth.metadata | 9 +- 4 files changed, 555 insertions(+), 426 deletions(-) diff --git a/packages/google-cloud-securitycenter/src/v1/security_center_client.ts b/packages/google-cloud-securitycenter/src/v1/security_center_client.ts index 120c54cd8ae..fd760cfe395 100644 --- a/packages/google-cloud-securitycenter/src/v1/security_center_client.ts +++ b/packages/google-cloud-securitycenter/src/v1/security_center_client.ts @@ -144,26 +144,26 @@ export class SecurityCenterClient { // identifiers to uniquely identify resources within the API. // Create useful helper objects for these. this._pathTemplates = { - organizationAssetPathTemplate: new gaxModule.PathTemplate( - 'organizations/{organization}/assets/{asset}/securityMarks' - ), - organizationSourceFindingPathTemplate: new gaxModule.PathTemplate( - 'organizations/{organization}/sources/{source}/findings/{finding}/securityMarks' + assetPathTemplate: new gaxModule.PathTemplate( + 'organizations/{organization}/assets/{asset}' ), findingPathTemplate: new gaxModule.PathTemplate( 'organizations/{organization}/sources/{source}/findings/{finding}' ), - sourcePathTemplate: new gaxModule.PathTemplate( - 'organizations/{organization}/sources/{source}' + organizationPathTemplate: new gaxModule.PathTemplate( + 'organizations/{organization}' ), - assetPathTemplate: new gaxModule.PathTemplate( - 'organizations/{organization}/assets/{asset}' + organizationAssetPathTemplate: new gaxModule.PathTemplate( + 'organizations/{organization}/assets/{asset}/securityMarks' ), organizationSettingsPathTemplate: new gaxModule.PathTemplate( 'organizations/{organization}/organizationSettings' ), - organizationPathTemplate: new gaxModule.PathTemplate( - 'organizations/{organization}' + organizationSourceFindingPathTemplate: new gaxModule.PathTemplate( + 'organizations/{organization}/sources/{source}/findings/{finding}/securityMarks' + ), + sourcePathTemplate: new gaxModule.PathTemplate( + 'organizations/{organization}/sources/{source}' ), }; @@ -1772,9 +1772,17 @@ export class SecurityCenterClient { */ groupAssetsStream( request?: protosTypes.google.cloud.securitycenter.v1.IGroupAssetsRequest, - options?: gax.CallOptions | {} + options?: gax.CallOptions ): Transform { request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); const callSettings = new gax.CallSettings(options); return this._descriptors.page.groupAssets.createStream( this._innerApiCalls.groupAssets as gax.GaxCall, @@ -2096,9 +2104,17 @@ export class SecurityCenterClient { */ groupFindingsStream( request?: protosTypes.google.cloud.securitycenter.v1.IGroupFindingsRequest, - options?: gax.CallOptions | {} + options?: gax.CallOptions ): Transform { request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); const callSettings = new gax.CallSettings(options); return this._descriptors.page.groupFindings.createStream( this._innerApiCalls.groupFindings as gax.GaxCall, @@ -2456,9 +2472,17 @@ export class SecurityCenterClient { */ listAssetsStream( request?: protosTypes.google.cloud.securitycenter.v1.IListAssetsRequest, - options?: gax.CallOptions | {} + options?: gax.CallOptions ): Transform { request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); const callSettings = new gax.CallSettings(options); return this._descriptors.page.listAssets.createStream( this._innerApiCalls.listAssets as gax.GaxCall, @@ -2789,9 +2813,17 @@ export class SecurityCenterClient { */ listFindingsStream( request?: protosTypes.google.cloud.securitycenter.v1.IListFindingsRequest, - options?: gax.CallOptions | {} + options?: gax.CallOptions ): Transform { request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); const callSettings = new gax.CallSettings(options); return this._descriptors.page.listFindings.createStream( this._innerApiCalls.listFindings as gax.GaxCall, @@ -2923,9 +2955,17 @@ export class SecurityCenterClient { */ listSourcesStream( request?: protosTypes.google.cloud.securitycenter.v1.IListSourcesRequest, - options?: gax.CallOptions | {} + options?: gax.CallOptions ): Transform { request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); const callSettings = new gax.CallSettings(options); return this._descriptors.page.listSources.createStream( this._innerApiCalls.listSources as gax.GaxCall, @@ -2938,108 +2978,39 @@ export class SecurityCenterClient { // -------------------- /** - * Return a fully-qualified organizationAsset resource name string. + * Return a fully-qualified asset resource name string. * * @param {string} organization * @param {string} asset * @returns {string} Resource name string. */ - organizationAssetPath(organization: string, asset: string) { - return this._pathTemplates.organizationAssetPathTemplate.render({ + assetPath(organization: string, asset: string) { + return this._pathTemplates.assetPathTemplate.render({ organization, asset, }); } /** - * Parse the organization from OrganizationAsset resource. + * Parse the organization from Asset resource. * - * @param {string} organizationAssetName - * A fully-qualified path representing organization_asset resource. + * @param {string} assetName + * A fully-qualified path representing Asset resource. * @returns {string} A string representing the organization. */ - matchOrganizationFromOrganizationAssetName(organizationAssetName: string) { - return this._pathTemplates.organizationAssetPathTemplate.match( - organizationAssetName - ).organization; + matchOrganizationFromAssetName(assetName: string) { + return this._pathTemplates.assetPathTemplate.match(assetName).organization; } /** - * Parse the asset from OrganizationAsset resource. + * Parse the asset from Asset resource. * - * @param {string} organizationAssetName - * A fully-qualified path representing organization_asset resource. + * @param {string} assetName + * A fully-qualified path representing Asset resource. * @returns {string} A string representing the asset. */ - matchAssetFromOrganizationAssetName(organizationAssetName: string) { - return this._pathTemplates.organizationAssetPathTemplate.match( - organizationAssetName - ).asset; - } - - /** - * Return a fully-qualified organizationSourceFinding resource name string. - * - * @param {string} organization - * @param {string} source - * @param {string} finding - * @returns {string} Resource name string. - */ - organizationSourceFindingPath( - organization: string, - source: string, - finding: string - ) { - return this._pathTemplates.organizationSourceFindingPathTemplate.render({ - organization, - source, - finding, - }); - } - - /** - * Parse the organization from OrganizationSourceFinding resource. - * - * @param {string} organizationSourceFindingName - * A fully-qualified path representing organization_source_finding resource. - * @returns {string} A string representing the organization. - */ - matchOrganizationFromOrganizationSourceFindingName( - organizationSourceFindingName: string - ) { - return this._pathTemplates.organizationSourceFindingPathTemplate.match( - organizationSourceFindingName - ).organization; - } - - /** - * Parse the source from OrganizationSourceFinding resource. - * - * @param {string} organizationSourceFindingName - * A fully-qualified path representing organization_source_finding resource. - * @returns {string} A string representing the source. - */ - matchSourceFromOrganizationSourceFindingName( - organizationSourceFindingName: string - ) { - return this._pathTemplates.organizationSourceFindingPathTemplate.match( - organizationSourceFindingName - ).source; - } - - /** - * Parse the finding from OrganizationSourceFinding resource. - * - * @param {string} organizationSourceFindingName - * A fully-qualified path representing organization_source_finding resource. - * @returns {string} A string representing the finding. - */ - matchFindingFromOrganizationSourceFindingName( - organizationSourceFindingName: string - ) { - return this._pathTemplates.organizationSourceFindingPathTemplate.match( - organizationSourceFindingName - ).finding; + matchAssetFromAssetName(assetName: string) { + return this._pathTemplates.assetPathTemplate.match(assetName).asset; } /** @@ -3093,76 +3064,67 @@ export class SecurityCenterClient { } /** - * Return a fully-qualified source resource name string. + * Return a fully-qualified organization resource name string. * * @param {string} organization - * @param {string} source * @returns {string} Resource name string. */ - sourcePath(organization: string, source: string) { - return this._pathTemplates.sourcePathTemplate.render({ + organizationPath(organization: string) { + return this._pathTemplates.organizationPathTemplate.render({ organization, - source, }); } /** - * Parse the organization from Source resource. + * Parse the organization from Organization resource. * - * @param {string} sourceName - * A fully-qualified path representing Source resource. + * @param {string} organizationName + * A fully-qualified path representing Organization resource. * @returns {string} A string representing the organization. */ - matchOrganizationFromSourceName(sourceName: string) { - return this._pathTemplates.sourcePathTemplate.match(sourceName) + matchOrganizationFromOrganizationName(organizationName: string) { + return this._pathTemplates.organizationPathTemplate.match(organizationName) .organization; } /** - * Parse the source from Source resource. - * - * @param {string} sourceName - * A fully-qualified path representing Source resource. - * @returns {string} A string representing the source. - */ - matchSourceFromSourceName(sourceName: string) { - return this._pathTemplates.sourcePathTemplate.match(sourceName).source; - } - - /** - * Return a fully-qualified asset resource name string. + * Return a fully-qualified organizationAsset resource name string. * * @param {string} organization * @param {string} asset * @returns {string} Resource name string. */ - assetPath(organization: string, asset: string) { - return this._pathTemplates.assetPathTemplate.render({ + organizationAssetPath(organization: string, asset: string) { + return this._pathTemplates.organizationAssetPathTemplate.render({ organization, asset, }); } /** - * Parse the organization from Asset resource. + * Parse the organization from OrganizationAsset resource. * - * @param {string} assetName - * A fully-qualified path representing Asset resource. + * @param {string} organizationAssetName + * A fully-qualified path representing organization_asset resource. * @returns {string} A string representing the organization. */ - matchOrganizationFromAssetName(assetName: string) { - return this._pathTemplates.assetPathTemplate.match(assetName).organization; + matchOrganizationFromOrganizationAssetName(organizationAssetName: string) { + return this._pathTemplates.organizationAssetPathTemplate.match( + organizationAssetName + ).organization; } /** - * Parse the asset from Asset resource. + * Parse the asset from OrganizationAsset resource. * - * @param {string} assetName - * A fully-qualified path representing Asset resource. + * @param {string} organizationAssetName + * A fully-qualified path representing organization_asset resource. * @returns {string} A string representing the asset. */ - matchAssetFromAssetName(assetName: string) { - return this._pathTemplates.assetPathTemplate.match(assetName).asset; + matchAssetFromOrganizationAssetName(organizationAssetName: string) { + return this._pathTemplates.organizationAssetPathTemplate.match( + organizationAssetName + ).asset; } /** @@ -3193,29 +3155,107 @@ export class SecurityCenterClient { } /** - * Return a fully-qualified organization resource name string. + * Return a fully-qualified organizationSourceFinding resource name string. * * @param {string} organization + * @param {string} source + * @param {string} finding * @returns {string} Resource name string. */ - organizationPath(organization: string) { - return this._pathTemplates.organizationPathTemplate.render({ + organizationSourceFindingPath( + organization: string, + source: string, + finding: string + ) { + return this._pathTemplates.organizationSourceFindingPathTemplate.render({ organization, + source, + finding, }); } /** - * Parse the organization from Organization resource. + * Parse the organization from OrganizationSourceFinding resource. * - * @param {string} organizationName - * A fully-qualified path representing Organization resource. + * @param {string} organizationSourceFindingName + * A fully-qualified path representing organization_source_finding resource. * @returns {string} A string representing the organization. */ - matchOrganizationFromOrganizationName(organizationName: string) { - return this._pathTemplates.organizationPathTemplate.match(organizationName) + matchOrganizationFromOrganizationSourceFindingName( + organizationSourceFindingName: string + ) { + return this._pathTemplates.organizationSourceFindingPathTemplate.match( + organizationSourceFindingName + ).organization; + } + + /** + * Parse the source from OrganizationSourceFinding resource. + * + * @param {string} organizationSourceFindingName + * A fully-qualified path representing organization_source_finding resource. + * @returns {string} A string representing the source. + */ + matchSourceFromOrganizationSourceFindingName( + organizationSourceFindingName: string + ) { + return this._pathTemplates.organizationSourceFindingPathTemplate.match( + organizationSourceFindingName + ).source; + } + + /** + * Parse the finding from OrganizationSourceFinding resource. + * + * @param {string} organizationSourceFindingName + * A fully-qualified path representing organization_source_finding resource. + * @returns {string} A string representing the finding. + */ + matchFindingFromOrganizationSourceFindingName( + organizationSourceFindingName: string + ) { + return this._pathTemplates.organizationSourceFindingPathTemplate.match( + organizationSourceFindingName + ).finding; + } + + /** + * Return a fully-qualified source resource name string. + * + * @param {string} organization + * @param {string} source + * @returns {string} Resource name string. + */ + sourcePath(organization: string, source: string) { + return this._pathTemplates.sourcePathTemplate.render({ + organization, + source, + }); + } + + /** + * Parse the organization from Source resource. + * + * @param {string} sourceName + * A fully-qualified path representing Source resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromSourceName(sourceName: string) { + return this._pathTemplates.sourcePathTemplate.match(sourceName) .organization; } + /** + * Parse the source from Source resource. + * + * @param {string} sourceName + * A fully-qualified path representing Source resource. + * @returns {string} A string representing the source. + */ + matchSourceFromSourceName(sourceName: string) { + return this._pathTemplates.sourcePathTemplate.match(sourceName).source; + } + /** * Terminate the GRPC channel and close the client. * diff --git a/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.ts b/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.ts index 4758d24a627..7833c90ee49 100644 --- a/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.ts +++ b/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.ts @@ -144,24 +144,24 @@ export class SecurityCenterClient { // identifiers to uniquely identify resources within the API. // Create useful helper objects for these. this._pathTemplates = { + findingPathTemplate: new gaxModule.PathTemplate( + 'organizations/{organization}/sources/{source}/findings/{finding}' + ), + organizationPathTemplate: new gaxModule.PathTemplate( + 'organizations/{organization}' + ), organizationAssetPathTemplate: new gaxModule.PathTemplate( 'organizations/{organization}/assets/{asset}/securityMarks' ), + organizationSettingsPathTemplate: new gaxModule.PathTemplate( + 'organizations/{organization}/organizationSettings' + ), organizationSourceFindingPathTemplate: new gaxModule.PathTemplate( 'organizations/{organization}/sources/{source}/findings/{finding}/securityMarks' ), - findingPathTemplate: new gaxModule.PathTemplate( - 'organizations/{organization}/sources/{source}/findings/{finding}' - ), sourcePathTemplate: new gaxModule.PathTemplate( 'organizations/{organization}/sources/{source}' ), - organizationSettingsPathTemplate: new gaxModule.PathTemplate( - 'organizations/{organization}/organizationSettings' - ), - organizationPathTemplate: new gaxModule.PathTemplate( - 'organizations/{organization}' - ), }; // Some of the methods on this service return "paged" results, @@ -1684,9 +1684,17 @@ export class SecurityCenterClient { */ groupAssetsStream( request?: protosTypes.google.cloud.securitycenter.v1beta1.IGroupAssetsRequest, - options?: gax.CallOptions | {} + options?: gax.CallOptions ): Transform { request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); const callSettings = new gax.CallSettings(options); return this._descriptors.page.groupAssets.createStream( this._innerApiCalls.groupAssets as gax.GaxCall, @@ -1912,9 +1920,17 @@ export class SecurityCenterClient { */ groupFindingsStream( request?: protosTypes.google.cloud.securitycenter.v1beta1.IGroupFindingsRequest, - options?: gax.CallOptions | {} + options?: gax.CallOptions ): Transform { request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); const callSettings = new gax.CallSettings(options); return this._descriptors.page.groupFindings.createStream( this._innerApiCalls.groupFindings as gax.GaxCall, @@ -2186,9 +2202,17 @@ export class SecurityCenterClient { */ listAssetsStream( request?: protosTypes.google.cloud.securitycenter.v1beta1.IListAssetsRequest, - options?: gax.CallOptions | {} + options?: gax.CallOptions ): Transform { request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); const callSettings = new gax.CallSettings(options); return this._descriptors.page.listAssets.createStream( this._innerApiCalls.listAssets as gax.GaxCall, @@ -2413,9 +2437,17 @@ export class SecurityCenterClient { */ listFindingsStream( request?: protosTypes.google.cloud.securitycenter.v1beta1.IListFindingsRequest, - options?: gax.CallOptions | {} + options?: gax.CallOptions ): Transform { request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); const callSettings = new gax.CallSettings(options); return this._descriptors.page.listFindings.createStream( this._innerApiCalls.listFindings as gax.GaxCall, @@ -2547,9 +2579,17 @@ export class SecurityCenterClient { */ listSourcesStream( request?: protosTypes.google.cloud.securitycenter.v1beta1.IListSourcesRequest, - options?: gax.CallOptions | {} + options?: gax.CallOptions ): Transform { request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); const callSettings = new gax.CallSettings(options); return this._descriptors.page.listSources.createStream( this._innerApiCalls.listSources as gax.GaxCall, @@ -2561,6 +2601,80 @@ export class SecurityCenterClient { // -- Path templates -- // -------------------- + /** + * Return a fully-qualified finding resource name string. + * + * @param {string} organization + * @param {string} source + * @param {string} finding + * @returns {string} Resource name string. + */ + findingPath(organization: string, source: string, finding: string) { + return this._pathTemplates.findingPathTemplate.render({ + organization, + source, + finding, + }); + } + + /** + * Parse the organization from Finding resource. + * + * @param {string} findingName + * A fully-qualified path representing Finding resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromFindingName(findingName: string) { + return this._pathTemplates.findingPathTemplate.match(findingName) + .organization; + } + + /** + * Parse the source from Finding resource. + * + * @param {string} findingName + * A fully-qualified path representing Finding resource. + * @returns {string} A string representing the source. + */ + matchSourceFromFindingName(findingName: string) { + return this._pathTemplates.findingPathTemplate.match(findingName).source; + } + + /** + * Parse the finding from Finding resource. + * + * @param {string} findingName + * A fully-qualified path representing Finding resource. + * @returns {string} A string representing the finding. + */ + matchFindingFromFindingName(findingName: string) { + return this._pathTemplates.findingPathTemplate.match(findingName).finding; + } + + /** + * Return a fully-qualified organization resource name string. + * + * @param {string} organization + * @returns {string} Resource name string. + */ + organizationPath(organization: string) { + return this._pathTemplates.organizationPathTemplate.render({ + organization, + }); + } + + /** + * Parse the organization from Organization resource. + * + * @param {string} organizationName + * A fully-qualified path representing Organization resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationName(organizationName: string) { + return this._pathTemplates.organizationPathTemplate.match(organizationName) + .organization; + } + /** * Return a fully-qualified organizationAsset resource name string. * @@ -2601,6 +2715,33 @@ export class SecurityCenterClient { ).asset; } + /** + * Return a fully-qualified organizationSettings resource name string. + * + * @param {string} organization + * @returns {string} Resource name string. + */ + organizationSettingsPath(organization: string) { + return this._pathTemplates.organizationSettingsPathTemplate.render({ + organization, + }); + } + + /** + * Parse the organization from OrganizationSettings resource. + * + * @param {string} organizationSettingsName + * A fully-qualified path representing OrganizationSettings resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationSettingsName( + organizationSettingsName: string + ) { + return this._pathTemplates.organizationSettingsPathTemplate.match( + organizationSettingsName + ).organization; + } + /** * Return a fully-qualified organizationSourceFinding resource name string. * @@ -2666,56 +2807,6 @@ export class SecurityCenterClient { ).finding; } - /** - * Return a fully-qualified finding resource name string. - * - * @param {string} organization - * @param {string} source - * @param {string} finding - * @returns {string} Resource name string. - */ - findingPath(organization: string, source: string, finding: string) { - return this._pathTemplates.findingPathTemplate.render({ - organization, - source, - finding, - }); - } - - /** - * Parse the organization from Finding resource. - * - * @param {string} findingName - * A fully-qualified path representing Finding resource. - * @returns {string} A string representing the organization. - */ - matchOrganizationFromFindingName(findingName: string) { - return this._pathTemplates.findingPathTemplate.match(findingName) - .organization; - } - - /** - * Parse the source from Finding resource. - * - * @param {string} findingName - * A fully-qualified path representing Finding resource. - * @returns {string} A string representing the source. - */ - matchSourceFromFindingName(findingName: string) { - return this._pathTemplates.findingPathTemplate.match(findingName).source; - } - - /** - * Parse the finding from Finding resource. - * - * @param {string} findingName - * A fully-qualified path representing Finding resource. - * @returns {string} A string representing the finding. - */ - matchFindingFromFindingName(findingName: string) { - return this._pathTemplates.findingPathTemplate.match(findingName).finding; - } - /** * Return a fully-qualified source resource name string. * @@ -2753,57 +2844,6 @@ export class SecurityCenterClient { return this._pathTemplates.sourcePathTemplate.match(sourceName).source; } - /** - * Return a fully-qualified organizationSettings resource name string. - * - * @param {string} organization - * @returns {string} Resource name string. - */ - organizationSettingsPath(organization: string) { - return this._pathTemplates.organizationSettingsPathTemplate.render({ - organization, - }); - } - - /** - * Parse the organization from OrganizationSettings resource. - * - * @param {string} organizationSettingsName - * A fully-qualified path representing OrganizationSettings resource. - * @returns {string} A string representing the organization. - */ - matchOrganizationFromOrganizationSettingsName( - organizationSettingsName: string - ) { - return this._pathTemplates.organizationSettingsPathTemplate.match( - organizationSettingsName - ).organization; - } - - /** - * Return a fully-qualified organization resource name string. - * - * @param {string} organization - * @returns {string} Resource name string. - */ - organizationPath(organization: string) { - return this._pathTemplates.organizationPathTemplate.render({ - organization, - }); - } - - /** - * Parse the organization from Organization resource. - * - * @param {string} organizationName - * A fully-qualified path representing Organization resource. - * @returns {string} A string representing the organization. - */ - matchOrganizationFromOrganizationName(organizationName: string) { - return this._pathTemplates.organizationPathTemplate.match(organizationName) - .organization; - } - /** * Terminate the GRPC channel and close the client. * diff --git a/packages/google-cloud-securitycenter/src/v1p1beta1/security_center_client.ts b/packages/google-cloud-securitycenter/src/v1p1beta1/security_center_client.ts index 13d3a8e785f..5c074f05680 100644 --- a/packages/google-cloud-securitycenter/src/v1p1beta1/security_center_client.ts +++ b/packages/google-cloud-securitycenter/src/v1p1beta1/security_center_client.ts @@ -144,29 +144,29 @@ export class SecurityCenterClient { // identifiers to uniquely identify resources within the API. // Create useful helper objects for these. this._pathTemplates = { - organizationAssetPathTemplate: new gaxModule.PathTemplate( - 'organizations/{organization}/assets/{asset}/securityMarks' - ), - organizationSourceFindingPathTemplate: new gaxModule.PathTemplate( - 'organizations/{organization}/sources/{source}/findings/{finding}/securityMarks' - ), assetPathTemplate: new gaxModule.PathTemplate( 'organizations/{organization}/assets/{asset}' ), findingPathTemplate: new gaxModule.PathTemplate( 'organizations/{organization}/sources/{source}/findings/{finding}' ), - sourcePathTemplate: new gaxModule.PathTemplate( - 'organizations/{organization}/sources/{source}' - ), notificationConfigPathTemplate: new gaxModule.PathTemplate( 'organizations/{organization}/notificationConfigs/{notification_config}' ), + organizationPathTemplate: new gaxModule.PathTemplate( + 'organizations/{organization}' + ), + organizationAssetPathTemplate: new gaxModule.PathTemplate( + 'organizations/{organization}/assets/{asset}/securityMarks' + ), organizationSettingsPathTemplate: new gaxModule.PathTemplate( 'organizations/{organization}/organizationSettings' ), - organizationPathTemplate: new gaxModule.PathTemplate( - 'organizations/{organization}' + organizationSourceFindingPathTemplate: new gaxModule.PathTemplate( + 'organizations/{organization}/sources/{source}/findings/{finding}/securityMarks' + ), + sourcePathTemplate: new gaxModule.PathTemplate( + 'organizations/{organization}/sources/{source}' ), }; @@ -2156,9 +2156,17 @@ export class SecurityCenterClient { */ groupAssetsStream( request?: protosTypes.google.cloud.securitycenter.v1p1beta1.IGroupAssetsRequest, - options?: gax.CallOptions | {} + options?: gax.CallOptions ): Transform { request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); const callSettings = new gax.CallSettings(options); return this._descriptors.page.groupAssets.createStream( this._innerApiCalls.groupAssets as gax.GaxCall, @@ -2488,9 +2496,17 @@ export class SecurityCenterClient { */ groupFindingsStream( request?: protosTypes.google.cloud.securitycenter.v1p1beta1.IGroupFindingsRequest, - options?: gax.CallOptions | {} + options?: gax.CallOptions ): Transform { request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); const callSettings = new gax.CallSettings(options); return this._descriptors.page.groupFindings.createStream( this._innerApiCalls.groupFindings as gax.GaxCall, @@ -2858,9 +2874,17 @@ export class SecurityCenterClient { */ listAssetsStream( request?: protosTypes.google.cloud.securitycenter.v1p1beta1.IListAssetsRequest, - options?: gax.CallOptions | {} + options?: gax.CallOptions ): Transform { request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); const callSettings = new gax.CallSettings(options); return this._descriptors.page.listAssets.createStream( this._innerApiCalls.listAssets as gax.GaxCall, @@ -3201,9 +3225,17 @@ export class SecurityCenterClient { */ listFindingsStream( request?: protosTypes.google.cloud.securitycenter.v1p1beta1.IListFindingsRequest, - options?: gax.CallOptions | {} + options?: gax.CallOptions ): Transform { request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); const callSettings = new gax.CallSettings(options); return this._descriptors.page.listFindings.createStream( this._innerApiCalls.listFindings as gax.GaxCall, @@ -3339,9 +3371,17 @@ export class SecurityCenterClient { */ listNotificationConfigsStream( request?: protosTypes.google.cloud.securitycenter.v1p1beta1.IListNotificationConfigsRequest, - options?: gax.CallOptions | {} + options?: gax.CallOptions ): Transform { request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); const callSettings = new gax.CallSettings(options); return this._descriptors.page.listNotificationConfigs.createStream( this._innerApiCalls.listNotificationConfigs as gax.GaxCall, @@ -3473,9 +3513,17 @@ export class SecurityCenterClient { */ listSourcesStream( request?: protosTypes.google.cloud.securitycenter.v1p1beta1.IListSourcesRequest, - options?: gax.CallOptions | {} + options?: gax.CallOptions ): Transform { request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); const callSettings = new gax.CallSettings(options); return this._descriptors.page.listSources.createStream( this._innerApiCalls.listSources as gax.GaxCall, @@ -3487,111 +3535,6 @@ export class SecurityCenterClient { // -- Path templates -- // -------------------- - /** - * Return a fully-qualified organizationAsset resource name string. - * - * @param {string} organization - * @param {string} asset - * @returns {string} Resource name string. - */ - organizationAssetPath(organization: string, asset: string) { - return this._pathTemplates.organizationAssetPathTemplate.render({ - organization, - asset, - }); - } - - /** - * Parse the organization from OrganizationAsset resource. - * - * @param {string} organizationAssetName - * A fully-qualified path representing organization_asset resource. - * @returns {string} A string representing the organization. - */ - matchOrganizationFromOrganizationAssetName(organizationAssetName: string) { - return this._pathTemplates.organizationAssetPathTemplate.match( - organizationAssetName - ).organization; - } - - /** - * Parse the asset from OrganizationAsset resource. - * - * @param {string} organizationAssetName - * A fully-qualified path representing organization_asset resource. - * @returns {string} A string representing the asset. - */ - matchAssetFromOrganizationAssetName(organizationAssetName: string) { - return this._pathTemplates.organizationAssetPathTemplate.match( - organizationAssetName - ).asset; - } - - /** - * Return a fully-qualified organizationSourceFinding resource name string. - * - * @param {string} organization - * @param {string} source - * @param {string} finding - * @returns {string} Resource name string. - */ - organizationSourceFindingPath( - organization: string, - source: string, - finding: string - ) { - return this._pathTemplates.organizationSourceFindingPathTemplate.render({ - organization, - source, - finding, - }); - } - - /** - * Parse the organization from OrganizationSourceFinding resource. - * - * @param {string} organizationSourceFindingName - * A fully-qualified path representing organization_source_finding resource. - * @returns {string} A string representing the organization. - */ - matchOrganizationFromOrganizationSourceFindingName( - organizationSourceFindingName: string - ) { - return this._pathTemplates.organizationSourceFindingPathTemplate.match( - organizationSourceFindingName - ).organization; - } - - /** - * Parse the source from OrganizationSourceFinding resource. - * - * @param {string} organizationSourceFindingName - * A fully-qualified path representing organization_source_finding resource. - * @returns {string} A string representing the source. - */ - matchSourceFromOrganizationSourceFindingName( - organizationSourceFindingName: string - ) { - return this._pathTemplates.organizationSourceFindingPathTemplate.match( - organizationSourceFindingName - ).source; - } - - /** - * Parse the finding from OrganizationSourceFinding resource. - * - * @param {string} organizationSourceFindingName - * A fully-qualified path representing organization_source_finding resource. - * @returns {string} A string representing the finding. - */ - matchFindingFromOrganizationSourceFindingName( - organizationSourceFindingName: string - ) { - return this._pathTemplates.organizationSourceFindingPathTemplate.match( - organizationSourceFindingName - ).finding; - } - /** * Return a fully-qualified asset resource name string. * @@ -3678,43 +3621,6 @@ export class SecurityCenterClient { return this._pathTemplates.findingPathTemplate.match(findingName).finding; } - /** - * Return a fully-qualified source resource name string. - * - * @param {string} organization - * @param {string} source - * @returns {string} Resource name string. - */ - sourcePath(organization: string, source: string) { - return this._pathTemplates.sourcePathTemplate.render({ - organization, - source, - }); - } - - /** - * Parse the organization from Source resource. - * - * @param {string} sourceName - * A fully-qualified path representing Source resource. - * @returns {string} A string representing the organization. - */ - matchOrganizationFromSourceName(sourceName: string) { - return this._pathTemplates.sourcePathTemplate.match(sourceName) - .organization; - } - - /** - * Parse the source from Source resource. - * - * @param {string} sourceName - * A fully-qualified path representing Source resource. - * @returns {string} A string representing the source. - */ - matchSourceFromSourceName(sourceName: string) { - return this._pathTemplates.sourcePathTemplate.match(sourceName).source; - } - /** * Return a fully-qualified notificationConfig resource name string. * @@ -3757,6 +3663,70 @@ export class SecurityCenterClient { ).notification_config; } + /** + * Return a fully-qualified organization resource name string. + * + * @param {string} organization + * @returns {string} Resource name string. + */ + organizationPath(organization: string) { + return this._pathTemplates.organizationPathTemplate.render({ + organization, + }); + } + + /** + * Parse the organization from Organization resource. + * + * @param {string} organizationName + * A fully-qualified path representing Organization resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationName(organizationName: string) { + return this._pathTemplates.organizationPathTemplate.match(organizationName) + .organization; + } + + /** + * Return a fully-qualified organizationAsset resource name string. + * + * @param {string} organization + * @param {string} asset + * @returns {string} Resource name string. + */ + organizationAssetPath(organization: string, asset: string) { + return this._pathTemplates.organizationAssetPathTemplate.render({ + organization, + asset, + }); + } + + /** + * Parse the organization from OrganizationAsset resource. + * + * @param {string} organizationAssetName + * A fully-qualified path representing organization_asset resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationAssetName(organizationAssetName: string) { + return this._pathTemplates.organizationAssetPathTemplate.match( + organizationAssetName + ).organization; + } + + /** + * Parse the asset from OrganizationAsset resource. + * + * @param {string} organizationAssetName + * A fully-qualified path representing organization_asset resource. + * @returns {string} A string representing the asset. + */ + matchAssetFromOrganizationAssetName(organizationAssetName: string) { + return this._pathTemplates.organizationAssetPathTemplate.match( + organizationAssetName + ).asset; + } + /** * Return a fully-qualified organizationSettings resource name string. * @@ -3785,29 +3755,107 @@ export class SecurityCenterClient { } /** - * Return a fully-qualified organization resource name string. + * Return a fully-qualified organizationSourceFinding resource name string. * * @param {string} organization + * @param {string} source + * @param {string} finding * @returns {string} Resource name string. */ - organizationPath(organization: string) { - return this._pathTemplates.organizationPathTemplate.render({ + organizationSourceFindingPath( + organization: string, + source: string, + finding: string + ) { + return this._pathTemplates.organizationSourceFindingPathTemplate.render({ organization, + source, + finding, }); } /** - * Parse the organization from Organization resource. + * Parse the organization from OrganizationSourceFinding resource. * - * @param {string} organizationName - * A fully-qualified path representing Organization resource. + * @param {string} organizationSourceFindingName + * A fully-qualified path representing organization_source_finding resource. * @returns {string} A string representing the organization. */ - matchOrganizationFromOrganizationName(organizationName: string) { - return this._pathTemplates.organizationPathTemplate.match(organizationName) + matchOrganizationFromOrganizationSourceFindingName( + organizationSourceFindingName: string + ) { + return this._pathTemplates.organizationSourceFindingPathTemplate.match( + organizationSourceFindingName + ).organization; + } + + /** + * Parse the source from OrganizationSourceFinding resource. + * + * @param {string} organizationSourceFindingName + * A fully-qualified path representing organization_source_finding resource. + * @returns {string} A string representing the source. + */ + matchSourceFromOrganizationSourceFindingName( + organizationSourceFindingName: string + ) { + return this._pathTemplates.organizationSourceFindingPathTemplate.match( + organizationSourceFindingName + ).source; + } + + /** + * Parse the finding from OrganizationSourceFinding resource. + * + * @param {string} organizationSourceFindingName + * A fully-qualified path representing organization_source_finding resource. + * @returns {string} A string representing the finding. + */ + matchFindingFromOrganizationSourceFindingName( + organizationSourceFindingName: string + ) { + return this._pathTemplates.organizationSourceFindingPathTemplate.match( + organizationSourceFindingName + ).finding; + } + + /** + * Return a fully-qualified source resource name string. + * + * @param {string} organization + * @param {string} source + * @returns {string} Resource name string. + */ + sourcePath(organization: string, source: string) { + return this._pathTemplates.sourcePathTemplate.render({ + organization, + source, + }); + } + + /** + * Parse the organization from Source resource. + * + * @param {string} sourceName + * A fully-qualified path representing Source resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromSourceName(sourceName: string) { + return this._pathTemplates.sourcePathTemplate.match(sourceName) .organization; } + /** + * Parse the source from Source resource. + * + * @param {string} sourceName + * A fully-qualified path representing Source resource. + * @returns {string} A string representing the source. + */ + matchSourceFromSourceName(sourceName: string) { + return this._pathTemplates.sourcePathTemplate.match(sourceName).source; + } + /** * Terminate the GRPC channel and close the client. * diff --git a/packages/google-cloud-securitycenter/synth.metadata b/packages/google-cloud-securitycenter/synth.metadata index 907828fe4bb..ae1fc9ecd32 100644 --- a/packages/google-cloud-securitycenter/synth.metadata +++ b/packages/google-cloud-securitycenter/synth.metadata @@ -1,19 +1,20 @@ { - "updateTime": "2020-02-05T17:41:36.417979Z", + "updateTime": "2020-02-07T12:36:41.727505Z", "sources": [ { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "a8ed9d921fdddc61d8467bfd7c1668f0ad90435c", - "internalRef": "293257997" + "sha": "e46f761cd6ec15a9e3d5ed4ff321a4bcba8e8585", + "internalRef": "293710856", + "log": "e46f761cd6ec15a9e3d5ed4ff321a4bcba8e8585\nGenerate the Bazel build file for recommendengine public api\n\nPiperOrigin-RevId: 293710856\n\n68477017c4173c98addac0373950c6aa9d7b375f\nMake `language_code` optional for UpdateIntentRequest and BatchUpdateIntentsRequest.\n\nThe comments and proto annotations describe this parameter as optional.\n\nPiperOrigin-RevId: 293703548\n\n16f823f578bca4e845a19b88bb9bc5870ea71ab2\nAdd BUILD.bazel files for managedidentities API\n\nPiperOrigin-RevId: 293698246\n\n2f53fd8178c9a9de4ad10fae8dd17a7ba36133f2\nAdd v1p1beta1 config file\n\nPiperOrigin-RevId: 293696729\n\n052b274138fce2be80f97b6dcb83ab343c7c8812\nAdd source field for user event and add field behavior annotations\n\nPiperOrigin-RevId: 293693115\n\n1e89732b2d69151b1b3418fff3d4cc0434f0dded\ndatacatalog: v1beta1 add three new RPCs to gapic v1beta1 config\n\nPiperOrigin-RevId: 293692823\n\n9c8bd09bbdc7c4160a44f1fbab279b73cd7a2337\nchange the name of AccessApproval service to AccessApprovalAdmin\n\nPiperOrigin-RevId: 293690934\n\n2e23b8fbc45f5d9e200572ca662fe1271bcd6760\nAdd ListEntryGroups method, add http bindings to support entry group tagging, and update some comments.\n\nPiperOrigin-RevId: 293666452\n\n0275e38a4ca03a13d3f47a9613aac8c8b0d3f1f2\nAdd proto_package field to managedidentities API. It is needed for APIs that still depend on artman generation.\n\nPiperOrigin-RevId: 293643323\n\n4cdfe8278cb6f308106580d70648001c9146e759\nRegenerating public protos for Data Catalog to add new Custom Type Entry feature.\n\nPiperOrigin-RevId: 293614782\n\n45d2a569ab526a1fad3720f95eefb1c7330eaada\nEnable client generation for v1 ManagedIdentities API.\n\nPiperOrigin-RevId: 293515675\n\n2c17086b77e6f3bcf04a1f65758dfb0c3da1568f\nAdd the Actions on Google common types (//google/actions/type/*).\n\nPiperOrigin-RevId: 293478245\n\n781aadb932e64a12fb6ead7cd842698d99588433\nDialogflow weekly v2/v2beta1 library update:\n- Documentation updates\nImportant updates are also posted at\nhttps://cloud.google.com/dialogflow/docs/release-notes\n\nPiperOrigin-RevId: 293443396\n\ne2602608c9138c2fca24162720e67f9307c30b95\nDialogflow weekly v2/v2beta1 library update:\n- Documentation updates\nImportant updates are also posted at\nhttps://cloud.google.com/dialogflow/docs/release-notes\n\nPiperOrigin-RevId: 293442964\n\nc8aef82028d06b7992278fa9294c18570dc86c3d\nAdd cc_proto_library and cc_grpc_library targets for Bigtable protos.\n\nAlso fix indentation of cc_grpc_library targets in Spanner and IAM protos.\n\nPiperOrigin-RevId: 293440538\n\ne2faab04f4cb7f9755072330866689b1943a16e9\ncloudtasks: v2 replace non-standard retry params in gapic config v2\n\nPiperOrigin-RevId: 293424055\n\ndfb4097ea628a8470292c6590a4313aee0c675bd\nerrorreporting: v1beta1 add legacy artman config for php\n\nPiperOrigin-RevId: 293423790\n\nb18aed55b45bfe5b62476292c72759e6c3e573c6\nasset: v1p1beta1 updated comment for `page_size` limit.\n\nPiperOrigin-RevId: 293421386\n\nc9ef36b7956d9859a2fc86ad35fcaa16958ab44f\nbazel: Refactor CI build scripts\n\nPiperOrigin-RevId: 293387911\n\n" } }, { "template": { "name": "node_library", "origin": "synthtool.gcp", - "version": "2019.10.17" + "version": "2020.2.4" } } ], From 6203a0ed9b4395422701e198125705667b071b0f Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Fri, 7 Feb 2020 12:52:44 -0800 Subject: [PATCH 136/342] chore: release 3.0.1 (#208) --- packages/google-cloud-securitycenter/CHANGELOG.md | 7 +++++++ packages/google-cloud-securitycenter/package.json | 2 +- packages/google-cloud-securitycenter/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-securitycenter/CHANGELOG.md b/packages/google-cloud-securitycenter/CHANGELOG.md index ee1a204b356..9c7d629f343 100644 --- a/packages/google-cloud-securitycenter/CHANGELOG.md +++ b/packages/google-cloud-securitycenter/CHANGELOG.md @@ -4,6 +4,13 @@ [1]: https://www.npmjs.com/package/@google-cloud/security-center?activeTab=versions +### [3.0.1](https://www.github.com/googleapis/nodejs-security-center/compare/v3.0.0...v3.0.1) (2020-02-07) + + +### Bug Fixes + +* pass x-goog-request-params header for streaming calls ([c73e1b6](https://www.github.com/googleapis/nodejs-security-center/commit/c73e1b688367377a2c879d3ad9b000b91588dcd3)) + ## [3.0.0](https://www.github.com/googleapis/nodejs-security-center/compare/v2.3.2...v3.0.0) (2020-02-05) diff --git a/packages/google-cloud-securitycenter/package.json b/packages/google-cloud-securitycenter/package.json index 379393c2908..1a6ed58a58b 100644 --- a/packages/google-cloud-securitycenter/package.json +++ b/packages/google-cloud-securitycenter/package.json @@ -1,7 +1,7 @@ { "name": "@google-cloud/security-center", "description": "Cloud Security Command Center API client for Node.js", - "version": "3.0.0", + "version": "3.0.1", "license": "Apache-2.0", "author": "Google LLC", "engines": { diff --git a/packages/google-cloud-securitycenter/samples/package.json b/packages/google-cloud-securitycenter/samples/package.json index 1a60ea610a8..4c8b30e3181 100644 --- a/packages/google-cloud-securitycenter/samples/package.json +++ b/packages/google-cloud-securitycenter/samples/package.json @@ -13,7 +13,7 @@ }, "license": "Apache-2.0", "dependencies": { - "@google-cloud/security-center": "^3.0.0" + "@google-cloud/security-center": "^3.0.1" }, "devDependencies": { "chai": "^4.2.0", From 66604d03d91c91c6be12cd93c69001183b351e8f Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Sat, 8 Feb 2020 06:15:25 +0100 Subject: [PATCH 137/342] chore(deps): update dependency @types/mocha to v7 (#205) Co-authored-by: Benjamin E. Coe --- packages/google-cloud-securitycenter/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-securitycenter/package.json b/packages/google-cloud-securitycenter/package.json index 1a6ed58a58b..56c4f5523bc 100644 --- a/packages/google-cloud-securitycenter/package.json +++ b/packages/google-cloud-securitycenter/package.json @@ -43,7 +43,7 @@ "google-gax": "^1.14.1" }, "devDependencies": { - "@types/mocha": "^5.2.5", + "@types/mocha": "^7.0.0", "@types/node": "^12.0.0", "c8": "^7.0.0", "eslint": "^6.0.0", From ae00a5fd71c01d1ed71dee6c331e05fa71b96fde Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Sat, 8 Feb 2020 15:34:07 -0800 Subject: [PATCH 138/342] chore: update package namespaces (#209) --- .../google/cloud/securitycenter/v1p1beta1/asset.proto | 2 +- .../google/cloud/securitycenter/v1p1beta1/finding.proto | 2 +- .../securitycenter/v1p1beta1/notification_config.proto | 2 +- .../securitycenter/v1p1beta1/notification_message.proto | 2 +- .../securitycenter/v1p1beta1/organization_settings.proto | 2 +- .../v1p1beta1/run_asset_discovery_response.proto | 2 +- .../cloud/securitycenter/v1p1beta1/security_marks.proto | 2 +- .../securitycenter/v1p1beta1/securitycenter_service.proto | 2 +- .../google/cloud/securitycenter/v1p1beta1/source.proto | 2 +- packages/google-cloud-securitycenter/protos/protos.json | 2 +- packages/google-cloud-securitycenter/synth.metadata | 8 ++++---- 11 files changed, 14 insertions(+), 14 deletions(-) diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/asset.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/asset.proto index d06a82bafca..3e4b26a8415 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/asset.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/asset.proto @@ -28,7 +28,7 @@ option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/ option java_multiple_files = true; option java_package = "com.google.cloud.securitycenter.v1p1beta1"; option php_namespace = "Google\\Cloud\\SecurityCenter\\V1p1beta1"; -option ruby_package = "Google::Cloud::SecurityCenter::V1p1Beta1"; +option ruby_package = "Google::Cloud::SecurityCenter::V1p1beta1"; // Cloud Security Command Center's (Cloud SCC) representation of a Google Cloud // Platform (GCP) resource. diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/finding.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/finding.proto index abd77df7d11..6428027df6a 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/finding.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/finding.proto @@ -29,7 +29,7 @@ option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/ option java_multiple_files = true; option java_package = "com.google.cloud.securitycenter.v1p1beta1"; option php_namespace = "Google\\Cloud\\SecurityCenter\\V1p1beta1"; -option ruby_package = "Google::Cloud::SecurityCenter::V1p1Beta1"; +option ruby_package = "Google::Cloud::SecurityCenter::V1p1beta1"; // Cloud Security Command Center (Cloud SCC) finding. // diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/notification_config.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/notification_config.proto index c114e52c83e..7cbb87b24b1 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/notification_config.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/notification_config.proto @@ -26,7 +26,7 @@ option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/ option java_multiple_files = true; option java_package = "com.google.cloud.securitycenter.v1p1beta1"; option php_namespace = "Google\\Cloud\\SecurityCenter\\V1p1beta1"; -option ruby_package = "Google::Cloud::SecurityCenter::V1p1Beta1"; +option ruby_package = "Google::Cloud::SecurityCenter::V1p1beta1"; // The Pub/Sub Topic resource definition is in google/cloud/pubsub/v1/, // but we do not import that proto directly; therefore, we redefine the diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/notification_message.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/notification_message.proto index ad0c50a270a..3abbcef32af 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/notification_message.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/notification_message.proto @@ -26,7 +26,7 @@ option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/ option java_multiple_files = true; option java_package = "com.google.cloud.securitycenter.v1p1beta1"; option php_namespace = "Google\\Cloud\\SecurityCenter\\V1p1beta1"; -option ruby_package = "Google::Cloud::SecurityCenter::V1p1Beta1"; +option ruby_package = "Google::Cloud::SecurityCenter::V1p1beta1"; // Cloud SCC's Notification message NotificationMessage { diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/organization_settings.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/organization_settings.proto index 325f5f34313..9c38b87ba0b 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/organization_settings.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/organization_settings.proto @@ -25,7 +25,7 @@ option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/ option java_multiple_files = true; option java_package = "com.google.cloud.securitycenter.v1p1beta1"; option php_namespace = "Google\\Cloud\\SecurityCenter\\V1p1beta1"; -option ruby_package = "Google::Cloud::SecurityCenter::V1p1Beta1"; +option ruby_package = "Google::Cloud::SecurityCenter::V1p1beta1"; // User specified settings that are attached to the Cloud Security Command // Center (Cloud SCC) organization. diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/run_asset_discovery_response.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/run_asset_discovery_response.proto index beff3d5e75d..b8b9ea489ed 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/run_asset_discovery_response.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/run_asset_discovery_response.proto @@ -25,7 +25,7 @@ option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/ option java_multiple_files = true; option java_package = "com.google.cloud.securitycenter.v1p1beta1"; option php_namespace = "Google\\Cloud\\SecurityCenter\\V1p1beta1"; -option ruby_package = "Google::Cloud::SecurityCenter::V1p1Beta1"; +option ruby_package = "Google::Cloud::SecurityCenter::V1p1beta1"; // Response of asset discovery run message RunAssetDiscoveryResponse { diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/security_marks.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/security_marks.proto index c6a721704ca..ac54bc19a4f 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/security_marks.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/security_marks.proto @@ -25,7 +25,7 @@ option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/ option java_multiple_files = true; option java_package = "com.google.cloud.securitycenter.v1p1beta1"; option php_namespace = "Google\\Cloud\\SecurityCenter\\V1p1beta1"; -option ruby_package = "Google::Cloud::SecurityCenter::V1p1Beta1"; +option ruby_package = "Google::Cloud::SecurityCenter::V1p1beta1"; // User specified security marks that are attached to the parent Cloud Security // Command Center (Cloud SCC) resource. Security marks are scoped within a Cloud diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/securitycenter_service.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/securitycenter_service.proto index 728213e2919..dcd9af68361 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/securitycenter_service.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/securitycenter_service.proto @@ -43,7 +43,7 @@ option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/ option java_multiple_files = true; option java_package = "com.google.cloud.securitycenter.v1p1beta1"; option php_namespace = "Google\\Cloud\\SecurityCenter\\V1p1beta1"; -option ruby_package = "Google::Cloud::SecurityCenter::V1p1Beta1"; +option ruby_package = "Google::Cloud::SecurityCenter::V1p1beta1"; // V1p1Beta1 APIs for Security Center service. service SecurityCenter { diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/source.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/source.proto index 875c2433ef5..d591a05cce4 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/source.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/source.proto @@ -25,7 +25,7 @@ option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/ option java_multiple_files = true; option java_package = "com.google.cloud.securitycenter.v1p1beta1"; option php_namespace = "Google\\Cloud\\SecurityCenter\\V1p1beta1"; -option ruby_package = "Google::Cloud::SecurityCenter::V1p1Beta1"; +option ruby_package = "Google::Cloud::SecurityCenter::V1p1beta1"; // Cloud Security Command Center's (Cloud SCC) finding source. A finding source // is an entity or a mechanism that can produce a finding. A source is like a diff --git a/packages/google-cloud-securitycenter/protos/protos.json b/packages/google-cloud-securitycenter/protos/protos.json index 710bd97d120..8a300d7912b 100644 --- a/packages/google-cloud-securitycenter/protos/protos.json +++ b/packages/google-cloud-securitycenter/protos/protos.json @@ -1856,7 +1856,7 @@ "java_multiple_files": true, "java_package": "com.google.cloud.securitycenter.v1p1beta1", "php_namespace": "Google\\Cloud\\SecurityCenter\\V1p1beta1", - "ruby_package": "Google::Cloud::SecurityCenter::V1p1Beta1", + "ruby_package": "Google::Cloud::SecurityCenter::V1p1beta1", "(google.api.resource_definition).type": "pubsub.googleapis.com/Topic", "(google.api.resource_definition).pattern": "projects/{project}/topics/{topic}" }, diff --git a/packages/google-cloud-securitycenter/synth.metadata b/packages/google-cloud-securitycenter/synth.metadata index ae1fc9ecd32..d4d0ea9ed83 100644 --- a/packages/google-cloud-securitycenter/synth.metadata +++ b/packages/google-cloud-securitycenter/synth.metadata @@ -1,13 +1,13 @@ { - "updateTime": "2020-02-07T12:36:41.727505Z", + "updateTime": "2020-02-08T12:35:46.813250Z", "sources": [ { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "e46f761cd6ec15a9e3d5ed4ff321a4bcba8e8585", - "internalRef": "293710856", - "log": "e46f761cd6ec15a9e3d5ed4ff321a4bcba8e8585\nGenerate the Bazel build file for recommendengine public api\n\nPiperOrigin-RevId: 293710856\n\n68477017c4173c98addac0373950c6aa9d7b375f\nMake `language_code` optional for UpdateIntentRequest and BatchUpdateIntentsRequest.\n\nThe comments and proto annotations describe this parameter as optional.\n\nPiperOrigin-RevId: 293703548\n\n16f823f578bca4e845a19b88bb9bc5870ea71ab2\nAdd BUILD.bazel files for managedidentities API\n\nPiperOrigin-RevId: 293698246\n\n2f53fd8178c9a9de4ad10fae8dd17a7ba36133f2\nAdd v1p1beta1 config file\n\nPiperOrigin-RevId: 293696729\n\n052b274138fce2be80f97b6dcb83ab343c7c8812\nAdd source field for user event and add field behavior annotations\n\nPiperOrigin-RevId: 293693115\n\n1e89732b2d69151b1b3418fff3d4cc0434f0dded\ndatacatalog: v1beta1 add three new RPCs to gapic v1beta1 config\n\nPiperOrigin-RevId: 293692823\n\n9c8bd09bbdc7c4160a44f1fbab279b73cd7a2337\nchange the name of AccessApproval service to AccessApprovalAdmin\n\nPiperOrigin-RevId: 293690934\n\n2e23b8fbc45f5d9e200572ca662fe1271bcd6760\nAdd ListEntryGroups method, add http bindings to support entry group tagging, and update some comments.\n\nPiperOrigin-RevId: 293666452\n\n0275e38a4ca03a13d3f47a9613aac8c8b0d3f1f2\nAdd proto_package field to managedidentities API. It is needed for APIs that still depend on artman generation.\n\nPiperOrigin-RevId: 293643323\n\n4cdfe8278cb6f308106580d70648001c9146e759\nRegenerating public protos for Data Catalog to add new Custom Type Entry feature.\n\nPiperOrigin-RevId: 293614782\n\n45d2a569ab526a1fad3720f95eefb1c7330eaada\nEnable client generation for v1 ManagedIdentities API.\n\nPiperOrigin-RevId: 293515675\n\n2c17086b77e6f3bcf04a1f65758dfb0c3da1568f\nAdd the Actions on Google common types (//google/actions/type/*).\n\nPiperOrigin-RevId: 293478245\n\n781aadb932e64a12fb6ead7cd842698d99588433\nDialogflow weekly v2/v2beta1 library update:\n- Documentation updates\nImportant updates are also posted at\nhttps://cloud.google.com/dialogflow/docs/release-notes\n\nPiperOrigin-RevId: 293443396\n\ne2602608c9138c2fca24162720e67f9307c30b95\nDialogflow weekly v2/v2beta1 library update:\n- Documentation updates\nImportant updates are also posted at\nhttps://cloud.google.com/dialogflow/docs/release-notes\n\nPiperOrigin-RevId: 293442964\n\nc8aef82028d06b7992278fa9294c18570dc86c3d\nAdd cc_proto_library and cc_grpc_library targets for Bigtable protos.\n\nAlso fix indentation of cc_grpc_library targets in Spanner and IAM protos.\n\nPiperOrigin-RevId: 293440538\n\ne2faab04f4cb7f9755072330866689b1943a16e9\ncloudtasks: v2 replace non-standard retry params in gapic config v2\n\nPiperOrigin-RevId: 293424055\n\ndfb4097ea628a8470292c6590a4313aee0c675bd\nerrorreporting: v1beta1 add legacy artman config for php\n\nPiperOrigin-RevId: 293423790\n\nb18aed55b45bfe5b62476292c72759e6c3e573c6\nasset: v1p1beta1 updated comment for `page_size` limit.\n\nPiperOrigin-RevId: 293421386\n\nc9ef36b7956d9859a2fc86ad35fcaa16958ab44f\nbazel: Refactor CI build scripts\n\nPiperOrigin-RevId: 293387911\n\n" + "sha": "e7d8a694f4559201e6913f6610069cb08b39274e", + "internalRef": "293903652", + "log": "e7d8a694f4559201e6913f6610069cb08b39274e\nDepend on the latest gapic-generator and resource names plugin.\n\nThis fixes the very old an very annoying bug: https://github.com/googleapis/gapic-generator/pull/3087\n\nPiperOrigin-RevId: 293903652\n\n806b2854a966d55374ee26bb0cef4e30eda17b58\nfix: correct capitalization of Ruby namespaces in SecurityCenter V1p1beta1\n\nPiperOrigin-RevId: 293903613\n\n1b83c92462b14d67a7644e2980f723112472e03a\nPublish annotations and grpc service config for Logging API.\n\nPiperOrigin-RevId: 293893514\n\n" } }, { From 56985c03bea25581c31a0481718a2d3a52daceb4 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Mon, 10 Feb 2020 18:05:02 +0100 Subject: [PATCH 139/342] chore(deps): update dependency linkinator to v2 --- packages/google-cloud-securitycenter/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-securitycenter/package.json b/packages/google-cloud-securitycenter/package.json index 56c4f5523bc..b28b27216a5 100644 --- a/packages/google-cloud-securitycenter/package.json +++ b/packages/google-cloud-securitycenter/package.json @@ -54,7 +54,7 @@ "jsdoc": "^3.6.2", "jsdoc-fresh": "^1.0.1", "jsdoc-region-tag": "^1.0.2", - "linkinator": "^1.5.0", + "linkinator": "^2.0.0", "mocha": "^7.0.0", "null-loader": "^3.0.0", "pack-n-play": "^1.0.0-2", From 41f8eef5019bca79a8d064aca1911ff5257878a1 Mon Sep 17 00:00:00 2001 From: "Benjamin E. Coe" Date: Tue, 11 Feb 2020 22:35:53 -0800 Subject: [PATCH 140/342] build: add GitHub actions config for unit tests * build: add GitHub actions config for unit tests * chore: link root directory before linting * chore: also need to npm i --- packages/google-cloud-securitycenter/package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/google-cloud-securitycenter/package.json b/packages/google-cloud-securitycenter/package.json index b28b27216a5..1b26c3dbe68 100644 --- a/packages/google-cloud-securitycenter/package.json +++ b/packages/google-cloud-securitycenter/package.json @@ -24,7 +24,8 @@ "prepare": "npm run compile", "system-test": "c8 mocha build/system-test", "test": "c8 mocha build/test", - "samples-test": "cd samples/ && npm link ../ && npm test && cd ../" + "samples-test": "cd samples/ && npm link ../ && npm test && cd ../", + "prelint": "cd samples; npm link ../; npm i" }, "keywords": [ "google apis client", From 923aee344fd83552d46d8ec1560b37e83e59b24c Mon Sep 17 00:00:00 2001 From: tdh911 Date: Thu, 20 Feb 2020 12:43:13 -0800 Subject: [PATCH 141/342] docs: Add v1p1beta1 notifications samples (#214) --- packages/google-cloud-securitycenter/samples/package.json | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/google-cloud-securitycenter/samples/package.json b/packages/google-cloud-securitycenter/samples/package.json index 4c8b30e3181..a3e79fb625d 100644 --- a/packages/google-cloud-securitycenter/samples/package.json +++ b/packages/google-cloud-securitycenter/samples/package.json @@ -13,10 +13,12 @@ }, "license": "Apache-2.0", "dependencies": { + "@google-cloud/pubsub": "^1.5.0", "@google-cloud/security-center": "^3.0.1" }, "devDependencies": { "chai": "^4.2.0", - "mocha": "^7.0.0" + "mocha": "^7.0.0", + "uuid": "^3.4.0" } } From 79a5f9f55b21cca82b2a15459284dd9688438276 Mon Sep 17 00:00:00 2001 From: Xiaozhen Liu Date: Wed, 26 Feb 2020 15:58:00 -0800 Subject: [PATCH 142/342] feat: export protos in src/index.ts --- packages/google-cloud-securitycenter/src/index.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/google-cloud-securitycenter/src/index.ts b/packages/google-cloud-securitycenter/src/index.ts index 00c5d09fec7..9078fa15e8e 100644 --- a/packages/google-cloud-securitycenter/src/index.ts +++ b/packages/google-cloud-securitycenter/src/index.ts @@ -27,3 +27,5 @@ const SecurityCenterClient = v1.SecurityCenterClient; // For compatibility with JavaScript libraries we need to provide this default export: // tslint:disable-next-line no-default-export export default {v1, v1beta1, v1p1beta1, SecurityCenterClient}; +import * as protos from '../protos/protos'; +export {protos}; From cc817d42db1b4ae66bb0c4ce0f14c70b4fbf9168 Mon Sep 17 00:00:00 2001 From: Summer Ji Date: Thu, 27 Feb 2020 11:56:18 -0800 Subject: [PATCH 143/342] chore: update jsdoc.js (#221) --- packages/google-cloud-securitycenter/.jsdoc.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-securitycenter/.jsdoc.js b/packages/google-cloud-securitycenter/.jsdoc.js index 003c8f9fc11..c974fa72ca8 100644 --- a/packages/google-cloud-securitycenter/.jsdoc.js +++ b/packages/google-cloud-securitycenter/.jsdoc.js @@ -36,11 +36,14 @@ module.exports = { includePattern: '\\.js$' }, templates: { - copyright: 'Copyright 2018 Google, LLC.', + copyright: 'Copyright 2019 Google, LLC.', includeDate: false, sourceFiles: false, systemName: '@google-cloud/security-center', - theme: 'lumen' + theme: 'lumen', + default: { + "outputSourceFiles": false + } }, markdown: { idInHeadings: true From c7f2ad34edf6e735cb95c6a9f956c4e8e7d2751a Mon Sep 17 00:00:00 2001 From: Summer Ji Date: Fri, 28 Feb 2020 21:29:04 -0800 Subject: [PATCH 144/342] chore: match jsdoc with macro license (#225) --- packages/google-cloud-securitycenter/.jsdoc.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/google-cloud-securitycenter/.jsdoc.js b/packages/google-cloud-securitycenter/.jsdoc.js index c974fa72ca8..89cb2d2ffa7 100644 --- a/packages/google-cloud-securitycenter/.jsdoc.js +++ b/packages/google-cloud-securitycenter/.jsdoc.js @@ -12,6 +12,9 @@ // See the License for the specific language governing permissions and // limitations under the License. // +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** 'use strict'; From b56bf8e96af20c999d09e340275ff3c93c028c28 Mon Sep 17 00:00:00 2001 From: Summer Ji Date: Fri, 28 Feb 2020 21:37:49 -0800 Subject: [PATCH 145/342] chore: correct .jsdoc.js protos and double quotes (#223) * chore: update jsdoc - protos and double quote * chore: update jsdoc - protos and double quote Co-authored-by: Alexander Fenster --- packages/google-cloud-securitycenter/.jsdoc.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-securitycenter/.jsdoc.js b/packages/google-cloud-securitycenter/.jsdoc.js index 89cb2d2ffa7..f0f6eea651e 100644 --- a/packages/google-cloud-securitycenter/.jsdoc.js +++ b/packages/google-cloud-securitycenter/.jsdoc.js @@ -34,7 +34,8 @@ module.exports = { source: { excludePattern: '(^|\\/|\\\\)[._]', include: [ - 'build/src' + 'build/src', + 'protos' ], includePattern: '\\.js$' }, @@ -45,7 +46,7 @@ module.exports = { systemName: '@google-cloud/security-center', theme: 'lumen', default: { - "outputSourceFiles": false + outputSourceFiles: false } }, markdown: { From 39eb616cb6eb3d3606623f21453a5a3714b4db12 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Sat, 29 Feb 2020 10:57:16 -0800 Subject: [PATCH 146/342] fix: updated timeout in service config --- .../src/v1/security_center_client_config.json | 36 +++++++-------- .../security_center_client_config.json | 36 +++++++-------- .../security_center_client_config.json | 46 +++++++++---------- .../synth.metadata | 8 ++-- 4 files changed, 63 insertions(+), 63 deletions(-) diff --git a/packages/google-cloud-securitycenter/src/v1/security_center_client_config.json b/packages/google-cloud-securitycenter/src/v1/security_center_client_config.json index 3f61d526acc..3fbeac794f2 100644 --- a/packages/google-cloud-securitycenter/src/v1/security_center_client_config.json +++ b/packages/google-cloud-securitycenter/src/v1/security_center_client_config.json @@ -21,92 +21,92 @@ }, "methods": { "CreateSource": { - "timeout_millis": 600000, + "timeout_millis": 60000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, "CreateFinding": { - "timeout_millis": 600000, + "timeout_millis": 60000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, "GetIamPolicy": { - "timeout_millis": 600000, + "timeout_millis": 60000, "retry_codes_name": "idempotent", "retry_params_name": "default" }, "GetOrganizationSettings": { - "timeout_millis": 600000, + "timeout_millis": 60000, "retry_codes_name": "idempotent", "retry_params_name": "default" }, "GetSource": { - "timeout_millis": 600000, + "timeout_millis": 60000, "retry_codes_name": "idempotent", "retry_params_name": "default" }, "GroupAssets": { - "timeout_millis": 600000, + "timeout_millis": 60000, "retry_codes_name": "idempotent", "retry_params_name": "default" }, "GroupFindings": { - "timeout_millis": 600000, + "timeout_millis": 60000, "retry_codes_name": "idempotent", "retry_params_name": "default" }, "ListAssets": { - "timeout_millis": 600000, + "timeout_millis": 60000, "retry_codes_name": "idempotent", "retry_params_name": "default" }, "ListFindings": { - "timeout_millis": 600000, + "timeout_millis": 60000, "retry_codes_name": "idempotent", "retry_params_name": "default" }, "ListSources": { - "timeout_millis": 600000, + "timeout_millis": 60000, "retry_codes_name": "idempotent", "retry_params_name": "default" }, "RunAssetDiscovery": { - "timeout_millis": 600000, + "timeout_millis": 60000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, "SetFindingState": { - "timeout_millis": 600000, + "timeout_millis": 60000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, "SetIamPolicy": { - "timeout_millis": 600000, + "timeout_millis": 60000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, "TestIamPermissions": { - "timeout_millis": 600000, + "timeout_millis": 60000, "retry_codes_name": "idempotent", "retry_params_name": "default" }, "UpdateFinding": { - "timeout_millis": 600000, + "timeout_millis": 60000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, "UpdateOrganizationSettings": { - "timeout_millis": 600000, + "timeout_millis": 60000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, "UpdateSource": { - "timeout_millis": 600000, + "timeout_millis": 60000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, "UpdateSecurityMarks": { - "timeout_millis": 600000, + "timeout_millis": 60000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" } diff --git a/packages/google-cloud-securitycenter/src/v1beta1/security_center_client_config.json b/packages/google-cloud-securitycenter/src/v1beta1/security_center_client_config.json index 4a2e6c90fa1..6f485a0f232 100644 --- a/packages/google-cloud-securitycenter/src/v1beta1/security_center_client_config.json +++ b/packages/google-cloud-securitycenter/src/v1beta1/security_center_client_config.json @@ -21,92 +21,92 @@ }, "methods": { "CreateSource": { - "timeout_millis": 600000, + "timeout_millis": 60000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, "CreateFinding": { - "timeout_millis": 600000, + "timeout_millis": 60000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, "GetIamPolicy": { - "timeout_millis": 600000, + "timeout_millis": 60000, "retry_codes_name": "idempotent", "retry_params_name": "default" }, "GetOrganizationSettings": { - "timeout_millis": 600000, + "timeout_millis": 60000, "retry_codes_name": "idempotent", "retry_params_name": "default" }, "GetSource": { - "timeout_millis": 600000, + "timeout_millis": 60000, "retry_codes_name": "idempotent", "retry_params_name": "default" }, "GroupAssets": { - "timeout_millis": 600000, + "timeout_millis": 60000, "retry_codes_name": "idempotent", "retry_params_name": "default" }, "GroupFindings": { - "timeout_millis": 600000, + "timeout_millis": 60000, "retry_codes_name": "idempotent", "retry_params_name": "default" }, "ListAssets": { - "timeout_millis": 600000, + "timeout_millis": 60000, "retry_codes_name": "idempotent", "retry_params_name": "default" }, "ListFindings": { - "timeout_millis": 600000, + "timeout_millis": 60000, "retry_codes_name": "idempotent", "retry_params_name": "default" }, "ListSources": { - "timeout_millis": 600000, + "timeout_millis": 60000, "retry_codes_name": "idempotent", "retry_params_name": "default" }, "RunAssetDiscovery": { - "timeout_millis": 600000, + "timeout_millis": 60000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, "SetFindingState": { - "timeout_millis": 600000, + "timeout_millis": 60000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, "SetIamPolicy": { - "timeout_millis": 600000, + "timeout_millis": 60000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, "TestIamPermissions": { - "timeout_millis": 600000, + "timeout_millis": 60000, "retry_codes_name": "idempotent", "retry_params_name": "default" }, "UpdateFinding": { - "timeout_millis": 600000, + "timeout_millis": 60000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, "UpdateOrganizationSettings": { - "timeout_millis": 600000, + "timeout_millis": 60000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, "UpdateSource": { - "timeout_millis": 600000, + "timeout_millis": 60000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, "UpdateSecurityMarks": { - "timeout_millis": 600000, + "timeout_millis": 60000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" } diff --git a/packages/google-cloud-securitycenter/src/v1p1beta1/security_center_client_config.json b/packages/google-cloud-securitycenter/src/v1p1beta1/security_center_client_config.json index 3d47939eb43..e7f4077497a 100644 --- a/packages/google-cloud-securitycenter/src/v1p1beta1/security_center_client_config.json +++ b/packages/google-cloud-securitycenter/src/v1p1beta1/security_center_client_config.json @@ -21,117 +21,117 @@ }, "methods": { "CreateSource": { - "timeout_millis": 600000, + "timeout_millis": 60000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, "CreateFinding": { - "timeout_millis": 600000, + "timeout_millis": 60000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, "CreateNotificationConfig": { - "timeout_millis": 600000, + "timeout_millis": 60000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, "DeleteNotificationConfig": { - "timeout_millis": 600000, + "timeout_millis": 60000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, "GetIamPolicy": { - "timeout_millis": 600000, + "timeout_millis": 60000, "retry_codes_name": "idempotent", "retry_params_name": "default" }, "GetNotificationConfig": { - "timeout_millis": 600000, + "timeout_millis": 60000, "retry_codes_name": "idempotent", "retry_params_name": "default" }, "GetOrganizationSettings": { - "timeout_millis": 600000, + "timeout_millis": 60000, "retry_codes_name": "idempotent", "retry_params_name": "default" }, "GetSource": { - "timeout_millis": 600000, + "timeout_millis": 60000, "retry_codes_name": "idempotent", "retry_params_name": "default" }, "GroupAssets": { - "timeout_millis": 600000, + "timeout_millis": 60000, "retry_codes_name": "idempotent", "retry_params_name": "default" }, "GroupFindings": { - "timeout_millis": 600000, + "timeout_millis": 60000, "retry_codes_name": "idempotent", "retry_params_name": "default" }, "ListAssets": { - "timeout_millis": 600000, + "timeout_millis": 60000, "retry_codes_name": "idempotent", "retry_params_name": "default" }, "ListFindings": { - "timeout_millis": 600000, + "timeout_millis": 60000, "retry_codes_name": "idempotent", "retry_params_name": "default" }, "ListNotificationConfigs": { - "timeout_millis": 600000, + "timeout_millis": 60000, "retry_codes_name": "idempotent", "retry_params_name": "default" }, "ListSources": { - "timeout_millis": 600000, + "timeout_millis": 60000, "retry_codes_name": "idempotent", "retry_params_name": "default" }, "RunAssetDiscovery": { - "timeout_millis": 600000, + "timeout_millis": 60000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, "SetFindingState": { - "timeout_millis": 600000, + "timeout_millis": 60000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, "SetIamPolicy": { - "timeout_millis": 600000, + "timeout_millis": 60000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, "TestIamPermissions": { - "timeout_millis": 600000, + "timeout_millis": 60000, "retry_codes_name": "idempotent", "retry_params_name": "default" }, "UpdateFinding": { - "timeout_millis": 600000, + "timeout_millis": 60000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, "UpdateNotificationConfig": { - "timeout_millis": 600000, + "timeout_millis": 60000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, "UpdateOrganizationSettings": { - "timeout_millis": 600000, + "timeout_millis": 60000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, "UpdateSource": { - "timeout_millis": 600000, + "timeout_millis": 60000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, "UpdateSecurityMarks": { - "timeout_millis": 600000, + "timeout_millis": 60000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" } diff --git a/packages/google-cloud-securitycenter/synth.metadata b/packages/google-cloud-securitycenter/synth.metadata index d4d0ea9ed83..43091c5dbe1 100644 --- a/packages/google-cloud-securitycenter/synth.metadata +++ b/packages/google-cloud-securitycenter/synth.metadata @@ -1,13 +1,13 @@ { - "updateTime": "2020-02-08T12:35:46.813250Z", + "updateTime": "2020-02-29T12:42:02.170282Z", "sources": [ { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "e7d8a694f4559201e6913f6610069cb08b39274e", - "internalRef": "293903652", - "log": "e7d8a694f4559201e6913f6610069cb08b39274e\nDepend on the latest gapic-generator and resource names plugin.\n\nThis fixes the very old an very annoying bug: https://github.com/googleapis/gapic-generator/pull/3087\n\nPiperOrigin-RevId: 293903652\n\n806b2854a966d55374ee26bb0cef4e30eda17b58\nfix: correct capitalization of Ruby namespaces in SecurityCenter V1p1beta1\n\nPiperOrigin-RevId: 293903613\n\n1b83c92462b14d67a7644e2980f723112472e03a\nPublish annotations and grpc service config for Logging API.\n\nPiperOrigin-RevId: 293893514\n\n" + "sha": "83c6f84035ee0f80eaa44d8b688a010461cc4080", + "internalRef": "297918498", + "log": "83c6f84035ee0f80eaa44d8b688a010461cc4080\nUpdate google/api/auth.proto to make AuthProvider to have JwtLocation\n\nPiperOrigin-RevId: 297918498\n\ne9e90a787703ec5d388902e2cb796aaed3a385b4\nDialogflow weekly v2/v2beta1 library update:\n - adding get validation result\n - adding field mask override control for output audio config\nImportant updates are also posted at:\nhttps://cloud.google.com/dialogflow/docs/release-notes\n\nPiperOrigin-RevId: 297671458\n\n1a2b05cc3541a5f7714529c665aecc3ea042c646\nAdding .yaml and .json config files.\n\nPiperOrigin-RevId: 297570622\n\ndfe1cf7be44dee31d78f78e485d8c95430981d6e\nPublish `QueryOptions` proto.\n\nIntroduced a `query_options` input in `ExecuteSqlRequest`.\n\nPiperOrigin-RevId: 297497710\n\ndafc905f71e5d46f500b41ed715aad585be062c3\npubsub: revert pull init_rpc_timeout & max_rpc_timeout back to 25 seconds and reset multiplier to 1.0\n\nPiperOrigin-RevId: 297486523\n\nf077632ba7fee588922d9e8717ee272039be126d\nfirestore: add update_transform\n\nPiperOrigin-RevId: 297405063\n\n0aba1900ffef672ec5f0da677cf590ee5686e13b\ncluster: use square brace for cross-reference\n\nPiperOrigin-RevId: 297204568\n\n5dac2da18f6325cbaed54603c43f0667ecd50247\nRestore retry params in gapic config because securitycenter has non-standard default retry params.\nRestore a few retry codes for some idempotent methods.\n\nPiperOrigin-RevId: 297196720\n\n1eb61455530252bba8b2c8d4bc9832960e5a56f6\npubsub: v1 replace IAM HTTP rules\n\nPiperOrigin-RevId: 297188590\n\n80b2d25f8d43d9d47024ff06ead7f7166548a7ba\nDialogflow weekly v2/v2beta1 library update:\n - updates to mega agent api\n - adding field mask override control for output audio config\nImportant updates are also posted at:\nhttps://cloud.google.com/dialogflow/docs/release-notes\n\nPiperOrigin-RevId: 297187629\n\n0b1876b35e98f560f9c9ca9797955f020238a092\nUse an older version of protoc-docs-plugin that is compatible with the specified gapic-generator and protobuf versions.\n\nprotoc-docs-plugin >=0.4.0 (see commit https://github.com/googleapis/protoc-docs-plugin/commit/979f03ede6678c487337f3d7e88bae58df5207af) is incompatible with protobuf 3.9.1.\n\nPiperOrigin-RevId: 296986742\n\n1e47e676cddbbd8d93f19ba0665af15b5532417e\nFix: Restore a method signature for UpdateCluster\n\nPiperOrigin-RevId: 296901854\n\n7f910bcc4fc4704947ccfd3ceed015d16b9e00c2\nUpdate Dataproc v1beta2 client.\n\nPiperOrigin-RevId: 296451205\n\nde287524405a3dce124d301634731584fc0432d7\nFix: Reinstate method signatures that had been missed off some RPCs\nFix: Correct resource types for two fields\n\nPiperOrigin-RevId: 296435091\n\ne5bc9566ae057fb4c92f8b7e047f1c8958235b53\nDeprecate the endpoint_uris field, as it is unused.\n\nPiperOrigin-RevId: 296357191\n\n8c12e2b4dca94e12bff9f538bdac29524ff7ef7a\nUpdate Dataproc v1 client.\n\nPiperOrigin-RevId: 296336662\n\n17567c4a1ef0a9b50faa87024d66f8acbb561089\nRemoving erroneous comment, a la https://github.com/googleapis/java-speech/pull/103\n\nPiperOrigin-RevId: 296332968\n\n3eaaaf8626ce5b0c0bc7eee05e143beffa373b01\nAdd BUILD.bazel for v1 secretmanager.googleapis.com\n\nPiperOrigin-RevId: 296274723\n\ne76149c3d992337f85eeb45643106aacae7ede82\nMove securitycenter v1 to use generate from annotations.\n\nPiperOrigin-RevId: 296266862\n\n203740c78ac69ee07c3bf6be7408048751f618f8\nAdd StackdriverLoggingConfig field to Cloud Tasks v2 API.\n\nPiperOrigin-RevId: 296256388\n\ne4117d5e9ed8bbca28da4a60a94947ca51cb2083\nCreate a Bazel BUILD file for the google.actions.type export.\n\nPiperOrigin-RevId: 296212567\n\na9639a0a9854fd6e1be08bba1ac3897f4f16cb2f\nAdd secretmanager.googleapis.com v1 protos\n\nPiperOrigin-RevId: 295983266\n\nce4f4c21d9dd2bfab18873a80449b9d9851efde8\nasset: v1p1beta1 remove SearchResources and SearchIamPolicies\n\nPiperOrigin-RevId: 295861722\n\ncb61d6c2d070b589980c779b68ffca617f789116\nasset: v1p1beta1 remove SearchResources and SearchIamPolicies\n\nPiperOrigin-RevId: 295855449\n\nab2685d8d3a0e191dc8aef83df36773c07cb3d06\nfix: Dataproc v1 - AutoscalingPolicy annotation\n\nThis adds the second resource name pattern to the\nAutoscalingPolicy resource.\n\nCommitter: @lukesneeringer\nPiperOrigin-RevId: 295738415\n\n8a1020bf6828f6e3c84c3014f2c51cb62b739140\nUpdate cloud asset api v1p4beta1.\n\nPiperOrigin-RevId: 295286165\n\n5cfa105206e77670369e4b2225597386aba32985\nAdd service control related proto build rule.\n\nPiperOrigin-RevId: 295262088\n\nee4dddf805072004ab19ac94df2ce669046eec26\nmonitoring v3: Add prefix \"https://cloud.google.com/\" into the link for global access\ncl 295167522, get ride of synth.py hacks\n\nPiperOrigin-RevId: 295238095\n\nd9835e922ea79eed8497db270d2f9f85099a519c\nUpdate some minor docs changes about user event proto\n\nPiperOrigin-RevId: 295185610\n\n5f311e416e69c170243de722023b22f3df89ec1c\nfix: use correct PHP package name in gapic configuration\n\nPiperOrigin-RevId: 295161330\n\n6cdd74dcdb071694da6a6b5a206e3a320b62dd11\npubsub: v1 add client config annotations and retry config\n\nPiperOrigin-RevId: 295158776\n\n5169f46d9f792e2934d9fa25c36d0515b4fd0024\nAdded cloud asset api v1p4beta1.\n\nPiperOrigin-RevId: 295026522\n\n56b55aa8818cd0a532a7d779f6ef337ba809ccbd\nFix: Resource annotations for CreateTimeSeriesRequest and ListTimeSeriesRequest should refer to valid resources. TimeSeries is not a named resource.\n\nPiperOrigin-RevId: 294931650\n\n0646bc775203077226c2c34d3e4d50cc4ec53660\nRemove unnecessary languages from bigquery-related artman configuration files.\n\nPiperOrigin-RevId: 294809380\n\n8b78aa04382e3d4147112ad6d344666771bb1909\nUpdate backend.proto for schemes and protocol\n\nPiperOrigin-RevId: 294788800\n\n80b8f8b3de2359831295e24e5238641a38d8488f\nAdds artman config files for bigquerystorage endpoints v1beta2, v1alpha2, v1\n\nPiperOrigin-RevId: 294763931\n\n2c17ac33b226194041155bb5340c3f34733f1b3a\nAdd parameter to sample generated for UpdateInstance. Related to https://github.com/googleapis/python-redis/issues/4\n\nPiperOrigin-RevId: 294734008\n\nd5e8a8953f2acdfe96fb15e85eb2f33739623957\nMove bigquery datatransfer to gapic v2.\n\nPiperOrigin-RevId: 294703703\n\nefd36705972cfcd7d00ab4c6dfa1135bafacd4ae\nfix: Add two annotations that we missed.\n\nPiperOrigin-RevId: 294664231\n\n8a36b928873ff9c05b43859b9d4ea14cd205df57\nFix: Define the \"bigquery.googleapis.com/Table\" resource in the BigQuery Storage API (v1beta2).\n\nPiperOrigin-RevId: 294459768\n\nc7a3caa2c40c49f034a3c11079dd90eb24987047\nFix: Define the \"bigquery.googleapis.com/Table\" resource in the BigQuery Storage API (v1).\n\nPiperOrigin-RevId: 294456889\n\n5006247aa157e59118833658084345ee59af7c09\nFix: Make deprecated fields optional\nFix: Deprecate SetLoggingServiceRequest.zone in line with the comments\nFeature: Add resource name method signatures where appropriate\n\nPiperOrigin-RevId: 294383128\n\neabba40dac05c5cbe0fca3a35761b17e372036c4\nFix: C# and PHP package/namespace capitalization for BigQuery Storage v1.\n\nPiperOrigin-RevId: 294382444\n\nf8d9a858a7a55eba8009a23aa3f5cc5fe5e88dde\nfix: artman configuration file for bigtable-admin\n\nPiperOrigin-RevId: 294322616\n\n0f29555d1cfcf96add5c0b16b089235afbe9b1a9\nAPI definition for (not-yet-launched) GCS gRPC.\n\nPiperOrigin-RevId: 294321472\n\nfcc86bee0e84dc11e9abbff8d7c3529c0626f390\nfix: Bigtable Admin v2\n\nChange LRO metadata from PartialUpdateInstanceMetadata\nto UpdateInstanceMetadata. (Otherwise, it will not build.)\n\nPiperOrigin-RevId: 294264582\n\n6d9361eae2ebb3f42d8c7ce5baf4bab966fee7c0\nrefactor: Add annotations to Bigtable Admin v2.\n\nPiperOrigin-RevId: 294243406\n\nad7616f3fc8e123451c8b3a7987bc91cea9e6913\nFix: Resource type in CreateLogMetricRequest should use logging.googleapis.com.\nFix: ListLogEntries should have a method signature for convenience of calling it.\n\nPiperOrigin-RevId: 294222165\n\n63796fcbb08712676069e20a3e455c9f7aa21026\nFix: Remove extraneous resource definition for cloudkms.googleapis.com/CryptoKey.\n\nPiperOrigin-RevId: 294176658\n\n" } }, { From 90aaef3afe55f8dd30a250645122f2e490475d99 Mon Sep 17 00:00:00 2001 From: Alexander Fenster Date: Thu, 5 Mar 2020 07:52:55 -0800 Subject: [PATCH 147/342] chore: added proto annotations --- .../cloud/securitycenter/v1/asset.proto | 5 +- .../cloud/securitycenter/v1/finding.proto | 5 +- .../v1/notification_config.proto | 96 + .../v1/notification_message.proto | 41 + .../v1/organization_settings.proto | 5 +- .../v1/run_asset_discovery_response.proto | 5 +- .../securitycenter/v1/security_marks.proto | 5 +- .../v1/securitycenter_service.proto | 261 +- .../cloud/securitycenter/v1/source.proto | 5 +- .../protos/protos.d.ts | 2588 ++++-- .../protos/protos.js | 7349 +++++++++++------ .../protos/protos.json | 351 +- .../src/v1/security_center_client.ts | 696 +- .../src/v1/security_center_client_config.json | 25 + .../src/v1/security_center_proto_list.json | 2 + .../synth.metadata | 8 +- .../test/gapic-security_center-v1.ts | 265 + 17 files changed, 8130 insertions(+), 3582 deletions(-) create mode 100644 packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/notification_config.proto create mode 100644 packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/notification_message.proto diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/asset.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/asset.proto index bd4751a142a..b079e5c5d7b 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/asset.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/asset.proto @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC. +// 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. @@ -11,17 +11,16 @@ // WITHOUT 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.cloud.securitycenter.v1; +import "google/api/annotations.proto"; import "google/api/resource.proto"; import "google/cloud/securitycenter/v1/security_marks.proto"; import "google/protobuf/struct.proto"; import "google/protobuf/timestamp.proto"; -import "google/api/annotations.proto"; option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1;securitycenter"; diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/finding.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/finding.proto index 5d8e5a78918..9a3261c4c7a 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/finding.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/finding.proto @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC. +// 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. @@ -11,18 +11,17 @@ // WITHOUT 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.cloud.securitycenter.v1; +import "google/api/annotations.proto"; import "google/api/field_behavior.proto"; import "google/api/resource.proto"; import "google/cloud/securitycenter/v1/security_marks.proto"; import "google/protobuf/struct.proto"; import "google/protobuf/timestamp.proto"; -import "google/api/annotations.proto"; option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1;securitycenter"; diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/notification_config.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/notification_config.proto new file mode 100644 index 00000000000..90bd83c3a93 --- /dev/null +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/notification_config.proto @@ -0,0 +1,96 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.securitycenter.v1; + +import "google/api/annotations.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1;securitycenter"; +option java_multiple_files = true; +option java_outer_classname = "NotificationConfigProto"; +option java_package = "com.google.cloud.securitycenter.v1"; +option php_namespace = "Google\\Cloud\\SecurityCenter\\V1"; +option ruby_package = "Google::Cloud::SecurityCenter::V1"; +option (google.api.resource_definition) = { + type: "pubsub.googleapis.com/Topic" + pattern: "projects/{project}/topics/{topic}" +}; + +// Cloud Security Command Center (Cloud SCC) notification configs. +// +// A notification config is a Cloud SCC resource that contains the configuration +// to send notifications for create/update events of findings, assets and etc. +message NotificationConfig { + option (google.api.resource) = { + type: "securitycenter.googleapis.com/NotificationConfig" + pattern: "organizations/{organization}/notificationConfigs/{notification_config}" + }; + + // The config for streaming-based notifications, which send each event as soon + // as it is detected. + message StreamingConfig { + // Expression that defines the filter to apply across create/update events + // of assets or findings as specified by the event type. The expression is a + // list of zero or more restrictions combined via logical operators `AND` + // and `OR`. Parentheses are supported, and `OR` has higher precedence than + // `AND`. + // + // Restrictions have the form ` ` and may have a + // `-` character in front of them to indicate negation. The fields map to + // those defined in the corresponding resource. + // + // The supported operators are: + // + // * `=` for all value types. + // * `>`, `<`, `>=`, `<=` for integer values. + // * `:`, meaning substring matching, for strings. + // + // The supported value types are: + // + // * string literals in quotes. + // * integer literals without quotes. + // * boolean literals `true` and `false` without quotes. + string filter = 1; + } + + // The relative resource name of this notification config. See: + // https://cloud.google.com/apis/design/resource_names#relative_resource_name + // Example: + // "organizations/{organization_id}/notificationConfigs/notify_public_bucket". + string name = 1; + + // The description of the notification config (max of 1024 characters). + string description = 2; + + // The PubSub topic to send notifications to. Its format is + // "projects/[project_id]/topics/[topic]". + string pubsub_topic = 3 [ + (google.api.resource_reference) = { type: "pubsub.googleapis.com/Topic" } + ]; + + // Output only. The service account that needs "pubsub.topics.publish" + // permission to publish to the PubSub topic. + string service_account = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The config for triggering notifications. + oneof notify_config { + // The config for triggering streaming-based notifications. + StreamingConfig streaming_config = 5; + } +} diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/notification_message.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/notification_message.proto new file mode 100644 index 00000000000..b9dfb171b13 --- /dev/null +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/notification_message.proto @@ -0,0 +1,41 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.securitycenter.v1; + +import "google/api/annotations.proto"; +import "google/cloud/securitycenter/v1/finding.proto"; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1;securitycenter"; +option java_multiple_files = true; +option java_outer_classname = "NotificationMessageProto"; +option java_package = "com.google.cloud.securitycenter.v1"; +option php_namespace = "Google\\Cloud\\SecurityCenter\\V1"; +option ruby_package = "Google::Cloud::SecurityCenter::V1"; + +// Cloud SCC's Notification +message NotificationMessage { + // Name of the notification config that generated current notification. + string notification_config_name = 1; + + // Notification Event. + oneof event { + // If it's a Finding based notification config, this field will be + // populated. + Finding finding = 2; + } +} diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/organization_settings.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/organization_settings.proto index aa4e80bd1a0..d9d9aed7926 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/organization_settings.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/organization_settings.proto @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC. +// 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. @@ -11,14 +11,13 @@ // WITHOUT 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.cloud.securitycenter.v1; -import "google/api/resource.proto"; import "google/api/annotations.proto"; +import "google/api/resource.proto"; option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1;securitycenter"; diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/run_asset_discovery_response.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/run_asset_discovery_response.proto index e7581078dac..4f09d9c0a42 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/run_asset_discovery_response.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/run_asset_discovery_response.proto @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC. +// 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. @@ -11,14 +11,13 @@ // WITHOUT 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.cloud.securitycenter.v1; -import "google/protobuf/duration.proto"; import "google/api/annotations.proto"; +import "google/protobuf/duration.proto"; option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1;securitycenter"; diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/security_marks.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/security_marks.proto index d2b53487437..229aff32dd9 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/security_marks.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/security_marks.proto @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC. +// 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. @@ -11,14 +11,13 @@ // WITHOUT 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.cloud.securitycenter.v1; -import "google/api/resource.proto"; import "google/api/annotations.proto"; +import "google/api/resource.proto"; option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1;securitycenter"; diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/securitycenter_service.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/securitycenter_service.proto index df3e53dc3aa..bb9a82849d1 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/securitycenter_service.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/securitycenter_service.proto @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC. +// 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. @@ -11,19 +11,20 @@ // WITHOUT 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.cloud.securitycenter.v1; import public "google/cloud/securitycenter/v1/run_asset_discovery_response.proto"; + import "google/api/annotations.proto"; import "google/api/client.proto"; import "google/api/field_behavior.proto"; import "google/api/resource.proto"; import "google/cloud/securitycenter/v1/asset.proto"; import "google/cloud/securitycenter/v1/finding.proto"; +import "google/cloud/securitycenter/v1/notification_config.proto"; import "google/cloud/securitycenter/v1/organization_settings.proto"; import "google/cloud/securitycenter/v1/security_marks.proto"; import "google/cloud/securitycenter/v1/source.proto"; @@ -46,7 +47,8 @@ option ruby_package = "Google::Cloud::SecurityCenter::V1"; // V1 APIs for Security Center service. service SecurityCenter { option (google.api.default_host) = "securitycenter.googleapis.com"; - option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; // Creates a source. rpc CreateSource(CreateSourceRequest) returns (Source) { @@ -67,8 +69,30 @@ service SecurityCenter { option (google.api.method_signature) = "parent,finding_id,finding"; } + // Creates a notification config. + rpc CreateNotificationConfig(CreateNotificationConfigRequest) + returns (NotificationConfig) { + option (google.api.http) = { + post: "/v1/{parent=organizations/*}/notificationConfigs" + body: "notification_config" + }; + option (google.api.method_signature) = + "parent,config_id,notification_config"; + option (google.api.method_signature) = "parent,notification_config"; + } + + // Deletes a notification config. + rpc DeleteNotificationConfig(DeleteNotificationConfigRequest) + returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1/{name=organizations/*/notificationConfigs/*}" + }; + option (google.api.method_signature) = "name"; + } + // Gets the access control policy on the specified Source. - rpc GetIamPolicy(google.iam.v1.GetIamPolicyRequest) returns (google.iam.v1.Policy) { + rpc GetIamPolicy(google.iam.v1.GetIamPolicyRequest) + returns (google.iam.v1.Policy) { option (google.api.http) = { post: "/v1/{resource=organizations/*/sources/*}:getIamPolicy" body: "*" @@ -76,8 +100,18 @@ service SecurityCenter { option (google.api.method_signature) = "resource"; } + // Gets a notification config. + rpc GetNotificationConfig(GetNotificationConfigRequest) + returns (NotificationConfig) { + option (google.api.http) = { + get: "/v1/{name=organizations/*/notificationConfigs/*}" + }; + option (google.api.method_signature) = "name"; + } + // Gets the settings for an organization. - rpc GetOrganizationSettings(GetOrganizationSettingsRequest) returns (OrganizationSettings) { + rpc GetOrganizationSettings(GetOrganizationSettingsRequest) + returns (OrganizationSettings) { option (google.api.http) = { get: "/v1/{name=organizations/*/organizationSettings}" }; @@ -131,6 +165,15 @@ service SecurityCenter { }; } + // Lists notification configs. + rpc ListNotificationConfigs(ListNotificationConfigsRequest) + returns (ListNotificationConfigsResponse) { + option (google.api.http) = { + get: "/v1/{parent=organizations/*}/notificationConfigs" + }; + option (google.api.method_signature) = "parent"; + } + // Lists all sources belonging to an organization. rpc ListSources(ListSourcesRequest) returns (ListSourcesResponse) { option (google.api.http) = { @@ -145,7 +188,8 @@ service SecurityCenter { // This API can only be called with limited frequency for an organization. If // it is called too frequently the caller will receive a TOO_MANY_REQUESTS // error. - rpc RunAssetDiscovery(RunAssetDiscoveryRequest) returns (google.longrunning.Operation) { + rpc RunAssetDiscovery(RunAssetDiscoveryRequest) + returns (google.longrunning.Operation) { option (google.api.http) = { post: "/v1/{parent=organizations/*}/assets:runDiscovery" body: "*" @@ -167,7 +211,8 @@ service SecurityCenter { } // Sets the access control policy on the specified Source. - rpc SetIamPolicy(google.iam.v1.SetIamPolicyRequest) returns (google.iam.v1.Policy) { + rpc SetIamPolicy(google.iam.v1.SetIamPolicyRequest) + returns (google.iam.v1.Policy) { option (google.api.http) = { post: "/v1/{resource=organizations/*/sources/*}:setIamPolicy" body: "*" @@ -176,7 +221,8 @@ service SecurityCenter { } // Returns the permissions that a caller has on the specified source. - rpc TestIamPermissions(google.iam.v1.TestIamPermissionsRequest) returns (google.iam.v1.TestIamPermissionsResponse) { + rpc TestIamPermissions(google.iam.v1.TestIamPermissionsRequest) + returns (google.iam.v1.TestIamPermissionsResponse) { option (google.api.http) = { post: "/v1/{resource=organizations/*/sources/*}:testIamPermissions" body: "*" @@ -194,8 +240,21 @@ service SecurityCenter { option (google.api.method_signature) = "finding"; } + // + // Updates a notification config. + rpc UpdateNotificationConfig(UpdateNotificationConfigRequest) + returns (NotificationConfig) { + option (google.api.http) = { + patch: "/v1/{notification_config.name=organizations/*/notificationConfigs/*}" + body: "notification_config" + }; + option (google.api.method_signature) = "notification_config"; + option (google.api.method_signature) = "notification_config,update_mask"; + } + // Updates an organization's settings. - rpc UpdateOrganizationSettings(UpdateOrganizationSettingsRequest) returns (OrganizationSettings) { + rpc UpdateOrganizationSettings(UpdateOrganizationSettingsRequest) + returns (OrganizationSettings) { option (google.api.http) = { patch: "/v1/{organization_settings.name=organizations/*/organizationSettings}" body: "organization_settings" @@ -242,11 +301,35 @@ message CreateFindingRequest { // greater than 0 characters in length. string finding_id = 2 [(google.api.field_behavior) = REQUIRED]; - // Required. The Finding being created. The name and security_marks will be ignored as - // they are both output only fields on this resource. + // Required. The Finding being created. The name and security_marks will be + // ignored as they are both output only fields on this resource. Finding finding = 3 [(google.api.field_behavior) = REQUIRED]; } +// Request message for creating a notification config. +message CreateNotificationConfigRequest { + // Required. Resource name of the new notification config's parent. Its format + // is "organizations/[organization_id]". + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudresourcemanager.googleapis.com/Organization" + } + ]; + + // Required. + // Unique identifier provided by the client within the parent scope. + // It must be between 1 and 128 characters, and contains alphanumeric + // characters, underscores or hyphens only. + string config_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The notification config being created. The name and the service + // account will be ignored as they are both output only fields on this + // resource. + NotificationConfig notification_config = 3 + [(google.api.field_behavior) = REQUIRED]; +} + // Request message for creating a source. message CreateSourceRequest { // Required. Resource name of the new source's parent. Its format should be @@ -258,15 +341,39 @@ message CreateSourceRequest { } ]; - // Required. The Source being created, only the display_name and description will be - // used. All other fields will be ignored. + // Required. The Source being created, only the display_name and description + // will be used. All other fields will be ignored. Source source = 2 [(google.api.field_behavior) = REQUIRED]; } +// Request message for deleting a notification config. +message DeleteNotificationConfigRequest { + // Required. Name of the notification config to delete. Its format is + // "organizations/[organization_id]/notificationConfigs/[config_id]". + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "securitycenter.googleapis.com/NotificationConfig" + } + ]; +} + +// Request message for getting a notification config. +message GetNotificationConfigRequest { + // Required. Name of the notification config to get. Its format is + // "organizations/[organization_id]/notificationConfigs/[config_id]". + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "securitycenter.googleapis.com/NotificationConfig" + } + ]; +} + // Request message for getting organization settings. message GetOrganizationSettingsRequest { - // Required. Name of the organization to get organization settings for. Its format is - // "organizations/[organization_id]/organizationSettings". + // Required. Name of the organization to get organization settings for. Its + // format is "organizations/[organization_id]/organizationSettings". string name = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -356,9 +463,9 @@ message GroupAssetsRequest { // For example, `resource_properties.size = 100` is a valid filter string. string filter = 2; - // Required. Expression that defines what assets fields to use for grouping. The string - // value should follow SQL syntax: comma separated list of fields. For - // example: + // Required. Expression that defines what assets fields to use for grouping. + // The string value should follow SQL syntax: comma separated list of fields. + // For example: // "security_center_properties.resource_project,security_center_properties.project". // // The following fields are supported when compare_duration is not set: @@ -497,9 +604,9 @@ message GroupFindingsRequest { // For example, `source_properties.size = 100` is a valid filter string. string filter = 2; - // Required. Expression that defines what assets fields to use for grouping (including - // `state_change`). The string value should follow SQL syntax: comma separated - // list of fields. For example: "parent,resource_name". + // Required. Expression that defines what assets fields to use for grouping + // (including `state_change`). The string value should follow SQL syntax: + // comma separated list of fields. For example: "parent,resource_name". // // The following fields are supported: // @@ -532,12 +639,18 @@ message GroupFindingsRequest { // // Possible "state_change" values when compare_duration is specified: // - // * "CHANGED": indicates that the finding was present at the start of - // compare_duration, but changed its state at read_time. - // * "UNCHANGED": indicates that the finding was present at the start of - // compare_duration and did not change state at read_time. - // * "ADDED": indicates that the finding was not present at the start - // of compare_duration, but was present at read_time. + // * "CHANGED": indicates that the finding was present and matched the given + // filter at the start of compare_duration, but changed its + // state at read_time. + // * "UNCHANGED": indicates that the finding was present and matched the given + // filter at the start of compare_duration and did not change + // state at read_time. + // * "ADDED": indicates that the finding did not match the given filter or + // was not present at the start of compare_duration, but was + // present at read_time. + // * "REMOVED": indicates that the finding was present and matched the + // filter at the start of compare_duration, but did not match + // the filter at read_time. // // If compare_duration is not specified, then the only possible state_change // is "UNUSED", which will be the state_change set for all findings present @@ -584,10 +697,41 @@ message GroupResult { int64 count = 2; } +// Request message for listing notification configs. +message ListNotificationConfigsRequest { + // Required. Name of the organization to list notification configs. + // Its format is "organizations/[organization_id]". + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudresourcemanager.googleapis.com/Organization" + } + ]; + + // The value returned by the last `ListNotificationConfigsResponse`; indicates + // that this is a continuation of a prior `ListNotificationConfigs` call, and + // that the system should return the next page of data. + string page_token = 2; + + // The maximum number of results to return in a single response. Default is + // 10, minimum is 1, maximum is 1000. + int32 page_size = 3; +} + +// Response message for listing notification configs. +message ListNotificationConfigsResponse { + // Notification configs belonging to the requested parent. + repeated NotificationConfig notification_configs = 1; + + // Token to retrieve the next page of results, or empty if there are no more + // results. + string next_page_token = 2; +} + // Request message for listing sources. message ListSourcesRequest { - // Required. Resource name of the parent of sources to list. Its format should be - // "organizations/[organization_id]". + // Required. Resource name of the parent of sources to list. Its format should + // be "organizations/[organization_id]". string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -739,10 +883,10 @@ message ListAssetsRequest { // read_time. google.protobuf.Duration compare_duration = 5; - // Optional. A field mask to specify the ListAssetsResult fields to be listed in the - // response. - // An empty field mask will list all fields. - google.protobuf.FieldMask field_mask = 7 [(google.api.field_behavior) = OPTIONAL]; + // Optional. A field mask to specify the ListAssetsResult fields to be listed + // in the response. An empty field mask will list all fields. + google.protobuf.FieldMask field_mask = 7 + [(google.api.field_behavior) = OPTIONAL]; // The value returned by the last `ListAssetsResponse`; indicates // that this is a continuation of a prior `ListAssets` call, and @@ -897,21 +1041,28 @@ message ListFindingsRequest { // // Possible "state_change" values when compare_duration is specified: // - // * "CHANGED": indicates that the finding was present at the start of - // compare_duration, but changed its state at read_time. - // * "UNCHANGED": indicates that the finding was present at the start of - // compare_duration and did not change state at read_time. - // * "ADDED": indicates that the finding was not present at the start - // of compare_duration, but was present at read_time. + // * "CHANGED": indicates that the finding was present and matched the given + // filter at the start of compare_duration, but changed its + // state at read_time. + // * "UNCHANGED": indicates that the finding was present and matched the given + // filter at the start of compare_duration and did not change + // state at read_time. + // * "ADDED": indicates that the finding did not match the given filter or + // was not present at the start of compare_duration, but was + // present at read_time. + // * "REMOVED": indicates that the finding was present and matched the + // filter at the start of compare_duration, but did not match + // the filter at read_time. // // If compare_duration is not specified, then the only possible state_change // is "UNUSED", which will be the state_change set for all findings present at // read_time. google.protobuf.Duration compare_duration = 5; - // Optional. A field mask to specify the Finding fields to be listed in the response. - // An empty field mask will list all fields. - google.protobuf.FieldMask field_mask = 7 [(google.api.field_behavior) = OPTIONAL]; + // Optional. A field mask to specify the Finding fields to be listed in the + // response. An empty field mask will list all fields. + google.protobuf.FieldMask field_mask = 7 + [(google.api.field_behavior) = OPTIONAL]; // The value returned by the last `ListFindingsResponse`; indicates // that this is a continuation of a prior `ListFindings` call, and @@ -1016,13 +1167,14 @@ message SetFindingStateRequest { Finding.State state = 2 [(google.api.field_behavior) = REQUIRED]; // Required. The time at which the updated state takes effect. - google.protobuf.Timestamp start_time = 3 [(google.api.field_behavior) = REQUIRED]; + google.protobuf.Timestamp start_time = 3 + [(google.api.field_behavior) = REQUIRED]; } // Request message for running asset discovery for an organization. message RunAssetDiscoveryRequest { - // Required. Name of the organization to run asset discovery for. Its format is - // "organizations/[organization_id]". + // Required. Name of the organization to run asset discovery for. Its format + // is "organizations/[organization_id]". string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -1033,8 +1185,8 @@ message RunAssetDiscoveryRequest { // Request message for updating or creating a finding. message UpdateFindingRequest { - // Required. The finding resource to update or create if it does not already exist. - // parent, security_marks, and update_time will be ignored. + // Required. The finding resource to update or create if it does not already + // exist. parent, security_marks, and update_time will be ignored. // // In the case of creation, the finding id portion of the name must be // alphanumeric and less than or equal to 32 characters and greater than 0 @@ -1051,10 +1203,23 @@ message UpdateFindingRequest { google.protobuf.FieldMask update_mask = 2; } +// Request message for updating a notification config. +message UpdateNotificationConfigRequest { + // Required. The notification config to update. + NotificationConfig notification_config = 1 + [(google.api.field_behavior) = REQUIRED]; + + // The FieldMask to use when updating the notification config. + // + // If empty all mutable fields will be updated. + google.protobuf.FieldMask update_mask = 2; +} + // Request message for updating an organization's settings. message UpdateOrganizationSettingsRequest { // Required. The organization settings resource to update. - OrganizationSettings organization_settings = 1 [(google.api.field_behavior) = REQUIRED]; + OrganizationSettings organization_settings = 1 + [(google.api.field_behavior) = REQUIRED]; // The FieldMask to use when updating the settings resource. // diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/source.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/source.proto index d26e042f121..6fca821b826 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/source.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/source.proto @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC. +// 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. @@ -11,14 +11,13 @@ // WITHOUT 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.cloud.securitycenter.v1; -import "google/api/resource.proto"; import "google/api/annotations.proto"; +import "google/api/resource.proto"; option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1;securitycenter"; diff --git a/packages/google-cloud-securitycenter/protos/protos.d.ts b/packages/google-cloud-securitycenter/protos/protos.d.ts index 79b5a273bb8..2ffbf461c71 100644 --- a/packages/google-cloud-securitycenter/protos/protos.d.ts +++ b/packages/google-cloud-securitycenter/protos/protos.d.ts @@ -627,919 +627,1615 @@ export namespace google { } } - /** Properties of an OrganizationSettings. */ - interface IOrganizationSettings { + /** Properties of a NotificationConfig. */ + interface INotificationConfig { - /** OrganizationSettings name */ + /** NotificationConfig name */ name?: (string|null); - /** OrganizationSettings enableAssetDiscovery */ - enableAssetDiscovery?: (boolean|null); + /** NotificationConfig description */ + description?: (string|null); - /** OrganizationSettings assetDiscoveryConfig */ - assetDiscoveryConfig?: (google.cloud.securitycenter.v1.OrganizationSettings.IAssetDiscoveryConfig|null); + /** NotificationConfig pubsubTopic */ + pubsubTopic?: (string|null); + + /** NotificationConfig serviceAccount */ + serviceAccount?: (string|null); + + /** NotificationConfig streamingConfig */ + streamingConfig?: (google.cloud.securitycenter.v1.NotificationConfig.IStreamingConfig|null); } - /** Represents an OrganizationSettings. */ - class OrganizationSettings implements IOrganizationSettings { + /** Represents a NotificationConfig. */ + class NotificationConfig implements INotificationConfig { /** - * Constructs a new OrganizationSettings. + * Constructs a new NotificationConfig. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.securitycenter.v1.IOrganizationSettings); + constructor(properties?: google.cloud.securitycenter.v1.INotificationConfig); - /** OrganizationSettings name. */ + /** NotificationConfig name. */ public name: string; - /** OrganizationSettings enableAssetDiscovery. */ - public enableAssetDiscovery: boolean; + /** NotificationConfig description. */ + public description: string; - /** OrganizationSettings assetDiscoveryConfig. */ - public assetDiscoveryConfig?: (google.cloud.securitycenter.v1.OrganizationSettings.IAssetDiscoveryConfig|null); + /** NotificationConfig pubsubTopic. */ + public pubsubTopic: string; + + /** NotificationConfig serviceAccount. */ + public serviceAccount: string; + + /** NotificationConfig streamingConfig. */ + public streamingConfig?: (google.cloud.securitycenter.v1.NotificationConfig.IStreamingConfig|null); + + /** NotificationConfig notifyConfig. */ + public notifyConfig?: "streamingConfig"; /** - * Creates a new OrganizationSettings instance using the specified properties. + * Creates a new NotificationConfig instance using the specified properties. * @param [properties] Properties to set - * @returns OrganizationSettings instance + * @returns NotificationConfig instance */ - public static create(properties?: google.cloud.securitycenter.v1.IOrganizationSettings): google.cloud.securitycenter.v1.OrganizationSettings; + public static create(properties?: google.cloud.securitycenter.v1.INotificationConfig): google.cloud.securitycenter.v1.NotificationConfig; /** - * Encodes the specified OrganizationSettings message. Does not implicitly {@link google.cloud.securitycenter.v1.OrganizationSettings.verify|verify} messages. - * @param message OrganizationSettings message or plain object to encode + * Encodes the specified NotificationConfig message. Does not implicitly {@link google.cloud.securitycenter.v1.NotificationConfig.verify|verify} messages. + * @param message NotificationConfig message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.securitycenter.v1.IOrganizationSettings, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.securitycenter.v1.INotificationConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified OrganizationSettings message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.OrganizationSettings.verify|verify} messages. - * @param message OrganizationSettings message or plain object to encode + * Encodes the specified NotificationConfig message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.NotificationConfig.verify|verify} messages. + * @param message NotificationConfig message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.securitycenter.v1.IOrganizationSettings, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.securitycenter.v1.INotificationConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an OrganizationSettings message from the specified reader or buffer. + * Decodes a NotificationConfig message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns OrganizationSettings + * @returns NotificationConfig * @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.cloud.securitycenter.v1.OrganizationSettings; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1.NotificationConfig; /** - * Decodes an OrganizationSettings message from the specified reader or buffer, length delimited. + * Decodes a NotificationConfig message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns OrganizationSettings + * @returns NotificationConfig * @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.cloud.securitycenter.v1.OrganizationSettings; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1.NotificationConfig; /** - * Verifies an OrganizationSettings message. + * Verifies a NotificationConfig 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 OrganizationSettings message from a plain object. Also converts values to their respective internal types. + * Creates a NotificationConfig message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns OrganizationSettings + * @returns NotificationConfig */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.OrganizationSettings; + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.NotificationConfig; /** - * Creates a plain object from an OrganizationSettings message. Also converts values to other types if specified. - * @param message OrganizationSettings + * Creates a plain object from a NotificationConfig message. Also converts values to other types if specified. + * @param message NotificationConfig * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.securitycenter.v1.OrganizationSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.securitycenter.v1.NotificationConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this OrganizationSettings to JSON. + * Converts this NotificationConfig to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - namespace OrganizationSettings { - - /** Properties of an AssetDiscoveryConfig. */ - interface IAssetDiscoveryConfig { + namespace NotificationConfig { - /** AssetDiscoveryConfig projectIds */ - projectIds?: (string[]|null); + /** Properties of a StreamingConfig. */ + interface IStreamingConfig { - /** AssetDiscoveryConfig inclusionMode */ - inclusionMode?: (google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode|keyof typeof google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode|null); + /** StreamingConfig filter */ + filter?: (string|null); } - /** Represents an AssetDiscoveryConfig. */ - class AssetDiscoveryConfig implements IAssetDiscoveryConfig { + /** Represents a StreamingConfig. */ + class StreamingConfig implements IStreamingConfig { /** - * Constructs a new AssetDiscoveryConfig. + * Constructs a new StreamingConfig. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.securitycenter.v1.OrganizationSettings.IAssetDiscoveryConfig); - - /** AssetDiscoveryConfig projectIds. */ - public projectIds: string[]; + constructor(properties?: google.cloud.securitycenter.v1.NotificationConfig.IStreamingConfig); - /** AssetDiscoveryConfig inclusionMode. */ - public inclusionMode: (google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode|keyof typeof google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode); + /** StreamingConfig filter. */ + public filter: string; /** - * Creates a new AssetDiscoveryConfig instance using the specified properties. + * Creates a new StreamingConfig instance using the specified properties. * @param [properties] Properties to set - * @returns AssetDiscoveryConfig instance + * @returns StreamingConfig instance */ - public static create(properties?: google.cloud.securitycenter.v1.OrganizationSettings.IAssetDiscoveryConfig): google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig; + public static create(properties?: google.cloud.securitycenter.v1.NotificationConfig.IStreamingConfig): google.cloud.securitycenter.v1.NotificationConfig.StreamingConfig; /** - * Encodes the specified AssetDiscoveryConfig message. Does not implicitly {@link google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.verify|verify} messages. - * @param message AssetDiscoveryConfig message or plain object to encode + * Encodes the specified StreamingConfig message. Does not implicitly {@link google.cloud.securitycenter.v1.NotificationConfig.StreamingConfig.verify|verify} messages. + * @param message StreamingConfig message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.securitycenter.v1.OrganizationSettings.IAssetDiscoveryConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.securitycenter.v1.NotificationConfig.IStreamingConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified AssetDiscoveryConfig message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.verify|verify} messages. - * @param message AssetDiscoveryConfig message or plain object to encode + * Encodes the specified StreamingConfig message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.NotificationConfig.StreamingConfig.verify|verify} messages. + * @param message StreamingConfig message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.securitycenter.v1.OrganizationSettings.IAssetDiscoveryConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.securitycenter.v1.NotificationConfig.IStreamingConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an AssetDiscoveryConfig message from the specified reader or buffer. + * Decodes a StreamingConfig message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns AssetDiscoveryConfig + * @returns StreamingConfig * @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.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1.NotificationConfig.StreamingConfig; /** - * Decodes an AssetDiscoveryConfig message from the specified reader or buffer, length delimited. + * Decodes a StreamingConfig message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns AssetDiscoveryConfig + * @returns StreamingConfig * @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.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1.NotificationConfig.StreamingConfig; /** - * Verifies an AssetDiscoveryConfig message. + * Verifies a StreamingConfig 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 AssetDiscoveryConfig message from a plain object. Also converts values to their respective internal types. + * Creates a StreamingConfig message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns AssetDiscoveryConfig + * @returns StreamingConfig */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig; + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.NotificationConfig.StreamingConfig; /** - * Creates a plain object from an AssetDiscoveryConfig message. Also converts values to other types if specified. - * @param message AssetDiscoveryConfig + * Creates a plain object from a StreamingConfig message. Also converts values to other types if specified. + * @param message StreamingConfig * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.securitycenter.v1.NotificationConfig.StreamingConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this AssetDiscoveryConfig to JSON. + * Converts this StreamingConfig to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - - namespace AssetDiscoveryConfig { - - /** InclusionMode enum. */ - enum InclusionMode { - INCLUSION_MODE_UNSPECIFIED = 0, - INCLUDE_ONLY = 1, - EXCLUDE = 2 - } - } } - /** Properties of a RunAssetDiscoveryResponse. */ - interface IRunAssetDiscoveryResponse { + /** Properties of a NotificationMessage. */ + interface INotificationMessage { - /** RunAssetDiscoveryResponse state */ - state?: (google.cloud.securitycenter.v1.RunAssetDiscoveryResponse.State|keyof typeof google.cloud.securitycenter.v1.RunAssetDiscoveryResponse.State|null); + /** NotificationMessage notificationConfigName */ + notificationConfigName?: (string|null); - /** RunAssetDiscoveryResponse duration */ - duration?: (google.protobuf.IDuration|null); + /** NotificationMessage finding */ + finding?: (google.cloud.securitycenter.v1.IFinding|null); } - /** Represents a RunAssetDiscoveryResponse. */ - class RunAssetDiscoveryResponse implements IRunAssetDiscoveryResponse { + /** Represents a NotificationMessage. */ + class NotificationMessage implements INotificationMessage { /** - * Constructs a new RunAssetDiscoveryResponse. + * Constructs a new NotificationMessage. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.securitycenter.v1.IRunAssetDiscoveryResponse); + constructor(properties?: google.cloud.securitycenter.v1.INotificationMessage); - /** RunAssetDiscoveryResponse state. */ - public state: (google.cloud.securitycenter.v1.RunAssetDiscoveryResponse.State|keyof typeof google.cloud.securitycenter.v1.RunAssetDiscoveryResponse.State); + /** NotificationMessage notificationConfigName. */ + public notificationConfigName: string; - /** RunAssetDiscoveryResponse duration. */ - public duration?: (google.protobuf.IDuration|null); + /** NotificationMessage finding. */ + public finding?: (google.cloud.securitycenter.v1.IFinding|null); + + /** NotificationMessage event. */ + public event?: "finding"; /** - * Creates a new RunAssetDiscoveryResponse instance using the specified properties. + * Creates a new NotificationMessage instance using the specified properties. * @param [properties] Properties to set - * @returns RunAssetDiscoveryResponse instance + * @returns NotificationMessage instance */ - public static create(properties?: google.cloud.securitycenter.v1.IRunAssetDiscoveryResponse): google.cloud.securitycenter.v1.RunAssetDiscoveryResponse; + public static create(properties?: google.cloud.securitycenter.v1.INotificationMessage): google.cloud.securitycenter.v1.NotificationMessage; /** - * Encodes the specified RunAssetDiscoveryResponse message. Does not implicitly {@link google.cloud.securitycenter.v1.RunAssetDiscoveryResponse.verify|verify} messages. - * @param message RunAssetDiscoveryResponse message or plain object to encode + * Encodes the specified NotificationMessage message. Does not implicitly {@link google.cloud.securitycenter.v1.NotificationMessage.verify|verify} messages. + * @param message NotificationMessage message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.securitycenter.v1.IRunAssetDiscoveryResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.securitycenter.v1.INotificationMessage, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified RunAssetDiscoveryResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.RunAssetDiscoveryResponse.verify|verify} messages. - * @param message RunAssetDiscoveryResponse message or plain object to encode + * Encodes the specified NotificationMessage message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.NotificationMessage.verify|verify} messages. + * @param message NotificationMessage message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.securitycenter.v1.IRunAssetDiscoveryResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.securitycenter.v1.INotificationMessage, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a RunAssetDiscoveryResponse message from the specified reader or buffer. + * Decodes a NotificationMessage message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns RunAssetDiscoveryResponse + * @returns NotificationMessage * @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.cloud.securitycenter.v1.RunAssetDiscoveryResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1.NotificationMessage; /** - * Decodes a RunAssetDiscoveryResponse message from the specified reader or buffer, length delimited. + * Decodes a NotificationMessage message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns RunAssetDiscoveryResponse + * @returns NotificationMessage * @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.cloud.securitycenter.v1.RunAssetDiscoveryResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1.NotificationMessage; /** - * Verifies a RunAssetDiscoveryResponse message. + * Verifies a NotificationMessage 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 RunAssetDiscoveryResponse message from a plain object. Also converts values to their respective internal types. + * Creates a NotificationMessage message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns RunAssetDiscoveryResponse + * @returns NotificationMessage */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.RunAssetDiscoveryResponse; + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.NotificationMessage; /** - * Creates a plain object from a RunAssetDiscoveryResponse message. Also converts values to other types if specified. - * @param message RunAssetDiscoveryResponse + * Creates a plain object from a NotificationMessage message. Also converts values to other types if specified. + * @param message NotificationMessage * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.securitycenter.v1.RunAssetDiscoveryResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.securitycenter.v1.NotificationMessage, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this RunAssetDiscoveryResponse to JSON. + * Converts this NotificationMessage to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - namespace RunAssetDiscoveryResponse { + /** Properties of an OrganizationSettings. */ + interface IOrganizationSettings { - /** State enum. */ - enum State { - STATE_UNSPECIFIED = 0, - COMPLETED = 1, - SUPERSEDED = 2, - TERMINATED = 3 - } + /** OrganizationSettings name */ + name?: (string|null); + + /** OrganizationSettings enableAssetDiscovery */ + enableAssetDiscovery?: (boolean|null); + + /** OrganizationSettings assetDiscoveryConfig */ + assetDiscoveryConfig?: (google.cloud.securitycenter.v1.OrganizationSettings.IAssetDiscoveryConfig|null); } - /** Represents a SecurityCenter */ - class SecurityCenter extends $protobuf.rpc.Service { + /** Represents an OrganizationSettings. */ + class OrganizationSettings implements IOrganizationSettings { /** - * Constructs a new SecurityCenter service. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited + * Constructs a new OrganizationSettings. + * @param [properties] Properties to set */ - constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + constructor(properties?: google.cloud.securitycenter.v1.IOrganizationSettings); - /** - * Creates new SecurityCenter service using the specified rpc implementation. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited + /** OrganizationSettings name. */ + public name: string; + + /** OrganizationSettings enableAssetDiscovery. */ + public enableAssetDiscovery: boolean; + + /** OrganizationSettings assetDiscoveryConfig. */ + public assetDiscoveryConfig?: (google.cloud.securitycenter.v1.OrganizationSettings.IAssetDiscoveryConfig|null); + + /** + * Creates a new OrganizationSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns OrganizationSettings instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IOrganizationSettings): google.cloud.securitycenter.v1.OrganizationSettings; + + /** + * Encodes the specified OrganizationSettings message. Does not implicitly {@link google.cloud.securitycenter.v1.OrganizationSettings.verify|verify} messages. + * @param message OrganizationSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IOrganizationSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OrganizationSettings message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.OrganizationSettings.verify|verify} messages. + * @param message OrganizationSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IOrganizationSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OrganizationSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OrganizationSettings + * @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.cloud.securitycenter.v1.OrganizationSettings; + + /** + * Decodes an OrganizationSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OrganizationSettings + * @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.cloud.securitycenter.v1.OrganizationSettings; + + /** + * Verifies an OrganizationSettings 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 OrganizationSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OrganizationSettings + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.OrganizationSettings; + + /** + * Creates a plain object from an OrganizationSettings message. Also converts values to other types if specified. + * @param message OrganizationSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.OrganizationSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OrganizationSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace OrganizationSettings { + + /** Properties of an AssetDiscoveryConfig. */ + interface IAssetDiscoveryConfig { + + /** AssetDiscoveryConfig projectIds */ + projectIds?: (string[]|null); + + /** AssetDiscoveryConfig inclusionMode */ + inclusionMode?: (google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode|keyof typeof google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode|null); + } + + /** Represents an AssetDiscoveryConfig. */ + class AssetDiscoveryConfig implements IAssetDiscoveryConfig { + + /** + * Constructs a new AssetDiscoveryConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.OrganizationSettings.IAssetDiscoveryConfig); + + /** AssetDiscoveryConfig projectIds. */ + public projectIds: string[]; + + /** AssetDiscoveryConfig inclusionMode. */ + public inclusionMode: (google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode|keyof typeof google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode); + + /** + * Creates a new AssetDiscoveryConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns AssetDiscoveryConfig instance + */ + public static create(properties?: google.cloud.securitycenter.v1.OrganizationSettings.IAssetDiscoveryConfig): google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig; + + /** + * Encodes the specified AssetDiscoveryConfig message. Does not implicitly {@link google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.verify|verify} messages. + * @param message AssetDiscoveryConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.OrganizationSettings.IAssetDiscoveryConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AssetDiscoveryConfig message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.verify|verify} messages. + * @param message AssetDiscoveryConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.OrganizationSettings.IAssetDiscoveryConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AssetDiscoveryConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AssetDiscoveryConfig + * @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.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig; + + /** + * Decodes an AssetDiscoveryConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AssetDiscoveryConfig + * @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.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig; + + /** + * Verifies an AssetDiscoveryConfig 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 AssetDiscoveryConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AssetDiscoveryConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig; + + /** + * Creates a plain object from an AssetDiscoveryConfig message. Also converts values to other types if specified. + * @param message AssetDiscoveryConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AssetDiscoveryConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace AssetDiscoveryConfig { + + /** InclusionMode enum. */ + enum InclusionMode { + INCLUSION_MODE_UNSPECIFIED = 0, + INCLUDE_ONLY = 1, + EXCLUDE = 2 + } + } + } + + /** Properties of a RunAssetDiscoveryResponse. */ + interface IRunAssetDiscoveryResponse { + + /** RunAssetDiscoveryResponse state */ + state?: (google.cloud.securitycenter.v1.RunAssetDiscoveryResponse.State|keyof typeof google.cloud.securitycenter.v1.RunAssetDiscoveryResponse.State|null); + + /** RunAssetDiscoveryResponse duration */ + duration?: (google.protobuf.IDuration|null); + } + + /** Represents a RunAssetDiscoveryResponse. */ + class RunAssetDiscoveryResponse implements IRunAssetDiscoveryResponse { + + /** + * Constructs a new RunAssetDiscoveryResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IRunAssetDiscoveryResponse); + + /** RunAssetDiscoveryResponse state. */ + public state: (google.cloud.securitycenter.v1.RunAssetDiscoveryResponse.State|keyof typeof google.cloud.securitycenter.v1.RunAssetDiscoveryResponse.State); + + /** RunAssetDiscoveryResponse duration. */ + public duration?: (google.protobuf.IDuration|null); + + /** + * Creates a new RunAssetDiscoveryResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns RunAssetDiscoveryResponse instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IRunAssetDiscoveryResponse): google.cloud.securitycenter.v1.RunAssetDiscoveryResponse; + + /** + * Encodes the specified RunAssetDiscoveryResponse message. Does not implicitly {@link google.cloud.securitycenter.v1.RunAssetDiscoveryResponse.verify|verify} messages. + * @param message RunAssetDiscoveryResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IRunAssetDiscoveryResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RunAssetDiscoveryResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.RunAssetDiscoveryResponse.verify|verify} messages. + * @param message RunAssetDiscoveryResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IRunAssetDiscoveryResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RunAssetDiscoveryResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RunAssetDiscoveryResponse + * @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.cloud.securitycenter.v1.RunAssetDiscoveryResponse; + + /** + * Decodes a RunAssetDiscoveryResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RunAssetDiscoveryResponse + * @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.cloud.securitycenter.v1.RunAssetDiscoveryResponse; + + /** + * Verifies a RunAssetDiscoveryResponse 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 RunAssetDiscoveryResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RunAssetDiscoveryResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.RunAssetDiscoveryResponse; + + /** + * Creates a plain object from a RunAssetDiscoveryResponse message. Also converts values to other types if specified. + * @param message RunAssetDiscoveryResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.RunAssetDiscoveryResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RunAssetDiscoveryResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace RunAssetDiscoveryResponse { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + COMPLETED = 1, + SUPERSEDED = 2, + TERMINATED = 3 + } + } + + /** Represents a SecurityCenter */ + class SecurityCenter extends $protobuf.rpc.Service { + + /** + * Constructs a new SecurityCenter 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 SecurityCenter 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): SecurityCenter; + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): SecurityCenter; + + /** + * Calls CreateSource. + * @param request CreateSourceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Source + */ + public createSource(request: google.cloud.securitycenter.v1.ICreateSourceRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.CreateSourceCallback): void; + + /** + * Calls CreateSource. + * @param request CreateSourceRequest message or plain object + * @returns Promise + */ + public createSource(request: google.cloud.securitycenter.v1.ICreateSourceRequest): Promise; + + /** + * Calls CreateFinding. + * @param request CreateFindingRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Finding + */ + public createFinding(request: google.cloud.securitycenter.v1.ICreateFindingRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.CreateFindingCallback): void; + + /** + * Calls CreateFinding. + * @param request CreateFindingRequest message or plain object + * @returns Promise + */ + public createFinding(request: google.cloud.securitycenter.v1.ICreateFindingRequest): Promise; + + /** + * Calls CreateNotificationConfig. + * @param request CreateNotificationConfigRequest message or plain object + * @param callback Node-style callback called with the error, if any, and NotificationConfig + */ + public createNotificationConfig(request: google.cloud.securitycenter.v1.ICreateNotificationConfigRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.CreateNotificationConfigCallback): void; + + /** + * Calls CreateNotificationConfig. + * @param request CreateNotificationConfigRequest message or plain object + * @returns Promise + */ + public createNotificationConfig(request: google.cloud.securitycenter.v1.ICreateNotificationConfigRequest): Promise; + + /** + * Calls DeleteNotificationConfig. + * @param request DeleteNotificationConfigRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteNotificationConfig(request: google.cloud.securitycenter.v1.IDeleteNotificationConfigRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.DeleteNotificationConfigCallback): void; + + /** + * Calls DeleteNotificationConfig. + * @param request DeleteNotificationConfigRequest message or plain object + * @returns Promise + */ + public deleteNotificationConfig(request: google.cloud.securitycenter.v1.IDeleteNotificationConfigRequest): Promise; + + /** + * Calls GetIamPolicy. + * @param request GetIamPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Policy + */ + public getIamPolicy(request: google.iam.v1.IGetIamPolicyRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.GetIamPolicyCallback): void; + + /** + * Calls GetIamPolicy. + * @param request GetIamPolicyRequest message or plain object + * @returns Promise + */ + public getIamPolicy(request: google.iam.v1.IGetIamPolicyRequest): Promise; + + /** + * Calls GetNotificationConfig. + * @param request GetNotificationConfigRequest message or plain object + * @param callback Node-style callback called with the error, if any, and NotificationConfig + */ + public getNotificationConfig(request: google.cloud.securitycenter.v1.IGetNotificationConfigRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.GetNotificationConfigCallback): void; + + /** + * Calls GetNotificationConfig. + * @param request GetNotificationConfigRequest message or plain object + * @returns Promise + */ + public getNotificationConfig(request: google.cloud.securitycenter.v1.IGetNotificationConfigRequest): Promise; + + /** + * Calls GetOrganizationSettings. + * @param request GetOrganizationSettingsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and OrganizationSettings + */ + public getOrganizationSettings(request: google.cloud.securitycenter.v1.IGetOrganizationSettingsRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.GetOrganizationSettingsCallback): void; + + /** + * Calls GetOrganizationSettings. + * @param request GetOrganizationSettingsRequest message or plain object + * @returns Promise + */ + public getOrganizationSettings(request: google.cloud.securitycenter.v1.IGetOrganizationSettingsRequest): Promise; + + /** + * Calls GetSource. + * @param request GetSourceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Source + */ + public getSource(request: google.cloud.securitycenter.v1.IGetSourceRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.GetSourceCallback): void; + + /** + * Calls GetSource. + * @param request GetSourceRequest message or plain object + * @returns Promise + */ + public getSource(request: google.cloud.securitycenter.v1.IGetSourceRequest): Promise; + + /** + * Calls GroupAssets. + * @param request GroupAssetsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and GroupAssetsResponse + */ + public groupAssets(request: google.cloud.securitycenter.v1.IGroupAssetsRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.GroupAssetsCallback): void; /** - * Calls CreateSource. - * @param request CreateSourceRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Source + * Calls GroupAssets. + * @param request GroupAssetsRequest message or plain object + * @returns Promise */ - public createSource(request: google.cloud.securitycenter.v1.ICreateSourceRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.CreateSourceCallback): void; + public groupAssets(request: google.cloud.securitycenter.v1.IGroupAssetsRequest): Promise; /** - * Calls CreateSource. - * @param request CreateSourceRequest message or plain object + * Calls GroupFindings. + * @param request GroupFindingsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and GroupFindingsResponse + */ + public groupFindings(request: google.cloud.securitycenter.v1.IGroupFindingsRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.GroupFindingsCallback): void; + + /** + * Calls GroupFindings. + * @param request GroupFindingsRequest message or plain object * @returns Promise */ - public createSource(request: google.cloud.securitycenter.v1.ICreateSourceRequest): Promise; + public groupFindings(request: google.cloud.securitycenter.v1.IGroupFindingsRequest): Promise; /** - * Calls CreateFinding. - * @param request CreateFindingRequest message or plain object + * Calls ListAssets. + * @param request ListAssetsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListAssetsResponse + */ + public listAssets(request: google.cloud.securitycenter.v1.IListAssetsRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.ListAssetsCallback): void; + + /** + * Calls ListAssets. + * @param request ListAssetsRequest message or plain object + * @returns Promise + */ + public listAssets(request: google.cloud.securitycenter.v1.IListAssetsRequest): Promise; + + /** + * Calls ListFindings. + * @param request ListFindingsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListFindingsResponse + */ + public listFindings(request: google.cloud.securitycenter.v1.IListFindingsRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.ListFindingsCallback): void; + + /** + * Calls ListFindings. + * @param request ListFindingsRequest message or plain object + * @returns Promise + */ + public listFindings(request: google.cloud.securitycenter.v1.IListFindingsRequest): Promise; + + /** + * Calls ListNotificationConfigs. + * @param request ListNotificationConfigsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListNotificationConfigsResponse + */ + public listNotificationConfigs(request: google.cloud.securitycenter.v1.IListNotificationConfigsRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.ListNotificationConfigsCallback): void; + + /** + * Calls ListNotificationConfigs. + * @param request ListNotificationConfigsRequest message or plain object + * @returns Promise + */ + public listNotificationConfigs(request: google.cloud.securitycenter.v1.IListNotificationConfigsRequest): Promise; + + /** + * Calls ListSources. + * @param request ListSourcesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListSourcesResponse + */ + public listSources(request: google.cloud.securitycenter.v1.IListSourcesRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.ListSourcesCallback): void; + + /** + * Calls ListSources. + * @param request ListSourcesRequest message or plain object + * @returns Promise + */ + public listSources(request: google.cloud.securitycenter.v1.IListSourcesRequest): Promise; + + /** + * Calls RunAssetDiscovery. + * @param request RunAssetDiscoveryRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public runAssetDiscovery(request: google.cloud.securitycenter.v1.IRunAssetDiscoveryRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.RunAssetDiscoveryCallback): void; + + /** + * Calls RunAssetDiscovery. + * @param request RunAssetDiscoveryRequest message or plain object + * @returns Promise + */ + public runAssetDiscovery(request: google.cloud.securitycenter.v1.IRunAssetDiscoveryRequest): Promise; + + /** + * Calls SetFindingState. + * @param request SetFindingStateRequest message or plain object * @param callback Node-style callback called with the error, if any, and Finding */ - public createFinding(request: google.cloud.securitycenter.v1.ICreateFindingRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.CreateFindingCallback): void; + public setFindingState(request: google.cloud.securitycenter.v1.ISetFindingStateRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.SetFindingStateCallback): void; /** - * Calls CreateFinding. - * @param request CreateFindingRequest message or plain object + * Calls SetFindingState. + * @param request SetFindingStateRequest message or plain object * @returns Promise */ - public createFinding(request: google.cloud.securitycenter.v1.ICreateFindingRequest): Promise; + public setFindingState(request: google.cloud.securitycenter.v1.ISetFindingStateRequest): Promise; /** - * Calls GetIamPolicy. - * @param request GetIamPolicyRequest message or plain object + * Calls SetIamPolicy. + * @param request SetIamPolicyRequest message or plain object * @param callback Node-style callback called with the error, if any, and Policy */ - public getIamPolicy(request: google.iam.v1.IGetIamPolicyRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.GetIamPolicyCallback): void; + public setIamPolicy(request: google.iam.v1.ISetIamPolicyRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.SetIamPolicyCallback): void; /** - * Calls GetIamPolicy. - * @param request GetIamPolicyRequest message or plain object + * Calls SetIamPolicy. + * @param request SetIamPolicyRequest message or plain object * @returns Promise */ - public getIamPolicy(request: google.iam.v1.IGetIamPolicyRequest): Promise; + public setIamPolicy(request: google.iam.v1.ISetIamPolicyRequest): Promise; /** - * Calls GetOrganizationSettings. - * @param request GetOrganizationSettingsRequest message or plain object + * Calls TestIamPermissions. + * @param request TestIamPermissionsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and TestIamPermissionsResponse + */ + public testIamPermissions(request: google.iam.v1.ITestIamPermissionsRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.TestIamPermissionsCallback): void; + + /** + * Calls TestIamPermissions. + * @param request TestIamPermissionsRequest message or plain object + * @returns Promise + */ + public testIamPermissions(request: google.iam.v1.ITestIamPermissionsRequest): Promise; + + /** + * Calls UpdateFinding. + * @param request UpdateFindingRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Finding + */ + public updateFinding(request: google.cloud.securitycenter.v1.IUpdateFindingRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.UpdateFindingCallback): void; + + /** + * Calls UpdateFinding. + * @param request UpdateFindingRequest message or plain object + * @returns Promise + */ + public updateFinding(request: google.cloud.securitycenter.v1.IUpdateFindingRequest): Promise; + + /** + * Calls UpdateNotificationConfig. + * @param request UpdateNotificationConfigRequest message or plain object + * @param callback Node-style callback called with the error, if any, and NotificationConfig + */ + public updateNotificationConfig(request: google.cloud.securitycenter.v1.IUpdateNotificationConfigRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.UpdateNotificationConfigCallback): void; + + /** + * Calls UpdateNotificationConfig. + * @param request UpdateNotificationConfigRequest message or plain object + * @returns Promise + */ + public updateNotificationConfig(request: google.cloud.securitycenter.v1.IUpdateNotificationConfigRequest): Promise; + + /** + * Calls UpdateOrganizationSettings. + * @param request UpdateOrganizationSettingsRequest message or plain object * @param callback Node-style callback called with the error, if any, and OrganizationSettings */ - public getOrganizationSettings(request: google.cloud.securitycenter.v1.IGetOrganizationSettingsRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.GetOrganizationSettingsCallback): void; + public updateOrganizationSettings(request: google.cloud.securitycenter.v1.IUpdateOrganizationSettingsRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.UpdateOrganizationSettingsCallback): void; /** - * Calls GetOrganizationSettings. - * @param request GetOrganizationSettingsRequest message or plain object + * Calls UpdateOrganizationSettings. + * @param request UpdateOrganizationSettingsRequest message or plain object * @returns Promise */ - public getOrganizationSettings(request: google.cloud.securitycenter.v1.IGetOrganizationSettingsRequest): Promise; + public updateOrganizationSettings(request: google.cloud.securitycenter.v1.IUpdateOrganizationSettingsRequest): Promise; /** - * Calls GetSource. - * @param request GetSourceRequest message or plain object + * Calls UpdateSource. + * @param request UpdateSourceRequest message or plain object * @param callback Node-style callback called with the error, if any, and Source */ - public getSource(request: google.cloud.securitycenter.v1.IGetSourceRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.GetSourceCallback): void; + public updateSource(request: google.cloud.securitycenter.v1.IUpdateSourceRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.UpdateSourceCallback): void; + + /** + * Calls UpdateSource. + * @param request UpdateSourceRequest message or plain object + * @returns Promise + */ + public updateSource(request: google.cloud.securitycenter.v1.IUpdateSourceRequest): Promise; + + /** + * Calls UpdateSecurityMarks. + * @param request UpdateSecurityMarksRequest message or plain object + * @param callback Node-style callback called with the error, if any, and SecurityMarks + */ + public updateSecurityMarks(request: google.cloud.securitycenter.v1.IUpdateSecurityMarksRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.UpdateSecurityMarksCallback): void; + + /** + * Calls UpdateSecurityMarks. + * @param request UpdateSecurityMarksRequest message or plain object + * @returns Promise + */ + public updateSecurityMarks(request: google.cloud.securitycenter.v1.IUpdateSecurityMarksRequest): Promise; + } + + namespace SecurityCenter { + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#createSource}. + * @param error Error, if any + * @param [response] Source + */ + type CreateSourceCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.Source) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#createFinding}. + * @param error Error, if any + * @param [response] Finding + */ + type CreateFindingCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.Finding) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#createNotificationConfig}. + * @param error Error, if any + * @param [response] NotificationConfig + */ + type CreateNotificationConfigCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.NotificationConfig) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#deleteNotificationConfig}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteNotificationConfigCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#getIamPolicy}. + * @param error Error, if any + * @param [response] Policy + */ + type GetIamPolicyCallback = (error: (Error|null), response?: google.iam.v1.Policy) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#getNotificationConfig}. + * @param error Error, if any + * @param [response] NotificationConfig + */ + type GetNotificationConfigCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.NotificationConfig) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#getOrganizationSettings}. + * @param error Error, if any + * @param [response] OrganizationSettings + */ + type GetOrganizationSettingsCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.OrganizationSettings) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#getSource}. + * @param error Error, if any + * @param [response] Source + */ + type GetSourceCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.Source) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#groupAssets}. + * @param error Error, if any + * @param [response] GroupAssetsResponse + */ + type GroupAssetsCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.GroupAssetsResponse) => void; /** - * Calls GetSource. - * @param request GetSourceRequest message or plain object - * @returns Promise + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#groupFindings}. + * @param error Error, if any + * @param [response] GroupFindingsResponse */ - public getSource(request: google.cloud.securitycenter.v1.IGetSourceRequest): Promise; + type GroupFindingsCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.GroupFindingsResponse) => void; /** - * Calls GroupAssets. - * @param request GroupAssetsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and GroupAssetsResponse + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#listAssets}. + * @param error Error, if any + * @param [response] ListAssetsResponse */ - public groupAssets(request: google.cloud.securitycenter.v1.IGroupAssetsRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.GroupAssetsCallback): void; + type ListAssetsCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.ListAssetsResponse) => void; /** - * Calls GroupAssets. - * @param request GroupAssetsRequest message or plain object - * @returns Promise + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#listFindings}. + * @param error Error, if any + * @param [response] ListFindingsResponse */ - public groupAssets(request: google.cloud.securitycenter.v1.IGroupAssetsRequest): Promise; + type ListFindingsCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.ListFindingsResponse) => void; /** - * Calls GroupFindings. - * @param request GroupFindingsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and GroupFindingsResponse + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#listNotificationConfigs}. + * @param error Error, if any + * @param [response] ListNotificationConfigsResponse */ - public groupFindings(request: google.cloud.securitycenter.v1.IGroupFindingsRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.GroupFindingsCallback): void; + type ListNotificationConfigsCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.ListNotificationConfigsResponse) => void; /** - * Calls GroupFindings. - * @param request GroupFindingsRequest message or plain object - * @returns Promise + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#listSources}. + * @param error Error, if any + * @param [response] ListSourcesResponse */ - public groupFindings(request: google.cloud.securitycenter.v1.IGroupFindingsRequest): Promise; + type ListSourcesCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.ListSourcesResponse) => void; /** - * Calls ListAssets. - * @param request ListAssetsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListAssetsResponse + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#runAssetDiscovery}. + * @param error Error, if any + * @param [response] Operation */ - public listAssets(request: google.cloud.securitycenter.v1.IListAssetsRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.ListAssetsCallback): void; + type RunAssetDiscoveryCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; /** - * Calls ListAssets. - * @param request ListAssetsRequest message or plain object - * @returns Promise + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#setFindingState}. + * @param error Error, if any + * @param [response] Finding */ - public listAssets(request: google.cloud.securitycenter.v1.IListAssetsRequest): Promise; + type SetFindingStateCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.Finding) => void; /** - * Calls ListFindings. - * @param request ListFindingsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListFindingsResponse + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#setIamPolicy}. + * @param error Error, if any + * @param [response] Policy */ - public listFindings(request: google.cloud.securitycenter.v1.IListFindingsRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.ListFindingsCallback): void; + type SetIamPolicyCallback = (error: (Error|null), response?: google.iam.v1.Policy) => void; /** - * Calls ListFindings. - * @param request ListFindingsRequest message or plain object - * @returns Promise + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#testIamPermissions}. + * @param error Error, if any + * @param [response] TestIamPermissionsResponse */ - public listFindings(request: google.cloud.securitycenter.v1.IListFindingsRequest): Promise; + type TestIamPermissionsCallback = (error: (Error|null), response?: google.iam.v1.TestIamPermissionsResponse) => void; /** - * Calls ListSources. - * @param request ListSourcesRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListSourcesResponse + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#updateFinding}. + * @param error Error, if any + * @param [response] Finding */ - public listSources(request: google.cloud.securitycenter.v1.IListSourcesRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.ListSourcesCallback): void; + type UpdateFindingCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.Finding) => void; /** - * Calls ListSources. - * @param request ListSourcesRequest message or plain object - * @returns Promise + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#updateNotificationConfig}. + * @param error Error, if any + * @param [response] NotificationConfig */ - public listSources(request: google.cloud.securitycenter.v1.IListSourcesRequest): Promise; + type UpdateNotificationConfigCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.NotificationConfig) => void; /** - * Calls RunAssetDiscovery. - * @param request RunAssetDiscoveryRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#updateOrganizationSettings}. + * @param error Error, if any + * @param [response] OrganizationSettings */ - public runAssetDiscovery(request: google.cloud.securitycenter.v1.IRunAssetDiscoveryRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.RunAssetDiscoveryCallback): void; + type UpdateOrganizationSettingsCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.OrganizationSettings) => void; /** - * Calls RunAssetDiscovery. - * @param request RunAssetDiscoveryRequest message or plain object - * @returns Promise + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#updateSource}. + * @param error Error, if any + * @param [response] Source */ - public runAssetDiscovery(request: google.cloud.securitycenter.v1.IRunAssetDiscoveryRequest): Promise; + type UpdateSourceCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.Source) => void; /** - * Calls SetFindingState. - * @param request SetFindingStateRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Finding + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#updateSecurityMarks}. + * @param error Error, if any + * @param [response] SecurityMarks */ - public setFindingState(request: google.cloud.securitycenter.v1.ISetFindingStateRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.SetFindingStateCallback): void; + type UpdateSecurityMarksCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.SecurityMarks) => void; + } + + /** Properties of a CreateFindingRequest. */ + interface ICreateFindingRequest { + + /** CreateFindingRequest parent */ + parent?: (string|null); + + /** CreateFindingRequest findingId */ + findingId?: (string|null); + + /** CreateFindingRequest finding */ + finding?: (google.cloud.securitycenter.v1.IFinding|null); + } + + /** Represents a CreateFindingRequest. */ + class CreateFindingRequest implements ICreateFindingRequest { /** - * Calls SetFindingState. - * @param request SetFindingStateRequest message or plain object - * @returns Promise + * Constructs a new CreateFindingRequest. + * @param [properties] Properties to set */ - public setFindingState(request: google.cloud.securitycenter.v1.ISetFindingStateRequest): Promise; + constructor(properties?: google.cloud.securitycenter.v1.ICreateFindingRequest); + + /** CreateFindingRequest parent. */ + public parent: string; + + /** CreateFindingRequest findingId. */ + public findingId: string; + + /** CreateFindingRequest finding. */ + public finding?: (google.cloud.securitycenter.v1.IFinding|null); /** - * Calls SetIamPolicy. - * @param request SetIamPolicyRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Policy + * Creates a new CreateFindingRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateFindingRequest instance */ - public setIamPolicy(request: google.iam.v1.ISetIamPolicyRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.SetIamPolicyCallback): void; + public static create(properties?: google.cloud.securitycenter.v1.ICreateFindingRequest): google.cloud.securitycenter.v1.CreateFindingRequest; /** - * Calls SetIamPolicy. - * @param request SetIamPolicyRequest message or plain object - * @returns Promise + * Encodes the specified CreateFindingRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.CreateFindingRequest.verify|verify} messages. + * @param message CreateFindingRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - public setIamPolicy(request: google.iam.v1.ISetIamPolicyRequest): Promise; + public static encode(message: google.cloud.securitycenter.v1.ICreateFindingRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Calls TestIamPermissions. - * @param request TestIamPermissionsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and TestIamPermissionsResponse + * Encodes the specified CreateFindingRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.CreateFindingRequest.verify|verify} messages. + * @param message CreateFindingRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - public testIamPermissions(request: google.iam.v1.ITestIamPermissionsRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.TestIamPermissionsCallback): void; + public static encodeDelimited(message: google.cloud.securitycenter.v1.ICreateFindingRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Calls TestIamPermissions. - * @param request TestIamPermissionsRequest message or plain object - * @returns Promise + * Decodes a CreateFindingRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateFindingRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public testIamPermissions(request: google.iam.v1.ITestIamPermissionsRequest): Promise; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1.CreateFindingRequest; /** - * Calls UpdateFinding. - * @param request UpdateFindingRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Finding + * Decodes a CreateFindingRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateFindingRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public updateFinding(request: google.cloud.securitycenter.v1.IUpdateFindingRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.UpdateFindingCallback): void; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1.CreateFindingRequest; /** - * Calls UpdateFinding. - * @param request UpdateFindingRequest message or plain object - * @returns Promise + * Verifies a CreateFindingRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not */ - public updateFinding(request: google.cloud.securitycenter.v1.IUpdateFindingRequest): Promise; + public static verify(message: { [k: string]: any }): (string|null); /** - * Calls UpdateOrganizationSettings. - * @param request UpdateOrganizationSettingsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and OrganizationSettings + * Creates a CreateFindingRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateFindingRequest */ - public updateOrganizationSettings(request: google.cloud.securitycenter.v1.IUpdateOrganizationSettingsRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.UpdateOrganizationSettingsCallback): void; + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.CreateFindingRequest; /** - * Calls UpdateOrganizationSettings. - * @param request UpdateOrganizationSettingsRequest message or plain object - * @returns Promise + * Creates a plain object from a CreateFindingRequest message. Also converts values to other types if specified. + * @param message CreateFindingRequest + * @param [options] Conversion options + * @returns Plain object */ - public updateOrganizationSettings(request: google.cloud.securitycenter.v1.IUpdateOrganizationSettingsRequest): Promise; + public static toObject(message: google.cloud.securitycenter.v1.CreateFindingRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Calls UpdateSource. - * @param request UpdateSourceRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Source + * Converts this CreateFindingRequest to JSON. + * @returns JSON object */ - public updateSource(request: google.cloud.securitycenter.v1.IUpdateSourceRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.UpdateSourceCallback): void; + public toJSON(): { [k: string]: any }; + } + + /** Properties of a CreateNotificationConfigRequest. */ + interface ICreateNotificationConfigRequest { + + /** CreateNotificationConfigRequest parent */ + parent?: (string|null); + + /** CreateNotificationConfigRequest configId */ + configId?: (string|null); + + /** CreateNotificationConfigRequest notificationConfig */ + notificationConfig?: (google.cloud.securitycenter.v1.INotificationConfig|null); + } + + /** Represents a CreateNotificationConfigRequest. */ + class CreateNotificationConfigRequest implements ICreateNotificationConfigRequest { /** - * Calls UpdateSource. - * @param request UpdateSourceRequest message or plain object - * @returns Promise + * Constructs a new CreateNotificationConfigRequest. + * @param [properties] Properties to set */ - public updateSource(request: google.cloud.securitycenter.v1.IUpdateSourceRequest): Promise; + constructor(properties?: google.cloud.securitycenter.v1.ICreateNotificationConfigRequest); + + /** CreateNotificationConfigRequest parent. */ + public parent: string; + + /** CreateNotificationConfigRequest configId. */ + public configId: string; + + /** CreateNotificationConfigRequest notificationConfig. */ + public notificationConfig?: (google.cloud.securitycenter.v1.INotificationConfig|null); /** - * Calls UpdateSecurityMarks. - * @param request UpdateSecurityMarksRequest message or plain object - * @param callback Node-style callback called with the error, if any, and SecurityMarks + * Creates a new CreateNotificationConfigRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateNotificationConfigRequest instance */ - public updateSecurityMarks(request: google.cloud.securitycenter.v1.IUpdateSecurityMarksRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.UpdateSecurityMarksCallback): void; + public static create(properties?: google.cloud.securitycenter.v1.ICreateNotificationConfigRequest): google.cloud.securitycenter.v1.CreateNotificationConfigRequest; /** - * Calls UpdateSecurityMarks. - * @param request UpdateSecurityMarksRequest message or plain object - * @returns Promise + * Encodes the specified CreateNotificationConfigRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.CreateNotificationConfigRequest.verify|verify} messages. + * @param message CreateNotificationConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - public updateSecurityMarks(request: google.cloud.securitycenter.v1.IUpdateSecurityMarksRequest): Promise; - } - - namespace SecurityCenter { + public static encode(message: google.cloud.securitycenter.v1.ICreateNotificationConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#createSource}. - * @param error Error, if any - * @param [response] Source + * Encodes the specified CreateNotificationConfigRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.CreateNotificationConfigRequest.verify|verify} messages. + * @param message CreateNotificationConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - type CreateSourceCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.Source) => void; + public static encodeDelimited(message: google.cloud.securitycenter.v1.ICreateNotificationConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#createFinding}. - * @param error Error, if any - * @param [response] Finding + * Decodes a CreateNotificationConfigRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateNotificationConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - type CreateFindingCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.Finding) => void; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1.CreateNotificationConfigRequest; /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#getIamPolicy}. - * @param error Error, if any - * @param [response] Policy + * Decodes a CreateNotificationConfigRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateNotificationConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - type GetIamPolicyCallback = (error: (Error|null), response?: google.iam.v1.Policy) => void; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1.CreateNotificationConfigRequest; /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#getOrganizationSettings}. - * @param error Error, if any - * @param [response] OrganizationSettings + * Verifies a CreateNotificationConfigRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not */ - type GetOrganizationSettingsCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.OrganizationSettings) => void; + public static verify(message: { [k: string]: any }): (string|null); /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#getSource}. - * @param error Error, if any - * @param [response] Source + * Creates a CreateNotificationConfigRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateNotificationConfigRequest */ - type GetSourceCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.Source) => void; + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.CreateNotificationConfigRequest; /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#groupAssets}. - * @param error Error, if any - * @param [response] GroupAssetsResponse + * Creates a plain object from a CreateNotificationConfigRequest message. Also converts values to other types if specified. + * @param message CreateNotificationConfigRequest + * @param [options] Conversion options + * @returns Plain object */ - type GroupAssetsCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.GroupAssetsResponse) => void; + public static toObject(message: google.cloud.securitycenter.v1.CreateNotificationConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#groupFindings}. - * @param error Error, if any - * @param [response] GroupFindingsResponse + * Converts this CreateNotificationConfigRequest to JSON. + * @returns JSON object */ - type GroupFindingsCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.GroupFindingsResponse) => void; + public toJSON(): { [k: string]: any }; + } - /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#listAssets}. - * @param error Error, if any - * @param [response] ListAssetsResponse - */ - type ListAssetsCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.ListAssetsResponse) => void; + /** Properties of a CreateSourceRequest. */ + interface ICreateSourceRequest { + + /** CreateSourceRequest parent */ + parent?: (string|null); + + /** CreateSourceRequest source */ + source?: (google.cloud.securitycenter.v1.ISource|null); + } + + /** Represents a CreateSourceRequest. */ + class CreateSourceRequest implements ICreateSourceRequest { /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#listFindings}. - * @param error Error, if any - * @param [response] ListFindingsResponse + * Constructs a new CreateSourceRequest. + * @param [properties] Properties to set */ - type ListFindingsCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.ListFindingsResponse) => void; + constructor(properties?: google.cloud.securitycenter.v1.ICreateSourceRequest); + + /** CreateSourceRequest parent. */ + public parent: string; + + /** CreateSourceRequest source. */ + public source?: (google.cloud.securitycenter.v1.ISource|null); /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#listSources}. - * @param error Error, if any - * @param [response] ListSourcesResponse + * Creates a new CreateSourceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateSourceRequest instance */ - type ListSourcesCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.ListSourcesResponse) => void; + public static create(properties?: google.cloud.securitycenter.v1.ICreateSourceRequest): google.cloud.securitycenter.v1.CreateSourceRequest; /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#runAssetDiscovery}. - * @param error Error, if any - * @param [response] Operation + * Encodes the specified CreateSourceRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.CreateSourceRequest.verify|verify} messages. + * @param message CreateSourceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - type RunAssetDiscoveryCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + public static encode(message: google.cloud.securitycenter.v1.ICreateSourceRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#setFindingState}. - * @param error Error, if any - * @param [response] Finding + * Encodes the specified CreateSourceRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.CreateSourceRequest.verify|verify} messages. + * @param message CreateSourceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - type SetFindingStateCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.Finding) => void; + public static encodeDelimited(message: google.cloud.securitycenter.v1.ICreateSourceRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#setIamPolicy}. - * @param error Error, if any - * @param [response] Policy + * Decodes a CreateSourceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateSourceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - type SetIamPolicyCallback = (error: (Error|null), response?: google.iam.v1.Policy) => void; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1.CreateSourceRequest; /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#testIamPermissions}. - * @param error Error, if any - * @param [response] TestIamPermissionsResponse + * Decodes a CreateSourceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateSourceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - type TestIamPermissionsCallback = (error: (Error|null), response?: google.iam.v1.TestIamPermissionsResponse) => void; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1.CreateSourceRequest; /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#updateFinding}. - * @param error Error, if any - * @param [response] Finding + * Verifies a CreateSourceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not */ - type UpdateFindingCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.Finding) => void; + public static verify(message: { [k: string]: any }): (string|null); /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#updateOrganizationSettings}. - * @param error Error, if any - * @param [response] OrganizationSettings + * Creates a CreateSourceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateSourceRequest */ - type UpdateOrganizationSettingsCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.OrganizationSettings) => void; + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.CreateSourceRequest; /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#updateSource}. - * @param error Error, if any - * @param [response] Source + * Creates a plain object from a CreateSourceRequest message. Also converts values to other types if specified. + * @param message CreateSourceRequest + * @param [options] Conversion options + * @returns Plain object */ - type UpdateSourceCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.Source) => void; + public static toObject(message: google.cloud.securitycenter.v1.CreateSourceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#updateSecurityMarks}. - * @param error Error, if any - * @param [response] SecurityMarks + * Converts this CreateSourceRequest to JSON. + * @returns JSON object */ - type UpdateSecurityMarksCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.SecurityMarks) => void; + public toJSON(): { [k: string]: any }; } - /** Properties of a CreateFindingRequest. */ - interface ICreateFindingRequest { - - /** CreateFindingRequest parent */ - parent?: (string|null); - - /** CreateFindingRequest findingId */ - findingId?: (string|null); + /** Properties of a DeleteNotificationConfigRequest. */ + interface IDeleteNotificationConfigRequest { - /** CreateFindingRequest finding */ - finding?: (google.cloud.securitycenter.v1.IFinding|null); + /** DeleteNotificationConfigRequest name */ + name?: (string|null); } - /** Represents a CreateFindingRequest. */ - class CreateFindingRequest implements ICreateFindingRequest { + /** Represents a DeleteNotificationConfigRequest. */ + class DeleteNotificationConfigRequest implements IDeleteNotificationConfigRequest { /** - * Constructs a new CreateFindingRequest. + * Constructs a new DeleteNotificationConfigRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.securitycenter.v1.ICreateFindingRequest); - - /** CreateFindingRequest parent. */ - public parent: string; - - /** CreateFindingRequest findingId. */ - public findingId: string; + constructor(properties?: google.cloud.securitycenter.v1.IDeleteNotificationConfigRequest); - /** CreateFindingRequest finding. */ - public finding?: (google.cloud.securitycenter.v1.IFinding|null); + /** DeleteNotificationConfigRequest name. */ + public name: string; /** - * Creates a new CreateFindingRequest instance using the specified properties. + * Creates a new DeleteNotificationConfigRequest instance using the specified properties. * @param [properties] Properties to set - * @returns CreateFindingRequest instance + * @returns DeleteNotificationConfigRequest instance */ - public static create(properties?: google.cloud.securitycenter.v1.ICreateFindingRequest): google.cloud.securitycenter.v1.CreateFindingRequest; + public static create(properties?: google.cloud.securitycenter.v1.IDeleteNotificationConfigRequest): google.cloud.securitycenter.v1.DeleteNotificationConfigRequest; /** - * Encodes the specified CreateFindingRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.CreateFindingRequest.verify|verify} messages. - * @param message CreateFindingRequest message or plain object to encode + * Encodes the specified DeleteNotificationConfigRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.DeleteNotificationConfigRequest.verify|verify} messages. + * @param message DeleteNotificationConfigRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.securitycenter.v1.ICreateFindingRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.securitycenter.v1.IDeleteNotificationConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified CreateFindingRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.CreateFindingRequest.verify|verify} messages. - * @param message CreateFindingRequest message or plain object to encode + * Encodes the specified DeleteNotificationConfigRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.DeleteNotificationConfigRequest.verify|verify} messages. + * @param message DeleteNotificationConfigRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.securitycenter.v1.ICreateFindingRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.securitycenter.v1.IDeleteNotificationConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a CreateFindingRequest message from the specified reader or buffer. + * Decodes a DeleteNotificationConfigRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns CreateFindingRequest + * @returns DeleteNotificationConfigRequest * @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.cloud.securitycenter.v1.CreateFindingRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1.DeleteNotificationConfigRequest; /** - * Decodes a CreateFindingRequest message from the specified reader or buffer, length delimited. + * Decodes a DeleteNotificationConfigRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns CreateFindingRequest + * @returns DeleteNotificationConfigRequest * @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.cloud.securitycenter.v1.CreateFindingRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1.DeleteNotificationConfigRequest; /** - * Verifies a CreateFindingRequest message. + * Verifies a DeleteNotificationConfigRequest 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 CreateFindingRequest message from a plain object. Also converts values to their respective internal types. + * Creates a DeleteNotificationConfigRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns CreateFindingRequest + * @returns DeleteNotificationConfigRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.CreateFindingRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.DeleteNotificationConfigRequest; /** - * Creates a plain object from a CreateFindingRequest message. Also converts values to other types if specified. - * @param message CreateFindingRequest + * Creates a plain object from a DeleteNotificationConfigRequest message. Also converts values to other types if specified. + * @param message DeleteNotificationConfigRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.securitycenter.v1.CreateFindingRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.securitycenter.v1.DeleteNotificationConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this CreateFindingRequest to JSON. + * Converts this DeleteNotificationConfigRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a CreateSourceRequest. */ - interface ICreateSourceRequest { - - /** CreateSourceRequest parent */ - parent?: (string|null); + /** Properties of a GetNotificationConfigRequest. */ + interface IGetNotificationConfigRequest { - /** CreateSourceRequest source */ - source?: (google.cloud.securitycenter.v1.ISource|null); + /** GetNotificationConfigRequest name */ + name?: (string|null); } - /** Represents a CreateSourceRequest. */ - class CreateSourceRequest implements ICreateSourceRequest { + /** Represents a GetNotificationConfigRequest. */ + class GetNotificationConfigRequest implements IGetNotificationConfigRequest { /** - * Constructs a new CreateSourceRequest. + * Constructs a new GetNotificationConfigRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.securitycenter.v1.ICreateSourceRequest); + constructor(properties?: google.cloud.securitycenter.v1.IGetNotificationConfigRequest); - /** CreateSourceRequest parent. */ - public parent: string; - - /** CreateSourceRequest source. */ - public source?: (google.cloud.securitycenter.v1.ISource|null); + /** GetNotificationConfigRequest name. */ + public name: string; /** - * Creates a new CreateSourceRequest instance using the specified properties. + * Creates a new GetNotificationConfigRequest instance using the specified properties. * @param [properties] Properties to set - * @returns CreateSourceRequest instance + * @returns GetNotificationConfigRequest instance */ - public static create(properties?: google.cloud.securitycenter.v1.ICreateSourceRequest): google.cloud.securitycenter.v1.CreateSourceRequest; + public static create(properties?: google.cloud.securitycenter.v1.IGetNotificationConfigRequest): google.cloud.securitycenter.v1.GetNotificationConfigRequest; /** - * Encodes the specified CreateSourceRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.CreateSourceRequest.verify|verify} messages. - * @param message CreateSourceRequest message or plain object to encode + * Encodes the specified GetNotificationConfigRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.GetNotificationConfigRequest.verify|verify} messages. + * @param message GetNotificationConfigRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.securitycenter.v1.ICreateSourceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.securitycenter.v1.IGetNotificationConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified CreateSourceRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.CreateSourceRequest.verify|verify} messages. - * @param message CreateSourceRequest message or plain object to encode + * Encodes the specified GetNotificationConfigRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.GetNotificationConfigRequest.verify|verify} messages. + * @param message GetNotificationConfigRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.securitycenter.v1.ICreateSourceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.securitycenter.v1.IGetNotificationConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a CreateSourceRequest message from the specified reader or buffer. + * Decodes a GetNotificationConfigRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns CreateSourceRequest + * @returns GetNotificationConfigRequest * @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.cloud.securitycenter.v1.CreateSourceRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1.GetNotificationConfigRequest; /** - * Decodes a CreateSourceRequest message from the specified reader or buffer, length delimited. + * Decodes a GetNotificationConfigRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns CreateSourceRequest + * @returns GetNotificationConfigRequest * @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.cloud.securitycenter.v1.CreateSourceRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1.GetNotificationConfigRequest; /** - * Verifies a CreateSourceRequest message. + * Verifies a GetNotificationConfigRequest 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 CreateSourceRequest message from a plain object. Also converts values to their respective internal types. + * Creates a GetNotificationConfigRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns CreateSourceRequest + * @returns GetNotificationConfigRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.CreateSourceRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.GetNotificationConfigRequest; /** - * Creates a plain object from a CreateSourceRequest message. Also converts values to other types if specified. - * @param message CreateSourceRequest + * Creates a plain object from a GetNotificationConfigRequest message. Also converts values to other types if specified. + * @param message GetNotificationConfigRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.securitycenter.v1.CreateSourceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.securitycenter.v1.GetNotificationConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this CreateSourceRequest to JSON. + * Converts this GetNotificationConfigRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; @@ -2038,252 +2734,450 @@ export namespace google { public static encodeDelimited(message: google.cloud.securitycenter.v1.IGroupFindingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a GroupFindingsRequest message from the specified reader or buffer. + * Decodes a GroupFindingsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GroupFindingsRequest + * @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.cloud.securitycenter.v1.GroupFindingsRequest; + + /** + * Decodes a GroupFindingsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GroupFindingsRequest + * @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.cloud.securitycenter.v1.GroupFindingsRequest; + + /** + * Verifies a GroupFindingsRequest 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 GroupFindingsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GroupFindingsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.GroupFindingsRequest; + + /** + * Creates a plain object from a GroupFindingsRequest message. Also converts values to other types if specified. + * @param message GroupFindingsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.GroupFindingsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GroupFindingsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GroupFindingsResponse. */ + interface IGroupFindingsResponse { + + /** GroupFindingsResponse groupByResults */ + groupByResults?: (google.cloud.securitycenter.v1.IGroupResult[]|null); + + /** GroupFindingsResponse readTime */ + readTime?: (google.protobuf.ITimestamp|null); + + /** GroupFindingsResponse nextPageToken */ + nextPageToken?: (string|null); + + /** GroupFindingsResponse totalSize */ + totalSize?: (number|null); + } + + /** Represents a GroupFindingsResponse. */ + class GroupFindingsResponse implements IGroupFindingsResponse { + + /** + * Constructs a new GroupFindingsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IGroupFindingsResponse); + + /** GroupFindingsResponse groupByResults. */ + public groupByResults: google.cloud.securitycenter.v1.IGroupResult[]; + + /** GroupFindingsResponse readTime. */ + public readTime?: (google.protobuf.ITimestamp|null); + + /** GroupFindingsResponse nextPageToken. */ + public nextPageToken: string; + + /** GroupFindingsResponse totalSize. */ + public totalSize: number; + + /** + * Creates a new GroupFindingsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns GroupFindingsResponse instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IGroupFindingsResponse): google.cloud.securitycenter.v1.GroupFindingsResponse; + + /** + * Encodes the specified GroupFindingsResponse message. Does not implicitly {@link google.cloud.securitycenter.v1.GroupFindingsResponse.verify|verify} messages. + * @param message GroupFindingsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IGroupFindingsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GroupFindingsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.GroupFindingsResponse.verify|verify} messages. + * @param message GroupFindingsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IGroupFindingsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GroupFindingsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GroupFindingsResponse + * @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.cloud.securitycenter.v1.GroupFindingsResponse; + + /** + * Decodes a GroupFindingsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GroupFindingsResponse + * @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.cloud.securitycenter.v1.GroupFindingsResponse; + + /** + * Verifies a GroupFindingsResponse 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 GroupFindingsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GroupFindingsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.GroupFindingsResponse; + + /** + * Creates a plain object from a GroupFindingsResponse message. Also converts values to other types if specified. + * @param message GroupFindingsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.GroupFindingsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GroupFindingsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GroupResult. */ + interface IGroupResult { + + /** GroupResult properties */ + properties?: ({ [k: string]: google.protobuf.IValue }|null); + + /** GroupResult count */ + count?: (number|Long|string|null); + } + + /** Represents a GroupResult. */ + class GroupResult implements IGroupResult { + + /** + * Constructs a new GroupResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IGroupResult); + + /** GroupResult properties. */ + public properties: { [k: string]: google.protobuf.IValue }; + + /** GroupResult count. */ + public count: (number|Long|string); + + /** + * Creates a new GroupResult instance using the specified properties. + * @param [properties] Properties to set + * @returns GroupResult instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IGroupResult): google.cloud.securitycenter.v1.GroupResult; + + /** + * Encodes the specified GroupResult message. Does not implicitly {@link google.cloud.securitycenter.v1.GroupResult.verify|verify} messages. + * @param message GroupResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IGroupResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GroupResult message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.GroupResult.verify|verify} messages. + * @param message GroupResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IGroupResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GroupResult message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns GroupFindingsRequest + * @returns GroupResult * @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.cloud.securitycenter.v1.GroupFindingsRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1.GroupResult; /** - * Decodes a GroupFindingsRequest message from the specified reader or buffer, length delimited. + * Decodes a GroupResult message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns GroupFindingsRequest + * @returns GroupResult * @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.cloud.securitycenter.v1.GroupFindingsRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1.GroupResult; /** - * Verifies a GroupFindingsRequest message. + * Verifies a GroupResult 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 GroupFindingsRequest message from a plain object. Also converts values to their respective internal types. + * Creates a GroupResult message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns GroupFindingsRequest + * @returns GroupResult */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.GroupFindingsRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.GroupResult; /** - * Creates a plain object from a GroupFindingsRequest message. Also converts values to other types if specified. - * @param message GroupFindingsRequest + * Creates a plain object from a GroupResult message. Also converts values to other types if specified. + * @param message GroupResult * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.securitycenter.v1.GroupFindingsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.securitycenter.v1.GroupResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this GroupFindingsRequest to JSON. + * Converts this GroupResult to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a GroupFindingsResponse. */ - interface IGroupFindingsResponse { - - /** GroupFindingsResponse groupByResults */ - groupByResults?: (google.cloud.securitycenter.v1.IGroupResult[]|null); + /** Properties of a ListNotificationConfigsRequest. */ + interface IListNotificationConfigsRequest { - /** GroupFindingsResponse readTime */ - readTime?: (google.protobuf.ITimestamp|null); + /** ListNotificationConfigsRequest parent */ + parent?: (string|null); - /** GroupFindingsResponse nextPageToken */ - nextPageToken?: (string|null); + /** ListNotificationConfigsRequest pageToken */ + pageToken?: (string|null); - /** GroupFindingsResponse totalSize */ - totalSize?: (number|null); + /** ListNotificationConfigsRequest pageSize */ + pageSize?: (number|null); } - /** Represents a GroupFindingsResponse. */ - class GroupFindingsResponse implements IGroupFindingsResponse { + /** Represents a ListNotificationConfigsRequest. */ + class ListNotificationConfigsRequest implements IListNotificationConfigsRequest { /** - * Constructs a new GroupFindingsResponse. + * Constructs a new ListNotificationConfigsRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.securitycenter.v1.IGroupFindingsResponse); - - /** GroupFindingsResponse groupByResults. */ - public groupByResults: google.cloud.securitycenter.v1.IGroupResult[]; + constructor(properties?: google.cloud.securitycenter.v1.IListNotificationConfigsRequest); - /** GroupFindingsResponse readTime. */ - public readTime?: (google.protobuf.ITimestamp|null); + /** ListNotificationConfigsRequest parent. */ + public parent: string; - /** GroupFindingsResponse nextPageToken. */ - public nextPageToken: string; + /** ListNotificationConfigsRequest pageToken. */ + public pageToken: string; - /** GroupFindingsResponse totalSize. */ - public totalSize: number; + /** ListNotificationConfigsRequest pageSize. */ + public pageSize: number; /** - * Creates a new GroupFindingsResponse instance using the specified properties. + * Creates a new ListNotificationConfigsRequest instance using the specified properties. * @param [properties] Properties to set - * @returns GroupFindingsResponse instance + * @returns ListNotificationConfigsRequest instance */ - public static create(properties?: google.cloud.securitycenter.v1.IGroupFindingsResponse): google.cloud.securitycenter.v1.GroupFindingsResponse; + public static create(properties?: google.cloud.securitycenter.v1.IListNotificationConfigsRequest): google.cloud.securitycenter.v1.ListNotificationConfigsRequest; /** - * Encodes the specified GroupFindingsResponse message. Does not implicitly {@link google.cloud.securitycenter.v1.GroupFindingsResponse.verify|verify} messages. - * @param message GroupFindingsResponse message or plain object to encode + * Encodes the specified ListNotificationConfigsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.ListNotificationConfigsRequest.verify|verify} messages. + * @param message ListNotificationConfigsRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.securitycenter.v1.IGroupFindingsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.securitycenter.v1.IListNotificationConfigsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified GroupFindingsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.GroupFindingsResponse.verify|verify} messages. - * @param message GroupFindingsResponse message or plain object to encode + * Encodes the specified ListNotificationConfigsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListNotificationConfigsRequest.verify|verify} messages. + * @param message ListNotificationConfigsRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.securitycenter.v1.IGroupFindingsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.securitycenter.v1.IListNotificationConfigsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a GroupFindingsResponse message from the specified reader or buffer. + * Decodes a ListNotificationConfigsRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns GroupFindingsResponse + * @returns ListNotificationConfigsRequest * @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.cloud.securitycenter.v1.GroupFindingsResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1.ListNotificationConfigsRequest; /** - * Decodes a GroupFindingsResponse message from the specified reader or buffer, length delimited. + * Decodes a ListNotificationConfigsRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns GroupFindingsResponse + * @returns ListNotificationConfigsRequest * @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.cloud.securitycenter.v1.GroupFindingsResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1.ListNotificationConfigsRequest; /** - * Verifies a GroupFindingsResponse message. + * Verifies a ListNotificationConfigsRequest 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 GroupFindingsResponse message from a plain object. Also converts values to their respective internal types. + * Creates a ListNotificationConfigsRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns GroupFindingsResponse + * @returns ListNotificationConfigsRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.GroupFindingsResponse; + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.ListNotificationConfigsRequest; /** - * Creates a plain object from a GroupFindingsResponse message. Also converts values to other types if specified. - * @param message GroupFindingsResponse + * Creates a plain object from a ListNotificationConfigsRequest message. Also converts values to other types if specified. + * @param message ListNotificationConfigsRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.securitycenter.v1.GroupFindingsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.securitycenter.v1.ListNotificationConfigsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this GroupFindingsResponse to JSON. + * Converts this ListNotificationConfigsRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a GroupResult. */ - interface IGroupResult { + /** Properties of a ListNotificationConfigsResponse. */ + interface IListNotificationConfigsResponse { - /** GroupResult properties */ - properties?: ({ [k: string]: google.protobuf.IValue }|null); + /** ListNotificationConfigsResponse notificationConfigs */ + notificationConfigs?: (google.cloud.securitycenter.v1.INotificationConfig[]|null); - /** GroupResult count */ - count?: (number|Long|string|null); + /** ListNotificationConfigsResponse nextPageToken */ + nextPageToken?: (string|null); } - /** Represents a GroupResult. */ - class GroupResult implements IGroupResult { + /** Represents a ListNotificationConfigsResponse. */ + class ListNotificationConfigsResponse implements IListNotificationConfigsResponse { /** - * Constructs a new GroupResult. + * Constructs a new ListNotificationConfigsResponse. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.securitycenter.v1.IGroupResult); + constructor(properties?: google.cloud.securitycenter.v1.IListNotificationConfigsResponse); - /** GroupResult properties. */ - public properties: { [k: string]: google.protobuf.IValue }; + /** ListNotificationConfigsResponse notificationConfigs. */ + public notificationConfigs: google.cloud.securitycenter.v1.INotificationConfig[]; - /** GroupResult count. */ - public count: (number|Long|string); + /** ListNotificationConfigsResponse nextPageToken. */ + public nextPageToken: string; /** - * Creates a new GroupResult instance using the specified properties. + * Creates a new ListNotificationConfigsResponse instance using the specified properties. * @param [properties] Properties to set - * @returns GroupResult instance + * @returns ListNotificationConfigsResponse instance */ - public static create(properties?: google.cloud.securitycenter.v1.IGroupResult): google.cloud.securitycenter.v1.GroupResult; + public static create(properties?: google.cloud.securitycenter.v1.IListNotificationConfigsResponse): google.cloud.securitycenter.v1.ListNotificationConfigsResponse; /** - * Encodes the specified GroupResult message. Does not implicitly {@link google.cloud.securitycenter.v1.GroupResult.verify|verify} messages. - * @param message GroupResult message or plain object to encode + * Encodes the specified ListNotificationConfigsResponse message. Does not implicitly {@link google.cloud.securitycenter.v1.ListNotificationConfigsResponse.verify|verify} messages. + * @param message ListNotificationConfigsResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.securitycenter.v1.IGroupResult, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.securitycenter.v1.IListNotificationConfigsResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified GroupResult message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.GroupResult.verify|verify} messages. - * @param message GroupResult message or plain object to encode + * Encodes the specified ListNotificationConfigsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListNotificationConfigsResponse.verify|verify} messages. + * @param message ListNotificationConfigsResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.securitycenter.v1.IGroupResult, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.securitycenter.v1.IListNotificationConfigsResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a GroupResult message from the specified reader or buffer. + * Decodes a ListNotificationConfigsResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns GroupResult + * @returns ListNotificationConfigsResponse * @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.cloud.securitycenter.v1.GroupResult; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1.ListNotificationConfigsResponse; /** - * Decodes a GroupResult message from the specified reader or buffer, length delimited. + * Decodes a ListNotificationConfigsResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns GroupResult + * @returns ListNotificationConfigsResponse * @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.cloud.securitycenter.v1.GroupResult; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1.ListNotificationConfigsResponse; /** - * Verifies a GroupResult message. + * Verifies a ListNotificationConfigsResponse 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 GroupResult message from a plain object. Also converts values to their respective internal types. + * Creates a ListNotificationConfigsResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns GroupResult + * @returns ListNotificationConfigsResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.GroupResult; + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.ListNotificationConfigsResponse; /** - * Creates a plain object from a GroupResult message. Also converts values to other types if specified. - * @param message GroupResult + * Creates a plain object from a ListNotificationConfigsResponse message. Also converts values to other types if specified. + * @param message ListNotificationConfigsResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.securitycenter.v1.GroupResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.securitycenter.v1.ListNotificationConfigsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this GroupResult to JSON. + * Converts this ListNotificationConfigsResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; @@ -3549,48 +4443,144 @@ export namespace google { public static encodeDelimited(message: google.cloud.securitycenter.v1.IUpdateFindingRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an UpdateFindingRequest message from the specified reader or buffer. + * Decodes an UpdateFindingRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateFindingRequest + * @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.cloud.securitycenter.v1.UpdateFindingRequest; + + /** + * Decodes an UpdateFindingRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateFindingRequest + * @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.cloud.securitycenter.v1.UpdateFindingRequest; + + /** + * Verifies an UpdateFindingRequest 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 UpdateFindingRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateFindingRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.UpdateFindingRequest; + + /** + * Creates a plain object from an UpdateFindingRequest message. Also converts values to other types if specified. + * @param message UpdateFindingRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.UpdateFindingRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateFindingRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an UpdateNotificationConfigRequest. */ + interface IUpdateNotificationConfigRequest { + + /** UpdateNotificationConfigRequest notificationConfig */ + notificationConfig?: (google.cloud.securitycenter.v1.INotificationConfig|null); + + /** UpdateNotificationConfigRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateNotificationConfigRequest. */ + class UpdateNotificationConfigRequest implements IUpdateNotificationConfigRequest { + + /** + * Constructs a new UpdateNotificationConfigRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IUpdateNotificationConfigRequest); + + /** UpdateNotificationConfigRequest notificationConfig. */ + public notificationConfig?: (google.cloud.securitycenter.v1.INotificationConfig|null); + + /** UpdateNotificationConfigRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateNotificationConfigRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateNotificationConfigRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IUpdateNotificationConfigRequest): google.cloud.securitycenter.v1.UpdateNotificationConfigRequest; + + /** + * Encodes the specified UpdateNotificationConfigRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.UpdateNotificationConfigRequest.verify|verify} messages. + * @param message UpdateNotificationConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IUpdateNotificationConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateNotificationConfigRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.UpdateNotificationConfigRequest.verify|verify} messages. + * @param message UpdateNotificationConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IUpdateNotificationConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateNotificationConfigRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns UpdateFindingRequest + * @returns UpdateNotificationConfigRequest * @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.cloud.securitycenter.v1.UpdateFindingRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1.UpdateNotificationConfigRequest; /** - * Decodes an UpdateFindingRequest message from the specified reader or buffer, length delimited. + * Decodes an UpdateNotificationConfigRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns UpdateFindingRequest + * @returns UpdateNotificationConfigRequest * @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.cloud.securitycenter.v1.UpdateFindingRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1.UpdateNotificationConfigRequest; /** - * Verifies an UpdateFindingRequest message. + * Verifies an UpdateNotificationConfigRequest 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 UpdateFindingRequest message from a plain object. Also converts values to their respective internal types. + * Creates an UpdateNotificationConfigRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns UpdateFindingRequest + * @returns UpdateNotificationConfigRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.UpdateFindingRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.UpdateNotificationConfigRequest; /** - * Creates a plain object from an UpdateFindingRequest message. Also converts values to other types if specified. - * @param message UpdateFindingRequest + * Creates a plain object from an UpdateNotificationConfigRequest message. Also converts values to other types if specified. + * @param message UpdateNotificationConfigRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.securitycenter.v1.UpdateFindingRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.securitycenter.v1.UpdateNotificationConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this UpdateFindingRequest to JSON. + * Converts this UpdateNotificationConfigRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; @@ -12575,252 +13565,26 @@ export namespace google { */ public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1p1beta1.Source; - /** - * Creates a plain object from a Source message. Also converts values to other types if specified. - * @param message Source - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.securitycenter.v1p1beta1.Source, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Source to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - } - } - } - - /** Namespace api. */ - namespace api { - - /** 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); - } - - /** 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; - - /** - * 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 }; - } - - namespace ResourceDescriptor { - - /** History enum. */ - enum History { - HISTORY_UNSPECIFIED = 0, - ORIGINALLY_SINGLE_PATTERN = 1, - FUTURE_MULTI_PATTERN = 2 - } - } - - /** 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 }; + /** + * Creates a plain object from a Source message. Also converts values to other types if specified. + * @param message Source + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1p1beta1.Source, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Converts this ResourceReference to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** + * Converts this Source to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } } + } + + /** Namespace api. */ + namespace api { /** Properties of a Http. */ interface IHttp { @@ -13161,6 +13925,232 @@ export namespace google { public toJSON(): { [k: string]: any }; } + /** 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); + } + + /** 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; + + /** + * 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 }; + } + + namespace ResourceDescriptor { + + /** History enum. */ + enum History { + HISTORY_UNSPECIFIED = 0, + ORIGINALLY_SINGLE_PATTERN = 1, + FUTURE_MULTI_PATTERN = 2 + } + } + + /** 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 }; + } + /** FieldBehavior enum. */ enum FieldBehavior { FIELD_BEHAVIOR_UNSPECIFIED = 0, diff --git a/packages/google-cloud-securitycenter/protos/protos.js b/packages/google-cloud-securitycenter/protos/protos.js index 9c04e7b3d0f..37be0296743 100644 --- a/packages/google-cloud-securitycenter/protos/protos.js +++ b/packages/google-cloud-securitycenter/protos/protos.js @@ -1681,26 +1681,28 @@ return Finding; })(); - v1.OrganizationSettings = (function() { + v1.NotificationConfig = (function() { /** - * Properties of an OrganizationSettings. + * Properties of a NotificationConfig. * @memberof google.cloud.securitycenter.v1 - * @interface IOrganizationSettings - * @property {string|null} [name] OrganizationSettings name - * @property {boolean|null} [enableAssetDiscovery] OrganizationSettings enableAssetDiscovery - * @property {google.cloud.securitycenter.v1.OrganizationSettings.IAssetDiscoveryConfig|null} [assetDiscoveryConfig] OrganizationSettings assetDiscoveryConfig + * @interface INotificationConfig + * @property {string|null} [name] NotificationConfig name + * @property {string|null} [description] NotificationConfig description + * @property {string|null} [pubsubTopic] NotificationConfig pubsubTopic + * @property {string|null} [serviceAccount] NotificationConfig serviceAccount + * @property {google.cloud.securitycenter.v1.NotificationConfig.IStreamingConfig|null} [streamingConfig] NotificationConfig streamingConfig */ /** - * Constructs a new OrganizationSettings. + * Constructs a new NotificationConfig. * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents an OrganizationSettings. - * @implements IOrganizationSettings + * @classdesc Represents a NotificationConfig. + * @implements INotificationConfig * @constructor - * @param {google.cloud.securitycenter.v1.IOrganizationSettings=} [properties] Properties to set + * @param {google.cloud.securitycenter.v1.INotificationConfig=} [properties] Properties to set */ - function OrganizationSettings(properties) { + function NotificationConfig(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -1708,90 +1710,124 @@ } /** - * OrganizationSettings name. + * NotificationConfig name. * @member {string} name - * @memberof google.cloud.securitycenter.v1.OrganizationSettings + * @memberof google.cloud.securitycenter.v1.NotificationConfig * @instance */ - OrganizationSettings.prototype.name = ""; + NotificationConfig.prototype.name = ""; /** - * OrganizationSettings enableAssetDiscovery. - * @member {boolean} enableAssetDiscovery - * @memberof google.cloud.securitycenter.v1.OrganizationSettings + * NotificationConfig description. + * @member {string} description + * @memberof google.cloud.securitycenter.v1.NotificationConfig * @instance */ - OrganizationSettings.prototype.enableAssetDiscovery = false; + NotificationConfig.prototype.description = ""; /** - * OrganizationSettings assetDiscoveryConfig. - * @member {google.cloud.securitycenter.v1.OrganizationSettings.IAssetDiscoveryConfig|null|undefined} assetDiscoveryConfig - * @memberof google.cloud.securitycenter.v1.OrganizationSettings + * NotificationConfig pubsubTopic. + * @member {string} pubsubTopic + * @memberof google.cloud.securitycenter.v1.NotificationConfig * @instance */ - OrganizationSettings.prototype.assetDiscoveryConfig = null; + NotificationConfig.prototype.pubsubTopic = ""; /** - * Creates a new OrganizationSettings instance using the specified properties. + * NotificationConfig serviceAccount. + * @member {string} serviceAccount + * @memberof google.cloud.securitycenter.v1.NotificationConfig + * @instance + */ + NotificationConfig.prototype.serviceAccount = ""; + + /** + * NotificationConfig streamingConfig. + * @member {google.cloud.securitycenter.v1.NotificationConfig.IStreamingConfig|null|undefined} streamingConfig + * @memberof google.cloud.securitycenter.v1.NotificationConfig + * @instance + */ + NotificationConfig.prototype.streamingConfig = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * NotificationConfig notifyConfig. + * @member {"streamingConfig"|undefined} notifyConfig + * @memberof google.cloud.securitycenter.v1.NotificationConfig + * @instance + */ + Object.defineProperty(NotificationConfig.prototype, "notifyConfig", { + get: $util.oneOfGetter($oneOfFields = ["streamingConfig"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new NotificationConfig instance using the specified properties. * @function create - * @memberof google.cloud.securitycenter.v1.OrganizationSettings + * @memberof google.cloud.securitycenter.v1.NotificationConfig * @static - * @param {google.cloud.securitycenter.v1.IOrganizationSettings=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.OrganizationSettings} OrganizationSettings instance + * @param {google.cloud.securitycenter.v1.INotificationConfig=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.NotificationConfig} NotificationConfig instance */ - OrganizationSettings.create = function create(properties) { - return new OrganizationSettings(properties); + NotificationConfig.create = function create(properties) { + return new NotificationConfig(properties); }; /** - * Encodes the specified OrganizationSettings message. Does not implicitly {@link google.cloud.securitycenter.v1.OrganizationSettings.verify|verify} messages. + * Encodes the specified NotificationConfig message. Does not implicitly {@link google.cloud.securitycenter.v1.NotificationConfig.verify|verify} messages. * @function encode - * @memberof google.cloud.securitycenter.v1.OrganizationSettings + * @memberof google.cloud.securitycenter.v1.NotificationConfig * @static - * @param {google.cloud.securitycenter.v1.IOrganizationSettings} message OrganizationSettings message or plain object to encode + * @param {google.cloud.securitycenter.v1.INotificationConfig} message NotificationConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - OrganizationSettings.encode = function encode(message, writer) { + NotificationConfig.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.name != null && message.hasOwnProperty("name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.enableAssetDiscovery != null && message.hasOwnProperty("enableAssetDiscovery")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.enableAssetDiscovery); - if (message.assetDiscoveryConfig != null && message.hasOwnProperty("assetDiscoveryConfig")) - $root.google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.encode(message.assetDiscoveryConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.description != null && message.hasOwnProperty("description")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); + if (message.pubsubTopic != null && message.hasOwnProperty("pubsubTopic")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pubsubTopic); + if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.serviceAccount); + if (message.streamingConfig != null && message.hasOwnProperty("streamingConfig")) + $root.google.cloud.securitycenter.v1.NotificationConfig.StreamingConfig.encode(message.streamingConfig, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); return writer; }; /** - * Encodes the specified OrganizationSettings message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.OrganizationSettings.verify|verify} messages. + * Encodes the specified NotificationConfig message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.NotificationConfig.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.OrganizationSettings + * @memberof google.cloud.securitycenter.v1.NotificationConfig * @static - * @param {google.cloud.securitycenter.v1.IOrganizationSettings} message OrganizationSettings message or plain object to encode + * @param {google.cloud.securitycenter.v1.INotificationConfig} message NotificationConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - OrganizationSettings.encodeDelimited = function encodeDelimited(message, writer) { + NotificationConfig.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an OrganizationSettings message from the specified reader or buffer. + * Decodes a NotificationConfig message from the specified reader or buffer. * @function decode - * @memberof google.cloud.securitycenter.v1.OrganizationSettings + * @memberof google.cloud.securitycenter.v1.NotificationConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.OrganizationSettings} OrganizationSettings + * @returns {google.cloud.securitycenter.v1.NotificationConfig} NotificationConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - OrganizationSettings.decode = function decode(reader, length) { + NotificationConfig.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.cloud.securitycenter.v1.OrganizationSettings(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.NotificationConfig(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -1799,10 +1835,16 @@ message.name = reader.string(); break; case 2: - message.enableAssetDiscovery = reader.bool(); + message.description = reader.string(); break; case 3: - message.assetDiscoveryConfig = $root.google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.decode(reader, reader.uint32()); + message.pubsubTopic = reader.string(); + break; + case 4: + message.serviceAccount = reader.string(); + break; + case 5: + message.streamingConfig = $root.google.cloud.securitycenter.v1.NotificationConfig.StreamingConfig.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -1813,128 +1855,148 @@ }; /** - * Decodes an OrganizationSettings message from the specified reader or buffer, length delimited. + * Decodes a NotificationConfig message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.OrganizationSettings + * @memberof google.cloud.securitycenter.v1.NotificationConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.OrganizationSettings} OrganizationSettings + * @returns {google.cloud.securitycenter.v1.NotificationConfig} NotificationConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - OrganizationSettings.decodeDelimited = function decodeDelimited(reader) { + NotificationConfig.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an OrganizationSettings message. + * Verifies a NotificationConfig message. * @function verify - * @memberof google.cloud.securitycenter.v1.OrganizationSettings + * @memberof google.cloud.securitycenter.v1.NotificationConfig * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - OrganizationSettings.verify = function verify(message) { + NotificationConfig.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.enableAssetDiscovery != null && message.hasOwnProperty("enableAssetDiscovery")) - if (typeof message.enableAssetDiscovery !== "boolean") - return "enableAssetDiscovery: boolean expected"; - if (message.assetDiscoveryConfig != null && message.hasOwnProperty("assetDiscoveryConfig")) { - var error = $root.google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.verify(message.assetDiscoveryConfig); - if (error) - return "assetDiscoveryConfig." + error; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.pubsubTopic != null && message.hasOwnProperty("pubsubTopic")) + if (!$util.isString(message.pubsubTopic)) + return "pubsubTopic: string expected"; + if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) + if (!$util.isString(message.serviceAccount)) + return "serviceAccount: string expected"; + if (message.streamingConfig != null && message.hasOwnProperty("streamingConfig")) { + properties.notifyConfig = 1; + { + var error = $root.google.cloud.securitycenter.v1.NotificationConfig.StreamingConfig.verify(message.streamingConfig); + if (error) + return "streamingConfig." + error; + } } return null; }; /** - * Creates an OrganizationSettings message from a plain object. Also converts values to their respective internal types. + * Creates a NotificationConfig message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.securitycenter.v1.OrganizationSettings + * @memberof google.cloud.securitycenter.v1.NotificationConfig * @static * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.OrganizationSettings} OrganizationSettings + * @returns {google.cloud.securitycenter.v1.NotificationConfig} NotificationConfig */ - OrganizationSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.OrganizationSettings) + NotificationConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.NotificationConfig) return object; - var message = new $root.google.cloud.securitycenter.v1.OrganizationSettings(); + var message = new $root.google.cloud.securitycenter.v1.NotificationConfig(); if (object.name != null) message.name = String(object.name); - if (object.enableAssetDiscovery != null) - message.enableAssetDiscovery = Boolean(object.enableAssetDiscovery); - if (object.assetDiscoveryConfig != null) { - if (typeof object.assetDiscoveryConfig !== "object") - throw TypeError(".google.cloud.securitycenter.v1.OrganizationSettings.assetDiscoveryConfig: object expected"); - message.assetDiscoveryConfig = $root.google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.fromObject(object.assetDiscoveryConfig); + if (object.description != null) + message.description = String(object.description); + if (object.pubsubTopic != null) + message.pubsubTopic = String(object.pubsubTopic); + if (object.serviceAccount != null) + message.serviceAccount = String(object.serviceAccount); + if (object.streamingConfig != null) { + if (typeof object.streamingConfig !== "object") + throw TypeError(".google.cloud.securitycenter.v1.NotificationConfig.streamingConfig: object expected"); + message.streamingConfig = $root.google.cloud.securitycenter.v1.NotificationConfig.StreamingConfig.fromObject(object.streamingConfig); } return message; }; /** - * Creates a plain object from an OrganizationSettings message. Also converts values to other types if specified. + * Creates a plain object from a NotificationConfig message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.securitycenter.v1.OrganizationSettings + * @memberof google.cloud.securitycenter.v1.NotificationConfig * @static - * @param {google.cloud.securitycenter.v1.OrganizationSettings} message OrganizationSettings + * @param {google.cloud.securitycenter.v1.NotificationConfig} message NotificationConfig * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - OrganizationSettings.toObject = function toObject(message, options) { + NotificationConfig.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { object.name = ""; - object.enableAssetDiscovery = false; - object.assetDiscoveryConfig = null; + object.description = ""; + object.pubsubTopic = ""; + object.serviceAccount = ""; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; - if (message.enableAssetDiscovery != null && message.hasOwnProperty("enableAssetDiscovery")) - object.enableAssetDiscovery = message.enableAssetDiscovery; - if (message.assetDiscoveryConfig != null && message.hasOwnProperty("assetDiscoveryConfig")) - object.assetDiscoveryConfig = $root.google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.toObject(message.assetDiscoveryConfig, options); + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.pubsubTopic != null && message.hasOwnProperty("pubsubTopic")) + object.pubsubTopic = message.pubsubTopic; + if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) + object.serviceAccount = message.serviceAccount; + if (message.streamingConfig != null && message.hasOwnProperty("streamingConfig")) { + object.streamingConfig = $root.google.cloud.securitycenter.v1.NotificationConfig.StreamingConfig.toObject(message.streamingConfig, options); + if (options.oneofs) + object.notifyConfig = "streamingConfig"; + } return object; }; /** - * Converts this OrganizationSettings to JSON. + * Converts this NotificationConfig to JSON. * @function toJSON - * @memberof google.cloud.securitycenter.v1.OrganizationSettings + * @memberof google.cloud.securitycenter.v1.NotificationConfig * @instance * @returns {Object.} JSON object */ - OrganizationSettings.prototype.toJSON = function toJSON() { + NotificationConfig.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - OrganizationSettings.AssetDiscoveryConfig = (function() { + NotificationConfig.StreamingConfig = (function() { /** - * Properties of an AssetDiscoveryConfig. - * @memberof google.cloud.securitycenter.v1.OrganizationSettings - * @interface IAssetDiscoveryConfig - * @property {Array.|null} [projectIds] AssetDiscoveryConfig projectIds - * @property {google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode|null} [inclusionMode] AssetDiscoveryConfig inclusionMode + * Properties of a StreamingConfig. + * @memberof google.cloud.securitycenter.v1.NotificationConfig + * @interface IStreamingConfig + * @property {string|null} [filter] StreamingConfig filter */ /** - * Constructs a new AssetDiscoveryConfig. - * @memberof google.cloud.securitycenter.v1.OrganizationSettings - * @classdesc Represents an AssetDiscoveryConfig. - * @implements IAssetDiscoveryConfig + * Constructs a new StreamingConfig. + * @memberof google.cloud.securitycenter.v1.NotificationConfig + * @classdesc Represents a StreamingConfig. + * @implements IStreamingConfig * @constructor - * @param {google.cloud.securitycenter.v1.OrganizationSettings.IAssetDiscoveryConfig=} [properties] Properties to set + * @param {google.cloud.securitycenter.v1.NotificationConfig.IStreamingConfig=} [properties] Properties to set */ - function AssetDiscoveryConfig(properties) { - this.projectIds = []; + function StreamingConfig(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -1942,91 +2004,75 @@ } /** - * AssetDiscoveryConfig projectIds. - * @member {Array.} projectIds - * @memberof google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig - * @instance - */ - AssetDiscoveryConfig.prototype.projectIds = $util.emptyArray; - - /** - * AssetDiscoveryConfig inclusionMode. - * @member {google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode} inclusionMode - * @memberof google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig + * StreamingConfig filter. + * @member {string} filter + * @memberof google.cloud.securitycenter.v1.NotificationConfig.StreamingConfig * @instance */ - AssetDiscoveryConfig.prototype.inclusionMode = 0; + StreamingConfig.prototype.filter = ""; /** - * Creates a new AssetDiscoveryConfig instance using the specified properties. + * Creates a new StreamingConfig instance using the specified properties. * @function create - * @memberof google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig + * @memberof google.cloud.securitycenter.v1.NotificationConfig.StreamingConfig * @static - * @param {google.cloud.securitycenter.v1.OrganizationSettings.IAssetDiscoveryConfig=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig} AssetDiscoveryConfig instance + * @param {google.cloud.securitycenter.v1.NotificationConfig.IStreamingConfig=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.NotificationConfig.StreamingConfig} StreamingConfig instance */ - AssetDiscoveryConfig.create = function create(properties) { - return new AssetDiscoveryConfig(properties); + StreamingConfig.create = function create(properties) { + return new StreamingConfig(properties); }; /** - * Encodes the specified AssetDiscoveryConfig message. Does not implicitly {@link google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.verify|verify} messages. + * Encodes the specified StreamingConfig message. Does not implicitly {@link google.cloud.securitycenter.v1.NotificationConfig.StreamingConfig.verify|verify} messages. * @function encode - * @memberof google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig + * @memberof google.cloud.securitycenter.v1.NotificationConfig.StreamingConfig * @static - * @param {google.cloud.securitycenter.v1.OrganizationSettings.IAssetDiscoveryConfig} message AssetDiscoveryConfig message or plain object to encode + * @param {google.cloud.securitycenter.v1.NotificationConfig.IStreamingConfig} message StreamingConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AssetDiscoveryConfig.encode = function encode(message, writer) { + StreamingConfig.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.projectIds != null && message.projectIds.length) - for (var i = 0; i < message.projectIds.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectIds[i]); - if (message.inclusionMode != null && message.hasOwnProperty("inclusionMode")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.inclusionMode); + if (message.filter != null && message.hasOwnProperty("filter")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.filter); return writer; }; /** - * Encodes the specified AssetDiscoveryConfig message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.verify|verify} messages. + * Encodes the specified StreamingConfig message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.NotificationConfig.StreamingConfig.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig + * @memberof google.cloud.securitycenter.v1.NotificationConfig.StreamingConfig * @static - * @param {google.cloud.securitycenter.v1.OrganizationSettings.IAssetDiscoveryConfig} message AssetDiscoveryConfig message or plain object to encode + * @param {google.cloud.securitycenter.v1.NotificationConfig.IStreamingConfig} message StreamingConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AssetDiscoveryConfig.encodeDelimited = function encodeDelimited(message, writer) { + StreamingConfig.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an AssetDiscoveryConfig message from the specified reader or buffer. + * Decodes a StreamingConfig message from the specified reader or buffer. * @function decode - * @memberof google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig + * @memberof google.cloud.securitycenter.v1.NotificationConfig.StreamingConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig} AssetDiscoveryConfig + * @returns {google.cloud.securitycenter.v1.NotificationConfig.StreamingConfig} StreamingConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - AssetDiscoveryConfig.decode = function decode(reader, length) { + StreamingConfig.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.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.NotificationConfig.StreamingConfig(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - if (!(message.projectIds && message.projectIds.length)) - message.projectIds = []; - message.projectIds.push(reader.string()); - break; - case 2: - message.inclusionMode = reader.int32(); + message.filter = reader.string(); break; default: reader.skipType(tag & 7); @@ -2037,166 +2083,111 @@ }; /** - * Decodes an AssetDiscoveryConfig message from the specified reader or buffer, length delimited. + * Decodes a StreamingConfig message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig + * @memberof google.cloud.securitycenter.v1.NotificationConfig.StreamingConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig} AssetDiscoveryConfig + * @returns {google.cloud.securitycenter.v1.NotificationConfig.StreamingConfig} StreamingConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - AssetDiscoveryConfig.decodeDelimited = function decodeDelimited(reader) { + StreamingConfig.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an AssetDiscoveryConfig message. + * Verifies a StreamingConfig message. * @function verify - * @memberof google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig + * @memberof google.cloud.securitycenter.v1.NotificationConfig.StreamingConfig * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - AssetDiscoveryConfig.verify = function verify(message) { + StreamingConfig.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.projectIds != null && message.hasOwnProperty("projectIds")) { - if (!Array.isArray(message.projectIds)) - return "projectIds: array expected"; - for (var i = 0; i < message.projectIds.length; ++i) - if (!$util.isString(message.projectIds[i])) - return "projectIds: string[] expected"; - } - if (message.inclusionMode != null && message.hasOwnProperty("inclusionMode")) - switch (message.inclusionMode) { - default: - return "inclusionMode: enum value expected"; - case 0: - case 1: - case 2: - break; - } + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; return null; }; /** - * Creates an AssetDiscoveryConfig message from a plain object. Also converts values to their respective internal types. + * Creates a StreamingConfig message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig + * @memberof google.cloud.securitycenter.v1.NotificationConfig.StreamingConfig * @static * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig} AssetDiscoveryConfig + * @returns {google.cloud.securitycenter.v1.NotificationConfig.StreamingConfig} StreamingConfig */ - AssetDiscoveryConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig) + StreamingConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.NotificationConfig.StreamingConfig) return object; - var message = new $root.google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig(); - if (object.projectIds) { - if (!Array.isArray(object.projectIds)) - throw TypeError(".google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.projectIds: array expected"); - message.projectIds = []; - for (var i = 0; i < object.projectIds.length; ++i) - message.projectIds[i] = String(object.projectIds[i]); - } - switch (object.inclusionMode) { - case "INCLUSION_MODE_UNSPECIFIED": - case 0: - message.inclusionMode = 0; - break; - case "INCLUDE_ONLY": - case 1: - message.inclusionMode = 1; - break; - case "EXCLUDE": - case 2: - message.inclusionMode = 2; - break; - } + var message = new $root.google.cloud.securitycenter.v1.NotificationConfig.StreamingConfig(); + if (object.filter != null) + message.filter = String(object.filter); return message; }; /** - * Creates a plain object from an AssetDiscoveryConfig message. Also converts values to other types if specified. + * Creates a plain object from a StreamingConfig message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig + * @memberof google.cloud.securitycenter.v1.NotificationConfig.StreamingConfig * @static - * @param {google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig} message AssetDiscoveryConfig + * @param {google.cloud.securitycenter.v1.NotificationConfig.StreamingConfig} message StreamingConfig * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - AssetDiscoveryConfig.toObject = function toObject(message, options) { + StreamingConfig.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.projectIds = []; if (options.defaults) - object.inclusionMode = options.enums === String ? "INCLUSION_MODE_UNSPECIFIED" : 0; - if (message.projectIds && message.projectIds.length) { - object.projectIds = []; - for (var j = 0; j < message.projectIds.length; ++j) - object.projectIds[j] = message.projectIds[j]; - } - if (message.inclusionMode != null && message.hasOwnProperty("inclusionMode")) - object.inclusionMode = options.enums === String ? $root.google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode[message.inclusionMode] : message.inclusionMode; + object.filter = ""; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; return object; }; /** - * Converts this AssetDiscoveryConfig to JSON. + * Converts this StreamingConfig to JSON. * @function toJSON - * @memberof google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig + * @memberof google.cloud.securitycenter.v1.NotificationConfig.StreamingConfig * @instance * @returns {Object.} JSON object */ - AssetDiscoveryConfig.prototype.toJSON = function toJSON() { + StreamingConfig.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - /** - * InclusionMode enum. - * @name google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode - * @enum {string} - * @property {number} INCLUSION_MODE_UNSPECIFIED=0 INCLUSION_MODE_UNSPECIFIED value - * @property {number} INCLUDE_ONLY=1 INCLUDE_ONLY value - * @property {number} EXCLUDE=2 EXCLUDE value - */ - AssetDiscoveryConfig.InclusionMode = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "INCLUSION_MODE_UNSPECIFIED"] = 0; - values[valuesById[1] = "INCLUDE_ONLY"] = 1; - values[valuesById[2] = "EXCLUDE"] = 2; - return values; - })(); - - return AssetDiscoveryConfig; + return StreamingConfig; })(); - return OrganizationSettings; + return NotificationConfig; })(); - v1.RunAssetDiscoveryResponse = (function() { + v1.NotificationMessage = (function() { /** - * Properties of a RunAssetDiscoveryResponse. + * Properties of a NotificationMessage. * @memberof google.cloud.securitycenter.v1 - * @interface IRunAssetDiscoveryResponse - * @property {google.cloud.securitycenter.v1.RunAssetDiscoveryResponse.State|null} [state] RunAssetDiscoveryResponse state - * @property {google.protobuf.IDuration|null} [duration] RunAssetDiscoveryResponse duration + * @interface INotificationMessage + * @property {string|null} [notificationConfigName] NotificationMessage notificationConfigName + * @property {google.cloud.securitycenter.v1.IFinding|null} [finding] NotificationMessage finding */ /** - * Constructs a new RunAssetDiscoveryResponse. + * Constructs a new NotificationMessage. * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents a RunAssetDiscoveryResponse. - * @implements IRunAssetDiscoveryResponse + * @classdesc Represents a NotificationMessage. + * @implements INotificationMessage * @constructor - * @param {google.cloud.securitycenter.v1.IRunAssetDiscoveryResponse=} [properties] Properties to set + * @param {google.cloud.securitycenter.v1.INotificationMessage=} [properties] Properties to set */ - function RunAssetDiscoveryResponse(properties) { + function NotificationMessage(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -2204,88 +2195,102 @@ } /** - * RunAssetDiscoveryResponse state. - * @member {google.cloud.securitycenter.v1.RunAssetDiscoveryResponse.State} state - * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryResponse + * NotificationMessage notificationConfigName. + * @member {string} notificationConfigName + * @memberof google.cloud.securitycenter.v1.NotificationMessage * @instance */ - RunAssetDiscoveryResponse.prototype.state = 0; + NotificationMessage.prototype.notificationConfigName = ""; /** - * RunAssetDiscoveryResponse duration. - * @member {google.protobuf.IDuration|null|undefined} duration - * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryResponse + * NotificationMessage finding. + * @member {google.cloud.securitycenter.v1.IFinding|null|undefined} finding + * @memberof google.cloud.securitycenter.v1.NotificationMessage * @instance */ - RunAssetDiscoveryResponse.prototype.duration = null; + NotificationMessage.prototype.finding = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; /** - * Creates a new RunAssetDiscoveryResponse instance using the specified properties. + * NotificationMessage event. + * @member {"finding"|undefined} event + * @memberof google.cloud.securitycenter.v1.NotificationMessage + * @instance + */ + Object.defineProperty(NotificationMessage.prototype, "event", { + get: $util.oneOfGetter($oneOfFields = ["finding"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new NotificationMessage instance using the specified properties. * @function create - * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryResponse + * @memberof google.cloud.securitycenter.v1.NotificationMessage * @static - * @param {google.cloud.securitycenter.v1.IRunAssetDiscoveryResponse=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.RunAssetDiscoveryResponse} RunAssetDiscoveryResponse instance + * @param {google.cloud.securitycenter.v1.INotificationMessage=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.NotificationMessage} NotificationMessage instance */ - RunAssetDiscoveryResponse.create = function create(properties) { - return new RunAssetDiscoveryResponse(properties); + NotificationMessage.create = function create(properties) { + return new NotificationMessage(properties); }; /** - * Encodes the specified RunAssetDiscoveryResponse message. Does not implicitly {@link google.cloud.securitycenter.v1.RunAssetDiscoveryResponse.verify|verify} messages. + * Encodes the specified NotificationMessage message. Does not implicitly {@link google.cloud.securitycenter.v1.NotificationMessage.verify|verify} messages. * @function encode - * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryResponse + * @memberof google.cloud.securitycenter.v1.NotificationMessage * @static - * @param {google.cloud.securitycenter.v1.IRunAssetDiscoveryResponse} message RunAssetDiscoveryResponse message or plain object to encode + * @param {google.cloud.securitycenter.v1.INotificationMessage} message NotificationMessage message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - RunAssetDiscoveryResponse.encode = function encode(message, writer) { + NotificationMessage.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.state != null && message.hasOwnProperty("state")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.state); - if (message.duration != null && message.hasOwnProperty("duration")) - $root.google.protobuf.Duration.encode(message.duration, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.notificationConfigName != null && message.hasOwnProperty("notificationConfigName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.notificationConfigName); + if (message.finding != null && message.hasOwnProperty("finding")) + $root.google.cloud.securitycenter.v1.Finding.encode(message.finding, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** - * Encodes the specified RunAssetDiscoveryResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.RunAssetDiscoveryResponse.verify|verify} messages. + * Encodes the specified NotificationMessage message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.NotificationMessage.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryResponse + * @memberof google.cloud.securitycenter.v1.NotificationMessage * @static - * @param {google.cloud.securitycenter.v1.IRunAssetDiscoveryResponse} message RunAssetDiscoveryResponse message or plain object to encode + * @param {google.cloud.securitycenter.v1.INotificationMessage} message NotificationMessage message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - RunAssetDiscoveryResponse.encodeDelimited = function encodeDelimited(message, writer) { + NotificationMessage.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a RunAssetDiscoveryResponse message from the specified reader or buffer. + * Decodes a NotificationMessage message from the specified reader or buffer. * @function decode - * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryResponse + * @memberof google.cloud.securitycenter.v1.NotificationMessage * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.RunAssetDiscoveryResponse} RunAssetDiscoveryResponse + * @returns {google.cloud.securitycenter.v1.NotificationMessage} NotificationMessage * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - RunAssetDiscoveryResponse.decode = function decode(reader, length) { + NotificationMessage.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.cloud.securitycenter.v1.RunAssetDiscoveryResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.NotificationMessage(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.state = reader.int32(); + message.notificationConfigName = reader.string(); break; case 2: - message.duration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + message.finding = $root.google.cloud.securitycenter.v1.Finding.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -2296,793 +2301,2736 @@ }; /** - * Decodes a RunAssetDiscoveryResponse message from the specified reader or buffer, length delimited. + * Decodes a NotificationMessage message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryResponse + * @memberof google.cloud.securitycenter.v1.NotificationMessage * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.RunAssetDiscoveryResponse} RunAssetDiscoveryResponse + * @returns {google.cloud.securitycenter.v1.NotificationMessage} NotificationMessage * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - RunAssetDiscoveryResponse.decodeDelimited = function decodeDelimited(reader) { + NotificationMessage.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a RunAssetDiscoveryResponse message. + * Verifies a NotificationMessage message. * @function verify - * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryResponse + * @memberof google.cloud.securitycenter.v1.NotificationMessage * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - RunAssetDiscoveryResponse.verify = function verify(message) { + NotificationMessage.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.state != null && message.hasOwnProperty("state")) - switch (message.state) { - default: - return "state: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; + var properties = {}; + if (message.notificationConfigName != null && message.hasOwnProperty("notificationConfigName")) + if (!$util.isString(message.notificationConfigName)) + return "notificationConfigName: string expected"; + if (message.finding != null && message.hasOwnProperty("finding")) { + properties.event = 1; + { + var error = $root.google.cloud.securitycenter.v1.Finding.verify(message.finding); + if (error) + return "finding." + error; } - if (message.duration != null && message.hasOwnProperty("duration")) { - var error = $root.google.protobuf.Duration.verify(message.duration); - if (error) - return "duration." + error; } return null; }; /** - * Creates a RunAssetDiscoveryResponse message from a plain object. Also converts values to their respective internal types. + * Creates a NotificationMessage message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryResponse + * @memberof google.cloud.securitycenter.v1.NotificationMessage * @static * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.RunAssetDiscoveryResponse} RunAssetDiscoveryResponse + * @returns {google.cloud.securitycenter.v1.NotificationMessage} NotificationMessage */ - RunAssetDiscoveryResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.RunAssetDiscoveryResponse) + NotificationMessage.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.NotificationMessage) return object; - var message = new $root.google.cloud.securitycenter.v1.RunAssetDiscoveryResponse(); - switch (object.state) { - case "STATE_UNSPECIFIED": - case 0: - message.state = 0; - break; - case "COMPLETED": - case 1: - message.state = 1; - break; - case "SUPERSEDED": - case 2: - message.state = 2; - break; - case "TERMINATED": - case 3: - message.state = 3; - break; - } - if (object.duration != null) { - if (typeof object.duration !== "object") - throw TypeError(".google.cloud.securitycenter.v1.RunAssetDiscoveryResponse.duration: object expected"); - message.duration = $root.google.protobuf.Duration.fromObject(object.duration); + var message = new $root.google.cloud.securitycenter.v1.NotificationMessage(); + if (object.notificationConfigName != null) + message.notificationConfigName = String(object.notificationConfigName); + if (object.finding != null) { + if (typeof object.finding !== "object") + throw TypeError(".google.cloud.securitycenter.v1.NotificationMessage.finding: object expected"); + message.finding = $root.google.cloud.securitycenter.v1.Finding.fromObject(object.finding); } return message; }; /** - * Creates a plain object from a RunAssetDiscoveryResponse message. Also converts values to other types if specified. + * Creates a plain object from a NotificationMessage message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryResponse + * @memberof google.cloud.securitycenter.v1.NotificationMessage * @static - * @param {google.cloud.securitycenter.v1.RunAssetDiscoveryResponse} message RunAssetDiscoveryResponse + * @param {google.cloud.securitycenter.v1.NotificationMessage} message NotificationMessage * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - RunAssetDiscoveryResponse.toObject = function toObject(message, options) { + NotificationMessage.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; - object.duration = null; + if (options.defaults) + object.notificationConfigName = ""; + if (message.notificationConfigName != null && message.hasOwnProperty("notificationConfigName")) + object.notificationConfigName = message.notificationConfigName; + if (message.finding != null && message.hasOwnProperty("finding")) { + object.finding = $root.google.cloud.securitycenter.v1.Finding.toObject(message.finding, options); + if (options.oneofs) + object.event = "finding"; } - if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.securitycenter.v1.RunAssetDiscoveryResponse.State[message.state] : message.state; - if (message.duration != null && message.hasOwnProperty("duration")) - object.duration = $root.google.protobuf.Duration.toObject(message.duration, options); return object; }; /** - * Converts this RunAssetDiscoveryResponse to JSON. + * Converts this NotificationMessage to JSON. * @function toJSON - * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryResponse + * @memberof google.cloud.securitycenter.v1.NotificationMessage * @instance * @returns {Object.} JSON object */ - RunAssetDiscoveryResponse.prototype.toJSON = function toJSON() { + NotificationMessage.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - /** - * State enum. - * @name google.cloud.securitycenter.v1.RunAssetDiscoveryResponse.State - * @enum {string} - * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value - * @property {number} COMPLETED=1 COMPLETED value - * @property {number} SUPERSEDED=2 SUPERSEDED value - * @property {number} TERMINATED=3 TERMINATED value - */ - RunAssetDiscoveryResponse.State = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; - values[valuesById[1] = "COMPLETED"] = 1; - values[valuesById[2] = "SUPERSEDED"] = 2; - values[valuesById[3] = "TERMINATED"] = 3; - return values; - })(); - - return RunAssetDiscoveryResponse; + return NotificationMessage; })(); - v1.SecurityCenter = (function() { + v1.OrganizationSettings = (function() { /** - * Constructs a new SecurityCenter service. + * Properties of an OrganizationSettings. * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents a SecurityCenter - * @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 + * @interface IOrganizationSettings + * @property {string|null} [name] OrganizationSettings name + * @property {boolean|null} [enableAssetDiscovery] OrganizationSettings enableAssetDiscovery + * @property {google.cloud.securitycenter.v1.OrganizationSettings.IAssetDiscoveryConfig|null} [assetDiscoveryConfig] OrganizationSettings assetDiscoveryConfig */ - function SecurityCenter(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (SecurityCenter.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = SecurityCenter; /** - * Creates new SecurityCenter service using the specified rpc implementation. - * @function create - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @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 {SecurityCenter} RPC service. Useful where requests and/or responses are streamed. + * Constructs a new OrganizationSettings. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents an OrganizationSettings. + * @implements IOrganizationSettings + * @constructor + * @param {google.cloud.securitycenter.v1.IOrganizationSettings=} [properties] Properties to set */ - SecurityCenter.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; + function OrganizationSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#createSource}. - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @typedef CreateSourceCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.securitycenter.v1.Source} [response] Source + * OrganizationSettings name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1.OrganizationSettings + * @instance */ + OrganizationSettings.prototype.name = ""; /** - * Calls CreateSource. - * @function createSource - * @memberof google.cloud.securitycenter.v1.SecurityCenter + * OrganizationSettings enableAssetDiscovery. + * @member {boolean} enableAssetDiscovery + * @memberof google.cloud.securitycenter.v1.OrganizationSettings * @instance - * @param {google.cloud.securitycenter.v1.ICreateSourceRequest} request CreateSourceRequest message or plain object - * @param {google.cloud.securitycenter.v1.SecurityCenter.CreateSourceCallback} callback Node-style callback called with the error, if any, and Source - * @returns {undefined} - * @variation 1 */ - Object.defineProperty(SecurityCenter.prototype.createSource = function createSource(request, callback) { - return this.rpcCall(createSource, $root.google.cloud.securitycenter.v1.CreateSourceRequest, $root.google.cloud.securitycenter.v1.Source, request, callback); - }, "name", { value: "CreateSource" }); + OrganizationSettings.prototype.enableAssetDiscovery = false; /** - * Calls CreateSource. - * @function createSource - * @memberof google.cloud.securitycenter.v1.SecurityCenter + * OrganizationSettings assetDiscoveryConfig. + * @member {google.cloud.securitycenter.v1.OrganizationSettings.IAssetDiscoveryConfig|null|undefined} assetDiscoveryConfig + * @memberof google.cloud.securitycenter.v1.OrganizationSettings * @instance - * @param {google.cloud.securitycenter.v1.ICreateSourceRequest} request CreateSourceRequest message or plain object - * @returns {Promise} Promise - * @variation 2 */ + OrganizationSettings.prototype.assetDiscoveryConfig = null; /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#createFinding}. - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @typedef CreateFindingCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.securitycenter.v1.Finding} [response] Finding + * Creates a new OrganizationSettings instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.OrganizationSettings + * @static + * @param {google.cloud.securitycenter.v1.IOrganizationSettings=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.OrganizationSettings} OrganizationSettings instance */ + OrganizationSettings.create = function create(properties) { + return new OrganizationSettings(properties); + }; /** - * Calls CreateFinding. - * @function createFinding - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1.ICreateFindingRequest} request CreateFindingRequest message or plain object - * @param {google.cloud.securitycenter.v1.SecurityCenter.CreateFindingCallback} callback Node-style callback called with the error, if any, and Finding - * @returns {undefined} - * @variation 1 + * Encodes the specified OrganizationSettings message. Does not implicitly {@link google.cloud.securitycenter.v1.OrganizationSettings.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.OrganizationSettings + * @static + * @param {google.cloud.securitycenter.v1.IOrganizationSettings} message OrganizationSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - Object.defineProperty(SecurityCenter.prototype.createFinding = function createFinding(request, callback) { - return this.rpcCall(createFinding, $root.google.cloud.securitycenter.v1.CreateFindingRequest, $root.google.cloud.securitycenter.v1.Finding, request, callback); - }, "name", { value: "CreateFinding" }); + OrganizationSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.enableAssetDiscovery != null && message.hasOwnProperty("enableAssetDiscovery")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.enableAssetDiscovery); + if (message.assetDiscoveryConfig != null && message.hasOwnProperty("assetDiscoveryConfig")) + $root.google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.encode(message.assetDiscoveryConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; /** - * Calls CreateFinding. - * @function createFinding - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1.ICreateFindingRequest} request CreateFindingRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Encodes the specified OrganizationSettings message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.OrganizationSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.OrganizationSettings + * @static + * @param {google.cloud.securitycenter.v1.IOrganizationSettings} message OrganizationSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ + OrganizationSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#getIamPolicy}. - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @typedef GetIamPolicyCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.iam.v1.Policy} [response] Policy + * Decodes an OrganizationSettings message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.OrganizationSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.OrganizationSettings} OrganizationSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ + OrganizationSettings.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.cloud.securitycenter.v1.OrganizationSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.enableAssetDiscovery = reader.bool(); + break; + case 3: + message.assetDiscoveryConfig = $root.google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; /** - * Calls GetIamPolicy. - * @function getIamPolicy - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @instance - * @param {google.iam.v1.IGetIamPolicyRequest} request GetIamPolicyRequest message or plain object - * @param {google.cloud.securitycenter.v1.SecurityCenter.GetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy - * @returns {undefined} - * @variation 1 + * Decodes an OrganizationSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.OrganizationSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.OrganizationSettings} OrganizationSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Object.defineProperty(SecurityCenter.prototype.getIamPolicy = function getIamPolicy(request, callback) { - return this.rpcCall(getIamPolicy, $root.google.iam.v1.GetIamPolicyRequest, $root.google.iam.v1.Policy, request, callback); - }, "name", { value: "GetIamPolicy" }); + OrganizationSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OrganizationSettings message. + * @function verify + * @memberof google.cloud.securitycenter.v1.OrganizationSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OrganizationSettings.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.enableAssetDiscovery != null && message.hasOwnProperty("enableAssetDiscovery")) + if (typeof message.enableAssetDiscovery !== "boolean") + return "enableAssetDiscovery: boolean expected"; + if (message.assetDiscoveryConfig != null && message.hasOwnProperty("assetDiscoveryConfig")) { + var error = $root.google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.verify(message.assetDiscoveryConfig); + if (error) + return "assetDiscoveryConfig." + error; + } + return null; + }; + + /** + * Creates an OrganizationSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.OrganizationSettings + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.OrganizationSettings} OrganizationSettings + */ + OrganizationSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.OrganizationSettings) + return object; + var message = new $root.google.cloud.securitycenter.v1.OrganizationSettings(); + if (object.name != null) + message.name = String(object.name); + if (object.enableAssetDiscovery != null) + message.enableAssetDiscovery = Boolean(object.enableAssetDiscovery); + if (object.assetDiscoveryConfig != null) { + if (typeof object.assetDiscoveryConfig !== "object") + throw TypeError(".google.cloud.securitycenter.v1.OrganizationSettings.assetDiscoveryConfig: object expected"); + message.assetDiscoveryConfig = $root.google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.fromObject(object.assetDiscoveryConfig); + } + return message; + }; + + /** + * Creates a plain object from an OrganizationSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.OrganizationSettings + * @static + * @param {google.cloud.securitycenter.v1.OrganizationSettings} message OrganizationSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OrganizationSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.enableAssetDiscovery = false; + object.assetDiscoveryConfig = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.enableAssetDiscovery != null && message.hasOwnProperty("enableAssetDiscovery")) + object.enableAssetDiscovery = message.enableAssetDiscovery; + if (message.assetDiscoveryConfig != null && message.hasOwnProperty("assetDiscoveryConfig")) + object.assetDiscoveryConfig = $root.google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.toObject(message.assetDiscoveryConfig, options); + return object; + }; + + /** + * Converts this OrganizationSettings to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.OrganizationSettings + * @instance + * @returns {Object.} JSON object + */ + OrganizationSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + OrganizationSettings.AssetDiscoveryConfig = (function() { + + /** + * Properties of an AssetDiscoveryConfig. + * @memberof google.cloud.securitycenter.v1.OrganizationSettings + * @interface IAssetDiscoveryConfig + * @property {Array.|null} [projectIds] AssetDiscoveryConfig projectIds + * @property {google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode|null} [inclusionMode] AssetDiscoveryConfig inclusionMode + */ + + /** + * Constructs a new AssetDiscoveryConfig. + * @memberof google.cloud.securitycenter.v1.OrganizationSettings + * @classdesc Represents an AssetDiscoveryConfig. + * @implements IAssetDiscoveryConfig + * @constructor + * @param {google.cloud.securitycenter.v1.OrganizationSettings.IAssetDiscoveryConfig=} [properties] Properties to set + */ + function AssetDiscoveryConfig(properties) { + this.projectIds = []; + 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]]; + } + + /** + * AssetDiscoveryConfig projectIds. + * @member {Array.} projectIds + * @memberof google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig + * @instance + */ + AssetDiscoveryConfig.prototype.projectIds = $util.emptyArray; + + /** + * AssetDiscoveryConfig inclusionMode. + * @member {google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode} inclusionMode + * @memberof google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig + * @instance + */ + AssetDiscoveryConfig.prototype.inclusionMode = 0; + + /** + * Creates a new AssetDiscoveryConfig instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig + * @static + * @param {google.cloud.securitycenter.v1.OrganizationSettings.IAssetDiscoveryConfig=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig} AssetDiscoveryConfig instance + */ + AssetDiscoveryConfig.create = function create(properties) { + return new AssetDiscoveryConfig(properties); + }; + + /** + * Encodes the specified AssetDiscoveryConfig message. Does not implicitly {@link google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig + * @static + * @param {google.cloud.securitycenter.v1.OrganizationSettings.IAssetDiscoveryConfig} message AssetDiscoveryConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AssetDiscoveryConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.projectIds != null && message.projectIds.length) + for (var i = 0; i < message.projectIds.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectIds[i]); + if (message.inclusionMode != null && message.hasOwnProperty("inclusionMode")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.inclusionMode); + return writer; + }; + + /** + * Encodes the specified AssetDiscoveryConfig message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig + * @static + * @param {google.cloud.securitycenter.v1.OrganizationSettings.IAssetDiscoveryConfig} message AssetDiscoveryConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AssetDiscoveryConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AssetDiscoveryConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig} AssetDiscoveryConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AssetDiscoveryConfig.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.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.projectIds && message.projectIds.length)) + message.projectIds = []; + message.projectIds.push(reader.string()); + break; + case 2: + message.inclusionMode = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AssetDiscoveryConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig} AssetDiscoveryConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AssetDiscoveryConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AssetDiscoveryConfig message. + * @function verify + * @memberof google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AssetDiscoveryConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.projectIds != null && message.hasOwnProperty("projectIds")) { + if (!Array.isArray(message.projectIds)) + return "projectIds: array expected"; + for (var i = 0; i < message.projectIds.length; ++i) + if (!$util.isString(message.projectIds[i])) + return "projectIds: string[] expected"; + } + if (message.inclusionMode != null && message.hasOwnProperty("inclusionMode")) + switch (message.inclusionMode) { + default: + return "inclusionMode: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates an AssetDiscoveryConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig} AssetDiscoveryConfig + */ + AssetDiscoveryConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig) + return object; + var message = new $root.google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig(); + if (object.projectIds) { + if (!Array.isArray(object.projectIds)) + throw TypeError(".google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.projectIds: array expected"); + message.projectIds = []; + for (var i = 0; i < object.projectIds.length; ++i) + message.projectIds[i] = String(object.projectIds[i]); + } + switch (object.inclusionMode) { + case "INCLUSION_MODE_UNSPECIFIED": + case 0: + message.inclusionMode = 0; + break; + case "INCLUDE_ONLY": + case 1: + message.inclusionMode = 1; + break; + case "EXCLUDE": + case 2: + message.inclusionMode = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from an AssetDiscoveryConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig + * @static + * @param {google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig} message AssetDiscoveryConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AssetDiscoveryConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.projectIds = []; + if (options.defaults) + object.inclusionMode = options.enums === String ? "INCLUSION_MODE_UNSPECIFIED" : 0; + if (message.projectIds && message.projectIds.length) { + object.projectIds = []; + for (var j = 0; j < message.projectIds.length; ++j) + object.projectIds[j] = message.projectIds[j]; + } + if (message.inclusionMode != null && message.hasOwnProperty("inclusionMode")) + object.inclusionMode = options.enums === String ? $root.google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode[message.inclusionMode] : message.inclusionMode; + return object; + }; + + /** + * Converts this AssetDiscoveryConfig to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig + * @instance + * @returns {Object.} JSON object + */ + AssetDiscoveryConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * InclusionMode enum. + * @name google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode + * @enum {string} + * @property {number} INCLUSION_MODE_UNSPECIFIED=0 INCLUSION_MODE_UNSPECIFIED value + * @property {number} INCLUDE_ONLY=1 INCLUDE_ONLY value + * @property {number} EXCLUDE=2 EXCLUDE value + */ + AssetDiscoveryConfig.InclusionMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "INCLUSION_MODE_UNSPECIFIED"] = 0; + values[valuesById[1] = "INCLUDE_ONLY"] = 1; + values[valuesById[2] = "EXCLUDE"] = 2; + return values; + })(); + + return AssetDiscoveryConfig; + })(); + + return OrganizationSettings; + })(); + + v1.RunAssetDiscoveryResponse = (function() { + + /** + * Properties of a RunAssetDiscoveryResponse. + * @memberof google.cloud.securitycenter.v1 + * @interface IRunAssetDiscoveryResponse + * @property {google.cloud.securitycenter.v1.RunAssetDiscoveryResponse.State|null} [state] RunAssetDiscoveryResponse state + * @property {google.protobuf.IDuration|null} [duration] RunAssetDiscoveryResponse duration + */ + + /** + * Constructs a new RunAssetDiscoveryResponse. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a RunAssetDiscoveryResponse. + * @implements IRunAssetDiscoveryResponse + * @constructor + * @param {google.cloud.securitycenter.v1.IRunAssetDiscoveryResponse=} [properties] Properties to set + */ + function RunAssetDiscoveryResponse(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]]; + } + + /** + * RunAssetDiscoveryResponse state. + * @member {google.cloud.securitycenter.v1.RunAssetDiscoveryResponse.State} state + * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryResponse + * @instance + */ + RunAssetDiscoveryResponse.prototype.state = 0; + + /** + * RunAssetDiscoveryResponse duration. + * @member {google.protobuf.IDuration|null|undefined} duration + * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryResponse + * @instance + */ + RunAssetDiscoveryResponse.prototype.duration = null; + + /** + * Creates a new RunAssetDiscoveryResponse instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryResponse + * @static + * @param {google.cloud.securitycenter.v1.IRunAssetDiscoveryResponse=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.RunAssetDiscoveryResponse} RunAssetDiscoveryResponse instance + */ + RunAssetDiscoveryResponse.create = function create(properties) { + return new RunAssetDiscoveryResponse(properties); + }; + + /** + * Encodes the specified RunAssetDiscoveryResponse message. Does not implicitly {@link google.cloud.securitycenter.v1.RunAssetDiscoveryResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryResponse + * @static + * @param {google.cloud.securitycenter.v1.IRunAssetDiscoveryResponse} message RunAssetDiscoveryResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RunAssetDiscoveryResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.state != null && message.hasOwnProperty("state")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.state); + if (message.duration != null && message.hasOwnProperty("duration")) + $root.google.protobuf.Duration.encode(message.duration, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RunAssetDiscoveryResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.RunAssetDiscoveryResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryResponse + * @static + * @param {google.cloud.securitycenter.v1.IRunAssetDiscoveryResponse} message RunAssetDiscoveryResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RunAssetDiscoveryResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RunAssetDiscoveryResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.RunAssetDiscoveryResponse} RunAssetDiscoveryResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RunAssetDiscoveryResponse.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.cloud.securitycenter.v1.RunAssetDiscoveryResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.state = reader.int32(); + break; + case 2: + message.duration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RunAssetDiscoveryResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.RunAssetDiscoveryResponse} RunAssetDiscoveryResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RunAssetDiscoveryResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RunAssetDiscoveryResponse message. + * @function verify + * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RunAssetDiscoveryResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.duration != null && message.hasOwnProperty("duration")) { + var error = $root.google.protobuf.Duration.verify(message.duration); + if (error) + return "duration." + error; + } + return null; + }; + + /** + * Creates a RunAssetDiscoveryResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.RunAssetDiscoveryResponse} RunAssetDiscoveryResponse + */ + RunAssetDiscoveryResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.RunAssetDiscoveryResponse) + return object; + var message = new $root.google.cloud.securitycenter.v1.RunAssetDiscoveryResponse(); + switch (object.state) { + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "COMPLETED": + case 1: + message.state = 1; + break; + case "SUPERSEDED": + case 2: + message.state = 2; + break; + case "TERMINATED": + case 3: + message.state = 3; + break; + } + if (object.duration != null) { + if (typeof object.duration !== "object") + throw TypeError(".google.cloud.securitycenter.v1.RunAssetDiscoveryResponse.duration: object expected"); + message.duration = $root.google.protobuf.Duration.fromObject(object.duration); + } + return message; + }; + + /** + * Creates a plain object from a RunAssetDiscoveryResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryResponse + * @static + * @param {google.cloud.securitycenter.v1.RunAssetDiscoveryResponse} message RunAssetDiscoveryResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RunAssetDiscoveryResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.duration = null; + } + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.securitycenter.v1.RunAssetDiscoveryResponse.State[message.state] : message.state; + if (message.duration != null && message.hasOwnProperty("duration")) + object.duration = $root.google.protobuf.Duration.toObject(message.duration, options); + return object; + }; + + /** + * Converts this RunAssetDiscoveryResponse to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryResponse + * @instance + * @returns {Object.} JSON object + */ + RunAssetDiscoveryResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * State enum. + * @name google.cloud.securitycenter.v1.RunAssetDiscoveryResponse.State + * @enum {string} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} COMPLETED=1 COMPLETED value + * @property {number} SUPERSEDED=2 SUPERSEDED value + * @property {number} TERMINATED=3 TERMINATED value + */ + RunAssetDiscoveryResponse.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "COMPLETED"] = 1; + values[valuesById[2] = "SUPERSEDED"] = 2; + values[valuesById[3] = "TERMINATED"] = 3; + return values; + })(); + + return RunAssetDiscoveryResponse; + })(); + + v1.SecurityCenter = (function() { + + /** + * Constructs a new SecurityCenter service. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a SecurityCenter + * @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 SecurityCenter(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (SecurityCenter.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = SecurityCenter; + + /** + * Creates new SecurityCenter service using the specified rpc implementation. + * @function create + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @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 {SecurityCenter} RPC service. Useful where requests and/or responses are streamed. + */ + SecurityCenter.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#createSource}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef CreateSourceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1.Source} [response] Source + */ + + /** + * Calls CreateSource. + * @function createSource + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.ICreateSourceRequest} request CreateSourceRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.CreateSourceCallback} callback Node-style callback called with the error, if any, and Source + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.createSource = function createSource(request, callback) { + return this.rpcCall(createSource, $root.google.cloud.securitycenter.v1.CreateSourceRequest, $root.google.cloud.securitycenter.v1.Source, request, callback); + }, "name", { value: "CreateSource" }); + + /** + * Calls CreateSource. + * @function createSource + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.ICreateSourceRequest} request CreateSourceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#createFinding}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef CreateFindingCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1.Finding} [response] Finding + */ + + /** + * Calls CreateFinding. + * @function createFinding + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.ICreateFindingRequest} request CreateFindingRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.CreateFindingCallback} callback Node-style callback called with the error, if any, and Finding + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.createFinding = function createFinding(request, callback) { + return this.rpcCall(createFinding, $root.google.cloud.securitycenter.v1.CreateFindingRequest, $root.google.cloud.securitycenter.v1.Finding, request, callback); + }, "name", { value: "CreateFinding" }); + + /** + * Calls CreateFinding. + * @function createFinding + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.ICreateFindingRequest} request CreateFindingRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#createNotificationConfig}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef CreateNotificationConfigCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1.NotificationConfig} [response] NotificationConfig + */ + + /** + * Calls CreateNotificationConfig. + * @function createNotificationConfig + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.ICreateNotificationConfigRequest} request CreateNotificationConfigRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.CreateNotificationConfigCallback} callback Node-style callback called with the error, if any, and NotificationConfig + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.createNotificationConfig = function createNotificationConfig(request, callback) { + return this.rpcCall(createNotificationConfig, $root.google.cloud.securitycenter.v1.CreateNotificationConfigRequest, $root.google.cloud.securitycenter.v1.NotificationConfig, request, callback); + }, "name", { value: "CreateNotificationConfig" }); + + /** + * Calls CreateNotificationConfig. + * @function createNotificationConfig + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.ICreateNotificationConfigRequest} request CreateNotificationConfigRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#deleteNotificationConfig}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef DeleteNotificationConfigCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteNotificationConfig. + * @function deleteNotificationConfig + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IDeleteNotificationConfigRequest} request DeleteNotificationConfigRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.DeleteNotificationConfigCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.deleteNotificationConfig = function deleteNotificationConfig(request, callback) { + return this.rpcCall(deleteNotificationConfig, $root.google.cloud.securitycenter.v1.DeleteNotificationConfigRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteNotificationConfig" }); + + /** + * Calls DeleteNotificationConfig. + * @function deleteNotificationConfig + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IDeleteNotificationConfigRequest} request DeleteNotificationConfigRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#getIamPolicy}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef GetIamPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.iam.v1.Policy} [response] Policy + */ + + /** + * Calls GetIamPolicy. + * @function getIamPolicy + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.iam.v1.IGetIamPolicyRequest} request GetIamPolicyRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.GetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.getIamPolicy = function getIamPolicy(request, callback) { + return this.rpcCall(getIamPolicy, $root.google.iam.v1.GetIamPolicyRequest, $root.google.iam.v1.Policy, request, callback); + }, "name", { value: "GetIamPolicy" }); + + /** + * Calls GetIamPolicy. + * @function getIamPolicy + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.iam.v1.IGetIamPolicyRequest} request GetIamPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#getNotificationConfig}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef GetNotificationConfigCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1.NotificationConfig} [response] NotificationConfig + */ + + /** + * Calls GetNotificationConfig. + * @function getNotificationConfig + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IGetNotificationConfigRequest} request GetNotificationConfigRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.GetNotificationConfigCallback} callback Node-style callback called with the error, if any, and NotificationConfig + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.getNotificationConfig = function getNotificationConfig(request, callback) { + return this.rpcCall(getNotificationConfig, $root.google.cloud.securitycenter.v1.GetNotificationConfigRequest, $root.google.cloud.securitycenter.v1.NotificationConfig, request, callback); + }, "name", { value: "GetNotificationConfig" }); + + /** + * Calls GetNotificationConfig. + * @function getNotificationConfig + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IGetNotificationConfigRequest} request GetNotificationConfigRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#getOrganizationSettings}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef GetOrganizationSettingsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1.OrganizationSettings} [response] OrganizationSettings + */ + + /** + * Calls GetOrganizationSettings. + * @function getOrganizationSettings + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IGetOrganizationSettingsRequest} request GetOrganizationSettingsRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.GetOrganizationSettingsCallback} callback Node-style callback called with the error, if any, and OrganizationSettings + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.getOrganizationSettings = function getOrganizationSettings(request, callback) { + return this.rpcCall(getOrganizationSettings, $root.google.cloud.securitycenter.v1.GetOrganizationSettingsRequest, $root.google.cloud.securitycenter.v1.OrganizationSettings, request, callback); + }, "name", { value: "GetOrganizationSettings" }); + + /** + * Calls GetOrganizationSettings. + * @function getOrganizationSettings + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IGetOrganizationSettingsRequest} request GetOrganizationSettingsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#getSource}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef GetSourceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1.Source} [response] Source + */ + + /** + * Calls GetSource. + * @function getSource + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IGetSourceRequest} request GetSourceRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.GetSourceCallback} callback Node-style callback called with the error, if any, and Source + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.getSource = function getSource(request, callback) { + return this.rpcCall(getSource, $root.google.cloud.securitycenter.v1.GetSourceRequest, $root.google.cloud.securitycenter.v1.Source, request, callback); + }, "name", { value: "GetSource" }); + + /** + * Calls GetSource. + * @function getSource + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IGetSourceRequest} request GetSourceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#groupAssets}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef GroupAssetsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1.GroupAssetsResponse} [response] GroupAssetsResponse + */ + + /** + * Calls GroupAssets. + * @function groupAssets + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IGroupAssetsRequest} request GroupAssetsRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.GroupAssetsCallback} callback Node-style callback called with the error, if any, and GroupAssetsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.groupAssets = function groupAssets(request, callback) { + return this.rpcCall(groupAssets, $root.google.cloud.securitycenter.v1.GroupAssetsRequest, $root.google.cloud.securitycenter.v1.GroupAssetsResponse, request, callback); + }, "name", { value: "GroupAssets" }); + + /** + * Calls GroupAssets. + * @function groupAssets + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IGroupAssetsRequest} request GroupAssetsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#groupFindings}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef GroupFindingsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1.GroupFindingsResponse} [response] GroupFindingsResponse + */ + + /** + * Calls GroupFindings. + * @function groupFindings + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IGroupFindingsRequest} request GroupFindingsRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.GroupFindingsCallback} callback Node-style callback called with the error, if any, and GroupFindingsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.groupFindings = function groupFindings(request, callback) { + return this.rpcCall(groupFindings, $root.google.cloud.securitycenter.v1.GroupFindingsRequest, $root.google.cloud.securitycenter.v1.GroupFindingsResponse, request, callback); + }, "name", { value: "GroupFindings" }); + + /** + * Calls GroupFindings. + * @function groupFindings + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IGroupFindingsRequest} request GroupFindingsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#listAssets}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef ListAssetsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1.ListAssetsResponse} [response] ListAssetsResponse + */ + + /** + * Calls ListAssets. + * @function listAssets + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IListAssetsRequest} request ListAssetsRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.ListAssetsCallback} callback Node-style callback called with the error, if any, and ListAssetsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.listAssets = function listAssets(request, callback) { + return this.rpcCall(listAssets, $root.google.cloud.securitycenter.v1.ListAssetsRequest, $root.google.cloud.securitycenter.v1.ListAssetsResponse, request, callback); + }, "name", { value: "ListAssets" }); + + /** + * Calls ListAssets. + * @function listAssets + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IListAssetsRequest} request ListAssetsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#listFindings}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef ListFindingsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1.ListFindingsResponse} [response] ListFindingsResponse + */ + + /** + * Calls ListFindings. + * @function listFindings + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IListFindingsRequest} request ListFindingsRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.ListFindingsCallback} callback Node-style callback called with the error, if any, and ListFindingsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.listFindings = function listFindings(request, callback) { + return this.rpcCall(listFindings, $root.google.cloud.securitycenter.v1.ListFindingsRequest, $root.google.cloud.securitycenter.v1.ListFindingsResponse, request, callback); + }, "name", { value: "ListFindings" }); + + /** + * Calls ListFindings. + * @function listFindings + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IListFindingsRequest} request ListFindingsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#listNotificationConfigs}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef ListNotificationConfigsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1.ListNotificationConfigsResponse} [response] ListNotificationConfigsResponse + */ + + /** + * Calls ListNotificationConfigs. + * @function listNotificationConfigs + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IListNotificationConfigsRequest} request ListNotificationConfigsRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.ListNotificationConfigsCallback} callback Node-style callback called with the error, if any, and ListNotificationConfigsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.listNotificationConfigs = function listNotificationConfigs(request, callback) { + return this.rpcCall(listNotificationConfigs, $root.google.cloud.securitycenter.v1.ListNotificationConfigsRequest, $root.google.cloud.securitycenter.v1.ListNotificationConfigsResponse, request, callback); + }, "name", { value: "ListNotificationConfigs" }); + + /** + * Calls ListNotificationConfigs. + * @function listNotificationConfigs + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IListNotificationConfigsRequest} request ListNotificationConfigsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#listSources}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef ListSourcesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1.ListSourcesResponse} [response] ListSourcesResponse + */ + + /** + * Calls ListSources. + * @function listSources + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IListSourcesRequest} request ListSourcesRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.ListSourcesCallback} callback Node-style callback called with the error, if any, and ListSourcesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.listSources = function listSources(request, callback) { + return this.rpcCall(listSources, $root.google.cloud.securitycenter.v1.ListSourcesRequest, $root.google.cloud.securitycenter.v1.ListSourcesResponse, request, callback); + }, "name", { value: "ListSources" }); + + /** + * Calls ListSources. + * @function listSources + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IListSourcesRequest} request ListSourcesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#runAssetDiscovery}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef RunAssetDiscoveryCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls RunAssetDiscovery. + * @function runAssetDiscovery + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IRunAssetDiscoveryRequest} request RunAssetDiscoveryRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.RunAssetDiscoveryCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.runAssetDiscovery = function runAssetDiscovery(request, callback) { + return this.rpcCall(runAssetDiscovery, $root.google.cloud.securitycenter.v1.RunAssetDiscoveryRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "RunAssetDiscovery" }); + + /** + * Calls RunAssetDiscovery. + * @function runAssetDiscovery + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IRunAssetDiscoveryRequest} request RunAssetDiscoveryRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#setFindingState}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef SetFindingStateCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1.Finding} [response] Finding + */ + + /** + * Calls SetFindingState. + * @function setFindingState + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.ISetFindingStateRequest} request SetFindingStateRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.SetFindingStateCallback} callback Node-style callback called with the error, if any, and Finding + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.setFindingState = function setFindingState(request, callback) { + return this.rpcCall(setFindingState, $root.google.cloud.securitycenter.v1.SetFindingStateRequest, $root.google.cloud.securitycenter.v1.Finding, request, callback); + }, "name", { value: "SetFindingState" }); + + /** + * Calls SetFindingState. + * @function setFindingState + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.ISetFindingStateRequest} request SetFindingStateRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#setIamPolicy}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef SetIamPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.iam.v1.Policy} [response] Policy + */ + + /** + * Calls SetIamPolicy. + * @function setIamPolicy + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.iam.v1.ISetIamPolicyRequest} request SetIamPolicyRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.SetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.setIamPolicy = function setIamPolicy(request, callback) { + return this.rpcCall(setIamPolicy, $root.google.iam.v1.SetIamPolicyRequest, $root.google.iam.v1.Policy, request, callback); + }, "name", { value: "SetIamPolicy" }); + + /** + * Calls SetIamPolicy. + * @function setIamPolicy + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.iam.v1.ISetIamPolicyRequest} request SetIamPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#testIamPermissions}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef TestIamPermissionsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.iam.v1.TestIamPermissionsResponse} [response] TestIamPermissionsResponse + */ + + /** + * Calls TestIamPermissions. + * @function testIamPermissions + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.iam.v1.ITestIamPermissionsRequest} request TestIamPermissionsRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.TestIamPermissionsCallback} callback Node-style callback called with the error, if any, and TestIamPermissionsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.testIamPermissions = function testIamPermissions(request, callback) { + return this.rpcCall(testIamPermissions, $root.google.iam.v1.TestIamPermissionsRequest, $root.google.iam.v1.TestIamPermissionsResponse, request, callback); + }, "name", { value: "TestIamPermissions" }); + + /** + * Calls TestIamPermissions. + * @function testIamPermissions + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.iam.v1.ITestIamPermissionsRequest} request TestIamPermissionsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#updateFinding}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef UpdateFindingCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1.Finding} [response] Finding + */ + + /** + * Calls UpdateFinding. + * @function updateFinding + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IUpdateFindingRequest} request UpdateFindingRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.UpdateFindingCallback} callback Node-style callback called with the error, if any, and Finding + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.updateFinding = function updateFinding(request, callback) { + return this.rpcCall(updateFinding, $root.google.cloud.securitycenter.v1.UpdateFindingRequest, $root.google.cloud.securitycenter.v1.Finding, request, callback); + }, "name", { value: "UpdateFinding" }); + + /** + * Calls UpdateFinding. + * @function updateFinding + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IUpdateFindingRequest} request UpdateFindingRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#updateNotificationConfig}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef UpdateNotificationConfigCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1.NotificationConfig} [response] NotificationConfig + */ + + /** + * Calls UpdateNotificationConfig. + * @function updateNotificationConfig + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IUpdateNotificationConfigRequest} request UpdateNotificationConfigRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.UpdateNotificationConfigCallback} callback Node-style callback called with the error, if any, and NotificationConfig + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.updateNotificationConfig = function updateNotificationConfig(request, callback) { + return this.rpcCall(updateNotificationConfig, $root.google.cloud.securitycenter.v1.UpdateNotificationConfigRequest, $root.google.cloud.securitycenter.v1.NotificationConfig, request, callback); + }, "name", { value: "UpdateNotificationConfig" }); + + /** + * Calls UpdateNotificationConfig. + * @function updateNotificationConfig + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IUpdateNotificationConfigRequest} request UpdateNotificationConfigRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#updateOrganizationSettings}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef UpdateOrganizationSettingsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1.OrganizationSettings} [response] OrganizationSettings + */ + + /** + * Calls UpdateOrganizationSettings. + * @function updateOrganizationSettings + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IUpdateOrganizationSettingsRequest} request UpdateOrganizationSettingsRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.UpdateOrganizationSettingsCallback} callback Node-style callback called with the error, if any, and OrganizationSettings + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.updateOrganizationSettings = function updateOrganizationSettings(request, callback) { + return this.rpcCall(updateOrganizationSettings, $root.google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest, $root.google.cloud.securitycenter.v1.OrganizationSettings, request, callback); + }, "name", { value: "UpdateOrganizationSettings" }); + + /** + * Calls UpdateOrganizationSettings. + * @function updateOrganizationSettings + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IUpdateOrganizationSettingsRequest} request UpdateOrganizationSettingsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#updateSource}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef UpdateSourceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1.Source} [response] Source + */ + + /** + * Calls UpdateSource. + * @function updateSource + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IUpdateSourceRequest} request UpdateSourceRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.UpdateSourceCallback} callback Node-style callback called with the error, if any, and Source + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.updateSource = function updateSource(request, callback) { + return this.rpcCall(updateSource, $root.google.cloud.securitycenter.v1.UpdateSourceRequest, $root.google.cloud.securitycenter.v1.Source, request, callback); + }, "name", { value: "UpdateSource" }); + + /** + * Calls UpdateSource. + * @function updateSource + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IUpdateSourceRequest} request UpdateSourceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#updateSecurityMarks}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef UpdateSecurityMarksCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1.SecurityMarks} [response] SecurityMarks + */ + + /** + * Calls UpdateSecurityMarks. + * @function updateSecurityMarks + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IUpdateSecurityMarksRequest} request UpdateSecurityMarksRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.UpdateSecurityMarksCallback} callback Node-style callback called with the error, if any, and SecurityMarks + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.updateSecurityMarks = function updateSecurityMarks(request, callback) { + return this.rpcCall(updateSecurityMarks, $root.google.cloud.securitycenter.v1.UpdateSecurityMarksRequest, $root.google.cloud.securitycenter.v1.SecurityMarks, request, callback); + }, "name", { value: "UpdateSecurityMarks" }); + + /** + * Calls UpdateSecurityMarks. + * @function updateSecurityMarks + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IUpdateSecurityMarksRequest} request UpdateSecurityMarksRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return SecurityCenter; + })(); + + v1.CreateFindingRequest = (function() { + + /** + * Properties of a CreateFindingRequest. + * @memberof google.cloud.securitycenter.v1 + * @interface ICreateFindingRequest + * @property {string|null} [parent] CreateFindingRequest parent + * @property {string|null} [findingId] CreateFindingRequest findingId + * @property {google.cloud.securitycenter.v1.IFinding|null} [finding] CreateFindingRequest finding + */ + + /** + * Constructs a new CreateFindingRequest. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a CreateFindingRequest. + * @implements ICreateFindingRequest + * @constructor + * @param {google.cloud.securitycenter.v1.ICreateFindingRequest=} [properties] Properties to set + */ + function CreateFindingRequest(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]]; + } + + /** + * CreateFindingRequest parent. + * @member {string} parent + * @memberof google.cloud.securitycenter.v1.CreateFindingRequest + * @instance + */ + CreateFindingRequest.prototype.parent = ""; /** - * Calls GetIamPolicy. - * @function getIamPolicy - * @memberof google.cloud.securitycenter.v1.SecurityCenter + * CreateFindingRequest findingId. + * @member {string} findingId + * @memberof google.cloud.securitycenter.v1.CreateFindingRequest * @instance - * @param {google.iam.v1.IGetIamPolicyRequest} request GetIamPolicyRequest message or plain object - * @returns {Promise} Promise - * @variation 2 */ + CreateFindingRequest.prototype.findingId = ""; + + /** + * CreateFindingRequest finding. + * @member {google.cloud.securitycenter.v1.IFinding|null|undefined} finding + * @memberof google.cloud.securitycenter.v1.CreateFindingRequest + * @instance + */ + CreateFindingRequest.prototype.finding = null; + + /** + * Creates a new CreateFindingRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.CreateFindingRequest + * @static + * @param {google.cloud.securitycenter.v1.ICreateFindingRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.CreateFindingRequest} CreateFindingRequest instance + */ + CreateFindingRequest.create = function create(properties) { + return new CreateFindingRequest(properties); + }; + + /** + * Encodes the specified CreateFindingRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.CreateFindingRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.CreateFindingRequest + * @static + * @param {google.cloud.securitycenter.v1.ICreateFindingRequest} message CreateFindingRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateFindingRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && message.hasOwnProperty("parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.findingId != null && message.hasOwnProperty("findingId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.findingId); + if (message.finding != null && message.hasOwnProperty("finding")) + $root.google.cloud.securitycenter.v1.Finding.encode(message.finding, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateFindingRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.CreateFindingRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.CreateFindingRequest + * @static + * @param {google.cloud.securitycenter.v1.ICreateFindingRequest} message CreateFindingRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateFindingRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateFindingRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.CreateFindingRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.CreateFindingRequest} CreateFindingRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateFindingRequest.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.cloud.securitycenter.v1.CreateFindingRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.findingId = reader.string(); + break; + case 3: + message.finding = $root.google.cloud.securitycenter.v1.Finding.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateFindingRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.CreateFindingRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.CreateFindingRequest} CreateFindingRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateFindingRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateFindingRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1.CreateFindingRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateFindingRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.findingId != null && message.hasOwnProperty("findingId")) + if (!$util.isString(message.findingId)) + return "findingId: string expected"; + if (message.finding != null && message.hasOwnProperty("finding")) { + var error = $root.google.cloud.securitycenter.v1.Finding.verify(message.finding); + if (error) + return "finding." + error; + } + return null; + }; + + /** + * Creates a CreateFindingRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.CreateFindingRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.CreateFindingRequest} CreateFindingRequest + */ + CreateFindingRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.CreateFindingRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1.CreateFindingRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.findingId != null) + message.findingId = String(object.findingId); + if (object.finding != null) { + if (typeof object.finding !== "object") + throw TypeError(".google.cloud.securitycenter.v1.CreateFindingRequest.finding: object expected"); + message.finding = $root.google.cloud.securitycenter.v1.Finding.fromObject(object.finding); + } + return message; + }; + + /** + * Creates a plain object from a CreateFindingRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.CreateFindingRequest + * @static + * @param {google.cloud.securitycenter.v1.CreateFindingRequest} message CreateFindingRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateFindingRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.findingId = ""; + object.finding = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.findingId != null && message.hasOwnProperty("findingId")) + object.findingId = message.findingId; + if (message.finding != null && message.hasOwnProperty("finding")) + object.finding = $root.google.cloud.securitycenter.v1.Finding.toObject(message.finding, options); + return object; + }; + + /** + * Converts this CreateFindingRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.CreateFindingRequest + * @instance + * @returns {Object.} JSON object + */ + CreateFindingRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return CreateFindingRequest; + })(); + + v1.CreateNotificationConfigRequest = (function() { + + /** + * Properties of a CreateNotificationConfigRequest. + * @memberof google.cloud.securitycenter.v1 + * @interface ICreateNotificationConfigRequest + * @property {string|null} [parent] CreateNotificationConfigRequest parent + * @property {string|null} [configId] CreateNotificationConfigRequest configId + * @property {google.cloud.securitycenter.v1.INotificationConfig|null} [notificationConfig] CreateNotificationConfigRequest notificationConfig + */ + + /** + * Constructs a new CreateNotificationConfigRequest. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a CreateNotificationConfigRequest. + * @implements ICreateNotificationConfigRequest + * @constructor + * @param {google.cloud.securitycenter.v1.ICreateNotificationConfigRequest=} [properties] Properties to set + */ + function CreateNotificationConfigRequest(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]]; + } + + /** + * CreateNotificationConfigRequest parent. + * @member {string} parent + * @memberof google.cloud.securitycenter.v1.CreateNotificationConfigRequest + * @instance + */ + CreateNotificationConfigRequest.prototype.parent = ""; + + /** + * CreateNotificationConfigRequest configId. + * @member {string} configId + * @memberof google.cloud.securitycenter.v1.CreateNotificationConfigRequest + * @instance + */ + CreateNotificationConfigRequest.prototype.configId = ""; + + /** + * CreateNotificationConfigRequest notificationConfig. + * @member {google.cloud.securitycenter.v1.INotificationConfig|null|undefined} notificationConfig + * @memberof google.cloud.securitycenter.v1.CreateNotificationConfigRequest + * @instance + */ + CreateNotificationConfigRequest.prototype.notificationConfig = null; + + /** + * Creates a new CreateNotificationConfigRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.CreateNotificationConfigRequest + * @static + * @param {google.cloud.securitycenter.v1.ICreateNotificationConfigRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.CreateNotificationConfigRequest} CreateNotificationConfigRequest instance + */ + CreateNotificationConfigRequest.create = function create(properties) { + return new CreateNotificationConfigRequest(properties); + }; /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#getOrganizationSettings}. - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @typedef GetOrganizationSettingsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.securitycenter.v1.OrganizationSettings} [response] OrganizationSettings + * Encodes the specified CreateNotificationConfigRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.CreateNotificationConfigRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.CreateNotificationConfigRequest + * @static + * @param {google.cloud.securitycenter.v1.ICreateNotificationConfigRequest} message CreateNotificationConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ + CreateNotificationConfigRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && message.hasOwnProperty("parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.configId != null && message.hasOwnProperty("configId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.configId); + if (message.notificationConfig != null && message.hasOwnProperty("notificationConfig")) + $root.google.cloud.securitycenter.v1.NotificationConfig.encode(message.notificationConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; /** - * Calls GetOrganizationSettings. - * @function getOrganizationSettings - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1.IGetOrganizationSettingsRequest} request GetOrganizationSettingsRequest message or plain object - * @param {google.cloud.securitycenter.v1.SecurityCenter.GetOrganizationSettingsCallback} callback Node-style callback called with the error, if any, and OrganizationSettings - * @returns {undefined} - * @variation 1 + * Encodes the specified CreateNotificationConfigRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.CreateNotificationConfigRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.CreateNotificationConfigRequest + * @static + * @param {google.cloud.securitycenter.v1.ICreateNotificationConfigRequest} message CreateNotificationConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - Object.defineProperty(SecurityCenter.prototype.getOrganizationSettings = function getOrganizationSettings(request, callback) { - return this.rpcCall(getOrganizationSettings, $root.google.cloud.securitycenter.v1.GetOrganizationSettingsRequest, $root.google.cloud.securitycenter.v1.OrganizationSettings, request, callback); - }, "name", { value: "GetOrganizationSettings" }); + CreateNotificationConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; /** - * Calls GetOrganizationSettings. - * @function getOrganizationSettings - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1.IGetOrganizationSettingsRequest} request GetOrganizationSettingsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Decodes a CreateNotificationConfigRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.CreateNotificationConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.CreateNotificationConfigRequest} CreateNotificationConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ + CreateNotificationConfigRequest.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.cloud.securitycenter.v1.CreateNotificationConfigRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.configId = reader.string(); + break; + case 3: + message.notificationConfig = $root.google.cloud.securitycenter.v1.NotificationConfig.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#getSource}. - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @typedef GetSourceCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.securitycenter.v1.Source} [response] Source + * Decodes a CreateNotificationConfigRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.CreateNotificationConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.CreateNotificationConfigRequest} CreateNotificationConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ + CreateNotificationConfigRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; /** - * Calls GetSource. - * @function getSource - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1.IGetSourceRequest} request GetSourceRequest message or plain object - * @param {google.cloud.securitycenter.v1.SecurityCenter.GetSourceCallback} callback Node-style callback called with the error, if any, and Source - * @returns {undefined} - * @variation 1 + * Verifies a CreateNotificationConfigRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1.CreateNotificationConfigRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Object.defineProperty(SecurityCenter.prototype.getSource = function getSource(request, callback) { - return this.rpcCall(getSource, $root.google.cloud.securitycenter.v1.GetSourceRequest, $root.google.cloud.securitycenter.v1.Source, request, callback); - }, "name", { value: "GetSource" }); + CreateNotificationConfigRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.configId != null && message.hasOwnProperty("configId")) + if (!$util.isString(message.configId)) + return "configId: string expected"; + if (message.notificationConfig != null && message.hasOwnProperty("notificationConfig")) { + var error = $root.google.cloud.securitycenter.v1.NotificationConfig.verify(message.notificationConfig); + if (error) + return "notificationConfig." + error; + } + return null; + }; /** - * Calls GetSource. - * @function getSource - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1.IGetSourceRequest} request GetSourceRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Creates a CreateNotificationConfigRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.CreateNotificationConfigRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.CreateNotificationConfigRequest} CreateNotificationConfigRequest */ + CreateNotificationConfigRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.CreateNotificationConfigRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1.CreateNotificationConfigRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.configId != null) + message.configId = String(object.configId); + if (object.notificationConfig != null) { + if (typeof object.notificationConfig !== "object") + throw TypeError(".google.cloud.securitycenter.v1.CreateNotificationConfigRequest.notificationConfig: object expected"); + message.notificationConfig = $root.google.cloud.securitycenter.v1.NotificationConfig.fromObject(object.notificationConfig); + } + return message; + }; /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#groupAssets}. - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @typedef GroupAssetsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.securitycenter.v1.GroupAssetsResponse} [response] GroupAssetsResponse + * Creates a plain object from a CreateNotificationConfigRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.CreateNotificationConfigRequest + * @static + * @param {google.cloud.securitycenter.v1.CreateNotificationConfigRequest} message CreateNotificationConfigRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object */ + CreateNotificationConfigRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.configId = ""; + object.notificationConfig = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.configId != null && message.hasOwnProperty("configId")) + object.configId = message.configId; + if (message.notificationConfig != null && message.hasOwnProperty("notificationConfig")) + object.notificationConfig = $root.google.cloud.securitycenter.v1.NotificationConfig.toObject(message.notificationConfig, options); + return object; + }; /** - * Calls GroupAssets. - * @function groupAssets - * @memberof google.cloud.securitycenter.v1.SecurityCenter + * Converts this CreateNotificationConfigRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.CreateNotificationConfigRequest * @instance - * @param {google.cloud.securitycenter.v1.IGroupAssetsRequest} request GroupAssetsRequest message or plain object - * @param {google.cloud.securitycenter.v1.SecurityCenter.GroupAssetsCallback} callback Node-style callback called with the error, if any, and GroupAssetsResponse - * @returns {undefined} - * @variation 1 + * @returns {Object.} JSON object */ - Object.defineProperty(SecurityCenter.prototype.groupAssets = function groupAssets(request, callback) { - return this.rpcCall(groupAssets, $root.google.cloud.securitycenter.v1.GroupAssetsRequest, $root.google.cloud.securitycenter.v1.GroupAssetsResponse, request, callback); - }, "name", { value: "GroupAssets" }); + CreateNotificationConfigRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return CreateNotificationConfigRequest; + })(); + + v1.CreateSourceRequest = (function() { /** - * Calls GroupAssets. - * @function groupAssets - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1.IGroupAssetsRequest} request GroupAssetsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Properties of a CreateSourceRequest. + * @memberof google.cloud.securitycenter.v1 + * @interface ICreateSourceRequest + * @property {string|null} [parent] CreateSourceRequest parent + * @property {google.cloud.securitycenter.v1.ISource|null} [source] CreateSourceRequest source */ /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#groupFindings}. - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @typedef GroupFindingsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.securitycenter.v1.GroupFindingsResponse} [response] GroupFindingsResponse + * Constructs a new CreateSourceRequest. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a CreateSourceRequest. + * @implements ICreateSourceRequest + * @constructor + * @param {google.cloud.securitycenter.v1.ICreateSourceRequest=} [properties] Properties to set */ + function CreateSourceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } /** - * Calls GroupFindings. - * @function groupFindings - * @memberof google.cloud.securitycenter.v1.SecurityCenter + * CreateSourceRequest parent. + * @member {string} parent + * @memberof google.cloud.securitycenter.v1.CreateSourceRequest * @instance - * @param {google.cloud.securitycenter.v1.IGroupFindingsRequest} request GroupFindingsRequest message or plain object - * @param {google.cloud.securitycenter.v1.SecurityCenter.GroupFindingsCallback} callback Node-style callback called with the error, if any, and GroupFindingsResponse - * @returns {undefined} - * @variation 1 */ - Object.defineProperty(SecurityCenter.prototype.groupFindings = function groupFindings(request, callback) { - return this.rpcCall(groupFindings, $root.google.cloud.securitycenter.v1.GroupFindingsRequest, $root.google.cloud.securitycenter.v1.GroupFindingsResponse, request, callback); - }, "name", { value: "GroupFindings" }); + CreateSourceRequest.prototype.parent = ""; /** - * Calls GroupFindings. - * @function groupFindings - * @memberof google.cloud.securitycenter.v1.SecurityCenter + * CreateSourceRequest source. + * @member {google.cloud.securitycenter.v1.ISource|null|undefined} source + * @memberof google.cloud.securitycenter.v1.CreateSourceRequest * @instance - * @param {google.cloud.securitycenter.v1.IGroupFindingsRequest} request GroupFindingsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 */ + CreateSourceRequest.prototype.source = null; /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#listAssets}. - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @typedef ListAssetsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.securitycenter.v1.ListAssetsResponse} [response] ListAssetsResponse + * Creates a new CreateSourceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.CreateSourceRequest + * @static + * @param {google.cloud.securitycenter.v1.ICreateSourceRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.CreateSourceRequest} CreateSourceRequest instance */ + CreateSourceRequest.create = function create(properties) { + return new CreateSourceRequest(properties); + }; /** - * Calls ListAssets. - * @function listAssets - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1.IListAssetsRequest} request ListAssetsRequest message or plain object - * @param {google.cloud.securitycenter.v1.SecurityCenter.ListAssetsCallback} callback Node-style callback called with the error, if any, and ListAssetsResponse - * @returns {undefined} - * @variation 1 + * Encodes the specified CreateSourceRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.CreateSourceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.CreateSourceRequest + * @static + * @param {google.cloud.securitycenter.v1.ICreateSourceRequest} message CreateSourceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - Object.defineProperty(SecurityCenter.prototype.listAssets = function listAssets(request, callback) { - return this.rpcCall(listAssets, $root.google.cloud.securitycenter.v1.ListAssetsRequest, $root.google.cloud.securitycenter.v1.ListAssetsResponse, request, callback); - }, "name", { value: "ListAssets" }); + CreateSourceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && message.hasOwnProperty("parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.source != null && message.hasOwnProperty("source")) + $root.google.cloud.securitycenter.v1.Source.encode(message.source, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; /** - * Calls ListAssets. - * @function listAssets - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1.IListAssetsRequest} request ListAssetsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Encodes the specified CreateSourceRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.CreateSourceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.CreateSourceRequest + * @static + * @param {google.cloud.securitycenter.v1.ICreateSourceRequest} message CreateSourceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ + CreateSourceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#listFindings}. - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @typedef ListFindingsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.securitycenter.v1.ListFindingsResponse} [response] ListFindingsResponse + * Decodes a CreateSourceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.CreateSourceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.CreateSourceRequest} CreateSourceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ + CreateSourceRequest.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.cloud.securitycenter.v1.CreateSourceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.source = $root.google.cloud.securitycenter.v1.Source.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; /** - * Calls ListFindings. - * @function listFindings - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1.IListFindingsRequest} request ListFindingsRequest message or plain object - * @param {google.cloud.securitycenter.v1.SecurityCenter.ListFindingsCallback} callback Node-style callback called with the error, if any, and ListFindingsResponse - * @returns {undefined} - * @variation 1 + * Decodes a CreateSourceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.CreateSourceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.CreateSourceRequest} CreateSourceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Object.defineProperty(SecurityCenter.prototype.listFindings = function listFindings(request, callback) { - return this.rpcCall(listFindings, $root.google.cloud.securitycenter.v1.ListFindingsRequest, $root.google.cloud.securitycenter.v1.ListFindingsResponse, request, callback); - }, "name", { value: "ListFindings" }); + CreateSourceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; /** - * Calls ListFindings. - * @function listFindings - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1.IListFindingsRequest} request ListFindingsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Verifies a CreateSourceRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1.CreateSourceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not */ + CreateSourceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.source != null && message.hasOwnProperty("source")) { + var error = $root.google.cloud.securitycenter.v1.Source.verify(message.source); + if (error) + return "source." + error; + } + return null; + }; /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#listSources}. - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @typedef ListSourcesCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.securitycenter.v1.ListSourcesResponse} [response] ListSourcesResponse + * Creates a CreateSourceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.CreateSourceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.CreateSourceRequest} CreateSourceRequest */ + CreateSourceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.CreateSourceRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1.CreateSourceRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.source != null) { + if (typeof object.source !== "object") + throw TypeError(".google.cloud.securitycenter.v1.CreateSourceRequest.source: object expected"); + message.source = $root.google.cloud.securitycenter.v1.Source.fromObject(object.source); + } + return message; + }; /** - * Calls ListSources. - * @function listSources - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1.IListSourcesRequest} request ListSourcesRequest message or plain object - * @param {google.cloud.securitycenter.v1.SecurityCenter.ListSourcesCallback} callback Node-style callback called with the error, if any, and ListSourcesResponse - * @returns {undefined} - * @variation 1 + * Creates a plain object from a CreateSourceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.CreateSourceRequest + * @static + * @param {google.cloud.securitycenter.v1.CreateSourceRequest} message CreateSourceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object */ - Object.defineProperty(SecurityCenter.prototype.listSources = function listSources(request, callback) { - return this.rpcCall(listSources, $root.google.cloud.securitycenter.v1.ListSourcesRequest, $root.google.cloud.securitycenter.v1.ListSourcesResponse, request, callback); - }, "name", { value: "ListSources" }); + CreateSourceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.source = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.source != null && message.hasOwnProperty("source")) + object.source = $root.google.cloud.securitycenter.v1.Source.toObject(message.source, options); + return object; + }; /** - * Calls ListSources. - * @function listSources - * @memberof google.cloud.securitycenter.v1.SecurityCenter + * Converts this CreateSourceRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.CreateSourceRequest * @instance - * @param {google.cloud.securitycenter.v1.IListSourcesRequest} request ListSourcesRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * @returns {Object.} JSON object */ + CreateSourceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return CreateSourceRequest; + })(); + + v1.DeleteNotificationConfigRequest = (function() { /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#runAssetDiscovery}. - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @typedef RunAssetDiscoveryCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation + * Properties of a DeleteNotificationConfigRequest. + * @memberof google.cloud.securitycenter.v1 + * @interface IDeleteNotificationConfigRequest + * @property {string|null} [name] DeleteNotificationConfigRequest name */ /** - * Calls RunAssetDiscovery. - * @function runAssetDiscovery - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1.IRunAssetDiscoveryRequest} request RunAssetDiscoveryRequest message or plain object - * @param {google.cloud.securitycenter.v1.SecurityCenter.RunAssetDiscoveryCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 + * Constructs a new DeleteNotificationConfigRequest. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a DeleteNotificationConfigRequest. + * @implements IDeleteNotificationConfigRequest + * @constructor + * @param {google.cloud.securitycenter.v1.IDeleteNotificationConfigRequest=} [properties] Properties to set */ - Object.defineProperty(SecurityCenter.prototype.runAssetDiscovery = function runAssetDiscovery(request, callback) { - return this.rpcCall(runAssetDiscovery, $root.google.cloud.securitycenter.v1.RunAssetDiscoveryRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "RunAssetDiscovery" }); + function DeleteNotificationConfigRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } /** - * Calls RunAssetDiscovery. - * @function runAssetDiscovery - * @memberof google.cloud.securitycenter.v1.SecurityCenter + * DeleteNotificationConfigRequest name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1.DeleteNotificationConfigRequest * @instance - * @param {google.cloud.securitycenter.v1.IRunAssetDiscoveryRequest} request RunAssetDiscoveryRequest message or plain object - * @returns {Promise} Promise - * @variation 2 */ + DeleteNotificationConfigRequest.prototype.name = ""; - /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#setFindingState}. - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @typedef SetFindingStateCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.securitycenter.v1.Finding} [response] Finding + /** + * Creates a new DeleteNotificationConfigRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.DeleteNotificationConfigRequest + * @static + * @param {google.cloud.securitycenter.v1.IDeleteNotificationConfigRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.DeleteNotificationConfigRequest} DeleteNotificationConfigRequest instance */ + DeleteNotificationConfigRequest.create = function create(properties) { + return new DeleteNotificationConfigRequest(properties); + }; /** - * Calls SetFindingState. - * @function setFindingState - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1.ISetFindingStateRequest} request SetFindingStateRequest message or plain object - * @param {google.cloud.securitycenter.v1.SecurityCenter.SetFindingStateCallback} callback Node-style callback called with the error, if any, and Finding - * @returns {undefined} - * @variation 1 + * Encodes the specified DeleteNotificationConfigRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.DeleteNotificationConfigRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.DeleteNotificationConfigRequest + * @static + * @param {google.cloud.securitycenter.v1.IDeleteNotificationConfigRequest} message DeleteNotificationConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - Object.defineProperty(SecurityCenter.prototype.setFindingState = function setFindingState(request, callback) { - return this.rpcCall(setFindingState, $root.google.cloud.securitycenter.v1.SetFindingStateRequest, $root.google.cloud.securitycenter.v1.Finding, request, callback); - }, "name", { value: "SetFindingState" }); + DeleteNotificationConfigRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; /** - * Calls SetFindingState. - * @function setFindingState - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1.ISetFindingStateRequest} request SetFindingStateRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Encodes the specified DeleteNotificationConfigRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.DeleteNotificationConfigRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.DeleteNotificationConfigRequest + * @static + * @param {google.cloud.securitycenter.v1.IDeleteNotificationConfigRequest} message DeleteNotificationConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ + DeleteNotificationConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#setIamPolicy}. - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @typedef SetIamPolicyCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.iam.v1.Policy} [response] Policy + * Decodes a DeleteNotificationConfigRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.DeleteNotificationConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.DeleteNotificationConfigRequest} DeleteNotificationConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ + DeleteNotificationConfigRequest.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.cloud.securitycenter.v1.DeleteNotificationConfigRequest(); + 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; + }; /** - * Calls SetIamPolicy. - * @function setIamPolicy - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @instance - * @param {google.iam.v1.ISetIamPolicyRequest} request SetIamPolicyRequest message or plain object - * @param {google.cloud.securitycenter.v1.SecurityCenter.SetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy - * @returns {undefined} - * @variation 1 + * Decodes a DeleteNotificationConfigRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.DeleteNotificationConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.DeleteNotificationConfigRequest} DeleteNotificationConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Object.defineProperty(SecurityCenter.prototype.setIamPolicy = function setIamPolicy(request, callback) { - return this.rpcCall(setIamPolicy, $root.google.iam.v1.SetIamPolicyRequest, $root.google.iam.v1.Policy, request, callback); - }, "name", { value: "SetIamPolicy" }); + DeleteNotificationConfigRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; /** - * Calls SetIamPolicy. - * @function setIamPolicy - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @instance - * @param {google.iam.v1.ISetIamPolicyRequest} request SetIamPolicyRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Verifies a DeleteNotificationConfigRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1.DeleteNotificationConfigRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not */ + DeleteNotificationConfigRequest.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; + }; /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#testIamPermissions}. - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @typedef TestIamPermissionsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.iam.v1.TestIamPermissionsResponse} [response] TestIamPermissionsResponse + * Creates a DeleteNotificationConfigRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.DeleteNotificationConfigRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.DeleteNotificationConfigRequest} DeleteNotificationConfigRequest */ + DeleteNotificationConfigRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.DeleteNotificationConfigRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1.DeleteNotificationConfigRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; /** - * Calls TestIamPermissions. - * @function testIamPermissions - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @instance - * @param {google.iam.v1.ITestIamPermissionsRequest} request TestIamPermissionsRequest message or plain object - * @param {google.cloud.securitycenter.v1.SecurityCenter.TestIamPermissionsCallback} callback Node-style callback called with the error, if any, and TestIamPermissionsResponse - * @returns {undefined} - * @variation 1 + * Creates a plain object from a DeleteNotificationConfigRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.DeleteNotificationConfigRequest + * @static + * @param {google.cloud.securitycenter.v1.DeleteNotificationConfigRequest} message DeleteNotificationConfigRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object */ - Object.defineProperty(SecurityCenter.prototype.testIamPermissions = function testIamPermissions(request, callback) { - return this.rpcCall(testIamPermissions, $root.google.iam.v1.TestIamPermissionsRequest, $root.google.iam.v1.TestIamPermissionsResponse, request, callback); - }, "name", { value: "TestIamPermissions" }); + DeleteNotificationConfigRequest.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; + }; /** - * Calls TestIamPermissions. - * @function testIamPermissions - * @memberof google.cloud.securitycenter.v1.SecurityCenter + * Converts this DeleteNotificationConfigRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.DeleteNotificationConfigRequest * @instance - * @param {google.iam.v1.ITestIamPermissionsRequest} request TestIamPermissionsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * @returns {Object.} JSON object */ + DeleteNotificationConfigRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DeleteNotificationConfigRequest; + })(); + + v1.GetNotificationConfigRequest = (function() { /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#updateFinding}. - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @typedef UpdateFindingCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.securitycenter.v1.Finding} [response] Finding + * Properties of a GetNotificationConfigRequest. + * @memberof google.cloud.securitycenter.v1 + * @interface IGetNotificationConfigRequest + * @property {string|null} [name] GetNotificationConfigRequest name */ /** - * Calls UpdateFinding. - * @function updateFinding - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1.IUpdateFindingRequest} request UpdateFindingRequest message or plain object - * @param {google.cloud.securitycenter.v1.SecurityCenter.UpdateFindingCallback} callback Node-style callback called with the error, if any, and Finding - * @returns {undefined} - * @variation 1 + * Constructs a new GetNotificationConfigRequest. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a GetNotificationConfigRequest. + * @implements IGetNotificationConfigRequest + * @constructor + * @param {google.cloud.securitycenter.v1.IGetNotificationConfigRequest=} [properties] Properties to set */ - Object.defineProperty(SecurityCenter.prototype.updateFinding = function updateFinding(request, callback) { - return this.rpcCall(updateFinding, $root.google.cloud.securitycenter.v1.UpdateFindingRequest, $root.google.cloud.securitycenter.v1.Finding, request, callback); - }, "name", { value: "UpdateFinding" }); + function GetNotificationConfigRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } /** - * Calls UpdateFinding. - * @function updateFinding - * @memberof google.cloud.securitycenter.v1.SecurityCenter + * GetNotificationConfigRequest name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1.GetNotificationConfigRequest * @instance - * @param {google.cloud.securitycenter.v1.IUpdateFindingRequest} request UpdateFindingRequest message or plain object - * @returns {Promise} Promise - * @variation 2 */ + GetNotificationConfigRequest.prototype.name = ""; /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#updateOrganizationSettings}. - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @typedef UpdateOrganizationSettingsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.securitycenter.v1.OrganizationSettings} [response] OrganizationSettings + * Creates a new GetNotificationConfigRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.GetNotificationConfigRequest + * @static + * @param {google.cloud.securitycenter.v1.IGetNotificationConfigRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.GetNotificationConfigRequest} GetNotificationConfigRequest instance */ + GetNotificationConfigRequest.create = function create(properties) { + return new GetNotificationConfigRequest(properties); + }; /** - * Calls UpdateOrganizationSettings. - * @function updateOrganizationSettings - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1.IUpdateOrganizationSettingsRequest} request UpdateOrganizationSettingsRequest message or plain object - * @param {google.cloud.securitycenter.v1.SecurityCenter.UpdateOrganizationSettingsCallback} callback Node-style callback called with the error, if any, and OrganizationSettings - * @returns {undefined} - * @variation 1 + * Encodes the specified GetNotificationConfigRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.GetNotificationConfigRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.GetNotificationConfigRequest + * @static + * @param {google.cloud.securitycenter.v1.IGetNotificationConfigRequest} message GetNotificationConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - Object.defineProperty(SecurityCenter.prototype.updateOrganizationSettings = function updateOrganizationSettings(request, callback) { - return this.rpcCall(updateOrganizationSettings, $root.google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest, $root.google.cloud.securitycenter.v1.OrganizationSettings, request, callback); - }, "name", { value: "UpdateOrganizationSettings" }); + GetNotificationConfigRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; /** - * Calls UpdateOrganizationSettings. - * @function updateOrganizationSettings - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1.IUpdateOrganizationSettingsRequest} request UpdateOrganizationSettingsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Encodes the specified GetNotificationConfigRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.GetNotificationConfigRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.GetNotificationConfigRequest + * @static + * @param {google.cloud.securitycenter.v1.IGetNotificationConfigRequest} message GetNotificationConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ + GetNotificationConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#updateSource}. - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @typedef UpdateSourceCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.securitycenter.v1.Source} [response] Source + * Decodes a GetNotificationConfigRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.GetNotificationConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.GetNotificationConfigRequest} GetNotificationConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ + GetNotificationConfigRequest.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.cloud.securitycenter.v1.GetNotificationConfigRequest(); + 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; + }; /** - * Calls UpdateSource. - * @function updateSource - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1.IUpdateSourceRequest} request UpdateSourceRequest message or plain object - * @param {google.cloud.securitycenter.v1.SecurityCenter.UpdateSourceCallback} callback Node-style callback called with the error, if any, and Source - * @returns {undefined} - * @variation 1 + * Decodes a GetNotificationConfigRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.GetNotificationConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.GetNotificationConfigRequest} GetNotificationConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Object.defineProperty(SecurityCenter.prototype.updateSource = function updateSource(request, callback) { - return this.rpcCall(updateSource, $root.google.cloud.securitycenter.v1.UpdateSourceRequest, $root.google.cloud.securitycenter.v1.Source, request, callback); - }, "name", { value: "UpdateSource" }); + GetNotificationConfigRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; /** - * Calls UpdateSource. - * @function updateSource - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1.IUpdateSourceRequest} request UpdateSourceRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Verifies a GetNotificationConfigRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1.GetNotificationConfigRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not */ + GetNotificationConfigRequest.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; + }; /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#updateSecurityMarks}. - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @typedef UpdateSecurityMarksCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.securitycenter.v1.SecurityMarks} [response] SecurityMarks + * Creates a GetNotificationConfigRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.GetNotificationConfigRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.GetNotificationConfigRequest} GetNotificationConfigRequest */ + GetNotificationConfigRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.GetNotificationConfigRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1.GetNotificationConfigRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; /** - * Calls UpdateSecurityMarks. - * @function updateSecurityMarks - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1.IUpdateSecurityMarksRequest} request UpdateSecurityMarksRequest message or plain object - * @param {google.cloud.securitycenter.v1.SecurityCenter.UpdateSecurityMarksCallback} callback Node-style callback called with the error, if any, and SecurityMarks - * @returns {undefined} - * @variation 1 + * Creates a plain object from a GetNotificationConfigRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.GetNotificationConfigRequest + * @static + * @param {google.cloud.securitycenter.v1.GetNotificationConfigRequest} message GetNotificationConfigRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object */ - Object.defineProperty(SecurityCenter.prototype.updateSecurityMarks = function updateSecurityMarks(request, callback) { - return this.rpcCall(updateSecurityMarks, $root.google.cloud.securitycenter.v1.UpdateSecurityMarksRequest, $root.google.cloud.securitycenter.v1.SecurityMarks, request, callback); - }, "name", { value: "UpdateSecurityMarks" }); + GetNotificationConfigRequest.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; + }; /** - * Calls UpdateSecurityMarks. - * @function updateSecurityMarks - * @memberof google.cloud.securitycenter.v1.SecurityCenter + * Converts this GetNotificationConfigRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.GetNotificationConfigRequest * @instance - * @param {google.cloud.securitycenter.v1.IUpdateSecurityMarksRequest} request UpdateSecurityMarksRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * @returns {Object.} JSON object */ + GetNotificationConfigRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - return SecurityCenter; + return GetNotificationConfigRequest; })(); - v1.CreateFindingRequest = (function() { + v1.GetOrganizationSettingsRequest = (function() { /** - * Properties of a CreateFindingRequest. + * Properties of a GetOrganizationSettingsRequest. * @memberof google.cloud.securitycenter.v1 - * @interface ICreateFindingRequest - * @property {string|null} [parent] CreateFindingRequest parent - * @property {string|null} [findingId] CreateFindingRequest findingId - * @property {google.cloud.securitycenter.v1.IFinding|null} [finding] CreateFindingRequest finding + * @interface IGetOrganizationSettingsRequest + * @property {string|null} [name] GetOrganizationSettingsRequest name */ /** - * Constructs a new CreateFindingRequest. + * Constructs a new GetOrganizationSettingsRequest. * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents a CreateFindingRequest. - * @implements ICreateFindingRequest + * @classdesc Represents a GetOrganizationSettingsRequest. + * @implements IGetOrganizationSettingsRequest * @constructor - * @param {google.cloud.securitycenter.v1.ICreateFindingRequest=} [properties] Properties to set + * @param {google.cloud.securitycenter.v1.IGetOrganizationSettingsRequest=} [properties] Properties to set */ - function CreateFindingRequest(properties) { + function GetOrganizationSettingsRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -3090,101 +5038,75 @@ } /** - * CreateFindingRequest parent. - * @member {string} parent - * @memberof google.cloud.securitycenter.v1.CreateFindingRequest - * @instance - */ - CreateFindingRequest.prototype.parent = ""; - - /** - * CreateFindingRequest findingId. - * @member {string} findingId - * @memberof google.cloud.securitycenter.v1.CreateFindingRequest - * @instance - */ - CreateFindingRequest.prototype.findingId = ""; - - /** - * CreateFindingRequest finding. - * @member {google.cloud.securitycenter.v1.IFinding|null|undefined} finding - * @memberof google.cloud.securitycenter.v1.CreateFindingRequest + * GetOrganizationSettingsRequest name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1.GetOrganizationSettingsRequest * @instance */ - CreateFindingRequest.prototype.finding = null; + GetOrganizationSettingsRequest.prototype.name = ""; /** - * Creates a new CreateFindingRequest instance using the specified properties. + * Creates a new GetOrganizationSettingsRequest instance using the specified properties. * @function create - * @memberof google.cloud.securitycenter.v1.CreateFindingRequest + * @memberof google.cloud.securitycenter.v1.GetOrganizationSettingsRequest * @static - * @param {google.cloud.securitycenter.v1.ICreateFindingRequest=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.CreateFindingRequest} CreateFindingRequest instance + * @param {google.cloud.securitycenter.v1.IGetOrganizationSettingsRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.GetOrganizationSettingsRequest} GetOrganizationSettingsRequest instance */ - CreateFindingRequest.create = function create(properties) { - return new CreateFindingRequest(properties); + GetOrganizationSettingsRequest.create = function create(properties) { + return new GetOrganizationSettingsRequest(properties); }; /** - * Encodes the specified CreateFindingRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.CreateFindingRequest.verify|verify} messages. + * Encodes the specified GetOrganizationSettingsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.GetOrganizationSettingsRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.securitycenter.v1.CreateFindingRequest + * @memberof google.cloud.securitycenter.v1.GetOrganizationSettingsRequest * @static - * @param {google.cloud.securitycenter.v1.ICreateFindingRequest} message CreateFindingRequest message or plain object to encode + * @param {google.cloud.securitycenter.v1.IGetOrganizationSettingsRequest} message GetOrganizationSettingsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateFindingRequest.encode = function encode(message, writer) { + GetOrganizationSettingsRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && message.hasOwnProperty("parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.findingId != null && message.hasOwnProperty("findingId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.findingId); - if (message.finding != null && message.hasOwnProperty("finding")) - $root.google.cloud.securitycenter.v1.Finding.encode(message.finding, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; /** - * Encodes the specified CreateFindingRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.CreateFindingRequest.verify|verify} messages. + * Encodes the specified GetOrganizationSettingsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.GetOrganizationSettingsRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.CreateFindingRequest + * @memberof google.cloud.securitycenter.v1.GetOrganizationSettingsRequest * @static - * @param {google.cloud.securitycenter.v1.ICreateFindingRequest} message CreateFindingRequest message or plain object to encode + * @param {google.cloud.securitycenter.v1.IGetOrganizationSettingsRequest} message GetOrganizationSettingsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateFindingRequest.encodeDelimited = function encodeDelimited(message, writer) { + GetOrganizationSettingsRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a CreateFindingRequest message from the specified reader or buffer. + * Decodes a GetOrganizationSettingsRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.securitycenter.v1.CreateFindingRequest + * @memberof google.cloud.securitycenter.v1.GetOrganizationSettingsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.CreateFindingRequest} CreateFindingRequest + * @returns {google.cloud.securitycenter.v1.GetOrganizationSettingsRequest} GetOrganizationSettingsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateFindingRequest.decode = function decode(reader, length) { + GetOrganizationSettingsRequest.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.cloud.securitycenter.v1.CreateFindingRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.GetOrganizationSettingsRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.parent = reader.string(); - break; - case 2: - message.findingId = reader.string(); - break; - case 3: - message.finding = $root.google.cloud.securitycenter.v1.Finding.decode(reader, reader.uint32()); + message.name = reader.string(); break; default: reader.skipType(tag & 7); @@ -3195,130 +5117,107 @@ }; /** - * Decodes a CreateFindingRequest message from the specified reader or buffer, length delimited. + * Decodes a GetOrganizationSettingsRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.CreateFindingRequest + * @memberof google.cloud.securitycenter.v1.GetOrganizationSettingsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.CreateFindingRequest} CreateFindingRequest + * @returns {google.cloud.securitycenter.v1.GetOrganizationSettingsRequest} GetOrganizationSettingsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateFindingRequest.decodeDelimited = function decodeDelimited(reader) { + GetOrganizationSettingsRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a CreateFindingRequest message. + * Verifies a GetOrganizationSettingsRequest message. * @function verify - * @memberof google.cloud.securitycenter.v1.CreateFindingRequest + * @memberof google.cloud.securitycenter.v1.GetOrganizationSettingsRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - CreateFindingRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.findingId != null && message.hasOwnProperty("findingId")) - if (!$util.isString(message.findingId)) - return "findingId: string expected"; - if (message.finding != null && message.hasOwnProperty("finding")) { - var error = $root.google.cloud.securitycenter.v1.Finding.verify(message.finding); - if (error) - return "finding." + error; - } + GetOrganizationSettingsRequest.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 CreateFindingRequest message from a plain object. Also converts values to their respective internal types. + * Creates a GetOrganizationSettingsRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.securitycenter.v1.CreateFindingRequest + * @memberof google.cloud.securitycenter.v1.GetOrganizationSettingsRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.CreateFindingRequest} CreateFindingRequest + * @returns {google.cloud.securitycenter.v1.GetOrganizationSettingsRequest} GetOrganizationSettingsRequest */ - CreateFindingRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.CreateFindingRequest) + GetOrganizationSettingsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.GetOrganizationSettingsRequest) return object; - var message = new $root.google.cloud.securitycenter.v1.CreateFindingRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.findingId != null) - message.findingId = String(object.findingId); - if (object.finding != null) { - if (typeof object.finding !== "object") - throw TypeError(".google.cloud.securitycenter.v1.CreateFindingRequest.finding: object expected"); - message.finding = $root.google.cloud.securitycenter.v1.Finding.fromObject(object.finding); - } + var message = new $root.google.cloud.securitycenter.v1.GetOrganizationSettingsRequest(); + if (object.name != null) + message.name = String(object.name); return message; }; /** - * Creates a plain object from a CreateFindingRequest message. Also converts values to other types if specified. + * Creates a plain object from a GetOrganizationSettingsRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.securitycenter.v1.CreateFindingRequest + * @memberof google.cloud.securitycenter.v1.GetOrganizationSettingsRequest * @static - * @param {google.cloud.securitycenter.v1.CreateFindingRequest} message CreateFindingRequest + * @param {google.cloud.securitycenter.v1.GetOrganizationSettingsRequest} message GetOrganizationSettingsRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CreateFindingRequest.toObject = function toObject(message, options) { + GetOrganizationSettingsRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.parent = ""; - object.findingId = ""; - object.finding = null; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.findingId != null && message.hasOwnProperty("findingId")) - object.findingId = message.findingId; - if (message.finding != null && message.hasOwnProperty("finding")) - object.finding = $root.google.cloud.securitycenter.v1.Finding.toObject(message.finding, options); + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; return object; }; /** - * Converts this CreateFindingRequest to JSON. + * Converts this GetOrganizationSettingsRequest to JSON. * @function toJSON - * @memberof google.cloud.securitycenter.v1.CreateFindingRequest + * @memberof google.cloud.securitycenter.v1.GetOrganizationSettingsRequest * @instance * @returns {Object.} JSON object */ - CreateFindingRequest.prototype.toJSON = function toJSON() { + GetOrganizationSettingsRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return CreateFindingRequest; + return GetOrganizationSettingsRequest; })(); - v1.CreateSourceRequest = (function() { + v1.GetSourceRequest = (function() { /** - * Properties of a CreateSourceRequest. + * Properties of a GetSourceRequest. * @memberof google.cloud.securitycenter.v1 - * @interface ICreateSourceRequest - * @property {string|null} [parent] CreateSourceRequest parent - * @property {google.cloud.securitycenter.v1.ISource|null} [source] CreateSourceRequest source + * @interface IGetSourceRequest + * @property {string|null} [name] GetSourceRequest name */ /** - * Constructs a new CreateSourceRequest. + * Constructs a new GetSourceRequest. * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents a CreateSourceRequest. - * @implements ICreateSourceRequest + * @classdesc Represents a GetSourceRequest. + * @implements IGetSourceRequest * @constructor - * @param {google.cloud.securitycenter.v1.ICreateSourceRequest=} [properties] Properties to set + * @param {google.cloud.securitycenter.v1.IGetSourceRequest=} [properties] Properties to set */ - function CreateSourceRequest(properties) { + function GetSourceRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -3326,88 +5225,75 @@ } /** - * CreateSourceRequest parent. - * @member {string} parent - * @memberof google.cloud.securitycenter.v1.CreateSourceRequest - * @instance - */ - CreateSourceRequest.prototype.parent = ""; - - /** - * CreateSourceRequest source. - * @member {google.cloud.securitycenter.v1.ISource|null|undefined} source - * @memberof google.cloud.securitycenter.v1.CreateSourceRequest + * GetSourceRequest name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1.GetSourceRequest * @instance */ - CreateSourceRequest.prototype.source = null; + GetSourceRequest.prototype.name = ""; /** - * Creates a new CreateSourceRequest instance using the specified properties. + * Creates a new GetSourceRequest instance using the specified properties. * @function create - * @memberof google.cloud.securitycenter.v1.CreateSourceRequest + * @memberof google.cloud.securitycenter.v1.GetSourceRequest * @static - * @param {google.cloud.securitycenter.v1.ICreateSourceRequest=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.CreateSourceRequest} CreateSourceRequest instance + * @param {google.cloud.securitycenter.v1.IGetSourceRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.GetSourceRequest} GetSourceRequest instance */ - CreateSourceRequest.create = function create(properties) { - return new CreateSourceRequest(properties); + GetSourceRequest.create = function create(properties) { + return new GetSourceRequest(properties); }; /** - * Encodes the specified CreateSourceRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.CreateSourceRequest.verify|verify} messages. + * Encodes the specified GetSourceRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.GetSourceRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.securitycenter.v1.CreateSourceRequest + * @memberof google.cloud.securitycenter.v1.GetSourceRequest * @static - * @param {google.cloud.securitycenter.v1.ICreateSourceRequest} message CreateSourceRequest message or plain object to encode + * @param {google.cloud.securitycenter.v1.IGetSourceRequest} message GetSourceRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateSourceRequest.encode = function encode(message, writer) { + GetSourceRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && message.hasOwnProperty("parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.source != null && message.hasOwnProperty("source")) - $root.google.cloud.securitycenter.v1.Source.encode(message.source, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; /** - * Encodes the specified CreateSourceRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.CreateSourceRequest.verify|verify} messages. + * Encodes the specified GetSourceRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.GetSourceRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.CreateSourceRequest + * @memberof google.cloud.securitycenter.v1.GetSourceRequest * @static - * @param {google.cloud.securitycenter.v1.ICreateSourceRequest} message CreateSourceRequest message or plain object to encode + * @param {google.cloud.securitycenter.v1.IGetSourceRequest} message GetSourceRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateSourceRequest.encodeDelimited = function encodeDelimited(message, writer) { + GetSourceRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a CreateSourceRequest message from the specified reader or buffer. + * Decodes a GetSourceRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.securitycenter.v1.CreateSourceRequest + * @memberof google.cloud.securitycenter.v1.GetSourceRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.CreateSourceRequest} CreateSourceRequest + * @returns {google.cloud.securitycenter.v1.GetSourceRequest} GetSourceRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateSourceRequest.decode = function decode(reader, length) { + GetSourceRequest.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.cloud.securitycenter.v1.CreateSourceRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.GetSourceRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.parent = reader.string(); - break; - case 2: - message.source = $root.google.cloud.securitycenter.v1.Source.decode(reader, reader.uint32()); + message.name = reader.string(); break; default: reader.skipType(tag & 7); @@ -3418,197 +5304,267 @@ }; /** - * Decodes a CreateSourceRequest message from the specified reader or buffer, length delimited. + * Decodes a GetSourceRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.CreateSourceRequest + * @memberof google.cloud.securitycenter.v1.GetSourceRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.CreateSourceRequest} CreateSourceRequest + * @returns {google.cloud.securitycenter.v1.GetSourceRequest} GetSourceRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateSourceRequest.decodeDelimited = function decodeDelimited(reader) { + GetSourceRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a CreateSourceRequest message. + * Verifies a GetSourceRequest message. * @function verify - * @memberof google.cloud.securitycenter.v1.CreateSourceRequest + * @memberof google.cloud.securitycenter.v1.GetSourceRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - CreateSourceRequest.verify = function verify(message) { + GetSourceRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.source != null && message.hasOwnProperty("source")) { - var error = $root.google.cloud.securitycenter.v1.Source.verify(message.source); - if (error) - return "source." + error; - } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; return null; }; /** - * Creates a CreateSourceRequest message from a plain object. Also converts values to their respective internal types. + * Creates a GetSourceRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.securitycenter.v1.CreateSourceRequest + * @memberof google.cloud.securitycenter.v1.GetSourceRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.CreateSourceRequest} CreateSourceRequest + * @returns {google.cloud.securitycenter.v1.GetSourceRequest} GetSourceRequest */ - CreateSourceRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.CreateSourceRequest) + GetSourceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.GetSourceRequest) return object; - var message = new $root.google.cloud.securitycenter.v1.CreateSourceRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.source != null) { - if (typeof object.source !== "object") - throw TypeError(".google.cloud.securitycenter.v1.CreateSourceRequest.source: object expected"); - message.source = $root.google.cloud.securitycenter.v1.Source.fromObject(object.source); - } + var message = new $root.google.cloud.securitycenter.v1.GetSourceRequest(); + if (object.name != null) + message.name = String(object.name); return message; }; /** - * Creates a plain object from a CreateSourceRequest message. Also converts values to other types if specified. + * Creates a plain object from a GetSourceRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.securitycenter.v1.CreateSourceRequest + * @memberof google.cloud.securitycenter.v1.GetSourceRequest * @static - * @param {google.cloud.securitycenter.v1.CreateSourceRequest} message CreateSourceRequest + * @param {google.cloud.securitycenter.v1.GetSourceRequest} message GetSourceRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CreateSourceRequest.toObject = function toObject(message, options) { + GetSourceRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.parent = ""; - object.source = null; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.source != null && message.hasOwnProperty("source")) - object.source = $root.google.cloud.securitycenter.v1.Source.toObject(message.source, options); + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; return object; }; /** - * Converts this CreateSourceRequest to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1.CreateSourceRequest + * Converts this GetSourceRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.GetSourceRequest + * @instance + * @returns {Object.} JSON object + */ + GetSourceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetSourceRequest; + })(); + + v1.GroupAssetsRequest = (function() { + + /** + * Properties of a GroupAssetsRequest. + * @memberof google.cloud.securitycenter.v1 + * @interface IGroupAssetsRequest + * @property {string|null} [parent] GroupAssetsRequest parent + * @property {string|null} [filter] GroupAssetsRequest filter + * @property {string|null} [groupBy] GroupAssetsRequest groupBy + * @property {google.protobuf.IDuration|null} [compareDuration] GroupAssetsRequest compareDuration + * @property {google.protobuf.ITimestamp|null} [readTime] GroupAssetsRequest readTime + * @property {string|null} [pageToken] GroupAssetsRequest pageToken + * @property {number|null} [pageSize] GroupAssetsRequest pageSize + */ + + /** + * Constructs a new GroupAssetsRequest. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a GroupAssetsRequest. + * @implements IGroupAssetsRequest + * @constructor + * @param {google.cloud.securitycenter.v1.IGroupAssetsRequest=} [properties] Properties to set + */ + function GroupAssetsRequest(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]]; + } + + /** + * GroupAssetsRequest parent. + * @member {string} parent + * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest + * @instance + */ + GroupAssetsRequest.prototype.parent = ""; + + /** + * GroupAssetsRequest filter. + * @member {string} filter + * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest * @instance - * @returns {Object.} JSON object */ - CreateSourceRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + GroupAssetsRequest.prototype.filter = ""; - return CreateSourceRequest; - })(); + /** + * GroupAssetsRequest groupBy. + * @member {string} groupBy + * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest + * @instance + */ + GroupAssetsRequest.prototype.groupBy = ""; - v1.GetOrganizationSettingsRequest = (function() { + /** + * GroupAssetsRequest compareDuration. + * @member {google.protobuf.IDuration|null|undefined} compareDuration + * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest + * @instance + */ + GroupAssetsRequest.prototype.compareDuration = null; /** - * Properties of a GetOrganizationSettingsRequest. - * @memberof google.cloud.securitycenter.v1 - * @interface IGetOrganizationSettingsRequest - * @property {string|null} [name] GetOrganizationSettingsRequest name + * GroupAssetsRequest readTime. + * @member {google.protobuf.ITimestamp|null|undefined} readTime + * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest + * @instance */ + GroupAssetsRequest.prototype.readTime = null; /** - * Constructs a new GetOrganizationSettingsRequest. - * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents a GetOrganizationSettingsRequest. - * @implements IGetOrganizationSettingsRequest - * @constructor - * @param {google.cloud.securitycenter.v1.IGetOrganizationSettingsRequest=} [properties] Properties to set + * GroupAssetsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest + * @instance */ - function GetOrganizationSettingsRequest(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]]; - } + GroupAssetsRequest.prototype.pageToken = ""; /** - * GetOrganizationSettingsRequest name. - * @member {string} name - * @memberof google.cloud.securitycenter.v1.GetOrganizationSettingsRequest + * GroupAssetsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest * @instance */ - GetOrganizationSettingsRequest.prototype.name = ""; + GroupAssetsRequest.prototype.pageSize = 0; /** - * Creates a new GetOrganizationSettingsRequest instance using the specified properties. + * Creates a new GroupAssetsRequest instance using the specified properties. * @function create - * @memberof google.cloud.securitycenter.v1.GetOrganizationSettingsRequest + * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest * @static - * @param {google.cloud.securitycenter.v1.IGetOrganizationSettingsRequest=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.GetOrganizationSettingsRequest} GetOrganizationSettingsRequest instance + * @param {google.cloud.securitycenter.v1.IGroupAssetsRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.GroupAssetsRequest} GroupAssetsRequest instance */ - GetOrganizationSettingsRequest.create = function create(properties) { - return new GetOrganizationSettingsRequest(properties); + GroupAssetsRequest.create = function create(properties) { + return new GroupAssetsRequest(properties); }; /** - * Encodes the specified GetOrganizationSettingsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.GetOrganizationSettingsRequest.verify|verify} messages. + * Encodes the specified GroupAssetsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.GroupAssetsRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.securitycenter.v1.GetOrganizationSettingsRequest + * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest * @static - * @param {google.cloud.securitycenter.v1.IGetOrganizationSettingsRequest} message GetOrganizationSettingsRequest message or plain object to encode + * @param {google.cloud.securitycenter.v1.IGroupAssetsRequest} message GroupAssetsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetOrganizationSettingsRequest.encode = function encode(message, writer) { + GroupAssetsRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.parent != null && message.hasOwnProperty("parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.filter != null && message.hasOwnProperty("filter")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); + if (message.groupBy != null && message.hasOwnProperty("groupBy")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.groupBy); + if (message.compareDuration != null && message.hasOwnProperty("compareDuration")) + $root.google.protobuf.Duration.encode(message.compareDuration, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.readTime != null && message.hasOwnProperty("readTime")) + $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.pageToken); + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.pageSize); return writer; }; /** - * Encodes the specified GetOrganizationSettingsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.GetOrganizationSettingsRequest.verify|verify} messages. + * Encodes the specified GroupAssetsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.GroupAssetsRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.GetOrganizationSettingsRequest + * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest * @static - * @param {google.cloud.securitycenter.v1.IGetOrganizationSettingsRequest} message GetOrganizationSettingsRequest message or plain object to encode + * @param {google.cloud.securitycenter.v1.IGroupAssetsRequest} message GroupAssetsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetOrganizationSettingsRequest.encodeDelimited = function encodeDelimited(message, writer) { + GroupAssetsRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GetOrganizationSettingsRequest message from the specified reader or buffer. + * Decodes a GroupAssetsRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.securitycenter.v1.GetOrganizationSettingsRequest + * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.GetOrganizationSettingsRequest} GetOrganizationSettingsRequest + * @returns {google.cloud.securitycenter.v1.GroupAssetsRequest} GroupAssetsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetOrganizationSettingsRequest.decode = function decode(reader, length) { + GroupAssetsRequest.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.cloud.securitycenter.v1.GetOrganizationSettingsRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.GroupAssetsRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.name = reader.string(); + message.parent = reader.string(); + break; + case 2: + message.filter = reader.string(); + break; + case 3: + message.groupBy = reader.string(); + break; + case 4: + message.compareDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + case 5: + message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 7: + message.pageToken = reader.string(); + break; + case 8: + message.pageSize = reader.int32(); break; default: reader.skipType(tag & 7); @@ -3619,107 +5575,170 @@ }; /** - * Decodes a GetOrganizationSettingsRequest message from the specified reader or buffer, length delimited. + * Decodes a GroupAssetsRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.GetOrganizationSettingsRequest + * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.GetOrganizationSettingsRequest} GetOrganizationSettingsRequest + * @returns {google.cloud.securitycenter.v1.GroupAssetsRequest} GroupAssetsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetOrganizationSettingsRequest.decodeDelimited = function decodeDelimited(reader) { + GroupAssetsRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GetOrganizationSettingsRequest message. + * Verifies a GroupAssetsRequest message. * @function verify - * @memberof google.cloud.securitycenter.v1.GetOrganizationSettingsRequest + * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GetOrganizationSettingsRequest.verify = function verify(message) { + GroupAssetsRequest.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.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.groupBy != null && message.hasOwnProperty("groupBy")) + if (!$util.isString(message.groupBy)) + return "groupBy: string expected"; + if (message.compareDuration != null && message.hasOwnProperty("compareDuration")) { + var error = $root.google.protobuf.Duration.verify(message.compareDuration); + if (error) + return "compareDuration." + error; + } + if (message.readTime != null && message.hasOwnProperty("readTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.readTime); + if (error) + return "readTime." + error; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; return null; }; /** - * Creates a GetOrganizationSettingsRequest message from a plain object. Also converts values to their respective internal types. + * Creates a GroupAssetsRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.securitycenter.v1.GetOrganizationSettingsRequest + * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.GetOrganizationSettingsRequest} GetOrganizationSettingsRequest + * @returns {google.cloud.securitycenter.v1.GroupAssetsRequest} GroupAssetsRequest */ - GetOrganizationSettingsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.GetOrganizationSettingsRequest) + GroupAssetsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.GroupAssetsRequest) return object; - var message = new $root.google.cloud.securitycenter.v1.GetOrganizationSettingsRequest(); - if (object.name != null) - message.name = String(object.name); + var message = new $root.google.cloud.securitycenter.v1.GroupAssetsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.filter != null) + message.filter = String(object.filter); + if (object.groupBy != null) + message.groupBy = String(object.groupBy); + if (object.compareDuration != null) { + if (typeof object.compareDuration !== "object") + throw TypeError(".google.cloud.securitycenter.v1.GroupAssetsRequest.compareDuration: object expected"); + message.compareDuration = $root.google.protobuf.Duration.fromObject(object.compareDuration); + } + if (object.readTime != null) { + if (typeof object.readTime !== "object") + throw TypeError(".google.cloud.securitycenter.v1.GroupAssetsRequest.readTime: object expected"); + message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); + } + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; return message; }; /** - * Creates a plain object from a GetOrganizationSettingsRequest message. Also converts values to other types if specified. + * Creates a plain object from a GroupAssetsRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.securitycenter.v1.GetOrganizationSettingsRequest + * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest * @static - * @param {google.cloud.securitycenter.v1.GetOrganizationSettingsRequest} message GetOrganizationSettingsRequest + * @param {google.cloud.securitycenter.v1.GroupAssetsRequest} message GroupAssetsRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GetOrganizationSettingsRequest.toObject = function toObject(message, options) { + GroupAssetsRequest.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 (options.defaults) { + object.parent = ""; + object.filter = ""; + object.groupBy = ""; + object.compareDuration = null; + object.readTime = null; + object.pageToken = ""; + object.pageSize = 0; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.groupBy != null && message.hasOwnProperty("groupBy")) + object.groupBy = message.groupBy; + if (message.compareDuration != null && message.hasOwnProperty("compareDuration")) + object.compareDuration = $root.google.protobuf.Duration.toObject(message.compareDuration, options); + if (message.readTime != null && message.hasOwnProperty("readTime")) + object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; return object; }; /** - * Converts this GetOrganizationSettingsRequest to JSON. + * Converts this GroupAssetsRequest to JSON. * @function toJSON - * @memberof google.cloud.securitycenter.v1.GetOrganizationSettingsRequest + * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest * @instance * @returns {Object.} JSON object */ - GetOrganizationSettingsRequest.prototype.toJSON = function toJSON() { + GroupAssetsRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return GetOrganizationSettingsRequest; + return GroupAssetsRequest; })(); - v1.GetSourceRequest = (function() { + v1.GroupAssetsResponse = (function() { /** - * Properties of a GetSourceRequest. + * Properties of a GroupAssetsResponse. * @memberof google.cloud.securitycenter.v1 - * @interface IGetSourceRequest - * @property {string|null} [name] GetSourceRequest name + * @interface IGroupAssetsResponse + * @property {Array.|null} [groupByResults] GroupAssetsResponse groupByResults + * @property {google.protobuf.ITimestamp|null} [readTime] GroupAssetsResponse readTime + * @property {string|null} [nextPageToken] GroupAssetsResponse nextPageToken + * @property {number|null} [totalSize] GroupAssetsResponse totalSize */ /** - * Constructs a new GetSourceRequest. + * Constructs a new GroupAssetsResponse. * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents a GetSourceRequest. - * @implements IGetSourceRequest + * @classdesc Represents a GroupAssetsResponse. + * @implements IGroupAssetsResponse * @constructor - * @param {google.cloud.securitycenter.v1.IGetSourceRequest=} [properties] Properties to set + * @param {google.cloud.securitycenter.v1.IGroupAssetsResponse=} [properties] Properties to set */ - function GetSourceRequest(properties) { + function GroupAssetsResponse(properties) { + this.groupByResults = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -3727,75 +5746,117 @@ } /** - * GetSourceRequest name. - * @member {string} name - * @memberof google.cloud.securitycenter.v1.GetSourceRequest + * GroupAssetsResponse groupByResults. + * @member {Array.} groupByResults + * @memberof google.cloud.securitycenter.v1.GroupAssetsResponse * @instance */ - GetSourceRequest.prototype.name = ""; + GroupAssetsResponse.prototype.groupByResults = $util.emptyArray; /** - * Creates a new GetSourceRequest instance using the specified properties. + * GroupAssetsResponse readTime. + * @member {google.protobuf.ITimestamp|null|undefined} readTime + * @memberof google.cloud.securitycenter.v1.GroupAssetsResponse + * @instance + */ + GroupAssetsResponse.prototype.readTime = null; + + /** + * GroupAssetsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.securitycenter.v1.GroupAssetsResponse + * @instance + */ + GroupAssetsResponse.prototype.nextPageToken = ""; + + /** + * GroupAssetsResponse totalSize. + * @member {number} totalSize + * @memberof google.cloud.securitycenter.v1.GroupAssetsResponse + * @instance + */ + GroupAssetsResponse.prototype.totalSize = 0; + + /** + * Creates a new GroupAssetsResponse instance using the specified properties. * @function create - * @memberof google.cloud.securitycenter.v1.GetSourceRequest + * @memberof google.cloud.securitycenter.v1.GroupAssetsResponse * @static - * @param {google.cloud.securitycenter.v1.IGetSourceRequest=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.GetSourceRequest} GetSourceRequest instance + * @param {google.cloud.securitycenter.v1.IGroupAssetsResponse=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.GroupAssetsResponse} GroupAssetsResponse instance */ - GetSourceRequest.create = function create(properties) { - return new GetSourceRequest(properties); + GroupAssetsResponse.create = function create(properties) { + return new GroupAssetsResponse(properties); }; /** - * Encodes the specified GetSourceRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.GetSourceRequest.verify|verify} messages. + * Encodes the specified GroupAssetsResponse message. Does not implicitly {@link google.cloud.securitycenter.v1.GroupAssetsResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.securitycenter.v1.GetSourceRequest + * @memberof google.cloud.securitycenter.v1.GroupAssetsResponse * @static - * @param {google.cloud.securitycenter.v1.IGetSourceRequest} message GetSourceRequest message or plain object to encode + * @param {google.cloud.securitycenter.v1.IGroupAssetsResponse} message GroupAssetsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetSourceRequest.encode = function encode(message, writer) { + GroupAssetsResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.groupByResults != null && message.groupByResults.length) + for (var i = 0; i < message.groupByResults.length; ++i) + $root.google.cloud.securitycenter.v1.GroupResult.encode(message.groupByResults[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.readTime != null && message.hasOwnProperty("readTime")) + $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.nextPageToken); + if (message.totalSize != null && message.hasOwnProperty("totalSize")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.totalSize); return writer; }; /** - * Encodes the specified GetSourceRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.GetSourceRequest.verify|verify} messages. + * Encodes the specified GroupAssetsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.GroupAssetsResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.GetSourceRequest + * @memberof google.cloud.securitycenter.v1.GroupAssetsResponse * @static - * @param {google.cloud.securitycenter.v1.IGetSourceRequest} message GetSourceRequest message or plain object to encode + * @param {google.cloud.securitycenter.v1.IGroupAssetsResponse} message GroupAssetsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetSourceRequest.encodeDelimited = function encodeDelimited(message, writer) { + GroupAssetsResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GetSourceRequest message from the specified reader or buffer. + * Decodes a GroupAssetsResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.securitycenter.v1.GetSourceRequest + * @memberof google.cloud.securitycenter.v1.GroupAssetsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.GetSourceRequest} GetSourceRequest + * @returns {google.cloud.securitycenter.v1.GroupAssetsResponse} GroupAssetsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetSourceRequest.decode = function decode(reader, length) { + GroupAssetsResponse.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.cloud.securitycenter.v1.GetSourceRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.GroupAssetsResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.name = reader.string(); + if (!(message.groupByResults && message.groupByResults.length)) + message.groupByResults = []; + message.groupByResults.push($root.google.cloud.securitycenter.v1.GroupResult.decode(reader, reader.uint32())); + break; + case 2: + message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 3: + message.nextPageToken = reader.string(); + break; + case 4: + message.totalSize = reader.int32(); break; default: reader.skipType(tag & 7); @@ -3806,113 +5867,161 @@ }; /** - * Decodes a GetSourceRequest message from the specified reader or buffer, length delimited. + * Decodes a GroupAssetsResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.GetSourceRequest + * @memberof google.cloud.securitycenter.v1.GroupAssetsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.GetSourceRequest} GetSourceRequest + * @returns {google.cloud.securitycenter.v1.GroupAssetsResponse} GroupAssetsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetSourceRequest.decodeDelimited = function decodeDelimited(reader) { + GroupAssetsResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GetSourceRequest message. + * Verifies a GroupAssetsResponse message. * @function verify - * @memberof google.cloud.securitycenter.v1.GetSourceRequest + * @memberof google.cloud.securitycenter.v1.GroupAssetsResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GetSourceRequest.verify = function verify(message) { + GroupAssetsResponse.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.groupByResults != null && message.hasOwnProperty("groupByResults")) { + if (!Array.isArray(message.groupByResults)) + return "groupByResults: array expected"; + for (var i = 0; i < message.groupByResults.length; ++i) { + var error = $root.google.cloud.securitycenter.v1.GroupResult.verify(message.groupByResults[i]); + if (error) + return "groupByResults." + error; + } + } + if (message.readTime != null && message.hasOwnProperty("readTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.readTime); + if (error) + return "readTime." + error; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.totalSize != null && message.hasOwnProperty("totalSize")) + if (!$util.isInteger(message.totalSize)) + return "totalSize: integer expected"; return null; }; /** - * Creates a GetSourceRequest message from a plain object. Also converts values to their respective internal types. + * Creates a GroupAssetsResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.securitycenter.v1.GetSourceRequest + * @memberof google.cloud.securitycenter.v1.GroupAssetsResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.GetSourceRequest} GetSourceRequest + * @returns {google.cloud.securitycenter.v1.GroupAssetsResponse} GroupAssetsResponse */ - GetSourceRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.GetSourceRequest) + GroupAssetsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.GroupAssetsResponse) return object; - var message = new $root.google.cloud.securitycenter.v1.GetSourceRequest(); - if (object.name != null) - message.name = String(object.name); + var message = new $root.google.cloud.securitycenter.v1.GroupAssetsResponse(); + if (object.groupByResults) { + if (!Array.isArray(object.groupByResults)) + throw TypeError(".google.cloud.securitycenter.v1.GroupAssetsResponse.groupByResults: array expected"); + message.groupByResults = []; + for (var i = 0; i < object.groupByResults.length; ++i) { + if (typeof object.groupByResults[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v1.GroupAssetsResponse.groupByResults: object expected"); + message.groupByResults[i] = $root.google.cloud.securitycenter.v1.GroupResult.fromObject(object.groupByResults[i]); + } + } + if (object.readTime != null) { + if (typeof object.readTime !== "object") + throw TypeError(".google.cloud.securitycenter.v1.GroupAssetsResponse.readTime: object expected"); + message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.totalSize != null) + message.totalSize = object.totalSize | 0; return message; }; /** - * Creates a plain object from a GetSourceRequest message. Also converts values to other types if specified. + * Creates a plain object from a GroupAssetsResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.securitycenter.v1.GetSourceRequest + * @memberof google.cloud.securitycenter.v1.GroupAssetsResponse * @static - * @param {google.cloud.securitycenter.v1.GetSourceRequest} message GetSourceRequest + * @param {google.cloud.securitycenter.v1.GroupAssetsResponse} message GroupAssetsResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GetSourceRequest.toObject = function toObject(message, options) { + GroupAssetsResponse.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 (options.arrays || options.defaults) + object.groupByResults = []; + if (options.defaults) { + object.readTime = null; + object.nextPageToken = ""; + object.totalSize = 0; + } + if (message.groupByResults && message.groupByResults.length) { + object.groupByResults = []; + for (var j = 0; j < message.groupByResults.length; ++j) + object.groupByResults[j] = $root.google.cloud.securitycenter.v1.GroupResult.toObject(message.groupByResults[j], options); + } + if (message.readTime != null && message.hasOwnProperty("readTime")) + object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.totalSize != null && message.hasOwnProperty("totalSize")) + object.totalSize = message.totalSize; return object; }; /** - * Converts this GetSourceRequest to JSON. + * Converts this GroupAssetsResponse to JSON. * @function toJSON - * @memberof google.cloud.securitycenter.v1.GetSourceRequest + * @memberof google.cloud.securitycenter.v1.GroupAssetsResponse * @instance * @returns {Object.} JSON object */ - GetSourceRequest.prototype.toJSON = function toJSON() { + GroupAssetsResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return GetSourceRequest; + return GroupAssetsResponse; })(); - v1.GroupAssetsRequest = (function() { + v1.GroupFindingsRequest = (function() { /** - * Properties of a GroupAssetsRequest. + * Properties of a GroupFindingsRequest. * @memberof google.cloud.securitycenter.v1 - * @interface IGroupAssetsRequest - * @property {string|null} [parent] GroupAssetsRequest parent - * @property {string|null} [filter] GroupAssetsRequest filter - * @property {string|null} [groupBy] GroupAssetsRequest groupBy - * @property {google.protobuf.IDuration|null} [compareDuration] GroupAssetsRequest compareDuration - * @property {google.protobuf.ITimestamp|null} [readTime] GroupAssetsRequest readTime - * @property {string|null} [pageToken] GroupAssetsRequest pageToken - * @property {number|null} [pageSize] GroupAssetsRequest pageSize + * @interface IGroupFindingsRequest + * @property {string|null} [parent] GroupFindingsRequest parent + * @property {string|null} [filter] GroupFindingsRequest filter + * @property {string|null} [groupBy] GroupFindingsRequest groupBy + * @property {google.protobuf.ITimestamp|null} [readTime] GroupFindingsRequest readTime + * @property {google.protobuf.IDuration|null} [compareDuration] GroupFindingsRequest compareDuration + * @property {string|null} [pageToken] GroupFindingsRequest pageToken + * @property {number|null} [pageSize] GroupFindingsRequest pageSize */ /** - * Constructs a new GroupAssetsRequest. + * Constructs a new GroupFindingsRequest. * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents a GroupAssetsRequest. - * @implements IGroupAssetsRequest + * @classdesc Represents a GroupFindingsRequest. + * @implements IGroupFindingsRequest * @constructor - * @param {google.cloud.securitycenter.v1.IGroupAssetsRequest=} [properties] Properties to set + * @param {google.cloud.securitycenter.v1.IGroupFindingsRequest=} [properties] Properties to set */ - function GroupAssetsRequest(properties) { + function GroupFindingsRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -3920,83 +6029,83 @@ } /** - * GroupAssetsRequest parent. + * GroupFindingsRequest parent. * @member {string} parent - * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest + * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest * @instance */ - GroupAssetsRequest.prototype.parent = ""; + GroupFindingsRequest.prototype.parent = ""; /** - * GroupAssetsRequest filter. + * GroupFindingsRequest filter. * @member {string} filter - * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest + * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest * @instance */ - GroupAssetsRequest.prototype.filter = ""; + GroupFindingsRequest.prototype.filter = ""; /** - * GroupAssetsRequest groupBy. + * GroupFindingsRequest groupBy. * @member {string} groupBy - * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest + * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest * @instance */ - GroupAssetsRequest.prototype.groupBy = ""; + GroupFindingsRequest.prototype.groupBy = ""; /** - * GroupAssetsRequest compareDuration. - * @member {google.protobuf.IDuration|null|undefined} compareDuration - * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest + * GroupFindingsRequest readTime. + * @member {google.protobuf.ITimestamp|null|undefined} readTime + * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest * @instance */ - GroupAssetsRequest.prototype.compareDuration = null; + GroupFindingsRequest.prototype.readTime = null; /** - * GroupAssetsRequest readTime. - * @member {google.protobuf.ITimestamp|null|undefined} readTime - * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest + * GroupFindingsRequest compareDuration. + * @member {google.protobuf.IDuration|null|undefined} compareDuration + * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest * @instance */ - GroupAssetsRequest.prototype.readTime = null; + GroupFindingsRequest.prototype.compareDuration = null; /** - * GroupAssetsRequest pageToken. + * GroupFindingsRequest pageToken. * @member {string} pageToken - * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest + * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest * @instance */ - GroupAssetsRequest.prototype.pageToken = ""; + GroupFindingsRequest.prototype.pageToken = ""; /** - * GroupAssetsRequest pageSize. + * GroupFindingsRequest pageSize. * @member {number} pageSize - * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest + * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest * @instance */ - GroupAssetsRequest.prototype.pageSize = 0; + GroupFindingsRequest.prototype.pageSize = 0; /** - * Creates a new GroupAssetsRequest instance using the specified properties. + * Creates a new GroupFindingsRequest instance using the specified properties. * @function create - * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest + * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest * @static - * @param {google.cloud.securitycenter.v1.IGroupAssetsRequest=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.GroupAssetsRequest} GroupAssetsRequest instance + * @param {google.cloud.securitycenter.v1.IGroupFindingsRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.GroupFindingsRequest} GroupFindingsRequest instance */ - GroupAssetsRequest.create = function create(properties) { - return new GroupAssetsRequest(properties); + GroupFindingsRequest.create = function create(properties) { + return new GroupFindingsRequest(properties); }; /** - * Encodes the specified GroupAssetsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.GroupAssetsRequest.verify|verify} messages. + * Encodes the specified GroupFindingsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.GroupFindingsRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest + * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest * @static - * @param {google.cloud.securitycenter.v1.IGroupAssetsRequest} message GroupAssetsRequest message or plain object to encode + * @param {google.cloud.securitycenter.v1.IGroupFindingsRequest} message GroupFindingsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GroupAssetsRequest.encode = function encode(message, writer) { + GroupFindingsRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.parent != null && message.hasOwnProperty("parent")) @@ -4005,10 +6114,10 @@ writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); if (message.groupBy != null && message.hasOwnProperty("groupBy")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.groupBy); - if (message.compareDuration != null && message.hasOwnProperty("compareDuration")) - $root.google.protobuf.Duration.encode(message.compareDuration, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); if (message.readTime != null && message.hasOwnProperty("readTime")) - $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.compareDuration != null && message.hasOwnProperty("compareDuration")) + $root.google.protobuf.Duration.encode(message.compareDuration, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); if (message.pageToken != null && message.hasOwnProperty("pageToken")) writer.uint32(/* id 7, wireType 2 =*/58).string(message.pageToken); if (message.pageSize != null && message.hasOwnProperty("pageSize")) @@ -4017,33 +6126,33 @@ }; /** - * Encodes the specified GroupAssetsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.GroupAssetsRequest.verify|verify} messages. + * Encodes the specified GroupFindingsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.GroupFindingsRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest + * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest * @static - * @param {google.cloud.securitycenter.v1.IGroupAssetsRequest} message GroupAssetsRequest message or plain object to encode + * @param {google.cloud.securitycenter.v1.IGroupFindingsRequest} message GroupFindingsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GroupAssetsRequest.encodeDelimited = function encodeDelimited(message, writer) { + GroupFindingsRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GroupAssetsRequest message from the specified reader or buffer. + * Decodes a GroupFindingsRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest + * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.GroupAssetsRequest} GroupAssetsRequest + * @returns {google.cloud.securitycenter.v1.GroupFindingsRequest} GroupFindingsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GroupAssetsRequest.decode = function decode(reader, length) { + GroupFindingsRequest.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.cloud.securitycenter.v1.GroupAssetsRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.GroupFindingsRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -4057,10 +6166,10 @@ message.groupBy = reader.string(); break; case 4: - message.compareDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; case 5: - message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + message.compareDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); break; case 7: message.pageToken = reader.string(); @@ -4077,30 +6186,30 @@ }; /** - * Decodes a GroupAssetsRequest message from the specified reader or buffer, length delimited. + * Decodes a GroupFindingsRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest + * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.GroupAssetsRequest} GroupAssetsRequest + * @returns {google.cloud.securitycenter.v1.GroupFindingsRequest} GroupFindingsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GroupAssetsRequest.decodeDelimited = function decodeDelimited(reader) { + GroupFindingsRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GroupAssetsRequest message. + * Verifies a GroupFindingsRequest message. * @function verify - * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest + * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GroupAssetsRequest.verify = function verify(message) { + GroupFindingsRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.parent != null && message.hasOwnProperty("parent")) @@ -4112,16 +6221,16 @@ if (message.groupBy != null && message.hasOwnProperty("groupBy")) if (!$util.isString(message.groupBy)) return "groupBy: string expected"; - if (message.compareDuration != null && message.hasOwnProperty("compareDuration")) { - var error = $root.google.protobuf.Duration.verify(message.compareDuration); - if (error) - return "compareDuration." + error; - } if (message.readTime != null && message.hasOwnProperty("readTime")) { var error = $root.google.protobuf.Timestamp.verify(message.readTime); if (error) return "readTime." + error; } + if (message.compareDuration != null && message.hasOwnProperty("compareDuration")) { + var error = $root.google.protobuf.Duration.verify(message.compareDuration); + if (error) + return "compareDuration." + error; + } if (message.pageToken != null && message.hasOwnProperty("pageToken")) if (!$util.isString(message.pageToken)) return "pageToken: string expected"; @@ -4132,33 +6241,33 @@ }; /** - * Creates a GroupAssetsRequest message from a plain object. Also converts values to their respective internal types. + * Creates a GroupFindingsRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest + * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.GroupAssetsRequest} GroupAssetsRequest + * @returns {google.cloud.securitycenter.v1.GroupFindingsRequest} GroupFindingsRequest */ - GroupAssetsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.GroupAssetsRequest) + GroupFindingsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.GroupFindingsRequest) return object; - var message = new $root.google.cloud.securitycenter.v1.GroupAssetsRequest(); + var message = new $root.google.cloud.securitycenter.v1.GroupFindingsRequest(); if (object.parent != null) message.parent = String(object.parent); if (object.filter != null) message.filter = String(object.filter); if (object.groupBy != null) message.groupBy = String(object.groupBy); - if (object.compareDuration != null) { - if (typeof object.compareDuration !== "object") - throw TypeError(".google.cloud.securitycenter.v1.GroupAssetsRequest.compareDuration: object expected"); - message.compareDuration = $root.google.protobuf.Duration.fromObject(object.compareDuration); - } if (object.readTime != null) { if (typeof object.readTime !== "object") - throw TypeError(".google.cloud.securitycenter.v1.GroupAssetsRequest.readTime: object expected"); + throw TypeError(".google.cloud.securitycenter.v1.GroupFindingsRequest.readTime: object expected"); message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); } + if (object.compareDuration != null) { + if (typeof object.compareDuration !== "object") + throw TypeError(".google.cloud.securitycenter.v1.GroupFindingsRequest.compareDuration: object expected"); + message.compareDuration = $root.google.protobuf.Duration.fromObject(object.compareDuration); + } if (object.pageToken != null) message.pageToken = String(object.pageToken); if (object.pageSize != null) @@ -4167,15 +6276,15 @@ }; /** - * Creates a plain object from a GroupAssetsRequest message. Also converts values to other types if specified. + * Creates a plain object from a GroupFindingsRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest + * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest * @static - * @param {google.cloud.securitycenter.v1.GroupAssetsRequest} message GroupAssetsRequest + * @param {google.cloud.securitycenter.v1.GroupFindingsRequest} message GroupFindingsRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GroupAssetsRequest.toObject = function toObject(message, options) { + GroupFindingsRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; @@ -4183,8 +6292,8 @@ object.parent = ""; object.filter = ""; object.groupBy = ""; - object.compareDuration = null; object.readTime = null; + object.compareDuration = null; object.pageToken = ""; object.pageSize = 0; } @@ -4194,10 +6303,10 @@ object.filter = message.filter; if (message.groupBy != null && message.hasOwnProperty("groupBy")) object.groupBy = message.groupBy; - if (message.compareDuration != null && message.hasOwnProperty("compareDuration")) - object.compareDuration = $root.google.protobuf.Duration.toObject(message.compareDuration, options); if (message.readTime != null && message.hasOwnProperty("readTime")) object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); + if (message.compareDuration != null && message.hasOwnProperty("compareDuration")) + object.compareDuration = $root.google.protobuf.Duration.toObject(message.compareDuration, options); if (message.pageToken != null && message.hasOwnProperty("pageToken")) object.pageToken = message.pageToken; if (message.pageSize != null && message.hasOwnProperty("pageSize")) @@ -4206,40 +6315,40 @@ }; /** - * Converts this GroupAssetsRequest to JSON. + * Converts this GroupFindingsRequest to JSON. * @function toJSON - * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest + * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest * @instance * @returns {Object.} JSON object */ - GroupAssetsRequest.prototype.toJSON = function toJSON() { + GroupFindingsRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return GroupAssetsRequest; + return GroupFindingsRequest; })(); - v1.GroupAssetsResponse = (function() { + v1.GroupFindingsResponse = (function() { /** - * Properties of a GroupAssetsResponse. + * Properties of a GroupFindingsResponse. * @memberof google.cloud.securitycenter.v1 - * @interface IGroupAssetsResponse - * @property {Array.|null} [groupByResults] GroupAssetsResponse groupByResults - * @property {google.protobuf.ITimestamp|null} [readTime] GroupAssetsResponse readTime - * @property {string|null} [nextPageToken] GroupAssetsResponse nextPageToken - * @property {number|null} [totalSize] GroupAssetsResponse totalSize + * @interface IGroupFindingsResponse + * @property {Array.|null} [groupByResults] GroupFindingsResponse groupByResults + * @property {google.protobuf.ITimestamp|null} [readTime] GroupFindingsResponse readTime + * @property {string|null} [nextPageToken] GroupFindingsResponse nextPageToken + * @property {number|null} [totalSize] GroupFindingsResponse totalSize */ /** - * Constructs a new GroupAssetsResponse. + * Constructs a new GroupFindingsResponse. * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents a GroupAssetsResponse. - * @implements IGroupAssetsResponse + * @classdesc Represents a GroupFindingsResponse. + * @implements IGroupFindingsResponse * @constructor - * @param {google.cloud.securitycenter.v1.IGroupAssetsResponse=} [properties] Properties to set + * @param {google.cloud.securitycenter.v1.IGroupFindingsResponse=} [properties] Properties to set */ - function GroupAssetsResponse(properties) { + function GroupFindingsResponse(properties) { this.groupByResults = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) @@ -4248,59 +6357,59 @@ } /** - * GroupAssetsResponse groupByResults. + * GroupFindingsResponse groupByResults. * @member {Array.} groupByResults - * @memberof google.cloud.securitycenter.v1.GroupAssetsResponse + * @memberof google.cloud.securitycenter.v1.GroupFindingsResponse * @instance */ - GroupAssetsResponse.prototype.groupByResults = $util.emptyArray; + GroupFindingsResponse.prototype.groupByResults = $util.emptyArray; /** - * GroupAssetsResponse readTime. + * GroupFindingsResponse readTime. * @member {google.protobuf.ITimestamp|null|undefined} readTime - * @memberof google.cloud.securitycenter.v1.GroupAssetsResponse + * @memberof google.cloud.securitycenter.v1.GroupFindingsResponse * @instance */ - GroupAssetsResponse.prototype.readTime = null; + GroupFindingsResponse.prototype.readTime = null; /** - * GroupAssetsResponse nextPageToken. + * GroupFindingsResponse nextPageToken. * @member {string} nextPageToken - * @memberof google.cloud.securitycenter.v1.GroupAssetsResponse + * @memberof google.cloud.securitycenter.v1.GroupFindingsResponse * @instance */ - GroupAssetsResponse.prototype.nextPageToken = ""; + GroupFindingsResponse.prototype.nextPageToken = ""; /** - * GroupAssetsResponse totalSize. + * GroupFindingsResponse totalSize. * @member {number} totalSize - * @memberof google.cloud.securitycenter.v1.GroupAssetsResponse + * @memberof google.cloud.securitycenter.v1.GroupFindingsResponse * @instance */ - GroupAssetsResponse.prototype.totalSize = 0; + GroupFindingsResponse.prototype.totalSize = 0; /** - * Creates a new GroupAssetsResponse instance using the specified properties. + * Creates a new GroupFindingsResponse instance using the specified properties. * @function create - * @memberof google.cloud.securitycenter.v1.GroupAssetsResponse + * @memberof google.cloud.securitycenter.v1.GroupFindingsResponse * @static - * @param {google.cloud.securitycenter.v1.IGroupAssetsResponse=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.GroupAssetsResponse} GroupAssetsResponse instance + * @param {google.cloud.securitycenter.v1.IGroupFindingsResponse=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.GroupFindingsResponse} GroupFindingsResponse instance */ - GroupAssetsResponse.create = function create(properties) { - return new GroupAssetsResponse(properties); + GroupFindingsResponse.create = function create(properties) { + return new GroupFindingsResponse(properties); }; /** - * Encodes the specified GroupAssetsResponse message. Does not implicitly {@link google.cloud.securitycenter.v1.GroupAssetsResponse.verify|verify} messages. + * Encodes the specified GroupFindingsResponse message. Does not implicitly {@link google.cloud.securitycenter.v1.GroupFindingsResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.securitycenter.v1.GroupAssetsResponse + * @memberof google.cloud.securitycenter.v1.GroupFindingsResponse * @static - * @param {google.cloud.securitycenter.v1.IGroupAssetsResponse} message GroupAssetsResponse message or plain object to encode + * @param {google.cloud.securitycenter.v1.IGroupFindingsResponse} message GroupFindingsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GroupAssetsResponse.encode = function encode(message, writer) { + GroupFindingsResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.groupByResults != null && message.groupByResults.length) @@ -4316,33 +6425,33 @@ }; /** - * Encodes the specified GroupAssetsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.GroupAssetsResponse.verify|verify} messages. + * Encodes the specified GroupFindingsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.GroupFindingsResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.GroupAssetsResponse + * @memberof google.cloud.securitycenter.v1.GroupFindingsResponse * @static - * @param {google.cloud.securitycenter.v1.IGroupAssetsResponse} message GroupAssetsResponse message or plain object to encode + * @param {google.cloud.securitycenter.v1.IGroupFindingsResponse} message GroupFindingsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GroupAssetsResponse.encodeDelimited = function encodeDelimited(message, writer) { + GroupFindingsResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GroupAssetsResponse message from the specified reader or buffer. + * Decodes a GroupFindingsResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.securitycenter.v1.GroupAssetsResponse + * @memberof google.cloud.securitycenter.v1.GroupFindingsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.GroupAssetsResponse} GroupAssetsResponse + * @returns {google.cloud.securitycenter.v1.GroupFindingsResponse} GroupFindingsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GroupAssetsResponse.decode = function decode(reader, length) { + GroupFindingsResponse.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.cloud.securitycenter.v1.GroupAssetsResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.GroupFindingsResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -4369,30 +6478,30 @@ }; /** - * Decodes a GroupAssetsResponse message from the specified reader or buffer, length delimited. + * Decodes a GroupFindingsResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.GroupAssetsResponse + * @memberof google.cloud.securitycenter.v1.GroupFindingsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.GroupAssetsResponse} GroupAssetsResponse + * @returns {google.cloud.securitycenter.v1.GroupFindingsResponse} GroupFindingsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GroupAssetsResponse.decodeDelimited = function decodeDelimited(reader) { + GroupFindingsResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GroupAssetsResponse message. + * Verifies a GroupFindingsResponse message. * @function verify - * @memberof google.cloud.securitycenter.v1.GroupAssetsResponse + * @memberof google.cloud.securitycenter.v1.GroupFindingsResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GroupAssetsResponse.verify = function verify(message) { + GroupFindingsResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.groupByResults != null && message.hasOwnProperty("groupByResults")) { @@ -4419,30 +6528,30 @@ }; /** - * Creates a GroupAssetsResponse message from a plain object. Also converts values to their respective internal types. + * Creates a GroupFindingsResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.securitycenter.v1.GroupAssetsResponse + * @memberof google.cloud.securitycenter.v1.GroupFindingsResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.GroupAssetsResponse} GroupAssetsResponse + * @returns {google.cloud.securitycenter.v1.GroupFindingsResponse} GroupFindingsResponse */ - GroupAssetsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.GroupAssetsResponse) + GroupFindingsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.GroupFindingsResponse) return object; - var message = new $root.google.cloud.securitycenter.v1.GroupAssetsResponse(); + var message = new $root.google.cloud.securitycenter.v1.GroupFindingsResponse(); if (object.groupByResults) { if (!Array.isArray(object.groupByResults)) - throw TypeError(".google.cloud.securitycenter.v1.GroupAssetsResponse.groupByResults: array expected"); + throw TypeError(".google.cloud.securitycenter.v1.GroupFindingsResponse.groupByResults: array expected"); message.groupByResults = []; for (var i = 0; i < object.groupByResults.length; ++i) { if (typeof object.groupByResults[i] !== "object") - throw TypeError(".google.cloud.securitycenter.v1.GroupAssetsResponse.groupByResults: object expected"); + throw TypeError(".google.cloud.securitycenter.v1.GroupFindingsResponse.groupByResults: object expected"); message.groupByResults[i] = $root.google.cloud.securitycenter.v1.GroupResult.fromObject(object.groupByResults[i]); } } if (object.readTime != null) { if (typeof object.readTime !== "object") - throw TypeError(".google.cloud.securitycenter.v1.GroupAssetsResponse.readTime: object expected"); + throw TypeError(".google.cloud.securitycenter.v1.GroupFindingsResponse.readTime: object expected"); message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); } if (object.nextPageToken != null) @@ -4453,15 +6562,15 @@ }; /** - * Creates a plain object from a GroupAssetsResponse message. Also converts values to other types if specified. + * Creates a plain object from a GroupFindingsResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.securitycenter.v1.GroupAssetsResponse + * @memberof google.cloud.securitycenter.v1.GroupFindingsResponse * @static - * @param {google.cloud.securitycenter.v1.GroupAssetsResponse} message GroupAssetsResponse + * @param {google.cloud.securitycenter.v1.GroupFindingsResponse} message GroupFindingsResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GroupAssetsResponse.toObject = function toObject(message, options) { + GroupFindingsResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; @@ -4487,43 +6596,39 @@ }; /** - * Converts this GroupAssetsResponse to JSON. + * Converts this GroupFindingsResponse to JSON. * @function toJSON - * @memberof google.cloud.securitycenter.v1.GroupAssetsResponse + * @memberof google.cloud.securitycenter.v1.GroupFindingsResponse * @instance * @returns {Object.} JSON object */ - GroupAssetsResponse.prototype.toJSON = function toJSON() { + GroupFindingsResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return GroupAssetsResponse; + return GroupFindingsResponse; })(); - v1.GroupFindingsRequest = (function() { + v1.GroupResult = (function() { /** - * Properties of a GroupFindingsRequest. + * Properties of a GroupResult. * @memberof google.cloud.securitycenter.v1 - * @interface IGroupFindingsRequest - * @property {string|null} [parent] GroupFindingsRequest parent - * @property {string|null} [filter] GroupFindingsRequest filter - * @property {string|null} [groupBy] GroupFindingsRequest groupBy - * @property {google.protobuf.ITimestamp|null} [readTime] GroupFindingsRequest readTime - * @property {google.protobuf.IDuration|null} [compareDuration] GroupFindingsRequest compareDuration - * @property {string|null} [pageToken] GroupFindingsRequest pageToken - * @property {number|null} [pageSize] GroupFindingsRequest pageSize + * @interface IGroupResult + * @property {Object.|null} [properties] GroupResult properties + * @property {number|Long|null} [count] GroupResult count */ /** - * Constructs a new GroupFindingsRequest. + * Constructs a new GroupResult. * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents a GroupFindingsRequest. - * @implements IGroupFindingsRequest + * @classdesc Represents a GroupResult. + * @implements IGroupResult * @constructor - * @param {google.cloud.securitycenter.v1.IGroupFindingsRequest=} [properties] Properties to set + * @param {google.cloud.securitycenter.v1.IGroupResult=} [properties] Properties to set */ - function GroupFindingsRequest(properties) { + function GroupResult(properties) { + this.properties = {}; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -4531,153 +6636,96 @@ } /** - * GroupFindingsRequest parent. - * @member {string} parent - * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest - * @instance - */ - GroupFindingsRequest.prototype.parent = ""; - - /** - * GroupFindingsRequest filter. - * @member {string} filter - * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest - * @instance - */ - GroupFindingsRequest.prototype.filter = ""; - - /** - * GroupFindingsRequest groupBy. - * @member {string} groupBy - * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest - * @instance - */ - GroupFindingsRequest.prototype.groupBy = ""; - - /** - * GroupFindingsRequest readTime. - * @member {google.protobuf.ITimestamp|null|undefined} readTime - * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest - * @instance - */ - GroupFindingsRequest.prototype.readTime = null; - - /** - * GroupFindingsRequest compareDuration. - * @member {google.protobuf.IDuration|null|undefined} compareDuration - * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest - * @instance - */ - GroupFindingsRequest.prototype.compareDuration = null; - - /** - * GroupFindingsRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest + * GroupResult properties. + * @member {Object.} properties + * @memberof google.cloud.securitycenter.v1.GroupResult * @instance */ - GroupFindingsRequest.prototype.pageToken = ""; + GroupResult.prototype.properties = $util.emptyObject; /** - * GroupFindingsRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest + * GroupResult count. + * @member {number|Long} count + * @memberof google.cloud.securitycenter.v1.GroupResult * @instance */ - GroupFindingsRequest.prototype.pageSize = 0; + GroupResult.prototype.count = $util.Long ? $util.Long.fromBits(0,0,false) : 0; /** - * Creates a new GroupFindingsRequest instance using the specified properties. + * Creates a new GroupResult instance using the specified properties. * @function create - * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest + * @memberof google.cloud.securitycenter.v1.GroupResult * @static - * @param {google.cloud.securitycenter.v1.IGroupFindingsRequest=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.GroupFindingsRequest} GroupFindingsRequest instance + * @param {google.cloud.securitycenter.v1.IGroupResult=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.GroupResult} GroupResult instance */ - GroupFindingsRequest.create = function create(properties) { - return new GroupFindingsRequest(properties); + GroupResult.create = function create(properties) { + return new GroupResult(properties); }; /** - * Encodes the specified GroupFindingsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.GroupFindingsRequest.verify|verify} messages. + * Encodes the specified GroupResult message. Does not implicitly {@link google.cloud.securitycenter.v1.GroupResult.verify|verify} messages. * @function encode - * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest + * @memberof google.cloud.securitycenter.v1.GroupResult * @static - * @param {google.cloud.securitycenter.v1.IGroupFindingsRequest} message GroupFindingsRequest message or plain object to encode + * @param {google.cloud.securitycenter.v1.IGroupResult} message GroupResult message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GroupFindingsRequest.encode = function encode(message, writer) { + GroupResult.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && message.hasOwnProperty("parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.filter != null && message.hasOwnProperty("filter")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); - if (message.groupBy != null && message.hasOwnProperty("groupBy")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.groupBy); - if (message.readTime != null && message.hasOwnProperty("readTime")) - $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.compareDuration != null && message.hasOwnProperty("compareDuration")) - $root.google.protobuf.Duration.encode(message.compareDuration, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.pageToken); - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - writer.uint32(/* id 8, wireType 0 =*/64).int32(message.pageSize); + if (message.properties != null && message.hasOwnProperty("properties")) + for (var keys = Object.keys(message.properties), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.protobuf.Value.encode(message.properties[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.count != null && message.hasOwnProperty("count")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.count); return writer; }; /** - * Encodes the specified GroupFindingsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.GroupFindingsRequest.verify|verify} messages. + * Encodes the specified GroupResult message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.GroupResult.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest + * @memberof google.cloud.securitycenter.v1.GroupResult * @static - * @param {google.cloud.securitycenter.v1.IGroupFindingsRequest} message GroupFindingsRequest message or plain object to encode + * @param {google.cloud.securitycenter.v1.IGroupResult} message GroupResult message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GroupFindingsRequest.encodeDelimited = function encodeDelimited(message, writer) { + GroupResult.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GroupFindingsRequest message from the specified reader or buffer. + * Decodes a GroupResult message from the specified reader or buffer. * @function decode - * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest + * @memberof google.cloud.securitycenter.v1.GroupResult * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.GroupFindingsRequest} GroupFindingsRequest + * @returns {google.cloud.securitycenter.v1.GroupResult} GroupResult * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GroupFindingsRequest.decode = function decode(reader, length) { + GroupResult.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.cloud.securitycenter.v1.GroupFindingsRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.GroupResult(), key; while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.parent = reader.string(); + reader.skip().pos++; + if (message.properties === $util.emptyObject) + message.properties = {}; + key = reader.string(); + reader.pos++; + message.properties[key] = $root.google.protobuf.Value.decode(reader, reader.uint32()); break; case 2: - message.filter = reader.string(); - break; - case 3: - message.groupBy = reader.string(); - break; - case 4: - message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 5: - message.compareDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - case 7: - message.pageToken = reader.string(); - break; - case 8: - message.pageSize = reader.int32(); + message.count = reader.int64(); break; default: reader.skipType(tag & 7); @@ -4688,170 +6736,151 @@ }; /** - * Decodes a GroupFindingsRequest message from the specified reader or buffer, length delimited. + * Decodes a GroupResult message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest + * @memberof google.cloud.securitycenter.v1.GroupResult * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.GroupFindingsRequest} GroupFindingsRequest + * @returns {google.cloud.securitycenter.v1.GroupResult} GroupResult * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GroupFindingsRequest.decodeDelimited = function decodeDelimited(reader) { + GroupResult.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GroupFindingsRequest message. + * Verifies a GroupResult message. * @function verify - * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest + * @memberof google.cloud.securitycenter.v1.GroupResult * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GroupFindingsRequest.verify = function verify(message) { + GroupResult.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.filter != null && message.hasOwnProperty("filter")) - if (!$util.isString(message.filter)) - return "filter: string expected"; - if (message.groupBy != null && message.hasOwnProperty("groupBy")) - if (!$util.isString(message.groupBy)) - return "groupBy: string expected"; - if (message.readTime != null && message.hasOwnProperty("readTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.readTime); - if (error) - return "readTime." + error; - } - if (message.compareDuration != null && message.hasOwnProperty("compareDuration")) { - var error = $root.google.protobuf.Duration.verify(message.compareDuration); - if (error) - return "compareDuration." + error; - } - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; + if (message.properties != null && message.hasOwnProperty("properties")) { + if (!$util.isObject(message.properties)) + return "properties: object expected"; + var key = Object.keys(message.properties); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.protobuf.Value.verify(message.properties[key[i]]); + if (error) + return "properties." + error; + } + } + if (message.count != null && message.hasOwnProperty("count")) + if (!$util.isInteger(message.count) && !(message.count && $util.isInteger(message.count.low) && $util.isInteger(message.count.high))) + return "count: integer|Long expected"; return null; }; /** - * Creates a GroupFindingsRequest message from a plain object. Also converts values to their respective internal types. + * Creates a GroupResult message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest + * @memberof google.cloud.securitycenter.v1.GroupResult * @static * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.GroupFindingsRequest} GroupFindingsRequest + * @returns {google.cloud.securitycenter.v1.GroupResult} GroupResult */ - GroupFindingsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.GroupFindingsRequest) + GroupResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.GroupResult) return object; - var message = new $root.google.cloud.securitycenter.v1.GroupFindingsRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.filter != null) - message.filter = String(object.filter); - if (object.groupBy != null) - message.groupBy = String(object.groupBy); - if (object.readTime != null) { - if (typeof object.readTime !== "object") - throw TypeError(".google.cloud.securitycenter.v1.GroupFindingsRequest.readTime: object expected"); - message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); - } - if (object.compareDuration != null) { - if (typeof object.compareDuration !== "object") - throw TypeError(".google.cloud.securitycenter.v1.GroupFindingsRequest.compareDuration: object expected"); - message.compareDuration = $root.google.protobuf.Duration.fromObject(object.compareDuration); + var message = new $root.google.cloud.securitycenter.v1.GroupResult(); + if (object.properties) { + if (typeof object.properties !== "object") + throw TypeError(".google.cloud.securitycenter.v1.GroupResult.properties: object expected"); + message.properties = {}; + for (var keys = Object.keys(object.properties), i = 0; i < keys.length; ++i) { + if (typeof object.properties[keys[i]] !== "object") + throw TypeError(".google.cloud.securitycenter.v1.GroupResult.properties: object expected"); + message.properties[keys[i]] = $root.google.protobuf.Value.fromObject(object.properties[keys[i]]); + } } - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; + if (object.count != null) + if ($util.Long) + (message.count = $util.Long.fromValue(object.count)).unsigned = false; + else if (typeof object.count === "string") + message.count = parseInt(object.count, 10); + else if (typeof object.count === "number") + message.count = object.count; + else if (typeof object.count === "object") + message.count = new $util.LongBits(object.count.low >>> 0, object.count.high >>> 0).toNumber(); return message; }; /** - * Creates a plain object from a GroupFindingsRequest message. Also converts values to other types if specified. + * Creates a plain object from a GroupResult message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest + * @memberof google.cloud.securitycenter.v1.GroupResult * @static - * @param {google.cloud.securitycenter.v1.GroupFindingsRequest} message GroupFindingsRequest + * @param {google.cloud.securitycenter.v1.GroupResult} message GroupResult * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GroupFindingsRequest.toObject = function toObject(message, options) { + GroupResult.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.parent = ""; - object.filter = ""; - object.groupBy = ""; - object.readTime = null; - object.compareDuration = null; - object.pageToken = ""; - object.pageSize = 0; + if (options.objects || options.defaults) + object.properties = {}; + if (options.defaults) + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.count = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.count = options.longs === String ? "0" : 0; + var keys2; + if (message.properties && (keys2 = Object.keys(message.properties)).length) { + object.properties = {}; + for (var j = 0; j < keys2.length; ++j) + object.properties[keys2[j]] = $root.google.protobuf.Value.toObject(message.properties[keys2[j]], options); } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.filter != null && message.hasOwnProperty("filter")) - object.filter = message.filter; - if (message.groupBy != null && message.hasOwnProperty("groupBy")) - object.groupBy = message.groupBy; - if (message.readTime != null && message.hasOwnProperty("readTime")) - object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); - if (message.compareDuration != null && message.hasOwnProperty("compareDuration")) - object.compareDuration = $root.google.protobuf.Duration.toObject(message.compareDuration, options); - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; + if (message.count != null && message.hasOwnProperty("count")) + if (typeof message.count === "number") + object.count = options.longs === String ? String(message.count) : message.count; + else + object.count = options.longs === String ? $util.Long.prototype.toString.call(message.count) : options.longs === Number ? new $util.LongBits(message.count.low >>> 0, message.count.high >>> 0).toNumber() : message.count; return object; }; /** - * Converts this GroupFindingsRequest to JSON. + * Converts this GroupResult to JSON. * @function toJSON - * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest + * @memberof google.cloud.securitycenter.v1.GroupResult * @instance * @returns {Object.} JSON object */ - GroupFindingsRequest.prototype.toJSON = function toJSON() { + GroupResult.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return GroupFindingsRequest; + return GroupResult; })(); - v1.GroupFindingsResponse = (function() { + v1.ListNotificationConfigsRequest = (function() { /** - * Properties of a GroupFindingsResponse. + * Properties of a ListNotificationConfigsRequest. * @memberof google.cloud.securitycenter.v1 - * @interface IGroupFindingsResponse - * @property {Array.|null} [groupByResults] GroupFindingsResponse groupByResults - * @property {google.protobuf.ITimestamp|null} [readTime] GroupFindingsResponse readTime - * @property {string|null} [nextPageToken] GroupFindingsResponse nextPageToken - * @property {number|null} [totalSize] GroupFindingsResponse totalSize + * @interface IListNotificationConfigsRequest + * @property {string|null} [parent] ListNotificationConfigsRequest parent + * @property {string|null} [pageToken] ListNotificationConfigsRequest pageToken + * @property {number|null} [pageSize] ListNotificationConfigsRequest pageSize */ /** - * Constructs a new GroupFindingsResponse. + * Constructs a new ListNotificationConfigsRequest. * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents a GroupFindingsResponse. - * @implements IGroupFindingsResponse + * @classdesc Represents a ListNotificationConfigsRequest. + * @implements IListNotificationConfigsRequest * @constructor - * @param {google.cloud.securitycenter.v1.IGroupFindingsResponse=} [properties] Properties to set + * @param {google.cloud.securitycenter.v1.IListNotificationConfigsRequest=} [properties] Properties to set */ - function GroupFindingsResponse(properties) { - this.groupByResults = []; + function ListNotificationConfigsRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -4859,117 +6888,101 @@ } /** - * GroupFindingsResponse groupByResults. - * @member {Array.} groupByResults - * @memberof google.cloud.securitycenter.v1.GroupFindingsResponse - * @instance - */ - GroupFindingsResponse.prototype.groupByResults = $util.emptyArray; - - /** - * GroupFindingsResponse readTime. - * @member {google.protobuf.ITimestamp|null|undefined} readTime - * @memberof google.cloud.securitycenter.v1.GroupFindingsResponse + * ListNotificationConfigsRequest parent. + * @member {string} parent + * @memberof google.cloud.securitycenter.v1.ListNotificationConfigsRequest * @instance */ - GroupFindingsResponse.prototype.readTime = null; + ListNotificationConfigsRequest.prototype.parent = ""; /** - * GroupFindingsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.securitycenter.v1.GroupFindingsResponse + * ListNotificationConfigsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.securitycenter.v1.ListNotificationConfigsRequest * @instance */ - GroupFindingsResponse.prototype.nextPageToken = ""; + ListNotificationConfigsRequest.prototype.pageToken = ""; /** - * GroupFindingsResponse totalSize. - * @member {number} totalSize - * @memberof google.cloud.securitycenter.v1.GroupFindingsResponse + * ListNotificationConfigsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.securitycenter.v1.ListNotificationConfigsRequest * @instance */ - GroupFindingsResponse.prototype.totalSize = 0; + ListNotificationConfigsRequest.prototype.pageSize = 0; /** - * Creates a new GroupFindingsResponse instance using the specified properties. + * Creates a new ListNotificationConfigsRequest instance using the specified properties. * @function create - * @memberof google.cloud.securitycenter.v1.GroupFindingsResponse + * @memberof google.cloud.securitycenter.v1.ListNotificationConfigsRequest * @static - * @param {google.cloud.securitycenter.v1.IGroupFindingsResponse=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.GroupFindingsResponse} GroupFindingsResponse instance + * @param {google.cloud.securitycenter.v1.IListNotificationConfigsRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.ListNotificationConfigsRequest} ListNotificationConfigsRequest instance */ - GroupFindingsResponse.create = function create(properties) { - return new GroupFindingsResponse(properties); + ListNotificationConfigsRequest.create = function create(properties) { + return new ListNotificationConfigsRequest(properties); }; /** - * Encodes the specified GroupFindingsResponse message. Does not implicitly {@link google.cloud.securitycenter.v1.GroupFindingsResponse.verify|verify} messages. + * Encodes the specified ListNotificationConfigsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.ListNotificationConfigsRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.securitycenter.v1.GroupFindingsResponse + * @memberof google.cloud.securitycenter.v1.ListNotificationConfigsRequest * @static - * @param {google.cloud.securitycenter.v1.IGroupFindingsResponse} message GroupFindingsResponse message or plain object to encode + * @param {google.cloud.securitycenter.v1.IListNotificationConfigsRequest} message ListNotificationConfigsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GroupFindingsResponse.encode = function encode(message, writer) { + ListNotificationConfigsRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.groupByResults != null && message.groupByResults.length) - for (var i = 0; i < message.groupByResults.length; ++i) - $root.google.cloud.securitycenter.v1.GroupResult.encode(message.groupByResults[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.readTime != null && message.hasOwnProperty("readTime")) - $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.nextPageToken); - if (message.totalSize != null && message.hasOwnProperty("totalSize")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.totalSize); + if (message.parent != null && message.hasOwnProperty("parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.pageToken); + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); return writer; }; /** - * Encodes the specified GroupFindingsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.GroupFindingsResponse.verify|verify} messages. + * Encodes the specified ListNotificationConfigsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListNotificationConfigsRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.GroupFindingsResponse + * @memberof google.cloud.securitycenter.v1.ListNotificationConfigsRequest * @static - * @param {google.cloud.securitycenter.v1.IGroupFindingsResponse} message GroupFindingsResponse message or plain object to encode + * @param {google.cloud.securitycenter.v1.IListNotificationConfigsRequest} message ListNotificationConfigsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GroupFindingsResponse.encodeDelimited = function encodeDelimited(message, writer) { + ListNotificationConfigsRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GroupFindingsResponse message from the specified reader or buffer. + * Decodes a ListNotificationConfigsRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.securitycenter.v1.GroupFindingsResponse + * @memberof google.cloud.securitycenter.v1.ListNotificationConfigsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.GroupFindingsResponse} GroupFindingsResponse + * @returns {google.cloud.securitycenter.v1.ListNotificationConfigsRequest} ListNotificationConfigsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GroupFindingsResponse.decode = function decode(reader, length) { + ListNotificationConfigsRequest.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.cloud.securitycenter.v1.GroupFindingsResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.ListNotificationConfigsRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - if (!(message.groupByResults && message.groupByResults.length)) - message.groupByResults = []; - message.groupByResults.push($root.google.cloud.securitycenter.v1.GroupResult.decode(reader, reader.uint32())); + message.parent = reader.string(); break; case 2: - message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + message.pageToken = reader.string(); break; case 3: - message.nextPageToken = reader.string(); - break; - case 4: - message.totalSize = reader.int32(); + message.pageSize = reader.int32(); break; default: reader.skipType(tag & 7); @@ -4980,157 +6993,126 @@ }; /** - * Decodes a GroupFindingsResponse message from the specified reader or buffer, length delimited. + * Decodes a ListNotificationConfigsRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.GroupFindingsResponse + * @memberof google.cloud.securitycenter.v1.ListNotificationConfigsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.GroupFindingsResponse} GroupFindingsResponse + * @returns {google.cloud.securitycenter.v1.ListNotificationConfigsRequest} ListNotificationConfigsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GroupFindingsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GroupFindingsResponse message. - * @function verify - * @memberof google.cloud.securitycenter.v1.GroupFindingsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GroupFindingsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.groupByResults != null && message.hasOwnProperty("groupByResults")) { - if (!Array.isArray(message.groupByResults)) - return "groupByResults: array expected"; - for (var i = 0; i < message.groupByResults.length; ++i) { - var error = $root.google.cloud.securitycenter.v1.GroupResult.verify(message.groupByResults[i]); - if (error) - return "groupByResults." + error; - } - } - if (message.readTime != null && message.hasOwnProperty("readTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.readTime); - if (error) - return "readTime." + error; - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - if (message.totalSize != null && message.hasOwnProperty("totalSize")) - if (!$util.isInteger(message.totalSize)) - return "totalSize: integer expected"; + ListNotificationConfigsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListNotificationConfigsRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1.ListNotificationConfigsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListNotificationConfigsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; return null; }; /** - * Creates a GroupFindingsResponse message from a plain object. Also converts values to their respective internal types. + * Creates a ListNotificationConfigsRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.securitycenter.v1.GroupFindingsResponse + * @memberof google.cloud.securitycenter.v1.ListNotificationConfigsRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.GroupFindingsResponse} GroupFindingsResponse + * @returns {google.cloud.securitycenter.v1.ListNotificationConfigsRequest} ListNotificationConfigsRequest */ - GroupFindingsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.GroupFindingsResponse) + ListNotificationConfigsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.ListNotificationConfigsRequest) return object; - var message = new $root.google.cloud.securitycenter.v1.GroupFindingsResponse(); - if (object.groupByResults) { - if (!Array.isArray(object.groupByResults)) - throw TypeError(".google.cloud.securitycenter.v1.GroupFindingsResponse.groupByResults: array expected"); - message.groupByResults = []; - for (var i = 0; i < object.groupByResults.length; ++i) { - if (typeof object.groupByResults[i] !== "object") - throw TypeError(".google.cloud.securitycenter.v1.GroupFindingsResponse.groupByResults: object expected"); - message.groupByResults[i] = $root.google.cloud.securitycenter.v1.GroupResult.fromObject(object.groupByResults[i]); - } - } - if (object.readTime != null) { - if (typeof object.readTime !== "object") - throw TypeError(".google.cloud.securitycenter.v1.GroupFindingsResponse.readTime: object expected"); - message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - if (object.totalSize != null) - message.totalSize = object.totalSize | 0; + var message = new $root.google.cloud.securitycenter.v1.ListNotificationConfigsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; return message; }; /** - * Creates a plain object from a GroupFindingsResponse message. Also converts values to other types if specified. + * Creates a plain object from a ListNotificationConfigsRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.securitycenter.v1.GroupFindingsResponse + * @memberof google.cloud.securitycenter.v1.ListNotificationConfigsRequest * @static - * @param {google.cloud.securitycenter.v1.GroupFindingsResponse} message GroupFindingsResponse + * @param {google.cloud.securitycenter.v1.ListNotificationConfigsRequest} message ListNotificationConfigsRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GroupFindingsResponse.toObject = function toObject(message, options) { + ListNotificationConfigsRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.groupByResults = []; if (options.defaults) { - object.readTime = null; - object.nextPageToken = ""; - object.totalSize = 0; - } - if (message.groupByResults && message.groupByResults.length) { - object.groupByResults = []; - for (var j = 0; j < message.groupByResults.length; ++j) - object.groupByResults[j] = $root.google.cloud.securitycenter.v1.GroupResult.toObject(message.groupByResults[j], options); + object.parent = ""; + object.pageToken = ""; + object.pageSize = 0; } - if (message.readTime != null && message.hasOwnProperty("readTime")) - object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - if (message.totalSize != null && message.hasOwnProperty("totalSize")) - object.totalSize = message.totalSize; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; return object; }; /** - * Converts this GroupFindingsResponse to JSON. + * Converts this ListNotificationConfigsRequest to JSON. * @function toJSON - * @memberof google.cloud.securitycenter.v1.GroupFindingsResponse + * @memberof google.cloud.securitycenter.v1.ListNotificationConfigsRequest * @instance * @returns {Object.} JSON object */ - GroupFindingsResponse.prototype.toJSON = function toJSON() { + ListNotificationConfigsRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return GroupFindingsResponse; + return ListNotificationConfigsRequest; })(); - v1.GroupResult = (function() { + v1.ListNotificationConfigsResponse = (function() { /** - * Properties of a GroupResult. + * Properties of a ListNotificationConfigsResponse. * @memberof google.cloud.securitycenter.v1 - * @interface IGroupResult - * @property {Object.|null} [properties] GroupResult properties - * @property {number|Long|null} [count] GroupResult count + * @interface IListNotificationConfigsResponse + * @property {Array.|null} [notificationConfigs] ListNotificationConfigsResponse notificationConfigs + * @property {string|null} [nextPageToken] ListNotificationConfigsResponse nextPageToken */ /** - * Constructs a new GroupResult. + * Constructs a new ListNotificationConfigsResponse. * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents a GroupResult. - * @implements IGroupResult + * @classdesc Represents a ListNotificationConfigsResponse. + * @implements IListNotificationConfigsResponse * @constructor - * @param {google.cloud.securitycenter.v1.IGroupResult=} [properties] Properties to set + * @param {google.cloud.securitycenter.v1.IListNotificationConfigsResponse=} [properties] Properties to set */ - function GroupResult(properties) { - this.properties = {}; + function ListNotificationConfigsResponse(properties) { + this.notificationConfigs = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -5138,96 +7120,91 @@ } /** - * GroupResult properties. - * @member {Object.} properties - * @memberof google.cloud.securitycenter.v1.GroupResult + * ListNotificationConfigsResponse notificationConfigs. + * @member {Array.} notificationConfigs + * @memberof google.cloud.securitycenter.v1.ListNotificationConfigsResponse * @instance */ - GroupResult.prototype.properties = $util.emptyObject; + ListNotificationConfigsResponse.prototype.notificationConfigs = $util.emptyArray; /** - * GroupResult count. - * @member {number|Long} count - * @memberof google.cloud.securitycenter.v1.GroupResult + * ListNotificationConfigsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.securitycenter.v1.ListNotificationConfigsResponse * @instance */ - GroupResult.prototype.count = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + ListNotificationConfigsResponse.prototype.nextPageToken = ""; /** - * Creates a new GroupResult instance using the specified properties. + * Creates a new ListNotificationConfigsResponse instance using the specified properties. * @function create - * @memberof google.cloud.securitycenter.v1.GroupResult + * @memberof google.cloud.securitycenter.v1.ListNotificationConfigsResponse * @static - * @param {google.cloud.securitycenter.v1.IGroupResult=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.GroupResult} GroupResult instance + * @param {google.cloud.securitycenter.v1.IListNotificationConfigsResponse=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.ListNotificationConfigsResponse} ListNotificationConfigsResponse instance */ - GroupResult.create = function create(properties) { - return new GroupResult(properties); + ListNotificationConfigsResponse.create = function create(properties) { + return new ListNotificationConfigsResponse(properties); }; /** - * Encodes the specified GroupResult message. Does not implicitly {@link google.cloud.securitycenter.v1.GroupResult.verify|verify} messages. + * Encodes the specified ListNotificationConfigsResponse message. Does not implicitly {@link google.cloud.securitycenter.v1.ListNotificationConfigsResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.securitycenter.v1.GroupResult + * @memberof google.cloud.securitycenter.v1.ListNotificationConfigsResponse * @static - * @param {google.cloud.securitycenter.v1.IGroupResult} message GroupResult message or plain object to encode + * @param {google.cloud.securitycenter.v1.IListNotificationConfigsResponse} message ListNotificationConfigsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GroupResult.encode = function encode(message, writer) { + ListNotificationConfigsResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.properties != null && message.hasOwnProperty("properties")) - for (var keys = Object.keys(message.properties), i = 0; i < keys.length; ++i) { - writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); - $root.google.protobuf.Value.encode(message.properties[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); - } - if (message.count != null && message.hasOwnProperty("count")) - writer.uint32(/* id 2, wireType 0 =*/16).int64(message.count); + if (message.notificationConfigs != null && message.notificationConfigs.length) + for (var i = 0; i < message.notificationConfigs.length; ++i) + $root.google.cloud.securitycenter.v1.NotificationConfig.encode(message.notificationConfigs[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); return writer; }; /** - * Encodes the specified GroupResult message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.GroupResult.verify|verify} messages. + * Encodes the specified ListNotificationConfigsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListNotificationConfigsResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.GroupResult + * @memberof google.cloud.securitycenter.v1.ListNotificationConfigsResponse * @static - * @param {google.cloud.securitycenter.v1.IGroupResult} message GroupResult message or plain object to encode + * @param {google.cloud.securitycenter.v1.IListNotificationConfigsResponse} message ListNotificationConfigsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GroupResult.encodeDelimited = function encodeDelimited(message, writer) { + ListNotificationConfigsResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GroupResult message from the specified reader or buffer. + * Decodes a ListNotificationConfigsResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.securitycenter.v1.GroupResult + * @memberof google.cloud.securitycenter.v1.ListNotificationConfigsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.GroupResult} GroupResult + * @returns {google.cloud.securitycenter.v1.ListNotificationConfigsResponse} ListNotificationConfigsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GroupResult.decode = function decode(reader, length) { + ListNotificationConfigsResponse.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.cloud.securitycenter.v1.GroupResult(), key; + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.ListNotificationConfigsResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - reader.skip().pos++; - if (message.properties === $util.emptyObject) - message.properties = {}; - key = reader.string(); - reader.pos++; - message.properties[key] = $root.google.protobuf.Value.decode(reader, reader.uint32()); + if (!(message.notificationConfigs && message.notificationConfigs.length)) + message.notificationConfigs = []; + message.notificationConfigs.push($root.google.cloud.securitycenter.v1.NotificationConfig.decode(reader, reader.uint32())); break; case 2: - message.count = reader.int64(); + message.nextPageToken = reader.string(); break; default: reader.skipType(tag & 7); @@ -5238,129 +7215,113 @@ }; /** - * Decodes a GroupResult message from the specified reader or buffer, length delimited. + * Decodes a ListNotificationConfigsResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.GroupResult + * @memberof google.cloud.securitycenter.v1.ListNotificationConfigsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.GroupResult} GroupResult + * @returns {google.cloud.securitycenter.v1.ListNotificationConfigsResponse} ListNotificationConfigsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GroupResult.decodeDelimited = function decodeDelimited(reader) { + ListNotificationConfigsResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GroupResult message. + * Verifies a ListNotificationConfigsResponse message. * @function verify - * @memberof google.cloud.securitycenter.v1.GroupResult + * @memberof google.cloud.securitycenter.v1.ListNotificationConfigsResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GroupResult.verify = function verify(message) { + ListNotificationConfigsResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.properties != null && message.hasOwnProperty("properties")) { - if (!$util.isObject(message.properties)) - return "properties: object expected"; - var key = Object.keys(message.properties); - for (var i = 0; i < key.length; ++i) { - var error = $root.google.protobuf.Value.verify(message.properties[key[i]]); + if (message.notificationConfigs != null && message.hasOwnProperty("notificationConfigs")) { + if (!Array.isArray(message.notificationConfigs)) + return "notificationConfigs: array expected"; + for (var i = 0; i < message.notificationConfigs.length; ++i) { + var error = $root.google.cloud.securitycenter.v1.NotificationConfig.verify(message.notificationConfigs[i]); if (error) - return "properties." + error; + return "notificationConfigs." + error; } } - if (message.count != null && message.hasOwnProperty("count")) - if (!$util.isInteger(message.count) && !(message.count && $util.isInteger(message.count.low) && $util.isInteger(message.count.high))) - return "count: integer|Long expected"; + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; return null; }; /** - * Creates a GroupResult message from a plain object. Also converts values to their respective internal types. + * Creates a ListNotificationConfigsResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.securitycenter.v1.GroupResult + * @memberof google.cloud.securitycenter.v1.ListNotificationConfigsResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.GroupResult} GroupResult + * @returns {google.cloud.securitycenter.v1.ListNotificationConfigsResponse} ListNotificationConfigsResponse */ - GroupResult.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.GroupResult) + ListNotificationConfigsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.ListNotificationConfigsResponse) return object; - var message = new $root.google.cloud.securitycenter.v1.GroupResult(); - if (object.properties) { - if (typeof object.properties !== "object") - throw TypeError(".google.cloud.securitycenter.v1.GroupResult.properties: object expected"); - message.properties = {}; - for (var keys = Object.keys(object.properties), i = 0; i < keys.length; ++i) { - if (typeof object.properties[keys[i]] !== "object") - throw TypeError(".google.cloud.securitycenter.v1.GroupResult.properties: object expected"); - message.properties[keys[i]] = $root.google.protobuf.Value.fromObject(object.properties[keys[i]]); + var message = new $root.google.cloud.securitycenter.v1.ListNotificationConfigsResponse(); + if (object.notificationConfigs) { + if (!Array.isArray(object.notificationConfigs)) + throw TypeError(".google.cloud.securitycenter.v1.ListNotificationConfigsResponse.notificationConfigs: array expected"); + message.notificationConfigs = []; + for (var i = 0; i < object.notificationConfigs.length; ++i) { + if (typeof object.notificationConfigs[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v1.ListNotificationConfigsResponse.notificationConfigs: object expected"); + message.notificationConfigs[i] = $root.google.cloud.securitycenter.v1.NotificationConfig.fromObject(object.notificationConfigs[i]); } } - if (object.count != null) - if ($util.Long) - (message.count = $util.Long.fromValue(object.count)).unsigned = false; - else if (typeof object.count === "string") - message.count = parseInt(object.count, 10); - else if (typeof object.count === "number") - message.count = object.count; - else if (typeof object.count === "object") - message.count = new $util.LongBits(object.count.low >>> 0, object.count.high >>> 0).toNumber(); + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); return message; }; /** - * Creates a plain object from a GroupResult message. Also converts values to other types if specified. + * Creates a plain object from a ListNotificationConfigsResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.securitycenter.v1.GroupResult + * @memberof google.cloud.securitycenter.v1.ListNotificationConfigsResponse * @static - * @param {google.cloud.securitycenter.v1.GroupResult} message GroupResult + * @param {google.cloud.securitycenter.v1.ListNotificationConfigsResponse} message ListNotificationConfigsResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GroupResult.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.objects || options.defaults) - object.properties = {}; - if (options.defaults) - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.count = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.count = options.longs === String ? "0" : 0; - var keys2; - if (message.properties && (keys2 = Object.keys(message.properties)).length) { - object.properties = {}; - for (var j = 0; j < keys2.length; ++j) - object.properties[keys2[j]] = $root.google.protobuf.Value.toObject(message.properties[keys2[j]], options); + ListNotificationConfigsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.notificationConfigs = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.notificationConfigs && message.notificationConfigs.length) { + object.notificationConfigs = []; + for (var j = 0; j < message.notificationConfigs.length; ++j) + object.notificationConfigs[j] = $root.google.cloud.securitycenter.v1.NotificationConfig.toObject(message.notificationConfigs[j], options); } - if (message.count != null && message.hasOwnProperty("count")) - if (typeof message.count === "number") - object.count = options.longs === String ? String(message.count) : message.count; - else - object.count = options.longs === String ? $util.Long.prototype.toString.call(message.count) : options.longs === Number ? new $util.LongBits(message.count.low >>> 0, message.count.high >>> 0).toNumber() : message.count; + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; return object; }; /** - * Converts this GroupResult to JSON. + * Converts this ListNotificationConfigsResponse to JSON. * @function toJSON - * @memberof google.cloud.securitycenter.v1.GroupResult + * @memberof google.cloud.securitycenter.v1.ListNotificationConfigsResponse * @instance * @returns {Object.} JSON object */ - GroupResult.prototype.toJSON = function toJSON() { + ListNotificationConfigsResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return GroupResult; + return ListNotificationConfigsResponse; })(); v1.ListSourcesRequest = (function() { @@ -8586,6 +10547,226 @@ return UpdateFindingRequest; })(); + v1.UpdateNotificationConfigRequest = (function() { + + /** + * Properties of an UpdateNotificationConfigRequest. + * @memberof google.cloud.securitycenter.v1 + * @interface IUpdateNotificationConfigRequest + * @property {google.cloud.securitycenter.v1.INotificationConfig|null} [notificationConfig] UpdateNotificationConfigRequest notificationConfig + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateNotificationConfigRequest updateMask + */ + + /** + * Constructs a new UpdateNotificationConfigRequest. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents an UpdateNotificationConfigRequest. + * @implements IUpdateNotificationConfigRequest + * @constructor + * @param {google.cloud.securitycenter.v1.IUpdateNotificationConfigRequest=} [properties] Properties to set + */ + function UpdateNotificationConfigRequest(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]]; + } + + /** + * UpdateNotificationConfigRequest notificationConfig. + * @member {google.cloud.securitycenter.v1.INotificationConfig|null|undefined} notificationConfig + * @memberof google.cloud.securitycenter.v1.UpdateNotificationConfigRequest + * @instance + */ + UpdateNotificationConfigRequest.prototype.notificationConfig = null; + + /** + * UpdateNotificationConfigRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.securitycenter.v1.UpdateNotificationConfigRequest + * @instance + */ + UpdateNotificationConfigRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateNotificationConfigRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.UpdateNotificationConfigRequest + * @static + * @param {google.cloud.securitycenter.v1.IUpdateNotificationConfigRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.UpdateNotificationConfigRequest} UpdateNotificationConfigRequest instance + */ + UpdateNotificationConfigRequest.create = function create(properties) { + return new UpdateNotificationConfigRequest(properties); + }; + + /** + * Encodes the specified UpdateNotificationConfigRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.UpdateNotificationConfigRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.UpdateNotificationConfigRequest + * @static + * @param {google.cloud.securitycenter.v1.IUpdateNotificationConfigRequest} message UpdateNotificationConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateNotificationConfigRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.notificationConfig != null && message.hasOwnProperty("notificationConfig")) + $root.google.cloud.securitycenter.v1.NotificationConfig.encode(message.notificationConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateNotificationConfigRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.UpdateNotificationConfigRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.UpdateNotificationConfigRequest + * @static + * @param {google.cloud.securitycenter.v1.IUpdateNotificationConfigRequest} message UpdateNotificationConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateNotificationConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateNotificationConfigRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.UpdateNotificationConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.UpdateNotificationConfigRequest} UpdateNotificationConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateNotificationConfigRequest.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.cloud.securitycenter.v1.UpdateNotificationConfigRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.notificationConfig = $root.google.cloud.securitycenter.v1.NotificationConfig.decode(reader, reader.uint32()); + break; + case 2: + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateNotificationConfigRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.UpdateNotificationConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.UpdateNotificationConfigRequest} UpdateNotificationConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateNotificationConfigRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateNotificationConfigRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1.UpdateNotificationConfigRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateNotificationConfigRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.notificationConfig != null && message.hasOwnProperty("notificationConfig")) { + var error = $root.google.cloud.securitycenter.v1.NotificationConfig.verify(message.notificationConfig); + if (error) + return "notificationConfig." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + return null; + }; + + /** + * Creates an UpdateNotificationConfigRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.UpdateNotificationConfigRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.UpdateNotificationConfigRequest} UpdateNotificationConfigRequest + */ + UpdateNotificationConfigRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.UpdateNotificationConfigRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1.UpdateNotificationConfigRequest(); + if (object.notificationConfig != null) { + if (typeof object.notificationConfig !== "object") + throw TypeError(".google.cloud.securitycenter.v1.UpdateNotificationConfigRequest.notificationConfig: object expected"); + message.notificationConfig = $root.google.cloud.securitycenter.v1.NotificationConfig.fromObject(object.notificationConfig); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.securitycenter.v1.UpdateNotificationConfigRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateNotificationConfigRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.UpdateNotificationConfigRequest + * @static + * @param {google.cloud.securitycenter.v1.UpdateNotificationConfigRequest} message UpdateNotificationConfigRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateNotificationConfigRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.notificationConfig = null; + object.updateMask = null; + } + if (message.notificationConfig != null && message.hasOwnProperty("notificationConfig")) + object.notificationConfig = $root.google.cloud.securitycenter.v1.NotificationConfig.toObject(message.notificationConfig, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateNotificationConfigRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.UpdateNotificationConfigRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateNotificationConfigRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return UpdateNotificationConfigRequest; + })(); + v1.UpdateOrganizationSettingsRequest = (function() { /** @@ -29806,174 +31987,118 @@ */ var api = {}; - 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 - */ - - /** - * 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 = []; - 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; + api.Http = (function() { /** - * ResourceDescriptor nameField. - * @member {string} nameField - * @memberof google.api.ResourceDescriptor - * @instance + * Properties of a Http. + * @memberof google.api + * @interface IHttp + * @property {Array.|null} [rules] Http rules + * @property {boolean|null} [fullyDecodeReservedExpansion] Http fullyDecodeReservedExpansion */ - ResourceDescriptor.prototype.nameField = ""; /** - * ResourceDescriptor history. - * @member {google.api.ResourceDescriptor.History} history - * @memberof google.api.ResourceDescriptor - * @instance + * Constructs a new Http. + * @memberof google.api + * @classdesc Represents a Http. + * @implements IHttp + * @constructor + * @param {google.api.IHttp=} [properties] Properties to set */ - ResourceDescriptor.prototype.history = 0; + 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]]; + } /** - * ResourceDescriptor plural. - * @member {string} plural - * @memberof google.api.ResourceDescriptor + * Http rules. + * @member {Array.} rules + * @memberof google.api.Http * @instance */ - ResourceDescriptor.prototype.plural = ""; + Http.prototype.rules = $util.emptyArray; /** - * ResourceDescriptor singular. - * @member {string} singular - * @memberof google.api.ResourceDescriptor + * Http fullyDecodeReservedExpansion. + * @member {boolean} fullyDecodeReservedExpansion + * @memberof google.api.Http * @instance */ - ResourceDescriptor.prototype.singular = ""; + Http.prototype.fullyDecodeReservedExpansion = false; /** - * Creates a new ResourceDescriptor instance using the specified properties. + * Creates a new Http instance using the specified properties. * @function create - * @memberof google.api.ResourceDescriptor + * @memberof google.api.Http * @static - * @param {google.api.IResourceDescriptor=} [properties] Properties to set - * @returns {google.api.ResourceDescriptor} ResourceDescriptor instance + * @param {google.api.IHttp=} [properties] Properties to set + * @returns {google.api.Http} Http instance */ - ResourceDescriptor.create = function create(properties) { - return new ResourceDescriptor(properties); + Http.create = function create(properties) { + return new Http(properties); }; /** - * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. * @function encode - * @memberof google.api.ResourceDescriptor + * @memberof google.api.Http * @static - * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode + * @param {google.api.IHttp} message Http message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ResourceDescriptor.encode = function encode(message, writer) { + Http.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.type != null && message.hasOwnProperty("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 && message.hasOwnProperty("nameField")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.nameField); - if (message.history != null && message.hasOwnProperty("history")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.history); - if (message.plural != null && message.hasOwnProperty("plural")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.plural); - if (message.singular != null && message.hasOwnProperty("singular")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.singular); + 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 && message.hasOwnProperty("fullyDecodeReservedExpansion")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.fullyDecodeReservedExpansion); return writer; }; /** - * Encodes the specified ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. * @function encodeDelimited - * @memberof google.api.ResourceDescriptor + * @memberof google.api.Http * @static - * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode + * @param {google.api.IHttp} message Http message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ResourceDescriptor.encodeDelimited = function encodeDelimited(message, writer) { + Http.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ResourceDescriptor message from the specified reader or buffer. + * Decodes a Http message from the specified reader or buffer. * @function decode - * @memberof google.api.ResourceDescriptor + * @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.ResourceDescriptor} ResourceDescriptor + * @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 */ - ResourceDescriptor.decode = function decode(reader, length) { + 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.ResourceDescriptor(); + 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: - message.type = reader.string(); + if (!(message.rules && message.rules.length)) + message.rules = []; + message.rules.push($root.google.api.HttpRule.decode(reader, reader.uint32())); 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(); + message.fullyDecodeReservedExpansion = reader.bool(); break; default: reader.skipType(tag & 7); @@ -29984,196 +32109,143 @@ }; /** - * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. + * Decodes a Http message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.api.ResourceDescriptor + * @memberof google.api.Http * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.ResourceDescriptor} ResourceDescriptor + * @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 */ - ResourceDescriptor.decodeDelimited = function decodeDelimited(reader) { + Http.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ResourceDescriptor message. + * Verifies a Http message. * @function verify - * @memberof google.api.ResourceDescriptor + * @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 */ - ResourceDescriptor.verify = function verify(message) { + Http.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.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.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.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) + if (typeof message.fullyDecodeReservedExpansion !== "boolean") + return "fullyDecodeReservedExpansion: boolean expected"; return null; }; /** - * Creates a ResourceDescriptor message from a plain object. Also converts values to their respective internal types. + * Creates a Http message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.api.ResourceDescriptor + * @memberof google.api.Http * @static * @param {Object.} object Plain object - * @returns {google.api.ResourceDescriptor} ResourceDescriptor + * @returns {google.api.Http} Http */ - ResourceDescriptor.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.ResourceDescriptor) + Http.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.Http) 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) { - 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; + 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.plural != null) - message.plural = String(object.plural); - if (object.singular != null) - message.singular = String(object.singular); + if (object.fullyDecodeReservedExpansion != null) + message.fullyDecodeReservedExpansion = Boolean(object.fullyDecodeReservedExpansion); return message; }; /** - * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. + * Creates a plain object from a Http message. Also converts values to other types if specified. * @function toObject - * @memberof google.api.ResourceDescriptor + * @memberof google.api.Http * @static - * @param {google.api.ResourceDescriptor} message ResourceDescriptor + * @param {google.api.Http} message Http * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ResourceDescriptor.toObject = function toObject(message, options) { + Http.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) - object.pattern = []; - 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] : message.history; - if (message.plural != null && message.hasOwnProperty("plural")) - object.plural = message.plural; - if (message.singular != null && message.hasOwnProperty("singular")) - object.singular = message.singular; + 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 ResourceDescriptor to JSON. + * Converts this Http to JSON. * @function toJSON - * @memberof google.api.ResourceDescriptor + * @memberof google.api.Http * @instance * @returns {Object.} JSON object */ - ResourceDescriptor.prototype.toJSON = function toJSON() { + Http.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - /** - * History enum. - * @name google.api.ResourceDescriptor.History - * @enum {string} - * @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; - })(); - - return ResourceDescriptor; + return Http; })(); - api.ResourceReference = (function() { + api.HttpRule = (function() { /** - * Properties of a ResourceReference. + * Properties of a HttpRule. * @memberof google.api - * @interface IResourceReference - * @property {string|null} [type] ResourceReference type - * @property {string|null} [childType] ResourceReference childType + * @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 ResourceReference. + * Constructs a new HttpRule. * @memberof google.api - * @classdesc Represents a ResourceReference. - * @implements IResourceReference + * @classdesc Represents a HttpRule. + * @implements IHttpRule * @constructor - * @param {google.api.IResourceReference=} [properties] Properties to set + * @param {google.api.IHttpRule=} [properties] Properties to set */ - function ResourceReference(properties) { + function HttpRule(properties) { + this.additionalBindings = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -30181,88 +32253,209 @@ } /** - * ResourceReference type. - * @member {string} type - * @memberof google.api.ResourceReference + * HttpRule selector. + * @member {string} selector + * @memberof google.api.HttpRule * @instance */ - ResourceReference.prototype.type = ""; + HttpRule.prototype.selector = ""; /** - * ResourceReference childType. - * @member {string} childType - * @memberof google.api.ResourceReference + * HttpRule get. + * @member {string} get + * @memberof google.api.HttpRule * @instance */ - ResourceReference.prototype.childType = ""; + HttpRule.prototype.get = ""; /** - * Creates a new ResourceReference instance using the specified properties. + * HttpRule put. + * @member {string} put + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.put = ""; + + /** + * HttpRule post. + * @member {string} post + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.post = ""; + + /** + * HttpRule delete. + * @member {string} delete + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype["delete"] = ""; + + /** + * HttpRule patch. + * @member {string} patch + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.patch = ""; + + /** + * 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.ResourceReference + * @memberof google.api.HttpRule * @static - * @param {google.api.IResourceReference=} [properties] Properties to set - * @returns {google.api.ResourceReference} ResourceReference instance + * @param {google.api.IHttpRule=} [properties] Properties to set + * @returns {google.api.HttpRule} HttpRule instance */ - ResourceReference.create = function create(properties) { - return new ResourceReference(properties); + HttpRule.create = function create(properties) { + return new HttpRule(properties); }; /** - * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. * @function encode - * @memberof google.api.ResourceReference + * @memberof google.api.HttpRule * @static - * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode + * @param {google.api.IHttpRule} message HttpRule message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ResourceReference.encode = function encode(message, writer) { + HttpRule.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.type != null && message.hasOwnProperty("type")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); - if (message.childType != null && message.hasOwnProperty("childType")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.childType); + if (message.selector != null && message.hasOwnProperty("selector")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector); + if (message.get != null && message.hasOwnProperty("get")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.get); + if (message.put != null && message.hasOwnProperty("put")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.put); + if (message.post != null && message.hasOwnProperty("post")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.post); + if (message["delete"] != null && message.hasOwnProperty("delete")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message["delete"]); + if (message.patch != null && message.hasOwnProperty("patch")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.patch); + if (message.body != null && message.hasOwnProperty("body")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.body); + if (message.custom != null && message.hasOwnProperty("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 && message.hasOwnProperty("responseBody")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.responseBody); return writer; }; /** - * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. * @function encodeDelimited - * @memberof google.api.ResourceReference + * @memberof google.api.HttpRule * @static - * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode + * @param {google.api.IHttpRule} message HttpRule message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ResourceReference.encodeDelimited = function encodeDelimited(message, writer) { + HttpRule.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ResourceReference message from the specified reader or buffer. + * Decodes a HttpRule message from the specified reader or buffer. * @function decode - * @memberof google.api.ResourceReference + * @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.ResourceReference} ResourceReference + * @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 */ - ResourceReference.decode = function decode(reader, length) { + 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.ResourceReference(); + 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.type = reader.string(); + message.selector = reader.string(); break; case 2: - message.childType = reader.string(); + 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); @@ -30273,118 +32466,240 @@ }; /** - * Decodes a ResourceReference message from the specified reader or buffer, length delimited. + * Decodes a HttpRule message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.api.ResourceReference + * @memberof google.api.HttpRule * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.ResourceReference} ResourceReference + * @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 */ - ResourceReference.decodeDelimited = function decodeDelimited(reader) { + HttpRule.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ResourceReference message. + * Verifies a HttpRule message. * @function verify - * @memberof google.api.ResourceReference + * @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 */ - ResourceReference.verify = function verify(message) { + HttpRule.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"; + 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 ResourceReference message from a plain object. Also converts values to their respective internal types. + * Creates a HttpRule message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.api.ResourceReference + * @memberof google.api.HttpRule * @static * @param {Object.} object Plain object - * @returns {google.api.ResourceReference} ResourceReference + * @returns {google.api.HttpRule} HttpRule */ - ResourceReference.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.ResourceReference) + HttpRule.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.HttpRule) 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); + 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 ResourceReference message. Also converts values to other types if specified. + * Creates a plain object from a HttpRule message. Also converts values to other types if specified. * @function toObject - * @memberof google.api.ResourceReference + * @memberof google.api.HttpRule * @static - * @param {google.api.ResourceReference} message ResourceReference + * @param {google.api.HttpRule} message HttpRule * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ResourceReference.toObject = function toObject(message, options) { + HttpRule.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) + object.additionalBindings = []; if (options.defaults) { - object.type = ""; - object.childType = ""; + object.selector = ""; + object.body = ""; + object.responseBody = ""; } - if (message.type != null && message.hasOwnProperty("type")) - object.type = message.type; - if (message.childType != null && message.hasOwnProperty("childType")) - object.childType = message.childType; + 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 ResourceReference to JSON. + * Converts this HttpRule to JSON. * @function toJSON - * @memberof google.api.ResourceReference + * @memberof google.api.HttpRule * @instance * @returns {Object.} JSON object */ - ResourceReference.prototype.toJSON = function toJSON() { + HttpRule.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ResourceReference; + return HttpRule; })(); - api.Http = (function() { + api.CustomHttpPattern = (function() { /** - * Properties of a Http. + * Properties of a CustomHttpPattern. * @memberof google.api - * @interface IHttp - * @property {Array.|null} [rules] Http rules - * @property {boolean|null} [fullyDecodeReservedExpansion] Http fullyDecodeReservedExpansion + * @interface ICustomHttpPattern + * @property {string|null} [kind] CustomHttpPattern kind + * @property {string|null} [path] CustomHttpPattern path */ /** - * Constructs a new Http. + * Constructs a new CustomHttpPattern. * @memberof google.api - * @classdesc Represents a Http. - * @implements IHttp + * @classdesc Represents a CustomHttpPattern. + * @implements ICustomHttpPattern * @constructor - * @param {google.api.IHttp=} [properties] Properties to set + * @param {google.api.ICustomHttpPattern=} [properties] Properties to set */ - function Http(properties) { - this.rules = []; + function CustomHttpPattern(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -30392,91 +32707,88 @@ } /** - * Http rules. - * @member {Array.} rules - * @memberof google.api.Http + * CustomHttpPattern kind. + * @member {string} kind + * @memberof google.api.CustomHttpPattern * @instance */ - Http.prototype.rules = $util.emptyArray; + CustomHttpPattern.prototype.kind = ""; /** - * Http fullyDecodeReservedExpansion. - * @member {boolean} fullyDecodeReservedExpansion - * @memberof google.api.Http + * CustomHttpPattern path. + * @member {string} path + * @memberof google.api.CustomHttpPattern * @instance */ - Http.prototype.fullyDecodeReservedExpansion = false; + CustomHttpPattern.prototype.path = ""; /** - * Creates a new Http instance using the specified properties. + * Creates a new CustomHttpPattern instance using the specified properties. * @function create - * @memberof google.api.Http + * @memberof google.api.CustomHttpPattern * @static - * @param {google.api.IHttp=} [properties] Properties to set - * @returns {google.api.Http} Http instance + * @param {google.api.ICustomHttpPattern=} [properties] Properties to set + * @returns {google.api.CustomHttpPattern} CustomHttpPattern instance */ - Http.create = function create(properties) { - return new Http(properties); + CustomHttpPattern.create = function create(properties) { + return new CustomHttpPattern(properties); }; /** - * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. + * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. * @function encode - * @memberof google.api.Http + * @memberof google.api.CustomHttpPattern * @static - * @param {google.api.IHttp} message Http message or plain object to encode + * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Http.encode = function encode(message, writer) { + CustomHttpPattern.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 && message.hasOwnProperty("fullyDecodeReservedExpansion")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.fullyDecodeReservedExpansion); + if (message.kind != null && message.hasOwnProperty("kind")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.kind); + if (message.path != null && message.hasOwnProperty("path")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.path); return writer; }; /** - * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. + * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. * @function encodeDelimited - * @memberof google.api.Http + * @memberof google.api.CustomHttpPattern * @static - * @param {google.api.IHttp} message Http message or plain object to encode + * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Http.encodeDelimited = function encodeDelimited(message, writer) { + CustomHttpPattern.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a Http message from the specified reader or buffer. + * Decodes a CustomHttpPattern message from the specified reader or buffer. * @function decode - * @memberof google.api.Http + * @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.Http} Http + * @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 */ - Http.decode = function decode(reader, length) { + 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.Http(); + 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: - if (!(message.rules && message.rules.length)) - message.rules = []; - message.rules.push($root.google.api.HttpRule.decode(reader, reader.uint32())); + message.kind = reader.string(); break; case 2: - message.fullyDecodeReservedExpansion = reader.bool(); + message.path = reader.string(); break; default: reader.skipType(tag & 7); @@ -30487,143 +32799,122 @@ }; /** - * Decodes a Http message from the specified reader or buffer, length delimited. + * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.api.Http + * @memberof google.api.CustomHttpPattern * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.Http} Http + * @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 */ - Http.decodeDelimited = function decodeDelimited(reader) { + CustomHttpPattern.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a Http message. + * Verifies a CustomHttpPattern message. * @function verify - * @memberof google.api.Http + * @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 */ - Http.verify = function verify(message) { + CustomHttpPattern.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"; + 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 Http message from a plain object. Also converts values to their respective internal types. + * Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.api.Http + * @memberof google.api.CustomHttpPattern * @static * @param {Object.} object Plain object - * @returns {google.api.Http} Http + * @returns {google.api.CustomHttpPattern} CustomHttpPattern */ - Http.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.Http) + CustomHttpPattern.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.CustomHttpPattern) 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); + 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 Http message. Also converts values to other types if specified. + * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. * @function toObject - * @memberof google.api.Http + * @memberof google.api.CustomHttpPattern * @static - * @param {google.api.Http} message Http + * @param {google.api.CustomHttpPattern} message CustomHttpPattern * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Http.toObject = function toObject(message, options) { + CustomHttpPattern.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 (options.defaults) { + object.kind = ""; + object.path = ""; } - if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) - object.fullyDecodeReservedExpansion = message.fullyDecodeReservedExpansion; + 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 Http to JSON. + * Converts this CustomHttpPattern to JSON. * @function toJSON - * @memberof google.api.Http + * @memberof google.api.CustomHttpPattern * @instance * @returns {Object.} JSON object */ - Http.prototype.toJSON = function toJSON() { + CustomHttpPattern.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return Http; + return CustomHttpPattern; })(); - api.HttpRule = (function() { + api.ResourceDescriptor = (function() { /** - * Properties of a HttpRule. + * Properties of a ResourceDescriptor. * @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 + * @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 */ /** - * Constructs a new HttpRule. + * Constructs a new ResourceDescriptor. * @memberof google.api - * @classdesc Represents a HttpRule. - * @implements IHttpRule + * @classdesc Represents a ResourceDescriptor. + * @implements IResourceDescriptor * @constructor - * @param {google.api.IHttpRule=} [properties] Properties to set + * @param {google.api.IResourceDescriptor=} [properties] Properties to set */ - function HttpRule(properties) { - this.additionalBindings = []; + function ResourceDescriptor(properties) { + this.pattern = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -30631,209 +32922,143 @@ } /** - * HttpRule selector. - * @member {string} selector - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.selector = ""; - - /** - * HttpRule get. - * @member {string} get - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.get = ""; - - /** - * HttpRule put. - * @member {string} put - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.put = ""; - - /** - * HttpRule post. - * @member {string} post - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.post = ""; - - /** - * HttpRule delete. - * @member {string} delete - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype["delete"] = ""; - - /** - * HttpRule patch. - * @member {string} patch - * @memberof google.api.HttpRule + * ResourceDescriptor type. + * @member {string} type + * @memberof google.api.ResourceDescriptor * @instance */ - HttpRule.prototype.patch = ""; + ResourceDescriptor.prototype.type = ""; /** - * HttpRule custom. - * @member {google.api.ICustomHttpPattern|null|undefined} custom - * @memberof google.api.HttpRule + * ResourceDescriptor pattern. + * @member {Array.} pattern + * @memberof google.api.ResourceDescriptor * @instance */ - HttpRule.prototype.custom = null; + ResourceDescriptor.prototype.pattern = $util.emptyArray; /** - * HttpRule body. - * @member {string} body - * @memberof google.api.HttpRule + * ResourceDescriptor nameField. + * @member {string} nameField + * @memberof google.api.ResourceDescriptor * @instance */ - HttpRule.prototype.body = ""; + ResourceDescriptor.prototype.nameField = ""; /** - * HttpRule responseBody. - * @member {string} responseBody - * @memberof google.api.HttpRule + * ResourceDescriptor history. + * @member {google.api.ResourceDescriptor.History} history + * @memberof google.api.ResourceDescriptor * @instance */ - HttpRule.prototype.responseBody = ""; + ResourceDescriptor.prototype.history = 0; /** - * HttpRule additionalBindings. - * @member {Array.} additionalBindings - * @memberof google.api.HttpRule + * ResourceDescriptor plural. + * @member {string} plural + * @memberof google.api.ResourceDescriptor * @instance */ - HttpRule.prototype.additionalBindings = $util.emptyArray; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + ResourceDescriptor.prototype.plural = ""; /** - * HttpRule pattern. - * @member {"get"|"put"|"post"|"delete"|"patch"|"custom"|undefined} pattern - * @memberof google.api.HttpRule + * ResourceDescriptor singular. + * @member {string} singular + * @memberof google.api.ResourceDescriptor * @instance */ - Object.defineProperty(HttpRule.prototype, "pattern", { - get: $util.oneOfGetter($oneOfFields = ["get", "put", "post", "delete", "patch", "custom"]), - set: $util.oneOfSetter($oneOfFields) - }); + ResourceDescriptor.prototype.singular = ""; /** - * Creates a new HttpRule instance using the specified properties. + * Creates a new ResourceDescriptor instance using the specified properties. * @function create - * @memberof google.api.HttpRule + * @memberof google.api.ResourceDescriptor * @static - * @param {google.api.IHttpRule=} [properties] Properties to set - * @returns {google.api.HttpRule} HttpRule instance + * @param {google.api.IResourceDescriptor=} [properties] Properties to set + * @returns {google.api.ResourceDescriptor} ResourceDescriptor instance */ - HttpRule.create = function create(properties) { - return new HttpRule(properties); + ResourceDescriptor.create = function create(properties) { + return new ResourceDescriptor(properties); }; /** - * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. * @function encode - * @memberof google.api.HttpRule + * @memberof google.api.ResourceDescriptor * @static - * @param {google.api.IHttpRule} message HttpRule message or plain object to encode + * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - HttpRule.encode = function encode(message, writer) { + ResourceDescriptor.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.selector != null && message.hasOwnProperty("selector")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector); - if (message.get != null && message.hasOwnProperty("get")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.get); - if (message.put != null && message.hasOwnProperty("put")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.put); - if (message.post != null && message.hasOwnProperty("post")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.post); - if (message["delete"] != null && message.hasOwnProperty("delete")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message["delete"]); - if (message.patch != null && message.hasOwnProperty("patch")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.patch); - if (message.body != null && message.hasOwnProperty("body")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.body); - if (message.custom != null && message.hasOwnProperty("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 && message.hasOwnProperty("responseBody")) - writer.uint32(/* id 12, wireType 2 =*/98).string(message.responseBody); + if (message.type != null && message.hasOwnProperty("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 && message.hasOwnProperty("nameField")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.nameField); + if (message.history != null && message.hasOwnProperty("history")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.history); + if (message.plural != null && message.hasOwnProperty("plural")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.plural); + if (message.singular != null && message.hasOwnProperty("singular")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.singular); return writer; }; /** - * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * Encodes the specified ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. * @function encodeDelimited - * @memberof google.api.HttpRule + * @memberof google.api.ResourceDescriptor * @static - * @param {google.api.IHttpRule} message HttpRule message or plain object to encode + * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - HttpRule.encodeDelimited = function encodeDelimited(message, writer) { + ResourceDescriptor.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a HttpRule message from the specified reader or buffer. + * Decodes a ResourceDescriptor message from the specified reader or buffer. * @function decode - * @memberof google.api.HttpRule + * @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.HttpRule} HttpRule + * @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 */ - HttpRule.decode = function decode(reader, length) { + 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.HttpRule(); + 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.selector = reader.string(); + message.type = reader.string(); break; case 2: - message.get = reader.string(); + if (!(message.pattern && message.pattern.length)) + message.pattern = []; + message.pattern.push(reader.string()); break; case 3: - message.put = reader.string(); + message.nameField = reader.string(); break; case 4: - message.post = reader.string(); + message.history = reader.int32(); break; case 5: - message["delete"] = reader.string(); + message.plural = 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())); + message.singular = reader.string(); break; default: reader.skipType(tag & 7); @@ -30844,240 +33069,196 @@ }; /** - * Decodes a HttpRule message from the specified reader or buffer, length delimited. + * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.api.HttpRule + * @memberof google.api.ResourceDescriptor * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.HttpRule} HttpRule + * @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 */ - HttpRule.decodeDelimited = function decodeDelimited(reader) { + ResourceDescriptor.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a HttpRule message. + * Verifies a ResourceDescriptor message. * @function verify - * @memberof google.api.HttpRule + * @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 */ - HttpRule.verify = function verify(message) { + ResourceDescriptor.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.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.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; + 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"; return null; }; /** - * Creates a HttpRule message from a plain object. Also converts values to their respective internal types. + * Creates a ResourceDescriptor message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.api.HttpRule + * @memberof google.api.ResourceDescriptor * @static * @param {Object.} object Plain object - * @returns {google.api.HttpRule} HttpRule + * @returns {google.api.ResourceDescriptor} ResourceDescriptor */ - HttpRule.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.HttpRule) + ResourceDescriptor.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.ResourceDescriptor) 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); + 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.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]); - } + if (object.nameField != null) + message.nameField = String(object.nameField); + switch (object.history) { + 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); return message; }; /** - * Creates a plain object from a HttpRule message. Also converts values to other types if specified. + * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. * @function toObject - * @memberof google.api.HttpRule + * @memberof google.api.ResourceDescriptor * @static - * @param {google.api.HttpRule} message HttpRule + * @param {google.api.ResourceDescriptor} message ResourceDescriptor * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - HttpRule.toObject = function toObject(message, options) { + ResourceDescriptor.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) - object.additionalBindings = []; + object.pattern = []; 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"; + object.type = ""; + object.nameField = ""; + object.history = options.enums === String ? "HISTORY_UNSPECIFIED" : 0; + object.plural = ""; + object.singular = ""; } - 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.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.responseBody != null && message.hasOwnProperty("responseBody")) - object.responseBody = message.responseBody; + 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] : message.history; + if (message.plural != null && message.hasOwnProperty("plural")) + object.plural = message.plural; + if (message.singular != null && message.hasOwnProperty("singular")) + object.singular = message.singular; return object; }; /** - * Converts this HttpRule to JSON. + * Converts this ResourceDescriptor to JSON. * @function toJSON - * @memberof google.api.HttpRule + * @memberof google.api.ResourceDescriptor * @instance * @returns {Object.} JSON object */ - HttpRule.prototype.toJSON = function toJSON() { + ResourceDescriptor.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return HttpRule; + /** + * History enum. + * @name google.api.ResourceDescriptor.History + * @enum {string} + * @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; + })(); + + return ResourceDescriptor; })(); - api.CustomHttpPattern = (function() { + api.ResourceReference = (function() { /** - * Properties of a CustomHttpPattern. + * Properties of a ResourceReference. * @memberof google.api - * @interface ICustomHttpPattern - * @property {string|null} [kind] CustomHttpPattern kind - * @property {string|null} [path] CustomHttpPattern path + * @interface IResourceReference + * @property {string|null} [type] ResourceReference type + * @property {string|null} [childType] ResourceReference childType */ /** - * Constructs a new CustomHttpPattern. + * Constructs a new ResourceReference. * @memberof google.api - * @classdesc Represents a CustomHttpPattern. - * @implements ICustomHttpPattern + * @classdesc Represents a ResourceReference. + * @implements IResourceReference * @constructor - * @param {google.api.ICustomHttpPattern=} [properties] Properties to set + * @param {google.api.IResourceReference=} [properties] Properties to set */ - function CustomHttpPattern(properties) { + function ResourceReference(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -31085,88 +33266,88 @@ } /** - * CustomHttpPattern kind. - * @member {string} kind - * @memberof google.api.CustomHttpPattern + * ResourceReference type. + * @member {string} type + * @memberof google.api.ResourceReference * @instance */ - CustomHttpPattern.prototype.kind = ""; + ResourceReference.prototype.type = ""; /** - * CustomHttpPattern path. - * @member {string} path - * @memberof google.api.CustomHttpPattern + * ResourceReference childType. + * @member {string} childType + * @memberof google.api.ResourceReference * @instance */ - CustomHttpPattern.prototype.path = ""; + ResourceReference.prototype.childType = ""; /** - * Creates a new CustomHttpPattern instance using the specified properties. + * Creates a new ResourceReference instance using the specified properties. * @function create - * @memberof google.api.CustomHttpPattern + * @memberof google.api.ResourceReference * @static - * @param {google.api.ICustomHttpPattern=} [properties] Properties to set - * @returns {google.api.CustomHttpPattern} CustomHttpPattern instance + * @param {google.api.IResourceReference=} [properties] Properties to set + * @returns {google.api.ResourceReference} ResourceReference instance */ - CustomHttpPattern.create = function create(properties) { - return new CustomHttpPattern(properties); + ResourceReference.create = function create(properties) { + return new ResourceReference(properties); }; /** - * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. * @function encode - * @memberof google.api.CustomHttpPattern + * @memberof google.api.ResourceReference * @static - * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode + * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CustomHttpPattern.encode = function encode(message, writer) { + ResourceReference.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.kind != null && message.hasOwnProperty("kind")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.kind); - if (message.path != null && message.hasOwnProperty("path")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.path); + if (message.type != null && message.hasOwnProperty("type")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); + if (message.childType != null && message.hasOwnProperty("childType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.childType); return writer; }; /** - * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. * @function encodeDelimited - * @memberof google.api.CustomHttpPattern + * @memberof google.api.ResourceReference * @static - * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode + * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CustomHttpPattern.encodeDelimited = function encodeDelimited(message, writer) { + ResourceReference.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a CustomHttpPattern message from the specified reader or buffer. + * Decodes a ResourceReference message from the specified reader or buffer. * @function decode - * @memberof google.api.CustomHttpPattern + * @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.CustomHttpPattern} CustomHttpPattern + * @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 */ - CustomHttpPattern.decode = function decode(reader, length) { + 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.CustomHttpPattern(); + 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.kind = reader.string(); + message.type = reader.string(); break; case 2: - message.path = reader.string(); + message.childType = reader.string(); break; default: reader.skipType(tag & 7); @@ -31177,96 +33358,96 @@ }; /** - * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. + * Decodes a ResourceReference message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.api.CustomHttpPattern + * @memberof google.api.ResourceReference * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.CustomHttpPattern} CustomHttpPattern + * @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 */ - CustomHttpPattern.decodeDelimited = function decodeDelimited(reader) { + ResourceReference.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a CustomHttpPattern message. + * Verifies a ResourceReference message. * @function verify - * @memberof google.api.CustomHttpPattern + * @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 */ - CustomHttpPattern.verify = function verify(message) { + ResourceReference.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"; + 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 CustomHttpPattern message from a plain object. Also converts values to their respective internal types. + * Creates a ResourceReference message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.api.CustomHttpPattern + * @memberof google.api.ResourceReference * @static * @param {Object.} object Plain object - * @returns {google.api.CustomHttpPattern} CustomHttpPattern + * @returns {google.api.ResourceReference} ResourceReference */ - CustomHttpPattern.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.CustomHttpPattern) + ResourceReference.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.ResourceReference) 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); + 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 CustomHttpPattern message. Also converts values to other types if specified. + * Creates a plain object from a ResourceReference message. Also converts values to other types if specified. * @function toObject - * @memberof google.api.CustomHttpPattern + * @memberof google.api.ResourceReference * @static - * @param {google.api.CustomHttpPattern} message CustomHttpPattern + * @param {google.api.ResourceReference} message ResourceReference * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CustomHttpPattern.toObject = function toObject(message, options) { + ResourceReference.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.kind = ""; - object.path = ""; + object.type = ""; + object.childType = ""; } - if (message.kind != null && message.hasOwnProperty("kind")) - object.kind = message.kind; - if (message.path != null && message.hasOwnProperty("path")) - object.path = message.path; + 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 CustomHttpPattern to JSON. + * Converts this ResourceReference to JSON. * @function toJSON - * @memberof google.api.CustomHttpPattern + * @memberof google.api.ResourceReference * @instance * @returns {Object.} JSON object */ - CustomHttpPattern.prototype.toJSON = function toJSON() { + ResourceReference.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return CustomHttpPattern; + return ResourceReference; })(); /** diff --git a/packages/google-cloud-securitycenter/protos/protos.json b/packages/google-cloud-securitycenter/protos/protos.json index 8a300d7912b..c3eda832731 100644 --- a/packages/google-cloud-securitycenter/protos/protos.json +++ b/packages/google-cloud-securitycenter/protos/protos.json @@ -13,7 +13,10 @@ "java_multiple_files": true, "java_package": "com.google.cloud.securitycenter.v1", "php_namespace": "Google\\Cloud\\SecurityCenter\\V1", - "ruby_package": "Google::Cloud::SecurityCenter::V1" + "ruby_package": "Google::Cloud::SecurityCenter::V1", + "java_outer_classname": "NotificationMessageProto", + "(google.api.resource_definition).type": "pubsub.googleapis.com/Topic", + "(google.api.resource_definition).pattern": "projects/{project}/topics/{topic}" }, "nested": { "Asset": { @@ -178,6 +181,76 @@ } } }, + "NotificationConfig": { + "options": { + "(google.api.resource).type": "securitycenter.googleapis.com/NotificationConfig", + "(google.api.resource).pattern": "organizations/{organization}/notificationConfigs/{notification_config}" + }, + "oneofs": { + "notifyConfig": { + "oneof": [ + "streamingConfig" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "description": { + "type": "string", + "id": 2 + }, + "pubsubTopic": { + "type": "string", + "id": 3, + "options": { + "(google.api.resource_reference).type": "pubsub.googleapis.com/Topic" + } + }, + "serviceAccount": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "streamingConfig": { + "type": "StreamingConfig", + "id": 5 + } + }, + "nested": { + "StreamingConfig": { + "fields": { + "filter": { + "type": "string", + "id": 1 + } + } + } + } + }, + "NotificationMessage": { + "oneofs": { + "event": { + "oneof": [ + "finding" + ] + } + }, + "fields": { + "notificationConfigName": { + "type": "string", + "id": 1 + }, + "finding": { + "type": "Finding", + "id": 2 + } + } + }, "OrganizationSettings": { "options": { "(google.api.resource).type": "securitycenter.googleapis.com/OrganizationSettings", @@ -268,6 +341,23 @@ "(google.api.method_signature)": "parent,finding_id,finding" } }, + "CreateNotificationConfig": { + "requestType": "CreateNotificationConfigRequest", + "responseType": "NotificationConfig", + "options": { + "(google.api.http).post": "/v1/{parent=organizations/*}/notificationConfigs", + "(google.api.http).body": "notification_config", + "(google.api.method_signature)": "parent,notification_config" + } + }, + "DeleteNotificationConfig": { + "requestType": "DeleteNotificationConfigRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/{name=organizations/*/notificationConfigs/*}", + "(google.api.method_signature)": "name" + } + }, "GetIamPolicy": { "requestType": "google.iam.v1.GetIamPolicyRequest", "responseType": "google.iam.v1.Policy", @@ -277,6 +367,14 @@ "(google.api.method_signature)": "resource" } }, + "GetNotificationConfig": { + "requestType": "GetNotificationConfigRequest", + "responseType": "NotificationConfig", + "options": { + "(google.api.http).get": "/v1/{name=organizations/*/notificationConfigs/*}", + "(google.api.method_signature)": "name" + } + }, "GetOrganizationSettings": { "requestType": "GetOrganizationSettingsRequest", "responseType": "OrganizationSettings", @@ -324,6 +422,14 @@ "(google.api.http).get": "/v1/{parent=organizations/*/sources/*}/findings" } }, + "ListNotificationConfigs": { + "requestType": "ListNotificationConfigsRequest", + "responseType": "ListNotificationConfigsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=organizations/*}/notificationConfigs", + "(google.api.method_signature)": "parent" + } + }, "ListSources": { "requestType": "ListSourcesRequest", "responseType": "ListSourcesResponse", @@ -379,6 +485,15 @@ "(google.api.method_signature)": "finding" } }, + "UpdateNotificationConfig": { + "requestType": "UpdateNotificationConfigRequest", + "responseType": "NotificationConfig", + "options": { + "(google.api.http).patch": "/v1/{notification_config.name=organizations/*/notificationConfigs/*}", + "(google.api.http).body": "notification_config", + "(google.api.method_signature)": "notification_config,update_mask" + } + }, "UpdateOrganizationSettings": { "requestType": "UpdateOrganizationSettingsRequest", "responseType": "OrganizationSettings", @@ -436,6 +551,32 @@ } } }, + "CreateNotificationConfigRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudresourcemanager.googleapis.com/Organization" + } + }, + "configId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "notificationConfig": { + "type": "NotificationConfig", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, "CreateSourceRequest": { "fields": { "parent": { @@ -455,6 +596,30 @@ } } }, + "DeleteNotificationConfigRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "securitycenter.googleapis.com/NotificationConfig" + } + } + } + }, + "GetNotificationConfigRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "securitycenter.googleapis.com/NotificationConfig" + } + } + } + }, "GetOrganizationSettingsRequest": { "fields": { "name": { @@ -612,6 +777,39 @@ } } }, + "ListNotificationConfigsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudresourcemanager.googleapis.com/Organization" + } + }, + "pageToken": { + "type": "string", + "id": 2 + }, + "pageSize": { + "type": "int32", + "id": 3 + } + } + }, + "ListNotificationConfigsResponse": { + "fields": { + "notificationConfigs": { + "rule": "repeated", + "type": "NotificationConfig", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, "ListSourcesRequest": { "fields": { "parent": { @@ -903,6 +1101,21 @@ } } }, + "UpdateNotificationConfigRequest": { + "fields": { + "notificationConfig": { + "type": "NotificationConfig", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2 + } + } + }, "UpdateOrganizationSettingsRequest": { "fields": { "organizationSettings": { @@ -3063,80 +3276,14 @@ }, "api": { "options": { - "cc_enable_arenas": true, "go_package": "google.golang.org/genproto/googleapis/api/annotations;annotations", "java_multiple_files": true, "java_outer_classname": "ClientProto", "java_package": "com.google.api", - "objc_class_prefix": "GAPI" + "objc_class_prefix": "GAPI", + "cc_enable_arenas": true }, "nested": { - "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 - } - }, - "nested": { - "History": { - "values": { - "HISTORY_UNSPECIFIED": 0, - "ORIGINALLY_SINGLE_PATTERN": 1, - "FUTURE_MULTI_PATTERN": 2 - } - } - } - }, - "ResourceReference": { - "fields": { - "type": { - "type": "string", - "id": 1 - }, - "childType": { - "type": "string", - "id": 2 - } - } - }, "http": { "type": "HttpRule", "id": 72295728, @@ -3224,6 +3371,72 @@ } } }, + "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 + } + }, + "nested": { + "History": { + "values": { + "HISTORY_UNSPECIFIED": 0, + "ORIGINALLY_SINGLE_PATTERN": 1, + "FUTURE_MULTI_PATTERN": 2 + } + } + } + }, + "ResourceReference": { + "fields": { + "type": { + "type": "string", + "id": 1 + }, + "childType": { + "type": "string", + "id": 2 + } + } + }, "fieldBehavior": { "rule": "repeated", "type": "google.api.FieldBehavior", diff --git a/packages/google-cloud-securitycenter/src/v1/security_center_client.ts b/packages/google-cloud-securitycenter/src/v1/security_center_client.ts index fd760cfe395..b77b522f2e1 100644 --- a/packages/google-cloud-securitycenter/src/v1/security_center_client.ts +++ b/packages/google-cloud-securitycenter/src/v1/security_center_client.ts @@ -150,6 +150,9 @@ export class SecurityCenterClient { findingPathTemplate: new gaxModule.PathTemplate( 'organizations/{organization}/sources/{source}/findings/{finding}' ), + notificationConfigPathTemplate: new gaxModule.PathTemplate( + 'organizations/{organization}/notificationConfigs/{notification_config}' + ), organizationPathTemplate: new gaxModule.PathTemplate( 'organizations/{organization}' ), @@ -191,6 +194,11 @@ export class SecurityCenterClient { 'nextPageToken', 'listFindingsResults' ), + listNotificationConfigs: new gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'notificationConfigs' + ), listSources: new gaxModule.PageDescriptor( 'pageToken', 'nextPageToken', @@ -256,19 +264,24 @@ export class SecurityCenterClient { const securityCenterStubMethods = [ 'createSource', 'createFinding', + 'createNotificationConfig', + 'deleteNotificationConfig', 'getIamPolicy', + 'getNotificationConfig', 'getOrganizationSettings', 'getSource', 'groupAssets', 'groupFindings', 'listAssets', 'listFindings', + 'listNotificationConfigs', 'listSources', 'runAssetDiscovery', 'setFindingState', 'setIamPolicy', 'testIamPermissions', 'updateFinding', + 'updateNotificationConfig', 'updateOrganizationSettings', 'updateSource', 'updateSecurityMarks', @@ -387,8 +400,8 @@ export class SecurityCenterClient { * Required. Resource name of the new source's parent. Its format should be * "organizations/[organization_id]". * @param {google.cloud.securitycenter.v1.Source} request.source - * Required. The Source being created, only the display_name and description will be - * used. All other fields will be ignored. + * Required. The Source being created, only the display_name and description + * will be used. All other fields will be ignored. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -476,8 +489,8 @@ export class SecurityCenterClient { * It must be alphanumeric and less than or equal to 32 characters and * greater than 0 characters in length. * @param {google.cloud.securitycenter.v1.Finding} request.finding - * Required. The Finding being created. The name and security_marks will be ignored as - * they are both output only fields on this resource. + * Required. The Finding being created. The name and security_marks will be + * ignored as they are both output only fields on this resource. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -528,6 +541,185 @@ export class SecurityCenterClient { }); return this._innerApiCalls.createFinding(request, options, callback); } + createNotificationConfig( + request: protosTypes.google.cloud.securitycenter.v1.ICreateNotificationConfigRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.cloud.securitycenter.v1.INotificationConfig, + ( + | protosTypes.google.cloud.securitycenter.v1.ICreateNotificationConfigRequest + | undefined + ), + {} | undefined + ] + >; + createNotificationConfig( + request: protosTypes.google.cloud.securitycenter.v1.ICreateNotificationConfigRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.cloud.securitycenter.v1.INotificationConfig, + | protosTypes.google.cloud.securitycenter.v1.ICreateNotificationConfigRequest + | undefined, + {} | undefined + > + ): void; + /** + * Creates a notification config. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Resource name of the new notification config's parent. Its format + * is "organizations/[organization_id]". + * @param {string} request.configId + * Required. + * Unique identifier provided by the client within the parent scope. + * It must be between 1 and 128 characters, and contains alphanumeric + * characters, underscores or hyphens only. + * @param {google.cloud.securitycenter.v1.NotificationConfig} request.notificationConfig + * Required. The notification config being created. The name and the service + * account will be ignored as they are both output only fields on this + * resource. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [NotificationConfig]{@link google.cloud.securitycenter.v1.NotificationConfig}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + createNotificationConfig( + request: protosTypes.google.cloud.securitycenter.v1.ICreateNotificationConfigRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.cloud.securitycenter.v1.INotificationConfig, + | protosTypes.google.cloud.securitycenter.v1.ICreateNotificationConfigRequest + | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.cloud.securitycenter.v1.INotificationConfig, + | protosTypes.google.cloud.securitycenter.v1.ICreateNotificationConfigRequest + | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.cloud.securitycenter.v1.INotificationConfig, + ( + | protosTypes.google.cloud.securitycenter.v1.ICreateNotificationConfigRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + return this._innerApiCalls.createNotificationConfig( + request, + options, + callback + ); + } + deleteNotificationConfig( + request: protosTypes.google.cloud.securitycenter.v1.IDeleteNotificationConfigRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.protobuf.IEmpty, + ( + | protosTypes.google.cloud.securitycenter.v1.IDeleteNotificationConfigRequest + | undefined + ), + {} | undefined + ] + >; + deleteNotificationConfig( + request: protosTypes.google.cloud.securitycenter.v1.IDeleteNotificationConfigRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.protobuf.IEmpty, + | protosTypes.google.cloud.securitycenter.v1.IDeleteNotificationConfigRequest + | undefined, + {} | undefined + > + ): void; + /** + * Deletes a notification config. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the notification config to delete. Its format is + * "organizations/[organization_id]/notificationConfigs/[config_id]". + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + deleteNotificationConfig( + request: protosTypes.google.cloud.securitycenter.v1.IDeleteNotificationConfigRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.protobuf.IEmpty, + | protosTypes.google.cloud.securitycenter.v1.IDeleteNotificationConfigRequest + | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.protobuf.IEmpty, + | protosTypes.google.cloud.securitycenter.v1.IDeleteNotificationConfigRequest + | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.protobuf.IEmpty, + ( + | protosTypes.google.cloud.securitycenter.v1.IDeleteNotificationConfigRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + name: request.name || '', + }); + return this._innerApiCalls.deleteNotificationConfig( + request, + options, + callback + ); + } getIamPolicy( request: protosTypes.google.iam.v1.IGetIamPolicyRequest, options?: gax.CallOptions @@ -597,6 +789,91 @@ export class SecurityCenterClient { }); return this._innerApiCalls.getIamPolicy(request, options, callback); } + getNotificationConfig( + request: protosTypes.google.cloud.securitycenter.v1.IGetNotificationConfigRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.cloud.securitycenter.v1.INotificationConfig, + ( + | protosTypes.google.cloud.securitycenter.v1.IGetNotificationConfigRequest + | undefined + ), + {} | undefined + ] + >; + getNotificationConfig( + request: protosTypes.google.cloud.securitycenter.v1.IGetNotificationConfigRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.cloud.securitycenter.v1.INotificationConfig, + | protosTypes.google.cloud.securitycenter.v1.IGetNotificationConfigRequest + | undefined, + {} | undefined + > + ): void; + /** + * Gets a notification config. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the notification config to get. Its format is + * "organizations/[organization_id]/notificationConfigs/[config_id]". + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [NotificationConfig]{@link google.cloud.securitycenter.v1.NotificationConfig}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + getNotificationConfig( + request: protosTypes.google.cloud.securitycenter.v1.IGetNotificationConfigRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.cloud.securitycenter.v1.INotificationConfig, + | protosTypes.google.cloud.securitycenter.v1.IGetNotificationConfigRequest + | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.cloud.securitycenter.v1.INotificationConfig, + | protosTypes.google.cloud.securitycenter.v1.IGetNotificationConfigRequest + | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.cloud.securitycenter.v1.INotificationConfig, + ( + | protosTypes.google.cloud.securitycenter.v1.IGetNotificationConfigRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + name: request.name || '', + }); + return this._innerApiCalls.getNotificationConfig( + request, + options, + callback + ); + } getOrganizationSettings( request: protosTypes.google.cloud.securitycenter.v1.IGetOrganizationSettingsRequest, options?: gax.CallOptions @@ -626,8 +903,8 @@ export class SecurityCenterClient { * @param {Object} request * The request object that will be sent. * @param {string} request.name - * Required. Name of the organization to get organization settings for. Its format is - * "organizations/[organization_id]/organizationSettings". + * Required. Name of the organization to get organization settings for. Its + * format is "organizations/[organization_id]/organizationSettings". * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -1010,8 +1287,8 @@ export class SecurityCenterClient { * @param {Object} request * The request object that will be sent. * @param {google.cloud.securitycenter.v1.Finding} request.finding - * Required. The finding resource to update or create if it does not already exist. - * parent, security_marks, and update_time will be ignored. + * Required. The finding resource to update or create if it does not already + * exist. parent, security_marks, and update_time will be ignored. * * In the case of creation, the finding id portion of the name must be * alphanumeric and less than or equal to 32 characters and greater than 0 @@ -1074,6 +1351,95 @@ export class SecurityCenterClient { }); return this._innerApiCalls.updateFinding(request, options, callback); } + updateNotificationConfig( + request: protosTypes.google.cloud.securitycenter.v1.IUpdateNotificationConfigRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.cloud.securitycenter.v1.INotificationConfig, + ( + | protosTypes.google.cloud.securitycenter.v1.IUpdateNotificationConfigRequest + | undefined + ), + {} | undefined + ] + >; + updateNotificationConfig( + request: protosTypes.google.cloud.securitycenter.v1.IUpdateNotificationConfigRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.cloud.securitycenter.v1.INotificationConfig, + | protosTypes.google.cloud.securitycenter.v1.IUpdateNotificationConfigRequest + | undefined, + {} | undefined + > + ): void; + /** + * + * Updates a notification config. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.securitycenter.v1.NotificationConfig} request.notificationConfig + * Required. The notification config to update. + * @param {google.protobuf.FieldMask} request.updateMask + * The FieldMask to use when updating the notification config. + * + * If empty all mutable fields will be updated. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [NotificationConfig]{@link google.cloud.securitycenter.v1.NotificationConfig}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + updateNotificationConfig( + request: protosTypes.google.cloud.securitycenter.v1.IUpdateNotificationConfigRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.cloud.securitycenter.v1.INotificationConfig, + | protosTypes.google.cloud.securitycenter.v1.IUpdateNotificationConfigRequest + | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.cloud.securitycenter.v1.INotificationConfig, + | protosTypes.google.cloud.securitycenter.v1.IUpdateNotificationConfigRequest + | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.cloud.securitycenter.v1.INotificationConfig, + ( + | protosTypes.google.cloud.securitycenter.v1.IUpdateNotificationConfigRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'notification_config.name': request.notificationConfig!.name || '', + }); + return this._innerApiCalls.updateNotificationConfig( + request, + options, + callback + ); + } updateOrganizationSettings( request: protosTypes.google.cloud.securitycenter.v1.IUpdateOrganizationSettingsRequest, options?: gax.CallOptions @@ -1373,8 +1739,8 @@ export class SecurityCenterClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. Name of the organization to run asset discovery for. Its format is - * "organizations/[organization_id]". + * Required. Name of the organization to run asset discovery for. Its format + * is "organizations/[organization_id]". * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -1515,9 +1881,9 @@ export class SecurityCenterClient { * * For example, `resource_properties.size = 100` is a valid filter string. * @param {string} request.groupBy - * Required. Expression that defines what assets fields to use for grouping. The string - * value should follow SQL syntax: comma separated list of fields. For - * example: + * Required. Expression that defines what assets fields to use for grouping. + * The string value should follow SQL syntax: comma separated list of fields. + * For example: * "security_center_properties.resource_project,security_center_properties.project". * * The following fields are supported when compare_duration is not set: @@ -1707,9 +2073,9 @@ export class SecurityCenterClient { * * For example, `resource_properties.size = 100` is a valid filter string. * @param {string} request.groupBy - * Required. Expression that defines what assets fields to use for grouping. The string - * value should follow SQL syntax: comma separated list of fields. For - * example: + * Required. Expression that defines what assets fields to use for grouping. + * The string value should follow SQL syntax: comma separated list of fields. + * For example: * "security_center_properties.resource_project,security_center_properties.project". * * The following fields are supported when compare_duration is not set: @@ -1868,9 +2234,9 @@ export class SecurityCenterClient { * * For example, `source_properties.size = 100` is a valid filter string. * @param {string} request.groupBy - * Required. Expression that defines what assets fields to use for grouping (including - * `state_change`). The string value should follow SQL syntax: comma separated - * list of fields. For example: "parent,resource_name". + * Required. Expression that defines what assets fields to use for grouping + * (including `state_change`). The string value should follow SQL syntax: + * comma separated list of fields. For example: "parent,resource_name". * * The following fields are supported: * @@ -1901,12 +2267,18 @@ export class SecurityCenterClient { * * Possible "state_change" values when compare_duration is specified: * - * * "CHANGED": indicates that the finding was present at the start of - * compare_duration, but changed its state at read_time. - * * "UNCHANGED": indicates that the finding was present at the start of - * compare_duration and did not change state at read_time. - * * "ADDED": indicates that the finding was not present at the start - * of compare_duration, but was present at read_time. + * * "CHANGED": indicates that the finding was present and matched the given + * filter at the start of compare_duration, but changed its + * state at read_time. + * * "UNCHANGED": indicates that the finding was present and matched the given + * filter at the start of compare_duration and did not change + * state at read_time. + * * "ADDED": indicates that the finding did not match the given filter or + * was not present at the start of compare_duration, but was + * present at read_time. + * * "REMOVED": indicates that the finding was present and matched the + * filter at the start of compare_duration, but did not match + * the filter at read_time. * * If compare_duration is not specified, then the only possible state_change * is "UNUSED", which will be the state_change set for all findings present @@ -2044,9 +2416,9 @@ export class SecurityCenterClient { * * For example, `source_properties.size = 100` is a valid filter string. * @param {string} request.groupBy - * Required. Expression that defines what assets fields to use for grouping (including - * `state_change`). The string value should follow SQL syntax: comma separated - * list of fields. For example: "parent,resource_name". + * Required. Expression that defines what assets fields to use for grouping + * (including `state_change`). The string value should follow SQL syntax: + * comma separated list of fields. For example: "parent,resource_name". * * The following fields are supported: * @@ -2077,12 +2449,18 @@ export class SecurityCenterClient { * * Possible "state_change" values when compare_duration is specified: * - * * "CHANGED": indicates that the finding was present at the start of - * compare_duration, but changed its state at read_time. - * * "UNCHANGED": indicates that the finding was present at the start of - * compare_duration and did not change state at read_time. - * * "ADDED": indicates that the finding was not present at the start - * of compare_duration, but was present at read_time. + * * "CHANGED": indicates that the finding was present and matched the given + * filter at the start of compare_duration, but changed its + * state at read_time. + * * "UNCHANGED": indicates that the finding was present and matched the given + * filter at the start of compare_duration and did not change + * state at read_time. + * * "ADDED": indicates that the finding did not match the given filter or + * was not present at the start of compare_duration, but was + * present at read_time. + * * "REMOVED": indicates that the finding was present and matched the + * filter at the start of compare_duration, but did not match + * the filter at read_time. * * If compare_duration is not specified, then the only possible state_change * is "UNUSED", which will be the state_change set for all findings present @@ -2259,9 +2637,8 @@ export class SecurityCenterClient { * is "UNUSED", which will be the state_change set for all assets present at * read_time. * @param {google.protobuf.FieldMask} [request.fieldMask] - * Optional. A field mask to specify the ListAssetsResult fields to be listed in the - * response. - * An empty field mask will list all fields. + * Optional. A field mask to specify the ListAssetsResult fields to be listed + * in the response. An empty field mask will list all fields. * @param {string} request.pageToken * The value returned by the last `ListAssetsResponse`; indicates * that this is a continuation of a prior `ListAssets` call, and @@ -2455,9 +2832,8 @@ export class SecurityCenterClient { * is "UNUSED", which will be the state_change set for all assets present at * read_time. * @param {google.protobuf.FieldMask} [request.fieldMask] - * Optional. A field mask to specify the ListAssetsResult fields to be listed in the - * response. - * An empty field mask will list all fields. + * Optional. A field mask to specify the ListAssetsResult fields to be listed + * in the response. An empty field mask will list all fields. * @param {string} request.pageToken * The value returned by the last `ListAssetsResponse`; indicates * that this is a continuation of a prior `ListAssets` call, and @@ -2605,19 +2981,25 @@ export class SecurityCenterClient { * * Possible "state_change" values when compare_duration is specified: * - * * "CHANGED": indicates that the finding was present at the start of - * compare_duration, but changed its state at read_time. - * * "UNCHANGED": indicates that the finding was present at the start of - * compare_duration and did not change state at read_time. - * * "ADDED": indicates that the finding was not present at the start - * of compare_duration, but was present at read_time. + * * "CHANGED": indicates that the finding was present and matched the given + * filter at the start of compare_duration, but changed its + * state at read_time. + * * "UNCHANGED": indicates that the finding was present and matched the given + * filter at the start of compare_duration and did not change + * state at read_time. + * * "ADDED": indicates that the finding did not match the given filter or + * was not present at the start of compare_duration, but was + * present at read_time. + * * "REMOVED": indicates that the finding was present and matched the + * filter at the start of compare_duration, but did not match + * the filter at read_time. * * If compare_duration is not specified, then the only possible state_change * is "UNUSED", which will be the state_change set for all findings present at * read_time. * @param {google.protobuf.FieldMask} [request.fieldMask] - * Optional. A field mask to specify the Finding fields to be listed in the response. - * An empty field mask will list all fields. + * Optional. A field mask to specify the Finding fields to be listed in the + * response. An empty field mask will list all fields. * @param {string} request.pageToken * The value returned by the last `ListFindingsResponse`; indicates * that this is a continuation of a prior `ListFindings` call, and @@ -2786,19 +3168,25 @@ export class SecurityCenterClient { * * Possible "state_change" values when compare_duration is specified: * - * * "CHANGED": indicates that the finding was present at the start of - * compare_duration, but changed its state at read_time. - * * "UNCHANGED": indicates that the finding was present at the start of - * compare_duration and did not change state at read_time. - * * "ADDED": indicates that the finding was not present at the start - * of compare_duration, but was present at read_time. + * * "CHANGED": indicates that the finding was present and matched the given + * filter at the start of compare_duration, but changed its + * state at read_time. + * * "UNCHANGED": indicates that the finding was present and matched the given + * filter at the start of compare_duration and did not change + * state at read_time. + * * "ADDED": indicates that the finding did not match the given filter or + * was not present at the start of compare_duration, but was + * present at read_time. + * * "REMOVED": indicates that the finding was present and matched the + * filter at the start of compare_duration, but did not match + * the filter at read_time. * * If compare_duration is not specified, then the only possible state_change * is "UNUSED", which will be the state_change set for all findings present at * read_time. * @param {google.protobuf.FieldMask} [request.fieldMask] - * Optional. A field mask to specify the Finding fields to be listed in the response. - * An empty field mask will list all fields. + * Optional. A field mask to specify the Finding fields to be listed in the + * response. An empty field mask will list all fields. * @param {string} request.pageToken * The value returned by the last `ListFindingsResponse`; indicates * that this is a continuation of a prior `ListFindings` call, and @@ -2831,6 +3219,152 @@ export class SecurityCenterClient { callSettings ); } + listNotificationConfigs( + request: protosTypes.google.cloud.securitycenter.v1.IListNotificationConfigsRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.cloud.securitycenter.v1.INotificationConfig[], + protosTypes.google.cloud.securitycenter.v1.IListNotificationConfigsRequest | null, + protosTypes.google.cloud.securitycenter.v1.IListNotificationConfigsResponse + ] + >; + listNotificationConfigs( + request: protosTypes.google.cloud.securitycenter.v1.IListNotificationConfigsRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.cloud.securitycenter.v1.INotificationConfig[], + protosTypes.google.cloud.securitycenter.v1.IListNotificationConfigsRequest | null, + protosTypes.google.cloud.securitycenter.v1.IListNotificationConfigsResponse + > + ): void; + /** + * Lists notification configs. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Name of the organization to list notification configs. + * Its format is "organizations/[organization_id]". + * @param {string} request.pageToken + * The value returned by the last `ListNotificationConfigsResponse`; indicates + * that this is a continuation of a prior `ListNotificationConfigs` call, and + * that the system should return the next page of data. + * @param {number} request.pageSize + * The maximum number of results to return in a single response. Default is + * 10, minimum is 1, maximum is 1000. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [NotificationConfig]{@link google.cloud.securitycenter.v1.NotificationConfig}. + * The client library support auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * + * When autoPaginate: false is specified through options, the array has three elements. + * The first element is Array of [NotificationConfig]{@link google.cloud.securitycenter.v1.NotificationConfig} that corresponds to + * the one page received from the API server. + * If the second element is not null it contains the request object of type [ListNotificationConfigsRequest]{@link google.cloud.securitycenter.v1.ListNotificationConfigsRequest} + * that can be used to obtain the next page of the results. + * If it is null, the next page does not exist. + * The third element contains the raw response received from the API server. Its type is + * [ListNotificationConfigsResponse]{@link google.cloud.securitycenter.v1.ListNotificationConfigsResponse}. + * + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + listNotificationConfigs( + request: protosTypes.google.cloud.securitycenter.v1.IListNotificationConfigsRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.cloud.securitycenter.v1.INotificationConfig[], + protosTypes.google.cloud.securitycenter.v1.IListNotificationConfigsRequest | null, + protosTypes.google.cloud.securitycenter.v1.IListNotificationConfigsResponse + >, + callback?: Callback< + protosTypes.google.cloud.securitycenter.v1.INotificationConfig[], + protosTypes.google.cloud.securitycenter.v1.IListNotificationConfigsRequest | null, + protosTypes.google.cloud.securitycenter.v1.IListNotificationConfigsResponse + > + ): Promise< + [ + protosTypes.google.cloud.securitycenter.v1.INotificationConfig[], + protosTypes.google.cloud.securitycenter.v1.IListNotificationConfigsRequest | null, + protosTypes.google.cloud.securitycenter.v1.IListNotificationConfigsResponse + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + return this._innerApiCalls.listNotificationConfigs( + request, + options, + callback + ); + } + + /** + * Equivalent to {@link listNotificationConfigs}, but returns a NodeJS Stream object. + * + * This fetches the paged responses for {@link listNotificationConfigs} continuously + * and invokes the callback registered for 'data' event for each element in the + * responses. + * + * The returned object has 'end' method when no more elements are required. + * + * autoPaginate option will be ignored. + * + * @see {@link https://nodejs.org/api/stream.html} + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Name of the organization to list notification configs. + * Its format is "organizations/[organization_id]". + * @param {string} request.pageToken + * The value returned by the last `ListNotificationConfigsResponse`; indicates + * that this is a continuation of a prior `ListNotificationConfigs` call, and + * that the system should return the next page of data. + * @param {number} request.pageSize + * The maximum number of results to return in a single response. Default is + * 10, minimum is 1, maximum is 1000. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [NotificationConfig]{@link google.cloud.securitycenter.v1.NotificationConfig} on 'data' event. + */ + listNotificationConfigsStream( + request?: protosTypes.google.cloud.securitycenter.v1.IListNotificationConfigsRequest, + options?: gax.CallOptions + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + const callSettings = new gax.CallSettings(options); + return this._descriptors.page.listNotificationConfigs.createStream( + this._innerApiCalls.listNotificationConfigs as gax.GaxCall, + request, + callSettings + ); + } listSources( request: protosTypes.google.cloud.securitycenter.v1.IListSourcesRequest, options?: gax.CallOptions @@ -2856,8 +3390,8 @@ export class SecurityCenterClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. Resource name of the parent of sources to list. Its format should be - * "organizations/[organization_id]". + * Required. Resource name of the parent of sources to list. Its format should + * be "organizations/[organization_id]". * @param {string} request.pageToken * The value returned by the last `ListSourcesResponse`; indicates * that this is a continuation of a prior `ListSources` call, and @@ -2939,8 +3473,8 @@ export class SecurityCenterClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. Resource name of the parent of sources to list. Its format should be - * "organizations/[organization_id]". + * Required. Resource name of the parent of sources to list. Its format should + * be "organizations/[organization_id]". * @param {string} request.pageToken * The value returned by the last `ListSourcesResponse`; indicates * that this is a continuation of a prior `ListSources` call, and @@ -3063,6 +3597,48 @@ export class SecurityCenterClient { return this._pathTemplates.findingPathTemplate.match(findingName).finding; } + /** + * Return a fully-qualified notificationConfig resource name string. + * + * @param {string} organization + * @param {string} notification_config + * @returns {string} Resource name string. + */ + notificationConfigPath(organization: string, notificationConfig: string) { + return this._pathTemplates.notificationConfigPathTemplate.render({ + organization, + notification_config: notificationConfig, + }); + } + + /** + * Parse the organization from NotificationConfig resource. + * + * @param {string} notificationConfigName + * A fully-qualified path representing NotificationConfig resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromNotificationConfigName(notificationConfigName: string) { + return this._pathTemplates.notificationConfigPathTemplate.match( + notificationConfigName + ).organization; + } + + /** + * Parse the notification_config from NotificationConfig resource. + * + * @param {string} notificationConfigName + * A fully-qualified path representing NotificationConfig resource. + * @returns {string} A string representing the notification_config. + */ + matchNotificationConfigFromNotificationConfigName( + notificationConfigName: string + ) { + return this._pathTemplates.notificationConfigPathTemplate.match( + notificationConfigName + ).notification_config; + } + /** * Return a fully-qualified organization resource name string. * diff --git a/packages/google-cloud-securitycenter/src/v1/security_center_client_config.json b/packages/google-cloud-securitycenter/src/v1/security_center_client_config.json index 3fbeac794f2..7e9fa71b14b 100644 --- a/packages/google-cloud-securitycenter/src/v1/security_center_client_config.json +++ b/packages/google-cloud-securitycenter/src/v1/security_center_client_config.json @@ -30,11 +30,26 @@ "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, + "CreateNotificationConfig": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteNotificationConfig": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, "GetIamPolicy": { "timeout_millis": 60000, "retry_codes_name": "idempotent", "retry_params_name": "default" }, + "GetNotificationConfig": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, "GetOrganizationSettings": { "timeout_millis": 60000, "retry_codes_name": "idempotent", @@ -65,6 +80,11 @@ "retry_codes_name": "idempotent", "retry_params_name": "default" }, + "ListNotificationConfigs": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, "ListSources": { "timeout_millis": 60000, "retry_codes_name": "idempotent", @@ -95,6 +115,11 @@ "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, + "UpdateNotificationConfig": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, "UpdateOrganizationSettings": { "timeout_millis": 60000, "retry_codes_name": "non_idempotent", diff --git a/packages/google-cloud-securitycenter/src/v1/security_center_proto_list.json b/packages/google-cloud-securitycenter/src/v1/security_center_proto_list.json index 37094e069a4..68e68f8751a 100644 --- a/packages/google-cloud-securitycenter/src/v1/security_center_proto_list.json +++ b/packages/google-cloud-securitycenter/src/v1/security_center_proto_list.json @@ -1,6 +1,8 @@ [ "../../protos/google/cloud/securitycenter/v1/asset.proto", "../../protos/google/cloud/securitycenter/v1/finding.proto", + "../../protos/google/cloud/securitycenter/v1/notification_config.proto", + "../../protos/google/cloud/securitycenter/v1/notification_message.proto", "../../protos/google/cloud/securitycenter/v1/organization_settings.proto", "../../protos/google/cloud/securitycenter/v1/run_asset_discovery_response.proto", "../../protos/google/cloud/securitycenter/v1/security_marks.proto", diff --git a/packages/google-cloud-securitycenter/synth.metadata b/packages/google-cloud-securitycenter/synth.metadata index 43091c5dbe1..414e2b09298 100644 --- a/packages/google-cloud-securitycenter/synth.metadata +++ b/packages/google-cloud-securitycenter/synth.metadata @@ -1,13 +1,13 @@ { - "updateTime": "2020-02-29T12:42:02.170282Z", + "updateTime": "2020-03-04T12:40:40.245405Z", "sources": [ { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "83c6f84035ee0f80eaa44d8b688a010461cc4080", - "internalRef": "297918498", - "log": "83c6f84035ee0f80eaa44d8b688a010461cc4080\nUpdate google/api/auth.proto to make AuthProvider to have JwtLocation\n\nPiperOrigin-RevId: 297918498\n\ne9e90a787703ec5d388902e2cb796aaed3a385b4\nDialogflow weekly v2/v2beta1 library update:\n - adding get validation result\n - adding field mask override control for output audio config\nImportant updates are also posted at:\nhttps://cloud.google.com/dialogflow/docs/release-notes\n\nPiperOrigin-RevId: 297671458\n\n1a2b05cc3541a5f7714529c665aecc3ea042c646\nAdding .yaml and .json config files.\n\nPiperOrigin-RevId: 297570622\n\ndfe1cf7be44dee31d78f78e485d8c95430981d6e\nPublish `QueryOptions` proto.\n\nIntroduced a `query_options` input in `ExecuteSqlRequest`.\n\nPiperOrigin-RevId: 297497710\n\ndafc905f71e5d46f500b41ed715aad585be062c3\npubsub: revert pull init_rpc_timeout & max_rpc_timeout back to 25 seconds and reset multiplier to 1.0\n\nPiperOrigin-RevId: 297486523\n\nf077632ba7fee588922d9e8717ee272039be126d\nfirestore: add update_transform\n\nPiperOrigin-RevId: 297405063\n\n0aba1900ffef672ec5f0da677cf590ee5686e13b\ncluster: use square brace for cross-reference\n\nPiperOrigin-RevId: 297204568\n\n5dac2da18f6325cbaed54603c43f0667ecd50247\nRestore retry params in gapic config because securitycenter has non-standard default retry params.\nRestore a few retry codes for some idempotent methods.\n\nPiperOrigin-RevId: 297196720\n\n1eb61455530252bba8b2c8d4bc9832960e5a56f6\npubsub: v1 replace IAM HTTP rules\n\nPiperOrigin-RevId: 297188590\n\n80b2d25f8d43d9d47024ff06ead7f7166548a7ba\nDialogflow weekly v2/v2beta1 library update:\n - updates to mega agent api\n - adding field mask override control for output audio config\nImportant updates are also posted at:\nhttps://cloud.google.com/dialogflow/docs/release-notes\n\nPiperOrigin-RevId: 297187629\n\n0b1876b35e98f560f9c9ca9797955f020238a092\nUse an older version of protoc-docs-plugin that is compatible with the specified gapic-generator and protobuf versions.\n\nprotoc-docs-plugin >=0.4.0 (see commit https://github.com/googleapis/protoc-docs-plugin/commit/979f03ede6678c487337f3d7e88bae58df5207af) is incompatible with protobuf 3.9.1.\n\nPiperOrigin-RevId: 296986742\n\n1e47e676cddbbd8d93f19ba0665af15b5532417e\nFix: Restore a method signature for UpdateCluster\n\nPiperOrigin-RevId: 296901854\n\n7f910bcc4fc4704947ccfd3ceed015d16b9e00c2\nUpdate Dataproc v1beta2 client.\n\nPiperOrigin-RevId: 296451205\n\nde287524405a3dce124d301634731584fc0432d7\nFix: Reinstate method signatures that had been missed off some RPCs\nFix: Correct resource types for two fields\n\nPiperOrigin-RevId: 296435091\n\ne5bc9566ae057fb4c92f8b7e047f1c8958235b53\nDeprecate the endpoint_uris field, as it is unused.\n\nPiperOrigin-RevId: 296357191\n\n8c12e2b4dca94e12bff9f538bdac29524ff7ef7a\nUpdate Dataproc v1 client.\n\nPiperOrigin-RevId: 296336662\n\n17567c4a1ef0a9b50faa87024d66f8acbb561089\nRemoving erroneous comment, a la https://github.com/googleapis/java-speech/pull/103\n\nPiperOrigin-RevId: 296332968\n\n3eaaaf8626ce5b0c0bc7eee05e143beffa373b01\nAdd BUILD.bazel for v1 secretmanager.googleapis.com\n\nPiperOrigin-RevId: 296274723\n\ne76149c3d992337f85eeb45643106aacae7ede82\nMove securitycenter v1 to use generate from annotations.\n\nPiperOrigin-RevId: 296266862\n\n203740c78ac69ee07c3bf6be7408048751f618f8\nAdd StackdriverLoggingConfig field to Cloud Tasks v2 API.\n\nPiperOrigin-RevId: 296256388\n\ne4117d5e9ed8bbca28da4a60a94947ca51cb2083\nCreate a Bazel BUILD file for the google.actions.type export.\n\nPiperOrigin-RevId: 296212567\n\na9639a0a9854fd6e1be08bba1ac3897f4f16cb2f\nAdd secretmanager.googleapis.com v1 protos\n\nPiperOrigin-RevId: 295983266\n\nce4f4c21d9dd2bfab18873a80449b9d9851efde8\nasset: v1p1beta1 remove SearchResources and SearchIamPolicies\n\nPiperOrigin-RevId: 295861722\n\ncb61d6c2d070b589980c779b68ffca617f789116\nasset: v1p1beta1 remove SearchResources and SearchIamPolicies\n\nPiperOrigin-RevId: 295855449\n\nab2685d8d3a0e191dc8aef83df36773c07cb3d06\nfix: Dataproc v1 - AutoscalingPolicy annotation\n\nThis adds the second resource name pattern to the\nAutoscalingPolicy resource.\n\nCommitter: @lukesneeringer\nPiperOrigin-RevId: 295738415\n\n8a1020bf6828f6e3c84c3014f2c51cb62b739140\nUpdate cloud asset api v1p4beta1.\n\nPiperOrigin-RevId: 295286165\n\n5cfa105206e77670369e4b2225597386aba32985\nAdd service control related proto build rule.\n\nPiperOrigin-RevId: 295262088\n\nee4dddf805072004ab19ac94df2ce669046eec26\nmonitoring v3: Add prefix \"https://cloud.google.com/\" into the link for global access\ncl 295167522, get ride of synth.py hacks\n\nPiperOrigin-RevId: 295238095\n\nd9835e922ea79eed8497db270d2f9f85099a519c\nUpdate some minor docs changes about user event proto\n\nPiperOrigin-RevId: 295185610\n\n5f311e416e69c170243de722023b22f3df89ec1c\nfix: use correct PHP package name in gapic configuration\n\nPiperOrigin-RevId: 295161330\n\n6cdd74dcdb071694da6a6b5a206e3a320b62dd11\npubsub: v1 add client config annotations and retry config\n\nPiperOrigin-RevId: 295158776\n\n5169f46d9f792e2934d9fa25c36d0515b4fd0024\nAdded cloud asset api v1p4beta1.\n\nPiperOrigin-RevId: 295026522\n\n56b55aa8818cd0a532a7d779f6ef337ba809ccbd\nFix: Resource annotations for CreateTimeSeriesRequest and ListTimeSeriesRequest should refer to valid resources. TimeSeries is not a named resource.\n\nPiperOrigin-RevId: 294931650\n\n0646bc775203077226c2c34d3e4d50cc4ec53660\nRemove unnecessary languages from bigquery-related artman configuration files.\n\nPiperOrigin-RevId: 294809380\n\n8b78aa04382e3d4147112ad6d344666771bb1909\nUpdate backend.proto for schemes and protocol\n\nPiperOrigin-RevId: 294788800\n\n80b8f8b3de2359831295e24e5238641a38d8488f\nAdds artman config files for bigquerystorage endpoints v1beta2, v1alpha2, v1\n\nPiperOrigin-RevId: 294763931\n\n2c17ac33b226194041155bb5340c3f34733f1b3a\nAdd parameter to sample generated for UpdateInstance. Related to https://github.com/googleapis/python-redis/issues/4\n\nPiperOrigin-RevId: 294734008\n\nd5e8a8953f2acdfe96fb15e85eb2f33739623957\nMove bigquery datatransfer to gapic v2.\n\nPiperOrigin-RevId: 294703703\n\nefd36705972cfcd7d00ab4c6dfa1135bafacd4ae\nfix: Add two annotations that we missed.\n\nPiperOrigin-RevId: 294664231\n\n8a36b928873ff9c05b43859b9d4ea14cd205df57\nFix: Define the \"bigquery.googleapis.com/Table\" resource in the BigQuery Storage API (v1beta2).\n\nPiperOrigin-RevId: 294459768\n\nc7a3caa2c40c49f034a3c11079dd90eb24987047\nFix: Define the \"bigquery.googleapis.com/Table\" resource in the BigQuery Storage API (v1).\n\nPiperOrigin-RevId: 294456889\n\n5006247aa157e59118833658084345ee59af7c09\nFix: Make deprecated fields optional\nFix: Deprecate SetLoggingServiceRequest.zone in line with the comments\nFeature: Add resource name method signatures where appropriate\n\nPiperOrigin-RevId: 294383128\n\neabba40dac05c5cbe0fca3a35761b17e372036c4\nFix: C# and PHP package/namespace capitalization for BigQuery Storage v1.\n\nPiperOrigin-RevId: 294382444\n\nf8d9a858a7a55eba8009a23aa3f5cc5fe5e88dde\nfix: artman configuration file for bigtable-admin\n\nPiperOrigin-RevId: 294322616\n\n0f29555d1cfcf96add5c0b16b089235afbe9b1a9\nAPI definition for (not-yet-launched) GCS gRPC.\n\nPiperOrigin-RevId: 294321472\n\nfcc86bee0e84dc11e9abbff8d7c3529c0626f390\nfix: Bigtable Admin v2\n\nChange LRO metadata from PartialUpdateInstanceMetadata\nto UpdateInstanceMetadata. (Otherwise, it will not build.)\n\nPiperOrigin-RevId: 294264582\n\n6d9361eae2ebb3f42d8c7ce5baf4bab966fee7c0\nrefactor: Add annotations to Bigtable Admin v2.\n\nPiperOrigin-RevId: 294243406\n\nad7616f3fc8e123451c8b3a7987bc91cea9e6913\nFix: Resource type in CreateLogMetricRequest should use logging.googleapis.com.\nFix: ListLogEntries should have a method signature for convenience of calling it.\n\nPiperOrigin-RevId: 294222165\n\n63796fcbb08712676069e20a3e455c9f7aa21026\nFix: Remove extraneous resource definition for cloudkms.googleapis.com/CryptoKey.\n\nPiperOrigin-RevId: 294176658\n\n" + "sha": "541b1ded4abadcc38e8178680b0677f65594ea6f", + "internalRef": "298686266", + "log": "541b1ded4abadcc38e8178680b0677f65594ea6f\nUpdate cloud asset api v1p4beta1.\n\nPiperOrigin-RevId: 298686266\n\nc0d171acecb4f5b0bfd2c4ca34fc54716574e300\n Updated to include the Notification v1 API.\n\nPiperOrigin-RevId: 298652775\n\n2346a9186c0bff2c9cc439f2459d558068637e05\nAdd Service Directory v1beta1 protos and configs\n\nPiperOrigin-RevId: 298625638\n\na78ed801b82a5c6d9c5368e24b1412212e541bb7\nPublishing v3 protos and configs.\n\nPiperOrigin-RevId: 298607357\n\n4a180bfff8a21645b3a935c2756e8d6ab18a74e0\nautoml/v1beta1 publish proto updates\n\nPiperOrigin-RevId: 298484782\n\n6de6e938b7df1cd62396563a067334abeedb9676\nchore: use the latest gapic-generator and protoc-java-resource-name-plugin in Bazel workspace.\n\nPiperOrigin-RevId: 298474513\n\n244ab2b83a82076a1fa7be63b7e0671af73f5c02\nAdds service config definition for bigqueryreservation v1\n\nPiperOrigin-RevId: 298455048\n\n" } }, { diff --git a/packages/google-cloud-securitycenter/test/gapic-security_center-v1.ts b/packages/google-cloud-securitycenter/test/gapic-security_center-v1.ts index d6c338fde1e..79521a6a46e 100644 --- a/packages/google-cloud-securitycenter/test/gapic-security_center-v1.ts +++ b/packages/google-cloud-securitycenter/test/gapic-security_center-v1.ts @@ -200,6 +200,108 @@ describe('v1.SecurityCenterClient', () => { }); }); }); + describe('createNotificationConfig', () => { + it('invokes createNotificationConfig without error', done => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.cloud.securitycenter.v1.ICreateNotificationConfigRequest = {}; + request.parent = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.createNotificationConfig = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.createNotificationConfig(request, (err: {}, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes createNotificationConfig with error', done => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.cloud.securitycenter.v1.ICreateNotificationConfigRequest = {}; + request.parent = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.createNotificationConfig = mockSimpleGrpcMethod( + request, + null, + error + ); + client.createNotificationConfig( + request, + (err: FakeError, response: {}) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + } + ); + }); + }); + describe('deleteNotificationConfig', () => { + it('invokes deleteNotificationConfig without error', done => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.cloud.securitycenter.v1.IDeleteNotificationConfigRequest = {}; + request.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.deleteNotificationConfig = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.deleteNotificationConfig(request, (err: {}, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes deleteNotificationConfig with error', done => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.cloud.securitycenter.v1.IDeleteNotificationConfigRequest = {}; + request.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.deleteNotificationConfig = mockSimpleGrpcMethod( + request, + null, + error + ); + client.deleteNotificationConfig( + request, + (err: FakeError, response: {}) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + } + ); + }); + }); describe('getIamPolicy', () => { it('invokes getIamPolicy without error', done => { const client = new securitycenterModule.v1.SecurityCenterClient({ @@ -248,6 +350,54 @@ describe('v1.SecurityCenterClient', () => { }); }); }); + describe('getNotificationConfig', () => { + it('invokes getNotificationConfig without error', done => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.cloud.securitycenter.v1.IGetNotificationConfigRequest = {}; + request.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.getNotificationConfig = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.getNotificationConfig(request, (err: {}, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes getNotificationConfig with error', done => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.cloud.securitycenter.v1.IGetNotificationConfigRequest = {}; + request.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.getNotificationConfig = mockSimpleGrpcMethod( + request, + null, + error + ); + client.getNotificationConfig(request, (err: FakeError, response: {}) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); describe('getOrganizationSettings', () => { it('invokes getOrganizationSettings without error', done => { const client = new securitycenterModule.v1.SecurityCenterClient({ @@ -541,6 +691,59 @@ describe('v1.SecurityCenterClient', () => { }); }); }); + describe('updateNotificationConfig', () => { + it('invokes updateNotificationConfig without error', done => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.cloud.securitycenter.v1.IUpdateNotificationConfigRequest = {}; + request.notificationConfig = {}; + request.notificationConfig.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.updateNotificationConfig = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.updateNotificationConfig(request, (err: {}, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes updateNotificationConfig with error', done => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.cloud.securitycenter.v1.IUpdateNotificationConfigRequest = {}; + request.notificationConfig = {}; + request.notificationConfig.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.updateNotificationConfig = mockSimpleGrpcMethod( + request, + null, + error + ); + client.updateNotificationConfig( + request, + (err: FakeError, response: {}) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + } + ); + }); + }); describe('updateOrganizationSettings', () => { it('invokes updateOrganizationSettings without error', done => { const client = new securitycenterModule.v1.SecurityCenterClient({ @@ -993,6 +1196,68 @@ describe('v1.SecurityCenterClient', () => { stream.write(expectedResponse); }); }); + describe('listNotificationConfigs', () => { + it('invokes listNotificationConfigs without error', done => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.cloud.securitycenter.v1.IListNotificationConfigsRequest = {}; + request.parent = ''; + // Mock response + const expectedResponse = {}; + // Mock Grpc layer + client._innerApiCalls.listNotificationConfigs = ( + actualRequest: {}, + options: {}, + callback: Callback + ) => { + assert.deepStrictEqual(actualRequest, request); + callback(null, expectedResponse); + }; + client.listNotificationConfigs( + request, + (err: FakeError, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + } + ); + }); + }); + describe('listNotificationConfigsStream', () => { + it('invokes listNotificationConfigsStream without error', done => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.cloud.securitycenter.v1.IListNotificationConfigsRequest = {}; + request.parent = ''; + // Mock response + const expectedResponse = {response: 'data'}; + // Mock Grpc layer + client._innerApiCalls.listNotificationConfigs = ( + actualRequest: {}, + options: {}, + callback: Callback + ) => { + assert.deepStrictEqual(actualRequest, request); + callback(null, expectedResponse); + }; + const stream = client + .listNotificationConfigsStream(request, {}) + .on('data', (response: {}) => { + assert.deepStrictEqual(response, expectedResponse); + done(); + }) + .on('error', (err: FakeError) => { + done(err); + }); + stream.write(expectedResponse); + }); + }); describe('listSources', () => { it('invokes listSources without error', done => { const client = new securitycenterModule.v1.SecurityCenterClient({ From 59ef15ff695b264c286fc7df860c0ad90cdf4be9 Mon Sep 17 00:00:00 2001 From: "gcf-merge-on-green[bot]" <60162190+gcf-merge-on-green[bot]@users.noreply.github.com> Date: Fri, 6 Mar 2020 00:08:36 +0000 Subject: [PATCH 148/342] feat: deferred client initialization (#230) This PR includes changes from https://github.com/googleapis/gapic-generator-typescript/pull/317 that will move the asynchronous initialization and authentication from the client constructor to an `initialize()` method. This method will be automatically called when the first RPC call is performed. The client library usage has not changed, there is no need to update any code. If you want to make sure the client is authenticated _before_ the first RPC call, you can do ```js await client.initialize(); ``` manually before calling any client method. --- .../src/v1/security_center_client.ts | 134 ++++++++++++----- .../src/v1beta1/security_center_client.ts | 123 +++++++++++----- .../src/v1p1beta1/security_center_client.ts | 135 +++++++++++++----- .../synth.metadata | 8 +- .../test/gapic-security_center-v1.ts | 108 ++++++++++++++ .../test/gapic-security_center-v1beta1.ts | 88 ++++++++++++ .../test/gapic-security_center-v1p1beta1.ts | 108 ++++++++++++++ 7 files changed, 589 insertions(+), 115 deletions(-) diff --git a/packages/google-cloud-securitycenter/src/v1/security_center_client.ts b/packages/google-cloud-securitycenter/src/v1/security_center_client.ts index b77b522f2e1..c3834524b57 100644 --- a/packages/google-cloud-securitycenter/src/v1/security_center_client.ts +++ b/packages/google-cloud-securitycenter/src/v1/security_center_client.ts @@ -45,9 +45,14 @@ export class SecurityCenterClient { private _innerApiCalls: {[name: string]: Function}; private _pathTemplates: {[name: string]: gax.PathTemplate}; private _terminated = false; + private _opts: ClientOptions; + 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; operationsClient: gax.OperationsClient; - securityCenterStub: Promise<{[name: string]: Function}>; + securityCenterStub?: Promise<{[name: string]: Function}>; /** * Construct an instance of SecurityCenterClient. @@ -71,8 +76,6 @@ export class SecurityCenterClient { * 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 {function} [options.promise] - Custom promise module to use instead - * of native Promises. * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. */ @@ -102,25 +105,28 @@ export class SecurityCenterClient { // If we are in browser, we are already using fallback because of the // "browser" field in package.json. // But if we were explicitly requested to use fallback, let's do it now. - const gaxModule = !isBrowser && opts.fallback ? gax.fallback : gax; + this._gaxModule = !isBrowser && opts.fallback ? gax.fallback : gax; // Create a `gaxGrpc` object, with any grpc-specific options // sent to the client. opts.scopes = (this.constructor as typeof SecurityCenterClient).scopes; - const gaxGrpc = new gaxModule.GrpcClient(opts); + 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 = gaxGrpc.auth as gax.GoogleAuth; + this.auth = this._gaxGrpc.auth as gax.GoogleAuth; // Determine the client header string. - const clientHeader = [`gax/${gaxModule.version}`, `gapic/${version}`]; + 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/${gaxModule.version}`); + clientHeader.push(`gl-web/${this._gaxModule.version}`); } if (!opts.fallback) { - clientHeader.push(`grpc/${gaxGrpc.grpcVersion}`); + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); } if (opts.libName && opts.libVersion) { clientHeader.push(`${opts.libName}/${opts.libVersion}`); @@ -136,7 +142,7 @@ export class SecurityCenterClient { 'protos', 'protos.json' ); - const protos = gaxGrpc.loadProto( + this._protos = this._gaxGrpc.loadProto( opts.fallback ? require('../../protos/protos.json') : nodejsProtoPath ); @@ -144,28 +150,28 @@ export class SecurityCenterClient { // identifiers to uniquely identify resources within the API. // Create useful helper objects for these. this._pathTemplates = { - assetPathTemplate: new gaxModule.PathTemplate( + assetPathTemplate: new this._gaxModule.PathTemplate( 'organizations/{organization}/assets/{asset}' ), - findingPathTemplate: new gaxModule.PathTemplate( + findingPathTemplate: new this._gaxModule.PathTemplate( 'organizations/{organization}/sources/{source}/findings/{finding}' ), - notificationConfigPathTemplate: new gaxModule.PathTemplate( + notificationConfigPathTemplate: new this._gaxModule.PathTemplate( 'organizations/{organization}/notificationConfigs/{notification_config}' ), - organizationPathTemplate: new gaxModule.PathTemplate( + organizationPathTemplate: new this._gaxModule.PathTemplate( 'organizations/{organization}' ), - organizationAssetPathTemplate: new gaxModule.PathTemplate( + organizationAssetPathTemplate: new this._gaxModule.PathTemplate( 'organizations/{organization}/assets/{asset}/securityMarks' ), - organizationSettingsPathTemplate: new gaxModule.PathTemplate( + organizationSettingsPathTemplate: new this._gaxModule.PathTemplate( 'organizations/{organization}/organizationSettings' ), - organizationSourceFindingPathTemplate: new gaxModule.PathTemplate( + organizationSourceFindingPathTemplate: new this._gaxModule.PathTemplate( 'organizations/{organization}/sources/{source}/findings/{finding}/securityMarks' ), - sourcePathTemplate: new gaxModule.PathTemplate( + sourcePathTemplate: new this._gaxModule.PathTemplate( 'organizations/{organization}/sources/{source}' ), }; @@ -174,32 +180,32 @@ export class SecurityCenterClient { // (e.g. 50 results at a time, with tokens to get subsequent // pages). Denote the keys used for pagination and results. this._descriptors.page = { - groupAssets: new gaxModule.PageDescriptor( + groupAssets: new this._gaxModule.PageDescriptor( 'pageToken', 'nextPageToken', 'groupByResults' ), - groupFindings: new gaxModule.PageDescriptor( + groupFindings: new this._gaxModule.PageDescriptor( 'pageToken', 'nextPageToken', 'groupByResults' ), - listAssets: new gaxModule.PageDescriptor( + listAssets: new this._gaxModule.PageDescriptor( 'pageToken', 'nextPageToken', 'listAssetsResults' ), - listFindings: new gaxModule.PageDescriptor( + listFindings: new this._gaxModule.PageDescriptor( 'pageToken', 'nextPageToken', 'listFindingsResults' ), - listNotificationConfigs: new gaxModule.PageDescriptor( + listNotificationConfigs: new this._gaxModule.PageDescriptor( 'pageToken', 'nextPageToken', 'notificationConfigs' ), - listSources: new gaxModule.PageDescriptor( + listSources: new this._gaxModule.PageDescriptor( 'pageToken', 'nextPageToken', 'sources' @@ -210,13 +216,15 @@ export class SecurityCenterClient { // an Operation object that allows for tracking of the operation, // rather than holding a request open. const protoFilesRoot = opts.fallback - ? gaxModule.protobuf.Root.fromJSON(require('../../protos/protos.json')) - : gaxModule.protobuf.loadSync(nodejsProtoPath); + ? this._gaxModule.protobuf.Root.fromJSON( + require('../../protos/protos.json') + ) + : this._gaxModule.protobuf.loadSync(nodejsProtoPath); - this.operationsClient = gaxModule + this.operationsClient = this._gaxModule .lro({ auth: this.auth, - grpc: 'grpc' in gaxGrpc ? gaxGrpc.grpc : undefined, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined, }) .operationsClient(opts); const runAssetDiscoveryResponse = protoFilesRoot.lookup( @@ -227,7 +235,7 @@ export class SecurityCenterClient { ) as gax.protobuf.Type; this._descriptors.longrunning = { - runAssetDiscovery: new gaxModule.LongrunningDescriptor( + runAssetDiscovery: new this._gaxModule.LongrunningDescriptor( this.operationsClient, runAssetDiscoveryResponse.decode.bind(runAssetDiscoveryResponse), runAssetDiscoveryMetadata.decode.bind(runAssetDiscoveryMetadata) @@ -235,7 +243,7 @@ export class SecurityCenterClient { }; // Put together the default options sent with requests. - const defaults = gaxGrpc.constructSettings( + this._defaults = this._gaxGrpc.constructSettings( 'google.cloud.securitycenter.v1.SecurityCenter', gapicConfig as gax.ClientConfig, opts.clientConfig || {}, @@ -246,17 +254,35 @@ export class SecurityCenterClient { // of calling the API is handled in `google-gax`, with this code // merely providing the destination and request information. this._innerApiCalls = {}; + } + + /** + * 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.securityCenterStub) { + return this.securityCenterStub; + } // Put together the "service stub" for // google.cloud.securitycenter.v1.SecurityCenter. - this.securityCenterStub = gaxGrpc.createStub( - opts.fallback - ? (protos as protobuf.Root).lookupService( + this.securityCenterStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( 'google.cloud.securitycenter.v1.SecurityCenter' ) : // tslint:disable-next-line no-any - (protos as any).google.cloud.securitycenter.v1.SecurityCenter, - opts + (this._protos as any).google.cloud.securitycenter.v1.SecurityCenter, + this._opts ) as Promise<{[method: string]: Function}>; // Iterate over each of the methods that the service provides @@ -300,9 +326,9 @@ export class SecurityCenterClient { } ); - const apiCall = gaxModule.createApiCall( + const apiCall = this._gaxModule.createApiCall( innerCallPromise, - defaults[methodName], + this._defaults[methodName], this._descriptors.page[methodName] || this._descriptors.stream[methodName] || this._descriptors.longrunning[methodName] @@ -316,6 +342,8 @@ export class SecurityCenterClient { return apiCall(argument, callOptions, callback); }; } + + return this.securityCenterStub; } /** @@ -450,6 +478,7 @@ export class SecurityCenterClient { ] = gax.routingHeader.fromParams({ parent: request.parent || '', }); + this.initialize(); return this._innerApiCalls.createSource(request, options, callback); } createFinding( @@ -539,6 +568,7 @@ export class SecurityCenterClient { ] = gax.routingHeader.fromParams({ parent: request.parent || '', }); + this.initialize(); return this._innerApiCalls.createFinding(request, options, callback); } createNotificationConfig( @@ -629,6 +659,7 @@ export class SecurityCenterClient { ] = gax.routingHeader.fromParams({ parent: request.parent || '', }); + this.initialize(); return this._innerApiCalls.createNotificationConfig( request, options, @@ -714,6 +745,7 @@ export class SecurityCenterClient { ] = gax.routingHeader.fromParams({ name: request.name || '', }); + this.initialize(); return this._innerApiCalls.deleteNotificationConfig( request, options, @@ -787,6 +819,7 @@ export class SecurityCenterClient { ] = gax.routingHeader.fromParams({ resource: request.resource || '', }); + this.initialize(); return this._innerApiCalls.getIamPolicy(request, options, callback); } getNotificationConfig( @@ -868,6 +901,7 @@ export class SecurityCenterClient { ] = gax.routingHeader.fromParams({ name: request.name || '', }); + this.initialize(); return this._innerApiCalls.getNotificationConfig( request, options, @@ -953,6 +987,7 @@ export class SecurityCenterClient { ] = gax.routingHeader.fromParams({ name: request.name || '', }); + this.initialize(); return this._innerApiCalls.getOrganizationSettings( request, options, @@ -1030,6 +1065,7 @@ export class SecurityCenterClient { ] = gax.routingHeader.fromParams({ name: request.name || '', }); + this.initialize(); return this._innerApiCalls.getSource(request, options, callback); } setFindingState( @@ -1117,6 +1153,7 @@ export class SecurityCenterClient { ] = gax.routingHeader.fromParams({ name: request.name || '', }); + this.initialize(); return this._innerApiCalls.setFindingState(request, options, callback); } setIamPolicy( @@ -1186,6 +1223,7 @@ export class SecurityCenterClient { ] = gax.routingHeader.fromParams({ resource: request.resource || '', }); + this.initialize(); return this._innerApiCalls.setIamPolicy(request, options, callback); } testIamPermissions( @@ -1255,6 +1293,7 @@ export class SecurityCenterClient { ] = gax.routingHeader.fromParams({ resource: request.resource || '', }); + this.initialize(); return this._innerApiCalls.testIamPermissions(request, options, callback); } updateFinding( @@ -1349,6 +1388,7 @@ export class SecurityCenterClient { ] = gax.routingHeader.fromParams({ 'finding.name': request.finding!.name || '', }); + this.initialize(); return this._innerApiCalls.updateFinding(request, options, callback); } updateNotificationConfig( @@ -1434,6 +1474,7 @@ export class SecurityCenterClient { ] = gax.routingHeader.fromParams({ 'notification_config.name': request.notificationConfig!.name || '', }); + this.initialize(); return this._innerApiCalls.updateNotificationConfig( request, options, @@ -1522,6 +1563,7 @@ export class SecurityCenterClient { ] = gax.routingHeader.fromParams({ 'organization_settings.name': request.organizationSettings!.name || '', }); + this.initialize(); return this._innerApiCalls.updateOrganizationSettings( request, options, @@ -1610,6 +1652,7 @@ export class SecurityCenterClient { ] = gax.routingHeader.fromParams({ 'source.name': request.source!.name || '', }); + this.initialize(); return this._innerApiCalls.updateSource(request, options, callback); } updateSecurityMarks( @@ -1700,6 +1743,7 @@ export class SecurityCenterClient { ] = gax.routingHeader.fromParams({ 'security_marks.name': request.securityMarks!.name || '', }); + this.initialize(); return this._innerApiCalls.updateSecurityMarks(request, options, callback); } @@ -1793,6 +1837,7 @@ export class SecurityCenterClient { ] = gax.routingHeader.fromParams({ parent: request.parent || '', }); + this.initialize(); return this._innerApiCalls.runAssetDiscovery(request, options, callback); } groupAssets( @@ -1994,6 +2039,7 @@ export class SecurityCenterClient { ] = gax.routingHeader.fromParams({ parent: request.parent || '', }); + this.initialize(); return this._innerApiCalls.groupAssets(request, options, callback); } @@ -2150,6 +2196,7 @@ export class SecurityCenterClient { parent: request.parent || '', }); const callSettings = new gax.CallSettings(options); + this.initialize(); return this._descriptors.page.groupAssets.createStream( this._innerApiCalls.groupAssets as gax.GaxCall, request, @@ -2348,6 +2395,7 @@ export class SecurityCenterClient { ] = gax.routingHeader.fromParams({ parent: request.parent || '', }); + this.initialize(); return this._innerApiCalls.groupFindings(request, options, callback); } @@ -2494,6 +2542,7 @@ export class SecurityCenterClient { parent: request.parent || '', }); const callSettings = new gax.CallSettings(options); + this.initialize(); return this._descriptors.page.groupFindings.createStream( this._innerApiCalls.groupFindings as gax.GaxCall, request, @@ -2701,6 +2750,7 @@ export class SecurityCenterClient { ] = gax.routingHeader.fromParams({ parent: request.parent || '', }); + this.initialize(); return this._innerApiCalls.listAssets(request, options, callback); } @@ -2860,6 +2910,7 @@ export class SecurityCenterClient { parent: request.parent || '', }); const callSettings = new gax.CallSettings(options); + this.initialize(); return this._descriptors.page.listAssets.createStream( this._innerApiCalls.listAssets as gax.GaxCall, request, @@ -3062,6 +3113,7 @@ export class SecurityCenterClient { ] = gax.routingHeader.fromParams({ parent: request.parent || '', }); + this.initialize(); return this._innerApiCalls.listFindings(request, options, callback); } @@ -3213,6 +3265,7 @@ export class SecurityCenterClient { parent: request.parent || '', }); const callSettings = new gax.CallSettings(options); + this.initialize(); return this._descriptors.page.listFindings.createStream( this._innerApiCalls.listFindings as gax.GaxCall, request, @@ -3308,6 +3361,7 @@ export class SecurityCenterClient { ] = gax.routingHeader.fromParams({ parent: request.parent || '', }); + this.initialize(); return this._innerApiCalls.listNotificationConfigs( request, options, @@ -3359,6 +3413,7 @@ export class SecurityCenterClient { parent: request.parent || '', }); const callSettings = new gax.CallSettings(options); + this.initialize(); return this._descriptors.page.listNotificationConfigs.createStream( this._innerApiCalls.listNotificationConfigs as gax.GaxCall, request, @@ -3454,6 +3509,7 @@ export class SecurityCenterClient { ] = gax.routingHeader.fromParams({ parent: request.parent || '', }); + this.initialize(); return this._innerApiCalls.listSources(request, options, callback); } @@ -3501,6 +3557,7 @@ export class SecurityCenterClient { parent: request.parent || '', }); const callSettings = new gax.CallSettings(options); + this.initialize(); return this._descriptors.page.listSources.createStream( this._innerApiCalls.listSources as gax.GaxCall, request, @@ -3838,8 +3895,9 @@ export class SecurityCenterClient { * The client will no longer be usable and all future behavior is undefined. */ close(): Promise { + this.initialize(); if (!this._terminated) { - return this.securityCenterStub.then(stub => { + return this.securityCenterStub!.then(stub => { this._terminated = true; stub.close(); }); diff --git a/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.ts b/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.ts index 7833c90ee49..2fb75e362cc 100644 --- a/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.ts +++ b/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.ts @@ -45,9 +45,14 @@ export class SecurityCenterClient { private _innerApiCalls: {[name: string]: Function}; private _pathTemplates: {[name: string]: gax.PathTemplate}; private _terminated = false; + private _opts: ClientOptions; + 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; operationsClient: gax.OperationsClient; - securityCenterStub: Promise<{[name: string]: Function}>; + securityCenterStub?: Promise<{[name: string]: Function}>; /** * Construct an instance of SecurityCenterClient. @@ -71,8 +76,6 @@ export class SecurityCenterClient { * 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 {function} [options.promise] - Custom promise module to use instead - * of native Promises. * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. */ @@ -102,25 +105,28 @@ export class SecurityCenterClient { // If we are in browser, we are already using fallback because of the // "browser" field in package.json. // But if we were explicitly requested to use fallback, let's do it now. - const gaxModule = !isBrowser && opts.fallback ? gax.fallback : gax; + this._gaxModule = !isBrowser && opts.fallback ? gax.fallback : gax; // Create a `gaxGrpc` object, with any grpc-specific options // sent to the client. opts.scopes = (this.constructor as typeof SecurityCenterClient).scopes; - const gaxGrpc = new gaxModule.GrpcClient(opts); + 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 = gaxGrpc.auth as gax.GoogleAuth; + this.auth = this._gaxGrpc.auth as gax.GoogleAuth; // Determine the client header string. - const clientHeader = [`gax/${gaxModule.version}`, `gapic/${version}`]; + 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/${gaxModule.version}`); + clientHeader.push(`gl-web/${this._gaxModule.version}`); } if (!opts.fallback) { - clientHeader.push(`grpc/${gaxGrpc.grpcVersion}`); + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); } if (opts.libName && opts.libVersion) { clientHeader.push(`${opts.libName}/${opts.libVersion}`); @@ -136,7 +142,7 @@ export class SecurityCenterClient { 'protos', 'protos.json' ); - const protos = gaxGrpc.loadProto( + this._protos = this._gaxGrpc.loadProto( opts.fallback ? require('../../protos/protos.json') : nodejsProtoPath ); @@ -144,22 +150,22 @@ export class SecurityCenterClient { // identifiers to uniquely identify resources within the API. // Create useful helper objects for these. this._pathTemplates = { - findingPathTemplate: new gaxModule.PathTemplate( + findingPathTemplate: new this._gaxModule.PathTemplate( 'organizations/{organization}/sources/{source}/findings/{finding}' ), - organizationPathTemplate: new gaxModule.PathTemplate( + organizationPathTemplate: new this._gaxModule.PathTemplate( 'organizations/{organization}' ), - organizationAssetPathTemplate: new gaxModule.PathTemplate( + organizationAssetPathTemplate: new this._gaxModule.PathTemplate( 'organizations/{organization}/assets/{asset}/securityMarks' ), - organizationSettingsPathTemplate: new gaxModule.PathTemplate( + organizationSettingsPathTemplate: new this._gaxModule.PathTemplate( 'organizations/{organization}/organizationSettings' ), - organizationSourceFindingPathTemplate: new gaxModule.PathTemplate( + organizationSourceFindingPathTemplate: new this._gaxModule.PathTemplate( 'organizations/{organization}/sources/{source}/findings/{finding}/securityMarks' ), - sourcePathTemplate: new gaxModule.PathTemplate( + sourcePathTemplate: new this._gaxModule.PathTemplate( 'organizations/{organization}/sources/{source}' ), }; @@ -168,27 +174,27 @@ export class SecurityCenterClient { // (e.g. 50 results at a time, with tokens to get subsequent // pages). Denote the keys used for pagination and results. this._descriptors.page = { - groupAssets: new gaxModule.PageDescriptor( + groupAssets: new this._gaxModule.PageDescriptor( 'pageToken', 'nextPageToken', 'groupByResults' ), - groupFindings: new gaxModule.PageDescriptor( + groupFindings: new this._gaxModule.PageDescriptor( 'pageToken', 'nextPageToken', 'groupByResults' ), - listAssets: new gaxModule.PageDescriptor( + listAssets: new this._gaxModule.PageDescriptor( 'pageToken', 'nextPageToken', 'listAssetsResults' ), - listFindings: new gaxModule.PageDescriptor( + listFindings: new this._gaxModule.PageDescriptor( 'pageToken', 'nextPageToken', 'findings' ), - listSources: new gaxModule.PageDescriptor( + listSources: new this._gaxModule.PageDescriptor( 'pageToken', 'nextPageToken', 'sources' @@ -199,13 +205,15 @@ export class SecurityCenterClient { // an Operation object that allows for tracking of the operation, // rather than holding a request open. const protoFilesRoot = opts.fallback - ? gaxModule.protobuf.Root.fromJSON(require('../../protos/protos.json')) - : gaxModule.protobuf.loadSync(nodejsProtoPath); + ? this._gaxModule.protobuf.Root.fromJSON( + require('../../protos/protos.json') + ) + : this._gaxModule.protobuf.loadSync(nodejsProtoPath); - this.operationsClient = gaxModule + this.operationsClient = this._gaxModule .lro({ auth: this.auth, - grpc: 'grpc' in gaxGrpc ? gaxGrpc.grpc : undefined, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined, }) .operationsClient(opts); const runAssetDiscoveryResponse = protoFilesRoot.lookup( @@ -216,7 +224,7 @@ export class SecurityCenterClient { ) as gax.protobuf.Type; this._descriptors.longrunning = { - runAssetDiscovery: new gaxModule.LongrunningDescriptor( + runAssetDiscovery: new this._gaxModule.LongrunningDescriptor( this.operationsClient, runAssetDiscoveryResponse.decode.bind(runAssetDiscoveryResponse), runAssetDiscoveryMetadata.decode.bind(runAssetDiscoveryMetadata) @@ -224,7 +232,7 @@ export class SecurityCenterClient { }; // Put together the default options sent with requests. - const defaults = gaxGrpc.constructSettings( + this._defaults = this._gaxGrpc.constructSettings( 'google.cloud.securitycenter.v1beta1.SecurityCenter', gapicConfig as gax.ClientConfig, opts.clientConfig || {}, @@ -235,17 +243,36 @@ export class SecurityCenterClient { // of calling the API is handled in `google-gax`, with this code // merely providing the destination and request information. this._innerApiCalls = {}; + } + + /** + * 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.securityCenterStub) { + return this.securityCenterStub; + } // Put together the "service stub" for // google.cloud.securitycenter.v1beta1.SecurityCenter. - this.securityCenterStub = gaxGrpc.createStub( - opts.fallback - ? (protos as protobuf.Root).lookupService( + this.securityCenterStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( 'google.cloud.securitycenter.v1beta1.SecurityCenter' ) : // tslint:disable-next-line no-any - (protos as any).google.cloud.securitycenter.v1beta1.SecurityCenter, - opts + (this._protos as any).google.cloud.securitycenter.v1beta1 + .SecurityCenter, + this._opts ) as Promise<{[method: string]: Function}>; // Iterate over each of the methods that the service provides @@ -284,9 +311,9 @@ export class SecurityCenterClient { } ); - const apiCall = gaxModule.createApiCall( + const apiCall = this._gaxModule.createApiCall( innerCallPromise, - defaults[methodName], + this._defaults[methodName], this._descriptors.page[methodName] || this._descriptors.stream[methodName] || this._descriptors.longrunning[methodName] @@ -300,6 +327,8 @@ export class SecurityCenterClient { return apiCall(argument, callOptions, callback); }; } + + return this.securityCenterStub; } /** @@ -434,6 +463,7 @@ export class SecurityCenterClient { ] = gax.routingHeader.fromParams({ parent: request.parent || '', }); + this.initialize(); return this._innerApiCalls.createSource(request, options, callback); } createFinding( @@ -523,6 +553,7 @@ export class SecurityCenterClient { ] = gax.routingHeader.fromParams({ parent: request.parent || '', }); + this.initialize(); return this._innerApiCalls.createFinding(request, options, callback); } getIamPolicy( @@ -592,6 +623,7 @@ export class SecurityCenterClient { ] = gax.routingHeader.fromParams({ resource: request.resource || '', }); + this.initialize(); return this._innerApiCalls.getIamPolicy(request, options, callback); } getOrganizationSettings( @@ -673,6 +705,7 @@ export class SecurityCenterClient { ] = gax.routingHeader.fromParams({ name: request.name || '', }); + this.initialize(); return this._innerApiCalls.getOrganizationSettings( request, options, @@ -758,6 +791,7 @@ export class SecurityCenterClient { ] = gax.routingHeader.fromParams({ name: request.name || '', }); + this.initialize(); return this._innerApiCalls.getSource(request, options, callback); } setFindingState( @@ -845,6 +879,7 @@ export class SecurityCenterClient { ] = gax.routingHeader.fromParams({ name: request.name || '', }); + this.initialize(); return this._innerApiCalls.setFindingState(request, options, callback); } setIamPolicy( @@ -914,6 +949,7 @@ export class SecurityCenterClient { ] = gax.routingHeader.fromParams({ resource: request.resource || '', }); + this.initialize(); return this._innerApiCalls.setIamPolicy(request, options, callback); } testIamPermissions( @@ -983,6 +1019,7 @@ export class SecurityCenterClient { ] = gax.routingHeader.fromParams({ resource: request.resource || '', }); + this.initialize(); return this._innerApiCalls.testIamPermissions(request, options, callback); } updateFinding( @@ -1072,6 +1109,7 @@ export class SecurityCenterClient { ] = gax.routingHeader.fromParams({ 'finding.name': request.finding!.name || '', }); + this.initialize(); return this._innerApiCalls.updateFinding(request, options, callback); } updateOrganizationSettings( @@ -1154,6 +1192,7 @@ export class SecurityCenterClient { ] = gax.routingHeader.fromParams({ 'organization_settings.name': request.organizationSettings!.name || '', }); + this.initialize(); return this._innerApiCalls.updateOrganizationSettings( request, options, @@ -1240,6 +1279,7 @@ export class SecurityCenterClient { ] = gax.routingHeader.fromParams({ 'source.name': request.source!.name || '', }); + this.initialize(); return this._innerApiCalls.updateSource(request, options, callback); } updateSecurityMarks( @@ -1324,6 +1364,7 @@ export class SecurityCenterClient { ] = gax.routingHeader.fromParams({ 'security_marks.name': request.securityMarks!.name || '', }); + this.initialize(); return this._innerApiCalls.updateSecurityMarks(request, options, callback); } @@ -1417,6 +1458,7 @@ export class SecurityCenterClient { ] = gax.routingHeader.fromParams({ parent: request.parent || '', }); + this.initialize(); return this._innerApiCalls.runAssetDiscovery(request, options, callback); } groupAssets( @@ -1579,6 +1621,7 @@ export class SecurityCenterClient { ] = gax.routingHeader.fromParams({ parent: request.parent || '', }); + this.initialize(); return this._innerApiCalls.groupAssets(request, options, callback); } @@ -1696,6 +1739,7 @@ export class SecurityCenterClient { parent: request.parent || '', }); const callSettings = new gax.CallSettings(options); + this.initialize(); return this._descriptors.page.groupAssets.createStream( this._innerApiCalls.groupAssets as gax.GaxCall, request, @@ -1840,6 +1884,7 @@ export class SecurityCenterClient { ] = gax.routingHeader.fromParams({ parent: request.parent || '', }); + this.initialize(); return this._innerApiCalls.groupFindings(request, options, callback); } @@ -1932,6 +1977,7 @@ export class SecurityCenterClient { parent: request.parent || '', }); const callSettings = new gax.CallSettings(options); + this.initialize(); return this._descriptors.page.groupFindings.createStream( this._innerApiCalls.groupFindings as gax.GaxCall, request, @@ -2097,6 +2143,7 @@ export class SecurityCenterClient { ] = gax.routingHeader.fromParams({ parent: request.parent || '', }); + this.initialize(); return this._innerApiCalls.listAssets(request, options, callback); } @@ -2214,6 +2261,7 @@ export class SecurityCenterClient { parent: request.parent || '', }); const callSettings = new gax.CallSettings(options); + this.initialize(); return this._descriptors.page.listAssets.createStream( this._innerApiCalls.listAssets as gax.GaxCall, request, @@ -2357,6 +2405,7 @@ export class SecurityCenterClient { ] = gax.routingHeader.fromParams({ parent: request.parent || '', }); + this.initialize(); return this._innerApiCalls.listFindings(request, options, callback); } @@ -2449,6 +2498,7 @@ export class SecurityCenterClient { parent: request.parent || '', }); const callSettings = new gax.CallSettings(options); + this.initialize(); return this._descriptors.page.listFindings.createStream( this._innerApiCalls.listFindings as gax.GaxCall, request, @@ -2544,6 +2594,7 @@ export class SecurityCenterClient { ] = gax.routingHeader.fromParams({ parent: request.parent || '', }); + this.initialize(); return this._innerApiCalls.listSources(request, options, callback); } @@ -2591,6 +2642,7 @@ export class SecurityCenterClient { parent: request.parent || '', }); const callSettings = new gax.CallSettings(options); + this.initialize(); return this._descriptors.page.listSources.createStream( this._innerApiCalls.listSources as gax.GaxCall, request, @@ -2850,8 +2902,9 @@ export class SecurityCenterClient { * The client will no longer be usable and all future behavior is undefined. */ close(): Promise { + this.initialize(); if (!this._terminated) { - return this.securityCenterStub.then(stub => { + return this.securityCenterStub!.then(stub => { this._terminated = true; stub.close(); }); diff --git a/packages/google-cloud-securitycenter/src/v1p1beta1/security_center_client.ts b/packages/google-cloud-securitycenter/src/v1p1beta1/security_center_client.ts index 5c074f05680..0f4069e5be2 100644 --- a/packages/google-cloud-securitycenter/src/v1p1beta1/security_center_client.ts +++ b/packages/google-cloud-securitycenter/src/v1p1beta1/security_center_client.ts @@ -45,9 +45,14 @@ export class SecurityCenterClient { private _innerApiCalls: {[name: string]: Function}; private _pathTemplates: {[name: string]: gax.PathTemplate}; private _terminated = false; + private _opts: ClientOptions; + 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; operationsClient: gax.OperationsClient; - securityCenterStub: Promise<{[name: string]: Function}>; + securityCenterStub?: Promise<{[name: string]: Function}>; /** * Construct an instance of SecurityCenterClient. @@ -71,8 +76,6 @@ export class SecurityCenterClient { * 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 {function} [options.promise] - Custom promise module to use instead - * of native Promises. * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. */ @@ -102,25 +105,28 @@ export class SecurityCenterClient { // If we are in browser, we are already using fallback because of the // "browser" field in package.json. // But if we were explicitly requested to use fallback, let's do it now. - const gaxModule = !isBrowser && opts.fallback ? gax.fallback : gax; + this._gaxModule = !isBrowser && opts.fallback ? gax.fallback : gax; // Create a `gaxGrpc` object, with any grpc-specific options // sent to the client. opts.scopes = (this.constructor as typeof SecurityCenterClient).scopes; - const gaxGrpc = new gaxModule.GrpcClient(opts); + 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 = gaxGrpc.auth as gax.GoogleAuth; + this.auth = this._gaxGrpc.auth as gax.GoogleAuth; // Determine the client header string. - const clientHeader = [`gax/${gaxModule.version}`, `gapic/${version}`]; + 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/${gaxModule.version}`); + clientHeader.push(`gl-web/${this._gaxModule.version}`); } if (!opts.fallback) { - clientHeader.push(`grpc/${gaxGrpc.grpcVersion}`); + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); } if (opts.libName && opts.libVersion) { clientHeader.push(`${opts.libName}/${opts.libVersion}`); @@ -136,7 +142,7 @@ export class SecurityCenterClient { 'protos', 'protos.json' ); - const protos = gaxGrpc.loadProto( + this._protos = this._gaxGrpc.loadProto( opts.fallback ? require('../../protos/protos.json') : nodejsProtoPath ); @@ -144,28 +150,28 @@ export class SecurityCenterClient { // identifiers to uniquely identify resources within the API. // Create useful helper objects for these. this._pathTemplates = { - assetPathTemplate: new gaxModule.PathTemplate( + assetPathTemplate: new this._gaxModule.PathTemplate( 'organizations/{organization}/assets/{asset}' ), - findingPathTemplate: new gaxModule.PathTemplate( + findingPathTemplate: new this._gaxModule.PathTemplate( 'organizations/{organization}/sources/{source}/findings/{finding}' ), - notificationConfigPathTemplate: new gaxModule.PathTemplate( + notificationConfigPathTemplate: new this._gaxModule.PathTemplate( 'organizations/{organization}/notificationConfigs/{notification_config}' ), - organizationPathTemplate: new gaxModule.PathTemplate( + organizationPathTemplate: new this._gaxModule.PathTemplate( 'organizations/{organization}' ), - organizationAssetPathTemplate: new gaxModule.PathTemplate( + organizationAssetPathTemplate: new this._gaxModule.PathTemplate( 'organizations/{organization}/assets/{asset}/securityMarks' ), - organizationSettingsPathTemplate: new gaxModule.PathTemplate( + organizationSettingsPathTemplate: new this._gaxModule.PathTemplate( 'organizations/{organization}/organizationSettings' ), - organizationSourceFindingPathTemplate: new gaxModule.PathTemplate( + organizationSourceFindingPathTemplate: new this._gaxModule.PathTemplate( 'organizations/{organization}/sources/{source}/findings/{finding}/securityMarks' ), - sourcePathTemplate: new gaxModule.PathTemplate( + sourcePathTemplate: new this._gaxModule.PathTemplate( 'organizations/{organization}/sources/{source}' ), }; @@ -174,32 +180,32 @@ export class SecurityCenterClient { // (e.g. 50 results at a time, with tokens to get subsequent // pages). Denote the keys used for pagination and results. this._descriptors.page = { - groupAssets: new gaxModule.PageDescriptor( + groupAssets: new this._gaxModule.PageDescriptor( 'pageToken', 'nextPageToken', 'groupByResults' ), - groupFindings: new gaxModule.PageDescriptor( + groupFindings: new this._gaxModule.PageDescriptor( 'pageToken', 'nextPageToken', 'groupByResults' ), - listAssets: new gaxModule.PageDescriptor( + listAssets: new this._gaxModule.PageDescriptor( 'pageToken', 'nextPageToken', 'listAssetsResults' ), - listFindings: new gaxModule.PageDescriptor( + listFindings: new this._gaxModule.PageDescriptor( 'pageToken', 'nextPageToken', 'listFindingsResults' ), - listNotificationConfigs: new gaxModule.PageDescriptor( + listNotificationConfigs: new this._gaxModule.PageDescriptor( 'pageToken', 'nextPageToken', 'notificationConfigs' ), - listSources: new gaxModule.PageDescriptor( + listSources: new this._gaxModule.PageDescriptor( 'pageToken', 'nextPageToken', 'sources' @@ -210,13 +216,15 @@ export class SecurityCenterClient { // an Operation object that allows for tracking of the operation, // rather than holding a request open. const protoFilesRoot = opts.fallback - ? gaxModule.protobuf.Root.fromJSON(require('../../protos/protos.json')) - : gaxModule.protobuf.loadSync(nodejsProtoPath); + ? this._gaxModule.protobuf.Root.fromJSON( + require('../../protos/protos.json') + ) + : this._gaxModule.protobuf.loadSync(nodejsProtoPath); - this.operationsClient = gaxModule + this.operationsClient = this._gaxModule .lro({ auth: this.auth, - grpc: 'grpc' in gaxGrpc ? gaxGrpc.grpc : undefined, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined, }) .operationsClient(opts); const runAssetDiscoveryResponse = protoFilesRoot.lookup( @@ -227,7 +235,7 @@ export class SecurityCenterClient { ) as gax.protobuf.Type; this._descriptors.longrunning = { - runAssetDiscovery: new gaxModule.LongrunningDescriptor( + runAssetDiscovery: new this._gaxModule.LongrunningDescriptor( this.operationsClient, runAssetDiscoveryResponse.decode.bind(runAssetDiscoveryResponse), runAssetDiscoveryMetadata.decode.bind(runAssetDiscoveryMetadata) @@ -235,7 +243,7 @@ export class SecurityCenterClient { }; // Put together the default options sent with requests. - const defaults = gaxGrpc.constructSettings( + this._defaults = this._gaxGrpc.constructSettings( 'google.cloud.securitycenter.v1p1beta1.SecurityCenter', gapicConfig as gax.ClientConfig, opts.clientConfig || {}, @@ -246,17 +254,36 @@ export class SecurityCenterClient { // of calling the API is handled in `google-gax`, with this code // merely providing the destination and request information. this._innerApiCalls = {}; + } + + /** + * 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.securityCenterStub) { + return this.securityCenterStub; + } // Put together the "service stub" for // google.cloud.securitycenter.v1p1beta1.SecurityCenter. - this.securityCenterStub = gaxGrpc.createStub( - opts.fallback - ? (protos as protobuf.Root).lookupService( + this.securityCenterStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( 'google.cloud.securitycenter.v1p1beta1.SecurityCenter' ) : // tslint:disable-next-line no-any - (protos as any).google.cloud.securitycenter.v1p1beta1.SecurityCenter, - opts + (this._protos as any).google.cloud.securitycenter.v1p1beta1 + .SecurityCenter, + this._opts ) as Promise<{[method: string]: Function}>; // Iterate over each of the methods that the service provides @@ -300,9 +327,9 @@ export class SecurityCenterClient { } ); - const apiCall = gaxModule.createApiCall( + const apiCall = this._gaxModule.createApiCall( innerCallPromise, - defaults[methodName], + this._defaults[methodName], this._descriptors.page[methodName] || this._descriptors.stream[methodName] || this._descriptors.longrunning[methodName] @@ -316,6 +343,8 @@ export class SecurityCenterClient { return apiCall(argument, callOptions, callback); }; } + + return this.securityCenterStub; } /** @@ -450,6 +479,7 @@ export class SecurityCenterClient { ] = gax.routingHeader.fromParams({ parent: request.parent || '', }); + this.initialize(); return this._innerApiCalls.createSource(request, options, callback); } createFinding( @@ -540,6 +570,7 @@ export class SecurityCenterClient { ] = gax.routingHeader.fromParams({ parent: request.parent || '', }); + this.initialize(); return this._innerApiCalls.createFinding(request, options, callback); } createNotificationConfig( @@ -630,6 +661,7 @@ export class SecurityCenterClient { ] = gax.routingHeader.fromParams({ parent: request.parent || '', }); + this.initialize(); return this._innerApiCalls.createNotificationConfig( request, options, @@ -715,6 +747,7 @@ export class SecurityCenterClient { ] = gax.routingHeader.fromParams({ name: request.name || '', }); + this.initialize(); return this._innerApiCalls.deleteNotificationConfig( request, options, @@ -788,6 +821,7 @@ export class SecurityCenterClient { ] = gax.routingHeader.fromParams({ resource: request.resource || '', }); + this.initialize(); return this._innerApiCalls.getIamPolicy(request, options, callback); } getNotificationConfig( @@ -869,6 +903,7 @@ export class SecurityCenterClient { ] = gax.routingHeader.fromParams({ name: request.name || '', }); + this.initialize(); return this._innerApiCalls.getNotificationConfig( request, options, @@ -954,6 +989,7 @@ export class SecurityCenterClient { ] = gax.routingHeader.fromParams({ name: request.name || '', }); + this.initialize(); return this._innerApiCalls.getOrganizationSettings( request, options, @@ -1039,6 +1075,7 @@ export class SecurityCenterClient { ] = gax.routingHeader.fromParams({ name: request.name || '', }); + this.initialize(); return this._innerApiCalls.getSource(request, options, callback); } setFindingState( @@ -1127,6 +1164,7 @@ export class SecurityCenterClient { ] = gax.routingHeader.fromParams({ name: request.name || '', }); + this.initialize(); return this._innerApiCalls.setFindingState(request, options, callback); } setIamPolicy( @@ -1196,6 +1234,7 @@ export class SecurityCenterClient { ] = gax.routingHeader.fromParams({ resource: request.resource || '', }); + this.initialize(); return this._innerApiCalls.setIamPolicy(request, options, callback); } testIamPermissions( @@ -1265,6 +1304,7 @@ export class SecurityCenterClient { ] = gax.routingHeader.fromParams({ resource: request.resource || '', }); + this.initialize(); return this._innerApiCalls.testIamPermissions(request, options, callback); } updateFinding( @@ -1360,6 +1400,7 @@ export class SecurityCenterClient { ] = gax.routingHeader.fromParams({ 'finding.name': request.finding!.name || '', }); + this.initialize(); return this._innerApiCalls.updateFinding(request, options, callback); } updateNotificationConfig( @@ -1444,6 +1485,7 @@ export class SecurityCenterClient { ] = gax.routingHeader.fromParams({ 'notification_config.name': request.notificationConfig!.name || '', }); + this.initialize(); return this._innerApiCalls.updateNotificationConfig( request, options, @@ -1532,6 +1574,7 @@ export class SecurityCenterClient { ] = gax.routingHeader.fromParams({ 'organization_settings.name': request.organizationSettings!.name || '', }); + this.initialize(); return this._innerApiCalls.updateOrganizationSettings( request, options, @@ -1620,6 +1663,7 @@ export class SecurityCenterClient { ] = gax.routingHeader.fromParams({ 'source.name': request.source!.name || '', }); + this.initialize(); return this._innerApiCalls.updateSource(request, options, callback); } updateSecurityMarks( @@ -1710,6 +1754,7 @@ export class SecurityCenterClient { ] = gax.routingHeader.fromParams({ 'security_marks.name': request.securityMarks!.name || '', }); + this.initialize(); return this._innerApiCalls.updateSecurityMarks(request, options, callback); } @@ -1803,6 +1848,7 @@ export class SecurityCenterClient { ] = gax.routingHeader.fromParams({ parent: request.parent || '', }); + this.initialize(); return this._innerApiCalls.runAssetDiscovery(request, options, callback); } groupAssets( @@ -2008,6 +2054,7 @@ export class SecurityCenterClient { ] = gax.routingHeader.fromParams({ parent: request.parent || '', }); + this.initialize(); return this._innerApiCalls.groupAssets(request, options, callback); } @@ -2168,6 +2215,7 @@ export class SecurityCenterClient { parent: request.parent || '', }); const callSettings = new gax.CallSettings(options); + this.initialize(); return this._descriptors.page.groupAssets.createStream( this._innerApiCalls.groupAssets as gax.GaxCall, request, @@ -2364,6 +2412,7 @@ export class SecurityCenterClient { ] = gax.routingHeader.fromParams({ parent: request.parent || '', }); + this.initialize(); return this._innerApiCalls.groupFindings(request, options, callback); } @@ -2508,6 +2557,7 @@ export class SecurityCenterClient { parent: request.parent || '', }); const callSettings = new gax.CallSettings(options); + this.initialize(); return this._descriptors.page.groupFindings.createStream( this._innerApiCalls.groupFindings as gax.GaxCall, request, @@ -2721,6 +2771,7 @@ export class SecurityCenterClient { ] = gax.routingHeader.fromParams({ parent: request.parent || '', }); + this.initialize(); return this._innerApiCalls.listAssets(request, options, callback); } @@ -2886,6 +2937,7 @@ export class SecurityCenterClient { parent: request.parent || '', }); const callSettings = new gax.CallSettings(options); + this.initialize(); return this._descriptors.page.listAssets.createStream( this._innerApiCalls.listAssets as gax.GaxCall, request, @@ -3087,6 +3139,7 @@ export class SecurityCenterClient { ] = gax.routingHeader.fromParams({ parent: request.parent || '', }); + this.initialize(); return this._innerApiCalls.listFindings(request, options, callback); } @@ -3237,6 +3290,7 @@ export class SecurityCenterClient { parent: request.parent || '', }); const callSettings = new gax.CallSettings(options); + this.initialize(); return this._descriptors.page.listFindings.createStream( this._innerApiCalls.listFindings as gax.GaxCall, request, @@ -3332,6 +3386,7 @@ export class SecurityCenterClient { ] = gax.routingHeader.fromParams({ parent: request.parent || '', }); + this.initialize(); return this._innerApiCalls.listNotificationConfigs( request, options, @@ -3383,6 +3438,7 @@ export class SecurityCenterClient { parent: request.parent || '', }); const callSettings = new gax.CallSettings(options); + this.initialize(); return this._descriptors.page.listNotificationConfigs.createStream( this._innerApiCalls.listNotificationConfigs as gax.GaxCall, request, @@ -3478,6 +3534,7 @@ export class SecurityCenterClient { ] = gax.routingHeader.fromParams({ parent: request.parent || '', }); + this.initialize(); return this._innerApiCalls.listSources(request, options, callback); } @@ -3525,6 +3582,7 @@ export class SecurityCenterClient { parent: request.parent || '', }); const callSettings = new gax.CallSettings(options); + this.initialize(); return this._descriptors.page.listSources.createStream( this._innerApiCalls.listSources as gax.GaxCall, request, @@ -3862,8 +3920,9 @@ export class SecurityCenterClient { * The client will no longer be usable and all future behavior is undefined. */ close(): Promise { + this.initialize(); if (!this._terminated) { - return this.securityCenterStub.then(stub => { + return this.securityCenterStub!.then(stub => { this._terminated = true; stub.close(); }); diff --git a/packages/google-cloud-securitycenter/synth.metadata b/packages/google-cloud-securitycenter/synth.metadata index 414e2b09298..0925f1e5dbb 100644 --- a/packages/google-cloud-securitycenter/synth.metadata +++ b/packages/google-cloud-securitycenter/synth.metadata @@ -1,13 +1,13 @@ { - "updateTime": "2020-03-04T12:40:40.245405Z", + "updateTime": "2020-03-05T23:15:57.060814Z", "sources": [ { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "541b1ded4abadcc38e8178680b0677f65594ea6f", - "internalRef": "298686266", - "log": "541b1ded4abadcc38e8178680b0677f65594ea6f\nUpdate cloud asset api v1p4beta1.\n\nPiperOrigin-RevId: 298686266\n\nc0d171acecb4f5b0bfd2c4ca34fc54716574e300\n Updated to include the Notification v1 API.\n\nPiperOrigin-RevId: 298652775\n\n2346a9186c0bff2c9cc439f2459d558068637e05\nAdd Service Directory v1beta1 protos and configs\n\nPiperOrigin-RevId: 298625638\n\na78ed801b82a5c6d9c5368e24b1412212e541bb7\nPublishing v3 protos and configs.\n\nPiperOrigin-RevId: 298607357\n\n4a180bfff8a21645b3a935c2756e8d6ab18a74e0\nautoml/v1beta1 publish proto updates\n\nPiperOrigin-RevId: 298484782\n\n6de6e938b7df1cd62396563a067334abeedb9676\nchore: use the latest gapic-generator and protoc-java-resource-name-plugin in Bazel workspace.\n\nPiperOrigin-RevId: 298474513\n\n244ab2b83a82076a1fa7be63b7e0671af73f5c02\nAdds service config definition for bigqueryreservation v1\n\nPiperOrigin-RevId: 298455048\n\n" + "sha": "f0b581b5bdf803e45201ecdb3688b60e381628a8", + "internalRef": "299181282", + "log": "f0b581b5bdf803e45201ecdb3688b60e381628a8\nfix: recommendationengine/v1beta1 update some comments\n\nPiperOrigin-RevId: 299181282\n\n10e9a0a833dc85ff8f05b2c67ebe5ac785fe04ff\nbuild: add generated BUILD file for Routes Preferred API\n\nPiperOrigin-RevId: 299164808\n\n86738c956a8238d7c77f729be78b0ed887a6c913\npublish v1p1beta1: update with absolute address in comments\n\nPiperOrigin-RevId: 299152383\n\n73d9f2ad4591de45c2e1f352bc99d70cbd2a6d95\npublish v1: update with absolute address in comments\n\nPiperOrigin-RevId: 299147194\n\nd2158f24cb77b0b0ccfe68af784c6a628705e3c6\npublish v1beta2: update with absolute address in comments\n\nPiperOrigin-RevId: 299147086\n\n7fca61292c11b4cd5b352cee1a50bf88819dd63b\npublish v1p2beta1: update with absolute address in comments\n\nPiperOrigin-RevId: 299146903\n\n583b7321624736e2c490e328f4b1957335779295\npublish v1p3beta1: update with absolute address in comments\n\nPiperOrigin-RevId: 299146674\n\n638253bf86d1ce1c314108a089b7351440c2f0bf\nfix: add java_multiple_files option for automl text_sentiment.proto\n\nPiperOrigin-RevId: 298971070\n\n373d655703bf914fb8b0b1cc4071d772bac0e0d1\nUpdate Recs AI Beta public bazel file\n\nPiperOrigin-RevId: 298961623\n\ndcc5d00fc8a8d8b56f16194d7c682027b2c66a3b\nfix: add java_multiple_files option for automl classification.proto\n\nPiperOrigin-RevId: 298953301\n\na3f791827266f3496a6a5201d58adc4bb265c2a3\nchore: automl/v1 publish annotations and retry config\n\nPiperOrigin-RevId: 298942178\n\n01c681586d8d6dbd60155289b587aee678530bd9\nMark return_immediately in PullRequest deprecated.\n\nPiperOrigin-RevId: 298893281\n\nc9f5e9c4bfed54bbd09227e990e7bded5f90f31c\nRemove out of date documentation for predicate support on the Storage API\n\nPiperOrigin-RevId: 298883309\n\nfd5b3b8238d783b04692a113ffe07c0363f5de0f\ngenerate webrisk v1 proto\n\nPiperOrigin-RevId: 298847934\n\n" } }, { diff --git a/packages/google-cloud-securitycenter/test/gapic-security_center-v1.ts b/packages/google-cloud-securitycenter/test/gapic-security_center-v1.ts index 79521a6a46e..fb12e4f462f 100644 --- a/packages/google-cloud-securitycenter/test/gapic-security_center-v1.ts +++ b/packages/google-cloud-securitycenter/test/gapic-security_center-v1.ts @@ -104,12 +104,30 @@ describe('v1.SecurityCenterClient', () => { }); assert(client); }); + it('has initialize method and supports deferred initialization', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.securityCenterStub, undefined); + await client.initialize(); + assert(client.securityCenterStub); + }); + it('has close method', () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.close(); + }); describe('createSource', () => { it('invokes createSource without error', done => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.securitycenter.v1.ICreateSourceRequest = {}; request.parent = ''; @@ -133,6 +151,8 @@ describe('v1.SecurityCenterClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.securitycenter.v1.ICreateSourceRequest = {}; request.parent = ''; @@ -158,6 +178,8 @@ describe('v1.SecurityCenterClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.securitycenter.v1.ICreateFindingRequest = {}; request.parent = ''; @@ -181,6 +203,8 @@ describe('v1.SecurityCenterClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.securitycenter.v1.ICreateFindingRequest = {}; request.parent = ''; @@ -206,6 +230,8 @@ describe('v1.SecurityCenterClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.securitycenter.v1.ICreateNotificationConfigRequest = {}; request.parent = ''; @@ -229,6 +255,8 @@ describe('v1.SecurityCenterClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.securitycenter.v1.ICreateNotificationConfigRequest = {}; request.parent = ''; @@ -257,6 +285,8 @@ describe('v1.SecurityCenterClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.securitycenter.v1.IDeleteNotificationConfigRequest = {}; request.name = ''; @@ -280,6 +310,8 @@ describe('v1.SecurityCenterClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.securitycenter.v1.IDeleteNotificationConfigRequest = {}; request.name = ''; @@ -308,6 +340,8 @@ describe('v1.SecurityCenterClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.iam.v1.IGetIamPolicyRequest = {}; request.resource = ''; @@ -331,6 +365,8 @@ describe('v1.SecurityCenterClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.iam.v1.IGetIamPolicyRequest = {}; request.resource = ''; @@ -356,6 +392,8 @@ describe('v1.SecurityCenterClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.securitycenter.v1.IGetNotificationConfigRequest = {}; request.name = ''; @@ -379,6 +417,8 @@ describe('v1.SecurityCenterClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.securitycenter.v1.IGetNotificationConfigRequest = {}; request.name = ''; @@ -404,6 +444,8 @@ describe('v1.SecurityCenterClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.securitycenter.v1.IGetOrganizationSettingsRequest = {}; request.name = ''; @@ -427,6 +469,8 @@ describe('v1.SecurityCenterClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.securitycenter.v1.IGetOrganizationSettingsRequest = {}; request.name = ''; @@ -455,6 +499,8 @@ describe('v1.SecurityCenterClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.securitycenter.v1.IGetSourceRequest = {}; request.name = ''; @@ -478,6 +524,8 @@ describe('v1.SecurityCenterClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.securitycenter.v1.IGetSourceRequest = {}; request.name = ''; @@ -503,6 +551,8 @@ describe('v1.SecurityCenterClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.securitycenter.v1.ISetFindingStateRequest = {}; request.name = ''; @@ -526,6 +576,8 @@ describe('v1.SecurityCenterClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.securitycenter.v1.ISetFindingStateRequest = {}; request.name = ''; @@ -551,6 +603,8 @@ describe('v1.SecurityCenterClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.iam.v1.ISetIamPolicyRequest = {}; request.resource = ''; @@ -574,6 +628,8 @@ describe('v1.SecurityCenterClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.iam.v1.ISetIamPolicyRequest = {}; request.resource = ''; @@ -599,6 +655,8 @@ describe('v1.SecurityCenterClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.iam.v1.ITestIamPermissionsRequest = {}; request.resource = ''; @@ -622,6 +680,8 @@ describe('v1.SecurityCenterClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.iam.v1.ITestIamPermissionsRequest = {}; request.resource = ''; @@ -647,6 +707,8 @@ describe('v1.SecurityCenterClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.securitycenter.v1.IUpdateFindingRequest = {}; request.finding = {}; @@ -671,6 +733,8 @@ describe('v1.SecurityCenterClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.securitycenter.v1.IUpdateFindingRequest = {}; request.finding = {}; @@ -697,6 +761,8 @@ describe('v1.SecurityCenterClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.securitycenter.v1.IUpdateNotificationConfigRequest = {}; request.notificationConfig = {}; @@ -721,6 +787,8 @@ describe('v1.SecurityCenterClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.securitycenter.v1.IUpdateNotificationConfigRequest = {}; request.notificationConfig = {}; @@ -750,6 +818,8 @@ describe('v1.SecurityCenterClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.securitycenter.v1.IUpdateOrganizationSettingsRequest = {}; request.organizationSettings = {}; @@ -774,6 +844,8 @@ describe('v1.SecurityCenterClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.securitycenter.v1.IUpdateOrganizationSettingsRequest = {}; request.organizationSettings = {}; @@ -803,6 +875,8 @@ describe('v1.SecurityCenterClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.securitycenter.v1.IUpdateSourceRequest = {}; request.source = {}; @@ -827,6 +901,8 @@ describe('v1.SecurityCenterClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.securitycenter.v1.IUpdateSourceRequest = {}; request.source = {}; @@ -853,6 +929,8 @@ describe('v1.SecurityCenterClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.securitycenter.v1.IUpdateSecurityMarksRequest = {}; request.securityMarks = {}; @@ -877,6 +955,8 @@ describe('v1.SecurityCenterClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.securitycenter.v1.IUpdateSecurityMarksRequest = {}; request.securityMarks = {}; @@ -903,6 +983,8 @@ describe('v1.SecurityCenterClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.securitycenter.v1.IRunAssetDiscoveryRequest = {}; request.parent = ''; @@ -933,6 +1015,8 @@ describe('v1.SecurityCenterClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.securitycenter.v1.IRunAssetDiscoveryRequest = {}; request.parent = ''; @@ -966,6 +1050,8 @@ describe('v1.SecurityCenterClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.securitycenter.v1.IGroupAssetsRequest = {}; request.parent = ''; @@ -993,6 +1079,8 @@ describe('v1.SecurityCenterClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.securitycenter.v1.IGroupAssetsRequest = {}; request.parent = ''; @@ -1025,6 +1113,8 @@ describe('v1.SecurityCenterClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.securitycenter.v1.IGroupFindingsRequest = {}; request.parent = ''; @@ -1052,6 +1142,8 @@ describe('v1.SecurityCenterClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.securitycenter.v1.IGroupFindingsRequest = {}; request.parent = ''; @@ -1084,6 +1176,8 @@ describe('v1.SecurityCenterClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.securitycenter.v1.IListAssetsRequest = {}; request.parent = ''; @@ -1111,6 +1205,8 @@ describe('v1.SecurityCenterClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.securitycenter.v1.IListAssetsRequest = {}; request.parent = ''; @@ -1143,6 +1239,8 @@ describe('v1.SecurityCenterClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.securitycenter.v1.IListFindingsRequest = {}; request.parent = ''; @@ -1170,6 +1268,8 @@ describe('v1.SecurityCenterClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.securitycenter.v1.IListFindingsRequest = {}; request.parent = ''; @@ -1202,6 +1302,8 @@ describe('v1.SecurityCenterClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.securitycenter.v1.IListNotificationConfigsRequest = {}; request.parent = ''; @@ -1232,6 +1334,8 @@ describe('v1.SecurityCenterClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.securitycenter.v1.IListNotificationConfigsRequest = {}; request.parent = ''; @@ -1264,6 +1368,8 @@ describe('v1.SecurityCenterClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.securitycenter.v1.IListSourcesRequest = {}; request.parent = ''; @@ -1291,6 +1397,8 @@ describe('v1.SecurityCenterClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.securitycenter.v1.IListSourcesRequest = {}; request.parent = ''; diff --git a/packages/google-cloud-securitycenter/test/gapic-security_center-v1beta1.ts b/packages/google-cloud-securitycenter/test/gapic-security_center-v1beta1.ts index 1425d84de26..098ce8a0cbe 100644 --- a/packages/google-cloud-securitycenter/test/gapic-security_center-v1beta1.ts +++ b/packages/google-cloud-securitycenter/test/gapic-security_center-v1beta1.ts @@ -104,12 +104,30 @@ describe('v1beta1.SecurityCenterClient', () => { }); assert(client); }); + it('has initialize method and supports deferred initialization', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.securityCenterStub, undefined); + await client.initialize(); + assert(client.securityCenterStub); + }); + it('has close method', () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.close(); + }); describe('createSource', () => { it('invokes createSource without error', done => { const client = new securitycenterModule.v1beta1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.securitycenter.v1beta1.ICreateSourceRequest = {}; request.parent = ''; @@ -133,6 +151,8 @@ describe('v1beta1.SecurityCenterClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.securitycenter.v1beta1.ICreateSourceRequest = {}; request.parent = ''; @@ -158,6 +178,8 @@ describe('v1beta1.SecurityCenterClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.securitycenter.v1beta1.ICreateFindingRequest = {}; request.parent = ''; @@ -181,6 +203,8 @@ describe('v1beta1.SecurityCenterClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.securitycenter.v1beta1.ICreateFindingRequest = {}; request.parent = ''; @@ -206,6 +230,8 @@ describe('v1beta1.SecurityCenterClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.iam.v1.IGetIamPolicyRequest = {}; request.resource = ''; @@ -229,6 +255,8 @@ describe('v1beta1.SecurityCenterClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.iam.v1.IGetIamPolicyRequest = {}; request.resource = ''; @@ -254,6 +282,8 @@ describe('v1beta1.SecurityCenterClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.securitycenter.v1beta1.IGetOrganizationSettingsRequest = {}; request.name = ''; @@ -277,6 +307,8 @@ describe('v1beta1.SecurityCenterClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.securitycenter.v1beta1.IGetOrganizationSettingsRequest = {}; request.name = ''; @@ -305,6 +337,8 @@ describe('v1beta1.SecurityCenterClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.securitycenter.v1beta1.IGetSourceRequest = {}; request.name = ''; @@ -328,6 +362,8 @@ describe('v1beta1.SecurityCenterClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.securitycenter.v1beta1.IGetSourceRequest = {}; request.name = ''; @@ -353,6 +389,8 @@ describe('v1beta1.SecurityCenterClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.securitycenter.v1beta1.ISetFindingStateRequest = {}; request.name = ''; @@ -376,6 +414,8 @@ describe('v1beta1.SecurityCenterClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.securitycenter.v1beta1.ISetFindingStateRequest = {}; request.name = ''; @@ -401,6 +441,8 @@ describe('v1beta1.SecurityCenterClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.iam.v1.ISetIamPolicyRequest = {}; request.resource = ''; @@ -424,6 +466,8 @@ describe('v1beta1.SecurityCenterClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.iam.v1.ISetIamPolicyRequest = {}; request.resource = ''; @@ -449,6 +493,8 @@ describe('v1beta1.SecurityCenterClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.iam.v1.ITestIamPermissionsRequest = {}; request.resource = ''; @@ -472,6 +518,8 @@ describe('v1beta1.SecurityCenterClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.iam.v1.ITestIamPermissionsRequest = {}; request.resource = ''; @@ -497,6 +545,8 @@ describe('v1beta1.SecurityCenterClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.securitycenter.v1beta1.IUpdateFindingRequest = {}; request.finding = {}; @@ -521,6 +571,8 @@ describe('v1beta1.SecurityCenterClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.securitycenter.v1beta1.IUpdateFindingRequest = {}; request.finding = {}; @@ -547,6 +599,8 @@ describe('v1beta1.SecurityCenterClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.securitycenter.v1beta1.IUpdateOrganizationSettingsRequest = {}; request.organizationSettings = {}; @@ -571,6 +625,8 @@ describe('v1beta1.SecurityCenterClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.securitycenter.v1beta1.IUpdateOrganizationSettingsRequest = {}; request.organizationSettings = {}; @@ -600,6 +656,8 @@ describe('v1beta1.SecurityCenterClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.securitycenter.v1beta1.IUpdateSourceRequest = {}; request.source = {}; @@ -624,6 +682,8 @@ describe('v1beta1.SecurityCenterClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.securitycenter.v1beta1.IUpdateSourceRequest = {}; request.source = {}; @@ -650,6 +710,8 @@ describe('v1beta1.SecurityCenterClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.securitycenter.v1beta1.IUpdateSecurityMarksRequest = {}; request.securityMarks = {}; @@ -674,6 +736,8 @@ describe('v1beta1.SecurityCenterClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.securitycenter.v1beta1.IUpdateSecurityMarksRequest = {}; request.securityMarks = {}; @@ -700,6 +764,8 @@ describe('v1beta1.SecurityCenterClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.securitycenter.v1beta1.IRunAssetDiscoveryRequest = {}; request.parent = ''; @@ -730,6 +796,8 @@ describe('v1beta1.SecurityCenterClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.securitycenter.v1beta1.IRunAssetDiscoveryRequest = {}; request.parent = ''; @@ -763,6 +831,8 @@ describe('v1beta1.SecurityCenterClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.securitycenter.v1beta1.IGroupAssetsRequest = {}; request.parent = ''; @@ -790,6 +860,8 @@ describe('v1beta1.SecurityCenterClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.securitycenter.v1beta1.IGroupAssetsRequest = {}; request.parent = ''; @@ -822,6 +894,8 @@ describe('v1beta1.SecurityCenterClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.securitycenter.v1beta1.IGroupFindingsRequest = {}; request.parent = ''; @@ -849,6 +923,8 @@ describe('v1beta1.SecurityCenterClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.securitycenter.v1beta1.IGroupFindingsRequest = {}; request.parent = ''; @@ -881,6 +957,8 @@ describe('v1beta1.SecurityCenterClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.securitycenter.v1beta1.IListAssetsRequest = {}; request.parent = ''; @@ -908,6 +986,8 @@ describe('v1beta1.SecurityCenterClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.securitycenter.v1beta1.IListAssetsRequest = {}; request.parent = ''; @@ -940,6 +1020,8 @@ describe('v1beta1.SecurityCenterClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.securitycenter.v1beta1.IListFindingsRequest = {}; request.parent = ''; @@ -967,6 +1049,8 @@ describe('v1beta1.SecurityCenterClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.securitycenter.v1beta1.IListFindingsRequest = {}; request.parent = ''; @@ -999,6 +1083,8 @@ describe('v1beta1.SecurityCenterClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.securitycenter.v1beta1.IListSourcesRequest = {}; request.parent = ''; @@ -1026,6 +1112,8 @@ describe('v1beta1.SecurityCenterClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.securitycenter.v1beta1.IListSourcesRequest = {}; request.parent = ''; diff --git a/packages/google-cloud-securitycenter/test/gapic-security_center-v1p1beta1.ts b/packages/google-cloud-securitycenter/test/gapic-security_center-v1p1beta1.ts index 07995433eb0..c60edab460a 100644 --- a/packages/google-cloud-securitycenter/test/gapic-security_center-v1p1beta1.ts +++ b/packages/google-cloud-securitycenter/test/gapic-security_center-v1p1beta1.ts @@ -104,12 +104,30 @@ describe('v1p1beta1.SecurityCenterClient', () => { }); assert(client); }); + it('has initialize method and supports deferred initialization', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.securityCenterStub, undefined); + await client.initialize(); + assert(client.securityCenterStub); + }); + it('has close method', () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.close(); + }); describe('createSource', () => { it('invokes createSource without error', done => { const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.securitycenter.v1p1beta1.ICreateSourceRequest = {}; request.parent = ''; @@ -133,6 +151,8 @@ describe('v1p1beta1.SecurityCenterClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.securitycenter.v1p1beta1.ICreateSourceRequest = {}; request.parent = ''; @@ -158,6 +178,8 @@ describe('v1p1beta1.SecurityCenterClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.securitycenter.v1p1beta1.ICreateFindingRequest = {}; request.parent = ''; @@ -181,6 +203,8 @@ describe('v1p1beta1.SecurityCenterClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.securitycenter.v1p1beta1.ICreateFindingRequest = {}; request.parent = ''; @@ -206,6 +230,8 @@ describe('v1p1beta1.SecurityCenterClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.securitycenter.v1p1beta1.ICreateNotificationConfigRequest = {}; request.parent = ''; @@ -229,6 +255,8 @@ describe('v1p1beta1.SecurityCenterClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.securitycenter.v1p1beta1.ICreateNotificationConfigRequest = {}; request.parent = ''; @@ -257,6 +285,8 @@ describe('v1p1beta1.SecurityCenterClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.securitycenter.v1p1beta1.IDeleteNotificationConfigRequest = {}; request.name = ''; @@ -280,6 +310,8 @@ describe('v1p1beta1.SecurityCenterClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.securitycenter.v1p1beta1.IDeleteNotificationConfigRequest = {}; request.name = ''; @@ -308,6 +340,8 @@ describe('v1p1beta1.SecurityCenterClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.iam.v1.IGetIamPolicyRequest = {}; request.resource = ''; @@ -331,6 +365,8 @@ describe('v1p1beta1.SecurityCenterClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.iam.v1.IGetIamPolicyRequest = {}; request.resource = ''; @@ -356,6 +392,8 @@ describe('v1p1beta1.SecurityCenterClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.securitycenter.v1p1beta1.IGetNotificationConfigRequest = {}; request.name = ''; @@ -379,6 +417,8 @@ describe('v1p1beta1.SecurityCenterClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.securitycenter.v1p1beta1.IGetNotificationConfigRequest = {}; request.name = ''; @@ -404,6 +444,8 @@ describe('v1p1beta1.SecurityCenterClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.securitycenter.v1p1beta1.IGetOrganizationSettingsRequest = {}; request.name = ''; @@ -427,6 +469,8 @@ describe('v1p1beta1.SecurityCenterClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.securitycenter.v1p1beta1.IGetOrganizationSettingsRequest = {}; request.name = ''; @@ -455,6 +499,8 @@ describe('v1p1beta1.SecurityCenterClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.securitycenter.v1p1beta1.IGetSourceRequest = {}; request.name = ''; @@ -478,6 +524,8 @@ describe('v1p1beta1.SecurityCenterClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.securitycenter.v1p1beta1.IGetSourceRequest = {}; request.name = ''; @@ -503,6 +551,8 @@ describe('v1p1beta1.SecurityCenterClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.securitycenter.v1p1beta1.ISetFindingStateRequest = {}; request.name = ''; @@ -526,6 +576,8 @@ describe('v1p1beta1.SecurityCenterClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.securitycenter.v1p1beta1.ISetFindingStateRequest = {}; request.name = ''; @@ -551,6 +603,8 @@ describe('v1p1beta1.SecurityCenterClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.iam.v1.ISetIamPolicyRequest = {}; request.resource = ''; @@ -574,6 +628,8 @@ describe('v1p1beta1.SecurityCenterClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.iam.v1.ISetIamPolicyRequest = {}; request.resource = ''; @@ -599,6 +655,8 @@ describe('v1p1beta1.SecurityCenterClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.iam.v1.ITestIamPermissionsRequest = {}; request.resource = ''; @@ -622,6 +680,8 @@ describe('v1p1beta1.SecurityCenterClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.iam.v1.ITestIamPermissionsRequest = {}; request.resource = ''; @@ -647,6 +707,8 @@ describe('v1p1beta1.SecurityCenterClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.securitycenter.v1p1beta1.IUpdateFindingRequest = {}; request.finding = {}; @@ -671,6 +733,8 @@ describe('v1p1beta1.SecurityCenterClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.securitycenter.v1p1beta1.IUpdateFindingRequest = {}; request.finding = {}; @@ -697,6 +761,8 @@ describe('v1p1beta1.SecurityCenterClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.securitycenter.v1p1beta1.IUpdateNotificationConfigRequest = {}; request.notificationConfig = {}; @@ -721,6 +787,8 @@ describe('v1p1beta1.SecurityCenterClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.securitycenter.v1p1beta1.IUpdateNotificationConfigRequest = {}; request.notificationConfig = {}; @@ -750,6 +818,8 @@ describe('v1p1beta1.SecurityCenterClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.securitycenter.v1p1beta1.IUpdateOrganizationSettingsRequest = {}; request.organizationSettings = {}; @@ -774,6 +844,8 @@ describe('v1p1beta1.SecurityCenterClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.securitycenter.v1p1beta1.IUpdateOrganizationSettingsRequest = {}; request.organizationSettings = {}; @@ -803,6 +875,8 @@ describe('v1p1beta1.SecurityCenterClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.securitycenter.v1p1beta1.IUpdateSourceRequest = {}; request.source = {}; @@ -827,6 +901,8 @@ describe('v1p1beta1.SecurityCenterClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.securitycenter.v1p1beta1.IUpdateSourceRequest = {}; request.source = {}; @@ -853,6 +929,8 @@ describe('v1p1beta1.SecurityCenterClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.securitycenter.v1p1beta1.IUpdateSecurityMarksRequest = {}; request.securityMarks = {}; @@ -877,6 +955,8 @@ describe('v1p1beta1.SecurityCenterClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.securitycenter.v1p1beta1.IUpdateSecurityMarksRequest = {}; request.securityMarks = {}; @@ -903,6 +983,8 @@ describe('v1p1beta1.SecurityCenterClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.securitycenter.v1p1beta1.IRunAssetDiscoveryRequest = {}; request.parent = ''; @@ -933,6 +1015,8 @@ describe('v1p1beta1.SecurityCenterClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.securitycenter.v1p1beta1.IRunAssetDiscoveryRequest = {}; request.parent = ''; @@ -966,6 +1050,8 @@ describe('v1p1beta1.SecurityCenterClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.securitycenter.v1p1beta1.IGroupAssetsRequest = {}; request.parent = ''; @@ -993,6 +1079,8 @@ describe('v1p1beta1.SecurityCenterClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.securitycenter.v1p1beta1.IGroupAssetsRequest = {}; request.parent = ''; @@ -1025,6 +1113,8 @@ describe('v1p1beta1.SecurityCenterClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.securitycenter.v1p1beta1.IGroupFindingsRequest = {}; request.parent = ''; @@ -1052,6 +1142,8 @@ describe('v1p1beta1.SecurityCenterClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.securitycenter.v1p1beta1.IGroupFindingsRequest = {}; request.parent = ''; @@ -1084,6 +1176,8 @@ describe('v1p1beta1.SecurityCenterClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.securitycenter.v1p1beta1.IListAssetsRequest = {}; request.parent = ''; @@ -1111,6 +1205,8 @@ describe('v1p1beta1.SecurityCenterClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.securitycenter.v1p1beta1.IListAssetsRequest = {}; request.parent = ''; @@ -1143,6 +1239,8 @@ describe('v1p1beta1.SecurityCenterClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.securitycenter.v1p1beta1.IListFindingsRequest = {}; request.parent = ''; @@ -1170,6 +1268,8 @@ describe('v1p1beta1.SecurityCenterClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.securitycenter.v1p1beta1.IListFindingsRequest = {}; request.parent = ''; @@ -1202,6 +1302,8 @@ describe('v1p1beta1.SecurityCenterClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.securitycenter.v1p1beta1.IListNotificationConfigsRequest = {}; request.parent = ''; @@ -1232,6 +1334,8 @@ describe('v1p1beta1.SecurityCenterClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.securitycenter.v1p1beta1.IListNotificationConfigsRequest = {}; request.parent = ''; @@ -1264,6 +1368,8 @@ describe('v1p1beta1.SecurityCenterClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.securitycenter.v1p1beta1.IListSourcesRequest = {}; request.parent = ''; @@ -1291,6 +1397,8 @@ describe('v1p1beta1.SecurityCenterClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.securitycenter.v1p1beta1.IListSourcesRequest = {}; request.parent = ''; From 1b607df8071322e0ae5e1faae23b6090131d1687 Mon Sep 17 00:00:00 2001 From: "gcf-merge-on-green[bot]" <60162190+gcf-merge-on-green[bot]@users.noreply.github.com> Date: Fri, 6 Mar 2020 01:25:55 +0000 Subject: [PATCH 149/342] build: update linkinator config (#231) --- packages/google-cloud-securitycenter/linkinator.config.json | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/google-cloud-securitycenter/linkinator.config.json b/packages/google-cloud-securitycenter/linkinator.config.json index b555215ca02..29a223b6db6 100644 --- a/packages/google-cloud-securitycenter/linkinator.config.json +++ b/packages/google-cloud-securitycenter/linkinator.config.json @@ -4,5 +4,7 @@ "https://codecov.io/gh/googleapis/", "www.googleapis.com", "img.shields.io" - ] + ], + "silent": true, + "concurrency": 10 } From 2129e2e30afcdf4b0239fd2d965cc914ef29fa3d Mon Sep 17 00:00:00 2001 From: "Benjamin E. Coe" Date: Fri, 6 Mar 2020 15:00:08 -0800 Subject: [PATCH 150/342] build(tests): fix coveralls and enable build cop (#232) --- .../google-cloud-securitycenter/.mocharc.js | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 packages/google-cloud-securitycenter/.mocharc.js diff --git a/packages/google-cloud-securitycenter/.mocharc.js b/packages/google-cloud-securitycenter/.mocharc.js new file mode 100644 index 00000000000..ff7b34fa5d1 --- /dev/null +++ b/packages/google-cloud-securitycenter/.mocharc.js @@ -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 +// +// 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 +} +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 From f40a1ec5372b68906c2595ca46cee044e9d9fa7d Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 11 Mar 2020 12:55:02 -0700 Subject: [PATCH 151/342] chore: release 3.1.0 (#218) --- packages/google-cloud-securitycenter/CHANGELOG.md | 13 +++++++++++++ packages/google-cloud-securitycenter/package.json | 2 +- .../samples/package.json | 2 +- 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-securitycenter/CHANGELOG.md b/packages/google-cloud-securitycenter/CHANGELOG.md index 9c7d629f343..9c44f8727b8 100644 --- a/packages/google-cloud-securitycenter/CHANGELOG.md +++ b/packages/google-cloud-securitycenter/CHANGELOG.md @@ -4,6 +4,19 @@ [1]: https://www.npmjs.com/package/@google-cloud/security-center?activeTab=versions +## [3.1.0](https://www.github.com/googleapis/nodejs-security-center/compare/v3.0.1...v3.1.0) (2020-03-06) + + +### Features + +* deferred client initialization ([#230](https://www.github.com/googleapis/nodejs-security-center/issues/230)) ([e6ee806](https://www.github.com/googleapis/nodejs-security-center/commit/e6ee8064285adfb64666dd976da401a123c0d8a1)) +* export protos in src/index.ts ([f3b2f47](https://www.github.com/googleapis/nodejs-security-center/commit/f3b2f477aa0af4d3f5a5c1d3b191643986f1c48b)) + + +### Bug Fixes + +* updated timeout in service config ([280cba4](https://www.github.com/googleapis/nodejs-security-center/commit/280cba439c681fcf7be0b936f052ebdaf215c850)) + ### [3.0.1](https://www.github.com/googleapis/nodejs-security-center/compare/v3.0.0...v3.0.1) (2020-02-07) diff --git a/packages/google-cloud-securitycenter/package.json b/packages/google-cloud-securitycenter/package.json index 1b26c3dbe68..69e8f0a3ef7 100644 --- a/packages/google-cloud-securitycenter/package.json +++ b/packages/google-cloud-securitycenter/package.json @@ -1,7 +1,7 @@ { "name": "@google-cloud/security-center", "description": "Cloud Security Command Center API client for Node.js", - "version": "3.0.1", + "version": "3.1.0", "license": "Apache-2.0", "author": "Google LLC", "engines": { diff --git a/packages/google-cloud-securitycenter/samples/package.json b/packages/google-cloud-securitycenter/samples/package.json index a3e79fb625d..273782ac86b 100644 --- a/packages/google-cloud-securitycenter/samples/package.json +++ b/packages/google-cloud-securitycenter/samples/package.json @@ -14,7 +14,7 @@ "license": "Apache-2.0", "dependencies": { "@google-cloud/pubsub": "^1.5.0", - "@google-cloud/security-center": "^3.0.1" + "@google-cloud/security-center": "^3.1.0" }, "devDependencies": { "chai": "^4.2.0", From dbfc5960eccf400740cbe7b774cac6b609de5456 Mon Sep 17 00:00:00 2001 From: "Benjamin E. Coe" Date: Wed, 11 Mar 2020 13:08:22 -0700 Subject: [PATCH 152/342] chore: update to latest version of uuid (#235) --- packages/google-cloud-securitycenter/samples/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-securitycenter/samples/package.json b/packages/google-cloud-securitycenter/samples/package.json index 273782ac86b..bcdb060c270 100644 --- a/packages/google-cloud-securitycenter/samples/package.json +++ b/packages/google-cloud-securitycenter/samples/package.json @@ -19,6 +19,6 @@ "devDependencies": { "chai": "^4.2.0", "mocha": "^7.0.0", - "uuid": "^3.4.0" + "uuid": "^7.0.2" } } From c2ea27d17830779c17c4e4e1c42ae1a424c441c6 Mon Sep 17 00:00:00 2001 From: "Benjamin E. Coe" Date: Wed, 18 Mar 2020 13:02:53 -0700 Subject: [PATCH 153/342] docs: mention templates in contributing section of README (#237) --- packages/google-cloud-securitycenter/README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/google-cloud-securitycenter/README.md b/packages/google-cloud-securitycenter/README.md index 0e9c4d6982f..9eb9245eac0 100644 --- a/packages/google-cloud-securitycenter/README.md +++ b/packages/google-cloud-securitycenter/README.md @@ -122,6 +122,12 @@ More Information: [Google Cloud Platform Launch Stages][launch_stages] Contributions welcome! See the [Contributing Guide](https://github.com/googleapis/nodejs-security-center/blob/master/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 template in this +[directory](https://github.com/googleapis/synthtool/tree/master/synthtool/gcp/templates/node_library). + ## License Apache Version 2.0 From 2da6274bd7d3cf9a54ba9e323fe412de4a6b6690 Mon Sep 17 00:00:00 2001 From: Jeff Ching Date: Thu, 19 Mar 2020 08:56:38 -0700 Subject: [PATCH 154/342] chore: remove snippet leading whitespace (#239) --- .../google-cloud-securitycenter/README.md | 34 +++++++++---------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/packages/google-cloud-securitycenter/README.md b/packages/google-cloud-securitycenter/README.md index 9eb9245eac0..ff7d74c2bcd 100644 --- a/packages/google-cloud-securitycenter/README.md +++ b/packages/google-cloud-securitycenter/README.md @@ -63,23 +63,23 @@ npm install @google-cloud/security-center ### Using the client library ```javascript - const sc = require('@google-cloud/security-center'); - - // Create a client - const client = new sc.SecurityCenterClient(); - - async function quickstart() { - // TODO(developer): choose the organization to use - // const organization = 'your-organization'; - const [source] = await client.createSource({ - parent: client.organizationPath(organization), - source: {}, - }); - // The newly created source. - console.log('Source created.'); - console.log(source); - } - quickstart(); +const sc = require('@google-cloud/security-center'); + +// Create a client +const client = new sc.SecurityCenterClient(); + +async function quickstart() { + // TODO(developer): choose the organization to use + // const organization = 'your-organization'; + const [source] = await client.createSource({ + parent: client.organizationPath(organization), + source: {}, + }); + // The newly created source. + console.log('Source created.'); + console.log(source); +} +quickstart(); ``` From a697fe09e2efab29ace36297e89f087925ed3aad Mon Sep 17 00:00:00 2001 From: "Benjamin E. Coe" Date: Mon, 23 Mar 2020 18:30:57 -0700 Subject: [PATCH 155/342] docs: document version support goals (#244) --- .../google-cloud-securitycenter/README.md | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/packages/google-cloud-securitycenter/README.md b/packages/google-cloud-securitycenter/README.md index ff7d74c2bcd..19cbedd2b76 100644 --- a/packages/google-cloud-securitycenter/README.md +++ b/packages/google-cloud-securitycenter/README.md @@ -99,6 +99,27 @@ has instructions for running the samples. The [Google Cloud Security Command Center 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. + +Client libraries targetting some end-of-life versions of Node.js are available, and +can be installed via npm [dist-tags](https://docs.npmjs.com/cli/dist-tag). +The dist-tags follow the naming convention `legacy-(version)`. + +_Legacy Node.js versions are supported as a best effort:_ + +* Legacy versions will not be tested in continuous integration. +* Some security patches may not be able to be backported. +* Dependencies will not be kept up-to-date, and features will not be backported. + +#### Legacy tags available + +* `legacy-8`: install client libraries from this dist-tag for versions + compatible with Node.js 8. + ## Versioning This library follows [Semantic Versioning](http://semver.org/). From 4e1502a22cdb81669f94260901784a2ca9c2f1f6 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Wed, 25 Mar 2020 02:00:29 -0700 Subject: [PATCH 156/342] chore: regenerate the code Co-authored-by: Alexander Fenster --- .../google-cloud-securitycenter/.jsdoc.js | 2 +- .../src/v1/index.ts | 2 +- .../src/v1/security_center_client.ts | 116 ++++++++++-------- .../src/v1beta1/index.ts | 2 +- .../src/v1beta1/security_center_client.ts | 116 ++++++++++-------- .../src/v1p1beta1/index.ts | 2 +- .../src/v1p1beta1/security_center_client.ts | 116 ++++++++++-------- .../synth.metadata | 16 +-- .../system-test/fixtures/sample/src/index.js | 2 +- .../system-test/fixtures/sample/src/index.ts | 2 +- .../system-test/install.ts | 2 +- .../test/gapic-security_center-v1.ts | 2 +- .../test/gapic-security_center-v1beta1.ts | 2 +- .../test/gapic-security_center-v1p1beta1.ts | 2 +- .../webpack.config.js | 2 +- 15 files changed, 214 insertions(+), 172 deletions(-) diff --git a/packages/google-cloud-securitycenter/.jsdoc.js b/packages/google-cloud-securitycenter/.jsdoc.js index f0f6eea651e..f877c24c4a8 100644 --- a/packages/google-cloud-securitycenter/.jsdoc.js +++ b/packages/google-cloud-securitycenter/.jsdoc.js @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC +// 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. diff --git a/packages/google-cloud-securitycenter/src/v1/index.ts b/packages/google-cloud-securitycenter/src/v1/index.ts index a44e8075d6f..2ce663a0a64 100644 --- a/packages/google-cloud-securitycenter/src/v1/index.ts +++ b/packages/google-cloud-securitycenter/src/v1/index.ts @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC +// 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. diff --git a/packages/google-cloud-securitycenter/src/v1/security_center_client.ts b/packages/google-cloud-securitycenter/src/v1/security_center_client.ts index c3834524b57..455c74bdf37 100644 --- a/packages/google-cloud-securitycenter/src/v1/security_center_client.ts +++ b/packages/google-cloud-securitycenter/src/v1/security_center_client.ts @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC +// 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. @@ -41,7 +41,12 @@ const version = require('../../../package.json').version; * @memberof v1 */ export class SecurityCenterClient { - private _descriptors: Descriptors = {page: {}, stream: {}, longrunning: {}}; + private _descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; private _innerApiCalls: {[name: string]: Function}; private _pathTemplates: {[name: string]: gax.PathTemplate}; private _terminated = false; @@ -162,13 +167,13 @@ export class SecurityCenterClient { organizationPathTemplate: new this._gaxModule.PathTemplate( 'organizations/{organization}' ), - organizationAssetPathTemplate: new this._gaxModule.PathTemplate( + organizationAssetSecurityMarksPathTemplate: new this._gaxModule.PathTemplate( 'organizations/{organization}/assets/{asset}/securityMarks' ), organizationSettingsPathTemplate: new this._gaxModule.PathTemplate( 'organizations/{organization}/organizationSettings' ), - organizationSourceFindingPathTemplate: new this._gaxModule.PathTemplate( + organizationSourceFindingSecurityMarksPathTemplate: new this._gaxModule.PathTemplate( 'organizations/{organization}/sources/{source}/findings/{finding}/securityMarks' ), sourcePathTemplate: new this._gaxModule.PathTemplate( @@ -319,7 +324,8 @@ export class SecurityCenterClient { if (this._terminated) { return Promise.reject('The client has already been closed.'); } - return stub[methodName].apply(stub, args); + const func = stub[methodName]; + return func.apply(stub, args); }, (err: Error | null | undefined) => () => { throw err; @@ -3721,42 +3727,48 @@ export class SecurityCenterClient { } /** - * Return a fully-qualified organizationAsset resource name string. + * Return a fully-qualified organizationAssetSecurityMarks resource name string. * * @param {string} organization * @param {string} asset * @returns {string} Resource name string. */ - organizationAssetPath(organization: string, asset: string) { - return this._pathTemplates.organizationAssetPathTemplate.render({ - organization, - asset, - }); + organizationAssetSecurityMarksPath(organization: string, asset: string) { + return this._pathTemplates.organizationAssetSecurityMarksPathTemplate.render( + { + organization, + asset, + } + ); } /** - * Parse the organization from OrganizationAsset resource. + * Parse the organization from OrganizationAssetSecurityMarks resource. * - * @param {string} organizationAssetName - * A fully-qualified path representing organization_asset resource. + * @param {string} organizationAssetSecurityMarksName + * A fully-qualified path representing organization_asset_securityMarks resource. * @returns {string} A string representing the organization. */ - matchOrganizationFromOrganizationAssetName(organizationAssetName: string) { - return this._pathTemplates.organizationAssetPathTemplate.match( - organizationAssetName + matchOrganizationFromOrganizationAssetSecurityMarksName( + organizationAssetSecurityMarksName: string + ) { + return this._pathTemplates.organizationAssetSecurityMarksPathTemplate.match( + organizationAssetSecurityMarksName ).organization; } /** - * Parse the asset from OrganizationAsset resource. + * Parse the asset from OrganizationAssetSecurityMarks resource. * - * @param {string} organizationAssetName - * A fully-qualified path representing organization_asset resource. + * @param {string} organizationAssetSecurityMarksName + * A fully-qualified path representing organization_asset_securityMarks resource. * @returns {string} A string representing the asset. */ - matchAssetFromOrganizationAssetName(organizationAssetName: string) { - return this._pathTemplates.organizationAssetPathTemplate.match( - organizationAssetName + matchAssetFromOrganizationAssetSecurityMarksName( + organizationAssetSecurityMarksName: string + ) { + return this._pathTemplates.organizationAssetSecurityMarksPathTemplate.match( + organizationAssetSecurityMarksName ).asset; } @@ -3788,67 +3800,69 @@ export class SecurityCenterClient { } /** - * Return a fully-qualified organizationSourceFinding resource name string. + * Return a fully-qualified organizationSourceFindingSecurityMarks resource name string. * * @param {string} organization * @param {string} source * @param {string} finding * @returns {string} Resource name string. */ - organizationSourceFindingPath( + organizationSourceFindingSecurityMarksPath( organization: string, source: string, finding: string ) { - return this._pathTemplates.organizationSourceFindingPathTemplate.render({ - organization, - source, - finding, - }); + return this._pathTemplates.organizationSourceFindingSecurityMarksPathTemplate.render( + { + organization, + source, + finding, + } + ); } /** - * Parse the organization from OrganizationSourceFinding resource. + * Parse the organization from OrganizationSourceFindingSecurityMarks resource. * - * @param {string} organizationSourceFindingName - * A fully-qualified path representing organization_source_finding resource. + * @param {string} organizationSourceFindingSecurityMarksName + * A fully-qualified path representing organization_source_finding_securityMarks resource. * @returns {string} A string representing the organization. */ - matchOrganizationFromOrganizationSourceFindingName( - organizationSourceFindingName: string + matchOrganizationFromOrganizationSourceFindingSecurityMarksName( + organizationSourceFindingSecurityMarksName: string ) { - return this._pathTemplates.organizationSourceFindingPathTemplate.match( - organizationSourceFindingName + return this._pathTemplates.organizationSourceFindingSecurityMarksPathTemplate.match( + organizationSourceFindingSecurityMarksName ).organization; } /** - * Parse the source from OrganizationSourceFinding resource. + * Parse the source from OrganizationSourceFindingSecurityMarks resource. * - * @param {string} organizationSourceFindingName - * A fully-qualified path representing organization_source_finding resource. + * @param {string} organizationSourceFindingSecurityMarksName + * A fully-qualified path representing organization_source_finding_securityMarks resource. * @returns {string} A string representing the source. */ - matchSourceFromOrganizationSourceFindingName( - organizationSourceFindingName: string + matchSourceFromOrganizationSourceFindingSecurityMarksName( + organizationSourceFindingSecurityMarksName: string ) { - return this._pathTemplates.organizationSourceFindingPathTemplate.match( - organizationSourceFindingName + return this._pathTemplates.organizationSourceFindingSecurityMarksPathTemplate.match( + organizationSourceFindingSecurityMarksName ).source; } /** - * Parse the finding from OrganizationSourceFinding resource. + * Parse the finding from OrganizationSourceFindingSecurityMarks resource. * - * @param {string} organizationSourceFindingName - * A fully-qualified path representing organization_source_finding resource. + * @param {string} organizationSourceFindingSecurityMarksName + * A fully-qualified path representing organization_source_finding_securityMarks resource. * @returns {string} A string representing the finding. */ - matchFindingFromOrganizationSourceFindingName( - organizationSourceFindingName: string + matchFindingFromOrganizationSourceFindingSecurityMarksName( + organizationSourceFindingSecurityMarksName: string ) { - return this._pathTemplates.organizationSourceFindingPathTemplate.match( - organizationSourceFindingName + return this._pathTemplates.organizationSourceFindingSecurityMarksPathTemplate.match( + organizationSourceFindingSecurityMarksName ).finding; } diff --git a/packages/google-cloud-securitycenter/src/v1beta1/index.ts b/packages/google-cloud-securitycenter/src/v1beta1/index.ts index a44e8075d6f..2ce663a0a64 100644 --- a/packages/google-cloud-securitycenter/src/v1beta1/index.ts +++ b/packages/google-cloud-securitycenter/src/v1beta1/index.ts @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC +// 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. diff --git a/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.ts b/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.ts index 2fb75e362cc..ca5c7b7d5e7 100644 --- a/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.ts +++ b/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.ts @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC +// 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. @@ -41,7 +41,12 @@ const version = require('../../../package.json').version; * @memberof v1beta1 */ export class SecurityCenterClient { - private _descriptors: Descriptors = {page: {}, stream: {}, longrunning: {}}; + private _descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; private _innerApiCalls: {[name: string]: Function}; private _pathTemplates: {[name: string]: gax.PathTemplate}; private _terminated = false; @@ -156,13 +161,13 @@ export class SecurityCenterClient { organizationPathTemplate: new this._gaxModule.PathTemplate( 'organizations/{organization}' ), - organizationAssetPathTemplate: new this._gaxModule.PathTemplate( + organizationAssetSecurityMarksPathTemplate: new this._gaxModule.PathTemplate( 'organizations/{organization}/assets/{asset}/securityMarks' ), organizationSettingsPathTemplate: new this._gaxModule.PathTemplate( 'organizations/{organization}/organizationSettings' ), - organizationSourceFindingPathTemplate: new this._gaxModule.PathTemplate( + organizationSourceFindingSecurityMarksPathTemplate: new this._gaxModule.PathTemplate( 'organizations/{organization}/sources/{source}/findings/{finding}/securityMarks' ), sourcePathTemplate: new this._gaxModule.PathTemplate( @@ -304,7 +309,8 @@ export class SecurityCenterClient { if (this._terminated) { return Promise.reject('The client has already been closed.'); } - return stub[methodName].apply(stub, args); + const func = stub[methodName]; + return func.apply(stub, args); }, (err: Error | null | undefined) => () => { throw err; @@ -2728,42 +2734,48 @@ export class SecurityCenterClient { } /** - * Return a fully-qualified organizationAsset resource name string. + * Return a fully-qualified organizationAssetSecurityMarks resource name string. * * @param {string} organization * @param {string} asset * @returns {string} Resource name string. */ - organizationAssetPath(organization: string, asset: string) { - return this._pathTemplates.organizationAssetPathTemplate.render({ - organization, - asset, - }); + organizationAssetSecurityMarksPath(organization: string, asset: string) { + return this._pathTemplates.organizationAssetSecurityMarksPathTemplate.render( + { + organization, + asset, + } + ); } /** - * Parse the organization from OrganizationAsset resource. + * Parse the organization from OrganizationAssetSecurityMarks resource. * - * @param {string} organizationAssetName - * A fully-qualified path representing organization_asset resource. + * @param {string} organizationAssetSecurityMarksName + * A fully-qualified path representing organization_asset_securityMarks resource. * @returns {string} A string representing the organization. */ - matchOrganizationFromOrganizationAssetName(organizationAssetName: string) { - return this._pathTemplates.organizationAssetPathTemplate.match( - organizationAssetName + matchOrganizationFromOrganizationAssetSecurityMarksName( + organizationAssetSecurityMarksName: string + ) { + return this._pathTemplates.organizationAssetSecurityMarksPathTemplate.match( + organizationAssetSecurityMarksName ).organization; } /** - * Parse the asset from OrganizationAsset resource. + * Parse the asset from OrganizationAssetSecurityMarks resource. * - * @param {string} organizationAssetName - * A fully-qualified path representing organization_asset resource. + * @param {string} organizationAssetSecurityMarksName + * A fully-qualified path representing organization_asset_securityMarks resource. * @returns {string} A string representing the asset. */ - matchAssetFromOrganizationAssetName(organizationAssetName: string) { - return this._pathTemplates.organizationAssetPathTemplate.match( - organizationAssetName + matchAssetFromOrganizationAssetSecurityMarksName( + organizationAssetSecurityMarksName: string + ) { + return this._pathTemplates.organizationAssetSecurityMarksPathTemplate.match( + organizationAssetSecurityMarksName ).asset; } @@ -2795,67 +2807,69 @@ export class SecurityCenterClient { } /** - * Return a fully-qualified organizationSourceFinding resource name string. + * Return a fully-qualified organizationSourceFindingSecurityMarks resource name string. * * @param {string} organization * @param {string} source * @param {string} finding * @returns {string} Resource name string. */ - organizationSourceFindingPath( + organizationSourceFindingSecurityMarksPath( organization: string, source: string, finding: string ) { - return this._pathTemplates.organizationSourceFindingPathTemplate.render({ - organization, - source, - finding, - }); + return this._pathTemplates.organizationSourceFindingSecurityMarksPathTemplate.render( + { + organization, + source, + finding, + } + ); } /** - * Parse the organization from OrganizationSourceFinding resource. + * Parse the organization from OrganizationSourceFindingSecurityMarks resource. * - * @param {string} organizationSourceFindingName - * A fully-qualified path representing organization_source_finding resource. + * @param {string} organizationSourceFindingSecurityMarksName + * A fully-qualified path representing organization_source_finding_securityMarks resource. * @returns {string} A string representing the organization. */ - matchOrganizationFromOrganizationSourceFindingName( - organizationSourceFindingName: string + matchOrganizationFromOrganizationSourceFindingSecurityMarksName( + organizationSourceFindingSecurityMarksName: string ) { - return this._pathTemplates.organizationSourceFindingPathTemplate.match( - organizationSourceFindingName + return this._pathTemplates.organizationSourceFindingSecurityMarksPathTemplate.match( + organizationSourceFindingSecurityMarksName ).organization; } /** - * Parse the source from OrganizationSourceFinding resource. + * Parse the source from OrganizationSourceFindingSecurityMarks resource. * - * @param {string} organizationSourceFindingName - * A fully-qualified path representing organization_source_finding resource. + * @param {string} organizationSourceFindingSecurityMarksName + * A fully-qualified path representing organization_source_finding_securityMarks resource. * @returns {string} A string representing the source. */ - matchSourceFromOrganizationSourceFindingName( - organizationSourceFindingName: string + matchSourceFromOrganizationSourceFindingSecurityMarksName( + organizationSourceFindingSecurityMarksName: string ) { - return this._pathTemplates.organizationSourceFindingPathTemplate.match( - organizationSourceFindingName + return this._pathTemplates.organizationSourceFindingSecurityMarksPathTemplate.match( + organizationSourceFindingSecurityMarksName ).source; } /** - * Parse the finding from OrganizationSourceFinding resource. + * Parse the finding from OrganizationSourceFindingSecurityMarks resource. * - * @param {string} organizationSourceFindingName - * A fully-qualified path representing organization_source_finding resource. + * @param {string} organizationSourceFindingSecurityMarksName + * A fully-qualified path representing organization_source_finding_securityMarks resource. * @returns {string} A string representing the finding. */ - matchFindingFromOrganizationSourceFindingName( - organizationSourceFindingName: string + matchFindingFromOrganizationSourceFindingSecurityMarksName( + organizationSourceFindingSecurityMarksName: string ) { - return this._pathTemplates.organizationSourceFindingPathTemplate.match( - organizationSourceFindingName + return this._pathTemplates.organizationSourceFindingSecurityMarksPathTemplate.match( + organizationSourceFindingSecurityMarksName ).finding; } diff --git a/packages/google-cloud-securitycenter/src/v1p1beta1/index.ts b/packages/google-cloud-securitycenter/src/v1p1beta1/index.ts index a44e8075d6f..2ce663a0a64 100644 --- a/packages/google-cloud-securitycenter/src/v1p1beta1/index.ts +++ b/packages/google-cloud-securitycenter/src/v1p1beta1/index.ts @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC +// 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. diff --git a/packages/google-cloud-securitycenter/src/v1p1beta1/security_center_client.ts b/packages/google-cloud-securitycenter/src/v1p1beta1/security_center_client.ts index 0f4069e5be2..18b047d6535 100644 --- a/packages/google-cloud-securitycenter/src/v1p1beta1/security_center_client.ts +++ b/packages/google-cloud-securitycenter/src/v1p1beta1/security_center_client.ts @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC +// 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. @@ -41,7 +41,12 @@ const version = require('../../../package.json').version; * @memberof v1p1beta1 */ export class SecurityCenterClient { - private _descriptors: Descriptors = {page: {}, stream: {}, longrunning: {}}; + private _descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; private _innerApiCalls: {[name: string]: Function}; private _pathTemplates: {[name: string]: gax.PathTemplate}; private _terminated = false; @@ -162,13 +167,13 @@ export class SecurityCenterClient { organizationPathTemplate: new this._gaxModule.PathTemplate( 'organizations/{organization}' ), - organizationAssetPathTemplate: new this._gaxModule.PathTemplate( + organizationAssetSecurityMarksPathTemplate: new this._gaxModule.PathTemplate( 'organizations/{organization}/assets/{asset}/securityMarks' ), organizationSettingsPathTemplate: new this._gaxModule.PathTemplate( 'organizations/{organization}/organizationSettings' ), - organizationSourceFindingPathTemplate: new this._gaxModule.PathTemplate( + organizationSourceFindingSecurityMarksPathTemplate: new this._gaxModule.PathTemplate( 'organizations/{organization}/sources/{source}/findings/{finding}/securityMarks' ), sourcePathTemplate: new this._gaxModule.PathTemplate( @@ -320,7 +325,8 @@ export class SecurityCenterClient { if (this._terminated) { return Promise.reject('The client has already been closed.'); } - return stub[methodName].apply(stub, args); + const func = stub[methodName]; + return func.apply(stub, args); }, (err: Error | null | undefined) => () => { throw err; @@ -3746,42 +3752,48 @@ export class SecurityCenterClient { } /** - * Return a fully-qualified organizationAsset resource name string. + * Return a fully-qualified organizationAssetSecurityMarks resource name string. * * @param {string} organization * @param {string} asset * @returns {string} Resource name string. */ - organizationAssetPath(organization: string, asset: string) { - return this._pathTemplates.organizationAssetPathTemplate.render({ - organization, - asset, - }); + organizationAssetSecurityMarksPath(organization: string, asset: string) { + return this._pathTemplates.organizationAssetSecurityMarksPathTemplate.render( + { + organization, + asset, + } + ); } /** - * Parse the organization from OrganizationAsset resource. + * Parse the organization from OrganizationAssetSecurityMarks resource. * - * @param {string} organizationAssetName - * A fully-qualified path representing organization_asset resource. + * @param {string} organizationAssetSecurityMarksName + * A fully-qualified path representing organization_asset_securityMarks resource. * @returns {string} A string representing the organization. */ - matchOrganizationFromOrganizationAssetName(organizationAssetName: string) { - return this._pathTemplates.organizationAssetPathTemplate.match( - organizationAssetName + matchOrganizationFromOrganizationAssetSecurityMarksName( + organizationAssetSecurityMarksName: string + ) { + return this._pathTemplates.organizationAssetSecurityMarksPathTemplate.match( + organizationAssetSecurityMarksName ).organization; } /** - * Parse the asset from OrganizationAsset resource. + * Parse the asset from OrganizationAssetSecurityMarks resource. * - * @param {string} organizationAssetName - * A fully-qualified path representing organization_asset resource. + * @param {string} organizationAssetSecurityMarksName + * A fully-qualified path representing organization_asset_securityMarks resource. * @returns {string} A string representing the asset. */ - matchAssetFromOrganizationAssetName(organizationAssetName: string) { - return this._pathTemplates.organizationAssetPathTemplate.match( - organizationAssetName + matchAssetFromOrganizationAssetSecurityMarksName( + organizationAssetSecurityMarksName: string + ) { + return this._pathTemplates.organizationAssetSecurityMarksPathTemplate.match( + organizationAssetSecurityMarksName ).asset; } @@ -3813,67 +3825,69 @@ export class SecurityCenterClient { } /** - * Return a fully-qualified organizationSourceFinding resource name string. + * Return a fully-qualified organizationSourceFindingSecurityMarks resource name string. * * @param {string} organization * @param {string} source * @param {string} finding * @returns {string} Resource name string. */ - organizationSourceFindingPath( + organizationSourceFindingSecurityMarksPath( organization: string, source: string, finding: string ) { - return this._pathTemplates.organizationSourceFindingPathTemplate.render({ - organization, - source, - finding, - }); + return this._pathTemplates.organizationSourceFindingSecurityMarksPathTemplate.render( + { + organization, + source, + finding, + } + ); } /** - * Parse the organization from OrganizationSourceFinding resource. + * Parse the organization from OrganizationSourceFindingSecurityMarks resource. * - * @param {string} organizationSourceFindingName - * A fully-qualified path representing organization_source_finding resource. + * @param {string} organizationSourceFindingSecurityMarksName + * A fully-qualified path representing organization_source_finding_securityMarks resource. * @returns {string} A string representing the organization. */ - matchOrganizationFromOrganizationSourceFindingName( - organizationSourceFindingName: string + matchOrganizationFromOrganizationSourceFindingSecurityMarksName( + organizationSourceFindingSecurityMarksName: string ) { - return this._pathTemplates.organizationSourceFindingPathTemplate.match( - organizationSourceFindingName + return this._pathTemplates.organizationSourceFindingSecurityMarksPathTemplate.match( + organizationSourceFindingSecurityMarksName ).organization; } /** - * Parse the source from OrganizationSourceFinding resource. + * Parse the source from OrganizationSourceFindingSecurityMarks resource. * - * @param {string} organizationSourceFindingName - * A fully-qualified path representing organization_source_finding resource. + * @param {string} organizationSourceFindingSecurityMarksName + * A fully-qualified path representing organization_source_finding_securityMarks resource. * @returns {string} A string representing the source. */ - matchSourceFromOrganizationSourceFindingName( - organizationSourceFindingName: string + matchSourceFromOrganizationSourceFindingSecurityMarksName( + organizationSourceFindingSecurityMarksName: string ) { - return this._pathTemplates.organizationSourceFindingPathTemplate.match( - organizationSourceFindingName + return this._pathTemplates.organizationSourceFindingSecurityMarksPathTemplate.match( + organizationSourceFindingSecurityMarksName ).source; } /** - * Parse the finding from OrganizationSourceFinding resource. + * Parse the finding from OrganizationSourceFindingSecurityMarks resource. * - * @param {string} organizationSourceFindingName - * A fully-qualified path representing organization_source_finding resource. + * @param {string} organizationSourceFindingSecurityMarksName + * A fully-qualified path representing organization_source_finding_securityMarks resource. * @returns {string} A string representing the finding. */ - matchFindingFromOrganizationSourceFindingName( - organizationSourceFindingName: string + matchFindingFromOrganizationSourceFindingSecurityMarksName( + organizationSourceFindingSecurityMarksName: string ) { - return this._pathTemplates.organizationSourceFindingPathTemplate.match( - organizationSourceFindingName + return this._pathTemplates.organizationSourceFindingSecurityMarksPathTemplate.match( + organizationSourceFindingSecurityMarksName ).finding; } diff --git a/packages/google-cloud-securitycenter/synth.metadata b/packages/google-cloud-securitycenter/synth.metadata index 0925f1e5dbb..1d7d56c5665 100644 --- a/packages/google-cloud-securitycenter/synth.metadata +++ b/packages/google-cloud-securitycenter/synth.metadata @@ -1,20 +1,20 @@ { - "updateTime": "2020-03-05T23:15:57.060814Z", + "updateTime": "2020-03-22T11:46:06.076100Z", "sources": [ { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "f0b581b5bdf803e45201ecdb3688b60e381628a8", - "internalRef": "299181282", - "log": "f0b581b5bdf803e45201ecdb3688b60e381628a8\nfix: recommendationengine/v1beta1 update some comments\n\nPiperOrigin-RevId: 299181282\n\n10e9a0a833dc85ff8f05b2c67ebe5ac785fe04ff\nbuild: add generated BUILD file for Routes Preferred API\n\nPiperOrigin-RevId: 299164808\n\n86738c956a8238d7c77f729be78b0ed887a6c913\npublish v1p1beta1: update with absolute address in comments\n\nPiperOrigin-RevId: 299152383\n\n73d9f2ad4591de45c2e1f352bc99d70cbd2a6d95\npublish v1: update with absolute address in comments\n\nPiperOrigin-RevId: 299147194\n\nd2158f24cb77b0b0ccfe68af784c6a628705e3c6\npublish v1beta2: update with absolute address in comments\n\nPiperOrigin-RevId: 299147086\n\n7fca61292c11b4cd5b352cee1a50bf88819dd63b\npublish v1p2beta1: update with absolute address in comments\n\nPiperOrigin-RevId: 299146903\n\n583b7321624736e2c490e328f4b1957335779295\npublish v1p3beta1: update with absolute address in comments\n\nPiperOrigin-RevId: 299146674\n\n638253bf86d1ce1c314108a089b7351440c2f0bf\nfix: add java_multiple_files option for automl text_sentiment.proto\n\nPiperOrigin-RevId: 298971070\n\n373d655703bf914fb8b0b1cc4071d772bac0e0d1\nUpdate Recs AI Beta public bazel file\n\nPiperOrigin-RevId: 298961623\n\ndcc5d00fc8a8d8b56f16194d7c682027b2c66a3b\nfix: add java_multiple_files option for automl classification.proto\n\nPiperOrigin-RevId: 298953301\n\na3f791827266f3496a6a5201d58adc4bb265c2a3\nchore: automl/v1 publish annotations and retry config\n\nPiperOrigin-RevId: 298942178\n\n01c681586d8d6dbd60155289b587aee678530bd9\nMark return_immediately in PullRequest deprecated.\n\nPiperOrigin-RevId: 298893281\n\nc9f5e9c4bfed54bbd09227e990e7bded5f90f31c\nRemove out of date documentation for predicate support on the Storage API\n\nPiperOrigin-RevId: 298883309\n\nfd5b3b8238d783b04692a113ffe07c0363f5de0f\ngenerate webrisk v1 proto\n\nPiperOrigin-RevId: 298847934\n\n" + "sha": "0be7105dc52590fa9a24e784052298ae37ce53aa", + "internalRef": "302154871", + "log": "0be7105dc52590fa9a24e784052298ae37ce53aa\nAdd BUILD.bazel file to asset/v1p1beta1\n\nPiperOrigin-RevId: 302154871\n\n6c248fd13e8543f8d22cbf118d978301a9fbe2a8\nAdd missing resource annotations and additional_bindings to dialogflow v2 API.\n\nPiperOrigin-RevId: 302063117\n\n9a3a7f33be9eeacf7b3e98435816b7022d206bd7\nChange the service name from \"chromeos-moblab.googleapis.com\" to \"chromeosmoblab.googleapis.com\"\n\nPiperOrigin-RevId: 302060989\n\n98a339237577e3de26cb4921f75fb5c57cc7a19f\nfeat: devtools/build/v1 publish client library config annotations\n\n* add details field to some of the BuildEvents\n* add final_invocation_id and build_tool_exit_code fields to BuildStatus\n\nPiperOrigin-RevId: 302044087\n\ncfabc98c6bbbb22d1aeaf7612179c0be193b3a13\nfeat: home/graph/v1 publish client library config annotations & comment updates\n\nThis change includes adding the client library configuration annotations, updated proto comments, and some client library configuration files.\n\nPiperOrigin-RevId: 302042647\n\nc8c8c0bd15d082db9546253dbaad1087c7a9782c\nchore: use latest gapic-generator in bazel WORKSPACE.\nincluding the following commits from gapic-generator:\n- feat: take source protos in all sub-packages (#3144)\n\nPiperOrigin-RevId: 301843591\n\ne4daf5202ea31cb2cb6916fdbfa9d6bd771aeb4c\nAdd bazel file for v1 client lib generation\n\nPiperOrigin-RevId: 301802926\n\n275fbcce2c900278d487c33293a3c7e1fbcd3a34\nfeat: pubsub/v1 add an experimental filter field to Subscription\n\nPiperOrigin-RevId: 301661567\n\nf2b18cec51d27c999ad30011dba17f3965677e9c\nFix: UpdateBackupRequest.backup is a resource, not a resource reference - remove annotation.\n\nPiperOrigin-RevId: 301636171\n\n800384063ac93a0cac3a510d41726fa4b2cd4a83\nCloud Billing Budget API v1beta1\nModified api documentation to include warnings about the new filter field.\n\nPiperOrigin-RevId: 301634389\n\n0cc6c146b660db21f04056c3d58a4b752ee445e3\nCloud Billing Budget API v1alpha1\nModified api documentation to include warnings about the new filter field.\n\nPiperOrigin-RevId: 301630018\n\nff2ea00f69065585c3ac0993c8b582af3b6fc215\nFix: Add resource definition for a parent of InspectTemplate which was otherwise missing.\n\nPiperOrigin-RevId: 301623052\n\n55fa441c9daf03173910760191646399338f2b7c\nAdd proto definition for AccessLevel, AccessPolicy, and ServicePerimeter.\n\nPiperOrigin-RevId: 301620844\n\ne7b10591c5408a67cf14ffafa267556f3290e262\nCloud Bigtable Managed Backup service and message proto files.\n\nPiperOrigin-RevId: 301585144\n\nd8e226f702f8ddf92915128c9f4693b63fb8685d\nfeat: Add time-to-live in a queue for builds\n\nPiperOrigin-RevId: 301579876\n\n430375af011f8c7a5174884f0d0e539c6ffa7675\ndocs: add missing closing backtick\n\nPiperOrigin-RevId: 301538851\n\n0e9f1f60ded9ad1c2e725e37719112f5b487ab65\nbazel: Use latest release of gax_java\n\nPiperOrigin-RevId: 301480457\n\n5058c1c96d0ece7f5301a154cf5a07b2ad03a571\nUpdate GAPIC v2 with batching parameters for Logging API\n\nPiperOrigin-RevId: 301443847\n\n64ab9744073de81fec1b3a6a931befc8a90edf90\nFix: Introduce location-based organization/folder/billing-account resources\nChore: Update copyright years\n\nPiperOrigin-RevId: 301373760\n\n23d5f09e670ebb0c1b36214acf78704e2ecfc2ac\nUpdate field_behavior annotations in V1 and V2.\n\nPiperOrigin-RevId: 301337970\n\nb2cf37e7fd62383a811aa4d54d013ecae638851d\nData Catalog V1 API\n\nPiperOrigin-RevId: 301282503\n\n1976b9981e2900c8172b7d34b4220bdb18c5db42\nCloud DLP api update. Adds missing fields to Finding and adds support for hybrid jobs.\n\nPiperOrigin-RevId: 301205325\n\nae78682c05e864d71223ce22532219813b0245ac\nfix: several sample code blocks in comments are now properly indented for markdown\n\nPiperOrigin-RevId: 301185150\n\ndcd171d04bda5b67db13049320f97eca3ace3731\nPublish Media Translation API V1Beta1\n\nPiperOrigin-RevId: 301180096\n\nff1713453b0fbc5a7544a1ef6828c26ad21a370e\nAdd protos and BUILD rules for v1 API.\n\nPiperOrigin-RevId: 301179394\n\n8386761d09819b665b6a6e1e6d6ff884bc8ff781\nfeat: chromeos/modlab publish protos and config for Chrome OS Moblab API.\n\nPiperOrigin-RevId: 300843960\n\nb2e2bc62fab90e6829e62d3d189906d9b79899e4\nUpdates to GCS gRPC API spec:\n\n1. Changed GetIamPolicy and TestBucketIamPermissions to use wrapper messages around google.iam.v1 IAM requests messages, and added CommonRequestParams. This lets us support RequesterPays buckets.\n2. Added a metadata field to GetObjectMediaResponse, to support resuming an object media read safely (by extracting the generation of the object being read, and using it in the resumed read request).\n\nPiperOrigin-RevId: 300817706\n\n7fd916ce12335cc9e784bb9452a8602d00b2516c\nAdd deprecated_collections field for backward-compatiblity in PHP and monolith-generated Python and Ruby clients.\n\nGenerate TopicName class in Java which covers the functionality of both ProjectTopicName and DeletedTopicName. Introduce breaking changes to be fixed by synth.py.\n\nDelete default retry parameters.\n\nRetry codes defs can be deleted once # https://github.com/googleapis/gapic-generator/issues/3137 is fixed.\n\nPiperOrigin-RevId: 300813135\n\n047d3a8ac7f75383855df0166144f891d7af08d9\nfix!: google/rpc refactor ErrorInfo.type to ErrorInfo.reason and comment updates.\n\nPiperOrigin-RevId: 300773211\n\nfae4bb6d5aac52aabe5f0bb4396466c2304ea6f6\nAdding RetryPolicy to pubsub.proto\n\nPiperOrigin-RevId: 300769420\n\n7d569be2928dbd72b4e261bf9e468f23afd2b950\nAdding additional protocol buffer annotations to v3.\n\nPiperOrigin-RevId: 300718800\n\n13942d1a85a337515040a03c5108993087dc0e4f\nAdd logging protos for Recommender v1.\n\nPiperOrigin-RevId: 300689896\n\na1a573c3eecfe2c404892bfa61a32dd0c9fb22b6\nfix: change go package to use cloud.google.com/go/maps\n\nPiperOrigin-RevId: 300661825\n\nc6fbac11afa0c7ab2972d9df181493875c566f77\nfeat: publish documentai/v1beta2 protos\n\nPiperOrigin-RevId: 300656808\n\n5202a9e0d9903f49e900f20fe5c7f4e42dd6588f\nProtos for v1beta1 release of Cloud Security Center Settings API\n\nPiperOrigin-RevId: 300580858\n\n83518e18655d9d4ac044acbda063cc6ecdb63ef8\nAdds gapic.yaml file and BUILD.bazel file.\n\nPiperOrigin-RevId: 300554200\n\n836c196dc8ef8354bbfb5f30696bd3477e8db5e2\nRegenerate recommender v1beta1 gRPC ServiceConfig file for Insights methods.\n\nPiperOrigin-RevId: 300549302\n\n34a5450c591b6be3d6566f25ac31caa5211b2f3f\nIncreases the default timeout from 20s to 30s for MetricService\n\nPiperOrigin-RevId: 300474272\n\n5d8bffe87cd01ba390c32f1714230e5a95d5991d\nfeat: use the latest gapic-generator in WORKSPACE for bazel build.\n\nPiperOrigin-RevId: 300461878\n\nd631c651e3bcfac5d371e8560c27648f7b3e2364\nUpdated the GAPIC configs to include parameters for Backups APIs.\n\nPiperOrigin-RevId: 300443402\n\n678afc7055c1adea9b7b54519f3bdb228013f918\nAdding Game Servers v1beta API.\n\nPiperOrigin-RevId: 300433218\n\n80d2bd2c652a5e213302041b0620aff423132589\nEnable proto annotation and gapic v2 for talent API.\n\nPiperOrigin-RevId: 300393997\n\n85e454be7a353f7fe1bf2b0affb753305785b872\ndocs(google/maps/roads): remove mention of nonexported api\n\nPiperOrigin-RevId: 300367734\n\nbf839ae632e0f263a729569e44be4b38b1c85f9c\nAdding protocol buffer annotations and updated config info for v1 and v2.\n\nPiperOrigin-RevId: 300276913\n\n309b899ca18a4c604bce63882a161d44854da549\nPublish `Backup` APIs and protos.\n\nPiperOrigin-RevId: 300246038\n\neced64c3f122421350b4aca68a28e89121d20db8\nadd PHP client libraries\n\nPiperOrigin-RevId: 300193634\n\n7727af0e39df1ae9ad715895c8576d7b65cf6c6d\nfeat: use the latest gapic-generator and protoc-java-resource-name-plugin in googleapis/WORKSPACE.\n\nPiperOrigin-RevId: 300188410\n\n2a25aa351dd5b5fe14895266aff5824d90ce757b\nBreaking change: remove the ProjectOrTenant resource and its references.\n\nPiperOrigin-RevId: 300182152\n\na499dbb28546379415f51803505cfb6123477e71\nUpdate web risk v1 gapic config and BUILD file.\n\nPiperOrigin-RevId: 300152177\n\n52701da10fec2a5f9796e8d12518c0fe574488fe\nFix: apply appropriate namespace/package options for C#, PHP and Ruby.\n\nPiperOrigin-RevId: 300123508\n\n365c029b8cdb63f7751b92ab490f1976e616105c\nAdd CC targets to the kms protos.\n\nThese are needed by go/tink.\n\nPiperOrigin-RevId: 300038469\n\n4ba9aa8a4a1413b88dca5a8fa931824ee9c284e6\nExpose logo recognition API proto for GA.\n\nPiperOrigin-RevId: 299971671\n\n1c9fc2c9e03dadf15f16b1c4f570955bdcebe00e\nAdding ruby_package option to accessapproval.proto for the Ruby client libraries generation.\n\nPiperOrigin-RevId: 299955924\n\n1cc6f0a7bfb147e6f2ede911d9b01e7a9923b719\nbuild(google/maps/routes): generate api clients\n\nPiperOrigin-RevId: 299955905\n\n29a47c965aac79e3fe8e3314482ca0b5967680f0\nIncrease timeout to 1hr for method `dropRange` in bigtable/admin/v2, which is\nsynced with the timeout setting in gapic_yaml.\n\nPiperOrigin-RevId: 299917154\n\n8f631c4c70a60a9c7da3749511ee4ad432b62898\nbuild(google/maps/roads/v1op): move go to monorepo pattern\n\nPiperOrigin-RevId: 299885195\n\nd66816518844ebbf63504c9e8dfc7133921dd2cd\nbuild(google/maps/roads/v1op): Add bazel build files to generate clients.\n\nPiperOrigin-RevId: 299851148\n\naf7dff701fabe029672168649c62356cf1bb43d0\nAdd LogPlayerReports and LogImpressions to Playable Locations service\n\nPiperOrigin-RevId: 299724050\n\nb6927fca808f38df32a642c560082f5bf6538ced\nUpdate BigQuery Connection API v1beta1 proto: added credential to CloudSqlProperties.\n\nPiperOrigin-RevId: 299503150\n\n91e1fb5ef9829c0c7a64bfa5bde330e6ed594378\nchore: update protobuf (protoc) version to 3.11.2\n\nPiperOrigin-RevId: 299404145\n\n30e36b4bee6749c4799f4fc1a51cc8f058ba167d\nUpdate cloud asset api v1p4beta1.\n\nPiperOrigin-RevId: 299399890\n\nffbb493674099f265693872ae250711b2238090c\nfeat: cloudbuild/v1 add new fields and annotate OUTPUT_OUT fields.\n\nPiperOrigin-RevId: 299397780\n\nbc973a15818e00c19e121959832676e9b7607456\nbazel: Fix broken common dependency\n\nPiperOrigin-RevId: 299397431\n\n71094a343e3b962e744aa49eb9338219537474e4\nchore: bigtable/admin/v2 publish retry config\n\nPiperOrigin-RevId: 299391875\n\n8f488efd7bda33885cb674ddd023b3678c40bd82\nfeat: Migrate logging to GAPIC v2; release new features.\n\nIMPORTANT: This is a breaking change for client libraries\nin all languages.\n\nCommitter: @lukesneeringer, @jskeet\nPiperOrigin-RevId: 299370279\n\n007605bf9ad3a1fd775014ebefbf7f1e6b31ee71\nUpdate API for bigqueryreservation v1beta1.\n- Adds flex capacity commitment plan to CapacityCommitment.\n- Adds methods for getting and updating BiReservations.\n- Adds methods for updating/splitting/merging CapacityCommitments.\n\nPiperOrigin-RevId: 299368059\n\n" } }, { - "template": { - "name": "node_library", - "origin": "synthtool.gcp", - "version": "2020.2.4" + "git": { + "name": "synthtool", + "remote": "https://github.com/googleapis/synthtool.git", + "sha": "7e98e1609c91082f4eeb63b530c6468aefd18cfd" } } ], diff --git a/packages/google-cloud-securitycenter/system-test/fixtures/sample/src/index.js b/packages/google-cloud-securitycenter/system-test/fixtures/sample/src/index.js index ee34dad4972..c9b57896440 100644 --- a/packages/google-cloud-securitycenter/system-test/fixtures/sample/src/index.js +++ b/packages/google-cloud-securitycenter/system-test/fixtures/sample/src/index.js @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC +// 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. diff --git a/packages/google-cloud-securitycenter/system-test/fixtures/sample/src/index.ts b/packages/google-cloud-securitycenter/system-test/fixtures/sample/src/index.ts index dd8b957e174..ddaa805ae5a 100644 --- a/packages/google-cloud-securitycenter/system-test/fixtures/sample/src/index.ts +++ b/packages/google-cloud-securitycenter/system-test/fixtures/sample/src/index.ts @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC +// 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. diff --git a/packages/google-cloud-securitycenter/system-test/install.ts b/packages/google-cloud-securitycenter/system-test/install.ts index c9aa74ec221..c4d80e9c0c8 100644 --- a/packages/google-cloud-securitycenter/system-test/install.ts +++ b/packages/google-cloud-securitycenter/system-test/install.ts @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC +// 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. diff --git a/packages/google-cloud-securitycenter/test/gapic-security_center-v1.ts b/packages/google-cloud-securitycenter/test/gapic-security_center-v1.ts index fb12e4f462f..a2b9576def9 100644 --- a/packages/google-cloud-securitycenter/test/gapic-security_center-v1.ts +++ b/packages/google-cloud-securitycenter/test/gapic-security_center-v1.ts @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC +// 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. diff --git a/packages/google-cloud-securitycenter/test/gapic-security_center-v1beta1.ts b/packages/google-cloud-securitycenter/test/gapic-security_center-v1beta1.ts index 098ce8a0cbe..e321432a982 100644 --- a/packages/google-cloud-securitycenter/test/gapic-security_center-v1beta1.ts +++ b/packages/google-cloud-securitycenter/test/gapic-security_center-v1beta1.ts @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC +// 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. diff --git a/packages/google-cloud-securitycenter/test/gapic-security_center-v1p1beta1.ts b/packages/google-cloud-securitycenter/test/gapic-security_center-v1p1beta1.ts index c60edab460a..fb8c4742af2 100644 --- a/packages/google-cloud-securitycenter/test/gapic-security_center-v1p1beta1.ts +++ b/packages/google-cloud-securitycenter/test/gapic-security_center-v1p1beta1.ts @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC +// 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. diff --git a/packages/google-cloud-securitycenter/webpack.config.js b/packages/google-cloud-securitycenter/webpack.config.js index 043de2c77cd..95e0a42e676 100644 --- a/packages/google-cloud-securitycenter/webpack.config.js +++ b/packages/google-cloud-securitycenter/webpack.config.js @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC +// 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. From 6cca9fea9dc99d42461b2f4e59cb4665817d8f5a Mon Sep 17 00:00:00 2001 From: Alexander Fenster Date: Tue, 31 Mar 2020 13:44:50 -0700 Subject: [PATCH 157/342] feat!: drop node8 support, support for async iterators (#248) BREAKING CHANGE: The library now supports Node.js v10+. The last version to support Node.js v8 is tagged legacy-8 on NPM. New feature: methods with pagination now support async iteration. --- .../.eslintrc.json | 3 + .../google-cloud-securitycenter/.eslintrc.yml | 15 - .../google-cloud-securitycenter/.prettierrc | 8 - .../.prettierrc.js | 17 + .../google-cloud-securitycenter/package.json | 10 +- .../src/v1/security_center_client.ts | 2182 +++++--- .../src/v1beta1/security_center_client.ts | 1552 ++++-- .../src/v1p1beta1/security_center_client.ts | 2193 +++++--- .../synth.metadata | 20 +- .../system-test/fixtures/sample/src/index.ts | 2 +- .../test/gapic-security_center-v1.ts | 1428 ----- .../test/gapic-security_center-v1beta1.ts | 1143 ---- .../test/gapic-security_center-v1p1beta1.ts | 1428 ----- .../test/gapic_security_center_v1.ts | 4605 ++++++++++++++++ .../test/gapic_security_center_v1beta1.ts | 3710 +++++++++++++ .../test/gapic_security_center_v1p1beta1.ts | 4619 +++++++++++++++++ 16 files changed, 17247 insertions(+), 5688 deletions(-) create mode 100644 packages/google-cloud-securitycenter/.eslintrc.json delete mode 100644 packages/google-cloud-securitycenter/.eslintrc.yml delete mode 100644 packages/google-cloud-securitycenter/.prettierrc create mode 100644 packages/google-cloud-securitycenter/.prettierrc.js delete mode 100644 packages/google-cloud-securitycenter/test/gapic-security_center-v1.ts delete mode 100644 packages/google-cloud-securitycenter/test/gapic-security_center-v1beta1.ts delete mode 100644 packages/google-cloud-securitycenter/test/gapic-security_center-v1p1beta1.ts create mode 100644 packages/google-cloud-securitycenter/test/gapic_security_center_v1.ts create mode 100644 packages/google-cloud-securitycenter/test/gapic_security_center_v1beta1.ts create mode 100644 packages/google-cloud-securitycenter/test/gapic_security_center_v1p1beta1.ts diff --git a/packages/google-cloud-securitycenter/.eslintrc.json b/packages/google-cloud-securitycenter/.eslintrc.json new file mode 100644 index 00000000000..78215349546 --- /dev/null +++ b/packages/google-cloud-securitycenter/.eslintrc.json @@ -0,0 +1,3 @@ +{ + "extends": "./node_modules/gts" +} diff --git a/packages/google-cloud-securitycenter/.eslintrc.yml b/packages/google-cloud-securitycenter/.eslintrc.yml deleted file mode 100644 index 73eeec27612..00000000000 --- a/packages/google-cloud-securitycenter/.eslintrc.yml +++ /dev/null @@ -1,15 +0,0 @@ ---- -extends: - - 'eslint:recommended' - - 'plugin:node/recommended' - - prettier -plugins: - - node - - prettier -rules: - prettier/prettier: error - block-scoped-var: error - eqeqeq: error - no-warning-comments: warn - no-var: error - prefer-const: error diff --git a/packages/google-cloud-securitycenter/.prettierrc b/packages/google-cloud-securitycenter/.prettierrc deleted file mode 100644 index df6eac07446..00000000000 --- a/packages/google-cloud-securitycenter/.prettierrc +++ /dev/null @@ -1,8 +0,0 @@ ---- -bracketSpacing: false -printWidth: 80 -semi: true -singleQuote: true -tabWidth: 2 -trailingComma: es5 -useTabs: false diff --git a/packages/google-cloud-securitycenter/.prettierrc.js b/packages/google-cloud-securitycenter/.prettierrc.js new file mode 100644 index 00000000000..08cba3775be --- /dev/null +++ b/packages/google-cloud-securitycenter/.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 +// +// 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. + +module.exports = { + ...require('gts/.prettierrc.json') +} diff --git a/packages/google-cloud-securitycenter/package.json b/packages/google-cloud-securitycenter/package.json index 69e8f0a3ef7..b614cf33388 100644 --- a/packages/google-cloud-securitycenter/package.json +++ b/packages/google-cloud-securitycenter/package.json @@ -5,7 +5,7 @@ "license": "Apache-2.0", "author": "Google LLC", "engines": { - "node": ">=8.10.0" + "node": ">=10" }, "repository": "googleapis/nodejs-security-center", "files": [ @@ -41,17 +41,18 @@ "Security Command Center API" ], "dependencies": { - "google-gax": "^1.14.1" + "google-gax": "^2.0.1" }, "devDependencies": { "@types/mocha": "^7.0.0", "@types/node": "^12.0.0", + "@types/sinon": "^7.5.2", "c8": "^7.0.0", "eslint": "^6.0.0", "eslint-config-prettier": "^6.0.0", "eslint-plugin-node": "^11.0.0", "eslint-plugin-prettier": "^3.0.0", - "gts": "^1.1.2", + "gts": "2.0.0-alpha.9", "jsdoc": "^3.6.2", "jsdoc-fresh": "^1.0.1", "jsdoc-region-tag": "^1.0.2", @@ -61,8 +62,9 @@ "pack-n-play": "^1.0.0-2", "power-assert": "^1.4.4", "prettier": "^1.7.4", + "sinon": "^9.0.1", "ts-loader": "^6.2.1", - "typescript": "~3.6.4", + "typescript": "^3.8.3", "webpack": "^4.41.2", "webpack-cli": "^3.3.10" } diff --git a/packages/google-cloud-securitycenter/src/v1/security_center_client.ts b/packages/google-cloud-securitycenter/src/v1/security_center_client.ts index 455c74bdf37..c161816047e 100644 --- a/packages/google-cloud-securitycenter/src/v1/security_center_client.ts +++ b/packages/google-cloud-securitycenter/src/v1/security_center_client.ts @@ -18,19 +18,19 @@ import * as gax from 'google-gax'; import { - APICallback, Callback, CallOptions, Descriptors, ClientOptions, LROperation, PaginationCallback, - PaginationResponse, + GaxCall, } from 'google-gax'; import * as path from 'path'; import {Transform} from 'stream'; -import * as protosTypes from '../../protos/protos'; +import {RequestType} from 'google-gax/build/src/apitypes'; +import * as protos from '../../protos/protos'; import * as gapicConfig from './security_center_client_config.json'; const version = require('../../../package.json').version; @@ -41,14 +41,6 @@ const version = require('../../../package.json').version; * @memberof v1 */ export class SecurityCenterClient { - private _descriptors: Descriptors = { - page: {}, - stream: {}, - longrunning: {}, - batching: {}, - }; - private _innerApiCalls: {[name: string]: Function}; - private _pathTemplates: {[name: string]: gax.PathTemplate}; private _terminated = false; private _opts: ClientOptions; private _gaxModule: typeof gax | typeof gax.fallback; @@ -56,6 +48,14 @@ export class SecurityCenterClient { private _protos: {}; private _defaults: {[method: string]: gax.CallSettings}; auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + innerApiCalls: {[name: string]: Function}; + pathTemplates: {[name: string]: gax.PathTemplate}; operationsClient: gax.OperationsClient; securityCenterStub?: Promise<{[name: string]: Function}>; @@ -148,13 +148,16 @@ export class SecurityCenterClient { 'protos.json' ); this._protos = this._gaxGrpc.loadProto( - opts.fallback ? require('../../protos/protos.json') : nodejsProtoPath + opts.fallback + ? // eslint-disable-next-line @typescript-eslint/no-var-requires + require('../../protos/protos.json') + : nodejsProtoPath ); // This API contains "path templates"; forward-slash-separated // identifiers to uniquely identify resources within the API. // Create useful helper objects for these. - this._pathTemplates = { + this.pathTemplates = { assetPathTemplate: new this._gaxModule.PathTemplate( 'organizations/{organization}/assets/{asset}' ), @@ -184,7 +187,7 @@ export class SecurityCenterClient { // Some of the methods on this service return "paged" results, // (e.g. 50 results at a time, with tokens to get subsequent // pages). Denote the keys used for pagination and results. - this._descriptors.page = { + this.descriptors.page = { groupAssets: new this._gaxModule.PageDescriptor( 'pageToken', 'nextPageToken', @@ -222,6 +225,7 @@ export class SecurityCenterClient { // rather than holding a request open. const protoFilesRoot = opts.fallback ? this._gaxModule.protobuf.Root.fromJSON( + // eslint-disable-next-line @typescript-eslint/no-var-requires require('../../protos/protos.json') ) : this._gaxModule.protobuf.loadSync(nodejsProtoPath); @@ -239,7 +243,7 @@ export class SecurityCenterClient { '.google.protobuf.Empty' ) as gax.protobuf.Type; - this._descriptors.longrunning = { + this.descriptors.longrunning = { runAssetDiscovery: new this._gaxModule.LongrunningDescriptor( this.operationsClient, runAssetDiscoveryResponse.decode.bind(runAssetDiscoveryResponse), @@ -258,7 +262,7 @@ export class SecurityCenterClient { // 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 = {}; + this.innerApiCalls = {}; } /** @@ -285,7 +289,7 @@ export class SecurityCenterClient { ? (this._protos as protobuf.Root).lookupService( 'google.cloud.securitycenter.v1.SecurityCenter' ) - : // tslint:disable-next-line no-any + : // eslint-disable-next-line @typescript-eslint/no-explicit-any (this._protos as any).google.cloud.securitycenter.v1.SecurityCenter, this._opts ) as Promise<{[method: string]: Function}>; @@ -317,9 +321,8 @@ export class SecurityCenterClient { 'updateSource', 'updateSecurityMarks', ]; - for (const methodName of securityCenterStubMethods) { - const innerCallPromise = this.securityCenterStub.then( + const callPromise = this.securityCenterStub.then( stub => (...args: Array<{}>) => { if (this._terminated) { return Promise.reject('The client has already been closed.'); @@ -333,20 +336,14 @@ export class SecurityCenterClient { ); const apiCall = this._gaxModule.createApiCall( - innerCallPromise, + callPromise, this._defaults[methodName], - this._descriptors.page[methodName] || - this._descriptors.stream[methodName] || - this._descriptors.longrunning[methodName] + this.descriptors.page[methodName] || + this.descriptors.stream[methodName] || + this.descriptors.longrunning[methodName] ); - this._innerApiCalls[methodName] = ( - argument: {}, - callOptions?: CallOptions, - callback?: APICallback - ) => { - return apiCall(argument, callOptions, callback); - }; + this.innerApiCalls[methodName] = apiCall; } return this.securityCenterStub; @@ -403,26 +400,34 @@ export class SecurityCenterClient { // -- Service calls -- // ------------------- createSource( - request: protosTypes.google.cloud.securitycenter.v1.ICreateSourceRequest, + request: protos.google.cloud.securitycenter.v1.ICreateSourceRequest, options?: gax.CallOptions ): Promise< [ - protosTypes.google.cloud.securitycenter.v1.ISource, - ( - | protosTypes.google.cloud.securitycenter.v1.ICreateSourceRequest - | undefined - ), + protos.google.cloud.securitycenter.v1.ISource, + protos.google.cloud.securitycenter.v1.ICreateSourceRequest | undefined, {} | undefined ] >; createSource( - request: protosTypes.google.cloud.securitycenter.v1.ICreateSourceRequest, + request: protos.google.cloud.securitycenter.v1.ICreateSourceRequest, options: gax.CallOptions, callback: Callback< - protosTypes.google.cloud.securitycenter.v1.ISource, - | protosTypes.google.cloud.securitycenter.v1.ICreateSourceRequest + protos.google.cloud.securitycenter.v1.ISource, + | protos.google.cloud.securitycenter.v1.ICreateSourceRequest + | null | undefined, - {} | undefined + {} | null | undefined + > + ): void; + createSource( + request: protos.google.cloud.securitycenter.v1.ICreateSourceRequest, + callback: Callback< + protos.google.cloud.securitycenter.v1.ISource, + | protos.google.cloud.securitycenter.v1.ICreateSourceRequest + | null + | undefined, + {} | null | undefined > ): void; /** @@ -443,28 +448,27 @@ export class SecurityCenterClient { * The promise has a method named "cancel" which cancels the ongoing API call. */ createSource( - request: protosTypes.google.cloud.securitycenter.v1.ICreateSourceRequest, + request: protos.google.cloud.securitycenter.v1.ICreateSourceRequest, optionsOrCallback?: | gax.CallOptions | Callback< - protosTypes.google.cloud.securitycenter.v1.ISource, - | protosTypes.google.cloud.securitycenter.v1.ICreateSourceRequest + protos.google.cloud.securitycenter.v1.ISource, + | protos.google.cloud.securitycenter.v1.ICreateSourceRequest + | null | undefined, - {} | undefined + {} | null | undefined >, callback?: Callback< - protosTypes.google.cloud.securitycenter.v1.ISource, - | protosTypes.google.cloud.securitycenter.v1.ICreateSourceRequest + protos.google.cloud.securitycenter.v1.ISource, + | protos.google.cloud.securitycenter.v1.ICreateSourceRequest + | null | undefined, - {} | undefined + {} | null | undefined > ): Promise< [ - protosTypes.google.cloud.securitycenter.v1.ISource, - ( - | protosTypes.google.cloud.securitycenter.v1.ICreateSourceRequest - | undefined - ), + protos.google.cloud.securitycenter.v1.ISource, + protos.google.cloud.securitycenter.v1.ICreateSourceRequest | undefined, {} | undefined ] > | void { @@ -485,29 +489,37 @@ export class SecurityCenterClient { parent: request.parent || '', }); this.initialize(); - return this._innerApiCalls.createSource(request, options, callback); + return this.innerApiCalls.createSource(request, options, callback); } createFinding( - request: protosTypes.google.cloud.securitycenter.v1.ICreateFindingRequest, + request: protos.google.cloud.securitycenter.v1.ICreateFindingRequest, options?: gax.CallOptions ): Promise< [ - protosTypes.google.cloud.securitycenter.v1.IFinding, - ( - | protosTypes.google.cloud.securitycenter.v1.ICreateFindingRequest - | undefined - ), + protos.google.cloud.securitycenter.v1.IFinding, + protos.google.cloud.securitycenter.v1.ICreateFindingRequest | undefined, {} | undefined ] >; createFinding( - request: protosTypes.google.cloud.securitycenter.v1.ICreateFindingRequest, + request: protos.google.cloud.securitycenter.v1.ICreateFindingRequest, options: gax.CallOptions, callback: Callback< - protosTypes.google.cloud.securitycenter.v1.IFinding, - | protosTypes.google.cloud.securitycenter.v1.ICreateFindingRequest + protos.google.cloud.securitycenter.v1.IFinding, + | protos.google.cloud.securitycenter.v1.ICreateFindingRequest + | null | undefined, - {} | undefined + {} | null | undefined + > + ): void; + createFinding( + request: protos.google.cloud.securitycenter.v1.ICreateFindingRequest, + callback: Callback< + protos.google.cloud.securitycenter.v1.IFinding, + | protos.google.cloud.securitycenter.v1.ICreateFindingRequest + | null + | undefined, + {} | null | undefined > ): void; /** @@ -533,28 +545,27 @@ export class SecurityCenterClient { * The promise has a method named "cancel" which cancels the ongoing API call. */ createFinding( - request: protosTypes.google.cloud.securitycenter.v1.ICreateFindingRequest, + request: protos.google.cloud.securitycenter.v1.ICreateFindingRequest, optionsOrCallback?: | gax.CallOptions | Callback< - protosTypes.google.cloud.securitycenter.v1.IFinding, - | protosTypes.google.cloud.securitycenter.v1.ICreateFindingRequest + protos.google.cloud.securitycenter.v1.IFinding, + | protos.google.cloud.securitycenter.v1.ICreateFindingRequest + | null | undefined, - {} | undefined + {} | null | undefined >, callback?: Callback< - protosTypes.google.cloud.securitycenter.v1.IFinding, - | protosTypes.google.cloud.securitycenter.v1.ICreateFindingRequest + protos.google.cloud.securitycenter.v1.IFinding, + | protos.google.cloud.securitycenter.v1.ICreateFindingRequest + | null | undefined, - {} | undefined + {} | null | undefined > ): Promise< [ - protosTypes.google.cloud.securitycenter.v1.IFinding, - ( - | protosTypes.google.cloud.securitycenter.v1.ICreateFindingRequest - | undefined - ), + protos.google.cloud.securitycenter.v1.IFinding, + protos.google.cloud.securitycenter.v1.ICreateFindingRequest | undefined, {} | undefined ] > | void { @@ -575,29 +586,40 @@ export class SecurityCenterClient { parent: request.parent || '', }); this.initialize(); - return this._innerApiCalls.createFinding(request, options, callback); + return this.innerApiCalls.createFinding(request, options, callback); } createNotificationConfig( - request: protosTypes.google.cloud.securitycenter.v1.ICreateNotificationConfigRequest, + request: protos.google.cloud.securitycenter.v1.ICreateNotificationConfigRequest, options?: gax.CallOptions ): Promise< [ - protosTypes.google.cloud.securitycenter.v1.INotificationConfig, + protos.google.cloud.securitycenter.v1.INotificationConfig, ( - | protosTypes.google.cloud.securitycenter.v1.ICreateNotificationConfigRequest + | protos.google.cloud.securitycenter.v1.ICreateNotificationConfigRequest | undefined ), {} | undefined ] >; createNotificationConfig( - request: protosTypes.google.cloud.securitycenter.v1.ICreateNotificationConfigRequest, + request: protos.google.cloud.securitycenter.v1.ICreateNotificationConfigRequest, options: gax.CallOptions, callback: Callback< - protosTypes.google.cloud.securitycenter.v1.INotificationConfig, - | protosTypes.google.cloud.securitycenter.v1.ICreateNotificationConfigRequest + protos.google.cloud.securitycenter.v1.INotificationConfig, + | protos.google.cloud.securitycenter.v1.ICreateNotificationConfigRequest + | null | undefined, - {} | undefined + {} | null | undefined + > + ): void; + createNotificationConfig( + request: protos.google.cloud.securitycenter.v1.ICreateNotificationConfigRequest, + callback: Callback< + protos.google.cloud.securitycenter.v1.INotificationConfig, + | protos.google.cloud.securitycenter.v1.ICreateNotificationConfigRequest + | null + | undefined, + {} | null | undefined > ): void; /** @@ -624,26 +646,28 @@ export class SecurityCenterClient { * The promise has a method named "cancel" which cancels the ongoing API call. */ createNotificationConfig( - request: protosTypes.google.cloud.securitycenter.v1.ICreateNotificationConfigRequest, + request: protos.google.cloud.securitycenter.v1.ICreateNotificationConfigRequest, optionsOrCallback?: | gax.CallOptions | Callback< - protosTypes.google.cloud.securitycenter.v1.INotificationConfig, - | protosTypes.google.cloud.securitycenter.v1.ICreateNotificationConfigRequest + protos.google.cloud.securitycenter.v1.INotificationConfig, + | protos.google.cloud.securitycenter.v1.ICreateNotificationConfigRequest + | null | undefined, - {} | undefined + {} | null | undefined >, callback?: Callback< - protosTypes.google.cloud.securitycenter.v1.INotificationConfig, - | protosTypes.google.cloud.securitycenter.v1.ICreateNotificationConfigRequest + protos.google.cloud.securitycenter.v1.INotificationConfig, + | protos.google.cloud.securitycenter.v1.ICreateNotificationConfigRequest + | null | undefined, - {} | undefined + {} | null | undefined > ): Promise< [ - protosTypes.google.cloud.securitycenter.v1.INotificationConfig, + protos.google.cloud.securitycenter.v1.INotificationConfig, ( - | protosTypes.google.cloud.securitycenter.v1.ICreateNotificationConfigRequest + | protos.google.cloud.securitycenter.v1.ICreateNotificationConfigRequest | undefined ), {} | undefined @@ -666,33 +690,44 @@ export class SecurityCenterClient { parent: request.parent || '', }); this.initialize(); - return this._innerApiCalls.createNotificationConfig( + return this.innerApiCalls.createNotificationConfig( request, options, callback ); } deleteNotificationConfig( - request: protosTypes.google.cloud.securitycenter.v1.IDeleteNotificationConfigRequest, + request: protos.google.cloud.securitycenter.v1.IDeleteNotificationConfigRequest, options?: gax.CallOptions ): Promise< [ - protosTypes.google.protobuf.IEmpty, + protos.google.protobuf.IEmpty, ( - | protosTypes.google.cloud.securitycenter.v1.IDeleteNotificationConfigRequest + | protos.google.cloud.securitycenter.v1.IDeleteNotificationConfigRequest | undefined ), {} | undefined ] >; deleteNotificationConfig( - request: protosTypes.google.cloud.securitycenter.v1.IDeleteNotificationConfigRequest, + request: protos.google.cloud.securitycenter.v1.IDeleteNotificationConfigRequest, options: gax.CallOptions, callback: Callback< - protosTypes.google.protobuf.IEmpty, - | protosTypes.google.cloud.securitycenter.v1.IDeleteNotificationConfigRequest + protos.google.protobuf.IEmpty, + | protos.google.cloud.securitycenter.v1.IDeleteNotificationConfigRequest + | null | undefined, - {} | undefined + {} | null | undefined + > + ): void; + deleteNotificationConfig( + request: protos.google.cloud.securitycenter.v1.IDeleteNotificationConfigRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.securitycenter.v1.IDeleteNotificationConfigRequest + | null + | undefined, + {} | null | undefined > ): void; /** @@ -710,26 +745,28 @@ export class SecurityCenterClient { * The promise has a method named "cancel" which cancels the ongoing API call. */ deleteNotificationConfig( - request: protosTypes.google.cloud.securitycenter.v1.IDeleteNotificationConfigRequest, + request: protos.google.cloud.securitycenter.v1.IDeleteNotificationConfigRequest, optionsOrCallback?: | gax.CallOptions | Callback< - protosTypes.google.protobuf.IEmpty, - | protosTypes.google.cloud.securitycenter.v1.IDeleteNotificationConfigRequest + protos.google.protobuf.IEmpty, + | protos.google.cloud.securitycenter.v1.IDeleteNotificationConfigRequest + | null | undefined, - {} | undefined + {} | null | undefined >, callback?: Callback< - protosTypes.google.protobuf.IEmpty, - | protosTypes.google.cloud.securitycenter.v1.IDeleteNotificationConfigRequest + protos.google.protobuf.IEmpty, + | protos.google.cloud.securitycenter.v1.IDeleteNotificationConfigRequest + | null | undefined, - {} | undefined + {} | null | undefined > ): Promise< [ - protosTypes.google.protobuf.IEmpty, + protos.google.protobuf.IEmpty, ( - | protosTypes.google.cloud.securitycenter.v1.IDeleteNotificationConfigRequest + | protos.google.cloud.securitycenter.v1.IDeleteNotificationConfigRequest | undefined ), {} | undefined @@ -752,29 +789,37 @@ export class SecurityCenterClient { name: request.name || '', }); this.initialize(); - return this._innerApiCalls.deleteNotificationConfig( + return this.innerApiCalls.deleteNotificationConfig( request, options, callback ); } getIamPolicy( - request: protosTypes.google.iam.v1.IGetIamPolicyRequest, + request: protos.google.iam.v1.IGetIamPolicyRequest, options?: gax.CallOptions ): Promise< [ - protosTypes.google.iam.v1.IPolicy, - protosTypes.google.iam.v1.IGetIamPolicyRequest | undefined, + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest | undefined, {} | undefined ] >; getIamPolicy( - request: protosTypes.google.iam.v1.IGetIamPolicyRequest, + request: protos.google.iam.v1.IGetIamPolicyRequest, options: gax.CallOptions, callback: Callback< - protosTypes.google.iam.v1.IPolicy, - protosTypes.google.iam.v1.IGetIamPolicyRequest | undefined, - {} | undefined + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ): void; + getIamPolicy( + request: protos.google.iam.v1.IGetIamPolicyRequest, + callback: Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest | null | undefined, + {} | null | undefined > ): void; /** @@ -789,23 +834,23 @@ export class SecurityCenterClient { * The promise has a method named "cancel" which cancels the ongoing API call. */ getIamPolicy( - request: protosTypes.google.iam.v1.IGetIamPolicyRequest, + request: protos.google.iam.v1.IGetIamPolicyRequest, optionsOrCallback?: | gax.CallOptions | Callback< - protosTypes.google.iam.v1.IPolicy, - protosTypes.google.iam.v1.IGetIamPolicyRequest | undefined, - {} | undefined + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest | null | undefined, + {} | null | undefined >, callback?: Callback< - protosTypes.google.iam.v1.IPolicy, - protosTypes.google.iam.v1.IGetIamPolicyRequest | undefined, - {} | undefined + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest | null | undefined, + {} | null | undefined > ): Promise< [ - protosTypes.google.iam.v1.IPolicy, - protosTypes.google.iam.v1.IGetIamPolicyRequest | undefined, + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest | undefined, {} | undefined ] > | void { @@ -826,29 +871,40 @@ export class SecurityCenterClient { resource: request.resource || '', }); this.initialize(); - return this._innerApiCalls.getIamPolicy(request, options, callback); + return this.innerApiCalls.getIamPolicy(request, options, callback); } getNotificationConfig( - request: protosTypes.google.cloud.securitycenter.v1.IGetNotificationConfigRequest, + request: protos.google.cloud.securitycenter.v1.IGetNotificationConfigRequest, options?: gax.CallOptions ): Promise< [ - protosTypes.google.cloud.securitycenter.v1.INotificationConfig, + protos.google.cloud.securitycenter.v1.INotificationConfig, ( - | protosTypes.google.cloud.securitycenter.v1.IGetNotificationConfigRequest + | protos.google.cloud.securitycenter.v1.IGetNotificationConfigRequest | undefined ), {} | undefined ] >; getNotificationConfig( - request: protosTypes.google.cloud.securitycenter.v1.IGetNotificationConfigRequest, + request: protos.google.cloud.securitycenter.v1.IGetNotificationConfigRequest, options: gax.CallOptions, callback: Callback< - protosTypes.google.cloud.securitycenter.v1.INotificationConfig, - | protosTypes.google.cloud.securitycenter.v1.IGetNotificationConfigRequest + protos.google.cloud.securitycenter.v1.INotificationConfig, + | protos.google.cloud.securitycenter.v1.IGetNotificationConfigRequest + | null | undefined, - {} | undefined + {} | null | undefined + > + ): void; + getNotificationConfig( + request: protos.google.cloud.securitycenter.v1.IGetNotificationConfigRequest, + callback: Callback< + protos.google.cloud.securitycenter.v1.INotificationConfig, + | protos.google.cloud.securitycenter.v1.IGetNotificationConfigRequest + | null + | undefined, + {} | null | undefined > ): void; /** @@ -866,26 +922,28 @@ export class SecurityCenterClient { * The promise has a method named "cancel" which cancels the ongoing API call. */ getNotificationConfig( - request: protosTypes.google.cloud.securitycenter.v1.IGetNotificationConfigRequest, + request: protos.google.cloud.securitycenter.v1.IGetNotificationConfigRequest, optionsOrCallback?: | gax.CallOptions | Callback< - protosTypes.google.cloud.securitycenter.v1.INotificationConfig, - | protosTypes.google.cloud.securitycenter.v1.IGetNotificationConfigRequest + protos.google.cloud.securitycenter.v1.INotificationConfig, + | protos.google.cloud.securitycenter.v1.IGetNotificationConfigRequest + | null | undefined, - {} | undefined + {} | null | undefined >, callback?: Callback< - protosTypes.google.cloud.securitycenter.v1.INotificationConfig, - | protosTypes.google.cloud.securitycenter.v1.IGetNotificationConfigRequest + protos.google.cloud.securitycenter.v1.INotificationConfig, + | protos.google.cloud.securitycenter.v1.IGetNotificationConfigRequest + | null | undefined, - {} | undefined + {} | null | undefined > ): Promise< [ - protosTypes.google.cloud.securitycenter.v1.INotificationConfig, + protos.google.cloud.securitycenter.v1.INotificationConfig, ( - | protosTypes.google.cloud.securitycenter.v1.IGetNotificationConfigRequest + | protos.google.cloud.securitycenter.v1.IGetNotificationConfigRequest | undefined ), {} | undefined @@ -908,33 +966,40 @@ export class SecurityCenterClient { name: request.name || '', }); this.initialize(); - return this._innerApiCalls.getNotificationConfig( - request, - options, - callback - ); + return this.innerApiCalls.getNotificationConfig(request, options, callback); } getOrganizationSettings( - request: protosTypes.google.cloud.securitycenter.v1.IGetOrganizationSettingsRequest, + request: protos.google.cloud.securitycenter.v1.IGetOrganizationSettingsRequest, options?: gax.CallOptions ): Promise< [ - protosTypes.google.cloud.securitycenter.v1.IOrganizationSettings, + protos.google.cloud.securitycenter.v1.IOrganizationSettings, ( - | protosTypes.google.cloud.securitycenter.v1.IGetOrganizationSettingsRequest + | protos.google.cloud.securitycenter.v1.IGetOrganizationSettingsRequest | undefined ), {} | undefined ] >; getOrganizationSettings( - request: protosTypes.google.cloud.securitycenter.v1.IGetOrganizationSettingsRequest, + request: protos.google.cloud.securitycenter.v1.IGetOrganizationSettingsRequest, options: gax.CallOptions, callback: Callback< - protosTypes.google.cloud.securitycenter.v1.IOrganizationSettings, - | protosTypes.google.cloud.securitycenter.v1.IGetOrganizationSettingsRequest + protos.google.cloud.securitycenter.v1.IOrganizationSettings, + | protos.google.cloud.securitycenter.v1.IGetOrganizationSettingsRequest + | null | undefined, - {} | undefined + {} | null | undefined + > + ): void; + getOrganizationSettings( + request: protos.google.cloud.securitycenter.v1.IGetOrganizationSettingsRequest, + callback: Callback< + protos.google.cloud.securitycenter.v1.IOrganizationSettings, + | protos.google.cloud.securitycenter.v1.IGetOrganizationSettingsRequest + | null + | undefined, + {} | null | undefined > ): void; /** @@ -952,26 +1017,28 @@ export class SecurityCenterClient { * The promise has a method named "cancel" which cancels the ongoing API call. */ getOrganizationSettings( - request: protosTypes.google.cloud.securitycenter.v1.IGetOrganizationSettingsRequest, + request: protos.google.cloud.securitycenter.v1.IGetOrganizationSettingsRequest, optionsOrCallback?: | gax.CallOptions | Callback< - protosTypes.google.cloud.securitycenter.v1.IOrganizationSettings, - | protosTypes.google.cloud.securitycenter.v1.IGetOrganizationSettingsRequest + protos.google.cloud.securitycenter.v1.IOrganizationSettings, + | protos.google.cloud.securitycenter.v1.IGetOrganizationSettingsRequest + | null | undefined, - {} | undefined + {} | null | undefined >, callback?: Callback< - protosTypes.google.cloud.securitycenter.v1.IOrganizationSettings, - | protosTypes.google.cloud.securitycenter.v1.IGetOrganizationSettingsRequest + protos.google.cloud.securitycenter.v1.IOrganizationSettings, + | protos.google.cloud.securitycenter.v1.IGetOrganizationSettingsRequest + | null | undefined, - {} | undefined + {} | null | undefined > ): Promise< [ - protosTypes.google.cloud.securitycenter.v1.IOrganizationSettings, + protos.google.cloud.securitycenter.v1.IOrganizationSettings, ( - | protosTypes.google.cloud.securitycenter.v1.IGetOrganizationSettingsRequest + | protos.google.cloud.securitycenter.v1.IGetOrganizationSettingsRequest | undefined ), {} | undefined @@ -994,29 +1061,41 @@ export class SecurityCenterClient { name: request.name || '', }); this.initialize(); - return this._innerApiCalls.getOrganizationSettings( + return this.innerApiCalls.getOrganizationSettings( request, options, callback ); } getSource( - request: protosTypes.google.cloud.securitycenter.v1.IGetSourceRequest, + request: protos.google.cloud.securitycenter.v1.IGetSourceRequest, options?: gax.CallOptions ): Promise< [ - protosTypes.google.cloud.securitycenter.v1.ISource, - protosTypes.google.cloud.securitycenter.v1.IGetSourceRequest | undefined, + protos.google.cloud.securitycenter.v1.ISource, + protos.google.cloud.securitycenter.v1.IGetSourceRequest | undefined, {} | undefined ] >; getSource( - request: protosTypes.google.cloud.securitycenter.v1.IGetSourceRequest, + request: protos.google.cloud.securitycenter.v1.IGetSourceRequest, options: gax.CallOptions, callback: Callback< - protosTypes.google.cloud.securitycenter.v1.ISource, - protosTypes.google.cloud.securitycenter.v1.IGetSourceRequest | undefined, - {} | undefined + protos.google.cloud.securitycenter.v1.ISource, + | protos.google.cloud.securitycenter.v1.IGetSourceRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getSource( + request: protos.google.cloud.securitycenter.v1.IGetSourceRequest, + callback: Callback< + protos.google.cloud.securitycenter.v1.ISource, + | protos.google.cloud.securitycenter.v1.IGetSourceRequest + | null + | undefined, + {} | null | undefined > ): void; /** @@ -1034,24 +1113,27 @@ export class SecurityCenterClient { * The promise has a method named "cancel" which cancels the ongoing API call. */ getSource( - request: protosTypes.google.cloud.securitycenter.v1.IGetSourceRequest, + request: protos.google.cloud.securitycenter.v1.IGetSourceRequest, optionsOrCallback?: | gax.CallOptions | Callback< - protosTypes.google.cloud.securitycenter.v1.ISource, - | protosTypes.google.cloud.securitycenter.v1.IGetSourceRequest + protos.google.cloud.securitycenter.v1.ISource, + | protos.google.cloud.securitycenter.v1.IGetSourceRequest + | null | undefined, - {} | undefined + {} | null | undefined >, callback?: Callback< - protosTypes.google.cloud.securitycenter.v1.ISource, - protosTypes.google.cloud.securitycenter.v1.IGetSourceRequest | undefined, - {} | undefined + protos.google.cloud.securitycenter.v1.ISource, + | protos.google.cloud.securitycenter.v1.IGetSourceRequest + | null + | undefined, + {} | null | undefined > ): Promise< [ - protosTypes.google.cloud.securitycenter.v1.ISource, - protosTypes.google.cloud.securitycenter.v1.IGetSourceRequest | undefined, + protos.google.cloud.securitycenter.v1.ISource, + protos.google.cloud.securitycenter.v1.IGetSourceRequest | undefined, {} | undefined ] > | void { @@ -1072,29 +1154,37 @@ export class SecurityCenterClient { name: request.name || '', }); this.initialize(); - return this._innerApiCalls.getSource(request, options, callback); + return this.innerApiCalls.getSource(request, options, callback); } setFindingState( - request: protosTypes.google.cloud.securitycenter.v1.ISetFindingStateRequest, + request: protos.google.cloud.securitycenter.v1.ISetFindingStateRequest, options?: gax.CallOptions ): Promise< [ - protosTypes.google.cloud.securitycenter.v1.IFinding, - ( - | protosTypes.google.cloud.securitycenter.v1.ISetFindingStateRequest - | undefined - ), + protos.google.cloud.securitycenter.v1.IFinding, + protos.google.cloud.securitycenter.v1.ISetFindingStateRequest | undefined, {} | undefined ] >; setFindingState( - request: protosTypes.google.cloud.securitycenter.v1.ISetFindingStateRequest, + request: protos.google.cloud.securitycenter.v1.ISetFindingStateRequest, options: gax.CallOptions, callback: Callback< - protosTypes.google.cloud.securitycenter.v1.IFinding, - | protosTypes.google.cloud.securitycenter.v1.ISetFindingStateRequest + protos.google.cloud.securitycenter.v1.IFinding, + | protos.google.cloud.securitycenter.v1.ISetFindingStateRequest + | null | undefined, - {} | undefined + {} | null | undefined + > + ): void; + setFindingState( + request: protos.google.cloud.securitycenter.v1.ISetFindingStateRequest, + callback: Callback< + protos.google.cloud.securitycenter.v1.IFinding, + | protos.google.cloud.securitycenter.v1.ISetFindingStateRequest + | null + | undefined, + {} | null | undefined > ): void; /** @@ -1118,28 +1208,27 @@ export class SecurityCenterClient { * The promise has a method named "cancel" which cancels the ongoing API call. */ setFindingState( - request: protosTypes.google.cloud.securitycenter.v1.ISetFindingStateRequest, + request: protos.google.cloud.securitycenter.v1.ISetFindingStateRequest, optionsOrCallback?: | gax.CallOptions | Callback< - protosTypes.google.cloud.securitycenter.v1.IFinding, - | protosTypes.google.cloud.securitycenter.v1.ISetFindingStateRequest + protos.google.cloud.securitycenter.v1.IFinding, + | protos.google.cloud.securitycenter.v1.ISetFindingStateRequest + | null | undefined, - {} | undefined + {} | null | undefined >, callback?: Callback< - protosTypes.google.cloud.securitycenter.v1.IFinding, - | protosTypes.google.cloud.securitycenter.v1.ISetFindingStateRequest + protos.google.cloud.securitycenter.v1.IFinding, + | protos.google.cloud.securitycenter.v1.ISetFindingStateRequest + | null | undefined, - {} | undefined + {} | null | undefined > ): Promise< [ - protosTypes.google.cloud.securitycenter.v1.IFinding, - ( - | protosTypes.google.cloud.securitycenter.v1.ISetFindingStateRequest - | undefined - ), + protos.google.cloud.securitycenter.v1.IFinding, + protos.google.cloud.securitycenter.v1.ISetFindingStateRequest | undefined, {} | undefined ] > | void { @@ -1160,25 +1249,33 @@ export class SecurityCenterClient { name: request.name || '', }); this.initialize(); - return this._innerApiCalls.setFindingState(request, options, callback); + return this.innerApiCalls.setFindingState(request, options, callback); } setIamPolicy( - request: protosTypes.google.iam.v1.ISetIamPolicyRequest, + request: protos.google.iam.v1.ISetIamPolicyRequest, options?: gax.CallOptions ): Promise< [ - protosTypes.google.iam.v1.IPolicy, - protosTypes.google.iam.v1.ISetIamPolicyRequest | undefined, + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest | undefined, {} | undefined ] >; setIamPolicy( - request: protosTypes.google.iam.v1.ISetIamPolicyRequest, + request: protos.google.iam.v1.ISetIamPolicyRequest, options: gax.CallOptions, callback: Callback< - protosTypes.google.iam.v1.IPolicy, - protosTypes.google.iam.v1.ISetIamPolicyRequest | undefined, - {} | undefined + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ): void; + setIamPolicy( + request: protos.google.iam.v1.ISetIamPolicyRequest, + callback: Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest | null | undefined, + {} | null | undefined > ): void; /** @@ -1193,23 +1290,23 @@ export class SecurityCenterClient { * The promise has a method named "cancel" which cancels the ongoing API call. */ setIamPolicy( - request: protosTypes.google.iam.v1.ISetIamPolicyRequest, + request: protos.google.iam.v1.ISetIamPolicyRequest, optionsOrCallback?: | gax.CallOptions | Callback< - protosTypes.google.iam.v1.IPolicy, - protosTypes.google.iam.v1.ISetIamPolicyRequest | undefined, - {} | undefined + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest | null | undefined, + {} | null | undefined >, callback?: Callback< - protosTypes.google.iam.v1.IPolicy, - protosTypes.google.iam.v1.ISetIamPolicyRequest | undefined, - {} | undefined + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest | null | undefined, + {} | null | undefined > ): Promise< [ - protosTypes.google.iam.v1.IPolicy, - protosTypes.google.iam.v1.ISetIamPolicyRequest | undefined, + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest | undefined, {} | undefined ] > | void { @@ -1230,25 +1327,33 @@ export class SecurityCenterClient { resource: request.resource || '', }); this.initialize(); - return this._innerApiCalls.setIamPolicy(request, options, callback); + return this.innerApiCalls.setIamPolicy(request, options, callback); } testIamPermissions( - request: protosTypes.google.iam.v1.ITestIamPermissionsRequest, + request: protos.google.iam.v1.ITestIamPermissionsRequest, options?: gax.CallOptions ): Promise< [ - protosTypes.google.iam.v1.ITestIamPermissionsResponse, - protosTypes.google.iam.v1.ITestIamPermissionsRequest | undefined, + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest | undefined, {} | undefined ] >; testIamPermissions( - request: protosTypes.google.iam.v1.ITestIamPermissionsRequest, + request: protos.google.iam.v1.ITestIamPermissionsRequest, options: gax.CallOptions, callback: Callback< - protosTypes.google.iam.v1.ITestIamPermissionsResponse, - protosTypes.google.iam.v1.ITestIamPermissionsRequest | undefined, - {} | undefined + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest | null | undefined, + {} | null | undefined + > + ): void; + testIamPermissions( + request: protos.google.iam.v1.ITestIamPermissionsRequest, + callback: Callback< + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest | null | undefined, + {} | null | undefined > ): void; /** @@ -1263,23 +1368,23 @@ export class SecurityCenterClient { * The promise has a method named "cancel" which cancels the ongoing API call. */ testIamPermissions( - request: protosTypes.google.iam.v1.ITestIamPermissionsRequest, + request: protos.google.iam.v1.ITestIamPermissionsRequest, optionsOrCallback?: | gax.CallOptions | Callback< - protosTypes.google.iam.v1.ITestIamPermissionsResponse, - protosTypes.google.iam.v1.ITestIamPermissionsRequest | undefined, - {} | undefined + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest | null | undefined, + {} | null | undefined >, callback?: Callback< - protosTypes.google.iam.v1.ITestIamPermissionsResponse, - protosTypes.google.iam.v1.ITestIamPermissionsRequest | undefined, - {} | undefined + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest | null | undefined, + {} | null | undefined > ): Promise< [ - protosTypes.google.iam.v1.ITestIamPermissionsResponse, - protosTypes.google.iam.v1.ITestIamPermissionsRequest | undefined, + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest | undefined, {} | undefined ] > | void { @@ -1300,29 +1405,37 @@ export class SecurityCenterClient { resource: request.resource || '', }); this.initialize(); - return this._innerApiCalls.testIamPermissions(request, options, callback); + return this.innerApiCalls.testIamPermissions(request, options, callback); } updateFinding( - request: protosTypes.google.cloud.securitycenter.v1.IUpdateFindingRequest, + request: protos.google.cloud.securitycenter.v1.IUpdateFindingRequest, options?: gax.CallOptions ): Promise< [ - protosTypes.google.cloud.securitycenter.v1.IFinding, - ( - | protosTypes.google.cloud.securitycenter.v1.IUpdateFindingRequest - | undefined - ), + protos.google.cloud.securitycenter.v1.IFinding, + protos.google.cloud.securitycenter.v1.IUpdateFindingRequest | undefined, {} | undefined ] >; updateFinding( - request: protosTypes.google.cloud.securitycenter.v1.IUpdateFindingRequest, + request: protos.google.cloud.securitycenter.v1.IUpdateFindingRequest, options: gax.CallOptions, callback: Callback< - protosTypes.google.cloud.securitycenter.v1.IFinding, - | protosTypes.google.cloud.securitycenter.v1.IUpdateFindingRequest + protos.google.cloud.securitycenter.v1.IFinding, + | protos.google.cloud.securitycenter.v1.IUpdateFindingRequest + | null | undefined, - {} | undefined + {} | null | undefined + > + ): void; + updateFinding( + request: protos.google.cloud.securitycenter.v1.IUpdateFindingRequest, + callback: Callback< + protos.google.cloud.securitycenter.v1.IFinding, + | protos.google.cloud.securitycenter.v1.IUpdateFindingRequest + | null + | undefined, + {} | null | undefined > ): void; /** @@ -1353,28 +1466,27 @@ export class SecurityCenterClient { * The promise has a method named "cancel" which cancels the ongoing API call. */ updateFinding( - request: protosTypes.google.cloud.securitycenter.v1.IUpdateFindingRequest, + request: protos.google.cloud.securitycenter.v1.IUpdateFindingRequest, optionsOrCallback?: | gax.CallOptions | Callback< - protosTypes.google.cloud.securitycenter.v1.IFinding, - | protosTypes.google.cloud.securitycenter.v1.IUpdateFindingRequest + protos.google.cloud.securitycenter.v1.IFinding, + | protos.google.cloud.securitycenter.v1.IUpdateFindingRequest + | null | undefined, - {} | undefined + {} | null | undefined >, callback?: Callback< - protosTypes.google.cloud.securitycenter.v1.IFinding, - | protosTypes.google.cloud.securitycenter.v1.IUpdateFindingRequest + protos.google.cloud.securitycenter.v1.IFinding, + | protos.google.cloud.securitycenter.v1.IUpdateFindingRequest + | null | undefined, - {} | undefined + {} | null | undefined > ): Promise< [ - protosTypes.google.cloud.securitycenter.v1.IFinding, - ( - | protosTypes.google.cloud.securitycenter.v1.IUpdateFindingRequest - | undefined - ), + protos.google.cloud.securitycenter.v1.IFinding, + protos.google.cloud.securitycenter.v1.IUpdateFindingRequest | undefined, {} | undefined ] > | void { @@ -1395,29 +1507,40 @@ export class SecurityCenterClient { 'finding.name': request.finding!.name || '', }); this.initialize(); - return this._innerApiCalls.updateFinding(request, options, callback); + return this.innerApiCalls.updateFinding(request, options, callback); } updateNotificationConfig( - request: protosTypes.google.cloud.securitycenter.v1.IUpdateNotificationConfigRequest, + request: protos.google.cloud.securitycenter.v1.IUpdateNotificationConfigRequest, options?: gax.CallOptions ): Promise< [ - protosTypes.google.cloud.securitycenter.v1.INotificationConfig, + protos.google.cloud.securitycenter.v1.INotificationConfig, ( - | protosTypes.google.cloud.securitycenter.v1.IUpdateNotificationConfigRequest + | protos.google.cloud.securitycenter.v1.IUpdateNotificationConfigRequest | undefined ), {} | undefined ] >; updateNotificationConfig( - request: protosTypes.google.cloud.securitycenter.v1.IUpdateNotificationConfigRequest, + request: protos.google.cloud.securitycenter.v1.IUpdateNotificationConfigRequest, options: gax.CallOptions, callback: Callback< - protosTypes.google.cloud.securitycenter.v1.INotificationConfig, - | protosTypes.google.cloud.securitycenter.v1.IUpdateNotificationConfigRequest + protos.google.cloud.securitycenter.v1.INotificationConfig, + | protos.google.cloud.securitycenter.v1.IUpdateNotificationConfigRequest + | null | undefined, - {} | undefined + {} | null | undefined + > + ): void; + updateNotificationConfig( + request: protos.google.cloud.securitycenter.v1.IUpdateNotificationConfigRequest, + callback: Callback< + protos.google.cloud.securitycenter.v1.INotificationConfig, + | protos.google.cloud.securitycenter.v1.IUpdateNotificationConfigRequest + | null + | undefined, + {} | null | undefined > ): void; /** @@ -1439,26 +1562,28 @@ export class SecurityCenterClient { * The promise has a method named "cancel" which cancels the ongoing API call. */ updateNotificationConfig( - request: protosTypes.google.cloud.securitycenter.v1.IUpdateNotificationConfigRequest, + request: protos.google.cloud.securitycenter.v1.IUpdateNotificationConfigRequest, optionsOrCallback?: | gax.CallOptions | Callback< - protosTypes.google.cloud.securitycenter.v1.INotificationConfig, - | protosTypes.google.cloud.securitycenter.v1.IUpdateNotificationConfigRequest + protos.google.cloud.securitycenter.v1.INotificationConfig, + | protos.google.cloud.securitycenter.v1.IUpdateNotificationConfigRequest + | null | undefined, - {} | undefined + {} | null | undefined >, callback?: Callback< - protosTypes.google.cloud.securitycenter.v1.INotificationConfig, - | protosTypes.google.cloud.securitycenter.v1.IUpdateNotificationConfigRequest + protos.google.cloud.securitycenter.v1.INotificationConfig, + | protos.google.cloud.securitycenter.v1.IUpdateNotificationConfigRequest + | null | undefined, - {} | undefined + {} | null | undefined > ): Promise< [ - protosTypes.google.cloud.securitycenter.v1.INotificationConfig, + protos.google.cloud.securitycenter.v1.INotificationConfig, ( - | protosTypes.google.cloud.securitycenter.v1.IUpdateNotificationConfigRequest + | protos.google.cloud.securitycenter.v1.IUpdateNotificationConfigRequest | undefined ), {} | undefined @@ -1481,33 +1606,44 @@ export class SecurityCenterClient { 'notification_config.name': request.notificationConfig!.name || '', }); this.initialize(); - return this._innerApiCalls.updateNotificationConfig( + return this.innerApiCalls.updateNotificationConfig( request, options, callback ); } updateOrganizationSettings( - request: protosTypes.google.cloud.securitycenter.v1.IUpdateOrganizationSettingsRequest, + request: protos.google.cloud.securitycenter.v1.IUpdateOrganizationSettingsRequest, options?: gax.CallOptions ): Promise< [ - protosTypes.google.cloud.securitycenter.v1.IOrganizationSettings, + protos.google.cloud.securitycenter.v1.IOrganizationSettings, ( - | protosTypes.google.cloud.securitycenter.v1.IUpdateOrganizationSettingsRequest + | protos.google.cloud.securitycenter.v1.IUpdateOrganizationSettingsRequest | undefined ), {} | undefined ] >; updateOrganizationSettings( - request: protosTypes.google.cloud.securitycenter.v1.IUpdateOrganizationSettingsRequest, + request: protos.google.cloud.securitycenter.v1.IUpdateOrganizationSettingsRequest, options: gax.CallOptions, callback: Callback< - protosTypes.google.cloud.securitycenter.v1.IOrganizationSettings, - | protosTypes.google.cloud.securitycenter.v1.IUpdateOrganizationSettingsRequest + protos.google.cloud.securitycenter.v1.IOrganizationSettings, + | protos.google.cloud.securitycenter.v1.IUpdateOrganizationSettingsRequest + | null | undefined, - {} | undefined + {} | null | undefined + > + ): void; + updateOrganizationSettings( + request: protos.google.cloud.securitycenter.v1.IUpdateOrganizationSettingsRequest, + callback: Callback< + protos.google.cloud.securitycenter.v1.IOrganizationSettings, + | protos.google.cloud.securitycenter.v1.IUpdateOrganizationSettingsRequest + | null + | undefined, + {} | null | undefined > ): void; /** @@ -1528,26 +1664,28 @@ export class SecurityCenterClient { * The promise has a method named "cancel" which cancels the ongoing API call. */ updateOrganizationSettings( - request: protosTypes.google.cloud.securitycenter.v1.IUpdateOrganizationSettingsRequest, + request: protos.google.cloud.securitycenter.v1.IUpdateOrganizationSettingsRequest, optionsOrCallback?: | gax.CallOptions | Callback< - protosTypes.google.cloud.securitycenter.v1.IOrganizationSettings, - | protosTypes.google.cloud.securitycenter.v1.IUpdateOrganizationSettingsRequest + protos.google.cloud.securitycenter.v1.IOrganizationSettings, + | protos.google.cloud.securitycenter.v1.IUpdateOrganizationSettingsRequest + | null | undefined, - {} | undefined + {} | null | undefined >, callback?: Callback< - protosTypes.google.cloud.securitycenter.v1.IOrganizationSettings, - | protosTypes.google.cloud.securitycenter.v1.IUpdateOrganizationSettingsRequest + protos.google.cloud.securitycenter.v1.IOrganizationSettings, + | protos.google.cloud.securitycenter.v1.IUpdateOrganizationSettingsRequest + | null | undefined, - {} | undefined + {} | null | undefined > ): Promise< [ - protosTypes.google.cloud.securitycenter.v1.IOrganizationSettings, + protos.google.cloud.securitycenter.v1.IOrganizationSettings, ( - | protosTypes.google.cloud.securitycenter.v1.IUpdateOrganizationSettingsRequest + | protos.google.cloud.securitycenter.v1.IUpdateOrganizationSettingsRequest | undefined ), {} | undefined @@ -1570,33 +1708,41 @@ export class SecurityCenterClient { 'organization_settings.name': request.organizationSettings!.name || '', }); this.initialize(); - return this._innerApiCalls.updateOrganizationSettings( + return this.innerApiCalls.updateOrganizationSettings( request, options, callback ); } updateSource( - request: protosTypes.google.cloud.securitycenter.v1.IUpdateSourceRequest, + request: protos.google.cloud.securitycenter.v1.IUpdateSourceRequest, options?: gax.CallOptions ): Promise< [ - protosTypes.google.cloud.securitycenter.v1.ISource, - ( - | protosTypes.google.cloud.securitycenter.v1.IUpdateSourceRequest - | undefined - ), + protos.google.cloud.securitycenter.v1.ISource, + protos.google.cloud.securitycenter.v1.IUpdateSourceRequest | undefined, {} | undefined ] >; updateSource( - request: protosTypes.google.cloud.securitycenter.v1.IUpdateSourceRequest, + request: protos.google.cloud.securitycenter.v1.IUpdateSourceRequest, options: gax.CallOptions, callback: Callback< - protosTypes.google.cloud.securitycenter.v1.ISource, - | protosTypes.google.cloud.securitycenter.v1.IUpdateSourceRequest + protos.google.cloud.securitycenter.v1.ISource, + | protos.google.cloud.securitycenter.v1.IUpdateSourceRequest + | null | undefined, - {} | undefined + {} | null | undefined + > + ): void; + updateSource( + request: protos.google.cloud.securitycenter.v1.IUpdateSourceRequest, + callback: Callback< + protos.google.cloud.securitycenter.v1.ISource, + | protos.google.cloud.securitycenter.v1.IUpdateSourceRequest + | null + | undefined, + {} | null | undefined > ): void; /** @@ -1617,28 +1763,27 @@ export class SecurityCenterClient { * The promise has a method named "cancel" which cancels the ongoing API call. */ updateSource( - request: protosTypes.google.cloud.securitycenter.v1.IUpdateSourceRequest, + request: protos.google.cloud.securitycenter.v1.IUpdateSourceRequest, optionsOrCallback?: | gax.CallOptions | Callback< - protosTypes.google.cloud.securitycenter.v1.ISource, - | protosTypes.google.cloud.securitycenter.v1.IUpdateSourceRequest + protos.google.cloud.securitycenter.v1.ISource, + | protos.google.cloud.securitycenter.v1.IUpdateSourceRequest + | null | undefined, - {} | undefined + {} | null | undefined >, callback?: Callback< - protosTypes.google.cloud.securitycenter.v1.ISource, - | protosTypes.google.cloud.securitycenter.v1.IUpdateSourceRequest + protos.google.cloud.securitycenter.v1.ISource, + | protos.google.cloud.securitycenter.v1.IUpdateSourceRequest + | null | undefined, - {} | undefined + {} | null | undefined > ): Promise< [ - protosTypes.google.cloud.securitycenter.v1.ISource, - ( - | protosTypes.google.cloud.securitycenter.v1.IUpdateSourceRequest - | undefined - ), + protos.google.cloud.securitycenter.v1.ISource, + protos.google.cloud.securitycenter.v1.IUpdateSourceRequest | undefined, {} | undefined ] > | void { @@ -1659,29 +1804,40 @@ export class SecurityCenterClient { 'source.name': request.source!.name || '', }); this.initialize(); - return this._innerApiCalls.updateSource(request, options, callback); + return this.innerApiCalls.updateSource(request, options, callback); } updateSecurityMarks( - request: protosTypes.google.cloud.securitycenter.v1.IUpdateSecurityMarksRequest, + request: protos.google.cloud.securitycenter.v1.IUpdateSecurityMarksRequest, options?: gax.CallOptions ): Promise< [ - protosTypes.google.cloud.securitycenter.v1.ISecurityMarks, + protos.google.cloud.securitycenter.v1.ISecurityMarks, ( - | protosTypes.google.cloud.securitycenter.v1.IUpdateSecurityMarksRequest + | protos.google.cloud.securitycenter.v1.IUpdateSecurityMarksRequest | undefined ), {} | undefined ] >; updateSecurityMarks( - request: protosTypes.google.cloud.securitycenter.v1.IUpdateSecurityMarksRequest, + request: protos.google.cloud.securitycenter.v1.IUpdateSecurityMarksRequest, options: gax.CallOptions, callback: Callback< - protosTypes.google.cloud.securitycenter.v1.ISecurityMarks, - | protosTypes.google.cloud.securitycenter.v1.IUpdateSecurityMarksRequest + protos.google.cloud.securitycenter.v1.ISecurityMarks, + | protos.google.cloud.securitycenter.v1.IUpdateSecurityMarksRequest + | null | undefined, - {} | undefined + {} | null | undefined + > + ): void; + updateSecurityMarks( + request: protos.google.cloud.securitycenter.v1.IUpdateSecurityMarksRequest, + callback: Callback< + protos.google.cloud.securitycenter.v1.ISecurityMarks, + | protos.google.cloud.securitycenter.v1.IUpdateSecurityMarksRequest + | null + | undefined, + {} | null | undefined > ): void; /** @@ -1708,26 +1864,28 @@ export class SecurityCenterClient { * The promise has a method named "cancel" which cancels the ongoing API call. */ updateSecurityMarks( - request: protosTypes.google.cloud.securitycenter.v1.IUpdateSecurityMarksRequest, + request: protos.google.cloud.securitycenter.v1.IUpdateSecurityMarksRequest, optionsOrCallback?: | gax.CallOptions | Callback< - protosTypes.google.cloud.securitycenter.v1.ISecurityMarks, - | protosTypes.google.cloud.securitycenter.v1.IUpdateSecurityMarksRequest + protos.google.cloud.securitycenter.v1.ISecurityMarks, + | protos.google.cloud.securitycenter.v1.IUpdateSecurityMarksRequest + | null | undefined, - {} | undefined + {} | null | undefined >, callback?: Callback< - protosTypes.google.cloud.securitycenter.v1.ISecurityMarks, - | protosTypes.google.cloud.securitycenter.v1.IUpdateSecurityMarksRequest + protos.google.cloud.securitycenter.v1.ISecurityMarks, + | protos.google.cloud.securitycenter.v1.IUpdateSecurityMarksRequest + | null | undefined, - {} | undefined + {} | null | undefined > ): Promise< [ - protosTypes.google.cloud.securitycenter.v1.ISecurityMarks, + protos.google.cloud.securitycenter.v1.ISecurityMarks, ( - | protosTypes.google.cloud.securitycenter.v1.IUpdateSecurityMarksRequest + | protos.google.cloud.securitycenter.v1.IUpdateSecurityMarksRequest | undefined ), {} | undefined @@ -1750,32 +1908,43 @@ export class SecurityCenterClient { 'security_marks.name': request.securityMarks!.name || '', }); this.initialize(); - return this._innerApiCalls.updateSecurityMarks(request, options, callback); + return this.innerApiCalls.updateSecurityMarks(request, options, callback); } runAssetDiscovery( - request: protosTypes.google.cloud.securitycenter.v1.IRunAssetDiscoveryRequest, + request: protos.google.cloud.securitycenter.v1.IRunAssetDiscoveryRequest, options?: gax.CallOptions ): Promise< [ LROperation< - protosTypes.google.cloud.securitycenter.v1.IRunAssetDiscoveryResponse, - protosTypes.google.protobuf.IEmpty + protos.google.cloud.securitycenter.v1.IRunAssetDiscoveryResponse, + protos.google.protobuf.IEmpty >, - protosTypes.google.longrunning.IOperation | undefined, + protos.google.longrunning.IOperation | undefined, {} | undefined ] >; runAssetDiscovery( - request: protosTypes.google.cloud.securitycenter.v1.IRunAssetDiscoveryRequest, + request: protos.google.cloud.securitycenter.v1.IRunAssetDiscoveryRequest, options: gax.CallOptions, callback: Callback< LROperation< - protosTypes.google.cloud.securitycenter.v1.IRunAssetDiscoveryResponse, - protosTypes.google.protobuf.IEmpty + protos.google.cloud.securitycenter.v1.IRunAssetDiscoveryResponse, + protos.google.protobuf.IEmpty >, - protosTypes.google.longrunning.IOperation | undefined, - {} | undefined + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + runAssetDiscovery( + request: protos.google.cloud.securitycenter.v1.IRunAssetDiscoveryRequest, + callback: Callback< + LROperation< + protos.google.cloud.securitycenter.v1.IRunAssetDiscoveryResponse, + protos.google.protobuf.IEmpty + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined > ): void; /** @@ -1798,32 +1967,32 @@ export class SecurityCenterClient { * The promise has a method named "cancel" which cancels the ongoing API call. */ runAssetDiscovery( - request: protosTypes.google.cloud.securitycenter.v1.IRunAssetDiscoveryRequest, + request: protos.google.cloud.securitycenter.v1.IRunAssetDiscoveryRequest, optionsOrCallback?: | gax.CallOptions | Callback< LROperation< - protosTypes.google.cloud.securitycenter.v1.IRunAssetDiscoveryResponse, - protosTypes.google.protobuf.IEmpty + protos.google.cloud.securitycenter.v1.IRunAssetDiscoveryResponse, + protos.google.protobuf.IEmpty >, - protosTypes.google.longrunning.IOperation | undefined, - {} | undefined + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined >, callback?: Callback< LROperation< - protosTypes.google.cloud.securitycenter.v1.IRunAssetDiscoveryResponse, - protosTypes.google.protobuf.IEmpty + protos.google.cloud.securitycenter.v1.IRunAssetDiscoveryResponse, + protos.google.protobuf.IEmpty >, - protosTypes.google.longrunning.IOperation | undefined, - {} | undefined + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined > ): Promise< [ LROperation< - protosTypes.google.cloud.securitycenter.v1.IRunAssetDiscoveryResponse, - protosTypes.google.protobuf.IEmpty + protos.google.cloud.securitycenter.v1.IRunAssetDiscoveryResponse, + protos.google.protobuf.IEmpty >, - protosTypes.google.longrunning.IOperation | undefined, + protos.google.longrunning.IOperation | undefined, {} | undefined ] > | void { @@ -1844,25 +2013,37 @@ export class SecurityCenterClient { parent: request.parent || '', }); this.initialize(); - return this._innerApiCalls.runAssetDiscovery(request, options, callback); + return this.innerApiCalls.runAssetDiscovery(request, options, callback); } groupAssets( - request: protosTypes.google.cloud.securitycenter.v1.IGroupAssetsRequest, + request: protos.google.cloud.securitycenter.v1.IGroupAssetsRequest, options?: gax.CallOptions ): Promise< [ - protosTypes.google.cloud.securitycenter.v1.IGroupResult[], - protosTypes.google.cloud.securitycenter.v1.IGroupAssetsRequest | null, - protosTypes.google.cloud.securitycenter.v1.IGroupAssetsResponse + protos.google.cloud.securitycenter.v1.IGroupResult[], + protos.google.cloud.securitycenter.v1.IGroupAssetsRequest | null, + protos.google.cloud.securitycenter.v1.IGroupAssetsResponse ] >; groupAssets( - request: protosTypes.google.cloud.securitycenter.v1.IGroupAssetsRequest, + request: protos.google.cloud.securitycenter.v1.IGroupAssetsRequest, options: gax.CallOptions, - callback: Callback< - protosTypes.google.cloud.securitycenter.v1.IGroupResult[], - protosTypes.google.cloud.securitycenter.v1.IGroupAssetsRequest | null, - protosTypes.google.cloud.securitycenter.v1.IGroupAssetsResponse + callback: PaginationCallback< + protos.google.cloud.securitycenter.v1.IGroupAssetsRequest, + | protos.google.cloud.securitycenter.v1.IGroupAssetsResponse + | null + | undefined, + protos.google.cloud.securitycenter.v1.IGroupResult + > + ): void; + groupAssets( + request: protos.google.cloud.securitycenter.v1.IGroupAssetsRequest, + callback: PaginationCallback< + protos.google.cloud.securitycenter.v1.IGroupAssetsRequest, + | protos.google.cloud.securitycenter.v1.IGroupAssetsResponse + | null + | undefined, + protos.google.cloud.securitycenter.v1.IGroupResult > ): void; /** @@ -2009,24 +2190,28 @@ export class SecurityCenterClient { * The promise has a method named "cancel" which cancels the ongoing API call. */ groupAssets( - request: protosTypes.google.cloud.securitycenter.v1.IGroupAssetsRequest, + request: protos.google.cloud.securitycenter.v1.IGroupAssetsRequest, optionsOrCallback?: | gax.CallOptions - | Callback< - protosTypes.google.cloud.securitycenter.v1.IGroupResult[], - protosTypes.google.cloud.securitycenter.v1.IGroupAssetsRequest | null, - protosTypes.google.cloud.securitycenter.v1.IGroupAssetsResponse + | PaginationCallback< + protos.google.cloud.securitycenter.v1.IGroupAssetsRequest, + | protos.google.cloud.securitycenter.v1.IGroupAssetsResponse + | null + | undefined, + protos.google.cloud.securitycenter.v1.IGroupResult >, - callback?: Callback< - protosTypes.google.cloud.securitycenter.v1.IGroupResult[], - protosTypes.google.cloud.securitycenter.v1.IGroupAssetsRequest | null, - protosTypes.google.cloud.securitycenter.v1.IGroupAssetsResponse + callback?: PaginationCallback< + protos.google.cloud.securitycenter.v1.IGroupAssetsRequest, + | protos.google.cloud.securitycenter.v1.IGroupAssetsResponse + | null + | undefined, + protos.google.cloud.securitycenter.v1.IGroupResult > ): Promise< [ - protosTypes.google.cloud.securitycenter.v1.IGroupResult[], - protosTypes.google.cloud.securitycenter.v1.IGroupAssetsRequest | null, - protosTypes.google.cloud.securitycenter.v1.IGroupAssetsResponse + protos.google.cloud.securitycenter.v1.IGroupResult[], + protos.google.cloud.securitycenter.v1.IGroupAssetsRequest | null, + protos.google.cloud.securitycenter.v1.IGroupAssetsResponse ] > | void { request = request || {}; @@ -2046,7 +2231,7 @@ export class SecurityCenterClient { parent: request.parent || '', }); this.initialize(); - return this._innerApiCalls.groupAssets(request, options, callback); + return this.innerApiCalls.groupAssets(request, options, callback); } /** @@ -2189,7 +2374,7 @@ export class SecurityCenterClient { * An object stream which emits an object representing [GroupResult]{@link google.cloud.securitycenter.v1.GroupResult} on 'data' event. */ groupAssetsStream( - request?: protosTypes.google.cloud.securitycenter.v1.IGroupAssetsRequest, + request?: protos.google.cloud.securitycenter.v1.IGroupAssetsRequest, options?: gax.CallOptions ): Transform { request = request || {}; @@ -2203,57 +2388,37 @@ export class SecurityCenterClient { }); const callSettings = new gax.CallSettings(options); this.initialize(); - return this._descriptors.page.groupAssets.createStream( - this._innerApiCalls.groupAssets as gax.GaxCall, + return this.descriptors.page.groupAssets.createStream( + this.innerApiCalls.groupAssets as gax.GaxCall, request, callSettings ); } - groupFindings( - request: protosTypes.google.cloud.securitycenter.v1.IGroupFindingsRequest, - options?: gax.CallOptions - ): Promise< - [ - protosTypes.google.cloud.securitycenter.v1.IGroupResult[], - protosTypes.google.cloud.securitycenter.v1.IGroupFindingsRequest | null, - protosTypes.google.cloud.securitycenter.v1.IGroupFindingsResponse - ] - >; - groupFindings( - request: protosTypes.google.cloud.securitycenter.v1.IGroupFindingsRequest, - options: gax.CallOptions, - callback: Callback< - protosTypes.google.cloud.securitycenter.v1.IGroupResult[], - protosTypes.google.cloud.securitycenter.v1.IGroupFindingsRequest | null, - protosTypes.google.cloud.securitycenter.v1.IGroupFindingsResponse - > - ): void; + /** - * Filters an organization or source's findings and groups them by their - * specified properties. + * Equivalent to {@link groupAssets}, but returns an iterable object. * - * To group across all sources provide a `-` as the source id. - * Example: /v1/organizations/{organization_id}/sources/-/findings + * for-await-of syntax is used with the iterable to recursively get response element on-demand. * * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. Name of the source to groupBy. Its format is - * "organizations/[organization_id]/sources/[source_id]". To groupBy across - * all sources provide a source_id of `-`. For example: - * organizations/{organization_id}/sources/- + * Required. Name of the organization to groupBy. Its format is + * "organizations/[organization_id]". * @param {string} request.filter - * Expression that defines the filter to apply across findings. - * The expression is a list of one or more restrictions combined via logical + * Expression that defines the filter to apply across assets. + * The expression is a list of zero or more restrictions combined via logical * operators `AND` and `OR`. * Parentheses are supported, and `OR` has higher precedence than `AND`. * * Restrictions have the form ` ` and may have a `-` - * character in front of them to indicate negation. Examples include: + * character in front of them to indicate negation. The fields map to those + * defined in the Asset resource. Examples include: * - * * name - * * source_properties.a_property - * * security_marks.marks.marka + * * name + * * security_center_properties.resource_name + * * resource_properties.a_property + * * security_marks.marks.marka * * The supported operators are: * @@ -2270,33 +2435,219 @@ export class SecurityCenterClient { * The following field and operator combinations are supported: * * * name: `=` - * * parent: `=`, `:` - * * resource_name: `=`, `:` - * * state: `=`, `:` - * * category: `=`, `:` - * * external_uri: `=`, `:` - * * event_time: `=`, `>`, `<`, `>=`, `<=` + * * update_time: `=`, `>`, `<`, `>=`, `<=` * * Usage: This should be milliseconds since epoch or an RFC3339 string. * Examples: - * "event_time = \"2019-06-10T16:07:18-07:00\"" - * "event_time = 1560208038000" + * "update_time = \"2019-06-10T16:07:18-07:00\"" + * "update_time = 1560208038000" + * + * * create_time: `=`, `>`, `<`, `>=`, `<=` * + * Usage: This should be milliseconds since epoch or an RFC3339 string. + * Examples: + * "create_time = \"2019-06-10T16:07:18-07:00\"" + * "create_time = 1560208038000" + * + * * iam_policy.policy_blob: `=`, `:` + * * resource_properties: `=`, `:`, `>`, `<`, `>=`, `<=` * * security_marks.marks: `=`, `:` - * * source_properties: `=`, `:`, `>`, `<`, `>=`, `<=` + * * security_center_properties.resource_name: `=`, `:` + * * security_center_properties.resource_display_name: `=`, `:` + * * security_center_properties.resource_type: `=`, `:` + * * security_center_properties.resource_parent: `=`, `:` + * * security_center_properties.resource_parent_display_name: `=`, `:` + * * security_center_properties.resource_project: `=`, `:` + * * security_center_properties.resource_project_display_name: `=`, `:` + * * security_center_properties.resource_owners: `=`, `:` * - * For example, `source_properties.size = 100` is a valid filter string. + * For example, `resource_properties.size = 100` is a valid filter string. * @param {string} request.groupBy - * Required. Expression that defines what assets fields to use for grouping - * (including `state_change`). The string value should follow SQL syntax: - * comma separated list of fields. For example: "parent,resource_name". - * - * The following fields are supported: + * Required. Expression that defines what assets fields to use for grouping. + * The string value should follow SQL syntax: comma separated list of fields. + * For example: + * "security_center_properties.resource_project,security_center_properties.project". * - * * resource_name - * * category - * * state - * * parent + * The following fields are supported when compare_duration is not set: + * + * * security_center_properties.resource_project + * * security_center_properties.resource_project_display_name + * * security_center_properties.resource_type + * * security_center_properties.resource_parent + * * security_center_properties.resource_parent_display_name + * + * The following fields are supported when compare_duration is set: + * + * * security_center_properties.resource_type + * * security_center_properties.resource_project_display_name + * * security_center_properties.resource_parent_display_name + * @param {google.protobuf.Duration} request.compareDuration + * When compare_duration is set, the GroupResult's "state_change" property is + * updated to indicate whether the asset was added, removed, or remained + * present during the compare_duration period of time that precedes the + * read_time. This is the time between (read_time - compare_duration) and + * read_time. + * + * The state change value is derived based on the presence of the asset at the + * two points in time. Intermediate state changes between the two times don't + * affect the result. For example, the results aren't affected if the asset is + * removed and re-created again. + * + * Possible "state_change" values when compare_duration is specified: + * + * * "ADDED": indicates that the asset was not present at the start of + * compare_duration, but present at reference_time. + * * "REMOVED": indicates that the asset was present at the start of + * compare_duration, but not present at reference_time. + * * "ACTIVE": indicates that the asset was present at both the + * start and the end of the time period defined by + * compare_duration and reference_time. + * + * If compare_duration is not specified, then the only possible state_change + * is "UNUSED", which will be the state_change set for all assets present at + * read_time. + * + * If this field is set then `state_change` must be a specified field in + * `group_by`. + * @param {google.protobuf.Timestamp} request.readTime + * Time used as a reference point when filtering assets. The filter is limited + * to assets existing at the supplied time and their values are those at that + * specific time. Absence of this field will default to the API's version of + * NOW. + * @param {string} request.pageToken + * The value returned by the last `GroupAssetsResponse`; indicates + * that this is a continuation of a prior `GroupAssets` call, and that the + * system should return the next page of data. + * @param {number} request.pageSize + * The maximum number of results to return in a single response. Default is + * 10, minimum is 1, maximum is 1000. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols. + */ + groupAssetsAsync( + request?: protos.google.cloud.securitycenter.v1.IGroupAssetsRequest, + options?: gax.CallOptions + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.groupAssets.asyncIterate( + this.innerApiCalls['groupAssets'] as GaxCall, + (request as unknown) as RequestType, + callSettings + ) as AsyncIterable; + } + groupFindings( + request: protos.google.cloud.securitycenter.v1.IGroupFindingsRequest, + options?: gax.CallOptions + ): Promise< + [ + protos.google.cloud.securitycenter.v1.IGroupResult[], + protos.google.cloud.securitycenter.v1.IGroupFindingsRequest | null, + protos.google.cloud.securitycenter.v1.IGroupFindingsResponse + ] + >; + groupFindings( + request: protos.google.cloud.securitycenter.v1.IGroupFindingsRequest, + options: gax.CallOptions, + callback: PaginationCallback< + protos.google.cloud.securitycenter.v1.IGroupFindingsRequest, + | protos.google.cloud.securitycenter.v1.IGroupFindingsResponse + | null + | undefined, + protos.google.cloud.securitycenter.v1.IGroupResult + > + ): void; + groupFindings( + request: protos.google.cloud.securitycenter.v1.IGroupFindingsRequest, + callback: PaginationCallback< + protos.google.cloud.securitycenter.v1.IGroupFindingsRequest, + | protos.google.cloud.securitycenter.v1.IGroupFindingsResponse + | null + | undefined, + protos.google.cloud.securitycenter.v1.IGroupResult + > + ): void; + /** + * Filters an organization or source's findings and groups them by their + * specified properties. + * + * To group across all sources provide a `-` as the source id. + * Example: /v1/organizations/{organization_id}/sources/-/findings + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Name of the source to groupBy. Its format is + * "organizations/[organization_id]/sources/[source_id]". To groupBy across + * all sources provide a source_id of `-`. For example: + * organizations/{organization_id}/sources/- + * @param {string} request.filter + * Expression that defines the filter to apply across findings. + * The expression is a list of one or more restrictions combined via logical + * operators `AND` and `OR`. + * Parentheses are supported, and `OR` has higher precedence than `AND`. + * + * Restrictions have the form ` ` and may have a `-` + * character in front of them to indicate negation. Examples include: + * + * * name + * * source_properties.a_property + * * security_marks.marks.marka + * + * The supported operators are: + * + * * `=` for all value types. + * * `>`, `<`, `>=`, `<=` for integer values. + * * `:`, meaning substring matching, for strings. + * + * The supported value types are: + * + * * string literals in quotes. + * * integer literals without quotes. + * * boolean literals `true` and `false` without quotes. + * + * The following field and operator combinations are supported: + * + * * name: `=` + * * parent: `=`, `:` + * * resource_name: `=`, `:` + * * state: `=`, `:` + * * category: `=`, `:` + * * external_uri: `=`, `:` + * * event_time: `=`, `>`, `<`, `>=`, `<=` + * + * Usage: This should be milliseconds since epoch or an RFC3339 string. + * Examples: + * "event_time = \"2019-06-10T16:07:18-07:00\"" + * "event_time = 1560208038000" + * + * * security_marks.marks: `=`, `:` + * * source_properties: `=`, `:`, `>`, `<`, `>=`, `<=` + * + * For example, `source_properties.size = 100` is a valid filter string. + * @param {string} request.groupBy + * Required. Expression that defines what assets fields to use for grouping + * (including `state_change`). The string value should follow SQL syntax: + * comma separated list of fields. For example: "parent,resource_name". + * + * The following fields are supported: + * + * * resource_name + * * category + * * state + * * parent * * The following fields are supported when compare_duration is set: * @@ -2365,24 +2716,28 @@ export class SecurityCenterClient { * The promise has a method named "cancel" which cancels the ongoing API call. */ groupFindings( - request: protosTypes.google.cloud.securitycenter.v1.IGroupFindingsRequest, + request: protos.google.cloud.securitycenter.v1.IGroupFindingsRequest, optionsOrCallback?: | gax.CallOptions - | Callback< - protosTypes.google.cloud.securitycenter.v1.IGroupResult[], - protosTypes.google.cloud.securitycenter.v1.IGroupFindingsRequest | null, - protosTypes.google.cloud.securitycenter.v1.IGroupFindingsResponse + | PaginationCallback< + protos.google.cloud.securitycenter.v1.IGroupFindingsRequest, + | protos.google.cloud.securitycenter.v1.IGroupFindingsResponse + | null + | undefined, + protos.google.cloud.securitycenter.v1.IGroupResult >, - callback?: Callback< - protosTypes.google.cloud.securitycenter.v1.IGroupResult[], - protosTypes.google.cloud.securitycenter.v1.IGroupFindingsRequest | null, - protosTypes.google.cloud.securitycenter.v1.IGroupFindingsResponse + callback?: PaginationCallback< + protos.google.cloud.securitycenter.v1.IGroupFindingsRequest, + | protos.google.cloud.securitycenter.v1.IGroupFindingsResponse + | null + | undefined, + protos.google.cloud.securitycenter.v1.IGroupResult > ): Promise< [ - protosTypes.google.cloud.securitycenter.v1.IGroupResult[], - protosTypes.google.cloud.securitycenter.v1.IGroupFindingsRequest | null, - protosTypes.google.cloud.securitycenter.v1.IGroupFindingsResponse + protos.google.cloud.securitycenter.v1.IGroupResult[], + protos.google.cloud.securitycenter.v1.IGroupFindingsRequest | null, + protos.google.cloud.securitycenter.v1.IGroupFindingsResponse ] > | void { request = request || {}; @@ -2402,7 +2757,7 @@ export class SecurityCenterClient { parent: request.parent || '', }); this.initialize(); - return this._innerApiCalls.groupFindings(request, options, callback); + return this.innerApiCalls.groupFindings(request, options, callback); } /** @@ -2535,7 +2890,7 @@ export class SecurityCenterClient { * An object stream which emits an object representing [GroupResult]{@link google.cloud.securitycenter.v1.GroupResult} on 'data' event. */ groupFindingsStream( - request?: protosTypes.google.cloud.securitycenter.v1.IGroupFindingsRequest, + request?: protos.google.cloud.securitycenter.v1.IGroupFindingsRequest, options?: gax.CallOptions ): Transform { request = request || {}; @@ -2549,29 +2904,185 @@ export class SecurityCenterClient { }); const callSettings = new gax.CallSettings(options); this.initialize(); - return this._descriptors.page.groupFindings.createStream( - this._innerApiCalls.groupFindings as gax.GaxCall, + return this.descriptors.page.groupFindings.createStream( + this.innerApiCalls.groupFindings as gax.GaxCall, request, callSettings ); } + + /** + * Equivalent to {@link groupFindings}, but returns an iterable object. + * + * for-await-of syntax is used with the iterable to recursively get response element on-demand. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Name of the source to groupBy. Its format is + * "organizations/[organization_id]/sources/[source_id]". To groupBy across + * all sources provide a source_id of `-`. For example: + * organizations/{organization_id}/sources/- + * @param {string} request.filter + * Expression that defines the filter to apply across findings. + * The expression is a list of one or more restrictions combined via logical + * operators `AND` and `OR`. + * Parentheses are supported, and `OR` has higher precedence than `AND`. + * + * Restrictions have the form ` ` and may have a `-` + * character in front of them to indicate negation. Examples include: + * + * * name + * * source_properties.a_property + * * security_marks.marks.marka + * + * The supported operators are: + * + * * `=` for all value types. + * * `>`, `<`, `>=`, `<=` for integer values. + * * `:`, meaning substring matching, for strings. + * + * The supported value types are: + * + * * string literals in quotes. + * * integer literals without quotes. + * * boolean literals `true` and `false` without quotes. + * + * The following field and operator combinations are supported: + * + * * name: `=` + * * parent: `=`, `:` + * * resource_name: `=`, `:` + * * state: `=`, `:` + * * category: `=`, `:` + * * external_uri: `=`, `:` + * * event_time: `=`, `>`, `<`, `>=`, `<=` + * + * Usage: This should be milliseconds since epoch or an RFC3339 string. + * Examples: + * "event_time = \"2019-06-10T16:07:18-07:00\"" + * "event_time = 1560208038000" + * + * * security_marks.marks: `=`, `:` + * * source_properties: `=`, `:`, `>`, `<`, `>=`, `<=` + * + * For example, `source_properties.size = 100` is a valid filter string. + * @param {string} request.groupBy + * Required. Expression that defines what assets fields to use for grouping + * (including `state_change`). The string value should follow SQL syntax: + * comma separated list of fields. For example: "parent,resource_name". + * + * The following fields are supported: + * + * * resource_name + * * category + * * state + * * parent + * + * The following fields are supported when compare_duration is set: + * + * * state_change + * @param {google.protobuf.Timestamp} request.readTime + * Time used as a reference point when filtering findings. The filter is + * limited to findings existing at the supplied time and their values are + * those at that specific time. Absence of this field will default to the + * API's version of NOW. + * @param {google.protobuf.Duration} request.compareDuration + * When compare_duration is set, the GroupResult's "state_change" attribute is + * updated to indicate whether the finding had its state changed, the + * finding's state remained unchanged, or if the finding was added during the + * compare_duration period of time that precedes the read_time. This is the + * time between (read_time - compare_duration) and read_time. + * + * The state_change value is derived based on the presence and state of the + * finding at the two points in time. Intermediate state changes between the + * two times don't affect the result. For example, the results aren't affected + * if the finding is made inactive and then active again. + * + * Possible "state_change" values when compare_duration is specified: + * + * * "CHANGED": indicates that the finding was present and matched the given + * filter at the start of compare_duration, but changed its + * state at read_time. + * * "UNCHANGED": indicates that the finding was present and matched the given + * filter at the start of compare_duration and did not change + * state at read_time. + * * "ADDED": indicates that the finding did not match the given filter or + * was not present at the start of compare_duration, but was + * present at read_time. + * * "REMOVED": indicates that the finding was present and matched the + * filter at the start of compare_duration, but did not match + * the filter at read_time. + * + * If compare_duration is not specified, then the only possible state_change + * is "UNUSED", which will be the state_change set for all findings present + * at read_time. + * + * If this field is set then `state_change` must be a specified field in + * `group_by`. + * @param {string} request.pageToken + * The value returned by the last `GroupFindingsResponse`; indicates + * that this is a continuation of a prior `GroupFindings` call, and + * that the system should return the next page of data. + * @param {number} request.pageSize + * The maximum number of results to return in a single response. Default is + * 10, minimum is 1, maximum is 1000. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols. + */ + groupFindingsAsync( + request?: protos.google.cloud.securitycenter.v1.IGroupFindingsRequest, + options?: gax.CallOptions + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.groupFindings.asyncIterate( + this.innerApiCalls['groupFindings'] as GaxCall, + (request as unknown) as RequestType, + callSettings + ) as AsyncIterable; + } listAssets( - request: protosTypes.google.cloud.securitycenter.v1.IListAssetsRequest, + request: protos.google.cloud.securitycenter.v1.IListAssetsRequest, options?: gax.CallOptions ): Promise< [ - protosTypes.google.cloud.securitycenter.v1.ListAssetsResponse.IListAssetsResult[], - protosTypes.google.cloud.securitycenter.v1.IListAssetsRequest | null, - protosTypes.google.cloud.securitycenter.v1.IListAssetsResponse + protos.google.cloud.securitycenter.v1.ListAssetsResponse.IListAssetsResult[], + protos.google.cloud.securitycenter.v1.IListAssetsRequest | null, + protos.google.cloud.securitycenter.v1.IListAssetsResponse ] >; listAssets( - request: protosTypes.google.cloud.securitycenter.v1.IListAssetsRequest, + request: protos.google.cloud.securitycenter.v1.IListAssetsRequest, options: gax.CallOptions, - callback: Callback< - protosTypes.google.cloud.securitycenter.v1.ListAssetsResponse.IListAssetsResult[], - protosTypes.google.cloud.securitycenter.v1.IListAssetsRequest | null, - protosTypes.google.cloud.securitycenter.v1.IListAssetsResponse + callback: PaginationCallback< + protos.google.cloud.securitycenter.v1.IListAssetsRequest, + | protos.google.cloud.securitycenter.v1.IListAssetsResponse + | null + | undefined, + protos.google.cloud.securitycenter.v1.ListAssetsResponse.IListAssetsResult + > + ): void; + listAssets( + request: protos.google.cloud.securitycenter.v1.IListAssetsRequest, + callback: PaginationCallback< + protos.google.cloud.securitycenter.v1.IListAssetsRequest, + | protos.google.cloud.securitycenter.v1.IListAssetsResponse + | null + | undefined, + protos.google.cloud.securitycenter.v1.ListAssetsResponse.IListAssetsResult > ): void; /** @@ -2720,24 +3231,28 @@ export class SecurityCenterClient { * The promise has a method named "cancel" which cancels the ongoing API call. */ listAssets( - request: protosTypes.google.cloud.securitycenter.v1.IListAssetsRequest, + request: protos.google.cloud.securitycenter.v1.IListAssetsRequest, optionsOrCallback?: | gax.CallOptions - | Callback< - protosTypes.google.cloud.securitycenter.v1.ListAssetsResponse.IListAssetsResult[], - protosTypes.google.cloud.securitycenter.v1.IListAssetsRequest | null, - protosTypes.google.cloud.securitycenter.v1.IListAssetsResponse + | PaginationCallback< + protos.google.cloud.securitycenter.v1.IListAssetsRequest, + | protos.google.cloud.securitycenter.v1.IListAssetsResponse + | null + | undefined, + protos.google.cloud.securitycenter.v1.ListAssetsResponse.IListAssetsResult >, - callback?: Callback< - protosTypes.google.cloud.securitycenter.v1.ListAssetsResponse.IListAssetsResult[], - protosTypes.google.cloud.securitycenter.v1.IListAssetsRequest | null, - protosTypes.google.cloud.securitycenter.v1.IListAssetsResponse + callback?: PaginationCallback< + protos.google.cloud.securitycenter.v1.IListAssetsRequest, + | protos.google.cloud.securitycenter.v1.IListAssetsResponse + | null + | undefined, + protos.google.cloud.securitycenter.v1.ListAssetsResponse.IListAssetsResult > ): Promise< [ - protosTypes.google.cloud.securitycenter.v1.ListAssetsResponse.IListAssetsResult[], - protosTypes.google.cloud.securitycenter.v1.IListAssetsRequest | null, - protosTypes.google.cloud.securitycenter.v1.IListAssetsResponse + protos.google.cloud.securitycenter.v1.ListAssetsResponse.IListAssetsResult[], + protos.google.cloud.securitycenter.v1.IListAssetsRequest | null, + protos.google.cloud.securitycenter.v1.IListAssetsResponse ] > | void { request = request || {}; @@ -2757,21 +3272,177 @@ export class SecurityCenterClient { parent: request.parent || '', }); this.initialize(); - return this._innerApiCalls.listAssets(request, options, callback); + return this.innerApiCalls.listAssets(request, options, callback); + } + + /** + * Equivalent to {@link listAssets}, but returns a NodeJS Stream object. + * + * This fetches the paged responses for {@link listAssets} continuously + * and invokes the callback registered for 'data' event for each element in the + * responses. + * + * The returned object has 'end' method when no more elements are required. + * + * autoPaginate option will be ignored. + * + * @see {@link https://nodejs.org/api/stream.html} + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Name of the organization assets should belong to. Its format is + * "organizations/[organization_id]". + * @param {string} request.filter + * Expression that defines the filter to apply across assets. + * The expression is a list of zero or more restrictions combined via logical + * operators `AND` and `OR`. + * Parentheses are supported, and `OR` has higher precedence than `AND`. + * + * Restrictions have the form ` ` and may have a `-` + * character in front of them to indicate negation. The fields map to those + * defined in the Asset resource. Examples include: + * + * * name + * * security_center_properties.resource_name + * * resource_properties.a_property + * * security_marks.marks.marka + * + * The supported operators are: + * + * * `=` for all value types. + * * `>`, `<`, `>=`, `<=` for integer values. + * * `:`, meaning substring matching, for strings. + * + * The supported value types are: + * + * * string literals in quotes. + * * integer literals without quotes. + * * boolean literals `true` and `false` without quotes. + * + * The following are the allowed field and operator combinations: + * + * * name: `=` + * * update_time: `=`, `>`, `<`, `>=`, `<=` + * + * Usage: This should be milliseconds since epoch or an RFC3339 string. + * Examples: + * "update_time = \"2019-06-10T16:07:18-07:00\"" + * "update_time = 1560208038000" + * + * * create_time: `=`, `>`, `<`, `>=`, `<=` + * + * Usage: This should be milliseconds since epoch or an RFC3339 string. + * Examples: + * "create_time = \"2019-06-10T16:07:18-07:00\"" + * "create_time = 1560208038000" + * + * * iam_policy.policy_blob: `=`, `:` + * * resource_properties: `=`, `:`, `>`, `<`, `>=`, `<=` + * * security_marks.marks: `=`, `:` + * * security_center_properties.resource_name: `=`, `:` + * * security_center_properties.resource_display_name: `=`, `:` + * * security_center_properties.resource_type: `=`, `:` + * * security_center_properties.resource_parent: `=`, `:` + * * security_center_properties.resource_parent_display_name: `=`, `:` + * * security_center_properties.resource_project: `=`, `:` + * * security_center_properties.resource_project_display_name: `=`, `:` + * * security_center_properties.resource_owners: `=`, `:` + * + * For example, `resource_properties.size = 100` is a valid filter string. + * @param {string} request.orderBy + * Expression that defines what fields and order to use for sorting. The + * string value should follow SQL syntax: comma separated list of fields. For + * example: "name,resource_properties.a_property". The default sorting order + * is ascending. To specify descending order for a field, a suffix " desc" + * should be appended to the field name. For example: "name + * desc,resource_properties.a_property". Redundant space characters in the + * syntax are insignificant. "name desc,resource_properties.a_property" and " + * name desc , resource_properties.a_property " are equivalent. + * + * The following fields are supported: + * name + * update_time + * resource_properties + * security_marks.marks + * security_center_properties.resource_name + * security_center_properties.resource_display_name + * security_center_properties.resource_parent + * security_center_properties.resource_parent_display_name + * security_center_properties.resource_project + * security_center_properties.resource_project_display_name + * security_center_properties.resource_type + * @param {google.protobuf.Timestamp} request.readTime + * Time used as a reference point when filtering assets. The filter is limited + * to assets existing at the supplied time and their values are those at that + * specific time. Absence of this field will default to the API's version of + * NOW. + * @param {google.protobuf.Duration} request.compareDuration + * When compare_duration is set, the ListAssetsResult's "state_change" + * attribute is updated to indicate whether the asset was added, removed, or + * remained present during the compare_duration period of time that precedes + * the read_time. This is the time between (read_time - compare_duration) and + * read_time. + * + * The state_change value is derived based on the presence of the asset at the + * two points in time. Intermediate state changes between the two times don't + * affect the result. For example, the results aren't affected if the asset is + * removed and re-created again. + * + * Possible "state_change" values when compare_duration is specified: + * + * * "ADDED": indicates that the asset was not present at the start of + * compare_duration, but present at read_time. + * * "REMOVED": indicates that the asset was present at the start of + * compare_duration, but not present at read_time. + * * "ACTIVE": indicates that the asset was present at both the + * start and the end of the time period defined by + * compare_duration and read_time. + * + * If compare_duration is not specified, then the only possible state_change + * is "UNUSED", which will be the state_change set for all assets present at + * read_time. + * @param {google.protobuf.FieldMask} [request.fieldMask] + * Optional. A field mask to specify the ListAssetsResult fields to be listed + * in the response. An empty field mask will list all fields. + * @param {string} request.pageToken + * The value returned by the last `ListAssetsResponse`; indicates + * that this is a continuation of a prior `ListAssets` call, and + * that the system should return the next page of data. + * @param {number} request.pageSize + * The maximum number of results to return in a single response. Default is + * 10, minimum is 1, maximum is 1000. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [ListAssetsResult]{@link google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult} on 'data' event. + */ + listAssetsStream( + request?: protos.google.cloud.securitycenter.v1.IListAssetsRequest, + options?: gax.CallOptions + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.listAssets.createStream( + this.innerApiCalls.listAssets as gax.GaxCall, + request, + callSettings + ); } /** - * Equivalent to {@link listAssets}, but returns a NodeJS Stream object. - * - * This fetches the paged responses for {@link listAssets} continuously - * and invokes the callback registered for 'data' event for each element in the - * responses. - * - * The returned object has 'end' method when no more elements are required. - * - * autoPaginate option will be ignored. + * Equivalent to {@link listAssets}, but returns an iterable object. * - * @see {@link https://nodejs.org/api/stream.html} + * for-await-of syntax is used with the iterable to recursively get response element on-demand. * * @param {Object} request * The request object that will be sent. @@ -2899,13 +3570,15 @@ export class SecurityCenterClient { * 10, minimum is 1, maximum is 1000. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing [ListAssetsResult]{@link google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult} on 'data' event. + * @returns {Object} + * An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols. */ - listAssetsStream( - request?: protosTypes.google.cloud.securitycenter.v1.IListAssetsRequest, + listAssetsAsync( + request?: protos.google.cloud.securitycenter.v1.IListAssetsRequest, options?: gax.CallOptions - ): Transform { + ): AsyncIterable< + protos.google.cloud.securitycenter.v1.ListAssetsResponse.IListAssetsResult + > { request = request || {}; options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -2915,31 +3588,46 @@ export class SecurityCenterClient { ] = gax.routingHeader.fromParams({ parent: request.parent || '', }); + options = options || {}; const callSettings = new gax.CallSettings(options); this.initialize(); - return this._descriptors.page.listAssets.createStream( - this._innerApiCalls.listAssets as gax.GaxCall, - request, + return this.descriptors.page.listAssets.asyncIterate( + this.innerApiCalls['listAssets'] as GaxCall, + (request as unknown) as RequestType, callSettings - ); + ) as AsyncIterable< + protos.google.cloud.securitycenter.v1.ListAssetsResponse.IListAssetsResult + >; } listFindings( - request: protosTypes.google.cloud.securitycenter.v1.IListFindingsRequest, + request: protos.google.cloud.securitycenter.v1.IListFindingsRequest, options?: gax.CallOptions ): Promise< [ - protosTypes.google.cloud.securitycenter.v1.ListFindingsResponse.IListFindingsResult[], - protosTypes.google.cloud.securitycenter.v1.IListFindingsRequest | null, - protosTypes.google.cloud.securitycenter.v1.IListFindingsResponse + protos.google.cloud.securitycenter.v1.ListFindingsResponse.IListFindingsResult[], + protos.google.cloud.securitycenter.v1.IListFindingsRequest | null, + protos.google.cloud.securitycenter.v1.IListFindingsResponse ] >; listFindings( - request: protosTypes.google.cloud.securitycenter.v1.IListFindingsRequest, + request: protos.google.cloud.securitycenter.v1.IListFindingsRequest, options: gax.CallOptions, - callback: Callback< - protosTypes.google.cloud.securitycenter.v1.ListFindingsResponse.IListFindingsResult[], - protosTypes.google.cloud.securitycenter.v1.IListFindingsRequest | null, - protosTypes.google.cloud.securitycenter.v1.IListFindingsResponse + callback: PaginationCallback< + protos.google.cloud.securitycenter.v1.IListFindingsRequest, + | protos.google.cloud.securitycenter.v1.IListFindingsResponse + | null + | undefined, + protos.google.cloud.securitycenter.v1.ListFindingsResponse.IListFindingsResult + > + ): void; + listFindings( + request: protos.google.cloud.securitycenter.v1.IListFindingsRequest, + callback: PaginationCallback< + protos.google.cloud.securitycenter.v1.IListFindingsRequest, + | protos.google.cloud.securitycenter.v1.IListFindingsResponse + | null + | undefined, + protos.google.cloud.securitycenter.v1.ListFindingsResponse.IListFindingsResult > ): void; /** @@ -3083,24 +3771,28 @@ export class SecurityCenterClient { * The promise has a method named "cancel" which cancels the ongoing API call. */ listFindings( - request: protosTypes.google.cloud.securitycenter.v1.IListFindingsRequest, + request: protos.google.cloud.securitycenter.v1.IListFindingsRequest, optionsOrCallback?: | gax.CallOptions - | Callback< - protosTypes.google.cloud.securitycenter.v1.ListFindingsResponse.IListFindingsResult[], - protosTypes.google.cloud.securitycenter.v1.IListFindingsRequest | null, - protosTypes.google.cloud.securitycenter.v1.IListFindingsResponse + | PaginationCallback< + protos.google.cloud.securitycenter.v1.IListFindingsRequest, + | protos.google.cloud.securitycenter.v1.IListFindingsResponse + | null + | undefined, + protos.google.cloud.securitycenter.v1.ListFindingsResponse.IListFindingsResult >, - callback?: Callback< - protosTypes.google.cloud.securitycenter.v1.ListFindingsResponse.IListFindingsResult[], - protosTypes.google.cloud.securitycenter.v1.IListFindingsRequest | null, - protosTypes.google.cloud.securitycenter.v1.IListFindingsResponse + callback?: PaginationCallback< + protos.google.cloud.securitycenter.v1.IListFindingsRequest, + | protos.google.cloud.securitycenter.v1.IListFindingsResponse + | null + | undefined, + protos.google.cloud.securitycenter.v1.ListFindingsResponse.IListFindingsResult > ): Promise< [ - protosTypes.google.cloud.securitycenter.v1.ListFindingsResponse.IListFindingsResult[], - protosTypes.google.cloud.securitycenter.v1.IListFindingsRequest | null, - protosTypes.google.cloud.securitycenter.v1.IListFindingsResponse + protos.google.cloud.securitycenter.v1.ListFindingsResponse.IListFindingsResult[], + protos.google.cloud.securitycenter.v1.IListFindingsRequest | null, + protos.google.cloud.securitycenter.v1.IListFindingsResponse ] > | void { request = request || {}; @@ -3120,7 +3812,7 @@ export class SecurityCenterClient { parent: request.parent || '', }); this.initialize(); - return this._innerApiCalls.listFindings(request, options, callback); + return this.innerApiCalls.listFindings(request, options, callback); } /** @@ -3258,7 +3950,7 @@ export class SecurityCenterClient { * An object stream which emits an object representing [ListFindingsResult]{@link google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult} on 'data' event. */ listFindingsStream( - request?: protosTypes.google.cloud.securitycenter.v1.IListFindingsRequest, + request?: protos.google.cloud.securitycenter.v1.IListFindingsRequest, options?: gax.CallOptions ): Transform { request = request || {}; @@ -3272,29 +3964,194 @@ export class SecurityCenterClient { }); const callSettings = new gax.CallSettings(options); this.initialize(); - return this._descriptors.page.listFindings.createStream( - this._innerApiCalls.listFindings as gax.GaxCall, + return this.descriptors.page.listFindings.createStream( + this.innerApiCalls.listFindings as gax.GaxCall, request, callSettings ); } + + /** + * Equivalent to {@link listFindings}, but returns an iterable object. + * + * for-await-of syntax is used with the iterable to recursively get response element on-demand. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Name of the source the findings belong to. Its format is + * "organizations/[organization_id]/sources/[source_id]". To list across all + * sources provide a source_id of `-`. For example: + * organizations/{organization_id}/sources/- + * @param {string} request.filter + * Expression that defines the filter to apply across findings. + * The expression is a list of one or more restrictions combined via logical + * operators `AND` and `OR`. + * Parentheses are supported, and `OR` has higher precedence than `AND`. + * + * Restrictions have the form ` ` and may have a `-` + * character in front of them to indicate negation. Examples include: + * + * * name + * * source_properties.a_property + * * security_marks.marks.marka + * + * The supported operators are: + * + * * `=` for all value types. + * * `>`, `<`, `>=`, `<=` for integer values. + * * `:`, meaning substring matching, for strings. + * + * The supported value types are: + * + * * string literals in quotes. + * * integer literals without quotes. + * * boolean literals `true` and `false` without quotes. + * + * The following field and operator combinations are supported: + * + * name: `=` + * parent: `=`, `:` + * resource_name: `=`, `:` + * state: `=`, `:` + * category: `=`, `:` + * external_uri: `=`, `:` + * event_time: `=`, `>`, `<`, `>=`, `<=` + * + * Usage: This should be milliseconds since epoch or an RFC3339 string. + * Examples: + * "event_time = \"2019-06-10T16:07:18-07:00\"" + * "event_time = 1560208038000" + * + * security_marks.marks: `=`, `:` + * source_properties: `=`, `:`, `>`, `<`, `>=`, `<=` + * + * For example, `source_properties.size = 100` is a valid filter string. + * @param {string} request.orderBy + * Expression that defines what fields and order to use for sorting. The + * string value should follow SQL syntax: comma separated list of fields. For + * example: "name,resource_properties.a_property". The default sorting order + * is ascending. To specify descending order for a field, a suffix " desc" + * should be appended to the field name. For example: "name + * desc,source_properties.a_property". Redundant space characters in the + * syntax are insignificant. "name desc,source_properties.a_property" and " + * name desc , source_properties.a_property " are equivalent. + * + * The following fields are supported: + * name + * parent + * state + * category + * resource_name + * event_time + * source_properties + * security_marks.marks + * @param {google.protobuf.Timestamp} request.readTime + * Time used as a reference point when filtering findings. The filter is + * limited to findings existing at the supplied time and their values are + * those at that specific time. Absence of this field will default to the + * API's version of NOW. + * @param {google.protobuf.Duration} request.compareDuration + * When compare_duration is set, the ListFindingsResult's "state_change" + * attribute is updated to indicate whether the finding had its state changed, + * the finding's state remained unchanged, or if the finding was added in any + * state during the compare_duration period of time that precedes the + * read_time. This is the time between (read_time - compare_duration) and + * read_time. + * + * The state_change value is derived based on the presence and state of the + * finding at the two points in time. Intermediate state changes between the + * two times don't affect the result. For example, the results aren't affected + * if the finding is made inactive and then active again. + * + * Possible "state_change" values when compare_duration is specified: + * + * * "CHANGED": indicates that the finding was present and matched the given + * filter at the start of compare_duration, but changed its + * state at read_time. + * * "UNCHANGED": indicates that the finding was present and matched the given + * filter at the start of compare_duration and did not change + * state at read_time. + * * "ADDED": indicates that the finding did not match the given filter or + * was not present at the start of compare_duration, but was + * present at read_time. + * * "REMOVED": indicates that the finding was present and matched the + * filter at the start of compare_duration, but did not match + * the filter at read_time. + * + * If compare_duration is not specified, then the only possible state_change + * is "UNUSED", which will be the state_change set for all findings present at + * read_time. + * @param {google.protobuf.FieldMask} [request.fieldMask] + * Optional. A field mask to specify the Finding fields to be listed in the + * response. An empty field mask will list all fields. + * @param {string} request.pageToken + * The value returned by the last `ListFindingsResponse`; indicates + * that this is a continuation of a prior `ListFindings` call, and + * that the system should return the next page of data. + * @param {number} request.pageSize + * The maximum number of results to return in a single response. Default is + * 10, minimum is 1, maximum is 1000. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols. + */ + listFindingsAsync( + request?: protos.google.cloud.securitycenter.v1.IListFindingsRequest, + options?: gax.CallOptions + ): AsyncIterable< + protos.google.cloud.securitycenter.v1.ListFindingsResponse.IListFindingsResult + > { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.listFindings.asyncIterate( + this.innerApiCalls['listFindings'] as GaxCall, + (request as unknown) as RequestType, + callSettings + ) as AsyncIterable< + protos.google.cloud.securitycenter.v1.ListFindingsResponse.IListFindingsResult + >; + } listNotificationConfigs( - request: protosTypes.google.cloud.securitycenter.v1.IListNotificationConfigsRequest, + request: protos.google.cloud.securitycenter.v1.IListNotificationConfigsRequest, options?: gax.CallOptions ): Promise< [ - protosTypes.google.cloud.securitycenter.v1.INotificationConfig[], - protosTypes.google.cloud.securitycenter.v1.IListNotificationConfigsRequest | null, - protosTypes.google.cloud.securitycenter.v1.IListNotificationConfigsResponse + protos.google.cloud.securitycenter.v1.INotificationConfig[], + protos.google.cloud.securitycenter.v1.IListNotificationConfigsRequest | null, + protos.google.cloud.securitycenter.v1.IListNotificationConfigsResponse ] >; listNotificationConfigs( - request: protosTypes.google.cloud.securitycenter.v1.IListNotificationConfigsRequest, + request: protos.google.cloud.securitycenter.v1.IListNotificationConfigsRequest, options: gax.CallOptions, - callback: Callback< - protosTypes.google.cloud.securitycenter.v1.INotificationConfig[], - protosTypes.google.cloud.securitycenter.v1.IListNotificationConfigsRequest | null, - protosTypes.google.cloud.securitycenter.v1.IListNotificationConfigsResponse + callback: PaginationCallback< + protos.google.cloud.securitycenter.v1.IListNotificationConfigsRequest, + | protos.google.cloud.securitycenter.v1.IListNotificationConfigsResponse + | null + | undefined, + protos.google.cloud.securitycenter.v1.INotificationConfig + > + ): void; + listNotificationConfigs( + request: protos.google.cloud.securitycenter.v1.IListNotificationConfigsRequest, + callback: PaginationCallback< + protos.google.cloud.securitycenter.v1.IListNotificationConfigsRequest, + | protos.google.cloud.securitycenter.v1.IListNotificationConfigsResponse + | null + | undefined, + protos.google.cloud.securitycenter.v1.INotificationConfig > ): void; /** @@ -3331,24 +4188,28 @@ export class SecurityCenterClient { * The promise has a method named "cancel" which cancels the ongoing API call. */ listNotificationConfigs( - request: protosTypes.google.cloud.securitycenter.v1.IListNotificationConfigsRequest, + request: protos.google.cloud.securitycenter.v1.IListNotificationConfigsRequest, optionsOrCallback?: | gax.CallOptions - | Callback< - protosTypes.google.cloud.securitycenter.v1.INotificationConfig[], - protosTypes.google.cloud.securitycenter.v1.IListNotificationConfigsRequest | null, - protosTypes.google.cloud.securitycenter.v1.IListNotificationConfigsResponse + | PaginationCallback< + protos.google.cloud.securitycenter.v1.IListNotificationConfigsRequest, + | protos.google.cloud.securitycenter.v1.IListNotificationConfigsResponse + | null + | undefined, + protos.google.cloud.securitycenter.v1.INotificationConfig >, - callback?: Callback< - protosTypes.google.cloud.securitycenter.v1.INotificationConfig[], - protosTypes.google.cloud.securitycenter.v1.IListNotificationConfigsRequest | null, - protosTypes.google.cloud.securitycenter.v1.IListNotificationConfigsResponse + callback?: PaginationCallback< + protos.google.cloud.securitycenter.v1.IListNotificationConfigsRequest, + | protos.google.cloud.securitycenter.v1.IListNotificationConfigsResponse + | null + | undefined, + protos.google.cloud.securitycenter.v1.INotificationConfig > ): Promise< [ - protosTypes.google.cloud.securitycenter.v1.INotificationConfig[], - protosTypes.google.cloud.securitycenter.v1.IListNotificationConfigsRequest | null, - protosTypes.google.cloud.securitycenter.v1.IListNotificationConfigsResponse + protos.google.cloud.securitycenter.v1.INotificationConfig[], + protos.google.cloud.securitycenter.v1.IListNotificationConfigsRequest | null, + protos.google.cloud.securitycenter.v1.IListNotificationConfigsResponse ] > | void { request = request || {}; @@ -3368,7 +4229,7 @@ export class SecurityCenterClient { parent: request.parent || '', }); this.initialize(); - return this._innerApiCalls.listNotificationConfigs( + return this.innerApiCalls.listNotificationConfigs( request, options, callback @@ -3406,7 +4267,7 @@ export class SecurityCenterClient { * An object stream which emits an object representing [NotificationConfig]{@link google.cloud.securitycenter.v1.NotificationConfig} on 'data' event. */ listNotificationConfigsStream( - request?: protosTypes.google.cloud.securitycenter.v1.IListNotificationConfigsRequest, + request?: protos.google.cloud.securitycenter.v1.IListNotificationConfigsRequest, options?: gax.CallOptions ): Transform { request = request || {}; @@ -3420,29 +4281,88 @@ export class SecurityCenterClient { }); const callSettings = new gax.CallSettings(options); this.initialize(); - return this._descriptors.page.listNotificationConfigs.createStream( - this._innerApiCalls.listNotificationConfigs as gax.GaxCall, + return this.descriptors.page.listNotificationConfigs.createStream( + this.innerApiCalls.listNotificationConfigs as gax.GaxCall, request, callSettings ); } + + /** + * Equivalent to {@link listNotificationConfigs}, but returns an iterable object. + * + * for-await-of syntax is used with the iterable to recursively get response element on-demand. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Name of the organization to list notification configs. + * Its format is "organizations/[organization_id]". + * @param {string} request.pageToken + * The value returned by the last `ListNotificationConfigsResponse`; indicates + * that this is a continuation of a prior `ListNotificationConfigs` call, and + * that the system should return the next page of data. + * @param {number} request.pageSize + * The maximum number of results to return in a single response. Default is + * 10, minimum is 1, maximum is 1000. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols. + */ + listNotificationConfigsAsync( + request?: protos.google.cloud.securitycenter.v1.IListNotificationConfigsRequest, + options?: gax.CallOptions + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.listNotificationConfigs.asyncIterate( + this.innerApiCalls['listNotificationConfigs'] as GaxCall, + (request as unknown) as RequestType, + callSettings + ) as AsyncIterable< + protos.google.cloud.securitycenter.v1.INotificationConfig + >; + } listSources( - request: protosTypes.google.cloud.securitycenter.v1.IListSourcesRequest, + request: protos.google.cloud.securitycenter.v1.IListSourcesRequest, options?: gax.CallOptions ): Promise< [ - protosTypes.google.cloud.securitycenter.v1.ISource[], - protosTypes.google.cloud.securitycenter.v1.IListSourcesRequest | null, - protosTypes.google.cloud.securitycenter.v1.IListSourcesResponse + protos.google.cloud.securitycenter.v1.ISource[], + protos.google.cloud.securitycenter.v1.IListSourcesRequest | null, + protos.google.cloud.securitycenter.v1.IListSourcesResponse ] >; listSources( - request: protosTypes.google.cloud.securitycenter.v1.IListSourcesRequest, + request: protos.google.cloud.securitycenter.v1.IListSourcesRequest, options: gax.CallOptions, - callback: Callback< - protosTypes.google.cloud.securitycenter.v1.ISource[], - protosTypes.google.cloud.securitycenter.v1.IListSourcesRequest | null, - protosTypes.google.cloud.securitycenter.v1.IListSourcesResponse + callback: PaginationCallback< + protos.google.cloud.securitycenter.v1.IListSourcesRequest, + | protos.google.cloud.securitycenter.v1.IListSourcesResponse + | null + | undefined, + protos.google.cloud.securitycenter.v1.ISource + > + ): void; + listSources( + request: protos.google.cloud.securitycenter.v1.IListSourcesRequest, + callback: PaginationCallback< + protos.google.cloud.securitycenter.v1.IListSourcesRequest, + | protos.google.cloud.securitycenter.v1.IListSourcesResponse + | null + | undefined, + protos.google.cloud.securitycenter.v1.ISource > ): void; /** @@ -3479,24 +4399,28 @@ export class SecurityCenterClient { * The promise has a method named "cancel" which cancels the ongoing API call. */ listSources( - request: protosTypes.google.cloud.securitycenter.v1.IListSourcesRequest, + request: protos.google.cloud.securitycenter.v1.IListSourcesRequest, optionsOrCallback?: | gax.CallOptions - | Callback< - protosTypes.google.cloud.securitycenter.v1.ISource[], - protosTypes.google.cloud.securitycenter.v1.IListSourcesRequest | null, - protosTypes.google.cloud.securitycenter.v1.IListSourcesResponse + | PaginationCallback< + protos.google.cloud.securitycenter.v1.IListSourcesRequest, + | protos.google.cloud.securitycenter.v1.IListSourcesResponse + | null + | undefined, + protos.google.cloud.securitycenter.v1.ISource >, - callback?: Callback< - protosTypes.google.cloud.securitycenter.v1.ISource[], - protosTypes.google.cloud.securitycenter.v1.IListSourcesRequest | null, - protosTypes.google.cloud.securitycenter.v1.IListSourcesResponse + callback?: PaginationCallback< + protos.google.cloud.securitycenter.v1.IListSourcesRequest, + | protos.google.cloud.securitycenter.v1.IListSourcesResponse + | null + | undefined, + protos.google.cloud.securitycenter.v1.ISource > ): Promise< [ - protosTypes.google.cloud.securitycenter.v1.ISource[], - protosTypes.google.cloud.securitycenter.v1.IListSourcesRequest | null, - protosTypes.google.cloud.securitycenter.v1.IListSourcesResponse + protos.google.cloud.securitycenter.v1.ISource[], + protos.google.cloud.securitycenter.v1.IListSourcesRequest | null, + protos.google.cloud.securitycenter.v1.IListSourcesResponse ] > | void { request = request || {}; @@ -3516,7 +4440,7 @@ export class SecurityCenterClient { parent: request.parent || '', }); this.initialize(); - return this._innerApiCalls.listSources(request, options, callback); + return this.innerApiCalls.listSources(request, options, callback); } /** @@ -3550,7 +4474,7 @@ export class SecurityCenterClient { * An object stream which emits an object representing [Source]{@link google.cloud.securitycenter.v1.Source} on 'data' event. */ listSourcesStream( - request?: protosTypes.google.cloud.securitycenter.v1.IListSourcesRequest, + request?: protos.google.cloud.securitycenter.v1.IListSourcesRequest, options?: gax.CallOptions ): Transform { request = request || {}; @@ -3564,12 +4488,57 @@ export class SecurityCenterClient { }); const callSettings = new gax.CallSettings(options); this.initialize(); - return this._descriptors.page.listSources.createStream( - this._innerApiCalls.listSources as gax.GaxCall, + return this.descriptors.page.listSources.createStream( + this.innerApiCalls.listSources as gax.GaxCall, request, callSettings ); } + + /** + * Equivalent to {@link listSources}, but returns an iterable object. + * + * for-await-of syntax is used with the iterable to recursively get response element on-demand. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Resource name of the parent of sources to list. Its format should + * be "organizations/[organization_id]". + * @param {string} request.pageToken + * The value returned by the last `ListSourcesResponse`; indicates + * that this is a continuation of a prior `ListSources` call, and + * that the system should return the next page of data. + * @param {number} request.pageSize + * The maximum number of results to return in a single response. Default is + * 10, minimum is 1, maximum is 1000. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols. + */ + listSourcesAsync( + request?: protos.google.cloud.securitycenter.v1.IListSourcesRequest, + options?: gax.CallOptions + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.listSources.asyncIterate( + this.innerApiCalls['listSources'] as GaxCall, + (request as unknown) as RequestType, + callSettings + ) as AsyncIterable; + } // -------------------- // -- Path templates -- // -------------------- @@ -3582,9 +4551,9 @@ export class SecurityCenterClient { * @returns {string} Resource name string. */ assetPath(organization: string, asset: string) { - return this._pathTemplates.assetPathTemplate.render({ - organization, - asset, + return this.pathTemplates.assetPathTemplate.render({ + organization: organization, + asset: asset, }); } @@ -3596,7 +4565,7 @@ export class SecurityCenterClient { * @returns {string} A string representing the organization. */ matchOrganizationFromAssetName(assetName: string) { - return this._pathTemplates.assetPathTemplate.match(assetName).organization; + return this.pathTemplates.assetPathTemplate.match(assetName).organization; } /** @@ -3607,7 +4576,7 @@ export class SecurityCenterClient { * @returns {string} A string representing the asset. */ matchAssetFromAssetName(assetName: string) { - return this._pathTemplates.assetPathTemplate.match(assetName).asset; + return this.pathTemplates.assetPathTemplate.match(assetName).asset; } /** @@ -3619,10 +4588,10 @@ export class SecurityCenterClient { * @returns {string} Resource name string. */ findingPath(organization: string, source: string, finding: string) { - return this._pathTemplates.findingPathTemplate.render({ - organization, - source, - finding, + return this.pathTemplates.findingPathTemplate.render({ + organization: organization, + source: source, + finding: finding, }); } @@ -3634,7 +4603,7 @@ export class SecurityCenterClient { * @returns {string} A string representing the organization. */ matchOrganizationFromFindingName(findingName: string) { - return this._pathTemplates.findingPathTemplate.match(findingName) + return this.pathTemplates.findingPathTemplate.match(findingName) .organization; } @@ -3646,7 +4615,7 @@ export class SecurityCenterClient { * @returns {string} A string representing the source. */ matchSourceFromFindingName(findingName: string) { - return this._pathTemplates.findingPathTemplate.match(findingName).source; + return this.pathTemplates.findingPathTemplate.match(findingName).source; } /** @@ -3657,7 +4626,7 @@ export class SecurityCenterClient { * @returns {string} A string representing the finding. */ matchFindingFromFindingName(findingName: string) { - return this._pathTemplates.findingPathTemplate.match(findingName).finding; + return this.pathTemplates.findingPathTemplate.match(findingName).finding; } /** @@ -3668,8 +4637,8 @@ export class SecurityCenterClient { * @returns {string} Resource name string. */ notificationConfigPath(organization: string, notificationConfig: string) { - return this._pathTemplates.notificationConfigPathTemplate.render({ - organization, + return this.pathTemplates.notificationConfigPathTemplate.render({ + organization: organization, notification_config: notificationConfig, }); } @@ -3682,7 +4651,7 @@ export class SecurityCenterClient { * @returns {string} A string representing the organization. */ matchOrganizationFromNotificationConfigName(notificationConfigName: string) { - return this._pathTemplates.notificationConfigPathTemplate.match( + return this.pathTemplates.notificationConfigPathTemplate.match( notificationConfigName ).organization; } @@ -3697,7 +4666,7 @@ export class SecurityCenterClient { matchNotificationConfigFromNotificationConfigName( notificationConfigName: string ) { - return this._pathTemplates.notificationConfigPathTemplate.match( + return this.pathTemplates.notificationConfigPathTemplate.match( notificationConfigName ).notification_config; } @@ -3709,8 +4678,8 @@ export class SecurityCenterClient { * @returns {string} Resource name string. */ organizationPath(organization: string) { - return this._pathTemplates.organizationPathTemplate.render({ - organization, + return this.pathTemplates.organizationPathTemplate.render({ + organization: organization, }); } @@ -3722,7 +4691,7 @@ export class SecurityCenterClient { * @returns {string} A string representing the organization. */ matchOrganizationFromOrganizationName(organizationName: string) { - return this._pathTemplates.organizationPathTemplate.match(organizationName) + return this.pathTemplates.organizationPathTemplate.match(organizationName) .organization; } @@ -3734,10 +4703,10 @@ export class SecurityCenterClient { * @returns {string} Resource name string. */ organizationAssetSecurityMarksPath(organization: string, asset: string) { - return this._pathTemplates.organizationAssetSecurityMarksPathTemplate.render( + return this.pathTemplates.organizationAssetSecurityMarksPathTemplate.render( { - organization, - asset, + organization: organization, + asset: asset, } ); } @@ -3752,7 +4721,7 @@ export class SecurityCenterClient { matchOrganizationFromOrganizationAssetSecurityMarksName( organizationAssetSecurityMarksName: string ) { - return this._pathTemplates.organizationAssetSecurityMarksPathTemplate.match( + return this.pathTemplates.organizationAssetSecurityMarksPathTemplate.match( organizationAssetSecurityMarksName ).organization; } @@ -3767,7 +4736,7 @@ export class SecurityCenterClient { matchAssetFromOrganizationAssetSecurityMarksName( organizationAssetSecurityMarksName: string ) { - return this._pathTemplates.organizationAssetSecurityMarksPathTemplate.match( + return this.pathTemplates.organizationAssetSecurityMarksPathTemplate.match( organizationAssetSecurityMarksName ).asset; } @@ -3779,8 +4748,8 @@ export class SecurityCenterClient { * @returns {string} Resource name string. */ organizationSettingsPath(organization: string) { - return this._pathTemplates.organizationSettingsPathTemplate.render({ - organization, + return this.pathTemplates.organizationSettingsPathTemplate.render({ + organization: organization, }); } @@ -3794,7 +4763,7 @@ export class SecurityCenterClient { matchOrganizationFromOrganizationSettingsName( organizationSettingsName: string ) { - return this._pathTemplates.organizationSettingsPathTemplate.match( + return this.pathTemplates.organizationSettingsPathTemplate.match( organizationSettingsName ).organization; } @@ -3812,11 +4781,11 @@ export class SecurityCenterClient { source: string, finding: string ) { - return this._pathTemplates.organizationSourceFindingSecurityMarksPathTemplate.render( + return this.pathTemplates.organizationSourceFindingSecurityMarksPathTemplate.render( { - organization, - source, - finding, + organization: organization, + source: source, + finding: finding, } ); } @@ -3831,7 +4800,7 @@ export class SecurityCenterClient { matchOrganizationFromOrganizationSourceFindingSecurityMarksName( organizationSourceFindingSecurityMarksName: string ) { - return this._pathTemplates.organizationSourceFindingSecurityMarksPathTemplate.match( + return this.pathTemplates.organizationSourceFindingSecurityMarksPathTemplate.match( organizationSourceFindingSecurityMarksName ).organization; } @@ -3846,7 +4815,7 @@ export class SecurityCenterClient { matchSourceFromOrganizationSourceFindingSecurityMarksName( organizationSourceFindingSecurityMarksName: string ) { - return this._pathTemplates.organizationSourceFindingSecurityMarksPathTemplate.match( + return this.pathTemplates.organizationSourceFindingSecurityMarksPathTemplate.match( organizationSourceFindingSecurityMarksName ).source; } @@ -3861,7 +4830,7 @@ export class SecurityCenterClient { matchFindingFromOrganizationSourceFindingSecurityMarksName( organizationSourceFindingSecurityMarksName: string ) { - return this._pathTemplates.organizationSourceFindingSecurityMarksPathTemplate.match( + return this.pathTemplates.organizationSourceFindingSecurityMarksPathTemplate.match( organizationSourceFindingSecurityMarksName ).finding; } @@ -3874,9 +4843,9 @@ export class SecurityCenterClient { * @returns {string} Resource name string. */ sourcePath(organization: string, source: string) { - return this._pathTemplates.sourcePathTemplate.render({ - organization, - source, + return this.pathTemplates.sourcePathTemplate.render({ + organization: organization, + source: source, }); } @@ -3888,8 +4857,7 @@ export class SecurityCenterClient { * @returns {string} A string representing the organization. */ matchOrganizationFromSourceName(sourceName: string) { - return this._pathTemplates.sourcePathTemplate.match(sourceName) - .organization; + return this.pathTemplates.sourcePathTemplate.match(sourceName).organization; } /** @@ -3900,7 +4868,7 @@ export class SecurityCenterClient { * @returns {string} A string representing the source. */ matchSourceFromSourceName(sourceName: string) { - return this._pathTemplates.sourcePathTemplate.match(sourceName).source; + return this.pathTemplates.sourcePathTemplate.match(sourceName).source; } /** diff --git a/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.ts b/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.ts index ca5c7b7d5e7..b2723b90e83 100644 --- a/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.ts +++ b/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.ts @@ -18,19 +18,19 @@ import * as gax from 'google-gax'; import { - APICallback, Callback, CallOptions, Descriptors, ClientOptions, LROperation, PaginationCallback, - PaginationResponse, + GaxCall, } from 'google-gax'; import * as path from 'path'; import {Transform} from 'stream'; -import * as protosTypes from '../../protos/protos'; +import {RequestType} from 'google-gax/build/src/apitypes'; +import * as protos from '../../protos/protos'; import * as gapicConfig from './security_center_client_config.json'; const version = require('../../../package.json').version; @@ -41,14 +41,6 @@ const version = require('../../../package.json').version; * @memberof v1beta1 */ export class SecurityCenterClient { - private _descriptors: Descriptors = { - page: {}, - stream: {}, - longrunning: {}, - batching: {}, - }; - private _innerApiCalls: {[name: string]: Function}; - private _pathTemplates: {[name: string]: gax.PathTemplate}; private _terminated = false; private _opts: ClientOptions; private _gaxModule: typeof gax | typeof gax.fallback; @@ -56,6 +48,14 @@ export class SecurityCenterClient { private _protos: {}; private _defaults: {[method: string]: gax.CallSettings}; auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + innerApiCalls: {[name: string]: Function}; + pathTemplates: {[name: string]: gax.PathTemplate}; operationsClient: gax.OperationsClient; securityCenterStub?: Promise<{[name: string]: Function}>; @@ -148,13 +148,16 @@ export class SecurityCenterClient { 'protos.json' ); this._protos = this._gaxGrpc.loadProto( - opts.fallback ? require('../../protos/protos.json') : nodejsProtoPath + opts.fallback + ? // eslint-disable-next-line @typescript-eslint/no-var-requires + require('../../protos/protos.json') + : nodejsProtoPath ); // This API contains "path templates"; forward-slash-separated // identifiers to uniquely identify resources within the API. // Create useful helper objects for these. - this._pathTemplates = { + this.pathTemplates = { findingPathTemplate: new this._gaxModule.PathTemplate( 'organizations/{organization}/sources/{source}/findings/{finding}' ), @@ -178,7 +181,7 @@ export class SecurityCenterClient { // Some of the methods on this service return "paged" results, // (e.g. 50 results at a time, with tokens to get subsequent // pages). Denote the keys used for pagination and results. - this._descriptors.page = { + this.descriptors.page = { groupAssets: new this._gaxModule.PageDescriptor( 'pageToken', 'nextPageToken', @@ -211,6 +214,7 @@ export class SecurityCenterClient { // rather than holding a request open. const protoFilesRoot = opts.fallback ? this._gaxModule.protobuf.Root.fromJSON( + // eslint-disable-next-line @typescript-eslint/no-var-requires require('../../protos/protos.json') ) : this._gaxModule.protobuf.loadSync(nodejsProtoPath); @@ -228,7 +232,7 @@ export class SecurityCenterClient { '.google.protobuf.Empty' ) as gax.protobuf.Type; - this._descriptors.longrunning = { + this.descriptors.longrunning = { runAssetDiscovery: new this._gaxModule.LongrunningDescriptor( this.operationsClient, runAssetDiscoveryResponse.decode.bind(runAssetDiscoveryResponse), @@ -247,7 +251,7 @@ export class SecurityCenterClient { // 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 = {}; + this.innerApiCalls = {}; } /** @@ -274,7 +278,7 @@ export class SecurityCenterClient { ? (this._protos as protobuf.Root).lookupService( 'google.cloud.securitycenter.v1beta1.SecurityCenter' ) - : // tslint:disable-next-line no-any + : // eslint-disable-next-line @typescript-eslint/no-explicit-any (this._protos as any).google.cloud.securitycenter.v1beta1 .SecurityCenter, this._opts @@ -302,9 +306,8 @@ export class SecurityCenterClient { 'updateSource', 'updateSecurityMarks', ]; - for (const methodName of securityCenterStubMethods) { - const innerCallPromise = this.securityCenterStub.then( + const callPromise = this.securityCenterStub.then( stub => (...args: Array<{}>) => { if (this._terminated) { return Promise.reject('The client has already been closed.'); @@ -318,20 +321,14 @@ export class SecurityCenterClient { ); const apiCall = this._gaxModule.createApiCall( - innerCallPromise, + callPromise, this._defaults[methodName], - this._descriptors.page[methodName] || - this._descriptors.stream[methodName] || - this._descriptors.longrunning[methodName] + this.descriptors.page[methodName] || + this.descriptors.stream[methodName] || + this.descriptors.longrunning[methodName] ); - this._innerApiCalls[methodName] = ( - argument: {}, - callOptions?: CallOptions, - callback?: APICallback - ) => { - return apiCall(argument, callOptions, callback); - }; + this.innerApiCalls[methodName] = apiCall; } return this.securityCenterStub; @@ -388,26 +385,37 @@ export class SecurityCenterClient { // -- Service calls -- // ------------------- createSource( - request: protosTypes.google.cloud.securitycenter.v1beta1.ICreateSourceRequest, + request: protos.google.cloud.securitycenter.v1beta1.ICreateSourceRequest, options?: gax.CallOptions ): Promise< [ - protosTypes.google.cloud.securitycenter.v1beta1.ISource, + protos.google.cloud.securitycenter.v1beta1.ISource, ( - | protosTypes.google.cloud.securitycenter.v1beta1.ICreateSourceRequest + | protos.google.cloud.securitycenter.v1beta1.ICreateSourceRequest | undefined ), {} | undefined ] >; createSource( - request: protosTypes.google.cloud.securitycenter.v1beta1.ICreateSourceRequest, + request: protos.google.cloud.securitycenter.v1beta1.ICreateSourceRequest, options: gax.CallOptions, callback: Callback< - protosTypes.google.cloud.securitycenter.v1beta1.ISource, - | protosTypes.google.cloud.securitycenter.v1beta1.ICreateSourceRequest + protos.google.cloud.securitycenter.v1beta1.ISource, + | protos.google.cloud.securitycenter.v1beta1.ICreateSourceRequest + | null | undefined, - {} | undefined + {} | null | undefined + > + ): void; + createSource( + request: protos.google.cloud.securitycenter.v1beta1.ICreateSourceRequest, + callback: Callback< + protos.google.cloud.securitycenter.v1beta1.ISource, + | protos.google.cloud.securitycenter.v1beta1.ICreateSourceRequest + | null + | undefined, + {} | null | undefined > ): void; /** @@ -428,26 +436,28 @@ export class SecurityCenterClient { * The promise has a method named "cancel" which cancels the ongoing API call. */ createSource( - request: protosTypes.google.cloud.securitycenter.v1beta1.ICreateSourceRequest, + request: protos.google.cloud.securitycenter.v1beta1.ICreateSourceRequest, optionsOrCallback?: | gax.CallOptions | Callback< - protosTypes.google.cloud.securitycenter.v1beta1.ISource, - | protosTypes.google.cloud.securitycenter.v1beta1.ICreateSourceRequest + protos.google.cloud.securitycenter.v1beta1.ISource, + | protos.google.cloud.securitycenter.v1beta1.ICreateSourceRequest + | null | undefined, - {} | undefined + {} | null | undefined >, callback?: Callback< - protosTypes.google.cloud.securitycenter.v1beta1.ISource, - | protosTypes.google.cloud.securitycenter.v1beta1.ICreateSourceRequest + protos.google.cloud.securitycenter.v1beta1.ISource, + | protos.google.cloud.securitycenter.v1beta1.ICreateSourceRequest + | null | undefined, - {} | undefined + {} | null | undefined > ): Promise< [ - protosTypes.google.cloud.securitycenter.v1beta1.ISource, + protos.google.cloud.securitycenter.v1beta1.ISource, ( - | protosTypes.google.cloud.securitycenter.v1beta1.ICreateSourceRequest + | protos.google.cloud.securitycenter.v1beta1.ICreateSourceRequest | undefined ), {} | undefined @@ -470,29 +480,40 @@ export class SecurityCenterClient { parent: request.parent || '', }); this.initialize(); - return this._innerApiCalls.createSource(request, options, callback); + return this.innerApiCalls.createSource(request, options, callback); } createFinding( - request: protosTypes.google.cloud.securitycenter.v1beta1.ICreateFindingRequest, + request: protos.google.cloud.securitycenter.v1beta1.ICreateFindingRequest, options?: gax.CallOptions ): Promise< [ - protosTypes.google.cloud.securitycenter.v1beta1.IFinding, + protos.google.cloud.securitycenter.v1beta1.IFinding, ( - | protosTypes.google.cloud.securitycenter.v1beta1.ICreateFindingRequest + | protos.google.cloud.securitycenter.v1beta1.ICreateFindingRequest | undefined ), {} | undefined ] >; createFinding( - request: protosTypes.google.cloud.securitycenter.v1beta1.ICreateFindingRequest, + request: protos.google.cloud.securitycenter.v1beta1.ICreateFindingRequest, options: gax.CallOptions, callback: Callback< - protosTypes.google.cloud.securitycenter.v1beta1.IFinding, - | protosTypes.google.cloud.securitycenter.v1beta1.ICreateFindingRequest + protos.google.cloud.securitycenter.v1beta1.IFinding, + | protos.google.cloud.securitycenter.v1beta1.ICreateFindingRequest + | null | undefined, - {} | undefined + {} | null | undefined + > + ): void; + createFinding( + request: protos.google.cloud.securitycenter.v1beta1.ICreateFindingRequest, + callback: Callback< + protos.google.cloud.securitycenter.v1beta1.IFinding, + | protos.google.cloud.securitycenter.v1beta1.ICreateFindingRequest + | null + | undefined, + {} | null | undefined > ): void; /** @@ -518,26 +539,28 @@ export class SecurityCenterClient { * The promise has a method named "cancel" which cancels the ongoing API call. */ createFinding( - request: protosTypes.google.cloud.securitycenter.v1beta1.ICreateFindingRequest, + request: protos.google.cloud.securitycenter.v1beta1.ICreateFindingRequest, optionsOrCallback?: | gax.CallOptions | Callback< - protosTypes.google.cloud.securitycenter.v1beta1.IFinding, - | protosTypes.google.cloud.securitycenter.v1beta1.ICreateFindingRequest + protos.google.cloud.securitycenter.v1beta1.IFinding, + | protos.google.cloud.securitycenter.v1beta1.ICreateFindingRequest + | null | undefined, - {} | undefined + {} | null | undefined >, callback?: Callback< - protosTypes.google.cloud.securitycenter.v1beta1.IFinding, - | protosTypes.google.cloud.securitycenter.v1beta1.ICreateFindingRequest + protos.google.cloud.securitycenter.v1beta1.IFinding, + | protos.google.cloud.securitycenter.v1beta1.ICreateFindingRequest + | null | undefined, - {} | undefined + {} | null | undefined > ): Promise< [ - protosTypes.google.cloud.securitycenter.v1beta1.IFinding, + protos.google.cloud.securitycenter.v1beta1.IFinding, ( - | protosTypes.google.cloud.securitycenter.v1beta1.ICreateFindingRequest + | protos.google.cloud.securitycenter.v1beta1.ICreateFindingRequest | undefined ), {} | undefined @@ -560,25 +583,33 @@ export class SecurityCenterClient { parent: request.parent || '', }); this.initialize(); - return this._innerApiCalls.createFinding(request, options, callback); + return this.innerApiCalls.createFinding(request, options, callback); } getIamPolicy( - request: protosTypes.google.iam.v1.IGetIamPolicyRequest, + request: protos.google.iam.v1.IGetIamPolicyRequest, options?: gax.CallOptions ): Promise< [ - protosTypes.google.iam.v1.IPolicy, - protosTypes.google.iam.v1.IGetIamPolicyRequest | undefined, + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest | undefined, {} | undefined ] >; getIamPolicy( - request: protosTypes.google.iam.v1.IGetIamPolicyRequest, + request: protos.google.iam.v1.IGetIamPolicyRequest, options: gax.CallOptions, callback: Callback< - protosTypes.google.iam.v1.IPolicy, - protosTypes.google.iam.v1.IGetIamPolicyRequest | undefined, - {} | undefined + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ): void; + getIamPolicy( + request: protos.google.iam.v1.IGetIamPolicyRequest, + callback: Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest | null | undefined, + {} | null | undefined > ): void; /** @@ -593,23 +624,23 @@ export class SecurityCenterClient { * The promise has a method named "cancel" which cancels the ongoing API call. */ getIamPolicy( - request: protosTypes.google.iam.v1.IGetIamPolicyRequest, + request: protos.google.iam.v1.IGetIamPolicyRequest, optionsOrCallback?: | gax.CallOptions | Callback< - protosTypes.google.iam.v1.IPolicy, - protosTypes.google.iam.v1.IGetIamPolicyRequest | undefined, - {} | undefined + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest | null | undefined, + {} | null | undefined >, callback?: Callback< - protosTypes.google.iam.v1.IPolicy, - protosTypes.google.iam.v1.IGetIamPolicyRequest | undefined, - {} | undefined + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest | null | undefined, + {} | null | undefined > ): Promise< [ - protosTypes.google.iam.v1.IPolicy, - protosTypes.google.iam.v1.IGetIamPolicyRequest | undefined, + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest | undefined, {} | undefined ] > | void { @@ -630,29 +661,40 @@ export class SecurityCenterClient { resource: request.resource || '', }); this.initialize(); - return this._innerApiCalls.getIamPolicy(request, options, callback); + return this.innerApiCalls.getIamPolicy(request, options, callback); } getOrganizationSettings( - request: protosTypes.google.cloud.securitycenter.v1beta1.IGetOrganizationSettingsRequest, + request: protos.google.cloud.securitycenter.v1beta1.IGetOrganizationSettingsRequest, options?: gax.CallOptions ): Promise< [ - protosTypes.google.cloud.securitycenter.v1beta1.IOrganizationSettings, + protos.google.cloud.securitycenter.v1beta1.IOrganizationSettings, ( - | protosTypes.google.cloud.securitycenter.v1beta1.IGetOrganizationSettingsRequest + | protos.google.cloud.securitycenter.v1beta1.IGetOrganizationSettingsRequest | undefined ), {} | undefined ] >; getOrganizationSettings( - request: protosTypes.google.cloud.securitycenter.v1beta1.IGetOrganizationSettingsRequest, + request: protos.google.cloud.securitycenter.v1beta1.IGetOrganizationSettingsRequest, options: gax.CallOptions, callback: Callback< - protosTypes.google.cloud.securitycenter.v1beta1.IOrganizationSettings, - | protosTypes.google.cloud.securitycenter.v1beta1.IGetOrganizationSettingsRequest + protos.google.cloud.securitycenter.v1beta1.IOrganizationSettings, + | protos.google.cloud.securitycenter.v1beta1.IGetOrganizationSettingsRequest + | null | undefined, - {} | undefined + {} | null | undefined + > + ): void; + getOrganizationSettings( + request: protos.google.cloud.securitycenter.v1beta1.IGetOrganizationSettingsRequest, + callback: Callback< + protos.google.cloud.securitycenter.v1beta1.IOrganizationSettings, + | protos.google.cloud.securitycenter.v1beta1.IGetOrganizationSettingsRequest + | null + | undefined, + {} | null | undefined > ): void; /** @@ -670,26 +712,28 @@ export class SecurityCenterClient { * The promise has a method named "cancel" which cancels the ongoing API call. */ getOrganizationSettings( - request: protosTypes.google.cloud.securitycenter.v1beta1.IGetOrganizationSettingsRequest, + request: protos.google.cloud.securitycenter.v1beta1.IGetOrganizationSettingsRequest, optionsOrCallback?: | gax.CallOptions | Callback< - protosTypes.google.cloud.securitycenter.v1beta1.IOrganizationSettings, - | protosTypes.google.cloud.securitycenter.v1beta1.IGetOrganizationSettingsRequest + protos.google.cloud.securitycenter.v1beta1.IOrganizationSettings, + | protos.google.cloud.securitycenter.v1beta1.IGetOrganizationSettingsRequest + | null | undefined, - {} | undefined + {} | null | undefined >, callback?: Callback< - protosTypes.google.cloud.securitycenter.v1beta1.IOrganizationSettings, - | protosTypes.google.cloud.securitycenter.v1beta1.IGetOrganizationSettingsRequest + protos.google.cloud.securitycenter.v1beta1.IOrganizationSettings, + | protos.google.cloud.securitycenter.v1beta1.IGetOrganizationSettingsRequest + | null | undefined, - {} | undefined + {} | null | undefined > ): Promise< [ - protosTypes.google.cloud.securitycenter.v1beta1.IOrganizationSettings, + protos.google.cloud.securitycenter.v1beta1.IOrganizationSettings, ( - | protosTypes.google.cloud.securitycenter.v1beta1.IGetOrganizationSettingsRequest + | protos.google.cloud.securitycenter.v1beta1.IGetOrganizationSettingsRequest | undefined ), {} | undefined @@ -712,33 +756,41 @@ export class SecurityCenterClient { name: request.name || '', }); this.initialize(); - return this._innerApiCalls.getOrganizationSettings( + return this.innerApiCalls.getOrganizationSettings( request, options, callback ); } getSource( - request: protosTypes.google.cloud.securitycenter.v1beta1.IGetSourceRequest, + request: protos.google.cloud.securitycenter.v1beta1.IGetSourceRequest, options?: gax.CallOptions ): Promise< [ - protosTypes.google.cloud.securitycenter.v1beta1.ISource, - ( - | protosTypes.google.cloud.securitycenter.v1beta1.IGetSourceRequest - | undefined - ), + protos.google.cloud.securitycenter.v1beta1.ISource, + protos.google.cloud.securitycenter.v1beta1.IGetSourceRequest | undefined, {} | undefined ] >; getSource( - request: protosTypes.google.cloud.securitycenter.v1beta1.IGetSourceRequest, + request: protos.google.cloud.securitycenter.v1beta1.IGetSourceRequest, options: gax.CallOptions, callback: Callback< - protosTypes.google.cloud.securitycenter.v1beta1.ISource, - | protosTypes.google.cloud.securitycenter.v1beta1.IGetSourceRequest + protos.google.cloud.securitycenter.v1beta1.ISource, + | protos.google.cloud.securitycenter.v1beta1.IGetSourceRequest + | null | undefined, - {} | undefined + {} | null | undefined + > + ): void; + getSource( + request: protos.google.cloud.securitycenter.v1beta1.IGetSourceRequest, + callback: Callback< + protos.google.cloud.securitycenter.v1beta1.ISource, + | protos.google.cloud.securitycenter.v1beta1.IGetSourceRequest + | null + | undefined, + {} | null | undefined > ): void; /** @@ -756,28 +808,27 @@ export class SecurityCenterClient { * The promise has a method named "cancel" which cancels the ongoing API call. */ getSource( - request: protosTypes.google.cloud.securitycenter.v1beta1.IGetSourceRequest, + request: protos.google.cloud.securitycenter.v1beta1.IGetSourceRequest, optionsOrCallback?: | gax.CallOptions | Callback< - protosTypes.google.cloud.securitycenter.v1beta1.ISource, - | protosTypes.google.cloud.securitycenter.v1beta1.IGetSourceRequest + protos.google.cloud.securitycenter.v1beta1.ISource, + | protos.google.cloud.securitycenter.v1beta1.IGetSourceRequest + | null | undefined, - {} | undefined + {} | null | undefined >, callback?: Callback< - protosTypes.google.cloud.securitycenter.v1beta1.ISource, - | protosTypes.google.cloud.securitycenter.v1beta1.IGetSourceRequest + protos.google.cloud.securitycenter.v1beta1.ISource, + | protos.google.cloud.securitycenter.v1beta1.IGetSourceRequest + | null | undefined, - {} | undefined + {} | null | undefined > ): Promise< [ - protosTypes.google.cloud.securitycenter.v1beta1.ISource, - ( - | protosTypes.google.cloud.securitycenter.v1beta1.IGetSourceRequest - | undefined - ), + protos.google.cloud.securitycenter.v1beta1.ISource, + protos.google.cloud.securitycenter.v1beta1.IGetSourceRequest | undefined, {} | undefined ] > | void { @@ -798,29 +849,40 @@ export class SecurityCenterClient { name: request.name || '', }); this.initialize(); - return this._innerApiCalls.getSource(request, options, callback); + return this.innerApiCalls.getSource(request, options, callback); } setFindingState( - request: protosTypes.google.cloud.securitycenter.v1beta1.ISetFindingStateRequest, + request: protos.google.cloud.securitycenter.v1beta1.ISetFindingStateRequest, options?: gax.CallOptions ): Promise< [ - protosTypes.google.cloud.securitycenter.v1beta1.IFinding, + protos.google.cloud.securitycenter.v1beta1.IFinding, ( - | protosTypes.google.cloud.securitycenter.v1beta1.ISetFindingStateRequest + | protos.google.cloud.securitycenter.v1beta1.ISetFindingStateRequest | undefined ), {} | undefined ] >; setFindingState( - request: protosTypes.google.cloud.securitycenter.v1beta1.ISetFindingStateRequest, + request: protos.google.cloud.securitycenter.v1beta1.ISetFindingStateRequest, options: gax.CallOptions, callback: Callback< - protosTypes.google.cloud.securitycenter.v1beta1.IFinding, - | protosTypes.google.cloud.securitycenter.v1beta1.ISetFindingStateRequest + protos.google.cloud.securitycenter.v1beta1.IFinding, + | protos.google.cloud.securitycenter.v1beta1.ISetFindingStateRequest + | null | undefined, - {} | undefined + {} | null | undefined + > + ): void; + setFindingState( + request: protos.google.cloud.securitycenter.v1beta1.ISetFindingStateRequest, + callback: Callback< + protos.google.cloud.securitycenter.v1beta1.IFinding, + | protos.google.cloud.securitycenter.v1beta1.ISetFindingStateRequest + | null + | undefined, + {} | null | undefined > ): void; /** @@ -844,26 +906,28 @@ export class SecurityCenterClient { * The promise has a method named "cancel" which cancels the ongoing API call. */ setFindingState( - request: protosTypes.google.cloud.securitycenter.v1beta1.ISetFindingStateRequest, + request: protos.google.cloud.securitycenter.v1beta1.ISetFindingStateRequest, optionsOrCallback?: | gax.CallOptions | Callback< - protosTypes.google.cloud.securitycenter.v1beta1.IFinding, - | protosTypes.google.cloud.securitycenter.v1beta1.ISetFindingStateRequest + protos.google.cloud.securitycenter.v1beta1.IFinding, + | protos.google.cloud.securitycenter.v1beta1.ISetFindingStateRequest + | null | undefined, - {} | undefined + {} | null | undefined >, callback?: Callback< - protosTypes.google.cloud.securitycenter.v1beta1.IFinding, - | protosTypes.google.cloud.securitycenter.v1beta1.ISetFindingStateRequest + protos.google.cloud.securitycenter.v1beta1.IFinding, + | protos.google.cloud.securitycenter.v1beta1.ISetFindingStateRequest + | null | undefined, - {} | undefined + {} | null | undefined > ): Promise< [ - protosTypes.google.cloud.securitycenter.v1beta1.IFinding, + protos.google.cloud.securitycenter.v1beta1.IFinding, ( - | protosTypes.google.cloud.securitycenter.v1beta1.ISetFindingStateRequest + | protos.google.cloud.securitycenter.v1beta1.ISetFindingStateRequest | undefined ), {} | undefined @@ -886,25 +950,33 @@ export class SecurityCenterClient { name: request.name || '', }); this.initialize(); - return this._innerApiCalls.setFindingState(request, options, callback); + return this.innerApiCalls.setFindingState(request, options, callback); } setIamPolicy( - request: protosTypes.google.iam.v1.ISetIamPolicyRequest, + request: protos.google.iam.v1.ISetIamPolicyRequest, options?: gax.CallOptions ): Promise< [ - protosTypes.google.iam.v1.IPolicy, - protosTypes.google.iam.v1.ISetIamPolicyRequest | undefined, + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest | undefined, {} | undefined ] >; setIamPolicy( - request: protosTypes.google.iam.v1.ISetIamPolicyRequest, + request: protos.google.iam.v1.ISetIamPolicyRequest, options: gax.CallOptions, callback: Callback< - protosTypes.google.iam.v1.IPolicy, - protosTypes.google.iam.v1.ISetIamPolicyRequest | undefined, - {} | undefined + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ): void; + setIamPolicy( + request: protos.google.iam.v1.ISetIamPolicyRequest, + callback: Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest | null | undefined, + {} | null | undefined > ): void; /** @@ -919,23 +991,23 @@ export class SecurityCenterClient { * The promise has a method named "cancel" which cancels the ongoing API call. */ setIamPolicy( - request: protosTypes.google.iam.v1.ISetIamPolicyRequest, + request: protos.google.iam.v1.ISetIamPolicyRequest, optionsOrCallback?: | gax.CallOptions | Callback< - protosTypes.google.iam.v1.IPolicy, - protosTypes.google.iam.v1.ISetIamPolicyRequest | undefined, - {} | undefined + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest | null | undefined, + {} | null | undefined >, callback?: Callback< - protosTypes.google.iam.v1.IPolicy, - protosTypes.google.iam.v1.ISetIamPolicyRequest | undefined, - {} | undefined + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest | null | undefined, + {} | null | undefined > ): Promise< [ - protosTypes.google.iam.v1.IPolicy, - protosTypes.google.iam.v1.ISetIamPolicyRequest | undefined, + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest | undefined, {} | undefined ] > | void { @@ -956,25 +1028,33 @@ export class SecurityCenterClient { resource: request.resource || '', }); this.initialize(); - return this._innerApiCalls.setIamPolicy(request, options, callback); + return this.innerApiCalls.setIamPolicy(request, options, callback); } testIamPermissions( - request: protosTypes.google.iam.v1.ITestIamPermissionsRequest, + request: protos.google.iam.v1.ITestIamPermissionsRequest, options?: gax.CallOptions ): Promise< [ - protosTypes.google.iam.v1.ITestIamPermissionsResponse, - protosTypes.google.iam.v1.ITestIamPermissionsRequest | undefined, + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest | undefined, {} | undefined ] >; testIamPermissions( - request: protosTypes.google.iam.v1.ITestIamPermissionsRequest, + request: protos.google.iam.v1.ITestIamPermissionsRequest, options: gax.CallOptions, callback: Callback< - protosTypes.google.iam.v1.ITestIamPermissionsResponse, - protosTypes.google.iam.v1.ITestIamPermissionsRequest | undefined, - {} | undefined + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest | null | undefined, + {} | null | undefined + > + ): void; + testIamPermissions( + request: protos.google.iam.v1.ITestIamPermissionsRequest, + callback: Callback< + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest | null | undefined, + {} | null | undefined > ): void; /** @@ -989,23 +1069,23 @@ export class SecurityCenterClient { * The promise has a method named "cancel" which cancels the ongoing API call. */ testIamPermissions( - request: protosTypes.google.iam.v1.ITestIamPermissionsRequest, + request: protos.google.iam.v1.ITestIamPermissionsRequest, optionsOrCallback?: | gax.CallOptions | Callback< - protosTypes.google.iam.v1.ITestIamPermissionsResponse, - protosTypes.google.iam.v1.ITestIamPermissionsRequest | undefined, - {} | undefined + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest | null | undefined, + {} | null | undefined >, callback?: Callback< - protosTypes.google.iam.v1.ITestIamPermissionsResponse, - protosTypes.google.iam.v1.ITestIamPermissionsRequest | undefined, - {} | undefined + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest | null | undefined, + {} | null | undefined > ): Promise< [ - protosTypes.google.iam.v1.ITestIamPermissionsResponse, - protosTypes.google.iam.v1.ITestIamPermissionsRequest | undefined, + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest | undefined, {} | undefined ] > | void { @@ -1026,29 +1106,40 @@ export class SecurityCenterClient { resource: request.resource || '', }); this.initialize(); - return this._innerApiCalls.testIamPermissions(request, options, callback); + return this.innerApiCalls.testIamPermissions(request, options, callback); } updateFinding( - request: protosTypes.google.cloud.securitycenter.v1beta1.IUpdateFindingRequest, + request: protos.google.cloud.securitycenter.v1beta1.IUpdateFindingRequest, options?: gax.CallOptions ): Promise< [ - protosTypes.google.cloud.securitycenter.v1beta1.IFinding, + protos.google.cloud.securitycenter.v1beta1.IFinding, ( - | protosTypes.google.cloud.securitycenter.v1beta1.IUpdateFindingRequest + | protos.google.cloud.securitycenter.v1beta1.IUpdateFindingRequest | undefined ), {} | undefined ] >; updateFinding( - request: protosTypes.google.cloud.securitycenter.v1beta1.IUpdateFindingRequest, + request: protos.google.cloud.securitycenter.v1beta1.IUpdateFindingRequest, options: gax.CallOptions, callback: Callback< - protosTypes.google.cloud.securitycenter.v1beta1.IFinding, - | protosTypes.google.cloud.securitycenter.v1beta1.IUpdateFindingRequest + protos.google.cloud.securitycenter.v1beta1.IFinding, + | protos.google.cloud.securitycenter.v1beta1.IUpdateFindingRequest + | null | undefined, - {} | undefined + {} | null | undefined + > + ): void; + updateFinding( + request: protos.google.cloud.securitycenter.v1beta1.IUpdateFindingRequest, + callback: Callback< + protos.google.cloud.securitycenter.v1beta1.IFinding, + | protos.google.cloud.securitycenter.v1beta1.IUpdateFindingRequest + | null + | undefined, + {} | null | undefined > ): void; /** @@ -1074,26 +1165,28 @@ export class SecurityCenterClient { * The promise has a method named "cancel" which cancels the ongoing API call. */ updateFinding( - request: protosTypes.google.cloud.securitycenter.v1beta1.IUpdateFindingRequest, + request: protos.google.cloud.securitycenter.v1beta1.IUpdateFindingRequest, optionsOrCallback?: | gax.CallOptions | Callback< - protosTypes.google.cloud.securitycenter.v1beta1.IFinding, - | protosTypes.google.cloud.securitycenter.v1beta1.IUpdateFindingRequest + protos.google.cloud.securitycenter.v1beta1.IFinding, + | protos.google.cloud.securitycenter.v1beta1.IUpdateFindingRequest + | null | undefined, - {} | undefined + {} | null | undefined >, callback?: Callback< - protosTypes.google.cloud.securitycenter.v1beta1.IFinding, - | protosTypes.google.cloud.securitycenter.v1beta1.IUpdateFindingRequest + protos.google.cloud.securitycenter.v1beta1.IFinding, + | protos.google.cloud.securitycenter.v1beta1.IUpdateFindingRequest + | null | undefined, - {} | undefined + {} | null | undefined > ): Promise< [ - protosTypes.google.cloud.securitycenter.v1beta1.IFinding, + protos.google.cloud.securitycenter.v1beta1.IFinding, ( - | protosTypes.google.cloud.securitycenter.v1beta1.IUpdateFindingRequest + | protos.google.cloud.securitycenter.v1beta1.IUpdateFindingRequest | undefined ), {} | undefined @@ -1116,29 +1209,40 @@ export class SecurityCenterClient { 'finding.name': request.finding!.name || '', }); this.initialize(); - return this._innerApiCalls.updateFinding(request, options, callback); + return this.innerApiCalls.updateFinding(request, options, callback); } updateOrganizationSettings( - request: protosTypes.google.cloud.securitycenter.v1beta1.IUpdateOrganizationSettingsRequest, + request: protos.google.cloud.securitycenter.v1beta1.IUpdateOrganizationSettingsRequest, options?: gax.CallOptions ): Promise< [ - protosTypes.google.cloud.securitycenter.v1beta1.IOrganizationSettings, + protos.google.cloud.securitycenter.v1beta1.IOrganizationSettings, ( - | protosTypes.google.cloud.securitycenter.v1beta1.IUpdateOrganizationSettingsRequest + | protos.google.cloud.securitycenter.v1beta1.IUpdateOrganizationSettingsRequest | undefined ), {} | undefined ] >; updateOrganizationSettings( - request: protosTypes.google.cloud.securitycenter.v1beta1.IUpdateOrganizationSettingsRequest, + request: protos.google.cloud.securitycenter.v1beta1.IUpdateOrganizationSettingsRequest, options: gax.CallOptions, callback: Callback< - protosTypes.google.cloud.securitycenter.v1beta1.IOrganizationSettings, - | protosTypes.google.cloud.securitycenter.v1beta1.IUpdateOrganizationSettingsRequest + protos.google.cloud.securitycenter.v1beta1.IOrganizationSettings, + | protos.google.cloud.securitycenter.v1beta1.IUpdateOrganizationSettingsRequest + | null | undefined, - {} | undefined + {} | null | undefined + > + ): void; + updateOrganizationSettings( + request: protos.google.cloud.securitycenter.v1beta1.IUpdateOrganizationSettingsRequest, + callback: Callback< + protos.google.cloud.securitycenter.v1beta1.IOrganizationSettings, + | protos.google.cloud.securitycenter.v1beta1.IUpdateOrganizationSettingsRequest + | null + | undefined, + {} | null | undefined > ): void; /** @@ -1157,26 +1261,28 @@ export class SecurityCenterClient { * The promise has a method named "cancel" which cancels the ongoing API call. */ updateOrganizationSettings( - request: protosTypes.google.cloud.securitycenter.v1beta1.IUpdateOrganizationSettingsRequest, + request: protos.google.cloud.securitycenter.v1beta1.IUpdateOrganizationSettingsRequest, optionsOrCallback?: | gax.CallOptions | Callback< - protosTypes.google.cloud.securitycenter.v1beta1.IOrganizationSettings, - | protosTypes.google.cloud.securitycenter.v1beta1.IUpdateOrganizationSettingsRequest + protos.google.cloud.securitycenter.v1beta1.IOrganizationSettings, + | protos.google.cloud.securitycenter.v1beta1.IUpdateOrganizationSettingsRequest + | null | undefined, - {} | undefined + {} | null | undefined >, callback?: Callback< - protosTypes.google.cloud.securitycenter.v1beta1.IOrganizationSettings, - | protosTypes.google.cloud.securitycenter.v1beta1.IUpdateOrganizationSettingsRequest + protos.google.cloud.securitycenter.v1beta1.IOrganizationSettings, + | protos.google.cloud.securitycenter.v1beta1.IUpdateOrganizationSettingsRequest + | null | undefined, - {} | undefined + {} | null | undefined > ): Promise< [ - protosTypes.google.cloud.securitycenter.v1beta1.IOrganizationSettings, + protos.google.cloud.securitycenter.v1beta1.IOrganizationSettings, ( - | protosTypes.google.cloud.securitycenter.v1beta1.IUpdateOrganizationSettingsRequest + | protos.google.cloud.securitycenter.v1beta1.IUpdateOrganizationSettingsRequest | undefined ), {} | undefined @@ -1199,33 +1305,44 @@ export class SecurityCenterClient { 'organization_settings.name': request.organizationSettings!.name || '', }); this.initialize(); - return this._innerApiCalls.updateOrganizationSettings( + return this.innerApiCalls.updateOrganizationSettings( request, options, callback ); } updateSource( - request: protosTypes.google.cloud.securitycenter.v1beta1.IUpdateSourceRequest, + request: protos.google.cloud.securitycenter.v1beta1.IUpdateSourceRequest, options?: gax.CallOptions ): Promise< [ - protosTypes.google.cloud.securitycenter.v1beta1.ISource, + protos.google.cloud.securitycenter.v1beta1.ISource, ( - | protosTypes.google.cloud.securitycenter.v1beta1.IUpdateSourceRequest + | protos.google.cloud.securitycenter.v1beta1.IUpdateSourceRequest | undefined ), {} | undefined ] >; updateSource( - request: protosTypes.google.cloud.securitycenter.v1beta1.IUpdateSourceRequest, + request: protos.google.cloud.securitycenter.v1beta1.IUpdateSourceRequest, options: gax.CallOptions, callback: Callback< - protosTypes.google.cloud.securitycenter.v1beta1.ISource, - | protosTypes.google.cloud.securitycenter.v1beta1.IUpdateSourceRequest + protos.google.cloud.securitycenter.v1beta1.ISource, + | protos.google.cloud.securitycenter.v1beta1.IUpdateSourceRequest + | null | undefined, - {} | undefined + {} | null | undefined + > + ): void; + updateSource( + request: protos.google.cloud.securitycenter.v1beta1.IUpdateSourceRequest, + callback: Callback< + protos.google.cloud.securitycenter.v1beta1.ISource, + | protos.google.cloud.securitycenter.v1beta1.IUpdateSourceRequest + | null + | undefined, + {} | null | undefined > ): void; /** @@ -1244,26 +1361,28 @@ export class SecurityCenterClient { * The promise has a method named "cancel" which cancels the ongoing API call. */ updateSource( - request: protosTypes.google.cloud.securitycenter.v1beta1.IUpdateSourceRequest, + request: protos.google.cloud.securitycenter.v1beta1.IUpdateSourceRequest, optionsOrCallback?: | gax.CallOptions | Callback< - protosTypes.google.cloud.securitycenter.v1beta1.ISource, - | protosTypes.google.cloud.securitycenter.v1beta1.IUpdateSourceRequest + protos.google.cloud.securitycenter.v1beta1.ISource, + | protos.google.cloud.securitycenter.v1beta1.IUpdateSourceRequest + | null | undefined, - {} | undefined + {} | null | undefined >, callback?: Callback< - protosTypes.google.cloud.securitycenter.v1beta1.ISource, - | protosTypes.google.cloud.securitycenter.v1beta1.IUpdateSourceRequest + protos.google.cloud.securitycenter.v1beta1.ISource, + | protos.google.cloud.securitycenter.v1beta1.IUpdateSourceRequest + | null | undefined, - {} | undefined + {} | null | undefined > ): Promise< [ - protosTypes.google.cloud.securitycenter.v1beta1.ISource, + protos.google.cloud.securitycenter.v1beta1.ISource, ( - | protosTypes.google.cloud.securitycenter.v1beta1.IUpdateSourceRequest + | protos.google.cloud.securitycenter.v1beta1.IUpdateSourceRequest | undefined ), {} | undefined @@ -1286,29 +1405,40 @@ export class SecurityCenterClient { 'source.name': request.source!.name || '', }); this.initialize(); - return this._innerApiCalls.updateSource(request, options, callback); + return this.innerApiCalls.updateSource(request, options, callback); } updateSecurityMarks( - request: protosTypes.google.cloud.securitycenter.v1beta1.IUpdateSecurityMarksRequest, + request: protos.google.cloud.securitycenter.v1beta1.IUpdateSecurityMarksRequest, options?: gax.CallOptions ): Promise< [ - protosTypes.google.cloud.securitycenter.v1beta1.ISecurityMarks, + protos.google.cloud.securitycenter.v1beta1.ISecurityMarks, ( - | protosTypes.google.cloud.securitycenter.v1beta1.IUpdateSecurityMarksRequest + | protos.google.cloud.securitycenter.v1beta1.IUpdateSecurityMarksRequest | undefined ), {} | undefined ] >; updateSecurityMarks( - request: protosTypes.google.cloud.securitycenter.v1beta1.IUpdateSecurityMarksRequest, + request: protos.google.cloud.securitycenter.v1beta1.IUpdateSecurityMarksRequest, options: gax.CallOptions, callback: Callback< - protosTypes.google.cloud.securitycenter.v1beta1.ISecurityMarks, - | protosTypes.google.cloud.securitycenter.v1beta1.IUpdateSecurityMarksRequest + protos.google.cloud.securitycenter.v1beta1.ISecurityMarks, + | protos.google.cloud.securitycenter.v1beta1.IUpdateSecurityMarksRequest + | null | undefined, - {} | undefined + {} | null | undefined + > + ): void; + updateSecurityMarks( + request: protos.google.cloud.securitycenter.v1beta1.IUpdateSecurityMarksRequest, + callback: Callback< + protos.google.cloud.securitycenter.v1beta1.ISecurityMarks, + | protos.google.cloud.securitycenter.v1beta1.IUpdateSecurityMarksRequest + | null + | undefined, + {} | null | undefined > ): void; /** @@ -1329,26 +1459,28 @@ export class SecurityCenterClient { * The promise has a method named "cancel" which cancels the ongoing API call. */ updateSecurityMarks( - request: protosTypes.google.cloud.securitycenter.v1beta1.IUpdateSecurityMarksRequest, + request: protos.google.cloud.securitycenter.v1beta1.IUpdateSecurityMarksRequest, optionsOrCallback?: | gax.CallOptions | Callback< - protosTypes.google.cloud.securitycenter.v1beta1.ISecurityMarks, - | protosTypes.google.cloud.securitycenter.v1beta1.IUpdateSecurityMarksRequest + protos.google.cloud.securitycenter.v1beta1.ISecurityMarks, + | protos.google.cloud.securitycenter.v1beta1.IUpdateSecurityMarksRequest + | null | undefined, - {} | undefined + {} | null | undefined >, callback?: Callback< - protosTypes.google.cloud.securitycenter.v1beta1.ISecurityMarks, - | protosTypes.google.cloud.securitycenter.v1beta1.IUpdateSecurityMarksRequest + protos.google.cloud.securitycenter.v1beta1.ISecurityMarks, + | protos.google.cloud.securitycenter.v1beta1.IUpdateSecurityMarksRequest + | null | undefined, - {} | undefined + {} | null | undefined > ): Promise< [ - protosTypes.google.cloud.securitycenter.v1beta1.ISecurityMarks, + protos.google.cloud.securitycenter.v1beta1.ISecurityMarks, ( - | protosTypes.google.cloud.securitycenter.v1beta1.IUpdateSecurityMarksRequest + | protos.google.cloud.securitycenter.v1beta1.IUpdateSecurityMarksRequest | undefined ), {} | undefined @@ -1371,32 +1503,34 @@ export class SecurityCenterClient { 'security_marks.name': request.securityMarks!.name || '', }); this.initialize(); - return this._innerApiCalls.updateSecurityMarks(request, options, callback); + return this.innerApiCalls.updateSecurityMarks(request, options, callback); } runAssetDiscovery( - request: protosTypes.google.cloud.securitycenter.v1beta1.IRunAssetDiscoveryRequest, + request: protos.google.cloud.securitycenter.v1beta1.IRunAssetDiscoveryRequest, options?: gax.CallOptions ): Promise< [ - LROperation< - protosTypes.google.protobuf.IEmpty, - protosTypes.google.protobuf.IEmpty - >, - protosTypes.google.longrunning.IOperation | undefined, + LROperation, + protos.google.longrunning.IOperation | undefined, {} | undefined ] >; runAssetDiscovery( - request: protosTypes.google.cloud.securitycenter.v1beta1.IRunAssetDiscoveryRequest, + request: protos.google.cloud.securitycenter.v1beta1.IRunAssetDiscoveryRequest, options: gax.CallOptions, callback: Callback< - LROperation< - protosTypes.google.protobuf.IEmpty, - protosTypes.google.protobuf.IEmpty - >, - protosTypes.google.longrunning.IOperation | undefined, - {} | undefined + LROperation, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + runAssetDiscovery( + request: protos.google.cloud.securitycenter.v1beta1.IRunAssetDiscoveryRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined > ): void; /** @@ -1419,32 +1553,26 @@ export class SecurityCenterClient { * The promise has a method named "cancel" which cancels the ongoing API call. */ runAssetDiscovery( - request: protosTypes.google.cloud.securitycenter.v1beta1.IRunAssetDiscoveryRequest, + request: protos.google.cloud.securitycenter.v1beta1.IRunAssetDiscoveryRequest, optionsOrCallback?: | gax.CallOptions | Callback< LROperation< - protosTypes.google.protobuf.IEmpty, - protosTypes.google.protobuf.IEmpty + protos.google.protobuf.IEmpty, + protos.google.protobuf.IEmpty >, - protosTypes.google.longrunning.IOperation | undefined, - {} | undefined + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined >, callback?: Callback< - LROperation< - protosTypes.google.protobuf.IEmpty, - protosTypes.google.protobuf.IEmpty - >, - protosTypes.google.longrunning.IOperation | undefined, - {} | undefined + LROperation, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined > ): Promise< [ - LROperation< - protosTypes.google.protobuf.IEmpty, - protosTypes.google.protobuf.IEmpty - >, - protosTypes.google.longrunning.IOperation | undefined, + LROperation, + protos.google.longrunning.IOperation | undefined, {} | undefined ] > | void { @@ -1465,25 +1593,37 @@ export class SecurityCenterClient { parent: request.parent || '', }); this.initialize(); - return this._innerApiCalls.runAssetDiscovery(request, options, callback); + return this.innerApiCalls.runAssetDiscovery(request, options, callback); } groupAssets( - request: protosTypes.google.cloud.securitycenter.v1beta1.IGroupAssetsRequest, + request: protos.google.cloud.securitycenter.v1beta1.IGroupAssetsRequest, options?: gax.CallOptions ): Promise< [ - protosTypes.google.cloud.securitycenter.v1beta1.IGroupResult[], - protosTypes.google.cloud.securitycenter.v1beta1.IGroupAssetsRequest | null, - protosTypes.google.cloud.securitycenter.v1beta1.IGroupAssetsResponse + protos.google.cloud.securitycenter.v1beta1.IGroupResult[], + protos.google.cloud.securitycenter.v1beta1.IGroupAssetsRequest | null, + protos.google.cloud.securitycenter.v1beta1.IGroupAssetsResponse ] >; groupAssets( - request: protosTypes.google.cloud.securitycenter.v1beta1.IGroupAssetsRequest, + request: protos.google.cloud.securitycenter.v1beta1.IGroupAssetsRequest, options: gax.CallOptions, - callback: Callback< - protosTypes.google.cloud.securitycenter.v1beta1.IGroupResult[], - protosTypes.google.cloud.securitycenter.v1beta1.IGroupAssetsRequest | null, - protosTypes.google.cloud.securitycenter.v1beta1.IGroupAssetsResponse + callback: PaginationCallback< + protos.google.cloud.securitycenter.v1beta1.IGroupAssetsRequest, + | protos.google.cloud.securitycenter.v1beta1.IGroupAssetsResponse + | null + | undefined, + protos.google.cloud.securitycenter.v1beta1.IGroupResult + > + ): void; + groupAssets( + request: protos.google.cloud.securitycenter.v1beta1.IGroupAssetsRequest, + callback: PaginationCallback< + protos.google.cloud.securitycenter.v1beta1.IGroupAssetsRequest, + | protos.google.cloud.securitycenter.v1beta1.IGroupAssetsResponse + | null + | undefined, + protos.google.cloud.securitycenter.v1beta1.IGroupResult > ): void; /** @@ -1591,24 +1731,28 @@ export class SecurityCenterClient { * The promise has a method named "cancel" which cancels the ongoing API call. */ groupAssets( - request: protosTypes.google.cloud.securitycenter.v1beta1.IGroupAssetsRequest, + request: protos.google.cloud.securitycenter.v1beta1.IGroupAssetsRequest, optionsOrCallback?: | gax.CallOptions - | Callback< - protosTypes.google.cloud.securitycenter.v1beta1.IGroupResult[], - protosTypes.google.cloud.securitycenter.v1beta1.IGroupAssetsRequest | null, - protosTypes.google.cloud.securitycenter.v1beta1.IGroupAssetsResponse + | PaginationCallback< + protos.google.cloud.securitycenter.v1beta1.IGroupAssetsRequest, + | protos.google.cloud.securitycenter.v1beta1.IGroupAssetsResponse + | null + | undefined, + protos.google.cloud.securitycenter.v1beta1.IGroupResult >, - callback?: Callback< - protosTypes.google.cloud.securitycenter.v1beta1.IGroupResult[], - protosTypes.google.cloud.securitycenter.v1beta1.IGroupAssetsRequest | null, - protosTypes.google.cloud.securitycenter.v1beta1.IGroupAssetsResponse + callback?: PaginationCallback< + protos.google.cloud.securitycenter.v1beta1.IGroupAssetsRequest, + | protos.google.cloud.securitycenter.v1beta1.IGroupAssetsResponse + | null + | undefined, + protos.google.cloud.securitycenter.v1beta1.IGroupResult > ): Promise< [ - protosTypes.google.cloud.securitycenter.v1beta1.IGroupResult[], - protosTypes.google.cloud.securitycenter.v1beta1.IGroupAssetsRequest | null, - protosTypes.google.cloud.securitycenter.v1beta1.IGroupAssetsResponse + protos.google.cloud.securitycenter.v1beta1.IGroupResult[], + protos.google.cloud.securitycenter.v1beta1.IGroupAssetsRequest | null, + protos.google.cloud.securitycenter.v1beta1.IGroupAssetsResponse ] > | void { request = request || {}; @@ -1628,7 +1772,7 @@ export class SecurityCenterClient { parent: request.parent || '', }); this.initialize(); - return this._innerApiCalls.groupAssets(request, options, callback); + return this.innerApiCalls.groupAssets(request, options, callback); } /** @@ -1732,7 +1876,7 @@ export class SecurityCenterClient { * An object stream which emits an object representing [GroupResult]{@link google.cloud.securitycenter.v1beta1.GroupResult} on 'data' event. */ groupAssetsStream( - request?: protosTypes.google.cloud.securitycenter.v1beta1.IGroupAssetsRequest, + request?: protos.google.cloud.securitycenter.v1beta1.IGroupAssetsRequest, options?: gax.CallOptions ): Transform { request = request || {}; @@ -1746,29 +1890,156 @@ export class SecurityCenterClient { }); const callSettings = new gax.CallSettings(options); this.initialize(); - return this._descriptors.page.groupAssets.createStream( - this._innerApiCalls.groupAssets as gax.GaxCall, + return this.descriptors.page.groupAssets.createStream( + this.innerApiCalls.groupAssets as gax.GaxCall, request, callSettings ); } + + /** + * Equivalent to {@link groupAssets}, but returns an iterable object. + * + * for-await-of syntax is used with the iterable to recursively get response element on-demand. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Name of the organization to groupBy. Its format is + * "organizations/[organization_id]". + * @param {string} request.filter + * Expression that defines the filter to apply across assets. + * The expression is a list of zero or more restrictions combined via logical + * operators `AND` and `OR`. + * Parentheses are not supported, and `OR` has higher precedence than `AND`. + * + * Restrictions have the form ` ` and may have a `-` + * character in front of them to indicate negation. The fields map to those + * defined in the Asset resource. Examples include: + * + * * name + * * security_center_properties.resource_name + * * resource_properties.a_property + * * security_marks.marks.marka + * + * The supported operators are: + * + * * `=` for all value types. + * * `>`, `<`, `>=`, `<=` for integer values. + * * `:`, meaning substring matching, for strings. + * + * The supported value types are: + * + * * string literals in quotes. + * * integer literals without quotes. + * * boolean literals `true` and `false` without quotes. + * + * For example, `resource_properties.size = 100` is a valid filter string. + * @param {string} request.groupBy + * Required. Expression that defines what assets fields to use for grouping. The string + * value should follow SQL syntax: comma separated list of fields. For + * example: + * "security_center_properties.resource_project,security_center_properties.project". + * + * The following fields are supported when compare_duration is not set: + * + * * security_center_properties.resource_project + * * security_center_properties.resource_type + * * security_center_properties.resource_parent + * + * The following fields are supported when compare_duration is set: + * + * * security_center_properties.resource_type + * @param {google.protobuf.Duration} request.compareDuration + * When compare_duration is set, the Asset's "state" property is updated to + * indicate whether the asset was added, removed, or remained present during + * the compare_duration period of time that precedes the read_time. This is + * the time between (read_time - compare_duration) and read_time. + * + * The state value is derived based on the presence of the asset at the two + * points in time. Intermediate state changes between the two times don't + * affect the result. For example, the results aren't affected if the asset is + * removed and re-created again. + * + * Possible "state" values when compare_duration is specified: + * + * * "ADDED": indicates that the asset was not present before + * compare_duration, but present at reference_time. + * * "REMOVED": indicates that the asset was present at the start of + * compare_duration, but not present at reference_time. + * * "ACTIVE": indicates that the asset was present at both the + * start and the end of the time period defined by + * compare_duration and reference_time. + * + * This field is ignored if `state` is not a field in `group_by`. + * @param {google.protobuf.Timestamp} request.readTime + * Time used as a reference point when filtering assets. The filter is limited + * to assets existing at the supplied time and their values are those at that + * specific time. Absence of this field will default to the API's version of + * NOW. + * @param {string} request.pageToken + * The value returned by the last `GroupAssetsResponse`; indicates + * that this is a continuation of a prior `GroupAssets` call, and that the + * system should return the next page of data. + * @param {number} request.pageSize + * The maximum number of results to return in a single response. Default is + * 10, minimum is 1, maximum is 1000. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols. + */ + groupAssetsAsync( + request?: protos.google.cloud.securitycenter.v1beta1.IGroupAssetsRequest, + options?: gax.CallOptions + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.groupAssets.asyncIterate( + this.innerApiCalls['groupAssets'] as GaxCall, + (request as unknown) as RequestType, + callSettings + ) as AsyncIterable; + } groupFindings( - request: protosTypes.google.cloud.securitycenter.v1beta1.IGroupFindingsRequest, + request: protos.google.cloud.securitycenter.v1beta1.IGroupFindingsRequest, options?: gax.CallOptions ): Promise< [ - protosTypes.google.cloud.securitycenter.v1beta1.IGroupResult[], - protosTypes.google.cloud.securitycenter.v1beta1.IGroupFindingsRequest | null, - protosTypes.google.cloud.securitycenter.v1beta1.IGroupFindingsResponse + protos.google.cloud.securitycenter.v1beta1.IGroupResult[], + protos.google.cloud.securitycenter.v1beta1.IGroupFindingsRequest | null, + protos.google.cloud.securitycenter.v1beta1.IGroupFindingsResponse ] >; groupFindings( - request: protosTypes.google.cloud.securitycenter.v1beta1.IGroupFindingsRequest, + request: protos.google.cloud.securitycenter.v1beta1.IGroupFindingsRequest, options: gax.CallOptions, - callback: Callback< - protosTypes.google.cloud.securitycenter.v1beta1.IGroupResult[], - protosTypes.google.cloud.securitycenter.v1beta1.IGroupFindingsRequest | null, - protosTypes.google.cloud.securitycenter.v1beta1.IGroupFindingsResponse + callback: PaginationCallback< + protos.google.cloud.securitycenter.v1beta1.IGroupFindingsRequest, + | protos.google.cloud.securitycenter.v1beta1.IGroupFindingsResponse + | null + | undefined, + protos.google.cloud.securitycenter.v1beta1.IGroupResult + > + ): void; + groupFindings( + request: protos.google.cloud.securitycenter.v1beta1.IGroupFindingsRequest, + callback: PaginationCallback< + protos.google.cloud.securitycenter.v1beta1.IGroupFindingsRequest, + | protos.google.cloud.securitycenter.v1beta1.IGroupFindingsResponse + | null + | undefined, + protos.google.cloud.securitycenter.v1beta1.IGroupResult > ): void; /** @@ -1854,24 +2125,28 @@ export class SecurityCenterClient { * The promise has a method named "cancel" which cancels the ongoing API call. */ groupFindings( - request: protosTypes.google.cloud.securitycenter.v1beta1.IGroupFindingsRequest, + request: protos.google.cloud.securitycenter.v1beta1.IGroupFindingsRequest, optionsOrCallback?: | gax.CallOptions - | Callback< - protosTypes.google.cloud.securitycenter.v1beta1.IGroupResult[], - protosTypes.google.cloud.securitycenter.v1beta1.IGroupFindingsRequest | null, - protosTypes.google.cloud.securitycenter.v1beta1.IGroupFindingsResponse + | PaginationCallback< + protos.google.cloud.securitycenter.v1beta1.IGroupFindingsRequest, + | protos.google.cloud.securitycenter.v1beta1.IGroupFindingsResponse + | null + | undefined, + protos.google.cloud.securitycenter.v1beta1.IGroupResult >, - callback?: Callback< - protosTypes.google.cloud.securitycenter.v1beta1.IGroupResult[], - protosTypes.google.cloud.securitycenter.v1beta1.IGroupFindingsRequest | null, - protosTypes.google.cloud.securitycenter.v1beta1.IGroupFindingsResponse + callback?: PaginationCallback< + protos.google.cloud.securitycenter.v1beta1.IGroupFindingsRequest, + | protos.google.cloud.securitycenter.v1beta1.IGroupFindingsResponse + | null + | undefined, + protos.google.cloud.securitycenter.v1beta1.IGroupResult > ): Promise< [ - protosTypes.google.cloud.securitycenter.v1beta1.IGroupResult[], - protosTypes.google.cloud.securitycenter.v1beta1.IGroupFindingsRequest | null, - protosTypes.google.cloud.securitycenter.v1beta1.IGroupFindingsResponse + protos.google.cloud.securitycenter.v1beta1.IGroupResult[], + protos.google.cloud.securitycenter.v1beta1.IGroupFindingsRequest | null, + protos.google.cloud.securitycenter.v1beta1.IGroupFindingsResponse ] > | void { request = request || {}; @@ -1891,7 +2166,7 @@ export class SecurityCenterClient { parent: request.parent || '', }); this.initialize(); - return this._innerApiCalls.groupFindings(request, options, callback); + return this.innerApiCalls.groupFindings(request, options, callback); } /** @@ -1970,7 +2245,7 @@ export class SecurityCenterClient { * An object stream which emits an object representing [GroupResult]{@link google.cloud.securitycenter.v1beta1.GroupResult} on 'data' event. */ groupFindingsStream( - request?: protosTypes.google.cloud.securitycenter.v1beta1.IGroupFindingsRequest, + request?: protos.google.cloud.securitycenter.v1beta1.IGroupFindingsRequest, options?: gax.CallOptions ): Transform { request = request || {}; @@ -1984,48 +2259,150 @@ export class SecurityCenterClient { }); const callSettings = new gax.CallSettings(options); this.initialize(); - return this._descriptors.page.groupFindings.createStream( - this._innerApiCalls.groupFindings as gax.GaxCall, + return this.descriptors.page.groupFindings.createStream( + this.innerApiCalls.groupFindings as gax.GaxCall, request, callSettings ); } - listAssets( - request: protosTypes.google.cloud.securitycenter.v1beta1.IListAssetsRequest, - options?: gax.CallOptions - ): Promise< - [ - protosTypes.google.cloud.securitycenter.v1beta1.ListAssetsResponse.IListAssetsResult[], - protosTypes.google.cloud.securitycenter.v1beta1.IListAssetsRequest | null, - protosTypes.google.cloud.securitycenter.v1beta1.IListAssetsResponse - ] - >; - listAssets( - request: protosTypes.google.cloud.securitycenter.v1beta1.IListAssetsRequest, - options: gax.CallOptions, - callback: Callback< - protosTypes.google.cloud.securitycenter.v1beta1.ListAssetsResponse.IListAssetsResult[], - protosTypes.google.cloud.securitycenter.v1beta1.IListAssetsRequest | null, - protosTypes.google.cloud.securitycenter.v1beta1.IListAssetsResponse - > - ): void; + /** - * Lists an organization's assets. + * Equivalent to {@link groupFindings}, but returns an iterable object. + * + * for-await-of syntax is used with the iterable to recursively get response element on-demand. * * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. Name of the organization assets should belong to. Its format is - * "organizations/[organization_id]". + * Required. Name of the source to groupBy. Its format is + * "organizations/[organization_id]/sources/[source_id]". To groupBy across + * all sources provide a source_id of `-`. For example: + * organizations/{organization_id}/sources/- * @param {string} request.filter - * Expression that defines the filter to apply across assets. - * The expression is a list of zero or more restrictions combined via logical + * Expression that defines the filter to apply across findings. + * The expression is a list of one or more restrictions combined via logical * operators `AND` and `OR`. * Parentheses are not supported, and `OR` has higher precedence than `AND`. * * Restrictions have the form ` ` and may have a `-` - * character in front of them to indicate negation. The fields map to those - * defined in the Asset resource. Examples include: + * character in front of them to indicate negation. Examples include: + * + * * name + * * source_properties.a_property + * * security_marks.marks.marka + * + * The supported operators are: + * + * * `=` for all value types. + * * `>`, `<`, `>=`, `<=` for integer values. + * * `:`, meaning substring matching, for strings. + * + * The supported value types are: + * + * * string literals in quotes. + * * integer literals without quotes. + * * boolean literals `true` and `false` without quotes. + * + * For example, `source_properties.size = 100` is a valid filter string. + * @param {string} request.groupBy + * Required. Expression that defines what assets fields to use for grouping (including + * `state`). The string value should follow SQL syntax: comma separated list + * of fields. For example: + * "parent,resource_name". + * + * The following fields are supported: + * + * * resource_name + * * category + * * state + * * parent + * @param {google.protobuf.Timestamp} request.readTime + * Time used as a reference point when filtering findings. The filter is + * limited to findings existing at the supplied time and their values are + * those at that specific time. Absence of this field will default to the + * API's version of NOW. + * @param {string} request.pageToken + * The value returned by the last `GroupFindingsResponse`; indicates + * that this is a continuation of a prior `GroupFindings` call, and + * that the system should return the next page of data. + * @param {number} request.pageSize + * The maximum number of results to return in a single response. Default is + * 10, minimum is 1, maximum is 1000. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols. + */ + groupFindingsAsync( + request?: protos.google.cloud.securitycenter.v1beta1.IGroupFindingsRequest, + options?: gax.CallOptions + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.groupFindings.asyncIterate( + this.innerApiCalls['groupFindings'] as GaxCall, + (request as unknown) as RequestType, + callSettings + ) as AsyncIterable; + } + listAssets( + request: protos.google.cloud.securitycenter.v1beta1.IListAssetsRequest, + options?: gax.CallOptions + ): Promise< + [ + protos.google.cloud.securitycenter.v1beta1.ListAssetsResponse.IListAssetsResult[], + protos.google.cloud.securitycenter.v1beta1.IListAssetsRequest | null, + protos.google.cloud.securitycenter.v1beta1.IListAssetsResponse + ] + >; + listAssets( + request: protos.google.cloud.securitycenter.v1beta1.IListAssetsRequest, + options: gax.CallOptions, + callback: PaginationCallback< + protos.google.cloud.securitycenter.v1beta1.IListAssetsRequest, + | protos.google.cloud.securitycenter.v1beta1.IListAssetsResponse + | null + | undefined, + protos.google.cloud.securitycenter.v1beta1.ListAssetsResponse.IListAssetsResult + > + ): void; + listAssets( + request: protos.google.cloud.securitycenter.v1beta1.IListAssetsRequest, + callback: PaginationCallback< + protos.google.cloud.securitycenter.v1beta1.IListAssetsRequest, + | protos.google.cloud.securitycenter.v1beta1.IListAssetsResponse + | null + | undefined, + protos.google.cloud.securitycenter.v1beta1.ListAssetsResponse.IListAssetsResult + > + ): void; + /** + * Lists an organization's assets. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Name of the organization assets should belong to. Its format is + * "organizations/[organization_id]". + * @param {string} request.filter + * Expression that defines the filter to apply across assets. + * The expression is a list of zero or more restrictions combined via logical + * operators `AND` and `OR`. + * Parentheses are not supported, and `OR` has higher precedence than `AND`. + * + * Restrictions have the form ` ` and may have a `-` + * character in front of them to indicate negation. The fields map to those + * defined in the Asset resource. Examples include: * * * name * * security_center_properties.resource_name @@ -2113,24 +2490,28 @@ export class SecurityCenterClient { * The promise has a method named "cancel" which cancels the ongoing API call. */ listAssets( - request: protosTypes.google.cloud.securitycenter.v1beta1.IListAssetsRequest, + request: protos.google.cloud.securitycenter.v1beta1.IListAssetsRequest, optionsOrCallback?: | gax.CallOptions - | Callback< - protosTypes.google.cloud.securitycenter.v1beta1.ListAssetsResponse.IListAssetsResult[], - protosTypes.google.cloud.securitycenter.v1beta1.IListAssetsRequest | null, - protosTypes.google.cloud.securitycenter.v1beta1.IListAssetsResponse + | PaginationCallback< + protos.google.cloud.securitycenter.v1beta1.IListAssetsRequest, + | protos.google.cloud.securitycenter.v1beta1.IListAssetsResponse + | null + | undefined, + protos.google.cloud.securitycenter.v1beta1.ListAssetsResponse.IListAssetsResult >, - callback?: Callback< - protosTypes.google.cloud.securitycenter.v1beta1.ListAssetsResponse.IListAssetsResult[], - protosTypes.google.cloud.securitycenter.v1beta1.IListAssetsRequest | null, - protosTypes.google.cloud.securitycenter.v1beta1.IListAssetsResponse + callback?: PaginationCallback< + protos.google.cloud.securitycenter.v1beta1.IListAssetsRequest, + | protos.google.cloud.securitycenter.v1beta1.IListAssetsResponse + | null + | undefined, + protos.google.cloud.securitycenter.v1beta1.ListAssetsResponse.IListAssetsResult > ): Promise< [ - protosTypes.google.cloud.securitycenter.v1beta1.ListAssetsResponse.IListAssetsResult[], - protosTypes.google.cloud.securitycenter.v1beta1.IListAssetsRequest | null, - protosTypes.google.cloud.securitycenter.v1beta1.IListAssetsResponse + protos.google.cloud.securitycenter.v1beta1.ListAssetsResponse.IListAssetsResult[], + protos.google.cloud.securitycenter.v1beta1.IListAssetsRequest | null, + protos.google.cloud.securitycenter.v1beta1.IListAssetsResponse ] > | void { request = request || {}; @@ -2150,7 +2531,7 @@ export class SecurityCenterClient { parent: request.parent || '', }); this.initialize(); - return this._innerApiCalls.listAssets(request, options, callback); + return this.innerApiCalls.listAssets(request, options, callback); } /** @@ -2254,7 +2635,7 @@ export class SecurityCenterClient { * An object stream which emits an object representing [ListAssetsResult]{@link google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult} on 'data' event. */ listAssetsStream( - request?: protosTypes.google.cloud.securitycenter.v1beta1.IListAssetsRequest, + request?: protos.google.cloud.securitycenter.v1beta1.IListAssetsRequest, options?: gax.CallOptions ): Transform { request = request || {}; @@ -2268,29 +2649,160 @@ export class SecurityCenterClient { }); const callSettings = new gax.CallSettings(options); this.initialize(); - return this._descriptors.page.listAssets.createStream( - this._innerApiCalls.listAssets as gax.GaxCall, + return this.descriptors.page.listAssets.createStream( + this.innerApiCalls.listAssets as gax.GaxCall, request, callSettings ); } + + /** + * Equivalent to {@link listAssets}, but returns an iterable object. + * + * for-await-of syntax is used with the iterable to recursively get response element on-demand. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Name of the organization assets should belong to. Its format is + * "organizations/[organization_id]". + * @param {string} request.filter + * Expression that defines the filter to apply across assets. + * The expression is a list of zero or more restrictions combined via logical + * operators `AND` and `OR`. + * Parentheses are not supported, and `OR` has higher precedence than `AND`. + * + * Restrictions have the form ` ` and may have a `-` + * character in front of them to indicate negation. The fields map to those + * defined in the Asset resource. Examples include: + * + * * name + * * security_center_properties.resource_name + * * resource_properties.a_property + * * security_marks.marks.marka + * + * The supported operators are: + * + * * `=` for all value types. + * * `>`, `<`, `>=`, `<=` for integer values. + * * `:`, meaning substring matching, for strings. + * + * The supported value types are: + * + * * string literals in quotes. + * * integer literals without quotes. + * * boolean literals `true` and `false` without quotes. + * + * For example, `resource_properties.size = 100` is a valid filter string. + * @param {string} request.orderBy + * Expression that defines what fields and order to use for sorting. The + * string value should follow SQL syntax: comma separated list of fields. For + * example: "name,resource_properties.a_property". The default sorting order + * is ascending. To specify descending order for a field, a suffix " desc" + * should be appended to the field name. For example: "name + * desc,resource_properties.a_property". Redundant space characters in the + * syntax are insignificant. "name desc,resource_properties.a_property" and " + * name desc , resource_properties.a_property " are equivalent. + * @param {google.protobuf.Timestamp} request.readTime + * Time used as a reference point when filtering assets. The filter is limited + * to assets existing at the supplied time and their values are those at that + * specific time. Absence of this field will default to the API's version of + * NOW. + * @param {google.protobuf.Duration} request.compareDuration + * When compare_duration is set, the ListAssetResult's "state" attribute is + * updated to indicate whether the asset was added, removed, or remained + * present during the compare_duration period of time that precedes the + * read_time. This is the time between (read_time - + * compare_duration) and read_time. + * + * The state value is derived based on the presence of the asset at the two + * points in time. Intermediate state changes between the two times don't + * affect the result. For example, the results aren't affected if the asset is + * removed and re-created again. + * + * Possible "state" values when compare_duration is specified: + * + * * "ADDED": indicates that the asset was not present before + * compare_duration, but present at read_time. + * * "REMOVED": indicates that the asset was present at the start of + * compare_duration, but not present at read_time. + * * "ACTIVE": indicates that the asset was present at both the + * start and the end of the time period defined by + * compare_duration and read_time. + * + * If compare_duration is not specified, then the only possible state is + * "UNUSED", which indicates that the asset is present at read_time. + * @param {google.protobuf.FieldMask} [request.fieldMask] + * Optional. A field mask to specify the ListAssetsResult fields to be listed in the + * response. + * An empty field mask will list all fields. + * @param {string} request.pageToken + * The value returned by the last `ListAssetsResponse`; indicates + * that this is a continuation of a prior `ListAssets` call, and + * that the system should return the next page of data. + * @param {number} request.pageSize + * The maximum number of results to return in a single response. Default is + * 10, minimum is 1, maximum is 1000. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols. + */ + listAssetsAsync( + request?: protos.google.cloud.securitycenter.v1beta1.IListAssetsRequest, + options?: gax.CallOptions + ): AsyncIterable< + protos.google.cloud.securitycenter.v1beta1.ListAssetsResponse.IListAssetsResult + > { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.listAssets.asyncIterate( + this.innerApiCalls['listAssets'] as GaxCall, + (request as unknown) as RequestType, + callSettings + ) as AsyncIterable< + protos.google.cloud.securitycenter.v1beta1.ListAssetsResponse.IListAssetsResult + >; + } listFindings( - request: protosTypes.google.cloud.securitycenter.v1beta1.IListFindingsRequest, + request: protos.google.cloud.securitycenter.v1beta1.IListFindingsRequest, options?: gax.CallOptions ): Promise< [ - protosTypes.google.cloud.securitycenter.v1beta1.IFinding[], - protosTypes.google.cloud.securitycenter.v1beta1.IListFindingsRequest | null, - protosTypes.google.cloud.securitycenter.v1beta1.IListFindingsResponse + protos.google.cloud.securitycenter.v1beta1.IFinding[], + protos.google.cloud.securitycenter.v1beta1.IListFindingsRequest | null, + protos.google.cloud.securitycenter.v1beta1.IListFindingsResponse ] >; listFindings( - request: protosTypes.google.cloud.securitycenter.v1beta1.IListFindingsRequest, + request: protos.google.cloud.securitycenter.v1beta1.IListFindingsRequest, options: gax.CallOptions, - callback: Callback< - protosTypes.google.cloud.securitycenter.v1beta1.IFinding[], - protosTypes.google.cloud.securitycenter.v1beta1.IListFindingsRequest | null, - protosTypes.google.cloud.securitycenter.v1beta1.IListFindingsResponse + callback: PaginationCallback< + protos.google.cloud.securitycenter.v1beta1.IListFindingsRequest, + | protos.google.cloud.securitycenter.v1beta1.IListFindingsResponse + | null + | undefined, + protos.google.cloud.securitycenter.v1beta1.IFinding + > + ): void; + listFindings( + request: protos.google.cloud.securitycenter.v1beta1.IListFindingsRequest, + callback: PaginationCallback< + protos.google.cloud.securitycenter.v1beta1.IListFindingsRequest, + | protos.google.cloud.securitycenter.v1beta1.IListFindingsResponse + | null + | undefined, + protos.google.cloud.securitycenter.v1beta1.IFinding > ): void; /** @@ -2375,24 +2887,28 @@ export class SecurityCenterClient { * The promise has a method named "cancel" which cancels the ongoing API call. */ listFindings( - request: protosTypes.google.cloud.securitycenter.v1beta1.IListFindingsRequest, + request: protos.google.cloud.securitycenter.v1beta1.IListFindingsRequest, optionsOrCallback?: | gax.CallOptions - | Callback< - protosTypes.google.cloud.securitycenter.v1beta1.IFinding[], - protosTypes.google.cloud.securitycenter.v1beta1.IListFindingsRequest | null, - protosTypes.google.cloud.securitycenter.v1beta1.IListFindingsResponse + | PaginationCallback< + protos.google.cloud.securitycenter.v1beta1.IListFindingsRequest, + | protos.google.cloud.securitycenter.v1beta1.IListFindingsResponse + | null + | undefined, + protos.google.cloud.securitycenter.v1beta1.IFinding >, - callback?: Callback< - protosTypes.google.cloud.securitycenter.v1beta1.IFinding[], - protosTypes.google.cloud.securitycenter.v1beta1.IListFindingsRequest | null, - protosTypes.google.cloud.securitycenter.v1beta1.IListFindingsResponse + callback?: PaginationCallback< + protos.google.cloud.securitycenter.v1beta1.IListFindingsRequest, + | protos.google.cloud.securitycenter.v1beta1.IListFindingsResponse + | null + | undefined, + protos.google.cloud.securitycenter.v1beta1.IFinding > ): Promise< [ - protosTypes.google.cloud.securitycenter.v1beta1.IFinding[], - protosTypes.google.cloud.securitycenter.v1beta1.IListFindingsRequest | null, - protosTypes.google.cloud.securitycenter.v1beta1.IListFindingsResponse + protos.google.cloud.securitycenter.v1beta1.IFinding[], + protos.google.cloud.securitycenter.v1beta1.IListFindingsRequest | null, + protos.google.cloud.securitycenter.v1beta1.IListFindingsResponse ] > | void { request = request || {}; @@ -2412,7 +2928,7 @@ export class SecurityCenterClient { parent: request.parent || '', }); this.initialize(); - return this._innerApiCalls.listFindings(request, options, callback); + return this.innerApiCalls.listFindings(request, options, callback); } /** @@ -2491,7 +3007,7 @@ export class SecurityCenterClient { * An object stream which emits an object representing [Finding]{@link google.cloud.securitycenter.v1beta1.Finding} on 'data' event. */ listFindingsStream( - request?: protosTypes.google.cloud.securitycenter.v1beta1.IListFindingsRequest, + request?: protos.google.cloud.securitycenter.v1beta1.IListFindingsRequest, options?: gax.CallOptions ): Transform { request = request || {}; @@ -2505,29 +3021,131 @@ export class SecurityCenterClient { }); const callSettings = new gax.CallSettings(options); this.initialize(); - return this._descriptors.page.listFindings.createStream( - this._innerApiCalls.listFindings as gax.GaxCall, + return this.descriptors.page.listFindings.createStream( + this.innerApiCalls.listFindings as gax.GaxCall, request, callSettings ); } + + /** + * Equivalent to {@link listFindings}, but returns an iterable object. + * + * for-await-of syntax is used with the iterable to recursively get response element on-demand. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Name of the source the findings belong to. Its format is + * "organizations/[organization_id]/sources/[source_id]". To list across all + * sources provide a source_id of `-`. For example: + * organizations/{organization_id}/sources/- + * @param {string} request.filter + * Expression that defines the filter to apply across findings. + * The expression is a list of one or more restrictions combined via logical + * operators `AND` and `OR`. + * Parentheses are not supported, and `OR` has higher precedence than `AND`. + * + * Restrictions have the form ` ` and may have a `-` + * character in front of them to indicate negation. Examples include: + * + * * name + * * source_properties.a_property + * * security_marks.marks.marka + * + * The supported operators are: + * + * * `=` for all value types. + * * `>`, `<`, `>=`, `<=` for integer values. + * * `:`, meaning substring matching, for strings. + * + * The supported value types are: + * + * * string literals in quotes. + * * integer literals without quotes. + * * boolean literals `true` and `false` without quotes. + * + * For example, `source_properties.size = 100` is a valid filter string. + * @param {string} request.orderBy + * Expression that defines what fields and order to use for sorting. The + * string value should follow SQL syntax: comma separated list of fields. For + * example: "name,resource_properties.a_property". The default sorting order + * is ascending. To specify descending order for a field, a suffix " desc" + * should be appended to the field name. For example: "name + * desc,source_properties.a_property". Redundant space characters in the + * syntax are insignificant. "name desc,source_properties.a_property" and " + * name desc , source_properties.a_property " are equivalent. + * @param {google.protobuf.Timestamp} request.readTime + * Time used as a reference point when filtering findings. The filter is + * limited to findings existing at the supplied time and their values are + * those at that specific time. Absence of this field will default to the + * API's version of NOW. + * @param {google.protobuf.FieldMask} [request.fieldMask] + * Optional. A field mask to specify the Finding fields to be listed in the response. + * An empty field mask will list all fields. + * @param {string} request.pageToken + * The value returned by the last `ListFindingsResponse`; indicates + * that this is a continuation of a prior `ListFindings` call, and + * that the system should return the next page of data. + * @param {number} request.pageSize + * The maximum number of results to return in a single response. Default is + * 10, minimum is 1, maximum is 1000. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols. + */ + listFindingsAsync( + request?: protos.google.cloud.securitycenter.v1beta1.IListFindingsRequest, + options?: gax.CallOptions + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.listFindings.asyncIterate( + this.innerApiCalls['listFindings'] as GaxCall, + (request as unknown) as RequestType, + callSettings + ) as AsyncIterable; + } listSources( - request: protosTypes.google.cloud.securitycenter.v1beta1.IListSourcesRequest, + request: protos.google.cloud.securitycenter.v1beta1.IListSourcesRequest, options?: gax.CallOptions ): Promise< [ - protosTypes.google.cloud.securitycenter.v1beta1.ISource[], - protosTypes.google.cloud.securitycenter.v1beta1.IListSourcesRequest | null, - protosTypes.google.cloud.securitycenter.v1beta1.IListSourcesResponse + protos.google.cloud.securitycenter.v1beta1.ISource[], + protos.google.cloud.securitycenter.v1beta1.IListSourcesRequest | null, + protos.google.cloud.securitycenter.v1beta1.IListSourcesResponse ] >; listSources( - request: protosTypes.google.cloud.securitycenter.v1beta1.IListSourcesRequest, + request: protos.google.cloud.securitycenter.v1beta1.IListSourcesRequest, options: gax.CallOptions, - callback: Callback< - protosTypes.google.cloud.securitycenter.v1beta1.ISource[], - protosTypes.google.cloud.securitycenter.v1beta1.IListSourcesRequest | null, - protosTypes.google.cloud.securitycenter.v1beta1.IListSourcesResponse + callback: PaginationCallback< + protos.google.cloud.securitycenter.v1beta1.IListSourcesRequest, + | protos.google.cloud.securitycenter.v1beta1.IListSourcesResponse + | null + | undefined, + protos.google.cloud.securitycenter.v1beta1.ISource + > + ): void; + listSources( + request: protos.google.cloud.securitycenter.v1beta1.IListSourcesRequest, + callback: PaginationCallback< + protos.google.cloud.securitycenter.v1beta1.IListSourcesRequest, + | protos.google.cloud.securitycenter.v1beta1.IListSourcesResponse + | null + | undefined, + protos.google.cloud.securitycenter.v1beta1.ISource > ): void; /** @@ -2564,24 +3182,28 @@ export class SecurityCenterClient { * The promise has a method named "cancel" which cancels the ongoing API call. */ listSources( - request: protosTypes.google.cloud.securitycenter.v1beta1.IListSourcesRequest, + request: protos.google.cloud.securitycenter.v1beta1.IListSourcesRequest, optionsOrCallback?: | gax.CallOptions - | Callback< - protosTypes.google.cloud.securitycenter.v1beta1.ISource[], - protosTypes.google.cloud.securitycenter.v1beta1.IListSourcesRequest | null, - protosTypes.google.cloud.securitycenter.v1beta1.IListSourcesResponse + | PaginationCallback< + protos.google.cloud.securitycenter.v1beta1.IListSourcesRequest, + | protos.google.cloud.securitycenter.v1beta1.IListSourcesResponse + | null + | undefined, + protos.google.cloud.securitycenter.v1beta1.ISource >, - callback?: Callback< - protosTypes.google.cloud.securitycenter.v1beta1.ISource[], - protosTypes.google.cloud.securitycenter.v1beta1.IListSourcesRequest | null, - protosTypes.google.cloud.securitycenter.v1beta1.IListSourcesResponse + callback?: PaginationCallback< + protos.google.cloud.securitycenter.v1beta1.IListSourcesRequest, + | protos.google.cloud.securitycenter.v1beta1.IListSourcesResponse + | null + | undefined, + protos.google.cloud.securitycenter.v1beta1.ISource > ): Promise< [ - protosTypes.google.cloud.securitycenter.v1beta1.ISource[], - protosTypes.google.cloud.securitycenter.v1beta1.IListSourcesRequest | null, - protosTypes.google.cloud.securitycenter.v1beta1.IListSourcesResponse + protos.google.cloud.securitycenter.v1beta1.ISource[], + protos.google.cloud.securitycenter.v1beta1.IListSourcesRequest | null, + protos.google.cloud.securitycenter.v1beta1.IListSourcesResponse ] > | void { request = request || {}; @@ -2601,7 +3223,7 @@ export class SecurityCenterClient { parent: request.parent || '', }); this.initialize(); - return this._innerApiCalls.listSources(request, options, callback); + return this.innerApiCalls.listSources(request, options, callback); } /** @@ -2635,7 +3257,7 @@ export class SecurityCenterClient { * An object stream which emits an object representing [Source]{@link google.cloud.securitycenter.v1beta1.Source} on 'data' event. */ listSourcesStream( - request?: protosTypes.google.cloud.securitycenter.v1beta1.IListSourcesRequest, + request?: protos.google.cloud.securitycenter.v1beta1.IListSourcesRequest, options?: gax.CallOptions ): Transform { request = request || {}; @@ -2649,12 +3271,57 @@ export class SecurityCenterClient { }); const callSettings = new gax.CallSettings(options); this.initialize(); - return this._descriptors.page.listSources.createStream( - this._innerApiCalls.listSources as gax.GaxCall, + return this.descriptors.page.listSources.createStream( + this.innerApiCalls.listSources as gax.GaxCall, request, callSettings ); } + + /** + * Equivalent to {@link listSources}, but returns an iterable object. + * + * for-await-of syntax is used with the iterable to recursively get response element on-demand. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Resource name of the parent of sources to list. Its format should be + * "organizations/[organization_id]". + * @param {string} request.pageToken + * The value returned by the last `ListSourcesResponse`; indicates + * that this is a continuation of a prior `ListSources` call, and + * that the system should return the next page of data. + * @param {number} request.pageSize + * The maximum number of results to return in a single response. Default is + * 10, minimum is 1, maximum is 1000. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols. + */ + listSourcesAsync( + request?: protos.google.cloud.securitycenter.v1beta1.IListSourcesRequest, + options?: gax.CallOptions + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.listSources.asyncIterate( + this.innerApiCalls['listSources'] as GaxCall, + (request as unknown) as RequestType, + callSettings + ) as AsyncIterable; + } // -------------------- // -- Path templates -- // -------------------- @@ -2668,10 +3335,10 @@ export class SecurityCenterClient { * @returns {string} Resource name string. */ findingPath(organization: string, source: string, finding: string) { - return this._pathTemplates.findingPathTemplate.render({ - organization, - source, - finding, + return this.pathTemplates.findingPathTemplate.render({ + organization: organization, + source: source, + finding: finding, }); } @@ -2683,7 +3350,7 @@ export class SecurityCenterClient { * @returns {string} A string representing the organization. */ matchOrganizationFromFindingName(findingName: string) { - return this._pathTemplates.findingPathTemplate.match(findingName) + return this.pathTemplates.findingPathTemplate.match(findingName) .organization; } @@ -2695,7 +3362,7 @@ export class SecurityCenterClient { * @returns {string} A string representing the source. */ matchSourceFromFindingName(findingName: string) { - return this._pathTemplates.findingPathTemplate.match(findingName).source; + return this.pathTemplates.findingPathTemplate.match(findingName).source; } /** @@ -2706,7 +3373,7 @@ export class SecurityCenterClient { * @returns {string} A string representing the finding. */ matchFindingFromFindingName(findingName: string) { - return this._pathTemplates.findingPathTemplate.match(findingName).finding; + return this.pathTemplates.findingPathTemplate.match(findingName).finding; } /** @@ -2716,8 +3383,8 @@ export class SecurityCenterClient { * @returns {string} Resource name string. */ organizationPath(organization: string) { - return this._pathTemplates.organizationPathTemplate.render({ - organization, + return this.pathTemplates.organizationPathTemplate.render({ + organization: organization, }); } @@ -2729,7 +3396,7 @@ export class SecurityCenterClient { * @returns {string} A string representing the organization. */ matchOrganizationFromOrganizationName(organizationName: string) { - return this._pathTemplates.organizationPathTemplate.match(organizationName) + return this.pathTemplates.organizationPathTemplate.match(organizationName) .organization; } @@ -2741,10 +3408,10 @@ export class SecurityCenterClient { * @returns {string} Resource name string. */ organizationAssetSecurityMarksPath(organization: string, asset: string) { - return this._pathTemplates.organizationAssetSecurityMarksPathTemplate.render( + return this.pathTemplates.organizationAssetSecurityMarksPathTemplate.render( { - organization, - asset, + organization: organization, + asset: asset, } ); } @@ -2759,7 +3426,7 @@ export class SecurityCenterClient { matchOrganizationFromOrganizationAssetSecurityMarksName( organizationAssetSecurityMarksName: string ) { - return this._pathTemplates.organizationAssetSecurityMarksPathTemplate.match( + return this.pathTemplates.organizationAssetSecurityMarksPathTemplate.match( organizationAssetSecurityMarksName ).organization; } @@ -2774,7 +3441,7 @@ export class SecurityCenterClient { matchAssetFromOrganizationAssetSecurityMarksName( organizationAssetSecurityMarksName: string ) { - return this._pathTemplates.organizationAssetSecurityMarksPathTemplate.match( + return this.pathTemplates.organizationAssetSecurityMarksPathTemplate.match( organizationAssetSecurityMarksName ).asset; } @@ -2786,8 +3453,8 @@ export class SecurityCenterClient { * @returns {string} Resource name string. */ organizationSettingsPath(organization: string) { - return this._pathTemplates.organizationSettingsPathTemplate.render({ - organization, + return this.pathTemplates.organizationSettingsPathTemplate.render({ + organization: organization, }); } @@ -2801,7 +3468,7 @@ export class SecurityCenterClient { matchOrganizationFromOrganizationSettingsName( organizationSettingsName: string ) { - return this._pathTemplates.organizationSettingsPathTemplate.match( + return this.pathTemplates.organizationSettingsPathTemplate.match( organizationSettingsName ).organization; } @@ -2819,11 +3486,11 @@ export class SecurityCenterClient { source: string, finding: string ) { - return this._pathTemplates.organizationSourceFindingSecurityMarksPathTemplate.render( + return this.pathTemplates.organizationSourceFindingSecurityMarksPathTemplate.render( { - organization, - source, - finding, + organization: organization, + source: source, + finding: finding, } ); } @@ -2838,7 +3505,7 @@ export class SecurityCenterClient { matchOrganizationFromOrganizationSourceFindingSecurityMarksName( organizationSourceFindingSecurityMarksName: string ) { - return this._pathTemplates.organizationSourceFindingSecurityMarksPathTemplate.match( + return this.pathTemplates.organizationSourceFindingSecurityMarksPathTemplate.match( organizationSourceFindingSecurityMarksName ).organization; } @@ -2853,7 +3520,7 @@ export class SecurityCenterClient { matchSourceFromOrganizationSourceFindingSecurityMarksName( organizationSourceFindingSecurityMarksName: string ) { - return this._pathTemplates.organizationSourceFindingSecurityMarksPathTemplate.match( + return this.pathTemplates.organizationSourceFindingSecurityMarksPathTemplate.match( organizationSourceFindingSecurityMarksName ).source; } @@ -2868,7 +3535,7 @@ export class SecurityCenterClient { matchFindingFromOrganizationSourceFindingSecurityMarksName( organizationSourceFindingSecurityMarksName: string ) { - return this._pathTemplates.organizationSourceFindingSecurityMarksPathTemplate.match( + return this.pathTemplates.organizationSourceFindingSecurityMarksPathTemplate.match( organizationSourceFindingSecurityMarksName ).finding; } @@ -2881,9 +3548,9 @@ export class SecurityCenterClient { * @returns {string} Resource name string. */ sourcePath(organization: string, source: string) { - return this._pathTemplates.sourcePathTemplate.render({ - organization, - source, + return this.pathTemplates.sourcePathTemplate.render({ + organization: organization, + source: source, }); } @@ -2895,8 +3562,7 @@ export class SecurityCenterClient { * @returns {string} A string representing the organization. */ matchOrganizationFromSourceName(sourceName: string) { - return this._pathTemplates.sourcePathTemplate.match(sourceName) - .organization; + return this.pathTemplates.sourcePathTemplate.match(sourceName).organization; } /** @@ -2907,7 +3573,7 @@ export class SecurityCenterClient { * @returns {string} A string representing the source. */ matchSourceFromSourceName(sourceName: string) { - return this._pathTemplates.sourcePathTemplate.match(sourceName).source; + return this.pathTemplates.sourcePathTemplate.match(sourceName).source; } /** diff --git a/packages/google-cloud-securitycenter/src/v1p1beta1/security_center_client.ts b/packages/google-cloud-securitycenter/src/v1p1beta1/security_center_client.ts index 18b047d6535..3357f8ce835 100644 --- a/packages/google-cloud-securitycenter/src/v1p1beta1/security_center_client.ts +++ b/packages/google-cloud-securitycenter/src/v1p1beta1/security_center_client.ts @@ -18,19 +18,19 @@ import * as gax from 'google-gax'; import { - APICallback, Callback, CallOptions, Descriptors, ClientOptions, LROperation, PaginationCallback, - PaginationResponse, + GaxCall, } from 'google-gax'; import * as path from 'path'; import {Transform} from 'stream'; -import * as protosTypes from '../../protos/protos'; +import {RequestType} from 'google-gax/build/src/apitypes'; +import * as protos from '../../protos/protos'; import * as gapicConfig from './security_center_client_config.json'; const version = require('../../../package.json').version; @@ -41,14 +41,6 @@ const version = require('../../../package.json').version; * @memberof v1p1beta1 */ export class SecurityCenterClient { - private _descriptors: Descriptors = { - page: {}, - stream: {}, - longrunning: {}, - batching: {}, - }; - private _innerApiCalls: {[name: string]: Function}; - private _pathTemplates: {[name: string]: gax.PathTemplate}; private _terminated = false; private _opts: ClientOptions; private _gaxModule: typeof gax | typeof gax.fallback; @@ -56,6 +48,14 @@ export class SecurityCenterClient { private _protos: {}; private _defaults: {[method: string]: gax.CallSettings}; auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + innerApiCalls: {[name: string]: Function}; + pathTemplates: {[name: string]: gax.PathTemplate}; operationsClient: gax.OperationsClient; securityCenterStub?: Promise<{[name: string]: Function}>; @@ -148,13 +148,16 @@ export class SecurityCenterClient { 'protos.json' ); this._protos = this._gaxGrpc.loadProto( - opts.fallback ? require('../../protos/protos.json') : nodejsProtoPath + opts.fallback + ? // eslint-disable-next-line @typescript-eslint/no-var-requires + require('../../protos/protos.json') + : nodejsProtoPath ); // This API contains "path templates"; forward-slash-separated // identifiers to uniquely identify resources within the API. // Create useful helper objects for these. - this._pathTemplates = { + this.pathTemplates = { assetPathTemplate: new this._gaxModule.PathTemplate( 'organizations/{organization}/assets/{asset}' ), @@ -184,7 +187,7 @@ export class SecurityCenterClient { // Some of the methods on this service return "paged" results, // (e.g. 50 results at a time, with tokens to get subsequent // pages). Denote the keys used for pagination and results. - this._descriptors.page = { + this.descriptors.page = { groupAssets: new this._gaxModule.PageDescriptor( 'pageToken', 'nextPageToken', @@ -222,6 +225,7 @@ export class SecurityCenterClient { // rather than holding a request open. const protoFilesRoot = opts.fallback ? this._gaxModule.protobuf.Root.fromJSON( + // eslint-disable-next-line @typescript-eslint/no-var-requires require('../../protos/protos.json') ) : this._gaxModule.protobuf.loadSync(nodejsProtoPath); @@ -239,7 +243,7 @@ export class SecurityCenterClient { '.google.protobuf.Empty' ) as gax.protobuf.Type; - this._descriptors.longrunning = { + this.descriptors.longrunning = { runAssetDiscovery: new this._gaxModule.LongrunningDescriptor( this.operationsClient, runAssetDiscoveryResponse.decode.bind(runAssetDiscoveryResponse), @@ -258,7 +262,7 @@ export class SecurityCenterClient { // 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 = {}; + this.innerApiCalls = {}; } /** @@ -285,7 +289,7 @@ export class SecurityCenterClient { ? (this._protos as protobuf.Root).lookupService( 'google.cloud.securitycenter.v1p1beta1.SecurityCenter' ) - : // tslint:disable-next-line no-any + : // eslint-disable-next-line @typescript-eslint/no-explicit-any (this._protos as any).google.cloud.securitycenter.v1p1beta1 .SecurityCenter, this._opts @@ -318,9 +322,8 @@ export class SecurityCenterClient { 'updateSource', 'updateSecurityMarks', ]; - for (const methodName of securityCenterStubMethods) { - const innerCallPromise = this.securityCenterStub.then( + const callPromise = this.securityCenterStub.then( stub => (...args: Array<{}>) => { if (this._terminated) { return Promise.reject('The client has already been closed.'); @@ -334,20 +337,14 @@ export class SecurityCenterClient { ); const apiCall = this._gaxModule.createApiCall( - innerCallPromise, + callPromise, this._defaults[methodName], - this._descriptors.page[methodName] || - this._descriptors.stream[methodName] || - this._descriptors.longrunning[methodName] + this.descriptors.page[methodName] || + this.descriptors.stream[methodName] || + this.descriptors.longrunning[methodName] ); - this._innerApiCalls[methodName] = ( - argument: {}, - callOptions?: CallOptions, - callback?: APICallback - ) => { - return apiCall(argument, callOptions, callback); - }; + this.innerApiCalls[methodName] = apiCall; } return this.securityCenterStub; @@ -404,26 +401,37 @@ export class SecurityCenterClient { // -- Service calls -- // ------------------- createSource( - request: protosTypes.google.cloud.securitycenter.v1p1beta1.ICreateSourceRequest, + request: protos.google.cloud.securitycenter.v1p1beta1.ICreateSourceRequest, options?: gax.CallOptions ): Promise< [ - protosTypes.google.cloud.securitycenter.v1p1beta1.ISource, + protos.google.cloud.securitycenter.v1p1beta1.ISource, ( - | protosTypes.google.cloud.securitycenter.v1p1beta1.ICreateSourceRequest + | protos.google.cloud.securitycenter.v1p1beta1.ICreateSourceRequest | undefined ), {} | undefined ] >; createSource( - request: protosTypes.google.cloud.securitycenter.v1p1beta1.ICreateSourceRequest, + request: protos.google.cloud.securitycenter.v1p1beta1.ICreateSourceRequest, options: gax.CallOptions, callback: Callback< - protosTypes.google.cloud.securitycenter.v1p1beta1.ISource, - | protosTypes.google.cloud.securitycenter.v1p1beta1.ICreateSourceRequest + protos.google.cloud.securitycenter.v1p1beta1.ISource, + | protos.google.cloud.securitycenter.v1p1beta1.ICreateSourceRequest + | null | undefined, - {} | undefined + {} | null | undefined + > + ): void; + createSource( + request: protos.google.cloud.securitycenter.v1p1beta1.ICreateSourceRequest, + callback: Callback< + protos.google.cloud.securitycenter.v1p1beta1.ISource, + | protos.google.cloud.securitycenter.v1p1beta1.ICreateSourceRequest + | null + | undefined, + {} | null | undefined > ): void; /** @@ -444,26 +452,28 @@ export class SecurityCenterClient { * The promise has a method named "cancel" which cancels the ongoing API call. */ createSource( - request: protosTypes.google.cloud.securitycenter.v1p1beta1.ICreateSourceRequest, + request: protos.google.cloud.securitycenter.v1p1beta1.ICreateSourceRequest, optionsOrCallback?: | gax.CallOptions | Callback< - protosTypes.google.cloud.securitycenter.v1p1beta1.ISource, - | protosTypes.google.cloud.securitycenter.v1p1beta1.ICreateSourceRequest + protos.google.cloud.securitycenter.v1p1beta1.ISource, + | protos.google.cloud.securitycenter.v1p1beta1.ICreateSourceRequest + | null | undefined, - {} | undefined + {} | null | undefined >, callback?: Callback< - protosTypes.google.cloud.securitycenter.v1p1beta1.ISource, - | protosTypes.google.cloud.securitycenter.v1p1beta1.ICreateSourceRequest + protos.google.cloud.securitycenter.v1p1beta1.ISource, + | protos.google.cloud.securitycenter.v1p1beta1.ICreateSourceRequest + | null | undefined, - {} | undefined + {} | null | undefined > ): Promise< [ - protosTypes.google.cloud.securitycenter.v1p1beta1.ISource, + protos.google.cloud.securitycenter.v1p1beta1.ISource, ( - | protosTypes.google.cloud.securitycenter.v1p1beta1.ICreateSourceRequest + | protos.google.cloud.securitycenter.v1p1beta1.ICreateSourceRequest | undefined ), {} | undefined @@ -486,29 +496,40 @@ export class SecurityCenterClient { parent: request.parent || '', }); this.initialize(); - return this._innerApiCalls.createSource(request, options, callback); + return this.innerApiCalls.createSource(request, options, callback); } createFinding( - request: protosTypes.google.cloud.securitycenter.v1p1beta1.ICreateFindingRequest, + request: protos.google.cloud.securitycenter.v1p1beta1.ICreateFindingRequest, options?: gax.CallOptions ): Promise< [ - protosTypes.google.cloud.securitycenter.v1p1beta1.IFinding, + protos.google.cloud.securitycenter.v1p1beta1.IFinding, ( - | protosTypes.google.cloud.securitycenter.v1p1beta1.ICreateFindingRequest + | protos.google.cloud.securitycenter.v1p1beta1.ICreateFindingRequest | undefined ), {} | undefined ] >; createFinding( - request: protosTypes.google.cloud.securitycenter.v1p1beta1.ICreateFindingRequest, + request: protos.google.cloud.securitycenter.v1p1beta1.ICreateFindingRequest, options: gax.CallOptions, callback: Callback< - protosTypes.google.cloud.securitycenter.v1p1beta1.IFinding, - | protosTypes.google.cloud.securitycenter.v1p1beta1.ICreateFindingRequest + protos.google.cloud.securitycenter.v1p1beta1.IFinding, + | protos.google.cloud.securitycenter.v1p1beta1.ICreateFindingRequest + | null | undefined, - {} | undefined + {} | null | undefined + > + ): void; + createFinding( + request: protos.google.cloud.securitycenter.v1p1beta1.ICreateFindingRequest, + callback: Callback< + protos.google.cloud.securitycenter.v1p1beta1.IFinding, + | protos.google.cloud.securitycenter.v1p1beta1.ICreateFindingRequest + | null + | undefined, + {} | null | undefined > ): void; /** @@ -535,26 +556,28 @@ export class SecurityCenterClient { * The promise has a method named "cancel" which cancels the ongoing API call. */ createFinding( - request: protosTypes.google.cloud.securitycenter.v1p1beta1.ICreateFindingRequest, + request: protos.google.cloud.securitycenter.v1p1beta1.ICreateFindingRequest, optionsOrCallback?: | gax.CallOptions | Callback< - protosTypes.google.cloud.securitycenter.v1p1beta1.IFinding, - | protosTypes.google.cloud.securitycenter.v1p1beta1.ICreateFindingRequest + protos.google.cloud.securitycenter.v1p1beta1.IFinding, + | protos.google.cloud.securitycenter.v1p1beta1.ICreateFindingRequest + | null | undefined, - {} | undefined + {} | null | undefined >, callback?: Callback< - protosTypes.google.cloud.securitycenter.v1p1beta1.IFinding, - | protosTypes.google.cloud.securitycenter.v1p1beta1.ICreateFindingRequest + protos.google.cloud.securitycenter.v1p1beta1.IFinding, + | protos.google.cloud.securitycenter.v1p1beta1.ICreateFindingRequest + | null | undefined, - {} | undefined + {} | null | undefined > ): Promise< [ - protosTypes.google.cloud.securitycenter.v1p1beta1.IFinding, + protos.google.cloud.securitycenter.v1p1beta1.IFinding, ( - | protosTypes.google.cloud.securitycenter.v1p1beta1.ICreateFindingRequest + | protos.google.cloud.securitycenter.v1p1beta1.ICreateFindingRequest | undefined ), {} | undefined @@ -577,29 +600,40 @@ export class SecurityCenterClient { parent: request.parent || '', }); this.initialize(); - return this._innerApiCalls.createFinding(request, options, callback); + return this.innerApiCalls.createFinding(request, options, callback); } createNotificationConfig( - request: protosTypes.google.cloud.securitycenter.v1p1beta1.ICreateNotificationConfigRequest, + request: protos.google.cloud.securitycenter.v1p1beta1.ICreateNotificationConfigRequest, options?: gax.CallOptions ): Promise< [ - protosTypes.google.cloud.securitycenter.v1p1beta1.INotificationConfig, + protos.google.cloud.securitycenter.v1p1beta1.INotificationConfig, ( - | protosTypes.google.cloud.securitycenter.v1p1beta1.ICreateNotificationConfigRequest + | protos.google.cloud.securitycenter.v1p1beta1.ICreateNotificationConfigRequest | undefined ), {} | undefined ] >; createNotificationConfig( - request: protosTypes.google.cloud.securitycenter.v1p1beta1.ICreateNotificationConfigRequest, + request: protos.google.cloud.securitycenter.v1p1beta1.ICreateNotificationConfigRequest, options: gax.CallOptions, callback: Callback< - protosTypes.google.cloud.securitycenter.v1p1beta1.INotificationConfig, - | protosTypes.google.cloud.securitycenter.v1p1beta1.ICreateNotificationConfigRequest + protos.google.cloud.securitycenter.v1p1beta1.INotificationConfig, + | protos.google.cloud.securitycenter.v1p1beta1.ICreateNotificationConfigRequest + | null | undefined, - {} | undefined + {} | null | undefined + > + ): void; + createNotificationConfig( + request: protos.google.cloud.securitycenter.v1p1beta1.ICreateNotificationConfigRequest, + callback: Callback< + protos.google.cloud.securitycenter.v1p1beta1.INotificationConfig, + | protos.google.cloud.securitycenter.v1p1beta1.ICreateNotificationConfigRequest + | null + | undefined, + {} | null | undefined > ): void; /** @@ -626,26 +660,28 @@ export class SecurityCenterClient { * The promise has a method named "cancel" which cancels the ongoing API call. */ createNotificationConfig( - request: protosTypes.google.cloud.securitycenter.v1p1beta1.ICreateNotificationConfigRequest, + request: protos.google.cloud.securitycenter.v1p1beta1.ICreateNotificationConfigRequest, optionsOrCallback?: | gax.CallOptions | Callback< - protosTypes.google.cloud.securitycenter.v1p1beta1.INotificationConfig, - | protosTypes.google.cloud.securitycenter.v1p1beta1.ICreateNotificationConfigRequest + protos.google.cloud.securitycenter.v1p1beta1.INotificationConfig, + | protos.google.cloud.securitycenter.v1p1beta1.ICreateNotificationConfigRequest + | null | undefined, - {} | undefined + {} | null | undefined >, callback?: Callback< - protosTypes.google.cloud.securitycenter.v1p1beta1.INotificationConfig, - | protosTypes.google.cloud.securitycenter.v1p1beta1.ICreateNotificationConfigRequest + protos.google.cloud.securitycenter.v1p1beta1.INotificationConfig, + | protos.google.cloud.securitycenter.v1p1beta1.ICreateNotificationConfigRequest + | null | undefined, - {} | undefined + {} | null | undefined > ): Promise< [ - protosTypes.google.cloud.securitycenter.v1p1beta1.INotificationConfig, + protos.google.cloud.securitycenter.v1p1beta1.INotificationConfig, ( - | protosTypes.google.cloud.securitycenter.v1p1beta1.ICreateNotificationConfigRequest + | protos.google.cloud.securitycenter.v1p1beta1.ICreateNotificationConfigRequest | undefined ), {} | undefined @@ -668,33 +704,44 @@ export class SecurityCenterClient { parent: request.parent || '', }); this.initialize(); - return this._innerApiCalls.createNotificationConfig( + return this.innerApiCalls.createNotificationConfig( request, options, callback ); } deleteNotificationConfig( - request: protosTypes.google.cloud.securitycenter.v1p1beta1.IDeleteNotificationConfigRequest, + request: protos.google.cloud.securitycenter.v1p1beta1.IDeleteNotificationConfigRequest, options?: gax.CallOptions ): Promise< [ - protosTypes.google.protobuf.IEmpty, + protos.google.protobuf.IEmpty, ( - | protosTypes.google.cloud.securitycenter.v1p1beta1.IDeleteNotificationConfigRequest + | protos.google.cloud.securitycenter.v1p1beta1.IDeleteNotificationConfigRequest | undefined ), {} | undefined ] >; deleteNotificationConfig( - request: protosTypes.google.cloud.securitycenter.v1p1beta1.IDeleteNotificationConfigRequest, + request: protos.google.cloud.securitycenter.v1p1beta1.IDeleteNotificationConfigRequest, options: gax.CallOptions, callback: Callback< - protosTypes.google.protobuf.IEmpty, - | protosTypes.google.cloud.securitycenter.v1p1beta1.IDeleteNotificationConfigRequest + protos.google.protobuf.IEmpty, + | protos.google.cloud.securitycenter.v1p1beta1.IDeleteNotificationConfigRequest + | null | undefined, - {} | undefined + {} | null | undefined + > + ): void; + deleteNotificationConfig( + request: protos.google.cloud.securitycenter.v1p1beta1.IDeleteNotificationConfigRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.securitycenter.v1p1beta1.IDeleteNotificationConfigRequest + | null + | undefined, + {} | null | undefined > ): void; /** @@ -712,26 +759,28 @@ export class SecurityCenterClient { * The promise has a method named "cancel" which cancels the ongoing API call. */ deleteNotificationConfig( - request: protosTypes.google.cloud.securitycenter.v1p1beta1.IDeleteNotificationConfigRequest, + request: protos.google.cloud.securitycenter.v1p1beta1.IDeleteNotificationConfigRequest, optionsOrCallback?: | gax.CallOptions | Callback< - protosTypes.google.protobuf.IEmpty, - | protosTypes.google.cloud.securitycenter.v1p1beta1.IDeleteNotificationConfigRequest + protos.google.protobuf.IEmpty, + | protos.google.cloud.securitycenter.v1p1beta1.IDeleteNotificationConfigRequest + | null | undefined, - {} | undefined + {} | null | undefined >, callback?: Callback< - protosTypes.google.protobuf.IEmpty, - | protosTypes.google.cloud.securitycenter.v1p1beta1.IDeleteNotificationConfigRequest + protos.google.protobuf.IEmpty, + | protos.google.cloud.securitycenter.v1p1beta1.IDeleteNotificationConfigRequest + | null | undefined, - {} | undefined + {} | null | undefined > ): Promise< [ - protosTypes.google.protobuf.IEmpty, + protos.google.protobuf.IEmpty, ( - | protosTypes.google.cloud.securitycenter.v1p1beta1.IDeleteNotificationConfigRequest + | protos.google.cloud.securitycenter.v1p1beta1.IDeleteNotificationConfigRequest | undefined ), {} | undefined @@ -754,29 +803,37 @@ export class SecurityCenterClient { name: request.name || '', }); this.initialize(); - return this._innerApiCalls.deleteNotificationConfig( + return this.innerApiCalls.deleteNotificationConfig( request, options, callback ); } getIamPolicy( - request: protosTypes.google.iam.v1.IGetIamPolicyRequest, + request: protos.google.iam.v1.IGetIamPolicyRequest, options?: gax.CallOptions ): Promise< [ - protosTypes.google.iam.v1.IPolicy, - protosTypes.google.iam.v1.IGetIamPolicyRequest | undefined, + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest | undefined, {} | undefined ] >; getIamPolicy( - request: protosTypes.google.iam.v1.IGetIamPolicyRequest, + request: protos.google.iam.v1.IGetIamPolicyRequest, options: gax.CallOptions, callback: Callback< - protosTypes.google.iam.v1.IPolicy, - protosTypes.google.iam.v1.IGetIamPolicyRequest | undefined, - {} | undefined + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ): void; + getIamPolicy( + request: protos.google.iam.v1.IGetIamPolicyRequest, + callback: Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest | null | undefined, + {} | null | undefined > ): void; /** @@ -791,23 +848,23 @@ export class SecurityCenterClient { * The promise has a method named "cancel" which cancels the ongoing API call. */ getIamPolicy( - request: protosTypes.google.iam.v1.IGetIamPolicyRequest, + request: protos.google.iam.v1.IGetIamPolicyRequest, optionsOrCallback?: | gax.CallOptions | Callback< - protosTypes.google.iam.v1.IPolicy, - protosTypes.google.iam.v1.IGetIamPolicyRequest | undefined, - {} | undefined + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest | null | undefined, + {} | null | undefined >, callback?: Callback< - protosTypes.google.iam.v1.IPolicy, - protosTypes.google.iam.v1.IGetIamPolicyRequest | undefined, - {} | undefined + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest | null | undefined, + {} | null | undefined > ): Promise< [ - protosTypes.google.iam.v1.IPolicy, - protosTypes.google.iam.v1.IGetIamPolicyRequest | undefined, + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest | undefined, {} | undefined ] > | void { @@ -828,29 +885,40 @@ export class SecurityCenterClient { resource: request.resource || '', }); this.initialize(); - return this._innerApiCalls.getIamPolicy(request, options, callback); + return this.innerApiCalls.getIamPolicy(request, options, callback); } getNotificationConfig( - request: protosTypes.google.cloud.securitycenter.v1p1beta1.IGetNotificationConfigRequest, + request: protos.google.cloud.securitycenter.v1p1beta1.IGetNotificationConfigRequest, options?: gax.CallOptions ): Promise< [ - protosTypes.google.cloud.securitycenter.v1p1beta1.INotificationConfig, + protos.google.cloud.securitycenter.v1p1beta1.INotificationConfig, ( - | protosTypes.google.cloud.securitycenter.v1p1beta1.IGetNotificationConfigRequest + | protos.google.cloud.securitycenter.v1p1beta1.IGetNotificationConfigRequest | undefined ), {} | undefined ] >; getNotificationConfig( - request: protosTypes.google.cloud.securitycenter.v1p1beta1.IGetNotificationConfigRequest, + request: protos.google.cloud.securitycenter.v1p1beta1.IGetNotificationConfigRequest, options: gax.CallOptions, callback: Callback< - protosTypes.google.cloud.securitycenter.v1p1beta1.INotificationConfig, - | protosTypes.google.cloud.securitycenter.v1p1beta1.IGetNotificationConfigRequest + protos.google.cloud.securitycenter.v1p1beta1.INotificationConfig, + | protos.google.cloud.securitycenter.v1p1beta1.IGetNotificationConfigRequest + | null | undefined, - {} | undefined + {} | null | undefined + > + ): void; + getNotificationConfig( + request: protos.google.cloud.securitycenter.v1p1beta1.IGetNotificationConfigRequest, + callback: Callback< + protos.google.cloud.securitycenter.v1p1beta1.INotificationConfig, + | protos.google.cloud.securitycenter.v1p1beta1.IGetNotificationConfigRequest + | null + | undefined, + {} | null | undefined > ): void; /** @@ -868,26 +936,28 @@ export class SecurityCenterClient { * The promise has a method named "cancel" which cancels the ongoing API call. */ getNotificationConfig( - request: protosTypes.google.cloud.securitycenter.v1p1beta1.IGetNotificationConfigRequest, + request: protos.google.cloud.securitycenter.v1p1beta1.IGetNotificationConfigRequest, optionsOrCallback?: | gax.CallOptions | Callback< - protosTypes.google.cloud.securitycenter.v1p1beta1.INotificationConfig, - | protosTypes.google.cloud.securitycenter.v1p1beta1.IGetNotificationConfigRequest + protos.google.cloud.securitycenter.v1p1beta1.INotificationConfig, + | protos.google.cloud.securitycenter.v1p1beta1.IGetNotificationConfigRequest + | null | undefined, - {} | undefined + {} | null | undefined >, callback?: Callback< - protosTypes.google.cloud.securitycenter.v1p1beta1.INotificationConfig, - | protosTypes.google.cloud.securitycenter.v1p1beta1.IGetNotificationConfigRequest + protos.google.cloud.securitycenter.v1p1beta1.INotificationConfig, + | protos.google.cloud.securitycenter.v1p1beta1.IGetNotificationConfigRequest + | null | undefined, - {} | undefined + {} | null | undefined > ): Promise< [ - protosTypes.google.cloud.securitycenter.v1p1beta1.INotificationConfig, + protos.google.cloud.securitycenter.v1p1beta1.INotificationConfig, ( - | protosTypes.google.cloud.securitycenter.v1p1beta1.IGetNotificationConfigRequest + | protos.google.cloud.securitycenter.v1p1beta1.IGetNotificationConfigRequest | undefined ), {} | undefined @@ -910,33 +980,40 @@ export class SecurityCenterClient { name: request.name || '', }); this.initialize(); - return this._innerApiCalls.getNotificationConfig( - request, - options, - callback - ); + return this.innerApiCalls.getNotificationConfig(request, options, callback); } getOrganizationSettings( - request: protosTypes.google.cloud.securitycenter.v1p1beta1.IGetOrganizationSettingsRequest, + request: protos.google.cloud.securitycenter.v1p1beta1.IGetOrganizationSettingsRequest, options?: gax.CallOptions ): Promise< [ - protosTypes.google.cloud.securitycenter.v1p1beta1.IOrganizationSettings, + protos.google.cloud.securitycenter.v1p1beta1.IOrganizationSettings, ( - | protosTypes.google.cloud.securitycenter.v1p1beta1.IGetOrganizationSettingsRequest + | protos.google.cloud.securitycenter.v1p1beta1.IGetOrganizationSettingsRequest | undefined ), {} | undefined ] >; getOrganizationSettings( - request: protosTypes.google.cloud.securitycenter.v1p1beta1.IGetOrganizationSettingsRequest, + request: protos.google.cloud.securitycenter.v1p1beta1.IGetOrganizationSettingsRequest, options: gax.CallOptions, callback: Callback< - protosTypes.google.cloud.securitycenter.v1p1beta1.IOrganizationSettings, - | protosTypes.google.cloud.securitycenter.v1p1beta1.IGetOrganizationSettingsRequest + protos.google.cloud.securitycenter.v1p1beta1.IOrganizationSettings, + | protos.google.cloud.securitycenter.v1p1beta1.IGetOrganizationSettingsRequest + | null | undefined, - {} | undefined + {} | null | undefined + > + ): void; + getOrganizationSettings( + request: protos.google.cloud.securitycenter.v1p1beta1.IGetOrganizationSettingsRequest, + callback: Callback< + protos.google.cloud.securitycenter.v1p1beta1.IOrganizationSettings, + | protos.google.cloud.securitycenter.v1p1beta1.IGetOrganizationSettingsRequest + | null + | undefined, + {} | null | undefined > ): void; /** @@ -954,26 +1031,28 @@ export class SecurityCenterClient { * The promise has a method named "cancel" which cancels the ongoing API call. */ getOrganizationSettings( - request: protosTypes.google.cloud.securitycenter.v1p1beta1.IGetOrganizationSettingsRequest, + request: protos.google.cloud.securitycenter.v1p1beta1.IGetOrganizationSettingsRequest, optionsOrCallback?: | gax.CallOptions | Callback< - protosTypes.google.cloud.securitycenter.v1p1beta1.IOrganizationSettings, - | protosTypes.google.cloud.securitycenter.v1p1beta1.IGetOrganizationSettingsRequest + protos.google.cloud.securitycenter.v1p1beta1.IOrganizationSettings, + | protos.google.cloud.securitycenter.v1p1beta1.IGetOrganizationSettingsRequest + | null | undefined, - {} | undefined + {} | null | undefined >, callback?: Callback< - protosTypes.google.cloud.securitycenter.v1p1beta1.IOrganizationSettings, - | protosTypes.google.cloud.securitycenter.v1p1beta1.IGetOrganizationSettingsRequest + protos.google.cloud.securitycenter.v1p1beta1.IOrganizationSettings, + | protos.google.cloud.securitycenter.v1p1beta1.IGetOrganizationSettingsRequest + | null | undefined, - {} | undefined + {} | null | undefined > ): Promise< [ - protosTypes.google.cloud.securitycenter.v1p1beta1.IOrganizationSettings, + protos.google.cloud.securitycenter.v1p1beta1.IOrganizationSettings, ( - | protosTypes.google.cloud.securitycenter.v1p1beta1.IGetOrganizationSettingsRequest + | protos.google.cloud.securitycenter.v1p1beta1.IGetOrganizationSettingsRequest | undefined ), {} | undefined @@ -996,33 +1075,44 @@ export class SecurityCenterClient { name: request.name || '', }); this.initialize(); - return this._innerApiCalls.getOrganizationSettings( + return this.innerApiCalls.getOrganizationSettings( request, options, callback ); } getSource( - request: protosTypes.google.cloud.securitycenter.v1p1beta1.IGetSourceRequest, + request: protos.google.cloud.securitycenter.v1p1beta1.IGetSourceRequest, options?: gax.CallOptions ): Promise< [ - protosTypes.google.cloud.securitycenter.v1p1beta1.ISource, + protos.google.cloud.securitycenter.v1p1beta1.ISource, ( - | protosTypes.google.cloud.securitycenter.v1p1beta1.IGetSourceRequest + | protos.google.cloud.securitycenter.v1p1beta1.IGetSourceRequest | undefined ), {} | undefined ] >; getSource( - request: protosTypes.google.cloud.securitycenter.v1p1beta1.IGetSourceRequest, + request: protos.google.cloud.securitycenter.v1p1beta1.IGetSourceRequest, options: gax.CallOptions, callback: Callback< - protosTypes.google.cloud.securitycenter.v1p1beta1.ISource, - | protosTypes.google.cloud.securitycenter.v1p1beta1.IGetSourceRequest + protos.google.cloud.securitycenter.v1p1beta1.ISource, + | protos.google.cloud.securitycenter.v1p1beta1.IGetSourceRequest + | null | undefined, - {} | undefined + {} | null | undefined + > + ): void; + getSource( + request: protos.google.cloud.securitycenter.v1p1beta1.IGetSourceRequest, + callback: Callback< + protos.google.cloud.securitycenter.v1p1beta1.ISource, + | protos.google.cloud.securitycenter.v1p1beta1.IGetSourceRequest + | null + | undefined, + {} | null | undefined > ): void; /** @@ -1040,26 +1130,28 @@ export class SecurityCenterClient { * The promise has a method named "cancel" which cancels the ongoing API call. */ getSource( - request: protosTypes.google.cloud.securitycenter.v1p1beta1.IGetSourceRequest, + request: protos.google.cloud.securitycenter.v1p1beta1.IGetSourceRequest, optionsOrCallback?: | gax.CallOptions | Callback< - protosTypes.google.cloud.securitycenter.v1p1beta1.ISource, - | protosTypes.google.cloud.securitycenter.v1p1beta1.IGetSourceRequest + protos.google.cloud.securitycenter.v1p1beta1.ISource, + | protos.google.cloud.securitycenter.v1p1beta1.IGetSourceRequest + | null | undefined, - {} | undefined + {} | null | undefined >, callback?: Callback< - protosTypes.google.cloud.securitycenter.v1p1beta1.ISource, - | protosTypes.google.cloud.securitycenter.v1p1beta1.IGetSourceRequest + protos.google.cloud.securitycenter.v1p1beta1.ISource, + | protos.google.cloud.securitycenter.v1p1beta1.IGetSourceRequest + | null | undefined, - {} | undefined + {} | null | undefined > ): Promise< [ - protosTypes.google.cloud.securitycenter.v1p1beta1.ISource, + protos.google.cloud.securitycenter.v1p1beta1.ISource, ( - | protosTypes.google.cloud.securitycenter.v1p1beta1.IGetSourceRequest + | protos.google.cloud.securitycenter.v1p1beta1.IGetSourceRequest | undefined ), {} | undefined @@ -1082,29 +1174,40 @@ export class SecurityCenterClient { name: request.name || '', }); this.initialize(); - return this._innerApiCalls.getSource(request, options, callback); + return this.innerApiCalls.getSource(request, options, callback); } setFindingState( - request: protosTypes.google.cloud.securitycenter.v1p1beta1.ISetFindingStateRequest, + request: protos.google.cloud.securitycenter.v1p1beta1.ISetFindingStateRequest, options?: gax.CallOptions ): Promise< [ - protosTypes.google.cloud.securitycenter.v1p1beta1.IFinding, + protos.google.cloud.securitycenter.v1p1beta1.IFinding, ( - | protosTypes.google.cloud.securitycenter.v1p1beta1.ISetFindingStateRequest + | protos.google.cloud.securitycenter.v1p1beta1.ISetFindingStateRequest | undefined ), {} | undefined ] >; setFindingState( - request: protosTypes.google.cloud.securitycenter.v1p1beta1.ISetFindingStateRequest, + request: protos.google.cloud.securitycenter.v1p1beta1.ISetFindingStateRequest, options: gax.CallOptions, callback: Callback< - protosTypes.google.cloud.securitycenter.v1p1beta1.IFinding, - | protosTypes.google.cloud.securitycenter.v1p1beta1.ISetFindingStateRequest + protos.google.cloud.securitycenter.v1p1beta1.IFinding, + | protos.google.cloud.securitycenter.v1p1beta1.ISetFindingStateRequest + | null | undefined, - {} | undefined + {} | null | undefined + > + ): void; + setFindingState( + request: protos.google.cloud.securitycenter.v1p1beta1.ISetFindingStateRequest, + callback: Callback< + protos.google.cloud.securitycenter.v1p1beta1.IFinding, + | protos.google.cloud.securitycenter.v1p1beta1.ISetFindingStateRequest + | null + | undefined, + {} | null | undefined > ): void; /** @@ -1129,26 +1232,28 @@ export class SecurityCenterClient { * The promise has a method named "cancel" which cancels the ongoing API call. */ setFindingState( - request: protosTypes.google.cloud.securitycenter.v1p1beta1.ISetFindingStateRequest, + request: protos.google.cloud.securitycenter.v1p1beta1.ISetFindingStateRequest, optionsOrCallback?: | gax.CallOptions | Callback< - protosTypes.google.cloud.securitycenter.v1p1beta1.IFinding, - | protosTypes.google.cloud.securitycenter.v1p1beta1.ISetFindingStateRequest + protos.google.cloud.securitycenter.v1p1beta1.IFinding, + | protos.google.cloud.securitycenter.v1p1beta1.ISetFindingStateRequest + | null | undefined, - {} | undefined + {} | null | undefined >, callback?: Callback< - protosTypes.google.cloud.securitycenter.v1p1beta1.IFinding, - | protosTypes.google.cloud.securitycenter.v1p1beta1.ISetFindingStateRequest + protos.google.cloud.securitycenter.v1p1beta1.IFinding, + | protos.google.cloud.securitycenter.v1p1beta1.ISetFindingStateRequest + | null | undefined, - {} | undefined + {} | null | undefined > ): Promise< [ - protosTypes.google.cloud.securitycenter.v1p1beta1.IFinding, + protos.google.cloud.securitycenter.v1p1beta1.IFinding, ( - | protosTypes.google.cloud.securitycenter.v1p1beta1.ISetFindingStateRequest + | protos.google.cloud.securitycenter.v1p1beta1.ISetFindingStateRequest | undefined ), {} | undefined @@ -1171,25 +1276,33 @@ export class SecurityCenterClient { name: request.name || '', }); this.initialize(); - return this._innerApiCalls.setFindingState(request, options, callback); + return this.innerApiCalls.setFindingState(request, options, callback); } setIamPolicy( - request: protosTypes.google.iam.v1.ISetIamPolicyRequest, + request: protos.google.iam.v1.ISetIamPolicyRequest, options?: gax.CallOptions ): Promise< [ - protosTypes.google.iam.v1.IPolicy, - protosTypes.google.iam.v1.ISetIamPolicyRequest | undefined, + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest | undefined, {} | undefined ] >; setIamPolicy( - request: protosTypes.google.iam.v1.ISetIamPolicyRequest, + request: protos.google.iam.v1.ISetIamPolicyRequest, options: gax.CallOptions, callback: Callback< - protosTypes.google.iam.v1.IPolicy, - protosTypes.google.iam.v1.ISetIamPolicyRequest | undefined, - {} | undefined + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ): void; + setIamPolicy( + request: protos.google.iam.v1.ISetIamPolicyRequest, + callback: Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest | null | undefined, + {} | null | undefined > ): void; /** @@ -1204,23 +1317,23 @@ export class SecurityCenterClient { * The promise has a method named "cancel" which cancels the ongoing API call. */ setIamPolicy( - request: protosTypes.google.iam.v1.ISetIamPolicyRequest, + request: protos.google.iam.v1.ISetIamPolicyRequest, optionsOrCallback?: | gax.CallOptions | Callback< - protosTypes.google.iam.v1.IPolicy, - protosTypes.google.iam.v1.ISetIamPolicyRequest | undefined, - {} | undefined + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest | null | undefined, + {} | null | undefined >, callback?: Callback< - protosTypes.google.iam.v1.IPolicy, - protosTypes.google.iam.v1.ISetIamPolicyRequest | undefined, - {} | undefined + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest | null | undefined, + {} | null | undefined > ): Promise< [ - protosTypes.google.iam.v1.IPolicy, - protosTypes.google.iam.v1.ISetIamPolicyRequest | undefined, + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest | undefined, {} | undefined ] > | void { @@ -1241,25 +1354,33 @@ export class SecurityCenterClient { resource: request.resource || '', }); this.initialize(); - return this._innerApiCalls.setIamPolicy(request, options, callback); + return this.innerApiCalls.setIamPolicy(request, options, callback); } testIamPermissions( - request: protosTypes.google.iam.v1.ITestIamPermissionsRequest, + request: protos.google.iam.v1.ITestIamPermissionsRequest, options?: gax.CallOptions ): Promise< [ - protosTypes.google.iam.v1.ITestIamPermissionsResponse, - protosTypes.google.iam.v1.ITestIamPermissionsRequest | undefined, + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest | undefined, {} | undefined ] >; testIamPermissions( - request: protosTypes.google.iam.v1.ITestIamPermissionsRequest, + request: protos.google.iam.v1.ITestIamPermissionsRequest, options: gax.CallOptions, callback: Callback< - protosTypes.google.iam.v1.ITestIamPermissionsResponse, - protosTypes.google.iam.v1.ITestIamPermissionsRequest | undefined, - {} | undefined + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest | null | undefined, + {} | null | undefined + > + ): void; + testIamPermissions( + request: protos.google.iam.v1.ITestIamPermissionsRequest, + callback: Callback< + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest | null | undefined, + {} | null | undefined > ): void; /** @@ -1274,23 +1395,23 @@ export class SecurityCenterClient { * The promise has a method named "cancel" which cancels the ongoing API call. */ testIamPermissions( - request: protosTypes.google.iam.v1.ITestIamPermissionsRequest, + request: protos.google.iam.v1.ITestIamPermissionsRequest, optionsOrCallback?: | gax.CallOptions | Callback< - protosTypes.google.iam.v1.ITestIamPermissionsResponse, - protosTypes.google.iam.v1.ITestIamPermissionsRequest | undefined, - {} | undefined + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest | null | undefined, + {} | null | undefined >, callback?: Callback< - protosTypes.google.iam.v1.ITestIamPermissionsResponse, - protosTypes.google.iam.v1.ITestIamPermissionsRequest | undefined, - {} | undefined + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest | null | undefined, + {} | null | undefined > ): Promise< [ - protosTypes.google.iam.v1.ITestIamPermissionsResponse, - protosTypes.google.iam.v1.ITestIamPermissionsRequest | undefined, + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest | undefined, {} | undefined ] > | void { @@ -1311,29 +1432,40 @@ export class SecurityCenterClient { resource: request.resource || '', }); this.initialize(); - return this._innerApiCalls.testIamPermissions(request, options, callback); + return this.innerApiCalls.testIamPermissions(request, options, callback); } updateFinding( - request: protosTypes.google.cloud.securitycenter.v1p1beta1.IUpdateFindingRequest, + request: protos.google.cloud.securitycenter.v1p1beta1.IUpdateFindingRequest, options?: gax.CallOptions ): Promise< [ - protosTypes.google.cloud.securitycenter.v1p1beta1.IFinding, + protos.google.cloud.securitycenter.v1p1beta1.IFinding, ( - | protosTypes.google.cloud.securitycenter.v1p1beta1.IUpdateFindingRequest + | protos.google.cloud.securitycenter.v1p1beta1.IUpdateFindingRequest | undefined ), {} | undefined ] >; updateFinding( - request: protosTypes.google.cloud.securitycenter.v1p1beta1.IUpdateFindingRequest, + request: protos.google.cloud.securitycenter.v1p1beta1.IUpdateFindingRequest, options: gax.CallOptions, callback: Callback< - protosTypes.google.cloud.securitycenter.v1p1beta1.IFinding, - | protosTypes.google.cloud.securitycenter.v1p1beta1.IUpdateFindingRequest + protos.google.cloud.securitycenter.v1p1beta1.IFinding, + | protos.google.cloud.securitycenter.v1p1beta1.IUpdateFindingRequest + | null | undefined, - {} | undefined + {} | null | undefined + > + ): void; + updateFinding( + request: protos.google.cloud.securitycenter.v1p1beta1.IUpdateFindingRequest, + callback: Callback< + protos.google.cloud.securitycenter.v1p1beta1.IFinding, + | protos.google.cloud.securitycenter.v1p1beta1.IUpdateFindingRequest + | null + | undefined, + {} | null | undefined > ): void; /** @@ -1365,26 +1497,28 @@ export class SecurityCenterClient { * The promise has a method named "cancel" which cancels the ongoing API call. */ updateFinding( - request: protosTypes.google.cloud.securitycenter.v1p1beta1.IUpdateFindingRequest, + request: protos.google.cloud.securitycenter.v1p1beta1.IUpdateFindingRequest, optionsOrCallback?: | gax.CallOptions | Callback< - protosTypes.google.cloud.securitycenter.v1p1beta1.IFinding, - | protosTypes.google.cloud.securitycenter.v1p1beta1.IUpdateFindingRequest + protos.google.cloud.securitycenter.v1p1beta1.IFinding, + | protos.google.cloud.securitycenter.v1p1beta1.IUpdateFindingRequest + | null | undefined, - {} | undefined + {} | null | undefined >, callback?: Callback< - protosTypes.google.cloud.securitycenter.v1p1beta1.IFinding, - | protosTypes.google.cloud.securitycenter.v1p1beta1.IUpdateFindingRequest + protos.google.cloud.securitycenter.v1p1beta1.IFinding, + | protos.google.cloud.securitycenter.v1p1beta1.IUpdateFindingRequest + | null | undefined, - {} | undefined + {} | null | undefined > ): Promise< [ - protosTypes.google.cloud.securitycenter.v1p1beta1.IFinding, + protos.google.cloud.securitycenter.v1p1beta1.IFinding, ( - | protosTypes.google.cloud.securitycenter.v1p1beta1.IUpdateFindingRequest + | protos.google.cloud.securitycenter.v1p1beta1.IUpdateFindingRequest | undefined ), {} | undefined @@ -1407,29 +1541,40 @@ export class SecurityCenterClient { 'finding.name': request.finding!.name || '', }); this.initialize(); - return this._innerApiCalls.updateFinding(request, options, callback); + return this.innerApiCalls.updateFinding(request, options, callback); } updateNotificationConfig( - request: protosTypes.google.cloud.securitycenter.v1p1beta1.IUpdateNotificationConfigRequest, + request: protos.google.cloud.securitycenter.v1p1beta1.IUpdateNotificationConfigRequest, options?: gax.CallOptions ): Promise< [ - protosTypes.google.cloud.securitycenter.v1p1beta1.INotificationConfig, + protos.google.cloud.securitycenter.v1p1beta1.INotificationConfig, ( - | protosTypes.google.cloud.securitycenter.v1p1beta1.IUpdateNotificationConfigRequest + | protos.google.cloud.securitycenter.v1p1beta1.IUpdateNotificationConfigRequest | undefined ), {} | undefined ] >; updateNotificationConfig( - request: protosTypes.google.cloud.securitycenter.v1p1beta1.IUpdateNotificationConfigRequest, + request: protos.google.cloud.securitycenter.v1p1beta1.IUpdateNotificationConfigRequest, options: gax.CallOptions, callback: Callback< - protosTypes.google.cloud.securitycenter.v1p1beta1.INotificationConfig, - | protosTypes.google.cloud.securitycenter.v1p1beta1.IUpdateNotificationConfigRequest + protos.google.cloud.securitycenter.v1p1beta1.INotificationConfig, + | protos.google.cloud.securitycenter.v1p1beta1.IUpdateNotificationConfigRequest + | null | undefined, - {} | undefined + {} | null | undefined + > + ): void; + updateNotificationConfig( + request: protos.google.cloud.securitycenter.v1p1beta1.IUpdateNotificationConfigRequest, + callback: Callback< + protos.google.cloud.securitycenter.v1p1beta1.INotificationConfig, + | protos.google.cloud.securitycenter.v1p1beta1.IUpdateNotificationConfigRequest + | null + | undefined, + {} | null | undefined > ): void; /** @@ -1450,26 +1595,28 @@ export class SecurityCenterClient { * The promise has a method named "cancel" which cancels the ongoing API call. */ updateNotificationConfig( - request: protosTypes.google.cloud.securitycenter.v1p1beta1.IUpdateNotificationConfigRequest, + request: protos.google.cloud.securitycenter.v1p1beta1.IUpdateNotificationConfigRequest, optionsOrCallback?: | gax.CallOptions | Callback< - protosTypes.google.cloud.securitycenter.v1p1beta1.INotificationConfig, - | protosTypes.google.cloud.securitycenter.v1p1beta1.IUpdateNotificationConfigRequest + protos.google.cloud.securitycenter.v1p1beta1.INotificationConfig, + | protos.google.cloud.securitycenter.v1p1beta1.IUpdateNotificationConfigRequest + | null | undefined, - {} | undefined + {} | null | undefined >, callback?: Callback< - protosTypes.google.cloud.securitycenter.v1p1beta1.INotificationConfig, - | protosTypes.google.cloud.securitycenter.v1p1beta1.IUpdateNotificationConfigRequest + protos.google.cloud.securitycenter.v1p1beta1.INotificationConfig, + | protos.google.cloud.securitycenter.v1p1beta1.IUpdateNotificationConfigRequest + | null | undefined, - {} | undefined + {} | null | undefined > ): Promise< [ - protosTypes.google.cloud.securitycenter.v1p1beta1.INotificationConfig, + protos.google.cloud.securitycenter.v1p1beta1.INotificationConfig, ( - | protosTypes.google.cloud.securitycenter.v1p1beta1.IUpdateNotificationConfigRequest + | protos.google.cloud.securitycenter.v1p1beta1.IUpdateNotificationConfigRequest | undefined ), {} | undefined @@ -1492,33 +1639,44 @@ export class SecurityCenterClient { 'notification_config.name': request.notificationConfig!.name || '', }); this.initialize(); - return this._innerApiCalls.updateNotificationConfig( + return this.innerApiCalls.updateNotificationConfig( request, options, callback ); } updateOrganizationSettings( - request: protosTypes.google.cloud.securitycenter.v1p1beta1.IUpdateOrganizationSettingsRequest, + request: protos.google.cloud.securitycenter.v1p1beta1.IUpdateOrganizationSettingsRequest, options?: gax.CallOptions ): Promise< [ - protosTypes.google.cloud.securitycenter.v1p1beta1.IOrganizationSettings, + protos.google.cloud.securitycenter.v1p1beta1.IOrganizationSettings, ( - | protosTypes.google.cloud.securitycenter.v1p1beta1.IUpdateOrganizationSettingsRequest + | protos.google.cloud.securitycenter.v1p1beta1.IUpdateOrganizationSettingsRequest | undefined ), {} | undefined ] >; updateOrganizationSettings( - request: protosTypes.google.cloud.securitycenter.v1p1beta1.IUpdateOrganizationSettingsRequest, + request: protos.google.cloud.securitycenter.v1p1beta1.IUpdateOrganizationSettingsRequest, options: gax.CallOptions, callback: Callback< - protosTypes.google.cloud.securitycenter.v1p1beta1.IOrganizationSettings, - | protosTypes.google.cloud.securitycenter.v1p1beta1.IUpdateOrganizationSettingsRequest + protos.google.cloud.securitycenter.v1p1beta1.IOrganizationSettings, + | protos.google.cloud.securitycenter.v1p1beta1.IUpdateOrganizationSettingsRequest + | null | undefined, - {} | undefined + {} | null | undefined + > + ): void; + updateOrganizationSettings( + request: protos.google.cloud.securitycenter.v1p1beta1.IUpdateOrganizationSettingsRequest, + callback: Callback< + protos.google.cloud.securitycenter.v1p1beta1.IOrganizationSettings, + | protos.google.cloud.securitycenter.v1p1beta1.IUpdateOrganizationSettingsRequest + | null + | undefined, + {} | null | undefined > ): void; /** @@ -1539,26 +1697,28 @@ export class SecurityCenterClient { * The promise has a method named "cancel" which cancels the ongoing API call. */ updateOrganizationSettings( - request: protosTypes.google.cloud.securitycenter.v1p1beta1.IUpdateOrganizationSettingsRequest, + request: protos.google.cloud.securitycenter.v1p1beta1.IUpdateOrganizationSettingsRequest, optionsOrCallback?: | gax.CallOptions | Callback< - protosTypes.google.cloud.securitycenter.v1p1beta1.IOrganizationSettings, - | protosTypes.google.cloud.securitycenter.v1p1beta1.IUpdateOrganizationSettingsRequest + protos.google.cloud.securitycenter.v1p1beta1.IOrganizationSettings, + | protos.google.cloud.securitycenter.v1p1beta1.IUpdateOrganizationSettingsRequest + | null | undefined, - {} | undefined + {} | null | undefined >, callback?: Callback< - protosTypes.google.cloud.securitycenter.v1p1beta1.IOrganizationSettings, - | protosTypes.google.cloud.securitycenter.v1p1beta1.IUpdateOrganizationSettingsRequest + protos.google.cloud.securitycenter.v1p1beta1.IOrganizationSettings, + | protos.google.cloud.securitycenter.v1p1beta1.IUpdateOrganizationSettingsRequest + | null | undefined, - {} | undefined + {} | null | undefined > ): Promise< [ - protosTypes.google.cloud.securitycenter.v1p1beta1.IOrganizationSettings, + protos.google.cloud.securitycenter.v1p1beta1.IOrganizationSettings, ( - | protosTypes.google.cloud.securitycenter.v1p1beta1.IUpdateOrganizationSettingsRequest + | protos.google.cloud.securitycenter.v1p1beta1.IUpdateOrganizationSettingsRequest | undefined ), {} | undefined @@ -1581,33 +1741,44 @@ export class SecurityCenterClient { 'organization_settings.name': request.organizationSettings!.name || '', }); this.initialize(); - return this._innerApiCalls.updateOrganizationSettings( + return this.innerApiCalls.updateOrganizationSettings( request, options, callback ); } updateSource( - request: protosTypes.google.cloud.securitycenter.v1p1beta1.IUpdateSourceRequest, + request: protos.google.cloud.securitycenter.v1p1beta1.IUpdateSourceRequest, options?: gax.CallOptions ): Promise< [ - protosTypes.google.cloud.securitycenter.v1p1beta1.ISource, + protos.google.cloud.securitycenter.v1p1beta1.ISource, ( - | protosTypes.google.cloud.securitycenter.v1p1beta1.IUpdateSourceRequest + | protos.google.cloud.securitycenter.v1p1beta1.IUpdateSourceRequest | undefined ), {} | undefined ] >; updateSource( - request: protosTypes.google.cloud.securitycenter.v1p1beta1.IUpdateSourceRequest, + request: protos.google.cloud.securitycenter.v1p1beta1.IUpdateSourceRequest, options: gax.CallOptions, callback: Callback< - protosTypes.google.cloud.securitycenter.v1p1beta1.ISource, - | protosTypes.google.cloud.securitycenter.v1p1beta1.IUpdateSourceRequest + protos.google.cloud.securitycenter.v1p1beta1.ISource, + | protos.google.cloud.securitycenter.v1p1beta1.IUpdateSourceRequest + | null | undefined, - {} | undefined + {} | null | undefined + > + ): void; + updateSource( + request: protos.google.cloud.securitycenter.v1p1beta1.IUpdateSourceRequest, + callback: Callback< + protos.google.cloud.securitycenter.v1p1beta1.ISource, + | protos.google.cloud.securitycenter.v1p1beta1.IUpdateSourceRequest + | null + | undefined, + {} | null | undefined > ): void; /** @@ -1628,26 +1799,28 @@ export class SecurityCenterClient { * The promise has a method named "cancel" which cancels the ongoing API call. */ updateSource( - request: protosTypes.google.cloud.securitycenter.v1p1beta1.IUpdateSourceRequest, + request: protos.google.cloud.securitycenter.v1p1beta1.IUpdateSourceRequest, optionsOrCallback?: | gax.CallOptions | Callback< - protosTypes.google.cloud.securitycenter.v1p1beta1.ISource, - | protosTypes.google.cloud.securitycenter.v1p1beta1.IUpdateSourceRequest + protos.google.cloud.securitycenter.v1p1beta1.ISource, + | protos.google.cloud.securitycenter.v1p1beta1.IUpdateSourceRequest + | null | undefined, - {} | undefined + {} | null | undefined >, callback?: Callback< - protosTypes.google.cloud.securitycenter.v1p1beta1.ISource, - | protosTypes.google.cloud.securitycenter.v1p1beta1.IUpdateSourceRequest + protos.google.cloud.securitycenter.v1p1beta1.ISource, + | protos.google.cloud.securitycenter.v1p1beta1.IUpdateSourceRequest + | null | undefined, - {} | undefined + {} | null | undefined > ): Promise< [ - protosTypes.google.cloud.securitycenter.v1p1beta1.ISource, + protos.google.cloud.securitycenter.v1p1beta1.ISource, ( - | protosTypes.google.cloud.securitycenter.v1p1beta1.IUpdateSourceRequest + | protos.google.cloud.securitycenter.v1p1beta1.IUpdateSourceRequest | undefined ), {} | undefined @@ -1670,29 +1843,40 @@ export class SecurityCenterClient { 'source.name': request.source!.name || '', }); this.initialize(); - return this._innerApiCalls.updateSource(request, options, callback); + return this.innerApiCalls.updateSource(request, options, callback); } updateSecurityMarks( - request: protosTypes.google.cloud.securitycenter.v1p1beta1.IUpdateSecurityMarksRequest, + request: protos.google.cloud.securitycenter.v1p1beta1.IUpdateSecurityMarksRequest, options?: gax.CallOptions ): Promise< [ - protosTypes.google.cloud.securitycenter.v1p1beta1.ISecurityMarks, + protos.google.cloud.securitycenter.v1p1beta1.ISecurityMarks, ( - | protosTypes.google.cloud.securitycenter.v1p1beta1.IUpdateSecurityMarksRequest + | protos.google.cloud.securitycenter.v1p1beta1.IUpdateSecurityMarksRequest | undefined ), {} | undefined ] >; updateSecurityMarks( - request: protosTypes.google.cloud.securitycenter.v1p1beta1.IUpdateSecurityMarksRequest, + request: protos.google.cloud.securitycenter.v1p1beta1.IUpdateSecurityMarksRequest, options: gax.CallOptions, callback: Callback< - protosTypes.google.cloud.securitycenter.v1p1beta1.ISecurityMarks, - | protosTypes.google.cloud.securitycenter.v1p1beta1.IUpdateSecurityMarksRequest + protos.google.cloud.securitycenter.v1p1beta1.ISecurityMarks, + | protos.google.cloud.securitycenter.v1p1beta1.IUpdateSecurityMarksRequest + | null | undefined, - {} | undefined + {} | null | undefined + > + ): void; + updateSecurityMarks( + request: protos.google.cloud.securitycenter.v1p1beta1.IUpdateSecurityMarksRequest, + callback: Callback< + protos.google.cloud.securitycenter.v1p1beta1.ISecurityMarks, + | protos.google.cloud.securitycenter.v1p1beta1.IUpdateSecurityMarksRequest + | null + | undefined, + {} | null | undefined > ): void; /** @@ -1719,26 +1903,28 @@ export class SecurityCenterClient { * The promise has a method named "cancel" which cancels the ongoing API call. */ updateSecurityMarks( - request: protosTypes.google.cloud.securitycenter.v1p1beta1.IUpdateSecurityMarksRequest, + request: protos.google.cloud.securitycenter.v1p1beta1.IUpdateSecurityMarksRequest, optionsOrCallback?: | gax.CallOptions | Callback< - protosTypes.google.cloud.securitycenter.v1p1beta1.ISecurityMarks, - | protosTypes.google.cloud.securitycenter.v1p1beta1.IUpdateSecurityMarksRequest + protos.google.cloud.securitycenter.v1p1beta1.ISecurityMarks, + | protos.google.cloud.securitycenter.v1p1beta1.IUpdateSecurityMarksRequest + | null | undefined, - {} | undefined + {} | null | undefined >, callback?: Callback< - protosTypes.google.cloud.securitycenter.v1p1beta1.ISecurityMarks, - | protosTypes.google.cloud.securitycenter.v1p1beta1.IUpdateSecurityMarksRequest + protos.google.cloud.securitycenter.v1p1beta1.ISecurityMarks, + | protos.google.cloud.securitycenter.v1p1beta1.IUpdateSecurityMarksRequest + | null | undefined, - {} | undefined + {} | null | undefined > ): Promise< [ - protosTypes.google.cloud.securitycenter.v1p1beta1.ISecurityMarks, + protos.google.cloud.securitycenter.v1p1beta1.ISecurityMarks, ( - | protosTypes.google.cloud.securitycenter.v1p1beta1.IUpdateSecurityMarksRequest + | protos.google.cloud.securitycenter.v1p1beta1.IUpdateSecurityMarksRequest | undefined ), {} | undefined @@ -1761,32 +1947,43 @@ export class SecurityCenterClient { 'security_marks.name': request.securityMarks!.name || '', }); this.initialize(); - return this._innerApiCalls.updateSecurityMarks(request, options, callback); + return this.innerApiCalls.updateSecurityMarks(request, options, callback); } runAssetDiscovery( - request: protosTypes.google.cloud.securitycenter.v1p1beta1.IRunAssetDiscoveryRequest, + request: protos.google.cloud.securitycenter.v1p1beta1.IRunAssetDiscoveryRequest, options?: gax.CallOptions ): Promise< [ LROperation< - protosTypes.google.cloud.securitycenter.v1p1beta1.IRunAssetDiscoveryResponse, - protosTypes.google.protobuf.IEmpty + protos.google.cloud.securitycenter.v1p1beta1.IRunAssetDiscoveryResponse, + protos.google.protobuf.IEmpty >, - protosTypes.google.longrunning.IOperation | undefined, + protos.google.longrunning.IOperation | undefined, {} | undefined ] >; runAssetDiscovery( - request: protosTypes.google.cloud.securitycenter.v1p1beta1.IRunAssetDiscoveryRequest, + request: protos.google.cloud.securitycenter.v1p1beta1.IRunAssetDiscoveryRequest, options: gax.CallOptions, callback: Callback< LROperation< - protosTypes.google.cloud.securitycenter.v1p1beta1.IRunAssetDiscoveryResponse, - protosTypes.google.protobuf.IEmpty + protos.google.cloud.securitycenter.v1p1beta1.IRunAssetDiscoveryResponse, + protos.google.protobuf.IEmpty >, - protosTypes.google.longrunning.IOperation | undefined, - {} | undefined + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + runAssetDiscovery( + request: protos.google.cloud.securitycenter.v1p1beta1.IRunAssetDiscoveryRequest, + callback: Callback< + LROperation< + protos.google.cloud.securitycenter.v1p1beta1.IRunAssetDiscoveryResponse, + protos.google.protobuf.IEmpty + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined > ): void; /** @@ -1809,32 +2006,32 @@ export class SecurityCenterClient { * The promise has a method named "cancel" which cancels the ongoing API call. */ runAssetDiscovery( - request: protosTypes.google.cloud.securitycenter.v1p1beta1.IRunAssetDiscoveryRequest, + request: protos.google.cloud.securitycenter.v1p1beta1.IRunAssetDiscoveryRequest, optionsOrCallback?: | gax.CallOptions | Callback< LROperation< - protosTypes.google.cloud.securitycenter.v1p1beta1.IRunAssetDiscoveryResponse, - protosTypes.google.protobuf.IEmpty + protos.google.cloud.securitycenter.v1p1beta1.IRunAssetDiscoveryResponse, + protos.google.protobuf.IEmpty >, - protosTypes.google.longrunning.IOperation | undefined, - {} | undefined + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined >, callback?: Callback< LROperation< - protosTypes.google.cloud.securitycenter.v1p1beta1.IRunAssetDiscoveryResponse, - protosTypes.google.protobuf.IEmpty + protos.google.cloud.securitycenter.v1p1beta1.IRunAssetDiscoveryResponse, + protos.google.protobuf.IEmpty >, - protosTypes.google.longrunning.IOperation | undefined, - {} | undefined + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined > ): Promise< [ LROperation< - protosTypes.google.cloud.securitycenter.v1p1beta1.IRunAssetDiscoveryResponse, - protosTypes.google.protobuf.IEmpty + protos.google.cloud.securitycenter.v1p1beta1.IRunAssetDiscoveryResponse, + protos.google.protobuf.IEmpty >, - protosTypes.google.longrunning.IOperation | undefined, + protos.google.longrunning.IOperation | undefined, {} | undefined ] > | void { @@ -1855,25 +2052,37 @@ export class SecurityCenterClient { parent: request.parent || '', }); this.initialize(); - return this._innerApiCalls.runAssetDiscovery(request, options, callback); + return this.innerApiCalls.runAssetDiscovery(request, options, callback); } groupAssets( - request: protosTypes.google.cloud.securitycenter.v1p1beta1.IGroupAssetsRequest, + request: protos.google.cloud.securitycenter.v1p1beta1.IGroupAssetsRequest, options?: gax.CallOptions ): Promise< [ - protosTypes.google.cloud.securitycenter.v1p1beta1.IGroupResult[], - protosTypes.google.cloud.securitycenter.v1p1beta1.IGroupAssetsRequest | null, - protosTypes.google.cloud.securitycenter.v1p1beta1.IGroupAssetsResponse + protos.google.cloud.securitycenter.v1p1beta1.IGroupResult[], + protos.google.cloud.securitycenter.v1p1beta1.IGroupAssetsRequest | null, + protos.google.cloud.securitycenter.v1p1beta1.IGroupAssetsResponse ] >; groupAssets( - request: protosTypes.google.cloud.securitycenter.v1p1beta1.IGroupAssetsRequest, + request: protos.google.cloud.securitycenter.v1p1beta1.IGroupAssetsRequest, options: gax.CallOptions, - callback: Callback< - protosTypes.google.cloud.securitycenter.v1p1beta1.IGroupResult[], - protosTypes.google.cloud.securitycenter.v1p1beta1.IGroupAssetsRequest | null, - protosTypes.google.cloud.securitycenter.v1p1beta1.IGroupAssetsResponse + callback: PaginationCallback< + protos.google.cloud.securitycenter.v1p1beta1.IGroupAssetsRequest, + | protos.google.cloud.securitycenter.v1p1beta1.IGroupAssetsResponse + | null + | undefined, + protos.google.cloud.securitycenter.v1p1beta1.IGroupResult + > + ): void; + groupAssets( + request: protos.google.cloud.securitycenter.v1p1beta1.IGroupAssetsRequest, + callback: PaginationCallback< + protos.google.cloud.securitycenter.v1p1beta1.IGroupAssetsRequest, + | protos.google.cloud.securitycenter.v1p1beta1.IGroupAssetsResponse + | null + | undefined, + protos.google.cloud.securitycenter.v1p1beta1.IGroupResult > ): void; /** @@ -2024,24 +2233,28 @@ export class SecurityCenterClient { * The promise has a method named "cancel" which cancels the ongoing API call. */ groupAssets( - request: protosTypes.google.cloud.securitycenter.v1p1beta1.IGroupAssetsRequest, + request: protos.google.cloud.securitycenter.v1p1beta1.IGroupAssetsRequest, optionsOrCallback?: | gax.CallOptions - | Callback< - protosTypes.google.cloud.securitycenter.v1p1beta1.IGroupResult[], - protosTypes.google.cloud.securitycenter.v1p1beta1.IGroupAssetsRequest | null, - protosTypes.google.cloud.securitycenter.v1p1beta1.IGroupAssetsResponse + | PaginationCallback< + protos.google.cloud.securitycenter.v1p1beta1.IGroupAssetsRequest, + | protos.google.cloud.securitycenter.v1p1beta1.IGroupAssetsResponse + | null + | undefined, + protos.google.cloud.securitycenter.v1p1beta1.IGroupResult >, - callback?: Callback< - protosTypes.google.cloud.securitycenter.v1p1beta1.IGroupResult[], - protosTypes.google.cloud.securitycenter.v1p1beta1.IGroupAssetsRequest | null, - protosTypes.google.cloud.securitycenter.v1p1beta1.IGroupAssetsResponse + callback?: PaginationCallback< + protos.google.cloud.securitycenter.v1p1beta1.IGroupAssetsRequest, + | protos.google.cloud.securitycenter.v1p1beta1.IGroupAssetsResponse + | null + | undefined, + protos.google.cloud.securitycenter.v1p1beta1.IGroupResult > ): Promise< [ - protosTypes.google.cloud.securitycenter.v1p1beta1.IGroupResult[], - protosTypes.google.cloud.securitycenter.v1p1beta1.IGroupAssetsRequest | null, - protosTypes.google.cloud.securitycenter.v1p1beta1.IGroupAssetsResponse + protos.google.cloud.securitycenter.v1p1beta1.IGroupResult[], + protos.google.cloud.securitycenter.v1p1beta1.IGroupAssetsRequest | null, + protos.google.cloud.securitycenter.v1p1beta1.IGroupAssetsResponse ] > | void { request = request || {}; @@ -2061,7 +2274,7 @@ export class SecurityCenterClient { parent: request.parent || '', }); this.initialize(); - return this._innerApiCalls.groupAssets(request, options, callback); + return this.innerApiCalls.groupAssets(request, options, callback); } /** @@ -2208,7 +2421,7 @@ export class SecurityCenterClient { * An object stream which emits an object representing [GroupResult]{@link google.cloud.securitycenter.v1p1beta1.GroupResult} on 'data' event. */ groupAssetsStream( - request?: protosTypes.google.cloud.securitycenter.v1p1beta1.IGroupAssetsRequest, + request?: protos.google.cloud.securitycenter.v1p1beta1.IGroupAssetsRequest, options?: gax.CallOptions ): Transform { request = request || {}; @@ -2222,57 +2435,37 @@ export class SecurityCenterClient { }); const callSettings = new gax.CallSettings(options); this.initialize(); - return this._descriptors.page.groupAssets.createStream( - this._innerApiCalls.groupAssets as gax.GaxCall, + return this.descriptors.page.groupAssets.createStream( + this.innerApiCalls.groupAssets as gax.GaxCall, request, callSettings ); } - groupFindings( - request: protosTypes.google.cloud.securitycenter.v1p1beta1.IGroupFindingsRequest, - options?: gax.CallOptions - ): Promise< - [ - protosTypes.google.cloud.securitycenter.v1p1beta1.IGroupResult[], - protosTypes.google.cloud.securitycenter.v1p1beta1.IGroupFindingsRequest | null, - protosTypes.google.cloud.securitycenter.v1p1beta1.IGroupFindingsResponse - ] - >; - groupFindings( - request: protosTypes.google.cloud.securitycenter.v1p1beta1.IGroupFindingsRequest, - options: gax.CallOptions, - callback: Callback< - protosTypes.google.cloud.securitycenter.v1p1beta1.IGroupResult[], - protosTypes.google.cloud.securitycenter.v1p1beta1.IGroupFindingsRequest | null, - protosTypes.google.cloud.securitycenter.v1p1beta1.IGroupFindingsResponse - > - ): void; + /** - * Filters an organization or source's findings and groups them by their - * specified properties. + * Equivalent to {@link groupAssets}, but returns an iterable object. * - * To group across all sources provide a `-` as the source id. - * Example: /v1p1beta1/organizations/{organization_id}/sources/-/findings + * for-await-of syntax is used with the iterable to recursively get response element on-demand. * * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. Name of the source to groupBy. Its format is - * "organizations/[organization_id]/sources/[source_id]". To groupBy across - * all sources provide a source_id of `-`. For example: - * organizations/{organization_id}/sources/- + * Required. Name of the organization to groupBy. Its format is + * "organizations/[organization_id]". * @param {string} request.filter - * Expression that defines the filter to apply across findings. - * The expression is a list of one or more restrictions combined via logical + * Expression that defines the filter to apply across assets. + * The expression is a list of zero or more restrictions combined via logical * operators `AND` and `OR`. * Parentheses are supported, and `OR` has higher precedence than `AND`. * * Restrictions have the form ` ` and may have a `-` - * character in front of them to indicate negation. Examples include: + * character in front of them to indicate negation. The fields map to those + * defined in the Asset resource. Examples include: * - * * name - * * source_properties.a_property - * * security_marks.marks.marka + * * name + * * security_center_properties.resource_name + * * resource_properties.a_property + * * security_marks.marks.marka * * The supported operators are: * @@ -2289,57 +2482,249 @@ export class SecurityCenterClient { * The following field and operator combinations are supported: * * * name: `=` - * * parent: `=`, `:` - * * resource_name: `=`, `:` - * * state: `=`, `:` - * * category: `=`, `:` - * * external_uri: `=`, `:` - * * event_time: `=`, `>`, `<`, `>=`, `<=` + * * update_time: `=`, `>`, `<`, `>=`, `<=` * * Usage: This should be milliseconds since epoch or an RFC3339 string. * Examples: - * "event_time = \"2019-06-10T16:07:18-07:00\"" - * "event_time = 1560208038000" + * "update_time = \"2019-06-10T16:07:18-07:00\"" + * "update_time = 1560208038000" + * + * * create_time: `=`, `>`, `<`, `>=`, `<=` * + * Usage: This should be milliseconds since epoch or an RFC3339 string. + * Examples: + * "create_time = \"2019-06-10T16:07:18-07:00\"" + * "create_time = 1560208038000" + * + * * iam_policy.policy_blob: `=`, `:` + * * resource_properties: `=`, `:`, `>`, `<`, `>=`, `<=` * * security_marks.marks: `=`, `:` - * * source_properties: `=`, `:`, `>`, `<`, `>=`, `<=` + * * security_center_properties.resource_name: `=`, `:` + * * security_center_properties.resource_name_display_name: `=`, `:` + * * security_center_properties.resource_type: `=`, `:` + * * security_center_properties.resource_parent: `=`, `:` + * * security_center_properties.resource_parent_display_name: `=`, `:` + * * security_center_properties.resource_project: `=`, `:` + * * security_center_properties.resource_project_display_name: `=`, `:` + * * security_center_properties.resource_owners: `=`, `:` * - * For example, `source_properties.size = 100` is a valid filter string. + * For example, `resource_properties.size = 100` is a valid filter string. * @param {string} request.groupBy - * Required. Expression that defines what assets fields to use for grouping - * (including `state_change`). The string value should follow SQL syntax: - * comma separated list of fields. For example: "parent,resource_name". + * Required. Expression that defines what assets fields to use for grouping. + * The string value should follow SQL syntax: comma separated list of fields. + * For example: + * "security_center_properties.resource_project,security_center_properties.project". * - * The following fields are supported: + * The following fields are supported when compare_duration is not set: * - * * resource_name - * * category - * * state - * * parent + * * security_center_properties.resource_project + * * security_center_properties.resource_project_display_name + * * security_center_properties.resource_type + * * security_center_properties.resource_parent + * * security_center_properties.resource_parent_display_name * * The following fields are supported when compare_duration is set: * - * * state_change - * @param {google.protobuf.Timestamp} request.readTime - * Time used as a reference point when filtering findings. The filter is - * limited to findings existing at the supplied time and their values are - * those at that specific time. Absence of this field will default to the - * API's version of NOW. + * * security_center_properties.resource_type + * * security_center_properties.resource_project_display_name + * * security_center_properties.resource_parent_display_name * @param {google.protobuf.Duration} request.compareDuration - * When compare_duration is set, the GroupResult's "state_change" attribute is - * updated to indicate whether the finding had its state changed, the - * finding's state remained unchanged, or if the finding was added during the - * compare_duration period of time that precedes the read_time. This is the - * time between (read_time - compare_duration) and read_time. + * When compare_duration is set, the GroupResult's "state_change" property is + * updated to indicate whether the asset was added, removed, or remained + * present during the compare_duration period of time that precedes the + * read_time. This is the time between (read_time - compare_duration) and + * read_time. * - * The state_change value is derived based on the presence and state of the - * finding at the two points in time. Intermediate state changes between the - * two times don't affect the result. For example, the results aren't affected - * if the finding is made inactive and then active again. + * The state change value is derived based on the presence of the asset at the + * two points in time. Intermediate state changes between the two times don't + * affect the result. For example, the results aren't affected if the asset is + * removed and re-created again. * * Possible "state_change" values when compare_duration is specified: * - * * "CHANGED": indicates that the finding was present at the start of + * * "ADDED": indicates that the asset was not present at the start of + * compare_duration, but present at reference_time. + * * "REMOVED": indicates that the asset was present at the start of + * compare_duration, but not present at reference_time. + * * "ACTIVE": indicates that the asset was present at both the + * start and the end of the time period defined by + * compare_duration and reference_time. + * + * If compare_duration is not specified, then the only possible state_change + * is "UNUSED", which will be the state_change set for all assets present at + * read_time. + * + * If this field is set then `state_change` must be a specified field in + * `group_by`. + * @param {google.protobuf.Timestamp} request.readTime + * Time used as a reference point when filtering assets. The filter is limited + * to assets existing at the supplied time and their values are those at that + * specific time. Absence of this field will default to the API's version of + * NOW. + * @param {string} request.having + * Filter that specifies what fields to further filter on *after* the query + * filter has been executed. Currently only `state_change` is supported and + * requires compare_duration to be specified. + * @param {string} request.pageToken + * The value returned by the last `GroupAssetsResponse`; indicates + * that this is a continuation of a prior `GroupAssets` call, and that the + * system should return the next page of data. + * @param {number} request.pageSize + * The maximum number of results to return in a single response. Default is + * 10, minimum is 1, maximum is 1000. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols. + */ + groupAssetsAsync( + request?: protos.google.cloud.securitycenter.v1p1beta1.IGroupAssetsRequest, + options?: gax.CallOptions + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.groupAssets.asyncIterate( + this.innerApiCalls['groupAssets'] as GaxCall, + (request as unknown) as RequestType, + callSettings + ) as AsyncIterable< + protos.google.cloud.securitycenter.v1p1beta1.IGroupResult + >; + } + groupFindings( + request: protos.google.cloud.securitycenter.v1p1beta1.IGroupFindingsRequest, + options?: gax.CallOptions + ): Promise< + [ + protos.google.cloud.securitycenter.v1p1beta1.IGroupResult[], + protos.google.cloud.securitycenter.v1p1beta1.IGroupFindingsRequest | null, + protos.google.cloud.securitycenter.v1p1beta1.IGroupFindingsResponse + ] + >; + groupFindings( + request: protos.google.cloud.securitycenter.v1p1beta1.IGroupFindingsRequest, + options: gax.CallOptions, + callback: PaginationCallback< + protos.google.cloud.securitycenter.v1p1beta1.IGroupFindingsRequest, + | protos.google.cloud.securitycenter.v1p1beta1.IGroupFindingsResponse + | null + | undefined, + protos.google.cloud.securitycenter.v1p1beta1.IGroupResult + > + ): void; + groupFindings( + request: protos.google.cloud.securitycenter.v1p1beta1.IGroupFindingsRequest, + callback: PaginationCallback< + protos.google.cloud.securitycenter.v1p1beta1.IGroupFindingsRequest, + | protos.google.cloud.securitycenter.v1p1beta1.IGroupFindingsResponse + | null + | undefined, + protos.google.cloud.securitycenter.v1p1beta1.IGroupResult + > + ): void; + /** + * Filters an organization or source's findings and groups them by their + * specified properties. + * + * To group across all sources provide a `-` as the source id. + * Example: /v1p1beta1/organizations/{organization_id}/sources/-/findings + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Name of the source to groupBy. Its format is + * "organizations/[organization_id]/sources/[source_id]". To groupBy across + * all sources provide a source_id of `-`. For example: + * organizations/{organization_id}/sources/- + * @param {string} request.filter + * Expression that defines the filter to apply across findings. + * The expression is a list of one or more restrictions combined via logical + * operators `AND` and `OR`. + * Parentheses are supported, and `OR` has higher precedence than `AND`. + * + * Restrictions have the form ` ` and may have a `-` + * character in front of them to indicate negation. Examples include: + * + * * name + * * source_properties.a_property + * * security_marks.marks.marka + * + * The supported operators are: + * + * * `=` for all value types. + * * `>`, `<`, `>=`, `<=` for integer values. + * * `:`, meaning substring matching, for strings. + * + * The supported value types are: + * + * * string literals in quotes. + * * integer literals without quotes. + * * boolean literals `true` and `false` without quotes. + * + * The following field and operator combinations are supported: + * + * * name: `=` + * * parent: `=`, `:` + * * resource_name: `=`, `:` + * * state: `=`, `:` + * * category: `=`, `:` + * * external_uri: `=`, `:` + * * event_time: `=`, `>`, `<`, `>=`, `<=` + * + * Usage: This should be milliseconds since epoch or an RFC3339 string. + * Examples: + * "event_time = \"2019-06-10T16:07:18-07:00\"" + * "event_time = 1560208038000" + * + * * security_marks.marks: `=`, `:` + * * source_properties: `=`, `:`, `>`, `<`, `>=`, `<=` + * + * For example, `source_properties.size = 100` is a valid filter string. + * @param {string} request.groupBy + * Required. Expression that defines what assets fields to use for grouping + * (including `state_change`). The string value should follow SQL syntax: + * comma separated list of fields. For example: "parent,resource_name". + * + * The following fields are supported: + * + * * resource_name + * * category + * * state + * * parent + * + * The following fields are supported when compare_duration is set: + * + * * state_change + * @param {google.protobuf.Timestamp} request.readTime + * Time used as a reference point when filtering findings. The filter is + * limited to findings existing at the supplied time and their values are + * those at that specific time. Absence of this field will default to the + * API's version of NOW. + * @param {google.protobuf.Duration} request.compareDuration + * When compare_duration is set, the GroupResult's "state_change" attribute is + * updated to indicate whether the finding had its state changed, the + * finding's state remained unchanged, or if the finding was added during the + * compare_duration period of time that precedes the read_time. This is the + * time between (read_time - compare_duration) and read_time. + * + * The state_change value is derived based on the presence and state of the + * finding at the two points in time. Intermediate state changes between the + * two times don't affect the result. For example, the results aren't affected + * if the finding is made inactive and then active again. + * + * Possible "state_change" values when compare_duration is specified: + * + * * "CHANGED": indicates that the finding was present at the start of * compare_duration, but changed its state at read_time. * * "UNCHANGED": indicates that the finding was present at the start of * compare_duration and did not change state at read_time. @@ -2382,24 +2767,28 @@ export class SecurityCenterClient { * The promise has a method named "cancel" which cancels the ongoing API call. */ groupFindings( - request: protosTypes.google.cloud.securitycenter.v1p1beta1.IGroupFindingsRequest, + request: protos.google.cloud.securitycenter.v1p1beta1.IGroupFindingsRequest, optionsOrCallback?: | gax.CallOptions - | Callback< - protosTypes.google.cloud.securitycenter.v1p1beta1.IGroupResult[], - protosTypes.google.cloud.securitycenter.v1p1beta1.IGroupFindingsRequest | null, - protosTypes.google.cloud.securitycenter.v1p1beta1.IGroupFindingsResponse + | PaginationCallback< + protos.google.cloud.securitycenter.v1p1beta1.IGroupFindingsRequest, + | protos.google.cloud.securitycenter.v1p1beta1.IGroupFindingsResponse + | null + | undefined, + protos.google.cloud.securitycenter.v1p1beta1.IGroupResult >, - callback?: Callback< - protosTypes.google.cloud.securitycenter.v1p1beta1.IGroupResult[], - protosTypes.google.cloud.securitycenter.v1p1beta1.IGroupFindingsRequest | null, - protosTypes.google.cloud.securitycenter.v1p1beta1.IGroupFindingsResponse + callback?: PaginationCallback< + protos.google.cloud.securitycenter.v1p1beta1.IGroupFindingsRequest, + | protos.google.cloud.securitycenter.v1p1beta1.IGroupFindingsResponse + | null + | undefined, + protos.google.cloud.securitycenter.v1p1beta1.IGroupResult > ): Promise< [ - protosTypes.google.cloud.securitycenter.v1p1beta1.IGroupResult[], - protosTypes.google.cloud.securitycenter.v1p1beta1.IGroupFindingsRequest | null, - protosTypes.google.cloud.securitycenter.v1p1beta1.IGroupFindingsResponse + protos.google.cloud.securitycenter.v1p1beta1.IGroupResult[], + protos.google.cloud.securitycenter.v1p1beta1.IGroupFindingsRequest | null, + protos.google.cloud.securitycenter.v1p1beta1.IGroupFindingsResponse ] > | void { request = request || {}; @@ -2419,7 +2808,7 @@ export class SecurityCenterClient { parent: request.parent || '', }); this.initialize(); - return this._innerApiCalls.groupFindings(request, options, callback); + return this.innerApiCalls.groupFindings(request, options, callback); } /** @@ -2550,7 +2939,7 @@ export class SecurityCenterClient { * An object stream which emits an object representing [GroupResult]{@link google.cloud.securitycenter.v1p1beta1.GroupResult} on 'data' event. */ groupFindingsStream( - request?: protosTypes.google.cloud.securitycenter.v1p1beta1.IGroupFindingsRequest, + request?: protos.google.cloud.securitycenter.v1p1beta1.IGroupFindingsRequest, options?: gax.CallOptions ): Transform { request = request || {}; @@ -2564,29 +2953,185 @@ export class SecurityCenterClient { }); const callSettings = new gax.CallSettings(options); this.initialize(); - return this._descriptors.page.groupFindings.createStream( - this._innerApiCalls.groupFindings as gax.GaxCall, + return this.descriptors.page.groupFindings.createStream( + this.innerApiCalls.groupFindings as gax.GaxCall, request, callSettings ); } + + /** + * Equivalent to {@link groupFindings}, but returns an iterable object. + * + * for-await-of syntax is used with the iterable to recursively get response element on-demand. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Name of the source to groupBy. Its format is + * "organizations/[organization_id]/sources/[source_id]". To groupBy across + * all sources provide a source_id of `-`. For example: + * organizations/{organization_id}/sources/- + * @param {string} request.filter + * Expression that defines the filter to apply across findings. + * The expression is a list of one or more restrictions combined via logical + * operators `AND` and `OR`. + * Parentheses are supported, and `OR` has higher precedence than `AND`. + * + * Restrictions have the form ` ` and may have a `-` + * character in front of them to indicate negation. Examples include: + * + * * name + * * source_properties.a_property + * * security_marks.marks.marka + * + * The supported operators are: + * + * * `=` for all value types. + * * `>`, `<`, `>=`, `<=` for integer values. + * * `:`, meaning substring matching, for strings. + * + * The supported value types are: + * + * * string literals in quotes. + * * integer literals without quotes. + * * boolean literals `true` and `false` without quotes. + * + * The following field and operator combinations are supported: + * + * * name: `=` + * * parent: `=`, `:` + * * resource_name: `=`, `:` + * * state: `=`, `:` + * * category: `=`, `:` + * * external_uri: `=`, `:` + * * event_time: `=`, `>`, `<`, `>=`, `<=` + * + * Usage: This should be milliseconds since epoch or an RFC3339 string. + * Examples: + * "event_time = \"2019-06-10T16:07:18-07:00\"" + * "event_time = 1560208038000" + * + * * security_marks.marks: `=`, `:` + * * source_properties: `=`, `:`, `>`, `<`, `>=`, `<=` + * + * For example, `source_properties.size = 100` is a valid filter string. + * @param {string} request.groupBy + * Required. Expression that defines what assets fields to use for grouping + * (including `state_change`). The string value should follow SQL syntax: + * comma separated list of fields. For example: "parent,resource_name". + * + * The following fields are supported: + * + * * resource_name + * * category + * * state + * * parent + * + * The following fields are supported when compare_duration is set: + * + * * state_change + * @param {google.protobuf.Timestamp} request.readTime + * Time used as a reference point when filtering findings. The filter is + * limited to findings existing at the supplied time and their values are + * those at that specific time. Absence of this field will default to the + * API's version of NOW. + * @param {google.protobuf.Duration} request.compareDuration + * When compare_duration is set, the GroupResult's "state_change" attribute is + * updated to indicate whether the finding had its state changed, the + * finding's state remained unchanged, or if the finding was added during the + * compare_duration period of time that precedes the read_time. This is the + * time between (read_time - compare_duration) and read_time. + * + * The state_change value is derived based on the presence and state of the + * finding at the two points in time. Intermediate state changes between the + * two times don't affect the result. For example, the results aren't affected + * if the finding is made inactive and then active again. + * + * Possible "state_change" values when compare_duration is specified: + * + * * "CHANGED": indicates that the finding was present at the start of + * compare_duration, but changed its state at read_time. + * * "UNCHANGED": indicates that the finding was present at the start of + * compare_duration and did not change state at read_time. + * * "ADDED": indicates that the finding was not present at the start + * of compare_duration, but was present at read_time. + * + * If compare_duration is not specified, then the only possible state_change + * is "UNUSED", which will be the state_change set for all findings present + * at read_time. + * + * If this field is set then `state_change` must be a specified field in + * `group_by`. + * @param {string} request.having + * Filter that specifies what fields to further filter on *after* the query + * filter has been executed. Currently only `finding.state` and `state_change` + * are supported and requires compare_duration to be specified. + * @param {string} request.pageToken + * The value returned by the last `GroupFindingsResponse`; indicates + * that this is a continuation of a prior `GroupFindings` call, and + * that the system should return the next page of data. + * @param {number} request.pageSize + * The maximum number of results to return in a single response. Default is + * 10, minimum is 1, maximum is 1000. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols. + */ + groupFindingsAsync( + request?: protos.google.cloud.securitycenter.v1p1beta1.IGroupFindingsRequest, + options?: gax.CallOptions + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.groupFindings.asyncIterate( + this.innerApiCalls['groupFindings'] as GaxCall, + (request as unknown) as RequestType, + callSettings + ) as AsyncIterable< + protos.google.cloud.securitycenter.v1p1beta1.IGroupResult + >; + } listAssets( - request: protosTypes.google.cloud.securitycenter.v1p1beta1.IListAssetsRequest, + request: protos.google.cloud.securitycenter.v1p1beta1.IListAssetsRequest, options?: gax.CallOptions ): Promise< [ - protosTypes.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.IListAssetsResult[], - protosTypes.google.cloud.securitycenter.v1p1beta1.IListAssetsRequest | null, - protosTypes.google.cloud.securitycenter.v1p1beta1.IListAssetsResponse + protos.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.IListAssetsResult[], + protos.google.cloud.securitycenter.v1p1beta1.IListAssetsRequest | null, + protos.google.cloud.securitycenter.v1p1beta1.IListAssetsResponse ] >; listAssets( - request: protosTypes.google.cloud.securitycenter.v1p1beta1.IListAssetsRequest, + request: protos.google.cloud.securitycenter.v1p1beta1.IListAssetsRequest, options: gax.CallOptions, - callback: Callback< - protosTypes.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.IListAssetsResult[], - protosTypes.google.cloud.securitycenter.v1p1beta1.IListAssetsRequest | null, - protosTypes.google.cloud.securitycenter.v1p1beta1.IListAssetsResponse + callback: PaginationCallback< + protos.google.cloud.securitycenter.v1p1beta1.IListAssetsRequest, + | protos.google.cloud.securitycenter.v1p1beta1.IListAssetsResponse + | null + | undefined, + protos.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.IListAssetsResult + > + ): void; + listAssets( + request: protos.google.cloud.securitycenter.v1p1beta1.IListAssetsRequest, + callback: PaginationCallback< + protos.google.cloud.securitycenter.v1p1beta1.IListAssetsRequest, + | protos.google.cloud.securitycenter.v1p1beta1.IListAssetsResponse + | null + | undefined, + protos.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.IListAssetsResult > ): void; /** @@ -2741,24 +3286,28 @@ export class SecurityCenterClient { * The promise has a method named "cancel" which cancels the ongoing API call. */ listAssets( - request: protosTypes.google.cloud.securitycenter.v1p1beta1.IListAssetsRequest, + request: protos.google.cloud.securitycenter.v1p1beta1.IListAssetsRequest, optionsOrCallback?: | gax.CallOptions - | Callback< - protosTypes.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.IListAssetsResult[], - protosTypes.google.cloud.securitycenter.v1p1beta1.IListAssetsRequest | null, - protosTypes.google.cloud.securitycenter.v1p1beta1.IListAssetsResponse + | PaginationCallback< + protos.google.cloud.securitycenter.v1p1beta1.IListAssetsRequest, + | protos.google.cloud.securitycenter.v1p1beta1.IListAssetsResponse + | null + | undefined, + protos.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.IListAssetsResult >, - callback?: Callback< - protosTypes.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.IListAssetsResult[], - protosTypes.google.cloud.securitycenter.v1p1beta1.IListAssetsRequest | null, - protosTypes.google.cloud.securitycenter.v1p1beta1.IListAssetsResponse + callback?: PaginationCallback< + protos.google.cloud.securitycenter.v1p1beta1.IListAssetsRequest, + | protos.google.cloud.securitycenter.v1p1beta1.IListAssetsResponse + | null + | undefined, + protos.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.IListAssetsResult > ): Promise< [ - protosTypes.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.IListAssetsResult[], - protosTypes.google.cloud.securitycenter.v1p1beta1.IListAssetsRequest | null, - protosTypes.google.cloud.securitycenter.v1p1beta1.IListAssetsResponse + protos.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.IListAssetsResult[], + protos.google.cloud.securitycenter.v1p1beta1.IListAssetsRequest | null, + protos.google.cloud.securitycenter.v1p1beta1.IListAssetsResponse ] > | void { request = request || {}; @@ -2778,21 +3327,183 @@ export class SecurityCenterClient { parent: request.parent || '', }); this.initialize(); - return this._innerApiCalls.listAssets(request, options, callback); + return this.innerApiCalls.listAssets(request, options, callback); + } + + /** + * Equivalent to {@link listAssets}, but returns a NodeJS Stream object. + * + * This fetches the paged responses for {@link listAssets} continuously + * and invokes the callback registered for 'data' event for each element in the + * responses. + * + * The returned object has 'end' method when no more elements are required. + * + * autoPaginate option will be ignored. + * + * @see {@link https://nodejs.org/api/stream.html} + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Name of the organization assets should belong to. Its format is + * "organizations/[organization_id]". + * @param {string} request.filter + * Expression that defines the filter to apply across assets. + * The expression is a list of zero or more restrictions combined via logical + * operators `AND` and `OR`. + * Parentheses are supported, and `OR` has higher precedence than `AND`. + * + * Restrictions have the form ` ` and may have a `-` + * character in front of them to indicate negation. The fields map to those + * defined in the Asset resource. Examples include: + * + * * name + * * security_center_properties.resource_name + * * resource_properties.a_property + * * security_marks.marks.marka + * + * The supported operators are: + * + * * `=` for all value types. + * * `>`, `<`, `>=`, `<=` for integer values. + * * `:`, meaning substring matching, for strings. + * + * The supported value types are: + * + * * string literals in quotes. + * * integer literals without quotes. + * * boolean literals `true` and `false` without quotes. + * + * The following are the allowed field and operator combinations: + * + * * name: `=` + * * update_time: `=`, `>`, `<`, `>=`, `<=` + * + * Usage: This should be milliseconds since epoch or an RFC3339 string. + * Examples: + * "update_time = \"2019-06-10T16:07:18-07:00\"" + * "update_time = 1560208038000" + * + * * create_time: `=`, `>`, `<`, `>=`, `<=` + * + * Usage: This should be milliseconds since epoch or an RFC3339 string. + * Examples: + * "create_time = \"2019-06-10T16:07:18-07:00\"" + * "create_time = 1560208038000" + * + * * iam_policy.policy_blob: `=`, `:` + * * resource_properties: `=`, `:`, `>`, `<`, `>=`, `<=` + * * security_marks.marks: `=`, `:` + * * security_center_properties.resource_name: `=`, `:` + * * security_center_properties.resource_display_name: `=`, `:` + * * security_center_properties.resource_type: `=`, `:` + * * security_center_properties.resource_parent: `=`, `:` + * * security_center_properties.resource_parent_display_name: `=`, `:` + * * security_center_properties.resource_project: `=`, `:` + * * security_center_properties.resource_project_display_name: `=`, `:` + * * security_center_properties.resource_owners: `=`, `:` + * + * For example, `resource_properties.size = 100` is a valid filter string. + * @param {string} request.orderBy + * Expression that defines what fields and order to use for sorting. The + * string value should follow SQL syntax: comma separated list of fields. For + * example: "name,resource_properties.a_property". The default sorting order + * is ascending. To specify descending order for a field, a suffix " desc" + * should be appended to the field name. For example: "name + * desc,resource_properties.a_property". Redundant space characters in the + * syntax are insignificant. "name desc,resource_properties.a_property" and " + * name desc , resource_properties.a_property " are equivalent. + * + * The following fields are supported: + * name + * update_time + * resource_properties + * security_marks.marks + * security_center_properties.resource_name + * security_center_properties.resource_display_name + * security_center_properties.resource_parent + * security_center_properties.resource_parent_display_name + * security_center_properties.resource_project + * security_center_properties.resource_project_display_name + * security_center_properties.resource_type + * @param {google.protobuf.Timestamp} request.readTime + * Time used as a reference point when filtering assets. The filter is limited + * to assets existing at the supplied time and their values are those at that + * specific time. Absence of this field will default to the API's version of + * NOW. + * @param {google.protobuf.Duration} request.compareDuration + * When compare_duration is set, the ListAssetsResult's "state_change" + * attribute is updated to indicate whether the asset was added, removed, or + * remained present during the compare_duration period of time that precedes + * the read_time. This is the time between (read_time - compare_duration) and + * read_time. + * + * The state_change value is derived based on the presence of the asset at the + * two points in time. Intermediate state changes between the two times don't + * affect the result. For example, the results aren't affected if the asset is + * removed and re-created again. + * + * Possible "state_change" values when compare_duration is specified: + * + * * "ADDED": indicates that the asset was not present at the start of + * compare_duration, but present at read_time. + * * "REMOVED": indicates that the asset was present at the start of + * compare_duration, but not present at read_time. + * * "ACTIVE": indicates that the asset was present at both the + * start and the end of the time period defined by + * compare_duration and read_time. + * + * If compare_duration is not specified, then the only possible state_change + * is "UNUSED", which will be the state_change set for all assets present at + * read_time. + * @param {string} request.having + * Filter that specifies what fields to further filter on *after* the query + * filter has been executed. Currently only `state_change` is supported and + * requires compare_duration to be specified. + * @param {google.protobuf.FieldMask} [request.fieldMask] + * Optional. + * A field mask to specify the ListAssetsResult fields to be listed in the + * response. + * An empty field mask will list all fields. + * @param {string} request.pageToken + * The value returned by the last `ListAssetsResponse`; indicates + * that this is a continuation of a prior `ListAssets` call, and + * that the system should return the next page of data. + * @param {number} request.pageSize + * The maximum number of results to return in a single response. Default is + * 10, minimum is 1, maximum is 1000. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [ListAssetsResult]{@link google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult} on 'data' event. + */ + listAssetsStream( + request?: protos.google.cloud.securitycenter.v1p1beta1.IListAssetsRequest, + options?: gax.CallOptions + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.listAssets.createStream( + this.innerApiCalls.listAssets as gax.GaxCall, + request, + callSettings + ); } /** - * Equivalent to {@link listAssets}, but returns a NodeJS Stream object. - * - * This fetches the paged responses for {@link listAssets} continuously - * and invokes the callback registered for 'data' event for each element in the - * responses. + * Equivalent to {@link listAssets}, but returns an iterable object. * - * The returned object has 'end' method when no more elements are required. - * - * autoPaginate option will be ignored. - * - * @see {@link https://nodejs.org/api/stream.html} + * for-await-of syntax is used with the iterable to recursively get response element on-demand. * * @param {Object} request * The request object that will be sent. @@ -2926,13 +3637,15 @@ export class SecurityCenterClient { * 10, minimum is 1, maximum is 1000. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing [ListAssetsResult]{@link google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult} on 'data' event. + * @returns {Object} + * An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols. */ - listAssetsStream( - request?: protosTypes.google.cloud.securitycenter.v1p1beta1.IListAssetsRequest, + listAssetsAsync( + request?: protos.google.cloud.securitycenter.v1p1beta1.IListAssetsRequest, options?: gax.CallOptions - ): Transform { + ): AsyncIterable< + protos.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.IListAssetsResult + > { request = request || {}; options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -2942,31 +3655,46 @@ export class SecurityCenterClient { ] = gax.routingHeader.fromParams({ parent: request.parent || '', }); + options = options || {}; const callSettings = new gax.CallSettings(options); this.initialize(); - return this._descriptors.page.listAssets.createStream( - this._innerApiCalls.listAssets as gax.GaxCall, - request, + return this.descriptors.page.listAssets.asyncIterate( + this.innerApiCalls['listAssets'] as GaxCall, + (request as unknown) as RequestType, callSettings - ); + ) as AsyncIterable< + protos.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.IListAssetsResult + >; } listFindings( - request: protosTypes.google.cloud.securitycenter.v1p1beta1.IListFindingsRequest, + request: protos.google.cloud.securitycenter.v1p1beta1.IListFindingsRequest, options?: gax.CallOptions ): Promise< [ - protosTypes.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.IListFindingsResult[], - protosTypes.google.cloud.securitycenter.v1p1beta1.IListFindingsRequest | null, - protosTypes.google.cloud.securitycenter.v1p1beta1.IListFindingsResponse + protos.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.IListFindingsResult[], + protos.google.cloud.securitycenter.v1p1beta1.IListFindingsRequest | null, + protos.google.cloud.securitycenter.v1p1beta1.IListFindingsResponse ] >; listFindings( - request: protosTypes.google.cloud.securitycenter.v1p1beta1.IListFindingsRequest, + request: protos.google.cloud.securitycenter.v1p1beta1.IListFindingsRequest, options: gax.CallOptions, - callback: Callback< - protosTypes.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.IListFindingsResult[], - protosTypes.google.cloud.securitycenter.v1p1beta1.IListFindingsRequest | null, - protosTypes.google.cloud.securitycenter.v1p1beta1.IListFindingsResponse + callback: PaginationCallback< + protos.google.cloud.securitycenter.v1p1beta1.IListFindingsRequest, + | protos.google.cloud.securitycenter.v1p1beta1.IListFindingsResponse + | null + | undefined, + protos.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.IListFindingsResult + > + ): void; + listFindings( + request: protos.google.cloud.securitycenter.v1p1beta1.IListFindingsRequest, + callback: PaginationCallback< + protos.google.cloud.securitycenter.v1p1beta1.IListFindingsRequest, + | protos.google.cloud.securitycenter.v1p1beta1.IListFindingsResponse + | null + | undefined, + protos.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.IListFindingsResult > ): void; /** @@ -3109,24 +3837,28 @@ export class SecurityCenterClient { * The promise has a method named "cancel" which cancels the ongoing API call. */ listFindings( - request: protosTypes.google.cloud.securitycenter.v1p1beta1.IListFindingsRequest, + request: protos.google.cloud.securitycenter.v1p1beta1.IListFindingsRequest, optionsOrCallback?: | gax.CallOptions - | Callback< - protosTypes.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.IListFindingsResult[], - protosTypes.google.cloud.securitycenter.v1p1beta1.IListFindingsRequest | null, - protosTypes.google.cloud.securitycenter.v1p1beta1.IListFindingsResponse + | PaginationCallback< + protos.google.cloud.securitycenter.v1p1beta1.IListFindingsRequest, + | protos.google.cloud.securitycenter.v1p1beta1.IListFindingsResponse + | null + | undefined, + protos.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.IListFindingsResult >, - callback?: Callback< - protosTypes.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.IListFindingsResult[], - protosTypes.google.cloud.securitycenter.v1p1beta1.IListFindingsRequest | null, - protosTypes.google.cloud.securitycenter.v1p1beta1.IListFindingsResponse + callback?: PaginationCallback< + protos.google.cloud.securitycenter.v1p1beta1.IListFindingsRequest, + | protos.google.cloud.securitycenter.v1p1beta1.IListFindingsResponse + | null + | undefined, + protos.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.IListFindingsResult > ): Promise< [ - protosTypes.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.IListFindingsResult[], - protosTypes.google.cloud.securitycenter.v1p1beta1.IListFindingsRequest | null, - protosTypes.google.cloud.securitycenter.v1p1beta1.IListFindingsResponse + protos.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.IListFindingsResult[], + protos.google.cloud.securitycenter.v1p1beta1.IListFindingsRequest | null, + protos.google.cloud.securitycenter.v1p1beta1.IListFindingsResponse ] > | void { request = request || {}; @@ -3146,7 +3878,7 @@ export class SecurityCenterClient { parent: request.parent || '', }); this.initialize(); - return this._innerApiCalls.listFindings(request, options, callback); + return this.innerApiCalls.listFindings(request, options, callback); } /** @@ -3283,7 +4015,7 @@ export class SecurityCenterClient { * An object stream which emits an object representing [ListFindingsResult]{@link google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult} on 'data' event. */ listFindingsStream( - request?: protosTypes.google.cloud.securitycenter.v1p1beta1.IListFindingsRequest, + request?: protos.google.cloud.securitycenter.v1p1beta1.IListFindingsRequest, options?: gax.CallOptions ): Transform { request = request || {}; @@ -3297,29 +4029,193 @@ export class SecurityCenterClient { }); const callSettings = new gax.CallSettings(options); this.initialize(); - return this._descriptors.page.listFindings.createStream( - this._innerApiCalls.listFindings as gax.GaxCall, + return this.descriptors.page.listFindings.createStream( + this.innerApiCalls.listFindings as gax.GaxCall, request, callSettings ); } + + /** + * Equivalent to {@link listFindings}, but returns an iterable object. + * + * for-await-of syntax is used with the iterable to recursively get response element on-demand. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Name of the source the findings belong to. Its format is + * "organizations/[organization_id]/sources/[source_id]". To list across all + * sources provide a source_id of `-`. For example: + * organizations/{organization_id}/sources/- + * @param {string} request.filter + * Expression that defines the filter to apply across findings. + * The expression is a list of one or more restrictions combined via logical + * operators `AND` and `OR`. + * Parentheses are supported, and `OR` has higher precedence than `AND`. + * + * Restrictions have the form ` ` and may have a `-` + * character in front of them to indicate negation. Examples include: + * + * * name + * * source_properties.a_property + * * security_marks.marks.marka + * + * The supported operators are: + * + * * `=` for all value types. + * * `>`, `<`, `>=`, `<=` for integer values. + * * `:`, meaning substring matching, for strings. + * + * The supported value types are: + * + * * string literals in quotes. + * * integer literals without quotes. + * * boolean literals `true` and `false` without quotes. + * + * The following field and operator combinations are supported: + * + * name: `=` + * parent: `=`, `:` + * resource_name: `=`, `:` + * state: `=`, `:` + * category: `=`, `:` + * external_uri: `=`, `:` + * event_time: `=`, `>`, `<`, `>=`, `<=` + * + * Usage: This should be milliseconds since epoch or an RFC3339 string. + * Examples: + * "event_time = \"2019-06-10T16:07:18-07:00\"" + * "event_time = 1560208038000" + * + * security_marks.marks: `=`, `:` + * source_properties: `=`, `:`, `>`, `<`, `>=`, `<=` + * + * For example, `source_properties.size = 100` is a valid filter string. + * @param {string} request.orderBy + * Expression that defines what fields and order to use for sorting. The + * string value should follow SQL syntax: comma separated list of fields. For + * example: "name,resource_properties.a_property". The default sorting order + * is ascending. To specify descending order for a field, a suffix " desc" + * should be appended to the field name. For example: "name + * desc,source_properties.a_property". Redundant space characters in the + * syntax are insignificant. "name desc,source_properties.a_property" and " + * name desc , source_properties.a_property " are equivalent. + * + * The following fields are supported: + * name + * parent + * state + * category + * resource_name + * event_time + * source_properties + * security_marks.marks + * @param {google.protobuf.Timestamp} request.readTime + * Time used as a reference point when filtering findings. The filter is + * limited to findings existing at the supplied time and their values are + * those at that specific time. Absence of this field will default to the + * API's version of NOW. + * @param {google.protobuf.Duration} request.compareDuration + * When compare_duration is set, the ListFindingsResult's "state_change" + * attribute is updated to indicate whether the finding had its state changed, + * the finding's state remained unchanged, or if the finding was added in any + * state during the compare_duration period of time that precedes the + * read_time. This is the time between (read_time - compare_duration) and + * read_time. + * + * The state_change value is derived based on the presence and state of the + * finding at the two points in time. Intermediate state changes between the + * two times don't affect the result. For example, the results aren't affected + * if the finding is made inactive and then active again. + * + * Possible "state_change" values when compare_duration is specified: + * + * * "CHANGED": indicates that the finding was present at the start of + * compare_duration, but changed its state at read_time. + * * "UNCHANGED": indicates that the finding was present at the start of + * compare_duration and did not change state at read_time. + * * "ADDED": indicates that the finding was not present at the start + * of compare_duration, but was present at read_time. + * + * If compare_duration is not specified, then the only possible state_change + * is "UNUSED", which will be the state_change set for all findings present at + * read_time. + * @param {string} request.having + * Filter that specifies what fields to further filter on *after* the query + * filter has been executed. Currently only `finding.state` and `state_change` + * are supported and requires compare_duration to be specified. + * @param {google.protobuf.FieldMask} [request.fieldMask] + * Optional. + * A field mask to specify the Finding fields to be listed in the response. + * An empty field mask will list all fields. + * @param {string} request.pageToken + * The value returned by the last `ListFindingsResponse`; indicates + * that this is a continuation of a prior `ListFindings` call, and + * that the system should return the next page of data. + * @param {number} request.pageSize + * The maximum number of results to return in a single response. Default is + * 10, minimum is 1, maximum is 1000. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols. + */ + listFindingsAsync( + request?: protos.google.cloud.securitycenter.v1p1beta1.IListFindingsRequest, + options?: gax.CallOptions + ): AsyncIterable< + protos.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.IListFindingsResult + > { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.listFindings.asyncIterate( + this.innerApiCalls['listFindings'] as GaxCall, + (request as unknown) as RequestType, + callSettings + ) as AsyncIterable< + protos.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.IListFindingsResult + >; + } listNotificationConfigs( - request: protosTypes.google.cloud.securitycenter.v1p1beta1.IListNotificationConfigsRequest, + request: protos.google.cloud.securitycenter.v1p1beta1.IListNotificationConfigsRequest, options?: gax.CallOptions ): Promise< [ - protosTypes.google.cloud.securitycenter.v1p1beta1.INotificationConfig[], - protosTypes.google.cloud.securitycenter.v1p1beta1.IListNotificationConfigsRequest | null, - protosTypes.google.cloud.securitycenter.v1p1beta1.IListNotificationConfigsResponse + protos.google.cloud.securitycenter.v1p1beta1.INotificationConfig[], + protos.google.cloud.securitycenter.v1p1beta1.IListNotificationConfigsRequest | null, + protos.google.cloud.securitycenter.v1p1beta1.IListNotificationConfigsResponse ] >; listNotificationConfigs( - request: protosTypes.google.cloud.securitycenter.v1p1beta1.IListNotificationConfigsRequest, + request: protos.google.cloud.securitycenter.v1p1beta1.IListNotificationConfigsRequest, options: gax.CallOptions, - callback: Callback< - protosTypes.google.cloud.securitycenter.v1p1beta1.INotificationConfig[], - protosTypes.google.cloud.securitycenter.v1p1beta1.IListNotificationConfigsRequest | null, - protosTypes.google.cloud.securitycenter.v1p1beta1.IListNotificationConfigsResponse + callback: PaginationCallback< + protos.google.cloud.securitycenter.v1p1beta1.IListNotificationConfigsRequest, + | protos.google.cloud.securitycenter.v1p1beta1.IListNotificationConfigsResponse + | null + | undefined, + protos.google.cloud.securitycenter.v1p1beta1.INotificationConfig + > + ): void; + listNotificationConfigs( + request: protos.google.cloud.securitycenter.v1p1beta1.IListNotificationConfigsRequest, + callback: PaginationCallback< + protos.google.cloud.securitycenter.v1p1beta1.IListNotificationConfigsRequest, + | protos.google.cloud.securitycenter.v1p1beta1.IListNotificationConfigsResponse + | null + | undefined, + protos.google.cloud.securitycenter.v1p1beta1.INotificationConfig > ): void; /** @@ -3356,24 +4252,28 @@ export class SecurityCenterClient { * The promise has a method named "cancel" which cancels the ongoing API call. */ listNotificationConfigs( - request: protosTypes.google.cloud.securitycenter.v1p1beta1.IListNotificationConfigsRequest, + request: protos.google.cloud.securitycenter.v1p1beta1.IListNotificationConfigsRequest, optionsOrCallback?: | gax.CallOptions - | Callback< - protosTypes.google.cloud.securitycenter.v1p1beta1.INotificationConfig[], - protosTypes.google.cloud.securitycenter.v1p1beta1.IListNotificationConfigsRequest | null, - protosTypes.google.cloud.securitycenter.v1p1beta1.IListNotificationConfigsResponse + | PaginationCallback< + protos.google.cloud.securitycenter.v1p1beta1.IListNotificationConfigsRequest, + | protos.google.cloud.securitycenter.v1p1beta1.IListNotificationConfigsResponse + | null + | undefined, + protos.google.cloud.securitycenter.v1p1beta1.INotificationConfig >, - callback?: Callback< - protosTypes.google.cloud.securitycenter.v1p1beta1.INotificationConfig[], - protosTypes.google.cloud.securitycenter.v1p1beta1.IListNotificationConfigsRequest | null, - protosTypes.google.cloud.securitycenter.v1p1beta1.IListNotificationConfigsResponse + callback?: PaginationCallback< + protos.google.cloud.securitycenter.v1p1beta1.IListNotificationConfigsRequest, + | protos.google.cloud.securitycenter.v1p1beta1.IListNotificationConfigsResponse + | null + | undefined, + protos.google.cloud.securitycenter.v1p1beta1.INotificationConfig > ): Promise< [ - protosTypes.google.cloud.securitycenter.v1p1beta1.INotificationConfig[], - protosTypes.google.cloud.securitycenter.v1p1beta1.IListNotificationConfigsRequest | null, - protosTypes.google.cloud.securitycenter.v1p1beta1.IListNotificationConfigsResponse + protos.google.cloud.securitycenter.v1p1beta1.INotificationConfig[], + protos.google.cloud.securitycenter.v1p1beta1.IListNotificationConfigsRequest | null, + protos.google.cloud.securitycenter.v1p1beta1.IListNotificationConfigsResponse ] > | void { request = request || {}; @@ -3393,7 +4293,7 @@ export class SecurityCenterClient { parent: request.parent || '', }); this.initialize(); - return this._innerApiCalls.listNotificationConfigs( + return this.innerApiCalls.listNotificationConfigs( request, options, callback @@ -3431,7 +4331,7 @@ export class SecurityCenterClient { * An object stream which emits an object representing [NotificationConfig]{@link google.cloud.securitycenter.v1p1beta1.NotificationConfig} on 'data' event. */ listNotificationConfigsStream( - request?: protosTypes.google.cloud.securitycenter.v1p1beta1.IListNotificationConfigsRequest, + request?: protos.google.cloud.securitycenter.v1p1beta1.IListNotificationConfigsRequest, options?: gax.CallOptions ): Transform { request = request || {}; @@ -3445,29 +4345,90 @@ export class SecurityCenterClient { }); const callSettings = new gax.CallSettings(options); this.initialize(); - return this._descriptors.page.listNotificationConfigs.createStream( - this._innerApiCalls.listNotificationConfigs as gax.GaxCall, + return this.descriptors.page.listNotificationConfigs.createStream( + this.innerApiCalls.listNotificationConfigs as gax.GaxCall, request, callSettings ); } + + /** + * Equivalent to {@link listNotificationConfigs}, but returns an iterable object. + * + * for-await-of syntax is used with the iterable to recursively get response element on-demand. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Name of the organization to list notification configs. + * Its format is "organizations/[organization_id]". + * @param {string} request.pageToken + * The value returned by the last `ListNotificationConfigsResponse`; indicates + * that this is a continuation of a prior `ListNotificationConfigs` call, and + * that the system should return the next page of data. + * @param {number} request.pageSize + * The maximum number of results to return in a single response. Default is + * 10, minimum is 1, maximum is 1000. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols. + */ + listNotificationConfigsAsync( + request?: protos.google.cloud.securitycenter.v1p1beta1.IListNotificationConfigsRequest, + options?: gax.CallOptions + ): AsyncIterable< + protos.google.cloud.securitycenter.v1p1beta1.INotificationConfig + > { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.listNotificationConfigs.asyncIterate( + this.innerApiCalls['listNotificationConfigs'] as GaxCall, + (request as unknown) as RequestType, + callSettings + ) as AsyncIterable< + protos.google.cloud.securitycenter.v1p1beta1.INotificationConfig + >; + } listSources( - request: protosTypes.google.cloud.securitycenter.v1p1beta1.IListSourcesRequest, + request: protos.google.cloud.securitycenter.v1p1beta1.IListSourcesRequest, options?: gax.CallOptions ): Promise< [ - protosTypes.google.cloud.securitycenter.v1p1beta1.ISource[], - protosTypes.google.cloud.securitycenter.v1p1beta1.IListSourcesRequest | null, - protosTypes.google.cloud.securitycenter.v1p1beta1.IListSourcesResponse + protos.google.cloud.securitycenter.v1p1beta1.ISource[], + protos.google.cloud.securitycenter.v1p1beta1.IListSourcesRequest | null, + protos.google.cloud.securitycenter.v1p1beta1.IListSourcesResponse ] >; listSources( - request: protosTypes.google.cloud.securitycenter.v1p1beta1.IListSourcesRequest, + request: protos.google.cloud.securitycenter.v1p1beta1.IListSourcesRequest, options: gax.CallOptions, - callback: Callback< - protosTypes.google.cloud.securitycenter.v1p1beta1.ISource[], - protosTypes.google.cloud.securitycenter.v1p1beta1.IListSourcesRequest | null, - protosTypes.google.cloud.securitycenter.v1p1beta1.IListSourcesResponse + callback: PaginationCallback< + protos.google.cloud.securitycenter.v1p1beta1.IListSourcesRequest, + | protos.google.cloud.securitycenter.v1p1beta1.IListSourcesResponse + | null + | undefined, + protos.google.cloud.securitycenter.v1p1beta1.ISource + > + ): void; + listSources( + request: protos.google.cloud.securitycenter.v1p1beta1.IListSourcesRequest, + callback: PaginationCallback< + protos.google.cloud.securitycenter.v1p1beta1.IListSourcesRequest, + | protos.google.cloud.securitycenter.v1p1beta1.IListSourcesResponse + | null + | undefined, + protos.google.cloud.securitycenter.v1p1beta1.ISource > ): void; /** @@ -3504,24 +4465,28 @@ export class SecurityCenterClient { * The promise has a method named "cancel" which cancels the ongoing API call. */ listSources( - request: protosTypes.google.cloud.securitycenter.v1p1beta1.IListSourcesRequest, + request: protos.google.cloud.securitycenter.v1p1beta1.IListSourcesRequest, optionsOrCallback?: | gax.CallOptions - | Callback< - protosTypes.google.cloud.securitycenter.v1p1beta1.ISource[], - protosTypes.google.cloud.securitycenter.v1p1beta1.IListSourcesRequest | null, - protosTypes.google.cloud.securitycenter.v1p1beta1.IListSourcesResponse + | PaginationCallback< + protos.google.cloud.securitycenter.v1p1beta1.IListSourcesRequest, + | protos.google.cloud.securitycenter.v1p1beta1.IListSourcesResponse + | null + | undefined, + protos.google.cloud.securitycenter.v1p1beta1.ISource >, - callback?: Callback< - protosTypes.google.cloud.securitycenter.v1p1beta1.ISource[], - protosTypes.google.cloud.securitycenter.v1p1beta1.IListSourcesRequest | null, - protosTypes.google.cloud.securitycenter.v1p1beta1.IListSourcesResponse + callback?: PaginationCallback< + protos.google.cloud.securitycenter.v1p1beta1.IListSourcesRequest, + | protos.google.cloud.securitycenter.v1p1beta1.IListSourcesResponse + | null + | undefined, + protos.google.cloud.securitycenter.v1p1beta1.ISource > ): Promise< [ - protosTypes.google.cloud.securitycenter.v1p1beta1.ISource[], - protosTypes.google.cloud.securitycenter.v1p1beta1.IListSourcesRequest | null, - protosTypes.google.cloud.securitycenter.v1p1beta1.IListSourcesResponse + protos.google.cloud.securitycenter.v1p1beta1.ISource[], + protos.google.cloud.securitycenter.v1p1beta1.IListSourcesRequest | null, + protos.google.cloud.securitycenter.v1p1beta1.IListSourcesResponse ] > | void { request = request || {}; @@ -3541,7 +4506,7 @@ export class SecurityCenterClient { parent: request.parent || '', }); this.initialize(); - return this._innerApiCalls.listSources(request, options, callback); + return this.innerApiCalls.listSources(request, options, callback); } /** @@ -3575,7 +4540,7 @@ export class SecurityCenterClient { * An object stream which emits an object representing [Source]{@link google.cloud.securitycenter.v1p1beta1.Source} on 'data' event. */ listSourcesStream( - request?: protosTypes.google.cloud.securitycenter.v1p1beta1.IListSourcesRequest, + request?: protos.google.cloud.securitycenter.v1p1beta1.IListSourcesRequest, options?: gax.CallOptions ): Transform { request = request || {}; @@ -3589,12 +4554,57 @@ export class SecurityCenterClient { }); const callSettings = new gax.CallSettings(options); this.initialize(); - return this._descriptors.page.listSources.createStream( - this._innerApiCalls.listSources as gax.GaxCall, + return this.descriptors.page.listSources.createStream( + this.innerApiCalls.listSources as gax.GaxCall, request, callSettings ); } + + /** + * Equivalent to {@link listSources}, but returns an iterable object. + * + * for-await-of syntax is used with the iterable to recursively get response element on-demand. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Resource name of the parent of sources to list. Its format should + * be "organizations/[organization_id]". + * @param {string} request.pageToken + * The value returned by the last `ListSourcesResponse`; indicates + * that this is a continuation of a prior `ListSources` call, and + * that the system should return the next page of data. + * @param {number} request.pageSize + * The maximum number of results to return in a single response. Default is + * 10, minimum is 1, maximum is 1000. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols. + */ + listSourcesAsync( + request?: protos.google.cloud.securitycenter.v1p1beta1.IListSourcesRequest, + options?: gax.CallOptions + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.listSources.asyncIterate( + this.innerApiCalls['listSources'] as GaxCall, + (request as unknown) as RequestType, + callSettings + ) as AsyncIterable; + } // -------------------- // -- Path templates -- // -------------------- @@ -3607,9 +4617,9 @@ export class SecurityCenterClient { * @returns {string} Resource name string. */ assetPath(organization: string, asset: string) { - return this._pathTemplates.assetPathTemplate.render({ - organization, - asset, + return this.pathTemplates.assetPathTemplate.render({ + organization: organization, + asset: asset, }); } @@ -3621,7 +4631,7 @@ export class SecurityCenterClient { * @returns {string} A string representing the organization. */ matchOrganizationFromAssetName(assetName: string) { - return this._pathTemplates.assetPathTemplate.match(assetName).organization; + return this.pathTemplates.assetPathTemplate.match(assetName).organization; } /** @@ -3632,7 +4642,7 @@ export class SecurityCenterClient { * @returns {string} A string representing the asset. */ matchAssetFromAssetName(assetName: string) { - return this._pathTemplates.assetPathTemplate.match(assetName).asset; + return this.pathTemplates.assetPathTemplate.match(assetName).asset; } /** @@ -3644,10 +4654,10 @@ export class SecurityCenterClient { * @returns {string} Resource name string. */ findingPath(organization: string, source: string, finding: string) { - return this._pathTemplates.findingPathTemplate.render({ - organization, - source, - finding, + return this.pathTemplates.findingPathTemplate.render({ + organization: organization, + source: source, + finding: finding, }); } @@ -3659,7 +4669,7 @@ export class SecurityCenterClient { * @returns {string} A string representing the organization. */ matchOrganizationFromFindingName(findingName: string) { - return this._pathTemplates.findingPathTemplate.match(findingName) + return this.pathTemplates.findingPathTemplate.match(findingName) .organization; } @@ -3671,7 +4681,7 @@ export class SecurityCenterClient { * @returns {string} A string representing the source. */ matchSourceFromFindingName(findingName: string) { - return this._pathTemplates.findingPathTemplate.match(findingName).source; + return this.pathTemplates.findingPathTemplate.match(findingName).source; } /** @@ -3682,7 +4692,7 @@ export class SecurityCenterClient { * @returns {string} A string representing the finding. */ matchFindingFromFindingName(findingName: string) { - return this._pathTemplates.findingPathTemplate.match(findingName).finding; + return this.pathTemplates.findingPathTemplate.match(findingName).finding; } /** @@ -3693,8 +4703,8 @@ export class SecurityCenterClient { * @returns {string} Resource name string. */ notificationConfigPath(organization: string, notificationConfig: string) { - return this._pathTemplates.notificationConfigPathTemplate.render({ - organization, + return this.pathTemplates.notificationConfigPathTemplate.render({ + organization: organization, notification_config: notificationConfig, }); } @@ -3707,7 +4717,7 @@ export class SecurityCenterClient { * @returns {string} A string representing the organization. */ matchOrganizationFromNotificationConfigName(notificationConfigName: string) { - return this._pathTemplates.notificationConfigPathTemplate.match( + return this.pathTemplates.notificationConfigPathTemplate.match( notificationConfigName ).organization; } @@ -3722,7 +4732,7 @@ export class SecurityCenterClient { matchNotificationConfigFromNotificationConfigName( notificationConfigName: string ) { - return this._pathTemplates.notificationConfigPathTemplate.match( + return this.pathTemplates.notificationConfigPathTemplate.match( notificationConfigName ).notification_config; } @@ -3734,8 +4744,8 @@ export class SecurityCenterClient { * @returns {string} Resource name string. */ organizationPath(organization: string) { - return this._pathTemplates.organizationPathTemplate.render({ - organization, + return this.pathTemplates.organizationPathTemplate.render({ + organization: organization, }); } @@ -3747,7 +4757,7 @@ export class SecurityCenterClient { * @returns {string} A string representing the organization. */ matchOrganizationFromOrganizationName(organizationName: string) { - return this._pathTemplates.organizationPathTemplate.match(organizationName) + return this.pathTemplates.organizationPathTemplate.match(organizationName) .organization; } @@ -3759,10 +4769,10 @@ export class SecurityCenterClient { * @returns {string} Resource name string. */ organizationAssetSecurityMarksPath(organization: string, asset: string) { - return this._pathTemplates.organizationAssetSecurityMarksPathTemplate.render( + return this.pathTemplates.organizationAssetSecurityMarksPathTemplate.render( { - organization, - asset, + organization: organization, + asset: asset, } ); } @@ -3777,7 +4787,7 @@ export class SecurityCenterClient { matchOrganizationFromOrganizationAssetSecurityMarksName( organizationAssetSecurityMarksName: string ) { - return this._pathTemplates.organizationAssetSecurityMarksPathTemplate.match( + return this.pathTemplates.organizationAssetSecurityMarksPathTemplate.match( organizationAssetSecurityMarksName ).organization; } @@ -3792,7 +4802,7 @@ export class SecurityCenterClient { matchAssetFromOrganizationAssetSecurityMarksName( organizationAssetSecurityMarksName: string ) { - return this._pathTemplates.organizationAssetSecurityMarksPathTemplate.match( + return this.pathTemplates.organizationAssetSecurityMarksPathTemplate.match( organizationAssetSecurityMarksName ).asset; } @@ -3804,8 +4814,8 @@ export class SecurityCenterClient { * @returns {string} Resource name string. */ organizationSettingsPath(organization: string) { - return this._pathTemplates.organizationSettingsPathTemplate.render({ - organization, + return this.pathTemplates.organizationSettingsPathTemplate.render({ + organization: organization, }); } @@ -3819,7 +4829,7 @@ export class SecurityCenterClient { matchOrganizationFromOrganizationSettingsName( organizationSettingsName: string ) { - return this._pathTemplates.organizationSettingsPathTemplate.match( + return this.pathTemplates.organizationSettingsPathTemplate.match( organizationSettingsName ).organization; } @@ -3837,11 +4847,11 @@ export class SecurityCenterClient { source: string, finding: string ) { - return this._pathTemplates.organizationSourceFindingSecurityMarksPathTemplate.render( + return this.pathTemplates.organizationSourceFindingSecurityMarksPathTemplate.render( { - organization, - source, - finding, + organization: organization, + source: source, + finding: finding, } ); } @@ -3856,7 +4866,7 @@ export class SecurityCenterClient { matchOrganizationFromOrganizationSourceFindingSecurityMarksName( organizationSourceFindingSecurityMarksName: string ) { - return this._pathTemplates.organizationSourceFindingSecurityMarksPathTemplate.match( + return this.pathTemplates.organizationSourceFindingSecurityMarksPathTemplate.match( organizationSourceFindingSecurityMarksName ).organization; } @@ -3871,7 +4881,7 @@ export class SecurityCenterClient { matchSourceFromOrganizationSourceFindingSecurityMarksName( organizationSourceFindingSecurityMarksName: string ) { - return this._pathTemplates.organizationSourceFindingSecurityMarksPathTemplate.match( + return this.pathTemplates.organizationSourceFindingSecurityMarksPathTemplate.match( organizationSourceFindingSecurityMarksName ).source; } @@ -3886,7 +4896,7 @@ export class SecurityCenterClient { matchFindingFromOrganizationSourceFindingSecurityMarksName( organizationSourceFindingSecurityMarksName: string ) { - return this._pathTemplates.organizationSourceFindingSecurityMarksPathTemplate.match( + return this.pathTemplates.organizationSourceFindingSecurityMarksPathTemplate.match( organizationSourceFindingSecurityMarksName ).finding; } @@ -3899,9 +4909,9 @@ export class SecurityCenterClient { * @returns {string} Resource name string. */ sourcePath(organization: string, source: string) { - return this._pathTemplates.sourcePathTemplate.render({ - organization, - source, + return this.pathTemplates.sourcePathTemplate.render({ + organization: organization, + source: source, }); } @@ -3913,8 +4923,7 @@ export class SecurityCenterClient { * @returns {string} A string representing the organization. */ matchOrganizationFromSourceName(sourceName: string) { - return this._pathTemplates.sourcePathTemplate.match(sourceName) - .organization; + return this.pathTemplates.sourcePathTemplate.match(sourceName).organization; } /** @@ -3925,7 +4934,7 @@ export class SecurityCenterClient { * @returns {string} A string representing the source. */ matchSourceFromSourceName(sourceName: string) { - return this._pathTemplates.sourcePathTemplate.match(sourceName).source; + return this.pathTemplates.sourcePathTemplate.match(sourceName).source; } /** diff --git a/packages/google-cloud-securitycenter/synth.metadata b/packages/google-cloud-securitycenter/synth.metadata index 1d7d56c5665..5555c2cf17b 100644 --- a/packages/google-cloud-securitycenter/synth.metadata +++ b/packages/google-cloud-securitycenter/synth.metadata @@ -1,23 +1,5 @@ { - "updateTime": "2020-03-22T11:46:06.076100Z", - "sources": [ - { - "git": { - "name": "googleapis", - "remote": "https://github.com/googleapis/googleapis.git", - "sha": "0be7105dc52590fa9a24e784052298ae37ce53aa", - "internalRef": "302154871", - "log": "0be7105dc52590fa9a24e784052298ae37ce53aa\nAdd BUILD.bazel file to asset/v1p1beta1\n\nPiperOrigin-RevId: 302154871\n\n6c248fd13e8543f8d22cbf118d978301a9fbe2a8\nAdd missing resource annotations and additional_bindings to dialogflow v2 API.\n\nPiperOrigin-RevId: 302063117\n\n9a3a7f33be9eeacf7b3e98435816b7022d206bd7\nChange the service name from \"chromeos-moblab.googleapis.com\" to \"chromeosmoblab.googleapis.com\"\n\nPiperOrigin-RevId: 302060989\n\n98a339237577e3de26cb4921f75fb5c57cc7a19f\nfeat: devtools/build/v1 publish client library config annotations\n\n* add details field to some of the BuildEvents\n* add final_invocation_id and build_tool_exit_code fields to BuildStatus\n\nPiperOrigin-RevId: 302044087\n\ncfabc98c6bbbb22d1aeaf7612179c0be193b3a13\nfeat: home/graph/v1 publish client library config annotations & comment updates\n\nThis change includes adding the client library configuration annotations, updated proto comments, and some client library configuration files.\n\nPiperOrigin-RevId: 302042647\n\nc8c8c0bd15d082db9546253dbaad1087c7a9782c\nchore: use latest gapic-generator in bazel WORKSPACE.\nincluding the following commits from gapic-generator:\n- feat: take source protos in all sub-packages (#3144)\n\nPiperOrigin-RevId: 301843591\n\ne4daf5202ea31cb2cb6916fdbfa9d6bd771aeb4c\nAdd bazel file for v1 client lib generation\n\nPiperOrigin-RevId: 301802926\n\n275fbcce2c900278d487c33293a3c7e1fbcd3a34\nfeat: pubsub/v1 add an experimental filter field to Subscription\n\nPiperOrigin-RevId: 301661567\n\nf2b18cec51d27c999ad30011dba17f3965677e9c\nFix: UpdateBackupRequest.backup is a resource, not a resource reference - remove annotation.\n\nPiperOrigin-RevId: 301636171\n\n800384063ac93a0cac3a510d41726fa4b2cd4a83\nCloud Billing Budget API v1beta1\nModified api documentation to include warnings about the new filter field.\n\nPiperOrigin-RevId: 301634389\n\n0cc6c146b660db21f04056c3d58a4b752ee445e3\nCloud Billing Budget API v1alpha1\nModified api documentation to include warnings about the new filter field.\n\nPiperOrigin-RevId: 301630018\n\nff2ea00f69065585c3ac0993c8b582af3b6fc215\nFix: Add resource definition for a parent of InspectTemplate which was otherwise missing.\n\nPiperOrigin-RevId: 301623052\n\n55fa441c9daf03173910760191646399338f2b7c\nAdd proto definition for AccessLevel, AccessPolicy, and ServicePerimeter.\n\nPiperOrigin-RevId: 301620844\n\ne7b10591c5408a67cf14ffafa267556f3290e262\nCloud Bigtable Managed Backup service and message proto files.\n\nPiperOrigin-RevId: 301585144\n\nd8e226f702f8ddf92915128c9f4693b63fb8685d\nfeat: Add time-to-live in a queue for builds\n\nPiperOrigin-RevId: 301579876\n\n430375af011f8c7a5174884f0d0e539c6ffa7675\ndocs: add missing closing backtick\n\nPiperOrigin-RevId: 301538851\n\n0e9f1f60ded9ad1c2e725e37719112f5b487ab65\nbazel: Use latest release of gax_java\n\nPiperOrigin-RevId: 301480457\n\n5058c1c96d0ece7f5301a154cf5a07b2ad03a571\nUpdate GAPIC v2 with batching parameters for Logging API\n\nPiperOrigin-RevId: 301443847\n\n64ab9744073de81fec1b3a6a931befc8a90edf90\nFix: Introduce location-based organization/folder/billing-account resources\nChore: Update copyright years\n\nPiperOrigin-RevId: 301373760\n\n23d5f09e670ebb0c1b36214acf78704e2ecfc2ac\nUpdate field_behavior annotations in V1 and V2.\n\nPiperOrigin-RevId: 301337970\n\nb2cf37e7fd62383a811aa4d54d013ecae638851d\nData Catalog V1 API\n\nPiperOrigin-RevId: 301282503\n\n1976b9981e2900c8172b7d34b4220bdb18c5db42\nCloud DLP api update. Adds missing fields to Finding and adds support for hybrid jobs.\n\nPiperOrigin-RevId: 301205325\n\nae78682c05e864d71223ce22532219813b0245ac\nfix: several sample code blocks in comments are now properly indented for markdown\n\nPiperOrigin-RevId: 301185150\n\ndcd171d04bda5b67db13049320f97eca3ace3731\nPublish Media Translation API V1Beta1\n\nPiperOrigin-RevId: 301180096\n\nff1713453b0fbc5a7544a1ef6828c26ad21a370e\nAdd protos and BUILD rules for v1 API.\n\nPiperOrigin-RevId: 301179394\n\n8386761d09819b665b6a6e1e6d6ff884bc8ff781\nfeat: chromeos/modlab publish protos and config for Chrome OS Moblab API.\n\nPiperOrigin-RevId: 300843960\n\nb2e2bc62fab90e6829e62d3d189906d9b79899e4\nUpdates to GCS gRPC API spec:\n\n1. Changed GetIamPolicy and TestBucketIamPermissions to use wrapper messages around google.iam.v1 IAM requests messages, and added CommonRequestParams. This lets us support RequesterPays buckets.\n2. Added a metadata field to GetObjectMediaResponse, to support resuming an object media read safely (by extracting the generation of the object being read, and using it in the resumed read request).\n\nPiperOrigin-RevId: 300817706\n\n7fd916ce12335cc9e784bb9452a8602d00b2516c\nAdd deprecated_collections field for backward-compatiblity in PHP and monolith-generated Python and Ruby clients.\n\nGenerate TopicName class in Java which covers the functionality of both ProjectTopicName and DeletedTopicName. Introduce breaking changes to be fixed by synth.py.\n\nDelete default retry parameters.\n\nRetry codes defs can be deleted once # https://github.com/googleapis/gapic-generator/issues/3137 is fixed.\n\nPiperOrigin-RevId: 300813135\n\n047d3a8ac7f75383855df0166144f891d7af08d9\nfix!: google/rpc refactor ErrorInfo.type to ErrorInfo.reason and comment updates.\n\nPiperOrigin-RevId: 300773211\n\nfae4bb6d5aac52aabe5f0bb4396466c2304ea6f6\nAdding RetryPolicy to pubsub.proto\n\nPiperOrigin-RevId: 300769420\n\n7d569be2928dbd72b4e261bf9e468f23afd2b950\nAdding additional protocol buffer annotations to v3.\n\nPiperOrigin-RevId: 300718800\n\n13942d1a85a337515040a03c5108993087dc0e4f\nAdd logging protos for Recommender v1.\n\nPiperOrigin-RevId: 300689896\n\na1a573c3eecfe2c404892bfa61a32dd0c9fb22b6\nfix: change go package to use cloud.google.com/go/maps\n\nPiperOrigin-RevId: 300661825\n\nc6fbac11afa0c7ab2972d9df181493875c566f77\nfeat: publish documentai/v1beta2 protos\n\nPiperOrigin-RevId: 300656808\n\n5202a9e0d9903f49e900f20fe5c7f4e42dd6588f\nProtos for v1beta1 release of Cloud Security Center Settings API\n\nPiperOrigin-RevId: 300580858\n\n83518e18655d9d4ac044acbda063cc6ecdb63ef8\nAdds gapic.yaml file and BUILD.bazel file.\n\nPiperOrigin-RevId: 300554200\n\n836c196dc8ef8354bbfb5f30696bd3477e8db5e2\nRegenerate recommender v1beta1 gRPC ServiceConfig file for Insights methods.\n\nPiperOrigin-RevId: 300549302\n\n34a5450c591b6be3d6566f25ac31caa5211b2f3f\nIncreases the default timeout from 20s to 30s for MetricService\n\nPiperOrigin-RevId: 300474272\n\n5d8bffe87cd01ba390c32f1714230e5a95d5991d\nfeat: use the latest gapic-generator in WORKSPACE for bazel build.\n\nPiperOrigin-RevId: 300461878\n\nd631c651e3bcfac5d371e8560c27648f7b3e2364\nUpdated the GAPIC configs to include parameters for Backups APIs.\n\nPiperOrigin-RevId: 300443402\n\n678afc7055c1adea9b7b54519f3bdb228013f918\nAdding Game Servers v1beta API.\n\nPiperOrigin-RevId: 300433218\n\n80d2bd2c652a5e213302041b0620aff423132589\nEnable proto annotation and gapic v2 for talent API.\n\nPiperOrigin-RevId: 300393997\n\n85e454be7a353f7fe1bf2b0affb753305785b872\ndocs(google/maps/roads): remove mention of nonexported api\n\nPiperOrigin-RevId: 300367734\n\nbf839ae632e0f263a729569e44be4b38b1c85f9c\nAdding protocol buffer annotations and updated config info for v1 and v2.\n\nPiperOrigin-RevId: 300276913\n\n309b899ca18a4c604bce63882a161d44854da549\nPublish `Backup` APIs and protos.\n\nPiperOrigin-RevId: 300246038\n\neced64c3f122421350b4aca68a28e89121d20db8\nadd PHP client libraries\n\nPiperOrigin-RevId: 300193634\n\n7727af0e39df1ae9ad715895c8576d7b65cf6c6d\nfeat: use the latest gapic-generator and protoc-java-resource-name-plugin in googleapis/WORKSPACE.\n\nPiperOrigin-RevId: 300188410\n\n2a25aa351dd5b5fe14895266aff5824d90ce757b\nBreaking change: remove the ProjectOrTenant resource and its references.\n\nPiperOrigin-RevId: 300182152\n\na499dbb28546379415f51803505cfb6123477e71\nUpdate web risk v1 gapic config and BUILD file.\n\nPiperOrigin-RevId: 300152177\n\n52701da10fec2a5f9796e8d12518c0fe574488fe\nFix: apply appropriate namespace/package options for C#, PHP and Ruby.\n\nPiperOrigin-RevId: 300123508\n\n365c029b8cdb63f7751b92ab490f1976e616105c\nAdd CC targets to the kms protos.\n\nThese are needed by go/tink.\n\nPiperOrigin-RevId: 300038469\n\n4ba9aa8a4a1413b88dca5a8fa931824ee9c284e6\nExpose logo recognition API proto for GA.\n\nPiperOrigin-RevId: 299971671\n\n1c9fc2c9e03dadf15f16b1c4f570955bdcebe00e\nAdding ruby_package option to accessapproval.proto for the Ruby client libraries generation.\n\nPiperOrigin-RevId: 299955924\n\n1cc6f0a7bfb147e6f2ede911d9b01e7a9923b719\nbuild(google/maps/routes): generate api clients\n\nPiperOrigin-RevId: 299955905\n\n29a47c965aac79e3fe8e3314482ca0b5967680f0\nIncrease timeout to 1hr for method `dropRange` in bigtable/admin/v2, which is\nsynced with the timeout setting in gapic_yaml.\n\nPiperOrigin-RevId: 299917154\n\n8f631c4c70a60a9c7da3749511ee4ad432b62898\nbuild(google/maps/roads/v1op): move go to monorepo pattern\n\nPiperOrigin-RevId: 299885195\n\nd66816518844ebbf63504c9e8dfc7133921dd2cd\nbuild(google/maps/roads/v1op): Add bazel build files to generate clients.\n\nPiperOrigin-RevId: 299851148\n\naf7dff701fabe029672168649c62356cf1bb43d0\nAdd LogPlayerReports and LogImpressions to Playable Locations service\n\nPiperOrigin-RevId: 299724050\n\nb6927fca808f38df32a642c560082f5bf6538ced\nUpdate BigQuery Connection API v1beta1 proto: added credential to CloudSqlProperties.\n\nPiperOrigin-RevId: 299503150\n\n91e1fb5ef9829c0c7a64bfa5bde330e6ed594378\nchore: update protobuf (protoc) version to 3.11.2\n\nPiperOrigin-RevId: 299404145\n\n30e36b4bee6749c4799f4fc1a51cc8f058ba167d\nUpdate cloud asset api v1p4beta1.\n\nPiperOrigin-RevId: 299399890\n\nffbb493674099f265693872ae250711b2238090c\nfeat: cloudbuild/v1 add new fields and annotate OUTPUT_OUT fields.\n\nPiperOrigin-RevId: 299397780\n\nbc973a15818e00c19e121959832676e9b7607456\nbazel: Fix broken common dependency\n\nPiperOrigin-RevId: 299397431\n\n71094a343e3b962e744aa49eb9338219537474e4\nchore: bigtable/admin/v2 publish retry config\n\nPiperOrigin-RevId: 299391875\n\n8f488efd7bda33885cb674ddd023b3678c40bd82\nfeat: Migrate logging to GAPIC v2; release new features.\n\nIMPORTANT: This is a breaking change for client libraries\nin all languages.\n\nCommitter: @lukesneeringer, @jskeet\nPiperOrigin-RevId: 299370279\n\n007605bf9ad3a1fd775014ebefbf7f1e6b31ee71\nUpdate API for bigqueryreservation v1beta1.\n- Adds flex capacity commitment plan to CapacityCommitment.\n- Adds methods for getting and updating BiReservations.\n- Adds methods for updating/splitting/merging CapacityCommitments.\n\nPiperOrigin-RevId: 299368059\n\n" - } - }, - { - "git": { - "name": "synthtool", - "remote": "https://github.com/googleapis/synthtool.git", - "sha": "7e98e1609c91082f4eeb63b530c6468aefd18cfd" - } - } - ], + "updateTime": "2020-03-31T20:05:15.683979Z", "destinations": [ { "client": { diff --git a/packages/google-cloud-securitycenter/system-test/fixtures/sample/src/index.ts b/packages/google-cloud-securitycenter/system-test/fixtures/sample/src/index.ts index ddaa805ae5a..929bf9bd2d2 100644 --- a/packages/google-cloud-securitycenter/system-test/fixtures/sample/src/index.ts +++ b/packages/google-cloud-securitycenter/system-test/fixtures/sample/src/index.ts @@ -19,7 +19,7 @@ import {SecurityCenterClient} from '@google-cloud/security-center'; function main() { - const securityCenterClient = new SecurityCenterClient(); + new SecurityCenterClient(); } main(); diff --git a/packages/google-cloud-securitycenter/test/gapic-security_center-v1.ts b/packages/google-cloud-securitycenter/test/gapic-security_center-v1.ts deleted file mode 100644 index a2b9576def9..00000000000 --- a/packages/google-cloud-securitycenter/test/gapic-security_center-v1.ts +++ /dev/null @@ -1,1428 +0,0 @@ -// 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 gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -import * as protosTypes from '../protos/protos'; -import * as assert from 'assert'; -import {describe, it} from 'mocha'; -const securitycenterModule = require('../src'); - -const FAKE_STATUS_CODE = 1; -class FakeError { - name: string; - message: string; - code: number; - constructor(n: number) { - this.name = 'fakeName'; - this.message = 'fake message'; - this.code = n; - } -} -const error = new FakeError(FAKE_STATUS_CODE); -export interface Callback { - (err: FakeError | null, response?: {} | null): void; -} - -export class Operation { - constructor() {} - promise() {} -} -function mockSimpleGrpcMethod( - expectedRequest: {}, - response: {} | null, - error: FakeError | null -) { - return (actualRequest: {}, options: {}, callback: Callback) => { - assert.deepStrictEqual(actualRequest, expectedRequest); - if (error) { - callback(error); - } else if (response) { - callback(null, response); - } else { - callback(null); - } - }; -} -function mockLongRunningGrpcMethod( - expectedRequest: {}, - response: {} | null, - error?: {} | null -) { - return (request: {}) => { - assert.deepStrictEqual(request, expectedRequest); - const mockOperation = { - promise() { - return new Promise((resolve, reject) => { - if (error) { - reject(error); - } else { - resolve([response]); - } - }); - }, - }; - return Promise.resolve([mockOperation]); - }; -} -describe('v1.SecurityCenterClient', () => { - it('has servicePath', () => { - const servicePath = - securitycenterModule.v1.SecurityCenterClient.servicePath; - assert(servicePath); - }); - it('has apiEndpoint', () => { - const apiEndpoint = - securitycenterModule.v1.SecurityCenterClient.apiEndpoint; - assert(apiEndpoint); - }); - it('has port', () => { - const port = securitycenterModule.v1.SecurityCenterClient.port; - assert(port); - assert(typeof port === 'number'); - }); - it('should create a client with no option', () => { - const client = new securitycenterModule.v1.SecurityCenterClient(); - assert(client); - }); - it('should create a client with gRPC fallback', () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - fallback: true, - }); - assert(client); - }); - it('has initialize method and supports deferred initialization', async () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.securityCenterStub, undefined); - await client.initialize(); - assert(client.securityCenterStub); - }); - it('has close method', () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.close(); - }); - describe('createSource', () => { - it('invokes createSource without error', done => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.securitycenter.v1.ICreateSourceRequest = {}; - request.parent = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.createSource = mockSimpleGrpcMethod( - request, - expectedResponse, - null - ); - client.createSource(request, (err: {}, response: {}) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes createSource with error', done => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.securitycenter.v1.ICreateSourceRequest = {}; - request.parent = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.createSource = mockSimpleGrpcMethod( - request, - null, - error - ); - client.createSource(request, (err: FakeError, response: {}) => { - assert(err instanceof FakeError); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - describe('createFinding', () => { - it('invokes createFinding without error', done => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.securitycenter.v1.ICreateFindingRequest = {}; - request.parent = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.createFinding = mockSimpleGrpcMethod( - request, - expectedResponse, - null - ); - client.createFinding(request, (err: {}, response: {}) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes createFinding with error', done => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.securitycenter.v1.ICreateFindingRequest = {}; - request.parent = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.createFinding = mockSimpleGrpcMethod( - request, - null, - error - ); - client.createFinding(request, (err: FakeError, response: {}) => { - assert(err instanceof FakeError); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - describe('createNotificationConfig', () => { - it('invokes createNotificationConfig without error', done => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.securitycenter.v1.ICreateNotificationConfigRequest = {}; - request.parent = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.createNotificationConfig = mockSimpleGrpcMethod( - request, - expectedResponse, - null - ); - client.createNotificationConfig(request, (err: {}, response: {}) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes createNotificationConfig with error', done => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.securitycenter.v1.ICreateNotificationConfigRequest = {}; - request.parent = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.createNotificationConfig = mockSimpleGrpcMethod( - request, - null, - error - ); - client.createNotificationConfig( - request, - (err: FakeError, response: {}) => { - assert(err instanceof FakeError); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - } - ); - }); - }); - describe('deleteNotificationConfig', () => { - it('invokes deleteNotificationConfig without error', done => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.securitycenter.v1.IDeleteNotificationConfigRequest = {}; - request.name = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.deleteNotificationConfig = mockSimpleGrpcMethod( - request, - expectedResponse, - null - ); - client.deleteNotificationConfig(request, (err: {}, response: {}) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes deleteNotificationConfig with error', done => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.securitycenter.v1.IDeleteNotificationConfigRequest = {}; - request.name = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.deleteNotificationConfig = mockSimpleGrpcMethod( - request, - null, - error - ); - client.deleteNotificationConfig( - request, - (err: FakeError, response: {}) => { - assert(err instanceof FakeError); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - } - ); - }); - }); - describe('getIamPolicy', () => { - it('invokes getIamPolicy without error', done => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.iam.v1.IGetIamPolicyRequest = {}; - request.resource = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.getIamPolicy = mockSimpleGrpcMethod( - request, - expectedResponse, - null - ); - client.getIamPolicy(request, (err: {}, response: {}) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes getIamPolicy with error', done => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.iam.v1.IGetIamPolicyRequest = {}; - request.resource = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.getIamPolicy = mockSimpleGrpcMethod( - request, - null, - error - ); - client.getIamPolicy(request, (err: FakeError, response: {}) => { - assert(err instanceof FakeError); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - describe('getNotificationConfig', () => { - it('invokes getNotificationConfig without error', done => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.securitycenter.v1.IGetNotificationConfigRequest = {}; - request.name = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.getNotificationConfig = mockSimpleGrpcMethod( - request, - expectedResponse, - null - ); - client.getNotificationConfig(request, (err: {}, response: {}) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes getNotificationConfig with error', done => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.securitycenter.v1.IGetNotificationConfigRequest = {}; - request.name = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.getNotificationConfig = mockSimpleGrpcMethod( - request, - null, - error - ); - client.getNotificationConfig(request, (err: FakeError, response: {}) => { - assert(err instanceof FakeError); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - describe('getOrganizationSettings', () => { - it('invokes getOrganizationSettings without error', done => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.securitycenter.v1.IGetOrganizationSettingsRequest = {}; - request.name = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.getOrganizationSettings = mockSimpleGrpcMethod( - request, - expectedResponse, - null - ); - client.getOrganizationSettings(request, (err: {}, response: {}) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes getOrganizationSettings with error', done => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.securitycenter.v1.IGetOrganizationSettingsRequest = {}; - request.name = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.getOrganizationSettings = mockSimpleGrpcMethod( - request, - null, - error - ); - client.getOrganizationSettings( - request, - (err: FakeError, response: {}) => { - assert(err instanceof FakeError); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - } - ); - }); - }); - describe('getSource', () => { - it('invokes getSource without error', done => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.securitycenter.v1.IGetSourceRequest = {}; - request.name = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.getSource = mockSimpleGrpcMethod( - request, - expectedResponse, - null - ); - client.getSource(request, (err: {}, response: {}) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes getSource with error', done => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.securitycenter.v1.IGetSourceRequest = {}; - request.name = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.getSource = mockSimpleGrpcMethod( - request, - null, - error - ); - client.getSource(request, (err: FakeError, response: {}) => { - assert(err instanceof FakeError); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - describe('setFindingState', () => { - it('invokes setFindingState without error', done => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.securitycenter.v1.ISetFindingStateRequest = {}; - request.name = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.setFindingState = mockSimpleGrpcMethod( - request, - expectedResponse, - null - ); - client.setFindingState(request, (err: {}, response: {}) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes setFindingState with error', done => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.securitycenter.v1.ISetFindingStateRequest = {}; - request.name = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.setFindingState = mockSimpleGrpcMethod( - request, - null, - error - ); - client.setFindingState(request, (err: FakeError, response: {}) => { - assert(err instanceof FakeError); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - describe('setIamPolicy', () => { - it('invokes setIamPolicy without error', done => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.iam.v1.ISetIamPolicyRequest = {}; - request.resource = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.setIamPolicy = mockSimpleGrpcMethod( - request, - expectedResponse, - null - ); - client.setIamPolicy(request, (err: {}, response: {}) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes setIamPolicy with error', done => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.iam.v1.ISetIamPolicyRequest = {}; - request.resource = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.setIamPolicy = mockSimpleGrpcMethod( - request, - null, - error - ); - client.setIamPolicy(request, (err: FakeError, response: {}) => { - assert(err instanceof FakeError); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - describe('testIamPermissions', () => { - it('invokes testIamPermissions without error', done => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.iam.v1.ITestIamPermissionsRequest = {}; - request.resource = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.testIamPermissions = mockSimpleGrpcMethod( - request, - expectedResponse, - null - ); - client.testIamPermissions(request, (err: {}, response: {}) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes testIamPermissions with error', done => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.iam.v1.ITestIamPermissionsRequest = {}; - request.resource = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.testIamPermissions = mockSimpleGrpcMethod( - request, - null, - error - ); - client.testIamPermissions(request, (err: FakeError, response: {}) => { - assert(err instanceof FakeError); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - describe('updateFinding', () => { - it('invokes updateFinding without error', done => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.securitycenter.v1.IUpdateFindingRequest = {}; - request.finding = {}; - request.finding.name = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.updateFinding = mockSimpleGrpcMethod( - request, - expectedResponse, - null - ); - client.updateFinding(request, (err: {}, response: {}) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes updateFinding with error', done => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.securitycenter.v1.IUpdateFindingRequest = {}; - request.finding = {}; - request.finding.name = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.updateFinding = mockSimpleGrpcMethod( - request, - null, - error - ); - client.updateFinding(request, (err: FakeError, response: {}) => { - assert(err instanceof FakeError); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - describe('updateNotificationConfig', () => { - it('invokes updateNotificationConfig without error', done => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.securitycenter.v1.IUpdateNotificationConfigRequest = {}; - request.notificationConfig = {}; - request.notificationConfig.name = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.updateNotificationConfig = mockSimpleGrpcMethod( - request, - expectedResponse, - null - ); - client.updateNotificationConfig(request, (err: {}, response: {}) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes updateNotificationConfig with error', done => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.securitycenter.v1.IUpdateNotificationConfigRequest = {}; - request.notificationConfig = {}; - request.notificationConfig.name = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.updateNotificationConfig = mockSimpleGrpcMethod( - request, - null, - error - ); - client.updateNotificationConfig( - request, - (err: FakeError, response: {}) => { - assert(err instanceof FakeError); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - } - ); - }); - }); - describe('updateOrganizationSettings', () => { - it('invokes updateOrganizationSettings without error', done => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.securitycenter.v1.IUpdateOrganizationSettingsRequest = {}; - request.organizationSettings = {}; - request.organizationSettings.name = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.updateOrganizationSettings = mockSimpleGrpcMethod( - request, - expectedResponse, - null - ); - client.updateOrganizationSettings(request, (err: {}, response: {}) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes updateOrganizationSettings with error', done => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.securitycenter.v1.IUpdateOrganizationSettingsRequest = {}; - request.organizationSettings = {}; - request.organizationSettings.name = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.updateOrganizationSettings = mockSimpleGrpcMethod( - request, - null, - error - ); - client.updateOrganizationSettings( - request, - (err: FakeError, response: {}) => { - assert(err instanceof FakeError); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - } - ); - }); - }); - describe('updateSource', () => { - it('invokes updateSource without error', done => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.securitycenter.v1.IUpdateSourceRequest = {}; - request.source = {}; - request.source.name = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.updateSource = mockSimpleGrpcMethod( - request, - expectedResponse, - null - ); - client.updateSource(request, (err: {}, response: {}) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes updateSource with error', done => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.securitycenter.v1.IUpdateSourceRequest = {}; - request.source = {}; - request.source.name = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.updateSource = mockSimpleGrpcMethod( - request, - null, - error - ); - client.updateSource(request, (err: FakeError, response: {}) => { - assert(err instanceof FakeError); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - describe('updateSecurityMarks', () => { - it('invokes updateSecurityMarks without error', done => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.securitycenter.v1.IUpdateSecurityMarksRequest = {}; - request.securityMarks = {}; - request.securityMarks.name = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.updateSecurityMarks = mockSimpleGrpcMethod( - request, - expectedResponse, - null - ); - client.updateSecurityMarks(request, (err: {}, response: {}) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes updateSecurityMarks with error', done => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.securitycenter.v1.IUpdateSecurityMarksRequest = {}; - request.securityMarks = {}; - request.securityMarks.name = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.updateSecurityMarks = mockSimpleGrpcMethod( - request, - null, - error - ); - client.updateSecurityMarks(request, (err: FakeError, response: {}) => { - assert(err instanceof FakeError); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - describe('runAssetDiscovery', () => { - it('invokes runAssetDiscovery without error', done => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.securitycenter.v1.IRunAssetDiscoveryRequest = {}; - request.parent = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.runAssetDiscovery = mockLongRunningGrpcMethod( - request, - expectedResponse - ); - client - .runAssetDiscovery(request) - .then((responses: [Operation]) => { - const operation = responses[0]; - return operation ? operation.promise() : {}; - }) - .then((responses: [Operation]) => { - assert.deepStrictEqual(responses[0], expectedResponse); - done(); - }) - .catch((err: {}) => { - done(err); - }); - }); - - it('invokes runAssetDiscovery with error', done => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.securitycenter.v1.IRunAssetDiscoveryRequest = {}; - request.parent = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.runAssetDiscovery = mockLongRunningGrpcMethod( - request, - null, - error - ); - client - .runAssetDiscovery(request) - .then((responses: [Operation]) => { - const operation = responses[0]; - return operation ? operation.promise() : {}; - }) - .then(() => { - assert.fail(); - }) - .catch((err: FakeError) => { - assert(err instanceof FakeError); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - done(); - }); - }); - }); - describe('groupAssets', () => { - it('invokes groupAssets without error', done => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.securitycenter.v1.IGroupAssetsRequest = {}; - request.parent = ''; - // Mock response - const expectedResponse = {}; - // Mock Grpc layer - client._innerApiCalls.groupAssets = ( - actualRequest: {}, - options: {}, - callback: Callback - ) => { - assert.deepStrictEqual(actualRequest, request); - callback(null, expectedResponse); - }; - client.groupAssets(request, (err: FakeError, response: {}) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - }); - describe('groupAssetsStream', () => { - it('invokes groupAssetsStream without error', done => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.securitycenter.v1.IGroupAssetsRequest = {}; - request.parent = ''; - // Mock response - const expectedResponse = {response: 'data'}; - // Mock Grpc layer - client._innerApiCalls.groupAssets = ( - actualRequest: {}, - options: {}, - callback: Callback - ) => { - assert.deepStrictEqual(actualRequest, request); - callback(null, expectedResponse); - }; - const stream = client - .groupAssetsStream(request, {}) - .on('data', (response: {}) => { - assert.deepStrictEqual(response, expectedResponse); - done(); - }) - .on('error', (err: FakeError) => { - done(err); - }); - stream.write(expectedResponse); - }); - }); - describe('groupFindings', () => { - it('invokes groupFindings without error', done => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.securitycenter.v1.IGroupFindingsRequest = {}; - request.parent = ''; - // Mock response - const expectedResponse = {}; - // Mock Grpc layer - client._innerApiCalls.groupFindings = ( - actualRequest: {}, - options: {}, - callback: Callback - ) => { - assert.deepStrictEqual(actualRequest, request); - callback(null, expectedResponse); - }; - client.groupFindings(request, (err: FakeError, response: {}) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - }); - describe('groupFindingsStream', () => { - it('invokes groupFindingsStream without error', done => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.securitycenter.v1.IGroupFindingsRequest = {}; - request.parent = ''; - // Mock response - const expectedResponse = {response: 'data'}; - // Mock Grpc layer - client._innerApiCalls.groupFindings = ( - actualRequest: {}, - options: {}, - callback: Callback - ) => { - assert.deepStrictEqual(actualRequest, request); - callback(null, expectedResponse); - }; - const stream = client - .groupFindingsStream(request, {}) - .on('data', (response: {}) => { - assert.deepStrictEqual(response, expectedResponse); - done(); - }) - .on('error', (err: FakeError) => { - done(err); - }); - stream.write(expectedResponse); - }); - }); - describe('listAssets', () => { - it('invokes listAssets without error', done => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.securitycenter.v1.IListAssetsRequest = {}; - request.parent = ''; - // Mock response - const expectedResponse = {}; - // Mock Grpc layer - client._innerApiCalls.listAssets = ( - actualRequest: {}, - options: {}, - callback: Callback - ) => { - assert.deepStrictEqual(actualRequest, request); - callback(null, expectedResponse); - }; - client.listAssets(request, (err: FakeError, response: {}) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - }); - describe('listAssetsStream', () => { - it('invokes listAssetsStream without error', done => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.securitycenter.v1.IListAssetsRequest = {}; - request.parent = ''; - // Mock response - const expectedResponse = {response: 'data'}; - // Mock Grpc layer - client._innerApiCalls.listAssets = ( - actualRequest: {}, - options: {}, - callback: Callback - ) => { - assert.deepStrictEqual(actualRequest, request); - callback(null, expectedResponse); - }; - const stream = client - .listAssetsStream(request, {}) - .on('data', (response: {}) => { - assert.deepStrictEqual(response, expectedResponse); - done(); - }) - .on('error', (err: FakeError) => { - done(err); - }); - stream.write(expectedResponse); - }); - }); - describe('listFindings', () => { - it('invokes listFindings without error', done => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.securitycenter.v1.IListFindingsRequest = {}; - request.parent = ''; - // Mock response - const expectedResponse = {}; - // Mock Grpc layer - client._innerApiCalls.listFindings = ( - actualRequest: {}, - options: {}, - callback: Callback - ) => { - assert.deepStrictEqual(actualRequest, request); - callback(null, expectedResponse); - }; - client.listFindings(request, (err: FakeError, response: {}) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - }); - describe('listFindingsStream', () => { - it('invokes listFindingsStream without error', done => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.securitycenter.v1.IListFindingsRequest = {}; - request.parent = ''; - // Mock response - const expectedResponse = {response: 'data'}; - // Mock Grpc layer - client._innerApiCalls.listFindings = ( - actualRequest: {}, - options: {}, - callback: Callback - ) => { - assert.deepStrictEqual(actualRequest, request); - callback(null, expectedResponse); - }; - const stream = client - .listFindingsStream(request, {}) - .on('data', (response: {}) => { - assert.deepStrictEqual(response, expectedResponse); - done(); - }) - .on('error', (err: FakeError) => { - done(err); - }); - stream.write(expectedResponse); - }); - }); - describe('listNotificationConfigs', () => { - it('invokes listNotificationConfigs without error', done => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.securitycenter.v1.IListNotificationConfigsRequest = {}; - request.parent = ''; - // Mock response - const expectedResponse = {}; - // Mock Grpc layer - client._innerApiCalls.listNotificationConfigs = ( - actualRequest: {}, - options: {}, - callback: Callback - ) => { - assert.deepStrictEqual(actualRequest, request); - callback(null, expectedResponse); - }; - client.listNotificationConfigs( - request, - (err: FakeError, response: {}) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - } - ); - }); - }); - describe('listNotificationConfigsStream', () => { - it('invokes listNotificationConfigsStream without error', done => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.securitycenter.v1.IListNotificationConfigsRequest = {}; - request.parent = ''; - // Mock response - const expectedResponse = {response: 'data'}; - // Mock Grpc layer - client._innerApiCalls.listNotificationConfigs = ( - actualRequest: {}, - options: {}, - callback: Callback - ) => { - assert.deepStrictEqual(actualRequest, request); - callback(null, expectedResponse); - }; - const stream = client - .listNotificationConfigsStream(request, {}) - .on('data', (response: {}) => { - assert.deepStrictEqual(response, expectedResponse); - done(); - }) - .on('error', (err: FakeError) => { - done(err); - }); - stream.write(expectedResponse); - }); - }); - describe('listSources', () => { - it('invokes listSources without error', done => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.securitycenter.v1.IListSourcesRequest = {}; - request.parent = ''; - // Mock response - const expectedResponse = {}; - // Mock Grpc layer - client._innerApiCalls.listSources = ( - actualRequest: {}, - options: {}, - callback: Callback - ) => { - assert.deepStrictEqual(actualRequest, request); - callback(null, expectedResponse); - }; - client.listSources(request, (err: FakeError, response: {}) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - }); - describe('listSourcesStream', () => { - it('invokes listSourcesStream without error', done => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.securitycenter.v1.IListSourcesRequest = {}; - request.parent = ''; - // Mock response - const expectedResponse = {response: 'data'}; - // Mock Grpc layer - client._innerApiCalls.listSources = ( - actualRequest: {}, - options: {}, - callback: Callback - ) => { - assert.deepStrictEqual(actualRequest, request); - callback(null, expectedResponse); - }; - const stream = client - .listSourcesStream(request, {}) - .on('data', (response: {}) => { - assert.deepStrictEqual(response, expectedResponse); - done(); - }) - .on('error', (err: FakeError) => { - done(err); - }); - stream.write(expectedResponse); - }); - }); -}); diff --git a/packages/google-cloud-securitycenter/test/gapic-security_center-v1beta1.ts b/packages/google-cloud-securitycenter/test/gapic-security_center-v1beta1.ts deleted file mode 100644 index e321432a982..00000000000 --- a/packages/google-cloud-securitycenter/test/gapic-security_center-v1beta1.ts +++ /dev/null @@ -1,1143 +0,0 @@ -// 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 gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -import * as protosTypes from '../protos/protos'; -import * as assert from 'assert'; -import {describe, it} from 'mocha'; -const securitycenterModule = require('../src'); - -const FAKE_STATUS_CODE = 1; -class FakeError { - name: string; - message: string; - code: number; - constructor(n: number) { - this.name = 'fakeName'; - this.message = 'fake message'; - this.code = n; - } -} -const error = new FakeError(FAKE_STATUS_CODE); -export interface Callback { - (err: FakeError | null, response?: {} | null): void; -} - -export class Operation { - constructor() {} - promise() {} -} -function mockSimpleGrpcMethod( - expectedRequest: {}, - response: {} | null, - error: FakeError | null -) { - return (actualRequest: {}, options: {}, callback: Callback) => { - assert.deepStrictEqual(actualRequest, expectedRequest); - if (error) { - callback(error); - } else if (response) { - callback(null, response); - } else { - callback(null); - } - }; -} -function mockLongRunningGrpcMethod( - expectedRequest: {}, - response: {} | null, - error?: {} | null -) { - return (request: {}) => { - assert.deepStrictEqual(request, expectedRequest); - const mockOperation = { - promise() { - return new Promise((resolve, reject) => { - if (error) { - reject(error); - } else { - resolve([response]); - } - }); - }, - }; - return Promise.resolve([mockOperation]); - }; -} -describe('v1beta1.SecurityCenterClient', () => { - it('has servicePath', () => { - const servicePath = - securitycenterModule.v1beta1.SecurityCenterClient.servicePath; - assert(servicePath); - }); - it('has apiEndpoint', () => { - const apiEndpoint = - securitycenterModule.v1beta1.SecurityCenterClient.apiEndpoint; - assert(apiEndpoint); - }); - it('has port', () => { - const port = securitycenterModule.v1beta1.SecurityCenterClient.port; - assert(port); - assert(typeof port === 'number'); - }); - it('should create a client with no option', () => { - const client = new securitycenterModule.v1beta1.SecurityCenterClient(); - assert(client); - }); - it('should create a client with gRPC fallback', () => { - const client = new securitycenterModule.v1beta1.SecurityCenterClient({ - fallback: true, - }); - assert(client); - }); - it('has initialize method and supports deferred initialization', async () => { - const client = new securitycenterModule.v1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.securityCenterStub, undefined); - await client.initialize(); - assert(client.securityCenterStub); - }); - it('has close method', () => { - const client = new securitycenterModule.v1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.close(); - }); - describe('createSource', () => { - it('invokes createSource without error', done => { - const client = new securitycenterModule.v1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.securitycenter.v1beta1.ICreateSourceRequest = {}; - request.parent = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.createSource = mockSimpleGrpcMethod( - request, - expectedResponse, - null - ); - client.createSource(request, (err: {}, response: {}) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes createSource with error', done => { - const client = new securitycenterModule.v1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.securitycenter.v1beta1.ICreateSourceRequest = {}; - request.parent = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.createSource = mockSimpleGrpcMethod( - request, - null, - error - ); - client.createSource(request, (err: FakeError, response: {}) => { - assert(err instanceof FakeError); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - describe('createFinding', () => { - it('invokes createFinding without error', done => { - const client = new securitycenterModule.v1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.securitycenter.v1beta1.ICreateFindingRequest = {}; - request.parent = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.createFinding = mockSimpleGrpcMethod( - request, - expectedResponse, - null - ); - client.createFinding(request, (err: {}, response: {}) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes createFinding with error', done => { - const client = new securitycenterModule.v1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.securitycenter.v1beta1.ICreateFindingRequest = {}; - request.parent = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.createFinding = mockSimpleGrpcMethod( - request, - null, - error - ); - client.createFinding(request, (err: FakeError, response: {}) => { - assert(err instanceof FakeError); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - describe('getIamPolicy', () => { - it('invokes getIamPolicy without error', done => { - const client = new securitycenterModule.v1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.iam.v1.IGetIamPolicyRequest = {}; - request.resource = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.getIamPolicy = mockSimpleGrpcMethod( - request, - expectedResponse, - null - ); - client.getIamPolicy(request, (err: {}, response: {}) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes getIamPolicy with error', done => { - const client = new securitycenterModule.v1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.iam.v1.IGetIamPolicyRequest = {}; - request.resource = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.getIamPolicy = mockSimpleGrpcMethod( - request, - null, - error - ); - client.getIamPolicy(request, (err: FakeError, response: {}) => { - assert(err instanceof FakeError); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - describe('getOrganizationSettings', () => { - it('invokes getOrganizationSettings without error', done => { - const client = new securitycenterModule.v1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.securitycenter.v1beta1.IGetOrganizationSettingsRequest = {}; - request.name = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.getOrganizationSettings = mockSimpleGrpcMethod( - request, - expectedResponse, - null - ); - client.getOrganizationSettings(request, (err: {}, response: {}) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes getOrganizationSettings with error', done => { - const client = new securitycenterModule.v1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.securitycenter.v1beta1.IGetOrganizationSettingsRequest = {}; - request.name = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.getOrganizationSettings = mockSimpleGrpcMethod( - request, - null, - error - ); - client.getOrganizationSettings( - request, - (err: FakeError, response: {}) => { - assert(err instanceof FakeError); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - } - ); - }); - }); - describe('getSource', () => { - it('invokes getSource without error', done => { - const client = new securitycenterModule.v1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.securitycenter.v1beta1.IGetSourceRequest = {}; - request.name = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.getSource = mockSimpleGrpcMethod( - request, - expectedResponse, - null - ); - client.getSource(request, (err: {}, response: {}) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes getSource with error', done => { - const client = new securitycenterModule.v1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.securitycenter.v1beta1.IGetSourceRequest = {}; - request.name = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.getSource = mockSimpleGrpcMethod( - request, - null, - error - ); - client.getSource(request, (err: FakeError, response: {}) => { - assert(err instanceof FakeError); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - describe('setFindingState', () => { - it('invokes setFindingState without error', done => { - const client = new securitycenterModule.v1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.securitycenter.v1beta1.ISetFindingStateRequest = {}; - request.name = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.setFindingState = mockSimpleGrpcMethod( - request, - expectedResponse, - null - ); - client.setFindingState(request, (err: {}, response: {}) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes setFindingState with error', done => { - const client = new securitycenterModule.v1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.securitycenter.v1beta1.ISetFindingStateRequest = {}; - request.name = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.setFindingState = mockSimpleGrpcMethod( - request, - null, - error - ); - client.setFindingState(request, (err: FakeError, response: {}) => { - assert(err instanceof FakeError); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - describe('setIamPolicy', () => { - it('invokes setIamPolicy without error', done => { - const client = new securitycenterModule.v1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.iam.v1.ISetIamPolicyRequest = {}; - request.resource = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.setIamPolicy = mockSimpleGrpcMethod( - request, - expectedResponse, - null - ); - client.setIamPolicy(request, (err: {}, response: {}) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes setIamPolicy with error', done => { - const client = new securitycenterModule.v1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.iam.v1.ISetIamPolicyRequest = {}; - request.resource = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.setIamPolicy = mockSimpleGrpcMethod( - request, - null, - error - ); - client.setIamPolicy(request, (err: FakeError, response: {}) => { - assert(err instanceof FakeError); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - describe('testIamPermissions', () => { - it('invokes testIamPermissions without error', done => { - const client = new securitycenterModule.v1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.iam.v1.ITestIamPermissionsRequest = {}; - request.resource = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.testIamPermissions = mockSimpleGrpcMethod( - request, - expectedResponse, - null - ); - client.testIamPermissions(request, (err: {}, response: {}) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes testIamPermissions with error', done => { - const client = new securitycenterModule.v1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.iam.v1.ITestIamPermissionsRequest = {}; - request.resource = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.testIamPermissions = mockSimpleGrpcMethod( - request, - null, - error - ); - client.testIamPermissions(request, (err: FakeError, response: {}) => { - assert(err instanceof FakeError); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - describe('updateFinding', () => { - it('invokes updateFinding without error', done => { - const client = new securitycenterModule.v1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.securitycenter.v1beta1.IUpdateFindingRequest = {}; - request.finding = {}; - request.finding.name = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.updateFinding = mockSimpleGrpcMethod( - request, - expectedResponse, - null - ); - client.updateFinding(request, (err: {}, response: {}) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes updateFinding with error', done => { - const client = new securitycenterModule.v1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.securitycenter.v1beta1.IUpdateFindingRequest = {}; - request.finding = {}; - request.finding.name = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.updateFinding = mockSimpleGrpcMethod( - request, - null, - error - ); - client.updateFinding(request, (err: FakeError, response: {}) => { - assert(err instanceof FakeError); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - describe('updateOrganizationSettings', () => { - it('invokes updateOrganizationSettings without error', done => { - const client = new securitycenterModule.v1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.securitycenter.v1beta1.IUpdateOrganizationSettingsRequest = {}; - request.organizationSettings = {}; - request.organizationSettings.name = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.updateOrganizationSettings = mockSimpleGrpcMethod( - request, - expectedResponse, - null - ); - client.updateOrganizationSettings(request, (err: {}, response: {}) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes updateOrganizationSettings with error', done => { - const client = new securitycenterModule.v1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.securitycenter.v1beta1.IUpdateOrganizationSettingsRequest = {}; - request.organizationSettings = {}; - request.organizationSettings.name = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.updateOrganizationSettings = mockSimpleGrpcMethod( - request, - null, - error - ); - client.updateOrganizationSettings( - request, - (err: FakeError, response: {}) => { - assert(err instanceof FakeError); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - } - ); - }); - }); - describe('updateSource', () => { - it('invokes updateSource without error', done => { - const client = new securitycenterModule.v1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.securitycenter.v1beta1.IUpdateSourceRequest = {}; - request.source = {}; - request.source.name = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.updateSource = mockSimpleGrpcMethod( - request, - expectedResponse, - null - ); - client.updateSource(request, (err: {}, response: {}) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes updateSource with error', done => { - const client = new securitycenterModule.v1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.securitycenter.v1beta1.IUpdateSourceRequest = {}; - request.source = {}; - request.source.name = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.updateSource = mockSimpleGrpcMethod( - request, - null, - error - ); - client.updateSource(request, (err: FakeError, response: {}) => { - assert(err instanceof FakeError); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - describe('updateSecurityMarks', () => { - it('invokes updateSecurityMarks without error', done => { - const client = new securitycenterModule.v1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.securitycenter.v1beta1.IUpdateSecurityMarksRequest = {}; - request.securityMarks = {}; - request.securityMarks.name = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.updateSecurityMarks = mockSimpleGrpcMethod( - request, - expectedResponse, - null - ); - client.updateSecurityMarks(request, (err: {}, response: {}) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes updateSecurityMarks with error', done => { - const client = new securitycenterModule.v1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.securitycenter.v1beta1.IUpdateSecurityMarksRequest = {}; - request.securityMarks = {}; - request.securityMarks.name = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.updateSecurityMarks = mockSimpleGrpcMethod( - request, - null, - error - ); - client.updateSecurityMarks(request, (err: FakeError, response: {}) => { - assert(err instanceof FakeError); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - describe('runAssetDiscovery', () => { - it('invokes runAssetDiscovery without error', done => { - const client = new securitycenterModule.v1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.securitycenter.v1beta1.IRunAssetDiscoveryRequest = {}; - request.parent = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.runAssetDiscovery = mockLongRunningGrpcMethod( - request, - expectedResponse - ); - client - .runAssetDiscovery(request) - .then((responses: [Operation]) => { - const operation = responses[0]; - return operation ? operation.promise() : {}; - }) - .then((responses: [Operation]) => { - assert.deepStrictEqual(responses[0], expectedResponse); - done(); - }) - .catch((err: {}) => { - done(err); - }); - }); - - it('invokes runAssetDiscovery with error', done => { - const client = new securitycenterModule.v1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.securitycenter.v1beta1.IRunAssetDiscoveryRequest = {}; - request.parent = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.runAssetDiscovery = mockLongRunningGrpcMethod( - request, - null, - error - ); - client - .runAssetDiscovery(request) - .then((responses: [Operation]) => { - const operation = responses[0]; - return operation ? operation.promise() : {}; - }) - .then(() => { - assert.fail(); - }) - .catch((err: FakeError) => { - assert(err instanceof FakeError); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - done(); - }); - }); - }); - describe('groupAssets', () => { - it('invokes groupAssets without error', done => { - const client = new securitycenterModule.v1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.securitycenter.v1beta1.IGroupAssetsRequest = {}; - request.parent = ''; - // Mock response - const expectedResponse = {}; - // Mock Grpc layer - client._innerApiCalls.groupAssets = ( - actualRequest: {}, - options: {}, - callback: Callback - ) => { - assert.deepStrictEqual(actualRequest, request); - callback(null, expectedResponse); - }; - client.groupAssets(request, (err: FakeError, response: {}) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - }); - describe('groupAssetsStream', () => { - it('invokes groupAssetsStream without error', done => { - const client = new securitycenterModule.v1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.securitycenter.v1beta1.IGroupAssetsRequest = {}; - request.parent = ''; - // Mock response - const expectedResponse = {response: 'data'}; - // Mock Grpc layer - client._innerApiCalls.groupAssets = ( - actualRequest: {}, - options: {}, - callback: Callback - ) => { - assert.deepStrictEqual(actualRequest, request); - callback(null, expectedResponse); - }; - const stream = client - .groupAssetsStream(request, {}) - .on('data', (response: {}) => { - assert.deepStrictEqual(response, expectedResponse); - done(); - }) - .on('error', (err: FakeError) => { - done(err); - }); - stream.write(expectedResponse); - }); - }); - describe('groupFindings', () => { - it('invokes groupFindings without error', done => { - const client = new securitycenterModule.v1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.securitycenter.v1beta1.IGroupFindingsRequest = {}; - request.parent = ''; - // Mock response - const expectedResponse = {}; - // Mock Grpc layer - client._innerApiCalls.groupFindings = ( - actualRequest: {}, - options: {}, - callback: Callback - ) => { - assert.deepStrictEqual(actualRequest, request); - callback(null, expectedResponse); - }; - client.groupFindings(request, (err: FakeError, response: {}) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - }); - describe('groupFindingsStream', () => { - it('invokes groupFindingsStream without error', done => { - const client = new securitycenterModule.v1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.securitycenter.v1beta1.IGroupFindingsRequest = {}; - request.parent = ''; - // Mock response - const expectedResponse = {response: 'data'}; - // Mock Grpc layer - client._innerApiCalls.groupFindings = ( - actualRequest: {}, - options: {}, - callback: Callback - ) => { - assert.deepStrictEqual(actualRequest, request); - callback(null, expectedResponse); - }; - const stream = client - .groupFindingsStream(request, {}) - .on('data', (response: {}) => { - assert.deepStrictEqual(response, expectedResponse); - done(); - }) - .on('error', (err: FakeError) => { - done(err); - }); - stream.write(expectedResponse); - }); - }); - describe('listAssets', () => { - it('invokes listAssets without error', done => { - const client = new securitycenterModule.v1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.securitycenter.v1beta1.IListAssetsRequest = {}; - request.parent = ''; - // Mock response - const expectedResponse = {}; - // Mock Grpc layer - client._innerApiCalls.listAssets = ( - actualRequest: {}, - options: {}, - callback: Callback - ) => { - assert.deepStrictEqual(actualRequest, request); - callback(null, expectedResponse); - }; - client.listAssets(request, (err: FakeError, response: {}) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - }); - describe('listAssetsStream', () => { - it('invokes listAssetsStream without error', done => { - const client = new securitycenterModule.v1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.securitycenter.v1beta1.IListAssetsRequest = {}; - request.parent = ''; - // Mock response - const expectedResponse = {response: 'data'}; - // Mock Grpc layer - client._innerApiCalls.listAssets = ( - actualRequest: {}, - options: {}, - callback: Callback - ) => { - assert.deepStrictEqual(actualRequest, request); - callback(null, expectedResponse); - }; - const stream = client - .listAssetsStream(request, {}) - .on('data', (response: {}) => { - assert.deepStrictEqual(response, expectedResponse); - done(); - }) - .on('error', (err: FakeError) => { - done(err); - }); - stream.write(expectedResponse); - }); - }); - describe('listFindings', () => { - it('invokes listFindings without error', done => { - const client = new securitycenterModule.v1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.securitycenter.v1beta1.IListFindingsRequest = {}; - request.parent = ''; - // Mock response - const expectedResponse = {}; - // Mock Grpc layer - client._innerApiCalls.listFindings = ( - actualRequest: {}, - options: {}, - callback: Callback - ) => { - assert.deepStrictEqual(actualRequest, request); - callback(null, expectedResponse); - }; - client.listFindings(request, (err: FakeError, response: {}) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - }); - describe('listFindingsStream', () => { - it('invokes listFindingsStream without error', done => { - const client = new securitycenterModule.v1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.securitycenter.v1beta1.IListFindingsRequest = {}; - request.parent = ''; - // Mock response - const expectedResponse = {response: 'data'}; - // Mock Grpc layer - client._innerApiCalls.listFindings = ( - actualRequest: {}, - options: {}, - callback: Callback - ) => { - assert.deepStrictEqual(actualRequest, request); - callback(null, expectedResponse); - }; - const stream = client - .listFindingsStream(request, {}) - .on('data', (response: {}) => { - assert.deepStrictEqual(response, expectedResponse); - done(); - }) - .on('error', (err: FakeError) => { - done(err); - }); - stream.write(expectedResponse); - }); - }); - describe('listSources', () => { - it('invokes listSources without error', done => { - const client = new securitycenterModule.v1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.securitycenter.v1beta1.IListSourcesRequest = {}; - request.parent = ''; - // Mock response - const expectedResponse = {}; - // Mock Grpc layer - client._innerApiCalls.listSources = ( - actualRequest: {}, - options: {}, - callback: Callback - ) => { - assert.deepStrictEqual(actualRequest, request); - callback(null, expectedResponse); - }; - client.listSources(request, (err: FakeError, response: {}) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - }); - describe('listSourcesStream', () => { - it('invokes listSourcesStream without error', done => { - const client = new securitycenterModule.v1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.securitycenter.v1beta1.IListSourcesRequest = {}; - request.parent = ''; - // Mock response - const expectedResponse = {response: 'data'}; - // Mock Grpc layer - client._innerApiCalls.listSources = ( - actualRequest: {}, - options: {}, - callback: Callback - ) => { - assert.deepStrictEqual(actualRequest, request); - callback(null, expectedResponse); - }; - const stream = client - .listSourcesStream(request, {}) - .on('data', (response: {}) => { - assert.deepStrictEqual(response, expectedResponse); - done(); - }) - .on('error', (err: FakeError) => { - done(err); - }); - stream.write(expectedResponse); - }); - }); -}); diff --git a/packages/google-cloud-securitycenter/test/gapic-security_center-v1p1beta1.ts b/packages/google-cloud-securitycenter/test/gapic-security_center-v1p1beta1.ts deleted file mode 100644 index fb8c4742af2..00000000000 --- a/packages/google-cloud-securitycenter/test/gapic-security_center-v1p1beta1.ts +++ /dev/null @@ -1,1428 +0,0 @@ -// 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 gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -import * as protosTypes from '../protos/protos'; -import * as assert from 'assert'; -import {describe, it} from 'mocha'; -const securitycenterModule = require('../src'); - -const FAKE_STATUS_CODE = 1; -class FakeError { - name: string; - message: string; - code: number; - constructor(n: number) { - this.name = 'fakeName'; - this.message = 'fake message'; - this.code = n; - } -} -const error = new FakeError(FAKE_STATUS_CODE); -export interface Callback { - (err: FakeError | null, response?: {} | null): void; -} - -export class Operation { - constructor() {} - promise() {} -} -function mockSimpleGrpcMethod( - expectedRequest: {}, - response: {} | null, - error: FakeError | null -) { - return (actualRequest: {}, options: {}, callback: Callback) => { - assert.deepStrictEqual(actualRequest, expectedRequest); - if (error) { - callback(error); - } else if (response) { - callback(null, response); - } else { - callback(null); - } - }; -} -function mockLongRunningGrpcMethod( - expectedRequest: {}, - response: {} | null, - error?: {} | null -) { - return (request: {}) => { - assert.deepStrictEqual(request, expectedRequest); - const mockOperation = { - promise() { - return new Promise((resolve, reject) => { - if (error) { - reject(error); - } else { - resolve([response]); - } - }); - }, - }; - return Promise.resolve([mockOperation]); - }; -} -describe('v1p1beta1.SecurityCenterClient', () => { - it('has servicePath', () => { - const servicePath = - securitycenterModule.v1p1beta1.SecurityCenterClient.servicePath; - assert(servicePath); - }); - it('has apiEndpoint', () => { - const apiEndpoint = - securitycenterModule.v1p1beta1.SecurityCenterClient.apiEndpoint; - assert(apiEndpoint); - }); - it('has port', () => { - const port = securitycenterModule.v1p1beta1.SecurityCenterClient.port; - assert(port); - assert(typeof port === 'number'); - }); - it('should create a client with no option', () => { - const client = new securitycenterModule.v1p1beta1.SecurityCenterClient(); - assert(client); - }); - it('should create a client with gRPC fallback', () => { - const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ - fallback: true, - }); - assert(client); - }); - it('has initialize method and supports deferred initialization', async () => { - const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.securityCenterStub, undefined); - await client.initialize(); - assert(client.securityCenterStub); - }); - it('has close method', () => { - const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.close(); - }); - describe('createSource', () => { - it('invokes createSource without error', done => { - const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.securitycenter.v1p1beta1.ICreateSourceRequest = {}; - request.parent = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.createSource = mockSimpleGrpcMethod( - request, - expectedResponse, - null - ); - client.createSource(request, (err: {}, response: {}) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes createSource with error', done => { - const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.securitycenter.v1p1beta1.ICreateSourceRequest = {}; - request.parent = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.createSource = mockSimpleGrpcMethod( - request, - null, - error - ); - client.createSource(request, (err: FakeError, response: {}) => { - assert(err instanceof FakeError); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - describe('createFinding', () => { - it('invokes createFinding without error', done => { - const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.securitycenter.v1p1beta1.ICreateFindingRequest = {}; - request.parent = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.createFinding = mockSimpleGrpcMethod( - request, - expectedResponse, - null - ); - client.createFinding(request, (err: {}, response: {}) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes createFinding with error', done => { - const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.securitycenter.v1p1beta1.ICreateFindingRequest = {}; - request.parent = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.createFinding = mockSimpleGrpcMethod( - request, - null, - error - ); - client.createFinding(request, (err: FakeError, response: {}) => { - assert(err instanceof FakeError); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - describe('createNotificationConfig', () => { - it('invokes createNotificationConfig without error', done => { - const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.securitycenter.v1p1beta1.ICreateNotificationConfigRequest = {}; - request.parent = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.createNotificationConfig = mockSimpleGrpcMethod( - request, - expectedResponse, - null - ); - client.createNotificationConfig(request, (err: {}, response: {}) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes createNotificationConfig with error', done => { - const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.securitycenter.v1p1beta1.ICreateNotificationConfigRequest = {}; - request.parent = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.createNotificationConfig = mockSimpleGrpcMethod( - request, - null, - error - ); - client.createNotificationConfig( - request, - (err: FakeError, response: {}) => { - assert(err instanceof FakeError); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - } - ); - }); - }); - describe('deleteNotificationConfig', () => { - it('invokes deleteNotificationConfig without error', done => { - const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.securitycenter.v1p1beta1.IDeleteNotificationConfigRequest = {}; - request.name = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.deleteNotificationConfig = mockSimpleGrpcMethod( - request, - expectedResponse, - null - ); - client.deleteNotificationConfig(request, (err: {}, response: {}) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes deleteNotificationConfig with error', done => { - const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.securitycenter.v1p1beta1.IDeleteNotificationConfigRequest = {}; - request.name = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.deleteNotificationConfig = mockSimpleGrpcMethod( - request, - null, - error - ); - client.deleteNotificationConfig( - request, - (err: FakeError, response: {}) => { - assert(err instanceof FakeError); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - } - ); - }); - }); - describe('getIamPolicy', () => { - it('invokes getIamPolicy without error', done => { - const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.iam.v1.IGetIamPolicyRequest = {}; - request.resource = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.getIamPolicy = mockSimpleGrpcMethod( - request, - expectedResponse, - null - ); - client.getIamPolicy(request, (err: {}, response: {}) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes getIamPolicy with error', done => { - const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.iam.v1.IGetIamPolicyRequest = {}; - request.resource = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.getIamPolicy = mockSimpleGrpcMethod( - request, - null, - error - ); - client.getIamPolicy(request, (err: FakeError, response: {}) => { - assert(err instanceof FakeError); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - describe('getNotificationConfig', () => { - it('invokes getNotificationConfig without error', done => { - const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.securitycenter.v1p1beta1.IGetNotificationConfigRequest = {}; - request.name = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.getNotificationConfig = mockSimpleGrpcMethod( - request, - expectedResponse, - null - ); - client.getNotificationConfig(request, (err: {}, response: {}) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes getNotificationConfig with error', done => { - const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.securitycenter.v1p1beta1.IGetNotificationConfigRequest = {}; - request.name = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.getNotificationConfig = mockSimpleGrpcMethod( - request, - null, - error - ); - client.getNotificationConfig(request, (err: FakeError, response: {}) => { - assert(err instanceof FakeError); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - describe('getOrganizationSettings', () => { - it('invokes getOrganizationSettings without error', done => { - const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.securitycenter.v1p1beta1.IGetOrganizationSettingsRequest = {}; - request.name = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.getOrganizationSettings = mockSimpleGrpcMethod( - request, - expectedResponse, - null - ); - client.getOrganizationSettings(request, (err: {}, response: {}) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes getOrganizationSettings with error', done => { - const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.securitycenter.v1p1beta1.IGetOrganizationSettingsRequest = {}; - request.name = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.getOrganizationSettings = mockSimpleGrpcMethod( - request, - null, - error - ); - client.getOrganizationSettings( - request, - (err: FakeError, response: {}) => { - assert(err instanceof FakeError); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - } - ); - }); - }); - describe('getSource', () => { - it('invokes getSource without error', done => { - const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.securitycenter.v1p1beta1.IGetSourceRequest = {}; - request.name = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.getSource = mockSimpleGrpcMethod( - request, - expectedResponse, - null - ); - client.getSource(request, (err: {}, response: {}) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes getSource with error', done => { - const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.securitycenter.v1p1beta1.IGetSourceRequest = {}; - request.name = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.getSource = mockSimpleGrpcMethod( - request, - null, - error - ); - client.getSource(request, (err: FakeError, response: {}) => { - assert(err instanceof FakeError); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - describe('setFindingState', () => { - it('invokes setFindingState without error', done => { - const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.securitycenter.v1p1beta1.ISetFindingStateRequest = {}; - request.name = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.setFindingState = mockSimpleGrpcMethod( - request, - expectedResponse, - null - ); - client.setFindingState(request, (err: {}, response: {}) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes setFindingState with error', done => { - const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.securitycenter.v1p1beta1.ISetFindingStateRequest = {}; - request.name = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.setFindingState = mockSimpleGrpcMethod( - request, - null, - error - ); - client.setFindingState(request, (err: FakeError, response: {}) => { - assert(err instanceof FakeError); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - describe('setIamPolicy', () => { - it('invokes setIamPolicy without error', done => { - const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.iam.v1.ISetIamPolicyRequest = {}; - request.resource = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.setIamPolicy = mockSimpleGrpcMethod( - request, - expectedResponse, - null - ); - client.setIamPolicy(request, (err: {}, response: {}) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes setIamPolicy with error', done => { - const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.iam.v1.ISetIamPolicyRequest = {}; - request.resource = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.setIamPolicy = mockSimpleGrpcMethod( - request, - null, - error - ); - client.setIamPolicy(request, (err: FakeError, response: {}) => { - assert(err instanceof FakeError); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - describe('testIamPermissions', () => { - it('invokes testIamPermissions without error', done => { - const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.iam.v1.ITestIamPermissionsRequest = {}; - request.resource = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.testIamPermissions = mockSimpleGrpcMethod( - request, - expectedResponse, - null - ); - client.testIamPermissions(request, (err: {}, response: {}) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes testIamPermissions with error', done => { - const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.iam.v1.ITestIamPermissionsRequest = {}; - request.resource = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.testIamPermissions = mockSimpleGrpcMethod( - request, - null, - error - ); - client.testIamPermissions(request, (err: FakeError, response: {}) => { - assert(err instanceof FakeError); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - describe('updateFinding', () => { - it('invokes updateFinding without error', done => { - const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.securitycenter.v1p1beta1.IUpdateFindingRequest = {}; - request.finding = {}; - request.finding.name = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.updateFinding = mockSimpleGrpcMethod( - request, - expectedResponse, - null - ); - client.updateFinding(request, (err: {}, response: {}) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes updateFinding with error', done => { - const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.securitycenter.v1p1beta1.IUpdateFindingRequest = {}; - request.finding = {}; - request.finding.name = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.updateFinding = mockSimpleGrpcMethod( - request, - null, - error - ); - client.updateFinding(request, (err: FakeError, response: {}) => { - assert(err instanceof FakeError); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - describe('updateNotificationConfig', () => { - it('invokes updateNotificationConfig without error', done => { - const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.securitycenter.v1p1beta1.IUpdateNotificationConfigRequest = {}; - request.notificationConfig = {}; - request.notificationConfig.name = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.updateNotificationConfig = mockSimpleGrpcMethod( - request, - expectedResponse, - null - ); - client.updateNotificationConfig(request, (err: {}, response: {}) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes updateNotificationConfig with error', done => { - const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.securitycenter.v1p1beta1.IUpdateNotificationConfigRequest = {}; - request.notificationConfig = {}; - request.notificationConfig.name = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.updateNotificationConfig = mockSimpleGrpcMethod( - request, - null, - error - ); - client.updateNotificationConfig( - request, - (err: FakeError, response: {}) => { - assert(err instanceof FakeError); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - } - ); - }); - }); - describe('updateOrganizationSettings', () => { - it('invokes updateOrganizationSettings without error', done => { - const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.securitycenter.v1p1beta1.IUpdateOrganizationSettingsRequest = {}; - request.organizationSettings = {}; - request.organizationSettings.name = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.updateOrganizationSettings = mockSimpleGrpcMethod( - request, - expectedResponse, - null - ); - client.updateOrganizationSettings(request, (err: {}, response: {}) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes updateOrganizationSettings with error', done => { - const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.securitycenter.v1p1beta1.IUpdateOrganizationSettingsRequest = {}; - request.organizationSettings = {}; - request.organizationSettings.name = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.updateOrganizationSettings = mockSimpleGrpcMethod( - request, - null, - error - ); - client.updateOrganizationSettings( - request, - (err: FakeError, response: {}) => { - assert(err instanceof FakeError); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - } - ); - }); - }); - describe('updateSource', () => { - it('invokes updateSource without error', done => { - const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.securitycenter.v1p1beta1.IUpdateSourceRequest = {}; - request.source = {}; - request.source.name = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.updateSource = mockSimpleGrpcMethod( - request, - expectedResponse, - null - ); - client.updateSource(request, (err: {}, response: {}) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes updateSource with error', done => { - const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.securitycenter.v1p1beta1.IUpdateSourceRequest = {}; - request.source = {}; - request.source.name = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.updateSource = mockSimpleGrpcMethod( - request, - null, - error - ); - client.updateSource(request, (err: FakeError, response: {}) => { - assert(err instanceof FakeError); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - describe('updateSecurityMarks', () => { - it('invokes updateSecurityMarks without error', done => { - const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.securitycenter.v1p1beta1.IUpdateSecurityMarksRequest = {}; - request.securityMarks = {}; - request.securityMarks.name = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.updateSecurityMarks = mockSimpleGrpcMethod( - request, - expectedResponse, - null - ); - client.updateSecurityMarks(request, (err: {}, response: {}) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes updateSecurityMarks with error', done => { - const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.securitycenter.v1p1beta1.IUpdateSecurityMarksRequest = {}; - request.securityMarks = {}; - request.securityMarks.name = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.updateSecurityMarks = mockSimpleGrpcMethod( - request, - null, - error - ); - client.updateSecurityMarks(request, (err: FakeError, response: {}) => { - assert(err instanceof FakeError); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - describe('runAssetDiscovery', () => { - it('invokes runAssetDiscovery without error', done => { - const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.securitycenter.v1p1beta1.IRunAssetDiscoveryRequest = {}; - request.parent = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.runAssetDiscovery = mockLongRunningGrpcMethod( - request, - expectedResponse - ); - client - .runAssetDiscovery(request) - .then((responses: [Operation]) => { - const operation = responses[0]; - return operation ? operation.promise() : {}; - }) - .then((responses: [Operation]) => { - assert.deepStrictEqual(responses[0], expectedResponse); - done(); - }) - .catch((err: {}) => { - done(err); - }); - }); - - it('invokes runAssetDiscovery with error', done => { - const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.securitycenter.v1p1beta1.IRunAssetDiscoveryRequest = {}; - request.parent = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.runAssetDiscovery = mockLongRunningGrpcMethod( - request, - null, - error - ); - client - .runAssetDiscovery(request) - .then((responses: [Operation]) => { - const operation = responses[0]; - return operation ? operation.promise() : {}; - }) - .then(() => { - assert.fail(); - }) - .catch((err: FakeError) => { - assert(err instanceof FakeError); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - done(); - }); - }); - }); - describe('groupAssets', () => { - it('invokes groupAssets without error', done => { - const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.securitycenter.v1p1beta1.IGroupAssetsRequest = {}; - request.parent = ''; - // Mock response - const expectedResponse = {}; - // Mock Grpc layer - client._innerApiCalls.groupAssets = ( - actualRequest: {}, - options: {}, - callback: Callback - ) => { - assert.deepStrictEqual(actualRequest, request); - callback(null, expectedResponse); - }; - client.groupAssets(request, (err: FakeError, response: {}) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - }); - describe('groupAssetsStream', () => { - it('invokes groupAssetsStream without error', done => { - const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.securitycenter.v1p1beta1.IGroupAssetsRequest = {}; - request.parent = ''; - // Mock response - const expectedResponse = {response: 'data'}; - // Mock Grpc layer - client._innerApiCalls.groupAssets = ( - actualRequest: {}, - options: {}, - callback: Callback - ) => { - assert.deepStrictEqual(actualRequest, request); - callback(null, expectedResponse); - }; - const stream = client - .groupAssetsStream(request, {}) - .on('data', (response: {}) => { - assert.deepStrictEqual(response, expectedResponse); - done(); - }) - .on('error', (err: FakeError) => { - done(err); - }); - stream.write(expectedResponse); - }); - }); - describe('groupFindings', () => { - it('invokes groupFindings without error', done => { - const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.securitycenter.v1p1beta1.IGroupFindingsRequest = {}; - request.parent = ''; - // Mock response - const expectedResponse = {}; - // Mock Grpc layer - client._innerApiCalls.groupFindings = ( - actualRequest: {}, - options: {}, - callback: Callback - ) => { - assert.deepStrictEqual(actualRequest, request); - callback(null, expectedResponse); - }; - client.groupFindings(request, (err: FakeError, response: {}) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - }); - describe('groupFindingsStream', () => { - it('invokes groupFindingsStream without error', done => { - const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.securitycenter.v1p1beta1.IGroupFindingsRequest = {}; - request.parent = ''; - // Mock response - const expectedResponse = {response: 'data'}; - // Mock Grpc layer - client._innerApiCalls.groupFindings = ( - actualRequest: {}, - options: {}, - callback: Callback - ) => { - assert.deepStrictEqual(actualRequest, request); - callback(null, expectedResponse); - }; - const stream = client - .groupFindingsStream(request, {}) - .on('data', (response: {}) => { - assert.deepStrictEqual(response, expectedResponse); - done(); - }) - .on('error', (err: FakeError) => { - done(err); - }); - stream.write(expectedResponse); - }); - }); - describe('listAssets', () => { - it('invokes listAssets without error', done => { - const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.securitycenter.v1p1beta1.IListAssetsRequest = {}; - request.parent = ''; - // Mock response - const expectedResponse = {}; - // Mock Grpc layer - client._innerApiCalls.listAssets = ( - actualRequest: {}, - options: {}, - callback: Callback - ) => { - assert.deepStrictEqual(actualRequest, request); - callback(null, expectedResponse); - }; - client.listAssets(request, (err: FakeError, response: {}) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - }); - describe('listAssetsStream', () => { - it('invokes listAssetsStream without error', done => { - const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.securitycenter.v1p1beta1.IListAssetsRequest = {}; - request.parent = ''; - // Mock response - const expectedResponse = {response: 'data'}; - // Mock Grpc layer - client._innerApiCalls.listAssets = ( - actualRequest: {}, - options: {}, - callback: Callback - ) => { - assert.deepStrictEqual(actualRequest, request); - callback(null, expectedResponse); - }; - const stream = client - .listAssetsStream(request, {}) - .on('data', (response: {}) => { - assert.deepStrictEqual(response, expectedResponse); - done(); - }) - .on('error', (err: FakeError) => { - done(err); - }); - stream.write(expectedResponse); - }); - }); - describe('listFindings', () => { - it('invokes listFindings without error', done => { - const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.securitycenter.v1p1beta1.IListFindingsRequest = {}; - request.parent = ''; - // Mock response - const expectedResponse = {}; - // Mock Grpc layer - client._innerApiCalls.listFindings = ( - actualRequest: {}, - options: {}, - callback: Callback - ) => { - assert.deepStrictEqual(actualRequest, request); - callback(null, expectedResponse); - }; - client.listFindings(request, (err: FakeError, response: {}) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - }); - describe('listFindingsStream', () => { - it('invokes listFindingsStream without error', done => { - const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.securitycenter.v1p1beta1.IListFindingsRequest = {}; - request.parent = ''; - // Mock response - const expectedResponse = {response: 'data'}; - // Mock Grpc layer - client._innerApiCalls.listFindings = ( - actualRequest: {}, - options: {}, - callback: Callback - ) => { - assert.deepStrictEqual(actualRequest, request); - callback(null, expectedResponse); - }; - const stream = client - .listFindingsStream(request, {}) - .on('data', (response: {}) => { - assert.deepStrictEqual(response, expectedResponse); - done(); - }) - .on('error', (err: FakeError) => { - done(err); - }); - stream.write(expectedResponse); - }); - }); - describe('listNotificationConfigs', () => { - it('invokes listNotificationConfigs without error', done => { - const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.securitycenter.v1p1beta1.IListNotificationConfigsRequest = {}; - request.parent = ''; - // Mock response - const expectedResponse = {}; - // Mock Grpc layer - client._innerApiCalls.listNotificationConfigs = ( - actualRequest: {}, - options: {}, - callback: Callback - ) => { - assert.deepStrictEqual(actualRequest, request); - callback(null, expectedResponse); - }; - client.listNotificationConfigs( - request, - (err: FakeError, response: {}) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - } - ); - }); - }); - describe('listNotificationConfigsStream', () => { - it('invokes listNotificationConfigsStream without error', done => { - const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.securitycenter.v1p1beta1.IListNotificationConfigsRequest = {}; - request.parent = ''; - // Mock response - const expectedResponse = {response: 'data'}; - // Mock Grpc layer - client._innerApiCalls.listNotificationConfigs = ( - actualRequest: {}, - options: {}, - callback: Callback - ) => { - assert.deepStrictEqual(actualRequest, request); - callback(null, expectedResponse); - }; - const stream = client - .listNotificationConfigsStream(request, {}) - .on('data', (response: {}) => { - assert.deepStrictEqual(response, expectedResponse); - done(); - }) - .on('error', (err: FakeError) => { - done(err); - }); - stream.write(expectedResponse); - }); - }); - describe('listSources', () => { - it('invokes listSources without error', done => { - const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.securitycenter.v1p1beta1.IListSourcesRequest = {}; - request.parent = ''; - // Mock response - const expectedResponse = {}; - // Mock Grpc layer - client._innerApiCalls.listSources = ( - actualRequest: {}, - options: {}, - callback: Callback - ) => { - assert.deepStrictEqual(actualRequest, request); - callback(null, expectedResponse); - }; - client.listSources(request, (err: FakeError, response: {}) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - }); - describe('listSourcesStream', () => { - it('invokes listSourcesStream without error', done => { - const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.securitycenter.v1p1beta1.IListSourcesRequest = {}; - request.parent = ''; - // Mock response - const expectedResponse = {response: 'data'}; - // Mock Grpc layer - client._innerApiCalls.listSources = ( - actualRequest: {}, - options: {}, - callback: Callback - ) => { - assert.deepStrictEqual(actualRequest, request); - callback(null, expectedResponse); - }; - const stream = client - .listSourcesStream(request, {}) - .on('data', (response: {}) => { - assert.deepStrictEqual(response, expectedResponse); - done(); - }) - .on('error', (err: FakeError) => { - done(err); - }); - stream.write(expectedResponse); - }); - }); -}); diff --git a/packages/google-cloud-securitycenter/test/gapic_security_center_v1.ts b/packages/google-cloud-securitycenter/test/gapic_security_center_v1.ts new file mode 100644 index 00000000000..0912e01a2a1 --- /dev/null +++ b/packages/google-cloud-securitycenter/test/gapic_security_center_v1.ts @@ -0,0 +1,4605 @@ +// 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 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 securitycenterModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf, LROperation} from 'google-gax'; + +function generateSampleMessage(instance: T) { + const filledObject = (instance.constructor as typeof protobuf.Message).toObject( + instance as protobuf.Message, + {defaults: true} + ); + return (instance.constructor as typeof protobuf.Message).fromObject( + filledObject + ) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error + ? sinon.stub().rejects(error) + : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback( + response?: ResponseType, + error?: Error +) { + return error + ? sinon.stub().callsArgWith(2, error) + : sinon.stub().callsArgWith(2, null, response); +} + +function stubLongRunningCall( + response?: ResponseType, + callError?: Error, + lroError?: Error +) { + const innerStub = lroError + ? sinon.stub().rejects(lroError) + : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError + ? sinon.stub().rejects(callError) + : sinon.stub().resolves([mockOperation]); +} + +function stubLongRunningCallWithCallback( + response?: ResponseType, + callError?: Error, + lroError?: Error +) { + const innerStub = lroError + ? sinon.stub().rejects(lroError) + : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError + ? sinon.stub().callsArgWith(2, callError) + : sinon.stub().callsArgWith(2, null, mockOperation); +} + +function stubPageStreamingCall( + responses?: ResponseType[], + error?: Error +) { + const pagingStub = sinon.stub(); + if (responses) { + for (let i = 0; i < responses.length; ++i) { + pagingStub.onCall(i).callsArgWith(2, null, responses[i]); + } + } + const transformStub = error + ? sinon.stub().callsArgWith(2, error) + : pagingStub; + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + // trigger as many responses as needed + if (responses) { + for (let i = 0; i < responses.length; ++i) { + setImmediate(() => { + mockStream.write({}); + }); + } + setImmediate(() => { + mockStream.end(); + }); + } else { + setImmediate(() => { + mockStream.write({}); + }); + setImmediate(() => { + mockStream.end(); + }); + } + return sinon.stub().returns(mockStream); +} + +function stubAsyncIterationCall( + responses?: ResponseType[], + error?: Error +) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({done: true, value: undefined}); + } + return Promise.resolve({done: false, value: responses![counter++]}); + }, + }; + }, + }; + return sinon.stub().returns(asyncIterable); +} + +describe('v1.SecurityCenterClient', () => { + it('has servicePath', () => { + const servicePath = + securitycenterModule.v1.SecurityCenterClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = + securitycenterModule.v1.SecurityCenterClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = securitycenterModule.v1.SecurityCenterClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new securitycenterModule.v1.SecurityCenterClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.securityCenterStub, undefined); + await client.initialize(); + assert(client.securityCenterStub); + }); + + it('has close method', () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.close(); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new securitycenterModule.v1.SecurityCenterClient({ + 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 securitycenterModule.v1.SecurityCenterClient({ + 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('createSource', () => { + it('invokes createSource without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.CreateSourceRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.Source() + ); + client.innerApiCalls.createSource = stubSimpleCall(expectedResponse); + const [response] = await client.createSource(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.createSource as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes createSource without error using callback', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.CreateSourceRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.Source() + ); + client.innerApiCalls.createSource = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.createSource( + request, + ( + err?: Error | null, + result?: protos.google.cloud.securitycenter.v1.ISource | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.createSource as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes createSource with error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.CreateSourceRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createSource = stubSimpleCall( + undefined, + expectedError + ); + assert.rejects(async () => { + await client.createSource(request); + }, expectedError); + assert( + (client.innerApiCalls.createSource as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('createFinding', () => { + it('invokes createFinding without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.CreateFindingRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.Finding() + ); + client.innerApiCalls.createFinding = stubSimpleCall(expectedResponse); + const [response] = await client.createFinding(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.createFinding as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes createFinding without error using callback', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.CreateFindingRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.Finding() + ); + client.innerApiCalls.createFinding = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.createFinding( + request, + ( + err?: Error | null, + result?: protos.google.cloud.securitycenter.v1.IFinding | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.createFinding as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes createFinding with error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.CreateFindingRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createFinding = stubSimpleCall( + undefined, + expectedError + ); + assert.rejects(async () => { + await client.createFinding(request); + }, expectedError); + assert( + (client.innerApiCalls.createFinding as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('createNotificationConfig', () => { + it('invokes createNotificationConfig without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.CreateNotificationConfigRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.NotificationConfig() + ); + client.innerApiCalls.createNotificationConfig = stubSimpleCall( + expectedResponse + ); + const [response] = await client.createNotificationConfig(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.createNotificationConfig as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes createNotificationConfig without error using callback', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.CreateNotificationConfigRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.NotificationConfig() + ); + client.innerApiCalls.createNotificationConfig = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.createNotificationConfig( + request, + ( + err?: Error | null, + result?: protos.google.cloud.securitycenter.v1.INotificationConfig | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.createNotificationConfig as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes createNotificationConfig with error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.CreateNotificationConfigRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createNotificationConfig = stubSimpleCall( + undefined, + expectedError + ); + assert.rejects(async () => { + await client.createNotificationConfig(request); + }, expectedError); + assert( + (client.innerApiCalls.createNotificationConfig as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('deleteNotificationConfig', () => { + it('invokes deleteNotificationConfig without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.DeleteNotificationConfigRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteNotificationConfig = stubSimpleCall( + expectedResponse + ); + const [response] = await client.deleteNotificationConfig(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.deleteNotificationConfig as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes deleteNotificationConfig without error using callback', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.DeleteNotificationConfigRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteNotificationConfig = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.deleteNotificationConfig( + request, + ( + err?: Error | null, + result?: protos.google.protobuf.IEmpty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.deleteNotificationConfig as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes deleteNotificationConfig with error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.DeleteNotificationConfigRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteNotificationConfig = stubSimpleCall( + undefined, + expectedError + ); + assert.rejects(async () => { + await client.deleteNotificationConfig(request); + }, expectedError); + assert( + (client.innerApiCalls.deleteNotificationConfig as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('getIamPolicy', () => { + it('invokes getIamPolicy without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.iam.v1.Policy() + ); + client.innerApiCalls.getIamPolicy = stubSimpleCall(expectedResponse); + const [response] = await client.getIamPolicy(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes getIamPolicy without error using callback', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.iam.v1.Policy() + ); + client.innerApiCalls.getIamPolicy = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.getIamPolicy( + request, + ( + err?: Error | null, + result?: protos.google.iam.v1.IPolicy | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes getIamPolicy with error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getIamPolicy = stubSimpleCall( + undefined, + expectedError + ); + assert.rejects(async () => { + await client.getIamPolicy(request); + }, expectedError); + assert( + (client.innerApiCalls.getIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('getNotificationConfig', () => { + it('invokes getNotificationConfig without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GetNotificationConfigRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.NotificationConfig() + ); + client.innerApiCalls.getNotificationConfig = stubSimpleCall( + expectedResponse + ); + const [response] = await client.getNotificationConfig(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getNotificationConfig as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes getNotificationConfig without error using callback', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GetNotificationConfigRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.NotificationConfig() + ); + client.innerApiCalls.getNotificationConfig = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.getNotificationConfig( + request, + ( + err?: Error | null, + result?: protos.google.cloud.securitycenter.v1.INotificationConfig | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getNotificationConfig as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes getNotificationConfig with error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GetNotificationConfigRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getNotificationConfig = stubSimpleCall( + undefined, + expectedError + ); + assert.rejects(async () => { + await client.getNotificationConfig(request); + }, expectedError); + assert( + (client.innerApiCalls.getNotificationConfig as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('getOrganizationSettings', () => { + it('invokes getOrganizationSettings without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GetOrganizationSettingsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.OrganizationSettings() + ); + client.innerApiCalls.getOrganizationSettings = stubSimpleCall( + expectedResponse + ); + const [response] = await client.getOrganizationSettings(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getOrganizationSettings as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes getOrganizationSettings without error using callback', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GetOrganizationSettingsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.OrganizationSettings() + ); + client.innerApiCalls.getOrganizationSettings = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.getOrganizationSettings( + request, + ( + err?: Error | null, + result?: protos.google.cloud.securitycenter.v1.IOrganizationSettings | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getOrganizationSettings as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes getOrganizationSettings with error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GetOrganizationSettingsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getOrganizationSettings = stubSimpleCall( + undefined, + expectedError + ); + assert.rejects(async () => { + await client.getOrganizationSettings(request); + }, expectedError); + assert( + (client.innerApiCalls.getOrganizationSettings as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('getSource', () => { + it('invokes getSource without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GetSourceRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.Source() + ); + client.innerApiCalls.getSource = stubSimpleCall(expectedResponse); + const [response] = await client.getSource(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getSource as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes getSource without error using callback', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GetSourceRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.Source() + ); + client.innerApiCalls.getSource = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.getSource( + request, + ( + err?: Error | null, + result?: protos.google.cloud.securitycenter.v1.ISource | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getSource as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes getSource with error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GetSourceRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getSource = stubSimpleCall(undefined, expectedError); + assert.rejects(async () => { + await client.getSource(request); + }, expectedError); + assert( + (client.innerApiCalls.getSource as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('setFindingState', () => { + it('invokes setFindingState without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.SetFindingStateRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.Finding() + ); + client.innerApiCalls.setFindingState = stubSimpleCall(expectedResponse); + const [response] = await client.setFindingState(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.setFindingState as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes setFindingState without error using callback', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.SetFindingStateRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.Finding() + ); + client.innerApiCalls.setFindingState = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.setFindingState( + request, + ( + err?: Error | null, + result?: protos.google.cloud.securitycenter.v1.IFinding | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.setFindingState as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes setFindingState with error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.SetFindingStateRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.setFindingState = stubSimpleCall( + undefined, + expectedError + ); + assert.rejects(async () => { + await client.setFindingState(request); + }, expectedError); + assert( + (client.innerApiCalls.setFindingState as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('setIamPolicy', () => { + it('invokes setIamPolicy without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.iam.v1.Policy() + ); + client.innerApiCalls.setIamPolicy = stubSimpleCall(expectedResponse); + const [response] = await client.setIamPolicy(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.setIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes setIamPolicy without error using callback', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.iam.v1.Policy() + ); + client.innerApiCalls.setIamPolicy = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.setIamPolicy( + request, + ( + err?: Error | null, + result?: protos.google.iam.v1.IPolicy | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.setIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes setIamPolicy with error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.setIamPolicy = stubSimpleCall( + undefined, + expectedError + ); + assert.rejects(async () => { + await client.setIamPolicy(request); + }, expectedError); + assert( + (client.innerApiCalls.setIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('testIamPermissions', () => { + it('invokes testIamPermissions without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.iam.v1.TestIamPermissionsResponse() + ); + client.innerApiCalls.testIamPermissions = stubSimpleCall( + expectedResponse + ); + const [response] = await client.testIamPermissions(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.testIamPermissions as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes testIamPermissions without error using callback', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.iam.v1.TestIamPermissionsResponse() + ); + client.innerApiCalls.testIamPermissions = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.testIamPermissions( + request, + ( + err?: Error | null, + result?: protos.google.iam.v1.ITestIamPermissionsResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.testIamPermissions as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes testIamPermissions with error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.testIamPermissions = stubSimpleCall( + undefined, + expectedError + ); + assert.rejects(async () => { + await client.testIamPermissions(request); + }, expectedError); + assert( + (client.innerApiCalls.testIamPermissions as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('updateFinding', () => { + it('invokes updateFinding without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.UpdateFindingRequest() + ); + request.finding = {}; + request.finding.name = ''; + const expectedHeaderRequestParams = 'finding.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.Finding() + ); + client.innerApiCalls.updateFinding = stubSimpleCall(expectedResponse); + const [response] = await client.updateFinding(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.updateFinding as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes updateFinding without error using callback', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.UpdateFindingRequest() + ); + request.finding = {}; + request.finding.name = ''; + const expectedHeaderRequestParams = 'finding.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.Finding() + ); + client.innerApiCalls.updateFinding = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.updateFinding( + request, + ( + err?: Error | null, + result?: protos.google.cloud.securitycenter.v1.IFinding | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.updateFinding as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes updateFinding with error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.UpdateFindingRequest() + ); + request.finding = {}; + request.finding.name = ''; + const expectedHeaderRequestParams = 'finding.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.updateFinding = stubSimpleCall( + undefined, + expectedError + ); + assert.rejects(async () => { + await client.updateFinding(request); + }, expectedError); + assert( + (client.innerApiCalls.updateFinding as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('updateNotificationConfig', () => { + it('invokes updateNotificationConfig without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.UpdateNotificationConfigRequest() + ); + request.notificationConfig = {}; + request.notificationConfig.name = ''; + const expectedHeaderRequestParams = 'notification_config.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.NotificationConfig() + ); + client.innerApiCalls.updateNotificationConfig = stubSimpleCall( + expectedResponse + ); + const [response] = await client.updateNotificationConfig(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.updateNotificationConfig as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes updateNotificationConfig without error using callback', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.UpdateNotificationConfigRequest() + ); + request.notificationConfig = {}; + request.notificationConfig.name = ''; + const expectedHeaderRequestParams = 'notification_config.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.NotificationConfig() + ); + client.innerApiCalls.updateNotificationConfig = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.updateNotificationConfig( + request, + ( + err?: Error | null, + result?: protos.google.cloud.securitycenter.v1.INotificationConfig | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.updateNotificationConfig as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes updateNotificationConfig with error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.UpdateNotificationConfigRequest() + ); + request.notificationConfig = {}; + request.notificationConfig.name = ''; + const expectedHeaderRequestParams = 'notification_config.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.updateNotificationConfig = stubSimpleCall( + undefined, + expectedError + ); + assert.rejects(async () => { + await client.updateNotificationConfig(request); + }, expectedError); + assert( + (client.innerApiCalls.updateNotificationConfig as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('updateOrganizationSettings', () => { + it('invokes updateOrganizationSettings without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest() + ); + request.organizationSettings = {}; + request.organizationSettings.name = ''; + const expectedHeaderRequestParams = 'organization_settings.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.OrganizationSettings() + ); + client.innerApiCalls.updateOrganizationSettings = stubSimpleCall( + expectedResponse + ); + const [response] = await client.updateOrganizationSettings(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.updateOrganizationSettings as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes updateOrganizationSettings without error using callback', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest() + ); + request.organizationSettings = {}; + request.organizationSettings.name = ''; + const expectedHeaderRequestParams = 'organization_settings.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.OrganizationSettings() + ); + client.innerApiCalls.updateOrganizationSettings = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.updateOrganizationSettings( + request, + ( + err?: Error | null, + result?: protos.google.cloud.securitycenter.v1.IOrganizationSettings | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.updateOrganizationSettings as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes updateOrganizationSettings with error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest() + ); + request.organizationSettings = {}; + request.organizationSettings.name = ''; + const expectedHeaderRequestParams = 'organization_settings.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.updateOrganizationSettings = stubSimpleCall( + undefined, + expectedError + ); + assert.rejects(async () => { + await client.updateOrganizationSettings(request); + }, expectedError); + assert( + (client.innerApiCalls.updateOrganizationSettings as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('updateSource', () => { + it('invokes updateSource without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.UpdateSourceRequest() + ); + request.source = {}; + request.source.name = ''; + const expectedHeaderRequestParams = 'source.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.Source() + ); + client.innerApiCalls.updateSource = stubSimpleCall(expectedResponse); + const [response] = await client.updateSource(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.updateSource as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes updateSource without error using callback', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.UpdateSourceRequest() + ); + request.source = {}; + request.source.name = ''; + const expectedHeaderRequestParams = 'source.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.Source() + ); + client.innerApiCalls.updateSource = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.updateSource( + request, + ( + err?: Error | null, + result?: protos.google.cloud.securitycenter.v1.ISource | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.updateSource as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes updateSource with error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.UpdateSourceRequest() + ); + request.source = {}; + request.source.name = ''; + const expectedHeaderRequestParams = 'source.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.updateSource = stubSimpleCall( + undefined, + expectedError + ); + assert.rejects(async () => { + await client.updateSource(request); + }, expectedError); + assert( + (client.innerApiCalls.updateSource as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('updateSecurityMarks', () => { + it('invokes updateSecurityMarks without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.UpdateSecurityMarksRequest() + ); + request.securityMarks = {}; + request.securityMarks.name = ''; + const expectedHeaderRequestParams = 'security_marks.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.SecurityMarks() + ); + client.innerApiCalls.updateSecurityMarks = stubSimpleCall( + expectedResponse + ); + const [response] = await client.updateSecurityMarks(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.updateSecurityMarks as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes updateSecurityMarks without error using callback', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.UpdateSecurityMarksRequest() + ); + request.securityMarks = {}; + request.securityMarks.name = ''; + const expectedHeaderRequestParams = 'security_marks.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.SecurityMarks() + ); + client.innerApiCalls.updateSecurityMarks = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.updateSecurityMarks( + request, + ( + err?: Error | null, + result?: protos.google.cloud.securitycenter.v1.ISecurityMarks | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.updateSecurityMarks as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes updateSecurityMarks with error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.UpdateSecurityMarksRequest() + ); + request.securityMarks = {}; + request.securityMarks.name = ''; + const expectedHeaderRequestParams = 'security_marks.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.updateSecurityMarks = stubSimpleCall( + undefined, + expectedError + ); + assert.rejects(async () => { + await client.updateSecurityMarks(request); + }, expectedError); + assert( + (client.innerApiCalls.updateSecurityMarks as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('runAssetDiscovery', () => { + it('invokes runAssetDiscovery without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.RunAssetDiscoveryRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.runAssetDiscovery = stubLongRunningCall( + expectedResponse + ); + const [operation] = await client.runAssetDiscovery(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.runAssetDiscovery as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes runAssetDiscovery without error using callback', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.RunAssetDiscoveryRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.runAssetDiscovery = stubLongRunningCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.runAssetDiscovery( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.securitycenter.v1.IRunAssetDiscoveryResponse, + protos.google.protobuf.IEmpty + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.securitycenter.v1.IRunAssetDiscoveryResponse, + protos.google.protobuf.IEmpty + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.runAssetDiscovery as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes runAssetDiscovery with call error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.RunAssetDiscoveryRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.runAssetDiscovery = stubLongRunningCall( + undefined, + expectedError + ); + assert.rejects(async () => { + await client.runAssetDiscovery(request); + }, expectedError); + assert( + (client.innerApiCalls.runAssetDiscovery as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes runAssetDiscovery with LRO error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.RunAssetDiscoveryRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.runAssetDiscovery = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.runAssetDiscovery(request); + assert.rejects(async () => { + await operation.promise(); + }, expectedError); + assert( + (client.innerApiCalls.runAssetDiscovery as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('groupAssets', () => { + it('invokes groupAssets without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GroupAssetsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GroupResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GroupResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GroupResult() + ), + ]; + client.innerApiCalls.groupAssets = stubSimpleCall(expectedResponse); + const [response] = await client.groupAssets(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.groupAssets as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes groupAssets without error using callback', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GroupAssetsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GroupResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GroupResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GroupResult() + ), + ]; + client.innerApiCalls.groupAssets = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.groupAssets( + request, + ( + err?: Error | null, + result?: protos.google.cloud.securitycenter.v1.IGroupResult[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.groupAssets as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes groupAssets with error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GroupAssetsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.groupAssets = stubSimpleCall( + undefined, + expectedError + ); + assert.rejects(async () => { + await client.groupAssets(request); + }, expectedError); + assert( + (client.innerApiCalls.groupAssets as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes groupAssetsStream without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GroupAssetsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GroupResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GroupResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GroupResult() + ), + ]; + client.descriptors.page.groupAssets.createStream = stubPageStreamingCall( + expectedResponse + ); + const stream = client.groupAssetsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.securitycenter.v1.GroupResult[] = []; + stream.on( + 'data', + (response: protos.google.cloud.securitycenter.v1.GroupResult) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert( + (client.descriptors.page.groupAssets.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.groupAssets, request) + ); + assert.strictEqual( + (client.descriptors.page.groupAssets.createStream as SinonStub).getCall( + 0 + ).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes groupAssetsStream with error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GroupAssetsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('expected'); + client.descriptors.page.groupAssets.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.groupAssetsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.securitycenter.v1.GroupResult[] = []; + stream.on( + 'data', + (response: protos.google.cloud.securitycenter.v1.GroupResult) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + assert.rejects(async () => { + await promise; + }, expectedError); + assert( + (client.descriptors.page.groupAssets.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.groupAssets, request) + ); + assert.strictEqual( + (client.descriptors.page.groupAssets.createStream as SinonStub).getCall( + 0 + ).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with groupAssets without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GroupAssetsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GroupResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GroupResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GroupResult() + ), + ]; + client.descriptors.page.groupAssets.asyncIterate = stubAsyncIterationCall( + expectedResponse + ); + const responses: protos.google.cloud.securitycenter.v1.IGroupResult[] = []; + const iterable = client.groupAssetsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.groupAssets.asyncIterate as SinonStub).getCall( + 0 + ).args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.groupAssets.asyncIterate as SinonStub).getCall( + 0 + ).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with groupAssets with error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GroupAssetsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('expected'); + client.descriptors.page.groupAssets.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.groupAssetsAsync(request); + assert.rejects(async () => { + const responses: protos.google.cloud.securitycenter.v1.IGroupResult[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.groupAssets.asyncIterate as SinonStub).getCall( + 0 + ).args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.groupAssets.asyncIterate as SinonStub).getCall( + 0 + ).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('groupFindings', () => { + it('invokes groupFindings without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GroupFindingsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GroupResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GroupResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GroupResult() + ), + ]; + client.innerApiCalls.groupFindings = stubSimpleCall(expectedResponse); + const [response] = await client.groupFindings(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.groupFindings as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes groupFindings without error using callback', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GroupFindingsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GroupResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GroupResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GroupResult() + ), + ]; + client.innerApiCalls.groupFindings = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.groupFindings( + request, + ( + err?: Error | null, + result?: protos.google.cloud.securitycenter.v1.IGroupResult[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.groupFindings as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes groupFindings with error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GroupFindingsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.groupFindings = stubSimpleCall( + undefined, + expectedError + ); + assert.rejects(async () => { + await client.groupFindings(request); + }, expectedError); + assert( + (client.innerApiCalls.groupFindings as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes groupFindingsStream without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GroupFindingsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GroupResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GroupResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GroupResult() + ), + ]; + client.descriptors.page.groupFindings.createStream = stubPageStreamingCall( + expectedResponse + ); + const stream = client.groupFindingsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.securitycenter.v1.GroupResult[] = []; + stream.on( + 'data', + (response: protos.google.cloud.securitycenter.v1.GroupResult) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert( + (client.descriptors.page.groupFindings.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.groupFindings, request) + ); + assert.strictEqual( + (client.descriptors.page.groupFindings + .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + expectedHeaderRequestParams + ); + }); + + it('invokes groupFindingsStream with error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GroupFindingsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('expected'); + client.descriptors.page.groupFindings.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.groupFindingsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.securitycenter.v1.GroupResult[] = []; + stream.on( + 'data', + (response: protos.google.cloud.securitycenter.v1.GroupResult) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + assert.rejects(async () => { + await promise; + }, expectedError); + assert( + (client.descriptors.page.groupFindings.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.groupFindings, request) + ); + assert.strictEqual( + (client.descriptors.page.groupFindings + .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with groupFindings without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GroupFindingsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GroupResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GroupResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GroupResult() + ), + ]; + client.descriptors.page.groupFindings.asyncIterate = stubAsyncIterationCall( + expectedResponse + ); + const responses: protos.google.cloud.securitycenter.v1.IGroupResult[] = []; + const iterable = client.groupFindingsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.groupFindings + .asyncIterate as SinonStub).getCall(0).args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.groupFindings + .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with groupFindings with error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GroupFindingsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('expected'); + client.descriptors.page.groupFindings.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.groupFindingsAsync(request); + assert.rejects(async () => { + const responses: protos.google.cloud.securitycenter.v1.IGroupResult[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.groupFindings + .asyncIterate as SinonStub).getCall(0).args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.groupFindings + .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + expectedHeaderRequestParams + ); + }); + }); + + describe('listAssets', () => { + it('invokes listAssets without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListAssetsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult() + ), + ]; + client.innerApiCalls.listAssets = stubSimpleCall(expectedResponse); + const [response] = await client.listAssets(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listAssets as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listAssets without error using callback', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListAssetsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult() + ), + ]; + client.innerApiCalls.listAssets = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.listAssets( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.securitycenter.v1.ListAssetsResponse.IListAssetsResult[] + | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listAssets as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes listAssets with error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListAssetsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listAssets = stubSimpleCall( + undefined, + expectedError + ); + assert.rejects(async () => { + await client.listAssets(request); + }, expectedError); + assert( + (client.innerApiCalls.listAssets as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listAssetsStream without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListAssetsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult() + ), + ]; + client.descriptors.page.listAssets.createStream = stubPageStreamingCall( + expectedResponse + ); + const stream = client.listAssetsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult[] = []; + stream.on( + 'data', + ( + response: protos.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult + ) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert( + (client.descriptors.page.listAssets.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listAssets, request) + ); + assert.strictEqual( + (client.descriptors.page.listAssets.createStream as SinonStub).getCall( + 0 + ).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listAssetsStream with error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListAssetsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('expected'); + client.descriptors.page.listAssets.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listAssetsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult[] = []; + stream.on( + 'data', + ( + response: protos.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult + ) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + assert.rejects(async () => { + await promise; + }, expectedError); + assert( + (client.descriptors.page.listAssets.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listAssets, request) + ); + assert.strictEqual( + (client.descriptors.page.listAssets.createStream as SinonStub).getCall( + 0 + ).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listAssets without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListAssetsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult() + ), + ]; + client.descriptors.page.listAssets.asyncIterate = stubAsyncIterationCall( + expectedResponse + ); + const responses: protos.google.cloud.securitycenter.v1.ListAssetsResponse.IListAssetsResult[] = []; + const iterable = client.listAssetsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listAssets.asyncIterate as SinonStub).getCall( + 0 + ).args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.listAssets.asyncIterate as SinonStub).getCall( + 0 + ).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listAssets with error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListAssetsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('expected'); + client.descriptors.page.listAssets.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listAssetsAsync(request); + assert.rejects(async () => { + const responses: protos.google.cloud.securitycenter.v1.ListAssetsResponse.IListAssetsResult[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listAssets.asyncIterate as SinonStub).getCall( + 0 + ).args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.listAssets.asyncIterate as SinonStub).getCall( + 0 + ).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('listFindings', () => { + it('invokes listFindings without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListFindingsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult() + ), + ]; + client.innerApiCalls.listFindings = stubSimpleCall(expectedResponse); + const [response] = await client.listFindings(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listFindings as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listFindings without error using callback', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListFindingsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult() + ), + ]; + client.innerApiCalls.listFindings = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.listFindings( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.securitycenter.v1.ListFindingsResponse.IListFindingsResult[] + | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listFindings as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes listFindings with error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListFindingsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listFindings = stubSimpleCall( + undefined, + expectedError + ); + assert.rejects(async () => { + await client.listFindings(request); + }, expectedError); + assert( + (client.innerApiCalls.listFindings as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listFindingsStream without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListFindingsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult() + ), + ]; + client.descriptors.page.listFindings.createStream = stubPageStreamingCall( + expectedResponse + ); + const stream = client.listFindingsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult[] = []; + stream.on( + 'data', + ( + response: protos.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult + ) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert( + (client.descriptors.page.listFindings.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listFindings, request) + ); + assert.strictEqual( + (client.descriptors.page.listFindings + .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + expectedHeaderRequestParams + ); + }); + + it('invokes listFindingsStream with error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListFindingsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('expected'); + client.descriptors.page.listFindings.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listFindingsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult[] = []; + stream.on( + 'data', + ( + response: protos.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult + ) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + assert.rejects(async () => { + await promise; + }, expectedError); + assert( + (client.descriptors.page.listFindings.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listFindings, request) + ); + assert.strictEqual( + (client.descriptors.page.listFindings + .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listFindings without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListFindingsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult() + ), + ]; + client.descriptors.page.listFindings.asyncIterate = stubAsyncIterationCall( + expectedResponse + ); + const responses: protos.google.cloud.securitycenter.v1.ListFindingsResponse.IListFindingsResult[] = []; + const iterable = client.listFindingsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listFindings + .asyncIterate as SinonStub).getCall(0).args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.listFindings + .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listFindings with error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListFindingsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('expected'); + client.descriptors.page.listFindings.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listFindingsAsync(request); + assert.rejects(async () => { + const responses: protos.google.cloud.securitycenter.v1.ListFindingsResponse.IListFindingsResult[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listFindings + .asyncIterate as SinonStub).getCall(0).args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.listFindings + .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + expectedHeaderRequestParams + ); + }); + }); + + describe('listNotificationConfigs', () => { + it('invokes listNotificationConfigs without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListNotificationConfigsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.NotificationConfig() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.NotificationConfig() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.NotificationConfig() + ), + ]; + client.innerApiCalls.listNotificationConfigs = stubSimpleCall( + expectedResponse + ); + const [response] = await client.listNotificationConfigs(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listNotificationConfigs as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listNotificationConfigs without error using callback', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListNotificationConfigsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.NotificationConfig() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.NotificationConfig() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.NotificationConfig() + ), + ]; + client.innerApiCalls.listNotificationConfigs = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.listNotificationConfigs( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.securitycenter.v1.INotificationConfig[] + | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listNotificationConfigs as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes listNotificationConfigs with error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListNotificationConfigsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listNotificationConfigs = stubSimpleCall( + undefined, + expectedError + ); + assert.rejects(async () => { + await client.listNotificationConfigs(request); + }, expectedError); + assert( + (client.innerApiCalls.listNotificationConfigs as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listNotificationConfigsStream without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListNotificationConfigsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.NotificationConfig() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.NotificationConfig() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.NotificationConfig() + ), + ]; + client.descriptors.page.listNotificationConfigs.createStream = stubPageStreamingCall( + expectedResponse + ); + const stream = client.listNotificationConfigsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.securitycenter.v1.NotificationConfig[] = []; + stream.on( + 'data', + ( + response: protos.google.cloud.securitycenter.v1.NotificationConfig + ) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert( + (client.descriptors.page.listNotificationConfigs + .createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listNotificationConfigs, request) + ); + assert.strictEqual( + (client.descriptors.page.listNotificationConfigs + .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + expectedHeaderRequestParams + ); + }); + + it('invokes listNotificationConfigsStream with error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListNotificationConfigsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('expected'); + client.descriptors.page.listNotificationConfigs.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listNotificationConfigsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.securitycenter.v1.NotificationConfig[] = []; + stream.on( + 'data', + ( + response: protos.google.cloud.securitycenter.v1.NotificationConfig + ) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + assert.rejects(async () => { + await promise; + }, expectedError); + assert( + (client.descriptors.page.listNotificationConfigs + .createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listNotificationConfigs, request) + ); + assert.strictEqual( + (client.descriptors.page.listNotificationConfigs + .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listNotificationConfigs without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListNotificationConfigsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.NotificationConfig() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.NotificationConfig() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.NotificationConfig() + ), + ]; + client.descriptors.page.listNotificationConfigs.asyncIterate = stubAsyncIterationCall( + expectedResponse + ); + const responses: protos.google.cloud.securitycenter.v1.INotificationConfig[] = []; + const iterable = client.listNotificationConfigsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listNotificationConfigs + .asyncIterate as SinonStub).getCall(0).args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.listNotificationConfigs + .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listNotificationConfigs with error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListNotificationConfigsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('expected'); + client.descriptors.page.listNotificationConfigs.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listNotificationConfigsAsync(request); + assert.rejects(async () => { + const responses: protos.google.cloud.securitycenter.v1.INotificationConfig[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listNotificationConfigs + .asyncIterate as SinonStub).getCall(0).args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.listNotificationConfigs + .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + expectedHeaderRequestParams + ); + }); + }); + + describe('listSources', () => { + it('invokes listSources without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListSourcesRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.Source() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.Source() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.Source() + ), + ]; + client.innerApiCalls.listSources = stubSimpleCall(expectedResponse); + const [response] = await client.listSources(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listSources as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listSources without error using callback', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListSourcesRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.Source() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.Source() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.Source() + ), + ]; + client.innerApiCalls.listSources = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.listSources( + request, + ( + err?: Error | null, + result?: protos.google.cloud.securitycenter.v1.ISource[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listSources as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes listSources with error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListSourcesRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listSources = stubSimpleCall( + undefined, + expectedError + ); + assert.rejects(async () => { + await client.listSources(request); + }, expectedError); + assert( + (client.innerApiCalls.listSources as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listSourcesStream without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListSourcesRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.Source() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.Source() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.Source() + ), + ]; + client.descriptors.page.listSources.createStream = stubPageStreamingCall( + expectedResponse + ); + const stream = client.listSourcesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.securitycenter.v1.Source[] = []; + stream.on( + 'data', + (response: protos.google.cloud.securitycenter.v1.Source) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert( + (client.descriptors.page.listSources.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listSources, request) + ); + assert.strictEqual( + (client.descriptors.page.listSources.createStream as SinonStub).getCall( + 0 + ).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listSourcesStream with error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListSourcesRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('expected'); + client.descriptors.page.listSources.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listSourcesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.securitycenter.v1.Source[] = []; + stream.on( + 'data', + (response: protos.google.cloud.securitycenter.v1.Source) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + assert.rejects(async () => { + await promise; + }, expectedError); + assert( + (client.descriptors.page.listSources.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listSources, request) + ); + assert.strictEqual( + (client.descriptors.page.listSources.createStream as SinonStub).getCall( + 0 + ).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listSources without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListSourcesRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.Source() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.Source() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.Source() + ), + ]; + client.descriptors.page.listSources.asyncIterate = stubAsyncIterationCall( + expectedResponse + ); + const responses: protos.google.cloud.securitycenter.v1.ISource[] = []; + const iterable = client.listSourcesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listSources.asyncIterate as SinonStub).getCall( + 0 + ).args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.listSources.asyncIterate as SinonStub).getCall( + 0 + ).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listSources with error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListSourcesRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('expected'); + client.descriptors.page.listSources.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listSourcesAsync(request); + assert.rejects(async () => { + const responses: protos.google.cloud.securitycenter.v1.ISource[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listSources.asyncIterate as SinonStub).getCall( + 0 + ).args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.listSources.asyncIterate as SinonStub).getCall( + 0 + ).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('Path templates', () => { + describe('asset', () => { + const fakePath = '/rendered/path/asset'; + const expectedParameters = { + organization: 'organizationValue', + asset: 'assetValue', + }; + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.assetPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.assetPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('assetPath', () => { + const result = client.assetPath('organizationValue', 'assetValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.assetPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchOrganizationFromAssetName', () => { + const result = client.matchOrganizationFromAssetName(fakePath); + assert.strictEqual(result, 'organizationValue'); + assert( + (client.pathTemplates.assetPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchAssetFromAssetName', () => { + const result = client.matchAssetFromAssetName(fakePath); + assert.strictEqual(result, 'assetValue'); + assert( + (client.pathTemplates.assetPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('finding', () => { + const fakePath = '/rendered/path/finding'; + const expectedParameters = { + organization: 'organizationValue', + source: 'sourceValue', + finding: 'findingValue', + }; + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.findingPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.findingPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('findingPath', () => { + const result = client.findingPath( + 'organizationValue', + 'sourceValue', + 'findingValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.findingPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchOrganizationFromFindingName', () => { + const result = client.matchOrganizationFromFindingName(fakePath); + assert.strictEqual(result, 'organizationValue'); + assert( + (client.pathTemplates.findingPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSourceFromFindingName', () => { + const result = client.matchSourceFromFindingName(fakePath); + assert.strictEqual(result, 'sourceValue'); + assert( + (client.pathTemplates.findingPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchFindingFromFindingName', () => { + const result = client.matchFindingFromFindingName(fakePath); + assert.strictEqual(result, 'findingValue'); + assert( + (client.pathTemplates.findingPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('notificationConfig', () => { + const fakePath = '/rendered/path/notificationConfig'; + const expectedParameters = { + organization: 'organizationValue', + notification_config: 'notificationConfigValue', + }; + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.notificationConfigPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.notificationConfigPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('notificationConfigPath', () => { + const result = client.notificationConfigPath( + 'organizationValue', + 'notificationConfigValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.notificationConfigPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchOrganizationFromNotificationConfigName', () => { + const result = client.matchOrganizationFromNotificationConfigName( + fakePath + ); + assert.strictEqual(result, 'organizationValue'); + assert( + (client.pathTemplates.notificationConfigPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchNotificationConfigFromNotificationConfigName', () => { + const result = client.matchNotificationConfigFromNotificationConfigName( + fakePath + ); + assert.strictEqual(result, 'notificationConfigValue'); + assert( + (client.pathTemplates.notificationConfigPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('organization', () => { + const fakePath = '/rendered/path/organization'; + const expectedParameters = { + organization: 'organizationValue', + }; + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.organizationPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.organizationPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('organizationPath', () => { + const result = client.organizationPath('organizationValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.organizationPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchOrganizationFromOrganizationName', () => { + const result = client.matchOrganizationFromOrganizationName(fakePath); + assert.strictEqual(result, 'organizationValue'); + assert( + (client.pathTemplates.organizationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('organizationAssetSecurityMarks', () => { + const fakePath = '/rendered/path/organizationAssetSecurityMarks'; + const expectedParameters = { + organization: 'organizationValue', + asset: 'assetValue', + }; + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.organizationAssetSecurityMarksPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.organizationAssetSecurityMarksPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('organizationAssetSecurityMarksPath', () => { + const result = client.organizationAssetSecurityMarksPath( + 'organizationValue', + 'assetValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.organizationAssetSecurityMarksPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchOrganizationFromOrganizationAssetSecurityMarksName', () => { + const result = client.matchOrganizationFromOrganizationAssetSecurityMarksName( + fakePath + ); + assert.strictEqual(result, 'organizationValue'); + assert( + (client.pathTemplates.organizationAssetSecurityMarksPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchAssetFromOrganizationAssetSecurityMarksName', () => { + const result = client.matchAssetFromOrganizationAssetSecurityMarksName( + fakePath + ); + assert.strictEqual(result, 'assetValue'); + assert( + (client.pathTemplates.organizationAssetSecurityMarksPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('organizationSettings', () => { + const fakePath = '/rendered/path/organizationSettings'; + const expectedParameters = { + organization: 'organizationValue', + }; + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.organizationSettingsPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.organizationSettingsPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('organizationSettingsPath', () => { + const result = client.organizationSettingsPath('organizationValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.organizationSettingsPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchOrganizationFromOrganizationSettingsName', () => { + const result = client.matchOrganizationFromOrganizationSettingsName( + fakePath + ); + assert.strictEqual(result, 'organizationValue'); + assert( + (client.pathTemplates.organizationSettingsPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('organizationSourceFindingSecurityMarks', () => { + const fakePath = '/rendered/path/organizationSourceFindingSecurityMarks'; + const expectedParameters = { + organization: 'organizationValue', + source: 'sourceValue', + finding: 'findingValue', + }; + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.organizationSourceFindingSecurityMarksPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.organizationSourceFindingSecurityMarksPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('organizationSourceFindingSecurityMarksPath', () => { + const result = client.organizationSourceFindingSecurityMarksPath( + 'organizationValue', + 'sourceValue', + 'findingValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates + .organizationSourceFindingSecurityMarksPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchOrganizationFromOrganizationSourceFindingSecurityMarksName', () => { + const result = client.matchOrganizationFromOrganizationSourceFindingSecurityMarksName( + fakePath + ); + assert.strictEqual(result, 'organizationValue'); + assert( + (client.pathTemplates + .organizationSourceFindingSecurityMarksPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSourceFromOrganizationSourceFindingSecurityMarksName', () => { + const result = client.matchSourceFromOrganizationSourceFindingSecurityMarksName( + fakePath + ); + assert.strictEqual(result, 'sourceValue'); + assert( + (client.pathTemplates + .organizationSourceFindingSecurityMarksPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchFindingFromOrganizationSourceFindingSecurityMarksName', () => { + const result = client.matchFindingFromOrganizationSourceFindingSecurityMarksName( + fakePath + ); + assert.strictEqual(result, 'findingValue'); + assert( + (client.pathTemplates + .organizationSourceFindingSecurityMarksPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('source', () => { + const fakePath = '/rendered/path/source'; + const expectedParameters = { + organization: 'organizationValue', + source: 'sourceValue', + }; + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.sourcePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.sourcePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('sourcePath', () => { + const result = client.sourcePath('organizationValue', 'sourceValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.sourcePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchOrganizationFromSourceName', () => { + const result = client.matchOrganizationFromSourceName(fakePath); + assert.strictEqual(result, 'organizationValue'); + assert( + (client.pathTemplates.sourcePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSourceFromSourceName', () => { + const result = client.matchSourceFromSourceName(fakePath); + assert.strictEqual(result, 'sourceValue'); + assert( + (client.pathTemplates.sourcePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + }); +}); diff --git a/packages/google-cloud-securitycenter/test/gapic_security_center_v1beta1.ts b/packages/google-cloud-securitycenter/test/gapic_security_center_v1beta1.ts new file mode 100644 index 00000000000..4187ac96644 --- /dev/null +++ b/packages/google-cloud-securitycenter/test/gapic_security_center_v1beta1.ts @@ -0,0 +1,3710 @@ +// 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 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 securitycenterModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf, LROperation} from 'google-gax'; + +function generateSampleMessage(instance: T) { + const filledObject = (instance.constructor as typeof protobuf.Message).toObject( + instance as protobuf.Message, + {defaults: true} + ); + return (instance.constructor as typeof protobuf.Message).fromObject( + filledObject + ) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error + ? sinon.stub().rejects(error) + : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback( + response?: ResponseType, + error?: Error +) { + return error + ? sinon.stub().callsArgWith(2, error) + : sinon.stub().callsArgWith(2, null, response); +} + +function stubLongRunningCall( + response?: ResponseType, + callError?: Error, + lroError?: Error +) { + const innerStub = lroError + ? sinon.stub().rejects(lroError) + : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError + ? sinon.stub().rejects(callError) + : sinon.stub().resolves([mockOperation]); +} + +function stubLongRunningCallWithCallback( + response?: ResponseType, + callError?: Error, + lroError?: Error +) { + const innerStub = lroError + ? sinon.stub().rejects(lroError) + : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError + ? sinon.stub().callsArgWith(2, callError) + : sinon.stub().callsArgWith(2, null, mockOperation); +} + +function stubPageStreamingCall( + responses?: ResponseType[], + error?: Error +) { + const pagingStub = sinon.stub(); + if (responses) { + for (let i = 0; i < responses.length; ++i) { + pagingStub.onCall(i).callsArgWith(2, null, responses[i]); + } + } + const transformStub = error + ? sinon.stub().callsArgWith(2, error) + : pagingStub; + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + // trigger as many responses as needed + if (responses) { + for (let i = 0; i < responses.length; ++i) { + setImmediate(() => { + mockStream.write({}); + }); + } + setImmediate(() => { + mockStream.end(); + }); + } else { + setImmediate(() => { + mockStream.write({}); + }); + setImmediate(() => { + mockStream.end(); + }); + } + return sinon.stub().returns(mockStream); +} + +function stubAsyncIterationCall( + responses?: ResponseType[], + error?: Error +) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({done: true, value: undefined}); + } + return Promise.resolve({done: false, value: responses![counter++]}); + }, + }; + }, + }; + return sinon.stub().returns(asyncIterable); +} + +describe('v1beta1.SecurityCenterClient', () => { + it('has servicePath', () => { + const servicePath = + securitycenterModule.v1beta1.SecurityCenterClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = + securitycenterModule.v1beta1.SecurityCenterClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = securitycenterModule.v1beta1.SecurityCenterClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.securityCenterStub, undefined); + await client.initialize(); + assert(client.securityCenterStub); + }); + + it('has close method', () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.close(); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + 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 securitycenterModule.v1beta1.SecurityCenterClient({ + 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('createSource', () => { + it('invokes createSource without error', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.CreateSourceRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.Source() + ); + client.innerApiCalls.createSource = stubSimpleCall(expectedResponse); + const [response] = await client.createSource(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.createSource as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes createSource without error using callback', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.CreateSourceRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.Source() + ); + client.innerApiCalls.createSource = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.createSource( + request, + ( + err?: Error | null, + result?: protos.google.cloud.securitycenter.v1beta1.ISource | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.createSource as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes createSource with error', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.CreateSourceRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createSource = stubSimpleCall( + undefined, + expectedError + ); + assert.rejects(async () => { + await client.createSource(request); + }, expectedError); + assert( + (client.innerApiCalls.createSource as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('createFinding', () => { + it('invokes createFinding without error', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.CreateFindingRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.Finding() + ); + client.innerApiCalls.createFinding = stubSimpleCall(expectedResponse); + const [response] = await client.createFinding(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.createFinding as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes createFinding without error using callback', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.CreateFindingRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.Finding() + ); + client.innerApiCalls.createFinding = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.createFinding( + request, + ( + err?: Error | null, + result?: protos.google.cloud.securitycenter.v1beta1.IFinding | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.createFinding as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes createFinding with error', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.CreateFindingRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createFinding = stubSimpleCall( + undefined, + expectedError + ); + assert.rejects(async () => { + await client.createFinding(request); + }, expectedError); + assert( + (client.innerApiCalls.createFinding as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('getIamPolicy', () => { + it('invokes getIamPolicy without error', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.iam.v1.Policy() + ); + client.innerApiCalls.getIamPolicy = stubSimpleCall(expectedResponse); + const [response] = await client.getIamPolicy(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes getIamPolicy without error using callback', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.iam.v1.Policy() + ); + client.innerApiCalls.getIamPolicy = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.getIamPolicy( + request, + ( + err?: Error | null, + result?: protos.google.iam.v1.IPolicy | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes getIamPolicy with error', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getIamPolicy = stubSimpleCall( + undefined, + expectedError + ); + assert.rejects(async () => { + await client.getIamPolicy(request); + }, expectedError); + assert( + (client.innerApiCalls.getIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('getOrganizationSettings', () => { + it('invokes getOrganizationSettings without error', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.OrganizationSettings() + ); + client.innerApiCalls.getOrganizationSettings = stubSimpleCall( + expectedResponse + ); + const [response] = await client.getOrganizationSettings(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getOrganizationSettings as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes getOrganizationSettings without error using callback', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.OrganizationSettings() + ); + client.innerApiCalls.getOrganizationSettings = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.getOrganizationSettings( + request, + ( + err?: Error | null, + result?: protos.google.cloud.securitycenter.v1beta1.IOrganizationSettings | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getOrganizationSettings as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes getOrganizationSettings with error', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getOrganizationSettings = stubSimpleCall( + undefined, + expectedError + ); + assert.rejects(async () => { + await client.getOrganizationSettings(request); + }, expectedError); + assert( + (client.innerApiCalls.getOrganizationSettings as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('getSource', () => { + it('invokes getSource without error', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.GetSourceRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.Source() + ); + client.innerApiCalls.getSource = stubSimpleCall(expectedResponse); + const [response] = await client.getSource(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getSource as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes getSource without error using callback', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.GetSourceRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.Source() + ); + client.innerApiCalls.getSource = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.getSource( + request, + ( + err?: Error | null, + result?: protos.google.cloud.securitycenter.v1beta1.ISource | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getSource as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes getSource with error', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.GetSourceRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getSource = stubSimpleCall(undefined, expectedError); + assert.rejects(async () => { + await client.getSource(request); + }, expectedError); + assert( + (client.innerApiCalls.getSource as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('setFindingState', () => { + it('invokes setFindingState without error', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.SetFindingStateRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.Finding() + ); + client.innerApiCalls.setFindingState = stubSimpleCall(expectedResponse); + const [response] = await client.setFindingState(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.setFindingState as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes setFindingState without error using callback', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.SetFindingStateRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.Finding() + ); + client.innerApiCalls.setFindingState = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.setFindingState( + request, + ( + err?: Error | null, + result?: protos.google.cloud.securitycenter.v1beta1.IFinding | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.setFindingState as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes setFindingState with error', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.SetFindingStateRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.setFindingState = stubSimpleCall( + undefined, + expectedError + ); + assert.rejects(async () => { + await client.setFindingState(request); + }, expectedError); + assert( + (client.innerApiCalls.setFindingState as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('setIamPolicy', () => { + it('invokes setIamPolicy without error', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.iam.v1.Policy() + ); + client.innerApiCalls.setIamPolicy = stubSimpleCall(expectedResponse); + const [response] = await client.setIamPolicy(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.setIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes setIamPolicy without error using callback', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.iam.v1.Policy() + ); + client.innerApiCalls.setIamPolicy = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.setIamPolicy( + request, + ( + err?: Error | null, + result?: protos.google.iam.v1.IPolicy | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.setIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes setIamPolicy with error', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.setIamPolicy = stubSimpleCall( + undefined, + expectedError + ); + assert.rejects(async () => { + await client.setIamPolicy(request); + }, expectedError); + assert( + (client.innerApiCalls.setIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('testIamPermissions', () => { + it('invokes testIamPermissions without error', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.iam.v1.TestIamPermissionsResponse() + ); + client.innerApiCalls.testIamPermissions = stubSimpleCall( + expectedResponse + ); + const [response] = await client.testIamPermissions(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.testIamPermissions as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes testIamPermissions without error using callback', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.iam.v1.TestIamPermissionsResponse() + ); + client.innerApiCalls.testIamPermissions = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.testIamPermissions( + request, + ( + err?: Error | null, + result?: protos.google.iam.v1.ITestIamPermissionsResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.testIamPermissions as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes testIamPermissions with error', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.testIamPermissions = stubSimpleCall( + undefined, + expectedError + ); + assert.rejects(async () => { + await client.testIamPermissions(request); + }, expectedError); + assert( + (client.innerApiCalls.testIamPermissions as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('updateFinding', () => { + it('invokes updateFinding without error', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.UpdateFindingRequest() + ); + request.finding = {}; + request.finding.name = ''; + const expectedHeaderRequestParams = 'finding.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.Finding() + ); + client.innerApiCalls.updateFinding = stubSimpleCall(expectedResponse); + const [response] = await client.updateFinding(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.updateFinding as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes updateFinding without error using callback', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.UpdateFindingRequest() + ); + request.finding = {}; + request.finding.name = ''; + const expectedHeaderRequestParams = 'finding.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.Finding() + ); + client.innerApiCalls.updateFinding = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.updateFinding( + request, + ( + err?: Error | null, + result?: protos.google.cloud.securitycenter.v1beta1.IFinding | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.updateFinding as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes updateFinding with error', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.UpdateFindingRequest() + ); + request.finding = {}; + request.finding.name = ''; + const expectedHeaderRequestParams = 'finding.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.updateFinding = stubSimpleCall( + undefined, + expectedError + ); + assert.rejects(async () => { + await client.updateFinding(request); + }, expectedError); + assert( + (client.innerApiCalls.updateFinding as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('updateOrganizationSettings', () => { + it('invokes updateOrganizationSettings without error', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest() + ); + request.organizationSettings = {}; + request.organizationSettings.name = ''; + const expectedHeaderRequestParams = 'organization_settings.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.OrganizationSettings() + ); + client.innerApiCalls.updateOrganizationSettings = stubSimpleCall( + expectedResponse + ); + const [response] = await client.updateOrganizationSettings(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.updateOrganizationSettings as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes updateOrganizationSettings without error using callback', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest() + ); + request.organizationSettings = {}; + request.organizationSettings.name = ''; + const expectedHeaderRequestParams = 'organization_settings.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.OrganizationSettings() + ); + client.innerApiCalls.updateOrganizationSettings = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.updateOrganizationSettings( + request, + ( + err?: Error | null, + result?: protos.google.cloud.securitycenter.v1beta1.IOrganizationSettings | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.updateOrganizationSettings as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes updateOrganizationSettings with error', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest() + ); + request.organizationSettings = {}; + request.organizationSettings.name = ''; + const expectedHeaderRequestParams = 'organization_settings.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.updateOrganizationSettings = stubSimpleCall( + undefined, + expectedError + ); + assert.rejects(async () => { + await client.updateOrganizationSettings(request); + }, expectedError); + assert( + (client.innerApiCalls.updateOrganizationSettings as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('updateSource', () => { + it('invokes updateSource without error', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.UpdateSourceRequest() + ); + request.source = {}; + request.source.name = ''; + const expectedHeaderRequestParams = 'source.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.Source() + ); + client.innerApiCalls.updateSource = stubSimpleCall(expectedResponse); + const [response] = await client.updateSource(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.updateSource as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes updateSource without error using callback', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.UpdateSourceRequest() + ); + request.source = {}; + request.source.name = ''; + const expectedHeaderRequestParams = 'source.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.Source() + ); + client.innerApiCalls.updateSource = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.updateSource( + request, + ( + err?: Error | null, + result?: protos.google.cloud.securitycenter.v1beta1.ISource | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.updateSource as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes updateSource with error', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.UpdateSourceRequest() + ); + request.source = {}; + request.source.name = ''; + const expectedHeaderRequestParams = 'source.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.updateSource = stubSimpleCall( + undefined, + expectedError + ); + assert.rejects(async () => { + await client.updateSource(request); + }, expectedError); + assert( + (client.innerApiCalls.updateSource as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('updateSecurityMarks', () => { + it('invokes updateSecurityMarks without error', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest() + ); + request.securityMarks = {}; + request.securityMarks.name = ''; + const expectedHeaderRequestParams = 'security_marks.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.SecurityMarks() + ); + client.innerApiCalls.updateSecurityMarks = stubSimpleCall( + expectedResponse + ); + const [response] = await client.updateSecurityMarks(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.updateSecurityMarks as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes updateSecurityMarks without error using callback', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest() + ); + request.securityMarks = {}; + request.securityMarks.name = ''; + const expectedHeaderRequestParams = 'security_marks.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.SecurityMarks() + ); + client.innerApiCalls.updateSecurityMarks = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.updateSecurityMarks( + request, + ( + err?: Error | null, + result?: protos.google.cloud.securitycenter.v1beta1.ISecurityMarks | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.updateSecurityMarks as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes updateSecurityMarks with error', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest() + ); + request.securityMarks = {}; + request.securityMarks.name = ''; + const expectedHeaderRequestParams = 'security_marks.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.updateSecurityMarks = stubSimpleCall( + undefined, + expectedError + ); + assert.rejects(async () => { + await client.updateSecurityMarks(request); + }, expectedError); + assert( + (client.innerApiCalls.updateSecurityMarks as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('runAssetDiscovery', () => { + it('invokes runAssetDiscovery without error', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.runAssetDiscovery = stubLongRunningCall( + expectedResponse + ); + const [operation] = await client.runAssetDiscovery(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.runAssetDiscovery as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes runAssetDiscovery without error using callback', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.runAssetDiscovery = stubLongRunningCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.runAssetDiscovery( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.protobuf.IEmpty, + protos.google.protobuf.IEmpty + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.protobuf.IEmpty, + protos.google.protobuf.IEmpty + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.runAssetDiscovery as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes runAssetDiscovery with call error', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.runAssetDiscovery = stubLongRunningCall( + undefined, + expectedError + ); + assert.rejects(async () => { + await client.runAssetDiscovery(request); + }, expectedError); + assert( + (client.innerApiCalls.runAssetDiscovery as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes runAssetDiscovery with LRO error', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.runAssetDiscovery = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.runAssetDiscovery(request); + assert.rejects(async () => { + await operation.promise(); + }, expectedError); + assert( + (client.innerApiCalls.runAssetDiscovery as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('groupAssets', () => { + it('invokes groupAssets without error', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.GroupAssetsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.GroupResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.GroupResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.GroupResult() + ), + ]; + client.innerApiCalls.groupAssets = stubSimpleCall(expectedResponse); + const [response] = await client.groupAssets(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.groupAssets as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes groupAssets without error using callback', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.GroupAssetsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.GroupResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.GroupResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.GroupResult() + ), + ]; + client.innerApiCalls.groupAssets = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.groupAssets( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.securitycenter.v1beta1.IGroupResult[] + | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.groupAssets as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes groupAssets with error', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.GroupAssetsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.groupAssets = stubSimpleCall( + undefined, + expectedError + ); + assert.rejects(async () => { + await client.groupAssets(request); + }, expectedError); + assert( + (client.innerApiCalls.groupAssets as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes groupAssetsStream without error', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.GroupAssetsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.GroupResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.GroupResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.GroupResult() + ), + ]; + client.descriptors.page.groupAssets.createStream = stubPageStreamingCall( + expectedResponse + ); + const stream = client.groupAssetsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.securitycenter.v1beta1.GroupResult[] = []; + stream.on( + 'data', + ( + response: protos.google.cloud.securitycenter.v1beta1.GroupResult + ) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert( + (client.descriptors.page.groupAssets.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.groupAssets, request) + ); + assert.strictEqual( + (client.descriptors.page.groupAssets.createStream as SinonStub).getCall( + 0 + ).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes groupAssetsStream with error', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.GroupAssetsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('expected'); + client.descriptors.page.groupAssets.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.groupAssetsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.securitycenter.v1beta1.GroupResult[] = []; + stream.on( + 'data', + ( + response: protos.google.cloud.securitycenter.v1beta1.GroupResult + ) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + assert.rejects(async () => { + await promise; + }, expectedError); + assert( + (client.descriptors.page.groupAssets.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.groupAssets, request) + ); + assert.strictEqual( + (client.descriptors.page.groupAssets.createStream as SinonStub).getCall( + 0 + ).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with groupAssets without error', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.GroupAssetsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.GroupResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.GroupResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.GroupResult() + ), + ]; + client.descriptors.page.groupAssets.asyncIterate = stubAsyncIterationCall( + expectedResponse + ); + const responses: protos.google.cloud.securitycenter.v1beta1.IGroupResult[] = []; + const iterable = client.groupAssetsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.groupAssets.asyncIterate as SinonStub).getCall( + 0 + ).args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.groupAssets.asyncIterate as SinonStub).getCall( + 0 + ).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with groupAssets with error', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.GroupAssetsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('expected'); + client.descriptors.page.groupAssets.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.groupAssetsAsync(request); + assert.rejects(async () => { + const responses: protos.google.cloud.securitycenter.v1beta1.IGroupResult[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.groupAssets.asyncIterate as SinonStub).getCall( + 0 + ).args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.groupAssets.asyncIterate as SinonStub).getCall( + 0 + ).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('groupFindings', () => { + it('invokes groupFindings without error', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.GroupFindingsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.GroupResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.GroupResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.GroupResult() + ), + ]; + client.innerApiCalls.groupFindings = stubSimpleCall(expectedResponse); + const [response] = await client.groupFindings(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.groupFindings as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes groupFindings without error using callback', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.GroupFindingsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.GroupResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.GroupResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.GroupResult() + ), + ]; + client.innerApiCalls.groupFindings = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.groupFindings( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.securitycenter.v1beta1.IGroupResult[] + | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.groupFindings as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes groupFindings with error', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.GroupFindingsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.groupFindings = stubSimpleCall( + undefined, + expectedError + ); + assert.rejects(async () => { + await client.groupFindings(request); + }, expectedError); + assert( + (client.innerApiCalls.groupFindings as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes groupFindingsStream without error', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.GroupFindingsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.GroupResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.GroupResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.GroupResult() + ), + ]; + client.descriptors.page.groupFindings.createStream = stubPageStreamingCall( + expectedResponse + ); + const stream = client.groupFindingsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.securitycenter.v1beta1.GroupResult[] = []; + stream.on( + 'data', + ( + response: protos.google.cloud.securitycenter.v1beta1.GroupResult + ) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert( + (client.descriptors.page.groupFindings.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.groupFindings, request) + ); + assert.strictEqual( + (client.descriptors.page.groupFindings + .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + expectedHeaderRequestParams + ); + }); + + it('invokes groupFindingsStream with error', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.GroupFindingsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('expected'); + client.descriptors.page.groupFindings.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.groupFindingsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.securitycenter.v1beta1.GroupResult[] = []; + stream.on( + 'data', + ( + response: protos.google.cloud.securitycenter.v1beta1.GroupResult + ) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + assert.rejects(async () => { + await promise; + }, expectedError); + assert( + (client.descriptors.page.groupFindings.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.groupFindings, request) + ); + assert.strictEqual( + (client.descriptors.page.groupFindings + .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with groupFindings without error', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.GroupFindingsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.GroupResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.GroupResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.GroupResult() + ), + ]; + client.descriptors.page.groupFindings.asyncIterate = stubAsyncIterationCall( + expectedResponse + ); + const responses: protos.google.cloud.securitycenter.v1beta1.IGroupResult[] = []; + const iterable = client.groupFindingsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.groupFindings + .asyncIterate as SinonStub).getCall(0).args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.groupFindings + .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with groupFindings with error', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.GroupFindingsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('expected'); + client.descriptors.page.groupFindings.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.groupFindingsAsync(request); + assert.rejects(async () => { + const responses: protos.google.cloud.securitycenter.v1beta1.IGroupResult[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.groupFindings + .asyncIterate as SinonStub).getCall(0).args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.groupFindings + .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + expectedHeaderRequestParams + ); + }); + }); + + describe('listAssets', () => { + it('invokes listAssets without error', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.ListAssetsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult() + ), + ]; + client.innerApiCalls.listAssets = stubSimpleCall(expectedResponse); + const [response] = await client.listAssets(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listAssets as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listAssets without error using callback', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.ListAssetsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult() + ), + ]; + client.innerApiCalls.listAssets = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.listAssets( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.securitycenter.v1beta1.ListAssetsResponse.IListAssetsResult[] + | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listAssets as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes listAssets with error', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.ListAssetsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listAssets = stubSimpleCall( + undefined, + expectedError + ); + assert.rejects(async () => { + await client.listAssets(request); + }, expectedError); + assert( + (client.innerApiCalls.listAssets as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listAssetsStream without error', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.ListAssetsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult() + ), + ]; + client.descriptors.page.listAssets.createStream = stubPageStreamingCall( + expectedResponse + ); + const stream = client.listAssetsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult[] = []; + stream.on( + 'data', + ( + response: protos.google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult + ) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert( + (client.descriptors.page.listAssets.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listAssets, request) + ); + assert.strictEqual( + (client.descriptors.page.listAssets.createStream as SinonStub).getCall( + 0 + ).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listAssetsStream with error', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.ListAssetsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('expected'); + client.descriptors.page.listAssets.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listAssetsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult[] = []; + stream.on( + 'data', + ( + response: protos.google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult + ) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + assert.rejects(async () => { + await promise; + }, expectedError); + assert( + (client.descriptors.page.listAssets.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listAssets, request) + ); + assert.strictEqual( + (client.descriptors.page.listAssets.createStream as SinonStub).getCall( + 0 + ).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listAssets without error', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.ListAssetsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult() + ), + ]; + client.descriptors.page.listAssets.asyncIterate = stubAsyncIterationCall( + expectedResponse + ); + const responses: protos.google.cloud.securitycenter.v1beta1.ListAssetsResponse.IListAssetsResult[] = []; + const iterable = client.listAssetsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listAssets.asyncIterate as SinonStub).getCall( + 0 + ).args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.listAssets.asyncIterate as SinonStub).getCall( + 0 + ).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listAssets with error', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.ListAssetsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('expected'); + client.descriptors.page.listAssets.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listAssetsAsync(request); + assert.rejects(async () => { + const responses: protos.google.cloud.securitycenter.v1beta1.ListAssetsResponse.IListAssetsResult[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listAssets.asyncIterate as SinonStub).getCall( + 0 + ).args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.listAssets.asyncIterate as SinonStub).getCall( + 0 + ).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('listFindings', () => { + it('invokes listFindings without error', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.ListFindingsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.Finding() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.Finding() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.Finding() + ), + ]; + client.innerApiCalls.listFindings = stubSimpleCall(expectedResponse); + const [response] = await client.listFindings(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listFindings as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listFindings without error using callback', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.ListFindingsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.Finding() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.Finding() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.Finding() + ), + ]; + client.innerApiCalls.listFindings = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.listFindings( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.securitycenter.v1beta1.IFinding[] + | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listFindings as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes listFindings with error', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.ListFindingsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listFindings = stubSimpleCall( + undefined, + expectedError + ); + assert.rejects(async () => { + await client.listFindings(request); + }, expectedError); + assert( + (client.innerApiCalls.listFindings as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listFindingsStream without error', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.ListFindingsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.Finding() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.Finding() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.Finding() + ), + ]; + client.descriptors.page.listFindings.createStream = stubPageStreamingCall( + expectedResponse + ); + const stream = client.listFindingsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.securitycenter.v1beta1.Finding[] = []; + stream.on( + 'data', + (response: protos.google.cloud.securitycenter.v1beta1.Finding) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert( + (client.descriptors.page.listFindings.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listFindings, request) + ); + assert.strictEqual( + (client.descriptors.page.listFindings + .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + expectedHeaderRequestParams + ); + }); + + it('invokes listFindingsStream with error', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.ListFindingsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('expected'); + client.descriptors.page.listFindings.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listFindingsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.securitycenter.v1beta1.Finding[] = []; + stream.on( + 'data', + (response: protos.google.cloud.securitycenter.v1beta1.Finding) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + assert.rejects(async () => { + await promise; + }, expectedError); + assert( + (client.descriptors.page.listFindings.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listFindings, request) + ); + assert.strictEqual( + (client.descriptors.page.listFindings + .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listFindings without error', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.ListFindingsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.Finding() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.Finding() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.Finding() + ), + ]; + client.descriptors.page.listFindings.asyncIterate = stubAsyncIterationCall( + expectedResponse + ); + const responses: protos.google.cloud.securitycenter.v1beta1.IFinding[] = []; + const iterable = client.listFindingsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listFindings + .asyncIterate as SinonStub).getCall(0).args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.listFindings + .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listFindings with error', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.ListFindingsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('expected'); + client.descriptors.page.listFindings.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listFindingsAsync(request); + assert.rejects(async () => { + const responses: protos.google.cloud.securitycenter.v1beta1.IFinding[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listFindings + .asyncIterate as SinonStub).getCall(0).args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.listFindings + .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + expectedHeaderRequestParams + ); + }); + }); + + describe('listSources', () => { + it('invokes listSources without error', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.ListSourcesRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.Source() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.Source() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.Source() + ), + ]; + client.innerApiCalls.listSources = stubSimpleCall(expectedResponse); + const [response] = await client.listSources(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listSources as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listSources without error using callback', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.ListSourcesRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.Source() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.Source() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.Source() + ), + ]; + client.innerApiCalls.listSources = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.listSources( + request, + ( + err?: Error | null, + result?: protos.google.cloud.securitycenter.v1beta1.ISource[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listSources as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes listSources with error', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.ListSourcesRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listSources = stubSimpleCall( + undefined, + expectedError + ); + assert.rejects(async () => { + await client.listSources(request); + }, expectedError); + assert( + (client.innerApiCalls.listSources as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listSourcesStream without error', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.ListSourcesRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.Source() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.Source() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.Source() + ), + ]; + client.descriptors.page.listSources.createStream = stubPageStreamingCall( + expectedResponse + ); + const stream = client.listSourcesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.securitycenter.v1beta1.Source[] = []; + stream.on( + 'data', + (response: protos.google.cloud.securitycenter.v1beta1.Source) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert( + (client.descriptors.page.listSources.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listSources, request) + ); + assert.strictEqual( + (client.descriptors.page.listSources.createStream as SinonStub).getCall( + 0 + ).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listSourcesStream with error', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.ListSourcesRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('expected'); + client.descriptors.page.listSources.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listSourcesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.securitycenter.v1beta1.Source[] = []; + stream.on( + 'data', + (response: protos.google.cloud.securitycenter.v1beta1.Source) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + assert.rejects(async () => { + await promise; + }, expectedError); + assert( + (client.descriptors.page.listSources.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listSources, request) + ); + assert.strictEqual( + (client.descriptors.page.listSources.createStream as SinonStub).getCall( + 0 + ).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listSources without error', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.ListSourcesRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.Source() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.Source() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.Source() + ), + ]; + client.descriptors.page.listSources.asyncIterate = stubAsyncIterationCall( + expectedResponse + ); + const responses: protos.google.cloud.securitycenter.v1beta1.ISource[] = []; + const iterable = client.listSourcesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listSources.asyncIterate as SinonStub).getCall( + 0 + ).args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.listSources.asyncIterate as SinonStub).getCall( + 0 + ).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listSources with error', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.ListSourcesRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('expected'); + client.descriptors.page.listSources.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listSourcesAsync(request); + assert.rejects(async () => { + const responses: protos.google.cloud.securitycenter.v1beta1.ISource[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listSources.asyncIterate as SinonStub).getCall( + 0 + ).args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.listSources.asyncIterate as SinonStub).getCall( + 0 + ).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('Path templates', () => { + describe('finding', () => { + const fakePath = '/rendered/path/finding'; + const expectedParameters = { + organization: 'organizationValue', + source: 'sourceValue', + finding: 'findingValue', + }; + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.findingPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.findingPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('findingPath', () => { + const result = client.findingPath( + 'organizationValue', + 'sourceValue', + 'findingValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.findingPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchOrganizationFromFindingName', () => { + const result = client.matchOrganizationFromFindingName(fakePath); + assert.strictEqual(result, 'organizationValue'); + assert( + (client.pathTemplates.findingPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSourceFromFindingName', () => { + const result = client.matchSourceFromFindingName(fakePath); + assert.strictEqual(result, 'sourceValue'); + assert( + (client.pathTemplates.findingPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchFindingFromFindingName', () => { + const result = client.matchFindingFromFindingName(fakePath); + assert.strictEqual(result, 'findingValue'); + assert( + (client.pathTemplates.findingPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('organization', () => { + const fakePath = '/rendered/path/organization'; + const expectedParameters = { + organization: 'organizationValue', + }; + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.organizationPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.organizationPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('organizationPath', () => { + const result = client.organizationPath('organizationValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.organizationPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchOrganizationFromOrganizationName', () => { + const result = client.matchOrganizationFromOrganizationName(fakePath); + assert.strictEqual(result, 'organizationValue'); + assert( + (client.pathTemplates.organizationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('organizationAssetSecurityMarks', () => { + const fakePath = '/rendered/path/organizationAssetSecurityMarks'; + const expectedParameters = { + organization: 'organizationValue', + asset: 'assetValue', + }; + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.organizationAssetSecurityMarksPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.organizationAssetSecurityMarksPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('organizationAssetSecurityMarksPath', () => { + const result = client.organizationAssetSecurityMarksPath( + 'organizationValue', + 'assetValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.organizationAssetSecurityMarksPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchOrganizationFromOrganizationAssetSecurityMarksName', () => { + const result = client.matchOrganizationFromOrganizationAssetSecurityMarksName( + fakePath + ); + assert.strictEqual(result, 'organizationValue'); + assert( + (client.pathTemplates.organizationAssetSecurityMarksPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchAssetFromOrganizationAssetSecurityMarksName', () => { + const result = client.matchAssetFromOrganizationAssetSecurityMarksName( + fakePath + ); + assert.strictEqual(result, 'assetValue'); + assert( + (client.pathTemplates.organizationAssetSecurityMarksPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('organizationSettings', () => { + const fakePath = '/rendered/path/organizationSettings'; + const expectedParameters = { + organization: 'organizationValue', + }; + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.organizationSettingsPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.organizationSettingsPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('organizationSettingsPath', () => { + const result = client.organizationSettingsPath('organizationValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.organizationSettingsPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchOrganizationFromOrganizationSettingsName', () => { + const result = client.matchOrganizationFromOrganizationSettingsName( + fakePath + ); + assert.strictEqual(result, 'organizationValue'); + assert( + (client.pathTemplates.organizationSettingsPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('organizationSourceFindingSecurityMarks', () => { + const fakePath = '/rendered/path/organizationSourceFindingSecurityMarks'; + const expectedParameters = { + organization: 'organizationValue', + source: 'sourceValue', + finding: 'findingValue', + }; + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.organizationSourceFindingSecurityMarksPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.organizationSourceFindingSecurityMarksPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('organizationSourceFindingSecurityMarksPath', () => { + const result = client.organizationSourceFindingSecurityMarksPath( + 'organizationValue', + 'sourceValue', + 'findingValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates + .organizationSourceFindingSecurityMarksPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchOrganizationFromOrganizationSourceFindingSecurityMarksName', () => { + const result = client.matchOrganizationFromOrganizationSourceFindingSecurityMarksName( + fakePath + ); + assert.strictEqual(result, 'organizationValue'); + assert( + (client.pathTemplates + .organizationSourceFindingSecurityMarksPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSourceFromOrganizationSourceFindingSecurityMarksName', () => { + const result = client.matchSourceFromOrganizationSourceFindingSecurityMarksName( + fakePath + ); + assert.strictEqual(result, 'sourceValue'); + assert( + (client.pathTemplates + .organizationSourceFindingSecurityMarksPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchFindingFromOrganizationSourceFindingSecurityMarksName', () => { + const result = client.matchFindingFromOrganizationSourceFindingSecurityMarksName( + fakePath + ); + assert.strictEqual(result, 'findingValue'); + assert( + (client.pathTemplates + .organizationSourceFindingSecurityMarksPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('source', () => { + const fakePath = '/rendered/path/source'; + const expectedParameters = { + organization: 'organizationValue', + source: 'sourceValue', + }; + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.sourcePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.sourcePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('sourcePath', () => { + const result = client.sourcePath('organizationValue', 'sourceValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.sourcePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchOrganizationFromSourceName', () => { + const result = client.matchOrganizationFromSourceName(fakePath); + assert.strictEqual(result, 'organizationValue'); + assert( + (client.pathTemplates.sourcePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSourceFromSourceName', () => { + const result = client.matchSourceFromSourceName(fakePath); + assert.strictEqual(result, 'sourceValue'); + assert( + (client.pathTemplates.sourcePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + }); +}); diff --git a/packages/google-cloud-securitycenter/test/gapic_security_center_v1p1beta1.ts b/packages/google-cloud-securitycenter/test/gapic_security_center_v1p1beta1.ts new file mode 100644 index 00000000000..4e9fe1cc44c --- /dev/null +++ b/packages/google-cloud-securitycenter/test/gapic_security_center_v1p1beta1.ts @@ -0,0 +1,4619 @@ +// 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 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 securitycenterModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf, LROperation} from 'google-gax'; + +function generateSampleMessage(instance: T) { + const filledObject = (instance.constructor as typeof protobuf.Message).toObject( + instance as protobuf.Message, + {defaults: true} + ); + return (instance.constructor as typeof protobuf.Message).fromObject( + filledObject + ) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error + ? sinon.stub().rejects(error) + : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback( + response?: ResponseType, + error?: Error +) { + return error + ? sinon.stub().callsArgWith(2, error) + : sinon.stub().callsArgWith(2, null, response); +} + +function stubLongRunningCall( + response?: ResponseType, + callError?: Error, + lroError?: Error +) { + const innerStub = lroError + ? sinon.stub().rejects(lroError) + : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError + ? sinon.stub().rejects(callError) + : sinon.stub().resolves([mockOperation]); +} + +function stubLongRunningCallWithCallback( + response?: ResponseType, + callError?: Error, + lroError?: Error +) { + const innerStub = lroError + ? sinon.stub().rejects(lroError) + : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError + ? sinon.stub().callsArgWith(2, callError) + : sinon.stub().callsArgWith(2, null, mockOperation); +} + +function stubPageStreamingCall( + responses?: ResponseType[], + error?: Error +) { + const pagingStub = sinon.stub(); + if (responses) { + for (let i = 0; i < responses.length; ++i) { + pagingStub.onCall(i).callsArgWith(2, null, responses[i]); + } + } + const transformStub = error + ? sinon.stub().callsArgWith(2, error) + : pagingStub; + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + // trigger as many responses as needed + if (responses) { + for (let i = 0; i < responses.length; ++i) { + setImmediate(() => { + mockStream.write({}); + }); + } + setImmediate(() => { + mockStream.end(); + }); + } else { + setImmediate(() => { + mockStream.write({}); + }); + setImmediate(() => { + mockStream.end(); + }); + } + return sinon.stub().returns(mockStream); +} + +function stubAsyncIterationCall( + responses?: ResponseType[], + error?: Error +) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({done: true, value: undefined}); + } + return Promise.resolve({done: false, value: responses![counter++]}); + }, + }; + }, + }; + return sinon.stub().returns(asyncIterable); +} + +describe('v1p1beta1.SecurityCenterClient', () => { + it('has servicePath', () => { + const servicePath = + securitycenterModule.v1p1beta1.SecurityCenterClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = + securitycenterModule.v1p1beta1.SecurityCenterClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = securitycenterModule.v1p1beta1.SecurityCenterClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.securityCenterStub, undefined); + await client.initialize(); + assert(client.securityCenterStub); + }); + + it('has close method', () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.close(); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + 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 securitycenterModule.v1p1beta1.SecurityCenterClient({ + 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('createSource', () => { + it('invokes createSource without error', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.CreateSourceRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.Source() + ); + client.innerApiCalls.createSource = stubSimpleCall(expectedResponse); + const [response] = await client.createSource(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.createSource as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes createSource without error using callback', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.CreateSourceRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.Source() + ); + client.innerApiCalls.createSource = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.createSource( + request, + ( + err?: Error | null, + result?: protos.google.cloud.securitycenter.v1p1beta1.ISource | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.createSource as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes createSource with error', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.CreateSourceRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createSource = stubSimpleCall( + undefined, + expectedError + ); + assert.rejects(async () => { + await client.createSource(request); + }, expectedError); + assert( + (client.innerApiCalls.createSource as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('createFinding', () => { + it('invokes createFinding without error', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.CreateFindingRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.Finding() + ); + client.innerApiCalls.createFinding = stubSimpleCall(expectedResponse); + const [response] = await client.createFinding(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.createFinding as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes createFinding without error using callback', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.CreateFindingRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.Finding() + ); + client.innerApiCalls.createFinding = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.createFinding( + request, + ( + err?: Error | null, + result?: protos.google.cloud.securitycenter.v1p1beta1.IFinding | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.createFinding as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes createFinding with error', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.CreateFindingRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createFinding = stubSimpleCall( + undefined, + expectedError + ); + assert.rejects(async () => { + await client.createFinding(request); + }, expectedError); + assert( + (client.innerApiCalls.createFinding as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('createNotificationConfig', () => { + it('invokes createNotificationConfig without error', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.CreateNotificationConfigRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.NotificationConfig() + ); + client.innerApiCalls.createNotificationConfig = stubSimpleCall( + expectedResponse + ); + const [response] = await client.createNotificationConfig(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.createNotificationConfig as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes createNotificationConfig without error using callback', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.CreateNotificationConfigRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.NotificationConfig() + ); + client.innerApiCalls.createNotificationConfig = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.createNotificationConfig( + request, + ( + err?: Error | null, + result?: protos.google.cloud.securitycenter.v1p1beta1.INotificationConfig | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.createNotificationConfig as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes createNotificationConfig with error', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.CreateNotificationConfigRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createNotificationConfig = stubSimpleCall( + undefined, + expectedError + ); + assert.rejects(async () => { + await client.createNotificationConfig(request); + }, expectedError); + assert( + (client.innerApiCalls.createNotificationConfig as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('deleteNotificationConfig', () => { + it('invokes deleteNotificationConfig without error', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.DeleteNotificationConfigRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteNotificationConfig = stubSimpleCall( + expectedResponse + ); + const [response] = await client.deleteNotificationConfig(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.deleteNotificationConfig as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes deleteNotificationConfig without error using callback', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.DeleteNotificationConfigRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteNotificationConfig = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.deleteNotificationConfig( + request, + ( + err?: Error | null, + result?: protos.google.protobuf.IEmpty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.deleteNotificationConfig as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes deleteNotificationConfig with error', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.DeleteNotificationConfigRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteNotificationConfig = stubSimpleCall( + undefined, + expectedError + ); + assert.rejects(async () => { + await client.deleteNotificationConfig(request); + }, expectedError); + assert( + (client.innerApiCalls.deleteNotificationConfig as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('getIamPolicy', () => { + it('invokes getIamPolicy without error', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.iam.v1.Policy() + ); + client.innerApiCalls.getIamPolicy = stubSimpleCall(expectedResponse); + const [response] = await client.getIamPolicy(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes getIamPolicy without error using callback', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.iam.v1.Policy() + ); + client.innerApiCalls.getIamPolicy = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.getIamPolicy( + request, + ( + err?: Error | null, + result?: protos.google.iam.v1.IPolicy | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes getIamPolicy with error', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getIamPolicy = stubSimpleCall( + undefined, + expectedError + ); + assert.rejects(async () => { + await client.getIamPolicy(request); + }, expectedError); + assert( + (client.innerApiCalls.getIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('getNotificationConfig', () => { + it('invokes getNotificationConfig without error', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.GetNotificationConfigRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.NotificationConfig() + ); + client.innerApiCalls.getNotificationConfig = stubSimpleCall( + expectedResponse + ); + const [response] = await client.getNotificationConfig(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getNotificationConfig as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes getNotificationConfig without error using callback', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.GetNotificationConfigRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.NotificationConfig() + ); + client.innerApiCalls.getNotificationConfig = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.getNotificationConfig( + request, + ( + err?: Error | null, + result?: protos.google.cloud.securitycenter.v1p1beta1.INotificationConfig | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getNotificationConfig as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes getNotificationConfig with error', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.GetNotificationConfigRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getNotificationConfig = stubSimpleCall( + undefined, + expectedError + ); + assert.rejects(async () => { + await client.getNotificationConfig(request); + }, expectedError); + assert( + (client.innerApiCalls.getNotificationConfig as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('getOrganizationSettings', () => { + it('invokes getOrganizationSettings without error', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.GetOrganizationSettingsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.OrganizationSettings() + ); + client.innerApiCalls.getOrganizationSettings = stubSimpleCall( + expectedResponse + ); + const [response] = await client.getOrganizationSettings(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getOrganizationSettings as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes getOrganizationSettings without error using callback', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.GetOrganizationSettingsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.OrganizationSettings() + ); + client.innerApiCalls.getOrganizationSettings = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.getOrganizationSettings( + request, + ( + err?: Error | null, + result?: protos.google.cloud.securitycenter.v1p1beta1.IOrganizationSettings | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getOrganizationSettings as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes getOrganizationSettings with error', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.GetOrganizationSettingsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getOrganizationSettings = stubSimpleCall( + undefined, + expectedError + ); + assert.rejects(async () => { + await client.getOrganizationSettings(request); + }, expectedError); + assert( + (client.innerApiCalls.getOrganizationSettings as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('getSource', () => { + it('invokes getSource without error', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.GetSourceRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.Source() + ); + client.innerApiCalls.getSource = stubSimpleCall(expectedResponse); + const [response] = await client.getSource(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getSource as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes getSource without error using callback', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.GetSourceRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.Source() + ); + client.innerApiCalls.getSource = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.getSource( + request, + ( + err?: Error | null, + result?: protos.google.cloud.securitycenter.v1p1beta1.ISource | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getSource as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes getSource with error', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.GetSourceRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getSource = stubSimpleCall(undefined, expectedError); + assert.rejects(async () => { + await client.getSource(request); + }, expectedError); + assert( + (client.innerApiCalls.getSource as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('setFindingState', () => { + it('invokes setFindingState without error', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.Finding() + ); + client.innerApiCalls.setFindingState = stubSimpleCall(expectedResponse); + const [response] = await client.setFindingState(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.setFindingState as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes setFindingState without error using callback', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.Finding() + ); + client.innerApiCalls.setFindingState = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.setFindingState( + request, + ( + err?: Error | null, + result?: protos.google.cloud.securitycenter.v1p1beta1.IFinding | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.setFindingState as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes setFindingState with error', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.setFindingState = stubSimpleCall( + undefined, + expectedError + ); + assert.rejects(async () => { + await client.setFindingState(request); + }, expectedError); + assert( + (client.innerApiCalls.setFindingState as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('setIamPolicy', () => { + it('invokes setIamPolicy without error', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.iam.v1.Policy() + ); + client.innerApiCalls.setIamPolicy = stubSimpleCall(expectedResponse); + const [response] = await client.setIamPolicy(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.setIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes setIamPolicy without error using callback', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.iam.v1.Policy() + ); + client.innerApiCalls.setIamPolicy = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.setIamPolicy( + request, + ( + err?: Error | null, + result?: protos.google.iam.v1.IPolicy | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.setIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes setIamPolicy with error', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.setIamPolicy = stubSimpleCall( + undefined, + expectedError + ); + assert.rejects(async () => { + await client.setIamPolicy(request); + }, expectedError); + assert( + (client.innerApiCalls.setIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('testIamPermissions', () => { + it('invokes testIamPermissions without error', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.iam.v1.TestIamPermissionsResponse() + ); + client.innerApiCalls.testIamPermissions = stubSimpleCall( + expectedResponse + ); + const [response] = await client.testIamPermissions(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.testIamPermissions as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes testIamPermissions without error using callback', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.iam.v1.TestIamPermissionsResponse() + ); + client.innerApiCalls.testIamPermissions = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.testIamPermissions( + request, + ( + err?: Error | null, + result?: protos.google.iam.v1.ITestIamPermissionsResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.testIamPermissions as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes testIamPermissions with error', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.testIamPermissions = stubSimpleCall( + undefined, + expectedError + ); + assert.rejects(async () => { + await client.testIamPermissions(request); + }, expectedError); + assert( + (client.innerApiCalls.testIamPermissions as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('updateFinding', () => { + it('invokes updateFinding without error', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.UpdateFindingRequest() + ); + request.finding = {}; + request.finding.name = ''; + const expectedHeaderRequestParams = 'finding.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.Finding() + ); + client.innerApiCalls.updateFinding = stubSimpleCall(expectedResponse); + const [response] = await client.updateFinding(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.updateFinding as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes updateFinding without error using callback', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.UpdateFindingRequest() + ); + request.finding = {}; + request.finding.name = ''; + const expectedHeaderRequestParams = 'finding.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.Finding() + ); + client.innerApiCalls.updateFinding = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.updateFinding( + request, + ( + err?: Error | null, + result?: protos.google.cloud.securitycenter.v1p1beta1.IFinding | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.updateFinding as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes updateFinding with error', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.UpdateFindingRequest() + ); + request.finding = {}; + request.finding.name = ''; + const expectedHeaderRequestParams = 'finding.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.updateFinding = stubSimpleCall( + undefined, + expectedError + ); + assert.rejects(async () => { + await client.updateFinding(request); + }, expectedError); + assert( + (client.innerApiCalls.updateFinding as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('updateNotificationConfig', () => { + it('invokes updateNotificationConfig without error', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest() + ); + request.notificationConfig = {}; + request.notificationConfig.name = ''; + const expectedHeaderRequestParams = 'notification_config.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.NotificationConfig() + ); + client.innerApiCalls.updateNotificationConfig = stubSimpleCall( + expectedResponse + ); + const [response] = await client.updateNotificationConfig(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.updateNotificationConfig as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes updateNotificationConfig without error using callback', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest() + ); + request.notificationConfig = {}; + request.notificationConfig.name = ''; + const expectedHeaderRequestParams = 'notification_config.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.NotificationConfig() + ); + client.innerApiCalls.updateNotificationConfig = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.updateNotificationConfig( + request, + ( + err?: Error | null, + result?: protos.google.cloud.securitycenter.v1p1beta1.INotificationConfig | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.updateNotificationConfig as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes updateNotificationConfig with error', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest() + ); + request.notificationConfig = {}; + request.notificationConfig.name = ''; + const expectedHeaderRequestParams = 'notification_config.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.updateNotificationConfig = stubSimpleCall( + undefined, + expectedError + ); + assert.rejects(async () => { + await client.updateNotificationConfig(request); + }, expectedError); + assert( + (client.innerApiCalls.updateNotificationConfig as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('updateOrganizationSettings', () => { + it('invokes updateOrganizationSettings without error', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest() + ); + request.organizationSettings = {}; + request.organizationSettings.name = ''; + const expectedHeaderRequestParams = 'organization_settings.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.OrganizationSettings() + ); + client.innerApiCalls.updateOrganizationSettings = stubSimpleCall( + expectedResponse + ); + const [response] = await client.updateOrganizationSettings(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.updateOrganizationSettings as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes updateOrganizationSettings without error using callback', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest() + ); + request.organizationSettings = {}; + request.organizationSettings.name = ''; + const expectedHeaderRequestParams = 'organization_settings.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.OrganizationSettings() + ); + client.innerApiCalls.updateOrganizationSettings = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.updateOrganizationSettings( + request, + ( + err?: Error | null, + result?: protos.google.cloud.securitycenter.v1p1beta1.IOrganizationSettings | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.updateOrganizationSettings as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes updateOrganizationSettings with error', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest() + ); + request.organizationSettings = {}; + request.organizationSettings.name = ''; + const expectedHeaderRequestParams = 'organization_settings.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.updateOrganizationSettings = stubSimpleCall( + undefined, + expectedError + ); + assert.rejects(async () => { + await client.updateOrganizationSettings(request); + }, expectedError); + assert( + (client.innerApiCalls.updateOrganizationSettings as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('updateSource', () => { + it('invokes updateSource without error', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.UpdateSourceRequest() + ); + request.source = {}; + request.source.name = ''; + const expectedHeaderRequestParams = 'source.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.Source() + ); + client.innerApiCalls.updateSource = stubSimpleCall(expectedResponse); + const [response] = await client.updateSource(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.updateSource as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes updateSource without error using callback', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.UpdateSourceRequest() + ); + request.source = {}; + request.source.name = ''; + const expectedHeaderRequestParams = 'source.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.Source() + ); + client.innerApiCalls.updateSource = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.updateSource( + request, + ( + err?: Error | null, + result?: protos.google.cloud.securitycenter.v1p1beta1.ISource | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.updateSource as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes updateSource with error', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.UpdateSourceRequest() + ); + request.source = {}; + request.source.name = ''; + const expectedHeaderRequestParams = 'source.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.updateSource = stubSimpleCall( + undefined, + expectedError + ); + assert.rejects(async () => { + await client.updateSource(request); + }, expectedError); + assert( + (client.innerApiCalls.updateSource as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('updateSecurityMarks', () => { + it('invokes updateSecurityMarks without error', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest() + ); + request.securityMarks = {}; + request.securityMarks.name = ''; + const expectedHeaderRequestParams = 'security_marks.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.SecurityMarks() + ); + client.innerApiCalls.updateSecurityMarks = stubSimpleCall( + expectedResponse + ); + const [response] = await client.updateSecurityMarks(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.updateSecurityMarks as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes updateSecurityMarks without error using callback', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest() + ); + request.securityMarks = {}; + request.securityMarks.name = ''; + const expectedHeaderRequestParams = 'security_marks.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.SecurityMarks() + ); + client.innerApiCalls.updateSecurityMarks = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.updateSecurityMarks( + request, + ( + err?: Error | null, + result?: protos.google.cloud.securitycenter.v1p1beta1.ISecurityMarks | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.updateSecurityMarks as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes updateSecurityMarks with error', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest() + ); + request.securityMarks = {}; + request.securityMarks.name = ''; + const expectedHeaderRequestParams = 'security_marks.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.updateSecurityMarks = stubSimpleCall( + undefined, + expectedError + ); + assert.rejects(async () => { + await client.updateSecurityMarks(request); + }, expectedError); + assert( + (client.innerApiCalls.updateSecurityMarks as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('runAssetDiscovery', () => { + it('invokes runAssetDiscovery without error', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.runAssetDiscovery = stubLongRunningCall( + expectedResponse + ); + const [operation] = await client.runAssetDiscovery(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.runAssetDiscovery as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes runAssetDiscovery without error using callback', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.runAssetDiscovery = stubLongRunningCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.runAssetDiscovery( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.securitycenter.v1p1beta1.IRunAssetDiscoveryResponse, + protos.google.protobuf.IEmpty + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.securitycenter.v1p1beta1.IRunAssetDiscoveryResponse, + protos.google.protobuf.IEmpty + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.runAssetDiscovery as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes runAssetDiscovery with call error', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.runAssetDiscovery = stubLongRunningCall( + undefined, + expectedError + ); + assert.rejects(async () => { + await client.runAssetDiscovery(request); + }, expectedError); + assert( + (client.innerApiCalls.runAssetDiscovery as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes runAssetDiscovery with LRO error', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.runAssetDiscovery = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.runAssetDiscovery(request); + assert.rejects(async () => { + await operation.promise(); + }, expectedError); + assert( + (client.innerApiCalls.runAssetDiscovery as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('groupAssets', () => { + it('invokes groupAssets without error', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.GroupResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.GroupResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.GroupResult() + ), + ]; + client.innerApiCalls.groupAssets = stubSimpleCall(expectedResponse); + const [response] = await client.groupAssets(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.groupAssets as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes groupAssets without error using callback', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.GroupResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.GroupResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.GroupResult() + ), + ]; + client.innerApiCalls.groupAssets = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.groupAssets( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.securitycenter.v1p1beta1.IGroupResult[] + | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.groupAssets as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes groupAssets with error', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.groupAssets = stubSimpleCall( + undefined, + expectedError + ); + assert.rejects(async () => { + await client.groupAssets(request); + }, expectedError); + assert( + (client.innerApiCalls.groupAssets as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes groupAssetsStream without error', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.GroupResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.GroupResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.GroupResult() + ), + ]; + client.descriptors.page.groupAssets.createStream = stubPageStreamingCall( + expectedResponse + ); + const stream = client.groupAssetsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.securitycenter.v1p1beta1.GroupResult[] = []; + stream.on( + 'data', + ( + response: protos.google.cloud.securitycenter.v1p1beta1.GroupResult + ) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert( + (client.descriptors.page.groupAssets.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.groupAssets, request) + ); + assert.strictEqual( + (client.descriptors.page.groupAssets.createStream as SinonStub).getCall( + 0 + ).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes groupAssetsStream with error', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('expected'); + client.descriptors.page.groupAssets.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.groupAssetsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.securitycenter.v1p1beta1.GroupResult[] = []; + stream.on( + 'data', + ( + response: protos.google.cloud.securitycenter.v1p1beta1.GroupResult + ) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + assert.rejects(async () => { + await promise; + }, expectedError); + assert( + (client.descriptors.page.groupAssets.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.groupAssets, request) + ); + assert.strictEqual( + (client.descriptors.page.groupAssets.createStream as SinonStub).getCall( + 0 + ).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with groupAssets without error', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.GroupResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.GroupResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.GroupResult() + ), + ]; + client.descriptors.page.groupAssets.asyncIterate = stubAsyncIterationCall( + expectedResponse + ); + const responses: protos.google.cloud.securitycenter.v1p1beta1.IGroupResult[] = []; + const iterable = client.groupAssetsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.groupAssets.asyncIterate as SinonStub).getCall( + 0 + ).args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.groupAssets.asyncIterate as SinonStub).getCall( + 0 + ).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with groupAssets with error', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('expected'); + client.descriptors.page.groupAssets.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.groupAssetsAsync(request); + assert.rejects(async () => { + const responses: protos.google.cloud.securitycenter.v1p1beta1.IGroupResult[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.groupAssets.asyncIterate as SinonStub).getCall( + 0 + ).args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.groupAssets.asyncIterate as SinonStub).getCall( + 0 + ).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('groupFindings', () => { + it('invokes groupFindings without error', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.GroupResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.GroupResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.GroupResult() + ), + ]; + client.innerApiCalls.groupFindings = stubSimpleCall(expectedResponse); + const [response] = await client.groupFindings(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.groupFindings as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes groupFindings without error using callback', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.GroupResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.GroupResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.GroupResult() + ), + ]; + client.innerApiCalls.groupFindings = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.groupFindings( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.securitycenter.v1p1beta1.IGroupResult[] + | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.groupFindings as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes groupFindings with error', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.groupFindings = stubSimpleCall( + undefined, + expectedError + ); + assert.rejects(async () => { + await client.groupFindings(request); + }, expectedError); + assert( + (client.innerApiCalls.groupFindings as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes groupFindingsStream without error', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.GroupResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.GroupResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.GroupResult() + ), + ]; + client.descriptors.page.groupFindings.createStream = stubPageStreamingCall( + expectedResponse + ); + const stream = client.groupFindingsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.securitycenter.v1p1beta1.GroupResult[] = []; + stream.on( + 'data', + ( + response: protos.google.cloud.securitycenter.v1p1beta1.GroupResult + ) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert( + (client.descriptors.page.groupFindings.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.groupFindings, request) + ); + assert.strictEqual( + (client.descriptors.page.groupFindings + .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + expectedHeaderRequestParams + ); + }); + + it('invokes groupFindingsStream with error', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('expected'); + client.descriptors.page.groupFindings.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.groupFindingsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.securitycenter.v1p1beta1.GroupResult[] = []; + stream.on( + 'data', + ( + response: protos.google.cloud.securitycenter.v1p1beta1.GroupResult + ) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + assert.rejects(async () => { + await promise; + }, expectedError); + assert( + (client.descriptors.page.groupFindings.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.groupFindings, request) + ); + assert.strictEqual( + (client.descriptors.page.groupFindings + .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with groupFindings without error', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.GroupResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.GroupResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.GroupResult() + ), + ]; + client.descriptors.page.groupFindings.asyncIterate = stubAsyncIterationCall( + expectedResponse + ); + const responses: protos.google.cloud.securitycenter.v1p1beta1.IGroupResult[] = []; + const iterable = client.groupFindingsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.groupFindings + .asyncIterate as SinonStub).getCall(0).args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.groupFindings + .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with groupFindings with error', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('expected'); + client.descriptors.page.groupFindings.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.groupFindingsAsync(request); + assert.rejects(async () => { + const responses: protos.google.cloud.securitycenter.v1p1beta1.IGroupResult[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.groupFindings + .asyncIterate as SinonStub).getCall(0).args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.groupFindings + .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + expectedHeaderRequestParams + ); + }); + }); + + describe('listAssets', () => { + it('invokes listAssets without error', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.ListAssetsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult() + ), + ]; + client.innerApiCalls.listAssets = stubSimpleCall(expectedResponse); + const [response] = await client.listAssets(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listAssets as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listAssets without error using callback', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.ListAssetsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult() + ), + ]; + client.innerApiCalls.listAssets = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.listAssets( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.IListAssetsResult[] + | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listAssets as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes listAssets with error', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.ListAssetsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listAssets = stubSimpleCall( + undefined, + expectedError + ); + assert.rejects(async () => { + await client.listAssets(request); + }, expectedError); + assert( + (client.innerApiCalls.listAssets as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listAssetsStream without error', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.ListAssetsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult() + ), + ]; + client.descriptors.page.listAssets.createStream = stubPageStreamingCall( + expectedResponse + ); + const stream = client.listAssetsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult[] = []; + stream.on( + 'data', + ( + response: protos.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult + ) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert( + (client.descriptors.page.listAssets.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listAssets, request) + ); + assert.strictEqual( + (client.descriptors.page.listAssets.createStream as SinonStub).getCall( + 0 + ).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listAssetsStream with error', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.ListAssetsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('expected'); + client.descriptors.page.listAssets.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listAssetsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult[] = []; + stream.on( + 'data', + ( + response: protos.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult + ) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + assert.rejects(async () => { + await promise; + }, expectedError); + assert( + (client.descriptors.page.listAssets.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listAssets, request) + ); + assert.strictEqual( + (client.descriptors.page.listAssets.createStream as SinonStub).getCall( + 0 + ).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listAssets without error', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.ListAssetsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult() + ), + ]; + client.descriptors.page.listAssets.asyncIterate = stubAsyncIterationCall( + expectedResponse + ); + const responses: protos.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.IListAssetsResult[] = []; + const iterable = client.listAssetsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listAssets.asyncIterate as SinonStub).getCall( + 0 + ).args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.listAssets.asyncIterate as SinonStub).getCall( + 0 + ).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listAssets with error', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.ListAssetsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('expected'); + client.descriptors.page.listAssets.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listAssetsAsync(request); + assert.rejects(async () => { + const responses: protos.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.IListAssetsResult[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listAssets.asyncIterate as SinonStub).getCall( + 0 + ).args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.listAssets.asyncIterate as SinonStub).getCall( + 0 + ).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('listFindings', () => { + it('invokes listFindings without error', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.ListFindingsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult() + ), + ]; + client.innerApiCalls.listFindings = stubSimpleCall(expectedResponse); + const [response] = await client.listFindings(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listFindings as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listFindings without error using callback', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.ListFindingsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult() + ), + ]; + client.innerApiCalls.listFindings = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.listFindings( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.IListFindingsResult[] + | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listFindings as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes listFindings with error', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.ListFindingsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listFindings = stubSimpleCall( + undefined, + expectedError + ); + assert.rejects(async () => { + await client.listFindings(request); + }, expectedError); + assert( + (client.innerApiCalls.listFindings as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listFindingsStream without error', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.ListFindingsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult() + ), + ]; + client.descriptors.page.listFindings.createStream = stubPageStreamingCall( + expectedResponse + ); + const stream = client.listFindingsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult[] = []; + stream.on( + 'data', + ( + response: protos.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult + ) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert( + (client.descriptors.page.listFindings.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listFindings, request) + ); + assert.strictEqual( + (client.descriptors.page.listFindings + .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + expectedHeaderRequestParams + ); + }); + + it('invokes listFindingsStream with error', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.ListFindingsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('expected'); + client.descriptors.page.listFindings.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listFindingsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult[] = []; + stream.on( + 'data', + ( + response: protos.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult + ) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + assert.rejects(async () => { + await promise; + }, expectedError); + assert( + (client.descriptors.page.listFindings.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listFindings, request) + ); + assert.strictEqual( + (client.descriptors.page.listFindings + .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listFindings without error', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.ListFindingsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult() + ), + ]; + client.descriptors.page.listFindings.asyncIterate = stubAsyncIterationCall( + expectedResponse + ); + const responses: protos.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.IListFindingsResult[] = []; + const iterable = client.listFindingsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listFindings + .asyncIterate as SinonStub).getCall(0).args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.listFindings + .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listFindings with error', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.ListFindingsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('expected'); + client.descriptors.page.listFindings.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listFindingsAsync(request); + assert.rejects(async () => { + const responses: protos.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.IListFindingsResult[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listFindings + .asyncIterate as SinonStub).getCall(0).args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.listFindings + .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + expectedHeaderRequestParams + ); + }); + }); + + describe('listNotificationConfigs', () => { + it('invokes listNotificationConfigs without error', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.NotificationConfig() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.NotificationConfig() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.NotificationConfig() + ), + ]; + client.innerApiCalls.listNotificationConfigs = stubSimpleCall( + expectedResponse + ); + const [response] = await client.listNotificationConfigs(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listNotificationConfigs as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listNotificationConfigs without error using callback', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.NotificationConfig() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.NotificationConfig() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.NotificationConfig() + ), + ]; + client.innerApiCalls.listNotificationConfigs = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.listNotificationConfigs( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.securitycenter.v1p1beta1.INotificationConfig[] + | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listNotificationConfigs as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes listNotificationConfigs with error', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listNotificationConfigs = stubSimpleCall( + undefined, + expectedError + ); + assert.rejects(async () => { + await client.listNotificationConfigs(request); + }, expectedError); + assert( + (client.innerApiCalls.listNotificationConfigs as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listNotificationConfigsStream without error', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.NotificationConfig() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.NotificationConfig() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.NotificationConfig() + ), + ]; + client.descriptors.page.listNotificationConfigs.createStream = stubPageStreamingCall( + expectedResponse + ); + const stream = client.listNotificationConfigsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.securitycenter.v1p1beta1.NotificationConfig[] = []; + stream.on( + 'data', + ( + response: protos.google.cloud.securitycenter.v1p1beta1.NotificationConfig + ) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert( + (client.descriptors.page.listNotificationConfigs + .createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listNotificationConfigs, request) + ); + assert.strictEqual( + (client.descriptors.page.listNotificationConfigs + .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + expectedHeaderRequestParams + ); + }); + + it('invokes listNotificationConfigsStream with error', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('expected'); + client.descriptors.page.listNotificationConfigs.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listNotificationConfigsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.securitycenter.v1p1beta1.NotificationConfig[] = []; + stream.on( + 'data', + ( + response: protos.google.cloud.securitycenter.v1p1beta1.NotificationConfig + ) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + assert.rejects(async () => { + await promise; + }, expectedError); + assert( + (client.descriptors.page.listNotificationConfigs + .createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listNotificationConfigs, request) + ); + assert.strictEqual( + (client.descriptors.page.listNotificationConfigs + .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listNotificationConfigs without error', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.NotificationConfig() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.NotificationConfig() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.NotificationConfig() + ), + ]; + client.descriptors.page.listNotificationConfigs.asyncIterate = stubAsyncIterationCall( + expectedResponse + ); + const responses: protos.google.cloud.securitycenter.v1p1beta1.INotificationConfig[] = []; + const iterable = client.listNotificationConfigsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listNotificationConfigs + .asyncIterate as SinonStub).getCall(0).args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.listNotificationConfigs + .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listNotificationConfigs with error', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('expected'); + client.descriptors.page.listNotificationConfigs.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listNotificationConfigsAsync(request); + assert.rejects(async () => { + const responses: protos.google.cloud.securitycenter.v1p1beta1.INotificationConfig[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listNotificationConfigs + .asyncIterate as SinonStub).getCall(0).args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.listNotificationConfigs + .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + expectedHeaderRequestParams + ); + }); + }); + + describe('listSources', () => { + it('invokes listSources without error', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.ListSourcesRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.Source() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.Source() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.Source() + ), + ]; + client.innerApiCalls.listSources = stubSimpleCall(expectedResponse); + const [response] = await client.listSources(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listSources as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listSources without error using callback', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.ListSourcesRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.Source() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.Source() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.Source() + ), + ]; + client.innerApiCalls.listSources = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.listSources( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.securitycenter.v1p1beta1.ISource[] + | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listSources as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes listSources with error', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.ListSourcesRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listSources = stubSimpleCall( + undefined, + expectedError + ); + assert.rejects(async () => { + await client.listSources(request); + }, expectedError); + assert( + (client.innerApiCalls.listSources as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listSourcesStream without error', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.ListSourcesRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.Source() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.Source() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.Source() + ), + ]; + client.descriptors.page.listSources.createStream = stubPageStreamingCall( + expectedResponse + ); + const stream = client.listSourcesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.securitycenter.v1p1beta1.Source[] = []; + stream.on( + 'data', + (response: protos.google.cloud.securitycenter.v1p1beta1.Source) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert( + (client.descriptors.page.listSources.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listSources, request) + ); + assert.strictEqual( + (client.descriptors.page.listSources.createStream as SinonStub).getCall( + 0 + ).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listSourcesStream with error', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.ListSourcesRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('expected'); + client.descriptors.page.listSources.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listSourcesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.securitycenter.v1p1beta1.Source[] = []; + stream.on( + 'data', + (response: protos.google.cloud.securitycenter.v1p1beta1.Source) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + assert.rejects(async () => { + await promise; + }, expectedError); + assert( + (client.descriptors.page.listSources.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listSources, request) + ); + assert.strictEqual( + (client.descriptors.page.listSources.createStream as SinonStub).getCall( + 0 + ).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listSources without error', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.ListSourcesRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.Source() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.Source() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.Source() + ), + ]; + client.descriptors.page.listSources.asyncIterate = stubAsyncIterationCall( + expectedResponse + ); + const responses: protos.google.cloud.securitycenter.v1p1beta1.ISource[] = []; + const iterable = client.listSourcesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listSources.asyncIterate as SinonStub).getCall( + 0 + ).args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.listSources.asyncIterate as SinonStub).getCall( + 0 + ).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listSources with error', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.ListSourcesRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('expected'); + client.descriptors.page.listSources.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listSourcesAsync(request); + assert.rejects(async () => { + const responses: protos.google.cloud.securitycenter.v1p1beta1.ISource[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listSources.asyncIterate as SinonStub).getCall( + 0 + ).args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.listSources.asyncIterate as SinonStub).getCall( + 0 + ).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('Path templates', () => { + describe('asset', () => { + const fakePath = '/rendered/path/asset'; + const expectedParameters = { + organization: 'organizationValue', + asset: 'assetValue', + }; + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.assetPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.assetPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('assetPath', () => { + const result = client.assetPath('organizationValue', 'assetValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.assetPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchOrganizationFromAssetName', () => { + const result = client.matchOrganizationFromAssetName(fakePath); + assert.strictEqual(result, 'organizationValue'); + assert( + (client.pathTemplates.assetPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchAssetFromAssetName', () => { + const result = client.matchAssetFromAssetName(fakePath); + assert.strictEqual(result, 'assetValue'); + assert( + (client.pathTemplates.assetPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('finding', () => { + const fakePath = '/rendered/path/finding'; + const expectedParameters = { + organization: 'organizationValue', + source: 'sourceValue', + finding: 'findingValue', + }; + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.findingPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.findingPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('findingPath', () => { + const result = client.findingPath( + 'organizationValue', + 'sourceValue', + 'findingValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.findingPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchOrganizationFromFindingName', () => { + const result = client.matchOrganizationFromFindingName(fakePath); + assert.strictEqual(result, 'organizationValue'); + assert( + (client.pathTemplates.findingPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSourceFromFindingName', () => { + const result = client.matchSourceFromFindingName(fakePath); + assert.strictEqual(result, 'sourceValue'); + assert( + (client.pathTemplates.findingPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchFindingFromFindingName', () => { + const result = client.matchFindingFromFindingName(fakePath); + assert.strictEqual(result, 'findingValue'); + assert( + (client.pathTemplates.findingPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('notificationConfig', () => { + const fakePath = '/rendered/path/notificationConfig'; + const expectedParameters = { + organization: 'organizationValue', + notification_config: 'notificationConfigValue', + }; + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.notificationConfigPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.notificationConfigPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('notificationConfigPath', () => { + const result = client.notificationConfigPath( + 'organizationValue', + 'notificationConfigValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.notificationConfigPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchOrganizationFromNotificationConfigName', () => { + const result = client.matchOrganizationFromNotificationConfigName( + fakePath + ); + assert.strictEqual(result, 'organizationValue'); + assert( + (client.pathTemplates.notificationConfigPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchNotificationConfigFromNotificationConfigName', () => { + const result = client.matchNotificationConfigFromNotificationConfigName( + fakePath + ); + assert.strictEqual(result, 'notificationConfigValue'); + assert( + (client.pathTemplates.notificationConfigPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('organization', () => { + const fakePath = '/rendered/path/organization'; + const expectedParameters = { + organization: 'organizationValue', + }; + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.organizationPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.organizationPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('organizationPath', () => { + const result = client.organizationPath('organizationValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.organizationPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchOrganizationFromOrganizationName', () => { + const result = client.matchOrganizationFromOrganizationName(fakePath); + assert.strictEqual(result, 'organizationValue'); + assert( + (client.pathTemplates.organizationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('organizationAssetSecurityMarks', () => { + const fakePath = '/rendered/path/organizationAssetSecurityMarks'; + const expectedParameters = { + organization: 'organizationValue', + asset: 'assetValue', + }; + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.organizationAssetSecurityMarksPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.organizationAssetSecurityMarksPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('organizationAssetSecurityMarksPath', () => { + const result = client.organizationAssetSecurityMarksPath( + 'organizationValue', + 'assetValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.organizationAssetSecurityMarksPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchOrganizationFromOrganizationAssetSecurityMarksName', () => { + const result = client.matchOrganizationFromOrganizationAssetSecurityMarksName( + fakePath + ); + assert.strictEqual(result, 'organizationValue'); + assert( + (client.pathTemplates.organizationAssetSecurityMarksPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchAssetFromOrganizationAssetSecurityMarksName', () => { + const result = client.matchAssetFromOrganizationAssetSecurityMarksName( + fakePath + ); + assert.strictEqual(result, 'assetValue'); + assert( + (client.pathTemplates.organizationAssetSecurityMarksPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('organizationSettings', () => { + const fakePath = '/rendered/path/organizationSettings'; + const expectedParameters = { + organization: 'organizationValue', + }; + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.organizationSettingsPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.organizationSettingsPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('organizationSettingsPath', () => { + const result = client.organizationSettingsPath('organizationValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.organizationSettingsPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchOrganizationFromOrganizationSettingsName', () => { + const result = client.matchOrganizationFromOrganizationSettingsName( + fakePath + ); + assert.strictEqual(result, 'organizationValue'); + assert( + (client.pathTemplates.organizationSettingsPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('organizationSourceFindingSecurityMarks', () => { + const fakePath = '/rendered/path/organizationSourceFindingSecurityMarks'; + const expectedParameters = { + organization: 'organizationValue', + source: 'sourceValue', + finding: 'findingValue', + }; + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.organizationSourceFindingSecurityMarksPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.organizationSourceFindingSecurityMarksPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('organizationSourceFindingSecurityMarksPath', () => { + const result = client.organizationSourceFindingSecurityMarksPath( + 'organizationValue', + 'sourceValue', + 'findingValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates + .organizationSourceFindingSecurityMarksPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchOrganizationFromOrganizationSourceFindingSecurityMarksName', () => { + const result = client.matchOrganizationFromOrganizationSourceFindingSecurityMarksName( + fakePath + ); + assert.strictEqual(result, 'organizationValue'); + assert( + (client.pathTemplates + .organizationSourceFindingSecurityMarksPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSourceFromOrganizationSourceFindingSecurityMarksName', () => { + const result = client.matchSourceFromOrganizationSourceFindingSecurityMarksName( + fakePath + ); + assert.strictEqual(result, 'sourceValue'); + assert( + (client.pathTemplates + .organizationSourceFindingSecurityMarksPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchFindingFromOrganizationSourceFindingSecurityMarksName', () => { + const result = client.matchFindingFromOrganizationSourceFindingSecurityMarksName( + fakePath + ); + assert.strictEqual(result, 'findingValue'); + assert( + (client.pathTemplates + .organizationSourceFindingSecurityMarksPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('source', () => { + const fakePath = '/rendered/path/source'; + const expectedParameters = { + organization: 'organizationValue', + source: 'sourceValue', + }; + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.sourcePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.sourcePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('sourcePath', () => { + const result = client.sourcePath('organizationValue', 'sourceValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.sourcePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchOrganizationFromSourceName', () => { + const result = client.matchOrganizationFromSourceName(fakePath); + assert.strictEqual(result, 'organizationValue'); + assert( + (client.pathTemplates.sourcePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSourceFromSourceName', () => { + const result = client.matchSourceFromSourceName(fakePath); + assert.strictEqual(result, 'sourceValue'); + assert( + (client.pathTemplates.sourcePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + }); +}); From 9f72bed2c14309eca9ecb9223b4a927f00f949db Mon Sep 17 00:00:00 2001 From: "Benjamin E. Coe" Date: Tue, 31 Mar 2020 18:39:31 -0700 Subject: [PATCH 158/342] build: set AUTOSYNTH_MULTIPLE_COMMITS=true for context aware commits (#250) --- packages/google-cloud-securitycenter/synth.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/google-cloud-securitycenter/synth.py b/packages/google-cloud-securitycenter/synth.py index 46260b1afc4..cc29c3de6af 100644 --- a/packages/google-cloud-securitycenter/synth.py +++ b/packages/google-cloud-securitycenter/synth.py @@ -19,6 +19,9 @@ logging.basicConfig(level=logging.DEBUG) +AUTOSYNTH_MULTIPLE_COMMITS = True + + # Run the gapic generator gapic = gcp.GAPICMicrogenerator() versions = ['v1beta1', 'v1', 'v1p1beta1'] From 151f7309ae39479006ef89e1b710a1c9ac3785dc Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 1 Apr 2020 23:38:22 +0200 Subject: [PATCH 159/342] chore(deps): update dependency @types/sinon to v9 (#251) This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [@types/sinon](https://togithub.com/DefinitelyTyped/DefinitelyTyped) | devDependencies | major | [`^7.5.2` -> `^9.0.0`](https://renovatebot.com/diffs/npm/@types%2fsinon/7.5.2/9.0.0) | --- ### Renovate configuration :date: **Schedule**: "after 9am and before 3pm" (UTC). :vertical_traffic_light: **Automerge**: Disabled by config. Please merge this manually once you are satisfied. :recycle: **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. :no_bell: **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#googleapis/nodejs-security-center). --- packages/google-cloud-securitycenter/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-securitycenter/package.json b/packages/google-cloud-securitycenter/package.json index b614cf33388..acf94aedeac 100644 --- a/packages/google-cloud-securitycenter/package.json +++ b/packages/google-cloud-securitycenter/package.json @@ -46,7 +46,7 @@ "devDependencies": { "@types/mocha": "^7.0.0", "@types/node": "^12.0.0", - "@types/sinon": "^7.5.2", + "@types/sinon": "^9.0.0", "c8": "^7.0.0", "eslint": "^6.0.0", "eslint-config-prettier": "^6.0.0", From e4f080b9bd19bd1116cf0e8304e917b11cf284e0 Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Sun, 5 Apr 2020 12:50:27 -0700 Subject: [PATCH 160/342] chore: remove duplicate mocha config (#254) --- packages/google-cloud-securitycenter/.mocharc.json | 5 ----- 1 file changed, 5 deletions(-) delete mode 100644 packages/google-cloud-securitycenter/.mocharc.json diff --git a/packages/google-cloud-securitycenter/.mocharc.json b/packages/google-cloud-securitycenter/.mocharc.json deleted file mode 100644 index 670c5e2c24b..00000000000 --- a/packages/google-cloud-securitycenter/.mocharc.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "enable-source-maps": true, - "throw-deprecation": true, - "timeout": 10000 -} From 3a08962c0a396bfa9808812c5f78174921370e2f Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Tue, 7 Apr 2020 00:10:24 -0700 Subject: [PATCH 161/342] fix: export explicit version from protos.js (#253) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/1630485f-7526-4afd-9c13-b5660664d6a2/targets --- .../protos/protos.js | 2 +- .../synth.metadata | 19 ++++++++++++++++++- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-securitycenter/protos/protos.js b/packages/google-cloud-securitycenter/protos/protos.js index 37be0296743..36bde737273 100644 --- a/packages/google-cloud-securitycenter/protos/protos.js +++ b/packages/google-cloud-securitycenter/protos/protos.js @@ -28,7 +28,7 @@ var $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util; // Exported root namespace - var $root = $protobuf.roots["default"] || ($protobuf.roots["default"] = {}); + var $root = $protobuf.roots._google_cloud_security_center_3_1_0_protos || ($protobuf.roots._google_cloud_security_center_3_1_0_protos = {}); $root.google = (function() { diff --git a/packages/google-cloud-securitycenter/synth.metadata b/packages/google-cloud-securitycenter/synth.metadata index 5555c2cf17b..49bda63c82e 100644 --- a/packages/google-cloud-securitycenter/synth.metadata +++ b/packages/google-cloud-securitycenter/synth.metadata @@ -1,5 +1,22 @@ { - "updateTime": "2020-03-31T20:05:15.683979Z", + "updateTime": "2020-04-03T12:08:21.889817Z", + "sources": [ + { + "git": { + "name": "googleapis", + "remote": "https://github.com/googleapis/googleapis.git", + "sha": "3d5d228a58bdf875e6147b228db3159010c735ee", + "internalRef": "304500143" + } + }, + { + "git": { + "name": "synthtool", + "remote": "https://github.com/googleapis/synthtool.git", + "sha": "99820243d348191bc9c634f2b48ddf65096285ed" + } + } + ], "destinations": [ { "client": { From 1dee07a627006bee7174db66e9648d3a8d1eac29 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Thu, 9 Apr 2020 09:37:30 -0700 Subject: [PATCH 162/342] test: await assert.rejects --- .../google-cloud-securitycenter/.jsdoc.js | 2 +- .../.prettierrc.js | 2 +- .../securitycenter/v1p1beta1/asset.proto | 2 +- .../synth.metadata | 17 +++-- .../test/gapic_security_center_v1.ts | 72 +++++++++---------- .../test/gapic_security_center_v1beta1.ts | 58 +++++++-------- .../test/gapic_security_center_v1p1beta1.ts | 72 +++++++++---------- 7 files changed, 117 insertions(+), 108 deletions(-) diff --git a/packages/google-cloud-securitycenter/.jsdoc.js b/packages/google-cloud-securitycenter/.jsdoc.js index f877c24c4a8..5bf29039c8f 100644 --- a/packages/google-cloud-securitycenter/.jsdoc.js +++ b/packages/google-cloud-securitycenter/.jsdoc.js @@ -40,7 +40,7 @@ module.exports = { includePattern: '\\.js$' }, templates: { - copyright: 'Copyright 2019 Google, LLC.', + copyright: 'Copyright 2020 Google LLC', includeDate: false, sourceFiles: false, systemName: '@google-cloud/security-center', diff --git a/packages/google-cloud-securitycenter/.prettierrc.js b/packages/google-cloud-securitycenter/.prettierrc.js index 08cba3775be..d1b95106f4c 100644 --- a/packages/google-cloud-securitycenter/.prettierrc.js +++ b/packages/google-cloud-securitycenter/.prettierrc.js @@ -4,7 +4,7 @@ // 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 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/asset.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/asset.proto index 3e4b26a8415..aaa18bcbaa9 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/asset.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/asset.proto @@ -82,7 +82,7 @@ message Asset { // resource and cannot be modified by the user. message IamPolicy { // The JSON representation of the Policy associated with the asset. - // See https://cloud.google.com/iam/reference/rest/v1p1beta1/Policy for + // See https://cloud.google.com/iam/reference/rest/v1/Policy for // format details. string policy_blob = 1; } diff --git a/packages/google-cloud-securitycenter/synth.metadata b/packages/google-cloud-securitycenter/synth.metadata index 49bda63c82e..52aefc87725 100644 --- a/packages/google-cloud-securitycenter/synth.metadata +++ b/packages/google-cloud-securitycenter/synth.metadata @@ -1,19 +1,28 @@ { - "updateTime": "2020-04-03T12:08:21.889817Z", + "updateTime": "2020-04-09T13:34:37.897426Z", "sources": [ + { + "git": { + "name": ".", + "remote": "https://github.com/googleapis/nodejs-security-center.git", + "sha": "aa6257554e5b401ba7b7613f0bf78d6233ef300b" + } + }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "3d5d228a58bdf875e6147b228db3159010c735ee", - "internalRef": "304500143" + "sha": "ee4ea76504aa60c2bff9b7c11269c155d8c21e0d", + "internalRef": "305619145", + "log": "ee4ea76504aa60c2bff9b7c11269c155d8c21e0d\ngapic-generator:\n- feat: Support extra plugin_args for php bazel rules rules (#3165)\n- feat: support '*' in resource definition (#3163)\n- fix: add null check and better error message when referenced resource is not found (#3169)\n\nresource name plugin:\n- support * annotation in resource def (#84)\n\nPiperOrigin-RevId: 305619145\n\ne4f4b23e07315492b533746e6a9255a1e6b3e748\nosconfig v1beta: fix the incorrect pattern for GuestPolicy resource and remove the obsolete history field.\n\nPiperOrigin-RevId: 305617619\n\nd741cd976975c745d0199987aff0e908b8352992\nchore: enable gapicv2 for firestore/v1 API\n\nNote that this contains breaking Java changes:\n com.google.cloud.firestore.v1.FirestoreClient: Method 'public void deleteDocument(com.google.firestore.v1.AnyPathName)' has been removed\n\nCommitter: @miraleung\nPiperOrigin-RevId: 305561906\n\n0d69cddaa23b556e7299f84ad55a02ec1cad55a9\nchore: enable gapicv2 for firestore/admin/v1 API\n\nCommitter: @miraleung\n\nThere are the following breaking changes due to the collection_id discrepancy between [1] and [2]\n\n1. https://github.com/googleapis/googleapis/blob/6f8350c0df231d7e742fa10dbf929f33047715c9/google/firestore/admin/v1/firestore_gapic.yaml#L24-L29\n2. https://github.com/googleapis/googleapis/blob/6f8350c0df231d7e742fa10dbf929f33047715c9/google/firestore/admin/v1/field.proto#L39\n```\ncom.google.firestore.admin.v1.FieldName: Method 'public java.lang.String getCollectionId()' has been removed\ncom.google.firestore.admin.v1.FieldName: Method 'public java.lang.String getFieldId()' has been removed\ncom.google.firestore.admin.v1.FieldName$Builder: Method 'public java.lang.String getCollectionId()' has been removed\ncom.google.firestore.admin.v1.FieldName$Builder: Method 'public java.lang.String getFieldId()' has been removed\ncom.google.firestore.admin.v1.FieldName$Builder: Method 'public com.google.firestore.admin.v1.FieldName$Builder setCollectionId(java.lang.String)' has been removed\ncom.google.firestore.admin.v1.FieldName$Builder: Method 'public com.google.firestore.admin.v1.FieldName$Builder setFieldId(java.lang.String)' has been removed\ncom.google.firestore.admin.v1.IndexName: Method 'public java.lang.String getCollectionId()' has been removed\ncom.google.firestore.admin.v1.IndexName: Method 'public java.lang.String getIndexId()' has been removed\ncom.google.firestore.admin.v1.IndexName$Builder: Method 'public java.lang.String getCollectionId()' has been removed\ncom.google.firestore.admin.v1.IndexName$Builder: Method 'public java.lang.String getIndexId()' has been removed\ncom.google.firestore.admin.v1.IndexName$Builder: Method 'public com.google.firestore.admin.v1.IndexName$Builder setCollectionId(java.lang.String)' has been removed\ncom.google.firestore.admin.v1.IndexName$Builder: Method 'public com.google.firestore.admin.v1.IndexName$Builder setIndexId(java.lang.String)' has been removed\n```\n\nPiperOrigin-RevId: 305561114\n\n6f8350c0df231d7e742fa10dbf929f33047715c9\nchore: enable gapicv2 for firestore/v1beta1 API\n\nCommitter: @miraleung\nPiperOrigin-RevId: 305537104\n\nd398d687aad9eab4c6ceee9cd5e012fa61f7e28c\ndocs: change relative URLs to absolute URLs to fix broken links.\n\nPiperOrigin-RevId: 305496764\n\n5520cb891a72ab0b0cbe3facaca7b012785f5b49\nchore: update gapic-generator to cd3c9ee7\n\nChanges include:\n* update generated nox file\n* fix generated license text alignment\n\nPiperOrigin-RevId: 305484038\n\nb20965f260d70e57b7dcd312cd356d6a81f31f8e\nUpdating retry configuration settings.\n\nPiperOrigin-RevId: 305431885\n\n83d7f20c06182cb6ada9a3b47daf17b2fd22b020\nMigrate dialogflow from gapic v1 to gapic v2.\nIncluding breaking changes (resource pattern change) introduced in cl/304043500.\n\ncommitter: @hzyi-google\nPiperOrigin-RevId: 305358314\n\nf8a97692250a6c781d87528995a5c72d41ca7762\nchore: enable gapic v2 and proto annotation for Grafeas API.\n\ncommitter: @noahdietz\nPiperOrigin-RevId: 305354660\n\nb1a5ca68468eb1587168972c9d15928e98ba92b0\nEnable gapicv2 for v1/osconfig\n\nCommitter: @miraleung\nPiperOrigin-RevId: 305351235\n\nc803327f9b1dd2583b070645b5b86e5e7ead3161\nEnable gapicv2 for osconfig/agentendpoint/v1beta\n\nCommitter: @miraleung\nPiperOrigin-RevId: 305350472\n\n99dddf1de598f95a71d3536f5c170d84f0c0ef87\nchore: enable gapicv2 for build/v1 API\n\nCommitter: @miraleung\nPiperOrigin-RevId: 305349884\n\nbf85ee3ed64951c14b19ef8577689f43ee6f0f41\nchore: enable gapicv2 for cloudbuild/v1 API\n\nCommitter: @miraleung\nPiperOrigin-RevId: 305349873\n\nf497c7aa912df121e11772767e667fdbc10a63d9\nchore: enable gapic v2 and proto annotation for Web Security Scanner v1alpha API.\n\ncommitter: @noahdietz\nPiperOrigin-RevId: 305349342\n\n0669a37c66d76bd413343da69420bb75c49062e7\nchore: rename unused GAPIC v1 configs for IAM to legacy\n\ncommitter: @noahdietz\nPiperOrigin-RevId: 305340308\n\naf7da29c24814a1c873c22f477e9dd8dd5a17b0b\nchore: set Ruby namespace in proto options\n\nPiperOrigin-RevId: 305330079\n\n3f767aa32b4b3313027d05b503aaba63e0c432a3\ndocs: Update an out-of-date external link.\n\nPiperOrigin-RevId: 305329485\n\n9ede34d093b9d786a974448fc7a3a17948c203e2\nchore: set Ruby namespace in proto options\n\nPiperOrigin-RevId: 305327985\n\n27daba50281357b676e1ba882422ebeab4ce4f92\nchore: set Ruby namespace in proto options\n\nPiperOrigin-RevId: 305327500\n\n82de0f6f04649651958b96fbc5b0b39dd4dbbd01\nFix: Add missing resource name definition (from the Compute API).\n\nPiperOrigin-RevId: 305324763\n\n744591190e828440f72745aef217f883afd1fd71\ndocs: change relative URLs to absolute URLs to fix broken links.\n\nPiperOrigin-RevId: 305323909\n\n1247c135ceaedfe04261d27a64aaecf78ffbae74\nchore: enable gapicv2 for videointelligence/v1beta2 API\n\nCommitter: @miraleung\nPiperOrigin-RevId: 305321976\n\n633c8b13227b9e3810749964d580e5be504db488\nchore: enable gapicv2 for videointelligence/v1p1beta1 API\n\nCommitter: @miraleung\nPiperOrigin-RevId: 305320877\n\n29aac60f121dc43382b37ff92f2dbb692d94143a\ndocs: fix broken link to policy reference documentation.\n\nPiperOrigin-RevId: 305319540\n\n54ddbbf14c489b8a2f0731aa39408c016f5a8387\nbazel: update gapic-generator-go to v0.13.0\n\nChanges include:\n* add clientHook feature\n\nPiperOrigin-RevId: 305289945\n\n823facb4ca6a4b36b817ce955a790dcb40cf808f\nchore: enable gapicv2 for videointelligence/v1p3beta1\n\nCommitter: @miraleung\nPiperOrigin-RevId: 305155214\n\n6b9c969d42bcb0f8206675bd868ed7d1ddcdaef9\nAdd API for bigqueryreservation v1.\n\nPiperOrigin-RevId: 305151484\n\n514f7d27811832a9f58b83d6f6305d894b097cf6\nchore: enable gapicv2 for phishingprotection/v1beta1 API\n\nCommitter: @miraleung\nPiperOrigin-RevId: 305126983\n\nff74d47d47280e6bbcbad1a7c82b1e0959c472ec\nfix: PHP-related fixes in BUILD.bazel and service.yamls\n\nThis PR also adds the rules for all 7 langauges in OsLogin and Kms BUILD.bazel files. Those build files were missing rules for 5 langagues, including PHP.\n\nThis PR is the prerequisite for migrating PHP synth.py scripts from artman to bazel.\n\nThe fixes in service.yaml fix regression made during proto annotation migration. This became visible only during PHP generation, because only PHP depends on the affected sections of the service.yaml config.\n\nPiperOrigin-RevId: 305108224\n\nfdbc7b1f63969307c71143a0c24fdfd02e739df6\nEnable gapicv2 for osconfig/agentendpoint/v1\n\nCommitter: @miraleung\nPiperOrigin-RevId: 305086443\n\n1490d30e1ae339570dd7826ba625a603ede91a08\nEnable gapicv2 for osconfig/v1beta\n\nCommitter: @miraleung\nPiperOrigin-RevId: 305069755\n\n7bf824e82e5c3549642b150dc4a9579602000f34\nEnable gapicv2 for iam/credentials/v1\n\nCommitter: @miraleung\nPiperOrigin-RevId: 305065283\n\n9ff6fd3b22f99167827e89aae7778408b5e82425\nUpdates Dataproc v1 API:\n- Adds Dataproc Jobs.SubmitJobAsOperation RPC\n- Adds SparkR and Presto job types to WorkflowTemplates\n- Adds new Optional Components\n- Clarifies usage of some APIs\n\nPiperOrigin-RevId: 305053617\n\ncad0f5137a70d0d14a8d9acbfcee98e4cd3e9662\nUpdates to Dataproc v1beta2 API:\n- Adds SparkR and Presto job types to WorkflowTemplates\n- Adds new Optional Components\n- Clarifies usage of some APIs\n\nPiperOrigin-RevId: 305053062\n\na005f045a301535eeb4c4b3fa7bb94eec9d22a8b\nAdd support for Cloud EKM to the Cloud KMS service and resource protos.\n\nPiperOrigin-RevId: 305026790\n\n5077b1e4674afdbbf11dac3f5f43d36285ba53ff\nchore: set Ruby namespace in proto options\n\nPiperOrigin-RevId: 304836531\n\nd6cb4997910eda04c0c66c0f2fd043eeaa0f660d\nchore: enable gapic v2 and proto annotation for documentai API.\n\ncommitter @summer-ji-eng\n\nPiperOrigin-RevId: 304724866\n\n490bc556608bfa5b1548c9374b06152fa33d657e\nEnable gapicv2 for devtools/remoteworkers/v1test2\n\nCommitter: @miraleung\nPiperOrigin-RevId: 304718691\n\n9f78ce31a5bd7f4a63e3cf0ddf28221557adb7ed\nEnable gapicv2 for managedidentities/v1beta1\n\nCommitter: @miraleung\nPiperOrigin-RevId: 304718676\n\n6e17d259b8e320bc51aa240cefef05ec753e2b83\ndocs: treat a dummy example URL as a string literal instead of a link\n\nPiperOrigin-RevId: 304716376\n\na8d76f99d3073aaccabdcc122c798a63e812c4fe\ndocs: change relative URLs to absolute URLs to fix broken links.\n\nPiperOrigin-RevId: 304702368\n\n65c749bc6a1d240416a0e6979381b67f97aff907\ndocs: fix formatting of some regexes and string literals.\n\nPiperOrigin-RevId: 304701150\n\n9119eefcd2b5ce845a680fa4ec4093ed733498f0\nchore: set Ruby namespace in proto options\n\nPiperOrigin-RevId: 304698702\n\n62a2a7cc33d3535638d220df238823eefcca930d\nchore: set Ruby namespace in proto options\n\nPiperOrigin-RevId: 304696461\n\n23848c8f64a5e81a239d6133378468185f1756dc\nchore: set Ruby namespace in proto options\n\nPiperOrigin-RevId: 304696192\n\n9514fa9e390a4c0715972c5b510cf4c10ad049a1\ndocs: change relative URLs to absolute URLs to fix broken links.\n\nPiperOrigin-RevId: 304695334\n\n0f7b1509a9a452808c3d07fe90fedfcea763d7d5\nfix: change config_schema_version to 2.0.0 for containeranalysis v1 gapic config.\n\ncommitter: @hzyi-google\nPiperOrigin-RevId: 304672648\n\n3d52f3c126fbfc31f067a7f54737b7f0dfbce163\nDialogflow weekly v2 library update:\n- Change `parent` field's resource_reference to specify child_type instead of type per client library generation requirement;\n- Change Session with its child resource pattern to support both projects/{project}/agent/sessions/{session} and projects/{project}/agent/environments/{environment}/users/{user}/sessions/{session};\n- Fix `method_signature`\n- Regular documentation update\n\nImportant updates are also posted at:\nhttps://cloud.google.com/dialogflow/docs/release-notes\n\nPiperOrigin-RevId: 304635286\n\n4a6a01ce0ead505c245d11a2ce156de34800c58f\ndocs: change a relative URL to an absolute URL to fix broken links.\n\nPiperOrigin-RevId: 304633630\n\n1b969c28a6579265e89cd35e6c2ecacc89970e2d\nchore: set Ruby namespace in proto options\n\nPiperOrigin-RevId: 304620317\n\n5378173a889f9c7d83e36e52d38a6267190de692\nAdd v1beta2 SubmitJobAsOperation RPC to Dataproc.\n\nPiperOrigin-RevId: 304594381\n\n" } }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "99820243d348191bc9c634f2b48ddf65096285ed" + "sha": "1df68ed6735ddce6797d0f83641a731c3c3f75b4", + "log": "1df68ed6735ddce6797d0f83641a731c3c3f75b4\nfix: apache license URL (#468)\n\n\nf4a59efa54808c4b958263de87bc666ce41e415f\nfeat: Add discogapic support for GAPICBazel generation (#459)\n\n* feat: Add discogapic support for GAPICBazel generation\n\n* reformat with black\n\n* Rename source repository variable\n\nCo-authored-by: Jeffrey Rennie \n" } } ], diff --git a/packages/google-cloud-securitycenter/test/gapic_security_center_v1.ts b/packages/google-cloud-securitycenter/test/gapic_security_center_v1.ts index 0912e01a2a1..42cdac90b37 100644 --- a/packages/google-cloud-securitycenter/test/gapic_security_center_v1.ts +++ b/packages/google-cloud-securitycenter/test/gapic_security_center_v1.ts @@ -331,7 +331,7 @@ describe('v1.SecurityCenterClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.createSource(request); }, expectedError); assert( @@ -445,7 +445,7 @@ describe('v1.SecurityCenterClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.createFinding(request); }, expectedError); assert( @@ -561,7 +561,7 @@ describe('v1.SecurityCenterClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.createNotificationConfig(request); }, expectedError); assert( @@ -677,7 +677,7 @@ describe('v1.SecurityCenterClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.deleteNotificationConfig(request); }, expectedError); assert( @@ -791,7 +791,7 @@ describe('v1.SecurityCenterClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.getIamPolicy(request); }, expectedError); assert( @@ -907,7 +907,7 @@ describe('v1.SecurityCenterClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.getNotificationConfig(request); }, expectedError); assert( @@ -1023,7 +1023,7 @@ describe('v1.SecurityCenterClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.getOrganizationSettings(request); }, expectedError); assert( @@ -1134,7 +1134,7 @@ describe('v1.SecurityCenterClient', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.getSource = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { + await assert.rejects(async () => { await client.getSource(request); }, expectedError); assert( @@ -1248,7 +1248,7 @@ describe('v1.SecurityCenterClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.setFindingState(request); }, expectedError); assert( @@ -1362,7 +1362,7 @@ describe('v1.SecurityCenterClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.setIamPolicy(request); }, expectedError); assert( @@ -1478,7 +1478,7 @@ describe('v1.SecurityCenterClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.testIamPermissions(request); }, expectedError); assert( @@ -1595,7 +1595,7 @@ describe('v1.SecurityCenterClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.updateFinding(request); }, expectedError); assert( @@ -1714,7 +1714,7 @@ describe('v1.SecurityCenterClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.updateNotificationConfig(request); }, expectedError); assert( @@ -1833,7 +1833,7 @@ describe('v1.SecurityCenterClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.updateOrganizationSettings(request); }, expectedError); assert( @@ -1950,7 +1950,7 @@ describe('v1.SecurityCenterClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.updateSource(request); }, expectedError); assert( @@ -2069,7 +2069,7 @@ describe('v1.SecurityCenterClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.updateSecurityMarks(request); }, expectedError); assert( @@ -2193,7 +2193,7 @@ describe('v1.SecurityCenterClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.runAssetDiscovery(request); }, expectedError); assert( @@ -2228,7 +2228,7 @@ describe('v1.SecurityCenterClient', () => { expectedError ); const [operation] = await client.runAssetDiscovery(request); - assert.rejects(async () => { + await assert.rejects(async () => { await operation.promise(); }, expectedError); assert( @@ -2358,7 +2358,7 @@ describe('v1.SecurityCenterClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.groupAssets(request); }, expectedError); assert( @@ -2456,7 +2456,7 @@ describe('v1.SecurityCenterClient', () => { reject(err); }); }); - assert.rejects(async () => { + await assert.rejects(async () => { await promise; }, expectedError); assert( @@ -2534,7 +2534,7 @@ describe('v1.SecurityCenterClient', () => { expectedError ); const iterable = client.groupAssetsAsync(request); - assert.rejects(async () => { + await assert.rejects(async () => { const responses: protos.google.cloud.securitycenter.v1.IGroupResult[] = []; for await (const resource of iterable) { responses.push(resource!); @@ -2674,7 +2674,7 @@ describe('v1.SecurityCenterClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.groupFindings(request); }, expectedError); assert( @@ -2773,7 +2773,7 @@ describe('v1.SecurityCenterClient', () => { reject(err); }); }); - assert.rejects(async () => { + await assert.rejects(async () => { await promise; }, expectedError); assert( @@ -2852,7 +2852,7 @@ describe('v1.SecurityCenterClient', () => { expectedError ); const iterable = client.groupFindingsAsync(request); - assert.rejects(async () => { + await assert.rejects(async () => { const responses: protos.google.cloud.securitycenter.v1.IGroupResult[] = []; for await (const resource of iterable) { responses.push(resource!); @@ -2994,7 +2994,7 @@ describe('v1.SecurityCenterClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.listAssets(request); }, expectedError); assert( @@ -3096,7 +3096,7 @@ describe('v1.SecurityCenterClient', () => { reject(err); }); }); - assert.rejects(async () => { + await assert.rejects(async () => { await promise; }, expectedError); assert( @@ -3174,7 +3174,7 @@ describe('v1.SecurityCenterClient', () => { expectedError ); const iterable = client.listAssetsAsync(request); - assert.rejects(async () => { + await assert.rejects(async () => { const responses: protos.google.cloud.securitycenter.v1.ListAssetsResponse.IListAssetsResult[] = []; for await (const resource of iterable) { responses.push(resource!); @@ -3316,7 +3316,7 @@ describe('v1.SecurityCenterClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.listFindings(request); }, expectedError); assert( @@ -3419,7 +3419,7 @@ describe('v1.SecurityCenterClient', () => { reject(err); }); }); - assert.rejects(async () => { + await assert.rejects(async () => { await promise; }, expectedError); assert( @@ -3498,7 +3498,7 @@ describe('v1.SecurityCenterClient', () => { expectedError ); const iterable = client.listFindingsAsync(request); - assert.rejects(async () => { + await assert.rejects(async () => { const responses: protos.google.cloud.securitycenter.v1.ListFindingsResponse.IListFindingsResult[] = []; for await (const resource of iterable) { responses.push(resource!); @@ -3642,7 +3642,7 @@ describe('v1.SecurityCenterClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.listNotificationConfigs(request); }, expectedError); assert( @@ -3746,7 +3746,7 @@ describe('v1.SecurityCenterClient', () => { reject(err); }); }); - assert.rejects(async () => { + await assert.rejects(async () => { await promise; }, expectedError); assert( @@ -3826,7 +3826,7 @@ describe('v1.SecurityCenterClient', () => { expectedError ); const iterable = client.listNotificationConfigsAsync(request); - assert.rejects(async () => { + await assert.rejects(async () => { const responses: protos.google.cloud.securitycenter.v1.INotificationConfig[] = []; for await (const resource of iterable) { responses.push(resource!); @@ -3966,7 +3966,7 @@ describe('v1.SecurityCenterClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.listSources(request); }, expectedError); assert( @@ -4064,7 +4064,7 @@ describe('v1.SecurityCenterClient', () => { reject(err); }); }); - assert.rejects(async () => { + await assert.rejects(async () => { await promise; }, expectedError); assert( @@ -4142,7 +4142,7 @@ describe('v1.SecurityCenterClient', () => { expectedError ); const iterable = client.listSourcesAsync(request); - assert.rejects(async () => { + await assert.rejects(async () => { const responses: protos.google.cloud.securitycenter.v1.ISource[] = []; for await (const resource of iterable) { responses.push(resource!); diff --git a/packages/google-cloud-securitycenter/test/gapic_security_center_v1beta1.ts b/packages/google-cloud-securitycenter/test/gapic_security_center_v1beta1.ts index 4187ac96644..40c1cb9ed40 100644 --- a/packages/google-cloud-securitycenter/test/gapic_security_center_v1beta1.ts +++ b/packages/google-cloud-securitycenter/test/gapic_security_center_v1beta1.ts @@ -331,7 +331,7 @@ describe('v1beta1.SecurityCenterClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.createSource(request); }, expectedError); assert( @@ -445,7 +445,7 @@ describe('v1beta1.SecurityCenterClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.createFinding(request); }, expectedError); assert( @@ -559,7 +559,7 @@ describe('v1beta1.SecurityCenterClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.getIamPolicy(request); }, expectedError); assert( @@ -675,7 +675,7 @@ describe('v1beta1.SecurityCenterClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.getOrganizationSettings(request); }, expectedError); assert( @@ -786,7 +786,7 @@ describe('v1beta1.SecurityCenterClient', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.getSource = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { + await assert.rejects(async () => { await client.getSource(request); }, expectedError); assert( @@ -900,7 +900,7 @@ describe('v1beta1.SecurityCenterClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.setFindingState(request); }, expectedError); assert( @@ -1014,7 +1014,7 @@ describe('v1beta1.SecurityCenterClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.setIamPolicy(request); }, expectedError); assert( @@ -1130,7 +1130,7 @@ describe('v1beta1.SecurityCenterClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.testIamPermissions(request); }, expectedError); assert( @@ -1247,7 +1247,7 @@ describe('v1beta1.SecurityCenterClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.updateFinding(request); }, expectedError); assert( @@ -1366,7 +1366,7 @@ describe('v1beta1.SecurityCenterClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.updateOrganizationSettings(request); }, expectedError); assert( @@ -1483,7 +1483,7 @@ describe('v1beta1.SecurityCenterClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.updateSource(request); }, expectedError); assert( @@ -1602,7 +1602,7 @@ describe('v1beta1.SecurityCenterClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.updateSecurityMarks(request); }, expectedError); assert( @@ -1726,7 +1726,7 @@ describe('v1beta1.SecurityCenterClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.runAssetDiscovery(request); }, expectedError); assert( @@ -1761,7 +1761,7 @@ describe('v1beta1.SecurityCenterClient', () => { expectedError ); const [operation] = await client.runAssetDiscovery(request); - assert.rejects(async () => { + await assert.rejects(async () => { await operation.promise(); }, expectedError); assert( @@ -1893,7 +1893,7 @@ describe('v1beta1.SecurityCenterClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.groupAssets(request); }, expectedError); assert( @@ -1995,7 +1995,7 @@ describe('v1beta1.SecurityCenterClient', () => { reject(err); }); }); - assert.rejects(async () => { + await assert.rejects(async () => { await promise; }, expectedError); assert( @@ -2073,7 +2073,7 @@ describe('v1beta1.SecurityCenterClient', () => { expectedError ); const iterable = client.groupAssetsAsync(request); - assert.rejects(async () => { + await assert.rejects(async () => { const responses: protos.google.cloud.securitycenter.v1beta1.IGroupResult[] = []; for await (const resource of iterable) { responses.push(resource!); @@ -2215,7 +2215,7 @@ describe('v1beta1.SecurityCenterClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.groupFindings(request); }, expectedError); assert( @@ -2318,7 +2318,7 @@ describe('v1beta1.SecurityCenterClient', () => { reject(err); }); }); - assert.rejects(async () => { + await assert.rejects(async () => { await promise; }, expectedError); assert( @@ -2397,7 +2397,7 @@ describe('v1beta1.SecurityCenterClient', () => { expectedError ); const iterable = client.groupFindingsAsync(request); - assert.rejects(async () => { + await assert.rejects(async () => { const responses: protos.google.cloud.securitycenter.v1beta1.IGroupResult[] = []; for await (const resource of iterable) { responses.push(resource!); @@ -2539,7 +2539,7 @@ describe('v1beta1.SecurityCenterClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.listAssets(request); }, expectedError); assert( @@ -2641,7 +2641,7 @@ describe('v1beta1.SecurityCenterClient', () => { reject(err); }); }); - assert.rejects(async () => { + await assert.rejects(async () => { await promise; }, expectedError); assert( @@ -2719,7 +2719,7 @@ describe('v1beta1.SecurityCenterClient', () => { expectedError ); const iterable = client.listAssetsAsync(request); - assert.rejects(async () => { + await assert.rejects(async () => { const responses: protos.google.cloud.securitycenter.v1beta1.ListAssetsResponse.IListAssetsResult[] = []; for await (const resource of iterable) { responses.push(resource!); @@ -2861,7 +2861,7 @@ describe('v1beta1.SecurityCenterClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.listFindings(request); }, expectedError); assert( @@ -2960,7 +2960,7 @@ describe('v1beta1.SecurityCenterClient', () => { reject(err); }); }); - assert.rejects(async () => { + await assert.rejects(async () => { await promise; }, expectedError); assert( @@ -3039,7 +3039,7 @@ describe('v1beta1.SecurityCenterClient', () => { expectedError ); const iterable = client.listFindingsAsync(request); - assert.rejects(async () => { + await assert.rejects(async () => { const responses: protos.google.cloud.securitycenter.v1beta1.IFinding[] = []; for await (const resource of iterable) { responses.push(resource!); @@ -3179,7 +3179,7 @@ describe('v1beta1.SecurityCenterClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.listSources(request); }, expectedError); assert( @@ -3277,7 +3277,7 @@ describe('v1beta1.SecurityCenterClient', () => { reject(err); }); }); - assert.rejects(async () => { + await assert.rejects(async () => { await promise; }, expectedError); assert( @@ -3355,7 +3355,7 @@ describe('v1beta1.SecurityCenterClient', () => { expectedError ); const iterable = client.listSourcesAsync(request); - assert.rejects(async () => { + await assert.rejects(async () => { const responses: protos.google.cloud.securitycenter.v1beta1.ISource[] = []; for await (const resource of iterable) { responses.push(resource!); diff --git a/packages/google-cloud-securitycenter/test/gapic_security_center_v1p1beta1.ts b/packages/google-cloud-securitycenter/test/gapic_security_center_v1p1beta1.ts index 4e9fe1cc44c..43fd674dfbb 100644 --- a/packages/google-cloud-securitycenter/test/gapic_security_center_v1p1beta1.ts +++ b/packages/google-cloud-securitycenter/test/gapic_security_center_v1p1beta1.ts @@ -331,7 +331,7 @@ describe('v1p1beta1.SecurityCenterClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.createSource(request); }, expectedError); assert( @@ -445,7 +445,7 @@ describe('v1p1beta1.SecurityCenterClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.createFinding(request); }, expectedError); assert( @@ -561,7 +561,7 @@ describe('v1p1beta1.SecurityCenterClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.createNotificationConfig(request); }, expectedError); assert( @@ -677,7 +677,7 @@ describe('v1p1beta1.SecurityCenterClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.deleteNotificationConfig(request); }, expectedError); assert( @@ -791,7 +791,7 @@ describe('v1p1beta1.SecurityCenterClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.getIamPolicy(request); }, expectedError); assert( @@ -907,7 +907,7 @@ describe('v1p1beta1.SecurityCenterClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.getNotificationConfig(request); }, expectedError); assert( @@ -1023,7 +1023,7 @@ describe('v1p1beta1.SecurityCenterClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.getOrganizationSettings(request); }, expectedError); assert( @@ -1134,7 +1134,7 @@ describe('v1p1beta1.SecurityCenterClient', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.getSource = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { + await assert.rejects(async () => { await client.getSource(request); }, expectedError); assert( @@ -1248,7 +1248,7 @@ describe('v1p1beta1.SecurityCenterClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.setFindingState(request); }, expectedError); assert( @@ -1362,7 +1362,7 @@ describe('v1p1beta1.SecurityCenterClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.setIamPolicy(request); }, expectedError); assert( @@ -1478,7 +1478,7 @@ describe('v1p1beta1.SecurityCenterClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.testIamPermissions(request); }, expectedError); assert( @@ -1595,7 +1595,7 @@ describe('v1p1beta1.SecurityCenterClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.updateFinding(request); }, expectedError); assert( @@ -1714,7 +1714,7 @@ describe('v1p1beta1.SecurityCenterClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.updateNotificationConfig(request); }, expectedError); assert( @@ -1833,7 +1833,7 @@ describe('v1p1beta1.SecurityCenterClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.updateOrganizationSettings(request); }, expectedError); assert( @@ -1950,7 +1950,7 @@ describe('v1p1beta1.SecurityCenterClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.updateSource(request); }, expectedError); assert( @@ -2069,7 +2069,7 @@ describe('v1p1beta1.SecurityCenterClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.updateSecurityMarks(request); }, expectedError); assert( @@ -2193,7 +2193,7 @@ describe('v1p1beta1.SecurityCenterClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.runAssetDiscovery(request); }, expectedError); assert( @@ -2228,7 +2228,7 @@ describe('v1p1beta1.SecurityCenterClient', () => { expectedError ); const [operation] = await client.runAssetDiscovery(request); - assert.rejects(async () => { + await assert.rejects(async () => { await operation.promise(); }, expectedError); assert( @@ -2360,7 +2360,7 @@ describe('v1p1beta1.SecurityCenterClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.groupAssets(request); }, expectedError); assert( @@ -2462,7 +2462,7 @@ describe('v1p1beta1.SecurityCenterClient', () => { reject(err); }); }); - assert.rejects(async () => { + await assert.rejects(async () => { await promise; }, expectedError); assert( @@ -2540,7 +2540,7 @@ describe('v1p1beta1.SecurityCenterClient', () => { expectedError ); const iterable = client.groupAssetsAsync(request); - assert.rejects(async () => { + await assert.rejects(async () => { const responses: protos.google.cloud.securitycenter.v1p1beta1.IGroupResult[] = []; for await (const resource of iterable) { responses.push(resource!); @@ -2682,7 +2682,7 @@ describe('v1p1beta1.SecurityCenterClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.groupFindings(request); }, expectedError); assert( @@ -2785,7 +2785,7 @@ describe('v1p1beta1.SecurityCenterClient', () => { reject(err); }); }); - assert.rejects(async () => { + await assert.rejects(async () => { await promise; }, expectedError); assert( @@ -2864,7 +2864,7 @@ describe('v1p1beta1.SecurityCenterClient', () => { expectedError ); const iterable = client.groupFindingsAsync(request); - assert.rejects(async () => { + await assert.rejects(async () => { const responses: protos.google.cloud.securitycenter.v1p1beta1.IGroupResult[] = []; for await (const resource of iterable) { responses.push(resource!); @@ -3006,7 +3006,7 @@ describe('v1p1beta1.SecurityCenterClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.listAssets(request); }, expectedError); assert( @@ -3108,7 +3108,7 @@ describe('v1p1beta1.SecurityCenterClient', () => { reject(err); }); }); - assert.rejects(async () => { + await assert.rejects(async () => { await promise; }, expectedError); assert( @@ -3186,7 +3186,7 @@ describe('v1p1beta1.SecurityCenterClient', () => { expectedError ); const iterable = client.listAssetsAsync(request); - assert.rejects(async () => { + await assert.rejects(async () => { const responses: protos.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.IListAssetsResult[] = []; for await (const resource of iterable) { responses.push(resource!); @@ -3328,7 +3328,7 @@ describe('v1p1beta1.SecurityCenterClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.listFindings(request); }, expectedError); assert( @@ -3431,7 +3431,7 @@ describe('v1p1beta1.SecurityCenterClient', () => { reject(err); }); }); - assert.rejects(async () => { + await assert.rejects(async () => { await promise; }, expectedError); assert( @@ -3510,7 +3510,7 @@ describe('v1p1beta1.SecurityCenterClient', () => { expectedError ); const iterable = client.listFindingsAsync(request); - assert.rejects(async () => { + await assert.rejects(async () => { const responses: protos.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.IListFindingsResult[] = []; for await (const resource of iterable) { responses.push(resource!); @@ -3654,7 +3654,7 @@ describe('v1p1beta1.SecurityCenterClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.listNotificationConfigs(request); }, expectedError); assert( @@ -3758,7 +3758,7 @@ describe('v1p1beta1.SecurityCenterClient', () => { reject(err); }); }); - assert.rejects(async () => { + await assert.rejects(async () => { await promise; }, expectedError); assert( @@ -3838,7 +3838,7 @@ describe('v1p1beta1.SecurityCenterClient', () => { expectedError ); const iterable = client.listNotificationConfigsAsync(request); - assert.rejects(async () => { + await assert.rejects(async () => { const responses: protos.google.cloud.securitycenter.v1p1beta1.INotificationConfig[] = []; for await (const resource of iterable) { responses.push(resource!); @@ -3980,7 +3980,7 @@ describe('v1p1beta1.SecurityCenterClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.listSources(request); }, expectedError); assert( @@ -4078,7 +4078,7 @@ describe('v1p1beta1.SecurityCenterClient', () => { reject(err); }); }); - assert.rejects(async () => { + await assert.rejects(async () => { await promise; }, expectedError); assert( @@ -4156,7 +4156,7 @@ describe('v1p1beta1.SecurityCenterClient', () => { expectedError ); const iterable = client.listSourcesAsync(request); - assert.rejects(async () => { + await assert.rejects(async () => { const responses: protos.google.cloud.securitycenter.v1p1beta1.ISource[] = []; for await (const resource of iterable) { responses.push(resource!); From 943faa22a6b8edffe054dce454813f9a6b6be258 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 10 Apr 2020 20:58:15 +0200 Subject: [PATCH 163/342] chore(deps): update dependency gts to v2.0.0 (#257) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [gts](https://togithub.com/google/gts) | devDependencies | patch | [`2.0.0-alpha.9` -> `2.0.0`](https://renovatebot.com/diffs/npm/gts/2.0.0-alpha.9/2.0.0) | --- ### Release Notes
google/gts ### [`v2.0.0`](https://togithub.com/google/gts/blob/master/CHANGELOG.md#​200-httpswwwgithubcomgooglegtscomparev112v200-2020-04-02) [Compare Source](https://togithub.com/google/gts/compare/39a2705e51b4b6329a70f91f8293a2d7a363bf5d...v2.0.0) ##### ⚠ BREAKING CHANGES ⚠ This is a major rewrite of the tool. Based on community guidance, we've switched from using [tslint](https://palantir.github.io/tslint/) to [eslint](https://eslint.org/). _Please read all of the steps below to upgrade_. ##### Configuring `eslint` With the shift to `eslint`, `gts` now will format and lint JavaScript _as well_ as TypeScript. Upgrading will require a number of manual steps. To format JavaScript and TypeScript, you can run: $ npx gts fix To specify only TypeScript: $ npx gts fix '**/*.ts' ##### Delete `tslint.json` This file is no longer used, and can lead to confusion. ##### Create a `.eslintrc.json` Now that we're using eslint, you need to extend the eslint configuration baked into the module. Create a new file named `.eslintrc.json`, and paste the following: ```js { "extends": "./node_modules/gts" } ``` ##### Create a `.eslintignore` The `.eslintignore` file lets you ignore specific directories. This tool now lints and formats JavaScript, so it's _really_ important to ignore your build directory! Here is an example of a `.eslintignore` file: **/node_modules build/ ##### Rule changes The underlying linter was changed, so naturally there are going to be a variety of rule changes along the way. To see the full list, check out [.eslintrc.json](https://togithub.com/google/gts/blob/master/.eslintrc.json). ##### Require Node.js 10.x and up Node.js 8.x is now end of life - this module now requires Ndoe.js 10.x and up. ##### Features - add the eol-last rule ([#​425](https://www.github.com/google/gts/issues/425)) ([50ebd4d](https://www.github.com/google/gts/commit/50ebd4dbaf063615f4c025f567ca28076a734223)) - allow eslintrc to run over tsx files ([#​469](https://www.github.com/google/gts/issues/469)) ([a21db94](https://www.github.com/google/gts/commit/a21db94601def563952d677cb0980a12b6730f4c)) - disable global rule for checking TODO comments ([#​459](https://www.github.com/google/gts/issues/459)) ([96aa84a](https://www.github.com/google/gts/commit/96aa84a0a42181046daa248750cc8fef0c320619)) - override require-atomic-updates ([#​468](https://www.github.com/google/gts/issues/468)) ([8105c93](https://www.github.com/google/gts/commit/8105c9334ee5104b05f6b1b2f150e51419637262)) - prefer single quotes if possible ([#​475](https://www.github.com/google/gts/issues/475)) ([39a2705](https://www.github.com/google/gts/commit/39a2705e51b4b6329a70f91f8293a2d7a363bf5d)) - use eslint instead of tslint ([#​400](https://www.github.com/google/gts/issues/400)) ([b3096fb](https://www.github.com/google/gts/commit/b3096fbd5076d302d93c2307bf627e12c423e726)) ##### Bug Fixes - use .prettierrc.js ([#​437](https://www.github.com/google/gts/issues/437)) ([06efa84](https://www.github.com/google/gts/commit/06efa8444cdf1064b64f3e8d61ebd04f45d90b4c)) - **deps:** update dependency chalk to v4 ([#​477](https://www.github.com/google/gts/issues/477)) ([061d64e](https://www.github.com/google/gts/commit/061d64e29d37b93ce55228937cc100e05ddef352)) - **deps:** update dependency eslint-plugin-node to v11 ([#​426](https://www.github.com/google/gts/issues/426)) ([a394b7c](https://www.github.com/google/gts/commit/a394b7c1f80437f25017ca5c500b968ebb789ece)) - **deps:** update dependency execa to v4 ([#​427](https://www.github.com/google/gts/issues/427)) ([f42ef36](https://www.github.com/google/gts/commit/f42ef36709251553342e655e287e889df72ee3e3)) - **deps:** update dependency prettier to v2 ([#​464](https://www.github.com/google/gts/issues/464)) ([20ef43d](https://www.github.com/google/gts/commit/20ef43d566df17d3c93949ef7db3b72ee9123ca3)) - disable no-use-before-define ([#​431](https://www.github.com/google/gts/issues/431)) ([dea2c22](https://www.github.com/google/gts/commit/dea2c223d1d3a60a1786aa820eebb93be27016a7)) - **deps:** update dependency update-notifier to v4 ([#​403](https://www.github.com/google/gts/issues/403)) ([57393b7](https://www.github.com/google/gts/commit/57393b74c6cf299e8ae09311f0382226b8baa3e3)) - **deps:** upgrade to meow 6.x ([#​423](https://www.github.com/google/gts/issues/423)) ([8f93d00](https://www.github.com/google/gts/commit/8f93d0049337a832d9a22b6ae4e86fd41140ec56)) - align back to the google style guide ([#​440](https://www.github.com/google/gts/issues/440)) ([8bd78c4](https://www.github.com/google/gts/commit/8bd78c4c78526a72400f618a95a987d2a7c1a8db)) - disable empty-function check ([#​467](https://www.github.com/google/gts/issues/467)) ([6455d7a](https://www.github.com/google/gts/commit/6455d7a9d227320d3ffe1b00c9c739b846f339a8)) - drop support for node 8 ([#​422](https://www.github.com/google/gts/issues/422)) ([888c686](https://www.github.com/google/gts/commit/888c68692079065f38ce66ec84472f1f3311a050)) - emit .prettierrc.js with init ([#​462](https://www.github.com/google/gts/issues/462)) ([b114614](https://www.github.com/google/gts/commit/b114614d22ab5560d2d1dd5cb6695968cc80027b)) - enable trailing comma ([#​470](https://www.github.com/google/gts/issues/470)) ([6518f58](https://www.github.com/google/gts/commit/6518f5843d3093e3beb7d3371b56d9aecedf3924)) - include _.tsx and _.jsx in default fix command ([#​473](https://www.github.com/google/gts/issues/473)) ([0509780](https://www.github.com/google/gts/commit/050978005ad089d9b3b5d8895b25ea1175d75db2)) ##### [1.1.2](https://www.github.com/google/gts/compare/v1.1.1...v1.1.2) (2019-11-20) ##### Bug Fixes - **deps:** update to newest prettier (with support for optional chain) ([#​396](https://www.github.com/google/gts/issues/396)) ([ce8ad06](https://www.github.com/google/gts/commit/ce8ad06c8489c44a9e2ed5292382637b3ebb7601)) ##### [1.1.1](https://www.github.com/google/gts/compare/v1.1.0...v1.1.1) (2019-11-11) ##### Bug Fixes - **deps:** update dependency chalk to v3 ([#​389](https://www.github.com/google/gts/issues/389)) ([1ce0f45](https://www.github.com/google/gts/commit/1ce0f450677e143a27efc39def617d13c66503e8)) - **deps:** update dependency inquirer to v7 ([#​377](https://www.github.com/google/gts/issues/377)) ([bf2c349](https://www.github.com/google/gts/commit/bf2c349b2208ac63e551542599ac9cd27b461338)) - **deps:** update dependency rimraf to v3 ([#​374](https://www.github.com/google/gts/issues/374)) ([2058eaa](https://www.github.com/google/gts/commit/2058eaa682f4baae978b469fd708d1f866e7da74)) - **deps:** update dependency write-file-atomic to v3 ([#​353](https://www.github.com/google/gts/issues/353)) ([59e6aa8](https://www.github.com/google/gts/commit/59e6aa8580a2f8e9457d2d2b6fa9e18e86347592))
--- ### Renovate configuration :date: **Schedule**: "after 9am and before 3pm" (UTC). :vertical_traffic_light: **Automerge**: Disabled by config. Please merge this manually once you are satisfied. :recycle: **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. :no_bell: **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#googleapis/nodejs-security-center). --- packages/google-cloud-securitycenter/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-securitycenter/package.json b/packages/google-cloud-securitycenter/package.json index acf94aedeac..377daf989df 100644 --- a/packages/google-cloud-securitycenter/package.json +++ b/packages/google-cloud-securitycenter/package.json @@ -52,7 +52,7 @@ "eslint-config-prettier": "^6.0.0", "eslint-plugin-node": "^11.0.0", "eslint-plugin-prettier": "^3.0.0", - "gts": "2.0.0-alpha.9", + "gts": "2.0.0", "jsdoc": "^3.6.2", "jsdoc-fresh": "^1.0.1", "jsdoc-region-tag": "^1.0.2", From 59e631c6a7114296b56f03c4de6777a14f5f851f Mon Sep 17 00:00:00 2001 From: Alexander Fenster Date: Fri, 10 Apr 2020 18:48:54 -0700 Subject: [PATCH 164/342] fix: remove eslint, update gax, fix generated protos, run the generator (#258) Run the latest version of the generator, update google-gax, update gts, and remove direct dependencies on eslint. --- .../google-cloud-securitycenter/package.json | 14 +++++------- .../protos/protos.json | 16 ++++++++++---- .../synth.metadata | 22 +++---------------- packages/google-cloud-securitycenter/synth.py | 2 +- 4 files changed, 21 insertions(+), 33 deletions(-) diff --git a/packages/google-cloud-securitycenter/package.json b/packages/google-cloud-securitycenter/package.json index 377daf989df..b430e8b4fbf 100644 --- a/packages/google-cloud-securitycenter/package.json +++ b/packages/google-cloud-securitycenter/package.json @@ -18,14 +18,14 @@ "compile": "tsc -p . && cp -r protos build/", "docs": "jsdoc -c .jsdoc.js", "docs-test": "linkinator docs", - "fix": "gts fix && eslint --fix '**/*.js'", - "lint": "gts check && eslint '**/*.js'", + "fix": "gts fix", + "lint": "gts fix", "predocs-test": "npm run docs", "prepare": "npm run compile", "system-test": "c8 mocha build/system-test", "test": "c8 mocha build/test", "samples-test": "cd samples/ && npm link ../ && npm test && cd ../", - "prelint": "cd samples; npm link ../; npm i" + "prelint": "cd samples; npm link ../; npm install" }, "keywords": [ "google apis client", @@ -41,18 +41,14 @@ "Security Command Center API" ], "dependencies": { - "google-gax": "^2.0.1" + "google-gax": "^2.1.0" }, "devDependencies": { "@types/mocha": "^7.0.0", "@types/node": "^12.0.0", "@types/sinon": "^9.0.0", "c8": "^7.0.0", - "eslint": "^6.0.0", - "eslint-config-prettier": "^6.0.0", - "eslint-plugin-node": "^11.0.0", - "eslint-plugin-prettier": "^3.0.0", - "gts": "2.0.0", + "gts": "^2.0.0", "jsdoc": "^3.6.2", "jsdoc-fresh": "^1.0.1", "jsdoc-region-tag": "^1.0.2", diff --git a/packages/google-cloud-securitycenter/protos/protos.json b/packages/google-cloud-securitycenter/protos/protos.json index c3eda832731..666f1bfd74c 100644 --- a/packages/google-cloud-securitycenter/protos/protos.json +++ b/packages/google-cloud-securitycenter/protos/protos.json @@ -4749,26 +4749,32 @@ "extend": "google.protobuf.MethodOptions" }, "Operations": { + "options": { + "(google.api.default_host)": "longrunning.googleapis.com" + }, "methods": { "ListOperations": { "requestType": "ListOperationsRequest", "responseType": "ListOperationsResponse", "options": { - "(google.api.http).get": "/v1/{name=operations}" + "(google.api.http).get": "/v1/{name=operations}", + "(google.api.method_signature)": "name,filter" } }, "GetOperation": { "requestType": "GetOperationRequest", "responseType": "Operation", "options": { - "(google.api.http).get": "/v1/{name=operations/**}" + "(google.api.http).get": "/v1/{name=operations/**}", + "(google.api.method_signature)": "name" } }, "DeleteOperation": { "requestType": "DeleteOperationRequest", "responseType": "google.protobuf.Empty", "options": { - "(google.api.http).delete": "/v1/{name=operations/**}" + "(google.api.http).delete": "/v1/{name=operations/**}", + "(google.api.method_signature)": "name" } }, "CancelOperation": { @@ -4776,7 +4782,8 @@ "responseType": "google.protobuf.Empty", "options": { "(google.api.http).post": "/v1/{name=operations/**}:cancel", - "(google.api.http).body": "*" + "(google.api.http).body": "*", + "(google.api.method_signature)": "name" } }, "WaitOperation": { @@ -4902,6 +4909,7 @@ }, "rpc": { "options": { + "cc_enable_arenas": true, "go_package": "google.golang.org/genproto/googleapis/rpc/status;status", "java_multiple_files": true, "java_outer_classname": "StatusProto", diff --git a/packages/google-cloud-securitycenter/synth.metadata b/packages/google-cloud-securitycenter/synth.metadata index 52aefc87725..039ee0ee075 100644 --- a/packages/google-cloud-securitycenter/synth.metadata +++ b/packages/google-cloud-securitycenter/synth.metadata @@ -1,28 +1,12 @@ { - "updateTime": "2020-04-09T13:34:37.897426Z", + "updateTime": "2020-04-11T00:52:31.325939Z", "sources": [ - { - "git": { - "name": ".", - "remote": "https://github.com/googleapis/nodejs-security-center.git", - "sha": "aa6257554e5b401ba7b7613f0bf78d6233ef300b" - } - }, - { - "git": { - "name": "googleapis", - "remote": "https://github.com/googleapis/googleapis.git", - "sha": "ee4ea76504aa60c2bff9b7c11269c155d8c21e0d", - "internalRef": "305619145", - "log": "ee4ea76504aa60c2bff9b7c11269c155d8c21e0d\ngapic-generator:\n- feat: Support extra plugin_args for php bazel rules rules (#3165)\n- feat: support '*' in resource definition (#3163)\n- fix: add null check and better error message when referenced resource is not found (#3169)\n\nresource name plugin:\n- support * annotation in resource def (#84)\n\nPiperOrigin-RevId: 305619145\n\ne4f4b23e07315492b533746e6a9255a1e6b3e748\nosconfig v1beta: fix the incorrect pattern for GuestPolicy resource and remove the obsolete history field.\n\nPiperOrigin-RevId: 305617619\n\nd741cd976975c745d0199987aff0e908b8352992\nchore: enable gapicv2 for firestore/v1 API\n\nNote that this contains breaking Java changes:\n com.google.cloud.firestore.v1.FirestoreClient: Method 'public void deleteDocument(com.google.firestore.v1.AnyPathName)' has been removed\n\nCommitter: @miraleung\nPiperOrigin-RevId: 305561906\n\n0d69cddaa23b556e7299f84ad55a02ec1cad55a9\nchore: enable gapicv2 for firestore/admin/v1 API\n\nCommitter: @miraleung\n\nThere are the following breaking changes due to the collection_id discrepancy between [1] and [2]\n\n1. https://github.com/googleapis/googleapis/blob/6f8350c0df231d7e742fa10dbf929f33047715c9/google/firestore/admin/v1/firestore_gapic.yaml#L24-L29\n2. https://github.com/googleapis/googleapis/blob/6f8350c0df231d7e742fa10dbf929f33047715c9/google/firestore/admin/v1/field.proto#L39\n```\ncom.google.firestore.admin.v1.FieldName: Method 'public java.lang.String getCollectionId()' has been removed\ncom.google.firestore.admin.v1.FieldName: Method 'public java.lang.String getFieldId()' has been removed\ncom.google.firestore.admin.v1.FieldName$Builder: Method 'public java.lang.String getCollectionId()' has been removed\ncom.google.firestore.admin.v1.FieldName$Builder: Method 'public java.lang.String getFieldId()' has been removed\ncom.google.firestore.admin.v1.FieldName$Builder: Method 'public com.google.firestore.admin.v1.FieldName$Builder setCollectionId(java.lang.String)' has been removed\ncom.google.firestore.admin.v1.FieldName$Builder: Method 'public com.google.firestore.admin.v1.FieldName$Builder setFieldId(java.lang.String)' has been removed\ncom.google.firestore.admin.v1.IndexName: Method 'public java.lang.String getCollectionId()' has been removed\ncom.google.firestore.admin.v1.IndexName: Method 'public java.lang.String getIndexId()' has been removed\ncom.google.firestore.admin.v1.IndexName$Builder: Method 'public java.lang.String getCollectionId()' has been removed\ncom.google.firestore.admin.v1.IndexName$Builder: Method 'public java.lang.String getIndexId()' has been removed\ncom.google.firestore.admin.v1.IndexName$Builder: Method 'public com.google.firestore.admin.v1.IndexName$Builder setCollectionId(java.lang.String)' has been removed\ncom.google.firestore.admin.v1.IndexName$Builder: Method 'public com.google.firestore.admin.v1.IndexName$Builder setIndexId(java.lang.String)' has been removed\n```\n\nPiperOrigin-RevId: 305561114\n\n6f8350c0df231d7e742fa10dbf929f33047715c9\nchore: enable gapicv2 for firestore/v1beta1 API\n\nCommitter: @miraleung\nPiperOrigin-RevId: 305537104\n\nd398d687aad9eab4c6ceee9cd5e012fa61f7e28c\ndocs: change relative URLs to absolute URLs to fix broken links.\n\nPiperOrigin-RevId: 305496764\n\n5520cb891a72ab0b0cbe3facaca7b012785f5b49\nchore: update gapic-generator to cd3c9ee7\n\nChanges include:\n* update generated nox file\n* fix generated license text alignment\n\nPiperOrigin-RevId: 305484038\n\nb20965f260d70e57b7dcd312cd356d6a81f31f8e\nUpdating retry configuration settings.\n\nPiperOrigin-RevId: 305431885\n\n83d7f20c06182cb6ada9a3b47daf17b2fd22b020\nMigrate dialogflow from gapic v1 to gapic v2.\nIncluding breaking changes (resource pattern change) introduced in cl/304043500.\n\ncommitter: @hzyi-google\nPiperOrigin-RevId: 305358314\n\nf8a97692250a6c781d87528995a5c72d41ca7762\nchore: enable gapic v2 and proto annotation for Grafeas API.\n\ncommitter: @noahdietz\nPiperOrigin-RevId: 305354660\n\nb1a5ca68468eb1587168972c9d15928e98ba92b0\nEnable gapicv2 for v1/osconfig\n\nCommitter: @miraleung\nPiperOrigin-RevId: 305351235\n\nc803327f9b1dd2583b070645b5b86e5e7ead3161\nEnable gapicv2 for osconfig/agentendpoint/v1beta\n\nCommitter: @miraleung\nPiperOrigin-RevId: 305350472\n\n99dddf1de598f95a71d3536f5c170d84f0c0ef87\nchore: enable gapicv2 for build/v1 API\n\nCommitter: @miraleung\nPiperOrigin-RevId: 305349884\n\nbf85ee3ed64951c14b19ef8577689f43ee6f0f41\nchore: enable gapicv2 for cloudbuild/v1 API\n\nCommitter: @miraleung\nPiperOrigin-RevId: 305349873\n\nf497c7aa912df121e11772767e667fdbc10a63d9\nchore: enable gapic v2 and proto annotation for Web Security Scanner v1alpha API.\n\ncommitter: @noahdietz\nPiperOrigin-RevId: 305349342\n\n0669a37c66d76bd413343da69420bb75c49062e7\nchore: rename unused GAPIC v1 configs for IAM to legacy\n\ncommitter: @noahdietz\nPiperOrigin-RevId: 305340308\n\naf7da29c24814a1c873c22f477e9dd8dd5a17b0b\nchore: set Ruby namespace in proto options\n\nPiperOrigin-RevId: 305330079\n\n3f767aa32b4b3313027d05b503aaba63e0c432a3\ndocs: Update an out-of-date external link.\n\nPiperOrigin-RevId: 305329485\n\n9ede34d093b9d786a974448fc7a3a17948c203e2\nchore: set Ruby namespace in proto options\n\nPiperOrigin-RevId: 305327985\n\n27daba50281357b676e1ba882422ebeab4ce4f92\nchore: set Ruby namespace in proto options\n\nPiperOrigin-RevId: 305327500\n\n82de0f6f04649651958b96fbc5b0b39dd4dbbd01\nFix: Add missing resource name definition (from the Compute API).\n\nPiperOrigin-RevId: 305324763\n\n744591190e828440f72745aef217f883afd1fd71\ndocs: change relative URLs to absolute URLs to fix broken links.\n\nPiperOrigin-RevId: 305323909\n\n1247c135ceaedfe04261d27a64aaecf78ffbae74\nchore: enable gapicv2 for videointelligence/v1beta2 API\n\nCommitter: @miraleung\nPiperOrigin-RevId: 305321976\n\n633c8b13227b9e3810749964d580e5be504db488\nchore: enable gapicv2 for videointelligence/v1p1beta1 API\n\nCommitter: @miraleung\nPiperOrigin-RevId: 305320877\n\n29aac60f121dc43382b37ff92f2dbb692d94143a\ndocs: fix broken link to policy reference documentation.\n\nPiperOrigin-RevId: 305319540\n\n54ddbbf14c489b8a2f0731aa39408c016f5a8387\nbazel: update gapic-generator-go to v0.13.0\n\nChanges include:\n* add clientHook feature\n\nPiperOrigin-RevId: 305289945\n\n823facb4ca6a4b36b817ce955a790dcb40cf808f\nchore: enable gapicv2 for videointelligence/v1p3beta1\n\nCommitter: @miraleung\nPiperOrigin-RevId: 305155214\n\n6b9c969d42bcb0f8206675bd868ed7d1ddcdaef9\nAdd API for bigqueryreservation v1.\n\nPiperOrigin-RevId: 305151484\n\n514f7d27811832a9f58b83d6f6305d894b097cf6\nchore: enable gapicv2 for phishingprotection/v1beta1 API\n\nCommitter: @miraleung\nPiperOrigin-RevId: 305126983\n\nff74d47d47280e6bbcbad1a7c82b1e0959c472ec\nfix: PHP-related fixes in BUILD.bazel and service.yamls\n\nThis PR also adds the rules for all 7 langauges in OsLogin and Kms BUILD.bazel files. Those build files were missing rules for 5 langagues, including PHP.\n\nThis PR is the prerequisite for migrating PHP synth.py scripts from artman to bazel.\n\nThe fixes in service.yaml fix regression made during proto annotation migration. This became visible only during PHP generation, because only PHP depends on the affected sections of the service.yaml config.\n\nPiperOrigin-RevId: 305108224\n\nfdbc7b1f63969307c71143a0c24fdfd02e739df6\nEnable gapicv2 for osconfig/agentendpoint/v1\n\nCommitter: @miraleung\nPiperOrigin-RevId: 305086443\n\n1490d30e1ae339570dd7826ba625a603ede91a08\nEnable gapicv2 for osconfig/v1beta\n\nCommitter: @miraleung\nPiperOrigin-RevId: 305069755\n\n7bf824e82e5c3549642b150dc4a9579602000f34\nEnable gapicv2 for iam/credentials/v1\n\nCommitter: @miraleung\nPiperOrigin-RevId: 305065283\n\n9ff6fd3b22f99167827e89aae7778408b5e82425\nUpdates Dataproc v1 API:\n- Adds Dataproc Jobs.SubmitJobAsOperation RPC\n- Adds SparkR and Presto job types to WorkflowTemplates\n- Adds new Optional Components\n- Clarifies usage of some APIs\n\nPiperOrigin-RevId: 305053617\n\ncad0f5137a70d0d14a8d9acbfcee98e4cd3e9662\nUpdates to Dataproc v1beta2 API:\n- Adds SparkR and Presto job types to WorkflowTemplates\n- Adds new Optional Components\n- Clarifies usage of some APIs\n\nPiperOrigin-RevId: 305053062\n\na005f045a301535eeb4c4b3fa7bb94eec9d22a8b\nAdd support for Cloud EKM to the Cloud KMS service and resource protos.\n\nPiperOrigin-RevId: 305026790\n\n5077b1e4674afdbbf11dac3f5f43d36285ba53ff\nchore: set Ruby namespace in proto options\n\nPiperOrigin-RevId: 304836531\n\nd6cb4997910eda04c0c66c0f2fd043eeaa0f660d\nchore: enable gapic v2 and proto annotation for documentai API.\n\ncommitter @summer-ji-eng\n\nPiperOrigin-RevId: 304724866\n\n490bc556608bfa5b1548c9374b06152fa33d657e\nEnable gapicv2 for devtools/remoteworkers/v1test2\n\nCommitter: @miraleung\nPiperOrigin-RevId: 304718691\n\n9f78ce31a5bd7f4a63e3cf0ddf28221557adb7ed\nEnable gapicv2 for managedidentities/v1beta1\n\nCommitter: @miraleung\nPiperOrigin-RevId: 304718676\n\n6e17d259b8e320bc51aa240cefef05ec753e2b83\ndocs: treat a dummy example URL as a string literal instead of a link\n\nPiperOrigin-RevId: 304716376\n\na8d76f99d3073aaccabdcc122c798a63e812c4fe\ndocs: change relative URLs to absolute URLs to fix broken links.\n\nPiperOrigin-RevId: 304702368\n\n65c749bc6a1d240416a0e6979381b67f97aff907\ndocs: fix formatting of some regexes and string literals.\n\nPiperOrigin-RevId: 304701150\n\n9119eefcd2b5ce845a680fa4ec4093ed733498f0\nchore: set Ruby namespace in proto options\n\nPiperOrigin-RevId: 304698702\n\n62a2a7cc33d3535638d220df238823eefcca930d\nchore: set Ruby namespace in proto options\n\nPiperOrigin-RevId: 304696461\n\n23848c8f64a5e81a239d6133378468185f1756dc\nchore: set Ruby namespace in proto options\n\nPiperOrigin-RevId: 304696192\n\n9514fa9e390a4c0715972c5b510cf4c10ad049a1\ndocs: change relative URLs to absolute URLs to fix broken links.\n\nPiperOrigin-RevId: 304695334\n\n0f7b1509a9a452808c3d07fe90fedfcea763d7d5\nfix: change config_schema_version to 2.0.0 for containeranalysis v1 gapic config.\n\ncommitter: @hzyi-google\nPiperOrigin-RevId: 304672648\n\n3d52f3c126fbfc31f067a7f54737b7f0dfbce163\nDialogflow weekly v2 library update:\n- Change `parent` field's resource_reference to specify child_type instead of type per client library generation requirement;\n- Change Session with its child resource pattern to support both projects/{project}/agent/sessions/{session} and projects/{project}/agent/environments/{environment}/users/{user}/sessions/{session};\n- Fix `method_signature`\n- Regular documentation update\n\nImportant updates are also posted at:\nhttps://cloud.google.com/dialogflow/docs/release-notes\n\nPiperOrigin-RevId: 304635286\n\n4a6a01ce0ead505c245d11a2ce156de34800c58f\ndocs: change a relative URL to an absolute URL to fix broken links.\n\nPiperOrigin-RevId: 304633630\n\n1b969c28a6579265e89cd35e6c2ecacc89970e2d\nchore: set Ruby namespace in proto options\n\nPiperOrigin-RevId: 304620317\n\n5378173a889f9c7d83e36e52d38a6267190de692\nAdd v1beta2 SubmitJobAsOperation RPC to Dataproc.\n\nPiperOrigin-RevId: 304594381\n\n" - } - }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "1df68ed6735ddce6797d0f83641a731c3c3f75b4", - "log": "1df68ed6735ddce6797d0f83641a731c3c3f75b4\nfix: apache license URL (#468)\n\n\nf4a59efa54808c4b958263de87bc666ce41e415f\nfeat: Add discogapic support for GAPICBazel generation (#459)\n\n* feat: Add discogapic support for GAPICBazel generation\n\n* reformat with black\n\n* Rename source repository variable\n\nCo-authored-by: Jeffrey Rennie \n" + "sha": "6f32150677c9784f3c3a7e1949472bd29c9d72c5", + "log": "6f32150677c9784f3c3a7e1949472bd29c9d72c5\nfix: installs test_utils from its common repo (#480)\n\n\n74ce986d3b5431eb66985e9a00c4eb45295a4020\nfix: stop recording update_time in synth.metadata (#478)\n\n\n7f8e62aa3edd225f76347a16f92e400661fdfb52\nchore(java): release-please only updates non maven versions in README (#476)\n\nPrevent release-please and synthtool from fighting over the released library version. Synthtool updates the install snippets from the samples pom.xml files so the bots fight if they are temporarily out of sync after a release.\nc7e0e517d7f46f77bebd27da2e5afcaa6eee7e25\nbuild(java): fix nightly integration test config to run integrations (#465)\n\nThis was only running the units.\nbd69a2aa7b70875f3c988e269706b22fefbef40e\nbuild(java): fix retry_with_backoff when -e option set (#475)\n\n\nd9b173c427bfa0c6cca818233562e7e8841a357c\nfix: record version of working repo in synth.metadata (#473)\n\nPartial revert of b37cf74d12e9a42b9de9e61a4f26133d7cd9c168.\nf73a541770d95a609e5be6bf6b3b220d17cefcbe\nfeat(discogapic): allow local discovery-artifact-manager (#474)\n\n\n8cf0f5d93a70c3dcb0b4999d3152c46d4d9264bf\ndoc: describe the Autosynth & Synthtool protocol (#472)\n\n* doc: describe the Autosynth & Synthtool protocol\n\n* Accommodate review comments.\n980baaa738a1ad8fa02b4fdbd56be075ee77ece5\nfix: pin sphinx to <3.0.0 as new version causes new error (#471)\n\nThe error `toctree contains reference to document changlelog that doesn't have a title: no link will be generated` occurs as of 3.0.0. Pinning to 2.x until we address the docs build issue.\n\nTowards #470\n\nI did this manually for python-datastore https://github.com/googleapis/python-datastore/pull/22\n928b2998ac5023e7c7e254ab935f9ef022455aad\nchore(deps): update dependency com.google.cloud.samples:shared-configuration to v1.0.15 (#466)\n\nCo-authored-by: Jeffrey Rennie \n188f1b1d53181f739b98f8aa5d40cfe99eb90c47\nfix: allow local and external deps to be specified (#469)\n\nModify noxfile.py to allow local and external dependencies for\nsystem tests to be specified.\n" } } ], diff --git a/packages/google-cloud-securitycenter/synth.py b/packages/google-cloud-securitycenter/synth.py index cc29c3de6af..b624c9a2f7c 100644 --- a/packages/google-cloud-securitycenter/synth.py +++ b/packages/google-cloud-securitycenter/synth.py @@ -49,5 +49,5 @@ # Node.js specific cleanup subprocess.run(['npm', 'install']) -subprocess.run(['npm', 'run', 'fix']) +subprocess.run(['npm', 'run', 'lint']) subprocess.run(['npx', 'compileProtos', 'src']) From dd97cff4e811ed48fdd589543b754329be6e07ce Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Sat, 11 Apr 2020 19:15:18 -0700 Subject: [PATCH 165/342] build: remove unused codecov config (#259) --- packages/google-cloud-securitycenter/codecov.yaml | 4 ---- 1 file changed, 4 deletions(-) delete mode 100644 packages/google-cloud-securitycenter/codecov.yaml diff --git a/packages/google-cloud-securitycenter/codecov.yaml b/packages/google-cloud-securitycenter/codecov.yaml deleted file mode 100644 index 5724ea9478d..00000000000 --- a/packages/google-cloud-securitycenter/codecov.yaml +++ /dev/null @@ -1,4 +0,0 @@ ---- -codecov: - ci: - - source.cloud.google.com From 911780f90c9fff3323ace98b78ad1f85897b9e6a Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Mon, 13 Apr 2020 14:57:07 -0700 Subject: [PATCH 166/342] chore: update lint ignore files (#260) --- packages/google-cloud-securitycenter/.eslintignore | 3 ++- packages/google-cloud-securitycenter/.prettierignore | 9 ++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/packages/google-cloud-securitycenter/.eslintignore b/packages/google-cloud-securitycenter/.eslintignore index 09b31fe735a..9340ad9b86d 100644 --- a/packages/google-cloud-securitycenter/.eslintignore +++ b/packages/google-cloud-securitycenter/.eslintignore @@ -1,5 +1,6 @@ **/node_modules -src/**/doc/* +**/coverage +test/fixtures build/ docs/ protos/ diff --git a/packages/google-cloud-securitycenter/.prettierignore b/packages/google-cloud-securitycenter/.prettierignore index f6fac98b0a8..9340ad9b86d 100644 --- a/packages/google-cloud-securitycenter/.prettierignore +++ b/packages/google-cloud-securitycenter/.prettierignore @@ -1,3 +1,6 @@ -node_modules/* -samples/node_modules/* -src/**/doc/* +**/node_modules +**/coverage +test/fixtures +build/ +docs/ +protos/ From 3296f9cb4714317a9eca4a3eae9e2990550b9fa7 Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Mon, 13 Apr 2020 19:32:54 -0700 Subject: [PATCH 167/342] chore: remove tslint.json (#261) --- packages/google-cloud-securitycenter/tslint.json | 3 --- 1 file changed, 3 deletions(-) delete mode 100644 packages/google-cloud-securitycenter/tslint.json diff --git a/packages/google-cloud-securitycenter/tslint.json b/packages/google-cloud-securitycenter/tslint.json deleted file mode 100644 index 617dc975bae..00000000000 --- a/packages/google-cloud-securitycenter/tslint.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "gts/tslint.json" -} From 98925d9cb53c12b681e51018d8c8bbabe55f5897 Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Tue, 14 Apr 2020 09:56:23 -0700 Subject: [PATCH 168/342] chore: remove unused dev packages (#262) --- packages/google-cloud-securitycenter/package.json | 2 -- 1 file changed, 2 deletions(-) diff --git a/packages/google-cloud-securitycenter/package.json b/packages/google-cloud-securitycenter/package.json index b430e8b4fbf..c2c7d1c35a2 100644 --- a/packages/google-cloud-securitycenter/package.json +++ b/packages/google-cloud-securitycenter/package.json @@ -56,8 +56,6 @@ "mocha": "^7.0.0", "null-loader": "^3.0.0", "pack-n-play": "^1.0.0-2", - "power-assert": "^1.4.4", - "prettier": "^1.7.4", "sinon": "^9.0.1", "ts-loader": "^6.2.1", "typescript": "^3.8.3", From 56e4b1ca86c9d218de8419395dabad33e732d7a8 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 15 Apr 2020 17:32:11 +0200 Subject: [PATCH 169/342] chore(deps): update dependency ts-loader to v7 (#263) This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [ts-loader](https://togithub.com/TypeStrong/ts-loader) | devDependencies | major | [`^6.2.1` -> `^7.0.0`](https://renovatebot.com/diffs/npm/ts-loader/6.2.2/7.0.0) | --- ### Release Notes
TypeStrong/ts-loader ### [`v7.0.0`](https://togithub.com/TypeStrong/ts-loader/blob/master/CHANGELOG.md#v700) [Compare Source](https://togithub.com/TypeStrong/ts-loader/compare/v6.2.2...v7.0.0) - [Project reference support enhancements](https://togithub.com/TypeStrong/ts-loader/pull/1076) - thanks [@​sheetalkamat](https://togithub.com/sheetalkamat)! - Following the end of life of Node 8, `ts-loader` no longer supports Node 8 **BREAKING CHANGE**
--- ### Renovate configuration :date: **Schedule**: "after 9am and before 3pm" (UTC). :vertical_traffic_light: **Automerge**: Disabled by config. Please merge this manually once you are satisfied. :recycle: **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. :no_bell: **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#googleapis/nodejs-security-center). --- packages/google-cloud-securitycenter/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-securitycenter/package.json b/packages/google-cloud-securitycenter/package.json index c2c7d1c35a2..32b88d762f9 100644 --- a/packages/google-cloud-securitycenter/package.json +++ b/packages/google-cloud-securitycenter/package.json @@ -57,7 +57,7 @@ "null-loader": "^3.0.0", "pack-n-play": "^1.0.0-2", "sinon": "^9.0.1", - "ts-loader": "^6.2.1", + "ts-loader": "^7.0.0", "typescript": "^3.8.3", "webpack": "^4.41.2", "webpack-cli": "^3.3.10" From bddb270998b5fdd1bc984f5e6d0d30c4cf83840d Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 15 Apr 2020 18:34:07 +0200 Subject: [PATCH 170/342] chore(deps): update dependency null-loader to v4 (#264) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [null-loader](https://togithub.com/webpack-contrib/null-loader) | devDependencies | major | [`^3.0.0` -> `^4.0.0`](https://renovatebot.com/diffs/npm/null-loader/3.0.0/4.0.0) | --- ### Release Notes
webpack-contrib/null-loader ### [`v4.0.0`](https://togithub.com/webpack-contrib/null-loader/blob/master/CHANGELOG.md#​400-httpsgithubcomwebpack-contribnull-loadercomparev300v400-2020-04-15) [Compare Source](https://togithub.com/webpack-contrib/null-loader/compare/v3.0.0...v4.0.0) ##### Bug Fixes - support `webpack@5` ##### ⚠ BREAKING CHANGES - minimum required Nodejs version is `10.13`
--- ### Renovate configuration :date: **Schedule**: "after 9am and before 3pm" (UTC). :vertical_traffic_light: **Automerge**: Disabled by config. Please merge this manually once you are satisfied. :recycle: **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. :no_bell: **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#googleapis/nodejs-security-center). --- packages/google-cloud-securitycenter/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-securitycenter/package.json b/packages/google-cloud-securitycenter/package.json index 32b88d762f9..6996ee694e5 100644 --- a/packages/google-cloud-securitycenter/package.json +++ b/packages/google-cloud-securitycenter/package.json @@ -54,7 +54,7 @@ "jsdoc-region-tag": "^1.0.2", "linkinator": "^2.0.0", "mocha": "^7.0.0", - "null-loader": "^3.0.0", + "null-loader": "^4.0.0", "pack-n-play": "^1.0.0-2", "sinon": "^9.0.1", "ts-loader": "^7.0.0", From 0da4f87991ba9478a2c41000c3a694ffdc33fd5e Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Wed, 15 Apr 2020 10:34:15 -0700 Subject: [PATCH 171/342] chore: run fix instead of lint in synthfile (#266) --- packages/google-cloud-securitycenter/synth.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-securitycenter/synth.py b/packages/google-cloud-securitycenter/synth.py index b624c9a2f7c..cc29c3de6af 100644 --- a/packages/google-cloud-securitycenter/synth.py +++ b/packages/google-cloud-securitycenter/synth.py @@ -49,5 +49,5 @@ # Node.js specific cleanup subprocess.run(['npm', 'install']) -subprocess.run(['npm', 'run', 'lint']) +subprocess.run(['npm', 'run', 'fix']) subprocess.run(['npx', 'compileProtos', 'src']) From 4caae6c208982ccd701c927db9592099ccfa75c6 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Mon, 27 Apr 2020 12:20:15 -0700 Subject: [PATCH 172/342] build: new coverage action (#271) --- .../protos/protos.js | 1118 ++++++++--------- .../src/v1/security_center_client.ts | 22 + .../src/v1beta1/security_center_client.ts | 22 + .../src/v1p1beta1/security_center_client.ts | 22 + .../synth.metadata | 19 +- .../system-test/install.ts | 4 +- 6 files changed, 643 insertions(+), 564 deletions(-) diff --git a/packages/google-cloud-securitycenter/protos/protos.js b/packages/google-cloud-securitycenter/protos/protos.js index 36bde737273..8a6969c26fd 100644 --- a/packages/google-cloud-securitycenter/protos/protos.js +++ b/packages/google-cloud-securitycenter/protos/protos.js @@ -177,22 +177,22 @@ Asset.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.securityCenterProperties != null && message.hasOwnProperty("securityCenterProperties")) + if (message.securityCenterProperties != null && Object.hasOwnProperty.call(message, "securityCenterProperties")) $root.google.cloud.securitycenter.v1.Asset.SecurityCenterProperties.encode(message.securityCenterProperties, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.resourceProperties != null && message.hasOwnProperty("resourceProperties")) + if (message.resourceProperties != null && Object.hasOwnProperty.call(message, "resourceProperties")) for (var keys = Object.keys(message.resourceProperties), i = 0; i < keys.length; ++i) { writer.uint32(/* id 7, wireType 2 =*/58).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); $root.google.protobuf.Value.encode(message.resourceProperties[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); } - if (message.securityMarks != null && message.hasOwnProperty("securityMarks")) + if (message.securityMarks != null && Object.hasOwnProperty.call(message, "securityMarks")) $root.google.cloud.securitycenter.v1.SecurityMarks.encode(message.securityMarks, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.createTime != null && message.hasOwnProperty("createTime")) + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.updateTime != null && message.hasOwnProperty("updateTime")) + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); - if (message.iamPolicy != null && message.hasOwnProperty("iamPolicy")) + if (message.iamPolicy != null && Object.hasOwnProperty.call(message, "iamPolicy")) $root.google.cloud.securitycenter.v1.Asset.IamPolicy.encode(message.iamPolicy, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); return writer; }; @@ -557,22 +557,22 @@ SecurityCenterProperties.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.resourceName != null && message.hasOwnProperty("resourceName")) + if (message.resourceName != null && Object.hasOwnProperty.call(message, "resourceName")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.resourceName); - if (message.resourceType != null && message.hasOwnProperty("resourceType")) + if (message.resourceType != null && Object.hasOwnProperty.call(message, "resourceType")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.resourceType); - if (message.resourceParent != null && message.hasOwnProperty("resourceParent")) + if (message.resourceParent != null && Object.hasOwnProperty.call(message, "resourceParent")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.resourceParent); - if (message.resourceProject != null && message.hasOwnProperty("resourceProject")) + if (message.resourceProject != null && Object.hasOwnProperty.call(message, "resourceProject")) writer.uint32(/* id 4, wireType 2 =*/34).string(message.resourceProject); if (message.resourceOwners != null && message.resourceOwners.length) for (var i = 0; i < message.resourceOwners.length; ++i) writer.uint32(/* id 5, wireType 2 =*/42).string(message.resourceOwners[i]); - if (message.resourceDisplayName != null && message.hasOwnProperty("resourceDisplayName")) + if (message.resourceDisplayName != null && Object.hasOwnProperty.call(message, "resourceDisplayName")) writer.uint32(/* id 6, wireType 2 =*/50).string(message.resourceDisplayName); - if (message.resourceParentDisplayName != null && message.hasOwnProperty("resourceParentDisplayName")) + if (message.resourceParentDisplayName != null && Object.hasOwnProperty.call(message, "resourceParentDisplayName")) writer.uint32(/* id 7, wireType 2 =*/58).string(message.resourceParentDisplayName); - if (message.resourceProjectDisplayName != null && message.hasOwnProperty("resourceProjectDisplayName")) + if (message.resourceProjectDisplayName != null && Object.hasOwnProperty.call(message, "resourceProjectDisplayName")) writer.uint32(/* id 8, wireType 2 =*/66).string(message.resourceProjectDisplayName); return writer; }; @@ -852,7 +852,7 @@ IamPolicy.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.policyBlob != null && message.hasOwnProperty("policyBlob")) + if (message.policyBlob != null && Object.hasOwnProperty.call(message, "policyBlob")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.policyBlob); return writer; }; @@ -1052,9 +1052,9 @@ SecurityMarks.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.marks != null && message.hasOwnProperty("marks")) + if (message.marks != null && Object.hasOwnProperty.call(message, "marks")) for (var keys = Object.keys(message.marks), i = 0; i < keys.length; ++i) writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.marks[keys[i]]).ldelim(); return writer; @@ -1355,28 +1355,28 @@ Finding.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.parent != null && message.hasOwnProperty("parent")) + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.parent); - if (message.resourceName != null && message.hasOwnProperty("resourceName")) + if (message.resourceName != null && Object.hasOwnProperty.call(message, "resourceName")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.resourceName); - if (message.state != null && message.hasOwnProperty("state")) + if (message.state != null && Object.hasOwnProperty.call(message, "state")) writer.uint32(/* id 4, wireType 0 =*/32).int32(message.state); - if (message.category != null && message.hasOwnProperty("category")) + if (message.category != null && Object.hasOwnProperty.call(message, "category")) writer.uint32(/* id 5, wireType 2 =*/42).string(message.category); - if (message.externalUri != null && message.hasOwnProperty("externalUri")) + if (message.externalUri != null && Object.hasOwnProperty.call(message, "externalUri")) writer.uint32(/* id 6, wireType 2 =*/50).string(message.externalUri); - if (message.sourceProperties != null && message.hasOwnProperty("sourceProperties")) + if (message.sourceProperties != null && Object.hasOwnProperty.call(message, "sourceProperties")) for (var keys = Object.keys(message.sourceProperties), i = 0; i < keys.length; ++i) { writer.uint32(/* id 7, wireType 2 =*/58).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); $root.google.protobuf.Value.encode(message.sourceProperties[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); } - if (message.securityMarks != null && message.hasOwnProperty("securityMarks")) + if (message.securityMarks != null && Object.hasOwnProperty.call(message, "securityMarks")) $root.google.cloud.securitycenter.v1.SecurityMarks.encode(message.securityMarks, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.eventTime != null && message.hasOwnProperty("eventTime")) + if (message.eventTime != null && Object.hasOwnProperty.call(message, "eventTime")) $root.google.protobuf.Timestamp.encode(message.eventTime, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.createTime != null && message.hasOwnProperty("createTime")) + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); return writer; }; @@ -1665,7 +1665,7 @@ /** * State enum. * @name google.cloud.securitycenter.v1.Finding.State - * @enum {string} + * @enum {number} * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value * @property {number} ACTIVE=1 ACTIVE value * @property {number} INACTIVE=2 INACTIVE value @@ -1787,15 +1787,15 @@ NotificationConfig.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.description != null && message.hasOwnProperty("description")) + if (message.description != null && Object.hasOwnProperty.call(message, "description")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); - if (message.pubsubTopic != null && message.hasOwnProperty("pubsubTopic")) + if (message.pubsubTopic != null && Object.hasOwnProperty.call(message, "pubsubTopic")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.pubsubTopic); - if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) + if (message.serviceAccount != null && Object.hasOwnProperty.call(message, "serviceAccount")) writer.uint32(/* id 4, wireType 2 =*/34).string(message.serviceAccount); - if (message.streamingConfig != null && message.hasOwnProperty("streamingConfig")) + if (message.streamingConfig != null && Object.hasOwnProperty.call(message, "streamingConfig")) $root.google.cloud.securitycenter.v1.NotificationConfig.StreamingConfig.encode(message.streamingConfig, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); return writer; }; @@ -2035,7 +2035,7 @@ StreamingConfig.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.filter != null && message.hasOwnProperty("filter")) + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.filter); return writer; }; @@ -2248,9 +2248,9 @@ NotificationMessage.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.notificationConfigName != null && message.hasOwnProperty("notificationConfigName")) + if (message.notificationConfigName != null && Object.hasOwnProperty.call(message, "notificationConfigName")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.notificationConfigName); - if (message.finding != null && message.hasOwnProperty("finding")) + if (message.finding != null && Object.hasOwnProperty.call(message, "finding")) $root.google.cloud.securitycenter.v1.Finding.encode(message.finding, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; @@ -2477,11 +2477,11 @@ OrganizationSettings.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.enableAssetDiscovery != null && message.hasOwnProperty("enableAssetDiscovery")) + if (message.enableAssetDiscovery != null && Object.hasOwnProperty.call(message, "enableAssetDiscovery")) writer.uint32(/* id 2, wireType 0 =*/16).bool(message.enableAssetDiscovery); - if (message.assetDiscoveryConfig != null && message.hasOwnProperty("assetDiscoveryConfig")) + if (message.assetDiscoveryConfig != null && Object.hasOwnProperty.call(message, "assetDiscoveryConfig")) $root.google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.encode(message.assetDiscoveryConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; @@ -2706,7 +2706,7 @@ if (message.projectIds != null && message.projectIds.length) for (var i = 0; i < message.projectIds.length; ++i) writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectIds[i]); - if (message.inclusionMode != null && message.hasOwnProperty("inclusionMode")) + if (message.inclusionMode != null && Object.hasOwnProperty.call(message, "inclusionMode")) writer.uint32(/* id 2, wireType 0 =*/16).int32(message.inclusionMode); return writer; }; @@ -2881,7 +2881,7 @@ /** * InclusionMode enum. * @name google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode - * @enum {string} + * @enum {number} * @property {number} INCLUSION_MODE_UNSPECIFIED=0 INCLUSION_MODE_UNSPECIFIED value * @property {number} INCLUDE_ONLY=1 INCLUDE_ONLY value * @property {number} EXCLUDE=2 EXCLUDE value @@ -2965,9 +2965,9 @@ RunAssetDiscoveryResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.state != null && message.hasOwnProperty("state")) + if (message.state != null && Object.hasOwnProperty.call(message, "state")) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.state); - if (message.duration != null && message.hasOwnProperty("duration")) + if (message.duration != null && Object.hasOwnProperty.call(message, "duration")) $root.google.protobuf.Duration.encode(message.duration, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; @@ -3138,7 +3138,7 @@ /** * State enum. * @name google.cloud.securitycenter.v1.RunAssetDiscoveryResponse.State - * @enum {string} + * @enum {number} * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value * @property {number} COMPLETED=1 COMPLETED value * @property {number} SUPERSEDED=2 SUPERSEDED value @@ -4024,11 +4024,11 @@ CreateFindingRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && message.hasOwnProperty("parent")) + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.findingId != null && message.hasOwnProperty("findingId")) + if (message.findingId != null && Object.hasOwnProperty.call(message, "findingId")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.findingId); - if (message.finding != null && message.hasOwnProperty("finding")) + if (message.finding != null && Object.hasOwnProperty.call(message, "finding")) $root.google.cloud.securitycenter.v1.Finding.encode(message.finding, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; @@ -4261,11 +4261,11 @@ CreateNotificationConfigRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && message.hasOwnProperty("parent")) + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.configId != null && message.hasOwnProperty("configId")) + if (message.configId != null && Object.hasOwnProperty.call(message, "configId")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.configId); - if (message.notificationConfig != null && message.hasOwnProperty("notificationConfig")) + if (message.notificationConfig != null && Object.hasOwnProperty.call(message, "notificationConfig")) $root.google.cloud.securitycenter.v1.NotificationConfig.encode(message.notificationConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; @@ -4489,9 +4489,9 @@ CreateSourceRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && message.hasOwnProperty("parent")) + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.source != null && message.hasOwnProperty("source")) + if (message.source != null && Object.hasOwnProperty.call(message, "source")) $root.google.cloud.securitycenter.v1.Source.encode(message.source, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; @@ -4695,7 +4695,7 @@ DeleteNotificationConfigRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; @@ -4882,7 +4882,7 @@ GetNotificationConfigRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; @@ -5069,7 +5069,7 @@ GetOrganizationSettingsRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; @@ -5256,7 +5256,7 @@ GetSourceRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; @@ -5497,19 +5497,19 @@ GroupAssetsRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && message.hasOwnProperty("parent")) + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.filter != null && message.hasOwnProperty("filter")) + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); - if (message.groupBy != null && message.hasOwnProperty("groupBy")) + if (message.groupBy != null && Object.hasOwnProperty.call(message, "groupBy")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.groupBy); - if (message.compareDuration != null && message.hasOwnProperty("compareDuration")) + if (message.compareDuration != null && Object.hasOwnProperty.call(message, "compareDuration")) $root.google.protobuf.Duration.encode(message.compareDuration, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.readTime != null && message.hasOwnProperty("readTime")) + if (message.readTime != null && Object.hasOwnProperty.call(message, "readTime")) $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) writer.uint32(/* id 7, wireType 2 =*/58).string(message.pageToken); - if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) writer.uint32(/* id 8, wireType 0 =*/64).int32(message.pageSize); return writer; }; @@ -5804,11 +5804,11 @@ if (message.groupByResults != null && message.groupByResults.length) for (var i = 0; i < message.groupByResults.length; ++i) $root.google.cloud.securitycenter.v1.GroupResult.encode(message.groupByResults[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.readTime != null && message.hasOwnProperty("readTime")) + if (message.readTime != null && Object.hasOwnProperty.call(message, "readTime")) $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.nextPageToken); - if (message.totalSize != null && message.hasOwnProperty("totalSize")) + if (message.totalSize != null && Object.hasOwnProperty.call(message, "totalSize")) writer.uint32(/* id 4, wireType 0 =*/32).int32(message.totalSize); return writer; }; @@ -6108,19 +6108,19 @@ GroupFindingsRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && message.hasOwnProperty("parent")) + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.filter != null && message.hasOwnProperty("filter")) + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); - if (message.groupBy != null && message.hasOwnProperty("groupBy")) + if (message.groupBy != null && Object.hasOwnProperty.call(message, "groupBy")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.groupBy); - if (message.readTime != null && message.hasOwnProperty("readTime")) + if (message.readTime != null && Object.hasOwnProperty.call(message, "readTime")) $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.compareDuration != null && message.hasOwnProperty("compareDuration")) + if (message.compareDuration != null && Object.hasOwnProperty.call(message, "compareDuration")) $root.google.protobuf.Duration.encode(message.compareDuration, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) writer.uint32(/* id 7, wireType 2 =*/58).string(message.pageToken); - if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) writer.uint32(/* id 8, wireType 0 =*/64).int32(message.pageSize); return writer; }; @@ -6415,11 +6415,11 @@ if (message.groupByResults != null && message.groupByResults.length) for (var i = 0; i < message.groupByResults.length; ++i) $root.google.cloud.securitycenter.v1.GroupResult.encode(message.groupByResults[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.readTime != null && message.hasOwnProperty("readTime")) + if (message.readTime != null && Object.hasOwnProperty.call(message, "readTime")) $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.nextPageToken); - if (message.totalSize != null && message.hasOwnProperty("totalSize")) + if (message.totalSize != null && Object.hasOwnProperty.call(message, "totalSize")) writer.uint32(/* id 4, wireType 0 =*/32).int32(message.totalSize); return writer; }; @@ -6675,12 +6675,12 @@ GroupResult.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.properties != null && message.hasOwnProperty("properties")) + if (message.properties != null && Object.hasOwnProperty.call(message, "properties")) for (var keys = Object.keys(message.properties), i = 0; i < keys.length; ++i) { writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); $root.google.protobuf.Value.encode(message.properties[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); } - if (message.count != null && message.hasOwnProperty("count")) + if (message.count != null && Object.hasOwnProperty.call(message, "count")) writer.uint32(/* id 2, wireType 0 =*/16).int64(message.count); return writer; }; @@ -6935,11 +6935,11 @@ ListNotificationConfigsRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && message.hasOwnProperty("parent")) + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.pageToken); - if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); return writer; }; @@ -7162,7 +7162,7 @@ if (message.notificationConfigs != null && message.notificationConfigs.length) for (var i = 0; i < message.notificationConfigs.length; ++i) $root.google.cloud.securitycenter.v1.NotificationConfig.encode(message.notificationConfigs[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); return writer; }; @@ -7398,11 +7398,11 @@ ListSourcesRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && message.hasOwnProperty("parent")) + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.pageToken); - if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) writer.uint32(/* id 7, wireType 0 =*/56).int32(message.pageSize); return writer; }; @@ -7625,7 +7625,7 @@ if (message.sources != null && message.sources.length) for (var i = 0; i < message.sources.length; ++i) $root.google.cloud.securitycenter.v1.Source.encode(message.sources[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); return writer; }; @@ -7906,21 +7906,21 @@ ListAssetsRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && message.hasOwnProperty("parent")) + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.filter != null && message.hasOwnProperty("filter")) + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); - if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.orderBy); - if (message.readTime != null && message.hasOwnProperty("readTime")) + if (message.readTime != null && Object.hasOwnProperty.call(message, "readTime")) $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.compareDuration != null && message.hasOwnProperty("compareDuration")) + if (message.compareDuration != null && Object.hasOwnProperty.call(message, "compareDuration")) $root.google.protobuf.Duration.encode(message.compareDuration, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.fieldMask != null && message.hasOwnProperty("fieldMask")) + if (message.fieldMask != null && Object.hasOwnProperty.call(message, "fieldMask")) $root.google.protobuf.FieldMask.encode(message.fieldMask, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) writer.uint32(/* id 8, wireType 2 =*/66).string(message.pageToken); - if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) writer.uint32(/* id 9, wireType 0 =*/72).int32(message.pageSize); return writer; }; @@ -8231,11 +8231,11 @@ if (message.listAssetsResults != null && message.listAssetsResults.length) for (var i = 0; i < message.listAssetsResults.length; ++i) $root.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult.encode(message.listAssetsResults[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.readTime != null && message.hasOwnProperty("readTime")) + if (message.readTime != null && Object.hasOwnProperty.call(message, "readTime")) $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.nextPageToken); - if (message.totalSize != null && message.hasOwnProperty("totalSize")) + if (message.totalSize != null && Object.hasOwnProperty.call(message, "totalSize")) writer.uint32(/* id 4, wireType 0 =*/32).int32(message.totalSize); return writer; }; @@ -8487,9 +8487,9 @@ ListAssetsResult.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.asset != null && message.hasOwnProperty("asset")) + if (message.asset != null && Object.hasOwnProperty.call(message, "asset")) $root.google.cloud.securitycenter.v1.Asset.encode(message.asset, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.stateChange != null && message.hasOwnProperty("stateChange")) + if (message.stateChange != null && Object.hasOwnProperty.call(message, "stateChange")) writer.uint32(/* id 2, wireType 0 =*/16).int32(message.stateChange); return writer; }; @@ -8660,7 +8660,7 @@ /** * StateChange enum. * @name google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult.StateChange - * @enum {string} + * @enum {number} * @property {number} UNUSED=0 UNUSED value * @property {number} ADDED=1 ADDED value * @property {number} REMOVED=2 REMOVED value @@ -8800,21 +8800,21 @@ ListFindingsRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && message.hasOwnProperty("parent")) + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.filter != null && message.hasOwnProperty("filter")) + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); - if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.orderBy); - if (message.readTime != null && message.hasOwnProperty("readTime")) + if (message.readTime != null && Object.hasOwnProperty.call(message, "readTime")) $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.compareDuration != null && message.hasOwnProperty("compareDuration")) + if (message.compareDuration != null && Object.hasOwnProperty.call(message, "compareDuration")) $root.google.protobuf.Duration.encode(message.compareDuration, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.fieldMask != null && message.hasOwnProperty("fieldMask")) + if (message.fieldMask != null && Object.hasOwnProperty.call(message, "fieldMask")) $root.google.protobuf.FieldMask.encode(message.fieldMask, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) writer.uint32(/* id 8, wireType 2 =*/66).string(message.pageToken); - if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) writer.uint32(/* id 9, wireType 0 =*/72).int32(message.pageSize); return writer; }; @@ -9125,11 +9125,11 @@ if (message.listFindingsResults != null && message.listFindingsResults.length) for (var i = 0; i < message.listFindingsResults.length; ++i) $root.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.encode(message.listFindingsResults[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.readTime != null && message.hasOwnProperty("readTime")) + if (message.readTime != null && Object.hasOwnProperty.call(message, "readTime")) $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.nextPageToken); - if (message.totalSize != null && message.hasOwnProperty("totalSize")) + if (message.totalSize != null && Object.hasOwnProperty.call(message, "totalSize")) writer.uint32(/* id 4, wireType 0 =*/32).int32(message.totalSize); return writer; }; @@ -9390,11 +9390,11 @@ ListFindingsResult.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.finding != null && message.hasOwnProperty("finding")) + if (message.finding != null && Object.hasOwnProperty.call(message, "finding")) $root.google.cloud.securitycenter.v1.Finding.encode(message.finding, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.stateChange != null && message.hasOwnProperty("stateChange")) + if (message.stateChange != null && Object.hasOwnProperty.call(message, "stateChange")) writer.uint32(/* id 2, wireType 0 =*/16).int32(message.stateChange); - if (message.resource != null && message.hasOwnProperty("resource")) + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) $root.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource.encode(message.resource, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; @@ -9675,15 +9675,15 @@ Resource.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.projectName != null && message.hasOwnProperty("projectName")) + if (message.projectName != null && Object.hasOwnProperty.call(message, "projectName")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.projectName); - if (message.projectDisplayName != null && message.hasOwnProperty("projectDisplayName")) + if (message.projectDisplayName != null && Object.hasOwnProperty.call(message, "projectDisplayName")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.projectDisplayName); - if (message.parentName != null && message.hasOwnProperty("parentName")) + if (message.parentName != null && Object.hasOwnProperty.call(message, "parentName")) writer.uint32(/* id 4, wireType 2 =*/34).string(message.parentName); - if (message.parentDisplayName != null && message.hasOwnProperty("parentDisplayName")) + if (message.parentDisplayName != null && Object.hasOwnProperty.call(message, "parentDisplayName")) writer.uint32(/* id 5, wireType 2 =*/42).string(message.parentDisplayName); return writer; }; @@ -9862,7 +9862,7 @@ /** * StateChange enum. * @name google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.StateChange - * @enum {string} + * @enum {number} * @property {number} UNUSED=0 UNUSED value * @property {number} CHANGED=1 CHANGED value * @property {number} UNCHANGED=2 UNCHANGED value @@ -9959,11 +9959,11 @@ SetFindingStateRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.state != null && message.hasOwnProperty("state")) + if (message.state != null && Object.hasOwnProperty.call(message, "state")) writer.uint32(/* id 2, wireType 0 =*/16).int32(message.state); - if (message.startTime != null && message.hasOwnProperty("startTime")) + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; @@ -10196,7 +10196,7 @@ RunAssetDiscoveryRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && message.hasOwnProperty("parent")) + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); return writer; }; @@ -10392,9 +10392,9 @@ UpdateFindingRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.finding != null && message.hasOwnProperty("finding")) + if (message.finding != null && Object.hasOwnProperty.call(message, "finding")) $root.google.cloud.securitycenter.v1.Finding.encode(message.finding, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; @@ -10612,9 +10612,9 @@ UpdateNotificationConfigRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.notificationConfig != null && message.hasOwnProperty("notificationConfig")) + if (message.notificationConfig != null && Object.hasOwnProperty.call(message, "notificationConfig")) $root.google.cloud.securitycenter.v1.NotificationConfig.encode(message.notificationConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; @@ -10832,9 +10832,9 @@ UpdateOrganizationSettingsRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.organizationSettings != null && message.hasOwnProperty("organizationSettings")) + if (message.organizationSettings != null && Object.hasOwnProperty.call(message, "organizationSettings")) $root.google.cloud.securitycenter.v1.OrganizationSettings.encode(message.organizationSettings, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; @@ -11052,9 +11052,9 @@ UpdateSourceRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.source != null && message.hasOwnProperty("source")) + if (message.source != null && Object.hasOwnProperty.call(message, "source")) $root.google.cloud.securitycenter.v1.Source.encode(message.source, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; @@ -11281,11 +11281,11 @@ UpdateSecurityMarksRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.securityMarks != null && message.hasOwnProperty("securityMarks")) + if (message.securityMarks != null && Object.hasOwnProperty.call(message, "securityMarks")) $root.google.cloud.securitycenter.v1.SecurityMarks.encode(message.securityMarks, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.startTime != null && message.hasOwnProperty("startTime")) + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; @@ -11528,11 +11528,11 @@ Source.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.displayName != null && message.hasOwnProperty("displayName")) + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); - if (message.description != null && message.hasOwnProperty("description")) + if (message.description != null && Object.hasOwnProperty.call(message, "description")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); return writer; }; @@ -11800,20 +11800,20 @@ Asset.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.securityCenterProperties != null && message.hasOwnProperty("securityCenterProperties")) + if (message.securityCenterProperties != null && Object.hasOwnProperty.call(message, "securityCenterProperties")) $root.google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties.encode(message.securityCenterProperties, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.resourceProperties != null && message.hasOwnProperty("resourceProperties")) + if (message.resourceProperties != null && Object.hasOwnProperty.call(message, "resourceProperties")) for (var keys = Object.keys(message.resourceProperties), i = 0; i < keys.length; ++i) { writer.uint32(/* id 7, wireType 2 =*/58).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); $root.google.protobuf.Value.encode(message.resourceProperties[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); } - if (message.securityMarks != null && message.hasOwnProperty("securityMarks")) + if (message.securityMarks != null && Object.hasOwnProperty.call(message, "securityMarks")) $root.google.cloud.securitycenter.v1beta1.SecurityMarks.encode(message.securityMarks, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.createTime != null && message.hasOwnProperty("createTime")) + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.updateTime != null && message.hasOwnProperty("updateTime")) + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); return writer; }; @@ -12135,13 +12135,13 @@ SecurityCenterProperties.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.resourceName != null && message.hasOwnProperty("resourceName")) + if (message.resourceName != null && Object.hasOwnProperty.call(message, "resourceName")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.resourceName); - if (message.resourceType != null && message.hasOwnProperty("resourceType")) + if (message.resourceType != null && Object.hasOwnProperty.call(message, "resourceType")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.resourceType); - if (message.resourceParent != null && message.hasOwnProperty("resourceParent")) + if (message.resourceParent != null && Object.hasOwnProperty.call(message, "resourceParent")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.resourceParent); - if (message.resourceProject != null && message.hasOwnProperty("resourceProject")) + if (message.resourceProject != null && Object.hasOwnProperty.call(message, "resourceProject")) writer.uint32(/* id 4, wireType 2 =*/34).string(message.resourceProject); if (message.resourceOwners != null && message.resourceOwners.length) for (var i = 0; i < message.resourceOwners.length; ++i) @@ -12404,9 +12404,9 @@ SecurityMarks.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.marks != null && message.hasOwnProperty("marks")) + if (message.marks != null && Object.hasOwnProperty.call(message, "marks")) for (var keys = Object.keys(message.marks), i = 0; i < keys.length; ++i) writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.marks[keys[i]]).ldelim(); return writer; @@ -12707,28 +12707,28 @@ Finding.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.parent != null && message.hasOwnProperty("parent")) + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.parent); - if (message.resourceName != null && message.hasOwnProperty("resourceName")) + if (message.resourceName != null && Object.hasOwnProperty.call(message, "resourceName")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.resourceName); - if (message.state != null && message.hasOwnProperty("state")) + if (message.state != null && Object.hasOwnProperty.call(message, "state")) writer.uint32(/* id 4, wireType 0 =*/32).int32(message.state); - if (message.category != null && message.hasOwnProperty("category")) + if (message.category != null && Object.hasOwnProperty.call(message, "category")) writer.uint32(/* id 5, wireType 2 =*/42).string(message.category); - if (message.externalUri != null && message.hasOwnProperty("externalUri")) + if (message.externalUri != null && Object.hasOwnProperty.call(message, "externalUri")) writer.uint32(/* id 6, wireType 2 =*/50).string(message.externalUri); - if (message.sourceProperties != null && message.hasOwnProperty("sourceProperties")) + if (message.sourceProperties != null && Object.hasOwnProperty.call(message, "sourceProperties")) for (var keys = Object.keys(message.sourceProperties), i = 0; i < keys.length; ++i) { writer.uint32(/* id 7, wireType 2 =*/58).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); $root.google.protobuf.Value.encode(message.sourceProperties[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); } - if (message.securityMarks != null && message.hasOwnProperty("securityMarks")) + if (message.securityMarks != null && Object.hasOwnProperty.call(message, "securityMarks")) $root.google.cloud.securitycenter.v1beta1.SecurityMarks.encode(message.securityMarks, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.eventTime != null && message.hasOwnProperty("eventTime")) + if (message.eventTime != null && Object.hasOwnProperty.call(message, "eventTime")) $root.google.protobuf.Timestamp.encode(message.eventTime, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.createTime != null && message.hasOwnProperty("createTime")) + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); return writer; }; @@ -13017,7 +13017,7 @@ /** * State enum. * @name google.cloud.securitycenter.v1beta1.Finding.State - * @enum {string} + * @enum {number} * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value * @property {number} ACTIVE=1 ACTIVE value * @property {number} INACTIVE=2 INACTIVE value @@ -13107,11 +13107,11 @@ OrganizationSettings.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.enableAssetDiscovery != null && message.hasOwnProperty("enableAssetDiscovery")) + if (message.enableAssetDiscovery != null && Object.hasOwnProperty.call(message, "enableAssetDiscovery")) writer.uint32(/* id 2, wireType 0 =*/16).bool(message.enableAssetDiscovery); - if (message.assetDiscoveryConfig != null && message.hasOwnProperty("assetDiscoveryConfig")) + if (message.assetDiscoveryConfig != null && Object.hasOwnProperty.call(message, "assetDiscoveryConfig")) $root.google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig.encode(message.assetDiscoveryConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; @@ -13336,7 +13336,7 @@ if (message.projectIds != null && message.projectIds.length) for (var i = 0; i < message.projectIds.length; ++i) writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectIds[i]); - if (message.inclusionMode != null && message.hasOwnProperty("inclusionMode")) + if (message.inclusionMode != null && Object.hasOwnProperty.call(message, "inclusionMode")) writer.uint32(/* id 2, wireType 0 =*/16).int32(message.inclusionMode); return writer; }; @@ -13511,7 +13511,7 @@ /** * InclusionMode enum. * @name google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode - * @enum {string} + * @enum {number} * @property {number} INCLUSION_MODE_UNSPECIFIED=0 INCLUSION_MODE_UNSPECIFIED value * @property {number} INCLUDE_ONLY=1 INCLUDE_ONLY value * @property {number} EXCLUDE=2 EXCLUDE value @@ -13595,9 +13595,9 @@ RunAssetDiscoveryResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.state != null && message.hasOwnProperty("state")) + if (message.state != null && Object.hasOwnProperty.call(message, "state")) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.state); - if (message.duration != null && message.hasOwnProperty("duration")) + if (message.duration != null && Object.hasOwnProperty.call(message, "duration")) $root.google.protobuf.Duration.encode(message.duration, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; @@ -13768,7 +13768,7 @@ /** * State enum. * @name google.cloud.securitycenter.v1beta1.RunAssetDiscoveryResponse.State - * @enum {string} + * @enum {number} * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value * @property {number} COMPLETED=1 COMPLETED value * @property {number} SUPERSEDED=2 SUPERSEDED value @@ -14489,11 +14489,11 @@ CreateFindingRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && message.hasOwnProperty("parent")) + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.findingId != null && message.hasOwnProperty("findingId")) + if (message.findingId != null && Object.hasOwnProperty.call(message, "findingId")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.findingId); - if (message.finding != null && message.hasOwnProperty("finding")) + if (message.finding != null && Object.hasOwnProperty.call(message, "finding")) $root.google.cloud.securitycenter.v1beta1.Finding.encode(message.finding, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; @@ -14717,9 +14717,9 @@ CreateSourceRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && message.hasOwnProperty("parent")) + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.source != null && message.hasOwnProperty("source")) + if (message.source != null && Object.hasOwnProperty.call(message, "source")) $root.google.cloud.securitycenter.v1beta1.Source.encode(message.source, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; @@ -14923,7 +14923,7 @@ GetOrganizationSettingsRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; @@ -15110,7 +15110,7 @@ GetSourceRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; @@ -15351,19 +15351,19 @@ GroupAssetsRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && message.hasOwnProperty("parent")) + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.filter != null && message.hasOwnProperty("filter")) + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); - if (message.groupBy != null && message.hasOwnProperty("groupBy")) + if (message.groupBy != null && Object.hasOwnProperty.call(message, "groupBy")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.groupBy); - if (message.compareDuration != null && message.hasOwnProperty("compareDuration")) + if (message.compareDuration != null && Object.hasOwnProperty.call(message, "compareDuration")) $root.google.protobuf.Duration.encode(message.compareDuration, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.readTime != null && message.hasOwnProperty("readTime")) + if (message.readTime != null && Object.hasOwnProperty.call(message, "readTime")) $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) writer.uint32(/* id 7, wireType 2 =*/58).string(message.pageToken); - if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) writer.uint32(/* id 8, wireType 0 =*/64).int32(message.pageSize); return writer; }; @@ -15649,9 +15649,9 @@ if (message.groupByResults != null && message.groupByResults.length) for (var i = 0; i < message.groupByResults.length; ++i) $root.google.cloud.securitycenter.v1beta1.GroupResult.encode(message.groupByResults[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.readTime != null && message.hasOwnProperty("readTime")) + if (message.readTime != null && Object.hasOwnProperty.call(message, "readTime")) $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.nextPageToken); return writer; }; @@ -15931,17 +15931,17 @@ GroupFindingsRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && message.hasOwnProperty("parent")) + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.filter != null && message.hasOwnProperty("filter")) + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); - if (message.groupBy != null && message.hasOwnProperty("groupBy")) + if (message.groupBy != null && Object.hasOwnProperty.call(message, "groupBy")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.groupBy); - if (message.readTime != null && message.hasOwnProperty("readTime")) + if (message.readTime != null && Object.hasOwnProperty.call(message, "readTime")) $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) writer.uint32(/* id 5, wireType 2 =*/42).string(message.pageToken); - if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) writer.uint32(/* id 6, wireType 0 =*/48).int32(message.pageSize); return writer; }; @@ -16211,9 +16211,9 @@ if (message.groupByResults != null && message.groupByResults.length) for (var i = 0; i < message.groupByResults.length; ++i) $root.google.cloud.securitycenter.v1beta1.GroupResult.encode(message.groupByResults[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.readTime != null && message.hasOwnProperty("readTime")) + if (message.readTime != null && Object.hasOwnProperty.call(message, "readTime")) $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.nextPageToken); return writer; }; @@ -16458,12 +16458,12 @@ GroupResult.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.properties != null && message.hasOwnProperty("properties")) + if (message.properties != null && Object.hasOwnProperty.call(message, "properties")) for (var keys = Object.keys(message.properties), i = 0; i < keys.length; ++i) { writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); $root.google.protobuf.Value.encode(message.properties[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); } - if (message.count != null && message.hasOwnProperty("count")) + if (message.count != null && Object.hasOwnProperty.call(message, "count")) writer.uint32(/* id 2, wireType 0 =*/16).int64(message.count); return writer; }; @@ -16718,11 +16718,11 @@ ListSourcesRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && message.hasOwnProperty("parent")) + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.pageToken); - if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) writer.uint32(/* id 7, wireType 0 =*/56).int32(message.pageSize); return writer; }; @@ -16945,7 +16945,7 @@ if (message.sources != null && message.sources.length) for (var i = 0; i < message.sources.length; ++i) $root.google.cloud.securitycenter.v1beta1.Source.encode(message.sources[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); return writer; }; @@ -17226,21 +17226,21 @@ ListAssetsRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && message.hasOwnProperty("parent")) + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.filter != null && message.hasOwnProperty("filter")) + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); - if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.orderBy); - if (message.readTime != null && message.hasOwnProperty("readTime")) + if (message.readTime != null && Object.hasOwnProperty.call(message, "readTime")) $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.compareDuration != null && message.hasOwnProperty("compareDuration")) + if (message.compareDuration != null && Object.hasOwnProperty.call(message, "compareDuration")) $root.google.protobuf.Duration.encode(message.compareDuration, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.fieldMask != null && message.hasOwnProperty("fieldMask")) + if (message.fieldMask != null && Object.hasOwnProperty.call(message, "fieldMask")) $root.google.protobuf.FieldMask.encode(message.fieldMask, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) writer.uint32(/* id 8, wireType 2 =*/66).string(message.pageToken); - if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) writer.uint32(/* id 9, wireType 0 =*/72).int32(message.pageSize); return writer; }; @@ -17551,11 +17551,11 @@ if (message.listAssetsResults != null && message.listAssetsResults.length) for (var i = 0; i < message.listAssetsResults.length; ++i) $root.google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult.encode(message.listAssetsResults[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.readTime != null && message.hasOwnProperty("readTime")) + if (message.readTime != null && Object.hasOwnProperty.call(message, "readTime")) $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.nextPageToken); - if (message.totalSize != null && message.hasOwnProperty("totalSize")) + if (message.totalSize != null && Object.hasOwnProperty.call(message, "totalSize")) writer.uint32(/* id 4, wireType 0 =*/32).int32(message.totalSize); return writer; }; @@ -17807,9 +17807,9 @@ ListAssetsResult.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.asset != null && message.hasOwnProperty("asset")) + if (message.asset != null && Object.hasOwnProperty.call(message, "asset")) $root.google.cloud.securitycenter.v1beta1.Asset.encode(message.asset, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.state != null && message.hasOwnProperty("state")) + if (message.state != null && Object.hasOwnProperty.call(message, "state")) writer.uint32(/* id 2, wireType 0 =*/16).int32(message.state); return writer; }; @@ -17985,7 +17985,7 @@ /** * State enum. * @name google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult.State - * @enum {string} + * @enum {number} * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value * @property {number} UNUSED=1 UNUSED value * @property {number} ADDED=2 ADDED value @@ -18118,19 +18118,19 @@ ListFindingsRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && message.hasOwnProperty("parent")) + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.filter != null && message.hasOwnProperty("filter")) + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); - if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.orderBy); - if (message.readTime != null && message.hasOwnProperty("readTime")) + if (message.readTime != null && Object.hasOwnProperty.call(message, "readTime")) $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.fieldMask != null && message.hasOwnProperty("fieldMask")) + if (message.fieldMask != null && Object.hasOwnProperty.call(message, "fieldMask")) $root.google.protobuf.FieldMask.encode(message.fieldMask, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) writer.uint32(/* id 6, wireType 2 =*/50).string(message.pageToken); - if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) writer.uint32(/* id 7, wireType 0 =*/56).int32(message.pageSize); return writer; }; @@ -18425,11 +18425,11 @@ if (message.findings != null && message.findings.length) for (var i = 0; i < message.findings.length; ++i) $root.google.cloud.securitycenter.v1beta1.Finding.encode(message.findings[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.readTime != null && message.hasOwnProperty("readTime")) + if (message.readTime != null && Object.hasOwnProperty.call(message, "readTime")) $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.nextPageToken); - if (message.totalSize != null && message.hasOwnProperty("totalSize")) + if (message.totalSize != null && Object.hasOwnProperty.call(message, "totalSize")) writer.uint32(/* id 4, wireType 0 =*/32).int32(message.totalSize); return writer; }; @@ -18693,11 +18693,11 @@ SetFindingStateRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.state != null && message.hasOwnProperty("state")) + if (message.state != null && Object.hasOwnProperty.call(message, "state")) writer.uint32(/* id 2, wireType 0 =*/16).int32(message.state); - if (message.startTime != null && message.hasOwnProperty("startTime")) + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; @@ -18930,7 +18930,7 @@ RunAssetDiscoveryRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && message.hasOwnProperty("parent")) + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); return writer; }; @@ -19126,9 +19126,9 @@ UpdateFindingRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.finding != null && message.hasOwnProperty("finding")) + if (message.finding != null && Object.hasOwnProperty.call(message, "finding")) $root.google.cloud.securitycenter.v1beta1.Finding.encode(message.finding, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; @@ -19346,9 +19346,9 @@ UpdateOrganizationSettingsRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.organizationSettings != null && message.hasOwnProperty("organizationSettings")) + if (message.organizationSettings != null && Object.hasOwnProperty.call(message, "organizationSettings")) $root.google.cloud.securitycenter.v1beta1.OrganizationSettings.encode(message.organizationSettings, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; @@ -19566,9 +19566,9 @@ UpdateSourceRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.source != null && message.hasOwnProperty("source")) + if (message.source != null && Object.hasOwnProperty.call(message, "source")) $root.google.cloud.securitycenter.v1beta1.Source.encode(message.source, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; @@ -19795,11 +19795,11 @@ UpdateSecurityMarksRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.securityMarks != null && message.hasOwnProperty("securityMarks")) + if (message.securityMarks != null && Object.hasOwnProperty.call(message, "securityMarks")) $root.google.cloud.securitycenter.v1beta1.SecurityMarks.encode(message.securityMarks, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.startTime != null && message.hasOwnProperty("startTime")) + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; @@ -20042,11 +20042,11 @@ Source.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.displayName != null && message.hasOwnProperty("displayName")) + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); - if (message.description != null && message.hasOwnProperty("description")) + if (message.description != null && Object.hasOwnProperty.call(message, "description")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); return writer; }; @@ -20323,22 +20323,22 @@ Asset.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.securityCenterProperties != null && message.hasOwnProperty("securityCenterProperties")) + if (message.securityCenterProperties != null && Object.hasOwnProperty.call(message, "securityCenterProperties")) $root.google.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterProperties.encode(message.securityCenterProperties, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.resourceProperties != null && message.hasOwnProperty("resourceProperties")) + if (message.resourceProperties != null && Object.hasOwnProperty.call(message, "resourceProperties")) for (var keys = Object.keys(message.resourceProperties), i = 0; i < keys.length; ++i) { writer.uint32(/* id 7, wireType 2 =*/58).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); $root.google.protobuf.Value.encode(message.resourceProperties[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); } - if (message.securityMarks != null && message.hasOwnProperty("securityMarks")) + if (message.securityMarks != null && Object.hasOwnProperty.call(message, "securityMarks")) $root.google.cloud.securitycenter.v1p1beta1.SecurityMarks.encode(message.securityMarks, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.createTime != null && message.hasOwnProperty("createTime")) + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.updateTime != null && message.hasOwnProperty("updateTime")) + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); - if (message.iamPolicy != null && message.hasOwnProperty("iamPolicy")) + if (message.iamPolicy != null && Object.hasOwnProperty.call(message, "iamPolicy")) $root.google.cloud.securitycenter.v1p1beta1.Asset.IamPolicy.encode(message.iamPolicy, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); return writer; }; @@ -20703,22 +20703,22 @@ SecurityCenterProperties.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.resourceName != null && message.hasOwnProperty("resourceName")) + if (message.resourceName != null && Object.hasOwnProperty.call(message, "resourceName")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.resourceName); - if (message.resourceType != null && message.hasOwnProperty("resourceType")) + if (message.resourceType != null && Object.hasOwnProperty.call(message, "resourceType")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.resourceType); - if (message.resourceParent != null && message.hasOwnProperty("resourceParent")) + if (message.resourceParent != null && Object.hasOwnProperty.call(message, "resourceParent")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.resourceParent); - if (message.resourceProject != null && message.hasOwnProperty("resourceProject")) + if (message.resourceProject != null && Object.hasOwnProperty.call(message, "resourceProject")) writer.uint32(/* id 4, wireType 2 =*/34).string(message.resourceProject); if (message.resourceOwners != null && message.resourceOwners.length) for (var i = 0; i < message.resourceOwners.length; ++i) writer.uint32(/* id 5, wireType 2 =*/42).string(message.resourceOwners[i]); - if (message.resourceDisplayName != null && message.hasOwnProperty("resourceDisplayName")) + if (message.resourceDisplayName != null && Object.hasOwnProperty.call(message, "resourceDisplayName")) writer.uint32(/* id 6, wireType 2 =*/50).string(message.resourceDisplayName); - if (message.resourceParentDisplayName != null && message.hasOwnProperty("resourceParentDisplayName")) + if (message.resourceParentDisplayName != null && Object.hasOwnProperty.call(message, "resourceParentDisplayName")) writer.uint32(/* id 7, wireType 2 =*/58).string(message.resourceParentDisplayName); - if (message.resourceProjectDisplayName != null && message.hasOwnProperty("resourceProjectDisplayName")) + if (message.resourceProjectDisplayName != null && Object.hasOwnProperty.call(message, "resourceProjectDisplayName")) writer.uint32(/* id 8, wireType 2 =*/66).string(message.resourceProjectDisplayName); return writer; }; @@ -20998,7 +20998,7 @@ IamPolicy.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.policyBlob != null && message.hasOwnProperty("policyBlob")) + if (message.policyBlob != null && Object.hasOwnProperty.call(message, "policyBlob")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.policyBlob); return writer; }; @@ -21198,9 +21198,9 @@ SecurityMarks.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.marks != null && message.hasOwnProperty("marks")) + if (message.marks != null && Object.hasOwnProperty.call(message, "marks")) for (var keys = Object.keys(message.marks), i = 0; i < keys.length; ++i) writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.marks[keys[i]]).ldelim(); return writer; @@ -21501,28 +21501,28 @@ Finding.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.parent != null && message.hasOwnProperty("parent")) + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.parent); - if (message.resourceName != null && message.hasOwnProperty("resourceName")) + if (message.resourceName != null && Object.hasOwnProperty.call(message, "resourceName")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.resourceName); - if (message.state != null && message.hasOwnProperty("state")) + if (message.state != null && Object.hasOwnProperty.call(message, "state")) writer.uint32(/* id 4, wireType 0 =*/32).int32(message.state); - if (message.category != null && message.hasOwnProperty("category")) + if (message.category != null && Object.hasOwnProperty.call(message, "category")) writer.uint32(/* id 5, wireType 2 =*/42).string(message.category); - if (message.externalUri != null && message.hasOwnProperty("externalUri")) + if (message.externalUri != null && Object.hasOwnProperty.call(message, "externalUri")) writer.uint32(/* id 6, wireType 2 =*/50).string(message.externalUri); - if (message.sourceProperties != null && message.hasOwnProperty("sourceProperties")) + if (message.sourceProperties != null && Object.hasOwnProperty.call(message, "sourceProperties")) for (var keys = Object.keys(message.sourceProperties), i = 0; i < keys.length; ++i) { writer.uint32(/* id 7, wireType 2 =*/58).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); $root.google.protobuf.Value.encode(message.sourceProperties[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); } - if (message.securityMarks != null && message.hasOwnProperty("securityMarks")) + if (message.securityMarks != null && Object.hasOwnProperty.call(message, "securityMarks")) $root.google.cloud.securitycenter.v1p1beta1.SecurityMarks.encode(message.securityMarks, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.eventTime != null && message.hasOwnProperty("eventTime")) + if (message.eventTime != null && Object.hasOwnProperty.call(message, "eventTime")) $root.google.protobuf.Timestamp.encode(message.eventTime, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.createTime != null && message.hasOwnProperty("createTime")) + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); return writer; }; @@ -21811,7 +21811,7 @@ /** * State enum. * @name google.cloud.securitycenter.v1p1beta1.Finding.State - * @enum {string} + * @enum {number} * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value * @property {number} ACTIVE=1 ACTIVE value * @property {number} INACTIVE=2 INACTIVE value @@ -21942,17 +21942,17 @@ NotificationConfig.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.description != null && message.hasOwnProperty("description")) + if (message.description != null && Object.hasOwnProperty.call(message, "description")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); - if (message.eventType != null && message.hasOwnProperty("eventType")) + if (message.eventType != null && Object.hasOwnProperty.call(message, "eventType")) writer.uint32(/* id 3, wireType 0 =*/24).int32(message.eventType); - if (message.pubsubTopic != null && message.hasOwnProperty("pubsubTopic")) + if (message.pubsubTopic != null && Object.hasOwnProperty.call(message, "pubsubTopic")) writer.uint32(/* id 4, wireType 2 =*/34).string(message.pubsubTopic); - if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) + if (message.serviceAccount != null && Object.hasOwnProperty.call(message, "serviceAccount")) writer.uint32(/* id 5, wireType 2 =*/42).string(message.serviceAccount); - if (message.streamingConfig != null && message.hasOwnProperty("streamingConfig")) + if (message.streamingConfig != null && Object.hasOwnProperty.call(message, "streamingConfig")) $root.google.cloud.securitycenter.v1p1beta1.NotificationConfig.StreamingConfig.encode(message.streamingConfig, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); return writer; }; @@ -22216,7 +22216,7 @@ StreamingConfig.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.filter != null && message.hasOwnProperty("filter")) + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.filter); return writer; }; @@ -22350,7 +22350,7 @@ /** * EventType enum. * @name google.cloud.securitycenter.v1p1beta1.NotificationConfig.EventType - * @enum {string} + * @enum {number} * @property {number} EVENT_TYPE_UNSPECIFIED=0 EVENT_TYPE_UNSPECIFIED value * @property {number} FINDING=1 FINDING value */ @@ -22443,9 +22443,9 @@ NotificationMessage.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.notificationConfigName != null && message.hasOwnProperty("notificationConfigName")) + if (message.notificationConfigName != null && Object.hasOwnProperty.call(message, "notificationConfigName")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.notificationConfigName); - if (message.finding != null && message.hasOwnProperty("finding")) + if (message.finding != null && Object.hasOwnProperty.call(message, "finding")) $root.google.cloud.securitycenter.v1p1beta1.Finding.encode(message.finding, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; @@ -22672,11 +22672,11 @@ OrganizationSettings.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.enableAssetDiscovery != null && message.hasOwnProperty("enableAssetDiscovery")) + if (message.enableAssetDiscovery != null && Object.hasOwnProperty.call(message, "enableAssetDiscovery")) writer.uint32(/* id 2, wireType 0 =*/16).bool(message.enableAssetDiscovery); - if (message.assetDiscoveryConfig != null && message.hasOwnProperty("assetDiscoveryConfig")) + if (message.assetDiscoveryConfig != null && Object.hasOwnProperty.call(message, "assetDiscoveryConfig")) $root.google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig.encode(message.assetDiscoveryConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; @@ -22901,7 +22901,7 @@ if (message.projectIds != null && message.projectIds.length) for (var i = 0; i < message.projectIds.length; ++i) writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectIds[i]); - if (message.inclusionMode != null && message.hasOwnProperty("inclusionMode")) + if (message.inclusionMode != null && Object.hasOwnProperty.call(message, "inclusionMode")) writer.uint32(/* id 2, wireType 0 =*/16).int32(message.inclusionMode); return writer; }; @@ -23076,7 +23076,7 @@ /** * InclusionMode enum. * @name google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode - * @enum {string} + * @enum {number} * @property {number} INCLUSION_MODE_UNSPECIFIED=0 INCLUSION_MODE_UNSPECIFIED value * @property {number} INCLUDE_ONLY=1 INCLUDE_ONLY value * @property {number} EXCLUDE=2 EXCLUDE value @@ -23160,9 +23160,9 @@ RunAssetDiscoveryResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.state != null && message.hasOwnProperty("state")) + if (message.state != null && Object.hasOwnProperty.call(message, "state")) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.state); - if (message.duration != null && message.hasOwnProperty("duration")) + if (message.duration != null && Object.hasOwnProperty.call(message, "duration")) $root.google.protobuf.Duration.encode(message.duration, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; @@ -23333,7 +23333,7 @@ /** * State enum. * @name google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse.State - * @enum {string} + * @enum {number} * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value * @property {number} COMPLETED=1 COMPLETED value * @property {number} SUPERSEDED=2 SUPERSEDED value @@ -24219,11 +24219,11 @@ CreateFindingRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && message.hasOwnProperty("parent")) + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.findingId != null && message.hasOwnProperty("findingId")) + if (message.findingId != null && Object.hasOwnProperty.call(message, "findingId")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.findingId); - if (message.finding != null && message.hasOwnProperty("finding")) + if (message.finding != null && Object.hasOwnProperty.call(message, "finding")) $root.google.cloud.securitycenter.v1p1beta1.Finding.encode(message.finding, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; @@ -24456,11 +24456,11 @@ CreateNotificationConfigRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && message.hasOwnProperty("parent")) + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.configId != null && message.hasOwnProperty("configId")) + if (message.configId != null && Object.hasOwnProperty.call(message, "configId")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.configId); - if (message.notificationConfig != null && message.hasOwnProperty("notificationConfig")) + if (message.notificationConfig != null && Object.hasOwnProperty.call(message, "notificationConfig")) $root.google.cloud.securitycenter.v1p1beta1.NotificationConfig.encode(message.notificationConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; @@ -24684,9 +24684,9 @@ CreateSourceRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && message.hasOwnProperty("parent")) + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.source != null && message.hasOwnProperty("source")) + if (message.source != null && Object.hasOwnProperty.call(message, "source")) $root.google.cloud.securitycenter.v1p1beta1.Source.encode(message.source, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; @@ -24890,7 +24890,7 @@ DeleteNotificationConfigRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; @@ -25077,7 +25077,7 @@ GetNotificationConfigRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; @@ -25264,7 +25264,7 @@ GetOrganizationSettingsRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; @@ -25451,7 +25451,7 @@ GetSourceRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; @@ -25701,21 +25701,21 @@ GroupAssetsRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && message.hasOwnProperty("parent")) + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.filter != null && message.hasOwnProperty("filter")) + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); - if (message.groupBy != null && message.hasOwnProperty("groupBy")) + if (message.groupBy != null && Object.hasOwnProperty.call(message, "groupBy")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.groupBy); - if (message.compareDuration != null && message.hasOwnProperty("compareDuration")) + if (message.compareDuration != null && Object.hasOwnProperty.call(message, "compareDuration")) $root.google.protobuf.Duration.encode(message.compareDuration, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.readTime != null && message.hasOwnProperty("readTime")) + if (message.readTime != null && Object.hasOwnProperty.call(message, "readTime")) $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.having != null && message.hasOwnProperty("having")) + if (message.having != null && Object.hasOwnProperty.call(message, "having")) writer.uint32(/* id 6, wireType 2 =*/50).string(message.having); - if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) writer.uint32(/* id 7, wireType 2 =*/58).string(message.pageToken); - if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) writer.uint32(/* id 8, wireType 0 =*/64).int32(message.pageSize); return writer; }; @@ -26021,11 +26021,11 @@ if (message.groupByResults != null && message.groupByResults.length) for (var i = 0; i < message.groupByResults.length; ++i) $root.google.cloud.securitycenter.v1p1beta1.GroupResult.encode(message.groupByResults[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.readTime != null && message.hasOwnProperty("readTime")) + if (message.readTime != null && Object.hasOwnProperty.call(message, "readTime")) $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.nextPageToken); - if (message.totalSize != null && message.hasOwnProperty("totalSize")) + if (message.totalSize != null && Object.hasOwnProperty.call(message, "totalSize")) writer.uint32(/* id 4, wireType 0 =*/32).int32(message.totalSize); return writer; }; @@ -26334,21 +26334,21 @@ GroupFindingsRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && message.hasOwnProperty("parent")) + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.filter != null && message.hasOwnProperty("filter")) + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); - if (message.groupBy != null && message.hasOwnProperty("groupBy")) + if (message.groupBy != null && Object.hasOwnProperty.call(message, "groupBy")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.groupBy); - if (message.readTime != null && message.hasOwnProperty("readTime")) + if (message.readTime != null && Object.hasOwnProperty.call(message, "readTime")) $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.compareDuration != null && message.hasOwnProperty("compareDuration")) + if (message.compareDuration != null && Object.hasOwnProperty.call(message, "compareDuration")) $root.google.protobuf.Duration.encode(message.compareDuration, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.having != null && message.hasOwnProperty("having")) + if (message.having != null && Object.hasOwnProperty.call(message, "having")) writer.uint32(/* id 6, wireType 2 =*/50).string(message.having); - if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) writer.uint32(/* id 7, wireType 2 =*/58).string(message.pageToken); - if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) writer.uint32(/* id 8, wireType 0 =*/64).int32(message.pageSize); return writer; }; @@ -26654,11 +26654,11 @@ if (message.groupByResults != null && message.groupByResults.length) for (var i = 0; i < message.groupByResults.length; ++i) $root.google.cloud.securitycenter.v1p1beta1.GroupResult.encode(message.groupByResults[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.readTime != null && message.hasOwnProperty("readTime")) + if (message.readTime != null && Object.hasOwnProperty.call(message, "readTime")) $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.nextPageToken); - if (message.totalSize != null && message.hasOwnProperty("totalSize")) + if (message.totalSize != null && Object.hasOwnProperty.call(message, "totalSize")) writer.uint32(/* id 4, wireType 0 =*/32).int32(message.totalSize); return writer; }; @@ -26914,12 +26914,12 @@ GroupResult.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.properties != null && message.hasOwnProperty("properties")) + if (message.properties != null && Object.hasOwnProperty.call(message, "properties")) for (var keys = Object.keys(message.properties), i = 0; i < keys.length; ++i) { writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); $root.google.protobuf.Value.encode(message.properties[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); } - if (message.count != null && message.hasOwnProperty("count")) + if (message.count != null && Object.hasOwnProperty.call(message, "count")) writer.uint32(/* id 2, wireType 0 =*/16).int64(message.count); return writer; }; @@ -27174,11 +27174,11 @@ ListNotificationConfigsRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && message.hasOwnProperty("parent")) + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.pageToken); - if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); return writer; }; @@ -27401,7 +27401,7 @@ if (message.notificationConfigs != null && message.notificationConfigs.length) for (var i = 0; i < message.notificationConfigs.length; ++i) $root.google.cloud.securitycenter.v1p1beta1.NotificationConfig.encode(message.notificationConfigs[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); return writer; }; @@ -27637,11 +27637,11 @@ ListSourcesRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && message.hasOwnProperty("parent")) + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.pageToken); - if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) writer.uint32(/* id 7, wireType 0 =*/56).int32(message.pageSize); return writer; }; @@ -27864,7 +27864,7 @@ if (message.sources != null && message.sources.length) for (var i = 0; i < message.sources.length; ++i) $root.google.cloud.securitycenter.v1p1beta1.Source.encode(message.sources[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); return writer; }; @@ -28154,23 +28154,23 @@ ListAssetsRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && message.hasOwnProperty("parent")) + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.filter != null && message.hasOwnProperty("filter")) + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); - if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.orderBy); - if (message.readTime != null && message.hasOwnProperty("readTime")) + if (message.readTime != null && Object.hasOwnProperty.call(message, "readTime")) $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.compareDuration != null && message.hasOwnProperty("compareDuration")) + if (message.compareDuration != null && Object.hasOwnProperty.call(message, "compareDuration")) $root.google.protobuf.Duration.encode(message.compareDuration, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.having != null && message.hasOwnProperty("having")) + if (message.having != null && Object.hasOwnProperty.call(message, "having")) writer.uint32(/* id 6, wireType 2 =*/50).string(message.having); - if (message.fieldMask != null && message.hasOwnProperty("fieldMask")) + if (message.fieldMask != null && Object.hasOwnProperty.call(message, "fieldMask")) $root.google.protobuf.FieldMask.encode(message.fieldMask, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) writer.uint32(/* id 8, wireType 2 =*/66).string(message.pageToken); - if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) writer.uint32(/* id 9, wireType 0 =*/72).int32(message.pageSize); return writer; }; @@ -28492,11 +28492,11 @@ if (message.listAssetsResults != null && message.listAssetsResults.length) for (var i = 0; i < message.listAssetsResults.length; ++i) $root.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult.encode(message.listAssetsResults[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.readTime != null && message.hasOwnProperty("readTime")) + if (message.readTime != null && Object.hasOwnProperty.call(message, "readTime")) $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.nextPageToken); - if (message.totalSize != null && message.hasOwnProperty("totalSize")) + if (message.totalSize != null && Object.hasOwnProperty.call(message, "totalSize")) writer.uint32(/* id 4, wireType 0 =*/32).int32(message.totalSize); return writer; }; @@ -28748,9 +28748,9 @@ ListAssetsResult.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.asset != null && message.hasOwnProperty("asset")) + if (message.asset != null && Object.hasOwnProperty.call(message, "asset")) $root.google.cloud.securitycenter.v1p1beta1.Asset.encode(message.asset, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.stateChange != null && message.hasOwnProperty("stateChange")) + if (message.stateChange != null && Object.hasOwnProperty.call(message, "stateChange")) writer.uint32(/* id 2, wireType 0 =*/16).int32(message.stateChange); return writer; }; @@ -28921,7 +28921,7 @@ /** * StateChange enum. * @name google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult.StateChange - * @enum {string} + * @enum {number} * @property {number} UNUSED=0 UNUSED value * @property {number} ADDED=1 ADDED value * @property {number} REMOVED=2 REMOVED value @@ -29070,23 +29070,23 @@ ListFindingsRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && message.hasOwnProperty("parent")) + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.filter != null && message.hasOwnProperty("filter")) + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); - if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.orderBy); - if (message.readTime != null && message.hasOwnProperty("readTime")) + if (message.readTime != null && Object.hasOwnProperty.call(message, "readTime")) $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.compareDuration != null && message.hasOwnProperty("compareDuration")) + if (message.compareDuration != null && Object.hasOwnProperty.call(message, "compareDuration")) $root.google.protobuf.Duration.encode(message.compareDuration, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.having != null && message.hasOwnProperty("having")) + if (message.having != null && Object.hasOwnProperty.call(message, "having")) writer.uint32(/* id 6, wireType 2 =*/50).string(message.having); - if (message.fieldMask != null && message.hasOwnProperty("fieldMask")) + if (message.fieldMask != null && Object.hasOwnProperty.call(message, "fieldMask")) $root.google.protobuf.FieldMask.encode(message.fieldMask, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) writer.uint32(/* id 8, wireType 2 =*/66).string(message.pageToken); - if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) writer.uint32(/* id 9, wireType 0 =*/72).int32(message.pageSize); return writer; }; @@ -29408,11 +29408,11 @@ if (message.listFindingsResults != null && message.listFindingsResults.length) for (var i = 0; i < message.listFindingsResults.length; ++i) $root.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.encode(message.listFindingsResults[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.readTime != null && message.hasOwnProperty("readTime")) + if (message.readTime != null && Object.hasOwnProperty.call(message, "readTime")) $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.nextPageToken); - if (message.totalSize != null && message.hasOwnProperty("totalSize")) + if (message.totalSize != null && Object.hasOwnProperty.call(message, "totalSize")) writer.uint32(/* id 4, wireType 0 =*/32).int32(message.totalSize); return writer; }; @@ -29673,11 +29673,11 @@ ListFindingsResult.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.finding != null && message.hasOwnProperty("finding")) + if (message.finding != null && Object.hasOwnProperty.call(message, "finding")) $root.google.cloud.securitycenter.v1p1beta1.Finding.encode(message.finding, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.stateChange != null && message.hasOwnProperty("stateChange")) + if (message.stateChange != null && Object.hasOwnProperty.call(message, "stateChange")) writer.uint32(/* id 2, wireType 0 =*/16).int32(message.stateChange); - if (message.resource != null && message.hasOwnProperty("resource")) + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) $root.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.Resource.encode(message.resource, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; @@ -29958,15 +29958,15 @@ Resource.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.projectName != null && message.hasOwnProperty("projectName")) + if (message.projectName != null && Object.hasOwnProperty.call(message, "projectName")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.projectName); - if (message.projectDisplayName != null && message.hasOwnProperty("projectDisplayName")) + if (message.projectDisplayName != null && Object.hasOwnProperty.call(message, "projectDisplayName")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.projectDisplayName); - if (message.parentName != null && message.hasOwnProperty("parentName")) + if (message.parentName != null && Object.hasOwnProperty.call(message, "parentName")) writer.uint32(/* id 4, wireType 2 =*/34).string(message.parentName); - if (message.parentDisplayName != null && message.hasOwnProperty("parentDisplayName")) + if (message.parentDisplayName != null && Object.hasOwnProperty.call(message, "parentDisplayName")) writer.uint32(/* id 5, wireType 2 =*/42).string(message.parentDisplayName); return writer; }; @@ -30145,7 +30145,7 @@ /** * StateChange enum. * @name google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.StateChange - * @enum {string} + * @enum {number} * @property {number} UNUSED=0 UNUSED value * @property {number} CHANGED=1 CHANGED value * @property {number} UNCHANGED=2 UNCHANGED value @@ -30242,11 +30242,11 @@ SetFindingStateRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.state != null && message.hasOwnProperty("state")) + if (message.state != null && Object.hasOwnProperty.call(message, "state")) writer.uint32(/* id 2, wireType 0 =*/16).int32(message.state); - if (message.startTime != null && message.hasOwnProperty("startTime")) + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; @@ -30479,7 +30479,7 @@ RunAssetDiscoveryRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && message.hasOwnProperty("parent")) + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); return writer; }; @@ -30675,9 +30675,9 @@ UpdateFindingRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.finding != null && message.hasOwnProperty("finding")) + if (message.finding != null && Object.hasOwnProperty.call(message, "finding")) $root.google.cloud.securitycenter.v1p1beta1.Finding.encode(message.finding, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; @@ -30895,9 +30895,9 @@ UpdateNotificationConfigRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.notificationConfig != null && message.hasOwnProperty("notificationConfig")) + if (message.notificationConfig != null && Object.hasOwnProperty.call(message, "notificationConfig")) $root.google.cloud.securitycenter.v1p1beta1.NotificationConfig.encode(message.notificationConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; @@ -31115,9 +31115,9 @@ UpdateOrganizationSettingsRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.organizationSettings != null && message.hasOwnProperty("organizationSettings")) + if (message.organizationSettings != null && Object.hasOwnProperty.call(message, "organizationSettings")) $root.google.cloud.securitycenter.v1p1beta1.OrganizationSettings.encode(message.organizationSettings, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; @@ -31335,9 +31335,9 @@ UpdateSourceRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.source != null && message.hasOwnProperty("source")) + if (message.source != null && Object.hasOwnProperty.call(message, "source")) $root.google.cloud.securitycenter.v1p1beta1.Source.encode(message.source, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; @@ -31564,11 +31564,11 @@ UpdateSecurityMarksRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.securityMarks != null && message.hasOwnProperty("securityMarks")) + if (message.securityMarks != null && Object.hasOwnProperty.call(message, "securityMarks")) $root.google.cloud.securitycenter.v1p1beta1.SecurityMarks.encode(message.securityMarks, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.startTime != null && message.hasOwnProperty("startTime")) + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; @@ -31811,11 +31811,11 @@ Source.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.displayName != null && message.hasOwnProperty("displayName")) + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); - if (message.description != null && message.hasOwnProperty("description")) + if (message.description != null && Object.hasOwnProperty.call(message, "description")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); return writer; }; @@ -32056,7 +32056,7 @@ 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 && message.hasOwnProperty("fullyDecodeReservedExpansion")) + if (message.fullyDecodeReservedExpansion != null && Object.hasOwnProperty.call(message, "fullyDecodeReservedExpansion")) writer.uint32(/* id 2, wireType 0 =*/16).bool(message.fullyDecodeReservedExpansion); return writer; }; @@ -32370,26 +32370,26 @@ HttpRule.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.selector != null && message.hasOwnProperty("selector")) + if (message.selector != null && Object.hasOwnProperty.call(message, "selector")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector); - if (message.get != null && message.hasOwnProperty("get")) + if (message.get != null && Object.hasOwnProperty.call(message, "get")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.get); - if (message.put != null && message.hasOwnProperty("put")) + if (message.put != null && Object.hasOwnProperty.call(message, "put")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.put); - if (message.post != null && message.hasOwnProperty("post")) + if (message.post != null && Object.hasOwnProperty.call(message, "post")) writer.uint32(/* id 4, wireType 2 =*/34).string(message.post); - if (message["delete"] != null && message.hasOwnProperty("delete")) + if (message["delete"] != null && Object.hasOwnProperty.call(message, "delete")) writer.uint32(/* id 5, wireType 2 =*/42).string(message["delete"]); - if (message.patch != null && message.hasOwnProperty("patch")) + if (message.patch != null && Object.hasOwnProperty.call(message, "patch")) writer.uint32(/* id 6, wireType 2 =*/50).string(message.patch); - if (message.body != null && message.hasOwnProperty("body")) + if (message.body != null && Object.hasOwnProperty.call(message, "body")) writer.uint32(/* id 7, wireType 2 =*/58).string(message.body); - if (message.custom != null && message.hasOwnProperty("custom")) + 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 && message.hasOwnProperty("responseBody")) + if (message.responseBody != null && Object.hasOwnProperty.call(message, "responseBody")) writer.uint32(/* id 12, wireType 2 =*/98).string(message.responseBody); return writer; }; @@ -32746,9 +32746,9 @@ CustomHttpPattern.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.kind != null && message.hasOwnProperty("kind")) + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.kind); - if (message.path != null && message.hasOwnProperty("path")) + if (message.path != null && Object.hasOwnProperty.call(message, "path")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.path); return writer; }; @@ -32993,18 +32993,18 @@ ResourceDescriptor.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.type != null && message.hasOwnProperty("type")) + 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 && message.hasOwnProperty("nameField")) + if (message.nameField != null && Object.hasOwnProperty.call(message, "nameField")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.nameField); - if (message.history != null && message.hasOwnProperty("history")) + if (message.history != null && Object.hasOwnProperty.call(message, "history")) writer.uint32(/* id 4, wireType 0 =*/32).int32(message.history); - if (message.plural != null && message.hasOwnProperty("plural")) + if (message.plural != null && Object.hasOwnProperty.call(message, "plural")) writer.uint32(/* id 5, wireType 2 =*/42).string(message.plural); - if (message.singular != null && message.hasOwnProperty("singular")) + if (message.singular != null && Object.hasOwnProperty.call(message, "singular")) writer.uint32(/* id 6, wireType 2 =*/50).string(message.singular); return writer; }; @@ -33224,7 +33224,7 @@ /** * History enum. * @name google.api.ResourceDescriptor.History - * @enum {string} + * @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 @@ -33305,9 +33305,9 @@ ResourceReference.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.type != null && message.hasOwnProperty("type")) + if (message.type != null && Object.hasOwnProperty.call(message, "type")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); - if (message.childType != null && message.hasOwnProperty("childType")) + if (message.childType != null && Object.hasOwnProperty.call(message, "childType")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.childType); return writer; }; @@ -33453,7 +33453,7 @@ /** * FieldBehavior enum. * @name google.api.FieldBehavior - * @enum {string} + * @enum {number} * @property {number} FIELD_BEHAVIOR_UNSPECIFIED=0 FIELD_BEHAVIOR_UNSPECIFIED value * @property {number} OPTIONAL=1 OPTIONAL value * @property {number} REQUIRED=2 REQUIRED value @@ -33854,9 +33854,9 @@ FileDescriptorProto.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message["package"] != null && message.hasOwnProperty("package")) + 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) @@ -33873,9 +33873,9 @@ 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 && message.hasOwnProperty("options")) + 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 && message.hasOwnProperty("sourceCodeInfo")) + 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) @@ -33883,7 +33883,7 @@ 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 && message.hasOwnProperty("syntax")) + if (message.syntax != null && Object.hasOwnProperty.call(message, "syntax")) writer.uint32(/* id 12, wireType 2 =*/98).string(message.syntax); return writer; }; @@ -34421,7 +34421,7 @@ DescriptorProto.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + 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) @@ -34438,7 +34438,7 @@ 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 && message.hasOwnProperty("options")) + 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) @@ -34903,11 +34903,11 @@ ExtensionRange.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.start != null && message.hasOwnProperty("start")) + if (message.start != null && Object.hasOwnProperty.call(message, "start")) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); - if (message.end != null && message.hasOwnProperty("end")) + if (message.end != null && Object.hasOwnProperty.call(message, "end")) writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); - if (message.options != null && message.hasOwnProperty("options")) + 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; }; @@ -35131,9 +35131,9 @@ ReservedRange.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.start != null && message.hasOwnProperty("start")) + if (message.start != null && Object.hasOwnProperty.call(message, "start")) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); - if (message.end != null && message.hasOwnProperty("end")) + if (message.end != null && Object.hasOwnProperty.call(message, "end")) writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); return writer; }; @@ -35624,25 +35624,25 @@ FieldDescriptorProto.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.extendee != null && message.hasOwnProperty("extendee")) + if (message.extendee != null && Object.hasOwnProperty.call(message, "extendee")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.extendee); - if (message.number != null && message.hasOwnProperty("number")) + if (message.number != null && Object.hasOwnProperty.call(message, "number")) writer.uint32(/* id 3, wireType 0 =*/24).int32(message.number); - if (message.label != null && message.hasOwnProperty("label")) + if (message.label != null && Object.hasOwnProperty.call(message, "label")) writer.uint32(/* id 4, wireType 0 =*/32).int32(message.label); - if (message.type != null && message.hasOwnProperty("type")) + if (message.type != null && Object.hasOwnProperty.call(message, "type")) writer.uint32(/* id 5, wireType 0 =*/40).int32(message.type); - if (message.typeName != null && message.hasOwnProperty("typeName")) + if (message.typeName != null && Object.hasOwnProperty.call(message, "typeName")) writer.uint32(/* id 6, wireType 2 =*/50).string(message.typeName); - if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) + if (message.defaultValue != null && Object.hasOwnProperty.call(message, "defaultValue")) writer.uint32(/* id 7, wireType 2 =*/58).string(message.defaultValue); - if (message.options != null && message.hasOwnProperty("options")) + 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 && message.hasOwnProperty("oneofIndex")) + if (message.oneofIndex != null && Object.hasOwnProperty.call(message, "oneofIndex")) writer.uint32(/* id 9, wireType 0 =*/72).int32(message.oneofIndex); - if (message.jsonName != null && message.hasOwnProperty("jsonName")) + if (message.jsonName != null && Object.hasOwnProperty.call(message, "jsonName")) writer.uint32(/* id 10, wireType 2 =*/82).string(message.jsonName); return writer; }; @@ -35989,7 +35989,7 @@ /** * Type enum. * @name google.protobuf.FieldDescriptorProto.Type - * @enum {string} + * @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 @@ -36035,7 +36035,7 @@ /** * Label enum. * @name google.protobuf.FieldDescriptorProto.Label - * @enum {string} + * @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 @@ -36116,9 +36116,9 @@ OneofDescriptorProto.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.options != null && message.hasOwnProperty("options")) + 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; }; @@ -36361,12 +36361,12 @@ EnumDescriptorProto.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + 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 && message.hasOwnProperty("options")) + 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) @@ -36669,9 +36669,9 @@ EnumReservedRange.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.start != null && message.hasOwnProperty("start")) + if (message.start != null && Object.hasOwnProperty.call(message, "start")) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); - if (message.end != null && message.hasOwnProperty("end")) + if (message.end != null && Object.hasOwnProperty.call(message, "end")) writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); return writer; }; @@ -36891,11 +36891,11 @@ EnumValueDescriptorProto.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.number != null && message.hasOwnProperty("number")) + if (message.number != null && Object.hasOwnProperty.call(message, "number")) writer.uint32(/* id 2, wireType 0 =*/16).int32(message.number); - if (message.options != null && message.hasOwnProperty("options")) + 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; }; @@ -37129,12 +37129,12 @@ ServiceDescriptorProto.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + 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 && message.hasOwnProperty("options")) + 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; }; @@ -37414,17 +37414,17 @@ MethodDescriptorProto.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.inputType != null && message.hasOwnProperty("inputType")) + if (message.inputType != null && Object.hasOwnProperty.call(message, "inputType")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.inputType); - if (message.outputType != null && message.hasOwnProperty("outputType")) + if (message.outputType != null && Object.hasOwnProperty.call(message, "outputType")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.outputType); - if (message.options != null && message.hasOwnProperty("options")) + 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 && message.hasOwnProperty("clientStreaming")) + if (message.clientStreaming != null && Object.hasOwnProperty.call(message, "clientStreaming")) writer.uint32(/* id 5, wireType 0 =*/40).bool(message.clientStreaming); - if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) + if (message.serverStreaming != null && Object.hasOwnProperty.call(message, "serverStreaming")) writer.uint32(/* id 6, wireType 0 =*/48).bool(message.serverStreaming); return writer; }; @@ -37863,45 +37863,45 @@ FileOptions.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) + if (message.javaPackage != null && Object.hasOwnProperty.call(message, "javaPackage")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.javaPackage); - if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) + if (message.javaOuterClassname != null && Object.hasOwnProperty.call(message, "javaOuterClassname")) writer.uint32(/* id 8, wireType 2 =*/66).string(message.javaOuterClassname); - if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) + if (message.optimizeFor != null && Object.hasOwnProperty.call(message, "optimizeFor")) writer.uint32(/* id 9, wireType 0 =*/72).int32(message.optimizeFor); - if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) + if (message.javaMultipleFiles != null && Object.hasOwnProperty.call(message, "javaMultipleFiles")) writer.uint32(/* id 10, wireType 0 =*/80).bool(message.javaMultipleFiles); - if (message.goPackage != null && message.hasOwnProperty("goPackage")) + if (message.goPackage != null && Object.hasOwnProperty.call(message, "goPackage")) writer.uint32(/* id 11, wireType 2 =*/90).string(message.goPackage); - if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) + if (message.ccGenericServices != null && Object.hasOwnProperty.call(message, "ccGenericServices")) writer.uint32(/* id 16, wireType 0 =*/128).bool(message.ccGenericServices); - if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) + if (message.javaGenericServices != null && Object.hasOwnProperty.call(message, "javaGenericServices")) writer.uint32(/* id 17, wireType 0 =*/136).bool(message.javaGenericServices); - if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) + if (message.pyGenericServices != null && Object.hasOwnProperty.call(message, "pyGenericServices")) writer.uint32(/* id 18, wireType 0 =*/144).bool(message.pyGenericServices); - if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) + if (message.javaGenerateEqualsAndHash != null && Object.hasOwnProperty.call(message, "javaGenerateEqualsAndHash")) writer.uint32(/* id 20, wireType 0 =*/160).bool(message.javaGenerateEqualsAndHash); - if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) writer.uint32(/* id 23, wireType 0 =*/184).bool(message.deprecated); - if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) + if (message.javaStringCheckUtf8 != null && Object.hasOwnProperty.call(message, "javaStringCheckUtf8")) writer.uint32(/* id 27, wireType 0 =*/216).bool(message.javaStringCheckUtf8); - if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) + if (message.ccEnableArenas != null && Object.hasOwnProperty.call(message, "ccEnableArenas")) writer.uint32(/* id 31, wireType 0 =*/248).bool(message.ccEnableArenas); - if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) + if (message.objcClassPrefix != null && Object.hasOwnProperty.call(message, "objcClassPrefix")) writer.uint32(/* id 36, wireType 2 =*/290).string(message.objcClassPrefix); - if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) + if (message.csharpNamespace != null && Object.hasOwnProperty.call(message, "csharpNamespace")) writer.uint32(/* id 37, wireType 2 =*/298).string(message.csharpNamespace); - if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) + if (message.swiftPrefix != null && Object.hasOwnProperty.call(message, "swiftPrefix")) writer.uint32(/* id 39, wireType 2 =*/314).string(message.swiftPrefix); - if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) + if (message.phpClassPrefix != null && Object.hasOwnProperty.call(message, "phpClassPrefix")) writer.uint32(/* id 40, wireType 2 =*/322).string(message.phpClassPrefix); - if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) + if (message.phpNamespace != null && Object.hasOwnProperty.call(message, "phpNamespace")) writer.uint32(/* id 41, wireType 2 =*/330).string(message.phpNamespace); - if (message.phpGenericServices != null && message.hasOwnProperty("phpGenericServices")) + if (message.phpGenericServices != null && Object.hasOwnProperty.call(message, "phpGenericServices")) writer.uint32(/* id 42, wireType 0 =*/336).bool(message.phpGenericServices); - if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) + if (message.phpMetadataNamespace != null && Object.hasOwnProperty.call(message, "phpMetadataNamespace")) writer.uint32(/* id 44, wireType 2 =*/354).string(message.phpMetadataNamespace); - if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) + 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) @@ -38328,7 +38328,7 @@ /** * OptimizeMode enum. * @name google.protobuf.FileOptions.OptimizeMode - * @enum {string} + * @enum {number} * @property {number} SPEED=1 SPEED value * @property {number} CODE_SIZE=2 CODE_SIZE value * @property {number} LITE_RUNTIME=3 LITE_RUNTIME value @@ -38446,18 +38446,18 @@ MessageOptions.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) + if (message.messageSetWireFormat != null && Object.hasOwnProperty.call(message, "messageSetWireFormat")) writer.uint32(/* id 1, wireType 0 =*/8).bool(message.messageSetWireFormat); - if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) + if (message.noStandardDescriptorAccessor != null && Object.hasOwnProperty.call(message, "noStandardDescriptorAccessor")) writer.uint32(/* id 2, wireType 0 =*/16).bool(message.noStandardDescriptorAccessor); - if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); - if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) + 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 && message.hasOwnProperty(".google.api.resource")) + 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; }; @@ -38799,17 +38799,17 @@ FieldOptions.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.ctype != null && message.hasOwnProperty("ctype")) + if (message.ctype != null && Object.hasOwnProperty.call(message, "ctype")) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.ctype); - if (message.packed != null && message.hasOwnProperty("packed")) + if (message.packed != null && Object.hasOwnProperty.call(message, "packed")) writer.uint32(/* id 2, wireType 0 =*/16).bool(message.packed); - if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); - if (message.lazy != null && message.hasOwnProperty("lazy")) + if (message.lazy != null && Object.hasOwnProperty.call(message, "lazy")) writer.uint32(/* id 5, wireType 0 =*/40).bool(message.lazy); - if (message.jstype != null && message.hasOwnProperty("jstype")) + if (message.jstype != null && Object.hasOwnProperty.call(message, "jstype")) writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jstype); - if (message.weak != null && message.hasOwnProperty("weak")) + if (message.weak != null && Object.hasOwnProperty.call(message, "weak")) writer.uint32(/* id 10, wireType 0 =*/80).bool(message.weak); if (message.uninterpretedOption != null && message.uninterpretedOption.length) for (var i = 0; i < message.uninterpretedOption.length; ++i) @@ -38820,7 +38820,7 @@ writer.int32(message[".google.api.fieldBehavior"][i]); writer.ldelim(); } - if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) + 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; }; @@ -39156,7 +39156,7 @@ /** * CType enum. * @name google.protobuf.FieldOptions.CType - * @enum {string} + * @enum {number} * @property {number} STRING=0 STRING value * @property {number} CORD=1 CORD value * @property {number} STRING_PIECE=2 STRING_PIECE value @@ -39172,7 +39172,7 @@ /** * JSType enum. * @name google.protobuf.FieldOptions.JSType - * @enum {string} + * @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 @@ -39471,9 +39471,9 @@ EnumOptions.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) + if (message.allowAlias != null && Object.hasOwnProperty.call(message, "allowAlias")) writer.uint32(/* id 2, wireType 0 =*/16).bool(message.allowAlias); - if (message.deprecated != null && message.hasOwnProperty("deprecated")) + 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) @@ -39716,7 +39716,7 @@ EnumValueOptions.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.deprecated != null && message.hasOwnProperty("deprecated")) + 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) @@ -39965,14 +39965,14 @@ ServiceOptions.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.deprecated != null && message.hasOwnProperty("deprecated")) + 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 && message.hasOwnProperty(".google.api.defaultHost")) + 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 && message.hasOwnProperty(".google.api.oauthScopes")) + 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; }; @@ -40260,19 +40260,19 @@ MethodOptions.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); - if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) + 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.longrunning.operationInfo"] != null && message.hasOwnProperty(".google.longrunning.operationInfo")) + if (message[".google.longrunning.operationInfo"] != null && Object.hasOwnProperty.call(message, ".google.longrunning.operationInfo")) $root.google.longrunning.OperationInfo.encode(message[".google.longrunning.operationInfo"], writer.uint32(/* id 1049, wireType 2 =*/8394).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 && message.hasOwnProperty(".google.api.http")) + 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; }; @@ -40522,7 +40522,7 @@ /** * IdempotencyLevel enum. * @name google.protobuf.MethodOptions.IdempotencyLevel - * @enum {string} + * @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 @@ -40652,17 +40652,17 @@ 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 && message.hasOwnProperty("identifierValue")) + if (message.identifierValue != null && Object.hasOwnProperty.call(message, "identifierValue")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.identifierValue); - if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) + if (message.positiveIntValue != null && Object.hasOwnProperty.call(message, "positiveIntValue")) writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.positiveIntValue); - if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) + if (message.negativeIntValue != null && Object.hasOwnProperty.call(message, "negativeIntValue")) writer.uint32(/* id 5, wireType 0 =*/40).int64(message.negativeIntValue); - if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) + if (message.doubleValue != null && Object.hasOwnProperty.call(message, "doubleValue")) writer.uint32(/* id 6, wireType 1 =*/49).double(message.doubleValue); - if (message.stringValue != null && message.hasOwnProperty("stringValue")) + if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue")) writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.stringValue); - if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) + if (message.aggregateValue != null && Object.hasOwnProperty.call(message, "aggregateValue")) writer.uint32(/* id 8, wireType 2 =*/66).string(message.aggregateValue); return writer; }; @@ -41439,9 +41439,9 @@ writer.int32(message.span[i]); writer.ldelim(); } - if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) + if (message.leadingComments != null && Object.hasOwnProperty.call(message, "leadingComments")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.leadingComments); - if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) + 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) @@ -41972,11 +41972,11 @@ writer.int32(message.path[i]); writer.ldelim(); } - if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) + if (message.sourceFile != null && Object.hasOwnProperty.call(message, "sourceFile")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.sourceFile); - if (message.begin != null && message.hasOwnProperty("begin")) + if (message.begin != null && Object.hasOwnProperty.call(message, "begin")) writer.uint32(/* id 3, wireType 0 =*/24).int32(message.begin); - if (message.end != null && message.hasOwnProperty("end")) + if (message.end != null && Object.hasOwnProperty.call(message, "end")) writer.uint32(/* id 4, wireType 0 =*/32).int32(message.end); return writer; }; @@ -42221,7 +42221,7 @@ Struct.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.fields != null && message.hasOwnProperty("fields")) + if (message.fields != null && Object.hasOwnProperty.call(message, "fields")) for (var keys = Object.keys(message.fields), i = 0; i < keys.length; ++i) { writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); $root.google.protobuf.Value.encode(message.fields[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); @@ -42494,17 +42494,17 @@ Value.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.nullValue != null && message.hasOwnProperty("nullValue")) + if (message.nullValue != null && Object.hasOwnProperty.call(message, "nullValue")) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.nullValue); - if (message.numberValue != null && message.hasOwnProperty("numberValue")) + if (message.numberValue != null && Object.hasOwnProperty.call(message, "numberValue")) writer.uint32(/* id 2, wireType 1 =*/17).double(message.numberValue); - if (message.stringValue != null && message.hasOwnProperty("stringValue")) + if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.stringValue); - if (message.boolValue != null && message.hasOwnProperty("boolValue")) + if (message.boolValue != null && Object.hasOwnProperty.call(message, "boolValue")) writer.uint32(/* id 4, wireType 0 =*/32).bool(message.boolValue); - if (message.structValue != null && message.hasOwnProperty("structValue")) + if (message.structValue != null && Object.hasOwnProperty.call(message, "structValue")) $root.google.protobuf.Struct.encode(message.structValue, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.listValue != null && message.hasOwnProperty("listValue")) + if (message.listValue != null && Object.hasOwnProperty.call(message, "listValue")) $root.google.protobuf.ListValue.encode(message.listValue, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); return writer; }; @@ -42747,7 +42747,7 @@ /** * NullValue enum. * @name google.protobuf.NullValue - * @enum {string} + * @enum {number} * @property {number} NULL_VALUE=0 NULL_VALUE value */ protobuf.NullValue = (function() { @@ -43029,9 +43029,9 @@ Timestamp.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.seconds != null && message.hasOwnProperty("seconds")) + if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); - if (message.nanos != null && message.hasOwnProperty("nanos")) + if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); return writer; }; @@ -43253,9 +43253,9 @@ Duration.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.seconds != null && message.hasOwnProperty("seconds")) + if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); - if (message.nanos != null && message.hasOwnProperty("nanos")) + if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); return writer; }; @@ -43477,9 +43477,9 @@ Any.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.type_url != null && message.hasOwnProperty("type_url")) + if (message.type_url != null && Object.hasOwnProperty.call(message, "type_url")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.type_url); - if (message.value != null && message.hasOwnProperty("value")) + if (message.value != null && Object.hasOwnProperty.call(message, "value")) writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.value); return writer; }; @@ -44214,9 +44214,9 @@ SetIamPolicyRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.resource != null && message.hasOwnProperty("resource")) + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.resource); - if (message.policy != null && message.hasOwnProperty("policy")) + if (message.policy != null && Object.hasOwnProperty.call(message, "policy")) $root.google.iam.v1.Policy.encode(message.policy, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; @@ -44429,9 +44429,9 @@ GetIamPolicyRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.resource != null && message.hasOwnProperty("resource")) + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.resource); - if (message.options != null && message.hasOwnProperty("options")) + if (message.options != null && Object.hasOwnProperty.call(message, "options")) $root.google.iam.v1.GetPolicyOptions.encode(message.options, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; @@ -44645,7 +44645,7 @@ TestIamPermissionsRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.resource != null && message.hasOwnProperty("resource")) + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.resource); if (message.permissions != null && message.permissions.length) for (var i = 0; i < message.permissions.length; ++i) @@ -45064,7 +45064,7 @@ GetPolicyOptions.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.requestedPolicyVersion != null && message.hasOwnProperty("requestedPolicyVersion")) + if (message.requestedPolicyVersion != null && Object.hasOwnProperty.call(message, "requestedPolicyVersion")) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.requestedPolicyVersion); return writer; }; @@ -45270,9 +45270,9 @@ Policy.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.version != null && message.hasOwnProperty("version")) + if (message.version != null && Object.hasOwnProperty.call(message, "version")) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.version); - if (message.etag != null && message.hasOwnProperty("etag")) + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.etag); if (message.bindings != null && message.bindings.length) for (var i = 0; i < message.bindings.length; ++i) @@ -45533,12 +45533,12 @@ Binding.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.role != null && message.hasOwnProperty("role")) + if (message.role != null && Object.hasOwnProperty.call(message, "role")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.role); if (message.members != null && message.members.length) for (var i = 0; i < message.members.length; ++i) writer.uint32(/* id 2, wireType 2 =*/18).string(message.members[i]); - if (message.condition != null && message.hasOwnProperty("condition")) + if (message.condition != null && Object.hasOwnProperty.call(message, "condition")) $root.google.type.Expr.encode(message.condition, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; @@ -46047,13 +46047,13 @@ BindingDelta.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.action != null && message.hasOwnProperty("action")) + if (message.action != null && Object.hasOwnProperty.call(message, "action")) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.action); - if (message.role != null && message.hasOwnProperty("role")) + if (message.role != null && Object.hasOwnProperty.call(message, "role")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.role); - if (message.member != null && message.hasOwnProperty("member")) + if (message.member != null && Object.hasOwnProperty.call(message, "member")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.member); - if (message.condition != null && message.hasOwnProperty("condition")) + if (message.condition != null && Object.hasOwnProperty.call(message, "condition")) $root.google.type.Expr.encode(message.condition, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); return writer; }; @@ -46241,7 +46241,7 @@ /** * Action enum. * @name google.iam.v1.BindingDelta.Action - * @enum {string} + * @enum {number} * @property {number} ACTION_UNSPECIFIED=0 ACTION_UNSPECIFIED value * @property {number} ADD=1 ADD value * @property {number} REMOVE=2 REMOVE value @@ -46340,13 +46340,13 @@ AuditConfigDelta.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.action != null && message.hasOwnProperty("action")) + if (message.action != null && Object.hasOwnProperty.call(message, "action")) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.action); - if (message.service != null && message.hasOwnProperty("service")) + if (message.service != null && Object.hasOwnProperty.call(message, "service")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.service); - if (message.exemptedMember != null && message.hasOwnProperty("exemptedMember")) + if (message.exemptedMember != null && Object.hasOwnProperty.call(message, "exemptedMember")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.exemptedMember); - if (message.logType != null && message.hasOwnProperty("logType")) + if (message.logType != null && Object.hasOwnProperty.call(message, "logType")) writer.uint32(/* id 4, wireType 2 =*/34).string(message.logType); return writer; }; @@ -46529,7 +46529,7 @@ /** * Action enum. * @name google.iam.v1.AuditConfigDelta.Action - * @enum {string} + * @enum {number} * @property {number} ACTION_UNSPECIFIED=0 ACTION_UNSPECIFIED value * @property {number} ADD=1 ADD value * @property {number} REMOVE=2 REMOVE value @@ -46643,13 +46643,13 @@ Expr.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.expression != null && message.hasOwnProperty("expression")) + if (message.expression != null && Object.hasOwnProperty.call(message, "expression")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.expression); - if (message.title != null && message.hasOwnProperty("title")) + if (message.title != null && Object.hasOwnProperty.call(message, "title")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.title); - if (message.description != null && message.hasOwnProperty("description")) + if (message.description != null && Object.hasOwnProperty.call(message, "description")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); - if (message.location != null && message.hasOwnProperty("location")) + if (message.location != null && Object.hasOwnProperty.call(message, "location")) writer.uint32(/* id 4, wireType 2 =*/34).string(message.location); return writer; }; @@ -47132,15 +47132,15 @@ Operation.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.metadata != null && message.hasOwnProperty("metadata")) + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) $root.google.protobuf.Any.encode(message.metadata, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.done != null && message.hasOwnProperty("done")) + if (message.done != null && Object.hasOwnProperty.call(message, "done")) writer.uint32(/* id 3, wireType 0 =*/24).bool(message.done); - if (message.error != null && message.hasOwnProperty("error")) + if (message.error != null && Object.hasOwnProperty.call(message, "error")) $root.google.rpc.Status.encode(message.error, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.response != null && message.hasOwnProperty("response")) + if (message.response != null && Object.hasOwnProperty.call(message, "response")) $root.google.protobuf.Any.encode(message.response, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); return writer; }; @@ -47400,7 +47400,7 @@ GetOperationRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; @@ -47614,13 +47614,13 @@ ListOperationsRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.filter != null && message.hasOwnProperty("filter")) + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.filter); - if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); - if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 4, wireType 2 =*/34).string(message.name); return writer; }; @@ -47854,7 +47854,7 @@ if (message.operations != null && message.operations.length) for (var i = 0; i < message.operations.length; ++i) $root.google.longrunning.Operation.encode(message.operations[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); return writer; }; @@ -48072,7 +48072,7 @@ CancelOperationRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; @@ -48259,7 +48259,7 @@ DeleteOperationRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; @@ -48455,9 +48455,9 @@ WaitOperationRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.timeout != null && message.hasOwnProperty("timeout")) + if (message.timeout != null && Object.hasOwnProperty.call(message, "timeout")) $root.google.protobuf.Duration.encode(message.timeout, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; @@ -48670,9 +48670,9 @@ OperationInfo.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.responseType != null && message.hasOwnProperty("responseType")) + if (message.responseType != null && Object.hasOwnProperty.call(message, "responseType")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.responseType); - if (message.metadataType != null && message.hasOwnProperty("metadataType")) + if (message.metadataType != null && Object.hasOwnProperty.call(message, "metadataType")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.metadataType); return writer; }; @@ -48902,9 +48902,9 @@ Status.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.code != null && message.hasOwnProperty("code")) + if (message.code != null && Object.hasOwnProperty.call(message, "code")) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.code); - if (message.message != null && message.hasOwnProperty("message")) + if (message.message != null && Object.hasOwnProperty.call(message, "message")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.message); if (message.details != null && message.details.length) for (var i = 0; i < message.details.length; ++i) diff --git a/packages/google-cloud-securitycenter/src/v1/security_center_client.ts b/packages/google-cloud-securitycenter/src/v1/security_center_client.ts index c161816047e..30e39bf3bf5 100644 --- a/packages/google-cloud-securitycenter/src/v1/security_center_client.ts +++ b/packages/google-cloud-securitycenter/src/v1/security_center_client.ts @@ -827,6 +827,12 @@ export class SecurityCenterClient { * * @param {Object} request * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {google.iam.v1.GetPolicyOptions} request.options + * OPTIONAL: A `GetPolicyOptions` object for specifying options to + * `GetIamPolicy`. This field is only used by Cloud IAM. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -1283,6 +1289,14 @@ export class SecurityCenterClient { * * @param {Object} request * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy is being specified. + * See the operation documentation for the appropriate value for this field. + * @param {google.iam.v1.Policy} request.policy + * REQUIRED: The complete policy to be applied to the `resource`. The size of + * the policy is limited to a few 10s of KB. An empty policy is a + * valid policy but certain Cloud Platform services (such as Projects) + * might reject them. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -1361,6 +1375,14 @@ export class SecurityCenterClient { * * @param {Object} request * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {string[]} request.permissions + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see + * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. diff --git a/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.ts b/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.ts index b2723b90e83..80b8eb085f2 100644 --- a/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.ts +++ b/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.ts @@ -617,6 +617,12 @@ export class SecurityCenterClient { * * @param {Object} request * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {google.iam.v1.GetPolicyOptions} request.options + * OPTIONAL: A `GetPolicyOptions` object for specifying options to + * `GetIamPolicy`. This field is only used by Cloud IAM. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -984,6 +990,14 @@ export class SecurityCenterClient { * * @param {Object} request * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy is being specified. + * See the operation documentation for the appropriate value for this field. + * @param {google.iam.v1.Policy} request.policy + * REQUIRED: The complete policy to be applied to the `resource`. The size of + * the policy is limited to a few 10s of KB. An empty policy is a + * valid policy but certain Cloud Platform services (such as Projects) + * might reject them. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -1062,6 +1076,14 @@ export class SecurityCenterClient { * * @param {Object} request * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {string[]} request.permissions + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see + * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. diff --git a/packages/google-cloud-securitycenter/src/v1p1beta1/security_center_client.ts b/packages/google-cloud-securitycenter/src/v1p1beta1/security_center_client.ts index 3357f8ce835..fe16758b59e 100644 --- a/packages/google-cloud-securitycenter/src/v1p1beta1/security_center_client.ts +++ b/packages/google-cloud-securitycenter/src/v1p1beta1/security_center_client.ts @@ -841,6 +841,12 @@ export class SecurityCenterClient { * * @param {Object} request * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {google.iam.v1.GetPolicyOptions} request.options + * OPTIONAL: A `GetPolicyOptions` object for specifying options to + * `GetIamPolicy`. This field is only used by Cloud IAM. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -1310,6 +1316,14 @@ export class SecurityCenterClient { * * @param {Object} request * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy is being specified. + * See the operation documentation for the appropriate value for this field. + * @param {google.iam.v1.Policy} request.policy + * REQUIRED: The complete policy to be applied to the `resource`. The size of + * the policy is limited to a few 10s of KB. An empty policy is a + * valid policy but certain Cloud Platform services (such as Projects) + * might reject them. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -1388,6 +1402,14 @@ export class SecurityCenterClient { * * @param {Object} request * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {string[]} request.permissions + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see + * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. diff --git a/packages/google-cloud-securitycenter/synth.metadata b/packages/google-cloud-securitycenter/synth.metadata index 039ee0ee075..59e3d33e412 100644 --- a/packages/google-cloud-securitycenter/synth.metadata +++ b/packages/google-cloud-securitycenter/synth.metadata @@ -1,12 +1,25 @@ { - "updateTime": "2020-04-11T00:52:31.325939Z", "sources": [ + { + "git": { + "name": ".", + "remote": "https://github.com/googleapis/nodejs-security-center.git", + "sha": "8ea195c2f3e83b30045943cd39ccb01a926eb535" + } + }, + { + "git": { + "name": "googleapis", + "remote": "https://github.com/googleapis/googleapis.git", + "sha": "28e76243c23cc282efbb288cb558c174e3e5e9ee", + "internalRef": "308294748" + } + }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "6f32150677c9784f3c3a7e1949472bd29c9d72c5", - "log": "6f32150677c9784f3c3a7e1949472bd29c9d72c5\nfix: installs test_utils from its common repo (#480)\n\n\n74ce986d3b5431eb66985e9a00c4eb45295a4020\nfix: stop recording update_time in synth.metadata (#478)\n\n\n7f8e62aa3edd225f76347a16f92e400661fdfb52\nchore(java): release-please only updates non maven versions in README (#476)\n\nPrevent release-please and synthtool from fighting over the released library version. Synthtool updates the install snippets from the samples pom.xml files so the bots fight if they are temporarily out of sync after a release.\nc7e0e517d7f46f77bebd27da2e5afcaa6eee7e25\nbuild(java): fix nightly integration test config to run integrations (#465)\n\nThis was only running the units.\nbd69a2aa7b70875f3c988e269706b22fefbef40e\nbuild(java): fix retry_with_backoff when -e option set (#475)\n\n\nd9b173c427bfa0c6cca818233562e7e8841a357c\nfix: record version of working repo in synth.metadata (#473)\n\nPartial revert of b37cf74d12e9a42b9de9e61a4f26133d7cd9c168.\nf73a541770d95a609e5be6bf6b3b220d17cefcbe\nfeat(discogapic): allow local discovery-artifact-manager (#474)\n\n\n8cf0f5d93a70c3dcb0b4999d3152c46d4d9264bf\ndoc: describe the Autosynth & Synthtool protocol (#472)\n\n* doc: describe the Autosynth & Synthtool protocol\n\n* Accommodate review comments.\n980baaa738a1ad8fa02b4fdbd56be075ee77ece5\nfix: pin sphinx to <3.0.0 as new version causes new error (#471)\n\nThe error `toctree contains reference to document changlelog that doesn't have a title: no link will be generated` occurs as of 3.0.0. Pinning to 2.x until we address the docs build issue.\n\nTowards #470\n\nI did this manually for python-datastore https://github.com/googleapis/python-datastore/pull/22\n928b2998ac5023e7c7e254ab935f9ef022455aad\nchore(deps): update dependency com.google.cloud.samples:shared-configuration to v1.0.15 (#466)\n\nCo-authored-by: Jeffrey Rennie \n188f1b1d53181f739b98f8aa5d40cfe99eb90c47\nfix: allow local and external deps to be specified (#469)\n\nModify noxfile.py to allow local and external dependencies for\nsystem tests to be specified.\n" + "sha": "19465d3ec5e5acdb01521d8f3bddd311bcbee28d" } } ], diff --git a/packages/google-cloud-securitycenter/system-test/install.ts b/packages/google-cloud-securitycenter/system-test/install.ts index c4d80e9c0c8..4c1ba3eb79a 100644 --- a/packages/google-cloud-securitycenter/system-test/install.ts +++ b/packages/google-cloud-securitycenter/system-test/install.ts @@ -21,7 +21,7 @@ import {readFileSync} from 'fs'; import {describe, it} from 'mocha'; describe('typescript consumer tests', () => { - it('should have correct type signature for typescript users', async function() { + it('should have correct type signature for typescript users', async function () { this.timeout(300000); const options = { packageDir: process.cwd(), // path to your module. @@ -35,7 +35,7 @@ describe('typescript consumer tests', () => { await packNTest(options); // will throw upon error. }); - it('should have correct type signature for javascript users', async function() { + it('should have correct type signature for javascript users', async function () { this.timeout(300000); const options = { packageDir: process.cwd(), // path to your module. From 7e45f3a2e433aaa1933f162a70585727bf4ec17b Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 1 May 2020 06:55:26 +0200 Subject: [PATCH 173/342] chore(deps): update dependency uuid to v8 (#272) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [uuid](https://togithub.com/uuidjs/uuid) | devDependencies | major | [`^7.0.2` -> `^8.0.0`](https://renovatebot.com/diffs/npm/uuid/7.0.3/8.0.0) | --- ### Release Notes
uuidjs/uuid ### [`v8.0.0`](https://togithub.com/uuidjs/uuid/blob/master/CHANGELOG.md#​800-httpsgithubcomuuidjsuuidcomparev703v800-2020-04-29) [Compare Source](https://togithub.com/uuidjs/uuid/compare/v7.0.3...v8.0.0) ##### ⚠ BREAKING CHANGES - For native ECMAScript Module (ESM) usage in Node.js only named exports are exposed, there is no more default export. ```diff -import uuid from 'uuid'; -console.log(uuid.v4()); // -> 'cd6c3b08-0adc-4f4b-a6ef-36087a1c9869' +import { v4 as uuidv4 } from 'uuid'; +uuidv4(); // ⇨ '9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d' ``` - Deep requiring specific algorithms of this library like `require('uuid/v4')`, which has been deprecated in `uuid@7`, is no longer supported. Instead use the named exports that this module exports. For ECMAScript Modules (ESM): ```diff -import uuidv4 from 'uuid/v4'; +import { v4 as uuidv4 } from 'uuid'; uuidv4(); ``` For CommonJS: ```diff -const uuidv4 = require('uuid/v4'); +const { v4: uuidv4 } = require('uuid'); uuidv4(); ``` ##### Features - native Node.js ES Modules (wrapper approach) ([#​423](https://togithub.com/uuidjs/uuid/issues/423)) ([2d9f590](https://togithub.com/uuidjs/uuid/commit/2d9f590ad9701d692625c07ed62f0a0f91227991)), closes [#​245](https://togithub.com/uuidjs/uuid/issues/245) [#​419](https://togithub.com/uuidjs/uuid/issues/419) [#​342](https://togithub.com/uuidjs/uuid/issues/342) - remove deep requires ([#​426](https://togithub.com/uuidjs/uuid/issues/426)) ([daf72b8](https://togithub.com/uuidjs/uuid/commit/daf72b84ceb20272a81bb5fbddb05dd95922cbba)) ##### Bug Fixes - add CommonJS syntax example to README quickstart section ([#​417](https://togithub.com/uuidjs/uuid/issues/417)) ([e0ec840](https://togithub.com/uuidjs/uuid/commit/e0ec8402c7ad44b7ef0453036c612f5db513fda0)) ##### [7.0.3](https://togithub.com/uuidjs/uuid/compare/v7.0.2...v7.0.3) (2020-03-31) ##### Bug Fixes - make deep require deprecation warning work in browsers ([#​409](https://togithub.com/uuidjs/uuid/issues/409)) ([4b71107](https://togithub.com/uuidjs/uuid/commit/4b71107d8c0d2ef56861ede6403fc9dc35a1e6bf)), closes [#​408](https://togithub.com/uuidjs/uuid/issues/408) ##### [7.0.2](https://togithub.com/uuidjs/uuid/compare/v7.0.1...v7.0.2) (2020-03-04) ##### Bug Fixes - make access to msCrypto consistent ([#​393](https://togithub.com/uuidjs/uuid/issues/393)) ([8bf2a20](https://togithub.com/uuidjs/uuid/commit/8bf2a20f3565df743da7215eebdbada9d2df118c)) - simplify link in deprecation warning ([#​391](https://togithub.com/uuidjs/uuid/issues/391)) ([bb2c8e4](https://togithub.com/uuidjs/uuid/commit/bb2c8e4e9f4c5f9c1eaaf3ea59710c633cd90cb7)) - update links to match content in readme ([#​386](https://togithub.com/uuidjs/uuid/issues/386)) ([44f2f86](https://togithub.com/uuidjs/uuid/commit/44f2f86e9d2bbf14ee5f0f00f72a3db1292666d4)) ##### [7.0.1](https://togithub.com/uuidjs/uuid/compare/v7.0.0...v7.0.1) (2020-02-25) ##### Bug Fixes - clean up esm builds for node and browser ([#​383](https://togithub.com/uuidjs/uuid/issues/383)) ([59e6a49](https://togithub.com/uuidjs/uuid/commit/59e6a49e7ce7b3e8fb0f3ee52b9daae72af467dc)) - provide browser versions independent from module system ([#​380](https://togithub.com/uuidjs/uuid/issues/380)) ([4344a22](https://togithub.com/uuidjs/uuid/commit/4344a22e7aed33be8627eeaaf05360f256a21753)), closes [#​378](https://togithub.com/uuidjs/uuid/issues/378)
--- ### Renovate configuration :date: **Schedule**: "after 9am and before 3pm" (UTC). :vertical_traffic_light: **Automerge**: Disabled by config. Please merge this manually once you are satisfied. :recycle: **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. :no_bell: **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#googleapis/nodejs-security-center). --- packages/google-cloud-securitycenter/samples/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-securitycenter/samples/package.json b/packages/google-cloud-securitycenter/samples/package.json index bcdb060c270..d760ff620b0 100644 --- a/packages/google-cloud-securitycenter/samples/package.json +++ b/packages/google-cloud-securitycenter/samples/package.json @@ -19,6 +19,6 @@ "devDependencies": { "chai": "^4.2.0", "mocha": "^7.0.0", - "uuid": "^7.0.2" + "uuid": "^8.0.0" } } From c1baa8fb4834b76991f41d046684efae2c98cda3 Mon Sep 17 00:00:00 2001 From: Alexander Fenster Date: Tue, 5 May 2020 17:27:24 -0700 Subject: [PATCH 174/342] chore: update npm scripts and synth.py (#269) Update npm scripts: add clean, prelint, prefix; make sure that lint and fix are set properly. Use post-process feature of synthtool. Co-authored-by: Benjamin E. Coe --- packages/google-cloud-securitycenter/package.json | 5 +++-- packages/google-cloud-securitycenter/synth.py | 7 ++----- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/packages/google-cloud-securitycenter/package.json b/packages/google-cloud-securitycenter/package.json index 6996ee694e5..b5c658f165a 100644 --- a/packages/google-cloud-securitycenter/package.json +++ b/packages/google-cloud-securitycenter/package.json @@ -19,13 +19,14 @@ "docs": "jsdoc -c .jsdoc.js", "docs-test": "linkinator docs", "fix": "gts fix", - "lint": "gts fix", + "lint": "gts check", "predocs-test": "npm run docs", "prepare": "npm run compile", "system-test": "c8 mocha build/system-test", "test": "c8 mocha build/test", "samples-test": "cd samples/ && npm link ../ && npm test && cd ../", - "prelint": "cd samples; npm link ../; npm install" + "prelint": "cd samples; npm link ../; npm install", + "precompile": "gts clean" }, "keywords": [ "google apis client", diff --git a/packages/google-cloud-securitycenter/synth.py b/packages/google-cloud-securitycenter/synth.py index cc29c3de6af..9d7b0f68f8b 100644 --- a/packages/google-cloud-securitycenter/synth.py +++ b/packages/google-cloud-securitycenter/synth.py @@ -14,7 +14,7 @@ import synthtool as s import synthtool.gcp as gcp -import subprocess +import synthtool.languages.node as node import logging logging.basicConfig(level=logging.DEBUG) @@ -47,7 +47,4 @@ templates = common_templates.node_library(source_location='build/src') s.copy(templates, excludes=['.kokoro/samples-test.sh', '.kokoro/samples-test.sh']) -# Node.js specific cleanup -subprocess.run(['npm', 'install']) -subprocess.run(['npm', 'run', 'fix']) -subprocess.run(['npx', 'compileProtos', 'src']) +node.postprocess_gapic_library() From a64cb6ab6449410a53720f02ea7013bdc00106b9 Mon Sep 17 00:00:00 2001 From: Alexander Fenster Date: Tue, 5 May 2020 19:46:20 -0700 Subject: [PATCH 175/342] feat: check status of long running operation by its name (#273) For each client method returning a long running operation, a separate method to check its status is added. Added methods: `checkRunAssetDiscoveryProgress`. --- .../src/v1/security_center_client.ts | 38 +++- .../src/v1beta1/security_center_client.ts | 35 +++- .../src/v1p1beta1/security_center_client.ts | 38 +++- .../synth.metadata | 14 +- .../test/gapic_security_center_v1.ts | 184 +++++++++--------- .../test/gapic_security_center_v1beta1.ts | 145 +++++++------- .../test/gapic_security_center_v1p1beta1.ts | 184 +++++++++--------- 7 files changed, 369 insertions(+), 269 deletions(-) diff --git a/packages/google-cloud-securitycenter/src/v1/security_center_client.ts b/packages/google-cloud-securitycenter/src/v1/security_center_client.ts index 30e39bf3bf5..d648a1ec5c1 100644 --- a/packages/google-cloud-securitycenter/src/v1/security_center_client.ts +++ b/packages/google-cloud-securitycenter/src/v1/security_center_client.ts @@ -32,7 +32,7 @@ import {Transform} from 'stream'; import {RequestType} from 'google-gax/build/src/apitypes'; import * as protos from '../../protos/protos'; import * as gapicConfig from './security_center_client_config.json'; - +import {operationsProtos} from 'google-gax'; const version = require('../../../package.json').version; /** @@ -2037,6 +2037,42 @@ export class SecurityCenterClient { this.initialize(); return this.innerApiCalls.runAssetDiscovery(request, options, callback); } + /** + * Check the status of the long running operation returned by the runAssetDiscovery() method. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * + * @example: + * const decodedOperation = await checkRunAssetDiscoveryProgress(name); + * console.log(decodedOperation.result); + * console.log(decodedOperation.done); + * console.log(decodedOperation.metadata); + * + */ + async checkRunAssetDiscoveryProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.securitycenter.v1.RunAssetDiscoveryResponse, + protos.google.protobuf.Empty + > + > { + const request = new operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation( + operation, + this.descriptors.longrunning.runAssetDiscovery, + gax.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.securitycenter.v1.RunAssetDiscoveryResponse, + protos.google.protobuf.Empty + >; + } groupAssets( request: protos.google.cloud.securitycenter.v1.IGroupAssetsRequest, options?: gax.CallOptions diff --git a/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.ts b/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.ts index 80b8eb085f2..a618a0abb82 100644 --- a/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.ts +++ b/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.ts @@ -32,7 +32,7 @@ import {Transform} from 'stream'; import {RequestType} from 'google-gax/build/src/apitypes'; import * as protos from '../../protos/protos'; import * as gapicConfig from './security_center_client_config.json'; - +import {operationsProtos} from 'google-gax'; const version = require('../../../package.json').version; /** @@ -1617,6 +1617,39 @@ export class SecurityCenterClient { this.initialize(); return this.innerApiCalls.runAssetDiscovery(request, options, callback); } + /** + * Check the status of the long running operation returned by the runAssetDiscovery() method. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * + * @example: + * const decodedOperation = await checkRunAssetDiscoveryProgress(name); + * console.log(decodedOperation.result); + * console.log(decodedOperation.done); + * console.log(decodedOperation.metadata); + * + */ + async checkRunAssetDiscoveryProgress( + name: string + ): Promise< + LROperation + > { + const request = new operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation( + operation, + this.descriptors.longrunning.runAssetDiscovery, + gax.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.protobuf.Empty, + protos.google.protobuf.Empty + >; + } groupAssets( request: protos.google.cloud.securitycenter.v1beta1.IGroupAssetsRequest, options?: gax.CallOptions diff --git a/packages/google-cloud-securitycenter/src/v1p1beta1/security_center_client.ts b/packages/google-cloud-securitycenter/src/v1p1beta1/security_center_client.ts index fe16758b59e..91ffc22468a 100644 --- a/packages/google-cloud-securitycenter/src/v1p1beta1/security_center_client.ts +++ b/packages/google-cloud-securitycenter/src/v1p1beta1/security_center_client.ts @@ -32,7 +32,7 @@ import {Transform} from 'stream'; import {RequestType} from 'google-gax/build/src/apitypes'; import * as protos from '../../protos/protos'; import * as gapicConfig from './security_center_client_config.json'; - +import {operationsProtos} from 'google-gax'; const version = require('../../../package.json').version; /** @@ -2076,6 +2076,42 @@ export class SecurityCenterClient { this.initialize(); return this.innerApiCalls.runAssetDiscovery(request, options, callback); } + /** + * Check the status of the long running operation returned by the runAssetDiscovery() method. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * + * @example: + * const decodedOperation = await checkRunAssetDiscoveryProgress(name); + * console.log(decodedOperation.result); + * console.log(decodedOperation.done); + * console.log(decodedOperation.metadata); + * + */ + async checkRunAssetDiscoveryProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse, + protos.google.protobuf.Empty + > + > { + const request = new operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation( + operation, + this.descriptors.longrunning.runAssetDiscovery, + gax.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse, + protos.google.protobuf.Empty + >; + } groupAssets( request: protos.google.cloud.securitycenter.v1p1beta1.IGroupAssetsRequest, options?: gax.CallOptions diff --git a/packages/google-cloud-securitycenter/synth.metadata b/packages/google-cloud-securitycenter/synth.metadata index 59e3d33e412..e44dc53fe97 100644 --- a/packages/google-cloud-securitycenter/synth.metadata +++ b/packages/google-cloud-securitycenter/synth.metadata @@ -3,23 +3,15 @@ { "git": { "name": ".", - "remote": "https://github.com/googleapis/nodejs-security-center.git", - "sha": "8ea195c2f3e83b30045943cd39ccb01a926eb535" - } - }, - { - "git": { - "name": "googleapis", - "remote": "https://github.com/googleapis/googleapis.git", - "sha": "28e76243c23cc282efbb288cb558c174e3e5e9ee", - "internalRef": "308294748" + "remote": "git@github.com:googleapis/nodejs-security-center.git", + "sha": "073960395fdaafcbdd921fba26ba1ace5e303813" } }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "19465d3ec5e5acdb01521d8f3bddd311bcbee28d" + "sha": "ab883569eb0257bbf16a6d825fd018b3adde3912" } } ], diff --git a/packages/google-cloud-securitycenter/test/gapic_security_center_v1.ts b/packages/google-cloud-securitycenter/test/gapic_security_center_v1.ts index 42cdac90b37..15bbe383bab 100644 --- a/packages/google-cloud-securitycenter/test/gapic_security_center_v1.ts +++ b/packages/google-cloud-securitycenter/test/gapic_security_center_v1.ts @@ -25,7 +25,7 @@ import * as securitycenterModule from '../src'; import {PassThrough} from 'stream'; -import {protobuf, LROperation} from 'google-gax'; +import {protobuf, LROperation, operationsProtos} from 'google-gax'; function generateSampleMessage(instance: T) { const filledObject = (instance.constructor as typeof protobuf.Message).toObject( @@ -331,9 +331,7 @@ describe('v1.SecurityCenterClient', () => { undefined, expectedError ); - await assert.rejects(async () => { - await client.createSource(request); - }, expectedError); + await assert.rejects(client.createSource(request), expectedError); assert( (client.innerApiCalls.createSource as SinonStub) .getCall(0) @@ -445,9 +443,7 @@ describe('v1.SecurityCenterClient', () => { undefined, expectedError ); - await assert.rejects(async () => { - await client.createFinding(request); - }, expectedError); + await assert.rejects(client.createFinding(request), expectedError); assert( (client.innerApiCalls.createFinding as SinonStub) .getCall(0) @@ -561,9 +557,10 @@ describe('v1.SecurityCenterClient', () => { undefined, expectedError ); - await assert.rejects(async () => { - await client.createNotificationConfig(request); - }, expectedError); + await assert.rejects( + client.createNotificationConfig(request), + expectedError + ); assert( (client.innerApiCalls.createNotificationConfig as SinonStub) .getCall(0) @@ -677,9 +674,10 @@ describe('v1.SecurityCenterClient', () => { undefined, expectedError ); - await assert.rejects(async () => { - await client.deleteNotificationConfig(request); - }, expectedError); + await assert.rejects( + client.deleteNotificationConfig(request), + expectedError + ); assert( (client.innerApiCalls.deleteNotificationConfig as SinonStub) .getCall(0) @@ -791,9 +789,7 @@ describe('v1.SecurityCenterClient', () => { undefined, expectedError ); - await assert.rejects(async () => { - await client.getIamPolicy(request); - }, expectedError); + await assert.rejects(client.getIamPolicy(request), expectedError); assert( (client.innerApiCalls.getIamPolicy as SinonStub) .getCall(0) @@ -907,9 +903,10 @@ describe('v1.SecurityCenterClient', () => { undefined, expectedError ); - await assert.rejects(async () => { - await client.getNotificationConfig(request); - }, expectedError); + await assert.rejects( + client.getNotificationConfig(request), + expectedError + ); assert( (client.innerApiCalls.getNotificationConfig as SinonStub) .getCall(0) @@ -1023,9 +1020,10 @@ describe('v1.SecurityCenterClient', () => { undefined, expectedError ); - await assert.rejects(async () => { - await client.getOrganizationSettings(request); - }, expectedError); + await assert.rejects( + client.getOrganizationSettings(request), + expectedError + ); assert( (client.innerApiCalls.getOrganizationSettings as SinonStub) .getCall(0) @@ -1134,9 +1132,7 @@ describe('v1.SecurityCenterClient', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.getSource = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => { - await client.getSource(request); - }, expectedError); + await assert.rejects(client.getSource(request), expectedError); assert( (client.innerApiCalls.getSource as SinonStub) .getCall(0) @@ -1248,9 +1244,7 @@ describe('v1.SecurityCenterClient', () => { undefined, expectedError ); - await assert.rejects(async () => { - await client.setFindingState(request); - }, expectedError); + await assert.rejects(client.setFindingState(request), expectedError); assert( (client.innerApiCalls.setFindingState as SinonStub) .getCall(0) @@ -1362,9 +1356,7 @@ describe('v1.SecurityCenterClient', () => { undefined, expectedError ); - await assert.rejects(async () => { - await client.setIamPolicy(request); - }, expectedError); + await assert.rejects(client.setIamPolicy(request), expectedError); assert( (client.innerApiCalls.setIamPolicy as SinonStub) .getCall(0) @@ -1478,9 +1470,7 @@ describe('v1.SecurityCenterClient', () => { undefined, expectedError ); - await assert.rejects(async () => { - await client.testIamPermissions(request); - }, expectedError); + await assert.rejects(client.testIamPermissions(request), expectedError); assert( (client.innerApiCalls.testIamPermissions as SinonStub) .getCall(0) @@ -1595,9 +1585,7 @@ describe('v1.SecurityCenterClient', () => { undefined, expectedError ); - await assert.rejects(async () => { - await client.updateFinding(request); - }, expectedError); + await assert.rejects(client.updateFinding(request), expectedError); assert( (client.innerApiCalls.updateFinding as SinonStub) .getCall(0) @@ -1714,9 +1702,10 @@ describe('v1.SecurityCenterClient', () => { undefined, expectedError ); - await assert.rejects(async () => { - await client.updateNotificationConfig(request); - }, expectedError); + await assert.rejects( + client.updateNotificationConfig(request), + expectedError + ); assert( (client.innerApiCalls.updateNotificationConfig as SinonStub) .getCall(0) @@ -1833,9 +1822,10 @@ describe('v1.SecurityCenterClient', () => { undefined, expectedError ); - await assert.rejects(async () => { - await client.updateOrganizationSettings(request); - }, expectedError); + await assert.rejects( + client.updateOrganizationSettings(request), + expectedError + ); assert( (client.innerApiCalls.updateOrganizationSettings as SinonStub) .getCall(0) @@ -1950,9 +1940,7 @@ describe('v1.SecurityCenterClient', () => { undefined, expectedError ); - await assert.rejects(async () => { - await client.updateSource(request); - }, expectedError); + await assert.rejects(client.updateSource(request), expectedError); assert( (client.innerApiCalls.updateSource as SinonStub) .getCall(0) @@ -2069,9 +2057,7 @@ describe('v1.SecurityCenterClient', () => { undefined, expectedError ); - await assert.rejects(async () => { - await client.updateSecurityMarks(request); - }, expectedError); + await assert.rejects(client.updateSecurityMarks(request), expectedError); assert( (client.innerApiCalls.updateSecurityMarks as SinonStub) .getCall(0) @@ -2193,9 +2179,7 @@ describe('v1.SecurityCenterClient', () => { undefined, expectedError ); - await assert.rejects(async () => { - await client.runAssetDiscovery(request); - }, expectedError); + await assert.rejects(client.runAssetDiscovery(request), expectedError); assert( (client.innerApiCalls.runAssetDiscovery as SinonStub) .getCall(0) @@ -2228,15 +2212,54 @@ describe('v1.SecurityCenterClient', () => { expectedError ); const [operation] = await client.runAssetDiscovery(request); - await assert.rejects(async () => { - await operation.promise(); - }, expectedError); + await assert.rejects(operation.promise(), expectedError); assert( (client.innerApiCalls.runAssetDiscovery as SinonStub) .getCall(0) .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes checkRunAssetDiscoveryProgress without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkRunAssetDiscoveryProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkRunAssetDiscoveryProgress with error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.checkRunAssetDiscoveryProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); }); describe('groupAssets', () => { @@ -2358,9 +2381,7 @@ describe('v1.SecurityCenterClient', () => { undefined, expectedError ); - await assert.rejects(async () => { - await client.groupAssets(request); - }, expectedError); + await assert.rejects(client.groupAssets(request), expectedError); assert( (client.innerApiCalls.groupAssets as SinonStub) .getCall(0) @@ -2456,9 +2477,7 @@ describe('v1.SecurityCenterClient', () => { reject(err); }); }); - await assert.rejects(async () => { - await promise; - }, expectedError); + await assert.rejects(promise, expectedError); assert( (client.descriptors.page.groupAssets.createStream as SinonStub) .getCall(0) @@ -2674,9 +2693,7 @@ describe('v1.SecurityCenterClient', () => { undefined, expectedError ); - await assert.rejects(async () => { - await client.groupFindings(request); - }, expectedError); + await assert.rejects(client.groupFindings(request), expectedError); assert( (client.innerApiCalls.groupFindings as SinonStub) .getCall(0) @@ -2773,9 +2790,7 @@ describe('v1.SecurityCenterClient', () => { reject(err); }); }); - await assert.rejects(async () => { - await promise; - }, expectedError); + await assert.rejects(promise, expectedError); assert( (client.descriptors.page.groupFindings.createStream as SinonStub) .getCall(0) @@ -2994,9 +3009,7 @@ describe('v1.SecurityCenterClient', () => { undefined, expectedError ); - await assert.rejects(async () => { - await client.listAssets(request); - }, expectedError); + await assert.rejects(client.listAssets(request), expectedError); assert( (client.innerApiCalls.listAssets as SinonStub) .getCall(0) @@ -3096,9 +3109,7 @@ describe('v1.SecurityCenterClient', () => { reject(err); }); }); - await assert.rejects(async () => { - await promise; - }, expectedError); + await assert.rejects(promise, expectedError); assert( (client.descriptors.page.listAssets.createStream as SinonStub) .getCall(0) @@ -3316,9 +3327,7 @@ describe('v1.SecurityCenterClient', () => { undefined, expectedError ); - await assert.rejects(async () => { - await client.listFindings(request); - }, expectedError); + await assert.rejects(client.listFindings(request), expectedError); assert( (client.innerApiCalls.listFindings as SinonStub) .getCall(0) @@ -3419,9 +3428,7 @@ describe('v1.SecurityCenterClient', () => { reject(err); }); }); - await assert.rejects(async () => { - await promise; - }, expectedError); + await assert.rejects(promise, expectedError); assert( (client.descriptors.page.listFindings.createStream as SinonStub) .getCall(0) @@ -3642,9 +3649,10 @@ describe('v1.SecurityCenterClient', () => { undefined, expectedError ); - await assert.rejects(async () => { - await client.listNotificationConfigs(request); - }, expectedError); + await assert.rejects( + client.listNotificationConfigs(request), + expectedError + ); assert( (client.innerApiCalls.listNotificationConfigs as SinonStub) .getCall(0) @@ -3746,9 +3754,7 @@ describe('v1.SecurityCenterClient', () => { reject(err); }); }); - await assert.rejects(async () => { - await promise; - }, expectedError); + await assert.rejects(promise, expectedError); assert( (client.descriptors.page.listNotificationConfigs .createStream as SinonStub) @@ -3966,9 +3972,7 @@ describe('v1.SecurityCenterClient', () => { undefined, expectedError ); - await assert.rejects(async () => { - await client.listSources(request); - }, expectedError); + await assert.rejects(client.listSources(request), expectedError); assert( (client.innerApiCalls.listSources as SinonStub) .getCall(0) @@ -4064,9 +4068,7 @@ describe('v1.SecurityCenterClient', () => { reject(err); }); }); - await assert.rejects(async () => { - await promise; - }, expectedError); + await assert.rejects(promise, expectedError); assert( (client.descriptors.page.listSources.createStream as SinonStub) .getCall(0) diff --git a/packages/google-cloud-securitycenter/test/gapic_security_center_v1beta1.ts b/packages/google-cloud-securitycenter/test/gapic_security_center_v1beta1.ts index 40c1cb9ed40..fe979c80a03 100644 --- a/packages/google-cloud-securitycenter/test/gapic_security_center_v1beta1.ts +++ b/packages/google-cloud-securitycenter/test/gapic_security_center_v1beta1.ts @@ -25,7 +25,7 @@ import * as securitycenterModule from '../src'; import {PassThrough} from 'stream'; -import {protobuf, LROperation} from 'google-gax'; +import {protobuf, LROperation, operationsProtos} from 'google-gax'; function generateSampleMessage(instance: T) { const filledObject = (instance.constructor as typeof protobuf.Message).toObject( @@ -331,9 +331,7 @@ describe('v1beta1.SecurityCenterClient', () => { undefined, expectedError ); - await assert.rejects(async () => { - await client.createSource(request); - }, expectedError); + await assert.rejects(client.createSource(request), expectedError); assert( (client.innerApiCalls.createSource as SinonStub) .getCall(0) @@ -445,9 +443,7 @@ describe('v1beta1.SecurityCenterClient', () => { undefined, expectedError ); - await assert.rejects(async () => { - await client.createFinding(request); - }, expectedError); + await assert.rejects(client.createFinding(request), expectedError); assert( (client.innerApiCalls.createFinding as SinonStub) .getCall(0) @@ -559,9 +555,7 @@ describe('v1beta1.SecurityCenterClient', () => { undefined, expectedError ); - await assert.rejects(async () => { - await client.getIamPolicy(request); - }, expectedError); + await assert.rejects(client.getIamPolicy(request), expectedError); assert( (client.innerApiCalls.getIamPolicy as SinonStub) .getCall(0) @@ -675,9 +669,10 @@ describe('v1beta1.SecurityCenterClient', () => { undefined, expectedError ); - await assert.rejects(async () => { - await client.getOrganizationSettings(request); - }, expectedError); + await assert.rejects( + client.getOrganizationSettings(request), + expectedError + ); assert( (client.innerApiCalls.getOrganizationSettings as SinonStub) .getCall(0) @@ -786,9 +781,7 @@ describe('v1beta1.SecurityCenterClient', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.getSource = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => { - await client.getSource(request); - }, expectedError); + await assert.rejects(client.getSource(request), expectedError); assert( (client.innerApiCalls.getSource as SinonStub) .getCall(0) @@ -900,9 +893,7 @@ describe('v1beta1.SecurityCenterClient', () => { undefined, expectedError ); - await assert.rejects(async () => { - await client.setFindingState(request); - }, expectedError); + await assert.rejects(client.setFindingState(request), expectedError); assert( (client.innerApiCalls.setFindingState as SinonStub) .getCall(0) @@ -1014,9 +1005,7 @@ describe('v1beta1.SecurityCenterClient', () => { undefined, expectedError ); - await assert.rejects(async () => { - await client.setIamPolicy(request); - }, expectedError); + await assert.rejects(client.setIamPolicy(request), expectedError); assert( (client.innerApiCalls.setIamPolicy as SinonStub) .getCall(0) @@ -1130,9 +1119,7 @@ describe('v1beta1.SecurityCenterClient', () => { undefined, expectedError ); - await assert.rejects(async () => { - await client.testIamPermissions(request); - }, expectedError); + await assert.rejects(client.testIamPermissions(request), expectedError); assert( (client.innerApiCalls.testIamPermissions as SinonStub) .getCall(0) @@ -1247,9 +1234,7 @@ describe('v1beta1.SecurityCenterClient', () => { undefined, expectedError ); - await assert.rejects(async () => { - await client.updateFinding(request); - }, expectedError); + await assert.rejects(client.updateFinding(request), expectedError); assert( (client.innerApiCalls.updateFinding as SinonStub) .getCall(0) @@ -1366,9 +1351,10 @@ describe('v1beta1.SecurityCenterClient', () => { undefined, expectedError ); - await assert.rejects(async () => { - await client.updateOrganizationSettings(request); - }, expectedError); + await assert.rejects( + client.updateOrganizationSettings(request), + expectedError + ); assert( (client.innerApiCalls.updateOrganizationSettings as SinonStub) .getCall(0) @@ -1483,9 +1469,7 @@ describe('v1beta1.SecurityCenterClient', () => { undefined, expectedError ); - await assert.rejects(async () => { - await client.updateSource(request); - }, expectedError); + await assert.rejects(client.updateSource(request), expectedError); assert( (client.innerApiCalls.updateSource as SinonStub) .getCall(0) @@ -1602,9 +1586,7 @@ describe('v1beta1.SecurityCenterClient', () => { undefined, expectedError ); - await assert.rejects(async () => { - await client.updateSecurityMarks(request); - }, expectedError); + await assert.rejects(client.updateSecurityMarks(request), expectedError); assert( (client.innerApiCalls.updateSecurityMarks as SinonStub) .getCall(0) @@ -1726,9 +1708,7 @@ describe('v1beta1.SecurityCenterClient', () => { undefined, expectedError ); - await assert.rejects(async () => { - await client.runAssetDiscovery(request); - }, expectedError); + await assert.rejects(client.runAssetDiscovery(request), expectedError); assert( (client.innerApiCalls.runAssetDiscovery as SinonStub) .getCall(0) @@ -1761,15 +1741,54 @@ describe('v1beta1.SecurityCenterClient', () => { expectedError ); const [operation] = await client.runAssetDiscovery(request); - await assert.rejects(async () => { - await operation.promise(); - }, expectedError); + await assert.rejects(operation.promise(), expectedError); assert( (client.innerApiCalls.runAssetDiscovery as SinonStub) .getCall(0) .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes checkRunAssetDiscoveryProgress without error', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkRunAssetDiscoveryProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkRunAssetDiscoveryProgress with error', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.checkRunAssetDiscoveryProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); }); describe('groupAssets', () => { @@ -1893,9 +1912,7 @@ describe('v1beta1.SecurityCenterClient', () => { undefined, expectedError ); - await assert.rejects(async () => { - await client.groupAssets(request); - }, expectedError); + await assert.rejects(client.groupAssets(request), expectedError); assert( (client.innerApiCalls.groupAssets as SinonStub) .getCall(0) @@ -1995,9 +2012,7 @@ describe('v1beta1.SecurityCenterClient', () => { reject(err); }); }); - await assert.rejects(async () => { - await promise; - }, expectedError); + await assert.rejects(promise, expectedError); assert( (client.descriptors.page.groupAssets.createStream as SinonStub) .getCall(0) @@ -2215,9 +2230,7 @@ describe('v1beta1.SecurityCenterClient', () => { undefined, expectedError ); - await assert.rejects(async () => { - await client.groupFindings(request); - }, expectedError); + await assert.rejects(client.groupFindings(request), expectedError); assert( (client.innerApiCalls.groupFindings as SinonStub) .getCall(0) @@ -2318,9 +2331,7 @@ describe('v1beta1.SecurityCenterClient', () => { reject(err); }); }); - await assert.rejects(async () => { - await promise; - }, expectedError); + await assert.rejects(promise, expectedError); assert( (client.descriptors.page.groupFindings.createStream as SinonStub) .getCall(0) @@ -2539,9 +2550,7 @@ describe('v1beta1.SecurityCenterClient', () => { undefined, expectedError ); - await assert.rejects(async () => { - await client.listAssets(request); - }, expectedError); + await assert.rejects(client.listAssets(request), expectedError); assert( (client.innerApiCalls.listAssets as SinonStub) .getCall(0) @@ -2641,9 +2650,7 @@ describe('v1beta1.SecurityCenterClient', () => { reject(err); }); }); - await assert.rejects(async () => { - await promise; - }, expectedError); + await assert.rejects(promise, expectedError); assert( (client.descriptors.page.listAssets.createStream as SinonStub) .getCall(0) @@ -2861,9 +2868,7 @@ describe('v1beta1.SecurityCenterClient', () => { undefined, expectedError ); - await assert.rejects(async () => { - await client.listFindings(request); - }, expectedError); + await assert.rejects(client.listFindings(request), expectedError); assert( (client.innerApiCalls.listFindings as SinonStub) .getCall(0) @@ -2960,9 +2965,7 @@ describe('v1beta1.SecurityCenterClient', () => { reject(err); }); }); - await assert.rejects(async () => { - await promise; - }, expectedError); + await assert.rejects(promise, expectedError); assert( (client.descriptors.page.listFindings.createStream as SinonStub) .getCall(0) @@ -3179,9 +3182,7 @@ describe('v1beta1.SecurityCenterClient', () => { undefined, expectedError ); - await assert.rejects(async () => { - await client.listSources(request); - }, expectedError); + await assert.rejects(client.listSources(request), expectedError); assert( (client.innerApiCalls.listSources as SinonStub) .getCall(0) @@ -3277,9 +3278,7 @@ describe('v1beta1.SecurityCenterClient', () => { reject(err); }); }); - await assert.rejects(async () => { - await promise; - }, expectedError); + await assert.rejects(promise, expectedError); assert( (client.descriptors.page.listSources.createStream as SinonStub) .getCall(0) diff --git a/packages/google-cloud-securitycenter/test/gapic_security_center_v1p1beta1.ts b/packages/google-cloud-securitycenter/test/gapic_security_center_v1p1beta1.ts index 43fd674dfbb..1ecf3a9a91f 100644 --- a/packages/google-cloud-securitycenter/test/gapic_security_center_v1p1beta1.ts +++ b/packages/google-cloud-securitycenter/test/gapic_security_center_v1p1beta1.ts @@ -25,7 +25,7 @@ import * as securitycenterModule from '../src'; import {PassThrough} from 'stream'; -import {protobuf, LROperation} from 'google-gax'; +import {protobuf, LROperation, operationsProtos} from 'google-gax'; function generateSampleMessage(instance: T) { const filledObject = (instance.constructor as typeof protobuf.Message).toObject( @@ -331,9 +331,7 @@ describe('v1p1beta1.SecurityCenterClient', () => { undefined, expectedError ); - await assert.rejects(async () => { - await client.createSource(request); - }, expectedError); + await assert.rejects(client.createSource(request), expectedError); assert( (client.innerApiCalls.createSource as SinonStub) .getCall(0) @@ -445,9 +443,7 @@ describe('v1p1beta1.SecurityCenterClient', () => { undefined, expectedError ); - await assert.rejects(async () => { - await client.createFinding(request); - }, expectedError); + await assert.rejects(client.createFinding(request), expectedError); assert( (client.innerApiCalls.createFinding as SinonStub) .getCall(0) @@ -561,9 +557,10 @@ describe('v1p1beta1.SecurityCenterClient', () => { undefined, expectedError ); - await assert.rejects(async () => { - await client.createNotificationConfig(request); - }, expectedError); + await assert.rejects( + client.createNotificationConfig(request), + expectedError + ); assert( (client.innerApiCalls.createNotificationConfig as SinonStub) .getCall(0) @@ -677,9 +674,10 @@ describe('v1p1beta1.SecurityCenterClient', () => { undefined, expectedError ); - await assert.rejects(async () => { - await client.deleteNotificationConfig(request); - }, expectedError); + await assert.rejects( + client.deleteNotificationConfig(request), + expectedError + ); assert( (client.innerApiCalls.deleteNotificationConfig as SinonStub) .getCall(0) @@ -791,9 +789,7 @@ describe('v1p1beta1.SecurityCenterClient', () => { undefined, expectedError ); - await assert.rejects(async () => { - await client.getIamPolicy(request); - }, expectedError); + await assert.rejects(client.getIamPolicy(request), expectedError); assert( (client.innerApiCalls.getIamPolicy as SinonStub) .getCall(0) @@ -907,9 +903,10 @@ describe('v1p1beta1.SecurityCenterClient', () => { undefined, expectedError ); - await assert.rejects(async () => { - await client.getNotificationConfig(request); - }, expectedError); + await assert.rejects( + client.getNotificationConfig(request), + expectedError + ); assert( (client.innerApiCalls.getNotificationConfig as SinonStub) .getCall(0) @@ -1023,9 +1020,10 @@ describe('v1p1beta1.SecurityCenterClient', () => { undefined, expectedError ); - await assert.rejects(async () => { - await client.getOrganizationSettings(request); - }, expectedError); + await assert.rejects( + client.getOrganizationSettings(request), + expectedError + ); assert( (client.innerApiCalls.getOrganizationSettings as SinonStub) .getCall(0) @@ -1134,9 +1132,7 @@ describe('v1p1beta1.SecurityCenterClient', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.getSource = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => { - await client.getSource(request); - }, expectedError); + await assert.rejects(client.getSource(request), expectedError); assert( (client.innerApiCalls.getSource as SinonStub) .getCall(0) @@ -1248,9 +1244,7 @@ describe('v1p1beta1.SecurityCenterClient', () => { undefined, expectedError ); - await assert.rejects(async () => { - await client.setFindingState(request); - }, expectedError); + await assert.rejects(client.setFindingState(request), expectedError); assert( (client.innerApiCalls.setFindingState as SinonStub) .getCall(0) @@ -1362,9 +1356,7 @@ describe('v1p1beta1.SecurityCenterClient', () => { undefined, expectedError ); - await assert.rejects(async () => { - await client.setIamPolicy(request); - }, expectedError); + await assert.rejects(client.setIamPolicy(request), expectedError); assert( (client.innerApiCalls.setIamPolicy as SinonStub) .getCall(0) @@ -1478,9 +1470,7 @@ describe('v1p1beta1.SecurityCenterClient', () => { undefined, expectedError ); - await assert.rejects(async () => { - await client.testIamPermissions(request); - }, expectedError); + await assert.rejects(client.testIamPermissions(request), expectedError); assert( (client.innerApiCalls.testIamPermissions as SinonStub) .getCall(0) @@ -1595,9 +1585,7 @@ describe('v1p1beta1.SecurityCenterClient', () => { undefined, expectedError ); - await assert.rejects(async () => { - await client.updateFinding(request); - }, expectedError); + await assert.rejects(client.updateFinding(request), expectedError); assert( (client.innerApiCalls.updateFinding as SinonStub) .getCall(0) @@ -1714,9 +1702,10 @@ describe('v1p1beta1.SecurityCenterClient', () => { undefined, expectedError ); - await assert.rejects(async () => { - await client.updateNotificationConfig(request); - }, expectedError); + await assert.rejects( + client.updateNotificationConfig(request), + expectedError + ); assert( (client.innerApiCalls.updateNotificationConfig as SinonStub) .getCall(0) @@ -1833,9 +1822,10 @@ describe('v1p1beta1.SecurityCenterClient', () => { undefined, expectedError ); - await assert.rejects(async () => { - await client.updateOrganizationSettings(request); - }, expectedError); + await assert.rejects( + client.updateOrganizationSettings(request), + expectedError + ); assert( (client.innerApiCalls.updateOrganizationSettings as SinonStub) .getCall(0) @@ -1950,9 +1940,7 @@ describe('v1p1beta1.SecurityCenterClient', () => { undefined, expectedError ); - await assert.rejects(async () => { - await client.updateSource(request); - }, expectedError); + await assert.rejects(client.updateSource(request), expectedError); assert( (client.innerApiCalls.updateSource as SinonStub) .getCall(0) @@ -2069,9 +2057,7 @@ describe('v1p1beta1.SecurityCenterClient', () => { undefined, expectedError ); - await assert.rejects(async () => { - await client.updateSecurityMarks(request); - }, expectedError); + await assert.rejects(client.updateSecurityMarks(request), expectedError); assert( (client.innerApiCalls.updateSecurityMarks as SinonStub) .getCall(0) @@ -2193,9 +2179,7 @@ describe('v1p1beta1.SecurityCenterClient', () => { undefined, expectedError ); - await assert.rejects(async () => { - await client.runAssetDiscovery(request); - }, expectedError); + await assert.rejects(client.runAssetDiscovery(request), expectedError); assert( (client.innerApiCalls.runAssetDiscovery as SinonStub) .getCall(0) @@ -2228,15 +2212,54 @@ describe('v1p1beta1.SecurityCenterClient', () => { expectedError ); const [operation] = await client.runAssetDiscovery(request); - await assert.rejects(async () => { - await operation.promise(); - }, expectedError); + await assert.rejects(operation.promise(), expectedError); assert( (client.innerApiCalls.runAssetDiscovery as SinonStub) .getCall(0) .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes checkRunAssetDiscoveryProgress without error', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkRunAssetDiscoveryProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkRunAssetDiscoveryProgress with error', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.checkRunAssetDiscoveryProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); }); describe('groupAssets', () => { @@ -2360,9 +2383,7 @@ describe('v1p1beta1.SecurityCenterClient', () => { undefined, expectedError ); - await assert.rejects(async () => { - await client.groupAssets(request); - }, expectedError); + await assert.rejects(client.groupAssets(request), expectedError); assert( (client.innerApiCalls.groupAssets as SinonStub) .getCall(0) @@ -2462,9 +2483,7 @@ describe('v1p1beta1.SecurityCenterClient', () => { reject(err); }); }); - await assert.rejects(async () => { - await promise; - }, expectedError); + await assert.rejects(promise, expectedError); assert( (client.descriptors.page.groupAssets.createStream as SinonStub) .getCall(0) @@ -2682,9 +2701,7 @@ describe('v1p1beta1.SecurityCenterClient', () => { undefined, expectedError ); - await assert.rejects(async () => { - await client.groupFindings(request); - }, expectedError); + await assert.rejects(client.groupFindings(request), expectedError); assert( (client.innerApiCalls.groupFindings as SinonStub) .getCall(0) @@ -2785,9 +2802,7 @@ describe('v1p1beta1.SecurityCenterClient', () => { reject(err); }); }); - await assert.rejects(async () => { - await promise; - }, expectedError); + await assert.rejects(promise, expectedError); assert( (client.descriptors.page.groupFindings.createStream as SinonStub) .getCall(0) @@ -3006,9 +3021,7 @@ describe('v1p1beta1.SecurityCenterClient', () => { undefined, expectedError ); - await assert.rejects(async () => { - await client.listAssets(request); - }, expectedError); + await assert.rejects(client.listAssets(request), expectedError); assert( (client.innerApiCalls.listAssets as SinonStub) .getCall(0) @@ -3108,9 +3121,7 @@ describe('v1p1beta1.SecurityCenterClient', () => { reject(err); }); }); - await assert.rejects(async () => { - await promise; - }, expectedError); + await assert.rejects(promise, expectedError); assert( (client.descriptors.page.listAssets.createStream as SinonStub) .getCall(0) @@ -3328,9 +3339,7 @@ describe('v1p1beta1.SecurityCenterClient', () => { undefined, expectedError ); - await assert.rejects(async () => { - await client.listFindings(request); - }, expectedError); + await assert.rejects(client.listFindings(request), expectedError); assert( (client.innerApiCalls.listFindings as SinonStub) .getCall(0) @@ -3431,9 +3440,7 @@ describe('v1p1beta1.SecurityCenterClient', () => { reject(err); }); }); - await assert.rejects(async () => { - await promise; - }, expectedError); + await assert.rejects(promise, expectedError); assert( (client.descriptors.page.listFindings.createStream as SinonStub) .getCall(0) @@ -3654,9 +3661,10 @@ describe('v1p1beta1.SecurityCenterClient', () => { undefined, expectedError ); - await assert.rejects(async () => { - await client.listNotificationConfigs(request); - }, expectedError); + await assert.rejects( + client.listNotificationConfigs(request), + expectedError + ); assert( (client.innerApiCalls.listNotificationConfigs as SinonStub) .getCall(0) @@ -3758,9 +3766,7 @@ describe('v1p1beta1.SecurityCenterClient', () => { reject(err); }); }); - await assert.rejects(async () => { - await promise; - }, expectedError); + await assert.rejects(promise, expectedError); assert( (client.descriptors.page.listNotificationConfigs .createStream as SinonStub) @@ -3980,9 +3986,7 @@ describe('v1p1beta1.SecurityCenterClient', () => { undefined, expectedError ); - await assert.rejects(async () => { - await client.listSources(request); - }, expectedError); + await assert.rejects(client.listSources(request), expectedError); assert( (client.innerApiCalls.listSources as SinonStub) .getCall(0) @@ -4078,9 +4082,7 @@ describe('v1p1beta1.SecurityCenterClient', () => { reject(err); }); }); - await assert.rejects(async () => { - await promise; - }, expectedError); + await assert.rejects(promise, expectedError); assert( (client.descriptors.page.listSources.createStream as SinonStub) .getCall(0) From f8d6d64c40a55f9ba91c9c0eacd437a943f4ce6f Mon Sep 17 00:00:00 2001 From: Summer Ji Date: Wed, 6 May 2020 16:40:35 -0700 Subject: [PATCH 176/342] fix: synth.py clean up for multiple version (#274) --- .../google-cloud-securitycenter/src/index.ts | 15 ++++++--------- .../google-cloud-securitycenter/synth.metadata | 16 ++++++++++++---- packages/google-cloud-securitycenter/synth.py | 10 ++++++---- 3 files changed, 24 insertions(+), 17 deletions(-) diff --git a/packages/google-cloud-securitycenter/src/index.ts b/packages/google-cloud-securitycenter/src/index.ts index 9078fa15e8e..49327a530ce 100644 --- a/packages/google-cloud-securitycenter/src/index.ts +++ b/packages/google-cloud-securitycenter/src/index.ts @@ -8,24 +8,21 @@ // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIEscS OR CONDITIONS OF ANY KIND, either express or implied. -// See the License fscor the specific language governing permissions and -// limitations undersc the License. +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** This file is automatically generated by synthtool. ** +// ** https://github.com/googleapis/synthtool ** // ** All changes to this file may be overwritten. ** import * as v1 from './v1'; import * as v1beta1 from './v1beta1'; import * as v1p1beta1 from './v1p1beta1'; -export {v1, v1beta1, v1p1beta1, SecurityCenterClient}; - const SecurityCenterClient = v1.SecurityCenterClient; -// For compatibility with JavaScript libraries we need to provide this default export: -// tslint:disable-next-line no-default-export +export {v1, v1beta1, v1p1beta1, SecurityCenterClient}; export default {v1, v1beta1, v1p1beta1, SecurityCenterClient}; import * as protos from '../protos/protos'; export {protos}; diff --git a/packages/google-cloud-securitycenter/synth.metadata b/packages/google-cloud-securitycenter/synth.metadata index e44dc53fe97..d8113e6973f 100644 --- a/packages/google-cloud-securitycenter/synth.metadata +++ b/packages/google-cloud-securitycenter/synth.metadata @@ -4,14 +4,22 @@ "git": { "name": ".", "remote": "git@github.com:googleapis/nodejs-security-center.git", - "sha": "073960395fdaafcbdd921fba26ba1ace5e303813" + "sha": "dd0f4d1866ec61e37392c79cf7f148e339d04d1b" + } + }, + { + "git": { + "name": "googleapis", + "remote": "https://github.com/googleapis/googleapis.git", + "sha": "839fae42335ee1bb1e70767f3e6c51738683892b", + "internalRef": "310213770" } }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "ab883569eb0257bbf16a6d825fd018b3adde3912" + "sha": "be74d3e532faa47eb59f1a0eaebde0860d1d8ab4" } } ], @@ -20,7 +28,7 @@ "client": { "source": "googleapis", "apiName": "securitycenter", - "apiVersion": "v1beta1", + "apiVersion": "v1", "language": "typescript", "generator": "gapic-generator-typescript" } @@ -29,7 +37,7 @@ "client": { "source": "googleapis", "apiName": "securitycenter", - "apiVersion": "v1", + "apiVersion": "v1beta1", "language": "typescript", "generator": "gapic-generator-typescript" } diff --git a/packages/google-cloud-securitycenter/synth.py b/packages/google-cloud-securitycenter/synth.py index 9d7b0f68f8b..c0236f7346a 100644 --- a/packages/google-cloud-securitycenter/synth.py +++ b/packages/google-cloud-securitycenter/synth.py @@ -24,7 +24,7 @@ # Run the gapic generator gapic = gcp.GAPICMicrogenerator() -versions = ['v1beta1', 'v1', 'v1p1beta1'] +versions = ['v1', 'v1beta1', 'v1p1beta1'] name = 'securitycenter' for version in versions: library = gapic.typescript_library( @@ -39,12 +39,14 @@ # skip index, protos, package.json, and README.md s.copy( library, - excludes=['package.json', 'src/index.ts', 'README.md'] + excludes=['package.json', 'README.md'] ) # Copy common templates common_templates = gcp.CommonTemplates() -templates = common_templates.node_library(source_location='build/src') -s.copy(templates, excludes=['.kokoro/samples-test.sh', '.kokoro/samples-test.sh']) +templates = common_templates.node_library( + source_location='build/src', versions=versions, default_version='v1') +s.copy(templates, excludes=[ + '.kokoro/samples-test.sh', '.kokoro/samples-test.sh']) node.postprocess_gapic_library() From 4589e27943953d7db4361968fefc4a30758761ba Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 28 May 2020 00:14:40 +0200 Subject: [PATCH 177/342] fix(deps): update dependency @google-cloud/pubsub to v2 (#276) --- packages/google-cloud-securitycenter/samples/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-securitycenter/samples/package.json b/packages/google-cloud-securitycenter/samples/package.json index d760ff620b0..f3d0a219639 100644 --- a/packages/google-cloud-securitycenter/samples/package.json +++ b/packages/google-cloud-securitycenter/samples/package.json @@ -13,7 +13,7 @@ }, "license": "Apache-2.0", "dependencies": { - "@google-cloud/pubsub": "^1.5.0", + "@google-cloud/pubsub": "^2.0.0", "@google-cloud/security-center": "^3.1.0" }, "devDependencies": { From e79ace4a2527ced99346ff26ae2d2d91f29c81a0 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Wed, 3 Jun 2020 17:39:10 -0700 Subject: [PATCH 178/342] build: update protos.js (#277) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/041f5df7-f5d3-4b2a-9ede-0752bf41c185/targets --- .../protos/protos.d.ts | 6 +++++ .../protos/protos.js | 26 +++++++++++++++++-- .../protos/protos.json | 6 ++++- .../synth.metadata | 4 +-- 4 files changed, 37 insertions(+), 5 deletions(-) diff --git a/packages/google-cloud-securitycenter/protos/protos.d.ts b/packages/google-cloud-securitycenter/protos/protos.d.ts index 2ffbf461c71..36b859448eb 100644 --- a/packages/google-cloud-securitycenter/protos/protos.d.ts +++ b/packages/google-cloud-securitycenter/protos/protos.d.ts @@ -14878,6 +14878,9 @@ export namespace google { /** FieldDescriptorProto options */ options?: (google.protobuf.IFieldOptions|null); + + /** FieldDescriptorProto proto3Optional */ + proto3Optional?: (boolean|null); } /** Represents a FieldDescriptorProto. */ @@ -14919,6 +14922,9 @@ export namespace google { /** 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 diff --git a/packages/google-cloud-securitycenter/protos/protos.js b/packages/google-cloud-securitycenter/protos/protos.js index 8a6969c26fd..bb1dd2bab62 100644 --- a/packages/google-cloud-securitycenter/protos/protos.js +++ b/packages/google-cloud-securitycenter/protos/protos.js @@ -35503,6 +35503,7 @@ * @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 */ /** @@ -35600,6 +35601,14 @@ */ 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 @@ -35644,6 +35653,8 @@ 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; }; @@ -35708,6 +35719,9 @@ 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; @@ -35802,6 +35816,9 @@ if (error) return "options." + error; } + if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional")) + if (typeof message.proto3Optional !== "boolean") + return "proto3Optional: boolean expected"; return null; }; @@ -35924,6 +35941,8 @@ 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; }; @@ -35951,6 +35970,7 @@ object.options = null; object.oneofIndex = 0; object.jsonName = ""; + object.proto3Optional = false; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -35972,6 +35992,8 @@ 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; }; @@ -37765,7 +37787,7 @@ * @memberof google.protobuf.FileOptions * @instance */ - FileOptions.prototype.ccEnableArenas = false; + FileOptions.prototype.ccEnableArenas = true; /** * FileOptions objcClassPrefix. @@ -38251,7 +38273,7 @@ object.javaGenerateEqualsAndHash = false; object.deprecated = false; object.javaStringCheckUtf8 = false; - object.ccEnableArenas = false; + object.ccEnableArenas = true; object.objcClassPrefix = ""; object.csharpNamespace = ""; object.swiftPrefix = ""; diff --git a/packages/google-cloud-securitycenter/protos/protos.json b/packages/google-cloud-securitycenter/protos/protos.json index 666f1bfd74c..5c8e73dddc5 100644 --- a/packages/google-cloud-securitycenter/protos/protos.json +++ b/packages/google-cloud-securitycenter/protos/protos.json @@ -3694,6 +3694,10 @@ "options": { "type": "FieldOptions", "id": 8 + }, + "proto3Optional": { + "type": "bool", + "id": 17 } }, "nested": { @@ -3929,7 +3933,7 @@ "type": "bool", "id": 31, "options": { - "default": false + "default": true } }, "objcClassPrefix": { diff --git a/packages/google-cloud-securitycenter/synth.metadata b/packages/google-cloud-securitycenter/synth.metadata index d8113e6973f..96f8552b039 100644 --- a/packages/google-cloud-securitycenter/synth.metadata +++ b/packages/google-cloud-securitycenter/synth.metadata @@ -3,8 +3,8 @@ { "git": { "name": ".", - "remote": "git@github.com:googleapis/nodejs-security-center.git", - "sha": "dd0f4d1866ec61e37392c79cf7f148e339d04d1b" + "remote": "https://github.com/googleapis/nodejs-security-center.git", + "sha": "6ce252eb770d1a4304301bfbaeacb9d165f8a3e9" } }, { From a15b0b4503df4b52768b3deb054feefc80e14b0e Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 3 Jun 2020 18:18:25 -0700 Subject: [PATCH 179/342] chore: release 4.0.0 (#249) * updated CHANGELOG.md [ci skip] * updated package.json [ci skip] * updated samples/package.json Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- .../google-cloud-securitycenter/CHANGELOG.md | 20 +++++++++++++++++++ .../google-cloud-securitycenter/package.json | 2 +- .../samples/package.json | 2 +- 3 files changed, 22 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-securitycenter/CHANGELOG.md b/packages/google-cloud-securitycenter/CHANGELOG.md index 9c44f8727b8..9f7baa8668a 100644 --- a/packages/google-cloud-securitycenter/CHANGELOG.md +++ b/packages/google-cloud-securitycenter/CHANGELOG.md @@ -4,6 +4,26 @@ [1]: https://www.npmjs.com/package/@google-cloud/security-center?activeTab=versions +## [4.0.0](https://www.github.com/googleapis/nodejs-security-center/compare/v3.1.0...v4.0.0) (2020-06-04) + + +### ⚠ BREAKING CHANGES + +* The library now supports Node.js v10+. The last version to support Node.js v8 is tagged legacy-8 on NPM. + +### Features + +* check status of long running operation by its name ([#273](https://www.github.com/googleapis/nodejs-security-center/issues/273)) ([dd0f4d1](https://www.github.com/googleapis/nodejs-security-center/commit/dd0f4d1866ec61e37392c79cf7f148e339d04d1b)) +* drop node8 support, support for async iterators ([#248](https://www.github.com/googleapis/nodejs-security-center/issues/248)) ([686f741](https://www.github.com/googleapis/nodejs-security-center/commit/686f7418517e6d827bfcbe483d7b1bb014385e10)) + + +### Bug Fixes + +* export explicit version from protos.js ([#253](https://www.github.com/googleapis/nodejs-security-center/issues/253)) ([aa62575](https://www.github.com/googleapis/nodejs-security-center/commit/aa6257554e5b401ba7b7613f0bf78d6233ef300b)) +* remove eslint, update gax, fix generated protos, run the generator ([#258](https://www.github.com/googleapis/nodejs-security-center/issues/258)) ([38e64d7](https://www.github.com/googleapis/nodejs-security-center/commit/38e64d77317870caa81122fa2a9c449dcbe714e0)) +* synth.py clean up for multiple version ([#274](https://www.github.com/googleapis/nodejs-security-center/issues/274)) ([e50061a](https://www.github.com/googleapis/nodejs-security-center/commit/e50061a5f834a356b0221ff01d8de4ed02089260)) +* **deps:** update dependency @google-cloud/pubsub to v2 ([#276](https://www.github.com/googleapis/nodejs-security-center/issues/276)) ([6ce252e](https://www.github.com/googleapis/nodejs-security-center/commit/6ce252eb770d1a4304301bfbaeacb9d165f8a3e9)) + ## [3.1.0](https://www.github.com/googleapis/nodejs-security-center/compare/v3.0.1...v3.1.0) (2020-03-06) diff --git a/packages/google-cloud-securitycenter/package.json b/packages/google-cloud-securitycenter/package.json index b5c658f165a..707785ef933 100644 --- a/packages/google-cloud-securitycenter/package.json +++ b/packages/google-cloud-securitycenter/package.json @@ -1,7 +1,7 @@ { "name": "@google-cloud/security-center", "description": "Cloud Security Command Center API client for Node.js", - "version": "3.1.0", + "version": "4.0.0", "license": "Apache-2.0", "author": "Google LLC", "engines": { diff --git a/packages/google-cloud-securitycenter/samples/package.json b/packages/google-cloud-securitycenter/samples/package.json index f3d0a219639..2cca2acf05a 100644 --- a/packages/google-cloud-securitycenter/samples/package.json +++ b/packages/google-cloud-securitycenter/samples/package.json @@ -14,7 +14,7 @@ "license": "Apache-2.0", "dependencies": { "@google-cloud/pubsub": "^2.0.0", - "@google-cloud/security-center": "^3.1.0" + "@google-cloud/security-center": "^4.0.0" }, "devDependencies": { "chai": "^4.2.0", From 7f20a802969a6d06b1aaa3345e939f62bc975f0b Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Thu, 4 Jun 2020 10:26:20 -0700 Subject: [PATCH 180/342] chore: update root proto namespace (#278) --- packages/google-cloud-securitycenter/protos/protos.js | 2 +- packages/google-cloud-securitycenter/synth.metadata | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-securitycenter/protos/protos.js b/packages/google-cloud-securitycenter/protos/protos.js index bb1dd2bab62..3a79816fbef 100644 --- a/packages/google-cloud-securitycenter/protos/protos.js +++ b/packages/google-cloud-securitycenter/protos/protos.js @@ -28,7 +28,7 @@ var $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util; // Exported root namespace - var $root = $protobuf.roots._google_cloud_security_center_3_1_0_protos || ($protobuf.roots._google_cloud_security_center_3_1_0_protos = {}); + var $root = $protobuf.roots._google_cloud_security_center_4_0_0_protos || ($protobuf.roots._google_cloud_security_center_4_0_0_protos = {}); $root.google = (function() { diff --git a/packages/google-cloud-securitycenter/synth.metadata b/packages/google-cloud-securitycenter/synth.metadata index 96f8552b039..aacc8a59e94 100644 --- a/packages/google-cloud-securitycenter/synth.metadata +++ b/packages/google-cloud-securitycenter/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-security-center.git", - "sha": "6ce252eb770d1a4304301bfbaeacb9d165f8a3e9" + "sha": "f798376de3512133b3f1f4b112ba78c9b212a33b" } }, { From 32d4f445bc39b750464a732ab9bfe941eec81479 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 11 Jun 2020 17:47:24 +0200 Subject: [PATCH 181/342] chore(deps): update dependency mocha to v8 (#282) This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [mocha](https://mochajs.org/) ([source](https://togithub.com/mochajs/mocha)) | devDependencies | major | [`^7.0.0` -> `^8.0.0`](https://renovatebot.com/diffs/npm/mocha/7.2.0/8.0.1) | --- ### Release Notes
mochajs/mocha ### [`v8.0.1`](https://togithub.com/mochajs/mocha/blob/master/CHANGELOG.md#​801--2020-06-10) [Compare Source](https://togithub.com/mochajs/mocha/compare/v8.0.0...v8.0.1) The obligatory patch after a major. #### :bug: Fixes - [#​4328](https://togithub.com/mochajs/mocha/issues/4328): Fix `--parallel` when combined with `--watch` ([**@​boneskull**](https://togithub.com/boneskull)) ### [`v8.0.0`](https://togithub.com/mochajs/mocha/blob/master/CHANGELOG.md#​800--2020-06-10) [Compare Source](https://togithub.com/mochajs/mocha/compare/v7.2.0...v8.0.0) In this major release, Mocha adds the ability to _run tests in parallel_. Better late than never! Please note the **breaking changes** detailed below. Let's welcome [**@​giltayar**](https://togithub.com/giltayar) and [**@​nicojs**](https://togithub.com/nicojs) to the maintenance team! #### :boom: Breaking Changes - [#​4164](https://togithub.com/mochajs/mocha/issues/4164): **Mocha v8.0.0 now requires Node.js v10.0.0 or newer.** Mocha no longer supports the Node.js v8.x line ("Carbon"), which entered End-of-Life at the end of 2019 ([**@​UlisesGascon**](https://togithub.com/UlisesGascon)) - [#​4175](https://togithub.com/mochajs/mocha/issues/4175): Having been deprecated with a warning since v7.0.0, **`mocha.opts` is no longer supported** ([**@​juergba**](https://togithub.com/juergba)) :sparkles: **WORKAROUND:** Replace `mocha.opts` with a [configuration file](https://mochajs.org/#configuring-mocha-nodejs). - [#​4260](https://togithub.com/mochajs/mocha/issues/4260): Remove `enableTimeout()` (`this.enableTimeout()`) from the context object ([**@​craigtaub**](https://togithub.com/craigtaub)) :sparkles: **WORKAROUND:** Replace usage of `this.enableTimeout(false)` in your tests with `this.timeout(0)`. - [#​4315](https://togithub.com/mochajs/mocha/issues/4315): The `spec` option no longer supports a comma-delimited list of files ([**@​juergba**](https://togithub.com/juergba)) :sparkles: **WORKAROUND**: Use an array instead (e.g., `"spec": "foo.js,bar.js"` becomes `"spec": ["foo.js", "bar.js"]`). - [#​4309](https://togithub.com/mochajs/mocha/issues/4309): Drop support for Node.js v13.x line, which is now End-of-Life ([**@​juergba**](https://togithub.com/juergba)) - [#​4282](https://togithub.com/mochajs/mocha/issues/4282): `--forbid-only` will throw an error even if exclusive tests are avoided via `--grep` or other means ([**@​arvidOtt**](https://togithub.com/arvidOtt)) - [#​4223](https://togithub.com/mochajs/mocha/issues/4223): The context object's `skip()` (`this.skip()`) in a "before all" (`before()`) hook will no longer execute subsequent sibling hooks, in addition to hooks in child suites ([**@​juergba**](https://togithub.com/juergba)) - [#​4178](https://togithub.com/mochajs/mocha/issues/4178): Remove previously soft-deprecated APIs ([**@​wnghdcjfe**](https://togithub.com/wnghdcjfe)): - `Mocha.prototype.ignoreLeaks()` - `Mocha.prototype.useColors()` - `Mocha.prototype.useInlineDiffs()` - `Mocha.prototype.hideDiff()` #### :tada: Enhancements - [#​4245](https://togithub.com/mochajs/mocha/issues/4245): Add ability to run tests in parallel for Node.js (see [docs](https://mochajs.org/#parallel-tests)) ([**@​boneskull**](https://togithub.com/boneskull)) :exclamation: See also [#​4244](https://togithub.com/mochajs/mocha/issues/4244); [Root Hook Plugins (docs)](https://mochajs.org/#root-hook-plugins) -- _root hooks must be defined via Root Hook Plugins to work in parallel mode_ - [#​4304](https://togithub.com/mochajs/mocha/issues/4304): `--require` now works with ES modules ([**@​JacobLey**](https://togithub.com/JacobLey)) - [#​4299](https://togithub.com/mochajs/mocha/issues/4299): In some circumstances, Mocha can run ES modules under Node.js v10 -- _use at your own risk!_ ([**@​giltayar**](https://togithub.com/giltayar)) #### :book: Documentation - [#​4246](https://togithub.com/mochajs/mocha/issues/4246): Add documentation for parallel mode and Root Hook plugins ([**@​boneskull**](https://togithub.com/boneskull)) #### :bug: Fixes (All bug fixes in Mocha v8.0.0 are also breaking changes, and are listed above)
--- ### Renovate configuration :date: **Schedule**: "after 9am and before 3pm" (UTC). :vertical_traffic_light: **Automerge**: Disabled by config. Please merge this manually once you are satisfied. :recycle: **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. :no_bell: **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#googleapis/nodejs-security-center). --- packages/google-cloud-securitycenter/package.json | 2 +- packages/google-cloud-securitycenter/samples/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-securitycenter/package.json b/packages/google-cloud-securitycenter/package.json index 707785ef933..d33e22f9e87 100644 --- a/packages/google-cloud-securitycenter/package.json +++ b/packages/google-cloud-securitycenter/package.json @@ -54,7 +54,7 @@ "jsdoc-fresh": "^1.0.1", "jsdoc-region-tag": "^1.0.2", "linkinator": "^2.0.0", - "mocha": "^7.0.0", + "mocha": "^8.0.0", "null-loader": "^4.0.0", "pack-n-play": "^1.0.0-2", "sinon": "^9.0.1", diff --git a/packages/google-cloud-securitycenter/samples/package.json b/packages/google-cloud-securitycenter/samples/package.json index 2cca2acf05a..078117a66f2 100644 --- a/packages/google-cloud-securitycenter/samples/package.json +++ b/packages/google-cloud-securitycenter/samples/package.json @@ -18,7 +18,7 @@ }, "devDependencies": { "chai": "^4.2.0", - "mocha": "^7.0.0", + "mocha": "^8.0.0", "uuid": "^8.0.0" } } From de729e9b3c2e3ebca377900062b89553659e79c5 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Thu, 11 Jun 2020 17:49:32 -0700 Subject: [PATCH 182/342] build(secrets): begin migration to secret manager from keystore (#281) * changes without context autosynth cannot find the source of changes triggered by earlier changes in this repository, or by version upgrades to tools such as linters. * feat(secrets): begin migration to secret manager from keystore Source-Author: Benjamin E. Coe Source-Date: Mon Jun 8 09:51:11 2020 -0700 Source-Repo: googleapis/synthtool Source-Sha: 1c92077459db3dc50741e878f98b08c6261181e0 Source-Link: https://github.com/googleapis/synthtool/commit/1c92077459db3dc50741e878f98b08c6261181e0 Co-authored-by: Alexander Fenster Co-authored-by: gcf-merge-on-green[bot] <60162190+gcf-merge-on-green[bot]@users.noreply.github.com> --- packages/google-cloud-securitycenter/protos/protos.js | 2 +- .../src/v1/security_center_client.ts | 7 +++++++ .../src/v1beta1/security_center_client.ts | 7 +++++++ .../src/v1p1beta1/security_center_client.ts | 7 +++++++ packages/google-cloud-securitycenter/synth.metadata | 4 ++-- packages/google-cloud-securitycenter/tsconfig.json | 2 +- 6 files changed, 25 insertions(+), 4 deletions(-) diff --git a/packages/google-cloud-securitycenter/protos/protos.js b/packages/google-cloud-securitycenter/protos/protos.js index 3a79816fbef..8f07d7a3f44 100644 --- a/packages/google-cloud-securitycenter/protos/protos.js +++ b/packages/google-cloud-securitycenter/protos/protos.js @@ -28,7 +28,7 @@ var $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util; // Exported root namespace - var $root = $protobuf.roots._google_cloud_security_center_4_0_0_protos || ($protobuf.roots._google_cloud_security_center_4_0_0_protos = {}); + var $root = $protobuf.roots._google_cloud_security_center_protos || ($protobuf.roots._google_cloud_security_center_protos = {}); $root.google = (function() { diff --git a/packages/google-cloud-securitycenter/src/v1/security_center_client.ts b/packages/google-cloud-securitycenter/src/v1/security_center_client.ts index d648a1ec5c1..ba058929a70 100644 --- a/packages/google-cloud-securitycenter/src/v1/security_center_client.ts +++ b/packages/google-cloud-securitycenter/src/v1/security_center_client.ts @@ -101,6 +101,13 @@ export class SecurityCenterClient { } opts.servicePath = opts.servicePath || servicePath; opts.port = opts.port || port; + + // users can override the config from client side, like retry codes name. + // The detailed structure of the clientConfig can be found here: https://github.com/googleapis/gax-nodejs/blob/master/src/gax.ts#L546 + // The way to override client config for Showcase API: + // + // const customConfig = {"interfaces": {"google.showcase.v1beta1.Echo": {"methods": {"Echo": {"retry_codes_name": "idempotent", "retry_params_name": "default"}}}}} + // const showcaseClient = new showcaseClient({ projectId, customConfig }); opts.clientConfig = opts.clientConfig || {}; const isBrowser = typeof window !== 'undefined'; diff --git a/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.ts b/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.ts index a618a0abb82..60b2a87504d 100644 --- a/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.ts +++ b/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.ts @@ -101,6 +101,13 @@ export class SecurityCenterClient { } opts.servicePath = opts.servicePath || servicePath; opts.port = opts.port || port; + + // users can override the config from client side, like retry codes name. + // The detailed structure of the clientConfig can be found here: https://github.com/googleapis/gax-nodejs/blob/master/src/gax.ts#L546 + // The way to override client config for Showcase API: + // + // const customConfig = {"interfaces": {"google.showcase.v1beta1.Echo": {"methods": {"Echo": {"retry_codes_name": "idempotent", "retry_params_name": "default"}}}}} + // const showcaseClient = new showcaseClient({ projectId, customConfig }); opts.clientConfig = opts.clientConfig || {}; const isBrowser = typeof window !== 'undefined'; diff --git a/packages/google-cloud-securitycenter/src/v1p1beta1/security_center_client.ts b/packages/google-cloud-securitycenter/src/v1p1beta1/security_center_client.ts index 91ffc22468a..5b896d81fbd 100644 --- a/packages/google-cloud-securitycenter/src/v1p1beta1/security_center_client.ts +++ b/packages/google-cloud-securitycenter/src/v1p1beta1/security_center_client.ts @@ -101,6 +101,13 @@ export class SecurityCenterClient { } opts.servicePath = opts.servicePath || servicePath; opts.port = opts.port || port; + + // users can override the config from client side, like retry codes name. + // The detailed structure of the clientConfig can be found here: https://github.com/googleapis/gax-nodejs/blob/master/src/gax.ts#L546 + // The way to override client config for Showcase API: + // + // const customConfig = {"interfaces": {"google.showcase.v1beta1.Echo": {"methods": {"Echo": {"retry_codes_name": "idempotent", "retry_params_name": "default"}}}}} + // const showcaseClient = new showcaseClient({ projectId, customConfig }); opts.clientConfig = opts.clientConfig || {}; const isBrowser = typeof window !== 'undefined'; diff --git a/packages/google-cloud-securitycenter/synth.metadata b/packages/google-cloud-securitycenter/synth.metadata index aacc8a59e94..8934c3e4615 100644 --- a/packages/google-cloud-securitycenter/synth.metadata +++ b/packages/google-cloud-securitycenter/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-security-center.git", - "sha": "f798376de3512133b3f1f4b112ba78c9b212a33b" + "sha": "20e4b1e59990902c7d48310fd452d8709d63743c" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "be74d3e532faa47eb59f1a0eaebde0860d1d8ab4" + "sha": "1c92077459db3dc50741e878f98b08c6261181e0" } } ], diff --git a/packages/google-cloud-securitycenter/tsconfig.json b/packages/google-cloud-securitycenter/tsconfig.json index 613d35597b5..c78f1c884ef 100644 --- a/packages/google-cloud-securitycenter/tsconfig.json +++ b/packages/google-cloud-securitycenter/tsconfig.json @@ -5,7 +5,7 @@ "outDir": "build", "resolveJsonModule": true, "lib": [ - "es2016", + "es2018", "dom" ] }, From 6f1c2093700995db36deb82bb0a76f3e141896ff Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Fri, 12 Jun 2020 10:57:39 -0700 Subject: [PATCH 183/342] fix: handle fallback option properly (#284) * changes without context autosynth cannot find the source of changes triggered by earlier changes in this repository, or by version upgrades to tools such as linters. * chore(nodejs_templates): add script logging to node_library populate-secrets.sh Co-authored-by: Benjamin E. Coe Source-Author: BenWhitehead Source-Date: Wed Jun 10 22:24:28 2020 -0400 Source-Repo: googleapis/synthtool Source-Sha: e7034945fbdc0e79d3c57f6e299e5c90b0f11469 Source-Link: https://github.com/googleapis/synthtool/commit/e7034945fbdc0e79d3c57f6e299e5c90b0f11469 --- .../src/v1/security_center_client.ts | 13 +++++-------- .../src/v1beta1/security_center_client.ts | 13 +++++-------- .../src/v1p1beta1/security_center_client.ts | 13 +++++-------- packages/google-cloud-securitycenter/synth.metadata | 4 ++-- 4 files changed, 17 insertions(+), 26 deletions(-) diff --git a/packages/google-cloud-securitycenter/src/v1/security_center_client.ts b/packages/google-cloud-securitycenter/src/v1/security_center_client.ts index ba058929a70..49a9f54c15a 100644 --- a/packages/google-cloud-securitycenter/src/v1/security_center_client.ts +++ b/packages/google-cloud-securitycenter/src/v1/security_center_client.ts @@ -110,14 +110,11 @@ export class SecurityCenterClient { // const showcaseClient = new showcaseClient({ projectId, customConfig }); opts.clientConfig = opts.clientConfig || {}; - const isBrowser = typeof window !== 'undefined'; - if (isBrowser) { - opts.fallback = true; - } - // If we are in browser, we are already using fallback because of the - // "browser" field in package.json. - // But if we were explicitly requested to use fallback, let's do it now. - this._gaxModule = !isBrowser && opts.fallback ? gax.fallback : gax; + // If we're running in browser, it's OK to omit `fallback` since + // google-gax has `browser` field in its `package.json`. + // For Electron (which does not respect `browser` field), + // pass `{fallback: true}` to the SecurityCenterClient constructor. + this._gaxModule = opts.fallback ? gax.fallback : gax; // Create a `gaxGrpc` object, with any grpc-specific options // sent to the client. diff --git a/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.ts b/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.ts index 60b2a87504d..893485e0465 100644 --- a/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.ts +++ b/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.ts @@ -110,14 +110,11 @@ export class SecurityCenterClient { // const showcaseClient = new showcaseClient({ projectId, customConfig }); opts.clientConfig = opts.clientConfig || {}; - const isBrowser = typeof window !== 'undefined'; - if (isBrowser) { - opts.fallback = true; - } - // If we are in browser, we are already using fallback because of the - // "browser" field in package.json. - // But if we were explicitly requested to use fallback, let's do it now. - this._gaxModule = !isBrowser && opts.fallback ? gax.fallback : gax; + // If we're running in browser, it's OK to omit `fallback` since + // google-gax has `browser` field in its `package.json`. + // For Electron (which does not respect `browser` field), + // pass `{fallback: true}` to the SecurityCenterClient constructor. + this._gaxModule = opts.fallback ? gax.fallback : gax; // Create a `gaxGrpc` object, with any grpc-specific options // sent to the client. diff --git a/packages/google-cloud-securitycenter/src/v1p1beta1/security_center_client.ts b/packages/google-cloud-securitycenter/src/v1p1beta1/security_center_client.ts index 5b896d81fbd..6998c02b1bf 100644 --- a/packages/google-cloud-securitycenter/src/v1p1beta1/security_center_client.ts +++ b/packages/google-cloud-securitycenter/src/v1p1beta1/security_center_client.ts @@ -110,14 +110,11 @@ export class SecurityCenterClient { // const showcaseClient = new showcaseClient({ projectId, customConfig }); opts.clientConfig = opts.clientConfig || {}; - const isBrowser = typeof window !== 'undefined'; - if (isBrowser) { - opts.fallback = true; - } - // If we are in browser, we are already using fallback because of the - // "browser" field in package.json. - // But if we were explicitly requested to use fallback, let's do it now. - this._gaxModule = !isBrowser && opts.fallback ? gax.fallback : gax; + // If we're running in browser, it's OK to omit `fallback` since + // google-gax has `browser` field in its `package.json`. + // For Electron (which does not respect `browser` field), + // pass `{fallback: true}` to the SecurityCenterClient constructor. + this._gaxModule = opts.fallback ? gax.fallback : gax; // Create a `gaxGrpc` object, with any grpc-specific options // sent to the client. diff --git a/packages/google-cloud-securitycenter/synth.metadata b/packages/google-cloud-securitycenter/synth.metadata index 8934c3e4615..9e472db0113 100644 --- a/packages/google-cloud-securitycenter/synth.metadata +++ b/packages/google-cloud-securitycenter/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-security-center.git", - "sha": "20e4b1e59990902c7d48310fd452d8709d63743c" + "sha": "41bd2a92dbed2041ef5d5def1b3ce0c22b670b12" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "1c92077459db3dc50741e878f98b08c6261181e0" + "sha": "e7034945fbdc0e79d3c57f6e299e5c90b0f11469" } } ], From ccf04e7cf14ec97c97e1c439df8f921ed92d8100 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Mon, 15 Jun 2020 11:26:19 -0700 Subject: [PATCH 184/342] feat: add Resource to the v1 NotificationMessage, update protos (#286) * feat: Add Resource to the v1 NotificationMessage, which contains resource-related fields associated to the Finding notification. docs: Adjusted wording from Cloud SCC to Security Command Center, and updated filtering docs for List APIs. PiperOrigin-RevId: 315715539 Source-Author: Google APIs Source-Date: Wed Jun 10 10:20:15 2020 -0700 Source-Repo: googleapis/googleapis Source-Sha: 3e7056405a83fcbdca86c829d32264b8102fc893 Source-Link: https://github.com/googleapis/googleapis/commit/3e7056405a83fcbdca86c829d32264b8102fc893 * feat: Add Resource to the vp1beta1 NotificationMessage, which contains resource-related fields associated to the Finding notification. feat!: Removed 'having' as a field for the Group and List APIs for both Assets and Findings. docs: Adjusted wording from Cloud SCC to Security Command Center, and updated filtering docs for List APIs. BREAKING CHANGE: Removed 'having' as a field in the List and Group Finding and Asset requests. PiperOrigin-RevId: 315725809 Source-Author: Google APIs Source-Date: Wed Jun 10 11:04:44 2020 -0700 Source-Repo: googleapis/googleapis Source-Sha: 027e9775e9d3a6f3eb197fb428727b7f17276e7b Source-Link: https://github.com/googleapis/googleapis/commit/027e9775e9d3a6f3eb197fb428727b7f17276e7b * fix!: Fix the version casing in the C# namespace option BREAKING CHANGE: This would break any C# code already generated, but this file is very new, so is unlikely to break anyone. PiperOrigin-RevId: 315933871 Source-Author: Google APIs Source-Date: Thu Jun 11 10:56:35 2020 -0700 Source-Repo: googleapis/googleapis Source-Sha: b789f790565ad7cc473571b0cf35dfbe6707f6a8 Source-Link: https://github.com/googleapis/googleapis/commit/b789f790565ad7cc473571b0cf35dfbe6707f6a8 --- .../cloud/securitycenter/v1/asset.proto | 49 +- .../cloud/securitycenter/v1/finding.proto | 24 +- .../v1/notification_message.proto | 4 + .../v1/organization_settings.proto | 4 +- .../cloud/securitycenter/v1/resource.proto | 46 ++ .../securitycenter/v1/security_marks.proto | 6 +- .../v1/securitycenter_service.proto | 50 +- .../cloud/securitycenter/v1/source.proto | 2 +- .../securitycenter/v1p1beta1/asset.proto | 50 +- .../securitycenter/v1p1beta1/finding.proto | 29 +- .../v1p1beta1/notification_config.proto | 18 +- .../v1p1beta1/notification_message.proto | 9 +- .../v1p1beta1/organization_settings.proto | 7 +- .../securitycenter/v1p1beta1/resource.proto | 46 ++ .../run_asset_discovery_response.proto | 3 +- .../v1p1beta1/security_marks.proto | 9 +- .../v1p1beta1/securitycenter_service.proto | 110 +-- .../securitycenter/v1p1beta1/source.proto | 7 +- .../protos/protos.d.ts | 264 ++++++- .../protos/protos.js | 700 +++++++++++++++--- .../protos/protos.json | 77 +- .../src/v1/security_center_client.ts | 144 +++- .../src/v1/security_center_proto_list.json | 1 + .../src/v1p1beta1/security_center_client.ts | 301 +++++--- .../security_center_client_config.json | 46 +- .../v1p1beta1/security_center_proto_list.json | 1 + .../synth.metadata | 6 +- 27 files changed, 1528 insertions(+), 485 deletions(-) create mode 100644 packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/resource.proto create mode 100644 packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/resource.proto diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/asset.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/asset.proto index b079e5c5d7b..eb07c0493b6 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/asset.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/asset.proto @@ -29,30 +29,31 @@ option java_package = "com.google.cloud.securitycenter.v1"; option php_namespace = "Google\\Cloud\\SecurityCenter\\V1"; option ruby_package = "Google::Cloud::SecurityCenter::V1"; -// Cloud Security Command Center's (Cloud SCC) representation of a Google Cloud -// Platform (GCP) resource. +// Security Command Center representation of a Google Cloud +// resource. // -// The Asset is a Cloud SCC resource that captures information about a single -// GCP resource. All modifications to an Asset are only within the context of -// Cloud SCC and don't affect the referenced GCP resource. +// The Asset is a Security Command Center resource that captures information +// about a single Google Cloud resource. All modifications to an Asset are only +// within the context of Security Command Center and don't affect the referenced +// Google Cloud resource. message Asset { option (google.api.resource) = { type: "securitycenter.googleapis.com/Asset" pattern: "organizations/{organization}/assets/{asset}" }; - // Cloud SCC managed properties. These properties are managed by Cloud SCC and - // cannot be modified by the user. + // Security Command Center managed properties. These properties are managed by + // Security Command Center and cannot be modified by the user. message SecurityCenterProperties { - // The full resource name of the GCP resource this asset + // The full resource name of the Google Cloud resource this asset // represents. This field is immutable after create time. See: // https://cloud.google.com/apis/design/resource_names#full_resource_name string resource_name = 1; - // The type of the GCP resource. Examples include: APPLICATION, + // The type of the Google Cloud resource. Examples include: APPLICATION, // PROJECT, and ORGANIZATION. This is a case insensitive field defined by - // Cloud SCC and/or the producer of the resource and is immutable - // after create time. + // Security Command Center and/or the producer of the resource and is + // immutable after create time. string resource_type = 2; // The full resource name of the immediate parent of the resource. See: @@ -76,9 +77,10 @@ message Asset { string resource_project_display_name = 8; } - // IAM Policy information associated with the GCP resource described by the - // Cloud SCC asset. This information is managed and defined by the GCP - // resource and cannot be modified by the user. + // Cloud IAM Policy information associated with the Google Cloud resource + // described by the Security Command Center asset. This information is managed + // and defined by the Google Cloud resource and cannot be modified by the + // user. message IamPolicy { // The JSON representation of the Policy associated with the asset. // See https://cloud.google.com/iam/reference/rest/v1/Policy for format @@ -92,27 +94,28 @@ message Asset { // "organizations/{organization_id}/assets/{asset_id}". string name = 1; - // Cloud SCC managed properties. These properties are managed by - // Cloud SCC and cannot be modified by the user. + // Security Command Center managed properties. These properties are managed by + // Security Command Center and cannot be modified by the user. SecurityCenterProperties security_center_properties = 2; // Resource managed properties. These properties are managed and defined by - // the GCP resource and cannot be modified by the user. + // the Google Cloud resource and cannot be modified by the user. map resource_properties = 7; // User specified security marks. These marks are entirely managed by the user // and come from the SecurityMarks resource that belongs to the asset. SecurityMarks security_marks = 8; - // The time at which the asset was created in Cloud SCC. + // The time at which the asset was created in Security Command Center. google.protobuf.Timestamp create_time = 9; - // The time at which the asset was last updated, added, or deleted in Cloud - // SCC. + // The time at which the asset was last updated, added, or deleted in Security + // Command Center. google.protobuf.Timestamp update_time = 10; - // IAM Policy information associated with the GCP resource described by the - // Cloud SCC asset. This information is managed and defined by the GCP - // resource and cannot be modified by the user. + // Cloud IAM Policy information associated with the Google Cloud resource + // described by the Security Command Center asset. This information is managed + // and defined by the Google Cloud resource and cannot be modified by the + // user. IamPolicy iam_policy = 11; } diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/finding.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/finding.proto index 9a3261c4c7a..4ccdc495c36 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/finding.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/finding.proto @@ -30,11 +30,11 @@ option java_package = "com.google.cloud.securitycenter.v1"; option php_namespace = "Google\\Cloud\\SecurityCenter\\V1"; option ruby_package = "Google::Cloud::SecurityCenter::V1"; -// Cloud Security Command Center (Cloud SCC) finding. +// Security Command Center finding. // // A finding is a record of assessment data like security, risk, health, or -// privacy, that is ingested into Cloud SCC for presentation, notification, -// analysis, policy testing, and enforcement. For example, a +// privacy, that is ingested into Security Command Center for presentation, +// notification, analysis, policy testing, and enforcement. For example, a // cross-site scripting (XSS) vulnerability in an App Engine application is a // finding. message Finding { @@ -69,12 +69,12 @@ message Finding { // "organizations/{organization_id}/sources/{source_id}" string parent = 2; - // For findings on Google Cloud Platform (GCP) resources, the full resource - // name of the GCP resource this finding is for. See: + // For findings on Google Cloud resources, the full resource + // name of the Google Cloud resource this finding is for. See: // https://cloud.google.com/apis/design/resource_names#full_resource_name - // When the finding is for a non-GCP resource, the resourceName can be a - // customer or partner defined string. - // This field is immutable after creation time. + // When the finding is for a non-Google Cloud resource, the resourceName can + // be a customer or partner defined string. This field is immutable after + // creation time. string resource_name = 3; // The state of the finding. @@ -85,9 +85,9 @@ message Finding { // Example: "XSS_FLASH_INJECTION" string category = 5; - // The URI that, if available, points to a web page outside of Cloud SCC - // where additional information about the finding can be found. This field is - // guaranteed to be either empty or a well formed URL. + // The URI that, if available, points to a web page outside of Security + // Command Center where additional information about the finding can be found. + // This field is guaranteed to be either empty or a well formed URL. string external_uri = 6; // Source specific properties. These properties are managed by the source @@ -106,6 +106,6 @@ message Finding { // the firewall became open. The accuracy is determined by the detector. google.protobuf.Timestamp event_time = 9; - // The time at which the finding was created in Cloud SCC. + // The time at which the finding was created in Security Command Center. google.protobuf.Timestamp create_time = 10; } diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/notification_message.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/notification_message.proto index b9dfb171b13..08b6b7c88eb 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/notification_message.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/notification_message.proto @@ -18,6 +18,7 @@ package google.cloud.securitycenter.v1; import "google/api/annotations.proto"; import "google/cloud/securitycenter/v1/finding.proto"; +import "google/cloud/securitycenter/v1/resource.proto"; option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1;securitycenter"; @@ -38,4 +39,7 @@ message NotificationMessage { // populated. Finding finding = 2; } + + // The Cloud resource tied to this notification's Finding. + Resource resource = 3; } diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/organization_settings.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/organization_settings.proto index d9d9aed7926..66b659bc5f0 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/organization_settings.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/organization_settings.proto @@ -26,8 +26,8 @@ option java_package = "com.google.cloud.securitycenter.v1"; option php_namespace = "Google\\Cloud\\SecurityCenter\\V1"; option ruby_package = "Google::Cloud::SecurityCenter::V1"; -// User specified settings that are attached to the Cloud Security Command -// Center (Cloud SCC) organization. +// User specified settings that are attached to the Security Command +// Center organization. message OrganizationSettings { option (google.api.resource) = { type: "securitycenter.googleapis.com/OrganizationSettings" diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/resource.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/resource.proto new file mode 100644 index 00000000000..855e697373f --- /dev/null +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/resource.proto @@ -0,0 +1,46 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.securitycenter.v1; + +import "google/api/annotations.proto"; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1;securitycenter"; +option java_multiple_files = true; +option java_outer_classname = "ResourceProto"; +option java_package = "com.google.cloud.securitycenter.v1"; +option php_namespace = "Google\\Cloud\\SecurityCenter\\V1"; +option ruby_package = "Google::Cloud::SecurityCenter::V1"; + +// Information related to the Google Cloud resource. +message Resource { + // The full resource name of the resource. See: + // https://cloud.google.com/apis/design/resource_names#full_resource_name + string name = 1; + + // The full resource name of project that the resource belongs to. + string project = 2; + + // The human readable name of project that the resource belongs to. + string project_display_name = 3; + + // The full resource name of resource's parent. + string parent = 4; + + // The human readable name of resource's parent. + string parent_display_name = 5; +} diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/security_marks.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/security_marks.proto index 229aff32dd9..47a4a150be5 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/security_marks.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/security_marks.proto @@ -26,9 +26,9 @@ option java_package = "com.google.cloud.securitycenter.v1"; option php_namespace = "Google\\Cloud\\SecurityCenter\\V1"; option ruby_package = "Google::Cloud::SecurityCenter::V1"; -// User specified security marks that are attached to the parent Cloud Security -// Command Center (Cloud SCC) resource. Security marks are scoped within a Cloud -// SCC organization -- they can be modified and viewed by all users who have +// User specified security marks that are attached to the parent Security +// Command Center resource. Security marks are scoped within a Security Command +// Center organization -- they can be modified and viewed by all users who have // proper permissions on the organization. message SecurityMarks { option (google.api.resource) = { diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/securitycenter_service.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/securitycenter_service.proto index bb9a82849d1..9a88e1e85bd 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/securitycenter_service.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/securitycenter_service.proto @@ -438,15 +438,15 @@ message GroupAssetsRequest { // // Usage: This should be milliseconds since epoch or an RFC3339 string. // Examples: - // "update_time = \"2019-06-10T16:07:18-07:00\"" - // "update_time = 1560208038000" + // `update_time = "2019-06-10T16:07:18-07:00"` + // `update_time = 1560208038000` // // * create_time: `=`, `>`, `<`, `>=`, `<=` // // Usage: This should be milliseconds since epoch or an RFC3339 string. // Examples: - // "create_time = \"2019-06-10T16:07:18-07:00\"" - // "create_time = 1560208038000" + // `create_time = "2019-06-10T16:07:18-07:00"` + // `create_time = 1560208038000` // // * iam_policy.policy_blob: `=`, `:` // * resource_properties: `=`, `:`, `>`, `<`, `>=`, `<=` @@ -461,6 +461,12 @@ message GroupAssetsRequest { // * security_center_properties.resource_owners: `=`, `:` // // For example, `resource_properties.size = 100` is a valid filter string. + // + // Use a partial match on the empty string to filter based on a property + // existing:`resource_properties.my_property : ""` + // + // Use a negated partial match on the empty string to filter based on a + // property not existing: `-resource_properties.my_property : ""` string filter = 2; // Required. Expression that defines what assets fields to use for grouping. @@ -595,13 +601,19 @@ message GroupFindingsRequest { // // Usage: This should be milliseconds since epoch or an RFC3339 string. // Examples: - // "event_time = \"2019-06-10T16:07:18-07:00\"" - // "event_time = 1560208038000" + // `event_time = "2019-06-10T16:07:18-07:00"` + // `event_time = 1560208038000` // // * security_marks.marks: `=`, `:` // * source_properties: `=`, `:`, `>`, `<`, `>=`, `<=` // // For example, `source_properties.size = 100` is a valid filter string. + // + // Use a partial match on the empty string to filter based on a property + // existing: `source_properties.my_property : ""` + // + // Use a negated partial match on the empty string to filter based on a + // property not existing: `-source_properties.my_property : ""` string filter = 2; // Required. Expression that defines what assets fields to use for grouping @@ -803,15 +815,15 @@ message ListAssetsRequest { // // Usage: This should be milliseconds since epoch or an RFC3339 string. // Examples: - // "update_time = \"2019-06-10T16:07:18-07:00\"" - // "update_time = 1560208038000" + // `update_time = "2019-06-10T16:07:18-07:00"` + // `update_time = 1560208038000` // // * create_time: `=`, `>`, `<`, `>=`, `<=` // // Usage: This should be milliseconds since epoch or an RFC3339 string. // Examples: - // "create_time = \"2019-06-10T16:07:18-07:00\"" - // "create_time = 1560208038000" + // `create_time = "2019-06-10T16:07:18-07:00"` + // `create_time = 1560208038000` // // * iam_policy.policy_blob: `=`, `:` // * resource_properties: `=`, `:`, `>`, `<`, `>=`, `<=` @@ -826,6 +838,12 @@ message ListAssetsRequest { // * security_center_properties.resource_owners: `=`, `:` // // For example, `resource_properties.size = 100` is a valid filter string. + // + // Use a partial match on the empty string to filter based on a property + // existing: `resource_properties.my_property : ""` + // + // Use a negated partial match on the empty string to filter based on a + // property not existing: `-resource_properties.my_property : ""` string filter = 2; // Expression that defines what fields and order to use for sorting. The @@ -992,13 +1010,19 @@ message ListFindingsRequest { // // Usage: This should be milliseconds since epoch or an RFC3339 string. // Examples: - // "event_time = \"2019-06-10T16:07:18-07:00\"" - // "event_time = 1560208038000" + // `event_time = "2019-06-10T16:07:18-07:00"` + // `event_time = 1560208038000` // // security_marks.marks: `=`, `:` // source_properties: `=`, `:`, `>`, `<`, `>=`, `<=` // // For example, `source_properties.size = 100` is a valid filter string. + // + // Use a partial match on the empty string to filter based on a property + // existing: `source_properties.my_property : ""` + // + // Use a negated partial match on the empty string to filter based on a + // property not existing: `-source_properties.my_property : ""` string filter = 2; // Expression that defines what fields and order to use for sorting. The @@ -1078,7 +1102,7 @@ message ListFindingsRequest { message ListFindingsResponse { // Result containing the Finding and its StateChange. message ListFindingsResult { - // Information related to the Google Cloud Platform (GCP) resource that is + // Information related to the Google Cloud resource that is // associated with this finding. message Resource { // The full resource name of the resource. See: diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/source.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/source.proto index 6fca821b826..e7b1a1835f4 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/source.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/source.proto @@ -26,7 +26,7 @@ option java_package = "com.google.cloud.securitycenter.v1"; option php_namespace = "Google\\Cloud\\SecurityCenter\\V1"; option ruby_package = "Google::Cloud::SecurityCenter::V1"; -// Cloud Security Command Center's (Cloud SCC) finding source. A finding source +// Security Command Center finding source. A finding source // is an entity or a mechanism that can produce a finding. A source is like a // container of findings that come from the same scanner, logger, monitor, and // other tools. diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/asset.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/asset.proto index aaa18bcbaa9..bfcae368859 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/asset.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/asset.proto @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC. +// 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. @@ -11,7 +11,6 @@ // WITHOUT 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"; @@ -30,30 +29,31 @@ option java_package = "com.google.cloud.securitycenter.v1p1beta1"; option php_namespace = "Google\\Cloud\\SecurityCenter\\V1p1beta1"; option ruby_package = "Google::Cloud::SecurityCenter::V1p1beta1"; -// Cloud Security Command Center's (Cloud SCC) representation of a Google Cloud -// Platform (GCP) resource. +// Security Command Center representation of a Google Cloud +// resource. // -// The Asset is a Cloud SCC resource that captures information about a single -// GCP resource. All modifications to an Asset are only within the context of -// Cloud SCC and don't affect the referenced GCP resource. +// The Asset is a Security Command Center resource that captures information +// about a single Google Cloud resource. All modifications to an Asset are only +// within the context of Security Command Center and don't affect the referenced +// Google Cloud resource. message Asset { option (google.api.resource) = { type: "securitycenter.googleapis.com/Asset" pattern: "organizations/{organization}/assets/{asset}" }; - // Cloud SCC managed properties. These properties are managed by Cloud SCC and - // cannot be modified by the user. + // Security Command Center managed properties. These properties are managed by + // Security Command Center and cannot be modified by the user. message SecurityCenterProperties { - // The full resource name of the GCP resource this asset + // The full resource name of the Google Cloud resource this asset // represents. This field is immutable after create time. See: // https://cloud.google.com/apis/design/resource_names#full_resource_name string resource_name = 1; - // The type of the GCP resource. Examples include: APPLICATION, + // The type of the Google Cloud resource. Examples include: APPLICATION, // PROJECT, and ORGANIZATION. This is a case insensitive field defined by - // Cloud SCC and/or the producer of the resource and is immutable - // after create time. + // Security Command Center and/or the producer of the resource and is + // immutable after create time. string resource_type = 2; // The full resource name of the immediate parent of the resource. See: @@ -77,12 +77,13 @@ message Asset { string resource_project_display_name = 8; } - // IAM Policy information associated with the GCP resource described by the - // Cloud SCC asset. This information is managed and defined by the GCP - // resource and cannot be modified by the user. + // Cloud IAM Policy information associated with the Google Cloud resource + // described by the Security Command Center asset. This information is managed + // and defined by the Google Cloud resource and cannot be modified by the + // user. message IamPolicy { // The JSON representation of the Policy associated with the asset. - // See https://cloud.google.com/iam/reference/rest/v1/Policy for + // See https://cloud.google.com/iam/docs/reference/rest/v1/Policy for // format details. string policy_blob = 1; } @@ -93,27 +94,28 @@ message Asset { // "organizations/{organization_id}/assets/{asset_id}". string name = 1; - // Cloud SCC managed properties. These properties are managed by - // Cloud SCC and cannot be modified by the user. + // Security Command Center managed properties. These properties are managed by + // Security Command Center and cannot be modified by the user. SecurityCenterProperties security_center_properties = 2; // Resource managed properties. These properties are managed and defined by - // the GCP resource and cannot be modified by the user. + // the Google Cloud resource and cannot be modified by the user. map resource_properties = 7; // User specified security marks. These marks are entirely managed by the user // and come from the SecurityMarks resource that belongs to the asset. SecurityMarks security_marks = 8; - // The time at which the asset was created in Cloud SCC. + // The time at which the asset was created in Security Command Center. google.protobuf.Timestamp create_time = 9; // The time at which the asset was last updated, added, or deleted in Cloud // SCC. google.protobuf.Timestamp update_time = 10; - // IAM Policy information associated with the GCP resource described by the - // Cloud SCC asset. This information is managed and defined by the GCP - // resource and cannot be modified by the user. + // Cloud IAM Policy information associated with the Google Cloud resource + // described by the Security Command Center asset. This information is managed + // and defined by the Google Cloud resource and cannot be modified by the + // user. IamPolicy iam_policy = 11; } diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/finding.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/finding.proto index 6428027df6a..21b655362d2 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/finding.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/finding.proto @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC. +// 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. @@ -11,7 +11,6 @@ // WITHOUT 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"; @@ -31,12 +30,12 @@ option java_package = "com.google.cloud.securitycenter.v1p1beta1"; option php_namespace = "Google\\Cloud\\SecurityCenter\\V1p1beta1"; option ruby_package = "Google::Cloud::SecurityCenter::V1p1beta1"; -// Cloud Security Command Center (Cloud SCC) finding. +// Security Command Center finding. // // A finding is a record of assessment data (security, risk, health or privacy) -// ingested into Cloud SCC for presentation, notification, analysis, -// policy testing, and enforcement. For example, an XSS vulnerability in an -// App Engine application is a finding. +// ingested into Security Command Center for presentation, notification, +// analysis, policy testing, and enforcement. For example, an XSS vulnerability +// in an App Engine application is a finding. message Finding { option (google.api.resource) = { type: "securitycenter.googleapis.com/Finding" @@ -69,12 +68,12 @@ message Finding { // "organizations/{organization_id}/sources/{source_id}" string parent = 2; - // For findings on Google Cloud Platform (GCP) resources, the full resource - // name of the GCP resource this finding is for. See: + // For findings on Google Cloud resources, the full resource + // name of the Google Cloud resource this finding is for. See: // https://cloud.google.com/apis/design/resource_names#full_resource_name - // When the finding is for a non-GCP resource, the resourceName can be a - // customer or partner defined string. - // This field is immutable after creation time. + // When the finding is for a non-Google Cloud resource, the resourceName can + // be a customer or partner defined string. This field is immutable after + // creation time. string resource_name = 3; // The state of the finding. @@ -85,9 +84,9 @@ message Finding { // Example: "XSS_FLASH_INJECTION" string category = 5; - // The URI that, if available, points to a web page outside of Cloud SCC - // where additional information about the finding can be found. This field is - // guaranteed to be either empty or a well formed URL. + // The URI that, if available, points to a web page outside of Security + // Command Center where additional information about the finding can be found. + // This field is guaranteed to be either empty or a well formed URL. string external_uri = 6; // Source specific properties. These properties are managed by the source @@ -106,6 +105,6 @@ message Finding { // the firewall became open. The accuracy is determined by the detector. google.protobuf.Timestamp event_time = 9; - // The time at which the finding was created in Cloud SCC. + // The time at which the finding was created in Security Command Center. google.protobuf.Timestamp create_time = 10; } diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/notification_config.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/notification_config.proto index 7cbb87b24b1..6f9e596691b 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/notification_config.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/notification_config.proto @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC. +// 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. @@ -11,7 +11,6 @@ // WITHOUT 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"; @@ -27,19 +26,16 @@ option java_multiple_files = true; option java_package = "com.google.cloud.securitycenter.v1p1beta1"; option php_namespace = "Google\\Cloud\\SecurityCenter\\V1p1beta1"; option ruby_package = "Google::Cloud::SecurityCenter::V1p1beta1"; - -// The Pub/Sub Topic resource definition is in google/cloud/pubsub/v1/, -// but we do not import that proto directly; therefore, we redefine the -// pattern here. option (google.api.resource_definition) = { type: "pubsub.googleapis.com/Topic" pattern: "projects/{project}/topics/{topic}" }; -// Cloud Security Command Center (Cloud SCC) notification configs. +// Security Command Center notification configs. // -// A notification config is a Cloud SCC resource that contains the configuration -// to send notifications for create/update events of findings, assets and etc. +// A notification config is a Security Command Center resource that contains the +// configuration to send notifications for create/update events of findings, +// assets and etc. message NotificationConfig { option (google.api.resource) = { type: "securitycenter.googleapis.com/NotificationConfig" @@ -94,14 +90,14 @@ message NotificationConfig { // The type of events the config is for, e.g. FINDING. EventType event_type = 3; - // The PubSub topic to send notifications to. Its format is + // The Pub/Sub topic to send notifications to. Its format is // "projects/[project_id]/topics/[topic]". string pubsub_topic = 4 [ (google.api.resource_reference) = { type: "pubsub.googleapis.com/Topic" } ]; // Output only. The service account that needs "pubsub.topics.publish" - // permission to publish to the PubSub topic. + // permission to publish to the Pub/Sub topic. string service_account = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; // The config for triggering notifications. diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/notification_message.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/notification_message.proto index 3abbcef32af..fd3c23b6344 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/notification_message.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/notification_message.proto @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC. +// 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. @@ -11,7 +11,6 @@ // WITHOUT 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"; @@ -20,6 +19,7 @@ package google.cloud.securitycenter.v1p1beta1; import "google/api/annotations.proto"; import "google/cloud/securitycenter/v1p1beta1/asset.proto"; import "google/cloud/securitycenter/v1p1beta1/finding.proto"; +import "google/cloud/securitycenter/v1p1beta1/resource.proto"; option csharp_namespace = "Google.Cloud.SecurityCenter.V1P1Beta1"; option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1p1beta1;securitycenter"; @@ -28,7 +28,7 @@ option java_package = "com.google.cloud.securitycenter.v1p1beta1"; option php_namespace = "Google\\Cloud\\SecurityCenter\\V1p1beta1"; option ruby_package = "Google::Cloud::SecurityCenter::V1p1beta1"; -// Cloud SCC's Notification +// Security Command Center's Notification message NotificationMessage { // Name of the notification config that generated current notification. string notification_config_name = 1; @@ -39,4 +39,7 @@ message NotificationMessage { // populated. Finding finding = 2; } + + // The Cloud resource tied to the notification. + Resource resource = 3; } diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/organization_settings.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/organization_settings.proto index 9c38b87ba0b..1be72dd7b6c 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/organization_settings.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/organization_settings.proto @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC. +// 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. @@ -11,7 +11,6 @@ // WITHOUT 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"; @@ -27,8 +26,8 @@ option java_package = "com.google.cloud.securitycenter.v1p1beta1"; option php_namespace = "Google\\Cloud\\SecurityCenter\\V1p1beta1"; option ruby_package = "Google::Cloud::SecurityCenter::V1p1beta1"; -// User specified settings that are attached to the Cloud Security Command -// Center (Cloud SCC) organization. +// User specified settings that are attached to the Security Command +// Center organization. message OrganizationSettings { option (google.api.resource) = { type: "securitycenter.googleapis.com/OrganizationSettings" diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/resource.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/resource.proto new file mode 100644 index 00000000000..6b8570993fc --- /dev/null +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/resource.proto @@ -0,0 +1,46 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.securitycenter.v1p1beta1; + +import "google/api/annotations.proto"; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V1P1Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1p1beta1;securitycenter"; +option java_multiple_files = true; +option java_outer_classname = "ResourceProto"; +option java_package = "com.google.cloud.securitycenter.v1p1beta1"; +option php_namespace = "Google\\Cloud\\SecurityCenter\\V1p1beta1"; +option ruby_package = "Google::Cloud::SecurityCenter::V1p1beta1"; + +// Information related to the Google Cloud resource. +message Resource { + // The full resource name of the resource. See: + // https://cloud.google.com/apis/design/resource_names#full_resource_name + string name = 1; + + // The full resource name of project that the resource belongs to. + string project = 2; + + // The human readable name of project that the resource belongs to. + string project_display_name = 3; + + // The full resource name of resource's parent. + string parent = 4; + + // The human readable name of resource's parent. + string parent_display_name = 5; +} diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/run_asset_discovery_response.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/run_asset_discovery_response.proto index b8b9ea489ed..720ffc4fae6 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/run_asset_discovery_response.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/run_asset_discovery_response.proto @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC. +// 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. @@ -11,7 +11,6 @@ // WITHOUT 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"; diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/security_marks.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/security_marks.proto index ac54bc19a4f..11a1dd85ab2 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/security_marks.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/security_marks.proto @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC. +// 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. @@ -11,7 +11,6 @@ // WITHOUT 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"; @@ -27,9 +26,9 @@ option java_package = "com.google.cloud.securitycenter.v1p1beta1"; option php_namespace = "Google\\Cloud\\SecurityCenter\\V1p1beta1"; option ruby_package = "Google::Cloud::SecurityCenter::V1p1beta1"; -// User specified security marks that are attached to the parent Cloud Security -// Command Center (Cloud SCC) resource. Security marks are scoped within a Cloud -// SCC organization -- they can be modified and viewed by all users who have +// User specified security marks that are attached to the parent Security +// Command Center resource. Security marks are scoped within a Security Command +// Center organization -- they can be modified and viewed by all users who have // proper permissions on the organization. message SecurityMarks { option (google.api.resource) = { diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/securitycenter_service.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/securitycenter_service.proto index dcd9af68361..7431515bfb8 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/securitycenter_service.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/securitycenter_service.proto @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC. +// 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. @@ -11,7 +11,6 @@ // WITHOUT 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"; @@ -236,7 +235,6 @@ service SecurityCenter { option (google.api.method_signature) = "resource,permissions"; } - // // Creates or updates a finding. The corresponding source must exist for a // finding creation to succeed. rpc UpdateFinding(UpdateFindingRequest) returns (Finding) { @@ -447,15 +445,15 @@ message GroupAssetsRequest { // // Usage: This should be milliseconds since epoch or an RFC3339 string. // Examples: - // "update_time = \"2019-06-10T16:07:18-07:00\"" - // "update_time = 1560208038000" + // `update_time = "2019-06-10T16:07:18-07:00"` + // `update_time = 1560208038000` // // * create_time: `=`, `>`, `<`, `>=`, `<=` // // Usage: This should be milliseconds since epoch or an RFC3339 string. // Examples: - // "create_time = \"2019-06-10T16:07:18-07:00\"" - // "create_time = 1560208038000" + // `create_time = "2019-06-10T16:07:18-07:00"` + // `create_time = 1560208038000` // // * iam_policy.policy_blob: `=`, `:` // * resource_properties: `=`, `:`, `>`, `<`, `>=`, `<=` @@ -470,6 +468,12 @@ message GroupAssetsRequest { // * security_center_properties.resource_owners: `=`, `:` // // For example, `resource_properties.size = 100` is a valid filter string. + // + // Use a partial match on the empty string to filter based on a property + // existing: `resource_properties.my_property : ""` + // + // Use a negated partial match on the empty string to filter based on a + // property not existing: `-resource_properties.my_property : ""` string filter = 2; // Required. Expression that defines what assets fields to use for grouping. @@ -527,11 +531,6 @@ message GroupAssetsRequest { // NOW. google.protobuf.Timestamp read_time = 5; - // Filter that specifies what fields to further filter on *after* the query - // filter has been executed. Currently only `state_change` is supported and - // requires compare_duration to be specified. - string having = 6; - // The value returned by the last `GroupAssetsResponse`; indicates // that this is a continuation of a prior `GroupAssets` call, and that the // system should return the next page of data. @@ -609,13 +608,19 @@ message GroupFindingsRequest { // // Usage: This should be milliseconds since epoch or an RFC3339 string. // Examples: - // "event_time = \"2019-06-10T16:07:18-07:00\"" - // "event_time = 1560208038000" + // `event_time = "2019-06-10T16:07:18-07:00"` + // `event_time = 1560208038000` // // * security_marks.marks: `=`, `:` // * source_properties: `=`, `:`, `>`, `<`, `>=`, `<=` // // For example, `source_properties.size = 100` is a valid filter string. + // + // Use a partial match on the empty string to filter based on a property + // existing: `source_properties.my_property : ""` + // + // Use a negated partial match on the empty string to filter based on a + // property not existing: `-source_properties.my_property : ""` string filter = 2; // Required. Expression that defines what assets fields to use for grouping @@ -653,12 +658,18 @@ message GroupFindingsRequest { // // Possible "state_change" values when compare_duration is specified: // - // * "CHANGED": indicates that the finding was present at the start of - // compare_duration, but changed its state at read_time. - // * "UNCHANGED": indicates that the finding was present at the start of - // compare_duration and did not change state at read_time. - // * "ADDED": indicates that the finding was not present at the start - // of compare_duration, but was present at read_time. + // * "CHANGED": indicates that the finding was present and matched the given + // filter at the start of compare_duration, but changed its + // state at read_time. + // * "UNCHANGED": indicates that the finding was present and matched the given + // filter at the start of compare_duration and did not change + // state at read_time. + // * "ADDED": indicates that the finding did not match the given filter or + // was not present at the start of compare_duration, but was + // present at read_time. + // * "REMOVED": indicates that the finding was present and matched the + // filter at the start of compare_duration, but did not match + // the filter at read_time. // // If compare_duration is not specified, then the only possible state_change // is "UNUSED", which will be the state_change set for all findings present @@ -668,11 +679,6 @@ message GroupFindingsRequest { // `group_by`. google.protobuf.Duration compare_duration = 5; - // Filter that specifies what fields to further filter on *after* the query - // filter has been executed. Currently only `finding.state` and `state_change` - // are supported and requires compare_duration to be specified. - string having = 6; - // The value returned by the last `GroupFindingsResponse`; indicates // that this is a continuation of a prior `GroupFindings` call, and // that the system should return the next page of data. @@ -816,15 +822,15 @@ message ListAssetsRequest { // // Usage: This should be milliseconds since epoch or an RFC3339 string. // Examples: - // "update_time = \"2019-06-10T16:07:18-07:00\"" - // "update_time = 1560208038000" + // `update_time = "2019-06-10T16:07:18-07:00"` + // `update_time = 1560208038000` // // * create_time: `=`, `>`, `<`, `>=`, `<=` // // Usage: This should be milliseconds since epoch or an RFC3339 string. // Examples: - // "create_time = \"2019-06-10T16:07:18-07:00\"" - // "create_time = 1560208038000" + // `create_time = "2019-06-10T16:07:18-07:00"` + // `create_time = 1560208038000` // // * iam_policy.policy_blob: `=`, `:` // * resource_properties: `=`, `:`, `>`, `<`, `>=`, `<=` @@ -839,6 +845,12 @@ message ListAssetsRequest { // * security_center_properties.resource_owners: `=`, `:` // // For example, `resource_properties.size = 100` is a valid filter string. + // + // Use a partial match on the empty string to filter based on a property + // existing: `resource_properties.my_property : ""` + // + // Use a negated partial match on the empty string to filter based on a + // property not existing: `-resource_properties.my_property : ""` string filter = 2; // Expression that defines what fields and order to use for sorting. The @@ -896,11 +908,6 @@ message ListAssetsRequest { // read_time. google.protobuf.Duration compare_duration = 5; - // Filter that specifies what fields to further filter on *after* the query - // filter has been executed. Currently only `state_change` is supported and - // requires compare_duration to be specified. - string having = 6; - // Optional. // A field mask to specify the ListAssetsResult fields to be listed in the // response. @@ -1012,13 +1019,19 @@ message ListFindingsRequest { // // Usage: This should be milliseconds since epoch or an RFC3339 string. // Examples: - // "event_time = \"2019-06-10T16:07:18-07:00\"" - // "event_time = 1560208038000" + // `event_time = "2019-06-10T16:07:18-07:00"` + // `event_time = 1560208038000` // // security_marks.marks: `=`, `:` // source_properties: `=`, `:`, `>`, `<`, `>=`, `<=` // // For example, `source_properties.size = 100` is a valid filter string. + // + // Use a partial match on the empty string to filter based on a property + // existing: `source_properties.my_property : ""` + // + // Use a negated partial match on the empty string to filter based on a + // property not existing: `-source_properties.my_property : ""` string filter = 2; // Expression that defines what fields and order to use for sorting. The @@ -1061,23 +1074,24 @@ message ListFindingsRequest { // // Possible "state_change" values when compare_duration is specified: // - // * "CHANGED": indicates that the finding was present at the start of - // compare_duration, but changed its state at read_time. - // * "UNCHANGED": indicates that the finding was present at the start of - // compare_duration and did not change state at read_time. - // * "ADDED": indicates that the finding was not present at the start - // of compare_duration, but was present at read_time. + // * "CHANGED": indicates that the finding was present and matched the given + // filter at the start of compare_duration, but changed its + // state at read_time. + // * "UNCHANGED": indicates that the finding was present and matched the given + // filter at the start of compare_duration and did not change + // state at read_time. + // * "ADDED": indicates that the finding did not match the given filter or + // was not present at the start of compare_duration, but was + // present at read_time. + // * "REMOVED": indicates that the finding was present and matched the + // filter at the start of compare_duration, but did not match + // the filter at read_time. // // If compare_duration is not specified, then the only possible state_change // is "UNUSED", which will be the state_change set for all findings present at // read_time. google.protobuf.Duration compare_duration = 5; - // Filter that specifies what fields to further filter on *after* the query - // filter has been executed. Currently only `finding.state` and `state_change` - // are supported and requires compare_duration to be specified. - string having = 6; - // Optional. // A field mask to specify the Finding fields to be listed in the response. // An empty field mask will list all fields. @@ -1098,7 +1112,7 @@ message ListFindingsRequest { message ListFindingsResponse { // Result containing the Finding and its StateChange. message ListFindingsResult { - // Information related to the Google Cloud Platform (GCP) resource that is + // Information related to the Google Cloud resource that is // associated with this finding. message Resource { // The full resource name of the resource. See: diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/source.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/source.proto index d591a05cce4..0e940df627a 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/source.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/source.proto @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC. +// 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. @@ -11,7 +11,6 @@ // WITHOUT 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"; @@ -27,7 +26,7 @@ option java_package = "com.google.cloud.securitycenter.v1p1beta1"; option php_namespace = "Google\\Cloud\\SecurityCenter\\V1p1beta1"; option ruby_package = "Google::Cloud::SecurityCenter::V1p1beta1"; -// Cloud Security Command Center's (Cloud SCC) finding source. A finding source +// Security Command Center finding source. A finding source // is an entity or a mechanism that can produce a finding. A source is like a // container of findings that come from the same scanner, logger, monitor, etc. message Source { @@ -51,7 +50,7 @@ message Source { // The description of the source (max of 1024 characters). // Example: - // "Cloud Security Scanner is a web security scanner for common + // "Web Security Scanner is a web security scanner for common // vulnerabilities in App Engine applications. It can automatically // scan and detect four common vulnerabilities, including cross-site-scripting // (XSS), Flash injection, mixed content (HTTP in HTTPS), and diff --git a/packages/google-cloud-securitycenter/protos/protos.d.ts b/packages/google-cloud-securitycenter/protos/protos.d.ts index 36b859448eb..2216b95dee9 100644 --- a/packages/google-cloud-securitycenter/protos/protos.d.ts +++ b/packages/google-cloud-securitycenter/protos/protos.d.ts @@ -845,6 +845,9 @@ export namespace google { /** NotificationMessage finding */ finding?: (google.cloud.securitycenter.v1.IFinding|null); + + /** NotificationMessage resource */ + resource?: (google.cloud.securitycenter.v1.IResource|null); } /** Represents a NotificationMessage. */ @@ -862,6 +865,9 @@ export namespace google { /** NotificationMessage finding. */ public finding?: (google.cloud.securitycenter.v1.IFinding|null); + /** NotificationMessage resource. */ + public resource?: (google.cloud.securitycenter.v1.IResource|null); + /** NotificationMessage event. */ public event?: "finding"; @@ -936,6 +942,120 @@ export namespace google { public toJSON(): { [k: string]: any }; } + /** Properties of a Resource. */ + interface IResource { + + /** Resource name */ + name?: (string|null); + + /** Resource project */ + project?: (string|null); + + /** Resource projectDisplayName */ + projectDisplayName?: (string|null); + + /** Resource parent */ + parent?: (string|null); + + /** Resource parentDisplayName */ + parentDisplayName?: (string|null); + } + + /** Represents a Resource. */ + class Resource implements IResource { + + /** + * Constructs a new Resource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IResource); + + /** Resource name. */ + public name: string; + + /** Resource project. */ + public project: string; + + /** Resource projectDisplayName. */ + public projectDisplayName: string; + + /** Resource parent. */ + public parent: string; + + /** Resource parentDisplayName. */ + public parentDisplayName: string; + + /** + * Creates a new Resource instance using the specified properties. + * @param [properties] Properties to set + * @returns Resource instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IResource): google.cloud.securitycenter.v1.Resource; + + /** + * Encodes the specified Resource message. Does not implicitly {@link google.cloud.securitycenter.v1.Resource.verify|verify} messages. + * @param message Resource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Resource message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Resource.verify|verify} messages. + * @param message Resource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Resource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Resource + * @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.cloud.securitycenter.v1.Resource; + + /** + * Decodes a Resource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Resource + * @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.cloud.securitycenter.v1.Resource; + + /** + * Verifies a Resource 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 Resource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Resource + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.Resource; + + /** + * Creates a plain object from a Resource message. Also converts values to other types if specified. + * @param message Resource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.Resource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Resource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + /** Properties of an OrganizationSettings. */ interface IOrganizationSettings { @@ -9419,6 +9539,9 @@ export namespace google { /** NotificationMessage finding */ finding?: (google.cloud.securitycenter.v1p1beta1.IFinding|null); + + /** NotificationMessage resource */ + resource?: (google.cloud.securitycenter.v1p1beta1.IResource|null); } /** Represents a NotificationMessage. */ @@ -9436,6 +9559,9 @@ export namespace google { /** NotificationMessage finding. */ public finding?: (google.cloud.securitycenter.v1p1beta1.IFinding|null); + /** NotificationMessage resource. */ + public resource?: (google.cloud.securitycenter.v1p1beta1.IResource|null); + /** NotificationMessage event. */ public event?: "finding"; @@ -9510,6 +9636,120 @@ export namespace google { public toJSON(): { [k: string]: any }; } + /** Properties of a Resource. */ + interface IResource { + + /** Resource name */ + name?: (string|null); + + /** Resource project */ + project?: (string|null); + + /** Resource projectDisplayName */ + projectDisplayName?: (string|null); + + /** Resource parent */ + parent?: (string|null); + + /** Resource parentDisplayName */ + parentDisplayName?: (string|null); + } + + /** Represents a Resource. */ + class Resource implements IResource { + + /** + * Constructs a new Resource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1p1beta1.IResource); + + /** Resource name. */ + public name: string; + + /** Resource project. */ + public project: string; + + /** Resource projectDisplayName. */ + public projectDisplayName: string; + + /** Resource parent. */ + public parent: string; + + /** Resource parentDisplayName. */ + public parentDisplayName: string; + + /** + * Creates a new Resource instance using the specified properties. + * @param [properties] Properties to set + * @returns Resource instance + */ + public static create(properties?: google.cloud.securitycenter.v1p1beta1.IResource): google.cloud.securitycenter.v1p1beta1.Resource; + + /** + * Encodes the specified Resource message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.Resource.verify|verify} messages. + * @param message Resource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1p1beta1.IResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Resource message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.Resource.verify|verify} messages. + * @param message Resource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1p1beta1.IResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Resource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Resource + * @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.cloud.securitycenter.v1p1beta1.Resource; + + /** + * Decodes a Resource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Resource + * @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.cloud.securitycenter.v1p1beta1.Resource; + + /** + * Verifies a Resource 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 Resource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Resource + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1p1beta1.Resource; + + /** + * Creates a plain object from a Resource message. Also converts values to other types if specified. + * @param message Resource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1p1beta1.Resource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Resource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + /** Properties of an OrganizationSettings. */ interface IOrganizationSettings { @@ -11013,9 +11253,6 @@ export namespace google { /** GroupAssetsRequest readTime */ readTime?: (google.protobuf.ITimestamp|null); - /** GroupAssetsRequest having */ - having?: (string|null); - /** GroupAssetsRequest pageToken */ pageToken?: (string|null); @@ -11047,9 +11284,6 @@ export namespace google { /** GroupAssetsRequest readTime. */ public readTime?: (google.protobuf.ITimestamp|null); - /** GroupAssetsRequest having. */ - public having: string; - /** GroupAssetsRequest pageToken. */ public pageToken: string; @@ -11253,9 +11487,6 @@ export namespace google { /** GroupFindingsRequest compareDuration */ compareDuration?: (google.protobuf.IDuration|null); - /** GroupFindingsRequest having */ - having?: (string|null); - /** GroupFindingsRequest pageToken */ pageToken?: (string|null); @@ -11287,9 +11518,6 @@ export namespace google { /** GroupFindingsRequest compareDuration. */ public compareDuration?: (google.protobuf.IDuration|null); - /** GroupFindingsRequest having. */ - public having: string; - /** GroupFindingsRequest pageToken. */ public pageToken: string; @@ -11985,9 +12213,6 @@ export namespace google { /** ListAssetsRequest compareDuration */ compareDuration?: (google.protobuf.IDuration|null); - /** ListAssetsRequest having */ - having?: (string|null); - /** ListAssetsRequest fieldMask */ fieldMask?: (google.protobuf.IFieldMask|null); @@ -12022,9 +12247,6 @@ export namespace google { /** ListAssetsRequest compareDuration. */ public compareDuration?: (google.protobuf.IDuration|null); - /** ListAssetsRequest having. */ - public having: string; - /** ListAssetsRequest fieldMask. */ public fieldMask?: (google.protobuf.IFieldMask|null); @@ -12341,9 +12563,6 @@ export namespace google { /** ListFindingsRequest compareDuration */ compareDuration?: (google.protobuf.IDuration|null); - /** ListFindingsRequest having */ - having?: (string|null); - /** ListFindingsRequest fieldMask */ fieldMask?: (google.protobuf.IFieldMask|null); @@ -12378,9 +12597,6 @@ export namespace google { /** ListFindingsRequest compareDuration. */ public compareDuration?: (google.protobuf.IDuration|null); - /** ListFindingsRequest having. */ - public having: string; - /** ListFindingsRequest fieldMask. */ public fieldMask?: (google.protobuf.IFieldMask|null); diff --git a/packages/google-cloud-securitycenter/protos/protos.js b/packages/google-cloud-securitycenter/protos/protos.js index 8f07d7a3f44..b40245a3531 100644 --- a/packages/google-cloud-securitycenter/protos/protos.js +++ b/packages/google-cloud-securitycenter/protos/protos.js @@ -2177,6 +2177,7 @@ * @interface INotificationMessage * @property {string|null} [notificationConfigName] NotificationMessage notificationConfigName * @property {google.cloud.securitycenter.v1.IFinding|null} [finding] NotificationMessage finding + * @property {google.cloud.securitycenter.v1.IResource|null} [resource] NotificationMessage resource */ /** @@ -2210,6 +2211,14 @@ */ NotificationMessage.prototype.finding = null; + /** + * NotificationMessage resource. + * @member {google.cloud.securitycenter.v1.IResource|null|undefined} resource + * @memberof google.cloud.securitycenter.v1.NotificationMessage + * @instance + */ + NotificationMessage.prototype.resource = null; + // OneOf field names bound to virtual getters and setters var $oneOfFields; @@ -2252,6 +2261,8 @@ writer.uint32(/* id 1, wireType 2 =*/10).string(message.notificationConfigName); if (message.finding != null && Object.hasOwnProperty.call(message, "finding")) $root.google.cloud.securitycenter.v1.Finding.encode(message.finding, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) + $root.google.cloud.securitycenter.v1.Resource.encode(message.resource, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; @@ -2292,6 +2303,9 @@ case 2: message.finding = $root.google.cloud.securitycenter.v1.Finding.decode(reader, reader.uint32()); break; + case 3: + message.resource = $root.google.cloud.securitycenter.v1.Resource.decode(reader, reader.uint32()); + break; default: reader.skipType(tag & 7); break; @@ -2339,6 +2353,11 @@ return "finding." + error; } } + if (message.resource != null && message.hasOwnProperty("resource")) { + var error = $root.google.cloud.securitycenter.v1.Resource.verify(message.resource); + if (error) + return "resource." + error; + } return null; }; @@ -2361,6 +2380,11 @@ throw TypeError(".google.cloud.securitycenter.v1.NotificationMessage.finding: object expected"); message.finding = $root.google.cloud.securitycenter.v1.Finding.fromObject(object.finding); } + if (object.resource != null) { + if (typeof object.resource !== "object") + throw TypeError(".google.cloud.securitycenter.v1.NotificationMessage.resource: object expected"); + message.resource = $root.google.cloud.securitycenter.v1.Resource.fromObject(object.resource); + } return message; }; @@ -2377,8 +2401,10 @@ if (!options) options = {}; var object = {}; - if (options.defaults) + if (options.defaults) { object.notificationConfigName = ""; + object.resource = null; + } if (message.notificationConfigName != null && message.hasOwnProperty("notificationConfigName")) object.notificationConfigName = message.notificationConfigName; if (message.finding != null && message.hasOwnProperty("finding")) { @@ -2386,6 +2412,8 @@ if (options.oneofs) object.event = "finding"; } + if (message.resource != null && message.hasOwnProperty("resource")) + object.resource = $root.google.cloud.securitycenter.v1.Resource.toObject(message.resource, options); return object; }; @@ -2403,6 +2431,282 @@ return NotificationMessage; })(); + v1.Resource = (function() { + + /** + * Properties of a Resource. + * @memberof google.cloud.securitycenter.v1 + * @interface IResource + * @property {string|null} [name] Resource name + * @property {string|null} [project] Resource project + * @property {string|null} [projectDisplayName] Resource projectDisplayName + * @property {string|null} [parent] Resource parent + * @property {string|null} [parentDisplayName] Resource parentDisplayName + */ + + /** + * Constructs a new Resource. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a Resource. + * @implements IResource + * @constructor + * @param {google.cloud.securitycenter.v1.IResource=} [properties] Properties to set + */ + function Resource(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]]; + } + + /** + * Resource name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1.Resource + * @instance + */ + Resource.prototype.name = ""; + + /** + * Resource project. + * @member {string} project + * @memberof google.cloud.securitycenter.v1.Resource + * @instance + */ + Resource.prototype.project = ""; + + /** + * Resource projectDisplayName. + * @member {string} projectDisplayName + * @memberof google.cloud.securitycenter.v1.Resource + * @instance + */ + Resource.prototype.projectDisplayName = ""; + + /** + * Resource parent. + * @member {string} parent + * @memberof google.cloud.securitycenter.v1.Resource + * @instance + */ + Resource.prototype.parent = ""; + + /** + * Resource parentDisplayName. + * @member {string} parentDisplayName + * @memberof google.cloud.securitycenter.v1.Resource + * @instance + */ + Resource.prototype.parentDisplayName = ""; + + /** + * Creates a new Resource instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.Resource + * @static + * @param {google.cloud.securitycenter.v1.IResource=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.Resource} Resource instance + */ + Resource.create = function create(properties) { + return new Resource(properties); + }; + + /** + * Encodes the specified Resource message. Does not implicitly {@link google.cloud.securitycenter.v1.Resource.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.Resource + * @static + * @param {google.cloud.securitycenter.v1.IResource} message Resource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Resource.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.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.project); + if (message.projectDisplayName != null && Object.hasOwnProperty.call(message, "projectDisplayName")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.projectDisplayName); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.parent); + if (message.parentDisplayName != null && Object.hasOwnProperty.call(message, "parentDisplayName")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.parentDisplayName); + return writer; + }; + + /** + * Encodes the specified Resource message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Resource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.Resource + * @static + * @param {google.cloud.securitycenter.v1.IResource} message Resource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Resource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Resource message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.Resource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.Resource} Resource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Resource.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.cloud.securitycenter.v1.Resource(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.project = reader.string(); + break; + case 3: + message.projectDisplayName = reader.string(); + break; + case 4: + message.parent = reader.string(); + break; + case 5: + message.parentDisplayName = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Resource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.Resource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.Resource} Resource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Resource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Resource message. + * @function verify + * @memberof google.cloud.securitycenter.v1.Resource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Resource.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.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.projectDisplayName != null && message.hasOwnProperty("projectDisplayName")) + if (!$util.isString(message.projectDisplayName)) + return "projectDisplayName: string expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.parentDisplayName != null && message.hasOwnProperty("parentDisplayName")) + if (!$util.isString(message.parentDisplayName)) + return "parentDisplayName: string expected"; + return null; + }; + + /** + * Creates a Resource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.Resource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.Resource} Resource + */ + Resource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.Resource) + return object; + var message = new $root.google.cloud.securitycenter.v1.Resource(); + if (object.name != null) + message.name = String(object.name); + if (object.project != null) + message.project = String(object.project); + if (object.projectDisplayName != null) + message.projectDisplayName = String(object.projectDisplayName); + if (object.parent != null) + message.parent = String(object.parent); + if (object.parentDisplayName != null) + message.parentDisplayName = String(object.parentDisplayName); + return message; + }; + + /** + * Creates a plain object from a Resource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.Resource + * @static + * @param {google.cloud.securitycenter.v1.Resource} message Resource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Resource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.project = ""; + object.projectDisplayName = ""; + object.parent = ""; + object.parentDisplayName = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.projectDisplayName != null && message.hasOwnProperty("projectDisplayName")) + object.projectDisplayName = message.projectDisplayName; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.parentDisplayName != null && message.hasOwnProperty("parentDisplayName")) + object.parentDisplayName = message.parentDisplayName; + return object; + }; + + /** + * Converts this Resource to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.Resource + * @instance + * @returns {Object.} JSON object + */ + Resource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Resource; + })(); + v1.OrganizationSettings = (function() { /** @@ -22372,6 +22676,7 @@ * @interface INotificationMessage * @property {string|null} [notificationConfigName] NotificationMessage notificationConfigName * @property {google.cloud.securitycenter.v1p1beta1.IFinding|null} [finding] NotificationMessage finding + * @property {google.cloud.securitycenter.v1p1beta1.IResource|null} [resource] NotificationMessage resource */ /** @@ -22405,6 +22710,14 @@ */ NotificationMessage.prototype.finding = null; + /** + * NotificationMessage resource. + * @member {google.cloud.securitycenter.v1p1beta1.IResource|null|undefined} resource + * @memberof google.cloud.securitycenter.v1p1beta1.NotificationMessage + * @instance + */ + NotificationMessage.prototype.resource = null; + // OneOf field names bound to virtual getters and setters var $oneOfFields; @@ -22447,6 +22760,8 @@ writer.uint32(/* id 1, wireType 2 =*/10).string(message.notificationConfigName); if (message.finding != null && Object.hasOwnProperty.call(message, "finding")) $root.google.cloud.securitycenter.v1p1beta1.Finding.encode(message.finding, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) + $root.google.cloud.securitycenter.v1p1beta1.Resource.encode(message.resource, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; @@ -22487,6 +22802,9 @@ case 2: message.finding = $root.google.cloud.securitycenter.v1p1beta1.Finding.decode(reader, reader.uint32()); break; + case 3: + message.resource = $root.google.cloud.securitycenter.v1p1beta1.Resource.decode(reader, reader.uint32()); + break; default: reader.skipType(tag & 7); break; @@ -22534,6 +22852,11 @@ return "finding." + error; } } + if (message.resource != null && message.hasOwnProperty("resource")) { + var error = $root.google.cloud.securitycenter.v1p1beta1.Resource.verify(message.resource); + if (error) + return "resource." + error; + } return null; }; @@ -22556,6 +22879,11 @@ throw TypeError(".google.cloud.securitycenter.v1p1beta1.NotificationMessage.finding: object expected"); message.finding = $root.google.cloud.securitycenter.v1p1beta1.Finding.fromObject(object.finding); } + if (object.resource != null) { + if (typeof object.resource !== "object") + throw TypeError(".google.cloud.securitycenter.v1p1beta1.NotificationMessage.resource: object expected"); + message.resource = $root.google.cloud.securitycenter.v1p1beta1.Resource.fromObject(object.resource); + } return message; }; @@ -22572,8 +22900,10 @@ if (!options) options = {}; var object = {}; - if (options.defaults) + if (options.defaults) { object.notificationConfigName = ""; + object.resource = null; + } if (message.notificationConfigName != null && message.hasOwnProperty("notificationConfigName")) object.notificationConfigName = message.notificationConfigName; if (message.finding != null && message.hasOwnProperty("finding")) { @@ -22581,6 +22911,8 @@ if (options.oneofs) object.event = "finding"; } + if (message.resource != null && message.hasOwnProperty("resource")) + object.resource = $root.google.cloud.securitycenter.v1p1beta1.Resource.toObject(message.resource, options); return object; }; @@ -22598,6 +22930,282 @@ return NotificationMessage; })(); + v1p1beta1.Resource = (function() { + + /** + * Properties of a Resource. + * @memberof google.cloud.securitycenter.v1p1beta1 + * @interface IResource + * @property {string|null} [name] Resource name + * @property {string|null} [project] Resource project + * @property {string|null} [projectDisplayName] Resource projectDisplayName + * @property {string|null} [parent] Resource parent + * @property {string|null} [parentDisplayName] Resource parentDisplayName + */ + + /** + * Constructs a new Resource. + * @memberof google.cloud.securitycenter.v1p1beta1 + * @classdesc Represents a Resource. + * @implements IResource + * @constructor + * @param {google.cloud.securitycenter.v1p1beta1.IResource=} [properties] Properties to set + */ + function Resource(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]]; + } + + /** + * Resource name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1p1beta1.Resource + * @instance + */ + Resource.prototype.name = ""; + + /** + * Resource project. + * @member {string} project + * @memberof google.cloud.securitycenter.v1p1beta1.Resource + * @instance + */ + Resource.prototype.project = ""; + + /** + * Resource projectDisplayName. + * @member {string} projectDisplayName + * @memberof google.cloud.securitycenter.v1p1beta1.Resource + * @instance + */ + Resource.prototype.projectDisplayName = ""; + + /** + * Resource parent. + * @member {string} parent + * @memberof google.cloud.securitycenter.v1p1beta1.Resource + * @instance + */ + Resource.prototype.parent = ""; + + /** + * Resource parentDisplayName. + * @member {string} parentDisplayName + * @memberof google.cloud.securitycenter.v1p1beta1.Resource + * @instance + */ + Resource.prototype.parentDisplayName = ""; + + /** + * Creates a new Resource instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1p1beta1.Resource + * @static + * @param {google.cloud.securitycenter.v1p1beta1.IResource=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1p1beta1.Resource} Resource instance + */ + Resource.create = function create(properties) { + return new Resource(properties); + }; + + /** + * Encodes the specified Resource message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.Resource.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1p1beta1.Resource + * @static + * @param {google.cloud.securitycenter.v1p1beta1.IResource} message Resource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Resource.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.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.project); + if (message.projectDisplayName != null && Object.hasOwnProperty.call(message, "projectDisplayName")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.projectDisplayName); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.parent); + if (message.parentDisplayName != null && Object.hasOwnProperty.call(message, "parentDisplayName")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.parentDisplayName); + return writer; + }; + + /** + * Encodes the specified Resource message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.Resource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1p1beta1.Resource + * @static + * @param {google.cloud.securitycenter.v1p1beta1.IResource} message Resource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Resource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Resource message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1p1beta1.Resource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1p1beta1.Resource} Resource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Resource.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.cloud.securitycenter.v1p1beta1.Resource(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.project = reader.string(); + break; + case 3: + message.projectDisplayName = reader.string(); + break; + case 4: + message.parent = reader.string(); + break; + case 5: + message.parentDisplayName = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Resource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1p1beta1.Resource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1p1beta1.Resource} Resource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Resource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Resource message. + * @function verify + * @memberof google.cloud.securitycenter.v1p1beta1.Resource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Resource.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.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.projectDisplayName != null && message.hasOwnProperty("projectDisplayName")) + if (!$util.isString(message.projectDisplayName)) + return "projectDisplayName: string expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.parentDisplayName != null && message.hasOwnProperty("parentDisplayName")) + if (!$util.isString(message.parentDisplayName)) + return "parentDisplayName: string expected"; + return null; + }; + + /** + * Creates a Resource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1p1beta1.Resource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1p1beta1.Resource} Resource + */ + Resource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1p1beta1.Resource) + return object; + var message = new $root.google.cloud.securitycenter.v1p1beta1.Resource(); + if (object.name != null) + message.name = String(object.name); + if (object.project != null) + message.project = String(object.project); + if (object.projectDisplayName != null) + message.projectDisplayName = String(object.projectDisplayName); + if (object.parent != null) + message.parent = String(object.parent); + if (object.parentDisplayName != null) + message.parentDisplayName = String(object.parentDisplayName); + return message; + }; + + /** + * Creates a plain object from a Resource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1p1beta1.Resource + * @static + * @param {google.cloud.securitycenter.v1p1beta1.Resource} message Resource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Resource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.project = ""; + object.projectDisplayName = ""; + object.parent = ""; + object.parentDisplayName = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.projectDisplayName != null && message.hasOwnProperty("projectDisplayName")) + object.projectDisplayName = message.projectDisplayName; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.parentDisplayName != null && message.hasOwnProperty("parentDisplayName")) + object.parentDisplayName = message.parentDisplayName; + return object; + }; + + /** + * Converts this Resource to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1p1beta1.Resource + * @instance + * @returns {Object.} JSON object + */ + Resource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Resource; + })(); + v1p1beta1.OrganizationSettings = (function() { /** @@ -25593,7 +26201,6 @@ * @property {string|null} [groupBy] GroupAssetsRequest groupBy * @property {google.protobuf.IDuration|null} [compareDuration] GroupAssetsRequest compareDuration * @property {google.protobuf.ITimestamp|null} [readTime] GroupAssetsRequest readTime - * @property {string|null} [having] GroupAssetsRequest having * @property {string|null} [pageToken] GroupAssetsRequest pageToken * @property {number|null} [pageSize] GroupAssetsRequest pageSize */ @@ -25653,14 +26260,6 @@ */ GroupAssetsRequest.prototype.readTime = null; - /** - * GroupAssetsRequest having. - * @member {string} having - * @memberof google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest - * @instance - */ - GroupAssetsRequest.prototype.having = ""; - /** * GroupAssetsRequest pageToken. * @member {string} pageToken @@ -25711,8 +26310,6 @@ $root.google.protobuf.Duration.encode(message.compareDuration, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); if (message.readTime != null && Object.hasOwnProperty.call(message, "readTime")) $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.having != null && Object.hasOwnProperty.call(message, "having")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.having); if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) writer.uint32(/* id 7, wireType 2 =*/58).string(message.pageToken); if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) @@ -25766,9 +26363,6 @@ case 5: message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; - case 6: - message.having = reader.string(); - break; case 7: message.pageToken = reader.string(); break; @@ -25829,9 +26423,6 @@ if (error) return "readTime." + error; } - if (message.having != null && message.hasOwnProperty("having")) - if (!$util.isString(message.having)) - return "having: string expected"; if (message.pageToken != null && message.hasOwnProperty("pageToken")) if (!$util.isString(message.pageToken)) return "pageToken: string expected"; @@ -25869,8 +26460,6 @@ throw TypeError(".google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest.readTime: object expected"); message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); } - if (object.having != null) - message.having = String(object.having); if (object.pageToken != null) message.pageToken = String(object.pageToken); if (object.pageSize != null) @@ -25897,7 +26486,6 @@ object.groupBy = ""; object.compareDuration = null; object.readTime = null; - object.having = ""; object.pageToken = ""; object.pageSize = 0; } @@ -25911,8 +26499,6 @@ object.compareDuration = $root.google.protobuf.Duration.toObject(message.compareDuration, options); if (message.readTime != null && message.hasOwnProperty("readTime")) object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); - if (message.having != null && message.hasOwnProperty("having")) - object.having = message.having; if (message.pageToken != null && message.hasOwnProperty("pageToken")) object.pageToken = message.pageToken; if (message.pageSize != null && message.hasOwnProperty("pageSize")) @@ -26226,7 +26812,6 @@ * @property {string|null} [groupBy] GroupFindingsRequest groupBy * @property {google.protobuf.ITimestamp|null} [readTime] GroupFindingsRequest readTime * @property {google.protobuf.IDuration|null} [compareDuration] GroupFindingsRequest compareDuration - * @property {string|null} [having] GroupFindingsRequest having * @property {string|null} [pageToken] GroupFindingsRequest pageToken * @property {number|null} [pageSize] GroupFindingsRequest pageSize */ @@ -26286,14 +26871,6 @@ */ GroupFindingsRequest.prototype.compareDuration = null; - /** - * GroupFindingsRequest having. - * @member {string} having - * @memberof google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest - * @instance - */ - GroupFindingsRequest.prototype.having = ""; - /** * GroupFindingsRequest pageToken. * @member {string} pageToken @@ -26344,8 +26921,6 @@ $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); if (message.compareDuration != null && Object.hasOwnProperty.call(message, "compareDuration")) $root.google.protobuf.Duration.encode(message.compareDuration, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.having != null && Object.hasOwnProperty.call(message, "having")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.having); if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) writer.uint32(/* id 7, wireType 2 =*/58).string(message.pageToken); if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) @@ -26399,9 +26974,6 @@ case 5: message.compareDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); break; - case 6: - message.having = reader.string(); - break; case 7: message.pageToken = reader.string(); break; @@ -26462,9 +27034,6 @@ if (error) return "compareDuration." + error; } - if (message.having != null && message.hasOwnProperty("having")) - if (!$util.isString(message.having)) - return "having: string expected"; if (message.pageToken != null && message.hasOwnProperty("pageToken")) if (!$util.isString(message.pageToken)) return "pageToken: string expected"; @@ -26502,8 +27071,6 @@ throw TypeError(".google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest.compareDuration: object expected"); message.compareDuration = $root.google.protobuf.Duration.fromObject(object.compareDuration); } - if (object.having != null) - message.having = String(object.having); if (object.pageToken != null) message.pageToken = String(object.pageToken); if (object.pageSize != null) @@ -26530,7 +27097,6 @@ object.groupBy = ""; object.readTime = null; object.compareDuration = null; - object.having = ""; object.pageToken = ""; object.pageSize = 0; } @@ -26544,8 +27110,6 @@ object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); if (message.compareDuration != null && message.hasOwnProperty("compareDuration")) object.compareDuration = $root.google.protobuf.Duration.toObject(message.compareDuration, options); - if (message.having != null && message.hasOwnProperty("having")) - object.having = message.having; if (message.pageToken != null && message.hasOwnProperty("pageToken")) object.pageToken = message.pageToken; if (message.pageSize != null && message.hasOwnProperty("pageSize")) @@ -28037,7 +28601,6 @@ * @property {string|null} [orderBy] ListAssetsRequest orderBy * @property {google.protobuf.ITimestamp|null} [readTime] ListAssetsRequest readTime * @property {google.protobuf.IDuration|null} [compareDuration] ListAssetsRequest compareDuration - * @property {string|null} [having] ListAssetsRequest having * @property {google.protobuf.IFieldMask|null} [fieldMask] ListAssetsRequest fieldMask * @property {string|null} [pageToken] ListAssetsRequest pageToken * @property {number|null} [pageSize] ListAssetsRequest pageSize @@ -28098,14 +28661,6 @@ */ ListAssetsRequest.prototype.compareDuration = null; - /** - * ListAssetsRequest having. - * @member {string} having - * @memberof google.cloud.securitycenter.v1p1beta1.ListAssetsRequest - * @instance - */ - ListAssetsRequest.prototype.having = ""; - /** * ListAssetsRequest fieldMask. * @member {google.protobuf.IFieldMask|null|undefined} fieldMask @@ -28164,8 +28719,6 @@ $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); if (message.compareDuration != null && Object.hasOwnProperty.call(message, "compareDuration")) $root.google.protobuf.Duration.encode(message.compareDuration, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.having != null && Object.hasOwnProperty.call(message, "having")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.having); if (message.fieldMask != null && Object.hasOwnProperty.call(message, "fieldMask")) $root.google.protobuf.FieldMask.encode(message.fieldMask, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) @@ -28221,9 +28774,6 @@ case 5: message.compareDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); break; - case 6: - message.having = reader.string(); - break; case 7: message.fieldMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); break; @@ -28287,9 +28837,6 @@ if (error) return "compareDuration." + error; } - if (message.having != null && message.hasOwnProperty("having")) - if (!$util.isString(message.having)) - return "having: string expected"; if (message.fieldMask != null && message.hasOwnProperty("fieldMask")) { var error = $root.google.protobuf.FieldMask.verify(message.fieldMask); if (error) @@ -28332,8 +28879,6 @@ throw TypeError(".google.cloud.securitycenter.v1p1beta1.ListAssetsRequest.compareDuration: object expected"); message.compareDuration = $root.google.protobuf.Duration.fromObject(object.compareDuration); } - if (object.having != null) - message.having = String(object.having); if (object.fieldMask != null) { if (typeof object.fieldMask !== "object") throw TypeError(".google.cloud.securitycenter.v1p1beta1.ListAssetsRequest.fieldMask: object expected"); @@ -28365,7 +28910,6 @@ object.orderBy = ""; object.readTime = null; object.compareDuration = null; - object.having = ""; object.fieldMask = null; object.pageToken = ""; object.pageSize = 0; @@ -28380,8 +28924,6 @@ object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); if (message.compareDuration != null && message.hasOwnProperty("compareDuration")) object.compareDuration = $root.google.protobuf.Duration.toObject(message.compareDuration, options); - if (message.having != null && message.hasOwnProperty("having")) - object.having = message.having; if (message.fieldMask != null && message.hasOwnProperty("fieldMask")) object.fieldMask = $root.google.protobuf.FieldMask.toObject(message.fieldMask, options); if (message.pageToken != null && message.hasOwnProperty("pageToken")) @@ -28953,7 +29495,6 @@ * @property {string|null} [orderBy] ListFindingsRequest orderBy * @property {google.protobuf.ITimestamp|null} [readTime] ListFindingsRequest readTime * @property {google.protobuf.IDuration|null} [compareDuration] ListFindingsRequest compareDuration - * @property {string|null} [having] ListFindingsRequest having * @property {google.protobuf.IFieldMask|null} [fieldMask] ListFindingsRequest fieldMask * @property {string|null} [pageToken] ListFindingsRequest pageToken * @property {number|null} [pageSize] ListFindingsRequest pageSize @@ -29014,14 +29555,6 @@ */ ListFindingsRequest.prototype.compareDuration = null; - /** - * ListFindingsRequest having. - * @member {string} having - * @memberof google.cloud.securitycenter.v1p1beta1.ListFindingsRequest - * @instance - */ - ListFindingsRequest.prototype.having = ""; - /** * ListFindingsRequest fieldMask. * @member {google.protobuf.IFieldMask|null|undefined} fieldMask @@ -29080,8 +29613,6 @@ $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); if (message.compareDuration != null && Object.hasOwnProperty.call(message, "compareDuration")) $root.google.protobuf.Duration.encode(message.compareDuration, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.having != null && Object.hasOwnProperty.call(message, "having")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.having); if (message.fieldMask != null && Object.hasOwnProperty.call(message, "fieldMask")) $root.google.protobuf.FieldMask.encode(message.fieldMask, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) @@ -29137,9 +29668,6 @@ case 5: message.compareDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); break; - case 6: - message.having = reader.string(); - break; case 7: message.fieldMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); break; @@ -29203,9 +29731,6 @@ if (error) return "compareDuration." + error; } - if (message.having != null && message.hasOwnProperty("having")) - if (!$util.isString(message.having)) - return "having: string expected"; if (message.fieldMask != null && message.hasOwnProperty("fieldMask")) { var error = $root.google.protobuf.FieldMask.verify(message.fieldMask); if (error) @@ -29248,8 +29773,6 @@ throw TypeError(".google.cloud.securitycenter.v1p1beta1.ListFindingsRequest.compareDuration: object expected"); message.compareDuration = $root.google.protobuf.Duration.fromObject(object.compareDuration); } - if (object.having != null) - message.having = String(object.having); if (object.fieldMask != null) { if (typeof object.fieldMask !== "object") throw TypeError(".google.cloud.securitycenter.v1p1beta1.ListFindingsRequest.fieldMask: object expected"); @@ -29281,7 +29804,6 @@ object.orderBy = ""; object.readTime = null; object.compareDuration = null; - object.having = ""; object.fieldMask = null; object.pageToken = ""; object.pageSize = 0; @@ -29296,8 +29818,6 @@ object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); if (message.compareDuration != null && message.hasOwnProperty("compareDuration")) object.compareDuration = $root.google.protobuf.Duration.toObject(message.compareDuration, options); - if (message.having != null && message.hasOwnProperty("having")) - object.having = message.having; if (message.fieldMask != null && message.hasOwnProperty("fieldMask")) object.fieldMask = $root.google.protobuf.FieldMask.toObject(message.fieldMask, options); if (message.pageToken != null && message.hasOwnProperty("pageToken")) diff --git a/packages/google-cloud-securitycenter/protos/protos.json b/packages/google-cloud-securitycenter/protos/protos.json index 5c8e73dddc5..7bb9f745b47 100644 --- a/packages/google-cloud-securitycenter/protos/protos.json +++ b/packages/google-cloud-securitycenter/protos/protos.json @@ -14,7 +14,7 @@ "java_package": "com.google.cloud.securitycenter.v1", "php_namespace": "Google\\Cloud\\SecurityCenter\\V1", "ruby_package": "Google::Cloud::SecurityCenter::V1", - "java_outer_classname": "NotificationMessageProto", + "java_outer_classname": "ResourceProto", "(google.api.resource_definition).type": "pubsub.googleapis.com/Topic", "(google.api.resource_definition).pattern": "projects/{project}/topics/{topic}" }, @@ -248,6 +248,34 @@ "finding": { "type": "Finding", "id": 2 + }, + "resource": { + "type": "Resource", + "id": 3 + } + } + }, + "Resource": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "project": { + "type": "string", + "id": 2 + }, + "projectDisplayName": { + "type": "string", + "id": 3 + }, + "parent": { + "type": "string", + "id": 4 + }, + "parentDisplayName": { + "type": "string", + "id": 5 } } }, @@ -2071,7 +2099,8 @@ "php_namespace": "Google\\Cloud\\SecurityCenter\\V1p1beta1", "ruby_package": "Google::Cloud::SecurityCenter::V1p1beta1", "(google.api.resource_definition).type": "pubsub.googleapis.com/Topic", - "(google.api.resource_definition).pattern": "projects/{project}/topics/{topic}" + "(google.api.resource_definition).pattern": "projects/{project}/topics/{topic}", + "java_outer_classname": "ResourceProto" }, "nested": { "Asset": { @@ -2313,6 +2342,34 @@ "finding": { "type": "Finding", "id": 2 + }, + "resource": { + "type": "Resource", + "id": 3 + } + } + }, + "Resource": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "project": { + "type": "string", + "id": 2 + }, + "projectDisplayName": { + "type": "string", + "id": 3 + }, + "parent": { + "type": "string", + "id": 4 + }, + "parentDisplayName": { + "type": "string", + "id": 5 } } }, @@ -2740,10 +2797,6 @@ "type": "google.protobuf.Timestamp", "id": 5 }, - "having": { - "type": "string", - "id": 6 - }, "pageToken": { "type": "string", "id": 7 @@ -2804,10 +2857,6 @@ "type": "google.protobuf.Duration", "id": 5 }, - "having": { - "type": "string", - "id": 6 - }, "pageToken": { "type": "string", "id": 7 @@ -2944,10 +2993,6 @@ "type": "google.protobuf.Duration", "id": 5 }, - "having": { - "type": "string", - "id": 6 - }, "fieldMask": { "type": "google.protobuf.FieldMask", "id": 7, @@ -3036,10 +3081,6 @@ "type": "google.protobuf.Duration", "id": 5 }, - "having": { - "type": "string", - "id": 6 - }, "fieldMask": { "type": "google.protobuf.FieldMask", "id": 7, diff --git a/packages/google-cloud-securitycenter/src/v1/security_center_client.ts b/packages/google-cloud-securitycenter/src/v1/security_center_client.ts index 49a9f54c15a..72b5f783636 100644 --- a/packages/google-cloud-securitycenter/src/v1/security_center_client.ts +++ b/packages/google-cloud-securitycenter/src/v1/security_center_client.ts @@ -2151,15 +2151,15 @@ export class SecurityCenterClient { * * Usage: This should be milliseconds since epoch or an RFC3339 string. * Examples: - * "update_time = \"2019-06-10T16:07:18-07:00\"" - * "update_time = 1560208038000" + * `update_time = "2019-06-10T16:07:18-07:00"` + * `update_time = 1560208038000` * * * create_time: `=`, `>`, `<`, `>=`, `<=` * * Usage: This should be milliseconds since epoch or an RFC3339 string. * Examples: - * "create_time = \"2019-06-10T16:07:18-07:00\"" - * "create_time = 1560208038000" + * `create_time = "2019-06-10T16:07:18-07:00"` + * `create_time = 1560208038000` * * * iam_policy.policy_blob: `=`, `:` * * resource_properties: `=`, `:`, `>`, `<`, `>=`, `<=` @@ -2174,6 +2174,12 @@ export class SecurityCenterClient { * * security_center_properties.resource_owners: `=`, `:` * * For example, `resource_properties.size = 100` is a valid filter string. + * + * Use a partial match on the empty string to filter based on a property + * existing:`resource_properties.my_property : ""` + * + * Use a negated partial match on the empty string to filter based on a + * property not existing: `-resource_properties.my_property : ""` * @param {string} request.groupBy * Required. Expression that defines what assets fields to use for grouping. * The string value should follow SQL syntax: comma separated list of fields. @@ -2348,15 +2354,15 @@ export class SecurityCenterClient { * * Usage: This should be milliseconds since epoch or an RFC3339 string. * Examples: - * "update_time = \"2019-06-10T16:07:18-07:00\"" - * "update_time = 1560208038000" + * `update_time = "2019-06-10T16:07:18-07:00"` + * `update_time = 1560208038000` * * * create_time: `=`, `>`, `<`, `>=`, `<=` * * Usage: This should be milliseconds since epoch or an RFC3339 string. * Examples: - * "create_time = \"2019-06-10T16:07:18-07:00\"" - * "create_time = 1560208038000" + * `create_time = "2019-06-10T16:07:18-07:00"` + * `create_time = 1560208038000` * * * iam_policy.policy_blob: `=`, `:` * * resource_properties: `=`, `:`, `>`, `<`, `>=`, `<=` @@ -2371,6 +2377,12 @@ export class SecurityCenterClient { * * security_center_properties.resource_owners: `=`, `:` * * For example, `resource_properties.size = 100` is a valid filter string. + * + * Use a partial match on the empty string to filter based on a property + * existing:`resource_properties.my_property : ""` + * + * Use a negated partial match on the empty string to filter based on a + * property not existing: `-resource_properties.my_property : ""` * @param {string} request.groupBy * Required. Expression that defines what assets fields to use for grouping. * The string value should follow SQL syntax: comma separated list of fields. @@ -2501,15 +2513,15 @@ export class SecurityCenterClient { * * Usage: This should be milliseconds since epoch or an RFC3339 string. * Examples: - * "update_time = \"2019-06-10T16:07:18-07:00\"" - * "update_time = 1560208038000" + * `update_time = "2019-06-10T16:07:18-07:00"` + * `update_time = 1560208038000` * * * create_time: `=`, `>`, `<`, `>=`, `<=` * * Usage: This should be milliseconds since epoch or an RFC3339 string. * Examples: - * "create_time = \"2019-06-10T16:07:18-07:00\"" - * "create_time = 1560208038000" + * `create_time = "2019-06-10T16:07:18-07:00"` + * `create_time = 1560208038000` * * * iam_policy.policy_blob: `=`, `:` * * resource_properties: `=`, `:`, `>`, `<`, `>=`, `<=` @@ -2524,6 +2536,12 @@ export class SecurityCenterClient { * * security_center_properties.resource_owners: `=`, `:` * * For example, `resource_properties.size = 100` is a valid filter string. + * + * Use a partial match on the empty string to filter based on a property + * existing:`resource_properties.my_property : ""` + * + * Use a negated partial match on the empty string to filter based on a + * property not existing: `-resource_properties.my_property : ""` * @param {string} request.groupBy * Required. Expression that defines what assets fields to use for grouping. * The string value should follow SQL syntax: comma separated list of fields. @@ -2692,13 +2710,19 @@ export class SecurityCenterClient { * * Usage: This should be milliseconds since epoch or an RFC3339 string. * Examples: - * "event_time = \"2019-06-10T16:07:18-07:00\"" - * "event_time = 1560208038000" + * `event_time = "2019-06-10T16:07:18-07:00"` + * `event_time = 1560208038000` * * * security_marks.marks: `=`, `:` * * source_properties: `=`, `:`, `>`, `<`, `>=`, `<=` * * For example, `source_properties.size = 100` is a valid filter string. + * + * Use a partial match on the empty string to filter based on a property + * existing: `source_properties.my_property : ""` + * + * Use a negated partial match on the empty string to filter based on a + * property not existing: `-source_properties.my_property : ""` * @param {string} request.groupBy * Required. Expression that defines what assets fields to use for grouping * (including `state_change`). The string value should follow SQL syntax: @@ -2879,13 +2903,19 @@ export class SecurityCenterClient { * * Usage: This should be milliseconds since epoch or an RFC3339 string. * Examples: - * "event_time = \"2019-06-10T16:07:18-07:00\"" - * "event_time = 1560208038000" + * `event_time = "2019-06-10T16:07:18-07:00"` + * `event_time = 1560208038000` * * * security_marks.marks: `=`, `:` * * source_properties: `=`, `:`, `>`, `<`, `>=`, `<=` * * For example, `source_properties.size = 100` is a valid filter string. + * + * Use a partial match on the empty string to filter based on a property + * existing: `source_properties.my_property : ""` + * + * Use a negated partial match on the empty string to filter based on a + * property not existing: `-source_properties.my_property : ""` * @param {string} request.groupBy * Required. Expression that defines what assets fields to use for grouping * (including `state_change`). The string value should follow SQL syntax: @@ -3022,13 +3052,19 @@ export class SecurityCenterClient { * * Usage: This should be milliseconds since epoch or an RFC3339 string. * Examples: - * "event_time = \"2019-06-10T16:07:18-07:00\"" - * "event_time = 1560208038000" + * `event_time = "2019-06-10T16:07:18-07:00"` + * `event_time = 1560208038000` * * * security_marks.marks: `=`, `:` * * source_properties: `=`, `:`, `>`, `<`, `>=`, `<=` * * For example, `source_properties.size = 100` is a valid filter string. + * + * Use a partial match on the empty string to filter based on a property + * existing: `source_properties.my_property : ""` + * + * Use a negated partial match on the empty string to filter based on a + * property not existing: `-source_properties.my_property : ""` * @param {string} request.groupBy * Required. Expression that defines what assets fields to use for grouping * (including `state_change`). The string value should follow SQL syntax: @@ -3189,15 +3225,15 @@ export class SecurityCenterClient { * * Usage: This should be milliseconds since epoch or an RFC3339 string. * Examples: - * "update_time = \"2019-06-10T16:07:18-07:00\"" - * "update_time = 1560208038000" + * `update_time = "2019-06-10T16:07:18-07:00"` + * `update_time = 1560208038000` * * * create_time: `=`, `>`, `<`, `>=`, `<=` * * Usage: This should be milliseconds since epoch or an RFC3339 string. * Examples: - * "create_time = \"2019-06-10T16:07:18-07:00\"" - * "create_time = 1560208038000" + * `create_time = "2019-06-10T16:07:18-07:00"` + * `create_time = 1560208038000` * * * iam_policy.policy_blob: `=`, `:` * * resource_properties: `=`, `:`, `>`, `<`, `>=`, `<=` @@ -3212,6 +3248,12 @@ export class SecurityCenterClient { * * security_center_properties.resource_owners: `=`, `:` * * For example, `resource_properties.size = 100` is a valid filter string. + * + * Use a partial match on the empty string to filter based on a property + * existing: `resource_properties.my_property : ""` + * + * Use a negated partial match on the empty string to filter based on a + * property not existing: `-resource_properties.my_property : ""` * @param {string} request.orderBy * Expression that defines what fields and order to use for sorting. The * string value should follow SQL syntax: comma separated list of fields. For @@ -3389,15 +3431,15 @@ export class SecurityCenterClient { * * Usage: This should be milliseconds since epoch or an RFC3339 string. * Examples: - * "update_time = \"2019-06-10T16:07:18-07:00\"" - * "update_time = 1560208038000" + * `update_time = "2019-06-10T16:07:18-07:00"` + * `update_time = 1560208038000` * * * create_time: `=`, `>`, `<`, `>=`, `<=` * * Usage: This should be milliseconds since epoch or an RFC3339 string. * Examples: - * "create_time = \"2019-06-10T16:07:18-07:00\"" - * "create_time = 1560208038000" + * `create_time = "2019-06-10T16:07:18-07:00"` + * `create_time = 1560208038000` * * * iam_policy.policy_blob: `=`, `:` * * resource_properties: `=`, `:`, `>`, `<`, `>=`, `<=` @@ -3412,6 +3454,12 @@ export class SecurityCenterClient { * * security_center_properties.resource_owners: `=`, `:` * * For example, `resource_properties.size = 100` is a valid filter string. + * + * Use a partial match on the empty string to filter based on a property + * existing: `resource_properties.my_property : ""` + * + * Use a negated partial match on the empty string to filter based on a + * property not existing: `-resource_properties.my_property : ""` * @param {string} request.orderBy * Expression that defines what fields and order to use for sorting. The * string value should follow SQL syntax: comma separated list of fields. For @@ -3545,15 +3593,15 @@ export class SecurityCenterClient { * * Usage: This should be milliseconds since epoch or an RFC3339 string. * Examples: - * "update_time = \"2019-06-10T16:07:18-07:00\"" - * "update_time = 1560208038000" + * `update_time = "2019-06-10T16:07:18-07:00"` + * `update_time = 1560208038000` * * * create_time: `=`, `>`, `<`, `>=`, `<=` * * Usage: This should be milliseconds since epoch or an RFC3339 string. * Examples: - * "create_time = \"2019-06-10T16:07:18-07:00\"" - * "create_time = 1560208038000" + * `create_time = "2019-06-10T16:07:18-07:00"` + * `create_time = 1560208038000` * * * iam_policy.policy_blob: `=`, `:` * * resource_properties: `=`, `:`, `>`, `<`, `>=`, `<=` @@ -3568,6 +3616,12 @@ export class SecurityCenterClient { * * security_center_properties.resource_owners: `=`, `:` * * For example, `resource_properties.size = 100` is a valid filter string. + * + * Use a partial match on the empty string to filter based on a property + * existing: `resource_properties.my_property : ""` + * + * Use a negated partial match on the empty string to filter based on a + * property not existing: `-resource_properties.my_property : ""` * @param {string} request.orderBy * Expression that defines what fields and order to use for sorting. The * string value should follow SQL syntax: comma separated list of fields. For @@ -3742,13 +3796,19 @@ export class SecurityCenterClient { * * Usage: This should be milliseconds since epoch or an RFC3339 string. * Examples: - * "event_time = \"2019-06-10T16:07:18-07:00\"" - * "event_time = 1560208038000" + * `event_time = "2019-06-10T16:07:18-07:00"` + * `event_time = 1560208038000` * * security_marks.marks: `=`, `:` * source_properties: `=`, `:`, `>`, `<`, `>=`, `<=` * * For example, `source_properties.size = 100` is a valid filter string. + * + * Use a partial match on the empty string to filter based on a property + * existing: `source_properties.my_property : ""` + * + * Use a negated partial match on the empty string to filter based on a + * property not existing: `-source_properties.my_property : ""` * @param {string} request.orderBy * Expression that defines what fields and order to use for sorting. The * string value should follow SQL syntax: comma separated list of fields. For @@ -3934,13 +3994,19 @@ export class SecurityCenterClient { * * Usage: This should be milliseconds since epoch or an RFC3339 string. * Examples: - * "event_time = \"2019-06-10T16:07:18-07:00\"" - * "event_time = 1560208038000" + * `event_time = "2019-06-10T16:07:18-07:00"` + * `event_time = 1560208038000` * * security_marks.marks: `=`, `:` * source_properties: `=`, `:`, `>`, `<`, `>=`, `<=` * * For example, `source_properties.size = 100` is a valid filter string. + * + * Use a partial match on the empty string to filter based on a property + * existing: `source_properties.my_property : ""` + * + * Use a negated partial match on the empty string to filter based on a + * property not existing: `-source_properties.my_property : ""` * @param {string} request.orderBy * Expression that defines what fields and order to use for sorting. The * string value should follow SQL syntax: comma separated list of fields. For @@ -4082,13 +4148,19 @@ export class SecurityCenterClient { * * Usage: This should be milliseconds since epoch or an RFC3339 string. * Examples: - * "event_time = \"2019-06-10T16:07:18-07:00\"" - * "event_time = 1560208038000" + * `event_time = "2019-06-10T16:07:18-07:00"` + * `event_time = 1560208038000` * * security_marks.marks: `=`, `:` * source_properties: `=`, `:`, `>`, `<`, `>=`, `<=` * * For example, `source_properties.size = 100` is a valid filter string. + * + * Use a partial match on the empty string to filter based on a property + * existing: `source_properties.my_property : ""` + * + * Use a negated partial match on the empty string to filter based on a + * property not existing: `-source_properties.my_property : ""` * @param {string} request.orderBy * Expression that defines what fields and order to use for sorting. The * string value should follow SQL syntax: comma separated list of fields. For diff --git a/packages/google-cloud-securitycenter/src/v1/security_center_proto_list.json b/packages/google-cloud-securitycenter/src/v1/security_center_proto_list.json index 68e68f8751a..7c75af0ed9d 100644 --- a/packages/google-cloud-securitycenter/src/v1/security_center_proto_list.json +++ b/packages/google-cloud-securitycenter/src/v1/security_center_proto_list.json @@ -4,6 +4,7 @@ "../../protos/google/cloud/securitycenter/v1/notification_config.proto", "../../protos/google/cloud/securitycenter/v1/notification_message.proto", "../../protos/google/cloud/securitycenter/v1/organization_settings.proto", + "../../protos/google/cloud/securitycenter/v1/resource.proto", "../../protos/google/cloud/securitycenter/v1/run_asset_discovery_response.proto", "../../protos/google/cloud/securitycenter/v1/security_marks.proto", "../../protos/google/cloud/securitycenter/v1/securitycenter_service.proto", diff --git a/packages/google-cloud-securitycenter/src/v1p1beta1/security_center_client.ts b/packages/google-cloud-securitycenter/src/v1p1beta1/security_center_client.ts index 6998c02b1bf..6f60e7f0fe2 100644 --- a/packages/google-cloud-securitycenter/src/v1p1beta1/security_center_client.ts +++ b/packages/google-cloud-securitycenter/src/v1p1beta1/security_center_client.ts @@ -1495,7 +1495,6 @@ export class SecurityCenterClient { > ): void; /** - * * Creates or updates a finding. The corresponding source must exist for a * finding creation to succeed. * @@ -2190,15 +2189,15 @@ export class SecurityCenterClient { * * Usage: This should be milliseconds since epoch or an RFC3339 string. * Examples: - * "update_time = \"2019-06-10T16:07:18-07:00\"" - * "update_time = 1560208038000" + * `update_time = "2019-06-10T16:07:18-07:00"` + * `update_time = 1560208038000` * * * create_time: `=`, `>`, `<`, `>=`, `<=` * * Usage: This should be milliseconds since epoch or an RFC3339 string. * Examples: - * "create_time = \"2019-06-10T16:07:18-07:00\"" - * "create_time = 1560208038000" + * `create_time = "2019-06-10T16:07:18-07:00"` + * `create_time = 1560208038000` * * * iam_policy.policy_blob: `=`, `:` * * resource_properties: `=`, `:`, `>`, `<`, `>=`, `<=` @@ -2213,6 +2212,12 @@ export class SecurityCenterClient { * * security_center_properties.resource_owners: `=`, `:` * * For example, `resource_properties.size = 100` is a valid filter string. + * + * Use a partial match on the empty string to filter based on a property + * existing: `resource_properties.my_property : ""` + * + * Use a negated partial match on the empty string to filter based on a + * property not existing: `-resource_properties.my_property : ""` * @param {string} request.groupBy * Required. Expression that defines what assets fields to use for grouping. * The string value should follow SQL syntax: comma separated list of fields. @@ -2265,10 +2270,6 @@ export class SecurityCenterClient { * to assets existing at the supplied time and their values are those at that * specific time. Absence of this field will default to the API's version of * NOW. - * @param {string} request.having - * Filter that specifies what fields to further filter on *after* the query - * filter has been executed. Currently only `state_change` is supported and - * requires compare_duration to be specified. * @param {string} request.pageToken * The value returned by the last `GroupAssetsResponse`; indicates * that this is a continuation of a prior `GroupAssets` call, and that the @@ -2391,15 +2392,15 @@ export class SecurityCenterClient { * * Usage: This should be milliseconds since epoch or an RFC3339 string. * Examples: - * "update_time = \"2019-06-10T16:07:18-07:00\"" - * "update_time = 1560208038000" + * `update_time = "2019-06-10T16:07:18-07:00"` + * `update_time = 1560208038000` * * * create_time: `=`, `>`, `<`, `>=`, `<=` * * Usage: This should be milliseconds since epoch or an RFC3339 string. * Examples: - * "create_time = \"2019-06-10T16:07:18-07:00\"" - * "create_time = 1560208038000" + * `create_time = "2019-06-10T16:07:18-07:00"` + * `create_time = 1560208038000` * * * iam_policy.policy_blob: `=`, `:` * * resource_properties: `=`, `:`, `>`, `<`, `>=`, `<=` @@ -2414,6 +2415,12 @@ export class SecurityCenterClient { * * security_center_properties.resource_owners: `=`, `:` * * For example, `resource_properties.size = 100` is a valid filter string. + * + * Use a partial match on the empty string to filter based on a property + * existing: `resource_properties.my_property : ""` + * + * Use a negated partial match on the empty string to filter based on a + * property not existing: `-resource_properties.my_property : ""` * @param {string} request.groupBy * Required. Expression that defines what assets fields to use for grouping. * The string value should follow SQL syntax: comma separated list of fields. @@ -2466,10 +2473,6 @@ export class SecurityCenterClient { * to assets existing at the supplied time and their values are those at that * specific time. Absence of this field will default to the API's version of * NOW. - * @param {string} request.having - * Filter that specifies what fields to further filter on *after* the query - * filter has been executed. Currently only `state_change` is supported and - * requires compare_duration to be specified. * @param {string} request.pageToken * The value returned by the last `GroupAssetsResponse`; indicates * that this is a continuation of a prior `GroupAssets` call, and that the @@ -2548,15 +2551,15 @@ export class SecurityCenterClient { * * Usage: This should be milliseconds since epoch or an RFC3339 string. * Examples: - * "update_time = \"2019-06-10T16:07:18-07:00\"" - * "update_time = 1560208038000" + * `update_time = "2019-06-10T16:07:18-07:00"` + * `update_time = 1560208038000` * * * create_time: `=`, `>`, `<`, `>=`, `<=` * * Usage: This should be milliseconds since epoch or an RFC3339 string. * Examples: - * "create_time = \"2019-06-10T16:07:18-07:00\"" - * "create_time = 1560208038000" + * `create_time = "2019-06-10T16:07:18-07:00"` + * `create_time = 1560208038000` * * * iam_policy.policy_blob: `=`, `:` * * resource_properties: `=`, `:`, `>`, `<`, `>=`, `<=` @@ -2571,6 +2574,12 @@ export class SecurityCenterClient { * * security_center_properties.resource_owners: `=`, `:` * * For example, `resource_properties.size = 100` is a valid filter string. + * + * Use a partial match on the empty string to filter based on a property + * existing: `resource_properties.my_property : ""` + * + * Use a negated partial match on the empty string to filter based on a + * property not existing: `-resource_properties.my_property : ""` * @param {string} request.groupBy * Required. Expression that defines what assets fields to use for grouping. * The string value should follow SQL syntax: comma separated list of fields. @@ -2623,10 +2632,6 @@ export class SecurityCenterClient { * to assets existing at the supplied time and their values are those at that * specific time. Absence of this field will default to the API's version of * NOW. - * @param {string} request.having - * Filter that specifies what fields to further filter on *after* the query - * filter has been executed. Currently only `state_change` is supported and - * requires compare_duration to be specified. * @param {string} request.pageToken * The value returned by the last `GroupAssetsResponse`; indicates * that this is a continuation of a prior `GroupAssets` call, and that the @@ -2745,13 +2750,19 @@ export class SecurityCenterClient { * * Usage: This should be milliseconds since epoch or an RFC3339 string. * Examples: - * "event_time = \"2019-06-10T16:07:18-07:00\"" - * "event_time = 1560208038000" + * `event_time = "2019-06-10T16:07:18-07:00"` + * `event_time = 1560208038000` * * * security_marks.marks: `=`, `:` * * source_properties: `=`, `:`, `>`, `<`, `>=`, `<=` * * For example, `source_properties.size = 100` is a valid filter string. + * + * Use a partial match on the empty string to filter based on a property + * existing: `source_properties.my_property : ""` + * + * Use a negated partial match on the empty string to filter based on a + * property not existing: `-source_properties.my_property : ""` * @param {string} request.groupBy * Required. Expression that defines what assets fields to use for grouping * (including `state_change`). The string value should follow SQL syntax: @@ -2786,12 +2797,18 @@ export class SecurityCenterClient { * * Possible "state_change" values when compare_duration is specified: * - * * "CHANGED": indicates that the finding was present at the start of - * compare_duration, but changed its state at read_time. - * * "UNCHANGED": indicates that the finding was present at the start of - * compare_duration and did not change state at read_time. - * * "ADDED": indicates that the finding was not present at the start - * of compare_duration, but was present at read_time. + * * "CHANGED": indicates that the finding was present and matched the given + * filter at the start of compare_duration, but changed its + * state at read_time. + * * "UNCHANGED": indicates that the finding was present and matched the given + * filter at the start of compare_duration and did not change + * state at read_time. + * * "ADDED": indicates that the finding did not match the given filter or + * was not present at the start of compare_duration, but was + * present at read_time. + * * "REMOVED": indicates that the finding was present and matched the + * filter at the start of compare_duration, but did not match + * the filter at read_time. * * If compare_duration is not specified, then the only possible state_change * is "UNUSED", which will be the state_change set for all findings present @@ -2799,10 +2816,6 @@ export class SecurityCenterClient { * * If this field is set then `state_change` must be a specified field in * `group_by`. - * @param {string} request.having - * Filter that specifies what fields to further filter on *after* the query - * filter has been executed. Currently only `finding.state` and `state_change` - * are supported and requires compare_duration to be specified. * @param {string} request.pageToken * The value returned by the last `GroupFindingsResponse`; indicates * that this is a continuation of a prior `GroupFindings` call, and @@ -2930,13 +2943,19 @@ export class SecurityCenterClient { * * Usage: This should be milliseconds since epoch or an RFC3339 string. * Examples: - * "event_time = \"2019-06-10T16:07:18-07:00\"" - * "event_time = 1560208038000" + * `event_time = "2019-06-10T16:07:18-07:00"` + * `event_time = 1560208038000` * * * security_marks.marks: `=`, `:` * * source_properties: `=`, `:`, `>`, `<`, `>=`, `<=` * * For example, `source_properties.size = 100` is a valid filter string. + * + * Use a partial match on the empty string to filter based on a property + * existing: `source_properties.my_property : ""` + * + * Use a negated partial match on the empty string to filter based on a + * property not existing: `-source_properties.my_property : ""` * @param {string} request.groupBy * Required. Expression that defines what assets fields to use for grouping * (including `state_change`). The string value should follow SQL syntax: @@ -2971,12 +2990,18 @@ export class SecurityCenterClient { * * Possible "state_change" values when compare_duration is specified: * - * * "CHANGED": indicates that the finding was present at the start of - * compare_duration, but changed its state at read_time. - * * "UNCHANGED": indicates that the finding was present at the start of - * compare_duration and did not change state at read_time. - * * "ADDED": indicates that the finding was not present at the start - * of compare_duration, but was present at read_time. + * * "CHANGED": indicates that the finding was present and matched the given + * filter at the start of compare_duration, but changed its + * state at read_time. + * * "UNCHANGED": indicates that the finding was present and matched the given + * filter at the start of compare_duration and did not change + * state at read_time. + * * "ADDED": indicates that the finding did not match the given filter or + * was not present at the start of compare_duration, but was + * present at read_time. + * * "REMOVED": indicates that the finding was present and matched the + * filter at the start of compare_duration, but did not match + * the filter at read_time. * * If compare_duration is not specified, then the only possible state_change * is "UNUSED", which will be the state_change set for all findings present @@ -2984,10 +3009,6 @@ export class SecurityCenterClient { * * If this field is set then `state_change` must be a specified field in * `group_by`. - * @param {string} request.having - * Filter that specifies what fields to further filter on *after* the query - * filter has been executed. Currently only `finding.state` and `state_change` - * are supported and requires compare_duration to be specified. * @param {string} request.pageToken * The value returned by the last `GroupFindingsResponse`; indicates * that this is a continuation of a prior `GroupFindings` call, and @@ -3071,13 +3092,19 @@ export class SecurityCenterClient { * * Usage: This should be milliseconds since epoch or an RFC3339 string. * Examples: - * "event_time = \"2019-06-10T16:07:18-07:00\"" - * "event_time = 1560208038000" + * `event_time = "2019-06-10T16:07:18-07:00"` + * `event_time = 1560208038000` * * * security_marks.marks: `=`, `:` * * source_properties: `=`, `:`, `>`, `<`, `>=`, `<=` * * For example, `source_properties.size = 100` is a valid filter string. + * + * Use a partial match on the empty string to filter based on a property + * existing: `source_properties.my_property : ""` + * + * Use a negated partial match on the empty string to filter based on a + * property not existing: `-source_properties.my_property : ""` * @param {string} request.groupBy * Required. Expression that defines what assets fields to use for grouping * (including `state_change`). The string value should follow SQL syntax: @@ -3112,12 +3139,18 @@ export class SecurityCenterClient { * * Possible "state_change" values when compare_duration is specified: * - * * "CHANGED": indicates that the finding was present at the start of - * compare_duration, but changed its state at read_time. - * * "UNCHANGED": indicates that the finding was present at the start of - * compare_duration and did not change state at read_time. - * * "ADDED": indicates that the finding was not present at the start - * of compare_duration, but was present at read_time. + * * "CHANGED": indicates that the finding was present and matched the given + * filter at the start of compare_duration, but changed its + * state at read_time. + * * "UNCHANGED": indicates that the finding was present and matched the given + * filter at the start of compare_duration and did not change + * state at read_time. + * * "ADDED": indicates that the finding did not match the given filter or + * was not present at the start of compare_duration, but was + * present at read_time. + * * "REMOVED": indicates that the finding was present and matched the + * filter at the start of compare_duration, but did not match + * the filter at read_time. * * If compare_duration is not specified, then the only possible state_change * is "UNUSED", which will be the state_change set for all findings present @@ -3125,10 +3158,6 @@ export class SecurityCenterClient { * * If this field is set then `state_change` must be a specified field in * `group_by`. - * @param {string} request.having - * Filter that specifies what fields to further filter on *after* the query - * filter has been executed. Currently only `finding.state` and `state_change` - * are supported and requires compare_duration to be specified. * @param {string} request.pageToken * The value returned by the last `GroupFindingsResponse`; indicates * that this is a continuation of a prior `GroupFindings` call, and @@ -3238,15 +3267,15 @@ export class SecurityCenterClient { * * Usage: This should be milliseconds since epoch or an RFC3339 string. * Examples: - * "update_time = \"2019-06-10T16:07:18-07:00\"" - * "update_time = 1560208038000" + * `update_time = "2019-06-10T16:07:18-07:00"` + * `update_time = 1560208038000` * * * create_time: `=`, `>`, `<`, `>=`, `<=` * * Usage: This should be milliseconds since epoch or an RFC3339 string. * Examples: - * "create_time = \"2019-06-10T16:07:18-07:00\"" - * "create_time = 1560208038000" + * `create_time = "2019-06-10T16:07:18-07:00"` + * `create_time = 1560208038000` * * * iam_policy.policy_blob: `=`, `:` * * resource_properties: `=`, `:`, `>`, `<`, `>=`, `<=` @@ -3261,6 +3290,12 @@ export class SecurityCenterClient { * * security_center_properties.resource_owners: `=`, `:` * * For example, `resource_properties.size = 100` is a valid filter string. + * + * Use a partial match on the empty string to filter based on a property + * existing: `resource_properties.my_property : ""` + * + * Use a negated partial match on the empty string to filter based on a + * property not existing: `-resource_properties.my_property : ""` * @param {string} request.orderBy * Expression that defines what fields and order to use for sorting. The * string value should follow SQL syntax: comma separated list of fields. For @@ -3313,10 +3348,6 @@ export class SecurityCenterClient { * If compare_duration is not specified, then the only possible state_change * is "UNUSED", which will be the state_change set for all assets present at * read_time. - * @param {string} request.having - * Filter that specifies what fields to further filter on *after* the query - * filter has been executed. Currently only `state_change` is supported and - * requires compare_duration to be specified. * @param {google.protobuf.FieldMask} [request.fieldMask] * Optional. * A field mask to specify the ListAssetsResult fields to be listed in the @@ -3444,15 +3475,15 @@ export class SecurityCenterClient { * * Usage: This should be milliseconds since epoch or an RFC3339 string. * Examples: - * "update_time = \"2019-06-10T16:07:18-07:00\"" - * "update_time = 1560208038000" + * `update_time = "2019-06-10T16:07:18-07:00"` + * `update_time = 1560208038000` * * * create_time: `=`, `>`, `<`, `>=`, `<=` * * Usage: This should be milliseconds since epoch or an RFC3339 string. * Examples: - * "create_time = \"2019-06-10T16:07:18-07:00\"" - * "create_time = 1560208038000" + * `create_time = "2019-06-10T16:07:18-07:00"` + * `create_time = 1560208038000` * * * iam_policy.policy_blob: `=`, `:` * * resource_properties: `=`, `:`, `>`, `<`, `>=`, `<=` @@ -3467,6 +3498,12 @@ export class SecurityCenterClient { * * security_center_properties.resource_owners: `=`, `:` * * For example, `resource_properties.size = 100` is a valid filter string. + * + * Use a partial match on the empty string to filter based on a property + * existing: `resource_properties.my_property : ""` + * + * Use a negated partial match on the empty string to filter based on a + * property not existing: `-resource_properties.my_property : ""` * @param {string} request.orderBy * Expression that defines what fields and order to use for sorting. The * string value should follow SQL syntax: comma separated list of fields. For @@ -3519,10 +3556,6 @@ export class SecurityCenterClient { * If compare_duration is not specified, then the only possible state_change * is "UNUSED", which will be the state_change set for all assets present at * read_time. - * @param {string} request.having - * Filter that specifies what fields to further filter on *after* the query - * filter has been executed. Currently only `state_change` is supported and - * requires compare_duration to be specified. * @param {google.protobuf.FieldMask} [request.fieldMask] * Optional. * A field mask to specify the ListAssetsResult fields to be listed in the @@ -3606,15 +3639,15 @@ export class SecurityCenterClient { * * Usage: This should be milliseconds since epoch or an RFC3339 string. * Examples: - * "update_time = \"2019-06-10T16:07:18-07:00\"" - * "update_time = 1560208038000" + * `update_time = "2019-06-10T16:07:18-07:00"` + * `update_time = 1560208038000` * * * create_time: `=`, `>`, `<`, `>=`, `<=` * * Usage: This should be milliseconds since epoch or an RFC3339 string. * Examples: - * "create_time = \"2019-06-10T16:07:18-07:00\"" - * "create_time = 1560208038000" + * `create_time = "2019-06-10T16:07:18-07:00"` + * `create_time = 1560208038000` * * * iam_policy.policy_blob: `=`, `:` * * resource_properties: `=`, `:`, `>`, `<`, `>=`, `<=` @@ -3629,6 +3662,12 @@ export class SecurityCenterClient { * * security_center_properties.resource_owners: `=`, `:` * * For example, `resource_properties.size = 100` is a valid filter string. + * + * Use a partial match on the empty string to filter based on a property + * existing: `resource_properties.my_property : ""` + * + * Use a negated partial match on the empty string to filter based on a + * property not existing: `-resource_properties.my_property : ""` * @param {string} request.orderBy * Expression that defines what fields and order to use for sorting. The * string value should follow SQL syntax: comma separated list of fields. For @@ -3681,10 +3720,6 @@ export class SecurityCenterClient { * If compare_duration is not specified, then the only possible state_change * is "UNUSED", which will be the state_change set for all assets present at * read_time. - * @param {string} request.having - * Filter that specifies what fields to further filter on *after* the query - * filter has been executed. Currently only `state_change` is supported and - * requires compare_duration to be specified. * @param {google.protobuf.FieldMask} [request.fieldMask] * Optional. * A field mask to specify the ListAssetsResult fields to be listed in the @@ -3809,13 +3844,19 @@ export class SecurityCenterClient { * * Usage: This should be milliseconds since epoch or an RFC3339 string. * Examples: - * "event_time = \"2019-06-10T16:07:18-07:00\"" - * "event_time = 1560208038000" + * `event_time = "2019-06-10T16:07:18-07:00"` + * `event_time = 1560208038000` * * security_marks.marks: `=`, `:` * source_properties: `=`, `:`, `>`, `<`, `>=`, `<=` * * For example, `source_properties.size = 100` is a valid filter string. + * + * Use a partial match on the empty string to filter based on a property + * existing: `source_properties.my_property : ""` + * + * Use a negated partial match on the empty string to filter based on a + * property not existing: `-source_properties.my_property : ""` * @param {string} request.orderBy * Expression that defines what fields and order to use for sorting. The * string value should follow SQL syntax: comma separated list of fields. For @@ -3855,20 +3896,22 @@ export class SecurityCenterClient { * * Possible "state_change" values when compare_duration is specified: * - * * "CHANGED": indicates that the finding was present at the start of - * compare_duration, but changed its state at read_time. - * * "UNCHANGED": indicates that the finding was present at the start of - * compare_duration and did not change state at read_time. - * * "ADDED": indicates that the finding was not present at the start - * of compare_duration, but was present at read_time. + * * "CHANGED": indicates that the finding was present and matched the given + * filter at the start of compare_duration, but changed its + * state at read_time. + * * "UNCHANGED": indicates that the finding was present and matched the given + * filter at the start of compare_duration and did not change + * state at read_time. + * * "ADDED": indicates that the finding did not match the given filter or + * was not present at the start of compare_duration, but was + * present at read_time. + * * "REMOVED": indicates that the finding was present and matched the + * filter at the start of compare_duration, but did not match + * the filter at read_time. * * If compare_duration is not specified, then the only possible state_change * is "UNUSED", which will be the state_change set for all findings present at * read_time. - * @param {string} request.having - * Filter that specifies what fields to further filter on *after* the query - * filter has been executed. Currently only `finding.state` and `state_change` - * are supported and requires compare_duration to be specified. * @param {google.protobuf.FieldMask} [request.fieldMask] * Optional. * A field mask to specify the Finding fields to be listed in the response. @@ -4000,13 +4043,19 @@ export class SecurityCenterClient { * * Usage: This should be milliseconds since epoch or an RFC3339 string. * Examples: - * "event_time = \"2019-06-10T16:07:18-07:00\"" - * "event_time = 1560208038000" + * `event_time = "2019-06-10T16:07:18-07:00"` + * `event_time = 1560208038000` * * security_marks.marks: `=`, `:` * source_properties: `=`, `:`, `>`, `<`, `>=`, `<=` * * For example, `source_properties.size = 100` is a valid filter string. + * + * Use a partial match on the empty string to filter based on a property + * existing: `source_properties.my_property : ""` + * + * Use a negated partial match on the empty string to filter based on a + * property not existing: `-source_properties.my_property : ""` * @param {string} request.orderBy * Expression that defines what fields and order to use for sorting. The * string value should follow SQL syntax: comma separated list of fields. For @@ -4046,20 +4095,22 @@ export class SecurityCenterClient { * * Possible "state_change" values when compare_duration is specified: * - * * "CHANGED": indicates that the finding was present at the start of - * compare_duration, but changed its state at read_time. - * * "UNCHANGED": indicates that the finding was present at the start of - * compare_duration and did not change state at read_time. - * * "ADDED": indicates that the finding was not present at the start - * of compare_duration, but was present at read_time. + * * "CHANGED": indicates that the finding was present and matched the given + * filter at the start of compare_duration, but changed its + * state at read_time. + * * "UNCHANGED": indicates that the finding was present and matched the given + * filter at the start of compare_duration and did not change + * state at read_time. + * * "ADDED": indicates that the finding did not match the given filter or + * was not present at the start of compare_duration, but was + * present at read_time. + * * "REMOVED": indicates that the finding was present and matched the + * filter at the start of compare_duration, but did not match + * the filter at read_time. * * If compare_duration is not specified, then the only possible state_change * is "UNUSED", which will be the state_change set for all findings present at * read_time. - * @param {string} request.having - * Filter that specifies what fields to further filter on *after* the query - * filter has been executed. Currently only `finding.state` and `state_change` - * are supported and requires compare_duration to be specified. * @param {google.protobuf.FieldMask} [request.fieldMask] * Optional. * A field mask to specify the Finding fields to be listed in the response. @@ -4147,13 +4198,19 @@ export class SecurityCenterClient { * * Usage: This should be milliseconds since epoch or an RFC3339 string. * Examples: - * "event_time = \"2019-06-10T16:07:18-07:00\"" - * "event_time = 1560208038000" + * `event_time = "2019-06-10T16:07:18-07:00"` + * `event_time = 1560208038000` * * security_marks.marks: `=`, `:` * source_properties: `=`, `:`, `>`, `<`, `>=`, `<=` * * For example, `source_properties.size = 100` is a valid filter string. + * + * Use a partial match on the empty string to filter based on a property + * existing: `source_properties.my_property : ""` + * + * Use a negated partial match on the empty string to filter based on a + * property not existing: `-source_properties.my_property : ""` * @param {string} request.orderBy * Expression that defines what fields and order to use for sorting. The * string value should follow SQL syntax: comma separated list of fields. For @@ -4193,20 +4250,22 @@ export class SecurityCenterClient { * * Possible "state_change" values when compare_duration is specified: * - * * "CHANGED": indicates that the finding was present at the start of - * compare_duration, but changed its state at read_time. - * * "UNCHANGED": indicates that the finding was present at the start of - * compare_duration and did not change state at read_time. - * * "ADDED": indicates that the finding was not present at the start - * of compare_duration, but was present at read_time. + * * "CHANGED": indicates that the finding was present and matched the given + * filter at the start of compare_duration, but changed its + * state at read_time. + * * "UNCHANGED": indicates that the finding was present and matched the given + * filter at the start of compare_duration and did not change + * state at read_time. + * * "ADDED": indicates that the finding did not match the given filter or + * was not present at the start of compare_duration, but was + * present at read_time. + * * "REMOVED": indicates that the finding was present and matched the + * filter at the start of compare_duration, but did not match + * the filter at read_time. * * If compare_duration is not specified, then the only possible state_change * is "UNUSED", which will be the state_change set for all findings present at * read_time. - * @param {string} request.having - * Filter that specifies what fields to further filter on *after* the query - * filter has been executed. Currently only `finding.state` and `state_change` - * are supported and requires compare_duration to be specified. * @param {google.protobuf.FieldMask} [request.fieldMask] * Optional. * A field mask to specify the Finding fields to be listed in the response. diff --git a/packages/google-cloud-securitycenter/src/v1p1beta1/security_center_client_config.json b/packages/google-cloud-securitycenter/src/v1p1beta1/security_center_client_config.json index e7f4077497a..3d47939eb43 100644 --- a/packages/google-cloud-securitycenter/src/v1p1beta1/security_center_client_config.json +++ b/packages/google-cloud-securitycenter/src/v1p1beta1/security_center_client_config.json @@ -21,117 +21,117 @@ }, "methods": { "CreateSource": { - "timeout_millis": 60000, + "timeout_millis": 600000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, "CreateFinding": { - "timeout_millis": 60000, + "timeout_millis": 600000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, "CreateNotificationConfig": { - "timeout_millis": 60000, + "timeout_millis": 600000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, "DeleteNotificationConfig": { - "timeout_millis": 60000, + "timeout_millis": 600000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, "GetIamPolicy": { - "timeout_millis": 60000, + "timeout_millis": 600000, "retry_codes_name": "idempotent", "retry_params_name": "default" }, "GetNotificationConfig": { - "timeout_millis": 60000, + "timeout_millis": 600000, "retry_codes_name": "idempotent", "retry_params_name": "default" }, "GetOrganizationSettings": { - "timeout_millis": 60000, + "timeout_millis": 600000, "retry_codes_name": "idempotent", "retry_params_name": "default" }, "GetSource": { - "timeout_millis": 60000, + "timeout_millis": 600000, "retry_codes_name": "idempotent", "retry_params_name": "default" }, "GroupAssets": { - "timeout_millis": 60000, + "timeout_millis": 600000, "retry_codes_name": "idempotent", "retry_params_name": "default" }, "GroupFindings": { - "timeout_millis": 60000, + "timeout_millis": 600000, "retry_codes_name": "idempotent", "retry_params_name": "default" }, "ListAssets": { - "timeout_millis": 60000, + "timeout_millis": 600000, "retry_codes_name": "idempotent", "retry_params_name": "default" }, "ListFindings": { - "timeout_millis": 60000, + "timeout_millis": 600000, "retry_codes_name": "idempotent", "retry_params_name": "default" }, "ListNotificationConfigs": { - "timeout_millis": 60000, + "timeout_millis": 600000, "retry_codes_name": "idempotent", "retry_params_name": "default" }, "ListSources": { - "timeout_millis": 60000, + "timeout_millis": 600000, "retry_codes_name": "idempotent", "retry_params_name": "default" }, "RunAssetDiscovery": { - "timeout_millis": 60000, + "timeout_millis": 600000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, "SetFindingState": { - "timeout_millis": 60000, + "timeout_millis": 600000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, "SetIamPolicy": { - "timeout_millis": 60000, + "timeout_millis": 600000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, "TestIamPermissions": { - "timeout_millis": 60000, + "timeout_millis": 600000, "retry_codes_name": "idempotent", "retry_params_name": "default" }, "UpdateFinding": { - "timeout_millis": 60000, + "timeout_millis": 600000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, "UpdateNotificationConfig": { - "timeout_millis": 60000, + "timeout_millis": 600000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, "UpdateOrganizationSettings": { - "timeout_millis": 60000, + "timeout_millis": 600000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, "UpdateSource": { - "timeout_millis": 60000, + "timeout_millis": 600000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, "UpdateSecurityMarks": { - "timeout_millis": 60000, + "timeout_millis": 600000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" } diff --git a/packages/google-cloud-securitycenter/src/v1p1beta1/security_center_proto_list.json b/packages/google-cloud-securitycenter/src/v1p1beta1/security_center_proto_list.json index 37f5aab1515..cfa18ff75d7 100644 --- a/packages/google-cloud-securitycenter/src/v1p1beta1/security_center_proto_list.json +++ b/packages/google-cloud-securitycenter/src/v1p1beta1/security_center_proto_list.json @@ -4,6 +4,7 @@ "../../protos/google/cloud/securitycenter/v1p1beta1/notification_config.proto", "../../protos/google/cloud/securitycenter/v1p1beta1/notification_message.proto", "../../protos/google/cloud/securitycenter/v1p1beta1/organization_settings.proto", + "../../protos/google/cloud/securitycenter/v1p1beta1/resource.proto", "../../protos/google/cloud/securitycenter/v1p1beta1/run_asset_discovery_response.proto", "../../protos/google/cloud/securitycenter/v1p1beta1/security_marks.proto", "../../protos/google/cloud/securitycenter/v1p1beta1/securitycenter_service.proto", diff --git a/packages/google-cloud-securitycenter/synth.metadata b/packages/google-cloud-securitycenter/synth.metadata index 9e472db0113..04888b5bbeb 100644 --- a/packages/google-cloud-securitycenter/synth.metadata +++ b/packages/google-cloud-securitycenter/synth.metadata @@ -4,15 +4,15 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-security-center.git", - "sha": "41bd2a92dbed2041ef5d5def1b3ce0c22b670b12" + "sha": "f71426053da4eb2416ebd593862e89c0d5557827" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "839fae42335ee1bb1e70767f3e6c51738683892b", - "internalRef": "310213770" + "sha": "b789f790565ad7cc473571b0cf35dfbe6707f6a8", + "internalRef": "315933871" } }, { From 91bc91bcd88ba3c049d96bffb43cee0a10f29637 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 16 Jun 2020 09:01:11 -0700 Subject: [PATCH 185/342] chore: release 5.0.0 (#287) * updated CHANGELOG.md [ci skip] * updated package.json [ci skip] * updated samples/package.json Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- .../google-cloud-securitycenter/CHANGELOG.md | 16 ++++++++++++++++ .../google-cloud-securitycenter/package.json | 2 +- .../samples/package.json | 2 +- 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-securitycenter/CHANGELOG.md b/packages/google-cloud-securitycenter/CHANGELOG.md index 9f7baa8668a..6239226f4a0 100644 --- a/packages/google-cloud-securitycenter/CHANGELOG.md +++ b/packages/google-cloud-securitycenter/CHANGELOG.md @@ -4,6 +4,22 @@ [1]: https://www.npmjs.com/package/@google-cloud/security-center?activeTab=versions +## [5.0.0](https://www.github.com/googleapis/nodejs-security-center/compare/v4.0.0...v5.0.0) (2020-06-15) + + +### ⚠ BREAKING CHANGES + +* Removed 'having' as a field in the List and Group Finding and Asset requests. + +### Features + +* add Resource to the v1 NotificationMessage, update protos ([#286](https://www.github.com/googleapis/nodejs-security-center/issues/286)) ([f810e5e](https://www.github.com/googleapis/nodejs-security-center/commit/f810e5e9f0791050616273f06bebc3ea05617e7f)) + + +### Bug Fixes + +* handle fallback option properly ([#284](https://www.github.com/googleapis/nodejs-security-center/issues/284)) ([f714260](https://www.github.com/googleapis/nodejs-security-center/commit/f71426053da4eb2416ebd593862e89c0d5557827)) + ## [4.0.0](https://www.github.com/googleapis/nodejs-security-center/compare/v3.1.0...v4.0.0) (2020-06-04) diff --git a/packages/google-cloud-securitycenter/package.json b/packages/google-cloud-securitycenter/package.json index d33e22f9e87..09aa016e91b 100644 --- a/packages/google-cloud-securitycenter/package.json +++ b/packages/google-cloud-securitycenter/package.json @@ -1,7 +1,7 @@ { "name": "@google-cloud/security-center", "description": "Cloud Security Command Center API client for Node.js", - "version": "4.0.0", + "version": "5.0.0", "license": "Apache-2.0", "author": "Google LLC", "engines": { diff --git a/packages/google-cloud-securitycenter/samples/package.json b/packages/google-cloud-securitycenter/samples/package.json index 078117a66f2..4eb3f6d34ab 100644 --- a/packages/google-cloud-securitycenter/samples/package.json +++ b/packages/google-cloud-securitycenter/samples/package.json @@ -14,7 +14,7 @@ "license": "Apache-2.0", "dependencies": { "@google-cloud/pubsub": "^2.0.0", - "@google-cloud/security-center": "^4.0.0" + "@google-cloud/security-center": "^5.0.0" }, "devDependencies": { "chai": "^4.2.0", From e7d3ca852ef06cb1558fdb2428bb74eddd5a4493 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Thu, 18 Jun 2020 07:58:05 -0700 Subject: [PATCH 186/342] docs: Specify allowed fields for UpdateNotificationConfig (#289) PiperOrigin-RevId: 316714521 Source-Author: Google APIs Source-Date: Tue Jun 16 10:55:41 2020 -0700 Source-Repo: googleapis/googleapis Source-Sha: 714a5f10f22d932bf4365dfdd57ced2c819e0ade Source-Link: https://github.com/googleapis/googleapis/commit/714a5f10f22d932bf4365dfdd57ced2c819e0ade --- .../cloud/securitycenter/v1/securitycenter_service.proto | 4 ++-- .../securitycenter/v1p1beta1/securitycenter_service.proto | 3 ++- .../src/v1/security_center_client.ts | 4 ++-- .../src/v1p1beta1/security_center_client.ts | 3 ++- packages/google-cloud-securitycenter/synth.metadata | 6 +++--- 5 files changed, 11 insertions(+), 9 deletions(-) diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/securitycenter_service.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/securitycenter_service.proto index 9a88e1e85bd..b660d4674fc 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/securitycenter_service.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/securitycenter_service.proto @@ -240,8 +240,8 @@ service SecurityCenter { option (google.api.method_signature) = "finding"; } - // - // Updates a notification config. + // Updates a notification config. The following update + // fields are allowed: description, pubsub_topic, streaming_config.filter rpc UpdateNotificationConfig(UpdateNotificationConfigRequest) returns (NotificationConfig) { option (google.api.http) = { diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/securitycenter_service.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/securitycenter_service.proto index 7431515bfb8..c4264a6a21d 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/securitycenter_service.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/securitycenter_service.proto @@ -246,7 +246,8 @@ service SecurityCenter { option (google.api.method_signature) = "finding,update_mask"; } - // Updates a notification config. + // Updates a notification config. The following update + // fields are allowed: description, pubsub_topic, streaming_config.filter rpc UpdateNotificationConfig(UpdateNotificationConfigRequest) returns (NotificationConfig) { option (google.api.http) = { diff --git a/packages/google-cloud-securitycenter/src/v1/security_center_client.ts b/packages/google-cloud-securitycenter/src/v1/security_center_client.ts index 72b5f783636..18feeeffa43 100644 --- a/packages/google-cloud-securitycenter/src/v1/security_center_client.ts +++ b/packages/google-cloud-securitycenter/src/v1/security_center_client.ts @@ -1570,8 +1570,8 @@ export class SecurityCenterClient { > ): void; /** - * - * Updates a notification config. + * Updates a notification config. The following update + * fields are allowed: description, pubsub_topic, streaming_config.filter * * @param {Object} request * The request object that will be sent. diff --git a/packages/google-cloud-securitycenter/src/v1p1beta1/security_center_client.ts b/packages/google-cloud-securitycenter/src/v1p1beta1/security_center_client.ts index 6f60e7f0fe2..2e8e7b42e14 100644 --- a/packages/google-cloud-securitycenter/src/v1p1beta1/security_center_client.ts +++ b/packages/google-cloud-securitycenter/src/v1p1beta1/security_center_client.ts @@ -1603,7 +1603,8 @@ export class SecurityCenterClient { > ): void; /** - * Updates a notification config. + * Updates a notification config. The following update + * fields are allowed: description, pubsub_topic, streaming_config.filter * * @param {Object} request * The request object that will be sent. diff --git a/packages/google-cloud-securitycenter/synth.metadata b/packages/google-cloud-securitycenter/synth.metadata index 04888b5bbeb..a80e1a00f24 100644 --- a/packages/google-cloud-securitycenter/synth.metadata +++ b/packages/google-cloud-securitycenter/synth.metadata @@ -4,15 +4,15 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-security-center.git", - "sha": "f71426053da4eb2416ebd593862e89c0d5557827" + "sha": "b1644df15866ac91d2ea7b4cec43c835b3f9e5c8" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "b789f790565ad7cc473571b0cf35dfbe6707f6a8", - "internalRef": "315933871" + "sha": "714a5f10f22d932bf4365dfdd57ced2c819e0ade", + "internalRef": "316714521" } }, { From f2b08c71d39d992211b3d3646be1543ff460d0b7 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Thu, 18 Jun 2020 11:05:20 -0700 Subject: [PATCH 187/342] fix: update node issue template (#290) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/37f383f8-7560-459e-b66c-def10ff830cb/targets - [ ] To automatically regenerate this PR, check this box. Source-Link: https://github.com/googleapis/synthtool/commit/b10590a4a1568548dd13cfcea9aa11d40898144b --- packages/google-cloud-securitycenter/synth.metadata | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-securitycenter/synth.metadata b/packages/google-cloud-securitycenter/synth.metadata index a80e1a00f24..a6e770e8f6d 100644 --- a/packages/google-cloud-securitycenter/synth.metadata +++ b/packages/google-cloud-securitycenter/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-security-center.git", - "sha": "b1644df15866ac91d2ea7b4cec43c835b3f9e5c8" + "sha": "9f2f5d2bcce59be2bdc3e35d328e10482b2a8491" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "e7034945fbdc0e79d3c57f6e299e5c90b0f11469" + "sha": "b10590a4a1568548dd13cfcea9aa11d40898144b" } } ], From 21a054744cb2582ef50f07412b45ed71b66d174f Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Mon, 29 Jun 2020 13:24:16 -0700 Subject: [PATCH 188/342] build: add config .gitattributes (#292) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/e6ac0f7f-2fc1-4ac2-9eb5-23ba1215b6a2/targets - [ ] To automatically regenerate this PR, check this box. Source-Link: https://github.com/googleapis/synthtool/commit/dc9caca650c77b7039e2bbc3339ffb34ae78e5b7 --- packages/google-cloud-securitycenter/.gitattributes | 3 +++ packages/google-cloud-securitycenter/synth.metadata | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) create mode 100644 packages/google-cloud-securitycenter/.gitattributes diff --git a/packages/google-cloud-securitycenter/.gitattributes b/packages/google-cloud-securitycenter/.gitattributes new file mode 100644 index 00000000000..2e63216ae9c --- /dev/null +++ b/packages/google-cloud-securitycenter/.gitattributes @@ -0,0 +1,3 @@ +*.ts text eol=lf +*.js test eol=lf +protos/* linguist-generated diff --git a/packages/google-cloud-securitycenter/synth.metadata b/packages/google-cloud-securitycenter/synth.metadata index a6e770e8f6d..986ac221b2d 100644 --- a/packages/google-cloud-securitycenter/synth.metadata +++ b/packages/google-cloud-securitycenter/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-security-center.git", - "sha": "9f2f5d2bcce59be2bdc3e35d328e10482b2a8491" + "sha": "c0b8bad200f829aa62ee7430bf0d51b5463c92ca" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "b10590a4a1568548dd13cfcea9aa11d40898144b" + "sha": "dc9caca650c77b7039e2bbc3339ffb34ae78e5b7" } } ], From bccb687a63648587f83458b57ee339204c24e0da Mon Sep 17 00:00:00 2001 From: Alexander Fenster Date: Mon, 6 Jul 2020 10:17:18 -0700 Subject: [PATCH 189/342] build: use bazel build (#294) --- .../synth.metadata | 26 +++++++------------ packages/google-cloud-securitycenter/synth.py | 12 ++------- 2 files changed, 11 insertions(+), 27 deletions(-) diff --git a/packages/google-cloud-securitycenter/synth.metadata b/packages/google-cloud-securitycenter/synth.metadata index 986ac221b2d..6857c334aab 100644 --- a/packages/google-cloud-securitycenter/synth.metadata +++ b/packages/google-cloud-securitycenter/synth.metadata @@ -3,23 +3,15 @@ { "git": { "name": ".", - "remote": "https://github.com/googleapis/nodejs-security-center.git", - "sha": "c0b8bad200f829aa62ee7430bf0d51b5463c92ca" - } - }, - { - "git": { - "name": "googleapis", - "remote": "https://github.com/googleapis/googleapis.git", - "sha": "714a5f10f22d932bf4365dfdd57ced2c819e0ade", - "internalRef": "316714521" + "remote": "git@github.com:googleapis/nodejs-security-center.git", + "sha": "c772a5ad5c9ff0b897848c0ffc2f3fc774707228" } }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "dc9caca650c77b7039e2bbc3339ffb34ae78e5b7" + "sha": "303271797a360f8a439203413f13a160f2f5b3b4" } } ], @@ -29,8 +21,8 @@ "source": "googleapis", "apiName": "securitycenter", "apiVersion": "v1", - "language": "typescript", - "generator": "gapic-generator-typescript" + "language": "nodejs", + "generator": "bazel" } }, { @@ -38,8 +30,8 @@ "source": "googleapis", "apiName": "securitycenter", "apiVersion": "v1beta1", - "language": "typescript", - "generator": "gapic-generator-typescript" + "language": "nodejs", + "generator": "bazel" } }, { @@ -47,8 +39,8 @@ "source": "googleapis", "apiName": "securitycenter", "apiVersion": "v1p1beta1", - "language": "typescript", - "generator": "gapic-generator-typescript" + "language": "nodejs", + "generator": "bazel" } } ] diff --git a/packages/google-cloud-securitycenter/synth.py b/packages/google-cloud-securitycenter/synth.py index c0236f7346a..6eda4071a6b 100644 --- a/packages/google-cloud-securitycenter/synth.py +++ b/packages/google-cloud-securitycenter/synth.py @@ -23,19 +23,11 @@ # Run the gapic generator -gapic = gcp.GAPICMicrogenerator() +gapic = gcp.GAPICBazel() versions = ['v1', 'v1beta1', 'v1p1beta1'] name = 'securitycenter' for version in versions: - library = gapic.typescript_library( - name, - proto_path=f'google/cloud/{name}/{version}', - generator_args={ - 'grpc-service-config': f'google/cloud/{name}/{version}/{name}_grpc_service_config.json', - 'package-name': f'@google-cloud/security-center', - }, - extra_proto_files=['google/cloud/common_resources.proto'], - version=version) + library = gapic.node_library(name, version) # skip index, protos, package.json, and README.md s.copy( library, From 29a3e9cfba1fe04328394fafae57704d906a920e Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 7 Jul 2020 14:04:39 -0700 Subject: [PATCH 190/342] chore: release 5.0.1 (#291) * updated CHANGELOG.md [ci skip] * updated package.json [ci skip] * updated samples/package.json Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- packages/google-cloud-securitycenter/CHANGELOG.md | 7 +++++++ packages/google-cloud-securitycenter/package.json | 2 +- packages/google-cloud-securitycenter/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-securitycenter/CHANGELOG.md b/packages/google-cloud-securitycenter/CHANGELOG.md index 6239226f4a0..f4c289384c3 100644 --- a/packages/google-cloud-securitycenter/CHANGELOG.md +++ b/packages/google-cloud-securitycenter/CHANGELOG.md @@ -4,6 +4,13 @@ [1]: https://www.npmjs.com/package/@google-cloud/security-center?activeTab=versions +### [5.0.1](https://www.github.com/googleapis/nodejs-security-center/compare/v5.0.0...v5.0.1) (2020-07-06) + + +### Bug Fixes + +* update node issue template ([#290](https://www.github.com/googleapis/nodejs-security-center/issues/290)) ([c0b8bad](https://www.github.com/googleapis/nodejs-security-center/commit/c0b8bad200f829aa62ee7430bf0d51b5463c92ca)) + ## [5.0.0](https://www.github.com/googleapis/nodejs-security-center/compare/v4.0.0...v5.0.0) (2020-06-15) diff --git a/packages/google-cloud-securitycenter/package.json b/packages/google-cloud-securitycenter/package.json index 09aa016e91b..5be71a501ee 100644 --- a/packages/google-cloud-securitycenter/package.json +++ b/packages/google-cloud-securitycenter/package.json @@ -1,7 +1,7 @@ { "name": "@google-cloud/security-center", "description": "Cloud Security Command Center API client for Node.js", - "version": "5.0.0", + "version": "5.0.1", "license": "Apache-2.0", "author": "Google LLC", "engines": { diff --git a/packages/google-cloud-securitycenter/samples/package.json b/packages/google-cloud-securitycenter/samples/package.json index 4eb3f6d34ab..a91a9b9d7af 100644 --- a/packages/google-cloud-securitycenter/samples/package.json +++ b/packages/google-cloud-securitycenter/samples/package.json @@ -14,7 +14,7 @@ "license": "Apache-2.0", "dependencies": { "@google-cloud/pubsub": "^2.0.0", - "@google-cloud/security-center": "^5.0.0" + "@google-cloud/security-center": "^5.0.1" }, "devDependencies": { "chai": "^4.2.0", From b0de2b6b025f3286d915f432b4b9d99894b9771c Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Thu, 9 Jul 2020 17:51:12 -0700 Subject: [PATCH 191/342] build: typeo in nodejs .gitattribute (#298) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/cc99acfa-05b8-434b-9500-2f6faf2eaa02/targets - [ ] To automatically regenerate this PR, check this box. Source-Link: https://github.com/googleapis/synthtool/commit/799d8e6522c1ef7cb55a70d9ea0b15e045c3d00b --- .../google-cloud-securitycenter/.gitattributes | 2 +- .../google-cloud-securitycenter/synth.metadata | 14 +++++++++++--- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/packages/google-cloud-securitycenter/.gitattributes b/packages/google-cloud-securitycenter/.gitattributes index 2e63216ae9c..d4f4169b28b 100644 --- a/packages/google-cloud-securitycenter/.gitattributes +++ b/packages/google-cloud-securitycenter/.gitattributes @@ -1,3 +1,3 @@ *.ts text eol=lf -*.js test eol=lf +*.js text eol=lf protos/* linguist-generated diff --git a/packages/google-cloud-securitycenter/synth.metadata b/packages/google-cloud-securitycenter/synth.metadata index 6857c334aab..6463808fae4 100644 --- a/packages/google-cloud-securitycenter/synth.metadata +++ b/packages/google-cloud-securitycenter/synth.metadata @@ -3,15 +3,23 @@ { "git": { "name": ".", - "remote": "git@github.com:googleapis/nodejs-security-center.git", - "sha": "c772a5ad5c9ff0b897848c0ffc2f3fc774707228" + "remote": "https://github.com/googleapis/nodejs-security-center.git", + "sha": "0551af19c1e7995823b05c92ea6675ccbf1bee01" + } + }, + { + "git": { + "name": "googleapis", + "remote": "https://github.com/googleapis/googleapis.git", + "sha": "4f4aa3a03e470f1390758b9d89eb1aa88837a5be", + "internalRef": "320300472" } }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "303271797a360f8a439203413f13a160f2f5b3b4" + "sha": "799d8e6522c1ef7cb55a70d9ea0b15e045c3d00b" } } ], From b2d050c392db9cb88d67f057d07befd3a4b83d53 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 10 Jul 2020 18:51:43 +0200 Subject: [PATCH 192/342] chore(deps): update dependency ts-loader to v8 (#297) This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [ts-loader](https://togithub.com/TypeStrong/ts-loader) | devDependencies | major | [`^7.0.0` -> `^8.0.0`](https://renovatebot.com/diffs/npm/ts-loader/7.0.5/8.0.0) | --- ### Release Notes
TypeStrong/ts-loader ### [`v8.0.0`](https://togithub.com/TypeStrong/ts-loader/blob/master/CHANGELOG.md#v800) [Compare Source](https://togithub.com/TypeStrong/ts-loader/compare/v7.0.5...v8.0.0) - [Support for symlinks in project references](https://togithub.com/TypeStrong/ts-loader/pull/1136) - thanks [@​sheetalkamat](https://togithub.com/sheetalkamat)! - `ts-loader` now supports TypeScript 3.6 and greater **BREAKING CHANGE**
--- ### Renovate configuration :date: **Schedule**: "after 9am and before 3pm" (UTC). :vertical_traffic_light: **Automerge**: Disabled by config. Please merge this manually once you are satisfied. :recycle: **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. :no_bell: **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#googleapis/nodejs-security-center). --- packages/google-cloud-securitycenter/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-securitycenter/package.json b/packages/google-cloud-securitycenter/package.json index 5be71a501ee..74c07369330 100644 --- a/packages/google-cloud-securitycenter/package.json +++ b/packages/google-cloud-securitycenter/package.json @@ -58,7 +58,7 @@ "null-loader": "^4.0.0", "pack-n-play": "^1.0.0-2", "sinon": "^9.0.1", - "ts-loader": "^7.0.0", + "ts-loader": "^8.0.0", "typescript": "^3.8.3", "webpack": "^4.41.2", "webpack-cli": "^3.3.10" From 30ecc7177ec50be0a19a63866d64a91b90c75bda Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Sun, 12 Jul 2020 18:50:06 +0200 Subject: [PATCH 193/342] chore(deps): update dependency @types/mocha to v8 (#299) This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [@types/mocha](https://togithub.com/DefinitelyTyped/DefinitelyTyped) | devDependencies | major | [`^7.0.0` -> `^8.0.0`](https://renovatebot.com/diffs/npm/@types%2fmocha/7.0.2/8.0.0) | --- ### Renovate configuration :date: **Schedule**: "after 9am and before 3pm" (UTC). :vertical_traffic_light: **Automerge**: Disabled by config. Please merge this manually once you are satisfied. :recycle: **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. :no_bell: **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#googleapis/nodejs-security-center). --- packages/google-cloud-securitycenter/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-securitycenter/package.json b/packages/google-cloud-securitycenter/package.json index 74c07369330..2b294a834ad 100644 --- a/packages/google-cloud-securitycenter/package.json +++ b/packages/google-cloud-securitycenter/package.json @@ -45,7 +45,7 @@ "google-gax": "^2.1.0" }, "devDependencies": { - "@types/mocha": "^7.0.0", + "@types/mocha": "^8.0.0", "@types/node": "^12.0.0", "@types/sinon": "^9.0.0", "c8": "^7.0.0", From 443fb0289a0afc73e64246bf79f71f65a7897861 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Mon, 20 Jul 2020 09:48:39 -0700 Subject: [PATCH 194/342] fix: correct securitycenter grpc_service_configs, add Node 8 tests (#302) * fix: correct securitycenter grpc_service_configs PiperOrigin-RevId: 320995419 Source-Author: Google APIs Source-Date: Mon Jul 13 11:22:03 2020 -0700 Source-Repo: googleapis/googleapis Source-Sha: 240e65bd142ae3914cb250491bf0589331736731 Source-Link: https://github.com/googleapis/googleapis/commit/240e65bd142ae3914cb250491bf0589331736731 --- .../protos/protos.js | 312 ++++++++++++++---- .../src/v1/security_center_client_config.json | 10 +- .../security_center_client_config.json | 10 +- .../security_center_client_config.json | 46 +-- .../synth.metadata | 6 +- 5 files changed, 283 insertions(+), 101 deletions(-) diff --git a/packages/google-cloud-securitycenter/protos/protos.js b/packages/google-cloud-securitycenter/protos/protos.js index b40245a3531..a40182feb79 100644 --- a/packages/google-cloud-securitycenter/protos/protos.js +++ b/packages/google-cloud-securitycenter/protos/protos.js @@ -224,7 +224,7 @@ Asset.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.cloud.securitycenter.v1.Asset(), key; + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.Asset(), key, value; while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -235,12 +235,26 @@ message.securityCenterProperties = $root.google.cloud.securitycenter.v1.Asset.SecurityCenterProperties.decode(reader, reader.uint32()); break; case 7: - reader.skip().pos++; if (message.resourceProperties === $util.emptyObject) message.resourceProperties = {}; - key = reader.string(); - reader.pos++; - message.resourceProperties[key] = $root.google.protobuf.Value.decode(reader, reader.uint32()); + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.protobuf.Value.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.resourceProperties[key] = value; break; case 8: message.securityMarks = $root.google.cloud.securitycenter.v1.SecurityMarks.decode(reader, reader.uint32()); @@ -1087,7 +1101,7 @@ SecurityMarks.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.cloud.securitycenter.v1.SecurityMarks(), key; + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.SecurityMarks(), key, value; while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -1095,12 +1109,26 @@ message.name = reader.string(); break; case 2: - reader.skip().pos++; if (message.marks === $util.emptyObject) message.marks = {}; - key = reader.string(); - reader.pos++; - message.marks[key] = reader.string(); + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.marks[key] = value; break; default: reader.skipType(tag & 7); @@ -1408,7 +1436,7 @@ Finding.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.cloud.securitycenter.v1.Finding(), key; + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.Finding(), key, value; while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -1431,12 +1459,26 @@ message.externalUri = reader.string(); break; case 7: - reader.skip().pos++; if (message.sourceProperties === $util.emptyObject) message.sourceProperties = {}; - key = reader.string(); - reader.pos++; - message.sourceProperties[key] = $root.google.protobuf.Value.decode(reader, reader.uint32()); + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.protobuf.Value.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.sourceProperties[key] = value; break; case 8: message.securityMarks = $root.google.cloud.securitycenter.v1.SecurityMarks.decode(reader, reader.uint32()); @@ -7016,17 +7058,31 @@ GroupResult.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.cloud.securitycenter.v1.GroupResult(), key; + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.GroupResult(), key, value; while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - reader.skip().pos++; if (message.properties === $util.emptyObject) message.properties = {}; - key = reader.string(); - reader.pos++; - message.properties[key] = $root.google.protobuf.Value.decode(reader, reader.uint32()); + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.protobuf.Value.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.properties[key] = value; break; case 2: message.count = reader.int64(); @@ -12149,7 +12205,7 @@ Asset.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.cloud.securitycenter.v1beta1.Asset(), key; + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1beta1.Asset(), key, value; while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -12160,12 +12216,26 @@ message.securityCenterProperties = $root.google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties.decode(reader, reader.uint32()); break; case 7: - reader.skip().pos++; if (message.resourceProperties === $util.emptyObject) message.resourceProperties = {}; - key = reader.string(); - reader.pos++; - message.resourceProperties[key] = $root.google.protobuf.Value.decode(reader, reader.uint32()); + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.protobuf.Value.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.resourceProperties[key] = value; break; case 8: message.securityMarks = $root.google.cloud.securitycenter.v1beta1.SecurityMarks.decode(reader, reader.uint32()); @@ -12743,7 +12813,7 @@ SecurityMarks.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.cloud.securitycenter.v1beta1.SecurityMarks(), key; + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1beta1.SecurityMarks(), key, value; while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -12751,12 +12821,26 @@ message.name = reader.string(); break; case 2: - reader.skip().pos++; if (message.marks === $util.emptyObject) message.marks = {}; - key = reader.string(); - reader.pos++; - message.marks[key] = reader.string(); + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.marks[key] = value; break; default: reader.skipType(tag & 7); @@ -13064,7 +13148,7 @@ Finding.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.cloud.securitycenter.v1beta1.Finding(), key; + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1beta1.Finding(), key, value; while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -13087,12 +13171,26 @@ message.externalUri = reader.string(); break; case 7: - reader.skip().pos++; if (message.sourceProperties === $util.emptyObject) message.sourceProperties = {}; - key = reader.string(); - reader.pos++; - message.sourceProperties[key] = $root.google.protobuf.Value.decode(reader, reader.uint32()); + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.protobuf.Value.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.sourceProperties[key] = value; break; case 8: message.securityMarks = $root.google.cloud.securitycenter.v1beta1.SecurityMarks.decode(reader, reader.uint32()); @@ -16799,17 +16897,31 @@ GroupResult.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.cloud.securitycenter.v1beta1.GroupResult(), key; + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1beta1.GroupResult(), key, value; while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - reader.skip().pos++; if (message.properties === $util.emptyObject) message.properties = {}; - key = reader.string(); - reader.pos++; - message.properties[key] = $root.google.protobuf.Value.decode(reader, reader.uint32()); + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.protobuf.Value.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.properties[key] = value; break; case 2: message.count = reader.int64(); @@ -20674,7 +20786,7 @@ Asset.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.cloud.securitycenter.v1p1beta1.Asset(), key; + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1p1beta1.Asset(), key, value; while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -20685,12 +20797,26 @@ message.securityCenterProperties = $root.google.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterProperties.decode(reader, reader.uint32()); break; case 7: - reader.skip().pos++; if (message.resourceProperties === $util.emptyObject) message.resourceProperties = {}; - key = reader.string(); - reader.pos++; - message.resourceProperties[key] = $root.google.protobuf.Value.decode(reader, reader.uint32()); + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.protobuf.Value.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.resourceProperties[key] = value; break; case 8: message.securityMarks = $root.google.cloud.securitycenter.v1p1beta1.SecurityMarks.decode(reader, reader.uint32()); @@ -21537,7 +21663,7 @@ SecurityMarks.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.cloud.securitycenter.v1p1beta1.SecurityMarks(), key; + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1p1beta1.SecurityMarks(), key, value; while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -21545,12 +21671,26 @@ message.name = reader.string(); break; case 2: - reader.skip().pos++; if (message.marks === $util.emptyObject) message.marks = {}; - key = reader.string(); - reader.pos++; - message.marks[key] = reader.string(); + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.marks[key] = value; break; default: reader.skipType(tag & 7); @@ -21858,7 +21998,7 @@ Finding.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.cloud.securitycenter.v1p1beta1.Finding(), key; + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1p1beta1.Finding(), key, value; while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -21881,12 +22021,26 @@ message.externalUri = reader.string(); break; case 7: - reader.skip().pos++; if (message.sourceProperties === $util.emptyObject) message.sourceProperties = {}; - key = reader.string(); - reader.pos++; - message.sourceProperties[key] = $root.google.protobuf.Value.decode(reader, reader.uint32()); + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.protobuf.Value.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.sourceProperties[key] = value; break; case 8: message.securityMarks = $root.google.cloud.securitycenter.v1p1beta1.SecurityMarks.decode(reader, reader.uint32()); @@ -27515,17 +27669,31 @@ GroupResult.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.cloud.securitycenter.v1p1beta1.GroupResult(), key; + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1p1beta1.GroupResult(), key, value; while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - reader.skip().pos++; if (message.properties === $util.emptyObject) message.properties = {}; - key = reader.string(); - reader.pos++; - message.properties[key] = $root.google.protobuf.Value.decode(reader, reader.uint32()); + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.protobuf.Value.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.properties[key] = value; break; case 2: message.count = reader.int64(); @@ -42798,17 +42966,31 @@ Struct.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.Struct(), key; + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Struct(), key, value; while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - reader.skip().pos++; if (message.fields === $util.emptyObject) message.fields = {}; - key = reader.string(); - reader.pos++; - message.fields[key] = $root.google.protobuf.Value.decode(reader, reader.uint32()); + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.protobuf.Value.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.fields[key] = value; break; default: reader.skipType(tag & 7); diff --git a/packages/google-cloud-securitycenter/src/v1/security_center_client_config.json b/packages/google-cloud-securitycenter/src/v1/security_center_client_config.json index 7e9fa71b14b..dbb23072520 100644 --- a/packages/google-cloud-securitycenter/src/v1/security_center_client_config.json +++ b/packages/google-cloud-securitycenter/src/v1/security_center_client_config.json @@ -61,22 +61,22 @@ "retry_params_name": "default" }, "GroupAssets": { - "timeout_millis": 60000, + "timeout_millis": 480000, "retry_codes_name": "idempotent", "retry_params_name": "default" }, "GroupFindings": { - "timeout_millis": 60000, + "timeout_millis": 480000, "retry_codes_name": "idempotent", "retry_params_name": "default" }, "ListAssets": { - "timeout_millis": 60000, + "timeout_millis": 480000, "retry_codes_name": "idempotent", "retry_params_name": "default" }, "ListFindings": { - "timeout_millis": 60000, + "timeout_millis": 480000, "retry_codes_name": "idempotent", "retry_params_name": "default" }, @@ -131,7 +131,7 @@ "retry_params_name": "default" }, "UpdateSecurityMarks": { - "timeout_millis": 60000, + "timeout_millis": 480000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" } diff --git a/packages/google-cloud-securitycenter/src/v1beta1/security_center_client_config.json b/packages/google-cloud-securitycenter/src/v1beta1/security_center_client_config.json index 6f485a0f232..a1a7e2d9386 100644 --- a/packages/google-cloud-securitycenter/src/v1beta1/security_center_client_config.json +++ b/packages/google-cloud-securitycenter/src/v1beta1/security_center_client_config.json @@ -46,22 +46,22 @@ "retry_params_name": "default" }, "GroupAssets": { - "timeout_millis": 60000, + "timeout_millis": 480000, "retry_codes_name": "idempotent", "retry_params_name": "default" }, "GroupFindings": { - "timeout_millis": 60000, + "timeout_millis": 480000, "retry_codes_name": "idempotent", "retry_params_name": "default" }, "ListAssets": { - "timeout_millis": 60000, + "timeout_millis": 480000, "retry_codes_name": "idempotent", "retry_params_name": "default" }, "ListFindings": { - "timeout_millis": 60000, + "timeout_millis": 480000, "retry_codes_name": "idempotent", "retry_params_name": "default" }, @@ -106,7 +106,7 @@ "retry_params_name": "default" }, "UpdateSecurityMarks": { - "timeout_millis": 60000, + "timeout_millis": 480000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" } diff --git a/packages/google-cloud-securitycenter/src/v1p1beta1/security_center_client_config.json b/packages/google-cloud-securitycenter/src/v1p1beta1/security_center_client_config.json index 3d47939eb43..b8821e07010 100644 --- a/packages/google-cloud-securitycenter/src/v1p1beta1/security_center_client_config.json +++ b/packages/google-cloud-securitycenter/src/v1p1beta1/security_center_client_config.json @@ -21,117 +21,117 @@ }, "methods": { "CreateSource": { - "timeout_millis": 600000, + "timeout_millis": 60000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, "CreateFinding": { - "timeout_millis": 600000, + "timeout_millis": 60000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, "CreateNotificationConfig": { - "timeout_millis": 600000, + "timeout_millis": 60000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, "DeleteNotificationConfig": { - "timeout_millis": 600000, + "timeout_millis": 60000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, "GetIamPolicy": { - "timeout_millis": 600000, + "timeout_millis": 60000, "retry_codes_name": "idempotent", "retry_params_name": "default" }, "GetNotificationConfig": { - "timeout_millis": 600000, + "timeout_millis": 60000, "retry_codes_name": "idempotent", "retry_params_name": "default" }, "GetOrganizationSettings": { - "timeout_millis": 600000, + "timeout_millis": 60000, "retry_codes_name": "idempotent", "retry_params_name": "default" }, "GetSource": { - "timeout_millis": 600000, + "timeout_millis": 60000, "retry_codes_name": "idempotent", "retry_params_name": "default" }, "GroupAssets": { - "timeout_millis": 600000, + "timeout_millis": 480000, "retry_codes_name": "idempotent", "retry_params_name": "default" }, "GroupFindings": { - "timeout_millis": 600000, + "timeout_millis": 480000, "retry_codes_name": "idempotent", "retry_params_name": "default" }, "ListAssets": { - "timeout_millis": 600000, + "timeout_millis": 480000, "retry_codes_name": "idempotent", "retry_params_name": "default" }, "ListFindings": { - "timeout_millis": 600000, + "timeout_millis": 480000, "retry_codes_name": "idempotent", "retry_params_name": "default" }, "ListNotificationConfigs": { - "timeout_millis": 600000, + "timeout_millis": 60000, "retry_codes_name": "idempotent", "retry_params_name": "default" }, "ListSources": { - "timeout_millis": 600000, + "timeout_millis": 60000, "retry_codes_name": "idempotent", "retry_params_name": "default" }, "RunAssetDiscovery": { - "timeout_millis": 600000, + "timeout_millis": 60000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, "SetFindingState": { - "timeout_millis": 600000, + "timeout_millis": 60000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, "SetIamPolicy": { - "timeout_millis": 600000, + "timeout_millis": 60000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, "TestIamPermissions": { - "timeout_millis": 600000, + "timeout_millis": 60000, "retry_codes_name": "idempotent", "retry_params_name": "default" }, "UpdateFinding": { - "timeout_millis": 600000, + "timeout_millis": 60000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, "UpdateNotificationConfig": { - "timeout_millis": 600000, + "timeout_millis": 60000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, "UpdateOrganizationSettings": { - "timeout_millis": 600000, + "timeout_millis": 60000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, "UpdateSource": { - "timeout_millis": 600000, + "timeout_millis": 60000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, "UpdateSecurityMarks": { - "timeout_millis": 600000, + "timeout_millis": 480000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" } diff --git a/packages/google-cloud-securitycenter/synth.metadata b/packages/google-cloud-securitycenter/synth.metadata index 6463808fae4..d6b81e4ec33 100644 --- a/packages/google-cloud-securitycenter/synth.metadata +++ b/packages/google-cloud-securitycenter/synth.metadata @@ -4,15 +4,15 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-security-center.git", - "sha": "0551af19c1e7995823b05c92ea6675ccbf1bee01" + "sha": "9707f8b09b87b29561cfc7368f4b202595459045" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "4f4aa3a03e470f1390758b9d89eb1aa88837a5be", - "internalRef": "320300472" + "sha": "240e65bd142ae3914cb250491bf0589331736731", + "internalRef": "320995419" } }, { From 2f48a2fb61939317a4a88799ae822847305c8f65 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Mon, 20 Jul 2020 10:30:54 -0700 Subject: [PATCH 195/342] build: missing parenthesis in publish script, delete Node 8 tests, add config for cloud-rad for nodejs (#303) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/b02a7220-ded6-43ea-abe6-c043d792fee2/targets - [ ] To automatically regenerate this PR, check this box. Source-Link: https://github.com/googleapis/synthtool/commit/21f1470ecd01424dc91c70f1a7c798e4e87d1eec Source-Link: https://github.com/googleapis/synthtool/commit/388e10f5ae302d3e8de1fac99f3a95d1ab8f824a Source-Link: https://github.com/googleapis/synthtool/commit/d82deccf657a66e31bd5da9efdb96c6fa322fc7e --- .../api-extractor.json | 369 ++++++++++++++++++ .../synth.metadata | 2 +- 2 files changed, 370 insertions(+), 1 deletion(-) create mode 100644 packages/google-cloud-securitycenter/api-extractor.json diff --git a/packages/google-cloud-securitycenter/api-extractor.json b/packages/google-cloud-securitycenter/api-extractor.json new file mode 100644 index 00000000000..de228294b23 --- /dev/null +++ b/packages/google-cloud-securitycenter/api-extractor.json @@ -0,0 +1,369 @@ +/** + * Config file for API Extractor. For more info, please visit: https://api-extractor.com + */ +{ + "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", + + /** + * Optionally specifies another JSON config file that this file extends from. This provides a way for + * standard settings to be shared across multiple projects. + * + * If the path starts with "./" or "../", the path is resolved relative to the folder of the file that contains + * the "extends" field. Otherwise, the first path segment is interpreted as an NPM package name, and will be + * resolved using NodeJS require(). + * + * SUPPORTED TOKENS: none + * DEFAULT VALUE: "" + */ + // "extends": "./shared/api-extractor-base.json" + // "extends": "my-package/include/api-extractor-base.json" + + /** + * Determines the "" token that can be used with other config file settings. The project folder + * typically contains the tsconfig.json and package.json config files, but the path is user-defined. + * + * The path is resolved relative to the folder of the config file that contains the setting. + * + * The default value for "projectFolder" is the token "", which means the folder is determined by traversing + * parent folders, starting from the folder containing api-extractor.json, and stopping at the first folder + * that contains a tsconfig.json file. If a tsconfig.json file cannot be found in this way, then an error + * will be reported. + * + * SUPPORTED TOKENS: + * DEFAULT VALUE: "" + */ + // "projectFolder": "..", + + /** + * (REQUIRED) Specifies the .d.ts file to be used as the starting point for analysis. API Extractor + * analyzes the symbols exported by this module. + * + * The file extension must be ".d.ts" and not ".ts". + * + * The path is resolved relative to the folder of the config file that contains the setting; to change this, + * prepend a folder token such as "". + * + * SUPPORTED TOKENS: , , + */ + "mainEntryPointFilePath": "/protos/protos.d.ts", + + /** + * A list of NPM package names whose exports should be treated as part of this package. + * + * For example, suppose that Webpack is used to generate a distributed bundle for the project "library1", + * and another NPM package "library2" is embedded in this bundle. Some types from library2 may become part + * of the exported API for library1, but by default API Extractor would generate a .d.ts rollup that explicitly + * imports library2. To avoid this, we can specify: + * + * "bundledPackages": [ "library2" ], + * + * This would direct API Extractor to embed those types directly in the .d.ts rollup, as if they had been + * local files for library1. + */ + "bundledPackages": [ ], + + /** + * Determines how the TypeScript compiler engine will be invoked by API Extractor. + */ + "compiler": { + /** + * Specifies the path to the tsconfig.json file to be used by API Extractor when analyzing the project. + * + * The path is resolved relative to the folder of the config file that contains the setting; to change this, + * prepend a folder token such as "". + * + * Note: This setting will be ignored if "overrideTsconfig" is used. + * + * SUPPORTED TOKENS: , , + * DEFAULT VALUE: "/tsconfig.json" + */ + // "tsconfigFilePath": "/tsconfig.json", + + /** + * Provides a compiler configuration that will be used instead of reading the tsconfig.json file from disk. + * The object must conform to the TypeScript tsconfig schema: + * + * http://json.schemastore.org/tsconfig + * + * If omitted, then the tsconfig.json file will be read from the "projectFolder". + * + * DEFAULT VALUE: no overrideTsconfig section + */ + // "overrideTsconfig": { + // . . . + // } + + /** + * This option causes the compiler to be invoked with the --skipLibCheck option. This option is not recommended + * and may cause API Extractor to produce incomplete or incorrect declarations, but it may be required when + * dependencies contain declarations that are incompatible with the TypeScript engine that API Extractor uses + * for its analysis. Where possible, the underlying issue should be fixed rather than relying on skipLibCheck. + * + * DEFAULT VALUE: false + */ + // "skipLibCheck": true, + }, + + /** + * Configures how the API report file (*.api.md) will be generated. + */ + "apiReport": { + /** + * (REQUIRED) Whether to generate an API report. + */ + "enabled": true, + + /** + * The filename for the API report files. It will be combined with "reportFolder" or "reportTempFolder" to produce + * a full file path. + * + * The file extension should be ".api.md", and the string should not contain a path separator such as "\" or "/". + * + * SUPPORTED TOKENS: , + * DEFAULT VALUE: ".api.md" + */ + // "reportFileName": ".api.md", + + /** + * Specifies the folder where the API report file is written. The file name portion is determined by + * the "reportFileName" setting. + * + * The API report file is normally tracked by Git. Changes to it can be used to trigger a branch policy, + * e.g. for an API review. + * + * The path is resolved relative to the folder of the config file that contains the setting; to change this, + * prepend a folder token such as "". + * + * SUPPORTED TOKENS: , , + * DEFAULT VALUE: "/etc/" + */ + // "reportFolder": "/etc/", + + /** + * Specifies the folder where the temporary report file is written. The file name portion is determined by + * the "reportFileName" setting. + * + * After the temporary file is written to disk, it is compared with the file in the "reportFolder". + * If they are different, a production build will fail. + * + * The path is resolved relative to the folder of the config file that contains the setting; to change this, + * prepend a folder token such as "". + * + * SUPPORTED TOKENS: , , + * DEFAULT VALUE: "/temp/" + */ + // "reportTempFolder": "/temp/" + }, + + /** + * Configures how the doc model file (*.api.json) will be generated. + */ + "docModel": { + /** + * (REQUIRED) Whether to generate a doc model file. + */ + "enabled": true, + + /** + * The output path for the doc model file. The file extension should be ".api.json". + * + * The path is resolved relative to the folder of the config file that contains the setting; to change this, + * prepend a folder token such as "". + * + * SUPPORTED TOKENS: , , + * DEFAULT VALUE: "/temp/.api.json" + */ + // "apiJsonFilePath": "/temp/.api.json" + }, + + /** + * Configures how the .d.ts rollup file will be generated. + */ + "dtsRollup": { + /** + * (REQUIRED) Whether to generate the .d.ts rollup file. + */ + "enabled": true, + + /** + * Specifies the output path for a .d.ts rollup file to be generated without any trimming. + * This file will include all declarations that are exported by the main entry point. + * + * If the path is an empty string, then this file will not be written. + * + * The path is resolved relative to the folder of the config file that contains the setting; to change this, + * prepend a folder token such as "". + * + * SUPPORTED TOKENS: , , + * DEFAULT VALUE: "/dist/.d.ts" + */ + // "untrimmedFilePath": "/dist/.d.ts", + + /** + * Specifies the output path for a .d.ts rollup file to be generated with trimming for a "beta" release. + * This file will include only declarations that are marked as "@public" or "@beta". + * + * The path is resolved relative to the folder of the config file that contains the setting; to change this, + * prepend a folder token such as "". + * + * SUPPORTED TOKENS: , , + * DEFAULT VALUE: "" + */ + // "betaTrimmedFilePath": "/dist/-beta.d.ts", + + + /** + * Specifies the output path for a .d.ts rollup file to be generated with trimming for a "public" release. + * This file will include only declarations that are marked as "@public". + * + * If the path is an empty string, then this file will not be written. + * + * The path is resolved relative to the folder of the config file that contains the setting; to change this, + * prepend a folder token such as "". + * + * SUPPORTED TOKENS: , , + * DEFAULT VALUE: "" + */ + // "publicTrimmedFilePath": "/dist/-public.d.ts", + + /** + * When a declaration is trimmed, by default it will be replaced by a code comment such as + * "Excluded from this release type: exampleMember". Set "omitTrimmingComments" to true to remove the + * declaration completely. + * + * DEFAULT VALUE: false + */ + // "omitTrimmingComments": true + }, + + /** + * Configures how the tsdoc-metadata.json file will be generated. + */ + "tsdocMetadata": { + /** + * Whether to generate the tsdoc-metadata.json file. + * + * DEFAULT VALUE: true + */ + // "enabled": true, + + /** + * Specifies where the TSDoc metadata file should be written. + * + * The path is resolved relative to the folder of the config file that contains the setting; to change this, + * prepend a folder token such as "". + * + * The default value is "", which causes the path to be automatically inferred from the "tsdocMetadata", + * "typings" or "main" fields of the project's package.json. If none of these fields are set, the lookup + * falls back to "tsdoc-metadata.json" in the package folder. + * + * SUPPORTED TOKENS: , , + * DEFAULT VALUE: "" + */ + // "tsdocMetadataFilePath": "/dist/tsdoc-metadata.json" + }, + + /** + * Specifies what type of newlines API Extractor should use when writing output files. By default, the output files + * will be written with Windows-style newlines. To use POSIX-style newlines, specify "lf" instead. + * To use the OS's default newline kind, specify "os". + * + * DEFAULT VALUE: "crlf" + */ + // "newlineKind": "crlf", + + /** + * Configures how API Extractor reports error and warning messages produced during analysis. + * + * There are three sources of messages: compiler messages, API Extractor messages, and TSDoc messages. + */ + "messages": { + /** + * Configures handling of diagnostic messages reported by the TypeScript compiler engine while analyzing + * the input .d.ts files. + * + * TypeScript message identifiers start with "TS" followed by an integer. For example: "TS2551" + * + * DEFAULT VALUE: A single "default" entry with logLevel=warning. + */ + "compilerMessageReporting": { + /** + * Configures the default routing for messages that don't match an explicit rule in this table. + */ + "default": { + /** + * Specifies whether the message should be written to the the tool's output log. Note that + * the "addToApiReportFile" property may supersede this option. + * + * Possible values: "error", "warning", "none" + * + * Errors cause the build to fail and return a nonzero exit code. Warnings cause a production build fail + * and return a nonzero exit code. For a non-production build (e.g. when "api-extractor run" includes + * the "--local" option), the warning is displayed but the build will not fail. + * + * DEFAULT VALUE: "warning" + */ + "logLevel": "warning", + + /** + * When addToApiReportFile is true: If API Extractor is configured to write an API report file (.api.md), + * then the message will be written inside that file; otherwise, the message is instead logged according to + * the "logLevel" option. + * + * DEFAULT VALUE: false + */ + // "addToApiReportFile": false + }, + + // "TS2551": { + // "logLevel": "warning", + // "addToApiReportFile": true + // }, + // + // . . . + }, + + /** + * Configures handling of messages reported by API Extractor during its analysis. + * + * API Extractor message identifiers start with "ae-". For example: "ae-extra-release-tag" + * + * DEFAULT VALUE: See api-extractor-defaults.json for the complete table of extractorMessageReporting mappings + */ + "extractorMessageReporting": { + "default": { + "logLevel": "warning", + // "addToApiReportFile": false + }, + + // "ae-extra-release-tag": { + // "logLevel": "warning", + // "addToApiReportFile": true + // }, + // + // . . . + }, + + /** + * Configures handling of messages reported by the TSDoc parser when analyzing code comments. + * + * TSDoc message identifiers start with "tsdoc-". For example: "tsdoc-link-tag-unescaped-text" + * + * DEFAULT VALUE: A single "default" entry with logLevel=warning. + */ + "tsdocMessageReporting": { + "default": { + "logLevel": "warning", + // "addToApiReportFile": false + } + + // "tsdoc-link-tag-unescaped-text": { + // "logLevel": "warning", + // "addToApiReportFile": true + // }, + // + // . . . + } + } + +} diff --git a/packages/google-cloud-securitycenter/synth.metadata b/packages/google-cloud-securitycenter/synth.metadata index d6b81e4ec33..4e1c03bc6f8 100644 --- a/packages/google-cloud-securitycenter/synth.metadata +++ b/packages/google-cloud-securitycenter/synth.metadata @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "799d8e6522c1ef7cb55a70d9ea0b15e045c3d00b" + "sha": "21f1470ecd01424dc91c70f1a7c798e4e87d1eec" } } ], From 1fece6850e8f994607806a22fb7d7938aafd4c7e Mon Sep 17 00:00:00 2001 From: "F. Hinkelmann" Date: Tue, 21 Jul 2020 14:46:03 -0400 Subject: [PATCH 196/342] chore: add dev dependencies for cloud-rad ref docs (#305) --- packages/google-cloud-securitycenter/package.json | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-securitycenter/package.json b/packages/google-cloud-securitycenter/package.json index 2b294a834ad..07d604bb890 100644 --- a/packages/google-cloud-securitycenter/package.json +++ b/packages/google-cloud-securitycenter/package.json @@ -26,7 +26,9 @@ "test": "c8 mocha build/test", "samples-test": "cd samples/ && npm link ../ && npm test && cd ../", "prelint": "cd samples; npm link ../; npm install", - "precompile": "gts clean" + "precompile": "gts clean", + "api-extractor": "api-extractor run --local", + "api-documenter": "api-documenter yaml --input-folder=temp" }, "keywords": [ "google apis client", @@ -61,6 +63,8 @@ "ts-loader": "^8.0.0", "typescript": "^3.8.3", "webpack": "^4.41.2", - "webpack-cli": "^3.3.10" + "webpack-cli": "^3.3.10", + "@microsoft/api-documenter": "^7.8.10", + "@microsoft/api-extractor": "^7.8.10" } } From 105a44f8340e5cb2661ccbd4d4317fa3195ccf99 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Fri, 24 Jul 2020 13:33:19 -0700 Subject: [PATCH 197/342] fix: add resource config to v1beta1 (#307) --- .../cloud/securitycenter/v1beta1/asset.proto | 44 ++++++++++------- .../securitycenter/v1beta1/finding.proto | 29 ++++++----- .../v1beta1/organization_settings.proto | 7 ++- .../run_asset_discovery_response.proto | 3 +- .../v1beta1/security_marks.proto | 9 ++-- .../v1beta1/securitycenter_service.proto | 3 +- .../cloud/securitycenter/v1beta1/source.proto | 7 ++- .../protos/protos.json | 4 ++ .../src/v1beta1/security_center_client.ts | 39 +++++++++++++++ .../synth.metadata | 6 +-- .../test/gapic_security_center_v1beta1.ts | 49 +++++++++++++++++++ 11 files changed, 146 insertions(+), 54 deletions(-) diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/asset.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/asset.proto index 85d0e0900db..b73f7d5bc1f 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/asset.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/asset.proto @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC. +// 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. @@ -11,13 +11,13 @@ // WITHOUT 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.cloud.securitycenter.v1beta1; import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; import "google/cloud/securitycenter/v1beta1/security_marks.proto"; import "google/protobuf/struct.proto"; import "google/protobuf/timestamp.proto"; @@ -27,25 +27,31 @@ option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/ option java_multiple_files = true; option java_package = "com.google.cloud.securitycenter.v1beta1"; -// Cloud Security Command Center's (Cloud SCC) representation of a Google Cloud -// Platform (GCP) resource. +// Security Command Center representation of a Google Cloud +// resource. // -// The Asset is a Cloud SCC resource that captures information about a single -// GCP resource. All modifications to an Asset are only within the context of -// Cloud SCC and don't affect the referenced GCP resource. +// The Asset is a Security Command Center resource that captures information +// about a single Google Cloud resource. All modifications to an Asset are only +// within the context of Security Command Center and don't affect the referenced +// Google Cloud resource. message Asset { - // Cloud SCC managed properties. These properties are managed by Cloud SCC and - // cannot be modified by the user. + option (google.api.resource) = { + type: "securitycenter.googleapis.com/Asset" + pattern: "organizations/{organization}/assets/{asset}" + }; + + // Security Command Center managed properties. These properties are managed by + // Security Command Center and cannot be modified by the user. message SecurityCenterProperties { - // Immutable. The full resource name of the GCP resource this asset + // Immutable. The full resource name of the Google Cloud resource this asset // represents. This field is immutable after create time. See: // https://cloud.google.com/apis/design/resource_names#full_resource_name string resource_name = 1 [(google.api.field_behavior) = IMMUTABLE]; - // The type of the GCP resource. Examples include: APPLICATION, + // The type of the Google Cloud resource. Examples include: APPLICATION, // PROJECT, and ORGANIZATION. This is a case insensitive field defined by - // Cloud SCC and/or the producer of the resource and is immutable - // after create time. + // Security Command Center and/or the producer of the resource and is + // immutable after create time. string resource_type = 2; // The full resource name of the immediate parent of the resource. See: @@ -66,22 +72,22 @@ message Asset { // "organizations/{organization_id}/assets/{asset_id}". string name = 1; - // Cloud SCC managed properties. These properties are managed by - // Cloud SCC and cannot be modified by the user. + // Security Command Center managed properties. These properties are managed by + // Security Command Center and cannot be modified by the user. SecurityCenterProperties security_center_properties = 2; // Resource managed properties. These properties are managed and defined by - // the GCP resource and cannot be modified by the user. + // the Google Cloud resource and cannot be modified by the user. map resource_properties = 7; // User specified security marks. These marks are entirely managed by the user // and come from the SecurityMarks resource that belongs to the asset. SecurityMarks security_marks = 8; - // The time at which the asset was created in Cloud SCC. + // The time at which the asset was created in Security Command Center. google.protobuf.Timestamp create_time = 9; - // The time at which the asset was last updated, added, or deleted in Cloud - // SCC. + // The time at which the asset was last updated, added, or deleted in Security + // Command Center. google.protobuf.Timestamp update_time = 10; } diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/finding.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/finding.proto index e582e6de3f5..d78a522b432 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/finding.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/finding.proto @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC. +// 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. @@ -11,7 +11,6 @@ // WITHOUT 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"; @@ -28,12 +27,12 @@ option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/ option java_multiple_files = true; option java_package = "com.google.cloud.securitycenter.v1beta1"; -// Cloud Security Command Center (Cloud SCC) finding. +// Security Command Center finding. // // A finding is a record of assessment data (security, risk, health or privacy) -// ingested into Cloud SCC for presentation, notification, analysis, -// policy testing, and enforcement. For example, an XSS vulnerability in an -// App Engine application is a finding. +// ingested into Security Command Center for presentation, notification, +// analysis, policy testing, and enforcement. For example, an XSS vulnerability +// in an App Engine application is a finding. message Finding { option (google.api.resource) = { type: "securitycenter.googleapis.com/Finding" @@ -66,12 +65,12 @@ message Finding { // "organizations/{organization_id}/sources/{source_id}" string parent = 2 [(google.api.field_behavior) = IMMUTABLE]; - // For findings on Google Cloud Platform (GCP) resources, the full resource - // name of the GCP resource this finding is for. See: + // For findings on Google Cloud resources, the full resource + // name of the Google Cloud resource this finding is for. See: // https://cloud.google.com/apis/design/resource_names#full_resource_name - // When the finding is for a non-GCP resource, the resourceName can be a - // customer or partner defined string. - // This field is immutable after creation time. + // When the finding is for a non-Google Cloud resource, the resourceName can + // be a customer or partner defined string. This field is immutable after + // creation time. string resource_name = 3; // The state of the finding. @@ -82,9 +81,9 @@ message Finding { // Example: "XSS_FLASH_INJECTION" string category = 5; - // The URI that, if available, points to a web page outside of Cloud SCC - // where additional information about the finding can be found. This field is - // guaranteed to be either empty or a well formed URL. + // The URI that, if available, points to a web page outside of Security + // Command Center where additional information about the finding can be found. + // This field is guaranteed to be either empty or a well formed URL. string external_uri = 6; // Source specific properties. These properties are managed by the source @@ -103,6 +102,6 @@ message Finding { // the firewall became open. The accuracy is determined by the detector. google.protobuf.Timestamp event_time = 9; - // The time at which the finding was created in Cloud SCC. + // The time at which the finding was created in Security Command Center. google.protobuf.Timestamp create_time = 10; } diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/organization_settings.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/organization_settings.proto index 9f7f2b0edb0..88b2008a190 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/organization_settings.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/organization_settings.proto @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC. +// 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. @@ -11,7 +11,6 @@ // WITHOUT 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"; @@ -24,8 +23,8 @@ option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/ option java_multiple_files = true; option java_package = "com.google.cloud.securitycenter.v1beta1"; -// User specified settings that are attached to the Cloud Security Command -// Center (Cloud SCC) organization. +// User specified settings that are attached to the Security Command +// Center organization. message OrganizationSettings { option (google.api.resource) = { type: "securitycenter.googleapis.com/OrganizationSettings" diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/run_asset_discovery_response.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/run_asset_discovery_response.proto index 53ba02ef0cc..20d3b25b10f 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/run_asset_discovery_response.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/run_asset_discovery_response.proto @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC. +// 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. @@ -11,7 +11,6 @@ // WITHOUT 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"; diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/security_marks.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/security_marks.proto index 97baf247980..2547c3063cc 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/security_marks.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/security_marks.proto @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC. +// 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. @@ -11,7 +11,6 @@ // WITHOUT 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"; @@ -24,9 +23,9 @@ option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/ option java_multiple_files = true; option java_package = "com.google.cloud.securitycenter.v1beta1"; -// User specified security marks that are attached to the parent Cloud Security -// Command Center (Cloud SCC) resource. Security marks are scoped within a Cloud -// SCC organization -- they can be modified and viewed by all users who have +// User specified security marks that are attached to the parent Security +// Command Center resource. Security marks are scoped within a Security Command +// Center organization -- they can be modified and viewed by all users who have // proper permissions on the organization. message SecurityMarks { option (google.api.resource) = { diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/securitycenter_service.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/securitycenter_service.proto index ba2edf4eed8..351c1f4a366 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/securitycenter_service.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/securitycenter_service.proto @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC. +// 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. @@ -11,7 +11,6 @@ // WITHOUT 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"; diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/source.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/source.proto index 98025bca28d..fb1e6c6a404 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/source.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/source.proto @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC. +// 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. @@ -11,7 +11,6 @@ // WITHOUT 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"; @@ -24,7 +23,7 @@ option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/ option java_multiple_files = true; option java_package = "com.google.cloud.securitycenter.v1beta1"; -// Cloud Security Command Center's (Cloud SCC) finding source. A finding source +// Security Command Center finding source. A finding source // is an entity or a mechanism that can produce a finding. A source is like a // container of findings that come from the same scanner, logger, monitor, etc. message Source { @@ -48,7 +47,7 @@ message Source { // The description of the source (max of 1024 characters). // Example: - // "Cloud Security Scanner is a web security scanner for common + // "Web Security Scanner is a web security scanner for common // vulnerabilities in App Engine applications. It can automatically // scan and detect four common vulnerabilities, including cross-site-scripting // (XSS), Flash injection, mixed content (HTTP in HTTPS), and diff --git a/packages/google-cloud-securitycenter/protos/protos.json b/packages/google-cloud-securitycenter/protos/protos.json index 7bb9f745b47..6b2486ba1a1 100644 --- a/packages/google-cloud-securitycenter/protos/protos.json +++ b/packages/google-cloud-securitycenter/protos/protos.json @@ -1223,6 +1223,10 @@ }, "nested": { "Asset": { + "options": { + "(google.api.resource).type": "securitycenter.googleapis.com/Asset", + "(google.api.resource).pattern": "organizations/{organization}/assets/{asset}" + }, "fields": { "name": { "type": "string", diff --git a/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.ts b/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.ts index 893485e0465..862a13b2df5 100644 --- a/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.ts +++ b/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.ts @@ -162,6 +162,9 @@ export class SecurityCenterClient { // identifiers to uniquely identify resources within the API. // Create useful helper objects for these. this.pathTemplates = { + assetPathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}/assets/{asset}' + ), findingPathTemplate: new this._gaxModule.PathTemplate( 'organizations/{organization}/sources/{source}/findings/{finding}' ), @@ -3385,6 +3388,42 @@ export class SecurityCenterClient { // -- Path templates -- // -------------------- + /** + * Return a fully-qualified asset resource name string. + * + * @param {string} organization + * @param {string} asset + * @returns {string} Resource name string. + */ + assetPath(organization: string, asset: string) { + return this.pathTemplates.assetPathTemplate.render({ + organization: organization, + asset: asset, + }); + } + + /** + * Parse the organization from Asset resource. + * + * @param {string} assetName + * A fully-qualified path representing Asset resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromAssetName(assetName: string) { + return this.pathTemplates.assetPathTemplate.match(assetName).organization; + } + + /** + * Parse the asset from Asset resource. + * + * @param {string} assetName + * A fully-qualified path representing Asset resource. + * @returns {string} A string representing the asset. + */ + matchAssetFromAssetName(assetName: string) { + return this.pathTemplates.assetPathTemplate.match(assetName).asset; + } + /** * Return a fully-qualified finding resource name string. * diff --git a/packages/google-cloud-securitycenter/synth.metadata b/packages/google-cloud-securitycenter/synth.metadata index 4e1c03bc6f8..e1f3c83b098 100644 --- a/packages/google-cloud-securitycenter/synth.metadata +++ b/packages/google-cloud-securitycenter/synth.metadata @@ -4,15 +4,15 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-security-center.git", - "sha": "9707f8b09b87b29561cfc7368f4b202595459045" + "sha": "c9e263cb969a1ef75f8e0b7a36d1a3041e2cb9f1" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "240e65bd142ae3914cb250491bf0589331736731", - "internalRef": "320995419" + "sha": "e26e1839a45445d13cd45b1be3b1523defb72fee", + "internalRef": "322867095" } }, { diff --git a/packages/google-cloud-securitycenter/test/gapic_security_center_v1beta1.ts b/packages/google-cloud-securitycenter/test/gapic_security_center_v1beta1.ts index fe979c80a03..4170cd256e0 100644 --- a/packages/google-cloud-securitycenter/test/gapic_security_center_v1beta1.ts +++ b/packages/google-cloud-securitycenter/test/gapic_security_center_v1beta1.ts @@ -3376,6 +3376,55 @@ describe('v1beta1.SecurityCenterClient', () => { }); describe('Path templates', () => { + describe('asset', () => { + const fakePath = '/rendered/path/asset'; + const expectedParameters = { + organization: 'organizationValue', + asset: 'assetValue', + }; + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.assetPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.assetPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('assetPath', () => { + const result = client.assetPath('organizationValue', 'assetValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.assetPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchOrganizationFromAssetName', () => { + const result = client.matchOrganizationFromAssetName(fakePath); + assert.strictEqual(result, 'organizationValue'); + assert( + (client.pathTemplates.assetPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchAssetFromAssetName', () => { + const result = client.matchAssetFromAssetName(fakePath); + assert.strictEqual(result, 'assetValue'); + assert( + (client.pathTemplates.assetPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('finding', () => { const fakePath = '/rendered/path/finding'; const expectedParameters = { From 60bff1f4e58ad2b3e600e962fe8de5b02c1c20e4 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Sun, 26 Jul 2020 21:14:05 -0700 Subject: [PATCH 198/342] build: rename _toc to toc (#306) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/940354f9-15cd-4361-bbf4-dc9af1426979/targets - [ ] To automatically regenerate this PR, check this box. Source-Link: https://github.com/googleapis/synthtool/commit/99c93fe09f8c1dca09dfc0301c8668e3a70dd796 --- packages/google-cloud-securitycenter/synth.metadata | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-securitycenter/synth.metadata b/packages/google-cloud-securitycenter/synth.metadata index e1f3c83b098..86d8df7a9aa 100644 --- a/packages/google-cloud-securitycenter/synth.metadata +++ b/packages/google-cloud-securitycenter/synth.metadata @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "21f1470ecd01424dc91c70f1a7c798e4e87d1eec" + "sha": "99c93fe09f8c1dca09dfc0301c8668e3a70dd796" } } ], From 3b00071f23414597e43adc2682dbe862caf8e863 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Mon, 27 Jul 2020 12:40:54 -0700 Subject: [PATCH 199/342] build: move gitattributes files to node templates (#308) Source-Author: F. Hinkelmann Source-Date: Thu Jul 23 01:45:04 2020 -0400 Source-Repo: googleapis/synthtool Source-Sha: 3a00b7fea8c4c83eaff8eb207f530a2e3e8e1de3 Source-Link: https://github.com/googleapis/synthtool/commit/3a00b7fea8c4c83eaff8eb207f530a2e3e8e1de3 --- packages/google-cloud-securitycenter/.gitattributes | 1 + packages/google-cloud-securitycenter/synth.metadata | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-securitycenter/.gitattributes b/packages/google-cloud-securitycenter/.gitattributes index d4f4169b28b..33739cb74e4 100644 --- a/packages/google-cloud-securitycenter/.gitattributes +++ b/packages/google-cloud-securitycenter/.gitattributes @@ -1,3 +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-cloud-securitycenter/synth.metadata b/packages/google-cloud-securitycenter/synth.metadata index 86d8df7a9aa..6d380b3ec4b 100644 --- a/packages/google-cloud-securitycenter/synth.metadata +++ b/packages/google-cloud-securitycenter/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-security-center.git", - "sha": "c9e263cb969a1ef75f8e0b7a36d1a3041e2cb9f1" + "sha": "cc0475d08356219dd4b40112bb297f9b683dec5b" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "99c93fe09f8c1dca09dfc0301c8668e3a70dd796" + "sha": "3a00b7fea8c4c83eaff8eb207f530a2e3e8e1de3" } } ], From 0925ee2502af764562770d61ee848075e7f991f6 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 28 Jul 2020 16:52:07 +0000 Subject: [PATCH 200/342] chore: release 5.0.2 (#304) :robot: I have created a release \*beep\* \*boop\* --- ### [5.0.2](https://www.github.com/googleapis/nodejs-security-center/compare/v5.0.1...v5.0.2) (2020-07-27) ### Bug Fixes * add resource config to v1beta1 ([#307](https://www.github.com/googleapis/nodejs-security-center/issues/307)) ([5d99acf](https://www.github.com/googleapis/nodejs-security-center/commit/5d99acf9dea7a6e2d384ee709678365c769f3d6e)) * correct securitycenter grpc_service_configs, add Node 8 tests ([#302](https://www.github.com/googleapis/nodejs-security-center/issues/302)) ([4e4ec5b](https://www.github.com/googleapis/nodejs-security-center/commit/4e4ec5bbd9623dc952781e80da226320db3906af)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). --- packages/google-cloud-securitycenter/CHANGELOG.md | 8 ++++++++ packages/google-cloud-securitycenter/package.json | 2 +- packages/google-cloud-securitycenter/samples/package.json | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-securitycenter/CHANGELOG.md b/packages/google-cloud-securitycenter/CHANGELOG.md index f4c289384c3..1d841f8dbf0 100644 --- a/packages/google-cloud-securitycenter/CHANGELOG.md +++ b/packages/google-cloud-securitycenter/CHANGELOG.md @@ -4,6 +4,14 @@ [1]: https://www.npmjs.com/package/@google-cloud/security-center?activeTab=versions +### [5.0.2](https://www.github.com/googleapis/nodejs-security-center/compare/v5.0.1...v5.0.2) (2020-07-27) + + +### Bug Fixes + +* add resource config to v1beta1 ([#307](https://www.github.com/googleapis/nodejs-security-center/issues/307)) ([5d99acf](https://www.github.com/googleapis/nodejs-security-center/commit/5d99acf9dea7a6e2d384ee709678365c769f3d6e)) +* correct securitycenter grpc_service_configs, add Node 8 tests ([#302](https://www.github.com/googleapis/nodejs-security-center/issues/302)) ([4e4ec5b](https://www.github.com/googleapis/nodejs-security-center/commit/4e4ec5bbd9623dc952781e80da226320db3906af)) + ### [5.0.1](https://www.github.com/googleapis/nodejs-security-center/compare/v5.0.0...v5.0.1) (2020-07-06) diff --git a/packages/google-cloud-securitycenter/package.json b/packages/google-cloud-securitycenter/package.json index 07d604bb890..95bbd2f1bda 100644 --- a/packages/google-cloud-securitycenter/package.json +++ b/packages/google-cloud-securitycenter/package.json @@ -1,7 +1,7 @@ { "name": "@google-cloud/security-center", "description": "Cloud Security Command Center API client for Node.js", - "version": "5.0.1", + "version": "5.0.2", "license": "Apache-2.0", "author": "Google LLC", "engines": { diff --git a/packages/google-cloud-securitycenter/samples/package.json b/packages/google-cloud-securitycenter/samples/package.json index a91a9b9d7af..6d154f4711d 100644 --- a/packages/google-cloud-securitycenter/samples/package.json +++ b/packages/google-cloud-securitycenter/samples/package.json @@ -14,7 +14,7 @@ "license": "Apache-2.0", "dependencies": { "@google-cloud/pubsub": "^2.0.0", - "@google-cloud/security-center": "^5.0.1" + "@google-cloud/security-center": "^5.0.2" }, "devDependencies": { "chai": "^4.2.0", From 206f2aaf4409341dc1fce699fb73cbe1d6e144e9 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 30 Jul 2020 02:08:07 +0200 Subject: [PATCH 201/342] fix(deps): roll back dependency @google-cloud/security-center to ^5.0.1 (#309) --- packages/google-cloud-securitycenter/samples/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-securitycenter/samples/package.json b/packages/google-cloud-securitycenter/samples/package.json index 6d154f4711d..a91a9b9d7af 100644 --- a/packages/google-cloud-securitycenter/samples/package.json +++ b/packages/google-cloud-securitycenter/samples/package.json @@ -14,7 +14,7 @@ "license": "Apache-2.0", "dependencies": { "@google-cloud/pubsub": "^2.0.0", - "@google-cloud/security-center": "^5.0.2" + "@google-cloud/security-center": "^5.0.1" }, "devDependencies": { "chai": "^4.2.0", From f9cfae89658a03cb8ffd1e2228395e9e1056d3b9 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Thu, 30 Jul 2020 13:23:40 -0700 Subject: [PATCH 202/342] build: config for new reference docs (#312) --- packages/google-cloud-securitycenter/protos/protos.d.ts | 2 +- packages/google-cloud-securitycenter/protos/protos.js | 2 +- packages/google-cloud-securitycenter/synth.metadata | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/google-cloud-securitycenter/protos/protos.d.ts b/packages/google-cloud-securitycenter/protos/protos.d.ts index 2216b95dee9..a188014ea6c 100644 --- a/packages/google-cloud-securitycenter/protos/protos.d.ts +++ b/packages/google-cloud-securitycenter/protos/protos.d.ts @@ -13,7 +13,7 @@ // limitations under the License. import * as Long from "long"; -import * as $protobuf from "protobufjs"; +import {protobuf as $protobuf} from "google-gax"; /** Namespace google. */ export namespace google { diff --git a/packages/google-cloud-securitycenter/protos/protos.js b/packages/google-cloud-securitycenter/protos/protos.js index a40182feb79..f8987b55099 100644 --- a/packages/google-cloud-securitycenter/protos/protos.js +++ b/packages/google-cloud-securitycenter/protos/protos.js @@ -19,7 +19,7 @@ define(["protobufjs/minimal"], factory); /* CommonJS */ else if (typeof require === 'function' && typeof module === 'object' && module && module.exports) - module.exports = factory(require("protobufjs/minimal")); + module.exports = factory(require("google-gax").protobufMinimal); })(this, function($protobuf) { "use strict"; diff --git a/packages/google-cloud-securitycenter/synth.metadata b/packages/google-cloud-securitycenter/synth.metadata index 6d380b3ec4b..dc9a50b2ad4 100644 --- a/packages/google-cloud-securitycenter/synth.metadata +++ b/packages/google-cloud-securitycenter/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-security-center.git", - "sha": "cc0475d08356219dd4b40112bb297f9b683dec5b" + "sha": "f68400c4490a6887bb8578184b4737a678da47d7" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "3a00b7fea8c4c83eaff8eb207f530a2e3e8e1de3" + "sha": "89d431fb2975fc4e0ed24995a6e6dfc8ff4c24fa" } } ], From 3e7437e208fb8eaa11fcd5cb4d144a3c522b0643 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Thu, 30 Jul 2020 20:24:19 -0700 Subject: [PATCH 203/342] chore: release 5.0.3 (#310) * chore: updated samples/package.json [ci skip] * chore: updated CHANGELOG.md [ci skip] * chore: updated package.json Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> Co-authored-by: sofisl <55454395+sofisl@users.noreply.github.com> --- packages/google-cloud-securitycenter/CHANGELOG.md | 7 +++++++ packages/google-cloud-securitycenter/package.json | 2 +- packages/google-cloud-securitycenter/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-securitycenter/CHANGELOG.md b/packages/google-cloud-securitycenter/CHANGELOG.md index 1d841f8dbf0..a182ca5c3d6 100644 --- a/packages/google-cloud-securitycenter/CHANGELOG.md +++ b/packages/google-cloud-securitycenter/CHANGELOG.md @@ -4,6 +4,13 @@ [1]: https://www.npmjs.com/package/@google-cloud/security-center?activeTab=versions +### [5.0.3](https://www.github.com/googleapis/nodejs-security-center/compare/v5.0.2...v5.0.3) (2020-07-30) + + +### Bug Fixes + +* **deps:** roll back dependency @google-cloud/security-center to ^5.0.1 ([#309](https://www.github.com/googleapis/nodejs-security-center/issues/309)) ([f68400c](https://www.github.com/googleapis/nodejs-security-center/commit/f68400c4490a6887bb8578184b4737a678da47d7)) + ### [5.0.2](https://www.github.com/googleapis/nodejs-security-center/compare/v5.0.1...v5.0.2) (2020-07-27) diff --git a/packages/google-cloud-securitycenter/package.json b/packages/google-cloud-securitycenter/package.json index 95bbd2f1bda..3b00beb8386 100644 --- a/packages/google-cloud-securitycenter/package.json +++ b/packages/google-cloud-securitycenter/package.json @@ -1,7 +1,7 @@ { "name": "@google-cloud/security-center", "description": "Cloud Security Command Center API client for Node.js", - "version": "5.0.2", + "version": "5.0.3", "license": "Apache-2.0", "author": "Google LLC", "engines": { diff --git a/packages/google-cloud-securitycenter/samples/package.json b/packages/google-cloud-securitycenter/samples/package.json index a91a9b9d7af..ca07777a6d1 100644 --- a/packages/google-cloud-securitycenter/samples/package.json +++ b/packages/google-cloud-securitycenter/samples/package.json @@ -14,7 +14,7 @@ "license": "Apache-2.0", "dependencies": { "@google-cloud/pubsub": "^2.0.0", - "@google-cloud/security-center": "^5.0.1" + "@google-cloud/security-center": "^5.0.3" }, "devDependencies": { "chai": "^4.2.0", From b3873cdf4378dfae5c1ff15736a38f27891b2c9b Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Sun, 2 Aug 2020 21:54:11 -0700 Subject: [PATCH 204/342] docs: add links to the CHANGELOG from the README.md for Java and Node (#313) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/7b446397-88f3-4463-9e7d-d2ce7069989d/targets - [ ] To automatically regenerate this PR, check this box. Source-Link: https://github.com/googleapis/synthtool/commit/5936421202fb53ed4641bcb824017dd393a3dbcc --- packages/google-cloud-securitycenter/README.md | 3 +++ packages/google-cloud-securitycenter/synth.metadata | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-securitycenter/README.md b/packages/google-cloud-securitycenter/README.md index 19cbedd2b76..8e276bef3b6 100644 --- a/packages/google-cloud-securitycenter/README.md +++ b/packages/google-cloud-securitycenter/README.md @@ -22,6 +22,9 @@ systems for sensitive data, detect common web vulnerabilities, and review access to your critical resources, all from a single, centralized dashboard. +A comprehensive list of changes in each version may be found in +[the CHANGELOG](https://github.com/googleapis/nodejs-security-center/blob/master/CHANGELOG.md). + * [Google Cloud Security Command Center Node.js Client API Reference][client-docs] * [Google Cloud Security Command Center Documentation][product-docs] * [github.com/googleapis/nodejs-security-center](https://github.com/googleapis/nodejs-security-center) diff --git a/packages/google-cloud-securitycenter/synth.metadata b/packages/google-cloud-securitycenter/synth.metadata index dc9a50b2ad4..81fd2580fdf 100644 --- a/packages/google-cloud-securitycenter/synth.metadata +++ b/packages/google-cloud-securitycenter/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-security-center.git", - "sha": "f68400c4490a6887bb8578184b4737a678da47d7" + "sha": "49eec1c9a44f963d0e88378330493f718a455e55" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "89d431fb2975fc4e0ed24995a6e6dfc8ff4c24fa" + "sha": "5936421202fb53ed4641bcb824017dd393a3dbcc" } } ], From 2ad76cbc67aa91300e8048ef30a53c957cfb3143 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Mon, 10 Aug 2020 10:56:19 -0700 Subject: [PATCH 205/342] build: --credential-file-override is no longer required (#314) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/96fb0e9d-e02a-4451-878f-e646368369cc/targets - [ ] To automatically regenerate this PR, check this box. Source-Link: https://github.com/googleapis/synthtool/commit/94421c47802f56a44c320257b2b4c190dc7d6b68 --- packages/google-cloud-securitycenter/synth.metadata | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-securitycenter/synth.metadata b/packages/google-cloud-securitycenter/synth.metadata index 81fd2580fdf..2219771abfb 100644 --- a/packages/google-cloud-securitycenter/synth.metadata +++ b/packages/google-cloud-securitycenter/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-security-center.git", - "sha": "49eec1c9a44f963d0e88378330493f718a455e55" + "sha": "e622cf84b3ef324bcc789f6b050ba9076d63baa0" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "5936421202fb53ed4641bcb824017dd393a3dbcc" + "sha": "94421c47802f56a44c320257b2b4c190dc7d6b68" } } ], From 56c305badbfbc67ca0fa6d32b3314fe50f614cc7 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Thu, 13 Aug 2020 12:40:23 -0700 Subject: [PATCH 206/342] build: use gapic-generator-typescript v1.0.7. (#315) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/c36c6dbc-ab79-4f17-b70b-523b420b2a70/targets - [ ] To automatically regenerate this PR, check this box. PiperOrigin-RevId: 325949033 Source-Link: https://github.com/googleapis/googleapis/commit/94006b3cb8d2fb44703cf535da15608eed6bf7db --- .../src/v1/security_center_client.ts | 8 +++++--- .../src/v1beta1/security_center_client.ts | 8 +++++--- .../src/v1p1beta1/security_center_client.ts | 8 +++++--- packages/google-cloud-securitycenter/synth.metadata | 6 +++--- 4 files changed, 18 insertions(+), 12 deletions(-) diff --git a/packages/google-cloud-securitycenter/src/v1/security_center_client.ts b/packages/google-cloud-securitycenter/src/v1/security_center_client.ts index 18feeeffa43..94633dc7919 100644 --- a/packages/google-cloud-securitycenter/src/v1/security_center_client.ts +++ b/packages/google-cloud-securitycenter/src/v1/security_center_client.ts @@ -339,12 +339,14 @@ export class SecurityCenterClient { } ); + const descriptor = + this.descriptors.page[methodName] || + this.descriptors.longrunning[methodName] || + undefined; const apiCall = this._gaxModule.createApiCall( callPromise, this._defaults[methodName], - this.descriptors.page[methodName] || - this.descriptors.stream[methodName] || - this.descriptors.longrunning[methodName] + descriptor ); this.innerApiCalls[methodName] = apiCall; diff --git a/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.ts b/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.ts index 862a13b2df5..62c90ca93db 100644 --- a/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.ts +++ b/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.ts @@ -327,12 +327,14 @@ export class SecurityCenterClient { } ); + const descriptor = + this.descriptors.page[methodName] || + this.descriptors.longrunning[methodName] || + undefined; const apiCall = this._gaxModule.createApiCall( callPromise, this._defaults[methodName], - this.descriptors.page[methodName] || - this.descriptors.stream[methodName] || - this.descriptors.longrunning[methodName] + descriptor ); this.innerApiCalls[methodName] = apiCall; diff --git a/packages/google-cloud-securitycenter/src/v1p1beta1/security_center_client.ts b/packages/google-cloud-securitycenter/src/v1p1beta1/security_center_client.ts index 2e8e7b42e14..b3cce87d648 100644 --- a/packages/google-cloud-securitycenter/src/v1p1beta1/security_center_client.ts +++ b/packages/google-cloud-securitycenter/src/v1p1beta1/security_center_client.ts @@ -340,12 +340,14 @@ export class SecurityCenterClient { } ); + const descriptor = + this.descriptors.page[methodName] || + this.descriptors.longrunning[methodName] || + undefined; const apiCall = this._gaxModule.createApiCall( callPromise, this._defaults[methodName], - this.descriptors.page[methodName] || - this.descriptors.stream[methodName] || - this.descriptors.longrunning[methodName] + descriptor ); this.innerApiCalls[methodName] = apiCall; diff --git a/packages/google-cloud-securitycenter/synth.metadata b/packages/google-cloud-securitycenter/synth.metadata index 2219771abfb..89ef817f54e 100644 --- a/packages/google-cloud-securitycenter/synth.metadata +++ b/packages/google-cloud-securitycenter/synth.metadata @@ -4,15 +4,15 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-security-center.git", - "sha": "e622cf84b3ef324bcc789f6b050ba9076d63baa0" + "sha": "fa72ab5a4bab1aa8add1f685d131005a866b5789" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "e26e1839a45445d13cd45b1be3b1523defb72fee", - "internalRef": "322867095" + "sha": "94006b3cb8d2fb44703cf535da15608eed6bf7db", + "internalRef": "325949033" } }, { From 99d461d7a58a036146d1be073d1a6165cf1981e4 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Fri, 14 Aug 2020 09:20:30 -0700 Subject: [PATCH 207/342] feat: added field severity to findings (#317) Clients will now see a new field, severity, on findings. They will also be able to filter and group by severity on ListFinding and GroupFinding API calls. PiperOrigin-RevId: 326514554 Source-Author: Google APIs Source-Date: Thu Aug 13 13:43:22 2020 -0700 Source-Repo: googleapis/googleapis Source-Sha: 5ad09e867a8f1faa19fbd674e51fa9c3f5fe2770 Source-Link: https://github.com/googleapis/googleapis/commit/5ad09e867a8f1faa19fbd674e51fa9c3f5fe2770 --- .../securitycenter/v1p1beta1/finding.proto | 21 ++++ .../v1p1beta1/securitycenter_service.proto | 111 +++++++----------- .../protos/protos.d.ts | 15 +++ .../protos/protos.js | 70 +++++++++++ .../protos/protos.json | 28 +++-- .../src/v1p1beta1/security_center_client.ts | 99 +++++++--------- .../synth.metadata | 6 +- 7 files changed, 214 insertions(+), 136 deletions(-) diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/finding.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/finding.proto index 21b655362d2..75f52dfe9ed 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/finding.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/finding.proto @@ -55,6 +55,24 @@ message Finding { INACTIVE = 2; } + // The severity of the finding. + enum Severity { + // No severity specified. The default value. + SEVERITY_UNSPECIFIED = 0; + + // Critical severity. + CRITICAL = 1; + + // High severity. + HIGH = 2; + + // Medium severity. + MEDIUM = 3; + + // Low severity. + LOW = 4; + } + // The relative resource name of this finding. See: // https://cloud.google.com/apis/design/resource_names#relative_resource_name // Example: @@ -107,4 +125,7 @@ message Finding { // The time at which the finding was created in Security Command Center. google.protobuf.Timestamp create_time = 10; + + // The severity of the finding. + Severity severity = 13; } diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/securitycenter_service.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/securitycenter_service.proto index c4264a6a21d..69d864c6c1d 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/securitycenter_service.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/securitycenter_service.proto @@ -17,7 +17,6 @@ syntax = "proto3"; package google.cloud.securitycenter.v1p1beta1; import public "google/cloud/securitycenter/v1p1beta1/run_asset_discovery_response.proto"; - import "google/api/annotations.proto"; import "google/api/client.proto"; import "google/api/field_behavior.proto"; @@ -47,8 +46,7 @@ option ruby_package = "Google::Cloud::SecurityCenter::V1p1beta1"; // V1p1Beta1 APIs for Security Center service. service SecurityCenter { option (google.api.default_host) = "securitycenter.googleapis.com"; - option (google.api.oauth_scopes) = - "https://www.googleapis.com/auth/cloud-platform"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; // Creates a source. rpc CreateSource(CreateSourceRequest) returns (Source) { @@ -59,7 +57,6 @@ service SecurityCenter { option (google.api.method_signature) = "parent,source"; } - // // Creates a finding. The corresponding source must exist for finding // creation to succeed. rpc CreateFinding(CreateFindingRequest) returns (Finding) { @@ -72,20 +69,17 @@ service SecurityCenter { } // Creates a notification config. - rpc CreateNotificationConfig(CreateNotificationConfigRequest) - returns (NotificationConfig) { + rpc CreateNotificationConfig(CreateNotificationConfigRequest) returns (NotificationConfig) { option (google.api.http) = { post: "/v1p1beta1/{parent=organizations/*}/notificationConfigs" body: "notification_config" }; - option (google.api.method_signature) = - "parent,config_id,notification_config"; + option (google.api.method_signature) = "parent,config_id,notification_config"; option (google.api.method_signature) = "parent,notification_config"; } // Deletes a notification config. - rpc DeleteNotificationConfig(DeleteNotificationConfigRequest) - returns (google.protobuf.Empty) { + rpc DeleteNotificationConfig(DeleteNotificationConfigRequest) returns (google.protobuf.Empty) { option (google.api.http) = { delete: "/v1p1beta1/{name=organizations/*/notificationConfigs/*}" }; @@ -93,8 +87,7 @@ service SecurityCenter { } // Gets the access control policy on the specified Source. - rpc GetIamPolicy(google.iam.v1.GetIamPolicyRequest) - returns (google.iam.v1.Policy) { + rpc GetIamPolicy(google.iam.v1.GetIamPolicyRequest) returns (google.iam.v1.Policy) { option (google.api.http) = { post: "/v1p1beta1/{resource=organizations/*/sources/*}:getIamPolicy" body: "*" @@ -103,8 +96,7 @@ service SecurityCenter { } // Gets a notification config. - rpc GetNotificationConfig(GetNotificationConfigRequest) - returns (NotificationConfig) { + rpc GetNotificationConfig(GetNotificationConfigRequest) returns (NotificationConfig) { option (google.api.http) = { get: "/v1p1beta1/{name=organizations/*/notificationConfigs/*}" }; @@ -112,8 +104,7 @@ service SecurityCenter { } // Gets the settings for an organization. - rpc GetOrganizationSettings(GetOrganizationSettingsRequest) - returns (OrganizationSettings) { + rpc GetOrganizationSettings(GetOrganizationSettingsRequest) returns (OrganizationSettings) { option (google.api.http) = { get: "/v1p1beta1/{name=organizations/*/organizationSettings}" }; @@ -170,8 +161,7 @@ service SecurityCenter { } // Lists notification configs. - rpc ListNotificationConfigs(ListNotificationConfigsRequest) - returns (ListNotificationConfigsResponse) { + rpc ListNotificationConfigs(ListNotificationConfigsRequest) returns (ListNotificationConfigsResponse) { option (google.api.http) = { get: "/v1p1beta1/{parent=organizations/*}/notificationConfigs" }; @@ -192,8 +182,7 @@ service SecurityCenter { // This API can only be called with limited frequency for an organization. If // it is called too frequently the caller will receive a TOO_MANY_REQUESTS // error. - rpc RunAssetDiscovery(RunAssetDiscoveryRequest) - returns (google.longrunning.Operation) { + rpc RunAssetDiscovery(RunAssetDiscoveryRequest) returns (google.longrunning.Operation) { option (google.api.http) = { post: "/v1p1beta1/{parent=organizations/*}/assets:runDiscovery" body: "*" @@ -205,7 +194,6 @@ service SecurityCenter { }; } - // // Updates the state of a finding. rpc SetFindingState(SetFindingStateRequest) returns (Finding) { option (google.api.http) = { @@ -216,8 +204,7 @@ service SecurityCenter { } // Sets the access control policy on the specified Source. - rpc SetIamPolicy(google.iam.v1.SetIamPolicyRequest) - returns (google.iam.v1.Policy) { + rpc SetIamPolicy(google.iam.v1.SetIamPolicyRequest) returns (google.iam.v1.Policy) { option (google.api.http) = { post: "/v1p1beta1/{resource=organizations/*/sources/*}:setIamPolicy" body: "*" @@ -226,8 +213,7 @@ service SecurityCenter { } // Returns the permissions that a caller has on the specified source. - rpc TestIamPermissions(google.iam.v1.TestIamPermissionsRequest) - returns (google.iam.v1.TestIamPermissionsResponse) { + rpc TestIamPermissions(google.iam.v1.TestIamPermissionsRequest) returns (google.iam.v1.TestIamPermissionsResponse) { option (google.api.http) = { post: "/v1p1beta1/{resource=organizations/*/sources/*}:testIamPermissions" body: "*" @@ -248,8 +234,7 @@ service SecurityCenter { // Updates a notification config. The following update // fields are allowed: description, pubsub_topic, streaming_config.filter - rpc UpdateNotificationConfig(UpdateNotificationConfigRequest) - returns (NotificationConfig) { + rpc UpdateNotificationConfig(UpdateNotificationConfigRequest) returns (NotificationConfig) { option (google.api.http) = { patch: "/v1p1beta1/{notification_config.name=organizations/*/notificationConfigs/*}" body: "notification_config" @@ -259,8 +244,7 @@ service SecurityCenter { } // Updates an organization's settings. - rpc UpdateOrganizationSettings(UpdateOrganizationSettingsRequest) - returns (OrganizationSettings) { + rpc UpdateOrganizationSettings(UpdateOrganizationSettingsRequest) returns (OrganizationSettings) { option (google.api.http) = { patch: "/v1p1beta1/{organization_settings.name=organizations/*/organizationSettings}" body: "organization_settings" @@ -305,19 +289,17 @@ message CreateFindingRequest { ]; // Required. Unique identifier provided by the client within the parent scope. - // It must be alphanumeric and less than or equal to 32 characters and - // greater than 0 characters in length. string finding_id = 2 [(google.api.field_behavior) = REQUIRED]; - // Required. The Finding being created. The name and security_marks will be - // ignored as they are both output only fields on this resource. + // Required. The Finding being created. The name and security_marks will be ignored as + // they are both output only fields on this resource. Finding finding = 3 [(google.api.field_behavior) = REQUIRED]; } // Request message for creating a notification config. message CreateNotificationConfigRequest { - // Required. Resource name of the new notification config's parent. Its format - // is "organizations/[organization_id]". + // Required. Resource name of the new notification config's parent. Its format is + // "organizations/[organization_id]". string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -331,11 +313,9 @@ message CreateNotificationConfigRequest { // characters, underscores or hyphens only. string config_id = 2 [(google.api.field_behavior) = REQUIRED]; - // Required. The notification config being created. The name and the service - // account will be ignored as they are both output only fields on this - // resource. - NotificationConfig notification_config = 3 - [(google.api.field_behavior) = REQUIRED]; + // Required. The notification config being created. The name and the service account + // will be ignored as they are both output only fields on this resource. + NotificationConfig notification_config = 3 [(google.api.field_behavior) = REQUIRED]; } // Request message for creating a source. @@ -349,8 +329,8 @@ message CreateSourceRequest { } ]; - // Required. The Source being created, only the display_name and description - // will be used. All other fields will be ignored. + // Required. The Source being created, only the display_name and description will be + // used. All other fields will be ignored. Source source = 2 [(google.api.field_behavior) = REQUIRED]; } @@ -380,8 +360,8 @@ message GetNotificationConfigRequest { // Request message for getting organization settings. message GetOrganizationSettingsRequest { - // Required. Name of the organization to get organization settings for. Its - // format is "organizations/[organization_id]/organizationSettings". + // Required. Name of the organization to get organization settings for. Its format is + // "organizations/[organization_id]/organizationSettings". string name = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -477,9 +457,9 @@ message GroupAssetsRequest { // property not existing: `-resource_properties.my_property : ""` string filter = 2; - // Required. Expression that defines what assets fields to use for grouping. - // The string value should follow SQL syntax: comma separated list of fields. - // For example: + // Required. Expression that defines what assets fields to use for grouping. The string + // value should follow SQL syntax: comma separated list of fields. For + // example: // "security_center_properties.resource_project,security_center_properties.project". // // The following fields are supported when compare_duration is not set: @@ -624,9 +604,9 @@ message GroupFindingsRequest { // property not existing: `-source_properties.my_property : ""` string filter = 2; - // Required. Expression that defines what assets fields to use for grouping - // (including `state_change`). The string value should follow SQL syntax: - // comma separated list of fields. For example: "parent,resource_name". + // Required. Expression that defines what assets fields to use for grouping (including + // `state_change`). The string value should follow SQL syntax: comma separated + // list of fields. For example: "parent,resource_name". // // The following fields are supported: // @@ -750,8 +730,8 @@ message ListNotificationConfigsResponse { // Request message for listing sources. message ListSourcesRequest { - // Required. Resource name of the parent of sources to list. Its format should - // be "organizations/[organization_id]". + // Required. Resource name of the parent of sources to list. Its format should be + // "organizations/[organization_id]". string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -909,12 +889,10 @@ message ListAssetsRequest { // read_time. google.protobuf.Duration compare_duration = 5; - // Optional. // A field mask to specify the ListAssetsResult fields to be listed in the // response. // An empty field mask will list all fields. - google.protobuf.FieldMask field_mask = 7 - [(google.api.field_behavior) = OPTIONAL]; + google.protobuf.FieldMask field_mask = 7; // The value returned by the last `ListAssetsResponse`; indicates // that this is a continuation of a prior `ListAssets` call, and @@ -1093,11 +1071,9 @@ message ListFindingsRequest { // read_time. google.protobuf.Duration compare_duration = 5; - // Optional. // A field mask to specify the Finding fields to be listed in the response. // An empty field mask will list all fields. - google.protobuf.FieldMask field_mask = 7 - [(google.api.field_behavior) = OPTIONAL]; + google.protobuf.FieldMask field_mask = 7; // The value returned by the last `ListFindingsResponse`; indicates // that this is a continuation of a prior `ListFindings` call, and @@ -1168,7 +1144,7 @@ message ListFindingsResponse { StateChange state_change = 2; // Output only. Resource that is associated with this finding. - Resource resource = 3; + Resource resource = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; } // Findings matching the list request. @@ -1202,14 +1178,13 @@ message SetFindingStateRequest { Finding.State state = 2 [(google.api.field_behavior) = REQUIRED]; // Required. The time at which the updated state takes effect. - google.protobuf.Timestamp start_time = 3 - [(google.api.field_behavior) = REQUIRED]; + google.protobuf.Timestamp start_time = 3 [(google.api.field_behavior) = REQUIRED]; } // Request message for running asset discovery for an organization. message RunAssetDiscoveryRequest { - // Required. Name of the organization to run asset discovery for. Its format - // is "organizations/[organization_id]". + // Required. Name of the organization to run asset discovery for. Its format is + // "organizations/[organization_id]". string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -1220,8 +1195,8 @@ message RunAssetDiscoveryRequest { // Request message for updating or creating a finding. message UpdateFindingRequest { - // Required. The finding resource to update or create if it does not already - // exist. parent, security_marks, and update_time will be ignored. + // Required. The finding resource to update or create if it does not already exist. + // parent, security_marks, and update_time will be ignored. // // In the case of creation, the finding id portion of the name must be // alphanumeric and less than or equal to 32 characters and greater than 0 @@ -1241,8 +1216,7 @@ message UpdateFindingRequest { // Request message for updating a notification config. message UpdateNotificationConfigRequest { // Required. The notification config to update. - NotificationConfig notification_config = 1 - [(google.api.field_behavior) = REQUIRED]; + NotificationConfig notification_config = 1 [(google.api.field_behavior) = REQUIRED]; // The FieldMask to use when updating the notification config. // @@ -1253,8 +1227,7 @@ message UpdateNotificationConfigRequest { // Request message for updating an organization's settings. message UpdateOrganizationSettingsRequest { // Required. The organization settings resource to update. - OrganizationSettings organization_settings = 1 - [(google.api.field_behavior) = REQUIRED]; + OrganizationSettings organization_settings = 1 [(google.api.field_behavior) = REQUIRED]; // The FieldMask to use when updating the settings resource. // diff --git a/packages/google-cloud-securitycenter/protos/protos.d.ts b/packages/google-cloud-securitycenter/protos/protos.d.ts index a188014ea6c..64113be92e6 100644 --- a/packages/google-cloud-securitycenter/protos/protos.d.ts +++ b/packages/google-cloud-securitycenter/protos/protos.d.ts @@ -9187,6 +9187,9 @@ export namespace google { /** Finding createTime */ createTime?: (google.protobuf.ITimestamp|null); + + /** Finding severity */ + severity?: (google.cloud.securitycenter.v1p1beta1.Finding.Severity|keyof typeof google.cloud.securitycenter.v1p1beta1.Finding.Severity|null); } /** Represents a Finding. */ @@ -9228,6 +9231,9 @@ export namespace google { /** Finding createTime. */ public createTime?: (google.protobuf.ITimestamp|null); + /** Finding severity. */ + public severity: (google.cloud.securitycenter.v1p1beta1.Finding.Severity|keyof typeof google.cloud.securitycenter.v1p1beta1.Finding.Severity); + /** * Creates a new Finding instance using the specified properties. * @param [properties] Properties to set @@ -9307,6 +9313,15 @@ export namespace google { ACTIVE = 1, INACTIVE = 2 } + + /** Severity enum. */ + enum Severity { + SEVERITY_UNSPECIFIED = 0, + CRITICAL = 1, + HIGH = 2, + MEDIUM = 3, + LOW = 4 + } } /** Properties of a NotificationConfig. */ diff --git a/packages/google-cloud-securitycenter/protos/protos.js b/packages/google-cloud-securitycenter/protos/protos.js index f8987b55099..2355fb81e53 100644 --- a/packages/google-cloud-securitycenter/protos/protos.js +++ b/packages/google-cloud-securitycenter/protos/protos.js @@ -21823,6 +21823,7 @@ * @property {google.cloud.securitycenter.v1p1beta1.ISecurityMarks|null} [securityMarks] Finding securityMarks * @property {google.protobuf.ITimestamp|null} [eventTime] Finding eventTime * @property {google.protobuf.ITimestamp|null} [createTime] Finding createTime + * @property {google.cloud.securitycenter.v1p1beta1.Finding.Severity|null} [severity] Finding severity */ /** @@ -21921,6 +21922,14 @@ */ Finding.prototype.createTime = null; + /** + * Finding severity. + * @member {google.cloud.securitycenter.v1p1beta1.Finding.Severity} severity + * @memberof google.cloud.securitycenter.v1p1beta1.Finding + * @instance + */ + Finding.prototype.severity = 0; + /** * Creates a new Finding instance using the specified properties. * @function create @@ -21968,6 +21977,8 @@ $root.google.protobuf.Timestamp.encode(message.eventTime, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.severity != null && Object.hasOwnProperty.call(message, "severity")) + writer.uint32(/* id 13, wireType 0 =*/104).int32(message.severity); return writer; }; @@ -22051,6 +22062,9 @@ case 10: message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; + case 13: + message.severity = reader.int32(); + break; default: reader.skipType(tag & 7); break; @@ -22135,6 +22149,17 @@ if (error) return "createTime." + error; } + if (message.severity != null && message.hasOwnProperty("severity")) + switch (message.severity) { + default: + return "severity: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } return null; }; @@ -22199,6 +22224,28 @@ throw TypeError(".google.cloud.securitycenter.v1p1beta1.Finding.createTime: object expected"); message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); } + switch (object.severity) { + case "SEVERITY_UNSPECIFIED": + case 0: + message.severity = 0; + break; + case "CRITICAL": + case 1: + message.severity = 1; + break; + case "HIGH": + case 2: + message.severity = 2; + break; + case "MEDIUM": + case 3: + message.severity = 3; + break; + case "LOW": + case 4: + message.severity = 4; + break; + } return message; }; @@ -22227,6 +22274,7 @@ object.securityMarks = null; object.eventTime = null; object.createTime = null; + object.severity = options.enums === String ? "SEVERITY_UNSPECIFIED" : 0; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -22252,6 +22300,8 @@ object.eventTime = $root.google.protobuf.Timestamp.toObject(message.eventTime, options); if (message.createTime != null && message.hasOwnProperty("createTime")) object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.severity != null && message.hasOwnProperty("severity")) + object.severity = options.enums === String ? $root.google.cloud.securitycenter.v1p1beta1.Finding.Severity[message.severity] : message.severity; return object; }; @@ -22282,6 +22332,26 @@ return values; })(); + /** + * Severity enum. + * @name google.cloud.securitycenter.v1p1beta1.Finding.Severity + * @enum {number} + * @property {number} SEVERITY_UNSPECIFIED=0 SEVERITY_UNSPECIFIED value + * @property {number} CRITICAL=1 CRITICAL value + * @property {number} HIGH=2 HIGH value + * @property {number} MEDIUM=3 MEDIUM value + * @property {number} LOW=4 LOW value + */ + Finding.Severity = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SEVERITY_UNSPECIFIED"] = 0; + values[valuesById[1] = "CRITICAL"] = 1; + values[valuesById[2] = "HIGH"] = 2; + values[valuesById[3] = "MEDIUM"] = 3; + values[valuesById[4] = "LOW"] = 4; + return values; + })(); + return Finding; })(); diff --git a/packages/google-cloud-securitycenter/protos/protos.json b/packages/google-cloud-securitycenter/protos/protos.json index 6b2486ba1a1..1ad6f5ef027 100644 --- a/packages/google-cloud-securitycenter/protos/protos.json +++ b/packages/google-cloud-securitycenter/protos/protos.json @@ -2257,6 +2257,10 @@ "createTime": { "type": "google.protobuf.Timestamp", "id": 10 + }, + "severity": { + "type": "Severity", + "id": 13 } }, "nested": { @@ -2266,6 +2270,15 @@ "ACTIVE": 1, "INACTIVE": 2 } + }, + "Severity": { + "values": { + "SEVERITY_UNSPECIFIED": 0, + "CRITICAL": 1, + "HIGH": 2, + "MEDIUM": 3, + "LOW": 4 + } } } }, @@ -2999,10 +3012,7 @@ }, "fieldMask": { "type": "google.protobuf.FieldMask", - "id": 7, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } + "id": 7 }, "pageToken": { "type": "string", @@ -3087,10 +3097,7 @@ }, "fieldMask": { "type": "google.protobuf.FieldMask", - "id": 7, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } + "id": 7 }, "pageToken": { "type": "string", @@ -3135,7 +3142,10 @@ }, "resource": { "type": "Resource", - "id": 3 + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } } }, "nested": { diff --git a/packages/google-cloud-securitycenter/src/v1p1beta1/security_center_client.ts b/packages/google-cloud-securitycenter/src/v1p1beta1/security_center_client.ts index b3cce87d648..f50ff04a249 100644 --- a/packages/google-cloud-securitycenter/src/v1p1beta1/security_center_client.ts +++ b/packages/google-cloud-securitycenter/src/v1p1beta1/security_center_client.ts @@ -449,8 +449,8 @@ export class SecurityCenterClient { * Required. Resource name of the new source's parent. Its format should be * "organizations/[organization_id]". * @param {google.cloud.securitycenter.v1p1beta1.Source} request.source - * Required. The Source being created, only the display_name and description - * will be used. All other fields will be ignored. + * Required. The Source being created, only the display_name and description will be + * used. All other fields will be ignored. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -539,7 +539,6 @@ export class SecurityCenterClient { > ): void; /** - * * Creates a finding. The corresponding source must exist for finding * creation to succeed. * @@ -550,11 +549,9 @@ export class SecurityCenterClient { * "organizations/[organization_id]/sources/[source_id]". * @param {string} request.findingId * Required. Unique identifier provided by the client within the parent scope. - * It must be alphanumeric and less than or equal to 32 characters and - * greater than 0 characters in length. * @param {google.cloud.securitycenter.v1p1beta1.Finding} request.finding - * Required. The Finding being created. The name and security_marks will be - * ignored as they are both output only fields on this resource. + * Required. The Finding being created. The name and security_marks will be ignored as + * they are both output only fields on this resource. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -648,17 +645,16 @@ export class SecurityCenterClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. Resource name of the new notification config's parent. Its format - * is "organizations/[organization_id]". + * Required. Resource name of the new notification config's parent. Its format is + * "organizations/[organization_id]". * @param {string} request.configId * Required. * Unique identifier provided by the client within the parent scope. * It must be between 1 and 128 characters, and contains alphanumeric * characters, underscores or hyphens only. * @param {google.cloud.securitycenter.v1p1beta1.NotificationConfig} request.notificationConfig - * Required. The notification config being created. The name and the service - * account will be ignored as they are both output only fields on this - * resource. + * Required. The notification config being created. The name and the service account + * will be ignored as they are both output only fields on this resource. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -1034,8 +1030,8 @@ export class SecurityCenterClient { * @param {Object} request * The request object that will be sent. * @param {string} request.name - * Required. Name of the organization to get organization settings for. Its - * format is "organizations/[organization_id]/organizationSettings". + * Required. Name of the organization to get organization settings for. Its format is + * "organizations/[organization_id]/organizationSettings". * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -1223,7 +1219,6 @@ export class SecurityCenterClient { > ): void; /** - * * Updates the state of a finding. * * @param {Object} request @@ -1503,8 +1498,8 @@ export class SecurityCenterClient { * @param {Object} request * The request object that will be sent. * @param {google.cloud.securitycenter.v1p1beta1.Finding} request.finding - * Required. The finding resource to update or create if it does not already - * exist. parent, security_marks, and update_time will be ignored. + * Required. The finding resource to update or create if it does not already exist. + * parent, security_marks, and update_time will be ignored. * * In the case of creation, the finding id portion of the name must be * alphanumeric and less than or equal to 32 characters and greater than 0 @@ -2025,8 +2020,8 @@ export class SecurityCenterClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. Name of the organization to run asset discovery for. Its format - * is "organizations/[organization_id]". + * Required. Name of the organization to run asset discovery for. Its format is + * "organizations/[organization_id]". * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -2222,9 +2217,9 @@ export class SecurityCenterClient { * Use a negated partial match on the empty string to filter based on a * property not existing: `-resource_properties.my_property : ""` * @param {string} request.groupBy - * Required. Expression that defines what assets fields to use for grouping. - * The string value should follow SQL syntax: comma separated list of fields. - * For example: + * Required. Expression that defines what assets fields to use for grouping. The string + * value should follow SQL syntax: comma separated list of fields. For + * example: * "security_center_properties.resource_project,security_center_properties.project". * * The following fields are supported when compare_duration is not set: @@ -2425,9 +2420,9 @@ export class SecurityCenterClient { * Use a negated partial match on the empty string to filter based on a * property not existing: `-resource_properties.my_property : ""` * @param {string} request.groupBy - * Required. Expression that defines what assets fields to use for grouping. - * The string value should follow SQL syntax: comma separated list of fields. - * For example: + * Required. Expression that defines what assets fields to use for grouping. The string + * value should follow SQL syntax: comma separated list of fields. For + * example: * "security_center_properties.resource_project,security_center_properties.project". * * The following fields are supported when compare_duration is not set: @@ -2584,9 +2579,9 @@ export class SecurityCenterClient { * Use a negated partial match on the empty string to filter based on a * property not existing: `-resource_properties.my_property : ""` * @param {string} request.groupBy - * Required. Expression that defines what assets fields to use for grouping. - * The string value should follow SQL syntax: comma separated list of fields. - * For example: + * Required. Expression that defines what assets fields to use for grouping. The string + * value should follow SQL syntax: comma separated list of fields. For + * example: * "security_center_properties.resource_project,security_center_properties.project". * * The following fields are supported when compare_duration is not set: @@ -2767,9 +2762,9 @@ export class SecurityCenterClient { * Use a negated partial match on the empty string to filter based on a * property not existing: `-source_properties.my_property : ""` * @param {string} request.groupBy - * Required. Expression that defines what assets fields to use for grouping - * (including `state_change`). The string value should follow SQL syntax: - * comma separated list of fields. For example: "parent,resource_name". + * Required. Expression that defines what assets fields to use for grouping (including + * `state_change`). The string value should follow SQL syntax: comma separated + * list of fields. For example: "parent,resource_name". * * The following fields are supported: * @@ -2960,9 +2955,9 @@ export class SecurityCenterClient { * Use a negated partial match on the empty string to filter based on a * property not existing: `-source_properties.my_property : ""` * @param {string} request.groupBy - * Required. Expression that defines what assets fields to use for grouping - * (including `state_change`). The string value should follow SQL syntax: - * comma separated list of fields. For example: "parent,resource_name". + * Required. Expression that defines what assets fields to use for grouping (including + * `state_change`). The string value should follow SQL syntax: comma separated + * list of fields. For example: "parent,resource_name". * * The following fields are supported: * @@ -3109,9 +3104,9 @@ export class SecurityCenterClient { * Use a negated partial match on the empty string to filter based on a * property not existing: `-source_properties.my_property : ""` * @param {string} request.groupBy - * Required. Expression that defines what assets fields to use for grouping - * (including `state_change`). The string value should follow SQL syntax: - * comma separated list of fields. For example: "parent,resource_name". + * Required. Expression that defines what assets fields to use for grouping (including + * `state_change`). The string value should follow SQL syntax: comma separated + * list of fields. For example: "parent,resource_name". * * The following fields are supported: * @@ -3351,8 +3346,7 @@ export class SecurityCenterClient { * If compare_duration is not specified, then the only possible state_change * is "UNUSED", which will be the state_change set for all assets present at * read_time. - * @param {google.protobuf.FieldMask} [request.fieldMask] - * Optional. + * @param {google.protobuf.FieldMask} request.fieldMask * A field mask to specify the ListAssetsResult fields to be listed in the * response. * An empty field mask will list all fields. @@ -3559,8 +3553,7 @@ export class SecurityCenterClient { * If compare_duration is not specified, then the only possible state_change * is "UNUSED", which will be the state_change set for all assets present at * read_time. - * @param {google.protobuf.FieldMask} [request.fieldMask] - * Optional. + * @param {google.protobuf.FieldMask} request.fieldMask * A field mask to specify the ListAssetsResult fields to be listed in the * response. * An empty field mask will list all fields. @@ -3723,8 +3716,7 @@ export class SecurityCenterClient { * If compare_duration is not specified, then the only possible state_change * is "UNUSED", which will be the state_change set for all assets present at * read_time. - * @param {google.protobuf.FieldMask} [request.fieldMask] - * Optional. + * @param {google.protobuf.FieldMask} request.fieldMask * A field mask to specify the ListAssetsResult fields to be listed in the * response. * An empty field mask will list all fields. @@ -3915,8 +3907,7 @@ export class SecurityCenterClient { * If compare_duration is not specified, then the only possible state_change * is "UNUSED", which will be the state_change set for all findings present at * read_time. - * @param {google.protobuf.FieldMask} [request.fieldMask] - * Optional. + * @param {google.protobuf.FieldMask} request.fieldMask * A field mask to specify the Finding fields to be listed in the response. * An empty field mask will list all fields. * @param {string} request.pageToken @@ -4114,8 +4105,7 @@ export class SecurityCenterClient { * If compare_duration is not specified, then the only possible state_change * is "UNUSED", which will be the state_change set for all findings present at * read_time. - * @param {google.protobuf.FieldMask} [request.fieldMask] - * Optional. + * @param {google.protobuf.FieldMask} request.fieldMask * A field mask to specify the Finding fields to be listed in the response. * An empty field mask will list all fields. * @param {string} request.pageToken @@ -4269,8 +4259,7 @@ export class SecurityCenterClient { * If compare_duration is not specified, then the only possible state_change * is "UNUSED", which will be the state_change set for all findings present at * read_time. - * @param {google.protobuf.FieldMask} [request.fieldMask] - * Optional. + * @param {google.protobuf.FieldMask} request.fieldMask * A field mask to specify the Finding fields to be listed in the response. * An empty field mask will list all fields. * @param {string} request.pageToken @@ -4561,8 +4550,8 @@ export class SecurityCenterClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. Resource name of the parent of sources to list. Its format should - * be "organizations/[organization_id]". + * Required. Resource name of the parent of sources to list. Its format should be + * "organizations/[organization_id]". * @param {string} request.pageToken * The value returned by the last `ListSourcesResponse`; indicates * that this is a continuation of a prior `ListSources` call, and @@ -4649,8 +4638,8 @@ export class SecurityCenterClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. Resource name of the parent of sources to list. Its format should - * be "organizations/[organization_id]". + * Required. Resource name of the parent of sources to list. Its format should be + * "organizations/[organization_id]". * @param {string} request.pageToken * The value returned by the last `ListSourcesResponse`; indicates * that this is a continuation of a prior `ListSources` call, and @@ -4693,8 +4682,8 @@ export class SecurityCenterClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. Resource name of the parent of sources to list. Its format should - * be "organizations/[organization_id]". + * Required. Resource name of the parent of sources to list. Its format should be + * "organizations/[organization_id]". * @param {string} request.pageToken * The value returned by the last `ListSourcesResponse`; indicates * that this is a continuation of a prior `ListSources` call, and diff --git a/packages/google-cloud-securitycenter/synth.metadata b/packages/google-cloud-securitycenter/synth.metadata index 89ef817f54e..5d1c0be757a 100644 --- a/packages/google-cloud-securitycenter/synth.metadata +++ b/packages/google-cloud-securitycenter/synth.metadata @@ -4,15 +4,15 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-security-center.git", - "sha": "fa72ab5a4bab1aa8add1f685d131005a866b5789" + "sha": "98d6d8a1a8747748aa775394c87b7cdef6d45285" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "94006b3cb8d2fb44703cf535da15608eed6bf7db", - "internalRef": "325949033" + "sha": "5ad09e867a8f1faa19fbd674e51fa9c3f5fe2770", + "internalRef": "326514554" } }, { From d8bd42397309ebb5083a1c4290d4588b0803ecad Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Fri, 14 Aug 2020 10:06:31 -0700 Subject: [PATCH 208/342] chore: release 5.1.0 (#318) * chore: updated samples/package.json [ci skip] * chore: updated CHANGELOG.md [ci skip] * chore: updated package.json Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- packages/google-cloud-securitycenter/CHANGELOG.md | 7 +++++++ packages/google-cloud-securitycenter/package.json | 2 +- packages/google-cloud-securitycenter/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-securitycenter/CHANGELOG.md b/packages/google-cloud-securitycenter/CHANGELOG.md index a182ca5c3d6..0f8d3730c35 100644 --- a/packages/google-cloud-securitycenter/CHANGELOG.md +++ b/packages/google-cloud-securitycenter/CHANGELOG.md @@ -4,6 +4,13 @@ [1]: https://www.npmjs.com/package/@google-cloud/security-center?activeTab=versions +## [5.1.0](https://www.github.com/googleapis/nodejs-security-center/compare/v5.0.3...v5.1.0) (2020-08-14) + + +### Features + +* added field severity to findings ([#317](https://www.github.com/googleapis/nodejs-security-center/issues/317)) ([155a14a](https://www.github.com/googleapis/nodejs-security-center/commit/155a14a714304be6916452c32aee833aa5fe4230)) + ### [5.0.3](https://www.github.com/googleapis/nodejs-security-center/compare/v5.0.2...v5.0.3) (2020-07-30) diff --git a/packages/google-cloud-securitycenter/package.json b/packages/google-cloud-securitycenter/package.json index 3b00beb8386..4d801c57e6b 100644 --- a/packages/google-cloud-securitycenter/package.json +++ b/packages/google-cloud-securitycenter/package.json @@ -1,7 +1,7 @@ { "name": "@google-cloud/security-center", "description": "Cloud Security Command Center API client for Node.js", - "version": "5.0.3", + "version": "5.1.0", "license": "Apache-2.0", "author": "Google LLC", "engines": { diff --git a/packages/google-cloud-securitycenter/samples/package.json b/packages/google-cloud-securitycenter/samples/package.json index ca07777a6d1..92eb9a5ddec 100644 --- a/packages/google-cloud-securitycenter/samples/package.json +++ b/packages/google-cloud-securitycenter/samples/package.json @@ -14,7 +14,7 @@ "license": "Apache-2.0", "dependencies": { "@google-cloud/pubsub": "^2.0.0", - "@google-cloud/security-center": "^5.0.3" + "@google-cloud/security-center": "^5.1.0" }, "devDependencies": { "chai": "^4.2.0", From d571017a8ae9f43e68d47eaf6785987e8d778d87 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Fri, 14 Aug 2020 10:26:06 -0700 Subject: [PATCH 209/342] build: perform publish using Node 12, update cloud rad kokoro build job (#316) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/c36c6dbc-ab79-4f17-b70b-523b420b2a70/targets - [ ] To automatically regenerate this PR, check this box. Source-Link: https://github.com/googleapis/synthtool/commit/5747555f7620113d9a2078a48f4c047a99d31b3e Source-Link: https://github.com/googleapis/synthtool/commit/bd0deaa1113b588d70449535ab9cbf0f2bd0e72f --- packages/google-cloud-securitycenter/synth.metadata | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-securitycenter/synth.metadata b/packages/google-cloud-securitycenter/synth.metadata index 5d1c0be757a..f2cf8351f87 100644 --- a/packages/google-cloud-securitycenter/synth.metadata +++ b/packages/google-cloud-securitycenter/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-security-center.git", - "sha": "98d6d8a1a8747748aa775394c87b7cdef6d45285" + "sha": "fa72ab5a4bab1aa8add1f685d131005a866b5789" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "94421c47802f56a44c320257b2b4c190dc7d6b68" + "sha": "5747555f7620113d9a2078a48f4c047a99d31b3e" } } ], From 396caffa3fe2636c7ab7f4e863040dc08a3608e9 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Mon, 17 Aug 2020 20:48:53 +0200 Subject: [PATCH 210/342] fix(deps): roll back dependency @google-cloud/security-center to ^5.0.3 (#319) --- packages/google-cloud-securitycenter/samples/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-securitycenter/samples/package.json b/packages/google-cloud-securitycenter/samples/package.json index 92eb9a5ddec..ca07777a6d1 100644 --- a/packages/google-cloud-securitycenter/samples/package.json +++ b/packages/google-cloud-securitycenter/samples/package.json @@ -14,7 +14,7 @@ "license": "Apache-2.0", "dependencies": { "@google-cloud/pubsub": "^2.0.0", - "@google-cloud/security-center": "^5.1.0" + "@google-cloud/security-center": "^5.0.3" }, "devDependencies": { "chai": "^4.2.0", From 9c887181d4823b3ea200b409d88153c78ba8e2f4 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 18 Aug 2020 09:40:36 -0700 Subject: [PATCH 211/342] chore: release 5.1.1 (#320) * chore: updated samples/package.json [ci skip] * chore: updated CHANGELOG.md [ci skip] * chore: updated package.json Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- packages/google-cloud-securitycenter/CHANGELOG.md | 7 +++++++ packages/google-cloud-securitycenter/package.json | 2 +- packages/google-cloud-securitycenter/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-securitycenter/CHANGELOG.md b/packages/google-cloud-securitycenter/CHANGELOG.md index 0f8d3730c35..255128bc6d0 100644 --- a/packages/google-cloud-securitycenter/CHANGELOG.md +++ b/packages/google-cloud-securitycenter/CHANGELOG.md @@ -4,6 +4,13 @@ [1]: https://www.npmjs.com/package/@google-cloud/security-center?activeTab=versions +### [5.1.1](https://www.github.com/googleapis/nodejs-security-center/compare/v5.1.0...v5.1.1) (2020-08-17) + + +### Bug Fixes + +* **deps:** roll back dependency @google-cloud/security-center to ^5.0.3 ([#319](https://www.github.com/googleapis/nodejs-security-center/issues/319)) ([f3462e1](https://www.github.com/googleapis/nodejs-security-center/commit/f3462e16aacb42f66f50ca4205a58981d2540686)) + ## [5.1.0](https://www.github.com/googleapis/nodejs-security-center/compare/v5.0.3...v5.1.0) (2020-08-14) diff --git a/packages/google-cloud-securitycenter/package.json b/packages/google-cloud-securitycenter/package.json index 4d801c57e6b..99935ecf2b8 100644 --- a/packages/google-cloud-securitycenter/package.json +++ b/packages/google-cloud-securitycenter/package.json @@ -1,7 +1,7 @@ { "name": "@google-cloud/security-center", "description": "Cloud Security Command Center API client for Node.js", - "version": "5.1.0", + "version": "5.1.1", "license": "Apache-2.0", "author": "Google LLC", "engines": { diff --git a/packages/google-cloud-securitycenter/samples/package.json b/packages/google-cloud-securitycenter/samples/package.json index ca07777a6d1..0ddb99b95ed 100644 --- a/packages/google-cloud-securitycenter/samples/package.json +++ b/packages/google-cloud-securitycenter/samples/package.json @@ -14,7 +14,7 @@ "license": "Apache-2.0", "dependencies": { "@google-cloud/pubsub": "^2.0.0", - "@google-cloud/security-center": "^5.0.3" + "@google-cloud/security-center": "^5.1.1" }, "devDependencies": { "chai": "^4.2.0", From f87834bc16a852b3275f39ec21c8a59b8ca162a5 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Thu, 20 Aug 2020 10:18:04 -0700 Subject: [PATCH 212/342] docs: Clarified that event_time can also be considered as the "update time" for a Finding. It also captures when a Finding was updated. The previous wording could've been interpreted as only the creation time. (#321) PiperOrigin-RevId: 327292977 Source-Author: Google APIs Source-Date: Tue Aug 18 13:17:43 2020 -0700 Source-Repo: googleapis/googleapis Source-Sha: 623a1aa03ae7a031b50be54df78263da2f22e981 Source-Link: https://github.com/googleapis/googleapis/commit/623a1aa03ae7a031b50be54df78263da2f22e981 --- .../cloud/securitycenter/v1/finding.proto | 8 +- .../securitycenter/v1beta1/finding.proto | 13 +- .../securitycenter/v1p1beta1/finding.proto | 8 +- .../synth.metadata | 111 +++++++++++++++++- 4 files changed, 126 insertions(+), 14 deletions(-) diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/finding.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/finding.proto index 4ccdc495c36..cf0873cfc82 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/finding.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/finding.proto @@ -101,9 +101,11 @@ message Finding { // to the finding. SecurityMarks security_marks = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; - // The time at which the event took place. For example, if the finding - // represents an open firewall it would capture the time the detector believes - // the firewall became open. The accuracy is determined by the detector. + // The time at which the event took place, or when an update to the finding + // occurred. For example, if the finding represents an open firewall it would + // capture the time the detector believes the firewall became open. The + // accuracy is determined by the detector. If the finding were to be resolved + // afterward, this time would reflect when the finding was resolved. google.protobuf.Timestamp event_time = 9; // The time at which the finding was created in Security Command Center. diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/finding.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/finding.proto index d78a522b432..647b3b43219 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/finding.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/finding.proto @@ -16,12 +16,12 @@ syntax = "proto3"; package google.cloud.securitycenter.v1beta1; +import "google/api/annotations.proto"; import "google/api/field_behavior.proto"; import "google/api/resource.proto"; import "google/cloud/securitycenter/v1beta1/security_marks.proto"; import "google/protobuf/struct.proto"; import "google/protobuf/timestamp.proto"; -import "google/api/annotations.proto"; option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1beta1;securitycenter"; option java_multiple_files = true; @@ -58,7 +58,8 @@ message Finding { // "organizations/{organization_id}/sources/{source_id}/findings/{finding_id}" string name = 1; - // Immutable. The relative resource name of the source the finding belongs to. See: + // Immutable. The relative resource name of the source the finding belongs to. + // See: // https://cloud.google.com/apis/design/resource_names#relative_resource_name // This field is immutable after creation time. // For example: @@ -97,9 +98,11 @@ message Finding { // to the finding. SecurityMarks security_marks = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; - // The time at which the event took place. For example, if the finding - // represents an open firewall it would capture the time the detector believes - // the firewall became open. The accuracy is determined by the detector. + // The time at which the event took place, or when an update to the finding + // occurred. For example, if the finding represents an open firewall it would + // capture the time the detector believes the firewall became open. The + // accuracy is determined by the detector. If the finding were to be resolved + // afterward, this time would reflect when the finding was resolved. google.protobuf.Timestamp event_time = 9; // The time at which the finding was created in Security Command Center. diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/finding.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/finding.proto index 75f52dfe9ed..49f8159f54c 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/finding.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/finding.proto @@ -118,9 +118,11 @@ message Finding { // to the finding. SecurityMarks security_marks = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; - // The time at which the event took place. For example, if the finding - // represents an open firewall it would capture the time the detector believes - // the firewall became open. The accuracy is determined by the detector. + // The time at which the event took place, or when an update to the finding + // occurred. For example, if the finding represents an open firewall it would + // capture the time the detector believes the firewall became open. The + // accuracy is determined by the detector. If the finding were to be resolved + // afterward, this time would reflect when the finding was resolved. google.protobuf.Timestamp event_time = 9; // The time at which the finding was created in Security Command Center. diff --git a/packages/google-cloud-securitycenter/synth.metadata b/packages/google-cloud-securitycenter/synth.metadata index f2cf8351f87..f5e7b993616 100644 --- a/packages/google-cloud-securitycenter/synth.metadata +++ b/packages/google-cloud-securitycenter/synth.metadata @@ -4,15 +4,15 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-security-center.git", - "sha": "fa72ab5a4bab1aa8add1f685d131005a866b5789" + "sha": "2de177d75b5e40a323b8ce2b8bbe3f839cc7c68b" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "5ad09e867a8f1faa19fbd674e51fa9c3f5fe2770", - "internalRef": "326514554" + "sha": "623a1aa03ae7a031b50be54df78263da2f22e981", + "internalRef": "327292977" } }, { @@ -51,5 +51,110 @@ "generator": "bazel" } } + ], + "generatedFiles": [ + ".eslintignore", + ".eslintrc.json", + ".gitattributes", + ".github/ISSUE_TEMPLATE/bug_report.md", + ".github/ISSUE_TEMPLATE/feature_request.md", + ".github/ISSUE_TEMPLATE/support_request.md", + ".github/PULL_REQUEST_TEMPLATE.md", + ".github/publish.yml", + ".github/release-please.yml", + ".github/workflows/ci.yaml", + ".gitignore", + ".jsdoc.js", + ".kokoro/.gitattributes", + ".kokoro/common.cfg", + ".kokoro/continuous/node10/common.cfg", + ".kokoro/continuous/node10/docs.cfg", + ".kokoro/continuous/node10/lint.cfg", + ".kokoro/continuous/node10/samples-test.cfg", + ".kokoro/continuous/node10/system-test.cfg", + ".kokoro/continuous/node10/test.cfg", + ".kokoro/continuous/node12/common.cfg", + ".kokoro/continuous/node12/test.cfg", + ".kokoro/docs.sh", + ".kokoro/lint.sh", + ".kokoro/populate-secrets.sh", + ".kokoro/presubmit/node10/common.cfg", + ".kokoro/presubmit/node10/samples-test.cfg", + ".kokoro/presubmit/node10/system-test.cfg", + ".kokoro/presubmit/node12/common.cfg", + ".kokoro/presubmit/node12/test.cfg", + ".kokoro/publish.sh", + ".kokoro/release/docs-devsite.cfg", + ".kokoro/release/docs-devsite.sh", + ".kokoro/release/docs.cfg", + ".kokoro/release/docs.sh", + ".kokoro/release/publish.cfg", + ".kokoro/system-test.sh", + ".kokoro/test.bat", + ".kokoro/test.sh", + ".kokoro/trampoline.sh", + ".mocharc.js", + ".nycrc", + ".prettierignore", + ".prettierrc.js", + "CODE_OF_CONDUCT.md", + "CONTRIBUTING.md", + "LICENSE", + "README.md", + "api-extractor.json", + "linkinator.config.json", + "protos/google/cloud/securitycenter/v1/asset.proto", + "protos/google/cloud/securitycenter/v1/finding.proto", + "protos/google/cloud/securitycenter/v1/notification_config.proto", + "protos/google/cloud/securitycenter/v1/notification_message.proto", + "protos/google/cloud/securitycenter/v1/organization_settings.proto", + "protos/google/cloud/securitycenter/v1/resource.proto", + "protos/google/cloud/securitycenter/v1/run_asset_discovery_response.proto", + "protos/google/cloud/securitycenter/v1/security_marks.proto", + "protos/google/cloud/securitycenter/v1/securitycenter_service.proto", + "protos/google/cloud/securitycenter/v1/source.proto", + "protos/google/cloud/securitycenter/v1beta1/asset.proto", + "protos/google/cloud/securitycenter/v1beta1/finding.proto", + "protos/google/cloud/securitycenter/v1beta1/organization_settings.proto", + "protos/google/cloud/securitycenter/v1beta1/run_asset_discovery_response.proto", + "protos/google/cloud/securitycenter/v1beta1/security_marks.proto", + "protos/google/cloud/securitycenter/v1beta1/securitycenter_service.proto", + "protos/google/cloud/securitycenter/v1beta1/source.proto", + "protos/google/cloud/securitycenter/v1p1beta1/asset.proto", + "protos/google/cloud/securitycenter/v1p1beta1/finding.proto", + "protos/google/cloud/securitycenter/v1p1beta1/notification_config.proto", + "protos/google/cloud/securitycenter/v1p1beta1/notification_message.proto", + "protos/google/cloud/securitycenter/v1p1beta1/organization_settings.proto", + "protos/google/cloud/securitycenter/v1p1beta1/resource.proto", + "protos/google/cloud/securitycenter/v1p1beta1/run_asset_discovery_response.proto", + "protos/google/cloud/securitycenter/v1p1beta1/security_marks.proto", + "protos/google/cloud/securitycenter/v1p1beta1/securitycenter_service.proto", + "protos/google/cloud/securitycenter/v1p1beta1/source.proto", + "protos/protos.d.ts", + "protos/protos.js", + "protos/protos.json", + "renovate.json", + "samples/README.md", + "src/index.ts", + "src/v1/index.ts", + "src/v1/security_center_client.ts", + "src/v1/security_center_client_config.json", + "src/v1/security_center_proto_list.json", + "src/v1beta1/index.ts", + "src/v1beta1/security_center_client.ts", + "src/v1beta1/security_center_client_config.json", + "src/v1beta1/security_center_proto_list.json", + "src/v1p1beta1/index.ts", + "src/v1p1beta1/security_center_client.ts", + "src/v1p1beta1/security_center_client_config.json", + "src/v1p1beta1/security_center_proto_list.json", + "system-test/fixtures/sample/src/index.js", + "system-test/fixtures/sample/src/index.ts", + "system-test/install.ts", + "test/gapic_security_center_v1.ts", + "test/gapic_security_center_v1beta1.ts", + "test/gapic_security_center_v1p1beta1.ts", + "tsconfig.json", + "webpack.config.js" ] } \ No newline at end of file From 752790e3e0d4ef3c845b87ba38675c4f6fdfebb9 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Fri, 21 Aug 2020 16:30:24 -0700 Subject: [PATCH 213/342] build: move system and samples test from Node 10 to Node 12 (#322) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/ba2d388f-b3b2-4ad7-a163-0c6b4d86894f/targets - [ ] To automatically regenerate this PR, check this box. Source-Link: https://github.com/googleapis/synthtool/commit/05de3e1e14a0b07eab8b474e669164dbd31f81fb --- .../google-cloud-securitycenter/synth.metadata | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/packages/google-cloud-securitycenter/synth.metadata b/packages/google-cloud-securitycenter/synth.metadata index f5e7b993616..bc3ed47bdfa 100644 --- a/packages/google-cloud-securitycenter/synth.metadata +++ b/packages/google-cloud-securitycenter/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-security-center.git", - "sha": "2de177d75b5e40a323b8ce2b8bbe3f839cc7c68b" + "sha": "a71eb16957019b2fa03d465ec909f36f37e2a93d" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "5747555f7620113d9a2078a48f4c047a99d31b3e" + "sha": "05de3e1e14a0b07eab8b474e669164dbd31f81fb" } } ], @@ -69,19 +69,19 @@ ".kokoro/common.cfg", ".kokoro/continuous/node10/common.cfg", ".kokoro/continuous/node10/docs.cfg", - ".kokoro/continuous/node10/lint.cfg", - ".kokoro/continuous/node10/samples-test.cfg", - ".kokoro/continuous/node10/system-test.cfg", ".kokoro/continuous/node10/test.cfg", ".kokoro/continuous/node12/common.cfg", + ".kokoro/continuous/node12/lint.cfg", + ".kokoro/continuous/node12/samples-test.cfg", + ".kokoro/continuous/node12/system-test.cfg", ".kokoro/continuous/node12/test.cfg", ".kokoro/docs.sh", ".kokoro/lint.sh", ".kokoro/populate-secrets.sh", ".kokoro/presubmit/node10/common.cfg", - ".kokoro/presubmit/node10/samples-test.cfg", - ".kokoro/presubmit/node10/system-test.cfg", ".kokoro/presubmit/node12/common.cfg", + ".kokoro/presubmit/node12/samples-test.cfg", + ".kokoro/presubmit/node12/system-test.cfg", ".kokoro/presubmit/node12/test.cfg", ".kokoro/publish.sh", ".kokoro/release/docs-devsite.cfg", From 98ab59f5068bc7585d539242d5424741ca6c0f2f Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Fri, 28 Aug 2020 10:02:20 -0700 Subject: [PATCH 214/342] build: track flaky tests for "nightly", add new secrets for tagging (#323) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/d07381b6-5717-4914-bfc5-88b1bfd69fc4/targets - [ ] To automatically regenerate this PR, check this box. Source-Link: https://github.com/googleapis/synthtool/commit/8cf6d2834ad14318e64429c3b94f6443ae83daf9 --- packages/google-cloud-securitycenter/synth.metadata | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/google-cloud-securitycenter/synth.metadata b/packages/google-cloud-securitycenter/synth.metadata index bc3ed47bdfa..0e7b757f777 100644 --- a/packages/google-cloud-securitycenter/synth.metadata +++ b/packages/google-cloud-securitycenter/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-security-center.git", - "sha": "a71eb16957019b2fa03d465ec909f36f37e2a93d" + "sha": "479e040c0cb357853a521c3080ced9f7bec9075f" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "05de3e1e14a0b07eab8b474e669164dbd31f81fb" + "sha": "8cf6d2834ad14318e64429c3b94f6443ae83daf9" } } ], @@ -60,7 +60,6 @@ ".github/ISSUE_TEMPLATE/feature_request.md", ".github/ISSUE_TEMPLATE/support_request.md", ".github/PULL_REQUEST_TEMPLATE.md", - ".github/publish.yml", ".github/release-please.yml", ".github/workflows/ci.yaml", ".gitignore", From e6555f809c4cda8e2661a9d798bbd512ff82bc91 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Sat, 12 Sep 2020 11:20:10 -0700 Subject: [PATCH 215/342] build(test): recursively find test files; fail on unsupported dependency versions (#326) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/9be7b892-4bc6-4dcb-8dc8-41f27e5fc193/targets - [ ] To automatically regenerate this PR, check this box. Source-Link: https://github.com/googleapis/synthtool/commit/fdd03c161003ab97657cc0218f25c82c89ddf4b6 --- packages/google-cloud-securitycenter/.mocharc.js | 3 ++- packages/google-cloud-securitycenter/synth.metadata | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/google-cloud-securitycenter/.mocharc.js b/packages/google-cloud-securitycenter/.mocharc.js index ff7b34fa5d1..0b600509bed 100644 --- a/packages/google-cloud-securitycenter/.mocharc.js +++ b/packages/google-cloud-securitycenter/.mocharc.js @@ -14,7 +14,8 @@ const config = { "enable-source-maps": true, "throw-deprecation": true, - "timeout": 10000 + "timeout": 10000, + "recursive": true } if (process.env.MOCHA_THROW_DEPRECATION === 'false') { delete config['throw-deprecation']; diff --git a/packages/google-cloud-securitycenter/synth.metadata b/packages/google-cloud-securitycenter/synth.metadata index 0e7b757f777..8efe10a350b 100644 --- a/packages/google-cloud-securitycenter/synth.metadata +++ b/packages/google-cloud-securitycenter/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-security-center.git", - "sha": "479e040c0cb357853a521c3080ced9f7bec9075f" + "sha": "8dcd0485134c4e0bd4f3742f0be2666f5a8b969c" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "8cf6d2834ad14318e64429c3b94f6443ae83daf9" + "sha": "fdd03c161003ab97657cc0218f25c82c89ddf4b6" } } ], From f0ec06f1d3b0e417c2f36f4f955cc1e83e923865 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Sat, 19 Sep 2020 08:57:21 -0700 Subject: [PATCH 216/342] docs: updated description of finding severity field (#327) PiperOrigin-RevId: 332497859 Source-Author: Google APIs Source-Date: Fri Sep 18 12:02:05 2020 -0700 Source-Repo: googleapis/googleapis Source-Sha: 8d73f9486fc193a150f6c907dfb9f49431aff3ff Source-Link: https://github.com/googleapis/googleapis/commit/8d73f9486fc193a150f6c907dfb9f49431aff3ff --- .../securitycenter/v1p1beta1/finding.proto | 6 ++- .../v1p1beta1/securitycenter_service.proto | 21 ++++---- .../src/v1p1beta1/security_center_client.ts | 54 +++++++++++-------- .../synth.metadata | 6 +-- 4 files changed, 50 insertions(+), 37 deletions(-) diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/finding.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/finding.proto index 49f8159f54c..551f1ceea71 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/finding.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/finding.proto @@ -55,7 +55,8 @@ message Finding { INACTIVE = 2; } - // The severity of the finding. + // The severity of the finding. This field is managed by the source that + // writes the finding. enum Severity { // No severity specified. The default value. SEVERITY_UNSPECIFIED = 0; @@ -128,6 +129,7 @@ message Finding { // The time at which the finding was created in Security Command Center. google.protobuf.Timestamp create_time = 10; - // The severity of the finding. + // The severity of the finding. This field is managed by the source that + // writes the finding. Severity severity = 13; } diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/securitycenter_service.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/securitycenter_service.proto index 69d864c6c1d..f8f1580f83c 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/securitycenter_service.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/securitycenter_service.proto @@ -16,6 +16,7 @@ syntax = "proto3"; package google.cloud.securitycenter.v1p1beta1; +import public "google/cloud/securitycenter/v1p1beta1/notification_message.proto"; import public "google/cloud/securitycenter/v1p1beta1/run_asset_discovery_response.proto"; import "google/api/annotations.proto"; import "google/api/client.proto"; @@ -307,8 +308,7 @@ message CreateNotificationConfigRequest { } ]; - // Required. - // Unique identifier provided by the client within the parent scope. + // Required. Unique identifier provided by the client within the parent scope. // It must be between 1 and 128 characters, and contains alphanumeric // characters, underscores or hyphens only. string config_id = 2 [(google.api.field_behavior) = REQUIRED]; @@ -586,6 +586,7 @@ message GroupFindingsRequest { // * category: `=`, `:` // * external_uri: `=`, `:` // * event_time: `=`, `>`, `<`, `>=`, `<=` + // * severity: `=`, `:` // // Usage: This should be milliseconds since epoch or an RFC3339 string. // Examples: @@ -614,6 +615,7 @@ message GroupFindingsRequest { // * category // * state // * parent + // * severity // // The following fields are supported when compare_duration is set: // @@ -988,13 +990,14 @@ message ListFindingsRequest { // // The following field and operator combinations are supported: // - // name: `=` - // parent: `=`, `:` - // resource_name: `=`, `:` - // state: `=`, `:` - // category: `=`, `:` - // external_uri: `=`, `:` - // event_time: `=`, `>`, `<`, `>=`, `<=` + // * name: `=` + // * parent: `=`, `:` + // * resource_name: `=`, `:` + // * state: `=`, `:` + // * category: `=`, `:` + // * external_uri: `=`, `:` + // * event_time: `=`, `>`, `<`, `>=`, `<=` + // * severity: `=`, `:` // // Usage: This should be milliseconds since epoch or an RFC3339 string. // Examples: diff --git a/packages/google-cloud-securitycenter/src/v1p1beta1/security_center_client.ts b/packages/google-cloud-securitycenter/src/v1p1beta1/security_center_client.ts index f50ff04a249..509dc93f537 100644 --- a/packages/google-cloud-securitycenter/src/v1p1beta1/security_center_client.ts +++ b/packages/google-cloud-securitycenter/src/v1p1beta1/security_center_client.ts @@ -648,8 +648,7 @@ export class SecurityCenterClient { * Required. Resource name of the new notification config's parent. Its format is * "organizations/[organization_id]". * @param {string} request.configId - * Required. - * Unique identifier provided by the client within the parent scope. + * Required. Unique identifier provided by the client within the parent scope. * It must be between 1 and 128 characters, and contains alphanumeric * characters, underscores or hyphens only. * @param {google.cloud.securitycenter.v1p1beta1.NotificationConfig} request.notificationConfig @@ -2745,6 +2744,7 @@ export class SecurityCenterClient { * * category: `=`, `:` * * external_uri: `=`, `:` * * event_time: `=`, `>`, `<`, `>=`, `<=` + * * severity: `=`, `:` * * Usage: This should be milliseconds since epoch or an RFC3339 string. * Examples: @@ -2772,6 +2772,7 @@ export class SecurityCenterClient { * * category * * state * * parent + * * severity * * The following fields are supported when compare_duration is set: * @@ -2938,6 +2939,7 @@ export class SecurityCenterClient { * * category: `=`, `:` * * external_uri: `=`, `:` * * event_time: `=`, `>`, `<`, `>=`, `<=` + * * severity: `=`, `:` * * Usage: This should be milliseconds since epoch or an RFC3339 string. * Examples: @@ -2965,6 +2967,7 @@ export class SecurityCenterClient { * * category * * state * * parent + * * severity * * The following fields are supported when compare_duration is set: * @@ -3087,6 +3090,7 @@ export class SecurityCenterClient { * * category: `=`, `:` * * external_uri: `=`, `:` * * event_time: `=`, `>`, `<`, `>=`, `<=` + * * severity: `=`, `:` * * Usage: This should be milliseconds since epoch or an RFC3339 string. * Examples: @@ -3114,6 +3118,7 @@ export class SecurityCenterClient { * * category * * state * * parent + * * severity * * The following fields are supported when compare_duration is set: * @@ -3829,13 +3834,14 @@ export class SecurityCenterClient { * * The following field and operator combinations are supported: * - * name: `=` - * parent: `=`, `:` - * resource_name: `=`, `:` - * state: `=`, `:` - * category: `=`, `:` - * external_uri: `=`, `:` - * event_time: `=`, `>`, `<`, `>=`, `<=` + * * name: `=` + * * parent: `=`, `:` + * * resource_name: `=`, `:` + * * state: `=`, `:` + * * category: `=`, `:` + * * external_uri: `=`, `:` + * * event_time: `=`, `>`, `<`, `>=`, `<=` + * * severity: `=`, `:` * * Usage: This should be milliseconds since epoch or an RFC3339 string. * Examples: @@ -4027,13 +4033,14 @@ export class SecurityCenterClient { * * The following field and operator combinations are supported: * - * name: `=` - * parent: `=`, `:` - * resource_name: `=`, `:` - * state: `=`, `:` - * category: `=`, `:` - * external_uri: `=`, `:` - * event_time: `=`, `>`, `<`, `>=`, `<=` + * * name: `=` + * * parent: `=`, `:` + * * resource_name: `=`, `:` + * * state: `=`, `:` + * * category: `=`, `:` + * * external_uri: `=`, `:` + * * event_time: `=`, `>`, `<`, `>=`, `<=` + * * severity: `=`, `:` * * Usage: This should be milliseconds since epoch or an RFC3339 string. * Examples: @@ -4181,13 +4188,14 @@ export class SecurityCenterClient { * * The following field and operator combinations are supported: * - * name: `=` - * parent: `=`, `:` - * resource_name: `=`, `:` - * state: `=`, `:` - * category: `=`, `:` - * external_uri: `=`, `:` - * event_time: `=`, `>`, `<`, `>=`, `<=` + * * name: `=` + * * parent: `=`, `:` + * * resource_name: `=`, `:` + * * state: `=`, `:` + * * category: `=`, `:` + * * external_uri: `=`, `:` + * * event_time: `=`, `>`, `<`, `>=`, `<=` + * * severity: `=`, `:` * * Usage: This should be milliseconds since epoch or an RFC3339 string. * Examples: diff --git a/packages/google-cloud-securitycenter/synth.metadata b/packages/google-cloud-securitycenter/synth.metadata index 8efe10a350b..d40e1c58325 100644 --- a/packages/google-cloud-securitycenter/synth.metadata +++ b/packages/google-cloud-securitycenter/synth.metadata @@ -4,15 +4,15 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-security-center.git", - "sha": "8dcd0485134c4e0bd4f3742f0be2666f5a8b969c" + "sha": "5ba92ef8bfd48a2c7b56fe652a6908cc93bbec3b" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "623a1aa03ae7a031b50be54df78263da2f22e981", - "internalRef": "327292977" + "sha": "8d73f9486fc193a150f6c907dfb9f49431aff3ff", + "internalRef": "332497859" } }, { From cf3765c84d4f0ec01dfed96543c767df90c489ca Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Thu, 1 Oct 2020 04:55:37 -0700 Subject: [PATCH 217/342] chore: update bucket for cloud-rad (#328) Co-authored-by: gcf-merge-on-green[bot] <60162190+gcf-merge-on-green[bot]@users.noreply.github.com> Source-Author: F. Hinkelmann Source-Date: Wed Sep 30 14:13:57 2020 -0400 Source-Repo: googleapis/synthtool Source-Sha: 079dcce498117f9570cebe6e6cff254b38ba3860 Source-Link: https://github.com/googleapis/synthtool/commit/079dcce498117f9570cebe6e6cff254b38ba3860 --- packages/google-cloud-securitycenter/synth.metadata | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-securitycenter/synth.metadata b/packages/google-cloud-securitycenter/synth.metadata index d40e1c58325..de99a48ef2a 100644 --- a/packages/google-cloud-securitycenter/synth.metadata +++ b/packages/google-cloud-securitycenter/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-security-center.git", - "sha": "5ba92ef8bfd48a2c7b56fe652a6908cc93bbec3b" + "sha": "e7bda5c2b69f28454405acd3deadd264520c7bbc" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "fdd03c161003ab97657cc0218f25c82c89ddf4b6" + "sha": "079dcce498117f9570cebe6e6cff254b38ba3860" } } ], From 44a361aff56c3430a2554d83d8127f192a7ae710 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Tue, 6 Oct 2020 09:46:39 -0700 Subject: [PATCH 218/342] build(node_library): migrate to Trampoline V2 (#329) Source-Author: Takashi Matsuo Source-Date: Fri Oct 2 12:13:27 2020 -0700 Source-Repo: googleapis/synthtool Source-Sha: 0c868d49b8e05bc1f299bc773df9eb4ef9ed96e9 Source-Link: https://github.com/googleapis/synthtool/commit/0c868d49b8e05bc1f299bc773df9eb4ef9ed96e9 --- packages/google-cloud-securitycenter/synth.metadata | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-securitycenter/synth.metadata b/packages/google-cloud-securitycenter/synth.metadata index de99a48ef2a..387dc437bda 100644 --- a/packages/google-cloud-securitycenter/synth.metadata +++ b/packages/google-cloud-securitycenter/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-security-center.git", - "sha": "e7bda5c2b69f28454405acd3deadd264520c7bbc" + "sha": "50e2acd424b319c586011e06b0042d0670826762" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "079dcce498117f9570cebe6e6cff254b38ba3860" + "sha": "0c868d49b8e05bc1f299bc773df9eb4ef9ed96e9" } } ], @@ -92,10 +92,12 @@ ".kokoro/test.bat", ".kokoro/test.sh", ".kokoro/trampoline.sh", + ".kokoro/trampoline_v2.sh", ".mocharc.js", ".nycrc", ".prettierignore", ".prettierrc.js", + ".trampolinerc", "CODE_OF_CONDUCT.md", "CONTRIBUTING.md", "LICENSE", From be037115e1364d73466c16ad2010f69f8598ee3f Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Fri, 16 Oct 2020 10:08:36 -0700 Subject: [PATCH 219/342] build: only check --engine-strict for production deps (#330) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/091ccb4c-684e-436a-9780-1d131a3b46af/targets - [ ] To automatically regenerate this PR, check this box. Source-Link: https://github.com/googleapis/synthtool/commit/5451633881133e5573cc271a18e73b18caca8b1b --- packages/google-cloud-securitycenter/synth.metadata | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-securitycenter/synth.metadata b/packages/google-cloud-securitycenter/synth.metadata index 387dc437bda..9c8abddfa5f 100644 --- a/packages/google-cloud-securitycenter/synth.metadata +++ b/packages/google-cloud-securitycenter/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-security-center.git", - "sha": "50e2acd424b319c586011e06b0042d0670826762" + "sha": "1295284ccd1826ac1ed9d9e48e723c9ef43e7a6e" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "0c868d49b8e05bc1f299bc773df9eb4ef9ed96e9" + "sha": "5451633881133e5573cc271a18e73b18caca8b1b" } } ], From 26fec80f8610834f7bc8189c1c52a5515b3c821d Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Wed, 21 Oct 2020 16:16:16 -0700 Subject: [PATCH 220/342] chore: clean up Node.js TOC for cloud-rad (#331) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/528df7ed-227f-470a-afc7-453221617bc3/targets - [ ] To automatically regenerate this PR, check this box. Source-Link: https://github.com/googleapis/synthtool/commit/901ddd44e9ef7887ee681b9183bbdea99437fdcc Source-Link: https://github.com/googleapis/synthtool/commit/f96d3b455fe27c3dc7bc37c3c9cd27b1c6d269c8 --- packages/google-cloud-securitycenter/synth.metadata | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-securitycenter/synth.metadata b/packages/google-cloud-securitycenter/synth.metadata index 9c8abddfa5f..c473264602e 100644 --- a/packages/google-cloud-securitycenter/synth.metadata +++ b/packages/google-cloud-securitycenter/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-security-center.git", - "sha": "1295284ccd1826ac1ed9d9e48e723c9ef43e7a6e" + "sha": "03932dfc69e596fe7e67466d31cbdda34092ff19" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "5451633881133e5573cc271a18e73b18caca8b1b" + "sha": "901ddd44e9ef7887ee681b9183bbdea99437fdcc" } } ], From b53b9b2f3f29fb42065c8c3443aaa9feee2059de Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Tue, 27 Oct 2020 11:12:14 -0700 Subject: [PATCH 221/342] docs: updated code of conduct (includes update to actions) (#334) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/c70654a6-9134-4d1e-9028-96354fef7186/targets - [ ] To automatically regenerate this PR, check this box. Source-Link: https://github.com/googleapis/synthtool/commit/89c849ba5013e45e8fb688b138f33c2ec6083dc5 Source-Link: https://github.com/googleapis/synthtool/commit/a783321fd55f010709294455584a553f4b24b944 Source-Link: https://github.com/googleapis/synthtool/commit/b7413d38b763827c72c0360f0a3d286c84656eeb Source-Link: https://github.com/googleapis/synthtool/commit/5f6ef0ec5501d33c4667885b37a7685a30d41a76 --- .../CODE_OF_CONDUCT.md | 123 +++++++++++++----- .../synth.metadata | 4 +- 2 files changed, 89 insertions(+), 38 deletions(-) diff --git a/packages/google-cloud-securitycenter/CODE_OF_CONDUCT.md b/packages/google-cloud-securitycenter/CODE_OF_CONDUCT.md index 46b2a08ea6d..2add2547a81 100644 --- a/packages/google-cloud-securitycenter/CODE_OF_CONDUCT.md +++ b/packages/google-cloud-securitycenter/CODE_OF_CONDUCT.md @@ -1,43 +1,94 @@ -# Contributor Code of Conduct + +# Code of Conduct -As contributors and maintainers of this project, -and in the interest of fostering an open and welcoming community, -we pledge to respect all people who contribute through reporting issues, -posting feature requests, updating documentation, -submitting pull requests or patches, and other activities. +## Our Pledge -We are committed to making participation in this project -a harassment-free experience for everyone, -regardless of level of experience, gender, gender identity and expression, -sexual orientation, disability, personal appearance, -body size, race, ethnicity, age, religion, or nationality. +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 -* Personal attacks -* Trolling or insulting/derogatory comments -* Public or private harassment -* Publishing other's private information, -such as physical or electronic -addresses, without explicit permission -* Other unethical or unprofessional conduct. +* 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. -By adopting this Code of Conduct, -project maintainers commit themselves to fairly and consistently -applying these principles to every aspect of managing this project. -Project maintainers who do not follow or enforce the Code of Conduct -may be permanently removed from the project team. - -This code of conduct applies both within project spaces and in public spaces -when an individual is representing the project or its community. - -Instances of abusive, harassing, or otherwise unacceptable behavior -may be reported by opening an issue -or contacting one or more of the project maintainers. - -This Code of Conduct is adapted from the [Contributor Covenant](http://contributor-covenant.org), version 1.2.0, -available at [http://contributor-covenant.org/version/1/2/0/](http://contributor-covenant.org/version/1/2/0/) +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-cloud-securitycenter/synth.metadata b/packages/google-cloud-securitycenter/synth.metadata index c473264602e..54f5278b62f 100644 --- a/packages/google-cloud-securitycenter/synth.metadata +++ b/packages/google-cloud-securitycenter/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-security-center.git", - "sha": "03932dfc69e596fe7e67466d31cbdda34092ff19" + "sha": "e3e846c9ab90aab8f6108706c3cdd37ba7ba736c" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "901ddd44e9ef7887ee681b9183bbdea99437fdcc" + "sha": "89c849ba5013e45e8fb688b138f33c2ec6083dc5" } } ], From 97e305a05704196973e52bd9481ebf66929662a6 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Mon, 2 Nov 2020 15:58:34 -0800 Subject: [PATCH 222/342] build(node): add KOKORO_BUILD_ARTIFACTS_SUBDIR to env (#335) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/5fc9e824-cf7f-4f93-9bfe-6ba3aa84ec69/targets - [ ] To automatically regenerate this PR, check this box. Source-Link: https://github.com/googleapis/synthtool/commit/ba9918cd22874245b55734f57470c719b577e591 --- packages/google-cloud-securitycenter/synth.metadata | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-securitycenter/synth.metadata b/packages/google-cloud-securitycenter/synth.metadata index 54f5278b62f..4c00ac47193 100644 --- a/packages/google-cloud-securitycenter/synth.metadata +++ b/packages/google-cloud-securitycenter/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-security-center.git", - "sha": "e3e846c9ab90aab8f6108706c3cdd37ba7ba736c" + "sha": "eaae9f419201f46f3bbcd6b65e41fd0a97ecbc28" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "89c849ba5013e45e8fb688b138f33c2ec6083dc5" + "sha": "ba9918cd22874245b55734f57470c719b577e591" } } ], From dc834a31f3d5072f0ea93d581685a98de64b675d Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Fri, 6 Nov 2020 14:48:41 -0800 Subject: [PATCH 223/342] build: export type v1.SecurityCenterClient (#336) --- packages/google-cloud-securitycenter/src/index.ts | 1 + packages/google-cloud-securitycenter/synth.metadata | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/google-cloud-securitycenter/src/index.ts b/packages/google-cloud-securitycenter/src/index.ts index 49327a530ce..2f1843814ee 100644 --- a/packages/google-cloud-securitycenter/src/index.ts +++ b/packages/google-cloud-securitycenter/src/index.ts @@ -21,6 +21,7 @@ import * as v1beta1 from './v1beta1'; import * as v1p1beta1 from './v1p1beta1'; const SecurityCenterClient = v1.SecurityCenterClient; +type SecurityCenterClient = v1.SecurityCenterClient; export {v1, v1beta1, v1p1beta1, SecurityCenterClient}; export default {v1, v1beta1, v1p1beta1, SecurityCenterClient}; diff --git a/packages/google-cloud-securitycenter/synth.metadata b/packages/google-cloud-securitycenter/synth.metadata index 4c00ac47193..8dc171dbdd5 100644 --- a/packages/google-cloud-securitycenter/synth.metadata +++ b/packages/google-cloud-securitycenter/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-security-center.git", - "sha": "eaae9f419201f46f3bbcd6b65e41fd0a97ecbc28" + "sha": "344c15b415f72a286a48559f38cc4150697d3531" } }, { From 254e336b5a9337514be6a779d1cf5b468fbb1bf4 Mon Sep 17 00:00:00 2001 From: Alexander Fenster Date: Fri, 6 Nov 2020 17:14:06 -0800 Subject: [PATCH 224/342] fix: do not modify options object, use defaultScopes (#337) Regenerated the library using [gapic-generator-typescript](https://github.com/googleapis/gapic-generator-typescript) v1.2.1. --- .../google-cloud-securitycenter/package.json | 2 +- .../src/v1/security_center_client.ts | 532 ++++++++++-------- .../src/v1beta1/security_center_client.ts | 455 ++++++++------- .../src/v1p1beta1/security_center_client.ts | 532 ++++++++++-------- .../synth.metadata | 4 +- .../system-test/fixtures/sample/src/index.ts | 9 +- .../system-test/install.ts | 18 +- 7 files changed, 892 insertions(+), 660 deletions(-) diff --git a/packages/google-cloud-securitycenter/package.json b/packages/google-cloud-securitycenter/package.json index 99935ecf2b8..9894d016ea8 100644 --- a/packages/google-cloud-securitycenter/package.json +++ b/packages/google-cloud-securitycenter/package.json @@ -44,7 +44,7 @@ "Security Command Center API" ], "dependencies": { - "google-gax": "^2.1.0" + "google-gax": "^2.9.2" }, "devDependencies": { "@types/mocha": "^8.0.0", diff --git a/packages/google-cloud-securitycenter/src/v1/security_center_client.ts b/packages/google-cloud-securitycenter/src/v1/security_center_client.ts index 94633dc7919..412e7ee7958 100644 --- a/packages/google-cloud-securitycenter/src/v1/security_center_client.ts +++ b/packages/google-cloud-securitycenter/src/v1/security_center_client.ts @@ -62,8 +62,10 @@ export class SecurityCenterClient { /** * Construct an instance of SecurityCenterClient. * - * @param {object} [options] - The configuration object. See the subsequent - * parameters for more details. + * @param {object} [options] - The configuration object. + * The options accepted by the constructor are described in detail + * in [this document](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#creating-the-client-instance). + * The common options are: * @param {object} [options.credentials] - Credentials object. * @param {string} [options.credentials.client_email] * @param {string} [options.credentials.private_key] @@ -83,42 +85,33 @@ export class SecurityCenterClient { * 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. + * TODO(@alexander-fenster): link to gax documentation. + * @param {boolean} fallback - Use HTTP fallback mode. + * In fallback mode, a special browser-compatible transport implementation is used + * instead of gRPC transport. In browser context (if the `window` object is defined) + * the fallback mode is enabled automatically; set `options.fallback` to `false` + * if you need to override this behavior. */ - constructor(opts?: ClientOptions) { - // Ensure that options include the service address and port. + // Ensure that options include all the required fields. const staticMembers = this.constructor as typeof SecurityCenterClient; const servicePath = - opts && opts.servicePath - ? opts.servicePath - : opts && opts.apiEndpoint - ? opts.apiEndpoint - : staticMembers.servicePath; - const port = opts && opts.port ? opts.port : staticMembers.port; + opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = opts?.fallback ?? typeof window !== 'undefined'; + opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); - if (!opts) { - opts = {servicePath, port}; + // 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; } - opts.servicePath = opts.servicePath || servicePath; - opts.port = opts.port || port; - - // users can override the config from client side, like retry codes name. - // The detailed structure of the clientConfig can be found here: https://github.com/googleapis/gax-nodejs/blob/master/src/gax.ts#L546 - // The way to override client config for Showcase API: - // - // const customConfig = {"interfaces": {"google.showcase.v1beta1.Echo": {"methods": {"Echo": {"retry_codes_name": "idempotent", "retry_params_name": "default"}}}}} - // const showcaseClient = new showcaseClient({ projectId, customConfig }); - opts.clientConfig = opts.clientConfig || {}; - // If we're running in browser, it's OK to omit `fallback` since - // google-gax has `browser` field in its `package.json`. - // For Electron (which does not respect `browser` field), - // pass `{fallback: true}` to the SecurityCenterClient constructor. + // Choose either gRPC or proto-over-HTTP implementation of google-gax. this._gaxModule = opts.fallback ? gax.fallback : gax; - // Create a `gaxGrpc` object, with any grpc-specific options - // sent to the client. - opts.scopes = (this.constructor as typeof SecurityCenterClient).scopes; + // 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. @@ -127,6 +120,11 @@ export class SecurityCenterClient { // Save the auth object to the client, for use by other methods. this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + // 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) { @@ -357,6 +355,7 @@ export class SecurityCenterClient { /** * The DNS address for this API service. + * @returns {string} The DNS address for this service. */ static get servicePath() { return 'securitycenter.googleapis.com'; @@ -365,6 +364,7 @@ export class SecurityCenterClient { /** * 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 'securitycenter.googleapis.com'; @@ -372,6 +372,7 @@ export class SecurityCenterClient { /** * The port for this API service. + * @returns {number} The default port for this service. */ static get port() { return 443; @@ -380,6 +381,7 @@ export class SecurityCenterClient { /** * 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/cloud-platform']; @@ -389,8 +391,7 @@ export class SecurityCenterClient { getProjectId(callback: Callback): void; /** * Return the project ID used by this class. - * @param {function(Error, string)} callback - the callback to - * be called with the current project Id. + * @returns {Promise} A promise that resolves to string containing the project ID. */ getProjectId( callback?: Callback @@ -451,7 +452,11 @@ export class SecurityCenterClient { * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. * The first element of the array is an object representing [Source]{@link google.cloud.securitycenter.v1.Source}. - * The promise has a method named "cancel" which cancels the ongoing API call. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * const [response] = await client.createSource(request); */ createSource( request: protos.google.cloud.securitycenter.v1.ICreateSourceRequest, @@ -548,7 +553,11 @@ export class SecurityCenterClient { * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. * The first element of the array is an object representing [Finding]{@link google.cloud.securitycenter.v1.Finding}. - * The promise has a method named "cancel" which cancels the ongoing API call. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * const [response] = await client.createFinding(request); */ createFinding( request: protos.google.cloud.securitycenter.v1.ICreateFindingRequest, @@ -649,7 +658,11 @@ export class SecurityCenterClient { * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. * The first element of the array is an object representing [NotificationConfig]{@link google.cloud.securitycenter.v1.NotificationConfig}. - * The promise has a method named "cancel" which cancels the ongoing API call. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * const [response] = await client.createNotificationConfig(request); */ createNotificationConfig( request: protos.google.cloud.securitycenter.v1.ICreateNotificationConfigRequest, @@ -748,7 +761,11 @@ export class SecurityCenterClient { * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. - * The promise has a method named "cancel" which cancels the ongoing API call. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * const [response] = await client.deleteNotificationConfig(request); */ deleteNotificationConfig( request: protos.google.cloud.securitycenter.v1.IDeleteNotificationConfigRequest, @@ -843,7 +860,11 @@ export class SecurityCenterClient { * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. * The first element of the array is an object representing [Policy]{@link google.iam.v1.Policy}. - * The promise has a method named "cancel" which cancels the ongoing API call. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * const [response] = await client.getIamPolicy(request); */ getIamPolicy( request: protos.google.iam.v1.IGetIamPolicyRequest, @@ -931,7 +952,11 @@ export class SecurityCenterClient { * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. * The first element of the array is an object representing [NotificationConfig]{@link google.cloud.securitycenter.v1.NotificationConfig}. - * The promise has a method named "cancel" which cancels the ongoing API call. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * const [response] = await client.getNotificationConfig(request); */ getNotificationConfig( request: protos.google.cloud.securitycenter.v1.IGetNotificationConfigRequest, @@ -1026,7 +1051,11 @@ export class SecurityCenterClient { * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. * The first element of the array is an object representing [OrganizationSettings]{@link google.cloud.securitycenter.v1.OrganizationSettings}. - * The promise has a method named "cancel" which cancels the ongoing API call. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * const [response] = await client.getOrganizationSettings(request); */ getOrganizationSettings( request: protos.google.cloud.securitycenter.v1.IGetOrganizationSettingsRequest, @@ -1122,7 +1151,11 @@ export class SecurityCenterClient { * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. * The first element of the array is an object representing [Source]{@link google.cloud.securitycenter.v1.Source}. - * The promise has a method named "cancel" which cancels the ongoing API call. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * const [response] = await client.getSource(request); */ getSource( request: protos.google.cloud.securitycenter.v1.IGetSourceRequest, @@ -1217,7 +1250,11 @@ export class SecurityCenterClient { * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. * The first element of the array is an object representing [Finding]{@link google.cloud.securitycenter.v1.Finding}. - * The promise has a method named "cancel" which cancels the ongoing API call. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * const [response] = await client.setFindingState(request); */ setFindingState( request: protos.google.cloud.securitycenter.v1.ISetFindingStateRequest, @@ -1307,7 +1344,11 @@ export class SecurityCenterClient { * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. * The first element of the array is an object representing [Policy]{@link google.iam.v1.Policy}. - * The promise has a method named "cancel" which cancels the ongoing API call. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * const [response] = await client.setIamPolicy(request); */ setIamPolicy( request: protos.google.iam.v1.ISetIamPolicyRequest, @@ -1393,7 +1434,11 @@ export class SecurityCenterClient { * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. * The first element of the array is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. - * The promise has a method named "cancel" which cancels the ongoing API call. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * const [response] = await client.testIamPermissions(request); */ testIamPermissions( request: protos.google.iam.v1.ITestIamPermissionsRequest, @@ -1491,7 +1536,11 @@ export class SecurityCenterClient { * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. * The first element of the array is an object representing [Finding]{@link google.cloud.securitycenter.v1.Finding}. - * The promise has a method named "cancel" which cancels the ongoing API call. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * const [response] = await client.updateFinding(request); */ updateFinding( request: protos.google.cloud.securitycenter.v1.IUpdateFindingRequest, @@ -1587,7 +1636,11 @@ export class SecurityCenterClient { * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. * The first element of the array is an object representing [NotificationConfig]{@link google.cloud.securitycenter.v1.NotificationConfig}. - * The promise has a method named "cancel" which cancels the ongoing API call. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * const [response] = await client.updateNotificationConfig(request); */ updateNotificationConfig( request: protos.google.cloud.securitycenter.v1.IUpdateNotificationConfigRequest, @@ -1689,7 +1742,11 @@ export class SecurityCenterClient { * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. * The first element of the array is an object representing [OrganizationSettings]{@link google.cloud.securitycenter.v1.OrganizationSettings}. - * The promise has a method named "cancel" which cancels the ongoing API call. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * const [response] = await client.updateOrganizationSettings(request); */ updateOrganizationSettings( request: protos.google.cloud.securitycenter.v1.IUpdateOrganizationSettingsRequest, @@ -1788,7 +1845,11 @@ export class SecurityCenterClient { * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. * The first element of the array is an object representing [Source]{@link google.cloud.securitycenter.v1.Source}. - * The promise has a method named "cancel" which cancels the ongoing API call. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * const [response] = await client.updateSource(request); */ updateSource( request: protos.google.cloud.securitycenter.v1.IUpdateSourceRequest, @@ -1889,7 +1950,11 @@ export class SecurityCenterClient { * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. * The first element of the array is an object representing [SecurityMarks]{@link google.cloud.securitycenter.v1.SecurityMarks}. - * The promise has a method named "cancel" which cancels the ongoing API call. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * const [response] = await client.updateSecurityMarks(request); */ updateSecurityMarks( request: protos.google.cloud.securitycenter.v1.IUpdateSecurityMarksRequest, @@ -1991,8 +2056,15 @@ export class SecurityCenterClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.longrunning.Operation}. - * The promise has a method named "cancel" which cancels the ongoing API call. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * const [operation] = await client.runAssetDiscovery(request); + * const [response] = await operation.promise(); */ runAssetDiscovery( request: protos.google.cloud.securitycenter.v1.IRunAssetDiscoveryRequest, @@ -2044,18 +2116,19 @@ export class SecurityCenterClient { return this.innerApiCalls.runAssetDiscovery(request, options, callback); } /** - * Check the status of the long running operation returned by the runAssetDiscovery() method. + * Check the status of the long running operation returned by `runAssetDiscovery()`. * @param {String} name * The operation name that will be passed. * @returns {Promise} - The promise which resolves to an object. * The decoded operation object has result and metadata field to get information from. - * - * @example: - * const decodedOperation = await checkRunAssetDiscoveryProgress(name); - * console.log(decodedOperation.result); - * console.log(decodedOperation.done); - * console.log(decodedOperation.metadata); - * + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * const decodedOperation = await checkRunAssetDiscoveryProgress(name); + * console.log(decodedOperation.result); + * console.log(decodedOperation.done); + * console.log(decodedOperation.metadata); */ async checkRunAssetDiscoveryProgress( name: string @@ -2245,19 +2318,14 @@ export class SecurityCenterClient { * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. * The first element of the array is Array of [GroupResult]{@link google.cloud.securitycenter.v1.GroupResult}. - * The client library support auto-pagination by default: it will call the API as many + * The client library will perform auto-pagination by default: it will call the API as many * times as needed and will merge results from all the pages into this array. - * - * When autoPaginate: false is specified through options, the array has three elements. - * The first element is Array of [GroupResult]{@link google.cloud.securitycenter.v1.GroupResult} that corresponds to - * the one page received from the API server. - * If the second element is not null it contains the request object of type [GroupAssetsRequest]{@link google.cloud.securitycenter.v1.GroupAssetsRequest} - * that can be used to obtain the next page of the results. - * If it is null, the next page does not exist. - * The third element contains the raw response received from the API server. Its type is - * [GroupAssetsResponse]{@link google.cloud.securitycenter.v1.GroupAssetsResponse}. - * - * The promise has a method named "cancel" which cancels the ongoing API call. + * Note that it can affect your quota. + * We recommend using `groupAssetsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. */ groupAssets( request: protos.google.cloud.securitycenter.v1.IGroupAssetsRequest, @@ -2305,18 +2373,7 @@ export class SecurityCenterClient { } /** - * Equivalent to {@link groupAssets}, but returns a NodeJS Stream object. - * - * This fetches the paged responses for {@link groupAssets} continuously - * and invokes the callback registered for 'data' event for each element in the - * responses. - * - * The returned object has 'end' method when no more elements are required. - * - * autoPaginate option will be ignored. - * - * @see {@link https://nodejs.org/api/stream.html} - * + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -2448,6 +2505,13 @@ export class SecurityCenterClient { * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Stream} * An object stream which emits an object representing [GroupResult]{@link google.cloud.securitycenter.v1.GroupResult} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `groupAssetsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. */ groupAssetsStream( request?: protos.google.cloud.securitycenter.v1.IGroupAssetsRequest, @@ -2472,10 +2536,9 @@ export class SecurityCenterClient { } /** - * Equivalent to {@link groupAssets}, but returns an iterable object. - * - * for-await-of syntax is used with the iterable to recursively get response element on-demand. + * Equivalent to `groupAssets`, but returns an iterable object. * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -2606,7 +2669,18 @@ export class SecurityCenterClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Object} - * An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols. + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [GroupResult]{@link google.cloud.securitycenter.v1.GroupResult}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example + * const iterable = client.groupAssetsAsync(request); + * for await (const response of iterable) { + * // process response + * } */ groupAssetsAsync( request?: protos.google.cloud.securitycenter.v1.IGroupAssetsRequest, @@ -2789,19 +2863,14 @@ export class SecurityCenterClient { * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. * The first element of the array is Array of [GroupResult]{@link google.cloud.securitycenter.v1.GroupResult}. - * The client library support auto-pagination by default: it will call the API as many + * The client library will perform auto-pagination by default: it will call the API as many * times as needed and will merge results from all the pages into this array. - * - * When autoPaginate: false is specified through options, the array has three elements. - * The first element is Array of [GroupResult]{@link google.cloud.securitycenter.v1.GroupResult} that corresponds to - * the one page received from the API server. - * If the second element is not null it contains the request object of type [GroupFindingsRequest]{@link google.cloud.securitycenter.v1.GroupFindingsRequest} - * that can be used to obtain the next page of the results. - * If it is null, the next page does not exist. - * The third element contains the raw response received from the API server. Its type is - * [GroupFindingsResponse]{@link google.cloud.securitycenter.v1.GroupFindingsResponse}. - * - * The promise has a method named "cancel" which cancels the ongoing API call. + * Note that it can affect your quota. + * We recommend using `groupFindingsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. */ groupFindings( request: protos.google.cloud.securitycenter.v1.IGroupFindingsRequest, @@ -2849,18 +2918,7 @@ export class SecurityCenterClient { } /** - * Equivalent to {@link groupFindings}, but returns a NodeJS Stream object. - * - * This fetches the paged responses for {@link groupFindings} continuously - * and invokes the callback registered for 'data' event for each element in the - * responses. - * - * The returned object has 'end' method when no more elements are required. - * - * autoPaginate option will be ignored. - * - * @see {@link https://nodejs.org/api/stream.html} - * + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -2982,6 +3040,13 @@ export class SecurityCenterClient { * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Stream} * An object stream which emits an object representing [GroupResult]{@link google.cloud.securitycenter.v1.GroupResult} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `groupFindingsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. */ groupFindingsStream( request?: protos.google.cloud.securitycenter.v1.IGroupFindingsRequest, @@ -3006,10 +3071,9 @@ export class SecurityCenterClient { } /** - * Equivalent to {@link groupFindings}, but returns an iterable object. - * - * for-await-of syntax is used with the iterable to recursively get response element on-demand. + * Equivalent to `groupFindings`, but returns an iterable object. * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -3130,7 +3194,18 @@ export class SecurityCenterClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Object} - * An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols. + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [GroupResult]{@link google.cloud.securitycenter.v1.GroupResult}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example + * const iterable = client.groupFindingsAsync(request); + * for await (const response of iterable) { + * // process response + * } */ groupFindingsAsync( request?: protos.google.cloud.securitycenter.v1.IGroupFindingsRequest, @@ -3322,19 +3397,14 @@ export class SecurityCenterClient { * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. * The first element of the array is Array of [ListAssetsResult]{@link google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult}. - * The client library support auto-pagination by default: it will call the API as many + * The client library will perform auto-pagination by default: it will call the API as many * times as needed and will merge results from all the pages into this array. - * - * When autoPaginate: false is specified through options, the array has three elements. - * The first element is Array of [ListAssetsResult]{@link google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult} that corresponds to - * the one page received from the API server. - * If the second element is not null it contains the request object of type [ListAssetsRequest]{@link google.cloud.securitycenter.v1.ListAssetsRequest} - * that can be used to obtain the next page of the results. - * If it is null, the next page does not exist. - * The third element contains the raw response received from the API server. Its type is - * [ListAssetsResponse]{@link google.cloud.securitycenter.v1.ListAssetsResponse}. - * - * The promise has a method named "cancel" which cancels the ongoing API call. + * Note that it can affect your quota. + * We recommend using `listAssetsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. */ listAssets( request: protos.google.cloud.securitycenter.v1.IListAssetsRequest, @@ -3382,18 +3452,7 @@ export class SecurityCenterClient { } /** - * Equivalent to {@link listAssets}, but returns a NodeJS Stream object. - * - * This fetches the paged responses for {@link listAssets} continuously - * and invokes the callback registered for 'data' event for each element in the - * responses. - * - * The returned object has 'end' method when no more elements are required. - * - * autoPaginate option will be ignored. - * - * @see {@link https://nodejs.org/api/stream.html} - * + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -3528,6 +3587,13 @@ export class SecurityCenterClient { * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Stream} * An object stream which emits an object representing [ListAssetsResult]{@link google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listAssetsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. */ listAssetsStream( request?: protos.google.cloud.securitycenter.v1.IListAssetsRequest, @@ -3552,10 +3618,9 @@ export class SecurityCenterClient { } /** - * Equivalent to {@link listAssets}, but returns an iterable object. - * - * for-await-of syntax is used with the iterable to recursively get response element on-demand. + * Equivalent to `listAssets`, but returns an iterable object. * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -3689,7 +3754,18 @@ export class SecurityCenterClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Object} - * An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols. + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [ListAssetsResult]{@link google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example + * const iterable = client.listAssetsAsync(request); + * for await (const response of iterable) { + * // process response + * } */ listAssetsAsync( request?: protos.google.cloud.securitycenter.v1.IListAssetsRequest, @@ -3880,19 +3956,14 @@ export class SecurityCenterClient { * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. * The first element of the array is Array of [ListFindingsResult]{@link google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult}. - * The client library support auto-pagination by default: it will call the API as many + * The client library will perform auto-pagination by default: it will call the API as many * times as needed and will merge results from all the pages into this array. - * - * When autoPaginate: false is specified through options, the array has three elements. - * The first element is Array of [ListFindingsResult]{@link google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult} that corresponds to - * the one page received from the API server. - * If the second element is not null it contains the request object of type [ListFindingsRequest]{@link google.cloud.securitycenter.v1.ListFindingsRequest} - * that can be used to obtain the next page of the results. - * If it is null, the next page does not exist. - * The third element contains the raw response received from the API server. Its type is - * [ListFindingsResponse]{@link google.cloud.securitycenter.v1.ListFindingsResponse}. - * - * The promise has a method named "cancel" which cancels the ongoing API call. + * Note that it can affect your quota. + * We recommend using `listFindingsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. */ listFindings( request: protos.google.cloud.securitycenter.v1.IListFindingsRequest, @@ -3940,18 +4011,7 @@ export class SecurityCenterClient { } /** - * Equivalent to {@link listFindings}, but returns a NodeJS Stream object. - * - * This fetches the paged responses for {@link listFindings} continuously - * and invokes the callback registered for 'data' event for each element in the - * responses. - * - * The returned object has 'end' method when no more elements are required. - * - * autoPaginate option will be ignored. - * - * @see {@link https://nodejs.org/api/stream.html} - * + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -4078,6 +4138,13 @@ export class SecurityCenterClient { * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Stream} * An object stream which emits an object representing [ListFindingsResult]{@link google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listFindingsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. */ listFindingsStream( request?: protos.google.cloud.securitycenter.v1.IListFindingsRequest, @@ -4102,10 +4169,9 @@ export class SecurityCenterClient { } /** - * Equivalent to {@link listFindings}, but returns an iterable object. - * - * for-await-of syntax is used with the iterable to recursively get response element on-demand. + * Equivalent to `listFindings`, but returns an iterable object. * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -4231,7 +4297,18 @@ export class SecurityCenterClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Object} - * An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols. + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [ListFindingsResult]{@link google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example + * const iterable = client.listFindingsAsync(request); + * for await (const response of iterable) { + * // process response + * } */ listFindingsAsync( request?: protos.google.cloud.securitycenter.v1.IListFindingsRequest, @@ -4309,19 +4386,14 @@ export class SecurityCenterClient { * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. * The first element of the array is Array of [NotificationConfig]{@link google.cloud.securitycenter.v1.NotificationConfig}. - * The client library support auto-pagination by default: it will call the API as many + * The client library will perform auto-pagination by default: it will call the API as many * times as needed and will merge results from all the pages into this array. - * - * When autoPaginate: false is specified through options, the array has three elements. - * The first element is Array of [NotificationConfig]{@link google.cloud.securitycenter.v1.NotificationConfig} that corresponds to - * the one page received from the API server. - * If the second element is not null it contains the request object of type [ListNotificationConfigsRequest]{@link google.cloud.securitycenter.v1.ListNotificationConfigsRequest} - * that can be used to obtain the next page of the results. - * If it is null, the next page does not exist. - * The third element contains the raw response received from the API server. Its type is - * [ListNotificationConfigsResponse]{@link google.cloud.securitycenter.v1.ListNotificationConfigsResponse}. - * - * The promise has a method named "cancel" which cancels the ongoing API call. + * Note that it can affect your quota. + * We recommend using `listNotificationConfigsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. */ listNotificationConfigs( request: protos.google.cloud.securitycenter.v1.IListNotificationConfigsRequest, @@ -4373,18 +4445,7 @@ export class SecurityCenterClient { } /** - * Equivalent to {@link listNotificationConfigs}, but returns a NodeJS Stream object. - * - * This fetches the paged responses for {@link listNotificationConfigs} continuously - * and invokes the callback registered for 'data' event for each element in the - * responses. - * - * The returned object has 'end' method when no more elements are required. - * - * autoPaginate option will be ignored. - * - * @see {@link https://nodejs.org/api/stream.html} - * + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -4401,6 +4462,13 @@ export class SecurityCenterClient { * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Stream} * An object stream which emits an object representing [NotificationConfig]{@link google.cloud.securitycenter.v1.NotificationConfig} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listNotificationConfigsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. */ listNotificationConfigsStream( request?: protos.google.cloud.securitycenter.v1.IListNotificationConfigsRequest, @@ -4425,10 +4493,9 @@ export class SecurityCenterClient { } /** - * Equivalent to {@link listNotificationConfigs}, but returns an iterable object. - * - * for-await-of syntax is used with the iterable to recursively get response element on-demand. + * Equivalent to `listNotificationConfigs`, but returns an iterable object. * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -4444,7 +4511,18 @@ export class SecurityCenterClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Object} - * An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols. + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [NotificationConfig]{@link google.cloud.securitycenter.v1.NotificationConfig}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example + * const iterable = client.listNotificationConfigsAsync(request); + * for await (const response of iterable) { + * // process response + * } */ listNotificationConfigsAsync( request?: protos.google.cloud.securitycenter.v1.IListNotificationConfigsRequest, @@ -4520,19 +4598,14 @@ export class SecurityCenterClient { * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. * The first element of the array is Array of [Source]{@link google.cloud.securitycenter.v1.Source}. - * The client library support auto-pagination by default: it will call the API as many + * The client library will perform auto-pagination by default: it will call the API as many * times as needed and will merge results from all the pages into this array. - * - * When autoPaginate: false is specified through options, the array has three elements. - * The first element is Array of [Source]{@link google.cloud.securitycenter.v1.Source} that corresponds to - * the one page received from the API server. - * If the second element is not null it contains the request object of type [ListSourcesRequest]{@link google.cloud.securitycenter.v1.ListSourcesRequest} - * that can be used to obtain the next page of the results. - * If it is null, the next page does not exist. - * The third element contains the raw response received from the API server. Its type is - * [ListSourcesResponse]{@link google.cloud.securitycenter.v1.ListSourcesResponse}. - * - * The promise has a method named "cancel" which cancels the ongoing API call. + * Note that it can affect your quota. + * We recommend using `listSourcesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. */ listSources( request: protos.google.cloud.securitycenter.v1.IListSourcesRequest, @@ -4580,18 +4653,7 @@ export class SecurityCenterClient { } /** - * Equivalent to {@link listSources}, but returns a NodeJS Stream object. - * - * This fetches the paged responses for {@link listSources} continuously - * and invokes the callback registered for 'data' event for each element in the - * responses. - * - * The returned object has 'end' method when no more elements are required. - * - * autoPaginate option will be ignored. - * - * @see {@link https://nodejs.org/api/stream.html} - * + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -4608,6 +4670,13 @@ export class SecurityCenterClient { * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Stream} * An object stream which emits an object representing [Source]{@link google.cloud.securitycenter.v1.Source} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listSourcesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. */ listSourcesStream( request?: protos.google.cloud.securitycenter.v1.IListSourcesRequest, @@ -4632,10 +4701,9 @@ export class SecurityCenterClient { } /** - * Equivalent to {@link listSources}, but returns an iterable object. - * - * for-await-of syntax is used with the iterable to recursively get response element on-demand. + * Equivalent to `listSources`, but returns an iterable object. * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -4651,7 +4719,18 @@ export class SecurityCenterClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Object} - * An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols. + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [Source]{@link google.cloud.securitycenter.v1.Source}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example + * const iterable = client.listSourcesAsync(request); + * for await (const response of iterable) { + * // process response + * } */ listSourcesAsync( request?: protos.google.cloud.securitycenter.v1.IListSourcesRequest, @@ -5008,9 +5087,10 @@ export class SecurityCenterClient { } /** - * Terminate the GRPC channel and close the client. + * 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 { this.initialize(); diff --git a/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.ts b/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.ts index 62c90ca93db..4ef1edbe0e0 100644 --- a/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.ts +++ b/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.ts @@ -62,8 +62,10 @@ export class SecurityCenterClient { /** * Construct an instance of SecurityCenterClient. * - * @param {object} [options] - The configuration object. See the subsequent - * parameters for more details. + * @param {object} [options] - The configuration object. + * The options accepted by the constructor are described in detail + * in [this document](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#creating-the-client-instance). + * The common options are: * @param {object} [options.credentials] - Credentials object. * @param {string} [options.credentials.client_email] * @param {string} [options.credentials.private_key] @@ -83,42 +85,33 @@ export class SecurityCenterClient { * 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. + * TODO(@alexander-fenster): link to gax documentation. + * @param {boolean} fallback - Use HTTP fallback mode. + * In fallback mode, a special browser-compatible transport implementation is used + * instead of gRPC transport. In browser context (if the `window` object is defined) + * the fallback mode is enabled automatically; set `options.fallback` to `false` + * if you need to override this behavior. */ - constructor(opts?: ClientOptions) { - // Ensure that options include the service address and port. + // Ensure that options include all the required fields. const staticMembers = this.constructor as typeof SecurityCenterClient; const servicePath = - opts && opts.servicePath - ? opts.servicePath - : opts && opts.apiEndpoint - ? opts.apiEndpoint - : staticMembers.servicePath; - const port = opts && opts.port ? opts.port : staticMembers.port; - - if (!opts) { - opts = {servicePath, port}; + opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = opts?.fallback ?? typeof window !== 'undefined'; + 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; } - opts.servicePath = opts.servicePath || servicePath; - opts.port = opts.port || port; - - // users can override the config from client side, like retry codes name. - // The detailed structure of the clientConfig can be found here: https://github.com/googleapis/gax-nodejs/blob/master/src/gax.ts#L546 - // The way to override client config for Showcase API: - // - // const customConfig = {"interfaces": {"google.showcase.v1beta1.Echo": {"methods": {"Echo": {"retry_codes_name": "idempotent", "retry_params_name": "default"}}}}} - // const showcaseClient = new showcaseClient({ projectId, customConfig }); - opts.clientConfig = opts.clientConfig || {}; - - // If we're running in browser, it's OK to omit `fallback` since - // google-gax has `browser` field in its `package.json`. - // For Electron (which does not respect `browser` field), - // pass `{fallback: true}` to the SecurityCenterClient constructor. + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. this._gaxModule = opts.fallback ? gax.fallback : gax; - // Create a `gaxGrpc` object, with any grpc-specific options - // sent to the client. - opts.scopes = (this.constructor as typeof SecurityCenterClient).scopes; + // 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. @@ -127,6 +120,11 @@ export class SecurityCenterClient { // Save the auth object to the client, for use by other methods. this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + // 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) { @@ -345,6 +343,7 @@ export class SecurityCenterClient { /** * The DNS address for this API service. + * @returns {string} The DNS address for this service. */ static get servicePath() { return 'securitycenter.googleapis.com'; @@ -353,6 +352,7 @@ export class SecurityCenterClient { /** * 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 'securitycenter.googleapis.com'; @@ -360,6 +360,7 @@ export class SecurityCenterClient { /** * The port for this API service. + * @returns {number} The default port for this service. */ static get port() { return 443; @@ -368,6 +369,7 @@ export class SecurityCenterClient { /** * 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/cloud-platform']; @@ -377,8 +379,7 @@ export class SecurityCenterClient { getProjectId(callback: Callback): void; /** * Return the project ID used by this class. - * @param {function(Error, string)} callback - the callback to - * be called with the current project Id. + * @returns {Promise} A promise that resolves to string containing the project ID. */ getProjectId( callback?: Callback @@ -442,7 +443,11 @@ export class SecurityCenterClient { * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. * The first element of the array is an object representing [Source]{@link google.cloud.securitycenter.v1beta1.Source}. - * The promise has a method named "cancel" which cancels the ongoing API call. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * const [response] = await client.createSource(request); */ createSource( request: protos.google.cloud.securitycenter.v1beta1.ICreateSourceRequest, @@ -545,7 +550,11 @@ export class SecurityCenterClient { * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. * The first element of the array is an object representing [Finding]{@link google.cloud.securitycenter.v1beta1.Finding}. - * The promise has a method named "cancel" which cancels the ongoing API call. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * const [response] = await client.createFinding(request); */ createFinding( request: protos.google.cloud.securitycenter.v1beta1.ICreateFindingRequest, @@ -636,7 +645,11 @@ export class SecurityCenterClient { * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. * The first element of the array is an object representing [Policy]{@link google.iam.v1.Policy}. - * The promise has a method named "cancel" which cancels the ongoing API call. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * const [response] = await client.getIamPolicy(request); */ getIamPolicy( request: protos.google.iam.v1.IGetIamPolicyRequest, @@ -724,7 +737,11 @@ export class SecurityCenterClient { * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. * The first element of the array is an object representing [OrganizationSettings]{@link google.cloud.securitycenter.v1beta1.OrganizationSettings}. - * The promise has a method named "cancel" which cancels the ongoing API call. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * const [response] = await client.getOrganizationSettings(request); */ getOrganizationSettings( request: protos.google.cloud.securitycenter.v1beta1.IGetOrganizationSettingsRequest, @@ -820,7 +837,11 @@ export class SecurityCenterClient { * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. * The first element of the array is an object representing [Source]{@link google.cloud.securitycenter.v1beta1.Source}. - * The promise has a method named "cancel" which cancels the ongoing API call. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * const [response] = await client.getSource(request); */ getSource( request: protos.google.cloud.securitycenter.v1beta1.IGetSourceRequest, @@ -918,7 +939,11 @@ export class SecurityCenterClient { * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. * The first element of the array is an object representing [Finding]{@link google.cloud.securitycenter.v1beta1.Finding}. - * The promise has a method named "cancel" which cancels the ongoing API call. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * const [response] = await client.setFindingState(request); */ setFindingState( request: protos.google.cloud.securitycenter.v1beta1.ISetFindingStateRequest, @@ -1011,7 +1036,11 @@ export class SecurityCenterClient { * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. * The first element of the array is an object representing [Policy]{@link google.iam.v1.Policy}. - * The promise has a method named "cancel" which cancels the ongoing API call. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * const [response] = await client.setIamPolicy(request); */ setIamPolicy( request: protos.google.iam.v1.ISetIamPolicyRequest, @@ -1097,7 +1126,11 @@ export class SecurityCenterClient { * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. * The first element of the array is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. - * The promise has a method named "cancel" which cancels the ongoing API call. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * const [response] = await client.testIamPermissions(request); */ testIamPermissions( request: protos.google.iam.v1.ITestIamPermissionsRequest, @@ -1193,7 +1226,11 @@ export class SecurityCenterClient { * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. * The first element of the array is an object representing [Finding]{@link google.cloud.securitycenter.v1beta1.Finding}. - * The promise has a method named "cancel" which cancels the ongoing API call. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * const [response] = await client.updateFinding(request); */ updateFinding( request: protos.google.cloud.securitycenter.v1beta1.IUpdateFindingRequest, @@ -1289,7 +1326,11 @@ export class SecurityCenterClient { * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. * The first element of the array is an object representing [OrganizationSettings]{@link google.cloud.securitycenter.v1beta1.OrganizationSettings}. - * The promise has a method named "cancel" which cancels the ongoing API call. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * const [response] = await client.updateOrganizationSettings(request); */ updateOrganizationSettings( request: protos.google.cloud.securitycenter.v1beta1.IUpdateOrganizationSettingsRequest, @@ -1389,7 +1430,11 @@ export class SecurityCenterClient { * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. * The first element of the array is an object representing [Source]{@link google.cloud.securitycenter.v1beta1.Source}. - * The promise has a method named "cancel" which cancels the ongoing API call. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * const [response] = await client.updateSource(request); */ updateSource( request: protos.google.cloud.securitycenter.v1beta1.IUpdateSourceRequest, @@ -1487,7 +1532,11 @@ export class SecurityCenterClient { * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. * The first element of the array is an object representing [SecurityMarks]{@link google.cloud.securitycenter.v1beta1.SecurityMarks}. - * The promise has a method named "cancel" which cancels the ongoing API call. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * const [response] = await client.updateSecurityMarks(request); */ updateSecurityMarks( request: protos.google.cloud.securitycenter.v1beta1.IUpdateSecurityMarksRequest, @@ -1580,8 +1629,15 @@ export class SecurityCenterClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.longrunning.Operation}. - * The promise has a method named "cancel" which cancels the ongoing API call. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * const [operation] = await client.runAssetDiscovery(request); + * const [response] = await operation.promise(); */ runAssetDiscovery( request: protos.google.cloud.securitycenter.v1beta1.IRunAssetDiscoveryRequest, @@ -1627,18 +1683,19 @@ export class SecurityCenterClient { return this.innerApiCalls.runAssetDiscovery(request, options, callback); } /** - * Check the status of the long running operation returned by the runAssetDiscovery() method. + * Check the status of the long running operation returned by `runAssetDiscovery()`. * @param {String} name * The operation name that will be passed. * @returns {Promise} - The promise which resolves to an object. * The decoded operation object has result and metadata field to get information from. - * - * @example: - * const decodedOperation = await checkRunAssetDiscoveryProgress(name); - * console.log(decodedOperation.result); - * console.log(decodedOperation.done); - * console.log(decodedOperation.metadata); - * + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * const decodedOperation = await checkRunAssetDiscoveryProgress(name); + * console.log(decodedOperation.result); + * console.log(decodedOperation.done); + * console.log(decodedOperation.metadata); */ async checkRunAssetDiscoveryProgress( name: string @@ -1780,19 +1837,14 @@ export class SecurityCenterClient { * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. * The first element of the array is Array of [GroupResult]{@link google.cloud.securitycenter.v1beta1.GroupResult}. - * The client library support auto-pagination by default: it will call the API as many + * The client library will perform auto-pagination by default: it will call the API as many * times as needed and will merge results from all the pages into this array. - * - * When autoPaginate: false is specified through options, the array has three elements. - * The first element is Array of [GroupResult]{@link google.cloud.securitycenter.v1beta1.GroupResult} that corresponds to - * the one page received from the API server. - * If the second element is not null it contains the request object of type [GroupAssetsRequest]{@link google.cloud.securitycenter.v1beta1.GroupAssetsRequest} - * that can be used to obtain the next page of the results. - * If it is null, the next page does not exist. - * The third element contains the raw response received from the API server. Its type is - * [GroupAssetsResponse]{@link google.cloud.securitycenter.v1beta1.GroupAssetsResponse}. - * - * The promise has a method named "cancel" which cancels the ongoing API call. + * Note that it can affect your quota. + * We recommend using `groupAssetsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. */ groupAssets( request: protos.google.cloud.securitycenter.v1beta1.IGroupAssetsRequest, @@ -1840,18 +1892,7 @@ export class SecurityCenterClient { } /** - * Equivalent to {@link groupAssets}, but returns a NodeJS Stream object. - * - * This fetches the paged responses for {@link groupAssets} continuously - * and invokes the callback registered for 'data' event for each element in the - * responses. - * - * The returned object has 'end' method when no more elements are required. - * - * autoPaginate option will be ignored. - * - * @see {@link https://nodejs.org/api/stream.html} - * + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -1938,6 +1979,13 @@ export class SecurityCenterClient { * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Stream} * An object stream which emits an object representing [GroupResult]{@link google.cloud.securitycenter.v1beta1.GroupResult} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `groupAssetsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. */ groupAssetsStream( request?: protos.google.cloud.securitycenter.v1beta1.IGroupAssetsRequest, @@ -1962,10 +2010,9 @@ export class SecurityCenterClient { } /** - * Equivalent to {@link groupAssets}, but returns an iterable object. - * - * for-await-of syntax is used with the iterable to recursively get response element on-demand. + * Equivalent to `groupAssets`, but returns an iterable object. * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -2051,7 +2098,18 @@ export class SecurityCenterClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Object} - * An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols. + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [GroupResult]{@link google.cloud.securitycenter.v1beta1.GroupResult}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example + * const iterable = client.groupAssetsAsync(request); + * for await (const response of iterable) { + * // process response + * } */ groupAssetsAsync( request?: protos.google.cloud.securitycenter.v1beta1.IGroupAssetsRequest, @@ -2174,19 +2232,14 @@ export class SecurityCenterClient { * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. * The first element of the array is Array of [GroupResult]{@link google.cloud.securitycenter.v1beta1.GroupResult}. - * The client library support auto-pagination by default: it will call the API as many + * The client library will perform auto-pagination by default: it will call the API as many * times as needed and will merge results from all the pages into this array. - * - * When autoPaginate: false is specified through options, the array has three elements. - * The first element is Array of [GroupResult]{@link google.cloud.securitycenter.v1beta1.GroupResult} that corresponds to - * the one page received from the API server. - * If the second element is not null it contains the request object of type [GroupFindingsRequest]{@link google.cloud.securitycenter.v1beta1.GroupFindingsRequest} - * that can be used to obtain the next page of the results. - * If it is null, the next page does not exist. - * The third element contains the raw response received from the API server. Its type is - * [GroupFindingsResponse]{@link google.cloud.securitycenter.v1beta1.GroupFindingsResponse}. - * - * The promise has a method named "cancel" which cancels the ongoing API call. + * Note that it can affect your quota. + * We recommend using `groupFindingsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. */ groupFindings( request: protos.google.cloud.securitycenter.v1beta1.IGroupFindingsRequest, @@ -2234,18 +2287,7 @@ export class SecurityCenterClient { } /** - * Equivalent to {@link groupFindings}, but returns a NodeJS Stream object. - * - * This fetches the paged responses for {@link groupFindings} continuously - * and invokes the callback registered for 'data' event for each element in the - * responses. - * - * The returned object has 'end' method when no more elements are required. - * - * autoPaginate option will be ignored. - * - * @see {@link https://nodejs.org/api/stream.html} - * + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -2307,6 +2349,13 @@ export class SecurityCenterClient { * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Stream} * An object stream which emits an object representing [GroupResult]{@link google.cloud.securitycenter.v1beta1.GroupResult} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `groupFindingsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. */ groupFindingsStream( request?: protos.google.cloud.securitycenter.v1beta1.IGroupFindingsRequest, @@ -2331,10 +2380,9 @@ export class SecurityCenterClient { } /** - * Equivalent to {@link groupFindings}, but returns an iterable object. - * - * for-await-of syntax is used with the iterable to recursively get response element on-demand. + * Equivalent to `groupFindings`, but returns an iterable object. * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -2395,7 +2443,18 @@ export class SecurityCenterClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Object} - * An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols. + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [GroupResult]{@link google.cloud.securitycenter.v1beta1.GroupResult}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example + * const iterable = client.groupFindingsAsync(request); + * for await (const response of iterable) { + * // process response + * } */ groupFindingsAsync( request?: protos.google.cloud.securitycenter.v1beta1.IGroupFindingsRequest, @@ -2539,19 +2598,14 @@ export class SecurityCenterClient { * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. * The first element of the array is Array of [ListAssetsResult]{@link google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult}. - * The client library support auto-pagination by default: it will call the API as many + * The client library will perform auto-pagination by default: it will call the API as many * times as needed and will merge results from all the pages into this array. - * - * When autoPaginate: false is specified through options, the array has three elements. - * The first element is Array of [ListAssetsResult]{@link google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult} that corresponds to - * the one page received from the API server. - * If the second element is not null it contains the request object of type [ListAssetsRequest]{@link google.cloud.securitycenter.v1beta1.ListAssetsRequest} - * that can be used to obtain the next page of the results. - * If it is null, the next page does not exist. - * The third element contains the raw response received from the API server. Its type is - * [ListAssetsResponse]{@link google.cloud.securitycenter.v1beta1.ListAssetsResponse}. - * - * The promise has a method named "cancel" which cancels the ongoing API call. + * Note that it can affect your quota. + * We recommend using `listAssetsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. */ listAssets( request: protos.google.cloud.securitycenter.v1beta1.IListAssetsRequest, @@ -2599,18 +2653,7 @@ export class SecurityCenterClient { } /** - * Equivalent to {@link listAssets}, but returns a NodeJS Stream object. - * - * This fetches the paged responses for {@link listAssets} continuously - * and invokes the callback registered for 'data' event for each element in the - * responses. - * - * The returned object has 'end' method when no more elements are required. - * - * autoPaginate option will be ignored. - * - * @see {@link https://nodejs.org/api/stream.html} - * + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -2697,6 +2740,13 @@ export class SecurityCenterClient { * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Stream} * An object stream which emits an object representing [ListAssetsResult]{@link google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listAssetsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. */ listAssetsStream( request?: protos.google.cloud.securitycenter.v1beta1.IListAssetsRequest, @@ -2721,10 +2771,9 @@ export class SecurityCenterClient { } /** - * Equivalent to {@link listAssets}, but returns an iterable object. - * - * for-await-of syntax is used with the iterable to recursively get response element on-demand. + * Equivalent to `listAssets`, but returns an iterable object. * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -2810,7 +2859,18 @@ export class SecurityCenterClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Object} - * An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols. + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [ListAssetsResult]{@link google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example + * const iterable = client.listAssetsAsync(request); + * for await (const response of iterable) { + * // process response + * } */ listAssetsAsync( request?: protos.google.cloud.securitycenter.v1beta1.IListAssetsRequest, @@ -2936,19 +2996,14 @@ export class SecurityCenterClient { * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. * The first element of the array is Array of [Finding]{@link google.cloud.securitycenter.v1beta1.Finding}. - * The client library support auto-pagination by default: it will call the API as many + * The client library will perform auto-pagination by default: it will call the API as many * times as needed and will merge results from all the pages into this array. - * - * When autoPaginate: false is specified through options, the array has three elements. - * The first element is Array of [Finding]{@link google.cloud.securitycenter.v1beta1.Finding} that corresponds to - * the one page received from the API server. - * If the second element is not null it contains the request object of type [ListFindingsRequest]{@link google.cloud.securitycenter.v1beta1.ListFindingsRequest} - * that can be used to obtain the next page of the results. - * If it is null, the next page does not exist. - * The third element contains the raw response received from the API server. Its type is - * [ListFindingsResponse]{@link google.cloud.securitycenter.v1beta1.ListFindingsResponse}. - * - * The promise has a method named "cancel" which cancels the ongoing API call. + * Note that it can affect your quota. + * We recommend using `listFindingsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. */ listFindings( request: protos.google.cloud.securitycenter.v1beta1.IListFindingsRequest, @@ -2996,18 +3051,7 @@ export class SecurityCenterClient { } /** - * Equivalent to {@link listFindings}, but returns a NodeJS Stream object. - * - * This fetches the paged responses for {@link listFindings} continuously - * and invokes the callback registered for 'data' event for each element in the - * responses. - * - * The returned object has 'end' method when no more elements are required. - * - * autoPaginate option will be ignored. - * - * @see {@link https://nodejs.org/api/stream.html} - * + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -3069,6 +3113,13 @@ export class SecurityCenterClient { * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Stream} * An object stream which emits an object representing [Finding]{@link google.cloud.securitycenter.v1beta1.Finding} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listFindingsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. */ listFindingsStream( request?: protos.google.cloud.securitycenter.v1beta1.IListFindingsRequest, @@ -3093,10 +3144,9 @@ export class SecurityCenterClient { } /** - * Equivalent to {@link listFindings}, but returns an iterable object. - * - * for-await-of syntax is used with the iterable to recursively get response element on-demand. + * Equivalent to `listFindings`, but returns an iterable object. * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -3157,7 +3207,18 @@ export class SecurityCenterClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Object} - * An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols. + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [Finding]{@link google.cloud.securitycenter.v1beta1.Finding}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example + * const iterable = client.listFindingsAsync(request); + * for await (const response of iterable) { + * // process response + * } */ listFindingsAsync( request?: protos.google.cloud.securitycenter.v1beta1.IListFindingsRequest, @@ -3231,19 +3292,14 @@ export class SecurityCenterClient { * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. * The first element of the array is Array of [Source]{@link google.cloud.securitycenter.v1beta1.Source}. - * The client library support auto-pagination by default: it will call the API as many + * The client library will perform auto-pagination by default: it will call the API as many * times as needed and will merge results from all the pages into this array. - * - * When autoPaginate: false is specified through options, the array has three elements. - * The first element is Array of [Source]{@link google.cloud.securitycenter.v1beta1.Source} that corresponds to - * the one page received from the API server. - * If the second element is not null it contains the request object of type [ListSourcesRequest]{@link google.cloud.securitycenter.v1beta1.ListSourcesRequest} - * that can be used to obtain the next page of the results. - * If it is null, the next page does not exist. - * The third element contains the raw response received from the API server. Its type is - * [ListSourcesResponse]{@link google.cloud.securitycenter.v1beta1.ListSourcesResponse}. - * - * The promise has a method named "cancel" which cancels the ongoing API call. + * Note that it can affect your quota. + * We recommend using `listSourcesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. */ listSources( request: protos.google.cloud.securitycenter.v1beta1.IListSourcesRequest, @@ -3291,18 +3347,7 @@ export class SecurityCenterClient { } /** - * Equivalent to {@link listSources}, but returns a NodeJS Stream object. - * - * This fetches the paged responses for {@link listSources} continuously - * and invokes the callback registered for 'data' event for each element in the - * responses. - * - * The returned object has 'end' method when no more elements are required. - * - * autoPaginate option will be ignored. - * - * @see {@link https://nodejs.org/api/stream.html} - * + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -3319,6 +3364,13 @@ export class SecurityCenterClient { * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Stream} * An object stream which emits an object representing [Source]{@link google.cloud.securitycenter.v1beta1.Source} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listSourcesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. */ listSourcesStream( request?: protos.google.cloud.securitycenter.v1beta1.IListSourcesRequest, @@ -3343,10 +3395,9 @@ export class SecurityCenterClient { } /** - * Equivalent to {@link listSources}, but returns an iterable object. - * - * for-await-of syntax is used with the iterable to recursively get response element on-demand. + * Equivalent to `listSources`, but returns an iterable object. * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -3362,7 +3413,18 @@ export class SecurityCenterClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Object} - * An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols. + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [Source]{@link google.cloud.securitycenter.v1beta1.Source}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example + * const iterable = client.listSourcesAsync(request); + * for await (const response of iterable) { + * // process response + * } */ listSourcesAsync( request?: protos.google.cloud.securitycenter.v1beta1.IListSourcesRequest, @@ -3677,9 +3739,10 @@ export class SecurityCenterClient { } /** - * Terminate the GRPC channel and close the client. + * 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 { this.initialize(); diff --git a/packages/google-cloud-securitycenter/src/v1p1beta1/security_center_client.ts b/packages/google-cloud-securitycenter/src/v1p1beta1/security_center_client.ts index 509dc93f537..aab0141fed9 100644 --- a/packages/google-cloud-securitycenter/src/v1p1beta1/security_center_client.ts +++ b/packages/google-cloud-securitycenter/src/v1p1beta1/security_center_client.ts @@ -62,8 +62,10 @@ export class SecurityCenterClient { /** * Construct an instance of SecurityCenterClient. * - * @param {object} [options] - The configuration object. See the subsequent - * parameters for more details. + * @param {object} [options] - The configuration object. + * The options accepted by the constructor are described in detail + * in [this document](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#creating-the-client-instance). + * The common options are: * @param {object} [options.credentials] - Credentials object. * @param {string} [options.credentials.client_email] * @param {string} [options.credentials.private_key] @@ -83,42 +85,33 @@ export class SecurityCenterClient { * 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. + * TODO(@alexander-fenster): link to gax documentation. + * @param {boolean} fallback - Use HTTP fallback mode. + * In fallback mode, a special browser-compatible transport implementation is used + * instead of gRPC transport. In browser context (if the `window` object is defined) + * the fallback mode is enabled automatically; set `options.fallback` to `false` + * if you need to override this behavior. */ - constructor(opts?: ClientOptions) { - // Ensure that options include the service address and port. + // Ensure that options include all the required fields. const staticMembers = this.constructor as typeof SecurityCenterClient; const servicePath = - opts && opts.servicePath - ? opts.servicePath - : opts && opts.apiEndpoint - ? opts.apiEndpoint - : staticMembers.servicePath; - const port = opts && opts.port ? opts.port : staticMembers.port; + opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = opts?.fallback ?? typeof window !== 'undefined'; + opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); - if (!opts) { - opts = {servicePath, port}; + // 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; } - opts.servicePath = opts.servicePath || servicePath; - opts.port = opts.port || port; - - // users can override the config from client side, like retry codes name. - // The detailed structure of the clientConfig can be found here: https://github.com/googleapis/gax-nodejs/blob/master/src/gax.ts#L546 - // The way to override client config for Showcase API: - // - // const customConfig = {"interfaces": {"google.showcase.v1beta1.Echo": {"methods": {"Echo": {"retry_codes_name": "idempotent", "retry_params_name": "default"}}}}} - // const showcaseClient = new showcaseClient({ projectId, customConfig }); - opts.clientConfig = opts.clientConfig || {}; - // If we're running in browser, it's OK to omit `fallback` since - // google-gax has `browser` field in its `package.json`. - // For Electron (which does not respect `browser` field), - // pass `{fallback: true}` to the SecurityCenterClient constructor. + // Choose either gRPC or proto-over-HTTP implementation of google-gax. this._gaxModule = opts.fallback ? gax.fallback : gax; - // Create a `gaxGrpc` object, with any grpc-specific options - // sent to the client. - opts.scopes = (this.constructor as typeof SecurityCenterClient).scopes; + // 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. @@ -127,6 +120,11 @@ export class SecurityCenterClient { // Save the auth object to the client, for use by other methods. this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + // 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) { @@ -358,6 +356,7 @@ export class SecurityCenterClient { /** * The DNS address for this API service. + * @returns {string} The DNS address for this service. */ static get servicePath() { return 'securitycenter.googleapis.com'; @@ -366,6 +365,7 @@ export class SecurityCenterClient { /** * 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 'securitycenter.googleapis.com'; @@ -373,6 +373,7 @@ export class SecurityCenterClient { /** * The port for this API service. + * @returns {number} The default port for this service. */ static get port() { return 443; @@ -381,6 +382,7 @@ export class SecurityCenterClient { /** * 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/cloud-platform']; @@ -390,8 +392,7 @@ export class SecurityCenterClient { getProjectId(callback: Callback): void; /** * Return the project ID used by this class. - * @param {function(Error, string)} callback - the callback to - * be called with the current project Id. + * @returns {Promise} A promise that resolves to string containing the project ID. */ getProjectId( callback?: Callback @@ -455,7 +456,11 @@ export class SecurityCenterClient { * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. * The first element of the array is an object representing [Source]{@link google.cloud.securitycenter.v1p1beta1.Source}. - * The promise has a method named "cancel" which cancels the ongoing API call. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * const [response] = await client.createSource(request); */ createSource( request: protos.google.cloud.securitycenter.v1p1beta1.ICreateSourceRequest, @@ -556,7 +561,11 @@ export class SecurityCenterClient { * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. * The first element of the array is an object representing [Finding]{@link google.cloud.securitycenter.v1p1beta1.Finding}. - * The promise has a method named "cancel" which cancels the ongoing API call. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * const [response] = await client.createFinding(request); */ createFinding( request: protos.google.cloud.securitycenter.v1p1beta1.ICreateFindingRequest, @@ -658,7 +667,11 @@ export class SecurityCenterClient { * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. * The first element of the array is an object representing [NotificationConfig]{@link google.cloud.securitycenter.v1p1beta1.NotificationConfig}. - * The promise has a method named "cancel" which cancels the ongoing API call. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * const [response] = await client.createNotificationConfig(request); */ createNotificationConfig( request: protos.google.cloud.securitycenter.v1p1beta1.ICreateNotificationConfigRequest, @@ -757,7 +770,11 @@ export class SecurityCenterClient { * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. - * The promise has a method named "cancel" which cancels the ongoing API call. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * const [response] = await client.deleteNotificationConfig(request); */ deleteNotificationConfig( request: protos.google.cloud.securitycenter.v1p1beta1.IDeleteNotificationConfigRequest, @@ -852,7 +869,11 @@ export class SecurityCenterClient { * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. * The first element of the array is an object representing [Policy]{@link google.iam.v1.Policy}. - * The promise has a method named "cancel" which cancels the ongoing API call. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * const [response] = await client.getIamPolicy(request); */ getIamPolicy( request: protos.google.iam.v1.IGetIamPolicyRequest, @@ -940,7 +961,11 @@ export class SecurityCenterClient { * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. * The first element of the array is an object representing [NotificationConfig]{@link google.cloud.securitycenter.v1p1beta1.NotificationConfig}. - * The promise has a method named "cancel" which cancels the ongoing API call. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * const [response] = await client.getNotificationConfig(request); */ getNotificationConfig( request: protos.google.cloud.securitycenter.v1p1beta1.IGetNotificationConfigRequest, @@ -1035,7 +1060,11 @@ export class SecurityCenterClient { * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. * The first element of the array is an object representing [OrganizationSettings]{@link google.cloud.securitycenter.v1p1beta1.OrganizationSettings}. - * The promise has a method named "cancel" which cancels the ongoing API call. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * const [response] = await client.getOrganizationSettings(request); */ getOrganizationSettings( request: protos.google.cloud.securitycenter.v1p1beta1.IGetOrganizationSettingsRequest, @@ -1134,7 +1163,11 @@ export class SecurityCenterClient { * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. * The first element of the array is an object representing [Source]{@link google.cloud.securitycenter.v1p1beta1.Source}. - * The promise has a method named "cancel" which cancels the ongoing API call. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * const [response] = await client.getSource(request); */ getSource( request: protos.google.cloud.securitycenter.v1p1beta1.IGetSourceRequest, @@ -1235,7 +1268,11 @@ export class SecurityCenterClient { * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. * The first element of the array is an object representing [Finding]{@link google.cloud.securitycenter.v1p1beta1.Finding}. - * The promise has a method named "cancel" which cancels the ongoing API call. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * const [response] = await client.setFindingState(request); */ setFindingState( request: protos.google.cloud.securitycenter.v1p1beta1.ISetFindingStateRequest, @@ -1328,7 +1365,11 @@ export class SecurityCenterClient { * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. * The first element of the array is an object representing [Policy]{@link google.iam.v1.Policy}. - * The promise has a method named "cancel" which cancels the ongoing API call. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * const [response] = await client.setIamPolicy(request); */ setIamPolicy( request: protos.google.iam.v1.ISetIamPolicyRequest, @@ -1414,7 +1455,11 @@ export class SecurityCenterClient { * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. * The first element of the array is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. - * The promise has a method named "cancel" which cancels the ongoing API call. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * const [response] = await client.testIamPermissions(request); */ testIamPermissions( request: protos.google.iam.v1.ITestIamPermissionsRequest, @@ -1515,7 +1560,11 @@ export class SecurityCenterClient { * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. * The first element of the array is an object representing [Finding]{@link google.cloud.securitycenter.v1p1beta1.Finding}. - * The promise has a method named "cancel" which cancels the ongoing API call. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * const [response] = await client.updateFinding(request); */ updateFinding( request: protos.google.cloud.securitycenter.v1p1beta1.IUpdateFindingRequest, @@ -1614,7 +1663,11 @@ export class SecurityCenterClient { * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. * The first element of the array is an object representing [NotificationConfig]{@link google.cloud.securitycenter.v1p1beta1.NotificationConfig}. - * The promise has a method named "cancel" which cancels the ongoing API call. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * const [response] = await client.updateNotificationConfig(request); */ updateNotificationConfig( request: protos.google.cloud.securitycenter.v1p1beta1.IUpdateNotificationConfigRequest, @@ -1716,7 +1769,11 @@ export class SecurityCenterClient { * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. * The first element of the array is an object representing [OrganizationSettings]{@link google.cloud.securitycenter.v1p1beta1.OrganizationSettings}. - * The promise has a method named "cancel" which cancels the ongoing API call. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * const [response] = await client.updateOrganizationSettings(request); */ updateOrganizationSettings( request: protos.google.cloud.securitycenter.v1p1beta1.IUpdateOrganizationSettingsRequest, @@ -1818,7 +1875,11 @@ export class SecurityCenterClient { * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. * The first element of the array is an object representing [Source]{@link google.cloud.securitycenter.v1p1beta1.Source}. - * The promise has a method named "cancel" which cancels the ongoing API call. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * const [response] = await client.updateSource(request); */ updateSource( request: protos.google.cloud.securitycenter.v1p1beta1.IUpdateSourceRequest, @@ -1922,7 +1983,11 @@ export class SecurityCenterClient { * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. * The first element of the array is an object representing [SecurityMarks]{@link google.cloud.securitycenter.v1p1beta1.SecurityMarks}. - * The promise has a method named "cancel" which cancels the ongoing API call. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * const [response] = await client.updateSecurityMarks(request); */ updateSecurityMarks( request: protos.google.cloud.securitycenter.v1p1beta1.IUpdateSecurityMarksRequest, @@ -2024,8 +2089,15 @@ export class SecurityCenterClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.longrunning.Operation}. - * The promise has a method named "cancel" which cancels the ongoing API call. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * const [operation] = await client.runAssetDiscovery(request); + * const [response] = await operation.promise(); */ runAssetDiscovery( request: protos.google.cloud.securitycenter.v1p1beta1.IRunAssetDiscoveryRequest, @@ -2077,18 +2149,19 @@ export class SecurityCenterClient { return this.innerApiCalls.runAssetDiscovery(request, options, callback); } /** - * Check the status of the long running operation returned by the runAssetDiscovery() method. + * Check the status of the long running operation returned by `runAssetDiscovery()`. * @param {String} name * The operation name that will be passed. * @returns {Promise} - The promise which resolves to an object. * The decoded operation object has result and metadata field to get information from. - * - * @example: - * const decodedOperation = await checkRunAssetDiscoveryProgress(name); - * console.log(decodedOperation.result); - * console.log(decodedOperation.done); - * console.log(decodedOperation.metadata); - * + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * const decodedOperation = await checkRunAssetDiscoveryProgress(name); + * console.log(decodedOperation.result); + * console.log(decodedOperation.done); + * console.log(decodedOperation.metadata); */ async checkRunAssetDiscoveryProgress( name: string @@ -2278,19 +2351,14 @@ export class SecurityCenterClient { * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. * The first element of the array is Array of [GroupResult]{@link google.cloud.securitycenter.v1p1beta1.GroupResult}. - * The client library support auto-pagination by default: it will call the API as many + * The client library will perform auto-pagination by default: it will call the API as many * times as needed and will merge results from all the pages into this array. - * - * When autoPaginate: false is specified through options, the array has three elements. - * The first element is Array of [GroupResult]{@link google.cloud.securitycenter.v1p1beta1.GroupResult} that corresponds to - * the one page received from the API server. - * If the second element is not null it contains the request object of type [GroupAssetsRequest]{@link google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest} - * that can be used to obtain the next page of the results. - * If it is null, the next page does not exist. - * The third element contains the raw response received from the API server. Its type is - * [GroupAssetsResponse]{@link google.cloud.securitycenter.v1p1beta1.GroupAssetsResponse}. - * - * The promise has a method named "cancel" which cancels the ongoing API call. + * Note that it can affect your quota. + * We recommend using `groupAssetsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. */ groupAssets( request: protos.google.cloud.securitycenter.v1p1beta1.IGroupAssetsRequest, @@ -2338,18 +2406,7 @@ export class SecurityCenterClient { } /** - * Equivalent to {@link groupAssets}, but returns a NodeJS Stream object. - * - * This fetches the paged responses for {@link groupAssets} continuously - * and invokes the callback registered for 'data' event for each element in the - * responses. - * - * The returned object has 'end' method when no more elements are required. - * - * autoPaginate option will be ignored. - * - * @see {@link https://nodejs.org/api/stream.html} - * + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -2481,6 +2538,13 @@ export class SecurityCenterClient { * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Stream} * An object stream which emits an object representing [GroupResult]{@link google.cloud.securitycenter.v1p1beta1.GroupResult} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `groupAssetsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. */ groupAssetsStream( request?: protos.google.cloud.securitycenter.v1p1beta1.IGroupAssetsRequest, @@ -2505,10 +2569,9 @@ export class SecurityCenterClient { } /** - * Equivalent to {@link groupAssets}, but returns an iterable object. - * - * for-await-of syntax is used with the iterable to recursively get response element on-demand. + * Equivalent to `groupAssets`, but returns an iterable object. * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -2639,7 +2702,18 @@ export class SecurityCenterClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Object} - * An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols. + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [GroupResult]{@link google.cloud.securitycenter.v1p1beta1.GroupResult}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example + * const iterable = client.groupAssetsAsync(request); + * for await (const response of iterable) { + * // process response + * } */ groupAssetsAsync( request?: protos.google.cloud.securitycenter.v1p1beta1.IGroupAssetsRequest, @@ -2826,19 +2900,14 @@ export class SecurityCenterClient { * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. * The first element of the array is Array of [GroupResult]{@link google.cloud.securitycenter.v1p1beta1.GroupResult}. - * The client library support auto-pagination by default: it will call the API as many + * The client library will perform auto-pagination by default: it will call the API as many * times as needed and will merge results from all the pages into this array. - * - * When autoPaginate: false is specified through options, the array has three elements. - * The first element is Array of [GroupResult]{@link google.cloud.securitycenter.v1p1beta1.GroupResult} that corresponds to - * the one page received from the API server. - * If the second element is not null it contains the request object of type [GroupFindingsRequest]{@link google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest} - * that can be used to obtain the next page of the results. - * If it is null, the next page does not exist. - * The third element contains the raw response received from the API server. Its type is - * [GroupFindingsResponse]{@link google.cloud.securitycenter.v1p1beta1.GroupFindingsResponse}. - * - * The promise has a method named "cancel" which cancels the ongoing API call. + * Note that it can affect your quota. + * We recommend using `groupFindingsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. */ groupFindings( request: protos.google.cloud.securitycenter.v1p1beta1.IGroupFindingsRequest, @@ -2886,18 +2955,7 @@ export class SecurityCenterClient { } /** - * Equivalent to {@link groupFindings}, but returns a NodeJS Stream object. - * - * This fetches the paged responses for {@link groupFindings} continuously - * and invokes the callback registered for 'data' event for each element in the - * responses. - * - * The returned object has 'end' method when no more elements are required. - * - * autoPaginate option will be ignored. - * - * @see {@link https://nodejs.org/api/stream.html} - * + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -3021,6 +3079,13 @@ export class SecurityCenterClient { * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Stream} * An object stream which emits an object representing [GroupResult]{@link google.cloud.securitycenter.v1p1beta1.GroupResult} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `groupFindingsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. */ groupFindingsStream( request?: protos.google.cloud.securitycenter.v1p1beta1.IGroupFindingsRequest, @@ -3045,10 +3110,9 @@ export class SecurityCenterClient { } /** - * Equivalent to {@link groupFindings}, but returns an iterable object. - * - * for-await-of syntax is used with the iterable to recursively get response element on-demand. + * Equivalent to `groupFindings`, but returns an iterable object. * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -3171,7 +3235,18 @@ export class SecurityCenterClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Object} - * An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols. + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [GroupResult]{@link google.cloud.securitycenter.v1p1beta1.GroupResult}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example + * const iterable = client.groupFindingsAsync(request); + * for await (const response of iterable) { + * // process response + * } */ groupFindingsAsync( request?: protos.google.cloud.securitycenter.v1p1beta1.IGroupFindingsRequest, @@ -3366,19 +3441,14 @@ export class SecurityCenterClient { * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. * The first element of the array is Array of [ListAssetsResult]{@link google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult}. - * The client library support auto-pagination by default: it will call the API as many + * The client library will perform auto-pagination by default: it will call the API as many * times as needed and will merge results from all the pages into this array. - * - * When autoPaginate: false is specified through options, the array has three elements. - * The first element is Array of [ListAssetsResult]{@link google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult} that corresponds to - * the one page received from the API server. - * If the second element is not null it contains the request object of type [ListAssetsRequest]{@link google.cloud.securitycenter.v1p1beta1.ListAssetsRequest} - * that can be used to obtain the next page of the results. - * If it is null, the next page does not exist. - * The third element contains the raw response received from the API server. Its type is - * [ListAssetsResponse]{@link google.cloud.securitycenter.v1p1beta1.ListAssetsResponse}. - * - * The promise has a method named "cancel" which cancels the ongoing API call. + * Note that it can affect your quota. + * We recommend using `listAssetsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. */ listAssets( request: protos.google.cloud.securitycenter.v1p1beta1.IListAssetsRequest, @@ -3426,18 +3496,7 @@ export class SecurityCenterClient { } /** - * Equivalent to {@link listAssets}, but returns a NodeJS Stream object. - * - * This fetches the paged responses for {@link listAssets} continuously - * and invokes the callback registered for 'data' event for each element in the - * responses. - * - * The returned object has 'end' method when no more elements are required. - * - * autoPaginate option will be ignored. - * - * @see {@link https://nodejs.org/api/stream.html} - * + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -3573,6 +3632,13 @@ export class SecurityCenterClient { * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Stream} * An object stream which emits an object representing [ListAssetsResult]{@link google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listAssetsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. */ listAssetsStream( request?: protos.google.cloud.securitycenter.v1p1beta1.IListAssetsRequest, @@ -3597,10 +3663,9 @@ export class SecurityCenterClient { } /** - * Equivalent to {@link listAssets}, but returns an iterable object. - * - * for-await-of syntax is used with the iterable to recursively get response element on-demand. + * Equivalent to `listAssets`, but returns an iterable object. * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -3735,7 +3800,18 @@ export class SecurityCenterClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Object} - * An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols. + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [ListAssetsResult]{@link google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example + * const iterable = client.listAssetsAsync(request); + * for await (const response of iterable) { + * // process response + * } */ listAssetsAsync( request?: protos.google.cloud.securitycenter.v1p1beta1.IListAssetsRequest, @@ -3927,19 +4003,14 @@ export class SecurityCenterClient { * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. * The first element of the array is Array of [ListFindingsResult]{@link google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult}. - * The client library support auto-pagination by default: it will call the API as many + * The client library will perform auto-pagination by default: it will call the API as many * times as needed and will merge results from all the pages into this array. - * - * When autoPaginate: false is specified through options, the array has three elements. - * The first element is Array of [ListFindingsResult]{@link google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult} that corresponds to - * the one page received from the API server. - * If the second element is not null it contains the request object of type [ListFindingsRequest]{@link google.cloud.securitycenter.v1p1beta1.ListFindingsRequest} - * that can be used to obtain the next page of the results. - * If it is null, the next page does not exist. - * The third element contains the raw response received from the API server. Its type is - * [ListFindingsResponse]{@link google.cloud.securitycenter.v1p1beta1.ListFindingsResponse}. - * - * The promise has a method named "cancel" which cancels the ongoing API call. + * Note that it can affect your quota. + * We recommend using `listFindingsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. */ listFindings( request: protos.google.cloud.securitycenter.v1p1beta1.IListFindingsRequest, @@ -3987,18 +4058,7 @@ export class SecurityCenterClient { } /** - * Equivalent to {@link listFindings}, but returns a NodeJS Stream object. - * - * This fetches the paged responses for {@link listFindings} continuously - * and invokes the callback registered for 'data' event for each element in the - * responses. - * - * The returned object has 'end' method when no more elements are required. - * - * autoPaginate option will be ignored. - * - * @see {@link https://nodejs.org/api/stream.html} - * + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -4126,6 +4186,13 @@ export class SecurityCenterClient { * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Stream} * An object stream which emits an object representing [ListFindingsResult]{@link google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listFindingsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. */ listFindingsStream( request?: protos.google.cloud.securitycenter.v1p1beta1.IListFindingsRequest, @@ -4150,10 +4217,9 @@ export class SecurityCenterClient { } /** - * Equivalent to {@link listFindings}, but returns an iterable object. - * - * for-await-of syntax is used with the iterable to recursively get response element on-demand. + * Equivalent to `listFindings`, but returns an iterable object. * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -4280,7 +4346,18 @@ export class SecurityCenterClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Object} - * An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols. + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [ListFindingsResult]{@link google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example + * const iterable = client.listFindingsAsync(request); + * for await (const response of iterable) { + * // process response + * } */ listFindingsAsync( request?: protos.google.cloud.securitycenter.v1p1beta1.IListFindingsRequest, @@ -4358,19 +4435,14 @@ export class SecurityCenterClient { * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. * The first element of the array is Array of [NotificationConfig]{@link google.cloud.securitycenter.v1p1beta1.NotificationConfig}. - * The client library support auto-pagination by default: it will call the API as many + * The client library will perform auto-pagination by default: it will call the API as many * times as needed and will merge results from all the pages into this array. - * - * When autoPaginate: false is specified through options, the array has three elements. - * The first element is Array of [NotificationConfig]{@link google.cloud.securitycenter.v1p1beta1.NotificationConfig} that corresponds to - * the one page received from the API server. - * If the second element is not null it contains the request object of type [ListNotificationConfigsRequest]{@link google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest} - * that can be used to obtain the next page of the results. - * If it is null, the next page does not exist. - * The third element contains the raw response received from the API server. Its type is - * [ListNotificationConfigsResponse]{@link google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsResponse}. - * - * The promise has a method named "cancel" which cancels the ongoing API call. + * Note that it can affect your quota. + * We recommend using `listNotificationConfigsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. */ listNotificationConfigs( request: protos.google.cloud.securitycenter.v1p1beta1.IListNotificationConfigsRequest, @@ -4422,18 +4494,7 @@ export class SecurityCenterClient { } /** - * Equivalent to {@link listNotificationConfigs}, but returns a NodeJS Stream object. - * - * This fetches the paged responses for {@link listNotificationConfigs} continuously - * and invokes the callback registered for 'data' event for each element in the - * responses. - * - * The returned object has 'end' method when no more elements are required. - * - * autoPaginate option will be ignored. - * - * @see {@link https://nodejs.org/api/stream.html} - * + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -4450,6 +4511,13 @@ export class SecurityCenterClient { * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Stream} * An object stream which emits an object representing [NotificationConfig]{@link google.cloud.securitycenter.v1p1beta1.NotificationConfig} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listNotificationConfigsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. */ listNotificationConfigsStream( request?: protos.google.cloud.securitycenter.v1p1beta1.IListNotificationConfigsRequest, @@ -4474,10 +4542,9 @@ export class SecurityCenterClient { } /** - * Equivalent to {@link listNotificationConfigs}, but returns an iterable object. - * - * for-await-of syntax is used with the iterable to recursively get response element on-demand. + * Equivalent to `listNotificationConfigs`, but returns an iterable object. * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -4493,7 +4560,18 @@ export class SecurityCenterClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Object} - * An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols. + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [NotificationConfig]{@link google.cloud.securitycenter.v1p1beta1.NotificationConfig}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example + * const iterable = client.listNotificationConfigsAsync(request); + * for await (const response of iterable) { + * // process response + * } */ listNotificationConfigsAsync( request?: protos.google.cloud.securitycenter.v1p1beta1.IListNotificationConfigsRequest, @@ -4571,19 +4649,14 @@ export class SecurityCenterClient { * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. * The first element of the array is Array of [Source]{@link google.cloud.securitycenter.v1p1beta1.Source}. - * The client library support auto-pagination by default: it will call the API as many + * The client library will perform auto-pagination by default: it will call the API as many * times as needed and will merge results from all the pages into this array. - * - * When autoPaginate: false is specified through options, the array has three elements. - * The first element is Array of [Source]{@link google.cloud.securitycenter.v1p1beta1.Source} that corresponds to - * the one page received from the API server. - * If the second element is not null it contains the request object of type [ListSourcesRequest]{@link google.cloud.securitycenter.v1p1beta1.ListSourcesRequest} - * that can be used to obtain the next page of the results. - * If it is null, the next page does not exist. - * The third element contains the raw response received from the API server. Its type is - * [ListSourcesResponse]{@link google.cloud.securitycenter.v1p1beta1.ListSourcesResponse}. - * - * The promise has a method named "cancel" which cancels the ongoing API call. + * Note that it can affect your quota. + * We recommend using `listSourcesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. */ listSources( request: protos.google.cloud.securitycenter.v1p1beta1.IListSourcesRequest, @@ -4631,18 +4704,7 @@ export class SecurityCenterClient { } /** - * Equivalent to {@link listSources}, but returns a NodeJS Stream object. - * - * This fetches the paged responses for {@link listSources} continuously - * and invokes the callback registered for 'data' event for each element in the - * responses. - * - * The returned object has 'end' method when no more elements are required. - * - * autoPaginate option will be ignored. - * - * @see {@link https://nodejs.org/api/stream.html} - * + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -4659,6 +4721,13 @@ export class SecurityCenterClient { * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Stream} * An object stream which emits an object representing [Source]{@link google.cloud.securitycenter.v1p1beta1.Source} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listSourcesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. */ listSourcesStream( request?: protos.google.cloud.securitycenter.v1p1beta1.IListSourcesRequest, @@ -4683,10 +4752,9 @@ export class SecurityCenterClient { } /** - * Equivalent to {@link listSources}, but returns an iterable object. - * - * for-await-of syntax is used with the iterable to recursively get response element on-demand. + * Equivalent to `listSources`, but returns an iterable object. * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -4702,7 +4770,18 @@ export class SecurityCenterClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Object} - * An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols. + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [Source]{@link google.cloud.securitycenter.v1p1beta1.Source}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example + * const iterable = client.listSourcesAsync(request); + * for await (const response of iterable) { + * // process response + * } */ listSourcesAsync( request?: protos.google.cloud.securitycenter.v1p1beta1.IListSourcesRequest, @@ -5059,9 +5138,10 @@ export class SecurityCenterClient { } /** - * Terminate the GRPC channel and close the client. + * 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 { this.initialize(); diff --git a/packages/google-cloud-securitycenter/synth.metadata b/packages/google-cloud-securitycenter/synth.metadata index 8dc171dbdd5..aba6812276f 100644 --- a/packages/google-cloud-securitycenter/synth.metadata +++ b/packages/google-cloud-securitycenter/synth.metadata @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "ba9918cd22874245b55734f57470c719b577e591" + "sha": "1f1148d3c7a7a52f0c98077f976bd9b3c948ee2b" } } ], @@ -104,6 +104,7 @@ "README.md", "api-extractor.json", "linkinator.config.json", + "package-lock.json.2716439027", "protos/google/cloud/securitycenter/v1/asset.proto", "protos/google/cloud/securitycenter/v1/finding.proto", "protos/google/cloud/securitycenter/v1/notification_config.proto", @@ -136,6 +137,7 @@ "protos/protos.json", "renovate.json", "samples/README.md", + "samples/package-lock.json.228309027", "src/index.ts", "src/v1/index.ts", "src/v1/security_center_client.ts", diff --git a/packages/google-cloud-securitycenter/system-test/fixtures/sample/src/index.ts b/packages/google-cloud-securitycenter/system-test/fixtures/sample/src/index.ts index 929bf9bd2d2..3f3881c595e 100644 --- a/packages/google-cloud-securitycenter/system-test/fixtures/sample/src/index.ts +++ b/packages/google-cloud-securitycenter/system-test/fixtures/sample/src/index.ts @@ -18,8 +18,15 @@ import {SecurityCenterClient} from '@google-cloud/security-center'; +// check that the client class type name can be used +function doStuffWithSecurityCenterClient(client: SecurityCenterClient) { + client.close(); +} + function main() { - new SecurityCenterClient(); + // check that the client instance can be created + const securityCenterClient = new SecurityCenterClient(); + doStuffWithSecurityCenterClient(securityCenterClient); } main(); diff --git a/packages/google-cloud-securitycenter/system-test/install.ts b/packages/google-cloud-securitycenter/system-test/install.ts index 4c1ba3eb79a..39d90f771de 100644 --- a/packages/google-cloud-securitycenter/system-test/install.ts +++ b/packages/google-cloud-securitycenter/system-test/install.ts @@ -20,32 +20,32 @@ import {packNTest} from 'pack-n-play'; import {readFileSync} from 'fs'; import {describe, it} from 'mocha'; -describe('typescript consumer tests', () => { - it('should have correct type signature for typescript users', async function () { +describe('📦 pack-n-play test', () => { + it('TypeScript code', async function () { this.timeout(300000); const options = { - packageDir: process.cwd(), // path to your module. + packageDir: process.cwd(), sample: { - description: 'typescript based user can use the type definitions', + description: 'TypeScript user can use the type definitions', ts: readFileSync( './system-test/fixtures/sample/src/index.ts' ).toString(), }, }; - await packNTest(options); // will throw upon error. + await packNTest(options); }); - it('should have correct type signature for javascript users', async function () { + it('JavaScript code', async function () { this.timeout(300000); const options = { - packageDir: process.cwd(), // path to your module. + packageDir: process.cwd(), sample: { - description: 'typescript based user can use the type definitions', + description: 'JavaScript user can use the library', ts: readFileSync( './system-test/fixtures/sample/src/index.js' ).toString(), }, }; - await packNTest(options); // will throw upon error. + await packNTest(options); }); }); From 2dc7a66bd9b8c946eb221484a3c420a9ef031691 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 11 Nov 2020 12:45:23 -0800 Subject: [PATCH 225/342] chore: release 5.1.2 (#338) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- packages/google-cloud-securitycenter/CHANGELOG.md | 7 +++++++ packages/google-cloud-securitycenter/package.json | 2 +- packages/google-cloud-securitycenter/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-securitycenter/CHANGELOG.md b/packages/google-cloud-securitycenter/CHANGELOG.md index 255128bc6d0..8219ac9219c 100644 --- a/packages/google-cloud-securitycenter/CHANGELOG.md +++ b/packages/google-cloud-securitycenter/CHANGELOG.md @@ -4,6 +4,13 @@ [1]: https://www.npmjs.com/package/@google-cloud/security-center?activeTab=versions +### [5.1.2](https://www.github.com/googleapis/nodejs-security-center/compare/v5.1.1...v5.1.2) (2020-11-07) + + +### Bug Fixes + +* do not modify options object, use defaultScopes ([#337](https://www.github.com/googleapis/nodejs-security-center/issues/337)) ([2792fc8](https://www.github.com/googleapis/nodejs-security-center/commit/2792fc829c6db2fbbd951df4739b8d1524243012)) + ### [5.1.1](https://www.github.com/googleapis/nodejs-security-center/compare/v5.1.0...v5.1.1) (2020-08-17) diff --git a/packages/google-cloud-securitycenter/package.json b/packages/google-cloud-securitycenter/package.json index 9894d016ea8..ce6b004e455 100644 --- a/packages/google-cloud-securitycenter/package.json +++ b/packages/google-cloud-securitycenter/package.json @@ -1,7 +1,7 @@ { "name": "@google-cloud/security-center", "description": "Cloud Security Command Center API client for Node.js", - "version": "5.1.1", + "version": "5.1.2", "license": "Apache-2.0", "author": "Google LLC", "engines": { diff --git a/packages/google-cloud-securitycenter/samples/package.json b/packages/google-cloud-securitycenter/samples/package.json index 0ddb99b95ed..fb83d35cf58 100644 --- a/packages/google-cloud-securitycenter/samples/package.json +++ b/packages/google-cloud-securitycenter/samples/package.json @@ -14,7 +14,7 @@ "license": "Apache-2.0", "dependencies": { "@google-cloud/pubsub": "^2.0.0", - "@google-cloud/security-center": "^5.1.1" + "@google-cloud/security-center": "^5.1.2" }, "devDependencies": { "chai": "^4.2.0", From a4ad724fc45c40bed801453d2157de0676e65927 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 19 Nov 2020 17:33:23 +0100 Subject: [PATCH 226/342] chore(deps): update dependency gts to v3 (#340) --- packages/google-cloud-securitycenter/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-securitycenter/package.json b/packages/google-cloud-securitycenter/package.json index ce6b004e455..bef6bce6173 100644 --- a/packages/google-cloud-securitycenter/package.json +++ b/packages/google-cloud-securitycenter/package.json @@ -51,7 +51,7 @@ "@types/node": "^12.0.0", "@types/sinon": "^9.0.0", "c8": "^7.0.0", - "gts": "^2.0.0", + "gts": "^3.0.0", "jsdoc": "^3.6.2", "jsdoc-fresh": "^1.0.1", "jsdoc-region-tag": "^1.0.2", From 14336135a7305ff5159a8f5beb7b7263b9a4d4f5 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Mon, 23 Nov 2020 11:57:33 -0800 Subject: [PATCH 227/342] fix: check for fetch on window (#344) --- .../protos/protos.json | 923 ++++++++++++++++-- .../src/v1/security_center_client.ts | 290 +++--- .../src/v1beta1/security_center_client.ts | 224 ++--- .../src/v1p1beta1/security_center_client.ts | 302 +++--- .../synth.metadata | 8 +- 5 files changed, 1260 insertions(+), 487 deletions(-) diff --git a/packages/google-cloud-securitycenter/protos/protos.json b/packages/google-cloud-securitycenter/protos/protos.json index 1ad6f5ef027..a102c248ece 100644 --- a/packages/google-cloud-securitycenter/protos/protos.json +++ b/packages/google-cloud-securitycenter/protos/protos.json @@ -358,7 +358,18 @@ "(google.api.http).post": "/v1/{parent=organizations/*}/sources", "(google.api.http).body": "source", "(google.api.method_signature)": "parent,source" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=organizations/*}/sources", + "body": "source" + } + }, + { + "(google.api.method_signature)": "parent,source" + } + ] }, "CreateFinding": { "requestType": "CreateFindingRequest", @@ -367,7 +378,18 @@ "(google.api.http).post": "/v1/{parent=organizations/*/sources/*}/findings", "(google.api.http).body": "finding", "(google.api.method_signature)": "parent,finding_id,finding" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=organizations/*/sources/*}/findings", + "body": "finding" + } + }, + { + "(google.api.method_signature)": "parent,finding_id,finding" + } + ] }, "CreateNotificationConfig": { "requestType": "CreateNotificationConfigRequest", @@ -376,7 +398,21 @@ "(google.api.http).post": "/v1/{parent=organizations/*}/notificationConfigs", "(google.api.http).body": "notification_config", "(google.api.method_signature)": "parent,notification_config" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=organizations/*}/notificationConfigs", + "body": "notification_config" + } + }, + { + "(google.api.method_signature)": "parent,config_id,notification_config" + }, + { + "(google.api.method_signature)": "parent,notification_config" + } + ] }, "DeleteNotificationConfig": { "requestType": "DeleteNotificationConfigRequest", @@ -384,7 +420,17 @@ "options": { "(google.api.http).delete": "/v1/{name=organizations/*/notificationConfigs/*}", "(google.api.method_signature)": "name" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=organizations/*/notificationConfigs/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] }, "GetIamPolicy": { "requestType": "google.iam.v1.GetIamPolicyRequest", @@ -393,7 +439,18 @@ "(google.api.http).post": "/v1/{resource=organizations/*/sources/*}:getIamPolicy", "(google.api.http).body": "*", "(google.api.method_signature)": "resource" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{resource=organizations/*/sources/*}:getIamPolicy", + "body": "*" + } + }, + { + "(google.api.method_signature)": "resource" + } + ] }, "GetNotificationConfig": { "requestType": "GetNotificationConfigRequest", @@ -401,7 +458,17 @@ "options": { "(google.api.http).get": "/v1/{name=organizations/*/notificationConfigs/*}", "(google.api.method_signature)": "name" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=organizations/*/notificationConfigs/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] }, "GetOrganizationSettings": { "requestType": "GetOrganizationSettingsRequest", @@ -409,7 +476,17 @@ "options": { "(google.api.http).get": "/v1/{name=organizations/*/organizationSettings}", "(google.api.method_signature)": "name" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=organizations/*/organizationSettings}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] }, "GetSource": { "requestType": "GetSourceRequest", @@ -417,7 +494,17 @@ "options": { "(google.api.http).get": "/v1/{name=organizations/*/sources/*}", "(google.api.method_signature)": "name" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=organizations/*/sources/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] }, "GroupAssets": { "requestType": "GroupAssetsRequest", @@ -425,7 +512,15 @@ "options": { "(google.api.http).post": "/v1/{parent=organizations/*}/assets:group", "(google.api.http).body": "*" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=organizations/*}/assets:group", + "body": "*" + } + } + ] }, "GroupFindings": { "requestType": "GroupFindingsRequest", @@ -434,21 +529,46 @@ "(google.api.http).post": "/v1/{parent=organizations/*/sources/*}/findings:group", "(google.api.http).body": "*", "(google.api.method_signature)": "parent,group_by" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=organizations/*/sources/*}/findings:group", + "body": "*" + } + }, + { + "(google.api.method_signature)": "parent,group_by" + } + ] }, "ListAssets": { "requestType": "ListAssetsRequest", "responseType": "ListAssetsResponse", "options": { "(google.api.http).get": "/v1/{parent=organizations/*}/assets" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=organizations/*}/assets" + } + } + ] }, "ListFindings": { "requestType": "ListFindingsRequest", "responseType": "ListFindingsResponse", "options": { "(google.api.http).get": "/v1/{parent=organizations/*/sources/*}/findings" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=organizations/*/sources/*}/findings" + } + } + ] }, "ListNotificationConfigs": { "requestType": "ListNotificationConfigsRequest", @@ -456,7 +576,17 @@ "options": { "(google.api.http).get": "/v1/{parent=organizations/*}/notificationConfigs", "(google.api.method_signature)": "parent" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=organizations/*}/notificationConfigs" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] }, "ListSources": { "requestType": "ListSourcesRequest", @@ -464,7 +594,17 @@ "options": { "(google.api.http).get": "/v1/{parent=organizations/*}/sources", "(google.api.method_signature)": "parent" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=organizations/*}/sources" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] }, "RunAssetDiscovery": { "requestType": "RunAssetDiscoveryRequest", @@ -475,7 +615,24 @@ "(google.api.method_signature)": "parent", "(google.longrunning.operation_info).response_type": "google.cloud.securitycenter.v1.RunAssetDiscoveryResponse", "(google.longrunning.operation_info).metadata_type": "google.protobuf.Empty" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=organizations/*}/assets:runDiscovery", + "body": "*" + } + }, + { + "(google.api.method_signature)": "parent" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.cloud.securitycenter.v1.RunAssetDiscoveryResponse", + "metadata_type": "google.protobuf.Empty" + } + } + ] }, "SetFindingState": { "requestType": "SetFindingStateRequest", @@ -484,7 +641,18 @@ "(google.api.http).post": "/v1/{name=organizations/*/sources/*/findings/*}:setState", "(google.api.http).body": "*", "(google.api.method_signature)": "name,state,start_time" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=organizations/*/sources/*/findings/*}:setState", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name,state,start_time" + } + ] }, "SetIamPolicy": { "requestType": "google.iam.v1.SetIamPolicyRequest", @@ -493,7 +661,18 @@ "(google.api.http).post": "/v1/{resource=organizations/*/sources/*}:setIamPolicy", "(google.api.http).body": "*", "(google.api.method_signature)": "resource,policy" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{resource=organizations/*/sources/*}:setIamPolicy", + "body": "*" + } + }, + { + "(google.api.method_signature)": "resource,policy" + } + ] }, "TestIamPermissions": { "requestType": "google.iam.v1.TestIamPermissionsRequest", @@ -502,7 +681,18 @@ "(google.api.http).post": "/v1/{resource=organizations/*/sources/*}:testIamPermissions", "(google.api.http).body": "*", "(google.api.method_signature)": "resource,permissions" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{resource=organizations/*/sources/*}:testIamPermissions", + "body": "*" + } + }, + { + "(google.api.method_signature)": "resource,permissions" + } + ] }, "UpdateFinding": { "requestType": "UpdateFindingRequest", @@ -511,7 +701,18 @@ "(google.api.http).patch": "/v1/{finding.name=organizations/*/sources/*/findings/*}", "(google.api.http).body": "finding", "(google.api.method_signature)": "finding" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{finding.name=organizations/*/sources/*/findings/*}", + "body": "finding" + } + }, + { + "(google.api.method_signature)": "finding" + } + ] }, "UpdateNotificationConfig": { "requestType": "UpdateNotificationConfigRequest", @@ -520,7 +721,21 @@ "(google.api.http).patch": "/v1/{notification_config.name=organizations/*/notificationConfigs/*}", "(google.api.http).body": "notification_config", "(google.api.method_signature)": "notification_config,update_mask" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{notification_config.name=organizations/*/notificationConfigs/*}", + "body": "notification_config" + } + }, + { + "(google.api.method_signature)": "notification_config" + }, + { + "(google.api.method_signature)": "notification_config,update_mask" + } + ] }, "UpdateOrganizationSettings": { "requestType": "UpdateOrganizationSettingsRequest", @@ -529,7 +744,18 @@ "(google.api.http).patch": "/v1/{organization_settings.name=organizations/*/organizationSettings}", "(google.api.http).body": "organization_settings", "(google.api.method_signature)": "organization_settings" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{organization_settings.name=organizations/*/organizationSettings}", + "body": "organization_settings" + } + }, + { + "(google.api.method_signature)": "organization_settings" + } + ] }, "UpdateSource": { "requestType": "UpdateSourceRequest", @@ -538,7 +764,18 @@ "(google.api.http).patch": "/v1/{source.name=organizations/*/sources/*}", "(google.api.http).body": "source", "(google.api.method_signature)": "source" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{source.name=organizations/*/sources/*}", + "body": "source" + } + }, + { + "(google.api.method_signature)": "source" + } + ] }, "UpdateSecurityMarks": { "requestType": "UpdateSecurityMarksRequest", @@ -549,7 +786,22 @@ "(google.api.http).additional_bindings.patch": "/v1/{security_marks.name=organizations/*/sources/*/findings/*/securityMarks}", "(google.api.http).additional_bindings.body": "security_marks", "(google.api.method_signature)": "security_marks" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{security_marks.name=organizations/*/assets/*/securityMarks}", + "body": "security_marks", + "additional_bindings": { + "patch": "/v1/{security_marks.name=organizations/*/sources/*/findings/*/securityMarks}", + "body": "security_marks" + } + } + }, + { + "(google.api.method_signature)": "security_marks" + } + ] } } }, @@ -1445,7 +1697,18 @@ "(google.api.http).post": "/v1beta1/{parent=organizations/*}/sources", "(google.api.http).body": "source", "(google.api.method_signature)": "parent,source" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta1/{parent=organizations/*}/sources", + "body": "source" + } + }, + { + "(google.api.method_signature)": "parent,source" + } + ] }, "CreateFinding": { "requestType": "CreateFindingRequest", @@ -1454,7 +1717,18 @@ "(google.api.http).post": "/v1beta1/{parent=organizations/*/sources/*}/findings", "(google.api.http).body": "finding", "(google.api.method_signature)": "parent,finding_id,finding" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta1/{parent=organizations/*/sources/*}/findings", + "body": "finding" + } + }, + { + "(google.api.method_signature)": "parent,finding_id,finding" + } + ] }, "GetIamPolicy": { "requestType": "google.iam.v1.GetIamPolicyRequest", @@ -1463,7 +1737,18 @@ "(google.api.http).post": "/v1beta1/{resource=organizations/*/sources/*}:getIamPolicy", "(google.api.http).body": "*", "(google.api.method_signature)": "resource" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta1/{resource=organizations/*/sources/*}:getIamPolicy", + "body": "*" + } + }, + { + "(google.api.method_signature)": "resource" + } + ] }, "GetOrganizationSettings": { "requestType": "GetOrganizationSettingsRequest", @@ -1471,7 +1756,17 @@ "options": { "(google.api.http).get": "/v1beta1/{name=organizations/*/organizationSettings}", "(google.api.method_signature)": "name" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta1/{name=organizations/*/organizationSettings}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] }, "GetSource": { "requestType": "GetSourceRequest", @@ -1479,7 +1774,17 @@ "options": { "(google.api.http).get": "/v1beta1/{name=organizations/*/sources/*}", "(google.api.method_signature)": "name" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta1/{name=organizations/*/sources/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] }, "GroupAssets": { "requestType": "GroupAssetsRequest", @@ -1487,7 +1792,15 @@ "options": { "(google.api.http).post": "/v1beta1/{parent=organizations/*}/assets:group", "(google.api.http).body": "*" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta1/{parent=organizations/*}/assets:group", + "body": "*" + } + } + ] }, "GroupFindings": { "requestType": "GroupFindingsRequest", @@ -1496,21 +1809,46 @@ "(google.api.http).post": "/v1beta1/{parent=organizations/*/sources/*}/findings:group", "(google.api.http).body": "*", "(google.api.method_signature)": "parent,group_by" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta1/{parent=organizations/*/sources/*}/findings:group", + "body": "*" + } + }, + { + "(google.api.method_signature)": "parent,group_by" + } + ] }, "ListAssets": { "requestType": "ListAssetsRequest", "responseType": "ListAssetsResponse", "options": { "(google.api.http).get": "/v1beta1/{parent=organizations/*}/assets" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta1/{parent=organizations/*}/assets" + } + } + ] }, "ListFindings": { "requestType": "ListFindingsRequest", "responseType": "ListFindingsResponse", "options": { "(google.api.http).get": "/v1beta1/{parent=organizations/*/sources/*}/findings" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta1/{parent=organizations/*/sources/*}/findings" + } + } + ] }, "ListSources": { "requestType": "ListSourcesRequest", @@ -1518,7 +1856,17 @@ "options": { "(google.api.http).get": "/v1beta1/{parent=organizations/*}/sources", "(google.api.method_signature)": "parent" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta1/{parent=organizations/*}/sources" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] }, "RunAssetDiscovery": { "requestType": "RunAssetDiscoveryRequest", @@ -1529,7 +1877,24 @@ "(google.api.method_signature)": "parent", "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", "(google.longrunning.operation_info).metadata_type": "google.protobuf.Empty" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta1/{parent=organizations/*}/assets:runDiscovery", + "body": "*" + } + }, + { + "(google.api.method_signature)": "parent" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "google.protobuf.Empty" + } + } + ] }, "SetFindingState": { "requestType": "SetFindingStateRequest", @@ -1538,7 +1903,18 @@ "(google.api.http).post": "/v1beta1/{name=organizations/*/sources/*/findings/*}:setState", "(google.api.http).body": "*", "(google.api.method_signature)": "name,state,start_time" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta1/{name=organizations/*/sources/*/findings/*}:setState", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name,state,start_time" + } + ] }, "SetIamPolicy": { "requestType": "google.iam.v1.SetIamPolicyRequest", @@ -1547,7 +1923,18 @@ "(google.api.http).post": "/v1beta1/{resource=organizations/*/sources/*}:setIamPolicy", "(google.api.http).body": "*", "(google.api.method_signature)": "resource,policy" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta1/{resource=organizations/*/sources/*}:setIamPolicy", + "body": "*" + } + }, + { + "(google.api.method_signature)": "resource,policy" + } + ] }, "TestIamPermissions": { "requestType": "google.iam.v1.TestIamPermissionsRequest", @@ -1556,7 +1943,18 @@ "(google.api.http).post": "/v1beta1/{resource=organizations/*/sources/*}:testIamPermissions", "(google.api.http).body": "*", "(google.api.method_signature)": "resource,permissions" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta1/{resource=organizations/*/sources/*}:testIamPermissions", + "body": "*" + } + }, + { + "(google.api.method_signature)": "resource,permissions" + } + ] }, "UpdateFinding": { "requestType": "UpdateFindingRequest", @@ -1565,7 +1963,18 @@ "(google.api.http).patch": "/v1beta1/{finding.name=organizations/*/sources/*/findings/*}", "(google.api.http).body": "finding", "(google.api.method_signature)": "finding" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1beta1/{finding.name=organizations/*/sources/*/findings/*}", + "body": "finding" + } + }, + { + "(google.api.method_signature)": "finding" + } + ] }, "UpdateOrganizationSettings": { "requestType": "UpdateOrganizationSettingsRequest", @@ -1574,7 +1983,18 @@ "(google.api.http).patch": "/v1beta1/{organization_settings.name=organizations/*/organizationSettings}", "(google.api.http).body": "organization_settings", "(google.api.method_signature)": "organization_settings" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1beta1/{organization_settings.name=organizations/*/organizationSettings}", + "body": "organization_settings" + } + }, + { + "(google.api.method_signature)": "organization_settings" + } + ] }, "UpdateSource": { "requestType": "UpdateSourceRequest", @@ -1583,7 +2003,18 @@ "(google.api.http).patch": "/v1beta1/{source.name=organizations/*/sources/*}", "(google.api.http).body": "source", "(google.api.method_signature)": "source" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1beta1/{source.name=organizations/*/sources/*}", + "body": "source" + } + }, + { + "(google.api.method_signature)": "source" + } + ] }, "UpdateSecurityMarks": { "requestType": "UpdateSecurityMarksRequest", @@ -1594,7 +2025,22 @@ "(google.api.http).additional_bindings.patch": "/v1beta1/{security_marks.name=organizations/*/sources/*/findings/*/securityMarks}", "(google.api.http).additional_bindings.body": "security_marks", "(google.api.method_signature)": "security_marks" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1beta1/{security_marks.name=organizations/*/assets/*/securityMarks}", + "body": "security_marks", + "additional_bindings": { + "patch": "/v1beta1/{security_marks.name=organizations/*/sources/*/findings/*/securityMarks}", + "body": "security_marks" + } + } + }, + { + "(google.api.method_signature)": "security_marks" + } + ] } } }, @@ -2469,7 +2915,18 @@ "(google.api.http).post": "/v1p1beta1/{parent=organizations/*}/sources", "(google.api.http).body": "source", "(google.api.method_signature)": "parent,source" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1p1beta1/{parent=organizations/*}/sources", + "body": "source" + } + }, + { + "(google.api.method_signature)": "parent,source" + } + ] }, "CreateFinding": { "requestType": "CreateFindingRequest", @@ -2478,7 +2935,21 @@ "(google.api.http).post": "/v1p1beta1/{parent=organizations/*/sources/*}/findings", "(google.api.http).body": "finding", "(google.api.method_signature)": "parent,finding,finding_id" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1p1beta1/{parent=organizations/*/sources/*}/findings", + "body": "finding" + } + }, + { + "(google.api.method_signature)": "parent,finding_id,finding" + }, + { + "(google.api.method_signature)": "parent,finding,finding_id" + } + ] }, "CreateNotificationConfig": { "requestType": "CreateNotificationConfigRequest", @@ -2487,7 +2958,21 @@ "(google.api.http).post": "/v1p1beta1/{parent=organizations/*}/notificationConfigs", "(google.api.http).body": "notification_config", "(google.api.method_signature)": "parent,notification_config" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1p1beta1/{parent=organizations/*}/notificationConfigs", + "body": "notification_config" + } + }, + { + "(google.api.method_signature)": "parent,config_id,notification_config" + }, + { + "(google.api.method_signature)": "parent,notification_config" + } + ] }, "DeleteNotificationConfig": { "requestType": "DeleteNotificationConfigRequest", @@ -2495,7 +2980,17 @@ "options": { "(google.api.http).delete": "/v1p1beta1/{name=organizations/*/notificationConfigs/*}", "(google.api.method_signature)": "name" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1p1beta1/{name=organizations/*/notificationConfigs/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] }, "GetIamPolicy": { "requestType": "google.iam.v1.GetIamPolicyRequest", @@ -2504,7 +2999,18 @@ "(google.api.http).post": "/v1p1beta1/{resource=organizations/*/sources/*}:getIamPolicy", "(google.api.http).body": "*", "(google.api.method_signature)": "resource" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1p1beta1/{resource=organizations/*/sources/*}:getIamPolicy", + "body": "*" + } + }, + { + "(google.api.method_signature)": "resource" + } + ] }, "GetNotificationConfig": { "requestType": "GetNotificationConfigRequest", @@ -2512,7 +3018,17 @@ "options": { "(google.api.http).get": "/v1p1beta1/{name=organizations/*/notificationConfigs/*}", "(google.api.method_signature)": "name" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1p1beta1/{name=organizations/*/notificationConfigs/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] }, "GetOrganizationSettings": { "requestType": "GetOrganizationSettingsRequest", @@ -2520,7 +3036,17 @@ "options": { "(google.api.http).get": "/v1p1beta1/{name=organizations/*/organizationSettings}", "(google.api.method_signature)": "name" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1p1beta1/{name=organizations/*/organizationSettings}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] }, "GetSource": { "requestType": "GetSourceRequest", @@ -2528,7 +3054,17 @@ "options": { "(google.api.http).get": "/v1p1beta1/{name=organizations/*/sources/*}", "(google.api.method_signature)": "name" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1p1beta1/{name=organizations/*/sources/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] }, "GroupAssets": { "requestType": "GroupAssetsRequest", @@ -2536,7 +3072,15 @@ "options": { "(google.api.http).post": "/v1p1beta1/{parent=organizations/*}/assets:group", "(google.api.http).body": "*" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1p1beta1/{parent=organizations/*}/assets:group", + "body": "*" + } + } + ] }, "GroupFindings": { "requestType": "GroupFindingsRequest", @@ -2545,7 +3089,18 @@ "(google.api.http).post": "/v1p1beta1/{parent=organizations/*/sources/*}/findings:group", "(google.api.http).body": "*", "(google.api.method_signature)": "parent,group_by" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1p1beta1/{parent=organizations/*/sources/*}/findings:group", + "body": "*" + } + }, + { + "(google.api.method_signature)": "parent,group_by" + } + ] }, "ListAssets": { "requestType": "ListAssetsRequest", @@ -2553,7 +3108,17 @@ "options": { "(google.api.http).get": "/v1p1beta1/{parent=organizations/*}/assets", "(google.api.method_signature)": "parent" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1p1beta1/{parent=organizations/*}/assets" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] }, "ListFindings": { "requestType": "ListFindingsRequest", @@ -2561,7 +3126,17 @@ "options": { "(google.api.http).get": "/v1p1beta1/{parent=organizations/*/sources/*}/findings", "(google.api.method_signature)": "parent" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1p1beta1/{parent=organizations/*/sources/*}/findings" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] }, "ListNotificationConfigs": { "requestType": "ListNotificationConfigsRequest", @@ -2569,7 +3144,17 @@ "options": { "(google.api.http).get": "/v1p1beta1/{parent=organizations/*}/notificationConfigs", "(google.api.method_signature)": "parent" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1p1beta1/{parent=organizations/*}/notificationConfigs" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] }, "ListSources": { "requestType": "ListSourcesRequest", @@ -2577,7 +3162,17 @@ "options": { "(google.api.http).get": "/v1p1beta1/{parent=organizations/*}/sources", "(google.api.method_signature)": "parent" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1p1beta1/{parent=organizations/*}/sources" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] }, "RunAssetDiscovery": { "requestType": "RunAssetDiscoveryRequest", @@ -2588,7 +3183,24 @@ "(google.api.method_signature)": "parent", "(google.longrunning.operation_info).response_type": "google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse", "(google.longrunning.operation_info).metadata_type": "google.protobuf.Empty" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1p1beta1/{parent=organizations/*}/assets:runDiscovery", + "body": "*" + } + }, + { + "(google.api.method_signature)": "parent" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse", + "metadata_type": "google.protobuf.Empty" + } + } + ] }, "SetFindingState": { "requestType": "SetFindingStateRequest", @@ -2597,7 +3209,18 @@ "(google.api.http).post": "/v1p1beta1/{name=organizations/*/sources/*/findings/*}:setState", "(google.api.http).body": "*", "(google.api.method_signature)": "name,state,start_time" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1p1beta1/{name=organizations/*/sources/*/findings/*}:setState", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name,state,start_time" + } + ] }, "SetIamPolicy": { "requestType": "google.iam.v1.SetIamPolicyRequest", @@ -2606,7 +3229,18 @@ "(google.api.http).post": "/v1p1beta1/{resource=organizations/*/sources/*}:setIamPolicy", "(google.api.http).body": "*", "(google.api.method_signature)": "resource,policy" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1p1beta1/{resource=organizations/*/sources/*}:setIamPolicy", + "body": "*" + } + }, + { + "(google.api.method_signature)": "resource,policy" + } + ] }, "TestIamPermissions": { "requestType": "google.iam.v1.TestIamPermissionsRequest", @@ -2615,7 +3249,18 @@ "(google.api.http).post": "/v1p1beta1/{resource=organizations/*/sources/*}:testIamPermissions", "(google.api.http).body": "*", "(google.api.method_signature)": "resource,permissions" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1p1beta1/{resource=organizations/*/sources/*}:testIamPermissions", + "body": "*" + } + }, + { + "(google.api.method_signature)": "resource,permissions" + } + ] }, "UpdateFinding": { "requestType": "UpdateFindingRequest", @@ -2624,7 +3269,21 @@ "(google.api.http).patch": "/v1p1beta1/{finding.name=organizations/*/sources/*/findings/*}", "(google.api.http).body": "finding", "(google.api.method_signature)": "finding,update_mask" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1p1beta1/{finding.name=organizations/*/sources/*/findings/*}", + "body": "finding" + } + }, + { + "(google.api.method_signature)": "finding" + }, + { + "(google.api.method_signature)": "finding,update_mask" + } + ] }, "UpdateNotificationConfig": { "requestType": "UpdateNotificationConfigRequest", @@ -2633,7 +3292,21 @@ "(google.api.http).patch": "/v1p1beta1/{notification_config.name=organizations/*/notificationConfigs/*}", "(google.api.http).body": "notification_config", "(google.api.method_signature)": "notification_config,update_mask" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1p1beta1/{notification_config.name=organizations/*/notificationConfigs/*}", + "body": "notification_config" + } + }, + { + "(google.api.method_signature)": "notification_config" + }, + { + "(google.api.method_signature)": "notification_config,update_mask" + } + ] }, "UpdateOrganizationSettings": { "requestType": "UpdateOrganizationSettingsRequest", @@ -2642,7 +3315,18 @@ "(google.api.http).patch": "/v1p1beta1/{organization_settings.name=organizations/*/organizationSettings}", "(google.api.http).body": "organization_settings", "(google.api.method_signature)": "organization_settings" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1p1beta1/{organization_settings.name=organizations/*/organizationSettings}", + "body": "organization_settings" + } + }, + { + "(google.api.method_signature)": "organization_settings" + } + ] }, "UpdateSource": { "requestType": "UpdateSourceRequest", @@ -2651,7 +3335,21 @@ "(google.api.http).patch": "/v1p1beta1/{source.name=organizations/*/sources/*}", "(google.api.http).body": "source", "(google.api.method_signature)": "source,update_mask" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1p1beta1/{source.name=organizations/*/sources/*}", + "body": "source" + } + }, + { + "(google.api.method_signature)": "source" + }, + { + "(google.api.method_signature)": "source,update_mask" + } + ] }, "UpdateSecurityMarks": { "requestType": "UpdateSecurityMarksRequest", @@ -2662,7 +3360,25 @@ "(google.api.http).additional_bindings.patch": "/v1p1beta1/{security_marks.name=organizations/*/sources/*/findings/*/securityMarks}", "(google.api.http).additional_bindings.body": "security_marks", "(google.api.method_signature)": "security_marks,update_mask" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1p1beta1/{security_marks.name=organizations/*/assets/*/securityMarks}", + "body": "security_marks", + "additional_bindings": { + "patch": "/v1p1beta1/{security_marks.name=organizations/*/sources/*/findings/*/securityMarks}", + "body": "security_marks" + } + } + }, + { + "(google.api.method_signature)": "security_marks" + }, + { + "(google.api.method_signature)": "security_marks,update_mask" + } + ] } } }, @@ -4558,7 +5274,15 @@ "options": { "(google.api.http).post": "/v1/{resource=**}:setIamPolicy", "(google.api.http).body": "*" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{resource=**}:setIamPolicy", + "body": "*" + } + } + ] }, "GetIamPolicy": { "requestType": "GetIamPolicyRequest", @@ -4566,7 +5290,15 @@ "options": { "(google.api.http).post": "/v1/{resource=**}:getIamPolicy", "(google.api.http).body": "*" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{resource=**}:getIamPolicy", + "body": "*" + } + } + ] }, "TestIamPermissions": { "requestType": "TestIamPermissionsRequest", @@ -4574,7 +5306,15 @@ "options": { "(google.api.http).post": "/v1/{resource=**}:testIamPermissions", "(google.api.http).body": "*" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{resource=**}:testIamPermissions", + "body": "*" + } + } + ] } } }, @@ -4818,7 +5558,17 @@ "options": { "(google.api.http).get": "/v1/{name=operations}", "(google.api.method_signature)": "name,filter" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=operations}" + } + }, + { + "(google.api.method_signature)": "name,filter" + } + ] }, "GetOperation": { "requestType": "GetOperationRequest", @@ -4826,7 +5576,17 @@ "options": { "(google.api.http).get": "/v1/{name=operations/**}", "(google.api.method_signature)": "name" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=operations/**}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] }, "DeleteOperation": { "requestType": "DeleteOperationRequest", @@ -4834,7 +5594,17 @@ "options": { "(google.api.http).delete": "/v1/{name=operations/**}", "(google.api.method_signature)": "name" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=operations/**}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] }, "CancelOperation": { "requestType": "CancelOperationRequest", @@ -4843,7 +5613,18 @@ "(google.api.http).post": "/v1/{name=operations/**}:cancel", "(google.api.http).body": "*", "(google.api.method_signature)": "name" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=operations/**}:cancel", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name" + } + ] }, "WaitOperation": { "requestType": "WaitOperationRequest", diff --git a/packages/google-cloud-securitycenter/src/v1/security_center_client.ts b/packages/google-cloud-securitycenter/src/v1/security_center_client.ts index 412e7ee7958..6e279447b39 100644 --- a/packages/google-cloud-securitycenter/src/v1/security_center_client.ts +++ b/packages/google-cloud-securitycenter/src/v1/security_center_client.ts @@ -16,6 +16,7 @@ // ** https://github.com/googleapis/gapic-generator-typescript ** // ** All changes to this file may be overwritten. ** +/* global window */ import * as gax from 'google-gax'; import { Callback, @@ -31,6 +32,11 @@ import * as path from 'path'; import {Transform} from 'stream'; import {RequestType} from 'google-gax/build/src/apitypes'; import * as protos from '../../protos/protos'; +/** + * Client JSON configuration object, loaded from + * `src/v1/security_center_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ import * as gapicConfig from './security_center_client_config.json'; import {operationsProtos} from 'google-gax'; const version = require('../../../package.json').version; @@ -85,9 +91,9 @@ export class SecurityCenterClient { * 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. - * TODO(@alexander-fenster): link to gax documentation. - * @param {boolean} fallback - Use HTTP fallback mode. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP fallback mode. * In fallback mode, a special browser-compatible transport implementation is used * instead of gRPC transport. In browser context (if the `window` object is defined) * the fallback mode is enabled automatically; set `options.fallback` to `false` @@ -100,7 +106,9 @@ export class SecurityCenterClient { opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; const port = opts?.port || staticMembers.port; const clientConfig = opts?.clientConfig ?? {}; - const fallback = opts?.fallback ?? typeof window !== 'undefined'; + 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. @@ -408,7 +416,7 @@ export class SecurityCenterClient { // ------------------- createSource( request: protos.google.cloud.securitycenter.v1.ICreateSourceRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.cloud.securitycenter.v1.ISource, @@ -418,7 +426,7 @@ export class SecurityCenterClient { >; createSource( request: protos.google.cloud.securitycenter.v1.ICreateSourceRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< protos.google.cloud.securitycenter.v1.ISource, | protos.google.cloud.securitycenter.v1.ICreateSourceRequest @@ -461,7 +469,7 @@ export class SecurityCenterClient { createSource( request: protos.google.cloud.securitycenter.v1.ICreateSourceRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< protos.google.cloud.securitycenter.v1.ISource, | protos.google.cloud.securitycenter.v1.ICreateSourceRequest @@ -484,12 +492,12 @@ export class SecurityCenterClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -504,7 +512,7 @@ export class SecurityCenterClient { } createFinding( request: protos.google.cloud.securitycenter.v1.ICreateFindingRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.cloud.securitycenter.v1.IFinding, @@ -514,7 +522,7 @@ export class SecurityCenterClient { >; createFinding( request: protos.google.cloud.securitycenter.v1.ICreateFindingRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< protos.google.cloud.securitycenter.v1.IFinding, | protos.google.cloud.securitycenter.v1.ICreateFindingRequest @@ -562,7 +570,7 @@ export class SecurityCenterClient { createFinding( request: protos.google.cloud.securitycenter.v1.ICreateFindingRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< protos.google.cloud.securitycenter.v1.IFinding, | protos.google.cloud.securitycenter.v1.ICreateFindingRequest @@ -585,12 +593,12 @@ export class SecurityCenterClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -605,7 +613,7 @@ export class SecurityCenterClient { } createNotificationConfig( request: protos.google.cloud.securitycenter.v1.ICreateNotificationConfigRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.cloud.securitycenter.v1.INotificationConfig, @@ -618,7 +626,7 @@ export class SecurityCenterClient { >; createNotificationConfig( request: protos.google.cloud.securitycenter.v1.ICreateNotificationConfigRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< protos.google.cloud.securitycenter.v1.INotificationConfig, | protos.google.cloud.securitycenter.v1.ICreateNotificationConfigRequest @@ -667,7 +675,7 @@ export class SecurityCenterClient { createNotificationConfig( request: protos.google.cloud.securitycenter.v1.ICreateNotificationConfigRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< protos.google.cloud.securitycenter.v1.INotificationConfig, | protos.google.cloud.securitycenter.v1.ICreateNotificationConfigRequest @@ -693,12 +701,12 @@ export class SecurityCenterClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -717,7 +725,7 @@ export class SecurityCenterClient { } deleteNotificationConfig( request: protos.google.cloud.securitycenter.v1.IDeleteNotificationConfigRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.protobuf.IEmpty, @@ -730,7 +738,7 @@ export class SecurityCenterClient { >; deleteNotificationConfig( request: protos.google.cloud.securitycenter.v1.IDeleteNotificationConfigRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< protos.google.protobuf.IEmpty, | protos.google.cloud.securitycenter.v1.IDeleteNotificationConfigRequest @@ -770,7 +778,7 @@ export class SecurityCenterClient { deleteNotificationConfig( request: protos.google.cloud.securitycenter.v1.IDeleteNotificationConfigRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< protos.google.protobuf.IEmpty, | protos.google.cloud.securitycenter.v1.IDeleteNotificationConfigRequest @@ -796,12 +804,12 @@ export class SecurityCenterClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -820,7 +828,7 @@ export class SecurityCenterClient { } getIamPolicy( request: protos.google.iam.v1.IGetIamPolicyRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.iam.v1.IPolicy, @@ -830,7 +838,7 @@ export class SecurityCenterClient { >; getIamPolicy( request: protos.google.iam.v1.IGetIamPolicyRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< protos.google.iam.v1.IPolicy, protos.google.iam.v1.IGetIamPolicyRequest | null | undefined, @@ -869,7 +877,7 @@ export class SecurityCenterClient { getIamPolicy( request: protos.google.iam.v1.IGetIamPolicyRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< protos.google.iam.v1.IPolicy, protos.google.iam.v1.IGetIamPolicyRequest | null | undefined, @@ -888,12 +896,12 @@ export class SecurityCenterClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -908,7 +916,7 @@ export class SecurityCenterClient { } getNotificationConfig( request: protos.google.cloud.securitycenter.v1.IGetNotificationConfigRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.cloud.securitycenter.v1.INotificationConfig, @@ -921,7 +929,7 @@ export class SecurityCenterClient { >; getNotificationConfig( request: protos.google.cloud.securitycenter.v1.IGetNotificationConfigRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< protos.google.cloud.securitycenter.v1.INotificationConfig, | protos.google.cloud.securitycenter.v1.IGetNotificationConfigRequest @@ -961,7 +969,7 @@ export class SecurityCenterClient { getNotificationConfig( request: protos.google.cloud.securitycenter.v1.IGetNotificationConfigRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< protos.google.cloud.securitycenter.v1.INotificationConfig, | protos.google.cloud.securitycenter.v1.IGetNotificationConfigRequest @@ -987,12 +995,12 @@ export class SecurityCenterClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -1007,7 +1015,7 @@ export class SecurityCenterClient { } getOrganizationSettings( request: protos.google.cloud.securitycenter.v1.IGetOrganizationSettingsRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.cloud.securitycenter.v1.IOrganizationSettings, @@ -1020,7 +1028,7 @@ export class SecurityCenterClient { >; getOrganizationSettings( request: protos.google.cloud.securitycenter.v1.IGetOrganizationSettingsRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< protos.google.cloud.securitycenter.v1.IOrganizationSettings, | protos.google.cloud.securitycenter.v1.IGetOrganizationSettingsRequest @@ -1060,7 +1068,7 @@ export class SecurityCenterClient { getOrganizationSettings( request: protos.google.cloud.securitycenter.v1.IGetOrganizationSettingsRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< protos.google.cloud.securitycenter.v1.IOrganizationSettings, | protos.google.cloud.securitycenter.v1.IGetOrganizationSettingsRequest @@ -1086,12 +1094,12 @@ export class SecurityCenterClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -1110,7 +1118,7 @@ export class SecurityCenterClient { } getSource( request: protos.google.cloud.securitycenter.v1.IGetSourceRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.cloud.securitycenter.v1.ISource, @@ -1120,7 +1128,7 @@ export class SecurityCenterClient { >; getSource( request: protos.google.cloud.securitycenter.v1.IGetSourceRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< protos.google.cloud.securitycenter.v1.ISource, | protos.google.cloud.securitycenter.v1.IGetSourceRequest @@ -1160,7 +1168,7 @@ export class SecurityCenterClient { getSource( request: protos.google.cloud.securitycenter.v1.IGetSourceRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< protos.google.cloud.securitycenter.v1.ISource, | protos.google.cloud.securitycenter.v1.IGetSourceRequest @@ -1183,12 +1191,12 @@ export class SecurityCenterClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -1203,7 +1211,7 @@ export class SecurityCenterClient { } setFindingState( request: protos.google.cloud.securitycenter.v1.ISetFindingStateRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.cloud.securitycenter.v1.IFinding, @@ -1213,7 +1221,7 @@ export class SecurityCenterClient { >; setFindingState( request: protos.google.cloud.securitycenter.v1.ISetFindingStateRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< protos.google.cloud.securitycenter.v1.IFinding, | protos.google.cloud.securitycenter.v1.ISetFindingStateRequest @@ -1259,7 +1267,7 @@ export class SecurityCenterClient { setFindingState( request: protos.google.cloud.securitycenter.v1.ISetFindingStateRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< protos.google.cloud.securitycenter.v1.IFinding, | protos.google.cloud.securitycenter.v1.ISetFindingStateRequest @@ -1282,12 +1290,12 @@ export class SecurityCenterClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -1302,7 +1310,7 @@ export class SecurityCenterClient { } setIamPolicy( request: protos.google.iam.v1.ISetIamPolicyRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.iam.v1.IPolicy, @@ -1312,7 +1320,7 @@ export class SecurityCenterClient { >; setIamPolicy( request: protos.google.iam.v1.ISetIamPolicyRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< protos.google.iam.v1.IPolicy, protos.google.iam.v1.ISetIamPolicyRequest | null | undefined, @@ -1353,7 +1361,7 @@ export class SecurityCenterClient { setIamPolicy( request: protos.google.iam.v1.ISetIamPolicyRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< protos.google.iam.v1.IPolicy, protos.google.iam.v1.ISetIamPolicyRequest | null | undefined, @@ -1372,12 +1380,12 @@ export class SecurityCenterClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -1392,7 +1400,7 @@ export class SecurityCenterClient { } testIamPermissions( request: protos.google.iam.v1.ITestIamPermissionsRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.iam.v1.ITestIamPermissionsResponse, @@ -1402,7 +1410,7 @@ export class SecurityCenterClient { >; testIamPermissions( request: protos.google.iam.v1.ITestIamPermissionsRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< protos.google.iam.v1.ITestIamPermissionsResponse, protos.google.iam.v1.ITestIamPermissionsRequest | null | undefined, @@ -1443,7 +1451,7 @@ export class SecurityCenterClient { testIamPermissions( request: protos.google.iam.v1.ITestIamPermissionsRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< protos.google.iam.v1.ITestIamPermissionsResponse, protos.google.iam.v1.ITestIamPermissionsRequest | null | undefined, @@ -1462,12 +1470,12 @@ export class SecurityCenterClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -1482,7 +1490,7 @@ export class SecurityCenterClient { } updateFinding( request: protos.google.cloud.securitycenter.v1.IUpdateFindingRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.cloud.securitycenter.v1.IFinding, @@ -1492,7 +1500,7 @@ export class SecurityCenterClient { >; updateFinding( request: protos.google.cloud.securitycenter.v1.IUpdateFindingRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< protos.google.cloud.securitycenter.v1.IFinding, | protos.google.cloud.securitycenter.v1.IUpdateFindingRequest @@ -1545,7 +1553,7 @@ export class SecurityCenterClient { updateFinding( request: protos.google.cloud.securitycenter.v1.IUpdateFindingRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< protos.google.cloud.securitycenter.v1.IFinding, | protos.google.cloud.securitycenter.v1.IUpdateFindingRequest @@ -1568,12 +1576,12 @@ export class SecurityCenterClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -1588,7 +1596,7 @@ export class SecurityCenterClient { } updateNotificationConfig( request: protos.google.cloud.securitycenter.v1.IUpdateNotificationConfigRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.cloud.securitycenter.v1.INotificationConfig, @@ -1601,7 +1609,7 @@ export class SecurityCenterClient { >; updateNotificationConfig( request: protos.google.cloud.securitycenter.v1.IUpdateNotificationConfigRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< protos.google.cloud.securitycenter.v1.INotificationConfig, | protos.google.cloud.securitycenter.v1.IUpdateNotificationConfigRequest @@ -1645,7 +1653,7 @@ export class SecurityCenterClient { updateNotificationConfig( request: protos.google.cloud.securitycenter.v1.IUpdateNotificationConfigRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< protos.google.cloud.securitycenter.v1.INotificationConfig, | protos.google.cloud.securitycenter.v1.IUpdateNotificationConfigRequest @@ -1671,12 +1679,12 @@ export class SecurityCenterClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -1695,7 +1703,7 @@ export class SecurityCenterClient { } updateOrganizationSettings( request: protos.google.cloud.securitycenter.v1.IUpdateOrganizationSettingsRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.cloud.securitycenter.v1.IOrganizationSettings, @@ -1708,7 +1716,7 @@ export class SecurityCenterClient { >; updateOrganizationSettings( request: protos.google.cloud.securitycenter.v1.IUpdateOrganizationSettingsRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< protos.google.cloud.securitycenter.v1.IOrganizationSettings, | protos.google.cloud.securitycenter.v1.IUpdateOrganizationSettingsRequest @@ -1751,7 +1759,7 @@ export class SecurityCenterClient { updateOrganizationSettings( request: protos.google.cloud.securitycenter.v1.IUpdateOrganizationSettingsRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< protos.google.cloud.securitycenter.v1.IOrganizationSettings, | protos.google.cloud.securitycenter.v1.IUpdateOrganizationSettingsRequest @@ -1777,12 +1785,12 @@ export class SecurityCenterClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -1801,7 +1809,7 @@ export class SecurityCenterClient { } updateSource( request: protos.google.cloud.securitycenter.v1.IUpdateSourceRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.cloud.securitycenter.v1.ISource, @@ -1811,7 +1819,7 @@ export class SecurityCenterClient { >; updateSource( request: protos.google.cloud.securitycenter.v1.IUpdateSourceRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< protos.google.cloud.securitycenter.v1.ISource, | protos.google.cloud.securitycenter.v1.IUpdateSourceRequest @@ -1854,7 +1862,7 @@ export class SecurityCenterClient { updateSource( request: protos.google.cloud.securitycenter.v1.IUpdateSourceRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< protos.google.cloud.securitycenter.v1.ISource, | protos.google.cloud.securitycenter.v1.IUpdateSourceRequest @@ -1877,12 +1885,12 @@ export class SecurityCenterClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -1897,7 +1905,7 @@ export class SecurityCenterClient { } updateSecurityMarks( request: protos.google.cloud.securitycenter.v1.IUpdateSecurityMarksRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.cloud.securitycenter.v1.ISecurityMarks, @@ -1910,7 +1918,7 @@ export class SecurityCenterClient { >; updateSecurityMarks( request: protos.google.cloud.securitycenter.v1.IUpdateSecurityMarksRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< protos.google.cloud.securitycenter.v1.ISecurityMarks, | protos.google.cloud.securitycenter.v1.IUpdateSecurityMarksRequest @@ -1959,7 +1967,7 @@ export class SecurityCenterClient { updateSecurityMarks( request: protos.google.cloud.securitycenter.v1.IUpdateSecurityMarksRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< protos.google.cloud.securitycenter.v1.ISecurityMarks, | protos.google.cloud.securitycenter.v1.IUpdateSecurityMarksRequest @@ -1985,12 +1993,12 @@ export class SecurityCenterClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -2006,7 +2014,7 @@ export class SecurityCenterClient { runAssetDiscovery( request: protos.google.cloud.securitycenter.v1.IRunAssetDiscoveryRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ LROperation< @@ -2019,7 +2027,7 @@ export class SecurityCenterClient { >; runAssetDiscovery( request: protos.google.cloud.securitycenter.v1.IRunAssetDiscoveryRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< LROperation< protos.google.cloud.securitycenter.v1.IRunAssetDiscoveryResponse, @@ -2069,7 +2077,7 @@ export class SecurityCenterClient { runAssetDiscovery( request: protos.google.cloud.securitycenter.v1.IRunAssetDiscoveryRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< LROperation< protos.google.cloud.securitycenter.v1.IRunAssetDiscoveryResponse, @@ -2097,12 +2105,12 @@ export class SecurityCenterClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -2154,7 +2162,7 @@ export class SecurityCenterClient { } groupAssets( request: protos.google.cloud.securitycenter.v1.IGroupAssetsRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.cloud.securitycenter.v1.IGroupResult[], @@ -2164,7 +2172,7 @@ export class SecurityCenterClient { >; groupAssets( request: protos.google.cloud.securitycenter.v1.IGroupAssetsRequest, - options: gax.CallOptions, + options: CallOptions, callback: PaginationCallback< protos.google.cloud.securitycenter.v1.IGroupAssetsRequest, | protos.google.cloud.securitycenter.v1.IGroupAssetsResponse @@ -2330,7 +2338,7 @@ export class SecurityCenterClient { groupAssets( request: protos.google.cloud.securitycenter.v1.IGroupAssetsRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | PaginationCallback< protos.google.cloud.securitycenter.v1.IGroupAssetsRequest, | protos.google.cloud.securitycenter.v1.IGroupAssetsResponse @@ -2353,12 +2361,12 @@ export class SecurityCenterClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -2515,7 +2523,7 @@ export class SecurityCenterClient { */ groupAssetsStream( request?: protos.google.cloud.securitycenter.v1.IGroupAssetsRequest, - options?: gax.CallOptions + options?: CallOptions ): Transform { request = request || {}; options = options || {}; @@ -2684,7 +2692,7 @@ export class SecurityCenterClient { */ groupAssetsAsync( request?: protos.google.cloud.securitycenter.v1.IGroupAssetsRequest, - options?: gax.CallOptions + options?: CallOptions ): AsyncIterable { request = request || {}; options = options || {}; @@ -2706,7 +2714,7 @@ export class SecurityCenterClient { } groupFindings( request: protos.google.cloud.securitycenter.v1.IGroupFindingsRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.cloud.securitycenter.v1.IGroupResult[], @@ -2716,7 +2724,7 @@ export class SecurityCenterClient { >; groupFindings( request: protos.google.cloud.securitycenter.v1.IGroupFindingsRequest, - options: gax.CallOptions, + options: CallOptions, callback: PaginationCallback< protos.google.cloud.securitycenter.v1.IGroupFindingsRequest, | protos.google.cloud.securitycenter.v1.IGroupFindingsResponse @@ -2875,7 +2883,7 @@ export class SecurityCenterClient { groupFindings( request: protos.google.cloud.securitycenter.v1.IGroupFindingsRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | PaginationCallback< protos.google.cloud.securitycenter.v1.IGroupFindingsRequest, | protos.google.cloud.securitycenter.v1.IGroupFindingsResponse @@ -2898,12 +2906,12 @@ export class SecurityCenterClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -3050,7 +3058,7 @@ export class SecurityCenterClient { */ groupFindingsStream( request?: protos.google.cloud.securitycenter.v1.IGroupFindingsRequest, - options?: gax.CallOptions + options?: CallOptions ): Transform { request = request || {}; options = options || {}; @@ -3209,7 +3217,7 @@ export class SecurityCenterClient { */ groupFindingsAsync( request?: protos.google.cloud.securitycenter.v1.IGroupFindingsRequest, - options?: gax.CallOptions + options?: CallOptions ): AsyncIterable { request = request || {}; options = options || {}; @@ -3231,7 +3239,7 @@ export class SecurityCenterClient { } listAssets( request: protos.google.cloud.securitycenter.v1.IListAssetsRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.cloud.securitycenter.v1.ListAssetsResponse.IListAssetsResult[], @@ -3241,7 +3249,7 @@ export class SecurityCenterClient { >; listAssets( request: protos.google.cloud.securitycenter.v1.IListAssetsRequest, - options: gax.CallOptions, + options: CallOptions, callback: PaginationCallback< protos.google.cloud.securitycenter.v1.IListAssetsRequest, | protos.google.cloud.securitycenter.v1.IListAssetsResponse @@ -3409,7 +3417,7 @@ export class SecurityCenterClient { listAssets( request: protos.google.cloud.securitycenter.v1.IListAssetsRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | PaginationCallback< protos.google.cloud.securitycenter.v1.IListAssetsRequest, | protos.google.cloud.securitycenter.v1.IListAssetsResponse @@ -3432,12 +3440,12 @@ export class SecurityCenterClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -3597,7 +3605,7 @@ export class SecurityCenterClient { */ listAssetsStream( request?: protos.google.cloud.securitycenter.v1.IListAssetsRequest, - options?: gax.CallOptions + options?: CallOptions ): Transform { request = request || {}; options = options || {}; @@ -3769,10 +3777,8 @@ export class SecurityCenterClient { */ listAssetsAsync( request?: protos.google.cloud.securitycenter.v1.IListAssetsRequest, - options?: gax.CallOptions - ): AsyncIterable< - protos.google.cloud.securitycenter.v1.ListAssetsResponse.IListAssetsResult - > { + options?: CallOptions + ): AsyncIterable { request = request || {}; options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -3789,13 +3795,11 @@ export class SecurityCenterClient { this.innerApiCalls['listAssets'] as GaxCall, (request as unknown) as RequestType, callSettings - ) as AsyncIterable< - protos.google.cloud.securitycenter.v1.ListAssetsResponse.IListAssetsResult - >; + ) as AsyncIterable; } listFindings( request: protos.google.cloud.securitycenter.v1.IListFindingsRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.cloud.securitycenter.v1.ListFindingsResponse.IListFindingsResult[], @@ -3805,7 +3809,7 @@ export class SecurityCenterClient { >; listFindings( request: protos.google.cloud.securitycenter.v1.IListFindingsRequest, - options: gax.CallOptions, + options: CallOptions, callback: PaginationCallback< protos.google.cloud.securitycenter.v1.IListFindingsRequest, | protos.google.cloud.securitycenter.v1.IListFindingsResponse @@ -3968,7 +3972,7 @@ export class SecurityCenterClient { listFindings( request: protos.google.cloud.securitycenter.v1.IListFindingsRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | PaginationCallback< protos.google.cloud.securitycenter.v1.IListFindingsRequest, | protos.google.cloud.securitycenter.v1.IListFindingsResponse @@ -3991,12 +3995,12 @@ export class SecurityCenterClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -4148,7 +4152,7 @@ export class SecurityCenterClient { */ listFindingsStream( request?: protos.google.cloud.securitycenter.v1.IListFindingsRequest, - options?: gax.CallOptions + options?: CallOptions ): Transform { request = request || {}; options = options || {}; @@ -4312,10 +4316,8 @@ export class SecurityCenterClient { */ listFindingsAsync( request?: protos.google.cloud.securitycenter.v1.IListFindingsRequest, - options?: gax.CallOptions - ): AsyncIterable< - protos.google.cloud.securitycenter.v1.ListFindingsResponse.IListFindingsResult - > { + options?: CallOptions + ): AsyncIterable { request = request || {}; options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -4332,13 +4334,11 @@ export class SecurityCenterClient { this.innerApiCalls['listFindings'] as GaxCall, (request as unknown) as RequestType, callSettings - ) as AsyncIterable< - protos.google.cloud.securitycenter.v1.ListFindingsResponse.IListFindingsResult - >; + ) as AsyncIterable; } listNotificationConfigs( request: protos.google.cloud.securitycenter.v1.IListNotificationConfigsRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.cloud.securitycenter.v1.INotificationConfig[], @@ -4348,7 +4348,7 @@ export class SecurityCenterClient { >; listNotificationConfigs( request: protos.google.cloud.securitycenter.v1.IListNotificationConfigsRequest, - options: gax.CallOptions, + options: CallOptions, callback: PaginationCallback< protos.google.cloud.securitycenter.v1.IListNotificationConfigsRequest, | protos.google.cloud.securitycenter.v1.IListNotificationConfigsResponse @@ -4398,7 +4398,7 @@ export class SecurityCenterClient { listNotificationConfigs( request: protos.google.cloud.securitycenter.v1.IListNotificationConfigsRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | PaginationCallback< protos.google.cloud.securitycenter.v1.IListNotificationConfigsRequest, | protos.google.cloud.securitycenter.v1.IListNotificationConfigsResponse @@ -4421,12 +4421,12 @@ export class SecurityCenterClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -4472,7 +4472,7 @@ export class SecurityCenterClient { */ listNotificationConfigsStream( request?: protos.google.cloud.securitycenter.v1.IListNotificationConfigsRequest, - options?: gax.CallOptions + options?: CallOptions ): Transform { request = request || {}; options = options || {}; @@ -4526,7 +4526,7 @@ export class SecurityCenterClient { */ listNotificationConfigsAsync( request?: protos.google.cloud.securitycenter.v1.IListNotificationConfigsRequest, - options?: gax.CallOptions + options?: CallOptions ): AsyncIterable { request = request || {}; options = options || {}; @@ -4544,13 +4544,11 @@ export class SecurityCenterClient { this.innerApiCalls['listNotificationConfigs'] as GaxCall, (request as unknown) as RequestType, callSettings - ) as AsyncIterable< - protos.google.cloud.securitycenter.v1.INotificationConfig - >; + ) as AsyncIterable; } listSources( request: protos.google.cloud.securitycenter.v1.IListSourcesRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.cloud.securitycenter.v1.ISource[], @@ -4560,7 +4558,7 @@ export class SecurityCenterClient { >; listSources( request: protos.google.cloud.securitycenter.v1.IListSourcesRequest, - options: gax.CallOptions, + options: CallOptions, callback: PaginationCallback< protos.google.cloud.securitycenter.v1.IListSourcesRequest, | protos.google.cloud.securitycenter.v1.IListSourcesResponse @@ -4610,7 +4608,7 @@ export class SecurityCenterClient { listSources( request: protos.google.cloud.securitycenter.v1.IListSourcesRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | PaginationCallback< protos.google.cloud.securitycenter.v1.IListSourcesRequest, | protos.google.cloud.securitycenter.v1.IListSourcesResponse @@ -4633,12 +4631,12 @@ export class SecurityCenterClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -4680,7 +4678,7 @@ export class SecurityCenterClient { */ listSourcesStream( request?: protos.google.cloud.securitycenter.v1.IListSourcesRequest, - options?: gax.CallOptions + options?: CallOptions ): Transform { request = request || {}; options = options || {}; @@ -4734,7 +4732,7 @@ export class SecurityCenterClient { */ listSourcesAsync( request?: protos.google.cloud.securitycenter.v1.IListSourcesRequest, - options?: gax.CallOptions + options?: CallOptions ): AsyncIterable { request = request || {}; options = options || {}; diff --git a/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.ts b/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.ts index 4ef1edbe0e0..a29a7e1318c 100644 --- a/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.ts +++ b/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.ts @@ -16,6 +16,7 @@ // ** https://github.com/googleapis/gapic-generator-typescript ** // ** All changes to this file may be overwritten. ** +/* global window */ import * as gax from 'google-gax'; import { Callback, @@ -31,6 +32,11 @@ import * as path from 'path'; import {Transform} from 'stream'; import {RequestType} from 'google-gax/build/src/apitypes'; import * as protos from '../../protos/protos'; +/** + * Client JSON configuration object, loaded from + * `src/v1beta1/security_center_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ import * as gapicConfig from './security_center_client_config.json'; import {operationsProtos} from 'google-gax'; const version = require('../../../package.json').version; @@ -85,9 +91,9 @@ export class SecurityCenterClient { * 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. - * TODO(@alexander-fenster): link to gax documentation. - * @param {boolean} fallback - Use HTTP fallback mode. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP fallback mode. * In fallback mode, a special browser-compatible transport implementation is used * instead of gRPC transport. In browser context (if the `window` object is defined) * the fallback mode is enabled automatically; set `options.fallback` to `false` @@ -100,7 +106,9 @@ export class SecurityCenterClient { opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; const port = opts?.port || staticMembers.port; const clientConfig = opts?.clientConfig ?? {}; - const fallback = opts?.fallback ?? typeof window !== 'undefined'; + 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. @@ -396,7 +404,7 @@ export class SecurityCenterClient { // ------------------- createSource( request: protos.google.cloud.securitycenter.v1beta1.ICreateSourceRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.cloud.securitycenter.v1beta1.ISource, @@ -409,7 +417,7 @@ export class SecurityCenterClient { >; createSource( request: protos.google.cloud.securitycenter.v1beta1.ICreateSourceRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< protos.google.cloud.securitycenter.v1beta1.ISource, | protos.google.cloud.securitycenter.v1beta1.ICreateSourceRequest @@ -452,7 +460,7 @@ export class SecurityCenterClient { createSource( request: protos.google.cloud.securitycenter.v1beta1.ICreateSourceRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< protos.google.cloud.securitycenter.v1beta1.ISource, | protos.google.cloud.securitycenter.v1beta1.ICreateSourceRequest @@ -478,12 +486,12 @@ export class SecurityCenterClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -498,7 +506,7 @@ export class SecurityCenterClient { } createFinding( request: protos.google.cloud.securitycenter.v1beta1.ICreateFindingRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.cloud.securitycenter.v1beta1.IFinding, @@ -511,7 +519,7 @@ export class SecurityCenterClient { >; createFinding( request: protos.google.cloud.securitycenter.v1beta1.ICreateFindingRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< protos.google.cloud.securitycenter.v1beta1.IFinding, | protos.google.cloud.securitycenter.v1beta1.ICreateFindingRequest @@ -559,7 +567,7 @@ export class SecurityCenterClient { createFinding( request: protos.google.cloud.securitycenter.v1beta1.ICreateFindingRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< protos.google.cloud.securitycenter.v1beta1.IFinding, | protos.google.cloud.securitycenter.v1beta1.ICreateFindingRequest @@ -585,12 +593,12 @@ export class SecurityCenterClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -605,7 +613,7 @@ export class SecurityCenterClient { } getIamPolicy( request: protos.google.iam.v1.IGetIamPolicyRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.iam.v1.IPolicy, @@ -615,7 +623,7 @@ export class SecurityCenterClient { >; getIamPolicy( request: protos.google.iam.v1.IGetIamPolicyRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< protos.google.iam.v1.IPolicy, protos.google.iam.v1.IGetIamPolicyRequest | null | undefined, @@ -654,7 +662,7 @@ export class SecurityCenterClient { getIamPolicy( request: protos.google.iam.v1.IGetIamPolicyRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< protos.google.iam.v1.IPolicy, protos.google.iam.v1.IGetIamPolicyRequest | null | undefined, @@ -673,12 +681,12 @@ export class SecurityCenterClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -693,7 +701,7 @@ export class SecurityCenterClient { } getOrganizationSettings( request: protos.google.cloud.securitycenter.v1beta1.IGetOrganizationSettingsRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.cloud.securitycenter.v1beta1.IOrganizationSettings, @@ -706,7 +714,7 @@ export class SecurityCenterClient { >; getOrganizationSettings( request: protos.google.cloud.securitycenter.v1beta1.IGetOrganizationSettingsRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< protos.google.cloud.securitycenter.v1beta1.IOrganizationSettings, | protos.google.cloud.securitycenter.v1beta1.IGetOrganizationSettingsRequest @@ -746,7 +754,7 @@ export class SecurityCenterClient { getOrganizationSettings( request: protos.google.cloud.securitycenter.v1beta1.IGetOrganizationSettingsRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< protos.google.cloud.securitycenter.v1beta1.IOrganizationSettings, | protos.google.cloud.securitycenter.v1beta1.IGetOrganizationSettingsRequest @@ -772,12 +780,12 @@ export class SecurityCenterClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -796,7 +804,7 @@ export class SecurityCenterClient { } getSource( request: protos.google.cloud.securitycenter.v1beta1.IGetSourceRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.cloud.securitycenter.v1beta1.ISource, @@ -806,7 +814,7 @@ export class SecurityCenterClient { >; getSource( request: protos.google.cloud.securitycenter.v1beta1.IGetSourceRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< protos.google.cloud.securitycenter.v1beta1.ISource, | protos.google.cloud.securitycenter.v1beta1.IGetSourceRequest @@ -846,7 +854,7 @@ export class SecurityCenterClient { getSource( request: protos.google.cloud.securitycenter.v1beta1.IGetSourceRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< protos.google.cloud.securitycenter.v1beta1.ISource, | protos.google.cloud.securitycenter.v1beta1.IGetSourceRequest @@ -869,12 +877,12 @@ export class SecurityCenterClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -889,7 +897,7 @@ export class SecurityCenterClient { } setFindingState( request: protos.google.cloud.securitycenter.v1beta1.ISetFindingStateRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.cloud.securitycenter.v1beta1.IFinding, @@ -902,7 +910,7 @@ export class SecurityCenterClient { >; setFindingState( request: protos.google.cloud.securitycenter.v1beta1.ISetFindingStateRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< protos.google.cloud.securitycenter.v1beta1.IFinding, | protos.google.cloud.securitycenter.v1beta1.ISetFindingStateRequest @@ -948,7 +956,7 @@ export class SecurityCenterClient { setFindingState( request: protos.google.cloud.securitycenter.v1beta1.ISetFindingStateRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< protos.google.cloud.securitycenter.v1beta1.IFinding, | protos.google.cloud.securitycenter.v1beta1.ISetFindingStateRequest @@ -974,12 +982,12 @@ export class SecurityCenterClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -994,7 +1002,7 @@ export class SecurityCenterClient { } setIamPolicy( request: protos.google.iam.v1.ISetIamPolicyRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.iam.v1.IPolicy, @@ -1004,7 +1012,7 @@ export class SecurityCenterClient { >; setIamPolicy( request: protos.google.iam.v1.ISetIamPolicyRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< protos.google.iam.v1.IPolicy, protos.google.iam.v1.ISetIamPolicyRequest | null | undefined, @@ -1045,7 +1053,7 @@ export class SecurityCenterClient { setIamPolicy( request: protos.google.iam.v1.ISetIamPolicyRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< protos.google.iam.v1.IPolicy, protos.google.iam.v1.ISetIamPolicyRequest | null | undefined, @@ -1064,12 +1072,12 @@ export class SecurityCenterClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -1084,7 +1092,7 @@ export class SecurityCenterClient { } testIamPermissions( request: protos.google.iam.v1.ITestIamPermissionsRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.iam.v1.ITestIamPermissionsResponse, @@ -1094,7 +1102,7 @@ export class SecurityCenterClient { >; testIamPermissions( request: protos.google.iam.v1.ITestIamPermissionsRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< protos.google.iam.v1.ITestIamPermissionsResponse, protos.google.iam.v1.ITestIamPermissionsRequest | null | undefined, @@ -1135,7 +1143,7 @@ export class SecurityCenterClient { testIamPermissions( request: protos.google.iam.v1.ITestIamPermissionsRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< protos.google.iam.v1.ITestIamPermissionsResponse, protos.google.iam.v1.ITestIamPermissionsRequest | null | undefined, @@ -1154,12 +1162,12 @@ export class SecurityCenterClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -1174,7 +1182,7 @@ export class SecurityCenterClient { } updateFinding( request: protos.google.cloud.securitycenter.v1beta1.IUpdateFindingRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.cloud.securitycenter.v1beta1.IFinding, @@ -1187,7 +1195,7 @@ export class SecurityCenterClient { >; updateFinding( request: protos.google.cloud.securitycenter.v1beta1.IUpdateFindingRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< protos.google.cloud.securitycenter.v1beta1.IFinding, | protos.google.cloud.securitycenter.v1beta1.IUpdateFindingRequest @@ -1235,7 +1243,7 @@ export class SecurityCenterClient { updateFinding( request: protos.google.cloud.securitycenter.v1beta1.IUpdateFindingRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< protos.google.cloud.securitycenter.v1beta1.IFinding, | protos.google.cloud.securitycenter.v1beta1.IUpdateFindingRequest @@ -1261,12 +1269,12 @@ export class SecurityCenterClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -1281,7 +1289,7 @@ export class SecurityCenterClient { } updateOrganizationSettings( request: protos.google.cloud.securitycenter.v1beta1.IUpdateOrganizationSettingsRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.cloud.securitycenter.v1beta1.IOrganizationSettings, @@ -1294,7 +1302,7 @@ export class SecurityCenterClient { >; updateOrganizationSettings( request: protos.google.cloud.securitycenter.v1beta1.IUpdateOrganizationSettingsRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< protos.google.cloud.securitycenter.v1beta1.IOrganizationSettings, | protos.google.cloud.securitycenter.v1beta1.IUpdateOrganizationSettingsRequest @@ -1335,7 +1343,7 @@ export class SecurityCenterClient { updateOrganizationSettings( request: protos.google.cloud.securitycenter.v1beta1.IUpdateOrganizationSettingsRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< protos.google.cloud.securitycenter.v1beta1.IOrganizationSettings, | protos.google.cloud.securitycenter.v1beta1.IUpdateOrganizationSettingsRequest @@ -1361,12 +1369,12 @@ export class SecurityCenterClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -1385,7 +1393,7 @@ export class SecurityCenterClient { } updateSource( request: protos.google.cloud.securitycenter.v1beta1.IUpdateSourceRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.cloud.securitycenter.v1beta1.ISource, @@ -1398,7 +1406,7 @@ export class SecurityCenterClient { >; updateSource( request: protos.google.cloud.securitycenter.v1beta1.IUpdateSourceRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< protos.google.cloud.securitycenter.v1beta1.ISource, | protos.google.cloud.securitycenter.v1beta1.IUpdateSourceRequest @@ -1439,7 +1447,7 @@ export class SecurityCenterClient { updateSource( request: protos.google.cloud.securitycenter.v1beta1.IUpdateSourceRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< protos.google.cloud.securitycenter.v1beta1.ISource, | protos.google.cloud.securitycenter.v1beta1.IUpdateSourceRequest @@ -1465,12 +1473,12 @@ export class SecurityCenterClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -1485,7 +1493,7 @@ export class SecurityCenterClient { } updateSecurityMarks( request: protos.google.cloud.securitycenter.v1beta1.IUpdateSecurityMarksRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.cloud.securitycenter.v1beta1.ISecurityMarks, @@ -1498,7 +1506,7 @@ export class SecurityCenterClient { >; updateSecurityMarks( request: protos.google.cloud.securitycenter.v1beta1.IUpdateSecurityMarksRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< protos.google.cloud.securitycenter.v1beta1.ISecurityMarks, | protos.google.cloud.securitycenter.v1beta1.IUpdateSecurityMarksRequest @@ -1541,7 +1549,7 @@ export class SecurityCenterClient { updateSecurityMarks( request: protos.google.cloud.securitycenter.v1beta1.IUpdateSecurityMarksRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< protos.google.cloud.securitycenter.v1beta1.ISecurityMarks, | protos.google.cloud.securitycenter.v1beta1.IUpdateSecurityMarksRequest @@ -1567,12 +1575,12 @@ export class SecurityCenterClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -1588,7 +1596,7 @@ export class SecurityCenterClient { runAssetDiscovery( request: protos.google.cloud.securitycenter.v1beta1.IRunAssetDiscoveryRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ LROperation, @@ -1598,7 +1606,7 @@ export class SecurityCenterClient { >; runAssetDiscovery( request: protos.google.cloud.securitycenter.v1beta1.IRunAssetDiscoveryRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< LROperation, protos.google.longrunning.IOperation | null | undefined, @@ -1642,7 +1650,7 @@ export class SecurityCenterClient { runAssetDiscovery( request: protos.google.cloud.securitycenter.v1beta1.IRunAssetDiscoveryRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< LROperation< protos.google.protobuf.IEmpty, @@ -1664,12 +1672,12 @@ export class SecurityCenterClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -1718,7 +1726,7 @@ export class SecurityCenterClient { } groupAssets( request: protos.google.cloud.securitycenter.v1beta1.IGroupAssetsRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.cloud.securitycenter.v1beta1.IGroupResult[], @@ -1728,7 +1736,7 @@ export class SecurityCenterClient { >; groupAssets( request: protos.google.cloud.securitycenter.v1beta1.IGroupAssetsRequest, - options: gax.CallOptions, + options: CallOptions, callback: PaginationCallback< protos.google.cloud.securitycenter.v1beta1.IGroupAssetsRequest, | protos.google.cloud.securitycenter.v1beta1.IGroupAssetsResponse @@ -1849,7 +1857,7 @@ export class SecurityCenterClient { groupAssets( request: protos.google.cloud.securitycenter.v1beta1.IGroupAssetsRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | PaginationCallback< protos.google.cloud.securitycenter.v1beta1.IGroupAssetsRequest, | protos.google.cloud.securitycenter.v1beta1.IGroupAssetsResponse @@ -1872,12 +1880,12 @@ export class SecurityCenterClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -1989,7 +1997,7 @@ export class SecurityCenterClient { */ groupAssetsStream( request?: protos.google.cloud.securitycenter.v1beta1.IGroupAssetsRequest, - options?: gax.CallOptions + options?: CallOptions ): Transform { request = request || {}; options = options || {}; @@ -2113,7 +2121,7 @@ export class SecurityCenterClient { */ groupAssetsAsync( request?: protos.google.cloud.securitycenter.v1beta1.IGroupAssetsRequest, - options?: gax.CallOptions + options?: CallOptions ): AsyncIterable { request = request || {}; options = options || {}; @@ -2135,7 +2143,7 @@ export class SecurityCenterClient { } groupFindings( request: protos.google.cloud.securitycenter.v1beta1.IGroupFindingsRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.cloud.securitycenter.v1beta1.IGroupResult[], @@ -2145,7 +2153,7 @@ export class SecurityCenterClient { >; groupFindings( request: protos.google.cloud.securitycenter.v1beta1.IGroupFindingsRequest, - options: gax.CallOptions, + options: CallOptions, callback: PaginationCallback< protos.google.cloud.securitycenter.v1beta1.IGroupFindingsRequest, | protos.google.cloud.securitycenter.v1beta1.IGroupFindingsResponse @@ -2244,7 +2252,7 @@ export class SecurityCenterClient { groupFindings( request: protos.google.cloud.securitycenter.v1beta1.IGroupFindingsRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | PaginationCallback< protos.google.cloud.securitycenter.v1beta1.IGroupFindingsRequest, | protos.google.cloud.securitycenter.v1beta1.IGroupFindingsResponse @@ -2267,12 +2275,12 @@ export class SecurityCenterClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -2359,7 +2367,7 @@ export class SecurityCenterClient { */ groupFindingsStream( request?: protos.google.cloud.securitycenter.v1beta1.IGroupFindingsRequest, - options?: gax.CallOptions + options?: CallOptions ): Transform { request = request || {}; options = options || {}; @@ -2458,7 +2466,7 @@ export class SecurityCenterClient { */ groupFindingsAsync( request?: protos.google.cloud.securitycenter.v1beta1.IGroupFindingsRequest, - options?: gax.CallOptions + options?: CallOptions ): AsyncIterable { request = request || {}; options = options || {}; @@ -2480,7 +2488,7 @@ export class SecurityCenterClient { } listAssets( request: protos.google.cloud.securitycenter.v1beta1.IListAssetsRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.cloud.securitycenter.v1beta1.ListAssetsResponse.IListAssetsResult[], @@ -2490,7 +2498,7 @@ export class SecurityCenterClient { >; listAssets( request: protos.google.cloud.securitycenter.v1beta1.IListAssetsRequest, - options: gax.CallOptions, + options: CallOptions, callback: PaginationCallback< protos.google.cloud.securitycenter.v1beta1.IListAssetsRequest, | protos.google.cloud.securitycenter.v1beta1.IListAssetsResponse @@ -2610,7 +2618,7 @@ export class SecurityCenterClient { listAssets( request: protos.google.cloud.securitycenter.v1beta1.IListAssetsRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | PaginationCallback< protos.google.cloud.securitycenter.v1beta1.IListAssetsRequest, | protos.google.cloud.securitycenter.v1beta1.IListAssetsResponse @@ -2633,12 +2641,12 @@ export class SecurityCenterClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -2750,7 +2758,7 @@ export class SecurityCenterClient { */ listAssetsStream( request?: protos.google.cloud.securitycenter.v1beta1.IListAssetsRequest, - options?: gax.CallOptions + options?: CallOptions ): Transform { request = request || {}; options = options || {}; @@ -2874,10 +2882,8 @@ export class SecurityCenterClient { */ listAssetsAsync( request?: protos.google.cloud.securitycenter.v1beta1.IListAssetsRequest, - options?: gax.CallOptions - ): AsyncIterable< - protos.google.cloud.securitycenter.v1beta1.ListAssetsResponse.IListAssetsResult - > { + options?: CallOptions + ): AsyncIterable { request = request || {}; options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -2894,13 +2900,11 @@ export class SecurityCenterClient { this.innerApiCalls['listAssets'] as GaxCall, (request as unknown) as RequestType, callSettings - ) as AsyncIterable< - protos.google.cloud.securitycenter.v1beta1.ListAssetsResponse.IListAssetsResult - >; + ) as AsyncIterable; } listFindings( request: protos.google.cloud.securitycenter.v1beta1.IListFindingsRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.cloud.securitycenter.v1beta1.IFinding[], @@ -2910,7 +2914,7 @@ export class SecurityCenterClient { >; listFindings( request: protos.google.cloud.securitycenter.v1beta1.IListFindingsRequest, - options: gax.CallOptions, + options: CallOptions, callback: PaginationCallback< protos.google.cloud.securitycenter.v1beta1.IListFindingsRequest, | protos.google.cloud.securitycenter.v1beta1.IListFindingsResponse @@ -3008,7 +3012,7 @@ export class SecurityCenterClient { listFindings( request: protos.google.cloud.securitycenter.v1beta1.IListFindingsRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | PaginationCallback< protos.google.cloud.securitycenter.v1beta1.IListFindingsRequest, | protos.google.cloud.securitycenter.v1beta1.IListFindingsResponse @@ -3031,12 +3035,12 @@ export class SecurityCenterClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -3123,7 +3127,7 @@ export class SecurityCenterClient { */ listFindingsStream( request?: protos.google.cloud.securitycenter.v1beta1.IListFindingsRequest, - options?: gax.CallOptions + options?: CallOptions ): Transform { request = request || {}; options = options || {}; @@ -3222,7 +3226,7 @@ export class SecurityCenterClient { */ listFindingsAsync( request?: protos.google.cloud.securitycenter.v1beta1.IListFindingsRequest, - options?: gax.CallOptions + options?: CallOptions ): AsyncIterable { request = request || {}; options = options || {}; @@ -3244,7 +3248,7 @@ export class SecurityCenterClient { } listSources( request: protos.google.cloud.securitycenter.v1beta1.IListSourcesRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.cloud.securitycenter.v1beta1.ISource[], @@ -3254,7 +3258,7 @@ export class SecurityCenterClient { >; listSources( request: protos.google.cloud.securitycenter.v1beta1.IListSourcesRequest, - options: gax.CallOptions, + options: CallOptions, callback: PaginationCallback< protos.google.cloud.securitycenter.v1beta1.IListSourcesRequest, | protos.google.cloud.securitycenter.v1beta1.IListSourcesResponse @@ -3304,7 +3308,7 @@ export class SecurityCenterClient { listSources( request: protos.google.cloud.securitycenter.v1beta1.IListSourcesRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | PaginationCallback< protos.google.cloud.securitycenter.v1beta1.IListSourcesRequest, | protos.google.cloud.securitycenter.v1beta1.IListSourcesResponse @@ -3327,12 +3331,12 @@ export class SecurityCenterClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -3374,7 +3378,7 @@ export class SecurityCenterClient { */ listSourcesStream( request?: protos.google.cloud.securitycenter.v1beta1.IListSourcesRequest, - options?: gax.CallOptions + options?: CallOptions ): Transform { request = request || {}; options = options || {}; @@ -3428,7 +3432,7 @@ export class SecurityCenterClient { */ listSourcesAsync( request?: protos.google.cloud.securitycenter.v1beta1.IListSourcesRequest, - options?: gax.CallOptions + options?: CallOptions ): AsyncIterable { request = request || {}; options = options || {}; diff --git a/packages/google-cloud-securitycenter/src/v1p1beta1/security_center_client.ts b/packages/google-cloud-securitycenter/src/v1p1beta1/security_center_client.ts index aab0141fed9..4c81d1d532f 100644 --- a/packages/google-cloud-securitycenter/src/v1p1beta1/security_center_client.ts +++ b/packages/google-cloud-securitycenter/src/v1p1beta1/security_center_client.ts @@ -16,6 +16,7 @@ // ** https://github.com/googleapis/gapic-generator-typescript ** // ** All changes to this file may be overwritten. ** +/* global window */ import * as gax from 'google-gax'; import { Callback, @@ -31,6 +32,11 @@ import * as path from 'path'; import {Transform} from 'stream'; import {RequestType} from 'google-gax/build/src/apitypes'; import * as protos from '../../protos/protos'; +/** + * Client JSON configuration object, loaded from + * `src/v1p1beta1/security_center_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ import * as gapicConfig from './security_center_client_config.json'; import {operationsProtos} from 'google-gax'; const version = require('../../../package.json').version; @@ -85,9 +91,9 @@ export class SecurityCenterClient { * 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. - * TODO(@alexander-fenster): link to gax documentation. - * @param {boolean} fallback - Use HTTP fallback mode. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP fallback mode. * In fallback mode, a special browser-compatible transport implementation is used * instead of gRPC transport. In browser context (if the `window` object is defined) * the fallback mode is enabled automatically; set `options.fallback` to `false` @@ -100,7 +106,9 @@ export class SecurityCenterClient { opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; const port = opts?.port || staticMembers.port; const clientConfig = opts?.clientConfig ?? {}; - const fallback = opts?.fallback ?? typeof window !== 'undefined'; + 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. @@ -409,7 +417,7 @@ export class SecurityCenterClient { // ------------------- createSource( request: protos.google.cloud.securitycenter.v1p1beta1.ICreateSourceRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.cloud.securitycenter.v1p1beta1.ISource, @@ -422,7 +430,7 @@ export class SecurityCenterClient { >; createSource( request: protos.google.cloud.securitycenter.v1p1beta1.ICreateSourceRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< protos.google.cloud.securitycenter.v1p1beta1.ISource, | protos.google.cloud.securitycenter.v1p1beta1.ICreateSourceRequest @@ -465,7 +473,7 @@ export class SecurityCenterClient { createSource( request: protos.google.cloud.securitycenter.v1p1beta1.ICreateSourceRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< protos.google.cloud.securitycenter.v1p1beta1.ISource, | protos.google.cloud.securitycenter.v1p1beta1.ICreateSourceRequest @@ -491,12 +499,12 @@ export class SecurityCenterClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -511,7 +519,7 @@ export class SecurityCenterClient { } createFinding( request: protos.google.cloud.securitycenter.v1p1beta1.ICreateFindingRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.cloud.securitycenter.v1p1beta1.IFinding, @@ -524,7 +532,7 @@ export class SecurityCenterClient { >; createFinding( request: protos.google.cloud.securitycenter.v1p1beta1.ICreateFindingRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< protos.google.cloud.securitycenter.v1p1beta1.IFinding, | protos.google.cloud.securitycenter.v1p1beta1.ICreateFindingRequest @@ -570,7 +578,7 @@ export class SecurityCenterClient { createFinding( request: protos.google.cloud.securitycenter.v1p1beta1.ICreateFindingRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< protos.google.cloud.securitycenter.v1p1beta1.IFinding, | protos.google.cloud.securitycenter.v1p1beta1.ICreateFindingRequest @@ -596,12 +604,12 @@ export class SecurityCenterClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -616,7 +624,7 @@ export class SecurityCenterClient { } createNotificationConfig( request: protos.google.cloud.securitycenter.v1p1beta1.ICreateNotificationConfigRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.cloud.securitycenter.v1p1beta1.INotificationConfig, @@ -629,7 +637,7 @@ export class SecurityCenterClient { >; createNotificationConfig( request: protos.google.cloud.securitycenter.v1p1beta1.ICreateNotificationConfigRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< protos.google.cloud.securitycenter.v1p1beta1.INotificationConfig, | protos.google.cloud.securitycenter.v1p1beta1.ICreateNotificationConfigRequest @@ -676,7 +684,7 @@ export class SecurityCenterClient { createNotificationConfig( request: protos.google.cloud.securitycenter.v1p1beta1.ICreateNotificationConfigRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< protos.google.cloud.securitycenter.v1p1beta1.INotificationConfig, | protos.google.cloud.securitycenter.v1p1beta1.ICreateNotificationConfigRequest @@ -702,12 +710,12 @@ export class SecurityCenterClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -726,7 +734,7 @@ export class SecurityCenterClient { } deleteNotificationConfig( request: protos.google.cloud.securitycenter.v1p1beta1.IDeleteNotificationConfigRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.protobuf.IEmpty, @@ -739,7 +747,7 @@ export class SecurityCenterClient { >; deleteNotificationConfig( request: protos.google.cloud.securitycenter.v1p1beta1.IDeleteNotificationConfigRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< protos.google.protobuf.IEmpty, | protos.google.cloud.securitycenter.v1p1beta1.IDeleteNotificationConfigRequest @@ -779,7 +787,7 @@ export class SecurityCenterClient { deleteNotificationConfig( request: protos.google.cloud.securitycenter.v1p1beta1.IDeleteNotificationConfigRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< protos.google.protobuf.IEmpty, | protos.google.cloud.securitycenter.v1p1beta1.IDeleteNotificationConfigRequest @@ -805,12 +813,12 @@ export class SecurityCenterClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -829,7 +837,7 @@ export class SecurityCenterClient { } getIamPolicy( request: protos.google.iam.v1.IGetIamPolicyRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.iam.v1.IPolicy, @@ -839,7 +847,7 @@ export class SecurityCenterClient { >; getIamPolicy( request: protos.google.iam.v1.IGetIamPolicyRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< protos.google.iam.v1.IPolicy, protos.google.iam.v1.IGetIamPolicyRequest | null | undefined, @@ -878,7 +886,7 @@ export class SecurityCenterClient { getIamPolicy( request: protos.google.iam.v1.IGetIamPolicyRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< protos.google.iam.v1.IPolicy, protos.google.iam.v1.IGetIamPolicyRequest | null | undefined, @@ -897,12 +905,12 @@ export class SecurityCenterClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -917,7 +925,7 @@ export class SecurityCenterClient { } getNotificationConfig( request: protos.google.cloud.securitycenter.v1p1beta1.IGetNotificationConfigRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.cloud.securitycenter.v1p1beta1.INotificationConfig, @@ -930,7 +938,7 @@ export class SecurityCenterClient { >; getNotificationConfig( request: protos.google.cloud.securitycenter.v1p1beta1.IGetNotificationConfigRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< protos.google.cloud.securitycenter.v1p1beta1.INotificationConfig, | protos.google.cloud.securitycenter.v1p1beta1.IGetNotificationConfigRequest @@ -970,7 +978,7 @@ export class SecurityCenterClient { getNotificationConfig( request: protos.google.cloud.securitycenter.v1p1beta1.IGetNotificationConfigRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< protos.google.cloud.securitycenter.v1p1beta1.INotificationConfig, | protos.google.cloud.securitycenter.v1p1beta1.IGetNotificationConfigRequest @@ -996,12 +1004,12 @@ export class SecurityCenterClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -1016,7 +1024,7 @@ export class SecurityCenterClient { } getOrganizationSettings( request: protos.google.cloud.securitycenter.v1p1beta1.IGetOrganizationSettingsRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.cloud.securitycenter.v1p1beta1.IOrganizationSettings, @@ -1029,7 +1037,7 @@ export class SecurityCenterClient { >; getOrganizationSettings( request: protos.google.cloud.securitycenter.v1p1beta1.IGetOrganizationSettingsRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< protos.google.cloud.securitycenter.v1p1beta1.IOrganizationSettings, | protos.google.cloud.securitycenter.v1p1beta1.IGetOrganizationSettingsRequest @@ -1069,7 +1077,7 @@ export class SecurityCenterClient { getOrganizationSettings( request: protos.google.cloud.securitycenter.v1p1beta1.IGetOrganizationSettingsRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< protos.google.cloud.securitycenter.v1p1beta1.IOrganizationSettings, | protos.google.cloud.securitycenter.v1p1beta1.IGetOrganizationSettingsRequest @@ -1095,12 +1103,12 @@ export class SecurityCenterClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -1119,7 +1127,7 @@ export class SecurityCenterClient { } getSource( request: protos.google.cloud.securitycenter.v1p1beta1.IGetSourceRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.cloud.securitycenter.v1p1beta1.ISource, @@ -1132,7 +1140,7 @@ export class SecurityCenterClient { >; getSource( request: protos.google.cloud.securitycenter.v1p1beta1.IGetSourceRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< protos.google.cloud.securitycenter.v1p1beta1.ISource, | protos.google.cloud.securitycenter.v1p1beta1.IGetSourceRequest @@ -1172,7 +1180,7 @@ export class SecurityCenterClient { getSource( request: protos.google.cloud.securitycenter.v1p1beta1.IGetSourceRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< protos.google.cloud.securitycenter.v1p1beta1.ISource, | protos.google.cloud.securitycenter.v1p1beta1.IGetSourceRequest @@ -1198,12 +1206,12 @@ export class SecurityCenterClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -1218,7 +1226,7 @@ export class SecurityCenterClient { } setFindingState( request: protos.google.cloud.securitycenter.v1p1beta1.ISetFindingStateRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.cloud.securitycenter.v1p1beta1.IFinding, @@ -1231,7 +1239,7 @@ export class SecurityCenterClient { >; setFindingState( request: protos.google.cloud.securitycenter.v1p1beta1.ISetFindingStateRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< protos.google.cloud.securitycenter.v1p1beta1.IFinding, | protos.google.cloud.securitycenter.v1p1beta1.ISetFindingStateRequest @@ -1277,7 +1285,7 @@ export class SecurityCenterClient { setFindingState( request: protos.google.cloud.securitycenter.v1p1beta1.ISetFindingStateRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< protos.google.cloud.securitycenter.v1p1beta1.IFinding, | protos.google.cloud.securitycenter.v1p1beta1.ISetFindingStateRequest @@ -1303,12 +1311,12 @@ export class SecurityCenterClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -1323,7 +1331,7 @@ export class SecurityCenterClient { } setIamPolicy( request: protos.google.iam.v1.ISetIamPolicyRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.iam.v1.IPolicy, @@ -1333,7 +1341,7 @@ export class SecurityCenterClient { >; setIamPolicy( request: protos.google.iam.v1.ISetIamPolicyRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< protos.google.iam.v1.IPolicy, protos.google.iam.v1.ISetIamPolicyRequest | null | undefined, @@ -1374,7 +1382,7 @@ export class SecurityCenterClient { setIamPolicy( request: protos.google.iam.v1.ISetIamPolicyRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< protos.google.iam.v1.IPolicy, protos.google.iam.v1.ISetIamPolicyRequest | null | undefined, @@ -1393,12 +1401,12 @@ export class SecurityCenterClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -1413,7 +1421,7 @@ export class SecurityCenterClient { } testIamPermissions( request: protos.google.iam.v1.ITestIamPermissionsRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.iam.v1.ITestIamPermissionsResponse, @@ -1423,7 +1431,7 @@ export class SecurityCenterClient { >; testIamPermissions( request: protos.google.iam.v1.ITestIamPermissionsRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< protos.google.iam.v1.ITestIamPermissionsResponse, protos.google.iam.v1.ITestIamPermissionsRequest | null | undefined, @@ -1464,7 +1472,7 @@ export class SecurityCenterClient { testIamPermissions( request: protos.google.iam.v1.ITestIamPermissionsRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< protos.google.iam.v1.ITestIamPermissionsResponse, protos.google.iam.v1.ITestIamPermissionsRequest | null | undefined, @@ -1483,12 +1491,12 @@ export class SecurityCenterClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -1503,7 +1511,7 @@ export class SecurityCenterClient { } updateFinding( request: protos.google.cloud.securitycenter.v1p1beta1.IUpdateFindingRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.cloud.securitycenter.v1p1beta1.IFinding, @@ -1516,7 +1524,7 @@ export class SecurityCenterClient { >; updateFinding( request: protos.google.cloud.securitycenter.v1p1beta1.IUpdateFindingRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< protos.google.cloud.securitycenter.v1p1beta1.IFinding, | protos.google.cloud.securitycenter.v1p1beta1.IUpdateFindingRequest @@ -1569,7 +1577,7 @@ export class SecurityCenterClient { updateFinding( request: protos.google.cloud.securitycenter.v1p1beta1.IUpdateFindingRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< protos.google.cloud.securitycenter.v1p1beta1.IFinding, | protos.google.cloud.securitycenter.v1p1beta1.IUpdateFindingRequest @@ -1595,12 +1603,12 @@ export class SecurityCenterClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -1615,7 +1623,7 @@ export class SecurityCenterClient { } updateNotificationConfig( request: protos.google.cloud.securitycenter.v1p1beta1.IUpdateNotificationConfigRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.cloud.securitycenter.v1p1beta1.INotificationConfig, @@ -1628,7 +1636,7 @@ export class SecurityCenterClient { >; updateNotificationConfig( request: protos.google.cloud.securitycenter.v1p1beta1.IUpdateNotificationConfigRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< protos.google.cloud.securitycenter.v1p1beta1.INotificationConfig, | protos.google.cloud.securitycenter.v1p1beta1.IUpdateNotificationConfigRequest @@ -1672,7 +1680,7 @@ export class SecurityCenterClient { updateNotificationConfig( request: protos.google.cloud.securitycenter.v1p1beta1.IUpdateNotificationConfigRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< protos.google.cloud.securitycenter.v1p1beta1.INotificationConfig, | protos.google.cloud.securitycenter.v1p1beta1.IUpdateNotificationConfigRequest @@ -1698,12 +1706,12 @@ export class SecurityCenterClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -1722,7 +1730,7 @@ export class SecurityCenterClient { } updateOrganizationSettings( request: protos.google.cloud.securitycenter.v1p1beta1.IUpdateOrganizationSettingsRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.cloud.securitycenter.v1p1beta1.IOrganizationSettings, @@ -1735,7 +1743,7 @@ export class SecurityCenterClient { >; updateOrganizationSettings( request: protos.google.cloud.securitycenter.v1p1beta1.IUpdateOrganizationSettingsRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< protos.google.cloud.securitycenter.v1p1beta1.IOrganizationSettings, | protos.google.cloud.securitycenter.v1p1beta1.IUpdateOrganizationSettingsRequest @@ -1778,7 +1786,7 @@ export class SecurityCenterClient { updateOrganizationSettings( request: protos.google.cloud.securitycenter.v1p1beta1.IUpdateOrganizationSettingsRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< protos.google.cloud.securitycenter.v1p1beta1.IOrganizationSettings, | protos.google.cloud.securitycenter.v1p1beta1.IUpdateOrganizationSettingsRequest @@ -1804,12 +1812,12 @@ export class SecurityCenterClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -1828,7 +1836,7 @@ export class SecurityCenterClient { } updateSource( request: protos.google.cloud.securitycenter.v1p1beta1.IUpdateSourceRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.cloud.securitycenter.v1p1beta1.ISource, @@ -1841,7 +1849,7 @@ export class SecurityCenterClient { >; updateSource( request: protos.google.cloud.securitycenter.v1p1beta1.IUpdateSourceRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< protos.google.cloud.securitycenter.v1p1beta1.ISource, | protos.google.cloud.securitycenter.v1p1beta1.IUpdateSourceRequest @@ -1884,7 +1892,7 @@ export class SecurityCenterClient { updateSource( request: protos.google.cloud.securitycenter.v1p1beta1.IUpdateSourceRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< protos.google.cloud.securitycenter.v1p1beta1.ISource, | protos.google.cloud.securitycenter.v1p1beta1.IUpdateSourceRequest @@ -1910,12 +1918,12 @@ export class SecurityCenterClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -1930,7 +1938,7 @@ export class SecurityCenterClient { } updateSecurityMarks( request: protos.google.cloud.securitycenter.v1p1beta1.IUpdateSecurityMarksRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.cloud.securitycenter.v1p1beta1.ISecurityMarks, @@ -1943,7 +1951,7 @@ export class SecurityCenterClient { >; updateSecurityMarks( request: protos.google.cloud.securitycenter.v1p1beta1.IUpdateSecurityMarksRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< protos.google.cloud.securitycenter.v1p1beta1.ISecurityMarks, | protos.google.cloud.securitycenter.v1p1beta1.IUpdateSecurityMarksRequest @@ -1992,7 +2000,7 @@ export class SecurityCenterClient { updateSecurityMarks( request: protos.google.cloud.securitycenter.v1p1beta1.IUpdateSecurityMarksRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< protos.google.cloud.securitycenter.v1p1beta1.ISecurityMarks, | protos.google.cloud.securitycenter.v1p1beta1.IUpdateSecurityMarksRequest @@ -2018,12 +2026,12 @@ export class SecurityCenterClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -2039,7 +2047,7 @@ export class SecurityCenterClient { runAssetDiscovery( request: protos.google.cloud.securitycenter.v1p1beta1.IRunAssetDiscoveryRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ LROperation< @@ -2052,7 +2060,7 @@ export class SecurityCenterClient { >; runAssetDiscovery( request: protos.google.cloud.securitycenter.v1p1beta1.IRunAssetDiscoveryRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< LROperation< protos.google.cloud.securitycenter.v1p1beta1.IRunAssetDiscoveryResponse, @@ -2102,7 +2110,7 @@ export class SecurityCenterClient { runAssetDiscovery( request: protos.google.cloud.securitycenter.v1p1beta1.IRunAssetDiscoveryRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< LROperation< protos.google.cloud.securitycenter.v1p1beta1.IRunAssetDiscoveryResponse, @@ -2130,12 +2138,12 @@ export class SecurityCenterClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -2187,7 +2195,7 @@ export class SecurityCenterClient { } groupAssets( request: protos.google.cloud.securitycenter.v1p1beta1.IGroupAssetsRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.cloud.securitycenter.v1p1beta1.IGroupResult[], @@ -2197,7 +2205,7 @@ export class SecurityCenterClient { >; groupAssets( request: protos.google.cloud.securitycenter.v1p1beta1.IGroupAssetsRequest, - options: gax.CallOptions, + options: CallOptions, callback: PaginationCallback< protos.google.cloud.securitycenter.v1p1beta1.IGroupAssetsRequest, | protos.google.cloud.securitycenter.v1p1beta1.IGroupAssetsResponse @@ -2363,7 +2371,7 @@ export class SecurityCenterClient { groupAssets( request: protos.google.cloud.securitycenter.v1p1beta1.IGroupAssetsRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | PaginationCallback< protos.google.cloud.securitycenter.v1p1beta1.IGroupAssetsRequest, | protos.google.cloud.securitycenter.v1p1beta1.IGroupAssetsResponse @@ -2386,12 +2394,12 @@ export class SecurityCenterClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -2548,7 +2556,7 @@ export class SecurityCenterClient { */ groupAssetsStream( request?: protos.google.cloud.securitycenter.v1p1beta1.IGroupAssetsRequest, - options?: gax.CallOptions + options?: CallOptions ): Transform { request = request || {}; options = options || {}; @@ -2717,7 +2725,7 @@ export class SecurityCenterClient { */ groupAssetsAsync( request?: protos.google.cloud.securitycenter.v1p1beta1.IGroupAssetsRequest, - options?: gax.CallOptions + options?: CallOptions ): AsyncIterable { request = request || {}; options = options || {}; @@ -2735,13 +2743,11 @@ export class SecurityCenterClient { this.innerApiCalls['groupAssets'] as GaxCall, (request as unknown) as RequestType, callSettings - ) as AsyncIterable< - protos.google.cloud.securitycenter.v1p1beta1.IGroupResult - >; + ) as AsyncIterable; } groupFindings( request: protos.google.cloud.securitycenter.v1p1beta1.IGroupFindingsRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.cloud.securitycenter.v1p1beta1.IGroupResult[], @@ -2751,7 +2757,7 @@ export class SecurityCenterClient { >; groupFindings( request: protos.google.cloud.securitycenter.v1p1beta1.IGroupFindingsRequest, - options: gax.CallOptions, + options: CallOptions, callback: PaginationCallback< protos.google.cloud.securitycenter.v1p1beta1.IGroupFindingsRequest, | protos.google.cloud.securitycenter.v1p1beta1.IGroupFindingsResponse @@ -2912,7 +2918,7 @@ export class SecurityCenterClient { groupFindings( request: protos.google.cloud.securitycenter.v1p1beta1.IGroupFindingsRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | PaginationCallback< protos.google.cloud.securitycenter.v1p1beta1.IGroupFindingsRequest, | protos.google.cloud.securitycenter.v1p1beta1.IGroupFindingsResponse @@ -2935,12 +2941,12 @@ export class SecurityCenterClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -3089,7 +3095,7 @@ export class SecurityCenterClient { */ groupFindingsStream( request?: protos.google.cloud.securitycenter.v1p1beta1.IGroupFindingsRequest, - options?: gax.CallOptions + options?: CallOptions ): Transform { request = request || {}; options = options || {}; @@ -3250,7 +3256,7 @@ export class SecurityCenterClient { */ groupFindingsAsync( request?: protos.google.cloud.securitycenter.v1p1beta1.IGroupFindingsRequest, - options?: gax.CallOptions + options?: CallOptions ): AsyncIterable { request = request || {}; options = options || {}; @@ -3268,13 +3274,11 @@ export class SecurityCenterClient { this.innerApiCalls['groupFindings'] as GaxCall, (request as unknown) as RequestType, callSettings - ) as AsyncIterable< - protos.google.cloud.securitycenter.v1p1beta1.IGroupResult - >; + ) as AsyncIterable; } listAssets( request: protos.google.cloud.securitycenter.v1p1beta1.IListAssetsRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.IListAssetsResult[], @@ -3284,7 +3288,7 @@ export class SecurityCenterClient { >; listAssets( request: protos.google.cloud.securitycenter.v1p1beta1.IListAssetsRequest, - options: gax.CallOptions, + options: CallOptions, callback: PaginationCallback< protos.google.cloud.securitycenter.v1p1beta1.IListAssetsRequest, | protos.google.cloud.securitycenter.v1p1beta1.IListAssetsResponse @@ -3453,7 +3457,7 @@ export class SecurityCenterClient { listAssets( request: protos.google.cloud.securitycenter.v1p1beta1.IListAssetsRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | PaginationCallback< protos.google.cloud.securitycenter.v1p1beta1.IListAssetsRequest, | protos.google.cloud.securitycenter.v1p1beta1.IListAssetsResponse @@ -3476,12 +3480,12 @@ export class SecurityCenterClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -3642,7 +3646,7 @@ export class SecurityCenterClient { */ listAssetsStream( request?: protos.google.cloud.securitycenter.v1p1beta1.IListAssetsRequest, - options?: gax.CallOptions + options?: CallOptions ): Transform { request = request || {}; options = options || {}; @@ -3815,10 +3819,8 @@ export class SecurityCenterClient { */ listAssetsAsync( request?: protos.google.cloud.securitycenter.v1p1beta1.IListAssetsRequest, - options?: gax.CallOptions - ): AsyncIterable< - protos.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.IListAssetsResult - > { + options?: CallOptions + ): AsyncIterable { request = request || {}; options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -3835,13 +3837,11 @@ export class SecurityCenterClient { this.innerApiCalls['listAssets'] as GaxCall, (request as unknown) as RequestType, callSettings - ) as AsyncIterable< - protos.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.IListAssetsResult - >; + ) as AsyncIterable; } listFindings( request: protos.google.cloud.securitycenter.v1p1beta1.IListFindingsRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.IListFindingsResult[], @@ -3851,7 +3851,7 @@ export class SecurityCenterClient { >; listFindings( request: protos.google.cloud.securitycenter.v1p1beta1.IListFindingsRequest, - options: gax.CallOptions, + options: CallOptions, callback: PaginationCallback< protos.google.cloud.securitycenter.v1p1beta1.IListFindingsRequest, | protos.google.cloud.securitycenter.v1p1beta1.IListFindingsResponse @@ -4015,7 +4015,7 @@ export class SecurityCenterClient { listFindings( request: protos.google.cloud.securitycenter.v1p1beta1.IListFindingsRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | PaginationCallback< protos.google.cloud.securitycenter.v1p1beta1.IListFindingsRequest, | protos.google.cloud.securitycenter.v1p1beta1.IListFindingsResponse @@ -4038,12 +4038,12 @@ export class SecurityCenterClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -4196,7 +4196,7 @@ export class SecurityCenterClient { */ listFindingsStream( request?: protos.google.cloud.securitycenter.v1p1beta1.IListFindingsRequest, - options?: gax.CallOptions + options?: CallOptions ): Transform { request = request || {}; options = options || {}; @@ -4361,10 +4361,8 @@ export class SecurityCenterClient { */ listFindingsAsync( request?: protos.google.cloud.securitycenter.v1p1beta1.IListFindingsRequest, - options?: gax.CallOptions - ): AsyncIterable< - protos.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.IListFindingsResult - > { + options?: CallOptions + ): AsyncIterable { request = request || {}; options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -4381,13 +4379,11 @@ export class SecurityCenterClient { this.innerApiCalls['listFindings'] as GaxCall, (request as unknown) as RequestType, callSettings - ) as AsyncIterable< - protos.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.IListFindingsResult - >; + ) as AsyncIterable; } listNotificationConfigs( request: protos.google.cloud.securitycenter.v1p1beta1.IListNotificationConfigsRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.cloud.securitycenter.v1p1beta1.INotificationConfig[], @@ -4397,7 +4393,7 @@ export class SecurityCenterClient { >; listNotificationConfigs( request: protos.google.cloud.securitycenter.v1p1beta1.IListNotificationConfigsRequest, - options: gax.CallOptions, + options: CallOptions, callback: PaginationCallback< protos.google.cloud.securitycenter.v1p1beta1.IListNotificationConfigsRequest, | protos.google.cloud.securitycenter.v1p1beta1.IListNotificationConfigsResponse @@ -4447,7 +4443,7 @@ export class SecurityCenterClient { listNotificationConfigs( request: protos.google.cloud.securitycenter.v1p1beta1.IListNotificationConfigsRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | PaginationCallback< protos.google.cloud.securitycenter.v1p1beta1.IListNotificationConfigsRequest, | protos.google.cloud.securitycenter.v1p1beta1.IListNotificationConfigsResponse @@ -4470,12 +4466,12 @@ export class SecurityCenterClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -4521,7 +4517,7 @@ export class SecurityCenterClient { */ listNotificationConfigsStream( request?: protos.google.cloud.securitycenter.v1p1beta1.IListNotificationConfigsRequest, - options?: gax.CallOptions + options?: CallOptions ): Transform { request = request || {}; options = options || {}; @@ -4575,10 +4571,8 @@ export class SecurityCenterClient { */ listNotificationConfigsAsync( request?: protos.google.cloud.securitycenter.v1p1beta1.IListNotificationConfigsRequest, - options?: gax.CallOptions - ): AsyncIterable< - protos.google.cloud.securitycenter.v1p1beta1.INotificationConfig - > { + options?: CallOptions + ): AsyncIterable { request = request || {}; options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -4595,13 +4589,11 @@ export class SecurityCenterClient { this.innerApiCalls['listNotificationConfigs'] as GaxCall, (request as unknown) as RequestType, callSettings - ) as AsyncIterable< - protos.google.cloud.securitycenter.v1p1beta1.INotificationConfig - >; + ) as AsyncIterable; } listSources( request: protos.google.cloud.securitycenter.v1p1beta1.IListSourcesRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.cloud.securitycenter.v1p1beta1.ISource[], @@ -4611,7 +4603,7 @@ export class SecurityCenterClient { >; listSources( request: protos.google.cloud.securitycenter.v1p1beta1.IListSourcesRequest, - options: gax.CallOptions, + options: CallOptions, callback: PaginationCallback< protos.google.cloud.securitycenter.v1p1beta1.IListSourcesRequest, | protos.google.cloud.securitycenter.v1p1beta1.IListSourcesResponse @@ -4661,7 +4653,7 @@ export class SecurityCenterClient { listSources( request: protos.google.cloud.securitycenter.v1p1beta1.IListSourcesRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | PaginationCallback< protos.google.cloud.securitycenter.v1p1beta1.IListSourcesRequest, | protos.google.cloud.securitycenter.v1p1beta1.IListSourcesResponse @@ -4684,12 +4676,12 @@ export class SecurityCenterClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -4731,7 +4723,7 @@ export class SecurityCenterClient { */ listSourcesStream( request?: protos.google.cloud.securitycenter.v1p1beta1.IListSourcesRequest, - options?: gax.CallOptions + options?: CallOptions ): Transform { request = request || {}; options = options || {}; @@ -4785,7 +4777,7 @@ export class SecurityCenterClient { */ listSourcesAsync( request?: protos.google.cloud.securitycenter.v1p1beta1.IListSourcesRequest, - options?: gax.CallOptions + options?: CallOptions ): AsyncIterable { request = request || {}; options = options || {}; diff --git a/packages/google-cloud-securitycenter/synth.metadata b/packages/google-cloud-securitycenter/synth.metadata index aba6812276f..154561b30bb 100644 --- a/packages/google-cloud-securitycenter/synth.metadata +++ b/packages/google-cloud-securitycenter/synth.metadata @@ -4,15 +4,15 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-security-center.git", - "sha": "344c15b415f72a286a48559f38cc4150697d3531" + "sha": "d8477d26f7ffd65110db0e6c17b2b5a42e16449e" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "8d73f9486fc193a150f6c907dfb9f49431aff3ff", - "internalRef": "332497859" + "sha": "5587028631d4d743fd906c4eb4e4e4649a7ee5ce", + "internalRef": "343187793" } }, { @@ -104,7 +104,6 @@ "README.md", "api-extractor.json", "linkinator.config.json", - "package-lock.json.2716439027", "protos/google/cloud/securitycenter/v1/asset.proto", "protos/google/cloud/securitycenter/v1/finding.proto", "protos/google/cloud/securitycenter/v1/notification_config.proto", @@ -137,7 +136,6 @@ "protos/protos.json", "renovate.json", "samples/README.md", - "samples/package-lock.json.228309027", "src/index.ts", "src/v1/index.ts", "src/v1/security_center_client.ts", From e7aa3d90ab2b9096212c9fb4dbc1d4a810c9c9b7 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Mon, 23 Nov 2020 22:26:03 +0100 Subject: [PATCH 228/342] chore(deps): update dependency webpack to v5 (#341) [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [webpack](https://togithub.com/webpack/webpack) | [`^4.41.2` -> `^5.0.0`](https://renovatebot.com/diffs/npm/webpack/4.44.2/5.6.0) | [![age](https://badges.renovateapi.com/packages/npm/webpack/5.6.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/webpack/5.6.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/webpack/5.6.0/compatibility-slim/4.44.2)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/webpack/5.6.0/confidence-slim/4.44.2)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
webpack/webpack ### [`v5.6.0`](https://togithub.com/webpack/webpack/releases/v5.6.0) [Compare Source](https://togithub.com/webpack/webpack/compare/v5.5.1...v5.6.0) ### Bugfixes - emit warnings/errors for exports in commonjs modules for which we know that they don't exist ### [`v5.5.1`](https://togithub.com/webpack/webpack/releases/v5.5.1) [Compare Source](https://togithub.com/webpack/webpack/compare/v5.5.0...v5.5.1) ### Bugfixes - fix crash when \_\_esModule is defined with defineProperty without value ### [`v5.5.0`](https://togithub.com/webpack/webpack/releases/v5.5.0) [Compare Source](https://togithub.com/webpack/webpack/compare/v5.4.0...v5.5.0) ### Bugfixes - fix ASI issues that occur between concatenated modules - fix incorrect handling of `[id]` and etc. in SourceMap sources - fix side-effect-free handling of exports for concatenated modules that causes an unused export - make ESM-CJS interop handling consistent - make `__esModule` flag consistent exposed - handle non enumerable exports - handle inherited exports - handle exported Promises ### [`v5.4.0`](https://togithub.com/webpack/webpack/releases/v5.4.0) [Compare Source](https://togithub.com/webpack/webpack/compare/v5.3.2...v5.4.0) ### Bugfixes - fix renaming in super class expression in nested scopes - fix parsing and handling of browserlist queries - fix a few edge cases with ESM-CJS interop and .mjs - fix ASI edge cases ### [`v5.3.2`](https://togithub.com/webpack/webpack/releases/v5.3.2) [Compare Source](https://togithub.com/webpack/webpack/compare/v5.3.1...v5.3.2) ### Bugfixes - runtime-dependent concatenated modules can generate code for runtime-dependent execution order of concatenated modules ### [`v5.3.1`](https://togithub.com/webpack/webpack/releases/v5.3.1) [Compare Source](https://togithub.com/webpack/webpack/compare/v5.3.0...v5.3.1) ### Bugfixes - fix incorrect concatenation of modules when multiple runtimes are involved - fixes a "This should not happen" error - fixes a `__webpack_require__(null)` problem - run CLI correctly after installing - fixes a huge performance issue when processing minimized code with SourceMap - Use `string[]` types instead of `[string, ...string[]]` for arrays that must not be empty - this is more convinient to use ### Performance - avoid incorrect store of counts in the ProgressPlugin, which causes unneeded serialization of the Persistent Cache - upgrade terser-webpack-plugin for performance improvements - upgrade webpack-sources for performance improvements ### [`v5.3.0`](https://togithub.com/webpack/webpack/releases/v5.3.0) [Compare Source](https://togithub.com/webpack/webpack/compare/v5.2.1...v5.3.0) ### Features and Bugfixes - generate runtime conditional code when modules are forcefully merged from multiple runtimes - This fixes a `Cannot read property 'call' of undefined` error in webpack runtime, because modules are used that are not in the graph in one runtime - disabled source code analysis for side effects in non-production modes - this causes unnecessary changes to parent modules in development - add `optimization.sideEffects: "flag"` as option for this ### [`v5.2.1`](https://togithub.com/webpack/webpack/releases/v5.2.1) [Compare Source](https://togithub.com/webpack/webpack/compare/v5.2.0...v5.2.1) ##### Bugfixes - add `watchOptions.followSymlinks` option to schema - fix hard crash when calling resolve with undefined value - fix emit problem when files have hash in query string - fix unneeded generation of SourceMaps when no devtool is used - fixes a huge performance regression with terser-webpack-plugin ### [`v5.2.0`](https://togithub.com/webpack/webpack/releases/v5.2.0) [Compare Source](https://togithub.com/webpack/webpack/compare/v5.1.3...v5.2.0) ### Features - add `sourceFilename` and `javascriptModule` to asset info for plugins ### Bugfixes - fix variable name collision when using module concatenation - fix arrow functions in ie 11 - fix `this` externals with module concatenation - force update for enhanced-resolve for critical bugfixes (see [changelog](https://togithub.com/webpack/enhanced-resolve/releases/tag/v5.3.0)) ### [`v5.1.3`](https://togithub.com/webpack/webpack/releases/v5.1.3) [Compare Source](https://togithub.com/webpack/webpack/compare/v5.1.2...v5.1.3) ##### Bugfixes - omit unused modules from chunks when modules are only unused in some runtimes - fixes `Self-reference dependency has unused export name` error - fix order of asset optimization to fix conflict between compression-plugin and real hash plugin ### [`v5.1.2`](https://togithub.com/webpack/webpack/releases/v5.1.2) [Compare Source](https://togithub.com/webpack/webpack/compare/v5.1.1...v5.1.2) ### Bugfixes - revert: omit unused modules from chunk when modules are only unused in some runtimes - caused issues with mini-css modules ### [`v5.1.1`](https://togithub.com/webpack/webpack/releases/v5.1.1) [Compare Source](https://togithub.com/webpack/webpack/compare/v5.1.0...v5.1.1) ### Bugfixes - fix order of chunk hashing to allow to uses hashes in WebWorkers - update to terser-webpack-plugin 5 - reduces number of dependencies by dropping webpack 4 support - omit unused modules from chunk when modules are only unused in some runtimes - fixes `Self-reference dependency has unused export name` error - fix hanging production builds because of infinite loop in inner graph optimization - `Compilation.deleteAsset` updates chunk to file mappings ### [`v5.1.0`](https://togithub.com/webpack/webpack/releases/v5.1.0) [Compare Source](https://togithub.com/webpack/webpack/compare/v5.0.0...v5.1.0) ### Features - expose `webpack` property from `Compiler` - expose `cleverMerge`, `EntryOptionPlugin`, `DynamicEntryPlugin` ### Bugfixes - missing `require("..").xxx` in try-catch produces a warning instead of an error now - handle reexports in concatenated modules correctly when they are side-effect-free - fix incorrect deprecation message for ModuleTemplate.hooks.hash ### [`v5.0.0`](https://togithub.com/webpack/webpack/releases/v5.0.0) [Compare Source](https://togithub.com/webpack/webpack/compare/v4.44.2...v5.0.0) [Announcement and changelog](https://webpack.js.org/blog/2020-10-10-webpack-5-release/)
--- ### Renovate configuration :date: **Schedule**: "after 9am and before 3pm" (UTC). :vertical_traffic_light: **Automerge**: Disabled by config. Please merge this manually once you are satisfied. :recycle: **Rebasing**: Renovate will not automatically rebase this PR, because other commits have been found. :no_bell: **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/nodejs-security-center). --- packages/google-cloud-securitycenter/package.json | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/google-cloud-securitycenter/package.json b/packages/google-cloud-securitycenter/package.json index bef6bce6173..8fe291bcd43 100644 --- a/packages/google-cloud-securitycenter/package.json +++ b/packages/google-cloud-securitycenter/package.json @@ -62,7 +62,6 @@ "sinon": "^9.0.1", "ts-loader": "^8.0.0", "typescript": "^3.8.3", - "webpack": "^4.41.2", "webpack-cli": "^3.3.10", "@microsoft/api-documenter": "^7.8.10", "@microsoft/api-extractor": "^7.8.10" From 2ca7bc469e7fd459698545cc2bbf5364ecb0b412 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Mon, 23 Nov 2020 22:44:06 +0100 Subject: [PATCH 229/342] chore(deps): update dependency webpack-cli to v4 (#342) [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [webpack-cli](https://togithub.com/webpack/webpack-cli) | [`^3.3.10` -> `^4.0.0`](https://renovatebot.com/diffs/npm/webpack-cli/3.3.12/4.2.0) | [![age](https://badges.renovateapi.com/packages/npm/webpack-cli/4.2.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/webpack-cli/4.2.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/webpack-cli/4.2.0/compatibility-slim/3.3.12)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/webpack-cli/4.2.0/confidence-slim/3.3.12)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
webpack/webpack-cli ### [`v4.2.0`](https://togithub.com/webpack/webpack-cli/releases/webpack-cli@4.2.0) [Compare Source](https://togithub.com/webpack/webpack-cli/compare/webpack-cli@4.1.0...webpack-cli@4.2.0) ##### Bug Fixes - \--config-name behaviour for functional configs ([#​2006](https://togithub.com/webpack/webpack-cli/issues/2006)) ([29ecf8d](https://togithub.com/webpack/webpack-cli/commit/29ecf8dbcd1c5c7d75fc7fb1634107697832d952)) - assign cache value for default configs ([#​2013](https://togithub.com/webpack/webpack-cli/issues/2013)) ([d2e3c74](https://togithub.com/webpack/webpack-cli/commit/d2e3c74d32b0141c694259cf4f31e6c48b0f681d)) - callback deprecation ([#​1977](https://togithub.com/webpack/webpack-cli/issues/1977)) ([2cb0c0e](https://togithub.com/webpack/webpack-cli/commit/2cb0c0e383670949ce31231edbfda514f47c3dfc)) - handle core flags for webpack 4 ([#​2023](https://togithub.com/webpack/webpack-cli/issues/2023)) ([ea66a7e](https://togithub.com/webpack/webpack-cli/commit/ea66a7e3ec6eabcc439b96acb21e2a25be2e35e5)) - help and version functionality ([#​1972](https://togithub.com/webpack/webpack-cli/issues/1972)) ([e8010b3](https://togithub.com/webpack/webpack-cli/commit/e8010b3aac695971e542ad4d3584ce534da39b8f)) ##### Features - export utils from core for other packages ([#​2011](https://togithub.com/webpack/webpack-cli/issues/2011)) ([3004549](https://togithub.com/webpack/webpack-cli/commit/3004549c06b3fe00708d8e1eecf42419e0f72f66)) - progress supports string argument ([#​2000](https://togithub.com/webpack/webpack-cli/issues/2000)) ([f13346e](https://togithub.com/webpack/webpack-cli/commit/f13346e6acb46e982a5d20fa1d2ae56fc52523dc)) - suggest the closest match based on the Levenshtein distance algorithm ([#​2010](https://togithub.com/webpack/webpack-cli/issues/2010)) ([491a582](https://togithub.com/webpack/webpack-cli/commit/491a582620b64ed4acbccd04f687adc28a5e4cff)) ### [`v4.1.0`](https://togithub.com/webpack/webpack-cli/releases/webpack-cli@4.1.0) [Compare Source](https://togithub.com/webpack/webpack-cli/compare/webpack-cli@4.0.0...webpack-cli@4.1.0) ##### Bug Fixes - avoid unnecessary stringify ([#​1920](https://togithub.com/webpack/webpack-cli/issues/1920)) ([5ef1e7b](https://togithub.com/webpack/webpack-cli/commit/5ef1e7b074390406b76cb3e25dd90f045e1bd8a2)) - colored output ([#​1944](https://togithub.com/webpack/webpack-cli/issues/1944)) ([2bbbb14](https://togithub.com/webpack/webpack-cli/commit/2bbbb14ca9a404f2205c0f5a5515e73832ee6173)) - move init command to separate package ([#​1950](https://togithub.com/webpack/webpack-cli/issues/1950)) ([92ad475](https://togithub.com/webpack/webpack-cli/commit/92ad475d4b9606b5db7c31dd3666658301c95597)) - output stacktrace on errors ([#​1949](https://togithub.com/webpack/webpack-cli/issues/1949)) ([9ba9d6f](https://togithub.com/webpack/webpack-cli/commit/9ba9d6f460fb25fb79d52f4360239b8c4b471451)) - run CLI after webpack installation ([#​1951](https://togithub.com/webpack/webpack-cli/issues/1951)) ([564279e](https://togithub.com/webpack/webpack-cli/commit/564279e5b634a399647bcdb21449e5e6a7f0637e)) - support any config name ([#​1926](https://togithub.com/webpack/webpack-cli/issues/1926)) ([6f95b26](https://togithub.com/webpack/webpack-cli/commit/6f95b267bf6a3a3e71360f4de176a4ebbec3afa1)) - support array of functions and promises ([#​1946](https://togithub.com/webpack/webpack-cli/issues/1946)) ([2ace39b](https://togithub.com/webpack/webpack-cli/commit/2ace39b06117f558c0d8528cea9248253cbdf593)) - watch mode and options ([#​1931](https://togithub.com/webpack/webpack-cli/issues/1931)) ([258219a](https://togithub.com/webpack/webpack-cli/commit/258219a3bb606b228636e6373a3d20413c1f660e)) ##### Features - allow passing strings in env flag ([#​1939](https://togithub.com/webpack/webpack-cli/issues/1939)) ([cc081a2](https://togithub.com/webpack/webpack-cli/commit/cc081a256181e34137a89d2e9d37b04280b3f180)) ### [`v4.0.0`](https://togithub.com/webpack/webpack-cli/blob/master/CHANGELOG.md#​400-httpsgithubcomwebpackwebpack-clicomparewebpack-cli400-rc1webpack-cli400-2020-10-10) [Compare Source](https://togithub.com/webpack/webpack-cli/compare/v3.3.12...webpack-cli@4.0.0) ##### Bug Fixes - add compilation lifecycle in watch instance ([#​1903](https://togithub.com/webpack/webpack-cli/issues/1903)) ([02b6d21](https://togithub.com/webpack/webpack-cli/commit/02b6d21eaa20166a7ed37816de716b8fc22b756a)) - cleanup `package-utils` package ([#​1822](https://togithub.com/webpack/webpack-cli/issues/1822)) ([fd5b92b](https://togithub.com/webpack/webpack-cli/commit/fd5b92b3cd40361daec5bf4486e455a41f4c9738)) - cli-executer supplies args further up ([#​1904](https://togithub.com/webpack/webpack-cli/issues/1904)) ([097564a](https://togithub.com/webpack/webpack-cli/commit/097564a851b36b63e0a6bf88144997ef65aa057a)) - exit code for validation errors ([59f6303](https://togithub.com/webpack/webpack-cli/commit/59f63037fcbdbb8934b578b9adf5725bc4ae1235)) - exit process in case of schema errors ([71e89b4](https://togithub.com/webpack/webpack-cli/commit/71e89b4092d953ea587cc4f606451ab78cbcdb93)) ##### Features - assign config paths in build dependencies in cache config ([#​1900](https://togithub.com/webpack/webpack-cli/issues/1900)) ([7e90f11](https://togithub.com/webpack/webpack-cli/commit/7e90f110b119f36ef9def4f66cf4e17ccf1438cd))
--- ### Renovate configuration :date: **Schedule**: "after 9am and before 3pm" (UTC). :vertical_traffic_light: **Automerge**: Disabled by config. Please merge this manually once you are satisfied. :recycle: **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. :no_bell: **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/nodejs-security-center). --- packages/google-cloud-securitycenter/package.json | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/google-cloud-securitycenter/package.json b/packages/google-cloud-securitycenter/package.json index 8fe291bcd43..5f0f3c9ef57 100644 --- a/packages/google-cloud-securitycenter/package.json +++ b/packages/google-cloud-securitycenter/package.json @@ -62,7 +62,6 @@ "sinon": "^9.0.1", "ts-loader": "^8.0.0", "typescript": "^3.8.3", - "webpack-cli": "^3.3.10", "@microsoft/api-documenter": "^7.8.10", "@microsoft/api-extractor": "^7.8.10" } From 6181c88ba6f267b246f724f3fa5a3939145499b6 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Wed, 25 Nov 2020 08:36:18 -0800 Subject: [PATCH 230/342] docs: spelling correction for "targetting" (#346) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/663471aa-c039-4d53-b978-92e058276a4e/targets - [ ] To automatically regenerate this PR, check this box. Source-Link: https://github.com/googleapis/synthtool/commit/15013eff642a7e7e855aed5a29e6e83c39beba2a --- .../google-cloud-securitycenter/README.md | 2 +- .../synth.metadata | 110 +----------------- 2 files changed, 3 insertions(+), 109 deletions(-) diff --git a/packages/google-cloud-securitycenter/README.md b/packages/google-cloud-securitycenter/README.md index 8e276bef3b6..ff90027c7d0 100644 --- a/packages/google-cloud-securitycenter/README.md +++ b/packages/google-cloud-securitycenter/README.md @@ -108,7 +108,7 @@ Our client libraries follow the [Node.js release schedule](https://nodejs.org/en Libraries are compatible with all current _active_ and _maintenance_ versions of Node.js. -Client libraries targetting some end-of-life versions of Node.js are available, and +Client libraries targeting some end-of-life versions of Node.js are available, and can be installed via npm [dist-tags](https://docs.npmjs.com/cli/dist-tag). The dist-tags follow the naming convention `legacy-(version)`. diff --git a/packages/google-cloud-securitycenter/synth.metadata b/packages/google-cloud-securitycenter/synth.metadata index 154561b30bb..25bf404b31e 100644 --- a/packages/google-cloud-securitycenter/synth.metadata +++ b/packages/google-cloud-securitycenter/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-security-center.git", - "sha": "d8477d26f7ffd65110db0e6c17b2b5a42e16449e" + "sha": "ff52e9ec1c83b70028cd1c90fc5b50d8e2d2bf6f" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "1f1148d3c7a7a52f0c98077f976bd9b3c948ee2b" + "sha": "15013eff642a7e7e855aed5a29e6e83c39beba2a" } } ], @@ -51,111 +51,5 @@ "generator": "bazel" } } - ], - "generatedFiles": [ - ".eslintignore", - ".eslintrc.json", - ".gitattributes", - ".github/ISSUE_TEMPLATE/bug_report.md", - ".github/ISSUE_TEMPLATE/feature_request.md", - ".github/ISSUE_TEMPLATE/support_request.md", - ".github/PULL_REQUEST_TEMPLATE.md", - ".github/release-please.yml", - ".github/workflows/ci.yaml", - ".gitignore", - ".jsdoc.js", - ".kokoro/.gitattributes", - ".kokoro/common.cfg", - ".kokoro/continuous/node10/common.cfg", - ".kokoro/continuous/node10/docs.cfg", - ".kokoro/continuous/node10/test.cfg", - ".kokoro/continuous/node12/common.cfg", - ".kokoro/continuous/node12/lint.cfg", - ".kokoro/continuous/node12/samples-test.cfg", - ".kokoro/continuous/node12/system-test.cfg", - ".kokoro/continuous/node12/test.cfg", - ".kokoro/docs.sh", - ".kokoro/lint.sh", - ".kokoro/populate-secrets.sh", - ".kokoro/presubmit/node10/common.cfg", - ".kokoro/presubmit/node12/common.cfg", - ".kokoro/presubmit/node12/samples-test.cfg", - ".kokoro/presubmit/node12/system-test.cfg", - ".kokoro/presubmit/node12/test.cfg", - ".kokoro/publish.sh", - ".kokoro/release/docs-devsite.cfg", - ".kokoro/release/docs-devsite.sh", - ".kokoro/release/docs.cfg", - ".kokoro/release/docs.sh", - ".kokoro/release/publish.cfg", - ".kokoro/system-test.sh", - ".kokoro/test.bat", - ".kokoro/test.sh", - ".kokoro/trampoline.sh", - ".kokoro/trampoline_v2.sh", - ".mocharc.js", - ".nycrc", - ".prettierignore", - ".prettierrc.js", - ".trampolinerc", - "CODE_OF_CONDUCT.md", - "CONTRIBUTING.md", - "LICENSE", - "README.md", - "api-extractor.json", - "linkinator.config.json", - "protos/google/cloud/securitycenter/v1/asset.proto", - "protos/google/cloud/securitycenter/v1/finding.proto", - "protos/google/cloud/securitycenter/v1/notification_config.proto", - "protos/google/cloud/securitycenter/v1/notification_message.proto", - "protos/google/cloud/securitycenter/v1/organization_settings.proto", - "protos/google/cloud/securitycenter/v1/resource.proto", - "protos/google/cloud/securitycenter/v1/run_asset_discovery_response.proto", - "protos/google/cloud/securitycenter/v1/security_marks.proto", - "protos/google/cloud/securitycenter/v1/securitycenter_service.proto", - "protos/google/cloud/securitycenter/v1/source.proto", - "protos/google/cloud/securitycenter/v1beta1/asset.proto", - "protos/google/cloud/securitycenter/v1beta1/finding.proto", - "protos/google/cloud/securitycenter/v1beta1/organization_settings.proto", - "protos/google/cloud/securitycenter/v1beta1/run_asset_discovery_response.proto", - "protos/google/cloud/securitycenter/v1beta1/security_marks.proto", - "protos/google/cloud/securitycenter/v1beta1/securitycenter_service.proto", - "protos/google/cloud/securitycenter/v1beta1/source.proto", - "protos/google/cloud/securitycenter/v1p1beta1/asset.proto", - "protos/google/cloud/securitycenter/v1p1beta1/finding.proto", - "protos/google/cloud/securitycenter/v1p1beta1/notification_config.proto", - "protos/google/cloud/securitycenter/v1p1beta1/notification_message.proto", - "protos/google/cloud/securitycenter/v1p1beta1/organization_settings.proto", - "protos/google/cloud/securitycenter/v1p1beta1/resource.proto", - "protos/google/cloud/securitycenter/v1p1beta1/run_asset_discovery_response.proto", - "protos/google/cloud/securitycenter/v1p1beta1/security_marks.proto", - "protos/google/cloud/securitycenter/v1p1beta1/securitycenter_service.proto", - "protos/google/cloud/securitycenter/v1p1beta1/source.proto", - "protos/protos.d.ts", - "protos/protos.js", - "protos/protos.json", - "renovate.json", - "samples/README.md", - "src/index.ts", - "src/v1/index.ts", - "src/v1/security_center_client.ts", - "src/v1/security_center_client_config.json", - "src/v1/security_center_proto_list.json", - "src/v1beta1/index.ts", - "src/v1beta1/security_center_client.ts", - "src/v1beta1/security_center_client_config.json", - "src/v1beta1/security_center_proto_list.json", - "src/v1p1beta1/index.ts", - "src/v1p1beta1/security_center_client.ts", - "src/v1p1beta1/security_center_client_config.json", - "src/v1p1beta1/security_center_proto_list.json", - "system-test/fixtures/sample/src/index.js", - "system-test/fixtures/sample/src/index.ts", - "system-test/install.ts", - "test/gapic_security_center_v1.ts", - "test/gapic_security_center_v1beta1.ts", - "test/gapic_security_center_v1p1beta1.ts", - "tsconfig.json", - "webpack.config.js" ] } \ No newline at end of file From fd46a8256866632d136e2fe5c7658f958c296fba Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 2 Dec 2020 19:42:18 +0000 Subject: [PATCH 231/342] chore: release 5.1.3 (#345) :robot: I have created a release \*beep\* \*boop\* --- ### [5.1.3](https://www.github.com/googleapis/nodejs-security-center/compare/v5.1.2...v5.1.3) (2020-11-25) ### Bug Fixes * check for fetch on window ([#344](https://www.github.com/googleapis/nodejs-security-center/issues/344)) ([85c6d55](https://www.github.com/googleapis/nodejs-security-center/commit/85c6d55fa245fb2508423d2f0ba94f2e1c25c53f)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). --- packages/google-cloud-securitycenter/CHANGELOG.md | 7 +++++++ packages/google-cloud-securitycenter/package.json | 2 +- packages/google-cloud-securitycenter/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-securitycenter/CHANGELOG.md b/packages/google-cloud-securitycenter/CHANGELOG.md index 8219ac9219c..c672c5c8bc2 100644 --- a/packages/google-cloud-securitycenter/CHANGELOG.md +++ b/packages/google-cloud-securitycenter/CHANGELOG.md @@ -4,6 +4,13 @@ [1]: https://www.npmjs.com/package/@google-cloud/security-center?activeTab=versions +### [5.1.3](https://www.github.com/googleapis/nodejs-security-center/compare/v5.1.2...v5.1.3) (2020-11-25) + + +### Bug Fixes + +* check for fetch on window ([#344](https://www.github.com/googleapis/nodejs-security-center/issues/344)) ([85c6d55](https://www.github.com/googleapis/nodejs-security-center/commit/85c6d55fa245fb2508423d2f0ba94f2e1c25c53f)) + ### [5.1.2](https://www.github.com/googleapis/nodejs-security-center/compare/v5.1.1...v5.1.2) (2020-11-07) diff --git a/packages/google-cloud-securitycenter/package.json b/packages/google-cloud-securitycenter/package.json index 5f0f3c9ef57..d19b6c96266 100644 --- a/packages/google-cloud-securitycenter/package.json +++ b/packages/google-cloud-securitycenter/package.json @@ -1,7 +1,7 @@ { "name": "@google-cloud/security-center", "description": "Cloud Security Command Center API client for Node.js", - "version": "5.1.2", + "version": "5.1.3", "license": "Apache-2.0", "author": "Google LLC", "engines": { diff --git a/packages/google-cloud-securitycenter/samples/package.json b/packages/google-cloud-securitycenter/samples/package.json index fb83d35cf58..01566339061 100644 --- a/packages/google-cloud-securitycenter/samples/package.json +++ b/packages/google-cloud-securitycenter/samples/package.json @@ -14,7 +14,7 @@ "license": "Apache-2.0", "dependencies": { "@google-cloud/pubsub": "^2.0.0", - "@google-cloud/security-center": "^5.1.2" + "@google-cloud/security-center": "^5.1.3" }, "devDependencies": { "chai": "^4.2.0", From 79a8a25487a6b0fc4f1e3e879b948ed212a36c5c Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Fri, 4 Dec 2020 08:58:30 -0800 Subject: [PATCH 232/342] chore: generate GAPIC metadata JSON file (#347) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/1375dc8f-6e92-47e5-b704-19ee285b9aaf/targets - [ ] To automatically regenerate this PR, check this box. PiperOrigin-RevId: 345596855 Source-Link: https://github.com/googleapis/googleapis/commit/d189e871205fea665a9648f7c4676f027495ccaf --- .../src/v1/gapic_metadata.json | 277 ++++++++++++++++++ .../src/v1beta1/gapic_metadata.json | 223 ++++++++++++++ .../src/v1p1beta1/gapic_metadata.json | 277 ++++++++++++++++++ .../synth.metadata | 6 +- 4 files changed, 780 insertions(+), 3 deletions(-) create mode 100644 packages/google-cloud-securitycenter/src/v1/gapic_metadata.json create mode 100644 packages/google-cloud-securitycenter/src/v1beta1/gapic_metadata.json create mode 100644 packages/google-cloud-securitycenter/src/v1p1beta1/gapic_metadata.json diff --git a/packages/google-cloud-securitycenter/src/v1/gapic_metadata.json b/packages/google-cloud-securitycenter/src/v1/gapic_metadata.json new file mode 100644 index 00000000000..3280f72a8ff --- /dev/null +++ b/packages/google-cloud-securitycenter/src/v1/gapic_metadata.json @@ -0,0 +1,277 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "typescript", + "protoPackage": "google.cloud.securitycenter.v1", + "libraryPackage": "@google-cloud/security-center", + "services": { + "SecurityCenter": { + "clients": { + "grpc": { + "libraryClient": "SecurityCenterClient", + "rpcs": { + "CreateSource": { + "methods": [ + "createSource" + ] + }, + "CreateFinding": { + "methods": [ + "createFinding" + ] + }, + "CreateNotificationConfig": { + "methods": [ + "createNotificationConfig" + ] + }, + "DeleteNotificationConfig": { + "methods": [ + "deleteNotificationConfig" + ] + }, + "GetIamPolicy": { + "methods": [ + "getIamPolicy" + ] + }, + "GetNotificationConfig": { + "methods": [ + "getNotificationConfig" + ] + }, + "GetOrganizationSettings": { + "methods": [ + "getOrganizationSettings" + ] + }, + "GetSource": { + "methods": [ + "getSource" + ] + }, + "SetFindingState": { + "methods": [ + "setFindingState" + ] + }, + "SetIamPolicy": { + "methods": [ + "setIamPolicy" + ] + }, + "TestIamPermissions": { + "methods": [ + "testIamPermissions" + ] + }, + "UpdateFinding": { + "methods": [ + "updateFinding" + ] + }, + "UpdateNotificationConfig": { + "methods": [ + "updateNotificationConfig" + ] + }, + "UpdateOrganizationSettings": { + "methods": [ + "updateOrganizationSettings" + ] + }, + "UpdateSource": { + "methods": [ + "updateSource" + ] + }, + "UpdateSecurityMarks": { + "methods": [ + "updateSecurityMarks" + ] + }, + "RunAssetDiscovery": { + "methods": [ + "runAssetDiscovery" + ] + }, + "GroupAssets": { + "methods": [ + "groupAssets", + "groupAssetsStream", + "groupAssetsAsync" + ] + }, + "GroupFindings": { + "methods": [ + "groupFindings", + "groupFindingsStream", + "groupFindingsAsync" + ] + }, + "ListAssets": { + "methods": [ + "listAssets", + "listAssetsStream", + "listAssetsAsync" + ] + }, + "ListFindings": { + "methods": [ + "listFindings", + "listFindingsStream", + "listFindingsAsync" + ] + }, + "ListNotificationConfigs": { + "methods": [ + "listNotificationConfigs", + "listNotificationConfigsStream", + "listNotificationConfigsAsync" + ] + }, + "ListSources": { + "methods": [ + "listSources", + "listSourcesStream", + "listSourcesAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "SecurityCenterClient", + "rpcs": { + "CreateSource": { + "methods": [ + "createSource" + ] + }, + "CreateFinding": { + "methods": [ + "createFinding" + ] + }, + "CreateNotificationConfig": { + "methods": [ + "createNotificationConfig" + ] + }, + "DeleteNotificationConfig": { + "methods": [ + "deleteNotificationConfig" + ] + }, + "GetIamPolicy": { + "methods": [ + "getIamPolicy" + ] + }, + "GetNotificationConfig": { + "methods": [ + "getNotificationConfig" + ] + }, + "GetOrganizationSettings": { + "methods": [ + "getOrganizationSettings" + ] + }, + "GetSource": { + "methods": [ + "getSource" + ] + }, + "SetFindingState": { + "methods": [ + "setFindingState" + ] + }, + "SetIamPolicy": { + "methods": [ + "setIamPolicy" + ] + }, + "TestIamPermissions": { + "methods": [ + "testIamPermissions" + ] + }, + "UpdateFinding": { + "methods": [ + "updateFinding" + ] + }, + "UpdateNotificationConfig": { + "methods": [ + "updateNotificationConfig" + ] + }, + "UpdateOrganizationSettings": { + "methods": [ + "updateOrganizationSettings" + ] + }, + "UpdateSource": { + "methods": [ + "updateSource" + ] + }, + "UpdateSecurityMarks": { + "methods": [ + "updateSecurityMarks" + ] + }, + "RunAssetDiscovery": { + "methods": [ + "runAssetDiscovery" + ] + }, + "GroupAssets": { + "methods": [ + "groupAssets", + "groupAssetsStream", + "groupAssetsAsync" + ] + }, + "GroupFindings": { + "methods": [ + "groupFindings", + "groupFindingsStream", + "groupFindingsAsync" + ] + }, + "ListAssets": { + "methods": [ + "listAssets", + "listAssetsStream", + "listAssetsAsync" + ] + }, + "ListFindings": { + "methods": [ + "listFindings", + "listFindingsStream", + "listFindingsAsync" + ] + }, + "ListNotificationConfigs": { + "methods": [ + "listNotificationConfigs", + "listNotificationConfigsStream", + "listNotificationConfigsAsync" + ] + }, + "ListSources": { + "methods": [ + "listSources", + "listSourcesStream", + "listSourcesAsync" + ] + } + } + } + } + } + } +} diff --git a/packages/google-cloud-securitycenter/src/v1beta1/gapic_metadata.json b/packages/google-cloud-securitycenter/src/v1beta1/gapic_metadata.json new file mode 100644 index 00000000000..02da4303dc4 --- /dev/null +++ b/packages/google-cloud-securitycenter/src/v1beta1/gapic_metadata.json @@ -0,0 +1,223 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "typescript", + "protoPackage": "google.cloud.securitycenter.v1beta1", + "libraryPackage": "@google-cloud/security-center", + "services": { + "SecurityCenter": { + "clients": { + "grpc": { + "libraryClient": "SecurityCenterClient", + "rpcs": { + "CreateSource": { + "methods": [ + "createSource" + ] + }, + "CreateFinding": { + "methods": [ + "createFinding" + ] + }, + "GetIamPolicy": { + "methods": [ + "getIamPolicy" + ] + }, + "GetOrganizationSettings": { + "methods": [ + "getOrganizationSettings" + ] + }, + "GetSource": { + "methods": [ + "getSource" + ] + }, + "SetFindingState": { + "methods": [ + "setFindingState" + ] + }, + "SetIamPolicy": { + "methods": [ + "setIamPolicy" + ] + }, + "TestIamPermissions": { + "methods": [ + "testIamPermissions" + ] + }, + "UpdateFinding": { + "methods": [ + "updateFinding" + ] + }, + "UpdateOrganizationSettings": { + "methods": [ + "updateOrganizationSettings" + ] + }, + "UpdateSource": { + "methods": [ + "updateSource" + ] + }, + "UpdateSecurityMarks": { + "methods": [ + "updateSecurityMarks" + ] + }, + "RunAssetDiscovery": { + "methods": [ + "runAssetDiscovery" + ] + }, + "GroupAssets": { + "methods": [ + "groupAssets", + "groupAssetsStream", + "groupAssetsAsync" + ] + }, + "GroupFindings": { + "methods": [ + "groupFindings", + "groupFindingsStream", + "groupFindingsAsync" + ] + }, + "ListAssets": { + "methods": [ + "listAssets", + "listAssetsStream", + "listAssetsAsync" + ] + }, + "ListFindings": { + "methods": [ + "listFindings", + "listFindingsStream", + "listFindingsAsync" + ] + }, + "ListSources": { + "methods": [ + "listSources", + "listSourcesStream", + "listSourcesAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "SecurityCenterClient", + "rpcs": { + "CreateSource": { + "methods": [ + "createSource" + ] + }, + "CreateFinding": { + "methods": [ + "createFinding" + ] + }, + "GetIamPolicy": { + "methods": [ + "getIamPolicy" + ] + }, + "GetOrganizationSettings": { + "methods": [ + "getOrganizationSettings" + ] + }, + "GetSource": { + "methods": [ + "getSource" + ] + }, + "SetFindingState": { + "methods": [ + "setFindingState" + ] + }, + "SetIamPolicy": { + "methods": [ + "setIamPolicy" + ] + }, + "TestIamPermissions": { + "methods": [ + "testIamPermissions" + ] + }, + "UpdateFinding": { + "methods": [ + "updateFinding" + ] + }, + "UpdateOrganizationSettings": { + "methods": [ + "updateOrganizationSettings" + ] + }, + "UpdateSource": { + "methods": [ + "updateSource" + ] + }, + "UpdateSecurityMarks": { + "methods": [ + "updateSecurityMarks" + ] + }, + "RunAssetDiscovery": { + "methods": [ + "runAssetDiscovery" + ] + }, + "GroupAssets": { + "methods": [ + "groupAssets", + "groupAssetsStream", + "groupAssetsAsync" + ] + }, + "GroupFindings": { + "methods": [ + "groupFindings", + "groupFindingsStream", + "groupFindingsAsync" + ] + }, + "ListAssets": { + "methods": [ + "listAssets", + "listAssetsStream", + "listAssetsAsync" + ] + }, + "ListFindings": { + "methods": [ + "listFindings", + "listFindingsStream", + "listFindingsAsync" + ] + }, + "ListSources": { + "methods": [ + "listSources", + "listSourcesStream", + "listSourcesAsync" + ] + } + } + } + } + } + } +} diff --git a/packages/google-cloud-securitycenter/src/v1p1beta1/gapic_metadata.json b/packages/google-cloud-securitycenter/src/v1p1beta1/gapic_metadata.json new file mode 100644 index 00000000000..c0d8ccc6990 --- /dev/null +++ b/packages/google-cloud-securitycenter/src/v1p1beta1/gapic_metadata.json @@ -0,0 +1,277 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "typescript", + "protoPackage": "google.cloud.securitycenter.v1p1beta1", + "libraryPackage": "@google-cloud/security-center", + "services": { + "SecurityCenter": { + "clients": { + "grpc": { + "libraryClient": "SecurityCenterClient", + "rpcs": { + "CreateSource": { + "methods": [ + "createSource" + ] + }, + "CreateFinding": { + "methods": [ + "createFinding" + ] + }, + "CreateNotificationConfig": { + "methods": [ + "createNotificationConfig" + ] + }, + "DeleteNotificationConfig": { + "methods": [ + "deleteNotificationConfig" + ] + }, + "GetIamPolicy": { + "methods": [ + "getIamPolicy" + ] + }, + "GetNotificationConfig": { + "methods": [ + "getNotificationConfig" + ] + }, + "GetOrganizationSettings": { + "methods": [ + "getOrganizationSettings" + ] + }, + "GetSource": { + "methods": [ + "getSource" + ] + }, + "SetFindingState": { + "methods": [ + "setFindingState" + ] + }, + "SetIamPolicy": { + "methods": [ + "setIamPolicy" + ] + }, + "TestIamPermissions": { + "methods": [ + "testIamPermissions" + ] + }, + "UpdateFinding": { + "methods": [ + "updateFinding" + ] + }, + "UpdateNotificationConfig": { + "methods": [ + "updateNotificationConfig" + ] + }, + "UpdateOrganizationSettings": { + "methods": [ + "updateOrganizationSettings" + ] + }, + "UpdateSource": { + "methods": [ + "updateSource" + ] + }, + "UpdateSecurityMarks": { + "methods": [ + "updateSecurityMarks" + ] + }, + "RunAssetDiscovery": { + "methods": [ + "runAssetDiscovery" + ] + }, + "GroupAssets": { + "methods": [ + "groupAssets", + "groupAssetsStream", + "groupAssetsAsync" + ] + }, + "GroupFindings": { + "methods": [ + "groupFindings", + "groupFindingsStream", + "groupFindingsAsync" + ] + }, + "ListAssets": { + "methods": [ + "listAssets", + "listAssetsStream", + "listAssetsAsync" + ] + }, + "ListFindings": { + "methods": [ + "listFindings", + "listFindingsStream", + "listFindingsAsync" + ] + }, + "ListNotificationConfigs": { + "methods": [ + "listNotificationConfigs", + "listNotificationConfigsStream", + "listNotificationConfigsAsync" + ] + }, + "ListSources": { + "methods": [ + "listSources", + "listSourcesStream", + "listSourcesAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "SecurityCenterClient", + "rpcs": { + "CreateSource": { + "methods": [ + "createSource" + ] + }, + "CreateFinding": { + "methods": [ + "createFinding" + ] + }, + "CreateNotificationConfig": { + "methods": [ + "createNotificationConfig" + ] + }, + "DeleteNotificationConfig": { + "methods": [ + "deleteNotificationConfig" + ] + }, + "GetIamPolicy": { + "methods": [ + "getIamPolicy" + ] + }, + "GetNotificationConfig": { + "methods": [ + "getNotificationConfig" + ] + }, + "GetOrganizationSettings": { + "methods": [ + "getOrganizationSettings" + ] + }, + "GetSource": { + "methods": [ + "getSource" + ] + }, + "SetFindingState": { + "methods": [ + "setFindingState" + ] + }, + "SetIamPolicy": { + "methods": [ + "setIamPolicy" + ] + }, + "TestIamPermissions": { + "methods": [ + "testIamPermissions" + ] + }, + "UpdateFinding": { + "methods": [ + "updateFinding" + ] + }, + "UpdateNotificationConfig": { + "methods": [ + "updateNotificationConfig" + ] + }, + "UpdateOrganizationSettings": { + "methods": [ + "updateOrganizationSettings" + ] + }, + "UpdateSource": { + "methods": [ + "updateSource" + ] + }, + "UpdateSecurityMarks": { + "methods": [ + "updateSecurityMarks" + ] + }, + "RunAssetDiscovery": { + "methods": [ + "runAssetDiscovery" + ] + }, + "GroupAssets": { + "methods": [ + "groupAssets", + "groupAssetsStream", + "groupAssetsAsync" + ] + }, + "GroupFindings": { + "methods": [ + "groupFindings", + "groupFindingsStream", + "groupFindingsAsync" + ] + }, + "ListAssets": { + "methods": [ + "listAssets", + "listAssetsStream", + "listAssetsAsync" + ] + }, + "ListFindings": { + "methods": [ + "listFindings", + "listFindingsStream", + "listFindingsAsync" + ] + }, + "ListNotificationConfigs": { + "methods": [ + "listNotificationConfigs", + "listNotificationConfigsStream", + "listNotificationConfigsAsync" + ] + }, + "ListSources": { + "methods": [ + "listSources", + "listSourcesStream", + "listSourcesAsync" + ] + } + } + } + } + } + } +} diff --git a/packages/google-cloud-securitycenter/synth.metadata b/packages/google-cloud-securitycenter/synth.metadata index 25bf404b31e..f8c9802a8bb 100644 --- a/packages/google-cloud-securitycenter/synth.metadata +++ b/packages/google-cloud-securitycenter/synth.metadata @@ -4,15 +4,15 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-security-center.git", - "sha": "ff52e9ec1c83b70028cd1c90fc5b50d8e2d2bf6f" + "sha": "f0e8525fb86f0e2e3405319a8c41d37dbc731b62" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "5587028631d4d743fd906c4eb4e4e4649a7ee5ce", - "internalRef": "343187793" + "sha": "d189e871205fea665a9648f7c4676f027495ccaf", + "internalRef": "345596855" } }, { From 099cfd73f5c284c7b6414f5058791b6cc6fb502e Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Mon, 21 Dec 2020 12:15:25 -0800 Subject: [PATCH 233/342] feat: added field severity to findings in v1 API (#349) Clients will now see a new field, severity, on findings. They will also be able to filter and group by severity on ListFinding and GroupFinding API calls. PiperOrigin-RevId: 347410691 Source-Author: Google APIs Source-Date: Mon Dec 14 10:08:23 2020 -0800 Source-Repo: googleapis/googleapis Source-Sha: e9135d3cb8a99f77ee2ba3318ebc2c9b807581d0 Source-Link: https://github.com/googleapis/googleapis/commit/e9135d3cb8a99f77ee2ba3318ebc2c9b807581d0 --- .../cloud/securitycenter/v1/finding.proto | 63 +++++++ .../v1/notification_config.proto | 10 +- .../v1/securitycenter_service.proto | 131 ++++++-------- .../protos/protos.d.ts | 15 ++ .../protos/protos.js | 70 ++++++++ .../protos/protos.json | 28 ++- .../src/v1/security_center_client.ts | 163 ++++++++++-------- .../synth.metadata | 6 +- 8 files changed, 319 insertions(+), 167 deletions(-) diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/finding.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/finding.proto index cf0873cfc82..dcc62f8b9c6 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/finding.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/finding.proto @@ -56,6 +56,65 @@ message Finding { INACTIVE = 2; } + // The severity of the finding. + enum Severity { + // This value is used for findings when a source doesn't write a severity + // value. + SEVERITY_UNSPECIFIED = 0; + + // Vulnerability: + // A critical vulnerability is easily discoverable by an external actor, + // exploitable, and results in the direct ability to execute arbitrary code, + // exfiltrate data, and otherwise gain additional access and privileges to + // cloud resources and workloads. Examples include publicly accessible + // unprotected user data, public SSH access with weak or no passwords, etc. + // + // Threat: + // Indicates a threat that is able to access, modify, or delete data or + // execute unauthorized code within existing resources. + CRITICAL = 1; + + // Vulnerability: + // A high risk vulnerability can be easily discovered and exploited in + // combination with other vulnerabilities in order to gain direct access and + // the ability to execute arbitrary code, exfiltrate data, and otherwise + // gain additional access and privileges to cloud resources and workloads. + // An example is a database with weak or no passwords that is only + // accessible internally. This database could easily be compromised by an + // actor that had access to the internal network. + // + // Threat: + // Indicates a threat that is able to create new computational resources in + // an environment but not able to access data or execute code in existing + // resources. + HIGH = 2; + + // Vulnerability: + // A medium risk vulnerability could be used by an actor to gain access to + // resources or privileges that enable them to eventually (through multiple + // steps or a complex exploit) gain access and the ability to execute + // arbitrary code or exfiltrate data. An example is a service account with + // access to more projects than it should have. If an actor gains access to + // the service account, they could potentially use that access to manipulate + // a project the service account was not intended to. + // + // Threat: + // Indicates a threat that is able to cause operational impact but may not + // access data or execute unauthorized code. + MEDIUM = 3; + + // Vulnerability: + // A low risk vulnerability hampers a security organization’s ability to + // detect vulnerabilities or active threats in their deployment, or prevents + // the root cause investigation of security issues. An example is monitoring + // and logs being disabled for resource configurations and access. + // + // Threat: + // Indicates a threat that has obtained minimal access to an environment but + // is not able to access data, execute code, or create resources. + LOW = 4; + } + // The relative resource name of this finding. See: // https://cloud.google.com/apis/design/resource_names#relative_resource_name // Example: @@ -110,4 +169,8 @@ message Finding { // The time at which the finding was created in Security Command Center. google.protobuf.Timestamp create_time = 10; + + // The severity of the finding. This field is managed by the source that + // writes the finding. + Severity severity = 12; } diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/notification_config.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/notification_config.proto index 90bd83c3a93..1a9676d9d67 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/notification_config.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/notification_config.proto @@ -78,14 +78,14 @@ message NotificationConfig { // The description of the notification config (max of 1024 characters). string description = 2; - // The PubSub topic to send notifications to. Its format is + // The Pub/Sub topic to send notifications to. Its format is // "projects/[project_id]/topics/[topic]". - string pubsub_topic = 3 [ - (google.api.resource_reference) = { type: "pubsub.googleapis.com/Topic" } - ]; + string pubsub_topic = 3 [(google.api.resource_reference) = { + type: "pubsub.googleapis.com/Topic" + }]; // Output only. The service account that needs "pubsub.topics.publish" - // permission to publish to the PubSub topic. + // permission to publish to the Pub/Sub topic. string service_account = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; // The config for triggering notifications. diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/securitycenter_service.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/securitycenter_service.proto index b660d4674fc..07f2f99d630 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/securitycenter_service.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/securitycenter_service.proto @@ -17,7 +17,6 @@ syntax = "proto3"; package google.cloud.securitycenter.v1; import public "google/cloud/securitycenter/v1/run_asset_discovery_response.proto"; - import "google/api/annotations.proto"; import "google/api/client.proto"; import "google/api/field_behavior.proto"; @@ -47,8 +46,7 @@ option ruby_package = "Google::Cloud::SecurityCenter::V1"; // V1 APIs for Security Center service. service SecurityCenter { option (google.api.default_host) = "securitycenter.googleapis.com"; - option (google.api.oauth_scopes) = - "https://www.googleapis.com/auth/cloud-platform"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; // Creates a source. rpc CreateSource(CreateSourceRequest) returns (Source) { @@ -70,20 +68,17 @@ service SecurityCenter { } // Creates a notification config. - rpc CreateNotificationConfig(CreateNotificationConfigRequest) - returns (NotificationConfig) { + rpc CreateNotificationConfig(CreateNotificationConfigRequest) returns (NotificationConfig) { option (google.api.http) = { post: "/v1/{parent=organizations/*}/notificationConfigs" body: "notification_config" }; - option (google.api.method_signature) = - "parent,config_id,notification_config"; + option (google.api.method_signature) = "parent,config_id,notification_config"; option (google.api.method_signature) = "parent,notification_config"; } // Deletes a notification config. - rpc DeleteNotificationConfig(DeleteNotificationConfigRequest) - returns (google.protobuf.Empty) { + rpc DeleteNotificationConfig(DeleteNotificationConfigRequest) returns (google.protobuf.Empty) { option (google.api.http) = { delete: "/v1/{name=organizations/*/notificationConfigs/*}" }; @@ -91,8 +86,7 @@ service SecurityCenter { } // Gets the access control policy on the specified Source. - rpc GetIamPolicy(google.iam.v1.GetIamPolicyRequest) - returns (google.iam.v1.Policy) { + rpc GetIamPolicy(google.iam.v1.GetIamPolicyRequest) returns (google.iam.v1.Policy) { option (google.api.http) = { post: "/v1/{resource=organizations/*/sources/*}:getIamPolicy" body: "*" @@ -101,8 +95,7 @@ service SecurityCenter { } // Gets a notification config. - rpc GetNotificationConfig(GetNotificationConfigRequest) - returns (NotificationConfig) { + rpc GetNotificationConfig(GetNotificationConfigRequest) returns (NotificationConfig) { option (google.api.http) = { get: "/v1/{name=organizations/*/notificationConfigs/*}" }; @@ -110,8 +103,7 @@ service SecurityCenter { } // Gets the settings for an organization. - rpc GetOrganizationSettings(GetOrganizationSettingsRequest) - returns (OrganizationSettings) { + rpc GetOrganizationSettings(GetOrganizationSettingsRequest) returns (OrganizationSettings) { option (google.api.http) = { get: "/v1/{name=organizations/*/organizationSettings}" }; @@ -166,8 +158,7 @@ service SecurityCenter { } // Lists notification configs. - rpc ListNotificationConfigs(ListNotificationConfigsRequest) - returns (ListNotificationConfigsResponse) { + rpc ListNotificationConfigs(ListNotificationConfigsRequest) returns (ListNotificationConfigsResponse) { option (google.api.http) = { get: "/v1/{parent=organizations/*}/notificationConfigs" }; @@ -188,8 +179,7 @@ service SecurityCenter { // This API can only be called with limited frequency for an organization. If // it is called too frequently the caller will receive a TOO_MANY_REQUESTS // error. - rpc RunAssetDiscovery(RunAssetDiscoveryRequest) - returns (google.longrunning.Operation) { + rpc RunAssetDiscovery(RunAssetDiscoveryRequest) returns (google.longrunning.Operation) { option (google.api.http) = { post: "/v1/{parent=organizations/*}/assets:runDiscovery" body: "*" @@ -211,8 +201,7 @@ service SecurityCenter { } // Sets the access control policy on the specified Source. - rpc SetIamPolicy(google.iam.v1.SetIamPolicyRequest) - returns (google.iam.v1.Policy) { + rpc SetIamPolicy(google.iam.v1.SetIamPolicyRequest) returns (google.iam.v1.Policy) { option (google.api.http) = { post: "/v1/{resource=organizations/*/sources/*}:setIamPolicy" body: "*" @@ -221,8 +210,7 @@ service SecurityCenter { } // Returns the permissions that a caller has on the specified source. - rpc TestIamPermissions(google.iam.v1.TestIamPermissionsRequest) - returns (google.iam.v1.TestIamPermissionsResponse) { + rpc TestIamPermissions(google.iam.v1.TestIamPermissionsRequest) returns (google.iam.v1.TestIamPermissionsResponse) { option (google.api.http) = { post: "/v1/{resource=organizations/*/sources/*}:testIamPermissions" body: "*" @@ -242,8 +230,7 @@ service SecurityCenter { // Updates a notification config. The following update // fields are allowed: description, pubsub_topic, streaming_config.filter - rpc UpdateNotificationConfig(UpdateNotificationConfigRequest) - returns (NotificationConfig) { + rpc UpdateNotificationConfig(UpdateNotificationConfigRequest) returns (NotificationConfig) { option (google.api.http) = { patch: "/v1/{notification_config.name=organizations/*/notificationConfigs/*}" body: "notification_config" @@ -253,8 +240,7 @@ service SecurityCenter { } // Updates an organization's settings. - rpc UpdateOrganizationSettings(UpdateOrganizationSettingsRequest) - returns (OrganizationSettings) { + rpc UpdateOrganizationSettings(UpdateOrganizationSettingsRequest) returns (OrganizationSettings) { option (google.api.http) = { patch: "/v1/{organization_settings.name=organizations/*/organizationSettings}" body: "organization_settings" @@ -301,15 +287,15 @@ message CreateFindingRequest { // greater than 0 characters in length. string finding_id = 2 [(google.api.field_behavior) = REQUIRED]; - // Required. The Finding being created. The name and security_marks will be - // ignored as they are both output only fields on this resource. + // Required. The Finding being created. The name and security_marks will be ignored as + // they are both output only fields on this resource. Finding finding = 3 [(google.api.field_behavior) = REQUIRED]; } // Request message for creating a notification config. message CreateNotificationConfigRequest { - // Required. Resource name of the new notification config's parent. Its format - // is "organizations/[organization_id]". + // Required. Resource name of the new notification config's parent. Its format is + // "organizations/[organization_id]". string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -323,11 +309,9 @@ message CreateNotificationConfigRequest { // characters, underscores or hyphens only. string config_id = 2 [(google.api.field_behavior) = REQUIRED]; - // Required. The notification config being created. The name and the service - // account will be ignored as they are both output only fields on this - // resource. - NotificationConfig notification_config = 3 - [(google.api.field_behavior) = REQUIRED]; + // Required. The notification config being created. The name and the service account + // will be ignored as they are both output only fields on this resource. + NotificationConfig notification_config = 3 [(google.api.field_behavior) = REQUIRED]; } // Request message for creating a source. @@ -341,8 +325,8 @@ message CreateSourceRequest { } ]; - // Required. The Source being created, only the display_name and description - // will be used. All other fields will be ignored. + // Required. The Source being created, only the display_name and description will be + // used. All other fields will be ignored. Source source = 2 [(google.api.field_behavior) = REQUIRED]; } @@ -372,8 +356,8 @@ message GetNotificationConfigRequest { // Request message for getting organization settings. message GetOrganizationSettingsRequest { - // Required. Name of the organization to get organization settings for. Its - // format is "organizations/[organization_id]/organizationSettings". + // Required. Name of the organization to get organization settings for. Its format is + // "organizations/[organization_id]/organizationSettings". string name = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -463,15 +447,15 @@ message GroupAssetsRequest { // For example, `resource_properties.size = 100` is a valid filter string. // // Use a partial match on the empty string to filter based on a property - // existing:`resource_properties.my_property : ""` + // existing: `resource_properties.my_property : ""` // // Use a negated partial match on the empty string to filter based on a // property not existing: `-resource_properties.my_property : ""` string filter = 2; - // Required. Expression that defines what assets fields to use for grouping. - // The string value should follow SQL syntax: comma separated list of fields. - // For example: + // Required. Expression that defines what assets fields to use for grouping. The string + // value should follow SQL syntax: comma separated list of fields. For + // example: // "security_center_properties.resource_project,security_center_properties.project". // // The following fields are supported when compare_duration is not set: @@ -598,6 +582,7 @@ message GroupFindingsRequest { // * category: `=`, `:` // * external_uri: `=`, `:` // * event_time: `=`, `>`, `<`, `>=`, `<=` + // * severity: `=`, `:` // // Usage: This should be milliseconds since epoch or an RFC3339 string. // Examples: @@ -616,9 +601,9 @@ message GroupFindingsRequest { // property not existing: `-source_properties.my_property : ""` string filter = 2; - // Required. Expression that defines what assets fields to use for grouping - // (including `state_change`). The string value should follow SQL syntax: - // comma separated list of fields. For example: "parent,resource_name". + // Required. Expression that defines what assets fields to use for grouping (including + // `state_change`). The string value should follow SQL syntax: comma separated + // list of fields. For example: "parent,resource_name". // // The following fields are supported: // @@ -626,6 +611,7 @@ message GroupFindingsRequest { // * category // * state // * parent + // * severity // // The following fields are supported when compare_duration is set: // @@ -901,10 +887,10 @@ message ListAssetsRequest { // read_time. google.protobuf.Duration compare_duration = 5; - // Optional. A field mask to specify the ListAssetsResult fields to be listed - // in the response. An empty field mask will list all fields. - google.protobuf.FieldMask field_mask = 7 - [(google.api.field_behavior) = OPTIONAL]; + // A field mask to specify the ListAssetsResult fields to be listed in the + // response. + // An empty field mask will list all fields. + google.protobuf.FieldMask field_mask = 7; // The value returned by the last `ListAssetsResponse`; indicates // that this is a continuation of a prior `ListAssets` call, and @@ -1000,13 +986,14 @@ message ListFindingsRequest { // // The following field and operator combinations are supported: // - // name: `=` - // parent: `=`, `:` - // resource_name: `=`, `:` - // state: `=`, `:` - // category: `=`, `:` - // external_uri: `=`, `:` - // event_time: `=`, `>`, `<`, `>=`, `<=` + // * name: `=` + // * parent: `=`, `:` + // * resource_name: `=`, `:` + // * state: `=`, `:` + // * category: `=`, `:` + // * external_uri: `=`, `:` + // * event_time: `=`, `>`, `<`, `>=`, `<=` + // * severity: `=`, `:` // // Usage: This should be milliseconds since epoch or an RFC3339 string. // Examples: @@ -1083,10 +1070,9 @@ message ListFindingsRequest { // read_time. google.protobuf.Duration compare_duration = 5; - // Optional. A field mask to specify the Finding fields to be listed in the - // response. An empty field mask will list all fields. - google.protobuf.FieldMask field_mask = 7 - [(google.api.field_behavior) = OPTIONAL]; + // A field mask to specify the Finding fields to be listed in the response. + // An empty field mask will list all fields. + google.protobuf.FieldMask field_mask = 7; // The value returned by the last `ListFindingsResponse`; indicates // that this is a continuation of a prior `ListFindings` call, and @@ -1157,7 +1143,7 @@ message ListFindingsResponse { StateChange state_change = 2; // Output only. Resource that is associated with this finding. - Resource resource = 3; + Resource resource = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; } // Findings matching the list request. @@ -1191,14 +1177,13 @@ message SetFindingStateRequest { Finding.State state = 2 [(google.api.field_behavior) = REQUIRED]; // Required. The time at which the updated state takes effect. - google.protobuf.Timestamp start_time = 3 - [(google.api.field_behavior) = REQUIRED]; + google.protobuf.Timestamp start_time = 3 [(google.api.field_behavior) = REQUIRED]; } // Request message for running asset discovery for an organization. message RunAssetDiscoveryRequest { - // Required. Name of the organization to run asset discovery for. Its format - // is "organizations/[organization_id]". + // Required. Name of the organization to run asset discovery for. Its format is + // "organizations/[organization_id]". string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -1209,8 +1194,8 @@ message RunAssetDiscoveryRequest { // Request message for updating or creating a finding. message UpdateFindingRequest { - // Required. The finding resource to update or create if it does not already - // exist. parent, security_marks, and update_time will be ignored. + // Required. The finding resource to update or create if it does not already exist. + // parent, security_marks, and update_time will be ignored. // // In the case of creation, the finding id portion of the name must be // alphanumeric and less than or equal to 32 characters and greater than 0 @@ -1230,8 +1215,7 @@ message UpdateFindingRequest { // Request message for updating a notification config. message UpdateNotificationConfigRequest { // Required. The notification config to update. - NotificationConfig notification_config = 1 - [(google.api.field_behavior) = REQUIRED]; + NotificationConfig notification_config = 1 [(google.api.field_behavior) = REQUIRED]; // The FieldMask to use when updating the notification config. // @@ -1242,12 +1226,11 @@ message UpdateNotificationConfigRequest { // Request message for updating an organization's settings. message UpdateOrganizationSettingsRequest { // Required. The organization settings resource to update. - OrganizationSettings organization_settings = 1 - [(google.api.field_behavior) = REQUIRED]; + OrganizationSettings organization_settings = 1 [(google.api.field_behavior) = REQUIRED]; // The FieldMask to use when updating the settings resource. // - // If empty all mutable fields will be updated. + // If empty all mutable fields will be updated. google.protobuf.FieldMask update_mask = 2; } diff --git a/packages/google-cloud-securitycenter/protos/protos.d.ts b/packages/google-cloud-securitycenter/protos/protos.d.ts index 64113be92e6..ec488173d4c 100644 --- a/packages/google-cloud-securitycenter/protos/protos.d.ts +++ b/packages/google-cloud-securitycenter/protos/protos.d.ts @@ -505,6 +505,9 @@ export namespace google { /** Finding createTime */ createTime?: (google.protobuf.ITimestamp|null); + + /** Finding severity */ + severity?: (google.cloud.securitycenter.v1.Finding.Severity|keyof typeof google.cloud.securitycenter.v1.Finding.Severity|null); } /** Represents a Finding. */ @@ -546,6 +549,9 @@ export namespace google { /** Finding createTime. */ public createTime?: (google.protobuf.ITimestamp|null); + /** Finding severity. */ + public severity: (google.cloud.securitycenter.v1.Finding.Severity|keyof typeof google.cloud.securitycenter.v1.Finding.Severity); + /** * Creates a new Finding instance using the specified properties. * @param [properties] Properties to set @@ -625,6 +631,15 @@ export namespace google { ACTIVE = 1, INACTIVE = 2 } + + /** Severity enum. */ + enum Severity { + SEVERITY_UNSPECIFIED = 0, + CRITICAL = 1, + HIGH = 2, + MEDIUM = 3, + LOW = 4 + } } /** Properties of a NotificationConfig. */ diff --git a/packages/google-cloud-securitycenter/protos/protos.js b/packages/google-cloud-securitycenter/protos/protos.js index 2355fb81e53..681015ae654 100644 --- a/packages/google-cloud-securitycenter/protos/protos.js +++ b/packages/google-cloud-securitycenter/protos/protos.js @@ -1261,6 +1261,7 @@ * @property {google.cloud.securitycenter.v1.ISecurityMarks|null} [securityMarks] Finding securityMarks * @property {google.protobuf.ITimestamp|null} [eventTime] Finding eventTime * @property {google.protobuf.ITimestamp|null} [createTime] Finding createTime + * @property {google.cloud.securitycenter.v1.Finding.Severity|null} [severity] Finding severity */ /** @@ -1359,6 +1360,14 @@ */ Finding.prototype.createTime = null; + /** + * Finding severity. + * @member {google.cloud.securitycenter.v1.Finding.Severity} severity + * @memberof google.cloud.securitycenter.v1.Finding + * @instance + */ + Finding.prototype.severity = 0; + /** * Creates a new Finding instance using the specified properties. * @function create @@ -1406,6 +1415,8 @@ $root.google.protobuf.Timestamp.encode(message.eventTime, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.severity != null && Object.hasOwnProperty.call(message, "severity")) + writer.uint32(/* id 12, wireType 0 =*/96).int32(message.severity); return writer; }; @@ -1489,6 +1500,9 @@ case 10: message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; + case 12: + message.severity = reader.int32(); + break; default: reader.skipType(tag & 7); break; @@ -1573,6 +1587,17 @@ if (error) return "createTime." + error; } + if (message.severity != null && message.hasOwnProperty("severity")) + switch (message.severity) { + default: + return "severity: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } return null; }; @@ -1637,6 +1662,28 @@ throw TypeError(".google.cloud.securitycenter.v1.Finding.createTime: object expected"); message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); } + switch (object.severity) { + case "SEVERITY_UNSPECIFIED": + case 0: + message.severity = 0; + break; + case "CRITICAL": + case 1: + message.severity = 1; + break; + case "HIGH": + case 2: + message.severity = 2; + break; + case "MEDIUM": + case 3: + message.severity = 3; + break; + case "LOW": + case 4: + message.severity = 4; + break; + } return message; }; @@ -1665,6 +1712,7 @@ object.securityMarks = null; object.eventTime = null; object.createTime = null; + object.severity = options.enums === String ? "SEVERITY_UNSPECIFIED" : 0; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -1690,6 +1738,8 @@ object.eventTime = $root.google.protobuf.Timestamp.toObject(message.eventTime, options); if (message.createTime != null && message.hasOwnProperty("createTime")) object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.severity != null && message.hasOwnProperty("severity")) + object.severity = options.enums === String ? $root.google.cloud.securitycenter.v1.Finding.Severity[message.severity] : message.severity; return object; }; @@ -1720,6 +1770,26 @@ return values; })(); + /** + * Severity enum. + * @name google.cloud.securitycenter.v1.Finding.Severity + * @enum {number} + * @property {number} SEVERITY_UNSPECIFIED=0 SEVERITY_UNSPECIFIED value + * @property {number} CRITICAL=1 CRITICAL value + * @property {number} HIGH=2 HIGH value + * @property {number} MEDIUM=3 MEDIUM value + * @property {number} LOW=4 LOW value + */ + Finding.Severity = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SEVERITY_UNSPECIFIED"] = 0; + values[valuesById[1] = "CRITICAL"] = 1; + values[valuesById[2] = "HIGH"] = 2; + values[valuesById[3] = "MEDIUM"] = 3; + values[valuesById[4] = "LOW"] = 4; + return values; + })(); + return Finding; })(); diff --git a/packages/google-cloud-securitycenter/protos/protos.json b/packages/google-cloud-securitycenter/protos/protos.json index a102c248ece..3fe7d0e4a82 100644 --- a/packages/google-cloud-securitycenter/protos/protos.json +++ b/packages/google-cloud-securitycenter/protos/protos.json @@ -169,6 +169,10 @@ "createTime": { "type": "google.protobuf.Timestamp", "id": 10 + }, + "severity": { + "type": "Severity", + "id": 12 } }, "nested": { @@ -178,6 +182,15 @@ "ACTIVE": 1, "INACTIVE": 2 } + }, + "Severity": { + "values": { + "SEVERITY_UNSPECIFIED": 0, + "CRITICAL": 1, + "HIGH": 2, + "MEDIUM": 3, + "LOW": 4 + } } } }, @@ -1151,10 +1164,7 @@ }, "fieldMask": { "type": "google.protobuf.FieldMask", - "id": 7, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } + "id": 7 }, "pageToken": { "type": "string", @@ -1239,10 +1249,7 @@ }, "fieldMask": { "type": "google.protobuf.FieldMask", - "id": 7, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } + "id": 7 }, "pageToken": { "type": "string", @@ -1287,7 +1294,10 @@ }, "resource": { "type": "Resource", - "id": 3 + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } } }, "nested": { diff --git a/packages/google-cloud-securitycenter/src/v1/security_center_client.ts b/packages/google-cloud-securitycenter/src/v1/security_center_client.ts index 6e279447b39..fb5a3161ce0 100644 --- a/packages/google-cloud-securitycenter/src/v1/security_center_client.ts +++ b/packages/google-cloud-securitycenter/src/v1/security_center_client.ts @@ -454,8 +454,8 @@ export class SecurityCenterClient { * Required. Resource name of the new source's parent. Its format should be * "organizations/[organization_id]". * @param {google.cloud.securitycenter.v1.Source} request.source - * Required. The Source being created, only the display_name and description - * will be used. All other fields will be ignored. + * Required. The Source being created, only the display_name and description will be + * used. All other fields will be ignored. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -555,8 +555,8 @@ export class SecurityCenterClient { * It must be alphanumeric and less than or equal to 32 characters and * greater than 0 characters in length. * @param {google.cloud.securitycenter.v1.Finding} request.finding - * Required. The Finding being created. The name and security_marks will be - * ignored as they are both output only fields on this resource. + * Required. The Finding being created. The name and security_marks will be ignored as + * they are both output only fields on this resource. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -651,17 +651,16 @@ export class SecurityCenterClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. Resource name of the new notification config's parent. Its format - * is "organizations/[organization_id]". + * Required. Resource name of the new notification config's parent. Its format is + * "organizations/[organization_id]". * @param {string} request.configId * Required. * Unique identifier provided by the client within the parent scope. * It must be between 1 and 128 characters, and contains alphanumeric * characters, underscores or hyphens only. * @param {google.cloud.securitycenter.v1.NotificationConfig} request.notificationConfig - * Required. The notification config being created. The name and the service - * account will be ignored as they are both output only fields on this - * resource. + * Required. The notification config being created. The name and the service account + * will be ignored as they are both output only fields on this resource. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -1053,8 +1052,8 @@ export class SecurityCenterClient { * @param {Object} request * The request object that will be sent. * @param {string} request.name - * Required. Name of the organization to get organization settings for. Its - * format is "organizations/[organization_id]/organizationSettings". + * Required. Name of the organization to get organization settings for. Its format is + * "organizations/[organization_id]/organizationSettings". * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -1526,8 +1525,8 @@ export class SecurityCenterClient { * @param {Object} request * The request object that will be sent. * @param {google.cloud.securitycenter.v1.Finding} request.finding - * Required. The finding resource to update or create if it does not already - * exist. parent, security_marks, and update_time will be ignored. + * Required. The finding resource to update or create if it does not already exist. + * parent, security_marks, and update_time will be ignored. * * In the case of creation, the finding id portion of the name must be * alphanumeric and less than or equal to 32 characters and greater than 0 @@ -1745,7 +1744,7 @@ export class SecurityCenterClient { * @param {google.protobuf.FieldMask} request.updateMask * The FieldMask to use when updating the settings resource. * - * If empty all mutable fields will be updated. + * If empty all mutable fields will be updated. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -2059,8 +2058,8 @@ export class SecurityCenterClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. Name of the organization to run asset discovery for. Its format - * is "organizations/[organization_id]". + * Required. Name of the organization to run asset discovery for. Its format is + * "organizations/[organization_id]". * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -2259,14 +2258,14 @@ export class SecurityCenterClient { * For example, `resource_properties.size = 100` is a valid filter string. * * Use a partial match on the empty string to filter based on a property - * existing:`resource_properties.my_property : ""` + * existing: `resource_properties.my_property : ""` * * Use a negated partial match on the empty string to filter based on a * property not existing: `-resource_properties.my_property : ""` * @param {string} request.groupBy - * Required. Expression that defines what assets fields to use for grouping. - * The string value should follow SQL syntax: comma separated list of fields. - * For example: + * Required. Expression that defines what assets fields to use for grouping. The string + * value should follow SQL syntax: comma separated list of fields. For + * example: * "security_center_properties.resource_project,security_center_properties.project". * * The following fields are supported when compare_duration is not set: @@ -2446,14 +2445,14 @@ export class SecurityCenterClient { * For example, `resource_properties.size = 100` is a valid filter string. * * Use a partial match on the empty string to filter based on a property - * existing:`resource_properties.my_property : ""` + * existing: `resource_properties.my_property : ""` * * Use a negated partial match on the empty string to filter based on a * property not existing: `-resource_properties.my_property : ""` * @param {string} request.groupBy - * Required. Expression that defines what assets fields to use for grouping. - * The string value should follow SQL syntax: comma separated list of fields. - * For example: + * Required. Expression that defines what assets fields to use for grouping. The string + * value should follow SQL syntax: comma separated list of fields. For + * example: * "security_center_properties.resource_project,security_center_properties.project". * * The following fields are supported when compare_duration is not set: @@ -2611,14 +2610,14 @@ export class SecurityCenterClient { * For example, `resource_properties.size = 100` is a valid filter string. * * Use a partial match on the empty string to filter based on a property - * existing:`resource_properties.my_property : ""` + * existing: `resource_properties.my_property : ""` * * Use a negated partial match on the empty string to filter based on a * property not existing: `-resource_properties.my_property : ""` * @param {string} request.groupBy - * Required. Expression that defines what assets fields to use for grouping. - * The string value should follow SQL syntax: comma separated list of fields. - * For example: + * Required. Expression that defines what assets fields to use for grouping. The string + * value should follow SQL syntax: comma separated list of fields. For + * example: * "security_center_properties.resource_project,security_center_properties.project". * * The following fields are supported when compare_duration is not set: @@ -2791,6 +2790,7 @@ export class SecurityCenterClient { * * category: `=`, `:` * * external_uri: `=`, `:` * * event_time: `=`, `>`, `<`, `>=`, `<=` + * * severity: `=`, `:` * * Usage: This should be milliseconds since epoch or an RFC3339 string. * Examples: @@ -2808,9 +2808,9 @@ export class SecurityCenterClient { * Use a negated partial match on the empty string to filter based on a * property not existing: `-source_properties.my_property : ""` * @param {string} request.groupBy - * Required. Expression that defines what assets fields to use for grouping - * (including `state_change`). The string value should follow SQL syntax: - * comma separated list of fields. For example: "parent,resource_name". + * Required. Expression that defines what assets fields to use for grouping (including + * `state_change`). The string value should follow SQL syntax: comma separated + * list of fields. For example: "parent,resource_name". * * The following fields are supported: * @@ -2818,6 +2818,7 @@ export class SecurityCenterClient { * * category * * state * * parent + * * severity * * The following fields are supported when compare_duration is set: * @@ -2968,6 +2969,7 @@ export class SecurityCenterClient { * * category: `=`, `:` * * external_uri: `=`, `:` * * event_time: `=`, `>`, `<`, `>=`, `<=` + * * severity: `=`, `:` * * Usage: This should be milliseconds since epoch or an RFC3339 string. * Examples: @@ -2985,9 +2987,9 @@ export class SecurityCenterClient { * Use a negated partial match on the empty string to filter based on a * property not existing: `-source_properties.my_property : ""` * @param {string} request.groupBy - * Required. Expression that defines what assets fields to use for grouping - * (including `state_change`). The string value should follow SQL syntax: - * comma separated list of fields. For example: "parent,resource_name". + * Required. Expression that defines what assets fields to use for grouping (including + * `state_change`). The string value should follow SQL syntax: comma separated + * list of fields. For example: "parent,resource_name". * * The following fields are supported: * @@ -2995,6 +2997,7 @@ export class SecurityCenterClient { * * category * * state * * parent + * * severity * * The following fields are supported when compare_duration is set: * @@ -3123,6 +3126,7 @@ export class SecurityCenterClient { * * category: `=`, `:` * * external_uri: `=`, `:` * * event_time: `=`, `>`, `<`, `>=`, `<=` + * * severity: `=`, `:` * * Usage: This should be milliseconds since epoch or an RFC3339 string. * Examples: @@ -3140,9 +3144,9 @@ export class SecurityCenterClient { * Use a negated partial match on the empty string to filter based on a * property not existing: `-source_properties.my_property : ""` * @param {string} request.groupBy - * Required. Expression that defines what assets fields to use for grouping - * (including `state_change`). The string value should follow SQL syntax: - * comma separated list of fields. For example: "parent,resource_name". + * Required. Expression that defines what assets fields to use for grouping (including + * `state_change`). The string value should follow SQL syntax: comma separated + * list of fields. For example: "parent,resource_name". * * The following fields are supported: * @@ -3150,6 +3154,7 @@ export class SecurityCenterClient { * * category * * state * * parent + * * severity * * The following fields are supported when compare_duration is set: * @@ -3391,9 +3396,10 @@ export class SecurityCenterClient { * If compare_duration is not specified, then the only possible state_change * is "UNUSED", which will be the state_change set for all assets present at * read_time. - * @param {google.protobuf.FieldMask} [request.fieldMask] - * Optional. A field mask to specify the ListAssetsResult fields to be listed - * in the response. An empty field mask will list all fields. + * @param {google.protobuf.FieldMask} request.fieldMask + * A field mask to specify the ListAssetsResult fields to be listed in the + * response. + * An empty field mask will list all fields. * @param {string} request.pageToken * The value returned by the last `ListAssetsResponse`; indicates * that this is a continuation of a prior `ListAssets` call, and @@ -3581,9 +3587,10 @@ export class SecurityCenterClient { * If compare_duration is not specified, then the only possible state_change * is "UNUSED", which will be the state_change set for all assets present at * read_time. - * @param {google.protobuf.FieldMask} [request.fieldMask] - * Optional. A field mask to specify the ListAssetsResult fields to be listed - * in the response. An empty field mask will list all fields. + * @param {google.protobuf.FieldMask} request.fieldMask + * A field mask to specify the ListAssetsResult fields to be listed in the + * response. + * An empty field mask will list all fields. * @param {string} request.pageToken * The value returned by the last `ListAssetsResponse`; indicates * that this is a continuation of a prior `ListAssets` call, and @@ -3749,9 +3756,10 @@ export class SecurityCenterClient { * If compare_duration is not specified, then the only possible state_change * is "UNUSED", which will be the state_change set for all assets present at * read_time. - * @param {google.protobuf.FieldMask} [request.fieldMask] - * Optional. A field mask to specify the ListAssetsResult fields to be listed - * in the response. An empty field mask will list all fields. + * @param {google.protobuf.FieldMask} request.fieldMask + * A field mask to specify the ListAssetsResult fields to be listed in the + * response. + * An empty field mask will list all fields. * @param {string} request.pageToken * The value returned by the last `ListAssetsResponse`; indicates * that this is a continuation of a prior `ListAssets` call, and @@ -3868,13 +3876,14 @@ export class SecurityCenterClient { * * The following field and operator combinations are supported: * - * name: `=` - * parent: `=`, `:` - * resource_name: `=`, `:` - * state: `=`, `:` - * category: `=`, `:` - * external_uri: `=`, `:` - * event_time: `=`, `>`, `<`, `>=`, `<=` + * * name: `=` + * * parent: `=`, `:` + * * resource_name: `=`, `:` + * * state: `=`, `:` + * * category: `=`, `:` + * * external_uri: `=`, `:` + * * event_time: `=`, `>`, `<`, `>=`, `<=` + * * severity: `=`, `:` * * Usage: This should be milliseconds since epoch or an RFC3339 string. * Examples: @@ -3946,9 +3955,9 @@ export class SecurityCenterClient { * If compare_duration is not specified, then the only possible state_change * is "UNUSED", which will be the state_change set for all findings present at * read_time. - * @param {google.protobuf.FieldMask} [request.fieldMask] - * Optional. A field mask to specify the Finding fields to be listed in the - * response. An empty field mask will list all fields. + * @param {google.protobuf.FieldMask} request.fieldMask + * A field mask to specify the Finding fields to be listed in the response. + * An empty field mask will list all fields. * @param {string} request.pageToken * The value returned by the last `ListFindingsResponse`; indicates * that this is a continuation of a prior `ListFindings` call, and @@ -4050,13 +4059,14 @@ export class SecurityCenterClient { * * The following field and operator combinations are supported: * - * name: `=` - * parent: `=`, `:` - * resource_name: `=`, `:` - * state: `=`, `:` - * category: `=`, `:` - * external_uri: `=`, `:` - * event_time: `=`, `>`, `<`, `>=`, `<=` + * * name: `=` + * * parent: `=`, `:` + * * resource_name: `=`, `:` + * * state: `=`, `:` + * * category: `=`, `:` + * * external_uri: `=`, `:` + * * event_time: `=`, `>`, `<`, `>=`, `<=` + * * severity: `=`, `:` * * Usage: This should be milliseconds since epoch or an RFC3339 string. * Examples: @@ -4128,9 +4138,9 @@ export class SecurityCenterClient { * If compare_duration is not specified, then the only possible state_change * is "UNUSED", which will be the state_change set for all findings present at * read_time. - * @param {google.protobuf.FieldMask} [request.fieldMask] - * Optional. A field mask to specify the Finding fields to be listed in the - * response. An empty field mask will list all fields. + * @param {google.protobuf.FieldMask} request.fieldMask + * A field mask to specify the Finding fields to be listed in the response. + * An empty field mask will list all fields. * @param {string} request.pageToken * The value returned by the last `ListFindingsResponse`; indicates * that this is a continuation of a prior `ListFindings` call, and @@ -4210,13 +4220,14 @@ export class SecurityCenterClient { * * The following field and operator combinations are supported: * - * name: `=` - * parent: `=`, `:` - * resource_name: `=`, `:` - * state: `=`, `:` - * category: `=`, `:` - * external_uri: `=`, `:` - * event_time: `=`, `>`, `<`, `>=`, `<=` + * * name: `=` + * * parent: `=`, `:` + * * resource_name: `=`, `:` + * * state: `=`, `:` + * * category: `=`, `:` + * * external_uri: `=`, `:` + * * event_time: `=`, `>`, `<`, `>=`, `<=` + * * severity: `=`, `:` * * Usage: This should be milliseconds since epoch or an RFC3339 string. * Examples: @@ -4288,9 +4299,9 @@ export class SecurityCenterClient { * If compare_duration is not specified, then the only possible state_change * is "UNUSED", which will be the state_change set for all findings present at * read_time. - * @param {google.protobuf.FieldMask} [request.fieldMask] - * Optional. A field mask to specify the Finding fields to be listed in the - * response. An empty field mask will list all fields. + * @param {google.protobuf.FieldMask} request.fieldMask + * A field mask to specify the Finding fields to be listed in the response. + * An empty field mask will list all fields. * @param {string} request.pageToken * The value returned by the last `ListFindingsResponse`; indicates * that this is a continuation of a prior `ListFindings` call, and diff --git a/packages/google-cloud-securitycenter/synth.metadata b/packages/google-cloud-securitycenter/synth.metadata index f8c9802a8bb..dda57c58e4d 100644 --- a/packages/google-cloud-securitycenter/synth.metadata +++ b/packages/google-cloud-securitycenter/synth.metadata @@ -4,15 +4,15 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-security-center.git", - "sha": "f0e8525fb86f0e2e3405319a8c41d37dbc731b62" + "sha": "50272404ab2411ba40eb350a92f7e8cc893ef1f4" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "d189e871205fea665a9648f7c4676f027495ccaf", - "internalRef": "345596855" + "sha": "e9135d3cb8a99f77ee2ba3318ebc2c9b807581d0", + "internalRef": "347410691" } }, { From 5a6e364ec02a0c63f452c7298e6fe8804be4b6cc Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Tue, 22 Dec 2020 11:46:15 -0800 Subject: [PATCH 234/342] docs: add instructions for authenticating for system tests (#351) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/fc1dd810-ea11-44c0-ab02-fa000827a405/targets - [ ] To automatically regenerate this PR, check this box. Source-Link: https://github.com/googleapis/synthtool/commit/363fe305e9ce34a6cd53951c6ee5f997094b54ee --- .../google-cloud-securitycenter/CONTRIBUTING.md | 15 +++++++++++++-- packages/google-cloud-securitycenter/README.md | 3 +-- .../google-cloud-securitycenter/synth.metadata | 4 ++-- 3 files changed, 16 insertions(+), 6 deletions(-) diff --git a/packages/google-cloud-securitycenter/CONTRIBUTING.md b/packages/google-cloud-securitycenter/CONTRIBUTING.md index f6c4cf010e3..18cf8c0b149 100644 --- a/packages/google-cloud-securitycenter/CONTRIBUTING.md +++ b/packages/google-cloud-securitycenter/CONTRIBUTING.md @@ -37,6 +37,15 @@ accept your pull requests. 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 billing for your project][billing]. +1. [Enable the Google Cloud Security Command Center 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]. @@ -51,11 +60,9 @@ accept your pull requests. npm test # Run sample integration tests. - gcloud auth application-default login npm run samples-test # Run all system tests. - gcloud auth application-default login npm run system-test 1. Lint (and maybe fix) any changes: @@ -63,3 +70,7 @@ accept your pull requests. 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=securitycenter.googleapis.com +[auth]: https://cloud.google.com/docs/authentication/getting-started \ No newline at end of file diff --git a/packages/google-cloud-securitycenter/README.md b/packages/google-cloud-securitycenter/README.md index ff90027c7d0..a7411611ea7 100644 --- a/packages/google-cloud-securitycenter/README.md +++ b/packages/google-cloud-securitycenter/README.md @@ -90,8 +90,7 @@ quickstart(); ## Samples -Samples are in the [`samples/`](https://github.com/googleapis/nodejs-security-center/tree/master/samples) directory. The samples' `README.md` -has instructions for running the samples. +Samples are in the [`samples/`](https://github.com/googleapis/nodejs-security-center/tree/master/samples) directory. Each sample's `README.md` has instructions for running its sample. | Sample | Source Code | Try it | | --------------------------- | --------------------------------- | ------ | diff --git a/packages/google-cloud-securitycenter/synth.metadata b/packages/google-cloud-securitycenter/synth.metadata index dda57c58e4d..7ba6754c759 100644 --- a/packages/google-cloud-securitycenter/synth.metadata +++ b/packages/google-cloud-securitycenter/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-security-center.git", - "sha": "50272404ab2411ba40eb350a92f7e8cc893ef1f4" + "sha": "79f1433d05037d1bb9f7d0a252cb483a0f817568" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "15013eff642a7e7e855aed5a29e6e83c39beba2a" + "sha": "363fe305e9ce34a6cd53951c6ee5f997094b54ee" } } ], From 38d925eed486ca75ac3d064f091fa04de87ce579 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Tue, 5 Jan 2021 17:41:52 -0800 Subject: [PATCH 235/342] docs: update copyright header --- packages/google-cloud-securitycenter/.jsdoc.js | 4 ++-- packages/google-cloud-securitycenter/protos/protos.d.ts | 2 +- packages/google-cloud-securitycenter/protos/protos.js | 2 +- packages/google-cloud-securitycenter/src/v1/index.ts | 2 +- .../src/v1/security_center_client.ts | 2 +- packages/google-cloud-securitycenter/src/v1beta1/index.ts | 2 +- .../src/v1beta1/security_center_client.ts | 2 +- packages/google-cloud-securitycenter/src/v1p1beta1/index.ts | 2 +- .../src/v1p1beta1/security_center_client.ts | 2 +- packages/google-cloud-securitycenter/synth.metadata | 2 +- .../system-test/fixtures/sample/src/index.js | 2 +- .../system-test/fixtures/sample/src/index.ts | 2 +- packages/google-cloud-securitycenter/system-test/install.ts | 2 +- .../test/gapic_security_center_v1.ts | 2 +- .../test/gapic_security_center_v1beta1.ts | 2 +- .../test/gapic_security_center_v1p1beta1.ts | 2 +- 16 files changed, 17 insertions(+), 17 deletions(-) diff --git a/packages/google-cloud-securitycenter/.jsdoc.js b/packages/google-cloud-securitycenter/.jsdoc.js index 5bf29039c8f..e201160b63a 100644 --- a/packages/google-cloud-securitycenter/.jsdoc.js +++ b/packages/google-cloud-securitycenter/.jsdoc.js @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// 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. @@ -40,7 +40,7 @@ module.exports = { includePattern: '\\.js$' }, templates: { - copyright: 'Copyright 2020 Google LLC', + copyright: 'Copyright 2021 Google LLC', includeDate: false, sourceFiles: false, systemName: '@google-cloud/security-center', diff --git a/packages/google-cloud-securitycenter/protos/protos.d.ts b/packages/google-cloud-securitycenter/protos/protos.d.ts index ec488173d4c..fe5e0c590f0 100644 --- a/packages/google-cloud-securitycenter/protos/protos.d.ts +++ b/packages/google-cloud-securitycenter/protos/protos.d.ts @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// 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. diff --git a/packages/google-cloud-securitycenter/protos/protos.js b/packages/google-cloud-securitycenter/protos/protos.js index 681015ae654..5adb00750ed 100644 --- a/packages/google-cloud-securitycenter/protos/protos.js +++ b/packages/google-cloud-securitycenter/protos/protos.js @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// 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. diff --git a/packages/google-cloud-securitycenter/src/v1/index.ts b/packages/google-cloud-securitycenter/src/v1/index.ts index 2ce663a0a64..de26020df4d 100644 --- a/packages/google-cloud-securitycenter/src/v1/index.ts +++ b/packages/google-cloud-securitycenter/src/v1/index.ts @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// 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. diff --git a/packages/google-cloud-securitycenter/src/v1/security_center_client.ts b/packages/google-cloud-securitycenter/src/v1/security_center_client.ts index fb5a3161ce0..7b7a1097b4c 100644 --- a/packages/google-cloud-securitycenter/src/v1/security_center_client.ts +++ b/packages/google-cloud-securitycenter/src/v1/security_center_client.ts @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// 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. diff --git a/packages/google-cloud-securitycenter/src/v1beta1/index.ts b/packages/google-cloud-securitycenter/src/v1beta1/index.ts index 2ce663a0a64..de26020df4d 100644 --- a/packages/google-cloud-securitycenter/src/v1beta1/index.ts +++ b/packages/google-cloud-securitycenter/src/v1beta1/index.ts @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// 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. diff --git a/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.ts b/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.ts index a29a7e1318c..7ee873d4f5a 100644 --- a/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.ts +++ b/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.ts @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// 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. diff --git a/packages/google-cloud-securitycenter/src/v1p1beta1/index.ts b/packages/google-cloud-securitycenter/src/v1p1beta1/index.ts index 2ce663a0a64..de26020df4d 100644 --- a/packages/google-cloud-securitycenter/src/v1p1beta1/index.ts +++ b/packages/google-cloud-securitycenter/src/v1p1beta1/index.ts @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// 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. diff --git a/packages/google-cloud-securitycenter/src/v1p1beta1/security_center_client.ts b/packages/google-cloud-securitycenter/src/v1p1beta1/security_center_client.ts index 4c81d1d532f..ca13ea15426 100644 --- a/packages/google-cloud-securitycenter/src/v1p1beta1/security_center_client.ts +++ b/packages/google-cloud-securitycenter/src/v1p1beta1/security_center_client.ts @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// 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. diff --git a/packages/google-cloud-securitycenter/synth.metadata b/packages/google-cloud-securitycenter/synth.metadata index 7ba6754c759..812c1162716 100644 --- a/packages/google-cloud-securitycenter/synth.metadata +++ b/packages/google-cloud-securitycenter/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-security-center.git", - "sha": "79f1433d05037d1bb9f7d0a252cb483a0f817568" + "sha": "1bb655d570a20bd1d099feaeb9b6e9b53f002e2c" } }, { diff --git a/packages/google-cloud-securitycenter/system-test/fixtures/sample/src/index.js b/packages/google-cloud-securitycenter/system-test/fixtures/sample/src/index.js index c9b57896440..1f5fbbc71c5 100644 --- a/packages/google-cloud-securitycenter/system-test/fixtures/sample/src/index.js +++ b/packages/google-cloud-securitycenter/system-test/fixtures/sample/src/index.js @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// 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. diff --git a/packages/google-cloud-securitycenter/system-test/fixtures/sample/src/index.ts b/packages/google-cloud-securitycenter/system-test/fixtures/sample/src/index.ts index 3f3881c595e..b4153c943ab 100644 --- a/packages/google-cloud-securitycenter/system-test/fixtures/sample/src/index.ts +++ b/packages/google-cloud-securitycenter/system-test/fixtures/sample/src/index.ts @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// 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. diff --git a/packages/google-cloud-securitycenter/system-test/install.ts b/packages/google-cloud-securitycenter/system-test/install.ts index 39d90f771de..d2d61c0396f 100644 --- a/packages/google-cloud-securitycenter/system-test/install.ts +++ b/packages/google-cloud-securitycenter/system-test/install.ts @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// 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. diff --git a/packages/google-cloud-securitycenter/test/gapic_security_center_v1.ts b/packages/google-cloud-securitycenter/test/gapic_security_center_v1.ts index 15bbe383bab..ba64fd58371 100644 --- a/packages/google-cloud-securitycenter/test/gapic_security_center_v1.ts +++ b/packages/google-cloud-securitycenter/test/gapic_security_center_v1.ts @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// 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. diff --git a/packages/google-cloud-securitycenter/test/gapic_security_center_v1beta1.ts b/packages/google-cloud-securitycenter/test/gapic_security_center_v1beta1.ts index 4170cd256e0..c73805fd46a 100644 --- a/packages/google-cloud-securitycenter/test/gapic_security_center_v1beta1.ts +++ b/packages/google-cloud-securitycenter/test/gapic_security_center_v1beta1.ts @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// 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. diff --git a/packages/google-cloud-securitycenter/test/gapic_security_center_v1p1beta1.ts b/packages/google-cloud-securitycenter/test/gapic_security_center_v1p1beta1.ts index 1ecf3a9a91f..1ef7aee251c 100644 --- a/packages/google-cloud-securitycenter/test/gapic_security_center_v1p1beta1.ts +++ b/packages/google-cloud-securitycenter/test/gapic_security_center_v1p1beta1.ts @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// 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. From 5dcf670c1684cb418c659e5f8c836c27f3e9d447 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Thu, 7 Jan 2021 11:24:59 -0800 Subject: [PATCH 236/342] feat: introduces style enumeration (#353) --- .../protos/protos.d.ts | 12 +++ .../protos/protos.js | 78 ++++++++++++++++++- .../protos/protos.json | 13 +++- .../synth.metadata | 2 +- 4 files changed, 102 insertions(+), 3 deletions(-) diff --git a/packages/google-cloud-securitycenter/protos/protos.d.ts b/packages/google-cloud-securitycenter/protos/protos.d.ts index fe5e0c590f0..77c03b2b57c 100644 --- a/packages/google-cloud-securitycenter/protos/protos.d.ts +++ b/packages/google-cloud-securitycenter/protos/protos.d.ts @@ -14191,6 +14191,9 @@ export namespace google { /** ResourceDescriptor singular */ singular?: (string|null); + + /** ResourceDescriptor style */ + style?: (google.api.ResourceDescriptor.Style[]|null); } /** Represents a ResourceDescriptor. */ @@ -14220,6 +14223,9 @@ export namespace google { /** 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 @@ -14299,6 +14305,12 @@ export namespace google { ORIGINALLY_SINGLE_PATTERN = 1, FUTURE_MULTI_PATTERN = 2 } + + /** Style enum. */ + enum Style { + STYLE_UNSPECIFIED = 0, + DECLARATIVE_FRIENDLY = 1 + } } /** Properties of a ResourceReference. */ diff --git a/packages/google-cloud-securitycenter/protos/protos.js b/packages/google-cloud-securitycenter/protos/protos.js index 5adb00750ed..d696a952556 100644 --- a/packages/google-cloud-securitycenter/protos/protos.js +++ b/packages/google-cloud-securitycenter/protos/protos.js @@ -33731,6 +33731,7 @@ * @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 */ /** @@ -33743,6 +33744,7 @@ */ 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) @@ -33797,6 +33799,14 @@ */ 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 @@ -33834,6 +33844,12 @@ 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; }; @@ -33888,6 +33904,16 @@ 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; @@ -33951,6 +33977,18 @@ 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; }; @@ -33995,6 +34033,23 @@ 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: + case "STYLE_UNSPECIFIED": + case 0: + message.style[i] = 0; + break; + case "DECLARATIVE_FRIENDLY": + case 1: + message.style[i] = 1; + break; + } + } return message; }; @@ -34011,8 +34066,10 @@ if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) + if (options.arrays || options.defaults) { object.pattern = []; + object.style = []; + } if (options.defaults) { object.type = ""; object.nameField = ""; @@ -34035,6 +34092,11 @@ 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]] : message.style[j]; + } return object; }; @@ -34065,6 +34127,20 @@ 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; })(); diff --git a/packages/google-cloud-securitycenter/protos/protos.json b/packages/google-cloud-securitycenter/protos/protos.json index 3fe7d0e4a82..960464f3d02 100644 --- a/packages/google-cloud-securitycenter/protos/protos.json +++ b/packages/google-cloud-securitycenter/protos/protos.json @@ -4194,6 +4194,11 @@ "singular": { "type": "string", "id": 6 + }, + "style": { + "rule": "repeated", + "type": "Style", + "id": 10 } }, "nested": { @@ -4203,6 +4208,12 @@ "ORIGINALLY_SINGLE_PATTERN": 1, "FUTURE_MULTI_PATTERN": 2 } + }, + "Style": { + "values": { + "STYLE_UNSPECIFIED": 0, + "DECLARATIVE_FRIENDLY": 1 + } } } }, @@ -4254,7 +4265,7 @@ }, "protobuf": { "options": { - "go_package": "github.com/golang/protobuf/protoc-gen-go/descriptor;descriptor", + "go_package": "google.golang.org/protobuf/types/descriptorpb", "java_package": "com.google.protobuf", "java_outer_classname": "DescriptorProtos", "csharp_namespace": "Google.Protobuf.Reflection", diff --git a/packages/google-cloud-securitycenter/synth.metadata b/packages/google-cloud-securitycenter/synth.metadata index 812c1162716..3eb4b7a0510 100644 --- a/packages/google-cloud-securitycenter/synth.metadata +++ b/packages/google-cloud-securitycenter/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-security-center.git", - "sha": "1bb655d570a20bd1d099feaeb9b6e9b53f002e2c" + "sha": "6c3455c447cfc9772213833af1543edb58d8ba92" } }, { From 9cdfe38b3d74046a08aa2a5883a1dc1f411f72cb Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Thu, 7 Jan 2021 11:45:58 -0800 Subject: [PATCH 237/342] chore: release 5.2.0 (#350) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- packages/google-cloud-securitycenter/CHANGELOG.md | 8 ++++++++ packages/google-cloud-securitycenter/package.json | 2 +- packages/google-cloud-securitycenter/samples/package.json | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-securitycenter/CHANGELOG.md b/packages/google-cloud-securitycenter/CHANGELOG.md index c672c5c8bc2..d7e4f7f1a13 100644 --- a/packages/google-cloud-securitycenter/CHANGELOG.md +++ b/packages/google-cloud-securitycenter/CHANGELOG.md @@ -4,6 +4,14 @@ [1]: https://www.npmjs.com/package/@google-cloud/security-center?activeTab=versions +## [5.2.0](https://www.github.com/googleapis/nodejs-security-center/compare/v5.1.3...v5.2.0) (2021-01-07) + + +### Features + +* added field severity to findings in v1 API ([#349](https://www.github.com/googleapis/nodejs-security-center/issues/349)) ([79f1433](https://www.github.com/googleapis/nodejs-security-center/commit/79f1433d05037d1bb9f7d0a252cb483a0f817568)) +* introduces style enumeration ([#353](https://www.github.com/googleapis/nodejs-security-center/issues/353)) ([37c179f](https://www.github.com/googleapis/nodejs-security-center/commit/37c179f8915d7b5f6e141b78e59ec612b6b115a7)) + ### [5.1.3](https://www.github.com/googleapis/nodejs-security-center/compare/v5.1.2...v5.1.3) (2020-11-25) diff --git a/packages/google-cloud-securitycenter/package.json b/packages/google-cloud-securitycenter/package.json index d19b6c96266..90411e2e9c2 100644 --- a/packages/google-cloud-securitycenter/package.json +++ b/packages/google-cloud-securitycenter/package.json @@ -1,7 +1,7 @@ { "name": "@google-cloud/security-center", "description": "Cloud Security Command Center API client for Node.js", - "version": "5.1.3", + "version": "5.2.0", "license": "Apache-2.0", "author": "Google LLC", "engines": { diff --git a/packages/google-cloud-securitycenter/samples/package.json b/packages/google-cloud-securitycenter/samples/package.json index 01566339061..a911d1d1ec7 100644 --- a/packages/google-cloud-securitycenter/samples/package.json +++ b/packages/google-cloud-securitycenter/samples/package.json @@ -14,7 +14,7 @@ "license": "Apache-2.0", "dependencies": { "@google-cloud/pubsub": "^2.0.0", - "@google-cloud/security-center": "^5.1.3" + "@google-cloud/security-center": "^5.2.0" }, "devDependencies": { "chai": "^4.2.0", From 2a97e7a1d26850b964f806b868a5d406b03b80d8 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Wed, 27 Jan 2021 08:44:02 -0800 Subject: [PATCH 238/342] refactor(nodejs): move build cop to flakybot (#356) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/541df317-e090-4c6d-88b9-3f79f53b8d13/targets - [ ] To automatically regenerate this PR, check this box. Source-Link: https://github.com/googleapis/synthtool/commit/57c23fa5705499a4181095ced81f0ee0933b64f6 --- packages/google-cloud-securitycenter/synth.metadata | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-securitycenter/synth.metadata b/packages/google-cloud-securitycenter/synth.metadata index 3eb4b7a0510..d89ecbc2012 100644 --- a/packages/google-cloud-securitycenter/synth.metadata +++ b/packages/google-cloud-securitycenter/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-security-center.git", - "sha": "6c3455c447cfc9772213833af1543edb58d8ba92" + "sha": "fb74f8aea857c140f9c680fe800f9d244f31ac21" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "363fe305e9ce34a6cd53951c6ee5f997094b54ee" + "sha": "57c23fa5705499a4181095ced81f0ee0933b64f6" } } ], From da225558d2418d791262bb7722276199d59db8c3 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Wed, 3 Feb 2021 17:56:27 -0800 Subject: [PATCH 239/342] build: adds UNORDERED_LIST enum (#357) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/fac33cba-1b6d-4d0a-8723-c1d1045460b0/targets - [ ] To automatically regenerate this PR, check this box. --- packages/google-cloud-securitycenter/protos/protos.d.ts | 3 ++- packages/google-cloud-securitycenter/protos/protos.js | 7 +++++++ packages/google-cloud-securitycenter/protos/protos.json | 3 ++- packages/google-cloud-securitycenter/synth.metadata | 2 +- 4 files changed, 12 insertions(+), 3 deletions(-) diff --git a/packages/google-cloud-securitycenter/protos/protos.d.ts b/packages/google-cloud-securitycenter/protos/protos.d.ts index 77c03b2b57c..29e852acd7e 100644 --- a/packages/google-cloud-securitycenter/protos/protos.d.ts +++ b/packages/google-cloud-securitycenter/protos/protos.d.ts @@ -14416,7 +14416,8 @@ export namespace google { REQUIRED = 2, OUTPUT_ONLY = 3, INPUT_ONLY = 4, - IMMUTABLE = 5 + IMMUTABLE = 5, + UNORDERED_LIST = 6 } } diff --git a/packages/google-cloud-securitycenter/protos/protos.js b/packages/google-cloud-securitycenter/protos/protos.js index d696a952556..80d55dd84b7 100644 --- a/packages/google-cloud-securitycenter/protos/protos.js +++ b/packages/google-cloud-securitycenter/protos/protos.js @@ -34364,6 +34364,7 @@ * @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 */ api.FieldBehavior = (function() { var valuesById = {}, values = Object.create(valuesById); @@ -34373,6 +34374,7 @@ values[valuesById[3] = "OUTPUT_ONLY"] = 3; values[valuesById[4] = "INPUT_ONLY"] = 4; values[valuesById[5] = "IMMUTABLE"] = 5; + values[valuesById[6] = "UNORDERED_LIST"] = 6; return values; })(); @@ -39910,6 +39912,7 @@ case 3: case 4: case 5: + case 6: break; } } @@ -40010,6 +40013,10 @@ case 5: message[".google.api.fieldBehavior"][i] = 5; break; + case "UNORDERED_LIST": + case 6: + message[".google.api.fieldBehavior"][i] = 6; + break; } } return message; diff --git a/packages/google-cloud-securitycenter/protos/protos.json b/packages/google-cloud-securitycenter/protos/protos.json index 960464f3d02..73b98ddf60f 100644 --- a/packages/google-cloud-securitycenter/protos/protos.json +++ b/packages/google-cloud-securitycenter/protos/protos.json @@ -4242,7 +4242,8 @@ "REQUIRED": 2, "OUTPUT_ONLY": 3, "INPUT_ONLY": 4, - "IMMUTABLE": 5 + "IMMUTABLE": 5, + "UNORDERED_LIST": 6 } }, "methodSignature": { diff --git a/packages/google-cloud-securitycenter/synth.metadata b/packages/google-cloud-securitycenter/synth.metadata index d89ecbc2012..b960e28a404 100644 --- a/packages/google-cloud-securitycenter/synth.metadata +++ b/packages/google-cloud-securitycenter/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-security-center.git", - "sha": "fb74f8aea857c140f9c680fe800f9d244f31ac21" + "sha": "0b964fe77efda8f09d5a97b426fd425861183e99" } }, { From 79053be6db361da79dee868012dd95fee81748fb Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Sun, 7 Mar 2021 09:00:32 -0800 Subject: [PATCH 240/342] build: update gapic-generator-typescript to v1.2.10. (#360) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/cb5a7bf7-f080-4698-bd24-ff5880d64fc8/targets - [ ] To automatically regenerate this PR, check this box. PiperOrigin-RevId: 361273630 Source-Link: https://github.com/googleapis/googleapis/commit/5477122b3e8037a1dc5bc920536158edbd151dc4 --- packages/google-cloud-securitycenter/synth.metadata | 6 +++--- packages/google-cloud-securitycenter/webpack.config.js | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/google-cloud-securitycenter/synth.metadata b/packages/google-cloud-securitycenter/synth.metadata index b960e28a404..1f6b33e5559 100644 --- a/packages/google-cloud-securitycenter/synth.metadata +++ b/packages/google-cloud-securitycenter/synth.metadata @@ -4,15 +4,15 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-security-center.git", - "sha": "0b964fe77efda8f09d5a97b426fd425861183e99" + "sha": "fb1a8b32cd67c4b1327a031c949f676d01d3b24f" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "e9135d3cb8a99f77ee2ba3318ebc2c9b807581d0", - "internalRef": "347410691" + "sha": "5477122b3e8037a1dc5bc920536158edbd151dc4", + "internalRef": "361273630" } }, { diff --git a/packages/google-cloud-securitycenter/webpack.config.js b/packages/google-cloud-securitycenter/webpack.config.js index 95e0a42e676..2f070bdcbd4 100644 --- a/packages/google-cloud-securitycenter/webpack.config.js +++ b/packages/google-cloud-securitycenter/webpack.config.js @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// 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. From 58c7a387dcbec381f0c4106830479973feacb0ca Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 23 Mar 2021 17:52:28 +0100 Subject: [PATCH 241/342] chore(deps): update dependency sinon to v10 (#362) [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [sinon](https://sinonjs.org/) ([source](https://togithub.com/sinonjs/sinon)) | [`^9.0.1` -> `^10.0.0`](https://renovatebot.com/diffs/npm/sinon/9.2.4/10.0.0) | [![age](https://badges.renovateapi.com/packages/npm/sinon/10.0.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/sinon/10.0.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/sinon/10.0.0/compatibility-slim/9.2.4)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/sinon/10.0.0/confidence-slim/9.2.4)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
sinonjs/sinon ### [`v10.0.0`](https://togithub.com/sinonjs/sinon/blob/master/CHANGELOG.md#​1000--2021-03-22) [Compare Source](https://togithub.com/sinonjs/sinon/compare/v9.2.4...v10.0.0) ================== - Upgrade nise to 4.1.0 - Use [@​sinonjs/eslint-config](https://togithub.com/sinonjs/eslint-config)[@​4](https://togithub.com/4) => Adopts ES2017 => Drops support for IE 11, Legacy Edge and legacy Safari
--- ### Renovate configuration :date: **Schedule**: "after 9am and before 3pm" (UTC). :vertical_traffic_light: **Automerge**: Disabled by config. Please merge this manually once you are satisfied. :recycle: **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. :no_bell: **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/nodejs-security-center). --- packages/google-cloud-securitycenter/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-securitycenter/package.json b/packages/google-cloud-securitycenter/package.json index 90411e2e9c2..c77d31919f6 100644 --- a/packages/google-cloud-securitycenter/package.json +++ b/packages/google-cloud-securitycenter/package.json @@ -59,7 +59,7 @@ "mocha": "^8.0.0", "null-loader": "^4.0.0", "pack-n-play": "^1.0.0-2", - "sinon": "^9.0.1", + "sinon": "^10.0.0", "ts-loader": "^8.0.0", "typescript": "^3.8.3", "@microsoft/api-documenter": "^7.8.10", From 0997dd7d7ea12cd7c03924525c6fb8759515c682 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 14 Apr 2021 23:10:21 +0200 Subject: [PATCH 242/342] chore(deps): update dependency @types/sinon to v10 (#365) [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [@types/sinon](https://togithub.com/DefinitelyTyped/DefinitelyTyped) | [`^9.0.0` -> `^10.0.0`](https://renovatebot.com/diffs/npm/@types%2fsinon/9.0.11/10.0.0) | [![age](https://badges.renovateapi.com/packages/npm/@types%2fsinon/10.0.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/@types%2fsinon/10.0.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/@types%2fsinon/10.0.0/compatibility-slim/9.0.11)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/@types%2fsinon/10.0.0/confidence-slim/9.0.11)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration :date: **Schedule**: "after 9am and before 3pm" (UTC). :vertical_traffic_light: **Automerge**: Disabled by config. Please merge this manually once you are satisfied. :recycle: **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. :no_bell: **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/nodejs-security-center). --- packages/google-cloud-securitycenter/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-securitycenter/package.json b/packages/google-cloud-securitycenter/package.json index c77d31919f6..5b4b137fe23 100644 --- a/packages/google-cloud-securitycenter/package.json +++ b/packages/google-cloud-securitycenter/package.json @@ -49,7 +49,7 @@ "devDependencies": { "@types/mocha": "^8.0.0", "@types/node": "^12.0.0", - "@types/sinon": "^9.0.0", + "@types/sinon": "^10.0.0", "c8": "^7.0.0", "gts": "^3.0.0", "jsdoc": "^3.6.2", From c972f76c8630b2325e53b9ad050a45380929c38a Mon Sep 17 00:00:00 2001 From: Jeffrey Rennie Date: Mon, 19 Apr 2021 17:40:07 -0700 Subject: [PATCH 243/342] chore: migrate to owl bot (#363) * chore: migrate to owl bot * chore: copy files from googleapis-gen fb91803ccef5d7c695139b22788b309e2197856b * chore: run the post processor --- .../.github/.OwlBot.yaml | 26 +++++++++ .../.repo-metadata.json | 17 +++--- .../google-cloud-securitycenter/owlbot.py | 20 +++++++ .../google-cloud-securitycenter/src/index.ts | 8 +-- .../synth.metadata | 55 ------------------- packages/google-cloud-securitycenter/synth.py | 44 --------------- 6 files changed, 59 insertions(+), 111 deletions(-) create mode 100644 packages/google-cloud-securitycenter/.github/.OwlBot.yaml create mode 100644 packages/google-cloud-securitycenter/owlbot.py delete mode 100644 packages/google-cloud-securitycenter/synth.metadata delete mode 100644 packages/google-cloud-securitycenter/synth.py diff --git a/packages/google-cloud-securitycenter/.github/.OwlBot.yaml b/packages/google-cloud-securitycenter/.github/.OwlBot.yaml new file mode 100644 index 00000000000..4b9917134e3 --- /dev/null +++ b/packages/google-cloud-securitycenter/.github/.OwlBot.yaml @@ -0,0 +1,26 @@ +# 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/repo-automation-bots/owlbot-nodejs:latest + + +deep-remove-regex: + - /owl-bot-staging + +deep-copy-regex: + - source: /google/cloud/securitycenter/(v.*)/.*-nodejs/(.*) + dest: /owl-bot-staging/$1/$2 + +begin-after-commit-hash: fb91803ccef5d7c695139b22788b309e2197856b + diff --git a/packages/google-cloud-securitycenter/.repo-metadata.json b/packages/google-cloud-securitycenter/.repo-metadata.json index 44f54d2dab8..951932aaedf 100644 --- a/packages/google-cloud-securitycenter/.repo-metadata.json +++ b/packages/google-cloud-securitycenter/.repo-metadata.json @@ -1,13 +1,14 @@ { - "name": "security-center", - "name_pretty": "Google Cloud Security Command Center", - "product_documentation": "https://cloud.google.com/security-command-center", - "client_documentation": "https://googleapis.dev/nodejs/security-center/latest", - "issue_tracker": "https://issuetracker.google.com/savedsearches/559748", - "release_level": "ga", "language": "nodejs", + "api_id": "securitycenter.googleapis.com", "repo": "googleapis/nodejs-security-center", + "release_level": "ga", "distribution_name": "@google-cloud/security-center", - "api_id": "securitycenter.googleapis.com", - "requires_billing": true + "default_version": "v1", + "name": "security-center", + "client_documentation": "https://googleapis.dev/nodejs/security-center/latest", + "requires_billing": true, + "name_pretty": "Google Cloud Security Command Center", + "issue_tracker": "https://issuetracker.google.com/savedsearches/559748", + "product_documentation": "https://cloud.google.com/security-command-center" } diff --git a/packages/google-cloud-securitycenter/owlbot.py b/packages/google-cloud-securitycenter/owlbot.py new file mode 100644 index 00000000000..c9485321fc1 --- /dev/null +++ b/packages/google-cloud-securitycenter/owlbot.py @@ -0,0 +1,20 @@ +# Copyright 2018 Google LLC +# +# Licensed under the Apache License, Version 2.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 synthtool.languages.node as node + +node.owlbot_main( + staging_excludes=['package.json', 'README.md'], + templates_excludes=['.kokoro/samples-test.sh', '.kokoro/samples-test.sh'] +) diff --git a/packages/google-cloud-securitycenter/src/index.ts b/packages/google-cloud-securitycenter/src/index.ts index 2f1843814ee..f0712e1a2de 100644 --- a/packages/google-cloud-securitycenter/src/index.ts +++ b/packages/google-cloud-securitycenter/src/index.ts @@ -16,14 +16,14 @@ // ** https://github.com/googleapis/synthtool ** // ** All changes to this file may be overwritten. ** -import * as v1 from './v1'; -import * as v1beta1 from './v1beta1'; import * as v1p1beta1 from './v1p1beta1'; +import * as v1beta1 from './v1beta1'; +import * as v1 from './v1'; const SecurityCenterClient = v1.SecurityCenterClient; type SecurityCenterClient = v1.SecurityCenterClient; -export {v1, v1beta1, v1p1beta1, SecurityCenterClient}; -export default {v1, v1beta1, v1p1beta1, SecurityCenterClient}; +export {v1p1beta1, v1beta1, v1, SecurityCenterClient}; +export default {v1p1beta1, v1beta1, v1, SecurityCenterClient}; import * as protos from '../protos/protos'; export {protos}; diff --git a/packages/google-cloud-securitycenter/synth.metadata b/packages/google-cloud-securitycenter/synth.metadata deleted file mode 100644 index 1f6b33e5559..00000000000 --- a/packages/google-cloud-securitycenter/synth.metadata +++ /dev/null @@ -1,55 +0,0 @@ -{ - "sources": [ - { - "git": { - "name": ".", - "remote": "https://github.com/googleapis/nodejs-security-center.git", - "sha": "fb1a8b32cd67c4b1327a031c949f676d01d3b24f" - } - }, - { - "git": { - "name": "googleapis", - "remote": "https://github.com/googleapis/googleapis.git", - "sha": "5477122b3e8037a1dc5bc920536158edbd151dc4", - "internalRef": "361273630" - } - }, - { - "git": { - "name": "synthtool", - "remote": "https://github.com/googleapis/synthtool.git", - "sha": "57c23fa5705499a4181095ced81f0ee0933b64f6" - } - } - ], - "destinations": [ - { - "client": { - "source": "googleapis", - "apiName": "securitycenter", - "apiVersion": "v1", - "language": "nodejs", - "generator": "bazel" - } - }, - { - "client": { - "source": "googleapis", - "apiName": "securitycenter", - "apiVersion": "v1beta1", - "language": "nodejs", - "generator": "bazel" - } - }, - { - "client": { - "source": "googleapis", - "apiName": "securitycenter", - "apiVersion": "v1p1beta1", - "language": "nodejs", - "generator": "bazel" - } - } - ] -} \ No newline at end of file diff --git a/packages/google-cloud-securitycenter/synth.py b/packages/google-cloud-securitycenter/synth.py deleted file mode 100644 index 6eda4071a6b..00000000000 --- a/packages/google-cloud-securitycenter/synth.py +++ /dev/null @@ -1,44 +0,0 @@ -# Copyright 2018 Google LLC -# -# Licensed under the Apache License, Version 2.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 synthtool as s -import synthtool.gcp as gcp -import synthtool.languages.node as node -import logging - -logging.basicConfig(level=logging.DEBUG) - -AUTOSYNTH_MULTIPLE_COMMITS = True - - -# Run the gapic generator -gapic = gcp.GAPICBazel() -versions = ['v1', 'v1beta1', 'v1p1beta1'] -name = 'securitycenter' -for version in versions: - library = gapic.node_library(name, version) - # skip index, protos, package.json, and README.md - s.copy( - library, - excludes=['package.json', 'README.md'] - ) - -# Copy common templates -common_templates = gcp.CommonTemplates() -templates = common_templates.node_library( - source_location='build/src', versions=versions, default_version='v1') -s.copy(templates, excludes=[ - '.kokoro/samples-test.sh', '.kokoro/samples-test.sh']) - -node.postprocess_gapic_library() From 55abd47978c27f3bb80cdeb0f7c5a17f55aa2839 Mon Sep 17 00:00:00 2001 From: Alexander Fenster Date: Thu, 6 May 2021 17:54:06 -0700 Subject: [PATCH 244/342] fix(deps): require google-gax v2.12.0 (#373) --- packages/google-cloud-securitycenter/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-securitycenter/package.json b/packages/google-cloud-securitycenter/package.json index 5b4b137fe23..a16f152c14a 100644 --- a/packages/google-cloud-securitycenter/package.json +++ b/packages/google-cloud-securitycenter/package.json @@ -44,7 +44,7 @@ "Security Command Center API" ], "dependencies": { - "google-gax": "^2.9.2" + "google-gax": "^2.12.0" }, "devDependencies": { "@types/mocha": "^8.0.0", From 3bb0617c59684184ebc98f7b98d39cfdd7027780 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Mon, 10 May 2021 17:00:42 +0000 Subject: [PATCH 245/342] chore: new owl bot post processor docker image (#375) gcr.io/repo-automation-bots/owlbot-nodejs:latest@sha256:f93bb861d6f12574437bb9aee426b71eafd63b419669ff0ed029f4b7e7162e3f --- .../protos/protos.d.ts | 18 +- .../protos/protos.js | 36 +- .../src/v1/security_center_client.ts | 356 +++++----- .../src/v1beta1/security_center_client.ts | 291 ++++----- .../src/v1p1beta1/security_center_client.ts | 356 +++++----- .../test/gapic_security_center_v1.ts | 602 +++++++++-------- .../test/gapic_security_center_v1beta1.ts | 446 +++++++------ .../test/gapic_security_center_v1p1beta1.ts | 614 +++++++++--------- 8 files changed, 1301 insertions(+), 1418 deletions(-) diff --git a/packages/google-cloud-securitycenter/protos/protos.d.ts b/packages/google-cloud-securitycenter/protos/protos.d.ts index 29e852acd7e..511510bc5dc 100644 --- a/packages/google-cloud-securitycenter/protos/protos.d.ts +++ b/packages/google-cloud-securitycenter/protos/protos.d.ts @@ -13975,19 +13975,19 @@ export namespace google { public selector: string; /** HttpRule get. */ - public get: string; + public get?: (string|null); /** HttpRule put. */ - public put: string; + public put?: (string|null); /** HttpRule post. */ - public post: string; + public post?: (string|null); /** HttpRule delete. */ - public delete: string; + public delete?: (string|null); /** HttpRule patch. */ - public patch: string; + public patch?: (string|null); /** HttpRule custom. */ public custom?: (google.api.ICustomHttpPattern|null); @@ -17675,16 +17675,16 @@ export namespace google { constructor(properties?: google.protobuf.IValue); /** Value nullValue. */ - public nullValue: (google.protobuf.NullValue|keyof typeof google.protobuf.NullValue); + public nullValue?: (google.protobuf.NullValue|keyof typeof google.protobuf.NullValue|null); /** Value numberValue. */ - public numberValue: number; + public numberValue?: (number|null); /** Value stringValue. */ - public stringValue: string; + public stringValue?: (string|null); /** Value boolValue. */ - public boolValue: boolean; + public boolValue?: (boolean|null); /** Value structValue. */ public structValue?: (google.protobuf.IStruct|null); diff --git a/packages/google-cloud-securitycenter/protos/protos.js b/packages/google-cloud-securitycenter/protos/protos.js index 80d55dd84b7..1170d0419e2 100644 --- a/packages/google-cloud-securitycenter/protos/protos.js +++ b/packages/google-cloud-securitycenter/protos/protos.js @@ -33090,43 +33090,43 @@ /** * HttpRule get. - * @member {string} get + * @member {string|null|undefined} get * @memberof google.api.HttpRule * @instance */ - HttpRule.prototype.get = ""; + HttpRule.prototype.get = null; /** * HttpRule put. - * @member {string} put + * @member {string|null|undefined} put * @memberof google.api.HttpRule * @instance */ - HttpRule.prototype.put = ""; + HttpRule.prototype.put = null; /** * HttpRule post. - * @member {string} post + * @member {string|null|undefined} post * @memberof google.api.HttpRule * @instance */ - HttpRule.prototype.post = ""; + HttpRule.prototype.post = null; /** * HttpRule delete. - * @member {string} delete + * @member {string|null|undefined} delete * @memberof google.api.HttpRule * @instance */ - HttpRule.prototype["delete"] = ""; + HttpRule.prototype["delete"] = null; /** * HttpRule patch. - * @member {string} patch + * @member {string|null|undefined} patch * @memberof google.api.HttpRule * @instance */ - HttpRule.prototype.patch = ""; + HttpRule.prototype.patch = null; /** * HttpRule custom. @@ -43357,35 +43357,35 @@ /** * Value nullValue. - * @member {google.protobuf.NullValue} nullValue + * @member {google.protobuf.NullValue|null|undefined} nullValue * @memberof google.protobuf.Value * @instance */ - Value.prototype.nullValue = 0; + Value.prototype.nullValue = null; /** * Value numberValue. - * @member {number} numberValue + * @member {number|null|undefined} numberValue * @memberof google.protobuf.Value * @instance */ - Value.prototype.numberValue = 0; + Value.prototype.numberValue = null; /** * Value stringValue. - * @member {string} stringValue + * @member {string|null|undefined} stringValue * @memberof google.protobuf.Value * @instance */ - Value.prototype.stringValue = ""; + Value.prototype.stringValue = null; /** * Value boolValue. - * @member {boolean} boolValue + * @member {boolean|null|undefined} boolValue * @memberof google.protobuf.Value * @instance */ - Value.prototype.boolValue = false; + Value.prototype.boolValue = null; /** * Value structValue. diff --git a/packages/google-cloud-securitycenter/src/v1/security_center_client.ts b/packages/google-cloud-securitycenter/src/v1/security_center_client.ts index 7b7a1097b4c..4d49f05bcfc 100644 --- a/packages/google-cloud-securitycenter/src/v1/security_center_client.ts +++ b/packages/google-cloud-securitycenter/src/v1/security_center_client.ts @@ -180,15 +180,17 @@ export class SecurityCenterClient { organizationPathTemplate: new this._gaxModule.PathTemplate( 'organizations/{organization}' ), - organizationAssetSecurityMarksPathTemplate: new this._gaxModule.PathTemplate( - 'organizations/{organization}/assets/{asset}/securityMarks' - ), + organizationAssetSecurityMarksPathTemplate: + new this._gaxModule.PathTemplate( + 'organizations/{organization}/assets/{asset}/securityMarks' + ), organizationSettingsPathTemplate: new this._gaxModule.PathTemplate( 'organizations/{organization}/organizationSettings' ), - organizationSourceFindingSecurityMarksPathTemplate: new this._gaxModule.PathTemplate( - 'organizations/{organization}/sources/{source}/findings/{finding}/securityMarks' - ), + organizationSourceFindingSecurityMarksPathTemplate: + new this._gaxModule.PathTemplate( + 'organizations/{organization}/sources/{source}/findings/{finding}/securityMarks' + ), sourcePathTemplate: new this._gaxModule.PathTemplate( 'organizations/{organization}/sources/{source}' ), @@ -333,13 +335,14 @@ export class SecurityCenterClient { ]; for (const methodName of securityCenterStubMethods) { const callPromise = this.securityCenterStub.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); - }, + 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; } @@ -502,11 +505,10 @@ export class SecurityCenterClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); this.initialize(); return this.innerApiCalls.createSource(request, options, callback); } @@ -603,11 +605,10 @@ export class SecurityCenterClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); this.initialize(); return this.innerApiCalls.createFinding(request, options, callback); } @@ -710,11 +711,10 @@ export class SecurityCenterClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); this.initialize(); return this.innerApiCalls.createNotificationConfig( request, @@ -813,11 +813,10 @@ export class SecurityCenterClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - name: request.name || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + name: request.name || '', + }); this.initialize(); return this.innerApiCalls.deleteNotificationConfig( request, @@ -905,11 +904,10 @@ export class SecurityCenterClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - resource: request.resource || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + resource: request.resource || '', + }); this.initialize(); return this.innerApiCalls.getIamPolicy(request, options, callback); } @@ -1004,11 +1002,10 @@ export class SecurityCenterClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - name: request.name || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + name: request.name || '', + }); this.initialize(); return this.innerApiCalls.getNotificationConfig(request, options, callback); } @@ -1103,11 +1100,10 @@ export class SecurityCenterClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - name: request.name || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + name: request.name || '', + }); this.initialize(); return this.innerApiCalls.getOrganizationSettings( request, @@ -1200,11 +1196,10 @@ export class SecurityCenterClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - name: request.name || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + name: request.name || '', + }); this.initialize(); return this.innerApiCalls.getSource(request, options, callback); } @@ -1299,11 +1294,10 @@ export class SecurityCenterClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - name: request.name || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + name: request.name || '', + }); this.initialize(); return this.innerApiCalls.setFindingState(request, options, callback); } @@ -1389,11 +1383,10 @@ export class SecurityCenterClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - resource: request.resource || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + resource: request.resource || '', + }); this.initialize(); return this.innerApiCalls.setIamPolicy(request, options, callback); } @@ -1479,11 +1472,10 @@ export class SecurityCenterClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - resource: request.resource || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + resource: request.resource || '', + }); this.initialize(); return this.innerApiCalls.testIamPermissions(request, options, callback); } @@ -1585,11 +1577,10 @@ export class SecurityCenterClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'finding.name': request.finding!.name || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + 'finding.name': request.finding!.name || '', + }); this.initialize(); return this.innerApiCalls.updateFinding(request, options, callback); } @@ -1688,11 +1679,10 @@ export class SecurityCenterClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'notification_config.name': request.notificationConfig!.name || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + 'notification_config.name': request.notificationConfig!.name || '', + }); this.initialize(); return this.innerApiCalls.updateNotificationConfig( request, @@ -1794,11 +1784,10 @@ export class SecurityCenterClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'organization_settings.name': request.organizationSettings!.name || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + 'organization_settings.name': request.organizationSettings!.name || '', + }); this.initialize(); return this.innerApiCalls.updateOrganizationSettings( request, @@ -1894,11 +1883,10 @@ export class SecurityCenterClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'source.name': request.source!.name || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + 'source.name': request.source!.name || '', + }); this.initialize(); return this.innerApiCalls.updateSource(request, options, callback); } @@ -2002,11 +1990,10 @@ export class SecurityCenterClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'security_marks.name': request.securityMarks!.name || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + 'security_marks.name': request.securityMarks!.name || '', + }); this.initialize(); return this.innerApiCalls.updateSecurityMarks(request, options, callback); } @@ -2114,11 +2101,10 @@ export class SecurityCenterClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); this.initialize(); return this.innerApiCalls.runAssetDiscovery(request, options, callback); } @@ -2370,11 +2356,10 @@ export class SecurityCenterClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); this.initialize(); return this.innerApiCalls.groupAssets(request, options, callback); } @@ -2528,11 +2513,10 @@ export class SecurityCenterClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); const callSettings = new gax.CallSettings(options); this.initialize(); return this.descriptors.page.groupAssets.createStream( @@ -2697,17 +2681,16 @@ export class SecurityCenterClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); options = options || {}; const callSettings = new gax.CallSettings(options); this.initialize(); return this.descriptors.page.groupAssets.asyncIterate( this.innerApiCalls['groupAssets'] as GaxCall, - (request as unknown) as RequestType, + request as unknown as RequestType, callSettings ) as AsyncIterable; } @@ -2917,11 +2900,10 @@ export class SecurityCenterClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); this.initialize(); return this.innerApiCalls.groupFindings(request, options, callback); } @@ -3067,11 +3049,10 @@ export class SecurityCenterClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); const callSettings = new gax.CallSettings(options); this.initialize(); return this.descriptors.page.groupFindings.createStream( @@ -3228,17 +3209,16 @@ export class SecurityCenterClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); options = options || {}; const callSettings = new gax.CallSettings(options); this.initialize(); return this.descriptors.page.groupFindings.asyncIterate( this.innerApiCalls['groupFindings'] as GaxCall, - (request as unknown) as RequestType, + request as unknown as RequestType, callSettings ) as AsyncIterable; } @@ -3456,11 +3436,10 @@ export class SecurityCenterClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); this.initialize(); return this.innerApiCalls.listAssets(request, options, callback); } @@ -3618,11 +3597,10 @@ export class SecurityCenterClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); const callSettings = new gax.CallSettings(options); this.initialize(); return this.descriptors.page.listAssets.createStream( @@ -3791,17 +3769,16 @@ export class SecurityCenterClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); options = options || {}; const callSettings = new gax.CallSettings(options); this.initialize(); return this.descriptors.page.listAssets.asyncIterate( this.innerApiCalls['listAssets'] as GaxCall, - (request as unknown) as RequestType, + request as unknown as RequestType, callSettings ) as AsyncIterable; } @@ -4014,11 +3991,10 @@ export class SecurityCenterClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); this.initialize(); return this.innerApiCalls.listFindings(request, options, callback); } @@ -4168,11 +4144,10 @@ export class SecurityCenterClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); const callSettings = new gax.CallSettings(options); this.initialize(); return this.descriptors.page.listFindings.createStream( @@ -4333,17 +4308,16 @@ export class SecurityCenterClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); options = options || {}; const callSettings = new gax.CallSettings(options); this.initialize(); return this.descriptors.page.listFindings.asyncIterate( this.innerApiCalls['listFindings'] as GaxCall, - (request as unknown) as RequestType, + request as unknown as RequestType, callSettings ) as AsyncIterable; } @@ -4442,11 +4416,10 @@ export class SecurityCenterClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); this.initialize(); return this.innerApiCalls.listNotificationConfigs( request, @@ -4489,11 +4462,10 @@ export class SecurityCenterClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); const callSettings = new gax.CallSettings(options); this.initialize(); return this.descriptors.page.listNotificationConfigs.createStream( @@ -4543,17 +4515,16 @@ export class SecurityCenterClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); options = options || {}; const callSettings = new gax.CallSettings(options); this.initialize(); return this.descriptors.page.listNotificationConfigs.asyncIterate( this.innerApiCalls['listNotificationConfigs'] as GaxCall, - (request as unknown) as RequestType, + request as unknown as RequestType, callSettings ) as AsyncIterable; } @@ -4652,11 +4623,10 @@ export class SecurityCenterClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); this.initialize(); return this.innerApiCalls.listSources(request, options, callback); } @@ -4695,11 +4665,10 @@ export class SecurityCenterClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); const callSettings = new gax.CallSettings(options); this.initialize(); return this.descriptors.page.listSources.createStream( @@ -4749,17 +4718,16 @@ export class SecurityCenterClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); options = options || {}; const callSettings = new gax.CallSettings(options); this.initialize(); return this.descriptors.page.listSources.asyncIterate( this.innerApiCalls['listSources'] as GaxCall, - (request as unknown) as RequestType, + request as unknown as RequestType, callSettings ) as AsyncIterable; } diff --git a/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.ts b/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.ts index 7ee873d4f5a..dc0e631cfd6 100644 --- a/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.ts +++ b/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.ts @@ -177,15 +177,17 @@ export class SecurityCenterClient { organizationPathTemplate: new this._gaxModule.PathTemplate( 'organizations/{organization}' ), - organizationAssetSecurityMarksPathTemplate: new this._gaxModule.PathTemplate( - 'organizations/{organization}/assets/{asset}/securityMarks' - ), + organizationAssetSecurityMarksPathTemplate: + new this._gaxModule.PathTemplate( + 'organizations/{organization}/assets/{asset}/securityMarks' + ), organizationSettingsPathTemplate: new this._gaxModule.PathTemplate( 'organizations/{organization}/organizationSettings' ), - organizationSourceFindingSecurityMarksPathTemplate: new this._gaxModule.PathTemplate( - 'organizations/{organization}/sources/{source}/findings/{finding}/securityMarks' - ), + organizationSourceFindingSecurityMarksPathTemplate: + new this._gaxModule.PathTemplate( + 'organizations/{organization}/sources/{source}/findings/{finding}/securityMarks' + ), sourcePathTemplate: new this._gaxModule.PathTemplate( 'organizations/{organization}/sources/{source}' ), @@ -321,13 +323,14 @@ export class SecurityCenterClient { ]; for (const methodName of securityCenterStubMethods) { const callPromise = this.securityCenterStub.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); - }, + 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; } @@ -496,11 +499,10 @@ export class SecurityCenterClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); this.initialize(); return this.innerApiCalls.createSource(request, options, callback); } @@ -603,11 +605,10 @@ export class SecurityCenterClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); this.initialize(); return this.innerApiCalls.createFinding(request, options, callback); } @@ -691,11 +692,10 @@ export class SecurityCenterClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - resource: request.resource || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + resource: request.resource || '', + }); this.initialize(); return this.innerApiCalls.getIamPolicy(request, options, callback); } @@ -790,11 +790,10 @@ export class SecurityCenterClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - name: request.name || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + name: request.name || '', + }); this.initialize(); return this.innerApiCalls.getOrganizationSettings( request, @@ -887,11 +886,10 @@ export class SecurityCenterClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - name: request.name || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + name: request.name || '', + }); this.initialize(); return this.innerApiCalls.getSource(request, options, callback); } @@ -992,11 +990,10 @@ export class SecurityCenterClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - name: request.name || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + name: request.name || '', + }); this.initialize(); return this.innerApiCalls.setFindingState(request, options, callback); } @@ -1082,11 +1079,10 @@ export class SecurityCenterClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - resource: request.resource || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + resource: request.resource || '', + }); this.initialize(); return this.innerApiCalls.setIamPolicy(request, options, callback); } @@ -1172,11 +1168,10 @@ export class SecurityCenterClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - resource: request.resource || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + resource: request.resource || '', + }); this.initialize(); return this.innerApiCalls.testIamPermissions(request, options, callback); } @@ -1279,11 +1274,10 @@ export class SecurityCenterClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'finding.name': request.finding!.name || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + 'finding.name': request.finding!.name || '', + }); this.initialize(); return this.innerApiCalls.updateFinding(request, options, callback); } @@ -1379,11 +1373,10 @@ export class SecurityCenterClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'organization_settings.name': request.organizationSettings!.name || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + 'organization_settings.name': request.organizationSettings!.name || '', + }); this.initialize(); return this.innerApiCalls.updateOrganizationSettings( request, @@ -1483,11 +1476,10 @@ export class SecurityCenterClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'source.name': request.source!.name || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + 'source.name': request.source!.name || '', + }); this.initialize(); return this.innerApiCalls.updateSource(request, options, callback); } @@ -1585,11 +1577,10 @@ export class SecurityCenterClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'security_marks.name': request.securityMarks!.name || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + 'security_marks.name': request.securityMarks!.name || '', + }); this.initialize(); return this.innerApiCalls.updateSecurityMarks(request, options, callback); } @@ -1682,11 +1673,10 @@ export class SecurityCenterClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); this.initialize(); return this.innerApiCalls.runAssetDiscovery(request, options, callback); } @@ -1890,11 +1880,10 @@ export class SecurityCenterClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); this.initialize(); return this.innerApiCalls.groupAssets(request, options, callback); } @@ -2003,11 +1992,10 @@ export class SecurityCenterClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); const callSettings = new gax.CallSettings(options); this.initialize(); return this.descriptors.page.groupAssets.createStream( @@ -2127,17 +2115,16 @@ export class SecurityCenterClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); options = options || {}; const callSettings = new gax.CallSettings(options); this.initialize(); return this.descriptors.page.groupAssets.asyncIterate( this.innerApiCalls['groupAssets'] as GaxCall, - (request as unknown) as RequestType, + request as unknown as RequestType, callSettings ) as AsyncIterable; } @@ -2285,11 +2272,10 @@ export class SecurityCenterClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); this.initialize(); return this.innerApiCalls.groupFindings(request, options, callback); } @@ -2373,11 +2359,10 @@ export class SecurityCenterClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); const callSettings = new gax.CallSettings(options); this.initialize(); return this.descriptors.page.groupFindings.createStream( @@ -2472,17 +2457,16 @@ export class SecurityCenterClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); options = options || {}; const callSettings = new gax.CallSettings(options); this.initialize(); return this.descriptors.page.groupFindings.asyncIterate( this.innerApiCalls['groupFindings'] as GaxCall, - (request as unknown) as RequestType, + request as unknown as RequestType, callSettings ) as AsyncIterable; } @@ -2651,11 +2635,10 @@ export class SecurityCenterClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); this.initialize(); return this.innerApiCalls.listAssets(request, options, callback); } @@ -2764,11 +2747,10 @@ export class SecurityCenterClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); const callSettings = new gax.CallSettings(options); this.initialize(); return this.descriptors.page.listAssets.createStream( @@ -2888,17 +2870,16 @@ export class SecurityCenterClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); options = options || {}; const callSettings = new gax.CallSettings(options); this.initialize(); return this.descriptors.page.listAssets.asyncIterate( this.innerApiCalls['listAssets'] as GaxCall, - (request as unknown) as RequestType, + request as unknown as RequestType, callSettings ) as AsyncIterable; } @@ -3045,11 +3026,10 @@ export class SecurityCenterClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); this.initialize(); return this.innerApiCalls.listFindings(request, options, callback); } @@ -3133,11 +3113,10 @@ export class SecurityCenterClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); const callSettings = new gax.CallSettings(options); this.initialize(); return this.descriptors.page.listFindings.createStream( @@ -3232,17 +3211,16 @@ export class SecurityCenterClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); options = options || {}; const callSettings = new gax.CallSettings(options); this.initialize(); return this.descriptors.page.listFindings.asyncIterate( this.innerApiCalls['listFindings'] as GaxCall, - (request as unknown) as RequestType, + request as unknown as RequestType, callSettings ) as AsyncIterable; } @@ -3341,11 +3319,10 @@ export class SecurityCenterClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); this.initialize(); return this.innerApiCalls.listSources(request, options, callback); } @@ -3384,11 +3361,10 @@ export class SecurityCenterClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); const callSettings = new gax.CallSettings(options); this.initialize(); return this.descriptors.page.listSources.createStream( @@ -3438,17 +3414,16 @@ export class SecurityCenterClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); options = options || {}; const callSettings = new gax.CallSettings(options); this.initialize(); return this.descriptors.page.listSources.asyncIterate( this.innerApiCalls['listSources'] as GaxCall, - (request as unknown) as RequestType, + request as unknown as RequestType, callSettings ) as AsyncIterable; } diff --git a/packages/google-cloud-securitycenter/src/v1p1beta1/security_center_client.ts b/packages/google-cloud-securitycenter/src/v1p1beta1/security_center_client.ts index ca13ea15426..6c143cf29b3 100644 --- a/packages/google-cloud-securitycenter/src/v1p1beta1/security_center_client.ts +++ b/packages/google-cloud-securitycenter/src/v1p1beta1/security_center_client.ts @@ -180,15 +180,17 @@ export class SecurityCenterClient { organizationPathTemplate: new this._gaxModule.PathTemplate( 'organizations/{organization}' ), - organizationAssetSecurityMarksPathTemplate: new this._gaxModule.PathTemplate( - 'organizations/{organization}/assets/{asset}/securityMarks' - ), + organizationAssetSecurityMarksPathTemplate: + new this._gaxModule.PathTemplate( + 'organizations/{organization}/assets/{asset}/securityMarks' + ), organizationSettingsPathTemplate: new this._gaxModule.PathTemplate( 'organizations/{organization}/organizationSettings' ), - organizationSourceFindingSecurityMarksPathTemplate: new this._gaxModule.PathTemplate( - 'organizations/{organization}/sources/{source}/findings/{finding}/securityMarks' - ), + organizationSourceFindingSecurityMarksPathTemplate: + new this._gaxModule.PathTemplate( + 'organizations/{organization}/sources/{source}/findings/{finding}/securityMarks' + ), sourcePathTemplate: new this._gaxModule.PathTemplate( 'organizations/{organization}/sources/{source}' ), @@ -334,13 +336,14 @@ export class SecurityCenterClient { ]; for (const methodName of securityCenterStubMethods) { const callPromise = this.securityCenterStub.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); - }, + 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; } @@ -509,11 +512,10 @@ export class SecurityCenterClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); this.initialize(); return this.innerApiCalls.createSource(request, options, callback); } @@ -614,11 +616,10 @@ export class SecurityCenterClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); this.initialize(); return this.innerApiCalls.createFinding(request, options, callback); } @@ -720,11 +721,10 @@ export class SecurityCenterClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); this.initialize(); return this.innerApiCalls.createNotificationConfig( request, @@ -823,11 +823,10 @@ export class SecurityCenterClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - name: request.name || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + name: request.name || '', + }); this.initialize(); return this.innerApiCalls.deleteNotificationConfig( request, @@ -915,11 +914,10 @@ export class SecurityCenterClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - resource: request.resource || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + resource: request.resource || '', + }); this.initialize(); return this.innerApiCalls.getIamPolicy(request, options, callback); } @@ -1014,11 +1012,10 @@ export class SecurityCenterClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - name: request.name || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + name: request.name || '', + }); this.initialize(); return this.innerApiCalls.getNotificationConfig(request, options, callback); } @@ -1113,11 +1110,10 @@ export class SecurityCenterClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - name: request.name || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + name: request.name || '', + }); this.initialize(); return this.innerApiCalls.getOrganizationSettings( request, @@ -1216,11 +1212,10 @@ export class SecurityCenterClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - name: request.name || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + name: request.name || '', + }); this.initialize(); return this.innerApiCalls.getSource(request, options, callback); } @@ -1321,11 +1316,10 @@ export class SecurityCenterClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - name: request.name || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + name: request.name || '', + }); this.initialize(); return this.innerApiCalls.setFindingState(request, options, callback); } @@ -1411,11 +1405,10 @@ export class SecurityCenterClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - resource: request.resource || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + resource: request.resource || '', + }); this.initialize(); return this.innerApiCalls.setIamPolicy(request, options, callback); } @@ -1501,11 +1494,10 @@ export class SecurityCenterClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - resource: request.resource || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + resource: request.resource || '', + }); this.initialize(); return this.innerApiCalls.testIamPermissions(request, options, callback); } @@ -1613,11 +1605,10 @@ export class SecurityCenterClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'finding.name': request.finding!.name || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + 'finding.name': request.finding!.name || '', + }); this.initialize(); return this.innerApiCalls.updateFinding(request, options, callback); } @@ -1716,11 +1707,10 @@ export class SecurityCenterClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'notification_config.name': request.notificationConfig!.name || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + 'notification_config.name': request.notificationConfig!.name || '', + }); this.initialize(); return this.innerApiCalls.updateNotificationConfig( request, @@ -1822,11 +1812,10 @@ export class SecurityCenterClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'organization_settings.name': request.organizationSettings!.name || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + 'organization_settings.name': request.organizationSettings!.name || '', + }); this.initialize(); return this.innerApiCalls.updateOrganizationSettings( request, @@ -1928,11 +1917,10 @@ export class SecurityCenterClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'source.name': request.source!.name || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + 'source.name': request.source!.name || '', + }); this.initialize(); return this.innerApiCalls.updateSource(request, options, callback); } @@ -2036,11 +2024,10 @@ export class SecurityCenterClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'security_marks.name': request.securityMarks!.name || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + 'security_marks.name': request.securityMarks!.name || '', + }); this.initialize(); return this.innerApiCalls.updateSecurityMarks(request, options, callback); } @@ -2148,11 +2135,10 @@ export class SecurityCenterClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); this.initialize(); return this.innerApiCalls.runAssetDiscovery(request, options, callback); } @@ -2404,11 +2390,10 @@ export class SecurityCenterClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); this.initialize(); return this.innerApiCalls.groupAssets(request, options, callback); } @@ -2562,11 +2547,10 @@ export class SecurityCenterClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); const callSettings = new gax.CallSettings(options); this.initialize(); return this.descriptors.page.groupAssets.createStream( @@ -2731,17 +2715,16 @@ export class SecurityCenterClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); options = options || {}; const callSettings = new gax.CallSettings(options); this.initialize(); return this.descriptors.page.groupAssets.asyncIterate( this.innerApiCalls['groupAssets'] as GaxCall, - (request as unknown) as RequestType, + request as unknown as RequestType, callSettings ) as AsyncIterable; } @@ -2951,11 +2934,10 @@ export class SecurityCenterClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); this.initialize(); return this.innerApiCalls.groupFindings(request, options, callback); } @@ -3101,11 +3083,10 @@ export class SecurityCenterClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); const callSettings = new gax.CallSettings(options); this.initialize(); return this.descriptors.page.groupFindings.createStream( @@ -3262,17 +3243,16 @@ export class SecurityCenterClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); options = options || {}; const callSettings = new gax.CallSettings(options); this.initialize(); return this.descriptors.page.groupFindings.asyncIterate( this.innerApiCalls['groupFindings'] as GaxCall, - (request as unknown) as RequestType, + request as unknown as RequestType, callSettings ) as AsyncIterable; } @@ -3490,11 +3470,10 @@ export class SecurityCenterClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); this.initialize(); return this.innerApiCalls.listAssets(request, options, callback); } @@ -3652,11 +3631,10 @@ export class SecurityCenterClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); const callSettings = new gax.CallSettings(options); this.initialize(); return this.descriptors.page.listAssets.createStream( @@ -3825,17 +3803,16 @@ export class SecurityCenterClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); options = options || {}; const callSettings = new gax.CallSettings(options); this.initialize(); return this.descriptors.page.listAssets.asyncIterate( this.innerApiCalls['listAssets'] as GaxCall, - (request as unknown) as RequestType, + request as unknown as RequestType, callSettings ) as AsyncIterable; } @@ -4048,11 +4025,10 @@ export class SecurityCenterClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); this.initialize(); return this.innerApiCalls.listFindings(request, options, callback); } @@ -4202,11 +4178,10 @@ export class SecurityCenterClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); const callSettings = new gax.CallSettings(options); this.initialize(); return this.descriptors.page.listFindings.createStream( @@ -4367,17 +4342,16 @@ export class SecurityCenterClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); options = options || {}; const callSettings = new gax.CallSettings(options); this.initialize(); return this.descriptors.page.listFindings.asyncIterate( this.innerApiCalls['listFindings'] as GaxCall, - (request as unknown) as RequestType, + request as unknown as RequestType, callSettings ) as AsyncIterable; } @@ -4476,11 +4450,10 @@ export class SecurityCenterClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); this.initialize(); return this.innerApiCalls.listNotificationConfigs( request, @@ -4523,11 +4496,10 @@ export class SecurityCenterClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); const callSettings = new gax.CallSettings(options); this.initialize(); return this.descriptors.page.listNotificationConfigs.createStream( @@ -4577,17 +4549,16 @@ export class SecurityCenterClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); options = options || {}; const callSettings = new gax.CallSettings(options); this.initialize(); return this.descriptors.page.listNotificationConfigs.asyncIterate( this.innerApiCalls['listNotificationConfigs'] as GaxCall, - (request as unknown) as RequestType, + request as unknown as RequestType, callSettings ) as AsyncIterable; } @@ -4686,11 +4657,10 @@ export class SecurityCenterClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); this.initialize(); return this.innerApiCalls.listSources(request, options, callback); } @@ -4729,11 +4699,10 @@ export class SecurityCenterClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); const callSettings = new gax.CallSettings(options); this.initialize(); return this.descriptors.page.listSources.createStream( @@ -4783,17 +4752,16 @@ export class SecurityCenterClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); options = options || {}; const callSettings = new gax.CallSettings(options); this.initialize(); return this.descriptors.page.listSources.asyncIterate( this.innerApiCalls['listSources'] as GaxCall, - (request as unknown) as RequestType, + request as unknown as RequestType, callSettings ) as AsyncIterable; } diff --git a/packages/google-cloud-securitycenter/test/gapic_security_center_v1.ts b/packages/google-cloud-securitycenter/test/gapic_security_center_v1.ts index ba64fd58371..73a8a1594ab 100644 --- a/packages/google-cloud-securitycenter/test/gapic_security_center_v1.ts +++ b/packages/google-cloud-securitycenter/test/gapic_security_center_v1.ts @@ -28,10 +28,9 @@ import {PassThrough} from 'stream'; import {protobuf, LROperation, operationsProtos} from 'google-gax'; function generateSampleMessage(instance: T) { - const filledObject = (instance.constructor as typeof protobuf.Message).toObject( - instance as protobuf.Message, - {defaults: true} - ); + 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; @@ -281,9 +280,8 @@ describe('v1.SecurityCenterClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.securitycenter.v1.Source() ); - client.innerApiCalls.createSource = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.createSource = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.createSource( request, @@ -393,9 +391,8 @@ describe('v1.SecurityCenterClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.securitycenter.v1.Finding() ); - client.innerApiCalls.createFinding = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.createFinding = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.createFinding( request, @@ -474,9 +471,8 @@ describe('v1.SecurityCenterClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.securitycenter.v1.NotificationConfig() ); - client.innerApiCalls.createNotificationConfig = stubSimpleCall( - expectedResponse - ); + client.innerApiCalls.createNotificationConfig = + stubSimpleCall(expectedResponse); const [response] = await client.createNotificationConfig(request); assert.deepStrictEqual(response, expectedResponse); assert( @@ -507,9 +503,8 @@ describe('v1.SecurityCenterClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.securitycenter.v1.NotificationConfig() ); - client.innerApiCalls.createNotificationConfig = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.createNotificationConfig = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.createNotificationConfig( request, @@ -591,9 +586,8 @@ describe('v1.SecurityCenterClient', () => { const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); - client.innerApiCalls.deleteNotificationConfig = stubSimpleCall( - expectedResponse - ); + client.innerApiCalls.deleteNotificationConfig = + stubSimpleCall(expectedResponse); const [response] = await client.deleteNotificationConfig(request); assert.deepStrictEqual(response, expectedResponse); assert( @@ -624,9 +618,8 @@ describe('v1.SecurityCenterClient', () => { const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); - client.innerApiCalls.deleteNotificationConfig = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.deleteNotificationConfig = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.deleteNotificationConfig( request, @@ -739,9 +732,8 @@ describe('v1.SecurityCenterClient', () => { const expectedResponse = generateSampleMessage( new protos.google.iam.v1.Policy() ); - client.innerApiCalls.getIamPolicy = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.getIamPolicy = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.getIamPolicy( request, @@ -820,9 +812,8 @@ describe('v1.SecurityCenterClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.securitycenter.v1.NotificationConfig() ); - client.innerApiCalls.getNotificationConfig = stubSimpleCall( - expectedResponse - ); + client.innerApiCalls.getNotificationConfig = + stubSimpleCall(expectedResponse); const [response] = await client.getNotificationConfig(request); assert.deepStrictEqual(response, expectedResponse); assert( @@ -853,9 +844,8 @@ describe('v1.SecurityCenterClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.securitycenter.v1.NotificationConfig() ); - client.innerApiCalls.getNotificationConfig = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.getNotificationConfig = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.getNotificationConfig( request, @@ -937,9 +927,8 @@ describe('v1.SecurityCenterClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.securitycenter.v1.OrganizationSettings() ); - client.innerApiCalls.getOrganizationSettings = stubSimpleCall( - expectedResponse - ); + client.innerApiCalls.getOrganizationSettings = + stubSimpleCall(expectedResponse); const [response] = await client.getOrganizationSettings(request); assert.deepStrictEqual(response, expectedResponse); assert( @@ -970,9 +959,8 @@ describe('v1.SecurityCenterClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.securitycenter.v1.OrganizationSettings() ); - client.innerApiCalls.getOrganizationSettings = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.getOrganizationSettings = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.getOrganizationSettings( request, @@ -1085,9 +1073,8 @@ describe('v1.SecurityCenterClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.securitycenter.v1.Source() ); - client.innerApiCalls.getSource = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.getSource = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.getSource( request, @@ -1194,9 +1181,8 @@ describe('v1.SecurityCenterClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.securitycenter.v1.Finding() ); - client.innerApiCalls.setFindingState = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.setFindingState = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.setFindingState( request, @@ -1306,9 +1292,8 @@ describe('v1.SecurityCenterClient', () => { const expectedResponse = generateSampleMessage( new protos.google.iam.v1.Policy() ); - client.innerApiCalls.setIamPolicy = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.setIamPolicy = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.setIamPolicy( request, @@ -1387,9 +1372,8 @@ describe('v1.SecurityCenterClient', () => { const expectedResponse = generateSampleMessage( new protos.google.iam.v1.TestIamPermissionsResponse() ); - client.innerApiCalls.testIamPermissions = stubSimpleCall( - expectedResponse - ); + client.innerApiCalls.testIamPermissions = + stubSimpleCall(expectedResponse); const [response] = await client.testIamPermissions(request); assert.deepStrictEqual(response, expectedResponse); assert( @@ -1420,9 +1404,8 @@ describe('v1.SecurityCenterClient', () => { const expectedResponse = generateSampleMessage( new protos.google.iam.v1.TestIamPermissionsResponse() ); - client.innerApiCalls.testIamPermissions = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.testIamPermissions = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.testIamPermissions( request, @@ -1534,9 +1517,8 @@ describe('v1.SecurityCenterClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.securitycenter.v1.Finding() ); - client.innerApiCalls.updateFinding = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.updateFinding = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.updateFinding( request, @@ -1617,9 +1599,8 @@ describe('v1.SecurityCenterClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.securitycenter.v1.NotificationConfig() ); - client.innerApiCalls.updateNotificationConfig = stubSimpleCall( - expectedResponse - ); + client.innerApiCalls.updateNotificationConfig = + stubSimpleCall(expectedResponse); const [response] = await client.updateNotificationConfig(request); assert.deepStrictEqual(response, expectedResponse); assert( @@ -1651,9 +1632,8 @@ describe('v1.SecurityCenterClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.securitycenter.v1.NotificationConfig() ); - client.innerApiCalls.updateNotificationConfig = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.updateNotificationConfig = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.updateNotificationConfig( request, @@ -1737,9 +1717,8 @@ describe('v1.SecurityCenterClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.securitycenter.v1.OrganizationSettings() ); - client.innerApiCalls.updateOrganizationSettings = stubSimpleCall( - expectedResponse - ); + client.innerApiCalls.updateOrganizationSettings = + stubSimpleCall(expectedResponse); const [response] = await client.updateOrganizationSettings(request); assert.deepStrictEqual(response, expectedResponse); assert( @@ -1771,9 +1750,8 @@ describe('v1.SecurityCenterClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.securitycenter.v1.OrganizationSettings() ); - client.innerApiCalls.updateOrganizationSettings = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.updateOrganizationSettings = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.updateOrganizationSettings( request, @@ -1889,9 +1867,8 @@ describe('v1.SecurityCenterClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.securitycenter.v1.Source() ); - client.innerApiCalls.updateSource = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.updateSource = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.updateSource( request, @@ -1972,9 +1949,8 @@ describe('v1.SecurityCenterClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.securitycenter.v1.SecurityMarks() ); - client.innerApiCalls.updateSecurityMarks = stubSimpleCall( - expectedResponse - ); + client.innerApiCalls.updateSecurityMarks = + stubSimpleCall(expectedResponse); const [response] = await client.updateSecurityMarks(request); assert.deepStrictEqual(response, expectedResponse); assert( @@ -2006,9 +1982,8 @@ describe('v1.SecurityCenterClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.securitycenter.v1.SecurityMarks() ); - client.innerApiCalls.updateSecurityMarks = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.updateSecurityMarks = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.updateSecurityMarks( request, @@ -2088,9 +2063,8 @@ describe('v1.SecurityCenterClient', () => { const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.runAssetDiscovery = stubLongRunningCall( - expectedResponse - ); + client.innerApiCalls.runAssetDiscovery = + stubLongRunningCall(expectedResponse); const [operation] = await client.runAssetDiscovery(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); @@ -2122,9 +2096,8 @@ describe('v1.SecurityCenterClient', () => { const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.runAssetDiscovery = stubLongRunningCallWithCallback( - expectedResponse - ); + client.innerApiCalls.runAssetDiscovery = + stubLongRunningCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.runAssetDiscovery( request, @@ -2331,9 +2304,8 @@ describe('v1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1.GroupResult() ), ]; - client.innerApiCalls.groupAssets = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.groupAssets = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.groupAssets( request, @@ -2411,12 +2383,12 @@ describe('v1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1.GroupResult() ), ]; - client.descriptors.page.groupAssets.createStream = stubPageStreamingCall( - expectedResponse - ); + client.descriptors.page.groupAssets.createStream = + stubPageStreamingCall(expectedResponse); const stream = client.groupAssetsStream(request); const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.securitycenter.v1.GroupResult[] = []; + const responses: protos.google.cloud.securitycenter.v1.GroupResult[] = + []; stream.on( 'data', (response: protos.google.cloud.securitycenter.v1.GroupResult) => { @@ -2463,7 +2435,8 @@ describe('v1.SecurityCenterClient', () => { ); const stream = client.groupAssetsStream(request); const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.securitycenter.v1.GroupResult[] = []; + const responses: protos.google.cloud.securitycenter.v1.GroupResult[] = + []; stream.on( 'data', (response: protos.google.cloud.securitycenter.v1.GroupResult) => { @@ -2513,10 +2486,10 @@ describe('v1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1.GroupResult() ), ]; - client.descriptors.page.groupAssets.asyncIterate = stubAsyncIterationCall( - expectedResponse - ); - const responses: protos.google.cloud.securitycenter.v1.IGroupResult[] = []; + client.descriptors.page.groupAssets.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.securitycenter.v1.IGroupResult[] = + []; const iterable = client.groupAssetsAsync(request); for await (const resource of iterable) { responses.push(resource!); @@ -2554,7 +2527,8 @@ describe('v1.SecurityCenterClient', () => { ); const iterable = client.groupAssetsAsync(request); await assert.rejects(async () => { - const responses: protos.google.cloud.securitycenter.v1.IGroupResult[] = []; + const responses: protos.google.cloud.securitycenter.v1.IGroupResult[] = + []; for await (const resource of iterable) { responses.push(resource!); } @@ -2643,9 +2617,8 @@ describe('v1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1.GroupResult() ), ]; - client.innerApiCalls.groupFindings = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.groupFindings = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.groupFindings( request, @@ -2723,12 +2696,12 @@ describe('v1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1.GroupResult() ), ]; - client.descriptors.page.groupFindings.createStream = stubPageStreamingCall( - expectedResponse - ); + client.descriptors.page.groupFindings.createStream = + stubPageStreamingCall(expectedResponse); const stream = client.groupFindingsStream(request); const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.securitycenter.v1.GroupResult[] = []; + const responses: protos.google.cloud.securitycenter.v1.GroupResult[] = + []; stream.on( 'data', (response: protos.google.cloud.securitycenter.v1.GroupResult) => { @@ -2750,10 +2723,9 @@ describe('v1.SecurityCenterClient', () => { .calledWith(client.innerApiCalls.groupFindings, request) ); assert.strictEqual( - (client.descriptors.page.groupFindings - .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.groupFindings.createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); @@ -2770,13 +2742,12 @@ describe('v1.SecurityCenterClient', () => { request.parent = ''; const expectedHeaderRequestParams = 'parent='; const expectedError = new Error('expected'); - client.descriptors.page.groupFindings.createStream = stubPageStreamingCall( - undefined, - expectedError - ); + client.descriptors.page.groupFindings.createStream = + stubPageStreamingCall(undefined, expectedError); const stream = client.groupFindingsStream(request); const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.securitycenter.v1.GroupResult[] = []; + const responses: protos.google.cloud.securitycenter.v1.GroupResult[] = + []; stream.on( 'data', (response: protos.google.cloud.securitycenter.v1.GroupResult) => { @@ -2797,10 +2768,9 @@ describe('v1.SecurityCenterClient', () => { .calledWith(client.innerApiCalls.groupFindings, request) ); assert.strictEqual( - (client.descriptors.page.groupFindings - .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.groupFindings.createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); @@ -2827,25 +2797,25 @@ describe('v1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1.GroupResult() ), ]; - client.descriptors.page.groupFindings.asyncIterate = stubAsyncIterationCall( - expectedResponse - ); - const responses: protos.google.cloud.securitycenter.v1.IGroupResult[] = []; + client.descriptors.page.groupFindings.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.securitycenter.v1.IGroupResult[] = + []; const iterable = client.groupFindingsAsync(request); for await (const resource of iterable) { responses.push(resource!); } assert.deepStrictEqual(responses, expectedResponse); assert.deepStrictEqual( - (client.descriptors.page.groupFindings - .asyncIterate as SinonStub).getCall(0).args[1], + ( + client.descriptors.page.groupFindings.asyncIterate as SinonStub + ).getCall(0).args[1], request ); assert.strictEqual( - (client.descriptors.page.groupFindings - .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.groupFindings.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); @@ -2862,27 +2832,26 @@ describe('v1.SecurityCenterClient', () => { request.parent = ''; const expectedHeaderRequestParams = 'parent='; const expectedError = new Error('expected'); - client.descriptors.page.groupFindings.asyncIterate = stubAsyncIterationCall( - undefined, - expectedError - ); + client.descriptors.page.groupFindings.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); const iterable = client.groupFindingsAsync(request); await assert.rejects(async () => { - const responses: protos.google.cloud.securitycenter.v1.IGroupResult[] = []; + const responses: protos.google.cloud.securitycenter.v1.IGroupResult[] = + []; for await (const resource of iterable) { responses.push(resource!); } }); assert.deepStrictEqual( - (client.descriptors.page.groupFindings - .asyncIterate as SinonStub).getCall(0).args[1], + ( + client.descriptors.page.groupFindings.asyncIterate as SinonStub + ).getCall(0).args[1], request ); assert.strictEqual( - (client.descriptors.page.groupFindings - .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.groupFindings.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); @@ -2957,9 +2926,8 @@ describe('v1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult() ), ]; - client.innerApiCalls.listAssets = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.listAssets = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.listAssets( request, @@ -3039,12 +3007,12 @@ describe('v1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult() ), ]; - client.descriptors.page.listAssets.createStream = stubPageStreamingCall( - expectedResponse - ); + client.descriptors.page.listAssets.createStream = + stubPageStreamingCall(expectedResponse); const stream = client.listAssetsStream(request); const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult[] = []; + const responses: protos.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult[] = + []; stream.on( 'data', ( @@ -3093,7 +3061,8 @@ describe('v1.SecurityCenterClient', () => { ); const stream = client.listAssetsStream(request); const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult[] = []; + const responses: protos.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult[] = + []; stream.on( 'data', ( @@ -3145,10 +3114,10 @@ describe('v1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult() ), ]; - client.descriptors.page.listAssets.asyncIterate = stubAsyncIterationCall( - expectedResponse - ); - const responses: protos.google.cloud.securitycenter.v1.ListAssetsResponse.IListAssetsResult[] = []; + client.descriptors.page.listAssets.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.securitycenter.v1.ListAssetsResponse.IListAssetsResult[] = + []; const iterable = client.listAssetsAsync(request); for await (const resource of iterable) { responses.push(resource!); @@ -3186,7 +3155,8 @@ describe('v1.SecurityCenterClient', () => { ); const iterable = client.listAssetsAsync(request); await assert.rejects(async () => { - const responses: protos.google.cloud.securitycenter.v1.ListAssetsResponse.IListAssetsResult[] = []; + const responses: protos.google.cloud.securitycenter.v1.ListAssetsResponse.IListAssetsResult[] = + []; for await (const resource of iterable) { responses.push(resource!); } @@ -3275,9 +3245,8 @@ describe('v1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult() ), ]; - client.innerApiCalls.listFindings = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.listFindings = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.listFindings( request, @@ -3357,12 +3326,12 @@ describe('v1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult() ), ]; - client.descriptors.page.listFindings.createStream = stubPageStreamingCall( - expectedResponse - ); + client.descriptors.page.listFindings.createStream = + stubPageStreamingCall(expectedResponse); const stream = client.listFindingsStream(request); const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult[] = []; + const responses: protos.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult[] = + []; stream.on( 'data', ( @@ -3386,10 +3355,9 @@ describe('v1.SecurityCenterClient', () => { .calledWith(client.innerApiCalls.listFindings, request) ); assert.strictEqual( - (client.descriptors.page.listFindings - .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.listFindings.createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); @@ -3412,7 +3380,8 @@ describe('v1.SecurityCenterClient', () => { ); const stream = client.listFindingsStream(request); const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult[] = []; + const responses: protos.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult[] = + []; stream.on( 'data', ( @@ -3435,10 +3404,9 @@ describe('v1.SecurityCenterClient', () => { .calledWith(client.innerApiCalls.listFindings, request) ); assert.strictEqual( - (client.descriptors.page.listFindings - .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.listFindings.createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); @@ -3465,25 +3433,25 @@ describe('v1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult() ), ]; - client.descriptors.page.listFindings.asyncIterate = stubAsyncIterationCall( - expectedResponse - ); - const responses: protos.google.cloud.securitycenter.v1.ListFindingsResponse.IListFindingsResult[] = []; + client.descriptors.page.listFindings.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.securitycenter.v1.ListFindingsResponse.IListFindingsResult[] = + []; const iterable = client.listFindingsAsync(request); for await (const resource of iterable) { responses.push(resource!); } assert.deepStrictEqual(responses, expectedResponse); assert.deepStrictEqual( - (client.descriptors.page.listFindings - .asyncIterate as SinonStub).getCall(0).args[1], + ( + client.descriptors.page.listFindings.asyncIterate as SinonStub + ).getCall(0).args[1], request ); assert.strictEqual( - (client.descriptors.page.listFindings - .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.listFindings.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); @@ -3500,27 +3468,26 @@ describe('v1.SecurityCenterClient', () => { request.parent = ''; const expectedHeaderRequestParams = 'parent='; const expectedError = new Error('expected'); - client.descriptors.page.listFindings.asyncIterate = stubAsyncIterationCall( - undefined, - expectedError - ); + client.descriptors.page.listFindings.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); const iterable = client.listFindingsAsync(request); await assert.rejects(async () => { - const responses: protos.google.cloud.securitycenter.v1.ListFindingsResponse.IListFindingsResult[] = []; + const responses: protos.google.cloud.securitycenter.v1.ListFindingsResponse.IListFindingsResult[] = + []; for await (const resource of iterable) { responses.push(resource!); } }); assert.deepStrictEqual( - (client.descriptors.page.listFindings - .asyncIterate as SinonStub).getCall(0).args[1], + ( + client.descriptors.page.listFindings.asyncIterate as SinonStub + ).getCall(0).args[1], request ); assert.strictEqual( - (client.descriptors.page.listFindings - .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.listFindings.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); @@ -3556,9 +3523,8 @@ describe('v1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1.NotificationConfig() ), ]; - client.innerApiCalls.listNotificationConfigs = stubSimpleCall( - expectedResponse - ); + client.innerApiCalls.listNotificationConfigs = + stubSimpleCall(expectedResponse); const [response] = await client.listNotificationConfigs(request); assert.deepStrictEqual(response, expectedResponse); assert( @@ -3597,9 +3563,8 @@ describe('v1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1.NotificationConfig() ), ]; - client.innerApiCalls.listNotificationConfigs = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.listNotificationConfigs = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.listNotificationConfigs( request, @@ -3682,12 +3647,12 @@ describe('v1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1.NotificationConfig() ), ]; - client.descriptors.page.listNotificationConfigs.createStream = stubPageStreamingCall( - expectedResponse - ); + client.descriptors.page.listNotificationConfigs.createStream = + stubPageStreamingCall(expectedResponse); const stream = client.listNotificationConfigsStream(request); const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.securitycenter.v1.NotificationConfig[] = []; + const responses: protos.google.cloud.securitycenter.v1.NotificationConfig[] = + []; stream.on( 'data', ( @@ -3706,16 +3671,18 @@ describe('v1.SecurityCenterClient', () => { const responses = await promise; assert.deepStrictEqual(responses, expectedResponse); assert( - (client.descriptors.page.listNotificationConfigs - .createStream as SinonStub) + ( + client.descriptors.page.listNotificationConfigs + .createStream as SinonStub + ) .getCall(0) .calledWith(client.innerApiCalls.listNotificationConfigs, request) ); assert.strictEqual( - (client.descriptors.page.listNotificationConfigs - .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.listNotificationConfigs + .createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); @@ -3732,13 +3699,12 @@ describe('v1.SecurityCenterClient', () => { request.parent = ''; const expectedHeaderRequestParams = 'parent='; const expectedError = new Error('expected'); - client.descriptors.page.listNotificationConfigs.createStream = stubPageStreamingCall( - undefined, - expectedError - ); + client.descriptors.page.listNotificationConfigs.createStream = + stubPageStreamingCall(undefined, expectedError); const stream = client.listNotificationConfigsStream(request); const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.securitycenter.v1.NotificationConfig[] = []; + const responses: protos.google.cloud.securitycenter.v1.NotificationConfig[] = + []; stream.on( 'data', ( @@ -3756,16 +3722,18 @@ describe('v1.SecurityCenterClient', () => { }); await assert.rejects(promise, expectedError); assert( - (client.descriptors.page.listNotificationConfigs - .createStream as SinonStub) + ( + client.descriptors.page.listNotificationConfigs + .createStream as SinonStub + ) .getCall(0) .calledWith(client.innerApiCalls.listNotificationConfigs, request) ); assert.strictEqual( - (client.descriptors.page.listNotificationConfigs - .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.listNotificationConfigs + .createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); @@ -3792,25 +3760,27 @@ describe('v1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1.NotificationConfig() ), ]; - client.descriptors.page.listNotificationConfigs.asyncIterate = stubAsyncIterationCall( - expectedResponse - ); - const responses: protos.google.cloud.securitycenter.v1.INotificationConfig[] = []; + client.descriptors.page.listNotificationConfigs.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.securitycenter.v1.INotificationConfig[] = + []; const iterable = client.listNotificationConfigsAsync(request); for await (const resource of iterable) { responses.push(resource!); } assert.deepStrictEqual(responses, expectedResponse); assert.deepStrictEqual( - (client.descriptors.page.listNotificationConfigs - .asyncIterate as SinonStub).getCall(0).args[1], + ( + client.descriptors.page.listNotificationConfigs + .asyncIterate as SinonStub + ).getCall(0).args[1], request ); assert.strictEqual( - (client.descriptors.page.listNotificationConfigs - .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.listNotificationConfigs + .asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); @@ -3827,27 +3797,28 @@ describe('v1.SecurityCenterClient', () => { request.parent = ''; const expectedHeaderRequestParams = 'parent='; const expectedError = new Error('expected'); - client.descriptors.page.listNotificationConfigs.asyncIterate = stubAsyncIterationCall( - undefined, - expectedError - ); + client.descriptors.page.listNotificationConfigs.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); const iterable = client.listNotificationConfigsAsync(request); await assert.rejects(async () => { - const responses: protos.google.cloud.securitycenter.v1.INotificationConfig[] = []; + const responses: protos.google.cloud.securitycenter.v1.INotificationConfig[] = + []; for await (const resource of iterable) { responses.push(resource!); } }); assert.deepStrictEqual( - (client.descriptors.page.listNotificationConfigs - .asyncIterate as SinonStub).getCall(0).args[1], + ( + client.descriptors.page.listNotificationConfigs + .asyncIterate as SinonStub + ).getCall(0).args[1], request ); assert.strictEqual( - (client.descriptors.page.listNotificationConfigs - .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.listNotificationConfigs + .asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); @@ -3922,9 +3893,8 @@ describe('v1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1.Source() ), ]; - client.innerApiCalls.listSources = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.listSources = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.listSources( request, @@ -4002,9 +3972,8 @@ describe('v1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1.Source() ), ]; - client.descriptors.page.listSources.createStream = stubPageStreamingCall( - expectedResponse - ); + client.descriptors.page.listSources.createStream = + stubPageStreamingCall(expectedResponse); const stream = client.listSourcesStream(request); const promise = new Promise((resolve, reject) => { const responses: protos.google.cloud.securitycenter.v1.Source[] = []; @@ -4104,9 +4073,8 @@ describe('v1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1.Source() ), ]; - client.descriptors.page.listSources.asyncIterate = stubAsyncIterationCall( - expectedResponse - ); + client.descriptors.page.listSources.asyncIterate = + stubAsyncIterationCall(expectedResponse); const responses: protos.google.cloud.securitycenter.v1.ISource[] = []; const iterable = client.listSourcesAsync(request); for await (const resource of iterable) { @@ -4304,34 +4272,38 @@ describe('v1.SecurityCenterClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.notificationConfigPathTemplate - .render as SinonStub) + ( + client.pathTemplates.notificationConfigPathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); }); it('matchOrganizationFromNotificationConfigName', () => { - const result = client.matchOrganizationFromNotificationConfigName( - fakePath - ); + const result = + client.matchOrganizationFromNotificationConfigName(fakePath); assert.strictEqual(result, 'organizationValue'); assert( - (client.pathTemplates.notificationConfigPathTemplate - .match as SinonStub) + ( + client.pathTemplates.notificationConfigPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchNotificationConfigFromNotificationConfigName', () => { - const result = client.matchNotificationConfigFromNotificationConfigName( - fakePath - ); + const result = + client.matchNotificationConfigFromNotificationConfigName(fakePath); assert.strictEqual(result, 'notificationConfigValue'); assert( - (client.pathTemplates.notificationConfigPathTemplate - .match as SinonStub) + ( + client.pathTemplates.notificationConfigPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -4387,12 +4359,10 @@ describe('v1.SecurityCenterClient', () => { projectId: 'bogus', }); client.initialize(); - client.pathTemplates.organizationAssetSecurityMarksPathTemplate.render = sinon - .stub() - .returns(fakePath); - client.pathTemplates.organizationAssetSecurityMarksPathTemplate.match = sinon - .stub() - .returns(expectedParameters); + client.pathTemplates.organizationAssetSecurityMarksPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationAssetSecurityMarksPathTemplate.match = + sinon.stub().returns(expectedParameters); it('organizationAssetSecurityMarksPath', () => { const result = client.organizationAssetSecurityMarksPath( @@ -4401,34 +4371,40 @@ describe('v1.SecurityCenterClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.organizationAssetSecurityMarksPathTemplate - .render as SinonStub) + ( + client.pathTemplates.organizationAssetSecurityMarksPathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); }); it('matchOrganizationFromOrganizationAssetSecurityMarksName', () => { - const result = client.matchOrganizationFromOrganizationAssetSecurityMarksName( - fakePath - ); + const result = + client.matchOrganizationFromOrganizationAssetSecurityMarksName( + fakePath + ); assert.strictEqual(result, 'organizationValue'); assert( - (client.pathTemplates.organizationAssetSecurityMarksPathTemplate - .match as SinonStub) + ( + client.pathTemplates.organizationAssetSecurityMarksPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchAssetFromOrganizationAssetSecurityMarksName', () => { - const result = client.matchAssetFromOrganizationAssetSecurityMarksName( - fakePath - ); + const result = + client.matchAssetFromOrganizationAssetSecurityMarksName(fakePath); assert.strictEqual(result, 'assetValue'); assert( - (client.pathTemplates.organizationAssetSecurityMarksPathTemplate - .match as SinonStub) + ( + client.pathTemplates.organizationAssetSecurityMarksPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -4456,21 +4432,24 @@ describe('v1.SecurityCenterClient', () => { const result = client.organizationSettingsPath('organizationValue'); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.organizationSettingsPathTemplate - .render as SinonStub) + ( + client.pathTemplates.organizationSettingsPathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); }); it('matchOrganizationFromOrganizationSettingsName', () => { - const result = client.matchOrganizationFromOrganizationSettingsName( - fakePath - ); + const result = + client.matchOrganizationFromOrganizationSettingsName(fakePath); assert.strictEqual(result, 'organizationValue'); assert( - (client.pathTemplates.organizationSettingsPathTemplate - .match as SinonStub) + ( + client.pathTemplates.organizationSettingsPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -4489,12 +4468,10 @@ describe('v1.SecurityCenterClient', () => { projectId: 'bogus', }); client.initialize(); - client.pathTemplates.organizationSourceFindingSecurityMarksPathTemplate.render = sinon - .stub() - .returns(fakePath); - client.pathTemplates.organizationSourceFindingSecurityMarksPathTemplate.match = sinon - .stub() - .returns(expectedParameters); + client.pathTemplates.organizationSourceFindingSecurityMarksPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationSourceFindingSecurityMarksPathTemplate.match = + sinon.stub().returns(expectedParameters); it('organizationSourceFindingSecurityMarksPath', () => { const result = client.organizationSourceFindingSecurityMarksPath( @@ -4504,51 +4481,62 @@ describe('v1.SecurityCenterClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates - .organizationSourceFindingSecurityMarksPathTemplate - .render as SinonStub) + ( + client.pathTemplates + .organizationSourceFindingSecurityMarksPathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); }); it('matchOrganizationFromOrganizationSourceFindingSecurityMarksName', () => { - const result = client.matchOrganizationFromOrganizationSourceFindingSecurityMarksName( - fakePath - ); + const result = + client.matchOrganizationFromOrganizationSourceFindingSecurityMarksName( + fakePath + ); assert.strictEqual(result, 'organizationValue'); assert( - (client.pathTemplates - .organizationSourceFindingSecurityMarksPathTemplate - .match as SinonStub) + ( + client.pathTemplates + .organizationSourceFindingSecurityMarksPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchSourceFromOrganizationSourceFindingSecurityMarksName', () => { - const result = client.matchSourceFromOrganizationSourceFindingSecurityMarksName( - fakePath - ); + const result = + client.matchSourceFromOrganizationSourceFindingSecurityMarksName( + fakePath + ); assert.strictEqual(result, 'sourceValue'); assert( - (client.pathTemplates - .organizationSourceFindingSecurityMarksPathTemplate - .match as SinonStub) + ( + client.pathTemplates + .organizationSourceFindingSecurityMarksPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchFindingFromOrganizationSourceFindingSecurityMarksName', () => { - const result = client.matchFindingFromOrganizationSourceFindingSecurityMarksName( - fakePath - ); + const result = + client.matchFindingFromOrganizationSourceFindingSecurityMarksName( + fakePath + ); assert.strictEqual(result, 'findingValue'); assert( - (client.pathTemplates - .organizationSourceFindingSecurityMarksPathTemplate - .match as SinonStub) + ( + client.pathTemplates + .organizationSourceFindingSecurityMarksPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); diff --git a/packages/google-cloud-securitycenter/test/gapic_security_center_v1beta1.ts b/packages/google-cloud-securitycenter/test/gapic_security_center_v1beta1.ts index c73805fd46a..58772026490 100644 --- a/packages/google-cloud-securitycenter/test/gapic_security_center_v1beta1.ts +++ b/packages/google-cloud-securitycenter/test/gapic_security_center_v1beta1.ts @@ -28,10 +28,9 @@ import {PassThrough} from 'stream'; import {protobuf, LROperation, operationsProtos} from 'google-gax'; function generateSampleMessage(instance: T) { - const filledObject = (instance.constructor as typeof protobuf.Message).toObject( - instance as protobuf.Message, - {defaults: true} - ); + 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; @@ -281,9 +280,8 @@ describe('v1beta1.SecurityCenterClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.securitycenter.v1beta1.Source() ); - client.innerApiCalls.createSource = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.createSource = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.createSource( request, @@ -393,9 +391,8 @@ describe('v1beta1.SecurityCenterClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.securitycenter.v1beta1.Finding() ); - client.innerApiCalls.createFinding = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.createFinding = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.createFinding( request, @@ -505,9 +502,8 @@ describe('v1beta1.SecurityCenterClient', () => { const expectedResponse = generateSampleMessage( new protos.google.iam.v1.Policy() ); - client.innerApiCalls.getIamPolicy = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.getIamPolicy = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.getIamPolicy( request, @@ -586,9 +582,8 @@ describe('v1beta1.SecurityCenterClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.securitycenter.v1beta1.OrganizationSettings() ); - client.innerApiCalls.getOrganizationSettings = stubSimpleCall( - expectedResponse - ); + client.innerApiCalls.getOrganizationSettings = + stubSimpleCall(expectedResponse); const [response] = await client.getOrganizationSettings(request); assert.deepStrictEqual(response, expectedResponse); assert( @@ -619,9 +614,8 @@ describe('v1beta1.SecurityCenterClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.securitycenter.v1beta1.OrganizationSettings() ); - client.innerApiCalls.getOrganizationSettings = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.getOrganizationSettings = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.getOrganizationSettings( request, @@ -734,9 +728,8 @@ describe('v1beta1.SecurityCenterClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.securitycenter.v1beta1.Source() ); - client.innerApiCalls.getSource = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.getSource = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.getSource( request, @@ -843,9 +836,8 @@ describe('v1beta1.SecurityCenterClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.securitycenter.v1beta1.Finding() ); - client.innerApiCalls.setFindingState = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.setFindingState = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.setFindingState( request, @@ -955,9 +947,8 @@ describe('v1beta1.SecurityCenterClient', () => { const expectedResponse = generateSampleMessage( new protos.google.iam.v1.Policy() ); - client.innerApiCalls.setIamPolicy = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.setIamPolicy = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.setIamPolicy( request, @@ -1036,9 +1027,8 @@ describe('v1beta1.SecurityCenterClient', () => { const expectedResponse = generateSampleMessage( new protos.google.iam.v1.TestIamPermissionsResponse() ); - client.innerApiCalls.testIamPermissions = stubSimpleCall( - expectedResponse - ); + client.innerApiCalls.testIamPermissions = + stubSimpleCall(expectedResponse); const [response] = await client.testIamPermissions(request); assert.deepStrictEqual(response, expectedResponse); assert( @@ -1069,9 +1059,8 @@ describe('v1beta1.SecurityCenterClient', () => { const expectedResponse = generateSampleMessage( new protos.google.iam.v1.TestIamPermissionsResponse() ); - client.innerApiCalls.testIamPermissions = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.testIamPermissions = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.testIamPermissions( request, @@ -1183,9 +1172,8 @@ describe('v1beta1.SecurityCenterClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.securitycenter.v1beta1.Finding() ); - client.innerApiCalls.updateFinding = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.updateFinding = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.updateFinding( request, @@ -1266,9 +1254,8 @@ describe('v1beta1.SecurityCenterClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.securitycenter.v1beta1.OrganizationSettings() ); - client.innerApiCalls.updateOrganizationSettings = stubSimpleCall( - expectedResponse - ); + client.innerApiCalls.updateOrganizationSettings = + stubSimpleCall(expectedResponse); const [response] = await client.updateOrganizationSettings(request); assert.deepStrictEqual(response, expectedResponse); assert( @@ -1300,9 +1287,8 @@ describe('v1beta1.SecurityCenterClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.securitycenter.v1beta1.OrganizationSettings() ); - client.innerApiCalls.updateOrganizationSettings = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.updateOrganizationSettings = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.updateOrganizationSettings( request, @@ -1418,9 +1404,8 @@ describe('v1beta1.SecurityCenterClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.securitycenter.v1beta1.Source() ); - client.innerApiCalls.updateSource = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.updateSource = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.updateSource( request, @@ -1501,9 +1486,8 @@ describe('v1beta1.SecurityCenterClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.securitycenter.v1beta1.SecurityMarks() ); - client.innerApiCalls.updateSecurityMarks = stubSimpleCall( - expectedResponse - ); + client.innerApiCalls.updateSecurityMarks = + stubSimpleCall(expectedResponse); const [response] = await client.updateSecurityMarks(request); assert.deepStrictEqual(response, expectedResponse); assert( @@ -1535,9 +1519,8 @@ describe('v1beta1.SecurityCenterClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.securitycenter.v1beta1.SecurityMarks() ); - client.innerApiCalls.updateSecurityMarks = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.updateSecurityMarks = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.updateSecurityMarks( request, @@ -1617,9 +1600,8 @@ describe('v1beta1.SecurityCenterClient', () => { const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.runAssetDiscovery = stubLongRunningCall( - expectedResponse - ); + client.innerApiCalls.runAssetDiscovery = + stubLongRunningCall(expectedResponse); const [operation] = await client.runAssetDiscovery(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); @@ -1651,9 +1633,8 @@ describe('v1beta1.SecurityCenterClient', () => { const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.runAssetDiscovery = stubLongRunningCallWithCallback( - expectedResponse - ); + client.innerApiCalls.runAssetDiscovery = + stubLongRunningCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.runAssetDiscovery( request, @@ -1860,9 +1841,8 @@ describe('v1beta1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1beta1.GroupResult() ), ]; - client.innerApiCalls.groupAssets = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.groupAssets = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.groupAssets( request, @@ -1942,12 +1922,12 @@ describe('v1beta1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1beta1.GroupResult() ), ]; - client.descriptors.page.groupAssets.createStream = stubPageStreamingCall( - expectedResponse - ); + client.descriptors.page.groupAssets.createStream = + stubPageStreamingCall(expectedResponse); const stream = client.groupAssetsStream(request); const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.securitycenter.v1beta1.GroupResult[] = []; + const responses: protos.google.cloud.securitycenter.v1beta1.GroupResult[] = + []; stream.on( 'data', ( @@ -1996,7 +1976,8 @@ describe('v1beta1.SecurityCenterClient', () => { ); const stream = client.groupAssetsStream(request); const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.securitycenter.v1beta1.GroupResult[] = []; + const responses: protos.google.cloud.securitycenter.v1beta1.GroupResult[] = + []; stream.on( 'data', ( @@ -2048,10 +2029,10 @@ describe('v1beta1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1beta1.GroupResult() ), ]; - client.descriptors.page.groupAssets.asyncIterate = stubAsyncIterationCall( - expectedResponse - ); - const responses: protos.google.cloud.securitycenter.v1beta1.IGroupResult[] = []; + client.descriptors.page.groupAssets.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.securitycenter.v1beta1.IGroupResult[] = + []; const iterable = client.groupAssetsAsync(request); for await (const resource of iterable) { responses.push(resource!); @@ -2089,7 +2070,8 @@ describe('v1beta1.SecurityCenterClient', () => { ); const iterable = client.groupAssetsAsync(request); await assert.rejects(async () => { - const responses: protos.google.cloud.securitycenter.v1beta1.IGroupResult[] = []; + const responses: protos.google.cloud.securitycenter.v1beta1.IGroupResult[] = + []; for await (const resource of iterable) { responses.push(resource!); } @@ -2178,9 +2160,8 @@ describe('v1beta1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1beta1.GroupResult() ), ]; - client.innerApiCalls.groupFindings = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.groupFindings = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.groupFindings( request, @@ -2260,12 +2241,12 @@ describe('v1beta1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1beta1.GroupResult() ), ]; - client.descriptors.page.groupFindings.createStream = stubPageStreamingCall( - expectedResponse - ); + client.descriptors.page.groupFindings.createStream = + stubPageStreamingCall(expectedResponse); const stream = client.groupFindingsStream(request); const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.securitycenter.v1beta1.GroupResult[] = []; + const responses: protos.google.cloud.securitycenter.v1beta1.GroupResult[] = + []; stream.on( 'data', ( @@ -2289,10 +2270,9 @@ describe('v1beta1.SecurityCenterClient', () => { .calledWith(client.innerApiCalls.groupFindings, request) ); assert.strictEqual( - (client.descriptors.page.groupFindings - .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.groupFindings.createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); @@ -2309,13 +2289,12 @@ describe('v1beta1.SecurityCenterClient', () => { request.parent = ''; const expectedHeaderRequestParams = 'parent='; const expectedError = new Error('expected'); - client.descriptors.page.groupFindings.createStream = stubPageStreamingCall( - undefined, - expectedError - ); + client.descriptors.page.groupFindings.createStream = + stubPageStreamingCall(undefined, expectedError); const stream = client.groupFindingsStream(request); const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.securitycenter.v1beta1.GroupResult[] = []; + const responses: protos.google.cloud.securitycenter.v1beta1.GroupResult[] = + []; stream.on( 'data', ( @@ -2338,10 +2317,9 @@ describe('v1beta1.SecurityCenterClient', () => { .calledWith(client.innerApiCalls.groupFindings, request) ); assert.strictEqual( - (client.descriptors.page.groupFindings - .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.groupFindings.createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); @@ -2368,25 +2346,25 @@ describe('v1beta1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1beta1.GroupResult() ), ]; - client.descriptors.page.groupFindings.asyncIterate = stubAsyncIterationCall( - expectedResponse - ); - const responses: protos.google.cloud.securitycenter.v1beta1.IGroupResult[] = []; + client.descriptors.page.groupFindings.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.securitycenter.v1beta1.IGroupResult[] = + []; const iterable = client.groupFindingsAsync(request); for await (const resource of iterable) { responses.push(resource!); } assert.deepStrictEqual(responses, expectedResponse); assert.deepStrictEqual( - (client.descriptors.page.groupFindings - .asyncIterate as SinonStub).getCall(0).args[1], + ( + client.descriptors.page.groupFindings.asyncIterate as SinonStub + ).getCall(0).args[1], request ); assert.strictEqual( - (client.descriptors.page.groupFindings - .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.groupFindings.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); @@ -2403,27 +2381,26 @@ describe('v1beta1.SecurityCenterClient', () => { request.parent = ''; const expectedHeaderRequestParams = 'parent='; const expectedError = new Error('expected'); - client.descriptors.page.groupFindings.asyncIterate = stubAsyncIterationCall( - undefined, - expectedError - ); + client.descriptors.page.groupFindings.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); const iterable = client.groupFindingsAsync(request); await assert.rejects(async () => { - const responses: protos.google.cloud.securitycenter.v1beta1.IGroupResult[] = []; + const responses: protos.google.cloud.securitycenter.v1beta1.IGroupResult[] = + []; for await (const resource of iterable) { responses.push(resource!); } }); assert.deepStrictEqual( - (client.descriptors.page.groupFindings - .asyncIterate as SinonStub).getCall(0).args[1], + ( + client.descriptors.page.groupFindings.asyncIterate as SinonStub + ).getCall(0).args[1], request ); assert.strictEqual( - (client.descriptors.page.groupFindings - .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.groupFindings.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); @@ -2498,9 +2475,8 @@ describe('v1beta1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult() ), ]; - client.innerApiCalls.listAssets = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.listAssets = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.listAssets( request, @@ -2580,12 +2556,12 @@ describe('v1beta1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult() ), ]; - client.descriptors.page.listAssets.createStream = stubPageStreamingCall( - expectedResponse - ); + client.descriptors.page.listAssets.createStream = + stubPageStreamingCall(expectedResponse); const stream = client.listAssetsStream(request); const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult[] = []; + const responses: protos.google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult[] = + []; stream.on( 'data', ( @@ -2634,7 +2610,8 @@ describe('v1beta1.SecurityCenterClient', () => { ); const stream = client.listAssetsStream(request); const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult[] = []; + const responses: protos.google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult[] = + []; stream.on( 'data', ( @@ -2686,10 +2663,10 @@ describe('v1beta1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult() ), ]; - client.descriptors.page.listAssets.asyncIterate = stubAsyncIterationCall( - expectedResponse - ); - const responses: protos.google.cloud.securitycenter.v1beta1.ListAssetsResponse.IListAssetsResult[] = []; + client.descriptors.page.listAssets.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.securitycenter.v1beta1.ListAssetsResponse.IListAssetsResult[] = + []; const iterable = client.listAssetsAsync(request); for await (const resource of iterable) { responses.push(resource!); @@ -2727,7 +2704,8 @@ describe('v1beta1.SecurityCenterClient', () => { ); const iterable = client.listAssetsAsync(request); await assert.rejects(async () => { - const responses: protos.google.cloud.securitycenter.v1beta1.ListAssetsResponse.IListAssetsResult[] = []; + const responses: protos.google.cloud.securitycenter.v1beta1.ListAssetsResponse.IListAssetsResult[] = + []; for await (const resource of iterable) { responses.push(resource!); } @@ -2816,9 +2794,8 @@ describe('v1beta1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1beta1.Finding() ), ]; - client.innerApiCalls.listFindings = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.listFindings = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.listFindings( request, @@ -2898,12 +2875,12 @@ describe('v1beta1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1beta1.Finding() ), ]; - client.descriptors.page.listFindings.createStream = stubPageStreamingCall( - expectedResponse - ); + client.descriptors.page.listFindings.createStream = + stubPageStreamingCall(expectedResponse); const stream = client.listFindingsStream(request); const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.securitycenter.v1beta1.Finding[] = []; + const responses: protos.google.cloud.securitycenter.v1beta1.Finding[] = + []; stream.on( 'data', (response: protos.google.cloud.securitycenter.v1beta1.Finding) => { @@ -2925,10 +2902,9 @@ describe('v1beta1.SecurityCenterClient', () => { .calledWith(client.innerApiCalls.listFindings, request) ); assert.strictEqual( - (client.descriptors.page.listFindings - .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.listFindings.createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); @@ -2951,7 +2927,8 @@ describe('v1beta1.SecurityCenterClient', () => { ); const stream = client.listFindingsStream(request); const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.securitycenter.v1beta1.Finding[] = []; + const responses: protos.google.cloud.securitycenter.v1beta1.Finding[] = + []; stream.on( 'data', (response: protos.google.cloud.securitycenter.v1beta1.Finding) => { @@ -2972,10 +2949,9 @@ describe('v1beta1.SecurityCenterClient', () => { .calledWith(client.innerApiCalls.listFindings, request) ); assert.strictEqual( - (client.descriptors.page.listFindings - .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.listFindings.createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); @@ -3002,25 +2978,25 @@ describe('v1beta1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1beta1.Finding() ), ]; - client.descriptors.page.listFindings.asyncIterate = stubAsyncIterationCall( - expectedResponse - ); - const responses: protos.google.cloud.securitycenter.v1beta1.IFinding[] = []; + client.descriptors.page.listFindings.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.securitycenter.v1beta1.IFinding[] = + []; const iterable = client.listFindingsAsync(request); for await (const resource of iterable) { responses.push(resource!); } assert.deepStrictEqual(responses, expectedResponse); assert.deepStrictEqual( - (client.descriptors.page.listFindings - .asyncIterate as SinonStub).getCall(0).args[1], + ( + client.descriptors.page.listFindings.asyncIterate as SinonStub + ).getCall(0).args[1], request ); assert.strictEqual( - (client.descriptors.page.listFindings - .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.listFindings.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); @@ -3037,27 +3013,26 @@ describe('v1beta1.SecurityCenterClient', () => { request.parent = ''; const expectedHeaderRequestParams = 'parent='; const expectedError = new Error('expected'); - client.descriptors.page.listFindings.asyncIterate = stubAsyncIterationCall( - undefined, - expectedError - ); + client.descriptors.page.listFindings.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); const iterable = client.listFindingsAsync(request); await assert.rejects(async () => { - const responses: protos.google.cloud.securitycenter.v1beta1.IFinding[] = []; + const responses: protos.google.cloud.securitycenter.v1beta1.IFinding[] = + []; for await (const resource of iterable) { responses.push(resource!); } }); assert.deepStrictEqual( - (client.descriptors.page.listFindings - .asyncIterate as SinonStub).getCall(0).args[1], + ( + client.descriptors.page.listFindings.asyncIterate as SinonStub + ).getCall(0).args[1], request ); assert.strictEqual( - (client.descriptors.page.listFindings - .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.listFindings.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); @@ -3132,9 +3107,8 @@ describe('v1beta1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1beta1.Source() ), ]; - client.innerApiCalls.listSources = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.listSources = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.listSources( request, @@ -3212,12 +3186,12 @@ describe('v1beta1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1beta1.Source() ), ]; - client.descriptors.page.listSources.createStream = stubPageStreamingCall( - expectedResponse - ); + client.descriptors.page.listSources.createStream = + stubPageStreamingCall(expectedResponse); const stream = client.listSourcesStream(request); const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.securitycenter.v1beta1.Source[] = []; + const responses: protos.google.cloud.securitycenter.v1beta1.Source[] = + []; stream.on( 'data', (response: protos.google.cloud.securitycenter.v1beta1.Source) => { @@ -3264,7 +3238,8 @@ describe('v1beta1.SecurityCenterClient', () => { ); const stream = client.listSourcesStream(request); const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.securitycenter.v1beta1.Source[] = []; + const responses: protos.google.cloud.securitycenter.v1beta1.Source[] = + []; stream.on( 'data', (response: protos.google.cloud.securitycenter.v1beta1.Source) => { @@ -3314,10 +3289,10 @@ describe('v1beta1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1beta1.Source() ), ]; - client.descriptors.page.listSources.asyncIterate = stubAsyncIterationCall( - expectedResponse - ); - const responses: protos.google.cloud.securitycenter.v1beta1.ISource[] = []; + client.descriptors.page.listSources.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.securitycenter.v1beta1.ISource[] = + []; const iterable = client.listSourcesAsync(request); for await (const resource of iterable) { responses.push(resource!); @@ -3355,7 +3330,8 @@ describe('v1beta1.SecurityCenterClient', () => { ); const iterable = client.listSourcesAsync(request); await assert.rejects(async () => { - const responses: protos.google.cloud.securitycenter.v1beta1.ISource[] = []; + const responses: protos.google.cloud.securitycenter.v1beta1.ISource[] = + []; for await (const resource of iterable) { responses.push(resource!); } @@ -3538,12 +3514,10 @@ describe('v1beta1.SecurityCenterClient', () => { projectId: 'bogus', }); client.initialize(); - client.pathTemplates.organizationAssetSecurityMarksPathTemplate.render = sinon - .stub() - .returns(fakePath); - client.pathTemplates.organizationAssetSecurityMarksPathTemplate.match = sinon - .stub() - .returns(expectedParameters); + client.pathTemplates.organizationAssetSecurityMarksPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationAssetSecurityMarksPathTemplate.match = + sinon.stub().returns(expectedParameters); it('organizationAssetSecurityMarksPath', () => { const result = client.organizationAssetSecurityMarksPath( @@ -3552,34 +3526,40 @@ describe('v1beta1.SecurityCenterClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.organizationAssetSecurityMarksPathTemplate - .render as SinonStub) + ( + client.pathTemplates.organizationAssetSecurityMarksPathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); }); it('matchOrganizationFromOrganizationAssetSecurityMarksName', () => { - const result = client.matchOrganizationFromOrganizationAssetSecurityMarksName( - fakePath - ); + const result = + client.matchOrganizationFromOrganizationAssetSecurityMarksName( + fakePath + ); assert.strictEqual(result, 'organizationValue'); assert( - (client.pathTemplates.organizationAssetSecurityMarksPathTemplate - .match as SinonStub) + ( + client.pathTemplates.organizationAssetSecurityMarksPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchAssetFromOrganizationAssetSecurityMarksName', () => { - const result = client.matchAssetFromOrganizationAssetSecurityMarksName( - fakePath - ); + const result = + client.matchAssetFromOrganizationAssetSecurityMarksName(fakePath); assert.strictEqual(result, 'assetValue'); assert( - (client.pathTemplates.organizationAssetSecurityMarksPathTemplate - .match as SinonStub) + ( + client.pathTemplates.organizationAssetSecurityMarksPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -3607,21 +3587,24 @@ describe('v1beta1.SecurityCenterClient', () => { const result = client.organizationSettingsPath('organizationValue'); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.organizationSettingsPathTemplate - .render as SinonStub) + ( + client.pathTemplates.organizationSettingsPathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); }); it('matchOrganizationFromOrganizationSettingsName', () => { - const result = client.matchOrganizationFromOrganizationSettingsName( - fakePath - ); + const result = + client.matchOrganizationFromOrganizationSettingsName(fakePath); assert.strictEqual(result, 'organizationValue'); assert( - (client.pathTemplates.organizationSettingsPathTemplate - .match as SinonStub) + ( + client.pathTemplates.organizationSettingsPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -3640,12 +3623,10 @@ describe('v1beta1.SecurityCenterClient', () => { projectId: 'bogus', }); client.initialize(); - client.pathTemplates.organizationSourceFindingSecurityMarksPathTemplate.render = sinon - .stub() - .returns(fakePath); - client.pathTemplates.organizationSourceFindingSecurityMarksPathTemplate.match = sinon - .stub() - .returns(expectedParameters); + client.pathTemplates.organizationSourceFindingSecurityMarksPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationSourceFindingSecurityMarksPathTemplate.match = + sinon.stub().returns(expectedParameters); it('organizationSourceFindingSecurityMarksPath', () => { const result = client.organizationSourceFindingSecurityMarksPath( @@ -3655,51 +3636,62 @@ describe('v1beta1.SecurityCenterClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates - .organizationSourceFindingSecurityMarksPathTemplate - .render as SinonStub) + ( + client.pathTemplates + .organizationSourceFindingSecurityMarksPathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); }); it('matchOrganizationFromOrganizationSourceFindingSecurityMarksName', () => { - const result = client.matchOrganizationFromOrganizationSourceFindingSecurityMarksName( - fakePath - ); + const result = + client.matchOrganizationFromOrganizationSourceFindingSecurityMarksName( + fakePath + ); assert.strictEqual(result, 'organizationValue'); assert( - (client.pathTemplates - .organizationSourceFindingSecurityMarksPathTemplate - .match as SinonStub) + ( + client.pathTemplates + .organizationSourceFindingSecurityMarksPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchSourceFromOrganizationSourceFindingSecurityMarksName', () => { - const result = client.matchSourceFromOrganizationSourceFindingSecurityMarksName( - fakePath - ); + const result = + client.matchSourceFromOrganizationSourceFindingSecurityMarksName( + fakePath + ); assert.strictEqual(result, 'sourceValue'); assert( - (client.pathTemplates - .organizationSourceFindingSecurityMarksPathTemplate - .match as SinonStub) + ( + client.pathTemplates + .organizationSourceFindingSecurityMarksPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchFindingFromOrganizationSourceFindingSecurityMarksName', () => { - const result = client.matchFindingFromOrganizationSourceFindingSecurityMarksName( - fakePath - ); + const result = + client.matchFindingFromOrganizationSourceFindingSecurityMarksName( + fakePath + ); assert.strictEqual(result, 'findingValue'); assert( - (client.pathTemplates - .organizationSourceFindingSecurityMarksPathTemplate - .match as SinonStub) + ( + client.pathTemplates + .organizationSourceFindingSecurityMarksPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); diff --git a/packages/google-cloud-securitycenter/test/gapic_security_center_v1p1beta1.ts b/packages/google-cloud-securitycenter/test/gapic_security_center_v1p1beta1.ts index 1ef7aee251c..6d5ff92218b 100644 --- a/packages/google-cloud-securitycenter/test/gapic_security_center_v1p1beta1.ts +++ b/packages/google-cloud-securitycenter/test/gapic_security_center_v1p1beta1.ts @@ -28,10 +28,9 @@ import {PassThrough} from 'stream'; import {protobuf, LROperation, operationsProtos} from 'google-gax'; function generateSampleMessage(instance: T) { - const filledObject = (instance.constructor as typeof protobuf.Message).toObject( - instance as protobuf.Message, - {defaults: true} - ); + 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; @@ -281,9 +280,8 @@ describe('v1p1beta1.SecurityCenterClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.Source() ); - client.innerApiCalls.createSource = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.createSource = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.createSource( request, @@ -393,9 +391,8 @@ describe('v1p1beta1.SecurityCenterClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.Finding() ); - client.innerApiCalls.createFinding = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.createFinding = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.createFinding( request, @@ -474,9 +471,8 @@ describe('v1p1beta1.SecurityCenterClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.NotificationConfig() ); - client.innerApiCalls.createNotificationConfig = stubSimpleCall( - expectedResponse - ); + client.innerApiCalls.createNotificationConfig = + stubSimpleCall(expectedResponse); const [response] = await client.createNotificationConfig(request); assert.deepStrictEqual(response, expectedResponse); assert( @@ -507,9 +503,8 @@ describe('v1p1beta1.SecurityCenterClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.NotificationConfig() ); - client.innerApiCalls.createNotificationConfig = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.createNotificationConfig = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.createNotificationConfig( request, @@ -591,9 +586,8 @@ describe('v1p1beta1.SecurityCenterClient', () => { const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); - client.innerApiCalls.deleteNotificationConfig = stubSimpleCall( - expectedResponse - ); + client.innerApiCalls.deleteNotificationConfig = + stubSimpleCall(expectedResponse); const [response] = await client.deleteNotificationConfig(request); assert.deepStrictEqual(response, expectedResponse); assert( @@ -624,9 +618,8 @@ describe('v1p1beta1.SecurityCenterClient', () => { const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); - client.innerApiCalls.deleteNotificationConfig = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.deleteNotificationConfig = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.deleteNotificationConfig( request, @@ -739,9 +732,8 @@ describe('v1p1beta1.SecurityCenterClient', () => { const expectedResponse = generateSampleMessage( new protos.google.iam.v1.Policy() ); - client.innerApiCalls.getIamPolicy = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.getIamPolicy = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.getIamPolicy( request, @@ -820,9 +812,8 @@ describe('v1p1beta1.SecurityCenterClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.NotificationConfig() ); - client.innerApiCalls.getNotificationConfig = stubSimpleCall( - expectedResponse - ); + client.innerApiCalls.getNotificationConfig = + stubSimpleCall(expectedResponse); const [response] = await client.getNotificationConfig(request); assert.deepStrictEqual(response, expectedResponse); assert( @@ -853,9 +844,8 @@ describe('v1p1beta1.SecurityCenterClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.NotificationConfig() ); - client.innerApiCalls.getNotificationConfig = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.getNotificationConfig = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.getNotificationConfig( request, @@ -937,9 +927,8 @@ describe('v1p1beta1.SecurityCenterClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.OrganizationSettings() ); - client.innerApiCalls.getOrganizationSettings = stubSimpleCall( - expectedResponse - ); + client.innerApiCalls.getOrganizationSettings = + stubSimpleCall(expectedResponse); const [response] = await client.getOrganizationSettings(request); assert.deepStrictEqual(response, expectedResponse); assert( @@ -970,9 +959,8 @@ describe('v1p1beta1.SecurityCenterClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.OrganizationSettings() ); - client.innerApiCalls.getOrganizationSettings = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.getOrganizationSettings = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.getOrganizationSettings( request, @@ -1085,9 +1073,8 @@ describe('v1p1beta1.SecurityCenterClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.Source() ); - client.innerApiCalls.getSource = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.getSource = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.getSource( request, @@ -1194,9 +1181,8 @@ describe('v1p1beta1.SecurityCenterClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.Finding() ); - client.innerApiCalls.setFindingState = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.setFindingState = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.setFindingState( request, @@ -1306,9 +1292,8 @@ describe('v1p1beta1.SecurityCenterClient', () => { const expectedResponse = generateSampleMessage( new protos.google.iam.v1.Policy() ); - client.innerApiCalls.setIamPolicy = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.setIamPolicy = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.setIamPolicy( request, @@ -1387,9 +1372,8 @@ describe('v1p1beta1.SecurityCenterClient', () => { const expectedResponse = generateSampleMessage( new protos.google.iam.v1.TestIamPermissionsResponse() ); - client.innerApiCalls.testIamPermissions = stubSimpleCall( - expectedResponse - ); + client.innerApiCalls.testIamPermissions = + stubSimpleCall(expectedResponse); const [response] = await client.testIamPermissions(request); assert.deepStrictEqual(response, expectedResponse); assert( @@ -1420,9 +1404,8 @@ describe('v1p1beta1.SecurityCenterClient', () => { const expectedResponse = generateSampleMessage( new protos.google.iam.v1.TestIamPermissionsResponse() ); - client.innerApiCalls.testIamPermissions = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.testIamPermissions = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.testIamPermissions( request, @@ -1534,9 +1517,8 @@ describe('v1p1beta1.SecurityCenterClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.Finding() ); - client.innerApiCalls.updateFinding = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.updateFinding = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.updateFinding( request, @@ -1617,9 +1599,8 @@ describe('v1p1beta1.SecurityCenterClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.NotificationConfig() ); - client.innerApiCalls.updateNotificationConfig = stubSimpleCall( - expectedResponse - ); + client.innerApiCalls.updateNotificationConfig = + stubSimpleCall(expectedResponse); const [response] = await client.updateNotificationConfig(request); assert.deepStrictEqual(response, expectedResponse); assert( @@ -1651,9 +1632,8 @@ describe('v1p1beta1.SecurityCenterClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.NotificationConfig() ); - client.innerApiCalls.updateNotificationConfig = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.updateNotificationConfig = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.updateNotificationConfig( request, @@ -1737,9 +1717,8 @@ describe('v1p1beta1.SecurityCenterClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.OrganizationSettings() ); - client.innerApiCalls.updateOrganizationSettings = stubSimpleCall( - expectedResponse - ); + client.innerApiCalls.updateOrganizationSettings = + stubSimpleCall(expectedResponse); const [response] = await client.updateOrganizationSettings(request); assert.deepStrictEqual(response, expectedResponse); assert( @@ -1771,9 +1750,8 @@ describe('v1p1beta1.SecurityCenterClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.OrganizationSettings() ); - client.innerApiCalls.updateOrganizationSettings = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.updateOrganizationSettings = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.updateOrganizationSettings( request, @@ -1889,9 +1867,8 @@ describe('v1p1beta1.SecurityCenterClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.Source() ); - client.innerApiCalls.updateSource = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.updateSource = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.updateSource( request, @@ -1972,9 +1949,8 @@ describe('v1p1beta1.SecurityCenterClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.SecurityMarks() ); - client.innerApiCalls.updateSecurityMarks = stubSimpleCall( - expectedResponse - ); + client.innerApiCalls.updateSecurityMarks = + stubSimpleCall(expectedResponse); const [response] = await client.updateSecurityMarks(request); assert.deepStrictEqual(response, expectedResponse); assert( @@ -2006,9 +1982,8 @@ describe('v1p1beta1.SecurityCenterClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.SecurityMarks() ); - client.innerApiCalls.updateSecurityMarks = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.updateSecurityMarks = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.updateSecurityMarks( request, @@ -2088,9 +2063,8 @@ describe('v1p1beta1.SecurityCenterClient', () => { const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.runAssetDiscovery = stubLongRunningCall( - expectedResponse - ); + client.innerApiCalls.runAssetDiscovery = + stubLongRunningCall(expectedResponse); const [operation] = await client.runAssetDiscovery(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); @@ -2122,9 +2096,8 @@ describe('v1p1beta1.SecurityCenterClient', () => { const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.runAssetDiscovery = stubLongRunningCallWithCallback( - expectedResponse - ); + client.innerApiCalls.runAssetDiscovery = + stubLongRunningCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.runAssetDiscovery( request, @@ -2331,9 +2304,8 @@ describe('v1p1beta1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1p1beta1.GroupResult() ), ]; - client.innerApiCalls.groupAssets = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.groupAssets = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.groupAssets( request, @@ -2413,12 +2385,12 @@ describe('v1p1beta1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1p1beta1.GroupResult() ), ]; - client.descriptors.page.groupAssets.createStream = stubPageStreamingCall( - expectedResponse - ); + client.descriptors.page.groupAssets.createStream = + stubPageStreamingCall(expectedResponse); const stream = client.groupAssetsStream(request); const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.securitycenter.v1p1beta1.GroupResult[] = []; + const responses: protos.google.cloud.securitycenter.v1p1beta1.GroupResult[] = + []; stream.on( 'data', ( @@ -2467,7 +2439,8 @@ describe('v1p1beta1.SecurityCenterClient', () => { ); const stream = client.groupAssetsStream(request); const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.securitycenter.v1p1beta1.GroupResult[] = []; + const responses: protos.google.cloud.securitycenter.v1p1beta1.GroupResult[] = + []; stream.on( 'data', ( @@ -2519,10 +2492,10 @@ describe('v1p1beta1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1p1beta1.GroupResult() ), ]; - client.descriptors.page.groupAssets.asyncIterate = stubAsyncIterationCall( - expectedResponse - ); - const responses: protos.google.cloud.securitycenter.v1p1beta1.IGroupResult[] = []; + client.descriptors.page.groupAssets.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.securitycenter.v1p1beta1.IGroupResult[] = + []; const iterable = client.groupAssetsAsync(request); for await (const resource of iterable) { responses.push(resource!); @@ -2560,7 +2533,8 @@ describe('v1p1beta1.SecurityCenterClient', () => { ); const iterable = client.groupAssetsAsync(request); await assert.rejects(async () => { - const responses: protos.google.cloud.securitycenter.v1p1beta1.IGroupResult[] = []; + const responses: protos.google.cloud.securitycenter.v1p1beta1.IGroupResult[] = + []; for await (const resource of iterable) { responses.push(resource!); } @@ -2649,9 +2623,8 @@ describe('v1p1beta1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1p1beta1.GroupResult() ), ]; - client.innerApiCalls.groupFindings = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.groupFindings = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.groupFindings( request, @@ -2731,12 +2704,12 @@ describe('v1p1beta1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1p1beta1.GroupResult() ), ]; - client.descriptors.page.groupFindings.createStream = stubPageStreamingCall( - expectedResponse - ); + client.descriptors.page.groupFindings.createStream = + stubPageStreamingCall(expectedResponse); const stream = client.groupFindingsStream(request); const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.securitycenter.v1p1beta1.GroupResult[] = []; + const responses: protos.google.cloud.securitycenter.v1p1beta1.GroupResult[] = + []; stream.on( 'data', ( @@ -2760,10 +2733,9 @@ describe('v1p1beta1.SecurityCenterClient', () => { .calledWith(client.innerApiCalls.groupFindings, request) ); assert.strictEqual( - (client.descriptors.page.groupFindings - .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.groupFindings.createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); @@ -2780,13 +2752,12 @@ describe('v1p1beta1.SecurityCenterClient', () => { request.parent = ''; const expectedHeaderRequestParams = 'parent='; const expectedError = new Error('expected'); - client.descriptors.page.groupFindings.createStream = stubPageStreamingCall( - undefined, - expectedError - ); + client.descriptors.page.groupFindings.createStream = + stubPageStreamingCall(undefined, expectedError); const stream = client.groupFindingsStream(request); const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.securitycenter.v1p1beta1.GroupResult[] = []; + const responses: protos.google.cloud.securitycenter.v1p1beta1.GroupResult[] = + []; stream.on( 'data', ( @@ -2809,10 +2780,9 @@ describe('v1p1beta1.SecurityCenterClient', () => { .calledWith(client.innerApiCalls.groupFindings, request) ); assert.strictEqual( - (client.descriptors.page.groupFindings - .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.groupFindings.createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); @@ -2839,25 +2809,25 @@ describe('v1p1beta1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1p1beta1.GroupResult() ), ]; - client.descriptors.page.groupFindings.asyncIterate = stubAsyncIterationCall( - expectedResponse - ); - const responses: protos.google.cloud.securitycenter.v1p1beta1.IGroupResult[] = []; + client.descriptors.page.groupFindings.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.securitycenter.v1p1beta1.IGroupResult[] = + []; const iterable = client.groupFindingsAsync(request); for await (const resource of iterable) { responses.push(resource!); } assert.deepStrictEqual(responses, expectedResponse); assert.deepStrictEqual( - (client.descriptors.page.groupFindings - .asyncIterate as SinonStub).getCall(0).args[1], + ( + client.descriptors.page.groupFindings.asyncIterate as SinonStub + ).getCall(0).args[1], request ); assert.strictEqual( - (client.descriptors.page.groupFindings - .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.groupFindings.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); @@ -2874,27 +2844,26 @@ describe('v1p1beta1.SecurityCenterClient', () => { request.parent = ''; const expectedHeaderRequestParams = 'parent='; const expectedError = new Error('expected'); - client.descriptors.page.groupFindings.asyncIterate = stubAsyncIterationCall( - undefined, - expectedError - ); + client.descriptors.page.groupFindings.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); const iterable = client.groupFindingsAsync(request); await assert.rejects(async () => { - const responses: protos.google.cloud.securitycenter.v1p1beta1.IGroupResult[] = []; + const responses: protos.google.cloud.securitycenter.v1p1beta1.IGroupResult[] = + []; for await (const resource of iterable) { responses.push(resource!); } }); assert.deepStrictEqual( - (client.descriptors.page.groupFindings - .asyncIterate as SinonStub).getCall(0).args[1], + ( + client.descriptors.page.groupFindings.asyncIterate as SinonStub + ).getCall(0).args[1], request ); assert.strictEqual( - (client.descriptors.page.groupFindings - .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.groupFindings.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); @@ -2969,9 +2938,8 @@ describe('v1p1beta1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult() ), ]; - client.innerApiCalls.listAssets = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.listAssets = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.listAssets( request, @@ -3051,12 +3019,12 @@ describe('v1p1beta1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult() ), ]; - client.descriptors.page.listAssets.createStream = stubPageStreamingCall( - expectedResponse - ); + client.descriptors.page.listAssets.createStream = + stubPageStreamingCall(expectedResponse); const stream = client.listAssetsStream(request); const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult[] = []; + const responses: protos.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult[] = + []; stream.on( 'data', ( @@ -3105,7 +3073,8 @@ describe('v1p1beta1.SecurityCenterClient', () => { ); const stream = client.listAssetsStream(request); const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult[] = []; + const responses: protos.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult[] = + []; stream.on( 'data', ( @@ -3157,10 +3126,10 @@ describe('v1p1beta1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult() ), ]; - client.descriptors.page.listAssets.asyncIterate = stubAsyncIterationCall( - expectedResponse - ); - const responses: protos.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.IListAssetsResult[] = []; + client.descriptors.page.listAssets.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.IListAssetsResult[] = + []; const iterable = client.listAssetsAsync(request); for await (const resource of iterable) { responses.push(resource!); @@ -3198,7 +3167,8 @@ describe('v1p1beta1.SecurityCenterClient', () => { ); const iterable = client.listAssetsAsync(request); await assert.rejects(async () => { - const responses: protos.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.IListAssetsResult[] = []; + const responses: protos.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.IListAssetsResult[] = + []; for await (const resource of iterable) { responses.push(resource!); } @@ -3287,9 +3257,8 @@ describe('v1p1beta1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult() ), ]; - client.innerApiCalls.listFindings = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.listFindings = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.listFindings( request, @@ -3369,12 +3338,12 @@ describe('v1p1beta1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult() ), ]; - client.descriptors.page.listFindings.createStream = stubPageStreamingCall( - expectedResponse - ); + client.descriptors.page.listFindings.createStream = + stubPageStreamingCall(expectedResponse); const stream = client.listFindingsStream(request); const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult[] = []; + const responses: protos.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult[] = + []; stream.on( 'data', ( @@ -3398,10 +3367,9 @@ describe('v1p1beta1.SecurityCenterClient', () => { .calledWith(client.innerApiCalls.listFindings, request) ); assert.strictEqual( - (client.descriptors.page.listFindings - .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.listFindings.createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); @@ -3424,7 +3392,8 @@ describe('v1p1beta1.SecurityCenterClient', () => { ); const stream = client.listFindingsStream(request); const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult[] = []; + const responses: protos.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult[] = + []; stream.on( 'data', ( @@ -3447,10 +3416,9 @@ describe('v1p1beta1.SecurityCenterClient', () => { .calledWith(client.innerApiCalls.listFindings, request) ); assert.strictEqual( - (client.descriptors.page.listFindings - .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.listFindings.createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); @@ -3477,25 +3445,25 @@ describe('v1p1beta1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult() ), ]; - client.descriptors.page.listFindings.asyncIterate = stubAsyncIterationCall( - expectedResponse - ); - const responses: protos.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.IListFindingsResult[] = []; + client.descriptors.page.listFindings.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.IListFindingsResult[] = + []; const iterable = client.listFindingsAsync(request); for await (const resource of iterable) { responses.push(resource!); } assert.deepStrictEqual(responses, expectedResponse); assert.deepStrictEqual( - (client.descriptors.page.listFindings - .asyncIterate as SinonStub).getCall(0).args[1], + ( + client.descriptors.page.listFindings.asyncIterate as SinonStub + ).getCall(0).args[1], request ); assert.strictEqual( - (client.descriptors.page.listFindings - .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.listFindings.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); @@ -3512,27 +3480,26 @@ describe('v1p1beta1.SecurityCenterClient', () => { request.parent = ''; const expectedHeaderRequestParams = 'parent='; const expectedError = new Error('expected'); - client.descriptors.page.listFindings.asyncIterate = stubAsyncIterationCall( - undefined, - expectedError - ); + client.descriptors.page.listFindings.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); const iterable = client.listFindingsAsync(request); await assert.rejects(async () => { - const responses: protos.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.IListFindingsResult[] = []; + const responses: protos.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.IListFindingsResult[] = + []; for await (const resource of iterable) { responses.push(resource!); } }); assert.deepStrictEqual( - (client.descriptors.page.listFindings - .asyncIterate as SinonStub).getCall(0).args[1], + ( + client.descriptors.page.listFindings.asyncIterate as SinonStub + ).getCall(0).args[1], request ); assert.strictEqual( - (client.descriptors.page.listFindings - .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.listFindings.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); @@ -3568,9 +3535,8 @@ describe('v1p1beta1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1p1beta1.NotificationConfig() ), ]; - client.innerApiCalls.listNotificationConfigs = stubSimpleCall( - expectedResponse - ); + client.innerApiCalls.listNotificationConfigs = + stubSimpleCall(expectedResponse); const [response] = await client.listNotificationConfigs(request); assert.deepStrictEqual(response, expectedResponse); assert( @@ -3609,9 +3575,8 @@ describe('v1p1beta1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1p1beta1.NotificationConfig() ), ]; - client.innerApiCalls.listNotificationConfigs = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.listNotificationConfigs = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.listNotificationConfigs( request, @@ -3694,12 +3659,12 @@ describe('v1p1beta1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1p1beta1.NotificationConfig() ), ]; - client.descriptors.page.listNotificationConfigs.createStream = stubPageStreamingCall( - expectedResponse - ); + client.descriptors.page.listNotificationConfigs.createStream = + stubPageStreamingCall(expectedResponse); const stream = client.listNotificationConfigsStream(request); const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.securitycenter.v1p1beta1.NotificationConfig[] = []; + const responses: protos.google.cloud.securitycenter.v1p1beta1.NotificationConfig[] = + []; stream.on( 'data', ( @@ -3718,16 +3683,18 @@ describe('v1p1beta1.SecurityCenterClient', () => { const responses = await promise; assert.deepStrictEqual(responses, expectedResponse); assert( - (client.descriptors.page.listNotificationConfigs - .createStream as SinonStub) + ( + client.descriptors.page.listNotificationConfigs + .createStream as SinonStub + ) .getCall(0) .calledWith(client.innerApiCalls.listNotificationConfigs, request) ); assert.strictEqual( - (client.descriptors.page.listNotificationConfigs - .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.listNotificationConfigs + .createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); @@ -3744,13 +3711,12 @@ describe('v1p1beta1.SecurityCenterClient', () => { request.parent = ''; const expectedHeaderRequestParams = 'parent='; const expectedError = new Error('expected'); - client.descriptors.page.listNotificationConfigs.createStream = stubPageStreamingCall( - undefined, - expectedError - ); + client.descriptors.page.listNotificationConfigs.createStream = + stubPageStreamingCall(undefined, expectedError); const stream = client.listNotificationConfigsStream(request); const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.securitycenter.v1p1beta1.NotificationConfig[] = []; + const responses: protos.google.cloud.securitycenter.v1p1beta1.NotificationConfig[] = + []; stream.on( 'data', ( @@ -3768,16 +3734,18 @@ describe('v1p1beta1.SecurityCenterClient', () => { }); await assert.rejects(promise, expectedError); assert( - (client.descriptors.page.listNotificationConfigs - .createStream as SinonStub) + ( + client.descriptors.page.listNotificationConfigs + .createStream as SinonStub + ) .getCall(0) .calledWith(client.innerApiCalls.listNotificationConfigs, request) ); assert.strictEqual( - (client.descriptors.page.listNotificationConfigs - .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.listNotificationConfigs + .createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); @@ -3804,25 +3772,27 @@ describe('v1p1beta1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1p1beta1.NotificationConfig() ), ]; - client.descriptors.page.listNotificationConfigs.asyncIterate = stubAsyncIterationCall( - expectedResponse - ); - const responses: protos.google.cloud.securitycenter.v1p1beta1.INotificationConfig[] = []; + client.descriptors.page.listNotificationConfigs.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.securitycenter.v1p1beta1.INotificationConfig[] = + []; const iterable = client.listNotificationConfigsAsync(request); for await (const resource of iterable) { responses.push(resource!); } assert.deepStrictEqual(responses, expectedResponse); assert.deepStrictEqual( - (client.descriptors.page.listNotificationConfigs - .asyncIterate as SinonStub).getCall(0).args[1], + ( + client.descriptors.page.listNotificationConfigs + .asyncIterate as SinonStub + ).getCall(0).args[1], request ); assert.strictEqual( - (client.descriptors.page.listNotificationConfigs - .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.listNotificationConfigs + .asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); @@ -3839,27 +3809,28 @@ describe('v1p1beta1.SecurityCenterClient', () => { request.parent = ''; const expectedHeaderRequestParams = 'parent='; const expectedError = new Error('expected'); - client.descriptors.page.listNotificationConfigs.asyncIterate = stubAsyncIterationCall( - undefined, - expectedError - ); + client.descriptors.page.listNotificationConfigs.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); const iterable = client.listNotificationConfigsAsync(request); await assert.rejects(async () => { - const responses: protos.google.cloud.securitycenter.v1p1beta1.INotificationConfig[] = []; + const responses: protos.google.cloud.securitycenter.v1p1beta1.INotificationConfig[] = + []; for await (const resource of iterable) { responses.push(resource!); } }); assert.deepStrictEqual( - (client.descriptors.page.listNotificationConfigs - .asyncIterate as SinonStub).getCall(0).args[1], + ( + client.descriptors.page.listNotificationConfigs + .asyncIterate as SinonStub + ).getCall(0).args[1], request ); assert.strictEqual( - (client.descriptors.page.listNotificationConfigs - .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.listNotificationConfigs + .asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); @@ -3934,9 +3905,8 @@ describe('v1p1beta1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1p1beta1.Source() ), ]; - client.innerApiCalls.listSources = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.listSources = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.listSources( request, @@ -4016,12 +3986,12 @@ describe('v1p1beta1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1p1beta1.Source() ), ]; - client.descriptors.page.listSources.createStream = stubPageStreamingCall( - expectedResponse - ); + client.descriptors.page.listSources.createStream = + stubPageStreamingCall(expectedResponse); const stream = client.listSourcesStream(request); const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.securitycenter.v1p1beta1.Source[] = []; + const responses: protos.google.cloud.securitycenter.v1p1beta1.Source[] = + []; stream.on( 'data', (response: protos.google.cloud.securitycenter.v1p1beta1.Source) => { @@ -4068,7 +4038,8 @@ describe('v1p1beta1.SecurityCenterClient', () => { ); const stream = client.listSourcesStream(request); const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.securitycenter.v1p1beta1.Source[] = []; + const responses: protos.google.cloud.securitycenter.v1p1beta1.Source[] = + []; stream.on( 'data', (response: protos.google.cloud.securitycenter.v1p1beta1.Source) => { @@ -4118,10 +4089,10 @@ describe('v1p1beta1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1p1beta1.Source() ), ]; - client.descriptors.page.listSources.asyncIterate = stubAsyncIterationCall( - expectedResponse - ); - const responses: protos.google.cloud.securitycenter.v1p1beta1.ISource[] = []; + client.descriptors.page.listSources.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.securitycenter.v1p1beta1.ISource[] = + []; const iterable = client.listSourcesAsync(request); for await (const resource of iterable) { responses.push(resource!); @@ -4159,7 +4130,8 @@ describe('v1p1beta1.SecurityCenterClient', () => { ); const iterable = client.listSourcesAsync(request); await assert.rejects(async () => { - const responses: protos.google.cloud.securitycenter.v1p1beta1.ISource[] = []; + const responses: protos.google.cloud.securitycenter.v1p1beta1.ISource[] = + []; for await (const resource of iterable) { responses.push(resource!); } @@ -4318,34 +4290,38 @@ describe('v1p1beta1.SecurityCenterClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.notificationConfigPathTemplate - .render as SinonStub) + ( + client.pathTemplates.notificationConfigPathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); }); it('matchOrganizationFromNotificationConfigName', () => { - const result = client.matchOrganizationFromNotificationConfigName( - fakePath - ); + const result = + client.matchOrganizationFromNotificationConfigName(fakePath); assert.strictEqual(result, 'organizationValue'); assert( - (client.pathTemplates.notificationConfigPathTemplate - .match as SinonStub) + ( + client.pathTemplates.notificationConfigPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchNotificationConfigFromNotificationConfigName', () => { - const result = client.matchNotificationConfigFromNotificationConfigName( - fakePath - ); + const result = + client.matchNotificationConfigFromNotificationConfigName(fakePath); assert.strictEqual(result, 'notificationConfigValue'); assert( - (client.pathTemplates.notificationConfigPathTemplate - .match as SinonStub) + ( + client.pathTemplates.notificationConfigPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -4401,12 +4377,10 @@ describe('v1p1beta1.SecurityCenterClient', () => { projectId: 'bogus', }); client.initialize(); - client.pathTemplates.organizationAssetSecurityMarksPathTemplate.render = sinon - .stub() - .returns(fakePath); - client.pathTemplates.organizationAssetSecurityMarksPathTemplate.match = sinon - .stub() - .returns(expectedParameters); + client.pathTemplates.organizationAssetSecurityMarksPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationAssetSecurityMarksPathTemplate.match = + sinon.stub().returns(expectedParameters); it('organizationAssetSecurityMarksPath', () => { const result = client.organizationAssetSecurityMarksPath( @@ -4415,34 +4389,40 @@ describe('v1p1beta1.SecurityCenterClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.organizationAssetSecurityMarksPathTemplate - .render as SinonStub) + ( + client.pathTemplates.organizationAssetSecurityMarksPathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); }); it('matchOrganizationFromOrganizationAssetSecurityMarksName', () => { - const result = client.matchOrganizationFromOrganizationAssetSecurityMarksName( - fakePath - ); + const result = + client.matchOrganizationFromOrganizationAssetSecurityMarksName( + fakePath + ); assert.strictEqual(result, 'organizationValue'); assert( - (client.pathTemplates.organizationAssetSecurityMarksPathTemplate - .match as SinonStub) + ( + client.pathTemplates.organizationAssetSecurityMarksPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchAssetFromOrganizationAssetSecurityMarksName', () => { - const result = client.matchAssetFromOrganizationAssetSecurityMarksName( - fakePath - ); + const result = + client.matchAssetFromOrganizationAssetSecurityMarksName(fakePath); assert.strictEqual(result, 'assetValue'); assert( - (client.pathTemplates.organizationAssetSecurityMarksPathTemplate - .match as SinonStub) + ( + client.pathTemplates.organizationAssetSecurityMarksPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -4470,21 +4450,24 @@ describe('v1p1beta1.SecurityCenterClient', () => { const result = client.organizationSettingsPath('organizationValue'); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.organizationSettingsPathTemplate - .render as SinonStub) + ( + client.pathTemplates.organizationSettingsPathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); }); it('matchOrganizationFromOrganizationSettingsName', () => { - const result = client.matchOrganizationFromOrganizationSettingsName( - fakePath - ); + const result = + client.matchOrganizationFromOrganizationSettingsName(fakePath); assert.strictEqual(result, 'organizationValue'); assert( - (client.pathTemplates.organizationSettingsPathTemplate - .match as SinonStub) + ( + client.pathTemplates.organizationSettingsPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -4503,12 +4486,10 @@ describe('v1p1beta1.SecurityCenterClient', () => { projectId: 'bogus', }); client.initialize(); - client.pathTemplates.organizationSourceFindingSecurityMarksPathTemplate.render = sinon - .stub() - .returns(fakePath); - client.pathTemplates.organizationSourceFindingSecurityMarksPathTemplate.match = sinon - .stub() - .returns(expectedParameters); + client.pathTemplates.organizationSourceFindingSecurityMarksPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationSourceFindingSecurityMarksPathTemplate.match = + sinon.stub().returns(expectedParameters); it('organizationSourceFindingSecurityMarksPath', () => { const result = client.organizationSourceFindingSecurityMarksPath( @@ -4518,51 +4499,62 @@ describe('v1p1beta1.SecurityCenterClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates - .organizationSourceFindingSecurityMarksPathTemplate - .render as SinonStub) + ( + client.pathTemplates + .organizationSourceFindingSecurityMarksPathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); }); it('matchOrganizationFromOrganizationSourceFindingSecurityMarksName', () => { - const result = client.matchOrganizationFromOrganizationSourceFindingSecurityMarksName( - fakePath - ); + const result = + client.matchOrganizationFromOrganizationSourceFindingSecurityMarksName( + fakePath + ); assert.strictEqual(result, 'organizationValue'); assert( - (client.pathTemplates - .organizationSourceFindingSecurityMarksPathTemplate - .match as SinonStub) + ( + client.pathTemplates + .organizationSourceFindingSecurityMarksPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchSourceFromOrganizationSourceFindingSecurityMarksName', () => { - const result = client.matchSourceFromOrganizationSourceFindingSecurityMarksName( - fakePath - ); + const result = + client.matchSourceFromOrganizationSourceFindingSecurityMarksName( + fakePath + ); assert.strictEqual(result, 'sourceValue'); assert( - (client.pathTemplates - .organizationSourceFindingSecurityMarksPathTemplate - .match as SinonStub) + ( + client.pathTemplates + .organizationSourceFindingSecurityMarksPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchFindingFromOrganizationSourceFindingSecurityMarksName', () => { - const result = client.matchFindingFromOrganizationSourceFindingSecurityMarksName( - fakePath - ); + const result = + client.matchFindingFromOrganizationSourceFindingSecurityMarksName( + fakePath + ); assert.strictEqual(result, 'findingValue'); assert( - (client.pathTemplates - .organizationSourceFindingSecurityMarksPathTemplate - .match as SinonStub) + ( + client.pathTemplates + .organizationSourceFindingSecurityMarksPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); From 5b3932c7968bbcc1a482da160b82f34361061016 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Tue, 11 May 2021 21:56:27 +0000 Subject: [PATCH 246/342] fix: use require() to load JSON protos (#376) The library is regenerated with gapic-generator-typescript v1.3.1. Committer: @alexander-fenster PiperOrigin-RevId: 372468161 Source-Link: https://github.com/googleapis/googleapis/commit/75880c3e6a6aa2597400582848e81bbbfac51dea Source-Link: https://github.com/googleapis/googleapis-gen/commit/77b18044813d4c8c415ff9ea68e76e307eb8e904 --- .../src/v1/security_center_client.ts | 26 +++---------------- .../src/v1beta1/security_center_client.ts | 26 +++---------------- .../src/v1p1beta1/security_center_client.ts | 26 +++---------------- 3 files changed, 12 insertions(+), 66 deletions(-) diff --git a/packages/google-cloud-securitycenter/src/v1/security_center_client.ts b/packages/google-cloud-securitycenter/src/v1/security_center_client.ts index 4d49f05bcfc..114db9a2b80 100644 --- a/packages/google-cloud-securitycenter/src/v1/security_center_client.ts +++ b/packages/google-cloud-securitycenter/src/v1/security_center_client.ts @@ -32,6 +32,7 @@ import * as path from 'path'; import {Transform} from 'stream'; import {RequestType} from 'google-gax/build/src/apitypes'; import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); /** * Client JSON configuration object, loaded from * `src/v1/security_center_client_config.json`. @@ -147,22 +148,7 @@ export class SecurityCenterClient { clientHeader.push(`${opts.libName}/${opts.libVersion}`); } // Load the applicable protos. - // For Node.js, pass the path to JSON proto file. - // For browsers, pass the JSON content. - - const nodejsProtoPath = path.join( - __dirname, - '..', - '..', - 'protos', - 'protos.json' - ); - this._protos = this._gaxGrpc.loadProto( - opts.fallback - ? // eslint-disable-next-line @typescript-eslint/no-var-requires - require('../../protos/protos.json') - : nodejsProtoPath - ); + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); // This API contains "path templates"; forward-slash-separated // identifiers to uniquely identify resources within the API. @@ -232,15 +218,11 @@ export class SecurityCenterClient { ), }; + const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos); + // This API contains "long-running operations", which return a // an Operation object that allows for tracking of the operation, // rather than holding a request open. - const protoFilesRoot = opts.fallback - ? this._gaxModule.protobuf.Root.fromJSON( - // eslint-disable-next-line @typescript-eslint/no-var-requires - require('../../protos/protos.json') - ) - : this._gaxModule.protobuf.loadSync(nodejsProtoPath); this.operationsClient = this._gaxModule .lro({ diff --git a/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.ts b/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.ts index dc0e631cfd6..773036f53d4 100644 --- a/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.ts +++ b/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.ts @@ -32,6 +32,7 @@ import * as path from 'path'; import {Transform} from 'stream'; import {RequestType} from 'google-gax/build/src/apitypes'; import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); /** * Client JSON configuration object, loaded from * `src/v1beta1/security_center_client_config.json`. @@ -147,22 +148,7 @@ export class SecurityCenterClient { clientHeader.push(`${opts.libName}/${opts.libVersion}`); } // Load the applicable protos. - // For Node.js, pass the path to JSON proto file. - // For browsers, pass the JSON content. - - const nodejsProtoPath = path.join( - __dirname, - '..', - '..', - 'protos', - 'protos.json' - ); - this._protos = this._gaxGrpc.loadProto( - opts.fallback - ? // eslint-disable-next-line @typescript-eslint/no-var-requires - require('../../protos/protos.json') - : nodejsProtoPath - ); + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); // This API contains "path templates"; forward-slash-separated // identifiers to uniquely identify resources within the API. @@ -224,15 +210,11 @@ export class SecurityCenterClient { ), }; + const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos); + // This API contains "long-running operations", which return a // an Operation object that allows for tracking of the operation, // rather than holding a request open. - const protoFilesRoot = opts.fallback - ? this._gaxModule.protobuf.Root.fromJSON( - // eslint-disable-next-line @typescript-eslint/no-var-requires - require('../../protos/protos.json') - ) - : this._gaxModule.protobuf.loadSync(nodejsProtoPath); this.operationsClient = this._gaxModule .lro({ diff --git a/packages/google-cloud-securitycenter/src/v1p1beta1/security_center_client.ts b/packages/google-cloud-securitycenter/src/v1p1beta1/security_center_client.ts index 6c143cf29b3..6afba0d2761 100644 --- a/packages/google-cloud-securitycenter/src/v1p1beta1/security_center_client.ts +++ b/packages/google-cloud-securitycenter/src/v1p1beta1/security_center_client.ts @@ -32,6 +32,7 @@ import * as path from 'path'; import {Transform} from 'stream'; import {RequestType} from 'google-gax/build/src/apitypes'; import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); /** * Client JSON configuration object, loaded from * `src/v1p1beta1/security_center_client_config.json`. @@ -147,22 +148,7 @@ export class SecurityCenterClient { clientHeader.push(`${opts.libName}/${opts.libVersion}`); } // Load the applicable protos. - // For Node.js, pass the path to JSON proto file. - // For browsers, pass the JSON content. - - const nodejsProtoPath = path.join( - __dirname, - '..', - '..', - 'protos', - 'protos.json' - ); - this._protos = this._gaxGrpc.loadProto( - opts.fallback - ? // eslint-disable-next-line @typescript-eslint/no-var-requires - require('../../protos/protos.json') - : nodejsProtoPath - ); + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); // This API contains "path templates"; forward-slash-separated // identifiers to uniquely identify resources within the API. @@ -232,15 +218,11 @@ export class SecurityCenterClient { ), }; + const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos); + // This API contains "long-running operations", which return a // an Operation object that allows for tracking of the operation, // rather than holding a request open. - const protoFilesRoot = opts.fallback - ? this._gaxModule.protobuf.Root.fromJSON( - // eslint-disable-next-line @typescript-eslint/no-var-requires - require('../../protos/protos.json') - ) - : this._gaxModule.protobuf.loadSync(nodejsProtoPath); this.operationsClient = this._gaxModule .lro({ From 1137d89995d6e3ab4e7b15ef688ae771672fa45d Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Tue, 11 May 2021 23:12:49 +0000 Subject: [PATCH 247/342] chore: update gapic-generator-typescript to v1.3.2 (#377) Committer: @alexander-fenster PiperOrigin-RevId: 372656503 Source-Link: https://github.com/googleapis/googleapis/commit/6fa858c6489b1bbc505a7d7afe39f2dc45819c38 Source-Link: https://github.com/googleapis/googleapis-gen/commit/d7c95df3ab1ea1b4c22a4542bad4924cc46d1388 --- .../google-cloud-securitycenter/src/v1/security_center_client.ts | 1 - .../src/v1beta1/security_center_client.ts | 1 - .../src/v1p1beta1/security_center_client.ts | 1 - 3 files changed, 3 deletions(-) diff --git a/packages/google-cloud-securitycenter/src/v1/security_center_client.ts b/packages/google-cloud-securitycenter/src/v1/security_center_client.ts index 114db9a2b80..c997ce63a64 100644 --- a/packages/google-cloud-securitycenter/src/v1/security_center_client.ts +++ b/packages/google-cloud-securitycenter/src/v1/security_center_client.ts @@ -27,7 +27,6 @@ import { PaginationCallback, GaxCall, } from 'google-gax'; -import * as path from 'path'; import {Transform} from 'stream'; import {RequestType} from 'google-gax/build/src/apitypes'; diff --git a/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.ts b/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.ts index 773036f53d4..71a07a887d3 100644 --- a/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.ts +++ b/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.ts @@ -27,7 +27,6 @@ import { PaginationCallback, GaxCall, } from 'google-gax'; -import * as path from 'path'; import {Transform} from 'stream'; import {RequestType} from 'google-gax/build/src/apitypes'; diff --git a/packages/google-cloud-securitycenter/src/v1p1beta1/security_center_client.ts b/packages/google-cloud-securitycenter/src/v1p1beta1/security_center_client.ts index 6afba0d2761..25cedb86a03 100644 --- a/packages/google-cloud-securitycenter/src/v1p1beta1/security_center_client.ts +++ b/packages/google-cloud-securitycenter/src/v1p1beta1/security_center_client.ts @@ -27,7 +27,6 @@ import { PaginationCallback, GaxCall, } from 'google-gax'; -import * as path from 'path'; import {Transform} from 'stream'; import {RequestType} from 'google-gax/build/src/apitypes'; From f4e729dec2d5c69896e6167442c2a047dd118f10 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Wed, 12 May 2021 15:54:03 +0000 Subject: [PATCH 248/342] feat(v1p1beta1): add canonical_name and folder fields (#378) Assets and findings may be created in organizations, folders or projects, however in the current API version the name field for resources will always be prefixed by "organizations/...", for historical reasons. The "canonical_name" field shows the actual location of the resource, and in requests either the name or "canonical name" can be used for the "name" in the request. The "folder" field contains the folders in the resource's ancestry. PiperOrigin-RevId: 372964926 Source-Link: https://github.com/googleapis/googleapis/commit/1d3573f5124e2f9ffdd174c6992269ea7f1e92a6 Source-Link: https://github.com/googleapis/googleapis-gen/commit/97932dbce252ed5983cf73063e8b6f9d812a8321 --- .../securitycenter/v1p1beta1/asset.proto | 22 +- .../securitycenter/v1p1beta1/finding.proto | 17 +- .../securitycenter/v1p1beta1/folder.proto | 38 + .../v1p1beta1/notification_config.proto | 10 +- .../v1p1beta1/notification_message.proto | 5 +- .../v1p1beta1/organization_settings.proto | 8 +- .../securitycenter/v1p1beta1/resource.proto | 9 +- .../run_asset_discovery_response.proto | 4 +- .../v1p1beta1/security_marks.proto | 18 +- .../v1p1beta1/securitycenter_service.proto | 111 ++- .../securitycenter/v1p1beta1/source.proto | 14 +- .../protos/protos.d.ts | 144 +++ .../protos/protos.js | 476 +++++++++- .../protos/protos.json | 188 +++- .../src/v1p1beta1/security_center_client.ts | 744 +++++++++++++-- .../v1p1beta1/security_center_proto_list.json | 1 + .../test/gapic_security_center_v1p1beta1.ts | 861 ++++++++++++++++-- 17 files changed, 2426 insertions(+), 244 deletions(-) create mode 100644 packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/folder.proto diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/asset.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/asset.proto index bfcae368859..9ee30783f7f 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/asset.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/asset.proto @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// 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. @@ -16,11 +16,12 @@ syntax = "proto3"; package google.cloud.securitycenter.v1p1beta1; -import "google/api/annotations.proto"; import "google/api/resource.proto"; +import "google/cloud/securitycenter/v1p1beta1/folder.proto"; import "google/cloud/securitycenter/v1p1beta1/security_marks.proto"; import "google/protobuf/struct.proto"; import "google/protobuf/timestamp.proto"; +import "google/api/annotations.proto"; option csharp_namespace = "Google.Cloud.SecurityCenter.V1P1Beta1"; option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1p1beta1;securitycenter"; @@ -40,6 +41,8 @@ message Asset { option (google.api.resource) = { type: "securitycenter.googleapis.com/Asset" pattern: "organizations/{organization}/assets/{asset}" + pattern: "folders/{folder}/assets/{asset}" + pattern: "projects/{project}/assets/{asset}" }; // Security Command Center managed properties. These properties are managed by @@ -75,6 +78,11 @@ message Asset { // The user defined display name for the project of this resource. string resource_project_display_name = 8; + + // Contains a Folder message for each folder in the assets ancestry. + // The first folder is the deepest nested folder, and the last folder is the + // folder directly under the Organization. + repeated Folder folders = 10; } // Cloud IAM Policy information associated with the Google Cloud resource @@ -109,8 +117,7 @@ message Asset { // The time at which the asset was created in Security Command Center. google.protobuf.Timestamp create_time = 9; - // The time at which the asset was last updated, added, or deleted in Cloud - // SCC. + // The time at which the asset was last updated or added in Cloud SCC. google.protobuf.Timestamp update_time = 10; // Cloud IAM Policy information associated with the Google Cloud resource @@ -118,4 +125,11 @@ message Asset { // and defined by the Google Cloud resource and cannot be modified by the // user. IamPolicy iam_policy = 11; + + // The canonical name of the resource. It's either + // "organizations/{organization_id}/assets/{asset_id}", + // "folders/{folder_id}/assets/{asset_id}" or + // "projects/{project_number}/assets/{asset_id}", depending on the closest CRM + // ancestor of the resource. + string canonical_name = 13; } diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/finding.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/finding.proto index 551f1ceea71..572a368f8e0 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/finding.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/finding.proto @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// 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. @@ -16,12 +16,12 @@ syntax = "proto3"; package google.cloud.securitycenter.v1p1beta1; -import "google/api/annotations.proto"; import "google/api/field_behavior.proto"; import "google/api/resource.proto"; import "google/cloud/securitycenter/v1p1beta1/security_marks.proto"; import "google/protobuf/struct.proto"; import "google/protobuf/timestamp.proto"; +import "google/api/annotations.proto"; option csharp_namespace = "Google.Cloud.SecurityCenter.V1P1Beta1"; option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1p1beta1;securitycenter"; @@ -40,6 +40,8 @@ message Finding { option (google.api.resource) = { type: "securitycenter.googleapis.com/Finding" pattern: "organizations/{organization}/sources/{source}/findings/{finding}" + pattern: "folders/{folder}/sources/{source}/findings/{finding}" + pattern: "projects/{project}/sources/{source}/findings/{finding}" }; // The state of the finding. @@ -123,7 +125,8 @@ message Finding { // occurred. For example, if the finding represents an open firewall it would // capture the time the detector believes the firewall became open. The // accuracy is determined by the detector. If the finding were to be resolved - // afterward, this time would reflect when the finding was resolved. + // afterward, this time would reflect when the finding was resolved. Must not + // be set to a value greater than the current timestamp. google.protobuf.Timestamp event_time = 9; // The time at which the finding was created in Security Command Center. @@ -132,4 +135,12 @@ message Finding { // The severity of the finding. This field is managed by the source that // writes the finding. Severity severity = 13; + + // The canonical name of the finding. It's either + // "organizations/{organization_id}/sources/{source_id}/findings/{finding_id}", + // "folders/{folder_id}/sources/{source_id}/findings/{finding_id}" or + // "projects/{project_number}/sources/{source_id}/findings/{finding_id}", + // depending on the closest CRM ancestor of the resource associated with the + // finding. + string canonical_name = 14; } diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/folder.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/folder.proto new file mode 100644 index 00000000000..ec6df5edda3 --- /dev/null +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/folder.proto @@ -0,0 +1,38 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.securitycenter.v1p1beta1; + +import "google/api/annotations.proto"; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V1P1Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1p1beta1;securitycenter"; +option java_multiple_files = true; +option java_outer_classname = "FolderProto"; +option java_package = "com.google.cloud.securitycenter.v1p1beta1"; +option php_namespace = "Google\\Cloud\\SecurityCenter\\V1p1beta1"; +option ruby_package = "Google::Cloud::SecurityCenter::V1p1Beta1"; + +// Message that contains the resource name and display name of a folder +// resource. +message Folder { + // Full resource name of this folder. See: + // https://cloud.google.com/apis/design/resource_names#full_resource_name + string resource_folder = 1; + + // The user defined display name for this folder. + string resource_folder_display_name = 2; +} diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/notification_config.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/notification_config.proto index 6f9e596691b..be5f6e0f532 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/notification_config.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/notification_config.proto @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// 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. @@ -16,9 +16,9 @@ syntax = "proto3"; package google.cloud.securitycenter.v1p1beta1; -import "google/api/annotations.proto"; import "google/api/field_behavior.proto"; import "google/api/resource.proto"; +import "google/api/annotations.proto"; option csharp_namespace = "Google.Cloud.SecurityCenter.V1P1Beta1"; option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1p1beta1;securitycenter"; @@ -92,9 +92,9 @@ message NotificationConfig { // The Pub/Sub topic to send notifications to. Its format is // "projects/[project_id]/topics/[topic]". - string pubsub_topic = 4 [ - (google.api.resource_reference) = { type: "pubsub.googleapis.com/Topic" } - ]; + string pubsub_topic = 4 [(google.api.resource_reference) = { + type: "pubsub.googleapis.com/Topic" + }]; // Output only. The service account that needs "pubsub.topics.publish" // permission to publish to the Pub/Sub topic. diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/notification_message.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/notification_message.proto index fd3c23b6344..5e671dd01d0 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/notification_message.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/notification_message.proto @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// 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. @@ -16,10 +16,9 @@ syntax = "proto3"; package google.cloud.securitycenter.v1p1beta1; -import "google/api/annotations.proto"; -import "google/cloud/securitycenter/v1p1beta1/asset.proto"; import "google/cloud/securitycenter/v1p1beta1/finding.proto"; import "google/cloud/securitycenter/v1p1beta1/resource.proto"; +import "google/api/annotations.proto"; option csharp_namespace = "Google.Cloud.SecurityCenter.V1P1Beta1"; option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1p1beta1;securitycenter"; diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/organization_settings.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/organization_settings.proto index 1be72dd7b6c..ad36d58a17b 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/organization_settings.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/organization_settings.proto @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// 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. @@ -16,8 +16,8 @@ syntax = "proto3"; package google.cloud.securitycenter.v1p1beta1; -import "google/api/annotations.proto"; import "google/api/resource.proto"; +import "google/api/annotations.proto"; option csharp_namespace = "Google.Cloud.SecurityCenter.V1P1Beta1"; option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1p1beta1;securitycenter"; @@ -63,6 +63,10 @@ message OrganizationSettings { // The mode to use for filtering asset discovery. InclusionMode inclusion_mode = 2; + + // The folder ids to use for filtering asset discovery. + // It consists of only digits, e.g., 756619654966. + repeated string folder_ids = 3; } // The relative resource name of the settings. See: diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/resource.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/resource.proto index 6b8570993fc..0fe2d362a6e 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/resource.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/resource.proto @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// 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. @@ -16,6 +16,8 @@ syntax = "proto3"; package google.cloud.securitycenter.v1p1beta1; +import "google/api/field_behavior.proto"; +import "google/cloud/securitycenter/v1p1beta1/folder.proto"; import "google/api/annotations.proto"; option csharp_namespace = "Google.Cloud.SecurityCenter.V1P1Beta1"; @@ -43,4 +45,9 @@ message Resource { // The human readable name of resource's parent. string parent_display_name = 5; + + // Output only. Contains a Folder message for each folder in the assets ancestry. + // The first folder is the deepest nested folder, and the last folder is the + // folder directly under the Organization. + repeated Folder folders = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; } diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/run_asset_discovery_response.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/run_asset_discovery_response.proto index 720ffc4fae6..d867d201fae 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/run_asset_discovery_response.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/run_asset_discovery_response.proto @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// 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. @@ -16,8 +16,8 @@ syntax = "proto3"; package google.cloud.securitycenter.v1p1beta1; -import "google/api/annotations.proto"; import "google/protobuf/duration.proto"; +import "google/api/annotations.proto"; option csharp_namespace = "Google.Cloud.SecurityCenter.V1P1Beta1"; option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1p1beta1;securitycenter"; diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/security_marks.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/security_marks.proto index 11a1dd85ab2..22db26cbad3 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/security_marks.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/security_marks.proto @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// 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. @@ -16,8 +16,8 @@ syntax = "proto3"; package google.cloud.securitycenter.v1p1beta1; -import "google/api/annotations.proto"; import "google/api/resource.proto"; +import "google/api/annotations.proto"; option csharp_namespace = "Google.Cloud.SecurityCenter.V1P1Beta1"; option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1p1beta1;securitycenter"; @@ -35,6 +35,10 @@ message SecurityMarks { type: "securitycenter.googleapis.com/SecurityMarks" pattern: "organizations/{organization}/assets/{asset}/securityMarks" pattern: "organizations/{organization}/sources/{source}/findings/{finding}/securityMarks" + pattern: "folders/{folder}/assets/{asset}/securityMarks" + pattern: "projects/{project}/assets/{asset}/securityMarks" + pattern: "folders/{folder}/sources/{source}/findings/{finding}/securityMarks" + pattern: "projects/{project}/sources/{source}/findings/{finding}/securityMarks" }; // The relative resource name of the SecurityMarks. See: @@ -53,4 +57,14 @@ message SecurityMarks { // * Values have leading and trailing whitespace trimmed, remaining // characters must be between 1 - 4096 characters (inclusive) map marks = 2; + + // The canonical name of the marks. + // Examples: + // "organizations/{organization_id}/assets/{asset_id}/securityMarks" + // "folders/{folder_id}/assets/{asset_id}/securityMarks" + // "projects/{project_number}/assets/{asset_id}/securityMarks" + // "organizations/{organization_id}/sources/{source_id}/findings/{finding_id}/securityMarks" + // "folders/{folder_id}/sources/{source_id}/findings/{finding_id}/securityMarks" + // "projects/{project_number}/sources/{source_id}/findings/{finding_id}/securityMarks" + string canonical_name = 3; } diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/securitycenter_service.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/securitycenter_service.proto index f8f1580f83c..d127dd7214a 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/securitycenter_service.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/securitycenter_service.proto @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// 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. @@ -24,6 +24,7 @@ import "google/api/field_behavior.proto"; import "google/api/resource.proto"; import "google/cloud/securitycenter/v1p1beta1/asset.proto"; import "google/cloud/securitycenter/v1p1beta1/finding.proto"; +import "google/cloud/securitycenter/v1p1beta1/folder.proto"; import "google/cloud/securitycenter/v1p1beta1/notification_config.proto"; import "google/cloud/securitycenter/v1p1beta1/organization_settings.proto"; import "google/cloud/securitycenter/v1p1beta1/security_marks.proto"; @@ -126,6 +127,14 @@ service SecurityCenter { option (google.api.http) = { post: "/v1p1beta1/{parent=organizations/*}/assets:group" body: "*" + additional_bindings { + post: "/v1p1beta1/{parent=folders/*}/assets:group" + body: "*" + } + additional_bindings { + post: "/v1p1beta1/{parent=projects/*}/assets:group" + body: "*" + } }; } @@ -133,11 +142,21 @@ service SecurityCenter { // specified properties. // // To group across all sources provide a `-` as the source id. - // Example: /v1p1beta1/organizations/{organization_id}/sources/-/findings + // Example: /v1/organizations/{organization_id}/sources/-/findings, + // /v1/folders/{folder_id}/sources/-/findings, + // /v1/projects/{project_id}/sources/-/findings rpc GroupFindings(GroupFindingsRequest) returns (GroupFindingsResponse) { option (google.api.http) = { post: "/v1p1beta1/{parent=organizations/*/sources/*}/findings:group" body: "*" + additional_bindings { + post: "/v1p1beta1/{parent=folders/*/sources/*}/findings:group" + body: "*" + } + additional_bindings { + post: "/v1p1beta1/{parent=projects/*/sources/*}/findings:group" + body: "*" + } }; option (google.api.method_signature) = "parent,group_by"; } @@ -146,6 +165,12 @@ service SecurityCenter { rpc ListAssets(ListAssetsRequest) returns (ListAssetsResponse) { option (google.api.http) = { get: "/v1p1beta1/{parent=organizations/*}/assets" + additional_bindings { + get: "/v1p1beta1/{parent=folders/*}/assets" + } + additional_bindings { + get: "/v1p1beta1/{parent=projects/*}/assets" + } }; option (google.api.method_signature) = "parent"; } @@ -157,6 +182,12 @@ service SecurityCenter { rpc ListFindings(ListFindingsRequest) returns (ListFindingsResponse) { option (google.api.http) = { get: "/v1p1beta1/{parent=organizations/*/sources/*}/findings" + additional_bindings { + get: "/v1p1beta1/{parent=folders/*/sources/*}/findings" + } + additional_bindings { + get: "/v1p1beta1/{parent=projects/*/sources/*}/findings" + } }; option (google.api.method_signature) = "parent"; } @@ -173,6 +204,12 @@ service SecurityCenter { rpc ListSources(ListSourcesRequest) returns (ListSourcesResponse) { option (google.api.http) = { get: "/v1p1beta1/{parent=organizations/*}/sources" + additional_bindings { + get: "/v1p1beta1/{parent=folders/*}/sources" + } + additional_bindings { + get: "/v1p1beta1/{parent=projects/*}/sources" + } }; option (google.api.method_signature) = "parent"; } @@ -200,6 +237,14 @@ service SecurityCenter { option (google.api.http) = { post: "/v1p1beta1/{name=organizations/*/sources/*/findings/*}:setState" body: "*" + additional_bindings { + post: "/v1p1beta1/{name=folders/*/sources/*/findings/*}:setState" + body: "*" + } + additional_bindings { + post: "/v1p1beta1/{name=projects/*/sources/*/findings/*}:setState" + body: "*" + } }; option (google.api.method_signature) = "name,state,start_time"; } @@ -228,6 +273,14 @@ service SecurityCenter { option (google.api.http) = { patch: "/v1p1beta1/{finding.name=organizations/*/sources/*/findings/*}" body: "finding" + additional_bindings { + patch: "/v1p1beta1/{finding.name=folders/*/sources/*/findings/*}" + body: "finding" + } + additional_bindings { + patch: "/v1p1beta1/{finding.name=projects/*/sources/*/findings/*}" + body: "finding" + } }; option (google.api.method_signature) = "finding"; option (google.api.method_signature) = "finding,update_mask"; @@ -268,10 +321,26 @@ service SecurityCenter { option (google.api.http) = { patch: "/v1p1beta1/{security_marks.name=organizations/*/assets/*/securityMarks}" body: "security_marks" + additional_bindings { + patch: "/v1p1beta1/{security_marks.name=folders/*/assets/*/securityMarks}" + body: "security_marks" + } + additional_bindings { + patch: "/v1p1beta1/{security_marks.name=projects/*/assets/*/securityMarks}" + body: "security_marks" + } additional_bindings { patch: "/v1p1beta1/{security_marks.name=organizations/*/sources/*/findings/*/securityMarks}" body: "security_marks" } + additional_bindings { + patch: "/v1p1beta1/{security_marks.name=folders/*/sources/*/findings/*/securityMarks}" + body: "security_marks" + } + additional_bindings { + patch: "/v1p1beta1/{security_marks.name=projects/*/sources/*/findings/*/securityMarks}" + body: "security_marks" + } }; option (google.api.method_signature) = "security_marks"; option (google.api.method_signature) = "security_marks,update_mask"; @@ -385,11 +454,12 @@ message GetSourceRequest { // Request message for grouping by assets. message GroupAssetsRequest { // Required. Name of the organization to groupBy. Its format is - // "organizations/[organization_id]". + // "organizations/[organization_id], folders/[folder_id], or + // projects/[project_id]". string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { - type: "cloudresourcemanager.googleapis.com/Organization" + child_type: "securitycenter.googleapis.com/Asset" } ]; @@ -543,9 +613,12 @@ message GroupAssetsResponse { // Request message for grouping by findings. message GroupFindingsRequest { // Required. Name of the source to groupBy. Its format is - // "organizations/[organization_id]/sources/[source_id]". To groupBy across - // all sources provide a source_id of `-`. For example: - // organizations/{organization_id}/sources/- + // "organizations/[organization_id]/sources/[source_id]", + // folders/[folder_id]/sources/[source_id], or + // projects/[project_id]/sources/[source_id]. To groupBy across all sources + // provide a source_id of `-`. For example: + // organizations/{organization_id}/sources/-, folders/{folder_id}/sources/-, + // or projects/{project_id}/sources/- string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -733,11 +806,12 @@ message ListNotificationConfigsResponse { // Request message for listing sources. message ListSourcesRequest { // Required. Resource name of the parent of sources to list. Its format should be - // "organizations/[organization_id]". + // "organizations/[organization_id], folders/[folder_id], or + // projects/[project_id]". string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { - type: "cloudresourcemanager.googleapis.com/Organization" + child_type: "securitycenter.googleapis.com/Source" } ]; @@ -764,11 +838,12 @@ message ListSourcesResponse { // Request message for listing assets. message ListAssetsRequest { // Required. Name of the organization assets should belong to. Its format is - // "organizations/[organization_id]". + // "organizations/[organization_id], folders/[folder_id], or + // projects/[project_id]". string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { - type: "cloudresourcemanager.googleapis.com/Organization" + child_type: "securitycenter.googleapis.com/Asset" } ]; @@ -954,9 +1029,12 @@ message ListAssetsResponse { // Request message for listing findings. message ListFindingsRequest { // Required. Name of the source the findings belong to. Its format is - // "organizations/[organization_id]/sources/[source_id]". To list across all - // sources provide a source_id of `-`. For example: - // organizations/{organization_id}/sources/- + // "organizations/[organization_id]/sources/[source_id], + // folders/[folder_id]/sources/[source_id], or + // projects/[project_id]/sources/[source_id]". To list across all sources + // provide a source_id of `-`. For example: + // organizations/{organization_id}/sources/-, folders/{folder_id}/sources/- or + // projects/{projects_id}/sources/- string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -1110,6 +1188,11 @@ message ListFindingsResponse { // The human readable name of resource's parent. string parent_display_name = 5; + + // Contains a Folder message for each folder in the assets ancestry. + // The first folder is the deepest nested folder, and the last folder is + // the folder directly under the Organization. + repeated Folder folders = 10; } // The change in state of the finding. diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/source.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/source.proto index 0e940df627a..5f36167ad16 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/source.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/source.proto @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// 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. @@ -16,8 +16,8 @@ syntax = "proto3"; package google.cloud.securitycenter.v1p1beta1; -import "google/api/annotations.proto"; import "google/api/resource.proto"; +import "google/api/annotations.proto"; option csharp_namespace = "Google.Cloud.SecurityCenter.V1P1Beta1"; option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1p1beta1;securitycenter"; @@ -33,6 +33,8 @@ message Source { option (google.api.resource) = { type: "securitycenter.googleapis.com/Source" pattern: "organizations/{organization}/sources/{source}" + pattern: "folders/{folder}/sources/{source}" + pattern: "projects/{project}/sources/{source}" }; // The relative resource name of this source. See: @@ -56,4 +58,12 @@ message Source { // (XSS), Flash injection, mixed content (HTTP in HTTPS), and // outdated/insecure libraries." string description = 3; + + // The canonical name of the finding. It's either + // "organizations/{organization_id}/sources/{source_id}", + // "folders/{folder_id}/sources/{source_id}" or + // "projects/{project_number}/sources/{source_id}", + // depending on the closest CRM ancestor of the resource associated with the + // finding. + string canonical_name = 14; } diff --git a/packages/google-cloud-securitycenter/protos/protos.d.ts b/packages/google-cloud-securitycenter/protos/protos.d.ts index 511510bc5dc..6817598cec6 100644 --- a/packages/google-cloud-securitycenter/protos/protos.d.ts +++ b/packages/google-cloud-securitycenter/protos/protos.d.ts @@ -8746,6 +8746,9 @@ export namespace google { /** Asset iamPolicy */ iamPolicy?: (google.cloud.securitycenter.v1p1beta1.Asset.IIamPolicy|null); + + /** Asset canonicalName */ + canonicalName?: (string|null); } /** Represents an Asset. */ @@ -8778,6 +8781,9 @@ export namespace google { /** Asset iamPolicy. */ public iamPolicy?: (google.cloud.securitycenter.v1p1beta1.Asset.IIamPolicy|null); + /** Asset canonicalName. */ + public canonicalName: string; + /** * Creates a new Asset instance using the specified properties. * @param [properties] Properties to set @@ -8877,6 +8883,9 @@ export namespace google { /** SecurityCenterProperties resourceProjectDisplayName */ resourceProjectDisplayName?: (string|null); + + /** SecurityCenterProperties folders */ + folders?: (google.cloud.securitycenter.v1p1beta1.IFolder[]|null); } /** Represents a SecurityCenterProperties. */ @@ -8912,6 +8921,9 @@ export namespace google { /** SecurityCenterProperties resourceProjectDisplayName. */ public resourceProjectDisplayName: string; + /** SecurityCenterProperties folders. */ + public folders: google.cloud.securitycenter.v1p1beta1.IFolder[]; + /** * Creates a new SecurityCenterProperties instance using the specified properties. * @param [properties] Properties to set @@ -9074,6 +9086,102 @@ export namespace google { } } + /** Properties of a Folder. */ + interface IFolder { + + /** Folder resourceFolder */ + resourceFolder?: (string|null); + + /** Folder resourceFolderDisplayName */ + resourceFolderDisplayName?: (string|null); + } + + /** Represents a Folder. */ + class Folder implements IFolder { + + /** + * Constructs a new Folder. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1p1beta1.IFolder); + + /** Folder resourceFolder. */ + public resourceFolder: string; + + /** Folder resourceFolderDisplayName. */ + public resourceFolderDisplayName: string; + + /** + * Creates a new Folder instance using the specified properties. + * @param [properties] Properties to set + * @returns Folder instance + */ + public static create(properties?: google.cloud.securitycenter.v1p1beta1.IFolder): google.cloud.securitycenter.v1p1beta1.Folder; + + /** + * Encodes the specified Folder message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.Folder.verify|verify} messages. + * @param message Folder message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1p1beta1.IFolder, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Folder message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.Folder.verify|verify} messages. + * @param message Folder message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1p1beta1.IFolder, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Folder message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Folder + * @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.cloud.securitycenter.v1p1beta1.Folder; + + /** + * Decodes a Folder message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Folder + * @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.cloud.securitycenter.v1p1beta1.Folder; + + /** + * Verifies a Folder 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 Folder message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Folder + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1p1beta1.Folder; + + /** + * Creates a plain object from a Folder message. Also converts values to other types if specified. + * @param message Folder + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1p1beta1.Folder, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Folder to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + /** Properties of a SecurityMarks. */ interface ISecurityMarks { @@ -9082,6 +9190,9 @@ export namespace google { /** SecurityMarks marks */ marks?: ({ [k: string]: string }|null); + + /** SecurityMarks canonicalName */ + canonicalName?: (string|null); } /** Represents a SecurityMarks. */ @@ -9099,6 +9210,9 @@ export namespace google { /** SecurityMarks marks. */ public marks: { [k: string]: string }; + /** SecurityMarks canonicalName. */ + public canonicalName: string; + /** * Creates a new SecurityMarks instance using the specified properties. * @param [properties] Properties to set @@ -9205,6 +9319,9 @@ export namespace google { /** Finding severity */ severity?: (google.cloud.securitycenter.v1p1beta1.Finding.Severity|keyof typeof google.cloud.securitycenter.v1p1beta1.Finding.Severity|null); + + /** Finding canonicalName */ + canonicalName?: (string|null); } /** Represents a Finding. */ @@ -9249,6 +9366,9 @@ export namespace google { /** Finding severity. */ public severity: (google.cloud.securitycenter.v1p1beta1.Finding.Severity|keyof typeof google.cloud.securitycenter.v1p1beta1.Finding.Severity); + /** Finding canonicalName. */ + public canonicalName: string; + /** * Creates a new Finding instance using the specified properties. * @param [properties] Properties to set @@ -9683,6 +9803,9 @@ export namespace google { /** Resource parentDisplayName */ parentDisplayName?: (string|null); + + /** Resource folders */ + folders?: (google.cloud.securitycenter.v1p1beta1.IFolder[]|null); } /** Represents a Resource. */ @@ -9709,6 +9832,9 @@ export namespace google { /** Resource parentDisplayName. */ public parentDisplayName: string; + /** Resource folders. */ + public folders: google.cloud.securitycenter.v1p1beta1.IFolder[]; + /** * Creates a new Resource instance using the specified properties. * @param [properties] Properties to set @@ -9892,6 +10018,9 @@ export namespace google { /** AssetDiscoveryConfig inclusionMode */ inclusionMode?: (google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode|keyof typeof google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode|null); + + /** AssetDiscoveryConfig folderIds */ + folderIds?: (string[]|null); } /** Represents an AssetDiscoveryConfig. */ @@ -9909,6 +10038,9 @@ export namespace google { /** AssetDiscoveryConfig inclusionMode. */ public inclusionMode: (google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode|keyof typeof google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode); + /** AssetDiscoveryConfig folderIds. */ + public folderIds: string[]; + /** * Creates a new AssetDiscoveryConfig instance using the specified properties. * @param [properties] Properties to set @@ -12938,6 +13070,9 @@ export namespace google { /** Resource parentDisplayName */ parentDisplayName?: (string|null); + + /** Resource folders */ + folders?: (google.cloud.securitycenter.v1p1beta1.IFolder[]|null); } /** Represents a Resource. */ @@ -12964,6 +13099,9 @@ export namespace google { /** Resource parentDisplayName. */ public parentDisplayName: string; + /** Resource folders. */ + public folders: google.cloud.securitycenter.v1p1beta1.IFolder[]; + /** * Creates a new Resource instance using the specified properties. * @param [properties] Properties to set @@ -13735,6 +13873,9 @@ export namespace google { /** Source description */ description?: (string|null); + + /** Source canonicalName */ + canonicalName?: (string|null); } /** Represents a Source. */ @@ -13755,6 +13896,9 @@ export namespace google { /** Source description. */ public description: string; + /** Source canonicalName. */ + public canonicalName: string; + /** * Creates a new Source instance using the specified properties. * @param [properties] Properties to set diff --git a/packages/google-cloud-securitycenter/protos/protos.js b/packages/google-cloud-securitycenter/protos/protos.js index 1170d0419e2..c4de7ef4235 100644 --- a/packages/google-cloud-securitycenter/protos/protos.js +++ b/packages/google-cloud-securitycenter/protos/protos.js @@ -20711,6 +20711,7 @@ * @property {google.protobuf.ITimestamp|null} [createTime] Asset createTime * @property {google.protobuf.ITimestamp|null} [updateTime] Asset updateTime * @property {google.cloud.securitycenter.v1p1beta1.Asset.IIamPolicy|null} [iamPolicy] Asset iamPolicy + * @property {string|null} [canonicalName] Asset canonicalName */ /** @@ -20785,6 +20786,14 @@ */ Asset.prototype.iamPolicy = null; + /** + * Asset canonicalName. + * @member {string} canonicalName + * @memberof google.cloud.securitycenter.v1p1beta1.Asset + * @instance + */ + Asset.prototype.canonicalName = ""; + /** * Creates a new Asset instance using the specified properties. * @function create @@ -20826,6 +20835,8 @@ $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); if (message.iamPolicy != null && Object.hasOwnProperty.call(message, "iamPolicy")) $root.google.cloud.securitycenter.v1p1beta1.Asset.IamPolicy.encode(message.iamPolicy, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.canonicalName != null && Object.hasOwnProperty.call(message, "canonicalName")) + writer.uint32(/* id 13, wireType 2 =*/106).string(message.canonicalName); return writer; }; @@ -20900,6 +20911,9 @@ case 11: message.iamPolicy = $root.google.cloud.securitycenter.v1p1beta1.Asset.IamPolicy.decode(reader, reader.uint32()); break; + case 13: + message.canonicalName = reader.string(); + break; default: reader.skipType(tag & 7); break; @@ -20973,6 +20987,9 @@ if (error) return "iamPolicy." + error; } + if (message.canonicalName != null && message.hasOwnProperty("canonicalName")) + if (!$util.isString(message.canonicalName)) + return "canonicalName: string expected"; return null; }; @@ -21025,6 +21042,8 @@ throw TypeError(".google.cloud.securitycenter.v1p1beta1.Asset.iamPolicy: object expected"); message.iamPolicy = $root.google.cloud.securitycenter.v1p1beta1.Asset.IamPolicy.fromObject(object.iamPolicy); } + if (object.canonicalName != null) + message.canonicalName = String(object.canonicalName); return message; }; @@ -21050,6 +21069,7 @@ object.createTime = null; object.updateTime = null; object.iamPolicy = null; + object.canonicalName = ""; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -21069,6 +21089,8 @@ object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); if (message.iamPolicy != null && message.hasOwnProperty("iamPolicy")) object.iamPolicy = $root.google.cloud.securitycenter.v1p1beta1.Asset.IamPolicy.toObject(message.iamPolicy, options); + if (message.canonicalName != null && message.hasOwnProperty("canonicalName")) + object.canonicalName = message.canonicalName; return object; }; @@ -21097,6 +21119,7 @@ * @property {string|null} [resourceDisplayName] SecurityCenterProperties resourceDisplayName * @property {string|null} [resourceParentDisplayName] SecurityCenterProperties resourceParentDisplayName * @property {string|null} [resourceProjectDisplayName] SecurityCenterProperties resourceProjectDisplayName + * @property {Array.|null} [folders] SecurityCenterProperties folders */ /** @@ -21109,6 +21132,7 @@ */ function SecurityCenterProperties(properties) { this.resourceOwners = []; + this.folders = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -21179,6 +21203,14 @@ */ SecurityCenterProperties.prototype.resourceProjectDisplayName = ""; + /** + * SecurityCenterProperties folders. + * @member {Array.} folders + * @memberof google.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterProperties + * @instance + */ + SecurityCenterProperties.prototype.folders = $util.emptyArray; + /** * Creates a new SecurityCenterProperties instance using the specified properties. * @function create @@ -21220,6 +21252,9 @@ writer.uint32(/* id 7, wireType 2 =*/58).string(message.resourceParentDisplayName); if (message.resourceProjectDisplayName != null && Object.hasOwnProperty.call(message, "resourceProjectDisplayName")) writer.uint32(/* id 8, wireType 2 =*/66).string(message.resourceProjectDisplayName); + if (message.folders != null && message.folders.length) + for (var i = 0; i < message.folders.length; ++i) + $root.google.cloud.securitycenter.v1p1beta1.Folder.encode(message.folders[i], writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); return writer; }; @@ -21280,6 +21315,11 @@ case 8: message.resourceProjectDisplayName = reader.string(); break; + case 10: + if (!(message.folders && message.folders.length)) + message.folders = []; + message.folders.push($root.google.cloud.securitycenter.v1p1beta1.Folder.decode(reader, reader.uint32())); + break; default: reader.skipType(tag & 7); break; @@ -21343,6 +21383,15 @@ if (message.resourceProjectDisplayName != null && message.hasOwnProperty("resourceProjectDisplayName")) if (!$util.isString(message.resourceProjectDisplayName)) return "resourceProjectDisplayName: string expected"; + if (message.folders != null && message.hasOwnProperty("folders")) { + if (!Array.isArray(message.folders)) + return "folders: array expected"; + for (var i = 0; i < message.folders.length; ++i) { + var error = $root.google.cloud.securitycenter.v1p1beta1.Folder.verify(message.folders[i]); + if (error) + return "folders." + error; + } + } return null; }; @@ -21379,6 +21428,16 @@ message.resourceParentDisplayName = String(object.resourceParentDisplayName); if (object.resourceProjectDisplayName != null) message.resourceProjectDisplayName = String(object.resourceProjectDisplayName); + if (object.folders) { + if (!Array.isArray(object.folders)) + throw TypeError(".google.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterProperties.folders: array expected"); + message.folders = []; + for (var i = 0; i < object.folders.length; ++i) { + if (typeof object.folders[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterProperties.folders: object expected"); + message.folders[i] = $root.google.cloud.securitycenter.v1p1beta1.Folder.fromObject(object.folders[i]); + } + } return message; }; @@ -21395,8 +21454,10 @@ if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) + if (options.arrays || options.defaults) { object.resourceOwners = []; + object.folders = []; + } if (options.defaults) { object.resourceName = ""; object.resourceType = ""; @@ -21425,6 +21486,11 @@ object.resourceParentDisplayName = message.resourceParentDisplayName; if (message.resourceProjectDisplayName != null && message.hasOwnProperty("resourceProjectDisplayName")) object.resourceProjectDisplayName = message.resourceProjectDisplayName; + if (message.folders && message.folders.length) { + object.folders = []; + for (var j = 0; j < message.folders.length; ++j) + object.folders[j] = $root.google.cloud.securitycenter.v1p1beta1.Folder.toObject(message.folders[j], options); + } return object; }; @@ -21632,6 +21698,216 @@ return Asset; })(); + v1p1beta1.Folder = (function() { + + /** + * Properties of a Folder. + * @memberof google.cloud.securitycenter.v1p1beta1 + * @interface IFolder + * @property {string|null} [resourceFolder] Folder resourceFolder + * @property {string|null} [resourceFolderDisplayName] Folder resourceFolderDisplayName + */ + + /** + * Constructs a new Folder. + * @memberof google.cloud.securitycenter.v1p1beta1 + * @classdesc Represents a Folder. + * @implements IFolder + * @constructor + * @param {google.cloud.securitycenter.v1p1beta1.IFolder=} [properties] Properties to set + */ + function Folder(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]]; + } + + /** + * Folder resourceFolder. + * @member {string} resourceFolder + * @memberof google.cloud.securitycenter.v1p1beta1.Folder + * @instance + */ + Folder.prototype.resourceFolder = ""; + + /** + * Folder resourceFolderDisplayName. + * @member {string} resourceFolderDisplayName + * @memberof google.cloud.securitycenter.v1p1beta1.Folder + * @instance + */ + Folder.prototype.resourceFolderDisplayName = ""; + + /** + * Creates a new Folder instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1p1beta1.Folder + * @static + * @param {google.cloud.securitycenter.v1p1beta1.IFolder=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1p1beta1.Folder} Folder instance + */ + Folder.create = function create(properties) { + return new Folder(properties); + }; + + /** + * Encodes the specified Folder message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.Folder.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1p1beta1.Folder + * @static + * @param {google.cloud.securitycenter.v1p1beta1.IFolder} message Folder message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Folder.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.resourceFolder != null && Object.hasOwnProperty.call(message, "resourceFolder")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.resourceFolder); + if (message.resourceFolderDisplayName != null && Object.hasOwnProperty.call(message, "resourceFolderDisplayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.resourceFolderDisplayName); + return writer; + }; + + /** + * Encodes the specified Folder message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.Folder.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1p1beta1.Folder + * @static + * @param {google.cloud.securitycenter.v1p1beta1.IFolder} message Folder message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Folder.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Folder message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1p1beta1.Folder + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1p1beta1.Folder} Folder + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Folder.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.cloud.securitycenter.v1p1beta1.Folder(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.resourceFolder = reader.string(); + break; + case 2: + message.resourceFolderDisplayName = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Folder message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1p1beta1.Folder + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1p1beta1.Folder} Folder + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Folder.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Folder message. + * @function verify + * @memberof google.cloud.securitycenter.v1p1beta1.Folder + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Folder.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.resourceFolder != null && message.hasOwnProperty("resourceFolder")) + if (!$util.isString(message.resourceFolder)) + return "resourceFolder: string expected"; + if (message.resourceFolderDisplayName != null && message.hasOwnProperty("resourceFolderDisplayName")) + if (!$util.isString(message.resourceFolderDisplayName)) + return "resourceFolderDisplayName: string expected"; + return null; + }; + + /** + * Creates a Folder message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1p1beta1.Folder + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1p1beta1.Folder} Folder + */ + Folder.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1p1beta1.Folder) + return object; + var message = new $root.google.cloud.securitycenter.v1p1beta1.Folder(); + if (object.resourceFolder != null) + message.resourceFolder = String(object.resourceFolder); + if (object.resourceFolderDisplayName != null) + message.resourceFolderDisplayName = String(object.resourceFolderDisplayName); + return message; + }; + + /** + * Creates a plain object from a Folder message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1p1beta1.Folder + * @static + * @param {google.cloud.securitycenter.v1p1beta1.Folder} message Folder + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Folder.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.resourceFolder = ""; + object.resourceFolderDisplayName = ""; + } + if (message.resourceFolder != null && message.hasOwnProperty("resourceFolder")) + object.resourceFolder = message.resourceFolder; + if (message.resourceFolderDisplayName != null && message.hasOwnProperty("resourceFolderDisplayName")) + object.resourceFolderDisplayName = message.resourceFolderDisplayName; + return object; + }; + + /** + * Converts this Folder to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1p1beta1.Folder + * @instance + * @returns {Object.} JSON object + */ + Folder.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Folder; + })(); + v1p1beta1.SecurityMarks = (function() { /** @@ -21640,6 +21916,7 @@ * @interface ISecurityMarks * @property {string|null} [name] SecurityMarks name * @property {Object.|null} [marks] SecurityMarks marks + * @property {string|null} [canonicalName] SecurityMarks canonicalName */ /** @@ -21674,6 +21951,14 @@ */ SecurityMarks.prototype.marks = $util.emptyObject; + /** + * SecurityMarks canonicalName. + * @member {string} canonicalName + * @memberof google.cloud.securitycenter.v1p1beta1.SecurityMarks + * @instance + */ + SecurityMarks.prototype.canonicalName = ""; + /** * Creates a new SecurityMarks instance using the specified properties. * @function create @@ -21703,6 +21988,8 @@ if (message.marks != null && Object.hasOwnProperty.call(message, "marks")) for (var keys = Object.keys(message.marks), i = 0; i < keys.length; ++i) writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.marks[keys[i]]).ldelim(); + if (message.canonicalName != null && Object.hasOwnProperty.call(message, "canonicalName")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.canonicalName); return writer; }; @@ -21762,6 +22049,9 @@ } message.marks[key] = value; break; + case 3: + message.canonicalName = reader.string(); + break; default: reader.skipType(tag & 7); break; @@ -21808,6 +22098,9 @@ if (!$util.isString(message.marks[key[i]])) return "marks: string{k:string} expected"; } + if (message.canonicalName != null && message.hasOwnProperty("canonicalName")) + if (!$util.isString(message.canonicalName)) + return "canonicalName: string expected"; return null; }; @@ -21832,6 +22125,8 @@ for (var keys = Object.keys(object.marks), i = 0; i < keys.length; ++i) message.marks[keys[i]] = String(object.marks[keys[i]]); } + if (object.canonicalName != null) + message.canonicalName = String(object.canonicalName); return message; }; @@ -21850,8 +22145,10 @@ var object = {}; if (options.objects || options.defaults) object.marks = {}; - if (options.defaults) + if (options.defaults) { object.name = ""; + object.canonicalName = ""; + } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; var keys2; @@ -21860,6 +22157,8 @@ for (var j = 0; j < keys2.length; ++j) object.marks[keys2[j]] = message.marks[keys2[j]]; } + if (message.canonicalName != null && message.hasOwnProperty("canonicalName")) + object.canonicalName = message.canonicalName; return object; }; @@ -21894,6 +22193,7 @@ * @property {google.protobuf.ITimestamp|null} [eventTime] Finding eventTime * @property {google.protobuf.ITimestamp|null} [createTime] Finding createTime * @property {google.cloud.securitycenter.v1p1beta1.Finding.Severity|null} [severity] Finding severity + * @property {string|null} [canonicalName] Finding canonicalName */ /** @@ -22000,6 +22300,14 @@ */ Finding.prototype.severity = 0; + /** + * Finding canonicalName. + * @member {string} canonicalName + * @memberof google.cloud.securitycenter.v1p1beta1.Finding + * @instance + */ + Finding.prototype.canonicalName = ""; + /** * Creates a new Finding instance using the specified properties. * @function create @@ -22049,6 +22357,8 @@ $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); if (message.severity != null && Object.hasOwnProperty.call(message, "severity")) writer.uint32(/* id 13, wireType 0 =*/104).int32(message.severity); + if (message.canonicalName != null && Object.hasOwnProperty.call(message, "canonicalName")) + writer.uint32(/* id 14, wireType 2 =*/114).string(message.canonicalName); return writer; }; @@ -22135,6 +22445,9 @@ case 13: message.severity = reader.int32(); break; + case 14: + message.canonicalName = reader.string(); + break; default: reader.skipType(tag & 7); break; @@ -22230,6 +22543,9 @@ case 4: break; } + if (message.canonicalName != null && message.hasOwnProperty("canonicalName")) + if (!$util.isString(message.canonicalName)) + return "canonicalName: string expected"; return null; }; @@ -22316,6 +22632,8 @@ message.severity = 4; break; } + if (object.canonicalName != null) + message.canonicalName = String(object.canonicalName); return message; }; @@ -22345,6 +22663,7 @@ object.eventTime = null; object.createTime = null; object.severity = options.enums === String ? "SEVERITY_UNSPECIFIED" : 0; + object.canonicalName = ""; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -22372,6 +22691,8 @@ object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); if (message.severity != null && message.hasOwnProperty("severity")) object.severity = options.enums === String ? $root.google.cloud.securitycenter.v1p1beta1.Finding.Severity[message.severity] : message.severity; + if (message.canonicalName != null && message.hasOwnProperty("canonicalName")) + object.canonicalName = message.canonicalName; return object; }; @@ -23235,6 +23556,7 @@ * @property {string|null} [projectDisplayName] Resource projectDisplayName * @property {string|null} [parent] Resource parent * @property {string|null} [parentDisplayName] Resource parentDisplayName + * @property {Array.|null} [folders] Resource folders */ /** @@ -23246,6 +23568,7 @@ * @param {google.cloud.securitycenter.v1p1beta1.IResource=} [properties] Properties to set */ function Resource(properties) { + this.folders = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -23292,6 +23615,14 @@ */ Resource.prototype.parentDisplayName = ""; + /** + * Resource folders. + * @member {Array.} folders + * @memberof google.cloud.securitycenter.v1p1beta1.Resource + * @instance + */ + Resource.prototype.folders = $util.emptyArray; + /** * Creates a new Resource instance using the specified properties. * @function create @@ -23326,6 +23657,9 @@ writer.uint32(/* id 4, wireType 2 =*/34).string(message.parent); if (message.parentDisplayName != null && Object.hasOwnProperty.call(message, "parentDisplayName")) writer.uint32(/* id 5, wireType 2 =*/42).string(message.parentDisplayName); + if (message.folders != null && message.folders.length) + for (var i = 0; i < message.folders.length; ++i) + $root.google.cloud.securitycenter.v1p1beta1.Folder.encode(message.folders[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); return writer; }; @@ -23375,6 +23709,11 @@ case 5: message.parentDisplayName = reader.string(); break; + case 7: + if (!(message.folders && message.folders.length)) + message.folders = []; + message.folders.push($root.google.cloud.securitycenter.v1p1beta1.Folder.decode(reader, reader.uint32())); + break; default: reader.skipType(tag & 7); break; @@ -23425,6 +23764,15 @@ if (message.parentDisplayName != null && message.hasOwnProperty("parentDisplayName")) if (!$util.isString(message.parentDisplayName)) return "parentDisplayName: string expected"; + if (message.folders != null && message.hasOwnProperty("folders")) { + if (!Array.isArray(message.folders)) + return "folders: array expected"; + for (var i = 0; i < message.folders.length; ++i) { + var error = $root.google.cloud.securitycenter.v1p1beta1.Folder.verify(message.folders[i]); + if (error) + return "folders." + error; + } + } return null; }; @@ -23450,6 +23798,16 @@ message.parent = String(object.parent); if (object.parentDisplayName != null) message.parentDisplayName = String(object.parentDisplayName); + if (object.folders) { + if (!Array.isArray(object.folders)) + throw TypeError(".google.cloud.securitycenter.v1p1beta1.Resource.folders: array expected"); + message.folders = []; + for (var i = 0; i < object.folders.length; ++i) { + if (typeof object.folders[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v1p1beta1.Resource.folders: object expected"); + message.folders[i] = $root.google.cloud.securitycenter.v1p1beta1.Folder.fromObject(object.folders[i]); + } + } return message; }; @@ -23466,6 +23824,8 @@ if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) + object.folders = []; if (options.defaults) { object.name = ""; object.project = ""; @@ -23483,6 +23843,11 @@ object.parent = message.parent; if (message.parentDisplayName != null && message.hasOwnProperty("parentDisplayName")) object.parentDisplayName = message.parentDisplayName; + if (message.folders && message.folders.length) { + object.folders = []; + for (var j = 0; j < message.folders.length; ++j) + object.folders[j] = $root.google.cloud.securitycenter.v1p1beta1.Folder.toObject(message.folders[j], options); + } return object; }; @@ -23742,6 +24107,7 @@ * @interface IAssetDiscoveryConfig * @property {Array.|null} [projectIds] AssetDiscoveryConfig projectIds * @property {google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode|null} [inclusionMode] AssetDiscoveryConfig inclusionMode + * @property {Array.|null} [folderIds] AssetDiscoveryConfig folderIds */ /** @@ -23754,6 +24120,7 @@ */ function AssetDiscoveryConfig(properties) { this.projectIds = []; + this.folderIds = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -23776,6 +24143,14 @@ */ AssetDiscoveryConfig.prototype.inclusionMode = 0; + /** + * AssetDiscoveryConfig folderIds. + * @member {Array.} folderIds + * @memberof google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig + * @instance + */ + AssetDiscoveryConfig.prototype.folderIds = $util.emptyArray; + /** * Creates a new AssetDiscoveryConfig instance using the specified properties. * @function create @@ -23805,6 +24180,9 @@ writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectIds[i]); if (message.inclusionMode != null && Object.hasOwnProperty.call(message, "inclusionMode")) writer.uint32(/* id 2, wireType 0 =*/16).int32(message.inclusionMode); + if (message.folderIds != null && message.folderIds.length) + for (var i = 0; i < message.folderIds.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.folderIds[i]); return writer; }; @@ -23847,6 +24225,11 @@ case 2: message.inclusionMode = reader.int32(); break; + case 3: + if (!(message.folderIds && message.folderIds.length)) + message.folderIds = []; + message.folderIds.push(reader.string()); + break; default: reader.skipType(tag & 7); break; @@ -23898,6 +24281,13 @@ case 2: break; } + if (message.folderIds != null && message.hasOwnProperty("folderIds")) { + if (!Array.isArray(message.folderIds)) + return "folderIds: array expected"; + for (var i = 0; i < message.folderIds.length; ++i) + if (!$util.isString(message.folderIds[i])) + return "folderIds: string[] expected"; + } return null; }; @@ -23934,6 +24324,13 @@ message.inclusionMode = 2; break; } + if (object.folderIds) { + if (!Array.isArray(object.folderIds)) + throw TypeError(".google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig.folderIds: array expected"); + message.folderIds = []; + for (var i = 0; i < object.folderIds.length; ++i) + message.folderIds[i] = String(object.folderIds[i]); + } return message; }; @@ -23950,8 +24347,10 @@ if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) + if (options.arrays || options.defaults) { object.projectIds = []; + object.folderIds = []; + } if (options.defaults) object.inclusionMode = options.enums === String ? "INCLUSION_MODE_UNSPECIFIED" : 0; if (message.projectIds && message.projectIds.length) { @@ -23961,6 +24360,11 @@ } if (message.inclusionMode != null && message.hasOwnProperty("inclusionMode")) object.inclusionMode = options.enums === String ? $root.google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode[message.inclusionMode] : message.inclusionMode; + if (message.folderIds && message.folderIds.length) { + object.folderIds = []; + for (var j = 0; j < message.folderIds.length; ++j) + object.folderIds[j] = message.folderIds[j]; + } return object; }; @@ -30705,6 +31109,7 @@ * @property {string|null} [projectDisplayName] Resource projectDisplayName * @property {string|null} [parentName] Resource parentName * @property {string|null} [parentDisplayName] Resource parentDisplayName + * @property {Array.|null} [folders] Resource folders */ /** @@ -30716,6 +31121,7 @@ * @param {google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.IResource=} [properties] Properties to set */ function Resource(properties) { + this.folders = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -30762,6 +31168,14 @@ */ Resource.prototype.parentDisplayName = ""; + /** + * Resource folders. + * @member {Array.} folders + * @memberof google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.Resource + * @instance + */ + Resource.prototype.folders = $util.emptyArray; + /** * Creates a new Resource instance using the specified properties. * @function create @@ -30796,6 +31210,9 @@ writer.uint32(/* id 4, wireType 2 =*/34).string(message.parentName); if (message.parentDisplayName != null && Object.hasOwnProperty.call(message, "parentDisplayName")) writer.uint32(/* id 5, wireType 2 =*/42).string(message.parentDisplayName); + if (message.folders != null && message.folders.length) + for (var i = 0; i < message.folders.length; ++i) + $root.google.cloud.securitycenter.v1p1beta1.Folder.encode(message.folders[i], writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); return writer; }; @@ -30845,6 +31262,11 @@ case 5: message.parentDisplayName = reader.string(); break; + case 10: + if (!(message.folders && message.folders.length)) + message.folders = []; + message.folders.push($root.google.cloud.securitycenter.v1p1beta1.Folder.decode(reader, reader.uint32())); + break; default: reader.skipType(tag & 7); break; @@ -30895,6 +31317,15 @@ if (message.parentDisplayName != null && message.hasOwnProperty("parentDisplayName")) if (!$util.isString(message.parentDisplayName)) return "parentDisplayName: string expected"; + if (message.folders != null && message.hasOwnProperty("folders")) { + if (!Array.isArray(message.folders)) + return "folders: array expected"; + for (var i = 0; i < message.folders.length; ++i) { + var error = $root.google.cloud.securitycenter.v1p1beta1.Folder.verify(message.folders[i]); + if (error) + return "folders." + error; + } + } return null; }; @@ -30920,6 +31351,16 @@ message.parentName = String(object.parentName); if (object.parentDisplayName != null) message.parentDisplayName = String(object.parentDisplayName); + if (object.folders) { + if (!Array.isArray(object.folders)) + throw TypeError(".google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.Resource.folders: array expected"); + message.folders = []; + for (var i = 0; i < object.folders.length; ++i) { + if (typeof object.folders[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.Resource.folders: object expected"); + message.folders[i] = $root.google.cloud.securitycenter.v1p1beta1.Folder.fromObject(object.folders[i]); + } + } return message; }; @@ -30936,6 +31377,8 @@ if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) + object.folders = []; if (options.defaults) { object.name = ""; object.projectName = ""; @@ -30953,6 +31396,11 @@ object.parentName = message.parentName; if (message.parentDisplayName != null && message.hasOwnProperty("parentDisplayName")) object.parentDisplayName = message.parentDisplayName; + if (message.folders && message.folders.length) { + object.folders = []; + for (var j = 0; j < message.folders.length; ++j) + object.folders[j] = $root.google.cloud.securitycenter.v1p1beta1.Folder.toObject(message.folders[j], options); + } return object; }; @@ -32574,6 +33022,7 @@ * @property {string|null} [name] Source name * @property {string|null} [displayName] Source displayName * @property {string|null} [description] Source description + * @property {string|null} [canonicalName] Source canonicalName */ /** @@ -32615,6 +33064,14 @@ */ Source.prototype.description = ""; + /** + * Source canonicalName. + * @member {string} canonicalName + * @memberof google.cloud.securitycenter.v1p1beta1.Source + * @instance + */ + Source.prototype.canonicalName = ""; + /** * Creates a new Source instance using the specified properties. * @function create @@ -32645,6 +33102,8 @@ writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); if (message.description != null && Object.hasOwnProperty.call(message, "description")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + if (message.canonicalName != null && Object.hasOwnProperty.call(message, "canonicalName")) + writer.uint32(/* id 14, wireType 2 =*/114).string(message.canonicalName); return writer; }; @@ -32688,6 +33147,9 @@ case 3: message.description = reader.string(); break; + case 14: + message.canonicalName = reader.string(); + break; default: reader.skipType(tag & 7); break; @@ -32732,6 +33194,9 @@ if (message.description != null && message.hasOwnProperty("description")) if (!$util.isString(message.description)) return "description: string expected"; + if (message.canonicalName != null && message.hasOwnProperty("canonicalName")) + if (!$util.isString(message.canonicalName)) + return "canonicalName: string expected"; return null; }; @@ -32753,6 +33218,8 @@ message.displayName = String(object.displayName); if (object.description != null) message.description = String(object.description); + if (object.canonicalName != null) + message.canonicalName = String(object.canonicalName); return message; }; @@ -32773,6 +33240,7 @@ object.name = ""; object.displayName = ""; object.description = ""; + object.canonicalName = ""; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -32780,6 +33248,8 @@ object.displayName = message.displayName; if (message.description != null && message.hasOwnProperty("description")) object.description = message.description; + if (message.canonicalName != null && message.hasOwnProperty("canonicalName")) + object.canonicalName = message.canonicalName; return object; }; diff --git a/packages/google-cloud-securitycenter/protos/protos.json b/packages/google-cloud-securitycenter/protos/protos.json index 73b98ddf60f..0548749a7a6 100644 --- a/packages/google-cloud-securitycenter/protos/protos.json +++ b/packages/google-cloud-securitycenter/protos/protos.json @@ -2558,15 +2558,15 @@ "java_package": "com.google.cloud.securitycenter.v1p1beta1", "php_namespace": "Google\\Cloud\\SecurityCenter\\V1p1beta1", "ruby_package": "Google::Cloud::SecurityCenter::V1p1beta1", + "java_outer_classname": "ResourceProto", "(google.api.resource_definition).type": "pubsub.googleapis.com/Topic", - "(google.api.resource_definition).pattern": "projects/{project}/topics/{topic}", - "java_outer_classname": "ResourceProto" + "(google.api.resource_definition).pattern": "projects/{project}/topics/{topic}" }, "nested": { "Asset": { "options": { "(google.api.resource).type": "securitycenter.googleapis.com/Asset", - "(google.api.resource).pattern": "organizations/{organization}/assets/{asset}" + "(google.api.resource).pattern": "projects/{project}/assets/{asset}" }, "fields": { "name": { @@ -2597,6 +2597,10 @@ "iamPolicy": { "type": "IamPolicy", "id": 11 + }, + "canonicalName": { + "type": "string", + "id": 13 } }, "nested": { @@ -2634,6 +2638,11 @@ "resourceProjectDisplayName": { "type": "string", "id": 8 + }, + "folders": { + "rule": "repeated", + "type": "Folder", + "id": 10 } } }, @@ -2647,10 +2656,22 @@ } } }, + "Folder": { + "fields": { + "resourceFolder": { + "type": "string", + "id": 1 + }, + "resourceFolderDisplayName": { + "type": "string", + "id": 2 + } + } + }, "SecurityMarks": { "options": { "(google.api.resource).type": "securitycenter.googleapis.com/SecurityMarks", - "(google.api.resource).pattern": "organizations/{organization}/sources/{source}/findings/{finding}/securityMarks" + "(google.api.resource).pattern": "projects/{project}/sources/{source}/findings/{finding}/securityMarks" }, "fields": { "name": { @@ -2661,13 +2682,17 @@ "keyType": "string", "type": "string", "id": 2 + }, + "canonicalName": { + "type": "string", + "id": 3 } } }, "Finding": { "options": { "(google.api.resource).type": "securitycenter.googleapis.com/Finding", - "(google.api.resource).pattern": "organizations/{organization}/sources/{source}/findings/{finding}" + "(google.api.resource).pattern": "projects/{project}/sources/{source}/findings/{finding}" }, "fields": { "name": { @@ -2717,6 +2742,10 @@ "severity": { "type": "Severity", "id": 13 + }, + "canonicalName": { + "type": "string", + "id": 14 } }, "nested": { @@ -2843,6 +2872,14 @@ "parentDisplayName": { "type": "string", "id": 5 + }, + "folders": { + "rule": "repeated", + "type": "Folder", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } } } }, @@ -2876,6 +2913,11 @@ "inclusionMode": { "type": "InclusionMode", "id": 2 + }, + "folderIds": { + "rule": "repeated", + "type": "string", + "id": 3 } }, "nested": { @@ -3081,13 +3123,25 @@ "responseType": "GroupAssetsResponse", "options": { "(google.api.http).post": "/v1p1beta1/{parent=organizations/*}/assets:group", - "(google.api.http).body": "*" + "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v1p1beta1/{parent=projects/*}/assets:group", + "(google.api.http).additional_bindings.body": "*" }, "parsedOptions": [ { "(google.api.http)": { "post": "/v1p1beta1/{parent=organizations/*}/assets:group", - "body": "*" + "body": "*", + "additional_bindings": [ + { + "post": "/v1p1beta1/{parent=folders/*}/assets:group", + "body": "*" + }, + { + "post": "/v1p1beta1/{parent=projects/*}/assets:group", + "body": "*" + } + ] } } ] @@ -3098,13 +3152,25 @@ "options": { "(google.api.http).post": "/v1p1beta1/{parent=organizations/*/sources/*}/findings:group", "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v1p1beta1/{parent=projects/*/sources/*}/findings:group", + "(google.api.http).additional_bindings.body": "*", "(google.api.method_signature)": "parent,group_by" }, "parsedOptions": [ { "(google.api.http)": { "post": "/v1p1beta1/{parent=organizations/*/sources/*}/findings:group", - "body": "*" + "body": "*", + "additional_bindings": [ + { + "post": "/v1p1beta1/{parent=folders/*/sources/*}/findings:group", + "body": "*" + }, + { + "post": "/v1p1beta1/{parent=projects/*/sources/*}/findings:group", + "body": "*" + } + ] } }, { @@ -3117,12 +3183,21 @@ "responseType": "ListAssetsResponse", "options": { "(google.api.http).get": "/v1p1beta1/{parent=organizations/*}/assets", + "(google.api.http).additional_bindings.get": "/v1p1beta1/{parent=projects/*}/assets", "(google.api.method_signature)": "parent" }, "parsedOptions": [ { "(google.api.http)": { - "get": "/v1p1beta1/{parent=organizations/*}/assets" + "get": "/v1p1beta1/{parent=organizations/*}/assets", + "additional_bindings": [ + { + "get": "/v1p1beta1/{parent=folders/*}/assets" + }, + { + "get": "/v1p1beta1/{parent=projects/*}/assets" + } + ] } }, { @@ -3135,12 +3210,21 @@ "responseType": "ListFindingsResponse", "options": { "(google.api.http).get": "/v1p1beta1/{parent=organizations/*/sources/*}/findings", + "(google.api.http).additional_bindings.get": "/v1p1beta1/{parent=projects/*/sources/*}/findings", "(google.api.method_signature)": "parent" }, "parsedOptions": [ { "(google.api.http)": { - "get": "/v1p1beta1/{parent=organizations/*/sources/*}/findings" + "get": "/v1p1beta1/{parent=organizations/*/sources/*}/findings", + "additional_bindings": [ + { + "get": "/v1p1beta1/{parent=folders/*/sources/*}/findings" + }, + { + "get": "/v1p1beta1/{parent=projects/*/sources/*}/findings" + } + ] } }, { @@ -3171,12 +3255,21 @@ "responseType": "ListSourcesResponse", "options": { "(google.api.http).get": "/v1p1beta1/{parent=organizations/*}/sources", + "(google.api.http).additional_bindings.get": "/v1p1beta1/{parent=projects/*}/sources", "(google.api.method_signature)": "parent" }, "parsedOptions": [ { "(google.api.http)": { - "get": "/v1p1beta1/{parent=organizations/*}/sources" + "get": "/v1p1beta1/{parent=organizations/*}/sources", + "additional_bindings": [ + { + "get": "/v1p1beta1/{parent=folders/*}/sources" + }, + { + "get": "/v1p1beta1/{parent=projects/*}/sources" + } + ] } }, { @@ -3218,13 +3311,25 @@ "options": { "(google.api.http).post": "/v1p1beta1/{name=organizations/*/sources/*/findings/*}:setState", "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v1p1beta1/{name=projects/*/sources/*/findings/*}:setState", + "(google.api.http).additional_bindings.body": "*", "(google.api.method_signature)": "name,state,start_time" }, "parsedOptions": [ { "(google.api.http)": { "post": "/v1p1beta1/{name=organizations/*/sources/*/findings/*}:setState", - "body": "*" + "body": "*", + "additional_bindings": [ + { + "post": "/v1p1beta1/{name=folders/*/sources/*/findings/*}:setState", + "body": "*" + }, + { + "post": "/v1p1beta1/{name=projects/*/sources/*/findings/*}:setState", + "body": "*" + } + ] } }, { @@ -3278,13 +3383,25 @@ "options": { "(google.api.http).patch": "/v1p1beta1/{finding.name=organizations/*/sources/*/findings/*}", "(google.api.http).body": "finding", + "(google.api.http).additional_bindings.patch": "/v1p1beta1/{finding.name=projects/*/sources/*/findings/*}", + "(google.api.http).additional_bindings.body": "finding", "(google.api.method_signature)": "finding,update_mask" }, "parsedOptions": [ { "(google.api.http)": { "patch": "/v1p1beta1/{finding.name=organizations/*/sources/*/findings/*}", - "body": "finding" + "body": "finding", + "additional_bindings": [ + { + "patch": "/v1p1beta1/{finding.name=folders/*/sources/*/findings/*}", + "body": "finding" + }, + { + "patch": "/v1p1beta1/{finding.name=projects/*/sources/*/findings/*}", + "body": "finding" + } + ] } }, { @@ -3367,7 +3484,7 @@ "options": { "(google.api.http).patch": "/v1p1beta1/{security_marks.name=organizations/*/assets/*/securityMarks}", "(google.api.http).body": "security_marks", - "(google.api.http).additional_bindings.patch": "/v1p1beta1/{security_marks.name=organizations/*/sources/*/findings/*/securityMarks}", + "(google.api.http).additional_bindings.patch": "/v1p1beta1/{security_marks.name=projects/*/sources/*/findings/*/securityMarks}", "(google.api.http).additional_bindings.body": "security_marks", "(google.api.method_signature)": "security_marks,update_mask" }, @@ -3376,10 +3493,28 @@ "(google.api.http)": { "patch": "/v1p1beta1/{security_marks.name=organizations/*/assets/*/securityMarks}", "body": "security_marks", - "additional_bindings": { - "patch": "/v1p1beta1/{security_marks.name=organizations/*/sources/*/findings/*/securityMarks}", - "body": "security_marks" - } + "additional_bindings": [ + { + "patch": "/v1p1beta1/{security_marks.name=folders/*/assets/*/securityMarks}", + "body": "security_marks" + }, + { + "patch": "/v1p1beta1/{security_marks.name=projects/*/assets/*/securityMarks}", + "body": "security_marks" + }, + { + "patch": "/v1p1beta1/{security_marks.name=organizations/*/sources/*/findings/*/securityMarks}", + "body": "security_marks" + }, + { + "patch": "/v1p1beta1/{security_marks.name=folders/*/sources/*/findings/*/securityMarks}", + "body": "security_marks" + }, + { + "patch": "/v1p1beta1/{security_marks.name=projects/*/sources/*/findings/*/securityMarks}", + "body": "security_marks" + } + ] } }, { @@ -3518,7 +3653,7 @@ "id": 1, "options": { "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "cloudresourcemanager.googleapis.com/Organization" + "(google.api.resource_reference).child_type": "securitycenter.googleapis.com/Asset" } }, "filter": { @@ -3684,7 +3819,7 @@ "id": 1, "options": { "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "cloudresourcemanager.googleapis.com/Organization" + "(google.api.resource_reference).child_type": "securitycenter.googleapis.com/Source" } }, "pageToken": { @@ -3717,7 +3852,7 @@ "id": 1, "options": { "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "cloudresourcemanager.googleapis.com/Organization" + "(google.api.resource_reference).child_type": "securitycenter.googleapis.com/Asset" } }, "filter": { @@ -3896,6 +4031,11 @@ "parentDisplayName": { "type": "string", "id": 5 + }, + "folders": { + "rule": "repeated", + "type": "Folder", + "id": 10 } } }, @@ -4032,7 +4172,7 @@ "Source": { "options": { "(google.api.resource).type": "securitycenter.googleapis.com/Source", - "(google.api.resource).pattern": "organizations/{organization}/sources/{source}" + "(google.api.resource).pattern": "projects/{project}/sources/{source}" }, "fields": { "name": { @@ -4046,6 +4186,10 @@ "description": { "type": "string", "id": 3 + }, + "canonicalName": { + "type": "string", + "id": 14 } } } diff --git a/packages/google-cloud-securitycenter/src/v1p1beta1/security_center_client.ts b/packages/google-cloud-securitycenter/src/v1p1beta1/security_center_client.ts index 25cedb86a03..e7253d82034 100644 --- a/packages/google-cloud-securitycenter/src/v1p1beta1/security_center_client.ts +++ b/packages/google-cloud-securitycenter/src/v1p1beta1/security_center_client.ts @@ -153,18 +153,31 @@ export class SecurityCenterClient { // identifiers to uniquely identify resources within the API. // Create useful helper objects for these. this.pathTemplates = { - assetPathTemplate: new this._gaxModule.PathTemplate( - 'organizations/{organization}/assets/{asset}' + folderAssetPathTemplate: new this._gaxModule.PathTemplate( + 'folders/{folder}/assets/{asset}' ), - findingPathTemplate: new this._gaxModule.PathTemplate( - 'organizations/{organization}/sources/{source}/findings/{finding}' + folderAssetSecurityMarksPathTemplate: new this._gaxModule.PathTemplate( + 'folders/{folder}/assets/{asset}/securityMarks' + ), + folderSourcePathTemplate: new this._gaxModule.PathTemplate( + 'folders/{folder}/sources/{source}' ), + folderSourceFindingPathTemplate: new this._gaxModule.PathTemplate( + 'folders/{folder}/sources/{source}/findings/{finding}' + ), + folderSourceFindingSecurityMarksPathTemplate: + new this._gaxModule.PathTemplate( + 'folders/{folder}/sources/{source}/findings/{finding}/securityMarks' + ), notificationConfigPathTemplate: new this._gaxModule.PathTemplate( 'organizations/{organization}/notificationConfigs/{notification_config}' ), organizationPathTemplate: new this._gaxModule.PathTemplate( 'organizations/{organization}' ), + organizationAssetPathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}/assets/{asset}' + ), organizationAssetSecurityMarksPathTemplate: new this._gaxModule.PathTemplate( 'organizations/{organization}/assets/{asset}/securityMarks' @@ -172,13 +185,32 @@ export class SecurityCenterClient { organizationSettingsPathTemplate: new this._gaxModule.PathTemplate( 'organizations/{organization}/organizationSettings' ), + organizationSourcePathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}/sources/{source}' + ), + organizationSourceFindingPathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}/sources/{source}/findings/{finding}' + ), organizationSourceFindingSecurityMarksPathTemplate: new this._gaxModule.PathTemplate( 'organizations/{organization}/sources/{source}/findings/{finding}/securityMarks' ), - sourcePathTemplate: new this._gaxModule.PathTemplate( - 'organizations/{organization}/sources/{source}' + projectAssetPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/assets/{asset}' + ), + projectAssetSecurityMarksPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/assets/{asset}/securityMarks' + ), + projectSourcePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/sources/{source}' + ), + projectSourceFindingPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/sources/{source}/findings/{finding}' ), + projectSourceFindingSecurityMarksPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/sources/{source}/findings/{finding}/securityMarks' + ), }; // Some of the methods on this service return "paged" results, @@ -2199,7 +2231,8 @@ export class SecurityCenterClient { * The request object that will be sent. * @param {string} request.parent * Required. Name of the organization to groupBy. Its format is - * "organizations/[organization_id]". + * "organizations/[organization_id], folders/[folder_id], or + * projects/[project_id]". * @param {string} request.filter * Expression that defines the filter to apply across assets. * The expression is a list of zero or more restrictions combined via logical @@ -2385,7 +2418,8 @@ export class SecurityCenterClient { * The request object that will be sent. * @param {string} request.parent * Required. Name of the organization to groupBy. Its format is - * "organizations/[organization_id]". + * "organizations/[organization_id], folders/[folder_id], or + * projects/[project_id]". * @param {string} request.filter * Expression that defines the filter to apply across assets. * The expression is a list of zero or more restrictions combined via logical @@ -2549,7 +2583,8 @@ export class SecurityCenterClient { * The request object that will be sent. * @param {string} request.parent * Required. Name of the organization to groupBy. Its format is - * "organizations/[organization_id]". + * "organizations/[organization_id], folders/[folder_id], or + * projects/[project_id]". * @param {string} request.filter * Expression that defines the filter to apply across assets. * The expression is a list of zero or more restrictions combined via logical @@ -2745,15 +2780,20 @@ export class SecurityCenterClient { * specified properties. * * To group across all sources provide a `-` as the source id. - * Example: /v1p1beta1/organizations/{organization_id}/sources/-/findings + * Example: /v1/organizations/{organization_id}/sources/-/findings, + * /v1/folders/{folder_id}/sources/-/findings, + * /v1/projects/{project_id}/sources/-/findings * * @param {Object} request * The request object that will be sent. * @param {string} request.parent * Required. Name of the source to groupBy. Its format is - * "organizations/[organization_id]/sources/[source_id]". To groupBy across - * all sources provide a source_id of `-`. For example: - * organizations/{organization_id}/sources/- + * "organizations/[organization_id]/sources/[source_id]", + * folders/[folder_id]/sources/[source_id], or + * projects/[project_id]/sources/[source_id]. To groupBy across all sources + * provide a source_id of `-`. For example: + * organizations/{organization_id}/sources/-, folders/{folder_id}/sources/-, + * or projects/{project_id}/sources/- * @param {string} request.filter * Expression that defines the filter to apply across findings. * The expression is a list of one or more restrictions combined via logical @@ -2929,9 +2969,12 @@ export class SecurityCenterClient { * The request object that will be sent. * @param {string} request.parent * Required. Name of the source to groupBy. Its format is - * "organizations/[organization_id]/sources/[source_id]". To groupBy across - * all sources provide a source_id of `-`. For example: - * organizations/{organization_id}/sources/- + * "organizations/[organization_id]/sources/[source_id]", + * folders/[folder_id]/sources/[source_id], or + * projects/[project_id]/sources/[source_id]. To groupBy across all sources + * provide a source_id of `-`. For example: + * organizations/{organization_id}/sources/-, folders/{folder_id}/sources/-, + * or projects/{project_id}/sources/- * @param {string} request.filter * Expression that defines the filter to apply across findings. * The expression is a list of one or more restrictions combined via logical @@ -3085,9 +3128,12 @@ export class SecurityCenterClient { * The request object that will be sent. * @param {string} request.parent * Required. Name of the source to groupBy. Its format is - * "organizations/[organization_id]/sources/[source_id]". To groupBy across - * all sources provide a source_id of `-`. For example: - * organizations/{organization_id}/sources/- + * "organizations/[organization_id]/sources/[source_id]", + * folders/[folder_id]/sources/[source_id], or + * projects/[project_id]/sources/[source_id]. To groupBy across all sources + * provide a source_id of `-`. For example: + * organizations/{organization_id}/sources/-, folders/{folder_id}/sources/-, + * or projects/{project_id}/sources/- * @param {string} request.filter * Expression that defines the filter to apply across findings. * The expression is a list of one or more restrictions combined via logical @@ -3275,7 +3321,8 @@ export class SecurityCenterClient { * The request object that will be sent. * @param {string} request.parent * Required. Name of the organization assets should belong to. Its format is - * "organizations/[organization_id]". + * "organizations/[organization_id], folders/[folder_id], or + * projects/[project_id]". * @param {string} request.filter * Expression that defines the filter to apply across assets. * The expression is a list of zero or more restrictions combined via logical @@ -3465,7 +3512,8 @@ export class SecurityCenterClient { * The request object that will be sent. * @param {string} request.parent * Required. Name of the organization assets should belong to. Its format is - * "organizations/[organization_id]". + * "organizations/[organization_id], folders/[folder_id], or + * projects/[project_id]". * @param {string} request.filter * Expression that defines the filter to apply across assets. * The expression is a list of zero or more restrictions combined via logical @@ -3633,7 +3681,8 @@ export class SecurityCenterClient { * The request object that will be sent. * @param {string} request.parent * Required. Name of the organization assets should belong to. Its format is - * "organizations/[organization_id]". + * "organizations/[organization_id], folders/[folder_id], or + * projects/[project_id]". * @param {string} request.filter * Expression that defines the filter to apply across assets. * The expression is a list of zero or more restrictions combined via logical @@ -3838,9 +3887,12 @@ export class SecurityCenterClient { * The request object that will be sent. * @param {string} request.parent * Required. Name of the source the findings belong to. Its format is - * "organizations/[organization_id]/sources/[source_id]". To list across all - * sources provide a source_id of `-`. For example: - * organizations/{organization_id}/sources/- + * "organizations/[organization_id]/sources/[source_id], + * folders/[folder_id]/sources/[source_id], or + * projects/[project_id]/sources/[source_id]". To list across all sources + * provide a source_id of `-`. For example: + * organizations/{organization_id}/sources/-, folders/{folder_id}/sources/- or + * projects/{projects_id}/sources/- * @param {string} request.filter * Expression that defines the filter to apply across findings. * The expression is a list of one or more restrictions combined via logical @@ -4020,9 +4072,12 @@ export class SecurityCenterClient { * The request object that will be sent. * @param {string} request.parent * Required. Name of the source the findings belong to. Its format is - * "organizations/[organization_id]/sources/[source_id]". To list across all - * sources provide a source_id of `-`. For example: - * organizations/{organization_id}/sources/- + * "organizations/[organization_id]/sources/[source_id], + * folders/[folder_id]/sources/[source_id], or + * projects/[project_id]/sources/[source_id]". To list across all sources + * provide a source_id of `-`. For example: + * organizations/{organization_id}/sources/-, folders/{folder_id}/sources/- or + * projects/{projects_id}/sources/- * @param {string} request.filter * Expression that defines the filter to apply across findings. * The expression is a list of one or more restrictions combined via logical @@ -4180,9 +4235,12 @@ export class SecurityCenterClient { * The request object that will be sent. * @param {string} request.parent * Required. Name of the source the findings belong to. Its format is - * "organizations/[organization_id]/sources/[source_id]". To list across all - * sources provide a source_id of `-`. For example: - * organizations/{organization_id}/sources/- + * "organizations/[organization_id]/sources/[source_id], + * folders/[folder_id]/sources/[source_id], or + * projects/[project_id]/sources/[source_id]". To list across all sources + * provide a source_id of `-`. For example: + * organizations/{organization_id}/sources/-, folders/{folder_id}/sources/- or + * projects/{projects_id}/sources/- * @param {string} request.filter * Expression that defines the filter to apply across findings. * The expression is a list of one or more restrictions combined via logical @@ -4581,7 +4639,8 @@ export class SecurityCenterClient { * The request object that will be sent. * @param {string} request.parent * Required. Resource name of the parent of sources to list. Its format should be - * "organizations/[organization_id]". + * "organizations/[organization_id], folders/[folder_id], or + * projects/[project_id]". * @param {string} request.pageToken * The value returned by the last `ListSourcesResponse`; indicates * that this is a continuation of a prior `ListSources` call, and @@ -4652,7 +4711,8 @@ export class SecurityCenterClient { * The request object that will be sent. * @param {string} request.parent * Required. Resource name of the parent of sources to list. Its format should be - * "organizations/[organization_id]". + * "organizations/[organization_id], folders/[folder_id], or + * projects/[project_id]". * @param {string} request.pageToken * The value returned by the last `ListSourcesResponse`; indicates * that this is a continuation of a prior `ListSources` call, and @@ -4701,7 +4761,8 @@ export class SecurityCenterClient { * The request object that will be sent. * @param {string} request.parent * Required. Resource name of the parent of sources to list. Its format should be - * "organizations/[organization_id]". + * "organizations/[organization_id], folders/[folder_id], or + * projects/[project_id]". * @param {string} request.pageToken * The value returned by the last `ListSourcesResponse`; indicates * that this is a continuation of a prior `ListSources` call, and @@ -4751,89 +4812,245 @@ export class SecurityCenterClient { // -------------------- /** - * Return a fully-qualified asset resource name string. + * Return a fully-qualified folderAsset resource name string. * - * @param {string} organization + * @param {string} folder * @param {string} asset * @returns {string} Resource name string. */ - assetPath(organization: string, asset: string) { - return this.pathTemplates.assetPathTemplate.render({ - organization: organization, + folderAssetPath(folder: string, asset: string) { + return this.pathTemplates.folderAssetPathTemplate.render({ + folder: folder, asset: asset, }); } /** - * Parse the organization from Asset resource. + * Parse the folder from FolderAsset resource. * - * @param {string} assetName - * A fully-qualified path representing Asset resource. - * @returns {string} A string representing the organization. + * @param {string} folderAssetName + * A fully-qualified path representing folder_asset resource. + * @returns {string} A string representing the folder. */ - matchOrganizationFromAssetName(assetName: string) { - return this.pathTemplates.assetPathTemplate.match(assetName).organization; + matchFolderFromFolderAssetName(folderAssetName: string) { + return this.pathTemplates.folderAssetPathTemplate.match(folderAssetName) + .folder; } /** - * Parse the asset from Asset resource. + * Parse the asset from FolderAsset resource. * - * @param {string} assetName - * A fully-qualified path representing Asset resource. + * @param {string} folderAssetName + * A fully-qualified path representing folder_asset resource. * @returns {string} A string representing the asset. */ - matchAssetFromAssetName(assetName: string) { - return this.pathTemplates.assetPathTemplate.match(assetName).asset; + matchAssetFromFolderAssetName(folderAssetName: string) { + return this.pathTemplates.folderAssetPathTemplate.match(folderAssetName) + .asset; } /** - * Return a fully-qualified finding resource name string. + * Return a fully-qualified folderAssetSecurityMarks resource name string. * - * @param {string} organization + * @param {string} folder + * @param {string} asset + * @returns {string} Resource name string. + */ + folderAssetSecurityMarksPath(folder: string, asset: string) { + return this.pathTemplates.folderAssetSecurityMarksPathTemplate.render({ + folder: folder, + asset: asset, + }); + } + + /** + * Parse the folder from FolderAssetSecurityMarks resource. + * + * @param {string} folderAssetSecurityMarksName + * A fully-qualified path representing folder_asset_securityMarks resource. + * @returns {string} A string representing the folder. + */ + matchFolderFromFolderAssetSecurityMarksName( + folderAssetSecurityMarksName: string + ) { + return this.pathTemplates.folderAssetSecurityMarksPathTemplate.match( + folderAssetSecurityMarksName + ).folder; + } + + /** + * Parse the asset from FolderAssetSecurityMarks resource. + * + * @param {string} folderAssetSecurityMarksName + * A fully-qualified path representing folder_asset_securityMarks resource. + * @returns {string} A string representing the asset. + */ + matchAssetFromFolderAssetSecurityMarksName( + folderAssetSecurityMarksName: string + ) { + return this.pathTemplates.folderAssetSecurityMarksPathTemplate.match( + folderAssetSecurityMarksName + ).asset; + } + + /** + * Return a fully-qualified folderSource resource name string. + * + * @param {string} folder + * @param {string} source + * @returns {string} Resource name string. + */ + folderSourcePath(folder: string, source: string) { + return this.pathTemplates.folderSourcePathTemplate.render({ + folder: folder, + source: source, + }); + } + + /** + * Parse the folder from FolderSource resource. + * + * @param {string} folderSourceName + * A fully-qualified path representing folder_source resource. + * @returns {string} A string representing the folder. + */ + matchFolderFromFolderSourceName(folderSourceName: string) { + return this.pathTemplates.folderSourcePathTemplate.match(folderSourceName) + .folder; + } + + /** + * Parse the source from FolderSource resource. + * + * @param {string} folderSourceName + * A fully-qualified path representing folder_source resource. + * @returns {string} A string representing the source. + */ + matchSourceFromFolderSourceName(folderSourceName: string) { + return this.pathTemplates.folderSourcePathTemplate.match(folderSourceName) + .source; + } + + /** + * Return a fully-qualified folderSourceFinding resource name string. + * + * @param {string} folder * @param {string} source * @param {string} finding * @returns {string} Resource name string. */ - findingPath(organization: string, source: string, finding: string) { - return this.pathTemplates.findingPathTemplate.render({ - organization: organization, + folderSourceFindingPath(folder: string, source: string, finding: string) { + return this.pathTemplates.folderSourceFindingPathTemplate.render({ + folder: folder, source: source, finding: finding, }); } /** - * Parse the organization from Finding resource. + * Parse the folder from FolderSourceFinding resource. * - * @param {string} findingName - * A fully-qualified path representing Finding resource. - * @returns {string} A string representing the organization. + * @param {string} folderSourceFindingName + * A fully-qualified path representing folder_source_finding resource. + * @returns {string} A string representing the folder. */ - matchOrganizationFromFindingName(findingName: string) { - return this.pathTemplates.findingPathTemplate.match(findingName) - .organization; + matchFolderFromFolderSourceFindingName(folderSourceFindingName: string) { + return this.pathTemplates.folderSourceFindingPathTemplate.match( + folderSourceFindingName + ).folder; + } + + /** + * Parse the source from FolderSourceFinding resource. + * + * @param {string} folderSourceFindingName + * A fully-qualified path representing folder_source_finding resource. + * @returns {string} A string representing the source. + */ + matchSourceFromFolderSourceFindingName(folderSourceFindingName: string) { + return this.pathTemplates.folderSourceFindingPathTemplate.match( + folderSourceFindingName + ).source; + } + + /** + * Parse the finding from FolderSourceFinding resource. + * + * @param {string} folderSourceFindingName + * A fully-qualified path representing folder_source_finding resource. + * @returns {string} A string representing the finding. + */ + matchFindingFromFolderSourceFindingName(folderSourceFindingName: string) { + return this.pathTemplates.folderSourceFindingPathTemplate.match( + folderSourceFindingName + ).finding; } /** - * Parse the source from Finding resource. + * Return a fully-qualified folderSourceFindingSecurityMarks resource name string. * - * @param {string} findingName - * A fully-qualified path representing Finding resource. + * @param {string} folder + * @param {string} source + * @param {string} finding + * @returns {string} Resource name string. + */ + folderSourceFindingSecurityMarksPath( + folder: string, + source: string, + finding: string + ) { + return this.pathTemplates.folderSourceFindingSecurityMarksPathTemplate.render( + { + folder: folder, + source: source, + finding: finding, + } + ); + } + + /** + * Parse the folder from FolderSourceFindingSecurityMarks resource. + * + * @param {string} folderSourceFindingSecurityMarksName + * A fully-qualified path representing folder_source_finding_securityMarks resource. + * @returns {string} A string representing the folder. + */ + matchFolderFromFolderSourceFindingSecurityMarksName( + folderSourceFindingSecurityMarksName: string + ) { + return this.pathTemplates.folderSourceFindingSecurityMarksPathTemplate.match( + folderSourceFindingSecurityMarksName + ).folder; + } + + /** + * Parse the source from FolderSourceFindingSecurityMarks resource. + * + * @param {string} folderSourceFindingSecurityMarksName + * A fully-qualified path representing folder_source_finding_securityMarks resource. * @returns {string} A string representing the source. */ - matchSourceFromFindingName(findingName: string) { - return this.pathTemplates.findingPathTemplate.match(findingName).source; + matchSourceFromFolderSourceFindingSecurityMarksName( + folderSourceFindingSecurityMarksName: string + ) { + return this.pathTemplates.folderSourceFindingSecurityMarksPathTemplate.match( + folderSourceFindingSecurityMarksName + ).source; } /** - * Parse the finding from Finding resource. + * Parse the finding from FolderSourceFindingSecurityMarks resource. * - * @param {string} findingName - * A fully-qualified path representing Finding resource. + * @param {string} folderSourceFindingSecurityMarksName + * A fully-qualified path representing folder_source_finding_securityMarks resource. * @returns {string} A string representing the finding. */ - matchFindingFromFindingName(findingName: string) { - return this.pathTemplates.findingPathTemplate.match(findingName).finding; + matchFindingFromFolderSourceFindingSecurityMarksName( + folderSourceFindingSecurityMarksName: string + ) { + return this.pathTemplates.folderSourceFindingSecurityMarksPathTemplate.match( + folderSourceFindingSecurityMarksName + ).finding; } /** @@ -4902,6 +5119,46 @@ export class SecurityCenterClient { .organization; } + /** + * Return a fully-qualified organizationAsset resource name string. + * + * @param {string} organization + * @param {string} asset + * @returns {string} Resource name string. + */ + organizationAssetPath(organization: string, asset: string) { + return this.pathTemplates.organizationAssetPathTemplate.render({ + organization: organization, + asset: asset, + }); + } + + /** + * Parse the organization from OrganizationAsset resource. + * + * @param {string} organizationAssetName + * A fully-qualified path representing organization_asset resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationAssetName(organizationAssetName: string) { + return this.pathTemplates.organizationAssetPathTemplate.match( + organizationAssetName + ).organization; + } + + /** + * Parse the asset from OrganizationAsset resource. + * + * @param {string} organizationAssetName + * A fully-qualified path representing organization_asset resource. + * @returns {string} A string representing the asset. + */ + matchAssetFromOrganizationAssetName(organizationAssetName: string) { + return this.pathTemplates.organizationAssetPathTemplate.match( + organizationAssetName + ).asset; + } + /** * Return a fully-qualified organizationAssetSecurityMarks resource name string. * @@ -4975,6 +5232,111 @@ export class SecurityCenterClient { ).organization; } + /** + * Return a fully-qualified organizationSource resource name string. + * + * @param {string} organization + * @param {string} source + * @returns {string} Resource name string. + */ + organizationSourcePath(organization: string, source: string) { + return this.pathTemplates.organizationSourcePathTemplate.render({ + organization: organization, + source: source, + }); + } + + /** + * Parse the organization from OrganizationSource resource. + * + * @param {string} organizationSourceName + * A fully-qualified path representing organization_source resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationSourceName(organizationSourceName: string) { + return this.pathTemplates.organizationSourcePathTemplate.match( + organizationSourceName + ).organization; + } + + /** + * Parse the source from OrganizationSource resource. + * + * @param {string} organizationSourceName + * A fully-qualified path representing organization_source resource. + * @returns {string} A string representing the source. + */ + matchSourceFromOrganizationSourceName(organizationSourceName: string) { + return this.pathTemplates.organizationSourcePathTemplate.match( + organizationSourceName + ).source; + } + + /** + * Return a fully-qualified organizationSourceFinding resource name string. + * + * @param {string} organization + * @param {string} source + * @param {string} finding + * @returns {string} Resource name string. + */ + organizationSourceFindingPath( + organization: string, + source: string, + finding: string + ) { + return this.pathTemplates.organizationSourceFindingPathTemplate.render({ + organization: organization, + source: source, + finding: finding, + }); + } + + /** + * Parse the organization from OrganizationSourceFinding resource. + * + * @param {string} organizationSourceFindingName + * A fully-qualified path representing organization_source_finding resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationSourceFindingName( + organizationSourceFindingName: string + ) { + return this.pathTemplates.organizationSourceFindingPathTemplate.match( + organizationSourceFindingName + ).organization; + } + + /** + * Parse the source from OrganizationSourceFinding resource. + * + * @param {string} organizationSourceFindingName + * A fully-qualified path representing organization_source_finding resource. + * @returns {string} A string representing the source. + */ + matchSourceFromOrganizationSourceFindingName( + organizationSourceFindingName: string + ) { + return this.pathTemplates.organizationSourceFindingPathTemplate.match( + organizationSourceFindingName + ).source; + } + + /** + * Parse the finding from OrganizationSourceFinding resource. + * + * @param {string} organizationSourceFindingName + * A fully-qualified path representing organization_source_finding resource. + * @returns {string} A string representing the finding. + */ + matchFindingFromOrganizationSourceFindingName( + organizationSourceFindingName: string + ) { + return this.pathTemplates.organizationSourceFindingPathTemplate.match( + organizationSourceFindingName + ).finding; + } + /** * Return a fully-qualified organizationSourceFindingSecurityMarks resource name string. * @@ -5043,39 +5405,245 @@ export class SecurityCenterClient { } /** - * Return a fully-qualified source resource name string. + * Return a fully-qualified projectAsset resource name string. * - * @param {string} organization + * @param {string} project + * @param {string} asset + * @returns {string} Resource name string. + */ + projectAssetPath(project: string, asset: string) { + return this.pathTemplates.projectAssetPathTemplate.render({ + project: project, + asset: asset, + }); + } + + /** + * Parse the project from ProjectAsset resource. + * + * @param {string} projectAssetName + * A fully-qualified path representing project_asset resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectAssetName(projectAssetName: string) { + return this.pathTemplates.projectAssetPathTemplate.match(projectAssetName) + .project; + } + + /** + * Parse the asset from ProjectAsset resource. + * + * @param {string} projectAssetName + * A fully-qualified path representing project_asset resource. + * @returns {string} A string representing the asset. + */ + matchAssetFromProjectAssetName(projectAssetName: string) { + return this.pathTemplates.projectAssetPathTemplate.match(projectAssetName) + .asset; + } + + /** + * Return a fully-qualified projectAssetSecurityMarks resource name string. + * + * @param {string} project + * @param {string} asset + * @returns {string} Resource name string. + */ + projectAssetSecurityMarksPath(project: string, asset: string) { + return this.pathTemplates.projectAssetSecurityMarksPathTemplate.render({ + project: project, + asset: asset, + }); + } + + /** + * Parse the project from ProjectAssetSecurityMarks resource. + * + * @param {string} projectAssetSecurityMarksName + * A fully-qualified path representing project_asset_securityMarks resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectAssetSecurityMarksName( + projectAssetSecurityMarksName: string + ) { + return this.pathTemplates.projectAssetSecurityMarksPathTemplate.match( + projectAssetSecurityMarksName + ).project; + } + + /** + * Parse the asset from ProjectAssetSecurityMarks resource. + * + * @param {string} projectAssetSecurityMarksName + * A fully-qualified path representing project_asset_securityMarks resource. + * @returns {string} A string representing the asset. + */ + matchAssetFromProjectAssetSecurityMarksName( + projectAssetSecurityMarksName: string + ) { + return this.pathTemplates.projectAssetSecurityMarksPathTemplate.match( + projectAssetSecurityMarksName + ).asset; + } + + /** + * Return a fully-qualified projectSource resource name string. + * + * @param {string} project * @param {string} source * @returns {string} Resource name string. */ - sourcePath(organization: string, source: string) { - return this.pathTemplates.sourcePathTemplate.render({ - organization: organization, + projectSourcePath(project: string, source: string) { + return this.pathTemplates.projectSourcePathTemplate.render({ + project: project, source: source, }); } /** - * Parse the organization from Source resource. + * Parse the project from ProjectSource resource. * - * @param {string} sourceName - * A fully-qualified path representing Source resource. - * @returns {string} A string representing the organization. + * @param {string} projectSourceName + * A fully-qualified path representing project_source resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectSourceName(projectSourceName: string) { + return this.pathTemplates.projectSourcePathTemplate.match(projectSourceName) + .project; + } + + /** + * Parse the source from ProjectSource resource. + * + * @param {string} projectSourceName + * A fully-qualified path representing project_source resource. + * @returns {string} A string representing the source. + */ + matchSourceFromProjectSourceName(projectSourceName: string) { + return this.pathTemplates.projectSourcePathTemplate.match(projectSourceName) + .source; + } + + /** + * Return a fully-qualified projectSourceFinding resource name string. + * + * @param {string} project + * @param {string} source + * @param {string} finding + * @returns {string} Resource name string. + */ + projectSourceFindingPath(project: string, source: string, finding: string) { + return this.pathTemplates.projectSourceFindingPathTemplate.render({ + project: project, + source: source, + finding: finding, + }); + } + + /** + * Parse the project from ProjectSourceFinding resource. + * + * @param {string} projectSourceFindingName + * A fully-qualified path representing project_source_finding resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectSourceFindingName(projectSourceFindingName: string) { + return this.pathTemplates.projectSourceFindingPathTemplate.match( + projectSourceFindingName + ).project; + } + + /** + * Parse the source from ProjectSourceFinding resource. + * + * @param {string} projectSourceFindingName + * A fully-qualified path representing project_source_finding resource. + * @returns {string} A string representing the source. */ - matchOrganizationFromSourceName(sourceName: string) { - return this.pathTemplates.sourcePathTemplate.match(sourceName).organization; + matchSourceFromProjectSourceFindingName(projectSourceFindingName: string) { + return this.pathTemplates.projectSourceFindingPathTemplate.match( + projectSourceFindingName + ).source; + } + + /** + * Parse the finding from ProjectSourceFinding resource. + * + * @param {string} projectSourceFindingName + * A fully-qualified path representing project_source_finding resource. + * @returns {string} A string representing the finding. + */ + matchFindingFromProjectSourceFindingName(projectSourceFindingName: string) { + return this.pathTemplates.projectSourceFindingPathTemplate.match( + projectSourceFindingName + ).finding; + } + + /** + * Return a fully-qualified projectSourceFindingSecurityMarks resource name string. + * + * @param {string} project + * @param {string} source + * @param {string} finding + * @returns {string} Resource name string. + */ + projectSourceFindingSecurityMarksPath( + project: string, + source: string, + finding: string + ) { + return this.pathTemplates.projectSourceFindingSecurityMarksPathTemplate.render( + { + project: project, + source: source, + finding: finding, + } + ); + } + + /** + * Parse the project from ProjectSourceFindingSecurityMarks resource. + * + * @param {string} projectSourceFindingSecurityMarksName + * A fully-qualified path representing project_source_finding_securityMarks resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectSourceFindingSecurityMarksName( + projectSourceFindingSecurityMarksName: string + ) { + return this.pathTemplates.projectSourceFindingSecurityMarksPathTemplate.match( + projectSourceFindingSecurityMarksName + ).project; } /** - * Parse the source from Source resource. + * Parse the source from ProjectSourceFindingSecurityMarks resource. * - * @param {string} sourceName - * A fully-qualified path representing Source resource. + * @param {string} projectSourceFindingSecurityMarksName + * A fully-qualified path representing project_source_finding_securityMarks resource. * @returns {string} A string representing the source. */ - matchSourceFromSourceName(sourceName: string) { - return this.pathTemplates.sourcePathTemplate.match(sourceName).source; + matchSourceFromProjectSourceFindingSecurityMarksName( + projectSourceFindingSecurityMarksName: string + ) { + return this.pathTemplates.projectSourceFindingSecurityMarksPathTemplate.match( + projectSourceFindingSecurityMarksName + ).source; + } + + /** + * Parse the finding from ProjectSourceFindingSecurityMarks resource. + * + * @param {string} projectSourceFindingSecurityMarksName + * A fully-qualified path representing project_source_finding_securityMarks resource. + * @returns {string} A string representing the finding. + */ + matchFindingFromProjectSourceFindingSecurityMarksName( + projectSourceFindingSecurityMarksName: string + ) { + return this.pathTemplates.projectSourceFindingSecurityMarksPathTemplate.match( + projectSourceFindingSecurityMarksName + ).finding; } /** diff --git a/packages/google-cloud-securitycenter/src/v1p1beta1/security_center_proto_list.json b/packages/google-cloud-securitycenter/src/v1p1beta1/security_center_proto_list.json index cfa18ff75d7..dcb821bf6e0 100644 --- a/packages/google-cloud-securitycenter/src/v1p1beta1/security_center_proto_list.json +++ b/packages/google-cloud-securitycenter/src/v1p1beta1/security_center_proto_list.json @@ -1,6 +1,7 @@ [ "../../protos/google/cloud/securitycenter/v1p1beta1/asset.proto", "../../protos/google/cloud/securitycenter/v1p1beta1/finding.proto", + "../../protos/google/cloud/securitycenter/v1p1beta1/folder.proto", "../../protos/google/cloud/securitycenter/v1p1beta1/notification_config.proto", "../../protos/google/cloud/securitycenter/v1p1beta1/notification_message.proto", "../../protos/google/cloud/securitycenter/v1p1beta1/organization_settings.proto", diff --git a/packages/google-cloud-securitycenter/test/gapic_security_center_v1p1beta1.ts b/packages/google-cloud-securitycenter/test/gapic_security_center_v1p1beta1.ts index 6d5ff92218b..2532c95eeaa 100644 --- a/packages/google-cloud-securitycenter/test/gapic_security_center_v1p1beta1.ts +++ b/packages/google-cloud-securitycenter/test/gapic_security_center_v1p1beta1.ts @@ -4152,10 +4152,10 @@ describe('v1p1beta1.SecurityCenterClient', () => { }); describe('Path templates', () => { - describe('asset', () => { - const fakePath = '/rendered/path/asset'; + describe('folderAsset', () => { + const fakePath = '/rendered/path/folderAsset'; const expectedParameters = { - organization: 'organizationValue', + folder: 'folderValue', asset: 'assetValue', }; const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ @@ -4163,48 +4163,160 @@ describe('v1p1beta1.SecurityCenterClient', () => { projectId: 'bogus', }); client.initialize(); - client.pathTemplates.assetPathTemplate.render = sinon + client.pathTemplates.folderAssetPathTemplate.render = sinon .stub() .returns(fakePath); - client.pathTemplates.assetPathTemplate.match = sinon + client.pathTemplates.folderAssetPathTemplate.match = sinon .stub() .returns(expectedParameters); - it('assetPath', () => { - const result = client.assetPath('organizationValue', 'assetValue'); + it('folderAssetPath', () => { + const result = client.folderAssetPath('folderValue', 'assetValue'); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.assetPathTemplate.render as SinonStub) + (client.pathTemplates.folderAssetPathTemplate.render as SinonStub) .getCall(-1) .calledWith(expectedParameters) ); }); - it('matchOrganizationFromAssetName', () => { - const result = client.matchOrganizationFromAssetName(fakePath); - assert.strictEqual(result, 'organizationValue'); + it('matchFolderFromFolderAssetName', () => { + const result = client.matchFolderFromFolderAssetName(fakePath); + assert.strictEqual(result, 'folderValue'); assert( - (client.pathTemplates.assetPathTemplate.match as SinonStub) + (client.pathTemplates.folderAssetPathTemplate.match as SinonStub) .getCall(-1) .calledWith(fakePath) ); }); - it('matchAssetFromAssetName', () => { - const result = client.matchAssetFromAssetName(fakePath); + it('matchAssetFromFolderAssetName', () => { + const result = client.matchAssetFromFolderAssetName(fakePath); assert.strictEqual(result, 'assetValue'); assert( - (client.pathTemplates.assetPathTemplate.match as SinonStub) + (client.pathTemplates.folderAssetPathTemplate.match as SinonStub) .getCall(-1) .calledWith(fakePath) ); }); }); - describe('finding', () => { - const fakePath = '/rendered/path/finding'; + describe('folderAssetSecurityMarks', () => { + const fakePath = '/rendered/path/folderAssetSecurityMarks'; const expectedParameters = { - organization: 'organizationValue', + folder: 'folderValue', + asset: 'assetValue', + }; + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.folderAssetSecurityMarksPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.folderAssetSecurityMarksPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('folderAssetSecurityMarksPath', () => { + const result = client.folderAssetSecurityMarksPath( + 'folderValue', + 'assetValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.folderAssetSecurityMarksPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchFolderFromFolderAssetSecurityMarksName', () => { + const result = + client.matchFolderFromFolderAssetSecurityMarksName(fakePath); + assert.strictEqual(result, 'folderValue'); + assert( + ( + client.pathTemplates.folderAssetSecurityMarksPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchAssetFromFolderAssetSecurityMarksName', () => { + const result = + client.matchAssetFromFolderAssetSecurityMarksName(fakePath); + assert.strictEqual(result, 'assetValue'); + assert( + ( + client.pathTemplates.folderAssetSecurityMarksPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('folderSource', () => { + const fakePath = '/rendered/path/folderSource'; + const expectedParameters = { + folder: 'folderValue', + source: 'sourceValue', + }; + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.folderSourcePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.folderSourcePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('folderSourcePath', () => { + const result = client.folderSourcePath('folderValue', 'sourceValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.folderSourcePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchFolderFromFolderSourceName', () => { + const result = client.matchFolderFromFolderSourceName(fakePath); + assert.strictEqual(result, 'folderValue'); + assert( + (client.pathTemplates.folderSourcePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSourceFromFolderSourceName', () => { + const result = client.matchSourceFromFolderSourceName(fakePath); + assert.strictEqual(result, 'sourceValue'); + assert( + (client.pathTemplates.folderSourcePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('folderSourceFinding', () => { + const fakePath = '/rendered/path/folderSourceFinding'; + const expectedParameters = { + folder: 'folderValue', source: 'sourceValue', finding: 'findingValue', }; @@ -4213,52 +4325,141 @@ describe('v1p1beta1.SecurityCenterClient', () => { projectId: 'bogus', }); client.initialize(); - client.pathTemplates.findingPathTemplate.render = sinon + client.pathTemplates.folderSourceFindingPathTemplate.render = sinon .stub() .returns(fakePath); - client.pathTemplates.findingPathTemplate.match = sinon + client.pathTemplates.folderSourceFindingPathTemplate.match = sinon .stub() .returns(expectedParameters); - it('findingPath', () => { - const result = client.findingPath( - 'organizationValue', + it('folderSourceFindingPath', () => { + const result = client.folderSourceFindingPath( + 'folderValue', 'sourceValue', 'findingValue' ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.findingPathTemplate.render as SinonStub) + ( + client.pathTemplates.folderSourceFindingPathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); }); - it('matchOrganizationFromFindingName', () => { - const result = client.matchOrganizationFromFindingName(fakePath); - assert.strictEqual(result, 'organizationValue'); + it('matchFolderFromFolderSourceFindingName', () => { + const result = client.matchFolderFromFolderSourceFindingName(fakePath); + assert.strictEqual(result, 'folderValue'); + assert( + ( + client.pathTemplates.folderSourceFindingPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSourceFromFolderSourceFindingName', () => { + const result = client.matchSourceFromFolderSourceFindingName(fakePath); + assert.strictEqual(result, 'sourceValue'); + assert( + ( + client.pathTemplates.folderSourceFindingPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchFindingFromFolderSourceFindingName', () => { + const result = client.matchFindingFromFolderSourceFindingName(fakePath); + assert.strictEqual(result, 'findingValue'); + assert( + ( + client.pathTemplates.folderSourceFindingPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('folderSourceFindingSecurityMarks', () => { + const fakePath = '/rendered/path/folderSourceFindingSecurityMarks'; + const expectedParameters = { + folder: 'folderValue', + source: 'sourceValue', + finding: 'findingValue', + }; + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.folderSourceFindingSecurityMarksPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.folderSourceFindingSecurityMarksPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('folderSourceFindingSecurityMarksPath', () => { + const result = client.folderSourceFindingSecurityMarksPath( + 'folderValue', + 'sourceValue', + 'findingValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.folderSourceFindingSecurityMarksPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchFolderFromFolderSourceFindingSecurityMarksName', () => { + const result = + client.matchFolderFromFolderSourceFindingSecurityMarksName(fakePath); + assert.strictEqual(result, 'folderValue'); assert( - (client.pathTemplates.findingPathTemplate.match as SinonStub) + ( + client.pathTemplates.folderSourceFindingSecurityMarksPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); - it('matchSourceFromFindingName', () => { - const result = client.matchSourceFromFindingName(fakePath); + it('matchSourceFromFolderSourceFindingSecurityMarksName', () => { + const result = + client.matchSourceFromFolderSourceFindingSecurityMarksName(fakePath); assert.strictEqual(result, 'sourceValue'); assert( - (client.pathTemplates.findingPathTemplate.match as SinonStub) + ( + client.pathTemplates.folderSourceFindingSecurityMarksPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); - it('matchFindingFromFindingName', () => { - const result = client.matchFindingFromFindingName(fakePath); + it('matchFindingFromFolderSourceFindingSecurityMarksName', () => { + const result = + client.matchFindingFromFolderSourceFindingSecurityMarksName(fakePath); assert.strictEqual(result, 'findingValue'); assert( - (client.pathTemplates.findingPathTemplate.match as SinonStub) + ( + client.pathTemplates.folderSourceFindingSecurityMarksPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -4366,6 +4567,68 @@ describe('v1p1beta1.SecurityCenterClient', () => { }); }); + describe('organizationAsset', () => { + const fakePath = '/rendered/path/organizationAsset'; + const expectedParameters = { + organization: 'organizationValue', + asset: 'assetValue', + }; + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.organizationAssetPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.organizationAssetPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('organizationAssetPath', () => { + const result = client.organizationAssetPath( + 'organizationValue', + 'assetValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.organizationAssetPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchOrganizationFromOrganizationAssetName', () => { + const result = + client.matchOrganizationFromOrganizationAssetName(fakePath); + assert.strictEqual(result, 'organizationValue'); + assert( + ( + client.pathTemplates.organizationAssetPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchAssetFromOrganizationAssetName', () => { + const result = client.matchAssetFromOrganizationAssetName(fakePath); + assert.strictEqual(result, 'assetValue'); + assert( + ( + client.pathTemplates.organizationAssetPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('organizationAssetSecurityMarks', () => { const fakePath = '/rendered/path/organizationAssetSecurityMarks'; const expectedParameters = { @@ -4474,34 +4737,33 @@ describe('v1p1beta1.SecurityCenterClient', () => { }); }); - describe('organizationSourceFindingSecurityMarks', () => { - const fakePath = '/rendered/path/organizationSourceFindingSecurityMarks'; + describe('organizationSource', () => { + const fakePath = '/rendered/path/organizationSource'; const expectedParameters = { organization: 'organizationValue', source: 'sourceValue', - finding: 'findingValue', }; const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); - client.pathTemplates.organizationSourceFindingSecurityMarksPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.organizationSourceFindingSecurityMarksPathTemplate.match = - sinon.stub().returns(expectedParameters); + client.pathTemplates.organizationSourcePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.organizationSourcePathTemplate.match = sinon + .stub() + .returns(expectedParameters); - it('organizationSourceFindingSecurityMarksPath', () => { - const result = client.organizationSourceFindingSecurityMarksPath( + it('organizationSourcePath', () => { + const result = client.organizationSourcePath( 'organizationValue', - 'sourceValue', - 'findingValue' + 'sourceValue' ); assert.strictEqual(result, fakePath); assert( ( - client.pathTemplates - .organizationSourceFindingSecurityMarksPathTemplate + client.pathTemplates.organizationSourcePathTemplate .render as SinonStub ) .getCall(-1) @@ -4509,16 +4771,13 @@ describe('v1p1beta1.SecurityCenterClient', () => { ); }); - it('matchOrganizationFromOrganizationSourceFindingSecurityMarksName', () => { + it('matchOrganizationFromOrganizationSourceName', () => { const result = - client.matchOrganizationFromOrganizationSourceFindingSecurityMarksName( - fakePath - ); + client.matchOrganizationFromOrganizationSourceName(fakePath); assert.strictEqual(result, 'organizationValue'); assert( ( - client.pathTemplates - .organizationSourceFindingSecurityMarksPathTemplate + client.pathTemplates.organizationSourcePathTemplate .match as SinonStub ) .getCall(-1) @@ -4526,33 +4785,12 @@ describe('v1p1beta1.SecurityCenterClient', () => { ); }); - it('matchSourceFromOrganizationSourceFindingSecurityMarksName', () => { - const result = - client.matchSourceFromOrganizationSourceFindingSecurityMarksName( - fakePath - ); + it('matchSourceFromOrganizationSourceName', () => { + const result = client.matchSourceFromOrganizationSourceName(fakePath); assert.strictEqual(result, 'sourceValue'); assert( ( - client.pathTemplates - .organizationSourceFindingSecurityMarksPathTemplate - .match as SinonStub - ) - .getCall(-1) - .calledWith(fakePath) - ); - }); - - it('matchFindingFromOrganizationSourceFindingSecurityMarksName', () => { - const result = - client.matchFindingFromOrganizationSourceFindingSecurityMarksName( - fakePath - ); - assert.strictEqual(result, 'findingValue'); - assert( - ( - client.pathTemplates - .organizationSourceFindingSecurityMarksPathTemplate + client.pathTemplates.organizationSourcePathTemplate .match as SinonStub ) .getCall(-1) @@ -4561,49 +4799,486 @@ describe('v1p1beta1.SecurityCenterClient', () => { }); }); - describe('source', () => { - const fakePath = '/rendered/path/source'; + describe('organizationSourceFinding', () => { + const fakePath = '/rendered/path/organizationSourceFinding'; const expectedParameters = { organization: 'organizationValue', source: 'sourceValue', + finding: 'findingValue', }; const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); - client.pathTemplates.sourcePathTemplate.render = sinon + client.pathTemplates.organizationSourceFindingPathTemplate.render = sinon .stub() .returns(fakePath); - client.pathTemplates.sourcePathTemplate.match = sinon + client.pathTemplates.organizationSourceFindingPathTemplate.match = sinon .stub() .returns(expectedParameters); - it('sourcePath', () => { - const result = client.sourcePath('organizationValue', 'sourceValue'); - assert.strictEqual(result, fakePath); - assert( - (client.pathTemplates.sourcePathTemplate.render as SinonStub) - .getCall(-1) + it('organizationSourceFindingPath', () => { + const result = client.organizationSourceFindingPath( + 'organizationValue', + 'sourceValue', + 'findingValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.organizationSourceFindingPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchOrganizationFromOrganizationSourceFindingName', () => { + const result = + client.matchOrganizationFromOrganizationSourceFindingName(fakePath); + assert.strictEqual(result, 'organizationValue'); + assert( + ( + client.pathTemplates.organizationSourceFindingPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSourceFromOrganizationSourceFindingName', () => { + const result = + client.matchSourceFromOrganizationSourceFindingName(fakePath); + assert.strictEqual(result, 'sourceValue'); + assert( + ( + client.pathTemplates.organizationSourceFindingPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchFindingFromOrganizationSourceFindingName', () => { + const result = + client.matchFindingFromOrganizationSourceFindingName(fakePath); + assert.strictEqual(result, 'findingValue'); + assert( + ( + client.pathTemplates.organizationSourceFindingPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('organizationSourceFindingSecurityMarks', () => { + const fakePath = '/rendered/path/organizationSourceFindingSecurityMarks'; + const expectedParameters = { + organization: 'organizationValue', + source: 'sourceValue', + finding: 'findingValue', + }; + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.organizationSourceFindingSecurityMarksPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationSourceFindingSecurityMarksPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('organizationSourceFindingSecurityMarksPath', () => { + const result = client.organizationSourceFindingSecurityMarksPath( + 'organizationValue', + 'sourceValue', + 'findingValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .organizationSourceFindingSecurityMarksPathTemplate + .render as SinonStub + ) + .getCall(-1) .calledWith(expectedParameters) ); }); - it('matchOrganizationFromSourceName', () => { - const result = client.matchOrganizationFromSourceName(fakePath); + it('matchOrganizationFromOrganizationSourceFindingSecurityMarksName', () => { + const result = + client.matchOrganizationFromOrganizationSourceFindingSecurityMarksName( + fakePath + ); assert.strictEqual(result, 'organizationValue'); assert( - (client.pathTemplates.sourcePathTemplate.match as SinonStub) + ( + client.pathTemplates + .organizationSourceFindingSecurityMarksPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSourceFromOrganizationSourceFindingSecurityMarksName', () => { + const result = + client.matchSourceFromOrganizationSourceFindingSecurityMarksName( + fakePath + ); + assert.strictEqual(result, 'sourceValue'); + assert( + ( + client.pathTemplates + .organizationSourceFindingSecurityMarksPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchFindingFromOrganizationSourceFindingSecurityMarksName', () => { + const result = + client.matchFindingFromOrganizationSourceFindingSecurityMarksName( + fakePath + ); + assert.strictEqual(result, 'findingValue'); + assert( + ( + client.pathTemplates + .organizationSourceFindingSecurityMarksPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectAsset', () => { + const fakePath = '/rendered/path/projectAsset'; + const expectedParameters = { + project: 'projectValue', + asset: 'assetValue', + }; + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectAssetPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectAssetPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectAssetPath', () => { + const result = client.projectAssetPath('projectValue', 'assetValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectAssetPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectAssetName', () => { + const result = client.matchProjectFromProjectAssetName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectAssetPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchAssetFromProjectAssetName', () => { + const result = client.matchAssetFromProjectAssetName(fakePath); + assert.strictEqual(result, 'assetValue'); + assert( + (client.pathTemplates.projectAssetPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectAssetSecurityMarks', () => { + const fakePath = '/rendered/path/projectAssetSecurityMarks'; + const expectedParameters = { + project: 'projectValue', + asset: 'assetValue', + }; + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectAssetSecurityMarksPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectAssetSecurityMarksPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectAssetSecurityMarksPath', () => { + const result = client.projectAssetSecurityMarksPath( + 'projectValue', + 'assetValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectAssetSecurityMarksPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectAssetSecurityMarksName', () => { + const result = + client.matchProjectFromProjectAssetSecurityMarksName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectAssetSecurityMarksPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchAssetFromProjectAssetSecurityMarksName', () => { + const result = + client.matchAssetFromProjectAssetSecurityMarksName(fakePath); + assert.strictEqual(result, 'assetValue'); + assert( + ( + client.pathTemplates.projectAssetSecurityMarksPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectSource', () => { + const fakePath = '/rendered/path/projectSource'; + const expectedParameters = { + project: 'projectValue', + source: 'sourceValue', + }; + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectSourcePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectSourcePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectSourcePath', () => { + const result = client.projectSourcePath('projectValue', 'sourceValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectSourcePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectSourceName', () => { + const result = client.matchProjectFromProjectSourceName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectSourcePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSourceFromProjectSourceName', () => { + const result = client.matchSourceFromProjectSourceName(fakePath); + assert.strictEqual(result, 'sourceValue'); + assert( + (client.pathTemplates.projectSourcePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectSourceFinding', () => { + const fakePath = '/rendered/path/projectSourceFinding'; + const expectedParameters = { + project: 'projectValue', + source: 'sourceValue', + finding: 'findingValue', + }; + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectSourceFindingPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectSourceFindingPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectSourceFindingPath', () => { + const result = client.projectSourceFindingPath( + 'projectValue', + 'sourceValue', + 'findingValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectSourceFindingPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectSourceFindingName', () => { + const result = + client.matchProjectFromProjectSourceFindingName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectSourceFindingPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSourceFromProjectSourceFindingName', () => { + const result = client.matchSourceFromProjectSourceFindingName(fakePath); + assert.strictEqual(result, 'sourceValue'); + assert( + ( + client.pathTemplates.projectSourceFindingPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchFindingFromProjectSourceFindingName', () => { + const result = + client.matchFindingFromProjectSourceFindingName(fakePath); + assert.strictEqual(result, 'findingValue'); + assert( + ( + client.pathTemplates.projectSourceFindingPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectSourceFindingSecurityMarks', () => { + const fakePath = '/rendered/path/projectSourceFindingSecurityMarks'; + const expectedParameters = { + project: 'projectValue', + source: 'sourceValue', + finding: 'findingValue', + }; + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectSourceFindingSecurityMarksPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectSourceFindingSecurityMarksPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectSourceFindingSecurityMarksPath', () => { + const result = client.projectSourceFindingSecurityMarksPath( + 'projectValue', + 'sourceValue', + 'findingValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectSourceFindingSecurityMarksPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectSourceFindingSecurityMarksName', () => { + const result = + client.matchProjectFromProjectSourceFindingSecurityMarksName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectSourceFindingSecurityMarksPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); - it('matchSourceFromSourceName', () => { - const result = client.matchSourceFromSourceName(fakePath); + it('matchSourceFromProjectSourceFindingSecurityMarksName', () => { + const result = + client.matchSourceFromProjectSourceFindingSecurityMarksName(fakePath); assert.strictEqual(result, 'sourceValue'); assert( - (client.pathTemplates.sourcePathTemplate.match as SinonStub) + ( + client.pathTemplates.projectSourceFindingSecurityMarksPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchFindingFromProjectSourceFindingSecurityMarksName', () => { + const result = + client.matchFindingFromProjectSourceFindingSecurityMarksName( + fakePath + ); + assert.strictEqual(result, 'findingValue'); + assert( + ( + client.pathTemplates.projectSourceFindingSecurityMarksPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); From a73c4ceb7544b8f1f56cebead8a9209da873b076 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Wed, 12 May 2021 16:54:02 +0000 Subject: [PATCH 249/342] feat(v1): add canonical_name and folder fields (#379) Assets and findings may be created in organizations, folders or projects, however in the current API version the name field for resources will always be prefixed by "organizations/...", for historical reasons. The "canonical_name" field shows the actual location of the resource, and in requests either the name or "canonical name" can be used for the "name" in the request. The "folder" field contains the folders in the resource's ancestry. PiperOrigin-RevId: 372965035 Source-Link: https://github.com/googleapis/googleapis/commit/0a992df8020d2fce3a18ccb7d43f727fb4f4a3cb Source-Link: https://github.com/googleapis/googleapis-gen/commit/3874faae0c32d3fb3da5ba2a0ced11f636bb2d05 --- .../cloud/securitycenter/v1/asset.proto | 22 +- .../cloud/securitycenter/v1/finding.proto | 17 +- .../cloud/securitycenter/v1/folder.proto | 38 + .../v1/notification_config.proto | 4 +- .../v1/notification_message.proto | 4 +- .../v1/organization_settings.proto | 8 +- .../cloud/securitycenter/v1/resource.proto | 9 +- .../v1/run_asset_discovery_response.proto | 4 +- .../securitycenter/v1/security_marks.proto | 18 +- .../v1/securitycenter_service.proto | 114 +- .../cloud/securitycenter/v1/source.proto | 14 +- .../protos/protos.d.ts | 682 +++-- .../protos/protos.js | 2198 ++++++++++------- .../protos/protos.json | 346 ++- .../google-cloud-securitycenter/src/index.ts | 6 +- .../src/v1/security_center_client.ts | 751 +++++- .../src/v1/security_center_proto_list.json | 1 + .../test/gapic_security_center_v1.ts | 861 ++++++- 18 files changed, 3641 insertions(+), 1456 deletions(-) create mode 100644 packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/folder.proto diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/asset.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/asset.proto index eb07c0493b6..b23a4232f94 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/asset.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/asset.proto @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// 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. @@ -16,11 +16,12 @@ syntax = "proto3"; package google.cloud.securitycenter.v1; -import "google/api/annotations.proto"; import "google/api/resource.proto"; +import "google/cloud/securitycenter/v1/folder.proto"; import "google/cloud/securitycenter/v1/security_marks.proto"; import "google/protobuf/struct.proto"; import "google/protobuf/timestamp.proto"; +import "google/api/annotations.proto"; option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1;securitycenter"; @@ -40,6 +41,8 @@ message Asset { option (google.api.resource) = { type: "securitycenter.googleapis.com/Asset" pattern: "organizations/{organization}/assets/{asset}" + pattern: "folders/{folder}/assets/{asset}" + pattern: "projects/{project}/assets/{asset}" }; // Security Command Center managed properties. These properties are managed by @@ -75,6 +78,11 @@ message Asset { // The user defined display name for the project of this resource. string resource_project_display_name = 8; + + // Contains a Folder message for each folder in the assets ancestry. + // The first folder is the deepest nested folder, and the last folder is the + // folder directly under the Organization. + repeated Folder folders = 10; } // Cloud IAM Policy information associated with the Google Cloud resource @@ -109,8 +117,7 @@ message Asset { // The time at which the asset was created in Security Command Center. google.protobuf.Timestamp create_time = 9; - // The time at which the asset was last updated, added, or deleted in Security - // Command Center. + // The time at which the asset was last updated or added in Cloud SCC. google.protobuf.Timestamp update_time = 10; // Cloud IAM Policy information associated with the Google Cloud resource @@ -118,4 +125,11 @@ message Asset { // and defined by the Google Cloud resource and cannot be modified by the // user. IamPolicy iam_policy = 11; + + // The canonical name of the resource. It's either + // "organizations/{organization_id}/assets/{asset_id}", + // "folders/{folder_id}/assets/{asset_id}" or + // "projects/{project_number}/assets/{asset_id}", depending on the closest CRM + // ancestor of the resource. + string canonical_name = 13; } diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/finding.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/finding.proto index dcc62f8b9c6..84abc862b0b 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/finding.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/finding.proto @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// 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. @@ -16,12 +16,12 @@ syntax = "proto3"; package google.cloud.securitycenter.v1; -import "google/api/annotations.proto"; import "google/api/field_behavior.proto"; import "google/api/resource.proto"; import "google/cloud/securitycenter/v1/security_marks.proto"; import "google/protobuf/struct.proto"; import "google/protobuf/timestamp.proto"; +import "google/api/annotations.proto"; option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1;securitycenter"; @@ -41,6 +41,8 @@ message Finding { option (google.api.resource) = { type: "securitycenter.googleapis.com/Finding" pattern: "organizations/{organization}/sources/{source}/findings/{finding}" + pattern: "folders/{folder}/sources/{source}/findings/{finding}" + pattern: "projects/{project}/sources/{source}/findings/{finding}" }; // The state of the finding. @@ -164,7 +166,8 @@ message Finding { // occurred. For example, if the finding represents an open firewall it would // capture the time the detector believes the firewall became open. The // accuracy is determined by the detector. If the finding were to be resolved - // afterward, this time would reflect when the finding was resolved. + // afterward, this time would reflect when the finding was resolved. Must not + // be set to a value greater than the current timestamp. google.protobuf.Timestamp event_time = 9; // The time at which the finding was created in Security Command Center. @@ -173,4 +176,12 @@ message Finding { // The severity of the finding. This field is managed by the source that // writes the finding. Severity severity = 12; + + // The canonical name of the finding. It's either + // "organizations/{organization_id}/sources/{source_id}/findings/{finding_id}", + // "folders/{folder_id}/sources/{source_id}/findings/{finding_id}" or + // "projects/{project_number}/sources/{source_id}/findings/{finding_id}", + // depending on the closest CRM ancestor of the resource associated with the + // finding. + string canonical_name = 14; } diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/folder.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/folder.proto new file mode 100644 index 00000000000..49c114d4613 --- /dev/null +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/folder.proto @@ -0,0 +1,38 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.securitycenter.v1; + +import "google/api/annotations.proto"; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1;securitycenter"; +option java_multiple_files = true; +option java_outer_classname = "FolderProto"; +option java_package = "com.google.cloud.securitycenter.v1"; +option php_namespace = "Google\\Cloud\\SecurityCenter\\V1"; +option ruby_package = "Google::Cloud::SecurityCenter::V1"; + +// Message that contains the resource name and display name of a folder +// resource. +message Folder { + // Full resource name of this folder. See: + // https://cloud.google.com/apis/design/resource_names#full_resource_name + string resource_folder = 1; + + // The user defined display name for this folder. + string resource_folder_display_name = 2; +} diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/notification_config.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/notification_config.proto index 1a9676d9d67..7f670279a7f 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/notification_config.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/notification_config.proto @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// 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. @@ -16,9 +16,9 @@ syntax = "proto3"; package google.cloud.securitycenter.v1; -import "google/api/annotations.proto"; import "google/api/field_behavior.proto"; import "google/api/resource.proto"; +import "google/api/annotations.proto"; option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1;securitycenter"; diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/notification_message.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/notification_message.proto index 08b6b7c88eb..6a9ce0852cf 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/notification_message.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/notification_message.proto @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// 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. @@ -16,9 +16,9 @@ syntax = "proto3"; package google.cloud.securitycenter.v1; -import "google/api/annotations.proto"; import "google/cloud/securitycenter/v1/finding.proto"; import "google/cloud/securitycenter/v1/resource.proto"; +import "google/api/annotations.proto"; option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1;securitycenter"; diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/organization_settings.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/organization_settings.proto index 66b659bc5f0..1dc77257726 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/organization_settings.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/organization_settings.proto @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// 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. @@ -16,8 +16,8 @@ syntax = "proto3"; package google.cloud.securitycenter.v1; -import "google/api/annotations.proto"; import "google/api/resource.proto"; +import "google/api/annotations.proto"; option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1;securitycenter"; @@ -63,6 +63,10 @@ message OrganizationSettings { // The mode to use for filtering asset discovery. InclusionMode inclusion_mode = 2; + + // The folder ids to use for filtering asset discovery. + // It consists of only digits, e.g., 756619654966. + repeated string folder_ids = 3; } // The relative resource name of the settings. See: diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/resource.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/resource.proto index 855e697373f..c1c2ad414a7 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/resource.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/resource.proto @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// 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. @@ -16,6 +16,8 @@ syntax = "proto3"; package google.cloud.securitycenter.v1; +import "google/api/field_behavior.proto"; +import "google/cloud/securitycenter/v1/folder.proto"; import "google/api/annotations.proto"; option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; @@ -43,4 +45,9 @@ message Resource { // The human readable name of resource's parent. string parent_display_name = 5; + + // Output only. Contains a Folder message for each folder in the assets ancestry. + // The first folder is the deepest nested folder, and the last folder is the + // folder directly under the Organization. + repeated Folder folders = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; } diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/run_asset_discovery_response.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/run_asset_discovery_response.proto index 4f09d9c0a42..20d084cae0b 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/run_asset_discovery_response.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/run_asset_discovery_response.proto @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// 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. @@ -16,8 +16,8 @@ syntax = "proto3"; package google.cloud.securitycenter.v1; -import "google/api/annotations.proto"; import "google/protobuf/duration.proto"; +import "google/api/annotations.proto"; option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1;securitycenter"; diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/security_marks.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/security_marks.proto index 47a4a150be5..f055cd5efcf 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/security_marks.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/security_marks.proto @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// 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. @@ -16,8 +16,8 @@ syntax = "proto3"; package google.cloud.securitycenter.v1; -import "google/api/annotations.proto"; import "google/api/resource.proto"; +import "google/api/annotations.proto"; option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1;securitycenter"; @@ -35,6 +35,10 @@ message SecurityMarks { type: "securitycenter.googleapis.com/SecurityMarks" pattern: "organizations/{organization}/assets/{asset}/securityMarks" pattern: "organizations/{organization}/sources/{source}/findings/{finding}/securityMarks" + pattern: "folders/{folder}/assets/{asset}/securityMarks" + pattern: "projects/{project}/assets/{asset}/securityMarks" + pattern: "folders/{folder}/sources/{source}/findings/{finding}/securityMarks" + pattern: "projects/{project}/sources/{source}/findings/{finding}/securityMarks" }; // The relative resource name of the SecurityMarks. See: @@ -53,4 +57,14 @@ message SecurityMarks { // * Values have leading and trailing whitespace trimmed, remaining // characters must be between 1 - 4096 characters (inclusive) map marks = 2; + + // The canonical name of the marks. + // Examples: + // "organizations/{organization_id}/assets/{asset_id}/securityMarks" + // "folders/{folder_id}/assets/{asset_id}/securityMarks" + // "projects/{project_number}/assets/{asset_id}/securityMarks" + // "organizations/{organization_id}/sources/{source_id}/findings/{finding_id}/securityMarks" + // "folders/{folder_id}/sources/{source_id}/findings/{finding_id}/securityMarks" + // "projects/{project_number}/sources/{source_id}/findings/{finding_id}/securityMarks" + string canonical_name = 3; } diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/securitycenter_service.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/securitycenter_service.proto index 07f2f99d630..2a23a2439a9 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/securitycenter_service.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/securitycenter_service.proto @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// 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. @@ -23,6 +23,7 @@ import "google/api/field_behavior.proto"; import "google/api/resource.proto"; import "google/cloud/securitycenter/v1/asset.proto"; import "google/cloud/securitycenter/v1/finding.proto"; +import "google/cloud/securitycenter/v1/folder.proto"; import "google/cloud/securitycenter/v1/notification_config.proto"; import "google/cloud/securitycenter/v1/organization_settings.proto"; import "google/cloud/securitycenter/v1/security_marks.proto"; @@ -124,6 +125,14 @@ service SecurityCenter { option (google.api.http) = { post: "/v1/{parent=organizations/*}/assets:group" body: "*" + additional_bindings { + post: "/v1/{parent=folders/*}/assets:group" + body: "*" + } + additional_bindings { + post: "/v1/{parent=projects/*}/assets:group" + body: "*" + } }; } @@ -131,11 +140,21 @@ service SecurityCenter { // specified properties. // // To group across all sources provide a `-` as the source id. - // Example: /v1/organizations/{organization_id}/sources/-/findings + // Example: /v1/organizations/{organization_id}/sources/-/findings, + // /v1/folders/{folder_id}/sources/-/findings, + // /v1/projects/{project_id}/sources/-/findings rpc GroupFindings(GroupFindingsRequest) returns (GroupFindingsResponse) { option (google.api.http) = { post: "/v1/{parent=organizations/*/sources/*}/findings:group" body: "*" + additional_bindings { + post: "/v1/{parent=folders/*/sources/*}/findings:group" + body: "*" + } + additional_bindings { + post: "/v1/{parent=projects/*/sources/*}/findings:group" + body: "*" + } }; option (google.api.method_signature) = "parent,group_by"; } @@ -144,6 +163,12 @@ service SecurityCenter { rpc ListAssets(ListAssetsRequest) returns (ListAssetsResponse) { option (google.api.http) = { get: "/v1/{parent=organizations/*}/assets" + additional_bindings { + get: "/v1/{parent=folders/*}/assets" + } + additional_bindings { + get: "/v1/{parent=projects/*}/assets" + } }; } @@ -154,6 +179,12 @@ service SecurityCenter { rpc ListFindings(ListFindingsRequest) returns (ListFindingsResponse) { option (google.api.http) = { get: "/v1/{parent=organizations/*/sources/*}/findings" + additional_bindings { + get: "/v1/{parent=folders/*/sources/*}/findings" + } + additional_bindings { + get: "/v1/{parent=projects/*/sources/*}/findings" + } }; } @@ -169,6 +200,12 @@ service SecurityCenter { rpc ListSources(ListSourcesRequest) returns (ListSourcesResponse) { option (google.api.http) = { get: "/v1/{parent=organizations/*}/sources" + additional_bindings { + get: "/v1/{parent=folders/*}/sources" + } + additional_bindings { + get: "/v1/{parent=projects/*}/sources" + } }; option (google.api.method_signature) = "parent"; } @@ -196,6 +233,14 @@ service SecurityCenter { option (google.api.http) = { post: "/v1/{name=organizations/*/sources/*/findings/*}:setState" body: "*" + additional_bindings { + post: "/v1/{name=folders/*/sources/*/findings/*}:setState" + body: "*" + } + additional_bindings { + post: "/v1/{name=projects/*/sources/*/findings/*}:setState" + body: "*" + } }; option (google.api.method_signature) = "name,state,start_time"; } @@ -224,10 +269,19 @@ service SecurityCenter { option (google.api.http) = { patch: "/v1/{finding.name=organizations/*/sources/*/findings/*}" body: "finding" + additional_bindings { + patch: "/v1/{finding.name=folders/*/sources/*/findings/*}" + body: "finding" + } + additional_bindings { + patch: "/v1/{finding.name=projects/*/sources/*/findings/*}" + body: "finding" + } }; option (google.api.method_signature) = "finding"; } + // // Updates a notification config. The following update // fields are allowed: description, pubsub_topic, streaming_config.filter rpc UpdateNotificationConfig(UpdateNotificationConfigRequest) returns (NotificationConfig) { @@ -262,10 +316,26 @@ service SecurityCenter { option (google.api.http) = { patch: "/v1/{security_marks.name=organizations/*/assets/*/securityMarks}" body: "security_marks" + additional_bindings { + patch: "/v1/{security_marks.name=folders/*/assets/*/securityMarks}" + body: "security_marks" + } + additional_bindings { + patch: "/v1/{security_marks.name=projects/*/assets/*/securityMarks}" + body: "security_marks" + } additional_bindings { patch: "/v1/{security_marks.name=organizations/*/sources/*/findings/*/securityMarks}" body: "security_marks" } + additional_bindings { + patch: "/v1/{security_marks.name=folders/*/sources/*/findings/*/securityMarks}" + body: "security_marks" + } + additional_bindings { + patch: "/v1/{security_marks.name=projects/*/sources/*/findings/*/securityMarks}" + body: "security_marks" + } }; option (google.api.method_signature) = "security_marks"; } @@ -381,11 +451,12 @@ message GetSourceRequest { // Request message for grouping by assets. message GroupAssetsRequest { // Required. Name of the organization to groupBy. Its format is - // "organizations/[organization_id]". + // "organizations/[organization_id], folders/[folder_id], or + // projects/[project_id]". string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { - type: "cloudresourcemanager.googleapis.com/Organization" + child_type: "securitycenter.googleapis.com/Asset" } ]; @@ -539,9 +610,12 @@ message GroupAssetsResponse { // Request message for grouping by findings. message GroupFindingsRequest { // Required. Name of the source to groupBy. Its format is - // "organizations/[organization_id]/sources/[source_id]". To groupBy across - // all sources provide a source_id of `-`. For example: - // organizations/{organization_id}/sources/- + // "organizations/[organization_id]/sources/[source_id]", + // folders/[folder_id]/sources/[source_id], or + // projects/[project_id]/sources/[source_id]. To groupBy across all sources + // provide a source_id of `-`. For example: + // organizations/{organization_id}/sources/-, folders/{folder_id}/sources/-, + // or projects/{project_id}/sources/- string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -728,12 +802,13 @@ message ListNotificationConfigsResponse { // Request message for listing sources. message ListSourcesRequest { - // Required. Resource name of the parent of sources to list. Its format should - // be "organizations/[organization_id]". + // Required. Resource name of the parent of sources to list. Its format should be + // "organizations/[organization_id], folders/[folder_id], or + // projects/[project_id]". string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { - type: "cloudresourcemanager.googleapis.com/Organization" + child_type: "securitycenter.googleapis.com/Source" } ]; @@ -760,11 +835,12 @@ message ListSourcesResponse { // Request message for listing assets. message ListAssetsRequest { // Required. Name of the organization assets should belong to. Its format is - // "organizations/[organization_id]". + // "organizations/[organization_id], folders/[folder_id], or + // projects/[project_id]". string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { - type: "cloudresourcemanager.googleapis.com/Organization" + child_type: "securitycenter.googleapis.com/Asset" } ]; @@ -950,9 +1026,12 @@ message ListAssetsResponse { // Request message for listing findings. message ListFindingsRequest { // Required. Name of the source the findings belong to. Its format is - // "organizations/[organization_id]/sources/[source_id]". To list across all - // sources provide a source_id of `-`. For example: - // organizations/{organization_id}/sources/- + // "organizations/[organization_id]/sources/[source_id], + // folders/[folder_id]/sources/[source_id], or + // projects/[project_id]/sources/[source_id]". To list across all sources + // provide a source_id of `-`. For example: + // organizations/{organization_id}/sources/-, folders/{folder_id}/sources/- or + // projects/{projects_id}/sources/- string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -1106,6 +1185,11 @@ message ListFindingsResponse { // The human readable name of resource's parent. string parent_display_name = 5; + + // Contains a Folder message for each folder in the assets ancestry. + // The first folder is the deepest nested folder, and the last folder is + // the folder directly under the Organization. + repeated Folder folders = 7; } // The change in state of the finding. diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/source.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/source.proto index e7b1a1835f4..0df844ddede 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/source.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/source.proto @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// 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. @@ -16,8 +16,8 @@ syntax = "proto3"; package google.cloud.securitycenter.v1; -import "google/api/annotations.proto"; import "google/api/resource.proto"; +import "google/api/annotations.proto"; option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1;securitycenter"; @@ -34,6 +34,8 @@ message Source { option (google.api.resource) = { type: "securitycenter.googleapis.com/Source" pattern: "organizations/{organization}/sources/{source}" + pattern: "folders/{folder}/sources/{source}" + pattern: "projects/{project}/sources/{source}" }; // The relative resource name of this source. See: @@ -57,4 +59,12 @@ message Source { // (XSS), Flash injection, mixed content (HTTP in HTTPS), and // outdated or insecure libraries." string description = 3; + + // The canonical name of the finding. It's either + // "organizations/{organization_id}/sources/{source_id}", + // "folders/{folder_id}/sources/{source_id}" or + // "projects/{project_number}/sources/{source_id}", + // depending on the closest CRM ancestor of the resource associated with the + // finding. + string canonical_name = 14; } diff --git a/packages/google-cloud-securitycenter/protos/protos.d.ts b/packages/google-cloud-securitycenter/protos/protos.d.ts index 6817598cec6..1c66aa3f09c 100644 --- a/packages/google-cloud-securitycenter/protos/protos.d.ts +++ b/packages/google-cloud-securitycenter/protos/protos.d.ts @@ -49,6 +49,9 @@ export namespace google { /** Asset iamPolicy */ iamPolicy?: (google.cloud.securitycenter.v1.Asset.IIamPolicy|null); + + /** Asset canonicalName */ + canonicalName?: (string|null); } /** Represents an Asset. */ @@ -81,6 +84,9 @@ export namespace google { /** Asset iamPolicy. */ public iamPolicy?: (google.cloud.securitycenter.v1.Asset.IIamPolicy|null); + /** Asset canonicalName. */ + public canonicalName: string; + /** * Creates a new Asset instance using the specified properties. * @param [properties] Properties to set @@ -180,6 +186,9 @@ export namespace google { /** SecurityCenterProperties resourceProjectDisplayName */ resourceProjectDisplayName?: (string|null); + + /** SecurityCenterProperties folders */ + folders?: (google.cloud.securitycenter.v1.IFolder[]|null); } /** Represents a SecurityCenterProperties. */ @@ -215,6 +224,9 @@ export namespace google { /** SecurityCenterProperties resourceProjectDisplayName. */ public resourceProjectDisplayName: string; + /** SecurityCenterProperties folders. */ + public folders: google.cloud.securitycenter.v1.IFolder[]; + /** * Creates a new SecurityCenterProperties instance using the specified properties. * @param [properties] Properties to set @@ -377,6 +389,102 @@ export namespace google { } } + /** Properties of a Folder. */ + interface IFolder { + + /** Folder resourceFolder */ + resourceFolder?: (string|null); + + /** Folder resourceFolderDisplayName */ + resourceFolderDisplayName?: (string|null); + } + + /** Represents a Folder. */ + class Folder implements IFolder { + + /** + * Constructs a new Folder. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IFolder); + + /** Folder resourceFolder. */ + public resourceFolder: string; + + /** Folder resourceFolderDisplayName. */ + public resourceFolderDisplayName: string; + + /** + * Creates a new Folder instance using the specified properties. + * @param [properties] Properties to set + * @returns Folder instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IFolder): google.cloud.securitycenter.v1.Folder; + + /** + * Encodes the specified Folder message. Does not implicitly {@link google.cloud.securitycenter.v1.Folder.verify|verify} messages. + * @param message Folder message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IFolder, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Folder message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Folder.verify|verify} messages. + * @param message Folder message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IFolder, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Folder message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Folder + * @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.cloud.securitycenter.v1.Folder; + + /** + * Decodes a Folder message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Folder + * @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.cloud.securitycenter.v1.Folder; + + /** + * Verifies a Folder 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 Folder message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Folder + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.Folder; + + /** + * Creates a plain object from a Folder message. Also converts values to other types if specified. + * @param message Folder + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.Folder, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Folder to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + /** Properties of a SecurityMarks. */ interface ISecurityMarks { @@ -385,6 +493,9 @@ export namespace google { /** SecurityMarks marks */ marks?: ({ [k: string]: string }|null); + + /** SecurityMarks canonicalName */ + canonicalName?: (string|null); } /** Represents a SecurityMarks. */ @@ -402,6 +513,9 @@ export namespace google { /** SecurityMarks marks. */ public marks: { [k: string]: string }; + /** SecurityMarks canonicalName. */ + public canonicalName: string; + /** * Creates a new SecurityMarks instance using the specified properties. * @param [properties] Properties to set @@ -508,6 +622,9 @@ export namespace google { /** Finding severity */ severity?: (google.cloud.securitycenter.v1.Finding.Severity|keyof typeof google.cloud.securitycenter.v1.Finding.Severity|null); + + /** Finding canonicalName */ + canonicalName?: (string|null); } /** Represents a Finding. */ @@ -552,6 +669,9 @@ export namespace google { /** Finding severity. */ public severity: (google.cloud.securitycenter.v1.Finding.Severity|keyof typeof google.cloud.securitycenter.v1.Finding.Severity); + /** Finding canonicalName. */ + public canonicalName: string; + /** * Creates a new Finding instance using the specified properties. * @param [properties] Properties to set @@ -974,6 +1094,9 @@ export namespace google { /** Resource parentDisplayName */ parentDisplayName?: (string|null); + + /** Resource folders */ + folders?: (google.cloud.securitycenter.v1.IFolder[]|null); } /** Represents a Resource. */ @@ -1000,6 +1123,9 @@ export namespace google { /** Resource parentDisplayName. */ public parentDisplayName: string; + /** Resource folders. */ + public folders: google.cloud.securitycenter.v1.IFolder[]; + /** * Creates a new Resource instance using the specified properties. * @param [properties] Properties to set @@ -1183,6 +1309,9 @@ export namespace google { /** AssetDiscoveryConfig inclusionMode */ inclusionMode?: (google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode|keyof typeof google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode|null); + + /** AssetDiscoveryConfig folderIds */ + folderIds?: (string[]|null); } /** Represents an AssetDiscoveryConfig. */ @@ -1200,6 +1329,9 @@ export namespace google { /** AssetDiscoveryConfig inclusionMode. */ public inclusionMode: (google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode|keyof typeof google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode); + /** AssetDiscoveryConfig folderIds. */ + public folderIds: string[]; + /** * Creates a new AssetDiscoveryConfig instance using the specified properties. * @param [properties] Properties to set @@ -4229,6 +4361,9 @@ export namespace google { /** Resource parentDisplayName */ parentDisplayName?: (string|null); + + /** Resource folders */ + folders?: (google.cloud.securitycenter.v1.IFolder[]|null); } /** Represents a Resource. */ @@ -4255,6 +4390,9 @@ export namespace google { /** Resource parentDisplayName. */ public parentDisplayName: string; + /** Resource folders. */ + public folders: google.cloud.securitycenter.v1.IFolder[]; + /** * Creates a new Resource instance using the specified properties. * @param [properties] Properties to set @@ -5026,6 +5164,9 @@ export namespace google { /** Source description */ description?: (string|null); + + /** Source canonicalName */ + canonicalName?: (string|null); } /** Represents a Source. */ @@ -5046,6 +5187,9 @@ export namespace google { /** Source description. */ public description: string; + /** Source canonicalName. */ + public canonicalName: string; + /** * Creates a new Source instance using the specified properties. * @param [properties] Properties to set @@ -13976,578 +14120,578 @@ export namespace google { /** Namespace api. */ namespace api { - /** Properties of a Http. */ - interface IHttp { + /** Properties of a ResourceDescriptor. */ + interface IResourceDescriptor { - /** Http rules */ - rules?: (google.api.IHttpRule[]|null); + /** ResourceDescriptor type */ + type?: (string|null); - /** Http fullyDecodeReservedExpansion */ - fullyDecodeReservedExpansion?: (boolean|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 Http. */ - class Http implements IHttp { + /** Represents a ResourceDescriptor. */ + class ResourceDescriptor implements IResourceDescriptor { /** - * Constructs a new Http. + * Constructs a new ResourceDescriptor. * @param [properties] Properties to set */ - constructor(properties?: google.api.IHttp); + constructor(properties?: google.api.IResourceDescriptor); - /** Http rules. */ - public rules: google.api.IHttpRule[]; + /** ResourceDescriptor type. */ + public type: string; - /** Http fullyDecodeReservedExpansion. */ - public fullyDecodeReservedExpansion: boolean; + /** 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 Http instance using the specified properties. + * Creates a new ResourceDescriptor instance using the specified properties. * @param [properties] Properties to set - * @returns Http instance + * @returns ResourceDescriptor instance */ - public static create(properties?: google.api.IHttp): google.api.Http; + public static create(properties?: google.api.IResourceDescriptor): google.api.ResourceDescriptor; /** - * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. - * @param message Http message or plain object to encode + * 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.IHttp, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.api.IResourceDescriptor, 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 + * 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.IHttp, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.api.IResourceDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a Http message from the specified reader or buffer. + * 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 Http + * @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.Http; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ResourceDescriptor; /** - * Decodes a Http message from the specified reader or buffer, length delimited. + * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Http + * @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.Http; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ResourceDescriptor; /** - * Verifies a Http message. + * 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 Http message from a plain object. Also converts values to their respective internal types. + * Creates a ResourceDescriptor message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Http + * @returns ResourceDescriptor */ - public static fromObject(object: { [k: string]: any }): google.api.Http; + public static fromObject(object: { [k: string]: any }): google.api.ResourceDescriptor; /** - * Creates a plain object from a Http message. Also converts values to other types if specified. - * @param message Http + * 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.Http, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.api.ResourceDescriptor, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Http to JSON. + * Converts this ResourceDescriptor to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a HttpRule. */ - interface IHttpRule { + namespace ResourceDescriptor { - /** HttpRule selector */ - selector?: (string|null); + /** History enum. */ + enum History { + HISTORY_UNSPECIFIED = 0, + ORIGINALLY_SINGLE_PATTERN = 1, + FUTURE_MULTI_PATTERN = 2 + } - /** HttpRule get */ - get?: (string|null); + /** Style enum. */ + enum Style { + STYLE_UNSPECIFIED = 0, + DECLARATIVE_FRIENDLY = 1 + } + } - /** HttpRule put */ - put?: (string|null); + /** Properties of a ResourceReference. */ + interface IResourceReference { - /** 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); + /** ResourceReference type */ + type?: (string|null); - /** HttpRule additionalBindings */ - additionalBindings?: (google.api.IHttpRule[]|null); + /** ResourceReference childType */ + childType?: (string|null); } - /** Represents a HttpRule. */ - class HttpRule implements IHttpRule { + /** Represents a ResourceReference. */ + class ResourceReference implements IResourceReference { /** - * Constructs a new HttpRule. + * Constructs a new ResourceReference. * @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; + constructor(properties?: google.api.IResourceReference); - /** HttpRule additionalBindings. */ - public additionalBindings: google.api.IHttpRule[]; + /** ResourceReference type. */ + public type: string; - /** HttpRule pattern. */ - public pattern?: ("get"|"put"|"post"|"delete"|"patch"|"custom"); + /** ResourceReference childType. */ + public childType: string; /** - * Creates a new HttpRule instance using the specified properties. + * Creates a new ResourceReference instance using the specified properties. * @param [properties] Properties to set - * @returns HttpRule instance + * @returns ResourceReference instance */ - public static create(properties?: google.api.IHttpRule): google.api.HttpRule; + public static create(properties?: google.api.IResourceReference): google.api.ResourceReference; /** - * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. - * @param message HttpRule message or plain object to encode + * 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.IHttpRule, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.api.IResourceReference, 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 + * 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.IHttpRule, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.api.IResourceReference, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a HttpRule message from the specified reader or buffer. + * 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 HttpRule + * @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.HttpRule; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ResourceReference; /** - * Decodes a HttpRule message from the specified reader or buffer, length delimited. + * Decodes a ResourceReference message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns HttpRule + * @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.HttpRule; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ResourceReference; /** - * Verifies a HttpRule message. + * 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 HttpRule message from a plain object. Also converts values to their respective internal types. + * Creates a ResourceReference message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns HttpRule + * @returns ResourceReference */ - public static fromObject(object: { [k: string]: any }): google.api.HttpRule; + public static fromObject(object: { [k: string]: any }): google.api.ResourceReference; /** - * Creates a plain object from a HttpRule message. Also converts values to other types if specified. - * @param message HttpRule + * 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.HttpRule, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.api.ResourceReference, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this HttpRule to JSON. + * Converts this ResourceReference to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a CustomHttpPattern. */ - interface ICustomHttpPattern { + /** Properties of a Http. */ + interface IHttp { - /** CustomHttpPattern kind */ - kind?: (string|null); + /** Http rules */ + rules?: (google.api.IHttpRule[]|null); - /** CustomHttpPattern path */ - path?: (string|null); + /** Http fullyDecodeReservedExpansion */ + fullyDecodeReservedExpansion?: (boolean|null); } - /** Represents a CustomHttpPattern. */ - class CustomHttpPattern implements ICustomHttpPattern { + /** Represents a Http. */ + class Http implements IHttp { /** - * Constructs a new CustomHttpPattern. + * Constructs a new Http. * @param [properties] Properties to set */ - constructor(properties?: google.api.ICustomHttpPattern); + constructor(properties?: google.api.IHttp); - /** CustomHttpPattern kind. */ - public kind: string; + /** Http rules. */ + public rules: google.api.IHttpRule[]; - /** CustomHttpPattern path. */ - public path: string; + /** Http fullyDecodeReservedExpansion. */ + public fullyDecodeReservedExpansion: boolean; /** - * Creates a new CustomHttpPattern instance using the specified properties. + * Creates a new Http instance using the specified properties. * @param [properties] Properties to set - * @returns CustomHttpPattern instance + * @returns Http instance */ - public static create(properties?: google.api.ICustomHttpPattern): google.api.CustomHttpPattern; + public static create(properties?: google.api.IHttp): google.api.Http; /** - * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. - * @param message CustomHttpPattern message or plain object to encode + * 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.ICustomHttpPattern, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.api.IHttp, 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 + * 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.ICustomHttpPattern, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.api.IHttp, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a CustomHttpPattern message from the specified reader or buffer. + * 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 CustomHttpPattern + * @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.CustomHttpPattern; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.Http; /** - * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. + * Decodes a Http message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns CustomHttpPattern + * @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.CustomHttpPattern; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.Http; /** - * Verifies a CustomHttpPattern message. + * 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 CustomHttpPattern message from a plain object. Also converts values to their respective internal types. + * Creates a Http message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns CustomHttpPattern + * @returns Http */ - public static fromObject(object: { [k: string]: any }): google.api.CustomHttpPattern; + public static fromObject(object: { [k: string]: any }): google.api.Http; /** - * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. - * @param message CustomHttpPattern + * 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.CustomHttpPattern, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.api.Http, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this CustomHttpPattern to JSON. + * Converts this Http to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a ResourceDescriptor. */ - interface IResourceDescriptor { + /** Properties of a HttpRule. */ + interface IHttpRule { - /** ResourceDescriptor type */ - type?: (string|null); + /** HttpRule selector */ + selector?: (string|null); - /** ResourceDescriptor pattern */ - pattern?: (string[]|null); + /** HttpRule get */ + get?: (string|null); - /** ResourceDescriptor nameField */ - nameField?: (string|null); + /** HttpRule put */ + put?: (string|null); - /** ResourceDescriptor history */ - history?: (google.api.ResourceDescriptor.History|keyof typeof google.api.ResourceDescriptor.History|null); + /** HttpRule post */ + post?: (string|null); - /** ResourceDescriptor plural */ - plural?: (string|null); + /** HttpRule delete */ + "delete"?: (string|null); - /** ResourceDescriptor singular */ - singular?: (string|null); + /** HttpRule patch */ + patch?: (string|null); - /** ResourceDescriptor style */ - style?: (google.api.ResourceDescriptor.Style[]|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 ResourceDescriptor. */ - class ResourceDescriptor implements IResourceDescriptor { + /** Represents a HttpRule. */ + class HttpRule implements IHttpRule { /** - * Constructs a new ResourceDescriptor. + * Constructs a new HttpRule. * @param [properties] Properties to set */ - constructor(properties?: google.api.IResourceDescriptor); + constructor(properties?: google.api.IHttpRule); - /** ResourceDescriptor type. */ - public type: string; + /** HttpRule selector. */ + public selector: string; - /** ResourceDescriptor pattern. */ - public pattern: string[]; + /** HttpRule get. */ + public get?: (string|null); - /** ResourceDescriptor nameField. */ - public nameField: string; + /** HttpRule put. */ + public put?: (string|null); - /** ResourceDescriptor history. */ - public history: (google.api.ResourceDescriptor.History|keyof typeof google.api.ResourceDescriptor.History); + /** HttpRule post. */ + public post?: (string|null); - /** ResourceDescriptor plural. */ - public plural: string; + /** HttpRule delete. */ + public delete?: (string|null); - /** ResourceDescriptor singular. */ - public singular: string; + /** HttpRule patch. */ + public patch?: (string|null); - /** ResourceDescriptor style. */ - public style: google.api.ResourceDescriptor.Style[]; + /** 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 ResourceDescriptor instance using the specified properties. + * Creates a new HttpRule instance using the specified properties. * @param [properties] Properties to set - * @returns ResourceDescriptor instance + * @returns HttpRule instance */ - public static create(properties?: google.api.IResourceDescriptor): google.api.ResourceDescriptor; + public static create(properties?: google.api.IHttpRule): google.api.HttpRule; /** - * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. - * @param message ResourceDescriptor message or plain object to encode + * 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.IResourceDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.api.IHttpRule, 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 + * 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.IResourceDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.api.IHttpRule, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ResourceDescriptor message from the specified reader or buffer. + * 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 ResourceDescriptor + * @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.ResourceDescriptor; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.HttpRule; /** - * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. + * Decodes a HttpRule message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ResourceDescriptor + * @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.ResourceDescriptor; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.HttpRule; /** - * Verifies a ResourceDescriptor message. + * 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 ResourceDescriptor message from a plain object. Also converts values to their respective internal types. + * Creates a HttpRule message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ResourceDescriptor + * @returns HttpRule */ - public static fromObject(object: { [k: string]: any }): google.api.ResourceDescriptor; + public static fromObject(object: { [k: string]: any }): google.api.HttpRule; /** - * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. - * @param message ResourceDescriptor + * 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.ResourceDescriptor, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.api.HttpRule, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ResourceDescriptor to JSON. + * Converts this HttpRule to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - 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 { + /** Properties of a CustomHttpPattern. */ + interface ICustomHttpPattern { - /** ResourceReference type */ - type?: (string|null); + /** CustomHttpPattern kind */ + kind?: (string|null); - /** ResourceReference childType */ - childType?: (string|null); + /** CustomHttpPattern path */ + path?: (string|null); } - /** Represents a ResourceReference. */ - class ResourceReference implements IResourceReference { + /** Represents a CustomHttpPattern. */ + class CustomHttpPattern implements ICustomHttpPattern { /** - * Constructs a new ResourceReference. + * Constructs a new CustomHttpPattern. * @param [properties] Properties to set */ - constructor(properties?: google.api.IResourceReference); + constructor(properties?: google.api.ICustomHttpPattern); - /** ResourceReference type. */ - public type: string; + /** CustomHttpPattern kind. */ + public kind: string; - /** ResourceReference childType. */ - public childType: string; + /** CustomHttpPattern path. */ + public path: string; /** - * Creates a new ResourceReference instance using the specified properties. + * Creates a new CustomHttpPattern instance using the specified properties. * @param [properties] Properties to set - * @returns ResourceReference instance + * @returns CustomHttpPattern instance */ - public static create(properties?: google.api.IResourceReference): google.api.ResourceReference; + public static create(properties?: google.api.ICustomHttpPattern): google.api.CustomHttpPattern; /** - * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. - * @param message ResourceReference message or plain object to encode + * 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.IResourceReference, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.api.ICustomHttpPattern, 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 + * 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.IResourceReference, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.api.ICustomHttpPattern, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ResourceReference message from the specified reader or buffer. + * 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 ResourceReference + * @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.ResourceReference; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.CustomHttpPattern; /** - * Decodes a ResourceReference message from the specified reader or buffer, length delimited. + * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ResourceReference + * @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.ResourceReference; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.CustomHttpPattern; /** - * Verifies a ResourceReference message. + * 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 ResourceReference message from a plain object. Also converts values to their respective internal types. + * Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ResourceReference + * @returns CustomHttpPattern */ - public static fromObject(object: { [k: string]: any }): google.api.ResourceReference; + public static fromObject(object: { [k: string]: any }): google.api.CustomHttpPattern; /** - * Creates a plain object from a ResourceReference message. Also converts values to other types if specified. - * @param message ResourceReference + * 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.ResourceReference, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.api.CustomHttpPattern, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ResourceReference to JSON. + * Converts this CustomHttpPattern to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; diff --git a/packages/google-cloud-securitycenter/protos/protos.js b/packages/google-cloud-securitycenter/protos/protos.js index c4de7ef4235..89c16f0ef81 100644 --- a/packages/google-cloud-securitycenter/protos/protos.js +++ b/packages/google-cloud-securitycenter/protos/protos.js @@ -79,6 +79,7 @@ * @property {google.protobuf.ITimestamp|null} [createTime] Asset createTime * @property {google.protobuf.ITimestamp|null} [updateTime] Asset updateTime * @property {google.cloud.securitycenter.v1.Asset.IIamPolicy|null} [iamPolicy] Asset iamPolicy + * @property {string|null} [canonicalName] Asset canonicalName */ /** @@ -153,6 +154,14 @@ */ Asset.prototype.iamPolicy = null; + /** + * Asset canonicalName. + * @member {string} canonicalName + * @memberof google.cloud.securitycenter.v1.Asset + * @instance + */ + Asset.prototype.canonicalName = ""; + /** * Creates a new Asset instance using the specified properties. * @function create @@ -194,6 +203,8 @@ $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); if (message.iamPolicy != null && Object.hasOwnProperty.call(message, "iamPolicy")) $root.google.cloud.securitycenter.v1.Asset.IamPolicy.encode(message.iamPolicy, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.canonicalName != null && Object.hasOwnProperty.call(message, "canonicalName")) + writer.uint32(/* id 13, wireType 2 =*/106).string(message.canonicalName); return writer; }; @@ -268,6 +279,9 @@ case 11: message.iamPolicy = $root.google.cloud.securitycenter.v1.Asset.IamPolicy.decode(reader, reader.uint32()); break; + case 13: + message.canonicalName = reader.string(); + break; default: reader.skipType(tag & 7); break; @@ -341,6 +355,9 @@ if (error) return "iamPolicy." + error; } + if (message.canonicalName != null && message.hasOwnProperty("canonicalName")) + if (!$util.isString(message.canonicalName)) + return "canonicalName: string expected"; return null; }; @@ -393,6 +410,8 @@ throw TypeError(".google.cloud.securitycenter.v1.Asset.iamPolicy: object expected"); message.iamPolicy = $root.google.cloud.securitycenter.v1.Asset.IamPolicy.fromObject(object.iamPolicy); } + if (object.canonicalName != null) + message.canonicalName = String(object.canonicalName); return message; }; @@ -418,6 +437,7 @@ object.createTime = null; object.updateTime = null; object.iamPolicy = null; + object.canonicalName = ""; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -437,6 +457,8 @@ object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); if (message.iamPolicy != null && message.hasOwnProperty("iamPolicy")) object.iamPolicy = $root.google.cloud.securitycenter.v1.Asset.IamPolicy.toObject(message.iamPolicy, options); + if (message.canonicalName != null && message.hasOwnProperty("canonicalName")) + object.canonicalName = message.canonicalName; return object; }; @@ -465,6 +487,7 @@ * @property {string|null} [resourceDisplayName] SecurityCenterProperties resourceDisplayName * @property {string|null} [resourceParentDisplayName] SecurityCenterProperties resourceParentDisplayName * @property {string|null} [resourceProjectDisplayName] SecurityCenterProperties resourceProjectDisplayName + * @property {Array.|null} [folders] SecurityCenterProperties folders */ /** @@ -477,6 +500,7 @@ */ function SecurityCenterProperties(properties) { this.resourceOwners = []; + this.folders = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -547,6 +571,14 @@ */ SecurityCenterProperties.prototype.resourceProjectDisplayName = ""; + /** + * SecurityCenterProperties folders. + * @member {Array.} folders + * @memberof google.cloud.securitycenter.v1.Asset.SecurityCenterProperties + * @instance + */ + SecurityCenterProperties.prototype.folders = $util.emptyArray; + /** * Creates a new SecurityCenterProperties instance using the specified properties. * @function create @@ -588,6 +620,9 @@ writer.uint32(/* id 7, wireType 2 =*/58).string(message.resourceParentDisplayName); if (message.resourceProjectDisplayName != null && Object.hasOwnProperty.call(message, "resourceProjectDisplayName")) writer.uint32(/* id 8, wireType 2 =*/66).string(message.resourceProjectDisplayName); + if (message.folders != null && message.folders.length) + for (var i = 0; i < message.folders.length; ++i) + $root.google.cloud.securitycenter.v1.Folder.encode(message.folders[i], writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); return writer; }; @@ -648,6 +683,11 @@ case 8: message.resourceProjectDisplayName = reader.string(); break; + case 10: + if (!(message.folders && message.folders.length)) + message.folders = []; + message.folders.push($root.google.cloud.securitycenter.v1.Folder.decode(reader, reader.uint32())); + break; default: reader.skipType(tag & 7); break; @@ -711,6 +751,15 @@ if (message.resourceProjectDisplayName != null && message.hasOwnProperty("resourceProjectDisplayName")) if (!$util.isString(message.resourceProjectDisplayName)) return "resourceProjectDisplayName: string expected"; + if (message.folders != null && message.hasOwnProperty("folders")) { + if (!Array.isArray(message.folders)) + return "folders: array expected"; + for (var i = 0; i < message.folders.length; ++i) { + var error = $root.google.cloud.securitycenter.v1.Folder.verify(message.folders[i]); + if (error) + return "folders." + error; + } + } return null; }; @@ -747,6 +796,16 @@ message.resourceParentDisplayName = String(object.resourceParentDisplayName); if (object.resourceProjectDisplayName != null) message.resourceProjectDisplayName = String(object.resourceProjectDisplayName); + if (object.folders) { + if (!Array.isArray(object.folders)) + throw TypeError(".google.cloud.securitycenter.v1.Asset.SecurityCenterProperties.folders: array expected"); + message.folders = []; + for (var i = 0; i < object.folders.length; ++i) { + if (typeof object.folders[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Asset.SecurityCenterProperties.folders: object expected"); + message.folders[i] = $root.google.cloud.securitycenter.v1.Folder.fromObject(object.folders[i]); + } + } return message; }; @@ -763,8 +822,10 @@ if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) + if (options.arrays || options.defaults) { object.resourceOwners = []; + object.folders = []; + } if (options.defaults) { object.resourceName = ""; object.resourceType = ""; @@ -793,6 +854,11 @@ object.resourceParentDisplayName = message.resourceParentDisplayName; if (message.resourceProjectDisplayName != null && message.hasOwnProperty("resourceProjectDisplayName")) object.resourceProjectDisplayName = message.resourceProjectDisplayName; + if (message.folders && message.folders.length) { + object.folders = []; + for (var j = 0; j < message.folders.length; ++j) + object.folders[j] = $root.google.cloud.securitycenter.v1.Folder.toObject(message.folders[j], options); + } return object; }; @@ -1000,6 +1066,216 @@ return Asset; })(); + v1.Folder = (function() { + + /** + * Properties of a Folder. + * @memberof google.cloud.securitycenter.v1 + * @interface IFolder + * @property {string|null} [resourceFolder] Folder resourceFolder + * @property {string|null} [resourceFolderDisplayName] Folder resourceFolderDisplayName + */ + + /** + * Constructs a new Folder. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a Folder. + * @implements IFolder + * @constructor + * @param {google.cloud.securitycenter.v1.IFolder=} [properties] Properties to set + */ + function Folder(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]]; + } + + /** + * Folder resourceFolder. + * @member {string} resourceFolder + * @memberof google.cloud.securitycenter.v1.Folder + * @instance + */ + Folder.prototype.resourceFolder = ""; + + /** + * Folder resourceFolderDisplayName. + * @member {string} resourceFolderDisplayName + * @memberof google.cloud.securitycenter.v1.Folder + * @instance + */ + Folder.prototype.resourceFolderDisplayName = ""; + + /** + * Creates a new Folder instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.Folder + * @static + * @param {google.cloud.securitycenter.v1.IFolder=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.Folder} Folder instance + */ + Folder.create = function create(properties) { + return new Folder(properties); + }; + + /** + * Encodes the specified Folder message. Does not implicitly {@link google.cloud.securitycenter.v1.Folder.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.Folder + * @static + * @param {google.cloud.securitycenter.v1.IFolder} message Folder message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Folder.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.resourceFolder != null && Object.hasOwnProperty.call(message, "resourceFolder")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.resourceFolder); + if (message.resourceFolderDisplayName != null && Object.hasOwnProperty.call(message, "resourceFolderDisplayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.resourceFolderDisplayName); + return writer; + }; + + /** + * Encodes the specified Folder message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Folder.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.Folder + * @static + * @param {google.cloud.securitycenter.v1.IFolder} message Folder message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Folder.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Folder message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.Folder + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.Folder} Folder + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Folder.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.cloud.securitycenter.v1.Folder(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.resourceFolder = reader.string(); + break; + case 2: + message.resourceFolderDisplayName = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Folder message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.Folder + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.Folder} Folder + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Folder.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Folder message. + * @function verify + * @memberof google.cloud.securitycenter.v1.Folder + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Folder.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.resourceFolder != null && message.hasOwnProperty("resourceFolder")) + if (!$util.isString(message.resourceFolder)) + return "resourceFolder: string expected"; + if (message.resourceFolderDisplayName != null && message.hasOwnProperty("resourceFolderDisplayName")) + if (!$util.isString(message.resourceFolderDisplayName)) + return "resourceFolderDisplayName: string expected"; + return null; + }; + + /** + * Creates a Folder message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.Folder + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.Folder} Folder + */ + Folder.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.Folder) + return object; + var message = new $root.google.cloud.securitycenter.v1.Folder(); + if (object.resourceFolder != null) + message.resourceFolder = String(object.resourceFolder); + if (object.resourceFolderDisplayName != null) + message.resourceFolderDisplayName = String(object.resourceFolderDisplayName); + return message; + }; + + /** + * Creates a plain object from a Folder message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.Folder + * @static + * @param {google.cloud.securitycenter.v1.Folder} message Folder + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Folder.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.resourceFolder = ""; + object.resourceFolderDisplayName = ""; + } + if (message.resourceFolder != null && message.hasOwnProperty("resourceFolder")) + object.resourceFolder = message.resourceFolder; + if (message.resourceFolderDisplayName != null && message.hasOwnProperty("resourceFolderDisplayName")) + object.resourceFolderDisplayName = message.resourceFolderDisplayName; + return object; + }; + + /** + * Converts this Folder to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.Folder + * @instance + * @returns {Object.} JSON object + */ + Folder.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Folder; + })(); + v1.SecurityMarks = (function() { /** @@ -1008,6 +1284,7 @@ * @interface ISecurityMarks * @property {string|null} [name] SecurityMarks name * @property {Object.|null} [marks] SecurityMarks marks + * @property {string|null} [canonicalName] SecurityMarks canonicalName */ /** @@ -1042,6 +1319,14 @@ */ SecurityMarks.prototype.marks = $util.emptyObject; + /** + * SecurityMarks canonicalName. + * @member {string} canonicalName + * @memberof google.cloud.securitycenter.v1.SecurityMarks + * @instance + */ + SecurityMarks.prototype.canonicalName = ""; + /** * Creates a new SecurityMarks instance using the specified properties. * @function create @@ -1071,6 +1356,8 @@ if (message.marks != null && Object.hasOwnProperty.call(message, "marks")) for (var keys = Object.keys(message.marks), i = 0; i < keys.length; ++i) writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.marks[keys[i]]).ldelim(); + if (message.canonicalName != null && Object.hasOwnProperty.call(message, "canonicalName")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.canonicalName); return writer; }; @@ -1130,6 +1417,9 @@ } message.marks[key] = value; break; + case 3: + message.canonicalName = reader.string(); + break; default: reader.skipType(tag & 7); break; @@ -1176,6 +1466,9 @@ if (!$util.isString(message.marks[key[i]])) return "marks: string{k:string} expected"; } + if (message.canonicalName != null && message.hasOwnProperty("canonicalName")) + if (!$util.isString(message.canonicalName)) + return "canonicalName: string expected"; return null; }; @@ -1200,6 +1493,8 @@ for (var keys = Object.keys(object.marks), i = 0; i < keys.length; ++i) message.marks[keys[i]] = String(object.marks[keys[i]]); } + if (object.canonicalName != null) + message.canonicalName = String(object.canonicalName); return message; }; @@ -1218,8 +1513,10 @@ var object = {}; if (options.objects || options.defaults) object.marks = {}; - if (options.defaults) + if (options.defaults) { object.name = ""; + object.canonicalName = ""; + } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; var keys2; @@ -1228,6 +1525,8 @@ for (var j = 0; j < keys2.length; ++j) object.marks[keys2[j]] = message.marks[keys2[j]]; } + if (message.canonicalName != null && message.hasOwnProperty("canonicalName")) + object.canonicalName = message.canonicalName; return object; }; @@ -1262,6 +1561,7 @@ * @property {google.protobuf.ITimestamp|null} [eventTime] Finding eventTime * @property {google.protobuf.ITimestamp|null} [createTime] Finding createTime * @property {google.cloud.securitycenter.v1.Finding.Severity|null} [severity] Finding severity + * @property {string|null} [canonicalName] Finding canonicalName */ /** @@ -1368,6 +1668,14 @@ */ Finding.prototype.severity = 0; + /** + * Finding canonicalName. + * @member {string} canonicalName + * @memberof google.cloud.securitycenter.v1.Finding + * @instance + */ + Finding.prototype.canonicalName = ""; + /** * Creates a new Finding instance using the specified properties. * @function create @@ -1417,6 +1725,8 @@ $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); if (message.severity != null && Object.hasOwnProperty.call(message, "severity")) writer.uint32(/* id 12, wireType 0 =*/96).int32(message.severity); + if (message.canonicalName != null && Object.hasOwnProperty.call(message, "canonicalName")) + writer.uint32(/* id 14, wireType 2 =*/114).string(message.canonicalName); return writer; }; @@ -1503,6 +1813,9 @@ case 12: message.severity = reader.int32(); break; + case 14: + message.canonicalName = reader.string(); + break; default: reader.skipType(tag & 7); break; @@ -1598,6 +1911,9 @@ case 4: break; } + if (message.canonicalName != null && message.hasOwnProperty("canonicalName")) + if (!$util.isString(message.canonicalName)) + return "canonicalName: string expected"; return null; }; @@ -1684,6 +2000,8 @@ message.severity = 4; break; } + if (object.canonicalName != null) + message.canonicalName = String(object.canonicalName); return message; }; @@ -1713,6 +2031,7 @@ object.eventTime = null; object.createTime = null; object.severity = options.enums === String ? "SEVERITY_UNSPECIFIED" : 0; + object.canonicalName = ""; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -1740,6 +2059,8 @@ object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); if (message.severity != null && message.hasOwnProperty("severity")) object.severity = options.enums === String ? $root.google.cloud.securitycenter.v1.Finding.Severity[message.severity] : message.severity; + if (message.canonicalName != null && message.hasOwnProperty("canonicalName")) + object.canonicalName = message.canonicalName; return object; }; @@ -2554,6 +2875,7 @@ * @property {string|null} [projectDisplayName] Resource projectDisplayName * @property {string|null} [parent] Resource parent * @property {string|null} [parentDisplayName] Resource parentDisplayName + * @property {Array.|null} [folders] Resource folders */ /** @@ -2565,6 +2887,7 @@ * @param {google.cloud.securitycenter.v1.IResource=} [properties] Properties to set */ function Resource(properties) { + this.folders = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -2611,6 +2934,14 @@ */ Resource.prototype.parentDisplayName = ""; + /** + * Resource folders. + * @member {Array.} folders + * @memberof google.cloud.securitycenter.v1.Resource + * @instance + */ + Resource.prototype.folders = $util.emptyArray; + /** * Creates a new Resource instance using the specified properties. * @function create @@ -2645,6 +2976,9 @@ writer.uint32(/* id 4, wireType 2 =*/34).string(message.parent); if (message.parentDisplayName != null && Object.hasOwnProperty.call(message, "parentDisplayName")) writer.uint32(/* id 5, wireType 2 =*/42).string(message.parentDisplayName); + if (message.folders != null && message.folders.length) + for (var i = 0; i < message.folders.length; ++i) + $root.google.cloud.securitycenter.v1.Folder.encode(message.folders[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); return writer; }; @@ -2694,6 +3028,11 @@ case 5: message.parentDisplayName = reader.string(); break; + case 7: + if (!(message.folders && message.folders.length)) + message.folders = []; + message.folders.push($root.google.cloud.securitycenter.v1.Folder.decode(reader, reader.uint32())); + break; default: reader.skipType(tag & 7); break; @@ -2744,6 +3083,15 @@ if (message.parentDisplayName != null && message.hasOwnProperty("parentDisplayName")) if (!$util.isString(message.parentDisplayName)) return "parentDisplayName: string expected"; + if (message.folders != null && message.hasOwnProperty("folders")) { + if (!Array.isArray(message.folders)) + return "folders: array expected"; + for (var i = 0; i < message.folders.length; ++i) { + var error = $root.google.cloud.securitycenter.v1.Folder.verify(message.folders[i]); + if (error) + return "folders." + error; + } + } return null; }; @@ -2769,6 +3117,16 @@ message.parent = String(object.parent); if (object.parentDisplayName != null) message.parentDisplayName = String(object.parentDisplayName); + if (object.folders) { + if (!Array.isArray(object.folders)) + throw TypeError(".google.cloud.securitycenter.v1.Resource.folders: array expected"); + message.folders = []; + for (var i = 0; i < object.folders.length; ++i) { + if (typeof object.folders[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Resource.folders: object expected"); + message.folders[i] = $root.google.cloud.securitycenter.v1.Folder.fromObject(object.folders[i]); + } + } return message; }; @@ -2785,6 +3143,8 @@ if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) + object.folders = []; if (options.defaults) { object.name = ""; object.project = ""; @@ -2802,6 +3162,11 @@ object.parent = message.parent; if (message.parentDisplayName != null && message.hasOwnProperty("parentDisplayName")) object.parentDisplayName = message.parentDisplayName; + if (message.folders && message.folders.length) { + object.folders = []; + for (var j = 0; j < message.folders.length; ++j) + object.folders[j] = $root.google.cloud.securitycenter.v1.Folder.toObject(message.folders[j], options); + } return object; }; @@ -3061,6 +3426,7 @@ * @interface IAssetDiscoveryConfig * @property {Array.|null} [projectIds] AssetDiscoveryConfig projectIds * @property {google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode|null} [inclusionMode] AssetDiscoveryConfig inclusionMode + * @property {Array.|null} [folderIds] AssetDiscoveryConfig folderIds */ /** @@ -3073,6 +3439,7 @@ */ function AssetDiscoveryConfig(properties) { this.projectIds = []; + this.folderIds = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -3095,6 +3462,14 @@ */ AssetDiscoveryConfig.prototype.inclusionMode = 0; + /** + * AssetDiscoveryConfig folderIds. + * @member {Array.} folderIds + * @memberof google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig + * @instance + */ + AssetDiscoveryConfig.prototype.folderIds = $util.emptyArray; + /** * Creates a new AssetDiscoveryConfig instance using the specified properties. * @function create @@ -3124,6 +3499,9 @@ writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectIds[i]); if (message.inclusionMode != null && Object.hasOwnProperty.call(message, "inclusionMode")) writer.uint32(/* id 2, wireType 0 =*/16).int32(message.inclusionMode); + if (message.folderIds != null && message.folderIds.length) + for (var i = 0; i < message.folderIds.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.folderIds[i]); return writer; }; @@ -3166,6 +3544,11 @@ case 2: message.inclusionMode = reader.int32(); break; + case 3: + if (!(message.folderIds && message.folderIds.length)) + message.folderIds = []; + message.folderIds.push(reader.string()); + break; default: reader.skipType(tag & 7); break; @@ -3217,6 +3600,13 @@ case 2: break; } + if (message.folderIds != null && message.hasOwnProperty("folderIds")) { + if (!Array.isArray(message.folderIds)) + return "folderIds: array expected"; + for (var i = 0; i < message.folderIds.length; ++i) + if (!$util.isString(message.folderIds[i])) + return "folderIds: string[] expected"; + } return null; }; @@ -3253,6 +3643,13 @@ message.inclusionMode = 2; break; } + if (object.folderIds) { + if (!Array.isArray(object.folderIds)) + throw TypeError(".google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.folderIds: array expected"); + message.folderIds = []; + for (var i = 0; i < object.folderIds.length; ++i) + message.folderIds[i] = String(object.folderIds[i]); + } return message; }; @@ -3269,8 +3666,10 @@ if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) + if (options.arrays || options.defaults) { object.projectIds = []; + object.folderIds = []; + } if (options.defaults) object.inclusionMode = options.enums === String ? "INCLUSION_MODE_UNSPECIFIED" : 0; if (message.projectIds && message.projectIds.length) { @@ -3280,6 +3679,11 @@ } if (message.inclusionMode != null && message.hasOwnProperty("inclusionMode")) object.inclusionMode = options.enums === String ? $root.google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode[message.inclusionMode] : message.inclusionMode; + if (message.folderIds && message.folderIds.length) { + object.folderIds = []; + for (var j = 0; j < message.folderIds.length; ++j) + object.folderIds[j] = message.folderIds[j]; + } return object; }; @@ -10024,6 +10428,7 @@ * @property {string|null} [projectDisplayName] Resource projectDisplayName * @property {string|null} [parentName] Resource parentName * @property {string|null} [parentDisplayName] Resource parentDisplayName + * @property {Array.|null} [folders] Resource folders */ /** @@ -10035,6 +10440,7 @@ * @param {google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.IResource=} [properties] Properties to set */ function Resource(properties) { + this.folders = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -10081,6 +10487,14 @@ */ Resource.prototype.parentDisplayName = ""; + /** + * Resource folders. + * @member {Array.} folders + * @memberof google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource + * @instance + */ + Resource.prototype.folders = $util.emptyArray; + /** * Creates a new Resource instance using the specified properties. * @function create @@ -10115,6 +10529,9 @@ writer.uint32(/* id 4, wireType 2 =*/34).string(message.parentName); if (message.parentDisplayName != null && Object.hasOwnProperty.call(message, "parentDisplayName")) writer.uint32(/* id 5, wireType 2 =*/42).string(message.parentDisplayName); + if (message.folders != null && message.folders.length) + for (var i = 0; i < message.folders.length; ++i) + $root.google.cloud.securitycenter.v1.Folder.encode(message.folders[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); return writer; }; @@ -10164,6 +10581,11 @@ case 5: message.parentDisplayName = reader.string(); break; + case 7: + if (!(message.folders && message.folders.length)) + message.folders = []; + message.folders.push($root.google.cloud.securitycenter.v1.Folder.decode(reader, reader.uint32())); + break; default: reader.skipType(tag & 7); break; @@ -10214,6 +10636,15 @@ if (message.parentDisplayName != null && message.hasOwnProperty("parentDisplayName")) if (!$util.isString(message.parentDisplayName)) return "parentDisplayName: string expected"; + if (message.folders != null && message.hasOwnProperty("folders")) { + if (!Array.isArray(message.folders)) + return "folders: array expected"; + for (var i = 0; i < message.folders.length; ++i) { + var error = $root.google.cloud.securitycenter.v1.Folder.verify(message.folders[i]); + if (error) + return "folders." + error; + } + } return null; }; @@ -10239,6 +10670,16 @@ message.parentName = String(object.parentName); if (object.parentDisplayName != null) message.parentDisplayName = String(object.parentDisplayName); + if (object.folders) { + if (!Array.isArray(object.folders)) + throw TypeError(".google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource.folders: array expected"); + message.folders = []; + for (var i = 0; i < object.folders.length; ++i) { + if (typeof object.folders[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource.folders: object expected"); + message.folders[i] = $root.google.cloud.securitycenter.v1.Folder.fromObject(object.folders[i]); + } + } return message; }; @@ -10255,6 +10696,8 @@ if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) + object.folders = []; if (options.defaults) { object.name = ""; object.projectName = ""; @@ -10272,6 +10715,11 @@ object.parentName = message.parentName; if (message.parentDisplayName != null && message.hasOwnProperty("parentDisplayName")) object.parentDisplayName = message.parentDisplayName; + if (message.folders && message.folders.length) { + object.folders = []; + for (var j = 0; j < message.folders.length; ++j) + object.folders[j] = $root.google.cloud.securitycenter.v1.Folder.toObject(message.folders[j], options); + } return object; }; @@ -11893,6 +12341,7 @@ * @property {string|null} [name] Source name * @property {string|null} [displayName] Source displayName * @property {string|null} [description] Source description + * @property {string|null} [canonicalName] Source canonicalName */ /** @@ -11934,6 +12383,14 @@ */ Source.prototype.description = ""; + /** + * Source canonicalName. + * @member {string} canonicalName + * @memberof google.cloud.securitycenter.v1.Source + * @instance + */ + Source.prototype.canonicalName = ""; + /** * Creates a new Source instance using the specified properties. * @function create @@ -11964,6 +12421,8 @@ writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); if (message.description != null && Object.hasOwnProperty.call(message, "description")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + if (message.canonicalName != null && Object.hasOwnProperty.call(message, "canonicalName")) + writer.uint32(/* id 14, wireType 2 =*/114).string(message.canonicalName); return writer; }; @@ -12007,6 +12466,9 @@ case 3: message.description = reader.string(); break; + case 14: + message.canonicalName = reader.string(); + break; default: reader.skipType(tag & 7); break; @@ -12051,6 +12513,9 @@ if (message.description != null && message.hasOwnProperty("description")) if (!$util.isString(message.description)) return "description: string expected"; + if (message.canonicalName != null && message.hasOwnProperty("canonicalName")) + if (!$util.isString(message.canonicalName)) + return "canonicalName: string expected"; return null; }; @@ -12072,6 +12537,8 @@ message.displayName = String(object.displayName); if (object.description != null) message.description = String(object.description); + if (object.canonicalName != null) + message.canonicalName = String(object.canonicalName); return message; }; @@ -12092,6 +12559,7 @@ object.name = ""; object.displayName = ""; object.description = ""; + object.canonicalName = ""; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -12099,6 +12567,8 @@ object.displayName = message.displayName; if (message.description != null && message.hasOwnProperty("description")) object.description = message.description; + if (message.canonicalName != null && message.hasOwnProperty("canonicalName")) + object.canonicalName = message.canonicalName; return object; }; @@ -33285,26 +33755,32 @@ */ var api = {}; - api.Http = (function() { + api.ResourceDescriptor = (function() { /** - * Properties of a Http. + * Properties of a ResourceDescriptor. * @memberof google.api - * @interface IHttp - * @property {Array.|null} [rules] Http rules - * @property {boolean|null} [fullyDecodeReservedExpansion] Http fullyDecodeReservedExpansion + * @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 Http. + * Constructs a new ResourceDescriptor. * @memberof google.api - * @classdesc Represents a Http. - * @implements IHttp + * @classdesc Represents a ResourceDescriptor. + * @implements IResourceDescriptor * @constructor - * @param {google.api.IHttp=} [properties] Properties to set + * @param {google.api.IResourceDescriptor=} [properties] Properties to set */ - function Http(properties) { - this.rules = []; + 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) @@ -33312,91 +33788,167 @@ } /** - * Http rules. - * @member {Array.} rules - * @memberof google.api.Http + * ResourceDescriptor type. + * @member {string} type + * @memberof google.api.ResourceDescriptor * @instance */ - Http.prototype.rules = $util.emptyArray; + ResourceDescriptor.prototype.type = ""; /** - * Http fullyDecodeReservedExpansion. - * @member {boolean} fullyDecodeReservedExpansion - * @memberof google.api.Http + * ResourceDescriptor pattern. + * @member {Array.} pattern + * @memberof google.api.ResourceDescriptor * @instance */ - Http.prototype.fullyDecodeReservedExpansion = false; + ResourceDescriptor.prototype.pattern = $util.emptyArray; /** - * Creates a new Http instance using the specified properties. + * 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.Http + * @memberof google.api.ResourceDescriptor * @static - * @param {google.api.IHttp=} [properties] Properties to set - * @returns {google.api.Http} Http instance + * @param {google.api.IResourceDescriptor=} [properties] Properties to set + * @returns {google.api.ResourceDescriptor} ResourceDescriptor instance */ - Http.create = function create(properties) { - return new Http(properties); + ResourceDescriptor.create = function create(properties) { + return new ResourceDescriptor(properties); }; /** - * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. + * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. * @function encode - * @memberof google.api.Http + * @memberof google.api.ResourceDescriptor * @static - * @param {google.api.IHttp} message Http message or plain object to encode + * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Http.encode = function encode(message, writer) { + ResourceDescriptor.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); + 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 Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. + * Encodes the specified ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. * @function encodeDelimited - * @memberof google.api.Http + * @memberof google.api.ResourceDescriptor * @static - * @param {google.api.IHttp} message Http message or plain object to encode + * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Http.encodeDelimited = function encodeDelimited(message, writer) { + ResourceDescriptor.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a Http message from the specified reader or buffer. + * Decodes a ResourceDescriptor message from the specified reader or buffer. * @function decode - * @memberof google.api.Http + * @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.Http} Http + * @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 */ - Http.decode = function decode(reader, length) { + 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.Http(); + 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: - if (!(message.rules && message.rules.length)) - message.rules = []; - message.rules.push($root.google.api.HttpRule.decode(reader, reader.uint32())); + message.type = reader.string(); break; case 2: - message.fullyDecodeReservedExpansion = reader.bool(); + 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); @@ -33407,353 +33959,335 @@ }; /** - * Decodes a Http message from the specified reader or buffer, length delimited. + * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.api.Http + * @memberof google.api.ResourceDescriptor * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.Http} Http + * @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 */ - Http.decodeDelimited = function decodeDelimited(reader) { + ResourceDescriptor.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a Http message. + * Verifies a ResourceDescriptor message. * @function verify - * @memberof google.api.Http + * @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 */ - Http.verify = function verify(message) { + ResourceDescriptor.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.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; + } } - 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. + * Creates a ResourceDescriptor message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.api.Http + * @memberof google.api.ResourceDescriptor * @static * @param {Object.} object Plain object - * @returns {google.api.Http} Http + * @returns {google.api.ResourceDescriptor} ResourceDescriptor */ - Http.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.Http) + ResourceDescriptor.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.ResourceDescriptor) 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]); - } + 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) { + 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: + case "STYLE_UNSPECIFIED": + case 0: + message.style[i] = 0; + break; + case "DECLARATIVE_FRIENDLY": + case 1: + message.style[i] = 1; + break; + } } - 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. + * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. * @function toObject - * @memberof google.api.Http + * @memberof google.api.ResourceDescriptor * @static - * @param {google.api.Http} message Http + * @param {google.api.ResourceDescriptor} message ResourceDescriptor * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Http.toObject = function toObject(message, options) { + ResourceDescriptor.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 (options.arrays || options.defaults) { + object.pattern = []; + object.style = []; } - 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); - }; - - 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; + 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] : 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]] : message.style[j]; + } + return object; + }; /** - * HttpRule put. - * @member {string|null|undefined} put - * @memberof google.api.HttpRule + * Converts this ResourceDescriptor to JSON. + * @function toJSON + * @memberof google.api.ResourceDescriptor * @instance + * @returns {Object.} JSON object */ - HttpRule.prototype.put = null; + ResourceDescriptor.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; /** - * HttpRule post. - * @member {string|null|undefined} post - * @memberof google.api.HttpRule - * @instance + * 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 */ - HttpRule.prototype.post = null; + 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; + })(); /** - * HttpRule delete. - * @member {string|null|undefined} delete - * @memberof google.api.HttpRule - * @instance + * 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 */ - HttpRule.prototype["delete"] = null; + ResourceDescriptor.Style = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STYLE_UNSPECIFIED"] = 0; + values[valuesById[1] = "DECLARATIVE_FRIENDLY"] = 1; + return values; + })(); - /** - * HttpRule patch. - * @member {string|null|undefined} patch - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.patch = null; + return ResourceDescriptor; + })(); - /** - * HttpRule custom. - * @member {google.api.ICustomHttpPattern|null|undefined} custom - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.custom = null; + api.ResourceReference = (function() { /** - * HttpRule body. - * @member {string} body - * @memberof google.api.HttpRule - * @instance + * Properties of a ResourceReference. + * @memberof google.api + * @interface IResourceReference + * @property {string|null} [type] ResourceReference type + * @property {string|null} [childType] ResourceReference childType */ - HttpRule.prototype.body = ""; /** - * HttpRule responseBody. - * @member {string} responseBody - * @memberof google.api.HttpRule - * @instance + * Constructs a new ResourceReference. + * @memberof google.api + * @classdesc Represents a ResourceReference. + * @implements IResourceReference + * @constructor + * @param {google.api.IResourceReference=} [properties] Properties to set */ - HttpRule.prototype.responseBody = ""; + 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]]; + } /** - * HttpRule additionalBindings. - * @member {Array.} additionalBindings - * @memberof google.api.HttpRule + * ResourceReference type. + * @member {string} type + * @memberof google.api.ResourceReference * @instance */ - HttpRule.prototype.additionalBindings = $util.emptyArray; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + ResourceReference.prototype.type = ""; /** - * HttpRule pattern. - * @member {"get"|"put"|"post"|"delete"|"patch"|"custom"|undefined} pattern - * @memberof google.api.HttpRule + * ResourceReference childType. + * @member {string} childType + * @memberof google.api.ResourceReference * @instance */ - Object.defineProperty(HttpRule.prototype, "pattern", { - get: $util.oneOfGetter($oneOfFields = ["get", "put", "post", "delete", "patch", "custom"]), - set: $util.oneOfSetter($oneOfFields) - }); + ResourceReference.prototype.childType = ""; /** - * Creates a new HttpRule instance using the specified properties. + * Creates a new ResourceReference instance using the specified properties. * @function create - * @memberof google.api.HttpRule + * @memberof google.api.ResourceReference * @static - * @param {google.api.IHttpRule=} [properties] Properties to set - * @returns {google.api.HttpRule} HttpRule instance + * @param {google.api.IResourceReference=} [properties] Properties to set + * @returns {google.api.ResourceReference} ResourceReference instance */ - HttpRule.create = function create(properties) { - return new HttpRule(properties); + ResourceReference.create = function create(properties) { + return new ResourceReference(properties); }; /** - * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. * @function encode - * @memberof google.api.HttpRule + * @memberof google.api.ResourceReference * @static - * @param {google.api.IHttpRule} message HttpRule message or plain object to encode + * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - HttpRule.encode = function encode(message, writer) { + ResourceReference.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); + 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 HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. * @function encodeDelimited - * @memberof google.api.HttpRule + * @memberof google.api.ResourceReference * @static - * @param {google.api.IHttpRule} message HttpRule message or plain object to encode + * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - HttpRule.encodeDelimited = function encodeDelimited(message, writer) { + ResourceReference.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a HttpRule message from the specified reader or buffer. + * Decodes a ResourceReference message from the specified reader or buffer. * @function decode - * @memberof google.api.HttpRule + * @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.HttpRule} HttpRule + * @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 */ - HttpRule.decode = function decode(reader, length) { + 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.HttpRule(); + 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.selector = reader.string(); + message.type = 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())); + message.childType = reader.string(); break; default: reader.skipType(tag & 7); @@ -33764,240 +34298,118 @@ }; /** - * Decodes a HttpRule message from the specified reader or buffer, length delimited. + * Decodes a ResourceReference message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.api.HttpRule + * @memberof google.api.ResourceReference * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.HttpRule} HttpRule + * @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 */ - HttpRule.decodeDelimited = function decodeDelimited(reader) { + ResourceReference.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a HttpRule message. + * Verifies a ResourceReference message. * @function verify - * @memberof google.api.HttpRule + * @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 */ - HttpRule.verify = function verify(message) { + ResourceReference.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; - } - } + 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 HttpRule message from a plain object. Also converts values to their respective internal types. + * Creates a ResourceReference message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.api.HttpRule + * @memberof google.api.ResourceReference * @static * @param {Object.} object Plain object - * @returns {google.api.HttpRule} HttpRule + * @returns {google.api.ResourceReference} ResourceReference */ - HttpRule.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.HttpRule) + ResourceReference.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.ResourceReference) 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]); - } - } + 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 HttpRule message. Also converts values to other types if specified. + * Creates a plain object from a ResourceReference message. Also converts values to other types if specified. * @function toObject - * @memberof google.api.HttpRule + * @memberof google.api.ResourceReference * @static - * @param {google.api.HttpRule} message HttpRule + * @param {google.api.ResourceReference} message ResourceReference * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - HttpRule.toObject = function toObject(message, options) { + ResourceReference.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); + object.type = ""; + object.childType = ""; } - if (message.responseBody != null && message.hasOwnProperty("responseBody")) - object.responseBody = message.responseBody; + 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 HttpRule to JSON. + * Converts this ResourceReference to JSON. * @function toJSON - * @memberof google.api.HttpRule + * @memberof google.api.ResourceReference * @instance * @returns {Object.} JSON object */ - HttpRule.prototype.toJSON = function toJSON() { + ResourceReference.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return HttpRule; + return ResourceReference; })(); - api.CustomHttpPattern = (function() { + api.Http = (function() { /** - * Properties of a CustomHttpPattern. + * Properties of a Http. * @memberof google.api - * @interface ICustomHttpPattern - * @property {string|null} [kind] CustomHttpPattern kind - * @property {string|null} [path] CustomHttpPattern path + * @interface IHttp + * @property {Array.|null} [rules] Http rules + * @property {boolean|null} [fullyDecodeReservedExpansion] Http fullyDecodeReservedExpansion */ /** - * Constructs a new CustomHttpPattern. + * Constructs a new Http. * @memberof google.api - * @classdesc Represents a CustomHttpPattern. - * @implements ICustomHttpPattern + * @classdesc Represents a Http. + * @implements IHttp * @constructor - * @param {google.api.ICustomHttpPattern=} [properties] Properties to set + * @param {google.api.IHttp=} [properties] Properties to set */ - function CustomHttpPattern(properties) { + function Http(properties) { + this.rules = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -34005,88 +34417,91 @@ } /** - * CustomHttpPattern kind. - * @member {string} kind - * @memberof google.api.CustomHttpPattern + * Http rules. + * @member {Array.} rules + * @memberof google.api.Http * @instance */ - CustomHttpPattern.prototype.kind = ""; + Http.prototype.rules = $util.emptyArray; /** - * CustomHttpPattern path. - * @member {string} path - * @memberof google.api.CustomHttpPattern + * Http fullyDecodeReservedExpansion. + * @member {boolean} fullyDecodeReservedExpansion + * @memberof google.api.Http * @instance */ - CustomHttpPattern.prototype.path = ""; + Http.prototype.fullyDecodeReservedExpansion = false; /** - * Creates a new CustomHttpPattern instance using the specified properties. + * Creates a new Http instance using the specified properties. * @function create - * @memberof google.api.CustomHttpPattern + * @memberof google.api.Http * @static - * @param {google.api.ICustomHttpPattern=} [properties] Properties to set - * @returns {google.api.CustomHttpPattern} CustomHttpPattern instance + * @param {google.api.IHttp=} [properties] Properties to set + * @returns {google.api.Http} Http instance */ - CustomHttpPattern.create = function create(properties) { - return new CustomHttpPattern(properties); + Http.create = function create(properties) { + return new Http(properties); }; /** - * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. * @function encode - * @memberof google.api.CustomHttpPattern + * @memberof google.api.Http * @static - * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode + * @param {google.api.IHttp} message Http message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CustomHttpPattern.encode = function encode(message, writer) { + Http.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); + 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 CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. * @function encodeDelimited - * @memberof google.api.CustomHttpPattern + * @memberof google.api.Http * @static - * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode + * @param {google.api.IHttp} message Http message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CustomHttpPattern.encodeDelimited = function encodeDelimited(message, writer) { + Http.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a CustomHttpPattern message from the specified reader or buffer. + * Decodes a Http message from the specified reader or buffer. * @function decode - * @memberof google.api.CustomHttpPattern + * @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.CustomHttpPattern} CustomHttpPattern + * @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 */ - CustomHttpPattern.decode = function decode(reader, length) { + 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.CustomHttpPattern(); + 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: - message.kind = reader.string(); + if (!(message.rules && message.rules.length)) + message.rules = []; + message.rules.push($root.google.api.HttpRule.decode(reader, reader.uint32())); break; case 2: - message.path = reader.string(); + message.fullyDecodeReservedExpansion = reader.bool(); break; default: reader.skipType(tag & 7); @@ -34097,124 +34512,143 @@ }; /** - * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. + * Decodes a Http message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.api.CustomHttpPattern + * @memberof google.api.Http * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.CustomHttpPattern} CustomHttpPattern + * @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 */ - CustomHttpPattern.decodeDelimited = function decodeDelimited(reader) { + Http.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a CustomHttpPattern message. + * Verifies a Http message. * @function verify - * @memberof google.api.CustomHttpPattern + * @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 */ - CustomHttpPattern.verify = function verify(message) { + Http.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"; + 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 CustomHttpPattern message from a plain object. Also converts values to their respective internal types. + * Creates a Http message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.api.CustomHttpPattern + * @memberof google.api.Http * @static * @param {Object.} object Plain object - * @returns {google.api.CustomHttpPattern} CustomHttpPattern + * @returns {google.api.Http} Http */ - CustomHttpPattern.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.CustomHttpPattern) + Http.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.Http) 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); + 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 CustomHttpPattern message. Also converts values to other types if specified. + * Creates a plain object from a Http message. Also converts values to other types if specified. * @function toObject - * @memberof google.api.CustomHttpPattern + * @memberof google.api.Http * @static - * @param {google.api.CustomHttpPattern} message CustomHttpPattern + * @param {google.api.Http} message Http * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CustomHttpPattern.toObject = function toObject(message, options) { + Http.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.kind = ""; - object.path = ""; + 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.kind != null && message.hasOwnProperty("kind")) - object.kind = message.kind; - if (message.path != null && message.hasOwnProperty("path")) - object.path = message.path; + if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) + object.fullyDecodeReservedExpansion = message.fullyDecodeReservedExpansion; return object; }; /** - * Converts this CustomHttpPattern to JSON. + * Converts this Http to JSON. * @function toJSON - * @memberof google.api.CustomHttpPattern + * @memberof google.api.Http * @instance * @returns {Object.} JSON object */ - CustomHttpPattern.prototype.toJSON = function toJSON() { + Http.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return CustomHttpPattern; + return Http; })(); - api.ResourceDescriptor = (function() { + api.HttpRule = (function() { /** - * Properties of a ResourceDescriptor. + * Properties of a HttpRule. * @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 + * @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 ResourceDescriptor. + * Constructs a new HttpRule. * @memberof google.api - * @classdesc Represents a ResourceDescriptor. - * @implements IResourceDescriptor + * @classdesc Represents a HttpRule. + * @implements IHttpRule * @constructor - * @param {google.api.IResourceDescriptor=} [properties] Properties to set + * @param {google.api.IHttpRule=} [properties] Properties to set */ - function ResourceDescriptor(properties) { - this.pattern = []; - this.style = []; + function HttpRule(properties) { + this.additionalBindings = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -34222,167 +34656,209 @@ } /** - * ResourceDescriptor type. - * @member {string} type - * @memberof google.api.ResourceDescriptor + * HttpRule selector. + * @member {string} selector + * @memberof google.api.HttpRule * @instance */ - ResourceDescriptor.prototype.type = ""; + HttpRule.prototype.selector = ""; /** - * ResourceDescriptor pattern. - * @member {Array.} pattern - * @memberof google.api.ResourceDescriptor + * HttpRule get. + * @member {string|null|undefined} get + * @memberof google.api.HttpRule * @instance */ - ResourceDescriptor.prototype.pattern = $util.emptyArray; + HttpRule.prototype.get = null; /** - * ResourceDescriptor nameField. - * @member {string} nameField - * @memberof google.api.ResourceDescriptor + * HttpRule put. + * @member {string|null|undefined} put + * @memberof google.api.HttpRule * @instance */ - ResourceDescriptor.prototype.nameField = ""; + HttpRule.prototype.put = null; /** - * ResourceDescriptor history. - * @member {google.api.ResourceDescriptor.History} history - * @memberof google.api.ResourceDescriptor + * HttpRule post. + * @member {string|null|undefined} post + * @memberof google.api.HttpRule * @instance */ - ResourceDescriptor.prototype.history = 0; + HttpRule.prototype.post = null; /** - * ResourceDescriptor plural. - * @member {string} plural - * @memberof google.api.ResourceDescriptor + * HttpRule delete. + * @member {string|null|undefined} delete + * @memberof google.api.HttpRule * @instance */ - ResourceDescriptor.prototype.plural = ""; + HttpRule.prototype["delete"] = null; /** - * ResourceDescriptor singular. - * @member {string} singular - * @memberof google.api.ResourceDescriptor + * HttpRule patch. + * @member {string|null|undefined} patch + * @memberof google.api.HttpRule * @instance */ - ResourceDescriptor.prototype.singular = ""; + HttpRule.prototype.patch = null; /** - * ResourceDescriptor style. - * @member {Array.} style - * @memberof google.api.ResourceDescriptor + * HttpRule custom. + * @member {google.api.ICustomHttpPattern|null|undefined} custom + * @memberof google.api.HttpRule * @instance */ - ResourceDescriptor.prototype.style = $util.emptyArray; + HttpRule.prototype.custom = null; /** - * Creates a new ResourceDescriptor instance using the specified properties. + * 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.ResourceDescriptor + * @memberof google.api.HttpRule * @static - * @param {google.api.IResourceDescriptor=} [properties] Properties to set - * @returns {google.api.ResourceDescriptor} ResourceDescriptor instance + * @param {google.api.IHttpRule=} [properties] Properties to set + * @returns {google.api.HttpRule} HttpRule instance */ - ResourceDescriptor.create = function create(properties) { - return new ResourceDescriptor(properties); + HttpRule.create = function create(properties) { + return new HttpRule(properties); }; /** - * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. * @function encode - * @memberof google.api.ResourceDescriptor + * @memberof google.api.HttpRule * @static - * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode + * @param {google.api.IHttpRule} message HttpRule message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ResourceDescriptor.encode = function encode(message, writer) { + HttpRule.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(); - } + 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 ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. * @function encodeDelimited - * @memberof google.api.ResourceDescriptor + * @memberof google.api.HttpRule * @static - * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode + * @param {google.api.IHttpRule} message HttpRule message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ResourceDescriptor.encodeDelimited = function encodeDelimited(message, writer) { + HttpRule.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ResourceDescriptor message from the specified reader or buffer. + * Decodes a HttpRule message from the specified reader or buffer. * @function decode - * @memberof google.api.ResourceDescriptor + * @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.ResourceDescriptor} ResourceDescriptor + * @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 */ - ResourceDescriptor.decode = function decode(reader, length) { + 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.ResourceDescriptor(); + 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.type = reader.string(); + message.selector = reader.string(); break; case 2: - if (!(message.pattern && message.pattern.length)) - message.pattern = []; - message.pattern.push(reader.string()); + message.get = reader.string(); break; case 3: - message.nameField = reader.string(); + message.put = reader.string(); break; case 4: - message.history = reader.int32(); + message.post = reader.string(); break; case 5: - message.plural = reader.string(); + message["delete"] = reader.string(); break; case 6: - message.singular = reader.string(); + message.patch = 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()); + 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); @@ -34393,246 +34869,240 @@ }; /** - * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. + * Decodes a HttpRule message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.api.ResourceDescriptor + * @memberof google.api.HttpRule * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.ResourceDescriptor} ResourceDescriptor + * @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 */ - ResourceDescriptor.decodeDelimited = function decodeDelimited(reader) { + HttpRule.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ResourceDescriptor message. + * Verifies a HttpRule message. * @function verify - * @memberof google.api.ResourceDescriptor + * @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 */ - ResourceDescriptor.verify = function verify(message) { + HttpRule.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"; + 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.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.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; } - 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. + * Creates a HttpRule message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.api.ResourceDescriptor + * @memberof google.api.HttpRule * @static * @param {Object.} object Plain object - * @returns {google.api.ResourceDescriptor} ResourceDescriptor + * @returns {google.api.HttpRule} HttpRule */ - ResourceDescriptor.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.ResourceDescriptor) + HttpRule.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.HttpRule) 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) { - 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; + 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.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: - case "STYLE_UNSPECIFIED": - case 0: - message.style[i] = 0; - break; - case "DECLARATIVE_FRIENDLY": - case 1: - message.style[i] = 1; - break; - } + 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 ResourceDescriptor message. Also converts values to other types if specified. + * Creates a plain object from a HttpRule message. Also converts values to other types if specified. * @function toObject - * @memberof google.api.ResourceDescriptor + * @memberof google.api.HttpRule * @static - * @param {google.api.ResourceDescriptor} message ResourceDescriptor + * @param {google.api.HttpRule} message HttpRule * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ResourceDescriptor.toObject = function toObject(message, options) { + HttpRule.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) { - object.pattern = []; - object.style = []; - } + if (options.arrays || options.defaults) + object.additionalBindings = []; if (options.defaults) { - object.type = ""; - object.nameField = ""; - object.history = options.enums === String ? "HISTORY_UNSPECIFIED" : 0; - object.plural = ""; - object.singular = ""; + object.selector = ""; + object.body = ""; + object.responseBody = ""; } - 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.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.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] : 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]] : message.style[j]; + 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 ResourceDescriptor to JSON. + * Converts this HttpRule to JSON. * @function toJSON - * @memberof google.api.ResourceDescriptor + * @memberof google.api.HttpRule * @instance * @returns {Object.} JSON object */ - ResourceDescriptor.prototype.toJSON = function toJSON() { + HttpRule.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - /** - * 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; + return HttpRule; })(); - api.ResourceReference = (function() { + api.CustomHttpPattern = (function() { /** - * Properties of a ResourceReference. + * Properties of a CustomHttpPattern. * @memberof google.api - * @interface IResourceReference - * @property {string|null} [type] ResourceReference type - * @property {string|null} [childType] ResourceReference childType + * @interface ICustomHttpPattern + * @property {string|null} [kind] CustomHttpPattern kind + * @property {string|null} [path] CustomHttpPattern path */ /** - * Constructs a new ResourceReference. + * Constructs a new CustomHttpPattern. * @memberof google.api - * @classdesc Represents a ResourceReference. - * @implements IResourceReference + * @classdesc Represents a CustomHttpPattern. + * @implements ICustomHttpPattern * @constructor - * @param {google.api.IResourceReference=} [properties] Properties to set + * @param {google.api.ICustomHttpPattern=} [properties] Properties to set */ - function ResourceReference(properties) { + function CustomHttpPattern(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -34640,88 +35110,88 @@ } /** - * ResourceReference type. - * @member {string} type - * @memberof google.api.ResourceReference + * CustomHttpPattern kind. + * @member {string} kind + * @memberof google.api.CustomHttpPattern * @instance */ - ResourceReference.prototype.type = ""; + CustomHttpPattern.prototype.kind = ""; /** - * ResourceReference childType. - * @member {string} childType - * @memberof google.api.ResourceReference + * CustomHttpPattern path. + * @member {string} path + * @memberof google.api.CustomHttpPattern * @instance */ - ResourceReference.prototype.childType = ""; + CustomHttpPattern.prototype.path = ""; /** - * Creates a new ResourceReference instance using the specified properties. + * Creates a new CustomHttpPattern instance using the specified properties. * @function create - * @memberof google.api.ResourceReference + * @memberof google.api.CustomHttpPattern * @static - * @param {google.api.IResourceReference=} [properties] Properties to set - * @returns {google.api.ResourceReference} ResourceReference instance + * @param {google.api.ICustomHttpPattern=} [properties] Properties to set + * @returns {google.api.CustomHttpPattern} CustomHttpPattern instance */ - ResourceReference.create = function create(properties) { - return new ResourceReference(properties); + CustomHttpPattern.create = function create(properties) { + return new CustomHttpPattern(properties); }; /** - * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. * @function encode - * @memberof google.api.ResourceReference + * @memberof google.api.CustomHttpPattern * @static - * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode + * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ResourceReference.encode = function encode(message, writer) { + CustomHttpPattern.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); + 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 ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. * @function encodeDelimited - * @memberof google.api.ResourceReference + * @memberof google.api.CustomHttpPattern * @static - * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode + * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ResourceReference.encodeDelimited = function encodeDelimited(message, writer) { + CustomHttpPattern.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ResourceReference message from the specified reader or buffer. + * Decodes a CustomHttpPattern message from the specified reader or buffer. * @function decode - * @memberof google.api.ResourceReference + * @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.ResourceReference} ResourceReference + * @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 */ - ResourceReference.decode = function decode(reader, length) { + 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.ResourceReference(); + 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.type = reader.string(); + message.kind = reader.string(); break; case 2: - message.childType = reader.string(); + message.path = reader.string(); break; default: reader.skipType(tag & 7); @@ -34732,96 +35202,96 @@ }; /** - * Decodes a ResourceReference message from the specified reader or buffer, length delimited. + * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.api.ResourceReference + * @memberof google.api.CustomHttpPattern * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.ResourceReference} ResourceReference + * @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 */ - ResourceReference.decodeDelimited = function decodeDelimited(reader) { + CustomHttpPattern.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ResourceReference message. + * Verifies a CustomHttpPattern message. * @function verify - * @memberof google.api.ResourceReference + * @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 */ - ResourceReference.verify = function verify(message) { + CustomHttpPattern.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"; + 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 ResourceReference message from a plain object. Also converts values to their respective internal types. + * Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.api.ResourceReference + * @memberof google.api.CustomHttpPattern * @static * @param {Object.} object Plain object - * @returns {google.api.ResourceReference} ResourceReference + * @returns {google.api.CustomHttpPattern} CustomHttpPattern */ - ResourceReference.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.ResourceReference) + CustomHttpPattern.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.CustomHttpPattern) 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); + 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 ResourceReference message. Also converts values to other types if specified. + * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. * @function toObject - * @memberof google.api.ResourceReference + * @memberof google.api.CustomHttpPattern * @static - * @param {google.api.ResourceReference} message ResourceReference + * @param {google.api.CustomHttpPattern} message CustomHttpPattern * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ResourceReference.toObject = function toObject(message, options) { + CustomHttpPattern.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.type = ""; - object.childType = ""; + object.kind = ""; + object.path = ""; } - if (message.type != null && message.hasOwnProperty("type")) - object.type = message.type; - if (message.childType != null && message.hasOwnProperty("childType")) - object.childType = message.childType; + 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 ResourceReference to JSON. + * Converts this CustomHttpPattern to JSON. * @function toJSON - * @memberof google.api.ResourceReference + * @memberof google.api.CustomHttpPattern * @instance * @returns {Object.} JSON object */ - ResourceReference.prototype.toJSON = function toJSON() { + CustomHttpPattern.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ResourceReference; + return CustomHttpPattern; })(); /** diff --git a/packages/google-cloud-securitycenter/protos/protos.json b/packages/google-cloud-securitycenter/protos/protos.json index 0548749a7a6..a667990855a 100644 --- a/packages/google-cloud-securitycenter/protos/protos.json +++ b/packages/google-cloud-securitycenter/protos/protos.json @@ -22,7 +22,7 @@ "Asset": { "options": { "(google.api.resource).type": "securitycenter.googleapis.com/Asset", - "(google.api.resource).pattern": "organizations/{organization}/assets/{asset}" + "(google.api.resource).pattern": "projects/{project}/assets/{asset}" }, "fields": { "name": { @@ -53,6 +53,10 @@ "iamPolicy": { "type": "IamPolicy", "id": 11 + }, + "canonicalName": { + "type": "string", + "id": 13 } }, "nested": { @@ -90,6 +94,11 @@ "resourceProjectDisplayName": { "type": "string", "id": 8 + }, + "folders": { + "rule": "repeated", + "type": "Folder", + "id": 10 } } }, @@ -103,10 +112,22 @@ } } }, + "Folder": { + "fields": { + "resourceFolder": { + "type": "string", + "id": 1 + }, + "resourceFolderDisplayName": { + "type": "string", + "id": 2 + } + } + }, "SecurityMarks": { "options": { "(google.api.resource).type": "securitycenter.googleapis.com/SecurityMarks", - "(google.api.resource).pattern": "organizations/{organization}/sources/{source}/findings/{finding}/securityMarks" + "(google.api.resource).pattern": "projects/{project}/sources/{source}/findings/{finding}/securityMarks" }, "fields": { "name": { @@ -117,13 +138,17 @@ "keyType": "string", "type": "string", "id": 2 + }, + "canonicalName": { + "type": "string", + "id": 3 } } }, "Finding": { "options": { "(google.api.resource).type": "securitycenter.googleapis.com/Finding", - "(google.api.resource).pattern": "organizations/{organization}/sources/{source}/findings/{finding}" + "(google.api.resource).pattern": "projects/{project}/sources/{source}/findings/{finding}" }, "fields": { "name": { @@ -173,6 +198,10 @@ "severity": { "type": "Severity", "id": 12 + }, + "canonicalName": { + "type": "string", + "id": 14 } }, "nested": { @@ -289,6 +318,14 @@ "parentDisplayName": { "type": "string", "id": 5 + }, + "folders": { + "rule": "repeated", + "type": "Folder", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } } } }, @@ -322,6 +359,11 @@ "inclusionMode": { "type": "InclusionMode", "id": 2 + }, + "folderIds": { + "rule": "repeated", + "type": "string", + "id": 3 } }, "nested": { @@ -524,13 +566,25 @@ "responseType": "GroupAssetsResponse", "options": { "(google.api.http).post": "/v1/{parent=organizations/*}/assets:group", - "(google.api.http).body": "*" + "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v1/{parent=projects/*}/assets:group", + "(google.api.http).additional_bindings.body": "*" }, "parsedOptions": [ { "(google.api.http)": { "post": "/v1/{parent=organizations/*}/assets:group", - "body": "*" + "body": "*", + "additional_bindings": [ + { + "post": "/v1/{parent=folders/*}/assets:group", + "body": "*" + }, + { + "post": "/v1/{parent=projects/*}/assets:group", + "body": "*" + } + ] } } ] @@ -541,13 +595,25 @@ "options": { "(google.api.http).post": "/v1/{parent=organizations/*/sources/*}/findings:group", "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v1/{parent=projects/*/sources/*}/findings:group", + "(google.api.http).additional_bindings.body": "*", "(google.api.method_signature)": "parent,group_by" }, "parsedOptions": [ { "(google.api.http)": { "post": "/v1/{parent=organizations/*/sources/*}/findings:group", - "body": "*" + "body": "*", + "additional_bindings": [ + { + "post": "/v1/{parent=folders/*/sources/*}/findings:group", + "body": "*" + }, + { + "post": "/v1/{parent=projects/*/sources/*}/findings:group", + "body": "*" + } + ] } }, { @@ -559,12 +625,21 @@ "requestType": "ListAssetsRequest", "responseType": "ListAssetsResponse", "options": { - "(google.api.http).get": "/v1/{parent=organizations/*}/assets" + "(google.api.http).get": "/v1/{parent=organizations/*}/assets", + "(google.api.http).additional_bindings.get": "/v1/{parent=projects/*}/assets" }, "parsedOptions": [ { "(google.api.http)": { - "get": "/v1/{parent=organizations/*}/assets" + "get": "/v1/{parent=organizations/*}/assets", + "additional_bindings": [ + { + "get": "/v1/{parent=folders/*}/assets" + }, + { + "get": "/v1/{parent=projects/*}/assets" + } + ] } } ] @@ -573,12 +648,21 @@ "requestType": "ListFindingsRequest", "responseType": "ListFindingsResponse", "options": { - "(google.api.http).get": "/v1/{parent=organizations/*/sources/*}/findings" + "(google.api.http).get": "/v1/{parent=organizations/*/sources/*}/findings", + "(google.api.http).additional_bindings.get": "/v1/{parent=projects/*/sources/*}/findings" }, "parsedOptions": [ { "(google.api.http)": { - "get": "/v1/{parent=organizations/*/sources/*}/findings" + "get": "/v1/{parent=organizations/*/sources/*}/findings", + "additional_bindings": [ + { + "get": "/v1/{parent=folders/*/sources/*}/findings" + }, + { + "get": "/v1/{parent=projects/*/sources/*}/findings" + } + ] } } ] @@ -606,12 +690,21 @@ "responseType": "ListSourcesResponse", "options": { "(google.api.http).get": "/v1/{parent=organizations/*}/sources", + "(google.api.http).additional_bindings.get": "/v1/{parent=projects/*}/sources", "(google.api.method_signature)": "parent" }, "parsedOptions": [ { "(google.api.http)": { - "get": "/v1/{parent=organizations/*}/sources" + "get": "/v1/{parent=organizations/*}/sources", + "additional_bindings": [ + { + "get": "/v1/{parent=folders/*}/sources" + }, + { + "get": "/v1/{parent=projects/*}/sources" + } + ] } }, { @@ -653,13 +746,25 @@ "options": { "(google.api.http).post": "/v1/{name=organizations/*/sources/*/findings/*}:setState", "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v1/{name=projects/*/sources/*/findings/*}:setState", + "(google.api.http).additional_bindings.body": "*", "(google.api.method_signature)": "name,state,start_time" }, "parsedOptions": [ { "(google.api.http)": { "post": "/v1/{name=organizations/*/sources/*/findings/*}:setState", - "body": "*" + "body": "*", + "additional_bindings": [ + { + "post": "/v1/{name=folders/*/sources/*/findings/*}:setState", + "body": "*" + }, + { + "post": "/v1/{name=projects/*/sources/*/findings/*}:setState", + "body": "*" + } + ] } }, { @@ -713,13 +818,25 @@ "options": { "(google.api.http).patch": "/v1/{finding.name=organizations/*/sources/*/findings/*}", "(google.api.http).body": "finding", + "(google.api.http).additional_bindings.patch": "/v1/{finding.name=projects/*/sources/*/findings/*}", + "(google.api.http).additional_bindings.body": "finding", "(google.api.method_signature)": "finding" }, "parsedOptions": [ { "(google.api.http)": { "patch": "/v1/{finding.name=organizations/*/sources/*/findings/*}", - "body": "finding" + "body": "finding", + "additional_bindings": [ + { + "patch": "/v1/{finding.name=folders/*/sources/*/findings/*}", + "body": "finding" + }, + { + "patch": "/v1/{finding.name=projects/*/sources/*/findings/*}", + "body": "finding" + } + ] } }, { @@ -796,7 +913,7 @@ "options": { "(google.api.http).patch": "/v1/{security_marks.name=organizations/*/assets/*/securityMarks}", "(google.api.http).body": "security_marks", - "(google.api.http).additional_bindings.patch": "/v1/{security_marks.name=organizations/*/sources/*/findings/*/securityMarks}", + "(google.api.http).additional_bindings.patch": "/v1/{security_marks.name=projects/*/sources/*/findings/*/securityMarks}", "(google.api.http).additional_bindings.body": "security_marks", "(google.api.method_signature)": "security_marks" }, @@ -805,10 +922,28 @@ "(google.api.http)": { "patch": "/v1/{security_marks.name=organizations/*/assets/*/securityMarks}", "body": "security_marks", - "additional_bindings": { - "patch": "/v1/{security_marks.name=organizations/*/sources/*/findings/*/securityMarks}", - "body": "security_marks" - } + "additional_bindings": [ + { + "patch": "/v1/{security_marks.name=folders/*/assets/*/securityMarks}", + "body": "security_marks" + }, + { + "patch": "/v1/{security_marks.name=projects/*/assets/*/securityMarks}", + "body": "security_marks" + }, + { + "patch": "/v1/{security_marks.name=organizations/*/sources/*/findings/*/securityMarks}", + "body": "security_marks" + }, + { + "patch": "/v1/{security_marks.name=folders/*/sources/*/findings/*/securityMarks}", + "body": "security_marks" + }, + { + "patch": "/v1/{security_marks.name=projects/*/sources/*/findings/*/securityMarks}", + "body": "security_marks" + } + ] } }, { @@ -944,7 +1079,7 @@ "id": 1, "options": { "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "cloudresourcemanager.googleapis.com/Organization" + "(google.api.resource_reference).child_type": "securitycenter.googleapis.com/Asset" } }, "filter": { @@ -1110,7 +1245,7 @@ "id": 1, "options": { "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "cloudresourcemanager.googleapis.com/Organization" + "(google.api.resource_reference).child_type": "securitycenter.googleapis.com/Source" } }, "pageToken": { @@ -1143,7 +1278,7 @@ "id": 1, "options": { "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "cloudresourcemanager.googleapis.com/Organization" + "(google.api.resource_reference).child_type": "securitycenter.googleapis.com/Asset" } }, "filter": { @@ -1322,6 +1457,11 @@ "parentDisplayName": { "type": "string", "id": 5 + }, + "folders": { + "rule": "repeated", + "type": "Folder", + "id": 7 } } }, @@ -1458,7 +1598,7 @@ "Source": { "options": { "(google.api.resource).type": "securitycenter.googleapis.com/Source", - "(google.api.resource).pattern": "organizations/{organization}/sources/{source}" + "(google.api.resource).pattern": "projects/{project}/sources/{source}" }, "fields": { "name": { @@ -1472,6 +1612,10 @@ "description": { "type": "string", "id": 3 + }, + "canonicalName": { + "type": "string", + "id": 14 } } } @@ -4201,14 +4345,91 @@ }, "api": { "options": { + "cc_enable_arenas": true, "go_package": "google.golang.org/genproto/googleapis/api/annotations;annotations", "java_multiple_files": true, "java_outer_classname": "ClientProto", "java_package": "com.google.api", - "objc_class_prefix": "GAPI", - "cc_enable_arenas": true + "objc_class_prefix": "GAPI" }, "nested": { + "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 + } + } + }, "http": { "type": "HttpRule", "id": 72295728, @@ -4296,83 +4517,6 @@ } } }, - "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 - } - } - }, "fieldBehavior": { "rule": "repeated", "type": "google.api.FieldBehavior", diff --git a/packages/google-cloud-securitycenter/src/index.ts b/packages/google-cloud-securitycenter/src/index.ts index f0712e1a2de..c05c520cf5f 100644 --- a/packages/google-cloud-securitycenter/src/index.ts +++ b/packages/google-cloud-securitycenter/src/index.ts @@ -16,14 +16,14 @@ // ** https://github.com/googleapis/synthtool ** // ** All changes to this file may be overwritten. ** -import * as v1p1beta1 from './v1p1beta1'; import * as v1beta1 from './v1beta1'; +import * as v1p1beta1 from './v1p1beta1'; import * as v1 from './v1'; const SecurityCenterClient = v1.SecurityCenterClient; type SecurityCenterClient = v1.SecurityCenterClient; -export {v1p1beta1, v1beta1, v1, SecurityCenterClient}; -export default {v1p1beta1, v1beta1, v1, SecurityCenterClient}; +export {v1beta1, v1p1beta1, v1, SecurityCenterClient}; +export default {v1beta1, v1p1beta1, v1, SecurityCenterClient}; import * as protos from '../protos/protos'; export {protos}; diff --git a/packages/google-cloud-securitycenter/src/v1/security_center_client.ts b/packages/google-cloud-securitycenter/src/v1/security_center_client.ts index c997ce63a64..69f7c815b9b 100644 --- a/packages/google-cloud-securitycenter/src/v1/security_center_client.ts +++ b/packages/google-cloud-securitycenter/src/v1/security_center_client.ts @@ -153,18 +153,31 @@ export class SecurityCenterClient { // identifiers to uniquely identify resources within the API. // Create useful helper objects for these. this.pathTemplates = { - assetPathTemplate: new this._gaxModule.PathTemplate( - 'organizations/{organization}/assets/{asset}' + folderAssetPathTemplate: new this._gaxModule.PathTemplate( + 'folders/{folder}/assets/{asset}' ), - findingPathTemplate: new this._gaxModule.PathTemplate( - 'organizations/{organization}/sources/{source}/findings/{finding}' + folderAssetSecurityMarksPathTemplate: new this._gaxModule.PathTemplate( + 'folders/{folder}/assets/{asset}/securityMarks' + ), + folderSourcePathTemplate: new this._gaxModule.PathTemplate( + 'folders/{folder}/sources/{source}' ), + folderSourceFindingPathTemplate: new this._gaxModule.PathTemplate( + 'folders/{folder}/sources/{source}/findings/{finding}' + ), + folderSourceFindingSecurityMarksPathTemplate: + new this._gaxModule.PathTemplate( + 'folders/{folder}/sources/{source}/findings/{finding}/securityMarks' + ), notificationConfigPathTemplate: new this._gaxModule.PathTemplate( 'organizations/{organization}/notificationConfigs/{notification_config}' ), organizationPathTemplate: new this._gaxModule.PathTemplate( 'organizations/{organization}' ), + organizationAssetPathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}/assets/{asset}' + ), organizationAssetSecurityMarksPathTemplate: new this._gaxModule.PathTemplate( 'organizations/{organization}/assets/{asset}/securityMarks' @@ -172,13 +185,32 @@ export class SecurityCenterClient { organizationSettingsPathTemplate: new this._gaxModule.PathTemplate( 'organizations/{organization}/organizationSettings' ), + organizationSourcePathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}/sources/{source}' + ), + organizationSourceFindingPathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}/sources/{source}/findings/{finding}' + ), organizationSourceFindingSecurityMarksPathTemplate: new this._gaxModule.PathTemplate( 'organizations/{organization}/sources/{source}/findings/{finding}/securityMarks' ), - sourcePathTemplate: new this._gaxModule.PathTemplate( - 'organizations/{organization}/sources/{source}' + projectAssetPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/assets/{asset}' + ), + projectAssetSecurityMarksPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/assets/{asset}/securityMarks' + ), + projectSourcePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/sources/{source}' + ), + projectSourceFindingPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/sources/{source}/findings/{finding}' ), + projectSourceFindingSecurityMarksPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/sources/{source}/findings/{finding}/securityMarks' + ), }; // Some of the methods on this service return "paged" results, @@ -1600,6 +1632,7 @@ export class SecurityCenterClient { > ): void; /** + * * Updates a notification config. The following update * fields are allowed: description, pubsub_topic, streaming_config.filter * @@ -2165,7 +2198,8 @@ export class SecurityCenterClient { * The request object that will be sent. * @param {string} request.parent * Required. Name of the organization to groupBy. Its format is - * "organizations/[organization_id]". + * "organizations/[organization_id], folders/[folder_id], or + * projects/[project_id]". * @param {string} request.filter * Expression that defines the filter to apply across assets. * The expression is a list of zero or more restrictions combined via logical @@ -2351,7 +2385,8 @@ export class SecurityCenterClient { * The request object that will be sent. * @param {string} request.parent * Required. Name of the organization to groupBy. Its format is - * "organizations/[organization_id]". + * "organizations/[organization_id], folders/[folder_id], or + * projects/[project_id]". * @param {string} request.filter * Expression that defines the filter to apply across assets. * The expression is a list of zero or more restrictions combined via logical @@ -2515,7 +2550,8 @@ export class SecurityCenterClient { * The request object that will be sent. * @param {string} request.parent * Required. Name of the organization to groupBy. Its format is - * "organizations/[organization_id]". + * "organizations/[organization_id], folders/[folder_id], or + * projects/[project_id]". * @param {string} request.filter * Expression that defines the filter to apply across assets. * The expression is a list of zero or more restrictions combined via logical @@ -2711,15 +2747,20 @@ export class SecurityCenterClient { * specified properties. * * To group across all sources provide a `-` as the source id. - * Example: /v1/organizations/{organization_id}/sources/-/findings + * Example: /v1/organizations/{organization_id}/sources/-/findings, + * /v1/folders/{folder_id}/sources/-/findings, + * /v1/projects/{project_id}/sources/-/findings * * @param {Object} request * The request object that will be sent. * @param {string} request.parent * Required. Name of the source to groupBy. Its format is - * "organizations/[organization_id]/sources/[source_id]". To groupBy across - * all sources provide a source_id of `-`. For example: - * organizations/{organization_id}/sources/- + * "organizations/[organization_id]/sources/[source_id]", + * folders/[folder_id]/sources/[source_id], or + * projects/[project_id]/sources/[source_id]. To groupBy across all sources + * provide a source_id of `-`. For example: + * organizations/{organization_id}/sources/-, folders/{folder_id}/sources/-, + * or projects/{project_id}/sources/- * @param {string} request.filter * Expression that defines the filter to apply across findings. * The expression is a list of one or more restrictions combined via logical @@ -2895,9 +2936,12 @@ export class SecurityCenterClient { * The request object that will be sent. * @param {string} request.parent * Required. Name of the source to groupBy. Its format is - * "organizations/[organization_id]/sources/[source_id]". To groupBy across - * all sources provide a source_id of `-`. For example: - * organizations/{organization_id}/sources/- + * "organizations/[organization_id]/sources/[source_id]", + * folders/[folder_id]/sources/[source_id], or + * projects/[project_id]/sources/[source_id]. To groupBy across all sources + * provide a source_id of `-`. For example: + * organizations/{organization_id}/sources/-, folders/{folder_id}/sources/-, + * or projects/{project_id}/sources/- * @param {string} request.filter * Expression that defines the filter to apply across findings. * The expression is a list of one or more restrictions combined via logical @@ -3051,9 +3095,12 @@ export class SecurityCenterClient { * The request object that will be sent. * @param {string} request.parent * Required. Name of the source to groupBy. Its format is - * "organizations/[organization_id]/sources/[source_id]". To groupBy across - * all sources provide a source_id of `-`. For example: - * organizations/{organization_id}/sources/- + * "organizations/[organization_id]/sources/[source_id]", + * folders/[folder_id]/sources/[source_id], or + * projects/[project_id]/sources/[source_id]. To groupBy across all sources + * provide a source_id of `-`. For example: + * organizations/{organization_id}/sources/-, folders/{folder_id}/sources/-, + * or projects/{project_id}/sources/- * @param {string} request.filter * Expression that defines the filter to apply across findings. * The expression is a list of one or more restrictions combined via logical @@ -3241,7 +3288,8 @@ export class SecurityCenterClient { * The request object that will be sent. * @param {string} request.parent * Required. Name of the organization assets should belong to. Its format is - * "organizations/[organization_id]". + * "organizations/[organization_id], folders/[folder_id], or + * projects/[project_id]". * @param {string} request.filter * Expression that defines the filter to apply across assets. * The expression is a list of zero or more restrictions combined via logical @@ -3431,7 +3479,8 @@ export class SecurityCenterClient { * The request object that will be sent. * @param {string} request.parent * Required. Name of the organization assets should belong to. Its format is - * "organizations/[organization_id]". + * "organizations/[organization_id], folders/[folder_id], or + * projects/[project_id]". * @param {string} request.filter * Expression that defines the filter to apply across assets. * The expression is a list of zero or more restrictions combined via logical @@ -3599,7 +3648,8 @@ export class SecurityCenterClient { * The request object that will be sent. * @param {string} request.parent * Required. Name of the organization assets should belong to. Its format is - * "organizations/[organization_id]". + * "organizations/[organization_id], folders/[folder_id], or + * projects/[project_id]". * @param {string} request.filter * Expression that defines the filter to apply across assets. * The expression is a list of zero or more restrictions combined via logical @@ -3804,9 +3854,12 @@ export class SecurityCenterClient { * The request object that will be sent. * @param {string} request.parent * Required. Name of the source the findings belong to. Its format is - * "organizations/[organization_id]/sources/[source_id]". To list across all - * sources provide a source_id of `-`. For example: - * organizations/{organization_id}/sources/- + * "organizations/[organization_id]/sources/[source_id], + * folders/[folder_id]/sources/[source_id], or + * projects/[project_id]/sources/[source_id]". To list across all sources + * provide a source_id of `-`. For example: + * organizations/{organization_id}/sources/-, folders/{folder_id}/sources/- or + * projects/{projects_id}/sources/- * @param {string} request.filter * Expression that defines the filter to apply across findings. * The expression is a list of one or more restrictions combined via logical @@ -3986,9 +4039,12 @@ export class SecurityCenterClient { * The request object that will be sent. * @param {string} request.parent * Required. Name of the source the findings belong to. Its format is - * "organizations/[organization_id]/sources/[source_id]". To list across all - * sources provide a source_id of `-`. For example: - * organizations/{organization_id}/sources/- + * "organizations/[organization_id]/sources/[source_id], + * folders/[folder_id]/sources/[source_id], or + * projects/[project_id]/sources/[source_id]". To list across all sources + * provide a source_id of `-`. For example: + * organizations/{organization_id}/sources/-, folders/{folder_id}/sources/- or + * projects/{projects_id}/sources/- * @param {string} request.filter * Expression that defines the filter to apply across findings. * The expression is a list of one or more restrictions combined via logical @@ -4146,9 +4202,12 @@ export class SecurityCenterClient { * The request object that will be sent. * @param {string} request.parent * Required. Name of the source the findings belong to. Its format is - * "organizations/[organization_id]/sources/[source_id]". To list across all - * sources provide a source_id of `-`. For example: - * organizations/{organization_id}/sources/- + * "organizations/[organization_id]/sources/[source_id], + * folders/[folder_id]/sources/[source_id], or + * projects/[project_id]/sources/[source_id]". To list across all sources + * provide a source_id of `-`. For example: + * organizations/{organization_id}/sources/-, folders/{folder_id}/sources/- or + * projects/{projects_id}/sources/- * @param {string} request.filter * Expression that defines the filter to apply across findings. * The expression is a list of one or more restrictions combined via logical @@ -4546,8 +4605,9 @@ export class SecurityCenterClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. Resource name of the parent of sources to list. Its format should - * be "organizations/[organization_id]". + * Required. Resource name of the parent of sources to list. Its format should be + * "organizations/[organization_id], folders/[folder_id], or + * projects/[project_id]". * @param {string} request.pageToken * The value returned by the last `ListSourcesResponse`; indicates * that this is a continuation of a prior `ListSources` call, and @@ -4617,8 +4677,9 @@ export class SecurityCenterClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. Resource name of the parent of sources to list. Its format should - * be "organizations/[organization_id]". + * Required. Resource name of the parent of sources to list. Its format should be + * "organizations/[organization_id], folders/[folder_id], or + * projects/[project_id]". * @param {string} request.pageToken * The value returned by the last `ListSourcesResponse`; indicates * that this is a continuation of a prior `ListSources` call, and @@ -4666,8 +4727,9 @@ export class SecurityCenterClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. Resource name of the parent of sources to list. Its format should - * be "organizations/[organization_id]". + * Required. Resource name of the parent of sources to list. Its format should be + * "organizations/[organization_id], folders/[folder_id], or + * projects/[project_id]". * @param {string} request.pageToken * The value returned by the last `ListSourcesResponse`; indicates * that this is a continuation of a prior `ListSources` call, and @@ -4717,89 +4779,245 @@ export class SecurityCenterClient { // -------------------- /** - * Return a fully-qualified asset resource name string. + * Return a fully-qualified folderAsset resource name string. * - * @param {string} organization + * @param {string} folder * @param {string} asset * @returns {string} Resource name string. */ - assetPath(organization: string, asset: string) { - return this.pathTemplates.assetPathTemplate.render({ - organization: organization, + folderAssetPath(folder: string, asset: string) { + return this.pathTemplates.folderAssetPathTemplate.render({ + folder: folder, asset: asset, }); } /** - * Parse the organization from Asset resource. + * Parse the folder from FolderAsset resource. * - * @param {string} assetName - * A fully-qualified path representing Asset resource. - * @returns {string} A string representing the organization. + * @param {string} folderAssetName + * A fully-qualified path representing folder_asset resource. + * @returns {string} A string representing the folder. */ - matchOrganizationFromAssetName(assetName: string) { - return this.pathTemplates.assetPathTemplate.match(assetName).organization; + matchFolderFromFolderAssetName(folderAssetName: string) { + return this.pathTemplates.folderAssetPathTemplate.match(folderAssetName) + .folder; } /** - * Parse the asset from Asset resource. + * Parse the asset from FolderAsset resource. * - * @param {string} assetName - * A fully-qualified path representing Asset resource. + * @param {string} folderAssetName + * A fully-qualified path representing folder_asset resource. * @returns {string} A string representing the asset. */ - matchAssetFromAssetName(assetName: string) { - return this.pathTemplates.assetPathTemplate.match(assetName).asset; + matchAssetFromFolderAssetName(folderAssetName: string) { + return this.pathTemplates.folderAssetPathTemplate.match(folderAssetName) + .asset; } /** - * Return a fully-qualified finding resource name string. + * Return a fully-qualified folderAssetSecurityMarks resource name string. * - * @param {string} organization + * @param {string} folder + * @param {string} asset + * @returns {string} Resource name string. + */ + folderAssetSecurityMarksPath(folder: string, asset: string) { + return this.pathTemplates.folderAssetSecurityMarksPathTemplate.render({ + folder: folder, + asset: asset, + }); + } + + /** + * Parse the folder from FolderAssetSecurityMarks resource. + * + * @param {string} folderAssetSecurityMarksName + * A fully-qualified path representing folder_asset_securityMarks resource. + * @returns {string} A string representing the folder. + */ + matchFolderFromFolderAssetSecurityMarksName( + folderAssetSecurityMarksName: string + ) { + return this.pathTemplates.folderAssetSecurityMarksPathTemplate.match( + folderAssetSecurityMarksName + ).folder; + } + + /** + * Parse the asset from FolderAssetSecurityMarks resource. + * + * @param {string} folderAssetSecurityMarksName + * A fully-qualified path representing folder_asset_securityMarks resource. + * @returns {string} A string representing the asset. + */ + matchAssetFromFolderAssetSecurityMarksName( + folderAssetSecurityMarksName: string + ) { + return this.pathTemplates.folderAssetSecurityMarksPathTemplate.match( + folderAssetSecurityMarksName + ).asset; + } + + /** + * Return a fully-qualified folderSource resource name string. + * + * @param {string} folder + * @param {string} source + * @returns {string} Resource name string. + */ + folderSourcePath(folder: string, source: string) { + return this.pathTemplates.folderSourcePathTemplate.render({ + folder: folder, + source: source, + }); + } + + /** + * Parse the folder from FolderSource resource. + * + * @param {string} folderSourceName + * A fully-qualified path representing folder_source resource. + * @returns {string} A string representing the folder. + */ + matchFolderFromFolderSourceName(folderSourceName: string) { + return this.pathTemplates.folderSourcePathTemplate.match(folderSourceName) + .folder; + } + + /** + * Parse the source from FolderSource resource. + * + * @param {string} folderSourceName + * A fully-qualified path representing folder_source resource. + * @returns {string} A string representing the source. + */ + matchSourceFromFolderSourceName(folderSourceName: string) { + return this.pathTemplates.folderSourcePathTemplate.match(folderSourceName) + .source; + } + + /** + * Return a fully-qualified folderSourceFinding resource name string. + * + * @param {string} folder * @param {string} source * @param {string} finding * @returns {string} Resource name string. */ - findingPath(organization: string, source: string, finding: string) { - return this.pathTemplates.findingPathTemplate.render({ - organization: organization, + folderSourceFindingPath(folder: string, source: string, finding: string) { + return this.pathTemplates.folderSourceFindingPathTemplate.render({ + folder: folder, source: source, finding: finding, }); } /** - * Parse the organization from Finding resource. + * Parse the folder from FolderSourceFinding resource. * - * @param {string} findingName - * A fully-qualified path representing Finding resource. - * @returns {string} A string representing the organization. + * @param {string} folderSourceFindingName + * A fully-qualified path representing folder_source_finding resource. + * @returns {string} A string representing the folder. */ - matchOrganizationFromFindingName(findingName: string) { - return this.pathTemplates.findingPathTemplate.match(findingName) - .organization; + matchFolderFromFolderSourceFindingName(folderSourceFindingName: string) { + return this.pathTemplates.folderSourceFindingPathTemplate.match( + folderSourceFindingName + ).folder; } /** - * Parse the source from Finding resource. + * Parse the source from FolderSourceFinding resource. * - * @param {string} findingName - * A fully-qualified path representing Finding resource. + * @param {string} folderSourceFindingName + * A fully-qualified path representing folder_source_finding resource. * @returns {string} A string representing the source. */ - matchSourceFromFindingName(findingName: string) { - return this.pathTemplates.findingPathTemplate.match(findingName).source; + matchSourceFromFolderSourceFindingName(folderSourceFindingName: string) { + return this.pathTemplates.folderSourceFindingPathTemplate.match( + folderSourceFindingName + ).source; } /** - * Parse the finding from Finding resource. + * Parse the finding from FolderSourceFinding resource. * - * @param {string} findingName - * A fully-qualified path representing Finding resource. + * @param {string} folderSourceFindingName + * A fully-qualified path representing folder_source_finding resource. * @returns {string} A string representing the finding. */ - matchFindingFromFindingName(findingName: string) { - return this.pathTemplates.findingPathTemplate.match(findingName).finding; + matchFindingFromFolderSourceFindingName(folderSourceFindingName: string) { + return this.pathTemplates.folderSourceFindingPathTemplate.match( + folderSourceFindingName + ).finding; + } + + /** + * Return a fully-qualified folderSourceFindingSecurityMarks resource name string. + * + * @param {string} folder + * @param {string} source + * @param {string} finding + * @returns {string} Resource name string. + */ + folderSourceFindingSecurityMarksPath( + folder: string, + source: string, + finding: string + ) { + return this.pathTemplates.folderSourceFindingSecurityMarksPathTemplate.render( + { + folder: folder, + source: source, + finding: finding, + } + ); + } + + /** + * Parse the folder from FolderSourceFindingSecurityMarks resource. + * + * @param {string} folderSourceFindingSecurityMarksName + * A fully-qualified path representing folder_source_finding_securityMarks resource. + * @returns {string} A string representing the folder. + */ + matchFolderFromFolderSourceFindingSecurityMarksName( + folderSourceFindingSecurityMarksName: string + ) { + return this.pathTemplates.folderSourceFindingSecurityMarksPathTemplate.match( + folderSourceFindingSecurityMarksName + ).folder; + } + + /** + * Parse the source from FolderSourceFindingSecurityMarks resource. + * + * @param {string} folderSourceFindingSecurityMarksName + * A fully-qualified path representing folder_source_finding_securityMarks resource. + * @returns {string} A string representing the source. + */ + matchSourceFromFolderSourceFindingSecurityMarksName( + folderSourceFindingSecurityMarksName: string + ) { + return this.pathTemplates.folderSourceFindingSecurityMarksPathTemplate.match( + folderSourceFindingSecurityMarksName + ).source; + } + + /** + * Parse the finding from FolderSourceFindingSecurityMarks resource. + * + * @param {string} folderSourceFindingSecurityMarksName + * A fully-qualified path representing folder_source_finding_securityMarks resource. + * @returns {string} A string representing the finding. + */ + matchFindingFromFolderSourceFindingSecurityMarksName( + folderSourceFindingSecurityMarksName: string + ) { + return this.pathTemplates.folderSourceFindingSecurityMarksPathTemplate.match( + folderSourceFindingSecurityMarksName + ).finding; } /** @@ -4868,6 +5086,46 @@ export class SecurityCenterClient { .organization; } + /** + * Return a fully-qualified organizationAsset resource name string. + * + * @param {string} organization + * @param {string} asset + * @returns {string} Resource name string. + */ + organizationAssetPath(organization: string, asset: string) { + return this.pathTemplates.organizationAssetPathTemplate.render({ + organization: organization, + asset: asset, + }); + } + + /** + * Parse the organization from OrganizationAsset resource. + * + * @param {string} organizationAssetName + * A fully-qualified path representing organization_asset resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationAssetName(organizationAssetName: string) { + return this.pathTemplates.organizationAssetPathTemplate.match( + organizationAssetName + ).organization; + } + + /** + * Parse the asset from OrganizationAsset resource. + * + * @param {string} organizationAssetName + * A fully-qualified path representing organization_asset resource. + * @returns {string} A string representing the asset. + */ + matchAssetFromOrganizationAssetName(organizationAssetName: string) { + return this.pathTemplates.organizationAssetPathTemplate.match( + organizationAssetName + ).asset; + } + /** * Return a fully-qualified organizationAssetSecurityMarks resource name string. * @@ -4941,6 +5199,111 @@ export class SecurityCenterClient { ).organization; } + /** + * Return a fully-qualified organizationSource resource name string. + * + * @param {string} organization + * @param {string} source + * @returns {string} Resource name string. + */ + organizationSourcePath(organization: string, source: string) { + return this.pathTemplates.organizationSourcePathTemplate.render({ + organization: organization, + source: source, + }); + } + + /** + * Parse the organization from OrganizationSource resource. + * + * @param {string} organizationSourceName + * A fully-qualified path representing organization_source resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationSourceName(organizationSourceName: string) { + return this.pathTemplates.organizationSourcePathTemplate.match( + organizationSourceName + ).organization; + } + + /** + * Parse the source from OrganizationSource resource. + * + * @param {string} organizationSourceName + * A fully-qualified path representing organization_source resource. + * @returns {string} A string representing the source. + */ + matchSourceFromOrganizationSourceName(organizationSourceName: string) { + return this.pathTemplates.organizationSourcePathTemplate.match( + organizationSourceName + ).source; + } + + /** + * Return a fully-qualified organizationSourceFinding resource name string. + * + * @param {string} organization + * @param {string} source + * @param {string} finding + * @returns {string} Resource name string. + */ + organizationSourceFindingPath( + organization: string, + source: string, + finding: string + ) { + return this.pathTemplates.organizationSourceFindingPathTemplate.render({ + organization: organization, + source: source, + finding: finding, + }); + } + + /** + * Parse the organization from OrganizationSourceFinding resource. + * + * @param {string} organizationSourceFindingName + * A fully-qualified path representing organization_source_finding resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationSourceFindingName( + organizationSourceFindingName: string + ) { + return this.pathTemplates.organizationSourceFindingPathTemplate.match( + organizationSourceFindingName + ).organization; + } + + /** + * Parse the source from OrganizationSourceFinding resource. + * + * @param {string} organizationSourceFindingName + * A fully-qualified path representing organization_source_finding resource. + * @returns {string} A string representing the source. + */ + matchSourceFromOrganizationSourceFindingName( + organizationSourceFindingName: string + ) { + return this.pathTemplates.organizationSourceFindingPathTemplate.match( + organizationSourceFindingName + ).source; + } + + /** + * Parse the finding from OrganizationSourceFinding resource. + * + * @param {string} organizationSourceFindingName + * A fully-qualified path representing organization_source_finding resource. + * @returns {string} A string representing the finding. + */ + matchFindingFromOrganizationSourceFindingName( + organizationSourceFindingName: string + ) { + return this.pathTemplates.organizationSourceFindingPathTemplate.match( + organizationSourceFindingName + ).finding; + } + /** * Return a fully-qualified organizationSourceFindingSecurityMarks resource name string. * @@ -5009,39 +5372,245 @@ export class SecurityCenterClient { } /** - * Return a fully-qualified source resource name string. + * Return a fully-qualified projectAsset resource name string. * - * @param {string} organization + * @param {string} project + * @param {string} asset + * @returns {string} Resource name string. + */ + projectAssetPath(project: string, asset: string) { + return this.pathTemplates.projectAssetPathTemplate.render({ + project: project, + asset: asset, + }); + } + + /** + * Parse the project from ProjectAsset resource. + * + * @param {string} projectAssetName + * A fully-qualified path representing project_asset resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectAssetName(projectAssetName: string) { + return this.pathTemplates.projectAssetPathTemplate.match(projectAssetName) + .project; + } + + /** + * Parse the asset from ProjectAsset resource. + * + * @param {string} projectAssetName + * A fully-qualified path representing project_asset resource. + * @returns {string} A string representing the asset. + */ + matchAssetFromProjectAssetName(projectAssetName: string) { + return this.pathTemplates.projectAssetPathTemplate.match(projectAssetName) + .asset; + } + + /** + * Return a fully-qualified projectAssetSecurityMarks resource name string. + * + * @param {string} project + * @param {string} asset + * @returns {string} Resource name string. + */ + projectAssetSecurityMarksPath(project: string, asset: string) { + return this.pathTemplates.projectAssetSecurityMarksPathTemplate.render({ + project: project, + asset: asset, + }); + } + + /** + * Parse the project from ProjectAssetSecurityMarks resource. + * + * @param {string} projectAssetSecurityMarksName + * A fully-qualified path representing project_asset_securityMarks resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectAssetSecurityMarksName( + projectAssetSecurityMarksName: string + ) { + return this.pathTemplates.projectAssetSecurityMarksPathTemplate.match( + projectAssetSecurityMarksName + ).project; + } + + /** + * Parse the asset from ProjectAssetSecurityMarks resource. + * + * @param {string} projectAssetSecurityMarksName + * A fully-qualified path representing project_asset_securityMarks resource. + * @returns {string} A string representing the asset. + */ + matchAssetFromProjectAssetSecurityMarksName( + projectAssetSecurityMarksName: string + ) { + return this.pathTemplates.projectAssetSecurityMarksPathTemplate.match( + projectAssetSecurityMarksName + ).asset; + } + + /** + * Return a fully-qualified projectSource resource name string. + * + * @param {string} project * @param {string} source * @returns {string} Resource name string. */ - sourcePath(organization: string, source: string) { - return this.pathTemplates.sourcePathTemplate.render({ - organization: organization, + projectSourcePath(project: string, source: string) { + return this.pathTemplates.projectSourcePathTemplate.render({ + project: project, source: source, }); } /** - * Parse the organization from Source resource. + * Parse the project from ProjectSource resource. * - * @param {string} sourceName - * A fully-qualified path representing Source resource. - * @returns {string} A string representing the organization. + * @param {string} projectSourceName + * A fully-qualified path representing project_source resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectSourceName(projectSourceName: string) { + return this.pathTemplates.projectSourcePathTemplate.match(projectSourceName) + .project; + } + + /** + * Parse the source from ProjectSource resource. + * + * @param {string} projectSourceName + * A fully-qualified path representing project_source resource. + * @returns {string} A string representing the source. + */ + matchSourceFromProjectSourceName(projectSourceName: string) { + return this.pathTemplates.projectSourcePathTemplate.match(projectSourceName) + .source; + } + + /** + * Return a fully-qualified projectSourceFinding resource name string. + * + * @param {string} project + * @param {string} source + * @param {string} finding + * @returns {string} Resource name string. + */ + projectSourceFindingPath(project: string, source: string, finding: string) { + return this.pathTemplates.projectSourceFindingPathTemplate.render({ + project: project, + source: source, + finding: finding, + }); + } + + /** + * Parse the project from ProjectSourceFinding resource. + * + * @param {string} projectSourceFindingName + * A fully-qualified path representing project_source_finding resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectSourceFindingName(projectSourceFindingName: string) { + return this.pathTemplates.projectSourceFindingPathTemplate.match( + projectSourceFindingName + ).project; + } + + /** + * Parse the source from ProjectSourceFinding resource. + * + * @param {string} projectSourceFindingName + * A fully-qualified path representing project_source_finding resource. + * @returns {string} A string representing the source. */ - matchOrganizationFromSourceName(sourceName: string) { - return this.pathTemplates.sourcePathTemplate.match(sourceName).organization; + matchSourceFromProjectSourceFindingName(projectSourceFindingName: string) { + return this.pathTemplates.projectSourceFindingPathTemplate.match( + projectSourceFindingName + ).source; + } + + /** + * Parse the finding from ProjectSourceFinding resource. + * + * @param {string} projectSourceFindingName + * A fully-qualified path representing project_source_finding resource. + * @returns {string} A string representing the finding. + */ + matchFindingFromProjectSourceFindingName(projectSourceFindingName: string) { + return this.pathTemplates.projectSourceFindingPathTemplate.match( + projectSourceFindingName + ).finding; + } + + /** + * Return a fully-qualified projectSourceFindingSecurityMarks resource name string. + * + * @param {string} project + * @param {string} source + * @param {string} finding + * @returns {string} Resource name string. + */ + projectSourceFindingSecurityMarksPath( + project: string, + source: string, + finding: string + ) { + return this.pathTemplates.projectSourceFindingSecurityMarksPathTemplate.render( + { + project: project, + source: source, + finding: finding, + } + ); + } + + /** + * Parse the project from ProjectSourceFindingSecurityMarks resource. + * + * @param {string} projectSourceFindingSecurityMarksName + * A fully-qualified path representing project_source_finding_securityMarks resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectSourceFindingSecurityMarksName( + projectSourceFindingSecurityMarksName: string + ) { + return this.pathTemplates.projectSourceFindingSecurityMarksPathTemplate.match( + projectSourceFindingSecurityMarksName + ).project; } /** - * Parse the source from Source resource. + * Parse the source from ProjectSourceFindingSecurityMarks resource. * - * @param {string} sourceName - * A fully-qualified path representing Source resource. + * @param {string} projectSourceFindingSecurityMarksName + * A fully-qualified path representing project_source_finding_securityMarks resource. * @returns {string} A string representing the source. */ - matchSourceFromSourceName(sourceName: string) { - return this.pathTemplates.sourcePathTemplate.match(sourceName).source; + matchSourceFromProjectSourceFindingSecurityMarksName( + projectSourceFindingSecurityMarksName: string + ) { + return this.pathTemplates.projectSourceFindingSecurityMarksPathTemplate.match( + projectSourceFindingSecurityMarksName + ).source; + } + + /** + * Parse the finding from ProjectSourceFindingSecurityMarks resource. + * + * @param {string} projectSourceFindingSecurityMarksName + * A fully-qualified path representing project_source_finding_securityMarks resource. + * @returns {string} A string representing the finding. + */ + matchFindingFromProjectSourceFindingSecurityMarksName( + projectSourceFindingSecurityMarksName: string + ) { + return this.pathTemplates.projectSourceFindingSecurityMarksPathTemplate.match( + projectSourceFindingSecurityMarksName + ).finding; } /** diff --git a/packages/google-cloud-securitycenter/src/v1/security_center_proto_list.json b/packages/google-cloud-securitycenter/src/v1/security_center_proto_list.json index 7c75af0ed9d..dcf14772dfb 100644 --- a/packages/google-cloud-securitycenter/src/v1/security_center_proto_list.json +++ b/packages/google-cloud-securitycenter/src/v1/security_center_proto_list.json @@ -1,6 +1,7 @@ [ "../../protos/google/cloud/securitycenter/v1/asset.proto", "../../protos/google/cloud/securitycenter/v1/finding.proto", + "../../protos/google/cloud/securitycenter/v1/folder.proto", "../../protos/google/cloud/securitycenter/v1/notification_config.proto", "../../protos/google/cloud/securitycenter/v1/notification_message.proto", "../../protos/google/cloud/securitycenter/v1/organization_settings.proto", diff --git a/packages/google-cloud-securitycenter/test/gapic_security_center_v1.ts b/packages/google-cloud-securitycenter/test/gapic_security_center_v1.ts index 73a8a1594ab..0b3e41f46ca 100644 --- a/packages/google-cloud-securitycenter/test/gapic_security_center_v1.ts +++ b/packages/google-cloud-securitycenter/test/gapic_security_center_v1.ts @@ -4134,10 +4134,10 @@ describe('v1.SecurityCenterClient', () => { }); describe('Path templates', () => { - describe('asset', () => { - const fakePath = '/rendered/path/asset'; + describe('folderAsset', () => { + const fakePath = '/rendered/path/folderAsset'; const expectedParameters = { - organization: 'organizationValue', + folder: 'folderValue', asset: 'assetValue', }; const client = new securitycenterModule.v1.SecurityCenterClient({ @@ -4145,48 +4145,160 @@ describe('v1.SecurityCenterClient', () => { projectId: 'bogus', }); client.initialize(); - client.pathTemplates.assetPathTemplate.render = sinon + client.pathTemplates.folderAssetPathTemplate.render = sinon .stub() .returns(fakePath); - client.pathTemplates.assetPathTemplate.match = sinon + client.pathTemplates.folderAssetPathTemplate.match = sinon .stub() .returns(expectedParameters); - it('assetPath', () => { - const result = client.assetPath('organizationValue', 'assetValue'); + it('folderAssetPath', () => { + const result = client.folderAssetPath('folderValue', 'assetValue'); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.assetPathTemplate.render as SinonStub) + (client.pathTemplates.folderAssetPathTemplate.render as SinonStub) .getCall(-1) .calledWith(expectedParameters) ); }); - it('matchOrganizationFromAssetName', () => { - const result = client.matchOrganizationFromAssetName(fakePath); - assert.strictEqual(result, 'organizationValue'); + it('matchFolderFromFolderAssetName', () => { + const result = client.matchFolderFromFolderAssetName(fakePath); + assert.strictEqual(result, 'folderValue'); assert( - (client.pathTemplates.assetPathTemplate.match as SinonStub) + (client.pathTemplates.folderAssetPathTemplate.match as SinonStub) .getCall(-1) .calledWith(fakePath) ); }); - it('matchAssetFromAssetName', () => { - const result = client.matchAssetFromAssetName(fakePath); + it('matchAssetFromFolderAssetName', () => { + const result = client.matchAssetFromFolderAssetName(fakePath); assert.strictEqual(result, 'assetValue'); assert( - (client.pathTemplates.assetPathTemplate.match as SinonStub) + (client.pathTemplates.folderAssetPathTemplate.match as SinonStub) .getCall(-1) .calledWith(fakePath) ); }); }); - describe('finding', () => { - const fakePath = '/rendered/path/finding'; + describe('folderAssetSecurityMarks', () => { + const fakePath = '/rendered/path/folderAssetSecurityMarks'; const expectedParameters = { - organization: 'organizationValue', + folder: 'folderValue', + asset: 'assetValue', + }; + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.folderAssetSecurityMarksPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.folderAssetSecurityMarksPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('folderAssetSecurityMarksPath', () => { + const result = client.folderAssetSecurityMarksPath( + 'folderValue', + 'assetValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.folderAssetSecurityMarksPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchFolderFromFolderAssetSecurityMarksName', () => { + const result = + client.matchFolderFromFolderAssetSecurityMarksName(fakePath); + assert.strictEqual(result, 'folderValue'); + assert( + ( + client.pathTemplates.folderAssetSecurityMarksPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchAssetFromFolderAssetSecurityMarksName', () => { + const result = + client.matchAssetFromFolderAssetSecurityMarksName(fakePath); + assert.strictEqual(result, 'assetValue'); + assert( + ( + client.pathTemplates.folderAssetSecurityMarksPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('folderSource', () => { + const fakePath = '/rendered/path/folderSource'; + const expectedParameters = { + folder: 'folderValue', + source: 'sourceValue', + }; + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.folderSourcePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.folderSourcePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('folderSourcePath', () => { + const result = client.folderSourcePath('folderValue', 'sourceValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.folderSourcePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchFolderFromFolderSourceName', () => { + const result = client.matchFolderFromFolderSourceName(fakePath); + assert.strictEqual(result, 'folderValue'); + assert( + (client.pathTemplates.folderSourcePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSourceFromFolderSourceName', () => { + const result = client.matchSourceFromFolderSourceName(fakePath); + assert.strictEqual(result, 'sourceValue'); + assert( + (client.pathTemplates.folderSourcePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('folderSourceFinding', () => { + const fakePath = '/rendered/path/folderSourceFinding'; + const expectedParameters = { + folder: 'folderValue', source: 'sourceValue', finding: 'findingValue', }; @@ -4195,52 +4307,141 @@ describe('v1.SecurityCenterClient', () => { projectId: 'bogus', }); client.initialize(); - client.pathTemplates.findingPathTemplate.render = sinon + client.pathTemplates.folderSourceFindingPathTemplate.render = sinon .stub() .returns(fakePath); - client.pathTemplates.findingPathTemplate.match = sinon + client.pathTemplates.folderSourceFindingPathTemplate.match = sinon .stub() .returns(expectedParameters); - it('findingPath', () => { - const result = client.findingPath( - 'organizationValue', + it('folderSourceFindingPath', () => { + const result = client.folderSourceFindingPath( + 'folderValue', 'sourceValue', 'findingValue' ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.findingPathTemplate.render as SinonStub) + ( + client.pathTemplates.folderSourceFindingPathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); }); - it('matchOrganizationFromFindingName', () => { - const result = client.matchOrganizationFromFindingName(fakePath); - assert.strictEqual(result, 'organizationValue'); + it('matchFolderFromFolderSourceFindingName', () => { + const result = client.matchFolderFromFolderSourceFindingName(fakePath); + assert.strictEqual(result, 'folderValue'); + assert( + ( + client.pathTemplates.folderSourceFindingPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSourceFromFolderSourceFindingName', () => { + const result = client.matchSourceFromFolderSourceFindingName(fakePath); + assert.strictEqual(result, 'sourceValue'); + assert( + ( + client.pathTemplates.folderSourceFindingPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchFindingFromFolderSourceFindingName', () => { + const result = client.matchFindingFromFolderSourceFindingName(fakePath); + assert.strictEqual(result, 'findingValue'); + assert( + ( + client.pathTemplates.folderSourceFindingPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('folderSourceFindingSecurityMarks', () => { + const fakePath = '/rendered/path/folderSourceFindingSecurityMarks'; + const expectedParameters = { + folder: 'folderValue', + source: 'sourceValue', + finding: 'findingValue', + }; + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.folderSourceFindingSecurityMarksPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.folderSourceFindingSecurityMarksPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('folderSourceFindingSecurityMarksPath', () => { + const result = client.folderSourceFindingSecurityMarksPath( + 'folderValue', + 'sourceValue', + 'findingValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.folderSourceFindingSecurityMarksPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchFolderFromFolderSourceFindingSecurityMarksName', () => { + const result = + client.matchFolderFromFolderSourceFindingSecurityMarksName(fakePath); + assert.strictEqual(result, 'folderValue'); assert( - (client.pathTemplates.findingPathTemplate.match as SinonStub) + ( + client.pathTemplates.folderSourceFindingSecurityMarksPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); - it('matchSourceFromFindingName', () => { - const result = client.matchSourceFromFindingName(fakePath); + it('matchSourceFromFolderSourceFindingSecurityMarksName', () => { + const result = + client.matchSourceFromFolderSourceFindingSecurityMarksName(fakePath); assert.strictEqual(result, 'sourceValue'); assert( - (client.pathTemplates.findingPathTemplate.match as SinonStub) + ( + client.pathTemplates.folderSourceFindingSecurityMarksPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); - it('matchFindingFromFindingName', () => { - const result = client.matchFindingFromFindingName(fakePath); + it('matchFindingFromFolderSourceFindingSecurityMarksName', () => { + const result = + client.matchFindingFromFolderSourceFindingSecurityMarksName(fakePath); assert.strictEqual(result, 'findingValue'); assert( - (client.pathTemplates.findingPathTemplate.match as SinonStub) + ( + client.pathTemplates.folderSourceFindingSecurityMarksPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -4348,6 +4549,68 @@ describe('v1.SecurityCenterClient', () => { }); }); + describe('organizationAsset', () => { + const fakePath = '/rendered/path/organizationAsset'; + const expectedParameters = { + organization: 'organizationValue', + asset: 'assetValue', + }; + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.organizationAssetPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.organizationAssetPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('organizationAssetPath', () => { + const result = client.organizationAssetPath( + 'organizationValue', + 'assetValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.organizationAssetPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchOrganizationFromOrganizationAssetName', () => { + const result = + client.matchOrganizationFromOrganizationAssetName(fakePath); + assert.strictEqual(result, 'organizationValue'); + assert( + ( + client.pathTemplates.organizationAssetPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchAssetFromOrganizationAssetName', () => { + const result = client.matchAssetFromOrganizationAssetName(fakePath); + assert.strictEqual(result, 'assetValue'); + assert( + ( + client.pathTemplates.organizationAssetPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('organizationAssetSecurityMarks', () => { const fakePath = '/rendered/path/organizationAssetSecurityMarks'; const expectedParameters = { @@ -4456,34 +4719,33 @@ describe('v1.SecurityCenterClient', () => { }); }); - describe('organizationSourceFindingSecurityMarks', () => { - const fakePath = '/rendered/path/organizationSourceFindingSecurityMarks'; + describe('organizationSource', () => { + const fakePath = '/rendered/path/organizationSource'; const expectedParameters = { organization: 'organizationValue', source: 'sourceValue', - finding: 'findingValue', }; const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); - client.pathTemplates.organizationSourceFindingSecurityMarksPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.organizationSourceFindingSecurityMarksPathTemplate.match = - sinon.stub().returns(expectedParameters); + client.pathTemplates.organizationSourcePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.organizationSourcePathTemplate.match = sinon + .stub() + .returns(expectedParameters); - it('organizationSourceFindingSecurityMarksPath', () => { - const result = client.organizationSourceFindingSecurityMarksPath( + it('organizationSourcePath', () => { + const result = client.organizationSourcePath( 'organizationValue', - 'sourceValue', - 'findingValue' + 'sourceValue' ); assert.strictEqual(result, fakePath); assert( ( - client.pathTemplates - .organizationSourceFindingSecurityMarksPathTemplate + client.pathTemplates.organizationSourcePathTemplate .render as SinonStub ) .getCall(-1) @@ -4491,16 +4753,13 @@ describe('v1.SecurityCenterClient', () => { ); }); - it('matchOrganizationFromOrganizationSourceFindingSecurityMarksName', () => { + it('matchOrganizationFromOrganizationSourceName', () => { const result = - client.matchOrganizationFromOrganizationSourceFindingSecurityMarksName( - fakePath - ); + client.matchOrganizationFromOrganizationSourceName(fakePath); assert.strictEqual(result, 'organizationValue'); assert( ( - client.pathTemplates - .organizationSourceFindingSecurityMarksPathTemplate + client.pathTemplates.organizationSourcePathTemplate .match as SinonStub ) .getCall(-1) @@ -4508,33 +4767,12 @@ describe('v1.SecurityCenterClient', () => { ); }); - it('matchSourceFromOrganizationSourceFindingSecurityMarksName', () => { - const result = - client.matchSourceFromOrganizationSourceFindingSecurityMarksName( - fakePath - ); + it('matchSourceFromOrganizationSourceName', () => { + const result = client.matchSourceFromOrganizationSourceName(fakePath); assert.strictEqual(result, 'sourceValue'); assert( ( - client.pathTemplates - .organizationSourceFindingSecurityMarksPathTemplate - .match as SinonStub - ) - .getCall(-1) - .calledWith(fakePath) - ); - }); - - it('matchFindingFromOrganizationSourceFindingSecurityMarksName', () => { - const result = - client.matchFindingFromOrganizationSourceFindingSecurityMarksName( - fakePath - ); - assert.strictEqual(result, 'findingValue'); - assert( - ( - client.pathTemplates - .organizationSourceFindingSecurityMarksPathTemplate + client.pathTemplates.organizationSourcePathTemplate .match as SinonStub ) .getCall(-1) @@ -4543,49 +4781,486 @@ describe('v1.SecurityCenterClient', () => { }); }); - describe('source', () => { - const fakePath = '/rendered/path/source'; + describe('organizationSourceFinding', () => { + const fakePath = '/rendered/path/organizationSourceFinding'; const expectedParameters = { organization: 'organizationValue', source: 'sourceValue', + finding: 'findingValue', }; const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); - client.pathTemplates.sourcePathTemplate.render = sinon + client.pathTemplates.organizationSourceFindingPathTemplate.render = sinon .stub() .returns(fakePath); - client.pathTemplates.sourcePathTemplate.match = sinon + client.pathTemplates.organizationSourceFindingPathTemplate.match = sinon .stub() .returns(expectedParameters); - it('sourcePath', () => { - const result = client.sourcePath('organizationValue', 'sourceValue'); - assert.strictEqual(result, fakePath); - assert( - (client.pathTemplates.sourcePathTemplate.render as SinonStub) - .getCall(-1) + it('organizationSourceFindingPath', () => { + const result = client.organizationSourceFindingPath( + 'organizationValue', + 'sourceValue', + 'findingValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.organizationSourceFindingPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchOrganizationFromOrganizationSourceFindingName', () => { + const result = + client.matchOrganizationFromOrganizationSourceFindingName(fakePath); + assert.strictEqual(result, 'organizationValue'); + assert( + ( + client.pathTemplates.organizationSourceFindingPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSourceFromOrganizationSourceFindingName', () => { + const result = + client.matchSourceFromOrganizationSourceFindingName(fakePath); + assert.strictEqual(result, 'sourceValue'); + assert( + ( + client.pathTemplates.organizationSourceFindingPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchFindingFromOrganizationSourceFindingName', () => { + const result = + client.matchFindingFromOrganizationSourceFindingName(fakePath); + assert.strictEqual(result, 'findingValue'); + assert( + ( + client.pathTemplates.organizationSourceFindingPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('organizationSourceFindingSecurityMarks', () => { + const fakePath = '/rendered/path/organizationSourceFindingSecurityMarks'; + const expectedParameters = { + organization: 'organizationValue', + source: 'sourceValue', + finding: 'findingValue', + }; + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.organizationSourceFindingSecurityMarksPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationSourceFindingSecurityMarksPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('organizationSourceFindingSecurityMarksPath', () => { + const result = client.organizationSourceFindingSecurityMarksPath( + 'organizationValue', + 'sourceValue', + 'findingValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .organizationSourceFindingSecurityMarksPathTemplate + .render as SinonStub + ) + .getCall(-1) .calledWith(expectedParameters) ); }); - it('matchOrganizationFromSourceName', () => { - const result = client.matchOrganizationFromSourceName(fakePath); + it('matchOrganizationFromOrganizationSourceFindingSecurityMarksName', () => { + const result = + client.matchOrganizationFromOrganizationSourceFindingSecurityMarksName( + fakePath + ); assert.strictEqual(result, 'organizationValue'); assert( - (client.pathTemplates.sourcePathTemplate.match as SinonStub) + ( + client.pathTemplates + .organizationSourceFindingSecurityMarksPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSourceFromOrganizationSourceFindingSecurityMarksName', () => { + const result = + client.matchSourceFromOrganizationSourceFindingSecurityMarksName( + fakePath + ); + assert.strictEqual(result, 'sourceValue'); + assert( + ( + client.pathTemplates + .organizationSourceFindingSecurityMarksPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchFindingFromOrganizationSourceFindingSecurityMarksName', () => { + const result = + client.matchFindingFromOrganizationSourceFindingSecurityMarksName( + fakePath + ); + assert.strictEqual(result, 'findingValue'); + assert( + ( + client.pathTemplates + .organizationSourceFindingSecurityMarksPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectAsset', () => { + const fakePath = '/rendered/path/projectAsset'; + const expectedParameters = { + project: 'projectValue', + asset: 'assetValue', + }; + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectAssetPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectAssetPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectAssetPath', () => { + const result = client.projectAssetPath('projectValue', 'assetValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectAssetPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectAssetName', () => { + const result = client.matchProjectFromProjectAssetName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectAssetPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchAssetFromProjectAssetName', () => { + const result = client.matchAssetFromProjectAssetName(fakePath); + assert.strictEqual(result, 'assetValue'); + assert( + (client.pathTemplates.projectAssetPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectAssetSecurityMarks', () => { + const fakePath = '/rendered/path/projectAssetSecurityMarks'; + const expectedParameters = { + project: 'projectValue', + asset: 'assetValue', + }; + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectAssetSecurityMarksPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectAssetSecurityMarksPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectAssetSecurityMarksPath', () => { + const result = client.projectAssetSecurityMarksPath( + 'projectValue', + 'assetValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectAssetSecurityMarksPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectAssetSecurityMarksName', () => { + const result = + client.matchProjectFromProjectAssetSecurityMarksName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectAssetSecurityMarksPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchAssetFromProjectAssetSecurityMarksName', () => { + const result = + client.matchAssetFromProjectAssetSecurityMarksName(fakePath); + assert.strictEqual(result, 'assetValue'); + assert( + ( + client.pathTemplates.projectAssetSecurityMarksPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectSource', () => { + const fakePath = '/rendered/path/projectSource'; + const expectedParameters = { + project: 'projectValue', + source: 'sourceValue', + }; + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectSourcePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectSourcePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectSourcePath', () => { + const result = client.projectSourcePath('projectValue', 'sourceValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectSourcePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectSourceName', () => { + const result = client.matchProjectFromProjectSourceName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectSourcePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSourceFromProjectSourceName', () => { + const result = client.matchSourceFromProjectSourceName(fakePath); + assert.strictEqual(result, 'sourceValue'); + assert( + (client.pathTemplates.projectSourcePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectSourceFinding', () => { + const fakePath = '/rendered/path/projectSourceFinding'; + const expectedParameters = { + project: 'projectValue', + source: 'sourceValue', + finding: 'findingValue', + }; + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectSourceFindingPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectSourceFindingPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectSourceFindingPath', () => { + const result = client.projectSourceFindingPath( + 'projectValue', + 'sourceValue', + 'findingValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectSourceFindingPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectSourceFindingName', () => { + const result = + client.matchProjectFromProjectSourceFindingName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectSourceFindingPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSourceFromProjectSourceFindingName', () => { + const result = client.matchSourceFromProjectSourceFindingName(fakePath); + assert.strictEqual(result, 'sourceValue'); + assert( + ( + client.pathTemplates.projectSourceFindingPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchFindingFromProjectSourceFindingName', () => { + const result = + client.matchFindingFromProjectSourceFindingName(fakePath); + assert.strictEqual(result, 'findingValue'); + assert( + ( + client.pathTemplates.projectSourceFindingPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectSourceFindingSecurityMarks', () => { + const fakePath = '/rendered/path/projectSourceFindingSecurityMarks'; + const expectedParameters = { + project: 'projectValue', + source: 'sourceValue', + finding: 'findingValue', + }; + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectSourceFindingSecurityMarksPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectSourceFindingSecurityMarksPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectSourceFindingSecurityMarksPath', () => { + const result = client.projectSourceFindingSecurityMarksPath( + 'projectValue', + 'sourceValue', + 'findingValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectSourceFindingSecurityMarksPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectSourceFindingSecurityMarksName', () => { + const result = + client.matchProjectFromProjectSourceFindingSecurityMarksName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectSourceFindingSecurityMarksPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); - it('matchSourceFromSourceName', () => { - const result = client.matchSourceFromSourceName(fakePath); + it('matchSourceFromProjectSourceFindingSecurityMarksName', () => { + const result = + client.matchSourceFromProjectSourceFindingSecurityMarksName(fakePath); assert.strictEqual(result, 'sourceValue'); assert( - (client.pathTemplates.sourcePathTemplate.match as SinonStub) + ( + client.pathTemplates.projectSourceFindingSecurityMarksPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchFindingFromProjectSourceFindingSecurityMarksName', () => { + const result = + client.matchFindingFromProjectSourceFindingSecurityMarksName( + fakePath + ); + assert.strictEqual(result, 'findingValue'); + assert( + ( + client.pathTemplates.projectSourceFindingSecurityMarksPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); From dfb266c962e7a83824e9e6bb8334569dbf996424 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Thu, 13 May 2021 10:34:31 -0700 Subject: [PATCH 250/342] chore: release 5.3.0 (#381) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore: release 5.3.0 * 🦉 Updates from OwlBot * 🦉 Updates from OwlBot * 🦉 Updates from OwlBot Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> Co-authored-by: Owl Bot --- packages/google-cloud-securitycenter/CHANGELOG.md | 14 ++++++++++++++ packages/google-cloud-securitycenter/package.json | 2 +- .../samples/package.json | 2 +- packages/google-cloud-securitycenter/src/index.ts | 6 +++--- 4 files changed, 19 insertions(+), 5 deletions(-) diff --git a/packages/google-cloud-securitycenter/CHANGELOG.md b/packages/google-cloud-securitycenter/CHANGELOG.md index d7e4f7f1a13..023b85844b5 100644 --- a/packages/google-cloud-securitycenter/CHANGELOG.md +++ b/packages/google-cloud-securitycenter/CHANGELOG.md @@ -4,6 +4,20 @@ [1]: https://www.npmjs.com/package/@google-cloud/security-center?activeTab=versions +## [5.3.0](https://www.github.com/googleapis/nodejs-security-center/compare/v5.2.0...v5.3.0) (2021-05-12) + + +### Features + +* **v1:** add canonical_name and folder fields ([#379](https://www.github.com/googleapis/nodejs-security-center/issues/379)) ([239901b](https://www.github.com/googleapis/nodejs-security-center/commit/239901ba42e5973024c86728013354cd4731a0ee)) +* **v1p1beta1:** add canonical_name and folder fields ([#378](https://www.github.com/googleapis/nodejs-security-center/issues/378)) ([5354f52](https://www.github.com/googleapis/nodejs-security-center/commit/5354f52df024d465b224c9db20e0c9cd9586060b)) + + +### Bug Fixes + +* **deps:** require google-gax v2.12.0 ([#373](https://www.github.com/googleapis/nodejs-security-center/issues/373)) ([c13a77a](https://www.github.com/googleapis/nodejs-security-center/commit/c13a77aa4340e63cc4c32b01463c2a761bef2f1f)) +* use require() to load JSON protos ([#376](https://www.github.com/googleapis/nodejs-security-center/issues/376)) ([efac58d](https://www.github.com/googleapis/nodejs-security-center/commit/efac58d6a49a68598703e8b7a7c7c235894c525f)) + ## [5.2.0](https://www.github.com/googleapis/nodejs-security-center/compare/v5.1.3...v5.2.0) (2021-01-07) diff --git a/packages/google-cloud-securitycenter/package.json b/packages/google-cloud-securitycenter/package.json index a16f152c14a..d84f2111408 100644 --- a/packages/google-cloud-securitycenter/package.json +++ b/packages/google-cloud-securitycenter/package.json @@ -1,7 +1,7 @@ { "name": "@google-cloud/security-center", "description": "Cloud Security Command Center API client for Node.js", - "version": "5.2.0", + "version": "5.3.0", "license": "Apache-2.0", "author": "Google LLC", "engines": { diff --git a/packages/google-cloud-securitycenter/samples/package.json b/packages/google-cloud-securitycenter/samples/package.json index a911d1d1ec7..f0b88d10eef 100644 --- a/packages/google-cloud-securitycenter/samples/package.json +++ b/packages/google-cloud-securitycenter/samples/package.json @@ -14,7 +14,7 @@ "license": "Apache-2.0", "dependencies": { "@google-cloud/pubsub": "^2.0.0", - "@google-cloud/security-center": "^5.2.0" + "@google-cloud/security-center": "^5.3.0" }, "devDependencies": { "chai": "^4.2.0", diff --git a/packages/google-cloud-securitycenter/src/index.ts b/packages/google-cloud-securitycenter/src/index.ts index c05c520cf5f..f0712e1a2de 100644 --- a/packages/google-cloud-securitycenter/src/index.ts +++ b/packages/google-cloud-securitycenter/src/index.ts @@ -16,14 +16,14 @@ // ** https://github.com/googleapis/synthtool ** // ** All changes to this file may be overwritten. ** -import * as v1beta1 from './v1beta1'; import * as v1p1beta1 from './v1p1beta1'; +import * as v1beta1 from './v1beta1'; import * as v1 from './v1'; const SecurityCenterClient = v1.SecurityCenterClient; type SecurityCenterClient = v1.SecurityCenterClient; -export {v1beta1, v1p1beta1, v1, SecurityCenterClient}; -export default {v1beta1, v1p1beta1, v1, SecurityCenterClient}; +export {v1p1beta1, v1beta1, v1, SecurityCenterClient}; +export default {v1p1beta1, v1beta1, v1, SecurityCenterClient}; import * as protos from '../protos/protos'; export {protos}; From 8514e01deee70cd6bb4f664e88dcbaf75808d565 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Wed, 19 May 2021 20:32:13 +0000 Subject: [PATCH 251/342] chore: new owl bot post processor docker image (#382) gcr.io/repo-automation-bots/owlbot-nodejs:latest@sha256:f4734af778c3d0eb58a6db0078907a87f2e53f3c7a6422363fc37ee52e02b25a --- packages/google-cloud-securitycenter/src/index.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/google-cloud-securitycenter/src/index.ts b/packages/google-cloud-securitycenter/src/index.ts index f0712e1a2de..c05c520cf5f 100644 --- a/packages/google-cloud-securitycenter/src/index.ts +++ b/packages/google-cloud-securitycenter/src/index.ts @@ -16,14 +16,14 @@ // ** https://github.com/googleapis/synthtool ** // ** All changes to this file may be overwritten. ** -import * as v1p1beta1 from './v1p1beta1'; import * as v1beta1 from './v1beta1'; +import * as v1p1beta1 from './v1p1beta1'; import * as v1 from './v1'; const SecurityCenterClient = v1.SecurityCenterClient; type SecurityCenterClient = v1.SecurityCenterClient; -export {v1p1beta1, v1beta1, v1, SecurityCenterClient}; -export default {v1p1beta1, v1beta1, v1, SecurityCenterClient}; +export {v1beta1, v1p1beta1, v1, SecurityCenterClient}; +export default {v1beta1, v1p1beta1, v1, SecurityCenterClient}; import * as protos from '../protos/protos'; export {protos}; From 8c5d6b87aa6a87cab1431ad942190b86086ccaee Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 21 May 2021 19:06:16 +0200 Subject: [PATCH 252/342] chore(deps): update dependency @types/node to v14 (#383) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [@types/node](https://togithub.com/DefinitelyTyped/DefinitelyTyped) | [`^12.0.0` -> `^14.0.0`](https://renovatebot.com/diffs/npm/@types%2fnode/12.20.13/14.17.0) | [![age](https://badges.renovateapi.com/packages/npm/@types%2fnode/14.17.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/@types%2fnode/14.17.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/@types%2fnode/14.17.0/compatibility-slim/12.20.13)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/@types%2fnode/14.17.0/confidence-slim/12.20.13)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration 📅 **Schedule**: "after 9am and before 3pm" (UTC). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻️ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/nodejs-security-center). --- packages/google-cloud-securitycenter/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-securitycenter/package.json b/packages/google-cloud-securitycenter/package.json index d84f2111408..7a092e75803 100644 --- a/packages/google-cloud-securitycenter/package.json +++ b/packages/google-cloud-securitycenter/package.json @@ -48,7 +48,7 @@ }, "devDependencies": { "@types/mocha": "^8.0.0", - "@types/node": "^12.0.0", + "@types/node": "^14.0.0", "@types/sinon": "^10.0.0", "c8": "^7.0.0", "gts": "^3.0.0", From e9c0d9680c2dc55e4d8202125705ea337a766bd4 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 25 May 2021 17:58:34 +0200 Subject: [PATCH 253/342] chore(deps): update dependency sinon to v11 (#384) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [sinon](https://sinonjs.org/) ([source](https://togithub.com/sinonjs/sinon)) | [`^10.0.0` -> `^11.0.0`](https://renovatebot.com/diffs/npm/sinon/10.0.0/11.1.0) | [![age](https://badges.renovateapi.com/packages/npm/sinon/11.1.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/sinon/11.1.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/sinon/11.1.0/compatibility-slim/10.0.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/sinon/11.1.0/confidence-slim/10.0.0)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
sinonjs/sinon ### [`v11.1.0`](https://togithub.com/sinonjs/sinon/blob/master/CHANGELOG.md#​1110--2021-05-25) [Compare Source](https://togithub.com/sinonjs/sinon/compare/v11.0.0...31be9a5d5a4762ef01cb195f29024616dfee9ce8) \================== - Add sinon.promise() implementation ([#​2369](https://togithub.com/sinonjs/sinon/issues/2369)) - Set wrappedMethod on getters/setters ([#​2378](https://togithub.com/sinonjs/sinon/issues/2378)) - \[Docs] Update fake-server usage & descriptions ([#​2365](https://togithub.com/sinonjs/sinon/issues/2365)) - Fake docs improvement ([#​2360](https://togithub.com/sinonjs/sinon/issues/2360)) - Update nise to 5.1.0 (fixed [#​2318](https://togithub.com/sinonjs/sinon/issues/2318)) ### [`v11.0.0`](https://togithub.com/sinonjs/sinon/blob/master/CHANGELOG.md#​1100--2021-05-24) [Compare Source](https://togithub.com/sinonjs/sinon/compare/v10.0.1...v11.0.0) \================== - Explicitly use samsam 6.0.2 with fix for [#​2345](https://togithub.com/sinonjs/sinon/issues/2345) - Update most packages ([#​2371](https://togithub.com/sinonjs/sinon/issues/2371)) - Update compatibility docs ([#​2366](https://togithub.com/sinonjs/sinon/issues/2366)) - Update packages (includes breaking fake-timers change, see [#​2352](https://togithub.com/sinonjs/sinon/issues/2352)) - Warn of potential memory leaks ([#​2357](https://togithub.com/sinonjs/sinon/issues/2357)) - Fix clock test errors ### [`v10.0.1`](https://togithub.com/sinonjs/sinon/blob/master/CHANGELOG.md#​1001--2021-04-08) [Compare Source](https://togithub.com/sinonjs/sinon/compare/v10.0.0...v10.0.1) \================== - Upgrade sinon components (bumps y18n to 4.0.1) - Bump y18n from 4.0.0 to 4.0.1
--- ### Configuration 📅 **Schedule**: "after 9am and before 3pm" (UTC). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻️ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/nodejs-security-center). --- packages/google-cloud-securitycenter/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-securitycenter/package.json b/packages/google-cloud-securitycenter/package.json index 7a092e75803..ca5e3f8c8f8 100644 --- a/packages/google-cloud-securitycenter/package.json +++ b/packages/google-cloud-securitycenter/package.json @@ -59,7 +59,7 @@ "mocha": "^8.0.0", "null-loader": "^4.0.0", "pack-n-play": "^1.0.0-2", - "sinon": "^10.0.0", + "sinon": "^11.0.0", "ts-loader": "^8.0.0", "typescript": "^3.8.3", "@microsoft/api-documenter": "^7.8.10", From 2af0139aab895f5fb139fcebc3a0f5921760d09a Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Tue, 25 May 2021 20:48:34 +0000 Subject: [PATCH 254/342] fix: GoogleAdsError missing using generator version after 1.3.0 (#385) [PR](https://github.com/googleapis/gapic-generator-typescript/pull/878) within updated gapic-generator-typescript version 1.4.0 Committer: @summer-ji-eng PiperOrigin-RevId: 375759421 Source-Link: https://github.com/googleapis/googleapis/commit/95fa72fdd0d69b02d72c33b37d1e4cc66d4b1446 Source-Link: https://github.com/googleapis/googleapis-gen/commit/f40a34377ad488a7c2bc3992b3c8d5faf5a15c46 --- .../src/v1/security_center_client.ts | 2 ++ .../src/v1beta1/security_center_client.ts | 2 ++ .../src/v1p1beta1/security_center_client.ts | 2 ++ 3 files changed, 6 insertions(+) diff --git a/packages/google-cloud-securitycenter/src/v1/security_center_client.ts b/packages/google-cloud-securitycenter/src/v1/security_center_client.ts index 69f7c815b9b..80c8bf1a692 100644 --- a/packages/google-cloud-securitycenter/src/v1/security_center_client.ts +++ b/packages/google-cloud-securitycenter/src/v1/security_center_client.ts @@ -142,6 +142,8 @@ export class SecurityCenterClient { } 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}`); diff --git a/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.ts b/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.ts index 71a07a887d3..b4ae49a173f 100644 --- a/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.ts +++ b/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.ts @@ -142,6 +142,8 @@ export class SecurityCenterClient { } 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}`); diff --git a/packages/google-cloud-securitycenter/src/v1p1beta1/security_center_client.ts b/packages/google-cloud-securitycenter/src/v1p1beta1/security_center_client.ts index e7253d82034..eb0fc5206d7 100644 --- a/packages/google-cloud-securitycenter/src/v1p1beta1/security_center_client.ts +++ b/packages/google-cloud-securitycenter/src/v1p1beta1/security_center_client.ts @@ -142,6 +142,8 @@ export class SecurityCenterClient { } 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}`); From bbea254ac2751794376c5d61c57bc52f676095cb Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 25 May 2021 18:23:02 -0400 Subject: [PATCH 255/342] chore: release 5.3.1 (#386) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- packages/google-cloud-securitycenter/CHANGELOG.md | 7 +++++++ packages/google-cloud-securitycenter/package.json | 2 +- packages/google-cloud-securitycenter/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-securitycenter/CHANGELOG.md b/packages/google-cloud-securitycenter/CHANGELOG.md index 023b85844b5..a5894e520f0 100644 --- a/packages/google-cloud-securitycenter/CHANGELOG.md +++ b/packages/google-cloud-securitycenter/CHANGELOG.md @@ -4,6 +4,13 @@ [1]: https://www.npmjs.com/package/@google-cloud/security-center?activeTab=versions +### [5.3.1](https://www.github.com/googleapis/nodejs-security-center/compare/v5.3.0...v5.3.1) (2021-05-25) + + +### Bug Fixes + +* GoogleAdsError missing using generator version after 1.3.0 ([#385](https://www.github.com/googleapis/nodejs-security-center/issues/385)) ([7faea1b](https://www.github.com/googleapis/nodejs-security-center/commit/7faea1b6670b96cf26d9bbc6d18a58b868627c60)) + ## [5.3.0](https://www.github.com/googleapis/nodejs-security-center/compare/v5.2.0...v5.3.0) (2021-05-12) diff --git a/packages/google-cloud-securitycenter/package.json b/packages/google-cloud-securitycenter/package.json index ca5e3f8c8f8..22949832b79 100644 --- a/packages/google-cloud-securitycenter/package.json +++ b/packages/google-cloud-securitycenter/package.json @@ -1,7 +1,7 @@ { "name": "@google-cloud/security-center", "description": "Cloud Security Command Center API client for Node.js", - "version": "5.3.0", + "version": "5.3.1", "license": "Apache-2.0", "author": "Google LLC", "engines": { diff --git a/packages/google-cloud-securitycenter/samples/package.json b/packages/google-cloud-securitycenter/samples/package.json index f0b88d10eef..c3deaed11ab 100644 --- a/packages/google-cloud-securitycenter/samples/package.json +++ b/packages/google-cloud-securitycenter/samples/package.json @@ -14,7 +14,7 @@ "license": "Apache-2.0", "dependencies": { "@google-cloud/pubsub": "^2.0.0", - "@google-cloud/security-center": "^5.3.0" + "@google-cloud/security-center": "^5.3.1" }, "devDependencies": { "chai": "^4.2.0", From 6ca4b8fa9fe411cd9e84bb6aa21897bb402a16aa Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Sat, 29 May 2021 20:54:07 +0000 Subject: [PATCH 256/342] chore: make generate_index_ts() deterministic (#388) Fixes https://github.com/googleapis/synthtool/issues/1103 Source-Link: https://github.com/googleapis/synthtool/commit/c3e41da0fa256ad7f6b4bc76b9d069dedecdfef4 Post-Processor: gcr.io/repo-automation-bots/owlbot-nodejs:latest@sha256:e37a815333a6f3e14d8532efe90cba8aa0d34210f8c0fdbdd9e6a34dcbe51e96 --- packages/google-cloud-securitycenter/src/index.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/google-cloud-securitycenter/src/index.ts b/packages/google-cloud-securitycenter/src/index.ts index c05c520cf5f..2f1843814ee 100644 --- a/packages/google-cloud-securitycenter/src/index.ts +++ b/packages/google-cloud-securitycenter/src/index.ts @@ -16,14 +16,14 @@ // ** https://github.com/googleapis/synthtool ** // ** All changes to this file may be overwritten. ** +import * as v1 from './v1'; import * as v1beta1 from './v1beta1'; import * as v1p1beta1 from './v1p1beta1'; -import * as v1 from './v1'; const SecurityCenterClient = v1.SecurityCenterClient; type SecurityCenterClient = v1.SecurityCenterClient; -export {v1beta1, v1p1beta1, v1, SecurityCenterClient}; -export default {v1beta1, v1p1beta1, v1, SecurityCenterClient}; +export {v1, v1beta1, v1p1beta1, SecurityCenterClient}; +export default {v1, v1beta1, v1p1beta1, SecurityCenterClient}; import * as protos from '../protos/protos'; export {protos}; From e8ca754f80b23d8df577d2646a5dfd93f22634c4 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Wed, 9 Jun 2021 10:46:53 -0500 Subject: [PATCH 257/342] docs: update currently supported Finding filter fields (#391) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * docs: update currently supported Finding filter fields. PiperOrigin-RevId: 378264900 Source-Link: https://github.com/googleapis/googleapis/commit/020ba74ce6eab75b754f7f885a0096722bed57c1 Source-Link: https://github.com/googleapis/googleapis-gen/commit/b1413c12175a7c512a37077f2f9941b7c598a58e * 🦉 Updates from OwlBot Co-authored-by: Owl Bot --- .../v1/securitycenter_service.proto | 168 ++++++++------ .../src/v1/security_center_client.ts | 218 +++++++++++------- 2 files changed, 235 insertions(+), 151 deletions(-) diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/securitycenter_service.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/securitycenter_service.proto index 2a23a2439a9..af4b5fd31f2 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/securitycenter_service.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/securitycenter_service.proto @@ -17,6 +17,7 @@ syntax = "proto3"; package google.cloud.securitycenter.v1; import public "google/cloud/securitycenter/v1/run_asset_discovery_response.proto"; + import "google/api/annotations.proto"; import "google/api/client.proto"; import "google/api/field_behavior.proto"; @@ -47,7 +48,8 @@ option ruby_package = "Google::Cloud::SecurityCenter::V1"; // V1 APIs for Security Center service. service SecurityCenter { option (google.api.default_host) = "securitycenter.googleapis.com"; - option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; // Creates a source. rpc CreateSource(CreateSourceRequest) returns (Source) { @@ -69,17 +71,20 @@ service SecurityCenter { } // Creates a notification config. - rpc CreateNotificationConfig(CreateNotificationConfigRequest) returns (NotificationConfig) { + rpc CreateNotificationConfig(CreateNotificationConfigRequest) + returns (NotificationConfig) { option (google.api.http) = { post: "/v1/{parent=organizations/*}/notificationConfigs" body: "notification_config" }; - option (google.api.method_signature) = "parent,config_id,notification_config"; + option (google.api.method_signature) = + "parent,config_id,notification_config"; option (google.api.method_signature) = "parent,notification_config"; } // Deletes a notification config. - rpc DeleteNotificationConfig(DeleteNotificationConfigRequest) returns (google.protobuf.Empty) { + rpc DeleteNotificationConfig(DeleteNotificationConfigRequest) + returns (google.protobuf.Empty) { option (google.api.http) = { delete: "/v1/{name=organizations/*/notificationConfigs/*}" }; @@ -87,7 +92,8 @@ service SecurityCenter { } // Gets the access control policy on the specified Source. - rpc GetIamPolicy(google.iam.v1.GetIamPolicyRequest) returns (google.iam.v1.Policy) { + rpc GetIamPolicy(google.iam.v1.GetIamPolicyRequest) + returns (google.iam.v1.Policy) { option (google.api.http) = { post: "/v1/{resource=organizations/*/sources/*}:getIamPolicy" body: "*" @@ -96,7 +102,8 @@ service SecurityCenter { } // Gets a notification config. - rpc GetNotificationConfig(GetNotificationConfigRequest) returns (NotificationConfig) { + rpc GetNotificationConfig(GetNotificationConfigRequest) + returns (NotificationConfig) { option (google.api.http) = { get: "/v1/{name=organizations/*/notificationConfigs/*}" }; @@ -104,7 +111,8 @@ service SecurityCenter { } // Gets the settings for an organization. - rpc GetOrganizationSettings(GetOrganizationSettingsRequest) returns (OrganizationSettings) { + rpc GetOrganizationSettings(GetOrganizationSettingsRequest) + returns (OrganizationSettings) { option (google.api.http) = { get: "/v1/{name=organizations/*/organizationSettings}" }; @@ -163,12 +171,8 @@ service SecurityCenter { rpc ListAssets(ListAssetsRequest) returns (ListAssetsResponse) { option (google.api.http) = { get: "/v1/{parent=organizations/*}/assets" - additional_bindings { - get: "/v1/{parent=folders/*}/assets" - } - additional_bindings { - get: "/v1/{parent=projects/*}/assets" - } + additional_bindings { get: "/v1/{parent=folders/*}/assets" } + additional_bindings { get: "/v1/{parent=projects/*}/assets" } }; } @@ -179,17 +183,14 @@ service SecurityCenter { rpc ListFindings(ListFindingsRequest) returns (ListFindingsResponse) { option (google.api.http) = { get: "/v1/{parent=organizations/*/sources/*}/findings" - additional_bindings { - get: "/v1/{parent=folders/*/sources/*}/findings" - } - additional_bindings { - get: "/v1/{parent=projects/*/sources/*}/findings" - } + additional_bindings { get: "/v1/{parent=folders/*/sources/*}/findings" } + additional_bindings { get: "/v1/{parent=projects/*/sources/*}/findings" } }; } // Lists notification configs. - rpc ListNotificationConfigs(ListNotificationConfigsRequest) returns (ListNotificationConfigsResponse) { + rpc ListNotificationConfigs(ListNotificationConfigsRequest) + returns (ListNotificationConfigsResponse) { option (google.api.http) = { get: "/v1/{parent=organizations/*}/notificationConfigs" }; @@ -200,12 +201,8 @@ service SecurityCenter { rpc ListSources(ListSourcesRequest) returns (ListSourcesResponse) { option (google.api.http) = { get: "/v1/{parent=organizations/*}/sources" - additional_bindings { - get: "/v1/{parent=folders/*}/sources" - } - additional_bindings { - get: "/v1/{parent=projects/*}/sources" - } + additional_bindings { get: "/v1/{parent=folders/*}/sources" } + additional_bindings { get: "/v1/{parent=projects/*}/sources" } }; option (google.api.method_signature) = "parent"; } @@ -216,7 +213,8 @@ service SecurityCenter { // This API can only be called with limited frequency for an organization. If // it is called too frequently the caller will receive a TOO_MANY_REQUESTS // error. - rpc RunAssetDiscovery(RunAssetDiscoveryRequest) returns (google.longrunning.Operation) { + rpc RunAssetDiscovery(RunAssetDiscoveryRequest) + returns (google.longrunning.Operation) { option (google.api.http) = { post: "/v1/{parent=organizations/*}/assets:runDiscovery" body: "*" @@ -246,7 +244,8 @@ service SecurityCenter { } // Sets the access control policy on the specified Source. - rpc SetIamPolicy(google.iam.v1.SetIamPolicyRequest) returns (google.iam.v1.Policy) { + rpc SetIamPolicy(google.iam.v1.SetIamPolicyRequest) + returns (google.iam.v1.Policy) { option (google.api.http) = { post: "/v1/{resource=organizations/*/sources/*}:setIamPolicy" body: "*" @@ -255,7 +254,8 @@ service SecurityCenter { } // Returns the permissions that a caller has on the specified source. - rpc TestIamPermissions(google.iam.v1.TestIamPermissionsRequest) returns (google.iam.v1.TestIamPermissionsResponse) { + rpc TestIamPermissions(google.iam.v1.TestIamPermissionsRequest) + returns (google.iam.v1.TestIamPermissionsResponse) { option (google.api.http) = { post: "/v1/{resource=organizations/*/sources/*}:testIamPermissions" body: "*" @@ -284,7 +284,8 @@ service SecurityCenter { // // Updates a notification config. The following update // fields are allowed: description, pubsub_topic, streaming_config.filter - rpc UpdateNotificationConfig(UpdateNotificationConfigRequest) returns (NotificationConfig) { + rpc UpdateNotificationConfig(UpdateNotificationConfigRequest) + returns (NotificationConfig) { option (google.api.http) = { patch: "/v1/{notification_config.name=organizations/*/notificationConfigs/*}" body: "notification_config" @@ -294,7 +295,8 @@ service SecurityCenter { } // Updates an organization's settings. - rpc UpdateOrganizationSettings(UpdateOrganizationSettingsRequest) returns (OrganizationSettings) { + rpc UpdateOrganizationSettings(UpdateOrganizationSettingsRequest) + returns (OrganizationSettings) { option (google.api.http) = { patch: "/v1/{organization_settings.name=organizations/*/organizationSettings}" body: "organization_settings" @@ -357,15 +359,15 @@ message CreateFindingRequest { // greater than 0 characters in length. string finding_id = 2 [(google.api.field_behavior) = REQUIRED]; - // Required. The Finding being created. The name and security_marks will be ignored as - // they are both output only fields on this resource. + // Required. The Finding being created. The name and security_marks will be + // ignored as they are both output only fields on this resource. Finding finding = 3 [(google.api.field_behavior) = REQUIRED]; } // Request message for creating a notification config. message CreateNotificationConfigRequest { - // Required. Resource name of the new notification config's parent. Its format is - // "organizations/[organization_id]". + // Required. Resource name of the new notification config's parent. Its format + // is "organizations/[organization_id]". string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -379,9 +381,11 @@ message CreateNotificationConfigRequest { // characters, underscores or hyphens only. string config_id = 2 [(google.api.field_behavior) = REQUIRED]; - // Required. The notification config being created. The name and the service account - // will be ignored as they are both output only fields on this resource. - NotificationConfig notification_config = 3 [(google.api.field_behavior) = REQUIRED]; + // Required. The notification config being created. The name and the service + // account will be ignored as they are both output only fields on this + // resource. + NotificationConfig notification_config = 3 + [(google.api.field_behavior) = REQUIRED]; } // Request message for creating a source. @@ -395,8 +399,8 @@ message CreateSourceRequest { } ]; - // Required. The Source being created, only the display_name and description will be - // used. All other fields will be ignored. + // Required. The Source being created, only the display_name and description + // will be used. All other fields will be ignored. Source source = 2 [(google.api.field_behavior) = REQUIRED]; } @@ -426,8 +430,8 @@ message GetNotificationConfigRequest { // Request message for getting organization settings. message GetOrganizationSettingsRequest { - // Required. Name of the organization to get organization settings for. Its format is - // "organizations/[organization_id]/organizationSettings". + // Required. Name of the organization to get organization settings for. Its + // format is "organizations/[organization_id]/organizationSettings". string name = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -524,9 +528,9 @@ message GroupAssetsRequest { // property not existing: `-resource_properties.my_property : ""` string filter = 2; - // Required. Expression that defines what assets fields to use for grouping. The string - // value should follow SQL syntax: comma separated list of fields. For - // example: + // Required. Expression that defines what assets fields to use for grouping. + // The string value should follow SQL syntax: comma separated list of fields. + // For example: // "security_center_properties.resource_project,security_center_properties.project". // // The following fields are supported when compare_duration is not set: @@ -656,28 +660,37 @@ message GroupFindingsRequest { // * category: `=`, `:` // * external_uri: `=`, `:` // * event_time: `=`, `>`, `<`, `>=`, `<=` - // * severity: `=`, `:` // // Usage: This should be milliseconds since epoch or an RFC3339 string. // Examples: // `event_time = "2019-06-10T16:07:18-07:00"` // `event_time = 1560208038000` // + // * severity: `=`, `:` + // * workflow_state: `=`, `:` // * security_marks.marks: `=`, `:` // * source_properties: `=`, `:`, `>`, `<`, `>=`, `<=` // - // For example, `source_properties.size = 100` is a valid filter string. + // For example, `source_properties.size = 100` is a valid filter string. // - // Use a partial match on the empty string to filter based on a property - // existing: `source_properties.my_property : ""` + // Use a partial match on the empty string to filter based on a property + // existing: `source_properties.my_property : ""` // - // Use a negated partial match on the empty string to filter based on a - // property not existing: `-source_properties.my_property : ""` + // Use a negated partial match on the empty string to filter based on a + // property not existing: `-source_properties.my_property : ""` + // + // * resource: + // * resource.name: `=`, `:` + // * resource.parent_name: `=`, `:` + // * resource.parent_display_name: `=`, `:` + // * resource.project_name: `=`, `:` + // * resource.project_display_name: `=`, `:` + // * resource.type: `=`, `:` string filter = 2; - // Required. Expression that defines what assets fields to use for grouping (including - // `state_change`). The string value should follow SQL syntax: comma separated - // list of fields. For example: "parent,resource_name". + // Required. Expression that defines what assets fields to use for grouping + // (including `state_change`). The string value should follow SQL syntax: + // comma separated list of fields. For example: "parent,resource_name". // // The following fields are supported: // @@ -802,8 +815,8 @@ message ListNotificationConfigsResponse { // Request message for listing sources. message ListSourcesRequest { - // Required. Resource name of the parent of sources to list. Its format should be - // "organizations/[organization_id], folders/[folder_id], or + // Required. Resource name of the parent of sources to list. Its format should + // be "organizations/[organization_id], folders/[folder_id], or // projects/[project_id]". string parent = 1 [ (google.api.field_behavior) = REQUIRED, @@ -1072,23 +1085,33 @@ message ListFindingsRequest { // * category: `=`, `:` // * external_uri: `=`, `:` // * event_time: `=`, `>`, `<`, `>=`, `<=` - // * severity: `=`, `:` // // Usage: This should be milliseconds since epoch or an RFC3339 string. // Examples: // `event_time = "2019-06-10T16:07:18-07:00"` // `event_time = 1560208038000` // - // security_marks.marks: `=`, `:` - // source_properties: `=`, `:`, `>`, `<`, `>=`, `<=` + // * severity: `=`, `:` + // * workflow_state: `=`, `:` + // * security_marks.marks: `=`, `:` + // * source_properties: `=`, `:`, `>`, `<`, `>=`, `<=` // - // For example, `source_properties.size = 100` is a valid filter string. + // For example, `source_properties.size = 100` is a valid filter string. // - // Use a partial match on the empty string to filter based on a property - // existing: `source_properties.my_property : ""` + // Use a partial match on the empty string to filter based on a property + // existing: `source_properties.my_property : ""` // - // Use a negated partial match on the empty string to filter based on a - // property not existing: `-source_properties.my_property : ""` + // Use a negated partial match on the empty string to filter based on a + // property not existing: `-source_properties.my_property : ""` + // + // * resource: + // * resource.name: `=`, `:` + // * resource.parent_name: `=`, `:` + // * resource.parent_display_name: `=`, `:` + // * resource.project_name: `=`, `:` + // * resource.project_display_name: `=`, `:` + // * resource.type: `=`, `:` + // * resource.folders.resource_folder: `=`, `:` string filter = 2; // Expression that defines what fields and order to use for sorting. The @@ -1261,13 +1284,14 @@ message SetFindingStateRequest { Finding.State state = 2 [(google.api.field_behavior) = REQUIRED]; // Required. The time at which the updated state takes effect. - google.protobuf.Timestamp start_time = 3 [(google.api.field_behavior) = REQUIRED]; + google.protobuf.Timestamp start_time = 3 + [(google.api.field_behavior) = REQUIRED]; } // Request message for running asset discovery for an organization. message RunAssetDiscoveryRequest { - // Required. Name of the organization to run asset discovery for. Its format is - // "organizations/[organization_id]". + // Required. Name of the organization to run asset discovery for. Its format + // is "organizations/[organization_id]". string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -1278,8 +1302,8 @@ message RunAssetDiscoveryRequest { // Request message for updating or creating a finding. message UpdateFindingRequest { - // Required. The finding resource to update or create if it does not already exist. - // parent, security_marks, and update_time will be ignored. + // Required. The finding resource to update or create if it does not already + // exist. parent, security_marks, and update_time will be ignored. // // In the case of creation, the finding id portion of the name must be // alphanumeric and less than or equal to 32 characters and greater than 0 @@ -1299,7 +1323,8 @@ message UpdateFindingRequest { // Request message for updating a notification config. message UpdateNotificationConfigRequest { // Required. The notification config to update. - NotificationConfig notification_config = 1 [(google.api.field_behavior) = REQUIRED]; + NotificationConfig notification_config = 1 + [(google.api.field_behavior) = REQUIRED]; // The FieldMask to use when updating the notification config. // @@ -1310,7 +1335,8 @@ message UpdateNotificationConfigRequest { // Request message for updating an organization's settings. message UpdateOrganizationSettingsRequest { // Required. The organization settings resource to update. - OrganizationSettings organization_settings = 1 [(google.api.field_behavior) = REQUIRED]; + OrganizationSettings organization_settings = 1 + [(google.api.field_behavior) = REQUIRED]; // The FieldMask to use when updating the settings resource. // diff --git a/packages/google-cloud-securitycenter/src/v1/security_center_client.ts b/packages/google-cloud-securitycenter/src/v1/security_center_client.ts index 80c8bf1a692..9dd53d972a6 100644 --- a/packages/google-cloud-securitycenter/src/v1/security_center_client.ts +++ b/packages/google-cloud-securitycenter/src/v1/security_center_client.ts @@ -472,8 +472,8 @@ export class SecurityCenterClient { * Required. Resource name of the new source's parent. Its format should be * "organizations/[organization_id]". * @param {google.cloud.securitycenter.v1.Source} request.source - * Required. The Source being created, only the display_name and description will be - * used. All other fields will be ignored. + * Required. The Source being created, only the display_name and description + * will be used. All other fields will be ignored. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -572,8 +572,8 @@ export class SecurityCenterClient { * It must be alphanumeric and less than or equal to 32 characters and * greater than 0 characters in length. * @param {google.cloud.securitycenter.v1.Finding} request.finding - * Required. The Finding being created. The name and security_marks will be ignored as - * they are both output only fields on this resource. + * Required. The Finding being created. The name and security_marks will be + * ignored as they are both output only fields on this resource. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -667,16 +667,17 @@ export class SecurityCenterClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. Resource name of the new notification config's parent. Its format is - * "organizations/[organization_id]". + * Required. Resource name of the new notification config's parent. Its format + * is "organizations/[organization_id]". * @param {string} request.configId * Required. * Unique identifier provided by the client within the parent scope. * It must be between 1 and 128 characters, and contains alphanumeric * characters, underscores or hyphens only. * @param {google.cloud.securitycenter.v1.NotificationConfig} request.notificationConfig - * Required. The notification config being created. The name and the service account - * will be ignored as they are both output only fields on this resource. + * Required. The notification config being created. The name and the service + * account will be ignored as they are both output only fields on this + * resource. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -1064,8 +1065,8 @@ export class SecurityCenterClient { * @param {Object} request * The request object that will be sent. * @param {string} request.name - * Required. Name of the organization to get organization settings for. Its format is - * "organizations/[organization_id]/organizationSettings". + * Required. Name of the organization to get organization settings for. Its + * format is "organizations/[organization_id]/organizationSettings". * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -1532,8 +1533,8 @@ export class SecurityCenterClient { * @param {Object} request * The request object that will be sent. * @param {google.cloud.securitycenter.v1.Finding} request.finding - * Required. The finding resource to update or create if it does not already exist. - * parent, security_marks, and update_time will be ignored. + * Required. The finding resource to update or create if it does not already + * exist. parent, security_marks, and update_time will be ignored. * * In the case of creation, the finding id portion of the name must be * alphanumeric and less than or equal to 32 characters and greater than 0 @@ -2061,8 +2062,8 @@ export class SecurityCenterClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. Name of the organization to run asset discovery for. Its format is - * "organizations/[organization_id]". + * Required. Name of the organization to run asset discovery for. Its format + * is "organizations/[organization_id]". * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -2266,9 +2267,9 @@ export class SecurityCenterClient { * Use a negated partial match on the empty string to filter based on a * property not existing: `-resource_properties.my_property : ""` * @param {string} request.groupBy - * Required. Expression that defines what assets fields to use for grouping. The string - * value should follow SQL syntax: comma separated list of fields. For - * example: + * Required. Expression that defines what assets fields to use for grouping. + * The string value should follow SQL syntax: comma separated list of fields. + * For example: * "security_center_properties.resource_project,security_center_properties.project". * * The following fields are supported when compare_duration is not set: @@ -2453,9 +2454,9 @@ export class SecurityCenterClient { * Use a negated partial match on the empty string to filter based on a * property not existing: `-resource_properties.my_property : ""` * @param {string} request.groupBy - * Required. Expression that defines what assets fields to use for grouping. The string - * value should follow SQL syntax: comma separated list of fields. For - * example: + * Required. Expression that defines what assets fields to use for grouping. + * The string value should follow SQL syntax: comma separated list of fields. + * For example: * "security_center_properties.resource_project,security_center_properties.project". * * The following fields are supported when compare_duration is not set: @@ -2618,9 +2619,9 @@ export class SecurityCenterClient { * Use a negated partial match on the empty string to filter based on a * property not existing: `-resource_properties.my_property : ""` * @param {string} request.groupBy - * Required. Expression that defines what assets fields to use for grouping. The string - * value should follow SQL syntax: comma separated list of fields. For - * example: + * Required. Expression that defines what assets fields to use for grouping. + * The string value should follow SQL syntax: comma separated list of fields. + * For example: * "security_center_properties.resource_project,security_center_properties.project". * * The following fields are supported when compare_duration is not set: @@ -2797,27 +2798,36 @@ export class SecurityCenterClient { * * category: `=`, `:` * * external_uri: `=`, `:` * * event_time: `=`, `>`, `<`, `>=`, `<=` - * * severity: `=`, `:` * * Usage: This should be milliseconds since epoch or an RFC3339 string. * Examples: * `event_time = "2019-06-10T16:07:18-07:00"` * `event_time = 1560208038000` * + * * severity: `=`, `:` + * * workflow_state: `=`, `:` * * security_marks.marks: `=`, `:` * * source_properties: `=`, `:`, `>`, `<`, `>=`, `<=` * - * For example, `source_properties.size = 100` is a valid filter string. + * For example, `source_properties.size = 100` is a valid filter string. * - * Use a partial match on the empty string to filter based on a property - * existing: `source_properties.my_property : ""` + * Use a partial match on the empty string to filter based on a property + * existing: `source_properties.my_property : ""` * - * Use a negated partial match on the empty string to filter based on a - * property not existing: `-source_properties.my_property : ""` + * Use a negated partial match on the empty string to filter based on a + * property not existing: `-source_properties.my_property : ""` + * + * * resource: + * * resource.name: `=`, `:` + * * resource.parent_name: `=`, `:` + * * resource.parent_display_name: `=`, `:` + * * resource.project_name: `=`, `:` + * * resource.project_display_name: `=`, `:` + * * resource.type: `=`, `:` * @param {string} request.groupBy - * Required. Expression that defines what assets fields to use for grouping (including - * `state_change`). The string value should follow SQL syntax: comma separated - * list of fields. For example: "parent,resource_name". + * Required. Expression that defines what assets fields to use for grouping + * (including `state_change`). The string value should follow SQL syntax: + * comma separated list of fields. For example: "parent,resource_name". * * The following fields are supported: * @@ -2978,27 +2988,36 @@ export class SecurityCenterClient { * * category: `=`, `:` * * external_uri: `=`, `:` * * event_time: `=`, `>`, `<`, `>=`, `<=` - * * severity: `=`, `:` * * Usage: This should be milliseconds since epoch or an RFC3339 string. * Examples: * `event_time = "2019-06-10T16:07:18-07:00"` * `event_time = 1560208038000` * + * * severity: `=`, `:` + * * workflow_state: `=`, `:` * * security_marks.marks: `=`, `:` * * source_properties: `=`, `:`, `>`, `<`, `>=`, `<=` * - * For example, `source_properties.size = 100` is a valid filter string. + * For example, `source_properties.size = 100` is a valid filter string. * - * Use a partial match on the empty string to filter based on a property - * existing: `source_properties.my_property : ""` + * Use a partial match on the empty string to filter based on a property + * existing: `source_properties.my_property : ""` * - * Use a negated partial match on the empty string to filter based on a - * property not existing: `-source_properties.my_property : ""` + * Use a negated partial match on the empty string to filter based on a + * property not existing: `-source_properties.my_property : ""` + * + * * resource: + * * resource.name: `=`, `:` + * * resource.parent_name: `=`, `:` + * * resource.parent_display_name: `=`, `:` + * * resource.project_name: `=`, `:` + * * resource.project_display_name: `=`, `:` + * * resource.type: `=`, `:` * @param {string} request.groupBy - * Required. Expression that defines what assets fields to use for grouping (including - * `state_change`). The string value should follow SQL syntax: comma separated - * list of fields. For example: "parent,resource_name". + * Required. Expression that defines what assets fields to use for grouping + * (including `state_change`). The string value should follow SQL syntax: + * comma separated list of fields. For example: "parent,resource_name". * * The following fields are supported: * @@ -3137,27 +3156,36 @@ export class SecurityCenterClient { * * category: `=`, `:` * * external_uri: `=`, `:` * * event_time: `=`, `>`, `<`, `>=`, `<=` - * * severity: `=`, `:` * * Usage: This should be milliseconds since epoch or an RFC3339 string. * Examples: * `event_time = "2019-06-10T16:07:18-07:00"` * `event_time = 1560208038000` * + * * severity: `=`, `:` + * * workflow_state: `=`, `:` * * security_marks.marks: `=`, `:` * * source_properties: `=`, `:`, `>`, `<`, `>=`, `<=` * - * For example, `source_properties.size = 100` is a valid filter string. + * For example, `source_properties.size = 100` is a valid filter string. * - * Use a partial match on the empty string to filter based on a property - * existing: `source_properties.my_property : ""` + * Use a partial match on the empty string to filter based on a property + * existing: `source_properties.my_property : ""` * - * Use a negated partial match on the empty string to filter based on a - * property not existing: `-source_properties.my_property : ""` + * Use a negated partial match on the empty string to filter based on a + * property not existing: `-source_properties.my_property : ""` + * + * * resource: + * * resource.name: `=`, `:` + * * resource.parent_name: `=`, `:` + * * resource.parent_display_name: `=`, `:` + * * resource.project_name: `=`, `:` + * * resource.project_display_name: `=`, `:` + * * resource.type: `=`, `:` * @param {string} request.groupBy - * Required. Expression that defines what assets fields to use for grouping (including - * `state_change`). The string value should follow SQL syntax: comma separated - * list of fields. For example: "parent,resource_name". + * Required. Expression that defines what assets fields to use for grouping + * (including `state_change`). The string value should follow SQL syntax: + * comma separated list of fields. For example: "parent,resource_name". * * The following fields are supported: * @@ -3896,23 +3924,33 @@ export class SecurityCenterClient { * * category: `=`, `:` * * external_uri: `=`, `:` * * event_time: `=`, `>`, `<`, `>=`, `<=` - * * severity: `=`, `:` * * Usage: This should be milliseconds since epoch or an RFC3339 string. * Examples: * `event_time = "2019-06-10T16:07:18-07:00"` * `event_time = 1560208038000` * - * security_marks.marks: `=`, `:` - * source_properties: `=`, `:`, `>`, `<`, `>=`, `<=` + * * severity: `=`, `:` + * * workflow_state: `=`, `:` + * * security_marks.marks: `=`, `:` + * * source_properties: `=`, `:`, `>`, `<`, `>=`, `<=` * - * For example, `source_properties.size = 100` is a valid filter string. + * For example, `source_properties.size = 100` is a valid filter string. * - * Use a partial match on the empty string to filter based on a property - * existing: `source_properties.my_property : ""` + * Use a partial match on the empty string to filter based on a property + * existing: `source_properties.my_property : ""` * - * Use a negated partial match on the empty string to filter based on a - * property not existing: `-source_properties.my_property : ""` + * Use a negated partial match on the empty string to filter based on a + * property not existing: `-source_properties.my_property : ""` + * + * * resource: + * * resource.name: `=`, `:` + * * resource.parent_name: `=`, `:` + * * resource.parent_display_name: `=`, `:` + * * resource.project_name: `=`, `:` + * * resource.project_display_name: `=`, `:` + * * resource.type: `=`, `:` + * * resource.folders.resource_folder: `=`, `:` * @param {string} request.orderBy * Expression that defines what fields and order to use for sorting. The * string value should follow SQL syntax: comma separated list of fields. For @@ -4081,23 +4119,33 @@ export class SecurityCenterClient { * * category: `=`, `:` * * external_uri: `=`, `:` * * event_time: `=`, `>`, `<`, `>=`, `<=` - * * severity: `=`, `:` * * Usage: This should be milliseconds since epoch or an RFC3339 string. * Examples: * `event_time = "2019-06-10T16:07:18-07:00"` * `event_time = 1560208038000` * - * security_marks.marks: `=`, `:` - * source_properties: `=`, `:`, `>`, `<`, `>=`, `<=` + * * severity: `=`, `:` + * * workflow_state: `=`, `:` + * * security_marks.marks: `=`, `:` + * * source_properties: `=`, `:`, `>`, `<`, `>=`, `<=` + * + * For example, `source_properties.size = 100` is a valid filter string. * - * For example, `source_properties.size = 100` is a valid filter string. + * Use a partial match on the empty string to filter based on a property + * existing: `source_properties.my_property : ""` * - * Use a partial match on the empty string to filter based on a property - * existing: `source_properties.my_property : ""` + * Use a negated partial match on the empty string to filter based on a + * property not existing: `-source_properties.my_property : ""` * - * Use a negated partial match on the empty string to filter based on a - * property not existing: `-source_properties.my_property : ""` + * * resource: + * * resource.name: `=`, `:` + * * resource.parent_name: `=`, `:` + * * resource.parent_display_name: `=`, `:` + * * resource.project_name: `=`, `:` + * * resource.project_display_name: `=`, `:` + * * resource.type: `=`, `:` + * * resource.folders.resource_folder: `=`, `:` * @param {string} request.orderBy * Expression that defines what fields and order to use for sorting. The * string value should follow SQL syntax: comma separated list of fields. For @@ -4244,23 +4292,33 @@ export class SecurityCenterClient { * * category: `=`, `:` * * external_uri: `=`, `:` * * event_time: `=`, `>`, `<`, `>=`, `<=` - * * severity: `=`, `:` * * Usage: This should be milliseconds since epoch or an RFC3339 string. * Examples: * `event_time = "2019-06-10T16:07:18-07:00"` * `event_time = 1560208038000` * - * security_marks.marks: `=`, `:` - * source_properties: `=`, `:`, `>`, `<`, `>=`, `<=` + * * severity: `=`, `:` + * * workflow_state: `=`, `:` + * * security_marks.marks: `=`, `:` + * * source_properties: `=`, `:`, `>`, `<`, `>=`, `<=` * - * For example, `source_properties.size = 100` is a valid filter string. + * For example, `source_properties.size = 100` is a valid filter string. * - * Use a partial match on the empty string to filter based on a property - * existing: `source_properties.my_property : ""` + * Use a partial match on the empty string to filter based on a property + * existing: `source_properties.my_property : ""` * - * Use a negated partial match on the empty string to filter based on a - * property not existing: `-source_properties.my_property : ""` + * Use a negated partial match on the empty string to filter based on a + * property not existing: `-source_properties.my_property : ""` + * + * * resource: + * * resource.name: `=`, `:` + * * resource.parent_name: `=`, `:` + * * resource.parent_display_name: `=`, `:` + * * resource.project_name: `=`, `:` + * * resource.project_display_name: `=`, `:` + * * resource.type: `=`, `:` + * * resource.folders.resource_folder: `=`, `:` * @param {string} request.orderBy * Expression that defines what fields and order to use for sorting. The * string value should follow SQL syntax: comma separated list of fields. For @@ -4607,8 +4665,8 @@ export class SecurityCenterClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. Resource name of the parent of sources to list. Its format should be - * "organizations/[organization_id], folders/[folder_id], or + * Required. Resource name of the parent of sources to list. Its format should + * be "organizations/[organization_id], folders/[folder_id], or * projects/[project_id]". * @param {string} request.pageToken * The value returned by the last `ListSourcesResponse`; indicates @@ -4679,8 +4737,8 @@ export class SecurityCenterClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. Resource name of the parent of sources to list. Its format should be - * "organizations/[organization_id], folders/[folder_id], or + * Required. Resource name of the parent of sources to list. Its format should + * be "organizations/[organization_id], folders/[folder_id], or * projects/[project_id]". * @param {string} request.pageToken * The value returned by the last `ListSourcesResponse`; indicates @@ -4729,8 +4787,8 @@ export class SecurityCenterClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. Resource name of the parent of sources to list. Its format should be - * "organizations/[organization_id], folders/[folder_id], or + * Required. Resource name of the parent of sources to list. Its format should + * be "organizations/[organization_id], folders/[folder_id], or * projects/[project_id]". * @param {string} request.pageToken * The value returned by the last `ListSourcesResponse`; indicates From 53851415c1f60d16407a51e1134995ad6f5626be Mon Sep 17 00:00:00 2001 From: "F. Hinkelmann" Date: Thu, 10 Jun 2021 23:04:26 +0200 Subject: [PATCH 258/342] chore(nodejs): remove api-extractor dependencies (#394) --- packages/google-cloud-securitycenter/package.json | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/packages/google-cloud-securitycenter/package.json b/packages/google-cloud-securitycenter/package.json index 22949832b79..d6b8170a47b 100644 --- a/packages/google-cloud-securitycenter/package.json +++ b/packages/google-cloud-securitycenter/package.json @@ -26,9 +26,7 @@ "test": "c8 mocha build/test", "samples-test": "cd samples/ && npm link ../ && npm test && cd ../", "prelint": "cd samples; npm link ../; npm install", - "precompile": "gts clean", - "api-extractor": "api-extractor run --local", - "api-documenter": "api-documenter yaml --input-folder=temp" + "precompile": "gts clean" }, "keywords": [ "google apis client", @@ -61,8 +59,6 @@ "pack-n-play": "^1.0.0-2", "sinon": "^11.0.0", "ts-loader": "^8.0.0", - "typescript": "^3.8.3", - "@microsoft/api-documenter": "^7.8.10", - "@microsoft/api-extractor": "^7.8.10" + "typescript": "^3.8.3" } } From 7fcf57e4242db46b941b5b69ff5f15d5f4e8f88a Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Tue, 22 Jun 2021 20:22:40 +0000 Subject: [PATCH 259/342] fix: make request optional in all cases (#396) ... chore: update gapic-generator-ruby to the latest commit chore: release gapic-generator-typescript 1.5.0 Committer: @miraleung PiperOrigin-RevId: 380641501 Source-Link: https://github.com/googleapis/googleapis/commit/076f7e9f0b258bdb54338895d7251b202e8f0de3 Source-Link: https://github.com/googleapis/googleapis-gen/commit/27e4c88b4048e5f56508d4e1aa417d60a3380892 --- .../src/v1/security_center_client.ts | 92 +++++++++---------- .../src/v1beta1/security_center_client.ts | 72 +++++++-------- .../src/v1p1beta1/security_center_client.ts | 92 +++++++++---------- 3 files changed, 128 insertions(+), 128 deletions(-) diff --git a/packages/google-cloud-securitycenter/src/v1/security_center_client.ts b/packages/google-cloud-securitycenter/src/v1/security_center_client.ts index 9dd53d972a6..848abd01d93 100644 --- a/packages/google-cloud-securitycenter/src/v1/security_center_client.ts +++ b/packages/google-cloud-securitycenter/src/v1/security_center_client.ts @@ -433,7 +433,7 @@ export class SecurityCenterClient { // -- Service calls -- // ------------------- createSource( - request: protos.google.cloud.securitycenter.v1.ICreateSourceRequest, + request?: protos.google.cloud.securitycenter.v1.ICreateSourceRequest, options?: CallOptions ): Promise< [ @@ -485,7 +485,7 @@ export class SecurityCenterClient { * const [response] = await client.createSource(request); */ createSource( - request: protos.google.cloud.securitycenter.v1.ICreateSourceRequest, + request?: protos.google.cloud.securitycenter.v1.ICreateSourceRequest, optionsOrCallback?: | CallOptions | Callback< @@ -528,7 +528,7 @@ export class SecurityCenterClient { return this.innerApiCalls.createSource(request, options, callback); } createFinding( - request: protos.google.cloud.securitycenter.v1.ICreateFindingRequest, + request?: protos.google.cloud.securitycenter.v1.ICreateFindingRequest, options?: CallOptions ): Promise< [ @@ -585,7 +585,7 @@ export class SecurityCenterClient { * const [response] = await client.createFinding(request); */ createFinding( - request: protos.google.cloud.securitycenter.v1.ICreateFindingRequest, + request?: protos.google.cloud.securitycenter.v1.ICreateFindingRequest, optionsOrCallback?: | CallOptions | Callback< @@ -628,7 +628,7 @@ export class SecurityCenterClient { return this.innerApiCalls.createFinding(request, options, callback); } createNotificationConfig( - request: protos.google.cloud.securitycenter.v1.ICreateNotificationConfigRequest, + request?: protos.google.cloud.securitycenter.v1.ICreateNotificationConfigRequest, options?: CallOptions ): Promise< [ @@ -689,7 +689,7 @@ export class SecurityCenterClient { * const [response] = await client.createNotificationConfig(request); */ createNotificationConfig( - request: protos.google.cloud.securitycenter.v1.ICreateNotificationConfigRequest, + request?: protos.google.cloud.securitycenter.v1.ICreateNotificationConfigRequest, optionsOrCallback?: | CallOptions | Callback< @@ -739,7 +739,7 @@ export class SecurityCenterClient { ); } deleteNotificationConfig( - request: protos.google.cloud.securitycenter.v1.IDeleteNotificationConfigRequest, + request?: protos.google.cloud.securitycenter.v1.IDeleteNotificationConfigRequest, options?: CallOptions ): Promise< [ @@ -791,7 +791,7 @@ export class SecurityCenterClient { * const [response] = await client.deleteNotificationConfig(request); */ deleteNotificationConfig( - request: protos.google.cloud.securitycenter.v1.IDeleteNotificationConfigRequest, + request?: protos.google.cloud.securitycenter.v1.IDeleteNotificationConfigRequest, optionsOrCallback?: | CallOptions | Callback< @@ -841,7 +841,7 @@ export class SecurityCenterClient { ); } getIamPolicy( - request: protos.google.iam.v1.IGetIamPolicyRequest, + request?: protos.google.iam.v1.IGetIamPolicyRequest, options?: CallOptions ): Promise< [ @@ -889,7 +889,7 @@ export class SecurityCenterClient { * const [response] = await client.getIamPolicy(request); */ getIamPolicy( - request: protos.google.iam.v1.IGetIamPolicyRequest, + request?: protos.google.iam.v1.IGetIamPolicyRequest, optionsOrCallback?: | CallOptions | Callback< @@ -928,7 +928,7 @@ export class SecurityCenterClient { return this.innerApiCalls.getIamPolicy(request, options, callback); } getNotificationConfig( - request: protos.google.cloud.securitycenter.v1.IGetNotificationConfigRequest, + request?: protos.google.cloud.securitycenter.v1.IGetNotificationConfigRequest, options?: CallOptions ): Promise< [ @@ -980,7 +980,7 @@ export class SecurityCenterClient { * const [response] = await client.getNotificationConfig(request); */ getNotificationConfig( - request: protos.google.cloud.securitycenter.v1.IGetNotificationConfigRequest, + request?: protos.google.cloud.securitycenter.v1.IGetNotificationConfigRequest, optionsOrCallback?: | CallOptions | Callback< @@ -1026,7 +1026,7 @@ export class SecurityCenterClient { return this.innerApiCalls.getNotificationConfig(request, options, callback); } getOrganizationSettings( - request: protos.google.cloud.securitycenter.v1.IGetOrganizationSettingsRequest, + request?: protos.google.cloud.securitycenter.v1.IGetOrganizationSettingsRequest, options?: CallOptions ): Promise< [ @@ -1078,7 +1078,7 @@ export class SecurityCenterClient { * const [response] = await client.getOrganizationSettings(request); */ getOrganizationSettings( - request: protos.google.cloud.securitycenter.v1.IGetOrganizationSettingsRequest, + request?: protos.google.cloud.securitycenter.v1.IGetOrganizationSettingsRequest, optionsOrCallback?: | CallOptions | Callback< @@ -1128,7 +1128,7 @@ export class SecurityCenterClient { ); } getSource( - request: protos.google.cloud.securitycenter.v1.IGetSourceRequest, + request?: protos.google.cloud.securitycenter.v1.IGetSourceRequest, options?: CallOptions ): Promise< [ @@ -1177,7 +1177,7 @@ export class SecurityCenterClient { * const [response] = await client.getSource(request); */ getSource( - request: protos.google.cloud.securitycenter.v1.IGetSourceRequest, + request?: protos.google.cloud.securitycenter.v1.IGetSourceRequest, optionsOrCallback?: | CallOptions | Callback< @@ -1220,7 +1220,7 @@ export class SecurityCenterClient { return this.innerApiCalls.getSource(request, options, callback); } setFindingState( - request: protos.google.cloud.securitycenter.v1.ISetFindingStateRequest, + request?: protos.google.cloud.securitycenter.v1.ISetFindingStateRequest, options?: CallOptions ): Promise< [ @@ -1275,7 +1275,7 @@ export class SecurityCenterClient { * const [response] = await client.setFindingState(request); */ setFindingState( - request: protos.google.cloud.securitycenter.v1.ISetFindingStateRequest, + request?: protos.google.cloud.securitycenter.v1.ISetFindingStateRequest, optionsOrCallback?: | CallOptions | Callback< @@ -1318,7 +1318,7 @@ export class SecurityCenterClient { return this.innerApiCalls.setFindingState(request, options, callback); } setIamPolicy( - request: protos.google.iam.v1.ISetIamPolicyRequest, + request?: protos.google.iam.v1.ISetIamPolicyRequest, options?: CallOptions ): Promise< [ @@ -1368,7 +1368,7 @@ export class SecurityCenterClient { * const [response] = await client.setIamPolicy(request); */ setIamPolicy( - request: protos.google.iam.v1.ISetIamPolicyRequest, + request?: protos.google.iam.v1.ISetIamPolicyRequest, optionsOrCallback?: | CallOptions | Callback< @@ -1407,7 +1407,7 @@ export class SecurityCenterClient { return this.innerApiCalls.setIamPolicy(request, options, callback); } testIamPermissions( - request: protos.google.iam.v1.ITestIamPermissionsRequest, + request?: protos.google.iam.v1.ITestIamPermissionsRequest, options?: CallOptions ): Promise< [ @@ -1457,7 +1457,7 @@ export class SecurityCenterClient { * const [response] = await client.testIamPermissions(request); */ testIamPermissions( - request: protos.google.iam.v1.ITestIamPermissionsRequest, + request?: protos.google.iam.v1.ITestIamPermissionsRequest, optionsOrCallback?: | CallOptions | Callback< @@ -1496,7 +1496,7 @@ export class SecurityCenterClient { return this.innerApiCalls.testIamPermissions(request, options, callback); } updateFinding( - request: protos.google.cloud.securitycenter.v1.IUpdateFindingRequest, + request?: protos.google.cloud.securitycenter.v1.IUpdateFindingRequest, options?: CallOptions ): Promise< [ @@ -1558,7 +1558,7 @@ export class SecurityCenterClient { * const [response] = await client.updateFinding(request); */ updateFinding( - request: protos.google.cloud.securitycenter.v1.IUpdateFindingRequest, + request?: protos.google.cloud.securitycenter.v1.IUpdateFindingRequest, optionsOrCallback?: | CallOptions | Callback< @@ -1601,7 +1601,7 @@ export class SecurityCenterClient { return this.innerApiCalls.updateFinding(request, options, callback); } updateNotificationConfig( - request: protos.google.cloud.securitycenter.v1.IUpdateNotificationConfigRequest, + request?: protos.google.cloud.securitycenter.v1.IUpdateNotificationConfigRequest, options?: CallOptions ): Promise< [ @@ -1658,7 +1658,7 @@ export class SecurityCenterClient { * const [response] = await client.updateNotificationConfig(request); */ updateNotificationConfig( - request: protos.google.cloud.securitycenter.v1.IUpdateNotificationConfigRequest, + request?: protos.google.cloud.securitycenter.v1.IUpdateNotificationConfigRequest, optionsOrCallback?: | CallOptions | Callback< @@ -1708,7 +1708,7 @@ export class SecurityCenterClient { ); } updateOrganizationSettings( - request: protos.google.cloud.securitycenter.v1.IUpdateOrganizationSettingsRequest, + request?: protos.google.cloud.securitycenter.v1.IUpdateOrganizationSettingsRequest, options?: CallOptions ): Promise< [ @@ -1763,7 +1763,7 @@ export class SecurityCenterClient { * const [response] = await client.updateOrganizationSettings(request); */ updateOrganizationSettings( - request: protos.google.cloud.securitycenter.v1.IUpdateOrganizationSettingsRequest, + request?: protos.google.cloud.securitycenter.v1.IUpdateOrganizationSettingsRequest, optionsOrCallback?: | CallOptions | Callback< @@ -1813,7 +1813,7 @@ export class SecurityCenterClient { ); } updateSource( - request: protos.google.cloud.securitycenter.v1.IUpdateSourceRequest, + request?: protos.google.cloud.securitycenter.v1.IUpdateSourceRequest, options?: CallOptions ): Promise< [ @@ -1865,7 +1865,7 @@ export class SecurityCenterClient { * const [response] = await client.updateSource(request); */ updateSource( - request: protos.google.cloud.securitycenter.v1.IUpdateSourceRequest, + request?: protos.google.cloud.securitycenter.v1.IUpdateSourceRequest, optionsOrCallback?: | CallOptions | Callback< @@ -1908,7 +1908,7 @@ export class SecurityCenterClient { return this.innerApiCalls.updateSource(request, options, callback); } updateSecurityMarks( - request: protos.google.cloud.securitycenter.v1.IUpdateSecurityMarksRequest, + request?: protos.google.cloud.securitycenter.v1.IUpdateSecurityMarksRequest, options?: CallOptions ): Promise< [ @@ -1969,7 +1969,7 @@ export class SecurityCenterClient { * const [response] = await client.updateSecurityMarks(request); */ updateSecurityMarks( - request: protos.google.cloud.securitycenter.v1.IUpdateSecurityMarksRequest, + request?: protos.google.cloud.securitycenter.v1.IUpdateSecurityMarksRequest, optionsOrCallback?: | CallOptions | Callback< @@ -2016,7 +2016,7 @@ export class SecurityCenterClient { } runAssetDiscovery( - request: protos.google.cloud.securitycenter.v1.IRunAssetDiscoveryRequest, + request?: protos.google.cloud.securitycenter.v1.IRunAssetDiscoveryRequest, options?: CallOptions ): Promise< [ @@ -2078,7 +2078,7 @@ export class SecurityCenterClient { * const [response] = await operation.promise(); */ runAssetDiscovery( - request: protos.google.cloud.securitycenter.v1.IRunAssetDiscoveryRequest, + request?: protos.google.cloud.securitycenter.v1.IRunAssetDiscoveryRequest, optionsOrCallback?: | CallOptions | Callback< @@ -2163,7 +2163,7 @@ export class SecurityCenterClient { >; } groupAssets( - request: protos.google.cloud.securitycenter.v1.IGroupAssetsRequest, + request?: protos.google.cloud.securitycenter.v1.IGroupAssetsRequest, options?: CallOptions ): Promise< [ @@ -2339,7 +2339,7 @@ export class SecurityCenterClient { * for more details and examples. */ groupAssets( - request: protos.google.cloud.securitycenter.v1.IGroupAssetsRequest, + request?: protos.google.cloud.securitycenter.v1.IGroupAssetsRequest, optionsOrCallback?: | CallOptions | PaginationCallback< @@ -2715,7 +2715,7 @@ export class SecurityCenterClient { ) as AsyncIterable; } groupFindings( - request: protos.google.cloud.securitycenter.v1.IGroupFindingsRequest, + request?: protos.google.cloud.securitycenter.v1.IGroupFindingsRequest, options?: CallOptions ): Promise< [ @@ -2899,7 +2899,7 @@ export class SecurityCenterClient { * for more details and examples. */ groupFindings( - request: protos.google.cloud.securitycenter.v1.IGroupFindingsRequest, + request?: protos.google.cloud.securitycenter.v1.IGroupFindingsRequest, optionsOrCallback?: | CallOptions | PaginationCallback< @@ -3281,7 +3281,7 @@ export class SecurityCenterClient { ) as AsyncIterable; } listAssets( - request: protos.google.cloud.securitycenter.v1.IListAssetsRequest, + request?: protos.google.cloud.securitycenter.v1.IListAssetsRequest, options?: CallOptions ): Promise< [ @@ -3460,7 +3460,7 @@ export class SecurityCenterClient { * for more details and examples. */ listAssets( - request: protos.google.cloud.securitycenter.v1.IListAssetsRequest, + request?: protos.google.cloud.securitycenter.v1.IListAssetsRequest, optionsOrCallback?: | CallOptions | PaginationCallback< @@ -3844,7 +3844,7 @@ export class SecurityCenterClient { ) as AsyncIterable; } listFindings( - request: protos.google.cloud.securitycenter.v1.IListFindingsRequest, + request?: protos.google.cloud.securitycenter.v1.IListFindingsRequest, options?: CallOptions ): Promise< [ @@ -4030,7 +4030,7 @@ export class SecurityCenterClient { * for more details and examples. */ listFindings( - request: protos.google.cloud.securitycenter.v1.IListFindingsRequest, + request?: protos.google.cloud.securitycenter.v1.IListFindingsRequest, optionsOrCallback?: | CallOptions | PaginationCallback< @@ -4422,7 +4422,7 @@ export class SecurityCenterClient { ) as AsyncIterable; } listNotificationConfigs( - request: protos.google.cloud.securitycenter.v1.IListNotificationConfigsRequest, + request?: protos.google.cloud.securitycenter.v1.IListNotificationConfigsRequest, options?: CallOptions ): Promise< [ @@ -4481,7 +4481,7 @@ export class SecurityCenterClient { * for more details and examples. */ listNotificationConfigs( - request: protos.google.cloud.securitycenter.v1.IListNotificationConfigsRequest, + request?: protos.google.cloud.securitycenter.v1.IListNotificationConfigsRequest, optionsOrCallback?: | CallOptions | PaginationCallback< @@ -4629,7 +4629,7 @@ export class SecurityCenterClient { ) as AsyncIterable; } listSources( - request: protos.google.cloud.securitycenter.v1.IListSourcesRequest, + request?: protos.google.cloud.securitycenter.v1.IListSourcesRequest, options?: CallOptions ): Promise< [ @@ -4689,7 +4689,7 @@ export class SecurityCenterClient { * for more details and examples. */ listSources( - request: protos.google.cloud.securitycenter.v1.IListSourcesRequest, + request?: protos.google.cloud.securitycenter.v1.IListSourcesRequest, optionsOrCallback?: | CallOptions | PaginationCallback< diff --git a/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.ts b/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.ts index b4ae49a173f..30b86f260b2 100644 --- a/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.ts +++ b/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.ts @@ -389,7 +389,7 @@ export class SecurityCenterClient { // -- Service calls -- // ------------------- createSource( - request: protos.google.cloud.securitycenter.v1beta1.ICreateSourceRequest, + request?: protos.google.cloud.securitycenter.v1beta1.ICreateSourceRequest, options?: CallOptions ): Promise< [ @@ -444,7 +444,7 @@ export class SecurityCenterClient { * const [response] = await client.createSource(request); */ createSource( - request: protos.google.cloud.securitycenter.v1beta1.ICreateSourceRequest, + request?: protos.google.cloud.securitycenter.v1beta1.ICreateSourceRequest, optionsOrCallback?: | CallOptions | Callback< @@ -490,7 +490,7 @@ export class SecurityCenterClient { return this.innerApiCalls.createSource(request, options, callback); } createFinding( - request: protos.google.cloud.securitycenter.v1beta1.ICreateFindingRequest, + request?: protos.google.cloud.securitycenter.v1beta1.ICreateFindingRequest, options?: CallOptions ): Promise< [ @@ -550,7 +550,7 @@ export class SecurityCenterClient { * const [response] = await client.createFinding(request); */ createFinding( - request: protos.google.cloud.securitycenter.v1beta1.ICreateFindingRequest, + request?: protos.google.cloud.securitycenter.v1beta1.ICreateFindingRequest, optionsOrCallback?: | CallOptions | Callback< @@ -596,7 +596,7 @@ export class SecurityCenterClient { return this.innerApiCalls.createFinding(request, options, callback); } getIamPolicy( - request: protos.google.iam.v1.IGetIamPolicyRequest, + request?: protos.google.iam.v1.IGetIamPolicyRequest, options?: CallOptions ): Promise< [ @@ -644,7 +644,7 @@ export class SecurityCenterClient { * const [response] = await client.getIamPolicy(request); */ getIamPolicy( - request: protos.google.iam.v1.IGetIamPolicyRequest, + request?: protos.google.iam.v1.IGetIamPolicyRequest, optionsOrCallback?: | CallOptions | Callback< @@ -683,7 +683,7 @@ export class SecurityCenterClient { return this.innerApiCalls.getIamPolicy(request, options, callback); } getOrganizationSettings( - request: protos.google.cloud.securitycenter.v1beta1.IGetOrganizationSettingsRequest, + request?: protos.google.cloud.securitycenter.v1beta1.IGetOrganizationSettingsRequest, options?: CallOptions ): Promise< [ @@ -735,7 +735,7 @@ export class SecurityCenterClient { * const [response] = await client.getOrganizationSettings(request); */ getOrganizationSettings( - request: protos.google.cloud.securitycenter.v1beta1.IGetOrganizationSettingsRequest, + request?: protos.google.cloud.securitycenter.v1beta1.IGetOrganizationSettingsRequest, optionsOrCallback?: | CallOptions | Callback< @@ -785,7 +785,7 @@ export class SecurityCenterClient { ); } getSource( - request: protos.google.cloud.securitycenter.v1beta1.IGetSourceRequest, + request?: protos.google.cloud.securitycenter.v1beta1.IGetSourceRequest, options?: CallOptions ): Promise< [ @@ -834,7 +834,7 @@ export class SecurityCenterClient { * const [response] = await client.getSource(request); */ getSource( - request: protos.google.cloud.securitycenter.v1beta1.IGetSourceRequest, + request?: protos.google.cloud.securitycenter.v1beta1.IGetSourceRequest, optionsOrCallback?: | CallOptions | Callback< @@ -877,7 +877,7 @@ export class SecurityCenterClient { return this.innerApiCalls.getSource(request, options, callback); } setFindingState( - request: protos.google.cloud.securitycenter.v1beta1.ISetFindingStateRequest, + request?: protos.google.cloud.securitycenter.v1beta1.ISetFindingStateRequest, options?: CallOptions ): Promise< [ @@ -935,7 +935,7 @@ export class SecurityCenterClient { * const [response] = await client.setFindingState(request); */ setFindingState( - request: protos.google.cloud.securitycenter.v1beta1.ISetFindingStateRequest, + request?: protos.google.cloud.securitycenter.v1beta1.ISetFindingStateRequest, optionsOrCallback?: | CallOptions | Callback< @@ -981,7 +981,7 @@ export class SecurityCenterClient { return this.innerApiCalls.setFindingState(request, options, callback); } setIamPolicy( - request: protos.google.iam.v1.ISetIamPolicyRequest, + request?: protos.google.iam.v1.ISetIamPolicyRequest, options?: CallOptions ): Promise< [ @@ -1031,7 +1031,7 @@ export class SecurityCenterClient { * const [response] = await client.setIamPolicy(request); */ setIamPolicy( - request: protos.google.iam.v1.ISetIamPolicyRequest, + request?: protos.google.iam.v1.ISetIamPolicyRequest, optionsOrCallback?: | CallOptions | Callback< @@ -1070,7 +1070,7 @@ export class SecurityCenterClient { return this.innerApiCalls.setIamPolicy(request, options, callback); } testIamPermissions( - request: protos.google.iam.v1.ITestIamPermissionsRequest, + request?: protos.google.iam.v1.ITestIamPermissionsRequest, options?: CallOptions ): Promise< [ @@ -1120,7 +1120,7 @@ export class SecurityCenterClient { * const [response] = await client.testIamPermissions(request); */ testIamPermissions( - request: protos.google.iam.v1.ITestIamPermissionsRequest, + request?: protos.google.iam.v1.ITestIamPermissionsRequest, optionsOrCallback?: | CallOptions | Callback< @@ -1159,7 +1159,7 @@ export class SecurityCenterClient { return this.innerApiCalls.testIamPermissions(request, options, callback); } updateFinding( - request: protos.google.cloud.securitycenter.v1beta1.IUpdateFindingRequest, + request?: protos.google.cloud.securitycenter.v1beta1.IUpdateFindingRequest, options?: CallOptions ): Promise< [ @@ -1219,7 +1219,7 @@ export class SecurityCenterClient { * const [response] = await client.updateFinding(request); */ updateFinding( - request: protos.google.cloud.securitycenter.v1beta1.IUpdateFindingRequest, + request?: protos.google.cloud.securitycenter.v1beta1.IUpdateFindingRequest, optionsOrCallback?: | CallOptions | Callback< @@ -1265,7 +1265,7 @@ export class SecurityCenterClient { return this.innerApiCalls.updateFinding(request, options, callback); } updateOrganizationSettings( - request: protos.google.cloud.securitycenter.v1beta1.IUpdateOrganizationSettingsRequest, + request?: protos.google.cloud.securitycenter.v1beta1.IUpdateOrganizationSettingsRequest, options?: CallOptions ): Promise< [ @@ -1318,7 +1318,7 @@ export class SecurityCenterClient { * const [response] = await client.updateOrganizationSettings(request); */ updateOrganizationSettings( - request: protos.google.cloud.securitycenter.v1beta1.IUpdateOrganizationSettingsRequest, + request?: protos.google.cloud.securitycenter.v1beta1.IUpdateOrganizationSettingsRequest, optionsOrCallback?: | CallOptions | Callback< @@ -1368,7 +1368,7 @@ export class SecurityCenterClient { ); } updateSource( - request: protos.google.cloud.securitycenter.v1beta1.IUpdateSourceRequest, + request?: protos.google.cloud.securitycenter.v1beta1.IUpdateSourceRequest, options?: CallOptions ): Promise< [ @@ -1421,7 +1421,7 @@ export class SecurityCenterClient { * const [response] = await client.updateSource(request); */ updateSource( - request: protos.google.cloud.securitycenter.v1beta1.IUpdateSourceRequest, + request?: protos.google.cloud.securitycenter.v1beta1.IUpdateSourceRequest, optionsOrCallback?: | CallOptions | Callback< @@ -1467,7 +1467,7 @@ export class SecurityCenterClient { return this.innerApiCalls.updateSource(request, options, callback); } updateSecurityMarks( - request: protos.google.cloud.securitycenter.v1beta1.IUpdateSecurityMarksRequest, + request?: protos.google.cloud.securitycenter.v1beta1.IUpdateSecurityMarksRequest, options?: CallOptions ): Promise< [ @@ -1522,7 +1522,7 @@ export class SecurityCenterClient { * const [response] = await client.updateSecurityMarks(request); */ updateSecurityMarks( - request: protos.google.cloud.securitycenter.v1beta1.IUpdateSecurityMarksRequest, + request?: protos.google.cloud.securitycenter.v1beta1.IUpdateSecurityMarksRequest, optionsOrCallback?: | CallOptions | Callback< @@ -1569,7 +1569,7 @@ export class SecurityCenterClient { } runAssetDiscovery( - request: protos.google.cloud.securitycenter.v1beta1.IRunAssetDiscoveryRequest, + request?: protos.google.cloud.securitycenter.v1beta1.IRunAssetDiscoveryRequest, options?: CallOptions ): Promise< [ @@ -1622,7 +1622,7 @@ export class SecurityCenterClient { * const [response] = await operation.promise(); */ runAssetDiscovery( - request: protos.google.cloud.securitycenter.v1beta1.IRunAssetDiscoveryRequest, + request?: protos.google.cloud.securitycenter.v1beta1.IRunAssetDiscoveryRequest, optionsOrCallback?: | CallOptions | Callback< @@ -1698,7 +1698,7 @@ export class SecurityCenterClient { >; } groupAssets( - request: protos.google.cloud.securitycenter.v1beta1.IGroupAssetsRequest, + request?: protos.google.cloud.securitycenter.v1beta1.IGroupAssetsRequest, options?: CallOptions ): Promise< [ @@ -1828,7 +1828,7 @@ export class SecurityCenterClient { * for more details and examples. */ groupAssets( - request: protos.google.cloud.securitycenter.v1beta1.IGroupAssetsRequest, + request?: protos.google.cloud.securitycenter.v1beta1.IGroupAssetsRequest, optionsOrCallback?: | CallOptions | PaginationCallback< @@ -2112,7 +2112,7 @@ export class SecurityCenterClient { ) as AsyncIterable; } groupFindings( - request: protos.google.cloud.securitycenter.v1beta1.IGroupFindingsRequest, + request?: protos.google.cloud.securitycenter.v1beta1.IGroupFindingsRequest, options?: CallOptions ): Promise< [ @@ -2220,7 +2220,7 @@ export class SecurityCenterClient { * for more details and examples. */ groupFindings( - request: protos.google.cloud.securitycenter.v1beta1.IGroupFindingsRequest, + request?: protos.google.cloud.securitycenter.v1beta1.IGroupFindingsRequest, optionsOrCallback?: | CallOptions | PaginationCallback< @@ -2454,7 +2454,7 @@ export class SecurityCenterClient { ) as AsyncIterable; } listAssets( - request: protos.google.cloud.securitycenter.v1beta1.IListAssetsRequest, + request?: protos.google.cloud.securitycenter.v1beta1.IListAssetsRequest, options?: CallOptions ): Promise< [ @@ -2583,7 +2583,7 @@ export class SecurityCenterClient { * for more details and examples. */ listAssets( - request: protos.google.cloud.securitycenter.v1beta1.IListAssetsRequest, + request?: protos.google.cloud.securitycenter.v1beta1.IListAssetsRequest, optionsOrCallback?: | CallOptions | PaginationCallback< @@ -2867,7 +2867,7 @@ export class SecurityCenterClient { ) as AsyncIterable; } listFindings( - request: protos.google.cloud.securitycenter.v1beta1.IListFindingsRequest, + request?: protos.google.cloud.securitycenter.v1beta1.IListFindingsRequest, options?: CallOptions ): Promise< [ @@ -2974,7 +2974,7 @@ export class SecurityCenterClient { * for more details and examples. */ listFindings( - request: protos.google.cloud.securitycenter.v1beta1.IListFindingsRequest, + request?: protos.google.cloud.securitycenter.v1beta1.IListFindingsRequest, optionsOrCallback?: | CallOptions | PaginationCallback< @@ -3208,7 +3208,7 @@ export class SecurityCenterClient { ) as AsyncIterable; } listSources( - request: protos.google.cloud.securitycenter.v1beta1.IListSourcesRequest, + request?: protos.google.cloud.securitycenter.v1beta1.IListSourcesRequest, options?: CallOptions ): Promise< [ @@ -3267,7 +3267,7 @@ export class SecurityCenterClient { * for more details and examples. */ listSources( - request: protos.google.cloud.securitycenter.v1beta1.IListSourcesRequest, + request?: protos.google.cloud.securitycenter.v1beta1.IListSourcesRequest, optionsOrCallback?: | CallOptions | PaginationCallback< diff --git a/packages/google-cloud-securitycenter/src/v1p1beta1/security_center_client.ts b/packages/google-cloud-securitycenter/src/v1p1beta1/security_center_client.ts index eb0fc5206d7..1483dbd0df5 100644 --- a/packages/google-cloud-securitycenter/src/v1p1beta1/security_center_client.ts +++ b/packages/google-cloud-securitycenter/src/v1p1beta1/security_center_client.ts @@ -434,7 +434,7 @@ export class SecurityCenterClient { // -- Service calls -- // ------------------- createSource( - request: protos.google.cloud.securitycenter.v1p1beta1.ICreateSourceRequest, + request?: protos.google.cloud.securitycenter.v1p1beta1.ICreateSourceRequest, options?: CallOptions ): Promise< [ @@ -489,7 +489,7 @@ export class SecurityCenterClient { * const [response] = await client.createSource(request); */ createSource( - request: protos.google.cloud.securitycenter.v1p1beta1.ICreateSourceRequest, + request?: protos.google.cloud.securitycenter.v1p1beta1.ICreateSourceRequest, optionsOrCallback?: | CallOptions | Callback< @@ -535,7 +535,7 @@ export class SecurityCenterClient { return this.innerApiCalls.createSource(request, options, callback); } createFinding( - request: protos.google.cloud.securitycenter.v1p1beta1.ICreateFindingRequest, + request?: protos.google.cloud.securitycenter.v1p1beta1.ICreateFindingRequest, options?: CallOptions ): Promise< [ @@ -593,7 +593,7 @@ export class SecurityCenterClient { * const [response] = await client.createFinding(request); */ createFinding( - request: protos.google.cloud.securitycenter.v1p1beta1.ICreateFindingRequest, + request?: protos.google.cloud.securitycenter.v1p1beta1.ICreateFindingRequest, optionsOrCallback?: | CallOptions | Callback< @@ -639,7 +639,7 @@ export class SecurityCenterClient { return this.innerApiCalls.createFinding(request, options, callback); } createNotificationConfig( - request: protos.google.cloud.securitycenter.v1p1beta1.ICreateNotificationConfigRequest, + request?: protos.google.cloud.securitycenter.v1p1beta1.ICreateNotificationConfigRequest, options?: CallOptions ): Promise< [ @@ -698,7 +698,7 @@ export class SecurityCenterClient { * const [response] = await client.createNotificationConfig(request); */ createNotificationConfig( - request: protos.google.cloud.securitycenter.v1p1beta1.ICreateNotificationConfigRequest, + request?: protos.google.cloud.securitycenter.v1p1beta1.ICreateNotificationConfigRequest, optionsOrCallback?: | CallOptions | Callback< @@ -748,7 +748,7 @@ export class SecurityCenterClient { ); } deleteNotificationConfig( - request: protos.google.cloud.securitycenter.v1p1beta1.IDeleteNotificationConfigRequest, + request?: protos.google.cloud.securitycenter.v1p1beta1.IDeleteNotificationConfigRequest, options?: CallOptions ): Promise< [ @@ -800,7 +800,7 @@ export class SecurityCenterClient { * const [response] = await client.deleteNotificationConfig(request); */ deleteNotificationConfig( - request: protos.google.cloud.securitycenter.v1p1beta1.IDeleteNotificationConfigRequest, + request?: protos.google.cloud.securitycenter.v1p1beta1.IDeleteNotificationConfigRequest, optionsOrCallback?: | CallOptions | Callback< @@ -850,7 +850,7 @@ export class SecurityCenterClient { ); } getIamPolicy( - request: protos.google.iam.v1.IGetIamPolicyRequest, + request?: protos.google.iam.v1.IGetIamPolicyRequest, options?: CallOptions ): Promise< [ @@ -898,7 +898,7 @@ export class SecurityCenterClient { * const [response] = await client.getIamPolicy(request); */ getIamPolicy( - request: protos.google.iam.v1.IGetIamPolicyRequest, + request?: protos.google.iam.v1.IGetIamPolicyRequest, optionsOrCallback?: | CallOptions | Callback< @@ -937,7 +937,7 @@ export class SecurityCenterClient { return this.innerApiCalls.getIamPolicy(request, options, callback); } getNotificationConfig( - request: protos.google.cloud.securitycenter.v1p1beta1.IGetNotificationConfigRequest, + request?: protos.google.cloud.securitycenter.v1p1beta1.IGetNotificationConfigRequest, options?: CallOptions ): Promise< [ @@ -989,7 +989,7 @@ export class SecurityCenterClient { * const [response] = await client.getNotificationConfig(request); */ getNotificationConfig( - request: protos.google.cloud.securitycenter.v1p1beta1.IGetNotificationConfigRequest, + request?: protos.google.cloud.securitycenter.v1p1beta1.IGetNotificationConfigRequest, optionsOrCallback?: | CallOptions | Callback< @@ -1035,7 +1035,7 @@ export class SecurityCenterClient { return this.innerApiCalls.getNotificationConfig(request, options, callback); } getOrganizationSettings( - request: protos.google.cloud.securitycenter.v1p1beta1.IGetOrganizationSettingsRequest, + request?: protos.google.cloud.securitycenter.v1p1beta1.IGetOrganizationSettingsRequest, options?: CallOptions ): Promise< [ @@ -1087,7 +1087,7 @@ export class SecurityCenterClient { * const [response] = await client.getOrganizationSettings(request); */ getOrganizationSettings( - request: protos.google.cloud.securitycenter.v1p1beta1.IGetOrganizationSettingsRequest, + request?: protos.google.cloud.securitycenter.v1p1beta1.IGetOrganizationSettingsRequest, optionsOrCallback?: | CallOptions | Callback< @@ -1137,7 +1137,7 @@ export class SecurityCenterClient { ); } getSource( - request: protos.google.cloud.securitycenter.v1p1beta1.IGetSourceRequest, + request?: protos.google.cloud.securitycenter.v1p1beta1.IGetSourceRequest, options?: CallOptions ): Promise< [ @@ -1189,7 +1189,7 @@ export class SecurityCenterClient { * const [response] = await client.getSource(request); */ getSource( - request: protos.google.cloud.securitycenter.v1p1beta1.IGetSourceRequest, + request?: protos.google.cloud.securitycenter.v1p1beta1.IGetSourceRequest, optionsOrCallback?: | CallOptions | Callback< @@ -1235,7 +1235,7 @@ export class SecurityCenterClient { return this.innerApiCalls.getSource(request, options, callback); } setFindingState( - request: protos.google.cloud.securitycenter.v1p1beta1.ISetFindingStateRequest, + request?: protos.google.cloud.securitycenter.v1p1beta1.ISetFindingStateRequest, options?: CallOptions ): Promise< [ @@ -1293,7 +1293,7 @@ export class SecurityCenterClient { * const [response] = await client.setFindingState(request); */ setFindingState( - request: protos.google.cloud.securitycenter.v1p1beta1.ISetFindingStateRequest, + request?: protos.google.cloud.securitycenter.v1p1beta1.ISetFindingStateRequest, optionsOrCallback?: | CallOptions | Callback< @@ -1339,7 +1339,7 @@ export class SecurityCenterClient { return this.innerApiCalls.setFindingState(request, options, callback); } setIamPolicy( - request: protos.google.iam.v1.ISetIamPolicyRequest, + request?: protos.google.iam.v1.ISetIamPolicyRequest, options?: CallOptions ): Promise< [ @@ -1389,7 +1389,7 @@ export class SecurityCenterClient { * const [response] = await client.setIamPolicy(request); */ setIamPolicy( - request: protos.google.iam.v1.ISetIamPolicyRequest, + request?: protos.google.iam.v1.ISetIamPolicyRequest, optionsOrCallback?: | CallOptions | Callback< @@ -1428,7 +1428,7 @@ export class SecurityCenterClient { return this.innerApiCalls.setIamPolicy(request, options, callback); } testIamPermissions( - request: protos.google.iam.v1.ITestIamPermissionsRequest, + request?: protos.google.iam.v1.ITestIamPermissionsRequest, options?: CallOptions ): Promise< [ @@ -1478,7 +1478,7 @@ export class SecurityCenterClient { * const [response] = await client.testIamPermissions(request); */ testIamPermissions( - request: protos.google.iam.v1.ITestIamPermissionsRequest, + request?: protos.google.iam.v1.ITestIamPermissionsRequest, optionsOrCallback?: | CallOptions | Callback< @@ -1517,7 +1517,7 @@ export class SecurityCenterClient { return this.innerApiCalls.testIamPermissions(request, options, callback); } updateFinding( - request: protos.google.cloud.securitycenter.v1p1beta1.IUpdateFindingRequest, + request?: protos.google.cloud.securitycenter.v1p1beta1.IUpdateFindingRequest, options?: CallOptions ): Promise< [ @@ -1582,7 +1582,7 @@ export class SecurityCenterClient { * const [response] = await client.updateFinding(request); */ updateFinding( - request: protos.google.cloud.securitycenter.v1p1beta1.IUpdateFindingRequest, + request?: protos.google.cloud.securitycenter.v1p1beta1.IUpdateFindingRequest, optionsOrCallback?: | CallOptions | Callback< @@ -1628,7 +1628,7 @@ export class SecurityCenterClient { return this.innerApiCalls.updateFinding(request, options, callback); } updateNotificationConfig( - request: protos.google.cloud.securitycenter.v1p1beta1.IUpdateNotificationConfigRequest, + request?: protos.google.cloud.securitycenter.v1p1beta1.IUpdateNotificationConfigRequest, options?: CallOptions ): Promise< [ @@ -1684,7 +1684,7 @@ export class SecurityCenterClient { * const [response] = await client.updateNotificationConfig(request); */ updateNotificationConfig( - request: protos.google.cloud.securitycenter.v1p1beta1.IUpdateNotificationConfigRequest, + request?: protos.google.cloud.securitycenter.v1p1beta1.IUpdateNotificationConfigRequest, optionsOrCallback?: | CallOptions | Callback< @@ -1734,7 +1734,7 @@ export class SecurityCenterClient { ); } updateOrganizationSettings( - request: protos.google.cloud.securitycenter.v1p1beta1.IUpdateOrganizationSettingsRequest, + request?: protos.google.cloud.securitycenter.v1p1beta1.IUpdateOrganizationSettingsRequest, options?: CallOptions ): Promise< [ @@ -1789,7 +1789,7 @@ export class SecurityCenterClient { * const [response] = await client.updateOrganizationSettings(request); */ updateOrganizationSettings( - request: protos.google.cloud.securitycenter.v1p1beta1.IUpdateOrganizationSettingsRequest, + request?: protos.google.cloud.securitycenter.v1p1beta1.IUpdateOrganizationSettingsRequest, optionsOrCallback?: | CallOptions | Callback< @@ -1839,7 +1839,7 @@ export class SecurityCenterClient { ); } updateSource( - request: protos.google.cloud.securitycenter.v1p1beta1.IUpdateSourceRequest, + request?: protos.google.cloud.securitycenter.v1p1beta1.IUpdateSourceRequest, options?: CallOptions ): Promise< [ @@ -1894,7 +1894,7 @@ export class SecurityCenterClient { * const [response] = await client.updateSource(request); */ updateSource( - request: protos.google.cloud.securitycenter.v1p1beta1.IUpdateSourceRequest, + request?: protos.google.cloud.securitycenter.v1p1beta1.IUpdateSourceRequest, optionsOrCallback?: | CallOptions | Callback< @@ -1940,7 +1940,7 @@ export class SecurityCenterClient { return this.innerApiCalls.updateSource(request, options, callback); } updateSecurityMarks( - request: protos.google.cloud.securitycenter.v1p1beta1.IUpdateSecurityMarksRequest, + request?: protos.google.cloud.securitycenter.v1p1beta1.IUpdateSecurityMarksRequest, options?: CallOptions ): Promise< [ @@ -2001,7 +2001,7 @@ export class SecurityCenterClient { * const [response] = await client.updateSecurityMarks(request); */ updateSecurityMarks( - request: protos.google.cloud.securitycenter.v1p1beta1.IUpdateSecurityMarksRequest, + request?: protos.google.cloud.securitycenter.v1p1beta1.IUpdateSecurityMarksRequest, optionsOrCallback?: | CallOptions | Callback< @@ -2048,7 +2048,7 @@ export class SecurityCenterClient { } runAssetDiscovery( - request: protos.google.cloud.securitycenter.v1p1beta1.IRunAssetDiscoveryRequest, + request?: protos.google.cloud.securitycenter.v1p1beta1.IRunAssetDiscoveryRequest, options?: CallOptions ): Promise< [ @@ -2110,7 +2110,7 @@ export class SecurityCenterClient { * const [response] = await operation.promise(); */ runAssetDiscovery( - request: protos.google.cloud.securitycenter.v1p1beta1.IRunAssetDiscoveryRequest, + request?: protos.google.cloud.securitycenter.v1p1beta1.IRunAssetDiscoveryRequest, optionsOrCallback?: | CallOptions | Callback< @@ -2195,7 +2195,7 @@ export class SecurityCenterClient { >; } groupAssets( - request: protos.google.cloud.securitycenter.v1p1beta1.IGroupAssetsRequest, + request?: protos.google.cloud.securitycenter.v1p1beta1.IGroupAssetsRequest, options?: CallOptions ): Promise< [ @@ -2371,7 +2371,7 @@ export class SecurityCenterClient { * for more details and examples. */ groupAssets( - request: protos.google.cloud.securitycenter.v1p1beta1.IGroupAssetsRequest, + request?: protos.google.cloud.securitycenter.v1p1beta1.IGroupAssetsRequest, optionsOrCallback?: | CallOptions | PaginationCallback< @@ -2747,7 +2747,7 @@ export class SecurityCenterClient { ) as AsyncIterable; } groupFindings( - request: protos.google.cloud.securitycenter.v1p1beta1.IGroupFindingsRequest, + request?: protos.google.cloud.securitycenter.v1p1beta1.IGroupFindingsRequest, options?: CallOptions ): Promise< [ @@ -2922,7 +2922,7 @@ export class SecurityCenterClient { * for more details and examples. */ groupFindings( - request: protos.google.cloud.securitycenter.v1p1beta1.IGroupFindingsRequest, + request?: protos.google.cloud.securitycenter.v1p1beta1.IGroupFindingsRequest, optionsOrCallback?: | CallOptions | PaginationCallback< @@ -3286,7 +3286,7 @@ export class SecurityCenterClient { ) as AsyncIterable; } listAssets( - request: protos.google.cloud.securitycenter.v1p1beta1.IListAssetsRequest, + request?: protos.google.cloud.securitycenter.v1p1beta1.IListAssetsRequest, options?: CallOptions ): Promise< [ @@ -3465,7 +3465,7 @@ export class SecurityCenterClient { * for more details and examples. */ listAssets( - request: protos.google.cloud.securitycenter.v1p1beta1.IListAssetsRequest, + request?: protos.google.cloud.securitycenter.v1p1beta1.IListAssetsRequest, optionsOrCallback?: | CallOptions | PaginationCallback< @@ -3849,7 +3849,7 @@ export class SecurityCenterClient { ) as AsyncIterable; } listFindings( - request: protos.google.cloud.securitycenter.v1p1beta1.IListFindingsRequest, + request?: protos.google.cloud.securitycenter.v1p1beta1.IListFindingsRequest, options?: CallOptions ): Promise< [ @@ -4025,7 +4025,7 @@ export class SecurityCenterClient { * for more details and examples. */ listFindings( - request: protos.google.cloud.securitycenter.v1p1beta1.IListFindingsRequest, + request?: protos.google.cloud.securitycenter.v1p1beta1.IListFindingsRequest, optionsOrCallback?: | CallOptions | PaginationCallback< @@ -4397,7 +4397,7 @@ export class SecurityCenterClient { ) as AsyncIterable; } listNotificationConfigs( - request: protos.google.cloud.securitycenter.v1p1beta1.IListNotificationConfigsRequest, + request?: protos.google.cloud.securitycenter.v1p1beta1.IListNotificationConfigsRequest, options?: CallOptions ): Promise< [ @@ -4456,7 +4456,7 @@ export class SecurityCenterClient { * for more details and examples. */ listNotificationConfigs( - request: protos.google.cloud.securitycenter.v1p1beta1.IListNotificationConfigsRequest, + request?: protos.google.cloud.securitycenter.v1p1beta1.IListNotificationConfigsRequest, optionsOrCallback?: | CallOptions | PaginationCallback< @@ -4604,7 +4604,7 @@ export class SecurityCenterClient { ) as AsyncIterable; } listSources( - request: protos.google.cloud.securitycenter.v1p1beta1.IListSourcesRequest, + request?: protos.google.cloud.securitycenter.v1p1beta1.IListSourcesRequest, options?: CallOptions ): Promise< [ @@ -4664,7 +4664,7 @@ export class SecurityCenterClient { * for more details and examples. */ listSources( - request: protos.google.cloud.securitycenter.v1p1beta1.IListSourcesRequest, + request?: protos.google.cloud.securitycenter.v1p1beta1.IListSourcesRequest, optionsOrCallback?: | CallOptions | PaginationCallback< From 894868bf06952fcd4b85696274722b30359c3d25 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 29 Jun 2021 09:38:50 -0700 Subject: [PATCH 260/342] chore: release 5.3.2 (#397) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- packages/google-cloud-securitycenter/CHANGELOG.md | 7 +++++++ packages/google-cloud-securitycenter/package.json | 2 +- packages/google-cloud-securitycenter/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-securitycenter/CHANGELOG.md b/packages/google-cloud-securitycenter/CHANGELOG.md index a5894e520f0..1e3928aa158 100644 --- a/packages/google-cloud-securitycenter/CHANGELOG.md +++ b/packages/google-cloud-securitycenter/CHANGELOG.md @@ -4,6 +4,13 @@ [1]: https://www.npmjs.com/package/@google-cloud/security-center?activeTab=versions +### [5.3.2](https://www.github.com/googleapis/nodejs-security-center/compare/v5.3.1...v5.3.2) (2021-06-25) + + +### Bug Fixes + +* make request optional in all cases ([#396](https://www.github.com/googleapis/nodejs-security-center/issues/396)) ([871b0d3](https://www.github.com/googleapis/nodejs-security-center/commit/871b0d3c26878f1a836ec186fb66be08073ed899)) + ### [5.3.1](https://www.github.com/googleapis/nodejs-security-center/compare/v5.3.0...v5.3.1) (2021-05-25) diff --git a/packages/google-cloud-securitycenter/package.json b/packages/google-cloud-securitycenter/package.json index d6b8170a47b..1fb5a792d79 100644 --- a/packages/google-cloud-securitycenter/package.json +++ b/packages/google-cloud-securitycenter/package.json @@ -1,7 +1,7 @@ { "name": "@google-cloud/security-center", "description": "Cloud Security Command Center API client for Node.js", - "version": "5.3.1", + "version": "5.3.2", "license": "Apache-2.0", "author": "Google LLC", "engines": { diff --git a/packages/google-cloud-securitycenter/samples/package.json b/packages/google-cloud-securitycenter/samples/package.json index c3deaed11ab..e32f1f24889 100644 --- a/packages/google-cloud-securitycenter/samples/package.json +++ b/packages/google-cloud-securitycenter/samples/package.json @@ -14,7 +14,7 @@ "license": "Apache-2.0", "dependencies": { "@google-cloud/pubsub": "^2.0.0", - "@google-cloud/security-center": "^5.3.1" + "@google-cloud/security-center": "^5.3.2" }, "devDependencies": { "chai": "^4.2.0", From f50374da91eed84de4929de01b53decf145cc253 Mon Sep 17 00:00:00 2001 From: "Benjamin E. Coe" Date: Wed, 30 Jun 2021 12:16:45 -0400 Subject: [PATCH 261/342] fix(deps): google-gax v2.17.0 with mTLS (#400) --- packages/google-cloud-securitycenter/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-securitycenter/package.json b/packages/google-cloud-securitycenter/package.json index 1fb5a792d79..2db1d9b9ed6 100644 --- a/packages/google-cloud-securitycenter/package.json +++ b/packages/google-cloud-securitycenter/package.json @@ -42,7 +42,7 @@ "Security Command Center API" ], "dependencies": { - "google-gax": "^2.12.0" + "google-gax": "^2.17.0" }, "devDependencies": { "@types/mocha": "^8.0.0", From 2ac33520d4c105285741f17211d00f5899bb17d7 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 30 Jun 2021 16:30:30 +0000 Subject: [PATCH 262/342] chore: release 5.3.3 (#402) :robot: I have created a release \*beep\* \*boop\* --- ### [5.3.3](https://www.github.com/googleapis/nodejs-security-center/compare/v5.3.2...v5.3.3) (2021-06-30) ### Bug Fixes * **deps:** google-gax v2.17.0 with mTLS ([#400](https://www.github.com/googleapis/nodejs-security-center/issues/400)) ([0f35393](https://www.github.com/googleapis/nodejs-security-center/commit/0f35393b8e64fdabc170eb264de5e5a54a0c6f2e)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- packages/google-cloud-securitycenter/CHANGELOG.md | 7 +++++++ packages/google-cloud-securitycenter/package.json | 2 +- packages/google-cloud-securitycenter/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-securitycenter/CHANGELOG.md b/packages/google-cloud-securitycenter/CHANGELOG.md index 1e3928aa158..ee7157d937f 100644 --- a/packages/google-cloud-securitycenter/CHANGELOG.md +++ b/packages/google-cloud-securitycenter/CHANGELOG.md @@ -4,6 +4,13 @@ [1]: https://www.npmjs.com/package/@google-cloud/security-center?activeTab=versions +### [5.3.3](https://www.github.com/googleapis/nodejs-security-center/compare/v5.3.2...v5.3.3) (2021-06-30) + + +### Bug Fixes + +* **deps:** google-gax v2.17.0 with mTLS ([#400](https://www.github.com/googleapis/nodejs-security-center/issues/400)) ([0f35393](https://www.github.com/googleapis/nodejs-security-center/commit/0f35393b8e64fdabc170eb264de5e5a54a0c6f2e)) + ### [5.3.2](https://www.github.com/googleapis/nodejs-security-center/compare/v5.3.1...v5.3.2) (2021-06-25) diff --git a/packages/google-cloud-securitycenter/package.json b/packages/google-cloud-securitycenter/package.json index 2db1d9b9ed6..203c29bed37 100644 --- a/packages/google-cloud-securitycenter/package.json +++ b/packages/google-cloud-securitycenter/package.json @@ -1,7 +1,7 @@ { "name": "@google-cloud/security-center", "description": "Cloud Security Command Center API client for Node.js", - "version": "5.3.2", + "version": "5.3.3", "license": "Apache-2.0", "author": "Google LLC", "engines": { diff --git a/packages/google-cloud-securitycenter/samples/package.json b/packages/google-cloud-securitycenter/samples/package.json index e32f1f24889..da224d58ea1 100644 --- a/packages/google-cloud-securitycenter/samples/package.json +++ b/packages/google-cloud-securitycenter/samples/package.json @@ -14,7 +14,7 @@ "license": "Apache-2.0", "dependencies": { "@google-cloud/pubsub": "^2.0.0", - "@google-cloud/security-center": "^5.3.2" + "@google-cloud/security-center": "^5.3.3" }, "devDependencies": { "chai": "^4.2.0", From 3dc0d7d41109827ef2f4d14ac2bcbab66016927c Mon Sep 17 00:00:00 2001 From: "Benjamin E. Coe" Date: Mon, 12 Jul 2021 17:46:19 -0400 Subject: [PATCH 263/342] fix(deps): google-gax v2.17.1 (#403) --- packages/google-cloud-securitycenter/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-securitycenter/package.json b/packages/google-cloud-securitycenter/package.json index 203c29bed37..62dc997f886 100644 --- a/packages/google-cloud-securitycenter/package.json +++ b/packages/google-cloud-securitycenter/package.json @@ -42,7 +42,7 @@ "Security Command Center API" ], "dependencies": { - "google-gax": "^2.17.0" + "google-gax": "^2.17.1" }, "devDependencies": { "@types/mocha": "^8.0.0", From f0697ac2097c2cb863b7fc678370fcaf4efea219 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Mon, 12 Jul 2021 22:22:29 +0000 Subject: [PATCH 264/342] chore: release 5.3.4 (#404) :robot: I have created a release \*beep\* \*boop\* --- ### [5.3.4](https://www.github.com/googleapis/nodejs-security-center/compare/v5.3.3...v5.3.4) (2021-07-12) ### Bug Fixes * **deps:** google-gax v2.17.1 ([#403](https://www.github.com/googleapis/nodejs-security-center/issues/403)) ([5bc78fb](https://www.github.com/googleapis/nodejs-security-center/commit/5bc78fbd4b038320032d8905af064a42d62e0c2f)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- packages/google-cloud-securitycenter/CHANGELOG.md | 7 +++++++ packages/google-cloud-securitycenter/package.json | 2 +- packages/google-cloud-securitycenter/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-securitycenter/CHANGELOG.md b/packages/google-cloud-securitycenter/CHANGELOG.md index ee7157d937f..ce109fde390 100644 --- a/packages/google-cloud-securitycenter/CHANGELOG.md +++ b/packages/google-cloud-securitycenter/CHANGELOG.md @@ -4,6 +4,13 @@ [1]: https://www.npmjs.com/package/@google-cloud/security-center?activeTab=versions +### [5.3.4](https://www.github.com/googleapis/nodejs-security-center/compare/v5.3.3...v5.3.4) (2021-07-12) + + +### Bug Fixes + +* **deps:** google-gax v2.17.1 ([#403](https://www.github.com/googleapis/nodejs-security-center/issues/403)) ([5bc78fb](https://www.github.com/googleapis/nodejs-security-center/commit/5bc78fbd4b038320032d8905af064a42d62e0c2f)) + ### [5.3.3](https://www.github.com/googleapis/nodejs-security-center/compare/v5.3.2...v5.3.3) (2021-06-30) diff --git a/packages/google-cloud-securitycenter/package.json b/packages/google-cloud-securitycenter/package.json index 62dc997f886..f873e7fbb30 100644 --- a/packages/google-cloud-securitycenter/package.json +++ b/packages/google-cloud-securitycenter/package.json @@ -1,7 +1,7 @@ { "name": "@google-cloud/security-center", "description": "Cloud Security Command Center API client for Node.js", - "version": "5.3.3", + "version": "5.3.4", "license": "Apache-2.0", "author": "Google LLC", "engines": { diff --git a/packages/google-cloud-securitycenter/samples/package.json b/packages/google-cloud-securitycenter/samples/package.json index da224d58ea1..014f50a17e8 100644 --- a/packages/google-cloud-securitycenter/samples/package.json +++ b/packages/google-cloud-securitycenter/samples/package.json @@ -14,7 +14,7 @@ "license": "Apache-2.0", "dependencies": { "@google-cloud/pubsub": "^2.0.0", - "@google-cloud/security-center": "^5.3.3" + "@google-cloud/security-center": "^5.3.4" }, "devDependencies": { "chai": "^4.2.0", From 68649bb326ba07b196be2e2fb89dcd8799f424f2 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Fri, 16 Jul 2021 19:08:46 +0000 Subject: [PATCH 265/342] fix: Updating WORKSPACE files to use the newest version of the Typescript generator. (#405) Also removing the explicit generator tag for the IAMPolicy mixin for the kms and pubsub APIS as the generator will now read it from the .yaml file. PiperOrigin-RevId: 385101839 Source-Link: https://github.com/googleapis/googleapis/commit/80f404215a9346259db760d80d0671f28c433453 Source-Link: https://github.com/googleapis/googleapis-gen/commit/d3509d2520fb8db862129633f1cf8406d17454e1 --- .../src/v1/security_center_client.ts | 11 ++++++++++- .../src/v1beta1/security_center_client.ts | 11 ++++++++++- .../src/v1p1beta1/security_center_client.ts | 11 ++++++++++- 3 files changed, 30 insertions(+), 3 deletions(-) diff --git a/packages/google-cloud-securitycenter/src/v1/security_center_client.ts b/packages/google-cloud-securitycenter/src/v1/security_center_client.ts index 848abd01d93..90cbe719ddc 100644 --- a/packages/google-cloud-securitycenter/src/v1/security_center_client.ts +++ b/packages/google-cloud-securitycenter/src/v1/security_center_client.ts @@ -49,6 +49,7 @@ const version = require('../../../package.json').version; export class SecurityCenterClient { 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: {}; @@ -60,6 +61,7 @@ export class SecurityCenterClient { longrunning: {}, batching: {}, }; + warn: (code: string, message: string, warnType?: string) => void; innerApiCalls: {[name: string]: Function}; pathTemplates: {[name: string]: gax.PathTemplate}; operationsClient: gax.OperationsClient; @@ -104,6 +106,9 @@ export class SecurityCenterClient { const staticMembers = this.constructor as typeof SecurityCenterClient; 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 = @@ -290,6 +295,9 @@ export class SecurityCenterClient { // of calling the API is handled in `google-gax`, with this code // merely providing the destination and request information. this.innerApiCalls = {}; + + // Add a warn function to the client constructor so it can be easily tested. + this.warn = gax.warn; } /** @@ -318,7 +326,8 @@ export class SecurityCenterClient { ) : // eslint-disable-next-line @typescript-eslint/no-explicit-any (this._protos as any).google.cloud.securitycenter.v1.SecurityCenter, - this._opts + this._opts, + this._providedCustomServicePath ) as Promise<{[method: string]: Function}>; // Iterate over each of the methods that the service provides diff --git a/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.ts b/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.ts index 30b86f260b2..5d1412ee9cc 100644 --- a/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.ts +++ b/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.ts @@ -49,6 +49,7 @@ const version = require('../../../package.json').version; export class SecurityCenterClient { 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: {}; @@ -60,6 +61,7 @@ export class SecurityCenterClient { longrunning: {}, batching: {}, }; + warn: (code: string, message: string, warnType?: string) => void; innerApiCalls: {[name: string]: Function}; pathTemplates: {[name: string]: gax.PathTemplate}; operationsClient: gax.OperationsClient; @@ -104,6 +106,9 @@ export class SecurityCenterClient { const staticMembers = this.constructor as typeof SecurityCenterClient; 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 = @@ -250,6 +255,9 @@ export class SecurityCenterClient { // of calling the API is handled in `google-gax`, with this code // merely providing the destination and request information. this.innerApiCalls = {}; + + // Add a warn function to the client constructor so it can be easily tested. + this.warn = gax.warn; } /** @@ -279,7 +287,8 @@ export class SecurityCenterClient { : // eslint-disable-next-line @typescript-eslint/no-explicit-any (this._protos as any).google.cloud.securitycenter.v1beta1 .SecurityCenter, - this._opts + this._opts, + this._providedCustomServicePath ) as Promise<{[method: string]: Function}>; // Iterate over each of the methods that the service provides diff --git a/packages/google-cloud-securitycenter/src/v1p1beta1/security_center_client.ts b/packages/google-cloud-securitycenter/src/v1p1beta1/security_center_client.ts index 1483dbd0df5..eb476ff8637 100644 --- a/packages/google-cloud-securitycenter/src/v1p1beta1/security_center_client.ts +++ b/packages/google-cloud-securitycenter/src/v1p1beta1/security_center_client.ts @@ -49,6 +49,7 @@ const version = require('../../../package.json').version; export class SecurityCenterClient { 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: {}; @@ -60,6 +61,7 @@ export class SecurityCenterClient { longrunning: {}, batching: {}, }; + warn: (code: string, message: string, warnType?: string) => void; innerApiCalls: {[name: string]: Function}; pathTemplates: {[name: string]: gax.PathTemplate}; operationsClient: gax.OperationsClient; @@ -104,6 +106,9 @@ export class SecurityCenterClient { const staticMembers = this.constructor as typeof SecurityCenterClient; 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 = @@ -290,6 +295,9 @@ export class SecurityCenterClient { // of calling the API is handled in `google-gax`, with this code // merely providing the destination and request information. this.innerApiCalls = {}; + + // Add a warn function to the client constructor so it can be easily tested. + this.warn = gax.warn; } /** @@ -319,7 +327,8 @@ export class SecurityCenterClient { : // eslint-disable-next-line @typescript-eslint/no-explicit-any (this._protos as any).google.cloud.securitycenter.v1p1beta1 .SecurityCenter, - this._opts + this._opts, + this._providedCustomServicePath ) as Promise<{[method: string]: Function}>; // Iterate over each of the methods that the service provides From d10a1441a9c44e4774462c8ed1696f2e9e443872 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Fri, 16 Jul 2021 12:50:17 -0700 Subject: [PATCH 266/342] chore: release 5.3.5 (#406) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- packages/google-cloud-securitycenter/CHANGELOG.md | 7 +++++++ packages/google-cloud-securitycenter/package.json | 2 +- packages/google-cloud-securitycenter/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-securitycenter/CHANGELOG.md b/packages/google-cloud-securitycenter/CHANGELOG.md index ce109fde390..ac047e36108 100644 --- a/packages/google-cloud-securitycenter/CHANGELOG.md +++ b/packages/google-cloud-securitycenter/CHANGELOG.md @@ -4,6 +4,13 @@ [1]: https://www.npmjs.com/package/@google-cloud/security-center?activeTab=versions +### [5.3.5](https://www.github.com/googleapis/nodejs-security-center/compare/v5.3.4...v5.3.5) (2021-07-16) + + +### Bug Fixes + +* Updating WORKSPACE files to use the newest version of the Typescript generator. ([#405](https://www.github.com/googleapis/nodejs-security-center/issues/405)) ([91dacef](https://www.github.com/googleapis/nodejs-security-center/commit/91dacef6d656cf1cd41803b337524c417498de1e)) + ### [5.3.4](https://www.github.com/googleapis/nodejs-security-center/compare/v5.3.3...v5.3.4) (2021-07-12) diff --git a/packages/google-cloud-securitycenter/package.json b/packages/google-cloud-securitycenter/package.json index f873e7fbb30..2ede80dd3a3 100644 --- a/packages/google-cloud-securitycenter/package.json +++ b/packages/google-cloud-securitycenter/package.json @@ -1,7 +1,7 @@ { "name": "@google-cloud/security-center", "description": "Cloud Security Command Center API client for Node.js", - "version": "5.3.4", + "version": "5.3.5", "license": "Apache-2.0", "author": "Google LLC", "engines": { diff --git a/packages/google-cloud-securitycenter/samples/package.json b/packages/google-cloud-securitycenter/samples/package.json index 014f50a17e8..3d5e1375120 100644 --- a/packages/google-cloud-securitycenter/samples/package.json +++ b/packages/google-cloud-securitycenter/samples/package.json @@ -14,7 +14,7 @@ "license": "Apache-2.0", "dependencies": { "@google-cloud/pubsub": "^2.0.0", - "@google-cloud/security-center": "^5.3.4" + "@google-cloud/security-center": "^5.3.5" }, "devDependencies": { "chai": "^4.2.0", From a69016d8aecf698bded11647b3ba50fcc1c73860 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Fri, 30 Jul 2021 11:46:15 -0500 Subject: [PATCH 267/342] feat: add finding_class and indicator fields in Finding (#409) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: add finding_class and indicator fields in Finding finding_class field is added in order to help our customer to quickly identify and categorize the different findings (threat, vulnerability, misconfiguration, ...). And indicator field is generated to indicate the domain and IP addresses that is causing the threat. PiperOrigin-RevId: 386975549 Source-Link: https://github.com/googleapis/googleapis/commit/5bf36f20f8e49c18620bf20a45645310f5bf6950 Source-Link: https://github.com/googleapis/googleapis-gen/commit/b9ab677eb147fbf3eb3b1d501f90b9d3f8078872 * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/master/packages/owl-bot/README.md Co-authored-by: Owl Bot --- .../cloud/securitycenter/v1/finding.proto | 31 ++ .../cloud/securitycenter/v1/indicator.proto | 40 +++ .../v1/securitycenter_service.proto | 121 +++---- .../protos/protos.d.ts | 117 ++++++ .../protos/protos.js | 339 ++++++++++++++++++ .../protos/protos.json | 31 ++ .../src/v1/security_center_client.ts | 77 ++-- .../src/v1/security_center_proto_list.json | 1 + 8 files changed, 654 insertions(+), 103 deletions(-) create mode 100644 packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/indicator.proto diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/finding.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/finding.proto index 84abc862b0b..ee4026dad2a 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/finding.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/finding.proto @@ -18,6 +18,7 @@ package google.cloud.securitycenter.v1; import "google/api/field_behavior.proto"; import "google/api/resource.proto"; +import "google/cloud/securitycenter/v1/indicator.proto"; import "google/cloud/securitycenter/v1/security_marks.proto"; import "google/protobuf/struct.proto"; import "google/protobuf/timestamp.proto"; @@ -117,6 +118,26 @@ message Finding { LOW = 4; } + // Represents what kind of Finding it is. + enum FindingClass { + // Unspecified finding class. + FINDING_CLASS_UNSPECIFIED = 0; + + // Describes unwanted or malicious activity. + THREAT = 1; + + // Describes a potential weakness in software that increases risk to + // Confidentiality & Integrity & Availability. + VULNERABILITY = 2; + + // Describes a potential weakness in cloud resource/asset configuration that + // increases risk. + MISCONFIGURATION = 3; + + // Describes a security observation that is for informational purposes. + OBSERVATION = 4; + } + // The relative resource name of this finding. See: // https://cloud.google.com/apis/design/resource_names#relative_resource_name // Example: @@ -184,4 +205,14 @@ message Finding { // depending on the closest CRM ancestor of the resource associated with the // finding. string canonical_name = 14; + + // The class of the finding. + FindingClass finding_class = 17; + + // Represents what's commonly known as an Indicator of compromise (IoC) in + // computer forensics. This is an artifact observed on a network or in an + // operating system that, with high confidence, indicates a computer + // intrusion. + // Reference: https://en.wikipedia.org/wiki/Indicator_of_compromise + Indicator indicator = 18; } diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/indicator.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/indicator.proto new file mode 100644 index 00000000000..f785156ffce --- /dev/null +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/indicator.proto @@ -0,0 +1,40 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.securitycenter.v1; + +import "google/api/annotations.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1;securitycenter"; +option java_multiple_files = true; +option java_outer_classname = "IndicatorProto"; +option java_package = "com.google.cloud.securitycenter.v1"; +option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; +option php_namespace = "Google\\Cloud\\SecurityCenter\\V1"; +option ruby_package = "Google::Cloud::SecurityCenter::V1"; + + +// Represents what's commonly known as an Indicator of compromise (IoC) in +// computer forensics. This is an artifact observed on a network or in an +// operating system that, with high confidence, indicates a computer intrusion. +// Reference: https://en.wikipedia.org/wiki/Indicator_of_compromise +message Indicator { + // List of ip addresses associated to the Finding. + repeated string ip_addresses = 1; + + // List of domains associated to the Finding. + repeated string domains = 2; +} diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/securitycenter_service.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/securitycenter_service.proto index af4b5fd31f2..0392de5ce3c 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/securitycenter_service.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/securitycenter_service.proto @@ -17,7 +17,6 @@ syntax = "proto3"; package google.cloud.securitycenter.v1; import public "google/cloud/securitycenter/v1/run_asset_discovery_response.proto"; - import "google/api/annotations.proto"; import "google/api/client.proto"; import "google/api/field_behavior.proto"; @@ -48,8 +47,7 @@ option ruby_package = "Google::Cloud::SecurityCenter::V1"; // V1 APIs for Security Center service. service SecurityCenter { option (google.api.default_host) = "securitycenter.googleapis.com"; - option (google.api.oauth_scopes) = - "https://www.googleapis.com/auth/cloud-platform"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; // Creates a source. rpc CreateSource(CreateSourceRequest) returns (Source) { @@ -71,20 +69,17 @@ service SecurityCenter { } // Creates a notification config. - rpc CreateNotificationConfig(CreateNotificationConfigRequest) - returns (NotificationConfig) { + rpc CreateNotificationConfig(CreateNotificationConfigRequest) returns (NotificationConfig) { option (google.api.http) = { post: "/v1/{parent=organizations/*}/notificationConfigs" body: "notification_config" }; - option (google.api.method_signature) = - "parent,config_id,notification_config"; + option (google.api.method_signature) = "parent,config_id,notification_config"; option (google.api.method_signature) = "parent,notification_config"; } // Deletes a notification config. - rpc DeleteNotificationConfig(DeleteNotificationConfigRequest) - returns (google.protobuf.Empty) { + rpc DeleteNotificationConfig(DeleteNotificationConfigRequest) returns (google.protobuf.Empty) { option (google.api.http) = { delete: "/v1/{name=organizations/*/notificationConfigs/*}" }; @@ -92,8 +87,7 @@ service SecurityCenter { } // Gets the access control policy on the specified Source. - rpc GetIamPolicy(google.iam.v1.GetIamPolicyRequest) - returns (google.iam.v1.Policy) { + rpc GetIamPolicy(google.iam.v1.GetIamPolicyRequest) returns (google.iam.v1.Policy) { option (google.api.http) = { post: "/v1/{resource=organizations/*/sources/*}:getIamPolicy" body: "*" @@ -102,8 +96,7 @@ service SecurityCenter { } // Gets a notification config. - rpc GetNotificationConfig(GetNotificationConfigRequest) - returns (NotificationConfig) { + rpc GetNotificationConfig(GetNotificationConfigRequest) returns (NotificationConfig) { option (google.api.http) = { get: "/v1/{name=organizations/*/notificationConfigs/*}" }; @@ -111,8 +104,7 @@ service SecurityCenter { } // Gets the settings for an organization. - rpc GetOrganizationSettings(GetOrganizationSettingsRequest) - returns (OrganizationSettings) { + rpc GetOrganizationSettings(GetOrganizationSettingsRequest) returns (OrganizationSettings) { option (google.api.http) = { get: "/v1/{name=organizations/*/organizationSettings}" }; @@ -171,8 +163,12 @@ service SecurityCenter { rpc ListAssets(ListAssetsRequest) returns (ListAssetsResponse) { option (google.api.http) = { get: "/v1/{parent=organizations/*}/assets" - additional_bindings { get: "/v1/{parent=folders/*}/assets" } - additional_bindings { get: "/v1/{parent=projects/*}/assets" } + additional_bindings { + get: "/v1/{parent=folders/*}/assets" + } + additional_bindings { + get: "/v1/{parent=projects/*}/assets" + } }; } @@ -183,14 +179,17 @@ service SecurityCenter { rpc ListFindings(ListFindingsRequest) returns (ListFindingsResponse) { option (google.api.http) = { get: "/v1/{parent=organizations/*/sources/*}/findings" - additional_bindings { get: "/v1/{parent=folders/*/sources/*}/findings" } - additional_bindings { get: "/v1/{parent=projects/*/sources/*}/findings" } + additional_bindings { + get: "/v1/{parent=folders/*/sources/*}/findings" + } + additional_bindings { + get: "/v1/{parent=projects/*/sources/*}/findings" + } }; } // Lists notification configs. - rpc ListNotificationConfigs(ListNotificationConfigsRequest) - returns (ListNotificationConfigsResponse) { + rpc ListNotificationConfigs(ListNotificationConfigsRequest) returns (ListNotificationConfigsResponse) { option (google.api.http) = { get: "/v1/{parent=organizations/*}/notificationConfigs" }; @@ -201,8 +200,12 @@ service SecurityCenter { rpc ListSources(ListSourcesRequest) returns (ListSourcesResponse) { option (google.api.http) = { get: "/v1/{parent=organizations/*}/sources" - additional_bindings { get: "/v1/{parent=folders/*}/sources" } - additional_bindings { get: "/v1/{parent=projects/*}/sources" } + additional_bindings { + get: "/v1/{parent=folders/*}/sources" + } + additional_bindings { + get: "/v1/{parent=projects/*}/sources" + } }; option (google.api.method_signature) = "parent"; } @@ -213,8 +216,7 @@ service SecurityCenter { // This API can only be called with limited frequency for an organization. If // it is called too frequently the caller will receive a TOO_MANY_REQUESTS // error. - rpc RunAssetDiscovery(RunAssetDiscoveryRequest) - returns (google.longrunning.Operation) { + rpc RunAssetDiscovery(RunAssetDiscoveryRequest) returns (google.longrunning.Operation) { option (google.api.http) = { post: "/v1/{parent=organizations/*}/assets:runDiscovery" body: "*" @@ -244,8 +246,7 @@ service SecurityCenter { } // Sets the access control policy on the specified Source. - rpc SetIamPolicy(google.iam.v1.SetIamPolicyRequest) - returns (google.iam.v1.Policy) { + rpc SetIamPolicy(google.iam.v1.SetIamPolicyRequest) returns (google.iam.v1.Policy) { option (google.api.http) = { post: "/v1/{resource=organizations/*/sources/*}:setIamPolicy" body: "*" @@ -254,8 +255,7 @@ service SecurityCenter { } // Returns the permissions that a caller has on the specified source. - rpc TestIamPermissions(google.iam.v1.TestIamPermissionsRequest) - returns (google.iam.v1.TestIamPermissionsResponse) { + rpc TestIamPermissions(google.iam.v1.TestIamPermissionsRequest) returns (google.iam.v1.TestIamPermissionsResponse) { option (google.api.http) = { post: "/v1/{resource=organizations/*/sources/*}:testIamPermissions" body: "*" @@ -284,8 +284,7 @@ service SecurityCenter { // // Updates a notification config. The following update // fields are allowed: description, pubsub_topic, streaming_config.filter - rpc UpdateNotificationConfig(UpdateNotificationConfigRequest) - returns (NotificationConfig) { + rpc UpdateNotificationConfig(UpdateNotificationConfigRequest) returns (NotificationConfig) { option (google.api.http) = { patch: "/v1/{notification_config.name=organizations/*/notificationConfigs/*}" body: "notification_config" @@ -295,8 +294,7 @@ service SecurityCenter { } // Updates an organization's settings. - rpc UpdateOrganizationSettings(UpdateOrganizationSettingsRequest) - returns (OrganizationSettings) { + rpc UpdateOrganizationSettings(UpdateOrganizationSettingsRequest) returns (OrganizationSettings) { option (google.api.http) = { patch: "/v1/{organization_settings.name=organizations/*/organizationSettings}" body: "organization_settings" @@ -359,15 +357,15 @@ message CreateFindingRequest { // greater than 0 characters in length. string finding_id = 2 [(google.api.field_behavior) = REQUIRED]; - // Required. The Finding being created. The name and security_marks will be - // ignored as they are both output only fields on this resource. + // Required. The Finding being created. The name and security_marks will be ignored as + // they are both output only fields on this resource. Finding finding = 3 [(google.api.field_behavior) = REQUIRED]; } // Request message for creating a notification config. message CreateNotificationConfigRequest { - // Required. Resource name of the new notification config's parent. Its format - // is "organizations/[organization_id]". + // Required. Resource name of the new notification config's parent. Its format is + // "organizations/[organization_id]". string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -381,11 +379,9 @@ message CreateNotificationConfigRequest { // characters, underscores or hyphens only. string config_id = 2 [(google.api.field_behavior) = REQUIRED]; - // Required. The notification config being created. The name and the service - // account will be ignored as they are both output only fields on this - // resource. - NotificationConfig notification_config = 3 - [(google.api.field_behavior) = REQUIRED]; + // Required. The notification config being created. The name and the service account + // will be ignored as they are both output only fields on this resource. + NotificationConfig notification_config = 3 [(google.api.field_behavior) = REQUIRED]; } // Request message for creating a source. @@ -399,8 +395,8 @@ message CreateSourceRequest { } ]; - // Required. The Source being created, only the display_name and description - // will be used. All other fields will be ignored. + // Required. The Source being created, only the display_name and description will be + // used. All other fields will be ignored. Source source = 2 [(google.api.field_behavior) = REQUIRED]; } @@ -430,8 +426,8 @@ message GetNotificationConfigRequest { // Request message for getting organization settings. message GetOrganizationSettingsRequest { - // Required. Name of the organization to get organization settings for. Its - // format is "organizations/[organization_id]/organizationSettings". + // Required. Name of the organization to get organization settings for. Its format is + // "organizations/[organization_id]/organizationSettings". string name = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -528,9 +524,9 @@ message GroupAssetsRequest { // property not existing: `-resource_properties.my_property : ""` string filter = 2; - // Required. Expression that defines what assets fields to use for grouping. - // The string value should follow SQL syntax: comma separated list of fields. - // For example: + // Required. Expression that defines what assets fields to use for grouping. The string + // value should follow SQL syntax: comma separated list of fields. For + // example: // "security_center_properties.resource_project,security_center_properties.project". // // The following fields are supported when compare_duration is not set: @@ -688,9 +684,9 @@ message GroupFindingsRequest { // * resource.type: `=`, `:` string filter = 2; - // Required. Expression that defines what assets fields to use for grouping - // (including `state_change`). The string value should follow SQL syntax: - // comma separated list of fields. For example: "parent,resource_name". + // Required. Expression that defines what assets fields to use for grouping (including + // `state_change`). The string value should follow SQL syntax: comma separated + // list of fields. For example: "parent,resource_name". // // The following fields are supported: // @@ -815,8 +811,8 @@ message ListNotificationConfigsResponse { // Request message for listing sources. message ListSourcesRequest { - // Required. Resource name of the parent of sources to list. Its format should - // be "organizations/[organization_id], folders/[folder_id], or + // Required. Resource name of the parent of sources to list. Its format should be + // "organizations/[organization_id], folders/[folder_id], or // projects/[project_id]". string parent = 1 [ (google.api.field_behavior) = REQUIRED, @@ -1284,14 +1280,13 @@ message SetFindingStateRequest { Finding.State state = 2 [(google.api.field_behavior) = REQUIRED]; // Required. The time at which the updated state takes effect. - google.protobuf.Timestamp start_time = 3 - [(google.api.field_behavior) = REQUIRED]; + google.protobuf.Timestamp start_time = 3 [(google.api.field_behavior) = REQUIRED]; } // Request message for running asset discovery for an organization. message RunAssetDiscoveryRequest { - // Required. Name of the organization to run asset discovery for. Its format - // is "organizations/[organization_id]". + // Required. Name of the organization to run asset discovery for. Its format is + // "organizations/[organization_id]". string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -1302,8 +1297,8 @@ message RunAssetDiscoveryRequest { // Request message for updating or creating a finding. message UpdateFindingRequest { - // Required. The finding resource to update or create if it does not already - // exist. parent, security_marks, and update_time will be ignored. + // Required. The finding resource to update or create if it does not already exist. + // parent, security_marks, and update_time will be ignored. // // In the case of creation, the finding id portion of the name must be // alphanumeric and less than or equal to 32 characters and greater than 0 @@ -1323,8 +1318,7 @@ message UpdateFindingRequest { // Request message for updating a notification config. message UpdateNotificationConfigRequest { // Required. The notification config to update. - NotificationConfig notification_config = 1 - [(google.api.field_behavior) = REQUIRED]; + NotificationConfig notification_config = 1 [(google.api.field_behavior) = REQUIRED]; // The FieldMask to use when updating the notification config. // @@ -1335,8 +1329,7 @@ message UpdateNotificationConfigRequest { // Request message for updating an organization's settings. message UpdateOrganizationSettingsRequest { // Required. The organization settings resource to update. - OrganizationSettings organization_settings = 1 - [(google.api.field_behavior) = REQUIRED]; + OrganizationSettings organization_settings = 1 [(google.api.field_behavior) = REQUIRED]; // The FieldMask to use when updating the settings resource. // diff --git a/packages/google-cloud-securitycenter/protos/protos.d.ts b/packages/google-cloud-securitycenter/protos/protos.d.ts index 1c66aa3f09c..5a946d11475 100644 --- a/packages/google-cloud-securitycenter/protos/protos.d.ts +++ b/packages/google-cloud-securitycenter/protos/protos.d.ts @@ -625,6 +625,12 @@ export namespace google { /** Finding canonicalName */ canonicalName?: (string|null); + + /** Finding findingClass */ + findingClass?: (google.cloud.securitycenter.v1.Finding.FindingClass|keyof typeof google.cloud.securitycenter.v1.Finding.FindingClass|null); + + /** Finding indicator */ + indicator?: (google.cloud.securitycenter.v1.IIndicator|null); } /** Represents a Finding. */ @@ -672,6 +678,12 @@ export namespace google { /** Finding canonicalName. */ public canonicalName: string; + /** Finding findingClass. */ + public findingClass: (google.cloud.securitycenter.v1.Finding.FindingClass|keyof typeof google.cloud.securitycenter.v1.Finding.FindingClass); + + /** Finding indicator. */ + public indicator?: (google.cloud.securitycenter.v1.IIndicator|null); + /** * Creates a new Finding instance using the specified properties. * @param [properties] Properties to set @@ -760,6 +772,111 @@ export namespace google { MEDIUM = 3, LOW = 4 } + + /** FindingClass enum. */ + enum FindingClass { + FINDING_CLASS_UNSPECIFIED = 0, + THREAT = 1, + VULNERABILITY = 2, + MISCONFIGURATION = 3, + OBSERVATION = 4 + } + } + + /** Properties of an Indicator. */ + interface IIndicator { + + /** Indicator ipAddresses */ + ipAddresses?: (string[]|null); + + /** Indicator domains */ + domains?: (string[]|null); + } + + /** Represents an Indicator. */ + class Indicator implements IIndicator { + + /** + * Constructs a new Indicator. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IIndicator); + + /** Indicator ipAddresses. */ + public ipAddresses: string[]; + + /** Indicator domains. */ + public domains: string[]; + + /** + * Creates a new Indicator instance using the specified properties. + * @param [properties] Properties to set + * @returns Indicator instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IIndicator): google.cloud.securitycenter.v1.Indicator; + + /** + * Encodes the specified Indicator message. Does not implicitly {@link google.cloud.securitycenter.v1.Indicator.verify|verify} messages. + * @param message Indicator message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IIndicator, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Indicator message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Indicator.verify|verify} messages. + * @param message Indicator message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IIndicator, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Indicator message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Indicator + * @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.cloud.securitycenter.v1.Indicator; + + /** + * Decodes an Indicator message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Indicator + * @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.cloud.securitycenter.v1.Indicator; + + /** + * Verifies an Indicator 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 Indicator message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Indicator + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.Indicator; + + /** + * Creates a plain object from an Indicator message. Also converts values to other types if specified. + * @param message Indicator + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.Indicator, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Indicator to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; } /** Properties of a NotificationConfig. */ diff --git a/packages/google-cloud-securitycenter/protos/protos.js b/packages/google-cloud-securitycenter/protos/protos.js index 89c16f0ef81..c5580746de3 100644 --- a/packages/google-cloud-securitycenter/protos/protos.js +++ b/packages/google-cloud-securitycenter/protos/protos.js @@ -1562,6 +1562,8 @@ * @property {google.protobuf.ITimestamp|null} [createTime] Finding createTime * @property {google.cloud.securitycenter.v1.Finding.Severity|null} [severity] Finding severity * @property {string|null} [canonicalName] Finding canonicalName + * @property {google.cloud.securitycenter.v1.Finding.FindingClass|null} [findingClass] Finding findingClass + * @property {google.cloud.securitycenter.v1.IIndicator|null} [indicator] Finding indicator */ /** @@ -1676,6 +1678,22 @@ */ Finding.prototype.canonicalName = ""; + /** + * Finding findingClass. + * @member {google.cloud.securitycenter.v1.Finding.FindingClass} findingClass + * @memberof google.cloud.securitycenter.v1.Finding + * @instance + */ + Finding.prototype.findingClass = 0; + + /** + * Finding indicator. + * @member {google.cloud.securitycenter.v1.IIndicator|null|undefined} indicator + * @memberof google.cloud.securitycenter.v1.Finding + * @instance + */ + Finding.prototype.indicator = null; + /** * Creates a new Finding instance using the specified properties. * @function create @@ -1727,6 +1745,10 @@ writer.uint32(/* id 12, wireType 0 =*/96).int32(message.severity); if (message.canonicalName != null && Object.hasOwnProperty.call(message, "canonicalName")) writer.uint32(/* id 14, wireType 2 =*/114).string(message.canonicalName); + if (message.findingClass != null && Object.hasOwnProperty.call(message, "findingClass")) + writer.uint32(/* id 17, wireType 0 =*/136).int32(message.findingClass); + if (message.indicator != null && Object.hasOwnProperty.call(message, "indicator")) + $root.google.cloud.securitycenter.v1.Indicator.encode(message.indicator, writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); return writer; }; @@ -1816,6 +1838,12 @@ case 14: message.canonicalName = reader.string(); break; + case 17: + message.findingClass = reader.int32(); + break; + case 18: + message.indicator = $root.google.cloud.securitycenter.v1.Indicator.decode(reader, reader.uint32()); + break; default: reader.skipType(tag & 7); break; @@ -1914,6 +1942,22 @@ if (message.canonicalName != null && message.hasOwnProperty("canonicalName")) if (!$util.isString(message.canonicalName)) return "canonicalName: string expected"; + if (message.findingClass != null && message.hasOwnProperty("findingClass")) + switch (message.findingClass) { + default: + return "findingClass: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.indicator != null && message.hasOwnProperty("indicator")) { + var error = $root.google.cloud.securitycenter.v1.Indicator.verify(message.indicator); + if (error) + return "indicator." + error; + } return null; }; @@ -2002,6 +2046,33 @@ } if (object.canonicalName != null) message.canonicalName = String(object.canonicalName); + switch (object.findingClass) { + case "FINDING_CLASS_UNSPECIFIED": + case 0: + message.findingClass = 0; + break; + case "THREAT": + case 1: + message.findingClass = 1; + break; + case "VULNERABILITY": + case 2: + message.findingClass = 2; + break; + case "MISCONFIGURATION": + case 3: + message.findingClass = 3; + break; + case "OBSERVATION": + case 4: + message.findingClass = 4; + break; + } + if (object.indicator != null) { + if (typeof object.indicator !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Finding.indicator: object expected"); + message.indicator = $root.google.cloud.securitycenter.v1.Indicator.fromObject(object.indicator); + } return message; }; @@ -2032,6 +2103,8 @@ object.createTime = null; object.severity = options.enums === String ? "SEVERITY_UNSPECIFIED" : 0; object.canonicalName = ""; + object.findingClass = options.enums === String ? "FINDING_CLASS_UNSPECIFIED" : 0; + object.indicator = null; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -2061,6 +2134,10 @@ object.severity = options.enums === String ? $root.google.cloud.securitycenter.v1.Finding.Severity[message.severity] : message.severity; if (message.canonicalName != null && message.hasOwnProperty("canonicalName")) object.canonicalName = message.canonicalName; + if (message.findingClass != null && message.hasOwnProperty("findingClass")) + object.findingClass = options.enums === String ? $root.google.cloud.securitycenter.v1.Finding.FindingClass[message.findingClass] : message.findingClass; + if (message.indicator != null && message.hasOwnProperty("indicator")) + object.indicator = $root.google.cloud.securitycenter.v1.Indicator.toObject(message.indicator, options); return object; }; @@ -2111,9 +2188,271 @@ return values; })(); + /** + * FindingClass enum. + * @name google.cloud.securitycenter.v1.Finding.FindingClass + * @enum {number} + * @property {number} FINDING_CLASS_UNSPECIFIED=0 FINDING_CLASS_UNSPECIFIED value + * @property {number} THREAT=1 THREAT value + * @property {number} VULNERABILITY=2 VULNERABILITY value + * @property {number} MISCONFIGURATION=3 MISCONFIGURATION value + * @property {number} OBSERVATION=4 OBSERVATION value + */ + Finding.FindingClass = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FINDING_CLASS_UNSPECIFIED"] = 0; + values[valuesById[1] = "THREAT"] = 1; + values[valuesById[2] = "VULNERABILITY"] = 2; + values[valuesById[3] = "MISCONFIGURATION"] = 3; + values[valuesById[4] = "OBSERVATION"] = 4; + return values; + })(); + return Finding; })(); + v1.Indicator = (function() { + + /** + * Properties of an Indicator. + * @memberof google.cloud.securitycenter.v1 + * @interface IIndicator + * @property {Array.|null} [ipAddresses] Indicator ipAddresses + * @property {Array.|null} [domains] Indicator domains + */ + + /** + * Constructs a new Indicator. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents an Indicator. + * @implements IIndicator + * @constructor + * @param {google.cloud.securitycenter.v1.IIndicator=} [properties] Properties to set + */ + function Indicator(properties) { + this.ipAddresses = []; + this.domains = []; + 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]]; + } + + /** + * Indicator ipAddresses. + * @member {Array.} ipAddresses + * @memberof google.cloud.securitycenter.v1.Indicator + * @instance + */ + Indicator.prototype.ipAddresses = $util.emptyArray; + + /** + * Indicator domains. + * @member {Array.} domains + * @memberof google.cloud.securitycenter.v1.Indicator + * @instance + */ + Indicator.prototype.domains = $util.emptyArray; + + /** + * Creates a new Indicator instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.Indicator + * @static + * @param {google.cloud.securitycenter.v1.IIndicator=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.Indicator} Indicator instance + */ + Indicator.create = function create(properties) { + return new Indicator(properties); + }; + + /** + * Encodes the specified Indicator message. Does not implicitly {@link google.cloud.securitycenter.v1.Indicator.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.Indicator + * @static + * @param {google.cloud.securitycenter.v1.IIndicator} message Indicator message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Indicator.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.ipAddresses != null && message.ipAddresses.length) + for (var i = 0; i < message.ipAddresses.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.ipAddresses[i]); + if (message.domains != null && message.domains.length) + for (var i = 0; i < message.domains.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.domains[i]); + return writer; + }; + + /** + * Encodes the specified Indicator message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Indicator.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.Indicator + * @static + * @param {google.cloud.securitycenter.v1.IIndicator} message Indicator message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Indicator.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Indicator message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.Indicator + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.Indicator} Indicator + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Indicator.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.cloud.securitycenter.v1.Indicator(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.ipAddresses && message.ipAddresses.length)) + message.ipAddresses = []; + message.ipAddresses.push(reader.string()); + break; + case 2: + if (!(message.domains && message.domains.length)) + message.domains = []; + message.domains.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Indicator message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.Indicator + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.Indicator} Indicator + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Indicator.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Indicator message. + * @function verify + * @memberof google.cloud.securitycenter.v1.Indicator + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Indicator.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.ipAddresses != null && message.hasOwnProperty("ipAddresses")) { + if (!Array.isArray(message.ipAddresses)) + return "ipAddresses: array expected"; + for (var i = 0; i < message.ipAddresses.length; ++i) + if (!$util.isString(message.ipAddresses[i])) + return "ipAddresses: string[] expected"; + } + if (message.domains != null && message.hasOwnProperty("domains")) { + if (!Array.isArray(message.domains)) + return "domains: array expected"; + for (var i = 0; i < message.domains.length; ++i) + if (!$util.isString(message.domains[i])) + return "domains: string[] expected"; + } + return null; + }; + + /** + * Creates an Indicator message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.Indicator + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.Indicator} Indicator + */ + Indicator.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.Indicator) + return object; + var message = new $root.google.cloud.securitycenter.v1.Indicator(); + if (object.ipAddresses) { + if (!Array.isArray(object.ipAddresses)) + throw TypeError(".google.cloud.securitycenter.v1.Indicator.ipAddresses: array expected"); + message.ipAddresses = []; + for (var i = 0; i < object.ipAddresses.length; ++i) + message.ipAddresses[i] = String(object.ipAddresses[i]); + } + if (object.domains) { + if (!Array.isArray(object.domains)) + throw TypeError(".google.cloud.securitycenter.v1.Indicator.domains: array expected"); + message.domains = []; + for (var i = 0; i < object.domains.length; ++i) + message.domains[i] = String(object.domains[i]); + } + return message; + }; + + /** + * Creates a plain object from an Indicator message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.Indicator + * @static + * @param {google.cloud.securitycenter.v1.Indicator} message Indicator + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Indicator.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.ipAddresses = []; + object.domains = []; + } + if (message.ipAddresses && message.ipAddresses.length) { + object.ipAddresses = []; + for (var j = 0; j < message.ipAddresses.length; ++j) + object.ipAddresses[j] = message.ipAddresses[j]; + } + if (message.domains && message.domains.length) { + object.domains = []; + for (var j = 0; j < message.domains.length; ++j) + object.domains[j] = message.domains[j]; + } + return object; + }; + + /** + * Converts this Indicator to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.Indicator + * @instance + * @returns {Object.} JSON object + */ + Indicator.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Indicator; + })(); + v1.NotificationConfig = (function() { /** diff --git a/packages/google-cloud-securitycenter/protos/protos.json b/packages/google-cloud-securitycenter/protos/protos.json index a667990855a..0ced60e408b 100644 --- a/packages/google-cloud-securitycenter/protos/protos.json +++ b/packages/google-cloud-securitycenter/protos/protos.json @@ -202,6 +202,14 @@ "canonicalName": { "type": "string", "id": 14 + }, + "findingClass": { + "type": "FindingClass", + "id": 17 + }, + "indicator": { + "type": "Indicator", + "id": 18 } }, "nested": { @@ -220,6 +228,29 @@ "MEDIUM": 3, "LOW": 4 } + }, + "FindingClass": { + "values": { + "FINDING_CLASS_UNSPECIFIED": 0, + "THREAT": 1, + "VULNERABILITY": 2, + "MISCONFIGURATION": 3, + "OBSERVATION": 4 + } + } + } + }, + "Indicator": { + "fields": { + "ipAddresses": { + "rule": "repeated", + "type": "string", + "id": 1 + }, + "domains": { + "rule": "repeated", + "type": "string", + "id": 2 } } }, diff --git a/packages/google-cloud-securitycenter/src/v1/security_center_client.ts b/packages/google-cloud-securitycenter/src/v1/security_center_client.ts index 90cbe719ddc..c7809e94b59 100644 --- a/packages/google-cloud-securitycenter/src/v1/security_center_client.ts +++ b/packages/google-cloud-securitycenter/src/v1/security_center_client.ts @@ -481,8 +481,8 @@ export class SecurityCenterClient { * Required. Resource name of the new source's parent. Its format should be * "organizations/[organization_id]". * @param {google.cloud.securitycenter.v1.Source} request.source - * Required. The Source being created, only the display_name and description - * will be used. All other fields will be ignored. + * Required. The Source being created, only the display_name and description will be + * used. All other fields will be ignored. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -581,8 +581,8 @@ export class SecurityCenterClient { * It must be alphanumeric and less than or equal to 32 characters and * greater than 0 characters in length. * @param {google.cloud.securitycenter.v1.Finding} request.finding - * Required. The Finding being created. The name and security_marks will be - * ignored as they are both output only fields on this resource. + * Required. The Finding being created. The name and security_marks will be ignored as + * they are both output only fields on this resource. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -676,17 +676,16 @@ export class SecurityCenterClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. Resource name of the new notification config's parent. Its format - * is "organizations/[organization_id]". + * Required. Resource name of the new notification config's parent. Its format is + * "organizations/[organization_id]". * @param {string} request.configId * Required. * Unique identifier provided by the client within the parent scope. * It must be between 1 and 128 characters, and contains alphanumeric * characters, underscores or hyphens only. * @param {google.cloud.securitycenter.v1.NotificationConfig} request.notificationConfig - * Required. The notification config being created. The name and the service - * account will be ignored as they are both output only fields on this - * resource. + * Required. The notification config being created. The name and the service account + * will be ignored as they are both output only fields on this resource. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -1074,8 +1073,8 @@ export class SecurityCenterClient { * @param {Object} request * The request object that will be sent. * @param {string} request.name - * Required. Name of the organization to get organization settings for. Its - * format is "organizations/[organization_id]/organizationSettings". + * Required. Name of the organization to get organization settings for. Its format is + * "organizations/[organization_id]/organizationSettings". * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -1542,8 +1541,8 @@ export class SecurityCenterClient { * @param {Object} request * The request object that will be sent. * @param {google.cloud.securitycenter.v1.Finding} request.finding - * Required. The finding resource to update or create if it does not already - * exist. parent, security_marks, and update_time will be ignored. + * Required. The finding resource to update or create if it does not already exist. + * parent, security_marks, and update_time will be ignored. * * In the case of creation, the finding id portion of the name must be * alphanumeric and less than or equal to 32 characters and greater than 0 @@ -2071,8 +2070,8 @@ export class SecurityCenterClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. Name of the organization to run asset discovery for. Its format - * is "organizations/[organization_id]". + * Required. Name of the organization to run asset discovery for. Its format is + * "organizations/[organization_id]". * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -2276,9 +2275,9 @@ export class SecurityCenterClient { * Use a negated partial match on the empty string to filter based on a * property not existing: `-resource_properties.my_property : ""` * @param {string} request.groupBy - * Required. Expression that defines what assets fields to use for grouping. - * The string value should follow SQL syntax: comma separated list of fields. - * For example: + * Required. Expression that defines what assets fields to use for grouping. The string + * value should follow SQL syntax: comma separated list of fields. For + * example: * "security_center_properties.resource_project,security_center_properties.project". * * The following fields are supported when compare_duration is not set: @@ -2463,9 +2462,9 @@ export class SecurityCenterClient { * Use a negated partial match on the empty string to filter based on a * property not existing: `-resource_properties.my_property : ""` * @param {string} request.groupBy - * Required. Expression that defines what assets fields to use for grouping. - * The string value should follow SQL syntax: comma separated list of fields. - * For example: + * Required. Expression that defines what assets fields to use for grouping. The string + * value should follow SQL syntax: comma separated list of fields. For + * example: * "security_center_properties.resource_project,security_center_properties.project". * * The following fields are supported when compare_duration is not set: @@ -2628,9 +2627,9 @@ export class SecurityCenterClient { * Use a negated partial match on the empty string to filter based on a * property not existing: `-resource_properties.my_property : ""` * @param {string} request.groupBy - * Required. Expression that defines what assets fields to use for grouping. - * The string value should follow SQL syntax: comma separated list of fields. - * For example: + * Required. Expression that defines what assets fields to use for grouping. The string + * value should follow SQL syntax: comma separated list of fields. For + * example: * "security_center_properties.resource_project,security_center_properties.project". * * The following fields are supported when compare_duration is not set: @@ -2834,9 +2833,9 @@ export class SecurityCenterClient { * * resource.project_display_name: `=`, `:` * * resource.type: `=`, `:` * @param {string} request.groupBy - * Required. Expression that defines what assets fields to use for grouping - * (including `state_change`). The string value should follow SQL syntax: - * comma separated list of fields. For example: "parent,resource_name". + * Required. Expression that defines what assets fields to use for grouping (including + * `state_change`). The string value should follow SQL syntax: comma separated + * list of fields. For example: "parent,resource_name". * * The following fields are supported: * @@ -3024,9 +3023,9 @@ export class SecurityCenterClient { * * resource.project_display_name: `=`, `:` * * resource.type: `=`, `:` * @param {string} request.groupBy - * Required. Expression that defines what assets fields to use for grouping - * (including `state_change`). The string value should follow SQL syntax: - * comma separated list of fields. For example: "parent,resource_name". + * Required. Expression that defines what assets fields to use for grouping (including + * `state_change`). The string value should follow SQL syntax: comma separated + * list of fields. For example: "parent,resource_name". * * The following fields are supported: * @@ -3192,9 +3191,9 @@ export class SecurityCenterClient { * * resource.project_display_name: `=`, `:` * * resource.type: `=`, `:` * @param {string} request.groupBy - * Required. Expression that defines what assets fields to use for grouping - * (including `state_change`). The string value should follow SQL syntax: - * comma separated list of fields. For example: "parent,resource_name". + * Required. Expression that defines what assets fields to use for grouping (including + * `state_change`). The string value should follow SQL syntax: comma separated + * list of fields. For example: "parent,resource_name". * * The following fields are supported: * @@ -4674,8 +4673,8 @@ export class SecurityCenterClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. Resource name of the parent of sources to list. Its format should - * be "organizations/[organization_id], folders/[folder_id], or + * Required. Resource name of the parent of sources to list. Its format should be + * "organizations/[organization_id], folders/[folder_id], or * projects/[project_id]". * @param {string} request.pageToken * The value returned by the last `ListSourcesResponse`; indicates @@ -4746,8 +4745,8 @@ export class SecurityCenterClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. Resource name of the parent of sources to list. Its format should - * be "organizations/[organization_id], folders/[folder_id], or + * Required. Resource name of the parent of sources to list. Its format should be + * "organizations/[organization_id], folders/[folder_id], or * projects/[project_id]". * @param {string} request.pageToken * The value returned by the last `ListSourcesResponse`; indicates @@ -4796,8 +4795,8 @@ export class SecurityCenterClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. Resource name of the parent of sources to list. Its format should - * be "organizations/[organization_id], folders/[folder_id], or + * Required. Resource name of the parent of sources to list. Its format should be + * "organizations/[organization_id], folders/[folder_id], or * projects/[project_id]". * @param {string} request.pageToken * The value returned by the last `ListSourcesResponse`; indicates diff --git a/packages/google-cloud-securitycenter/src/v1/security_center_proto_list.json b/packages/google-cloud-securitycenter/src/v1/security_center_proto_list.json index dcf14772dfb..e437464605b 100644 --- a/packages/google-cloud-securitycenter/src/v1/security_center_proto_list.json +++ b/packages/google-cloud-securitycenter/src/v1/security_center_proto_list.json @@ -2,6 +2,7 @@ "../../protos/google/cloud/securitycenter/v1/asset.proto", "../../protos/google/cloud/securitycenter/v1/finding.proto", "../../protos/google/cloud/securitycenter/v1/folder.proto", + "../../protos/google/cloud/securitycenter/v1/indicator.proto", "../../protos/google/cloud/securitycenter/v1/notification_config.proto", "../../protos/google/cloud/securitycenter/v1/notification_message.proto", "../../protos/google/cloud/securitycenter/v1/organization_settings.proto", From fbd80f856cc28bcd1a00b9d2503d6445e8fd42e6 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Fri, 30 Jul 2021 19:36:27 +0000 Subject: [PATCH 268/342] chore: release 5.4.0 (#411) :robot: I have created a release \*beep\* \*boop\* --- ## [5.4.0](https://www.github.com/googleapis/nodejs-security-center/compare/v5.3.5...v5.4.0) (2021-07-30) ### Features * add finding_class and indicator fields in Finding ([#409](https://www.github.com/googleapis/nodejs-security-center/issues/409)) ([d0abd01](https://www.github.com/googleapis/nodejs-security-center/commit/d0abd013b359b1876c16e7f4ee6b8c873acc5014)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- packages/google-cloud-securitycenter/CHANGELOG.md | 7 +++++++ packages/google-cloud-securitycenter/package.json | 2 +- packages/google-cloud-securitycenter/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-securitycenter/CHANGELOG.md b/packages/google-cloud-securitycenter/CHANGELOG.md index ac047e36108..b512ce47c8c 100644 --- a/packages/google-cloud-securitycenter/CHANGELOG.md +++ b/packages/google-cloud-securitycenter/CHANGELOG.md @@ -4,6 +4,13 @@ [1]: https://www.npmjs.com/package/@google-cloud/security-center?activeTab=versions +## [5.4.0](https://www.github.com/googleapis/nodejs-security-center/compare/v5.3.5...v5.4.0) (2021-07-30) + + +### Features + +* add finding_class and indicator fields in Finding ([#409](https://www.github.com/googleapis/nodejs-security-center/issues/409)) ([d0abd01](https://www.github.com/googleapis/nodejs-security-center/commit/d0abd013b359b1876c16e7f4ee6b8c873acc5014)) + ### [5.3.5](https://www.github.com/googleapis/nodejs-security-center/compare/v5.3.4...v5.3.5) (2021-07-16) diff --git a/packages/google-cloud-securitycenter/package.json b/packages/google-cloud-securitycenter/package.json index 2ede80dd3a3..d05b2c8e5bc 100644 --- a/packages/google-cloud-securitycenter/package.json +++ b/packages/google-cloud-securitycenter/package.json @@ -1,7 +1,7 @@ { "name": "@google-cloud/security-center", "description": "Cloud Security Command Center API client for Node.js", - "version": "5.3.5", + "version": "5.4.0", "license": "Apache-2.0", "author": "Google LLC", "engines": { diff --git a/packages/google-cloud-securitycenter/samples/package.json b/packages/google-cloud-securitycenter/samples/package.json index 3d5e1375120..a5194e3cf6a 100644 --- a/packages/google-cloud-securitycenter/samples/package.json +++ b/packages/google-cloud-securitycenter/samples/package.json @@ -14,7 +14,7 @@ "license": "Apache-2.0", "dependencies": { "@google-cloud/pubsub": "^2.0.0", - "@google-cloud/security-center": "^5.3.5" + "@google-cloud/security-center": "^5.4.0" }, "devDependencies": { "chai": "^4.2.0", From 7ec38a260ff83c261cc5b404b53e44b549045b4f Mon Sep 17 00:00:00 2001 From: "F. Hinkelmann" Date: Wed, 4 Aug 2021 16:06:34 -0400 Subject: [PATCH 269/342] chore(nodejs): update client ref docs link in metadata (#413) --- packages/google-cloud-securitycenter/.repo-metadata.json | 2 +- packages/google-cloud-securitycenter/README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-securitycenter/.repo-metadata.json b/packages/google-cloud-securitycenter/.repo-metadata.json index 951932aaedf..adb15f06a90 100644 --- a/packages/google-cloud-securitycenter/.repo-metadata.json +++ b/packages/google-cloud-securitycenter/.repo-metadata.json @@ -6,7 +6,7 @@ "distribution_name": "@google-cloud/security-center", "default_version": "v1", "name": "security-center", - "client_documentation": "https://googleapis.dev/nodejs/security-center/latest", + "client_documentation": "https://cloud.google.com/nodejs/docs/reference/security-center/latest", "requires_billing": true, "name_pretty": "Google Cloud Security Command Center", "issue_tracker": "https://issuetracker.google.com/savedsearches/559748", diff --git a/packages/google-cloud-securitycenter/README.md b/packages/google-cloud-securitycenter/README.md index a7411611ea7..2e6b65ac0af 100644 --- a/packages/google-cloud-securitycenter/README.md +++ b/packages/google-cloud-securitycenter/README.md @@ -157,7 +157,7 @@ Apache Version 2.0 See [LICENSE](https://github.com/googleapis/nodejs-security-center/blob/master/LICENSE) -[client-docs]: https://googleapis.dev/nodejs/security-center/latest +[client-docs]: https://cloud.google.com/nodejs/docs/reference/security-center/latest [product-docs]: https://cloud.google.com/security-command-center [shell_img]: https://gstatic.com/cloudssh/images/open-btn.png [projects]: https://console.cloud.google.com/project From 53ff4439535a91942ecc6a3f658deb759c6b78bd Mon Sep 17 00:00:00 2001 From: "Benjamin E. Coe" Date: Mon, 16 Aug 2021 22:42:32 -0400 Subject: [PATCH 270/342] fix(deps): google-gax v2.24.1 (#415) --- packages/google-cloud-securitycenter/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-securitycenter/package.json b/packages/google-cloud-securitycenter/package.json index d05b2c8e5bc..4ce0bc83196 100644 --- a/packages/google-cloud-securitycenter/package.json +++ b/packages/google-cloud-securitycenter/package.json @@ -42,7 +42,7 @@ "Security Command Center API" ], "dependencies": { - "google-gax": "^2.17.1" + "google-gax": "^2.24.1" }, "devDependencies": { "@types/mocha": "^8.0.0", From 52fa541e7174fc83d27659b28eb32c49971e5926 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 17 Aug 2021 17:14:20 +0000 Subject: [PATCH 271/342] chore: release 5.4.1 (#416) :robot: I have created a release \*beep\* \*boop\* --- ### [5.4.1](https://www.github.com/googleapis/nodejs-security-center/compare/v5.4.0...v5.4.1) (2021-08-17) ### Bug Fixes * **deps:** google-gax v2.24.1 ([#415](https://www.github.com/googleapis/nodejs-security-center/issues/415)) ([aa77ac3](https://www.github.com/googleapis/nodejs-security-center/commit/aa77ac33ed9e20e75505fb4d31183a0f1f0d1f76)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- packages/google-cloud-securitycenter/CHANGELOG.md | 7 +++++++ packages/google-cloud-securitycenter/package.json | 2 +- packages/google-cloud-securitycenter/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-securitycenter/CHANGELOG.md b/packages/google-cloud-securitycenter/CHANGELOG.md index b512ce47c8c..1877225400f 100644 --- a/packages/google-cloud-securitycenter/CHANGELOG.md +++ b/packages/google-cloud-securitycenter/CHANGELOG.md @@ -4,6 +4,13 @@ [1]: https://www.npmjs.com/package/@google-cloud/security-center?activeTab=versions +### [5.4.1](https://www.github.com/googleapis/nodejs-security-center/compare/v5.4.0...v5.4.1) (2021-08-17) + + +### Bug Fixes + +* **deps:** google-gax v2.24.1 ([#415](https://www.github.com/googleapis/nodejs-security-center/issues/415)) ([aa77ac3](https://www.github.com/googleapis/nodejs-security-center/commit/aa77ac33ed9e20e75505fb4d31183a0f1f0d1f76)) + ## [5.4.0](https://www.github.com/googleapis/nodejs-security-center/compare/v5.3.5...v5.4.0) (2021-07-30) diff --git a/packages/google-cloud-securitycenter/package.json b/packages/google-cloud-securitycenter/package.json index 4ce0bc83196..7b1b9928fb9 100644 --- a/packages/google-cloud-securitycenter/package.json +++ b/packages/google-cloud-securitycenter/package.json @@ -1,7 +1,7 @@ { "name": "@google-cloud/security-center", "description": "Cloud Security Command Center API client for Node.js", - "version": "5.4.0", + "version": "5.4.1", "license": "Apache-2.0", "author": "Google LLC", "engines": { diff --git a/packages/google-cloud-securitycenter/samples/package.json b/packages/google-cloud-securitycenter/samples/package.json index a5194e3cf6a..db207583a82 100644 --- a/packages/google-cloud-securitycenter/samples/package.json +++ b/packages/google-cloud-securitycenter/samples/package.json @@ -14,7 +14,7 @@ "license": "Apache-2.0", "dependencies": { "@google-cloud/pubsub": "^2.0.0", - "@google-cloud/security-center": "^5.4.0" + "@google-cloud/security-center": "^5.4.1" }, "devDependencies": { "chai": "^4.2.0", From 561b9e9be0ce2fc00790e5c5efcf39c82b4a98ed Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Mon, 23 Aug 2021 18:28:22 +0000 Subject: [PATCH 272/342] feat: turns on self-signed JWT feature flag (#417) - [ ] Regenerate this pull request now. PiperOrigin-RevId: 392067151 Source-Link: https://github.com/googleapis/googleapis/commit/06345f7b95c4b4a3ffe4303f1f2984ccc304b2e0 Source-Link: https://github.com/googleapis/googleapis-gen/commit/95882b37970e41e4cd51b22fa507cfd46dc7c4b6 --- .../src/v1/security_center_client.ts | 7 +++++++ .../src/v1beta1/security_center_client.ts | 7 +++++++ .../src/v1p1beta1/security_center_client.ts | 7 +++++++ 3 files changed, 21 insertions(+) diff --git a/packages/google-cloud-securitycenter/src/v1/security_center_client.ts b/packages/google-cloud-securitycenter/src/v1/security_center_client.ts index c7809e94b59..b69f99af5be 100644 --- a/packages/google-cloud-securitycenter/src/v1/security_center_client.ts +++ b/packages/google-cloud-securitycenter/src/v1/security_center_client.ts @@ -133,6 +133,12 @@ export class SecurityCenterClient { // 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; @@ -5693,6 +5699,7 @@ export class SecurityCenterClient { return this.securityCenterStub!.then(stub => { this._terminated = true; stub.close(); + this.operationsClient.close(); }); } return Promise.resolve(); diff --git a/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.ts b/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.ts index 5d1412ee9cc..3b93e9ee0c1 100644 --- a/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.ts +++ b/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.ts @@ -133,6 +133,12 @@ export class SecurityCenterClient { // 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; @@ -3721,6 +3727,7 @@ export class SecurityCenterClient { return this.securityCenterStub!.then(stub => { this._terminated = true; stub.close(); + this.operationsClient.close(); }); } return Promise.resolve(); diff --git a/packages/google-cloud-securitycenter/src/v1p1beta1/security_center_client.ts b/packages/google-cloud-securitycenter/src/v1p1beta1/security_center_client.ts index eb476ff8637..862f4607248 100644 --- a/packages/google-cloud-securitycenter/src/v1p1beta1/security_center_client.ts +++ b/packages/google-cloud-securitycenter/src/v1p1beta1/security_center_client.ts @@ -133,6 +133,12 @@ export class SecurityCenterClient { // 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; @@ -5669,6 +5675,7 @@ export class SecurityCenterClient { return this.securityCenterStub!.then(stub => { this._terminated = true; stub.close(); + this.operationsClient.close(); }); } return Promise.resolve(); From 6b003e01219cd5f8803a95e5efc1666c9a513385 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Mon, 23 Aug 2021 18:40:14 +0000 Subject: [PATCH 273/342] chore: release 5.5.0 (#418) :robot: I have created a release \*beep\* \*boop\* --- ## [5.5.0](https://www.github.com/googleapis/nodejs-security-center/compare/v5.4.1...v5.5.0) (2021-08-23) ### Features * turns on self-signed JWT feature flag ([#417](https://www.github.com/googleapis/nodejs-security-center/issues/417)) ([ec4b179](https://www.github.com/googleapis/nodejs-security-center/commit/ec4b17916d42f9ff006b9c9d0c1a6c2dd0743fa7)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- packages/google-cloud-securitycenter/CHANGELOG.md | 7 +++++++ packages/google-cloud-securitycenter/package.json | 2 +- packages/google-cloud-securitycenter/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-securitycenter/CHANGELOG.md b/packages/google-cloud-securitycenter/CHANGELOG.md index 1877225400f..b8ad5c5c3b5 100644 --- a/packages/google-cloud-securitycenter/CHANGELOG.md +++ b/packages/google-cloud-securitycenter/CHANGELOG.md @@ -4,6 +4,13 @@ [1]: https://www.npmjs.com/package/@google-cloud/security-center?activeTab=versions +## [5.5.0](https://www.github.com/googleapis/nodejs-security-center/compare/v5.4.1...v5.5.0) (2021-08-23) + + +### Features + +* turns on self-signed JWT feature flag ([#417](https://www.github.com/googleapis/nodejs-security-center/issues/417)) ([ec4b179](https://www.github.com/googleapis/nodejs-security-center/commit/ec4b17916d42f9ff006b9c9d0c1a6c2dd0743fa7)) + ### [5.4.1](https://www.github.com/googleapis/nodejs-security-center/compare/v5.4.0...v5.4.1) (2021-08-17) diff --git a/packages/google-cloud-securitycenter/package.json b/packages/google-cloud-securitycenter/package.json index 7b1b9928fb9..8da58a7d474 100644 --- a/packages/google-cloud-securitycenter/package.json +++ b/packages/google-cloud-securitycenter/package.json @@ -1,7 +1,7 @@ { "name": "@google-cloud/security-center", "description": "Cloud Security Command Center API client for Node.js", - "version": "5.4.1", + "version": "5.5.0", "license": "Apache-2.0", "author": "Google LLC", "engines": { diff --git a/packages/google-cloud-securitycenter/samples/package.json b/packages/google-cloud-securitycenter/samples/package.json index db207583a82..3e2e3d4cb75 100644 --- a/packages/google-cloud-securitycenter/samples/package.json +++ b/packages/google-cloud-securitycenter/samples/package.json @@ -14,7 +14,7 @@ "license": "Apache-2.0", "dependencies": { "@google-cloud/pubsub": "^2.0.0", - "@google-cloud/security-center": "^5.4.1" + "@google-cloud/security-center": "^5.5.0" }, "devDependencies": { "chai": "^4.2.0", From c81535c86792c615141a08324d0664c22289329a Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Wed, 25 Aug 2021 23:42:32 +0000 Subject: [PATCH 274/342] chore: disable renovate dependency dashboard (#1194) (#419) --- packages/google-cloud-securitycenter/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-securitycenter/README.md b/packages/google-cloud-securitycenter/README.md index 2e6b65ac0af..10d8efaf4e0 100644 --- a/packages/google-cloud-securitycenter/README.md +++ b/packages/google-cloud-securitycenter/README.md @@ -148,8 +148,8 @@ Contributions welcome! See the [Contributing Guide](https://github.com/googleapi 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 template in this -[directory](https://github.com/googleapis/synthtool/tree/master/synthtool/gcp/templates/node_library). +to its templates in +[directory](https://github.com/googleapis/synthtool). ## License From 8a4832671cebad1a49300c8b8b28fd09295c1dfd Mon Sep 17 00:00:00 2001 From: "Benjamin E. Coe" Date: Fri, 10 Sep 2021 12:42:11 -0400 Subject: [PATCH 275/342] fix(build): set default branch to main (#420) --- packages/google-cloud-securitycenter/README.md | 12 ++++++------ .../google-cloud-securitycenter/samples/README.md | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/packages/google-cloud-securitycenter/README.md b/packages/google-cloud-securitycenter/README.md index 10d8efaf4e0..f6a527d9794 100644 --- a/packages/google-cloud-securitycenter/README.md +++ b/packages/google-cloud-securitycenter/README.md @@ -6,7 +6,7 @@ [![release level](https://img.shields.io/badge/release%20level-general%20availability%20%28GA%29-brightgreen.svg?style=flat)](https://cloud.google.com/terms/launch-stages) [![npm version](https://img.shields.io/npm/v/@google-cloud/security-center.svg)](https://www.npmjs.org/package/@google-cloud/security-center) -[![codecov](https://img.shields.io/codecov/c/github/googleapis/nodejs-security-center/master.svg?style=flat)](https://codecov.io/gh/googleapis/nodejs-security-center) +[![codecov](https://img.shields.io/codecov/c/github/googleapis/nodejs-security-center/main.svg?style=flat)](https://codecov.io/gh/googleapis/nodejs-security-center) @@ -23,7 +23,7 @@ to your critical resources, all from a single, centralized dashboard. A comprehensive list of changes in each version may be found in -[the CHANGELOG](https://github.com/googleapis/nodejs-security-center/blob/master/CHANGELOG.md). +[the CHANGELOG](https://github.com/googleapis/nodejs-security-center/blob/main/CHANGELOG.md). * [Google Cloud Security Command Center Node.js Client API Reference][client-docs] * [Google Cloud Security Command Center Documentation][product-docs] @@ -90,11 +90,11 @@ quickstart(); ## Samples -Samples are in the [`samples/`](https://github.com/googleapis/nodejs-security-center/tree/master/samples) directory. Each sample's `README.md` has instructions for running its sample. +Samples are in the [`samples/`](https://github.com/googleapis/nodejs-security-center/tree/main/samples) directory. Each sample's `README.md` has instructions for running its sample. | Sample | Source Code | Try it | | --------------------------- | --------------------------------- | ------ | -| Quickstart | [source code](https://github.com/googleapis/nodejs-security-center/blob/master/samples/quickstart.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-security-center&page=editor&open_in_editor=samples/quickstart.js,samples/README.md) | +| Quickstart | [source code](https://github.com/googleapis/nodejs-security-center/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-security-center&page=editor&open_in_editor=samples/quickstart.js,samples/README.md) | @@ -143,7 +143,7 @@ More Information: [Google Cloud Platform Launch Stages][launch_stages] ## Contributing -Contributions welcome! See the [Contributing Guide](https://github.com/googleapis/nodejs-security-center/blob/master/CONTRIBUTING.md). +Contributions welcome! See the [Contributing Guide](https://github.com/googleapis/nodejs-security-center/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`) @@ -155,7 +155,7 @@ to its templates in Apache Version 2.0 -See [LICENSE](https://github.com/googleapis/nodejs-security-center/blob/master/LICENSE) +See [LICENSE](https://github.com/googleapis/nodejs-security-center/blob/main/LICENSE) [client-docs]: https://cloud.google.com/nodejs/docs/reference/security-center/latest [product-docs]: https://cloud.google.com/security-command-center diff --git a/packages/google-cloud-securitycenter/samples/README.md b/packages/google-cloud-securitycenter/samples/README.md index 4e4ff2b1c91..b62afb4b600 100644 --- a/packages/google-cloud-securitycenter/samples/README.md +++ b/packages/google-cloud-securitycenter/samples/README.md @@ -39,7 +39,7 @@ Before running the samples, make sure you've followed the steps outlined in ### Quickstart -View the [source code](https://github.com/googleapis/nodejs-security-center/blob/master/samples/quickstart.js). +View the [source code](https://github.com/googleapis/nodejs-security-center/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-security-center&page=editor&open_in_editor=samples/quickstart.js,samples/README.md) From 1903249b4bcba06020dfad15cb2385dc777e36e1 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Fri, 10 Sep 2021 10:53:35 -0700 Subject: [PATCH 276/342] chore: release 5.5.1 (#421) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- packages/google-cloud-securitycenter/CHANGELOG.md | 7 +++++++ packages/google-cloud-securitycenter/package.json | 2 +- packages/google-cloud-securitycenter/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-securitycenter/CHANGELOG.md b/packages/google-cloud-securitycenter/CHANGELOG.md index b8ad5c5c3b5..d1fe23c87d3 100644 --- a/packages/google-cloud-securitycenter/CHANGELOG.md +++ b/packages/google-cloud-securitycenter/CHANGELOG.md @@ -4,6 +4,13 @@ [1]: https://www.npmjs.com/package/@google-cloud/security-center?activeTab=versions +### [5.5.1](https://www.github.com/googleapis/nodejs-security-center/compare/v5.5.0...v5.5.1) (2021-09-10) + + +### Bug Fixes + +* **build:** set default branch to main ([#420](https://www.github.com/googleapis/nodejs-security-center/issues/420)) ([7a04895](https://www.github.com/googleapis/nodejs-security-center/commit/7a04895d15fc51694aba186bfbffaf7495744937)) + ## [5.5.0](https://www.github.com/googleapis/nodejs-security-center/compare/v5.4.1...v5.5.0) (2021-08-23) diff --git a/packages/google-cloud-securitycenter/package.json b/packages/google-cloud-securitycenter/package.json index 8da58a7d474..be703c1cb86 100644 --- a/packages/google-cloud-securitycenter/package.json +++ b/packages/google-cloud-securitycenter/package.json @@ -1,7 +1,7 @@ { "name": "@google-cloud/security-center", "description": "Cloud Security Command Center API client for Node.js", - "version": "5.5.0", + "version": "5.5.1", "license": "Apache-2.0", "author": "Google LLC", "engines": { diff --git a/packages/google-cloud-securitycenter/samples/package.json b/packages/google-cloud-securitycenter/samples/package.json index 3e2e3d4cb75..b65b485132d 100644 --- a/packages/google-cloud-securitycenter/samples/package.json +++ b/packages/google-cloud-securitycenter/samples/package.json @@ -14,7 +14,7 @@ "license": "Apache-2.0", "dependencies": { "@google-cloud/pubsub": "^2.0.0", - "@google-cloud/security-center": "^5.5.0" + "@google-cloud/security-center": "^5.5.1" }, "devDependencies": { "chai": "^4.2.0", From c081610e3cb6aec875cc36ae04d1de454c58d613 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 14 Oct 2021 00:48:17 +0000 Subject: [PATCH 277/342] build(node): update deps used during postprocessing (#1243) (#429) --- .../protos/protos.d.ts | 3 ++- .../google-cloud-securitycenter/protos/protos.js | 7 +++++++ .../protos/protos.json | 15 ++++++++++++++- 3 files changed, 23 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-securitycenter/protos/protos.d.ts b/packages/google-cloud-securitycenter/protos/protos.d.ts index 5a946d11475..ccfbf7e76d2 100644 --- a/packages/google-cloud-securitycenter/protos/protos.d.ts +++ b/packages/google-cloud-securitycenter/protos/protos.d.ts @@ -14822,7 +14822,8 @@ export namespace google { OUTPUT_ONLY = 3, INPUT_ONLY = 4, IMMUTABLE = 5, - UNORDERED_LIST = 6 + UNORDERED_LIST = 6, + NON_EMPTY_DEFAULT = 7 } } diff --git a/packages/google-cloud-securitycenter/protos/protos.js b/packages/google-cloud-securitycenter/protos/protos.js index c5580746de3..7b8f66c2271 100644 --- a/packages/google-cloud-securitycenter/protos/protos.js +++ b/packages/google-cloud-securitycenter/protos/protos.js @@ -35644,6 +35644,7 @@ * @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); @@ -35654,6 +35655,7 @@ 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; })(); @@ -41192,6 +41194,7 @@ case 4: case 5: case 6: + case 7: break; } } @@ -41296,6 +41299,10 @@ case 6: message[".google.api.fieldBehavior"][i] = 6; break; + case "NON_EMPTY_DEFAULT": + case 7: + message[".google.api.fieldBehavior"][i] = 7; + break; } } return message; diff --git a/packages/google-cloud-securitycenter/protos/protos.json b/packages/google-cloud-securitycenter/protos/protos.json index 0ced60e408b..46bc36055bd 100644 --- a/packages/google-cloud-securitycenter/protos/protos.json +++ b/packages/google-cloud-securitycenter/protos/protos.json @@ -4562,7 +4562,8 @@ "OUTPUT_ONLY": 3, "INPUT_ONLY": 4, "IMMUTABLE": 5, - "UNORDERED_LIST": 6 + "UNORDERED_LIST": 6, + "NON_EMPTY_DEFAULT": 7 } }, "methodSignature": { @@ -5144,6 +5145,18 @@ ] ], "reserved": [ + [ + 4, + 4 + ], + [ + 5, + 5 + ], + [ + 6, + 6 + ], [ 8, 8 From 37aacdc56ef2debad326609d81eb93c5eaa1edc5 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 14 Oct 2021 09:19:16 -0700 Subject: [PATCH 278/342] feat: Added vulnerability field to the finding feat: Added type field to the resource which is surfaced in NotificationMessage (#428) PiperOrigin-RevId: 401787368 Source-Link: https://github.com/googleapis/googleapis/commit/a7a3440103e7821aae4a3531756f2ad22a270e77 Source-Link: https://github.com/googleapis/googleapis-gen/commit/169ba7febf00ee030446a0534ac77ad57f0bf83a Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMTY5YmE3ZmViZjAwZWUwMzA0NDZhMDUzNGFjNzdhZDU3ZjBiZjgzYSJ9 --- .../cloud/securitycenter/v1/finding.proto | 6 + .../cloud/securitycenter/v1/resource.proto | 3 + .../securitycenter/v1/vulnerability.proto | 215 +++ .../protos/protos.d.ts | 487 ++++++ .../protos/protos.js | 1494 ++++++++++++++++- .../protos/protos.json | 133 ++ .../v1/security_center.create_finding.js | 66 + ...urity_center.create_notification_config.js | 69 + .../v1/security_center.create_source.js | 59 + ...urity_center.delete_notification_config.js | 55 + .../v1/security_center.get_iam_policy.js | 58 + ...security_center.get_notification_config.js | 53 + ...curity_center.get_organization_settings.js | 55 + .../v1/security_center.get_source.js | 53 + .../v1/security_center.group_assets.js | 167 ++ .../v1/security_center.group_findings.js | 171 ++ .../v1/security_center.list_assets.js | 176 ++ .../v1/security_center.list_findings.js | 181 ++ ...curity_center.list_notification_configs.js | 68 + .../v1/security_center.list_sources.js | 67 + .../v1/security_center.run_asset_discovery.js | 54 + .../v1/security_center.set_finding_state.js | 65 + .../v1/security_center.set_iam_policy.js | 61 + .../security_center.test_iam_permissions.js | 61 + .../v1/security_center.update_finding.js | 65 + ...urity_center.update_notification_config.js | 59 + ...ity_center.update_organization_settings.js | 59 + .../security_center.update_security_marks.js | 65 + .../v1/security_center.update_source.js | 57 + .../v1beta1/security_center.create_finding.js | 67 + .../v1beta1/security_center.create_source.js | 60 + .../v1beta1/security_center.get_iam_policy.js | 59 + ...curity_center.get_organization_settings.js | 56 + .../v1beta1/security_center.get_source.js | 54 + .../v1beta1/security_center.group_assets.js | 131 ++ .../v1beta1/security_center.group_findings.js | 110 ++ .../v1beta1/security_center.list_assets.js | 136 ++ .../v1beta1/security_center.list_findings.js | 113 ++ .../v1beta1/security_center.list_sources.js | 67 + .../security_center.run_asset_discovery.js | 55 + .../security_center.set_finding_state.js | 66 + .../v1beta1/security_center.set_iam_policy.js | 62 + .../security_center.test_iam_permissions.js | 62 + .../v1beta1/security_center.update_finding.js | 62 + ...ity_center.update_organization_settings.js | 59 + .../security_center.update_security_marks.js | 61 + .../v1beta1/security_center.update_source.js | 57 + .../security_center.create_finding.js | 65 + ...urity_center.create_notification_config.js | 69 + .../security_center.create_source.js | 60 + ...urity_center.delete_notification_config.js | 56 + .../security_center.get_iam_policy.js | 59 + ...security_center.get_notification_config.js | 54 + ...curity_center.get_organization_settings.js | 56 + .../v1p1beta1/security_center.get_source.js | 54 + .../v1p1beta1/security_center.group_assets.js | 168 ++ .../security_center.group_findings.js | 164 ++ .../v1p1beta1/security_center.list_assets.js | 177 ++ .../security_center.list_findings.js | 173 ++ ...curity_center.list_notification_configs.js | 69 + .../v1p1beta1/security_center.list_sources.js | 68 + .../security_center.run_asset_discovery.js | 55 + .../security_center.set_finding_state.js | 66 + .../security_center.set_iam_policy.js | 62 + .../security_center.test_iam_permissions.js | 62 + .../security_center.update_finding.js | 66 + ...urity_center.update_notification_config.js | 60 + ...ity_center.update_organization_settings.js | 60 + .../security_center.update_security_marks.js | 66 + .../security_center.update_source.js | 58 + .../samples/package.json | 2 +- .../src/v1/security_center_client.ts | 36 +- .../src/v1/security_center_proto_list.json | 3 +- .../src/v1beta1/security_center_client.ts | 30 +- .../src/v1p1beta1/security_center_client.ts | 36 +- 75 files changed, 7366 insertions(+), 107 deletions(-) create mode 100644 packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/vulnerability.proto create mode 100644 packages/google-cloud-securitycenter/samples/generated/v1/security_center.create_finding.js create mode 100644 packages/google-cloud-securitycenter/samples/generated/v1/security_center.create_notification_config.js create mode 100644 packages/google-cloud-securitycenter/samples/generated/v1/security_center.create_source.js create mode 100644 packages/google-cloud-securitycenter/samples/generated/v1/security_center.delete_notification_config.js create mode 100644 packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_iam_policy.js create mode 100644 packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_notification_config.js create mode 100644 packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_organization_settings.js create mode 100644 packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_source.js create mode 100644 packages/google-cloud-securitycenter/samples/generated/v1/security_center.group_assets.js create mode 100644 packages/google-cloud-securitycenter/samples/generated/v1/security_center.group_findings.js create mode 100644 packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_assets.js create mode 100644 packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_findings.js create mode 100644 packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_notification_configs.js create mode 100644 packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_sources.js create mode 100644 packages/google-cloud-securitycenter/samples/generated/v1/security_center.run_asset_discovery.js create mode 100644 packages/google-cloud-securitycenter/samples/generated/v1/security_center.set_finding_state.js create mode 100644 packages/google-cloud-securitycenter/samples/generated/v1/security_center.set_iam_policy.js create mode 100644 packages/google-cloud-securitycenter/samples/generated/v1/security_center.test_iam_permissions.js create mode 100644 packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_finding.js create mode 100644 packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_notification_config.js create mode 100644 packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_organization_settings.js create mode 100644 packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_security_marks.js create mode 100644 packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_source.js create mode 100644 packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.create_finding.js create mode 100644 packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.create_source.js create mode 100644 packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.get_iam_policy.js create mode 100644 packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.get_organization_settings.js create mode 100644 packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.get_source.js create mode 100644 packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.group_assets.js create mode 100644 packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.group_findings.js create mode 100644 packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.list_assets.js create mode 100644 packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.list_findings.js create mode 100644 packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.list_sources.js create mode 100644 packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.run_asset_discovery.js create mode 100644 packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.set_finding_state.js create mode 100644 packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.set_iam_policy.js create mode 100644 packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.test_iam_permissions.js create mode 100644 packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.update_finding.js create mode 100644 packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.update_organization_settings.js create mode 100644 packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.update_security_marks.js create mode 100644 packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.update_source.js create mode 100644 packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.create_finding.js create mode 100644 packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.create_notification_config.js create mode 100644 packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.create_source.js create mode 100644 packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.delete_notification_config.js create mode 100644 packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.get_iam_policy.js create mode 100644 packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.get_notification_config.js create mode 100644 packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.get_organization_settings.js create mode 100644 packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.get_source.js create mode 100644 packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.group_assets.js create mode 100644 packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.group_findings.js create mode 100644 packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.list_assets.js create mode 100644 packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.list_findings.js create mode 100644 packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.list_notification_configs.js create mode 100644 packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.list_sources.js create mode 100644 packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.run_asset_discovery.js create mode 100644 packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.set_finding_state.js create mode 100644 packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.set_iam_policy.js create mode 100644 packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.test_iam_permissions.js create mode 100644 packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.update_finding.js create mode 100644 packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.update_notification_config.js create mode 100644 packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.update_organization_settings.js create mode 100644 packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.update_security_marks.js create mode 100644 packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.update_source.js diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/finding.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/finding.proto index ee4026dad2a..e14266b44db 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/finding.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/finding.proto @@ -20,6 +20,7 @@ import "google/api/field_behavior.proto"; import "google/api/resource.proto"; import "google/cloud/securitycenter/v1/indicator.proto"; import "google/cloud/securitycenter/v1/security_marks.proto"; +import "google/cloud/securitycenter/v1/vulnerability.proto"; import "google/protobuf/struct.proto"; import "google/protobuf/timestamp.proto"; import "google/api/annotations.proto"; @@ -215,4 +216,9 @@ message Finding { // intrusion. // Reference: https://en.wikipedia.org/wiki/Indicator_of_compromise Indicator indicator = 18; + + // Represents vulnerability specific fields like cve, cvss scores etc. + // CVE stands for Common Vulnerabilities and Exposures + // (https://cve.mitre.org/about/) + Vulnerability vulnerability = 20; } diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/resource.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/resource.proto index c1c2ad414a7..494b8bdc52d 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/resource.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/resource.proto @@ -46,6 +46,9 @@ message Resource { // The human readable name of resource's parent. string parent_display_name = 5; + // The full resource type of the resource. + string type = 6; + // Output only. Contains a Folder message for each folder in the assets ancestry. // The first folder is the deepest nested folder, and the last folder is the // folder directly under the Organization. diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/vulnerability.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/vulnerability.proto new file mode 100644 index 00000000000..4649adf90df --- /dev/null +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/vulnerability.proto @@ -0,0 +1,215 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.securitycenter.v1; + +import "google/api/annotations.proto"; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1;securitycenter"; +option java_multiple_files = true; +option java_outer_classname = "VulnerabilityProto"; +option java_package = "com.google.cloud.securitycenter.v1"; +option php_namespace = "Google\\Cloud\\SecurityCenter\\V1"; +option ruby_package = "Google::Cloud::SecurityCenter::V1"; + +// Refers to common vulnerability fields e.g. cve, cvss, cwe etc. +message Vulnerability { + // CVE stands for Common Vulnerabilities and Exposures + // (https://cve.mitre.org/about/) + Cve cve = 1; +} + +// CVE stands for Common Vulnerabilities and Exposures. +// More information: https://cve.mitre.org +message Cve { + // The unique identifier for the vulnerability. e.g. CVE-2021-34527 + string id = 1; + + // Additional information about the CVE. + // e.g. https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-34527 + repeated Reference references = 2; + + // Describe Common Vulnerability Scoring System specified at + // https://www.first.org/cvss/v3.1/specification-document + Cvssv3 cvssv3 = 3; +} + +// Additional Links +message Reference { + // Source of the reference e.g. NVD + string source = 1; + + // Uri for the mentioned source e.g. + // https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-34527. + string uri = 2; +} + +// Common Vulnerability Scoring System version 3. +message Cvssv3 { + // This metric reflects the context by which vulnerability exploitation is + // possible. + enum AttackVector { + // Invalid value. + ATTACK_VECTOR_UNSPECIFIED = 0; + + // The vulnerable component is bound to the network stack and the set of + // possible attackers extends beyond the other options listed below, up to + // and including the entire Internet. + ATTACK_VECTOR_NETWORK = 1; + + // The vulnerable component is bound to the network stack, but the attack is + // limited at the protocol level to a logically adjacent topology. + ATTACK_VECTOR_ADJACENT = 2; + + // The vulnerable component is not bound to the network stack and the + // attacker's path is via read/write/execute capabilities. + ATTACK_VECTOR_LOCAL = 3; + + // The attack requires the attacker to physically touch or manipulate the + // vulnerable component. + ATTACK_VECTOR_PHYSICAL = 4; + } + + // This metric describes the conditions beyond the attacker's control that + // must exist in order to exploit the vulnerability. + enum AttackComplexity { + // Invalid value. + ATTACK_COMPLEXITY_UNSPECIFIED = 0; + + // Specialized access conditions or extenuating circumstances do not exist. + // An attacker can expect repeatable success when attacking the vulnerable + // component. + ATTACK_COMPLEXITY_LOW = 1; + + // A successful attack depends on conditions beyond the attacker's control. + // That is, a successful attack cannot be accomplished at will, but requires + // the attacker to invest in some measurable amount of effort in preparation + // or execution against the vulnerable component before a successful attack + // can be expected. + ATTACK_COMPLEXITY_HIGH = 2; + } + + // This metric describes the level of privileges an attacker must possess + // before successfully exploiting the vulnerability. + enum PrivilegesRequired { + // Invalid value. + PRIVILEGES_REQUIRED_UNSPECIFIED = 0; + + // The attacker is unauthorized prior to attack, and therefore does not + // require any access to settings or files of the vulnerable system to + // carry out an attack. + PRIVILEGES_REQUIRED_NONE = 1; + + // The attacker requires privileges that provide basic user capabilities + // that could normally affect only settings and files owned by a user. + // Alternatively, an attacker with Low privileges has the ability to access + // only non-sensitive resources. + PRIVILEGES_REQUIRED_LOW = 2; + + // The attacker requires privileges that provide significant (e.g., + // administrative) control over the vulnerable component allowing access to + // component-wide settings and files. + PRIVILEGES_REQUIRED_HIGH = 3; + } + + // This metric captures the requirement for a human user, other than the + // attacker, to participate in the successful compromise of the vulnerable + // component. + enum UserInteraction { + // Invalid value. + USER_INTERACTION_UNSPECIFIED = 0; + + // The vulnerable system can be exploited without interaction from any user. + USER_INTERACTION_NONE = 1; + + // Successful exploitation of this vulnerability requires a user to take + // some action before the vulnerability can be exploited. + USER_INTERACTION_REQUIRED = 2; + } + + // The Scope metric captures whether a vulnerability in one vulnerable + // component impacts resources in components beyond its security scope. + enum Scope { + // Invalid value. + SCOPE_UNSPECIFIED = 0; + + // An exploited vulnerability can only affect resources managed by the same + // security authority. + SCOPE_UNCHANGED = 1; + + // An exploited vulnerability can affect resources beyond the security scope + // managed by the security authority of the vulnerable component. + SCOPE_CHANGED = 2; + } + + // The Impact metrics capture the effects of a successfully exploited + // vulnerability on the component that suffers the worst outcome that is most + // directly and predictably associated with the attack. + enum Impact { + // Invalid value. + IMPACT_UNSPECIFIED = 0; + + // High impact. + IMPACT_HIGH = 1; + + // Low impact. + IMPACT_LOW = 2; + + // No impact. + IMPACT_NONE = 3; + } + + // The base score is a function of the base metric scores. + double base_score = 1; + + // Base Metrics + // Represents the intrinsic characteristics of a vulnerability that are + // constant over time and across user environments. + // This metric reflects the context by which vulnerability exploitation is + // possible. + AttackVector attack_vector = 5; + + // This metric describes the conditions beyond the attacker's control that + // must exist in order to exploit the vulnerability. + AttackComplexity attack_complexity = 6; + + // This metric describes the level of privileges an attacker must possess + // before successfully exploiting the vulnerability. + PrivilegesRequired privileges_required = 7; + + // This metric captures the requirement for a human user, other than the + // attacker, to participate in the successful compromise of the vulnerable + // component. + UserInteraction user_interaction = 8; + + // The Scope metric captures whether a vulnerability in one vulnerable + // component impacts resources in components beyond its security scope. + Scope scope = 9; + + // This metric measures the impact to the confidentiality of the information + // resources managed by a software component due to a successfully exploited + // vulnerability. + Impact confidentiality_impact = 10; + + // This metric measures the impact to integrity of a successfully exploited + // vulnerability. + Impact integrity_impact = 11; + + // This metric measures the impact to the availability of the impacted + // component resulting from a successfully exploited vulnerability. + Impact availability_impact = 12; +} diff --git a/packages/google-cloud-securitycenter/protos/protos.d.ts b/packages/google-cloud-securitycenter/protos/protos.d.ts index ccfbf7e76d2..ef46c7b3006 100644 --- a/packages/google-cloud-securitycenter/protos/protos.d.ts +++ b/packages/google-cloud-securitycenter/protos/protos.d.ts @@ -631,6 +631,9 @@ export namespace google { /** Finding indicator */ indicator?: (google.cloud.securitycenter.v1.IIndicator|null); + + /** Finding vulnerability */ + vulnerability?: (google.cloud.securitycenter.v1.IVulnerability|null); } /** Represents a Finding. */ @@ -684,6 +687,9 @@ export namespace google { /** Finding indicator. */ public indicator?: (google.cloud.securitycenter.v1.IIndicator|null); + /** Finding vulnerability. */ + public vulnerability?: (google.cloud.securitycenter.v1.IVulnerability|null); + /** * Creates a new Finding instance using the specified properties. * @param [properties] Properties to set @@ -879,6 +885,481 @@ export namespace google { public toJSON(): { [k: string]: any }; } + /** Properties of a Vulnerability. */ + interface IVulnerability { + + /** Vulnerability cve */ + cve?: (google.cloud.securitycenter.v1.ICve|null); + } + + /** Represents a Vulnerability. */ + class Vulnerability implements IVulnerability { + + /** + * Constructs a new Vulnerability. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IVulnerability); + + /** Vulnerability cve. */ + public cve?: (google.cloud.securitycenter.v1.ICve|null); + + /** + * Creates a new Vulnerability instance using the specified properties. + * @param [properties] Properties to set + * @returns Vulnerability instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IVulnerability): google.cloud.securitycenter.v1.Vulnerability; + + /** + * Encodes the specified Vulnerability message. Does not implicitly {@link google.cloud.securitycenter.v1.Vulnerability.verify|verify} messages. + * @param message Vulnerability message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IVulnerability, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Vulnerability message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Vulnerability.verify|verify} messages. + * @param message Vulnerability message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IVulnerability, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Vulnerability message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Vulnerability + * @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.cloud.securitycenter.v1.Vulnerability; + + /** + * Decodes a Vulnerability message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Vulnerability + * @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.cloud.securitycenter.v1.Vulnerability; + + /** + * Verifies a Vulnerability 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 Vulnerability message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Vulnerability + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.Vulnerability; + + /** + * Creates a plain object from a Vulnerability message. Also converts values to other types if specified. + * @param message Vulnerability + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.Vulnerability, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Vulnerability to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a Cve. */ + interface ICve { + + /** Cve id */ + id?: (string|null); + + /** Cve references */ + references?: (google.cloud.securitycenter.v1.IReference[]|null); + + /** Cve cvssv3 */ + cvssv3?: (google.cloud.securitycenter.v1.ICvssv3|null); + } + + /** Represents a Cve. */ + class Cve implements ICve { + + /** + * Constructs a new Cve. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.ICve); + + /** Cve id. */ + public id: string; + + /** Cve references. */ + public references: google.cloud.securitycenter.v1.IReference[]; + + /** Cve cvssv3. */ + public cvssv3?: (google.cloud.securitycenter.v1.ICvssv3|null); + + /** + * Creates a new Cve instance using the specified properties. + * @param [properties] Properties to set + * @returns Cve instance + */ + public static create(properties?: google.cloud.securitycenter.v1.ICve): google.cloud.securitycenter.v1.Cve; + + /** + * Encodes the specified Cve message. Does not implicitly {@link google.cloud.securitycenter.v1.Cve.verify|verify} messages. + * @param message Cve message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.ICve, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Cve message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Cve.verify|verify} messages. + * @param message Cve message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.ICve, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Cve message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Cve + * @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.cloud.securitycenter.v1.Cve; + + /** + * Decodes a Cve message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Cve + * @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.cloud.securitycenter.v1.Cve; + + /** + * Verifies a Cve 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 Cve message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Cve + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.Cve; + + /** + * Creates a plain object from a Cve message. Also converts values to other types if specified. + * @param message Cve + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.Cve, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Cve to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a Reference. */ + interface IReference { + + /** Reference source */ + source?: (string|null); + + /** Reference uri */ + uri?: (string|null); + } + + /** Represents a Reference. */ + class Reference implements IReference { + + /** + * Constructs a new Reference. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IReference); + + /** Reference source. */ + public source: string; + + /** Reference uri. */ + public uri: string; + + /** + * Creates a new Reference instance using the specified properties. + * @param [properties] Properties to set + * @returns Reference instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IReference): google.cloud.securitycenter.v1.Reference; + + /** + * Encodes the specified Reference message. Does not implicitly {@link google.cloud.securitycenter.v1.Reference.verify|verify} messages. + * @param message Reference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Reference message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Reference.verify|verify} messages. + * @param message Reference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Reference message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Reference + * @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.cloud.securitycenter.v1.Reference; + + /** + * Decodes a Reference message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Reference + * @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.cloud.securitycenter.v1.Reference; + + /** + * Verifies a Reference 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 Reference message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Reference + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.Reference; + + /** + * Creates a plain object from a Reference message. Also converts values to other types if specified. + * @param message Reference + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.Reference, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Reference to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a Cvssv3. */ + interface ICvssv3 { + + /** Cvssv3 baseScore */ + baseScore?: (number|null); + + /** Cvssv3 attackVector */ + attackVector?: (google.cloud.securitycenter.v1.Cvssv3.AttackVector|keyof typeof google.cloud.securitycenter.v1.Cvssv3.AttackVector|null); + + /** Cvssv3 attackComplexity */ + attackComplexity?: (google.cloud.securitycenter.v1.Cvssv3.AttackComplexity|keyof typeof google.cloud.securitycenter.v1.Cvssv3.AttackComplexity|null); + + /** Cvssv3 privilegesRequired */ + privilegesRequired?: (google.cloud.securitycenter.v1.Cvssv3.PrivilegesRequired|keyof typeof google.cloud.securitycenter.v1.Cvssv3.PrivilegesRequired|null); + + /** Cvssv3 userInteraction */ + userInteraction?: (google.cloud.securitycenter.v1.Cvssv3.UserInteraction|keyof typeof google.cloud.securitycenter.v1.Cvssv3.UserInteraction|null); + + /** Cvssv3 scope */ + scope?: (google.cloud.securitycenter.v1.Cvssv3.Scope|keyof typeof google.cloud.securitycenter.v1.Cvssv3.Scope|null); + + /** Cvssv3 confidentialityImpact */ + confidentialityImpact?: (google.cloud.securitycenter.v1.Cvssv3.Impact|keyof typeof google.cloud.securitycenter.v1.Cvssv3.Impact|null); + + /** Cvssv3 integrityImpact */ + integrityImpact?: (google.cloud.securitycenter.v1.Cvssv3.Impact|keyof typeof google.cloud.securitycenter.v1.Cvssv3.Impact|null); + + /** Cvssv3 availabilityImpact */ + availabilityImpact?: (google.cloud.securitycenter.v1.Cvssv3.Impact|keyof typeof google.cloud.securitycenter.v1.Cvssv3.Impact|null); + } + + /** Represents a Cvssv3. */ + class Cvssv3 implements ICvssv3 { + + /** + * Constructs a new Cvssv3. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.ICvssv3); + + /** Cvssv3 baseScore. */ + public baseScore: number; + + /** Cvssv3 attackVector. */ + public attackVector: (google.cloud.securitycenter.v1.Cvssv3.AttackVector|keyof typeof google.cloud.securitycenter.v1.Cvssv3.AttackVector); + + /** Cvssv3 attackComplexity. */ + public attackComplexity: (google.cloud.securitycenter.v1.Cvssv3.AttackComplexity|keyof typeof google.cloud.securitycenter.v1.Cvssv3.AttackComplexity); + + /** Cvssv3 privilegesRequired. */ + public privilegesRequired: (google.cloud.securitycenter.v1.Cvssv3.PrivilegesRequired|keyof typeof google.cloud.securitycenter.v1.Cvssv3.PrivilegesRequired); + + /** Cvssv3 userInteraction. */ + public userInteraction: (google.cloud.securitycenter.v1.Cvssv3.UserInteraction|keyof typeof google.cloud.securitycenter.v1.Cvssv3.UserInteraction); + + /** Cvssv3 scope. */ + public scope: (google.cloud.securitycenter.v1.Cvssv3.Scope|keyof typeof google.cloud.securitycenter.v1.Cvssv3.Scope); + + /** Cvssv3 confidentialityImpact. */ + public confidentialityImpact: (google.cloud.securitycenter.v1.Cvssv3.Impact|keyof typeof google.cloud.securitycenter.v1.Cvssv3.Impact); + + /** Cvssv3 integrityImpact. */ + public integrityImpact: (google.cloud.securitycenter.v1.Cvssv3.Impact|keyof typeof google.cloud.securitycenter.v1.Cvssv3.Impact); + + /** Cvssv3 availabilityImpact. */ + public availabilityImpact: (google.cloud.securitycenter.v1.Cvssv3.Impact|keyof typeof google.cloud.securitycenter.v1.Cvssv3.Impact); + + /** + * Creates a new Cvssv3 instance using the specified properties. + * @param [properties] Properties to set + * @returns Cvssv3 instance + */ + public static create(properties?: google.cloud.securitycenter.v1.ICvssv3): google.cloud.securitycenter.v1.Cvssv3; + + /** + * Encodes the specified Cvssv3 message. Does not implicitly {@link google.cloud.securitycenter.v1.Cvssv3.verify|verify} messages. + * @param message Cvssv3 message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.ICvssv3, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Cvssv3 message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Cvssv3.verify|verify} messages. + * @param message Cvssv3 message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.ICvssv3, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Cvssv3 message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Cvssv3 + * @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.cloud.securitycenter.v1.Cvssv3; + + /** + * Decodes a Cvssv3 message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Cvssv3 + * @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.cloud.securitycenter.v1.Cvssv3; + + /** + * Verifies a Cvssv3 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 Cvssv3 message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Cvssv3 + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.Cvssv3; + + /** + * Creates a plain object from a Cvssv3 message. Also converts values to other types if specified. + * @param message Cvssv3 + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.Cvssv3, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Cvssv3 to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace Cvssv3 { + + /** AttackVector enum. */ + enum AttackVector { + ATTACK_VECTOR_UNSPECIFIED = 0, + ATTACK_VECTOR_NETWORK = 1, + ATTACK_VECTOR_ADJACENT = 2, + ATTACK_VECTOR_LOCAL = 3, + ATTACK_VECTOR_PHYSICAL = 4 + } + + /** AttackComplexity enum. */ + enum AttackComplexity { + ATTACK_COMPLEXITY_UNSPECIFIED = 0, + ATTACK_COMPLEXITY_LOW = 1, + ATTACK_COMPLEXITY_HIGH = 2 + } + + /** PrivilegesRequired enum. */ + enum PrivilegesRequired { + PRIVILEGES_REQUIRED_UNSPECIFIED = 0, + PRIVILEGES_REQUIRED_NONE = 1, + PRIVILEGES_REQUIRED_LOW = 2, + PRIVILEGES_REQUIRED_HIGH = 3 + } + + /** UserInteraction enum. */ + enum UserInteraction { + USER_INTERACTION_UNSPECIFIED = 0, + USER_INTERACTION_NONE = 1, + USER_INTERACTION_REQUIRED = 2 + } + + /** Scope enum. */ + enum Scope { + SCOPE_UNSPECIFIED = 0, + SCOPE_UNCHANGED = 1, + SCOPE_CHANGED = 2 + } + + /** Impact enum. */ + enum Impact { + IMPACT_UNSPECIFIED = 0, + IMPACT_HIGH = 1, + IMPACT_LOW = 2, + IMPACT_NONE = 3 + } + } + /** Properties of a NotificationConfig. */ interface INotificationConfig { @@ -1212,6 +1693,9 @@ export namespace google { /** Resource parentDisplayName */ parentDisplayName?: (string|null); + /** Resource type */ + type?: (string|null); + /** Resource folders */ folders?: (google.cloud.securitycenter.v1.IFolder[]|null); } @@ -1240,6 +1724,9 @@ export namespace google { /** Resource parentDisplayName. */ public parentDisplayName: string; + /** Resource type. */ + public type: string; + /** Resource folders. */ public folders: google.cloud.securitycenter.v1.IFolder[]; diff --git a/packages/google-cloud-securitycenter/protos/protos.js b/packages/google-cloud-securitycenter/protos/protos.js index 7b8f66c2271..ee76c255d2d 100644 --- a/packages/google-cloud-securitycenter/protos/protos.js +++ b/packages/google-cloud-securitycenter/protos/protos.js @@ -1564,6 +1564,7 @@ * @property {string|null} [canonicalName] Finding canonicalName * @property {google.cloud.securitycenter.v1.Finding.FindingClass|null} [findingClass] Finding findingClass * @property {google.cloud.securitycenter.v1.IIndicator|null} [indicator] Finding indicator + * @property {google.cloud.securitycenter.v1.IVulnerability|null} [vulnerability] Finding vulnerability */ /** @@ -1694,6 +1695,14 @@ */ Finding.prototype.indicator = null; + /** + * Finding vulnerability. + * @member {google.cloud.securitycenter.v1.IVulnerability|null|undefined} vulnerability + * @memberof google.cloud.securitycenter.v1.Finding + * @instance + */ + Finding.prototype.vulnerability = null; + /** * Creates a new Finding instance using the specified properties. * @function create @@ -1749,6 +1758,8 @@ writer.uint32(/* id 17, wireType 0 =*/136).int32(message.findingClass); if (message.indicator != null && Object.hasOwnProperty.call(message, "indicator")) $root.google.cloud.securitycenter.v1.Indicator.encode(message.indicator, writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); + if (message.vulnerability != null && Object.hasOwnProperty.call(message, "vulnerability")) + $root.google.cloud.securitycenter.v1.Vulnerability.encode(message.vulnerability, writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); return writer; }; @@ -1844,6 +1855,9 @@ case 18: message.indicator = $root.google.cloud.securitycenter.v1.Indicator.decode(reader, reader.uint32()); break; + case 20: + message.vulnerability = $root.google.cloud.securitycenter.v1.Vulnerability.decode(reader, reader.uint32()); + break; default: reader.skipType(tag & 7); break; @@ -1958,6 +1972,11 @@ if (error) return "indicator." + error; } + if (message.vulnerability != null && message.hasOwnProperty("vulnerability")) { + var error = $root.google.cloud.securitycenter.v1.Vulnerability.verify(message.vulnerability); + if (error) + return "vulnerability." + error; + } return null; }; @@ -2073,6 +2092,11 @@ throw TypeError(".google.cloud.securitycenter.v1.Finding.indicator: object expected"); message.indicator = $root.google.cloud.securitycenter.v1.Indicator.fromObject(object.indicator); } + if (object.vulnerability != null) { + if (typeof object.vulnerability !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Finding.vulnerability: object expected"); + message.vulnerability = $root.google.cloud.securitycenter.v1.Vulnerability.fromObject(object.vulnerability); + } return message; }; @@ -2105,6 +2129,7 @@ object.canonicalName = ""; object.findingClass = options.enums === String ? "FINDING_CLASS_UNSPECIFIED" : 0; object.indicator = null; + object.vulnerability = null; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -2138,6 +2163,8 @@ object.findingClass = options.enums === String ? $root.google.cloud.securitycenter.v1.Finding.FindingClass[message.findingClass] : message.findingClass; if (message.indicator != null && message.hasOwnProperty("indicator")) object.indicator = $root.google.cloud.securitycenter.v1.Indicator.toObject(message.indicator, options); + if (message.vulnerability != null && message.hasOwnProperty("vulnerability")) + object.vulnerability = $root.google.cloud.securitycenter.v1.Vulnerability.toObject(message.vulnerability, options); return object; }; @@ -2307,26 +2334,1019 @@ * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.Indicator} Indicator + * @returns {google.cloud.securitycenter.v1.Indicator} Indicator + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Indicator.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.cloud.securitycenter.v1.Indicator(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.ipAddresses && message.ipAddresses.length)) + message.ipAddresses = []; + message.ipAddresses.push(reader.string()); + break; + case 2: + if (!(message.domains && message.domains.length)) + message.domains = []; + message.domains.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Indicator message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.Indicator + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.Indicator} Indicator + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Indicator.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Indicator message. + * @function verify + * @memberof google.cloud.securitycenter.v1.Indicator + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Indicator.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.ipAddresses != null && message.hasOwnProperty("ipAddresses")) { + if (!Array.isArray(message.ipAddresses)) + return "ipAddresses: array expected"; + for (var i = 0; i < message.ipAddresses.length; ++i) + if (!$util.isString(message.ipAddresses[i])) + return "ipAddresses: string[] expected"; + } + if (message.domains != null && message.hasOwnProperty("domains")) { + if (!Array.isArray(message.domains)) + return "domains: array expected"; + for (var i = 0; i < message.domains.length; ++i) + if (!$util.isString(message.domains[i])) + return "domains: string[] expected"; + } + return null; + }; + + /** + * Creates an Indicator message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.Indicator + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.Indicator} Indicator + */ + Indicator.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.Indicator) + return object; + var message = new $root.google.cloud.securitycenter.v1.Indicator(); + if (object.ipAddresses) { + if (!Array.isArray(object.ipAddresses)) + throw TypeError(".google.cloud.securitycenter.v1.Indicator.ipAddresses: array expected"); + message.ipAddresses = []; + for (var i = 0; i < object.ipAddresses.length; ++i) + message.ipAddresses[i] = String(object.ipAddresses[i]); + } + if (object.domains) { + if (!Array.isArray(object.domains)) + throw TypeError(".google.cloud.securitycenter.v1.Indicator.domains: array expected"); + message.domains = []; + for (var i = 0; i < object.domains.length; ++i) + message.domains[i] = String(object.domains[i]); + } + return message; + }; + + /** + * Creates a plain object from an Indicator message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.Indicator + * @static + * @param {google.cloud.securitycenter.v1.Indicator} message Indicator + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Indicator.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.ipAddresses = []; + object.domains = []; + } + if (message.ipAddresses && message.ipAddresses.length) { + object.ipAddresses = []; + for (var j = 0; j < message.ipAddresses.length; ++j) + object.ipAddresses[j] = message.ipAddresses[j]; + } + if (message.domains && message.domains.length) { + object.domains = []; + for (var j = 0; j < message.domains.length; ++j) + object.domains[j] = message.domains[j]; + } + return object; + }; + + /** + * Converts this Indicator to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.Indicator + * @instance + * @returns {Object.} JSON object + */ + Indicator.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Indicator; + })(); + + v1.Vulnerability = (function() { + + /** + * Properties of a Vulnerability. + * @memberof google.cloud.securitycenter.v1 + * @interface IVulnerability + * @property {google.cloud.securitycenter.v1.ICve|null} [cve] Vulnerability cve + */ + + /** + * Constructs a new Vulnerability. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a Vulnerability. + * @implements IVulnerability + * @constructor + * @param {google.cloud.securitycenter.v1.IVulnerability=} [properties] Properties to set + */ + function Vulnerability(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]]; + } + + /** + * Vulnerability cve. + * @member {google.cloud.securitycenter.v1.ICve|null|undefined} cve + * @memberof google.cloud.securitycenter.v1.Vulnerability + * @instance + */ + Vulnerability.prototype.cve = null; + + /** + * Creates a new Vulnerability instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.Vulnerability + * @static + * @param {google.cloud.securitycenter.v1.IVulnerability=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.Vulnerability} Vulnerability instance + */ + Vulnerability.create = function create(properties) { + return new Vulnerability(properties); + }; + + /** + * Encodes the specified Vulnerability message. Does not implicitly {@link google.cloud.securitycenter.v1.Vulnerability.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.Vulnerability + * @static + * @param {google.cloud.securitycenter.v1.IVulnerability} message Vulnerability message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Vulnerability.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.cve != null && Object.hasOwnProperty.call(message, "cve")) + $root.google.cloud.securitycenter.v1.Cve.encode(message.cve, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Vulnerability message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Vulnerability.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.Vulnerability + * @static + * @param {google.cloud.securitycenter.v1.IVulnerability} message Vulnerability message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Vulnerability.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Vulnerability message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.Vulnerability + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.Vulnerability} Vulnerability + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Vulnerability.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.cloud.securitycenter.v1.Vulnerability(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.cve = $root.google.cloud.securitycenter.v1.Cve.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Vulnerability message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.Vulnerability + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.Vulnerability} Vulnerability + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Vulnerability.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Vulnerability message. + * @function verify + * @memberof google.cloud.securitycenter.v1.Vulnerability + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Vulnerability.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.cve != null && message.hasOwnProperty("cve")) { + var error = $root.google.cloud.securitycenter.v1.Cve.verify(message.cve); + if (error) + return "cve." + error; + } + return null; + }; + + /** + * Creates a Vulnerability message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.Vulnerability + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.Vulnerability} Vulnerability + */ + Vulnerability.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.Vulnerability) + return object; + var message = new $root.google.cloud.securitycenter.v1.Vulnerability(); + if (object.cve != null) { + if (typeof object.cve !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Vulnerability.cve: object expected"); + message.cve = $root.google.cloud.securitycenter.v1.Cve.fromObject(object.cve); + } + return message; + }; + + /** + * Creates a plain object from a Vulnerability message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.Vulnerability + * @static + * @param {google.cloud.securitycenter.v1.Vulnerability} message Vulnerability + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Vulnerability.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.cve = null; + if (message.cve != null && message.hasOwnProperty("cve")) + object.cve = $root.google.cloud.securitycenter.v1.Cve.toObject(message.cve, options); + return object; + }; + + /** + * Converts this Vulnerability to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.Vulnerability + * @instance + * @returns {Object.} JSON object + */ + Vulnerability.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Vulnerability; + })(); + + v1.Cve = (function() { + + /** + * Properties of a Cve. + * @memberof google.cloud.securitycenter.v1 + * @interface ICve + * @property {string|null} [id] Cve id + * @property {Array.|null} [references] Cve references + * @property {google.cloud.securitycenter.v1.ICvssv3|null} [cvssv3] Cve cvssv3 + */ + + /** + * Constructs a new Cve. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a Cve. + * @implements ICve + * @constructor + * @param {google.cloud.securitycenter.v1.ICve=} [properties] Properties to set + */ + function Cve(properties) { + this.references = []; + 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]]; + } + + /** + * Cve id. + * @member {string} id + * @memberof google.cloud.securitycenter.v1.Cve + * @instance + */ + Cve.prototype.id = ""; + + /** + * Cve references. + * @member {Array.} references + * @memberof google.cloud.securitycenter.v1.Cve + * @instance + */ + Cve.prototype.references = $util.emptyArray; + + /** + * Cve cvssv3. + * @member {google.cloud.securitycenter.v1.ICvssv3|null|undefined} cvssv3 + * @memberof google.cloud.securitycenter.v1.Cve + * @instance + */ + Cve.prototype.cvssv3 = null; + + /** + * Creates a new Cve instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.Cve + * @static + * @param {google.cloud.securitycenter.v1.ICve=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.Cve} Cve instance + */ + Cve.create = function create(properties) { + return new Cve(properties); + }; + + /** + * Encodes the specified Cve message. Does not implicitly {@link google.cloud.securitycenter.v1.Cve.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.Cve + * @static + * @param {google.cloud.securitycenter.v1.ICve} message Cve message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Cve.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.id); + if (message.references != null && message.references.length) + for (var i = 0; i < message.references.length; ++i) + $root.google.cloud.securitycenter.v1.Reference.encode(message.references[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.cvssv3 != null && Object.hasOwnProperty.call(message, "cvssv3")) + $root.google.cloud.securitycenter.v1.Cvssv3.encode(message.cvssv3, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Cve message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Cve.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.Cve + * @static + * @param {google.cloud.securitycenter.v1.ICve} message Cve message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Cve.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Cve message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.Cve + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.Cve} Cve + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Cve.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.cloud.securitycenter.v1.Cve(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.string(); + break; + case 2: + if (!(message.references && message.references.length)) + message.references = []; + message.references.push($root.google.cloud.securitycenter.v1.Reference.decode(reader, reader.uint32())); + break; + case 3: + message.cvssv3 = $root.google.cloud.securitycenter.v1.Cvssv3.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Cve message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.Cve + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.Cve} Cve + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Cve.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Cve message. + * @function verify + * @memberof google.cloud.securitycenter.v1.Cve + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Cve.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.id != null && message.hasOwnProperty("id")) + if (!$util.isString(message.id)) + return "id: string expected"; + if (message.references != null && message.hasOwnProperty("references")) { + if (!Array.isArray(message.references)) + return "references: array expected"; + for (var i = 0; i < message.references.length; ++i) { + var error = $root.google.cloud.securitycenter.v1.Reference.verify(message.references[i]); + if (error) + return "references." + error; + } + } + if (message.cvssv3 != null && message.hasOwnProperty("cvssv3")) { + var error = $root.google.cloud.securitycenter.v1.Cvssv3.verify(message.cvssv3); + if (error) + return "cvssv3." + error; + } + return null; + }; + + /** + * Creates a Cve message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.Cve + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.Cve} Cve + */ + Cve.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.Cve) + return object; + var message = new $root.google.cloud.securitycenter.v1.Cve(); + if (object.id != null) + message.id = String(object.id); + if (object.references) { + if (!Array.isArray(object.references)) + throw TypeError(".google.cloud.securitycenter.v1.Cve.references: array expected"); + message.references = []; + for (var i = 0; i < object.references.length; ++i) { + if (typeof object.references[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Cve.references: object expected"); + message.references[i] = $root.google.cloud.securitycenter.v1.Reference.fromObject(object.references[i]); + } + } + if (object.cvssv3 != null) { + if (typeof object.cvssv3 !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Cve.cvssv3: object expected"); + message.cvssv3 = $root.google.cloud.securitycenter.v1.Cvssv3.fromObject(object.cvssv3); + } + return message; + }; + + /** + * Creates a plain object from a Cve message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.Cve + * @static + * @param {google.cloud.securitycenter.v1.Cve} message Cve + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Cve.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.references = []; + if (options.defaults) { + object.id = ""; + object.cvssv3 = null; + } + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; + if (message.references && message.references.length) { + object.references = []; + for (var j = 0; j < message.references.length; ++j) + object.references[j] = $root.google.cloud.securitycenter.v1.Reference.toObject(message.references[j], options); + } + if (message.cvssv3 != null && message.hasOwnProperty("cvssv3")) + object.cvssv3 = $root.google.cloud.securitycenter.v1.Cvssv3.toObject(message.cvssv3, options); + return object; + }; + + /** + * Converts this Cve to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.Cve + * @instance + * @returns {Object.} JSON object + */ + Cve.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Cve; + })(); + + v1.Reference = (function() { + + /** + * Properties of a Reference. + * @memberof google.cloud.securitycenter.v1 + * @interface IReference + * @property {string|null} [source] Reference source + * @property {string|null} [uri] Reference uri + */ + + /** + * Constructs a new Reference. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a Reference. + * @implements IReference + * @constructor + * @param {google.cloud.securitycenter.v1.IReference=} [properties] Properties to set + */ + function Reference(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]]; + } + + /** + * Reference source. + * @member {string} source + * @memberof google.cloud.securitycenter.v1.Reference + * @instance + */ + Reference.prototype.source = ""; + + /** + * Reference uri. + * @member {string} uri + * @memberof google.cloud.securitycenter.v1.Reference + * @instance + */ + Reference.prototype.uri = ""; + + /** + * Creates a new Reference instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.Reference + * @static + * @param {google.cloud.securitycenter.v1.IReference=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.Reference} Reference instance + */ + Reference.create = function create(properties) { + return new Reference(properties); + }; + + /** + * Encodes the specified Reference message. Does not implicitly {@link google.cloud.securitycenter.v1.Reference.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.Reference + * @static + * @param {google.cloud.securitycenter.v1.IReference} message Reference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Reference.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.source != null && Object.hasOwnProperty.call(message, "source")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.source); + if (message.uri != null && Object.hasOwnProperty.call(message, "uri")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.uri); + return writer; + }; + + /** + * Encodes the specified Reference message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Reference.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.Reference + * @static + * @param {google.cloud.securitycenter.v1.IReference} message Reference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Reference.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Reference message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.Reference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.Reference} Reference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Reference.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.cloud.securitycenter.v1.Reference(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.source = reader.string(); + break; + case 2: + message.uri = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Reference message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.Reference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.Reference} Reference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Reference.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Reference message. + * @function verify + * @memberof google.cloud.securitycenter.v1.Reference + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Reference.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.source != null && message.hasOwnProperty("source")) + if (!$util.isString(message.source)) + return "source: string expected"; + if (message.uri != null && message.hasOwnProperty("uri")) + if (!$util.isString(message.uri)) + return "uri: string expected"; + return null; + }; + + /** + * Creates a Reference message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.Reference + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.Reference} Reference + */ + Reference.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.Reference) + return object; + var message = new $root.google.cloud.securitycenter.v1.Reference(); + if (object.source != null) + message.source = String(object.source); + if (object.uri != null) + message.uri = String(object.uri); + return message; + }; + + /** + * Creates a plain object from a Reference message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.Reference + * @static + * @param {google.cloud.securitycenter.v1.Reference} message Reference + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Reference.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.source = ""; + object.uri = ""; + } + if (message.source != null && message.hasOwnProperty("source")) + object.source = message.source; + if (message.uri != null && message.hasOwnProperty("uri")) + object.uri = message.uri; + return object; + }; + + /** + * Converts this Reference to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.Reference + * @instance + * @returns {Object.} JSON object + */ + Reference.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Reference; + })(); + + v1.Cvssv3 = (function() { + + /** + * Properties of a Cvssv3. + * @memberof google.cloud.securitycenter.v1 + * @interface ICvssv3 + * @property {number|null} [baseScore] Cvssv3 baseScore + * @property {google.cloud.securitycenter.v1.Cvssv3.AttackVector|null} [attackVector] Cvssv3 attackVector + * @property {google.cloud.securitycenter.v1.Cvssv3.AttackComplexity|null} [attackComplexity] Cvssv3 attackComplexity + * @property {google.cloud.securitycenter.v1.Cvssv3.PrivilegesRequired|null} [privilegesRequired] Cvssv3 privilegesRequired + * @property {google.cloud.securitycenter.v1.Cvssv3.UserInteraction|null} [userInteraction] Cvssv3 userInteraction + * @property {google.cloud.securitycenter.v1.Cvssv3.Scope|null} [scope] Cvssv3 scope + * @property {google.cloud.securitycenter.v1.Cvssv3.Impact|null} [confidentialityImpact] Cvssv3 confidentialityImpact + * @property {google.cloud.securitycenter.v1.Cvssv3.Impact|null} [integrityImpact] Cvssv3 integrityImpact + * @property {google.cloud.securitycenter.v1.Cvssv3.Impact|null} [availabilityImpact] Cvssv3 availabilityImpact + */ + + /** + * Constructs a new Cvssv3. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a Cvssv3. + * @implements ICvssv3 + * @constructor + * @param {google.cloud.securitycenter.v1.ICvssv3=} [properties] Properties to set + */ + function Cvssv3(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]]; + } + + /** + * Cvssv3 baseScore. + * @member {number} baseScore + * @memberof google.cloud.securitycenter.v1.Cvssv3 + * @instance + */ + Cvssv3.prototype.baseScore = 0; + + /** + * Cvssv3 attackVector. + * @member {google.cloud.securitycenter.v1.Cvssv3.AttackVector} attackVector + * @memberof google.cloud.securitycenter.v1.Cvssv3 + * @instance + */ + Cvssv3.prototype.attackVector = 0; + + /** + * Cvssv3 attackComplexity. + * @member {google.cloud.securitycenter.v1.Cvssv3.AttackComplexity} attackComplexity + * @memberof google.cloud.securitycenter.v1.Cvssv3 + * @instance + */ + Cvssv3.prototype.attackComplexity = 0; + + /** + * Cvssv3 privilegesRequired. + * @member {google.cloud.securitycenter.v1.Cvssv3.PrivilegesRequired} privilegesRequired + * @memberof google.cloud.securitycenter.v1.Cvssv3 + * @instance + */ + Cvssv3.prototype.privilegesRequired = 0; + + /** + * Cvssv3 userInteraction. + * @member {google.cloud.securitycenter.v1.Cvssv3.UserInteraction} userInteraction + * @memberof google.cloud.securitycenter.v1.Cvssv3 + * @instance + */ + Cvssv3.prototype.userInteraction = 0; + + /** + * Cvssv3 scope. + * @member {google.cloud.securitycenter.v1.Cvssv3.Scope} scope + * @memberof google.cloud.securitycenter.v1.Cvssv3 + * @instance + */ + Cvssv3.prototype.scope = 0; + + /** + * Cvssv3 confidentialityImpact. + * @member {google.cloud.securitycenter.v1.Cvssv3.Impact} confidentialityImpact + * @memberof google.cloud.securitycenter.v1.Cvssv3 + * @instance + */ + Cvssv3.prototype.confidentialityImpact = 0; + + /** + * Cvssv3 integrityImpact. + * @member {google.cloud.securitycenter.v1.Cvssv3.Impact} integrityImpact + * @memberof google.cloud.securitycenter.v1.Cvssv3 + * @instance + */ + Cvssv3.prototype.integrityImpact = 0; + + /** + * Cvssv3 availabilityImpact. + * @member {google.cloud.securitycenter.v1.Cvssv3.Impact} availabilityImpact + * @memberof google.cloud.securitycenter.v1.Cvssv3 + * @instance + */ + Cvssv3.prototype.availabilityImpact = 0; + + /** + * Creates a new Cvssv3 instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.Cvssv3 + * @static + * @param {google.cloud.securitycenter.v1.ICvssv3=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.Cvssv3} Cvssv3 instance + */ + Cvssv3.create = function create(properties) { + return new Cvssv3(properties); + }; + + /** + * Encodes the specified Cvssv3 message. Does not implicitly {@link google.cloud.securitycenter.v1.Cvssv3.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.Cvssv3 + * @static + * @param {google.cloud.securitycenter.v1.ICvssv3} message Cvssv3 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Cvssv3.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.baseScore != null && Object.hasOwnProperty.call(message, "baseScore")) + writer.uint32(/* id 1, wireType 1 =*/9).double(message.baseScore); + if (message.attackVector != null && Object.hasOwnProperty.call(message, "attackVector")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.attackVector); + if (message.attackComplexity != null && Object.hasOwnProperty.call(message, "attackComplexity")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.attackComplexity); + if (message.privilegesRequired != null && Object.hasOwnProperty.call(message, "privilegesRequired")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.privilegesRequired); + if (message.userInteraction != null && Object.hasOwnProperty.call(message, "userInteraction")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.userInteraction); + if (message.scope != null && Object.hasOwnProperty.call(message, "scope")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.scope); + if (message.confidentialityImpact != null && Object.hasOwnProperty.call(message, "confidentialityImpact")) + writer.uint32(/* id 10, wireType 0 =*/80).int32(message.confidentialityImpact); + if (message.integrityImpact != null && Object.hasOwnProperty.call(message, "integrityImpact")) + writer.uint32(/* id 11, wireType 0 =*/88).int32(message.integrityImpact); + if (message.availabilityImpact != null && Object.hasOwnProperty.call(message, "availabilityImpact")) + writer.uint32(/* id 12, wireType 0 =*/96).int32(message.availabilityImpact); + return writer; + }; + + /** + * Encodes the specified Cvssv3 message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Cvssv3.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.Cvssv3 + * @static + * @param {google.cloud.securitycenter.v1.ICvssv3} message Cvssv3 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Cvssv3.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Cvssv3 message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.Cvssv3 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.Cvssv3} Cvssv3 * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Indicator.decode = function decode(reader, length) { + Cvssv3.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.cloud.securitycenter.v1.Indicator(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.Cvssv3(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - if (!(message.ipAddresses && message.ipAddresses.length)) - message.ipAddresses = []; - message.ipAddresses.push(reader.string()); + message.baseScore = reader.double(); break; - case 2: - if (!(message.domains && message.domains.length)) - message.domains = []; - message.domains.push(reader.string()); + case 5: + message.attackVector = reader.int32(); + break; + case 6: + message.attackComplexity = reader.int32(); + break; + case 7: + message.privilegesRequired = reader.int32(); + break; + case 8: + message.userInteraction = reader.int32(); + break; + case 9: + message.scope = reader.int32(); + break; + case 10: + message.confidentialityImpact = reader.int32(); + break; + case 11: + message.integrityImpact = reader.int32(); + break; + case 12: + message.availabilityImpact = reader.int32(); break; default: reader.skipType(tag & 7); @@ -2337,120 +3357,430 @@ }; /** - * Decodes an Indicator message from the specified reader or buffer, length delimited. + * Decodes a Cvssv3 message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.Indicator + * @memberof google.cloud.securitycenter.v1.Cvssv3 * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.Indicator} Indicator + * @returns {google.cloud.securitycenter.v1.Cvssv3} Cvssv3 * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Indicator.decodeDelimited = function decodeDelimited(reader) { + Cvssv3.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an Indicator message. + * Verifies a Cvssv3 message. * @function verify - * @memberof google.cloud.securitycenter.v1.Indicator + * @memberof google.cloud.securitycenter.v1.Cvssv3 * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Indicator.verify = function verify(message) { + Cvssv3.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.ipAddresses != null && message.hasOwnProperty("ipAddresses")) { - if (!Array.isArray(message.ipAddresses)) - return "ipAddresses: array expected"; - for (var i = 0; i < message.ipAddresses.length; ++i) - if (!$util.isString(message.ipAddresses[i])) - return "ipAddresses: string[] expected"; - } - if (message.domains != null && message.hasOwnProperty("domains")) { - if (!Array.isArray(message.domains)) - return "domains: array expected"; - for (var i = 0; i < message.domains.length; ++i) - if (!$util.isString(message.domains[i])) - return "domains: string[] expected"; - } + if (message.baseScore != null && message.hasOwnProperty("baseScore")) + if (typeof message.baseScore !== "number") + return "baseScore: number expected"; + if (message.attackVector != null && message.hasOwnProperty("attackVector")) + switch (message.attackVector) { + default: + return "attackVector: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.attackComplexity != null && message.hasOwnProperty("attackComplexity")) + switch (message.attackComplexity) { + default: + return "attackComplexity: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.privilegesRequired != null && message.hasOwnProperty("privilegesRequired")) + switch (message.privilegesRequired) { + default: + return "privilegesRequired: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.userInteraction != null && message.hasOwnProperty("userInteraction")) + switch (message.userInteraction) { + default: + return "userInteraction: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.scope != null && message.hasOwnProperty("scope")) + switch (message.scope) { + default: + return "scope: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.confidentialityImpact != null && message.hasOwnProperty("confidentialityImpact")) + switch (message.confidentialityImpact) { + default: + return "confidentialityImpact: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.integrityImpact != null && message.hasOwnProperty("integrityImpact")) + switch (message.integrityImpact) { + default: + return "integrityImpact: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.availabilityImpact != null && message.hasOwnProperty("availabilityImpact")) + switch (message.availabilityImpact) { + default: + return "availabilityImpact: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } return null; }; /** - * Creates an Indicator message from a plain object. Also converts values to their respective internal types. + * Creates a Cvssv3 message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.securitycenter.v1.Indicator + * @memberof google.cloud.securitycenter.v1.Cvssv3 * @static * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.Indicator} Indicator + * @returns {google.cloud.securitycenter.v1.Cvssv3} Cvssv3 */ - Indicator.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.Indicator) + Cvssv3.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.Cvssv3) return object; - var message = new $root.google.cloud.securitycenter.v1.Indicator(); - if (object.ipAddresses) { - if (!Array.isArray(object.ipAddresses)) - throw TypeError(".google.cloud.securitycenter.v1.Indicator.ipAddresses: array expected"); - message.ipAddresses = []; - for (var i = 0; i < object.ipAddresses.length; ++i) - message.ipAddresses[i] = String(object.ipAddresses[i]); + var message = new $root.google.cloud.securitycenter.v1.Cvssv3(); + if (object.baseScore != null) + message.baseScore = Number(object.baseScore); + switch (object.attackVector) { + case "ATTACK_VECTOR_UNSPECIFIED": + case 0: + message.attackVector = 0; + break; + case "ATTACK_VECTOR_NETWORK": + case 1: + message.attackVector = 1; + break; + case "ATTACK_VECTOR_ADJACENT": + case 2: + message.attackVector = 2; + break; + case "ATTACK_VECTOR_LOCAL": + case 3: + message.attackVector = 3; + break; + case "ATTACK_VECTOR_PHYSICAL": + case 4: + message.attackVector = 4; + break; } - if (object.domains) { - if (!Array.isArray(object.domains)) - throw TypeError(".google.cloud.securitycenter.v1.Indicator.domains: array expected"); - message.domains = []; - for (var i = 0; i < object.domains.length; ++i) - message.domains[i] = String(object.domains[i]); + switch (object.attackComplexity) { + case "ATTACK_COMPLEXITY_UNSPECIFIED": + case 0: + message.attackComplexity = 0; + break; + case "ATTACK_COMPLEXITY_LOW": + case 1: + message.attackComplexity = 1; + break; + case "ATTACK_COMPLEXITY_HIGH": + case 2: + message.attackComplexity = 2; + break; + } + switch (object.privilegesRequired) { + case "PRIVILEGES_REQUIRED_UNSPECIFIED": + case 0: + message.privilegesRequired = 0; + break; + case "PRIVILEGES_REQUIRED_NONE": + case 1: + message.privilegesRequired = 1; + break; + case "PRIVILEGES_REQUIRED_LOW": + case 2: + message.privilegesRequired = 2; + break; + case "PRIVILEGES_REQUIRED_HIGH": + case 3: + message.privilegesRequired = 3; + break; + } + switch (object.userInteraction) { + case "USER_INTERACTION_UNSPECIFIED": + case 0: + message.userInteraction = 0; + break; + case "USER_INTERACTION_NONE": + case 1: + message.userInteraction = 1; + break; + case "USER_INTERACTION_REQUIRED": + case 2: + message.userInteraction = 2; + break; + } + switch (object.scope) { + case "SCOPE_UNSPECIFIED": + case 0: + message.scope = 0; + break; + case "SCOPE_UNCHANGED": + case 1: + message.scope = 1; + break; + case "SCOPE_CHANGED": + case 2: + message.scope = 2; + break; + } + switch (object.confidentialityImpact) { + case "IMPACT_UNSPECIFIED": + case 0: + message.confidentialityImpact = 0; + break; + case "IMPACT_HIGH": + case 1: + message.confidentialityImpact = 1; + break; + case "IMPACT_LOW": + case 2: + message.confidentialityImpact = 2; + break; + case "IMPACT_NONE": + case 3: + message.confidentialityImpact = 3; + break; + } + switch (object.integrityImpact) { + case "IMPACT_UNSPECIFIED": + case 0: + message.integrityImpact = 0; + break; + case "IMPACT_HIGH": + case 1: + message.integrityImpact = 1; + break; + case "IMPACT_LOW": + case 2: + message.integrityImpact = 2; + break; + case "IMPACT_NONE": + case 3: + message.integrityImpact = 3; + break; + } + switch (object.availabilityImpact) { + case "IMPACT_UNSPECIFIED": + case 0: + message.availabilityImpact = 0; + break; + case "IMPACT_HIGH": + case 1: + message.availabilityImpact = 1; + break; + case "IMPACT_LOW": + case 2: + message.availabilityImpact = 2; + break; + case "IMPACT_NONE": + case 3: + message.availabilityImpact = 3; + break; } return message; }; /** - * Creates a plain object from an Indicator message. Also converts values to other types if specified. + * Creates a plain object from a Cvssv3 message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.securitycenter.v1.Indicator + * @memberof google.cloud.securitycenter.v1.Cvssv3 * @static - * @param {google.cloud.securitycenter.v1.Indicator} message Indicator + * @param {google.cloud.securitycenter.v1.Cvssv3} message Cvssv3 * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Indicator.toObject = function toObject(message, options) { + Cvssv3.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) { - object.ipAddresses = []; - object.domains = []; - } - if (message.ipAddresses && message.ipAddresses.length) { - object.ipAddresses = []; - for (var j = 0; j < message.ipAddresses.length; ++j) - object.ipAddresses[j] = message.ipAddresses[j]; - } - if (message.domains && message.domains.length) { - object.domains = []; - for (var j = 0; j < message.domains.length; ++j) - object.domains[j] = message.domains[j]; - } + if (options.defaults) { + object.baseScore = 0; + object.attackVector = options.enums === String ? "ATTACK_VECTOR_UNSPECIFIED" : 0; + object.attackComplexity = options.enums === String ? "ATTACK_COMPLEXITY_UNSPECIFIED" : 0; + object.privilegesRequired = options.enums === String ? "PRIVILEGES_REQUIRED_UNSPECIFIED" : 0; + object.userInteraction = options.enums === String ? "USER_INTERACTION_UNSPECIFIED" : 0; + object.scope = options.enums === String ? "SCOPE_UNSPECIFIED" : 0; + object.confidentialityImpact = options.enums === String ? "IMPACT_UNSPECIFIED" : 0; + object.integrityImpact = options.enums === String ? "IMPACT_UNSPECIFIED" : 0; + object.availabilityImpact = options.enums === String ? "IMPACT_UNSPECIFIED" : 0; + } + if (message.baseScore != null && message.hasOwnProperty("baseScore")) + object.baseScore = options.json && !isFinite(message.baseScore) ? String(message.baseScore) : message.baseScore; + if (message.attackVector != null && message.hasOwnProperty("attackVector")) + object.attackVector = options.enums === String ? $root.google.cloud.securitycenter.v1.Cvssv3.AttackVector[message.attackVector] : message.attackVector; + if (message.attackComplexity != null && message.hasOwnProperty("attackComplexity")) + object.attackComplexity = options.enums === String ? $root.google.cloud.securitycenter.v1.Cvssv3.AttackComplexity[message.attackComplexity] : message.attackComplexity; + if (message.privilegesRequired != null && message.hasOwnProperty("privilegesRequired")) + object.privilegesRequired = options.enums === String ? $root.google.cloud.securitycenter.v1.Cvssv3.PrivilegesRequired[message.privilegesRequired] : message.privilegesRequired; + if (message.userInteraction != null && message.hasOwnProperty("userInteraction")) + object.userInteraction = options.enums === String ? $root.google.cloud.securitycenter.v1.Cvssv3.UserInteraction[message.userInteraction] : message.userInteraction; + if (message.scope != null && message.hasOwnProperty("scope")) + object.scope = options.enums === String ? $root.google.cloud.securitycenter.v1.Cvssv3.Scope[message.scope] : message.scope; + if (message.confidentialityImpact != null && message.hasOwnProperty("confidentialityImpact")) + object.confidentialityImpact = options.enums === String ? $root.google.cloud.securitycenter.v1.Cvssv3.Impact[message.confidentialityImpact] : message.confidentialityImpact; + if (message.integrityImpact != null && message.hasOwnProperty("integrityImpact")) + object.integrityImpact = options.enums === String ? $root.google.cloud.securitycenter.v1.Cvssv3.Impact[message.integrityImpact] : message.integrityImpact; + if (message.availabilityImpact != null && message.hasOwnProperty("availabilityImpact")) + object.availabilityImpact = options.enums === String ? $root.google.cloud.securitycenter.v1.Cvssv3.Impact[message.availabilityImpact] : message.availabilityImpact; return object; }; /** - * Converts this Indicator to JSON. + * Converts this Cvssv3 to JSON. * @function toJSON - * @memberof google.cloud.securitycenter.v1.Indicator + * @memberof google.cloud.securitycenter.v1.Cvssv3 * @instance * @returns {Object.} JSON object */ - Indicator.prototype.toJSON = function toJSON() { + Cvssv3.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return Indicator; + /** + * AttackVector enum. + * @name google.cloud.securitycenter.v1.Cvssv3.AttackVector + * @enum {number} + * @property {number} ATTACK_VECTOR_UNSPECIFIED=0 ATTACK_VECTOR_UNSPECIFIED value + * @property {number} ATTACK_VECTOR_NETWORK=1 ATTACK_VECTOR_NETWORK value + * @property {number} ATTACK_VECTOR_ADJACENT=2 ATTACK_VECTOR_ADJACENT value + * @property {number} ATTACK_VECTOR_LOCAL=3 ATTACK_VECTOR_LOCAL value + * @property {number} ATTACK_VECTOR_PHYSICAL=4 ATTACK_VECTOR_PHYSICAL value + */ + Cvssv3.AttackVector = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ATTACK_VECTOR_UNSPECIFIED"] = 0; + values[valuesById[1] = "ATTACK_VECTOR_NETWORK"] = 1; + values[valuesById[2] = "ATTACK_VECTOR_ADJACENT"] = 2; + values[valuesById[3] = "ATTACK_VECTOR_LOCAL"] = 3; + values[valuesById[4] = "ATTACK_VECTOR_PHYSICAL"] = 4; + return values; + })(); + + /** + * AttackComplexity enum. + * @name google.cloud.securitycenter.v1.Cvssv3.AttackComplexity + * @enum {number} + * @property {number} ATTACK_COMPLEXITY_UNSPECIFIED=0 ATTACK_COMPLEXITY_UNSPECIFIED value + * @property {number} ATTACK_COMPLEXITY_LOW=1 ATTACK_COMPLEXITY_LOW value + * @property {number} ATTACK_COMPLEXITY_HIGH=2 ATTACK_COMPLEXITY_HIGH value + */ + Cvssv3.AttackComplexity = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ATTACK_COMPLEXITY_UNSPECIFIED"] = 0; + values[valuesById[1] = "ATTACK_COMPLEXITY_LOW"] = 1; + values[valuesById[2] = "ATTACK_COMPLEXITY_HIGH"] = 2; + return values; + })(); + + /** + * PrivilegesRequired enum. + * @name google.cloud.securitycenter.v1.Cvssv3.PrivilegesRequired + * @enum {number} + * @property {number} PRIVILEGES_REQUIRED_UNSPECIFIED=0 PRIVILEGES_REQUIRED_UNSPECIFIED value + * @property {number} PRIVILEGES_REQUIRED_NONE=1 PRIVILEGES_REQUIRED_NONE value + * @property {number} PRIVILEGES_REQUIRED_LOW=2 PRIVILEGES_REQUIRED_LOW value + * @property {number} PRIVILEGES_REQUIRED_HIGH=3 PRIVILEGES_REQUIRED_HIGH value + */ + Cvssv3.PrivilegesRequired = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "PRIVILEGES_REQUIRED_UNSPECIFIED"] = 0; + values[valuesById[1] = "PRIVILEGES_REQUIRED_NONE"] = 1; + values[valuesById[2] = "PRIVILEGES_REQUIRED_LOW"] = 2; + values[valuesById[3] = "PRIVILEGES_REQUIRED_HIGH"] = 3; + return values; + })(); + + /** + * UserInteraction enum. + * @name google.cloud.securitycenter.v1.Cvssv3.UserInteraction + * @enum {number} + * @property {number} USER_INTERACTION_UNSPECIFIED=0 USER_INTERACTION_UNSPECIFIED value + * @property {number} USER_INTERACTION_NONE=1 USER_INTERACTION_NONE value + * @property {number} USER_INTERACTION_REQUIRED=2 USER_INTERACTION_REQUIRED value + */ + Cvssv3.UserInteraction = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "USER_INTERACTION_UNSPECIFIED"] = 0; + values[valuesById[1] = "USER_INTERACTION_NONE"] = 1; + values[valuesById[2] = "USER_INTERACTION_REQUIRED"] = 2; + return values; + })(); + + /** + * Scope enum. + * @name google.cloud.securitycenter.v1.Cvssv3.Scope + * @enum {number} + * @property {number} SCOPE_UNSPECIFIED=0 SCOPE_UNSPECIFIED value + * @property {number} SCOPE_UNCHANGED=1 SCOPE_UNCHANGED value + * @property {number} SCOPE_CHANGED=2 SCOPE_CHANGED value + */ + Cvssv3.Scope = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SCOPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "SCOPE_UNCHANGED"] = 1; + values[valuesById[2] = "SCOPE_CHANGED"] = 2; + return values; + })(); + + /** + * Impact enum. + * @name google.cloud.securitycenter.v1.Cvssv3.Impact + * @enum {number} + * @property {number} IMPACT_UNSPECIFIED=0 IMPACT_UNSPECIFIED value + * @property {number} IMPACT_HIGH=1 IMPACT_HIGH value + * @property {number} IMPACT_LOW=2 IMPACT_LOW value + * @property {number} IMPACT_NONE=3 IMPACT_NONE value + */ + Cvssv3.Impact = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "IMPACT_UNSPECIFIED"] = 0; + values[valuesById[1] = "IMPACT_HIGH"] = 1; + values[valuesById[2] = "IMPACT_LOW"] = 2; + values[valuesById[3] = "IMPACT_NONE"] = 3; + return values; + })(); + + return Cvssv3; })(); v1.NotificationConfig = (function() { @@ -3214,6 +4544,7 @@ * @property {string|null} [projectDisplayName] Resource projectDisplayName * @property {string|null} [parent] Resource parent * @property {string|null} [parentDisplayName] Resource parentDisplayName + * @property {string|null} [type] Resource type * @property {Array.|null} [folders] Resource folders */ @@ -3273,6 +4604,14 @@ */ Resource.prototype.parentDisplayName = ""; + /** + * Resource type. + * @member {string} type + * @memberof google.cloud.securitycenter.v1.Resource + * @instance + */ + Resource.prototype.type = ""; + /** * Resource folders. * @member {Array.} folders @@ -3315,6 +4654,8 @@ writer.uint32(/* id 4, wireType 2 =*/34).string(message.parent); if (message.parentDisplayName != null && Object.hasOwnProperty.call(message, "parentDisplayName")) writer.uint32(/* id 5, wireType 2 =*/42).string(message.parentDisplayName); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.type); if (message.folders != null && message.folders.length) for (var i = 0; i < message.folders.length; ++i) $root.google.cloud.securitycenter.v1.Folder.encode(message.folders[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); @@ -3367,6 +4708,9 @@ case 5: message.parentDisplayName = reader.string(); break; + case 6: + message.type = reader.string(); + break; case 7: if (!(message.folders && message.folders.length)) message.folders = []; @@ -3422,6 +4766,9 @@ if (message.parentDisplayName != null && message.hasOwnProperty("parentDisplayName")) if (!$util.isString(message.parentDisplayName)) return "parentDisplayName: string expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; if (message.folders != null && message.hasOwnProperty("folders")) { if (!Array.isArray(message.folders)) return "folders: array expected"; @@ -3456,6 +4803,8 @@ message.parent = String(object.parent); if (object.parentDisplayName != null) message.parentDisplayName = String(object.parentDisplayName); + if (object.type != null) + message.type = String(object.type); if (object.folders) { if (!Array.isArray(object.folders)) throw TypeError(".google.cloud.securitycenter.v1.Resource.folders: array expected"); @@ -3490,6 +4839,7 @@ object.projectDisplayName = ""; object.parent = ""; object.parentDisplayName = ""; + object.type = ""; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -3501,6 +4851,8 @@ object.parent = message.parent; if (message.parentDisplayName != null && message.hasOwnProperty("parentDisplayName")) object.parentDisplayName = message.parentDisplayName; + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; if (message.folders && message.folders.length) { object.folders = []; for (var j = 0; j < message.folders.length; ++j) diff --git a/packages/google-cloud-securitycenter/protos/protos.json b/packages/google-cloud-securitycenter/protos/protos.json index 46bc36055bd..dd8803b9b8b 100644 --- a/packages/google-cloud-securitycenter/protos/protos.json +++ b/packages/google-cloud-securitycenter/protos/protos.json @@ -210,6 +210,10 @@ "indicator": { "type": "Indicator", "id": 18 + }, + "vulnerability": { + "type": "Vulnerability", + "id": 20 } }, "nested": { @@ -254,6 +258,131 @@ } } }, + "Vulnerability": { + "fields": { + "cve": { + "type": "Cve", + "id": 1 + } + } + }, + "Cve": { + "fields": { + "id": { + "type": "string", + "id": 1 + }, + "references": { + "rule": "repeated", + "type": "Reference", + "id": 2 + }, + "cvssv3": { + "type": "Cvssv3", + "id": 3 + } + } + }, + "Reference": { + "fields": { + "source": { + "type": "string", + "id": 1 + }, + "uri": { + "type": "string", + "id": 2 + } + } + }, + "Cvssv3": { + "fields": { + "baseScore": { + "type": "double", + "id": 1 + }, + "attackVector": { + "type": "AttackVector", + "id": 5 + }, + "attackComplexity": { + "type": "AttackComplexity", + "id": 6 + }, + "privilegesRequired": { + "type": "PrivilegesRequired", + "id": 7 + }, + "userInteraction": { + "type": "UserInteraction", + "id": 8 + }, + "scope": { + "type": "Scope", + "id": 9 + }, + "confidentialityImpact": { + "type": "Impact", + "id": 10 + }, + "integrityImpact": { + "type": "Impact", + "id": 11 + }, + "availabilityImpact": { + "type": "Impact", + "id": 12 + } + }, + "nested": { + "AttackVector": { + "values": { + "ATTACK_VECTOR_UNSPECIFIED": 0, + "ATTACK_VECTOR_NETWORK": 1, + "ATTACK_VECTOR_ADJACENT": 2, + "ATTACK_VECTOR_LOCAL": 3, + "ATTACK_VECTOR_PHYSICAL": 4 + } + }, + "AttackComplexity": { + "values": { + "ATTACK_COMPLEXITY_UNSPECIFIED": 0, + "ATTACK_COMPLEXITY_LOW": 1, + "ATTACK_COMPLEXITY_HIGH": 2 + } + }, + "PrivilegesRequired": { + "values": { + "PRIVILEGES_REQUIRED_UNSPECIFIED": 0, + "PRIVILEGES_REQUIRED_NONE": 1, + "PRIVILEGES_REQUIRED_LOW": 2, + "PRIVILEGES_REQUIRED_HIGH": 3 + } + }, + "UserInteraction": { + "values": { + "USER_INTERACTION_UNSPECIFIED": 0, + "USER_INTERACTION_NONE": 1, + "USER_INTERACTION_REQUIRED": 2 + } + }, + "Scope": { + "values": { + "SCOPE_UNSPECIFIED": 0, + "SCOPE_UNCHANGED": 1, + "SCOPE_CHANGED": 2 + } + }, + "Impact": { + "values": { + "IMPACT_UNSPECIFIED": 0, + "IMPACT_HIGH": 1, + "IMPACT_LOW": 2, + "IMPACT_NONE": 3 + } + } + } + }, "NotificationConfig": { "options": { "(google.api.resource).type": "securitycenter.googleapis.com/NotificationConfig", @@ -350,6 +479,10 @@ "type": "string", "id": 5 }, + "type": { + "type": "string", + "id": 6 + }, "folders": { "rule": "repeated", "type": "Folder", diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.create_finding.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.create_finding.js new file mode 100644 index 00000000000..14fef7d24c3 --- /dev/null +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.create_finding.js @@ -0,0 +1,66 @@ +// 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'; + +function main(parent, findingId, finding) { + // [START securitycenter_v1_generated_SecurityCenter_CreateFinding_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Resource name of the new finding's parent. Its format should be + * "organizations/[organization_id]/sources/[source_id]". + */ + // const parent = 'abc123' + /** + * Required. Unique identifier provided by the client within the parent scope. + * It must be alphanumeric and less than or equal to 32 characters and + * greater than 0 characters in length. + */ + // const findingId = 'abc123' + /** + * Required. The Finding being created. The name and security_marks will be ignored as + * they are both output only fields on this resource. + */ + // const finding = '' + + // Imports the Securitycenter library + const {SecurityCenterClient} = require('@google-cloud/security-center').v1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function createFinding() { + // Construct request + const request = { + parent, + findingId, + finding, + }; + + // Run request + const response = await securitycenterClient.createFinding(request); + console.log(response); + } + + createFinding(); + // [END securitycenter_v1_generated_SecurityCenter_CreateFinding_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.create_notification_config.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.create_notification_config.js new file mode 100644 index 00000000000..12414cea813 --- /dev/null +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.create_notification_config.js @@ -0,0 +1,69 @@ +// 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'; + +function main(parent, configId, notificationConfig) { + // [START securitycenter_v1_generated_SecurityCenter_CreateNotificationConfig_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Resource name of the new notification config's parent. Its format is + * "organizations/[organization_id]". + */ + // const parent = 'abc123' + /** + * Required. + * Unique identifier provided by the client within the parent scope. + * It must be between 1 and 128 characters, and contains alphanumeric + * characters, underscores or hyphens only. + */ + // const configId = 'abc123' + /** + * Required. The notification config being created. The name and the service account + * will be ignored as they are both output only fields on this resource. + */ + // const notificationConfig = '' + + // Imports the Securitycenter library + const {SecurityCenterClient} = require('@google-cloud/security-center').v1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function createNotificationConfig() { + // Construct request + const request = { + parent, + configId, + notificationConfig, + }; + + // Run request + const response = await securitycenterClient.createNotificationConfig( + request + ); + console.log(response); + } + + createNotificationConfig(); + // [END securitycenter_v1_generated_SecurityCenter_CreateNotificationConfig_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.create_source.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.create_source.js new file mode 100644 index 00000000000..5cb669a5755 --- /dev/null +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.create_source.js @@ -0,0 +1,59 @@ +// 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'; + +function main(parent, source) { + // [START securitycenter_v1_generated_SecurityCenter_CreateSource_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Resource name of the new source's parent. Its format should be + * "organizations/[organization_id]". + */ + // const parent = 'abc123' + /** + * Required. The Source being created, only the display_name and description will be + * used. All other fields will be ignored. + */ + // const source = '' + + // Imports the Securitycenter library + const {SecurityCenterClient} = require('@google-cloud/security-center').v1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function createSource() { + // Construct request + const request = { + parent, + source, + }; + + // Run request + const response = await securitycenterClient.createSource(request); + console.log(response); + } + + createSource(); + // [END securitycenter_v1_generated_SecurityCenter_CreateSource_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.delete_notification_config.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.delete_notification_config.js new file mode 100644 index 00000000000..9169320b951 --- /dev/null +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.delete_notification_config.js @@ -0,0 +1,55 @@ +// 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'; + +function main(name) { + // [START securitycenter_v1_generated_SecurityCenter_DeleteNotificationConfig_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of the notification config to delete. Its format is + * "organizations/[organization_id]/notificationConfigs/[config_id]". + */ + // const name = 'abc123' + + // Imports the Securitycenter library + const {SecurityCenterClient} = require('@google-cloud/security-center').v1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function deleteNotificationConfig() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await securitycenterClient.deleteNotificationConfig( + request + ); + console.log(response); + } + + deleteNotificationConfig(); + // [END securitycenter_v1_generated_SecurityCenter_DeleteNotificationConfig_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_iam_policy.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_iam_policy.js new file mode 100644 index 00000000000..d48f7eca2e2 --- /dev/null +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_iam_policy.js @@ -0,0 +1,58 @@ +// 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'; + +function main(resource) { + // [START securitycenter_v1_generated_SecurityCenter_GetIamPolicy_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * REQUIRED: The resource for which the policy is being requested. + * See the operation documentation for the appropriate value for this field. + */ + // const resource = 'abc123' + /** + * OPTIONAL: A `GetPolicyOptions` object for specifying options to + * `GetIamPolicy`. This field is only used by Cloud IAM. + */ + // const options = '' + + // Imports the Securitycenter library + const {SecurityCenterClient} = require('@google-cloud/security-center').v1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function getIamPolicy() { + // Construct request + const request = { + resource, + }; + + // Run request + const response = await securitycenterClient.getIamPolicy(request); + console.log(response); + } + + getIamPolicy(); + // [END securitycenter_v1_generated_SecurityCenter_GetIamPolicy_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_notification_config.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_notification_config.js new file mode 100644 index 00000000000..2e8ba3d3361 --- /dev/null +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_notification_config.js @@ -0,0 +1,53 @@ +// 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'; + +function main(name) { + // [START securitycenter_v1_generated_SecurityCenter_GetNotificationConfig_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of the notification config to get. Its format is + * "organizations/[organization_id]/notificationConfigs/[config_id]". + */ + // const name = 'abc123' + + // Imports the Securitycenter library + const {SecurityCenterClient} = require('@google-cloud/security-center').v1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function getNotificationConfig() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await securitycenterClient.getNotificationConfig(request); + console.log(response); + } + + getNotificationConfig(); + // [END securitycenter_v1_generated_SecurityCenter_GetNotificationConfig_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_organization_settings.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_organization_settings.js new file mode 100644 index 00000000000..828a0bc05e7 --- /dev/null +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_organization_settings.js @@ -0,0 +1,55 @@ +// 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'; + +function main(name) { + // [START securitycenter_v1_generated_SecurityCenter_GetOrganizationSettings_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of the organization to get organization settings for. Its format is + * "organizations/[organization_id]/organizationSettings". + */ + // const name = 'abc123' + + // Imports the Securitycenter library + const {SecurityCenterClient} = require('@google-cloud/security-center').v1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function getOrganizationSettings() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await securitycenterClient.getOrganizationSettings( + request + ); + console.log(response); + } + + getOrganizationSettings(); + // [END securitycenter_v1_generated_SecurityCenter_GetOrganizationSettings_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_source.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_source.js new file mode 100644 index 00000000000..43cab34da0a --- /dev/null +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_source.js @@ -0,0 +1,53 @@ +// 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'; + +function main(name) { + // [START securitycenter_v1_generated_SecurityCenter_GetSource_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Relative resource name of the source. Its format is + * "organizations/[organization_id]/source/[source_id]". + */ + // const name = 'abc123' + + // Imports the Securitycenter library + const {SecurityCenterClient} = require('@google-cloud/security-center').v1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function getSource() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await securitycenterClient.getSource(request); + console.log(response); + } + + getSource(); + // [END securitycenter_v1_generated_SecurityCenter_GetSource_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.group_assets.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.group_assets.js new file mode 100644 index 00000000000..fd5b35aaabe --- /dev/null +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.group_assets.js @@ -0,0 +1,167 @@ +// 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'; + +function main(parent, groupBy) { + // [START securitycenter_v1_generated_SecurityCenter_GroupAssets_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of the organization to groupBy. Its format is + * "organizations/[organization_id], folders/[folder_id], or + * projects/[project_id]". + */ + // const parent = 'abc123' + /** + * Expression that defines the filter to apply across assets. + * The expression is a list of zero or more restrictions combined via logical + * operators `AND` and `OR`. + * Parentheses are supported, and `OR` has higher precedence than `AND`. + * Restrictions have the form ` ` and may have a `-` + * character in front of them to indicate negation. The fields map to those + * defined in the Asset resource. Examples include: + * * name + * * security_center_properties.resource_name + * * resource_properties.a_property + * * security_marks.marks.marka + * The supported operators are: + * * `=` for all value types. + * * `>`, `<`, `>=`, `<=` for integer values. + * * `:`, meaning substring matching, for strings. + * The supported value types are: + * * string literals in quotes. + * * integer literals without quotes. + * * boolean literals `true` and `false` without quotes. + * The following field and operator combinations are supported: + * * name: `=` + * * update_time: `=`, `>`, `<`, `>=`, `<=` + * Usage: This should be milliseconds since epoch or an RFC3339 string. + * Examples: + * `update_time = "2019-06-10T16:07:18-07:00"` + * `update_time = 1560208038000` + * * create_time: `=`, `>`, `<`, `>=`, `<=` + * Usage: This should be milliseconds since epoch or an RFC3339 string. + * Examples: + * `create_time = "2019-06-10T16:07:18-07:00"` + * `create_time = 1560208038000` + * * iam_policy.policy_blob: `=`, `:` + * * resource_properties: `=`, `:`, `>`, `<`, `>=`, `<=` + * * security_marks.marks: `=`, `:` + * * security_center_properties.resource_name: `=`, `:` + * * security_center_properties.resource_display_name: `=`, `:` + * * security_center_properties.resource_type: `=`, `:` + * * security_center_properties.resource_parent: `=`, `:` + * * security_center_properties.resource_parent_display_name: `=`, `:` + * * security_center_properties.resource_project: `=`, `:` + * * security_center_properties.resource_project_display_name: `=`, `:` + * * security_center_properties.resource_owners: `=`, `:` + * For example, `resource_properties.size = 100` is a valid filter string. + * Use a partial match on the empty string to filter based on a property + * existing: `resource_properties.my_property : ""` + * Use a negated partial match on the empty string to filter based on a + * property not existing: `-resource_properties.my_property : ""` + */ + // const filter = 'abc123' + /** + * Required. Expression that defines what assets fields to use for grouping. The string + * value should follow SQL syntax: comma separated list of fields. For + * example: + * "security_center_properties.resource_project,security_center_properties.project". + * The following fields are supported when compare_duration is not set: + * * security_center_properties.resource_project + * * security_center_properties.resource_project_display_name + * * security_center_properties.resource_type + * * security_center_properties.resource_parent + * * security_center_properties.resource_parent_display_name + * The following fields are supported when compare_duration is set: + * * security_center_properties.resource_type + * * security_center_properties.resource_project_display_name + * * security_center_properties.resource_parent_display_name + */ + // const groupBy = 'abc123' + /** + * When compare_duration is set, the GroupResult's "state_change" property is + * updated to indicate whether the asset was added, removed, or remained + * present during the compare_duration period of time that precedes the + * read_time. This is the time between (read_time - compare_duration) and + * read_time. + * The state change value is derived based on the presence of the asset at the + * two points in time. Intermediate state changes between the two times don't + * affect the result. For example, the results aren't affected if the asset is + * removed and re-created again. + * Possible "state_change" values when compare_duration is specified: + * * "ADDED": indicates that the asset was not present at the start of + * compare_duration, but present at reference_time. + * * "REMOVED": indicates that the asset was present at the start of + * compare_duration, but not present at reference_time. + * * "ACTIVE": indicates that the asset was present at both the + * start and the end of the time period defined by + * compare_duration and reference_time. + * If compare_duration is not specified, then the only possible state_change + * is "UNUSED", which will be the state_change set for all assets present at + * read_time. + * If this field is set then `state_change` must be a specified field in + * `group_by`. + */ + // const compareDuration = '' + /** + * Time used as a reference point when filtering assets. The filter is limited + * to assets existing at the supplied time and their values are those at that + * specific time. Absence of this field will default to the API's version of + * NOW. + */ + // const readTime = '' + /** + * The value returned by the last `GroupAssetsResponse`; indicates + * that this is a continuation of a prior `GroupAssets` call, and that the + * system should return the next page of data. + */ + // const pageToken = 'abc123' + /** + * The maximum number of results to return in a single response. Default is + * 10, minimum is 1, maximum is 1000. + */ + // const pageSize = 1234 + + // Imports the Securitycenter library + const {SecurityCenterClient} = require('@google-cloud/security-center').v1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function groupAssets() { + // Construct request + const request = { + parent, + groupBy, + }; + + // Run request + const iterable = await securitycenterClient.groupAssetsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + groupAssets(); + // [END securitycenter_v1_generated_SecurityCenter_GroupAssets_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.group_findings.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.group_findings.js new file mode 100644 index 00000000000..8375e49e741 --- /dev/null +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.group_findings.js @@ -0,0 +1,171 @@ +// 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'; + +function main(parent, groupBy) { + // [START securitycenter_v1_generated_SecurityCenter_GroupFindings_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of the source to groupBy. Its format is + * "organizations/[organization_id]/sources/[source_id]", + * folders/[folder_id]/sources/[source_id], or + * projects/[project_id]/sources/[source_id]. To groupBy across all sources + * provide a source_id of `-`. For example: + * organizations/{organization_id}/sources/-, folders/{folder_id}/sources/-, + * or projects/{project_id}/sources/- + */ + // const parent = 'abc123' + /** + * Expression that defines the filter to apply across findings. + * The expression is a list of one or more restrictions combined via logical + * operators `AND` and `OR`. + * Parentheses are supported, and `OR` has higher precedence than `AND`. + * Restrictions have the form ` ` and may have a `-` + * character in front of them to indicate negation. Examples include: + * * name + * * source_properties.a_property + * * security_marks.marks.marka + * The supported operators are: + * * `=` for all value types. + * * `>`, `<`, `>=`, `<=` for integer values. + * * `:`, meaning substring matching, for strings. + * The supported value types are: + * * string literals in quotes. + * * integer literals without quotes. + * * boolean literals `true` and `false` without quotes. + * The following field and operator combinations are supported: + * * name: `=` + * * parent: `=`, `:` + * * resource_name: `=`, `:` + * * state: `=`, `:` + * * category: `=`, `:` + * * external_uri: `=`, `:` + * * event_time: `=`, `>`, `<`, `>=`, `<=` + * Usage: This should be milliseconds since epoch or an RFC3339 string. + * Examples: + * `event_time = "2019-06-10T16:07:18-07:00"` + * `event_time = 1560208038000` + * * severity: `=`, `:` + * * workflow_state: `=`, `:` + * * security_marks.marks: `=`, `:` + * * source_properties: `=`, `:`, `>`, `<`, `>=`, `<=` + * For example, `source_properties.size = 100` is a valid filter string. + * Use a partial match on the empty string to filter based on a property + * existing: `source_properties.my_property : ""` + * Use a negated partial match on the empty string to filter based on a + * property not existing: `-source_properties.my_property : ""` + * * resource: + * * resource.name: `=`, `:` + * * resource.parent_name: `=`, `:` + * * resource.parent_display_name: `=`, `:` + * * resource.project_name: `=`, `:` + * * resource.project_display_name: `=`, `:` + * * resource.type: `=`, `:` + */ + // const filter = 'abc123' + /** + * Required. Expression that defines what assets fields to use for grouping (including + * `state_change`). The string value should follow SQL syntax: comma separated + * list of fields. For example: "parent,resource_name". + * The following fields are supported: + * * resource_name + * * category + * * state + * * parent + * * severity + * The following fields are supported when compare_duration is set: + * * state_change + */ + // const groupBy = 'abc123' + /** + * Time used as a reference point when filtering findings. The filter is + * limited to findings existing at the supplied time and their values are + * those at that specific time. Absence of this field will default to the + * API's version of NOW. + */ + // const readTime = '' + /** + * When compare_duration is set, the GroupResult's "state_change" attribute is + * updated to indicate whether the finding had its state changed, the + * finding's state remained unchanged, or if the finding was added during the + * compare_duration period of time that precedes the read_time. This is the + * time between (read_time - compare_duration) and read_time. + * The state_change value is derived based on the presence and state of the + * finding at the two points in time. Intermediate state changes between the + * two times don't affect the result. For example, the results aren't affected + * if the finding is made inactive and then active again. + * Possible "state_change" values when compare_duration is specified: + * * "CHANGED": indicates that the finding was present and matched the given + * filter at the start of compare_duration, but changed its + * state at read_time. + * * "UNCHANGED": indicates that the finding was present and matched the given + * filter at the start of compare_duration and did not change + * state at read_time. + * * "ADDED": indicates that the finding did not match the given filter or + * was not present at the start of compare_duration, but was + * present at read_time. + * * "REMOVED": indicates that the finding was present and matched the + * filter at the start of compare_duration, but did not match + * the filter at read_time. + * If compare_duration is not specified, then the only possible state_change + * is "UNUSED", which will be the state_change set for all findings present + * at read_time. + * If this field is set then `state_change` must be a specified field in + * `group_by`. + */ + // const compareDuration = '' + /** + * The value returned by the last `GroupFindingsResponse`; indicates + * that this is a continuation of a prior `GroupFindings` call, and + * that the system should return the next page of data. + */ + // const pageToken = 'abc123' + /** + * The maximum number of results to return in a single response. Default is + * 10, minimum is 1, maximum is 1000. + */ + // const pageSize = 1234 + + // Imports the Securitycenter library + const {SecurityCenterClient} = require('@google-cloud/security-center').v1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function groupFindings() { + // Construct request + const request = { + parent, + groupBy, + }; + + // Run request + const iterable = await securitycenterClient.groupFindingsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + groupFindings(); + // [END securitycenter_v1_generated_SecurityCenter_GroupFindings_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_assets.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_assets.js new file mode 100644 index 00000000000..d5187d0ed5b --- /dev/null +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_assets.js @@ -0,0 +1,176 @@ +// 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'; + +function main(parent) { + // [START securitycenter_v1_generated_SecurityCenter_ListAssets_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of the organization assets should belong to. Its format is + * "organizations/[organization_id], folders/[folder_id], or + * projects/[project_id]". + */ + // const parent = 'abc123' + /** + * Expression that defines the filter to apply across assets. + * The expression is a list of zero or more restrictions combined via logical + * operators `AND` and `OR`. + * Parentheses are supported, and `OR` has higher precedence than `AND`. + * Restrictions have the form ` ` and may have a `-` + * character in front of them to indicate negation. The fields map to those + * defined in the Asset resource. Examples include: + * * name + * * security_center_properties.resource_name + * * resource_properties.a_property + * * security_marks.marks.marka + * The supported operators are: + * * `=` for all value types. + * * `>`, `<`, `>=`, `<=` for integer values. + * * `:`, meaning substring matching, for strings. + * The supported value types are: + * * string literals in quotes. + * * integer literals without quotes. + * * boolean literals `true` and `false` without quotes. + * The following are the allowed field and operator combinations: + * * name: `=` + * * update_time: `=`, `>`, `<`, `>=`, `<=` + * Usage: This should be milliseconds since epoch or an RFC3339 string. + * Examples: + * `update_time = "2019-06-10T16:07:18-07:00"` + * `update_time = 1560208038000` + * * create_time: `=`, `>`, `<`, `>=`, `<=` + * Usage: This should be milliseconds since epoch or an RFC3339 string. + * Examples: + * `create_time = "2019-06-10T16:07:18-07:00"` + * `create_time = 1560208038000` + * * iam_policy.policy_blob: `=`, `:` + * * resource_properties: `=`, `:`, `>`, `<`, `>=`, `<=` + * * security_marks.marks: `=`, `:` + * * security_center_properties.resource_name: `=`, `:` + * * security_center_properties.resource_display_name: `=`, `:` + * * security_center_properties.resource_type: `=`, `:` + * * security_center_properties.resource_parent: `=`, `:` + * * security_center_properties.resource_parent_display_name: `=`, `:` + * * security_center_properties.resource_project: `=`, `:` + * * security_center_properties.resource_project_display_name: `=`, `:` + * * security_center_properties.resource_owners: `=`, `:` + * For example, `resource_properties.size = 100` is a valid filter string. + * Use a partial match on the empty string to filter based on a property + * existing: `resource_properties.my_property : ""` + * Use a negated partial match on the empty string to filter based on a + * property not existing: `-resource_properties.my_property : ""` + */ + // const filter = 'abc123' + /** + * Expression that defines what fields and order to use for sorting. The + * string value should follow SQL syntax: comma separated list of fields. For + * example: "name,resource_properties.a_property". The default sorting order + * is ascending. To specify descending order for a field, a suffix " desc" + * should be appended to the field name. For example: "name + * desc,resource_properties.a_property". Redundant space characters in the + * syntax are insignificant. "name desc,resource_properties.a_property" and " + * name desc , resource_properties.a_property " are equivalent. + * The following fields are supported: + * name + * update_time + * resource_properties + * security_marks.marks + * security_center_properties.resource_name + * security_center_properties.resource_display_name + * security_center_properties.resource_parent + * security_center_properties.resource_parent_display_name + * security_center_properties.resource_project + * security_center_properties.resource_project_display_name + * security_center_properties.resource_type + */ + // const orderBy = 'abc123' + /** + * Time used as a reference point when filtering assets. The filter is limited + * to assets existing at the supplied time and their values are those at that + * specific time. Absence of this field will default to the API's version of + * NOW. + */ + // const readTime = '' + /** + * When compare_duration is set, the ListAssetsResult's "state_change" + * attribute is updated to indicate whether the asset was added, removed, or + * remained present during the compare_duration period of time that precedes + * the read_time. This is the time between (read_time - compare_duration) and + * read_time. + * The state_change value is derived based on the presence of the asset at the + * two points in time. Intermediate state changes between the two times don't + * affect the result. For example, the results aren't affected if the asset is + * removed and re-created again. + * Possible "state_change" values when compare_duration is specified: + * * "ADDED": indicates that the asset was not present at the start of + * compare_duration, but present at read_time. + * * "REMOVED": indicates that the asset was present at the start of + * compare_duration, but not present at read_time. + * * "ACTIVE": indicates that the asset was present at both the + * start and the end of the time period defined by + * compare_duration and read_time. + * If compare_duration is not specified, then the only possible state_change + * is "UNUSED", which will be the state_change set for all assets present at + * read_time. + */ + // const compareDuration = '' + /** + * A field mask to specify the ListAssetsResult fields to be listed in the + * response. + * An empty field mask will list all fields. + */ + // const fieldMask = '' + /** + * The value returned by the last `ListAssetsResponse`; indicates + * that this is a continuation of a prior `ListAssets` call, and + * that the system should return the next page of data. + */ + // const pageToken = 'abc123' + /** + * The maximum number of results to return in a single response. Default is + * 10, minimum is 1, maximum is 1000. + */ + // const pageSize = 1234 + + // Imports the Securitycenter library + const {SecurityCenterClient} = require('@google-cloud/security-center').v1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function listAssets() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await securitycenterClient.listAssetsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + listAssets(); + // [END securitycenter_v1_generated_SecurityCenter_ListAssets_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_findings.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_findings.js new file mode 100644 index 00000000000..c1ac12408d9 --- /dev/null +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_findings.js @@ -0,0 +1,181 @@ +// 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'; + +function main(parent) { + // [START securitycenter_v1_generated_SecurityCenter_ListFindings_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of the source the findings belong to. Its format is + * "organizations/[organization_id]/sources/[source_id], + * folders/[folder_id]/sources/[source_id], or + * projects/[project_id]/sources/[source_id]". To list across all sources + * provide a source_id of `-`. For example: + * organizations/{organization_id}/sources/-, folders/{folder_id}/sources/- or + * projects/{projects_id}/sources/- + */ + // const parent = 'abc123' + /** + * Expression that defines the filter to apply across findings. + * The expression is a list of one or more restrictions combined via logical + * operators `AND` and `OR`. + * Parentheses are supported, and `OR` has higher precedence than `AND`. + * Restrictions have the form ` ` and may have a `-` + * character in front of them to indicate negation. Examples include: + * * name + * * source_properties.a_property + * * security_marks.marks.marka + * The supported operators are: + * * `=` for all value types. + * * `>`, `<`, `>=`, `<=` for integer values. + * * `:`, meaning substring matching, for strings. + * The supported value types are: + * * string literals in quotes. + * * integer literals without quotes. + * * boolean literals `true` and `false` without quotes. + * The following field and operator combinations are supported: + * * name: `=` + * * parent: `=`, `:` + * * resource_name: `=`, `:` + * * state: `=`, `:` + * * category: `=`, `:` + * * external_uri: `=`, `:` + * * event_time: `=`, `>`, `<`, `>=`, `<=` + * Usage: This should be milliseconds since epoch or an RFC3339 string. + * Examples: + * `event_time = "2019-06-10T16:07:18-07:00"` + * `event_time = 1560208038000` + * * severity: `=`, `:` + * * workflow_state: `=`, `:` + * * security_marks.marks: `=`, `:` + * * source_properties: `=`, `:`, `>`, `<`, `>=`, `<=` + * For example, `source_properties.size = 100` is a valid filter string. + * Use a partial match on the empty string to filter based on a property + * existing: `source_properties.my_property : ""` + * Use a negated partial match on the empty string to filter based on a + * property not existing: `-source_properties.my_property : ""` + * * resource: + * * resource.name: `=`, `:` + * * resource.parent_name: `=`, `:` + * * resource.parent_display_name: `=`, `:` + * * resource.project_name: `=`, `:` + * * resource.project_display_name: `=`, `:` + * * resource.type: `=`, `:` + * * resource.folders.resource_folder: `=`, `:` + */ + // const filter = 'abc123' + /** + * Expression that defines what fields and order to use for sorting. The + * string value should follow SQL syntax: comma separated list of fields. For + * example: "name,resource_properties.a_property". The default sorting order + * is ascending. To specify descending order for a field, a suffix " desc" + * should be appended to the field name. For example: "name + * desc,source_properties.a_property". Redundant space characters in the + * syntax are insignificant. "name desc,source_properties.a_property" and " + * name desc , source_properties.a_property " are equivalent. + * The following fields are supported: + * name + * parent + * state + * category + * resource_name + * event_time + * source_properties + * security_marks.marks + */ + // const orderBy = 'abc123' + /** + * Time used as a reference point when filtering findings. The filter is + * limited to findings existing at the supplied time and their values are + * those at that specific time. Absence of this field will default to the + * API's version of NOW. + */ + // const readTime = '' + /** + * When compare_duration is set, the ListFindingsResult's "state_change" + * attribute is updated to indicate whether the finding had its state changed, + * the finding's state remained unchanged, or if the finding was added in any + * state during the compare_duration period of time that precedes the + * read_time. This is the time between (read_time - compare_duration) and + * read_time. + * The state_change value is derived based on the presence and state of the + * finding at the two points in time. Intermediate state changes between the + * two times don't affect the result. For example, the results aren't affected + * if the finding is made inactive and then active again. + * Possible "state_change" values when compare_duration is specified: + * * "CHANGED": indicates that the finding was present and matched the given + * filter at the start of compare_duration, but changed its + * state at read_time. + * * "UNCHANGED": indicates that the finding was present and matched the given + * filter at the start of compare_duration and did not change + * state at read_time. + * * "ADDED": indicates that the finding did not match the given filter or + * was not present at the start of compare_duration, but was + * present at read_time. + * * "REMOVED": indicates that the finding was present and matched the + * filter at the start of compare_duration, but did not match + * the filter at read_time. + * If compare_duration is not specified, then the only possible state_change + * is "UNUSED", which will be the state_change set for all findings present at + * read_time. + */ + // const compareDuration = '' + /** + * A field mask to specify the Finding fields to be listed in the response. + * An empty field mask will list all fields. + */ + // const fieldMask = '' + /** + * The value returned by the last `ListFindingsResponse`; indicates + * that this is a continuation of a prior `ListFindings` call, and + * that the system should return the next page of data. + */ + // const pageToken = 'abc123' + /** + * The maximum number of results to return in a single response. Default is + * 10, minimum is 1, maximum is 1000. + */ + // const pageSize = 1234 + + // Imports the Securitycenter library + const {SecurityCenterClient} = require('@google-cloud/security-center').v1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function listFindings() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await securitycenterClient.listFindingsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + listFindings(); + // [END securitycenter_v1_generated_SecurityCenter_ListFindings_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_notification_configs.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_notification_configs.js new file mode 100644 index 00000000000..699911be578 --- /dev/null +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_notification_configs.js @@ -0,0 +1,68 @@ +// 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'; + +function main(parent) { + // [START securitycenter_v1_generated_SecurityCenter_ListNotificationConfigs_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of the organization to list notification configs. + * Its format is "organizations/[organization_id]". + */ + // const parent = 'abc123' + /** + * The value returned by the last `ListNotificationConfigsResponse`; indicates + * that this is a continuation of a prior `ListNotificationConfigs` call, and + * that the system should return the next page of data. + */ + // const pageToken = 'abc123' + /** + * The maximum number of results to return in a single response. Default is + * 10, minimum is 1, maximum is 1000. + */ + // const pageSize = 1234 + + // Imports the Securitycenter library + const {SecurityCenterClient} = require('@google-cloud/security-center').v1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function listNotificationConfigs() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await securitycenterClient.listNotificationConfigsAsync( + request + ); + for await (const response of iterable) { + console.log(response); + } + } + + listNotificationConfigs(); + // [END securitycenter_v1_generated_SecurityCenter_ListNotificationConfigs_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_sources.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_sources.js new file mode 100644 index 00000000000..e4102af68ff --- /dev/null +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_sources.js @@ -0,0 +1,67 @@ +// 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'; + +function main(parent) { + // [START securitycenter_v1_generated_SecurityCenter_ListSources_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Resource name of the parent of sources to list. Its format should be + * "organizations/[organization_id], folders/[folder_id], or + * projects/[project_id]". + */ + // const parent = 'abc123' + /** + * The value returned by the last `ListSourcesResponse`; indicates + * that this is a continuation of a prior `ListSources` call, and + * that the system should return the next page of data. + */ + // const pageToken = 'abc123' + /** + * The maximum number of results to return in a single response. Default is + * 10, minimum is 1, maximum is 1000. + */ + // const pageSize = 1234 + + // Imports the Securitycenter library + const {SecurityCenterClient} = require('@google-cloud/security-center').v1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function listSources() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await securitycenterClient.listSourcesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + listSources(); + // [END securitycenter_v1_generated_SecurityCenter_ListSources_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.run_asset_discovery.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.run_asset_discovery.js new file mode 100644 index 00000000000..9a1f01c220c --- /dev/null +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.run_asset_discovery.js @@ -0,0 +1,54 @@ +// 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'; + +function main(parent) { + // [START securitycenter_v1_generated_SecurityCenter_RunAssetDiscovery_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of the organization to run asset discovery for. Its format is + * "organizations/[organization_id]". + */ + // const parent = 'abc123' + + // Imports the Securitycenter library + const {SecurityCenterClient} = require('@google-cloud/security-center').v1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function runAssetDiscovery() { + // Construct request + const request = { + parent, + }; + + // Run request + const [operation] = await securitycenterClient.runAssetDiscovery(request); + const [response] = await operation.promise(); + console.log(response); + } + + runAssetDiscovery(); + // [END securitycenter_v1_generated_SecurityCenter_RunAssetDiscovery_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.set_finding_state.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.set_finding_state.js new file mode 100644 index 00000000000..980a508861d --- /dev/null +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.set_finding_state.js @@ -0,0 +1,65 @@ +// 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'; + +function main(name, state, startTime) { + // [START securitycenter_v1_generated_SecurityCenter_SetFindingState_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The relative resource name of the finding. See: + * https://cloud.google.com/apis/design/resource_names#relative_resource_name + * Example: + * "organizations/{organization_id}/sources/{source_id}/finding/{finding_id}". + */ + // const name = 'abc123' + /** + * Required. The desired State of the finding. + */ + // const state = '' + /** + * Required. The time at which the updated state takes effect. + */ + // const startTime = '' + + // Imports the Securitycenter library + const {SecurityCenterClient} = require('@google-cloud/security-center').v1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function setFindingState() { + // Construct request + const request = { + name, + state, + startTime, + }; + + // Run request + const response = await securitycenterClient.setFindingState(request); + console.log(response); + } + + setFindingState(); + // [END securitycenter_v1_generated_SecurityCenter_SetFindingState_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.set_iam_policy.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.set_iam_policy.js new file mode 100644 index 00000000000..dfd1ed9a70a --- /dev/null +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.set_iam_policy.js @@ -0,0 +1,61 @@ +// 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'; + +function main(resource, policy) { + // [START securitycenter_v1_generated_SecurityCenter_SetIamPolicy_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * REQUIRED: The resource for which the policy is being specified. + * See the operation documentation for the appropriate value for this field. + */ + // const resource = 'abc123' + /** + * REQUIRED: The complete policy to be applied to the `resource`. The size of + * the policy is limited to a few 10s of KB. An empty policy is a + * valid policy but certain Cloud Platform services (such as Projects) + * might reject them. + */ + // const policy = '' + + // Imports the Securitycenter library + const {SecurityCenterClient} = require('@google-cloud/security-center').v1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function setIamPolicy() { + // Construct request + const request = { + resource, + policy, + }; + + // Run request + const response = await securitycenterClient.setIamPolicy(request); + console.log(response); + } + + setIamPolicy(); + // [END securitycenter_v1_generated_SecurityCenter_SetIamPolicy_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.test_iam_permissions.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.test_iam_permissions.js new file mode 100644 index 00000000000..39b32d4c082 --- /dev/null +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.test_iam_permissions.js @@ -0,0 +1,61 @@ +// 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'; + +function main(resource, permissions) { + // [START securitycenter_v1_generated_SecurityCenter_TestIamPermissions_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + */ + // const resource = 'abc123' + /** + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see + * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + */ + // const permissions = 'abc123' + + // Imports the Securitycenter library + const {SecurityCenterClient} = require('@google-cloud/security-center').v1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function testIamPermissions() { + // Construct request + const request = { + resource, + permissions, + }; + + // Run request + const response = await securitycenterClient.testIamPermissions(request); + console.log(response); + } + + testIamPermissions(); + // [END securitycenter_v1_generated_SecurityCenter_TestIamPermissions_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_finding.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_finding.js new file mode 100644 index 00000000000..8cf92414a38 --- /dev/null +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_finding.js @@ -0,0 +1,65 @@ +// 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'; + +function main(finding) { + // [START securitycenter_v1_generated_SecurityCenter_UpdateFinding_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The finding resource to update or create if it does not already exist. + * parent, security_marks, and update_time will be ignored. + * In the case of creation, the finding id portion of the name must be + * alphanumeric and less than or equal to 32 characters and greater than 0 + * characters in length. + */ + // const finding = '' + /** + * The FieldMask to use when updating the finding resource. This field should + * not be specified when creating a finding. + * When updating a finding, an empty mask is treated as updating all mutable + * fields and replacing source_properties. Individual source_properties can + * be added/updated by using "source_properties." in the field + * mask. + */ + // const updateMask = '' + + // Imports the Securitycenter library + const {SecurityCenterClient} = require('@google-cloud/security-center').v1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function updateFinding() { + // Construct request + const request = { + finding, + }; + + // Run request + const response = await securitycenterClient.updateFinding(request); + console.log(response); + } + + updateFinding(); + // [END securitycenter_v1_generated_SecurityCenter_UpdateFinding_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_notification_config.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_notification_config.js new file mode 100644 index 00000000000..6a7d70d8023 --- /dev/null +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_notification_config.js @@ -0,0 +1,59 @@ +// 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'; + +function main(notificationConfig) { + // [START securitycenter_v1_generated_SecurityCenter_UpdateNotificationConfig_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The notification config to update. + */ + // const notificationConfig = '' + /** + * The FieldMask to use when updating the notification config. + * If empty all mutable fields will be updated. + */ + // const updateMask = '' + + // Imports the Securitycenter library + const {SecurityCenterClient} = require('@google-cloud/security-center').v1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function updateNotificationConfig() { + // Construct request + const request = { + notificationConfig, + }; + + // Run request + const response = await securitycenterClient.updateNotificationConfig( + request + ); + console.log(response); + } + + updateNotificationConfig(); + // [END securitycenter_v1_generated_SecurityCenter_UpdateNotificationConfig_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_organization_settings.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_organization_settings.js new file mode 100644 index 00000000000..a310b1238b4 --- /dev/null +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_organization_settings.js @@ -0,0 +1,59 @@ +// 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'; + +function main(organizationSettings) { + // [START securitycenter_v1_generated_SecurityCenter_UpdateOrganizationSettings_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The organization settings resource to update. + */ + // const organizationSettings = '' + /** + * The FieldMask to use when updating the settings resource. + * If empty all mutable fields will be updated. + */ + // const updateMask = '' + + // Imports the Securitycenter library + const {SecurityCenterClient} = require('@google-cloud/security-center').v1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function updateOrganizationSettings() { + // Construct request + const request = { + organizationSettings, + }; + + // Run request + const response = await securitycenterClient.updateOrganizationSettings( + request + ); + console.log(response); + } + + updateOrganizationSettings(); + // [END securitycenter_v1_generated_SecurityCenter_UpdateOrganizationSettings_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_security_marks.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_security_marks.js new file mode 100644 index 00000000000..fd42e11ba01 --- /dev/null +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_security_marks.js @@ -0,0 +1,65 @@ +// 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'; + +function main(securityMarks) { + // [START securitycenter_v1_generated_SecurityCenter_UpdateSecurityMarks_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The security marks resource to update. + */ + // const securityMarks = '' + /** + * The FieldMask to use when updating the security marks resource. + * The field mask must not contain duplicate fields. + * If empty or set to "marks", all marks will be replaced. Individual + * marks can be updated using "marks.". + */ + // const updateMask = '' + /** + * The time at which the updated SecurityMarks take effect. + * If not set uses current server time. Updates will be applied to the + * SecurityMarks that are active immediately preceding this time. + */ + // const startTime = '' + + // Imports the Securitycenter library + const {SecurityCenterClient} = require('@google-cloud/security-center').v1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function updateSecurityMarks() { + // Construct request + const request = { + securityMarks, + }; + + // Run request + const response = await securitycenterClient.updateSecurityMarks(request); + console.log(response); + } + + updateSecurityMarks(); + // [END securitycenter_v1_generated_SecurityCenter_UpdateSecurityMarks_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_source.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_source.js new file mode 100644 index 00000000000..3a7e3667dd0 --- /dev/null +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_source.js @@ -0,0 +1,57 @@ +// 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'; + +function main(source) { + // [START securitycenter_v1_generated_SecurityCenter_UpdateSource_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The source resource to update. + */ + // const source = '' + /** + * The FieldMask to use when updating the source resource. + * If empty all mutable fields will be updated. + */ + // const updateMask = '' + + // Imports the Securitycenter library + const {SecurityCenterClient} = require('@google-cloud/security-center').v1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function updateSource() { + // Construct request + const request = { + source, + }; + + // Run request + const response = await securitycenterClient.updateSource(request); + console.log(response); + } + + updateSource(); + // [END securitycenter_v1_generated_SecurityCenter_UpdateSource_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.create_finding.js b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.create_finding.js new file mode 100644 index 00000000000..094e34758f5 --- /dev/null +++ b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.create_finding.js @@ -0,0 +1,67 @@ +// 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'; + +function main(parent, findingId, finding) { + // [START securitycenter_v1beta1_generated_SecurityCenter_CreateFinding_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Resource name of the new finding's parent. Its format should be + * "organizations/[organization_id]/sources/[source_id]". + */ + // const parent = 'abc123' + /** + * Required. Unique identifier provided by the client within the parent scope. + * It must be alphanumeric and less than or equal to 32 characters and + * greater than 0 characters in length. + */ + // const findingId = 'abc123' + /** + * Required. The Finding being created. The name and security_marks will be ignored as + * they are both output only fields on this resource. + */ + // const finding = '' + + // Imports the Securitycenter library + const {SecurityCenterClient} = + require('@google-cloud/security-center').v1beta1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function createFinding() { + // Construct request + const request = { + parent, + findingId, + finding, + }; + + // Run request + const response = await securitycenterClient.createFinding(request); + console.log(response); + } + + createFinding(); + // [END securitycenter_v1beta1_generated_SecurityCenter_CreateFinding_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.create_source.js b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.create_source.js new file mode 100644 index 00000000000..442e4f7d29a --- /dev/null +++ b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.create_source.js @@ -0,0 +1,60 @@ +// 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'; + +function main(parent, source) { + // [START securitycenter_v1beta1_generated_SecurityCenter_CreateSource_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Resource name of the new source's parent. Its format should be + * "organizations/[organization_id]". + */ + // const parent = 'abc123' + /** + * Required. The Source being created, only the display_name and description will be + * used. All other fields will be ignored. + */ + // const source = '' + + // Imports the Securitycenter library + const {SecurityCenterClient} = + require('@google-cloud/security-center').v1beta1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function createSource() { + // Construct request + const request = { + parent, + source, + }; + + // Run request + const response = await securitycenterClient.createSource(request); + console.log(response); + } + + createSource(); + // [END securitycenter_v1beta1_generated_SecurityCenter_CreateSource_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.get_iam_policy.js b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.get_iam_policy.js new file mode 100644 index 00000000000..bb3667f651b --- /dev/null +++ b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.get_iam_policy.js @@ -0,0 +1,59 @@ +// 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'; + +function main(resource) { + // [START securitycenter_v1beta1_generated_SecurityCenter_GetIamPolicy_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * REQUIRED: The resource for which the policy is being requested. + * See the operation documentation for the appropriate value for this field. + */ + // const resource = 'abc123' + /** + * OPTIONAL: A `GetPolicyOptions` object for specifying options to + * `GetIamPolicy`. This field is only used by Cloud IAM. + */ + // const options = '' + + // Imports the Securitycenter library + const {SecurityCenterClient} = + require('@google-cloud/security-center').v1beta1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function getIamPolicy() { + // Construct request + const request = { + resource, + }; + + // Run request + const response = await securitycenterClient.getIamPolicy(request); + console.log(response); + } + + getIamPolicy(); + // [END securitycenter_v1beta1_generated_SecurityCenter_GetIamPolicy_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.get_organization_settings.js b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.get_organization_settings.js new file mode 100644 index 00000000000..e05e2fcf230 --- /dev/null +++ b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.get_organization_settings.js @@ -0,0 +1,56 @@ +// 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'; + +function main(name) { + // [START securitycenter_v1beta1_generated_SecurityCenter_GetOrganizationSettings_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of the organization to get organization settings for. Its format is + * "organizations/[organization_id]/organizationSettings". + */ + // const name = 'abc123' + + // Imports the Securitycenter library + const {SecurityCenterClient} = + require('@google-cloud/security-center').v1beta1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function getOrganizationSettings() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await securitycenterClient.getOrganizationSettings( + request + ); + console.log(response); + } + + getOrganizationSettings(); + // [END securitycenter_v1beta1_generated_SecurityCenter_GetOrganizationSettings_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.get_source.js b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.get_source.js new file mode 100644 index 00000000000..d02e5a8be4c --- /dev/null +++ b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.get_source.js @@ -0,0 +1,54 @@ +// 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'; + +function main(name) { + // [START securitycenter_v1beta1_generated_SecurityCenter_GetSource_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Relative resource name of the source. Its format is + * "organizations/[organization_id]/source/[source_id]". + */ + // const name = 'abc123' + + // Imports the Securitycenter library + const {SecurityCenterClient} = + require('@google-cloud/security-center').v1beta1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function getSource() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await securitycenterClient.getSource(request); + console.log(response); + } + + getSource(); + // [END securitycenter_v1beta1_generated_SecurityCenter_GetSource_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.group_assets.js b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.group_assets.js new file mode 100644 index 00000000000..ede3e9b5bb0 --- /dev/null +++ b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.group_assets.js @@ -0,0 +1,131 @@ +// 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'; + +function main(parent, groupBy) { + // [START securitycenter_v1beta1_generated_SecurityCenter_GroupAssets_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of the organization to groupBy. Its format is + * "organizations/[organization_id]". + */ + // const parent = 'abc123' + /** + * Expression that defines the filter to apply across assets. + * The expression is a list of zero or more restrictions combined via logical + * operators `AND` and `OR`. + * Parentheses are not supported, and `OR` has higher precedence than `AND`. + * Restrictions have the form ` ` and may have a `-` + * character in front of them to indicate negation. The fields map to those + * defined in the Asset resource. Examples include: + * * name + * * security_center_properties.resource_name + * * resource_properties.a_property + * * security_marks.marks.marka + * The supported operators are: + * * `=` for all value types. + * * `>`, `<`, `>=`, `<=` for integer values. + * * `:`, meaning substring matching, for strings. + * The supported value types are: + * * string literals in quotes. + * * integer literals without quotes. + * * boolean literals `true` and `false` without quotes. + * For example, `resource_properties.size = 100` is a valid filter string. + */ + // const filter = 'abc123' + /** + * Required. Expression that defines what assets fields to use for grouping. The string + * value should follow SQL syntax: comma separated list of fields. For + * example: + * "security_center_properties.resource_project,security_center_properties.project". + * The following fields are supported when compare_duration is not set: + * * security_center_properties.resource_project + * * security_center_properties.resource_type + * * security_center_properties.resource_parent + * The following fields are supported when compare_duration is set: + * * security_center_properties.resource_type + */ + // const groupBy = 'abc123' + /** + * When compare_duration is set, the Asset's "state" property is updated to + * indicate whether the asset was added, removed, or remained present during + * the compare_duration period of time that precedes the read_time. This is + * the time between (read_time - compare_duration) and read_time. + * The state value is derived based on the presence of the asset at the two + * points in time. Intermediate state changes between the two times don't + * affect the result. For example, the results aren't affected if the asset is + * removed and re-created again. + * Possible "state" values when compare_duration is specified: + * * "ADDED": indicates that the asset was not present before + * compare_duration, but present at reference_time. + * * "REMOVED": indicates that the asset was present at the start of + * compare_duration, but not present at reference_time. + * * "ACTIVE": indicates that the asset was present at both the + * start and the end of the time period defined by + * compare_duration and reference_time. + * This field is ignored if `state` is not a field in `group_by`. + */ + // const compareDuration = '' + /** + * Time used as a reference point when filtering assets. The filter is limited + * to assets existing at the supplied time and their values are those at that + * specific time. Absence of this field will default to the API's version of + * NOW. + */ + // const readTime = '' + /** + * The value returned by the last `GroupAssetsResponse`; indicates + * that this is a continuation of a prior `GroupAssets` call, and that the + * system should return the next page of data. + */ + // const pageToken = 'abc123' + /** + * The maximum number of results to return in a single response. Default is + * 10, minimum is 1, maximum is 1000. + */ + // const pageSize = 1234 + + // Imports the Securitycenter library + const {SecurityCenterClient} = + require('@google-cloud/security-center').v1beta1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function groupAssets() { + // Construct request + const request = { + parent, + groupBy, + }; + + // Run request + const iterable = await securitycenterClient.groupAssetsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + groupAssets(); + // [END securitycenter_v1beta1_generated_SecurityCenter_GroupAssets_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.group_findings.js b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.group_findings.js new file mode 100644 index 00000000000..51994c0bac7 --- /dev/null +++ b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.group_findings.js @@ -0,0 +1,110 @@ +// 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'; + +function main(parent, groupBy) { + // [START securitycenter_v1beta1_generated_SecurityCenter_GroupFindings_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of the source to groupBy. Its format is + * "organizations/[organization_id]/sources/[source_id]". To groupBy across + * all sources provide a source_id of `-`. For example: + * organizations/{organization_id}/sources/- + */ + // const parent = 'abc123' + /** + * Expression that defines the filter to apply across findings. + * The expression is a list of one or more restrictions combined via logical + * operators `AND` and `OR`. + * Parentheses are not supported, and `OR` has higher precedence than `AND`. + * Restrictions have the form ` ` and may have a `-` + * character in front of them to indicate negation. Examples include: + * * name + * * source_properties.a_property + * * security_marks.marks.marka + * The supported operators are: + * * `=` for all value types. + * * `>`, `<`, `>=`, `<=` for integer values. + * * `:`, meaning substring matching, for strings. + * The supported value types are: + * * string literals in quotes. + * * integer literals without quotes. + * * boolean literals `true` and `false` without quotes. + * For example, `source_properties.size = 100` is a valid filter string. + */ + // const filter = 'abc123' + /** + * Required. Expression that defines what assets fields to use for grouping (including + * `state`). The string value should follow SQL syntax: comma separated list + * of fields. For example: + * "parent,resource_name". + * The following fields are supported: + * * resource_name + * * category + * * state + * * parent + */ + // const groupBy = 'abc123' + /** + * Time used as a reference point when filtering findings. The filter is + * limited to findings existing at the supplied time and their values are + * those at that specific time. Absence of this field will default to the + * API's version of NOW. + */ + // const readTime = '' + /** + * The value returned by the last `GroupFindingsResponse`; indicates + * that this is a continuation of a prior `GroupFindings` call, and + * that the system should return the next page of data. + */ + // const pageToken = 'abc123' + /** + * The maximum number of results to return in a single response. Default is + * 10, minimum is 1, maximum is 1000. + */ + // const pageSize = 1234 + + // Imports the Securitycenter library + const {SecurityCenterClient} = + require('@google-cloud/security-center').v1beta1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function groupFindings() { + // Construct request + const request = { + parent, + groupBy, + }; + + // Run request + const iterable = await securitycenterClient.groupFindingsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + groupFindings(); + // [END securitycenter_v1beta1_generated_SecurityCenter_GroupFindings_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.list_assets.js b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.list_assets.js new file mode 100644 index 00000000000..89ad1c9a1cc --- /dev/null +++ b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.list_assets.js @@ -0,0 +1,136 @@ +// 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'; + +function main(parent) { + // [START securitycenter_v1beta1_generated_SecurityCenter_ListAssets_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of the organization assets should belong to. Its format is + * "organizations/[organization_id]". + */ + // const parent = 'abc123' + /** + * Expression that defines the filter to apply across assets. + * The expression is a list of zero or more restrictions combined via logical + * operators `AND` and `OR`. + * Parentheses are not supported, and `OR` has higher precedence than `AND`. + * Restrictions have the form ` ` and may have a `-` + * character in front of them to indicate negation. The fields map to those + * defined in the Asset resource. Examples include: + * * name + * * security_center_properties.resource_name + * * resource_properties.a_property + * * security_marks.marks.marka + * The supported operators are: + * * `=` for all value types. + * * `>`, `<`, `>=`, `<=` for integer values. + * * `:`, meaning substring matching, for strings. + * The supported value types are: + * * string literals in quotes. + * * integer literals without quotes. + * * boolean literals `true` and `false` without quotes. + * For example, `resource_properties.size = 100` is a valid filter string. + */ + // const filter = 'abc123' + /** + * Expression that defines what fields and order to use for sorting. The + * string value should follow SQL syntax: comma separated list of fields. For + * example: "name,resource_properties.a_property". The default sorting order + * is ascending. To specify descending order for a field, a suffix " desc" + * should be appended to the field name. For example: "name + * desc,resource_properties.a_property". Redundant space characters in the + * syntax are insignificant. "name desc,resource_properties.a_property" and " + * name desc , resource_properties.a_property " are equivalent. + */ + // const orderBy = 'abc123' + /** + * Time used as a reference point when filtering assets. The filter is limited + * to assets existing at the supplied time and their values are those at that + * specific time. Absence of this field will default to the API's version of + * NOW. + */ + // const readTime = '' + /** + * When compare_duration is set, the ListAssetResult's "state" attribute is + * updated to indicate whether the asset was added, removed, or remained + * present during the compare_duration period of time that precedes the + * read_time. This is the time between (read_time - + * compare_duration) and read_time. + * The state value is derived based on the presence of the asset at the two + * points in time. Intermediate state changes between the two times don't + * affect the result. For example, the results aren't affected if the asset is + * removed and re-created again. + * Possible "state" values when compare_duration is specified: + * * "ADDED": indicates that the asset was not present before + * compare_duration, but present at read_time. + * * "REMOVED": indicates that the asset was present at the start of + * compare_duration, but not present at read_time. + * * "ACTIVE": indicates that the asset was present at both the + * start and the end of the time period defined by + * compare_duration and read_time. + * If compare_duration is not specified, then the only possible state is + * "UNUSED", which indicates that the asset is present at read_time. + */ + // const compareDuration = '' + /** + * Optional. A field mask to specify the ListAssetsResult fields to be listed in the + * response. + * An empty field mask will list all fields. + */ + // const fieldMask = '' + /** + * The value returned by the last `ListAssetsResponse`; indicates + * that this is a continuation of a prior `ListAssets` call, and + * that the system should return the next page of data. + */ + // const pageToken = 'abc123' + /** + * The maximum number of results to return in a single response. Default is + * 10, minimum is 1, maximum is 1000. + */ + // const pageSize = 1234 + + // Imports the Securitycenter library + const {SecurityCenterClient} = + require('@google-cloud/security-center').v1beta1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function listAssets() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await securitycenterClient.listAssetsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + listAssets(); + // [END securitycenter_v1beta1_generated_SecurityCenter_ListAssets_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.list_findings.js b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.list_findings.js new file mode 100644 index 00000000000..dd524c27453 --- /dev/null +++ b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.list_findings.js @@ -0,0 +1,113 @@ +// 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'; + +function main(parent) { + // [START securitycenter_v1beta1_generated_SecurityCenter_ListFindings_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of the source the findings belong to. Its format is + * "organizations/[organization_id]/sources/[source_id]". To list across all + * sources provide a source_id of `-`. For example: + * organizations/{organization_id}/sources/- + */ + // const parent = 'abc123' + /** + * Expression that defines the filter to apply across findings. + * The expression is a list of one or more restrictions combined via logical + * operators `AND` and `OR`. + * Parentheses are not supported, and `OR` has higher precedence than `AND`. + * Restrictions have the form ` ` and may have a `-` + * character in front of them to indicate negation. Examples include: + * * name + * * source_properties.a_property + * * security_marks.marks.marka + * The supported operators are: + * * `=` for all value types. + * * `>`, `<`, `>=`, `<=` for integer values. + * * `:`, meaning substring matching, for strings. + * The supported value types are: + * * string literals in quotes. + * * integer literals without quotes. + * * boolean literals `true` and `false` without quotes. + * For example, `source_properties.size = 100` is a valid filter string. + */ + // const filter = 'abc123' + /** + * Expression that defines what fields and order to use for sorting. The + * string value should follow SQL syntax: comma separated list of fields. For + * example: "name,resource_properties.a_property". The default sorting order + * is ascending. To specify descending order for a field, a suffix " desc" + * should be appended to the field name. For example: "name + * desc,source_properties.a_property". Redundant space characters in the + * syntax are insignificant. "name desc,source_properties.a_property" and " + * name desc , source_properties.a_property " are equivalent. + */ + // const orderBy = 'abc123' + /** + * Time used as a reference point when filtering findings. The filter is + * limited to findings existing at the supplied time and their values are + * those at that specific time. Absence of this field will default to the + * API's version of NOW. + */ + // const readTime = '' + /** + * Optional. A field mask to specify the Finding fields to be listed in the response. + * An empty field mask will list all fields. + */ + // const fieldMask = '' + /** + * The value returned by the last `ListFindingsResponse`; indicates + * that this is a continuation of a prior `ListFindings` call, and + * that the system should return the next page of data. + */ + // const pageToken = 'abc123' + /** + * The maximum number of results to return in a single response. Default is + * 10, minimum is 1, maximum is 1000. + */ + // const pageSize = 1234 + + // Imports the Securitycenter library + const {SecurityCenterClient} = + require('@google-cloud/security-center').v1beta1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function listFindings() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await securitycenterClient.listFindingsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + listFindings(); + // [END securitycenter_v1beta1_generated_SecurityCenter_ListFindings_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.list_sources.js b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.list_sources.js new file mode 100644 index 00000000000..33330ba206d --- /dev/null +++ b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.list_sources.js @@ -0,0 +1,67 @@ +// 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'; + +function main(parent) { + // [START securitycenter_v1beta1_generated_SecurityCenter_ListSources_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Resource name of the parent of sources to list. Its format should be + * "organizations/[organization_id]". + */ + // const parent = 'abc123' + /** + * The value returned by the last `ListSourcesResponse`; indicates + * that this is a continuation of a prior `ListSources` call, and + * that the system should return the next page of data. + */ + // const pageToken = 'abc123' + /** + * The maximum number of results to return in a single response. Default is + * 10, minimum is 1, maximum is 1000. + */ + // const pageSize = 1234 + + // Imports the Securitycenter library + const {SecurityCenterClient} = + require('@google-cloud/security-center').v1beta1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function listSources() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await securitycenterClient.listSourcesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + listSources(); + // [END securitycenter_v1beta1_generated_SecurityCenter_ListSources_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.run_asset_discovery.js b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.run_asset_discovery.js new file mode 100644 index 00000000000..a57775cd762 --- /dev/null +++ b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.run_asset_discovery.js @@ -0,0 +1,55 @@ +// 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'; + +function main(parent) { + // [START securitycenter_v1beta1_generated_SecurityCenter_RunAssetDiscovery_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of the organization to run asset discovery for. Its format is + * "organizations/[organization_id]". + */ + // const parent = 'abc123' + + // Imports the Securitycenter library + const {SecurityCenterClient} = + require('@google-cloud/security-center').v1beta1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function runAssetDiscovery() { + // Construct request + const request = { + parent, + }; + + // Run request + const [operation] = await securitycenterClient.runAssetDiscovery(request); + const [response] = await operation.promise(); + console.log(response); + } + + runAssetDiscovery(); + // [END securitycenter_v1beta1_generated_SecurityCenter_RunAssetDiscovery_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.set_finding_state.js b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.set_finding_state.js new file mode 100644 index 00000000000..89f6702c6c6 --- /dev/null +++ b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.set_finding_state.js @@ -0,0 +1,66 @@ +// 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'; + +function main(name, state, startTime) { + // [START securitycenter_v1beta1_generated_SecurityCenter_SetFindingState_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The relative resource name of the finding. See: + * https://cloud.google.com/apis/design/resource_names#relative_resource_name + * Example: + * "organizations/{organization_id}/sources/{source_id}/finding/{finding_id}". + */ + // const name = 'abc123' + /** + * Required. The desired State of the finding. + */ + // const state = '' + /** + * Required. The time at which the updated state takes effect. + */ + // const startTime = '' + + // Imports the Securitycenter library + const {SecurityCenterClient} = + require('@google-cloud/security-center').v1beta1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function setFindingState() { + // Construct request + const request = { + name, + state, + startTime, + }; + + // Run request + const response = await securitycenterClient.setFindingState(request); + console.log(response); + } + + setFindingState(); + // [END securitycenter_v1beta1_generated_SecurityCenter_SetFindingState_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.set_iam_policy.js b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.set_iam_policy.js new file mode 100644 index 00000000000..d19993d2273 --- /dev/null +++ b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.set_iam_policy.js @@ -0,0 +1,62 @@ +// 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'; + +function main(resource, policy) { + // [START securitycenter_v1beta1_generated_SecurityCenter_SetIamPolicy_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * REQUIRED: The resource for which the policy is being specified. + * See the operation documentation for the appropriate value for this field. + */ + // const resource = 'abc123' + /** + * REQUIRED: The complete policy to be applied to the `resource`. The size of + * the policy is limited to a few 10s of KB. An empty policy is a + * valid policy but certain Cloud Platform services (such as Projects) + * might reject them. + */ + // const policy = '' + + // Imports the Securitycenter library + const {SecurityCenterClient} = + require('@google-cloud/security-center').v1beta1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function setIamPolicy() { + // Construct request + const request = { + resource, + policy, + }; + + // Run request + const response = await securitycenterClient.setIamPolicy(request); + console.log(response); + } + + setIamPolicy(); + // [END securitycenter_v1beta1_generated_SecurityCenter_SetIamPolicy_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.test_iam_permissions.js b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.test_iam_permissions.js new file mode 100644 index 00000000000..903ac00249a --- /dev/null +++ b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.test_iam_permissions.js @@ -0,0 +1,62 @@ +// 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'; + +function main(resource, permissions) { + // [START securitycenter_v1beta1_generated_SecurityCenter_TestIamPermissions_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + */ + // const resource = 'abc123' + /** + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see + * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + */ + // const permissions = 'abc123' + + // Imports the Securitycenter library + const {SecurityCenterClient} = + require('@google-cloud/security-center').v1beta1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function testIamPermissions() { + // Construct request + const request = { + resource, + permissions, + }; + + // Run request + const response = await securitycenterClient.testIamPermissions(request); + console.log(response); + } + + testIamPermissions(); + // [END securitycenter_v1beta1_generated_SecurityCenter_TestIamPermissions_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.update_finding.js b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.update_finding.js new file mode 100644 index 00000000000..caa61d3d804 --- /dev/null +++ b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.update_finding.js @@ -0,0 +1,62 @@ +// 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'; + +function main(finding) { + // [START securitycenter_v1beta1_generated_SecurityCenter_UpdateFinding_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The finding resource to update or create if it does not already exist. + * parent, security_marks, and update_time will be ignored. + * In the case of creation, the finding id portion of the name must + * alphanumeric and less than or equal to 32 characters and greater than 0 + * characters in length. + */ + // const finding = '' + /** + * The FieldMask to use when updating the finding resource. This field should + * not be specified when creating a finding. + */ + // const updateMask = '' + + // Imports the Securitycenter library + const {SecurityCenterClient} = + require('@google-cloud/security-center').v1beta1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function updateFinding() { + // Construct request + const request = { + finding, + }; + + // Run request + const response = await securitycenterClient.updateFinding(request); + console.log(response); + } + + updateFinding(); + // [END securitycenter_v1beta1_generated_SecurityCenter_UpdateFinding_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.update_organization_settings.js b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.update_organization_settings.js new file mode 100644 index 00000000000..1973f67cdd7 --- /dev/null +++ b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.update_organization_settings.js @@ -0,0 +1,59 @@ +// 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'; + +function main(organizationSettings) { + // [START securitycenter_v1beta1_generated_SecurityCenter_UpdateOrganizationSettings_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The organization settings resource to update. + */ + // const organizationSettings = '' + /** + * The FieldMask to use when updating the settings resource. + */ + // const updateMask = '' + + // Imports the Securitycenter library + const {SecurityCenterClient} = + require('@google-cloud/security-center').v1beta1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function updateOrganizationSettings() { + // Construct request + const request = { + organizationSettings, + }; + + // Run request + const response = await securitycenterClient.updateOrganizationSettings( + request + ); + console.log(response); + } + + updateOrganizationSettings(); + // [END securitycenter_v1beta1_generated_SecurityCenter_UpdateOrganizationSettings_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.update_security_marks.js b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.update_security_marks.js new file mode 100644 index 00000000000..ae7389cb857 --- /dev/null +++ b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.update_security_marks.js @@ -0,0 +1,61 @@ +// 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'; + +function main(securityMarks) { + // [START securitycenter_v1beta1_generated_SecurityCenter_UpdateSecurityMarks_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The security marks resource to update. + */ + // const securityMarks = '' + /** + * The FieldMask to use when updating the security marks resource. + */ + // const updateMask = '' + /** + * The time at which the updated SecurityMarks take effect. + */ + // const startTime = '' + + // Imports the Securitycenter library + const {SecurityCenterClient} = + require('@google-cloud/security-center').v1beta1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function updateSecurityMarks() { + // Construct request + const request = { + securityMarks, + }; + + // Run request + const response = await securitycenterClient.updateSecurityMarks(request); + console.log(response); + } + + updateSecurityMarks(); + // [END securitycenter_v1beta1_generated_SecurityCenter_UpdateSecurityMarks_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.update_source.js b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.update_source.js new file mode 100644 index 00000000000..06ab97df6c9 --- /dev/null +++ b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.update_source.js @@ -0,0 +1,57 @@ +// 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'; + +function main(source) { + // [START securitycenter_v1beta1_generated_SecurityCenter_UpdateSource_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The source resource to update. + */ + // const source = '' + /** + * The FieldMask to use when updating the source resource. + */ + // const updateMask = '' + + // Imports the Securitycenter library + const {SecurityCenterClient} = + require('@google-cloud/security-center').v1beta1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function updateSource() { + // Construct request + const request = { + source, + }; + + // Run request + const response = await securitycenterClient.updateSource(request); + console.log(response); + } + + updateSource(); + // [END securitycenter_v1beta1_generated_SecurityCenter_UpdateSource_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.create_finding.js b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.create_finding.js new file mode 100644 index 00000000000..691d6a353b5 --- /dev/null +++ b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.create_finding.js @@ -0,0 +1,65 @@ +// 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'; + +function main(parent, findingId, finding) { + // [START securitycenter_v1p1beta1_generated_SecurityCenter_CreateFinding_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Resource name of the new finding's parent. Its format should be + * "organizations/[organization_id]/sources/[source_id]". + */ + // const parent = 'abc123' + /** + * Required. Unique identifier provided by the client within the parent scope. + */ + // const findingId = 'abc123' + /** + * Required. The Finding being created. The name and security_marks will be ignored as + * they are both output only fields on this resource. + */ + // const finding = '' + + // Imports the Securitycenter library + const {SecurityCenterClient} = + require('@google-cloud/security-center').v1p1beta1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function createFinding() { + // Construct request + const request = { + parent, + findingId, + finding, + }; + + // Run request + const response = await securitycenterClient.createFinding(request); + console.log(response); + } + + createFinding(); + // [END securitycenter_v1p1beta1_generated_SecurityCenter_CreateFinding_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.create_notification_config.js b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.create_notification_config.js new file mode 100644 index 00000000000..6132d6c29e2 --- /dev/null +++ b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.create_notification_config.js @@ -0,0 +1,69 @@ +// 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'; + +function main(parent, configId, notificationConfig) { + // [START securitycenter_v1p1beta1_generated_SecurityCenter_CreateNotificationConfig_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Resource name of the new notification config's parent. Its format is + * "organizations/[organization_id]". + */ + // const parent = 'abc123' + /** + * Required. Unique identifier provided by the client within the parent scope. + * It must be between 1 and 128 characters, and contains alphanumeric + * characters, underscores or hyphens only. + */ + // const configId = 'abc123' + /** + * Required. The notification config being created. The name and the service account + * will be ignored as they are both output only fields on this resource. + */ + // const notificationConfig = '' + + // Imports the Securitycenter library + const {SecurityCenterClient} = + require('@google-cloud/security-center').v1p1beta1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function createNotificationConfig() { + // Construct request + const request = { + parent, + configId, + notificationConfig, + }; + + // Run request + const response = await securitycenterClient.createNotificationConfig( + request + ); + console.log(response); + } + + createNotificationConfig(); + // [END securitycenter_v1p1beta1_generated_SecurityCenter_CreateNotificationConfig_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.create_source.js b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.create_source.js new file mode 100644 index 00000000000..72e4a5ed45c --- /dev/null +++ b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.create_source.js @@ -0,0 +1,60 @@ +// 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'; + +function main(parent, source) { + // [START securitycenter_v1p1beta1_generated_SecurityCenter_CreateSource_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Resource name of the new source's parent. Its format should be + * "organizations/[organization_id]". + */ + // const parent = 'abc123' + /** + * Required. The Source being created, only the display_name and description will be + * used. All other fields will be ignored. + */ + // const source = '' + + // Imports the Securitycenter library + const {SecurityCenterClient} = + require('@google-cloud/security-center').v1p1beta1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function createSource() { + // Construct request + const request = { + parent, + source, + }; + + // Run request + const response = await securitycenterClient.createSource(request); + console.log(response); + } + + createSource(); + // [END securitycenter_v1p1beta1_generated_SecurityCenter_CreateSource_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.delete_notification_config.js b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.delete_notification_config.js new file mode 100644 index 00000000000..3b6f27578b2 --- /dev/null +++ b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.delete_notification_config.js @@ -0,0 +1,56 @@ +// 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'; + +function main(name) { + // [START securitycenter_v1p1beta1_generated_SecurityCenter_DeleteNotificationConfig_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of the notification config to delete. Its format is + * "organizations/[organization_id]/notificationConfigs/[config_id]". + */ + // const name = 'abc123' + + // Imports the Securitycenter library + const {SecurityCenterClient} = + require('@google-cloud/security-center').v1p1beta1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function deleteNotificationConfig() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await securitycenterClient.deleteNotificationConfig( + request + ); + console.log(response); + } + + deleteNotificationConfig(); + // [END securitycenter_v1p1beta1_generated_SecurityCenter_DeleteNotificationConfig_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.get_iam_policy.js b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.get_iam_policy.js new file mode 100644 index 00000000000..4014fa73c10 --- /dev/null +++ b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.get_iam_policy.js @@ -0,0 +1,59 @@ +// 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'; + +function main(resource) { + // [START securitycenter_v1p1beta1_generated_SecurityCenter_GetIamPolicy_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * REQUIRED: The resource for which the policy is being requested. + * See the operation documentation for the appropriate value for this field. + */ + // const resource = 'abc123' + /** + * OPTIONAL: A `GetPolicyOptions` object for specifying options to + * `GetIamPolicy`. This field is only used by Cloud IAM. + */ + // const options = '' + + // Imports the Securitycenter library + const {SecurityCenterClient} = + require('@google-cloud/security-center').v1p1beta1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function getIamPolicy() { + // Construct request + const request = { + resource, + }; + + // Run request + const response = await securitycenterClient.getIamPolicy(request); + console.log(response); + } + + getIamPolicy(); + // [END securitycenter_v1p1beta1_generated_SecurityCenter_GetIamPolicy_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.get_notification_config.js b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.get_notification_config.js new file mode 100644 index 00000000000..a8fb4b2d87e --- /dev/null +++ b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.get_notification_config.js @@ -0,0 +1,54 @@ +// 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'; + +function main(name) { + // [START securitycenter_v1p1beta1_generated_SecurityCenter_GetNotificationConfig_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of the notification config to get. Its format is + * "organizations/[organization_id]/notificationConfigs/[config_id]". + */ + // const name = 'abc123' + + // Imports the Securitycenter library + const {SecurityCenterClient} = + require('@google-cloud/security-center').v1p1beta1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function getNotificationConfig() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await securitycenterClient.getNotificationConfig(request); + console.log(response); + } + + getNotificationConfig(); + // [END securitycenter_v1p1beta1_generated_SecurityCenter_GetNotificationConfig_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.get_organization_settings.js b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.get_organization_settings.js new file mode 100644 index 00000000000..868e530ff9c --- /dev/null +++ b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.get_organization_settings.js @@ -0,0 +1,56 @@ +// 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'; + +function main(name) { + // [START securitycenter_v1p1beta1_generated_SecurityCenter_GetOrganizationSettings_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of the organization to get organization settings for. Its format is + * "organizations/[organization_id]/organizationSettings". + */ + // const name = 'abc123' + + // Imports the Securitycenter library + const {SecurityCenterClient} = + require('@google-cloud/security-center').v1p1beta1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function getOrganizationSettings() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await securitycenterClient.getOrganizationSettings( + request + ); + console.log(response); + } + + getOrganizationSettings(); + // [END securitycenter_v1p1beta1_generated_SecurityCenter_GetOrganizationSettings_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.get_source.js b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.get_source.js new file mode 100644 index 00000000000..93c406c59af --- /dev/null +++ b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.get_source.js @@ -0,0 +1,54 @@ +// 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'; + +function main(name) { + // [START securitycenter_v1p1beta1_generated_SecurityCenter_GetSource_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Relative resource name of the source. Its format is + * "organizations/[organization_id]/source/[source_id]". + */ + // const name = 'abc123' + + // Imports the Securitycenter library + const {SecurityCenterClient} = + require('@google-cloud/security-center').v1p1beta1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function getSource() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await securitycenterClient.getSource(request); + console.log(response); + } + + getSource(); + // [END securitycenter_v1p1beta1_generated_SecurityCenter_GetSource_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.group_assets.js b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.group_assets.js new file mode 100644 index 00000000000..47fa3e9ae2f --- /dev/null +++ b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.group_assets.js @@ -0,0 +1,168 @@ +// 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'; + +function main(parent, groupBy) { + // [START securitycenter_v1p1beta1_generated_SecurityCenter_GroupAssets_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of the organization to groupBy. Its format is + * "organizations/[organization_id], folders/[folder_id], or + * projects/[project_id]". + */ + // const parent = 'abc123' + /** + * Expression that defines the filter to apply across assets. + * The expression is a list of zero or more restrictions combined via logical + * operators `AND` and `OR`. + * Parentheses are supported, and `OR` has higher precedence than `AND`. + * Restrictions have the form ` ` and may have a `-` + * character in front of them to indicate negation. The fields map to those + * defined in the Asset resource. Examples include: + * * name + * * security_center_properties.resource_name + * * resource_properties.a_property + * * security_marks.marks.marka + * The supported operators are: + * * `=` for all value types. + * * `>`, `<`, `>=`, `<=` for integer values. + * * `:`, meaning substring matching, for strings. + * The supported value types are: + * * string literals in quotes. + * * integer literals without quotes. + * * boolean literals `true` and `false` without quotes. + * The following field and operator combinations are supported: + * * name: `=` + * * update_time: `=`, `>`, `<`, `>=`, `<=` + * Usage: This should be milliseconds since epoch or an RFC3339 string. + * Examples: + * `update_time = "2019-06-10T16:07:18-07:00"` + * `update_time = 1560208038000` + * * create_time: `=`, `>`, `<`, `>=`, `<=` + * Usage: This should be milliseconds since epoch or an RFC3339 string. + * Examples: + * `create_time = "2019-06-10T16:07:18-07:00"` + * `create_time = 1560208038000` + * * iam_policy.policy_blob: `=`, `:` + * * resource_properties: `=`, `:`, `>`, `<`, `>=`, `<=` + * * security_marks.marks: `=`, `:` + * * security_center_properties.resource_name: `=`, `:` + * * security_center_properties.resource_name_display_name: `=`, `:` + * * security_center_properties.resource_type: `=`, `:` + * * security_center_properties.resource_parent: `=`, `:` + * * security_center_properties.resource_parent_display_name: `=`, `:` + * * security_center_properties.resource_project: `=`, `:` + * * security_center_properties.resource_project_display_name: `=`, `:` + * * security_center_properties.resource_owners: `=`, `:` + * For example, `resource_properties.size = 100` is a valid filter string. + * Use a partial match on the empty string to filter based on a property + * existing: `resource_properties.my_property : ""` + * Use a negated partial match on the empty string to filter based on a + * property not existing: `-resource_properties.my_property : ""` + */ + // const filter = 'abc123' + /** + * Required. Expression that defines what assets fields to use for grouping. The string + * value should follow SQL syntax: comma separated list of fields. For + * example: + * "security_center_properties.resource_project,security_center_properties.project". + * The following fields are supported when compare_duration is not set: + * * security_center_properties.resource_project + * * security_center_properties.resource_project_display_name + * * security_center_properties.resource_type + * * security_center_properties.resource_parent + * * security_center_properties.resource_parent_display_name + * The following fields are supported when compare_duration is set: + * * security_center_properties.resource_type + * * security_center_properties.resource_project_display_name + * * security_center_properties.resource_parent_display_name + */ + // const groupBy = 'abc123' + /** + * When compare_duration is set, the GroupResult's "state_change" property is + * updated to indicate whether the asset was added, removed, or remained + * present during the compare_duration period of time that precedes the + * read_time. This is the time between (read_time - compare_duration) and + * read_time. + * The state change value is derived based on the presence of the asset at the + * two points in time. Intermediate state changes between the two times don't + * affect the result. For example, the results aren't affected if the asset is + * removed and re-created again. + * Possible "state_change" values when compare_duration is specified: + * * "ADDED": indicates that the asset was not present at the start of + * compare_duration, but present at reference_time. + * * "REMOVED": indicates that the asset was present at the start of + * compare_duration, but not present at reference_time. + * * "ACTIVE": indicates that the asset was present at both the + * start and the end of the time period defined by + * compare_duration and reference_time. + * If compare_duration is not specified, then the only possible state_change + * is "UNUSED", which will be the state_change set for all assets present at + * read_time. + * If this field is set then `state_change` must be a specified field in + * `group_by`. + */ + // const compareDuration = '' + /** + * Time used as a reference point when filtering assets. The filter is limited + * to assets existing at the supplied time and their values are those at that + * specific time. Absence of this field will default to the API's version of + * NOW. + */ + // const readTime = '' + /** + * The value returned by the last `GroupAssetsResponse`; indicates + * that this is a continuation of a prior `GroupAssets` call, and that the + * system should return the next page of data. + */ + // const pageToken = 'abc123' + /** + * The maximum number of results to return in a single response. Default is + * 10, minimum is 1, maximum is 1000. + */ + // const pageSize = 1234 + + // Imports the Securitycenter library + const {SecurityCenterClient} = + require('@google-cloud/security-center').v1p1beta1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function groupAssets() { + // Construct request + const request = { + parent, + groupBy, + }; + + // Run request + const iterable = await securitycenterClient.groupAssetsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + groupAssets(); + // [END securitycenter_v1p1beta1_generated_SecurityCenter_GroupAssets_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.group_findings.js b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.group_findings.js new file mode 100644 index 00000000000..51d517e132d --- /dev/null +++ b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.group_findings.js @@ -0,0 +1,164 @@ +// 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'; + +function main(parent, groupBy) { + // [START securitycenter_v1p1beta1_generated_SecurityCenter_GroupFindings_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of the source to groupBy. Its format is + * "organizations/[organization_id]/sources/[source_id]", + * folders/[folder_id]/sources/[source_id], or + * projects/[project_id]/sources/[source_id]. To groupBy across all sources + * provide a source_id of `-`. For example: + * organizations/{organization_id}/sources/-, folders/{folder_id}/sources/-, + * or projects/{project_id}/sources/- + */ + // const parent = 'abc123' + /** + * Expression that defines the filter to apply across findings. + * The expression is a list of one or more restrictions combined via logical + * operators `AND` and `OR`. + * Parentheses are supported, and `OR` has higher precedence than `AND`. + * Restrictions have the form ` ` and may have a `-` + * character in front of them to indicate negation. Examples include: + * * name + * * source_properties.a_property + * * security_marks.marks.marka + * The supported operators are: + * * `=` for all value types. + * * `>`, `<`, `>=`, `<=` for integer values. + * * `:`, meaning substring matching, for strings. + * The supported value types are: + * * string literals in quotes. + * * integer literals without quotes. + * * boolean literals `true` and `false` without quotes. + * The following field and operator combinations are supported: + * * name: `=` + * * parent: `=`, `:` + * * resource_name: `=`, `:` + * * state: `=`, `:` + * * category: `=`, `:` + * * external_uri: `=`, `:` + * * event_time: `=`, `>`, `<`, `>=`, `<=` + * * severity: `=`, `:` + * Usage: This should be milliseconds since epoch or an RFC3339 string. + * Examples: + * `event_time = "2019-06-10T16:07:18-07:00"` + * `event_time = 1560208038000` + * * security_marks.marks: `=`, `:` + * * source_properties: `=`, `:`, `>`, `<`, `>=`, `<=` + * For example, `source_properties.size = 100` is a valid filter string. + * Use a partial match on the empty string to filter based on a property + * existing: `source_properties.my_property : ""` + * Use a negated partial match on the empty string to filter based on a + * property not existing: `-source_properties.my_property : ""` + */ + // const filter = 'abc123' + /** + * Required. Expression that defines what assets fields to use for grouping (including + * `state_change`). The string value should follow SQL syntax: comma separated + * list of fields. For example: "parent,resource_name". + * The following fields are supported: + * * resource_name + * * category + * * state + * * parent + * * severity + * The following fields are supported when compare_duration is set: + * * state_change + */ + // const groupBy = 'abc123' + /** + * Time used as a reference point when filtering findings. The filter is + * limited to findings existing at the supplied time and their values are + * those at that specific time. Absence of this field will default to the + * API's version of NOW. + */ + // const readTime = '' + /** + * When compare_duration is set, the GroupResult's "state_change" attribute is + * updated to indicate whether the finding had its state changed, the + * finding's state remained unchanged, or if the finding was added during the + * compare_duration period of time that precedes the read_time. This is the + * time between (read_time - compare_duration) and read_time. + * The state_change value is derived based on the presence and state of the + * finding at the two points in time. Intermediate state changes between the + * two times don't affect the result. For example, the results aren't affected + * if the finding is made inactive and then active again. + * Possible "state_change" values when compare_duration is specified: + * * "CHANGED": indicates that the finding was present and matched the given + * filter at the start of compare_duration, but changed its + * state at read_time. + * * "UNCHANGED": indicates that the finding was present and matched the given + * filter at the start of compare_duration and did not change + * state at read_time. + * * "ADDED": indicates that the finding did not match the given filter or + * was not present at the start of compare_duration, but was + * present at read_time. + * * "REMOVED": indicates that the finding was present and matched the + * filter at the start of compare_duration, but did not match + * the filter at read_time. + * If compare_duration is not specified, then the only possible state_change + * is "UNUSED", which will be the state_change set for all findings present + * at read_time. + * If this field is set then `state_change` must be a specified field in + * `group_by`. + */ + // const compareDuration = '' + /** + * The value returned by the last `GroupFindingsResponse`; indicates + * that this is a continuation of a prior `GroupFindings` call, and + * that the system should return the next page of data. + */ + // const pageToken = 'abc123' + /** + * The maximum number of results to return in a single response. Default is + * 10, minimum is 1, maximum is 1000. + */ + // const pageSize = 1234 + + // Imports the Securitycenter library + const {SecurityCenterClient} = + require('@google-cloud/security-center').v1p1beta1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function groupFindings() { + // Construct request + const request = { + parent, + groupBy, + }; + + // Run request + const iterable = await securitycenterClient.groupFindingsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + groupFindings(); + // [END securitycenter_v1p1beta1_generated_SecurityCenter_GroupFindings_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.list_assets.js b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.list_assets.js new file mode 100644 index 00000000000..7ab4b0f3ce8 --- /dev/null +++ b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.list_assets.js @@ -0,0 +1,177 @@ +// 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'; + +function main(parent) { + // [START securitycenter_v1p1beta1_generated_SecurityCenter_ListAssets_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of the organization assets should belong to. Its format is + * "organizations/[organization_id], folders/[folder_id], or + * projects/[project_id]". + */ + // const parent = 'abc123' + /** + * Expression that defines the filter to apply across assets. + * The expression is a list of zero or more restrictions combined via logical + * operators `AND` and `OR`. + * Parentheses are supported, and `OR` has higher precedence than `AND`. + * Restrictions have the form ` ` and may have a `-` + * character in front of them to indicate negation. The fields map to those + * defined in the Asset resource. Examples include: + * * name + * * security_center_properties.resource_name + * * resource_properties.a_property + * * security_marks.marks.marka + * The supported operators are: + * * `=` for all value types. + * * `>`, `<`, `>=`, `<=` for integer values. + * * `:`, meaning substring matching, for strings. + * The supported value types are: + * * string literals in quotes. + * * integer literals without quotes. + * * boolean literals `true` and `false` without quotes. + * The following are the allowed field and operator combinations: + * * name: `=` + * * update_time: `=`, `>`, `<`, `>=`, `<=` + * Usage: This should be milliseconds since epoch or an RFC3339 string. + * Examples: + * `update_time = "2019-06-10T16:07:18-07:00"` + * `update_time = 1560208038000` + * * create_time: `=`, `>`, `<`, `>=`, `<=` + * Usage: This should be milliseconds since epoch or an RFC3339 string. + * Examples: + * `create_time = "2019-06-10T16:07:18-07:00"` + * `create_time = 1560208038000` + * * iam_policy.policy_blob: `=`, `:` + * * resource_properties: `=`, `:`, `>`, `<`, `>=`, `<=` + * * security_marks.marks: `=`, `:` + * * security_center_properties.resource_name: `=`, `:` + * * security_center_properties.resource_display_name: `=`, `:` + * * security_center_properties.resource_type: `=`, `:` + * * security_center_properties.resource_parent: `=`, `:` + * * security_center_properties.resource_parent_display_name: `=`, `:` + * * security_center_properties.resource_project: `=`, `:` + * * security_center_properties.resource_project_display_name: `=`, `:` + * * security_center_properties.resource_owners: `=`, `:` + * For example, `resource_properties.size = 100` is a valid filter string. + * Use a partial match on the empty string to filter based on a property + * existing: `resource_properties.my_property : ""` + * Use a negated partial match on the empty string to filter based on a + * property not existing: `-resource_properties.my_property : ""` + */ + // const filter = 'abc123' + /** + * Expression that defines what fields and order to use for sorting. The + * string value should follow SQL syntax: comma separated list of fields. For + * example: "name,resource_properties.a_property". The default sorting order + * is ascending. To specify descending order for a field, a suffix " desc" + * should be appended to the field name. For example: "name + * desc,resource_properties.a_property". Redundant space characters in the + * syntax are insignificant. "name desc,resource_properties.a_property" and " + * name desc , resource_properties.a_property " are equivalent. + * The following fields are supported: + * name + * update_time + * resource_properties + * security_marks.marks + * security_center_properties.resource_name + * security_center_properties.resource_display_name + * security_center_properties.resource_parent + * security_center_properties.resource_parent_display_name + * security_center_properties.resource_project + * security_center_properties.resource_project_display_name + * security_center_properties.resource_type + */ + // const orderBy = 'abc123' + /** + * Time used as a reference point when filtering assets. The filter is limited + * to assets existing at the supplied time and their values are those at that + * specific time. Absence of this field will default to the API's version of + * NOW. + */ + // const readTime = '' + /** + * When compare_duration is set, the ListAssetsResult's "state_change" + * attribute is updated to indicate whether the asset was added, removed, or + * remained present during the compare_duration period of time that precedes + * the read_time. This is the time between (read_time - compare_duration) and + * read_time. + * The state_change value is derived based on the presence of the asset at the + * two points in time. Intermediate state changes between the two times don't + * affect the result. For example, the results aren't affected if the asset is + * removed and re-created again. + * Possible "state_change" values when compare_duration is specified: + * * "ADDED": indicates that the asset was not present at the start of + * compare_duration, but present at read_time. + * * "REMOVED": indicates that the asset was present at the start of + * compare_duration, but not present at read_time. + * * "ACTIVE": indicates that the asset was present at both the + * start and the end of the time period defined by + * compare_duration and read_time. + * If compare_duration is not specified, then the only possible state_change + * is "UNUSED", which will be the state_change set for all assets present at + * read_time. + */ + // const compareDuration = '' + /** + * A field mask to specify the ListAssetsResult fields to be listed in the + * response. + * An empty field mask will list all fields. + */ + // const fieldMask = '' + /** + * The value returned by the last `ListAssetsResponse`; indicates + * that this is a continuation of a prior `ListAssets` call, and + * that the system should return the next page of data. + */ + // const pageToken = 'abc123' + /** + * The maximum number of results to return in a single response. Default is + * 10, minimum is 1, maximum is 1000. + */ + // const pageSize = 1234 + + // Imports the Securitycenter library + const {SecurityCenterClient} = + require('@google-cloud/security-center').v1p1beta1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function listAssets() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await securitycenterClient.listAssetsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + listAssets(); + // [END securitycenter_v1p1beta1_generated_SecurityCenter_ListAssets_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.list_findings.js b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.list_findings.js new file mode 100644 index 00000000000..2fa2ce09ef7 --- /dev/null +++ b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.list_findings.js @@ -0,0 +1,173 @@ +// 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'; + +function main(parent) { + // [START securitycenter_v1p1beta1_generated_SecurityCenter_ListFindings_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of the source the findings belong to. Its format is + * "organizations/[organization_id]/sources/[source_id], + * folders/[folder_id]/sources/[source_id], or + * projects/[project_id]/sources/[source_id]". To list across all sources + * provide a source_id of `-`. For example: + * organizations/{organization_id}/sources/-, folders/{folder_id}/sources/- or + * projects/{projects_id}/sources/- + */ + // const parent = 'abc123' + /** + * Expression that defines the filter to apply across findings. + * The expression is a list of one or more restrictions combined via logical + * operators `AND` and `OR`. + * Parentheses are supported, and `OR` has higher precedence than `AND`. + * Restrictions have the form ` ` and may have a `-` + * character in front of them to indicate negation. Examples include: + * * name + * * source_properties.a_property + * * security_marks.marks.marka + * The supported operators are: + * * `=` for all value types. + * * `>`, `<`, `>=`, `<=` for integer values. + * * `:`, meaning substring matching, for strings. + * The supported value types are: + * * string literals in quotes. + * * integer literals without quotes. + * * boolean literals `true` and `false` without quotes. + * The following field and operator combinations are supported: + * * name: `=` + * * parent: `=`, `:` + * * resource_name: `=`, `:` + * * state: `=`, `:` + * * category: `=`, `:` + * * external_uri: `=`, `:` + * * event_time: `=`, `>`, `<`, `>=`, `<=` + * * severity: `=`, `:` + * Usage: This should be milliseconds since epoch or an RFC3339 string. + * Examples: + * `event_time = "2019-06-10T16:07:18-07:00"` + * `event_time = 1560208038000` + * security_marks.marks: `=`, `:` + * source_properties: `=`, `:`, `>`, `<`, `>=`, `<=` + * For example, `source_properties.size = 100` is a valid filter string. + * Use a partial match on the empty string to filter based on a property + * existing: `source_properties.my_property : ""` + * Use a negated partial match on the empty string to filter based on a + * property not existing: `-source_properties.my_property : ""` + */ + // const filter = 'abc123' + /** + * Expression that defines what fields and order to use for sorting. The + * string value should follow SQL syntax: comma separated list of fields. For + * example: "name,resource_properties.a_property". The default sorting order + * is ascending. To specify descending order for a field, a suffix " desc" + * should be appended to the field name. For example: "name + * desc,source_properties.a_property". Redundant space characters in the + * syntax are insignificant. "name desc,source_properties.a_property" and " + * name desc , source_properties.a_property " are equivalent. + * The following fields are supported: + * name + * parent + * state + * category + * resource_name + * event_time + * source_properties + * security_marks.marks + */ + // const orderBy = 'abc123' + /** + * Time used as a reference point when filtering findings. The filter is + * limited to findings existing at the supplied time and their values are + * those at that specific time. Absence of this field will default to the + * API's version of NOW. + */ + // const readTime = '' + /** + * When compare_duration is set, the ListFindingsResult's "state_change" + * attribute is updated to indicate whether the finding had its state changed, + * the finding's state remained unchanged, or if the finding was added in any + * state during the compare_duration period of time that precedes the + * read_time. This is the time between (read_time - compare_duration) and + * read_time. + * The state_change value is derived based on the presence and state of the + * finding at the two points in time. Intermediate state changes between the + * two times don't affect the result. For example, the results aren't affected + * if the finding is made inactive and then active again. + * Possible "state_change" values when compare_duration is specified: + * * "CHANGED": indicates that the finding was present and matched the given + * filter at the start of compare_duration, but changed its + * state at read_time. + * * "UNCHANGED": indicates that the finding was present and matched the given + * filter at the start of compare_duration and did not change + * state at read_time. + * * "ADDED": indicates that the finding did not match the given filter or + * was not present at the start of compare_duration, but was + * present at read_time. + * * "REMOVED": indicates that the finding was present and matched the + * filter at the start of compare_duration, but did not match + * the filter at read_time. + * If compare_duration is not specified, then the only possible state_change + * is "UNUSED", which will be the state_change set for all findings present at + * read_time. + */ + // const compareDuration = '' + /** + * A field mask to specify the Finding fields to be listed in the response. + * An empty field mask will list all fields. + */ + // const fieldMask = '' + /** + * The value returned by the last `ListFindingsResponse`; indicates + * that this is a continuation of a prior `ListFindings` call, and + * that the system should return the next page of data. + */ + // const pageToken = 'abc123' + /** + * The maximum number of results to return in a single response. Default is + * 10, minimum is 1, maximum is 1000. + */ + // const pageSize = 1234 + + // Imports the Securitycenter library + const {SecurityCenterClient} = + require('@google-cloud/security-center').v1p1beta1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function listFindings() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await securitycenterClient.listFindingsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + listFindings(); + // [END securitycenter_v1p1beta1_generated_SecurityCenter_ListFindings_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.list_notification_configs.js b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.list_notification_configs.js new file mode 100644 index 00000000000..590a9bfda30 --- /dev/null +++ b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.list_notification_configs.js @@ -0,0 +1,69 @@ +// 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'; + +function main(parent) { + // [START securitycenter_v1p1beta1_generated_SecurityCenter_ListNotificationConfigs_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of the organization to list notification configs. + * Its format is "organizations/[organization_id]". + */ + // const parent = 'abc123' + /** + * The value returned by the last `ListNotificationConfigsResponse`; indicates + * that this is a continuation of a prior `ListNotificationConfigs` call, and + * that the system should return the next page of data. + */ + // const pageToken = 'abc123' + /** + * The maximum number of results to return in a single response. Default is + * 10, minimum is 1, maximum is 1000. + */ + // const pageSize = 1234 + + // Imports the Securitycenter library + const {SecurityCenterClient} = + require('@google-cloud/security-center').v1p1beta1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function listNotificationConfigs() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await securitycenterClient.listNotificationConfigsAsync( + request + ); + for await (const response of iterable) { + console.log(response); + } + } + + listNotificationConfigs(); + // [END securitycenter_v1p1beta1_generated_SecurityCenter_ListNotificationConfigs_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.list_sources.js b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.list_sources.js new file mode 100644 index 00000000000..e8a6e77d3fe --- /dev/null +++ b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.list_sources.js @@ -0,0 +1,68 @@ +// 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'; + +function main(parent) { + // [START securitycenter_v1p1beta1_generated_SecurityCenter_ListSources_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Resource name of the parent of sources to list. Its format should be + * "organizations/[organization_id], folders/[folder_id], or + * projects/[project_id]". + */ + // const parent = 'abc123' + /** + * The value returned by the last `ListSourcesResponse`; indicates + * that this is a continuation of a prior `ListSources` call, and + * that the system should return the next page of data. + */ + // const pageToken = 'abc123' + /** + * The maximum number of results to return in a single response. Default is + * 10, minimum is 1, maximum is 1000. + */ + // const pageSize = 1234 + + // Imports the Securitycenter library + const {SecurityCenterClient} = + require('@google-cloud/security-center').v1p1beta1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function listSources() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await securitycenterClient.listSourcesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + listSources(); + // [END securitycenter_v1p1beta1_generated_SecurityCenter_ListSources_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.run_asset_discovery.js b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.run_asset_discovery.js new file mode 100644 index 00000000000..3b17414dcbe --- /dev/null +++ b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.run_asset_discovery.js @@ -0,0 +1,55 @@ +// 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'; + +function main(parent) { + // [START securitycenter_v1p1beta1_generated_SecurityCenter_RunAssetDiscovery_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of the organization to run asset discovery for. Its format is + * "organizations/[organization_id]". + */ + // const parent = 'abc123' + + // Imports the Securitycenter library + const {SecurityCenterClient} = + require('@google-cloud/security-center').v1p1beta1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function runAssetDiscovery() { + // Construct request + const request = { + parent, + }; + + // Run request + const [operation] = await securitycenterClient.runAssetDiscovery(request); + const [response] = await operation.promise(); + console.log(response); + } + + runAssetDiscovery(); + // [END securitycenter_v1p1beta1_generated_SecurityCenter_RunAssetDiscovery_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.set_finding_state.js b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.set_finding_state.js new file mode 100644 index 00000000000..6b96c45b764 --- /dev/null +++ b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.set_finding_state.js @@ -0,0 +1,66 @@ +// 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'; + +function main(name, state, startTime) { + // [START securitycenter_v1p1beta1_generated_SecurityCenter_SetFindingState_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The relative resource name of the finding. See: + * https://cloud.google.com/apis/design/resource_names#relative_resource_name + * Example: + * "organizations/{organization_id}/sources/{source_id}/finding/{finding_id}". + */ + // const name = 'abc123' + /** + * Required. The desired State of the finding. + */ + // const state = '' + /** + * Required. The time at which the updated state takes effect. + */ + // const startTime = '' + + // Imports the Securitycenter library + const {SecurityCenterClient} = + require('@google-cloud/security-center').v1p1beta1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function setFindingState() { + // Construct request + const request = { + name, + state, + startTime, + }; + + // Run request + const response = await securitycenterClient.setFindingState(request); + console.log(response); + } + + setFindingState(); + // [END securitycenter_v1p1beta1_generated_SecurityCenter_SetFindingState_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.set_iam_policy.js b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.set_iam_policy.js new file mode 100644 index 00000000000..b11092d07d5 --- /dev/null +++ b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.set_iam_policy.js @@ -0,0 +1,62 @@ +// 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'; + +function main(resource, policy) { + // [START securitycenter_v1p1beta1_generated_SecurityCenter_SetIamPolicy_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * REQUIRED: The resource for which the policy is being specified. + * See the operation documentation for the appropriate value for this field. + */ + // const resource = 'abc123' + /** + * REQUIRED: The complete policy to be applied to the `resource`. The size of + * the policy is limited to a few 10s of KB. An empty policy is a + * valid policy but certain Cloud Platform services (such as Projects) + * might reject them. + */ + // const policy = '' + + // Imports the Securitycenter library + const {SecurityCenterClient} = + require('@google-cloud/security-center').v1p1beta1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function setIamPolicy() { + // Construct request + const request = { + resource, + policy, + }; + + // Run request + const response = await securitycenterClient.setIamPolicy(request); + console.log(response); + } + + setIamPolicy(); + // [END securitycenter_v1p1beta1_generated_SecurityCenter_SetIamPolicy_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.test_iam_permissions.js b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.test_iam_permissions.js new file mode 100644 index 00000000000..f4bf03ae8e0 --- /dev/null +++ b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.test_iam_permissions.js @@ -0,0 +1,62 @@ +// 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'; + +function main(resource, permissions) { + // [START securitycenter_v1p1beta1_generated_SecurityCenter_TestIamPermissions_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + */ + // const resource = 'abc123' + /** + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see + * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + */ + // const permissions = 'abc123' + + // Imports the Securitycenter library + const {SecurityCenterClient} = + require('@google-cloud/security-center').v1p1beta1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function testIamPermissions() { + // Construct request + const request = { + resource, + permissions, + }; + + // Run request + const response = await securitycenterClient.testIamPermissions(request); + console.log(response); + } + + testIamPermissions(); + // [END securitycenter_v1p1beta1_generated_SecurityCenter_TestIamPermissions_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.update_finding.js b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.update_finding.js new file mode 100644 index 00000000000..88fbd0436b5 --- /dev/null +++ b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.update_finding.js @@ -0,0 +1,66 @@ +// 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'; + +function main(finding) { + // [START securitycenter_v1p1beta1_generated_SecurityCenter_UpdateFinding_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The finding resource to update or create if it does not already exist. + * parent, security_marks, and update_time will be ignored. + * In the case of creation, the finding id portion of the name must be + * alphanumeric and less than or equal to 32 characters and greater than 0 + * characters in length. + */ + // const finding = '' + /** + * The FieldMask to use when updating the finding resource. This field should + * not be specified when creating a finding. + * When updating a finding, an empty mask is treated as updating all mutable + * fields and replacing source_properties. Individual source_properties can + * be added/updated by using "source_properties." in the field + * mask. + */ + // const updateMask = '' + + // Imports the Securitycenter library + const {SecurityCenterClient} = + require('@google-cloud/security-center').v1p1beta1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function updateFinding() { + // Construct request + const request = { + finding, + }; + + // Run request + const response = await securitycenterClient.updateFinding(request); + console.log(response); + } + + updateFinding(); + // [END securitycenter_v1p1beta1_generated_SecurityCenter_UpdateFinding_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.update_notification_config.js b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.update_notification_config.js new file mode 100644 index 00000000000..1c908d2f2b4 --- /dev/null +++ b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.update_notification_config.js @@ -0,0 +1,60 @@ +// 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'; + +function main(notificationConfig) { + // [START securitycenter_v1p1beta1_generated_SecurityCenter_UpdateNotificationConfig_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The notification config to update. + */ + // const notificationConfig = '' + /** + * The FieldMask to use when updating the notification config. + * If empty all mutable fields will be updated. + */ + // const updateMask = '' + + // Imports the Securitycenter library + const {SecurityCenterClient} = + require('@google-cloud/security-center').v1p1beta1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function updateNotificationConfig() { + // Construct request + const request = { + notificationConfig, + }; + + // Run request + const response = await securitycenterClient.updateNotificationConfig( + request + ); + console.log(response); + } + + updateNotificationConfig(); + // [END securitycenter_v1p1beta1_generated_SecurityCenter_UpdateNotificationConfig_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.update_organization_settings.js b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.update_organization_settings.js new file mode 100644 index 00000000000..2eae3e2d487 --- /dev/null +++ b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.update_organization_settings.js @@ -0,0 +1,60 @@ +// 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'; + +function main(organizationSettings) { + // [START securitycenter_v1p1beta1_generated_SecurityCenter_UpdateOrganizationSettings_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The organization settings resource to update. + */ + // const organizationSettings = '' + /** + * The FieldMask to use when updating the settings resource. + * If empty all mutable fields will be updated. + */ + // const updateMask = '' + + // Imports the Securitycenter library + const {SecurityCenterClient} = + require('@google-cloud/security-center').v1p1beta1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function updateOrganizationSettings() { + // Construct request + const request = { + organizationSettings, + }; + + // Run request + const response = await securitycenterClient.updateOrganizationSettings( + request + ); + console.log(response); + } + + updateOrganizationSettings(); + // [END securitycenter_v1p1beta1_generated_SecurityCenter_UpdateOrganizationSettings_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.update_security_marks.js b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.update_security_marks.js new file mode 100644 index 00000000000..ec138d6979d --- /dev/null +++ b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.update_security_marks.js @@ -0,0 +1,66 @@ +// 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'; + +function main(securityMarks) { + // [START securitycenter_v1p1beta1_generated_SecurityCenter_UpdateSecurityMarks_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The security marks resource to update. + */ + // const securityMarks = '' + /** + * The FieldMask to use when updating the security marks resource. + * The field mask must not contain duplicate fields. + * If empty or set to "marks", all marks will be replaced. Individual + * marks can be updated using "marks.". + */ + // const updateMask = '' + /** + * The time at which the updated SecurityMarks take effect. + * If not set uses current server time. Updates will be applied to the + * SecurityMarks that are active immediately preceding this time. + */ + // const startTime = '' + + // Imports the Securitycenter library + const {SecurityCenterClient} = + require('@google-cloud/security-center').v1p1beta1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function updateSecurityMarks() { + // Construct request + const request = { + securityMarks, + }; + + // Run request + const response = await securitycenterClient.updateSecurityMarks(request); + console.log(response); + } + + updateSecurityMarks(); + // [END securitycenter_v1p1beta1_generated_SecurityCenter_UpdateSecurityMarks_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.update_source.js b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.update_source.js new file mode 100644 index 00000000000..2d4ac6486ab --- /dev/null +++ b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.update_source.js @@ -0,0 +1,58 @@ +// 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'; + +function main(source) { + // [START securitycenter_v1p1beta1_generated_SecurityCenter_UpdateSource_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The source resource to update. + */ + // const source = '' + /** + * The FieldMask to use when updating the source resource. + * If empty all mutable fields will be updated. + */ + // const updateMask = '' + + // Imports the Securitycenter library + const {SecurityCenterClient} = + require('@google-cloud/security-center').v1p1beta1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function updateSource() { + // Construct request + const request = { + source, + }; + + // Run request + const response = await securitycenterClient.updateSource(request); + console.log(response); + } + + updateSource(); + // [END securitycenter_v1p1beta1_generated_SecurityCenter_UpdateSource_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-securitycenter/samples/package.json b/packages/google-cloud-securitycenter/samples/package.json index b65b485132d..4c50c616c4e 100644 --- a/packages/google-cloud-securitycenter/samples/package.json +++ b/packages/google-cloud-securitycenter/samples/package.json @@ -6,7 +6,7 @@ "!system-test/" ], "engines": { - "node": ">=8" + "node": ">=10" }, "scripts": { "test": "mocha system-test/ --recursive --timeout 6000000" diff --git a/packages/google-cloud-securitycenter/src/v1/security_center_client.ts b/packages/google-cloud-securitycenter/src/v1/security_center_client.ts index b69f99af5be..7cd4e69b75d 100644 --- a/packages/google-cloud-securitycenter/src/v1/security_center_client.ts +++ b/packages/google-cloud-securitycenter/src/v1/security_center_client.ts @@ -2550,7 +2550,8 @@ export class SecurityCenterClient { gax.routingHeader.fromParams({ parent: request.parent || '', }); - const callSettings = new gax.CallSettings(options); + const defaultCallSettings = this._defaults['groupAssets']; + const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.groupAssets.createStream( this.innerApiCalls.groupAssets as gax.GaxCall, @@ -2720,7 +2721,8 @@ export class SecurityCenterClient { parent: request.parent || '', }); options = options || {}; - const callSettings = new gax.CallSettings(options); + const defaultCallSettings = this._defaults['groupAssets']; + const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.groupAssets.asyncIterate( this.innerApiCalls['groupAssets'] as GaxCall, @@ -3113,7 +3115,8 @@ export class SecurityCenterClient { gax.routingHeader.fromParams({ parent: request.parent || '', }); - const callSettings = new gax.CallSettings(options); + const defaultCallSettings = this._defaults['groupFindings']; + const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.groupFindings.createStream( this.innerApiCalls.groupFindings as gax.GaxCall, @@ -3286,7 +3289,8 @@ export class SecurityCenterClient { parent: request.parent || '', }); options = options || {}; - const callSettings = new gax.CallSettings(options); + const defaultCallSettings = this._defaults['groupFindings']; + const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.groupFindings.asyncIterate( this.innerApiCalls['groupFindings'] as GaxCall, @@ -3675,7 +3679,8 @@ export class SecurityCenterClient { gax.routingHeader.fromParams({ parent: request.parent || '', }); - const callSettings = new gax.CallSettings(options); + const defaultCallSettings = this._defaults['listAssets']; + const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listAssets.createStream( this.innerApiCalls.listAssets as gax.GaxCall, @@ -3849,7 +3854,8 @@ export class SecurityCenterClient { parent: request.parent || '', }); options = options || {}; - const callSettings = new gax.CallSettings(options); + const defaultCallSettings = this._defaults['listAssets']; + const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listAssets.asyncIterate( this.innerApiCalls['listAssets'] as GaxCall, @@ -4249,7 +4255,8 @@ export class SecurityCenterClient { gax.routingHeader.fromParams({ parent: request.parent || '', }); - const callSettings = new gax.CallSettings(options); + const defaultCallSettings = this._defaults['listFindings']; + const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listFindings.createStream( this.innerApiCalls.listFindings as gax.GaxCall, @@ -4427,7 +4434,8 @@ export class SecurityCenterClient { parent: request.parent || '', }); options = options || {}; - const callSettings = new gax.CallSettings(options); + const defaultCallSettings = this._defaults['listFindings']; + const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listFindings.asyncIterate( this.innerApiCalls['listFindings'] as GaxCall, @@ -4580,7 +4588,8 @@ export class SecurityCenterClient { gax.routingHeader.fromParams({ parent: request.parent || '', }); - const callSettings = new gax.CallSettings(options); + const defaultCallSettings = this._defaults['listNotificationConfigs']; + const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listNotificationConfigs.createStream( this.innerApiCalls.listNotificationConfigs as gax.GaxCall, @@ -4634,7 +4643,8 @@ export class SecurityCenterClient { parent: request.parent || '', }); options = options || {}; - const callSettings = new gax.CallSettings(options); + const defaultCallSettings = this._defaults['listNotificationConfigs']; + const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listNotificationConfigs.asyncIterate( this.innerApiCalls['listNotificationConfigs'] as GaxCall, @@ -4785,7 +4795,8 @@ export class SecurityCenterClient { gax.routingHeader.fromParams({ parent: request.parent || '', }); - const callSettings = new gax.CallSettings(options); + const defaultCallSettings = this._defaults['listSources']; + const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listSources.createStream( this.innerApiCalls.listSources as gax.GaxCall, @@ -4840,7 +4851,8 @@ export class SecurityCenterClient { parent: request.parent || '', }); options = options || {}; - const callSettings = new gax.CallSettings(options); + const defaultCallSettings = this._defaults['listSources']; + const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listSources.asyncIterate( this.innerApiCalls['listSources'] as GaxCall, diff --git a/packages/google-cloud-securitycenter/src/v1/security_center_proto_list.json b/packages/google-cloud-securitycenter/src/v1/security_center_proto_list.json index e437464605b..dbee8391a70 100644 --- a/packages/google-cloud-securitycenter/src/v1/security_center_proto_list.json +++ b/packages/google-cloud-securitycenter/src/v1/security_center_proto_list.json @@ -10,5 +10,6 @@ "../../protos/google/cloud/securitycenter/v1/run_asset_discovery_response.proto", "../../protos/google/cloud/securitycenter/v1/security_marks.proto", "../../protos/google/cloud/securitycenter/v1/securitycenter_service.proto", - "../../protos/google/cloud/securitycenter/v1/source.proto" + "../../protos/google/cloud/securitycenter/v1/source.proto", + "../../protos/google/cloud/securitycenter/v1/vulnerability.proto" ] diff --git a/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.ts b/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.ts index 3b93e9ee0c1..4e8d9ec896b 100644 --- a/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.ts +++ b/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.ts @@ -1994,7 +1994,8 @@ export class SecurityCenterClient { gax.routingHeader.fromParams({ parent: request.parent || '', }); - const callSettings = new gax.CallSettings(options); + const defaultCallSettings = this._defaults['groupAssets']; + const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.groupAssets.createStream( this.innerApiCalls.groupAssets as gax.GaxCall, @@ -2118,7 +2119,8 @@ export class SecurityCenterClient { parent: request.parent || '', }); options = options || {}; - const callSettings = new gax.CallSettings(options); + const defaultCallSettings = this._defaults['groupAssets']; + const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.groupAssets.asyncIterate( this.innerApiCalls['groupAssets'] as GaxCall, @@ -2361,7 +2363,8 @@ export class SecurityCenterClient { gax.routingHeader.fromParams({ parent: request.parent || '', }); - const callSettings = new gax.CallSettings(options); + const defaultCallSettings = this._defaults['groupFindings']; + const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.groupFindings.createStream( this.innerApiCalls.groupFindings as gax.GaxCall, @@ -2460,7 +2463,8 @@ export class SecurityCenterClient { parent: request.parent || '', }); options = options || {}; - const callSettings = new gax.CallSettings(options); + const defaultCallSettings = this._defaults['groupFindings']; + const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.groupFindings.asyncIterate( this.innerApiCalls['groupFindings'] as GaxCall, @@ -2749,7 +2753,8 @@ export class SecurityCenterClient { gax.routingHeader.fromParams({ parent: request.parent || '', }); - const callSettings = new gax.CallSettings(options); + const defaultCallSettings = this._defaults['listAssets']; + const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listAssets.createStream( this.innerApiCalls.listAssets as gax.GaxCall, @@ -2873,7 +2878,8 @@ export class SecurityCenterClient { parent: request.parent || '', }); options = options || {}; - const callSettings = new gax.CallSettings(options); + const defaultCallSettings = this._defaults['listAssets']; + const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listAssets.asyncIterate( this.innerApiCalls['listAssets'] as GaxCall, @@ -3115,7 +3121,8 @@ export class SecurityCenterClient { gax.routingHeader.fromParams({ parent: request.parent || '', }); - const callSettings = new gax.CallSettings(options); + const defaultCallSettings = this._defaults['listFindings']; + const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listFindings.createStream( this.innerApiCalls.listFindings as gax.GaxCall, @@ -3214,7 +3221,8 @@ export class SecurityCenterClient { parent: request.parent || '', }); options = options || {}; - const callSettings = new gax.CallSettings(options); + const defaultCallSettings = this._defaults['listFindings']; + const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listFindings.asyncIterate( this.innerApiCalls['listFindings'] as GaxCall, @@ -3363,7 +3371,8 @@ export class SecurityCenterClient { gax.routingHeader.fromParams({ parent: request.parent || '', }); - const callSettings = new gax.CallSettings(options); + const defaultCallSettings = this._defaults['listSources']; + const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listSources.createStream( this.innerApiCalls.listSources as gax.GaxCall, @@ -3417,7 +3426,8 @@ export class SecurityCenterClient { parent: request.parent || '', }); options = options || {}; - const callSettings = new gax.CallSettings(options); + const defaultCallSettings = this._defaults['listSources']; + const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listSources.asyncIterate( this.innerApiCalls['listSources'] as GaxCall, diff --git a/packages/google-cloud-securitycenter/src/v1p1beta1/security_center_client.ts b/packages/google-cloud-securitycenter/src/v1p1beta1/security_center_client.ts index 862f4607248..f11ea946a70 100644 --- a/packages/google-cloud-securitycenter/src/v1p1beta1/security_center_client.ts +++ b/packages/google-cloud-securitycenter/src/v1p1beta1/security_center_client.ts @@ -2583,7 +2583,8 @@ export class SecurityCenterClient { gax.routingHeader.fromParams({ parent: request.parent || '', }); - const callSettings = new gax.CallSettings(options); + const defaultCallSettings = this._defaults['groupAssets']; + const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.groupAssets.createStream( this.innerApiCalls.groupAssets as gax.GaxCall, @@ -2753,7 +2754,8 @@ export class SecurityCenterClient { parent: request.parent || '', }); options = options || {}; - const callSettings = new gax.CallSettings(options); + const defaultCallSettings = this._defaults['groupAssets']; + const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.groupAssets.asyncIterate( this.innerApiCalls['groupAssets'] as GaxCall, @@ -3128,7 +3130,8 @@ export class SecurityCenterClient { gax.routingHeader.fromParams({ parent: request.parent || '', }); - const callSettings = new gax.CallSettings(options); + const defaultCallSettings = this._defaults['groupFindings']; + const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.groupFindings.createStream( this.innerApiCalls.groupFindings as gax.GaxCall, @@ -3292,7 +3295,8 @@ export class SecurityCenterClient { parent: request.parent || '', }); options = options || {}; - const callSettings = new gax.CallSettings(options); + const defaultCallSettings = this._defaults['groupFindings']; + const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.groupFindings.asyncIterate( this.innerApiCalls['groupFindings'] as GaxCall, @@ -3681,7 +3685,8 @@ export class SecurityCenterClient { gax.routingHeader.fromParams({ parent: request.parent || '', }); - const callSettings = new gax.CallSettings(options); + const defaultCallSettings = this._defaults['listAssets']; + const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listAssets.createStream( this.innerApiCalls.listAssets as gax.GaxCall, @@ -3855,7 +3860,8 @@ export class SecurityCenterClient { parent: request.parent || '', }); options = options || {}; - const callSettings = new gax.CallSettings(options); + const defaultCallSettings = this._defaults['listAssets']; + const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listAssets.asyncIterate( this.innerApiCalls['listAssets'] as GaxCall, @@ -4235,7 +4241,8 @@ export class SecurityCenterClient { gax.routingHeader.fromParams({ parent: request.parent || '', }); - const callSettings = new gax.CallSettings(options); + const defaultCallSettings = this._defaults['listFindings']; + const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listFindings.createStream( this.innerApiCalls.listFindings as gax.GaxCall, @@ -4403,7 +4410,8 @@ export class SecurityCenterClient { parent: request.parent || '', }); options = options || {}; - const callSettings = new gax.CallSettings(options); + const defaultCallSettings = this._defaults['listFindings']; + const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listFindings.asyncIterate( this.innerApiCalls['listFindings'] as GaxCall, @@ -4556,7 +4564,8 @@ export class SecurityCenterClient { gax.routingHeader.fromParams({ parent: request.parent || '', }); - const callSettings = new gax.CallSettings(options); + const defaultCallSettings = this._defaults['listNotificationConfigs']; + const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listNotificationConfigs.createStream( this.innerApiCalls.listNotificationConfigs as gax.GaxCall, @@ -4610,7 +4619,8 @@ export class SecurityCenterClient { parent: request.parent || '', }); options = options || {}; - const callSettings = new gax.CallSettings(options); + const defaultCallSettings = this._defaults['listNotificationConfigs']; + const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listNotificationConfigs.asyncIterate( this.innerApiCalls['listNotificationConfigs'] as GaxCall, @@ -4761,7 +4771,8 @@ export class SecurityCenterClient { gax.routingHeader.fromParams({ parent: request.parent || '', }); - const callSettings = new gax.CallSettings(options); + const defaultCallSettings = this._defaults['listSources']; + const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listSources.createStream( this.innerApiCalls.listSources as gax.GaxCall, @@ -4816,7 +4827,8 @@ export class SecurityCenterClient { parent: request.parent || '', }); options = options || {}; - const callSettings = new gax.CallSettings(options); + const defaultCallSettings = this._defaults['listSources']; + const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listSources.asyncIterate( this.innerApiCalls['listSources'] as GaxCall, From 8f67df0e801f3fd17c429d4b7215368af4ca09ba Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Thu, 14 Oct 2021 16:26:16 +0000 Subject: [PATCH 279/342] chore: release 5.6.0 (#430) :robot: I have created a release \*beep\* \*boop\* --- ## [5.6.0](https://www.github.com/googleapis/nodejs-security-center/compare/v5.5.1...v5.6.0) (2021-10-14) ### Features * Added type field to the resource which is surfaced in NotificationMessage ([#428](https://www.github.com/googleapis/nodejs-security-center/issues/428)) ([924aaec](https://www.github.com/googleapis/nodejs-security-center/commit/924aaec714aec659a2cff0c995a00a9a269ca9d6)) * Added vulnerability field to the finding ([924aaec](https://www.github.com/googleapis/nodejs-security-center/commit/924aaec714aec659a2cff0c995a00a9a269ca9d6)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- packages/google-cloud-securitycenter/CHANGELOG.md | 8 ++++++++ packages/google-cloud-securitycenter/package.json | 2 +- packages/google-cloud-securitycenter/samples/package.json | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-securitycenter/CHANGELOG.md b/packages/google-cloud-securitycenter/CHANGELOG.md index d1fe23c87d3..865066c310f 100644 --- a/packages/google-cloud-securitycenter/CHANGELOG.md +++ b/packages/google-cloud-securitycenter/CHANGELOG.md @@ -4,6 +4,14 @@ [1]: https://www.npmjs.com/package/@google-cloud/security-center?activeTab=versions +## [5.6.0](https://www.github.com/googleapis/nodejs-security-center/compare/v5.5.1...v5.6.0) (2021-10-14) + + +### Features + +* Added type field to the resource which is surfaced in NotificationMessage ([#428](https://www.github.com/googleapis/nodejs-security-center/issues/428)) ([924aaec](https://www.github.com/googleapis/nodejs-security-center/commit/924aaec714aec659a2cff0c995a00a9a269ca9d6)) +* Added vulnerability field to the finding ([924aaec](https://www.github.com/googleapis/nodejs-security-center/commit/924aaec714aec659a2cff0c995a00a9a269ca9d6)) + ### [5.5.1](https://www.github.com/googleapis/nodejs-security-center/compare/v5.5.0...v5.5.1) (2021-09-10) diff --git a/packages/google-cloud-securitycenter/package.json b/packages/google-cloud-securitycenter/package.json index be703c1cb86..bbf8ba9bad4 100644 --- a/packages/google-cloud-securitycenter/package.json +++ b/packages/google-cloud-securitycenter/package.json @@ -1,7 +1,7 @@ { "name": "@google-cloud/security-center", "description": "Cloud Security Command Center API client for Node.js", - "version": "5.5.1", + "version": "5.6.0", "license": "Apache-2.0", "author": "Google LLC", "engines": { diff --git a/packages/google-cloud-securitycenter/samples/package.json b/packages/google-cloud-securitycenter/samples/package.json index 4c50c616c4e..01e334e0a06 100644 --- a/packages/google-cloud-securitycenter/samples/package.json +++ b/packages/google-cloud-securitycenter/samples/package.json @@ -14,7 +14,7 @@ "license": "Apache-2.0", "dependencies": { "@google-cloud/pubsub": "^2.0.0", - "@google-cloud/security-center": "^5.5.1" + "@google-cloud/security-center": "^5.6.0" }, "devDependencies": { "chai": "^4.2.0", From b82a473f2e5c327dbaa377a279c0614427bff2c4 Mon Sep 17 00:00:00 2001 From: "F. Hinkelmann" Date: Thu, 21 Oct 2021 11:30:31 -0400 Subject: [PATCH 280/342] chore(cloud-rad): delete api-extractor config (#431) --- .../api-extractor.json | 369 ------------------ 1 file changed, 369 deletions(-) delete mode 100644 packages/google-cloud-securitycenter/api-extractor.json diff --git a/packages/google-cloud-securitycenter/api-extractor.json b/packages/google-cloud-securitycenter/api-extractor.json deleted file mode 100644 index de228294b23..00000000000 --- a/packages/google-cloud-securitycenter/api-extractor.json +++ /dev/null @@ -1,369 +0,0 @@ -/** - * Config file for API Extractor. For more info, please visit: https://api-extractor.com - */ -{ - "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", - - /** - * Optionally specifies another JSON config file that this file extends from. This provides a way for - * standard settings to be shared across multiple projects. - * - * If the path starts with "./" or "../", the path is resolved relative to the folder of the file that contains - * the "extends" field. Otherwise, the first path segment is interpreted as an NPM package name, and will be - * resolved using NodeJS require(). - * - * SUPPORTED TOKENS: none - * DEFAULT VALUE: "" - */ - // "extends": "./shared/api-extractor-base.json" - // "extends": "my-package/include/api-extractor-base.json" - - /** - * Determines the "" token that can be used with other config file settings. The project folder - * typically contains the tsconfig.json and package.json config files, but the path is user-defined. - * - * The path is resolved relative to the folder of the config file that contains the setting. - * - * The default value for "projectFolder" is the token "", which means the folder is determined by traversing - * parent folders, starting from the folder containing api-extractor.json, and stopping at the first folder - * that contains a tsconfig.json file. If a tsconfig.json file cannot be found in this way, then an error - * will be reported. - * - * SUPPORTED TOKENS: - * DEFAULT VALUE: "" - */ - // "projectFolder": "..", - - /** - * (REQUIRED) Specifies the .d.ts file to be used as the starting point for analysis. API Extractor - * analyzes the symbols exported by this module. - * - * The file extension must be ".d.ts" and not ".ts". - * - * The path is resolved relative to the folder of the config file that contains the setting; to change this, - * prepend a folder token such as "". - * - * SUPPORTED TOKENS: , , - */ - "mainEntryPointFilePath": "/protos/protos.d.ts", - - /** - * A list of NPM package names whose exports should be treated as part of this package. - * - * For example, suppose that Webpack is used to generate a distributed bundle for the project "library1", - * and another NPM package "library2" is embedded in this bundle. Some types from library2 may become part - * of the exported API for library1, but by default API Extractor would generate a .d.ts rollup that explicitly - * imports library2. To avoid this, we can specify: - * - * "bundledPackages": [ "library2" ], - * - * This would direct API Extractor to embed those types directly in the .d.ts rollup, as if they had been - * local files for library1. - */ - "bundledPackages": [ ], - - /** - * Determines how the TypeScript compiler engine will be invoked by API Extractor. - */ - "compiler": { - /** - * Specifies the path to the tsconfig.json file to be used by API Extractor when analyzing the project. - * - * The path is resolved relative to the folder of the config file that contains the setting; to change this, - * prepend a folder token such as "". - * - * Note: This setting will be ignored if "overrideTsconfig" is used. - * - * SUPPORTED TOKENS: , , - * DEFAULT VALUE: "/tsconfig.json" - */ - // "tsconfigFilePath": "/tsconfig.json", - - /** - * Provides a compiler configuration that will be used instead of reading the tsconfig.json file from disk. - * The object must conform to the TypeScript tsconfig schema: - * - * http://json.schemastore.org/tsconfig - * - * If omitted, then the tsconfig.json file will be read from the "projectFolder". - * - * DEFAULT VALUE: no overrideTsconfig section - */ - // "overrideTsconfig": { - // . . . - // } - - /** - * This option causes the compiler to be invoked with the --skipLibCheck option. This option is not recommended - * and may cause API Extractor to produce incomplete or incorrect declarations, but it may be required when - * dependencies contain declarations that are incompatible with the TypeScript engine that API Extractor uses - * for its analysis. Where possible, the underlying issue should be fixed rather than relying on skipLibCheck. - * - * DEFAULT VALUE: false - */ - // "skipLibCheck": true, - }, - - /** - * Configures how the API report file (*.api.md) will be generated. - */ - "apiReport": { - /** - * (REQUIRED) Whether to generate an API report. - */ - "enabled": true, - - /** - * The filename for the API report files. It will be combined with "reportFolder" or "reportTempFolder" to produce - * a full file path. - * - * The file extension should be ".api.md", and the string should not contain a path separator such as "\" or "/". - * - * SUPPORTED TOKENS: , - * DEFAULT VALUE: ".api.md" - */ - // "reportFileName": ".api.md", - - /** - * Specifies the folder where the API report file is written. The file name portion is determined by - * the "reportFileName" setting. - * - * The API report file is normally tracked by Git. Changes to it can be used to trigger a branch policy, - * e.g. for an API review. - * - * The path is resolved relative to the folder of the config file that contains the setting; to change this, - * prepend a folder token such as "". - * - * SUPPORTED TOKENS: , , - * DEFAULT VALUE: "/etc/" - */ - // "reportFolder": "/etc/", - - /** - * Specifies the folder where the temporary report file is written. The file name portion is determined by - * the "reportFileName" setting. - * - * After the temporary file is written to disk, it is compared with the file in the "reportFolder". - * If they are different, a production build will fail. - * - * The path is resolved relative to the folder of the config file that contains the setting; to change this, - * prepend a folder token such as "". - * - * SUPPORTED TOKENS: , , - * DEFAULT VALUE: "/temp/" - */ - // "reportTempFolder": "/temp/" - }, - - /** - * Configures how the doc model file (*.api.json) will be generated. - */ - "docModel": { - /** - * (REQUIRED) Whether to generate a doc model file. - */ - "enabled": true, - - /** - * The output path for the doc model file. The file extension should be ".api.json". - * - * The path is resolved relative to the folder of the config file that contains the setting; to change this, - * prepend a folder token such as "". - * - * SUPPORTED TOKENS: , , - * DEFAULT VALUE: "/temp/.api.json" - */ - // "apiJsonFilePath": "/temp/.api.json" - }, - - /** - * Configures how the .d.ts rollup file will be generated. - */ - "dtsRollup": { - /** - * (REQUIRED) Whether to generate the .d.ts rollup file. - */ - "enabled": true, - - /** - * Specifies the output path for a .d.ts rollup file to be generated without any trimming. - * This file will include all declarations that are exported by the main entry point. - * - * If the path is an empty string, then this file will not be written. - * - * The path is resolved relative to the folder of the config file that contains the setting; to change this, - * prepend a folder token such as "". - * - * SUPPORTED TOKENS: , , - * DEFAULT VALUE: "/dist/.d.ts" - */ - // "untrimmedFilePath": "/dist/.d.ts", - - /** - * Specifies the output path for a .d.ts rollup file to be generated with trimming for a "beta" release. - * This file will include only declarations that are marked as "@public" or "@beta". - * - * The path is resolved relative to the folder of the config file that contains the setting; to change this, - * prepend a folder token such as "". - * - * SUPPORTED TOKENS: , , - * DEFAULT VALUE: "" - */ - // "betaTrimmedFilePath": "/dist/-beta.d.ts", - - - /** - * Specifies the output path for a .d.ts rollup file to be generated with trimming for a "public" release. - * This file will include only declarations that are marked as "@public". - * - * If the path is an empty string, then this file will not be written. - * - * The path is resolved relative to the folder of the config file that contains the setting; to change this, - * prepend a folder token such as "". - * - * SUPPORTED TOKENS: , , - * DEFAULT VALUE: "" - */ - // "publicTrimmedFilePath": "/dist/-public.d.ts", - - /** - * When a declaration is trimmed, by default it will be replaced by a code comment such as - * "Excluded from this release type: exampleMember". Set "omitTrimmingComments" to true to remove the - * declaration completely. - * - * DEFAULT VALUE: false - */ - // "omitTrimmingComments": true - }, - - /** - * Configures how the tsdoc-metadata.json file will be generated. - */ - "tsdocMetadata": { - /** - * Whether to generate the tsdoc-metadata.json file. - * - * DEFAULT VALUE: true - */ - // "enabled": true, - - /** - * Specifies where the TSDoc metadata file should be written. - * - * The path is resolved relative to the folder of the config file that contains the setting; to change this, - * prepend a folder token such as "". - * - * The default value is "", which causes the path to be automatically inferred from the "tsdocMetadata", - * "typings" or "main" fields of the project's package.json. If none of these fields are set, the lookup - * falls back to "tsdoc-metadata.json" in the package folder. - * - * SUPPORTED TOKENS: , , - * DEFAULT VALUE: "" - */ - // "tsdocMetadataFilePath": "/dist/tsdoc-metadata.json" - }, - - /** - * Specifies what type of newlines API Extractor should use when writing output files. By default, the output files - * will be written with Windows-style newlines. To use POSIX-style newlines, specify "lf" instead. - * To use the OS's default newline kind, specify "os". - * - * DEFAULT VALUE: "crlf" - */ - // "newlineKind": "crlf", - - /** - * Configures how API Extractor reports error and warning messages produced during analysis. - * - * There are three sources of messages: compiler messages, API Extractor messages, and TSDoc messages. - */ - "messages": { - /** - * Configures handling of diagnostic messages reported by the TypeScript compiler engine while analyzing - * the input .d.ts files. - * - * TypeScript message identifiers start with "TS" followed by an integer. For example: "TS2551" - * - * DEFAULT VALUE: A single "default" entry with logLevel=warning. - */ - "compilerMessageReporting": { - /** - * Configures the default routing for messages that don't match an explicit rule in this table. - */ - "default": { - /** - * Specifies whether the message should be written to the the tool's output log. Note that - * the "addToApiReportFile" property may supersede this option. - * - * Possible values: "error", "warning", "none" - * - * Errors cause the build to fail and return a nonzero exit code. Warnings cause a production build fail - * and return a nonzero exit code. For a non-production build (e.g. when "api-extractor run" includes - * the "--local" option), the warning is displayed but the build will not fail. - * - * DEFAULT VALUE: "warning" - */ - "logLevel": "warning", - - /** - * When addToApiReportFile is true: If API Extractor is configured to write an API report file (.api.md), - * then the message will be written inside that file; otherwise, the message is instead logged according to - * the "logLevel" option. - * - * DEFAULT VALUE: false - */ - // "addToApiReportFile": false - }, - - // "TS2551": { - // "logLevel": "warning", - // "addToApiReportFile": true - // }, - // - // . . . - }, - - /** - * Configures handling of messages reported by API Extractor during its analysis. - * - * API Extractor message identifiers start with "ae-". For example: "ae-extra-release-tag" - * - * DEFAULT VALUE: See api-extractor-defaults.json for the complete table of extractorMessageReporting mappings - */ - "extractorMessageReporting": { - "default": { - "logLevel": "warning", - // "addToApiReportFile": false - }, - - // "ae-extra-release-tag": { - // "logLevel": "warning", - // "addToApiReportFile": true - // }, - // - // . . . - }, - - /** - * Configures handling of messages reported by the TSDoc parser when analyzing code comments. - * - * TSDoc message identifiers start with "tsdoc-". For example: "tsdoc-link-tag-unescaped-text" - * - * DEFAULT VALUE: A single "default" entry with logLevel=warning. - */ - "tsdocMessageReporting": { - "default": { - "logLevel": "warning", - // "addToApiReportFile": false - } - - // "tsdoc-link-tag-unescaped-text": { - // "logLevel": "warning", - // "addToApiReportFile": true - // }, - // - // . . . - } - } - -} From 4cf93c2e73645cd9d2995f07d23e00824dac24df Mon Sep 17 00:00:00 2001 From: Takashi Matsuo Date: Wed, 27 Oct 2021 11:42:14 -0700 Subject: [PATCH 281/342] chore: fix the wrong post processor image (#433) --- packages/google-cloud-securitycenter/.github/.OwlBot.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-securitycenter/.github/.OwlBot.yaml b/packages/google-cloud-securitycenter/.github/.OwlBot.yaml index 4b9917134e3..0302714c19c 100644 --- a/packages/google-cloud-securitycenter/.github/.OwlBot.yaml +++ b/packages/google-cloud-securitycenter/.github/.OwlBot.yaml @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. docker: - image: gcr.io/repo-automation-bots/owlbot-nodejs:latest + image: gcr.io/cloud-devrel-public-resources/owlbot-nodejs:latest deep-remove-regex: From b91dce08f12084ce042cea894c705c03bb3b9668 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 27 Oct 2021 21:38:22 +0200 Subject: [PATCH 282/342] chore(deps): update dependency @types/node to v16 (#432) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [@types/node](https://togithub.com/DefinitelyTyped/DefinitelyTyped) | [`^14.0.0` -> `^16.0.0`](https://renovatebot.com/diffs/npm/@types%2fnode/14.17.32/16.11.6) | [![age](https://badges.renovateapi.com/packages/npm/@types%2fnode/16.11.6/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/@types%2fnode/16.11.6/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/@types%2fnode/16.11.6/compatibility-slim/14.17.32)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/@types%2fnode/16.11.6/confidence-slim/14.17.32)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration 📅 **Schedule**: "after 9am and before 3pm" (UTC). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/nodejs-security-center). --- packages/google-cloud-securitycenter/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-securitycenter/package.json b/packages/google-cloud-securitycenter/package.json index bbf8ba9bad4..f95274a68f2 100644 --- a/packages/google-cloud-securitycenter/package.json +++ b/packages/google-cloud-securitycenter/package.json @@ -46,7 +46,7 @@ }, "devDependencies": { "@types/mocha": "^8.0.0", - "@types/node": "^14.0.0", + "@types/node": "^16.0.0", "@types/sinon": "^10.0.0", "c8": "^7.0.0", "gts": "^3.0.0", From 7e0a394f9c27f2e8217af56e2a49285d4873c7f5 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 4 Nov 2021 20:42:11 +0100 Subject: [PATCH 283/342] chore(deps): update dependency sinon to v12 (#434) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [sinon](https://sinonjs.org/) ([source](https://togithub.com/sinonjs/sinon)) | [`^11.0.0` -> `^12.0.0`](https://renovatebot.com/diffs/npm/sinon/11.1.2/12.0.1) | [![age](https://badges.renovateapi.com/packages/npm/sinon/12.0.1/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/sinon/12.0.1/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/sinon/12.0.1/compatibility-slim/11.1.2)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/sinon/12.0.1/confidence-slim/11.1.2)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
sinonjs/sinon ### [`v12.0.1`](https://togithub.com/sinonjs/sinon/blob/master/CHANGES.md#​1201) [Compare Source](https://togithub.com/sinonjs/sinon/compare/v12.0.0...v12.0.1) - [`3f598221`](https://togithub.com/sinonjs/sinon/commit/3f598221045904681f2b3b3ba1df617ed5e230e3) Fix issue with npm unlink for npm version > 6 (Carl-Erik Kopseng) > 'npm unlink' would implicitly unlink the current dir > until version 7, which requires an argument - [`51417a38`](https://togithub.com/sinonjs/sinon/commit/51417a38111eeeb7cd14338bfb762cc2df487e1b) Fix bundling of cjs module ([#​2412](https://togithub.com/sinonjs/sinon/issues/2412)) (Julian Grinblat) > - Fix bundling of cjs module > > - Run prettier *Released by [Carl-Erik Kopseng](https://togithub.com/fatso83) on 2021-11-04.* #### 12.0.0 ### [`v12.0.0`](https://togithub.com/sinonjs/sinon/compare/v11.1.2...v12.0.0) [Compare Source](https://togithub.com/sinonjs/sinon/compare/v11.1.2...v12.0.0)
--- ### Configuration 📅 **Schedule**: "after 9am and before 3pm" (UTC). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/nodejs-security-center). --- packages/google-cloud-securitycenter/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-securitycenter/package.json b/packages/google-cloud-securitycenter/package.json index f95274a68f2..acd9d9df11e 100644 --- a/packages/google-cloud-securitycenter/package.json +++ b/packages/google-cloud-securitycenter/package.json @@ -57,7 +57,7 @@ "mocha": "^8.0.0", "null-loader": "^4.0.0", "pack-n-play": "^1.0.0-2", - "sinon": "^11.0.0", + "sinon": "^12.0.0", "ts-loader": "^8.0.0", "typescript": "^3.8.3" } From d9f4f5cd87a2d12d0cdd1ee7e23f83f02f84812a Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Wed, 10 Nov 2021 21:34:27 +0000 Subject: [PATCH 284/342] docs(samples): add example tags to generated samples (#436) - [ ] Regenerate this pull request now. PiperOrigin-RevId: 408439482 Source-Link: https://github.com/googleapis/googleapis/commit/b9f61843dc80c7c285fc34fd3a40aae55082c2b9 Source-Link: https://github.com/googleapis/googleapis-gen/commit/eb888bc214efc7bf43bf4634b470254565a659a5 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZWI4ODhiYzIxNGVmYzdiZjQzYmY0NjM0YjQ3MDI1NDU2NWE2NTlhNSJ9 --- .../linkinator.config.json | 2 +- .../cloud/securitycenter/v1/resource.proto | 3 + .../v1/securitycenter_service.proto | 7 + .../protos/protos.d.ts | 18 + .../protos/protos.js | 66 + .../protos/protos.json | 12 + .../v1/security_center.create_finding.js | 6 +- ...urity_center.create_notification_config.js | 6 +- .../v1/security_center.create_source.js | 6 +- ...urity_center.delete_notification_config.js | 4 +- .../v1/security_center.get_iam_policy.js | 6 +- ...security_center.get_notification_config.js | 4 +- ...curity_center.get_organization_settings.js | 4 +- .../v1/security_center.get_source.js | 4 +- .../v1/security_center.group_assets.js | 8 +- .../v1/security_center.group_findings.js | 8 +- .../v1/security_center.list_assets.js | 10 +- .../v1/security_center.list_findings.js | 11 +- ...curity_center.list_notification_configs.js | 4 +- .../v1/security_center.list_sources.js | 4 +- .../v1/security_center.run_asset_discovery.js | 4 +- .../v1/security_center.set_finding_state.js | 8 +- .../v1/security_center.set_iam_policy.js | 6 +- .../security_center.test_iam_permissions.js | 6 +- .../v1/security_center.update_finding.js | 8 +- ...urity_center.update_notification_config.js | 8 +- ...ity_center.update_organization_settings.js | 8 +- .../security_center.update_security_marks.js | 10 +- .../v1/security_center.update_source.js | 8 +- .../v1beta1/security_center.create_finding.js | 6 +- .../v1beta1/security_center.create_source.js | 6 +- .../v1beta1/security_center.get_iam_policy.js | 6 +- ...curity_center.get_organization_settings.js | 4 +- .../v1beta1/security_center.get_source.js | 4 +- .../v1beta1/security_center.group_assets.js | 8 +- .../v1beta1/security_center.group_findings.js | 6 +- .../v1beta1/security_center.list_assets.js | 10 +- .../v1beta1/security_center.list_findings.js | 8 +- .../v1beta1/security_center.list_sources.js | 4 +- .../security_center.run_asset_discovery.js | 4 +- .../security_center.set_finding_state.js | 8 +- .../v1beta1/security_center.set_iam_policy.js | 6 +- .../security_center.test_iam_permissions.js | 6 +- .../v1beta1/security_center.update_finding.js | 8 +- ...ity_center.update_organization_settings.js | 8 +- .../security_center.update_security_marks.js | 10 +- .../v1beta1/security_center.update_source.js | 8 +- .../security_center.create_finding.js | 6 +- ...urity_center.create_notification_config.js | 6 +- .../security_center.create_source.js | 6 +- ...urity_center.delete_notification_config.js | 4 +- .../security_center.get_iam_policy.js | 6 +- ...security_center.get_notification_config.js | 4 +- ...curity_center.get_organization_settings.js | 4 +- .../v1p1beta1/security_center.get_source.js | 4 +- .../v1p1beta1/security_center.group_assets.js | 8 +- .../security_center.group_findings.js | 8 +- .../v1p1beta1/security_center.list_assets.js | 10 +- .../security_center.list_findings.js | 10 +- ...curity_center.list_notification_configs.js | 4 +- .../v1p1beta1/security_center.list_sources.js | 4 +- .../security_center.run_asset_discovery.js | 4 +- .../security_center.set_finding_state.js | 8 +- .../security_center.set_iam_policy.js | 6 +- .../security_center.test_iam_permissions.js | 6 +- .../security_center.update_finding.js | 8 +- ...urity_center.update_notification_config.js | 8 +- ...ity_center.update_organization_settings.js | 8 +- .../security_center.update_security_marks.js | 10 +- .../security_center.update_source.js | 8 +- .../src/v1/security_center_client.ts | 1209 ++++++++--------- .../src/v1beta1/security_center_client.ts | 926 ++++++------- .../src/v1p1beta1/security_center_client.ts | 1198 ++++++++-------- 73 files changed, 1946 insertions(+), 1916 deletions(-) diff --git a/packages/google-cloud-securitycenter/linkinator.config.json b/packages/google-cloud-securitycenter/linkinator.config.json index 29a223b6db6..0121dfa684f 100644 --- a/packages/google-cloud-securitycenter/linkinator.config.json +++ b/packages/google-cloud-securitycenter/linkinator.config.json @@ -6,5 +6,5 @@ "img.shields.io" ], "silent": true, - "concurrency": 10 + "concurrency": 5 } diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/resource.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/resource.proto index 494b8bdc52d..8377329ebac 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/resource.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/resource.proto @@ -53,4 +53,7 @@ message Resource { // The first folder is the deepest nested folder, and the last folder is the // folder directly under the Organization. repeated Folder folders = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The human readable name of the resource. + string display_name = 8; } diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/securitycenter_service.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/securitycenter_service.proto index 0392de5ce3c..89f89a0cd99 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/securitycenter_service.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/securitycenter_service.proto @@ -1108,6 +1108,7 @@ message ListFindingsRequest { // * resource.project_display_name: `=`, `:` // * resource.type: `=`, `:` // * resource.folders.resource_folder: `=`, `:` + // * resource.display_name: `=`, `:` string filter = 2; // Expression that defines what fields and order to use for sorting. The @@ -1205,10 +1206,16 @@ message ListFindingsResponse { // The human readable name of resource's parent. string parent_display_name = 5; + // The full resource type of the resource. + string type = 6; + // Contains a Folder message for each folder in the assets ancestry. // The first folder is the deepest nested folder, and the last folder is // the folder directly under the Organization. repeated Folder folders = 7; + + // The human readable name of the resource. + string display_name = 8; } // The change in state of the finding. diff --git a/packages/google-cloud-securitycenter/protos/protos.d.ts b/packages/google-cloud-securitycenter/protos/protos.d.ts index ef46c7b3006..dffff7336a1 100644 --- a/packages/google-cloud-securitycenter/protos/protos.d.ts +++ b/packages/google-cloud-securitycenter/protos/protos.d.ts @@ -1698,6 +1698,9 @@ export namespace google { /** Resource folders */ folders?: (google.cloud.securitycenter.v1.IFolder[]|null); + + /** Resource displayName */ + displayName?: (string|null); } /** Represents a Resource. */ @@ -1730,6 +1733,9 @@ export namespace google { /** Resource folders. */ public folders: google.cloud.securitycenter.v1.IFolder[]; + /** Resource displayName. */ + public displayName: string; + /** * Creates a new Resource instance using the specified properties. * @param [properties] Properties to set @@ -4966,8 +4972,14 @@ export namespace google { /** Resource parentDisplayName */ parentDisplayName?: (string|null); + /** Resource type */ + type?: (string|null); + /** Resource folders */ folders?: (google.cloud.securitycenter.v1.IFolder[]|null); + + /** Resource displayName */ + displayName?: (string|null); } /** Represents a Resource. */ @@ -4994,9 +5006,15 @@ export namespace google { /** Resource parentDisplayName. */ public parentDisplayName: string; + /** Resource type. */ + public type: string; + /** Resource folders. */ public folders: google.cloud.securitycenter.v1.IFolder[]; + /** Resource displayName. */ + public displayName: string; + /** * Creates a new Resource instance using the specified properties. * @param [properties] Properties to set diff --git a/packages/google-cloud-securitycenter/protos/protos.js b/packages/google-cloud-securitycenter/protos/protos.js index ee76c255d2d..9690fb96359 100644 --- a/packages/google-cloud-securitycenter/protos/protos.js +++ b/packages/google-cloud-securitycenter/protos/protos.js @@ -4546,6 +4546,7 @@ * @property {string|null} [parentDisplayName] Resource parentDisplayName * @property {string|null} [type] Resource type * @property {Array.|null} [folders] Resource folders + * @property {string|null} [displayName] Resource displayName */ /** @@ -4620,6 +4621,14 @@ */ Resource.prototype.folders = $util.emptyArray; + /** + * Resource displayName. + * @member {string} displayName + * @memberof google.cloud.securitycenter.v1.Resource + * @instance + */ + Resource.prototype.displayName = ""; + /** * Creates a new Resource instance using the specified properties. * @function create @@ -4659,6 +4668,8 @@ if (message.folders != null && message.folders.length) for (var i = 0; i < message.folders.length; ++i) $root.google.cloud.securitycenter.v1.Folder.encode(message.folders[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.displayName); return writer; }; @@ -4716,6 +4727,9 @@ message.folders = []; message.folders.push($root.google.cloud.securitycenter.v1.Folder.decode(reader, reader.uint32())); break; + case 8: + message.displayName = reader.string(); + break; default: reader.skipType(tag & 7); break; @@ -4778,6 +4792,9 @@ return "folders." + error; } } + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; return null; }; @@ -4815,6 +4832,8 @@ message.folders[i] = $root.google.cloud.securitycenter.v1.Folder.fromObject(object.folders[i]); } } + if (object.displayName != null) + message.displayName = String(object.displayName); return message; }; @@ -4840,6 +4859,7 @@ object.parent = ""; object.parentDisplayName = ""; object.type = ""; + object.displayName = ""; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -4858,6 +4878,8 @@ for (var j = 0; j < message.folders.length; ++j) object.folders[j] = $root.google.cloud.securitycenter.v1.Folder.toObject(message.folders[j], options); } + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; return object; }; @@ -12119,7 +12141,9 @@ * @property {string|null} [projectDisplayName] Resource projectDisplayName * @property {string|null} [parentName] Resource parentName * @property {string|null} [parentDisplayName] Resource parentDisplayName + * @property {string|null} [type] Resource type * @property {Array.|null} [folders] Resource folders + * @property {string|null} [displayName] Resource displayName */ /** @@ -12178,6 +12202,14 @@ */ Resource.prototype.parentDisplayName = ""; + /** + * Resource type. + * @member {string} type + * @memberof google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource + * @instance + */ + Resource.prototype.type = ""; + /** * Resource folders. * @member {Array.} folders @@ -12186,6 +12218,14 @@ */ Resource.prototype.folders = $util.emptyArray; + /** + * Resource displayName. + * @member {string} displayName + * @memberof google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource + * @instance + */ + Resource.prototype.displayName = ""; + /** * Creates a new Resource instance using the specified properties. * @function create @@ -12220,9 +12260,13 @@ writer.uint32(/* id 4, wireType 2 =*/34).string(message.parentName); if (message.parentDisplayName != null && Object.hasOwnProperty.call(message, "parentDisplayName")) writer.uint32(/* id 5, wireType 2 =*/42).string(message.parentDisplayName); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.type); if (message.folders != null && message.folders.length) for (var i = 0; i < message.folders.length; ++i) $root.google.cloud.securitycenter.v1.Folder.encode(message.folders[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.displayName); return writer; }; @@ -12272,11 +12316,17 @@ case 5: message.parentDisplayName = reader.string(); break; + case 6: + message.type = reader.string(); + break; case 7: if (!(message.folders && message.folders.length)) message.folders = []; message.folders.push($root.google.cloud.securitycenter.v1.Folder.decode(reader, reader.uint32())); break; + case 8: + message.displayName = reader.string(); + break; default: reader.skipType(tag & 7); break; @@ -12327,6 +12377,9 @@ if (message.parentDisplayName != null && message.hasOwnProperty("parentDisplayName")) if (!$util.isString(message.parentDisplayName)) return "parentDisplayName: string expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; if (message.folders != null && message.hasOwnProperty("folders")) { if (!Array.isArray(message.folders)) return "folders: array expected"; @@ -12336,6 +12389,9 @@ return "folders." + error; } } + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; return null; }; @@ -12361,6 +12417,8 @@ message.parentName = String(object.parentName); if (object.parentDisplayName != null) message.parentDisplayName = String(object.parentDisplayName); + if (object.type != null) + message.type = String(object.type); if (object.folders) { if (!Array.isArray(object.folders)) throw TypeError(".google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource.folders: array expected"); @@ -12371,6 +12429,8 @@ message.folders[i] = $root.google.cloud.securitycenter.v1.Folder.fromObject(object.folders[i]); } } + if (object.displayName != null) + message.displayName = String(object.displayName); return message; }; @@ -12395,6 +12455,8 @@ object.projectDisplayName = ""; object.parentName = ""; object.parentDisplayName = ""; + object.type = ""; + object.displayName = ""; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -12406,11 +12468,15 @@ object.parentName = message.parentName; if (message.parentDisplayName != null && message.hasOwnProperty("parentDisplayName")) object.parentDisplayName = message.parentDisplayName; + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; if (message.folders && message.folders.length) { object.folders = []; for (var j = 0; j < message.folders.length; ++j) object.folders[j] = $root.google.cloud.securitycenter.v1.Folder.toObject(message.folders[j], options); } + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; return object; }; diff --git a/packages/google-cloud-securitycenter/protos/protos.json b/packages/google-cloud-securitycenter/protos/protos.json index dd8803b9b8b..5f68213c94f 100644 --- a/packages/google-cloud-securitycenter/protos/protos.json +++ b/packages/google-cloud-securitycenter/protos/protos.json @@ -490,6 +490,10 @@ "options": { "(google.api.field_behavior)": "OUTPUT_ONLY" } + }, + "displayName": { + "type": "string", + "id": 8 } } }, @@ -1622,10 +1626,18 @@ "type": "string", "id": 5 }, + "type": { + "type": "string", + "id": 6 + }, "folders": { "rule": "repeated", "type": "Folder", "id": 7 + }, + "displayName": { + "type": "string", + "id": 8 } } }, diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.create_finding.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.create_finding.js index 14fef7d24c3..c64eec76825 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.create_finding.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.create_finding.js @@ -34,7 +34,7 @@ function main(parent, findingId, finding) { * Required. The Finding being created. The name and security_marks will be ignored as * they are both output only fields on this resource. */ - // const finding = '' + // const finding = {} // Imports the Securitycenter library const {SecurityCenterClient} = require('@google-cloud/security-center').v1; @@ -42,7 +42,7 @@ function main(parent, findingId, finding) { // Instantiates a client const securitycenterClient = new SecurityCenterClient(); - async function createFinding() { + async function callCreateFinding() { // Construct request const request = { parent, @@ -55,7 +55,7 @@ function main(parent, findingId, finding) { console.log(response); } - createFinding(); + callCreateFinding(); // [END securitycenter_v1_generated_SecurityCenter_CreateFinding_async] } diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.create_notification_config.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.create_notification_config.js index 12414cea813..612baaa49fb 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.create_notification_config.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.create_notification_config.js @@ -35,7 +35,7 @@ function main(parent, configId, notificationConfig) { * Required. The notification config being created. The name and the service account * will be ignored as they are both output only fields on this resource. */ - // const notificationConfig = '' + // const notificationConfig = {} // Imports the Securitycenter library const {SecurityCenterClient} = require('@google-cloud/security-center').v1; @@ -43,7 +43,7 @@ function main(parent, configId, notificationConfig) { // Instantiates a client const securitycenterClient = new SecurityCenterClient(); - async function createNotificationConfig() { + async function callCreateNotificationConfig() { // Construct request const request = { parent, @@ -58,7 +58,7 @@ function main(parent, configId, notificationConfig) { console.log(response); } - createNotificationConfig(); + callCreateNotificationConfig(); // [END securitycenter_v1_generated_SecurityCenter_CreateNotificationConfig_async] } diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.create_source.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.create_source.js index 5cb669a5755..2bbe843ca2f 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.create_source.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.create_source.js @@ -28,7 +28,7 @@ function main(parent, source) { * Required. The Source being created, only the display_name and description will be * used. All other fields will be ignored. */ - // const source = '' + // const source = {} // Imports the Securitycenter library const {SecurityCenterClient} = require('@google-cloud/security-center').v1; @@ -36,7 +36,7 @@ function main(parent, source) { // Instantiates a client const securitycenterClient = new SecurityCenterClient(); - async function createSource() { + async function callCreateSource() { // Construct request const request = { parent, @@ -48,7 +48,7 @@ function main(parent, source) { console.log(response); } - createSource(); + callCreateSource(); // [END securitycenter_v1_generated_SecurityCenter_CreateSource_async] } diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.delete_notification_config.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.delete_notification_config.js index 9169320b951..5bbaf9c02f3 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.delete_notification_config.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.delete_notification_config.js @@ -31,7 +31,7 @@ function main(name) { // Instantiates a client const securitycenterClient = new SecurityCenterClient(); - async function deleteNotificationConfig() { + async function callDeleteNotificationConfig() { // Construct request const request = { name, @@ -44,7 +44,7 @@ function main(name) { console.log(response); } - deleteNotificationConfig(); + callDeleteNotificationConfig(); // [END securitycenter_v1_generated_SecurityCenter_DeleteNotificationConfig_async] } diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_iam_policy.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_iam_policy.js index d48f7eca2e2..0e6d1234a86 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_iam_policy.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_iam_policy.js @@ -28,7 +28,7 @@ function main(resource) { * OPTIONAL: A `GetPolicyOptions` object for specifying options to * `GetIamPolicy`. This field is only used by Cloud IAM. */ - // const options = '' + // const options = {} // Imports the Securitycenter library const {SecurityCenterClient} = require('@google-cloud/security-center').v1; @@ -36,7 +36,7 @@ function main(resource) { // Instantiates a client const securitycenterClient = new SecurityCenterClient(); - async function getIamPolicy() { + async function callGetIamPolicy() { // Construct request const request = { resource, @@ -47,7 +47,7 @@ function main(resource) { console.log(response); } - getIamPolicy(); + callGetIamPolicy(); // [END securitycenter_v1_generated_SecurityCenter_GetIamPolicy_async] } diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_notification_config.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_notification_config.js index 2e8ba3d3361..4544fa504b2 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_notification_config.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_notification_config.js @@ -31,7 +31,7 @@ function main(name) { // Instantiates a client const securitycenterClient = new SecurityCenterClient(); - async function getNotificationConfig() { + async function callGetNotificationConfig() { // Construct request const request = { name, @@ -42,7 +42,7 @@ function main(name) { console.log(response); } - getNotificationConfig(); + callGetNotificationConfig(); // [END securitycenter_v1_generated_SecurityCenter_GetNotificationConfig_async] } diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_organization_settings.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_organization_settings.js index 828a0bc05e7..4a550f68eac 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_organization_settings.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_organization_settings.js @@ -31,7 +31,7 @@ function main(name) { // Instantiates a client const securitycenterClient = new SecurityCenterClient(); - async function getOrganizationSettings() { + async function callGetOrganizationSettings() { // Construct request const request = { name, @@ -44,7 +44,7 @@ function main(name) { console.log(response); } - getOrganizationSettings(); + callGetOrganizationSettings(); // [END securitycenter_v1_generated_SecurityCenter_GetOrganizationSettings_async] } diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_source.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_source.js index 43cab34da0a..e2e382a368f 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_source.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_source.js @@ -31,7 +31,7 @@ function main(name) { // Instantiates a client const securitycenterClient = new SecurityCenterClient(); - async function getSource() { + async function callGetSource() { // Construct request const request = { name, @@ -42,7 +42,7 @@ function main(name) { console.log(response); } - getSource(); + callGetSource(); // [END securitycenter_v1_generated_SecurityCenter_GetSource_async] } diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.group_assets.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.group_assets.js index fd5b35aaabe..f6d95ca456f 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.group_assets.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.group_assets.js @@ -116,14 +116,14 @@ function main(parent, groupBy) { * If this field is set then `state_change` must be a specified field in * `group_by`. */ - // const compareDuration = '' + // const compareDuration = {} /** * Time used as a reference point when filtering assets. The filter is limited * to assets existing at the supplied time and their values are those at that * specific time. Absence of this field will default to the API's version of * NOW. */ - // const readTime = '' + // const readTime = {} /** * The value returned by the last `GroupAssetsResponse`; indicates * that this is a continuation of a prior `GroupAssets` call, and that the @@ -142,7 +142,7 @@ function main(parent, groupBy) { // Instantiates a client const securitycenterClient = new SecurityCenterClient(); - async function groupAssets() { + async function callGroupAssets() { // Construct request const request = { parent, @@ -156,7 +156,7 @@ function main(parent, groupBy) { } } - groupAssets(); + callGroupAssets(); // [END securitycenter_v1_generated_SecurityCenter_GroupAssets_async] } diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.group_findings.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.group_findings.js index 8375e49e741..d24db360069 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.group_findings.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.group_findings.js @@ -97,7 +97,7 @@ function main(parent, groupBy) { * those at that specific time. Absence of this field will default to the * API's version of NOW. */ - // const readTime = '' + // const readTime = {} /** * When compare_duration is set, the GroupResult's "state_change" attribute is * updated to indicate whether the finding had its state changed, the @@ -127,7 +127,7 @@ function main(parent, groupBy) { * If this field is set then `state_change` must be a specified field in * `group_by`. */ - // const compareDuration = '' + // const compareDuration = {} /** * The value returned by the last `GroupFindingsResponse`; indicates * that this is a continuation of a prior `GroupFindings` call, and @@ -146,7 +146,7 @@ function main(parent, groupBy) { // Instantiates a client const securitycenterClient = new SecurityCenterClient(); - async function groupFindings() { + async function callGroupFindings() { // Construct request const request = { parent, @@ -160,7 +160,7 @@ function main(parent, groupBy) { } } - groupFindings(); + callGroupFindings(); // [END securitycenter_v1_generated_SecurityCenter_GroupFindings_async] } diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_assets.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_assets.js index d5187d0ed5b..1188c615a43 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_assets.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_assets.js @@ -104,7 +104,7 @@ function main(parent) { * specific time. Absence of this field will default to the API's version of * NOW. */ - // const readTime = '' + // const readTime = {} /** * When compare_duration is set, the ListAssetsResult's "state_change" * attribute is updated to indicate whether the asset was added, removed, or @@ -127,13 +127,13 @@ function main(parent) { * is "UNUSED", which will be the state_change set for all assets present at * read_time. */ - // const compareDuration = '' + // const compareDuration = {} /** * A field mask to specify the ListAssetsResult fields to be listed in the * response. * An empty field mask will list all fields. */ - // const fieldMask = '' + // const fieldMask = {} /** * The value returned by the last `ListAssetsResponse`; indicates * that this is a continuation of a prior `ListAssets` call, and @@ -152,7 +152,7 @@ function main(parent) { // Instantiates a client const securitycenterClient = new SecurityCenterClient(); - async function listAssets() { + async function callListAssets() { // Construct request const request = { parent, @@ -165,7 +165,7 @@ function main(parent) { } } - listAssets(); + callListAssets(); // [END securitycenter_v1_generated_SecurityCenter_ListAssets_async] } diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_findings.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_findings.js index c1ac12408d9..d3be6817ebe 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_findings.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_findings.js @@ -76,6 +76,7 @@ function main(parent) { * * resource.project_display_name: `=`, `:` * * resource.type: `=`, `:` * * resource.folders.resource_folder: `=`, `:` + * * resource.display_name: `=`, `:` */ // const filter = 'abc123' /** @@ -104,7 +105,7 @@ function main(parent) { * those at that specific time. Absence of this field will default to the * API's version of NOW. */ - // const readTime = '' + // const readTime = {} /** * When compare_duration is set, the ListFindingsResult's "state_change" * attribute is updated to indicate whether the finding had its state changed, @@ -133,12 +134,12 @@ function main(parent) { * is "UNUSED", which will be the state_change set for all findings present at * read_time. */ - // const compareDuration = '' + // const compareDuration = {} /** * A field mask to specify the Finding fields to be listed in the response. * An empty field mask will list all fields. */ - // const fieldMask = '' + // const fieldMask = {} /** * The value returned by the last `ListFindingsResponse`; indicates * that this is a continuation of a prior `ListFindings` call, and @@ -157,7 +158,7 @@ function main(parent) { // Instantiates a client const securitycenterClient = new SecurityCenterClient(); - async function listFindings() { + async function callListFindings() { // Construct request const request = { parent, @@ -170,7 +171,7 @@ function main(parent) { } } - listFindings(); + callListFindings(); // [END securitycenter_v1_generated_SecurityCenter_ListFindings_async] } diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_notification_configs.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_notification_configs.js index 699911be578..d9571e5837a 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_notification_configs.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_notification_configs.js @@ -42,7 +42,7 @@ function main(parent) { // Instantiates a client const securitycenterClient = new SecurityCenterClient(); - async function listNotificationConfigs() { + async function callListNotificationConfigs() { // Construct request const request = { parent, @@ -57,7 +57,7 @@ function main(parent) { } } - listNotificationConfigs(); + callListNotificationConfigs(); // [END securitycenter_v1_generated_SecurityCenter_ListNotificationConfigs_async] } diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_sources.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_sources.js index e4102af68ff..9272f1611fa 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_sources.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_sources.js @@ -43,7 +43,7 @@ function main(parent) { // Instantiates a client const securitycenterClient = new SecurityCenterClient(); - async function listSources() { + async function callListSources() { // Construct request const request = { parent, @@ -56,7 +56,7 @@ function main(parent) { } } - listSources(); + callListSources(); // [END securitycenter_v1_generated_SecurityCenter_ListSources_async] } diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.run_asset_discovery.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.run_asset_discovery.js index 9a1f01c220c..feaeabe06cc 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.run_asset_discovery.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.run_asset_discovery.js @@ -31,7 +31,7 @@ function main(parent) { // Instantiates a client const securitycenterClient = new SecurityCenterClient(); - async function runAssetDiscovery() { + async function callRunAssetDiscovery() { // Construct request const request = { parent, @@ -43,7 +43,7 @@ function main(parent) { console.log(response); } - runAssetDiscovery(); + callRunAssetDiscovery(); // [END securitycenter_v1_generated_SecurityCenter_RunAssetDiscovery_async] } diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.set_finding_state.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.set_finding_state.js index 980a508861d..955a874dcbd 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.set_finding_state.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.set_finding_state.js @@ -29,11 +29,11 @@ function main(name, state, startTime) { /** * Required. The desired State of the finding. */ - // const state = '' + // const state = {} /** * Required. The time at which the updated state takes effect. */ - // const startTime = '' + // const startTime = {} // Imports the Securitycenter library const {SecurityCenterClient} = require('@google-cloud/security-center').v1; @@ -41,7 +41,7 @@ function main(name, state, startTime) { // Instantiates a client const securitycenterClient = new SecurityCenterClient(); - async function setFindingState() { + async function callSetFindingState() { // Construct request const request = { name, @@ -54,7 +54,7 @@ function main(name, state, startTime) { console.log(response); } - setFindingState(); + callSetFindingState(); // [END securitycenter_v1_generated_SecurityCenter_SetFindingState_async] } diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.set_iam_policy.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.set_iam_policy.js index dfd1ed9a70a..dea5d2c0ec9 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.set_iam_policy.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.set_iam_policy.js @@ -30,7 +30,7 @@ function main(resource, policy) { * valid policy but certain Cloud Platform services (such as Projects) * might reject them. */ - // const policy = '' + // const policy = {} // Imports the Securitycenter library const {SecurityCenterClient} = require('@google-cloud/security-center').v1; @@ -38,7 +38,7 @@ function main(resource, policy) { // Instantiates a client const securitycenterClient = new SecurityCenterClient(); - async function setIamPolicy() { + async function callSetIamPolicy() { // Construct request const request = { resource, @@ -50,7 +50,7 @@ function main(resource, policy) { console.log(response); } - setIamPolicy(); + callSetIamPolicy(); // [END securitycenter_v1_generated_SecurityCenter_SetIamPolicy_async] } diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.test_iam_permissions.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.test_iam_permissions.js index 39b32d4c082..3a1c7cb6113 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.test_iam_permissions.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.test_iam_permissions.js @@ -28,7 +28,7 @@ function main(resource, permissions) { * The set of permissions to check for the `resource`. Permissions with * wildcards (such as '*' or 'storage.*') are not allowed. For more * information see - * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + * IAM Overview (https://cloud.google.com/iam/docs/overview#permissions). */ // const permissions = 'abc123' @@ -38,7 +38,7 @@ function main(resource, permissions) { // Instantiates a client const securitycenterClient = new SecurityCenterClient(); - async function testIamPermissions() { + async function callTestIamPermissions() { // Construct request const request = { resource, @@ -50,7 +50,7 @@ function main(resource, permissions) { console.log(response); } - testIamPermissions(); + callTestIamPermissions(); // [END securitycenter_v1_generated_SecurityCenter_TestIamPermissions_async] } diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_finding.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_finding.js index 8cf92414a38..dbfab63db35 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_finding.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_finding.js @@ -26,7 +26,7 @@ function main(finding) { * alphanumeric and less than or equal to 32 characters and greater than 0 * characters in length. */ - // const finding = '' + // const finding = {} /** * The FieldMask to use when updating the finding resource. This field should * not be specified when creating a finding. @@ -35,7 +35,7 @@ function main(finding) { * be added/updated by using "source_properties." in the field * mask. */ - // const updateMask = '' + // const updateMask = {} // Imports the Securitycenter library const {SecurityCenterClient} = require('@google-cloud/security-center').v1; @@ -43,7 +43,7 @@ function main(finding) { // Instantiates a client const securitycenterClient = new SecurityCenterClient(); - async function updateFinding() { + async function callUpdateFinding() { // Construct request const request = { finding, @@ -54,7 +54,7 @@ function main(finding) { console.log(response); } - updateFinding(); + callUpdateFinding(); // [END securitycenter_v1_generated_SecurityCenter_UpdateFinding_async] } diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_notification_config.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_notification_config.js index 6a7d70d8023..8bb3c86fad6 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_notification_config.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_notification_config.js @@ -22,12 +22,12 @@ function main(notificationConfig) { /** * Required. The notification config to update. */ - // const notificationConfig = '' + // const notificationConfig = {} /** * The FieldMask to use when updating the notification config. * If empty all mutable fields will be updated. */ - // const updateMask = '' + // const updateMask = {} // Imports the Securitycenter library const {SecurityCenterClient} = require('@google-cloud/security-center').v1; @@ -35,7 +35,7 @@ function main(notificationConfig) { // Instantiates a client const securitycenterClient = new SecurityCenterClient(); - async function updateNotificationConfig() { + async function callUpdateNotificationConfig() { // Construct request const request = { notificationConfig, @@ -48,7 +48,7 @@ function main(notificationConfig) { console.log(response); } - updateNotificationConfig(); + callUpdateNotificationConfig(); // [END securitycenter_v1_generated_SecurityCenter_UpdateNotificationConfig_async] } diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_organization_settings.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_organization_settings.js index a310b1238b4..35b0e5c3db4 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_organization_settings.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_organization_settings.js @@ -22,12 +22,12 @@ function main(organizationSettings) { /** * Required. The organization settings resource to update. */ - // const organizationSettings = '' + // const organizationSettings = {} /** * The FieldMask to use when updating the settings resource. * If empty all mutable fields will be updated. */ - // const updateMask = '' + // const updateMask = {} // Imports the Securitycenter library const {SecurityCenterClient} = require('@google-cloud/security-center').v1; @@ -35,7 +35,7 @@ function main(organizationSettings) { // Instantiates a client const securitycenterClient = new SecurityCenterClient(); - async function updateOrganizationSettings() { + async function callUpdateOrganizationSettings() { // Construct request const request = { organizationSettings, @@ -48,7 +48,7 @@ function main(organizationSettings) { console.log(response); } - updateOrganizationSettings(); + callUpdateOrganizationSettings(); // [END securitycenter_v1_generated_SecurityCenter_UpdateOrganizationSettings_async] } diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_security_marks.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_security_marks.js index fd42e11ba01..12110134203 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_security_marks.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_security_marks.js @@ -22,20 +22,20 @@ function main(securityMarks) { /** * Required. The security marks resource to update. */ - // const securityMarks = '' + // const securityMarks = {} /** * The FieldMask to use when updating the security marks resource. * The field mask must not contain duplicate fields. * If empty or set to "marks", all marks will be replaced. Individual * marks can be updated using "marks.". */ - // const updateMask = '' + // const updateMask = {} /** * The time at which the updated SecurityMarks take effect. * If not set uses current server time. Updates will be applied to the * SecurityMarks that are active immediately preceding this time. */ - // const startTime = '' + // const startTime = {} // Imports the Securitycenter library const {SecurityCenterClient} = require('@google-cloud/security-center').v1; @@ -43,7 +43,7 @@ function main(securityMarks) { // Instantiates a client const securitycenterClient = new SecurityCenterClient(); - async function updateSecurityMarks() { + async function callUpdateSecurityMarks() { // Construct request const request = { securityMarks, @@ -54,7 +54,7 @@ function main(securityMarks) { console.log(response); } - updateSecurityMarks(); + callUpdateSecurityMarks(); // [END securitycenter_v1_generated_SecurityCenter_UpdateSecurityMarks_async] } diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_source.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_source.js index 3a7e3667dd0..d423bcf8982 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_source.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_source.js @@ -22,12 +22,12 @@ function main(source) { /** * Required. The source resource to update. */ - // const source = '' + // const source = {} /** * The FieldMask to use when updating the source resource. * If empty all mutable fields will be updated. */ - // const updateMask = '' + // const updateMask = {} // Imports the Securitycenter library const {SecurityCenterClient} = require('@google-cloud/security-center').v1; @@ -35,7 +35,7 @@ function main(source) { // Instantiates a client const securitycenterClient = new SecurityCenterClient(); - async function updateSource() { + async function callUpdateSource() { // Construct request const request = { source, @@ -46,7 +46,7 @@ function main(source) { console.log(response); } - updateSource(); + callUpdateSource(); // [END securitycenter_v1_generated_SecurityCenter_UpdateSource_async] } diff --git a/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.create_finding.js b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.create_finding.js index 094e34758f5..aea73fabb00 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.create_finding.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.create_finding.js @@ -34,7 +34,7 @@ function main(parent, findingId, finding) { * Required. The Finding being created. The name and security_marks will be ignored as * they are both output only fields on this resource. */ - // const finding = '' + // const finding = {} // Imports the Securitycenter library const {SecurityCenterClient} = @@ -43,7 +43,7 @@ function main(parent, findingId, finding) { // Instantiates a client const securitycenterClient = new SecurityCenterClient(); - async function createFinding() { + async function callCreateFinding() { // Construct request const request = { parent, @@ -56,7 +56,7 @@ function main(parent, findingId, finding) { console.log(response); } - createFinding(); + callCreateFinding(); // [END securitycenter_v1beta1_generated_SecurityCenter_CreateFinding_async] } diff --git a/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.create_source.js b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.create_source.js index 442e4f7d29a..f7b07c22d73 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.create_source.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.create_source.js @@ -28,7 +28,7 @@ function main(parent, source) { * Required. The Source being created, only the display_name and description will be * used. All other fields will be ignored. */ - // const source = '' + // const source = {} // Imports the Securitycenter library const {SecurityCenterClient} = @@ -37,7 +37,7 @@ function main(parent, source) { // Instantiates a client const securitycenterClient = new SecurityCenterClient(); - async function createSource() { + async function callCreateSource() { // Construct request const request = { parent, @@ -49,7 +49,7 @@ function main(parent, source) { console.log(response); } - createSource(); + callCreateSource(); // [END securitycenter_v1beta1_generated_SecurityCenter_CreateSource_async] } diff --git a/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.get_iam_policy.js b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.get_iam_policy.js index bb3667f651b..305040346ae 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.get_iam_policy.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.get_iam_policy.js @@ -28,7 +28,7 @@ function main(resource) { * OPTIONAL: A `GetPolicyOptions` object for specifying options to * `GetIamPolicy`. This field is only used by Cloud IAM. */ - // const options = '' + // const options = {} // Imports the Securitycenter library const {SecurityCenterClient} = @@ -37,7 +37,7 @@ function main(resource) { // Instantiates a client const securitycenterClient = new SecurityCenterClient(); - async function getIamPolicy() { + async function callGetIamPolicy() { // Construct request const request = { resource, @@ -48,7 +48,7 @@ function main(resource) { console.log(response); } - getIamPolicy(); + callGetIamPolicy(); // [END securitycenter_v1beta1_generated_SecurityCenter_GetIamPolicy_async] } diff --git a/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.get_organization_settings.js b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.get_organization_settings.js index e05e2fcf230..88237d5e26f 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.get_organization_settings.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.get_organization_settings.js @@ -32,7 +32,7 @@ function main(name) { // Instantiates a client const securitycenterClient = new SecurityCenterClient(); - async function getOrganizationSettings() { + async function callGetOrganizationSettings() { // Construct request const request = { name, @@ -45,7 +45,7 @@ function main(name) { console.log(response); } - getOrganizationSettings(); + callGetOrganizationSettings(); // [END securitycenter_v1beta1_generated_SecurityCenter_GetOrganizationSettings_async] } diff --git a/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.get_source.js b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.get_source.js index d02e5a8be4c..7abbda7749b 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.get_source.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.get_source.js @@ -32,7 +32,7 @@ function main(name) { // Instantiates a client const securitycenterClient = new SecurityCenterClient(); - async function getSource() { + async function callGetSource() { // Construct request const request = { name, @@ -43,7 +43,7 @@ function main(name) { console.log(response); } - getSource(); + callGetSource(); // [END securitycenter_v1beta1_generated_SecurityCenter_GetSource_async] } diff --git a/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.group_assets.js b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.group_assets.js index ede3e9b5bb0..73615251fa5 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.group_assets.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.group_assets.js @@ -79,14 +79,14 @@ function main(parent, groupBy) { * compare_duration and reference_time. * This field is ignored if `state` is not a field in `group_by`. */ - // const compareDuration = '' + // const compareDuration = {} /** * Time used as a reference point when filtering assets. The filter is limited * to assets existing at the supplied time and their values are those at that * specific time. Absence of this field will default to the API's version of * NOW. */ - // const readTime = '' + // const readTime = {} /** * The value returned by the last `GroupAssetsResponse`; indicates * that this is a continuation of a prior `GroupAssets` call, and that the @@ -106,7 +106,7 @@ function main(parent, groupBy) { // Instantiates a client const securitycenterClient = new SecurityCenterClient(); - async function groupAssets() { + async function callGroupAssets() { // Construct request const request = { parent, @@ -120,7 +120,7 @@ function main(parent, groupBy) { } } - groupAssets(); + callGroupAssets(); // [END securitycenter_v1beta1_generated_SecurityCenter_GroupAssets_async] } diff --git a/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.group_findings.js b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.group_findings.js index 51994c0bac7..c9b37d15775 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.group_findings.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.group_findings.js @@ -65,7 +65,7 @@ function main(parent, groupBy) { * those at that specific time. Absence of this field will default to the * API's version of NOW. */ - // const readTime = '' + // const readTime = {} /** * The value returned by the last `GroupFindingsResponse`; indicates * that this is a continuation of a prior `GroupFindings` call, and @@ -85,7 +85,7 @@ function main(parent, groupBy) { // Instantiates a client const securitycenterClient = new SecurityCenterClient(); - async function groupFindings() { + async function callGroupFindings() { // Construct request const request = { parent, @@ -99,7 +99,7 @@ function main(parent, groupBy) { } } - groupFindings(); + callGroupFindings(); // [END securitycenter_v1beta1_generated_SecurityCenter_GroupFindings_async] } diff --git a/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.list_assets.js b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.list_assets.js index 89ad1c9a1cc..320d42dd317 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.list_assets.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.list_assets.js @@ -64,7 +64,7 @@ function main(parent) { * specific time. Absence of this field will default to the API's version of * NOW. */ - // const readTime = '' + // const readTime = {} /** * When compare_duration is set, the ListAssetResult's "state" attribute is * updated to indicate whether the asset was added, removed, or remained @@ -86,13 +86,13 @@ function main(parent) { * If compare_duration is not specified, then the only possible state is * "UNUSED", which indicates that the asset is present at read_time. */ - // const compareDuration = '' + // const compareDuration = {} /** * Optional. A field mask to specify the ListAssetsResult fields to be listed in the * response. * An empty field mask will list all fields. */ - // const fieldMask = '' + // const fieldMask = {} /** * The value returned by the last `ListAssetsResponse`; indicates * that this is a continuation of a prior `ListAssets` call, and @@ -112,7 +112,7 @@ function main(parent) { // Instantiates a client const securitycenterClient = new SecurityCenterClient(); - async function listAssets() { + async function callListAssets() { // Construct request const request = { parent, @@ -125,7 +125,7 @@ function main(parent) { } } - listAssets(); + callListAssets(); // [END securitycenter_v1beta1_generated_SecurityCenter_ListAssets_async] } diff --git a/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.list_findings.js b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.list_findings.js index dd524c27453..931016744ae 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.list_findings.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.list_findings.js @@ -64,12 +64,12 @@ function main(parent) { * those at that specific time. Absence of this field will default to the * API's version of NOW. */ - // const readTime = '' + // const readTime = {} /** * Optional. A field mask to specify the Finding fields to be listed in the response. * An empty field mask will list all fields. */ - // const fieldMask = '' + // const fieldMask = {} /** * The value returned by the last `ListFindingsResponse`; indicates * that this is a continuation of a prior `ListFindings` call, and @@ -89,7 +89,7 @@ function main(parent) { // Instantiates a client const securitycenterClient = new SecurityCenterClient(); - async function listFindings() { + async function callListFindings() { // Construct request const request = { parent, @@ -102,7 +102,7 @@ function main(parent) { } } - listFindings(); + callListFindings(); // [END securitycenter_v1beta1_generated_SecurityCenter_ListFindings_async] } diff --git a/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.list_sources.js b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.list_sources.js index 33330ba206d..b052183ca48 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.list_sources.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.list_sources.js @@ -43,7 +43,7 @@ function main(parent) { // Instantiates a client const securitycenterClient = new SecurityCenterClient(); - async function listSources() { + async function callListSources() { // Construct request const request = { parent, @@ -56,7 +56,7 @@ function main(parent) { } } - listSources(); + callListSources(); // [END securitycenter_v1beta1_generated_SecurityCenter_ListSources_async] } diff --git a/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.run_asset_discovery.js b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.run_asset_discovery.js index a57775cd762..9302c302058 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.run_asset_discovery.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.run_asset_discovery.js @@ -32,7 +32,7 @@ function main(parent) { // Instantiates a client const securitycenterClient = new SecurityCenterClient(); - async function runAssetDiscovery() { + async function callRunAssetDiscovery() { // Construct request const request = { parent, @@ -44,7 +44,7 @@ function main(parent) { console.log(response); } - runAssetDiscovery(); + callRunAssetDiscovery(); // [END securitycenter_v1beta1_generated_SecurityCenter_RunAssetDiscovery_async] } diff --git a/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.set_finding_state.js b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.set_finding_state.js index 89f6702c6c6..1c84b5c032a 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.set_finding_state.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.set_finding_state.js @@ -29,11 +29,11 @@ function main(name, state, startTime) { /** * Required. The desired State of the finding. */ - // const state = '' + // const state = {} /** * Required. The time at which the updated state takes effect. */ - // const startTime = '' + // const startTime = {} // Imports the Securitycenter library const {SecurityCenterClient} = @@ -42,7 +42,7 @@ function main(name, state, startTime) { // Instantiates a client const securitycenterClient = new SecurityCenterClient(); - async function setFindingState() { + async function callSetFindingState() { // Construct request const request = { name, @@ -55,7 +55,7 @@ function main(name, state, startTime) { console.log(response); } - setFindingState(); + callSetFindingState(); // [END securitycenter_v1beta1_generated_SecurityCenter_SetFindingState_async] } diff --git a/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.set_iam_policy.js b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.set_iam_policy.js index d19993d2273..e92642a3f6f 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.set_iam_policy.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.set_iam_policy.js @@ -30,7 +30,7 @@ function main(resource, policy) { * valid policy but certain Cloud Platform services (such as Projects) * might reject them. */ - // const policy = '' + // const policy = {} // Imports the Securitycenter library const {SecurityCenterClient} = @@ -39,7 +39,7 @@ function main(resource, policy) { // Instantiates a client const securitycenterClient = new SecurityCenterClient(); - async function setIamPolicy() { + async function callSetIamPolicy() { // Construct request const request = { resource, @@ -51,7 +51,7 @@ function main(resource, policy) { console.log(response); } - setIamPolicy(); + callSetIamPolicy(); // [END securitycenter_v1beta1_generated_SecurityCenter_SetIamPolicy_async] } diff --git a/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.test_iam_permissions.js b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.test_iam_permissions.js index 903ac00249a..664ee9453f8 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.test_iam_permissions.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.test_iam_permissions.js @@ -28,7 +28,7 @@ function main(resource, permissions) { * The set of permissions to check for the `resource`. Permissions with * wildcards (such as '*' or 'storage.*') are not allowed. For more * information see - * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + * IAM Overview (https://cloud.google.com/iam/docs/overview#permissions). */ // const permissions = 'abc123' @@ -39,7 +39,7 @@ function main(resource, permissions) { // Instantiates a client const securitycenterClient = new SecurityCenterClient(); - async function testIamPermissions() { + async function callTestIamPermissions() { // Construct request const request = { resource, @@ -51,7 +51,7 @@ function main(resource, permissions) { console.log(response); } - testIamPermissions(); + callTestIamPermissions(); // [END securitycenter_v1beta1_generated_SecurityCenter_TestIamPermissions_async] } diff --git a/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.update_finding.js b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.update_finding.js index caa61d3d804..7812a166637 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.update_finding.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.update_finding.js @@ -26,12 +26,12 @@ function main(finding) { * alphanumeric and less than or equal to 32 characters and greater than 0 * characters in length. */ - // const finding = '' + // const finding = {} /** * The FieldMask to use when updating the finding resource. This field should * not be specified when creating a finding. */ - // const updateMask = '' + // const updateMask = {} // Imports the Securitycenter library const {SecurityCenterClient} = @@ -40,7 +40,7 @@ function main(finding) { // Instantiates a client const securitycenterClient = new SecurityCenterClient(); - async function updateFinding() { + async function callUpdateFinding() { // Construct request const request = { finding, @@ -51,7 +51,7 @@ function main(finding) { console.log(response); } - updateFinding(); + callUpdateFinding(); // [END securitycenter_v1beta1_generated_SecurityCenter_UpdateFinding_async] } diff --git a/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.update_organization_settings.js b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.update_organization_settings.js index 1973f67cdd7..44770f1c87c 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.update_organization_settings.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.update_organization_settings.js @@ -22,11 +22,11 @@ function main(organizationSettings) { /** * Required. The organization settings resource to update. */ - // const organizationSettings = '' + // const organizationSettings = {} /** * The FieldMask to use when updating the settings resource. */ - // const updateMask = '' + // const updateMask = {} // Imports the Securitycenter library const {SecurityCenterClient} = @@ -35,7 +35,7 @@ function main(organizationSettings) { // Instantiates a client const securitycenterClient = new SecurityCenterClient(); - async function updateOrganizationSettings() { + async function callUpdateOrganizationSettings() { // Construct request const request = { organizationSettings, @@ -48,7 +48,7 @@ function main(organizationSettings) { console.log(response); } - updateOrganizationSettings(); + callUpdateOrganizationSettings(); // [END securitycenter_v1beta1_generated_SecurityCenter_UpdateOrganizationSettings_async] } diff --git a/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.update_security_marks.js b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.update_security_marks.js index ae7389cb857..a3f4b418722 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.update_security_marks.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.update_security_marks.js @@ -22,15 +22,15 @@ function main(securityMarks) { /** * Required. The security marks resource to update. */ - // const securityMarks = '' + // const securityMarks = {} /** * The FieldMask to use when updating the security marks resource. */ - // const updateMask = '' + // const updateMask = {} /** * The time at which the updated SecurityMarks take effect. */ - // const startTime = '' + // const startTime = {} // Imports the Securitycenter library const {SecurityCenterClient} = @@ -39,7 +39,7 @@ function main(securityMarks) { // Instantiates a client const securitycenterClient = new SecurityCenterClient(); - async function updateSecurityMarks() { + async function callUpdateSecurityMarks() { // Construct request const request = { securityMarks, @@ -50,7 +50,7 @@ function main(securityMarks) { console.log(response); } - updateSecurityMarks(); + callUpdateSecurityMarks(); // [END securitycenter_v1beta1_generated_SecurityCenter_UpdateSecurityMarks_async] } diff --git a/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.update_source.js b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.update_source.js index 06ab97df6c9..0e504cbd6e5 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.update_source.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.update_source.js @@ -22,11 +22,11 @@ function main(source) { /** * Required. The source resource to update. */ - // const source = '' + // const source = {} /** * The FieldMask to use when updating the source resource. */ - // const updateMask = '' + // const updateMask = {} // Imports the Securitycenter library const {SecurityCenterClient} = @@ -35,7 +35,7 @@ function main(source) { // Instantiates a client const securitycenterClient = new SecurityCenterClient(); - async function updateSource() { + async function callUpdateSource() { // Construct request const request = { source, @@ -46,7 +46,7 @@ function main(source) { console.log(response); } - updateSource(); + callUpdateSource(); // [END securitycenter_v1beta1_generated_SecurityCenter_UpdateSource_async] } diff --git a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.create_finding.js b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.create_finding.js index 691d6a353b5..1a960ce8d43 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.create_finding.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.create_finding.js @@ -32,7 +32,7 @@ function main(parent, findingId, finding) { * Required. The Finding being created. The name and security_marks will be ignored as * they are both output only fields on this resource. */ - // const finding = '' + // const finding = {} // Imports the Securitycenter library const {SecurityCenterClient} = @@ -41,7 +41,7 @@ function main(parent, findingId, finding) { // Instantiates a client const securitycenterClient = new SecurityCenterClient(); - async function createFinding() { + async function callCreateFinding() { // Construct request const request = { parent, @@ -54,7 +54,7 @@ function main(parent, findingId, finding) { console.log(response); } - createFinding(); + callCreateFinding(); // [END securitycenter_v1p1beta1_generated_SecurityCenter_CreateFinding_async] } diff --git a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.create_notification_config.js b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.create_notification_config.js index 6132d6c29e2..a342c85ec5f 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.create_notification_config.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.create_notification_config.js @@ -34,7 +34,7 @@ function main(parent, configId, notificationConfig) { * Required. The notification config being created. The name and the service account * will be ignored as they are both output only fields on this resource. */ - // const notificationConfig = '' + // const notificationConfig = {} // Imports the Securitycenter library const {SecurityCenterClient} = @@ -43,7 +43,7 @@ function main(parent, configId, notificationConfig) { // Instantiates a client const securitycenterClient = new SecurityCenterClient(); - async function createNotificationConfig() { + async function callCreateNotificationConfig() { // Construct request const request = { parent, @@ -58,7 +58,7 @@ function main(parent, configId, notificationConfig) { console.log(response); } - createNotificationConfig(); + callCreateNotificationConfig(); // [END securitycenter_v1p1beta1_generated_SecurityCenter_CreateNotificationConfig_async] } diff --git a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.create_source.js b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.create_source.js index 72e4a5ed45c..534feddf3f5 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.create_source.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.create_source.js @@ -28,7 +28,7 @@ function main(parent, source) { * Required. The Source being created, only the display_name and description will be * used. All other fields will be ignored. */ - // const source = '' + // const source = {} // Imports the Securitycenter library const {SecurityCenterClient} = @@ -37,7 +37,7 @@ function main(parent, source) { // Instantiates a client const securitycenterClient = new SecurityCenterClient(); - async function createSource() { + async function callCreateSource() { // Construct request const request = { parent, @@ -49,7 +49,7 @@ function main(parent, source) { console.log(response); } - createSource(); + callCreateSource(); // [END securitycenter_v1p1beta1_generated_SecurityCenter_CreateSource_async] } diff --git a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.delete_notification_config.js b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.delete_notification_config.js index 3b6f27578b2..13eff5164c0 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.delete_notification_config.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.delete_notification_config.js @@ -32,7 +32,7 @@ function main(name) { // Instantiates a client const securitycenterClient = new SecurityCenterClient(); - async function deleteNotificationConfig() { + async function callDeleteNotificationConfig() { // Construct request const request = { name, @@ -45,7 +45,7 @@ function main(name) { console.log(response); } - deleteNotificationConfig(); + callDeleteNotificationConfig(); // [END securitycenter_v1p1beta1_generated_SecurityCenter_DeleteNotificationConfig_async] } diff --git a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.get_iam_policy.js b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.get_iam_policy.js index 4014fa73c10..9e4f355c197 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.get_iam_policy.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.get_iam_policy.js @@ -28,7 +28,7 @@ function main(resource) { * OPTIONAL: A `GetPolicyOptions` object for specifying options to * `GetIamPolicy`. This field is only used by Cloud IAM. */ - // const options = '' + // const options = {} // Imports the Securitycenter library const {SecurityCenterClient} = @@ -37,7 +37,7 @@ function main(resource) { // Instantiates a client const securitycenterClient = new SecurityCenterClient(); - async function getIamPolicy() { + async function callGetIamPolicy() { // Construct request const request = { resource, @@ -48,7 +48,7 @@ function main(resource) { console.log(response); } - getIamPolicy(); + callGetIamPolicy(); // [END securitycenter_v1p1beta1_generated_SecurityCenter_GetIamPolicy_async] } diff --git a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.get_notification_config.js b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.get_notification_config.js index a8fb4b2d87e..edf969f14c5 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.get_notification_config.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.get_notification_config.js @@ -32,7 +32,7 @@ function main(name) { // Instantiates a client const securitycenterClient = new SecurityCenterClient(); - async function getNotificationConfig() { + async function callGetNotificationConfig() { // Construct request const request = { name, @@ -43,7 +43,7 @@ function main(name) { console.log(response); } - getNotificationConfig(); + callGetNotificationConfig(); // [END securitycenter_v1p1beta1_generated_SecurityCenter_GetNotificationConfig_async] } diff --git a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.get_organization_settings.js b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.get_organization_settings.js index 868e530ff9c..e7e18a20eee 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.get_organization_settings.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.get_organization_settings.js @@ -32,7 +32,7 @@ function main(name) { // Instantiates a client const securitycenterClient = new SecurityCenterClient(); - async function getOrganizationSettings() { + async function callGetOrganizationSettings() { // Construct request const request = { name, @@ -45,7 +45,7 @@ function main(name) { console.log(response); } - getOrganizationSettings(); + callGetOrganizationSettings(); // [END securitycenter_v1p1beta1_generated_SecurityCenter_GetOrganizationSettings_async] } diff --git a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.get_source.js b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.get_source.js index 93c406c59af..5257a4398ad 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.get_source.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.get_source.js @@ -32,7 +32,7 @@ function main(name) { // Instantiates a client const securitycenterClient = new SecurityCenterClient(); - async function getSource() { + async function callGetSource() { // Construct request const request = { name, @@ -43,7 +43,7 @@ function main(name) { console.log(response); } - getSource(); + callGetSource(); // [END securitycenter_v1p1beta1_generated_SecurityCenter_GetSource_async] } diff --git a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.group_assets.js b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.group_assets.js index 47fa3e9ae2f..410a1b631df 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.group_assets.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.group_assets.js @@ -116,14 +116,14 @@ function main(parent, groupBy) { * If this field is set then `state_change` must be a specified field in * `group_by`. */ - // const compareDuration = '' + // const compareDuration = {} /** * Time used as a reference point when filtering assets. The filter is limited * to assets existing at the supplied time and their values are those at that * specific time. Absence of this field will default to the API's version of * NOW. */ - // const readTime = '' + // const readTime = {} /** * The value returned by the last `GroupAssetsResponse`; indicates * that this is a continuation of a prior `GroupAssets` call, and that the @@ -143,7 +143,7 @@ function main(parent, groupBy) { // Instantiates a client const securitycenterClient = new SecurityCenterClient(); - async function groupAssets() { + async function callGroupAssets() { // Construct request const request = { parent, @@ -157,7 +157,7 @@ function main(parent, groupBy) { } } - groupAssets(); + callGroupAssets(); // [END securitycenter_v1p1beta1_generated_SecurityCenter_GroupAssets_async] } diff --git a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.group_findings.js b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.group_findings.js index 51d517e132d..194d4f55583 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.group_findings.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.group_findings.js @@ -89,7 +89,7 @@ function main(parent, groupBy) { * those at that specific time. Absence of this field will default to the * API's version of NOW. */ - // const readTime = '' + // const readTime = {} /** * When compare_duration is set, the GroupResult's "state_change" attribute is * updated to indicate whether the finding had its state changed, the @@ -119,7 +119,7 @@ function main(parent, groupBy) { * If this field is set then `state_change` must be a specified field in * `group_by`. */ - // const compareDuration = '' + // const compareDuration = {} /** * The value returned by the last `GroupFindingsResponse`; indicates * that this is a continuation of a prior `GroupFindings` call, and @@ -139,7 +139,7 @@ function main(parent, groupBy) { // Instantiates a client const securitycenterClient = new SecurityCenterClient(); - async function groupFindings() { + async function callGroupFindings() { // Construct request const request = { parent, @@ -153,7 +153,7 @@ function main(parent, groupBy) { } } - groupFindings(); + callGroupFindings(); // [END securitycenter_v1p1beta1_generated_SecurityCenter_GroupFindings_async] } diff --git a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.list_assets.js b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.list_assets.js index 7ab4b0f3ce8..f9408f37483 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.list_assets.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.list_assets.js @@ -104,7 +104,7 @@ function main(parent) { * specific time. Absence of this field will default to the API's version of * NOW. */ - // const readTime = '' + // const readTime = {} /** * When compare_duration is set, the ListAssetsResult's "state_change" * attribute is updated to indicate whether the asset was added, removed, or @@ -127,13 +127,13 @@ function main(parent) { * is "UNUSED", which will be the state_change set for all assets present at * read_time. */ - // const compareDuration = '' + // const compareDuration = {} /** * A field mask to specify the ListAssetsResult fields to be listed in the * response. * An empty field mask will list all fields. */ - // const fieldMask = '' + // const fieldMask = {} /** * The value returned by the last `ListAssetsResponse`; indicates * that this is a continuation of a prior `ListAssets` call, and @@ -153,7 +153,7 @@ function main(parent) { // Instantiates a client const securitycenterClient = new SecurityCenterClient(); - async function listAssets() { + async function callListAssets() { // Construct request const request = { parent, @@ -166,7 +166,7 @@ function main(parent) { } } - listAssets(); + callListAssets(); // [END securitycenter_v1p1beta1_generated_SecurityCenter_ListAssets_async] } diff --git a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.list_findings.js b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.list_findings.js index 2fa2ce09ef7..76bc3ae0e6f 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.list_findings.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.list_findings.js @@ -95,7 +95,7 @@ function main(parent) { * those at that specific time. Absence of this field will default to the * API's version of NOW. */ - // const readTime = '' + // const readTime = {} /** * When compare_duration is set, the ListFindingsResult's "state_change" * attribute is updated to indicate whether the finding had its state changed, @@ -124,12 +124,12 @@ function main(parent) { * is "UNUSED", which will be the state_change set for all findings present at * read_time. */ - // const compareDuration = '' + // const compareDuration = {} /** * A field mask to specify the Finding fields to be listed in the response. * An empty field mask will list all fields. */ - // const fieldMask = '' + // const fieldMask = {} /** * The value returned by the last `ListFindingsResponse`; indicates * that this is a continuation of a prior `ListFindings` call, and @@ -149,7 +149,7 @@ function main(parent) { // Instantiates a client const securitycenterClient = new SecurityCenterClient(); - async function listFindings() { + async function callListFindings() { // Construct request const request = { parent, @@ -162,7 +162,7 @@ function main(parent) { } } - listFindings(); + callListFindings(); // [END securitycenter_v1p1beta1_generated_SecurityCenter_ListFindings_async] } diff --git a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.list_notification_configs.js b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.list_notification_configs.js index 590a9bfda30..780c2f9eb86 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.list_notification_configs.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.list_notification_configs.js @@ -43,7 +43,7 @@ function main(parent) { // Instantiates a client const securitycenterClient = new SecurityCenterClient(); - async function listNotificationConfigs() { + async function callListNotificationConfigs() { // Construct request const request = { parent, @@ -58,7 +58,7 @@ function main(parent) { } } - listNotificationConfigs(); + callListNotificationConfigs(); // [END securitycenter_v1p1beta1_generated_SecurityCenter_ListNotificationConfigs_async] } diff --git a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.list_sources.js b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.list_sources.js index e8a6e77d3fe..f22aa25ce9e 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.list_sources.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.list_sources.js @@ -44,7 +44,7 @@ function main(parent) { // Instantiates a client const securitycenterClient = new SecurityCenterClient(); - async function listSources() { + async function callListSources() { // Construct request const request = { parent, @@ -57,7 +57,7 @@ function main(parent) { } } - listSources(); + callListSources(); // [END securitycenter_v1p1beta1_generated_SecurityCenter_ListSources_async] } diff --git a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.run_asset_discovery.js b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.run_asset_discovery.js index 3b17414dcbe..522197b4ad3 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.run_asset_discovery.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.run_asset_discovery.js @@ -32,7 +32,7 @@ function main(parent) { // Instantiates a client const securitycenterClient = new SecurityCenterClient(); - async function runAssetDiscovery() { + async function callRunAssetDiscovery() { // Construct request const request = { parent, @@ -44,7 +44,7 @@ function main(parent) { console.log(response); } - runAssetDiscovery(); + callRunAssetDiscovery(); // [END securitycenter_v1p1beta1_generated_SecurityCenter_RunAssetDiscovery_async] } diff --git a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.set_finding_state.js b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.set_finding_state.js index 6b96c45b764..a7a1f50731e 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.set_finding_state.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.set_finding_state.js @@ -29,11 +29,11 @@ function main(name, state, startTime) { /** * Required. The desired State of the finding. */ - // const state = '' + // const state = {} /** * Required. The time at which the updated state takes effect. */ - // const startTime = '' + // const startTime = {} // Imports the Securitycenter library const {SecurityCenterClient} = @@ -42,7 +42,7 @@ function main(name, state, startTime) { // Instantiates a client const securitycenterClient = new SecurityCenterClient(); - async function setFindingState() { + async function callSetFindingState() { // Construct request const request = { name, @@ -55,7 +55,7 @@ function main(name, state, startTime) { console.log(response); } - setFindingState(); + callSetFindingState(); // [END securitycenter_v1p1beta1_generated_SecurityCenter_SetFindingState_async] } diff --git a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.set_iam_policy.js b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.set_iam_policy.js index b11092d07d5..4ae13419b85 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.set_iam_policy.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.set_iam_policy.js @@ -30,7 +30,7 @@ function main(resource, policy) { * valid policy but certain Cloud Platform services (such as Projects) * might reject them. */ - // const policy = '' + // const policy = {} // Imports the Securitycenter library const {SecurityCenterClient} = @@ -39,7 +39,7 @@ function main(resource, policy) { // Instantiates a client const securitycenterClient = new SecurityCenterClient(); - async function setIamPolicy() { + async function callSetIamPolicy() { // Construct request const request = { resource, @@ -51,7 +51,7 @@ function main(resource, policy) { console.log(response); } - setIamPolicy(); + callSetIamPolicy(); // [END securitycenter_v1p1beta1_generated_SecurityCenter_SetIamPolicy_async] } diff --git a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.test_iam_permissions.js b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.test_iam_permissions.js index f4bf03ae8e0..e7eec2c3a5f 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.test_iam_permissions.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.test_iam_permissions.js @@ -28,7 +28,7 @@ function main(resource, permissions) { * The set of permissions to check for the `resource`. Permissions with * wildcards (such as '*' or 'storage.*') are not allowed. For more * information see - * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + * IAM Overview (https://cloud.google.com/iam/docs/overview#permissions). */ // const permissions = 'abc123' @@ -39,7 +39,7 @@ function main(resource, permissions) { // Instantiates a client const securitycenterClient = new SecurityCenterClient(); - async function testIamPermissions() { + async function callTestIamPermissions() { // Construct request const request = { resource, @@ -51,7 +51,7 @@ function main(resource, permissions) { console.log(response); } - testIamPermissions(); + callTestIamPermissions(); // [END securitycenter_v1p1beta1_generated_SecurityCenter_TestIamPermissions_async] } diff --git a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.update_finding.js b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.update_finding.js index 88fbd0436b5..f8e002ac4c7 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.update_finding.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.update_finding.js @@ -26,7 +26,7 @@ function main(finding) { * alphanumeric and less than or equal to 32 characters and greater than 0 * characters in length. */ - // const finding = '' + // const finding = {} /** * The FieldMask to use when updating the finding resource. This field should * not be specified when creating a finding. @@ -35,7 +35,7 @@ function main(finding) { * be added/updated by using "source_properties." in the field * mask. */ - // const updateMask = '' + // const updateMask = {} // Imports the Securitycenter library const {SecurityCenterClient} = @@ -44,7 +44,7 @@ function main(finding) { // Instantiates a client const securitycenterClient = new SecurityCenterClient(); - async function updateFinding() { + async function callUpdateFinding() { // Construct request const request = { finding, @@ -55,7 +55,7 @@ function main(finding) { console.log(response); } - updateFinding(); + callUpdateFinding(); // [END securitycenter_v1p1beta1_generated_SecurityCenter_UpdateFinding_async] } diff --git a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.update_notification_config.js b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.update_notification_config.js index 1c908d2f2b4..9d353cb2b37 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.update_notification_config.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.update_notification_config.js @@ -22,12 +22,12 @@ function main(notificationConfig) { /** * Required. The notification config to update. */ - // const notificationConfig = '' + // const notificationConfig = {} /** * The FieldMask to use when updating the notification config. * If empty all mutable fields will be updated. */ - // const updateMask = '' + // const updateMask = {} // Imports the Securitycenter library const {SecurityCenterClient} = @@ -36,7 +36,7 @@ function main(notificationConfig) { // Instantiates a client const securitycenterClient = new SecurityCenterClient(); - async function updateNotificationConfig() { + async function callUpdateNotificationConfig() { // Construct request const request = { notificationConfig, @@ -49,7 +49,7 @@ function main(notificationConfig) { console.log(response); } - updateNotificationConfig(); + callUpdateNotificationConfig(); // [END securitycenter_v1p1beta1_generated_SecurityCenter_UpdateNotificationConfig_async] } diff --git a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.update_organization_settings.js b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.update_organization_settings.js index 2eae3e2d487..169ddaf075f 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.update_organization_settings.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.update_organization_settings.js @@ -22,12 +22,12 @@ function main(organizationSettings) { /** * Required. The organization settings resource to update. */ - // const organizationSettings = '' + // const organizationSettings = {} /** * The FieldMask to use when updating the settings resource. * If empty all mutable fields will be updated. */ - // const updateMask = '' + // const updateMask = {} // Imports the Securitycenter library const {SecurityCenterClient} = @@ -36,7 +36,7 @@ function main(organizationSettings) { // Instantiates a client const securitycenterClient = new SecurityCenterClient(); - async function updateOrganizationSettings() { + async function callUpdateOrganizationSettings() { // Construct request const request = { organizationSettings, @@ -49,7 +49,7 @@ function main(organizationSettings) { console.log(response); } - updateOrganizationSettings(); + callUpdateOrganizationSettings(); // [END securitycenter_v1p1beta1_generated_SecurityCenter_UpdateOrganizationSettings_async] } diff --git a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.update_security_marks.js b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.update_security_marks.js index ec138d6979d..fcd80ab648a 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.update_security_marks.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.update_security_marks.js @@ -22,20 +22,20 @@ function main(securityMarks) { /** * Required. The security marks resource to update. */ - // const securityMarks = '' + // const securityMarks = {} /** * The FieldMask to use when updating the security marks resource. * The field mask must not contain duplicate fields. * If empty or set to "marks", all marks will be replaced. Individual * marks can be updated using "marks.". */ - // const updateMask = '' + // const updateMask = {} /** * The time at which the updated SecurityMarks take effect. * If not set uses current server time. Updates will be applied to the * SecurityMarks that are active immediately preceding this time. */ - // const startTime = '' + // const startTime = {} // Imports the Securitycenter library const {SecurityCenterClient} = @@ -44,7 +44,7 @@ function main(securityMarks) { // Instantiates a client const securitycenterClient = new SecurityCenterClient(); - async function updateSecurityMarks() { + async function callUpdateSecurityMarks() { // Construct request const request = { securityMarks, @@ -55,7 +55,7 @@ function main(securityMarks) { console.log(response); } - updateSecurityMarks(); + callUpdateSecurityMarks(); // [END securitycenter_v1p1beta1_generated_SecurityCenter_UpdateSecurityMarks_async] } diff --git a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.update_source.js b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.update_source.js index 2d4ac6486ab..db9dc7ac477 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.update_source.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.update_source.js @@ -22,12 +22,12 @@ function main(source) { /** * Required. The source resource to update. */ - // const source = '' + // const source = {} /** * The FieldMask to use when updating the source resource. * If empty all mutable fields will be updated. */ - // const updateMask = '' + // const updateMask = {} // Imports the Securitycenter library const {SecurityCenterClient} = @@ -36,7 +36,7 @@ function main(source) { // Instantiates a client const securitycenterClient = new SecurityCenterClient(); - async function updateSource() { + async function callUpdateSource() { // Construct request const request = { source, @@ -47,7 +47,7 @@ function main(source) { console.log(response); } - updateSource(); + callUpdateSource(); // [END securitycenter_v1p1beta1_generated_SecurityCenter_UpdateSource_async] } diff --git a/packages/google-cloud-securitycenter/src/v1/security_center_client.ts b/packages/google-cloud-securitycenter/src/v1/security_center_client.ts index 7cd4e69b75d..62af5bfd16d 100644 --- a/packages/google-cloud-securitycenter/src/v1/security_center_client.ts +++ b/packages/google-cloud-securitycenter/src/v1/security_center_client.ts @@ -447,6 +447,27 @@ export class SecurityCenterClient { // ------------------- // -- Service calls -- // ------------------- + /** + * Creates a source. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Resource name of the new source's parent. Its format should be + * "organizations/[organization_id]". + * @param {google.cloud.securitycenter.v1.Source} request.source + * Required. The Source being created, only the display_name and description will be + * used. All other fields will be ignored. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Source]{@link google.cloud.securitycenter.v1.Source}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/security_center.create_source.js + * region_tag:securitycenter_v1_generated_SecurityCenter_CreateSource_async + */ createSource( request?: protos.google.cloud.securitycenter.v1.ICreateSourceRequest, options?: CallOptions @@ -478,27 +499,6 @@ export class SecurityCenterClient { {} | null | undefined > ): void; - /** - * Creates a source. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Resource name of the new source's parent. Its format should be - * "organizations/[organization_id]". - * @param {google.cloud.securitycenter.v1.Source} request.source - * Required. The Source being created, only the display_name and description will be - * used. All other fields will be ignored. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Source]{@link google.cloud.securitycenter.v1.Source}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * const [response] = await client.createSource(request); - */ createSource( request?: protos.google.cloud.securitycenter.v1.ICreateSourceRequest, optionsOrCallback?: @@ -542,6 +542,32 @@ export class SecurityCenterClient { this.initialize(); return this.innerApiCalls.createSource(request, options, callback); } + /** + * Creates a finding. The corresponding source must exist for finding creation + * to succeed. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Resource name of the new finding's parent. Its format should be + * "organizations/[organization_id]/sources/[source_id]". + * @param {string} request.findingId + * Required. Unique identifier provided by the client within the parent scope. + * It must be alphanumeric and less than or equal to 32 characters and + * greater than 0 characters in length. + * @param {google.cloud.securitycenter.v1.Finding} request.finding + * Required. The Finding being created. The name and security_marks will be ignored as + * they are both output only fields on this resource. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Finding]{@link google.cloud.securitycenter.v1.Finding}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/security_center.create_finding.js + * region_tag:securitycenter_v1_generated_SecurityCenter_CreateFinding_async + */ createFinding( request?: protos.google.cloud.securitycenter.v1.ICreateFindingRequest, options?: CallOptions @@ -573,32 +599,6 @@ export class SecurityCenterClient { {} | null | undefined > ): void; - /** - * Creates a finding. The corresponding source must exist for finding creation - * to succeed. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Resource name of the new finding's parent. Its format should be - * "organizations/[organization_id]/sources/[source_id]". - * @param {string} request.findingId - * Required. Unique identifier provided by the client within the parent scope. - * It must be alphanumeric and less than or equal to 32 characters and - * greater than 0 characters in length. - * @param {google.cloud.securitycenter.v1.Finding} request.finding - * Required. The Finding being created. The name and security_marks will be ignored as - * they are both output only fields on this resource. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Finding]{@link google.cloud.securitycenter.v1.Finding}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * const [response] = await client.createFinding(request); - */ createFinding( request?: protos.google.cloud.securitycenter.v1.ICreateFindingRequest, optionsOrCallback?: @@ -642,6 +642,32 @@ export class SecurityCenterClient { this.initialize(); return this.innerApiCalls.createFinding(request, options, callback); } + /** + * Creates a notification config. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Resource name of the new notification config's parent. Its format is + * "organizations/[organization_id]". + * @param {string} request.configId + * Required. + * Unique identifier provided by the client within the parent scope. + * It must be between 1 and 128 characters, and contains alphanumeric + * characters, underscores or hyphens only. + * @param {google.cloud.securitycenter.v1.NotificationConfig} request.notificationConfig + * Required. The notification config being created. The name and the service account + * will be ignored as they are both output only fields on this resource. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [NotificationConfig]{@link google.cloud.securitycenter.v1.NotificationConfig}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/security_center.create_notification_config.js + * region_tag:securitycenter_v1_generated_SecurityCenter_CreateNotificationConfig_async + */ createNotificationConfig( request?: protos.google.cloud.securitycenter.v1.ICreateNotificationConfigRequest, options?: CallOptions @@ -676,32 +702,6 @@ export class SecurityCenterClient { {} | null | undefined > ): void; - /** - * Creates a notification config. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Resource name of the new notification config's parent. Its format is - * "organizations/[organization_id]". - * @param {string} request.configId - * Required. - * Unique identifier provided by the client within the parent scope. - * It must be between 1 and 128 characters, and contains alphanumeric - * characters, underscores or hyphens only. - * @param {google.cloud.securitycenter.v1.NotificationConfig} request.notificationConfig - * Required. The notification config being created. The name and the service account - * will be ignored as they are both output only fields on this resource. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [NotificationConfig]{@link google.cloud.securitycenter.v1.NotificationConfig}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * const [response] = await client.createNotificationConfig(request); - */ createNotificationConfig( request?: protos.google.cloud.securitycenter.v1.ICreateNotificationConfigRequest, optionsOrCallback?: @@ -752,6 +752,24 @@ export class SecurityCenterClient { callback ); } + /** + * Deletes a notification config. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the notification config to delete. Its format is + * "organizations/[organization_id]/notificationConfigs/[config_id]". + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/security_center.delete_notification_config.js + * region_tag:securitycenter_v1_generated_SecurityCenter_DeleteNotificationConfig_async + */ deleteNotificationConfig( request?: protos.google.cloud.securitycenter.v1.IDeleteNotificationConfigRequest, options?: CallOptions @@ -786,24 +804,6 @@ export class SecurityCenterClient { {} | null | undefined > ): void; - /** - * Deletes a notification config. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. Name of the notification config to delete. Its format is - * "organizations/[organization_id]/notificationConfigs/[config_id]". - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * const [response] = await client.deleteNotificationConfig(request); - */ deleteNotificationConfig( request?: protos.google.cloud.securitycenter.v1.IDeleteNotificationConfigRequest, optionsOrCallback?: @@ -854,6 +854,27 @@ export class SecurityCenterClient { callback ); } + /** + * Gets the access control policy on the specified Source. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {google.iam.v1.GetPolicyOptions} request.options + * OPTIONAL: A `GetPolicyOptions` object for specifying options to + * `GetIamPolicy`. This field is only used by Cloud IAM. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Policy]{@link google.iam.v1.Policy}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/security_center.get_iam_policy.js + * region_tag:securitycenter_v1_generated_SecurityCenter_GetIamPolicy_async + */ getIamPolicy( request?: protos.google.iam.v1.IGetIamPolicyRequest, options?: CallOptions @@ -881,27 +902,6 @@ export class SecurityCenterClient { {} | null | undefined > ): void; - /** - * Gets the access control policy on the specified Source. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy is being requested. - * See the operation documentation for the appropriate value for this field. - * @param {google.iam.v1.GetPolicyOptions} request.options - * OPTIONAL: A `GetPolicyOptions` object for specifying options to - * `GetIamPolicy`. This field is only used by Cloud IAM. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Policy]{@link google.iam.v1.Policy}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * const [response] = await client.getIamPolicy(request); - */ getIamPolicy( request?: protos.google.iam.v1.IGetIamPolicyRequest, optionsOrCallback?: @@ -941,6 +941,24 @@ export class SecurityCenterClient { this.initialize(); return this.innerApiCalls.getIamPolicy(request, options, callback); } + /** + * Gets a notification config. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the notification config to get. Its format is + * "organizations/[organization_id]/notificationConfigs/[config_id]". + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [NotificationConfig]{@link google.cloud.securitycenter.v1.NotificationConfig}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/security_center.get_notification_config.js + * region_tag:securitycenter_v1_generated_SecurityCenter_GetNotificationConfig_async + */ getNotificationConfig( request?: protos.google.cloud.securitycenter.v1.IGetNotificationConfigRequest, options?: CallOptions @@ -975,24 +993,6 @@ export class SecurityCenterClient { {} | null | undefined > ): void; - /** - * Gets a notification config. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. Name of the notification config to get. Its format is - * "organizations/[organization_id]/notificationConfigs/[config_id]". - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [NotificationConfig]{@link google.cloud.securitycenter.v1.NotificationConfig}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * const [response] = await client.getNotificationConfig(request); - */ getNotificationConfig( request?: protos.google.cloud.securitycenter.v1.IGetNotificationConfigRequest, optionsOrCallback?: @@ -1039,6 +1039,24 @@ export class SecurityCenterClient { this.initialize(); return this.innerApiCalls.getNotificationConfig(request, options, callback); } + /** + * Gets the settings for an organization. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the organization to get organization settings for. Its format is + * "organizations/[organization_id]/organizationSettings". + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [OrganizationSettings]{@link google.cloud.securitycenter.v1.OrganizationSettings}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/security_center.get_organization_settings.js + * region_tag:securitycenter_v1_generated_SecurityCenter_GetOrganizationSettings_async + */ getOrganizationSettings( request?: protos.google.cloud.securitycenter.v1.IGetOrganizationSettingsRequest, options?: CallOptions @@ -1073,24 +1091,6 @@ export class SecurityCenterClient { {} | null | undefined > ): void; - /** - * Gets the settings for an organization. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. Name of the organization to get organization settings for. Its format is - * "organizations/[organization_id]/organizationSettings". - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [OrganizationSettings]{@link google.cloud.securitycenter.v1.OrganizationSettings}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * const [response] = await client.getOrganizationSettings(request); - */ getOrganizationSettings( request?: protos.google.cloud.securitycenter.v1.IGetOrganizationSettingsRequest, optionsOrCallback?: @@ -1141,6 +1141,24 @@ export class SecurityCenterClient { callback ); } + /** + * Gets a source. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Relative resource name of the source. Its format is + * "organizations/[organization_id]/source/[source_id]". + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Source]{@link google.cloud.securitycenter.v1.Source}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/security_center.get_source.js + * region_tag:securitycenter_v1_generated_SecurityCenter_GetSource_async + */ getSource( request?: protos.google.cloud.securitycenter.v1.IGetSourceRequest, options?: CallOptions @@ -1172,24 +1190,6 @@ export class SecurityCenterClient { {} | null | undefined > ): void; - /** - * Gets a source. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. Relative resource name of the source. Its format is - * "organizations/[organization_id]/source/[source_id]". - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Source]{@link google.cloud.securitycenter.v1.Source}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * const [response] = await client.getSource(request); - */ getSource( request?: protos.google.cloud.securitycenter.v1.IGetSourceRequest, optionsOrCallback?: @@ -1233,6 +1233,30 @@ export class SecurityCenterClient { this.initialize(); return this.innerApiCalls.getSource(request, options, callback); } + /** + * Updates the state of a finding. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The relative resource name of the finding. See: + * https://cloud.google.com/apis/design/resource_names#relative_resource_name + * Example: + * "organizations/{organization_id}/sources/{source_id}/finding/{finding_id}". + * @param {google.cloud.securitycenter.v1.Finding.State} request.state + * Required. The desired State of the finding. + * @param {google.protobuf.Timestamp} request.startTime + * Required. The time at which the updated state takes effect. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Finding]{@link google.cloud.securitycenter.v1.Finding}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/security_center.set_finding_state.js + * region_tag:securitycenter_v1_generated_SecurityCenter_SetFindingState_async + */ setFindingState( request?: protos.google.cloud.securitycenter.v1.ISetFindingStateRequest, options?: CallOptions @@ -1264,30 +1288,6 @@ export class SecurityCenterClient { {} | null | undefined > ): void; - /** - * Updates the state of a finding. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The relative resource name of the finding. See: - * https://cloud.google.com/apis/design/resource_names#relative_resource_name - * Example: - * "organizations/{organization_id}/sources/{source_id}/finding/{finding_id}". - * @param {google.cloud.securitycenter.v1.Finding.State} request.state - * Required. The desired State of the finding. - * @param {google.protobuf.Timestamp} request.startTime - * Required. The time at which the updated state takes effect. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Finding]{@link google.cloud.securitycenter.v1.Finding}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * const [response] = await client.setFindingState(request); - */ setFindingState( request?: protos.google.cloud.securitycenter.v1.ISetFindingStateRequest, optionsOrCallback?: @@ -1331,6 +1331,29 @@ export class SecurityCenterClient { this.initialize(); return this.innerApiCalls.setFindingState(request, options, callback); } + /** + * Sets the access control policy on the specified Source. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy is being specified. + * See the operation documentation for the appropriate value for this field. + * @param {google.iam.v1.Policy} request.policy + * REQUIRED: The complete policy to be applied to the `resource`. The size of + * the policy is limited to a few 10s of KB. An empty policy is a + * valid policy but certain Cloud Platform services (such as Projects) + * might reject them. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Policy]{@link google.iam.v1.Policy}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/security_center.set_iam_policy.js + * region_tag:securitycenter_v1_generated_SecurityCenter_SetIamPolicy_async + */ setIamPolicy( request?: protos.google.iam.v1.ISetIamPolicyRequest, options?: CallOptions @@ -1358,29 +1381,6 @@ export class SecurityCenterClient { {} | null | undefined > ): void; - /** - * Sets the access control policy on the specified Source. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy is being specified. - * See the operation documentation for the appropriate value for this field. - * @param {google.iam.v1.Policy} request.policy - * REQUIRED: The complete policy to be applied to the `resource`. The size of - * the policy is limited to a few 10s of KB. An empty policy is a - * valid policy but certain Cloud Platform services (such as Projects) - * might reject them. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Policy]{@link google.iam.v1.Policy}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * const [response] = await client.setIamPolicy(request); - */ setIamPolicy( request?: protos.google.iam.v1.ISetIamPolicyRequest, optionsOrCallback?: @@ -1420,6 +1420,29 @@ export class SecurityCenterClient { this.initialize(); return this.innerApiCalls.setIamPolicy(request, options, callback); } + /** + * Returns the permissions that a caller has on the specified source. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {string[]} request.permissions + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see + * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/security_center.test_iam_permissions.js + * region_tag:securitycenter_v1_generated_SecurityCenter_TestIamPermissions_async + */ testIamPermissions( request?: protos.google.iam.v1.ITestIamPermissionsRequest, options?: CallOptions @@ -1447,29 +1470,6 @@ export class SecurityCenterClient { {} | null | undefined > ): void; - /** - * Returns the permissions that a caller has on the specified source. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy detail is being requested. - * See the operation documentation for the appropriate value for this field. - * @param {string[]} request.permissions - * The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For more - * information see - * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * const [response] = await client.testIamPermissions(request); - */ testIamPermissions( request?: protos.google.iam.v1.ITestIamPermissionsRequest, optionsOrCallback?: @@ -1509,6 +1509,37 @@ export class SecurityCenterClient { this.initialize(); return this.innerApiCalls.testIamPermissions(request, options, callback); } + /** + * Creates or updates a finding. The corresponding source must exist for a + * finding creation to succeed. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.securitycenter.v1.Finding} request.finding + * Required. The finding resource to update or create if it does not already exist. + * parent, security_marks, and update_time will be ignored. + * + * In the case of creation, the finding id portion of the name must be + * alphanumeric and less than or equal to 32 characters and greater than 0 + * characters in length. + * @param {google.protobuf.FieldMask} request.updateMask + * The FieldMask to use when updating the finding resource. This field should + * not be specified when creating a finding. + * + * When updating a finding, an empty mask is treated as updating all mutable + * fields and replacing source_properties. Individual source_properties can + * be added/updated by using "source_properties." in the field + * mask. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Finding]{@link google.cloud.securitycenter.v1.Finding}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/security_center.update_finding.js + * region_tag:securitycenter_v1_generated_SecurityCenter_UpdateFinding_async + */ updateFinding( request?: protos.google.cloud.securitycenter.v1.IUpdateFindingRequest, options?: CallOptions @@ -1540,37 +1571,6 @@ export class SecurityCenterClient { {} | null | undefined > ): void; - /** - * Creates or updates a finding. The corresponding source must exist for a - * finding creation to succeed. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.securitycenter.v1.Finding} request.finding - * Required. The finding resource to update or create if it does not already exist. - * parent, security_marks, and update_time will be ignored. - * - * In the case of creation, the finding id portion of the name must be - * alphanumeric and less than or equal to 32 characters and greater than 0 - * characters in length. - * @param {google.protobuf.FieldMask} request.updateMask - * The FieldMask to use when updating the finding resource. This field should - * not be specified when creating a finding. - * - * When updating a finding, an empty mask is treated as updating all mutable - * fields and replacing source_properties. Individual source_properties can - * be added/updated by using "source_properties." in the field - * mask. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Finding]{@link google.cloud.securitycenter.v1.Finding}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * const [response] = await client.updateFinding(request); - */ updateFinding( request?: protos.google.cloud.securitycenter.v1.IUpdateFindingRequest, optionsOrCallback?: @@ -1614,6 +1614,29 @@ export class SecurityCenterClient { this.initialize(); return this.innerApiCalls.updateFinding(request, options, callback); } + /** + * + * Updates a notification config. The following update + * fields are allowed: description, pubsub_topic, streaming_config.filter + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.securitycenter.v1.NotificationConfig} request.notificationConfig + * Required. The notification config to update. + * @param {google.protobuf.FieldMask} request.updateMask + * The FieldMask to use when updating the notification config. + * + * If empty all mutable fields will be updated. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [NotificationConfig]{@link google.cloud.securitycenter.v1.NotificationConfig}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/security_center.update_notification_config.js + * region_tag:securitycenter_v1_generated_SecurityCenter_UpdateNotificationConfig_async + */ updateNotificationConfig( request?: protos.google.cloud.securitycenter.v1.IUpdateNotificationConfigRequest, options?: CallOptions @@ -1648,29 +1671,6 @@ export class SecurityCenterClient { {} | null | undefined > ): void; - /** - * - * Updates a notification config. The following update - * fields are allowed: description, pubsub_topic, streaming_config.filter - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.securitycenter.v1.NotificationConfig} request.notificationConfig - * Required. The notification config to update. - * @param {google.protobuf.FieldMask} request.updateMask - * The FieldMask to use when updating the notification config. - * - * If empty all mutable fields will be updated. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [NotificationConfig]{@link google.cloud.securitycenter.v1.NotificationConfig}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * const [response] = await client.updateNotificationConfig(request); - */ updateNotificationConfig( request?: protos.google.cloud.securitycenter.v1.IUpdateNotificationConfigRequest, optionsOrCallback?: @@ -1721,6 +1721,27 @@ export class SecurityCenterClient { callback ); } + /** + * Updates an organization's settings. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.securitycenter.v1.OrganizationSettings} request.organizationSettings + * Required. The organization settings resource to update. + * @param {google.protobuf.FieldMask} request.updateMask + * The FieldMask to use when updating the settings resource. + * + * If empty all mutable fields will be updated. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [OrganizationSettings]{@link google.cloud.securitycenter.v1.OrganizationSettings}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/security_center.update_organization_settings.js + * region_tag:securitycenter_v1_generated_SecurityCenter_UpdateOrganizationSettings_async + */ updateOrganizationSettings( request?: protos.google.cloud.securitycenter.v1.IUpdateOrganizationSettingsRequest, options?: CallOptions @@ -1746,37 +1767,16 @@ export class SecurityCenterClient { > ): void; updateOrganizationSettings( - request: protos.google.cloud.securitycenter.v1.IUpdateOrganizationSettingsRequest, - callback: Callback< - protos.google.cloud.securitycenter.v1.IOrganizationSettings, - | protos.google.cloud.securitycenter.v1.IUpdateOrganizationSettingsRequest - | null - | undefined, - {} | null | undefined - > - ): void; - /** - * Updates an organization's settings. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.securitycenter.v1.OrganizationSettings} request.organizationSettings - * Required. The organization settings resource to update. - * @param {google.protobuf.FieldMask} request.updateMask - * The FieldMask to use when updating the settings resource. - * - * If empty all mutable fields will be updated. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [OrganizationSettings]{@link google.cloud.securitycenter.v1.OrganizationSettings}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * const [response] = await client.updateOrganizationSettings(request); - */ - updateOrganizationSettings( + request: protos.google.cloud.securitycenter.v1.IUpdateOrganizationSettingsRequest, + callback: Callback< + protos.google.cloud.securitycenter.v1.IOrganizationSettings, + | protos.google.cloud.securitycenter.v1.IUpdateOrganizationSettingsRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateOrganizationSettings( request?: protos.google.cloud.securitycenter.v1.IUpdateOrganizationSettingsRequest, optionsOrCallback?: | CallOptions @@ -1826,6 +1826,27 @@ export class SecurityCenterClient { callback ); } + /** + * Updates a source. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.securitycenter.v1.Source} request.source + * Required. The source resource to update. + * @param {google.protobuf.FieldMask} request.updateMask + * The FieldMask to use when updating the source resource. + * + * If empty all mutable fields will be updated. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Source]{@link google.cloud.securitycenter.v1.Source}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/security_center.update_source.js + * region_tag:securitycenter_v1_generated_SecurityCenter_UpdateSource_async + */ updateSource( request?: protos.google.cloud.securitycenter.v1.IUpdateSourceRequest, options?: CallOptions @@ -1857,27 +1878,6 @@ export class SecurityCenterClient { {} | null | undefined > ): void; - /** - * Updates a source. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.securitycenter.v1.Source} request.source - * Required. The source resource to update. - * @param {google.protobuf.FieldMask} request.updateMask - * The FieldMask to use when updating the source resource. - * - * If empty all mutable fields will be updated. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Source]{@link google.cloud.securitycenter.v1.Source}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * const [response] = await client.updateSource(request); - */ updateSource( request?: protos.google.cloud.securitycenter.v1.IUpdateSourceRequest, optionsOrCallback?: @@ -1921,6 +1921,33 @@ export class SecurityCenterClient { this.initialize(); return this.innerApiCalls.updateSource(request, options, callback); } + /** + * Updates security marks. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.securitycenter.v1.SecurityMarks} request.securityMarks + * Required. The security marks resource to update. + * @param {google.protobuf.FieldMask} request.updateMask + * The FieldMask to use when updating the security marks resource. + * + * The field mask must not contain duplicate fields. + * If empty or set to "marks", all marks will be replaced. Individual + * marks can be updated using "marks.". + * @param {google.protobuf.Timestamp} request.startTime + * The time at which the updated SecurityMarks take effect. + * If not set uses current server time. Updates will be applied to the + * SecurityMarks that are active immediately preceding this time. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [SecurityMarks]{@link google.cloud.securitycenter.v1.SecurityMarks}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/security_center.update_security_marks.js + * region_tag:securitycenter_v1_generated_SecurityCenter_UpdateSecurityMarks_async + */ updateSecurityMarks( request?: protos.google.cloud.securitycenter.v1.IUpdateSecurityMarksRequest, options?: CallOptions @@ -1955,33 +1982,6 @@ export class SecurityCenterClient { {} | null | undefined > ): void; - /** - * Updates security marks. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.securitycenter.v1.SecurityMarks} request.securityMarks - * Required. The security marks resource to update. - * @param {google.protobuf.FieldMask} request.updateMask - * The FieldMask to use when updating the security marks resource. - * - * The field mask must not contain duplicate fields. - * If empty or set to "marks", all marks will be replaced. Individual - * marks can be updated using "marks.". - * @param {google.protobuf.Timestamp} request.startTime - * The time at which the updated SecurityMarks take effect. - * If not set uses current server time. Updates will be applied to the - * SecurityMarks that are active immediately preceding this time. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [SecurityMarks]{@link google.cloud.securitycenter.v1.SecurityMarks}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * const [response] = await client.updateSecurityMarks(request); - */ updateSecurityMarks( request?: protos.google.cloud.securitycenter.v1.IUpdateSecurityMarksRequest, optionsOrCallback?: @@ -2029,6 +2029,31 @@ export class SecurityCenterClient { return this.innerApiCalls.updateSecurityMarks(request, options, callback); } + /** + * Runs asset discovery. The discovery is tracked with a long-running + * operation. + * + * This API can only be called with limited frequency for an organization. If + * it is called too frequently the caller will receive a TOO_MANY_REQUESTS + * error. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Name of the organization to run asset discovery for. Its format is + * "organizations/[organization_id]". + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/security_center.run_asset_discovery.js + * region_tag:securitycenter_v1_generated_SecurityCenter_RunAssetDiscovery_async + */ runAssetDiscovery( request?: protos.google.cloud.securitycenter.v1.IRunAssetDiscoveryRequest, options?: CallOptions @@ -2065,32 +2090,6 @@ export class SecurityCenterClient { {} | null | undefined > ): void; - /** - * Runs asset discovery. The discovery is tracked with a long-running - * operation. - * - * This API can only be called with limited frequency for an organization. If - * it is called too frequently the caller will receive a TOO_MANY_REQUESTS - * error. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Name of the organization to run asset discovery for. Its format is - * "organizations/[organization_id]". - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * const [operation] = await client.runAssetDiscovery(request); - * const [response] = await operation.promise(); - */ runAssetDiscovery( request?: protos.google.cloud.securitycenter.v1.IRunAssetDiscoveryRequest, optionsOrCallback?: @@ -2148,11 +2147,8 @@ export class SecurityCenterClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. - * @example - * const decodedOperation = await checkRunAssetDiscoveryProgress(name); - * console.log(decodedOperation.result); - * console.log(decodedOperation.done); - * console.log(decodedOperation.metadata); + * @example include:samples/generated/v1/security_center.run_asset_discovery.js + * region_tag:securitycenter_v1_generated_SecurityCenter_RunAssetDiscovery_async */ async checkRunAssetDiscoveryProgress( name: string @@ -2176,37 +2172,6 @@ export class SecurityCenterClient { protos.google.protobuf.Empty >; } - groupAssets( - request?: protos.google.cloud.securitycenter.v1.IGroupAssetsRequest, - options?: CallOptions - ): Promise< - [ - protos.google.cloud.securitycenter.v1.IGroupResult[], - protos.google.cloud.securitycenter.v1.IGroupAssetsRequest | null, - protos.google.cloud.securitycenter.v1.IGroupAssetsResponse - ] - >; - groupAssets( - request: protos.google.cloud.securitycenter.v1.IGroupAssetsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.securitycenter.v1.IGroupAssetsRequest, - | protos.google.cloud.securitycenter.v1.IGroupAssetsResponse - | null - | undefined, - protos.google.cloud.securitycenter.v1.IGroupResult - > - ): void; - groupAssets( - request: protos.google.cloud.securitycenter.v1.IGroupAssetsRequest, - callback: PaginationCallback< - protos.google.cloud.securitycenter.v1.IGroupAssetsRequest, - | protos.google.cloud.securitycenter.v1.IGroupAssetsResponse - | null - | undefined, - protos.google.cloud.securitycenter.v1.IGroupResult - > - ): void; /** * Filters an organization's assets and groups them by their specified * properties. @@ -2352,6 +2317,37 @@ export class SecurityCenterClient { * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) * for more details and examples. */ + groupAssets( + request?: protos.google.cloud.securitycenter.v1.IGroupAssetsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.securitycenter.v1.IGroupResult[], + protos.google.cloud.securitycenter.v1.IGroupAssetsRequest | null, + protos.google.cloud.securitycenter.v1.IGroupAssetsResponse + ] + >; + groupAssets( + request: protos.google.cloud.securitycenter.v1.IGroupAssetsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.securitycenter.v1.IGroupAssetsRequest, + | protos.google.cloud.securitycenter.v1.IGroupAssetsResponse + | null + | undefined, + protos.google.cloud.securitycenter.v1.IGroupResult + > + ): void; + groupAssets( + request: protos.google.cloud.securitycenter.v1.IGroupAssetsRequest, + callback: PaginationCallback< + protos.google.cloud.securitycenter.v1.IGroupAssetsRequest, + | protos.google.cloud.securitycenter.v1.IGroupAssetsResponse + | null + | undefined, + protos.google.cloud.securitycenter.v1.IGroupResult + > + ): void; groupAssets( request?: protos.google.cloud.securitycenter.v1.IGroupAssetsRequest, optionsOrCallback?: @@ -2702,11 +2698,8 @@ export class SecurityCenterClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) * for more details and examples. - * @example - * const iterable = client.groupAssetsAsync(request); - * for await (const response of iterable) { - * // process response - * } + * @example include:samples/generated/v1/security_center.group_assets.js + * region_tag:securitycenter_v1_generated_SecurityCenter_GroupAssets_async */ groupAssetsAsync( request?: protos.google.cloud.securitycenter.v1.IGroupAssetsRequest, @@ -2720,7 +2713,6 @@ export class SecurityCenterClient { gax.routingHeader.fromParams({ parent: request.parent || '', }); - options = options || {}; const defaultCallSettings = this._defaults['groupAssets']; const callSettings = defaultCallSettings.merge(options); this.initialize(); @@ -2730,37 +2722,6 @@ export class SecurityCenterClient { callSettings ) as AsyncIterable; } - groupFindings( - request?: protos.google.cloud.securitycenter.v1.IGroupFindingsRequest, - options?: CallOptions - ): Promise< - [ - protos.google.cloud.securitycenter.v1.IGroupResult[], - protos.google.cloud.securitycenter.v1.IGroupFindingsRequest | null, - protos.google.cloud.securitycenter.v1.IGroupFindingsResponse - ] - >; - groupFindings( - request: protos.google.cloud.securitycenter.v1.IGroupFindingsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.securitycenter.v1.IGroupFindingsRequest, - | protos.google.cloud.securitycenter.v1.IGroupFindingsResponse - | null - | undefined, - protos.google.cloud.securitycenter.v1.IGroupResult - > - ): void; - groupFindings( - request: protos.google.cloud.securitycenter.v1.IGroupFindingsRequest, - callback: PaginationCallback< - protos.google.cloud.securitycenter.v1.IGroupFindingsRequest, - | protos.google.cloud.securitycenter.v1.IGroupFindingsResponse - | null - | undefined, - protos.google.cloud.securitycenter.v1.IGroupResult - > - ): void; /** * Filters an organization or source's findings and groups them by their * specified properties. @@ -2914,6 +2875,37 @@ export class SecurityCenterClient { * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) * for more details and examples. */ + groupFindings( + request?: protos.google.cloud.securitycenter.v1.IGroupFindingsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.securitycenter.v1.IGroupResult[], + protos.google.cloud.securitycenter.v1.IGroupFindingsRequest | null, + protos.google.cloud.securitycenter.v1.IGroupFindingsResponse + ] + >; + groupFindings( + request: protos.google.cloud.securitycenter.v1.IGroupFindingsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.securitycenter.v1.IGroupFindingsRequest, + | protos.google.cloud.securitycenter.v1.IGroupFindingsResponse + | null + | undefined, + protos.google.cloud.securitycenter.v1.IGroupResult + > + ): void; + groupFindings( + request: protos.google.cloud.securitycenter.v1.IGroupFindingsRequest, + callback: PaginationCallback< + protos.google.cloud.securitycenter.v1.IGroupFindingsRequest, + | protos.google.cloud.securitycenter.v1.IGroupFindingsResponse + | null + | undefined, + protos.google.cloud.securitycenter.v1.IGroupResult + > + ): void; groupFindings( request?: protos.google.cloud.securitycenter.v1.IGroupFindingsRequest, optionsOrCallback?: @@ -3270,11 +3262,8 @@ export class SecurityCenterClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) * for more details and examples. - * @example - * const iterable = client.groupFindingsAsync(request); - * for await (const response of iterable) { - * // process response - * } + * @example include:samples/generated/v1/security_center.group_findings.js + * region_tag:securitycenter_v1_generated_SecurityCenter_GroupFindings_async */ groupFindingsAsync( request?: protos.google.cloud.securitycenter.v1.IGroupFindingsRequest, @@ -3288,7 +3277,6 @@ export class SecurityCenterClient { gax.routingHeader.fromParams({ parent: request.parent || '', }); - options = options || {}; const defaultCallSettings = this._defaults['groupFindings']; const callSettings = defaultCallSettings.merge(options); this.initialize(); @@ -3298,37 +3286,6 @@ export class SecurityCenterClient { callSettings ) as AsyncIterable; } - listAssets( - request?: protos.google.cloud.securitycenter.v1.IListAssetsRequest, - options?: CallOptions - ): Promise< - [ - protos.google.cloud.securitycenter.v1.ListAssetsResponse.IListAssetsResult[], - protos.google.cloud.securitycenter.v1.IListAssetsRequest | null, - protos.google.cloud.securitycenter.v1.IListAssetsResponse - ] - >; - listAssets( - request: protos.google.cloud.securitycenter.v1.IListAssetsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.securitycenter.v1.IListAssetsRequest, - | protos.google.cloud.securitycenter.v1.IListAssetsResponse - | null - | undefined, - protos.google.cloud.securitycenter.v1.ListAssetsResponse.IListAssetsResult - > - ): void; - listAssets( - request: protos.google.cloud.securitycenter.v1.IListAssetsRequest, - callback: PaginationCallback< - protos.google.cloud.securitycenter.v1.IListAssetsRequest, - | protos.google.cloud.securitycenter.v1.IListAssetsResponse - | null - | undefined, - protos.google.cloud.securitycenter.v1.ListAssetsResponse.IListAssetsResult - > - ): void; /** * Lists an organization's assets. * @@ -3477,6 +3434,37 @@ export class SecurityCenterClient { * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) * for more details and examples. */ + listAssets( + request?: protos.google.cloud.securitycenter.v1.IListAssetsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.securitycenter.v1.ListAssetsResponse.IListAssetsResult[], + protos.google.cloud.securitycenter.v1.IListAssetsRequest | null, + protos.google.cloud.securitycenter.v1.IListAssetsResponse + ] + >; + listAssets( + request: protos.google.cloud.securitycenter.v1.IListAssetsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.securitycenter.v1.IListAssetsRequest, + | protos.google.cloud.securitycenter.v1.IListAssetsResponse + | null + | undefined, + protos.google.cloud.securitycenter.v1.ListAssetsResponse.IListAssetsResult + > + ): void; + listAssets( + request: protos.google.cloud.securitycenter.v1.IListAssetsRequest, + callback: PaginationCallback< + protos.google.cloud.securitycenter.v1.IListAssetsRequest, + | protos.google.cloud.securitycenter.v1.IListAssetsResponse + | null + | undefined, + protos.google.cloud.securitycenter.v1.ListAssetsResponse.IListAssetsResult + > + ): void; listAssets( request?: protos.google.cloud.securitycenter.v1.IListAssetsRequest, optionsOrCallback?: @@ -3835,11 +3823,8 @@ export class SecurityCenterClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) * for more details and examples. - * @example - * const iterable = client.listAssetsAsync(request); - * for await (const response of iterable) { - * // process response - * } + * @example include:samples/generated/v1/security_center.list_assets.js + * region_tag:securitycenter_v1_generated_SecurityCenter_ListAssets_async */ listAssetsAsync( request?: protos.google.cloud.securitycenter.v1.IListAssetsRequest, @@ -3853,7 +3838,6 @@ export class SecurityCenterClient { gax.routingHeader.fromParams({ parent: request.parent || '', }); - options = options || {}; const defaultCallSettings = this._defaults['listAssets']; const callSettings = defaultCallSettings.merge(options); this.initialize(); @@ -3863,37 +3847,6 @@ export class SecurityCenterClient { callSettings ) as AsyncIterable; } - listFindings( - request?: protos.google.cloud.securitycenter.v1.IListFindingsRequest, - options?: CallOptions - ): Promise< - [ - protos.google.cloud.securitycenter.v1.ListFindingsResponse.IListFindingsResult[], - protos.google.cloud.securitycenter.v1.IListFindingsRequest | null, - protos.google.cloud.securitycenter.v1.IListFindingsResponse - ] - >; - listFindings( - request: protos.google.cloud.securitycenter.v1.IListFindingsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.securitycenter.v1.IListFindingsRequest, - | protos.google.cloud.securitycenter.v1.IListFindingsResponse - | null - | undefined, - protos.google.cloud.securitycenter.v1.ListFindingsResponse.IListFindingsResult - > - ): void; - listFindings( - request: protos.google.cloud.securitycenter.v1.IListFindingsRequest, - callback: PaginationCallback< - protos.google.cloud.securitycenter.v1.IListFindingsRequest, - | protos.google.cloud.securitycenter.v1.IListFindingsResponse - | null - | undefined, - protos.google.cloud.securitycenter.v1.ListFindingsResponse.IListFindingsResult - > - ): void; /** * Lists an organization or source's findings. * @@ -3971,6 +3924,7 @@ export class SecurityCenterClient { * * resource.project_display_name: `=`, `:` * * resource.type: `=`, `:` * * resource.folders.resource_folder: `=`, `:` + * * resource.display_name: `=`, `:` * @param {string} request.orderBy * Expression that defines what fields and order to use for sorting. The * string value should follow SQL syntax: comma separated list of fields. For @@ -4049,6 +4003,37 @@ export class SecurityCenterClient { * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) * for more details and examples. */ + listFindings( + request?: protos.google.cloud.securitycenter.v1.IListFindingsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.securitycenter.v1.ListFindingsResponse.IListFindingsResult[], + protos.google.cloud.securitycenter.v1.IListFindingsRequest | null, + protos.google.cloud.securitycenter.v1.IListFindingsResponse + ] + >; + listFindings( + request: protos.google.cloud.securitycenter.v1.IListFindingsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.securitycenter.v1.IListFindingsRequest, + | protos.google.cloud.securitycenter.v1.IListFindingsResponse + | null + | undefined, + protos.google.cloud.securitycenter.v1.ListFindingsResponse.IListFindingsResult + > + ): void; + listFindings( + request: protos.google.cloud.securitycenter.v1.IListFindingsRequest, + callback: PaginationCallback< + protos.google.cloud.securitycenter.v1.IListFindingsRequest, + | protos.google.cloud.securitycenter.v1.IListFindingsResponse + | null + | undefined, + protos.google.cloud.securitycenter.v1.ListFindingsResponse.IListFindingsResult + > + ): void; listFindings( request?: protos.google.cloud.securitycenter.v1.IListFindingsRequest, optionsOrCallback?: @@ -4166,6 +4151,7 @@ export class SecurityCenterClient { * * resource.project_display_name: `=`, `:` * * resource.type: `=`, `:` * * resource.folders.resource_folder: `=`, `:` + * * resource.display_name: `=`, `:` * @param {string} request.orderBy * Expression that defines what fields and order to use for sorting. The * string value should follow SQL syntax: comma separated list of fields. For @@ -4340,6 +4326,7 @@ export class SecurityCenterClient { * * resource.project_display_name: `=`, `:` * * resource.type: `=`, `:` * * resource.folders.resource_folder: `=`, `:` + * * resource.display_name: `=`, `:` * @param {string} request.orderBy * Expression that defines what fields and order to use for sorting. The * string value should follow SQL syntax: comma separated list of fields. For @@ -4415,11 +4402,8 @@ export class SecurityCenterClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) * for more details and examples. - * @example - * const iterable = client.listFindingsAsync(request); - * for await (const response of iterable) { - * // process response - * } + * @example include:samples/generated/v1/security_center.list_findings.js + * region_tag:securitycenter_v1_generated_SecurityCenter_ListFindings_async */ listFindingsAsync( request?: protos.google.cloud.securitycenter.v1.IListFindingsRequest, @@ -4433,7 +4417,6 @@ export class SecurityCenterClient { gax.routingHeader.fromParams({ parent: request.parent || '', }); - options = options || {}; const defaultCallSettings = this._defaults['listFindings']; const callSettings = defaultCallSettings.merge(options); this.initialize(); @@ -4443,6 +4426,34 @@ export class SecurityCenterClient { callSettings ) as AsyncIterable; } + /** + * Lists notification configs. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Name of the organization to list notification configs. + * Its format is "organizations/[organization_id]". + * @param {string} request.pageToken + * The value returned by the last `ListNotificationConfigsResponse`; indicates + * that this is a continuation of a prior `ListNotificationConfigs` call, and + * that the system should return the next page of data. + * @param {number} request.pageSize + * The maximum number of results to return in a single response. Default is + * 10, minimum is 1, maximum is 1000. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [NotificationConfig]{@link google.cloud.securitycenter.v1.NotificationConfig}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listNotificationConfigsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ listNotificationConfigs( request?: protos.google.cloud.securitycenter.v1.IListNotificationConfigsRequest, options?: CallOptions @@ -4474,34 +4485,6 @@ export class SecurityCenterClient { protos.google.cloud.securitycenter.v1.INotificationConfig > ): void; - /** - * Lists notification configs. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Name of the organization to list notification configs. - * Its format is "organizations/[organization_id]". - * @param {string} request.pageToken - * The value returned by the last `ListNotificationConfigsResponse`; indicates - * that this is a continuation of a prior `ListNotificationConfigs` call, and - * that the system should return the next page of data. - * @param {number} request.pageSize - * The maximum number of results to return in a single response. Default is - * 10, minimum is 1, maximum is 1000. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of [NotificationConfig]{@link google.cloud.securitycenter.v1.NotificationConfig}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `listNotificationConfigsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ listNotificationConfigs( request?: protos.google.cloud.securitycenter.v1.IListNotificationConfigsRequest, optionsOrCallback?: @@ -4624,11 +4607,8 @@ export class SecurityCenterClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) * for more details and examples. - * @example - * const iterable = client.listNotificationConfigsAsync(request); - * for await (const response of iterable) { - * // process response - * } + * @example include:samples/generated/v1/security_center.list_notification_configs.js + * region_tag:securitycenter_v1_generated_SecurityCenter_ListNotificationConfigs_async */ listNotificationConfigsAsync( request?: protos.google.cloud.securitycenter.v1.IListNotificationConfigsRequest, @@ -4642,7 +4622,6 @@ export class SecurityCenterClient { gax.routingHeader.fromParams({ parent: request.parent || '', }); - options = options || {}; const defaultCallSettings = this._defaults['listNotificationConfigs']; const callSettings = defaultCallSettings.merge(options); this.initialize(); @@ -4652,6 +4631,35 @@ export class SecurityCenterClient { callSettings ) as AsyncIterable; } + /** + * Lists all sources belonging to an organization. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Resource name of the parent of sources to list. Its format should be + * "organizations/[organization_id], folders/[folder_id], or + * projects/[project_id]". + * @param {string} request.pageToken + * The value returned by the last `ListSourcesResponse`; indicates + * that this is a continuation of a prior `ListSources` call, and + * that the system should return the next page of data. + * @param {number} request.pageSize + * The maximum number of results to return in a single response. Default is + * 10, minimum is 1, maximum is 1000. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [Source]{@link google.cloud.securitycenter.v1.Source}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listSourcesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ listSources( request?: protos.google.cloud.securitycenter.v1.IListSourcesRequest, options?: CallOptions @@ -4683,35 +4691,6 @@ export class SecurityCenterClient { protos.google.cloud.securitycenter.v1.ISource > ): void; - /** - * Lists all sources belonging to an organization. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Resource name of the parent of sources to list. Its format should be - * "organizations/[organization_id], folders/[folder_id], or - * projects/[project_id]". - * @param {string} request.pageToken - * The value returned by the last `ListSourcesResponse`; indicates - * that this is a continuation of a prior `ListSources` call, and - * that the system should return the next page of data. - * @param {number} request.pageSize - * The maximum number of results to return in a single response. Default is - * 10, minimum is 1, maximum is 1000. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of [Source]{@link google.cloud.securitycenter.v1.Source}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `listSourcesAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ listSources( request?: protos.google.cloud.securitycenter.v1.IListSourcesRequest, optionsOrCallback?: @@ -4832,11 +4811,8 @@ export class SecurityCenterClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) * for more details and examples. - * @example - * const iterable = client.listSourcesAsync(request); - * for await (const response of iterable) { - * // process response - * } + * @example include:samples/generated/v1/security_center.list_sources.js + * region_tag:securitycenter_v1_generated_SecurityCenter_ListSources_async */ listSourcesAsync( request?: protos.google.cloud.securitycenter.v1.IListSourcesRequest, @@ -4850,7 +4826,6 @@ export class SecurityCenterClient { gax.routingHeader.fromParams({ parent: request.parent || '', }); - options = options || {}; const defaultCallSettings = this._defaults['listSources']; const callSettings = defaultCallSettings.merge(options); this.initialize(); diff --git a/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.ts b/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.ts index 4e8d9ec896b..b10757d17fb 100644 --- a/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.ts +++ b/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.ts @@ -403,6 +403,27 @@ export class SecurityCenterClient { // ------------------- // -- Service calls -- // ------------------- + /** + * Creates a source. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Resource name of the new source's parent. Its format should be + * "organizations/[organization_id]". + * @param {google.cloud.securitycenter.v1beta1.Source} request.source + * Required. The Source being created, only the display_name and description will be + * used. All other fields will be ignored. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Source]{@link google.cloud.securitycenter.v1beta1.Source}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta1/security_center.create_source.js + * region_tag:securitycenter_v1beta1_generated_SecurityCenter_CreateSource_async + */ createSource( request?: protos.google.cloud.securitycenter.v1beta1.ICreateSourceRequest, options?: CallOptions @@ -437,27 +458,6 @@ export class SecurityCenterClient { {} | null | undefined > ): void; - /** - * Creates a source. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Resource name of the new source's parent. Its format should be - * "organizations/[organization_id]". - * @param {google.cloud.securitycenter.v1beta1.Source} request.source - * Required. The Source being created, only the display_name and description will be - * used. All other fields will be ignored. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Source]{@link google.cloud.securitycenter.v1beta1.Source}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * const [response] = await client.createSource(request); - */ createSource( request?: protos.google.cloud.securitycenter.v1beta1.ICreateSourceRequest, optionsOrCallback?: @@ -504,6 +504,32 @@ export class SecurityCenterClient { this.initialize(); return this.innerApiCalls.createSource(request, options, callback); } + /** + * Creates a finding. The corresponding source must exist for finding creation + * to succeed. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Resource name of the new finding's parent. Its format should be + * "organizations/[organization_id]/sources/[source_id]". + * @param {string} request.findingId + * Required. Unique identifier provided by the client within the parent scope. + * It must be alphanumeric and less than or equal to 32 characters and + * greater than 0 characters in length. + * @param {google.cloud.securitycenter.v1beta1.Finding} request.finding + * Required. The Finding being created. The name and security_marks will be ignored as + * they are both output only fields on this resource. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Finding]{@link google.cloud.securitycenter.v1beta1.Finding}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta1/security_center.create_finding.js + * region_tag:securitycenter_v1beta1_generated_SecurityCenter_CreateFinding_async + */ createFinding( request?: protos.google.cloud.securitycenter.v1beta1.ICreateFindingRequest, options?: CallOptions @@ -538,32 +564,6 @@ export class SecurityCenterClient { {} | null | undefined > ): void; - /** - * Creates a finding. The corresponding source must exist for finding creation - * to succeed. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Resource name of the new finding's parent. Its format should be - * "organizations/[organization_id]/sources/[source_id]". - * @param {string} request.findingId - * Required. Unique identifier provided by the client within the parent scope. - * It must be alphanumeric and less than or equal to 32 characters and - * greater than 0 characters in length. - * @param {google.cloud.securitycenter.v1beta1.Finding} request.finding - * Required. The Finding being created. The name and security_marks will be ignored as - * they are both output only fields on this resource. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Finding]{@link google.cloud.securitycenter.v1beta1.Finding}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * const [response] = await client.createFinding(request); - */ createFinding( request?: protos.google.cloud.securitycenter.v1beta1.ICreateFindingRequest, optionsOrCallback?: @@ -610,6 +610,27 @@ export class SecurityCenterClient { this.initialize(); return this.innerApiCalls.createFinding(request, options, callback); } + /** + * Gets the access control policy on the specified Source. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {google.iam.v1.GetPolicyOptions} request.options + * OPTIONAL: A `GetPolicyOptions` object for specifying options to + * `GetIamPolicy`. This field is only used by Cloud IAM. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Policy]{@link google.iam.v1.Policy}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta1/security_center.get_iam_policy.js + * region_tag:securitycenter_v1beta1_generated_SecurityCenter_GetIamPolicy_async + */ getIamPolicy( request?: protos.google.iam.v1.IGetIamPolicyRequest, options?: CallOptions @@ -637,27 +658,6 @@ export class SecurityCenterClient { {} | null | undefined > ): void; - /** - * Gets the access control policy on the specified Source. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy is being requested. - * See the operation documentation for the appropriate value for this field. - * @param {google.iam.v1.GetPolicyOptions} request.options - * OPTIONAL: A `GetPolicyOptions` object for specifying options to - * `GetIamPolicy`. This field is only used by Cloud IAM. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Policy]{@link google.iam.v1.Policy}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * const [response] = await client.getIamPolicy(request); - */ getIamPolicy( request?: protos.google.iam.v1.IGetIamPolicyRequest, optionsOrCallback?: @@ -697,6 +697,24 @@ export class SecurityCenterClient { this.initialize(); return this.innerApiCalls.getIamPolicy(request, options, callback); } + /** + * Gets the settings for an organization. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the organization to get organization settings for. Its format is + * "organizations/[organization_id]/organizationSettings". + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [OrganizationSettings]{@link google.cloud.securitycenter.v1beta1.OrganizationSettings}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta1/security_center.get_organization_settings.js + * region_tag:securitycenter_v1beta1_generated_SecurityCenter_GetOrganizationSettings_async + */ getOrganizationSettings( request?: protos.google.cloud.securitycenter.v1beta1.IGetOrganizationSettingsRequest, options?: CallOptions @@ -731,24 +749,6 @@ export class SecurityCenterClient { {} | null | undefined > ): void; - /** - * Gets the settings for an organization. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. Name of the organization to get organization settings for. Its format is - * "organizations/[organization_id]/organizationSettings". - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [OrganizationSettings]{@link google.cloud.securitycenter.v1beta1.OrganizationSettings}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * const [response] = await client.getOrganizationSettings(request); - */ getOrganizationSettings( request?: protos.google.cloud.securitycenter.v1beta1.IGetOrganizationSettingsRequest, optionsOrCallback?: @@ -799,6 +799,24 @@ export class SecurityCenterClient { callback ); } + /** + * Gets a source. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Relative resource name of the source. Its format is + * "organizations/[organization_id]/source/[source_id]". + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Source]{@link google.cloud.securitycenter.v1beta1.Source}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta1/security_center.get_source.js + * region_tag:securitycenter_v1beta1_generated_SecurityCenter_GetSource_async + */ getSource( request?: protos.google.cloud.securitycenter.v1beta1.IGetSourceRequest, options?: CallOptions @@ -830,24 +848,6 @@ export class SecurityCenterClient { {} | null | undefined > ): void; - /** - * Gets a source. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. Relative resource name of the source. Its format is - * "organizations/[organization_id]/source/[source_id]". - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Source]{@link google.cloud.securitycenter.v1beta1.Source}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * const [response] = await client.getSource(request); - */ getSource( request?: protos.google.cloud.securitycenter.v1beta1.IGetSourceRequest, optionsOrCallback?: @@ -891,6 +891,30 @@ export class SecurityCenterClient { this.initialize(); return this.innerApiCalls.getSource(request, options, callback); } + /** + * Updates the state of a finding. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The relative resource name of the finding. See: + * https://cloud.google.com/apis/design/resource_names#relative_resource_name + * Example: + * "organizations/{organization_id}/sources/{source_id}/finding/{finding_id}". + * @param {google.cloud.securitycenter.v1beta1.Finding.State} request.state + * Required. The desired State of the finding. + * @param {google.protobuf.Timestamp} request.startTime + * Required. The time at which the updated state takes effect. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Finding]{@link google.cloud.securitycenter.v1beta1.Finding}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta1/security_center.set_finding_state.js + * region_tag:securitycenter_v1beta1_generated_SecurityCenter_SetFindingState_async + */ setFindingState( request?: protos.google.cloud.securitycenter.v1beta1.ISetFindingStateRequest, options?: CallOptions @@ -925,30 +949,6 @@ export class SecurityCenterClient { {} | null | undefined > ): void; - /** - * Updates the state of a finding. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The relative resource name of the finding. See: - * https://cloud.google.com/apis/design/resource_names#relative_resource_name - * Example: - * "organizations/{organization_id}/sources/{source_id}/finding/{finding_id}". - * @param {google.cloud.securitycenter.v1beta1.Finding.State} request.state - * Required. The desired State of the finding. - * @param {google.protobuf.Timestamp} request.startTime - * Required. The time at which the updated state takes effect. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Finding]{@link google.cloud.securitycenter.v1beta1.Finding}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * const [response] = await client.setFindingState(request); - */ setFindingState( request?: protos.google.cloud.securitycenter.v1beta1.ISetFindingStateRequest, optionsOrCallback?: @@ -995,6 +995,29 @@ export class SecurityCenterClient { this.initialize(); return this.innerApiCalls.setFindingState(request, options, callback); } + /** + * Sets the access control policy on the specified Source. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy is being specified. + * See the operation documentation for the appropriate value for this field. + * @param {google.iam.v1.Policy} request.policy + * REQUIRED: The complete policy to be applied to the `resource`. The size of + * the policy is limited to a few 10s of KB. An empty policy is a + * valid policy but certain Cloud Platform services (such as Projects) + * might reject them. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Policy]{@link google.iam.v1.Policy}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta1/security_center.set_iam_policy.js + * region_tag:securitycenter_v1beta1_generated_SecurityCenter_SetIamPolicy_async + */ setIamPolicy( request?: protos.google.iam.v1.ISetIamPolicyRequest, options?: CallOptions @@ -1022,29 +1045,6 @@ export class SecurityCenterClient { {} | null | undefined > ): void; - /** - * Sets the access control policy on the specified Source. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy is being specified. - * See the operation documentation for the appropriate value for this field. - * @param {google.iam.v1.Policy} request.policy - * REQUIRED: The complete policy to be applied to the `resource`. The size of - * the policy is limited to a few 10s of KB. An empty policy is a - * valid policy but certain Cloud Platform services (such as Projects) - * might reject them. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Policy]{@link google.iam.v1.Policy}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * const [response] = await client.setIamPolicy(request); - */ setIamPolicy( request?: protos.google.iam.v1.ISetIamPolicyRequest, optionsOrCallback?: @@ -1084,6 +1084,29 @@ export class SecurityCenterClient { this.initialize(); return this.innerApiCalls.setIamPolicy(request, options, callback); } + /** + * Returns the permissions that a caller has on the specified source. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {string[]} request.permissions + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see + * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta1/security_center.test_iam_permissions.js + * region_tag:securitycenter_v1beta1_generated_SecurityCenter_TestIamPermissions_async + */ testIamPermissions( request?: protos.google.iam.v1.ITestIamPermissionsRequest, options?: CallOptions @@ -1108,32 +1131,9 @@ export class SecurityCenterClient { callback: Callback< protos.google.iam.v1.ITestIamPermissionsResponse, protos.google.iam.v1.ITestIamPermissionsRequest | null | undefined, - {} | null | undefined - > - ): void; - /** - * Returns the permissions that a caller has on the specified source. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy detail is being requested. - * See the operation documentation for the appropriate value for this field. - * @param {string[]} request.permissions - * The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For more - * information see - * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * const [response] = await client.testIamPermissions(request); - */ + {} | null | undefined + > + ): void; testIamPermissions( request?: protos.google.iam.v1.ITestIamPermissionsRequest, optionsOrCallback?: @@ -1173,6 +1173,32 @@ export class SecurityCenterClient { this.initialize(); return this.innerApiCalls.testIamPermissions(request, options, callback); } + /** + * Creates or updates a finding. The corresponding source must exist for a + * finding creation to succeed. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.securitycenter.v1beta1.Finding} request.finding + * Required. The finding resource to update or create if it does not already exist. + * parent, security_marks, and update_time will be ignored. + * + * In the case of creation, the finding id portion of the name must + * alphanumeric and less than or equal to 32 characters and greater than 0 + * characters in length. + * @param {google.protobuf.FieldMask} request.updateMask + * The FieldMask to use when updating the finding resource. This field should + * not be specified when creating a finding. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Finding]{@link google.cloud.securitycenter.v1beta1.Finding}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta1/security_center.update_finding.js + * region_tag:securitycenter_v1beta1_generated_SecurityCenter_UpdateFinding_async + */ updateFinding( request?: protos.google.cloud.securitycenter.v1beta1.IUpdateFindingRequest, options?: CallOptions @@ -1207,32 +1233,6 @@ export class SecurityCenterClient { {} | null | undefined > ): void; - /** - * Creates or updates a finding. The corresponding source must exist for a - * finding creation to succeed. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.securitycenter.v1beta1.Finding} request.finding - * Required. The finding resource to update or create if it does not already exist. - * parent, security_marks, and update_time will be ignored. - * - * In the case of creation, the finding id portion of the name must - * alphanumeric and less than or equal to 32 characters and greater than 0 - * characters in length. - * @param {google.protobuf.FieldMask} request.updateMask - * The FieldMask to use when updating the finding resource. This field should - * not be specified when creating a finding. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Finding]{@link google.cloud.securitycenter.v1beta1.Finding}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * const [response] = await client.updateFinding(request); - */ updateFinding( request?: protos.google.cloud.securitycenter.v1beta1.IUpdateFindingRequest, optionsOrCallback?: @@ -1279,6 +1279,25 @@ export class SecurityCenterClient { this.initialize(); return this.innerApiCalls.updateFinding(request, options, callback); } + /** + * Updates an organization's settings. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.securitycenter.v1beta1.OrganizationSettings} request.organizationSettings + * Required. The organization settings resource to update. + * @param {google.protobuf.FieldMask} request.updateMask + * The FieldMask to use when updating the settings resource. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [OrganizationSettings]{@link google.cloud.securitycenter.v1beta1.OrganizationSettings}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta1/security_center.update_organization_settings.js + * region_tag:securitycenter_v1beta1_generated_SecurityCenter_UpdateOrganizationSettings_async + */ updateOrganizationSettings( request?: protos.google.cloud.securitycenter.v1beta1.IUpdateOrganizationSettingsRequest, options?: CallOptions @@ -1313,25 +1332,6 @@ export class SecurityCenterClient { {} | null | undefined > ): void; - /** - * Updates an organization's settings. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.securitycenter.v1beta1.OrganizationSettings} request.organizationSettings - * Required. The organization settings resource to update. - * @param {google.protobuf.FieldMask} request.updateMask - * The FieldMask to use when updating the settings resource. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [OrganizationSettings]{@link google.cloud.securitycenter.v1beta1.OrganizationSettings}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * const [response] = await client.updateOrganizationSettings(request); - */ updateOrganizationSettings( request?: protos.google.cloud.securitycenter.v1beta1.IUpdateOrganizationSettingsRequest, optionsOrCallback?: @@ -1382,6 +1382,25 @@ export class SecurityCenterClient { callback ); } + /** + * Updates a source. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.securitycenter.v1beta1.Source} request.source + * Required. The source resource to update. + * @param {google.protobuf.FieldMask} request.updateMask + * The FieldMask to use when updating the source resource. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Source]{@link google.cloud.securitycenter.v1beta1.Source}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta1/security_center.update_source.js + * region_tag:securitycenter_v1beta1_generated_SecurityCenter_UpdateSource_async + */ updateSource( request?: protos.google.cloud.securitycenter.v1beta1.IUpdateSourceRequest, options?: CallOptions @@ -1416,25 +1435,6 @@ export class SecurityCenterClient { {} | null | undefined > ): void; - /** - * Updates a source. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.securitycenter.v1beta1.Source} request.source - * Required. The source resource to update. - * @param {google.protobuf.FieldMask} request.updateMask - * The FieldMask to use when updating the source resource. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Source]{@link google.cloud.securitycenter.v1beta1.Source}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * const [response] = await client.updateSource(request); - */ updateSource( request?: protos.google.cloud.securitycenter.v1beta1.IUpdateSourceRequest, optionsOrCallback?: @@ -1481,6 +1481,27 @@ export class SecurityCenterClient { this.initialize(); return this.innerApiCalls.updateSource(request, options, callback); } + /** + * Updates security marks. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.securitycenter.v1beta1.SecurityMarks} request.securityMarks + * Required. The security marks resource to update. + * @param {google.protobuf.FieldMask} request.updateMask + * The FieldMask to use when updating the security marks resource. + * @param {google.protobuf.Timestamp} request.startTime + * The time at which the updated SecurityMarks take effect. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [SecurityMarks]{@link google.cloud.securitycenter.v1beta1.SecurityMarks}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta1/security_center.update_security_marks.js + * region_tag:securitycenter_v1beta1_generated_SecurityCenter_UpdateSecurityMarks_async + */ updateSecurityMarks( request?: protos.google.cloud.securitycenter.v1beta1.IUpdateSecurityMarksRequest, options?: CallOptions @@ -1515,27 +1536,6 @@ export class SecurityCenterClient { {} | null | undefined > ): void; - /** - * Updates security marks. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.securitycenter.v1beta1.SecurityMarks} request.securityMarks - * Required. The security marks resource to update. - * @param {google.protobuf.FieldMask} request.updateMask - * The FieldMask to use when updating the security marks resource. - * @param {google.protobuf.Timestamp} request.startTime - * The time at which the updated SecurityMarks take effect. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [SecurityMarks]{@link google.cloud.securitycenter.v1beta1.SecurityMarks}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * const [response] = await client.updateSecurityMarks(request); - */ updateSecurityMarks( request?: protos.google.cloud.securitycenter.v1beta1.IUpdateSecurityMarksRequest, optionsOrCallback?: @@ -1583,6 +1583,31 @@ export class SecurityCenterClient { return this.innerApiCalls.updateSecurityMarks(request, options, callback); } + /** + * Runs asset discovery. The discovery is tracked with a long-running + * operation. + * + * This API can only be called with limited frequency for an organization. If + * it is called too frequently the caller will receive a TOO_MANY_REQUESTS + * error. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Name of the organization to run asset discovery for. Its format is + * "organizations/[organization_id]". + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1beta1/security_center.run_asset_discovery.js + * region_tag:securitycenter_v1beta1_generated_SecurityCenter_RunAssetDiscovery_async + */ runAssetDiscovery( request?: protos.google.cloud.securitycenter.v1beta1.IRunAssetDiscoveryRequest, options?: CallOptions @@ -1610,32 +1635,6 @@ export class SecurityCenterClient { {} | null | undefined > ): void; - /** - * Runs asset discovery. The discovery is tracked with a long-running - * operation. - * - * This API can only be called with limited frequency for an organization. If - * it is called too frequently the caller will receive a TOO_MANY_REQUESTS - * error. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Name of the organization to run asset discovery for. Its format is - * "organizations/[organization_id]". - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * const [operation] = await client.runAssetDiscovery(request); - * const [response] = await operation.promise(); - */ runAssetDiscovery( request?: protos.google.cloud.securitycenter.v1beta1.IRunAssetDiscoveryRequest, optionsOrCallback?: @@ -1687,11 +1686,8 @@ export class SecurityCenterClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. - * @example - * const decodedOperation = await checkRunAssetDiscoveryProgress(name); - * console.log(decodedOperation.result); - * console.log(decodedOperation.done); - * console.log(decodedOperation.metadata); + * @example include:samples/generated/v1beta1/security_center.run_asset_discovery.js + * region_tag:securitycenter_v1beta1_generated_SecurityCenter_RunAssetDiscovery_async */ async checkRunAssetDiscoveryProgress( name: string @@ -1712,37 +1708,6 @@ export class SecurityCenterClient { protos.google.protobuf.Empty >; } - groupAssets( - request?: protos.google.cloud.securitycenter.v1beta1.IGroupAssetsRequest, - options?: CallOptions - ): Promise< - [ - protos.google.cloud.securitycenter.v1beta1.IGroupResult[], - protos.google.cloud.securitycenter.v1beta1.IGroupAssetsRequest | null, - protos.google.cloud.securitycenter.v1beta1.IGroupAssetsResponse - ] - >; - groupAssets( - request: protos.google.cloud.securitycenter.v1beta1.IGroupAssetsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.securitycenter.v1beta1.IGroupAssetsRequest, - | protos.google.cloud.securitycenter.v1beta1.IGroupAssetsResponse - | null - | undefined, - protos.google.cloud.securitycenter.v1beta1.IGroupResult - > - ): void; - groupAssets( - request: protos.google.cloud.securitycenter.v1beta1.IGroupAssetsRequest, - callback: PaginationCallback< - protos.google.cloud.securitycenter.v1beta1.IGroupAssetsRequest, - | protos.google.cloud.securitycenter.v1beta1.IGroupAssetsResponse - | null - | undefined, - protos.google.cloud.securitycenter.v1beta1.IGroupResult - > - ): void; /** * Filters an organization's assets and groups them by their specified * properties. @@ -1842,6 +1807,37 @@ export class SecurityCenterClient { * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) * for more details and examples. */ + groupAssets( + request?: protos.google.cloud.securitycenter.v1beta1.IGroupAssetsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.securitycenter.v1beta1.IGroupResult[], + protos.google.cloud.securitycenter.v1beta1.IGroupAssetsRequest | null, + protos.google.cloud.securitycenter.v1beta1.IGroupAssetsResponse + ] + >; + groupAssets( + request: protos.google.cloud.securitycenter.v1beta1.IGroupAssetsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.securitycenter.v1beta1.IGroupAssetsRequest, + | protos.google.cloud.securitycenter.v1beta1.IGroupAssetsResponse + | null + | undefined, + protos.google.cloud.securitycenter.v1beta1.IGroupResult + > + ): void; + groupAssets( + request: protos.google.cloud.securitycenter.v1beta1.IGroupAssetsRequest, + callback: PaginationCallback< + protos.google.cloud.securitycenter.v1beta1.IGroupAssetsRequest, + | protos.google.cloud.securitycenter.v1beta1.IGroupAssetsResponse + | null + | undefined, + protos.google.cloud.securitycenter.v1beta1.IGroupResult + > + ): void; groupAssets( request?: protos.google.cloud.securitycenter.v1beta1.IGroupAssetsRequest, optionsOrCallback?: @@ -2100,11 +2096,8 @@ export class SecurityCenterClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) * for more details and examples. - * @example - * const iterable = client.groupAssetsAsync(request); - * for await (const response of iterable) { - * // process response - * } + * @example include:samples/generated/v1beta1/security_center.group_assets.js + * region_tag:securitycenter_v1beta1_generated_SecurityCenter_GroupAssets_async */ groupAssetsAsync( request?: protos.google.cloud.securitycenter.v1beta1.IGroupAssetsRequest, @@ -2118,7 +2111,6 @@ export class SecurityCenterClient { gax.routingHeader.fromParams({ parent: request.parent || '', }); - options = options || {}; const defaultCallSettings = this._defaults['groupAssets']; const callSettings = defaultCallSettings.merge(options); this.initialize(); @@ -2128,37 +2120,6 @@ export class SecurityCenterClient { callSettings ) as AsyncIterable; } - groupFindings( - request?: protos.google.cloud.securitycenter.v1beta1.IGroupFindingsRequest, - options?: CallOptions - ): Promise< - [ - protos.google.cloud.securitycenter.v1beta1.IGroupResult[], - protos.google.cloud.securitycenter.v1beta1.IGroupFindingsRequest | null, - protos.google.cloud.securitycenter.v1beta1.IGroupFindingsResponse - ] - >; - groupFindings( - request: protos.google.cloud.securitycenter.v1beta1.IGroupFindingsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.securitycenter.v1beta1.IGroupFindingsRequest, - | protos.google.cloud.securitycenter.v1beta1.IGroupFindingsResponse - | null - | undefined, - protos.google.cloud.securitycenter.v1beta1.IGroupResult - > - ): void; - groupFindings( - request: protos.google.cloud.securitycenter.v1beta1.IGroupFindingsRequest, - callback: PaginationCallback< - protos.google.cloud.securitycenter.v1beta1.IGroupFindingsRequest, - | protos.google.cloud.securitycenter.v1beta1.IGroupFindingsResponse - | null - | undefined, - protos.google.cloud.securitycenter.v1beta1.IGroupResult - > - ): void; /** * Filters an organization or source's findings and groups them by their * specified properties. @@ -2236,6 +2197,37 @@ export class SecurityCenterClient { * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) * for more details and examples. */ + groupFindings( + request?: protos.google.cloud.securitycenter.v1beta1.IGroupFindingsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.securitycenter.v1beta1.IGroupResult[], + protos.google.cloud.securitycenter.v1beta1.IGroupFindingsRequest | null, + protos.google.cloud.securitycenter.v1beta1.IGroupFindingsResponse + ] + >; + groupFindings( + request: protos.google.cloud.securitycenter.v1beta1.IGroupFindingsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.securitycenter.v1beta1.IGroupFindingsRequest, + | protos.google.cloud.securitycenter.v1beta1.IGroupFindingsResponse + | null + | undefined, + protos.google.cloud.securitycenter.v1beta1.IGroupResult + > + ): void; + groupFindings( + request: protos.google.cloud.securitycenter.v1beta1.IGroupFindingsRequest, + callback: PaginationCallback< + protos.google.cloud.securitycenter.v1beta1.IGroupFindingsRequest, + | protos.google.cloud.securitycenter.v1beta1.IGroupFindingsResponse + | null + | undefined, + protos.google.cloud.securitycenter.v1beta1.IGroupResult + > + ): void; groupFindings( request?: protos.google.cloud.securitycenter.v1beta1.IGroupFindingsRequest, optionsOrCallback?: @@ -2444,11 +2436,8 @@ export class SecurityCenterClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) * for more details and examples. - * @example - * const iterable = client.groupFindingsAsync(request); - * for await (const response of iterable) { - * // process response - * } + * @example include:samples/generated/v1beta1/security_center.group_findings.js + * region_tag:securitycenter_v1beta1_generated_SecurityCenter_GroupFindings_async */ groupFindingsAsync( request?: protos.google.cloud.securitycenter.v1beta1.IGroupFindingsRequest, @@ -2462,7 +2451,6 @@ export class SecurityCenterClient { gax.routingHeader.fromParams({ parent: request.parent || '', }); - options = options || {}; const defaultCallSettings = this._defaults['groupFindings']; const callSettings = defaultCallSettings.merge(options); this.initialize(); @@ -2472,37 +2460,6 @@ export class SecurityCenterClient { callSettings ) as AsyncIterable; } - listAssets( - request?: protos.google.cloud.securitycenter.v1beta1.IListAssetsRequest, - options?: CallOptions - ): Promise< - [ - protos.google.cloud.securitycenter.v1beta1.ListAssetsResponse.IListAssetsResult[], - protos.google.cloud.securitycenter.v1beta1.IListAssetsRequest | null, - protos.google.cloud.securitycenter.v1beta1.IListAssetsResponse - ] - >; - listAssets( - request: protos.google.cloud.securitycenter.v1beta1.IListAssetsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.securitycenter.v1beta1.IListAssetsRequest, - | protos.google.cloud.securitycenter.v1beta1.IListAssetsResponse - | null - | undefined, - protos.google.cloud.securitycenter.v1beta1.ListAssetsResponse.IListAssetsResult - > - ): void; - listAssets( - request: protos.google.cloud.securitycenter.v1beta1.IListAssetsRequest, - callback: PaginationCallback< - protos.google.cloud.securitycenter.v1beta1.IListAssetsRequest, - | protos.google.cloud.securitycenter.v1beta1.IListAssetsResponse - | null - | undefined, - protos.google.cloud.securitycenter.v1beta1.ListAssetsResponse.IListAssetsResult - > - ): void; /** * Lists an organization's assets. * @@ -2601,6 +2558,37 @@ export class SecurityCenterClient { * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) * for more details and examples. */ + listAssets( + request?: protos.google.cloud.securitycenter.v1beta1.IListAssetsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.securitycenter.v1beta1.ListAssetsResponse.IListAssetsResult[], + protos.google.cloud.securitycenter.v1beta1.IListAssetsRequest | null, + protos.google.cloud.securitycenter.v1beta1.IListAssetsResponse + ] + >; + listAssets( + request: protos.google.cloud.securitycenter.v1beta1.IListAssetsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.securitycenter.v1beta1.IListAssetsRequest, + | protos.google.cloud.securitycenter.v1beta1.IListAssetsResponse + | null + | undefined, + protos.google.cloud.securitycenter.v1beta1.ListAssetsResponse.IListAssetsResult + > + ): void; + listAssets( + request: protos.google.cloud.securitycenter.v1beta1.IListAssetsRequest, + callback: PaginationCallback< + protos.google.cloud.securitycenter.v1beta1.IListAssetsRequest, + | protos.google.cloud.securitycenter.v1beta1.IListAssetsResponse + | null + | undefined, + protos.google.cloud.securitycenter.v1beta1.ListAssetsResponse.IListAssetsResult + > + ): void; listAssets( request?: protos.google.cloud.securitycenter.v1beta1.IListAssetsRequest, optionsOrCallback?: @@ -2859,11 +2847,8 @@ export class SecurityCenterClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) * for more details and examples. - * @example - * const iterable = client.listAssetsAsync(request); - * for await (const response of iterable) { - * // process response - * } + * @example include:samples/generated/v1beta1/security_center.list_assets.js + * region_tag:securitycenter_v1beta1_generated_SecurityCenter_ListAssets_async */ listAssetsAsync( request?: protos.google.cloud.securitycenter.v1beta1.IListAssetsRequest, @@ -2877,7 +2862,6 @@ export class SecurityCenterClient { gax.routingHeader.fromParams({ parent: request.parent || '', }); - options = options || {}; const defaultCallSettings = this._defaults['listAssets']; const callSettings = defaultCallSettings.merge(options); this.initialize(); @@ -2887,37 +2871,6 @@ export class SecurityCenterClient { callSettings ) as AsyncIterable; } - listFindings( - request?: protos.google.cloud.securitycenter.v1beta1.IListFindingsRequest, - options?: CallOptions - ): Promise< - [ - protos.google.cloud.securitycenter.v1beta1.IFinding[], - protos.google.cloud.securitycenter.v1beta1.IListFindingsRequest | null, - protos.google.cloud.securitycenter.v1beta1.IListFindingsResponse - ] - >; - listFindings( - request: protos.google.cloud.securitycenter.v1beta1.IListFindingsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.securitycenter.v1beta1.IListFindingsRequest, - | protos.google.cloud.securitycenter.v1beta1.IListFindingsResponse - | null - | undefined, - protos.google.cloud.securitycenter.v1beta1.IFinding - > - ): void; - listFindings( - request: protos.google.cloud.securitycenter.v1beta1.IListFindingsRequest, - callback: PaginationCallback< - protos.google.cloud.securitycenter.v1beta1.IListFindingsRequest, - | protos.google.cloud.securitycenter.v1beta1.IListFindingsResponse - | null - | undefined, - protos.google.cloud.securitycenter.v1beta1.IFinding - > - ): void; /** * Lists an organization or source's findings. * @@ -2994,6 +2947,37 @@ export class SecurityCenterClient { * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) * for more details and examples. */ + listFindings( + request?: protos.google.cloud.securitycenter.v1beta1.IListFindingsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.securitycenter.v1beta1.IFinding[], + protos.google.cloud.securitycenter.v1beta1.IListFindingsRequest | null, + protos.google.cloud.securitycenter.v1beta1.IListFindingsResponse + ] + >; + listFindings( + request: protos.google.cloud.securitycenter.v1beta1.IListFindingsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.securitycenter.v1beta1.IListFindingsRequest, + | protos.google.cloud.securitycenter.v1beta1.IListFindingsResponse + | null + | undefined, + protos.google.cloud.securitycenter.v1beta1.IFinding + > + ): void; + listFindings( + request: protos.google.cloud.securitycenter.v1beta1.IListFindingsRequest, + callback: PaginationCallback< + protos.google.cloud.securitycenter.v1beta1.IListFindingsRequest, + | protos.google.cloud.securitycenter.v1beta1.IListFindingsResponse + | null + | undefined, + protos.google.cloud.securitycenter.v1beta1.IFinding + > + ): void; listFindings( request?: protos.google.cloud.securitycenter.v1beta1.IListFindingsRequest, optionsOrCallback?: @@ -3202,11 +3186,8 @@ export class SecurityCenterClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) * for more details and examples. - * @example - * const iterable = client.listFindingsAsync(request); - * for await (const response of iterable) { - * // process response - * } + * @example include:samples/generated/v1beta1/security_center.list_findings.js + * region_tag:securitycenter_v1beta1_generated_SecurityCenter_ListFindings_async */ listFindingsAsync( request?: protos.google.cloud.securitycenter.v1beta1.IListFindingsRequest, @@ -3220,7 +3201,6 @@ export class SecurityCenterClient { gax.routingHeader.fromParams({ parent: request.parent || '', }); - options = options || {}; const defaultCallSettings = this._defaults['listFindings']; const callSettings = defaultCallSettings.merge(options); this.initialize(); @@ -3230,6 +3210,34 @@ export class SecurityCenterClient { callSettings ) as AsyncIterable; } + /** + * Lists all sources belonging to an organization. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Resource name of the parent of sources to list. Its format should be + * "organizations/[organization_id]". + * @param {string} request.pageToken + * The value returned by the last `ListSourcesResponse`; indicates + * that this is a continuation of a prior `ListSources` call, and + * that the system should return the next page of data. + * @param {number} request.pageSize + * The maximum number of results to return in a single response. Default is + * 10, minimum is 1, maximum is 1000. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [Source]{@link google.cloud.securitycenter.v1beta1.Source}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listSourcesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ listSources( request?: protos.google.cloud.securitycenter.v1beta1.IListSourcesRequest, options?: CallOptions @@ -3261,34 +3269,6 @@ export class SecurityCenterClient { protos.google.cloud.securitycenter.v1beta1.ISource > ): void; - /** - * Lists all sources belonging to an organization. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Resource name of the parent of sources to list. Its format should be - * "organizations/[organization_id]". - * @param {string} request.pageToken - * The value returned by the last `ListSourcesResponse`; indicates - * that this is a continuation of a prior `ListSources` call, and - * that the system should return the next page of data. - * @param {number} request.pageSize - * The maximum number of results to return in a single response. Default is - * 10, minimum is 1, maximum is 1000. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of [Source]{@link google.cloud.securitycenter.v1beta1.Source}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `listSourcesAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ listSources( request?: protos.google.cloud.securitycenter.v1beta1.IListSourcesRequest, optionsOrCallback?: @@ -3407,11 +3387,8 @@ export class SecurityCenterClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) * for more details and examples. - * @example - * const iterable = client.listSourcesAsync(request); - * for await (const response of iterable) { - * // process response - * } + * @example include:samples/generated/v1beta1/security_center.list_sources.js + * region_tag:securitycenter_v1beta1_generated_SecurityCenter_ListSources_async */ listSourcesAsync( request?: protos.google.cloud.securitycenter.v1beta1.IListSourcesRequest, @@ -3425,7 +3402,6 @@ export class SecurityCenterClient { gax.routingHeader.fromParams({ parent: request.parent || '', }); - options = options || {}; const defaultCallSettings = this._defaults['listSources']; const callSettings = defaultCallSettings.merge(options); this.initialize(); diff --git a/packages/google-cloud-securitycenter/src/v1p1beta1/security_center_client.ts b/packages/google-cloud-securitycenter/src/v1p1beta1/security_center_client.ts index f11ea946a70..054b07d677f 100644 --- a/packages/google-cloud-securitycenter/src/v1p1beta1/security_center_client.ts +++ b/packages/google-cloud-securitycenter/src/v1p1beta1/security_center_client.ts @@ -448,6 +448,27 @@ export class SecurityCenterClient { // ------------------- // -- Service calls -- // ------------------- + /** + * Creates a source. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Resource name of the new source's parent. Its format should be + * "organizations/[organization_id]". + * @param {google.cloud.securitycenter.v1p1beta1.Source} request.source + * Required. The Source being created, only the display_name and description will be + * used. All other fields will be ignored. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Source]{@link google.cloud.securitycenter.v1p1beta1.Source}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1p1beta1/security_center.create_source.js + * region_tag:securitycenter_v1p1beta1_generated_SecurityCenter_CreateSource_async + */ createSource( request?: protos.google.cloud.securitycenter.v1p1beta1.ICreateSourceRequest, options?: CallOptions @@ -482,27 +503,6 @@ export class SecurityCenterClient { {} | null | undefined > ): void; - /** - * Creates a source. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Resource name of the new source's parent. Its format should be - * "organizations/[organization_id]". - * @param {google.cloud.securitycenter.v1p1beta1.Source} request.source - * Required. The Source being created, only the display_name and description will be - * used. All other fields will be ignored. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Source]{@link google.cloud.securitycenter.v1p1beta1.Source}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * const [response] = await client.createSource(request); - */ createSource( request?: protos.google.cloud.securitycenter.v1p1beta1.ICreateSourceRequest, optionsOrCallback?: @@ -549,6 +549,30 @@ export class SecurityCenterClient { this.initialize(); return this.innerApiCalls.createSource(request, options, callback); } + /** + * Creates a finding. The corresponding source must exist for finding + * creation to succeed. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Resource name of the new finding's parent. Its format should be + * "organizations/[organization_id]/sources/[source_id]". + * @param {string} request.findingId + * Required. Unique identifier provided by the client within the parent scope. + * @param {google.cloud.securitycenter.v1p1beta1.Finding} request.finding + * Required. The Finding being created. The name and security_marks will be ignored as + * they are both output only fields on this resource. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Finding]{@link google.cloud.securitycenter.v1p1beta1.Finding}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1p1beta1/security_center.create_finding.js + * region_tag:securitycenter_v1p1beta1_generated_SecurityCenter_CreateFinding_async + */ createFinding( request?: protos.google.cloud.securitycenter.v1p1beta1.ICreateFindingRequest, options?: CallOptions @@ -583,30 +607,6 @@ export class SecurityCenterClient { {} | null | undefined > ): void; - /** - * Creates a finding. The corresponding source must exist for finding - * creation to succeed. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Resource name of the new finding's parent. Its format should be - * "organizations/[organization_id]/sources/[source_id]". - * @param {string} request.findingId - * Required. Unique identifier provided by the client within the parent scope. - * @param {google.cloud.securitycenter.v1p1beta1.Finding} request.finding - * Required. The Finding being created. The name and security_marks will be ignored as - * they are both output only fields on this resource. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Finding]{@link google.cloud.securitycenter.v1p1beta1.Finding}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * const [response] = await client.createFinding(request); - */ createFinding( request?: protos.google.cloud.securitycenter.v1p1beta1.ICreateFindingRequest, optionsOrCallback?: @@ -653,6 +653,31 @@ export class SecurityCenterClient { this.initialize(); return this.innerApiCalls.createFinding(request, options, callback); } + /** + * Creates a notification config. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Resource name of the new notification config's parent. Its format is + * "organizations/[organization_id]". + * @param {string} request.configId + * Required. Unique identifier provided by the client within the parent scope. + * It must be between 1 and 128 characters, and contains alphanumeric + * characters, underscores or hyphens only. + * @param {google.cloud.securitycenter.v1p1beta1.NotificationConfig} request.notificationConfig + * Required. The notification config being created. The name and the service account + * will be ignored as they are both output only fields on this resource. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [NotificationConfig]{@link google.cloud.securitycenter.v1p1beta1.NotificationConfig}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1p1beta1/security_center.create_notification_config.js + * region_tag:securitycenter_v1p1beta1_generated_SecurityCenter_CreateNotificationConfig_async + */ createNotificationConfig( request?: protos.google.cloud.securitycenter.v1p1beta1.ICreateNotificationConfigRequest, options?: CallOptions @@ -687,31 +712,6 @@ export class SecurityCenterClient { {} | null | undefined > ): void; - /** - * Creates a notification config. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Resource name of the new notification config's parent. Its format is - * "organizations/[organization_id]". - * @param {string} request.configId - * Required. Unique identifier provided by the client within the parent scope. - * It must be between 1 and 128 characters, and contains alphanumeric - * characters, underscores or hyphens only. - * @param {google.cloud.securitycenter.v1p1beta1.NotificationConfig} request.notificationConfig - * Required. The notification config being created. The name and the service account - * will be ignored as they are both output only fields on this resource. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [NotificationConfig]{@link google.cloud.securitycenter.v1p1beta1.NotificationConfig}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * const [response] = await client.createNotificationConfig(request); - */ createNotificationConfig( request?: protos.google.cloud.securitycenter.v1p1beta1.ICreateNotificationConfigRequest, optionsOrCallback?: @@ -762,6 +762,24 @@ export class SecurityCenterClient { callback ); } + /** + * Deletes a notification config. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the notification config to delete. Its format is + * "organizations/[organization_id]/notificationConfigs/[config_id]". + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1p1beta1/security_center.delete_notification_config.js + * region_tag:securitycenter_v1p1beta1_generated_SecurityCenter_DeleteNotificationConfig_async + */ deleteNotificationConfig( request?: protos.google.cloud.securitycenter.v1p1beta1.IDeleteNotificationConfigRequest, options?: CallOptions @@ -796,24 +814,6 @@ export class SecurityCenterClient { {} | null | undefined > ): void; - /** - * Deletes a notification config. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. Name of the notification config to delete. Its format is - * "organizations/[organization_id]/notificationConfigs/[config_id]". - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * const [response] = await client.deleteNotificationConfig(request); - */ deleteNotificationConfig( request?: protos.google.cloud.securitycenter.v1p1beta1.IDeleteNotificationConfigRequest, optionsOrCallback?: @@ -864,6 +864,27 @@ export class SecurityCenterClient { callback ); } + /** + * Gets the access control policy on the specified Source. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {google.iam.v1.GetPolicyOptions} request.options + * OPTIONAL: A `GetPolicyOptions` object for specifying options to + * `GetIamPolicy`. This field is only used by Cloud IAM. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Policy]{@link google.iam.v1.Policy}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1p1beta1/security_center.get_iam_policy.js + * region_tag:securitycenter_v1p1beta1_generated_SecurityCenter_GetIamPolicy_async + */ getIamPolicy( request?: protos.google.iam.v1.IGetIamPolicyRequest, options?: CallOptions @@ -891,27 +912,6 @@ export class SecurityCenterClient { {} | null | undefined > ): void; - /** - * Gets the access control policy on the specified Source. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy is being requested. - * See the operation documentation for the appropriate value for this field. - * @param {google.iam.v1.GetPolicyOptions} request.options - * OPTIONAL: A `GetPolicyOptions` object for specifying options to - * `GetIamPolicy`. This field is only used by Cloud IAM. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Policy]{@link google.iam.v1.Policy}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * const [response] = await client.getIamPolicy(request); - */ getIamPolicy( request?: protos.google.iam.v1.IGetIamPolicyRequest, optionsOrCallback?: @@ -951,6 +951,24 @@ export class SecurityCenterClient { this.initialize(); return this.innerApiCalls.getIamPolicy(request, options, callback); } + /** + * Gets a notification config. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the notification config to get. Its format is + * "organizations/[organization_id]/notificationConfigs/[config_id]". + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [NotificationConfig]{@link google.cloud.securitycenter.v1p1beta1.NotificationConfig}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1p1beta1/security_center.get_notification_config.js + * region_tag:securitycenter_v1p1beta1_generated_SecurityCenter_GetNotificationConfig_async + */ getNotificationConfig( request?: protos.google.cloud.securitycenter.v1p1beta1.IGetNotificationConfigRequest, options?: CallOptions @@ -985,24 +1003,6 @@ export class SecurityCenterClient { {} | null | undefined > ): void; - /** - * Gets a notification config. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. Name of the notification config to get. Its format is - * "organizations/[organization_id]/notificationConfigs/[config_id]". - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [NotificationConfig]{@link google.cloud.securitycenter.v1p1beta1.NotificationConfig}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * const [response] = await client.getNotificationConfig(request); - */ getNotificationConfig( request?: protos.google.cloud.securitycenter.v1p1beta1.IGetNotificationConfigRequest, optionsOrCallback?: @@ -1049,6 +1049,24 @@ export class SecurityCenterClient { this.initialize(); return this.innerApiCalls.getNotificationConfig(request, options, callback); } + /** + * Gets the settings for an organization. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the organization to get organization settings for. Its format is + * "organizations/[organization_id]/organizationSettings". + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [OrganizationSettings]{@link google.cloud.securitycenter.v1p1beta1.OrganizationSettings}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1p1beta1/security_center.get_organization_settings.js + * region_tag:securitycenter_v1p1beta1_generated_SecurityCenter_GetOrganizationSettings_async + */ getOrganizationSettings( request?: protos.google.cloud.securitycenter.v1p1beta1.IGetOrganizationSettingsRequest, options?: CallOptions @@ -1083,24 +1101,6 @@ export class SecurityCenterClient { {} | null | undefined > ): void; - /** - * Gets the settings for an organization. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. Name of the organization to get organization settings for. Its format is - * "organizations/[organization_id]/organizationSettings". - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [OrganizationSettings]{@link google.cloud.securitycenter.v1p1beta1.OrganizationSettings}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * const [response] = await client.getOrganizationSettings(request); - */ getOrganizationSettings( request?: protos.google.cloud.securitycenter.v1p1beta1.IGetOrganizationSettingsRequest, optionsOrCallback?: @@ -1151,6 +1151,24 @@ export class SecurityCenterClient { callback ); } + /** + * Gets a source. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Relative resource name of the source. Its format is + * "organizations/[organization_id]/source/[source_id]". + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Source]{@link google.cloud.securitycenter.v1p1beta1.Source}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1p1beta1/security_center.get_source.js + * region_tag:securitycenter_v1p1beta1_generated_SecurityCenter_GetSource_async + */ getSource( request?: protos.google.cloud.securitycenter.v1p1beta1.IGetSourceRequest, options?: CallOptions @@ -1185,24 +1203,6 @@ export class SecurityCenterClient { {} | null | undefined > ): void; - /** - * Gets a source. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. Relative resource name of the source. Its format is - * "organizations/[organization_id]/source/[source_id]". - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Source]{@link google.cloud.securitycenter.v1p1beta1.Source}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * const [response] = await client.getSource(request); - */ getSource( request?: protos.google.cloud.securitycenter.v1p1beta1.IGetSourceRequest, optionsOrCallback?: @@ -1249,6 +1249,30 @@ export class SecurityCenterClient { this.initialize(); return this.innerApiCalls.getSource(request, options, callback); } + /** + * Updates the state of a finding. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The relative resource name of the finding. See: + * https://cloud.google.com/apis/design/resource_names#relative_resource_name + * Example: + * "organizations/{organization_id}/sources/{source_id}/finding/{finding_id}". + * @param {google.cloud.securitycenter.v1p1beta1.Finding.State} request.state + * Required. The desired State of the finding. + * @param {google.protobuf.Timestamp} request.startTime + * Required. The time at which the updated state takes effect. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Finding]{@link google.cloud.securitycenter.v1p1beta1.Finding}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1p1beta1/security_center.set_finding_state.js + * region_tag:securitycenter_v1p1beta1_generated_SecurityCenter_SetFindingState_async + */ setFindingState( request?: protos.google.cloud.securitycenter.v1p1beta1.ISetFindingStateRequest, options?: CallOptions @@ -1283,30 +1307,6 @@ export class SecurityCenterClient { {} | null | undefined > ): void; - /** - * Updates the state of a finding. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The relative resource name of the finding. See: - * https://cloud.google.com/apis/design/resource_names#relative_resource_name - * Example: - * "organizations/{organization_id}/sources/{source_id}/finding/{finding_id}". - * @param {google.cloud.securitycenter.v1p1beta1.Finding.State} request.state - * Required. The desired State of the finding. - * @param {google.protobuf.Timestamp} request.startTime - * Required. The time at which the updated state takes effect. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Finding]{@link google.cloud.securitycenter.v1p1beta1.Finding}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * const [response] = await client.setFindingState(request); - */ setFindingState( request?: protos.google.cloud.securitycenter.v1p1beta1.ISetFindingStateRequest, optionsOrCallback?: @@ -1353,6 +1353,29 @@ export class SecurityCenterClient { this.initialize(); return this.innerApiCalls.setFindingState(request, options, callback); } + /** + * Sets the access control policy on the specified Source. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy is being specified. + * See the operation documentation for the appropriate value for this field. + * @param {google.iam.v1.Policy} request.policy + * REQUIRED: The complete policy to be applied to the `resource`. The size of + * the policy is limited to a few 10s of KB. An empty policy is a + * valid policy but certain Cloud Platform services (such as Projects) + * might reject them. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Policy]{@link google.iam.v1.Policy}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1p1beta1/security_center.set_iam_policy.js + * region_tag:securitycenter_v1p1beta1_generated_SecurityCenter_SetIamPolicy_async + */ setIamPolicy( request?: protos.google.iam.v1.ISetIamPolicyRequest, options?: CallOptions @@ -1380,29 +1403,6 @@ export class SecurityCenterClient { {} | null | undefined > ): void; - /** - * Sets the access control policy on the specified Source. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy is being specified. - * See the operation documentation for the appropriate value for this field. - * @param {google.iam.v1.Policy} request.policy - * REQUIRED: The complete policy to be applied to the `resource`. The size of - * the policy is limited to a few 10s of KB. An empty policy is a - * valid policy but certain Cloud Platform services (such as Projects) - * might reject them. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Policy]{@link google.iam.v1.Policy}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * const [response] = await client.setIamPolicy(request); - */ setIamPolicy( request?: protos.google.iam.v1.ISetIamPolicyRequest, optionsOrCallback?: @@ -1442,6 +1442,29 @@ export class SecurityCenterClient { this.initialize(); return this.innerApiCalls.setIamPolicy(request, options, callback); } + /** + * Returns the permissions that a caller has on the specified source. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {string[]} request.permissions + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see + * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1p1beta1/security_center.test_iam_permissions.js + * region_tag:securitycenter_v1p1beta1_generated_SecurityCenter_TestIamPermissions_async + */ testIamPermissions( request?: protos.google.iam.v1.ITestIamPermissionsRequest, options?: CallOptions @@ -1469,29 +1492,6 @@ export class SecurityCenterClient { {} | null | undefined > ): void; - /** - * Returns the permissions that a caller has on the specified source. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy detail is being requested. - * See the operation documentation for the appropriate value for this field. - * @param {string[]} request.permissions - * The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For more - * information see - * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * const [response] = await client.testIamPermissions(request); - */ testIamPermissions( request?: protos.google.iam.v1.ITestIamPermissionsRequest, optionsOrCallback?: @@ -1531,6 +1531,37 @@ export class SecurityCenterClient { this.initialize(); return this.innerApiCalls.testIamPermissions(request, options, callback); } + /** + * Creates or updates a finding. The corresponding source must exist for a + * finding creation to succeed. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.securitycenter.v1p1beta1.Finding} request.finding + * Required. The finding resource to update or create if it does not already exist. + * parent, security_marks, and update_time will be ignored. + * + * In the case of creation, the finding id portion of the name must be + * alphanumeric and less than or equal to 32 characters and greater than 0 + * characters in length. + * @param {google.protobuf.FieldMask} request.updateMask + * The FieldMask to use when updating the finding resource. This field should + * not be specified when creating a finding. + * + * When updating a finding, an empty mask is treated as updating all mutable + * fields and replacing source_properties. Individual source_properties can + * be added/updated by using "source_properties." in the field + * mask. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Finding]{@link google.cloud.securitycenter.v1p1beta1.Finding}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1p1beta1/security_center.update_finding.js + * region_tag:securitycenter_v1p1beta1_generated_SecurityCenter_UpdateFinding_async + */ updateFinding( request?: protos.google.cloud.securitycenter.v1p1beta1.IUpdateFindingRequest, options?: CallOptions @@ -1565,37 +1596,6 @@ export class SecurityCenterClient { {} | null | undefined > ): void; - /** - * Creates or updates a finding. The corresponding source must exist for a - * finding creation to succeed. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.securitycenter.v1p1beta1.Finding} request.finding - * Required. The finding resource to update or create if it does not already exist. - * parent, security_marks, and update_time will be ignored. - * - * In the case of creation, the finding id portion of the name must be - * alphanumeric and less than or equal to 32 characters and greater than 0 - * characters in length. - * @param {google.protobuf.FieldMask} request.updateMask - * The FieldMask to use when updating the finding resource. This field should - * not be specified when creating a finding. - * - * When updating a finding, an empty mask is treated as updating all mutable - * fields and replacing source_properties. Individual source_properties can - * be added/updated by using "source_properties." in the field - * mask. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Finding]{@link google.cloud.securitycenter.v1p1beta1.Finding}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * const [response] = await client.updateFinding(request); - */ updateFinding( request?: protos.google.cloud.securitycenter.v1p1beta1.IUpdateFindingRequest, optionsOrCallback?: @@ -1642,6 +1642,28 @@ export class SecurityCenterClient { this.initialize(); return this.innerApiCalls.updateFinding(request, options, callback); } + /** + * Updates a notification config. The following update + * fields are allowed: description, pubsub_topic, streaming_config.filter + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.securitycenter.v1p1beta1.NotificationConfig} request.notificationConfig + * Required. The notification config to update. + * @param {google.protobuf.FieldMask} request.updateMask + * The FieldMask to use when updating the notification config. + * + * If empty all mutable fields will be updated. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [NotificationConfig]{@link google.cloud.securitycenter.v1p1beta1.NotificationConfig}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1p1beta1/security_center.update_notification_config.js + * region_tag:securitycenter_v1p1beta1_generated_SecurityCenter_UpdateNotificationConfig_async + */ updateNotificationConfig( request?: protos.google.cloud.securitycenter.v1p1beta1.IUpdateNotificationConfigRequest, options?: CallOptions @@ -1676,28 +1698,6 @@ export class SecurityCenterClient { {} | null | undefined > ): void; - /** - * Updates a notification config. The following update - * fields are allowed: description, pubsub_topic, streaming_config.filter - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.securitycenter.v1p1beta1.NotificationConfig} request.notificationConfig - * Required. The notification config to update. - * @param {google.protobuf.FieldMask} request.updateMask - * The FieldMask to use when updating the notification config. - * - * If empty all mutable fields will be updated. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [NotificationConfig]{@link google.cloud.securitycenter.v1p1beta1.NotificationConfig}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * const [response] = await client.updateNotificationConfig(request); - */ updateNotificationConfig( request?: protos.google.cloud.securitycenter.v1p1beta1.IUpdateNotificationConfigRequest, optionsOrCallback?: @@ -1748,6 +1748,27 @@ export class SecurityCenterClient { callback ); } + /** + * Updates an organization's settings. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.securitycenter.v1p1beta1.OrganizationSettings} request.organizationSettings + * Required. The organization settings resource to update. + * @param {google.protobuf.FieldMask} request.updateMask + * The FieldMask to use when updating the settings resource. + * + * If empty all mutable fields will be updated. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [OrganizationSettings]{@link google.cloud.securitycenter.v1p1beta1.OrganizationSettings}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1p1beta1/security_center.update_organization_settings.js + * region_tag:securitycenter_v1p1beta1_generated_SecurityCenter_UpdateOrganizationSettings_async + */ updateOrganizationSettings( request?: protos.google.cloud.securitycenter.v1p1beta1.IUpdateOrganizationSettingsRequest, options?: CallOptions @@ -1773,37 +1794,16 @@ export class SecurityCenterClient { > ): void; updateOrganizationSettings( - request: protos.google.cloud.securitycenter.v1p1beta1.IUpdateOrganizationSettingsRequest, - callback: Callback< - protos.google.cloud.securitycenter.v1p1beta1.IOrganizationSettings, - | protos.google.cloud.securitycenter.v1p1beta1.IUpdateOrganizationSettingsRequest - | null - | undefined, - {} | null | undefined - > - ): void; - /** - * Updates an organization's settings. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.securitycenter.v1p1beta1.OrganizationSettings} request.organizationSettings - * Required. The organization settings resource to update. - * @param {google.protobuf.FieldMask} request.updateMask - * The FieldMask to use when updating the settings resource. - * - * If empty all mutable fields will be updated. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [OrganizationSettings]{@link google.cloud.securitycenter.v1p1beta1.OrganizationSettings}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * const [response] = await client.updateOrganizationSettings(request); - */ - updateOrganizationSettings( + request: protos.google.cloud.securitycenter.v1p1beta1.IUpdateOrganizationSettingsRequest, + callback: Callback< + protos.google.cloud.securitycenter.v1p1beta1.IOrganizationSettings, + | protos.google.cloud.securitycenter.v1p1beta1.IUpdateOrganizationSettingsRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateOrganizationSettings( request?: protos.google.cloud.securitycenter.v1p1beta1.IUpdateOrganizationSettingsRequest, optionsOrCallback?: | CallOptions @@ -1853,6 +1853,27 @@ export class SecurityCenterClient { callback ); } + /** + * Updates a source. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.securitycenter.v1p1beta1.Source} request.source + * Required. The source resource to update. + * @param {google.protobuf.FieldMask} request.updateMask + * The FieldMask to use when updating the source resource. + * + * If empty all mutable fields will be updated. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Source]{@link google.cloud.securitycenter.v1p1beta1.Source}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1p1beta1/security_center.update_source.js + * region_tag:securitycenter_v1p1beta1_generated_SecurityCenter_UpdateSource_async + */ updateSource( request?: protos.google.cloud.securitycenter.v1p1beta1.IUpdateSourceRequest, options?: CallOptions @@ -1887,27 +1908,6 @@ export class SecurityCenterClient { {} | null | undefined > ): void; - /** - * Updates a source. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.securitycenter.v1p1beta1.Source} request.source - * Required. The source resource to update. - * @param {google.protobuf.FieldMask} request.updateMask - * The FieldMask to use when updating the source resource. - * - * If empty all mutable fields will be updated. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Source]{@link google.cloud.securitycenter.v1p1beta1.Source}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * const [response] = await client.updateSource(request); - */ updateSource( request?: protos.google.cloud.securitycenter.v1p1beta1.IUpdateSourceRequest, optionsOrCallback?: @@ -1954,6 +1954,33 @@ export class SecurityCenterClient { this.initialize(); return this.innerApiCalls.updateSource(request, options, callback); } + /** + * Updates security marks. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.securitycenter.v1p1beta1.SecurityMarks} request.securityMarks + * Required. The security marks resource to update. + * @param {google.protobuf.FieldMask} request.updateMask + * The FieldMask to use when updating the security marks resource. + * + * The field mask must not contain duplicate fields. + * If empty or set to "marks", all marks will be replaced. Individual + * marks can be updated using "marks.". + * @param {google.protobuf.Timestamp} request.startTime + * The time at which the updated SecurityMarks take effect. + * If not set uses current server time. Updates will be applied to the + * SecurityMarks that are active immediately preceding this time. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [SecurityMarks]{@link google.cloud.securitycenter.v1p1beta1.SecurityMarks}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1p1beta1/security_center.update_security_marks.js + * region_tag:securitycenter_v1p1beta1_generated_SecurityCenter_UpdateSecurityMarks_async + */ updateSecurityMarks( request?: protos.google.cloud.securitycenter.v1p1beta1.IUpdateSecurityMarksRequest, options?: CallOptions @@ -1988,33 +2015,6 @@ export class SecurityCenterClient { {} | null | undefined > ): void; - /** - * Updates security marks. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.securitycenter.v1p1beta1.SecurityMarks} request.securityMarks - * Required. The security marks resource to update. - * @param {google.protobuf.FieldMask} request.updateMask - * The FieldMask to use when updating the security marks resource. - * - * The field mask must not contain duplicate fields. - * If empty or set to "marks", all marks will be replaced. Individual - * marks can be updated using "marks.". - * @param {google.protobuf.Timestamp} request.startTime - * The time at which the updated SecurityMarks take effect. - * If not set uses current server time. Updates will be applied to the - * SecurityMarks that are active immediately preceding this time. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [SecurityMarks]{@link google.cloud.securitycenter.v1p1beta1.SecurityMarks}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * const [response] = await client.updateSecurityMarks(request); - */ updateSecurityMarks( request?: protos.google.cloud.securitycenter.v1p1beta1.IUpdateSecurityMarksRequest, optionsOrCallback?: @@ -2062,6 +2062,31 @@ export class SecurityCenterClient { return this.innerApiCalls.updateSecurityMarks(request, options, callback); } + /** + * Runs asset discovery. The discovery is tracked with a long-running + * operation. + * + * This API can only be called with limited frequency for an organization. If + * it is called too frequently the caller will receive a TOO_MANY_REQUESTS + * error. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Name of the organization to run asset discovery for. Its format is + * "organizations/[organization_id]". + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1p1beta1/security_center.run_asset_discovery.js + * region_tag:securitycenter_v1p1beta1_generated_SecurityCenter_RunAssetDiscovery_async + */ runAssetDiscovery( request?: protos.google.cloud.securitycenter.v1p1beta1.IRunAssetDiscoveryRequest, options?: CallOptions @@ -2098,32 +2123,6 @@ export class SecurityCenterClient { {} | null | undefined > ): void; - /** - * Runs asset discovery. The discovery is tracked with a long-running - * operation. - * - * This API can only be called with limited frequency for an organization. If - * it is called too frequently the caller will receive a TOO_MANY_REQUESTS - * error. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Name of the organization to run asset discovery for. Its format is - * "organizations/[organization_id]". - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * const [operation] = await client.runAssetDiscovery(request); - * const [response] = await operation.promise(); - */ runAssetDiscovery( request?: protos.google.cloud.securitycenter.v1p1beta1.IRunAssetDiscoveryRequest, optionsOrCallback?: @@ -2181,11 +2180,8 @@ export class SecurityCenterClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. - * @example - * const decodedOperation = await checkRunAssetDiscoveryProgress(name); - * console.log(decodedOperation.result); - * console.log(decodedOperation.done); - * console.log(decodedOperation.metadata); + * @example include:samples/generated/v1p1beta1/security_center.run_asset_discovery.js + * region_tag:securitycenter_v1p1beta1_generated_SecurityCenter_RunAssetDiscovery_async */ async checkRunAssetDiscoveryProgress( name: string @@ -2209,37 +2205,6 @@ export class SecurityCenterClient { protos.google.protobuf.Empty >; } - groupAssets( - request?: protos.google.cloud.securitycenter.v1p1beta1.IGroupAssetsRequest, - options?: CallOptions - ): Promise< - [ - protos.google.cloud.securitycenter.v1p1beta1.IGroupResult[], - protos.google.cloud.securitycenter.v1p1beta1.IGroupAssetsRequest | null, - protos.google.cloud.securitycenter.v1p1beta1.IGroupAssetsResponse - ] - >; - groupAssets( - request: protos.google.cloud.securitycenter.v1p1beta1.IGroupAssetsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.securitycenter.v1p1beta1.IGroupAssetsRequest, - | protos.google.cloud.securitycenter.v1p1beta1.IGroupAssetsResponse - | null - | undefined, - protos.google.cloud.securitycenter.v1p1beta1.IGroupResult - > - ): void; - groupAssets( - request: protos.google.cloud.securitycenter.v1p1beta1.IGroupAssetsRequest, - callback: PaginationCallback< - protos.google.cloud.securitycenter.v1p1beta1.IGroupAssetsRequest, - | protos.google.cloud.securitycenter.v1p1beta1.IGroupAssetsResponse - | null - | undefined, - protos.google.cloud.securitycenter.v1p1beta1.IGroupResult - > - ): void; /** * Filters an organization's assets and groups them by their specified * properties. @@ -2385,6 +2350,37 @@ export class SecurityCenterClient { * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) * for more details and examples. */ + groupAssets( + request?: protos.google.cloud.securitycenter.v1p1beta1.IGroupAssetsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.securitycenter.v1p1beta1.IGroupResult[], + protos.google.cloud.securitycenter.v1p1beta1.IGroupAssetsRequest | null, + protos.google.cloud.securitycenter.v1p1beta1.IGroupAssetsResponse + ] + >; + groupAssets( + request: protos.google.cloud.securitycenter.v1p1beta1.IGroupAssetsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.securitycenter.v1p1beta1.IGroupAssetsRequest, + | protos.google.cloud.securitycenter.v1p1beta1.IGroupAssetsResponse + | null + | undefined, + protos.google.cloud.securitycenter.v1p1beta1.IGroupResult + > + ): void; + groupAssets( + request: protos.google.cloud.securitycenter.v1p1beta1.IGroupAssetsRequest, + callback: PaginationCallback< + protos.google.cloud.securitycenter.v1p1beta1.IGroupAssetsRequest, + | protos.google.cloud.securitycenter.v1p1beta1.IGroupAssetsResponse + | null + | undefined, + protos.google.cloud.securitycenter.v1p1beta1.IGroupResult + > + ): void; groupAssets( request?: protos.google.cloud.securitycenter.v1p1beta1.IGroupAssetsRequest, optionsOrCallback?: @@ -2735,11 +2731,8 @@ export class SecurityCenterClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) * for more details and examples. - * @example - * const iterable = client.groupAssetsAsync(request); - * for await (const response of iterable) { - * // process response - * } + * @example include:samples/generated/v1p1beta1/security_center.group_assets.js + * region_tag:securitycenter_v1p1beta1_generated_SecurityCenter_GroupAssets_async */ groupAssetsAsync( request?: protos.google.cloud.securitycenter.v1p1beta1.IGroupAssetsRequest, @@ -2753,7 +2746,6 @@ export class SecurityCenterClient { gax.routingHeader.fromParams({ parent: request.parent || '', }); - options = options || {}; const defaultCallSettings = this._defaults['groupAssets']; const callSettings = defaultCallSettings.merge(options); this.initialize(); @@ -2763,37 +2755,6 @@ export class SecurityCenterClient { callSettings ) as AsyncIterable; } - groupFindings( - request?: protos.google.cloud.securitycenter.v1p1beta1.IGroupFindingsRequest, - options?: CallOptions - ): Promise< - [ - protos.google.cloud.securitycenter.v1p1beta1.IGroupResult[], - protos.google.cloud.securitycenter.v1p1beta1.IGroupFindingsRequest | null, - protos.google.cloud.securitycenter.v1p1beta1.IGroupFindingsResponse - ] - >; - groupFindings( - request: protos.google.cloud.securitycenter.v1p1beta1.IGroupFindingsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.securitycenter.v1p1beta1.IGroupFindingsRequest, - | protos.google.cloud.securitycenter.v1p1beta1.IGroupFindingsResponse - | null - | undefined, - protos.google.cloud.securitycenter.v1p1beta1.IGroupResult - > - ): void; - groupFindings( - request: protos.google.cloud.securitycenter.v1p1beta1.IGroupFindingsRequest, - callback: PaginationCallback< - protos.google.cloud.securitycenter.v1p1beta1.IGroupFindingsRequest, - | protos.google.cloud.securitycenter.v1p1beta1.IGroupFindingsResponse - | null - | undefined, - protos.google.cloud.securitycenter.v1p1beta1.IGroupResult - > - ): void; /** * Filters an organization or source's findings and groups them by their * specified properties. @@ -2938,6 +2899,37 @@ export class SecurityCenterClient { * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) * for more details and examples. */ + groupFindings( + request?: protos.google.cloud.securitycenter.v1p1beta1.IGroupFindingsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.securitycenter.v1p1beta1.IGroupResult[], + protos.google.cloud.securitycenter.v1p1beta1.IGroupFindingsRequest | null, + protos.google.cloud.securitycenter.v1p1beta1.IGroupFindingsResponse + ] + >; + groupFindings( + request: protos.google.cloud.securitycenter.v1p1beta1.IGroupFindingsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.securitycenter.v1p1beta1.IGroupFindingsRequest, + | protos.google.cloud.securitycenter.v1p1beta1.IGroupFindingsResponse + | null + | undefined, + protos.google.cloud.securitycenter.v1p1beta1.IGroupResult + > + ): void; + groupFindings( + request: protos.google.cloud.securitycenter.v1p1beta1.IGroupFindingsRequest, + callback: PaginationCallback< + protos.google.cloud.securitycenter.v1p1beta1.IGroupFindingsRequest, + | protos.google.cloud.securitycenter.v1p1beta1.IGroupFindingsResponse + | null + | undefined, + protos.google.cloud.securitycenter.v1p1beta1.IGroupResult + > + ): void; groupFindings( request?: protos.google.cloud.securitycenter.v1p1beta1.IGroupFindingsRequest, optionsOrCallback?: @@ -3276,11 +3268,8 @@ export class SecurityCenterClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) * for more details and examples. - * @example - * const iterable = client.groupFindingsAsync(request); - * for await (const response of iterable) { - * // process response - * } + * @example include:samples/generated/v1p1beta1/security_center.group_findings.js + * region_tag:securitycenter_v1p1beta1_generated_SecurityCenter_GroupFindings_async */ groupFindingsAsync( request?: protos.google.cloud.securitycenter.v1p1beta1.IGroupFindingsRequest, @@ -3294,7 +3283,6 @@ export class SecurityCenterClient { gax.routingHeader.fromParams({ parent: request.parent || '', }); - options = options || {}; const defaultCallSettings = this._defaults['groupFindings']; const callSettings = defaultCallSettings.merge(options); this.initialize(); @@ -3304,37 +3292,6 @@ export class SecurityCenterClient { callSettings ) as AsyncIterable; } - listAssets( - request?: protos.google.cloud.securitycenter.v1p1beta1.IListAssetsRequest, - options?: CallOptions - ): Promise< - [ - protos.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.IListAssetsResult[], - protos.google.cloud.securitycenter.v1p1beta1.IListAssetsRequest | null, - protos.google.cloud.securitycenter.v1p1beta1.IListAssetsResponse - ] - >; - listAssets( - request: protos.google.cloud.securitycenter.v1p1beta1.IListAssetsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.securitycenter.v1p1beta1.IListAssetsRequest, - | protos.google.cloud.securitycenter.v1p1beta1.IListAssetsResponse - | null - | undefined, - protos.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.IListAssetsResult - > - ): void; - listAssets( - request: protos.google.cloud.securitycenter.v1p1beta1.IListAssetsRequest, - callback: PaginationCallback< - protos.google.cloud.securitycenter.v1p1beta1.IListAssetsRequest, - | protos.google.cloud.securitycenter.v1p1beta1.IListAssetsResponse - | null - | undefined, - protos.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.IListAssetsResult - > - ): void; /** * Lists an organization's assets. * @@ -3483,6 +3440,37 @@ export class SecurityCenterClient { * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) * for more details and examples. */ + listAssets( + request?: protos.google.cloud.securitycenter.v1p1beta1.IListAssetsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.IListAssetsResult[], + protos.google.cloud.securitycenter.v1p1beta1.IListAssetsRequest | null, + protos.google.cloud.securitycenter.v1p1beta1.IListAssetsResponse + ] + >; + listAssets( + request: protos.google.cloud.securitycenter.v1p1beta1.IListAssetsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.securitycenter.v1p1beta1.IListAssetsRequest, + | protos.google.cloud.securitycenter.v1p1beta1.IListAssetsResponse + | null + | undefined, + protos.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.IListAssetsResult + > + ): void; + listAssets( + request: protos.google.cloud.securitycenter.v1p1beta1.IListAssetsRequest, + callback: PaginationCallback< + protos.google.cloud.securitycenter.v1p1beta1.IListAssetsRequest, + | protos.google.cloud.securitycenter.v1p1beta1.IListAssetsResponse + | null + | undefined, + protos.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.IListAssetsResult + > + ): void; listAssets( request?: protos.google.cloud.securitycenter.v1p1beta1.IListAssetsRequest, optionsOrCallback?: @@ -3841,11 +3829,8 @@ export class SecurityCenterClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) * for more details and examples. - * @example - * const iterable = client.listAssetsAsync(request); - * for await (const response of iterable) { - * // process response - * } + * @example include:samples/generated/v1p1beta1/security_center.list_assets.js + * region_tag:securitycenter_v1p1beta1_generated_SecurityCenter_ListAssets_async */ listAssetsAsync( request?: protos.google.cloud.securitycenter.v1p1beta1.IListAssetsRequest, @@ -3859,7 +3844,6 @@ export class SecurityCenterClient { gax.routingHeader.fromParams({ parent: request.parent || '', }); - options = options || {}; const defaultCallSettings = this._defaults['listAssets']; const callSettings = defaultCallSettings.merge(options); this.initialize(); @@ -3869,37 +3853,6 @@ export class SecurityCenterClient { callSettings ) as AsyncIterable; } - listFindings( - request?: protos.google.cloud.securitycenter.v1p1beta1.IListFindingsRequest, - options?: CallOptions - ): Promise< - [ - protos.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.IListFindingsResult[], - protos.google.cloud.securitycenter.v1p1beta1.IListFindingsRequest | null, - protos.google.cloud.securitycenter.v1p1beta1.IListFindingsResponse - ] - >; - listFindings( - request: protos.google.cloud.securitycenter.v1p1beta1.IListFindingsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.securitycenter.v1p1beta1.IListFindingsRequest, - | protos.google.cloud.securitycenter.v1p1beta1.IListFindingsResponse - | null - | undefined, - protos.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.IListFindingsResult - > - ): void; - listFindings( - request: protos.google.cloud.securitycenter.v1p1beta1.IListFindingsRequest, - callback: PaginationCallback< - protos.google.cloud.securitycenter.v1p1beta1.IListFindingsRequest, - | protos.google.cloud.securitycenter.v1p1beta1.IListFindingsResponse - | null - | undefined, - protos.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.IListFindingsResult - > - ): void; /** * Lists an organization or source's findings. * @@ -4045,6 +3998,37 @@ export class SecurityCenterClient { * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) * for more details and examples. */ + listFindings( + request?: protos.google.cloud.securitycenter.v1p1beta1.IListFindingsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.IListFindingsResult[], + protos.google.cloud.securitycenter.v1p1beta1.IListFindingsRequest | null, + protos.google.cloud.securitycenter.v1p1beta1.IListFindingsResponse + ] + >; + listFindings( + request: protos.google.cloud.securitycenter.v1p1beta1.IListFindingsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.securitycenter.v1p1beta1.IListFindingsRequest, + | protos.google.cloud.securitycenter.v1p1beta1.IListFindingsResponse + | null + | undefined, + protos.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.IListFindingsResult + > + ): void; + listFindings( + request: protos.google.cloud.securitycenter.v1p1beta1.IListFindingsRequest, + callback: PaginationCallback< + protos.google.cloud.securitycenter.v1p1beta1.IListFindingsRequest, + | protos.google.cloud.securitycenter.v1p1beta1.IListFindingsResponse + | null + | undefined, + protos.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.IListFindingsResult + > + ): void; listFindings( request?: protos.google.cloud.securitycenter.v1p1beta1.IListFindingsRequest, optionsOrCallback?: @@ -4391,11 +4375,8 @@ export class SecurityCenterClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) * for more details and examples. - * @example - * const iterable = client.listFindingsAsync(request); - * for await (const response of iterable) { - * // process response - * } + * @example include:samples/generated/v1p1beta1/security_center.list_findings.js + * region_tag:securitycenter_v1p1beta1_generated_SecurityCenter_ListFindings_async */ listFindingsAsync( request?: protos.google.cloud.securitycenter.v1p1beta1.IListFindingsRequest, @@ -4409,7 +4390,6 @@ export class SecurityCenterClient { gax.routingHeader.fromParams({ parent: request.parent || '', }); - options = options || {}; const defaultCallSettings = this._defaults['listFindings']; const callSettings = defaultCallSettings.merge(options); this.initialize(); @@ -4419,6 +4399,34 @@ export class SecurityCenterClient { callSettings ) as AsyncIterable; } + /** + * Lists notification configs. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Name of the organization to list notification configs. + * Its format is "organizations/[organization_id]". + * @param {string} request.pageToken + * The value returned by the last `ListNotificationConfigsResponse`; indicates + * that this is a continuation of a prior `ListNotificationConfigs` call, and + * that the system should return the next page of data. + * @param {number} request.pageSize + * The maximum number of results to return in a single response. Default is + * 10, minimum is 1, maximum is 1000. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [NotificationConfig]{@link google.cloud.securitycenter.v1p1beta1.NotificationConfig}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listNotificationConfigsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ listNotificationConfigs( request?: protos.google.cloud.securitycenter.v1p1beta1.IListNotificationConfigsRequest, options?: CallOptions @@ -4450,34 +4458,6 @@ export class SecurityCenterClient { protos.google.cloud.securitycenter.v1p1beta1.INotificationConfig > ): void; - /** - * Lists notification configs. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Name of the organization to list notification configs. - * Its format is "organizations/[organization_id]". - * @param {string} request.pageToken - * The value returned by the last `ListNotificationConfigsResponse`; indicates - * that this is a continuation of a prior `ListNotificationConfigs` call, and - * that the system should return the next page of data. - * @param {number} request.pageSize - * The maximum number of results to return in a single response. Default is - * 10, minimum is 1, maximum is 1000. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of [NotificationConfig]{@link google.cloud.securitycenter.v1p1beta1.NotificationConfig}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `listNotificationConfigsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ listNotificationConfigs( request?: protos.google.cloud.securitycenter.v1p1beta1.IListNotificationConfigsRequest, optionsOrCallback?: @@ -4600,11 +4580,8 @@ export class SecurityCenterClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) * for more details and examples. - * @example - * const iterable = client.listNotificationConfigsAsync(request); - * for await (const response of iterable) { - * // process response - * } + * @example include:samples/generated/v1p1beta1/security_center.list_notification_configs.js + * region_tag:securitycenter_v1p1beta1_generated_SecurityCenter_ListNotificationConfigs_async */ listNotificationConfigsAsync( request?: protos.google.cloud.securitycenter.v1p1beta1.IListNotificationConfigsRequest, @@ -4618,7 +4595,6 @@ export class SecurityCenterClient { gax.routingHeader.fromParams({ parent: request.parent || '', }); - options = options || {}; const defaultCallSettings = this._defaults['listNotificationConfigs']; const callSettings = defaultCallSettings.merge(options); this.initialize(); @@ -4628,6 +4604,35 @@ export class SecurityCenterClient { callSettings ) as AsyncIterable; } + /** + * Lists all sources belonging to an organization. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Resource name of the parent of sources to list. Its format should be + * "organizations/[organization_id], folders/[folder_id], or + * projects/[project_id]". + * @param {string} request.pageToken + * The value returned by the last `ListSourcesResponse`; indicates + * that this is a continuation of a prior `ListSources` call, and + * that the system should return the next page of data. + * @param {number} request.pageSize + * The maximum number of results to return in a single response. Default is + * 10, minimum is 1, maximum is 1000. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [Source]{@link google.cloud.securitycenter.v1p1beta1.Source}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listSourcesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ listSources( request?: protos.google.cloud.securitycenter.v1p1beta1.IListSourcesRequest, options?: CallOptions @@ -4659,35 +4664,6 @@ export class SecurityCenterClient { protos.google.cloud.securitycenter.v1p1beta1.ISource > ): void; - /** - * Lists all sources belonging to an organization. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Resource name of the parent of sources to list. Its format should be - * "organizations/[organization_id], folders/[folder_id], or - * projects/[project_id]". - * @param {string} request.pageToken - * The value returned by the last `ListSourcesResponse`; indicates - * that this is a continuation of a prior `ListSources` call, and - * that the system should return the next page of data. - * @param {number} request.pageSize - * The maximum number of results to return in a single response. Default is - * 10, minimum is 1, maximum is 1000. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of [Source]{@link google.cloud.securitycenter.v1p1beta1.Source}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `listSourcesAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ listSources( request?: protos.google.cloud.securitycenter.v1p1beta1.IListSourcesRequest, optionsOrCallback?: @@ -4808,11 +4784,8 @@ export class SecurityCenterClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) * for more details and examples. - * @example - * const iterable = client.listSourcesAsync(request); - * for await (const response of iterable) { - * // process response - * } + * @example include:samples/generated/v1p1beta1/security_center.list_sources.js + * region_tag:securitycenter_v1p1beta1_generated_SecurityCenter_ListSources_async */ listSourcesAsync( request?: protos.google.cloud.securitycenter.v1p1beta1.IListSourcesRequest, @@ -4826,7 +4799,6 @@ export class SecurityCenterClient { gax.routingHeader.fromParams({ parent: request.parent || '', }); - options = options || {}; const defaultCallSettings = this._defaults['listSources']; const callSettings = defaultCallSettings.merge(options); this.initialize(); From e8d356698aa652b72626fc77ab65ab00ed6c5512 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Wed, 10 Nov 2021 14:13:59 -0800 Subject: [PATCH 285/342] docs: fix docstring formatting (#437) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * docs: fix docstring formatting Committer: @parthea PiperOrigin-RevId: 408564402 Source-Link: https://github.com/googleapis/googleapis/commit/3020af5118bf135a2ac279d39093cbbfd343d0f8 Source-Link: https://github.com/googleapis/googleapis-gen/commit/799c505014cbad999e2bd3dca4f5e1f68bde5aa2 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNzk5YzUwNTAxNGNiYWQ5OTllMmJkM2RjYTRmNWUxZjY4YmRlNWFhMiJ9 * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot --- .../cloud/securitycenter/v1p1beta1/securitycenter_service.proto | 2 +- .../v1p1beta1/security_center.update_organization_settings.js | 2 +- .../src/v1p1beta1/security_center_client.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/securitycenter_service.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/securitycenter_service.proto index d127dd7214a..958e69714cf 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/securitycenter_service.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/securitycenter_service.proto @@ -1317,7 +1317,7 @@ message UpdateOrganizationSettingsRequest { // The FieldMask to use when updating the settings resource. // - // If empty all mutable fields will be updated. + // If empty all mutable fields will be updated. google.protobuf.FieldMask update_mask = 2; } diff --git a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.update_organization_settings.js b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.update_organization_settings.js index 169ddaf075f..b9084384656 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.update_organization_settings.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.update_organization_settings.js @@ -25,7 +25,7 @@ function main(organizationSettings) { // const organizationSettings = {} /** * The FieldMask to use when updating the settings resource. - * If empty all mutable fields will be updated. + * If empty all mutable fields will be updated. */ // const updateMask = {} diff --git a/packages/google-cloud-securitycenter/src/v1p1beta1/security_center_client.ts b/packages/google-cloud-securitycenter/src/v1p1beta1/security_center_client.ts index 054b07d677f..a36a4d9bfea 100644 --- a/packages/google-cloud-securitycenter/src/v1p1beta1/security_center_client.ts +++ b/packages/google-cloud-securitycenter/src/v1p1beta1/security_center_client.ts @@ -1758,7 +1758,7 @@ export class SecurityCenterClient { * @param {google.protobuf.FieldMask} request.updateMask * The FieldMask to use when updating the settings resource. * - * If empty all mutable fields will be updated. + * If empty all mutable fields will be updated. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. From cd9addcda66035b56a3f4a9cda0ddc9f30928304 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Mon, 15 Nov 2021 10:19:55 -0800 Subject: [PATCH 286/342] feat: Added mute related APIs, proto messages and fields (#438) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: Added mute related APIs, proto messages and fields PiperOrigin-RevId: 409484892 Source-Link: https://github.com/googleapis/googleapis/commit/2de80fe0fa2e31bcf1a831dbe8c5354de6407152 Source-Link: https://github.com/googleapis/googleapis-gen/commit/48307f80a428f4bd3398d3ab6a52168c9c0cd406 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNDgzMDdmODBhNDI4ZjRiZDMzOThkM2FiNmE1MjE2OGM5YzBjZDQwNiJ9 * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot --- .../cloud/securitycenter/v1/finding.proto | 27 + .../cloud/securitycenter/v1/mute_config.proto | 90 + .../v1/securitycenter_service.proto | 283 + .../protos/protos.d.ts | 1169 ++- .../protos/protos.js | 8162 +++++++++++------ .../protos/protos.json | 437 + .../v1/security_center.bulk_mute_findings.js | 78 + .../v1/security_center.create_mute_config.js | 67 + .../v1/security_center.delete_mute_config.js | 55 + .../v1/security_center.get_mute_config.js | 55 + .../v1/security_center.list_mute_configs.js | 70 + .../generated/v1/security_center.set_mute.js | 62 + .../v1/security_center.update_mute_config.js | 57 + .../src/v1/gapic_metadata.json | 74 + .../src/v1/security_center_client.ts | 1061 ++- .../src/v1/security_center_client_config.json | 28 + .../src/v1/security_center_proto_list.json | 1 + .../test/gapic_security_center_v1.ts | 2655 ++++-- 18 files changed, 10915 insertions(+), 3516 deletions(-) create mode 100644 packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/mute_config.proto create mode 100644 packages/google-cloud-securitycenter/samples/generated/v1/security_center.bulk_mute_findings.js create mode 100644 packages/google-cloud-securitycenter/samples/generated/v1/security_center.create_mute_config.js create mode 100644 packages/google-cloud-securitycenter/samples/generated/v1/security_center.delete_mute_config.js create mode 100644 packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_mute_config.js create mode 100644 packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_mute_configs.js create mode 100644 packages/google-cloud-securitycenter/samples/generated/v1/security_center.set_mute.js create mode 100644 packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_mute_config.js diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/finding.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/finding.proto index e14266b44db..d914a6984ea 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/finding.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/finding.proto @@ -119,6 +119,21 @@ message Finding { LOW = 4; } + // Mute state a finding can be in. + enum Mute { + // Unspecified. + MUTE_UNSPECIFIED = 0; + + // Finding has been muted. + MUTED = 1; + + // Finding has been unmuted. + UNMUTED = 2; + + // Finding has never been muted/unmuted. + UNDEFINED = 4; + } + // Represents what kind of Finding it is. enum FindingClass { // Unspecified finding class. @@ -207,6 +222,10 @@ message Finding { // finding. string canonical_name = 14; + // Indicates the mute state of a finding (either unspecified, muted, unmuted + // or undefined). + Mute mute = 15; + // The class of the finding. FindingClass finding_class = 17; @@ -221,4 +240,12 @@ message Finding { // CVE stands for Common Vulnerabilities and Exposures // (https://cve.mitre.org/about/) Vulnerability vulnerability = 20; + + // Output only. The most recent time this finding was muted or unmuted. + google.protobuf.Timestamp mute_update_time = 21 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // First known as mute_annotation. Records additional information about the + // mute operation e.g. mute config that muted the finding, user who muted the + // finding, etc. + string mute_initiator = 28; } diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/mute_config.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/mute_config.proto new file mode 100644 index 00000000000..78d63a66bbd --- /dev/null +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/mute_config.proto @@ -0,0 +1,90 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.securitycenter.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/timestamp.proto"; +import "google/api/annotations.proto"; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1;securitycenter"; +option java_multiple_files = true; +option java_outer_classname = "MuteConfigProto"; +option java_package = "com.google.cloud.securitycenter.v1"; +option php_namespace = "Google\\Cloud\\SecurityCenter\\V1"; +option ruby_package = "Google::Cloud::SecurityCenter::V1"; + +// A mute config is a Cloud SCC resource that contains the configuration +// to mute create/update events of findings. +message MuteConfig { + option (google.api.resource) = { + type: "securitycenter.googleapis.com/MuteConfig" + pattern: "organizations/{organization}/muteConfigs/{mute_config}" + pattern: "folders/{folder}/muteConfigs/{mute_config}" + pattern: "projects/{project}/muteConfigs/{mute_config}" + }; + + // This field will be ignored if provided on config creation. Format + // "organizations/{organization}/muteConfigs/{mute_config}" + // "folders/{folder}/muteConfigs/{mute_config}" + // "projects/{project}/muteConfigs/{mute_config}" + string name = 1; + + // The human readable name to be displayed for the mute config. + string display_name = 2 [deprecated = true]; + + // A description of the mute config. + string description = 3; + + // Required. An expression that defines the filter to apply across create/update events + // of findings. While creating a filter string, be mindful of the + // scope in which the mute configuration is being created. E.g., If a filter + // contains project = X but is created under the project = Y scope, it might + // not match any findings. + // + // The following field and operator combinations are supported: + // + // * severity: `=`, `:` + // * category: `=`, `:` + // * resource.name: `=`, `:` + // * resource.project_name: `=`, `:` + // * resource.project_display_name: `=`, `:` + // * resource.folders.resource_folder: `=`, `:` + // * resource.parent_name: `=`, `:` + // * resource.parent_display_name: `=`, `:` + // * resource.type: `=`, `:` + // * finding_class: `=`, `:` + // * indicator.ip_addresses: `=`, `:` + // * indicator.domains: `=`, `:` + string filter = 4 [(google.api.field_behavior) = REQUIRED]; + + // Output only. The time at which the mute config was created. + // This field is set by the server and will be ignored if provided on config + // creation. + google.protobuf.Timestamp create_time = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The most recent time at which the mute config was updated. + // This field is set by the server and will be ignored if provided on config + // creation or update. + google.protobuf.Timestamp update_time = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Email address of the user who last edited the mute config. + // This field is set by the server and will be ignored if provided on config + // creation or update. + string most_recent_editor = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/securitycenter_service.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/securitycenter_service.proto index 89f89a0cd99..a7690a177cc 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/securitycenter_service.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/securitycenter_service.proto @@ -24,6 +24,7 @@ import "google/api/resource.proto"; import "google/cloud/securitycenter/v1/asset.proto"; import "google/cloud/securitycenter/v1/finding.proto"; import "google/cloud/securitycenter/v1/folder.proto"; +import "google/cloud/securitycenter/v1/mute_config.proto"; import "google/cloud/securitycenter/v1/notification_config.proto"; import "google/cloud/securitycenter/v1/organization_settings.proto"; import "google/cloud/securitycenter/v1/security_marks.proto"; @@ -49,6 +50,29 @@ service SecurityCenter { option (google.api.default_host) = "securitycenter.googleapis.com"; option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + // Kicks off an LRO to bulk mute findings for a parent based on a filter. The + // parent can be either an organization, folder or project. The findings + // matched by the filter will be muted after the LRO is done. + rpc BulkMuteFindings(BulkMuteFindingsRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=organizations/*}/findings:bulkMute" + body: "*" + additional_bindings { + post: "/v1/{parent=folders/*}/findings:bulkMute" + body: "*" + } + additional_bindings { + post: "/v1/{parent=projects/*}/findings:bulkMute" + body: "*" + } + }; + option (google.api.method_signature) = "parent"; + option (google.longrunning.operation_info) = { + response_type: "google.cloud.securitycenter.v1.BulkMuteFindingsResponse" + metadata_type: "google.protobuf.Empty" + }; + } + // Creates a source. rpc CreateSource(CreateSourceRequest) returns (Source) { option (google.api.http) = { @@ -68,6 +92,24 @@ service SecurityCenter { option (google.api.method_signature) = "parent,finding_id,finding"; } + // Creates a mute config. + rpc CreateMuteConfig(CreateMuteConfigRequest) returns (MuteConfig) { + option (google.api.http) = { + post: "/v1/{parent=organizations/*}/muteConfigs" + body: "mute_config" + additional_bindings { + post: "/v1/{parent=folders/*}/muteConfigs" + body: "mute_config" + } + additional_bindings { + post: "/v1/{parent=projects/*}/muteConfigs" + body: "mute_config" + } + }; + option (google.api.method_signature) = "parent,mute_config"; + option (google.api.method_signature) = "parent,mute_config,mute_config_id"; + } + // Creates a notification config. rpc CreateNotificationConfig(CreateNotificationConfigRequest) returns (NotificationConfig) { option (google.api.http) = { @@ -78,6 +120,20 @@ service SecurityCenter { option (google.api.method_signature) = "parent,notification_config"; } + // Deletes an existing mute config. + rpc DeleteMuteConfig(DeleteMuteConfigRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1/{name=organizations/*/muteConfigs/*}" + additional_bindings { + delete: "/v1/{name=folders/*/muteConfigs/*}" + } + additional_bindings { + delete: "/v1/{name=projects/*/muteConfigs/*}" + } + }; + option (google.api.method_signature) = "name"; + } + // Deletes a notification config. rpc DeleteNotificationConfig(DeleteNotificationConfigRequest) returns (google.protobuf.Empty) { option (google.api.http) = { @@ -95,6 +151,20 @@ service SecurityCenter { option (google.api.method_signature) = "resource"; } + // Gets a mute config. + rpc GetMuteConfig(GetMuteConfigRequest) returns (MuteConfig) { + option (google.api.http) = { + get: "/v1/{name=organizations/*/muteConfigs/*}" + additional_bindings { + get: "/v1/{name=folders/*/muteConfigs/*}" + } + additional_bindings { + get: "/v1/{name=projects/*/muteConfigs/*}" + } + }; + option (google.api.method_signature) = "name"; + } + // Gets a notification config. rpc GetNotificationConfig(GetNotificationConfigRequest) returns (NotificationConfig) { option (google.api.http) = { @@ -188,6 +258,20 @@ service SecurityCenter { }; } + // Lists mute configs. + rpc ListMuteConfigs(ListMuteConfigsRequest) returns (ListMuteConfigsResponse) { + option (google.api.http) = { + get: "/v1/{parent=organizations/*}/muteConfigs" + additional_bindings { + get: "/v1/{parent=folders/*}/muteConfigs" + } + additional_bindings { + get: "/v1/{parent=projects/*}/muteConfigs" + } + }; + option (google.api.method_signature) = "parent"; + } + // Lists notification configs. rpc ListNotificationConfigs(ListNotificationConfigsRequest) returns (ListNotificationConfigsResponse) { option (google.api.http) = { @@ -245,6 +329,23 @@ service SecurityCenter { option (google.api.method_signature) = "name,state,start_time"; } + // Updates the mute state of a finding. + rpc SetMute(SetMuteRequest) returns (Finding) { + option (google.api.http) = { + post: "/v1/{name=organizations/*/sources/*/findings/*}:setMute" + body: "*" + additional_bindings { + post: "/v1/{name=folders/*/sources/*/findings/*}:setMute" + body: "*" + } + additional_bindings { + post: "/v1/{name=projects/*/sources/*/findings/*}:setMute" + body: "*" + } + }; + option (google.api.method_signature) = "name,mute"; + } + // Sets the access control policy on the specified Source. rpc SetIamPolicy(google.iam.v1.SetIamPolicyRequest) returns (google.iam.v1.Policy) { option (google.api.http) = { @@ -281,6 +382,23 @@ service SecurityCenter { option (google.api.method_signature) = "finding"; } + // Updates a mute config. + rpc UpdateMuteConfig(UpdateMuteConfigRequest) returns (MuteConfig) { + option (google.api.http) = { + patch: "/v1/{mute_config.name=organizations/*/muteConfigs/*}" + body: "mute_config" + additional_bindings { + patch: "/v1/{mute_config.name=folders/*/muteConfigs/*}" + body: "mute_config" + } + additional_bindings { + patch: "/v1/{mute_config.name=projects/*/muteConfigs/*}" + body: "mute_config" + } + }; + option (google.api.method_signature) = "mute_config,update_mask"; + } + // // Updates a notification config. The following update // fields are allowed: description, pubsub_topic, streaming_config.filter @@ -341,6 +459,55 @@ service SecurityCenter { } } +// Request message for bulk findings update. +// +// Note: +// 1. If multiple bulk update requests match the same resource, the order in +// which they get executed is not defined. +// 2. Once a bulk operation is started, there is no way to stop it. +message BulkMuteFindingsRequest { + // Required. The parent, at which bulk action needs to be applied. Its format is + // "organizations/[organization_id]", "folders/[folder_id]", + // "projects/[project_id]". + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "*" + } + ]; + + // Expression that identifies findings that should be updated. + // The expression is a list of zero or more restrictions combined + // via logical operators `AND` and `OR`. Parentheses are supported, and `OR` + // has higher precedence than `AND`. + // + // Restrictions have the form ` ` and may have a + // `-` character in front of them to indicate negation. The fields map to + // those defined in the corresponding resource. + // + // The supported operators are: + // + // * `=` for all value types. + // * `>`, `<`, `>=`, `<=` for integer values. + // * `:`, meaning substring matching, for strings. + // + // The supported value types are: + // + // * string literals in quotes. + // * integer literals without quotes. + // * boolean literals `true` and `false` without quotes. + string filter = 2; + + // This can be a mute configuration name or any identifier for mute/unmute + // of findings based on the filter. + string mute_annotation = 3 [deprecated = true]; +} + +// The response to a BulkMute request. Contains the LRO information. +message BulkMuteFindingsResponse { + +} + // Request message for creating a finding. message CreateFindingRequest { // Required. Resource name of the new finding's parent. Its format should be @@ -362,6 +529,28 @@ message CreateFindingRequest { Finding finding = 3 [(google.api.field_behavior) = REQUIRED]; } +// Request message for creating a mute config. +message CreateMuteConfigRequest { + // Required. Resource name of the new mute configs's parent. Its format is + // "organizations/[organization_id]", "folders/[folder_id]", or + // "projects/[project_id]". + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "securitycenter.googleapis.com/MuteConfig" + } + ]; + + // Required. The mute config being created. + MuteConfig mute_config = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. Unique identifier provided by the client within the parent scope. + // It must consist of lower case letters, numbers, and hyphen, with the first + // character a letter, the last a letter or a number, and a 63 character + // maximum. + string mute_config_id = 3 [(google.api.field_behavior) = REQUIRED]; +} + // Request message for creating a notification config. message CreateNotificationConfigRequest { // Required. Resource name of the new notification config's parent. Its format is @@ -400,6 +589,20 @@ message CreateSourceRequest { Source source = 2 [(google.api.field_behavior) = REQUIRED]; } +// Request message for deleting a mute config. +message DeleteMuteConfigRequest { + // Required. Name of the mute config to delete. Its format is + // organizations/{organization}/muteConfigs/{config_id}, + // folders/{folder}/muteConfigs/{config_id}, or + // projects/{project}/muteConfigs/{config_id} + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "securitycenter.googleapis.com/MuteConfig" + } + ]; +} + // Request message for deleting a notification config. message DeleteNotificationConfigRequest { // Required. Name of the notification config to delete. Its format is @@ -412,6 +615,20 @@ message DeleteNotificationConfigRequest { ]; } +// Request message for retrieving a mute config. +message GetMuteConfigRequest { + // Required. Name of the mute config to retrieve. Its format is + // organizations/{organization}/muteConfigs/{config_id}, + // folders/{folder}/muteConfigs/{config_id}, or + // projects/{project}/muteConfigs/{config_id} + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "securitycenter.googleapis.com/MuteConfig" + } + ]; +} + // Request message for getting a notification config. message GetNotificationConfigRequest { // Required. Name of the notification config to get. Its format is @@ -778,6 +995,43 @@ message GroupResult { int64 count = 2; } +// Request message for listing mute configs at a given scope e.g. organization, +// folder or project. +message ListMuteConfigsRequest { + // Required. The parent, which owns the collection of mute configs. Its format is + // "organizations/[organization_id]", "folders/[folder_id]", + // "projects/[project_id]". + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "securitycenter.googleapis.com/MuteConfig" + } + ]; + + // The maximum number of configs to return. The service may return fewer than + // this value. + // If unspecified, at most 10 configs will be returned. + // The maximum value is 1000; values above 1000 will be coerced to 1000. + int32 page_size = 2; + + // A page token, received from a previous `ListMuteConfigs` call. + // Provide this to retrieve the subsequent page. + // + // When paginating, all other parameters provided to `ListMuteConfigs` must + // match the call that provided the page token. + string page_token = 3; +} + +// Response message for listing mute configs. +message ListMuteConfigsResponse { + // The mute configs from the specified parent. + repeated MuteConfig mute_configs = 1; + + // A token, which can be sent as `page_token` to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; +} + // Request message for listing notification configs. message ListNotificationConfigsRequest { // Required. Name of the organization to list notification configs. @@ -1290,6 +1544,25 @@ message SetFindingStateRequest { google.protobuf.Timestamp start_time = 3 [(google.api.field_behavior) = REQUIRED]; } +// Request message for updating a finding's mute status. +message SetMuteRequest { + // Required. The relative resource name of the finding. See: + // https://cloud.google.com/apis/design/resource_names#relative_resource_name + // Example: + // "organizations/{organization_id}/sources/{source_id}/finding/{finding_id}", + // "folders/{folder_id}/sources/{source_id}/finding/{finding_id}", + // "projects/{project_id}/sources/{source_id}/finding/{finding_id}". + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "securitycenter.googleapis.com/Finding" + } + ]; + + // Required. The desired state of the Mute. + Finding.Mute mute = 2 [(google.api.field_behavior) = REQUIRED]; +} + // Request message for running asset discovery for an organization. message RunAssetDiscoveryRequest { // Required. Name of the organization to run asset discovery for. Its format is @@ -1322,6 +1595,16 @@ message UpdateFindingRequest { google.protobuf.FieldMask update_mask = 2; } +// Request message for updating a mute config. +message UpdateMuteConfigRequest { + // Required. The mute config being updated. + MuteConfig mute_config = 1 [(google.api.field_behavior) = REQUIRED]; + + // The list of fields to be updated. + // If empty all mutable fields will be updated. + google.protobuf.FieldMask update_mask = 2; +} + // Request message for updating a notification config. message UpdateNotificationConfigRequest { // Required. The notification config to update. diff --git a/packages/google-cloud-securitycenter/protos/protos.d.ts b/packages/google-cloud-securitycenter/protos/protos.d.ts index dffff7336a1..66a9913cc63 100644 --- a/packages/google-cloud-securitycenter/protos/protos.d.ts +++ b/packages/google-cloud-securitycenter/protos/protos.d.ts @@ -626,6 +626,9 @@ export namespace google { /** Finding canonicalName */ canonicalName?: (string|null); + /** Finding mute */ + mute?: (google.cloud.securitycenter.v1.Finding.Mute|keyof typeof google.cloud.securitycenter.v1.Finding.Mute|null); + /** Finding findingClass */ findingClass?: (google.cloud.securitycenter.v1.Finding.FindingClass|keyof typeof google.cloud.securitycenter.v1.Finding.FindingClass|null); @@ -634,6 +637,12 @@ export namespace google { /** Finding vulnerability */ vulnerability?: (google.cloud.securitycenter.v1.IVulnerability|null); + + /** Finding muteUpdateTime */ + muteUpdateTime?: (google.protobuf.ITimestamp|null); + + /** Finding muteInitiator */ + muteInitiator?: (string|null); } /** Represents a Finding. */ @@ -681,6 +690,9 @@ export namespace google { /** Finding canonicalName. */ public canonicalName: string; + /** Finding mute. */ + public mute: (google.cloud.securitycenter.v1.Finding.Mute|keyof typeof google.cloud.securitycenter.v1.Finding.Mute); + /** Finding findingClass. */ public findingClass: (google.cloud.securitycenter.v1.Finding.FindingClass|keyof typeof google.cloud.securitycenter.v1.Finding.FindingClass); @@ -690,6 +702,12 @@ export namespace google { /** Finding vulnerability. */ public vulnerability?: (google.cloud.securitycenter.v1.IVulnerability|null); + /** Finding muteUpdateTime. */ + public muteUpdateTime?: (google.protobuf.ITimestamp|null); + + /** Finding muteInitiator. */ + public muteInitiator: string; + /** * Creates a new Finding instance using the specified properties. * @param [properties] Properties to set @@ -779,6 +797,14 @@ export namespace google { LOW = 4 } + /** Mute enum. */ + enum Mute { + MUTE_UNSPECIFIED = 0, + MUTED = 1, + UNMUTED = 2, + UNDEFINED = 4 + } + /** FindingClass enum. */ enum FindingClass { FINDING_CLASS_UNSPECIFIED = 0, @@ -1360,6 +1386,132 @@ export namespace google { } } + /** Properties of a MuteConfig. */ + interface IMuteConfig { + + /** MuteConfig name */ + name?: (string|null); + + /** MuteConfig displayName */ + displayName?: (string|null); + + /** MuteConfig description */ + description?: (string|null); + + /** MuteConfig filter */ + filter?: (string|null); + + /** MuteConfig createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** MuteConfig updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** MuteConfig mostRecentEditor */ + mostRecentEditor?: (string|null); + } + + /** Represents a MuteConfig. */ + class MuteConfig implements IMuteConfig { + + /** + * Constructs a new MuteConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IMuteConfig); + + /** MuteConfig name. */ + public name: string; + + /** MuteConfig displayName. */ + public displayName: string; + + /** MuteConfig description. */ + public description: string; + + /** MuteConfig filter. */ + public filter: string; + + /** MuteConfig createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** MuteConfig updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** MuteConfig mostRecentEditor. */ + public mostRecentEditor: string; + + /** + * Creates a new MuteConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns MuteConfig instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IMuteConfig): google.cloud.securitycenter.v1.MuteConfig; + + /** + * Encodes the specified MuteConfig message. Does not implicitly {@link google.cloud.securitycenter.v1.MuteConfig.verify|verify} messages. + * @param message MuteConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IMuteConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MuteConfig message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.MuteConfig.verify|verify} messages. + * @param message MuteConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IMuteConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MuteConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MuteConfig + * @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.cloud.securitycenter.v1.MuteConfig; + + /** + * Decodes a MuteConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MuteConfig + * @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.cloud.securitycenter.v1.MuteConfig; + + /** + * Verifies a MuteConfig 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 MuteConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MuteConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.MuteConfig; + + /** + * Creates a plain object from a MuteConfig message. Also converts values to other types if specified. + * @param message MuteConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.MuteConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MuteConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + /** Properties of a NotificationConfig. */ interface INotificationConfig { @@ -2151,6 +2303,20 @@ export namespace google { */ public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): SecurityCenter; + /** + * Calls BulkMuteFindings. + * @param request BulkMuteFindingsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public bulkMuteFindings(request: google.cloud.securitycenter.v1.IBulkMuteFindingsRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.BulkMuteFindingsCallback): void; + + /** + * Calls BulkMuteFindings. + * @param request BulkMuteFindingsRequest message or plain object + * @returns Promise + */ + public bulkMuteFindings(request: google.cloud.securitycenter.v1.IBulkMuteFindingsRequest): Promise; + /** * Calls CreateSource. * @param request CreateSourceRequest message or plain object @@ -2179,6 +2345,20 @@ export namespace google { */ public createFinding(request: google.cloud.securitycenter.v1.ICreateFindingRequest): Promise; + /** + * Calls CreateMuteConfig. + * @param request CreateMuteConfigRequest message or plain object + * @param callback Node-style callback called with the error, if any, and MuteConfig + */ + public createMuteConfig(request: google.cloud.securitycenter.v1.ICreateMuteConfigRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.CreateMuteConfigCallback): void; + + /** + * Calls CreateMuteConfig. + * @param request CreateMuteConfigRequest message or plain object + * @returns Promise + */ + public createMuteConfig(request: google.cloud.securitycenter.v1.ICreateMuteConfigRequest): Promise; + /** * Calls CreateNotificationConfig. * @param request CreateNotificationConfigRequest message or plain object @@ -2193,6 +2373,20 @@ export namespace google { */ public createNotificationConfig(request: google.cloud.securitycenter.v1.ICreateNotificationConfigRequest): Promise; + /** + * Calls DeleteMuteConfig. + * @param request DeleteMuteConfigRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteMuteConfig(request: google.cloud.securitycenter.v1.IDeleteMuteConfigRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.DeleteMuteConfigCallback): void; + + /** + * Calls DeleteMuteConfig. + * @param request DeleteMuteConfigRequest message or plain object + * @returns Promise + */ + public deleteMuteConfig(request: google.cloud.securitycenter.v1.IDeleteMuteConfigRequest): Promise; + /** * Calls DeleteNotificationConfig. * @param request DeleteNotificationConfigRequest message or plain object @@ -2221,6 +2415,20 @@ export namespace google { */ public getIamPolicy(request: google.iam.v1.IGetIamPolicyRequest): Promise; + /** + * Calls GetMuteConfig. + * @param request GetMuteConfigRequest message or plain object + * @param callback Node-style callback called with the error, if any, and MuteConfig + */ + public getMuteConfig(request: google.cloud.securitycenter.v1.IGetMuteConfigRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.GetMuteConfigCallback): void; + + /** + * Calls GetMuteConfig. + * @param request GetMuteConfigRequest message or plain object + * @returns Promise + */ + public getMuteConfig(request: google.cloud.securitycenter.v1.IGetMuteConfigRequest): Promise; + /** * Calls GetNotificationConfig. * @param request GetNotificationConfigRequest message or plain object @@ -2319,6 +2527,20 @@ export namespace google { */ public listFindings(request: google.cloud.securitycenter.v1.IListFindingsRequest): Promise; + /** + * Calls ListMuteConfigs. + * @param request ListMuteConfigsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListMuteConfigsResponse + */ + public listMuteConfigs(request: google.cloud.securitycenter.v1.IListMuteConfigsRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.ListMuteConfigsCallback): void; + + /** + * Calls ListMuteConfigs. + * @param request ListMuteConfigsRequest message or plain object + * @returns Promise + */ + public listMuteConfigs(request: google.cloud.securitycenter.v1.IListMuteConfigsRequest): Promise; + /** * Calls ListNotificationConfigs. * @param request ListNotificationConfigsRequest message or plain object @@ -2375,6 +2597,20 @@ export namespace google { */ public setFindingState(request: google.cloud.securitycenter.v1.ISetFindingStateRequest): Promise; + /** + * Calls SetMute. + * @param request SetMuteRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Finding + */ + public setMute(request: google.cloud.securitycenter.v1.ISetMuteRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.SetMuteCallback): void; + + /** + * Calls SetMute. + * @param request SetMuteRequest message or plain object + * @returns Promise + */ + public setMute(request: google.cloud.securitycenter.v1.ISetMuteRequest): Promise; + /** * Calls SetIamPolicy. * @param request SetIamPolicyRequest message or plain object @@ -2417,6 +2653,20 @@ export namespace google { */ public updateFinding(request: google.cloud.securitycenter.v1.IUpdateFindingRequest): Promise; + /** + * Calls UpdateMuteConfig. + * @param request UpdateMuteConfigRequest message or plain object + * @param callback Node-style callback called with the error, if any, and MuteConfig + */ + public updateMuteConfig(request: google.cloud.securitycenter.v1.IUpdateMuteConfigRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.UpdateMuteConfigCallback): void; + + /** + * Calls UpdateMuteConfig. + * @param request UpdateMuteConfigRequest message or plain object + * @returns Promise + */ + public updateMuteConfig(request: google.cloud.securitycenter.v1.IUpdateMuteConfigRequest): Promise; + /** * Calls UpdateNotificationConfig. * @param request UpdateNotificationConfigRequest message or plain object @@ -2476,6 +2726,13 @@ export namespace google { namespace SecurityCenter { + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#bulkMuteFindings}. + * @param error Error, if any + * @param [response] Operation + */ + type BulkMuteFindingsCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + /** * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#createSource}. * @param error Error, if any @@ -2490,6 +2747,13 @@ export namespace google { */ type CreateFindingCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.Finding) => void; + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#createMuteConfig}. + * @param error Error, if any + * @param [response] MuteConfig + */ + type CreateMuteConfigCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.MuteConfig) => void; + /** * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#createNotificationConfig}. * @param error Error, if any @@ -2497,6 +2761,13 @@ export namespace google { */ type CreateNotificationConfigCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.NotificationConfig) => void; + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#deleteMuteConfig}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteMuteConfigCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + /** * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#deleteNotificationConfig}. * @param error Error, if any @@ -2511,6 +2782,13 @@ export namespace google { */ type GetIamPolicyCallback = (error: (Error|null), response?: google.iam.v1.Policy) => void; + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#getMuteConfig}. + * @param error Error, if any + * @param [response] MuteConfig + */ + type GetMuteConfigCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.MuteConfig) => void; + /** * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#getNotificationConfig}. * @param error Error, if any @@ -2560,6 +2838,13 @@ export namespace google { */ type ListFindingsCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.ListFindingsResponse) => void; + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#listMuteConfigs}. + * @param error Error, if any + * @param [response] ListMuteConfigsResponse + */ + type ListMuteConfigsCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.ListMuteConfigsResponse) => void; + /** * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#listNotificationConfigs}. * @param error Error, if any @@ -2588,6 +2873,13 @@ export namespace google { */ type SetFindingStateCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.Finding) => void; + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#setMute}. + * @param error Error, if any + * @param [response] Finding + */ + type SetMuteCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.Finding) => void; + /** * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#setIamPolicy}. * @param error Error, if any @@ -2609,6 +2901,13 @@ export namespace google { */ type UpdateFindingCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.Finding) => void; + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#updateMuteConfig}. + * @param error Error, if any + * @param [response] MuteConfig + */ + type UpdateMuteConfigCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.MuteConfig) => void; + /** * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#updateNotificationConfig}. * @param error Error, if any @@ -2638,6 +2937,192 @@ export namespace google { type UpdateSecurityMarksCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.SecurityMarks) => void; } + /** Properties of a BulkMuteFindingsRequest. */ + interface IBulkMuteFindingsRequest { + + /** BulkMuteFindingsRequest parent */ + parent?: (string|null); + + /** BulkMuteFindingsRequest filter */ + filter?: (string|null); + + /** BulkMuteFindingsRequest muteAnnotation */ + muteAnnotation?: (string|null); + } + + /** Represents a BulkMuteFindingsRequest. */ + class BulkMuteFindingsRequest implements IBulkMuteFindingsRequest { + + /** + * Constructs a new BulkMuteFindingsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IBulkMuteFindingsRequest); + + /** BulkMuteFindingsRequest parent. */ + public parent: string; + + /** BulkMuteFindingsRequest filter. */ + public filter: string; + + /** BulkMuteFindingsRequest muteAnnotation. */ + public muteAnnotation: string; + + /** + * Creates a new BulkMuteFindingsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns BulkMuteFindingsRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IBulkMuteFindingsRequest): google.cloud.securitycenter.v1.BulkMuteFindingsRequest; + + /** + * Encodes the specified BulkMuteFindingsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.BulkMuteFindingsRequest.verify|verify} messages. + * @param message BulkMuteFindingsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IBulkMuteFindingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BulkMuteFindingsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.BulkMuteFindingsRequest.verify|verify} messages. + * @param message BulkMuteFindingsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IBulkMuteFindingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BulkMuteFindingsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BulkMuteFindingsRequest + * @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.cloud.securitycenter.v1.BulkMuteFindingsRequest; + + /** + * Decodes a BulkMuteFindingsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BulkMuteFindingsRequest + * @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.cloud.securitycenter.v1.BulkMuteFindingsRequest; + + /** + * Verifies a BulkMuteFindingsRequest 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 BulkMuteFindingsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BulkMuteFindingsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.BulkMuteFindingsRequest; + + /** + * Creates a plain object from a BulkMuteFindingsRequest message. Also converts values to other types if specified. + * @param message BulkMuteFindingsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.BulkMuteFindingsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BulkMuteFindingsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a BulkMuteFindingsResponse. */ + interface IBulkMuteFindingsResponse { + } + + /** Represents a BulkMuteFindingsResponse. */ + class BulkMuteFindingsResponse implements IBulkMuteFindingsResponse { + + /** + * Constructs a new BulkMuteFindingsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IBulkMuteFindingsResponse); + + /** + * Creates a new BulkMuteFindingsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns BulkMuteFindingsResponse instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IBulkMuteFindingsResponse): google.cloud.securitycenter.v1.BulkMuteFindingsResponse; + + /** + * Encodes the specified BulkMuteFindingsResponse message. Does not implicitly {@link google.cloud.securitycenter.v1.BulkMuteFindingsResponse.verify|verify} messages. + * @param message BulkMuteFindingsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IBulkMuteFindingsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BulkMuteFindingsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.BulkMuteFindingsResponse.verify|verify} messages. + * @param message BulkMuteFindingsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IBulkMuteFindingsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BulkMuteFindingsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BulkMuteFindingsResponse + * @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.cloud.securitycenter.v1.BulkMuteFindingsResponse; + + /** + * Decodes a BulkMuteFindingsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BulkMuteFindingsResponse + * @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.cloud.securitycenter.v1.BulkMuteFindingsResponse; + + /** + * Verifies a BulkMuteFindingsResponse 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 BulkMuteFindingsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BulkMuteFindingsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.BulkMuteFindingsResponse; + + /** + * Creates a plain object from a BulkMuteFindingsResponse message. Also converts values to other types if specified. + * @param message BulkMuteFindingsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.BulkMuteFindingsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BulkMuteFindingsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + /** Properties of a CreateFindingRequest. */ interface ICreateFindingRequest { @@ -2740,6 +3225,108 @@ export namespace google { public toJSON(): { [k: string]: any }; } + /** Properties of a CreateMuteConfigRequest. */ + interface ICreateMuteConfigRequest { + + /** CreateMuteConfigRequest parent */ + parent?: (string|null); + + /** CreateMuteConfigRequest muteConfig */ + muteConfig?: (google.cloud.securitycenter.v1.IMuteConfig|null); + + /** CreateMuteConfigRequest muteConfigId */ + muteConfigId?: (string|null); + } + + /** Represents a CreateMuteConfigRequest. */ + class CreateMuteConfigRequest implements ICreateMuteConfigRequest { + + /** + * Constructs a new CreateMuteConfigRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.ICreateMuteConfigRequest); + + /** CreateMuteConfigRequest parent. */ + public parent: string; + + /** CreateMuteConfigRequest muteConfig. */ + public muteConfig?: (google.cloud.securitycenter.v1.IMuteConfig|null); + + /** CreateMuteConfigRequest muteConfigId. */ + public muteConfigId: string; + + /** + * Creates a new CreateMuteConfigRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateMuteConfigRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v1.ICreateMuteConfigRequest): google.cloud.securitycenter.v1.CreateMuteConfigRequest; + + /** + * Encodes the specified CreateMuteConfigRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.CreateMuteConfigRequest.verify|verify} messages. + * @param message CreateMuteConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.ICreateMuteConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateMuteConfigRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.CreateMuteConfigRequest.verify|verify} messages. + * @param message CreateMuteConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.ICreateMuteConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateMuteConfigRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateMuteConfigRequest + * @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.cloud.securitycenter.v1.CreateMuteConfigRequest; + + /** + * Decodes a CreateMuteConfigRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateMuteConfigRequest + * @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.cloud.securitycenter.v1.CreateMuteConfigRequest; + + /** + * Verifies a CreateMuteConfigRequest 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 CreateMuteConfigRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateMuteConfigRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.CreateMuteConfigRequest; + + /** + * Creates a plain object from a CreateMuteConfigRequest message. Also converts values to other types if specified. + * @param message CreateMuteConfigRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.CreateMuteConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateMuteConfigRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + /** Properties of a CreateNotificationConfigRequest. */ interface ICreateNotificationConfigRequest { @@ -2938,6 +3525,96 @@ export namespace google { public toJSON(): { [k: string]: any }; } + /** Properties of a DeleteMuteConfigRequest. */ + interface IDeleteMuteConfigRequest { + + /** DeleteMuteConfigRequest name */ + name?: (string|null); + } + + /** Represents a DeleteMuteConfigRequest. */ + class DeleteMuteConfigRequest implements IDeleteMuteConfigRequest { + + /** + * Constructs a new DeleteMuteConfigRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IDeleteMuteConfigRequest); + + /** DeleteMuteConfigRequest name. */ + public name: string; + + /** + * Creates a new DeleteMuteConfigRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteMuteConfigRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IDeleteMuteConfigRequest): google.cloud.securitycenter.v1.DeleteMuteConfigRequest; + + /** + * Encodes the specified DeleteMuteConfigRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.DeleteMuteConfigRequest.verify|verify} messages. + * @param message DeleteMuteConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IDeleteMuteConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteMuteConfigRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.DeleteMuteConfigRequest.verify|verify} messages. + * @param message DeleteMuteConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IDeleteMuteConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteMuteConfigRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteMuteConfigRequest + * @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.cloud.securitycenter.v1.DeleteMuteConfigRequest; + + /** + * Decodes a DeleteMuteConfigRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteMuteConfigRequest + * @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.cloud.securitycenter.v1.DeleteMuteConfigRequest; + + /** + * Verifies a DeleteMuteConfigRequest 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 DeleteMuteConfigRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteMuteConfigRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.DeleteMuteConfigRequest; + + /** + * Creates a plain object from a DeleteMuteConfigRequest message. Also converts values to other types if specified. + * @param message DeleteMuteConfigRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.DeleteMuteConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteMuteConfigRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + /** Properties of a DeleteNotificationConfigRequest. */ interface IDeleteNotificationConfigRequest { @@ -3009,20 +3686,110 @@ export namespace google { /** * Creates a DeleteNotificationConfigRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns DeleteNotificationConfigRequest + * @returns DeleteNotificationConfigRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.DeleteNotificationConfigRequest; + + /** + * Creates a plain object from a DeleteNotificationConfigRequest message. Also converts values to other types if specified. + * @param message DeleteNotificationConfigRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.DeleteNotificationConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteNotificationConfigRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GetMuteConfigRequest. */ + interface IGetMuteConfigRequest { + + /** GetMuteConfigRequest name */ + name?: (string|null); + } + + /** Represents a GetMuteConfigRequest. */ + class GetMuteConfigRequest implements IGetMuteConfigRequest { + + /** + * Constructs a new GetMuteConfigRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IGetMuteConfigRequest); + + /** GetMuteConfigRequest name. */ + public name: string; + + /** + * Creates a new GetMuteConfigRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetMuteConfigRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IGetMuteConfigRequest): google.cloud.securitycenter.v1.GetMuteConfigRequest; + + /** + * Encodes the specified GetMuteConfigRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.GetMuteConfigRequest.verify|verify} messages. + * @param message GetMuteConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IGetMuteConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetMuteConfigRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.GetMuteConfigRequest.verify|verify} messages. + * @param message GetMuteConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IGetMuteConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetMuteConfigRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetMuteConfigRequest + * @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.cloud.securitycenter.v1.GetMuteConfigRequest; + + /** + * Decodes a GetMuteConfigRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetMuteConfigRequest + * @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.cloud.securitycenter.v1.GetMuteConfigRequest; + + /** + * Verifies a GetMuteConfigRequest 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 GetMuteConfigRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetMuteConfigRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.DeleteNotificationConfigRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.GetMuteConfigRequest; /** - * Creates a plain object from a DeleteNotificationConfigRequest message. Also converts values to other types if specified. - * @param message DeleteNotificationConfigRequest + * Creates a plain object from a GetMuteConfigRequest message. Also converts values to other types if specified. + * @param message GetMuteConfigRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.securitycenter.v1.DeleteNotificationConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.securitycenter.v1.GetMuteConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this DeleteNotificationConfigRequest to JSON. + * Converts this GetMuteConfigRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; @@ -3862,6 +4629,204 @@ export namespace google { public toJSON(): { [k: string]: any }; } + /** Properties of a ListMuteConfigsRequest. */ + interface IListMuteConfigsRequest { + + /** ListMuteConfigsRequest parent */ + parent?: (string|null); + + /** ListMuteConfigsRequest pageSize */ + pageSize?: (number|null); + + /** ListMuteConfigsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListMuteConfigsRequest. */ + class ListMuteConfigsRequest implements IListMuteConfigsRequest { + + /** + * Constructs a new ListMuteConfigsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IListMuteConfigsRequest); + + /** ListMuteConfigsRequest parent. */ + public parent: string; + + /** ListMuteConfigsRequest pageSize. */ + public pageSize: number; + + /** ListMuteConfigsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListMuteConfigsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListMuteConfigsRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IListMuteConfigsRequest): google.cloud.securitycenter.v1.ListMuteConfigsRequest; + + /** + * Encodes the specified ListMuteConfigsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.ListMuteConfigsRequest.verify|verify} messages. + * @param message ListMuteConfigsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IListMuteConfigsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListMuteConfigsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListMuteConfigsRequest.verify|verify} messages. + * @param message ListMuteConfigsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IListMuteConfigsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListMuteConfigsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListMuteConfigsRequest + * @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.cloud.securitycenter.v1.ListMuteConfigsRequest; + + /** + * Decodes a ListMuteConfigsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListMuteConfigsRequest + * @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.cloud.securitycenter.v1.ListMuteConfigsRequest; + + /** + * Verifies a ListMuteConfigsRequest 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 ListMuteConfigsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListMuteConfigsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.ListMuteConfigsRequest; + + /** + * Creates a plain object from a ListMuteConfigsRequest message. Also converts values to other types if specified. + * @param message ListMuteConfigsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.ListMuteConfigsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListMuteConfigsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListMuteConfigsResponse. */ + interface IListMuteConfigsResponse { + + /** ListMuteConfigsResponse muteConfigs */ + muteConfigs?: (google.cloud.securitycenter.v1.IMuteConfig[]|null); + + /** ListMuteConfigsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListMuteConfigsResponse. */ + class ListMuteConfigsResponse implements IListMuteConfigsResponse { + + /** + * Constructs a new ListMuteConfigsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IListMuteConfigsResponse); + + /** ListMuteConfigsResponse muteConfigs. */ + public muteConfigs: google.cloud.securitycenter.v1.IMuteConfig[]; + + /** ListMuteConfigsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListMuteConfigsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListMuteConfigsResponse instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IListMuteConfigsResponse): google.cloud.securitycenter.v1.ListMuteConfigsResponse; + + /** + * Encodes the specified ListMuteConfigsResponse message. Does not implicitly {@link google.cloud.securitycenter.v1.ListMuteConfigsResponse.verify|verify} messages. + * @param message ListMuteConfigsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IListMuteConfigsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListMuteConfigsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListMuteConfigsResponse.verify|verify} messages. + * @param message ListMuteConfigsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IListMuteConfigsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListMuteConfigsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListMuteConfigsResponse + * @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.cloud.securitycenter.v1.ListMuteConfigsResponse; + + /** + * Decodes a ListMuteConfigsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListMuteConfigsResponse + * @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.cloud.securitycenter.v1.ListMuteConfigsResponse; + + /** + * Verifies a ListMuteConfigsResponse 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 ListMuteConfigsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListMuteConfigsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.ListMuteConfigsResponse; + + /** + * Creates a plain object from a ListMuteConfigsResponse message. Also converts values to other types if specified. + * @param message ListMuteConfigsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.ListMuteConfigsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListMuteConfigsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + /** Properties of a ListNotificationConfigsRequest. */ interface IListNotificationConfigsRequest { @@ -5199,6 +6164,102 @@ export namespace google { public toJSON(): { [k: string]: any }; } + /** Properties of a SetMuteRequest. */ + interface ISetMuteRequest { + + /** SetMuteRequest name */ + name?: (string|null); + + /** SetMuteRequest mute */ + mute?: (google.cloud.securitycenter.v1.Finding.Mute|keyof typeof google.cloud.securitycenter.v1.Finding.Mute|null); + } + + /** Represents a SetMuteRequest. */ + class SetMuteRequest implements ISetMuteRequest { + + /** + * Constructs a new SetMuteRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.ISetMuteRequest); + + /** SetMuteRequest name. */ + public name: string; + + /** SetMuteRequest mute. */ + public mute: (google.cloud.securitycenter.v1.Finding.Mute|keyof typeof google.cloud.securitycenter.v1.Finding.Mute); + + /** + * Creates a new SetMuteRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns SetMuteRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v1.ISetMuteRequest): google.cloud.securitycenter.v1.SetMuteRequest; + + /** + * Encodes the specified SetMuteRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.SetMuteRequest.verify|verify} messages. + * @param message SetMuteRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.ISetMuteRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SetMuteRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.SetMuteRequest.verify|verify} messages. + * @param message SetMuteRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.ISetMuteRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SetMuteRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SetMuteRequest + * @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.cloud.securitycenter.v1.SetMuteRequest; + + /** + * Decodes a SetMuteRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SetMuteRequest + * @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.cloud.securitycenter.v1.SetMuteRequest; + + /** + * Verifies a SetMuteRequest 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 SetMuteRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SetMuteRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.SetMuteRequest; + + /** + * Creates a plain object from a SetMuteRequest message. Also converts values to other types if specified. + * @param message SetMuteRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.SetMuteRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SetMuteRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + /** Properties of a RunAssetDiscoveryRequest. */ interface IRunAssetDiscoveryRequest { @@ -5385,6 +6446,102 @@ export namespace google { public toJSON(): { [k: string]: any }; } + /** Properties of an UpdateMuteConfigRequest. */ + interface IUpdateMuteConfigRequest { + + /** UpdateMuteConfigRequest muteConfig */ + muteConfig?: (google.cloud.securitycenter.v1.IMuteConfig|null); + + /** UpdateMuteConfigRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateMuteConfigRequest. */ + class UpdateMuteConfigRequest implements IUpdateMuteConfigRequest { + + /** + * Constructs a new UpdateMuteConfigRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IUpdateMuteConfigRequest); + + /** UpdateMuteConfigRequest muteConfig. */ + public muteConfig?: (google.cloud.securitycenter.v1.IMuteConfig|null); + + /** UpdateMuteConfigRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateMuteConfigRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateMuteConfigRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IUpdateMuteConfigRequest): google.cloud.securitycenter.v1.UpdateMuteConfigRequest; + + /** + * Encodes the specified UpdateMuteConfigRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.UpdateMuteConfigRequest.verify|verify} messages. + * @param message UpdateMuteConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IUpdateMuteConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateMuteConfigRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.UpdateMuteConfigRequest.verify|verify} messages. + * @param message UpdateMuteConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IUpdateMuteConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateMuteConfigRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateMuteConfigRequest + * @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.cloud.securitycenter.v1.UpdateMuteConfigRequest; + + /** + * Decodes an UpdateMuteConfigRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateMuteConfigRequest + * @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.cloud.securitycenter.v1.UpdateMuteConfigRequest; + + /** + * Verifies an UpdateMuteConfigRequest 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 UpdateMuteConfigRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateMuteConfigRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.UpdateMuteConfigRequest; + + /** + * Creates a plain object from an UpdateMuteConfigRequest message. Also converts values to other types if specified. + * @param message UpdateMuteConfigRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.UpdateMuteConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateMuteConfigRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + /** Properties of an UpdateNotificationConfigRequest. */ interface IUpdateNotificationConfigRequest { diff --git a/packages/google-cloud-securitycenter/protos/protos.js b/packages/google-cloud-securitycenter/protos/protos.js index 9690fb96359..89d96cb6622 100644 --- a/packages/google-cloud-securitycenter/protos/protos.js +++ b/packages/google-cloud-securitycenter/protos/protos.js @@ -1562,9 +1562,12 @@ * @property {google.protobuf.ITimestamp|null} [createTime] Finding createTime * @property {google.cloud.securitycenter.v1.Finding.Severity|null} [severity] Finding severity * @property {string|null} [canonicalName] Finding canonicalName + * @property {google.cloud.securitycenter.v1.Finding.Mute|null} [mute] Finding mute * @property {google.cloud.securitycenter.v1.Finding.FindingClass|null} [findingClass] Finding findingClass * @property {google.cloud.securitycenter.v1.IIndicator|null} [indicator] Finding indicator * @property {google.cloud.securitycenter.v1.IVulnerability|null} [vulnerability] Finding vulnerability + * @property {google.protobuf.ITimestamp|null} [muteUpdateTime] Finding muteUpdateTime + * @property {string|null} [muteInitiator] Finding muteInitiator */ /** @@ -1679,6 +1682,14 @@ */ Finding.prototype.canonicalName = ""; + /** + * Finding mute. + * @member {google.cloud.securitycenter.v1.Finding.Mute} mute + * @memberof google.cloud.securitycenter.v1.Finding + * @instance + */ + Finding.prototype.mute = 0; + /** * Finding findingClass. * @member {google.cloud.securitycenter.v1.Finding.FindingClass} findingClass @@ -1703,6 +1714,22 @@ */ Finding.prototype.vulnerability = null; + /** + * Finding muteUpdateTime. + * @member {google.protobuf.ITimestamp|null|undefined} muteUpdateTime + * @memberof google.cloud.securitycenter.v1.Finding + * @instance + */ + Finding.prototype.muteUpdateTime = null; + + /** + * Finding muteInitiator. + * @member {string} muteInitiator + * @memberof google.cloud.securitycenter.v1.Finding + * @instance + */ + Finding.prototype.muteInitiator = ""; + /** * Creates a new Finding instance using the specified properties. * @function create @@ -1754,12 +1781,18 @@ writer.uint32(/* id 12, wireType 0 =*/96).int32(message.severity); if (message.canonicalName != null && Object.hasOwnProperty.call(message, "canonicalName")) writer.uint32(/* id 14, wireType 2 =*/114).string(message.canonicalName); + if (message.mute != null && Object.hasOwnProperty.call(message, "mute")) + writer.uint32(/* id 15, wireType 0 =*/120).int32(message.mute); if (message.findingClass != null && Object.hasOwnProperty.call(message, "findingClass")) writer.uint32(/* id 17, wireType 0 =*/136).int32(message.findingClass); if (message.indicator != null && Object.hasOwnProperty.call(message, "indicator")) $root.google.cloud.securitycenter.v1.Indicator.encode(message.indicator, writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); if (message.vulnerability != null && Object.hasOwnProperty.call(message, "vulnerability")) $root.google.cloud.securitycenter.v1.Vulnerability.encode(message.vulnerability, writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); + if (message.muteUpdateTime != null && Object.hasOwnProperty.call(message, "muteUpdateTime")) + $root.google.protobuf.Timestamp.encode(message.muteUpdateTime, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); + if (message.muteInitiator != null && Object.hasOwnProperty.call(message, "muteInitiator")) + writer.uint32(/* id 28, wireType 2 =*/226).string(message.muteInitiator); return writer; }; @@ -1849,6 +1882,9 @@ case 14: message.canonicalName = reader.string(); break; + case 15: + message.mute = reader.int32(); + break; case 17: message.findingClass = reader.int32(); break; @@ -1858,6 +1894,12 @@ case 20: message.vulnerability = $root.google.cloud.securitycenter.v1.Vulnerability.decode(reader, reader.uint32()); break; + case 21: + message.muteUpdateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 28: + message.muteInitiator = reader.string(); + break; default: reader.skipType(tag & 7); break; @@ -1956,6 +1998,16 @@ if (message.canonicalName != null && message.hasOwnProperty("canonicalName")) if (!$util.isString(message.canonicalName)) return "canonicalName: string expected"; + if (message.mute != null && message.hasOwnProperty("mute")) + switch (message.mute) { + default: + return "mute: enum value expected"; + case 0: + case 1: + case 2: + case 4: + break; + } if (message.findingClass != null && message.hasOwnProperty("findingClass")) switch (message.findingClass) { default: @@ -1977,6 +2029,14 @@ if (error) return "vulnerability." + error; } + if (message.muteUpdateTime != null && message.hasOwnProperty("muteUpdateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.muteUpdateTime); + if (error) + return "muteUpdateTime." + error; + } + if (message.muteInitiator != null && message.hasOwnProperty("muteInitiator")) + if (!$util.isString(message.muteInitiator)) + return "muteInitiator: string expected"; return null; }; @@ -2065,6 +2125,24 @@ } if (object.canonicalName != null) message.canonicalName = String(object.canonicalName); + switch (object.mute) { + case "MUTE_UNSPECIFIED": + case 0: + message.mute = 0; + break; + case "MUTED": + case 1: + message.mute = 1; + break; + case "UNMUTED": + case 2: + message.mute = 2; + break; + case "UNDEFINED": + case 4: + message.mute = 4; + break; + } switch (object.findingClass) { case "FINDING_CLASS_UNSPECIFIED": case 0: @@ -2097,6 +2175,13 @@ throw TypeError(".google.cloud.securitycenter.v1.Finding.vulnerability: object expected"); message.vulnerability = $root.google.cloud.securitycenter.v1.Vulnerability.fromObject(object.vulnerability); } + if (object.muteUpdateTime != null) { + if (typeof object.muteUpdateTime !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Finding.muteUpdateTime: object expected"); + message.muteUpdateTime = $root.google.protobuf.Timestamp.fromObject(object.muteUpdateTime); + } + if (object.muteInitiator != null) + message.muteInitiator = String(object.muteInitiator); return message; }; @@ -2127,9 +2212,12 @@ object.createTime = null; object.severity = options.enums === String ? "SEVERITY_UNSPECIFIED" : 0; object.canonicalName = ""; + object.mute = options.enums === String ? "MUTE_UNSPECIFIED" : 0; object.findingClass = options.enums === String ? "FINDING_CLASS_UNSPECIFIED" : 0; object.indicator = null; object.vulnerability = null; + object.muteUpdateTime = null; + object.muteInitiator = ""; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -2159,12 +2247,18 @@ object.severity = options.enums === String ? $root.google.cloud.securitycenter.v1.Finding.Severity[message.severity] : message.severity; if (message.canonicalName != null && message.hasOwnProperty("canonicalName")) object.canonicalName = message.canonicalName; + if (message.mute != null && message.hasOwnProperty("mute")) + object.mute = options.enums === String ? $root.google.cloud.securitycenter.v1.Finding.Mute[message.mute] : message.mute; if (message.findingClass != null && message.hasOwnProperty("findingClass")) object.findingClass = options.enums === String ? $root.google.cloud.securitycenter.v1.Finding.FindingClass[message.findingClass] : message.findingClass; if (message.indicator != null && message.hasOwnProperty("indicator")) object.indicator = $root.google.cloud.securitycenter.v1.Indicator.toObject(message.indicator, options); if (message.vulnerability != null && message.hasOwnProperty("vulnerability")) object.vulnerability = $root.google.cloud.securitycenter.v1.Vulnerability.toObject(message.vulnerability, options); + if (message.muteUpdateTime != null && message.hasOwnProperty("muteUpdateTime")) + object.muteUpdateTime = $root.google.protobuf.Timestamp.toObject(message.muteUpdateTime, options); + if (message.muteInitiator != null && message.hasOwnProperty("muteInitiator")) + object.muteInitiator = message.muteInitiator; return object; }; @@ -2215,6 +2309,24 @@ return values; })(); + /** + * Mute enum. + * @name google.cloud.securitycenter.v1.Finding.Mute + * @enum {number} + * @property {number} MUTE_UNSPECIFIED=0 MUTE_UNSPECIFIED value + * @property {number} MUTED=1 MUTED value + * @property {number} UNMUTED=2 UNMUTED value + * @property {number} UNDEFINED=4 UNDEFINED value + */ + Finding.Mute = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MUTE_UNSPECIFIED"] = 0; + values[valuesById[1] = "MUTED"] = 1; + values[valuesById[2] = "UNMUTED"] = 2; + values[valuesById[4] = "UNDEFINED"] = 4; + return values; + })(); + /** * FindingClass enum. * @name google.cloud.securitycenter.v1.Finding.FindingClass @@ -3783,28 +3895,30 @@ return Cvssv3; })(); - v1.NotificationConfig = (function() { + v1.MuteConfig = (function() { /** - * Properties of a NotificationConfig. + * Properties of a MuteConfig. * @memberof google.cloud.securitycenter.v1 - * @interface INotificationConfig - * @property {string|null} [name] NotificationConfig name - * @property {string|null} [description] NotificationConfig description - * @property {string|null} [pubsubTopic] NotificationConfig pubsubTopic - * @property {string|null} [serviceAccount] NotificationConfig serviceAccount - * @property {google.cloud.securitycenter.v1.NotificationConfig.IStreamingConfig|null} [streamingConfig] NotificationConfig streamingConfig + * @interface IMuteConfig + * @property {string|null} [name] MuteConfig name + * @property {string|null} [displayName] MuteConfig displayName + * @property {string|null} [description] MuteConfig description + * @property {string|null} [filter] MuteConfig filter + * @property {google.protobuf.ITimestamp|null} [createTime] MuteConfig createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] MuteConfig updateTime + * @property {string|null} [mostRecentEditor] MuteConfig mostRecentEditor */ /** - * Constructs a new NotificationConfig. + * Constructs a new MuteConfig. * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents a NotificationConfig. - * @implements INotificationConfig + * @classdesc Represents a MuteConfig. + * @implements IMuteConfig * @constructor - * @param {google.cloud.securitycenter.v1.INotificationConfig=} [properties] Properties to set + * @param {google.cloud.securitycenter.v1.IMuteConfig=} [properties] Properties to set */ - function NotificationConfig(properties) { + function MuteConfig(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -3812,124 +3926,130 @@ } /** - * NotificationConfig name. + * MuteConfig name. * @member {string} name - * @memberof google.cloud.securitycenter.v1.NotificationConfig + * @memberof google.cloud.securitycenter.v1.MuteConfig * @instance */ - NotificationConfig.prototype.name = ""; + MuteConfig.prototype.name = ""; /** - * NotificationConfig description. - * @member {string} description - * @memberof google.cloud.securitycenter.v1.NotificationConfig + * MuteConfig displayName. + * @member {string} displayName + * @memberof google.cloud.securitycenter.v1.MuteConfig * @instance */ - NotificationConfig.prototype.description = ""; + MuteConfig.prototype.displayName = ""; /** - * NotificationConfig pubsubTopic. - * @member {string} pubsubTopic - * @memberof google.cloud.securitycenter.v1.NotificationConfig + * MuteConfig description. + * @member {string} description + * @memberof google.cloud.securitycenter.v1.MuteConfig * @instance */ - NotificationConfig.prototype.pubsubTopic = ""; + MuteConfig.prototype.description = ""; /** - * NotificationConfig serviceAccount. - * @member {string} serviceAccount - * @memberof google.cloud.securitycenter.v1.NotificationConfig + * MuteConfig filter. + * @member {string} filter + * @memberof google.cloud.securitycenter.v1.MuteConfig * @instance */ - NotificationConfig.prototype.serviceAccount = ""; + MuteConfig.prototype.filter = ""; /** - * NotificationConfig streamingConfig. - * @member {google.cloud.securitycenter.v1.NotificationConfig.IStreamingConfig|null|undefined} streamingConfig - * @memberof google.cloud.securitycenter.v1.NotificationConfig + * MuteConfig createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.securitycenter.v1.MuteConfig * @instance */ - NotificationConfig.prototype.streamingConfig = null; + MuteConfig.prototype.createTime = null; - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + /** + * MuteConfig updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.securitycenter.v1.MuteConfig + * @instance + */ + MuteConfig.prototype.updateTime = null; /** - * NotificationConfig notifyConfig. - * @member {"streamingConfig"|undefined} notifyConfig - * @memberof google.cloud.securitycenter.v1.NotificationConfig + * MuteConfig mostRecentEditor. + * @member {string} mostRecentEditor + * @memberof google.cloud.securitycenter.v1.MuteConfig * @instance */ - Object.defineProperty(NotificationConfig.prototype, "notifyConfig", { - get: $util.oneOfGetter($oneOfFields = ["streamingConfig"]), - set: $util.oneOfSetter($oneOfFields) - }); + MuteConfig.prototype.mostRecentEditor = ""; /** - * Creates a new NotificationConfig instance using the specified properties. + * Creates a new MuteConfig instance using the specified properties. * @function create - * @memberof google.cloud.securitycenter.v1.NotificationConfig + * @memberof google.cloud.securitycenter.v1.MuteConfig * @static - * @param {google.cloud.securitycenter.v1.INotificationConfig=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.NotificationConfig} NotificationConfig instance + * @param {google.cloud.securitycenter.v1.IMuteConfig=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.MuteConfig} MuteConfig instance */ - NotificationConfig.create = function create(properties) { - return new NotificationConfig(properties); + MuteConfig.create = function create(properties) { + return new MuteConfig(properties); }; /** - * Encodes the specified NotificationConfig message. Does not implicitly {@link google.cloud.securitycenter.v1.NotificationConfig.verify|verify} messages. + * Encodes the specified MuteConfig message. Does not implicitly {@link google.cloud.securitycenter.v1.MuteConfig.verify|verify} messages. * @function encode - * @memberof google.cloud.securitycenter.v1.NotificationConfig + * @memberof google.cloud.securitycenter.v1.MuteConfig * @static - * @param {google.cloud.securitycenter.v1.INotificationConfig} message NotificationConfig message or plain object to encode + * @param {google.cloud.securitycenter.v1.IMuteConfig} message MuteConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - NotificationConfig.encode = function encode(message, writer) { + MuteConfig.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.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); if (message.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); - if (message.pubsubTopic != null && Object.hasOwnProperty.call(message, "pubsubTopic")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.pubsubTopic); - if (message.serviceAccount != null && Object.hasOwnProperty.call(message, "serviceAccount")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.serviceAccount); - if (message.streamingConfig != null && Object.hasOwnProperty.call(message, "streamingConfig")) - $root.google.cloud.securitycenter.v1.NotificationConfig.StreamingConfig.encode(message.streamingConfig, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.mostRecentEditor != null && Object.hasOwnProperty.call(message, "mostRecentEditor")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.mostRecentEditor); return writer; }; /** - * Encodes the specified NotificationConfig message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.NotificationConfig.verify|verify} messages. + * Encodes the specified MuteConfig message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.MuteConfig.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.NotificationConfig + * @memberof google.cloud.securitycenter.v1.MuteConfig * @static - * @param {google.cloud.securitycenter.v1.INotificationConfig} message NotificationConfig message or plain object to encode + * @param {google.cloud.securitycenter.v1.IMuteConfig} message MuteConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - NotificationConfig.encodeDelimited = function encodeDelimited(message, writer) { + MuteConfig.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a NotificationConfig message from the specified reader or buffer. + * Decodes a MuteConfig message from the specified reader or buffer. * @function decode - * @memberof google.cloud.securitycenter.v1.NotificationConfig + * @memberof google.cloud.securitycenter.v1.MuteConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.NotificationConfig} NotificationConfig + * @returns {google.cloud.securitycenter.v1.MuteConfig} MuteConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - NotificationConfig.decode = function decode(reader, length) { + MuteConfig.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.cloud.securitycenter.v1.NotificationConfig(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.MuteConfig(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -3937,16 +4057,22 @@ message.name = reader.string(); break; case 2: - message.description = reader.string(); + message.displayName = reader.string(); break; case 3: - message.pubsubTopic = reader.string(); + message.description = reader.string(); break; case 4: - message.serviceAccount = reader.string(); + message.filter = reader.string(); break; case 5: - message.streamingConfig = $root.google.cloud.securitycenter.v1.NotificationConfig.StreamingConfig.decode(reader, reader.uint32()); + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 6: + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 7: + message.mostRecentEditor = reader.string(); break; default: reader.skipType(tag & 7); @@ -3957,340 +4083,170 @@ }; /** - * Decodes a NotificationConfig message from the specified reader or buffer, length delimited. + * Decodes a MuteConfig message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.NotificationConfig + * @memberof google.cloud.securitycenter.v1.MuteConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.NotificationConfig} NotificationConfig + * @returns {google.cloud.securitycenter.v1.MuteConfig} MuteConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - NotificationConfig.decodeDelimited = function decodeDelimited(reader) { + MuteConfig.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a NotificationConfig message. + * Verifies a MuteConfig message. * @function verify - * @memberof google.cloud.securitycenter.v1.NotificationConfig + * @memberof google.cloud.securitycenter.v1.MuteConfig * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - NotificationConfig.verify = function verify(message) { + MuteConfig.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.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; if (message.description != null && message.hasOwnProperty("description")) if (!$util.isString(message.description)) return "description: string expected"; - if (message.pubsubTopic != null && message.hasOwnProperty("pubsubTopic")) - if (!$util.isString(message.pubsubTopic)) - return "pubsubTopic: string expected"; - if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) - if (!$util.isString(message.serviceAccount)) - return "serviceAccount: string expected"; - if (message.streamingConfig != null && message.hasOwnProperty("streamingConfig")) { - properties.notifyConfig = 1; - { - var error = $root.google.cloud.securitycenter.v1.NotificationConfig.StreamingConfig.verify(message.streamingConfig); - if (error) - return "streamingConfig." + error; - } + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; } + if (message.mostRecentEditor != null && message.hasOwnProperty("mostRecentEditor")) + if (!$util.isString(message.mostRecentEditor)) + return "mostRecentEditor: string expected"; return null; }; /** - * Creates a NotificationConfig message from a plain object. Also converts values to their respective internal types. + * Creates a MuteConfig message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.securitycenter.v1.NotificationConfig + * @memberof google.cloud.securitycenter.v1.MuteConfig * @static * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.NotificationConfig} NotificationConfig + * @returns {google.cloud.securitycenter.v1.MuteConfig} MuteConfig */ - NotificationConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.NotificationConfig) + MuteConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.MuteConfig) return object; - var message = new $root.google.cloud.securitycenter.v1.NotificationConfig(); + var message = new $root.google.cloud.securitycenter.v1.MuteConfig(); if (object.name != null) message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); if (object.description != null) message.description = String(object.description); - if (object.pubsubTopic != null) - message.pubsubTopic = String(object.pubsubTopic); - if (object.serviceAccount != null) - message.serviceAccount = String(object.serviceAccount); - if (object.streamingConfig != null) { - if (typeof object.streamingConfig !== "object") - throw TypeError(".google.cloud.securitycenter.v1.NotificationConfig.streamingConfig: object expected"); - message.streamingConfig = $root.google.cloud.securitycenter.v1.NotificationConfig.StreamingConfig.fromObject(object.streamingConfig); + if (object.filter != null) + message.filter = String(object.filter); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.securitycenter.v1.MuteConfig.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.securitycenter.v1.MuteConfig.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); } + if (object.mostRecentEditor != null) + message.mostRecentEditor = String(object.mostRecentEditor); return message; }; /** - * Creates a plain object from a NotificationConfig message. Also converts values to other types if specified. + * Creates a plain object from a MuteConfig message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.securitycenter.v1.NotificationConfig + * @memberof google.cloud.securitycenter.v1.MuteConfig * @static - * @param {google.cloud.securitycenter.v1.NotificationConfig} message NotificationConfig + * @param {google.cloud.securitycenter.v1.MuteConfig} message MuteConfig * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - NotificationConfig.toObject = function toObject(message, options) { + MuteConfig.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { object.name = ""; + object.displayName = ""; object.description = ""; - object.pubsubTopic = ""; - object.serviceAccount = ""; + object.filter = ""; + object.createTime = null; + object.updateTime = null; + object.mostRecentEditor = ""; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; if (message.description != null && message.hasOwnProperty("description")) object.description = message.description; - if (message.pubsubTopic != null && message.hasOwnProperty("pubsubTopic")) - object.pubsubTopic = message.pubsubTopic; - if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) - object.serviceAccount = message.serviceAccount; - if (message.streamingConfig != null && message.hasOwnProperty("streamingConfig")) { - object.streamingConfig = $root.google.cloud.securitycenter.v1.NotificationConfig.StreamingConfig.toObject(message.streamingConfig, options); - if (options.oneofs) - object.notifyConfig = "streamingConfig"; - } + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.mostRecentEditor != null && message.hasOwnProperty("mostRecentEditor")) + object.mostRecentEditor = message.mostRecentEditor; return object; }; /** - * Converts this NotificationConfig to JSON. + * Converts this MuteConfig to JSON. * @function toJSON - * @memberof google.cloud.securitycenter.v1.NotificationConfig + * @memberof google.cloud.securitycenter.v1.MuteConfig * @instance * @returns {Object.} JSON object */ - NotificationConfig.prototype.toJSON = function toJSON() { + MuteConfig.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - NotificationConfig.StreamingConfig = (function() { - - /** - * Properties of a StreamingConfig. - * @memberof google.cloud.securitycenter.v1.NotificationConfig - * @interface IStreamingConfig - * @property {string|null} [filter] StreamingConfig filter - */ + return MuteConfig; + })(); - /** - * Constructs a new StreamingConfig. - * @memberof google.cloud.securitycenter.v1.NotificationConfig - * @classdesc Represents a StreamingConfig. - * @implements IStreamingConfig - * @constructor - * @param {google.cloud.securitycenter.v1.NotificationConfig.IStreamingConfig=} [properties] Properties to set - */ - function StreamingConfig(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]]; - } - - /** - * StreamingConfig filter. - * @member {string} filter - * @memberof google.cloud.securitycenter.v1.NotificationConfig.StreamingConfig - * @instance - */ - StreamingConfig.prototype.filter = ""; - - /** - * Creates a new StreamingConfig instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v1.NotificationConfig.StreamingConfig - * @static - * @param {google.cloud.securitycenter.v1.NotificationConfig.IStreamingConfig=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.NotificationConfig.StreamingConfig} StreamingConfig instance - */ - StreamingConfig.create = function create(properties) { - return new StreamingConfig(properties); - }; - - /** - * Encodes the specified StreamingConfig message. Does not implicitly {@link google.cloud.securitycenter.v1.NotificationConfig.StreamingConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1.NotificationConfig.StreamingConfig - * @static - * @param {google.cloud.securitycenter.v1.NotificationConfig.IStreamingConfig} message StreamingConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StreamingConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.filter); - return writer; - }; - - /** - * Encodes the specified StreamingConfig message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.NotificationConfig.StreamingConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.NotificationConfig.StreamingConfig - * @static - * @param {google.cloud.securitycenter.v1.NotificationConfig.IStreamingConfig} message StreamingConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StreamingConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a StreamingConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v1.NotificationConfig.StreamingConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.NotificationConfig.StreamingConfig} StreamingConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - StreamingConfig.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.cloud.securitycenter.v1.NotificationConfig.StreamingConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.filter = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a StreamingConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.NotificationConfig.StreamingConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.NotificationConfig.StreamingConfig} StreamingConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - StreamingConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a StreamingConfig message. - * @function verify - * @memberof google.cloud.securitycenter.v1.NotificationConfig.StreamingConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - StreamingConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.filter != null && message.hasOwnProperty("filter")) - if (!$util.isString(message.filter)) - return "filter: string expected"; - return null; - }; - - /** - * Creates a StreamingConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v1.NotificationConfig.StreamingConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.NotificationConfig.StreamingConfig} StreamingConfig - */ - StreamingConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.NotificationConfig.StreamingConfig) - return object; - var message = new $root.google.cloud.securitycenter.v1.NotificationConfig.StreamingConfig(); - if (object.filter != null) - message.filter = String(object.filter); - return message; - }; - - /** - * Creates a plain object from a StreamingConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v1.NotificationConfig.StreamingConfig - * @static - * @param {google.cloud.securitycenter.v1.NotificationConfig.StreamingConfig} message StreamingConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - StreamingConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.filter = ""; - if (message.filter != null && message.hasOwnProperty("filter")) - object.filter = message.filter; - return object; - }; - - /** - * Converts this StreamingConfig to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1.NotificationConfig.StreamingConfig - * @instance - * @returns {Object.} JSON object - */ - StreamingConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return StreamingConfig; - })(); - - return NotificationConfig; - })(); - - v1.NotificationMessage = (function() { + v1.NotificationConfig = (function() { /** - * Properties of a NotificationMessage. + * Properties of a NotificationConfig. * @memberof google.cloud.securitycenter.v1 - * @interface INotificationMessage - * @property {string|null} [notificationConfigName] NotificationMessage notificationConfigName - * @property {google.cloud.securitycenter.v1.IFinding|null} [finding] NotificationMessage finding - * @property {google.cloud.securitycenter.v1.IResource|null} [resource] NotificationMessage resource + * @interface INotificationConfig + * @property {string|null} [name] NotificationConfig name + * @property {string|null} [description] NotificationConfig description + * @property {string|null} [pubsubTopic] NotificationConfig pubsubTopic + * @property {string|null} [serviceAccount] NotificationConfig serviceAccount + * @property {google.cloud.securitycenter.v1.NotificationConfig.IStreamingConfig|null} [streamingConfig] NotificationConfig streamingConfig */ /** - * Constructs a new NotificationMessage. + * Constructs a new NotificationConfig. * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents a NotificationMessage. - * @implements INotificationMessage + * @classdesc Represents a NotificationConfig. + * @implements INotificationConfig * @constructor - * @param {google.cloud.securitycenter.v1.INotificationMessage=} [properties] Properties to set + * @param {google.cloud.securitycenter.v1.INotificationConfig=} [properties] Properties to set */ - function NotificationMessage(properties) { + function NotificationConfig(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -4298,115 +4254,141 @@ } /** - * NotificationMessage notificationConfigName. - * @member {string} notificationConfigName - * @memberof google.cloud.securitycenter.v1.NotificationMessage + * NotificationConfig name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1.NotificationConfig * @instance */ - NotificationMessage.prototype.notificationConfigName = ""; + NotificationConfig.prototype.name = ""; /** - * NotificationMessage finding. - * @member {google.cloud.securitycenter.v1.IFinding|null|undefined} finding - * @memberof google.cloud.securitycenter.v1.NotificationMessage + * NotificationConfig description. + * @member {string} description + * @memberof google.cloud.securitycenter.v1.NotificationConfig * @instance */ - NotificationMessage.prototype.finding = null; + NotificationConfig.prototype.description = ""; /** - * NotificationMessage resource. - * @member {google.cloud.securitycenter.v1.IResource|null|undefined} resource - * @memberof google.cloud.securitycenter.v1.NotificationMessage + * NotificationConfig pubsubTopic. + * @member {string} pubsubTopic + * @memberof google.cloud.securitycenter.v1.NotificationConfig * @instance */ - NotificationMessage.prototype.resource = null; + NotificationConfig.prototype.pubsubTopic = ""; + + /** + * NotificationConfig serviceAccount. + * @member {string} serviceAccount + * @memberof google.cloud.securitycenter.v1.NotificationConfig + * @instance + */ + NotificationConfig.prototype.serviceAccount = ""; + + /** + * NotificationConfig streamingConfig. + * @member {google.cloud.securitycenter.v1.NotificationConfig.IStreamingConfig|null|undefined} streamingConfig + * @memberof google.cloud.securitycenter.v1.NotificationConfig + * @instance + */ + NotificationConfig.prototype.streamingConfig = null; // OneOf field names bound to virtual getters and setters var $oneOfFields; /** - * NotificationMessage event. - * @member {"finding"|undefined} event - * @memberof google.cloud.securitycenter.v1.NotificationMessage + * NotificationConfig notifyConfig. + * @member {"streamingConfig"|undefined} notifyConfig + * @memberof google.cloud.securitycenter.v1.NotificationConfig * @instance */ - Object.defineProperty(NotificationMessage.prototype, "event", { - get: $util.oneOfGetter($oneOfFields = ["finding"]), + Object.defineProperty(NotificationConfig.prototype, "notifyConfig", { + get: $util.oneOfGetter($oneOfFields = ["streamingConfig"]), set: $util.oneOfSetter($oneOfFields) }); /** - * Creates a new NotificationMessage instance using the specified properties. + * Creates a new NotificationConfig instance using the specified properties. * @function create - * @memberof google.cloud.securitycenter.v1.NotificationMessage + * @memberof google.cloud.securitycenter.v1.NotificationConfig * @static - * @param {google.cloud.securitycenter.v1.INotificationMessage=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.NotificationMessage} NotificationMessage instance + * @param {google.cloud.securitycenter.v1.INotificationConfig=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.NotificationConfig} NotificationConfig instance */ - NotificationMessage.create = function create(properties) { - return new NotificationMessage(properties); + NotificationConfig.create = function create(properties) { + return new NotificationConfig(properties); }; /** - * Encodes the specified NotificationMessage message. Does not implicitly {@link google.cloud.securitycenter.v1.NotificationMessage.verify|verify} messages. + * Encodes the specified NotificationConfig message. Does not implicitly {@link google.cloud.securitycenter.v1.NotificationConfig.verify|verify} messages. * @function encode - * @memberof google.cloud.securitycenter.v1.NotificationMessage + * @memberof google.cloud.securitycenter.v1.NotificationConfig * @static - * @param {google.cloud.securitycenter.v1.INotificationMessage} message NotificationMessage message or plain object to encode + * @param {google.cloud.securitycenter.v1.INotificationConfig} message NotificationConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - NotificationMessage.encode = function encode(message, writer) { + NotificationConfig.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.notificationConfigName != null && Object.hasOwnProperty.call(message, "notificationConfigName")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.notificationConfigName); - if (message.finding != null && Object.hasOwnProperty.call(message, "finding")) - $root.google.cloud.securitycenter.v1.Finding.encode(message.finding, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) - $root.google.cloud.securitycenter.v1.Resource.encode(message.resource, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); + if (message.pubsubTopic != null && Object.hasOwnProperty.call(message, "pubsubTopic")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pubsubTopic); + if (message.serviceAccount != null && Object.hasOwnProperty.call(message, "serviceAccount")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.serviceAccount); + if (message.streamingConfig != null && Object.hasOwnProperty.call(message, "streamingConfig")) + $root.google.cloud.securitycenter.v1.NotificationConfig.StreamingConfig.encode(message.streamingConfig, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); return writer; }; /** - * Encodes the specified NotificationMessage message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.NotificationMessage.verify|verify} messages. + * Encodes the specified NotificationConfig message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.NotificationConfig.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.NotificationMessage + * @memberof google.cloud.securitycenter.v1.NotificationConfig * @static - * @param {google.cloud.securitycenter.v1.INotificationMessage} message NotificationMessage message or plain object to encode + * @param {google.cloud.securitycenter.v1.INotificationConfig} message NotificationConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - NotificationMessage.encodeDelimited = function encodeDelimited(message, writer) { + NotificationConfig.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a NotificationMessage message from the specified reader or buffer. + * Decodes a NotificationConfig message from the specified reader or buffer. * @function decode - * @memberof google.cloud.securitycenter.v1.NotificationMessage + * @memberof google.cloud.securitycenter.v1.NotificationConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.NotificationMessage} NotificationMessage + * @returns {google.cloud.securitycenter.v1.NotificationConfig} NotificationConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - NotificationMessage.decode = function decode(reader, length) { + NotificationConfig.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.cloud.securitycenter.v1.NotificationMessage(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.NotificationConfig(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.notificationConfigName = reader.string(); + message.name = reader.string(); break; case 2: - message.finding = $root.google.cloud.securitycenter.v1.Finding.decode(reader, reader.uint32()); + message.description = reader.string(); break; case 3: - message.resource = $root.google.cloud.securitycenter.v1.Resource.decode(reader, reader.uint32()); + message.pubsubTopic = reader.string(); + break; + case 4: + message.serviceAccount = reader.string(); + break; + case 5: + message.streamingConfig = $root.google.cloud.securitycenter.v1.NotificationConfig.StreamingConfig.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -4417,318 +4399,456 @@ }; /** - * Decodes a NotificationMessage message from the specified reader or buffer, length delimited. + * Decodes a NotificationConfig message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.NotificationMessage + * @memberof google.cloud.securitycenter.v1.NotificationConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.NotificationMessage} NotificationMessage + * @returns {google.cloud.securitycenter.v1.NotificationConfig} NotificationConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - NotificationMessage.decodeDelimited = function decodeDelimited(reader) { + NotificationConfig.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a NotificationMessage message. + * Verifies a NotificationConfig message. * @function verify - * @memberof google.cloud.securitycenter.v1.NotificationMessage + * @memberof google.cloud.securitycenter.v1.NotificationConfig * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - NotificationMessage.verify = function verify(message) { + NotificationConfig.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; var properties = {}; - if (message.notificationConfigName != null && message.hasOwnProperty("notificationConfigName")) - if (!$util.isString(message.notificationConfigName)) - return "notificationConfigName: string expected"; - if (message.finding != null && message.hasOwnProperty("finding")) { - properties.event = 1; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.pubsubTopic != null && message.hasOwnProperty("pubsubTopic")) + if (!$util.isString(message.pubsubTopic)) + return "pubsubTopic: string expected"; + if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) + if (!$util.isString(message.serviceAccount)) + return "serviceAccount: string expected"; + if (message.streamingConfig != null && message.hasOwnProperty("streamingConfig")) { + properties.notifyConfig = 1; { - var error = $root.google.cloud.securitycenter.v1.Finding.verify(message.finding); + var error = $root.google.cloud.securitycenter.v1.NotificationConfig.StreamingConfig.verify(message.streamingConfig); if (error) - return "finding." + error; + return "streamingConfig." + error; } } - if (message.resource != null && message.hasOwnProperty("resource")) { - var error = $root.google.cloud.securitycenter.v1.Resource.verify(message.resource); - if (error) - return "resource." + error; - } return null; }; /** - * Creates a NotificationMessage message from a plain object. Also converts values to their respective internal types. + * Creates a NotificationConfig message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.securitycenter.v1.NotificationMessage + * @memberof google.cloud.securitycenter.v1.NotificationConfig * @static * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.NotificationMessage} NotificationMessage + * @returns {google.cloud.securitycenter.v1.NotificationConfig} NotificationConfig */ - NotificationMessage.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.NotificationMessage) + NotificationConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.NotificationConfig) return object; - var message = new $root.google.cloud.securitycenter.v1.NotificationMessage(); - if (object.notificationConfigName != null) - message.notificationConfigName = String(object.notificationConfigName); - if (object.finding != null) { - if (typeof object.finding !== "object") - throw TypeError(".google.cloud.securitycenter.v1.NotificationMessage.finding: object expected"); - message.finding = $root.google.cloud.securitycenter.v1.Finding.fromObject(object.finding); - } - if (object.resource != null) { - if (typeof object.resource !== "object") - throw TypeError(".google.cloud.securitycenter.v1.NotificationMessage.resource: object expected"); - message.resource = $root.google.cloud.securitycenter.v1.Resource.fromObject(object.resource); + var message = new $root.google.cloud.securitycenter.v1.NotificationConfig(); + if (object.name != null) + message.name = String(object.name); + if (object.description != null) + message.description = String(object.description); + if (object.pubsubTopic != null) + message.pubsubTopic = String(object.pubsubTopic); + if (object.serviceAccount != null) + message.serviceAccount = String(object.serviceAccount); + if (object.streamingConfig != null) { + if (typeof object.streamingConfig !== "object") + throw TypeError(".google.cloud.securitycenter.v1.NotificationConfig.streamingConfig: object expected"); + message.streamingConfig = $root.google.cloud.securitycenter.v1.NotificationConfig.StreamingConfig.fromObject(object.streamingConfig); } return message; }; /** - * Creates a plain object from a NotificationMessage message. Also converts values to other types if specified. + * Creates a plain object from a NotificationConfig message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.securitycenter.v1.NotificationMessage + * @memberof google.cloud.securitycenter.v1.NotificationConfig * @static - * @param {google.cloud.securitycenter.v1.NotificationMessage} message NotificationMessage + * @param {google.cloud.securitycenter.v1.NotificationConfig} message NotificationConfig * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - NotificationMessage.toObject = function toObject(message, options) { + NotificationConfig.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.notificationConfigName = ""; - object.resource = null; + object.name = ""; + object.description = ""; + object.pubsubTopic = ""; + object.serviceAccount = ""; } - if (message.notificationConfigName != null && message.hasOwnProperty("notificationConfigName")) - object.notificationConfigName = message.notificationConfigName; - if (message.finding != null && message.hasOwnProperty("finding")) { - object.finding = $root.google.cloud.securitycenter.v1.Finding.toObject(message.finding, options); + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.pubsubTopic != null && message.hasOwnProperty("pubsubTopic")) + object.pubsubTopic = message.pubsubTopic; + if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) + object.serviceAccount = message.serviceAccount; + if (message.streamingConfig != null && message.hasOwnProperty("streamingConfig")) { + object.streamingConfig = $root.google.cloud.securitycenter.v1.NotificationConfig.StreamingConfig.toObject(message.streamingConfig, options); if (options.oneofs) - object.event = "finding"; + object.notifyConfig = "streamingConfig"; } - if (message.resource != null && message.hasOwnProperty("resource")) - object.resource = $root.google.cloud.securitycenter.v1.Resource.toObject(message.resource, options); return object; }; /** - * Converts this NotificationMessage to JSON. + * Converts this NotificationConfig to JSON. * @function toJSON - * @memberof google.cloud.securitycenter.v1.NotificationMessage + * @memberof google.cloud.securitycenter.v1.NotificationConfig * @instance * @returns {Object.} JSON object */ - NotificationMessage.prototype.toJSON = function toJSON() { + NotificationConfig.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return NotificationMessage; - })(); - - v1.Resource = (function() { - - /** - * Properties of a Resource. - * @memberof google.cloud.securitycenter.v1 - * @interface IResource - * @property {string|null} [name] Resource name - * @property {string|null} [project] Resource project - * @property {string|null} [projectDisplayName] Resource projectDisplayName - * @property {string|null} [parent] Resource parent - * @property {string|null} [parentDisplayName] Resource parentDisplayName - * @property {string|null} [type] Resource type - * @property {Array.|null} [folders] Resource folders - * @property {string|null} [displayName] Resource displayName - */ + NotificationConfig.StreamingConfig = (function() { - /** - * Constructs a new Resource. - * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents a Resource. - * @implements IResource - * @constructor - * @param {google.cloud.securitycenter.v1.IResource=} [properties] Properties to set - */ - function Resource(properties) { - this.folders = []; - 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]]; - } + /** + * Properties of a StreamingConfig. + * @memberof google.cloud.securitycenter.v1.NotificationConfig + * @interface IStreamingConfig + * @property {string|null} [filter] StreamingConfig filter + */ - /** - * Resource name. - * @member {string} name - * @memberof google.cloud.securitycenter.v1.Resource - * @instance - */ - Resource.prototype.name = ""; + /** + * Constructs a new StreamingConfig. + * @memberof google.cloud.securitycenter.v1.NotificationConfig + * @classdesc Represents a StreamingConfig. + * @implements IStreamingConfig + * @constructor + * @param {google.cloud.securitycenter.v1.NotificationConfig.IStreamingConfig=} [properties] Properties to set + */ + function StreamingConfig(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]]; + } - /** - * Resource project. - * @member {string} project - * @memberof google.cloud.securitycenter.v1.Resource - * @instance - */ - Resource.prototype.project = ""; + /** + * StreamingConfig filter. + * @member {string} filter + * @memberof google.cloud.securitycenter.v1.NotificationConfig.StreamingConfig + * @instance + */ + StreamingConfig.prototype.filter = ""; - /** - * Resource projectDisplayName. - * @member {string} projectDisplayName - * @memberof google.cloud.securitycenter.v1.Resource - * @instance - */ - Resource.prototype.projectDisplayName = ""; + /** + * Creates a new StreamingConfig instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.NotificationConfig.StreamingConfig + * @static + * @param {google.cloud.securitycenter.v1.NotificationConfig.IStreamingConfig=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.NotificationConfig.StreamingConfig} StreamingConfig instance + */ + StreamingConfig.create = function create(properties) { + return new StreamingConfig(properties); + }; - /** - * Resource parent. - * @member {string} parent - * @memberof google.cloud.securitycenter.v1.Resource - * @instance + /** + * Encodes the specified StreamingConfig message. Does not implicitly {@link google.cloud.securitycenter.v1.NotificationConfig.StreamingConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.NotificationConfig.StreamingConfig + * @static + * @param {google.cloud.securitycenter.v1.NotificationConfig.IStreamingConfig} message StreamingConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StreamingConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.filter); + return writer; + }; + + /** + * Encodes the specified StreamingConfig message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.NotificationConfig.StreamingConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.NotificationConfig.StreamingConfig + * @static + * @param {google.cloud.securitycenter.v1.NotificationConfig.IStreamingConfig} message StreamingConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StreamingConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StreamingConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.NotificationConfig.StreamingConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.NotificationConfig.StreamingConfig} StreamingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StreamingConfig.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.cloud.securitycenter.v1.NotificationConfig.StreamingConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.filter = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StreamingConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.NotificationConfig.StreamingConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.NotificationConfig.StreamingConfig} StreamingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StreamingConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StreamingConfig message. + * @function verify + * @memberof google.cloud.securitycenter.v1.NotificationConfig.StreamingConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StreamingConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + return null; + }; + + /** + * Creates a StreamingConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.NotificationConfig.StreamingConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.NotificationConfig.StreamingConfig} StreamingConfig + */ + StreamingConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.NotificationConfig.StreamingConfig) + return object; + var message = new $root.google.cloud.securitycenter.v1.NotificationConfig.StreamingConfig(); + if (object.filter != null) + message.filter = String(object.filter); + return message; + }; + + /** + * Creates a plain object from a StreamingConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.NotificationConfig.StreamingConfig + * @static + * @param {google.cloud.securitycenter.v1.NotificationConfig.StreamingConfig} message StreamingConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StreamingConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.filter = ""; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + return object; + }; + + /** + * Converts this StreamingConfig to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.NotificationConfig.StreamingConfig + * @instance + * @returns {Object.} JSON object + */ + StreamingConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return StreamingConfig; + })(); + + return NotificationConfig; + })(); + + v1.NotificationMessage = (function() { + + /** + * Properties of a NotificationMessage. + * @memberof google.cloud.securitycenter.v1 + * @interface INotificationMessage + * @property {string|null} [notificationConfigName] NotificationMessage notificationConfigName + * @property {google.cloud.securitycenter.v1.IFinding|null} [finding] NotificationMessage finding + * @property {google.cloud.securitycenter.v1.IResource|null} [resource] NotificationMessage resource */ - Resource.prototype.parent = ""; /** - * Resource parentDisplayName. - * @member {string} parentDisplayName - * @memberof google.cloud.securitycenter.v1.Resource + * Constructs a new NotificationMessage. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a NotificationMessage. + * @implements INotificationMessage + * @constructor + * @param {google.cloud.securitycenter.v1.INotificationMessage=} [properties] Properties to set + */ + function NotificationMessage(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]]; + } + + /** + * NotificationMessage notificationConfigName. + * @member {string} notificationConfigName + * @memberof google.cloud.securitycenter.v1.NotificationMessage * @instance */ - Resource.prototype.parentDisplayName = ""; + NotificationMessage.prototype.notificationConfigName = ""; /** - * Resource type. - * @member {string} type - * @memberof google.cloud.securitycenter.v1.Resource + * NotificationMessage finding. + * @member {google.cloud.securitycenter.v1.IFinding|null|undefined} finding + * @memberof google.cloud.securitycenter.v1.NotificationMessage * @instance */ - Resource.prototype.type = ""; + NotificationMessage.prototype.finding = null; /** - * Resource folders. - * @member {Array.} folders - * @memberof google.cloud.securitycenter.v1.Resource + * NotificationMessage resource. + * @member {google.cloud.securitycenter.v1.IResource|null|undefined} resource + * @memberof google.cloud.securitycenter.v1.NotificationMessage * @instance */ - Resource.prototype.folders = $util.emptyArray; + NotificationMessage.prototype.resource = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; /** - * Resource displayName. - * @member {string} displayName - * @memberof google.cloud.securitycenter.v1.Resource + * NotificationMessage event. + * @member {"finding"|undefined} event + * @memberof google.cloud.securitycenter.v1.NotificationMessage * @instance */ - Resource.prototype.displayName = ""; + Object.defineProperty(NotificationMessage.prototype, "event", { + get: $util.oneOfGetter($oneOfFields = ["finding"]), + set: $util.oneOfSetter($oneOfFields) + }); /** - * Creates a new Resource instance using the specified properties. + * Creates a new NotificationMessage instance using the specified properties. * @function create - * @memberof google.cloud.securitycenter.v1.Resource + * @memberof google.cloud.securitycenter.v1.NotificationMessage * @static - * @param {google.cloud.securitycenter.v1.IResource=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.Resource} Resource instance + * @param {google.cloud.securitycenter.v1.INotificationMessage=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.NotificationMessage} NotificationMessage instance */ - Resource.create = function create(properties) { - return new Resource(properties); + NotificationMessage.create = function create(properties) { + return new NotificationMessage(properties); }; /** - * Encodes the specified Resource message. Does not implicitly {@link google.cloud.securitycenter.v1.Resource.verify|verify} messages. + * Encodes the specified NotificationMessage message. Does not implicitly {@link google.cloud.securitycenter.v1.NotificationMessage.verify|verify} messages. * @function encode - * @memberof google.cloud.securitycenter.v1.Resource + * @memberof google.cloud.securitycenter.v1.NotificationMessage * @static - * @param {google.cloud.securitycenter.v1.IResource} message Resource message or plain object to encode + * @param {google.cloud.securitycenter.v1.INotificationMessage} message NotificationMessage message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Resource.encode = function encode(message, writer) { + NotificationMessage.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.project != null && Object.hasOwnProperty.call(message, "project")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.project); - if (message.projectDisplayName != null && Object.hasOwnProperty.call(message, "projectDisplayName")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.projectDisplayName); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.parent); - if (message.parentDisplayName != null && Object.hasOwnProperty.call(message, "parentDisplayName")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.parentDisplayName); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.type); - if (message.folders != null && message.folders.length) - for (var i = 0; i < message.folders.length; ++i) - $root.google.cloud.securitycenter.v1.Folder.encode(message.folders[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.displayName); + if (message.notificationConfigName != null && Object.hasOwnProperty.call(message, "notificationConfigName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.notificationConfigName); + if (message.finding != null && Object.hasOwnProperty.call(message, "finding")) + $root.google.cloud.securitycenter.v1.Finding.encode(message.finding, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) + $root.google.cloud.securitycenter.v1.Resource.encode(message.resource, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; /** - * Encodes the specified Resource message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Resource.verify|verify} messages. + * Encodes the specified NotificationMessage message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.NotificationMessage.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.Resource + * @memberof google.cloud.securitycenter.v1.NotificationMessage * @static - * @param {google.cloud.securitycenter.v1.IResource} message Resource message or plain object to encode + * @param {google.cloud.securitycenter.v1.INotificationMessage} message NotificationMessage message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Resource.encodeDelimited = function encodeDelimited(message, writer) { + NotificationMessage.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a Resource message from the specified reader or buffer. + * Decodes a NotificationMessage message from the specified reader or buffer. * @function decode - * @memberof google.cloud.securitycenter.v1.Resource + * @memberof google.cloud.securitycenter.v1.NotificationMessage * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.Resource} Resource + * @returns {google.cloud.securitycenter.v1.NotificationMessage} NotificationMessage * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Resource.decode = function decode(reader, length) { + NotificationMessage.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.cloud.securitycenter.v1.Resource(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.NotificationMessage(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.name = reader.string(); + message.notificationConfigName = reader.string(); break; case 2: - message.project = reader.string(); + message.finding = $root.google.cloud.securitycenter.v1.Finding.decode(reader, reader.uint32()); break; case 3: - message.projectDisplayName = reader.string(); - break; - case 4: - message.parent = reader.string(); - break; - case 5: - message.parentDisplayName = reader.string(); - break; - case 6: - message.type = reader.string(); - break; - case 7: - if (!(message.folders && message.folders.length)) - message.folders = []; - message.folders.push($root.google.cloud.securitycenter.v1.Folder.decode(reader, reader.uint32())); - break; - case 8: - message.displayName = reader.string(); + message.resource = $root.google.cloud.securitycenter.v1.Resource.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -4739,184 +4859,148 @@ }; /** - * Decodes a Resource message from the specified reader or buffer, length delimited. + * Decodes a NotificationMessage message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.Resource + * @memberof google.cloud.securitycenter.v1.NotificationMessage * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.Resource} Resource + * @returns {google.cloud.securitycenter.v1.NotificationMessage} NotificationMessage * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Resource.decodeDelimited = function decodeDelimited(reader) { + NotificationMessage.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a Resource message. + * Verifies a NotificationMessage message. * @function verify - * @memberof google.cloud.securitycenter.v1.Resource + * @memberof google.cloud.securitycenter.v1.NotificationMessage * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Resource.verify = function verify(message) { + NotificationMessage.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.project != null && message.hasOwnProperty("project")) - if (!$util.isString(message.project)) - return "project: string expected"; - if (message.projectDisplayName != null && message.hasOwnProperty("projectDisplayName")) - if (!$util.isString(message.projectDisplayName)) - return "projectDisplayName: string expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.parentDisplayName != null && message.hasOwnProperty("parentDisplayName")) - if (!$util.isString(message.parentDisplayName)) - return "parentDisplayName: string expected"; - if (message.type != null && message.hasOwnProperty("type")) - if (!$util.isString(message.type)) - return "type: string expected"; - if (message.folders != null && message.hasOwnProperty("folders")) { - if (!Array.isArray(message.folders)) - return "folders: array expected"; - for (var i = 0; i < message.folders.length; ++i) { - var error = $root.google.cloud.securitycenter.v1.Folder.verify(message.folders[i]); + var properties = {}; + if (message.notificationConfigName != null && message.hasOwnProperty("notificationConfigName")) + if (!$util.isString(message.notificationConfigName)) + return "notificationConfigName: string expected"; + if (message.finding != null && message.hasOwnProperty("finding")) { + properties.event = 1; + { + var error = $root.google.cloud.securitycenter.v1.Finding.verify(message.finding); if (error) - return "folders." + error; + return "finding." + error; } } - if (message.displayName != null && message.hasOwnProperty("displayName")) - if (!$util.isString(message.displayName)) - return "displayName: string expected"; + if (message.resource != null && message.hasOwnProperty("resource")) { + var error = $root.google.cloud.securitycenter.v1.Resource.verify(message.resource); + if (error) + return "resource." + error; + } return null; }; /** - * Creates a Resource message from a plain object. Also converts values to their respective internal types. + * Creates a NotificationMessage message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.securitycenter.v1.Resource + * @memberof google.cloud.securitycenter.v1.NotificationMessage * @static * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.Resource} Resource + * @returns {google.cloud.securitycenter.v1.NotificationMessage} NotificationMessage */ - Resource.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.Resource) + NotificationMessage.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.NotificationMessage) return object; - var message = new $root.google.cloud.securitycenter.v1.Resource(); - if (object.name != null) - message.name = String(object.name); - if (object.project != null) - message.project = String(object.project); - if (object.projectDisplayName != null) - message.projectDisplayName = String(object.projectDisplayName); - if (object.parent != null) - message.parent = String(object.parent); - if (object.parentDisplayName != null) - message.parentDisplayName = String(object.parentDisplayName); - if (object.type != null) - message.type = String(object.type); - if (object.folders) { - if (!Array.isArray(object.folders)) - throw TypeError(".google.cloud.securitycenter.v1.Resource.folders: array expected"); - message.folders = []; - for (var i = 0; i < object.folders.length; ++i) { - if (typeof object.folders[i] !== "object") - throw TypeError(".google.cloud.securitycenter.v1.Resource.folders: object expected"); - message.folders[i] = $root.google.cloud.securitycenter.v1.Folder.fromObject(object.folders[i]); - } + var message = new $root.google.cloud.securitycenter.v1.NotificationMessage(); + if (object.notificationConfigName != null) + message.notificationConfigName = String(object.notificationConfigName); + if (object.finding != null) { + if (typeof object.finding !== "object") + throw TypeError(".google.cloud.securitycenter.v1.NotificationMessage.finding: object expected"); + message.finding = $root.google.cloud.securitycenter.v1.Finding.fromObject(object.finding); + } + if (object.resource != null) { + if (typeof object.resource !== "object") + throw TypeError(".google.cloud.securitycenter.v1.NotificationMessage.resource: object expected"); + message.resource = $root.google.cloud.securitycenter.v1.Resource.fromObject(object.resource); } - if (object.displayName != null) - message.displayName = String(object.displayName); return message; }; /** - * Creates a plain object from a Resource message. Also converts values to other types if specified. + * Creates a plain object from a NotificationMessage message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.securitycenter.v1.Resource + * @memberof google.cloud.securitycenter.v1.NotificationMessage * @static - * @param {google.cloud.securitycenter.v1.Resource} message Resource + * @param {google.cloud.securitycenter.v1.NotificationMessage} message NotificationMessage * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Resource.toObject = function toObject(message, options) { + NotificationMessage.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.folders = []; if (options.defaults) { - object.name = ""; - object.project = ""; - object.projectDisplayName = ""; - object.parent = ""; - object.parentDisplayName = ""; - object.type = ""; - object.displayName = ""; + object.notificationConfigName = ""; + object.resource = null; } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.project != null && message.hasOwnProperty("project")) - object.project = message.project; - if (message.projectDisplayName != null && message.hasOwnProperty("projectDisplayName")) - object.projectDisplayName = message.projectDisplayName; - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.parentDisplayName != null && message.hasOwnProperty("parentDisplayName")) - object.parentDisplayName = message.parentDisplayName; - if (message.type != null && message.hasOwnProperty("type")) - object.type = message.type; - if (message.folders && message.folders.length) { - object.folders = []; - for (var j = 0; j < message.folders.length; ++j) - object.folders[j] = $root.google.cloud.securitycenter.v1.Folder.toObject(message.folders[j], options); + if (message.notificationConfigName != null && message.hasOwnProperty("notificationConfigName")) + object.notificationConfigName = message.notificationConfigName; + if (message.finding != null && message.hasOwnProperty("finding")) { + object.finding = $root.google.cloud.securitycenter.v1.Finding.toObject(message.finding, options); + if (options.oneofs) + object.event = "finding"; } - if (message.displayName != null && message.hasOwnProperty("displayName")) - object.displayName = message.displayName; + if (message.resource != null && message.hasOwnProperty("resource")) + object.resource = $root.google.cloud.securitycenter.v1.Resource.toObject(message.resource, options); return object; }; /** - * Converts this Resource to JSON. + * Converts this NotificationMessage to JSON. * @function toJSON - * @memberof google.cloud.securitycenter.v1.Resource + * @memberof google.cloud.securitycenter.v1.NotificationMessage * @instance * @returns {Object.} JSON object */ - Resource.prototype.toJSON = function toJSON() { + NotificationMessage.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return Resource; + return NotificationMessage; })(); - v1.OrganizationSettings = (function() { + v1.Resource = (function() { /** - * Properties of an OrganizationSettings. + * Properties of a Resource. * @memberof google.cloud.securitycenter.v1 - * @interface IOrganizationSettings - * @property {string|null} [name] OrganizationSettings name - * @property {boolean|null} [enableAssetDiscovery] OrganizationSettings enableAssetDiscovery - * @property {google.cloud.securitycenter.v1.OrganizationSettings.IAssetDiscoveryConfig|null} [assetDiscoveryConfig] OrganizationSettings assetDiscoveryConfig + * @interface IResource + * @property {string|null} [name] Resource name + * @property {string|null} [project] Resource project + * @property {string|null} [projectDisplayName] Resource projectDisplayName + * @property {string|null} [parent] Resource parent + * @property {string|null} [parentDisplayName] Resource parentDisplayName + * @property {string|null} [type] Resource type + * @property {Array.|null} [folders] Resource folders + * @property {string|null} [displayName] Resource displayName */ /** - * Constructs a new OrganizationSettings. + * Constructs a new Resource. * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents an OrganizationSettings. - * @implements IOrganizationSettings + * @classdesc Represents a Resource. + * @implements IResource * @constructor - * @param {google.cloud.securitycenter.v1.IOrganizationSettings=} [properties] Properties to set + * @param {google.cloud.securitycenter.v1.IResource=} [properties] Properties to set */ - function OrganizationSettings(properties) { + function Resource(properties) { + this.folders = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -4924,90 +5008,141 @@ } /** - * OrganizationSettings name. + * Resource name. * @member {string} name - * @memberof google.cloud.securitycenter.v1.OrganizationSettings + * @memberof google.cloud.securitycenter.v1.Resource * @instance */ - OrganizationSettings.prototype.name = ""; + Resource.prototype.name = ""; /** - * OrganizationSettings enableAssetDiscovery. - * @member {boolean} enableAssetDiscovery - * @memberof google.cloud.securitycenter.v1.OrganizationSettings + * Resource project. + * @member {string} project + * @memberof google.cloud.securitycenter.v1.Resource * @instance */ - OrganizationSettings.prototype.enableAssetDiscovery = false; + Resource.prototype.project = ""; /** - * OrganizationSettings assetDiscoveryConfig. - * @member {google.cloud.securitycenter.v1.OrganizationSettings.IAssetDiscoveryConfig|null|undefined} assetDiscoveryConfig - * @memberof google.cloud.securitycenter.v1.OrganizationSettings + * Resource projectDisplayName. + * @member {string} projectDisplayName + * @memberof google.cloud.securitycenter.v1.Resource * @instance */ - OrganizationSettings.prototype.assetDiscoveryConfig = null; + Resource.prototype.projectDisplayName = ""; /** - * Creates a new OrganizationSettings instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v1.OrganizationSettings - * @static - * @param {google.cloud.securitycenter.v1.IOrganizationSettings=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.OrganizationSettings} OrganizationSettings instance + * Resource parent. + * @member {string} parent + * @memberof google.cloud.securitycenter.v1.Resource + * @instance */ - OrganizationSettings.create = function create(properties) { - return new OrganizationSettings(properties); + Resource.prototype.parent = ""; + + /** + * Resource parentDisplayName. + * @member {string} parentDisplayName + * @memberof google.cloud.securitycenter.v1.Resource + * @instance + */ + Resource.prototype.parentDisplayName = ""; + + /** + * Resource type. + * @member {string} type + * @memberof google.cloud.securitycenter.v1.Resource + * @instance + */ + Resource.prototype.type = ""; + + /** + * Resource folders. + * @member {Array.} folders + * @memberof google.cloud.securitycenter.v1.Resource + * @instance + */ + Resource.prototype.folders = $util.emptyArray; + + /** + * Resource displayName. + * @member {string} displayName + * @memberof google.cloud.securitycenter.v1.Resource + * @instance + */ + Resource.prototype.displayName = ""; + + /** + * Creates a new Resource instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.Resource + * @static + * @param {google.cloud.securitycenter.v1.IResource=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.Resource} Resource instance + */ + Resource.create = function create(properties) { + return new Resource(properties); }; /** - * Encodes the specified OrganizationSettings message. Does not implicitly {@link google.cloud.securitycenter.v1.OrganizationSettings.verify|verify} messages. + * Encodes the specified Resource message. Does not implicitly {@link google.cloud.securitycenter.v1.Resource.verify|verify} messages. * @function encode - * @memberof google.cloud.securitycenter.v1.OrganizationSettings + * @memberof google.cloud.securitycenter.v1.Resource * @static - * @param {google.cloud.securitycenter.v1.IOrganizationSettings} message OrganizationSettings message or plain object to encode + * @param {google.cloud.securitycenter.v1.IResource} message Resource message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - OrganizationSettings.encode = function encode(message, writer) { + Resource.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.enableAssetDiscovery != null && Object.hasOwnProperty.call(message, "enableAssetDiscovery")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.enableAssetDiscovery); - if (message.assetDiscoveryConfig != null && Object.hasOwnProperty.call(message, "assetDiscoveryConfig")) - $root.google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.encode(message.assetDiscoveryConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.project); + if (message.projectDisplayName != null && Object.hasOwnProperty.call(message, "projectDisplayName")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.projectDisplayName); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.parent); + if (message.parentDisplayName != null && Object.hasOwnProperty.call(message, "parentDisplayName")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.parentDisplayName); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.type); + if (message.folders != null && message.folders.length) + for (var i = 0; i < message.folders.length; ++i) + $root.google.cloud.securitycenter.v1.Folder.encode(message.folders[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.displayName); return writer; }; /** - * Encodes the specified OrganizationSettings message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.OrganizationSettings.verify|verify} messages. + * Encodes the specified Resource message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Resource.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.OrganizationSettings + * @memberof google.cloud.securitycenter.v1.Resource * @static - * @param {google.cloud.securitycenter.v1.IOrganizationSettings} message OrganizationSettings message or plain object to encode + * @param {google.cloud.securitycenter.v1.IResource} message Resource message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - OrganizationSettings.encodeDelimited = function encodeDelimited(message, writer) { + Resource.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an OrganizationSettings message from the specified reader or buffer. + * Decodes a Resource message from the specified reader or buffer. * @function decode - * @memberof google.cloud.securitycenter.v1.OrganizationSettings + * @memberof google.cloud.securitycenter.v1.Resource * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.OrganizationSettings} OrganizationSettings + * @returns {google.cloud.securitycenter.v1.Resource} Resource * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - OrganizationSettings.decode = function decode(reader, length) { + Resource.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.cloud.securitycenter.v1.OrganizationSettings(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.Resource(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -5015,10 +5150,27 @@ message.name = reader.string(); break; case 2: - message.enableAssetDiscovery = reader.bool(); + message.project = reader.string(); break; case 3: - message.assetDiscoveryConfig = $root.google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.decode(reader, reader.uint32()); + message.projectDisplayName = reader.string(); + break; + case 4: + message.parent = reader.string(); + break; + case 5: + message.parentDisplayName = reader.string(); + break; + case 6: + message.type = reader.string(); + break; + case 7: + if (!(message.folders && message.folders.length)) + message.folders = []; + message.folders.push($root.google.cloud.securitycenter.v1.Folder.decode(reader, reader.uint32())); + break; + case 8: + message.displayName = reader.string(); break; default: reader.skipType(tag & 7); @@ -5029,121 +5181,411 @@ }; /** - * Decodes an OrganizationSettings message from the specified reader or buffer, length delimited. + * Decodes a Resource message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.OrganizationSettings + * @memberof google.cloud.securitycenter.v1.Resource * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.OrganizationSettings} OrganizationSettings + * @returns {google.cloud.securitycenter.v1.Resource} Resource * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - OrganizationSettings.decodeDelimited = function decodeDelimited(reader) { + Resource.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an OrganizationSettings message. + * Verifies a Resource message. * @function verify - * @memberof google.cloud.securitycenter.v1.OrganizationSettings + * @memberof google.cloud.securitycenter.v1.Resource * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - OrganizationSettings.verify = function verify(message) { + Resource.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.enableAssetDiscovery != null && message.hasOwnProperty("enableAssetDiscovery")) - if (typeof message.enableAssetDiscovery !== "boolean") - return "enableAssetDiscovery: boolean expected"; - if (message.assetDiscoveryConfig != null && message.hasOwnProperty("assetDiscoveryConfig")) { - var error = $root.google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.verify(message.assetDiscoveryConfig); - if (error) - return "assetDiscoveryConfig." + error; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.projectDisplayName != null && message.hasOwnProperty("projectDisplayName")) + if (!$util.isString(message.projectDisplayName)) + return "projectDisplayName: string expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.parentDisplayName != null && message.hasOwnProperty("parentDisplayName")) + if (!$util.isString(message.parentDisplayName)) + return "parentDisplayName: string expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.folders != null && message.hasOwnProperty("folders")) { + if (!Array.isArray(message.folders)) + return "folders: array expected"; + for (var i = 0; i < message.folders.length; ++i) { + var error = $root.google.cloud.securitycenter.v1.Folder.verify(message.folders[i]); + if (error) + return "folders." + error; + } } + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; return null; }; /** - * Creates an OrganizationSettings message from a plain object. Also converts values to their respective internal types. + * Creates a Resource message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.securitycenter.v1.OrganizationSettings + * @memberof google.cloud.securitycenter.v1.Resource * @static * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.OrganizationSettings} OrganizationSettings + * @returns {google.cloud.securitycenter.v1.Resource} Resource */ - OrganizationSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.OrganizationSettings) + Resource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.Resource) return object; - var message = new $root.google.cloud.securitycenter.v1.OrganizationSettings(); + var message = new $root.google.cloud.securitycenter.v1.Resource(); if (object.name != null) message.name = String(object.name); - if (object.enableAssetDiscovery != null) - message.enableAssetDiscovery = Boolean(object.enableAssetDiscovery); - if (object.assetDiscoveryConfig != null) { - if (typeof object.assetDiscoveryConfig !== "object") - throw TypeError(".google.cloud.securitycenter.v1.OrganizationSettings.assetDiscoveryConfig: object expected"); - message.assetDiscoveryConfig = $root.google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.fromObject(object.assetDiscoveryConfig); + if (object.project != null) + message.project = String(object.project); + if (object.projectDisplayName != null) + message.projectDisplayName = String(object.projectDisplayName); + if (object.parent != null) + message.parent = String(object.parent); + if (object.parentDisplayName != null) + message.parentDisplayName = String(object.parentDisplayName); + if (object.type != null) + message.type = String(object.type); + if (object.folders) { + if (!Array.isArray(object.folders)) + throw TypeError(".google.cloud.securitycenter.v1.Resource.folders: array expected"); + message.folders = []; + for (var i = 0; i < object.folders.length; ++i) { + if (typeof object.folders[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Resource.folders: object expected"); + message.folders[i] = $root.google.cloud.securitycenter.v1.Folder.fromObject(object.folders[i]); + } } + if (object.displayName != null) + message.displayName = String(object.displayName); return message; }; /** - * Creates a plain object from an OrganizationSettings message. Also converts values to other types if specified. + * Creates a plain object from a Resource message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.securitycenter.v1.OrganizationSettings + * @memberof google.cloud.securitycenter.v1.Resource * @static - * @param {google.cloud.securitycenter.v1.OrganizationSettings} message OrganizationSettings + * @param {google.cloud.securitycenter.v1.Resource} message Resource * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - OrganizationSettings.toObject = function toObject(message, options) { + Resource.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) + object.folders = []; if (options.defaults) { object.name = ""; - object.enableAssetDiscovery = false; - object.assetDiscoveryConfig = null; + object.project = ""; + object.projectDisplayName = ""; + object.parent = ""; + object.parentDisplayName = ""; + object.type = ""; + object.displayName = ""; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; - if (message.enableAssetDiscovery != null && message.hasOwnProperty("enableAssetDiscovery")) - object.enableAssetDiscovery = message.enableAssetDiscovery; - if (message.assetDiscoveryConfig != null && message.hasOwnProperty("assetDiscoveryConfig")) - object.assetDiscoveryConfig = $root.google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.toObject(message.assetDiscoveryConfig, options); + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.projectDisplayName != null && message.hasOwnProperty("projectDisplayName")) + object.projectDisplayName = message.projectDisplayName; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.parentDisplayName != null && message.hasOwnProperty("parentDisplayName")) + object.parentDisplayName = message.parentDisplayName; + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.folders && message.folders.length) { + object.folders = []; + for (var j = 0; j < message.folders.length; ++j) + object.folders[j] = $root.google.cloud.securitycenter.v1.Folder.toObject(message.folders[j], options); + } + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; return object; }; /** - * Converts this OrganizationSettings to JSON. + * Converts this Resource to JSON. * @function toJSON - * @memberof google.cloud.securitycenter.v1.OrganizationSettings + * @memberof google.cloud.securitycenter.v1.Resource * @instance * @returns {Object.} JSON object */ - OrganizationSettings.prototype.toJSON = function toJSON() { + Resource.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - OrganizationSettings.AssetDiscoveryConfig = (function() { + return Resource; + })(); - /** - * Properties of an AssetDiscoveryConfig. - * @memberof google.cloud.securitycenter.v1.OrganizationSettings - * @interface IAssetDiscoveryConfig - * @property {Array.|null} [projectIds] AssetDiscoveryConfig projectIds - * @property {google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode|null} [inclusionMode] AssetDiscoveryConfig inclusionMode - * @property {Array.|null} [folderIds] AssetDiscoveryConfig folderIds - */ + v1.OrganizationSettings = (function() { - /** - * Constructs a new AssetDiscoveryConfig. + /** + * Properties of an OrganizationSettings. + * @memberof google.cloud.securitycenter.v1 + * @interface IOrganizationSettings + * @property {string|null} [name] OrganizationSettings name + * @property {boolean|null} [enableAssetDiscovery] OrganizationSettings enableAssetDiscovery + * @property {google.cloud.securitycenter.v1.OrganizationSettings.IAssetDiscoveryConfig|null} [assetDiscoveryConfig] OrganizationSettings assetDiscoveryConfig + */ + + /** + * Constructs a new OrganizationSettings. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents an OrganizationSettings. + * @implements IOrganizationSettings + * @constructor + * @param {google.cloud.securitycenter.v1.IOrganizationSettings=} [properties] Properties to set + */ + function OrganizationSettings(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]]; + } + + /** + * OrganizationSettings name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1.OrganizationSettings + * @instance + */ + OrganizationSettings.prototype.name = ""; + + /** + * OrganizationSettings enableAssetDiscovery. + * @member {boolean} enableAssetDiscovery + * @memberof google.cloud.securitycenter.v1.OrganizationSettings + * @instance + */ + OrganizationSettings.prototype.enableAssetDiscovery = false; + + /** + * OrganizationSettings assetDiscoveryConfig. + * @member {google.cloud.securitycenter.v1.OrganizationSettings.IAssetDiscoveryConfig|null|undefined} assetDiscoveryConfig + * @memberof google.cloud.securitycenter.v1.OrganizationSettings + * @instance + */ + OrganizationSettings.prototype.assetDiscoveryConfig = null; + + /** + * Creates a new OrganizationSettings instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.OrganizationSettings + * @static + * @param {google.cloud.securitycenter.v1.IOrganizationSettings=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.OrganizationSettings} OrganizationSettings instance + */ + OrganizationSettings.create = function create(properties) { + return new OrganizationSettings(properties); + }; + + /** + * Encodes the specified OrganizationSettings message. Does not implicitly {@link google.cloud.securitycenter.v1.OrganizationSettings.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.OrganizationSettings + * @static + * @param {google.cloud.securitycenter.v1.IOrganizationSettings} message OrganizationSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OrganizationSettings.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.enableAssetDiscovery != null && Object.hasOwnProperty.call(message, "enableAssetDiscovery")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.enableAssetDiscovery); + if (message.assetDiscoveryConfig != null && Object.hasOwnProperty.call(message, "assetDiscoveryConfig")) + $root.google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.encode(message.assetDiscoveryConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OrganizationSettings message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.OrganizationSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.OrganizationSettings + * @static + * @param {google.cloud.securitycenter.v1.IOrganizationSettings} message OrganizationSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OrganizationSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OrganizationSettings message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.OrganizationSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.OrganizationSettings} OrganizationSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OrganizationSettings.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.cloud.securitycenter.v1.OrganizationSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.enableAssetDiscovery = reader.bool(); + break; + case 3: + message.assetDiscoveryConfig = $root.google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OrganizationSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.OrganizationSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.OrganizationSettings} OrganizationSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OrganizationSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OrganizationSettings message. + * @function verify + * @memberof google.cloud.securitycenter.v1.OrganizationSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OrganizationSettings.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.enableAssetDiscovery != null && message.hasOwnProperty("enableAssetDiscovery")) + if (typeof message.enableAssetDiscovery !== "boolean") + return "enableAssetDiscovery: boolean expected"; + if (message.assetDiscoveryConfig != null && message.hasOwnProperty("assetDiscoveryConfig")) { + var error = $root.google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.verify(message.assetDiscoveryConfig); + if (error) + return "assetDiscoveryConfig." + error; + } + return null; + }; + + /** + * Creates an OrganizationSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.OrganizationSettings + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.OrganizationSettings} OrganizationSettings + */ + OrganizationSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.OrganizationSettings) + return object; + var message = new $root.google.cloud.securitycenter.v1.OrganizationSettings(); + if (object.name != null) + message.name = String(object.name); + if (object.enableAssetDiscovery != null) + message.enableAssetDiscovery = Boolean(object.enableAssetDiscovery); + if (object.assetDiscoveryConfig != null) { + if (typeof object.assetDiscoveryConfig !== "object") + throw TypeError(".google.cloud.securitycenter.v1.OrganizationSettings.assetDiscoveryConfig: object expected"); + message.assetDiscoveryConfig = $root.google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.fromObject(object.assetDiscoveryConfig); + } + return message; + }; + + /** + * Creates a plain object from an OrganizationSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.OrganizationSettings + * @static + * @param {google.cloud.securitycenter.v1.OrganizationSettings} message OrganizationSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OrganizationSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.enableAssetDiscovery = false; + object.assetDiscoveryConfig = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.enableAssetDiscovery != null && message.hasOwnProperty("enableAssetDiscovery")) + object.enableAssetDiscovery = message.enableAssetDiscovery; + if (message.assetDiscoveryConfig != null && message.hasOwnProperty("assetDiscoveryConfig")) + object.assetDiscoveryConfig = $root.google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.toObject(message.assetDiscoveryConfig, options); + return object; + }; + + /** + * Converts this OrganizationSettings to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.OrganizationSettings + * @instance + * @returns {Object.} JSON object + */ + OrganizationSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + OrganizationSettings.AssetDiscoveryConfig = (function() { + + /** + * Properties of an AssetDiscoveryConfig. + * @memberof google.cloud.securitycenter.v1.OrganizationSettings + * @interface IAssetDiscoveryConfig + * @property {Array.|null} [projectIds] AssetDiscoveryConfig projectIds + * @property {google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode|null} [inclusionMode] AssetDiscoveryConfig inclusionMode + * @property {Array.|null} [folderIds] AssetDiscoveryConfig folderIds + */ + + /** + * Constructs a new AssetDiscoveryConfig. * @memberof google.cloud.securitycenter.v1.OrganizationSettings * @classdesc Represents an AssetDiscoveryConfig. * @implements IAssetDiscoveryConfig @@ -5400,58 +5842,1340 @@ return object; }; - /** - * Converts this AssetDiscoveryConfig to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig - * @instance - * @returns {Object.} JSON object - */ - AssetDiscoveryConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Converts this AssetDiscoveryConfig to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig + * @instance + * @returns {Object.} JSON object + */ + AssetDiscoveryConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * InclusionMode enum. + * @name google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode + * @enum {number} + * @property {number} INCLUSION_MODE_UNSPECIFIED=0 INCLUSION_MODE_UNSPECIFIED value + * @property {number} INCLUDE_ONLY=1 INCLUDE_ONLY value + * @property {number} EXCLUDE=2 EXCLUDE value + */ + AssetDiscoveryConfig.InclusionMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "INCLUSION_MODE_UNSPECIFIED"] = 0; + values[valuesById[1] = "INCLUDE_ONLY"] = 1; + values[valuesById[2] = "EXCLUDE"] = 2; + return values; + })(); + + return AssetDiscoveryConfig; + })(); + + return OrganizationSettings; + })(); + + v1.RunAssetDiscoveryResponse = (function() { + + /** + * Properties of a RunAssetDiscoveryResponse. + * @memberof google.cloud.securitycenter.v1 + * @interface IRunAssetDiscoveryResponse + * @property {google.cloud.securitycenter.v1.RunAssetDiscoveryResponse.State|null} [state] RunAssetDiscoveryResponse state + * @property {google.protobuf.IDuration|null} [duration] RunAssetDiscoveryResponse duration + */ + + /** + * Constructs a new RunAssetDiscoveryResponse. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a RunAssetDiscoveryResponse. + * @implements IRunAssetDiscoveryResponse + * @constructor + * @param {google.cloud.securitycenter.v1.IRunAssetDiscoveryResponse=} [properties] Properties to set + */ + function RunAssetDiscoveryResponse(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]]; + } + + /** + * RunAssetDiscoveryResponse state. + * @member {google.cloud.securitycenter.v1.RunAssetDiscoveryResponse.State} state + * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryResponse + * @instance + */ + RunAssetDiscoveryResponse.prototype.state = 0; + + /** + * RunAssetDiscoveryResponse duration. + * @member {google.protobuf.IDuration|null|undefined} duration + * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryResponse + * @instance + */ + RunAssetDiscoveryResponse.prototype.duration = null; + + /** + * Creates a new RunAssetDiscoveryResponse instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryResponse + * @static + * @param {google.cloud.securitycenter.v1.IRunAssetDiscoveryResponse=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.RunAssetDiscoveryResponse} RunAssetDiscoveryResponse instance + */ + RunAssetDiscoveryResponse.create = function create(properties) { + return new RunAssetDiscoveryResponse(properties); + }; + + /** + * Encodes the specified RunAssetDiscoveryResponse message. Does not implicitly {@link google.cloud.securitycenter.v1.RunAssetDiscoveryResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryResponse + * @static + * @param {google.cloud.securitycenter.v1.IRunAssetDiscoveryResponse} message RunAssetDiscoveryResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RunAssetDiscoveryResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.state); + if (message.duration != null && Object.hasOwnProperty.call(message, "duration")) + $root.google.protobuf.Duration.encode(message.duration, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RunAssetDiscoveryResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.RunAssetDiscoveryResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryResponse + * @static + * @param {google.cloud.securitycenter.v1.IRunAssetDiscoveryResponse} message RunAssetDiscoveryResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RunAssetDiscoveryResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RunAssetDiscoveryResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.RunAssetDiscoveryResponse} RunAssetDiscoveryResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RunAssetDiscoveryResponse.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.cloud.securitycenter.v1.RunAssetDiscoveryResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.state = reader.int32(); + break; + case 2: + message.duration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RunAssetDiscoveryResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.RunAssetDiscoveryResponse} RunAssetDiscoveryResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RunAssetDiscoveryResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RunAssetDiscoveryResponse message. + * @function verify + * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RunAssetDiscoveryResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.duration != null && message.hasOwnProperty("duration")) { + var error = $root.google.protobuf.Duration.verify(message.duration); + if (error) + return "duration." + error; + } + return null; + }; + + /** + * Creates a RunAssetDiscoveryResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.RunAssetDiscoveryResponse} RunAssetDiscoveryResponse + */ + RunAssetDiscoveryResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.RunAssetDiscoveryResponse) + return object; + var message = new $root.google.cloud.securitycenter.v1.RunAssetDiscoveryResponse(); + switch (object.state) { + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "COMPLETED": + case 1: + message.state = 1; + break; + case "SUPERSEDED": + case 2: + message.state = 2; + break; + case "TERMINATED": + case 3: + message.state = 3; + break; + } + if (object.duration != null) { + if (typeof object.duration !== "object") + throw TypeError(".google.cloud.securitycenter.v1.RunAssetDiscoveryResponse.duration: object expected"); + message.duration = $root.google.protobuf.Duration.fromObject(object.duration); + } + return message; + }; + + /** + * Creates a plain object from a RunAssetDiscoveryResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryResponse + * @static + * @param {google.cloud.securitycenter.v1.RunAssetDiscoveryResponse} message RunAssetDiscoveryResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RunAssetDiscoveryResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.duration = null; + } + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.securitycenter.v1.RunAssetDiscoveryResponse.State[message.state] : message.state; + if (message.duration != null && message.hasOwnProperty("duration")) + object.duration = $root.google.protobuf.Duration.toObject(message.duration, options); + return object; + }; + + /** + * Converts this RunAssetDiscoveryResponse to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryResponse + * @instance + * @returns {Object.} JSON object + */ + RunAssetDiscoveryResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * State enum. + * @name google.cloud.securitycenter.v1.RunAssetDiscoveryResponse.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} COMPLETED=1 COMPLETED value + * @property {number} SUPERSEDED=2 SUPERSEDED value + * @property {number} TERMINATED=3 TERMINATED value + */ + RunAssetDiscoveryResponse.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "COMPLETED"] = 1; + values[valuesById[2] = "SUPERSEDED"] = 2; + values[valuesById[3] = "TERMINATED"] = 3; + return values; + })(); + + return RunAssetDiscoveryResponse; + })(); + + v1.SecurityCenter = (function() { + + /** + * Constructs a new SecurityCenter service. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a SecurityCenter + * @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 SecurityCenter(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (SecurityCenter.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = SecurityCenter; + + /** + * Creates new SecurityCenter service using the specified rpc implementation. + * @function create + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @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 {SecurityCenter} RPC service. Useful where requests and/or responses are streamed. + */ + SecurityCenter.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#bulkMuteFindings}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef BulkMuteFindingsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls BulkMuteFindings. + * @function bulkMuteFindings + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IBulkMuteFindingsRequest} request BulkMuteFindingsRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.BulkMuteFindingsCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.bulkMuteFindings = function bulkMuteFindings(request, callback) { + return this.rpcCall(bulkMuteFindings, $root.google.cloud.securitycenter.v1.BulkMuteFindingsRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "BulkMuteFindings" }); + + /** + * Calls BulkMuteFindings. + * @function bulkMuteFindings + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IBulkMuteFindingsRequest} request BulkMuteFindingsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#createSource}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef CreateSourceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1.Source} [response] Source + */ + + /** + * Calls CreateSource. + * @function createSource + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.ICreateSourceRequest} request CreateSourceRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.CreateSourceCallback} callback Node-style callback called with the error, if any, and Source + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.createSource = function createSource(request, callback) { + return this.rpcCall(createSource, $root.google.cloud.securitycenter.v1.CreateSourceRequest, $root.google.cloud.securitycenter.v1.Source, request, callback); + }, "name", { value: "CreateSource" }); + + /** + * Calls CreateSource. + * @function createSource + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.ICreateSourceRequest} request CreateSourceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#createFinding}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef CreateFindingCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1.Finding} [response] Finding + */ + + /** + * Calls CreateFinding. + * @function createFinding + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.ICreateFindingRequest} request CreateFindingRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.CreateFindingCallback} callback Node-style callback called with the error, if any, and Finding + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.createFinding = function createFinding(request, callback) { + return this.rpcCall(createFinding, $root.google.cloud.securitycenter.v1.CreateFindingRequest, $root.google.cloud.securitycenter.v1.Finding, request, callback); + }, "name", { value: "CreateFinding" }); + + /** + * Calls CreateFinding. + * @function createFinding + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.ICreateFindingRequest} request CreateFindingRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#createMuteConfig}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef CreateMuteConfigCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1.MuteConfig} [response] MuteConfig + */ + + /** + * Calls CreateMuteConfig. + * @function createMuteConfig + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.ICreateMuteConfigRequest} request CreateMuteConfigRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.CreateMuteConfigCallback} callback Node-style callback called with the error, if any, and MuteConfig + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.createMuteConfig = function createMuteConfig(request, callback) { + return this.rpcCall(createMuteConfig, $root.google.cloud.securitycenter.v1.CreateMuteConfigRequest, $root.google.cloud.securitycenter.v1.MuteConfig, request, callback); + }, "name", { value: "CreateMuteConfig" }); + + /** + * Calls CreateMuteConfig. + * @function createMuteConfig + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.ICreateMuteConfigRequest} request CreateMuteConfigRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#createNotificationConfig}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef CreateNotificationConfigCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1.NotificationConfig} [response] NotificationConfig + */ + + /** + * Calls CreateNotificationConfig. + * @function createNotificationConfig + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.ICreateNotificationConfigRequest} request CreateNotificationConfigRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.CreateNotificationConfigCallback} callback Node-style callback called with the error, if any, and NotificationConfig + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.createNotificationConfig = function createNotificationConfig(request, callback) { + return this.rpcCall(createNotificationConfig, $root.google.cloud.securitycenter.v1.CreateNotificationConfigRequest, $root.google.cloud.securitycenter.v1.NotificationConfig, request, callback); + }, "name", { value: "CreateNotificationConfig" }); + + /** + * Calls CreateNotificationConfig. + * @function createNotificationConfig + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.ICreateNotificationConfigRequest} request CreateNotificationConfigRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#deleteMuteConfig}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef DeleteMuteConfigCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteMuteConfig. + * @function deleteMuteConfig + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IDeleteMuteConfigRequest} request DeleteMuteConfigRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.DeleteMuteConfigCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.deleteMuteConfig = function deleteMuteConfig(request, callback) { + return this.rpcCall(deleteMuteConfig, $root.google.cloud.securitycenter.v1.DeleteMuteConfigRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteMuteConfig" }); + + /** + * Calls DeleteMuteConfig. + * @function deleteMuteConfig + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IDeleteMuteConfigRequest} request DeleteMuteConfigRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#deleteNotificationConfig}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef DeleteNotificationConfigCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteNotificationConfig. + * @function deleteNotificationConfig + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IDeleteNotificationConfigRequest} request DeleteNotificationConfigRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.DeleteNotificationConfigCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.deleteNotificationConfig = function deleteNotificationConfig(request, callback) { + return this.rpcCall(deleteNotificationConfig, $root.google.cloud.securitycenter.v1.DeleteNotificationConfigRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteNotificationConfig" }); + + /** + * Calls DeleteNotificationConfig. + * @function deleteNotificationConfig + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IDeleteNotificationConfigRequest} request DeleteNotificationConfigRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#getIamPolicy}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef GetIamPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.iam.v1.Policy} [response] Policy + */ + + /** + * Calls GetIamPolicy. + * @function getIamPolicy + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.iam.v1.IGetIamPolicyRequest} request GetIamPolicyRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.GetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.getIamPolicy = function getIamPolicy(request, callback) { + return this.rpcCall(getIamPolicy, $root.google.iam.v1.GetIamPolicyRequest, $root.google.iam.v1.Policy, request, callback); + }, "name", { value: "GetIamPolicy" }); + + /** + * Calls GetIamPolicy. + * @function getIamPolicy + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.iam.v1.IGetIamPolicyRequest} request GetIamPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#getMuteConfig}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef GetMuteConfigCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1.MuteConfig} [response] MuteConfig + */ + + /** + * Calls GetMuteConfig. + * @function getMuteConfig + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IGetMuteConfigRequest} request GetMuteConfigRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.GetMuteConfigCallback} callback Node-style callback called with the error, if any, and MuteConfig + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.getMuteConfig = function getMuteConfig(request, callback) { + return this.rpcCall(getMuteConfig, $root.google.cloud.securitycenter.v1.GetMuteConfigRequest, $root.google.cloud.securitycenter.v1.MuteConfig, request, callback); + }, "name", { value: "GetMuteConfig" }); + + /** + * Calls GetMuteConfig. + * @function getMuteConfig + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IGetMuteConfigRequest} request GetMuteConfigRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#getNotificationConfig}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef GetNotificationConfigCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1.NotificationConfig} [response] NotificationConfig + */ + + /** + * Calls GetNotificationConfig. + * @function getNotificationConfig + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IGetNotificationConfigRequest} request GetNotificationConfigRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.GetNotificationConfigCallback} callback Node-style callback called with the error, if any, and NotificationConfig + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.getNotificationConfig = function getNotificationConfig(request, callback) { + return this.rpcCall(getNotificationConfig, $root.google.cloud.securitycenter.v1.GetNotificationConfigRequest, $root.google.cloud.securitycenter.v1.NotificationConfig, request, callback); + }, "name", { value: "GetNotificationConfig" }); + + /** + * Calls GetNotificationConfig. + * @function getNotificationConfig + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IGetNotificationConfigRequest} request GetNotificationConfigRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#getOrganizationSettings}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef GetOrganizationSettingsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1.OrganizationSettings} [response] OrganizationSettings + */ + + /** + * Calls GetOrganizationSettings. + * @function getOrganizationSettings + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IGetOrganizationSettingsRequest} request GetOrganizationSettingsRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.GetOrganizationSettingsCallback} callback Node-style callback called with the error, if any, and OrganizationSettings + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.getOrganizationSettings = function getOrganizationSettings(request, callback) { + return this.rpcCall(getOrganizationSettings, $root.google.cloud.securitycenter.v1.GetOrganizationSettingsRequest, $root.google.cloud.securitycenter.v1.OrganizationSettings, request, callback); + }, "name", { value: "GetOrganizationSettings" }); + + /** + * Calls GetOrganizationSettings. + * @function getOrganizationSettings + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IGetOrganizationSettingsRequest} request GetOrganizationSettingsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#getSource}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef GetSourceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1.Source} [response] Source + */ + + /** + * Calls GetSource. + * @function getSource + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IGetSourceRequest} request GetSourceRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.GetSourceCallback} callback Node-style callback called with the error, if any, and Source + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.getSource = function getSource(request, callback) { + return this.rpcCall(getSource, $root.google.cloud.securitycenter.v1.GetSourceRequest, $root.google.cloud.securitycenter.v1.Source, request, callback); + }, "name", { value: "GetSource" }); + + /** + * Calls GetSource. + * @function getSource + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IGetSourceRequest} request GetSourceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#groupAssets}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef GroupAssetsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1.GroupAssetsResponse} [response] GroupAssetsResponse + */ + + /** + * Calls GroupAssets. + * @function groupAssets + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IGroupAssetsRequest} request GroupAssetsRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.GroupAssetsCallback} callback Node-style callback called with the error, if any, and GroupAssetsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.groupAssets = function groupAssets(request, callback) { + return this.rpcCall(groupAssets, $root.google.cloud.securitycenter.v1.GroupAssetsRequest, $root.google.cloud.securitycenter.v1.GroupAssetsResponse, request, callback); + }, "name", { value: "GroupAssets" }); + + /** + * Calls GroupAssets. + * @function groupAssets + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IGroupAssetsRequest} request GroupAssetsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#groupFindings}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef GroupFindingsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1.GroupFindingsResponse} [response] GroupFindingsResponse + */ + + /** + * Calls GroupFindings. + * @function groupFindings + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IGroupFindingsRequest} request GroupFindingsRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.GroupFindingsCallback} callback Node-style callback called with the error, if any, and GroupFindingsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.groupFindings = function groupFindings(request, callback) { + return this.rpcCall(groupFindings, $root.google.cloud.securitycenter.v1.GroupFindingsRequest, $root.google.cloud.securitycenter.v1.GroupFindingsResponse, request, callback); + }, "name", { value: "GroupFindings" }); + + /** + * Calls GroupFindings. + * @function groupFindings + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IGroupFindingsRequest} request GroupFindingsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#listAssets}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef ListAssetsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1.ListAssetsResponse} [response] ListAssetsResponse + */ + + /** + * Calls ListAssets. + * @function listAssets + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IListAssetsRequest} request ListAssetsRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.ListAssetsCallback} callback Node-style callback called with the error, if any, and ListAssetsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.listAssets = function listAssets(request, callback) { + return this.rpcCall(listAssets, $root.google.cloud.securitycenter.v1.ListAssetsRequest, $root.google.cloud.securitycenter.v1.ListAssetsResponse, request, callback); + }, "name", { value: "ListAssets" }); + + /** + * Calls ListAssets. + * @function listAssets + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IListAssetsRequest} request ListAssetsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#listFindings}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef ListFindingsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1.ListFindingsResponse} [response] ListFindingsResponse + */ + + /** + * Calls ListFindings. + * @function listFindings + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IListFindingsRequest} request ListFindingsRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.ListFindingsCallback} callback Node-style callback called with the error, if any, and ListFindingsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.listFindings = function listFindings(request, callback) { + return this.rpcCall(listFindings, $root.google.cloud.securitycenter.v1.ListFindingsRequest, $root.google.cloud.securitycenter.v1.ListFindingsResponse, request, callback); + }, "name", { value: "ListFindings" }); + + /** + * Calls ListFindings. + * @function listFindings + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IListFindingsRequest} request ListFindingsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#listMuteConfigs}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef ListMuteConfigsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1.ListMuteConfigsResponse} [response] ListMuteConfigsResponse + */ + + /** + * Calls ListMuteConfigs. + * @function listMuteConfigs + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IListMuteConfigsRequest} request ListMuteConfigsRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.ListMuteConfigsCallback} callback Node-style callback called with the error, if any, and ListMuteConfigsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.listMuteConfigs = function listMuteConfigs(request, callback) { + return this.rpcCall(listMuteConfigs, $root.google.cloud.securitycenter.v1.ListMuteConfigsRequest, $root.google.cloud.securitycenter.v1.ListMuteConfigsResponse, request, callback); + }, "name", { value: "ListMuteConfigs" }); + + /** + * Calls ListMuteConfigs. + * @function listMuteConfigs + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IListMuteConfigsRequest} request ListMuteConfigsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#listNotificationConfigs}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef ListNotificationConfigsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1.ListNotificationConfigsResponse} [response] ListNotificationConfigsResponse + */ + + /** + * Calls ListNotificationConfigs. + * @function listNotificationConfigs + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IListNotificationConfigsRequest} request ListNotificationConfigsRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.ListNotificationConfigsCallback} callback Node-style callback called with the error, if any, and ListNotificationConfigsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.listNotificationConfigs = function listNotificationConfigs(request, callback) { + return this.rpcCall(listNotificationConfigs, $root.google.cloud.securitycenter.v1.ListNotificationConfigsRequest, $root.google.cloud.securitycenter.v1.ListNotificationConfigsResponse, request, callback); + }, "name", { value: "ListNotificationConfigs" }); + + /** + * Calls ListNotificationConfigs. + * @function listNotificationConfigs + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IListNotificationConfigsRequest} request ListNotificationConfigsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#listSources}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef ListSourcesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1.ListSourcesResponse} [response] ListSourcesResponse + */ + + /** + * Calls ListSources. + * @function listSources + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IListSourcesRequest} request ListSourcesRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.ListSourcesCallback} callback Node-style callback called with the error, if any, and ListSourcesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.listSources = function listSources(request, callback) { + return this.rpcCall(listSources, $root.google.cloud.securitycenter.v1.ListSourcesRequest, $root.google.cloud.securitycenter.v1.ListSourcesResponse, request, callback); + }, "name", { value: "ListSources" }); + + /** + * Calls ListSources. + * @function listSources + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IListSourcesRequest} request ListSourcesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#runAssetDiscovery}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef RunAssetDiscoveryCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls RunAssetDiscovery. + * @function runAssetDiscovery + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IRunAssetDiscoveryRequest} request RunAssetDiscoveryRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.RunAssetDiscoveryCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.runAssetDiscovery = function runAssetDiscovery(request, callback) { + return this.rpcCall(runAssetDiscovery, $root.google.cloud.securitycenter.v1.RunAssetDiscoveryRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "RunAssetDiscovery" }); + + /** + * Calls RunAssetDiscovery. + * @function runAssetDiscovery + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IRunAssetDiscoveryRequest} request RunAssetDiscoveryRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#setFindingState}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef SetFindingStateCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1.Finding} [response] Finding + */ + + /** + * Calls SetFindingState. + * @function setFindingState + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.ISetFindingStateRequest} request SetFindingStateRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.SetFindingStateCallback} callback Node-style callback called with the error, if any, and Finding + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.setFindingState = function setFindingState(request, callback) { + return this.rpcCall(setFindingState, $root.google.cloud.securitycenter.v1.SetFindingStateRequest, $root.google.cloud.securitycenter.v1.Finding, request, callback); + }, "name", { value: "SetFindingState" }); + + /** + * Calls SetFindingState. + * @function setFindingState + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.ISetFindingStateRequest} request SetFindingStateRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#setMute}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef SetMuteCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1.Finding} [response] Finding + */ + + /** + * Calls SetMute. + * @function setMute + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.ISetMuteRequest} request SetMuteRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.SetMuteCallback} callback Node-style callback called with the error, if any, and Finding + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.setMute = function setMute(request, callback) { + return this.rpcCall(setMute, $root.google.cloud.securitycenter.v1.SetMuteRequest, $root.google.cloud.securitycenter.v1.Finding, request, callback); + }, "name", { value: "SetMute" }); + + /** + * Calls SetMute. + * @function setMute + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.ISetMuteRequest} request SetMuteRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#setIamPolicy}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef SetIamPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.iam.v1.Policy} [response] Policy + */ + + /** + * Calls SetIamPolicy. + * @function setIamPolicy + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.iam.v1.ISetIamPolicyRequest} request SetIamPolicyRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.SetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.setIamPolicy = function setIamPolicy(request, callback) { + return this.rpcCall(setIamPolicy, $root.google.iam.v1.SetIamPolicyRequest, $root.google.iam.v1.Policy, request, callback); + }, "name", { value: "SetIamPolicy" }); + + /** + * Calls SetIamPolicy. + * @function setIamPolicy + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.iam.v1.ISetIamPolicyRequest} request SetIamPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#testIamPermissions}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef TestIamPermissionsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.iam.v1.TestIamPermissionsResponse} [response] TestIamPermissionsResponse + */ + + /** + * Calls TestIamPermissions. + * @function testIamPermissions + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.iam.v1.ITestIamPermissionsRequest} request TestIamPermissionsRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.TestIamPermissionsCallback} callback Node-style callback called with the error, if any, and TestIamPermissionsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.testIamPermissions = function testIamPermissions(request, callback) { + return this.rpcCall(testIamPermissions, $root.google.iam.v1.TestIamPermissionsRequest, $root.google.iam.v1.TestIamPermissionsResponse, request, callback); + }, "name", { value: "TestIamPermissions" }); + + /** + * Calls TestIamPermissions. + * @function testIamPermissions + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.iam.v1.ITestIamPermissionsRequest} request TestIamPermissionsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#updateFinding}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef UpdateFindingCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1.Finding} [response] Finding + */ + + /** + * Calls UpdateFinding. + * @function updateFinding + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IUpdateFindingRequest} request UpdateFindingRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.UpdateFindingCallback} callback Node-style callback called with the error, if any, and Finding + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.updateFinding = function updateFinding(request, callback) { + return this.rpcCall(updateFinding, $root.google.cloud.securitycenter.v1.UpdateFindingRequest, $root.google.cloud.securitycenter.v1.Finding, request, callback); + }, "name", { value: "UpdateFinding" }); + + /** + * Calls UpdateFinding. + * @function updateFinding + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IUpdateFindingRequest} request UpdateFindingRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#updateMuteConfig}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef UpdateMuteConfigCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1.MuteConfig} [response] MuteConfig + */ + + /** + * Calls UpdateMuteConfig. + * @function updateMuteConfig + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IUpdateMuteConfigRequest} request UpdateMuteConfigRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.UpdateMuteConfigCallback} callback Node-style callback called with the error, if any, and MuteConfig + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.updateMuteConfig = function updateMuteConfig(request, callback) { + return this.rpcCall(updateMuteConfig, $root.google.cloud.securitycenter.v1.UpdateMuteConfigRequest, $root.google.cloud.securitycenter.v1.MuteConfig, request, callback); + }, "name", { value: "UpdateMuteConfig" }); + + /** + * Calls UpdateMuteConfig. + * @function updateMuteConfig + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IUpdateMuteConfigRequest} request UpdateMuteConfigRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#updateNotificationConfig}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef UpdateNotificationConfigCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1.NotificationConfig} [response] NotificationConfig + */ + + /** + * Calls UpdateNotificationConfig. + * @function updateNotificationConfig + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IUpdateNotificationConfigRequest} request UpdateNotificationConfigRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.UpdateNotificationConfigCallback} callback Node-style callback called with the error, if any, and NotificationConfig + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.updateNotificationConfig = function updateNotificationConfig(request, callback) { + return this.rpcCall(updateNotificationConfig, $root.google.cloud.securitycenter.v1.UpdateNotificationConfigRequest, $root.google.cloud.securitycenter.v1.NotificationConfig, request, callback); + }, "name", { value: "UpdateNotificationConfig" }); + + /** + * Calls UpdateNotificationConfig. + * @function updateNotificationConfig + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IUpdateNotificationConfigRequest} request UpdateNotificationConfigRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#updateOrganizationSettings}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef UpdateOrganizationSettingsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1.OrganizationSettings} [response] OrganizationSettings + */ + + /** + * Calls UpdateOrganizationSettings. + * @function updateOrganizationSettings + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IUpdateOrganizationSettingsRequest} request UpdateOrganizationSettingsRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.UpdateOrganizationSettingsCallback} callback Node-style callback called with the error, if any, and OrganizationSettings + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.updateOrganizationSettings = function updateOrganizationSettings(request, callback) { + return this.rpcCall(updateOrganizationSettings, $root.google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest, $root.google.cloud.securitycenter.v1.OrganizationSettings, request, callback); + }, "name", { value: "UpdateOrganizationSettings" }); + + /** + * Calls UpdateOrganizationSettings. + * @function updateOrganizationSettings + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IUpdateOrganizationSettingsRequest} request UpdateOrganizationSettingsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#updateSource}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef UpdateSourceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1.Source} [response] Source + */ + + /** + * Calls UpdateSource. + * @function updateSource + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IUpdateSourceRequest} request UpdateSourceRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.UpdateSourceCallback} callback Node-style callback called with the error, if any, and Source + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.updateSource = function updateSource(request, callback) { + return this.rpcCall(updateSource, $root.google.cloud.securitycenter.v1.UpdateSourceRequest, $root.google.cloud.securitycenter.v1.Source, request, callback); + }, "name", { value: "UpdateSource" }); + + /** + * Calls UpdateSource. + * @function updateSource + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IUpdateSourceRequest} request UpdateSourceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ - /** - * InclusionMode enum. - * @name google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode - * @enum {number} - * @property {number} INCLUSION_MODE_UNSPECIFIED=0 INCLUSION_MODE_UNSPECIFIED value - * @property {number} INCLUDE_ONLY=1 INCLUDE_ONLY value - * @property {number} EXCLUDE=2 EXCLUDE value - */ - AssetDiscoveryConfig.InclusionMode = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "INCLUSION_MODE_UNSPECIFIED"] = 0; - values[valuesById[1] = "INCLUDE_ONLY"] = 1; - values[valuesById[2] = "EXCLUDE"] = 2; - return values; - })(); + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#updateSecurityMarks}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef UpdateSecurityMarksCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1.SecurityMarks} [response] SecurityMarks + */ - return AssetDiscoveryConfig; - })(); + /** + * Calls UpdateSecurityMarks. + * @function updateSecurityMarks + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IUpdateSecurityMarksRequest} request UpdateSecurityMarksRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.UpdateSecurityMarksCallback} callback Node-style callback called with the error, if any, and SecurityMarks + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.updateSecurityMarks = function updateSecurityMarks(request, callback) { + return this.rpcCall(updateSecurityMarks, $root.google.cloud.securitycenter.v1.UpdateSecurityMarksRequest, $root.google.cloud.securitycenter.v1.SecurityMarks, request, callback); + }, "name", { value: "UpdateSecurityMarks" }); - return OrganizationSettings; + /** + * Calls UpdateSecurityMarks. + * @function updateSecurityMarks + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IUpdateSecurityMarksRequest} request UpdateSecurityMarksRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return SecurityCenter; })(); - v1.RunAssetDiscoveryResponse = (function() { + v1.BulkMuteFindingsRequest = (function() { /** - * Properties of a RunAssetDiscoveryResponse. + * Properties of a BulkMuteFindingsRequest. * @memberof google.cloud.securitycenter.v1 - * @interface IRunAssetDiscoveryResponse - * @property {google.cloud.securitycenter.v1.RunAssetDiscoveryResponse.State|null} [state] RunAssetDiscoveryResponse state - * @property {google.protobuf.IDuration|null} [duration] RunAssetDiscoveryResponse duration + * @interface IBulkMuteFindingsRequest + * @property {string|null} [parent] BulkMuteFindingsRequest parent + * @property {string|null} [filter] BulkMuteFindingsRequest filter + * @property {string|null} [muteAnnotation] BulkMuteFindingsRequest muteAnnotation */ /** - * Constructs a new RunAssetDiscoveryResponse. + * Constructs a new BulkMuteFindingsRequest. * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents a RunAssetDiscoveryResponse. - * @implements IRunAssetDiscoveryResponse + * @classdesc Represents a BulkMuteFindingsRequest. + * @implements IBulkMuteFindingsRequest * @constructor - * @param {google.cloud.securitycenter.v1.IRunAssetDiscoveryResponse=} [properties] Properties to set + * @param {google.cloud.securitycenter.v1.IBulkMuteFindingsRequest=} [properties] Properties to set */ - function RunAssetDiscoveryResponse(properties) { + function BulkMuteFindingsRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -5459,89 +7183,292 @@ } /** - * RunAssetDiscoveryResponse state. - * @member {google.cloud.securitycenter.v1.RunAssetDiscoveryResponse.State} state - * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryResponse + * BulkMuteFindingsRequest parent. + * @member {string} parent + * @memberof google.cloud.securitycenter.v1.BulkMuteFindingsRequest * @instance */ - RunAssetDiscoveryResponse.prototype.state = 0; + BulkMuteFindingsRequest.prototype.parent = ""; /** - * RunAssetDiscoveryResponse duration. - * @member {google.protobuf.IDuration|null|undefined} duration - * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryResponse + * BulkMuteFindingsRequest filter. + * @member {string} filter + * @memberof google.cloud.securitycenter.v1.BulkMuteFindingsRequest * @instance */ - RunAssetDiscoveryResponse.prototype.duration = null; + BulkMuteFindingsRequest.prototype.filter = ""; /** - * Creates a new RunAssetDiscoveryResponse instance using the specified properties. + * BulkMuteFindingsRequest muteAnnotation. + * @member {string} muteAnnotation + * @memberof google.cloud.securitycenter.v1.BulkMuteFindingsRequest + * @instance + */ + BulkMuteFindingsRequest.prototype.muteAnnotation = ""; + + /** + * Creates a new BulkMuteFindingsRequest instance using the specified properties. * @function create - * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryResponse + * @memberof google.cloud.securitycenter.v1.BulkMuteFindingsRequest * @static - * @param {google.cloud.securitycenter.v1.IRunAssetDiscoveryResponse=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.RunAssetDiscoveryResponse} RunAssetDiscoveryResponse instance + * @param {google.cloud.securitycenter.v1.IBulkMuteFindingsRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.BulkMuteFindingsRequest} BulkMuteFindingsRequest instance */ - RunAssetDiscoveryResponse.create = function create(properties) { - return new RunAssetDiscoveryResponse(properties); + BulkMuteFindingsRequest.create = function create(properties) { + return new BulkMuteFindingsRequest(properties); }; /** - * Encodes the specified RunAssetDiscoveryResponse message. Does not implicitly {@link google.cloud.securitycenter.v1.RunAssetDiscoveryResponse.verify|verify} messages. + * Encodes the specified BulkMuteFindingsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.BulkMuteFindingsRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryResponse + * @memberof google.cloud.securitycenter.v1.BulkMuteFindingsRequest * @static - * @param {google.cloud.securitycenter.v1.IRunAssetDiscoveryResponse} message RunAssetDiscoveryResponse message or plain object to encode + * @param {google.cloud.securitycenter.v1.IBulkMuteFindingsRequest} message BulkMuteFindingsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - RunAssetDiscoveryResponse.encode = function encode(message, writer) { + BulkMuteFindingsRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.state != null && Object.hasOwnProperty.call(message, "state")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.state); - if (message.duration != null && Object.hasOwnProperty.call(message, "duration")) - $root.google.protobuf.Duration.encode(message.duration, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); + if (message.muteAnnotation != null && Object.hasOwnProperty.call(message, "muteAnnotation")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.muteAnnotation); return writer; }; /** - * Encodes the specified RunAssetDiscoveryResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.RunAssetDiscoveryResponse.verify|verify} messages. + * Encodes the specified BulkMuteFindingsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.BulkMuteFindingsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.BulkMuteFindingsRequest + * @static + * @param {google.cloud.securitycenter.v1.IBulkMuteFindingsRequest} message BulkMuteFindingsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BulkMuteFindingsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BulkMuteFindingsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.BulkMuteFindingsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.BulkMuteFindingsRequest} BulkMuteFindingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BulkMuteFindingsRequest.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.cloud.securitycenter.v1.BulkMuteFindingsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.filter = reader.string(); + break; + case 3: + message.muteAnnotation = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BulkMuteFindingsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.BulkMuteFindingsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.BulkMuteFindingsRequest} BulkMuteFindingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BulkMuteFindingsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BulkMuteFindingsRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1.BulkMuteFindingsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BulkMuteFindingsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.muteAnnotation != null && message.hasOwnProperty("muteAnnotation")) + if (!$util.isString(message.muteAnnotation)) + return "muteAnnotation: string expected"; + return null; + }; + + /** + * Creates a BulkMuteFindingsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.BulkMuteFindingsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.BulkMuteFindingsRequest} BulkMuteFindingsRequest + */ + BulkMuteFindingsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.BulkMuteFindingsRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1.BulkMuteFindingsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.filter != null) + message.filter = String(object.filter); + if (object.muteAnnotation != null) + message.muteAnnotation = String(object.muteAnnotation); + return message; + }; + + /** + * Creates a plain object from a BulkMuteFindingsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.BulkMuteFindingsRequest + * @static + * @param {google.cloud.securitycenter.v1.BulkMuteFindingsRequest} message BulkMuteFindingsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BulkMuteFindingsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.filter = ""; + object.muteAnnotation = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.muteAnnotation != null && message.hasOwnProperty("muteAnnotation")) + object.muteAnnotation = message.muteAnnotation; + return object; + }; + + /** + * Converts this BulkMuteFindingsRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.BulkMuteFindingsRequest + * @instance + * @returns {Object.} JSON object + */ + BulkMuteFindingsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return BulkMuteFindingsRequest; + })(); + + v1.BulkMuteFindingsResponse = (function() { + + /** + * Properties of a BulkMuteFindingsResponse. + * @memberof google.cloud.securitycenter.v1 + * @interface IBulkMuteFindingsResponse + */ + + /** + * Constructs a new BulkMuteFindingsResponse. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a BulkMuteFindingsResponse. + * @implements IBulkMuteFindingsResponse + * @constructor + * @param {google.cloud.securitycenter.v1.IBulkMuteFindingsResponse=} [properties] Properties to set + */ + function BulkMuteFindingsResponse(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]]; + } + + /** + * Creates a new BulkMuteFindingsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.BulkMuteFindingsResponse + * @static + * @param {google.cloud.securitycenter.v1.IBulkMuteFindingsResponse=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.BulkMuteFindingsResponse} BulkMuteFindingsResponse instance + */ + BulkMuteFindingsResponse.create = function create(properties) { + return new BulkMuteFindingsResponse(properties); + }; + + /** + * Encodes the specified BulkMuteFindingsResponse message. Does not implicitly {@link google.cloud.securitycenter.v1.BulkMuteFindingsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.BulkMuteFindingsResponse + * @static + * @param {google.cloud.securitycenter.v1.IBulkMuteFindingsResponse} message BulkMuteFindingsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BulkMuteFindingsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified BulkMuteFindingsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.BulkMuteFindingsResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryResponse + * @memberof google.cloud.securitycenter.v1.BulkMuteFindingsResponse * @static - * @param {google.cloud.securitycenter.v1.IRunAssetDiscoveryResponse} message RunAssetDiscoveryResponse message or plain object to encode + * @param {google.cloud.securitycenter.v1.IBulkMuteFindingsResponse} message BulkMuteFindingsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - RunAssetDiscoveryResponse.encodeDelimited = function encodeDelimited(message, writer) { + BulkMuteFindingsResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a RunAssetDiscoveryResponse message from the specified reader or buffer. + * Decodes a BulkMuteFindingsResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryResponse + * @memberof google.cloud.securitycenter.v1.BulkMuteFindingsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.RunAssetDiscoveryResponse} RunAssetDiscoveryResponse + * @returns {google.cloud.securitycenter.v1.BulkMuteFindingsResponse} BulkMuteFindingsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - RunAssetDiscoveryResponse.decode = function decode(reader, length) { + BulkMuteFindingsResponse.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.cloud.securitycenter.v1.RunAssetDiscoveryResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.BulkMuteFindingsResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.state = reader.int32(); - break; - case 2: - message.duration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; default: reader.skipType(tag & 7); break; @@ -5551,958 +7478,1207 @@ }; /** - * Decodes a RunAssetDiscoveryResponse message from the specified reader or buffer, length delimited. + * Decodes a BulkMuteFindingsResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryResponse + * @memberof google.cloud.securitycenter.v1.BulkMuteFindingsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.RunAssetDiscoveryResponse} RunAssetDiscoveryResponse + * @returns {google.cloud.securitycenter.v1.BulkMuteFindingsResponse} BulkMuteFindingsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - RunAssetDiscoveryResponse.decodeDelimited = function decodeDelimited(reader) { + BulkMuteFindingsResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a RunAssetDiscoveryResponse message. + * Verifies a BulkMuteFindingsResponse message. * @function verify - * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryResponse + * @memberof google.cloud.securitycenter.v1.BulkMuteFindingsResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - RunAssetDiscoveryResponse.verify = function verify(message) { + BulkMuteFindingsResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.state != null && message.hasOwnProperty("state")) - switch (message.state) { - default: - return "state: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.duration != null && message.hasOwnProperty("duration")) { - var error = $root.google.protobuf.Duration.verify(message.duration); - if (error) - return "duration." + error; - } return null; }; /** - * Creates a RunAssetDiscoveryResponse message from a plain object. Also converts values to their respective internal types. + * Creates a BulkMuteFindingsResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryResponse + * @memberof google.cloud.securitycenter.v1.BulkMuteFindingsResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.RunAssetDiscoveryResponse} RunAssetDiscoveryResponse + * @returns {google.cloud.securitycenter.v1.BulkMuteFindingsResponse} BulkMuteFindingsResponse */ - RunAssetDiscoveryResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.RunAssetDiscoveryResponse) + BulkMuteFindingsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.BulkMuteFindingsResponse) return object; - var message = new $root.google.cloud.securitycenter.v1.RunAssetDiscoveryResponse(); - switch (object.state) { - case "STATE_UNSPECIFIED": - case 0: - message.state = 0; - break; - case "COMPLETED": - case 1: - message.state = 1; - break; - case "SUPERSEDED": - case 2: - message.state = 2; - break; - case "TERMINATED": - case 3: - message.state = 3; - break; - } - if (object.duration != null) { - if (typeof object.duration !== "object") - throw TypeError(".google.cloud.securitycenter.v1.RunAssetDiscoveryResponse.duration: object expected"); - message.duration = $root.google.protobuf.Duration.fromObject(object.duration); - } - return message; + return new $root.google.cloud.securitycenter.v1.BulkMuteFindingsResponse(); }; /** - * Creates a plain object from a RunAssetDiscoveryResponse message. Also converts values to other types if specified. + * Creates a plain object from a BulkMuteFindingsResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryResponse + * @memberof google.cloud.securitycenter.v1.BulkMuteFindingsResponse * @static - * @param {google.cloud.securitycenter.v1.RunAssetDiscoveryResponse} message RunAssetDiscoveryResponse + * @param {google.cloud.securitycenter.v1.BulkMuteFindingsResponse} message BulkMuteFindingsResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - RunAssetDiscoveryResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; - object.duration = null; - } - if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.securitycenter.v1.RunAssetDiscoveryResponse.State[message.state] : message.state; - if (message.duration != null && message.hasOwnProperty("duration")) - object.duration = $root.google.protobuf.Duration.toObject(message.duration, options); - return object; + BulkMuteFindingsResponse.toObject = function toObject() { + return {}; }; /** - * Converts this RunAssetDiscoveryResponse to JSON. + * Converts this BulkMuteFindingsResponse to JSON. * @function toJSON - * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryResponse + * @memberof google.cloud.securitycenter.v1.BulkMuteFindingsResponse * @instance * @returns {Object.} JSON object */ - RunAssetDiscoveryResponse.prototype.toJSON = function toJSON() { + BulkMuteFindingsResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - /** - * State enum. - * @name google.cloud.securitycenter.v1.RunAssetDiscoveryResponse.State - * @enum {number} - * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value - * @property {number} COMPLETED=1 COMPLETED value - * @property {number} SUPERSEDED=2 SUPERSEDED value - * @property {number} TERMINATED=3 TERMINATED value - */ - RunAssetDiscoveryResponse.State = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; - values[valuesById[1] = "COMPLETED"] = 1; - values[valuesById[2] = "SUPERSEDED"] = 2; - values[valuesById[3] = "TERMINATED"] = 3; - return values; - })(); - - return RunAssetDiscoveryResponse; + return BulkMuteFindingsResponse; })(); - v1.SecurityCenter = (function() { + v1.CreateFindingRequest = (function() { /** - * Constructs a new SecurityCenter service. + * Properties of a CreateFindingRequest. * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents a SecurityCenter - * @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 SecurityCenter(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (SecurityCenter.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = SecurityCenter; - - /** - * Creates new SecurityCenter service using the specified rpc implementation. - * @function create - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @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 {SecurityCenter} RPC service. Useful where requests and/or responses are streamed. - */ - SecurityCenter.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; - - /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#createSource}. - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @typedef CreateSourceCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.securitycenter.v1.Source} [response] Source + * @interface ICreateFindingRequest + * @property {string|null} [parent] CreateFindingRequest parent + * @property {string|null} [findingId] CreateFindingRequest findingId + * @property {google.cloud.securitycenter.v1.IFinding|null} [finding] CreateFindingRequest finding */ /** - * Calls CreateSource. - * @function createSource - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1.ICreateSourceRequest} request CreateSourceRequest message or plain object - * @param {google.cloud.securitycenter.v1.SecurityCenter.CreateSourceCallback} callback Node-style callback called with the error, if any, and Source - * @returns {undefined} - * @variation 1 + * Constructs a new CreateFindingRequest. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a CreateFindingRequest. + * @implements ICreateFindingRequest + * @constructor + * @param {google.cloud.securitycenter.v1.ICreateFindingRequest=} [properties] Properties to set */ - Object.defineProperty(SecurityCenter.prototype.createSource = function createSource(request, callback) { - return this.rpcCall(createSource, $root.google.cloud.securitycenter.v1.CreateSourceRequest, $root.google.cloud.securitycenter.v1.Source, request, callback); - }, "name", { value: "CreateSource" }); + function CreateFindingRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } /** - * Calls CreateSource. - * @function createSource - * @memberof google.cloud.securitycenter.v1.SecurityCenter + * CreateFindingRequest parent. + * @member {string} parent + * @memberof google.cloud.securitycenter.v1.CreateFindingRequest * @instance - * @param {google.cloud.securitycenter.v1.ICreateSourceRequest} request CreateSourceRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#createFinding}. - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @typedef CreateFindingCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.securitycenter.v1.Finding} [response] Finding */ + CreateFindingRequest.prototype.parent = ""; /** - * Calls CreateFinding. - * @function createFinding - * @memberof google.cloud.securitycenter.v1.SecurityCenter + * CreateFindingRequest findingId. + * @member {string} findingId + * @memberof google.cloud.securitycenter.v1.CreateFindingRequest * @instance - * @param {google.cloud.securitycenter.v1.ICreateFindingRequest} request CreateFindingRequest message or plain object - * @param {google.cloud.securitycenter.v1.SecurityCenter.CreateFindingCallback} callback Node-style callback called with the error, if any, and Finding - * @returns {undefined} - * @variation 1 */ - Object.defineProperty(SecurityCenter.prototype.createFinding = function createFinding(request, callback) { - return this.rpcCall(createFinding, $root.google.cloud.securitycenter.v1.CreateFindingRequest, $root.google.cloud.securitycenter.v1.Finding, request, callback); - }, "name", { value: "CreateFinding" }); + CreateFindingRequest.prototype.findingId = ""; /** - * Calls CreateFinding. - * @function createFinding - * @memberof google.cloud.securitycenter.v1.SecurityCenter + * CreateFindingRequest finding. + * @member {google.cloud.securitycenter.v1.IFinding|null|undefined} finding + * @memberof google.cloud.securitycenter.v1.CreateFindingRequest * @instance - * @param {google.cloud.securitycenter.v1.ICreateFindingRequest} request CreateFindingRequest message or plain object - * @returns {Promise} Promise - * @variation 2 */ + CreateFindingRequest.prototype.finding = null; /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#createNotificationConfig}. - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @typedef CreateNotificationConfigCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.securitycenter.v1.NotificationConfig} [response] NotificationConfig + * Creates a new CreateFindingRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.CreateFindingRequest + * @static + * @param {google.cloud.securitycenter.v1.ICreateFindingRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.CreateFindingRequest} CreateFindingRequest instance */ + CreateFindingRequest.create = function create(properties) { + return new CreateFindingRequest(properties); + }; /** - * Calls CreateNotificationConfig. - * @function createNotificationConfig - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1.ICreateNotificationConfigRequest} request CreateNotificationConfigRequest message or plain object - * @param {google.cloud.securitycenter.v1.SecurityCenter.CreateNotificationConfigCallback} callback Node-style callback called with the error, if any, and NotificationConfig - * @returns {undefined} - * @variation 1 + * Encodes the specified CreateFindingRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.CreateFindingRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.CreateFindingRequest + * @static + * @param {google.cloud.securitycenter.v1.ICreateFindingRequest} message CreateFindingRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - Object.defineProperty(SecurityCenter.prototype.createNotificationConfig = function createNotificationConfig(request, callback) { - return this.rpcCall(createNotificationConfig, $root.google.cloud.securitycenter.v1.CreateNotificationConfigRequest, $root.google.cloud.securitycenter.v1.NotificationConfig, request, callback); - }, "name", { value: "CreateNotificationConfig" }); + CreateFindingRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.findingId != null && Object.hasOwnProperty.call(message, "findingId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.findingId); + if (message.finding != null && Object.hasOwnProperty.call(message, "finding")) + $root.google.cloud.securitycenter.v1.Finding.encode(message.finding, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; /** - * Calls CreateNotificationConfig. - * @function createNotificationConfig - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1.ICreateNotificationConfigRequest} request CreateNotificationConfigRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Encodes the specified CreateFindingRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.CreateFindingRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.CreateFindingRequest + * @static + * @param {google.cloud.securitycenter.v1.ICreateFindingRequest} message CreateFindingRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ + CreateFindingRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#deleteNotificationConfig}. - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @typedef DeleteNotificationConfigCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.protobuf.Empty} [response] Empty + * Decodes a CreateFindingRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.CreateFindingRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.CreateFindingRequest} CreateFindingRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ + CreateFindingRequest.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.cloud.securitycenter.v1.CreateFindingRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.findingId = reader.string(); + break; + case 3: + message.finding = $root.google.cloud.securitycenter.v1.Finding.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; /** - * Calls DeleteNotificationConfig. - * @function deleteNotificationConfig - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1.IDeleteNotificationConfigRequest} request DeleteNotificationConfigRequest message or plain object - * @param {google.cloud.securitycenter.v1.SecurityCenter.DeleteNotificationConfigCallback} callback Node-style callback called with the error, if any, and Empty - * @returns {undefined} - * @variation 1 + * Decodes a CreateFindingRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.CreateFindingRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.CreateFindingRequest} CreateFindingRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Object.defineProperty(SecurityCenter.prototype.deleteNotificationConfig = function deleteNotificationConfig(request, callback) { - return this.rpcCall(deleteNotificationConfig, $root.google.cloud.securitycenter.v1.DeleteNotificationConfigRequest, $root.google.protobuf.Empty, request, callback); - }, "name", { value: "DeleteNotificationConfig" }); + CreateFindingRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; /** - * Calls DeleteNotificationConfig. - * @function deleteNotificationConfig - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1.IDeleteNotificationConfigRequest} request DeleteNotificationConfigRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Verifies a CreateFindingRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1.CreateFindingRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not */ + CreateFindingRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.findingId != null && message.hasOwnProperty("findingId")) + if (!$util.isString(message.findingId)) + return "findingId: string expected"; + if (message.finding != null && message.hasOwnProperty("finding")) { + var error = $root.google.cloud.securitycenter.v1.Finding.verify(message.finding); + if (error) + return "finding." + error; + } + return null; + }; /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#getIamPolicy}. - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @typedef GetIamPolicyCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.iam.v1.Policy} [response] Policy + * Creates a CreateFindingRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.CreateFindingRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.CreateFindingRequest} CreateFindingRequest */ + CreateFindingRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.CreateFindingRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1.CreateFindingRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.findingId != null) + message.findingId = String(object.findingId); + if (object.finding != null) { + if (typeof object.finding !== "object") + throw TypeError(".google.cloud.securitycenter.v1.CreateFindingRequest.finding: object expected"); + message.finding = $root.google.cloud.securitycenter.v1.Finding.fromObject(object.finding); + } + return message; + }; /** - * Calls GetIamPolicy. - * @function getIamPolicy - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @instance - * @param {google.iam.v1.IGetIamPolicyRequest} request GetIamPolicyRequest message or plain object - * @param {google.cloud.securitycenter.v1.SecurityCenter.GetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy - * @returns {undefined} - * @variation 1 + * Creates a plain object from a CreateFindingRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.CreateFindingRequest + * @static + * @param {google.cloud.securitycenter.v1.CreateFindingRequest} message CreateFindingRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object */ - Object.defineProperty(SecurityCenter.prototype.getIamPolicy = function getIamPolicy(request, callback) { - return this.rpcCall(getIamPolicy, $root.google.iam.v1.GetIamPolicyRequest, $root.google.iam.v1.Policy, request, callback); - }, "name", { value: "GetIamPolicy" }); + CreateFindingRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.findingId = ""; + object.finding = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.findingId != null && message.hasOwnProperty("findingId")) + object.findingId = message.findingId; + if (message.finding != null && message.hasOwnProperty("finding")) + object.finding = $root.google.cloud.securitycenter.v1.Finding.toObject(message.finding, options); + return object; + }; /** - * Calls GetIamPolicy. - * @function getIamPolicy - * @memberof google.cloud.securitycenter.v1.SecurityCenter + * Converts this CreateFindingRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.CreateFindingRequest * @instance - * @param {google.iam.v1.IGetIamPolicyRequest} request GetIamPolicyRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * @returns {Object.} JSON object */ + CreateFindingRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return CreateFindingRequest; + })(); + + v1.CreateMuteConfigRequest = (function() { /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#getNotificationConfig}. - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @typedef GetNotificationConfigCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.securitycenter.v1.NotificationConfig} [response] NotificationConfig + * Properties of a CreateMuteConfigRequest. + * @memberof google.cloud.securitycenter.v1 + * @interface ICreateMuteConfigRequest + * @property {string|null} [parent] CreateMuteConfigRequest parent + * @property {google.cloud.securitycenter.v1.IMuteConfig|null} [muteConfig] CreateMuteConfigRequest muteConfig + * @property {string|null} [muteConfigId] CreateMuteConfigRequest muteConfigId */ /** - * Calls GetNotificationConfig. - * @function getNotificationConfig - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1.IGetNotificationConfigRequest} request GetNotificationConfigRequest message or plain object - * @param {google.cloud.securitycenter.v1.SecurityCenter.GetNotificationConfigCallback} callback Node-style callback called with the error, if any, and NotificationConfig - * @returns {undefined} - * @variation 1 + * Constructs a new CreateMuteConfigRequest. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a CreateMuteConfigRequest. + * @implements ICreateMuteConfigRequest + * @constructor + * @param {google.cloud.securitycenter.v1.ICreateMuteConfigRequest=} [properties] Properties to set */ - Object.defineProperty(SecurityCenter.prototype.getNotificationConfig = function getNotificationConfig(request, callback) { - return this.rpcCall(getNotificationConfig, $root.google.cloud.securitycenter.v1.GetNotificationConfigRequest, $root.google.cloud.securitycenter.v1.NotificationConfig, request, callback); - }, "name", { value: "GetNotificationConfig" }); + function CreateMuteConfigRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } /** - * Calls GetNotificationConfig. - * @function getNotificationConfig - * @memberof google.cloud.securitycenter.v1.SecurityCenter + * CreateMuteConfigRequest parent. + * @member {string} parent + * @memberof google.cloud.securitycenter.v1.CreateMuteConfigRequest * @instance - * @param {google.cloud.securitycenter.v1.IGetNotificationConfigRequest} request GetNotificationConfigRequest message or plain object - * @returns {Promise} Promise - * @variation 2 */ + CreateMuteConfigRequest.prototype.parent = ""; /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#getOrganizationSettings}. - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @typedef GetOrganizationSettingsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.securitycenter.v1.OrganizationSettings} [response] OrganizationSettings + * CreateMuteConfigRequest muteConfig. + * @member {google.cloud.securitycenter.v1.IMuteConfig|null|undefined} muteConfig + * @memberof google.cloud.securitycenter.v1.CreateMuteConfigRequest + * @instance */ + CreateMuteConfigRequest.prototype.muteConfig = null; /** - * Calls GetOrganizationSettings. - * @function getOrganizationSettings - * @memberof google.cloud.securitycenter.v1.SecurityCenter + * CreateMuteConfigRequest muteConfigId. + * @member {string} muteConfigId + * @memberof google.cloud.securitycenter.v1.CreateMuteConfigRequest * @instance - * @param {google.cloud.securitycenter.v1.IGetOrganizationSettingsRequest} request GetOrganizationSettingsRequest message or plain object - * @param {google.cloud.securitycenter.v1.SecurityCenter.GetOrganizationSettingsCallback} callback Node-style callback called with the error, if any, and OrganizationSettings - * @returns {undefined} - * @variation 1 */ - Object.defineProperty(SecurityCenter.prototype.getOrganizationSettings = function getOrganizationSettings(request, callback) { - return this.rpcCall(getOrganizationSettings, $root.google.cloud.securitycenter.v1.GetOrganizationSettingsRequest, $root.google.cloud.securitycenter.v1.OrganizationSettings, request, callback); - }, "name", { value: "GetOrganizationSettings" }); + CreateMuteConfigRequest.prototype.muteConfigId = ""; /** - * Calls GetOrganizationSettings. - * @function getOrganizationSettings - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1.IGetOrganizationSettingsRequest} request GetOrganizationSettingsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Creates a new CreateMuteConfigRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.CreateMuteConfigRequest + * @static + * @param {google.cloud.securitycenter.v1.ICreateMuteConfigRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.CreateMuteConfigRequest} CreateMuteConfigRequest instance */ + CreateMuteConfigRequest.create = function create(properties) { + return new CreateMuteConfigRequest(properties); + }; /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#getSource}. - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @typedef GetSourceCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.securitycenter.v1.Source} [response] Source + * Encodes the specified CreateMuteConfigRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.CreateMuteConfigRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.CreateMuteConfigRequest + * @static + * @param {google.cloud.securitycenter.v1.ICreateMuteConfigRequest} message CreateMuteConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ + CreateMuteConfigRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.muteConfig != null && Object.hasOwnProperty.call(message, "muteConfig")) + $root.google.cloud.securitycenter.v1.MuteConfig.encode(message.muteConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.muteConfigId != null && Object.hasOwnProperty.call(message, "muteConfigId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.muteConfigId); + return writer; + }; /** - * Calls GetSource. - * @function getSource - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1.IGetSourceRequest} request GetSourceRequest message or plain object - * @param {google.cloud.securitycenter.v1.SecurityCenter.GetSourceCallback} callback Node-style callback called with the error, if any, and Source - * @returns {undefined} - * @variation 1 + * Encodes the specified CreateMuteConfigRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.CreateMuteConfigRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.CreateMuteConfigRequest + * @static + * @param {google.cloud.securitycenter.v1.ICreateMuteConfigRequest} message CreateMuteConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - Object.defineProperty(SecurityCenter.prototype.getSource = function getSource(request, callback) { - return this.rpcCall(getSource, $root.google.cloud.securitycenter.v1.GetSourceRequest, $root.google.cloud.securitycenter.v1.Source, request, callback); - }, "name", { value: "GetSource" }); + CreateMuteConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; /** - * Calls GetSource. - * @function getSource - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1.IGetSourceRequest} request GetSourceRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Decodes a CreateMuteConfigRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.CreateMuteConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.CreateMuteConfigRequest} CreateMuteConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ + CreateMuteConfigRequest.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.cloud.securitycenter.v1.CreateMuteConfigRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.muteConfig = $root.google.cloud.securitycenter.v1.MuteConfig.decode(reader, reader.uint32()); + break; + case 3: + message.muteConfigId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#groupAssets}. - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @typedef GroupAssetsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.securitycenter.v1.GroupAssetsResponse} [response] GroupAssetsResponse + * Decodes a CreateMuteConfigRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.CreateMuteConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.CreateMuteConfigRequest} CreateMuteConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ + CreateMuteConfigRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; /** - * Calls GroupAssets. - * @function groupAssets - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1.IGroupAssetsRequest} request GroupAssetsRequest message or plain object - * @param {google.cloud.securitycenter.v1.SecurityCenter.GroupAssetsCallback} callback Node-style callback called with the error, if any, and GroupAssetsResponse - * @returns {undefined} - * @variation 1 + * Verifies a CreateMuteConfigRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1.CreateMuteConfigRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Object.defineProperty(SecurityCenter.prototype.groupAssets = function groupAssets(request, callback) { - return this.rpcCall(groupAssets, $root.google.cloud.securitycenter.v1.GroupAssetsRequest, $root.google.cloud.securitycenter.v1.GroupAssetsResponse, request, callback); - }, "name", { value: "GroupAssets" }); + CreateMuteConfigRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.muteConfig != null && message.hasOwnProperty("muteConfig")) { + var error = $root.google.cloud.securitycenter.v1.MuteConfig.verify(message.muteConfig); + if (error) + return "muteConfig." + error; + } + if (message.muteConfigId != null && message.hasOwnProperty("muteConfigId")) + if (!$util.isString(message.muteConfigId)) + return "muteConfigId: string expected"; + return null; + }; /** - * Calls GroupAssets. - * @function groupAssets - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1.IGroupAssetsRequest} request GroupAssetsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Creates a CreateMuteConfigRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.CreateMuteConfigRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.CreateMuteConfigRequest} CreateMuteConfigRequest */ + CreateMuteConfigRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.CreateMuteConfigRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1.CreateMuteConfigRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.muteConfig != null) { + if (typeof object.muteConfig !== "object") + throw TypeError(".google.cloud.securitycenter.v1.CreateMuteConfigRequest.muteConfig: object expected"); + message.muteConfig = $root.google.cloud.securitycenter.v1.MuteConfig.fromObject(object.muteConfig); + } + if (object.muteConfigId != null) + message.muteConfigId = String(object.muteConfigId); + return message; + }; /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#groupFindings}. - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @typedef GroupFindingsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.securitycenter.v1.GroupFindingsResponse} [response] GroupFindingsResponse + * Creates a plain object from a CreateMuteConfigRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.CreateMuteConfigRequest + * @static + * @param {google.cloud.securitycenter.v1.CreateMuteConfigRequest} message CreateMuteConfigRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object */ + CreateMuteConfigRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.muteConfig = null; + object.muteConfigId = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.muteConfig != null && message.hasOwnProperty("muteConfig")) + object.muteConfig = $root.google.cloud.securitycenter.v1.MuteConfig.toObject(message.muteConfig, options); + if (message.muteConfigId != null && message.hasOwnProperty("muteConfigId")) + object.muteConfigId = message.muteConfigId; + return object; + }; /** - * Calls GroupFindings. - * @function groupFindings - * @memberof google.cloud.securitycenter.v1.SecurityCenter + * Converts this CreateMuteConfigRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.CreateMuteConfigRequest * @instance - * @param {google.cloud.securitycenter.v1.IGroupFindingsRequest} request GroupFindingsRequest message or plain object - * @param {google.cloud.securitycenter.v1.SecurityCenter.GroupFindingsCallback} callback Node-style callback called with the error, if any, and GroupFindingsResponse - * @returns {undefined} - * @variation 1 + * @returns {Object.} JSON object */ - Object.defineProperty(SecurityCenter.prototype.groupFindings = function groupFindings(request, callback) { - return this.rpcCall(groupFindings, $root.google.cloud.securitycenter.v1.GroupFindingsRequest, $root.google.cloud.securitycenter.v1.GroupFindingsResponse, request, callback); - }, "name", { value: "GroupFindings" }); + CreateMuteConfigRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Calls GroupFindings. - * @function groupFindings - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1.IGroupFindingsRequest} request GroupFindingsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ + return CreateMuteConfigRequest; + })(); + + v1.CreateNotificationConfigRequest = (function() { /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#listAssets}. - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @typedef ListAssetsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.securitycenter.v1.ListAssetsResponse} [response] ListAssetsResponse + * Properties of a CreateNotificationConfigRequest. + * @memberof google.cloud.securitycenter.v1 + * @interface ICreateNotificationConfigRequest + * @property {string|null} [parent] CreateNotificationConfigRequest parent + * @property {string|null} [configId] CreateNotificationConfigRequest configId + * @property {google.cloud.securitycenter.v1.INotificationConfig|null} [notificationConfig] CreateNotificationConfigRequest notificationConfig */ /** - * Calls ListAssets. - * @function listAssets - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1.IListAssetsRequest} request ListAssetsRequest message or plain object - * @param {google.cloud.securitycenter.v1.SecurityCenter.ListAssetsCallback} callback Node-style callback called with the error, if any, and ListAssetsResponse - * @returns {undefined} - * @variation 1 + * Constructs a new CreateNotificationConfigRequest. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a CreateNotificationConfigRequest. + * @implements ICreateNotificationConfigRequest + * @constructor + * @param {google.cloud.securitycenter.v1.ICreateNotificationConfigRequest=} [properties] Properties to set */ - Object.defineProperty(SecurityCenter.prototype.listAssets = function listAssets(request, callback) { - return this.rpcCall(listAssets, $root.google.cloud.securitycenter.v1.ListAssetsRequest, $root.google.cloud.securitycenter.v1.ListAssetsResponse, request, callback); - }, "name", { value: "ListAssets" }); + function CreateNotificationConfigRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } /** - * Calls ListAssets. - * @function listAssets - * @memberof google.cloud.securitycenter.v1.SecurityCenter + * CreateNotificationConfigRequest parent. + * @member {string} parent + * @memberof google.cloud.securitycenter.v1.CreateNotificationConfigRequest * @instance - * @param {google.cloud.securitycenter.v1.IListAssetsRequest} request ListAssetsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 */ + CreateNotificationConfigRequest.prototype.parent = ""; /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#listFindings}. - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @typedef ListFindingsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.securitycenter.v1.ListFindingsResponse} [response] ListFindingsResponse + * CreateNotificationConfigRequest configId. + * @member {string} configId + * @memberof google.cloud.securitycenter.v1.CreateNotificationConfigRequest + * @instance */ + CreateNotificationConfigRequest.prototype.configId = ""; /** - * Calls ListFindings. - * @function listFindings - * @memberof google.cloud.securitycenter.v1.SecurityCenter + * CreateNotificationConfigRequest notificationConfig. + * @member {google.cloud.securitycenter.v1.INotificationConfig|null|undefined} notificationConfig + * @memberof google.cloud.securitycenter.v1.CreateNotificationConfigRequest * @instance - * @param {google.cloud.securitycenter.v1.IListFindingsRequest} request ListFindingsRequest message or plain object - * @param {google.cloud.securitycenter.v1.SecurityCenter.ListFindingsCallback} callback Node-style callback called with the error, if any, and ListFindingsResponse - * @returns {undefined} - * @variation 1 */ - Object.defineProperty(SecurityCenter.prototype.listFindings = function listFindings(request, callback) { - return this.rpcCall(listFindings, $root.google.cloud.securitycenter.v1.ListFindingsRequest, $root.google.cloud.securitycenter.v1.ListFindingsResponse, request, callback); - }, "name", { value: "ListFindings" }); + CreateNotificationConfigRequest.prototype.notificationConfig = null; /** - * Calls ListFindings. - * @function listFindings - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1.IListFindingsRequest} request ListFindingsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Creates a new CreateNotificationConfigRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.CreateNotificationConfigRequest + * @static + * @param {google.cloud.securitycenter.v1.ICreateNotificationConfigRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.CreateNotificationConfigRequest} CreateNotificationConfigRequest instance */ + CreateNotificationConfigRequest.create = function create(properties) { + return new CreateNotificationConfigRequest(properties); + }; /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#listNotificationConfigs}. - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @typedef ListNotificationConfigsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.securitycenter.v1.ListNotificationConfigsResponse} [response] ListNotificationConfigsResponse + * Encodes the specified CreateNotificationConfigRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.CreateNotificationConfigRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.CreateNotificationConfigRequest + * @static + * @param {google.cloud.securitycenter.v1.ICreateNotificationConfigRequest} message CreateNotificationConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ + CreateNotificationConfigRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.configId != null && Object.hasOwnProperty.call(message, "configId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.configId); + if (message.notificationConfig != null && Object.hasOwnProperty.call(message, "notificationConfig")) + $root.google.cloud.securitycenter.v1.NotificationConfig.encode(message.notificationConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; /** - * Calls ListNotificationConfigs. - * @function listNotificationConfigs - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1.IListNotificationConfigsRequest} request ListNotificationConfigsRequest message or plain object - * @param {google.cloud.securitycenter.v1.SecurityCenter.ListNotificationConfigsCallback} callback Node-style callback called with the error, if any, and ListNotificationConfigsResponse - * @returns {undefined} - * @variation 1 + * Encodes the specified CreateNotificationConfigRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.CreateNotificationConfigRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.CreateNotificationConfigRequest + * @static + * @param {google.cloud.securitycenter.v1.ICreateNotificationConfigRequest} message CreateNotificationConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - Object.defineProperty(SecurityCenter.prototype.listNotificationConfigs = function listNotificationConfigs(request, callback) { - return this.rpcCall(listNotificationConfigs, $root.google.cloud.securitycenter.v1.ListNotificationConfigsRequest, $root.google.cloud.securitycenter.v1.ListNotificationConfigsResponse, request, callback); - }, "name", { value: "ListNotificationConfigs" }); + CreateNotificationConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; /** - * Calls ListNotificationConfigs. - * @function listNotificationConfigs - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1.IListNotificationConfigsRequest} request ListNotificationConfigsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Decodes a CreateNotificationConfigRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.CreateNotificationConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.CreateNotificationConfigRequest} CreateNotificationConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ + CreateNotificationConfigRequest.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.cloud.securitycenter.v1.CreateNotificationConfigRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.configId = reader.string(); + break; + case 3: + message.notificationConfig = $root.google.cloud.securitycenter.v1.NotificationConfig.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#listSources}. - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @typedef ListSourcesCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.securitycenter.v1.ListSourcesResponse} [response] ListSourcesResponse + * Decodes a CreateNotificationConfigRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.CreateNotificationConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.CreateNotificationConfigRequest} CreateNotificationConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ + CreateNotificationConfigRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; /** - * Calls ListSources. - * @function listSources - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1.IListSourcesRequest} request ListSourcesRequest message or plain object - * @param {google.cloud.securitycenter.v1.SecurityCenter.ListSourcesCallback} callback Node-style callback called with the error, if any, and ListSourcesResponse - * @returns {undefined} - * @variation 1 + * Verifies a CreateNotificationConfigRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1.CreateNotificationConfigRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Object.defineProperty(SecurityCenter.prototype.listSources = function listSources(request, callback) { - return this.rpcCall(listSources, $root.google.cloud.securitycenter.v1.ListSourcesRequest, $root.google.cloud.securitycenter.v1.ListSourcesResponse, request, callback); - }, "name", { value: "ListSources" }); + CreateNotificationConfigRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.configId != null && message.hasOwnProperty("configId")) + if (!$util.isString(message.configId)) + return "configId: string expected"; + if (message.notificationConfig != null && message.hasOwnProperty("notificationConfig")) { + var error = $root.google.cloud.securitycenter.v1.NotificationConfig.verify(message.notificationConfig); + if (error) + return "notificationConfig." + error; + } + return null; + }; /** - * Calls ListSources. - * @function listSources - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1.IListSourcesRequest} request ListSourcesRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Creates a CreateNotificationConfigRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.CreateNotificationConfigRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.CreateNotificationConfigRequest} CreateNotificationConfigRequest */ + CreateNotificationConfigRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.CreateNotificationConfigRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1.CreateNotificationConfigRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.configId != null) + message.configId = String(object.configId); + if (object.notificationConfig != null) { + if (typeof object.notificationConfig !== "object") + throw TypeError(".google.cloud.securitycenter.v1.CreateNotificationConfigRequest.notificationConfig: object expected"); + message.notificationConfig = $root.google.cloud.securitycenter.v1.NotificationConfig.fromObject(object.notificationConfig); + } + return message; + }; /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#runAssetDiscovery}. - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @typedef RunAssetDiscoveryCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation + * Creates a plain object from a CreateNotificationConfigRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.CreateNotificationConfigRequest + * @static + * @param {google.cloud.securitycenter.v1.CreateNotificationConfigRequest} message CreateNotificationConfigRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object */ + CreateNotificationConfigRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.configId = ""; + object.notificationConfig = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.configId != null && message.hasOwnProperty("configId")) + object.configId = message.configId; + if (message.notificationConfig != null && message.hasOwnProperty("notificationConfig")) + object.notificationConfig = $root.google.cloud.securitycenter.v1.NotificationConfig.toObject(message.notificationConfig, options); + return object; + }; /** - * Calls RunAssetDiscovery. - * @function runAssetDiscovery - * @memberof google.cloud.securitycenter.v1.SecurityCenter + * Converts this CreateNotificationConfigRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.CreateNotificationConfigRequest * @instance - * @param {google.cloud.securitycenter.v1.IRunAssetDiscoveryRequest} request RunAssetDiscoveryRequest message or plain object - * @param {google.cloud.securitycenter.v1.SecurityCenter.RunAssetDiscoveryCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 + * @returns {Object.} JSON object */ - Object.defineProperty(SecurityCenter.prototype.runAssetDiscovery = function runAssetDiscovery(request, callback) { - return this.rpcCall(runAssetDiscovery, $root.google.cloud.securitycenter.v1.RunAssetDiscoveryRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "RunAssetDiscovery" }); + CreateNotificationConfigRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return CreateNotificationConfigRequest; + })(); + + v1.CreateSourceRequest = (function() { /** - * Calls RunAssetDiscovery. - * @function runAssetDiscovery - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1.IRunAssetDiscoveryRequest} request RunAssetDiscoveryRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Properties of a CreateSourceRequest. + * @memberof google.cloud.securitycenter.v1 + * @interface ICreateSourceRequest + * @property {string|null} [parent] CreateSourceRequest parent + * @property {google.cloud.securitycenter.v1.ISource|null} [source] CreateSourceRequest source */ /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#setFindingState}. - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @typedef SetFindingStateCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.securitycenter.v1.Finding} [response] Finding + * Constructs a new CreateSourceRequest. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a CreateSourceRequest. + * @implements ICreateSourceRequest + * @constructor + * @param {google.cloud.securitycenter.v1.ICreateSourceRequest=} [properties] Properties to set */ + function CreateSourceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } /** - * Calls SetFindingState. - * @function setFindingState - * @memberof google.cloud.securitycenter.v1.SecurityCenter + * CreateSourceRequest parent. + * @member {string} parent + * @memberof google.cloud.securitycenter.v1.CreateSourceRequest * @instance - * @param {google.cloud.securitycenter.v1.ISetFindingStateRequest} request SetFindingStateRequest message or plain object - * @param {google.cloud.securitycenter.v1.SecurityCenter.SetFindingStateCallback} callback Node-style callback called with the error, if any, and Finding - * @returns {undefined} - * @variation 1 */ - Object.defineProperty(SecurityCenter.prototype.setFindingState = function setFindingState(request, callback) { - return this.rpcCall(setFindingState, $root.google.cloud.securitycenter.v1.SetFindingStateRequest, $root.google.cloud.securitycenter.v1.Finding, request, callback); - }, "name", { value: "SetFindingState" }); + CreateSourceRequest.prototype.parent = ""; /** - * Calls SetFindingState. - * @function setFindingState - * @memberof google.cloud.securitycenter.v1.SecurityCenter + * CreateSourceRequest source. + * @member {google.cloud.securitycenter.v1.ISource|null|undefined} source + * @memberof google.cloud.securitycenter.v1.CreateSourceRequest * @instance - * @param {google.cloud.securitycenter.v1.ISetFindingStateRequest} request SetFindingStateRequest message or plain object - * @returns {Promise} Promise - * @variation 2 */ + CreateSourceRequest.prototype.source = null; /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#setIamPolicy}. - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @typedef SetIamPolicyCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.iam.v1.Policy} [response] Policy + * Creates a new CreateSourceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.CreateSourceRequest + * @static + * @param {google.cloud.securitycenter.v1.ICreateSourceRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.CreateSourceRequest} CreateSourceRequest instance */ + CreateSourceRequest.create = function create(properties) { + return new CreateSourceRequest(properties); + }; /** - * Calls SetIamPolicy. - * @function setIamPolicy - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @instance - * @param {google.iam.v1.ISetIamPolicyRequest} request SetIamPolicyRequest message or plain object - * @param {google.cloud.securitycenter.v1.SecurityCenter.SetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy - * @returns {undefined} - * @variation 1 + * Encodes the specified CreateSourceRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.CreateSourceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.CreateSourceRequest + * @static + * @param {google.cloud.securitycenter.v1.ICreateSourceRequest} message CreateSourceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - Object.defineProperty(SecurityCenter.prototype.setIamPolicy = function setIamPolicy(request, callback) { - return this.rpcCall(setIamPolicy, $root.google.iam.v1.SetIamPolicyRequest, $root.google.iam.v1.Policy, request, callback); - }, "name", { value: "SetIamPolicy" }); + CreateSourceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.source != null && Object.hasOwnProperty.call(message, "source")) + $root.google.cloud.securitycenter.v1.Source.encode(message.source, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; /** - * Calls SetIamPolicy. - * @function setIamPolicy - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @instance - * @param {google.iam.v1.ISetIamPolicyRequest} request SetIamPolicyRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Encodes the specified CreateSourceRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.CreateSourceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.CreateSourceRequest + * @static + * @param {google.cloud.securitycenter.v1.ICreateSourceRequest} message CreateSourceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ + CreateSourceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#testIamPermissions}. - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @typedef TestIamPermissionsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.iam.v1.TestIamPermissionsResponse} [response] TestIamPermissionsResponse + * Decodes a CreateSourceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.CreateSourceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.CreateSourceRequest} CreateSourceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ + CreateSourceRequest.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.cloud.securitycenter.v1.CreateSourceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.source = $root.google.cloud.securitycenter.v1.Source.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; /** - * Calls TestIamPermissions. - * @function testIamPermissions - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @instance - * @param {google.iam.v1.ITestIamPermissionsRequest} request TestIamPermissionsRequest message or plain object - * @param {google.cloud.securitycenter.v1.SecurityCenter.TestIamPermissionsCallback} callback Node-style callback called with the error, if any, and TestIamPermissionsResponse - * @returns {undefined} - * @variation 1 + * Decodes a CreateSourceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.CreateSourceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.CreateSourceRequest} CreateSourceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Object.defineProperty(SecurityCenter.prototype.testIamPermissions = function testIamPermissions(request, callback) { - return this.rpcCall(testIamPermissions, $root.google.iam.v1.TestIamPermissionsRequest, $root.google.iam.v1.TestIamPermissionsResponse, request, callback); - }, "name", { value: "TestIamPermissions" }); + CreateSourceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; /** - * Calls TestIamPermissions. - * @function testIamPermissions - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @instance - * @param {google.iam.v1.ITestIamPermissionsRequest} request TestIamPermissionsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Verifies a CreateSourceRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1.CreateSourceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not */ + CreateSourceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.source != null && message.hasOwnProperty("source")) { + var error = $root.google.cloud.securitycenter.v1.Source.verify(message.source); + if (error) + return "source." + error; + } + return null; + }; /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#updateFinding}. - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @typedef UpdateFindingCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.securitycenter.v1.Finding} [response] Finding + * Creates a CreateSourceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.CreateSourceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.CreateSourceRequest} CreateSourceRequest */ + CreateSourceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.CreateSourceRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1.CreateSourceRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.source != null) { + if (typeof object.source !== "object") + throw TypeError(".google.cloud.securitycenter.v1.CreateSourceRequest.source: object expected"); + message.source = $root.google.cloud.securitycenter.v1.Source.fromObject(object.source); + } + return message; + }; /** - * Calls UpdateFinding. - * @function updateFinding - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1.IUpdateFindingRequest} request UpdateFindingRequest message or plain object - * @param {google.cloud.securitycenter.v1.SecurityCenter.UpdateFindingCallback} callback Node-style callback called with the error, if any, and Finding - * @returns {undefined} - * @variation 1 + * Creates a plain object from a CreateSourceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.CreateSourceRequest + * @static + * @param {google.cloud.securitycenter.v1.CreateSourceRequest} message CreateSourceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object */ - Object.defineProperty(SecurityCenter.prototype.updateFinding = function updateFinding(request, callback) { - return this.rpcCall(updateFinding, $root.google.cloud.securitycenter.v1.UpdateFindingRequest, $root.google.cloud.securitycenter.v1.Finding, request, callback); - }, "name", { value: "UpdateFinding" }); + CreateSourceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.source = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.source != null && message.hasOwnProperty("source")) + object.source = $root.google.cloud.securitycenter.v1.Source.toObject(message.source, options); + return object; + }; /** - * Calls UpdateFinding. - * @function updateFinding - * @memberof google.cloud.securitycenter.v1.SecurityCenter + * Converts this CreateSourceRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.CreateSourceRequest * @instance - * @param {google.cloud.securitycenter.v1.IUpdateFindingRequest} request UpdateFindingRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * @returns {Object.} JSON object */ + CreateSourceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return CreateSourceRequest; + })(); + + v1.DeleteMuteConfigRequest = (function() { /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#updateNotificationConfig}. - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @typedef UpdateNotificationConfigCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.securitycenter.v1.NotificationConfig} [response] NotificationConfig + * Properties of a DeleteMuteConfigRequest. + * @memberof google.cloud.securitycenter.v1 + * @interface IDeleteMuteConfigRequest + * @property {string|null} [name] DeleteMuteConfigRequest name */ /** - * Calls UpdateNotificationConfig. - * @function updateNotificationConfig - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1.IUpdateNotificationConfigRequest} request UpdateNotificationConfigRequest message or plain object - * @param {google.cloud.securitycenter.v1.SecurityCenter.UpdateNotificationConfigCallback} callback Node-style callback called with the error, if any, and NotificationConfig - * @returns {undefined} - * @variation 1 + * Constructs a new DeleteMuteConfigRequest. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a DeleteMuteConfigRequest. + * @implements IDeleteMuteConfigRequest + * @constructor + * @param {google.cloud.securitycenter.v1.IDeleteMuteConfigRequest=} [properties] Properties to set */ - Object.defineProperty(SecurityCenter.prototype.updateNotificationConfig = function updateNotificationConfig(request, callback) { - return this.rpcCall(updateNotificationConfig, $root.google.cloud.securitycenter.v1.UpdateNotificationConfigRequest, $root.google.cloud.securitycenter.v1.NotificationConfig, request, callback); - }, "name", { value: "UpdateNotificationConfig" }); + function DeleteMuteConfigRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } /** - * Calls UpdateNotificationConfig. - * @function updateNotificationConfig - * @memberof google.cloud.securitycenter.v1.SecurityCenter + * DeleteMuteConfigRequest name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1.DeleteMuteConfigRequest * @instance - * @param {google.cloud.securitycenter.v1.IUpdateNotificationConfigRequest} request UpdateNotificationConfigRequest message or plain object - * @returns {Promise} Promise - * @variation 2 */ + DeleteMuteConfigRequest.prototype.name = ""; /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#updateOrganizationSettings}. - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @typedef UpdateOrganizationSettingsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.securitycenter.v1.OrganizationSettings} [response] OrganizationSettings + * Creates a new DeleteMuteConfigRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.DeleteMuteConfigRequest + * @static + * @param {google.cloud.securitycenter.v1.IDeleteMuteConfigRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.DeleteMuteConfigRequest} DeleteMuteConfigRequest instance */ + DeleteMuteConfigRequest.create = function create(properties) { + return new DeleteMuteConfigRequest(properties); + }; /** - * Calls UpdateOrganizationSettings. - * @function updateOrganizationSettings - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1.IUpdateOrganizationSettingsRequest} request UpdateOrganizationSettingsRequest message or plain object - * @param {google.cloud.securitycenter.v1.SecurityCenter.UpdateOrganizationSettingsCallback} callback Node-style callback called with the error, if any, and OrganizationSettings - * @returns {undefined} - * @variation 1 + * Encodes the specified DeleteMuteConfigRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.DeleteMuteConfigRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.DeleteMuteConfigRequest + * @static + * @param {google.cloud.securitycenter.v1.IDeleteMuteConfigRequest} message DeleteMuteConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - Object.defineProperty(SecurityCenter.prototype.updateOrganizationSettings = function updateOrganizationSettings(request, callback) { - return this.rpcCall(updateOrganizationSettings, $root.google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest, $root.google.cloud.securitycenter.v1.OrganizationSettings, request, callback); - }, "name", { value: "UpdateOrganizationSettings" }); + DeleteMuteConfigRequest.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; + }; /** - * Calls UpdateOrganizationSettings. - * @function updateOrganizationSettings - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1.IUpdateOrganizationSettingsRequest} request UpdateOrganizationSettingsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Encodes the specified DeleteMuteConfigRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.DeleteMuteConfigRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.DeleteMuteConfigRequest + * @static + * @param {google.cloud.securitycenter.v1.IDeleteMuteConfigRequest} message DeleteMuteConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ + DeleteMuteConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#updateSource}. - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @typedef UpdateSourceCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.securitycenter.v1.Source} [response] Source + * Decodes a DeleteMuteConfigRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.DeleteMuteConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.DeleteMuteConfigRequest} DeleteMuteConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ + DeleteMuteConfigRequest.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.cloud.securitycenter.v1.DeleteMuteConfigRequest(); + 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; + }; /** - * Calls UpdateSource. - * @function updateSource - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1.IUpdateSourceRequest} request UpdateSourceRequest message or plain object - * @param {google.cloud.securitycenter.v1.SecurityCenter.UpdateSourceCallback} callback Node-style callback called with the error, if any, and Source - * @returns {undefined} - * @variation 1 + * Decodes a DeleteMuteConfigRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.DeleteMuteConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.DeleteMuteConfigRequest} DeleteMuteConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Object.defineProperty(SecurityCenter.prototype.updateSource = function updateSource(request, callback) { - return this.rpcCall(updateSource, $root.google.cloud.securitycenter.v1.UpdateSourceRequest, $root.google.cloud.securitycenter.v1.Source, request, callback); - }, "name", { value: "UpdateSource" }); + DeleteMuteConfigRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; /** - * Calls UpdateSource. - * @function updateSource - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1.IUpdateSourceRequest} request UpdateSourceRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Verifies a DeleteMuteConfigRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1.DeleteMuteConfigRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not */ + DeleteMuteConfigRequest.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; + }; /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#updateSecurityMarks}. - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @typedef UpdateSecurityMarksCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.securitycenter.v1.SecurityMarks} [response] SecurityMarks + * Creates a DeleteMuteConfigRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.DeleteMuteConfigRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.DeleteMuteConfigRequest} DeleteMuteConfigRequest */ + DeleteMuteConfigRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.DeleteMuteConfigRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1.DeleteMuteConfigRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; /** - * Calls UpdateSecurityMarks. - * @function updateSecurityMarks - * @memberof google.cloud.securitycenter.v1.SecurityCenter - * @instance - * @param {google.cloud.securitycenter.v1.IUpdateSecurityMarksRequest} request UpdateSecurityMarksRequest message or plain object - * @param {google.cloud.securitycenter.v1.SecurityCenter.UpdateSecurityMarksCallback} callback Node-style callback called with the error, if any, and SecurityMarks - * @returns {undefined} - * @variation 1 + * Creates a plain object from a DeleteMuteConfigRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.DeleteMuteConfigRequest + * @static + * @param {google.cloud.securitycenter.v1.DeleteMuteConfigRequest} message DeleteMuteConfigRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object */ - Object.defineProperty(SecurityCenter.prototype.updateSecurityMarks = function updateSecurityMarks(request, callback) { - return this.rpcCall(updateSecurityMarks, $root.google.cloud.securitycenter.v1.UpdateSecurityMarksRequest, $root.google.cloud.securitycenter.v1.SecurityMarks, request, callback); - }, "name", { value: "UpdateSecurityMarks" }); + DeleteMuteConfigRequest.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; + }; /** - * Calls UpdateSecurityMarks. - * @function updateSecurityMarks - * @memberof google.cloud.securitycenter.v1.SecurityCenter + * Converts this DeleteMuteConfigRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.DeleteMuteConfigRequest * @instance - * @param {google.cloud.securitycenter.v1.IUpdateSecurityMarksRequest} request UpdateSecurityMarksRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * @returns {Object.} JSON object */ + DeleteMuteConfigRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - return SecurityCenter; + return DeleteMuteConfigRequest; })(); - v1.CreateFindingRequest = (function() { + v1.DeleteNotificationConfigRequest = (function() { /** - * Properties of a CreateFindingRequest. + * Properties of a DeleteNotificationConfigRequest. * @memberof google.cloud.securitycenter.v1 - * @interface ICreateFindingRequest - * @property {string|null} [parent] CreateFindingRequest parent - * @property {string|null} [findingId] CreateFindingRequest findingId - * @property {google.cloud.securitycenter.v1.IFinding|null} [finding] CreateFindingRequest finding + * @interface IDeleteNotificationConfigRequest + * @property {string|null} [name] DeleteNotificationConfigRequest name */ /** - * Constructs a new CreateFindingRequest. + * Constructs a new DeleteNotificationConfigRequest. * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents a CreateFindingRequest. - * @implements ICreateFindingRequest + * @classdesc Represents a DeleteNotificationConfigRequest. + * @implements IDeleteNotificationConfigRequest * @constructor - * @param {google.cloud.securitycenter.v1.ICreateFindingRequest=} [properties] Properties to set + * @param {google.cloud.securitycenter.v1.IDeleteNotificationConfigRequest=} [properties] Properties to set */ - function CreateFindingRequest(properties) { + function DeleteNotificationConfigRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -6510,101 +8686,75 @@ } /** - * CreateFindingRequest parent. - * @member {string} parent - * @memberof google.cloud.securitycenter.v1.CreateFindingRequest - * @instance - */ - CreateFindingRequest.prototype.parent = ""; - - /** - * CreateFindingRequest findingId. - * @member {string} findingId - * @memberof google.cloud.securitycenter.v1.CreateFindingRequest - * @instance - */ - CreateFindingRequest.prototype.findingId = ""; - - /** - * CreateFindingRequest finding. - * @member {google.cloud.securitycenter.v1.IFinding|null|undefined} finding - * @memberof google.cloud.securitycenter.v1.CreateFindingRequest + * DeleteNotificationConfigRequest name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1.DeleteNotificationConfigRequest * @instance */ - CreateFindingRequest.prototype.finding = null; + DeleteNotificationConfigRequest.prototype.name = ""; /** - * Creates a new CreateFindingRequest instance using the specified properties. + * Creates a new DeleteNotificationConfigRequest instance using the specified properties. * @function create - * @memberof google.cloud.securitycenter.v1.CreateFindingRequest + * @memberof google.cloud.securitycenter.v1.DeleteNotificationConfigRequest * @static - * @param {google.cloud.securitycenter.v1.ICreateFindingRequest=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.CreateFindingRequest} CreateFindingRequest instance + * @param {google.cloud.securitycenter.v1.IDeleteNotificationConfigRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.DeleteNotificationConfigRequest} DeleteNotificationConfigRequest instance */ - CreateFindingRequest.create = function create(properties) { - return new CreateFindingRequest(properties); + DeleteNotificationConfigRequest.create = function create(properties) { + return new DeleteNotificationConfigRequest(properties); }; /** - * Encodes the specified CreateFindingRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.CreateFindingRequest.verify|verify} messages. + * Encodes the specified DeleteNotificationConfigRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.DeleteNotificationConfigRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.securitycenter.v1.CreateFindingRequest + * @memberof google.cloud.securitycenter.v1.DeleteNotificationConfigRequest * @static - * @param {google.cloud.securitycenter.v1.ICreateFindingRequest} message CreateFindingRequest message or plain object to encode + * @param {google.cloud.securitycenter.v1.IDeleteNotificationConfigRequest} message DeleteNotificationConfigRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateFindingRequest.encode = function encode(message, writer) { + DeleteNotificationConfigRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.findingId != null && Object.hasOwnProperty.call(message, "findingId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.findingId); - if (message.finding != null && Object.hasOwnProperty.call(message, "finding")) - $root.google.cloud.securitycenter.v1.Finding.encode(message.finding, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; /** - * Encodes the specified CreateFindingRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.CreateFindingRequest.verify|verify} messages. + * Encodes the specified DeleteNotificationConfigRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.DeleteNotificationConfigRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.CreateFindingRequest + * @memberof google.cloud.securitycenter.v1.DeleteNotificationConfigRequest * @static - * @param {google.cloud.securitycenter.v1.ICreateFindingRequest} message CreateFindingRequest message or plain object to encode + * @param {google.cloud.securitycenter.v1.IDeleteNotificationConfigRequest} message DeleteNotificationConfigRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateFindingRequest.encodeDelimited = function encodeDelimited(message, writer) { + DeleteNotificationConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a CreateFindingRequest message from the specified reader or buffer. + * Decodes a DeleteNotificationConfigRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.securitycenter.v1.CreateFindingRequest + * @memberof google.cloud.securitycenter.v1.DeleteNotificationConfigRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.CreateFindingRequest} CreateFindingRequest + * @returns {google.cloud.securitycenter.v1.DeleteNotificationConfigRequest} DeleteNotificationConfigRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateFindingRequest.decode = function decode(reader, length) { + DeleteNotificationConfigRequest.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.cloud.securitycenter.v1.CreateFindingRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.DeleteNotificationConfigRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.parent = reader.string(); - break; - case 2: - message.findingId = reader.string(); - break; - case 3: - message.finding = $root.google.cloud.securitycenter.v1.Finding.decode(reader, reader.uint32()); + message.name = reader.string(); break; default: reader.skipType(tag & 7); @@ -6615,131 +8765,107 @@ }; /** - * Decodes a CreateFindingRequest message from the specified reader or buffer, length delimited. + * Decodes a DeleteNotificationConfigRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.CreateFindingRequest + * @memberof google.cloud.securitycenter.v1.DeleteNotificationConfigRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.CreateFindingRequest} CreateFindingRequest + * @returns {google.cloud.securitycenter.v1.DeleteNotificationConfigRequest} DeleteNotificationConfigRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateFindingRequest.decodeDelimited = function decodeDelimited(reader) { + DeleteNotificationConfigRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a CreateFindingRequest message. + * Verifies a DeleteNotificationConfigRequest message. * @function verify - * @memberof google.cloud.securitycenter.v1.CreateFindingRequest + * @memberof google.cloud.securitycenter.v1.DeleteNotificationConfigRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - CreateFindingRequest.verify = function verify(message) { + DeleteNotificationConfigRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.findingId != null && message.hasOwnProperty("findingId")) - if (!$util.isString(message.findingId)) - return "findingId: string expected"; - if (message.finding != null && message.hasOwnProperty("finding")) { - var error = $root.google.cloud.securitycenter.v1.Finding.verify(message.finding); - if (error) - return "finding." + error; - } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; return null; }; /** - * Creates a CreateFindingRequest message from a plain object. Also converts values to their respective internal types. + * Creates a DeleteNotificationConfigRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.securitycenter.v1.CreateFindingRequest + * @memberof google.cloud.securitycenter.v1.DeleteNotificationConfigRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.CreateFindingRequest} CreateFindingRequest + * @returns {google.cloud.securitycenter.v1.DeleteNotificationConfigRequest} DeleteNotificationConfigRequest */ - CreateFindingRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.CreateFindingRequest) + DeleteNotificationConfigRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.DeleteNotificationConfigRequest) return object; - var message = new $root.google.cloud.securitycenter.v1.CreateFindingRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.findingId != null) - message.findingId = String(object.findingId); - if (object.finding != null) { - if (typeof object.finding !== "object") - throw TypeError(".google.cloud.securitycenter.v1.CreateFindingRequest.finding: object expected"); - message.finding = $root.google.cloud.securitycenter.v1.Finding.fromObject(object.finding); - } + var message = new $root.google.cloud.securitycenter.v1.DeleteNotificationConfigRequest(); + if (object.name != null) + message.name = String(object.name); return message; }; /** - * Creates a plain object from a CreateFindingRequest message. Also converts values to other types if specified. + * Creates a plain object from a DeleteNotificationConfigRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.securitycenter.v1.CreateFindingRequest + * @memberof google.cloud.securitycenter.v1.DeleteNotificationConfigRequest * @static - * @param {google.cloud.securitycenter.v1.CreateFindingRequest} message CreateFindingRequest + * @param {google.cloud.securitycenter.v1.DeleteNotificationConfigRequest} message DeleteNotificationConfigRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CreateFindingRequest.toObject = function toObject(message, options) { + DeleteNotificationConfigRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.parent = ""; - object.findingId = ""; - object.finding = null; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.findingId != null && message.hasOwnProperty("findingId")) - object.findingId = message.findingId; - if (message.finding != null && message.hasOwnProperty("finding")) - object.finding = $root.google.cloud.securitycenter.v1.Finding.toObject(message.finding, options); + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; return object; }; /** - * Converts this CreateFindingRequest to JSON. + * Converts this DeleteNotificationConfigRequest to JSON. * @function toJSON - * @memberof google.cloud.securitycenter.v1.CreateFindingRequest + * @memberof google.cloud.securitycenter.v1.DeleteNotificationConfigRequest * @instance * @returns {Object.} JSON object */ - CreateFindingRequest.prototype.toJSON = function toJSON() { + DeleteNotificationConfigRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return CreateFindingRequest; + return DeleteNotificationConfigRequest; })(); - v1.CreateNotificationConfigRequest = (function() { + v1.GetMuteConfigRequest = (function() { /** - * Properties of a CreateNotificationConfigRequest. + * Properties of a GetMuteConfigRequest. * @memberof google.cloud.securitycenter.v1 - * @interface ICreateNotificationConfigRequest - * @property {string|null} [parent] CreateNotificationConfigRequest parent - * @property {string|null} [configId] CreateNotificationConfigRequest configId - * @property {google.cloud.securitycenter.v1.INotificationConfig|null} [notificationConfig] CreateNotificationConfigRequest notificationConfig + * @interface IGetMuteConfigRequest + * @property {string|null} [name] GetMuteConfigRequest name */ /** - * Constructs a new CreateNotificationConfigRequest. + * Constructs a new GetMuteConfigRequest. * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents a CreateNotificationConfigRequest. - * @implements ICreateNotificationConfigRequest + * @classdesc Represents a GetMuteConfigRequest. + * @implements IGetMuteConfigRequest * @constructor - * @param {google.cloud.securitycenter.v1.ICreateNotificationConfigRequest=} [properties] Properties to set + * @param {google.cloud.securitycenter.v1.IGetMuteConfigRequest=} [properties] Properties to set */ - function CreateNotificationConfigRequest(properties) { + function GetMuteConfigRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -6747,101 +8873,75 @@ } /** - * CreateNotificationConfigRequest parent. - * @member {string} parent - * @memberof google.cloud.securitycenter.v1.CreateNotificationConfigRequest - * @instance - */ - CreateNotificationConfigRequest.prototype.parent = ""; - - /** - * CreateNotificationConfigRequest configId. - * @member {string} configId - * @memberof google.cloud.securitycenter.v1.CreateNotificationConfigRequest - * @instance - */ - CreateNotificationConfigRequest.prototype.configId = ""; - - /** - * CreateNotificationConfigRequest notificationConfig. - * @member {google.cloud.securitycenter.v1.INotificationConfig|null|undefined} notificationConfig - * @memberof google.cloud.securitycenter.v1.CreateNotificationConfigRequest + * GetMuteConfigRequest name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1.GetMuteConfigRequest * @instance */ - CreateNotificationConfigRequest.prototype.notificationConfig = null; + GetMuteConfigRequest.prototype.name = ""; /** - * Creates a new CreateNotificationConfigRequest instance using the specified properties. + * Creates a new GetMuteConfigRequest instance using the specified properties. * @function create - * @memberof google.cloud.securitycenter.v1.CreateNotificationConfigRequest + * @memberof google.cloud.securitycenter.v1.GetMuteConfigRequest * @static - * @param {google.cloud.securitycenter.v1.ICreateNotificationConfigRequest=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.CreateNotificationConfigRequest} CreateNotificationConfigRequest instance + * @param {google.cloud.securitycenter.v1.IGetMuteConfigRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.GetMuteConfigRequest} GetMuteConfigRequest instance */ - CreateNotificationConfigRequest.create = function create(properties) { - return new CreateNotificationConfigRequest(properties); + GetMuteConfigRequest.create = function create(properties) { + return new GetMuteConfigRequest(properties); }; /** - * Encodes the specified CreateNotificationConfigRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.CreateNotificationConfigRequest.verify|verify} messages. + * Encodes the specified GetMuteConfigRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.GetMuteConfigRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.securitycenter.v1.CreateNotificationConfigRequest + * @memberof google.cloud.securitycenter.v1.GetMuteConfigRequest * @static - * @param {google.cloud.securitycenter.v1.ICreateNotificationConfigRequest} message CreateNotificationConfigRequest message or plain object to encode + * @param {google.cloud.securitycenter.v1.IGetMuteConfigRequest} message GetMuteConfigRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateNotificationConfigRequest.encode = function encode(message, writer) { + GetMuteConfigRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.configId != null && Object.hasOwnProperty.call(message, "configId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.configId); - if (message.notificationConfig != null && Object.hasOwnProperty.call(message, "notificationConfig")) - $root.google.cloud.securitycenter.v1.NotificationConfig.encode(message.notificationConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; /** - * Encodes the specified CreateNotificationConfigRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.CreateNotificationConfigRequest.verify|verify} messages. + * Encodes the specified GetMuteConfigRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.GetMuteConfigRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.CreateNotificationConfigRequest + * @memberof google.cloud.securitycenter.v1.GetMuteConfigRequest * @static - * @param {google.cloud.securitycenter.v1.ICreateNotificationConfigRequest} message CreateNotificationConfigRequest message or plain object to encode + * @param {google.cloud.securitycenter.v1.IGetMuteConfigRequest} message GetMuteConfigRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateNotificationConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { + GetMuteConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a CreateNotificationConfigRequest message from the specified reader or buffer. + * Decodes a GetMuteConfigRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.securitycenter.v1.CreateNotificationConfigRequest + * @memberof google.cloud.securitycenter.v1.GetMuteConfigRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.CreateNotificationConfigRequest} CreateNotificationConfigRequest + * @returns {google.cloud.securitycenter.v1.GetMuteConfigRequest} GetMuteConfigRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateNotificationConfigRequest.decode = function decode(reader, length) { + GetMuteConfigRequest.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.cloud.securitycenter.v1.CreateNotificationConfigRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.GetMuteConfigRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.parent = reader.string(); - break; - case 2: - message.configId = reader.string(); - break; - case 3: - message.notificationConfig = $root.google.cloud.securitycenter.v1.NotificationConfig.decode(reader, reader.uint32()); + message.name = reader.string(); break; default: reader.skipType(tag & 7); @@ -6852,130 +8952,107 @@ }; /** - * Decodes a CreateNotificationConfigRequest message from the specified reader or buffer, length delimited. + * Decodes a GetMuteConfigRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.CreateNotificationConfigRequest + * @memberof google.cloud.securitycenter.v1.GetMuteConfigRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.CreateNotificationConfigRequest} CreateNotificationConfigRequest + * @returns {google.cloud.securitycenter.v1.GetMuteConfigRequest} GetMuteConfigRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateNotificationConfigRequest.decodeDelimited = function decodeDelimited(reader) { + GetMuteConfigRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a CreateNotificationConfigRequest message. + * Verifies a GetMuteConfigRequest message. * @function verify - * @memberof google.cloud.securitycenter.v1.CreateNotificationConfigRequest + * @memberof google.cloud.securitycenter.v1.GetMuteConfigRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - CreateNotificationConfigRequest.verify = function verify(message) { + GetMuteConfigRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.configId != null && message.hasOwnProperty("configId")) - if (!$util.isString(message.configId)) - return "configId: string expected"; - if (message.notificationConfig != null && message.hasOwnProperty("notificationConfig")) { - var error = $root.google.cloud.securitycenter.v1.NotificationConfig.verify(message.notificationConfig); - if (error) - return "notificationConfig." + error; - } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; return null; }; /** - * Creates a CreateNotificationConfigRequest message from a plain object. Also converts values to their respective internal types. + * Creates a GetMuteConfigRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.securitycenter.v1.CreateNotificationConfigRequest + * @memberof google.cloud.securitycenter.v1.GetMuteConfigRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.CreateNotificationConfigRequest} CreateNotificationConfigRequest + * @returns {google.cloud.securitycenter.v1.GetMuteConfigRequest} GetMuteConfigRequest */ - CreateNotificationConfigRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.CreateNotificationConfigRequest) + GetMuteConfigRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.GetMuteConfigRequest) return object; - var message = new $root.google.cloud.securitycenter.v1.CreateNotificationConfigRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.configId != null) - message.configId = String(object.configId); - if (object.notificationConfig != null) { - if (typeof object.notificationConfig !== "object") - throw TypeError(".google.cloud.securitycenter.v1.CreateNotificationConfigRequest.notificationConfig: object expected"); - message.notificationConfig = $root.google.cloud.securitycenter.v1.NotificationConfig.fromObject(object.notificationConfig); - } + var message = new $root.google.cloud.securitycenter.v1.GetMuteConfigRequest(); + if (object.name != null) + message.name = String(object.name); return message; }; /** - * Creates a plain object from a CreateNotificationConfigRequest message. Also converts values to other types if specified. + * Creates a plain object from a GetMuteConfigRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.securitycenter.v1.CreateNotificationConfigRequest + * @memberof google.cloud.securitycenter.v1.GetMuteConfigRequest * @static - * @param {google.cloud.securitycenter.v1.CreateNotificationConfigRequest} message CreateNotificationConfigRequest + * @param {google.cloud.securitycenter.v1.GetMuteConfigRequest} message GetMuteConfigRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CreateNotificationConfigRequest.toObject = function toObject(message, options) { + GetMuteConfigRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.parent = ""; - object.configId = ""; - object.notificationConfig = null; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.configId != null && message.hasOwnProperty("configId")) - object.configId = message.configId; - if (message.notificationConfig != null && message.hasOwnProperty("notificationConfig")) - object.notificationConfig = $root.google.cloud.securitycenter.v1.NotificationConfig.toObject(message.notificationConfig, options); + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; return object; }; /** - * Converts this CreateNotificationConfigRequest to JSON. + * Converts this GetMuteConfigRequest to JSON. * @function toJSON - * @memberof google.cloud.securitycenter.v1.CreateNotificationConfigRequest + * @memberof google.cloud.securitycenter.v1.GetMuteConfigRequest * @instance * @returns {Object.} JSON object */ - CreateNotificationConfigRequest.prototype.toJSON = function toJSON() { + GetMuteConfigRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return CreateNotificationConfigRequest; + return GetMuteConfigRequest; })(); - v1.CreateSourceRequest = (function() { + v1.GetNotificationConfigRequest = (function() { /** - * Properties of a CreateSourceRequest. + * Properties of a GetNotificationConfigRequest. * @memberof google.cloud.securitycenter.v1 - * @interface ICreateSourceRequest - * @property {string|null} [parent] CreateSourceRequest parent - * @property {google.cloud.securitycenter.v1.ISource|null} [source] CreateSourceRequest source + * @interface IGetNotificationConfigRequest + * @property {string|null} [name] GetNotificationConfigRequest name */ /** - * Constructs a new CreateSourceRequest. + * Constructs a new GetNotificationConfigRequest. * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents a CreateSourceRequest. - * @implements ICreateSourceRequest + * @classdesc Represents a GetNotificationConfigRequest. + * @implements IGetNotificationConfigRequest * @constructor - * @param {google.cloud.securitycenter.v1.ICreateSourceRequest=} [properties] Properties to set + * @param {google.cloud.securitycenter.v1.IGetNotificationConfigRequest=} [properties] Properties to set */ - function CreateSourceRequest(properties) { + function GetNotificationConfigRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -6983,88 +9060,75 @@ } /** - * CreateSourceRequest parent. - * @member {string} parent - * @memberof google.cloud.securitycenter.v1.CreateSourceRequest - * @instance - */ - CreateSourceRequest.prototype.parent = ""; - - /** - * CreateSourceRequest source. - * @member {google.cloud.securitycenter.v1.ISource|null|undefined} source - * @memberof google.cloud.securitycenter.v1.CreateSourceRequest + * GetNotificationConfigRequest name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1.GetNotificationConfigRequest * @instance */ - CreateSourceRequest.prototype.source = null; + GetNotificationConfigRequest.prototype.name = ""; /** - * Creates a new CreateSourceRequest instance using the specified properties. + * Creates a new GetNotificationConfigRequest instance using the specified properties. * @function create - * @memberof google.cloud.securitycenter.v1.CreateSourceRequest + * @memberof google.cloud.securitycenter.v1.GetNotificationConfigRequest * @static - * @param {google.cloud.securitycenter.v1.ICreateSourceRequest=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.CreateSourceRequest} CreateSourceRequest instance + * @param {google.cloud.securitycenter.v1.IGetNotificationConfigRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.GetNotificationConfigRequest} GetNotificationConfigRequest instance */ - CreateSourceRequest.create = function create(properties) { - return new CreateSourceRequest(properties); + GetNotificationConfigRequest.create = function create(properties) { + return new GetNotificationConfigRequest(properties); }; /** - * Encodes the specified CreateSourceRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.CreateSourceRequest.verify|verify} messages. + * Encodes the specified GetNotificationConfigRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.GetNotificationConfigRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.securitycenter.v1.CreateSourceRequest + * @memberof google.cloud.securitycenter.v1.GetNotificationConfigRequest * @static - * @param {google.cloud.securitycenter.v1.ICreateSourceRequest} message CreateSourceRequest message or plain object to encode + * @param {google.cloud.securitycenter.v1.IGetNotificationConfigRequest} message GetNotificationConfigRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateSourceRequest.encode = function encode(message, writer) { + GetNotificationConfigRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.source != null && Object.hasOwnProperty.call(message, "source")) - $root.google.cloud.securitycenter.v1.Source.encode(message.source, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; /** - * Encodes the specified CreateSourceRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.CreateSourceRequest.verify|verify} messages. + * Encodes the specified GetNotificationConfigRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.GetNotificationConfigRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.CreateSourceRequest + * @memberof google.cloud.securitycenter.v1.GetNotificationConfigRequest * @static - * @param {google.cloud.securitycenter.v1.ICreateSourceRequest} message CreateSourceRequest message or plain object to encode + * @param {google.cloud.securitycenter.v1.IGetNotificationConfigRequest} message GetNotificationConfigRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateSourceRequest.encodeDelimited = function encodeDelimited(message, writer) { + GetNotificationConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a CreateSourceRequest message from the specified reader or buffer. + * Decodes a GetNotificationConfigRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.securitycenter.v1.CreateSourceRequest + * @memberof google.cloud.securitycenter.v1.GetNotificationConfigRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.CreateSourceRequest} CreateSourceRequest + * @returns {google.cloud.securitycenter.v1.GetNotificationConfigRequest} GetNotificationConfigRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateSourceRequest.decode = function decode(reader, length) { + GetNotificationConfigRequest.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.cloud.securitycenter.v1.CreateSourceRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.GetNotificationConfigRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.parent = reader.string(); - break; - case 2: - message.source = $root.google.cloud.securitycenter.v1.Source.decode(reader, reader.uint32()); + message.name = reader.string(); break; default: reader.skipType(tag & 7); @@ -7075,121 +9139,107 @@ }; /** - * Decodes a CreateSourceRequest message from the specified reader or buffer, length delimited. + * Decodes a GetNotificationConfigRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.CreateSourceRequest + * @memberof google.cloud.securitycenter.v1.GetNotificationConfigRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.CreateSourceRequest} CreateSourceRequest + * @returns {google.cloud.securitycenter.v1.GetNotificationConfigRequest} GetNotificationConfigRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateSourceRequest.decodeDelimited = function decodeDelimited(reader) { + GetNotificationConfigRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a CreateSourceRequest message. + * Verifies a GetNotificationConfigRequest message. * @function verify - * @memberof google.cloud.securitycenter.v1.CreateSourceRequest + * @memberof google.cloud.securitycenter.v1.GetNotificationConfigRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - CreateSourceRequest.verify = function verify(message) { + GetNotificationConfigRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.source != null && message.hasOwnProperty("source")) { - var error = $root.google.cloud.securitycenter.v1.Source.verify(message.source); - if (error) - return "source." + error; - } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; return null; }; /** - * Creates a CreateSourceRequest message from a plain object. Also converts values to their respective internal types. + * Creates a GetNotificationConfigRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.securitycenter.v1.CreateSourceRequest + * @memberof google.cloud.securitycenter.v1.GetNotificationConfigRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.CreateSourceRequest} CreateSourceRequest + * @returns {google.cloud.securitycenter.v1.GetNotificationConfigRequest} GetNotificationConfigRequest */ - CreateSourceRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.CreateSourceRequest) + GetNotificationConfigRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.GetNotificationConfigRequest) return object; - var message = new $root.google.cloud.securitycenter.v1.CreateSourceRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.source != null) { - if (typeof object.source !== "object") - throw TypeError(".google.cloud.securitycenter.v1.CreateSourceRequest.source: object expected"); - message.source = $root.google.cloud.securitycenter.v1.Source.fromObject(object.source); - } + var message = new $root.google.cloud.securitycenter.v1.GetNotificationConfigRequest(); + if (object.name != null) + message.name = String(object.name); return message; }; /** - * Creates a plain object from a CreateSourceRequest message. Also converts values to other types if specified. + * Creates a plain object from a GetNotificationConfigRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.securitycenter.v1.CreateSourceRequest + * @memberof google.cloud.securitycenter.v1.GetNotificationConfigRequest * @static - * @param {google.cloud.securitycenter.v1.CreateSourceRequest} message CreateSourceRequest + * @param {google.cloud.securitycenter.v1.GetNotificationConfigRequest} message GetNotificationConfigRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CreateSourceRequest.toObject = function toObject(message, options) { + GetNotificationConfigRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.parent = ""; - object.source = null; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.source != null && message.hasOwnProperty("source")) - object.source = $root.google.cloud.securitycenter.v1.Source.toObject(message.source, options); + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; return object; }; /** - * Converts this CreateSourceRequest to JSON. + * Converts this GetNotificationConfigRequest to JSON. * @function toJSON - * @memberof google.cloud.securitycenter.v1.CreateSourceRequest + * @memberof google.cloud.securitycenter.v1.GetNotificationConfigRequest * @instance * @returns {Object.} JSON object */ - CreateSourceRequest.prototype.toJSON = function toJSON() { + GetNotificationConfigRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return CreateSourceRequest; + return GetNotificationConfigRequest; })(); - v1.DeleteNotificationConfigRequest = (function() { + v1.GetOrganizationSettingsRequest = (function() { /** - * Properties of a DeleteNotificationConfigRequest. + * Properties of a GetOrganizationSettingsRequest. * @memberof google.cloud.securitycenter.v1 - * @interface IDeleteNotificationConfigRequest - * @property {string|null} [name] DeleteNotificationConfigRequest name + * @interface IGetOrganizationSettingsRequest + * @property {string|null} [name] GetOrganizationSettingsRequest name */ /** - * Constructs a new DeleteNotificationConfigRequest. + * Constructs a new GetOrganizationSettingsRequest. * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents a DeleteNotificationConfigRequest. - * @implements IDeleteNotificationConfigRequest + * @classdesc Represents a GetOrganizationSettingsRequest. + * @implements IGetOrganizationSettingsRequest * @constructor - * @param {google.cloud.securitycenter.v1.IDeleteNotificationConfigRequest=} [properties] Properties to set + * @param {google.cloud.securitycenter.v1.IGetOrganizationSettingsRequest=} [properties] Properties to set */ - function DeleteNotificationConfigRequest(properties) { + function GetOrganizationSettingsRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -7197,35 +9247,35 @@ } /** - * DeleteNotificationConfigRequest name. + * GetOrganizationSettingsRequest name. * @member {string} name - * @memberof google.cloud.securitycenter.v1.DeleteNotificationConfigRequest + * @memberof google.cloud.securitycenter.v1.GetOrganizationSettingsRequest * @instance */ - DeleteNotificationConfigRequest.prototype.name = ""; + GetOrganizationSettingsRequest.prototype.name = ""; /** - * Creates a new DeleteNotificationConfigRequest instance using the specified properties. + * Creates a new GetOrganizationSettingsRequest instance using the specified properties. * @function create - * @memberof google.cloud.securitycenter.v1.DeleteNotificationConfigRequest + * @memberof google.cloud.securitycenter.v1.GetOrganizationSettingsRequest * @static - * @param {google.cloud.securitycenter.v1.IDeleteNotificationConfigRequest=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.DeleteNotificationConfigRequest} DeleteNotificationConfigRequest instance + * @param {google.cloud.securitycenter.v1.IGetOrganizationSettingsRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.GetOrganizationSettingsRequest} GetOrganizationSettingsRequest instance */ - DeleteNotificationConfigRequest.create = function create(properties) { - return new DeleteNotificationConfigRequest(properties); + GetOrganizationSettingsRequest.create = function create(properties) { + return new GetOrganizationSettingsRequest(properties); }; /** - * Encodes the specified DeleteNotificationConfigRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.DeleteNotificationConfigRequest.verify|verify} messages. + * Encodes the specified GetOrganizationSettingsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.GetOrganizationSettingsRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.securitycenter.v1.DeleteNotificationConfigRequest + * @memberof google.cloud.securitycenter.v1.GetOrganizationSettingsRequest * @static - * @param {google.cloud.securitycenter.v1.IDeleteNotificationConfigRequest} message DeleteNotificationConfigRequest message or plain object to encode + * @param {google.cloud.securitycenter.v1.IGetOrganizationSettingsRequest} message GetOrganizationSettingsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DeleteNotificationConfigRequest.encode = function encode(message, writer) { + GetOrganizationSettingsRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.name != null && Object.hasOwnProperty.call(message, "name")) @@ -7234,33 +9284,33 @@ }; /** - * Encodes the specified DeleteNotificationConfigRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.DeleteNotificationConfigRequest.verify|verify} messages. + * Encodes the specified GetOrganizationSettingsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.GetOrganizationSettingsRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.DeleteNotificationConfigRequest + * @memberof google.cloud.securitycenter.v1.GetOrganizationSettingsRequest * @static - * @param {google.cloud.securitycenter.v1.IDeleteNotificationConfigRequest} message DeleteNotificationConfigRequest message or plain object to encode + * @param {google.cloud.securitycenter.v1.IGetOrganizationSettingsRequest} message GetOrganizationSettingsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DeleteNotificationConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { + GetOrganizationSettingsRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a DeleteNotificationConfigRequest message from the specified reader or buffer. + * Decodes a GetOrganizationSettingsRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.securitycenter.v1.DeleteNotificationConfigRequest + * @memberof google.cloud.securitycenter.v1.GetOrganizationSettingsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.DeleteNotificationConfigRequest} DeleteNotificationConfigRequest + * @returns {google.cloud.securitycenter.v1.GetOrganizationSettingsRequest} GetOrganizationSettingsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DeleteNotificationConfigRequest.decode = function decode(reader, length) { + GetOrganizationSettingsRequest.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.cloud.securitycenter.v1.DeleteNotificationConfigRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.GetOrganizationSettingsRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -7276,30 +9326,30 @@ }; /** - * Decodes a DeleteNotificationConfigRequest message from the specified reader or buffer, length delimited. + * Decodes a GetOrganizationSettingsRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.DeleteNotificationConfigRequest + * @memberof google.cloud.securitycenter.v1.GetOrganizationSettingsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.DeleteNotificationConfigRequest} DeleteNotificationConfigRequest + * @returns {google.cloud.securitycenter.v1.GetOrganizationSettingsRequest} GetOrganizationSettingsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DeleteNotificationConfigRequest.decodeDelimited = function decodeDelimited(reader) { + GetOrganizationSettingsRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a DeleteNotificationConfigRequest message. + * Verifies a GetOrganizationSettingsRequest message. * @function verify - * @memberof google.cloud.securitycenter.v1.DeleteNotificationConfigRequest + * @memberof google.cloud.securitycenter.v1.GetOrganizationSettingsRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - DeleteNotificationConfigRequest.verify = function verify(message) { + GetOrganizationSettingsRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.name != null && message.hasOwnProperty("name")) @@ -7309,32 +9359,32 @@ }; /** - * Creates a DeleteNotificationConfigRequest message from a plain object. Also converts values to their respective internal types. + * Creates a GetOrganizationSettingsRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.securitycenter.v1.DeleteNotificationConfigRequest + * @memberof google.cloud.securitycenter.v1.GetOrganizationSettingsRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.DeleteNotificationConfigRequest} DeleteNotificationConfigRequest + * @returns {google.cloud.securitycenter.v1.GetOrganizationSettingsRequest} GetOrganizationSettingsRequest */ - DeleteNotificationConfigRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.DeleteNotificationConfigRequest) + GetOrganizationSettingsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.GetOrganizationSettingsRequest) return object; - var message = new $root.google.cloud.securitycenter.v1.DeleteNotificationConfigRequest(); + var message = new $root.google.cloud.securitycenter.v1.GetOrganizationSettingsRequest(); if (object.name != null) message.name = String(object.name); return message; }; /** - * Creates a plain object from a DeleteNotificationConfigRequest message. Also converts values to other types if specified. + * Creates a plain object from a GetOrganizationSettingsRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.securitycenter.v1.DeleteNotificationConfigRequest + * @memberof google.cloud.securitycenter.v1.GetOrganizationSettingsRequest * @static - * @param {google.cloud.securitycenter.v1.DeleteNotificationConfigRequest} message DeleteNotificationConfigRequest + * @param {google.cloud.securitycenter.v1.GetOrganizationSettingsRequest} message GetOrganizationSettingsRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DeleteNotificationConfigRequest.toObject = function toObject(message, options) { + GetOrganizationSettingsRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; @@ -7346,37 +9396,37 @@ }; /** - * Converts this DeleteNotificationConfigRequest to JSON. + * Converts this GetOrganizationSettingsRequest to JSON. * @function toJSON - * @memberof google.cloud.securitycenter.v1.DeleteNotificationConfigRequest + * @memberof google.cloud.securitycenter.v1.GetOrganizationSettingsRequest * @instance * @returns {Object.} JSON object */ - DeleteNotificationConfigRequest.prototype.toJSON = function toJSON() { + GetOrganizationSettingsRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return DeleteNotificationConfigRequest; + return GetOrganizationSettingsRequest; })(); - v1.GetNotificationConfigRequest = (function() { + v1.GetSourceRequest = (function() { /** - * Properties of a GetNotificationConfigRequest. + * Properties of a GetSourceRequest. * @memberof google.cloud.securitycenter.v1 - * @interface IGetNotificationConfigRequest - * @property {string|null} [name] GetNotificationConfigRequest name + * @interface IGetSourceRequest + * @property {string|null} [name] GetSourceRequest name */ /** - * Constructs a new GetNotificationConfigRequest. + * Constructs a new GetSourceRequest. * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents a GetNotificationConfigRequest. - * @implements IGetNotificationConfigRequest + * @classdesc Represents a GetSourceRequest. + * @implements IGetSourceRequest * @constructor - * @param {google.cloud.securitycenter.v1.IGetNotificationConfigRequest=} [properties] Properties to set + * @param {google.cloud.securitycenter.v1.IGetSourceRequest=} [properties] Properties to set */ - function GetNotificationConfigRequest(properties) { + function GetSourceRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -7384,35 +9434,35 @@ } /** - * GetNotificationConfigRequest name. + * GetSourceRequest name. * @member {string} name - * @memberof google.cloud.securitycenter.v1.GetNotificationConfigRequest + * @memberof google.cloud.securitycenter.v1.GetSourceRequest * @instance */ - GetNotificationConfigRequest.prototype.name = ""; + GetSourceRequest.prototype.name = ""; /** - * Creates a new GetNotificationConfigRequest instance using the specified properties. + * Creates a new GetSourceRequest instance using the specified properties. * @function create - * @memberof google.cloud.securitycenter.v1.GetNotificationConfigRequest + * @memberof google.cloud.securitycenter.v1.GetSourceRequest * @static - * @param {google.cloud.securitycenter.v1.IGetNotificationConfigRequest=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.GetNotificationConfigRequest} GetNotificationConfigRequest instance + * @param {google.cloud.securitycenter.v1.IGetSourceRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.GetSourceRequest} GetSourceRequest instance */ - GetNotificationConfigRequest.create = function create(properties) { - return new GetNotificationConfigRequest(properties); + GetSourceRequest.create = function create(properties) { + return new GetSourceRequest(properties); }; /** - * Encodes the specified GetNotificationConfigRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.GetNotificationConfigRequest.verify|verify} messages. + * Encodes the specified GetSourceRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.GetSourceRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.securitycenter.v1.GetNotificationConfigRequest + * @memberof google.cloud.securitycenter.v1.GetSourceRequest * @static - * @param {google.cloud.securitycenter.v1.IGetNotificationConfigRequest} message GetNotificationConfigRequest message or plain object to encode + * @param {google.cloud.securitycenter.v1.IGetSourceRequest} message GetSourceRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetNotificationConfigRequest.encode = function encode(message, writer) { + GetSourceRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.name != null && Object.hasOwnProperty.call(message, "name")) @@ -7421,33 +9471,33 @@ }; /** - * Encodes the specified GetNotificationConfigRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.GetNotificationConfigRequest.verify|verify} messages. + * Encodes the specified GetSourceRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.GetSourceRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.GetNotificationConfigRequest + * @memberof google.cloud.securitycenter.v1.GetSourceRequest * @static - * @param {google.cloud.securitycenter.v1.IGetNotificationConfigRequest} message GetNotificationConfigRequest message or plain object to encode + * @param {google.cloud.securitycenter.v1.IGetSourceRequest} message GetSourceRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetNotificationConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { + GetSourceRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GetNotificationConfigRequest message from the specified reader or buffer. + * Decodes a GetSourceRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.securitycenter.v1.GetNotificationConfigRequest + * @memberof google.cloud.securitycenter.v1.GetSourceRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.GetNotificationConfigRequest} GetNotificationConfigRequest + * @returns {google.cloud.securitycenter.v1.GetSourceRequest} GetSourceRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetNotificationConfigRequest.decode = function decode(reader, length) { + GetSourceRequest.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.cloud.securitycenter.v1.GetNotificationConfigRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.GetSourceRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -7463,30 +9513,30 @@ }; /** - * Decodes a GetNotificationConfigRequest message from the specified reader or buffer, length delimited. + * Decodes a GetSourceRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.GetNotificationConfigRequest + * @memberof google.cloud.securitycenter.v1.GetSourceRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.GetNotificationConfigRequest} GetNotificationConfigRequest + * @returns {google.cloud.securitycenter.v1.GetSourceRequest} GetSourceRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetNotificationConfigRequest.decodeDelimited = function decodeDelimited(reader) { + GetSourceRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GetNotificationConfigRequest message. + * Verifies a GetSourceRequest message. * @function verify - * @memberof google.cloud.securitycenter.v1.GetNotificationConfigRequest + * @memberof google.cloud.securitycenter.v1.GetSourceRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GetNotificationConfigRequest.verify = function verify(message) { + GetSourceRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.name != null && message.hasOwnProperty("name")) @@ -7496,32 +9546,32 @@ }; /** - * Creates a GetNotificationConfigRequest message from a plain object. Also converts values to their respective internal types. + * Creates a GetSourceRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.securitycenter.v1.GetNotificationConfigRequest + * @memberof google.cloud.securitycenter.v1.GetSourceRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.GetNotificationConfigRequest} GetNotificationConfigRequest + * @returns {google.cloud.securitycenter.v1.GetSourceRequest} GetSourceRequest */ - GetNotificationConfigRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.GetNotificationConfigRequest) + GetSourceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.GetSourceRequest) return object; - var message = new $root.google.cloud.securitycenter.v1.GetNotificationConfigRequest(); + var message = new $root.google.cloud.securitycenter.v1.GetSourceRequest(); if (object.name != null) message.name = String(object.name); return message; }; /** - * Creates a plain object from a GetNotificationConfigRequest message. Also converts values to other types if specified. + * Creates a plain object from a GetSourceRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.securitycenter.v1.GetNotificationConfigRequest + * @memberof google.cloud.securitycenter.v1.GetSourceRequest * @static - * @param {google.cloud.securitycenter.v1.GetNotificationConfigRequest} message GetNotificationConfigRequest + * @param {google.cloud.securitycenter.v1.GetSourceRequest} message GetSourceRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GetNotificationConfigRequest.toObject = function toObject(message, options) { + GetSourceRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; @@ -7533,37 +9583,43 @@ }; /** - * Converts this GetNotificationConfigRequest to JSON. + * Converts this GetSourceRequest to JSON. * @function toJSON - * @memberof google.cloud.securitycenter.v1.GetNotificationConfigRequest + * @memberof google.cloud.securitycenter.v1.GetSourceRequest * @instance * @returns {Object.} JSON object */ - GetNotificationConfigRequest.prototype.toJSON = function toJSON() { + GetSourceRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return GetNotificationConfigRequest; + return GetSourceRequest; })(); - v1.GetOrganizationSettingsRequest = (function() { + v1.GroupAssetsRequest = (function() { /** - * Properties of a GetOrganizationSettingsRequest. + * Properties of a GroupAssetsRequest. * @memberof google.cloud.securitycenter.v1 - * @interface IGetOrganizationSettingsRequest - * @property {string|null} [name] GetOrganizationSettingsRequest name + * @interface IGroupAssetsRequest + * @property {string|null} [parent] GroupAssetsRequest parent + * @property {string|null} [filter] GroupAssetsRequest filter + * @property {string|null} [groupBy] GroupAssetsRequest groupBy + * @property {google.protobuf.IDuration|null} [compareDuration] GroupAssetsRequest compareDuration + * @property {google.protobuf.ITimestamp|null} [readTime] GroupAssetsRequest readTime + * @property {string|null} [pageToken] GroupAssetsRequest pageToken + * @property {number|null} [pageSize] GroupAssetsRequest pageSize */ /** - * Constructs a new GetOrganizationSettingsRequest. + * Constructs a new GroupAssetsRequest. * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents a GetOrganizationSettingsRequest. - * @implements IGetOrganizationSettingsRequest + * @classdesc Represents a GroupAssetsRequest. + * @implements IGroupAssetsRequest * @constructor - * @param {google.cloud.securitycenter.v1.IGetOrganizationSettingsRequest=} [properties] Properties to set + * @param {google.cloud.securitycenter.v1.IGroupAssetsRequest=} [properties] Properties to set */ - function GetOrganizationSettingsRequest(properties) { + function GroupAssetsRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -7571,75 +9627,153 @@ } /** - * GetOrganizationSettingsRequest name. - * @member {string} name - * @memberof google.cloud.securitycenter.v1.GetOrganizationSettingsRequest + * GroupAssetsRequest parent. + * @member {string} parent + * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest * @instance */ - GetOrganizationSettingsRequest.prototype.name = ""; + GroupAssetsRequest.prototype.parent = ""; /** - * Creates a new GetOrganizationSettingsRequest instance using the specified properties. + * GroupAssetsRequest filter. + * @member {string} filter + * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest + * @instance + */ + GroupAssetsRequest.prototype.filter = ""; + + /** + * GroupAssetsRequest groupBy. + * @member {string} groupBy + * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest + * @instance + */ + GroupAssetsRequest.prototype.groupBy = ""; + + /** + * GroupAssetsRequest compareDuration. + * @member {google.protobuf.IDuration|null|undefined} compareDuration + * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest + * @instance + */ + GroupAssetsRequest.prototype.compareDuration = null; + + /** + * GroupAssetsRequest readTime. + * @member {google.protobuf.ITimestamp|null|undefined} readTime + * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest + * @instance + */ + GroupAssetsRequest.prototype.readTime = null; + + /** + * GroupAssetsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest + * @instance + */ + GroupAssetsRequest.prototype.pageToken = ""; + + /** + * GroupAssetsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest + * @instance + */ + GroupAssetsRequest.prototype.pageSize = 0; + + /** + * Creates a new GroupAssetsRequest instance using the specified properties. * @function create - * @memberof google.cloud.securitycenter.v1.GetOrganizationSettingsRequest + * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest * @static - * @param {google.cloud.securitycenter.v1.IGetOrganizationSettingsRequest=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.GetOrganizationSettingsRequest} GetOrganizationSettingsRequest instance + * @param {google.cloud.securitycenter.v1.IGroupAssetsRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.GroupAssetsRequest} GroupAssetsRequest instance */ - GetOrganizationSettingsRequest.create = function create(properties) { - return new GetOrganizationSettingsRequest(properties); + GroupAssetsRequest.create = function create(properties) { + return new GroupAssetsRequest(properties); }; /** - * Encodes the specified GetOrganizationSettingsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.GetOrganizationSettingsRequest.verify|verify} messages. + * Encodes the specified GroupAssetsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.GroupAssetsRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.securitycenter.v1.GetOrganizationSettingsRequest + * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest * @static - * @param {google.cloud.securitycenter.v1.IGetOrganizationSettingsRequest} message GetOrganizationSettingsRequest message or plain object to encode + * @param {google.cloud.securitycenter.v1.IGroupAssetsRequest} message GroupAssetsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetOrganizationSettingsRequest.encode = function encode(message, writer) { + GroupAssetsRequest.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.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); + if (message.groupBy != null && Object.hasOwnProperty.call(message, "groupBy")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.groupBy); + if (message.compareDuration != null && Object.hasOwnProperty.call(message, "compareDuration")) + $root.google.protobuf.Duration.encode(message.compareDuration, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.readTime != null && Object.hasOwnProperty.call(message, "readTime")) + $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.pageToken); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.pageSize); return writer; }; /** - * Encodes the specified GetOrganizationSettingsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.GetOrganizationSettingsRequest.verify|verify} messages. + * Encodes the specified GroupAssetsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.GroupAssetsRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.GetOrganizationSettingsRequest + * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest * @static - * @param {google.cloud.securitycenter.v1.IGetOrganizationSettingsRequest} message GetOrganizationSettingsRequest message or plain object to encode + * @param {google.cloud.securitycenter.v1.IGroupAssetsRequest} message GroupAssetsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetOrganizationSettingsRequest.encodeDelimited = function encodeDelimited(message, writer) { + GroupAssetsRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GetOrganizationSettingsRequest message from the specified reader or buffer. + * Decodes a GroupAssetsRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.securitycenter.v1.GetOrganizationSettingsRequest + * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.GetOrganizationSettingsRequest} GetOrganizationSettingsRequest + * @returns {google.cloud.securitycenter.v1.GroupAssetsRequest} GroupAssetsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetOrganizationSettingsRequest.decode = function decode(reader, length) { + GroupAssetsRequest.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.cloud.securitycenter.v1.GetOrganizationSettingsRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.GroupAssetsRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.name = reader.string(); + message.parent = reader.string(); + break; + case 2: + message.filter = reader.string(); + break; + case 3: + message.groupBy = reader.string(); + break; + case 4: + message.compareDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + case 5: + message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 7: + message.pageToken = reader.string(); + break; + case 8: + message.pageSize = reader.int32(); break; default: reader.skipType(tag & 7); @@ -7650,107 +9784,170 @@ }; /** - * Decodes a GetOrganizationSettingsRequest message from the specified reader or buffer, length delimited. + * Decodes a GroupAssetsRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.GetOrganizationSettingsRequest + * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.GetOrganizationSettingsRequest} GetOrganizationSettingsRequest + * @returns {google.cloud.securitycenter.v1.GroupAssetsRequest} GroupAssetsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetOrganizationSettingsRequest.decodeDelimited = function decodeDelimited(reader) { + GroupAssetsRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GetOrganizationSettingsRequest message. + * Verifies a GroupAssetsRequest message. * @function verify - * @memberof google.cloud.securitycenter.v1.GetOrganizationSettingsRequest + * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GetOrganizationSettingsRequest.verify = function verify(message) { + GroupAssetsRequest.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.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.groupBy != null && message.hasOwnProperty("groupBy")) + if (!$util.isString(message.groupBy)) + return "groupBy: string expected"; + if (message.compareDuration != null && message.hasOwnProperty("compareDuration")) { + var error = $root.google.protobuf.Duration.verify(message.compareDuration); + if (error) + return "compareDuration." + error; + } + if (message.readTime != null && message.hasOwnProperty("readTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.readTime); + if (error) + return "readTime." + error; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; return null; }; /** - * Creates a GetOrganizationSettingsRequest message from a plain object. Also converts values to their respective internal types. + * Creates a GroupAssetsRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.securitycenter.v1.GetOrganizationSettingsRequest + * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.GetOrganizationSettingsRequest} GetOrganizationSettingsRequest + * @returns {google.cloud.securitycenter.v1.GroupAssetsRequest} GroupAssetsRequest */ - GetOrganizationSettingsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.GetOrganizationSettingsRequest) + GroupAssetsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.GroupAssetsRequest) return object; - var message = new $root.google.cloud.securitycenter.v1.GetOrganizationSettingsRequest(); - if (object.name != null) - message.name = String(object.name); + var message = new $root.google.cloud.securitycenter.v1.GroupAssetsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.filter != null) + message.filter = String(object.filter); + if (object.groupBy != null) + message.groupBy = String(object.groupBy); + if (object.compareDuration != null) { + if (typeof object.compareDuration !== "object") + throw TypeError(".google.cloud.securitycenter.v1.GroupAssetsRequest.compareDuration: object expected"); + message.compareDuration = $root.google.protobuf.Duration.fromObject(object.compareDuration); + } + if (object.readTime != null) { + if (typeof object.readTime !== "object") + throw TypeError(".google.cloud.securitycenter.v1.GroupAssetsRequest.readTime: object expected"); + message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); + } + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; return message; }; /** - * Creates a plain object from a GetOrganizationSettingsRequest message. Also converts values to other types if specified. + * Creates a plain object from a GroupAssetsRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.securitycenter.v1.GetOrganizationSettingsRequest + * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest * @static - * @param {google.cloud.securitycenter.v1.GetOrganizationSettingsRequest} message GetOrganizationSettingsRequest + * @param {google.cloud.securitycenter.v1.GroupAssetsRequest} message GroupAssetsRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GetOrganizationSettingsRequest.toObject = function toObject(message, options) { + GroupAssetsRequest.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 (options.defaults) { + object.parent = ""; + object.filter = ""; + object.groupBy = ""; + object.compareDuration = null; + object.readTime = null; + object.pageToken = ""; + object.pageSize = 0; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.groupBy != null && message.hasOwnProperty("groupBy")) + object.groupBy = message.groupBy; + if (message.compareDuration != null && message.hasOwnProperty("compareDuration")) + object.compareDuration = $root.google.protobuf.Duration.toObject(message.compareDuration, options); + if (message.readTime != null && message.hasOwnProperty("readTime")) + object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; return object; }; /** - * Converts this GetOrganizationSettingsRequest to JSON. + * Converts this GroupAssetsRequest to JSON. * @function toJSON - * @memberof google.cloud.securitycenter.v1.GetOrganizationSettingsRequest + * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest * @instance * @returns {Object.} JSON object */ - GetOrganizationSettingsRequest.prototype.toJSON = function toJSON() { + GroupAssetsRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return GetOrganizationSettingsRequest; + return GroupAssetsRequest; })(); - v1.GetSourceRequest = (function() { + v1.GroupAssetsResponse = (function() { /** - * Properties of a GetSourceRequest. + * Properties of a GroupAssetsResponse. * @memberof google.cloud.securitycenter.v1 - * @interface IGetSourceRequest - * @property {string|null} [name] GetSourceRequest name + * @interface IGroupAssetsResponse + * @property {Array.|null} [groupByResults] GroupAssetsResponse groupByResults + * @property {google.protobuf.ITimestamp|null} [readTime] GroupAssetsResponse readTime + * @property {string|null} [nextPageToken] GroupAssetsResponse nextPageToken + * @property {number|null} [totalSize] GroupAssetsResponse totalSize */ /** - * Constructs a new GetSourceRequest. + * Constructs a new GroupAssetsResponse. * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents a GetSourceRequest. - * @implements IGetSourceRequest + * @classdesc Represents a GroupAssetsResponse. + * @implements IGroupAssetsResponse * @constructor - * @param {google.cloud.securitycenter.v1.IGetSourceRequest=} [properties] Properties to set + * @param {google.cloud.securitycenter.v1.IGroupAssetsResponse=} [properties] Properties to set */ - function GetSourceRequest(properties) { + function GroupAssetsResponse(properties) { + this.groupByResults = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -7758,75 +9955,117 @@ } /** - * GetSourceRequest name. - * @member {string} name - * @memberof google.cloud.securitycenter.v1.GetSourceRequest + * GroupAssetsResponse groupByResults. + * @member {Array.} groupByResults + * @memberof google.cloud.securitycenter.v1.GroupAssetsResponse * @instance */ - GetSourceRequest.prototype.name = ""; + GroupAssetsResponse.prototype.groupByResults = $util.emptyArray; /** - * Creates a new GetSourceRequest instance using the specified properties. + * GroupAssetsResponse readTime. + * @member {google.protobuf.ITimestamp|null|undefined} readTime + * @memberof google.cloud.securitycenter.v1.GroupAssetsResponse + * @instance + */ + GroupAssetsResponse.prototype.readTime = null; + + /** + * GroupAssetsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.securitycenter.v1.GroupAssetsResponse + * @instance + */ + GroupAssetsResponse.prototype.nextPageToken = ""; + + /** + * GroupAssetsResponse totalSize. + * @member {number} totalSize + * @memberof google.cloud.securitycenter.v1.GroupAssetsResponse + * @instance + */ + GroupAssetsResponse.prototype.totalSize = 0; + + /** + * Creates a new GroupAssetsResponse instance using the specified properties. * @function create - * @memberof google.cloud.securitycenter.v1.GetSourceRequest + * @memberof google.cloud.securitycenter.v1.GroupAssetsResponse * @static - * @param {google.cloud.securitycenter.v1.IGetSourceRequest=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.GetSourceRequest} GetSourceRequest instance + * @param {google.cloud.securitycenter.v1.IGroupAssetsResponse=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.GroupAssetsResponse} GroupAssetsResponse instance */ - GetSourceRequest.create = function create(properties) { - return new GetSourceRequest(properties); + GroupAssetsResponse.create = function create(properties) { + return new GroupAssetsResponse(properties); }; /** - * Encodes the specified GetSourceRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.GetSourceRequest.verify|verify} messages. + * Encodes the specified GroupAssetsResponse message. Does not implicitly {@link google.cloud.securitycenter.v1.GroupAssetsResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.securitycenter.v1.GetSourceRequest + * @memberof google.cloud.securitycenter.v1.GroupAssetsResponse * @static - * @param {google.cloud.securitycenter.v1.IGetSourceRequest} message GetSourceRequest message or plain object to encode + * @param {google.cloud.securitycenter.v1.IGroupAssetsResponse} message GroupAssetsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetSourceRequest.encode = function encode(message, writer) { + GroupAssetsResponse.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.groupByResults != null && message.groupByResults.length) + for (var i = 0; i < message.groupByResults.length; ++i) + $root.google.cloud.securitycenter.v1.GroupResult.encode(message.groupByResults[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.readTime != null && Object.hasOwnProperty.call(message, "readTime")) + $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.nextPageToken); + if (message.totalSize != null && Object.hasOwnProperty.call(message, "totalSize")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.totalSize); return writer; }; /** - * Encodes the specified GetSourceRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.GetSourceRequest.verify|verify} messages. + * Encodes the specified GroupAssetsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.GroupAssetsResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.GetSourceRequest + * @memberof google.cloud.securitycenter.v1.GroupAssetsResponse * @static - * @param {google.cloud.securitycenter.v1.IGetSourceRequest} message GetSourceRequest message or plain object to encode + * @param {google.cloud.securitycenter.v1.IGroupAssetsResponse} message GroupAssetsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetSourceRequest.encodeDelimited = function encodeDelimited(message, writer) { + GroupAssetsResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GetSourceRequest message from the specified reader or buffer. + * Decodes a GroupAssetsResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.securitycenter.v1.GetSourceRequest + * @memberof google.cloud.securitycenter.v1.GroupAssetsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.GetSourceRequest} GetSourceRequest + * @returns {google.cloud.securitycenter.v1.GroupAssetsResponse} GroupAssetsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetSourceRequest.decode = function decode(reader, length) { + GroupAssetsResponse.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.cloud.securitycenter.v1.GetSourceRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.GroupAssetsResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.name = reader.string(); + if (!(message.groupByResults && message.groupByResults.length)) + message.groupByResults = []; + message.groupByResults.push($root.google.cloud.securitycenter.v1.GroupResult.decode(reader, reader.uint32())); + break; + case 2: + message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 3: + message.nextPageToken = reader.string(); + break; + case 4: + message.totalSize = reader.int32(); break; default: reader.skipType(tag & 7); @@ -7837,113 +10076,161 @@ }; /** - * Decodes a GetSourceRequest message from the specified reader or buffer, length delimited. + * Decodes a GroupAssetsResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.GetSourceRequest + * @memberof google.cloud.securitycenter.v1.GroupAssetsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.GetSourceRequest} GetSourceRequest + * @returns {google.cloud.securitycenter.v1.GroupAssetsResponse} GroupAssetsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetSourceRequest.decodeDelimited = function decodeDelimited(reader) { + GroupAssetsResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GetSourceRequest message. + * Verifies a GroupAssetsResponse message. * @function verify - * @memberof google.cloud.securitycenter.v1.GetSourceRequest + * @memberof google.cloud.securitycenter.v1.GroupAssetsResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GetSourceRequest.verify = function verify(message) { + GroupAssetsResponse.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.groupByResults != null && message.hasOwnProperty("groupByResults")) { + if (!Array.isArray(message.groupByResults)) + return "groupByResults: array expected"; + for (var i = 0; i < message.groupByResults.length; ++i) { + var error = $root.google.cloud.securitycenter.v1.GroupResult.verify(message.groupByResults[i]); + if (error) + return "groupByResults." + error; + } + } + if (message.readTime != null && message.hasOwnProperty("readTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.readTime); + if (error) + return "readTime." + error; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.totalSize != null && message.hasOwnProperty("totalSize")) + if (!$util.isInteger(message.totalSize)) + return "totalSize: integer expected"; return null; }; /** - * Creates a GetSourceRequest message from a plain object. Also converts values to their respective internal types. + * Creates a GroupAssetsResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.securitycenter.v1.GetSourceRequest + * @memberof google.cloud.securitycenter.v1.GroupAssetsResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.GetSourceRequest} GetSourceRequest + * @returns {google.cloud.securitycenter.v1.GroupAssetsResponse} GroupAssetsResponse */ - GetSourceRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.GetSourceRequest) + GroupAssetsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.GroupAssetsResponse) return object; - var message = new $root.google.cloud.securitycenter.v1.GetSourceRequest(); - if (object.name != null) - message.name = String(object.name); + var message = new $root.google.cloud.securitycenter.v1.GroupAssetsResponse(); + if (object.groupByResults) { + if (!Array.isArray(object.groupByResults)) + throw TypeError(".google.cloud.securitycenter.v1.GroupAssetsResponse.groupByResults: array expected"); + message.groupByResults = []; + for (var i = 0; i < object.groupByResults.length; ++i) { + if (typeof object.groupByResults[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v1.GroupAssetsResponse.groupByResults: object expected"); + message.groupByResults[i] = $root.google.cloud.securitycenter.v1.GroupResult.fromObject(object.groupByResults[i]); + } + } + if (object.readTime != null) { + if (typeof object.readTime !== "object") + throw TypeError(".google.cloud.securitycenter.v1.GroupAssetsResponse.readTime: object expected"); + message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.totalSize != null) + message.totalSize = object.totalSize | 0; return message; }; /** - * Creates a plain object from a GetSourceRequest message. Also converts values to other types if specified. + * Creates a plain object from a GroupAssetsResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.securitycenter.v1.GetSourceRequest + * @memberof google.cloud.securitycenter.v1.GroupAssetsResponse * @static - * @param {google.cloud.securitycenter.v1.GetSourceRequest} message GetSourceRequest + * @param {google.cloud.securitycenter.v1.GroupAssetsResponse} message GroupAssetsResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GetSourceRequest.toObject = function toObject(message, options) { + GroupAssetsResponse.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 (options.arrays || options.defaults) + object.groupByResults = []; + if (options.defaults) { + object.readTime = null; + object.nextPageToken = ""; + object.totalSize = 0; + } + if (message.groupByResults && message.groupByResults.length) { + object.groupByResults = []; + for (var j = 0; j < message.groupByResults.length; ++j) + object.groupByResults[j] = $root.google.cloud.securitycenter.v1.GroupResult.toObject(message.groupByResults[j], options); + } + if (message.readTime != null && message.hasOwnProperty("readTime")) + object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.totalSize != null && message.hasOwnProperty("totalSize")) + object.totalSize = message.totalSize; return object; }; /** - * Converts this GetSourceRequest to JSON. + * Converts this GroupAssetsResponse to JSON. * @function toJSON - * @memberof google.cloud.securitycenter.v1.GetSourceRequest + * @memberof google.cloud.securitycenter.v1.GroupAssetsResponse * @instance * @returns {Object.} JSON object */ - GetSourceRequest.prototype.toJSON = function toJSON() { + GroupAssetsResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return GetSourceRequest; + return GroupAssetsResponse; })(); - v1.GroupAssetsRequest = (function() { + v1.GroupFindingsRequest = (function() { /** - * Properties of a GroupAssetsRequest. + * Properties of a GroupFindingsRequest. * @memberof google.cloud.securitycenter.v1 - * @interface IGroupAssetsRequest - * @property {string|null} [parent] GroupAssetsRequest parent - * @property {string|null} [filter] GroupAssetsRequest filter - * @property {string|null} [groupBy] GroupAssetsRequest groupBy - * @property {google.protobuf.IDuration|null} [compareDuration] GroupAssetsRequest compareDuration - * @property {google.protobuf.ITimestamp|null} [readTime] GroupAssetsRequest readTime - * @property {string|null} [pageToken] GroupAssetsRequest pageToken - * @property {number|null} [pageSize] GroupAssetsRequest pageSize + * @interface IGroupFindingsRequest + * @property {string|null} [parent] GroupFindingsRequest parent + * @property {string|null} [filter] GroupFindingsRequest filter + * @property {string|null} [groupBy] GroupFindingsRequest groupBy + * @property {google.protobuf.ITimestamp|null} [readTime] GroupFindingsRequest readTime + * @property {google.protobuf.IDuration|null} [compareDuration] GroupFindingsRequest compareDuration + * @property {string|null} [pageToken] GroupFindingsRequest pageToken + * @property {number|null} [pageSize] GroupFindingsRequest pageSize */ /** - * Constructs a new GroupAssetsRequest. + * Constructs a new GroupFindingsRequest. * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents a GroupAssetsRequest. - * @implements IGroupAssetsRequest + * @classdesc Represents a GroupFindingsRequest. + * @implements IGroupFindingsRequest * @constructor - * @param {google.cloud.securitycenter.v1.IGroupAssetsRequest=} [properties] Properties to set + * @param {google.cloud.securitycenter.v1.IGroupFindingsRequest=} [properties] Properties to set */ - function GroupAssetsRequest(properties) { + function GroupFindingsRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -7951,83 +10238,83 @@ } /** - * GroupAssetsRequest parent. + * GroupFindingsRequest parent. * @member {string} parent - * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest + * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest * @instance */ - GroupAssetsRequest.prototype.parent = ""; + GroupFindingsRequest.prototype.parent = ""; /** - * GroupAssetsRequest filter. + * GroupFindingsRequest filter. * @member {string} filter - * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest + * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest * @instance */ - GroupAssetsRequest.prototype.filter = ""; + GroupFindingsRequest.prototype.filter = ""; /** - * GroupAssetsRequest groupBy. + * GroupFindingsRequest groupBy. * @member {string} groupBy - * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest + * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest * @instance */ - GroupAssetsRequest.prototype.groupBy = ""; + GroupFindingsRequest.prototype.groupBy = ""; /** - * GroupAssetsRequest compareDuration. - * @member {google.protobuf.IDuration|null|undefined} compareDuration - * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest + * GroupFindingsRequest readTime. + * @member {google.protobuf.ITimestamp|null|undefined} readTime + * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest * @instance */ - GroupAssetsRequest.prototype.compareDuration = null; + GroupFindingsRequest.prototype.readTime = null; /** - * GroupAssetsRequest readTime. - * @member {google.protobuf.ITimestamp|null|undefined} readTime - * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest + * GroupFindingsRequest compareDuration. + * @member {google.protobuf.IDuration|null|undefined} compareDuration + * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest * @instance */ - GroupAssetsRequest.prototype.readTime = null; + GroupFindingsRequest.prototype.compareDuration = null; /** - * GroupAssetsRequest pageToken. + * GroupFindingsRequest pageToken. * @member {string} pageToken - * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest + * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest * @instance */ - GroupAssetsRequest.prototype.pageToken = ""; + GroupFindingsRequest.prototype.pageToken = ""; /** - * GroupAssetsRequest pageSize. + * GroupFindingsRequest pageSize. * @member {number} pageSize - * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest + * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest * @instance */ - GroupAssetsRequest.prototype.pageSize = 0; + GroupFindingsRequest.prototype.pageSize = 0; /** - * Creates a new GroupAssetsRequest instance using the specified properties. + * Creates a new GroupFindingsRequest instance using the specified properties. * @function create - * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest + * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest * @static - * @param {google.cloud.securitycenter.v1.IGroupAssetsRequest=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.GroupAssetsRequest} GroupAssetsRequest instance + * @param {google.cloud.securitycenter.v1.IGroupFindingsRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.GroupFindingsRequest} GroupFindingsRequest instance */ - GroupAssetsRequest.create = function create(properties) { - return new GroupAssetsRequest(properties); + GroupFindingsRequest.create = function create(properties) { + return new GroupFindingsRequest(properties); }; /** - * Encodes the specified GroupAssetsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.GroupAssetsRequest.verify|verify} messages. + * Encodes the specified GroupFindingsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.GroupFindingsRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest + * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest * @static - * @param {google.cloud.securitycenter.v1.IGroupAssetsRequest} message GroupAssetsRequest message or plain object to encode + * @param {google.cloud.securitycenter.v1.IGroupFindingsRequest} message GroupFindingsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GroupAssetsRequest.encode = function encode(message, writer) { + GroupFindingsRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) @@ -8036,10 +10323,10 @@ writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); if (message.groupBy != null && Object.hasOwnProperty.call(message, "groupBy")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.groupBy); - if (message.compareDuration != null && Object.hasOwnProperty.call(message, "compareDuration")) - $root.google.protobuf.Duration.encode(message.compareDuration, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); if (message.readTime != null && Object.hasOwnProperty.call(message, "readTime")) - $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.compareDuration != null && Object.hasOwnProperty.call(message, "compareDuration")) + $root.google.protobuf.Duration.encode(message.compareDuration, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) writer.uint32(/* id 7, wireType 2 =*/58).string(message.pageToken); if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) @@ -8048,33 +10335,33 @@ }; /** - * Encodes the specified GroupAssetsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.GroupAssetsRequest.verify|verify} messages. + * Encodes the specified GroupFindingsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.GroupFindingsRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest + * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest * @static - * @param {google.cloud.securitycenter.v1.IGroupAssetsRequest} message GroupAssetsRequest message or plain object to encode + * @param {google.cloud.securitycenter.v1.IGroupFindingsRequest} message GroupFindingsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GroupAssetsRequest.encodeDelimited = function encodeDelimited(message, writer) { + GroupFindingsRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GroupAssetsRequest message from the specified reader or buffer. + * Decodes a GroupFindingsRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest + * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.GroupAssetsRequest} GroupAssetsRequest + * @returns {google.cloud.securitycenter.v1.GroupFindingsRequest} GroupFindingsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GroupAssetsRequest.decode = function decode(reader, length) { + GroupFindingsRequest.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.cloud.securitycenter.v1.GroupAssetsRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.GroupFindingsRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -8088,10 +10375,10 @@ message.groupBy = reader.string(); break; case 4: - message.compareDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; case 5: - message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + message.compareDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); break; case 7: message.pageToken = reader.string(); @@ -8108,30 +10395,30 @@ }; /** - * Decodes a GroupAssetsRequest message from the specified reader or buffer, length delimited. + * Decodes a GroupFindingsRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest + * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.GroupAssetsRequest} GroupAssetsRequest + * @returns {google.cloud.securitycenter.v1.GroupFindingsRequest} GroupFindingsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GroupAssetsRequest.decodeDelimited = function decodeDelimited(reader) { + GroupFindingsRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GroupAssetsRequest message. + * Verifies a GroupFindingsRequest message. * @function verify - * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest + * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GroupAssetsRequest.verify = function verify(message) { + GroupFindingsRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.parent != null && message.hasOwnProperty("parent")) @@ -8143,16 +10430,16 @@ if (message.groupBy != null && message.hasOwnProperty("groupBy")) if (!$util.isString(message.groupBy)) return "groupBy: string expected"; - if (message.compareDuration != null && message.hasOwnProperty("compareDuration")) { - var error = $root.google.protobuf.Duration.verify(message.compareDuration); - if (error) - return "compareDuration." + error; - } if (message.readTime != null && message.hasOwnProperty("readTime")) { var error = $root.google.protobuf.Timestamp.verify(message.readTime); if (error) return "readTime." + error; } + if (message.compareDuration != null && message.hasOwnProperty("compareDuration")) { + var error = $root.google.protobuf.Duration.verify(message.compareDuration); + if (error) + return "compareDuration." + error; + } if (message.pageToken != null && message.hasOwnProperty("pageToken")) if (!$util.isString(message.pageToken)) return "pageToken: string expected"; @@ -8163,33 +10450,33 @@ }; /** - * Creates a GroupAssetsRequest message from a plain object. Also converts values to their respective internal types. + * Creates a GroupFindingsRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest + * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.GroupAssetsRequest} GroupAssetsRequest + * @returns {google.cloud.securitycenter.v1.GroupFindingsRequest} GroupFindingsRequest */ - GroupAssetsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.GroupAssetsRequest) + GroupFindingsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.GroupFindingsRequest) return object; - var message = new $root.google.cloud.securitycenter.v1.GroupAssetsRequest(); + var message = new $root.google.cloud.securitycenter.v1.GroupFindingsRequest(); if (object.parent != null) message.parent = String(object.parent); if (object.filter != null) message.filter = String(object.filter); if (object.groupBy != null) message.groupBy = String(object.groupBy); - if (object.compareDuration != null) { - if (typeof object.compareDuration !== "object") - throw TypeError(".google.cloud.securitycenter.v1.GroupAssetsRequest.compareDuration: object expected"); - message.compareDuration = $root.google.protobuf.Duration.fromObject(object.compareDuration); - } if (object.readTime != null) { if (typeof object.readTime !== "object") - throw TypeError(".google.cloud.securitycenter.v1.GroupAssetsRequest.readTime: object expected"); + throw TypeError(".google.cloud.securitycenter.v1.GroupFindingsRequest.readTime: object expected"); message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); } + if (object.compareDuration != null) { + if (typeof object.compareDuration !== "object") + throw TypeError(".google.cloud.securitycenter.v1.GroupFindingsRequest.compareDuration: object expected"); + message.compareDuration = $root.google.protobuf.Duration.fromObject(object.compareDuration); + } if (object.pageToken != null) message.pageToken = String(object.pageToken); if (object.pageSize != null) @@ -8198,15 +10485,15 @@ }; /** - * Creates a plain object from a GroupAssetsRequest message. Also converts values to other types if specified. + * Creates a plain object from a GroupFindingsRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest + * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest * @static - * @param {google.cloud.securitycenter.v1.GroupAssetsRequest} message GroupAssetsRequest + * @param {google.cloud.securitycenter.v1.GroupFindingsRequest} message GroupFindingsRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GroupAssetsRequest.toObject = function toObject(message, options) { + GroupFindingsRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; @@ -8214,8 +10501,8 @@ object.parent = ""; object.filter = ""; object.groupBy = ""; - object.compareDuration = null; object.readTime = null; + object.compareDuration = null; object.pageToken = ""; object.pageSize = 0; } @@ -8225,10 +10512,10 @@ object.filter = message.filter; if (message.groupBy != null && message.hasOwnProperty("groupBy")) object.groupBy = message.groupBy; - if (message.compareDuration != null && message.hasOwnProperty("compareDuration")) - object.compareDuration = $root.google.protobuf.Duration.toObject(message.compareDuration, options); if (message.readTime != null && message.hasOwnProperty("readTime")) object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); + if (message.compareDuration != null && message.hasOwnProperty("compareDuration")) + object.compareDuration = $root.google.protobuf.Duration.toObject(message.compareDuration, options); if (message.pageToken != null && message.hasOwnProperty("pageToken")) object.pageToken = message.pageToken; if (message.pageSize != null && message.hasOwnProperty("pageSize")) @@ -8237,40 +10524,40 @@ }; /** - * Converts this GroupAssetsRequest to JSON. + * Converts this GroupFindingsRequest to JSON. * @function toJSON - * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest + * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest * @instance * @returns {Object.} JSON object */ - GroupAssetsRequest.prototype.toJSON = function toJSON() { + GroupFindingsRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return GroupAssetsRequest; + return GroupFindingsRequest; })(); - v1.GroupAssetsResponse = (function() { + v1.GroupFindingsResponse = (function() { /** - * Properties of a GroupAssetsResponse. + * Properties of a GroupFindingsResponse. * @memberof google.cloud.securitycenter.v1 - * @interface IGroupAssetsResponse - * @property {Array.|null} [groupByResults] GroupAssetsResponse groupByResults - * @property {google.protobuf.ITimestamp|null} [readTime] GroupAssetsResponse readTime - * @property {string|null} [nextPageToken] GroupAssetsResponse nextPageToken - * @property {number|null} [totalSize] GroupAssetsResponse totalSize + * @interface IGroupFindingsResponse + * @property {Array.|null} [groupByResults] GroupFindingsResponse groupByResults + * @property {google.protobuf.ITimestamp|null} [readTime] GroupFindingsResponse readTime + * @property {string|null} [nextPageToken] GroupFindingsResponse nextPageToken + * @property {number|null} [totalSize] GroupFindingsResponse totalSize */ /** - * Constructs a new GroupAssetsResponse. + * Constructs a new GroupFindingsResponse. * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents a GroupAssetsResponse. - * @implements IGroupAssetsResponse + * @classdesc Represents a GroupFindingsResponse. + * @implements IGroupFindingsResponse * @constructor - * @param {google.cloud.securitycenter.v1.IGroupAssetsResponse=} [properties] Properties to set + * @param {google.cloud.securitycenter.v1.IGroupFindingsResponse=} [properties] Properties to set */ - function GroupAssetsResponse(properties) { + function GroupFindingsResponse(properties) { this.groupByResults = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) @@ -8279,59 +10566,59 @@ } /** - * GroupAssetsResponse groupByResults. + * GroupFindingsResponse groupByResults. * @member {Array.} groupByResults - * @memberof google.cloud.securitycenter.v1.GroupAssetsResponse + * @memberof google.cloud.securitycenter.v1.GroupFindingsResponse * @instance */ - GroupAssetsResponse.prototype.groupByResults = $util.emptyArray; + GroupFindingsResponse.prototype.groupByResults = $util.emptyArray; /** - * GroupAssetsResponse readTime. + * GroupFindingsResponse readTime. * @member {google.protobuf.ITimestamp|null|undefined} readTime - * @memberof google.cloud.securitycenter.v1.GroupAssetsResponse + * @memberof google.cloud.securitycenter.v1.GroupFindingsResponse * @instance */ - GroupAssetsResponse.prototype.readTime = null; + GroupFindingsResponse.prototype.readTime = null; /** - * GroupAssetsResponse nextPageToken. + * GroupFindingsResponse nextPageToken. * @member {string} nextPageToken - * @memberof google.cloud.securitycenter.v1.GroupAssetsResponse + * @memberof google.cloud.securitycenter.v1.GroupFindingsResponse * @instance */ - GroupAssetsResponse.prototype.nextPageToken = ""; + GroupFindingsResponse.prototype.nextPageToken = ""; /** - * GroupAssetsResponse totalSize. + * GroupFindingsResponse totalSize. * @member {number} totalSize - * @memberof google.cloud.securitycenter.v1.GroupAssetsResponse + * @memberof google.cloud.securitycenter.v1.GroupFindingsResponse * @instance */ - GroupAssetsResponse.prototype.totalSize = 0; + GroupFindingsResponse.prototype.totalSize = 0; /** - * Creates a new GroupAssetsResponse instance using the specified properties. + * Creates a new GroupFindingsResponse instance using the specified properties. * @function create - * @memberof google.cloud.securitycenter.v1.GroupAssetsResponse + * @memberof google.cloud.securitycenter.v1.GroupFindingsResponse * @static - * @param {google.cloud.securitycenter.v1.IGroupAssetsResponse=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.GroupAssetsResponse} GroupAssetsResponse instance + * @param {google.cloud.securitycenter.v1.IGroupFindingsResponse=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.GroupFindingsResponse} GroupFindingsResponse instance */ - GroupAssetsResponse.create = function create(properties) { - return new GroupAssetsResponse(properties); + GroupFindingsResponse.create = function create(properties) { + return new GroupFindingsResponse(properties); }; /** - * Encodes the specified GroupAssetsResponse message. Does not implicitly {@link google.cloud.securitycenter.v1.GroupAssetsResponse.verify|verify} messages. + * Encodes the specified GroupFindingsResponse message. Does not implicitly {@link google.cloud.securitycenter.v1.GroupFindingsResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.securitycenter.v1.GroupAssetsResponse + * @memberof google.cloud.securitycenter.v1.GroupFindingsResponse * @static - * @param {google.cloud.securitycenter.v1.IGroupAssetsResponse} message GroupAssetsResponse message or plain object to encode + * @param {google.cloud.securitycenter.v1.IGroupFindingsResponse} message GroupFindingsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GroupAssetsResponse.encode = function encode(message, writer) { + GroupFindingsResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.groupByResults != null && message.groupByResults.length) @@ -8347,33 +10634,33 @@ }; /** - * Encodes the specified GroupAssetsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.GroupAssetsResponse.verify|verify} messages. + * Encodes the specified GroupFindingsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.GroupFindingsResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.GroupAssetsResponse + * @memberof google.cloud.securitycenter.v1.GroupFindingsResponse * @static - * @param {google.cloud.securitycenter.v1.IGroupAssetsResponse} message GroupAssetsResponse message or plain object to encode + * @param {google.cloud.securitycenter.v1.IGroupFindingsResponse} message GroupFindingsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GroupAssetsResponse.encodeDelimited = function encodeDelimited(message, writer) { + GroupFindingsResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GroupAssetsResponse message from the specified reader or buffer. + * Decodes a GroupFindingsResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.securitycenter.v1.GroupAssetsResponse + * @memberof google.cloud.securitycenter.v1.GroupFindingsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.GroupAssetsResponse} GroupAssetsResponse + * @returns {google.cloud.securitycenter.v1.GroupFindingsResponse} GroupFindingsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GroupAssetsResponse.decode = function decode(reader, length) { + GroupFindingsResponse.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.cloud.securitycenter.v1.GroupAssetsResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.GroupFindingsResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -8400,30 +10687,30 @@ }; /** - * Decodes a GroupAssetsResponse message from the specified reader or buffer, length delimited. + * Decodes a GroupFindingsResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.GroupAssetsResponse + * @memberof google.cloud.securitycenter.v1.GroupFindingsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.GroupAssetsResponse} GroupAssetsResponse + * @returns {google.cloud.securitycenter.v1.GroupFindingsResponse} GroupFindingsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GroupAssetsResponse.decodeDelimited = function decodeDelimited(reader) { + GroupFindingsResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GroupAssetsResponse message. + * Verifies a GroupFindingsResponse message. * @function verify - * @memberof google.cloud.securitycenter.v1.GroupAssetsResponse + * @memberof google.cloud.securitycenter.v1.GroupFindingsResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GroupAssetsResponse.verify = function verify(message) { + GroupFindingsResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.groupByResults != null && message.hasOwnProperty("groupByResults")) { @@ -8450,30 +10737,30 @@ }; /** - * Creates a GroupAssetsResponse message from a plain object. Also converts values to their respective internal types. + * Creates a GroupFindingsResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.securitycenter.v1.GroupAssetsResponse + * @memberof google.cloud.securitycenter.v1.GroupFindingsResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.GroupAssetsResponse} GroupAssetsResponse + * @returns {google.cloud.securitycenter.v1.GroupFindingsResponse} GroupFindingsResponse */ - GroupAssetsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.GroupAssetsResponse) + GroupFindingsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.GroupFindingsResponse) return object; - var message = new $root.google.cloud.securitycenter.v1.GroupAssetsResponse(); + var message = new $root.google.cloud.securitycenter.v1.GroupFindingsResponse(); if (object.groupByResults) { if (!Array.isArray(object.groupByResults)) - throw TypeError(".google.cloud.securitycenter.v1.GroupAssetsResponse.groupByResults: array expected"); + throw TypeError(".google.cloud.securitycenter.v1.GroupFindingsResponse.groupByResults: array expected"); message.groupByResults = []; for (var i = 0; i < object.groupByResults.length; ++i) { if (typeof object.groupByResults[i] !== "object") - throw TypeError(".google.cloud.securitycenter.v1.GroupAssetsResponse.groupByResults: object expected"); + throw TypeError(".google.cloud.securitycenter.v1.GroupFindingsResponse.groupByResults: object expected"); message.groupByResults[i] = $root.google.cloud.securitycenter.v1.GroupResult.fromObject(object.groupByResults[i]); } } if (object.readTime != null) { if (typeof object.readTime !== "object") - throw TypeError(".google.cloud.securitycenter.v1.GroupAssetsResponse.readTime: object expected"); + throw TypeError(".google.cloud.securitycenter.v1.GroupFindingsResponse.readTime: object expected"); message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); } if (object.nextPageToken != null) @@ -8484,15 +10771,15 @@ }; /** - * Creates a plain object from a GroupAssetsResponse message. Also converts values to other types if specified. + * Creates a plain object from a GroupFindingsResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.securitycenter.v1.GroupAssetsResponse + * @memberof google.cloud.securitycenter.v1.GroupFindingsResponse * @static - * @param {google.cloud.securitycenter.v1.GroupAssetsResponse} message GroupAssetsResponse + * @param {google.cloud.securitycenter.v1.GroupFindingsResponse} message GroupFindingsResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GroupAssetsResponse.toObject = function toObject(message, options) { + GroupFindingsResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; @@ -8518,43 +10805,39 @@ }; /** - * Converts this GroupAssetsResponse to JSON. + * Converts this GroupFindingsResponse to JSON. * @function toJSON - * @memberof google.cloud.securitycenter.v1.GroupAssetsResponse + * @memberof google.cloud.securitycenter.v1.GroupFindingsResponse * @instance * @returns {Object.} JSON object */ - GroupAssetsResponse.prototype.toJSON = function toJSON() { + GroupFindingsResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return GroupAssetsResponse; + return GroupFindingsResponse; })(); - v1.GroupFindingsRequest = (function() { + v1.GroupResult = (function() { /** - * Properties of a GroupFindingsRequest. + * Properties of a GroupResult. * @memberof google.cloud.securitycenter.v1 - * @interface IGroupFindingsRequest - * @property {string|null} [parent] GroupFindingsRequest parent - * @property {string|null} [filter] GroupFindingsRequest filter - * @property {string|null} [groupBy] GroupFindingsRequest groupBy - * @property {google.protobuf.ITimestamp|null} [readTime] GroupFindingsRequest readTime - * @property {google.protobuf.IDuration|null} [compareDuration] GroupFindingsRequest compareDuration - * @property {string|null} [pageToken] GroupFindingsRequest pageToken - * @property {number|null} [pageSize] GroupFindingsRequest pageSize + * @interface IGroupResult + * @property {Object.|null} [properties] GroupResult properties + * @property {number|Long|null} [count] GroupResult count */ /** - * Constructs a new GroupFindingsRequest. + * Constructs a new GroupResult. * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents a GroupFindingsRequest. - * @implements IGroupFindingsRequest + * @classdesc Represents a GroupResult. + * @implements IGroupResult * @constructor - * @param {google.cloud.securitycenter.v1.IGroupFindingsRequest=} [properties] Properties to set + * @param {google.cloud.securitycenter.v1.IGroupResult=} [properties] Properties to set */ - function GroupFindingsRequest(properties) { + function GroupResult(properties) { + this.properties = {}; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -8562,153 +10845,110 @@ } /** - * GroupFindingsRequest parent. - * @member {string} parent - * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest - * @instance - */ - GroupFindingsRequest.prototype.parent = ""; - - /** - * GroupFindingsRequest filter. - * @member {string} filter - * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest - * @instance - */ - GroupFindingsRequest.prototype.filter = ""; - - /** - * GroupFindingsRequest groupBy. - * @member {string} groupBy - * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest - * @instance - */ - GroupFindingsRequest.prototype.groupBy = ""; - - /** - * GroupFindingsRequest readTime. - * @member {google.protobuf.ITimestamp|null|undefined} readTime - * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest - * @instance - */ - GroupFindingsRequest.prototype.readTime = null; - - /** - * GroupFindingsRequest compareDuration. - * @member {google.protobuf.IDuration|null|undefined} compareDuration - * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest - * @instance - */ - GroupFindingsRequest.prototype.compareDuration = null; - - /** - * GroupFindingsRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest + * GroupResult properties. + * @member {Object.} properties + * @memberof google.cloud.securitycenter.v1.GroupResult * @instance */ - GroupFindingsRequest.prototype.pageToken = ""; + GroupResult.prototype.properties = $util.emptyObject; /** - * GroupFindingsRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest + * GroupResult count. + * @member {number|Long} count + * @memberof google.cloud.securitycenter.v1.GroupResult * @instance */ - GroupFindingsRequest.prototype.pageSize = 0; + GroupResult.prototype.count = $util.Long ? $util.Long.fromBits(0,0,false) : 0; /** - * Creates a new GroupFindingsRequest instance using the specified properties. + * Creates a new GroupResult instance using the specified properties. * @function create - * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest + * @memberof google.cloud.securitycenter.v1.GroupResult * @static - * @param {google.cloud.securitycenter.v1.IGroupFindingsRequest=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.GroupFindingsRequest} GroupFindingsRequest instance + * @param {google.cloud.securitycenter.v1.IGroupResult=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.GroupResult} GroupResult instance */ - GroupFindingsRequest.create = function create(properties) { - return new GroupFindingsRequest(properties); + GroupResult.create = function create(properties) { + return new GroupResult(properties); }; /** - * Encodes the specified GroupFindingsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.GroupFindingsRequest.verify|verify} messages. + * Encodes the specified GroupResult message. Does not implicitly {@link google.cloud.securitycenter.v1.GroupResult.verify|verify} messages. * @function encode - * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest + * @memberof google.cloud.securitycenter.v1.GroupResult * @static - * @param {google.cloud.securitycenter.v1.IGroupFindingsRequest} message GroupFindingsRequest message or plain object to encode + * @param {google.cloud.securitycenter.v1.IGroupResult} message GroupResult message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GroupFindingsRequest.encode = function encode(message, writer) { + GroupResult.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); - if (message.groupBy != null && Object.hasOwnProperty.call(message, "groupBy")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.groupBy); - if (message.readTime != null && Object.hasOwnProperty.call(message, "readTime")) - $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.compareDuration != null && Object.hasOwnProperty.call(message, "compareDuration")) - $root.google.protobuf.Duration.encode(message.compareDuration, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.pageToken); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 8, wireType 0 =*/64).int32(message.pageSize); + if (message.properties != null && Object.hasOwnProperty.call(message, "properties")) + for (var keys = Object.keys(message.properties), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.protobuf.Value.encode(message.properties[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.count != null && Object.hasOwnProperty.call(message, "count")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.count); return writer; }; /** - * Encodes the specified GroupFindingsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.GroupFindingsRequest.verify|verify} messages. + * Encodes the specified GroupResult message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.GroupResult.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest + * @memberof google.cloud.securitycenter.v1.GroupResult * @static - * @param {google.cloud.securitycenter.v1.IGroupFindingsRequest} message GroupFindingsRequest message or plain object to encode + * @param {google.cloud.securitycenter.v1.IGroupResult} message GroupResult message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GroupFindingsRequest.encodeDelimited = function encodeDelimited(message, writer) { + GroupResult.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GroupFindingsRequest message from the specified reader or buffer. + * Decodes a GroupResult message from the specified reader or buffer. * @function decode - * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest + * @memberof google.cloud.securitycenter.v1.GroupResult * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.GroupFindingsRequest} GroupFindingsRequest + * @returns {google.cloud.securitycenter.v1.GroupResult} GroupResult * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GroupFindingsRequest.decode = function decode(reader, length) { + GroupResult.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.cloud.securitycenter.v1.GroupFindingsRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.GroupResult(), key, value; while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.parent = reader.string(); + if (message.properties === $util.emptyObject) + message.properties = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.protobuf.Value.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.properties[key] = value; break; case 2: - message.filter = reader.string(); - break; - case 3: - message.groupBy = reader.string(); - break; - case 4: - message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 5: - message.compareDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - case 7: - message.pageToken = reader.string(); - break; - case 8: - message.pageSize = reader.int32(); + message.count = reader.int64(); break; default: reader.skipType(tag & 7); @@ -8719,170 +10959,151 @@ }; /** - * Decodes a GroupFindingsRequest message from the specified reader or buffer, length delimited. + * Decodes a GroupResult message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest + * @memberof google.cloud.securitycenter.v1.GroupResult * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.GroupFindingsRequest} GroupFindingsRequest + * @returns {google.cloud.securitycenter.v1.GroupResult} GroupResult * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GroupFindingsRequest.decodeDelimited = function decodeDelimited(reader) { + GroupResult.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GroupFindingsRequest message. + * Verifies a GroupResult message. * @function verify - * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest + * @memberof google.cloud.securitycenter.v1.GroupResult * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GroupFindingsRequest.verify = function verify(message) { + GroupResult.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.filter != null && message.hasOwnProperty("filter")) - if (!$util.isString(message.filter)) - return "filter: string expected"; - if (message.groupBy != null && message.hasOwnProperty("groupBy")) - if (!$util.isString(message.groupBy)) - return "groupBy: string expected"; - if (message.readTime != null && message.hasOwnProperty("readTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.readTime); - if (error) - return "readTime." + error; - } - if (message.compareDuration != null && message.hasOwnProperty("compareDuration")) { - var error = $root.google.protobuf.Duration.verify(message.compareDuration); - if (error) - return "compareDuration." + error; + if (message.properties != null && message.hasOwnProperty("properties")) { + if (!$util.isObject(message.properties)) + return "properties: object expected"; + var key = Object.keys(message.properties); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.protobuf.Value.verify(message.properties[key[i]]); + if (error) + return "properties." + error; + } } - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; + if (message.count != null && message.hasOwnProperty("count")) + if (!$util.isInteger(message.count) && !(message.count && $util.isInteger(message.count.low) && $util.isInteger(message.count.high))) + return "count: integer|Long expected"; return null; }; /** - * Creates a GroupFindingsRequest message from a plain object. Also converts values to their respective internal types. + * Creates a GroupResult message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest + * @memberof google.cloud.securitycenter.v1.GroupResult * @static * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.GroupFindingsRequest} GroupFindingsRequest + * @returns {google.cloud.securitycenter.v1.GroupResult} GroupResult */ - GroupFindingsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.GroupFindingsRequest) + GroupResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.GroupResult) return object; - var message = new $root.google.cloud.securitycenter.v1.GroupFindingsRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.filter != null) - message.filter = String(object.filter); - if (object.groupBy != null) - message.groupBy = String(object.groupBy); - if (object.readTime != null) { - if (typeof object.readTime !== "object") - throw TypeError(".google.cloud.securitycenter.v1.GroupFindingsRequest.readTime: object expected"); - message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); - } - if (object.compareDuration != null) { - if (typeof object.compareDuration !== "object") - throw TypeError(".google.cloud.securitycenter.v1.GroupFindingsRequest.compareDuration: object expected"); - message.compareDuration = $root.google.protobuf.Duration.fromObject(object.compareDuration); + var message = new $root.google.cloud.securitycenter.v1.GroupResult(); + if (object.properties) { + if (typeof object.properties !== "object") + throw TypeError(".google.cloud.securitycenter.v1.GroupResult.properties: object expected"); + message.properties = {}; + for (var keys = Object.keys(object.properties), i = 0; i < keys.length; ++i) { + if (typeof object.properties[keys[i]] !== "object") + throw TypeError(".google.cloud.securitycenter.v1.GroupResult.properties: object expected"); + message.properties[keys[i]] = $root.google.protobuf.Value.fromObject(object.properties[keys[i]]); + } } - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; + if (object.count != null) + if ($util.Long) + (message.count = $util.Long.fromValue(object.count)).unsigned = false; + else if (typeof object.count === "string") + message.count = parseInt(object.count, 10); + else if (typeof object.count === "number") + message.count = object.count; + else if (typeof object.count === "object") + message.count = new $util.LongBits(object.count.low >>> 0, object.count.high >>> 0).toNumber(); return message; }; /** - * Creates a plain object from a GroupFindingsRequest message. Also converts values to other types if specified. + * Creates a plain object from a GroupResult message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest + * @memberof google.cloud.securitycenter.v1.GroupResult * @static - * @param {google.cloud.securitycenter.v1.GroupFindingsRequest} message GroupFindingsRequest + * @param {google.cloud.securitycenter.v1.GroupResult} message GroupResult * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GroupFindingsRequest.toObject = function toObject(message, options) { + GroupResult.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.parent = ""; - object.filter = ""; - object.groupBy = ""; - object.readTime = null; - object.compareDuration = null; - object.pageToken = ""; - object.pageSize = 0; + if (options.objects || options.defaults) + object.properties = {}; + if (options.defaults) + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.count = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.count = options.longs === String ? "0" : 0; + var keys2; + if (message.properties && (keys2 = Object.keys(message.properties)).length) { + object.properties = {}; + for (var j = 0; j < keys2.length; ++j) + object.properties[keys2[j]] = $root.google.protobuf.Value.toObject(message.properties[keys2[j]], options); } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.filter != null && message.hasOwnProperty("filter")) - object.filter = message.filter; - if (message.groupBy != null && message.hasOwnProperty("groupBy")) - object.groupBy = message.groupBy; - if (message.readTime != null && message.hasOwnProperty("readTime")) - object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); - if (message.compareDuration != null && message.hasOwnProperty("compareDuration")) - object.compareDuration = $root.google.protobuf.Duration.toObject(message.compareDuration, options); - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; + if (message.count != null && message.hasOwnProperty("count")) + if (typeof message.count === "number") + object.count = options.longs === String ? String(message.count) : message.count; + else + object.count = options.longs === String ? $util.Long.prototype.toString.call(message.count) : options.longs === Number ? new $util.LongBits(message.count.low >>> 0, message.count.high >>> 0).toNumber() : message.count; return object; }; /** - * Converts this GroupFindingsRequest to JSON. + * Converts this GroupResult to JSON. * @function toJSON - * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest + * @memberof google.cloud.securitycenter.v1.GroupResult * @instance * @returns {Object.} JSON object */ - GroupFindingsRequest.prototype.toJSON = function toJSON() { + GroupResult.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return GroupFindingsRequest; + return GroupResult; })(); - v1.GroupFindingsResponse = (function() { + v1.ListMuteConfigsRequest = (function() { /** - * Properties of a GroupFindingsResponse. + * Properties of a ListMuteConfigsRequest. * @memberof google.cloud.securitycenter.v1 - * @interface IGroupFindingsResponse - * @property {Array.|null} [groupByResults] GroupFindingsResponse groupByResults - * @property {google.protobuf.ITimestamp|null} [readTime] GroupFindingsResponse readTime - * @property {string|null} [nextPageToken] GroupFindingsResponse nextPageToken - * @property {number|null} [totalSize] GroupFindingsResponse totalSize + * @interface IListMuteConfigsRequest + * @property {string|null} [parent] ListMuteConfigsRequest parent + * @property {number|null} [pageSize] ListMuteConfigsRequest pageSize + * @property {string|null} [pageToken] ListMuteConfigsRequest pageToken */ /** - * Constructs a new GroupFindingsResponse. + * Constructs a new ListMuteConfigsRequest. * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents a GroupFindingsResponse. - * @implements IGroupFindingsResponse + * @classdesc Represents a ListMuteConfigsRequest. + * @implements IListMuteConfigsRequest * @constructor - * @param {google.cloud.securitycenter.v1.IGroupFindingsResponse=} [properties] Properties to set + * @param {google.cloud.securitycenter.v1.IListMuteConfigsRequest=} [properties] Properties to set */ - function GroupFindingsResponse(properties) { - this.groupByResults = []; + function ListMuteConfigsRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -8890,117 +11111,101 @@ } /** - * GroupFindingsResponse groupByResults. - * @member {Array.} groupByResults - * @memberof google.cloud.securitycenter.v1.GroupFindingsResponse - * @instance - */ - GroupFindingsResponse.prototype.groupByResults = $util.emptyArray; - - /** - * GroupFindingsResponse readTime. - * @member {google.protobuf.ITimestamp|null|undefined} readTime - * @memberof google.cloud.securitycenter.v1.GroupFindingsResponse + * ListMuteConfigsRequest parent. + * @member {string} parent + * @memberof google.cloud.securitycenter.v1.ListMuteConfigsRequest * @instance */ - GroupFindingsResponse.prototype.readTime = null; + ListMuteConfigsRequest.prototype.parent = ""; /** - * GroupFindingsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.securitycenter.v1.GroupFindingsResponse + * ListMuteConfigsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.securitycenter.v1.ListMuteConfigsRequest * @instance */ - GroupFindingsResponse.prototype.nextPageToken = ""; + ListMuteConfigsRequest.prototype.pageSize = 0; /** - * GroupFindingsResponse totalSize. - * @member {number} totalSize - * @memberof google.cloud.securitycenter.v1.GroupFindingsResponse + * ListMuteConfigsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.securitycenter.v1.ListMuteConfigsRequest * @instance */ - GroupFindingsResponse.prototype.totalSize = 0; + ListMuteConfigsRequest.prototype.pageToken = ""; /** - * Creates a new GroupFindingsResponse instance using the specified properties. + * Creates a new ListMuteConfigsRequest instance using the specified properties. * @function create - * @memberof google.cloud.securitycenter.v1.GroupFindingsResponse + * @memberof google.cloud.securitycenter.v1.ListMuteConfigsRequest * @static - * @param {google.cloud.securitycenter.v1.IGroupFindingsResponse=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.GroupFindingsResponse} GroupFindingsResponse instance + * @param {google.cloud.securitycenter.v1.IListMuteConfigsRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.ListMuteConfigsRequest} ListMuteConfigsRequest instance */ - GroupFindingsResponse.create = function create(properties) { - return new GroupFindingsResponse(properties); + ListMuteConfigsRequest.create = function create(properties) { + return new ListMuteConfigsRequest(properties); }; /** - * Encodes the specified GroupFindingsResponse message. Does not implicitly {@link google.cloud.securitycenter.v1.GroupFindingsResponse.verify|verify} messages. + * Encodes the specified ListMuteConfigsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.ListMuteConfigsRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.securitycenter.v1.GroupFindingsResponse + * @memberof google.cloud.securitycenter.v1.ListMuteConfigsRequest * @static - * @param {google.cloud.securitycenter.v1.IGroupFindingsResponse} message GroupFindingsResponse message or plain object to encode + * @param {google.cloud.securitycenter.v1.IListMuteConfigsRequest} message ListMuteConfigsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GroupFindingsResponse.encode = function encode(message, writer) { + ListMuteConfigsRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.groupByResults != null && message.groupByResults.length) - for (var i = 0; i < message.groupByResults.length; ++i) - $root.google.cloud.securitycenter.v1.GroupResult.encode(message.groupByResults[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.readTime != null && Object.hasOwnProperty.call(message, "readTime")) - $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.nextPageToken); - if (message.totalSize != null && Object.hasOwnProperty.call(message, "totalSize")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.totalSize); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); return writer; }; /** - * Encodes the specified GroupFindingsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.GroupFindingsResponse.verify|verify} messages. + * Encodes the specified ListMuteConfigsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListMuteConfigsRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.GroupFindingsResponse + * @memberof google.cloud.securitycenter.v1.ListMuteConfigsRequest * @static - * @param {google.cloud.securitycenter.v1.IGroupFindingsResponse} message GroupFindingsResponse message or plain object to encode + * @param {google.cloud.securitycenter.v1.IListMuteConfigsRequest} message ListMuteConfigsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GroupFindingsResponse.encodeDelimited = function encodeDelimited(message, writer) { + ListMuteConfigsRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GroupFindingsResponse message from the specified reader or buffer. + * Decodes a ListMuteConfigsRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.securitycenter.v1.GroupFindingsResponse + * @memberof google.cloud.securitycenter.v1.ListMuteConfigsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.GroupFindingsResponse} GroupFindingsResponse + * @returns {google.cloud.securitycenter.v1.ListMuteConfigsRequest} ListMuteConfigsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GroupFindingsResponse.decode = function decode(reader, length) { + ListMuteConfigsRequest.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.cloud.securitycenter.v1.GroupFindingsResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.ListMuteConfigsRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - if (!(message.groupByResults && message.groupByResults.length)) - message.groupByResults = []; - message.groupByResults.push($root.google.cloud.securitycenter.v1.GroupResult.decode(reader, reader.uint32())); + message.parent = reader.string(); break; case 2: - message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + message.pageSize = reader.int32(); break; case 3: - message.nextPageToken = reader.string(); - break; - case 4: - message.totalSize = reader.int32(); + message.pageToken = reader.string(); break; default: reader.skipType(tag & 7); @@ -9011,157 +11216,126 @@ }; /** - * Decodes a GroupFindingsResponse message from the specified reader or buffer, length delimited. + * Decodes a ListMuteConfigsRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.GroupFindingsResponse + * @memberof google.cloud.securitycenter.v1.ListMuteConfigsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.GroupFindingsResponse} GroupFindingsResponse + * @returns {google.cloud.securitycenter.v1.ListMuteConfigsRequest} ListMuteConfigsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GroupFindingsResponse.decodeDelimited = function decodeDelimited(reader) { + ListMuteConfigsRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GroupFindingsResponse message. + * Verifies a ListMuteConfigsRequest message. * @function verify - * @memberof google.cloud.securitycenter.v1.GroupFindingsResponse + * @memberof google.cloud.securitycenter.v1.ListMuteConfigsRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GroupFindingsResponse.verify = function verify(message) { + ListMuteConfigsRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.groupByResults != null && message.hasOwnProperty("groupByResults")) { - if (!Array.isArray(message.groupByResults)) - return "groupByResults: array expected"; - for (var i = 0; i < message.groupByResults.length; ++i) { - var error = $root.google.cloud.securitycenter.v1.GroupResult.verify(message.groupByResults[i]); - if (error) - return "groupByResults." + error; - } - } - if (message.readTime != null && message.hasOwnProperty("readTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.readTime); - if (error) - return "readTime." + error; - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - if (message.totalSize != null && message.hasOwnProperty("totalSize")) - if (!$util.isInteger(message.totalSize)) - return "totalSize: integer expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; return null; }; /** - * Creates a GroupFindingsResponse message from a plain object. Also converts values to their respective internal types. + * Creates a ListMuteConfigsRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.securitycenter.v1.GroupFindingsResponse + * @memberof google.cloud.securitycenter.v1.ListMuteConfigsRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.GroupFindingsResponse} GroupFindingsResponse + * @returns {google.cloud.securitycenter.v1.ListMuteConfigsRequest} ListMuteConfigsRequest */ - GroupFindingsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.GroupFindingsResponse) + ListMuteConfigsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.ListMuteConfigsRequest) return object; - var message = new $root.google.cloud.securitycenter.v1.GroupFindingsResponse(); - if (object.groupByResults) { - if (!Array.isArray(object.groupByResults)) - throw TypeError(".google.cloud.securitycenter.v1.GroupFindingsResponse.groupByResults: array expected"); - message.groupByResults = []; - for (var i = 0; i < object.groupByResults.length; ++i) { - if (typeof object.groupByResults[i] !== "object") - throw TypeError(".google.cloud.securitycenter.v1.GroupFindingsResponse.groupByResults: object expected"); - message.groupByResults[i] = $root.google.cloud.securitycenter.v1.GroupResult.fromObject(object.groupByResults[i]); - } - } - if (object.readTime != null) { - if (typeof object.readTime !== "object") - throw TypeError(".google.cloud.securitycenter.v1.GroupFindingsResponse.readTime: object expected"); - message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - if (object.totalSize != null) - message.totalSize = object.totalSize | 0; + var message = new $root.google.cloud.securitycenter.v1.ListMuteConfigsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); return message; }; /** - * Creates a plain object from a GroupFindingsResponse message. Also converts values to other types if specified. + * Creates a plain object from a ListMuteConfigsRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.securitycenter.v1.GroupFindingsResponse + * @memberof google.cloud.securitycenter.v1.ListMuteConfigsRequest * @static - * @param {google.cloud.securitycenter.v1.GroupFindingsResponse} message GroupFindingsResponse + * @param {google.cloud.securitycenter.v1.ListMuteConfigsRequest} message ListMuteConfigsRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GroupFindingsResponse.toObject = function toObject(message, options) { + ListMuteConfigsRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.groupByResults = []; if (options.defaults) { - object.readTime = null; - object.nextPageToken = ""; - object.totalSize = 0; - } - if (message.groupByResults && message.groupByResults.length) { - object.groupByResults = []; - for (var j = 0; j < message.groupByResults.length; ++j) - object.groupByResults[j] = $root.google.cloud.securitycenter.v1.GroupResult.toObject(message.groupByResults[j], options); + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; } - if (message.readTime != null && message.hasOwnProperty("readTime")) - object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - if (message.totalSize != null && message.hasOwnProperty("totalSize")) - object.totalSize = message.totalSize; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; return object; }; /** - * Converts this GroupFindingsResponse to JSON. + * Converts this ListMuteConfigsRequest to JSON. * @function toJSON - * @memberof google.cloud.securitycenter.v1.GroupFindingsResponse + * @memberof google.cloud.securitycenter.v1.ListMuteConfigsRequest * @instance * @returns {Object.} JSON object */ - GroupFindingsResponse.prototype.toJSON = function toJSON() { + ListMuteConfigsRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return GroupFindingsResponse; + return ListMuteConfigsRequest; })(); - v1.GroupResult = (function() { + v1.ListMuteConfigsResponse = (function() { /** - * Properties of a GroupResult. + * Properties of a ListMuteConfigsResponse. * @memberof google.cloud.securitycenter.v1 - * @interface IGroupResult - * @property {Object.|null} [properties] GroupResult properties - * @property {number|Long|null} [count] GroupResult count + * @interface IListMuteConfigsResponse + * @property {Array.|null} [muteConfigs] ListMuteConfigsResponse muteConfigs + * @property {string|null} [nextPageToken] ListMuteConfigsResponse nextPageToken */ /** - * Constructs a new GroupResult. + * Constructs a new ListMuteConfigsResponse. * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents a GroupResult. - * @implements IGroupResult + * @classdesc Represents a ListMuteConfigsResponse. + * @implements IListMuteConfigsResponse * @constructor - * @param {google.cloud.securitycenter.v1.IGroupResult=} [properties] Properties to set + * @param {google.cloud.securitycenter.v1.IListMuteConfigsResponse=} [properties] Properties to set */ - function GroupResult(properties) { - this.properties = {}; + function ListMuteConfigsResponse(properties) { + this.muteConfigs = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -9169,110 +11343,91 @@ } /** - * GroupResult properties. - * @member {Object.} properties - * @memberof google.cloud.securitycenter.v1.GroupResult + * ListMuteConfigsResponse muteConfigs. + * @member {Array.} muteConfigs + * @memberof google.cloud.securitycenter.v1.ListMuteConfigsResponse * @instance */ - GroupResult.prototype.properties = $util.emptyObject; + ListMuteConfigsResponse.prototype.muteConfigs = $util.emptyArray; /** - * GroupResult count. - * @member {number|Long} count - * @memberof google.cloud.securitycenter.v1.GroupResult + * ListMuteConfigsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.securitycenter.v1.ListMuteConfigsResponse * @instance */ - GroupResult.prototype.count = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + ListMuteConfigsResponse.prototype.nextPageToken = ""; /** - * Creates a new GroupResult instance using the specified properties. + * Creates a new ListMuteConfigsResponse instance using the specified properties. * @function create - * @memberof google.cloud.securitycenter.v1.GroupResult + * @memberof google.cloud.securitycenter.v1.ListMuteConfigsResponse * @static - * @param {google.cloud.securitycenter.v1.IGroupResult=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.GroupResult} GroupResult instance + * @param {google.cloud.securitycenter.v1.IListMuteConfigsResponse=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.ListMuteConfigsResponse} ListMuteConfigsResponse instance */ - GroupResult.create = function create(properties) { - return new GroupResult(properties); + ListMuteConfigsResponse.create = function create(properties) { + return new ListMuteConfigsResponse(properties); }; /** - * Encodes the specified GroupResult message. Does not implicitly {@link google.cloud.securitycenter.v1.GroupResult.verify|verify} messages. + * Encodes the specified ListMuteConfigsResponse message. Does not implicitly {@link google.cloud.securitycenter.v1.ListMuteConfigsResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.securitycenter.v1.GroupResult + * @memberof google.cloud.securitycenter.v1.ListMuteConfigsResponse * @static - * @param {google.cloud.securitycenter.v1.IGroupResult} message GroupResult message or plain object to encode + * @param {google.cloud.securitycenter.v1.IListMuteConfigsResponse} message ListMuteConfigsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GroupResult.encode = function encode(message, writer) { + ListMuteConfigsResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.properties != null && Object.hasOwnProperty.call(message, "properties")) - for (var keys = Object.keys(message.properties), i = 0; i < keys.length; ++i) { - writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); - $root.google.protobuf.Value.encode(message.properties[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); - } - if (message.count != null && Object.hasOwnProperty.call(message, "count")) - writer.uint32(/* id 2, wireType 0 =*/16).int64(message.count); + if (message.muteConfigs != null && message.muteConfigs.length) + for (var i = 0; i < message.muteConfigs.length; ++i) + $root.google.cloud.securitycenter.v1.MuteConfig.encode(message.muteConfigs[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); return writer; }; /** - * Encodes the specified GroupResult message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.GroupResult.verify|verify} messages. + * Encodes the specified ListMuteConfigsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListMuteConfigsResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.GroupResult + * @memberof google.cloud.securitycenter.v1.ListMuteConfigsResponse * @static - * @param {google.cloud.securitycenter.v1.IGroupResult} message GroupResult message or plain object to encode + * @param {google.cloud.securitycenter.v1.IListMuteConfigsResponse} message ListMuteConfigsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GroupResult.encodeDelimited = function encodeDelimited(message, writer) { + ListMuteConfigsResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GroupResult message from the specified reader or buffer. + * Decodes a ListMuteConfigsResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.securitycenter.v1.GroupResult + * @memberof google.cloud.securitycenter.v1.ListMuteConfigsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.GroupResult} GroupResult + * @returns {google.cloud.securitycenter.v1.ListMuteConfigsResponse} ListMuteConfigsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GroupResult.decode = function decode(reader, length) { + ListMuteConfigsResponse.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.cloud.securitycenter.v1.GroupResult(), key, value; + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.ListMuteConfigsResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - if (message.properties === $util.emptyObject) - message.properties = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = null; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = $root.google.protobuf.Value.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.properties[key] = value; + if (!(message.muteConfigs && message.muteConfigs.length)) + message.muteConfigs = []; + message.muteConfigs.push($root.google.cloud.securitycenter.v1.MuteConfig.decode(reader, reader.uint32())); break; case 2: - message.count = reader.int64(); + message.nextPageToken = reader.string(); break; default: reader.skipType(tag & 7); @@ -9283,129 +11438,113 @@ }; /** - * Decodes a GroupResult message from the specified reader or buffer, length delimited. + * Decodes a ListMuteConfigsResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.GroupResult + * @memberof google.cloud.securitycenter.v1.ListMuteConfigsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.GroupResult} GroupResult + * @returns {google.cloud.securitycenter.v1.ListMuteConfigsResponse} ListMuteConfigsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GroupResult.decodeDelimited = function decodeDelimited(reader) { + ListMuteConfigsResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GroupResult message. + * Verifies a ListMuteConfigsResponse message. * @function verify - * @memberof google.cloud.securitycenter.v1.GroupResult + * @memberof google.cloud.securitycenter.v1.ListMuteConfigsResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GroupResult.verify = function verify(message) { + ListMuteConfigsResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.properties != null && message.hasOwnProperty("properties")) { - if (!$util.isObject(message.properties)) - return "properties: object expected"; - var key = Object.keys(message.properties); - for (var i = 0; i < key.length; ++i) { - var error = $root.google.protobuf.Value.verify(message.properties[key[i]]); + if (message.muteConfigs != null && message.hasOwnProperty("muteConfigs")) { + if (!Array.isArray(message.muteConfigs)) + return "muteConfigs: array expected"; + for (var i = 0; i < message.muteConfigs.length; ++i) { + var error = $root.google.cloud.securitycenter.v1.MuteConfig.verify(message.muteConfigs[i]); if (error) - return "properties." + error; + return "muteConfigs." + error; } } - if (message.count != null && message.hasOwnProperty("count")) - if (!$util.isInteger(message.count) && !(message.count && $util.isInteger(message.count.low) && $util.isInteger(message.count.high))) - return "count: integer|Long expected"; + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; return null; }; /** - * Creates a GroupResult message from a plain object. Also converts values to their respective internal types. + * Creates a ListMuteConfigsResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.securitycenter.v1.GroupResult + * @memberof google.cloud.securitycenter.v1.ListMuteConfigsResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.GroupResult} GroupResult + * @returns {google.cloud.securitycenter.v1.ListMuteConfigsResponse} ListMuteConfigsResponse */ - GroupResult.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.GroupResult) + ListMuteConfigsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.ListMuteConfigsResponse) return object; - var message = new $root.google.cloud.securitycenter.v1.GroupResult(); - if (object.properties) { - if (typeof object.properties !== "object") - throw TypeError(".google.cloud.securitycenter.v1.GroupResult.properties: object expected"); - message.properties = {}; - for (var keys = Object.keys(object.properties), i = 0; i < keys.length; ++i) { - if (typeof object.properties[keys[i]] !== "object") - throw TypeError(".google.cloud.securitycenter.v1.GroupResult.properties: object expected"); - message.properties[keys[i]] = $root.google.protobuf.Value.fromObject(object.properties[keys[i]]); + var message = new $root.google.cloud.securitycenter.v1.ListMuteConfigsResponse(); + if (object.muteConfigs) { + if (!Array.isArray(object.muteConfigs)) + throw TypeError(".google.cloud.securitycenter.v1.ListMuteConfigsResponse.muteConfigs: array expected"); + message.muteConfigs = []; + for (var i = 0; i < object.muteConfigs.length; ++i) { + if (typeof object.muteConfigs[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v1.ListMuteConfigsResponse.muteConfigs: object expected"); + message.muteConfigs[i] = $root.google.cloud.securitycenter.v1.MuteConfig.fromObject(object.muteConfigs[i]); } } - if (object.count != null) - if ($util.Long) - (message.count = $util.Long.fromValue(object.count)).unsigned = false; - else if (typeof object.count === "string") - message.count = parseInt(object.count, 10); - else if (typeof object.count === "number") - message.count = object.count; - else if (typeof object.count === "object") - message.count = new $util.LongBits(object.count.low >>> 0, object.count.high >>> 0).toNumber(); + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); return message; }; /** - * Creates a plain object from a GroupResult message. Also converts values to other types if specified. + * Creates a plain object from a ListMuteConfigsResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.securitycenter.v1.GroupResult + * @memberof google.cloud.securitycenter.v1.ListMuteConfigsResponse * @static - * @param {google.cloud.securitycenter.v1.GroupResult} message GroupResult + * @param {google.cloud.securitycenter.v1.ListMuteConfigsResponse} message ListMuteConfigsResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GroupResult.toObject = function toObject(message, options) { + ListMuteConfigsResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.objects || options.defaults) - object.properties = {}; + if (options.arrays || options.defaults) + object.muteConfigs = []; if (options.defaults) - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.count = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.count = options.longs === String ? "0" : 0; - var keys2; - if (message.properties && (keys2 = Object.keys(message.properties)).length) { - object.properties = {}; - for (var j = 0; j < keys2.length; ++j) - object.properties[keys2[j]] = $root.google.protobuf.Value.toObject(message.properties[keys2[j]], options); + object.nextPageToken = ""; + if (message.muteConfigs && message.muteConfigs.length) { + object.muteConfigs = []; + for (var j = 0; j < message.muteConfigs.length; ++j) + object.muteConfigs[j] = $root.google.cloud.securitycenter.v1.MuteConfig.toObject(message.muteConfigs[j], options); } - if (message.count != null && message.hasOwnProperty("count")) - if (typeof message.count === "number") - object.count = options.longs === String ? String(message.count) : message.count; - else - object.count = options.longs === String ? $util.Long.prototype.toString.call(message.count) : options.longs === Number ? new $util.LongBits(message.count.low >>> 0, message.count.high >>> 0).toNumber() : message.count; + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; return object; }; /** - * Converts this GroupResult to JSON. + * Converts this ListMuteConfigsResponse to JSON. * @function toJSON - * @memberof google.cloud.securitycenter.v1.GroupResult + * @memberof google.cloud.securitycenter.v1.ListMuteConfigsResponse * @instance * @returns {Object.} JSON object */ - GroupResult.prototype.toJSON = function toJSON() { + ListMuteConfigsResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return GroupResult; + return ListMuteConfigsResponse; })(); v1.ListNotificationConfigsRequest = (function() { @@ -12517,29 +14656,283 @@ return ListFindingsResult; })(); - return ListFindingsResponse; + return ListFindingsResponse; + })(); + + v1.SetFindingStateRequest = (function() { + + /** + * Properties of a SetFindingStateRequest. + * @memberof google.cloud.securitycenter.v1 + * @interface ISetFindingStateRequest + * @property {string|null} [name] SetFindingStateRequest name + * @property {google.cloud.securitycenter.v1.Finding.State|null} [state] SetFindingStateRequest state + * @property {google.protobuf.ITimestamp|null} [startTime] SetFindingStateRequest startTime + */ + + /** + * Constructs a new SetFindingStateRequest. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a SetFindingStateRequest. + * @implements ISetFindingStateRequest + * @constructor + * @param {google.cloud.securitycenter.v1.ISetFindingStateRequest=} [properties] Properties to set + */ + function SetFindingStateRequest(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]]; + } + + /** + * SetFindingStateRequest name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1.SetFindingStateRequest + * @instance + */ + SetFindingStateRequest.prototype.name = ""; + + /** + * SetFindingStateRequest state. + * @member {google.cloud.securitycenter.v1.Finding.State} state + * @memberof google.cloud.securitycenter.v1.SetFindingStateRequest + * @instance + */ + SetFindingStateRequest.prototype.state = 0; + + /** + * SetFindingStateRequest startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.cloud.securitycenter.v1.SetFindingStateRequest + * @instance + */ + SetFindingStateRequest.prototype.startTime = null; + + /** + * Creates a new SetFindingStateRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.SetFindingStateRequest + * @static + * @param {google.cloud.securitycenter.v1.ISetFindingStateRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.SetFindingStateRequest} SetFindingStateRequest instance + */ + SetFindingStateRequest.create = function create(properties) { + return new SetFindingStateRequest(properties); + }; + + /** + * Encodes the specified SetFindingStateRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.SetFindingStateRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.SetFindingStateRequest + * @static + * @param {google.cloud.securitycenter.v1.ISetFindingStateRequest} message SetFindingStateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetFindingStateRequest.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.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.state); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SetFindingStateRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.SetFindingStateRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.SetFindingStateRequest + * @static + * @param {google.cloud.securitycenter.v1.ISetFindingStateRequest} message SetFindingStateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetFindingStateRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SetFindingStateRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.SetFindingStateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.SetFindingStateRequest} SetFindingStateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetFindingStateRequest.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.cloud.securitycenter.v1.SetFindingStateRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.state = reader.int32(); + break; + case 3: + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SetFindingStateRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.SetFindingStateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.SetFindingStateRequest} SetFindingStateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetFindingStateRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SetFindingStateRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1.SetFindingStateRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SetFindingStateRequest.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.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.startTime != null && message.hasOwnProperty("startTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.startTime); + if (error) + return "startTime." + error; + } + return null; + }; + + /** + * Creates a SetFindingStateRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.SetFindingStateRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.SetFindingStateRequest} SetFindingStateRequest + */ + SetFindingStateRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.SetFindingStateRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1.SetFindingStateRequest(); + if (object.name != null) + message.name = String(object.name); + switch (object.state) { + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "ACTIVE": + case 1: + message.state = 1; + break; + case "INACTIVE": + case 2: + message.state = 2; + break; + } + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.cloud.securitycenter.v1.SetFindingStateRequest.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); + } + return message; + }; + + /** + * Creates a plain object from a SetFindingStateRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.SetFindingStateRequest + * @static + * @param {google.cloud.securitycenter.v1.SetFindingStateRequest} message SetFindingStateRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SetFindingStateRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.startTime = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.securitycenter.v1.Finding.State[message.state] : message.state; + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); + return object; + }; + + /** + * Converts this SetFindingStateRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.SetFindingStateRequest + * @instance + * @returns {Object.} JSON object + */ + SetFindingStateRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SetFindingStateRequest; })(); - v1.SetFindingStateRequest = (function() { + v1.SetMuteRequest = (function() { /** - * Properties of a SetFindingStateRequest. + * Properties of a SetMuteRequest. * @memberof google.cloud.securitycenter.v1 - * @interface ISetFindingStateRequest - * @property {string|null} [name] SetFindingStateRequest name - * @property {google.cloud.securitycenter.v1.Finding.State|null} [state] SetFindingStateRequest state - * @property {google.protobuf.ITimestamp|null} [startTime] SetFindingStateRequest startTime + * @interface ISetMuteRequest + * @property {string|null} [name] SetMuteRequest name + * @property {google.cloud.securitycenter.v1.Finding.Mute|null} [mute] SetMuteRequest mute */ /** - * Constructs a new SetFindingStateRequest. + * Constructs a new SetMuteRequest. * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents a SetFindingStateRequest. - * @implements ISetFindingStateRequest + * @classdesc Represents a SetMuteRequest. + * @implements ISetMuteRequest * @constructor - * @param {google.cloud.securitycenter.v1.ISetFindingStateRequest=} [properties] Properties to set + * @param {google.cloud.securitycenter.v1.ISetMuteRequest=} [properties] Properties to set */ - function SetFindingStateRequest(properties) { + function SetMuteRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -12547,90 +14940,80 @@ } /** - * SetFindingStateRequest name. + * SetMuteRequest name. * @member {string} name - * @memberof google.cloud.securitycenter.v1.SetFindingStateRequest - * @instance - */ - SetFindingStateRequest.prototype.name = ""; - - /** - * SetFindingStateRequest state. - * @member {google.cloud.securitycenter.v1.Finding.State} state - * @memberof google.cloud.securitycenter.v1.SetFindingStateRequest + * @memberof google.cloud.securitycenter.v1.SetMuteRequest * @instance */ - SetFindingStateRequest.prototype.state = 0; + SetMuteRequest.prototype.name = ""; /** - * SetFindingStateRequest startTime. - * @member {google.protobuf.ITimestamp|null|undefined} startTime - * @memberof google.cloud.securitycenter.v1.SetFindingStateRequest + * SetMuteRequest mute. + * @member {google.cloud.securitycenter.v1.Finding.Mute} mute + * @memberof google.cloud.securitycenter.v1.SetMuteRequest * @instance */ - SetFindingStateRequest.prototype.startTime = null; + SetMuteRequest.prototype.mute = 0; /** - * Creates a new SetFindingStateRequest instance using the specified properties. + * Creates a new SetMuteRequest instance using the specified properties. * @function create - * @memberof google.cloud.securitycenter.v1.SetFindingStateRequest + * @memberof google.cloud.securitycenter.v1.SetMuteRequest * @static - * @param {google.cloud.securitycenter.v1.ISetFindingStateRequest=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.SetFindingStateRequest} SetFindingStateRequest instance + * @param {google.cloud.securitycenter.v1.ISetMuteRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.SetMuteRequest} SetMuteRequest instance */ - SetFindingStateRequest.create = function create(properties) { - return new SetFindingStateRequest(properties); + SetMuteRequest.create = function create(properties) { + return new SetMuteRequest(properties); }; /** - * Encodes the specified SetFindingStateRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.SetFindingStateRequest.verify|verify} messages. + * Encodes the specified SetMuteRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.SetMuteRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.securitycenter.v1.SetFindingStateRequest + * @memberof google.cloud.securitycenter.v1.SetMuteRequest * @static - * @param {google.cloud.securitycenter.v1.ISetFindingStateRequest} message SetFindingStateRequest message or plain object to encode + * @param {google.cloud.securitycenter.v1.ISetMuteRequest} message SetMuteRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SetFindingStateRequest.encode = function encode(message, writer) { + SetMuteRequest.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.state != null && Object.hasOwnProperty.call(message, "state")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.state); - if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) - $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.mute != null && Object.hasOwnProperty.call(message, "mute")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.mute); return writer; }; /** - * Encodes the specified SetFindingStateRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.SetFindingStateRequest.verify|verify} messages. + * Encodes the specified SetMuteRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.SetMuteRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.SetFindingStateRequest + * @memberof google.cloud.securitycenter.v1.SetMuteRequest * @static - * @param {google.cloud.securitycenter.v1.ISetFindingStateRequest} message SetFindingStateRequest message or plain object to encode + * @param {google.cloud.securitycenter.v1.ISetMuteRequest} message SetMuteRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SetFindingStateRequest.encodeDelimited = function encodeDelimited(message, writer) { + SetMuteRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a SetFindingStateRequest message from the specified reader or buffer. + * Decodes a SetMuteRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.securitycenter.v1.SetFindingStateRequest + * @memberof google.cloud.securitycenter.v1.SetMuteRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.SetFindingStateRequest} SetFindingStateRequest + * @returns {google.cloud.securitycenter.v1.SetMuteRequest} SetMuteRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SetFindingStateRequest.decode = function decode(reader, length) { + SetMuteRequest.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.cloud.securitycenter.v1.SetFindingStateRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.SetMuteRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -12638,10 +15021,7 @@ message.name = reader.string(); break; case 2: - message.state = reader.int32(); - break; - case 3: - message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + message.mute = reader.int32(); break; default: reader.skipType(tag & 7); @@ -12652,127 +15032,119 @@ }; /** - * Decodes a SetFindingStateRequest message from the specified reader or buffer, length delimited. + * Decodes a SetMuteRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.SetFindingStateRequest + * @memberof google.cloud.securitycenter.v1.SetMuteRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.SetFindingStateRequest} SetFindingStateRequest + * @returns {google.cloud.securitycenter.v1.SetMuteRequest} SetMuteRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SetFindingStateRequest.decodeDelimited = function decodeDelimited(reader) { + SetMuteRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a SetFindingStateRequest message. + * Verifies a SetMuteRequest message. * @function verify - * @memberof google.cloud.securitycenter.v1.SetFindingStateRequest + * @memberof google.cloud.securitycenter.v1.SetMuteRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - SetFindingStateRequest.verify = function verify(message) { + SetMuteRequest.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.state != null && message.hasOwnProperty("state")) - switch (message.state) { + if (message.mute != null && message.hasOwnProperty("mute")) + switch (message.mute) { default: - return "state: enum value expected"; + return "mute: enum value expected"; case 0: case 1: case 2: + case 4: break; } - if (message.startTime != null && message.hasOwnProperty("startTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.startTime); - if (error) - return "startTime." + error; - } return null; }; /** - * Creates a SetFindingStateRequest message from a plain object. Also converts values to their respective internal types. + * Creates a SetMuteRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.securitycenter.v1.SetFindingStateRequest + * @memberof google.cloud.securitycenter.v1.SetMuteRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.SetFindingStateRequest} SetFindingStateRequest + * @returns {google.cloud.securitycenter.v1.SetMuteRequest} SetMuteRequest */ - SetFindingStateRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.SetFindingStateRequest) + SetMuteRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.SetMuteRequest) return object; - var message = new $root.google.cloud.securitycenter.v1.SetFindingStateRequest(); + var message = new $root.google.cloud.securitycenter.v1.SetMuteRequest(); if (object.name != null) message.name = String(object.name); - switch (object.state) { - case "STATE_UNSPECIFIED": + switch (object.mute) { + case "MUTE_UNSPECIFIED": case 0: - message.state = 0; + message.mute = 0; break; - case "ACTIVE": + case "MUTED": case 1: - message.state = 1; + message.mute = 1; break; - case "INACTIVE": + case "UNMUTED": case 2: - message.state = 2; + message.mute = 2; + break; + case "UNDEFINED": + case 4: + message.mute = 4; break; - } - if (object.startTime != null) { - if (typeof object.startTime !== "object") - throw TypeError(".google.cloud.securitycenter.v1.SetFindingStateRequest.startTime: object expected"); - message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); } return message; }; /** - * Creates a plain object from a SetFindingStateRequest message. Also converts values to other types if specified. + * Creates a plain object from a SetMuteRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.securitycenter.v1.SetFindingStateRequest + * @memberof google.cloud.securitycenter.v1.SetMuteRequest * @static - * @param {google.cloud.securitycenter.v1.SetFindingStateRequest} message SetFindingStateRequest + * @param {google.cloud.securitycenter.v1.SetMuteRequest} message SetMuteRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SetFindingStateRequest.toObject = function toObject(message, options) { + SetMuteRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { object.name = ""; - object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; - object.startTime = null; + object.mute = options.enums === String ? "MUTE_UNSPECIFIED" : 0; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; - if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.securitycenter.v1.Finding.State[message.state] : message.state; - if (message.startTime != null && message.hasOwnProperty("startTime")) - object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); + if (message.mute != null && message.hasOwnProperty("mute")) + object.mute = options.enums === String ? $root.google.cloud.securitycenter.v1.Finding.Mute[message.mute] : message.mute; return object; }; /** - * Converts this SetFindingStateRequest to JSON. + * Converts this SetMuteRequest to JSON. * @function toJSON - * @memberof google.cloud.securitycenter.v1.SetFindingStateRequest + * @memberof google.cloud.securitycenter.v1.SetMuteRequest * @instance * @returns {Object.} JSON object */ - SetFindingStateRequest.prototype.toJSON = function toJSON() { + SetMuteRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return SetFindingStateRequest; + return SetMuteRequest; })(); v1.RunAssetDiscoveryRequest = (function() { @@ -13182,6 +15554,226 @@ return UpdateFindingRequest; })(); + v1.UpdateMuteConfigRequest = (function() { + + /** + * Properties of an UpdateMuteConfigRequest. + * @memberof google.cloud.securitycenter.v1 + * @interface IUpdateMuteConfigRequest + * @property {google.cloud.securitycenter.v1.IMuteConfig|null} [muteConfig] UpdateMuteConfigRequest muteConfig + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateMuteConfigRequest updateMask + */ + + /** + * Constructs a new UpdateMuteConfigRequest. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents an UpdateMuteConfigRequest. + * @implements IUpdateMuteConfigRequest + * @constructor + * @param {google.cloud.securitycenter.v1.IUpdateMuteConfigRequest=} [properties] Properties to set + */ + function UpdateMuteConfigRequest(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]]; + } + + /** + * UpdateMuteConfigRequest muteConfig. + * @member {google.cloud.securitycenter.v1.IMuteConfig|null|undefined} muteConfig + * @memberof google.cloud.securitycenter.v1.UpdateMuteConfigRequest + * @instance + */ + UpdateMuteConfigRequest.prototype.muteConfig = null; + + /** + * UpdateMuteConfigRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.securitycenter.v1.UpdateMuteConfigRequest + * @instance + */ + UpdateMuteConfigRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateMuteConfigRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.UpdateMuteConfigRequest + * @static + * @param {google.cloud.securitycenter.v1.IUpdateMuteConfigRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.UpdateMuteConfigRequest} UpdateMuteConfigRequest instance + */ + UpdateMuteConfigRequest.create = function create(properties) { + return new UpdateMuteConfigRequest(properties); + }; + + /** + * Encodes the specified UpdateMuteConfigRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.UpdateMuteConfigRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.UpdateMuteConfigRequest + * @static + * @param {google.cloud.securitycenter.v1.IUpdateMuteConfigRequest} message UpdateMuteConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateMuteConfigRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.muteConfig != null && Object.hasOwnProperty.call(message, "muteConfig")) + $root.google.cloud.securitycenter.v1.MuteConfig.encode(message.muteConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateMuteConfigRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.UpdateMuteConfigRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.UpdateMuteConfigRequest + * @static + * @param {google.cloud.securitycenter.v1.IUpdateMuteConfigRequest} message UpdateMuteConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateMuteConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateMuteConfigRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.UpdateMuteConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.UpdateMuteConfigRequest} UpdateMuteConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateMuteConfigRequest.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.cloud.securitycenter.v1.UpdateMuteConfigRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.muteConfig = $root.google.cloud.securitycenter.v1.MuteConfig.decode(reader, reader.uint32()); + break; + case 2: + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateMuteConfigRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.UpdateMuteConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.UpdateMuteConfigRequest} UpdateMuteConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateMuteConfigRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateMuteConfigRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1.UpdateMuteConfigRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateMuteConfigRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.muteConfig != null && message.hasOwnProperty("muteConfig")) { + var error = $root.google.cloud.securitycenter.v1.MuteConfig.verify(message.muteConfig); + if (error) + return "muteConfig." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + return null; + }; + + /** + * Creates an UpdateMuteConfigRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.UpdateMuteConfigRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.UpdateMuteConfigRequest} UpdateMuteConfigRequest + */ + UpdateMuteConfigRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.UpdateMuteConfigRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1.UpdateMuteConfigRequest(); + if (object.muteConfig != null) { + if (typeof object.muteConfig !== "object") + throw TypeError(".google.cloud.securitycenter.v1.UpdateMuteConfigRequest.muteConfig: object expected"); + message.muteConfig = $root.google.cloud.securitycenter.v1.MuteConfig.fromObject(object.muteConfig); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.securitycenter.v1.UpdateMuteConfigRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateMuteConfigRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.UpdateMuteConfigRequest + * @static + * @param {google.cloud.securitycenter.v1.UpdateMuteConfigRequest} message UpdateMuteConfigRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateMuteConfigRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.muteConfig = null; + object.updateMask = null; + } + if (message.muteConfig != null && message.hasOwnProperty("muteConfig")) + object.muteConfig = $root.google.cloud.securitycenter.v1.MuteConfig.toObject(message.muteConfig, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateMuteConfigRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.UpdateMuteConfigRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateMuteConfigRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return UpdateMuteConfigRequest; + })(); + v1.UpdateNotificationConfigRequest = (function() { /** diff --git a/packages/google-cloud-securitycenter/protos/protos.json b/packages/google-cloud-securitycenter/protos/protos.json index 5f68213c94f..7ab735d4b3c 100644 --- a/packages/google-cloud-securitycenter/protos/protos.json +++ b/packages/google-cloud-securitycenter/protos/protos.json @@ -203,6 +203,10 @@ "type": "string", "id": 14 }, + "mute": { + "type": "Mute", + "id": 15 + }, "findingClass": { "type": "FindingClass", "id": 17 @@ -214,6 +218,17 @@ "vulnerability": { "type": "Vulnerability", "id": 20 + }, + "muteUpdateTime": { + "type": "google.protobuf.Timestamp", + "id": 21, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "muteInitiator": { + "type": "string", + "id": 28 } }, "nested": { @@ -233,6 +248,14 @@ "LOW": 4 } }, + "Mute": { + "values": { + "MUTE_UNSPECIFIED": 0, + "MUTED": 1, + "UNMUTED": 2, + "UNDEFINED": 4 + } + }, "FindingClass": { "values": { "FINDING_CLASS_UNSPECIFIED": 0, @@ -383,6 +406,57 @@ } } }, + "MuteConfig": { + "options": { + "(google.api.resource).type": "securitycenter.googleapis.com/MuteConfig", + "(google.api.resource).pattern": "projects/{project}/muteConfigs/{mute_config}" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "displayName": { + "type": "string", + "id": 2, + "options": { + "deprecated": true + } + }, + "description": { + "type": "string", + "id": 3 + }, + "filter": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "mostRecentEditor": { + "type": "string", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, "NotificationConfig": { "options": { "(google.api.resource).type": "securitycenter.googleapis.com/NotificationConfig", @@ -574,6 +648,46 @@ "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" }, "methods": { + "BulkMuteFindings": { + "requestType": "BulkMuteFindingsRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{parent=organizations/*}/findings:bulkMute", + "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v1/{parent=projects/*}/findings:bulkMute", + "(google.api.http).additional_bindings.body": "*", + "(google.api.method_signature)": "parent", + "(google.longrunning.operation_info).response_type": "google.cloud.securitycenter.v1.BulkMuteFindingsResponse", + "(google.longrunning.operation_info).metadata_type": "google.protobuf.Empty" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=organizations/*}/findings:bulkMute", + "body": "*", + "additional_bindings": [ + { + "post": "/v1/{parent=folders/*}/findings:bulkMute", + "body": "*" + }, + { + "post": "/v1/{parent=projects/*}/findings:bulkMute", + "body": "*" + } + ] + } + }, + { + "(google.api.method_signature)": "parent" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.cloud.securitycenter.v1.BulkMuteFindingsResponse", + "metadata_type": "google.protobuf.Empty" + } + } + ] + }, "CreateSource": { "requestType": "CreateSourceRequest", "responseType": "Source", @@ -614,6 +728,41 @@ } ] }, + "CreateMuteConfig": { + "requestType": "CreateMuteConfigRequest", + "responseType": "MuteConfig", + "options": { + "(google.api.http).post": "/v1/{parent=organizations/*}/muteConfigs", + "(google.api.http).body": "mute_config", + "(google.api.http).additional_bindings.post": "/v1/{parent=projects/*}/muteConfigs", + "(google.api.http).additional_bindings.body": "mute_config", + "(google.api.method_signature)": "parent,mute_config,mute_config_id" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=organizations/*}/muteConfigs", + "body": "mute_config", + "additional_bindings": [ + { + "post": "/v1/{parent=folders/*}/muteConfigs", + "body": "mute_config" + }, + { + "post": "/v1/{parent=projects/*}/muteConfigs", + "body": "mute_config" + } + ] + } + }, + { + "(google.api.method_signature)": "parent,mute_config" + }, + { + "(google.api.method_signature)": "parent,mute_config,mute_config_id" + } + ] + }, "CreateNotificationConfig": { "requestType": "CreateNotificationConfigRequest", "responseType": "NotificationConfig", @@ -637,6 +786,33 @@ } ] }, + "DeleteMuteConfig": { + "requestType": "DeleteMuteConfigRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/{name=organizations/*/muteConfigs/*}", + "(google.api.http).additional_bindings.delete": "/v1/{name=projects/*/muteConfigs/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=organizations/*/muteConfigs/*}", + "additional_bindings": [ + { + "delete": "/v1/{name=folders/*/muteConfigs/*}" + }, + { + "delete": "/v1/{name=projects/*/muteConfigs/*}" + } + ] + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, "DeleteNotificationConfig": { "requestType": "DeleteNotificationConfigRequest", "responseType": "google.protobuf.Empty", @@ -675,6 +851,33 @@ } ] }, + "GetMuteConfig": { + "requestType": "GetMuteConfigRequest", + "responseType": "MuteConfig", + "options": { + "(google.api.http).get": "/v1/{name=organizations/*/muteConfigs/*}", + "(google.api.http).additional_bindings.get": "/v1/{name=projects/*/muteConfigs/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=organizations/*/muteConfigs/*}", + "additional_bindings": [ + { + "get": "/v1/{name=folders/*/muteConfigs/*}" + }, + { + "get": "/v1/{name=projects/*/muteConfigs/*}" + } + ] + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, "GetNotificationConfig": { "requestType": "GetNotificationConfigRequest", "responseType": "NotificationConfig", @@ -835,6 +1038,33 @@ } ] }, + "ListMuteConfigs": { + "requestType": "ListMuteConfigsRequest", + "responseType": "ListMuteConfigsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=organizations/*}/muteConfigs", + "(google.api.http).additional_bindings.get": "/v1/{parent=projects/*}/muteConfigs", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=organizations/*}/muteConfigs", + "additional_bindings": [ + { + "get": "/v1/{parent=folders/*}/muteConfigs" + }, + { + "get": "/v1/{parent=projects/*}/muteConfigs" + } + ] + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, "ListNotificationConfigs": { "requestType": "ListNotificationConfigsRequest", "responseType": "ListNotificationConfigsResponse", @@ -940,6 +1170,38 @@ } ] }, + "SetMute": { + "requestType": "SetMuteRequest", + "responseType": "Finding", + "options": { + "(google.api.http).post": "/v1/{name=organizations/*/sources/*/findings/*}:setMute", + "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v1/{name=projects/*/sources/*/findings/*}:setMute", + "(google.api.http).additional_bindings.body": "*", + "(google.api.method_signature)": "name,mute" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=organizations/*/sources/*/findings/*}:setMute", + "body": "*", + "additional_bindings": [ + { + "post": "/v1/{name=folders/*/sources/*/findings/*}:setMute", + "body": "*" + }, + { + "post": "/v1/{name=projects/*/sources/*/findings/*}:setMute", + "body": "*" + } + ] + } + }, + { + "(google.api.method_signature)": "name,mute" + } + ] + }, "SetIamPolicy": { "requestType": "google.iam.v1.SetIamPolicyRequest", "responseType": "google.iam.v1.Policy", @@ -1012,6 +1274,38 @@ } ] }, + "UpdateMuteConfig": { + "requestType": "UpdateMuteConfigRequest", + "responseType": "MuteConfig", + "options": { + "(google.api.http).patch": "/v1/{mute_config.name=organizations/*/muteConfigs/*}", + "(google.api.http).body": "mute_config", + "(google.api.http).additional_bindings.patch": "/v1/{mute_config.name=projects/*/muteConfigs/*}", + "(google.api.http).additional_bindings.body": "mute_config", + "(google.api.method_signature)": "mute_config,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{mute_config.name=organizations/*/muteConfigs/*}", + "body": "mute_config", + "additional_bindings": [ + { + "patch": "/v1/{mute_config.name=folders/*/muteConfigs/*}", + "body": "mute_config" + }, + { + "patch": "/v1/{mute_config.name=projects/*/muteConfigs/*}", + "body": "mute_config" + } + ] + } + }, + { + "(google.api.method_signature)": "mute_config,update_mask" + } + ] + }, "UpdateNotificationConfig": { "requestType": "UpdateNotificationConfigRequest", "responseType": "NotificationConfig", @@ -1121,6 +1415,32 @@ } } }, + "BulkMuteFindingsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "*" + } + }, + "filter": { + "type": "string", + "id": 2 + }, + "muteAnnotation": { + "type": "string", + "id": 3, + "options": { + "deprecated": true + } + } + } + }, + "BulkMuteFindingsResponse": { + "fields": {} + }, "CreateFindingRequest": { "fields": { "parent": { @@ -1147,6 +1467,32 @@ } } }, + "CreateMuteConfigRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "securitycenter.googleapis.com/MuteConfig" + } + }, + "muteConfig": { + "type": "MuteConfig", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "muteConfigId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, "CreateNotificationConfigRequest": { "fields": { "parent": { @@ -1192,6 +1538,18 @@ } } }, + "DeleteMuteConfigRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "securitycenter.googleapis.com/MuteConfig" + } + } + } + }, "DeleteNotificationConfigRequest": { "fields": { "name": { @@ -1204,6 +1562,18 @@ } } }, + "GetMuteConfigRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "securitycenter.googleapis.com/MuteConfig" + } + } + } + }, "GetNotificationConfigRequest": { "fields": { "name": { @@ -1373,6 +1743,39 @@ } } }, + "ListMuteConfigsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "securitycenter.googleapis.com/MuteConfig" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListMuteConfigsResponse": { + "fields": { + "muteConfigs": { + "rule": "repeated", + "type": "MuteConfig", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, "ListNotificationConfigsRequest": { "fields": { "parent": { @@ -1680,6 +2083,25 @@ } } }, + "SetMuteRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "securitycenter.googleapis.com/Finding" + } + }, + "mute": { + "type": "Finding.Mute", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, "RunAssetDiscoveryRequest": { "fields": { "parent": { @@ -1707,6 +2129,21 @@ } } }, + "UpdateMuteConfigRequest": { + "fields": { + "muteConfig": { + "type": "MuteConfig", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2 + } + } + }, "UpdateNotificationConfigRequest": { "fields": { "notificationConfig": { diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.bulk_mute_findings.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.bulk_mute_findings.js new file mode 100644 index 00000000000..e54076f7156 --- /dev/null +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.bulk_mute_findings.js @@ -0,0 +1,78 @@ +// 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'; + +function main(parent) { + // [START securitycenter_v1_generated_SecurityCenter_BulkMuteFindings_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent, at which bulk action needs to be applied. Its format is + * "organizations/[organization_id]", "folders/[folder_id]", + * "projects/[project_id]". + */ + // const parent = 'abc123' + /** + * Expression that identifies findings that should be updated. + * The expression is a list of zero or more restrictions combined + * via logical operators `AND` and `OR`. Parentheses are supported, and `OR` + * has higher precedence than `AND`. + * Restrictions have the form ` ` and may have a + * `-` character in front of them to indicate negation. The fields map to + * those defined in the corresponding resource. + * The supported operators are: + * * `=` for all value types. + * * `>`, `<`, `>=`, `<=` for integer values. + * * `:`, meaning substring matching, for strings. + * The supported value types are: + * * string literals in quotes. + * * integer literals without quotes. + * * boolean literals `true` and `false` without quotes. + */ + // const filter = 'abc123' + /** + * This can be a mute configuration name or any identifier for mute/unmute + * of findings based on the filter. + */ + // const muteAnnotation = 'abc123' + + // Imports the Securitycenter library + const {SecurityCenterClient} = require('@google-cloud/security-center').v1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function callBulkMuteFindings() { + // Construct request + const request = { + parent, + }; + + // Run request + const [operation] = await securitycenterClient.bulkMuteFindings(request); + const [response] = await operation.promise(); + console.log(response); + } + + callBulkMuteFindings(); + // [END securitycenter_v1_generated_SecurityCenter_BulkMuteFindings_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.create_mute_config.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.create_mute_config.js new file mode 100644 index 00000000000..b92956f5f8c --- /dev/null +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.create_mute_config.js @@ -0,0 +1,67 @@ +// 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'; + +function main(parent, muteConfig, muteConfigId) { + // [START securitycenter_v1_generated_SecurityCenter_CreateMuteConfig_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Resource name of the new mute configs's parent. Its format is + * "organizations/[organization_id]", "folders/[folder_id]", or + * "projects/[project_id]". + */ + // const parent = 'abc123' + /** + * Required. The mute config being created. + */ + // const muteConfig = {} + /** + * Required. Unique identifier provided by the client within the parent scope. + * It must consist of lower case letters, numbers, and hyphen, with the first + * character a letter, the last a letter or a number, and a 63 character + * maximum. + */ + // const muteConfigId = 'abc123' + + // Imports the Securitycenter library + const {SecurityCenterClient} = require('@google-cloud/security-center').v1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function callCreateMuteConfig() { + // Construct request + const request = { + parent, + muteConfig, + muteConfigId, + }; + + // Run request + const response = await securitycenterClient.createMuteConfig(request); + console.log(response); + } + + callCreateMuteConfig(); + // [END securitycenter_v1_generated_SecurityCenter_CreateMuteConfig_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.delete_mute_config.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.delete_mute_config.js new file mode 100644 index 00000000000..e04240aaf24 --- /dev/null +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.delete_mute_config.js @@ -0,0 +1,55 @@ +// 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'; + +function main(name) { + // [START securitycenter_v1_generated_SecurityCenter_DeleteMuteConfig_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of the mute config to delete. Its format is + * organizations/{organization}/muteConfigs/{config_id}, + * folders/{folder}/muteConfigs/{config_id}, or + * projects/{project}/muteConfigs/{config_id} + */ + // const name = 'abc123' + + // Imports the Securitycenter library + const {SecurityCenterClient} = require('@google-cloud/security-center').v1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function callDeleteMuteConfig() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await securitycenterClient.deleteMuteConfig(request); + console.log(response); + } + + callDeleteMuteConfig(); + // [END securitycenter_v1_generated_SecurityCenter_DeleteMuteConfig_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_mute_config.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_mute_config.js new file mode 100644 index 00000000000..d012524c2cc --- /dev/null +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_mute_config.js @@ -0,0 +1,55 @@ +// 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'; + +function main(name) { + // [START securitycenter_v1_generated_SecurityCenter_GetMuteConfig_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of the mute config to retrieve. Its format is + * organizations/{organization}/muteConfigs/{config_id}, + * folders/{folder}/muteConfigs/{config_id}, or + * projects/{project}/muteConfigs/{config_id} + */ + // const name = 'abc123' + + // Imports the Securitycenter library + const {SecurityCenterClient} = require('@google-cloud/security-center').v1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function callGetMuteConfig() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await securitycenterClient.getMuteConfig(request); + console.log(response); + } + + callGetMuteConfig(); + // [END securitycenter_v1_generated_SecurityCenter_GetMuteConfig_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_mute_configs.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_mute_configs.js new file mode 100644 index 00000000000..60cc9d97cc7 --- /dev/null +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_mute_configs.js @@ -0,0 +1,70 @@ +// 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'; + +function main(parent) { + // [START securitycenter_v1_generated_SecurityCenter_ListMuteConfigs_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent, which owns the collection of mute configs. Its format is + * "organizations/[organization_id]", "folders/[folder_id]", + * "projects/[project_id]". + */ + // const parent = 'abc123' + /** + * The maximum number of configs to return. The service may return fewer than + * this value. + * If unspecified, at most 10 configs will be returned. + * The maximum value is 1000; values above 1000 will be coerced to 1000. + */ + // const pageSize = 1234 + /** + * A page token, received from a previous `ListMuteConfigs` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListMuteConfigs` must + * match the call that provided the page token. + */ + // const pageToken = 'abc123' + + // Imports the Securitycenter library + const {SecurityCenterClient} = require('@google-cloud/security-center').v1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function callListMuteConfigs() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await securitycenterClient.listMuteConfigsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListMuteConfigs(); + // [END securitycenter_v1_generated_SecurityCenter_ListMuteConfigs_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.set_mute.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.set_mute.js new file mode 100644 index 00000000000..16c225bc894 --- /dev/null +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.set_mute.js @@ -0,0 +1,62 @@ +// 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'; + +function main(name, mute) { + // [START securitycenter_v1_generated_SecurityCenter_SetMute_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The relative resource name of the finding. See: + * https://cloud.google.com/apis/design/resource_names#relative_resource_name + * Example: + * "organizations/{organization_id}/sources/{source_id}/finding/{finding_id}", + * "folders/{folder_id}/sources/{source_id}/finding/{finding_id}", + * "projects/{project_id}/sources/{source_id}/finding/{finding_id}". + */ + // const name = 'abc123' + /** + * Required. The desired state of the Mute. + */ + // const mute = {} + + // Imports the Securitycenter library + const {SecurityCenterClient} = require('@google-cloud/security-center').v1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function callSetMute() { + // Construct request + const request = { + name, + mute, + }; + + // Run request + const response = await securitycenterClient.setMute(request); + console.log(response); + } + + callSetMute(); + // [END securitycenter_v1_generated_SecurityCenter_SetMute_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_mute_config.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_mute_config.js new file mode 100644 index 00000000000..6744511b834 --- /dev/null +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_mute_config.js @@ -0,0 +1,57 @@ +// 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'; + +function main(muteConfig) { + // [START securitycenter_v1_generated_SecurityCenter_UpdateMuteConfig_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The mute config being updated. + */ + // const muteConfig = {} + /** + * The list of fields to be updated. + * If empty all mutable fields will be updated. + */ + // const updateMask = {} + + // Imports the Securitycenter library + const {SecurityCenterClient} = require('@google-cloud/security-center').v1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function callUpdateMuteConfig() { + // Construct request + const request = { + muteConfig, + }; + + // Run request + const response = await securitycenterClient.updateMuteConfig(request); + console.log(response); + } + + callUpdateMuteConfig(); + // [END securitycenter_v1_generated_SecurityCenter_UpdateMuteConfig_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-securitycenter/src/v1/gapic_metadata.json b/packages/google-cloud-securitycenter/src/v1/gapic_metadata.json index 3280f72a8ff..53654b4a9bf 100644 --- a/packages/google-cloud-securitycenter/src/v1/gapic_metadata.json +++ b/packages/google-cloud-securitycenter/src/v1/gapic_metadata.json @@ -20,11 +20,21 @@ "createFinding" ] }, + "CreateMuteConfig": { + "methods": [ + "createMuteConfig" + ] + }, "CreateNotificationConfig": { "methods": [ "createNotificationConfig" ] }, + "DeleteMuteConfig": { + "methods": [ + "deleteMuteConfig" + ] + }, "DeleteNotificationConfig": { "methods": [ "deleteNotificationConfig" @@ -35,6 +45,11 @@ "getIamPolicy" ] }, + "GetMuteConfig": { + "methods": [ + "getMuteConfig" + ] + }, "GetNotificationConfig": { "methods": [ "getNotificationConfig" @@ -55,6 +70,11 @@ "setFindingState" ] }, + "SetMute": { + "methods": [ + "setMute" + ] + }, "SetIamPolicy": { "methods": [ "setIamPolicy" @@ -70,6 +90,11 @@ "updateFinding" ] }, + "UpdateMuteConfig": { + "methods": [ + "updateMuteConfig" + ] + }, "UpdateNotificationConfig": { "methods": [ "updateNotificationConfig" @@ -90,6 +115,11 @@ "updateSecurityMarks" ] }, + "BulkMuteFindings": { + "methods": [ + "bulkMuteFindings" + ] + }, "RunAssetDiscovery": { "methods": [ "runAssetDiscovery" @@ -123,6 +153,13 @@ "listFindingsAsync" ] }, + "ListMuteConfigs": { + "methods": [ + "listMuteConfigs", + "listMuteConfigsStream", + "listMuteConfigsAsync" + ] + }, "ListNotificationConfigs": { "methods": [ "listNotificationConfigs", @@ -152,11 +189,21 @@ "createFinding" ] }, + "CreateMuteConfig": { + "methods": [ + "createMuteConfig" + ] + }, "CreateNotificationConfig": { "methods": [ "createNotificationConfig" ] }, + "DeleteMuteConfig": { + "methods": [ + "deleteMuteConfig" + ] + }, "DeleteNotificationConfig": { "methods": [ "deleteNotificationConfig" @@ -167,6 +214,11 @@ "getIamPolicy" ] }, + "GetMuteConfig": { + "methods": [ + "getMuteConfig" + ] + }, "GetNotificationConfig": { "methods": [ "getNotificationConfig" @@ -187,6 +239,11 @@ "setFindingState" ] }, + "SetMute": { + "methods": [ + "setMute" + ] + }, "SetIamPolicy": { "methods": [ "setIamPolicy" @@ -202,6 +259,11 @@ "updateFinding" ] }, + "UpdateMuteConfig": { + "methods": [ + "updateMuteConfig" + ] + }, "UpdateNotificationConfig": { "methods": [ "updateNotificationConfig" @@ -222,6 +284,11 @@ "updateSecurityMarks" ] }, + "BulkMuteFindings": { + "methods": [ + "bulkMuteFindings" + ] + }, "RunAssetDiscovery": { "methods": [ "runAssetDiscovery" @@ -255,6 +322,13 @@ "listFindingsAsync" ] }, + "ListMuteConfigs": { + "methods": [ + "listMuteConfigs", + "listMuteConfigsStream", + "listMuteConfigsAsync" + ] + }, "ListNotificationConfigs": { "methods": [ "listNotificationConfigs", diff --git a/packages/google-cloud-securitycenter/src/v1/security_center_client.ts b/packages/google-cloud-securitycenter/src/v1/security_center_client.ts index 62af5bfd16d..517cb9d6a6e 100644 --- a/packages/google-cloud-securitycenter/src/v1/security_center_client.ts +++ b/packages/google-cloud-securitycenter/src/v1/security_center_client.ts @@ -172,6 +172,9 @@ export class SecurityCenterClient { folderAssetSecurityMarksPathTemplate: new this._gaxModule.PathTemplate( 'folders/{folder}/assets/{asset}/securityMarks' ), + folderMuteConfigPathTemplate: new this._gaxModule.PathTemplate( + 'folders/{folder}/muteConfigs/{mute_config}' + ), folderSourcePathTemplate: new this._gaxModule.PathTemplate( 'folders/{folder}/sources/{source}' ), @@ -195,6 +198,9 @@ export class SecurityCenterClient { new this._gaxModule.PathTemplate( 'organizations/{organization}/assets/{asset}/securityMarks' ), + organizationMuteConfigPathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}/muteConfigs/{mute_config}' + ), organizationSettingsPathTemplate: new this._gaxModule.PathTemplate( 'organizations/{organization}/organizationSettings' ), @@ -214,6 +220,9 @@ export class SecurityCenterClient { projectAssetSecurityMarksPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/assets/{asset}/securityMarks' ), + projectMuteConfigPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/muteConfigs/{mute_config}' + ), projectSourcePathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/sources/{source}' ), @@ -250,6 +259,11 @@ export class SecurityCenterClient { 'nextPageToken', 'listFindingsResults' ), + listMuteConfigs: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'muteConfigs' + ), listNotificationConfigs: new this._gaxModule.PageDescriptor( 'pageToken', 'nextPageToken', @@ -274,6 +288,12 @@ export class SecurityCenterClient { grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined, }) .operationsClient(opts); + const bulkMuteFindingsResponse = protoFilesRoot.lookup( + '.google.cloud.securitycenter.v1.BulkMuteFindingsResponse' + ) as gax.protobuf.Type; + const bulkMuteFindingsMetadata = protoFilesRoot.lookup( + '.google.protobuf.Empty' + ) as gax.protobuf.Type; const runAssetDiscoveryResponse = protoFilesRoot.lookup( '.google.cloud.securitycenter.v1.RunAssetDiscoveryResponse' ) as gax.protobuf.Type; @@ -282,6 +302,11 @@ export class SecurityCenterClient { ) as gax.protobuf.Type; this.descriptors.longrunning = { + bulkMuteFindings: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + bulkMuteFindingsResponse.decode.bind(bulkMuteFindingsResponse), + bulkMuteFindingsMetadata.decode.bind(bulkMuteFindingsMetadata) + ), runAssetDiscovery: new this._gaxModule.LongrunningDescriptor( this.operationsClient, runAssetDiscoveryResponse.decode.bind(runAssetDiscoveryResponse), @@ -339,11 +364,15 @@ export class SecurityCenterClient { // Iterate over each of the methods that the service provides // and create an API call method for each. const securityCenterStubMethods = [ + 'bulkMuteFindings', 'createSource', 'createFinding', + 'createMuteConfig', 'createNotificationConfig', + 'deleteMuteConfig', 'deleteNotificationConfig', 'getIamPolicy', + 'getMuteConfig', 'getNotificationConfig', 'getOrganizationSettings', 'getSource', @@ -351,13 +380,16 @@ export class SecurityCenterClient { 'groupFindings', 'listAssets', 'listFindings', + 'listMuteConfigs', 'listNotificationConfigs', 'listSources', 'runAssetDiscovery', 'setFindingState', + 'setMute', 'setIamPolicy', 'testIamPermissions', 'updateFinding', + 'updateMuteConfig', 'updateNotificationConfig', 'updateOrganizationSettings', 'updateSource', @@ -642,6 +674,112 @@ export class SecurityCenterClient { this.initialize(); return this.innerApiCalls.createFinding(request, options, callback); } + /** + * Creates a mute config. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Resource name of the new mute configs's parent. Its format is + * "organizations/[organization_id]", "folders/[folder_id]", or + * "projects/[project_id]". + * @param {google.cloud.securitycenter.v1.MuteConfig} request.muteConfig + * Required. The mute config being created. + * @param {string} request.muteConfigId + * Required. Unique identifier provided by the client within the parent scope. + * It must consist of lower case letters, numbers, and hyphen, with the first + * character a letter, the last a letter or a number, and a 63 character + * maximum. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [MuteConfig]{@link google.cloud.securitycenter.v1.MuteConfig}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/security_center.create_mute_config.js + * region_tag:securitycenter_v1_generated_SecurityCenter_CreateMuteConfig_async + */ + createMuteConfig( + request?: protos.google.cloud.securitycenter.v1.ICreateMuteConfigRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.securitycenter.v1.IMuteConfig, + ( + | protos.google.cloud.securitycenter.v1.ICreateMuteConfigRequest + | undefined + ), + {} | undefined + ] + >; + createMuteConfig( + request: protos.google.cloud.securitycenter.v1.ICreateMuteConfigRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.securitycenter.v1.IMuteConfig, + | protos.google.cloud.securitycenter.v1.ICreateMuteConfigRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createMuteConfig( + request: protos.google.cloud.securitycenter.v1.ICreateMuteConfigRequest, + callback: Callback< + protos.google.cloud.securitycenter.v1.IMuteConfig, + | protos.google.cloud.securitycenter.v1.ICreateMuteConfigRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createMuteConfig( + request?: protos.google.cloud.securitycenter.v1.ICreateMuteConfigRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.securitycenter.v1.IMuteConfig, + | protos.google.cloud.securitycenter.v1.ICreateMuteConfigRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.securitycenter.v1.IMuteConfig, + | protos.google.cloud.securitycenter.v1.ICreateMuteConfigRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.securitycenter.v1.IMuteConfig, + ( + | protos.google.cloud.securitycenter.v1.ICreateMuteConfigRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.createMuteConfig(request, options, callback); + } /** * Creates a notification config. * @@ -752,6 +890,106 @@ export class SecurityCenterClient { callback ); } + /** + * Deletes an existing mute config. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the mute config to delete. Its format is + * organizations/{organization}/muteConfigs/{config_id}, + * folders/{folder}/muteConfigs/{config_id}, or + * projects/{project}/muteConfigs/{config_id} + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/security_center.delete_mute_config.js + * region_tag:securitycenter_v1_generated_SecurityCenter_DeleteMuteConfig_async + */ + deleteMuteConfig( + request?: protos.google.cloud.securitycenter.v1.IDeleteMuteConfigRequest, + options?: CallOptions + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.securitycenter.v1.IDeleteMuteConfigRequest + | undefined + ), + {} | undefined + ] + >; + deleteMuteConfig( + request: protos.google.cloud.securitycenter.v1.IDeleteMuteConfigRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.securitycenter.v1.IDeleteMuteConfigRequest + | null + | undefined, + {} | null | undefined + > + ): void; + deleteMuteConfig( + request: protos.google.cloud.securitycenter.v1.IDeleteMuteConfigRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.securitycenter.v1.IDeleteMuteConfigRequest + | null + | undefined, + {} | null | undefined + > + ): void; + deleteMuteConfig( + request?: protos.google.cloud.securitycenter.v1.IDeleteMuteConfigRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.securitycenter.v1.IDeleteMuteConfigRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.securitycenter.v1.IDeleteMuteConfigRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.securitycenter.v1.IDeleteMuteConfigRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + name: request.name || '', + }); + this.initialize(); + return this.innerApiCalls.deleteMuteConfig(request, options, callback); + } /** * Deletes a notification config. * @@ -941,6 +1179,100 @@ export class SecurityCenterClient { this.initialize(); return this.innerApiCalls.getIamPolicy(request, options, callback); } + /** + * Gets a mute config. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the mute config to retrieve. Its format is + * organizations/{organization}/muteConfigs/{config_id}, + * folders/{folder}/muteConfigs/{config_id}, or + * projects/{project}/muteConfigs/{config_id} + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [MuteConfig]{@link google.cloud.securitycenter.v1.MuteConfig}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/security_center.get_mute_config.js + * region_tag:securitycenter_v1_generated_SecurityCenter_GetMuteConfig_async + */ + getMuteConfig( + request?: protos.google.cloud.securitycenter.v1.IGetMuteConfigRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.securitycenter.v1.IMuteConfig, + protos.google.cloud.securitycenter.v1.IGetMuteConfigRequest | undefined, + {} | undefined + ] + >; + getMuteConfig( + request: protos.google.cloud.securitycenter.v1.IGetMuteConfigRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.securitycenter.v1.IMuteConfig, + | protos.google.cloud.securitycenter.v1.IGetMuteConfigRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getMuteConfig( + request: protos.google.cloud.securitycenter.v1.IGetMuteConfigRequest, + callback: Callback< + protos.google.cloud.securitycenter.v1.IMuteConfig, + | protos.google.cloud.securitycenter.v1.IGetMuteConfigRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getMuteConfig( + request?: protos.google.cloud.securitycenter.v1.IGetMuteConfigRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.securitycenter.v1.IMuteConfig, + | protos.google.cloud.securitycenter.v1.IGetMuteConfigRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.securitycenter.v1.IMuteConfig, + | protos.google.cloud.securitycenter.v1.IGetMuteConfigRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.securitycenter.v1.IMuteConfig, + protos.google.cloud.securitycenter.v1.IGetMuteConfigRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + name: request.name || '', + }); + this.initialize(); + return this.innerApiCalls.getMuteConfig(request, options, callback); + } /** * Gets a notification config. * @@ -1331,6 +1663,98 @@ export class SecurityCenterClient { this.initialize(); return this.innerApiCalls.setFindingState(request, options, callback); } + /** + * Updates the mute state of a finding. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The relative resource name of the finding. See: + * https://cloud.google.com/apis/design/resource_names#relative_resource_name + * Example: + * "organizations/{organization_id}/sources/{source_id}/finding/{finding_id}", + * "folders/{folder_id}/sources/{source_id}/finding/{finding_id}", + * "projects/{project_id}/sources/{source_id}/finding/{finding_id}". + * @param {google.cloud.securitycenter.v1.Finding.Mute} request.mute + * Required. The desired state of the Mute. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Finding]{@link google.cloud.securitycenter.v1.Finding}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/security_center.set_mute.js + * region_tag:securitycenter_v1_generated_SecurityCenter_SetMute_async + */ + setMute( + request?: protos.google.cloud.securitycenter.v1.ISetMuteRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.securitycenter.v1.IFinding, + protos.google.cloud.securitycenter.v1.ISetMuteRequest | undefined, + {} | undefined + ] + >; + setMute( + request: protos.google.cloud.securitycenter.v1.ISetMuteRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.securitycenter.v1.IFinding, + protos.google.cloud.securitycenter.v1.ISetMuteRequest | null | undefined, + {} | null | undefined + > + ): void; + setMute( + request: protos.google.cloud.securitycenter.v1.ISetMuteRequest, + callback: Callback< + protos.google.cloud.securitycenter.v1.IFinding, + protos.google.cloud.securitycenter.v1.ISetMuteRequest | null | undefined, + {} | null | undefined + > + ): void; + setMute( + request?: protos.google.cloud.securitycenter.v1.ISetMuteRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.securitycenter.v1.IFinding, + | protos.google.cloud.securitycenter.v1.ISetMuteRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.securitycenter.v1.IFinding, + protos.google.cloud.securitycenter.v1.ISetMuteRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.securitycenter.v1.IFinding, + protos.google.cloud.securitycenter.v1.ISetMuteRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + name: request.name || '', + }); + this.initialize(); + return this.innerApiCalls.setMute(request, options, callback); + } /** * Sets the access control policy on the specified Source. * @@ -1614,6 +2038,106 @@ export class SecurityCenterClient { this.initialize(); return this.innerApiCalls.updateFinding(request, options, callback); } + /** + * Updates a mute config. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.securitycenter.v1.MuteConfig} request.muteConfig + * Required. The mute config being updated. + * @param {google.protobuf.FieldMask} request.updateMask + * The list of fields to be updated. + * If empty all mutable fields will be updated. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [MuteConfig]{@link google.cloud.securitycenter.v1.MuteConfig}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/security_center.update_mute_config.js + * region_tag:securitycenter_v1_generated_SecurityCenter_UpdateMuteConfig_async + */ + updateMuteConfig( + request?: protos.google.cloud.securitycenter.v1.IUpdateMuteConfigRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.securitycenter.v1.IMuteConfig, + ( + | protos.google.cloud.securitycenter.v1.IUpdateMuteConfigRequest + | undefined + ), + {} | undefined + ] + >; + updateMuteConfig( + request: protos.google.cloud.securitycenter.v1.IUpdateMuteConfigRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.securitycenter.v1.IMuteConfig, + | protos.google.cloud.securitycenter.v1.IUpdateMuteConfigRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateMuteConfig( + request: protos.google.cloud.securitycenter.v1.IUpdateMuteConfigRequest, + callback: Callback< + protos.google.cloud.securitycenter.v1.IMuteConfig, + | protos.google.cloud.securitycenter.v1.IUpdateMuteConfigRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateMuteConfig( + request?: protos.google.cloud.securitycenter.v1.IUpdateMuteConfigRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.securitycenter.v1.IMuteConfig, + | protos.google.cloud.securitycenter.v1.IUpdateMuteConfigRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.securitycenter.v1.IMuteConfig, + | protos.google.cloud.securitycenter.v1.IUpdateMuteConfigRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.securitycenter.v1.IMuteConfig, + ( + | protos.google.cloud.securitycenter.v1.IUpdateMuteConfigRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + 'mute_config.name': request.muteConfig!.name || '', + }); + this.initialize(); + return this.innerApiCalls.updateMuteConfig(request, options, callback); + } /** * * Updates a notification config. The following update @@ -1987,26 +2511,158 @@ export class SecurityCenterClient { optionsOrCallback?: | CallOptions | Callback< - protos.google.cloud.securitycenter.v1.ISecurityMarks, - | protos.google.cloud.securitycenter.v1.IUpdateSecurityMarksRequest - | null - | undefined, + protos.google.cloud.securitycenter.v1.ISecurityMarks, + | protos.google.cloud.securitycenter.v1.IUpdateSecurityMarksRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.securitycenter.v1.ISecurityMarks, + | protos.google.cloud.securitycenter.v1.IUpdateSecurityMarksRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.securitycenter.v1.ISecurityMarks, + ( + | protos.google.cloud.securitycenter.v1.IUpdateSecurityMarksRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + 'security_marks.name': request.securityMarks!.name || '', + }); + this.initialize(); + return this.innerApiCalls.updateSecurityMarks(request, options, callback); + } + + /** + * Kicks off an LRO to bulk mute findings for a parent based on a filter. The + * parent can be either an organization, folder or project. The findings + * matched by the filter will be muted after the LRO is done. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, at which bulk action needs to be applied. Its format is + * "organizations/[organization_id]", "folders/[folder_id]", + * "projects/[project_id]". + * @param {string} request.filter + * Expression that identifies findings that should be updated. + * The expression is a list of zero or more restrictions combined + * via logical operators `AND` and `OR`. Parentheses are supported, and `OR` + * has higher precedence than `AND`. + * + * Restrictions have the form ` ` and may have a + * `-` character in front of them to indicate negation. The fields map to + * those defined in the corresponding resource. + * + * The supported operators are: + * + * * `=` for all value types. + * * `>`, `<`, `>=`, `<=` for integer values. + * * `:`, meaning substring matching, for strings. + * + * The supported value types are: + * + * * string literals in quotes. + * * integer literals without quotes. + * * boolean literals `true` and `false` without quotes. + * @param {string} request.muteAnnotation + * This can be a mute configuration name or any identifier for mute/unmute + * of findings based on the filter. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/security_center.bulk_mute_findings.js + * region_tag:securitycenter_v1_generated_SecurityCenter_BulkMuteFindings_async + */ + bulkMuteFindings( + request?: protos.google.cloud.securitycenter.v1.IBulkMuteFindingsRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.securitycenter.v1.IBulkMuteFindingsResponse, + protos.google.protobuf.IEmpty + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + bulkMuteFindings( + request: protos.google.cloud.securitycenter.v1.IBulkMuteFindingsRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.securitycenter.v1.IBulkMuteFindingsResponse, + protos.google.protobuf.IEmpty + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + bulkMuteFindings( + request: protos.google.cloud.securitycenter.v1.IBulkMuteFindingsRequest, + callback: Callback< + LROperation< + protos.google.cloud.securitycenter.v1.IBulkMuteFindingsResponse, + protos.google.protobuf.IEmpty + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + bulkMuteFindings( + request?: protos.google.cloud.securitycenter.v1.IBulkMuteFindingsRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.securitycenter.v1.IBulkMuteFindingsResponse, + protos.google.protobuf.IEmpty + >, + protos.google.longrunning.IOperation | null | undefined, {} | null | undefined >, callback?: Callback< - protos.google.cloud.securitycenter.v1.ISecurityMarks, - | protos.google.cloud.securitycenter.v1.IUpdateSecurityMarksRequest - | null - | undefined, + LROperation< + protos.google.cloud.securitycenter.v1.IBulkMuteFindingsResponse, + protos.google.protobuf.IEmpty + >, + protos.google.longrunning.IOperation | null | undefined, {} | null | undefined > ): Promise< [ - protos.google.cloud.securitycenter.v1.ISecurityMarks, - ( - | protos.google.cloud.securitycenter.v1.IUpdateSecurityMarksRequest - | undefined - ), + LROperation< + protos.google.cloud.securitycenter.v1.IBulkMuteFindingsResponse, + protos.google.protobuf.IEmpty + >, + protos.google.longrunning.IOperation | undefined, {} | undefined ] > | void { @@ -2023,12 +2679,45 @@ export class SecurityCenterClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = gax.routingHeader.fromParams({ - 'security_marks.name': request.securityMarks!.name || '', + parent: request.parent || '', }); this.initialize(); - return this.innerApiCalls.updateSecurityMarks(request, options, callback); + return this.innerApiCalls.bulkMuteFindings(request, options, callback); + } + /** + * Check the status of the long running operation returned by `bulkMuteFindings()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/security_center.bulk_mute_findings.js + * region_tag:securitycenter_v1_generated_SecurityCenter_BulkMuteFindings_async + */ + async checkBulkMuteFindingsProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.securitycenter.v1.BulkMuteFindingsResponse, + protos.google.protobuf.Empty + > + > { + const request = new operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation( + operation, + this.descriptors.longrunning.bulkMuteFindings, + gax.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.securitycenter.v1.BulkMuteFindingsResponse, + protos.google.protobuf.Empty + >; } - /** * Runs asset discovery. The discovery is tracked with a long-running * operation. @@ -4426,6 +5115,222 @@ export class SecurityCenterClient { callSettings ) as AsyncIterable; } + /** + * Lists mute configs. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns the collection of mute configs. Its format is + * "organizations/[organization_id]", "folders/[folder_id]", + * "projects/[project_id]". + * @param {number} request.pageSize + * The maximum number of configs to return. The service may return fewer than + * this value. + * If unspecified, at most 10 configs will be returned. + * The maximum value is 1000; values above 1000 will be coerced to 1000. + * @param {string} request.pageToken + * A page token, received from a previous `ListMuteConfigs` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListMuteConfigs` must + * match the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [MuteConfig]{@link google.cloud.securitycenter.v1.MuteConfig}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listMuteConfigsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listMuteConfigs( + request?: protos.google.cloud.securitycenter.v1.IListMuteConfigsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.securitycenter.v1.IMuteConfig[], + protos.google.cloud.securitycenter.v1.IListMuteConfigsRequest | null, + protos.google.cloud.securitycenter.v1.IListMuteConfigsResponse + ] + >; + listMuteConfigs( + request: protos.google.cloud.securitycenter.v1.IListMuteConfigsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.securitycenter.v1.IListMuteConfigsRequest, + | protos.google.cloud.securitycenter.v1.IListMuteConfigsResponse + | null + | undefined, + protos.google.cloud.securitycenter.v1.IMuteConfig + > + ): void; + listMuteConfigs( + request: protos.google.cloud.securitycenter.v1.IListMuteConfigsRequest, + callback: PaginationCallback< + protos.google.cloud.securitycenter.v1.IListMuteConfigsRequest, + | protos.google.cloud.securitycenter.v1.IListMuteConfigsResponse + | null + | undefined, + protos.google.cloud.securitycenter.v1.IMuteConfig + > + ): void; + listMuteConfigs( + request?: protos.google.cloud.securitycenter.v1.IListMuteConfigsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.securitycenter.v1.IListMuteConfigsRequest, + | protos.google.cloud.securitycenter.v1.IListMuteConfigsResponse + | null + | undefined, + protos.google.cloud.securitycenter.v1.IMuteConfig + >, + callback?: PaginationCallback< + protos.google.cloud.securitycenter.v1.IListMuteConfigsRequest, + | protos.google.cloud.securitycenter.v1.IListMuteConfigsResponse + | null + | undefined, + protos.google.cloud.securitycenter.v1.IMuteConfig + > + ): Promise< + [ + protos.google.cloud.securitycenter.v1.IMuteConfig[], + protos.google.cloud.securitycenter.v1.IListMuteConfigsRequest | null, + protos.google.cloud.securitycenter.v1.IListMuteConfigsResponse + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.listMuteConfigs(request, options, callback); + } + + /** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns the collection of mute configs. Its format is + * "organizations/[organization_id]", "folders/[folder_id]", + * "projects/[project_id]". + * @param {number} request.pageSize + * The maximum number of configs to return. The service may return fewer than + * this value. + * If unspecified, at most 10 configs will be returned. + * The maximum value is 1000; values above 1000 will be coerced to 1000. + * @param {string} request.pageToken + * A page token, received from a previous `ListMuteConfigs` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListMuteConfigs` must + * match the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [MuteConfig]{@link google.cloud.securitycenter.v1.MuteConfig} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listMuteConfigsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listMuteConfigsStream( + request?: protos.google.cloud.securitycenter.v1.IListMuteConfigsRequest, + options?: CallOptions + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + const defaultCallSettings = this._defaults['listMuteConfigs']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listMuteConfigs.createStream( + this.innerApiCalls.listMuteConfigs as gax.GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listMuteConfigs`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns the collection of mute configs. Its format is + * "organizations/[organization_id]", "folders/[folder_id]", + * "projects/[project_id]". + * @param {number} request.pageSize + * The maximum number of configs to return. The service may return fewer than + * this value. + * If unspecified, at most 10 configs will be returned. + * The maximum value is 1000; values above 1000 will be coerced to 1000. + * @param {string} request.pageToken + * A page token, received from a previous `ListMuteConfigs` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListMuteConfigs` must + * match the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [MuteConfig]{@link google.cloud.securitycenter.v1.MuteConfig}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example include:samples/generated/v1/security_center.list_mute_configs.js + * region_tag:securitycenter_v1_generated_SecurityCenter_ListMuteConfigs_async + */ + listMuteConfigsAsync( + request?: protos.google.cloud.securitycenter.v1.IListMuteConfigsRequest, + options?: CallOptions + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + const defaultCallSettings = this._defaults['listMuteConfigs']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listMuteConfigs.asyncIterate( + this.innerApiCalls['listMuteConfigs'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } /** * Lists notification configs. * @@ -4921,6 +5826,46 @@ export class SecurityCenterClient { ).asset; } + /** + * Return a fully-qualified folderMuteConfig resource name string. + * + * @param {string} folder + * @param {string} mute_config + * @returns {string} Resource name string. + */ + folderMuteConfigPath(folder: string, muteConfig: string) { + return this.pathTemplates.folderMuteConfigPathTemplate.render({ + folder: folder, + mute_config: muteConfig, + }); + } + + /** + * Parse the folder from FolderMuteConfig resource. + * + * @param {string} folderMuteConfigName + * A fully-qualified path representing folder_mute_config resource. + * @returns {string} A string representing the folder. + */ + matchFolderFromFolderMuteConfigName(folderMuteConfigName: string) { + return this.pathTemplates.folderMuteConfigPathTemplate.match( + folderMuteConfigName + ).folder; + } + + /** + * Parse the mute_config from FolderMuteConfig resource. + * + * @param {string} folderMuteConfigName + * A fully-qualified path representing folder_mute_config resource. + * @returns {string} A string representing the mute_config. + */ + matchMuteConfigFromFolderMuteConfigName(folderMuteConfigName: string) { + return this.pathTemplates.folderMuteConfigPathTemplate.match( + folderMuteConfigName + ).mute_config; + } + /** * Return a fully-qualified folderSource resource name string. * @@ -5233,6 +6178,50 @@ export class SecurityCenterClient { ).asset; } + /** + * Return a fully-qualified organizationMuteConfig resource name string. + * + * @param {string} organization + * @param {string} mute_config + * @returns {string} Resource name string. + */ + organizationMuteConfigPath(organization: string, muteConfig: string) { + return this.pathTemplates.organizationMuteConfigPathTemplate.render({ + organization: organization, + mute_config: muteConfig, + }); + } + + /** + * Parse the organization from OrganizationMuteConfig resource. + * + * @param {string} organizationMuteConfigName + * A fully-qualified path representing organization_mute_config resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationMuteConfigName( + organizationMuteConfigName: string + ) { + return this.pathTemplates.organizationMuteConfigPathTemplate.match( + organizationMuteConfigName + ).organization; + } + + /** + * Parse the mute_config from OrganizationMuteConfig resource. + * + * @param {string} organizationMuteConfigName + * A fully-qualified path representing organization_mute_config resource. + * @returns {string} A string representing the mute_config. + */ + matchMuteConfigFromOrganizationMuteConfigName( + organizationMuteConfigName: string + ) { + return this.pathTemplates.organizationMuteConfigPathTemplate.match( + organizationMuteConfigName + ).mute_config; + } + /** * Return a fully-qualified organizationSettings resource name string. * @@ -5514,6 +6503,46 @@ export class SecurityCenterClient { ).asset; } + /** + * Return a fully-qualified projectMuteConfig resource name string. + * + * @param {string} project + * @param {string} mute_config + * @returns {string} Resource name string. + */ + projectMuteConfigPath(project: string, muteConfig: string) { + return this.pathTemplates.projectMuteConfigPathTemplate.render({ + project: project, + mute_config: muteConfig, + }); + } + + /** + * Parse the project from ProjectMuteConfig resource. + * + * @param {string} projectMuteConfigName + * A fully-qualified path representing project_mute_config resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectMuteConfigName(projectMuteConfigName: string) { + return this.pathTemplates.projectMuteConfigPathTemplate.match( + projectMuteConfigName + ).project; + } + + /** + * Parse the mute_config from ProjectMuteConfig resource. + * + * @param {string} projectMuteConfigName + * A fully-qualified path representing project_mute_config resource. + * @returns {string} A string representing the mute_config. + */ + matchMuteConfigFromProjectMuteConfigName(projectMuteConfigName: string) { + return this.pathTemplates.projectMuteConfigPathTemplate.match( + projectMuteConfigName + ).mute_config; + } + /** * Return a fully-qualified projectSource resource name string. * diff --git a/packages/google-cloud-securitycenter/src/v1/security_center_client_config.json b/packages/google-cloud-securitycenter/src/v1/security_center_client_config.json index dbb23072520..f42e8c7db8b 100644 --- a/packages/google-cloud-securitycenter/src/v1/security_center_client_config.json +++ b/packages/google-cloud-securitycenter/src/v1/security_center_client_config.json @@ -20,6 +20,10 @@ } }, "methods": { + "BulkMuteFindings": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, "CreateSource": { "timeout_millis": 60000, "retry_codes_name": "non_idempotent", @@ -30,11 +34,19 @@ "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, + "CreateMuteConfig": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, "CreateNotificationConfig": { "timeout_millis": 60000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, + "DeleteMuteConfig": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, "DeleteNotificationConfig": { "timeout_millis": 60000, "retry_codes_name": "non_idempotent", @@ -45,6 +57,10 @@ "retry_codes_name": "idempotent", "retry_params_name": "default" }, + "GetMuteConfig": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, "GetNotificationConfig": { "timeout_millis": 60000, "retry_codes_name": "idempotent", @@ -80,6 +96,10 @@ "retry_codes_name": "idempotent", "retry_params_name": "default" }, + "ListMuteConfigs": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, "ListNotificationConfigs": { "timeout_millis": 60000, "retry_codes_name": "idempotent", @@ -100,6 +120,10 @@ "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, + "SetMute": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, "SetIamPolicy": { "timeout_millis": 60000, "retry_codes_name": "non_idempotent", @@ -115,6 +139,10 @@ "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, + "UpdateMuteConfig": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, "UpdateNotificationConfig": { "timeout_millis": 60000, "retry_codes_name": "non_idempotent", diff --git a/packages/google-cloud-securitycenter/src/v1/security_center_proto_list.json b/packages/google-cloud-securitycenter/src/v1/security_center_proto_list.json index dbee8391a70..a32f4658899 100644 --- a/packages/google-cloud-securitycenter/src/v1/security_center_proto_list.json +++ b/packages/google-cloud-securitycenter/src/v1/security_center_proto_list.json @@ -3,6 +3,7 @@ "../../protos/google/cloud/securitycenter/v1/finding.proto", "../../protos/google/cloud/securitycenter/v1/folder.proto", "../../protos/google/cloud/securitycenter/v1/indicator.proto", + "../../protos/google/cloud/securitycenter/v1/mute_config.proto", "../../protos/google/cloud/securitycenter/v1/notification_config.proto", "../../protos/google/cloud/securitycenter/v1/notification_message.proto", "../../protos/google/cloud/securitycenter/v1/organization_settings.proto", diff --git a/packages/google-cloud-securitycenter/test/gapic_security_center_v1.ts b/packages/google-cloud-securitycenter/test/gapic_security_center_v1.ts index 0b3e41f46ca..080ff5d2159 100644 --- a/packages/google-cloud-securitycenter/test/gapic_security_center_v1.ts +++ b/packages/google-cloud-securitycenter/test/gapic_security_center_v1.ts @@ -449,15 +449,15 @@ describe('v1.SecurityCenterClient', () => { }); }); - describe('createNotificationConfig', () => { - it('invokes createNotificationConfig without error', async () => { + describe('createMuteConfig', () => { + it('invokes createMuteConfig without error', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.CreateNotificationConfigRequest() + new protos.google.cloud.securitycenter.v1.CreateMuteConfigRequest() ); request.parent = ''; const expectedHeaderRequestParams = 'parent='; @@ -469,27 +469,26 @@ describe('v1.SecurityCenterClient', () => { }, }; const expectedResponse = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.NotificationConfig() + new protos.google.cloud.securitycenter.v1.MuteConfig() ); - client.innerApiCalls.createNotificationConfig = - stubSimpleCall(expectedResponse); - const [response] = await client.createNotificationConfig(request); + client.innerApiCalls.createMuteConfig = stubSimpleCall(expectedResponse); + const [response] = await client.createMuteConfig(request); assert.deepStrictEqual(response, expectedResponse); assert( - (client.innerApiCalls.createNotificationConfig as SinonStub) + (client.innerApiCalls.createMuteConfig as SinonStub) .getCall(0) .calledWith(request, expectedOptions, undefined) ); }); - it('invokes createNotificationConfig without error using callback', async () => { + it('invokes createMuteConfig without error using callback', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.CreateNotificationConfigRequest() + new protos.google.cloud.securitycenter.v1.CreateMuteConfigRequest() ); request.parent = ''; const expectedHeaderRequestParams = 'parent='; @@ -501,16 +500,16 @@ describe('v1.SecurityCenterClient', () => { }, }; const expectedResponse = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.NotificationConfig() + new protos.google.cloud.securitycenter.v1.MuteConfig() ); - client.innerApiCalls.createNotificationConfig = + client.innerApiCalls.createMuteConfig = stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.createNotificationConfig( + client.createMuteConfig( request, ( err?: Error | null, - result?: protos.google.cloud.securitycenter.v1.INotificationConfig | null + result?: protos.google.cloud.securitycenter.v1.IMuteConfig | null ) => { if (err) { reject(err); @@ -523,20 +522,20 @@ describe('v1.SecurityCenterClient', () => { const response = await promise; assert.deepStrictEqual(response, expectedResponse); assert( - (client.innerApiCalls.createNotificationConfig as SinonStub) + (client.innerApiCalls.createMuteConfig as SinonStub) .getCall(0) .calledWith(request, expectedOptions /*, callback defined above */) ); }); - it('invokes createNotificationConfig with error', async () => { + it('invokes createMuteConfig with error', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.CreateNotificationConfigRequest() + new protos.google.cloud.securitycenter.v1.CreateMuteConfigRequest() ); request.parent = ''; const expectedHeaderRequestParams = 'parent='; @@ -548,34 +547,31 @@ describe('v1.SecurityCenterClient', () => { }, }; const expectedError = new Error('expected'); - client.innerApiCalls.createNotificationConfig = stubSimpleCall( + client.innerApiCalls.createMuteConfig = stubSimpleCall( undefined, expectedError ); - await assert.rejects( - client.createNotificationConfig(request), - expectedError - ); + await assert.rejects(client.createMuteConfig(request), expectedError); assert( - (client.innerApiCalls.createNotificationConfig as SinonStub) + (client.innerApiCalls.createMuteConfig as SinonStub) .getCall(0) .calledWith(request, expectedOptions, undefined) ); }); }); - describe('deleteNotificationConfig', () => { - it('invokes deleteNotificationConfig without error', async () => { + describe('createNotificationConfig', () => { + it('invokes createNotificationConfig without error', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.DeleteNotificationConfigRequest() + new protos.google.cloud.securitycenter.v1.CreateNotificationConfigRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; const expectedOptions = { otherArgs: { headers: { @@ -584,30 +580,30 @@ describe('v1.SecurityCenterClient', () => { }, }; const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() + new protos.google.cloud.securitycenter.v1.NotificationConfig() ); - client.innerApiCalls.deleteNotificationConfig = + client.innerApiCalls.createNotificationConfig = stubSimpleCall(expectedResponse); - const [response] = await client.deleteNotificationConfig(request); + const [response] = await client.createNotificationConfig(request); assert.deepStrictEqual(response, expectedResponse); assert( - (client.innerApiCalls.deleteNotificationConfig as SinonStub) + (client.innerApiCalls.createNotificationConfig as SinonStub) .getCall(0) .calledWith(request, expectedOptions, undefined) ); }); - it('invokes deleteNotificationConfig without error using callback', async () => { + it('invokes createNotificationConfig without error using callback', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.DeleteNotificationConfigRequest() + new protos.google.cloud.securitycenter.v1.CreateNotificationConfigRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; const expectedOptions = { otherArgs: { headers: { @@ -616,16 +612,16 @@ describe('v1.SecurityCenterClient', () => { }, }; const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() + new protos.google.cloud.securitycenter.v1.NotificationConfig() ); - client.innerApiCalls.deleteNotificationConfig = + client.innerApiCalls.createNotificationConfig = stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.deleteNotificationConfig( + client.createNotificationConfig( request, ( err?: Error | null, - result?: protos.google.protobuf.IEmpty | null + result?: protos.google.cloud.securitycenter.v1.INotificationConfig | null ) => { if (err) { reject(err); @@ -638,23 +634,23 @@ describe('v1.SecurityCenterClient', () => { const response = await promise; assert.deepStrictEqual(response, expectedResponse); assert( - (client.innerApiCalls.deleteNotificationConfig as SinonStub) + (client.innerApiCalls.createNotificationConfig as SinonStub) .getCall(0) .calledWith(request, expectedOptions /*, callback defined above */) ); }); - it('invokes deleteNotificationConfig with error', async () => { + it('invokes createNotificationConfig with error', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.DeleteNotificationConfigRequest() + new protos.google.cloud.securitycenter.v1.CreateNotificationConfigRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; const expectedOptions = { otherArgs: { headers: { @@ -663,34 +659,34 @@ describe('v1.SecurityCenterClient', () => { }, }; const expectedError = new Error('expected'); - client.innerApiCalls.deleteNotificationConfig = stubSimpleCall( + client.innerApiCalls.createNotificationConfig = stubSimpleCall( undefined, expectedError ); await assert.rejects( - client.deleteNotificationConfig(request), + client.createNotificationConfig(request), expectedError ); assert( - (client.innerApiCalls.deleteNotificationConfig as SinonStub) + (client.innerApiCalls.createNotificationConfig as SinonStub) .getCall(0) .calledWith(request, expectedOptions, undefined) ); }); }); - describe('getIamPolicy', () => { - it('invokes getIamPolicy without error', async () => { + describe('deleteMuteConfig', () => { + it('invokes deleteMuteConfig without error', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.iam.v1.GetIamPolicyRequest() + new protos.google.cloud.securitycenter.v1.DeleteMuteConfigRequest() ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; + request.name = ''; + const expectedHeaderRequestParams = 'name='; const expectedOptions = { otherArgs: { headers: { @@ -699,29 +695,29 @@ describe('v1.SecurityCenterClient', () => { }, }; const expectedResponse = generateSampleMessage( - new protos.google.iam.v1.Policy() + new protos.google.protobuf.Empty() ); - client.innerApiCalls.getIamPolicy = stubSimpleCall(expectedResponse); - const [response] = await client.getIamPolicy(request); + client.innerApiCalls.deleteMuteConfig = stubSimpleCall(expectedResponse); + const [response] = await client.deleteMuteConfig(request); assert.deepStrictEqual(response, expectedResponse); assert( - (client.innerApiCalls.getIamPolicy as SinonStub) + (client.innerApiCalls.deleteMuteConfig as SinonStub) .getCall(0) .calledWith(request, expectedOptions, undefined) ); }); - it('invokes getIamPolicy without error using callback', async () => { + it('invokes deleteMuteConfig without error using callback', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.iam.v1.GetIamPolicyRequest() + new protos.google.cloud.securitycenter.v1.DeleteMuteConfigRequest() ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; + request.name = ''; + const expectedHeaderRequestParams = 'name='; const expectedOptions = { otherArgs: { headers: { @@ -730,16 +726,16 @@ describe('v1.SecurityCenterClient', () => { }, }; const expectedResponse = generateSampleMessage( - new protos.google.iam.v1.Policy() + new protos.google.protobuf.Empty() ); - client.innerApiCalls.getIamPolicy = + client.innerApiCalls.deleteMuteConfig = stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.getIamPolicy( + client.deleteMuteConfig( request, ( err?: Error | null, - result?: protos.google.iam.v1.IPolicy | null + result?: protos.google.protobuf.IEmpty | null ) => { if (err) { reject(err); @@ -752,23 +748,23 @@ describe('v1.SecurityCenterClient', () => { const response = await promise; assert.deepStrictEqual(response, expectedResponse); assert( - (client.innerApiCalls.getIamPolicy as SinonStub) + (client.innerApiCalls.deleteMuteConfig as SinonStub) .getCall(0) .calledWith(request, expectedOptions /*, callback defined above */) ); }); - it('invokes getIamPolicy with error', async () => { + it('invokes deleteMuteConfig with error', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.iam.v1.GetIamPolicyRequest() + new protos.google.cloud.securitycenter.v1.DeleteMuteConfigRequest() ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; + request.name = ''; + const expectedHeaderRequestParams = 'name='; const expectedOptions = { otherArgs: { headers: { @@ -777,28 +773,28 @@ describe('v1.SecurityCenterClient', () => { }, }; const expectedError = new Error('expected'); - client.innerApiCalls.getIamPolicy = stubSimpleCall( + client.innerApiCalls.deleteMuteConfig = stubSimpleCall( undefined, expectedError ); - await assert.rejects(client.getIamPolicy(request), expectedError); + await assert.rejects(client.deleteMuteConfig(request), expectedError); assert( - (client.innerApiCalls.getIamPolicy as SinonStub) + (client.innerApiCalls.deleteMuteConfig as SinonStub) .getCall(0) .calledWith(request, expectedOptions, undefined) ); }); }); - describe('getNotificationConfig', () => { - it('invokes getNotificationConfig without error', async () => { + describe('deleteNotificationConfig', () => { + it('invokes deleteNotificationConfig without error', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.GetNotificationConfigRequest() + new protos.google.cloud.securitycenter.v1.DeleteNotificationConfigRequest() ); request.name = ''; const expectedHeaderRequestParams = 'name='; @@ -810,27 +806,27 @@ describe('v1.SecurityCenterClient', () => { }, }; const expectedResponse = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.NotificationConfig() + new protos.google.protobuf.Empty() ); - client.innerApiCalls.getNotificationConfig = + client.innerApiCalls.deleteNotificationConfig = stubSimpleCall(expectedResponse); - const [response] = await client.getNotificationConfig(request); + const [response] = await client.deleteNotificationConfig(request); assert.deepStrictEqual(response, expectedResponse); assert( - (client.innerApiCalls.getNotificationConfig as SinonStub) + (client.innerApiCalls.deleteNotificationConfig as SinonStub) .getCall(0) .calledWith(request, expectedOptions, undefined) ); }); - it('invokes getNotificationConfig without error using callback', async () => { + it('invokes deleteNotificationConfig without error using callback', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.GetNotificationConfigRequest() + new protos.google.cloud.securitycenter.v1.DeleteNotificationConfigRequest() ); request.name = ''; const expectedHeaderRequestParams = 'name='; @@ -842,16 +838,16 @@ describe('v1.SecurityCenterClient', () => { }, }; const expectedResponse = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.NotificationConfig() + new protos.google.protobuf.Empty() ); - client.innerApiCalls.getNotificationConfig = + client.innerApiCalls.deleteNotificationConfig = stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.getNotificationConfig( + client.deleteNotificationConfig( request, ( err?: Error | null, - result?: protos.google.cloud.securitycenter.v1.INotificationConfig | null + result?: protos.google.protobuf.IEmpty | null ) => { if (err) { reject(err); @@ -864,20 +860,20 @@ describe('v1.SecurityCenterClient', () => { const response = await promise; assert.deepStrictEqual(response, expectedResponse); assert( - (client.innerApiCalls.getNotificationConfig as SinonStub) + (client.innerApiCalls.deleteNotificationConfig as SinonStub) .getCall(0) .calledWith(request, expectedOptions /*, callback defined above */) ); }); - it('invokes getNotificationConfig with error', async () => { + it('invokes deleteNotificationConfig with error', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.GetNotificationConfigRequest() + new protos.google.cloud.securitycenter.v1.DeleteNotificationConfigRequest() ); request.name = ''; const expectedHeaderRequestParams = 'name='; @@ -889,34 +885,34 @@ describe('v1.SecurityCenterClient', () => { }, }; const expectedError = new Error('expected'); - client.innerApiCalls.getNotificationConfig = stubSimpleCall( + client.innerApiCalls.deleteNotificationConfig = stubSimpleCall( undefined, expectedError ); await assert.rejects( - client.getNotificationConfig(request), + client.deleteNotificationConfig(request), expectedError ); assert( - (client.innerApiCalls.getNotificationConfig as SinonStub) + (client.innerApiCalls.deleteNotificationConfig as SinonStub) .getCall(0) .calledWith(request, expectedOptions, undefined) ); }); }); - describe('getOrganizationSettings', () => { - it('invokes getOrganizationSettings without error', async () => { + describe('getIamPolicy', () => { + it('invokes getIamPolicy without error', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.GetOrganizationSettingsRequest() + new protos.google.iam.v1.GetIamPolicyRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; const expectedOptions = { otherArgs: { headers: { @@ -925,30 +921,29 @@ describe('v1.SecurityCenterClient', () => { }, }; const expectedResponse = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.OrganizationSettings() + new protos.google.iam.v1.Policy() ); - client.innerApiCalls.getOrganizationSettings = - stubSimpleCall(expectedResponse); - const [response] = await client.getOrganizationSettings(request); + client.innerApiCalls.getIamPolicy = stubSimpleCall(expectedResponse); + const [response] = await client.getIamPolicy(request); assert.deepStrictEqual(response, expectedResponse); assert( - (client.innerApiCalls.getOrganizationSettings as SinonStub) + (client.innerApiCalls.getIamPolicy as SinonStub) .getCall(0) .calledWith(request, expectedOptions, undefined) ); }); - it('invokes getOrganizationSettings without error using callback', async () => { + it('invokes getIamPolicy without error using callback', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.GetOrganizationSettingsRequest() + new protos.google.iam.v1.GetIamPolicyRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; const expectedOptions = { otherArgs: { headers: { @@ -957,16 +952,16 @@ describe('v1.SecurityCenterClient', () => { }, }; const expectedResponse = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.OrganizationSettings() + new protos.google.iam.v1.Policy() ); - client.innerApiCalls.getOrganizationSettings = + client.innerApiCalls.getIamPolicy = stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.getOrganizationSettings( + client.getIamPolicy( request, ( err?: Error | null, - result?: protos.google.cloud.securitycenter.v1.IOrganizationSettings | null + result?: protos.google.iam.v1.IPolicy | null ) => { if (err) { reject(err); @@ -979,23 +974,23 @@ describe('v1.SecurityCenterClient', () => { const response = await promise; assert.deepStrictEqual(response, expectedResponse); assert( - (client.innerApiCalls.getOrganizationSettings as SinonStub) + (client.innerApiCalls.getIamPolicy as SinonStub) .getCall(0) .calledWith(request, expectedOptions /*, callback defined above */) ); }); - it('invokes getOrganizationSettings with error', async () => { + it('invokes getIamPolicy with error', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.GetOrganizationSettingsRequest() + new protos.google.iam.v1.GetIamPolicyRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; const expectedOptions = { otherArgs: { headers: { @@ -1004,31 +999,28 @@ describe('v1.SecurityCenterClient', () => { }, }; const expectedError = new Error('expected'); - client.innerApiCalls.getOrganizationSettings = stubSimpleCall( + client.innerApiCalls.getIamPolicy = stubSimpleCall( undefined, expectedError ); - await assert.rejects( - client.getOrganizationSettings(request), - expectedError - ); + await assert.rejects(client.getIamPolicy(request), expectedError); assert( - (client.innerApiCalls.getOrganizationSettings as SinonStub) + (client.innerApiCalls.getIamPolicy as SinonStub) .getCall(0) .calledWith(request, expectedOptions, undefined) ); }); }); - describe('getSource', () => { - it('invokes getSource without error', async () => { + describe('getMuteConfig', () => { + it('invokes getMuteConfig without error', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.GetSourceRequest() + new protos.google.cloud.securitycenter.v1.GetMuteConfigRequest() ); request.name = ''; const expectedHeaderRequestParams = 'name='; @@ -1040,26 +1032,26 @@ describe('v1.SecurityCenterClient', () => { }, }; const expectedResponse = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.Source() + new protos.google.cloud.securitycenter.v1.MuteConfig() ); - client.innerApiCalls.getSource = stubSimpleCall(expectedResponse); - const [response] = await client.getSource(request); + client.innerApiCalls.getMuteConfig = stubSimpleCall(expectedResponse); + const [response] = await client.getMuteConfig(request); assert.deepStrictEqual(response, expectedResponse); assert( - (client.innerApiCalls.getSource as SinonStub) + (client.innerApiCalls.getMuteConfig as SinonStub) .getCall(0) .calledWith(request, expectedOptions, undefined) ); }); - it('invokes getSource without error using callback', async () => { + it('invokes getMuteConfig without error using callback', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.GetSourceRequest() + new protos.google.cloud.securitycenter.v1.GetMuteConfigRequest() ); request.name = ''; const expectedHeaderRequestParams = 'name='; @@ -1071,16 +1063,16 @@ describe('v1.SecurityCenterClient', () => { }, }; const expectedResponse = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.Source() + new protos.google.cloud.securitycenter.v1.MuteConfig() ); - client.innerApiCalls.getSource = + client.innerApiCalls.getMuteConfig = stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.getSource( + client.getMuteConfig( request, ( err?: Error | null, - result?: protos.google.cloud.securitycenter.v1.ISource | null + result?: protos.google.cloud.securitycenter.v1.IMuteConfig | null ) => { if (err) { reject(err); @@ -1093,20 +1085,20 @@ describe('v1.SecurityCenterClient', () => { const response = await promise; assert.deepStrictEqual(response, expectedResponse); assert( - (client.innerApiCalls.getSource as SinonStub) + (client.innerApiCalls.getMuteConfig as SinonStub) .getCall(0) .calledWith(request, expectedOptions /*, callback defined above */) ); }); - it('invokes getSource with error', async () => { + it('invokes getMuteConfig with error', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.GetSourceRequest() + new protos.google.cloud.securitycenter.v1.GetMuteConfigRequest() ); request.name = ''; const expectedHeaderRequestParams = 'name='; @@ -1118,25 +1110,28 @@ describe('v1.SecurityCenterClient', () => { }, }; const expectedError = new Error('expected'); - client.innerApiCalls.getSource = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getSource(request), expectedError); + client.innerApiCalls.getMuteConfig = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getMuteConfig(request), expectedError); assert( - (client.innerApiCalls.getSource as SinonStub) + (client.innerApiCalls.getMuteConfig as SinonStub) .getCall(0) .calledWith(request, expectedOptions, undefined) ); }); }); - describe('setFindingState', () => { - it('invokes setFindingState without error', async () => { + describe('getNotificationConfig', () => { + it('invokes getNotificationConfig without error', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.SetFindingStateRequest() + new protos.google.cloud.securitycenter.v1.GetNotificationConfigRequest() ); request.name = ''; const expectedHeaderRequestParams = 'name='; @@ -1148,26 +1143,27 @@ describe('v1.SecurityCenterClient', () => { }, }; const expectedResponse = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.Finding() + new protos.google.cloud.securitycenter.v1.NotificationConfig() ); - client.innerApiCalls.setFindingState = stubSimpleCall(expectedResponse); - const [response] = await client.setFindingState(request); + client.innerApiCalls.getNotificationConfig = + stubSimpleCall(expectedResponse); + const [response] = await client.getNotificationConfig(request); assert.deepStrictEqual(response, expectedResponse); assert( - (client.innerApiCalls.setFindingState as SinonStub) + (client.innerApiCalls.getNotificationConfig as SinonStub) .getCall(0) .calledWith(request, expectedOptions, undefined) ); }); - it('invokes setFindingState without error using callback', async () => { + it('invokes getNotificationConfig without error using callback', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.SetFindingStateRequest() + new protos.google.cloud.securitycenter.v1.GetNotificationConfigRequest() ); request.name = ''; const expectedHeaderRequestParams = 'name='; @@ -1179,16 +1175,16 @@ describe('v1.SecurityCenterClient', () => { }, }; const expectedResponse = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.Finding() + new protos.google.cloud.securitycenter.v1.NotificationConfig() ); - client.innerApiCalls.setFindingState = + client.innerApiCalls.getNotificationConfig = stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.setFindingState( + client.getNotificationConfig( request, ( err?: Error | null, - result?: protos.google.cloud.securitycenter.v1.IFinding | null + result?: protos.google.cloud.securitycenter.v1.INotificationConfig | null ) => { if (err) { reject(err); @@ -1201,20 +1197,20 @@ describe('v1.SecurityCenterClient', () => { const response = await promise; assert.deepStrictEqual(response, expectedResponse); assert( - (client.innerApiCalls.setFindingState as SinonStub) + (client.innerApiCalls.getNotificationConfig as SinonStub) .getCall(0) .calledWith(request, expectedOptions /*, callback defined above */) ); }); - it('invokes setFindingState with error', async () => { + it('invokes getNotificationConfig with error', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.SetFindingStateRequest() + new protos.google.cloud.securitycenter.v1.GetNotificationConfigRequest() ); request.name = ''; const expectedHeaderRequestParams = 'name='; @@ -1226,31 +1222,34 @@ describe('v1.SecurityCenterClient', () => { }, }; const expectedError = new Error('expected'); - client.innerApiCalls.setFindingState = stubSimpleCall( + client.innerApiCalls.getNotificationConfig = stubSimpleCall( undefined, expectedError ); - await assert.rejects(client.setFindingState(request), expectedError); + await assert.rejects( + client.getNotificationConfig(request), + expectedError + ); assert( - (client.innerApiCalls.setFindingState as SinonStub) + (client.innerApiCalls.getNotificationConfig as SinonStub) .getCall(0) .calledWith(request, expectedOptions, undefined) ); }); }); - describe('setIamPolicy', () => { - it('invokes setIamPolicy without error', async () => { + describe('getOrganizationSettings', () => { + it('invokes getOrganizationSettings without error', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.iam.v1.SetIamPolicyRequest() + new protos.google.cloud.securitycenter.v1.GetOrganizationSettingsRequest() ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; + request.name = ''; + const expectedHeaderRequestParams = 'name='; const expectedOptions = { otherArgs: { headers: { @@ -1259,29 +1258,30 @@ describe('v1.SecurityCenterClient', () => { }, }; const expectedResponse = generateSampleMessage( - new protos.google.iam.v1.Policy() + new protos.google.cloud.securitycenter.v1.OrganizationSettings() ); - client.innerApiCalls.setIamPolicy = stubSimpleCall(expectedResponse); - const [response] = await client.setIamPolicy(request); + client.innerApiCalls.getOrganizationSettings = + stubSimpleCall(expectedResponse); + const [response] = await client.getOrganizationSettings(request); assert.deepStrictEqual(response, expectedResponse); assert( - (client.innerApiCalls.setIamPolicy as SinonStub) + (client.innerApiCalls.getOrganizationSettings as SinonStub) .getCall(0) .calledWith(request, expectedOptions, undefined) ); }); - it('invokes setIamPolicy without error using callback', async () => { + it('invokes getOrganizationSettings without error using callback', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.iam.v1.SetIamPolicyRequest() + new protos.google.cloud.securitycenter.v1.GetOrganizationSettingsRequest() ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; + request.name = ''; + const expectedHeaderRequestParams = 'name='; const expectedOptions = { otherArgs: { headers: { @@ -1290,16 +1290,16 @@ describe('v1.SecurityCenterClient', () => { }, }; const expectedResponse = generateSampleMessage( - new protos.google.iam.v1.Policy() + new protos.google.cloud.securitycenter.v1.OrganizationSettings() ); - client.innerApiCalls.setIamPolicy = + client.innerApiCalls.getOrganizationSettings = stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.setIamPolicy( + client.getOrganizationSettings( request, ( err?: Error | null, - result?: protos.google.iam.v1.IPolicy | null + result?: protos.google.cloud.securitycenter.v1.IOrganizationSettings | null ) => { if (err) { reject(err); @@ -1312,23 +1312,23 @@ describe('v1.SecurityCenterClient', () => { const response = await promise; assert.deepStrictEqual(response, expectedResponse); assert( - (client.innerApiCalls.setIamPolicy as SinonStub) + (client.innerApiCalls.getOrganizationSettings as SinonStub) .getCall(0) .calledWith(request, expectedOptions /*, callback defined above */) ); }); - it('invokes setIamPolicy with error', async () => { + it('invokes getOrganizationSettings with error', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.iam.v1.SetIamPolicyRequest() + new protos.google.cloud.securitycenter.v1.GetOrganizationSettingsRequest() ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; + request.name = ''; + const expectedHeaderRequestParams = 'name='; const expectedOptions = { otherArgs: { headers: { @@ -1337,31 +1337,34 @@ describe('v1.SecurityCenterClient', () => { }, }; const expectedError = new Error('expected'); - client.innerApiCalls.setIamPolicy = stubSimpleCall( + client.innerApiCalls.getOrganizationSettings = stubSimpleCall( undefined, expectedError ); - await assert.rejects(client.setIamPolicy(request), expectedError); + await assert.rejects( + client.getOrganizationSettings(request), + expectedError + ); assert( - (client.innerApiCalls.setIamPolicy as SinonStub) + (client.innerApiCalls.getOrganizationSettings as SinonStub) .getCall(0) .calledWith(request, expectedOptions, undefined) ); }); }); - describe('testIamPermissions', () => { - it('invokes testIamPermissions without error', async () => { + describe('getSource', () => { + it('invokes getSource without error', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.iam.v1.TestIamPermissionsRequest() + new protos.google.cloud.securitycenter.v1.GetSourceRequest() ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; + request.name = ''; + const expectedHeaderRequestParams = 'name='; const expectedOptions = { otherArgs: { headers: { @@ -1370,30 +1373,29 @@ describe('v1.SecurityCenterClient', () => { }, }; const expectedResponse = generateSampleMessage( - new protos.google.iam.v1.TestIamPermissionsResponse() + new protos.google.cloud.securitycenter.v1.Source() ); - client.innerApiCalls.testIamPermissions = - stubSimpleCall(expectedResponse); - const [response] = await client.testIamPermissions(request); + client.innerApiCalls.getSource = stubSimpleCall(expectedResponse); + const [response] = await client.getSource(request); assert.deepStrictEqual(response, expectedResponse); assert( - (client.innerApiCalls.testIamPermissions as SinonStub) + (client.innerApiCalls.getSource as SinonStub) .getCall(0) .calledWith(request, expectedOptions, undefined) ); }); - it('invokes testIamPermissions without error using callback', async () => { + it('invokes getSource without error using callback', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.iam.v1.TestIamPermissionsRequest() + new protos.google.cloud.securitycenter.v1.GetSourceRequest() ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; + request.name = ''; + const expectedHeaderRequestParams = 'name='; const expectedOptions = { otherArgs: { headers: { @@ -1402,16 +1404,16 @@ describe('v1.SecurityCenterClient', () => { }, }; const expectedResponse = generateSampleMessage( - new protos.google.iam.v1.TestIamPermissionsResponse() + new protos.google.cloud.securitycenter.v1.Source() ); - client.innerApiCalls.testIamPermissions = + client.innerApiCalls.getSource = stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.testIamPermissions( + client.getSource( request, ( err?: Error | null, - result?: protos.google.iam.v1.ITestIamPermissionsResponse | null + result?: protos.google.cloud.securitycenter.v1.ISource | null ) => { if (err) { reject(err); @@ -1424,23 +1426,23 @@ describe('v1.SecurityCenterClient', () => { const response = await promise; assert.deepStrictEqual(response, expectedResponse); assert( - (client.innerApiCalls.testIamPermissions as SinonStub) + (client.innerApiCalls.getSource as SinonStub) .getCall(0) .calledWith(request, expectedOptions /*, callback defined above */) ); }); - it('invokes testIamPermissions with error', async () => { + it('invokes getSource with error', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.iam.v1.TestIamPermissionsRequest() + new protos.google.cloud.securitycenter.v1.GetSourceRequest() ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; + request.name = ''; + const expectedHeaderRequestParams = 'name='; const expectedOptions = { otherArgs: { headers: { @@ -1449,32 +1451,28 @@ describe('v1.SecurityCenterClient', () => { }, }; const expectedError = new Error('expected'); - client.innerApiCalls.testIamPermissions = stubSimpleCall( - undefined, - expectedError - ); - await assert.rejects(client.testIamPermissions(request), expectedError); + client.innerApiCalls.getSource = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getSource(request), expectedError); assert( - (client.innerApiCalls.testIamPermissions as SinonStub) + (client.innerApiCalls.getSource as SinonStub) .getCall(0) .calledWith(request, expectedOptions, undefined) ); }); }); - describe('updateFinding', () => { - it('invokes updateFinding without error', async () => { + describe('setFindingState', () => { + it('invokes setFindingState without error', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.UpdateFindingRequest() + new protos.google.cloud.securitycenter.v1.SetFindingStateRequest() ); - request.finding = {}; - request.finding.name = ''; - const expectedHeaderRequestParams = 'finding.name='; + request.name = ''; + const expectedHeaderRequestParams = 'name='; const expectedOptions = { otherArgs: { headers: { @@ -1485,28 +1483,27 @@ describe('v1.SecurityCenterClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.securitycenter.v1.Finding() ); - client.innerApiCalls.updateFinding = stubSimpleCall(expectedResponse); - const [response] = await client.updateFinding(request); + client.innerApiCalls.setFindingState = stubSimpleCall(expectedResponse); + const [response] = await client.setFindingState(request); assert.deepStrictEqual(response, expectedResponse); assert( - (client.innerApiCalls.updateFinding as SinonStub) + (client.innerApiCalls.setFindingState as SinonStub) .getCall(0) .calledWith(request, expectedOptions, undefined) ); }); - it('invokes updateFinding without error using callback', async () => { + it('invokes setFindingState without error using callback', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.UpdateFindingRequest() + new protos.google.cloud.securitycenter.v1.SetFindingStateRequest() ); - request.finding = {}; - request.finding.name = ''; - const expectedHeaderRequestParams = 'finding.name='; + request.name = ''; + const expectedHeaderRequestParams = 'name='; const expectedOptions = { otherArgs: { headers: { @@ -1517,10 +1514,10 @@ describe('v1.SecurityCenterClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.securitycenter.v1.Finding() ); - client.innerApiCalls.updateFinding = + client.innerApiCalls.setFindingState = stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.updateFinding( + client.setFindingState( request, ( err?: Error | null, @@ -1537,24 +1534,23 @@ describe('v1.SecurityCenterClient', () => { const response = await promise; assert.deepStrictEqual(response, expectedResponse); assert( - (client.innerApiCalls.updateFinding as SinonStub) + (client.innerApiCalls.setFindingState as SinonStub) .getCall(0) .calledWith(request, expectedOptions /*, callback defined above */) ); }); - it('invokes updateFinding with error', async () => { + it('invokes setFindingState with error', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.UpdateFindingRequest() + new protos.google.cloud.securitycenter.v1.SetFindingStateRequest() ); - request.finding = {}; - request.finding.name = ''; - const expectedHeaderRequestParams = 'finding.name='; + request.name = ''; + const expectedHeaderRequestParams = 'name='; const expectedOptions = { otherArgs: { headers: { @@ -1563,32 +1559,31 @@ describe('v1.SecurityCenterClient', () => { }, }; const expectedError = new Error('expected'); - client.innerApiCalls.updateFinding = stubSimpleCall( + client.innerApiCalls.setFindingState = stubSimpleCall( undefined, expectedError ); - await assert.rejects(client.updateFinding(request), expectedError); + await assert.rejects(client.setFindingState(request), expectedError); assert( - (client.innerApiCalls.updateFinding as SinonStub) + (client.innerApiCalls.setFindingState as SinonStub) .getCall(0) .calledWith(request, expectedOptions, undefined) ); }); }); - describe('updateNotificationConfig', () => { - it('invokes updateNotificationConfig without error', async () => { + describe('setMute', () => { + it('invokes setMute without error', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.UpdateNotificationConfigRequest() + new protos.google.cloud.securitycenter.v1.SetMuteRequest() ); - request.notificationConfig = {}; - request.notificationConfig.name = ''; - const expectedHeaderRequestParams = 'notification_config.name='; + request.name = ''; + const expectedHeaderRequestParams = 'name='; const expectedOptions = { otherArgs: { headers: { @@ -1597,31 +1592,29 @@ describe('v1.SecurityCenterClient', () => { }, }; const expectedResponse = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.NotificationConfig() + new protos.google.cloud.securitycenter.v1.Finding() ); - client.innerApiCalls.updateNotificationConfig = - stubSimpleCall(expectedResponse); - const [response] = await client.updateNotificationConfig(request); + client.innerApiCalls.setMute = stubSimpleCall(expectedResponse); + const [response] = await client.setMute(request); assert.deepStrictEqual(response, expectedResponse); assert( - (client.innerApiCalls.updateNotificationConfig as SinonStub) + (client.innerApiCalls.setMute as SinonStub) .getCall(0) .calledWith(request, expectedOptions, undefined) ); }); - it('invokes updateNotificationConfig without error using callback', async () => { + it('invokes setMute without error using callback', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.UpdateNotificationConfigRequest() + new protos.google.cloud.securitycenter.v1.SetMuteRequest() ); - request.notificationConfig = {}; - request.notificationConfig.name = ''; - const expectedHeaderRequestParams = 'notification_config.name='; + request.name = ''; + const expectedHeaderRequestParams = 'name='; const expectedOptions = { otherArgs: { headers: { @@ -1630,16 +1623,16 @@ describe('v1.SecurityCenterClient', () => { }, }; const expectedResponse = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.NotificationConfig() + new protos.google.cloud.securitycenter.v1.Finding() ); - client.innerApiCalls.updateNotificationConfig = + client.innerApiCalls.setMute = stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.updateNotificationConfig( + client.setMute( request, ( err?: Error | null, - result?: protos.google.cloud.securitycenter.v1.INotificationConfig | null + result?: protos.google.cloud.securitycenter.v1.IFinding | null ) => { if (err) { reject(err); @@ -1652,24 +1645,23 @@ describe('v1.SecurityCenterClient', () => { const response = await promise; assert.deepStrictEqual(response, expectedResponse); assert( - (client.innerApiCalls.updateNotificationConfig as SinonStub) + (client.innerApiCalls.setMute as SinonStub) .getCall(0) .calledWith(request, expectedOptions /*, callback defined above */) ); }); - it('invokes updateNotificationConfig with error', async () => { + it('invokes setMute with error', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.UpdateNotificationConfigRequest() + new protos.google.cloud.securitycenter.v1.SetMuteRequest() ); - request.notificationConfig = {}; - request.notificationConfig.name = ''; - const expectedHeaderRequestParams = 'notification_config.name='; + request.name = ''; + const expectedHeaderRequestParams = 'name='; const expectedOptions = { otherArgs: { headers: { @@ -1678,35 +1670,28 @@ describe('v1.SecurityCenterClient', () => { }, }; const expectedError = new Error('expected'); - client.innerApiCalls.updateNotificationConfig = stubSimpleCall( - undefined, - expectedError - ); - await assert.rejects( - client.updateNotificationConfig(request), - expectedError - ); + client.innerApiCalls.setMute = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.setMute(request), expectedError); assert( - (client.innerApiCalls.updateNotificationConfig as SinonStub) + (client.innerApiCalls.setMute as SinonStub) .getCall(0) .calledWith(request, expectedOptions, undefined) ); }); }); - describe('updateOrganizationSettings', () => { - it('invokes updateOrganizationSettings without error', async () => { + describe('setIamPolicy', () => { + it('invokes setIamPolicy without error', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest() + new protos.google.iam.v1.SetIamPolicyRequest() ); - request.organizationSettings = {}; - request.organizationSettings.name = ''; - const expectedHeaderRequestParams = 'organization_settings.name='; + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; const expectedOptions = { otherArgs: { headers: { @@ -1715,31 +1700,29 @@ describe('v1.SecurityCenterClient', () => { }, }; const expectedResponse = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.OrganizationSettings() + new protos.google.iam.v1.Policy() ); - client.innerApiCalls.updateOrganizationSettings = - stubSimpleCall(expectedResponse); - const [response] = await client.updateOrganizationSettings(request); + client.innerApiCalls.setIamPolicy = stubSimpleCall(expectedResponse); + const [response] = await client.setIamPolicy(request); assert.deepStrictEqual(response, expectedResponse); assert( - (client.innerApiCalls.updateOrganizationSettings as SinonStub) + (client.innerApiCalls.setIamPolicy as SinonStub) .getCall(0) .calledWith(request, expectedOptions, undefined) ); }); - it('invokes updateOrganizationSettings without error using callback', async () => { + it('invokes setIamPolicy without error using callback', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest() + new protos.google.iam.v1.SetIamPolicyRequest() ); - request.organizationSettings = {}; - request.organizationSettings.name = ''; - const expectedHeaderRequestParams = 'organization_settings.name='; + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; const expectedOptions = { otherArgs: { headers: { @@ -1748,16 +1731,16 @@ describe('v1.SecurityCenterClient', () => { }, }; const expectedResponse = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.OrganizationSettings() + new protos.google.iam.v1.Policy() ); - client.innerApiCalls.updateOrganizationSettings = + client.innerApiCalls.setIamPolicy = stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.updateOrganizationSettings( + client.setIamPolicy( request, ( err?: Error | null, - result?: protos.google.cloud.securitycenter.v1.IOrganizationSettings | null + result?: protos.google.iam.v1.IPolicy | null ) => { if (err) { reject(err); @@ -1770,24 +1753,23 @@ describe('v1.SecurityCenterClient', () => { const response = await promise; assert.deepStrictEqual(response, expectedResponse); assert( - (client.innerApiCalls.updateOrganizationSettings as SinonStub) + (client.innerApiCalls.setIamPolicy as SinonStub) .getCall(0) .calledWith(request, expectedOptions /*, callback defined above */) ); }); - it('invokes updateOrganizationSettings with error', async () => { + it('invokes setIamPolicy with error', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest() + new protos.google.iam.v1.SetIamPolicyRequest() ); - request.organizationSettings = {}; - request.organizationSettings.name = ''; - const expectedHeaderRequestParams = 'organization_settings.name='; + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; const expectedOptions = { otherArgs: { headers: { @@ -1796,35 +1778,31 @@ describe('v1.SecurityCenterClient', () => { }, }; const expectedError = new Error('expected'); - client.innerApiCalls.updateOrganizationSettings = stubSimpleCall( + client.innerApiCalls.setIamPolicy = stubSimpleCall( undefined, expectedError ); - await assert.rejects( - client.updateOrganizationSettings(request), - expectedError - ); + await assert.rejects(client.setIamPolicy(request), expectedError); assert( - (client.innerApiCalls.updateOrganizationSettings as SinonStub) + (client.innerApiCalls.setIamPolicy as SinonStub) .getCall(0) .calledWith(request, expectedOptions, undefined) ); }); }); - describe('updateSource', () => { - it('invokes updateSource without error', async () => { + describe('testIamPermissions', () => { + it('invokes testIamPermissions without error', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.UpdateSourceRequest() + new protos.google.iam.v1.TestIamPermissionsRequest() ); - request.source = {}; - request.source.name = ''; - const expectedHeaderRequestParams = 'source.name='; + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; const expectedOptions = { otherArgs: { headers: { @@ -1833,30 +1811,30 @@ describe('v1.SecurityCenterClient', () => { }, }; const expectedResponse = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.Source() + new protos.google.iam.v1.TestIamPermissionsResponse() ); - client.innerApiCalls.updateSource = stubSimpleCall(expectedResponse); - const [response] = await client.updateSource(request); + client.innerApiCalls.testIamPermissions = + stubSimpleCall(expectedResponse); + const [response] = await client.testIamPermissions(request); assert.deepStrictEqual(response, expectedResponse); assert( - (client.innerApiCalls.updateSource as SinonStub) + (client.innerApiCalls.testIamPermissions as SinonStub) .getCall(0) .calledWith(request, expectedOptions, undefined) ); }); - it('invokes updateSource without error using callback', async () => { + it('invokes testIamPermissions without error using callback', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.UpdateSourceRequest() + new protos.google.iam.v1.TestIamPermissionsRequest() ); - request.source = {}; - request.source.name = ''; - const expectedHeaderRequestParams = 'source.name='; + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; const expectedOptions = { otherArgs: { headers: { @@ -1865,16 +1843,16 @@ describe('v1.SecurityCenterClient', () => { }, }; const expectedResponse = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.Source() + new protos.google.iam.v1.TestIamPermissionsResponse() ); - client.innerApiCalls.updateSource = + client.innerApiCalls.testIamPermissions = stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.updateSource( + client.testIamPermissions( request, ( err?: Error | null, - result?: protos.google.cloud.securitycenter.v1.ISource | null + result?: protos.google.iam.v1.ITestIamPermissionsResponse | null ) => { if (err) { reject(err); @@ -1887,24 +1865,23 @@ describe('v1.SecurityCenterClient', () => { const response = await promise; assert.deepStrictEqual(response, expectedResponse); assert( - (client.innerApiCalls.updateSource as SinonStub) + (client.innerApiCalls.testIamPermissions as SinonStub) .getCall(0) .calledWith(request, expectedOptions /*, callback defined above */) ); }); - it('invokes updateSource with error', async () => { + it('invokes testIamPermissions with error', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.UpdateSourceRequest() + new protos.google.iam.v1.TestIamPermissionsRequest() ); - request.source = {}; - request.source.name = ''; - const expectedHeaderRequestParams = 'source.name='; + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; const expectedOptions = { otherArgs: { headers: { @@ -1913,32 +1890,32 @@ describe('v1.SecurityCenterClient', () => { }, }; const expectedError = new Error('expected'); - client.innerApiCalls.updateSource = stubSimpleCall( + client.innerApiCalls.testIamPermissions = stubSimpleCall( undefined, expectedError ); - await assert.rejects(client.updateSource(request), expectedError); + await assert.rejects(client.testIamPermissions(request), expectedError); assert( - (client.innerApiCalls.updateSource as SinonStub) + (client.innerApiCalls.testIamPermissions as SinonStub) .getCall(0) .calledWith(request, expectedOptions, undefined) ); }); }); - describe('updateSecurityMarks', () => { - it('invokes updateSecurityMarks without error', async () => { + describe('updateFinding', () => { + it('invokes updateFinding without error', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.UpdateSecurityMarksRequest() + new protos.google.cloud.securitycenter.v1.UpdateFindingRequest() ); - request.securityMarks = {}; - request.securityMarks.name = ''; - const expectedHeaderRequestParams = 'security_marks.name='; + request.finding = {}; + request.finding.name = ''; + const expectedHeaderRequestParams = 'finding.name='; const expectedOptions = { otherArgs: { headers: { @@ -1947,31 +1924,30 @@ describe('v1.SecurityCenterClient', () => { }, }; const expectedResponse = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.SecurityMarks() + new protos.google.cloud.securitycenter.v1.Finding() ); - client.innerApiCalls.updateSecurityMarks = - stubSimpleCall(expectedResponse); - const [response] = await client.updateSecurityMarks(request); + client.innerApiCalls.updateFinding = stubSimpleCall(expectedResponse); + const [response] = await client.updateFinding(request); assert.deepStrictEqual(response, expectedResponse); assert( - (client.innerApiCalls.updateSecurityMarks as SinonStub) + (client.innerApiCalls.updateFinding as SinonStub) .getCall(0) .calledWith(request, expectedOptions, undefined) ); }); - it('invokes updateSecurityMarks without error using callback', async () => { + it('invokes updateFinding without error using callback', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.UpdateSecurityMarksRequest() + new protos.google.cloud.securitycenter.v1.UpdateFindingRequest() ); - request.securityMarks = {}; - request.securityMarks.name = ''; - const expectedHeaderRequestParams = 'security_marks.name='; + request.finding = {}; + request.finding.name = ''; + const expectedHeaderRequestParams = 'finding.name='; const expectedOptions = { otherArgs: { headers: { @@ -1980,16 +1956,16 @@ describe('v1.SecurityCenterClient', () => { }, }; const expectedResponse = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.SecurityMarks() + new protos.google.cloud.securitycenter.v1.Finding() ); - client.innerApiCalls.updateSecurityMarks = + client.innerApiCalls.updateFinding = stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.updateSecurityMarks( + client.updateFinding( request, ( err?: Error | null, - result?: protos.google.cloud.securitycenter.v1.ISecurityMarks | null + result?: protos.google.cloud.securitycenter.v1.IFinding | null ) => { if (err) { reject(err); @@ -2002,24 +1978,24 @@ describe('v1.SecurityCenterClient', () => { const response = await promise; assert.deepStrictEqual(response, expectedResponse); assert( - (client.innerApiCalls.updateSecurityMarks as SinonStub) + (client.innerApiCalls.updateFinding as SinonStub) .getCall(0) .calledWith(request, expectedOptions /*, callback defined above */) ); }); - it('invokes updateSecurityMarks with error', async () => { + it('invokes updateFinding with error', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.UpdateSecurityMarksRequest() + new protos.google.cloud.securitycenter.v1.UpdateFindingRequest() ); - request.securityMarks = {}; - request.securityMarks.name = ''; - const expectedHeaderRequestParams = 'security_marks.name='; + request.finding = {}; + request.finding.name = ''; + const expectedHeaderRequestParams = 'finding.name='; const expectedOptions = { otherArgs: { headers: { @@ -2028,31 +2004,32 @@ describe('v1.SecurityCenterClient', () => { }, }; const expectedError = new Error('expected'); - client.innerApiCalls.updateSecurityMarks = stubSimpleCall( + client.innerApiCalls.updateFinding = stubSimpleCall( undefined, expectedError ); - await assert.rejects(client.updateSecurityMarks(request), expectedError); + await assert.rejects(client.updateFinding(request), expectedError); assert( - (client.innerApiCalls.updateSecurityMarks as SinonStub) + (client.innerApiCalls.updateFinding as SinonStub) .getCall(0) .calledWith(request, expectedOptions, undefined) ); }); }); - describe('runAssetDiscovery', () => { - it('invokes runAssetDiscovery without error', async () => { + describe('updateMuteConfig', () => { + it('invokes updateMuteConfig without error', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.RunAssetDiscoveryRequest() + new protos.google.cloud.securitycenter.v1.UpdateMuteConfigRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + request.muteConfig = {}; + request.muteConfig.name = ''; + const expectedHeaderRequestParams = 'mute_config.name='; const expectedOptions = { otherArgs: { headers: { @@ -2061,31 +2038,30 @@ describe('v1.SecurityCenterClient', () => { }, }; const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() + new protos.google.cloud.securitycenter.v1.MuteConfig() ); - client.innerApiCalls.runAssetDiscovery = - stubLongRunningCall(expectedResponse); - const [operation] = await client.runAssetDiscovery(request); - const [response] = await operation.promise(); + client.innerApiCalls.updateMuteConfig = stubSimpleCall(expectedResponse); + const [response] = await client.updateMuteConfig(request); assert.deepStrictEqual(response, expectedResponse); assert( - (client.innerApiCalls.runAssetDiscovery as SinonStub) + (client.innerApiCalls.updateMuteConfig as SinonStub) .getCall(0) .calledWith(request, expectedOptions, undefined) ); }); - it('invokes runAssetDiscovery without error using callback', async () => { + it('invokes updateMuteConfig without error using callback', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.RunAssetDiscoveryRequest() + new protos.google.cloud.securitycenter.v1.UpdateMuteConfigRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + request.muteConfig = {}; + request.muteConfig.name = ''; + const expectedHeaderRequestParams = 'mute_config.name='; const expectedOptions = { otherArgs: { headers: { @@ -2094,19 +2070,16 @@ describe('v1.SecurityCenterClient', () => { }, }; const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() + new protos.google.cloud.securitycenter.v1.MuteConfig() ); - client.innerApiCalls.runAssetDiscovery = - stubLongRunningCallWithCallback(expectedResponse); + client.innerApiCalls.updateMuteConfig = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.runAssetDiscovery( + client.updateMuteConfig( request, ( err?: Error | null, - result?: LROperation< - protos.google.cloud.securitycenter.v1.IRunAssetDiscoveryResponse, - protos.google.protobuf.IEmpty - > | null + result?: protos.google.cloud.securitycenter.v1.IMuteConfig | null ) => { if (err) { reject(err); @@ -2116,30 +2089,27 @@ describe('v1.SecurityCenterClient', () => { } ); }); - const operation = (await promise) as LROperation< - protos.google.cloud.securitycenter.v1.IRunAssetDiscoveryResponse, - protos.google.protobuf.IEmpty - >; - const [response] = await operation.promise(); + const response = await promise; assert.deepStrictEqual(response, expectedResponse); assert( - (client.innerApiCalls.runAssetDiscovery as SinonStub) + (client.innerApiCalls.updateMuteConfig as SinonStub) .getCall(0) .calledWith(request, expectedOptions /*, callback defined above */) ); }); - it('invokes runAssetDiscovery with call error', async () => { + it('invokes updateMuteConfig with error', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.RunAssetDiscoveryRequest() + new protos.google.cloud.securitycenter.v1.UpdateMuteConfigRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + request.muteConfig = {}; + request.muteConfig.name = ''; + const expectedHeaderRequestParams = 'mute_config.name='; const expectedOptions = { otherArgs: { headers: { @@ -2148,29 +2118,32 @@ describe('v1.SecurityCenterClient', () => { }, }; const expectedError = new Error('expected'); - client.innerApiCalls.runAssetDiscovery = stubLongRunningCall( + client.innerApiCalls.updateMuteConfig = stubSimpleCall( undefined, expectedError ); - await assert.rejects(client.runAssetDiscovery(request), expectedError); + await assert.rejects(client.updateMuteConfig(request), expectedError); assert( - (client.innerApiCalls.runAssetDiscovery as SinonStub) + (client.innerApiCalls.updateMuteConfig as SinonStub) .getCall(0) .calledWith(request, expectedOptions, undefined) ); }); + }); - it('invokes runAssetDiscovery with LRO error', async () => { + describe('updateNotificationConfig', () => { + it('invokes updateNotificationConfig without error', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.RunAssetDiscoveryRequest() + new protos.google.cloud.securitycenter.v1.UpdateNotificationConfigRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + request.notificationConfig = {}; + request.notificationConfig.name = ''; + const expectedHeaderRequestParams = 'notification_config.name='; const expectedOptions = { otherArgs: { headers: { @@ -2178,63 +2151,839 @@ describe('v1.SecurityCenterClient', () => { }, }, }; - const expectedError = new Error('expected'); - client.innerApiCalls.runAssetDiscovery = stubLongRunningCall( - undefined, - undefined, - expectedError + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.NotificationConfig() ); - const [operation] = await client.runAssetDiscovery(request); - await assert.rejects(operation.promise(), expectedError); + client.innerApiCalls.updateNotificationConfig = + stubSimpleCall(expectedResponse); + const [response] = await client.updateNotificationConfig(request); + assert.deepStrictEqual(response, expectedResponse); assert( - (client.innerApiCalls.runAssetDiscovery as SinonStub) + (client.innerApiCalls.updateNotificationConfig as SinonStub) .getCall(0) .calledWith(request, expectedOptions, undefined) ); }); - it('invokes checkRunAssetDiscoveryProgress without error', async () => { + it('invokes updateNotificationConfig without error using callback', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.UpdateNotificationConfigRequest() + ); + request.notificationConfig = {}; + request.notificationConfig.name = ''; + const expectedHeaderRequestParams = 'notification_config.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() + new protos.google.cloud.securitycenter.v1.NotificationConfig() ); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkRunAssetDiscoveryProgress( - expectedResponse.name + client.innerApiCalls.updateNotificationConfig = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateNotificationConfig( + request, + ( + err?: Error | null, + result?: protos.google.cloud.securitycenter.v1.INotificationConfig | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.updateNotificationConfig as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) ); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); }); - it('invokes checkRunAssetDiscoveryProgress with error', async () => { + it('invokes updateNotificationConfig with error', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.UpdateNotificationConfigRequest() + ); + request.notificationConfig = {}; + request.notificationConfig.name = ''; + const expectedHeaderRequestParams = 'notification_config.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall( + client.innerApiCalls.updateNotificationConfig = stubSimpleCall( undefined, expectedError ); await assert.rejects( - client.checkRunAssetDiscoveryProgress(''), + client.updateNotificationConfig(request), expectedError ); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - }); - + assert( + (client.innerApiCalls.updateNotificationConfig as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('updateOrganizationSettings', () => { + it('invokes updateOrganizationSettings without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest() + ); + request.organizationSettings = {}; + request.organizationSettings.name = ''; + const expectedHeaderRequestParams = 'organization_settings.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.OrganizationSettings() + ); + client.innerApiCalls.updateOrganizationSettings = + stubSimpleCall(expectedResponse); + const [response] = await client.updateOrganizationSettings(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.updateOrganizationSettings as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes updateOrganizationSettings without error using callback', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest() + ); + request.organizationSettings = {}; + request.organizationSettings.name = ''; + const expectedHeaderRequestParams = 'organization_settings.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.OrganizationSettings() + ); + client.innerApiCalls.updateOrganizationSettings = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateOrganizationSettings( + request, + ( + err?: Error | null, + result?: protos.google.cloud.securitycenter.v1.IOrganizationSettings | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.updateOrganizationSettings as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes updateOrganizationSettings with error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest() + ); + request.organizationSettings = {}; + request.organizationSettings.name = ''; + const expectedHeaderRequestParams = 'organization_settings.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.updateOrganizationSettings = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.updateOrganizationSettings(request), + expectedError + ); + assert( + (client.innerApiCalls.updateOrganizationSettings as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('updateSource', () => { + it('invokes updateSource without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.UpdateSourceRequest() + ); + request.source = {}; + request.source.name = ''; + const expectedHeaderRequestParams = 'source.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.Source() + ); + client.innerApiCalls.updateSource = stubSimpleCall(expectedResponse); + const [response] = await client.updateSource(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.updateSource as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes updateSource without error using callback', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.UpdateSourceRequest() + ); + request.source = {}; + request.source.name = ''; + const expectedHeaderRequestParams = 'source.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.Source() + ); + client.innerApiCalls.updateSource = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateSource( + request, + ( + err?: Error | null, + result?: protos.google.cloud.securitycenter.v1.ISource | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.updateSource as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes updateSource with error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.UpdateSourceRequest() + ); + request.source = {}; + request.source.name = ''; + const expectedHeaderRequestParams = 'source.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.updateSource = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.updateSource(request), expectedError); + assert( + (client.innerApiCalls.updateSource as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('updateSecurityMarks', () => { + it('invokes updateSecurityMarks without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.UpdateSecurityMarksRequest() + ); + request.securityMarks = {}; + request.securityMarks.name = ''; + const expectedHeaderRequestParams = 'security_marks.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.SecurityMarks() + ); + client.innerApiCalls.updateSecurityMarks = + stubSimpleCall(expectedResponse); + const [response] = await client.updateSecurityMarks(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.updateSecurityMarks as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes updateSecurityMarks without error using callback', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.UpdateSecurityMarksRequest() + ); + request.securityMarks = {}; + request.securityMarks.name = ''; + const expectedHeaderRequestParams = 'security_marks.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.SecurityMarks() + ); + client.innerApiCalls.updateSecurityMarks = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateSecurityMarks( + request, + ( + err?: Error | null, + result?: protos.google.cloud.securitycenter.v1.ISecurityMarks | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.updateSecurityMarks as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes updateSecurityMarks with error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.UpdateSecurityMarksRequest() + ); + request.securityMarks = {}; + request.securityMarks.name = ''; + const expectedHeaderRequestParams = 'security_marks.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.updateSecurityMarks = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.updateSecurityMarks(request), expectedError); + assert( + (client.innerApiCalls.updateSecurityMarks as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('bulkMuteFindings', () => { + it('invokes bulkMuteFindings without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.BulkMuteFindingsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.bulkMuteFindings = + stubLongRunningCall(expectedResponse); + const [operation] = await client.bulkMuteFindings(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.bulkMuteFindings as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes bulkMuteFindings without error using callback', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.BulkMuteFindingsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.bulkMuteFindings = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.bulkMuteFindings( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.securitycenter.v1.IBulkMuteFindingsResponse, + protos.google.protobuf.IEmpty + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.securitycenter.v1.IBulkMuteFindingsResponse, + protos.google.protobuf.IEmpty + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.bulkMuteFindings as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes bulkMuteFindings with call error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.BulkMuteFindingsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.bulkMuteFindings = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.bulkMuteFindings(request), expectedError); + assert( + (client.innerApiCalls.bulkMuteFindings as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes bulkMuteFindings with LRO error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.BulkMuteFindingsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.bulkMuteFindings = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.bulkMuteFindings(request); + await assert.rejects(operation.promise(), expectedError); + assert( + (client.innerApiCalls.bulkMuteFindings as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes checkBulkMuteFindingsProgress without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkBulkMuteFindingsProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkBulkMuteFindingsProgress with error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.checkBulkMuteFindingsProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('runAssetDiscovery', () => { + it('invokes runAssetDiscovery without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.RunAssetDiscoveryRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.runAssetDiscovery = + stubLongRunningCall(expectedResponse); + const [operation] = await client.runAssetDiscovery(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.runAssetDiscovery as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes runAssetDiscovery without error using callback', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.RunAssetDiscoveryRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.runAssetDiscovery = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.runAssetDiscovery( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.securitycenter.v1.IRunAssetDiscoveryResponse, + protos.google.protobuf.IEmpty + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.securitycenter.v1.IRunAssetDiscoveryResponse, + protos.google.protobuf.IEmpty + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.runAssetDiscovery as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes runAssetDiscovery with call error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.RunAssetDiscoveryRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.runAssetDiscovery = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.runAssetDiscovery(request), expectedError); + assert( + (client.innerApiCalls.runAssetDiscovery as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes runAssetDiscovery with LRO error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.RunAssetDiscoveryRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.runAssetDiscovery = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.runAssetDiscovery(request); + await assert.rejects(operation.promise(), expectedError); + assert( + (client.innerApiCalls.runAssetDiscovery as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes checkRunAssetDiscoveryProgress without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkRunAssetDiscoveryProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkRunAssetDiscoveryProgress with error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.checkRunAssetDiscoveryProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + describe('groupAssets', () => { it('invokes groupAssets without error', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ @@ -2265,24 +3014,337 @@ describe('v1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1.GroupResult() ), ]; - client.innerApiCalls.groupAssets = stubSimpleCall(expectedResponse); - const [response] = await client.groupAssets(request); + client.innerApiCalls.groupAssets = stubSimpleCall(expectedResponse); + const [response] = await client.groupAssets(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.groupAssets as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes groupAssets without error using callback', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GroupAssetsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GroupResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GroupResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GroupResult() + ), + ]; + client.innerApiCalls.groupAssets = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.groupAssets( + request, + ( + err?: Error | null, + result?: protos.google.cloud.securitycenter.v1.IGroupResult[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.groupAssets as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes groupAssets with error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GroupAssetsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.groupAssets = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.groupAssets(request), expectedError); + assert( + (client.innerApiCalls.groupAssets as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes groupAssetsStream without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GroupAssetsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GroupResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GroupResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GroupResult() + ), + ]; + client.descriptors.page.groupAssets.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.groupAssetsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.securitycenter.v1.GroupResult[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.securitycenter.v1.GroupResult) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert( + (client.descriptors.page.groupAssets.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.groupAssets, request) + ); + assert.strictEqual( + (client.descriptors.page.groupAssets.createStream as SinonStub).getCall( + 0 + ).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes groupAssetsStream with error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GroupAssetsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('expected'); + client.descriptors.page.groupAssets.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.groupAssetsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.securitycenter.v1.GroupResult[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.securitycenter.v1.GroupResult) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.groupAssets.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.groupAssets, request) + ); + assert.strictEqual( + (client.descriptors.page.groupAssets.createStream as SinonStub).getCall( + 0 + ).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with groupAssets without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GroupAssetsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GroupResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GroupResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GroupResult() + ), + ]; + client.descriptors.page.groupAssets.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.securitycenter.v1.IGroupResult[] = + []; + const iterable = client.groupAssetsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.groupAssets.asyncIterate as SinonStub).getCall( + 0 + ).args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.groupAssets.asyncIterate as SinonStub).getCall( + 0 + ).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with groupAssets with error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GroupAssetsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('expected'); + client.descriptors.page.groupAssets.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.groupAssetsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.securitycenter.v1.IGroupResult[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.groupAssets.asyncIterate as SinonStub).getCall( + 0 + ).args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.groupAssets.asyncIterate as SinonStub).getCall( + 0 + ).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('groupFindings', () => { + it('invokes groupFindings without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GroupFindingsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GroupResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GroupResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GroupResult() + ), + ]; + client.innerApiCalls.groupFindings = stubSimpleCall(expectedResponse); + const [response] = await client.groupFindings(request); assert.deepStrictEqual(response, expectedResponse); assert( - (client.innerApiCalls.groupAssets as SinonStub) + (client.innerApiCalls.groupFindings as SinonStub) .getCall(0) .calledWith(request, expectedOptions, undefined) ); }); - it('invokes groupAssets without error using callback', async () => { + it('invokes groupFindings without error using callback', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.GroupAssetsRequest() + new protos.google.cloud.securitycenter.v1.GroupFindingsRequest() ); request.parent = ''; const expectedHeaderRequestParams = 'parent='; @@ -2304,10 +3366,10 @@ describe('v1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1.GroupResult() ), ]; - client.innerApiCalls.groupAssets = + client.innerApiCalls.groupFindings = stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.groupAssets( + client.groupFindings( request, ( err?: Error | null, @@ -2324,20 +3386,20 @@ describe('v1.SecurityCenterClient', () => { const response = await promise; assert.deepStrictEqual(response, expectedResponse); assert( - (client.innerApiCalls.groupAssets as SinonStub) + (client.innerApiCalls.groupFindings as SinonStub) .getCall(0) .calledWith(request, expectedOptions /*, callback defined above */) ); }); - it('invokes groupAssets with error', async () => { + it('invokes groupFindings with error', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.GroupAssetsRequest() + new protos.google.cloud.securitycenter.v1.GroupFindingsRequest() ); request.parent = ''; const expectedHeaderRequestParams = 'parent='; @@ -2349,26 +3411,26 @@ describe('v1.SecurityCenterClient', () => { }, }; const expectedError = new Error('expected'); - client.innerApiCalls.groupAssets = stubSimpleCall( + client.innerApiCalls.groupFindings = stubSimpleCall( undefined, expectedError ); - await assert.rejects(client.groupAssets(request), expectedError); + await assert.rejects(client.groupFindings(request), expectedError); assert( - (client.innerApiCalls.groupAssets as SinonStub) + (client.innerApiCalls.groupFindings as SinonStub) .getCall(0) .calledWith(request, expectedOptions, undefined) ); }); - it('invokes groupAssetsStream without error', async () => { + it('invokes groupFindingsStream without error', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.GroupAssetsRequest() + new protos.google.cloud.securitycenter.v1.GroupFindingsRequest() ); request.parent = ''; const expectedHeaderRequestParams = 'parent='; @@ -2383,9 +3445,9 @@ describe('v1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1.GroupResult() ), ]; - client.descriptors.page.groupAssets.createStream = + client.descriptors.page.groupFindings.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.groupAssetsStream(request); + const stream = client.groupFindingsStream(request); const promise = new Promise((resolve, reject) => { const responses: protos.google.cloud.securitycenter.v1.GroupResult[] = []; @@ -2405,35 +3467,33 @@ describe('v1.SecurityCenterClient', () => { const responses = await promise; assert.deepStrictEqual(responses, expectedResponse); assert( - (client.descriptors.page.groupAssets.createStream as SinonStub) + (client.descriptors.page.groupFindings.createStream as SinonStub) .getCall(0) - .calledWith(client.innerApiCalls.groupAssets, request) + .calledWith(client.innerApiCalls.groupFindings, request) ); assert.strictEqual( - (client.descriptors.page.groupAssets.createStream as SinonStub).getCall( - 0 - ).args[2].otherArgs.headers['x-goog-request-params'], + ( + client.descriptors.page.groupFindings.createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); - it('invokes groupAssetsStream with error', async () => { + it('invokes groupFindingsStream with error', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.GroupAssetsRequest() + new protos.google.cloud.securitycenter.v1.GroupFindingsRequest() ); request.parent = ''; const expectedHeaderRequestParams = 'parent='; const expectedError = new Error('expected'); - client.descriptors.page.groupAssets.createStream = stubPageStreamingCall( - undefined, - expectedError - ); - const stream = client.groupAssetsStream(request); + client.descriptors.page.groupFindings.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.groupFindingsStream(request); const promise = new Promise((resolve, reject) => { const responses: protos.google.cloud.securitycenter.v1.GroupResult[] = []; @@ -2452,26 +3512,26 @@ describe('v1.SecurityCenterClient', () => { }); await assert.rejects(promise, expectedError); assert( - (client.descriptors.page.groupAssets.createStream as SinonStub) + (client.descriptors.page.groupFindings.createStream as SinonStub) .getCall(0) - .calledWith(client.innerApiCalls.groupAssets, request) + .calledWith(client.innerApiCalls.groupFindings, request) ); assert.strictEqual( - (client.descriptors.page.groupAssets.createStream as SinonStub).getCall( - 0 - ).args[2].otherArgs.headers['x-goog-request-params'], + ( + client.descriptors.page.groupFindings.createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); - it('uses async iteration with groupAssets without error', async () => { + it('uses async iteration with groupFindings without error', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.GroupAssetsRequest() + new protos.google.cloud.securitycenter.v1.GroupFindingsRequest() ); request.parent = ''; const expectedHeaderRequestParams = 'parent='; @@ -2486,46 +3546,44 @@ describe('v1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1.GroupResult() ), ]; - client.descriptors.page.groupAssets.asyncIterate = + client.descriptors.page.groupFindings.asyncIterate = stubAsyncIterationCall(expectedResponse); const responses: protos.google.cloud.securitycenter.v1.IGroupResult[] = []; - const iterable = client.groupAssetsAsync(request); + const iterable = client.groupFindingsAsync(request); for await (const resource of iterable) { responses.push(resource!); } assert.deepStrictEqual(responses, expectedResponse); assert.deepStrictEqual( - (client.descriptors.page.groupAssets.asyncIterate as SinonStub).getCall( - 0 - ).args[1], + ( + client.descriptors.page.groupFindings.asyncIterate as SinonStub + ).getCall(0).args[1], request ); assert.strictEqual( - (client.descriptors.page.groupAssets.asyncIterate as SinonStub).getCall( - 0 - ).args[2].otherArgs.headers['x-goog-request-params'], + ( + client.descriptors.page.groupFindings.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); - it('uses async iteration with groupAssets with error', async () => { + it('uses async iteration with groupFindings with error', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.GroupAssetsRequest() + new protos.google.cloud.securitycenter.v1.GroupFindingsRequest() ); request.parent = ''; const expectedHeaderRequestParams = 'parent='; const expectedError = new Error('expected'); - client.descriptors.page.groupAssets.asyncIterate = stubAsyncIterationCall( - undefined, - expectedError - ); - const iterable = client.groupAssetsAsync(request); + client.descriptors.page.groupFindings.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.groupFindingsAsync(request); await assert.rejects(async () => { const responses: protos.google.cloud.securitycenter.v1.IGroupResult[] = []; @@ -2534,29 +3592,29 @@ describe('v1.SecurityCenterClient', () => { } }); assert.deepStrictEqual( - (client.descriptors.page.groupAssets.asyncIterate as SinonStub).getCall( - 0 - ).args[1], + ( + client.descriptors.page.groupFindings.asyncIterate as SinonStub + ).getCall(0).args[1], request ); assert.strictEqual( - (client.descriptors.page.groupAssets.asyncIterate as SinonStub).getCall( - 0 - ).args[2].otherArgs.headers['x-goog-request-params'], + ( + client.descriptors.page.groupFindings.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); }); - describe('groupFindings', () => { - it('invokes groupFindings without error', async () => { + describe('listAssets', () => { + it('invokes listAssets without error', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.GroupFindingsRequest() + new protos.google.cloud.securitycenter.v1.ListAssetsRequest() ); request.parent = ''; const expectedHeaderRequestParams = 'parent='; @@ -2569,33 +3627,33 @@ describe('v1.SecurityCenterClient', () => { }; const expectedResponse = [ generateSampleMessage( - new protos.google.cloud.securitycenter.v1.GroupResult() + new protos.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult() ), generateSampleMessage( - new protos.google.cloud.securitycenter.v1.GroupResult() + new protos.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult() ), generateSampleMessage( - new protos.google.cloud.securitycenter.v1.GroupResult() + new protos.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult() ), ]; - client.innerApiCalls.groupFindings = stubSimpleCall(expectedResponse); - const [response] = await client.groupFindings(request); + client.innerApiCalls.listAssets = stubSimpleCall(expectedResponse); + const [response] = await client.listAssets(request); assert.deepStrictEqual(response, expectedResponse); assert( - (client.innerApiCalls.groupFindings as SinonStub) + (client.innerApiCalls.listAssets as SinonStub) .getCall(0) .calledWith(request, expectedOptions, undefined) ); }); - it('invokes groupFindings without error using callback', async () => { + it('invokes listAssets without error using callback', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.GroupFindingsRequest() + new protos.google.cloud.securitycenter.v1.ListAssetsRequest() ); request.parent = ''; const expectedHeaderRequestParams = 'parent='; @@ -2608,23 +3666,25 @@ describe('v1.SecurityCenterClient', () => { }; const expectedResponse = [ generateSampleMessage( - new protos.google.cloud.securitycenter.v1.GroupResult() + new protos.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult() ), generateSampleMessage( - new protos.google.cloud.securitycenter.v1.GroupResult() + new protos.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult() ), generateSampleMessage( - new protos.google.cloud.securitycenter.v1.GroupResult() + new protos.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult() ), ]; - client.innerApiCalls.groupFindings = + client.innerApiCalls.listAssets = stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.groupFindings( + client.listAssets( request, ( err?: Error | null, - result?: protos.google.cloud.securitycenter.v1.IGroupResult[] | null + result?: + | protos.google.cloud.securitycenter.v1.ListAssetsResponse.IListAssetsResult[] + | null ) => { if (err) { reject(err); @@ -2637,20 +3697,20 @@ describe('v1.SecurityCenterClient', () => { const response = await promise; assert.deepStrictEqual(response, expectedResponse); assert( - (client.innerApiCalls.groupFindings as SinonStub) + (client.innerApiCalls.listAssets as SinonStub) .getCall(0) .calledWith(request, expectedOptions /*, callback defined above */) ); }); - it('invokes groupFindings with error', async () => { + it('invokes listAssets with error', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.GroupFindingsRequest() + new protos.google.cloud.securitycenter.v1.ListAssetsRequest() ); request.parent = ''; const expectedHeaderRequestParams = 'parent='; @@ -2662,49 +3722,51 @@ describe('v1.SecurityCenterClient', () => { }, }; const expectedError = new Error('expected'); - client.innerApiCalls.groupFindings = stubSimpleCall( + client.innerApiCalls.listAssets = stubSimpleCall( undefined, expectedError ); - await assert.rejects(client.groupFindings(request), expectedError); + await assert.rejects(client.listAssets(request), expectedError); assert( - (client.innerApiCalls.groupFindings as SinonStub) + (client.innerApiCalls.listAssets as SinonStub) .getCall(0) .calledWith(request, expectedOptions, undefined) ); }); - it('invokes groupFindingsStream without error', async () => { + it('invokes listAssetsStream without error', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.GroupFindingsRequest() + new protos.google.cloud.securitycenter.v1.ListAssetsRequest() ); request.parent = ''; const expectedHeaderRequestParams = 'parent='; const expectedResponse = [ generateSampleMessage( - new protos.google.cloud.securitycenter.v1.GroupResult() + new protos.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult() ), generateSampleMessage( - new protos.google.cloud.securitycenter.v1.GroupResult() + new protos.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult() ), generateSampleMessage( - new protos.google.cloud.securitycenter.v1.GroupResult() + new protos.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult() ), ]; - client.descriptors.page.groupFindings.createStream = + client.descriptors.page.listAssets.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.groupFindingsStream(request); + const stream = client.listAssetsStream(request); const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.securitycenter.v1.GroupResult[] = + const responses: protos.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult[] = []; stream.on( 'data', - (response: protos.google.cloud.securitycenter.v1.GroupResult) => { + ( + response: protos.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult + ) => { responses.push(response); } ); @@ -2718,39 +3780,43 @@ describe('v1.SecurityCenterClient', () => { const responses = await promise; assert.deepStrictEqual(responses, expectedResponse); assert( - (client.descriptors.page.groupFindings.createStream as SinonStub) + (client.descriptors.page.listAssets.createStream as SinonStub) .getCall(0) - .calledWith(client.innerApiCalls.groupFindings, request) + .calledWith(client.innerApiCalls.listAssets, request) ); assert.strictEqual( - ( - client.descriptors.page.groupFindings.createStream as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + (client.descriptors.page.listAssets.createStream as SinonStub).getCall( + 0 + ).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); - it('invokes groupFindingsStream with error', async () => { + it('invokes listAssetsStream with error', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.GroupFindingsRequest() + new protos.google.cloud.securitycenter.v1.ListAssetsRequest() ); request.parent = ''; const expectedHeaderRequestParams = 'parent='; const expectedError = new Error('expected'); - client.descriptors.page.groupFindings.createStream = - stubPageStreamingCall(undefined, expectedError); - const stream = client.groupFindingsStream(request); + client.descriptors.page.listAssets.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listAssetsStream(request); const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.securitycenter.v1.GroupResult[] = + const responses: protos.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult[] = []; stream.on( 'data', - (response: protos.google.cloud.securitycenter.v1.GroupResult) => { + ( + response: protos.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult + ) => { responses.push(response); } ); @@ -2763,109 +3829,111 @@ describe('v1.SecurityCenterClient', () => { }); await assert.rejects(promise, expectedError); assert( - (client.descriptors.page.groupFindings.createStream as SinonStub) + (client.descriptors.page.listAssets.createStream as SinonStub) .getCall(0) - .calledWith(client.innerApiCalls.groupFindings, request) + .calledWith(client.innerApiCalls.listAssets, request) ); assert.strictEqual( - ( - client.descriptors.page.groupFindings.createStream as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + (client.descriptors.page.listAssets.createStream as SinonStub).getCall( + 0 + ).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); - it('uses async iteration with groupFindings without error', async () => { + it('uses async iteration with listAssets without error', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.GroupFindingsRequest() + new protos.google.cloud.securitycenter.v1.ListAssetsRequest() ); request.parent = ''; const expectedHeaderRequestParams = 'parent='; const expectedResponse = [ generateSampleMessage( - new protos.google.cloud.securitycenter.v1.GroupResult() + new protos.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult() ), generateSampleMessage( - new protos.google.cloud.securitycenter.v1.GroupResult() + new protos.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult() ), generateSampleMessage( - new protos.google.cloud.securitycenter.v1.GroupResult() + new protos.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult() ), ]; - client.descriptors.page.groupFindings.asyncIterate = + client.descriptors.page.listAssets.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.securitycenter.v1.IGroupResult[] = + const responses: protos.google.cloud.securitycenter.v1.ListAssetsResponse.IListAssetsResult[] = []; - const iterable = client.groupFindingsAsync(request); + const iterable = client.listAssetsAsync(request); for await (const resource of iterable) { responses.push(resource!); } assert.deepStrictEqual(responses, expectedResponse); assert.deepStrictEqual( - ( - client.descriptors.page.groupFindings.asyncIterate as SinonStub - ).getCall(0).args[1], + (client.descriptors.page.listAssets.asyncIterate as SinonStub).getCall( + 0 + ).args[1], request ); assert.strictEqual( - ( - client.descriptors.page.groupFindings.asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + (client.descriptors.page.listAssets.asyncIterate as SinonStub).getCall( + 0 + ).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); - it('uses async iteration with groupFindings with error', async () => { + it('uses async iteration with listAssets with error', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.GroupFindingsRequest() + new protos.google.cloud.securitycenter.v1.ListAssetsRequest() ); request.parent = ''; const expectedHeaderRequestParams = 'parent='; const expectedError = new Error('expected'); - client.descriptors.page.groupFindings.asyncIterate = - stubAsyncIterationCall(undefined, expectedError); - const iterable = client.groupFindingsAsync(request); + client.descriptors.page.listAssets.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listAssetsAsync(request); await assert.rejects(async () => { - const responses: protos.google.cloud.securitycenter.v1.IGroupResult[] = + const responses: protos.google.cloud.securitycenter.v1.ListAssetsResponse.IListAssetsResult[] = []; for await (const resource of iterable) { responses.push(resource!); } }); assert.deepStrictEqual( - ( - client.descriptors.page.groupFindings.asyncIterate as SinonStub - ).getCall(0).args[1], + (client.descriptors.page.listAssets.asyncIterate as SinonStub).getCall( + 0 + ).args[1], request ); assert.strictEqual( - ( - client.descriptors.page.groupFindings.asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + (client.descriptors.page.listAssets.asyncIterate as SinonStub).getCall( + 0 + ).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); }); - describe('listAssets', () => { - it('invokes listAssets without error', async () => { + describe('listFindings', () => { + it('invokes listFindings without error', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListAssetsRequest() + new protos.google.cloud.securitycenter.v1.ListFindingsRequest() ); request.parent = ''; const expectedHeaderRequestParams = 'parent='; @@ -2878,33 +3946,33 @@ describe('v1.SecurityCenterClient', () => { }; const expectedResponse = [ generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult() + new protos.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult() ), generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult() + new protos.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult() ), generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult() + new protos.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult() ), ]; - client.innerApiCalls.listAssets = stubSimpleCall(expectedResponse); - const [response] = await client.listAssets(request); + client.innerApiCalls.listFindings = stubSimpleCall(expectedResponse); + const [response] = await client.listFindings(request); assert.deepStrictEqual(response, expectedResponse); assert( - (client.innerApiCalls.listAssets as SinonStub) + (client.innerApiCalls.listFindings as SinonStub) .getCall(0) .calledWith(request, expectedOptions, undefined) ); }); - it('invokes listAssets without error using callback', async () => { + it('invokes listFindings without error using callback', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListAssetsRequest() + new protos.google.cloud.securitycenter.v1.ListFindingsRequest() ); request.parent = ''; const expectedHeaderRequestParams = 'parent='; @@ -2917,24 +3985,24 @@ describe('v1.SecurityCenterClient', () => { }; const expectedResponse = [ generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult() + new protos.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult() ), generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult() + new protos.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult() ), generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult() + new protos.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult() ), ]; - client.innerApiCalls.listAssets = + client.innerApiCalls.listFindings = stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.listAssets( + client.listFindings( request, ( err?: Error | null, result?: - | protos.google.cloud.securitycenter.v1.ListAssetsResponse.IListAssetsResult[] + | protos.google.cloud.securitycenter.v1.ListFindingsResponse.IListFindingsResult[] | null ) => { if (err) { @@ -2948,20 +4016,20 @@ describe('v1.SecurityCenterClient', () => { const response = await promise; assert.deepStrictEqual(response, expectedResponse); assert( - (client.innerApiCalls.listAssets as SinonStub) + (client.innerApiCalls.listFindings as SinonStub) .getCall(0) .calledWith(request, expectedOptions /*, callback defined above */) ); }); - it('invokes listAssets with error', async () => { + it('invokes listFindings with error', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListAssetsRequest() + new protos.google.cloud.securitycenter.v1.ListFindingsRequest() ); request.parent = ''; const expectedHeaderRequestParams = 'parent='; @@ -2973,50 +4041,50 @@ describe('v1.SecurityCenterClient', () => { }, }; const expectedError = new Error('expected'); - client.innerApiCalls.listAssets = stubSimpleCall( + client.innerApiCalls.listFindings = stubSimpleCall( undefined, expectedError ); - await assert.rejects(client.listAssets(request), expectedError); + await assert.rejects(client.listFindings(request), expectedError); assert( - (client.innerApiCalls.listAssets as SinonStub) + (client.innerApiCalls.listFindings as SinonStub) .getCall(0) .calledWith(request, expectedOptions, undefined) ); }); - it('invokes listAssetsStream without error', async () => { + it('invokes listFindingsStream without error', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListAssetsRequest() + new protos.google.cloud.securitycenter.v1.ListFindingsRequest() ); request.parent = ''; const expectedHeaderRequestParams = 'parent='; const expectedResponse = [ generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult() + new protos.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult() ), generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult() + new protos.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult() ), generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult() + new protos.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult() ), ]; - client.descriptors.page.listAssets.createStream = + client.descriptors.page.listFindings.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listAssetsStream(request); + const stream = client.listFindingsStream(request); const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult[] = + const responses: protos.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult[] = []; stream.on( 'data', ( - response: protos.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult + response: protos.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult ) => { responses.push(response); } @@ -3031,42 +4099,42 @@ describe('v1.SecurityCenterClient', () => { const responses = await promise; assert.deepStrictEqual(responses, expectedResponse); assert( - (client.descriptors.page.listAssets.createStream as SinonStub) + (client.descriptors.page.listFindings.createStream as SinonStub) .getCall(0) - .calledWith(client.innerApiCalls.listAssets, request) + .calledWith(client.innerApiCalls.listFindings, request) ); assert.strictEqual( - (client.descriptors.page.listAssets.createStream as SinonStub).getCall( - 0 - ).args[2].otherArgs.headers['x-goog-request-params'], + ( + client.descriptors.page.listFindings.createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); - it('invokes listAssetsStream with error', async () => { + it('invokes listFindingsStream with error', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListAssetsRequest() + new protos.google.cloud.securitycenter.v1.ListFindingsRequest() ); request.parent = ''; const expectedHeaderRequestParams = 'parent='; const expectedError = new Error('expected'); - client.descriptors.page.listAssets.createStream = stubPageStreamingCall( + client.descriptors.page.listFindings.createStream = stubPageStreamingCall( undefined, expectedError ); - const stream = client.listAssetsStream(request); + const stream = client.listFindingsStream(request); const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult[] = + const responses: protos.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult[] = []; stream.on( 'data', ( - response: protos.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult + response: protos.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult ) => { responses.push(response); } @@ -3080,111 +4148,109 @@ describe('v1.SecurityCenterClient', () => { }); await assert.rejects(promise, expectedError); assert( - (client.descriptors.page.listAssets.createStream as SinonStub) + (client.descriptors.page.listFindings.createStream as SinonStub) .getCall(0) - .calledWith(client.innerApiCalls.listAssets, request) + .calledWith(client.innerApiCalls.listFindings, request) ); assert.strictEqual( - (client.descriptors.page.listAssets.createStream as SinonStub).getCall( - 0 - ).args[2].otherArgs.headers['x-goog-request-params'], + ( + client.descriptors.page.listFindings.createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); - it('uses async iteration with listAssets without error', async () => { + it('uses async iteration with listFindings without error', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListAssetsRequest() + new protos.google.cloud.securitycenter.v1.ListFindingsRequest() ); request.parent = ''; const expectedHeaderRequestParams = 'parent='; const expectedResponse = [ generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult() + new protos.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult() ), generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult() + new protos.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult() ), generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult() + new protos.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult() ), ]; - client.descriptors.page.listAssets.asyncIterate = + client.descriptors.page.listFindings.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.securitycenter.v1.ListAssetsResponse.IListAssetsResult[] = + const responses: protos.google.cloud.securitycenter.v1.ListFindingsResponse.IListFindingsResult[] = []; - const iterable = client.listAssetsAsync(request); + const iterable = client.listFindingsAsync(request); for await (const resource of iterable) { responses.push(resource!); } assert.deepStrictEqual(responses, expectedResponse); assert.deepStrictEqual( - (client.descriptors.page.listAssets.asyncIterate as SinonStub).getCall( - 0 - ).args[1], + ( + client.descriptors.page.listFindings.asyncIterate as SinonStub + ).getCall(0).args[1], request ); assert.strictEqual( - (client.descriptors.page.listAssets.asyncIterate as SinonStub).getCall( - 0 - ).args[2].otherArgs.headers['x-goog-request-params'], + ( + client.descriptors.page.listFindings.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); - it('uses async iteration with listAssets with error', async () => { + it('uses async iteration with listFindings with error', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListAssetsRequest() + new protos.google.cloud.securitycenter.v1.ListFindingsRequest() ); request.parent = ''; const expectedHeaderRequestParams = 'parent='; const expectedError = new Error('expected'); - client.descriptors.page.listAssets.asyncIterate = stubAsyncIterationCall( - undefined, - expectedError - ); - const iterable = client.listAssetsAsync(request); + client.descriptors.page.listFindings.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listFindingsAsync(request); await assert.rejects(async () => { - const responses: protos.google.cloud.securitycenter.v1.ListAssetsResponse.IListAssetsResult[] = + const responses: protos.google.cloud.securitycenter.v1.ListFindingsResponse.IListFindingsResult[] = []; for await (const resource of iterable) { responses.push(resource!); } }); assert.deepStrictEqual( - (client.descriptors.page.listAssets.asyncIterate as SinonStub).getCall( - 0 - ).args[1], + ( + client.descriptors.page.listFindings.asyncIterate as SinonStub + ).getCall(0).args[1], request ); assert.strictEqual( - (client.descriptors.page.listAssets.asyncIterate as SinonStub).getCall( - 0 - ).args[2].otherArgs.headers['x-goog-request-params'], + ( + client.descriptors.page.listFindings.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); }); - describe('listFindings', () => { - it('invokes listFindings without error', async () => { + describe('listMuteConfigs', () => { + it('invokes listMuteConfigs without error', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListFindingsRequest() + new protos.google.cloud.securitycenter.v1.ListMuteConfigsRequest() ); request.parent = ''; const expectedHeaderRequestParams = 'parent='; @@ -3197,33 +4263,33 @@ describe('v1.SecurityCenterClient', () => { }; const expectedResponse = [ generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult() + new protos.google.cloud.securitycenter.v1.MuteConfig() ), generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult() + new protos.google.cloud.securitycenter.v1.MuteConfig() ), generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult() + new protos.google.cloud.securitycenter.v1.MuteConfig() ), ]; - client.innerApiCalls.listFindings = stubSimpleCall(expectedResponse); - const [response] = await client.listFindings(request); + client.innerApiCalls.listMuteConfigs = stubSimpleCall(expectedResponse); + const [response] = await client.listMuteConfigs(request); assert.deepStrictEqual(response, expectedResponse); assert( - (client.innerApiCalls.listFindings as SinonStub) + (client.innerApiCalls.listMuteConfigs as SinonStub) .getCall(0) .calledWith(request, expectedOptions, undefined) ); }); - it('invokes listFindings without error using callback', async () => { + it('invokes listMuteConfigs without error using callback', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListFindingsRequest() + new protos.google.cloud.securitycenter.v1.ListMuteConfigsRequest() ); request.parent = ''; const expectedHeaderRequestParams = 'parent='; @@ -3236,25 +4302,23 @@ describe('v1.SecurityCenterClient', () => { }; const expectedResponse = [ generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult() + new protos.google.cloud.securitycenter.v1.MuteConfig() ), generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult() + new protos.google.cloud.securitycenter.v1.MuteConfig() ), generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult() + new protos.google.cloud.securitycenter.v1.MuteConfig() ), ]; - client.innerApiCalls.listFindings = + client.innerApiCalls.listMuteConfigs = stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.listFindings( + client.listMuteConfigs( request, ( err?: Error | null, - result?: - | protos.google.cloud.securitycenter.v1.ListFindingsResponse.IListFindingsResult[] - | null + result?: protos.google.cloud.securitycenter.v1.IMuteConfig[] | null ) => { if (err) { reject(err); @@ -3267,20 +4331,20 @@ describe('v1.SecurityCenterClient', () => { const response = await promise; assert.deepStrictEqual(response, expectedResponse); assert( - (client.innerApiCalls.listFindings as SinonStub) + (client.innerApiCalls.listMuteConfigs as SinonStub) .getCall(0) .calledWith(request, expectedOptions /*, callback defined above */) ); }); - it('invokes listFindings with error', async () => { + it('invokes listMuteConfigs with error', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListFindingsRequest() + new protos.google.cloud.securitycenter.v1.ListMuteConfigsRequest() ); request.parent = ''; const expectedHeaderRequestParams = 'parent='; @@ -3292,51 +4356,49 @@ describe('v1.SecurityCenterClient', () => { }, }; const expectedError = new Error('expected'); - client.innerApiCalls.listFindings = stubSimpleCall( + client.innerApiCalls.listMuteConfigs = stubSimpleCall( undefined, expectedError ); - await assert.rejects(client.listFindings(request), expectedError); + await assert.rejects(client.listMuteConfigs(request), expectedError); assert( - (client.innerApiCalls.listFindings as SinonStub) + (client.innerApiCalls.listMuteConfigs as SinonStub) .getCall(0) .calledWith(request, expectedOptions, undefined) ); }); - it('invokes listFindingsStream without error', async () => { + it('invokes listMuteConfigsStream without error', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListFindingsRequest() + new protos.google.cloud.securitycenter.v1.ListMuteConfigsRequest() ); request.parent = ''; const expectedHeaderRequestParams = 'parent='; const expectedResponse = [ generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult() + new protos.google.cloud.securitycenter.v1.MuteConfig() ), generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult() + new protos.google.cloud.securitycenter.v1.MuteConfig() ), generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult() + new protos.google.cloud.securitycenter.v1.MuteConfig() ), ]; - client.descriptors.page.listFindings.createStream = + client.descriptors.page.listMuteConfigs.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listFindingsStream(request); + const stream = client.listMuteConfigsStream(request); const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult[] = + const responses: protos.google.cloud.securitycenter.v1.MuteConfig[] = []; stream.on( 'data', - ( - response: protos.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult - ) => { + (response: protos.google.cloud.securitycenter.v1.MuteConfig) => { responses.push(response); } ); @@ -3350,43 +4412,39 @@ describe('v1.SecurityCenterClient', () => { const responses = await promise; assert.deepStrictEqual(responses, expectedResponse); assert( - (client.descriptors.page.listFindings.createStream as SinonStub) + (client.descriptors.page.listMuteConfigs.createStream as SinonStub) .getCall(0) - .calledWith(client.innerApiCalls.listFindings, request) + .calledWith(client.innerApiCalls.listMuteConfigs, request) ); assert.strictEqual( ( - client.descriptors.page.listFindings.createStream as SinonStub + client.descriptors.page.listMuteConfigs.createStream as SinonStub ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); - it('invokes listFindingsStream with error', async () => { + it('invokes listMuteConfigsStream with error', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListFindingsRequest() + new protos.google.cloud.securitycenter.v1.ListMuteConfigsRequest() ); request.parent = ''; const expectedHeaderRequestParams = 'parent='; const expectedError = new Error('expected'); - client.descriptors.page.listFindings.createStream = stubPageStreamingCall( - undefined, - expectedError - ); - const stream = client.listFindingsStream(request); + client.descriptors.page.listMuteConfigs.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listMuteConfigsStream(request); const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult[] = + const responses: protos.google.cloud.securitycenter.v1.MuteConfig[] = []; stream.on( 'data', - ( - response: protos.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult - ) => { + (response: protos.google.cloud.securitycenter.v1.MuteConfig) => { responses.push(response); } ); @@ -3399,80 +4457,79 @@ describe('v1.SecurityCenterClient', () => { }); await assert.rejects(promise, expectedError); assert( - (client.descriptors.page.listFindings.createStream as SinonStub) + (client.descriptors.page.listMuteConfigs.createStream as SinonStub) .getCall(0) - .calledWith(client.innerApiCalls.listFindings, request) + .calledWith(client.innerApiCalls.listMuteConfigs, request) ); assert.strictEqual( ( - client.descriptors.page.listFindings.createStream as SinonStub + client.descriptors.page.listMuteConfigs.createStream as SinonStub ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); - it('uses async iteration with listFindings without error', async () => { + it('uses async iteration with listMuteConfigs without error', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListFindingsRequest() + new protos.google.cloud.securitycenter.v1.ListMuteConfigsRequest() ); request.parent = ''; const expectedHeaderRequestParams = 'parent='; const expectedResponse = [ generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult() + new protos.google.cloud.securitycenter.v1.MuteConfig() ), generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult() + new protos.google.cloud.securitycenter.v1.MuteConfig() ), generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult() + new protos.google.cloud.securitycenter.v1.MuteConfig() ), ]; - client.descriptors.page.listFindings.asyncIterate = + client.descriptors.page.listMuteConfigs.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.securitycenter.v1.ListFindingsResponse.IListFindingsResult[] = - []; - const iterable = client.listFindingsAsync(request); + const responses: protos.google.cloud.securitycenter.v1.IMuteConfig[] = []; + const iterable = client.listMuteConfigsAsync(request); for await (const resource of iterable) { responses.push(resource!); } assert.deepStrictEqual(responses, expectedResponse); assert.deepStrictEqual( ( - client.descriptors.page.listFindings.asyncIterate as SinonStub + client.descriptors.page.listMuteConfigs.asyncIterate as SinonStub ).getCall(0).args[1], request ); assert.strictEqual( ( - client.descriptors.page.listFindings.asyncIterate as SinonStub + client.descriptors.page.listMuteConfigs.asyncIterate as SinonStub ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); - it('uses async iteration with listFindings with error', async () => { + it('uses async iteration with listMuteConfigs with error', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListFindingsRequest() + new protos.google.cloud.securitycenter.v1.ListMuteConfigsRequest() ); request.parent = ''; const expectedHeaderRequestParams = 'parent='; const expectedError = new Error('expected'); - client.descriptors.page.listFindings.asyncIterate = + client.descriptors.page.listMuteConfigs.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listFindingsAsync(request); + const iterable = client.listMuteConfigsAsync(request); await assert.rejects(async () => { - const responses: protos.google.cloud.securitycenter.v1.ListFindingsResponse.IListFindingsResult[] = + const responses: protos.google.cloud.securitycenter.v1.IMuteConfig[] = []; for await (const resource of iterable) { responses.push(resource!); @@ -3480,13 +4537,13 @@ describe('v1.SecurityCenterClient', () => { }); assert.deepStrictEqual( ( - client.descriptors.page.listFindings.asyncIterate as SinonStub + client.descriptors.page.listMuteConfigs.asyncIterate as SinonStub ).getCall(0).args[1], request ); assert.strictEqual( ( - client.descriptors.page.listFindings.asyncIterate as SinonStub + client.descriptors.page.listMuteConfigs.asyncIterate as SinonStub ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); @@ -4246,6 +5303,61 @@ describe('v1.SecurityCenterClient', () => { }); }); + describe('folderMuteConfig', () => { + const fakePath = '/rendered/path/folderMuteConfig'; + const expectedParameters = { + folder: 'folderValue', + mute_config: 'muteConfigValue', + }; + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.folderMuteConfigPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.folderMuteConfigPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('folderMuteConfigPath', () => { + const result = client.folderMuteConfigPath( + 'folderValue', + 'muteConfigValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.folderMuteConfigPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchFolderFromFolderMuteConfigName', () => { + const result = client.matchFolderFromFolderMuteConfigName(fakePath); + assert.strictEqual(result, 'folderValue'); + assert( + (client.pathTemplates.folderMuteConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchMuteConfigFromFolderMuteConfigName', () => { + const result = client.matchMuteConfigFromFolderMuteConfigName(fakePath); + assert.strictEqual(result, 'muteConfigValue'); + assert( + (client.pathTemplates.folderMuteConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('folderSource', () => { const fakePath = '/rendered/path/folderSource'; const expectedParameters = { @@ -4674,6 +5786,69 @@ describe('v1.SecurityCenterClient', () => { }); }); + describe('organizationMuteConfig', () => { + const fakePath = '/rendered/path/organizationMuteConfig'; + const expectedParameters = { + organization: 'organizationValue', + mute_config: 'muteConfigValue', + }; + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.organizationMuteConfigPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.organizationMuteConfigPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('organizationMuteConfigPath', () => { + const result = client.organizationMuteConfigPath( + 'organizationValue', + 'muteConfigValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.organizationMuteConfigPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchOrganizationFromOrganizationMuteConfigName', () => { + const result = + client.matchOrganizationFromOrganizationMuteConfigName(fakePath); + assert.strictEqual(result, 'organizationValue'); + assert( + ( + client.pathTemplates.organizationMuteConfigPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchMuteConfigFromOrganizationMuteConfigName', () => { + const result = + client.matchMuteConfigFromOrganizationMuteConfigName(fakePath); + assert.strictEqual(result, 'muteConfigValue'); + assert( + ( + client.pathTemplates.organizationMuteConfigPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('organizationSettings', () => { const fakePath = '/rendered/path/organizationSettings'; const expectedParameters = { @@ -5059,6 +6234,68 @@ describe('v1.SecurityCenterClient', () => { }); }); + describe('projectMuteConfig', () => { + const fakePath = '/rendered/path/projectMuteConfig'; + const expectedParameters = { + project: 'projectValue', + mute_config: 'muteConfigValue', + }; + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectMuteConfigPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectMuteConfigPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectMuteConfigPath', () => { + const result = client.projectMuteConfigPath( + 'projectValue', + 'muteConfigValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectMuteConfigPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectMuteConfigName', () => { + const result = client.matchProjectFromProjectMuteConfigName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectMuteConfigPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchMuteConfigFromProjectMuteConfigName', () => { + const result = + client.matchMuteConfigFromProjectMuteConfigName(fakePath); + assert.strictEqual(result, 'muteConfigValue'); + assert( + ( + client.pathTemplates.projectMuteConfigPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('projectSource', () => { const fakePath = '/rendered/path/projectSource'; const expectedParameters = { From 160839d6f3fc583e469436a5606b994aa0dc3fde Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Mon, 15 Nov 2021 18:38:16 +0000 Subject: [PATCH 287/342] chore: release 5.7.0 (#439) :robot: I have created a release \*beep\* \*boop\* --- ## [5.7.0](https://www.github.com/googleapis/nodejs-security-center/compare/v5.6.0...v5.7.0) (2021-11-15) ### Features * Added mute related APIs, proto messages and fields ([#438](https://www.github.com/googleapis/nodejs-security-center/issues/438)) ([d432649](https://www.github.com/googleapis/nodejs-security-center/commit/d432649fed31f92a6048769b6b889666f5b9cced)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- packages/google-cloud-securitycenter/CHANGELOG.md | 7 +++++++ packages/google-cloud-securitycenter/package.json | 2 +- packages/google-cloud-securitycenter/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-securitycenter/CHANGELOG.md b/packages/google-cloud-securitycenter/CHANGELOG.md index 865066c310f..b1109d77c42 100644 --- a/packages/google-cloud-securitycenter/CHANGELOG.md +++ b/packages/google-cloud-securitycenter/CHANGELOG.md @@ -4,6 +4,13 @@ [1]: https://www.npmjs.com/package/@google-cloud/security-center?activeTab=versions +## [5.7.0](https://www.github.com/googleapis/nodejs-security-center/compare/v5.6.0...v5.7.0) (2021-11-15) + + +### Features + +* Added mute related APIs, proto messages and fields ([#438](https://www.github.com/googleapis/nodejs-security-center/issues/438)) ([d432649](https://www.github.com/googleapis/nodejs-security-center/commit/d432649fed31f92a6048769b6b889666f5b9cced)) + ## [5.6.0](https://www.github.com/googleapis/nodejs-security-center/compare/v5.5.1...v5.6.0) (2021-10-14) diff --git a/packages/google-cloud-securitycenter/package.json b/packages/google-cloud-securitycenter/package.json index acd9d9df11e..0b5cf781b7e 100644 --- a/packages/google-cloud-securitycenter/package.json +++ b/packages/google-cloud-securitycenter/package.json @@ -1,7 +1,7 @@ { "name": "@google-cloud/security-center", "description": "Cloud Security Command Center API client for Node.js", - "version": "5.6.0", + "version": "5.7.0", "license": "Apache-2.0", "author": "Google LLC", "engines": { diff --git a/packages/google-cloud-securitycenter/samples/package.json b/packages/google-cloud-securitycenter/samples/package.json index 01e334e0a06..04b4da2a4fa 100644 --- a/packages/google-cloud-securitycenter/samples/package.json +++ b/packages/google-cloud-securitycenter/samples/package.json @@ -14,7 +14,7 @@ "license": "Apache-2.0", "dependencies": { "@google-cloud/pubsub": "^2.0.0", - "@google-cloud/security-center": "^5.6.0" + "@google-cloud/security-center": "^5.7.0" }, "devDependencies": { "chai": "^4.2.0", From b35588204337e0f6271f6e57aa95dfee1c2ae30f Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Wed, 17 Nov 2021 12:12:08 -0800 Subject: [PATCH 288/342] docs: fix docstring formatting (#440) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * docs: fix docstring formatting Committer: @parthea PiperOrigin-RevId: 410563372 Source-Link: https://github.com/googleapis/googleapis/commit/23a388deac272effe33962d65ca124130956c1f5 Source-Link: https://github.com/googleapis/googleapis-gen/commit/426ebb90e67733b9e55506d2d9829617c287f998 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNDI2ZWJiOTBlNjc3MzNiOWU1NTUwNmQyZDk4Mjk2MTdjMjg3Zjk5OCJ9 * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot --- .../cloud/securitycenter/v1/securitycenter_service.proto | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/securitycenter_service.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/securitycenter_service.proto index a7690a177cc..cf139592614 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/securitycenter_service.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/securitycenter_service.proto @@ -462,9 +462,9 @@ service SecurityCenter { // Request message for bulk findings update. // // Note: -// 1. If multiple bulk update requests match the same resource, the order in +// 1. If multiple bulk update requests match the same resource, the order in // which they get executed is not defined. -// 2. Once a bulk operation is started, there is no way to stop it. +// 2. Once a bulk operation is started, there is no way to stop it. message BulkMuteFindingsRequest { // Required. The parent, at which bulk action needs to be applied. Its format is // "organizations/[organization_id]", "folders/[folder_id]", From 838da1aadc48ebdf773ceede746daeec247ed593 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Mon, 22 Nov 2021 18:15:04 +0000 Subject: [PATCH 289/342] feat: Added a new API method UpdateExternalSystem, which enables updating a finding w/ external system metadata. External systems are a child resource under finding, and are housed on the finding itself, and can also be filtered on in Notifications, the ListFindings and GroupFindings API PiperOrigin-RevId: 411093163 Source-Link: https://github.com/googleapis/googleapis/commit/be8f9889c7662043b89f63d475e72eea9a0621af Source-Link: https://github.com/googleapis/googleapis-gen/commit/186665a0ff6acaf9bf6d5ef0cef663dd828b48a7 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMTg2NjY1YTBmZjZhY2FmOWJmNmQ1ZWYwY2VmNjYzZGQ4MjhiNDhhNyJ9 See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot --- .../securitycenter/v1/external_system.proto | 59 ++ .../cloud/securitycenter/v1/finding.proto | 5 + .../v1/securitycenter_service.proto | 29 + .../protos/protos.d.ts | 237 +++++++ .../protos/protos.js | 617 +++++++++++++++++- .../protos/protos.json | 84 +++ .../security_center.update_external_system.js | 57 ++ .../src/v1/gapic_metadata.json | 10 + .../src/v1/security_center_client.ts | 369 +++++++++++ .../src/v1/security_center_client_config.json | 4 + .../src/v1/security_center_proto_list.json | 1 + .../test/gapic_security_center_v1.ts | 419 ++++++++++++ 12 files changed, 1890 insertions(+), 1 deletion(-) create mode 100644 packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/external_system.proto create mode 100644 packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_external_system.js diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/external_system.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/external_system.proto new file mode 100644 index 00000000000..b5a99332f6c --- /dev/null +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/external_system.proto @@ -0,0 +1,59 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.securitycenter.v1; + +import "google/api/resource.proto"; +import "google/protobuf/timestamp.proto"; +import "google/api/annotations.proto"; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1;securitycenter"; +option java_multiple_files = true; +option java_outer_classname = "ExternalSystemProto"; +option java_package = "com.google.cloud.securitycenter.v1"; +option php_namespace = "Google\\Cloud\\SecurityCenter\\V1"; +option ruby_package = "Google::Cloud::SecurityCenter::V1"; + +// Representation of third party SIEM/SOAR fields within SCC. +message ExternalSystem { + option (google.api.resource) = { + type: "securitycenter.googleapis.com/ExternalSystem" + pattern: "organizations/{organization}/sources/{source}/findings/{finding}/externalSystems/{externalsystem}" + pattern: "folders/{folder}/sources/{source}/findings/{finding}/externalSystems/{externalsystem}" + pattern: "projects/{project}/sources/{source}/findings/{finding}/externalSystems/{externalsystem}" + }; + + // External System Name e.g. jira, demisto, etc. + // e.g.: `organizations/1234/sources/5678/findings/123456/externalSystems/jira` + // `folders/1234/sources/5678/findings/123456/externalSystems/jira` + // `projects/1234/sources/5678/findings/123456/externalSystems/jira` + string name = 1; + + // References primary/secondary etc assignees in the external system. + repeated string assignees = 2; + + // Identifier that's used to track the given finding in the external system. + string external_uid = 3; + + // Most recent status of the corresponding finding's ticket/tracker in the + // external system. + string status = 4; + + // The most recent time when the corresponding finding's ticket/tracker was + // updated in the external system. + google.protobuf.Timestamp external_system_update_time = 5; +} diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/finding.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/finding.proto index d914a6984ea..5556b5249ef 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/finding.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/finding.proto @@ -18,6 +18,7 @@ package google.cloud.securitycenter.v1; import "google/api/field_behavior.proto"; import "google/api/resource.proto"; +import "google/cloud/securitycenter/v1/external_system.proto"; import "google/cloud/securitycenter/v1/indicator.proto"; import "google/cloud/securitycenter/v1/security_marks.proto"; import "google/cloud/securitycenter/v1/vulnerability.proto"; @@ -244,6 +245,10 @@ message Finding { // Output only. The most recent time this finding was muted or unmuted. google.protobuf.Timestamp mute_update_time = 21 [(google.api.field_behavior) = OUTPUT_ONLY]; + // Output only. Third party SIEM/SOAR fields within SCC, contains external system + // information and external system finding fields. + map external_systems = 22 [(google.api.field_behavior) = OUTPUT_ONLY]; + // First known as mute_annotation. Records additional information about the // mute operation e.g. mute config that muted the finding, user who muted the // finding, etc. diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/securitycenter_service.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/securitycenter_service.proto index cf139592614..9c8446c2f36 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/securitycenter_service.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/securitycenter_service.proto @@ -22,6 +22,7 @@ import "google/api/client.proto"; import "google/api/field_behavior.proto"; import "google/api/resource.proto"; import "google/cloud/securitycenter/v1/asset.proto"; +import "google/cloud/securitycenter/v1/external_system.proto"; import "google/cloud/securitycenter/v1/finding.proto"; import "google/cloud/securitycenter/v1/folder.proto"; import "google/cloud/securitycenter/v1/mute_config.proto"; @@ -364,6 +365,23 @@ service SecurityCenter { option (google.api.method_signature) = "resource,permissions"; } + // Updates external system. This is for a given finding. + rpc UpdateExternalSystem(UpdateExternalSystemRequest) returns (ExternalSystem) { + option (google.api.http) = { + patch: "/v1/{external_system.name=organizations/*/sources/*/findings/*/externalSystems/*}" + body: "external_system" + additional_bindings { + patch: "/v1/{external_system.name=folders/*/sources/*/findings/*/externalSystems/*}" + body: "external_system" + } + additional_bindings { + patch: "/v1/{external_system.name=projects/*/sources/*/findings/*/externalSystems/*}" + body: "external_system" + } + }; + option (google.api.method_signature) = "external_system,update_mask"; + } + // Creates or updates a finding. The corresponding source must exist for a // finding creation to succeed. rpc UpdateFinding(UpdateFindingRequest) returns (Finding) { @@ -1575,6 +1593,17 @@ message RunAssetDiscoveryRequest { ]; } +// Request message for updating a ExternalSystem resource. +message UpdateExternalSystemRequest { + // Required. The external system resource to update. + ExternalSystem external_system = 1 [(google.api.field_behavior) = REQUIRED]; + + // The FieldMask to use when updating the external system resource. + // + // If empty all mutable fields will be updated. + google.protobuf.FieldMask update_mask = 2; +} + // Request message for updating or creating a finding. message UpdateFindingRequest { // Required. The finding resource to update or create if it does not already exist. diff --git a/packages/google-cloud-securitycenter/protos/protos.d.ts b/packages/google-cloud-securitycenter/protos/protos.d.ts index 66a9913cc63..6e546de8175 100644 --- a/packages/google-cloud-securitycenter/protos/protos.d.ts +++ b/packages/google-cloud-securitycenter/protos/protos.d.ts @@ -587,6 +587,120 @@ export namespace google { public toJSON(): { [k: string]: any }; } + /** Properties of an ExternalSystem. */ + interface IExternalSystem { + + /** ExternalSystem name */ + name?: (string|null); + + /** ExternalSystem assignees */ + assignees?: (string[]|null); + + /** ExternalSystem externalUid */ + externalUid?: (string|null); + + /** ExternalSystem status */ + status?: (string|null); + + /** ExternalSystem externalSystemUpdateTime */ + externalSystemUpdateTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents an ExternalSystem. */ + class ExternalSystem implements IExternalSystem { + + /** + * Constructs a new ExternalSystem. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IExternalSystem); + + /** ExternalSystem name. */ + public name: string; + + /** ExternalSystem assignees. */ + public assignees: string[]; + + /** ExternalSystem externalUid. */ + public externalUid: string; + + /** ExternalSystem status. */ + public status: string; + + /** ExternalSystem externalSystemUpdateTime. */ + public externalSystemUpdateTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new ExternalSystem instance using the specified properties. + * @param [properties] Properties to set + * @returns ExternalSystem instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IExternalSystem): google.cloud.securitycenter.v1.ExternalSystem; + + /** + * Encodes the specified ExternalSystem message. Does not implicitly {@link google.cloud.securitycenter.v1.ExternalSystem.verify|verify} messages. + * @param message ExternalSystem message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IExternalSystem, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExternalSystem message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ExternalSystem.verify|verify} messages. + * @param message ExternalSystem message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IExternalSystem, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExternalSystem message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExternalSystem + * @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.cloud.securitycenter.v1.ExternalSystem; + + /** + * Decodes an ExternalSystem message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExternalSystem + * @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.cloud.securitycenter.v1.ExternalSystem; + + /** + * Verifies an ExternalSystem 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 ExternalSystem message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExternalSystem + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.ExternalSystem; + + /** + * Creates a plain object from an ExternalSystem message. Also converts values to other types if specified. + * @param message ExternalSystem + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.ExternalSystem, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExternalSystem to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + /** Properties of a Finding. */ interface IFinding { @@ -641,6 +755,9 @@ export namespace google { /** Finding muteUpdateTime */ muteUpdateTime?: (google.protobuf.ITimestamp|null); + /** Finding externalSystems */ + externalSystems?: ({ [k: string]: google.cloud.securitycenter.v1.IExternalSystem }|null); + /** Finding muteInitiator */ muteInitiator?: (string|null); } @@ -705,6 +822,9 @@ export namespace google { /** Finding muteUpdateTime. */ public muteUpdateTime?: (google.protobuf.ITimestamp|null); + /** Finding externalSystems. */ + public externalSystems: { [k: string]: google.cloud.securitycenter.v1.IExternalSystem }; + /** Finding muteInitiator. */ public muteInitiator: string; @@ -2639,6 +2759,20 @@ export namespace google { */ public testIamPermissions(request: google.iam.v1.ITestIamPermissionsRequest): Promise; + /** + * Calls UpdateExternalSystem. + * @param request UpdateExternalSystemRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ExternalSystem + */ + public updateExternalSystem(request: google.cloud.securitycenter.v1.IUpdateExternalSystemRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.UpdateExternalSystemCallback): void; + + /** + * Calls UpdateExternalSystem. + * @param request UpdateExternalSystemRequest message or plain object + * @returns Promise + */ + public updateExternalSystem(request: google.cloud.securitycenter.v1.IUpdateExternalSystemRequest): Promise; + /** * Calls UpdateFinding. * @param request UpdateFindingRequest message or plain object @@ -2894,6 +3028,13 @@ export namespace google { */ type TestIamPermissionsCallback = (error: (Error|null), response?: google.iam.v1.TestIamPermissionsResponse) => void; + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#updateExternalSystem}. + * @param error Error, if any + * @param [response] ExternalSystem + */ + type UpdateExternalSystemCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.ExternalSystem) => void; + /** * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#updateFinding}. * @param error Error, if any @@ -6350,6 +6491,102 @@ export namespace google { public toJSON(): { [k: string]: any }; } + /** Properties of an UpdateExternalSystemRequest. */ + interface IUpdateExternalSystemRequest { + + /** UpdateExternalSystemRequest externalSystem */ + externalSystem?: (google.cloud.securitycenter.v1.IExternalSystem|null); + + /** UpdateExternalSystemRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateExternalSystemRequest. */ + class UpdateExternalSystemRequest implements IUpdateExternalSystemRequest { + + /** + * Constructs a new UpdateExternalSystemRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IUpdateExternalSystemRequest); + + /** UpdateExternalSystemRequest externalSystem. */ + public externalSystem?: (google.cloud.securitycenter.v1.IExternalSystem|null); + + /** UpdateExternalSystemRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateExternalSystemRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateExternalSystemRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IUpdateExternalSystemRequest): google.cloud.securitycenter.v1.UpdateExternalSystemRequest; + + /** + * Encodes the specified UpdateExternalSystemRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.UpdateExternalSystemRequest.verify|verify} messages. + * @param message UpdateExternalSystemRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IUpdateExternalSystemRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateExternalSystemRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.UpdateExternalSystemRequest.verify|verify} messages. + * @param message UpdateExternalSystemRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IUpdateExternalSystemRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateExternalSystemRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateExternalSystemRequest + * @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.cloud.securitycenter.v1.UpdateExternalSystemRequest; + + /** + * Decodes an UpdateExternalSystemRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateExternalSystemRequest + * @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.cloud.securitycenter.v1.UpdateExternalSystemRequest; + + /** + * Verifies an UpdateExternalSystemRequest 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 UpdateExternalSystemRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateExternalSystemRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.UpdateExternalSystemRequest; + + /** + * Creates a plain object from an UpdateExternalSystemRequest message. Also converts values to other types if specified. + * @param message UpdateExternalSystemRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.UpdateExternalSystemRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateExternalSystemRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + /** Properties of an UpdateFindingRequest. */ interface IUpdateFindingRequest { diff --git a/packages/google-cloud-securitycenter/protos/protos.js b/packages/google-cloud-securitycenter/protos/protos.js index 89d96cb6622..bfaedfd5674 100644 --- a/packages/google-cloud-securitycenter/protos/protos.js +++ b/packages/google-cloud-securitycenter/protos/protos.js @@ -1544,6 +1544,304 @@ return SecurityMarks; })(); + v1.ExternalSystem = (function() { + + /** + * Properties of an ExternalSystem. + * @memberof google.cloud.securitycenter.v1 + * @interface IExternalSystem + * @property {string|null} [name] ExternalSystem name + * @property {Array.|null} [assignees] ExternalSystem assignees + * @property {string|null} [externalUid] ExternalSystem externalUid + * @property {string|null} [status] ExternalSystem status + * @property {google.protobuf.ITimestamp|null} [externalSystemUpdateTime] ExternalSystem externalSystemUpdateTime + */ + + /** + * Constructs a new ExternalSystem. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents an ExternalSystem. + * @implements IExternalSystem + * @constructor + * @param {google.cloud.securitycenter.v1.IExternalSystem=} [properties] Properties to set + */ + function ExternalSystem(properties) { + this.assignees = []; + 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]]; + } + + /** + * ExternalSystem name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1.ExternalSystem + * @instance + */ + ExternalSystem.prototype.name = ""; + + /** + * ExternalSystem assignees. + * @member {Array.} assignees + * @memberof google.cloud.securitycenter.v1.ExternalSystem + * @instance + */ + ExternalSystem.prototype.assignees = $util.emptyArray; + + /** + * ExternalSystem externalUid. + * @member {string} externalUid + * @memberof google.cloud.securitycenter.v1.ExternalSystem + * @instance + */ + ExternalSystem.prototype.externalUid = ""; + + /** + * ExternalSystem status. + * @member {string} status + * @memberof google.cloud.securitycenter.v1.ExternalSystem + * @instance + */ + ExternalSystem.prototype.status = ""; + + /** + * ExternalSystem externalSystemUpdateTime. + * @member {google.protobuf.ITimestamp|null|undefined} externalSystemUpdateTime + * @memberof google.cloud.securitycenter.v1.ExternalSystem + * @instance + */ + ExternalSystem.prototype.externalSystemUpdateTime = null; + + /** + * Creates a new ExternalSystem instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.ExternalSystem + * @static + * @param {google.cloud.securitycenter.v1.IExternalSystem=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.ExternalSystem} ExternalSystem instance + */ + ExternalSystem.create = function create(properties) { + return new ExternalSystem(properties); + }; + + /** + * Encodes the specified ExternalSystem message. Does not implicitly {@link google.cloud.securitycenter.v1.ExternalSystem.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.ExternalSystem + * @static + * @param {google.cloud.securitycenter.v1.IExternalSystem} message ExternalSystem message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExternalSystem.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.assignees != null && message.assignees.length) + for (var i = 0; i < message.assignees.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.assignees[i]); + if (message.externalUid != null && Object.hasOwnProperty.call(message, "externalUid")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.externalUid); + if (message.status != null && Object.hasOwnProperty.call(message, "status")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.status); + if (message.externalSystemUpdateTime != null && Object.hasOwnProperty.call(message, "externalSystemUpdateTime")) + $root.google.protobuf.Timestamp.encode(message.externalSystemUpdateTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExternalSystem message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ExternalSystem.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.ExternalSystem + * @static + * @param {google.cloud.securitycenter.v1.IExternalSystem} message ExternalSystem message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExternalSystem.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExternalSystem message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.ExternalSystem + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.ExternalSystem} ExternalSystem + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExternalSystem.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.cloud.securitycenter.v1.ExternalSystem(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + if (!(message.assignees && message.assignees.length)) + message.assignees = []; + message.assignees.push(reader.string()); + break; + case 3: + message.externalUid = reader.string(); + break; + case 4: + message.status = reader.string(); + break; + case 5: + message.externalSystemUpdateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExternalSystem message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.ExternalSystem + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.ExternalSystem} ExternalSystem + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExternalSystem.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExternalSystem message. + * @function verify + * @memberof google.cloud.securitycenter.v1.ExternalSystem + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExternalSystem.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.assignees != null && message.hasOwnProperty("assignees")) { + if (!Array.isArray(message.assignees)) + return "assignees: array expected"; + for (var i = 0; i < message.assignees.length; ++i) + if (!$util.isString(message.assignees[i])) + return "assignees: string[] expected"; + } + if (message.externalUid != null && message.hasOwnProperty("externalUid")) + if (!$util.isString(message.externalUid)) + return "externalUid: string expected"; + if (message.status != null && message.hasOwnProperty("status")) + if (!$util.isString(message.status)) + return "status: string expected"; + if (message.externalSystemUpdateTime != null && message.hasOwnProperty("externalSystemUpdateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.externalSystemUpdateTime); + if (error) + return "externalSystemUpdateTime." + error; + } + return null; + }; + + /** + * Creates an ExternalSystem message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.ExternalSystem + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.ExternalSystem} ExternalSystem + */ + ExternalSystem.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.ExternalSystem) + return object; + var message = new $root.google.cloud.securitycenter.v1.ExternalSystem(); + if (object.name != null) + message.name = String(object.name); + if (object.assignees) { + if (!Array.isArray(object.assignees)) + throw TypeError(".google.cloud.securitycenter.v1.ExternalSystem.assignees: array expected"); + message.assignees = []; + for (var i = 0; i < object.assignees.length; ++i) + message.assignees[i] = String(object.assignees[i]); + } + if (object.externalUid != null) + message.externalUid = String(object.externalUid); + if (object.status != null) + message.status = String(object.status); + if (object.externalSystemUpdateTime != null) { + if (typeof object.externalSystemUpdateTime !== "object") + throw TypeError(".google.cloud.securitycenter.v1.ExternalSystem.externalSystemUpdateTime: object expected"); + message.externalSystemUpdateTime = $root.google.protobuf.Timestamp.fromObject(object.externalSystemUpdateTime); + } + return message; + }; + + /** + * Creates a plain object from an ExternalSystem message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.ExternalSystem + * @static + * @param {google.cloud.securitycenter.v1.ExternalSystem} message ExternalSystem + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExternalSystem.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.assignees = []; + if (options.defaults) { + object.name = ""; + object.externalUid = ""; + object.status = ""; + object.externalSystemUpdateTime = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.assignees && message.assignees.length) { + object.assignees = []; + for (var j = 0; j < message.assignees.length; ++j) + object.assignees[j] = message.assignees[j]; + } + if (message.externalUid != null && message.hasOwnProperty("externalUid")) + object.externalUid = message.externalUid; + if (message.status != null && message.hasOwnProperty("status")) + object.status = message.status; + if (message.externalSystemUpdateTime != null && message.hasOwnProperty("externalSystemUpdateTime")) + object.externalSystemUpdateTime = $root.google.protobuf.Timestamp.toObject(message.externalSystemUpdateTime, options); + return object; + }; + + /** + * Converts this ExternalSystem to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.ExternalSystem + * @instance + * @returns {Object.} JSON object + */ + ExternalSystem.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ExternalSystem; + })(); + v1.Finding = (function() { /** @@ -1567,6 +1865,7 @@ * @property {google.cloud.securitycenter.v1.IIndicator|null} [indicator] Finding indicator * @property {google.cloud.securitycenter.v1.IVulnerability|null} [vulnerability] Finding vulnerability * @property {google.protobuf.ITimestamp|null} [muteUpdateTime] Finding muteUpdateTime + * @property {Object.|null} [externalSystems] Finding externalSystems * @property {string|null} [muteInitiator] Finding muteInitiator */ @@ -1580,6 +1879,7 @@ */ function Finding(properties) { this.sourceProperties = {}; + this.externalSystems = {}; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -1722,6 +2022,14 @@ */ Finding.prototype.muteUpdateTime = null; + /** + * Finding externalSystems. + * @member {Object.} externalSystems + * @memberof google.cloud.securitycenter.v1.Finding + * @instance + */ + Finding.prototype.externalSystems = $util.emptyObject; + /** * Finding muteInitiator. * @member {string} muteInitiator @@ -1791,6 +2099,11 @@ $root.google.cloud.securitycenter.v1.Vulnerability.encode(message.vulnerability, writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); if (message.muteUpdateTime != null && Object.hasOwnProperty.call(message, "muteUpdateTime")) $root.google.protobuf.Timestamp.encode(message.muteUpdateTime, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); + if (message.externalSystems != null && Object.hasOwnProperty.call(message, "externalSystems")) + for (var keys = Object.keys(message.externalSystems), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 22, wireType 2 =*/178).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.cloud.securitycenter.v1.ExternalSystem.encode(message.externalSystems[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } if (message.muteInitiator != null && Object.hasOwnProperty.call(message, "muteInitiator")) writer.uint32(/* id 28, wireType 2 =*/226).string(message.muteInitiator); return writer; @@ -1897,6 +2210,28 @@ case 21: message.muteUpdateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; + case 22: + if (message.externalSystems === $util.emptyObject) + message.externalSystems = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.cloud.securitycenter.v1.ExternalSystem.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.externalSystems[key] = value; + break; case 28: message.muteInitiator = reader.string(); break; @@ -2034,6 +2369,16 @@ if (error) return "muteUpdateTime." + error; } + if (message.externalSystems != null && message.hasOwnProperty("externalSystems")) { + if (!$util.isObject(message.externalSystems)) + return "externalSystems: object expected"; + var key = Object.keys(message.externalSystems); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.securitycenter.v1.ExternalSystem.verify(message.externalSystems[key[i]]); + if (error) + return "externalSystems." + error; + } + } if (message.muteInitiator != null && message.hasOwnProperty("muteInitiator")) if (!$util.isString(message.muteInitiator)) return "muteInitiator: string expected"; @@ -2180,6 +2525,16 @@ throw TypeError(".google.cloud.securitycenter.v1.Finding.muteUpdateTime: object expected"); message.muteUpdateTime = $root.google.protobuf.Timestamp.fromObject(object.muteUpdateTime); } + if (object.externalSystems) { + if (typeof object.externalSystems !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Finding.externalSystems: object expected"); + message.externalSystems = {}; + for (var keys = Object.keys(object.externalSystems), i = 0; i < keys.length; ++i) { + if (typeof object.externalSystems[keys[i]] !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Finding.externalSystems: object expected"); + message.externalSystems[keys[i]] = $root.google.cloud.securitycenter.v1.ExternalSystem.fromObject(object.externalSystems[keys[i]]); + } + } if (object.muteInitiator != null) message.muteInitiator = String(object.muteInitiator); return message; @@ -2198,8 +2553,10 @@ if (!options) options = {}; var object = {}; - if (options.objects || options.defaults) + if (options.objects || options.defaults) { object.sourceProperties = {}; + object.externalSystems = {}; + } if (options.defaults) { object.name = ""; object.parent = ""; @@ -2257,6 +2614,11 @@ object.vulnerability = $root.google.cloud.securitycenter.v1.Vulnerability.toObject(message.vulnerability, options); if (message.muteUpdateTime != null && message.hasOwnProperty("muteUpdateTime")) object.muteUpdateTime = $root.google.protobuf.Timestamp.toObject(message.muteUpdateTime, options); + if (message.externalSystems && (keys2 = Object.keys(message.externalSystems)).length) { + object.externalSystems = {}; + for (var j = 0; j < keys2.length; ++j) + object.externalSystems[keys2[j]] = $root.google.cloud.securitycenter.v1.ExternalSystem.toObject(message.externalSystems[keys2[j]], options); + } if (message.muteInitiator != null && message.hasOwnProperty("muteInitiator")) object.muteInitiator = message.muteInitiator; return object; @@ -6955,6 +7317,39 @@ * @variation 2 */ + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#updateExternalSystem}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef UpdateExternalSystemCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1.ExternalSystem} [response] ExternalSystem + */ + + /** + * Calls UpdateExternalSystem. + * @function updateExternalSystem + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IUpdateExternalSystemRequest} request UpdateExternalSystemRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.UpdateExternalSystemCallback} callback Node-style callback called with the error, if any, and ExternalSystem + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.updateExternalSystem = function updateExternalSystem(request, callback) { + return this.rpcCall(updateExternalSystem, $root.google.cloud.securitycenter.v1.UpdateExternalSystemRequest, $root.google.cloud.securitycenter.v1.ExternalSystem, request, callback); + }, "name", { value: "UpdateExternalSystem" }); + + /** + * Calls UpdateExternalSystem. + * @function updateExternalSystem + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IUpdateExternalSystemRequest} request UpdateExternalSystemRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + /** * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#updateFinding}. * @memberof google.cloud.securitycenter.v1.SecurityCenter @@ -15334,6 +15729,226 @@ return RunAssetDiscoveryRequest; })(); + v1.UpdateExternalSystemRequest = (function() { + + /** + * Properties of an UpdateExternalSystemRequest. + * @memberof google.cloud.securitycenter.v1 + * @interface IUpdateExternalSystemRequest + * @property {google.cloud.securitycenter.v1.IExternalSystem|null} [externalSystem] UpdateExternalSystemRequest externalSystem + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateExternalSystemRequest updateMask + */ + + /** + * Constructs a new UpdateExternalSystemRequest. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents an UpdateExternalSystemRequest. + * @implements IUpdateExternalSystemRequest + * @constructor + * @param {google.cloud.securitycenter.v1.IUpdateExternalSystemRequest=} [properties] Properties to set + */ + function UpdateExternalSystemRequest(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]]; + } + + /** + * UpdateExternalSystemRequest externalSystem. + * @member {google.cloud.securitycenter.v1.IExternalSystem|null|undefined} externalSystem + * @memberof google.cloud.securitycenter.v1.UpdateExternalSystemRequest + * @instance + */ + UpdateExternalSystemRequest.prototype.externalSystem = null; + + /** + * UpdateExternalSystemRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.securitycenter.v1.UpdateExternalSystemRequest + * @instance + */ + UpdateExternalSystemRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateExternalSystemRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.UpdateExternalSystemRequest + * @static + * @param {google.cloud.securitycenter.v1.IUpdateExternalSystemRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.UpdateExternalSystemRequest} UpdateExternalSystemRequest instance + */ + UpdateExternalSystemRequest.create = function create(properties) { + return new UpdateExternalSystemRequest(properties); + }; + + /** + * Encodes the specified UpdateExternalSystemRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.UpdateExternalSystemRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.UpdateExternalSystemRequest + * @static + * @param {google.cloud.securitycenter.v1.IUpdateExternalSystemRequest} message UpdateExternalSystemRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateExternalSystemRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.externalSystem != null && Object.hasOwnProperty.call(message, "externalSystem")) + $root.google.cloud.securitycenter.v1.ExternalSystem.encode(message.externalSystem, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateExternalSystemRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.UpdateExternalSystemRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.UpdateExternalSystemRequest + * @static + * @param {google.cloud.securitycenter.v1.IUpdateExternalSystemRequest} message UpdateExternalSystemRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateExternalSystemRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateExternalSystemRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.UpdateExternalSystemRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.UpdateExternalSystemRequest} UpdateExternalSystemRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateExternalSystemRequest.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.cloud.securitycenter.v1.UpdateExternalSystemRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.externalSystem = $root.google.cloud.securitycenter.v1.ExternalSystem.decode(reader, reader.uint32()); + break; + case 2: + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateExternalSystemRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.UpdateExternalSystemRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.UpdateExternalSystemRequest} UpdateExternalSystemRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateExternalSystemRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateExternalSystemRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1.UpdateExternalSystemRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateExternalSystemRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.externalSystem != null && message.hasOwnProperty("externalSystem")) { + var error = $root.google.cloud.securitycenter.v1.ExternalSystem.verify(message.externalSystem); + if (error) + return "externalSystem." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + return null; + }; + + /** + * Creates an UpdateExternalSystemRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.UpdateExternalSystemRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.UpdateExternalSystemRequest} UpdateExternalSystemRequest + */ + UpdateExternalSystemRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.UpdateExternalSystemRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1.UpdateExternalSystemRequest(); + if (object.externalSystem != null) { + if (typeof object.externalSystem !== "object") + throw TypeError(".google.cloud.securitycenter.v1.UpdateExternalSystemRequest.externalSystem: object expected"); + message.externalSystem = $root.google.cloud.securitycenter.v1.ExternalSystem.fromObject(object.externalSystem); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.securitycenter.v1.UpdateExternalSystemRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateExternalSystemRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.UpdateExternalSystemRequest + * @static + * @param {google.cloud.securitycenter.v1.UpdateExternalSystemRequest} message UpdateExternalSystemRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateExternalSystemRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.externalSystem = null; + object.updateMask = null; + } + if (message.externalSystem != null && message.hasOwnProperty("externalSystem")) + object.externalSystem = $root.google.cloud.securitycenter.v1.ExternalSystem.toObject(message.externalSystem, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateExternalSystemRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.UpdateExternalSystemRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateExternalSystemRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return UpdateExternalSystemRequest; + })(); + v1.UpdateFindingRequest = (function() { /** diff --git a/packages/google-cloud-securitycenter/protos/protos.json b/packages/google-cloud-securitycenter/protos/protos.json index 7ab735d4b3c..342eb19be8d 100644 --- a/packages/google-cloud-securitycenter/protos/protos.json +++ b/packages/google-cloud-securitycenter/protos/protos.json @@ -145,6 +145,35 @@ } } }, + "ExternalSystem": { + "options": { + "(google.api.resource).type": "securitycenter.googleapis.com/ExternalSystem", + "(google.api.resource).pattern": "projects/{project}/sources/{source}/findings/{finding}/externalSystems/{externalsystem}" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "assignees": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "externalUid": { + "type": "string", + "id": 3 + }, + "status": { + "type": "string", + "id": 4 + }, + "externalSystemUpdateTime": { + "type": "google.protobuf.Timestamp", + "id": 5 + } + } + }, "Finding": { "options": { "(google.api.resource).type": "securitycenter.googleapis.com/Finding", @@ -226,6 +255,14 @@ "(google.api.field_behavior)": "OUTPUT_ONLY" } }, + "externalSystems": { + "keyType": "string", + "type": "ExternalSystem", + "id": 22, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, "muteInitiator": { "type": "string", "id": 28 @@ -1242,6 +1279,38 @@ } ] }, + "UpdateExternalSystem": { + "requestType": "UpdateExternalSystemRequest", + "responseType": "ExternalSystem", + "options": { + "(google.api.http).patch": "/v1/{external_system.name=organizations/*/sources/*/findings/*/externalSystems/*}", + "(google.api.http).body": "external_system", + "(google.api.http).additional_bindings.patch": "/v1/{external_system.name=projects/*/sources/*/findings/*/externalSystems/*}", + "(google.api.http).additional_bindings.body": "external_system", + "(google.api.method_signature)": "external_system,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{external_system.name=organizations/*/sources/*/findings/*/externalSystems/*}", + "body": "external_system", + "additional_bindings": [ + { + "patch": "/v1/{external_system.name=folders/*/sources/*/findings/*/externalSystems/*}", + "body": "external_system" + }, + { + "patch": "/v1/{external_system.name=projects/*/sources/*/findings/*/externalSystems/*}", + "body": "external_system" + } + ] + } + }, + { + "(google.api.method_signature)": "external_system,update_mask" + } + ] + }, "UpdateFinding": { "requestType": "UpdateFindingRequest", "responseType": "Finding", @@ -2114,6 +2183,21 @@ } } }, + "UpdateExternalSystemRequest": { + "fields": { + "externalSystem": { + "type": "ExternalSystem", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2 + } + } + }, "UpdateFindingRequest": { "fields": { "finding": { diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_external_system.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_external_system.js new file mode 100644 index 00000000000..d29496da90c --- /dev/null +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_external_system.js @@ -0,0 +1,57 @@ +// 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'; + +function main(externalSystem) { + // [START securitycenter_v1_generated_SecurityCenter_UpdateExternalSystem_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The external system resource to update. + */ + // const externalSystem = {} + /** + * The FieldMask to use when updating the external system resource. + * If empty all mutable fields will be updated. + */ + // const updateMask = {} + + // Imports the Securitycenter library + const {SecurityCenterClient} = require('@google-cloud/security-center').v1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function callUpdateExternalSystem() { + // Construct request + const request = { + externalSystem, + }; + + // Run request + const response = await securitycenterClient.updateExternalSystem(request); + console.log(response); + } + + callUpdateExternalSystem(); + // [END securitycenter_v1_generated_SecurityCenter_UpdateExternalSystem_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-securitycenter/src/v1/gapic_metadata.json b/packages/google-cloud-securitycenter/src/v1/gapic_metadata.json index 53654b4a9bf..84ee4472f7e 100644 --- a/packages/google-cloud-securitycenter/src/v1/gapic_metadata.json +++ b/packages/google-cloud-securitycenter/src/v1/gapic_metadata.json @@ -85,6 +85,11 @@ "testIamPermissions" ] }, + "UpdateExternalSystem": { + "methods": [ + "updateExternalSystem" + ] + }, "UpdateFinding": { "methods": [ "updateFinding" @@ -254,6 +259,11 @@ "testIamPermissions" ] }, + "UpdateExternalSystem": { + "methods": [ + "updateExternalSystem" + ] + }, "UpdateFinding": { "methods": [ "updateFinding" diff --git a/packages/google-cloud-securitycenter/src/v1/security_center_client.ts b/packages/google-cloud-securitycenter/src/v1/security_center_client.ts index 517cb9d6a6e..4421cc793cc 100644 --- a/packages/google-cloud-securitycenter/src/v1/security_center_client.ts +++ b/packages/google-cloud-securitycenter/src/v1/security_center_client.ts @@ -181,6 +181,10 @@ export class SecurityCenterClient { folderSourceFindingPathTemplate: new this._gaxModule.PathTemplate( 'folders/{folder}/sources/{source}/findings/{finding}' ), + folderSourceFindingExternalsystemPathTemplate: + new this._gaxModule.PathTemplate( + 'folders/{folder}/sources/{source}/findings/{finding}/externalSystems/{externalsystem}' + ), folderSourceFindingSecurityMarksPathTemplate: new this._gaxModule.PathTemplate( 'folders/{folder}/sources/{source}/findings/{finding}/securityMarks' @@ -210,6 +214,10 @@ export class SecurityCenterClient { organizationSourceFindingPathTemplate: new this._gaxModule.PathTemplate( 'organizations/{organization}/sources/{source}/findings/{finding}' ), + organizationSourceFindingExternalsystemPathTemplate: + new this._gaxModule.PathTemplate( + 'organizations/{organization}/sources/{source}/findings/{finding}/externalSystems/{externalsystem}' + ), organizationSourceFindingSecurityMarksPathTemplate: new this._gaxModule.PathTemplate( 'organizations/{organization}/sources/{source}/findings/{finding}/securityMarks' @@ -229,6 +237,10 @@ export class SecurityCenterClient { projectSourceFindingPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/sources/{source}/findings/{finding}' ), + projectSourceFindingExternalsystemPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/sources/{source}/findings/{finding}/externalSystems/{externalsystem}' + ), projectSourceFindingSecurityMarksPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/sources/{source}/findings/{finding}/securityMarks' @@ -388,6 +400,7 @@ export class SecurityCenterClient { 'setMute', 'setIamPolicy', 'testIamPermissions', + 'updateExternalSystem', 'updateFinding', 'updateMuteConfig', 'updateNotificationConfig', @@ -1933,6 +1946,107 @@ export class SecurityCenterClient { this.initialize(); return this.innerApiCalls.testIamPermissions(request, options, callback); } + /** + * Updates external system. This is for a given finding. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.securitycenter.v1.ExternalSystem} request.externalSystem + * Required. The external system resource to update. + * @param {google.protobuf.FieldMask} request.updateMask + * The FieldMask to use when updating the external system resource. + * + * If empty all mutable fields will be updated. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [ExternalSystem]{@link google.cloud.securitycenter.v1.ExternalSystem}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/security_center.update_external_system.js + * region_tag:securitycenter_v1_generated_SecurityCenter_UpdateExternalSystem_async + */ + updateExternalSystem( + request?: protos.google.cloud.securitycenter.v1.IUpdateExternalSystemRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.securitycenter.v1.IExternalSystem, + ( + | protos.google.cloud.securitycenter.v1.IUpdateExternalSystemRequest + | undefined + ), + {} | undefined + ] + >; + updateExternalSystem( + request: protos.google.cloud.securitycenter.v1.IUpdateExternalSystemRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.securitycenter.v1.IExternalSystem, + | protos.google.cloud.securitycenter.v1.IUpdateExternalSystemRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateExternalSystem( + request: protos.google.cloud.securitycenter.v1.IUpdateExternalSystemRequest, + callback: Callback< + protos.google.cloud.securitycenter.v1.IExternalSystem, + | protos.google.cloud.securitycenter.v1.IUpdateExternalSystemRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateExternalSystem( + request?: protos.google.cloud.securitycenter.v1.IUpdateExternalSystemRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.securitycenter.v1.IExternalSystem, + | protos.google.cloud.securitycenter.v1.IUpdateExternalSystemRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.securitycenter.v1.IExternalSystem, + | protos.google.cloud.securitycenter.v1.IUpdateExternalSystemRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.securitycenter.v1.IExternalSystem, + ( + | protos.google.cloud.securitycenter.v1.IUpdateExternalSystemRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + 'external_system.name': request.externalSystem!.name || '', + }); + this.initialize(); + return this.innerApiCalls.updateExternalSystem(request, options, callback); + } /** * Creates or updates a finding. The corresponding source must exist for a * finding creation to succeed. @@ -5959,6 +6073,91 @@ export class SecurityCenterClient { ).finding; } + /** + * Return a fully-qualified folderSourceFindingExternalsystem resource name string. + * + * @param {string} folder + * @param {string} source + * @param {string} finding + * @param {string} externalsystem + * @returns {string} Resource name string. + */ + folderSourceFindingExternalsystemPath( + folder: string, + source: string, + finding: string, + externalsystem: string + ) { + return this.pathTemplates.folderSourceFindingExternalsystemPathTemplate.render( + { + folder: folder, + source: source, + finding: finding, + externalsystem: externalsystem, + } + ); + } + + /** + * Parse the folder from FolderSourceFindingExternalsystem resource. + * + * @param {string} folderSourceFindingExternalsystemName + * A fully-qualified path representing folder_source_finding_externalsystem resource. + * @returns {string} A string representing the folder. + */ + matchFolderFromFolderSourceFindingExternalsystemName( + folderSourceFindingExternalsystemName: string + ) { + return this.pathTemplates.folderSourceFindingExternalsystemPathTemplate.match( + folderSourceFindingExternalsystemName + ).folder; + } + + /** + * Parse the source from FolderSourceFindingExternalsystem resource. + * + * @param {string} folderSourceFindingExternalsystemName + * A fully-qualified path representing folder_source_finding_externalsystem resource. + * @returns {string} A string representing the source. + */ + matchSourceFromFolderSourceFindingExternalsystemName( + folderSourceFindingExternalsystemName: string + ) { + return this.pathTemplates.folderSourceFindingExternalsystemPathTemplate.match( + folderSourceFindingExternalsystemName + ).source; + } + + /** + * Parse the finding from FolderSourceFindingExternalsystem resource. + * + * @param {string} folderSourceFindingExternalsystemName + * A fully-qualified path representing folder_source_finding_externalsystem resource. + * @returns {string} A string representing the finding. + */ + matchFindingFromFolderSourceFindingExternalsystemName( + folderSourceFindingExternalsystemName: string + ) { + return this.pathTemplates.folderSourceFindingExternalsystemPathTemplate.match( + folderSourceFindingExternalsystemName + ).finding; + } + + /** + * Parse the externalsystem from FolderSourceFindingExternalsystem resource. + * + * @param {string} folderSourceFindingExternalsystemName + * A fully-qualified path representing folder_source_finding_externalsystem resource. + * @returns {string} A string representing the externalsystem. + */ + matchExternalsystemFromFolderSourceFindingExternalsystemName( + folderSourceFindingExternalsystemName: string + ) { + return this.pathTemplates.folderSourceFindingExternalsystemPathTemplate.match( + folderSourceFindingExternalsystemName + ).externalsystem; + } + /** * Return a fully-qualified folderSourceFindingSecurityMarks resource name string. * @@ -6354,6 +6553,91 @@ export class SecurityCenterClient { ).finding; } + /** + * Return a fully-qualified organizationSourceFindingExternalsystem resource name string. + * + * @param {string} organization + * @param {string} source + * @param {string} finding + * @param {string} externalsystem + * @returns {string} Resource name string. + */ + organizationSourceFindingExternalsystemPath( + organization: string, + source: string, + finding: string, + externalsystem: string + ) { + return this.pathTemplates.organizationSourceFindingExternalsystemPathTemplate.render( + { + organization: organization, + source: source, + finding: finding, + externalsystem: externalsystem, + } + ); + } + + /** + * Parse the organization from OrganizationSourceFindingExternalsystem resource. + * + * @param {string} organizationSourceFindingExternalsystemName + * A fully-qualified path representing organization_source_finding_externalsystem resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationSourceFindingExternalsystemName( + organizationSourceFindingExternalsystemName: string + ) { + return this.pathTemplates.organizationSourceFindingExternalsystemPathTemplate.match( + organizationSourceFindingExternalsystemName + ).organization; + } + + /** + * Parse the source from OrganizationSourceFindingExternalsystem resource. + * + * @param {string} organizationSourceFindingExternalsystemName + * A fully-qualified path representing organization_source_finding_externalsystem resource. + * @returns {string} A string representing the source. + */ + matchSourceFromOrganizationSourceFindingExternalsystemName( + organizationSourceFindingExternalsystemName: string + ) { + return this.pathTemplates.organizationSourceFindingExternalsystemPathTemplate.match( + organizationSourceFindingExternalsystemName + ).source; + } + + /** + * Parse the finding from OrganizationSourceFindingExternalsystem resource. + * + * @param {string} organizationSourceFindingExternalsystemName + * A fully-qualified path representing organization_source_finding_externalsystem resource. + * @returns {string} A string representing the finding. + */ + matchFindingFromOrganizationSourceFindingExternalsystemName( + organizationSourceFindingExternalsystemName: string + ) { + return this.pathTemplates.organizationSourceFindingExternalsystemPathTemplate.match( + organizationSourceFindingExternalsystemName + ).finding; + } + + /** + * Parse the externalsystem from OrganizationSourceFindingExternalsystem resource. + * + * @param {string} organizationSourceFindingExternalsystemName + * A fully-qualified path representing organization_source_finding_externalsystem resource. + * @returns {string} A string representing the externalsystem. + */ + matchExternalsystemFromOrganizationSourceFindingExternalsystemName( + organizationSourceFindingExternalsystemName: string + ) { + return this.pathTemplates.organizationSourceFindingExternalsystemPathTemplate.match( + organizationSourceFindingExternalsystemName + ).externalsystem; + } + /** * Return a fully-qualified organizationSourceFindingSecurityMarks resource name string. * @@ -6636,6 +6920,91 @@ export class SecurityCenterClient { ).finding; } + /** + * Return a fully-qualified projectSourceFindingExternalsystem resource name string. + * + * @param {string} project + * @param {string} source + * @param {string} finding + * @param {string} externalsystem + * @returns {string} Resource name string. + */ + projectSourceFindingExternalsystemPath( + project: string, + source: string, + finding: string, + externalsystem: string + ) { + return this.pathTemplates.projectSourceFindingExternalsystemPathTemplate.render( + { + project: project, + source: source, + finding: finding, + externalsystem: externalsystem, + } + ); + } + + /** + * Parse the project from ProjectSourceFindingExternalsystem resource. + * + * @param {string} projectSourceFindingExternalsystemName + * A fully-qualified path representing project_source_finding_externalsystem resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectSourceFindingExternalsystemName( + projectSourceFindingExternalsystemName: string + ) { + return this.pathTemplates.projectSourceFindingExternalsystemPathTemplate.match( + projectSourceFindingExternalsystemName + ).project; + } + + /** + * Parse the source from ProjectSourceFindingExternalsystem resource. + * + * @param {string} projectSourceFindingExternalsystemName + * A fully-qualified path representing project_source_finding_externalsystem resource. + * @returns {string} A string representing the source. + */ + matchSourceFromProjectSourceFindingExternalsystemName( + projectSourceFindingExternalsystemName: string + ) { + return this.pathTemplates.projectSourceFindingExternalsystemPathTemplate.match( + projectSourceFindingExternalsystemName + ).source; + } + + /** + * Parse the finding from ProjectSourceFindingExternalsystem resource. + * + * @param {string} projectSourceFindingExternalsystemName + * A fully-qualified path representing project_source_finding_externalsystem resource. + * @returns {string} A string representing the finding. + */ + matchFindingFromProjectSourceFindingExternalsystemName( + projectSourceFindingExternalsystemName: string + ) { + return this.pathTemplates.projectSourceFindingExternalsystemPathTemplate.match( + projectSourceFindingExternalsystemName + ).finding; + } + + /** + * Parse the externalsystem from ProjectSourceFindingExternalsystem resource. + * + * @param {string} projectSourceFindingExternalsystemName + * A fully-qualified path representing project_source_finding_externalsystem resource. + * @returns {string} A string representing the externalsystem. + */ + matchExternalsystemFromProjectSourceFindingExternalsystemName( + projectSourceFindingExternalsystemName: string + ) { + return this.pathTemplates.projectSourceFindingExternalsystemPathTemplate.match( + projectSourceFindingExternalsystemName + ).externalsystem; + } + /** * Return a fully-qualified projectSourceFindingSecurityMarks resource name string. * diff --git a/packages/google-cloud-securitycenter/src/v1/security_center_client_config.json b/packages/google-cloud-securitycenter/src/v1/security_center_client_config.json index f42e8c7db8b..54adba19c51 100644 --- a/packages/google-cloud-securitycenter/src/v1/security_center_client_config.json +++ b/packages/google-cloud-securitycenter/src/v1/security_center_client_config.json @@ -134,6 +134,10 @@ "retry_codes_name": "idempotent", "retry_params_name": "default" }, + "UpdateExternalSystem": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, "UpdateFinding": { "timeout_millis": 60000, "retry_codes_name": "non_idempotent", diff --git a/packages/google-cloud-securitycenter/src/v1/security_center_proto_list.json b/packages/google-cloud-securitycenter/src/v1/security_center_proto_list.json index a32f4658899..865edc59b68 100644 --- a/packages/google-cloud-securitycenter/src/v1/security_center_proto_list.json +++ b/packages/google-cloud-securitycenter/src/v1/security_center_proto_list.json @@ -1,5 +1,6 @@ [ "../../protos/google/cloud/securitycenter/v1/asset.proto", + "../../protos/google/cloud/securitycenter/v1/external_system.proto", "../../protos/google/cloud/securitycenter/v1/finding.proto", "../../protos/google/cloud/securitycenter/v1/folder.proto", "../../protos/google/cloud/securitycenter/v1/indicator.proto", diff --git a/packages/google-cloud-securitycenter/test/gapic_security_center_v1.ts b/packages/google-cloud-securitycenter/test/gapic_security_center_v1.ts index 080ff5d2159..6b011b3d7eb 100644 --- a/packages/google-cloud-securitycenter/test/gapic_security_center_v1.ts +++ b/packages/google-cloud-securitycenter/test/gapic_security_center_v1.ts @@ -1903,6 +1903,121 @@ describe('v1.SecurityCenterClient', () => { }); }); + describe('updateExternalSystem', () => { + it('invokes updateExternalSystem without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.UpdateExternalSystemRequest() + ); + request.externalSystem = {}; + request.externalSystem.name = ''; + const expectedHeaderRequestParams = 'external_system.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ExternalSystem() + ); + client.innerApiCalls.updateExternalSystem = + stubSimpleCall(expectedResponse); + const [response] = await client.updateExternalSystem(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.updateExternalSystem as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes updateExternalSystem without error using callback', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.UpdateExternalSystemRequest() + ); + request.externalSystem = {}; + request.externalSystem.name = ''; + const expectedHeaderRequestParams = 'external_system.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ExternalSystem() + ); + client.innerApiCalls.updateExternalSystem = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateExternalSystem( + request, + ( + err?: Error | null, + result?: protos.google.cloud.securitycenter.v1.IExternalSystem | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.updateExternalSystem as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes updateExternalSystem with error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.UpdateExternalSystemRequest() + ); + request.externalSystem = {}; + request.externalSystem.name = ''; + const expectedHeaderRequestParams = 'external_system.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.updateExternalSystem = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.updateExternalSystem(request), expectedError); + assert( + (client.innerApiCalls.updateExternalSystem as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + describe('updateFinding', () => { it('invokes updateFinding without error', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ @@ -5483,6 +5598,103 @@ describe('v1.SecurityCenterClient', () => { }); }); + describe('folderSourceFindingExternalsystem', () => { + const fakePath = '/rendered/path/folderSourceFindingExternalsystem'; + const expectedParameters = { + folder: 'folderValue', + source: 'sourceValue', + finding: 'findingValue', + externalsystem: 'externalsystemValue', + }; + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.folderSourceFindingExternalsystemPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.folderSourceFindingExternalsystemPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('folderSourceFindingExternalsystemPath', () => { + const result = client.folderSourceFindingExternalsystemPath( + 'folderValue', + 'sourceValue', + 'findingValue', + 'externalsystemValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.folderSourceFindingExternalsystemPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchFolderFromFolderSourceFindingExternalsystemName', () => { + const result = + client.matchFolderFromFolderSourceFindingExternalsystemName(fakePath); + assert.strictEqual(result, 'folderValue'); + assert( + ( + client.pathTemplates.folderSourceFindingExternalsystemPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSourceFromFolderSourceFindingExternalsystemName', () => { + const result = + client.matchSourceFromFolderSourceFindingExternalsystemName(fakePath); + assert.strictEqual(result, 'sourceValue'); + assert( + ( + client.pathTemplates.folderSourceFindingExternalsystemPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchFindingFromFolderSourceFindingExternalsystemName', () => { + const result = + client.matchFindingFromFolderSourceFindingExternalsystemName( + fakePath + ); + assert.strictEqual(result, 'findingValue'); + assert( + ( + client.pathTemplates.folderSourceFindingExternalsystemPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchExternalsystemFromFolderSourceFindingExternalsystemName', () => { + const result = + client.matchExternalsystemFromFolderSourceFindingExternalsystemName( + fakePath + ); + assert.strictEqual(result, 'externalsystemValue'); + assert( + ( + client.pathTemplates.folderSourceFindingExternalsystemPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('folderSourceFindingSecurityMarks', () => { const fakePath = '/rendered/path/folderSourceFindingSecurityMarks'; const expectedParameters = { @@ -6035,6 +6247,112 @@ describe('v1.SecurityCenterClient', () => { }); }); + describe('organizationSourceFindingExternalsystem', () => { + const fakePath = '/rendered/path/organizationSourceFindingExternalsystem'; + const expectedParameters = { + organization: 'organizationValue', + source: 'sourceValue', + finding: 'findingValue', + externalsystem: 'externalsystemValue', + }; + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.organizationSourceFindingExternalsystemPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationSourceFindingExternalsystemPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('organizationSourceFindingExternalsystemPath', () => { + const result = client.organizationSourceFindingExternalsystemPath( + 'organizationValue', + 'sourceValue', + 'findingValue', + 'externalsystemValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .organizationSourceFindingExternalsystemPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchOrganizationFromOrganizationSourceFindingExternalsystemName', () => { + const result = + client.matchOrganizationFromOrganizationSourceFindingExternalsystemName( + fakePath + ); + assert.strictEqual(result, 'organizationValue'); + assert( + ( + client.pathTemplates + .organizationSourceFindingExternalsystemPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSourceFromOrganizationSourceFindingExternalsystemName', () => { + const result = + client.matchSourceFromOrganizationSourceFindingExternalsystemName( + fakePath + ); + assert.strictEqual(result, 'sourceValue'); + assert( + ( + client.pathTemplates + .organizationSourceFindingExternalsystemPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchFindingFromOrganizationSourceFindingExternalsystemName', () => { + const result = + client.matchFindingFromOrganizationSourceFindingExternalsystemName( + fakePath + ); + assert.strictEqual(result, 'findingValue'); + assert( + ( + client.pathTemplates + .organizationSourceFindingExternalsystemPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchExternalsystemFromOrganizationSourceFindingExternalsystemName', () => { + const result = + client.matchExternalsystemFromOrganizationSourceFindingExternalsystemName( + fakePath + ); + assert.strictEqual(result, 'externalsystemValue'); + assert( + ( + client.pathTemplates + .organizationSourceFindingExternalsystemPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('organizationSourceFindingSecurityMarks', () => { const fakePath = '/rendered/path/organizationSourceFindingSecurityMarks'; const expectedParameters = { @@ -6423,6 +6741,107 @@ describe('v1.SecurityCenterClient', () => { }); }); + describe('projectSourceFindingExternalsystem', () => { + const fakePath = '/rendered/path/projectSourceFindingExternalsystem'; + const expectedParameters = { + project: 'projectValue', + source: 'sourceValue', + finding: 'findingValue', + externalsystem: 'externalsystemValue', + }; + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectSourceFindingExternalsystemPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectSourceFindingExternalsystemPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectSourceFindingExternalsystemPath', () => { + const result = client.projectSourceFindingExternalsystemPath( + 'projectValue', + 'sourceValue', + 'findingValue', + 'externalsystemValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectSourceFindingExternalsystemPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectSourceFindingExternalsystemName', () => { + const result = + client.matchProjectFromProjectSourceFindingExternalsystemName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectSourceFindingExternalsystemPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSourceFromProjectSourceFindingExternalsystemName', () => { + const result = + client.matchSourceFromProjectSourceFindingExternalsystemName( + fakePath + ); + assert.strictEqual(result, 'sourceValue'); + assert( + ( + client.pathTemplates.projectSourceFindingExternalsystemPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchFindingFromProjectSourceFindingExternalsystemName', () => { + const result = + client.matchFindingFromProjectSourceFindingExternalsystemName( + fakePath + ); + assert.strictEqual(result, 'findingValue'); + assert( + ( + client.pathTemplates.projectSourceFindingExternalsystemPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchExternalsystemFromProjectSourceFindingExternalsystemName', () => { + const result = + client.matchExternalsystemFromProjectSourceFindingExternalsystemName( + fakePath + ); + assert.strictEqual(result, 'externalsystemValue'); + assert( + ( + client.pathTemplates.projectSourceFindingExternalsystemPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('projectSourceFindingSecurityMarks', () => { const fakePath = '/rendered/path/projectSourceFindingSecurityMarks'; const expectedParameters = { From efa4f369e4acc962213fccbbda7cdfa45165003b Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Mon, 29 Nov 2021 10:09:37 -0800 Subject: [PATCH 290/342] chore: release 5.8.0 (#442) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- packages/google-cloud-securitycenter/CHANGELOG.md | 7 +++++++ packages/google-cloud-securitycenter/package.json | 2 +- packages/google-cloud-securitycenter/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-securitycenter/CHANGELOG.md b/packages/google-cloud-securitycenter/CHANGELOG.md index b1109d77c42..9f6038f18cc 100644 --- a/packages/google-cloud-securitycenter/CHANGELOG.md +++ b/packages/google-cloud-securitycenter/CHANGELOG.md @@ -4,6 +4,13 @@ [1]: https://www.npmjs.com/package/@google-cloud/security-center?activeTab=versions +## [5.8.0](https://www.github.com/googleapis/nodejs-security-center/compare/v5.7.0...v5.8.0) (2021-11-22) + + +### Features + +* Added a new API method UpdateExternalSystem, which enables updating a finding w/ external system metadata. External systems are a child resource under finding, and are housed on the finding itself, and can also be filtered on in Notifications, the ListFindings and GroupFindings API ([3917f97](https://www.github.com/googleapis/nodejs-security-center/commit/3917f978d8d645d08024d28c7045a4d5481782dd)) + ## [5.7.0](https://www.github.com/googleapis/nodejs-security-center/compare/v5.6.0...v5.7.0) (2021-11-15) diff --git a/packages/google-cloud-securitycenter/package.json b/packages/google-cloud-securitycenter/package.json index 0b5cf781b7e..dbf66e01c85 100644 --- a/packages/google-cloud-securitycenter/package.json +++ b/packages/google-cloud-securitycenter/package.json @@ -1,7 +1,7 @@ { "name": "@google-cloud/security-center", "description": "Cloud Security Command Center API client for Node.js", - "version": "5.7.0", + "version": "5.8.0", "license": "Apache-2.0", "author": "Google LLC", "engines": { diff --git a/packages/google-cloud-securitycenter/samples/package.json b/packages/google-cloud-securitycenter/samples/package.json index 04b4da2a4fa..fbb82371c41 100644 --- a/packages/google-cloud-securitycenter/samples/package.json +++ b/packages/google-cloud-securitycenter/samples/package.json @@ -14,7 +14,7 @@ "license": "Apache-2.0", "dependencies": { "@google-cloud/pubsub": "^2.0.0", - "@google-cloud/security-center": "^5.7.0" + "@google-cloud/security-center": "^5.8.0" }, "devDependencies": { "chai": "^4.2.0", From 0efe9b05354b8f2d0e2c1354b0a30936488b77e5 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 9 Dec 2021 22:44:27 +0000 Subject: [PATCH 291/342] build: add generated samples to .eslintignore (#443) --- packages/google-cloud-securitycenter/.eslintignore | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/google-cloud-securitycenter/.eslintignore b/packages/google-cloud-securitycenter/.eslintignore index 9340ad9b86d..ea5b04aebe6 100644 --- a/packages/google-cloud-securitycenter/.eslintignore +++ b/packages/google-cloud-securitycenter/.eslintignore @@ -4,3 +4,4 @@ test/fixtures build/ docs/ protos/ +samples/generated/ From 06ac3dc6313bfb31c3ba44e7db6254c45d029201 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Wed, 29 Dec 2021 19:54:23 +0000 Subject: [PATCH 292/342] docs(node): support "stable"/"preview" release level (#1312) (#446) --- packages/google-cloud-securitycenter/README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/google-cloud-securitycenter/README.md b/packages/google-cloud-securitycenter/README.md index f6a527d9794..9d30ab1a3a4 100644 --- a/packages/google-cloud-securitycenter/README.md +++ b/packages/google-cloud-securitycenter/README.md @@ -137,6 +137,8 @@ are addressed with the highest priority. + + More Information: [Google Cloud Platform Launch Stages][launch_stages] [launch_stages]: https://cloud.google.com/terms/launch-stages From a5d09cfa1db74865fac9ba03c7e04e3c8879f776 Mon Sep 17 00:00:00 2001 From: Anthonios Partheniou Date: Thu, 30 Dec 2021 12:27:44 -0500 Subject: [PATCH 293/342] chore: add api_shortname and library_type to repo metadata (#445) --- packages/google-cloud-securitycenter/.repo-metadata.json | 6 ++++-- packages/google-cloud-securitycenter/README.md | 9 ++++----- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/packages/google-cloud-securitycenter/.repo-metadata.json b/packages/google-cloud-securitycenter/.repo-metadata.json index adb15f06a90..c396871af1a 100644 --- a/packages/google-cloud-securitycenter/.repo-metadata.json +++ b/packages/google-cloud-securitycenter/.repo-metadata.json @@ -2,7 +2,7 @@ "language": "nodejs", "api_id": "securitycenter.googleapis.com", "repo": "googleapis/nodejs-security-center", - "release_level": "ga", + "release_level": "stable", "distribution_name": "@google-cloud/security-center", "default_version": "v1", "name": "security-center", @@ -10,5 +10,7 @@ "requires_billing": true, "name_pretty": "Google Cloud Security Command Center", "issue_tracker": "https://issuetracker.google.com/savedsearches/559748", - "product_documentation": "https://cloud.google.com/security-command-center" + "product_documentation": "https://cloud.google.com/security-command-center", + "api_shortname": "securitycenter", + "library_type": "GAPIC_AUTO" } diff --git a/packages/google-cloud-securitycenter/README.md b/packages/google-cloud-securitycenter/README.md index 9d30ab1a3a4..58af19b7e53 100644 --- a/packages/google-cloud-securitycenter/README.md +++ b/packages/google-cloud-securitycenter/README.md @@ -4,7 +4,7 @@ # [Google Cloud Security Command Center: Node.js Client](https://github.com/googleapis/nodejs-security-center) -[![release level](https://img.shields.io/badge/release%20level-general%20availability%20%28GA%29-brightgreen.svg?style=flat)](https://cloud.google.com/terms/launch-stages) + [![npm version](https://img.shields.io/npm/v/@google-cloud/security-center.svg)](https://www.npmjs.org/package/@google-cloud/security-center) [![codecov](https://img.shields.io/codecov/c/github/googleapis/nodejs-security-center/main.svg?style=flat)](https://codecov.io/gh/googleapis/nodejs-security-center) @@ -127,10 +127,10 @@ _Legacy Node.js versions are supported as a best effort:_ This library follows [Semantic Versioning](http://semver.org/). -This library is considered to be **General Availability (GA)**. This means it -is stable; the code surface will not change in backwards-incompatible ways + +This library is considered to be **stable**. The code surface will not change in backwards-incompatible ways unless absolutely necessary (e.g. because of critical security issues) or with -an extensive deprecation period. Issues and requests against **GA** libraries +an extensive deprecation period. Issues and requests against **stable** libraries are addressed with the highest priority. @@ -138,7 +138,6 @@ are addressed with the highest priority. - More Information: [Google Cloud Platform Launch Stages][launch_stages] [launch_stages]: https://cloud.google.com/terms/launch-stages From 243721055e0bcea02f9d6654684c126c004f057d Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 30 Dec 2021 23:12:21 +0000 Subject: [PATCH 294/342] docs(badges): tweak badge to use new preview/stable language (#1314) (#448) --- packages/google-cloud-securitycenter/README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/google-cloud-securitycenter/README.md b/packages/google-cloud-securitycenter/README.md index 58af19b7e53..6c4e9dcddae 100644 --- a/packages/google-cloud-securitycenter/README.md +++ b/packages/google-cloud-securitycenter/README.md @@ -4,9 +4,8 @@ # [Google Cloud Security Command Center: Node.js Client](https://github.com/googleapis/nodejs-security-center) - +[![release level](https://img.shields.io/badge/release%20level-stable-brightgreen.svg?style=flat)](https://cloud.google.com/terms/launch-stages) [![npm version](https://img.shields.io/npm/v/@google-cloud/security-center.svg)](https://www.npmjs.org/package/@google-cloud/security-center) -[![codecov](https://img.shields.io/codecov/c/github/googleapis/nodejs-security-center/main.svg?style=flat)](https://codecov.io/gh/googleapis/nodejs-security-center) From 6a16590dddfdd2607502c01c27cac1398d2df11c Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Tue, 11 Jan 2022 17:08:18 +0000 Subject: [PATCH 295/342] test(nodejs): remove 15 add 16 (#1322) (#450) --- packages/google-cloud-securitycenter/protos/protos.d.ts | 2 +- packages/google-cloud-securitycenter/protos/protos.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-securitycenter/protos/protos.d.ts b/packages/google-cloud-securitycenter/protos/protos.d.ts index 6e546de8175..502521d72da 100644 --- a/packages/google-cloud-securitycenter/protos/protos.d.ts +++ b/packages/google-cloud-securitycenter/protos/protos.d.ts @@ -1,4 +1,4 @@ -// Copyright 2021 Google LLC +// 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. diff --git a/packages/google-cloud-securitycenter/protos/protos.js b/packages/google-cloud-securitycenter/protos/protos.js index bfaedfd5674..5080cfc2286 100644 --- a/packages/google-cloud-securitycenter/protos/protos.js +++ b/packages/google-cloud-securitycenter/protos/protos.js @@ -1,4 +1,4 @@ -// Copyright 2021 Google LLC +// 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. From 3833d8ac56aeb6e6c8be40b20dd58b12865c46d2 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Wed, 19 Jan 2022 12:40:02 -0800 Subject: [PATCH 296/342] build: update copyright year to 2022 (#452) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(deps): upgrade gapic-generator-java to 2.4.1 PiperOrigin-RevId: 422607515 Source-Link: https://github.com/googleapis/googleapis/commit/ba2ffd6fe6642e28b4fed2ffae217b4c5f084034 Source-Link: https://github.com/googleapis/googleapis-gen/commit/73ba4add239a619da567ffbd4e5730fdd6de04d3 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNzNiYTRhZGQyMzlhNjE5ZGE1NjdmZmJkNGU1NzMwZmRkNmRlMDRkMyJ9 * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot --- packages/google-cloud-securitycenter/.jsdoc.js | 4 ++-- .../generated/v1/security_center.bulk_mute_findings.js | 1 + .../generated/v1/security_center.create_finding.js | 1 + .../generated/v1/security_center.create_mute_config.js | 1 + .../v1/security_center.create_notification_config.js | 5 ++--- .../generated/v1/security_center.create_source.js | 1 + .../generated/v1/security_center.delete_mute_config.js | 1 + .../v1/security_center.delete_notification_config.js | 5 ++--- .../generated/v1/security_center.get_iam_policy.js | 1 + .../generated/v1/security_center.get_mute_config.js | 1 + .../v1/security_center.get_notification_config.js | 1 + .../v1/security_center.get_organization_settings.js | 5 ++--- .../samples/generated/v1/security_center.get_source.js | 1 + .../generated/v1/security_center.group_assets.js | 3 ++- .../generated/v1/security_center.group_findings.js | 3 ++- .../generated/v1/security_center.list_assets.js | 3 ++- .../generated/v1/security_center.list_findings.js | 3 ++- .../generated/v1/security_center.list_mute_configs.js | 3 ++- .../v1/security_center.list_notification_configs.js | 7 +++---- .../generated/v1/security_center.list_sources.js | 3 ++- .../v1/security_center.run_asset_discovery.js | 1 + .../generated/v1/security_center.set_finding_state.js | 1 + .../generated/v1/security_center.set_iam_policy.js | 1 + .../samples/generated/v1/security_center.set_mute.js | 1 + .../v1/security_center.test_iam_permissions.js | 1 + .../v1/security_center.update_external_system.js | 1 + .../generated/v1/security_center.update_finding.js | 1 + .../generated/v1/security_center.update_mute_config.js | 1 + .../v1/security_center.update_notification_config.js | 5 ++--- .../v1/security_center.update_organization_settings.js | 5 ++--- .../v1/security_center.update_security_marks.js | 1 + .../generated/v1/security_center.update_source.js | 1 + .../v1beta1/security_center.create_finding.js | 4 ++-- .../generated/v1beta1/security_center.create_source.js | 4 ++-- .../v1beta1/security_center.get_iam_policy.js | 4 ++-- .../security_center.get_organization_settings.js | 8 +++----- .../generated/v1beta1/security_center.get_source.js | 4 ++-- .../generated/v1beta1/security_center.group_assets.js | 6 +++--- .../v1beta1/security_center.group_findings.js | 6 +++--- .../generated/v1beta1/security_center.list_assets.js | 6 +++--- .../generated/v1beta1/security_center.list_findings.js | 6 +++--- .../generated/v1beta1/security_center.list_sources.js | 6 +++--- .../v1beta1/security_center.run_asset_discovery.js | 4 ++-- .../v1beta1/security_center.set_finding_state.js | 4 ++-- .../v1beta1/security_center.set_iam_policy.js | 4 ++-- .../v1beta1/security_center.test_iam_permissions.js | 4 ++-- .../v1beta1/security_center.update_finding.js | 4 ++-- .../security_center.update_organization_settings.js | 8 +++----- .../v1beta1/security_center.update_security_marks.js | 4 ++-- .../generated/v1beta1/security_center.update_source.js | 4 ++-- .../v1p1beta1/security_center.create_finding.js | 4 ++-- .../security_center.create_notification_config.js | 8 +++----- .../v1p1beta1/security_center.create_source.js | 4 ++-- .../security_center.delete_notification_config.js | 8 +++----- .../v1p1beta1/security_center.get_iam_policy.js | 4 ++-- .../security_center.get_notification_config.js | 4 ++-- .../security_center.get_organization_settings.js | 8 +++----- .../generated/v1p1beta1/security_center.get_source.js | 4 ++-- .../v1p1beta1/security_center.group_assets.js | 6 +++--- .../v1p1beta1/security_center.group_findings.js | 6 +++--- .../generated/v1p1beta1/security_center.list_assets.js | 6 +++--- .../v1p1beta1/security_center.list_findings.js | 6 +++--- .../security_center.list_notification_configs.js | 10 ++++------ .../v1p1beta1/security_center.list_sources.js | 6 +++--- .../v1p1beta1/security_center.run_asset_discovery.js | 4 ++-- .../v1p1beta1/security_center.set_finding_state.js | 4 ++-- .../v1p1beta1/security_center.set_iam_policy.js | 4 ++-- .../v1p1beta1/security_center.test_iam_permissions.js | 4 ++-- .../v1p1beta1/security_center.update_finding.js | 4 ++-- .../security_center.update_notification_config.js | 8 +++----- .../security_center.update_organization_settings.js | 8 +++----- .../v1p1beta1/security_center.update_security_marks.js | 4 ++-- .../v1p1beta1/security_center.update_source.js | 4 ++-- packages/google-cloud-securitycenter/src/v1/index.ts | 2 +- .../src/v1/security_center_client.ts | 2 +- .../google-cloud-securitycenter/src/v1beta1/index.ts | 2 +- .../src/v1beta1/security_center_client.ts | 2 +- .../google-cloud-securitycenter/src/v1p1beta1/index.ts | 2 +- .../src/v1p1beta1/security_center_client.ts | 2 +- .../system-test/fixtures/sample/src/index.js | 2 +- .../system-test/fixtures/sample/src/index.ts | 2 +- .../google-cloud-securitycenter/system-test/install.ts | 2 +- .../test/gapic_security_center_v1.ts | 2 +- .../test/gapic_security_center_v1beta1.ts | 2 +- .../test/gapic_security_center_v1p1beta1.ts | 2 +- 85 files changed, 159 insertions(+), 156 deletions(-) diff --git a/packages/google-cloud-securitycenter/.jsdoc.js b/packages/google-cloud-securitycenter/.jsdoc.js index e201160b63a..3f4fcde553b 100644 --- a/packages/google-cloud-securitycenter/.jsdoc.js +++ b/packages/google-cloud-securitycenter/.jsdoc.js @@ -1,4 +1,4 @@ -// Copyright 2021 Google LLC +// 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. @@ -40,7 +40,7 @@ module.exports = { includePattern: '\\.js$' }, templates: { - copyright: 'Copyright 2021 Google LLC', + copyright: 'Copyright 2022 Google LLC', includeDate: false, sourceFiles: false, systemName: '@google-cloud/security-center', diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.bulk_mute_findings.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.bulk_mute_findings.js index e54076f7156..63f99ecf617 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.bulk_mute_findings.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.bulk_mute_findings.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(parent) { diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.create_finding.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.create_finding.js index c64eec76825..746920f6a21 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.create_finding.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.create_finding.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(parent, findingId, finding) { diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.create_mute_config.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.create_mute_config.js index b92956f5f8c..49dea76262c 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.create_mute_config.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.create_mute_config.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(parent, muteConfig, muteConfigId) { diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.create_notification_config.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.create_notification_config.js index 612baaa49fb..6394278de3d 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.create_notification_config.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.create_notification_config.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(parent, configId, notificationConfig) { @@ -52,9 +53,7 @@ function main(parent, configId, notificationConfig) { }; // Run request - const response = await securitycenterClient.createNotificationConfig( - request - ); + const response = await securitycenterClient.createNotificationConfig(request); console.log(response); } diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.create_source.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.create_source.js index 2bbe843ca2f..a0465fd2aa9 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.create_source.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.create_source.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(parent, source) { diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.delete_mute_config.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.delete_mute_config.js index e04240aaf24..8162ee3d9fd 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.delete_mute_config.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.delete_mute_config.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(name) { diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.delete_notification_config.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.delete_notification_config.js index 5bbaf9c02f3..12b4f019fe4 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.delete_notification_config.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.delete_notification_config.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(name) { @@ -38,9 +39,7 @@ function main(name) { }; // Run request - const response = await securitycenterClient.deleteNotificationConfig( - request - ); + const response = await securitycenterClient.deleteNotificationConfig(request); console.log(response); } diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_iam_policy.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_iam_policy.js index 0e6d1234a86..e8452cca35a 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_iam_policy.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_iam_policy.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(resource) { diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_mute_config.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_mute_config.js index d012524c2cc..53edaecbbe5 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_mute_config.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_mute_config.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(name) { diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_notification_config.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_notification_config.js index 4544fa504b2..d0eb23ca57b 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_notification_config.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_notification_config.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(name) { diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_organization_settings.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_organization_settings.js index 4a550f68eac..f408324f61c 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_organization_settings.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_organization_settings.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(name) { @@ -38,9 +39,7 @@ function main(name) { }; // Run request - const response = await securitycenterClient.getOrganizationSettings( - request - ); + const response = await securitycenterClient.getOrganizationSettings(request); console.log(response); } diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_source.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_source.js index e2e382a368f..fa5796e643e 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_source.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_source.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(name) { diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.group_assets.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.group_assets.js index f6d95ca456f..2b70cea81ac 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.group_assets.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.group_assets.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(parent, groupBy) { @@ -152,7 +153,7 @@ function main(parent, groupBy) { // Run request const iterable = await securitycenterClient.groupAssetsAsync(request); for await (const response of iterable) { - console.log(response); + console.log(response); } } diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.group_findings.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.group_findings.js index d24db360069..faf3c30ba4a 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.group_findings.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.group_findings.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(parent, groupBy) { @@ -156,7 +157,7 @@ function main(parent, groupBy) { // Run request const iterable = await securitycenterClient.groupFindingsAsync(request); for await (const response of iterable) { - console.log(response); + console.log(response); } } diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_assets.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_assets.js index 1188c615a43..9ebf2a98058 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_assets.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_assets.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(parent) { @@ -161,7 +162,7 @@ function main(parent) { // Run request const iterable = await securitycenterClient.listAssetsAsync(request); for await (const response of iterable) { - console.log(response); + console.log(response); } } diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_findings.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_findings.js index d3be6817ebe..bf2a9563753 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_findings.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_findings.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(parent) { @@ -167,7 +168,7 @@ function main(parent) { // Run request const iterable = await securitycenterClient.listFindingsAsync(request); for await (const response of iterable) { - console.log(response); + console.log(response); } } diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_mute_configs.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_mute_configs.js index 60cc9d97cc7..ade6360bc28 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_mute_configs.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_mute_configs.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(parent) { @@ -55,7 +56,7 @@ function main(parent) { // Run request const iterable = await securitycenterClient.listMuteConfigsAsync(request); for await (const response of iterable) { - console.log(response); + console.log(response); } } diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_notification_configs.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_notification_configs.js index d9571e5837a..11aeada8ee1 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_notification_configs.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_notification_configs.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(parent) { @@ -49,11 +50,9 @@ function main(parent) { }; // Run request - const iterable = await securitycenterClient.listNotificationConfigsAsync( - request - ); + const iterable = await securitycenterClient.listNotificationConfigsAsync(request); for await (const response of iterable) { - console.log(response); + console.log(response); } } diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_sources.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_sources.js index 9272f1611fa..7fc4f557618 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_sources.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_sources.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(parent) { @@ -52,7 +53,7 @@ function main(parent) { // Run request const iterable = await securitycenterClient.listSourcesAsync(request); for await (const response of iterable) { - console.log(response); + console.log(response); } } diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.run_asset_discovery.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.run_asset_discovery.js index feaeabe06cc..4c1728e433d 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.run_asset_discovery.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.run_asset_discovery.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(parent) { diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.set_finding_state.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.set_finding_state.js index 955a874dcbd..676cf8a55a1 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.set_finding_state.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.set_finding_state.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(name, state, startTime) { diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.set_iam_policy.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.set_iam_policy.js index dea5d2c0ec9..91cd2d88cf4 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.set_iam_policy.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.set_iam_policy.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(resource, policy) { diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.set_mute.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.set_mute.js index 16c225bc894..3ad33235b6b 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.set_mute.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.set_mute.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(name, mute) { diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.test_iam_permissions.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.test_iam_permissions.js index 3a1c7cb6113..b50171550ad 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.test_iam_permissions.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.test_iam_permissions.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(resource, permissions) { diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_external_system.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_external_system.js index d29496da90c..801548bfa25 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_external_system.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_external_system.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(externalSystem) { diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_finding.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_finding.js index dbfab63db35..271872a49a1 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_finding.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_finding.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(finding) { diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_mute_config.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_mute_config.js index 6744511b834..c261c605fbf 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_mute_config.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_mute_config.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(muteConfig) { diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_notification_config.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_notification_config.js index 8bb3c86fad6..74af35bca99 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_notification_config.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_notification_config.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(notificationConfig) { @@ -42,9 +43,7 @@ function main(notificationConfig) { }; // Run request - const response = await securitycenterClient.updateNotificationConfig( - request - ); + const response = await securitycenterClient.updateNotificationConfig(request); console.log(response); } diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_organization_settings.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_organization_settings.js index 35b0e5c3db4..ff5fc3c976d 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_organization_settings.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_organization_settings.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(organizationSettings) { @@ -42,9 +43,7 @@ function main(organizationSettings) { }; // Run request - const response = await securitycenterClient.updateOrganizationSettings( - request - ); + const response = await securitycenterClient.updateOrganizationSettings(request); console.log(response); } diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_security_marks.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_security_marks.js index 12110134203..14137cb7037 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_security_marks.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_security_marks.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(securityMarks) { diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_source.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_source.js index d423bcf8982..e99ad6fe83a 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_source.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_source.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(source) { diff --git a/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.create_finding.js b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.create_finding.js index aea73fabb00..90289ca8bcb 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.create_finding.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.create_finding.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(parent, findingId, finding) { @@ -37,8 +38,7 @@ function main(parent, findingId, finding) { // const finding = {} // Imports the Securitycenter library - const {SecurityCenterClient} = - require('@google-cloud/security-center').v1beta1; + const {SecurityCenterClient} = require('@google-cloud/security-center').v1beta1; // Instantiates a client const securitycenterClient = new SecurityCenterClient(); diff --git a/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.create_source.js b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.create_source.js index f7b07c22d73..9342a0f90a3 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.create_source.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.create_source.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(parent, source) { @@ -31,8 +32,7 @@ function main(parent, source) { // const source = {} // Imports the Securitycenter library - const {SecurityCenterClient} = - require('@google-cloud/security-center').v1beta1; + const {SecurityCenterClient} = require('@google-cloud/security-center').v1beta1; // Instantiates a client const securitycenterClient = new SecurityCenterClient(); diff --git a/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.get_iam_policy.js b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.get_iam_policy.js index 305040346ae..9bdfa2c4d88 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.get_iam_policy.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.get_iam_policy.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(resource) { @@ -31,8 +32,7 @@ function main(resource) { // const options = {} // Imports the Securitycenter library - const {SecurityCenterClient} = - require('@google-cloud/security-center').v1beta1; + const {SecurityCenterClient} = require('@google-cloud/security-center').v1beta1; // Instantiates a client const securitycenterClient = new SecurityCenterClient(); diff --git a/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.get_organization_settings.js b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.get_organization_settings.js index 88237d5e26f..7862db8da2c 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.get_organization_settings.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.get_organization_settings.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(name) { @@ -26,8 +27,7 @@ function main(name) { // const name = 'abc123' // Imports the Securitycenter library - const {SecurityCenterClient} = - require('@google-cloud/security-center').v1beta1; + const {SecurityCenterClient} = require('@google-cloud/security-center').v1beta1; // Instantiates a client const securitycenterClient = new SecurityCenterClient(); @@ -39,9 +39,7 @@ function main(name) { }; // Run request - const response = await securitycenterClient.getOrganizationSettings( - request - ); + const response = await securitycenterClient.getOrganizationSettings(request); console.log(response); } diff --git a/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.get_source.js b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.get_source.js index 7abbda7749b..47f895c35db 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.get_source.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.get_source.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(name) { @@ -26,8 +27,7 @@ function main(name) { // const name = 'abc123' // Imports the Securitycenter library - const {SecurityCenterClient} = - require('@google-cloud/security-center').v1beta1; + const {SecurityCenterClient} = require('@google-cloud/security-center').v1beta1; // Instantiates a client const securitycenterClient = new SecurityCenterClient(); diff --git a/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.group_assets.js b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.group_assets.js index 73615251fa5..59edb045f29 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.group_assets.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.group_assets.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(parent, groupBy) { @@ -100,8 +101,7 @@ function main(parent, groupBy) { // const pageSize = 1234 // Imports the Securitycenter library - const {SecurityCenterClient} = - require('@google-cloud/security-center').v1beta1; + const {SecurityCenterClient} = require('@google-cloud/security-center').v1beta1; // Instantiates a client const securitycenterClient = new SecurityCenterClient(); @@ -116,7 +116,7 @@ function main(parent, groupBy) { // Run request const iterable = await securitycenterClient.groupAssetsAsync(request); for await (const response of iterable) { - console.log(response); + console.log(response); } } diff --git a/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.group_findings.js b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.group_findings.js index c9b37d15775..4818c6cdd04 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.group_findings.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.group_findings.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(parent, groupBy) { @@ -79,8 +80,7 @@ function main(parent, groupBy) { // const pageSize = 1234 // Imports the Securitycenter library - const {SecurityCenterClient} = - require('@google-cloud/security-center').v1beta1; + const {SecurityCenterClient} = require('@google-cloud/security-center').v1beta1; // Instantiates a client const securitycenterClient = new SecurityCenterClient(); @@ -95,7 +95,7 @@ function main(parent, groupBy) { // Run request const iterable = await securitycenterClient.groupFindingsAsync(request); for await (const response of iterable) { - console.log(response); + console.log(response); } } diff --git a/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.list_assets.js b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.list_assets.js index 320d42dd317..dcfd98b974f 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.list_assets.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.list_assets.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(parent) { @@ -106,8 +107,7 @@ function main(parent) { // const pageSize = 1234 // Imports the Securitycenter library - const {SecurityCenterClient} = - require('@google-cloud/security-center').v1beta1; + const {SecurityCenterClient} = require('@google-cloud/security-center').v1beta1; // Instantiates a client const securitycenterClient = new SecurityCenterClient(); @@ -121,7 +121,7 @@ function main(parent) { // Run request const iterable = await securitycenterClient.listAssetsAsync(request); for await (const response of iterable) { - console.log(response); + console.log(response); } } diff --git a/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.list_findings.js b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.list_findings.js index 931016744ae..b12126935be 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.list_findings.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.list_findings.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(parent) { @@ -83,8 +84,7 @@ function main(parent) { // const pageSize = 1234 // Imports the Securitycenter library - const {SecurityCenterClient} = - require('@google-cloud/security-center').v1beta1; + const {SecurityCenterClient} = require('@google-cloud/security-center').v1beta1; // Instantiates a client const securitycenterClient = new SecurityCenterClient(); @@ -98,7 +98,7 @@ function main(parent) { // Run request const iterable = await securitycenterClient.listFindingsAsync(request); for await (const response of iterable) { - console.log(response); + console.log(response); } } diff --git a/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.list_sources.js b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.list_sources.js index b052183ca48..e3722e67d12 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.list_sources.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.list_sources.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(parent) { @@ -37,8 +38,7 @@ function main(parent) { // const pageSize = 1234 // Imports the Securitycenter library - const {SecurityCenterClient} = - require('@google-cloud/security-center').v1beta1; + const {SecurityCenterClient} = require('@google-cloud/security-center').v1beta1; // Instantiates a client const securitycenterClient = new SecurityCenterClient(); @@ -52,7 +52,7 @@ function main(parent) { // Run request const iterable = await securitycenterClient.listSourcesAsync(request); for await (const response of iterable) { - console.log(response); + console.log(response); } } diff --git a/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.run_asset_discovery.js b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.run_asset_discovery.js index 9302c302058..beed664c4ac 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.run_asset_discovery.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.run_asset_discovery.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(parent) { @@ -26,8 +27,7 @@ function main(parent) { // const parent = 'abc123' // Imports the Securitycenter library - const {SecurityCenterClient} = - require('@google-cloud/security-center').v1beta1; + const {SecurityCenterClient} = require('@google-cloud/security-center').v1beta1; // Instantiates a client const securitycenterClient = new SecurityCenterClient(); diff --git a/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.set_finding_state.js b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.set_finding_state.js index 1c84b5c032a..db0cea43399 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.set_finding_state.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.set_finding_state.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(name, state, startTime) { @@ -36,8 +37,7 @@ function main(name, state, startTime) { // const startTime = {} // Imports the Securitycenter library - const {SecurityCenterClient} = - require('@google-cloud/security-center').v1beta1; + const {SecurityCenterClient} = require('@google-cloud/security-center').v1beta1; // Instantiates a client const securitycenterClient = new SecurityCenterClient(); diff --git a/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.set_iam_policy.js b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.set_iam_policy.js index e92642a3f6f..458ee483659 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.set_iam_policy.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.set_iam_policy.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(resource, policy) { @@ -33,8 +34,7 @@ function main(resource, policy) { // const policy = {} // Imports the Securitycenter library - const {SecurityCenterClient} = - require('@google-cloud/security-center').v1beta1; + const {SecurityCenterClient} = require('@google-cloud/security-center').v1beta1; // Instantiates a client const securitycenterClient = new SecurityCenterClient(); diff --git a/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.test_iam_permissions.js b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.test_iam_permissions.js index 664ee9453f8..fbb5ee1fb03 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.test_iam_permissions.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.test_iam_permissions.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(resource, permissions) { @@ -33,8 +34,7 @@ function main(resource, permissions) { // const permissions = 'abc123' // Imports the Securitycenter library - const {SecurityCenterClient} = - require('@google-cloud/security-center').v1beta1; + const {SecurityCenterClient} = require('@google-cloud/security-center').v1beta1; // Instantiates a client const securitycenterClient = new SecurityCenterClient(); diff --git a/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.update_finding.js b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.update_finding.js index 7812a166637..5f0e87ad894 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.update_finding.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.update_finding.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(finding) { @@ -34,8 +35,7 @@ function main(finding) { // const updateMask = {} // Imports the Securitycenter library - const {SecurityCenterClient} = - require('@google-cloud/security-center').v1beta1; + const {SecurityCenterClient} = require('@google-cloud/security-center').v1beta1; // Instantiates a client const securitycenterClient = new SecurityCenterClient(); diff --git a/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.update_organization_settings.js b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.update_organization_settings.js index 44770f1c87c..6519c22242c 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.update_organization_settings.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.update_organization_settings.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(organizationSettings) { @@ -29,8 +30,7 @@ function main(organizationSettings) { // const updateMask = {} // Imports the Securitycenter library - const {SecurityCenterClient} = - require('@google-cloud/security-center').v1beta1; + const {SecurityCenterClient} = require('@google-cloud/security-center').v1beta1; // Instantiates a client const securitycenterClient = new SecurityCenterClient(); @@ -42,9 +42,7 @@ function main(organizationSettings) { }; // Run request - const response = await securitycenterClient.updateOrganizationSettings( - request - ); + const response = await securitycenterClient.updateOrganizationSettings(request); console.log(response); } diff --git a/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.update_security_marks.js b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.update_security_marks.js index a3f4b418722..366bfa38762 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.update_security_marks.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.update_security_marks.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(securityMarks) { @@ -33,8 +34,7 @@ function main(securityMarks) { // const startTime = {} // Imports the Securitycenter library - const {SecurityCenterClient} = - require('@google-cloud/security-center').v1beta1; + const {SecurityCenterClient} = require('@google-cloud/security-center').v1beta1; // Instantiates a client const securitycenterClient = new SecurityCenterClient(); diff --git a/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.update_source.js b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.update_source.js index 0e504cbd6e5..cba6870c848 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.update_source.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.update_source.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(source) { @@ -29,8 +30,7 @@ function main(source) { // const updateMask = {} // Imports the Securitycenter library - const {SecurityCenterClient} = - require('@google-cloud/security-center').v1beta1; + const {SecurityCenterClient} = require('@google-cloud/security-center').v1beta1; // Instantiates a client const securitycenterClient = new SecurityCenterClient(); diff --git a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.create_finding.js b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.create_finding.js index 1a960ce8d43..9eb96389119 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.create_finding.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.create_finding.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(parent, findingId, finding) { @@ -35,8 +36,7 @@ function main(parent, findingId, finding) { // const finding = {} // Imports the Securitycenter library - const {SecurityCenterClient} = - require('@google-cloud/security-center').v1p1beta1; + const {SecurityCenterClient} = require('@google-cloud/security-center').v1p1beta1; // Instantiates a client const securitycenterClient = new SecurityCenterClient(); diff --git a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.create_notification_config.js b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.create_notification_config.js index a342c85ec5f..290b2f86582 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.create_notification_config.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.create_notification_config.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(parent, configId, notificationConfig) { @@ -37,8 +38,7 @@ function main(parent, configId, notificationConfig) { // const notificationConfig = {} // Imports the Securitycenter library - const {SecurityCenterClient} = - require('@google-cloud/security-center').v1p1beta1; + const {SecurityCenterClient} = require('@google-cloud/security-center').v1p1beta1; // Instantiates a client const securitycenterClient = new SecurityCenterClient(); @@ -52,9 +52,7 @@ function main(parent, configId, notificationConfig) { }; // Run request - const response = await securitycenterClient.createNotificationConfig( - request - ); + const response = await securitycenterClient.createNotificationConfig(request); console.log(response); } diff --git a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.create_source.js b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.create_source.js index 534feddf3f5..fba03b1b967 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.create_source.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.create_source.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(parent, source) { @@ -31,8 +32,7 @@ function main(parent, source) { // const source = {} // Imports the Securitycenter library - const {SecurityCenterClient} = - require('@google-cloud/security-center').v1p1beta1; + const {SecurityCenterClient} = require('@google-cloud/security-center').v1p1beta1; // Instantiates a client const securitycenterClient = new SecurityCenterClient(); diff --git a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.delete_notification_config.js b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.delete_notification_config.js index 13eff5164c0..77462b2f423 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.delete_notification_config.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.delete_notification_config.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(name) { @@ -26,8 +27,7 @@ function main(name) { // const name = 'abc123' // Imports the Securitycenter library - const {SecurityCenterClient} = - require('@google-cloud/security-center').v1p1beta1; + const {SecurityCenterClient} = require('@google-cloud/security-center').v1p1beta1; // Instantiates a client const securitycenterClient = new SecurityCenterClient(); @@ -39,9 +39,7 @@ function main(name) { }; // Run request - const response = await securitycenterClient.deleteNotificationConfig( - request - ); + const response = await securitycenterClient.deleteNotificationConfig(request); console.log(response); } diff --git a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.get_iam_policy.js b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.get_iam_policy.js index 9e4f355c197..90c348abfba 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.get_iam_policy.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.get_iam_policy.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(resource) { @@ -31,8 +32,7 @@ function main(resource) { // const options = {} // Imports the Securitycenter library - const {SecurityCenterClient} = - require('@google-cloud/security-center').v1p1beta1; + const {SecurityCenterClient} = require('@google-cloud/security-center').v1p1beta1; // Instantiates a client const securitycenterClient = new SecurityCenterClient(); diff --git a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.get_notification_config.js b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.get_notification_config.js index edf969f14c5..120dba67f6e 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.get_notification_config.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.get_notification_config.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(name) { @@ -26,8 +27,7 @@ function main(name) { // const name = 'abc123' // Imports the Securitycenter library - const {SecurityCenterClient} = - require('@google-cloud/security-center').v1p1beta1; + const {SecurityCenterClient} = require('@google-cloud/security-center').v1p1beta1; // Instantiates a client const securitycenterClient = new SecurityCenterClient(); diff --git a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.get_organization_settings.js b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.get_organization_settings.js index e7e18a20eee..d09f46d413a 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.get_organization_settings.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.get_organization_settings.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(name) { @@ -26,8 +27,7 @@ function main(name) { // const name = 'abc123' // Imports the Securitycenter library - const {SecurityCenterClient} = - require('@google-cloud/security-center').v1p1beta1; + const {SecurityCenterClient} = require('@google-cloud/security-center').v1p1beta1; // Instantiates a client const securitycenterClient = new SecurityCenterClient(); @@ -39,9 +39,7 @@ function main(name) { }; // Run request - const response = await securitycenterClient.getOrganizationSettings( - request - ); + const response = await securitycenterClient.getOrganizationSettings(request); console.log(response); } diff --git a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.get_source.js b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.get_source.js index 5257a4398ad..968bb024297 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.get_source.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.get_source.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(name) { @@ -26,8 +27,7 @@ function main(name) { // const name = 'abc123' // Imports the Securitycenter library - const {SecurityCenterClient} = - require('@google-cloud/security-center').v1p1beta1; + const {SecurityCenterClient} = require('@google-cloud/security-center').v1p1beta1; // Instantiates a client const securitycenterClient = new SecurityCenterClient(); diff --git a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.group_assets.js b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.group_assets.js index 410a1b631df..2615ed829d4 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.group_assets.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.group_assets.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(parent, groupBy) { @@ -137,8 +138,7 @@ function main(parent, groupBy) { // const pageSize = 1234 // Imports the Securitycenter library - const {SecurityCenterClient} = - require('@google-cloud/security-center').v1p1beta1; + const {SecurityCenterClient} = require('@google-cloud/security-center').v1p1beta1; // Instantiates a client const securitycenterClient = new SecurityCenterClient(); @@ -153,7 +153,7 @@ function main(parent, groupBy) { // Run request const iterable = await securitycenterClient.groupAssetsAsync(request); for await (const response of iterable) { - console.log(response); + console.log(response); } } diff --git a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.group_findings.js b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.group_findings.js index 194d4f55583..87f7ec5a72c 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.group_findings.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.group_findings.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(parent, groupBy) { @@ -133,8 +134,7 @@ function main(parent, groupBy) { // const pageSize = 1234 // Imports the Securitycenter library - const {SecurityCenterClient} = - require('@google-cloud/security-center').v1p1beta1; + const {SecurityCenterClient} = require('@google-cloud/security-center').v1p1beta1; // Instantiates a client const securitycenterClient = new SecurityCenterClient(); @@ -149,7 +149,7 @@ function main(parent, groupBy) { // Run request const iterable = await securitycenterClient.groupFindingsAsync(request); for await (const response of iterable) { - console.log(response); + console.log(response); } } diff --git a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.list_assets.js b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.list_assets.js index f9408f37483..edb3f4aeeb2 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.list_assets.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.list_assets.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(parent) { @@ -147,8 +148,7 @@ function main(parent) { // const pageSize = 1234 // Imports the Securitycenter library - const {SecurityCenterClient} = - require('@google-cloud/security-center').v1p1beta1; + const {SecurityCenterClient} = require('@google-cloud/security-center').v1p1beta1; // Instantiates a client const securitycenterClient = new SecurityCenterClient(); @@ -162,7 +162,7 @@ function main(parent) { // Run request const iterable = await securitycenterClient.listAssetsAsync(request); for await (const response of iterable) { - console.log(response); + console.log(response); } } diff --git a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.list_findings.js b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.list_findings.js index 76bc3ae0e6f..58d5fd5fa6b 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.list_findings.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.list_findings.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(parent) { @@ -143,8 +144,7 @@ function main(parent) { // const pageSize = 1234 // Imports the Securitycenter library - const {SecurityCenterClient} = - require('@google-cloud/security-center').v1p1beta1; + const {SecurityCenterClient} = require('@google-cloud/security-center').v1p1beta1; // Instantiates a client const securitycenterClient = new SecurityCenterClient(); @@ -158,7 +158,7 @@ function main(parent) { // Run request const iterable = await securitycenterClient.listFindingsAsync(request); for await (const response of iterable) { - console.log(response); + console.log(response); } } diff --git a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.list_notification_configs.js b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.list_notification_configs.js index 780c2f9eb86..d00b3a8f2fa 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.list_notification_configs.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.list_notification_configs.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(parent) { @@ -37,8 +38,7 @@ function main(parent) { // const pageSize = 1234 // Imports the Securitycenter library - const {SecurityCenterClient} = - require('@google-cloud/security-center').v1p1beta1; + const {SecurityCenterClient} = require('@google-cloud/security-center').v1p1beta1; // Instantiates a client const securitycenterClient = new SecurityCenterClient(); @@ -50,11 +50,9 @@ function main(parent) { }; // Run request - const iterable = await securitycenterClient.listNotificationConfigsAsync( - request - ); + const iterable = await securitycenterClient.listNotificationConfigsAsync(request); for await (const response of iterable) { - console.log(response); + console.log(response); } } diff --git a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.list_sources.js b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.list_sources.js index f22aa25ce9e..d3e5613c583 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.list_sources.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.list_sources.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(parent) { @@ -38,8 +39,7 @@ function main(parent) { // const pageSize = 1234 // Imports the Securitycenter library - const {SecurityCenterClient} = - require('@google-cloud/security-center').v1p1beta1; + const {SecurityCenterClient} = require('@google-cloud/security-center').v1p1beta1; // Instantiates a client const securitycenterClient = new SecurityCenterClient(); @@ -53,7 +53,7 @@ function main(parent) { // Run request const iterable = await securitycenterClient.listSourcesAsync(request); for await (const response of iterable) { - console.log(response); + console.log(response); } } diff --git a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.run_asset_discovery.js b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.run_asset_discovery.js index 522197b4ad3..0563f1605aa 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.run_asset_discovery.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.run_asset_discovery.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(parent) { @@ -26,8 +27,7 @@ function main(parent) { // const parent = 'abc123' // Imports the Securitycenter library - const {SecurityCenterClient} = - require('@google-cloud/security-center').v1p1beta1; + const {SecurityCenterClient} = require('@google-cloud/security-center').v1p1beta1; // Instantiates a client const securitycenterClient = new SecurityCenterClient(); diff --git a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.set_finding_state.js b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.set_finding_state.js index a7a1f50731e..99d97f276cd 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.set_finding_state.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.set_finding_state.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(name, state, startTime) { @@ -36,8 +37,7 @@ function main(name, state, startTime) { // const startTime = {} // Imports the Securitycenter library - const {SecurityCenterClient} = - require('@google-cloud/security-center').v1p1beta1; + const {SecurityCenterClient} = require('@google-cloud/security-center').v1p1beta1; // Instantiates a client const securitycenterClient = new SecurityCenterClient(); diff --git a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.set_iam_policy.js b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.set_iam_policy.js index 4ae13419b85..8fdb23eb12b 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.set_iam_policy.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.set_iam_policy.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(resource, policy) { @@ -33,8 +34,7 @@ function main(resource, policy) { // const policy = {} // Imports the Securitycenter library - const {SecurityCenterClient} = - require('@google-cloud/security-center').v1p1beta1; + const {SecurityCenterClient} = require('@google-cloud/security-center').v1p1beta1; // Instantiates a client const securitycenterClient = new SecurityCenterClient(); diff --git a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.test_iam_permissions.js b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.test_iam_permissions.js index e7eec2c3a5f..e69d5cafa91 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.test_iam_permissions.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.test_iam_permissions.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(resource, permissions) { @@ -33,8 +34,7 @@ function main(resource, permissions) { // const permissions = 'abc123' // Imports the Securitycenter library - const {SecurityCenterClient} = - require('@google-cloud/security-center').v1p1beta1; + const {SecurityCenterClient} = require('@google-cloud/security-center').v1p1beta1; // Instantiates a client const securitycenterClient = new SecurityCenterClient(); diff --git a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.update_finding.js b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.update_finding.js index f8e002ac4c7..9dcc69b5087 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.update_finding.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.update_finding.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(finding) { @@ -38,8 +39,7 @@ function main(finding) { // const updateMask = {} // Imports the Securitycenter library - const {SecurityCenterClient} = - require('@google-cloud/security-center').v1p1beta1; + const {SecurityCenterClient} = require('@google-cloud/security-center').v1p1beta1; // Instantiates a client const securitycenterClient = new SecurityCenterClient(); diff --git a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.update_notification_config.js b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.update_notification_config.js index 9d353cb2b37..54718b4bc43 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.update_notification_config.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.update_notification_config.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(notificationConfig) { @@ -30,8 +31,7 @@ function main(notificationConfig) { // const updateMask = {} // Imports the Securitycenter library - const {SecurityCenterClient} = - require('@google-cloud/security-center').v1p1beta1; + const {SecurityCenterClient} = require('@google-cloud/security-center').v1p1beta1; // Instantiates a client const securitycenterClient = new SecurityCenterClient(); @@ -43,9 +43,7 @@ function main(notificationConfig) { }; // Run request - const response = await securitycenterClient.updateNotificationConfig( - request - ); + const response = await securitycenterClient.updateNotificationConfig(request); console.log(response); } diff --git a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.update_organization_settings.js b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.update_organization_settings.js index b9084384656..0786b122b7f 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.update_organization_settings.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.update_organization_settings.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(organizationSettings) { @@ -30,8 +31,7 @@ function main(organizationSettings) { // const updateMask = {} // Imports the Securitycenter library - const {SecurityCenterClient} = - require('@google-cloud/security-center').v1p1beta1; + const {SecurityCenterClient} = require('@google-cloud/security-center').v1p1beta1; // Instantiates a client const securitycenterClient = new SecurityCenterClient(); @@ -43,9 +43,7 @@ function main(organizationSettings) { }; // Run request - const response = await securitycenterClient.updateOrganizationSettings( - request - ); + const response = await securitycenterClient.updateOrganizationSettings(request); console.log(response); } diff --git a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.update_security_marks.js b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.update_security_marks.js index fcd80ab648a..33cfe18d01c 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.update_security_marks.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.update_security_marks.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(securityMarks) { @@ -38,8 +39,7 @@ function main(securityMarks) { // const startTime = {} // Imports the Securitycenter library - const {SecurityCenterClient} = - require('@google-cloud/security-center').v1p1beta1; + const {SecurityCenterClient} = require('@google-cloud/security-center').v1p1beta1; // Instantiates a client const securitycenterClient = new SecurityCenterClient(); diff --git a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.update_source.js b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.update_source.js index db9dc7ac477..9078baab911 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.update_source.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.update_source.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(source) { @@ -30,8 +31,7 @@ function main(source) { // const updateMask = {} // Imports the Securitycenter library - const {SecurityCenterClient} = - require('@google-cloud/security-center').v1p1beta1; + const {SecurityCenterClient} = require('@google-cloud/security-center').v1p1beta1; // Instantiates a client const securitycenterClient = new SecurityCenterClient(); diff --git a/packages/google-cloud-securitycenter/src/v1/index.ts b/packages/google-cloud-securitycenter/src/v1/index.ts index de26020df4d..d7817680667 100644 --- a/packages/google-cloud-securitycenter/src/v1/index.ts +++ b/packages/google-cloud-securitycenter/src/v1/index.ts @@ -1,4 +1,4 @@ -// Copyright 2021 Google LLC +// 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. diff --git a/packages/google-cloud-securitycenter/src/v1/security_center_client.ts b/packages/google-cloud-securitycenter/src/v1/security_center_client.ts index 4421cc793cc..d75210b9e85 100644 --- a/packages/google-cloud-securitycenter/src/v1/security_center_client.ts +++ b/packages/google-cloud-securitycenter/src/v1/security_center_client.ts @@ -1,4 +1,4 @@ -// Copyright 2021 Google LLC +// 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. diff --git a/packages/google-cloud-securitycenter/src/v1beta1/index.ts b/packages/google-cloud-securitycenter/src/v1beta1/index.ts index de26020df4d..d7817680667 100644 --- a/packages/google-cloud-securitycenter/src/v1beta1/index.ts +++ b/packages/google-cloud-securitycenter/src/v1beta1/index.ts @@ -1,4 +1,4 @@ -// Copyright 2021 Google LLC +// 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. diff --git a/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.ts b/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.ts index b10757d17fb..bde22bdb421 100644 --- a/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.ts +++ b/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.ts @@ -1,4 +1,4 @@ -// Copyright 2021 Google LLC +// 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. diff --git a/packages/google-cloud-securitycenter/src/v1p1beta1/index.ts b/packages/google-cloud-securitycenter/src/v1p1beta1/index.ts index de26020df4d..d7817680667 100644 --- a/packages/google-cloud-securitycenter/src/v1p1beta1/index.ts +++ b/packages/google-cloud-securitycenter/src/v1p1beta1/index.ts @@ -1,4 +1,4 @@ -// Copyright 2021 Google LLC +// 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. diff --git a/packages/google-cloud-securitycenter/src/v1p1beta1/security_center_client.ts b/packages/google-cloud-securitycenter/src/v1p1beta1/security_center_client.ts index a36a4d9bfea..06f5da83e8c 100644 --- a/packages/google-cloud-securitycenter/src/v1p1beta1/security_center_client.ts +++ b/packages/google-cloud-securitycenter/src/v1p1beta1/security_center_client.ts @@ -1,4 +1,4 @@ -// Copyright 2021 Google LLC +// 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. diff --git a/packages/google-cloud-securitycenter/system-test/fixtures/sample/src/index.js b/packages/google-cloud-securitycenter/system-test/fixtures/sample/src/index.js index 1f5fbbc71c5..2684cdee5e3 100644 --- a/packages/google-cloud-securitycenter/system-test/fixtures/sample/src/index.js +++ b/packages/google-cloud-securitycenter/system-test/fixtures/sample/src/index.js @@ -1,4 +1,4 @@ -// Copyright 2021 Google LLC +// 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. diff --git a/packages/google-cloud-securitycenter/system-test/fixtures/sample/src/index.ts b/packages/google-cloud-securitycenter/system-test/fixtures/sample/src/index.ts index b4153c943ab..1e7b0783212 100644 --- a/packages/google-cloud-securitycenter/system-test/fixtures/sample/src/index.ts +++ b/packages/google-cloud-securitycenter/system-test/fixtures/sample/src/index.ts @@ -1,4 +1,4 @@ -// Copyright 2021 Google LLC +// 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. diff --git a/packages/google-cloud-securitycenter/system-test/install.ts b/packages/google-cloud-securitycenter/system-test/install.ts index d2d61c0396f..6dd1eaadafa 100644 --- a/packages/google-cloud-securitycenter/system-test/install.ts +++ b/packages/google-cloud-securitycenter/system-test/install.ts @@ -1,4 +1,4 @@ -// Copyright 2021 Google LLC +// 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. diff --git a/packages/google-cloud-securitycenter/test/gapic_security_center_v1.ts b/packages/google-cloud-securitycenter/test/gapic_security_center_v1.ts index 6b011b3d7eb..e194308b8e4 100644 --- a/packages/google-cloud-securitycenter/test/gapic_security_center_v1.ts +++ b/packages/google-cloud-securitycenter/test/gapic_security_center_v1.ts @@ -1,4 +1,4 @@ -// Copyright 2021 Google LLC +// 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. diff --git a/packages/google-cloud-securitycenter/test/gapic_security_center_v1beta1.ts b/packages/google-cloud-securitycenter/test/gapic_security_center_v1beta1.ts index 58772026490..731bfab577a 100644 --- a/packages/google-cloud-securitycenter/test/gapic_security_center_v1beta1.ts +++ b/packages/google-cloud-securitycenter/test/gapic_security_center_v1beta1.ts @@ -1,4 +1,4 @@ -// Copyright 2021 Google LLC +// 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. diff --git a/packages/google-cloud-securitycenter/test/gapic_security_center_v1p1beta1.ts b/packages/google-cloud-securitycenter/test/gapic_security_center_v1p1beta1.ts index 2532c95eeaa..8997345277c 100644 --- a/packages/google-cloud-securitycenter/test/gapic_security_center_v1p1beta1.ts +++ b/packages/google-cloud-securitycenter/test/gapic_security_center_v1p1beta1.ts @@ -1,4 +1,4 @@ -// Copyright 2021 Google LLC +// 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. From 98325b8f3a3c89a3ab2a73be9e4bed3fd41583da Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Wed, 26 Jan 2022 20:06:19 +0000 Subject: [PATCH 297/342] chore: update v2.12.0 gapic-generator-typescript (#454) - [ ] Regenerate this pull request now. Committer: @summer-ji-eng PiperOrigin-RevId: 424244721 Source-Link: https://github.com/googleapis/googleapis/commit/4b6b01f507ebc3df95fdf8e1d76b0ae0ae33e52c Source-Link: https://github.com/googleapis/googleapis-gen/commit/8ac83fba606d008c7e8a42e7d55b6596ec4be35f Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiOGFjODNmYmE2MDZkMDA4YzdlOGE0MmU3ZDU1YjY1OTZlYzRiZTM1ZiJ9 --- .../google-cloud-securitycenter/linkinator.config.json | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-securitycenter/linkinator.config.json b/packages/google-cloud-securitycenter/linkinator.config.json index 0121dfa684f..befd23c8633 100644 --- a/packages/google-cloud-securitycenter/linkinator.config.json +++ b/packages/google-cloud-securitycenter/linkinator.config.json @@ -3,8 +3,14 @@ "skip": [ "https://codecov.io/gh/googleapis/", "www.googleapis.com", - "img.shields.io" + "img.shields.io", + "https://console.cloud.google.com/cloudshell", + "https://support.google.com" ], "silent": true, - "concurrency": 5 + "concurrency": 5, + "retry": true, + "retryErrors": true, + "retryErrorsCount": 5, + "retryErrorsJitter": 3000 } From 15f402ae1e1b6798781fd8ac44e2e4ffc6a6a2f4 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Mon, 31 Jan 2022 23:32:28 +0100 Subject: [PATCH 298/342] chore(deps): update dependency sinon to v13 (#456) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [sinon](https://sinonjs.org/) ([source](https://togithub.com/sinonjs/sinon)) | [`^12.0.0` -> `^13.0.0`](https://renovatebot.com/diffs/npm/sinon/12.0.1/13.0.0) | [![age](https://badges.renovateapi.com/packages/npm/sinon/13.0.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/sinon/13.0.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/sinon/13.0.0/compatibility-slim/12.0.1)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/sinon/13.0.0/confidence-slim/12.0.1)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
sinonjs/sinon ### [`v13.0.0`](https://togithub.com/sinonjs/sinon/blob/HEAD/CHANGES.md#​1300) [Compare Source](https://togithub.com/sinonjs/sinon/compare/v12.0.1...v13.0.0) - [`cf3d6c0c`](https://togithub.com/sinonjs/sinon/commit/cf3d6c0cd9689c0ee673b3daa8bf9abd70304392) Upgrade packages ([#​2431](https://togithub.com/sinonjs/sinon/issues/2431)) (Carl-Erik Kopseng) > - Update all @​sinonjs/ packages > > - Upgrade to fake-timers 9 > > - chore: ensure always using latest LTS release - [`41710467`](https://togithub.com/sinonjs/sinon/commit/417104670d575e96a1b645ea40ce763afa76fb1b) Adjust deploy scripts to archive old releases in a separate branch, move existing releases out of master ([#​2426](https://togithub.com/sinonjs/sinon/issues/2426)) (Joel Bradshaw) > Co-authored-by: Carl-Erik Kopseng - [`c80a7266`](https://togithub.com/sinonjs/sinon/commit/c80a72660e89d88b08275eff1028ecb9e26fd8e9) Bump node-fetch from 2.6.1 to 2.6.7 ([#​2430](https://togithub.com/sinonjs/sinon/issues/2430)) (dependabot\[bot]) > Co-authored-by: dependabot\[bot] <49699333+dependabot\[bot][@​users](https://togithub.com/users).noreply.github.com> - [`a00f14a9`](https://togithub.com/sinonjs/sinon/commit/a00f14a97dbe8c65afa89674e16ad73fc7d2fdc0) Add explicit export for `./*` ([#​2413](https://togithub.com/sinonjs/sinon/issues/2413)) (なつき) - [`b82ca7ad`](https://togithub.com/sinonjs/sinon/commit/b82ca7ad9b1add59007771f65a18ee34415de8ca) Bump cached-path-relative from 1.0.2 to 1.1.0 ([#​2428](https://togithub.com/sinonjs/sinon/issues/2428)) (dependabot\[bot]) - [`a9ea1427`](https://togithub.com/sinonjs/sinon/commit/a9ea142716c094ef3c432ecc4089f8207b8dd8b6) Add documentation for assert.calledOnceWithMatch ([#​2424](https://togithub.com/sinonjs/sinon/issues/2424)) (Mathias Schreck) - [`1d5ab86b`](https://togithub.com/sinonjs/sinon/commit/1d5ab86ba60e50dd69593ffed2bffd4b8faa0d38) Be more general in stripping off stack frames to fix Firefox tests ([#​2425](https://togithub.com/sinonjs/sinon/issues/2425)) (Joel Bradshaw) - [`56b06129`](https://togithub.com/sinonjs/sinon/commit/56b06129e223eae690265c37b1113067e2b31bdc) Check call count type ([#​2410](https://togithub.com/sinonjs/sinon/issues/2410)) (Joel Bradshaw) - [`7863e2df`](https://togithub.com/sinonjs/sinon/commit/7863e2dfdbda79e0a32e42af09e6539fc2f2b80f) Fix [#​2414](https://togithub.com/sinonjs/sinon/issues/2414): make Sinon available on homepage (Carl-Erik Kopseng) - [`fabaabdd`](https://togithub.com/sinonjs/sinon/commit/fabaabdda82f39a7f5b75b55bd56cf77b1cd4a8f) Bump nokogiri from 1.11.4 to 1.13.1 ([#​2423](https://togithub.com/sinonjs/sinon/issues/2423)) (dependabot\[bot]) - [`dbc0fbd2`](https://togithub.com/sinonjs/sinon/commit/dbc0fbd263c8419fa47f9c3b20cf47890a242d21) Bump shelljs from 0.8.4 to 0.8.5 ([#​2422](https://togithub.com/sinonjs/sinon/issues/2422)) (dependabot\[bot]) - [`fb8b3d72`](https://togithub.com/sinonjs/sinon/commit/fb8b3d72a85dc8fb0547f859baf3f03a22a039f7) Run Prettier (Carl-Erik Kopseng) - [`12a45939`](https://togithub.com/sinonjs/sinon/commit/12a45939e9b047b6d3663fe55f2eb383ec63c4e1) Fix 2377: Throw error when trying to stub non-configurable or non-writable properties ([#​2417](https://togithub.com/sinonjs/sinon/issues/2417)) (Stuart Dotson) > Fixes issue [#​2377](https://togithub.com/sinonjs/sinon/issues/2377) by throwing an error when trying to stub non-configurable or non-writable properties *Released by [Carl-Erik Kopseng](https://togithub.com/fatso83) on 2022-01-28.*
--- ### Configuration 📅 **Schedule**: "after 9am and before 3pm" (UTC). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/nodejs-security-center). --- packages/google-cloud-securitycenter/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-securitycenter/package.json b/packages/google-cloud-securitycenter/package.json index dbf66e01c85..9b0ecbf3b2f 100644 --- a/packages/google-cloud-securitycenter/package.json +++ b/packages/google-cloud-securitycenter/package.json @@ -57,7 +57,7 @@ "mocha": "^8.0.0", "null-loader": "^4.0.0", "pack-n-play": "^1.0.0-2", - "sinon": "^12.0.0", + "sinon": "^13.0.0", "ts-loader": "^8.0.0", "typescript": "^3.8.3" } From 0462a7ff4531e360101bf4493e1aae4e982ec848 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Wed, 2 Feb 2022 15:09:45 +0000 Subject: [PATCH 299/342] feat: Release the access field in the v1 finding proto, which represents an access event tied to the finding docs: added more clarification around what event_time means on a v1 finding (#457) feat: Release the access field in the v1 finding proto, which represents an access event tied to the finding docs: added more clarification around what event_time means on a v1 finding PiperOrigin-RevId: 425659764 Source-Link: https://github.com/googleapis/googleapis/commit/fa6793b316b97519fa9ea21960233096421710c5 Source-Link: https://github.com/googleapis/googleapis-gen/commit/254190611d11e7f0d271222cf64487de9ffbd5d9 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMjU0MTkwNjExZDExZTdmMGQyNzEyMjJjZjY0NDg3ZGU5ZmZiZDVkOSJ9 Co-authored-by: Owl Bot --- .../cloud/securitycenter/v1/access.proto | 56 + .../cloud/securitycenter/v1/finding.proto | 18 +- .../v1/securitycenter_service.proto | 61 +- .../protos/protos.d.ts | 772 +++--- .../protos/protos.js | 2097 ++++++++++------- .../protos/protos.json | 220 +- .../security_center.update_security_marks.js | 3 +- .../src/v1/security_center_client.ts | 3 +- .../src/v1/security_center_proto_list.json | 1 + 9 files changed, 2035 insertions(+), 1196 deletions(-) create mode 100644 packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/access.proto diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/access.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/access.proto new file mode 100644 index 00000000000..f348313a95f --- /dev/null +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/access.proto @@ -0,0 +1,56 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.securitycenter.v1; + +import "google/api/annotations.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1;securitycenter"; +option java_multiple_files = true; +option java_outer_classname = "AccessProto"; +option java_package = "com.google.cloud.securitycenter.v1"; +option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; +option php_namespace = "Google\\Cloud\\SecurityCenter\\V1"; +option ruby_package = "Google::Cloud::SecurityCenter::V1"; + +// Represents an access event. +message Access { + // Associated email, such as "foo@google.com". + string principal_email = 1; + + // Caller's IP address, such as "1.1.1.1". + string caller_ip = 2; + + // The caller IP's geolocation, which identifies where the call came from. + Geolocation caller_ip_geo = 3; + + // What kind of user agent is associated, e.g. operating system shells, + // embedded or stand-alone applications, etc. + string user_agent_family = 4; + + // This is the API service that the service account made a call to, e.g. + // "iam.googleapis.com" + string service_name = 5; + + // The method that the service account called, e.g. "SetIamPolicy". + string method_name = 6; +} + +// Represents a geographical location for a given access. +message Geolocation { + // A CLDR. + string region_code = 1; +} diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/finding.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/finding.proto index 5556b5249ef..611716ec011 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/finding.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/finding.proto @@ -16,15 +16,16 @@ syntax = "proto3"; package google.cloud.securitycenter.v1; +import "google/api/annotations.proto"; import "google/api/field_behavior.proto"; import "google/api/resource.proto"; +import "google/cloud/securitycenter/v1/access.proto"; import "google/cloud/securitycenter/v1/external_system.proto"; import "google/cloud/securitycenter/v1/indicator.proto"; import "google/cloud/securitycenter/v1/security_marks.proto"; import "google/cloud/securitycenter/v1/vulnerability.proto"; import "google/protobuf/struct.proto"; import "google/protobuf/timestamp.proto"; -import "google/api/annotations.proto"; option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1;securitycenter"; @@ -200,11 +201,12 @@ message Finding { // to the finding. SecurityMarks security_marks = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; - // The time at which the event took place, or when an update to the finding - // occurred. For example, if the finding represents an open firewall it would - // capture the time the detector believes the firewall became open. The - // accuracy is determined by the detector. If the finding were to be resolved - // afterward, this time would reflect when the finding was resolved. Must not + // The time the finding was first detected. If an existing finding is updated, + // then this is the time the update occurred. + // For example, if the finding represents an open firewall, this property + // captures the time the detector believes the firewall became open. The + // accuracy is determined by the detector. If the finding is later resolved, + // then this time reflects when the finding was resolved. This must not // be set to a value greater than the current timestamp. google.protobuf.Timestamp event_time = 9; @@ -249,6 +251,10 @@ message Finding { // information and external system finding fields. map external_systems = 22 [(google.api.field_behavior) = OUTPUT_ONLY]; + // Access details associated to the Finding, such as more information on the + // caller, which method was accessed, from where, etc. + Access access = 26; + // First known as mute_annotation. Records additional information about the // mute operation e.g. mute config that muted the finding, user who muted the // finding, etc. diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/securitycenter_service.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/securitycenter_service.proto index 9c8446c2f36..973ded26ec0 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/securitycenter_service.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/securitycenter_service.proto @@ -16,7 +16,6 @@ syntax = "proto3"; package google.cloud.securitycenter.v1; -import public "google/cloud/securitycenter/v1/run_asset_discovery_response.proto"; import "google/api/annotations.proto"; import "google/api/client.proto"; import "google/api/field_behavior.proto"; @@ -28,6 +27,7 @@ import "google/cloud/securitycenter/v1/folder.proto"; import "google/cloud/securitycenter/v1/mute_config.proto"; import "google/cloud/securitycenter/v1/notification_config.proto"; import "google/cloud/securitycenter/v1/organization_settings.proto"; +import public "google/cloud/securitycenter/v1/run_asset_discovery_response.proto"; import "google/cloud/securitycenter/v1/security_marks.proto"; import "google/cloud/securitycenter/v1/source.proto"; import "google/iam/v1/iam_policy.proto"; @@ -1459,6 +1459,34 @@ message ListFindingsRequest { message ListFindingsResponse { // Result containing the Finding and its StateChange. message ListFindingsResult { + // The change in state of the finding. + // + // When querying across two points in time this describes + // the change in the finding between the two points: CHANGED, UNCHANGED, + // ADDED, or REMOVED. Findings can not be deleted, so REMOVED implies that + // the finding at timestamp does not match the filter specified, but it did + // at timestamp - compare_duration. If there was no compare_duration + // supplied in the request the state change will be: UNUSED + enum StateChange { + // State change is unused, this is the canonical default for this enum. + UNUSED = 0; + + // The finding has changed state in some way between the points in time + // and existed at both points. + CHANGED = 1; + + // The finding has not changed state between the points in time and + // existed at both points. + UNCHANGED = 2; + + // The finding was created between the points in time. + ADDED = 3; + + // The finding at timestamp does not match the filter specified, but it + // did at timestamp - compare_duration. + REMOVED = 4; + } + // Information related to the Google Cloud resource that is // associated with this finding. message Resource { @@ -1490,34 +1518,6 @@ message ListFindingsResponse { string display_name = 8; } - // The change in state of the finding. - // - // When querying across two points in time this describes - // the change in the finding between the two points: CHANGED, UNCHANGED, - // ADDED, or REMOVED. Findings can not be deleted, so REMOVED implies that - // the finding at timestamp does not match the filter specified, but it did - // at timestamp - compare_duration. If there was no compare_duration - // supplied in the request the state change will be: UNUSED - enum StateChange { - // State change is unused, this is the canonical default for this enum. - UNUSED = 0; - - // The finding has changed state in some way between the points in time - // and existed at both points. - CHANGED = 1; - - // The finding has not changed state between the points in time and - // existed at both points. - UNCHANGED = 2; - - // The finding was created between the points in time. - ADDED = 3; - - // The finding at timestamp does not match the filter specified, but it - // did at timestamp - compare_duration. - REMOVED = 4; - } - // Finding matching the search request. Finding finding = 1; @@ -1681,6 +1681,7 @@ message UpdateSecurityMarksRequest { // The time at which the updated SecurityMarks take effect. // If not set uses current server time. Updates will be applied to the - // SecurityMarks that are active immediately preceding this time. + // SecurityMarks that are active immediately preceding this time. Must be + // smaller or equal to the server time. google.protobuf.Timestamp start_time = 3; } diff --git a/packages/google-cloud-securitycenter/protos/protos.d.ts b/packages/google-cloud-securitycenter/protos/protos.d.ts index 502521d72da..39010745411 100644 --- a/packages/google-cloud-securitycenter/protos/protos.d.ts +++ b/packages/google-cloud-securitycenter/protos/protos.d.ts @@ -26,6 +26,216 @@ export namespace google { /** Namespace v1. */ namespace v1 { + /** Properties of an Access. */ + interface IAccess { + + /** Access principalEmail */ + principalEmail?: (string|null); + + /** Access callerIp */ + callerIp?: (string|null); + + /** Access callerIpGeo */ + callerIpGeo?: (google.cloud.securitycenter.v1.IGeolocation|null); + + /** Access userAgentFamily */ + userAgentFamily?: (string|null); + + /** Access serviceName */ + serviceName?: (string|null); + + /** Access methodName */ + methodName?: (string|null); + } + + /** Represents an Access. */ + class Access implements IAccess { + + /** + * Constructs a new Access. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IAccess); + + /** Access principalEmail. */ + public principalEmail: string; + + /** Access callerIp. */ + public callerIp: string; + + /** Access callerIpGeo. */ + public callerIpGeo?: (google.cloud.securitycenter.v1.IGeolocation|null); + + /** Access userAgentFamily. */ + public userAgentFamily: string; + + /** Access serviceName. */ + public serviceName: string; + + /** Access methodName. */ + public methodName: string; + + /** + * Creates a new Access instance using the specified properties. + * @param [properties] Properties to set + * @returns Access instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IAccess): google.cloud.securitycenter.v1.Access; + + /** + * Encodes the specified Access message. Does not implicitly {@link google.cloud.securitycenter.v1.Access.verify|verify} messages. + * @param message Access message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IAccess, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Access message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Access.verify|verify} messages. + * @param message Access message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IAccess, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Access message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Access + * @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.cloud.securitycenter.v1.Access; + + /** + * Decodes an Access message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Access + * @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.cloud.securitycenter.v1.Access; + + /** + * Verifies an Access 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 Access message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Access + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.Access; + + /** + * Creates a plain object from an Access message. Also converts values to other types if specified. + * @param message Access + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.Access, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Access to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a Geolocation. */ + interface IGeolocation { + + /** Geolocation regionCode */ + regionCode?: (string|null); + } + + /** Represents a Geolocation. */ + class Geolocation implements IGeolocation { + + /** + * Constructs a new Geolocation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IGeolocation); + + /** Geolocation regionCode. */ + public regionCode: string; + + /** + * Creates a new Geolocation instance using the specified properties. + * @param [properties] Properties to set + * @returns Geolocation instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IGeolocation): google.cloud.securitycenter.v1.Geolocation; + + /** + * Encodes the specified Geolocation message. Does not implicitly {@link google.cloud.securitycenter.v1.Geolocation.verify|verify} messages. + * @param message Geolocation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IGeolocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Geolocation message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Geolocation.verify|verify} messages. + * @param message Geolocation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IGeolocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Geolocation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Geolocation + * @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.cloud.securitycenter.v1.Geolocation; + + /** + * Decodes a Geolocation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Geolocation + * @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.cloud.securitycenter.v1.Geolocation; + + /** + * Verifies a Geolocation 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 Geolocation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Geolocation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.Geolocation; + + /** + * Creates a plain object from a Geolocation message. Also converts values to other types if specified. + * @param message Geolocation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.Geolocation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Geolocation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + /** Properties of an Asset. */ interface IAsset { @@ -758,6 +968,9 @@ export namespace google { /** Finding externalSystems */ externalSystems?: ({ [k: string]: google.cloud.securitycenter.v1.IExternalSystem }|null); + /** Finding access */ + access?: (google.cloud.securitycenter.v1.IAccess|null); + /** Finding muteInitiator */ muteInitiator?: (string|null); } @@ -825,6 +1038,9 @@ export namespace google { /** Finding externalSystems. */ public externalSystems: { [k: string]: google.cloud.securitycenter.v1.IExternalSystem }; + /** Finding access. */ + public access?: (google.cloud.securitycenter.v1.IAccess|null); + /** Finding muteInitiator. */ public muteInitiator: string; @@ -6060,6 +6276,15 @@ export namespace google { namespace ListFindingsResult { + /** StateChange enum. */ + enum StateChange { + UNUSED = 0, + CHANGED = 1, + UNCHANGED = 2, + ADDED = 3, + REMOVED = 4 + } + /** Properties of a Resource. */ interface IResource { @@ -6191,15 +6416,6 @@ export namespace google { */ public toJSON(): { [k: string]: any }; } - - /** StateChange enum. */ - enum StateChange { - UNUSED = 0, - CHANGED = 1, - UNCHANGED = 2, - ADDED = 3, - REMOVED = 4 - } } } @@ -16136,578 +16352,578 @@ export namespace google { /** Namespace api. */ namespace api { - /** 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); + /** Properties of a Http. */ + interface IHttp { - /** ResourceDescriptor singular */ - singular?: (string|null); + /** Http rules */ + rules?: (google.api.IHttpRule[]|null); - /** ResourceDescriptor style */ - style?: (google.api.ResourceDescriptor.Style[]|null); + /** Http fullyDecodeReservedExpansion */ + fullyDecodeReservedExpansion?: (boolean|null); } - /** Represents a ResourceDescriptor. */ - class ResourceDescriptor implements IResourceDescriptor { + /** Represents a Http. */ + class Http implements IHttp { /** - * Constructs a new ResourceDescriptor. + * Constructs a new Http. * @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; + constructor(properties?: google.api.IHttp); - /** ResourceDescriptor singular. */ - public singular: string; + /** Http rules. */ + public rules: google.api.IHttpRule[]; - /** ResourceDescriptor style. */ - public style: google.api.ResourceDescriptor.Style[]; + /** Http fullyDecodeReservedExpansion. */ + public fullyDecodeReservedExpansion: boolean; /** - * Creates a new ResourceDescriptor instance using the specified properties. + * Creates a new Http instance using the specified properties. * @param [properties] Properties to set - * @returns ResourceDescriptor instance + * @returns Http instance */ - public static create(properties?: google.api.IResourceDescriptor): google.api.ResourceDescriptor; + public static create(properties?: google.api.IHttp): google.api.Http; /** - * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. - * @param message ResourceDescriptor message or plain object to encode + * 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.IResourceDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.api.IHttp, 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 + * 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.IResourceDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.api.IHttp, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ResourceDescriptor message from the specified reader or buffer. + * 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 ResourceDescriptor + * @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.ResourceDescriptor; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.Http; /** - * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. + * Decodes a Http message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ResourceDescriptor + * @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.ResourceDescriptor; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.Http; /** - * Verifies a ResourceDescriptor message. + * 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 ResourceDescriptor message from a plain object. Also converts values to their respective internal types. + * Creates a Http message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ResourceDescriptor + * @returns Http */ - public static fromObject(object: { [k: string]: any }): google.api.ResourceDescriptor; + public static fromObject(object: { [k: string]: any }): google.api.Http; /** - * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. - * @param message ResourceDescriptor + * 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.ResourceDescriptor, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.api.Http, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ResourceDescriptor to JSON. + * Converts this Http to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - namespace ResourceDescriptor { + /** Properties of a HttpRule. */ + interface IHttpRule { - /** History enum. */ - enum History { - HISTORY_UNSPECIFIED = 0, - ORIGINALLY_SINGLE_PATTERN = 1, - FUTURE_MULTI_PATTERN = 2 - } + /** HttpRule selector */ + selector?: (string|null); - /** Style enum. */ - enum Style { - STYLE_UNSPECIFIED = 0, - DECLARATIVE_FRIENDLY = 1 - } - } + /** HttpRule get */ + get?: (string|null); - /** Properties of a ResourceReference. */ - interface IResourceReference { + /** HttpRule put */ + put?: (string|null); - /** ResourceReference type */ - type?: (string|null); + /** HttpRule post */ + post?: (string|null); - /** ResourceReference childType */ - childType?: (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 ResourceReference. */ - class ResourceReference implements IResourceReference { + /** Represents a HttpRule. */ + class HttpRule implements IHttpRule { /** - * Constructs a new ResourceReference. + * Constructs a new HttpRule. * @param [properties] Properties to set */ - constructor(properties?: google.api.IResourceReference); + constructor(properties?: google.api.IHttpRule); - /** ResourceReference type. */ - public type: string; + /** HttpRule selector. */ + public selector: string; - /** ResourceReference childType. */ - public childType: 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 ResourceReference instance using the specified properties. + * Creates a new HttpRule instance using the specified properties. * @param [properties] Properties to set - * @returns ResourceReference instance + * @returns HttpRule instance */ - public static create(properties?: google.api.IResourceReference): google.api.ResourceReference; + public static create(properties?: google.api.IHttpRule): google.api.HttpRule; /** - * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. - * @param message ResourceReference message or plain object to encode + * 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.IResourceReference, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.api.IHttpRule, 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 + * 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.IResourceReference, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.api.IHttpRule, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ResourceReference message from the specified reader or buffer. + * 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 ResourceReference + * @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.ResourceReference; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.HttpRule; /** - * Decodes a ResourceReference message from the specified reader or buffer, length delimited. + * Decodes a HttpRule message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ResourceReference + * @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.ResourceReference; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.HttpRule; /** - * Verifies a ResourceReference message. + * 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 ResourceReference message from a plain object. Also converts values to their respective internal types. + * Creates a HttpRule message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ResourceReference + * @returns HttpRule */ - public static fromObject(object: { [k: string]: any }): google.api.ResourceReference; + public static fromObject(object: { [k: string]: any }): google.api.HttpRule; /** - * Creates a plain object from a ResourceReference message. Also converts values to other types if specified. - * @param message ResourceReference + * 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.ResourceReference, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.api.HttpRule, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ResourceReference to JSON. + * Converts this HttpRule to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a Http. */ - interface IHttp { + /** Properties of a CustomHttpPattern. */ + interface ICustomHttpPattern { - /** Http rules */ - rules?: (google.api.IHttpRule[]|null); + /** CustomHttpPattern kind */ + kind?: (string|null); - /** Http fullyDecodeReservedExpansion */ - fullyDecodeReservedExpansion?: (boolean|null); + /** CustomHttpPattern path */ + path?: (string|null); } - /** Represents a Http. */ - class Http implements IHttp { + /** Represents a CustomHttpPattern. */ + class CustomHttpPattern implements ICustomHttpPattern { /** - * Constructs a new Http. + * Constructs a new CustomHttpPattern. * @param [properties] Properties to set */ - constructor(properties?: google.api.IHttp); + constructor(properties?: google.api.ICustomHttpPattern); - /** Http rules. */ - public rules: google.api.IHttpRule[]; + /** CustomHttpPattern kind. */ + public kind: string; - /** Http fullyDecodeReservedExpansion. */ - public fullyDecodeReservedExpansion: boolean; + /** CustomHttpPattern path. */ + public path: string; /** - * Creates a new Http instance using the specified properties. + * Creates a new CustomHttpPattern instance using the specified properties. * @param [properties] Properties to set - * @returns Http instance + * @returns CustomHttpPattern instance */ - public static create(properties?: google.api.IHttp): google.api.Http; + public static create(properties?: google.api.ICustomHttpPattern): google.api.CustomHttpPattern; /** - * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. - * @param message Http message or plain object to encode + * 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.IHttp, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.api.ICustomHttpPattern, 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 + * 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.IHttp, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.api.ICustomHttpPattern, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a Http message from the specified reader or buffer. + * 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 Http + * @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.Http; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.CustomHttpPattern; /** - * Decodes a Http message from the specified reader or buffer, length delimited. + * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Http + * @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.Http; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.CustomHttpPattern; /** - * Verifies a Http message. + * 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 Http message from a plain object. Also converts values to their respective internal types. + * Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Http + * @returns CustomHttpPattern */ - public static fromObject(object: { [k: string]: any }): google.api.Http; + public static fromObject(object: { [k: string]: any }): google.api.CustomHttpPattern; /** - * Creates a plain object from a Http message. Also converts values to other types if specified. - * @param message Http + * 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.Http, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.api.CustomHttpPattern, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Http to JSON. + * Converts this CustomHttpPattern to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a HttpRule. */ - interface IHttpRule { - - /** HttpRule selector */ - selector?: (string|null); - - /** HttpRule get */ - get?: (string|null); - - /** HttpRule put */ - put?: (string|null); + /** Properties of a ResourceDescriptor. */ + interface IResourceDescriptor { - /** HttpRule post */ - post?: (string|null); + /** ResourceDescriptor type */ + type?: (string|null); - /** HttpRule delete */ - "delete"?: (string|null); + /** ResourceDescriptor pattern */ + pattern?: (string[]|null); - /** HttpRule patch */ - patch?: (string|null); + /** ResourceDescriptor nameField */ + nameField?: (string|null); - /** HttpRule custom */ - custom?: (google.api.ICustomHttpPattern|null); + /** ResourceDescriptor history */ + history?: (google.api.ResourceDescriptor.History|keyof typeof google.api.ResourceDescriptor.History|null); - /** HttpRule body */ - body?: (string|null); + /** ResourceDescriptor plural */ + plural?: (string|null); - /** HttpRule responseBody */ - responseBody?: (string|null); + /** ResourceDescriptor singular */ + singular?: (string|null); - /** HttpRule additionalBindings */ - additionalBindings?: (google.api.IHttpRule[]|null); + /** ResourceDescriptor style */ + style?: (google.api.ResourceDescriptor.Style[]|null); } - /** Represents a HttpRule. */ - class HttpRule implements IHttpRule { + /** Represents a ResourceDescriptor. */ + class ResourceDescriptor implements IResourceDescriptor { /** - * Constructs a new HttpRule. + * Constructs a new ResourceDescriptor. * @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); + constructor(properties?: google.api.IResourceDescriptor); - /** HttpRule delete. */ - public delete?: (string|null); + /** ResourceDescriptor type. */ + public type: string; - /** HttpRule patch. */ - public patch?: (string|null); + /** ResourceDescriptor pattern. */ + public pattern: string[]; - /** HttpRule custom. */ - public custom?: (google.api.ICustomHttpPattern|null); + /** ResourceDescriptor nameField. */ + public nameField: string; - /** HttpRule body. */ - public body: string; + /** ResourceDescriptor history. */ + public history: (google.api.ResourceDescriptor.History|keyof typeof google.api.ResourceDescriptor.History); - /** HttpRule responseBody. */ - public responseBody: string; + /** ResourceDescriptor plural. */ + public plural: string; - /** HttpRule additionalBindings. */ - public additionalBindings: google.api.IHttpRule[]; + /** ResourceDescriptor singular. */ + public singular: string; - /** HttpRule pattern. */ - public pattern?: ("get"|"put"|"post"|"delete"|"patch"|"custom"); + /** ResourceDescriptor style. */ + public style: google.api.ResourceDescriptor.Style[]; /** - * Creates a new HttpRule instance using the specified properties. + * Creates a new ResourceDescriptor instance using the specified properties. * @param [properties] Properties to set - * @returns HttpRule instance + * @returns ResourceDescriptor instance */ - public static create(properties?: google.api.IHttpRule): google.api.HttpRule; + public static create(properties?: google.api.IResourceDescriptor): google.api.ResourceDescriptor; /** - * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. - * @param message HttpRule message or plain object to encode + * 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.IHttpRule, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.api.IResourceDescriptor, 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 + * 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.IHttpRule, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.api.IResourceDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a HttpRule message from the specified reader or buffer. + * 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 HttpRule + * @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.HttpRule; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ResourceDescriptor; /** - * Decodes a HttpRule message from the specified reader or buffer, length delimited. + * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns HttpRule + * @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.HttpRule; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ResourceDescriptor; /** - * Verifies a HttpRule message. + * 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 HttpRule message from a plain object. Also converts values to their respective internal types. + * Creates a ResourceDescriptor message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns HttpRule + * @returns ResourceDescriptor */ - public static fromObject(object: { [k: string]: any }): google.api.HttpRule; + public static fromObject(object: { [k: string]: any }): google.api.ResourceDescriptor; /** - * Creates a plain object from a HttpRule message. Also converts values to other types if specified. - * @param message HttpRule + * 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.HttpRule, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.api.ResourceDescriptor, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this HttpRule to JSON. + * Converts this ResourceDescriptor to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a CustomHttpPattern. */ - interface ICustomHttpPattern { + namespace ResourceDescriptor { - /** CustomHttpPattern kind */ - kind?: (string|null); + /** History enum. */ + enum History { + HISTORY_UNSPECIFIED = 0, + ORIGINALLY_SINGLE_PATTERN = 1, + FUTURE_MULTI_PATTERN = 2 + } - /** CustomHttpPattern path */ - path?: (string|null); + /** Style enum. */ + enum Style { + STYLE_UNSPECIFIED = 0, + DECLARATIVE_FRIENDLY = 1 + } } - /** Represents a CustomHttpPattern. */ - class CustomHttpPattern implements ICustomHttpPattern { + /** 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 CustomHttpPattern. + * Constructs a new ResourceReference. * @param [properties] Properties to set */ - constructor(properties?: google.api.ICustomHttpPattern); + constructor(properties?: google.api.IResourceReference); - /** CustomHttpPattern kind. */ - public kind: string; + /** ResourceReference type. */ + public type: string; - /** CustomHttpPattern path. */ - public path: string; + /** ResourceReference childType. */ + public childType: string; /** - * Creates a new CustomHttpPattern instance using the specified properties. + * Creates a new ResourceReference instance using the specified properties. * @param [properties] Properties to set - * @returns CustomHttpPattern instance + * @returns ResourceReference instance */ - public static create(properties?: google.api.ICustomHttpPattern): google.api.CustomHttpPattern; + public static create(properties?: google.api.IResourceReference): google.api.ResourceReference; /** - * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. - * @param message CustomHttpPattern message or plain object to encode + * 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.ICustomHttpPattern, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.api.IResourceReference, 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 + * 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.ICustomHttpPattern, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.api.IResourceReference, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a CustomHttpPattern message from the specified reader or buffer. + * 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 CustomHttpPattern + * @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.CustomHttpPattern; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ResourceReference; /** - * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. + * Decodes a ResourceReference message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns CustomHttpPattern + * @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.CustomHttpPattern; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ResourceReference; /** - * Verifies a CustomHttpPattern message. + * 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 CustomHttpPattern message from a plain object. Also converts values to their respective internal types. + * Creates a ResourceReference message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns CustomHttpPattern + * @returns ResourceReference */ - public static fromObject(object: { [k: string]: any }): google.api.CustomHttpPattern; + public static fromObject(object: { [k: string]: any }): google.api.ResourceReference; /** - * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. - * @param message CustomHttpPattern + * 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.CustomHttpPattern, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.api.ResourceReference, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this CustomHttpPattern to JSON. + * Converts this ResourceReference to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; diff --git a/packages/google-cloud-securitycenter/protos/protos.js b/packages/google-cloud-securitycenter/protos/protos.js index 5080cfc2286..a129e1b6b2d 100644 --- a/packages/google-cloud-securitycenter/protos/protos.js +++ b/packages/google-cloud-securitycenter/protos/protos.js @@ -66,6 +66,496 @@ */ var v1 = {}; + v1.Access = (function() { + + /** + * Properties of an Access. + * @memberof google.cloud.securitycenter.v1 + * @interface IAccess + * @property {string|null} [principalEmail] Access principalEmail + * @property {string|null} [callerIp] Access callerIp + * @property {google.cloud.securitycenter.v1.IGeolocation|null} [callerIpGeo] Access callerIpGeo + * @property {string|null} [userAgentFamily] Access userAgentFamily + * @property {string|null} [serviceName] Access serviceName + * @property {string|null} [methodName] Access methodName + */ + + /** + * Constructs a new Access. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents an Access. + * @implements IAccess + * @constructor + * @param {google.cloud.securitycenter.v1.IAccess=} [properties] Properties to set + */ + function Access(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]]; + } + + /** + * Access principalEmail. + * @member {string} principalEmail + * @memberof google.cloud.securitycenter.v1.Access + * @instance + */ + Access.prototype.principalEmail = ""; + + /** + * Access callerIp. + * @member {string} callerIp + * @memberof google.cloud.securitycenter.v1.Access + * @instance + */ + Access.prototype.callerIp = ""; + + /** + * Access callerIpGeo. + * @member {google.cloud.securitycenter.v1.IGeolocation|null|undefined} callerIpGeo + * @memberof google.cloud.securitycenter.v1.Access + * @instance + */ + Access.prototype.callerIpGeo = null; + + /** + * Access userAgentFamily. + * @member {string} userAgentFamily + * @memberof google.cloud.securitycenter.v1.Access + * @instance + */ + Access.prototype.userAgentFamily = ""; + + /** + * Access serviceName. + * @member {string} serviceName + * @memberof google.cloud.securitycenter.v1.Access + * @instance + */ + Access.prototype.serviceName = ""; + + /** + * Access methodName. + * @member {string} methodName + * @memberof google.cloud.securitycenter.v1.Access + * @instance + */ + Access.prototype.methodName = ""; + + /** + * Creates a new Access instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.Access + * @static + * @param {google.cloud.securitycenter.v1.IAccess=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.Access} Access instance + */ + Access.create = function create(properties) { + return new Access(properties); + }; + + /** + * Encodes the specified Access message. Does not implicitly {@link google.cloud.securitycenter.v1.Access.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.Access + * @static + * @param {google.cloud.securitycenter.v1.IAccess} message Access message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Access.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.principalEmail != null && Object.hasOwnProperty.call(message, "principalEmail")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.principalEmail); + if (message.callerIp != null && Object.hasOwnProperty.call(message, "callerIp")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.callerIp); + if (message.callerIpGeo != null && Object.hasOwnProperty.call(message, "callerIpGeo")) + $root.google.cloud.securitycenter.v1.Geolocation.encode(message.callerIpGeo, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.userAgentFamily != null && Object.hasOwnProperty.call(message, "userAgentFamily")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.userAgentFamily); + if (message.serviceName != null && Object.hasOwnProperty.call(message, "serviceName")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.serviceName); + if (message.methodName != null && Object.hasOwnProperty.call(message, "methodName")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.methodName); + return writer; + }; + + /** + * Encodes the specified Access message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Access.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.Access + * @static + * @param {google.cloud.securitycenter.v1.IAccess} message Access message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Access.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Access message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.Access + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.Access} Access + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Access.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.cloud.securitycenter.v1.Access(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.principalEmail = reader.string(); + break; + case 2: + message.callerIp = reader.string(); + break; + case 3: + message.callerIpGeo = $root.google.cloud.securitycenter.v1.Geolocation.decode(reader, reader.uint32()); + break; + case 4: + message.userAgentFamily = reader.string(); + break; + case 5: + message.serviceName = reader.string(); + break; + case 6: + message.methodName = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Access message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.Access + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.Access} Access + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Access.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Access message. + * @function verify + * @memberof google.cloud.securitycenter.v1.Access + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Access.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.principalEmail != null && message.hasOwnProperty("principalEmail")) + if (!$util.isString(message.principalEmail)) + return "principalEmail: string expected"; + if (message.callerIp != null && message.hasOwnProperty("callerIp")) + if (!$util.isString(message.callerIp)) + return "callerIp: string expected"; + if (message.callerIpGeo != null && message.hasOwnProperty("callerIpGeo")) { + var error = $root.google.cloud.securitycenter.v1.Geolocation.verify(message.callerIpGeo); + if (error) + return "callerIpGeo." + error; + } + if (message.userAgentFamily != null && message.hasOwnProperty("userAgentFamily")) + if (!$util.isString(message.userAgentFamily)) + return "userAgentFamily: string expected"; + if (message.serviceName != null && message.hasOwnProperty("serviceName")) + if (!$util.isString(message.serviceName)) + return "serviceName: string expected"; + if (message.methodName != null && message.hasOwnProperty("methodName")) + if (!$util.isString(message.methodName)) + return "methodName: string expected"; + return null; + }; + + /** + * Creates an Access message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.Access + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.Access} Access + */ + Access.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.Access) + return object; + var message = new $root.google.cloud.securitycenter.v1.Access(); + if (object.principalEmail != null) + message.principalEmail = String(object.principalEmail); + if (object.callerIp != null) + message.callerIp = String(object.callerIp); + if (object.callerIpGeo != null) { + if (typeof object.callerIpGeo !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Access.callerIpGeo: object expected"); + message.callerIpGeo = $root.google.cloud.securitycenter.v1.Geolocation.fromObject(object.callerIpGeo); + } + if (object.userAgentFamily != null) + message.userAgentFamily = String(object.userAgentFamily); + if (object.serviceName != null) + message.serviceName = String(object.serviceName); + if (object.methodName != null) + message.methodName = String(object.methodName); + return message; + }; + + /** + * Creates a plain object from an Access message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.Access + * @static + * @param {google.cloud.securitycenter.v1.Access} message Access + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Access.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.principalEmail = ""; + object.callerIp = ""; + object.callerIpGeo = null; + object.userAgentFamily = ""; + object.serviceName = ""; + object.methodName = ""; + } + if (message.principalEmail != null && message.hasOwnProperty("principalEmail")) + object.principalEmail = message.principalEmail; + if (message.callerIp != null && message.hasOwnProperty("callerIp")) + object.callerIp = message.callerIp; + if (message.callerIpGeo != null && message.hasOwnProperty("callerIpGeo")) + object.callerIpGeo = $root.google.cloud.securitycenter.v1.Geolocation.toObject(message.callerIpGeo, options); + if (message.userAgentFamily != null && message.hasOwnProperty("userAgentFamily")) + object.userAgentFamily = message.userAgentFamily; + if (message.serviceName != null && message.hasOwnProperty("serviceName")) + object.serviceName = message.serviceName; + if (message.methodName != null && message.hasOwnProperty("methodName")) + object.methodName = message.methodName; + return object; + }; + + /** + * Converts this Access to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.Access + * @instance + * @returns {Object.} JSON object + */ + Access.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Access; + })(); + + v1.Geolocation = (function() { + + /** + * Properties of a Geolocation. + * @memberof google.cloud.securitycenter.v1 + * @interface IGeolocation + * @property {string|null} [regionCode] Geolocation regionCode + */ + + /** + * Constructs a new Geolocation. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a Geolocation. + * @implements IGeolocation + * @constructor + * @param {google.cloud.securitycenter.v1.IGeolocation=} [properties] Properties to set + */ + function Geolocation(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]]; + } + + /** + * Geolocation regionCode. + * @member {string} regionCode + * @memberof google.cloud.securitycenter.v1.Geolocation + * @instance + */ + Geolocation.prototype.regionCode = ""; + + /** + * Creates a new Geolocation instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.Geolocation + * @static + * @param {google.cloud.securitycenter.v1.IGeolocation=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.Geolocation} Geolocation instance + */ + Geolocation.create = function create(properties) { + return new Geolocation(properties); + }; + + /** + * Encodes the specified Geolocation message. Does not implicitly {@link google.cloud.securitycenter.v1.Geolocation.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.Geolocation + * @static + * @param {google.cloud.securitycenter.v1.IGeolocation} message Geolocation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Geolocation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.regionCode != null && Object.hasOwnProperty.call(message, "regionCode")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.regionCode); + return writer; + }; + + /** + * Encodes the specified Geolocation message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Geolocation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.Geolocation + * @static + * @param {google.cloud.securitycenter.v1.IGeolocation} message Geolocation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Geolocation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Geolocation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.Geolocation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.Geolocation} Geolocation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Geolocation.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.cloud.securitycenter.v1.Geolocation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.regionCode = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Geolocation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.Geolocation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.Geolocation} Geolocation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Geolocation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Geolocation message. + * @function verify + * @memberof google.cloud.securitycenter.v1.Geolocation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Geolocation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.regionCode != null && message.hasOwnProperty("regionCode")) + if (!$util.isString(message.regionCode)) + return "regionCode: string expected"; + return null; + }; + + /** + * Creates a Geolocation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.Geolocation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.Geolocation} Geolocation + */ + Geolocation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.Geolocation) + return object; + var message = new $root.google.cloud.securitycenter.v1.Geolocation(); + if (object.regionCode != null) + message.regionCode = String(object.regionCode); + return message; + }; + + /** + * Creates a plain object from a Geolocation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.Geolocation + * @static + * @param {google.cloud.securitycenter.v1.Geolocation} message Geolocation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Geolocation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.regionCode = ""; + if (message.regionCode != null && message.hasOwnProperty("regionCode")) + object.regionCode = message.regionCode; + return object; + }; + + /** + * Converts this Geolocation to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.Geolocation + * @instance + * @returns {Object.} JSON object + */ + Geolocation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Geolocation; + })(); + v1.Asset = (function() { /** @@ -1866,6 +2356,7 @@ * @property {google.cloud.securitycenter.v1.IVulnerability|null} [vulnerability] Finding vulnerability * @property {google.protobuf.ITimestamp|null} [muteUpdateTime] Finding muteUpdateTime * @property {Object.|null} [externalSystems] Finding externalSystems + * @property {google.cloud.securitycenter.v1.IAccess|null} [access] Finding access * @property {string|null} [muteInitiator] Finding muteInitiator */ @@ -2030,6 +2521,14 @@ */ Finding.prototype.externalSystems = $util.emptyObject; + /** + * Finding access. + * @member {google.cloud.securitycenter.v1.IAccess|null|undefined} access + * @memberof google.cloud.securitycenter.v1.Finding + * @instance + */ + Finding.prototype.access = null; + /** * Finding muteInitiator. * @member {string} muteInitiator @@ -2104,6 +2603,8 @@ writer.uint32(/* id 22, wireType 2 =*/178).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); $root.google.cloud.securitycenter.v1.ExternalSystem.encode(message.externalSystems[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); } + if (message.access != null && Object.hasOwnProperty.call(message, "access")) + $root.google.cloud.securitycenter.v1.Access.encode(message.access, writer.uint32(/* id 26, wireType 2 =*/210).fork()).ldelim(); if (message.muteInitiator != null && Object.hasOwnProperty.call(message, "muteInitiator")) writer.uint32(/* id 28, wireType 2 =*/226).string(message.muteInitiator); return writer; @@ -2232,6 +2733,9 @@ } message.externalSystems[key] = value; break; + case 26: + message.access = $root.google.cloud.securitycenter.v1.Access.decode(reader, reader.uint32()); + break; case 28: message.muteInitiator = reader.string(); break; @@ -2379,6 +2883,11 @@ return "externalSystems." + error; } } + if (message.access != null && message.hasOwnProperty("access")) { + var error = $root.google.cloud.securitycenter.v1.Access.verify(message.access); + if (error) + return "access." + error; + } if (message.muteInitiator != null && message.hasOwnProperty("muteInitiator")) if (!$util.isString(message.muteInitiator)) return "muteInitiator: string expected"; @@ -2535,6 +3044,11 @@ message.externalSystems[keys[i]] = $root.google.cloud.securitycenter.v1.ExternalSystem.fromObject(object.externalSystems[keys[i]]); } } + if (object.access != null) { + if (typeof object.access !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Finding.access: object expected"); + message.access = $root.google.cloud.securitycenter.v1.Access.fromObject(object.access); + } if (object.muteInitiator != null) message.muteInitiator = String(object.muteInitiator); return message; @@ -2574,6 +3088,7 @@ object.indicator = null; object.vulnerability = null; object.muteUpdateTime = null; + object.access = null; object.muteInitiator = ""; } if (message.name != null && message.hasOwnProperty("name")) @@ -2619,6 +3134,8 @@ for (var j = 0; j < keys2.length; ++j) object.externalSystems[keys2[j]] = $root.google.cloud.securitycenter.v1.ExternalSystem.toObject(message.externalSystems[keys2[j]], options); } + if (message.access != null && message.hasOwnProperty("access")) + object.access = $root.google.cloud.securitycenter.v1.Access.toObject(message.access, options); if (message.muteInitiator != null && message.hasOwnProperty("muteInitiator")) object.muteInitiator = message.muteInitiator; return object; @@ -14664,6 +15181,26 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * StateChange enum. + * @name google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.StateChange + * @enum {number} + * @property {number} UNUSED=0 UNUSED value + * @property {number} CHANGED=1 CHANGED value + * @property {number} UNCHANGED=2 UNCHANGED value + * @property {number} ADDED=3 ADDED value + * @property {number} REMOVED=4 REMOVED value + */ + ListFindingsResult.StateChange = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNUSED"] = 0; + values[valuesById[1] = "CHANGED"] = 1; + values[valuesById[2] = "UNCHANGED"] = 2; + values[valuesById[3] = "ADDED"] = 3; + values[valuesById[4] = "REMOVED"] = 4; + return values; + })(); + ListFindingsResult.Resource = (function() { /** @@ -15028,26 +15565,6 @@ return Resource; })(); - /** - * StateChange enum. - * @name google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.StateChange - * @enum {number} - * @property {number} UNUSED=0 UNUSED value - * @property {number} CHANGED=1 CHANGED value - * @property {number} UNCHANGED=2 UNCHANGED value - * @property {number} ADDED=3 ADDED value - * @property {number} REMOVED=4 REMOVED value - */ - ListFindingsResult.StateChange = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "UNUSED"] = 0; - values[valuesById[1] = "CHANGED"] = 1; - values[valuesById[2] = "UNCHANGED"] = 2; - values[valuesById[3] = "ADDED"] = 3; - values[valuesById[4] = "REMOVED"] = 4; - return values; - })(); - return ListFindingsResult; })(); @@ -38719,32 +39236,26 @@ */ var api = {}; - api.ResourceDescriptor = (function() { + api.Http = (function() { /** - * Properties of a ResourceDescriptor. + * Properties of a Http. * @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 + * @interface IHttp + * @property {Array.|null} [rules] Http rules + * @property {boolean|null} [fullyDecodeReservedExpansion] Http fullyDecodeReservedExpansion */ /** - * Constructs a new ResourceDescriptor. + * Constructs a new Http. * @memberof google.api - * @classdesc Represents a ResourceDescriptor. - * @implements IResourceDescriptor + * @classdesc Represents a Http. + * @implements IHttp * @constructor - * @param {google.api.IResourceDescriptor=} [properties] Properties to set + * @param {google.api.IHttp=} [properties] Properties to set */ - function ResourceDescriptor(properties) { - this.pattern = []; - this.style = []; + function Http(properties) { + this.rules = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -38752,167 +39263,91 @@ } /** - * 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 + * Http rules. + * @member {Array.} rules + * @memberof google.api.Http * @instance */ - ResourceDescriptor.prototype.singular = ""; + Http.prototype.rules = $util.emptyArray; /** - * ResourceDescriptor style. - * @member {Array.} style - * @memberof google.api.ResourceDescriptor + * Http fullyDecodeReservedExpansion. + * @member {boolean} fullyDecodeReservedExpansion + * @memberof google.api.Http * @instance */ - ResourceDescriptor.prototype.style = $util.emptyArray; + Http.prototype.fullyDecodeReservedExpansion = false; /** - * Creates a new ResourceDescriptor instance using the specified properties. + * Creates a new Http instance using the specified properties. * @function create - * @memberof google.api.ResourceDescriptor + * @memberof google.api.Http * @static - * @param {google.api.IResourceDescriptor=} [properties] Properties to set - * @returns {google.api.ResourceDescriptor} ResourceDescriptor instance + * @param {google.api.IHttp=} [properties] Properties to set + * @returns {google.api.Http} Http instance */ - ResourceDescriptor.create = function create(properties) { - return new ResourceDescriptor(properties); + Http.create = function create(properties) { + return new Http(properties); }; /** - * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. * @function encode - * @memberof google.api.ResourceDescriptor + * @memberof google.api.Http * @static - * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode + * @param {google.api.IHttp} message Http message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ResourceDescriptor.encode = function encode(message, writer) { + Http.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(); - } + 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 ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. * @function encodeDelimited - * @memberof google.api.ResourceDescriptor + * @memberof google.api.Http * @static - * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode + * @param {google.api.IHttp} message Http message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ResourceDescriptor.encodeDelimited = function encodeDelimited(message, writer) { + Http.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ResourceDescriptor message from the specified reader or buffer. + * Decodes a Http message from the specified reader or buffer. * @function decode - * @memberof google.api.ResourceDescriptor + * @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.ResourceDescriptor} ResourceDescriptor + * @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 */ - ResourceDescriptor.decode = function decode(reader, length) { + 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.ResourceDescriptor(); + 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: - message.type = reader.string(); + if (!(message.rules && message.rules.length)) + message.rules = []; + message.rules.push($root.google.api.HttpRule.decode(reader, reader.uint32())); 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()); + message.fullyDecodeReservedExpansion = reader.bool(); break; default: reader.skipType(tag & 7); @@ -38923,246 +39358,143 @@ }; /** - * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. + * Decodes a Http message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.api.ResourceDescriptor + * @memberof google.api.Http * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.ResourceDescriptor} ResourceDescriptor + * @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 */ - ResourceDescriptor.decodeDelimited = function decodeDelimited(reader) { + Http.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ResourceDescriptor message. + * Verifies a Http message. * @function verify - * @memberof google.api.ResourceDescriptor + * @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 */ - ResourceDescriptor.verify = function verify(message) { + Http.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.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.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; - } } + if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) + if (typeof message.fullyDecodeReservedExpansion !== "boolean") + return "fullyDecodeReservedExpansion: boolean expected"; return null; }; /** - * Creates a ResourceDescriptor message from a plain object. Also converts values to their respective internal types. + * Creates a Http message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.api.ResourceDescriptor + * @memberof google.api.Http * @static * @param {Object.} object Plain object - * @returns {google.api.ResourceDescriptor} ResourceDescriptor + * @returns {google.api.Http} Http */ - ResourceDescriptor.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.ResourceDescriptor) + Http.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.Http) 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) { - 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: - case "STYLE_UNSPECIFIED": - case 0: - message.style[i] = 0; - break; - case "DECLARATIVE_FRIENDLY": - case 1: - message.style[i] = 1; - break; - } + 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 ResourceDescriptor message. Also converts values to other types if specified. + * Creates a plain object from a Http message. Also converts values to other types if specified. * @function toObject - * @memberof google.api.ResourceDescriptor + * @memberof google.api.Http * @static - * @param {google.api.ResourceDescriptor} message ResourceDescriptor + * @param {google.api.Http} message Http * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ResourceDescriptor.toObject = function toObject(message, options) { + Http.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] : 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]] : message.style[j]; + 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 ResourceDescriptor to JSON. + * Converts this Http to JSON. * @function toJSON - * @memberof google.api.ResourceDescriptor + * @memberof google.api.Http * @instance * @returns {Object.} JSON object */ - ResourceDescriptor.prototype.toJSON = function toJSON() { + Http.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - /** - * 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; + return Http; })(); - api.ResourceReference = (function() { + api.HttpRule = (function() { /** - * Properties of a ResourceReference. + * Properties of a HttpRule. * @memberof google.api - * @interface IResourceReference - * @property {string|null} [type] ResourceReference type - * @property {string|null} [childType] ResourceReference childType + * @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 ResourceReference. + * Constructs a new HttpRule. * @memberof google.api - * @classdesc Represents a ResourceReference. - * @implements IResourceReference + * @classdesc Represents a HttpRule. + * @implements IHttpRule * @constructor - * @param {google.api.IResourceReference=} [properties] Properties to set + * @param {google.api.IHttpRule=} [properties] Properties to set */ - function ResourceReference(properties) { + function HttpRule(properties) { + this.additionalBindings = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -39170,484 +39502,34 @@ } /** - * ResourceReference type. - * @member {string} type - * @memberof google.api.ResourceReference + * HttpRule selector. + * @member {string} selector + * @memberof google.api.HttpRule * @instance */ - ResourceReference.prototype.type = ""; + HttpRule.prototype.selector = ""; /** - * ResourceReference childType. - * @member {string} childType - * @memberof google.api.ResourceReference + * HttpRule get. + * @member {string|null|undefined} get + * @memberof google.api.HttpRule * @instance */ - ResourceReference.prototype.childType = ""; + HttpRule.prototype.get = null; /** - * 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 + * HttpRule put. + * @member {string|null|undefined} put + * @memberof google.api.HttpRule + * @instance */ - ResourceReference.create = function create(properties) { - return new ResourceReference(properties); - }; + HttpRule.prototype.put = null; /** - * 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); - }; - - return ResourceReference; - })(); - - 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); - }; - - 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 post. + * @member {string|null|undefined} post + * @memberof google.api.HttpRule + * @instance */ HttpRule.prototype.post = null; @@ -40258,6 +40140,641 @@ return CustomHttpPattern; })(); + 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) { + 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: + 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] : 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]] : 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); + }; + + /** + * 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); + }; + + return ResourceReference; + })(); + /** * FieldBehavior enum. * @name google.api.FieldBehavior diff --git a/packages/google-cloud-securitycenter/protos/protos.json b/packages/google-cloud-securitycenter/protos/protos.json index 342eb19be8d..dd1c8c98d87 100644 --- a/packages/google-cloud-securitycenter/protos/protos.json +++ b/packages/google-cloud-securitycenter/protos/protos.json @@ -8,17 +8,53 @@ "nested": { "v1": { "options": { - "csharp_namespace": "Google.Cloud.SecurityCenter.V1", "go_package": "google.golang.org/genproto/googleapis/cloud/securitycenter/v1;securitycenter", "java_multiple_files": true, + "java_outer_classname": "ResourceProto", "java_package": "com.google.cloud.securitycenter.v1", + "csharp_namespace": "Google.Cloud.SecurityCenter.V1", "php_namespace": "Google\\Cloud\\SecurityCenter\\V1", "ruby_package": "Google::Cloud::SecurityCenter::V1", - "java_outer_classname": "ResourceProto", "(google.api.resource_definition).type": "pubsub.googleapis.com/Topic", "(google.api.resource_definition).pattern": "projects/{project}/topics/{topic}" }, "nested": { + "Access": { + "fields": { + "principalEmail": { + "type": "string", + "id": 1 + }, + "callerIp": { + "type": "string", + "id": 2 + }, + "callerIpGeo": { + "type": "Geolocation", + "id": 3 + }, + "userAgentFamily": { + "type": "string", + "id": 4 + }, + "serviceName": { + "type": "string", + "id": 5 + }, + "methodName": { + "type": "string", + "id": 6 + } + } + }, + "Geolocation": { + "fields": { + "regionCode": { + "type": "string", + "id": 1 + } + } + }, "Asset": { "options": { "(google.api.resource).type": "securitycenter.googleapis.com/Asset", @@ -263,6 +299,10 @@ "(google.api.field_behavior)": "OUTPUT_ONLY" } }, + "access": { + "type": "Access", + "id": 26 + }, "muteInitiator": { "type": "string", "id": 28 @@ -2076,6 +2116,15 @@ } }, "nested": { + "StateChange": { + "values": { + "UNUSED": 0, + "CHANGED": 1, + "UNCHANGED": 2, + "ADDED": 3, + "REMOVED": 4 + } + }, "Resource": { "fields": { "name": { @@ -2112,15 +2161,6 @@ "id": 8 } } - }, - "StateChange": { - "values": { - "UNUSED": 0, - "CHANGED": 1, - "UNCHANGED": 2, - "ADDED": 3, - "REMOVED": 4 - } } } } @@ -5042,91 +5082,14 @@ }, "api": { "options": { - "cc_enable_arenas": true, "go_package": "google.golang.org/genproto/googleapis/api/annotations;annotations", "java_multiple_files": true, "java_outer_classname": "ClientProto", "java_package": "com.google.api", - "objc_class_prefix": "GAPI" + "objc_class_prefix": "GAPI", + "cc_enable_arenas": true }, "nested": { - "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 - } - } - }, "http": { "type": "HttpRule", "id": 72295728, @@ -5214,6 +5177,83 @@ } } }, + "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 + } + } + }, "fieldBehavior": { "rule": "repeated", "type": "google.api.FieldBehavior", diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_security_marks.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_security_marks.js index 14137cb7037..c6e99ad8ec8 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_security_marks.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_security_marks.js @@ -34,7 +34,8 @@ function main(securityMarks) { /** * The time at which the updated SecurityMarks take effect. * If not set uses current server time. Updates will be applied to the - * SecurityMarks that are active immediately preceding this time. + * SecurityMarks that are active immediately preceding this time. Must be + * smaller or equal to the server time. */ // const startTime = {} diff --git a/packages/google-cloud-securitycenter/src/v1/security_center_client.ts b/packages/google-cloud-securitycenter/src/v1/security_center_client.ts index d75210b9e85..fc3b34145f3 100644 --- a/packages/google-cloud-securitycenter/src/v1/security_center_client.ts +++ b/packages/google-cloud-securitycenter/src/v1/security_center_client.ts @@ -2575,7 +2575,8 @@ export class SecurityCenterClient { * @param {google.protobuf.Timestamp} request.startTime * The time at which the updated SecurityMarks take effect. * If not set uses current server time. Updates will be applied to the - * SecurityMarks that are active immediately preceding this time. + * SecurityMarks that are active immediately preceding this time. Must be + * smaller or equal to the server time. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. diff --git a/packages/google-cloud-securitycenter/src/v1/security_center_proto_list.json b/packages/google-cloud-securitycenter/src/v1/security_center_proto_list.json index 865edc59b68..e7582711c8f 100644 --- a/packages/google-cloud-securitycenter/src/v1/security_center_proto_list.json +++ b/packages/google-cloud-securitycenter/src/v1/security_center_proto_list.json @@ -1,4 +1,5 @@ [ + "../../protos/google/cloud/securitycenter/v1/access.proto", "../../protos/google/cloud/securitycenter/v1/asset.proto", "../../protos/google/cloud/securitycenter/v1/external_system.proto", "../../protos/google/cloud/securitycenter/v1/finding.proto", From fe83553576c42e0329a3d682a0b1f60206adf8ed Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Fri, 4 Feb 2022 16:09:07 +0000 Subject: [PATCH 300/342] docs(nodejs): version support policy edits (#1346) (#460) --- .../google-cloud-securitycenter/README.md | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/packages/google-cloud-securitycenter/README.md b/packages/google-cloud-securitycenter/README.md index 6c4e9dcddae..f524eceeebf 100644 --- a/packages/google-cloud-securitycenter/README.md +++ b/packages/google-cloud-securitycenter/README.md @@ -105,21 +105,21 @@ also contains samples. 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. -Client libraries targeting some end-of-life versions of Node.js are available, and -can be installed via npm [dist-tags](https://docs.npmjs.com/cli/dist-tag). -The dist-tags follow the naming convention `legacy-(version)`. - -_Legacy Node.js versions are supported as a best effort:_ +Google's client libraries support legacy versions of Node.js runtimes on a +best-efforts basis with the following warnings: -* Legacy versions will not be tested in continuous integration. -* Some security patches may not be able to be backported. -* Dependencies will not be kept up-to-date, and features will not be backported. +* Legacy versions are not tested in continuous integration. +* Some security patches and features cannot be backported. +* Dependencies cannot be kept up-to-date. -#### Legacy tags available - -* `legacy-8`: install client libraries from this dist-tag for versions - compatible with Node.js 8. +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-cloud/security-center@legacy-8` installs client libraries +for versions compatible with Node.js 8. ## Versioning From 50fb7db8d2273999c4c519e471c46ae14e6df135 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Mon, 7 Feb 2022 14:55:28 -0800 Subject: [PATCH 301/342] chore(main): release 5.9.0 (#458) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- packages/google-cloud-securitycenter/CHANGELOG.md | 8 ++++++++ packages/google-cloud-securitycenter/package.json | 2 +- packages/google-cloud-securitycenter/samples/package.json | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-securitycenter/CHANGELOG.md b/packages/google-cloud-securitycenter/CHANGELOG.md index 9f6038f18cc..0a7b55eb320 100644 --- a/packages/google-cloud-securitycenter/CHANGELOG.md +++ b/packages/google-cloud-securitycenter/CHANGELOG.md @@ -4,6 +4,14 @@ [1]: https://www.npmjs.com/package/@google-cloud/security-center?activeTab=versions +## [5.9.0](https://github.com/googleapis/nodejs-security-center/compare/v5.8.0...v5.9.0) (2022-02-04) + + +### Features + +* Release the access field in the v1 finding proto, which represents an access event tied to the finding ([6bbb738](https://github.com/googleapis/nodejs-security-center/commit/6bbb73850a1ed0ee3481ddbdc55c52e7bfa8fc0f)) +* Release the access field in the v1 finding proto, which represents an access event tied to the finding docs: added more clarification around what event_time means on a v1 finding ([#457](https://github.com/googleapis/nodejs-security-center/issues/457)) ([6bbb738](https://github.com/googleapis/nodejs-security-center/commit/6bbb73850a1ed0ee3481ddbdc55c52e7bfa8fc0f)) + ## [5.8.0](https://www.github.com/googleapis/nodejs-security-center/compare/v5.7.0...v5.8.0) (2021-11-22) diff --git a/packages/google-cloud-securitycenter/package.json b/packages/google-cloud-securitycenter/package.json index 9b0ecbf3b2f..16f2462f08a 100644 --- a/packages/google-cloud-securitycenter/package.json +++ b/packages/google-cloud-securitycenter/package.json @@ -1,7 +1,7 @@ { "name": "@google-cloud/security-center", "description": "Cloud Security Command Center API client for Node.js", - "version": "5.8.0", + "version": "5.9.0", "license": "Apache-2.0", "author": "Google LLC", "engines": { diff --git a/packages/google-cloud-securitycenter/samples/package.json b/packages/google-cloud-securitycenter/samples/package.json index fbb82371c41..d261126e828 100644 --- a/packages/google-cloud-securitycenter/samples/package.json +++ b/packages/google-cloud-securitycenter/samples/package.json @@ -14,7 +14,7 @@ "license": "Apache-2.0", "dependencies": { "@google-cloud/pubsub": "^2.0.0", - "@google-cloud/security-center": "^5.8.0" + "@google-cloud/security-center": "^5.9.0" }, "devDependencies": { "chai": "^4.2.0", From 4c282921b2dd69bc0beeda318250eb8b7d6f57b7 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 17 Feb 2022 17:24:53 +0000 Subject: [PATCH 302/342] docs: Update documentation for the Finding resource field "project_display_name" (#461) - [ ] Regenerate this pull request now. docs: Update documentation for the Mute fields on Findings PiperOrigin-RevId: 429148908 Source-Link: https://github.com/googleapis/googleapis/commit/c93764cc28b12e745f453a3eacf20080e3ec5a0c Source-Link: https://github.com/googleapis/googleapis-gen/commit/88104688fff37c67ff72addb73f3fe61d19dc85a Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiODgxMDQ2ODhmZmYzN2M2N2ZmNzJhZGRiNzNmM2ZlNjFkMTlkYzg1YSJ9 --- .../protos/google/cloud/securitycenter/v1/access.proto | 2 +- .../protos/google/cloud/securitycenter/v1/asset.proto | 2 +- .../google/cloud/securitycenter/v1/external_system.proto | 2 +- .../protos/google/cloud/securitycenter/v1/finding.proto | 8 +++++--- .../protos/google/cloud/securitycenter/v1/folder.proto | 2 +- .../protos/google/cloud/securitycenter/v1/indicator.proto | 2 +- .../google/cloud/securitycenter/v1/mute_config.proto | 2 +- .../cloud/securitycenter/v1/notification_config.proto | 2 +- .../cloud/securitycenter/v1/notification_message.proto | 2 +- .../cloud/securitycenter/v1/organization_settings.proto | 2 +- .../protos/google/cloud/securitycenter/v1/resource.proto | 4 ++-- .../securitycenter/v1/run_asset_discovery_response.proto | 2 +- .../google/cloud/securitycenter/v1/security_marks.proto | 2 +- .../cloud/securitycenter/v1/securitycenter_service.proto | 4 ++-- .../protos/google/cloud/securitycenter/v1/source.proto | 2 +- .../google/cloud/securitycenter/v1/vulnerability.proto | 2 +- 16 files changed, 22 insertions(+), 20 deletions(-) diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/access.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/access.proto index f348313a95f..851927d9d5c 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/access.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/access.proto @@ -1,4 +1,4 @@ -// Copyright 2021 Google LLC +// 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. diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/asset.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/asset.proto index b23a4232f94..3821cce77ab 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/asset.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/asset.proto @@ -1,4 +1,4 @@ -// Copyright 2021 Google LLC +// 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. diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/external_system.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/external_system.proto index b5a99332f6c..830a56b3213 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/external_system.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/external_system.proto @@ -1,4 +1,4 @@ -// Copyright 2021 Google LLC +// 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. diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/finding.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/finding.proto index 611716ec011..883b1e104f7 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/finding.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/finding.proto @@ -1,4 +1,4 @@ -// Copyright 2021 Google LLC +// 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. @@ -226,7 +226,8 @@ message Finding { string canonical_name = 14; // Indicates the mute state of a finding (either unspecified, muted, unmuted - // or undefined). + // or undefined). Unlike other attributes of a finding, a finding provider + // shouldn't set the value of mute. Mute mute = 15; // The class of the finding. @@ -257,6 +258,7 @@ message Finding { // First known as mute_annotation. Records additional information about the // mute operation e.g. mute config that muted the finding, user who muted the - // finding, etc. + // finding, etc. Unlike other attributes of a finding, a finding provider + // shouldn't set the value of mute. string mute_initiator = 28; } diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/folder.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/folder.proto index 49c114d4613..8afd9753669 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/folder.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/folder.proto @@ -1,4 +1,4 @@ -// Copyright 2021 Google LLC +// 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. diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/indicator.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/indicator.proto index f785156ffce..336f72dd62f 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/indicator.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/indicator.proto @@ -1,4 +1,4 @@ -// Copyright 2021 Google LLC +// 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. diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/mute_config.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/mute_config.proto index 78d63a66bbd..d528bcabb12 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/mute_config.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/mute_config.proto @@ -1,4 +1,4 @@ -// Copyright 2021 Google LLC +// 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. diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/notification_config.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/notification_config.proto index 7f670279a7f..344d1c09086 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/notification_config.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/notification_config.proto @@ -1,4 +1,4 @@ -// Copyright 2021 Google LLC +// 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. diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/notification_message.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/notification_message.proto index 6a9ce0852cf..52bc6d34675 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/notification_message.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/notification_message.proto @@ -1,4 +1,4 @@ -// Copyright 2021 Google LLC +// 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. diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/organization_settings.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/organization_settings.proto index 1dc77257726..d4131e65dcb 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/organization_settings.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/organization_settings.proto @@ -1,4 +1,4 @@ -// Copyright 2021 Google LLC +// 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. diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/resource.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/resource.proto index 8377329ebac..b2f78a9597b 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/resource.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/resource.proto @@ -1,4 +1,4 @@ -// Copyright 2021 Google LLC +// 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. @@ -37,7 +37,7 @@ message Resource { // The full resource name of project that the resource belongs to. string project = 2; - // The human readable name of project that the resource belongs to. + // The project id that the resource belongs to. string project_display_name = 3; // The full resource name of resource's parent. diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/run_asset_discovery_response.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/run_asset_discovery_response.proto index 20d084cae0b..78c6a6e3b47 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/run_asset_discovery_response.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/run_asset_discovery_response.proto @@ -1,4 +1,4 @@ -// Copyright 2021 Google LLC +// 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. diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/security_marks.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/security_marks.proto index f055cd5efcf..f4dd753d1b4 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/security_marks.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/security_marks.proto @@ -1,4 +1,4 @@ -// Copyright 2021 Google LLC +// 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. diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/securitycenter_service.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/securitycenter_service.proto index 973ded26ec0..67a3509c569 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/securitycenter_service.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/securitycenter_service.proto @@ -1,4 +1,4 @@ -// Copyright 2021 Google LLC +// 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. @@ -1497,7 +1497,7 @@ message ListFindingsResponse { // The full resource name of project that the resource belongs to. string project_name = 2; - // The human readable name of project that the resource belongs to. + // The project id that the resource belongs to. string project_display_name = 3; // The full resource name of resource's parent. diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/source.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/source.proto index 0df844ddede..61bbfd3b603 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/source.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/source.proto @@ -1,4 +1,4 @@ -// Copyright 2021 Google LLC +// 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. diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/vulnerability.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/vulnerability.proto index 4649adf90df..fb6b5c1721c 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/vulnerability.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/vulnerability.proto @@ -1,4 +1,4 @@ -// Copyright 2021 Google LLC +// 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. From 2114b93aa758d6a0df3a6f38150f9be3fc99a11e Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Fri, 18 Feb 2022 02:06:47 +0000 Subject: [PATCH 303/342] docs(samples): include metadata file, add exclusions for samples to handwritten libraries (#462) - [ ] Regenerate this pull request now. PiperOrigin-RevId: 429395631 Source-Link: https://github.com/googleapis/googleapis/commit/84594b35af0c38efcd6967e8179d801702ad96ff Source-Link: https://github.com/googleapis/googleapis-gen/commit/ed74f970fd82914874e6b27b04763cfa66bafe9b Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZWQ3NGY5NzBmZDgyOTE0ODc0ZTZiMjdiMDQ3NjNjZmE2NmJhZmU5YiJ9 --- .../v1/security_center.bulk_mute_findings.js | 9 +- .../v1/security_center.create_finding.js | 9 +- .../v1/security_center.create_mute_config.js | 9 +- ...urity_center.create_notification_config.js | 9 +- .../v1/security_center.create_source.js | 9 +- .../v1/security_center.delete_mute_config.js | 9 +- ...urity_center.delete_notification_config.js | 9 +- .../v1/security_center.get_iam_policy.js | 9 +- .../v1/security_center.get_mute_config.js | 9 +- ...security_center.get_notification_config.js | 9 +- ...curity_center.get_organization_settings.js | 9 +- .../v1/security_center.get_source.js | 9 +- .../v1/security_center.group_assets.js | 9 +- .../v1/security_center.group_findings.js | 9 +- .../v1/security_center.list_assets.js | 9 +- .../v1/security_center.list_findings.js | 9 +- .../v1/security_center.list_mute_configs.js | 9 +- ...curity_center.list_notification_configs.js | 9 +- .../v1/security_center.list_sources.js | 9 +- .../v1/security_center.run_asset_discovery.js | 9 +- .../v1/security_center.set_finding_state.js | 9 +- .../v1/security_center.set_iam_policy.js | 9 +- .../generated/v1/security_center.set_mute.js | 9 +- .../security_center.test_iam_permissions.js | 9 +- .../security_center.update_external_system.js | 9 +- .../v1/security_center.update_finding.js | 9 +- .../v1/security_center.update_mute_config.js | 9 +- ...urity_center.update_notification_config.js | 9 +- ...ity_center.update_organization_settings.js | 9 +- .../security_center.update_security_marks.js | 9 +- .../v1/security_center.update_source.js | 9 +- ...tadata.google.cloud.securitycenter.v1.json | 1475 +++++++++++++++++ .../v1beta1/security_center.create_finding.js | 9 +- .../v1beta1/security_center.create_source.js | 9 +- .../v1beta1/security_center.get_iam_policy.js | 9 +- ...curity_center.get_organization_settings.js | 9 +- .../v1beta1/security_center.get_source.js | 9 +- .../v1beta1/security_center.group_assets.js | 9 +- .../v1beta1/security_center.group_findings.js | 9 +- .../v1beta1/security_center.list_assets.js | 9 +- .../v1beta1/security_center.list_findings.js | 9 +- .../v1beta1/security_center.list_sources.js | 9 +- .../security_center.run_asset_discovery.js | 9 +- .../security_center.set_finding_state.js | 9 +- .../v1beta1/security_center.set_iam_policy.js | 9 +- .../security_center.test_iam_permissions.js | 9 +- .../v1beta1/security_center.update_finding.js | 9 +- ...ity_center.update_organization_settings.js | 9 +- .../security_center.update_security_marks.js | 9 +- .../v1beta1/security_center.update_source.js | 9 +- ...a.google.cloud.securitycenter.v1beta1.json | 891 ++++++++++ .../security_center.create_finding.js | 9 +- ...urity_center.create_notification_config.js | 9 +- .../security_center.create_source.js | 9 +- ...urity_center.delete_notification_config.js | 9 +- .../security_center.get_iam_policy.js | 9 +- ...security_center.get_notification_config.js | 9 +- ...curity_center.get_organization_settings.js | 9 +- .../v1p1beta1/security_center.get_source.js | 9 +- .../v1p1beta1/security_center.group_assets.js | 9 +- .../security_center.group_findings.js | 9 +- .../v1p1beta1/security_center.list_assets.js | 9 +- .../security_center.list_findings.js | 9 +- ...curity_center.list_notification_configs.js | 9 +- .../v1p1beta1/security_center.list_sources.js | 9 +- .../security_center.run_asset_discovery.js | 9 +- .../security_center.set_finding_state.js | 9 +- .../security_center.set_iam_policy.js | 9 +- .../security_center.test_iam_permissions.js | 9 +- .../security_center.update_finding.js | 9 +- ...urity_center.update_notification_config.js | 9 +- ...ity_center.update_organization_settings.js | 9 +- .../security_center.update_security_marks.js | 9 +- .../security_center.update_source.js | 9 +- ...google.cloud.securitycenter.v1p1beta1.json | 1119 +++++++++++++ .../src/v1/security_center_client.ts | 5 +- .../src/v1beta1/security_center_client.ts | 5 +- .../src/v1p1beta1/security_center_client.ts | 5 +- .../test/gapic_security_center_v1.ts | 396 ++++- .../test/gapic_security_center_v1beta1.ts | 221 ++- .../test/gapic_security_center_v1p1beta1.ts | 298 +++- 81 files changed, 4904 insertions(+), 159 deletions(-) create mode 100644 packages/google-cloud-securitycenter/samples/generated/v1/snippet_metadata.google.cloud.securitycenter.v1.json create mode 100644 packages/google-cloud-securitycenter/samples/generated/v1beta1/snippet_metadata.google.cloud.securitycenter.v1beta1.json create mode 100644 packages/google-cloud-securitycenter/samples/generated/v1p1beta1/snippet_metadata.google.cloud.securitycenter.v1p1beta1.json diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.bulk_mute_findings.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.bulk_mute_findings.js index 63f99ecf617..dfc2499d41d 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.bulk_mute_findings.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.bulk_mute_findings.js @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// 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 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.create_finding.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.create_finding.js index 746920f6a21..a51ddfddb26 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.create_finding.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.create_finding.js @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// 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 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.create_mute_config.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.create_mute_config.js index 49dea76262c..f6ad1e5675e 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.create_mute_config.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.create_mute_config.js @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// 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 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.create_notification_config.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.create_notification_config.js index 6394278de3d..73f2e6ba3d1 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.create_notification_config.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.create_notification_config.js @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// 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 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.create_source.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.create_source.js index a0465fd2aa9..0465b795433 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.create_source.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.create_source.js @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// 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 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.delete_mute_config.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.delete_mute_config.js index 8162ee3d9fd..0d3d0984605 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.delete_mute_config.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.delete_mute_config.js @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// 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 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.delete_notification_config.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.delete_notification_config.js index 12b4f019fe4..9a922f8d940 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.delete_notification_config.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.delete_notification_config.js @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// 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 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_iam_policy.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_iam_policy.js index e8452cca35a..c14522e3c00 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_iam_policy.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_iam_policy.js @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// 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 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_mute_config.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_mute_config.js index 53edaecbbe5..1364ec1bd7f 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_mute_config.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_mute_config.js @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// 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 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_notification_config.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_notification_config.js index d0eb23ca57b..090b0283ca2 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_notification_config.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_notification_config.js @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// 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 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_organization_settings.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_organization_settings.js index f408324f61c..888f48e3075 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_organization_settings.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_organization_settings.js @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// 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 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_source.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_source.js index fa5796e643e..55f6f64511e 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_source.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_source.js @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// 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 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.group_assets.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.group_assets.js index 2b70cea81ac..a16fcba32fb 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.group_assets.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.group_assets.js @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// 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 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.group_findings.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.group_findings.js index faf3c30ba4a..d59021ca140 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.group_findings.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.group_findings.js @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// 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 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_assets.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_assets.js index 9ebf2a98058..bf2dd52f483 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_assets.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_assets.js @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// 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 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_findings.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_findings.js index bf2a9563753..15eb8d4a5a9 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_findings.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_findings.js @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// 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 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_mute_configs.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_mute_configs.js index ade6360bc28..605e24f40ae 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_mute_configs.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_mute_configs.js @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// 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 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_notification_configs.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_notification_configs.js index 11aeada8ee1..2e4e8da7241 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_notification_configs.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_notification_configs.js @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// 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 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_sources.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_sources.js index 7fc4f557618..cb28399a2e8 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_sources.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_sources.js @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// 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 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.run_asset_discovery.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.run_asset_discovery.js index 4c1728e433d..d52034dfd59 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.run_asset_discovery.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.run_asset_discovery.js @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// 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 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.set_finding_state.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.set_finding_state.js index 676cf8a55a1..4ef1408793e 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.set_finding_state.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.set_finding_state.js @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// 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 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.set_iam_policy.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.set_iam_policy.js index 91cd2d88cf4..7949b8e5dc7 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.set_iam_policy.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.set_iam_policy.js @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// 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 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.set_mute.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.set_mute.js index 3ad33235b6b..b5430cb0bba 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.set_mute.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.set_mute.js @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// 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 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.test_iam_permissions.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.test_iam_permissions.js index b50171550ad..eec1299c476 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.test_iam_permissions.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.test_iam_permissions.js @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// 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 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_external_system.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_external_system.js index 801548bfa25..0c91e7721cf 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_external_system.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_external_system.js @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// 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 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_finding.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_finding.js index 271872a49a1..43974498848 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_finding.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_finding.js @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// 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 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_mute_config.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_mute_config.js index c261c605fbf..e624ed19e37 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_mute_config.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_mute_config.js @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// 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 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_notification_config.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_notification_config.js index 74af35bca99..d8bc1878a0d 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_notification_config.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_notification_config.js @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// 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 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_organization_settings.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_organization_settings.js index ff5fc3c976d..31b890d1d50 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_organization_settings.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_organization_settings.js @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// 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 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_security_marks.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_security_marks.js index c6e99ad8ec8..9827fb86fde 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_security_marks.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_security_marks.js @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// 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 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_source.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_source.js index e99ad6fe83a..03c19de4153 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_source.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_source.js @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// 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 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/snippet_metadata.google.cloud.securitycenter.v1.json b/packages/google-cloud-securitycenter/samples/generated/v1/snippet_metadata.google.cloud.securitycenter.v1.json new file mode 100644 index 00000000000..5bf1ce0f5e0 --- /dev/null +++ b/packages/google-cloud-securitycenter/samples/generated/v1/snippet_metadata.google.cloud.securitycenter.v1.json @@ -0,0 +1,1475 @@ +{ + "clientLibrary": { + "name": "nodejs-securitycenter", + "version": "0.1.0", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.cloud.securitycenter.v1", + "version": "v1" + } + ] + }, + "snippets": [ + { + "regionTag": "securitycenter_v1_generated_SecurityCenter_BulkMuteFindings_async", + "title": "SecurityCenter bulkMuteFindings Sample", + "origin": "API_DEFINITION", + "description": " Kicks off an LRO to bulk mute findings for a parent based on a filter. The parent can be either an organization, folder or project. The findings matched by the filter will be muted after the LRO is done.", + "canonical": true, + "file": "security_center.bulk_mute_findings.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 76, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "BulkMuteFindings", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.BulkMuteFindings", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "mute_annotation", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" + }, + "method": { + "shortName": "BulkMuteFindings", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.BulkMuteFindings", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v1_generated_SecurityCenter_CreateSource_async", + "title": "SecurityCenter createSource Sample", + "origin": "API_DEFINITION", + "description": " Creates a source.", + "canonical": true, + "file": "security_center.create_source.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 57, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateSource", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.CreateSource", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "source", + "type": ".google.cloud.securitycenter.v1.Source" + } + ], + "resultType": ".google.cloud.securitycenter.v1.Source", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" + }, + "method": { + "shortName": "CreateSource", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.CreateSource", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v1_generated_SecurityCenter_CreateFinding_async", + "title": "SecurityCenter createFinding Sample", + "origin": "API_DEFINITION", + "description": " Creates a finding. The corresponding source must exist for finding creation to succeed.", + "canonical": true, + "file": "security_center.create_finding.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 64, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateFinding", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.CreateFinding", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "finding_id", + "type": "TYPE_STRING" + }, + { + "name": "finding", + "type": ".google.cloud.securitycenter.v1.Finding" + } + ], + "resultType": ".google.cloud.securitycenter.v1.Finding", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" + }, + "method": { + "shortName": "CreateFinding", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.CreateFinding", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v1_generated_SecurityCenter_CreateMuteConfig_async", + "title": "SecurityCenter createMuteConfig Sample", + "origin": "API_DEFINITION", + "description": " Creates a mute config.", + "canonical": true, + "file": "security_center.create_mute_config.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 65, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateMuteConfig", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.CreateMuteConfig", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "mute_config", + "type": ".google.cloud.securitycenter.v1.MuteConfig" + }, + { + "name": "mute_config_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.securitycenter.v1.MuteConfig", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" + }, + "method": { + "shortName": "CreateMuteConfig", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.CreateMuteConfig", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v1_generated_SecurityCenter_CreateNotificationConfig_async", + "title": "SecurityCenter createNotificationConfig Sample", + "origin": "API_DEFINITION", + "description": " Creates a notification config.", + "canonical": true, + "file": "security_center.create_notification_config.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 65, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateNotificationConfig", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.CreateNotificationConfig", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "config_id", + "type": "TYPE_STRING" + }, + { + "name": "notification_config", + "type": ".google.cloud.securitycenter.v1.NotificationConfig" + } + ], + "resultType": ".google.cloud.securitycenter.v1.NotificationConfig", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" + }, + "method": { + "shortName": "CreateNotificationConfig", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.CreateNotificationConfig", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v1_generated_SecurityCenter_DeleteMuteConfig_async", + "title": "SecurityCenter deleteMuteConfig Sample", + "origin": "API_DEFINITION", + "description": " Deletes an existing mute config.", + "canonical": true, + "file": "security_center.delete_mute_config.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteMuteConfig", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.DeleteMuteConfig", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" + }, + "method": { + "shortName": "DeleteMuteConfig", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.DeleteMuteConfig", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v1_generated_SecurityCenter_DeleteNotificationConfig_async", + "title": "SecurityCenter deleteNotificationConfig Sample", + "origin": "API_DEFINITION", + "description": " Deletes a notification config.", + "canonical": true, + "file": "security_center.delete_notification_config.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 51, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteNotificationConfig", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.DeleteNotificationConfig", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" + }, + "method": { + "shortName": "DeleteNotificationConfig", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.DeleteNotificationConfig", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v1_generated_SecurityCenter_GetIamPolicy_async", + "title": "SecurityCenter getIamPolicy Sample", + "origin": "API_DEFINITION", + "description": " Gets the access control policy on the specified Source.", + "canonical": true, + "file": "security_center.get_iam_policy.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 56, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetIamPolicy", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.GetIamPolicy", + "async": true, + "parameters": [ + { + "name": "resource", + "type": "TYPE_STRING" + }, + { + "name": "options", + "type": ".google.iam.v1.GetPolicyOptions" + } + ], + "resultType": ".google.iam.v1.Policy", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" + }, + "method": { + "shortName": "GetIamPolicy", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.GetIamPolicy", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v1_generated_SecurityCenter_GetMuteConfig_async", + "title": "SecurityCenter getMuteConfig Sample", + "origin": "API_DEFINITION", + "description": " Gets a mute config.", + "canonical": true, + "file": "security_center.get_mute_config.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetMuteConfig", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.GetMuteConfig", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.securitycenter.v1.MuteConfig", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" + }, + "method": { + "shortName": "GetMuteConfig", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.GetMuteConfig", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v1_generated_SecurityCenter_GetNotificationConfig_async", + "title": "SecurityCenter getNotificationConfig Sample", + "origin": "API_DEFINITION", + "description": " Gets a notification config.", + "canonical": true, + "file": "security_center.get_notification_config.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 51, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetNotificationConfig", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.GetNotificationConfig", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.securitycenter.v1.NotificationConfig", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" + }, + "method": { + "shortName": "GetNotificationConfig", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.GetNotificationConfig", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v1_generated_SecurityCenter_GetOrganizationSettings_async", + "title": "SecurityCenter getOrganizationSettings Sample", + "origin": "API_DEFINITION", + "description": " Gets the settings for an organization.", + "canonical": true, + "file": "security_center.get_organization_settings.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 51, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetOrganizationSettings", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.GetOrganizationSettings", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.securitycenter.v1.OrganizationSettings", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" + }, + "method": { + "shortName": "GetOrganizationSettings", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.GetOrganizationSettings", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v1_generated_SecurityCenter_GetSource_async", + "title": "SecurityCenter getSource Sample", + "origin": "API_DEFINITION", + "description": " Gets a source.", + "canonical": true, + "file": "security_center.get_source.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 51, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetSource", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.GetSource", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.securitycenter.v1.Source", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" + }, + "method": { + "shortName": "GetSource", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.GetSource", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v1_generated_SecurityCenter_GroupAssets_async", + "title": "SecurityCenter groupAssets Sample", + "origin": "API_DEFINITION", + "description": " Filters an organization's assets and groups them by their specified properties.", + "canonical": true, + "file": "security_center.group_assets.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 165, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GroupAssets", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.GroupAssets", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "group_by", + "type": "TYPE_STRING" + }, + { + "name": "compare_duration", + "type": ".google.protobuf.Duration" + }, + { + "name": "read_time", + "type": ".google.protobuf.Timestamp" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + } + ], + "resultType": ".google.cloud.securitycenter.v1.GroupAssetsResponse", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" + }, + "method": { + "shortName": "GroupAssets", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.GroupAssets", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v1_generated_SecurityCenter_GroupFindings_async", + "title": "SecurityCenter groupFindings Sample", + "origin": "API_DEFINITION", + "description": " Filters an organization or source's findings and groups them by their specified properties. To group across all sources provide a `-` as the source id. Example: /v1/organizations/{organization_id}/sources/-/findings, /v1/folders/{folder_id}/sources/-/findings, /v1/projects/{project_id}/sources/-/findings", + "canonical": true, + "file": "security_center.group_findings.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 169, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GroupFindings", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.GroupFindings", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "group_by", + "type": "TYPE_STRING" + }, + { + "name": "read_time", + "type": ".google.protobuf.Timestamp" + }, + { + "name": "compare_duration", + "type": ".google.protobuf.Duration" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + } + ], + "resultType": ".google.cloud.securitycenter.v1.GroupFindingsResponse", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" + }, + "method": { + "shortName": "GroupFindings", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.GroupFindings", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v1_generated_SecurityCenter_ListAssets_async", + "title": "SecurityCenter listAssets Sample", + "origin": "API_DEFINITION", + "description": " Lists an organization's assets.", + "canonical": true, + "file": "security_center.list_assets.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 174, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListAssets", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.ListAssets", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "order_by", + "type": "TYPE_STRING" + }, + { + "name": "read_time", + "type": ".google.protobuf.Timestamp" + }, + { + "name": "compare_duration", + "type": ".google.protobuf.Duration" + }, + { + "name": "field_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + } + ], + "resultType": ".google.cloud.securitycenter.v1.ListAssetsResponse", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" + }, + "method": { + "shortName": "ListAssets", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.ListAssets", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v1_generated_SecurityCenter_ListFindings_async", + "title": "SecurityCenter listFindings Sample", + "origin": "API_DEFINITION", + "description": " Lists an organization or source's findings. To list across all sources provide a `-` as the source id. Example: /v1/organizations/{organization_id}/sources/-/findings", + "canonical": true, + "file": "security_center.list_findings.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 180, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListFindings", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.ListFindings", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "order_by", + "type": "TYPE_STRING" + }, + { + "name": "read_time", + "type": ".google.protobuf.Timestamp" + }, + { + "name": "compare_duration", + "type": ".google.protobuf.Duration" + }, + { + "name": "field_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + } + ], + "resultType": ".google.cloud.securitycenter.v1.ListFindingsResponse", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" + }, + "method": { + "shortName": "ListFindings", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.ListFindings", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v1_generated_SecurityCenter_ListMuteConfigs_async", + "title": "SecurityCenter listMuteConfigs Sample", + "origin": "API_DEFINITION", + "description": " Lists mute configs.", + "canonical": true, + "file": "security_center.list_mute_configs.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 68, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListMuteConfigs", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.ListMuteConfigs", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.securitycenter.v1.ListMuteConfigsResponse", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" + }, + "method": { + "shortName": "ListMuteConfigs", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.ListMuteConfigs", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v1_generated_SecurityCenter_ListNotificationConfigs_async", + "title": "SecurityCenter listNotificationConfigs Sample", + "origin": "API_DEFINITION", + "description": " Lists notification configs.", + "canonical": true, + "file": "security_center.list_notification_configs.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 64, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListNotificationConfigs", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.ListNotificationConfigs", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + } + ], + "resultType": ".google.cloud.securitycenter.v1.ListNotificationConfigsResponse", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" + }, + "method": { + "shortName": "ListNotificationConfigs", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.ListNotificationConfigs", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v1_generated_SecurityCenter_ListSources_async", + "title": "SecurityCenter listSources Sample", + "origin": "API_DEFINITION", + "description": " Lists all sources belonging to an organization.", + "canonical": true, + "file": "security_center.list_sources.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 65, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListSources", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.ListSources", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + } + ], + "resultType": ".google.cloud.securitycenter.v1.ListSourcesResponse", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" + }, + "method": { + "shortName": "ListSources", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.ListSources", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v1_generated_SecurityCenter_RunAssetDiscovery_async", + "title": "SecurityCenter runAssetDiscovery Sample", + "origin": "API_DEFINITION", + "description": " Runs asset discovery. The discovery is tracked with a long-running operation. This API can only be called with limited frequency for an organization. If it is called too frequently the caller will receive a TOO_MANY_REQUESTS error.", + "canonical": true, + "file": "security_center.run_asset_discovery.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 52, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "RunAssetDiscovery", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.RunAssetDiscovery", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" + }, + "method": { + "shortName": "RunAssetDiscovery", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.RunAssetDiscovery", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v1_generated_SecurityCenter_SetFindingState_async", + "title": "SecurityCenter setFindingState Sample", + "origin": "API_DEFINITION", + "description": " Updates the state of a finding.", + "canonical": true, + "file": "security_center.set_finding_state.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 63, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "SetFindingState", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.SetFindingState", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "state", + "type": ".google.cloud.securitycenter.v1.Finding.State" + }, + { + "name": "start_time", + "type": ".google.protobuf.Timestamp" + } + ], + "resultType": ".google.cloud.securitycenter.v1.Finding", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" + }, + "method": { + "shortName": "SetFindingState", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.SetFindingState", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v1_generated_SecurityCenter_SetMute_async", + "title": "SecurityCenter setMute Sample", + "origin": "API_DEFINITION", + "description": " Updates the mute state of a finding.", + "canonical": true, + "file": "security_center.set_mute.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 60, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "SetMute", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.SetMute", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "mute", + "type": ".google.cloud.securitycenter.v1.Finding.Mute" + } + ], + "resultType": ".google.cloud.securitycenter.v1.Finding", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" + }, + "method": { + "shortName": "SetMute", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.SetMute", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v1_generated_SecurityCenter_SetIamPolicy_async", + "title": "SecurityCenter setIamPolicy Sample", + "origin": "API_DEFINITION", + "description": " Sets the access control policy on the specified Source.", + "canonical": true, + "file": "security_center.set_iam_policy.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "SetIamPolicy", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.SetIamPolicy", + "async": true, + "parameters": [ + { + "name": "resource", + "type": "TYPE_STRING" + }, + { + "name": "policy", + "type": ".google.iam.v1.Policy" + } + ], + "resultType": ".google.iam.v1.Policy", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" + }, + "method": { + "shortName": "SetIamPolicy", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.SetIamPolicy", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v1_generated_SecurityCenter_TestIamPermissions_async", + "title": "SecurityCenter testIamPermissions Sample", + "origin": "API_DEFINITION", + "description": " Returns the permissions that a caller has on the specified source.", + "canonical": true, + "file": "security_center.test_iam_permissions.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "TestIamPermissions", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.TestIamPermissions", + "async": true, + "parameters": [ + { + "name": "resource", + "type": "TYPE_STRING" + }, + { + "name": "permissions", + "type": "TYPE_STRING[]" + } + ], + "resultType": ".google.iam.v1.TestIamPermissionsResponse", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" + }, + "method": { + "shortName": "TestIamPermissions", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.TestIamPermissions", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v1_generated_SecurityCenter_UpdateExternalSystem_async", + "title": "SecurityCenter updateExternalSystem Sample", + "origin": "API_DEFINITION", + "description": " Updates external system. This is for a given finding.", + "canonical": true, + "file": "security_center.update_external_system.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateExternalSystem", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.UpdateExternalSystem", + "async": true, + "parameters": [ + { + "name": "external_system", + "type": ".google.cloud.securitycenter.v1.ExternalSystem" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.securitycenter.v1.ExternalSystem", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" + }, + "method": { + "shortName": "UpdateExternalSystem", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.UpdateExternalSystem", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v1_generated_SecurityCenter_UpdateFinding_async", + "title": "SecurityCenter updateFinding Sample", + "origin": "API_DEFINITION", + "description": " Creates or updates a finding. The corresponding source must exist for a finding creation to succeed.", + "canonical": true, + "file": "security_center.update_finding.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 63, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateFinding", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.UpdateFinding", + "async": true, + "parameters": [ + { + "name": "finding", + "type": ".google.cloud.securitycenter.v1.Finding" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.securitycenter.v1.Finding", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" + }, + "method": { + "shortName": "UpdateFinding", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.UpdateFinding", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v1_generated_SecurityCenter_UpdateMuteConfig_async", + "title": "SecurityCenter updateMuteConfig Sample", + "origin": "API_DEFINITION", + "description": " Updates a mute config.", + "canonical": true, + "file": "security_center.update_mute_config.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateMuteConfig", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.UpdateMuteConfig", + "async": true, + "parameters": [ + { + "name": "mute_config", + "type": ".google.cloud.securitycenter.v1.MuteConfig" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.securitycenter.v1.MuteConfig", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" + }, + "method": { + "shortName": "UpdateMuteConfig", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.UpdateMuteConfig", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v1_generated_SecurityCenter_UpdateNotificationConfig_async", + "title": "SecurityCenter updateNotificationConfig Sample", + "origin": "API_DEFINITION", + "description": " Updates a notification config. The following update fields are allowed: description, pubsub_topic, streaming_config.filter", + "canonical": true, + "file": "security_center.update_notification_config.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateNotificationConfig", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.UpdateNotificationConfig", + "async": true, + "parameters": [ + { + "name": "notification_config", + "type": ".google.cloud.securitycenter.v1.NotificationConfig" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.securitycenter.v1.NotificationConfig", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" + }, + "method": { + "shortName": "UpdateNotificationConfig", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.UpdateNotificationConfig", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v1_generated_SecurityCenter_UpdateOrganizationSettings_async", + "title": "SecurityCenter updateOrganizationSettings Sample", + "origin": "API_DEFINITION", + "description": " Updates an organization's settings.", + "canonical": true, + "file": "security_center.update_organization_settings.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateOrganizationSettings", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.UpdateOrganizationSettings", + "async": true, + "parameters": [ + { + "name": "organization_settings", + "type": ".google.cloud.securitycenter.v1.OrganizationSettings" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.securitycenter.v1.OrganizationSettings", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" + }, + "method": { + "shortName": "UpdateOrganizationSettings", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.UpdateOrganizationSettings", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v1_generated_SecurityCenter_UpdateSource_async", + "title": "SecurityCenter updateSource Sample", + "origin": "API_DEFINITION", + "description": " Updates a source.", + "canonical": true, + "file": "security_center.update_source.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateSource", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.UpdateSource", + "async": true, + "parameters": [ + { + "name": "source", + "type": ".google.cloud.securitycenter.v1.Source" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.securitycenter.v1.Source", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" + }, + "method": { + "shortName": "UpdateSource", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.UpdateSource", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v1_generated_SecurityCenter_UpdateSecurityMarks_async", + "title": "SecurityCenter updateSecurityMarks Sample", + "origin": "API_DEFINITION", + "description": " Updates security marks.", + "canonical": true, + "file": "security_center.update_security_marks.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 64, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateSecurityMarks", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.UpdateSecurityMarks", + "async": true, + "parameters": [ + { + "name": "security_marks", + "type": ".google.cloud.securitycenter.v1.SecurityMarks" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "start_time", + "type": ".google.protobuf.Timestamp" + } + ], + "resultType": ".google.cloud.securitycenter.v1.SecurityMarks", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" + }, + "method": { + "shortName": "UpdateSecurityMarks", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.UpdateSecurityMarks", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + } + } + ] +} diff --git a/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.create_finding.js b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.create_finding.js index 90289ca8bcb..b6d02d23eb7 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.create_finding.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.create_finding.js @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// 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 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; diff --git a/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.create_source.js b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.create_source.js index 9342a0f90a3..89b1fb7d57d 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.create_source.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.create_source.js @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// 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 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; diff --git a/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.get_iam_policy.js b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.get_iam_policy.js index 9bdfa2c4d88..a91712e7ea0 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.get_iam_policy.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.get_iam_policy.js @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// 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 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; diff --git a/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.get_organization_settings.js b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.get_organization_settings.js index 7862db8da2c..3844f406041 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.get_organization_settings.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.get_organization_settings.js @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// 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 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; diff --git a/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.get_source.js b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.get_source.js index 47f895c35db..fa59cdbd4e1 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.get_source.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.get_source.js @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// 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 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; diff --git a/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.group_assets.js b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.group_assets.js index 59edb045f29..f1094ea2974 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.group_assets.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.group_assets.js @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// 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 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; diff --git a/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.group_findings.js b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.group_findings.js index 4818c6cdd04..3eb12bb9af3 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.group_findings.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.group_findings.js @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// 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 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; diff --git a/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.list_assets.js b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.list_assets.js index dcfd98b974f..187079e5ac7 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.list_assets.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.list_assets.js @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// 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 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; diff --git a/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.list_findings.js b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.list_findings.js index b12126935be..49e6b81d5d2 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.list_findings.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.list_findings.js @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// 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 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; diff --git a/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.list_sources.js b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.list_sources.js index e3722e67d12..6a6a4c3e5da 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.list_sources.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.list_sources.js @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// 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 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; diff --git a/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.run_asset_discovery.js b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.run_asset_discovery.js index beed664c4ac..8cc9e9645e4 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.run_asset_discovery.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.run_asset_discovery.js @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// 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 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; diff --git a/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.set_finding_state.js b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.set_finding_state.js index db0cea43399..c135e7f5544 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.set_finding_state.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.set_finding_state.js @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// 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 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; diff --git a/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.set_iam_policy.js b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.set_iam_policy.js index 458ee483659..f30512e7a9a 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.set_iam_policy.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.set_iam_policy.js @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// 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 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; diff --git a/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.test_iam_permissions.js b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.test_iam_permissions.js index fbb5ee1fb03..2920bddb3db 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.test_iam_permissions.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.test_iam_permissions.js @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// 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 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; diff --git a/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.update_finding.js b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.update_finding.js index 5f0e87ad894..1c30526911e 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.update_finding.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.update_finding.js @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// 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 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; diff --git a/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.update_organization_settings.js b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.update_organization_settings.js index 6519c22242c..cea471f4a78 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.update_organization_settings.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.update_organization_settings.js @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// 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 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; diff --git a/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.update_security_marks.js b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.update_security_marks.js index 366bfa38762..d1aaced78b5 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.update_security_marks.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.update_security_marks.js @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// 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 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; diff --git a/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.update_source.js b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.update_source.js index cba6870c848..01f4c9f4ab3 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.update_source.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.update_source.js @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// 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 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; diff --git a/packages/google-cloud-securitycenter/samples/generated/v1beta1/snippet_metadata.google.cloud.securitycenter.v1beta1.json b/packages/google-cloud-securitycenter/samples/generated/v1beta1/snippet_metadata.google.cloud.securitycenter.v1beta1.json new file mode 100644 index 00000000000..0420e922284 --- /dev/null +++ b/packages/google-cloud-securitycenter/samples/generated/v1beta1/snippet_metadata.google.cloud.securitycenter.v1beta1.json @@ -0,0 +1,891 @@ +{ + "clientLibrary": { + "name": "nodejs-securitycenter", + "version": "0.1.0", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.cloud.securitycenter.v1beta1", + "version": "v1beta1" + } + ] + }, + "snippets": [ + { + "regionTag": "securitycenter_v1beta1_generated_SecurityCenter_CreateSource_async", + "title": "SecurityCenter createSource Sample", + "origin": "API_DEFINITION", + "description": " Creates a source.", + "canonical": true, + "file": "security_center.create_source.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 57, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateSource", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter.CreateSource", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "source", + "type": ".google.cloud.securitycenter.v1beta1.Source" + } + ], + "resultType": ".google.cloud.securitycenter.v1beta1.Source", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenterClient" + }, + "method": { + "shortName": "CreateSource", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter.CreateSource", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v1beta1_generated_SecurityCenter_CreateFinding_async", + "title": "SecurityCenter createFinding Sample", + "origin": "API_DEFINITION", + "description": " Creates a finding. The corresponding source must exist for finding creation to succeed.", + "canonical": true, + "file": "security_center.create_finding.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 64, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateFinding", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter.CreateFinding", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "finding_id", + "type": "TYPE_STRING" + }, + { + "name": "finding", + "type": ".google.cloud.securitycenter.v1beta1.Finding" + } + ], + "resultType": ".google.cloud.securitycenter.v1beta1.Finding", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenterClient" + }, + "method": { + "shortName": "CreateFinding", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter.CreateFinding", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v1beta1_generated_SecurityCenter_GetIamPolicy_async", + "title": "SecurityCenter getIamPolicy Sample", + "origin": "API_DEFINITION", + "description": " Gets the access control policy on the specified Source.", + "canonical": true, + "file": "security_center.get_iam_policy.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 56, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetIamPolicy", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter.GetIamPolicy", + "async": true, + "parameters": [ + { + "name": "resource", + "type": "TYPE_STRING" + }, + { + "name": "options", + "type": ".google.iam.v1.GetPolicyOptions" + } + ], + "resultType": ".google.iam.v1.Policy", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenterClient" + }, + "method": { + "shortName": "GetIamPolicy", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter.GetIamPolicy", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v1beta1_generated_SecurityCenter_GetOrganizationSettings_async", + "title": "SecurityCenter getOrganizationSettings Sample", + "origin": "API_DEFINITION", + "description": " Gets the settings for an organization.", + "canonical": true, + "file": "security_center.get_organization_settings.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 51, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetOrganizationSettings", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter.GetOrganizationSettings", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.securitycenter.v1beta1.OrganizationSettings", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenterClient" + }, + "method": { + "shortName": "GetOrganizationSettings", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter.GetOrganizationSettings", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v1beta1_generated_SecurityCenter_GetSource_async", + "title": "SecurityCenter getSource Sample", + "origin": "API_DEFINITION", + "description": " Gets a source.", + "canonical": true, + "file": "security_center.get_source.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 51, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetSource", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter.GetSource", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.securitycenter.v1beta1.Source", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenterClient" + }, + "method": { + "shortName": "GetSource", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter.GetSource", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v1beta1_generated_SecurityCenter_GroupAssets_async", + "title": "SecurityCenter groupAssets Sample", + "origin": "API_DEFINITION", + "description": " Filters an organization's assets and groups them by their specified properties.", + "canonical": true, + "file": "security_center.group_assets.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 128, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GroupAssets", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter.GroupAssets", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "group_by", + "type": "TYPE_STRING" + }, + { + "name": "compare_duration", + "type": ".google.protobuf.Duration" + }, + { + "name": "read_time", + "type": ".google.protobuf.Timestamp" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + } + ], + "resultType": ".google.cloud.securitycenter.v1beta1.GroupAssetsResponse", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenterClient" + }, + "method": { + "shortName": "GroupAssets", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter.GroupAssets", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v1beta1_generated_SecurityCenter_GroupFindings_async", + "title": "SecurityCenter groupFindings Sample", + "origin": "API_DEFINITION", + "description": " Filters an organization or source's findings and groups them by their specified properties. To group across all sources provide a `-` as the source id. Example: /v1beta1/organizations/{organization_id}/sources/-/findings", + "canonical": true, + "file": "security_center.group_findings.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 107, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GroupFindings", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter.GroupFindings", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "group_by", + "type": "TYPE_STRING" + }, + { + "name": "read_time", + "type": ".google.protobuf.Timestamp" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + } + ], + "resultType": ".google.cloud.securitycenter.v1beta1.GroupFindingsResponse", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenterClient" + }, + "method": { + "shortName": "GroupFindings", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter.GroupFindings", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v1beta1_generated_SecurityCenter_ListAssets_async", + "title": "SecurityCenter listAssets Sample", + "origin": "API_DEFINITION", + "description": " Lists an organization's assets.", + "canonical": true, + "file": "security_center.list_assets.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 133, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListAssets", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter.ListAssets", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "order_by", + "type": "TYPE_STRING" + }, + { + "name": "read_time", + "type": ".google.protobuf.Timestamp" + }, + { + "name": "compare_duration", + "type": ".google.protobuf.Duration" + }, + { + "name": "field_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + } + ], + "resultType": ".google.cloud.securitycenter.v1beta1.ListAssetsResponse", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenterClient" + }, + "method": { + "shortName": "ListAssets", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter.ListAssets", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v1beta1_generated_SecurityCenter_ListFindings_async", + "title": "SecurityCenter listFindings Sample", + "origin": "API_DEFINITION", + "description": " Lists an organization or source's findings. To list across all sources provide a `-` as the source id. Example: /v1beta1/organizations/{organization_id}/sources/-/findings", + "canonical": true, + "file": "security_center.list_findings.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 110, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListFindings", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter.ListFindings", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "order_by", + "type": "TYPE_STRING" + }, + { + "name": "read_time", + "type": ".google.protobuf.Timestamp" + }, + { + "name": "field_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + } + ], + "resultType": ".google.cloud.securitycenter.v1beta1.ListFindingsResponse", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenterClient" + }, + "method": { + "shortName": "ListFindings", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter.ListFindings", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v1beta1_generated_SecurityCenter_ListSources_async", + "title": "SecurityCenter listSources Sample", + "origin": "API_DEFINITION", + "description": " Lists all sources belonging to an organization.", + "canonical": true, + "file": "security_center.list_sources.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 64, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListSources", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter.ListSources", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + } + ], + "resultType": ".google.cloud.securitycenter.v1beta1.ListSourcesResponse", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenterClient" + }, + "method": { + "shortName": "ListSources", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter.ListSources", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v1beta1_generated_SecurityCenter_RunAssetDiscovery_async", + "title": "SecurityCenter runAssetDiscovery Sample", + "origin": "API_DEFINITION", + "description": " Runs asset discovery. The discovery is tracked with a long-running operation. This API can only be called with limited frequency for an organization. If it is called too frequently the caller will receive a TOO_MANY_REQUESTS error.", + "canonical": true, + "file": "security_center.run_asset_discovery.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 52, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "RunAssetDiscovery", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter.RunAssetDiscovery", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenterClient" + }, + "method": { + "shortName": "RunAssetDiscovery", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter.RunAssetDiscovery", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v1beta1_generated_SecurityCenter_SetFindingState_async", + "title": "SecurityCenter setFindingState Sample", + "origin": "API_DEFINITION", + "description": " Updates the state of a finding.", + "canonical": true, + "file": "security_center.set_finding_state.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 63, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "SetFindingState", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter.SetFindingState", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "state", + "type": ".google.cloud.securitycenter.v1beta1.Finding.State" + }, + { + "name": "start_time", + "type": ".google.protobuf.Timestamp" + } + ], + "resultType": ".google.cloud.securitycenter.v1beta1.Finding", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenterClient" + }, + "method": { + "shortName": "SetFindingState", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter.SetFindingState", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v1beta1_generated_SecurityCenter_SetIamPolicy_async", + "title": "SecurityCenter setIamPolicy Sample", + "origin": "API_DEFINITION", + "description": " Sets the access control policy on the specified Source.", + "canonical": true, + "file": "security_center.set_iam_policy.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "SetIamPolicy", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter.SetIamPolicy", + "async": true, + "parameters": [ + { + "name": "resource", + "type": "TYPE_STRING" + }, + { + "name": "policy", + "type": ".google.iam.v1.Policy" + } + ], + "resultType": ".google.iam.v1.Policy", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenterClient" + }, + "method": { + "shortName": "SetIamPolicy", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter.SetIamPolicy", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v1beta1_generated_SecurityCenter_TestIamPermissions_async", + "title": "SecurityCenter testIamPermissions Sample", + "origin": "API_DEFINITION", + "description": " Returns the permissions that a caller has on the specified source.", + "canonical": true, + "file": "security_center.test_iam_permissions.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "TestIamPermissions", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter.TestIamPermissions", + "async": true, + "parameters": [ + { + "name": "resource", + "type": "TYPE_STRING" + }, + { + "name": "permissions", + "type": "TYPE_STRING[]" + } + ], + "resultType": ".google.iam.v1.TestIamPermissionsResponse", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenterClient" + }, + "method": { + "shortName": "TestIamPermissions", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter.TestIamPermissions", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v1beta1_generated_SecurityCenter_UpdateFinding_async", + "title": "SecurityCenter updateFinding Sample", + "origin": "API_DEFINITION", + "description": " Creates or updates a finding. The corresponding source must exist for a finding creation to succeed.", + "canonical": true, + "file": "security_center.update_finding.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateFinding", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter.UpdateFinding", + "async": true, + "parameters": [ + { + "name": "finding", + "type": ".google.cloud.securitycenter.v1beta1.Finding" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.securitycenter.v1beta1.Finding", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenterClient" + }, + "method": { + "shortName": "UpdateFinding", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter.UpdateFinding", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v1beta1_generated_SecurityCenter_UpdateOrganizationSettings_async", + "title": "SecurityCenter updateOrganizationSettings Sample", + "origin": "API_DEFINITION", + "description": " Updates an organization's settings.", + "canonical": true, + "file": "security_center.update_organization_settings.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateOrganizationSettings", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter.UpdateOrganizationSettings", + "async": true, + "parameters": [ + { + "name": "organization_settings", + "type": ".google.cloud.securitycenter.v1beta1.OrganizationSettings" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.securitycenter.v1beta1.OrganizationSettings", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenterClient" + }, + "method": { + "shortName": "UpdateOrganizationSettings", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter.UpdateOrganizationSettings", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v1beta1_generated_SecurityCenter_UpdateSource_async", + "title": "SecurityCenter updateSource Sample", + "origin": "API_DEFINITION", + "description": " Updates a source.", + "canonical": true, + "file": "security_center.update_source.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateSource", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter.UpdateSource", + "async": true, + "parameters": [ + { + "name": "source", + "type": ".google.cloud.securitycenter.v1beta1.Source" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.securitycenter.v1beta1.Source", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenterClient" + }, + "method": { + "shortName": "UpdateSource", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter.UpdateSource", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v1beta1_generated_SecurityCenter_UpdateSecurityMarks_async", + "title": "SecurityCenter updateSecurityMarks Sample", + "origin": "API_DEFINITION", + "description": " Updates security marks.", + "canonical": true, + "file": "security_center.update_security_marks.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 58, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateSecurityMarks", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter.UpdateSecurityMarks", + "async": true, + "parameters": [ + { + "name": "security_marks", + "type": ".google.cloud.securitycenter.v1beta1.SecurityMarks" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "start_time", + "type": ".google.protobuf.Timestamp" + } + ], + "resultType": ".google.cloud.securitycenter.v1beta1.SecurityMarks", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenterClient" + }, + "method": { + "shortName": "UpdateSecurityMarks", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter.UpdateSecurityMarks", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter" + } + } + } + } + ] +} diff --git a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.create_finding.js b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.create_finding.js index 9eb96389119..aac99ed7894 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.create_finding.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.create_finding.js @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// 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 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; diff --git a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.create_notification_config.js b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.create_notification_config.js index 290b2f86582..b6f6d561f72 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.create_notification_config.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.create_notification_config.js @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// 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 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; diff --git a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.create_source.js b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.create_source.js index fba03b1b967..b9efa166434 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.create_source.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.create_source.js @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// 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 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; diff --git a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.delete_notification_config.js b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.delete_notification_config.js index 77462b2f423..4eb4bcec9c3 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.delete_notification_config.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.delete_notification_config.js @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// 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 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; diff --git a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.get_iam_policy.js b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.get_iam_policy.js index 90c348abfba..728cb1ed0ff 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.get_iam_policy.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.get_iam_policy.js @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// 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 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; diff --git a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.get_notification_config.js b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.get_notification_config.js index 120dba67f6e..8f87ffe5d3c 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.get_notification_config.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.get_notification_config.js @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// 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 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; diff --git a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.get_organization_settings.js b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.get_organization_settings.js index d09f46d413a..e96b8b4e4d5 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.get_organization_settings.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.get_organization_settings.js @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// 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 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; diff --git a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.get_source.js b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.get_source.js index 968bb024297..988cb631047 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.get_source.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.get_source.js @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// 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 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; diff --git a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.group_assets.js b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.group_assets.js index 2615ed829d4..6f364214af0 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.group_assets.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.group_assets.js @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// 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 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; diff --git a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.group_findings.js b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.group_findings.js index 87f7ec5a72c..949e649fcbb 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.group_findings.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.group_findings.js @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// 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 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; diff --git a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.list_assets.js b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.list_assets.js index edb3f4aeeb2..29b0abc6dfe 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.list_assets.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.list_assets.js @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// 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 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; diff --git a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.list_findings.js b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.list_findings.js index 58d5fd5fa6b..2e5ce81c690 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.list_findings.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.list_findings.js @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// 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 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; diff --git a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.list_notification_configs.js b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.list_notification_configs.js index d00b3a8f2fa..d67cbdb743c 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.list_notification_configs.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.list_notification_configs.js @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// 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 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; diff --git a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.list_sources.js b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.list_sources.js index d3e5613c583..78951b70149 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.list_sources.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.list_sources.js @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// 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 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; diff --git a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.run_asset_discovery.js b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.run_asset_discovery.js index 0563f1605aa..b53e6a02985 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.run_asset_discovery.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.run_asset_discovery.js @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// 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 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; diff --git a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.set_finding_state.js b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.set_finding_state.js index 99d97f276cd..f10874bdc4d 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.set_finding_state.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.set_finding_state.js @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// 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 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; diff --git a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.set_iam_policy.js b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.set_iam_policy.js index 8fdb23eb12b..e9c4e89e4ef 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.set_iam_policy.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.set_iam_policy.js @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// 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 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; diff --git a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.test_iam_permissions.js b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.test_iam_permissions.js index e69d5cafa91..808a5c07cf2 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.test_iam_permissions.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.test_iam_permissions.js @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// 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 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; diff --git a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.update_finding.js b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.update_finding.js index 9dcc69b5087..0b7e0ca31d5 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.update_finding.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.update_finding.js @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// 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 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; diff --git a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.update_notification_config.js b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.update_notification_config.js index 54718b4bc43..d36a254bef7 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.update_notification_config.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.update_notification_config.js @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// 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 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; diff --git a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.update_organization_settings.js b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.update_organization_settings.js index 0786b122b7f..73d291ae7a3 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.update_organization_settings.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.update_organization_settings.js @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// 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 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; diff --git a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.update_security_marks.js b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.update_security_marks.js index 33cfe18d01c..c4c73bcd20d 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.update_security_marks.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.update_security_marks.js @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// 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 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; diff --git a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.update_source.js b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.update_source.js index 9078baab911..89e55925451 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.update_source.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.update_source.js @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// 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 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; diff --git a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/snippet_metadata.google.cloud.securitycenter.v1p1beta1.json b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/snippet_metadata.google.cloud.securitycenter.v1p1beta1.json new file mode 100644 index 00000000000..6b0aa36eabd --- /dev/null +++ b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/snippet_metadata.google.cloud.securitycenter.v1p1beta1.json @@ -0,0 +1,1119 @@ +{ + "clientLibrary": { + "name": "nodejs-securitycenter", + "version": "0.1.0", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.cloud.securitycenter.v1p1beta1", + "version": "v1p1beta1" + } + ] + }, + "snippets": [ + { + "regionTag": "securitycenter_v1p1beta1_generated_SecurityCenter_CreateSource_async", + "title": "SecurityCenter createSource Sample", + "origin": "API_DEFINITION", + "description": " Creates a source.", + "canonical": true, + "file": "security_center.create_source.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 57, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateSource", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.CreateSource", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "source", + "type": ".google.cloud.securitycenter.v1p1beta1.Source" + } + ], + "resultType": ".google.cloud.securitycenter.v1p1beta1.Source", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenterClient" + }, + "method": { + "shortName": "CreateSource", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.CreateSource", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v1p1beta1_generated_SecurityCenter_CreateFinding_async", + "title": "SecurityCenter createFinding Sample", + "origin": "API_DEFINITION", + "description": " Creates a finding. The corresponding source must exist for finding creation to succeed.", + "canonical": true, + "file": "security_center.create_finding.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 62, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateFinding", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.CreateFinding", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "finding_id", + "type": "TYPE_STRING" + }, + { + "name": "finding", + "type": ".google.cloud.securitycenter.v1p1beta1.Finding" + } + ], + "resultType": ".google.cloud.securitycenter.v1p1beta1.Finding", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenterClient" + }, + "method": { + "shortName": "CreateFinding", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.CreateFinding", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v1p1beta1_generated_SecurityCenter_CreateNotificationConfig_async", + "title": "SecurityCenter createNotificationConfig Sample", + "origin": "API_DEFINITION", + "description": " Creates a notification config.", + "canonical": true, + "file": "security_center.create_notification_config.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 64, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateNotificationConfig", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.CreateNotificationConfig", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "config_id", + "type": "TYPE_STRING" + }, + { + "name": "notification_config", + "type": ".google.cloud.securitycenter.v1p1beta1.NotificationConfig" + } + ], + "resultType": ".google.cloud.securitycenter.v1p1beta1.NotificationConfig", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenterClient" + }, + "method": { + "shortName": "CreateNotificationConfig", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.CreateNotificationConfig", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v1p1beta1_generated_SecurityCenter_DeleteNotificationConfig_async", + "title": "SecurityCenter deleteNotificationConfig Sample", + "origin": "API_DEFINITION", + "description": " Deletes a notification config.", + "canonical": true, + "file": "security_center.delete_notification_config.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 51, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteNotificationConfig", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.DeleteNotificationConfig", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenterClient" + }, + "method": { + "shortName": "DeleteNotificationConfig", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.DeleteNotificationConfig", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v1p1beta1_generated_SecurityCenter_GetIamPolicy_async", + "title": "SecurityCenter getIamPolicy Sample", + "origin": "API_DEFINITION", + "description": " Gets the access control policy on the specified Source.", + "canonical": true, + "file": "security_center.get_iam_policy.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 56, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetIamPolicy", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.GetIamPolicy", + "async": true, + "parameters": [ + { + "name": "resource", + "type": "TYPE_STRING" + }, + { + "name": "options", + "type": ".google.iam.v1.GetPolicyOptions" + } + ], + "resultType": ".google.iam.v1.Policy", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenterClient" + }, + "method": { + "shortName": "GetIamPolicy", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.GetIamPolicy", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v1p1beta1_generated_SecurityCenter_GetNotificationConfig_async", + "title": "SecurityCenter getNotificationConfig Sample", + "origin": "API_DEFINITION", + "description": " Gets a notification config.", + "canonical": true, + "file": "security_center.get_notification_config.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 51, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetNotificationConfig", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.GetNotificationConfig", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.securitycenter.v1p1beta1.NotificationConfig", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenterClient" + }, + "method": { + "shortName": "GetNotificationConfig", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.GetNotificationConfig", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v1p1beta1_generated_SecurityCenter_GetOrganizationSettings_async", + "title": "SecurityCenter getOrganizationSettings Sample", + "origin": "API_DEFINITION", + "description": " Gets the settings for an organization.", + "canonical": true, + "file": "security_center.get_organization_settings.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 51, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetOrganizationSettings", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.GetOrganizationSettings", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.securitycenter.v1p1beta1.OrganizationSettings", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenterClient" + }, + "method": { + "shortName": "GetOrganizationSettings", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.GetOrganizationSettings", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v1p1beta1_generated_SecurityCenter_GetSource_async", + "title": "SecurityCenter getSource Sample", + "origin": "API_DEFINITION", + "description": " Gets a source.", + "canonical": true, + "file": "security_center.get_source.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 51, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetSource", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.GetSource", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.securitycenter.v1p1beta1.Source", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenterClient" + }, + "method": { + "shortName": "GetSource", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.GetSource", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v1p1beta1_generated_SecurityCenter_GroupAssets_async", + "title": "SecurityCenter groupAssets Sample", + "origin": "API_DEFINITION", + "description": " Filters an organization's assets and groups them by their specified properties.", + "canonical": true, + "file": "security_center.group_assets.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 165, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GroupAssets", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.GroupAssets", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "group_by", + "type": "TYPE_STRING" + }, + { + "name": "compare_duration", + "type": ".google.protobuf.Duration" + }, + { + "name": "read_time", + "type": ".google.protobuf.Timestamp" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + } + ], + "resultType": ".google.cloud.securitycenter.v1p1beta1.GroupAssetsResponse", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenterClient" + }, + "method": { + "shortName": "GroupAssets", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.GroupAssets", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v1p1beta1_generated_SecurityCenter_GroupFindings_async", + "title": "SecurityCenter groupFindings Sample", + "origin": "API_DEFINITION", + "description": " Filters an organization or source's findings and groups them by their specified properties. To group across all sources provide a `-` as the source id. Example: /v1/organizations/{organization_id}/sources/-/findings, /v1/folders/{folder_id}/sources/-/findings, /v1/projects/{project_id}/sources/-/findings", + "canonical": true, + "file": "security_center.group_findings.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 161, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GroupFindings", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.GroupFindings", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "group_by", + "type": "TYPE_STRING" + }, + { + "name": "read_time", + "type": ".google.protobuf.Timestamp" + }, + { + "name": "compare_duration", + "type": ".google.protobuf.Duration" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + } + ], + "resultType": ".google.cloud.securitycenter.v1p1beta1.GroupFindingsResponse", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenterClient" + }, + "method": { + "shortName": "GroupFindings", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.GroupFindings", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v1p1beta1_generated_SecurityCenter_ListAssets_async", + "title": "SecurityCenter listAssets Sample", + "origin": "API_DEFINITION", + "description": " Lists an organization's assets.", + "canonical": true, + "file": "security_center.list_assets.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 174, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListAssets", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.ListAssets", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "order_by", + "type": "TYPE_STRING" + }, + { + "name": "read_time", + "type": ".google.protobuf.Timestamp" + }, + { + "name": "compare_duration", + "type": ".google.protobuf.Duration" + }, + { + "name": "field_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + } + ], + "resultType": ".google.cloud.securitycenter.v1p1beta1.ListAssetsResponse", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenterClient" + }, + "method": { + "shortName": "ListAssets", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.ListAssets", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v1p1beta1_generated_SecurityCenter_ListFindings_async", + "title": "SecurityCenter listFindings Sample", + "origin": "API_DEFINITION", + "description": " Lists an organization or source's findings. To list across all sources provide a `-` as the source id. Example: /v1p1beta1/organizations/{organization_id}/sources/-/findings", + "canonical": true, + "file": "security_center.list_findings.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 170, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListFindings", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.ListFindings", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "order_by", + "type": "TYPE_STRING" + }, + { + "name": "read_time", + "type": ".google.protobuf.Timestamp" + }, + { + "name": "compare_duration", + "type": ".google.protobuf.Duration" + }, + { + "name": "field_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + } + ], + "resultType": ".google.cloud.securitycenter.v1p1beta1.ListFindingsResponse", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenterClient" + }, + "method": { + "shortName": "ListFindings", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.ListFindings", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v1p1beta1_generated_SecurityCenter_ListNotificationConfigs_async", + "title": "SecurityCenter listNotificationConfigs Sample", + "origin": "API_DEFINITION", + "description": " Lists notification configs.", + "canonical": true, + "file": "security_center.list_notification_configs.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 64, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListNotificationConfigs", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.ListNotificationConfigs", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + } + ], + "resultType": ".google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsResponse", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenterClient" + }, + "method": { + "shortName": "ListNotificationConfigs", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.ListNotificationConfigs", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v1p1beta1_generated_SecurityCenter_ListSources_async", + "title": "SecurityCenter listSources Sample", + "origin": "API_DEFINITION", + "description": " Lists all sources belonging to an organization.", + "canonical": true, + "file": "security_center.list_sources.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 65, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListSources", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.ListSources", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + } + ], + "resultType": ".google.cloud.securitycenter.v1p1beta1.ListSourcesResponse", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenterClient" + }, + "method": { + "shortName": "ListSources", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.ListSources", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v1p1beta1_generated_SecurityCenter_RunAssetDiscovery_async", + "title": "SecurityCenter runAssetDiscovery Sample", + "origin": "API_DEFINITION", + "description": " Runs asset discovery. The discovery is tracked with a long-running operation. This API can only be called with limited frequency for an organization. If it is called too frequently the caller will receive a TOO_MANY_REQUESTS error.", + "canonical": true, + "file": "security_center.run_asset_discovery.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 52, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "RunAssetDiscovery", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.RunAssetDiscovery", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenterClient" + }, + "method": { + "shortName": "RunAssetDiscovery", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.RunAssetDiscovery", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v1p1beta1_generated_SecurityCenter_SetFindingState_async", + "title": "SecurityCenter setFindingState Sample", + "origin": "API_DEFINITION", + "description": " Updates the state of a finding.", + "canonical": true, + "file": "security_center.set_finding_state.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 63, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "SetFindingState", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.SetFindingState", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "state", + "type": ".google.cloud.securitycenter.v1p1beta1.Finding.State" + }, + { + "name": "start_time", + "type": ".google.protobuf.Timestamp" + } + ], + "resultType": ".google.cloud.securitycenter.v1p1beta1.Finding", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenterClient" + }, + "method": { + "shortName": "SetFindingState", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.SetFindingState", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v1p1beta1_generated_SecurityCenter_SetIamPolicy_async", + "title": "SecurityCenter setIamPolicy Sample", + "origin": "API_DEFINITION", + "description": " Sets the access control policy on the specified Source.", + "canonical": true, + "file": "security_center.set_iam_policy.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "SetIamPolicy", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.SetIamPolicy", + "async": true, + "parameters": [ + { + "name": "resource", + "type": "TYPE_STRING" + }, + { + "name": "policy", + "type": ".google.iam.v1.Policy" + } + ], + "resultType": ".google.iam.v1.Policy", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenterClient" + }, + "method": { + "shortName": "SetIamPolicy", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.SetIamPolicy", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v1p1beta1_generated_SecurityCenter_TestIamPermissions_async", + "title": "SecurityCenter testIamPermissions Sample", + "origin": "API_DEFINITION", + "description": " Returns the permissions that a caller has on the specified source.", + "canonical": true, + "file": "security_center.test_iam_permissions.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "TestIamPermissions", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.TestIamPermissions", + "async": true, + "parameters": [ + { + "name": "resource", + "type": "TYPE_STRING" + }, + { + "name": "permissions", + "type": "TYPE_STRING[]" + } + ], + "resultType": ".google.iam.v1.TestIamPermissionsResponse", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenterClient" + }, + "method": { + "shortName": "TestIamPermissions", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.TestIamPermissions", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v1p1beta1_generated_SecurityCenter_UpdateFinding_async", + "title": "SecurityCenter updateFinding Sample", + "origin": "API_DEFINITION", + "description": " Creates or updates a finding. The corresponding source must exist for a finding creation to succeed.", + "canonical": true, + "file": "security_center.update_finding.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 63, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateFinding", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.UpdateFinding", + "async": true, + "parameters": [ + { + "name": "finding", + "type": ".google.cloud.securitycenter.v1p1beta1.Finding" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.securitycenter.v1p1beta1.Finding", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenterClient" + }, + "method": { + "shortName": "UpdateFinding", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.UpdateFinding", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v1p1beta1_generated_SecurityCenter_UpdateNotificationConfig_async", + "title": "SecurityCenter updateNotificationConfig Sample", + "origin": "API_DEFINITION", + "description": " Updates a notification config. The following update fields are allowed: description, pubsub_topic, streaming_config.filter", + "canonical": true, + "file": "security_center.update_notification_config.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateNotificationConfig", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.UpdateNotificationConfig", + "async": true, + "parameters": [ + { + "name": "notification_config", + "type": ".google.cloud.securitycenter.v1p1beta1.NotificationConfig" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.securitycenter.v1p1beta1.NotificationConfig", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenterClient" + }, + "method": { + "shortName": "UpdateNotificationConfig", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.UpdateNotificationConfig", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v1p1beta1_generated_SecurityCenter_UpdateOrganizationSettings_async", + "title": "SecurityCenter updateOrganizationSettings Sample", + "origin": "API_DEFINITION", + "description": " Updates an organization's settings.", + "canonical": true, + "file": "security_center.update_organization_settings.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateOrganizationSettings", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.UpdateOrganizationSettings", + "async": true, + "parameters": [ + { + "name": "organization_settings", + "type": ".google.cloud.securitycenter.v1p1beta1.OrganizationSettings" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.securitycenter.v1p1beta1.OrganizationSettings", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenterClient" + }, + "method": { + "shortName": "UpdateOrganizationSettings", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.UpdateOrganizationSettings", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v1p1beta1_generated_SecurityCenter_UpdateSource_async", + "title": "SecurityCenter updateSource Sample", + "origin": "API_DEFINITION", + "description": " Updates a source.", + "canonical": true, + "file": "security_center.update_source.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateSource", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.UpdateSource", + "async": true, + "parameters": [ + { + "name": "source", + "type": ".google.cloud.securitycenter.v1p1beta1.Source" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.securitycenter.v1p1beta1.Source", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenterClient" + }, + "method": { + "shortName": "UpdateSource", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.UpdateSource", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v1p1beta1_generated_SecurityCenter_UpdateSecurityMarks_async", + "title": "SecurityCenter updateSecurityMarks Sample", + "origin": "API_DEFINITION", + "description": " Updates security marks.", + "canonical": true, + "file": "security_center.update_security_marks.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 63, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateSecurityMarks", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.UpdateSecurityMarks", + "async": true, + "parameters": [ + { + "name": "security_marks", + "type": ".google.cloud.securitycenter.v1p1beta1.SecurityMarks" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "start_time", + "type": ".google.protobuf.Timestamp" + } + ], + "resultType": ".google.cloud.securitycenter.v1p1beta1.SecurityMarks", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenterClient" + }, + "method": { + "shortName": "UpdateSecurityMarks", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.UpdateSecurityMarks", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter" + } + } + } + } + ] +} diff --git a/packages/google-cloud-securitycenter/src/v1/security_center_client.ts b/packages/google-cloud-securitycenter/src/v1/security_center_client.ts index fc3b34145f3..b747c342ad0 100644 --- a/packages/google-cloud-securitycenter/src/v1/security_center_client.ts +++ b/packages/google-cloud-securitycenter/src/v1/security_center_client.ts @@ -7080,9 +7080,8 @@ export class SecurityCenterClient { * @returns {Promise} A promise that resolves when the client is closed. */ close(): Promise { - this.initialize(); - if (!this._terminated) { - return this.securityCenterStub!.then(stub => { + if (this.securityCenterStub && !this._terminated) { + return this.securityCenterStub.then(stub => { this._terminated = true; stub.close(); this.operationsClient.close(); diff --git a/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.ts b/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.ts index bde22bdb421..cc3fb50996a 100644 --- a/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.ts +++ b/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.ts @@ -3708,9 +3708,8 @@ export class SecurityCenterClient { * @returns {Promise} A promise that resolves when the client is closed. */ close(): Promise { - this.initialize(); - if (!this._terminated) { - return this.securityCenterStub!.then(stub => { + if (this.securityCenterStub && !this._terminated) { + return this.securityCenterStub.then(stub => { this._terminated = true; stub.close(); this.operationsClient.close(); diff --git a/packages/google-cloud-securitycenter/src/v1p1beta1/security_center_client.ts b/packages/google-cloud-securitycenter/src/v1p1beta1/security_center_client.ts index 06f5da83e8c..341ee5cc427 100644 --- a/packages/google-cloud-securitycenter/src/v1p1beta1/security_center_client.ts +++ b/packages/google-cloud-securitycenter/src/v1p1beta1/security_center_client.ts @@ -5654,9 +5654,8 @@ export class SecurityCenterClient { * @returns {Promise} A promise that resolves when the client is closed. */ close(): Promise { - this.initialize(); - if (!this._terminated) { - return this.securityCenterStub!.then(stub => { + if (this.securityCenterStub && !this._terminated) { + return this.securityCenterStub.then(stub => { this._terminated = true; stub.close(); this.operationsClient.close(); diff --git a/packages/google-cloud-securitycenter/test/gapic_security_center_v1.ts b/packages/google-cloud-securitycenter/test/gapic_security_center_v1.ts index e194308b8e4..6f959226627 100644 --- a/packages/google-cloud-securitycenter/test/gapic_security_center_v1.ts +++ b/packages/google-cloud-securitycenter/test/gapic_security_center_v1.ts @@ -185,12 +185,27 @@ describe('v1.SecurityCenterClient', () => { assert(client.securityCenterStub); }); - it('has close method', () => { + it('has close method for the initialized client', done => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); - client.close(); + client.initialize(); + assert(client.securityCenterStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.securityCenterStub, undefined); + client.close().then(() => { + done(); + }); }); it('has getProjectId method', async () => { @@ -336,6 +351,22 @@ describe('v1.SecurityCenterClient', () => { .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes createSource with closed client', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.CreateSourceRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createSource(request), expectedError); + }); }); describe('createFinding', () => { @@ -447,6 +478,22 @@ describe('v1.SecurityCenterClient', () => { .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes createFinding with closed client', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.CreateFindingRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createFinding(request), expectedError); + }); }); describe('createMuteConfig', () => { @@ -558,6 +605,22 @@ describe('v1.SecurityCenterClient', () => { .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes createMuteConfig with closed client', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.CreateMuteConfigRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createMuteConfig(request), expectedError); + }); }); describe('createNotificationConfig', () => { @@ -673,6 +736,25 @@ describe('v1.SecurityCenterClient', () => { .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes createNotificationConfig with closed client', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.CreateNotificationConfigRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects( + client.createNotificationConfig(request), + expectedError + ); + }); }); describe('deleteMuteConfig', () => { @@ -784,6 +866,22 @@ describe('v1.SecurityCenterClient', () => { .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes deleteMuteConfig with closed client', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.DeleteMuteConfigRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.deleteMuteConfig(request), expectedError); + }); }); describe('deleteNotificationConfig', () => { @@ -899,6 +997,25 @@ describe('v1.SecurityCenterClient', () => { .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes deleteNotificationConfig with closed client', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.DeleteNotificationConfigRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects( + client.deleteNotificationConfig(request), + expectedError + ); + }); }); describe('getIamPolicy', () => { @@ -1010,6 +1127,22 @@ describe('v1.SecurityCenterClient', () => { .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes getIamPolicy with closed client', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getIamPolicy(request), expectedError); + }); }); describe('getMuteConfig', () => { @@ -1121,6 +1254,22 @@ describe('v1.SecurityCenterClient', () => { .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes getMuteConfig with closed client', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GetMuteConfigRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getMuteConfig(request), expectedError); + }); }); describe('getNotificationConfig', () => { @@ -1236,6 +1385,25 @@ describe('v1.SecurityCenterClient', () => { .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes getNotificationConfig with closed client', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GetNotificationConfigRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects( + client.getNotificationConfig(request), + expectedError + ); + }); }); describe('getOrganizationSettings', () => { @@ -1351,6 +1519,25 @@ describe('v1.SecurityCenterClient', () => { .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes getOrganizationSettings with closed client', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GetOrganizationSettingsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects( + client.getOrganizationSettings(request), + expectedError + ); + }); }); describe('getSource', () => { @@ -1459,6 +1646,22 @@ describe('v1.SecurityCenterClient', () => { .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes getSource with closed client', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GetSourceRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getSource(request), expectedError); + }); }); describe('setFindingState', () => { @@ -1570,6 +1773,22 @@ describe('v1.SecurityCenterClient', () => { .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes setFindingState with closed client', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.SetFindingStateRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.setFindingState(request), expectedError); + }); }); describe('setMute', () => { @@ -1678,6 +1897,22 @@ describe('v1.SecurityCenterClient', () => { .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes setMute with closed client', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.SetMuteRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.setMute(request), expectedError); + }); }); describe('setIamPolicy', () => { @@ -1789,6 +2024,22 @@ describe('v1.SecurityCenterClient', () => { .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes setIamPolicy with closed client', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.setIamPolicy(request), expectedError); + }); }); describe('testIamPermissions', () => { @@ -1901,6 +2152,22 @@ describe('v1.SecurityCenterClient', () => { .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes testIamPermissions with closed client', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.testIamPermissions(request), expectedError); + }); }); describe('updateExternalSystem', () => { @@ -2016,6 +2283,23 @@ describe('v1.SecurityCenterClient', () => { .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes updateExternalSystem with closed client', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.UpdateExternalSystemRequest() + ); + request.externalSystem = {}; + request.externalSystem.name = ''; + const expectedHeaderRequestParams = 'external_system.name='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateExternalSystem(request), expectedError); + }); }); describe('updateFinding', () => { @@ -2130,6 +2414,23 @@ describe('v1.SecurityCenterClient', () => { .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes updateFinding with closed client', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.UpdateFindingRequest() + ); + request.finding = {}; + request.finding.name = ''; + const expectedHeaderRequestParams = 'finding.name='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateFinding(request), expectedError); + }); }); describe('updateMuteConfig', () => { @@ -2244,6 +2545,23 @@ describe('v1.SecurityCenterClient', () => { .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes updateMuteConfig with closed client', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.UpdateMuteConfigRequest() + ); + request.muteConfig = {}; + request.muteConfig.name = ''; + const expectedHeaderRequestParams = 'mute_config.name='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateMuteConfig(request), expectedError); + }); }); describe('updateNotificationConfig', () => { @@ -2362,6 +2680,26 @@ describe('v1.SecurityCenterClient', () => { .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes updateNotificationConfig with closed client', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.UpdateNotificationConfigRequest() + ); + request.notificationConfig = {}; + request.notificationConfig.name = ''; + const expectedHeaderRequestParams = 'notification_config.name='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects( + client.updateNotificationConfig(request), + expectedError + ); + }); }); describe('updateOrganizationSettings', () => { @@ -2480,6 +2818,26 @@ describe('v1.SecurityCenterClient', () => { .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes updateOrganizationSettings with closed client', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest() + ); + request.organizationSettings = {}; + request.organizationSettings.name = ''; + const expectedHeaderRequestParams = 'organization_settings.name='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects( + client.updateOrganizationSettings(request), + expectedError + ); + }); }); describe('updateSource', () => { @@ -2594,6 +2952,23 @@ describe('v1.SecurityCenterClient', () => { .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes updateSource with closed client', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.UpdateSourceRequest() + ); + request.source = {}; + request.source.name = ''; + const expectedHeaderRequestParams = 'source.name='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateSource(request), expectedError); + }); }); describe('updateSecurityMarks', () => { @@ -2709,6 +3084,23 @@ describe('v1.SecurityCenterClient', () => { .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes updateSecurityMarks with closed client', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.UpdateSecurityMarksRequest() + ); + request.securityMarks = {}; + request.securityMarks.name = ''; + const expectedHeaderRequestParams = 'security_marks.name='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateSecurityMarks(request), expectedError); + }); }); describe('bulkMuteFindings', () => { diff --git a/packages/google-cloud-securitycenter/test/gapic_security_center_v1beta1.ts b/packages/google-cloud-securitycenter/test/gapic_security_center_v1beta1.ts index 731bfab577a..5c817221afa 100644 --- a/packages/google-cloud-securitycenter/test/gapic_security_center_v1beta1.ts +++ b/packages/google-cloud-securitycenter/test/gapic_security_center_v1beta1.ts @@ -185,12 +185,27 @@ describe('v1beta1.SecurityCenterClient', () => { assert(client.securityCenterStub); }); - it('has close method', () => { + it('has close method for the initialized client', done => { const client = new securitycenterModule.v1beta1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); - client.close(); + client.initialize(); + assert(client.securityCenterStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.securityCenterStub, undefined); + client.close().then(() => { + done(); + }); }); it('has getProjectId method', async () => { @@ -336,6 +351,22 @@ describe('v1beta1.SecurityCenterClient', () => { .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes createSource with closed client', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.CreateSourceRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createSource(request), expectedError); + }); }); describe('createFinding', () => { @@ -447,6 +478,22 @@ describe('v1beta1.SecurityCenterClient', () => { .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes createFinding with closed client', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.CreateFindingRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createFinding(request), expectedError); + }); }); describe('getIamPolicy', () => { @@ -558,6 +605,22 @@ describe('v1beta1.SecurityCenterClient', () => { .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes getIamPolicy with closed client', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getIamPolicy(request), expectedError); + }); }); describe('getOrganizationSettings', () => { @@ -673,6 +736,25 @@ describe('v1beta1.SecurityCenterClient', () => { .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes getOrganizationSettings with closed client', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects( + client.getOrganizationSettings(request), + expectedError + ); + }); }); describe('getSource', () => { @@ -781,6 +863,22 @@ describe('v1beta1.SecurityCenterClient', () => { .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes getSource with closed client', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.GetSourceRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getSource(request), expectedError); + }); }); describe('setFindingState', () => { @@ -892,6 +990,22 @@ describe('v1beta1.SecurityCenterClient', () => { .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes setFindingState with closed client', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.SetFindingStateRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.setFindingState(request), expectedError); + }); }); describe('setIamPolicy', () => { @@ -1003,6 +1117,22 @@ describe('v1beta1.SecurityCenterClient', () => { .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes setIamPolicy with closed client', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.setIamPolicy(request), expectedError); + }); }); describe('testIamPermissions', () => { @@ -1115,6 +1245,22 @@ describe('v1beta1.SecurityCenterClient', () => { .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes testIamPermissions with closed client', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.testIamPermissions(request), expectedError); + }); }); describe('updateFinding', () => { @@ -1229,6 +1375,23 @@ describe('v1beta1.SecurityCenterClient', () => { .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes updateFinding with closed client', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.UpdateFindingRequest() + ); + request.finding = {}; + request.finding.name = ''; + const expectedHeaderRequestParams = 'finding.name='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateFinding(request), expectedError); + }); }); describe('updateOrganizationSettings', () => { @@ -1347,6 +1510,26 @@ describe('v1beta1.SecurityCenterClient', () => { .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes updateOrganizationSettings with closed client', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest() + ); + request.organizationSettings = {}; + request.organizationSettings.name = ''; + const expectedHeaderRequestParams = 'organization_settings.name='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects( + client.updateOrganizationSettings(request), + expectedError + ); + }); }); describe('updateSource', () => { @@ -1461,6 +1644,23 @@ describe('v1beta1.SecurityCenterClient', () => { .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes updateSource with closed client', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.UpdateSourceRequest() + ); + request.source = {}; + request.source.name = ''; + const expectedHeaderRequestParams = 'source.name='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateSource(request), expectedError); + }); }); describe('updateSecurityMarks', () => { @@ -1576,6 +1776,23 @@ describe('v1beta1.SecurityCenterClient', () => { .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes updateSecurityMarks with closed client', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest() + ); + request.securityMarks = {}; + request.securityMarks.name = ''; + const expectedHeaderRequestParams = 'security_marks.name='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateSecurityMarks(request), expectedError); + }); }); describe('runAssetDiscovery', () => { diff --git a/packages/google-cloud-securitycenter/test/gapic_security_center_v1p1beta1.ts b/packages/google-cloud-securitycenter/test/gapic_security_center_v1p1beta1.ts index 8997345277c..c9ecc169a0f 100644 --- a/packages/google-cloud-securitycenter/test/gapic_security_center_v1p1beta1.ts +++ b/packages/google-cloud-securitycenter/test/gapic_security_center_v1p1beta1.ts @@ -185,12 +185,27 @@ describe('v1p1beta1.SecurityCenterClient', () => { assert(client.securityCenterStub); }); - it('has close method', () => { + it('has close method for the initialized client', done => { const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); - client.close(); + client.initialize(); + assert(client.securityCenterStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.securityCenterStub, undefined); + client.close().then(() => { + done(); + }); }); it('has getProjectId method', async () => { @@ -336,6 +351,22 @@ describe('v1p1beta1.SecurityCenterClient', () => { .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes createSource with closed client', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.CreateSourceRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createSource(request), expectedError); + }); }); describe('createFinding', () => { @@ -447,6 +478,22 @@ describe('v1p1beta1.SecurityCenterClient', () => { .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes createFinding with closed client', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.CreateFindingRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createFinding(request), expectedError); + }); }); describe('createNotificationConfig', () => { @@ -562,6 +609,25 @@ describe('v1p1beta1.SecurityCenterClient', () => { .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes createNotificationConfig with closed client', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.CreateNotificationConfigRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects( + client.createNotificationConfig(request), + expectedError + ); + }); }); describe('deleteNotificationConfig', () => { @@ -677,6 +743,25 @@ describe('v1p1beta1.SecurityCenterClient', () => { .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes deleteNotificationConfig with closed client', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.DeleteNotificationConfigRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects( + client.deleteNotificationConfig(request), + expectedError + ); + }); }); describe('getIamPolicy', () => { @@ -788,6 +873,22 @@ describe('v1p1beta1.SecurityCenterClient', () => { .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes getIamPolicy with closed client', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getIamPolicy(request), expectedError); + }); }); describe('getNotificationConfig', () => { @@ -903,6 +1004,25 @@ describe('v1p1beta1.SecurityCenterClient', () => { .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes getNotificationConfig with closed client', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.GetNotificationConfigRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects( + client.getNotificationConfig(request), + expectedError + ); + }); }); describe('getOrganizationSettings', () => { @@ -1018,6 +1138,25 @@ describe('v1p1beta1.SecurityCenterClient', () => { .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes getOrganizationSettings with closed client', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.GetOrganizationSettingsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects( + client.getOrganizationSettings(request), + expectedError + ); + }); }); describe('getSource', () => { @@ -1126,6 +1265,22 @@ describe('v1p1beta1.SecurityCenterClient', () => { .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes getSource with closed client', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.GetSourceRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getSource(request), expectedError); + }); }); describe('setFindingState', () => { @@ -1237,6 +1392,22 @@ describe('v1p1beta1.SecurityCenterClient', () => { .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes setFindingState with closed client', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.setFindingState(request), expectedError); + }); }); describe('setIamPolicy', () => { @@ -1348,6 +1519,22 @@ describe('v1p1beta1.SecurityCenterClient', () => { .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes setIamPolicy with closed client', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.setIamPolicy(request), expectedError); + }); }); describe('testIamPermissions', () => { @@ -1460,6 +1647,22 @@ describe('v1p1beta1.SecurityCenterClient', () => { .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes testIamPermissions with closed client', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.testIamPermissions(request), expectedError); + }); }); describe('updateFinding', () => { @@ -1574,6 +1777,23 @@ describe('v1p1beta1.SecurityCenterClient', () => { .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes updateFinding with closed client', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.UpdateFindingRequest() + ); + request.finding = {}; + request.finding.name = ''; + const expectedHeaderRequestParams = 'finding.name='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateFinding(request), expectedError); + }); }); describe('updateNotificationConfig', () => { @@ -1692,6 +1912,26 @@ describe('v1p1beta1.SecurityCenterClient', () => { .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes updateNotificationConfig with closed client', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest() + ); + request.notificationConfig = {}; + request.notificationConfig.name = ''; + const expectedHeaderRequestParams = 'notification_config.name='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects( + client.updateNotificationConfig(request), + expectedError + ); + }); }); describe('updateOrganizationSettings', () => { @@ -1810,6 +2050,26 @@ describe('v1p1beta1.SecurityCenterClient', () => { .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes updateOrganizationSettings with closed client', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest() + ); + request.organizationSettings = {}; + request.organizationSettings.name = ''; + const expectedHeaderRequestParams = 'organization_settings.name='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects( + client.updateOrganizationSettings(request), + expectedError + ); + }); }); describe('updateSource', () => { @@ -1924,6 +2184,23 @@ describe('v1p1beta1.SecurityCenterClient', () => { .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes updateSource with closed client', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.UpdateSourceRequest() + ); + request.source = {}; + request.source.name = ''; + const expectedHeaderRequestParams = 'source.name='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateSource(request), expectedError); + }); }); describe('updateSecurityMarks', () => { @@ -2039,6 +2316,23 @@ describe('v1p1beta1.SecurityCenterClient', () => { .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes updateSecurityMarks with closed client', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest() + ); + request.securityMarks = {}; + request.securityMarks.name = ''; + const expectedHeaderRequestParams = 'security_marks.name='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateSecurityMarks(request), expectedError); + }); }); describe('runAssetDiscovery', () => { From 4caf4d067c525dd50a11354ff16dfada31d34240 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Tue, 22 Feb 2022 18:00:59 +0000 Subject: [PATCH 304/342] chore: remove unused proto imports (#463) - [ ] Regenerate this pull request now. PiperOrigin-RevId: 429755954 Source-Link: https://github.com/googleapis/googleapis/commit/f19466bdfd2c544a1a286ad111b64a6ab430a237 Source-Link: https://github.com/googleapis/googleapis-gen/commit/84aed4f7cbcd63d999e152fc9da18d8330229ccf Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiODRhZWQ0ZjdjYmNkNjNkOTk5ZTE1MmZjOWRhMThkODMzMDIyOWNjZiJ9 --- .../protos/google/cloud/securitycenter/v1/asset.proto | 1 - .../protos/google/cloud/securitycenter/v1/external_system.proto | 1 - .../protos/google/cloud/securitycenter/v1/finding.proto | 1 - .../protos/google/cloud/securitycenter/v1/folder.proto | 2 -- .../protos/google/cloud/securitycenter/v1/indicator.proto | 2 -- .../protos/google/cloud/securitycenter/v1/mute_config.proto | 1 - .../google/cloud/securitycenter/v1/notification_config.proto | 1 - .../google/cloud/securitycenter/v1/notification_message.proto | 1 - .../google/cloud/securitycenter/v1/organization_settings.proto | 1 - .../protos/google/cloud/securitycenter/v1/resource.proto | 1 - .../cloud/securitycenter/v1/run_asset_discovery_response.proto | 1 - .../protos/google/cloud/securitycenter/v1/security_marks.proto | 1 - .../protos/google/cloud/securitycenter/v1/source.proto | 1 - .../protos/google/cloud/securitycenter/v1/vulnerability.proto | 2 -- 14 files changed, 17 deletions(-) diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/asset.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/asset.proto index 3821cce77ab..55ba5641a09 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/asset.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/asset.proto @@ -21,7 +21,6 @@ import "google/cloud/securitycenter/v1/folder.proto"; import "google/cloud/securitycenter/v1/security_marks.proto"; import "google/protobuf/struct.proto"; import "google/protobuf/timestamp.proto"; -import "google/api/annotations.proto"; option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1;securitycenter"; diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/external_system.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/external_system.proto index 830a56b3213..78a7d65fea6 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/external_system.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/external_system.proto @@ -18,7 +18,6 @@ package google.cloud.securitycenter.v1; import "google/api/resource.proto"; import "google/protobuf/timestamp.proto"; -import "google/api/annotations.proto"; option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1;securitycenter"; diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/finding.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/finding.proto index 883b1e104f7..b3525f007d9 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/finding.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/finding.proto @@ -16,7 +16,6 @@ syntax = "proto3"; package google.cloud.securitycenter.v1; -import "google/api/annotations.proto"; import "google/api/field_behavior.proto"; import "google/api/resource.proto"; import "google/cloud/securitycenter/v1/access.proto"; diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/folder.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/folder.proto index 8afd9753669..4078a527b33 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/folder.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/folder.proto @@ -16,8 +16,6 @@ syntax = "proto3"; package google.cloud.securitycenter.v1; -import "google/api/annotations.proto"; - option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1;securitycenter"; option java_multiple_files = true; diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/indicator.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/indicator.proto index 336f72dd62f..067ddb1638f 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/indicator.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/indicator.proto @@ -16,8 +16,6 @@ syntax = "proto3"; package google.cloud.securitycenter.v1; -import "google/api/annotations.proto"; - option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1;securitycenter"; option java_multiple_files = true; option java_outer_classname = "IndicatorProto"; diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/mute_config.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/mute_config.proto index d528bcabb12..74426957b7c 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/mute_config.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/mute_config.proto @@ -19,7 +19,6 @@ package google.cloud.securitycenter.v1; import "google/api/field_behavior.proto"; import "google/api/resource.proto"; import "google/protobuf/timestamp.proto"; -import "google/api/annotations.proto"; option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1;securitycenter"; diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/notification_config.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/notification_config.proto index 344d1c09086..7ab94662823 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/notification_config.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/notification_config.proto @@ -18,7 +18,6 @@ package google.cloud.securitycenter.v1; import "google/api/field_behavior.proto"; import "google/api/resource.proto"; -import "google/api/annotations.proto"; option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1;securitycenter"; diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/notification_message.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/notification_message.proto index 52bc6d34675..3605dfbefae 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/notification_message.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/notification_message.proto @@ -18,7 +18,6 @@ package google.cloud.securitycenter.v1; import "google/cloud/securitycenter/v1/finding.proto"; import "google/cloud/securitycenter/v1/resource.proto"; -import "google/api/annotations.proto"; option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1;securitycenter"; diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/organization_settings.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/organization_settings.proto index d4131e65dcb..e8bc9687d02 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/organization_settings.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/organization_settings.proto @@ -17,7 +17,6 @@ syntax = "proto3"; package google.cloud.securitycenter.v1; import "google/api/resource.proto"; -import "google/api/annotations.proto"; option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1;securitycenter"; diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/resource.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/resource.proto index b2f78a9597b..46b8372f34c 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/resource.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/resource.proto @@ -18,7 +18,6 @@ package google.cloud.securitycenter.v1; import "google/api/field_behavior.proto"; import "google/cloud/securitycenter/v1/folder.proto"; -import "google/api/annotations.proto"; option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1;securitycenter"; diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/run_asset_discovery_response.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/run_asset_discovery_response.proto index 78c6a6e3b47..70088c06a64 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/run_asset_discovery_response.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/run_asset_discovery_response.proto @@ -17,7 +17,6 @@ syntax = "proto3"; package google.cloud.securitycenter.v1; import "google/protobuf/duration.proto"; -import "google/api/annotations.proto"; option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1;securitycenter"; diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/security_marks.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/security_marks.proto index f4dd753d1b4..15c9769f226 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/security_marks.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/security_marks.proto @@ -17,7 +17,6 @@ syntax = "proto3"; package google.cloud.securitycenter.v1; import "google/api/resource.proto"; -import "google/api/annotations.proto"; option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1;securitycenter"; diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/source.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/source.proto index 61bbfd3b603..75c069a1ccc 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/source.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/source.proto @@ -17,7 +17,6 @@ syntax = "proto3"; package google.cloud.securitycenter.v1; import "google/api/resource.proto"; -import "google/api/annotations.proto"; option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1;securitycenter"; diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/vulnerability.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/vulnerability.proto index fb6b5c1721c..e11784ce321 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/vulnerability.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/vulnerability.proto @@ -16,8 +16,6 @@ syntax = "proto3"; package google.cloud.securitycenter.v1; -import "google/api/annotations.proto"; - option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1;securitycenter"; option java_multiple_files = true; From 0df3e1b18e8295984fca2138638afdf664f8750c Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Wed, 16 Mar 2022 21:34:22 +0000 Subject: [PATCH 305/342] chore: update v2.14.2 gapic-generator-typescript (#467) - [ ] Regenerate this pull request now. Committer: @summer-ji-eng PiperOrigin-RevId: 434859890 Source-Link: https://github.com/googleapis/googleapis/commit/bc2432d50cba657e95212122e3fa112591b5bec2 Source-Link: https://github.com/googleapis/googleapis-gen/commit/930b673103e92523f8cfed38decd7d3afae8ebe7 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiOTMwYjY3MzEwM2U5MjUyM2Y4Y2ZlZDM4ZGVjZDdkM2FmYWU4ZWJlNyJ9 chore: update v2.14.1 gapic-generator-typescript Committer: @summer-ji-eng PiperOrigin-RevId: 433031262 Source-Link: https://github.com/googleapis/googleapis/commit/2a55d13d9dc6cbf99990d1ab490e0ea07b5e7649 Source-Link: https://github.com/googleapis/googleapis-gen/commit/2fce3893ae9da47763e0872c4a3a87d9ff78771f Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMmZjZTM4OTNhZTlkYTQ3NzYzZTA4NzJjNGEzYTg3ZDlmZjc4NzcxZiJ9 --- .../cloud/securitycenter/v1/access.proto | 2 - .../securitycenter/v1/bigquery_export.proto | 101 + .../cloud/securitycenter/v1/finding.proto | 18 +- .../securitycenter/v1/mitre_attack.proto | 190 + .../v1/securitycenter_service.proto | 345 +- .../securitycenter/v1/vulnerability.proto | 3 + .../protos/protos.d.ts | 1859 ++++-- .../protos/protos.js | 5057 +++++++++++++---- .../protos/protos.json | 565 +- .../v1/security_center.bulk_mute_findings.js | 4 +- ...security_center.create_big_query_export.js | 73 + .../v1/security_center.create_finding.js | 4 +- ...urity_center.create_notification_config.js | 9 +- .../v1/security_center.create_source.js | 4 +- ...security_center.delete_big_query_export.js | 61 + .../security_center.get_big_query_export.js | 61 + ...curity_center.get_organization_settings.js | 4 +- .../v1/security_center.group_assets.js | 6 +- .../v1/security_center.group_findings.js | 6 +- .../security_center.list_big_query_exports.js | 76 + .../v1/security_center.list_mute_configs.js | 4 +- .../v1/security_center.list_sources.js | 4 +- .../v1/security_center.run_asset_discovery.js | 4 +- ...security_center.update_big_query_export.js | 63 + .../v1/security_center.update_finding.js | 4 +- ...tadata.google.cloud.securitycenter.v1.json | 222 +- .../src/v1/gapic_metadata.json | 54 + .../src/v1/security_center_client.ts | 925 ++- .../src/v1/security_center_client_config.json | 20 + .../src/v1/security_center_proto_list.json | 2 + .../test/gapic_security_center_v1.ts | 2429 +++++--- .../test/gapic_security_center_v1beta1.ts | 12 - .../test/gapic_security_center_v1p1beta1.ts | 16 - 33 files changed, 9580 insertions(+), 2627 deletions(-) create mode 100644 packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/bigquery_export.proto create mode 100644 packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/mitre_attack.proto create mode 100644 packages/google-cloud-securitycenter/samples/generated/v1/security_center.create_big_query_export.js create mode 100644 packages/google-cloud-securitycenter/samples/generated/v1/security_center.delete_big_query_export.js create mode 100644 packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_big_query_export.js create mode 100644 packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_big_query_exports.js create mode 100644 packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_big_query_export.js diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/access.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/access.proto index 851927d9d5c..85c8d729400 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/access.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/access.proto @@ -16,8 +16,6 @@ syntax = "proto3"; package google.cloud.securitycenter.v1; -import "google/api/annotations.proto"; - option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1;securitycenter"; option java_multiple_files = true; option java_outer_classname = "AccessProto"; diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/bigquery_export.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/bigquery_export.proto new file mode 100644 index 00000000000..51bf353ba83 --- /dev/null +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/bigquery_export.proto @@ -0,0 +1,101 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// 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.cloud.securitycenter.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1;securitycenter"; +option java_multiple_files = true; +option java_outer_classname = "BigQueryExportProto"; +option java_package = "com.google.cloud.securitycenter.v1"; +option php_namespace = "Google\\Cloud\\SecurityCenter\\V1"; +option ruby_package = "Google::Cloud::SecurityCenter::V1"; + +// Configures how to deliver Findings to BigQuery Instance. +message BigQueryExport { + option (google.api.resource) = { + type: "securitycenter.googleapis.com/BigQueryExport" + pattern: "organizations/{organization}/bigQueryExports/{export}" + pattern: "folders/{folder}/bigQueryExports/{export}" + pattern: "projects/{project}/bigQueryExports/{export}" + }; + + // The relative resource name of this export. See: + // https://cloud.google.com/apis/design/resource_names#relative_resource_name. + // Example format: + // "organizations/{organization_id}/bigQueryExports/{export_id}" Example + // format: "folders/{folder_id}/bigQueryExports/{export_id}" Example format: + // "projects/{project_id}/bigQueryExports/{export_id}" + // This field is provided in responses, and is ignored when provided in create + // requests. + string name = 1; + + // The description of the export (max of 1024 characters). + string description = 2; + + // Expression that defines the filter to apply across create/update events + // of findings. The expression is a list of zero or more restrictions combined + // via logical operators `AND` and `OR`. Parentheses are supported, and `OR` + // has higher precedence than `AND`. + // + // Restrictions have the form ` ` and may have a + // `-` character in front of them to indicate negation. The fields map to + // those defined in the corresponding resource. + // + // The supported operators are: + // + // * `=` for all value types. + // * `>`, `<`, `>=`, `<=` for integer values. + // * `:`, meaning substring matching, for strings. + // + // The supported value types are: + // + // * string literals in quotes. + // * integer literals without quotes. + // * boolean literals `true` and `false` without quotes. + string filter = 3; + + // The dataset to write findings' updates to. Its format is + // "projects/[project_id]/datasets/[bigquery_dataset_id]". + // BigQuery Dataset unique ID must contain only letters (a-z, A-Z), numbers + // (0-9), or underscores (_). + string dataset = 4; + + // Output only. The time at which the big query export was created. + // This field is set by the server and will be ignored if provided on export + // on creation. + google.protobuf.Timestamp create_time = 5 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The most recent time at which the big export was updated. + // This field is set by the server and will be ignored if provided on export + // creation or update. + google.protobuf.Timestamp update_time = 6 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Email address of the user who last edited the big query + // export. This field is set by the server and will be ignored if provided on + // export creation or update. + string most_recent_editor = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The service account that needs permission to create table, + // upload data to the big query dataset. + string principal = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/finding.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/finding.proto index b3525f007d9..105b4d04b5c 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/finding.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/finding.proto @@ -21,6 +21,7 @@ import "google/api/resource.proto"; import "google/cloud/securitycenter/v1/access.proto"; import "google/cloud/securitycenter/v1/external_system.proto"; import "google/cloud/securitycenter/v1/indicator.proto"; +import "google/cloud/securitycenter/v1/mitre_attack.proto"; import "google/cloud/securitycenter/v1/security_marks.proto"; import "google/cloud/securitycenter/v1/vulnerability.proto"; import "google/protobuf/struct.proto"; @@ -153,6 +154,9 @@ message Finding { // Describes a security observation that is for informational purposes. OBSERVATION = 4; + + // Describes an error that prevents some SCC functionality. + SCC_ERROR = 5; } // The relative resource name of this finding. See: @@ -245,11 +249,17 @@ message Finding { Vulnerability vulnerability = 20; // Output only. The most recent time this finding was muted or unmuted. - google.protobuf.Timestamp mute_update_time = 21 [(google.api.field_behavior) = OUTPUT_ONLY]; + google.protobuf.Timestamp mute_update_time = 21 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Third party SIEM/SOAR fields within SCC, contains external + // system information and external system finding fields. + map external_systems = 22 + [(google.api.field_behavior) = OUTPUT_ONLY]; - // Output only. Third party SIEM/SOAR fields within SCC, contains external system - // information and external system finding fields. - map external_systems = 22 [(google.api.field_behavior) = OUTPUT_ONLY]; + // MITRE ATT&CK tactics and techniques related to this finding. + // See: https://attack.mitre.org + MitreAttack mitre_attack = 25; // Access details associated to the Finding, such as more information on the // caller, which method was accessed, from where, etc. diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/mitre_attack.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/mitre_attack.proto new file mode 100644 index 00000000000..03767cac719 --- /dev/null +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/mitre_attack.proto @@ -0,0 +1,190 @@ +// 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.cloud.securitycenter.v1; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1;securitycenter"; +option java_multiple_files = true; +option java_outer_classname = "MitreAttackProto"; +option java_package = "com.google.cloud.securitycenter.v1"; +option php_namespace = "Google\\Cloud\\SecurityCenter\\V1"; +option ruby_package = "Google::Cloud::SecurityCenter::V1"; + +// MITRE ATT&CK tactics and techniques related to this finding. +// See: https://attack.mitre.org +message MitreAttack { + // MITRE ATT&CK tactics that can be referenced by SCC findings. + // See: https://attack.mitre.org/tactics/enterprise/ + enum Tactic { + // Unspecified value. + TACTIC_UNSPECIFIED = 0; + + // TA0043 + RECONNAISSANCE = 1; + + // TA0042 + RESOURCE_DEVELOPMENT = 2; + + // TA0001 + INITIAL_ACCESS = 5; + + // TA0002 + EXECUTION = 3; + + // TA0003 + PERSISTENCE = 6; + + // TA0004 + PRIVILEGE_ESCALATION = 8; + + // TA0005 + DEFENSE_EVASION = 7; + + // TA0006 + CREDENTIAL_ACCESS = 9; + + // TA0007 + DISCOVERY = 10; + + // TA0008 + LATERAL_MOVEMENT = 11; + + // TA0009 + COLLECTION = 12; + + // TA0011 + COMMAND_AND_CONTROL = 4; + + // TA0010 + EXFILTRATION = 13; + + // TA0040 + IMPACT = 14; + } + + // MITRE ATT&CK techniques that can be referenced by SCC findings. + // See: https://attack.mitre.org/techniques/enterprise/ + enum Technique { + // Unspecified value. + TECHNIQUE_UNSPECIFIED = 0; + + // T1595 + ACTIVE_SCANNING = 1; + + // T1595.001 + SCANNING_IP_BLOCKS = 2; + + // T1105 + INGRESS_TOOL_TRANSFER = 3; + + // T1106 + NATIVE_API = 4; + + // T1129 + SHARED_MODULES = 5; + + // T1059 + COMMAND_AND_SCRIPTING_INTERPRETER = 6; + + // T1059.004 + UNIX_SHELL = 7; + + // T1496 + RESOURCE_HIJACKING = 8; + + // T1090 + PROXY = 9; + + // T1090.002 + EXTERNAL_PROXY = 10; + + // T1090.003 + MULTI_HOP_PROXY = 11; + + // T1568 + DYNAMIC_RESOLUTION = 12; + + // T1552 + UNSECURED_CREDENTIALS = 13; + + // T1078 + VALID_ACCOUNTS = 14; + + // T1078.003 + LOCAL_ACCOUNTS = 15; + + // T1078.004 + CLOUD_ACCOUNTS = 16; + + // T1498 + NETWORK_DENIAL_OF_SERVICE = 17; + + // T1069 + PERMISSION_GROUPS_DISCOVERY = 18; + + // T1069.003 + CLOUD_GROUPS = 19; + + // T1567 + EXFILTRATION_OVER_WEB_SERVICE = 20; + + // T1567.002 + EXFILTRATION_TO_CLOUD_STORAGE = 21; + + // T1098 + ACCOUNT_MANIPULATION = 22; + + // T1098.004 + SSH_AUTHORIZED_KEYS = 23; + + // T1543 + CREATE_OR_MODIFY_SYSTEM_PROCESS = 24; + + // T1539 + STEAL_WEB_SESSION_COOKIE = 25; + + // T1578 + MODIFY_CLOUD_COMPUTE_INFRASTRUCTURE = 26; + + // T1190 + EXPLOIT_PUBLIC_FACING_APPLICATION = 27; + + // T1556 + MODIFY_AUTHENTICATION_PROCESS = 28; + } + + // The MITRE ATT&CK tactic most closely represented by this finding, if any. + Tactic primary_tactic = 1; + + // The MITRE ATT&CK technique most closely represented by this finding, if + // any. primary_techniques is a repeated field because there are multiple + // levels of MITRE ATT&CK techniques. If the technique most closely + // represented by this finding is a sub-technique (e.g. `SCANNING_IP_BLOCKS`), + // both the sub-technique and its parent technique(s) will be listed (e.g. + // `SCANNING_IP_BLOCKS`, `ACTIVE_SCANNING`). + repeated Technique primary_techniques = 2; + + // Additional MITRE ATT&CK tactics related to this finding, if any. + repeated Tactic additional_tactics = 3; + + // Additional MITRE ATT&CK techniques related to this finding, if any, along + // with any of their respective parent techniques. + repeated Technique additional_techniques = 4; + + // The MITRE ATT&CK version referenced by the above fields. E.g. "8". + string version = 5; +} diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/securitycenter_service.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/securitycenter_service.proto index 67a3509c569..99aa8adab0c 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/securitycenter_service.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/securitycenter_service.proto @@ -16,18 +16,20 @@ syntax = "proto3"; package google.cloud.securitycenter.v1; +import public "google/cloud/securitycenter/v1/run_asset_discovery_response.proto"; + import "google/api/annotations.proto"; import "google/api/client.proto"; import "google/api/field_behavior.proto"; import "google/api/resource.proto"; import "google/cloud/securitycenter/v1/asset.proto"; +import "google/cloud/securitycenter/v1/bigquery_export.proto"; import "google/cloud/securitycenter/v1/external_system.proto"; import "google/cloud/securitycenter/v1/finding.proto"; import "google/cloud/securitycenter/v1/folder.proto"; import "google/cloud/securitycenter/v1/mute_config.proto"; import "google/cloud/securitycenter/v1/notification_config.proto"; import "google/cloud/securitycenter/v1/organization_settings.proto"; -import public "google/cloud/securitycenter/v1/run_asset_discovery_response.proto"; import "google/cloud/securitycenter/v1/security_marks.proto"; import "google/cloud/securitycenter/v1/source.proto"; import "google/iam/v1/iam_policy.proto"; @@ -49,12 +51,14 @@ option ruby_package = "Google::Cloud::SecurityCenter::V1"; // V1 APIs for Security Center service. service SecurityCenter { option (google.api.default_host) = "securitycenter.googleapis.com"; - option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; // Kicks off an LRO to bulk mute findings for a parent based on a filter. The // parent can be either an organization, folder or project. The findings // matched by the filter will be muted after the LRO is done. - rpc BulkMuteFindings(BulkMuteFindingsRequest) returns (google.longrunning.Operation) { + rpc BulkMuteFindings(BulkMuteFindingsRequest) + returns (google.longrunning.Operation) { option (google.api.http) = { post: "/v1/{parent=organizations/*}/findings:bulkMute" body: "*" @@ -112,39 +116,50 @@ service SecurityCenter { } // Creates a notification config. - rpc CreateNotificationConfig(CreateNotificationConfigRequest) returns (NotificationConfig) { + rpc CreateNotificationConfig(CreateNotificationConfigRequest) + returns (NotificationConfig) { option (google.api.http) = { post: "/v1/{parent=organizations/*}/notificationConfigs" body: "notification_config" }; - option (google.api.method_signature) = "parent,config_id,notification_config"; + option (google.api.method_signature) = + "parent,config_id,notification_config"; option (google.api.method_signature) = "parent,notification_config"; } // Deletes an existing mute config. - rpc DeleteMuteConfig(DeleteMuteConfigRequest) returns (google.protobuf.Empty) { + rpc DeleteMuteConfig(DeleteMuteConfigRequest) + returns (google.protobuf.Empty) { option (google.api.http) = { delete: "/v1/{name=organizations/*/muteConfigs/*}" - additional_bindings { - delete: "/v1/{name=folders/*/muteConfigs/*}" - } - additional_bindings { - delete: "/v1/{name=projects/*/muteConfigs/*}" - } + additional_bindings { delete: "/v1/{name=folders/*/muteConfigs/*}" } + additional_bindings { delete: "/v1/{name=projects/*/muteConfigs/*}" } }; option (google.api.method_signature) = "name"; } // Deletes a notification config. - rpc DeleteNotificationConfig(DeleteNotificationConfigRequest) returns (google.protobuf.Empty) { + rpc DeleteNotificationConfig(DeleteNotificationConfigRequest) + returns (google.protobuf.Empty) { option (google.api.http) = { delete: "/v1/{name=organizations/*/notificationConfigs/*}" }; option (google.api.method_signature) = "name"; } + // Gets a big query export. + rpc GetBigQueryExport(GetBigQueryExportRequest) returns (BigQueryExport) { + option (google.api.http) = { + get: "/v1/{name=organizations/*/bigQueryExports/*}" + additional_bindings { get: "/v1/{name=folders/*/bigQueryExports/*}" } + additional_bindings { get: "/v1/{name=projects/*/bigQueryExports/*}" } + }; + option (google.api.method_signature) = "name"; + } + // Gets the access control policy on the specified Source. - rpc GetIamPolicy(google.iam.v1.GetIamPolicyRequest) returns (google.iam.v1.Policy) { + rpc GetIamPolicy(google.iam.v1.GetIamPolicyRequest) + returns (google.iam.v1.Policy) { option (google.api.http) = { post: "/v1/{resource=organizations/*/sources/*}:getIamPolicy" body: "*" @@ -156,18 +171,15 @@ service SecurityCenter { rpc GetMuteConfig(GetMuteConfigRequest) returns (MuteConfig) { option (google.api.http) = { get: "/v1/{name=organizations/*/muteConfigs/*}" - additional_bindings { - get: "/v1/{name=folders/*/muteConfigs/*}" - } - additional_bindings { - get: "/v1/{name=projects/*/muteConfigs/*}" - } + additional_bindings { get: "/v1/{name=folders/*/muteConfigs/*}" } + additional_bindings { get: "/v1/{name=projects/*/muteConfigs/*}" } }; option (google.api.method_signature) = "name"; } // Gets a notification config. - rpc GetNotificationConfig(GetNotificationConfigRequest) returns (NotificationConfig) { + rpc GetNotificationConfig(GetNotificationConfigRequest) + returns (NotificationConfig) { option (google.api.http) = { get: "/v1/{name=organizations/*/notificationConfigs/*}" }; @@ -175,7 +187,8 @@ service SecurityCenter { } // Gets the settings for an organization. - rpc GetOrganizationSettings(GetOrganizationSettingsRequest) returns (OrganizationSettings) { + rpc GetOrganizationSettings(GetOrganizationSettingsRequest) + returns (OrganizationSettings) { option (google.api.http) = { get: "/v1/{name=organizations/*/organizationSettings}" }; @@ -234,12 +247,8 @@ service SecurityCenter { rpc ListAssets(ListAssetsRequest) returns (ListAssetsResponse) { option (google.api.http) = { get: "/v1/{parent=organizations/*}/assets" - additional_bindings { - get: "/v1/{parent=folders/*}/assets" - } - additional_bindings { - get: "/v1/{parent=projects/*}/assets" - } + additional_bindings { get: "/v1/{parent=folders/*}/assets" } + additional_bindings { get: "/v1/{parent=projects/*}/assets" } }; } @@ -250,31 +259,25 @@ service SecurityCenter { rpc ListFindings(ListFindingsRequest) returns (ListFindingsResponse) { option (google.api.http) = { get: "/v1/{parent=organizations/*/sources/*}/findings" - additional_bindings { - get: "/v1/{parent=folders/*/sources/*}/findings" - } - additional_bindings { - get: "/v1/{parent=projects/*/sources/*}/findings" - } + additional_bindings { get: "/v1/{parent=folders/*/sources/*}/findings" } + additional_bindings { get: "/v1/{parent=projects/*/sources/*}/findings" } }; } // Lists mute configs. - rpc ListMuteConfigs(ListMuteConfigsRequest) returns (ListMuteConfigsResponse) { + rpc ListMuteConfigs(ListMuteConfigsRequest) + returns (ListMuteConfigsResponse) { option (google.api.http) = { get: "/v1/{parent=organizations/*}/muteConfigs" - additional_bindings { - get: "/v1/{parent=folders/*}/muteConfigs" - } - additional_bindings { - get: "/v1/{parent=projects/*}/muteConfigs" - } + additional_bindings { get: "/v1/{parent=folders/*}/muteConfigs" } + additional_bindings { get: "/v1/{parent=projects/*}/muteConfigs" } }; option (google.api.method_signature) = "parent"; } // Lists notification configs. - rpc ListNotificationConfigs(ListNotificationConfigsRequest) returns (ListNotificationConfigsResponse) { + rpc ListNotificationConfigs(ListNotificationConfigsRequest) + returns (ListNotificationConfigsResponse) { option (google.api.http) = { get: "/v1/{parent=organizations/*}/notificationConfigs" }; @@ -285,12 +288,8 @@ service SecurityCenter { rpc ListSources(ListSourcesRequest) returns (ListSourcesResponse) { option (google.api.http) = { get: "/v1/{parent=organizations/*}/sources" - additional_bindings { - get: "/v1/{parent=folders/*}/sources" - } - additional_bindings { - get: "/v1/{parent=projects/*}/sources" - } + additional_bindings { get: "/v1/{parent=folders/*}/sources" } + additional_bindings { get: "/v1/{parent=projects/*}/sources" } }; option (google.api.method_signature) = "parent"; } @@ -301,7 +300,8 @@ service SecurityCenter { // This API can only be called with limited frequency for an organization. If // it is called too frequently the caller will receive a TOO_MANY_REQUESTS // error. - rpc RunAssetDiscovery(RunAssetDiscoveryRequest) returns (google.longrunning.Operation) { + rpc RunAssetDiscovery(RunAssetDiscoveryRequest) + returns (google.longrunning.Operation) { option (google.api.http) = { post: "/v1/{parent=organizations/*}/assets:runDiscovery" body: "*" @@ -348,7 +348,8 @@ service SecurityCenter { } // Sets the access control policy on the specified Source. - rpc SetIamPolicy(google.iam.v1.SetIamPolicyRequest) returns (google.iam.v1.Policy) { + rpc SetIamPolicy(google.iam.v1.SetIamPolicyRequest) + returns (google.iam.v1.Policy) { option (google.api.http) = { post: "/v1/{resource=organizations/*/sources/*}:setIamPolicy" body: "*" @@ -357,7 +358,8 @@ service SecurityCenter { } // Returns the permissions that a caller has on the specified source. - rpc TestIamPermissions(google.iam.v1.TestIamPermissionsRequest) returns (google.iam.v1.TestIamPermissionsResponse) { + rpc TestIamPermissions(google.iam.v1.TestIamPermissionsRequest) + returns (google.iam.v1.TestIamPermissionsResponse) { option (google.api.http) = { post: "/v1/{resource=organizations/*/sources/*}:testIamPermissions" body: "*" @@ -366,7 +368,8 @@ service SecurityCenter { } // Updates external system. This is for a given finding. - rpc UpdateExternalSystem(UpdateExternalSystemRequest) returns (ExternalSystem) { + rpc UpdateExternalSystem(UpdateExternalSystemRequest) + returns (ExternalSystem) { option (google.api.http) = { patch: "/v1/{external_system.name=organizations/*/sources/*/findings/*/externalSystems/*}" body: "external_system" @@ -420,7 +423,8 @@ service SecurityCenter { // // Updates a notification config. The following update // fields are allowed: description, pubsub_topic, streaming_config.filter - rpc UpdateNotificationConfig(UpdateNotificationConfigRequest) returns (NotificationConfig) { + rpc UpdateNotificationConfig(UpdateNotificationConfigRequest) + returns (NotificationConfig) { option (google.api.http) = { patch: "/v1/{notification_config.name=organizations/*/notificationConfigs/*}" body: "notification_config" @@ -430,7 +434,8 @@ service SecurityCenter { } // Updates an organization's settings. - rpc UpdateOrganizationSettings(UpdateOrganizationSettingsRequest) returns (OrganizationSettings) { + rpc UpdateOrganizationSettings(UpdateOrganizationSettingsRequest) + returns (OrganizationSettings) { option (google.api.http) = { patch: "/v1/{organization_settings.name=organizations/*/organizationSettings}" body: "organization_settings" @@ -475,6 +480,69 @@ service SecurityCenter { }; option (google.api.method_signature) = "security_marks"; } + + // Creates a big query export. + rpc CreateBigQueryExport(CreateBigQueryExportRequest) + returns (BigQueryExport) { + option (google.api.http) = { + post: "/v1/{parent=organizations/*}/bigQueryExports" + body: "big_query_export" + additional_bindings { + post: "/v1/{parent=folders/*}/bigQueryExports" + body: "big_query_export" + } + additional_bindings { + post: "/v1/{parent=projects/*}/bigQueryExports" + body: "big_query_export" + } + }; + option (google.api.method_signature) = + "parent,big_query_export,big_query_export_id"; + } + + // Deletes an existing big query export. + rpc DeleteBigQueryExport(DeleteBigQueryExportRequest) + returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1/{name=organizations/*/bigQueryExports/*}" + additional_bindings { delete: "/v1/{name=folders/*/bigQueryExports/*}" } + additional_bindings { delete: "/v1/{name=projects/*/bigQueryExports/*}" } + }; + option (google.api.method_signature) = "name"; + } + + // Updates a BigQuery export. + rpc UpdateBigQueryExport(UpdateBigQueryExportRequest) + returns (BigQueryExport) { + option (google.api.http) = { + patch: "/v1/{big_query_export.name=organizations/*/bigQueryExports/*}" + body: "big_query_export" + additional_bindings { + patch: "/v1/{big_query_export.name=folders/*/bigQueryExports/*}" + body: "big_query_export" + } + additional_bindings { + patch: "/v1/{big_query_export.name=projects/*/bigQueryExports/*}" + body: "big_query_export" + } + }; + option (google.api.method_signature) = "big_query_export,update_mask"; + } + + // Lists BigQuery exports. Note that when requesting BigQuery exports at a + // given level all exports under that level are also returned e.g. if + // requesting BigQuery exports under a folder, then all BigQuery exports + // immediately under the folder plus the ones created under the projects + // within the folder are returned. + rpc ListBigQueryExports(ListBigQueryExportsRequest) + returns (ListBigQueryExportsResponse) { + option (google.api.http) = { + get: "/v1/{parent=organizations/*}/bigQueryExports" + additional_bindings { get: "/v1/{parent=folders/*}/bigQueryExports" } + additional_bindings { get: "/v1/{parent=projects/*}/bigQueryExports" } + }; + option (google.api.method_signature) = "parent"; + } } // Request message for bulk findings update. @@ -484,14 +552,12 @@ service SecurityCenter { // which they get executed is not defined. // 2. Once a bulk operation is started, there is no way to stop it. message BulkMuteFindingsRequest { - // Required. The parent, at which bulk action needs to be applied. Its format is - // "organizations/[organization_id]", "folders/[folder_id]", + // Required. The parent, at which bulk action needs to be applied. Its format + // is "organizations/[organization_id]", "folders/[folder_id]", // "projects/[project_id]". string parent = 1 [ (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "*" - } + (google.api.resource_reference) = { type: "*" } ]; // Expression that identifies findings that should be updated. @@ -522,9 +588,7 @@ message BulkMuteFindingsRequest { } // The response to a BulkMute request. Contains the LRO information. -message BulkMuteFindingsResponse { - -} +message BulkMuteFindingsResponse {} // Request message for creating a finding. message CreateFindingRequest { @@ -542,8 +606,8 @@ message CreateFindingRequest { // greater than 0 characters in length. string finding_id = 2 [(google.api.field_behavior) = REQUIRED]; - // Required. The Finding being created. The name and security_marks will be ignored as - // they are both output only fields on this resource. + // Required. The Finding being created. The name and security_marks will be + // ignored as they are both output only fields on this resource. Finding finding = 3 [(google.api.field_behavior) = REQUIRED]; } @@ -571,8 +635,8 @@ message CreateMuteConfigRequest { // Request message for creating a notification config. message CreateNotificationConfigRequest { - // Required. Resource name of the new notification config's parent. Its format is - // "organizations/[organization_id]". + // Required. Resource name of the new notification config's parent. Its format + // is "organizations/[organization_id]". string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -586,9 +650,11 @@ message CreateNotificationConfigRequest { // characters, underscores or hyphens only. string config_id = 2 [(google.api.field_behavior) = REQUIRED]; - // Required. The notification config being created. The name and the service account - // will be ignored as they are both output only fields on this resource. - NotificationConfig notification_config = 3 [(google.api.field_behavior) = REQUIRED]; + // Required. The notification config being created. The name and the service + // account will be ignored as they are both output only fields on this + // resource. + NotificationConfig notification_config = 3 + [(google.api.field_behavior) = REQUIRED]; } // Request message for creating a source. @@ -602,8 +668,8 @@ message CreateSourceRequest { } ]; - // Required. The Source being created, only the display_name and description will be - // used. All other fields will be ignored. + // Required. The Source being created, only the display_name and description + // will be used. All other fields will be ignored. Source source = 2 [(google.api.field_behavior) = REQUIRED]; } @@ -633,6 +699,20 @@ message DeleteNotificationConfigRequest { ]; } +// Request message for retrieving a big query export. +message GetBigQueryExportRequest { + // Required. Name of the big query export to retrieve. Its format is + // organizations/{organization}/bigQueryExports/{export_id}, + // folders/{folder}/bigQueryExports/{export_id}, or + // projects/{project}/bigQueryExports/{export_id} + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "securitycenter.googleapis.com/BigQueryExport" + } + ]; +} + // Request message for retrieving a mute config. message GetMuteConfigRequest { // Required. Name of the mute config to retrieve. Its format is @@ -661,8 +741,8 @@ message GetNotificationConfigRequest { // Request message for getting organization settings. message GetOrganizationSettingsRequest { - // Required. Name of the organization to get organization settings for. Its format is - // "organizations/[organization_id]/organizationSettings". + // Required. Name of the organization to get organization settings for. Its + // format is "organizations/[organization_id]/organizationSettings". string name = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -759,9 +839,9 @@ message GroupAssetsRequest { // property not existing: `-resource_properties.my_property : ""` string filter = 2; - // Required. Expression that defines what assets fields to use for grouping. The string - // value should follow SQL syntax: comma separated list of fields. For - // example: + // Required. Expression that defines what assets fields to use for grouping. + // The string value should follow SQL syntax: comma separated list of fields. + // For example: // "security_center_properties.resource_project,security_center_properties.project". // // The following fields are supported when compare_duration is not set: @@ -919,9 +999,9 @@ message GroupFindingsRequest { // * resource.type: `=`, `:` string filter = 2; - // Required. Expression that defines what assets fields to use for grouping (including - // `state_change`). The string value should follow SQL syntax: comma separated - // list of fields. For example: "parent,resource_name". + // Required. Expression that defines what assets fields to use for grouping + // (including `state_change`). The string value should follow SQL syntax: + // comma separated list of fields. For example: "parent,resource_name". // // The following fields are supported: // @@ -1016,8 +1096,8 @@ message GroupResult { // Request message for listing mute configs at a given scope e.g. organization, // folder or project. message ListMuteConfigsRequest { - // Required. The parent, which owns the collection of mute configs. Its format is - // "organizations/[organization_id]", "folders/[folder_id]", + // Required. The parent, which owns the collection of mute configs. Its format + // is "organizations/[organization_id]", "folders/[folder_id]", // "projects/[project_id]". string parent = 1 [ (google.api.field_behavior) = REQUIRED, @@ -1083,8 +1163,8 @@ message ListNotificationConfigsResponse { // Request message for listing sources. message ListSourcesRequest { - // Required. Resource name of the parent of sources to list. Its format should be - // "organizations/[organization_id], folders/[folder_id], or + // Required. Resource name of the parent of sources to list. Its format should + // be "organizations/[organization_id], folders/[folder_id], or // projects/[project_id]". string parent = 1 [ (google.api.field_behavior) = REQUIRED, @@ -1559,7 +1639,8 @@ message SetFindingStateRequest { Finding.State state = 2 [(google.api.field_behavior) = REQUIRED]; // Required. The time at which the updated state takes effect. - google.protobuf.Timestamp start_time = 3 [(google.api.field_behavior) = REQUIRED]; + google.protobuf.Timestamp start_time = 3 + [(google.api.field_behavior) = REQUIRED]; } // Request message for updating a finding's mute status. @@ -1583,8 +1664,8 @@ message SetMuteRequest { // Request message for running asset discovery for an organization. message RunAssetDiscoveryRequest { - // Required. Name of the organization to run asset discovery for. Its format is - // "organizations/[organization_id]". + // Required. Name of the organization to run asset discovery for. Its format + // is "organizations/[organization_id]". string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -1606,8 +1687,8 @@ message UpdateExternalSystemRequest { // Request message for updating or creating a finding. message UpdateFindingRequest { - // Required. The finding resource to update or create if it does not already exist. - // parent, security_marks, and update_time will be ignored. + // Required. The finding resource to update or create if it does not already + // exist. parent, security_marks, and update_time will be ignored. // // In the case of creation, the finding id portion of the name must be // alphanumeric and less than or equal to 32 characters and greater than 0 @@ -1637,7 +1718,8 @@ message UpdateMuteConfigRequest { // Request message for updating a notification config. message UpdateNotificationConfigRequest { // Required. The notification config to update. - NotificationConfig notification_config = 1 [(google.api.field_behavior) = REQUIRED]; + NotificationConfig notification_config = 1 + [(google.api.field_behavior) = REQUIRED]; // The FieldMask to use when updating the notification config. // @@ -1648,7 +1730,8 @@ message UpdateNotificationConfigRequest { // Request message for updating an organization's settings. message UpdateOrganizationSettingsRequest { // Required. The organization settings resource to update. - OrganizationSettings organization_settings = 1 [(google.api.field_behavior) = REQUIRED]; + OrganizationSettings organization_settings = 1 + [(google.api.field_behavior) = REQUIRED]; // The FieldMask to use when updating the settings resource. // @@ -1685,3 +1768,85 @@ message UpdateSecurityMarksRequest { // smaller or equal to the server time. google.protobuf.Timestamp start_time = 3; } + +// Request message for creating a big query export. +message CreateBigQueryExportRequest { + // Required. Resource name of the new big query export's parent. Its format is + // "organizations/[organization_id]", "folders/[folder_id]", or + // "projects/[project_id]". + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "securitycenter.googleapis.com/BigQueryExport" + } + ]; + + // Required. The big query export being created. + BigQueryExport big_query_export = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. Unique identifier provided by the client within the parent scope. + // It must consist of lower case letters, numbers, and hyphen, with the first + // character a letter, the last a letter or a number, and a 63 character + // maximum. + string big_query_export_id = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for updating a BigQuery export. +message UpdateBigQueryExportRequest { + // Required. The BigQuery export being updated. + BigQueryExport big_query_export = 1 [(google.api.field_behavior) = REQUIRED]; + + // The list of fields to be updated. + // If empty all mutable fields will be updated. + google.protobuf.FieldMask update_mask = 2; +} + +// Request message for listing BigQuery exports at a given scope e.g. +// organization, folder or project. +message ListBigQueryExportsRequest { + // Required. The parent, which owns the collection of BigQuery exports. Its + // format is "organizations/[organization_id]", "folders/[folder_id]", + // "projects/[project_id]". + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "securitycenter.googleapis.com/BigQueryExport" + } + ]; + + // The maximum number of configs to return. The service may return fewer than + // this value. + // If unspecified, at most 10 configs will be returned. + // The maximum value is 1000; values above 1000 will be coerced to 1000. + int32 page_size = 2; + + // A page token, received from a previous `ListBigQueryExports` call. + // Provide this to retrieve the subsequent page. + // When paginating, all other parameters provided to `ListBigQueryExports` + // must match the call that provided the page token. + string page_token = 3; +} + +// Response message for listing BigQuery exports. +message ListBigQueryExportsResponse { + // The BigQuery exports from the specified parent. + repeated BigQueryExport big_query_exports = 1; + + // A token, which can be sent as `page_token` to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; +} + +// Request message for deleting a big query export. +message DeleteBigQueryExportRequest { + // Required. Name of the big query export to delete. Its format is + // organizations/{organization}/bigQueryExports/{export_id}, + // folders/{folder}/bigQueryExports/{export_id}, or + // projects/{project}/bigQueryExports/{export_id} + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "securitycenter.googleapis.com/BigQueryExport" + } + ]; +} diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/vulnerability.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/vulnerability.proto index e11784ce321..3810d90c705 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/vulnerability.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/vulnerability.proto @@ -44,6 +44,9 @@ message Cve { // Describe Common Vulnerability Scoring System specified at // https://www.first.org/cvss/v3.1/specification-document Cvssv3 cvssv3 = 3; + + // Whether upstream fix is available for the CVE. + bool upstream_fix_available = 4; } // Additional Links diff --git a/packages/google-cloud-securitycenter/protos/protos.d.ts b/packages/google-cloud-securitycenter/protos/protos.d.ts index 39010745411..3848123a19a 100644 --- a/packages/google-cloud-securitycenter/protos/protos.d.ts +++ b/packages/google-cloud-securitycenter/protos/protos.d.ts @@ -797,6 +797,138 @@ export namespace google { public toJSON(): { [k: string]: any }; } + /** Properties of a BigQueryExport. */ + interface IBigQueryExport { + + /** BigQueryExport name */ + name?: (string|null); + + /** BigQueryExport description */ + description?: (string|null); + + /** BigQueryExport filter */ + filter?: (string|null); + + /** BigQueryExport dataset */ + dataset?: (string|null); + + /** BigQueryExport createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** BigQueryExport updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** BigQueryExport mostRecentEditor */ + mostRecentEditor?: (string|null); + + /** BigQueryExport principal */ + principal?: (string|null); + } + + /** Represents a BigQueryExport. */ + class BigQueryExport implements IBigQueryExport { + + /** + * Constructs a new BigQueryExport. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IBigQueryExport); + + /** BigQueryExport name. */ + public name: string; + + /** BigQueryExport description. */ + public description: string; + + /** BigQueryExport filter. */ + public filter: string; + + /** BigQueryExport dataset. */ + public dataset: string; + + /** BigQueryExport createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** BigQueryExport updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** BigQueryExport mostRecentEditor. */ + public mostRecentEditor: string; + + /** BigQueryExport principal. */ + public principal: string; + + /** + * Creates a new BigQueryExport instance using the specified properties. + * @param [properties] Properties to set + * @returns BigQueryExport instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IBigQueryExport): google.cloud.securitycenter.v1.BigQueryExport; + + /** + * Encodes the specified BigQueryExport message. Does not implicitly {@link google.cloud.securitycenter.v1.BigQueryExport.verify|verify} messages. + * @param message BigQueryExport message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IBigQueryExport, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BigQueryExport message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.BigQueryExport.verify|verify} messages. + * @param message BigQueryExport message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IBigQueryExport, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BigQueryExport message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BigQueryExport + * @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.cloud.securitycenter.v1.BigQueryExport; + + /** + * Decodes a BigQueryExport message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BigQueryExport + * @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.cloud.securitycenter.v1.BigQueryExport; + + /** + * Verifies a BigQueryExport 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 BigQueryExport message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BigQueryExport + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.BigQueryExport; + + /** + * Creates a plain object from a BigQueryExport message. Also converts values to other types if specified. + * @param message BigQueryExport + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.BigQueryExport, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BigQueryExport to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + /** Properties of an ExternalSystem. */ interface IExternalSystem { @@ -968,6 +1100,9 @@ export namespace google { /** Finding externalSystems */ externalSystems?: ({ [k: string]: google.cloud.securitycenter.v1.IExternalSystem }|null); + /** Finding mitreAttack */ + mitreAttack?: (google.cloud.securitycenter.v1.IMitreAttack|null); + /** Finding access */ access?: (google.cloud.securitycenter.v1.IAccess|null); @@ -1038,6 +1173,9 @@ export namespace google { /** Finding externalSystems. */ public externalSystems: { [k: string]: google.cloud.securitycenter.v1.IExternalSystem }; + /** Finding mitreAttack. */ + public mitreAttack?: (google.cloud.securitycenter.v1.IMitreAttack|null); + /** Finding access. */ public access?: (google.cloud.securitycenter.v1.IAccess|null); @@ -1147,7 +1285,8 @@ export namespace google { THREAT = 1, VULNERABILITY = 2, MISCONFIGURATION = 3, - OBSERVATION = 4 + OBSERVATION = 4, + SCC_ERROR = 5 } } @@ -1247,6 +1386,175 @@ export namespace google { public toJSON(): { [k: string]: any }; } + /** Properties of a MitreAttack. */ + interface IMitreAttack { + + /** MitreAttack primaryTactic */ + primaryTactic?: (google.cloud.securitycenter.v1.MitreAttack.Tactic|keyof typeof google.cloud.securitycenter.v1.MitreAttack.Tactic|null); + + /** MitreAttack primaryTechniques */ + primaryTechniques?: (google.cloud.securitycenter.v1.MitreAttack.Technique[]|null); + + /** MitreAttack additionalTactics */ + additionalTactics?: (google.cloud.securitycenter.v1.MitreAttack.Tactic[]|null); + + /** MitreAttack additionalTechniques */ + additionalTechniques?: (google.cloud.securitycenter.v1.MitreAttack.Technique[]|null); + + /** MitreAttack version */ + version?: (string|null); + } + + /** Represents a MitreAttack. */ + class MitreAttack implements IMitreAttack { + + /** + * Constructs a new MitreAttack. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IMitreAttack); + + /** MitreAttack primaryTactic. */ + public primaryTactic: (google.cloud.securitycenter.v1.MitreAttack.Tactic|keyof typeof google.cloud.securitycenter.v1.MitreAttack.Tactic); + + /** MitreAttack primaryTechniques. */ + public primaryTechniques: google.cloud.securitycenter.v1.MitreAttack.Technique[]; + + /** MitreAttack additionalTactics. */ + public additionalTactics: google.cloud.securitycenter.v1.MitreAttack.Tactic[]; + + /** MitreAttack additionalTechniques. */ + public additionalTechniques: google.cloud.securitycenter.v1.MitreAttack.Technique[]; + + /** MitreAttack version. */ + public version: string; + + /** + * Creates a new MitreAttack instance using the specified properties. + * @param [properties] Properties to set + * @returns MitreAttack instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IMitreAttack): google.cloud.securitycenter.v1.MitreAttack; + + /** + * Encodes the specified MitreAttack message. Does not implicitly {@link google.cloud.securitycenter.v1.MitreAttack.verify|verify} messages. + * @param message MitreAttack message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IMitreAttack, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MitreAttack message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.MitreAttack.verify|verify} messages. + * @param message MitreAttack message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IMitreAttack, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MitreAttack message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MitreAttack + * @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.cloud.securitycenter.v1.MitreAttack; + + /** + * Decodes a MitreAttack message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MitreAttack + * @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.cloud.securitycenter.v1.MitreAttack; + + /** + * Verifies a MitreAttack 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 MitreAttack message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MitreAttack + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.MitreAttack; + + /** + * Creates a plain object from a MitreAttack message. Also converts values to other types if specified. + * @param message MitreAttack + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.MitreAttack, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MitreAttack to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace MitreAttack { + + /** Tactic enum. */ + enum Tactic { + TACTIC_UNSPECIFIED = 0, + RECONNAISSANCE = 1, + RESOURCE_DEVELOPMENT = 2, + INITIAL_ACCESS = 5, + EXECUTION = 3, + PERSISTENCE = 6, + PRIVILEGE_ESCALATION = 8, + DEFENSE_EVASION = 7, + CREDENTIAL_ACCESS = 9, + DISCOVERY = 10, + LATERAL_MOVEMENT = 11, + COLLECTION = 12, + COMMAND_AND_CONTROL = 4, + EXFILTRATION = 13, + IMPACT = 14 + } + + /** Technique enum. */ + enum Technique { + TECHNIQUE_UNSPECIFIED = 0, + ACTIVE_SCANNING = 1, + SCANNING_IP_BLOCKS = 2, + INGRESS_TOOL_TRANSFER = 3, + NATIVE_API = 4, + SHARED_MODULES = 5, + COMMAND_AND_SCRIPTING_INTERPRETER = 6, + UNIX_SHELL = 7, + RESOURCE_HIJACKING = 8, + PROXY = 9, + EXTERNAL_PROXY = 10, + MULTI_HOP_PROXY = 11, + DYNAMIC_RESOLUTION = 12, + UNSECURED_CREDENTIALS = 13, + VALID_ACCOUNTS = 14, + LOCAL_ACCOUNTS = 15, + CLOUD_ACCOUNTS = 16, + NETWORK_DENIAL_OF_SERVICE = 17, + PERMISSION_GROUPS_DISCOVERY = 18, + CLOUD_GROUPS = 19, + EXFILTRATION_OVER_WEB_SERVICE = 20, + EXFILTRATION_TO_CLOUD_STORAGE = 21, + ACCOUNT_MANIPULATION = 22, + SSH_AUTHORIZED_KEYS = 23, + CREATE_OR_MODIFY_SYSTEM_PROCESS = 24, + STEAL_WEB_SESSION_COOKIE = 25, + MODIFY_CLOUD_COMPUTE_INFRASTRUCTURE = 26, + EXPLOIT_PUBLIC_FACING_APPLICATION = 27, + MODIFY_AUTHENTICATION_PROCESS = 28 + } + } + /** Properties of a Vulnerability. */ interface IVulnerability { @@ -1348,6 +1656,9 @@ export namespace google { /** Cve cvssv3 */ cvssv3?: (google.cloud.securitycenter.v1.ICvssv3|null); + + /** Cve upstreamFixAvailable */ + upstreamFixAvailable?: (boolean|null); } /** Represents a Cve. */ @@ -1368,6 +1679,9 @@ export namespace google { /** Cve cvssv3. */ public cvssv3?: (google.cloud.securitycenter.v1.ICvssv3|null); + /** Cve upstreamFixAvailable. */ + public upstreamFixAvailable: boolean; + /** * Creates a new Cve instance using the specified properties. * @param [properties] Properties to set @@ -2737,6 +3051,20 @@ export namespace google { */ public deleteNotificationConfig(request: google.cloud.securitycenter.v1.IDeleteNotificationConfigRequest): Promise; + /** + * Calls GetBigQueryExport. + * @param request GetBigQueryExportRequest message or plain object + * @param callback Node-style callback called with the error, if any, and BigQueryExport + */ + public getBigQueryExport(request: google.cloud.securitycenter.v1.IGetBigQueryExportRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.GetBigQueryExportCallback): void; + + /** + * Calls GetBigQueryExport. + * @param request GetBigQueryExportRequest message or plain object + * @returns Promise + */ + public getBigQueryExport(request: google.cloud.securitycenter.v1.IGetBigQueryExportRequest): Promise; + /** * Calls GetIamPolicy. * @param request GetIamPolicyRequest message or plain object @@ -3072,6 +3400,62 @@ export namespace google { * @returns Promise */ public updateSecurityMarks(request: google.cloud.securitycenter.v1.IUpdateSecurityMarksRequest): Promise; + + /** + * Calls CreateBigQueryExport. + * @param request CreateBigQueryExportRequest message or plain object + * @param callback Node-style callback called with the error, if any, and BigQueryExport + */ + public createBigQueryExport(request: google.cloud.securitycenter.v1.ICreateBigQueryExportRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.CreateBigQueryExportCallback): void; + + /** + * Calls CreateBigQueryExport. + * @param request CreateBigQueryExportRequest message or plain object + * @returns Promise + */ + public createBigQueryExport(request: google.cloud.securitycenter.v1.ICreateBigQueryExportRequest): Promise; + + /** + * Calls DeleteBigQueryExport. + * @param request DeleteBigQueryExportRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteBigQueryExport(request: google.cloud.securitycenter.v1.IDeleteBigQueryExportRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.DeleteBigQueryExportCallback): void; + + /** + * Calls DeleteBigQueryExport. + * @param request DeleteBigQueryExportRequest message or plain object + * @returns Promise + */ + public deleteBigQueryExport(request: google.cloud.securitycenter.v1.IDeleteBigQueryExportRequest): Promise; + + /** + * Calls UpdateBigQueryExport. + * @param request UpdateBigQueryExportRequest message or plain object + * @param callback Node-style callback called with the error, if any, and BigQueryExport + */ + public updateBigQueryExport(request: google.cloud.securitycenter.v1.IUpdateBigQueryExportRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.UpdateBigQueryExportCallback): void; + + /** + * Calls UpdateBigQueryExport. + * @param request UpdateBigQueryExportRequest message or plain object + * @returns Promise + */ + public updateBigQueryExport(request: google.cloud.securitycenter.v1.IUpdateBigQueryExportRequest): Promise; + + /** + * Calls ListBigQueryExports. + * @param request ListBigQueryExportsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListBigQueryExportsResponse + */ + public listBigQueryExports(request: google.cloud.securitycenter.v1.IListBigQueryExportsRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.ListBigQueryExportsCallback): void; + + /** + * Calls ListBigQueryExports. + * @param request ListBigQueryExportsRequest message or plain object + * @returns Promise + */ + public listBigQueryExports(request: google.cloud.securitycenter.v1.IListBigQueryExportsRequest): Promise; } namespace SecurityCenter { @@ -3125,6 +3509,13 @@ export namespace google { */ type DeleteNotificationConfigCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#getBigQueryExport}. + * @param error Error, if any + * @param [response] BigQueryExport + */ + type GetBigQueryExportCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.BigQueryExport) => void; + /** * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#getIamPolicy}. * @param error Error, if any @@ -3292,6 +3683,34 @@ export namespace google { * @param [response] SecurityMarks */ type UpdateSecurityMarksCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.SecurityMarks) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#createBigQueryExport}. + * @param error Error, if any + * @param [response] BigQueryExport + */ + type CreateBigQueryExportCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.BigQueryExport) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#deleteBigQueryExport}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteBigQueryExportCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#updateBigQueryExport}. + * @param error Error, if any + * @param [response] BigQueryExport + */ + type UpdateBigQueryExportCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.BigQueryExport) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#listBigQueryExports}. + * @param error Error, if any + * @param [response] ListBigQueryExportsResponse + */ + type ListBigQueryExportsCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.ListBigQueryExportsResponse) => void; } /** Properties of a BulkMuteFindingsRequest. */ @@ -4062,108 +4481,198 @@ export namespace google { public toJSON(): { [k: string]: any }; } - /** Properties of a GetMuteConfigRequest. */ - interface IGetMuteConfigRequest { + /** Properties of a GetBigQueryExportRequest. */ + interface IGetBigQueryExportRequest { - /** GetMuteConfigRequest name */ + /** GetBigQueryExportRequest name */ name?: (string|null); } - /** Represents a GetMuteConfigRequest. */ - class GetMuteConfigRequest implements IGetMuteConfigRequest { + /** Represents a GetBigQueryExportRequest. */ + class GetBigQueryExportRequest implements IGetBigQueryExportRequest { /** - * Constructs a new GetMuteConfigRequest. + * Constructs a new GetBigQueryExportRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.securitycenter.v1.IGetMuteConfigRequest); + constructor(properties?: google.cloud.securitycenter.v1.IGetBigQueryExportRequest); - /** GetMuteConfigRequest name. */ + /** GetBigQueryExportRequest name. */ public name: string; /** - * Creates a new GetMuteConfigRequest instance using the specified properties. + * Creates a new GetBigQueryExportRequest instance using the specified properties. * @param [properties] Properties to set - * @returns GetMuteConfigRequest instance + * @returns GetBigQueryExportRequest instance */ - public static create(properties?: google.cloud.securitycenter.v1.IGetMuteConfigRequest): google.cloud.securitycenter.v1.GetMuteConfigRequest; + public static create(properties?: google.cloud.securitycenter.v1.IGetBigQueryExportRequest): google.cloud.securitycenter.v1.GetBigQueryExportRequest; /** - * Encodes the specified GetMuteConfigRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.GetMuteConfigRequest.verify|verify} messages. - * @param message GetMuteConfigRequest message or plain object to encode + * Encodes the specified GetBigQueryExportRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.GetBigQueryExportRequest.verify|verify} messages. + * @param message GetBigQueryExportRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.securitycenter.v1.IGetMuteConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.securitycenter.v1.IGetBigQueryExportRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified GetMuteConfigRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.GetMuteConfigRequest.verify|verify} messages. - * @param message GetMuteConfigRequest message or plain object to encode + * Encodes the specified GetBigQueryExportRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.GetBigQueryExportRequest.verify|verify} messages. + * @param message GetBigQueryExportRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.securitycenter.v1.IGetMuteConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.securitycenter.v1.IGetBigQueryExportRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a GetMuteConfigRequest message from the specified reader or buffer. + * Decodes a GetBigQueryExportRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns GetMuteConfigRequest + * @returns GetBigQueryExportRequest * @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.cloud.securitycenter.v1.GetMuteConfigRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1.GetBigQueryExportRequest; /** - * Decodes a GetMuteConfigRequest message from the specified reader or buffer, length delimited. + * Decodes a GetBigQueryExportRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns GetMuteConfigRequest + * @returns GetBigQueryExportRequest * @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.cloud.securitycenter.v1.GetMuteConfigRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1.GetBigQueryExportRequest; /** - * Verifies a GetMuteConfigRequest message. + * Verifies a GetBigQueryExportRequest 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 GetMuteConfigRequest message from a plain object. Also converts values to their respective internal types. + * Creates a GetBigQueryExportRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns GetMuteConfigRequest + * @returns GetBigQueryExportRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.GetMuteConfigRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.GetBigQueryExportRequest; /** - * Creates a plain object from a GetMuteConfigRequest message. Also converts values to other types if specified. - * @param message GetMuteConfigRequest + * Creates a plain object from a GetBigQueryExportRequest message. Also converts values to other types if specified. + * @param message GetBigQueryExportRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.securitycenter.v1.GetMuteConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.securitycenter.v1.GetBigQueryExportRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this GetMuteConfigRequest to JSON. + * Converts this GetBigQueryExportRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a GetNotificationConfigRequest. */ - interface IGetNotificationConfigRequest { + /** Properties of a GetMuteConfigRequest. */ + interface IGetMuteConfigRequest { - /** GetNotificationConfigRequest name */ + /** GetMuteConfigRequest name */ name?: (string|null); } - /** Represents a GetNotificationConfigRequest. */ - class GetNotificationConfigRequest implements IGetNotificationConfigRequest { + /** Represents a GetMuteConfigRequest. */ + class GetMuteConfigRequest implements IGetMuteConfigRequest { /** - * Constructs a new GetNotificationConfigRequest. + * Constructs a new GetMuteConfigRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IGetMuteConfigRequest); + + /** GetMuteConfigRequest name. */ + public name: string; + + /** + * Creates a new GetMuteConfigRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetMuteConfigRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IGetMuteConfigRequest): google.cloud.securitycenter.v1.GetMuteConfigRequest; + + /** + * Encodes the specified GetMuteConfigRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.GetMuteConfigRequest.verify|verify} messages. + * @param message GetMuteConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IGetMuteConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetMuteConfigRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.GetMuteConfigRequest.verify|verify} messages. + * @param message GetMuteConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IGetMuteConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetMuteConfigRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetMuteConfigRequest + * @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.cloud.securitycenter.v1.GetMuteConfigRequest; + + /** + * Decodes a GetMuteConfigRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetMuteConfigRequest + * @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.cloud.securitycenter.v1.GetMuteConfigRequest; + + /** + * Verifies a GetMuteConfigRequest 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 GetMuteConfigRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetMuteConfigRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.GetMuteConfigRequest; + + /** + * Creates a plain object from a GetMuteConfigRequest message. Also converts values to other types if specified. + * @param message GetMuteConfigRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.GetMuteConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetMuteConfigRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GetNotificationConfigRequest. */ + interface IGetNotificationConfigRequest { + + /** GetNotificationConfigRequest name */ + name?: (string|null); + } + + /** Represents a GetNotificationConfigRequest. */ + class GetNotificationConfigRequest implements IGetNotificationConfigRequest { + + /** + * Constructs a new GetNotificationConfigRequest. * @param [properties] Properties to set */ constructor(properties?: google.cloud.securitycenter.v1.IGetNotificationConfigRequest); @@ -7385,278 +7894,764 @@ export namespace google { public toJSON(): { [k: string]: any }; } - /** Properties of a Source. */ - interface ISource { - - /** Source name */ - name?: (string|null); + /** Properties of a CreateBigQueryExportRequest. */ + interface ICreateBigQueryExportRequest { - /** Source displayName */ - displayName?: (string|null); + /** CreateBigQueryExportRequest parent */ + parent?: (string|null); - /** Source description */ - description?: (string|null); + /** CreateBigQueryExportRequest bigQueryExport */ + bigQueryExport?: (google.cloud.securitycenter.v1.IBigQueryExport|null); - /** Source canonicalName */ - canonicalName?: (string|null); + /** CreateBigQueryExportRequest bigQueryExportId */ + bigQueryExportId?: (string|null); } - /** Represents a Source. */ - class Source implements ISource { + /** Represents a CreateBigQueryExportRequest. */ + class CreateBigQueryExportRequest implements ICreateBigQueryExportRequest { /** - * Constructs a new Source. + * Constructs a new CreateBigQueryExportRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.securitycenter.v1.ISource); - - /** Source name. */ - public name: string; + constructor(properties?: google.cloud.securitycenter.v1.ICreateBigQueryExportRequest); - /** Source displayName. */ - public displayName: string; + /** CreateBigQueryExportRequest parent. */ + public parent: string; - /** Source description. */ - public description: string; + /** CreateBigQueryExportRequest bigQueryExport. */ + public bigQueryExport?: (google.cloud.securitycenter.v1.IBigQueryExport|null); - /** Source canonicalName. */ - public canonicalName: string; + /** CreateBigQueryExportRequest bigQueryExportId. */ + public bigQueryExportId: string; /** - * Creates a new Source instance using the specified properties. + * Creates a new CreateBigQueryExportRequest instance using the specified properties. * @param [properties] Properties to set - * @returns Source instance + * @returns CreateBigQueryExportRequest instance */ - public static create(properties?: google.cloud.securitycenter.v1.ISource): google.cloud.securitycenter.v1.Source; + public static create(properties?: google.cloud.securitycenter.v1.ICreateBigQueryExportRequest): google.cloud.securitycenter.v1.CreateBigQueryExportRequest; /** - * Encodes the specified Source message. Does not implicitly {@link google.cloud.securitycenter.v1.Source.verify|verify} messages. - * @param message Source message or plain object to encode + * Encodes the specified CreateBigQueryExportRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.CreateBigQueryExportRequest.verify|verify} messages. + * @param message CreateBigQueryExportRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.securitycenter.v1.ISource, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.securitycenter.v1.ICreateBigQueryExportRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified Source message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Source.verify|verify} messages. - * @param message Source message or plain object to encode + * Encodes the specified CreateBigQueryExportRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.CreateBigQueryExportRequest.verify|verify} messages. + * @param message CreateBigQueryExportRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.securitycenter.v1.ISource, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.securitycenter.v1.ICreateBigQueryExportRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a Source message from the specified reader or buffer. + * Decodes a CreateBigQueryExportRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns Source + * @returns CreateBigQueryExportRequest * @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.cloud.securitycenter.v1.Source; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1.CreateBigQueryExportRequest; /** - * Decodes a Source message from the specified reader or buffer, length delimited. + * Decodes a CreateBigQueryExportRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Source + * @returns CreateBigQueryExportRequest * @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.cloud.securitycenter.v1.Source; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1.CreateBigQueryExportRequest; /** - * Verifies a Source message. + * Verifies a CreateBigQueryExportRequest 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 Source message from a plain object. Also converts values to their respective internal types. + * Creates a CreateBigQueryExportRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Source + * @returns CreateBigQueryExportRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.Source; + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.CreateBigQueryExportRequest; /** - * Creates a plain object from a Source message. Also converts values to other types if specified. - * @param message Source + * Creates a plain object from a CreateBigQueryExportRequest message. Also converts values to other types if specified. + * @param message CreateBigQueryExportRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.securitycenter.v1.Source, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.securitycenter.v1.CreateBigQueryExportRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Source to JSON. + * Converts this CreateBigQueryExportRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - } - - /** Namespace v1beta1. */ - namespace v1beta1 { - /** Properties of an Asset. */ - interface IAsset { - - /** Asset name */ - name?: (string|null); - - /** Asset securityCenterProperties */ - securityCenterProperties?: (google.cloud.securitycenter.v1beta1.Asset.ISecurityCenterProperties|null); + /** Properties of an UpdateBigQueryExportRequest. */ + interface IUpdateBigQueryExportRequest { - /** Asset resourceProperties */ - resourceProperties?: ({ [k: string]: google.protobuf.IValue }|null); - - /** Asset securityMarks */ - securityMarks?: (google.cloud.securitycenter.v1beta1.ISecurityMarks|null); - - /** Asset createTime */ - createTime?: (google.protobuf.ITimestamp|null); + /** UpdateBigQueryExportRequest bigQueryExport */ + bigQueryExport?: (google.cloud.securitycenter.v1.IBigQueryExport|null); - /** Asset updateTime */ - updateTime?: (google.protobuf.ITimestamp|null); + /** UpdateBigQueryExportRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); } - /** Represents an Asset. */ - class Asset implements IAsset { + /** Represents an UpdateBigQueryExportRequest. */ + class UpdateBigQueryExportRequest implements IUpdateBigQueryExportRequest { /** - * Constructs a new Asset. + * Constructs a new UpdateBigQueryExportRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.securitycenter.v1beta1.IAsset); - - /** Asset name. */ - public name: string; - - /** Asset securityCenterProperties. */ - public securityCenterProperties?: (google.cloud.securitycenter.v1beta1.Asset.ISecurityCenterProperties|null); - - /** Asset resourceProperties. */ - public resourceProperties: { [k: string]: google.protobuf.IValue }; + constructor(properties?: google.cloud.securitycenter.v1.IUpdateBigQueryExportRequest); - /** Asset securityMarks. */ - public securityMarks?: (google.cloud.securitycenter.v1beta1.ISecurityMarks|null); - - /** Asset createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); + /** UpdateBigQueryExportRequest bigQueryExport. */ + public bigQueryExport?: (google.cloud.securitycenter.v1.IBigQueryExport|null); - /** Asset updateTime. */ - public updateTime?: (google.protobuf.ITimestamp|null); + /** UpdateBigQueryExportRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); /** - * Creates a new Asset instance using the specified properties. + * Creates a new UpdateBigQueryExportRequest instance using the specified properties. * @param [properties] Properties to set - * @returns Asset instance + * @returns UpdateBigQueryExportRequest instance */ - public static create(properties?: google.cloud.securitycenter.v1beta1.IAsset): google.cloud.securitycenter.v1beta1.Asset; + public static create(properties?: google.cloud.securitycenter.v1.IUpdateBigQueryExportRequest): google.cloud.securitycenter.v1.UpdateBigQueryExportRequest; /** - * Encodes the specified Asset message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.Asset.verify|verify} messages. - * @param message Asset message or plain object to encode + * Encodes the specified UpdateBigQueryExportRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.UpdateBigQueryExportRequest.verify|verify} messages. + * @param message UpdateBigQueryExportRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.securitycenter.v1beta1.IAsset, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.securitycenter.v1.IUpdateBigQueryExportRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified Asset message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.Asset.verify|verify} messages. - * @param message Asset message or plain object to encode + * Encodes the specified UpdateBigQueryExportRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.UpdateBigQueryExportRequest.verify|verify} messages. + * @param message UpdateBigQueryExportRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.securitycenter.v1beta1.IAsset, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.securitycenter.v1.IUpdateBigQueryExportRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an Asset message from the specified reader or buffer. + * Decodes an UpdateBigQueryExportRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns Asset + * @returns UpdateBigQueryExportRequest * @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.cloud.securitycenter.v1beta1.Asset; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1.UpdateBigQueryExportRequest; /** - * Decodes an Asset message from the specified reader or buffer, length delimited. + * Decodes an UpdateBigQueryExportRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Asset + * @returns UpdateBigQueryExportRequest * @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.cloud.securitycenter.v1beta1.Asset; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1.UpdateBigQueryExportRequest; /** - * Verifies an Asset message. + * Verifies an UpdateBigQueryExportRequest 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 Asset message from a plain object. Also converts values to their respective internal types. + * Creates an UpdateBigQueryExportRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Asset + * @returns UpdateBigQueryExportRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1beta1.Asset; + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.UpdateBigQueryExportRequest; /** - * Creates a plain object from an Asset message. Also converts values to other types if specified. - * @param message Asset + * Creates a plain object from an UpdateBigQueryExportRequest message. Also converts values to other types if specified. + * @param message UpdateBigQueryExportRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.securitycenter.v1beta1.Asset, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.securitycenter.v1.UpdateBigQueryExportRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Asset to JSON. + * Converts this UpdateBigQueryExportRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - namespace Asset { + /** Properties of a ListBigQueryExportsRequest. */ + interface IListBigQueryExportsRequest { - /** Properties of a SecurityCenterProperties. */ - interface ISecurityCenterProperties { + /** ListBigQueryExportsRequest parent */ + parent?: (string|null); - /** SecurityCenterProperties resourceName */ - resourceName?: (string|null); + /** ListBigQueryExportsRequest pageSize */ + pageSize?: (number|null); - /** SecurityCenterProperties resourceType */ - resourceType?: (string|null); + /** ListBigQueryExportsRequest pageToken */ + pageToken?: (string|null); + } - /** SecurityCenterProperties resourceParent */ - resourceParent?: (string|null); + /** Represents a ListBigQueryExportsRequest. */ + class ListBigQueryExportsRequest implements IListBigQueryExportsRequest { - /** SecurityCenterProperties resourceProject */ - resourceProject?: (string|null); + /** + * Constructs a new ListBigQueryExportsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IListBigQueryExportsRequest); - /** SecurityCenterProperties resourceOwners */ - resourceOwners?: (string[]|null); - } + /** ListBigQueryExportsRequest parent. */ + public parent: string; - /** Represents a SecurityCenterProperties. */ - class SecurityCenterProperties implements ISecurityCenterProperties { + /** ListBigQueryExportsRequest pageSize. */ + public pageSize: number; - /** - * Constructs a new SecurityCenterProperties. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.securitycenter.v1beta1.Asset.ISecurityCenterProperties); + /** ListBigQueryExportsRequest pageToken. */ + public pageToken: string; - /** SecurityCenterProperties resourceName. */ - public resourceName: string; + /** + * Creates a new ListBigQueryExportsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListBigQueryExportsRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IListBigQueryExportsRequest): google.cloud.securitycenter.v1.ListBigQueryExportsRequest; - /** SecurityCenterProperties resourceType. */ - public resourceType: string; + /** + * Encodes the specified ListBigQueryExportsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.ListBigQueryExportsRequest.verify|verify} messages. + * @param message ListBigQueryExportsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IListBigQueryExportsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** SecurityCenterProperties resourceParent. */ - public resourceParent: string; + /** + * Encodes the specified ListBigQueryExportsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListBigQueryExportsRequest.verify|verify} messages. + * @param message ListBigQueryExportsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IListBigQueryExportsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** SecurityCenterProperties resourceProject. */ + /** + * Decodes a ListBigQueryExportsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListBigQueryExportsRequest + * @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.cloud.securitycenter.v1.ListBigQueryExportsRequest; + + /** + * Decodes a ListBigQueryExportsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListBigQueryExportsRequest + * @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.cloud.securitycenter.v1.ListBigQueryExportsRequest; + + /** + * Verifies a ListBigQueryExportsRequest 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 ListBigQueryExportsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListBigQueryExportsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.ListBigQueryExportsRequest; + + /** + * Creates a plain object from a ListBigQueryExportsRequest message. Also converts values to other types if specified. + * @param message ListBigQueryExportsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.ListBigQueryExportsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListBigQueryExportsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListBigQueryExportsResponse. */ + interface IListBigQueryExportsResponse { + + /** ListBigQueryExportsResponse bigQueryExports */ + bigQueryExports?: (google.cloud.securitycenter.v1.IBigQueryExport[]|null); + + /** ListBigQueryExportsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListBigQueryExportsResponse. */ + class ListBigQueryExportsResponse implements IListBigQueryExportsResponse { + + /** + * Constructs a new ListBigQueryExportsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IListBigQueryExportsResponse); + + /** ListBigQueryExportsResponse bigQueryExports. */ + public bigQueryExports: google.cloud.securitycenter.v1.IBigQueryExport[]; + + /** ListBigQueryExportsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListBigQueryExportsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListBigQueryExportsResponse instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IListBigQueryExportsResponse): google.cloud.securitycenter.v1.ListBigQueryExportsResponse; + + /** + * Encodes the specified ListBigQueryExportsResponse message. Does not implicitly {@link google.cloud.securitycenter.v1.ListBigQueryExportsResponse.verify|verify} messages. + * @param message ListBigQueryExportsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IListBigQueryExportsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListBigQueryExportsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListBigQueryExportsResponse.verify|verify} messages. + * @param message ListBigQueryExportsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IListBigQueryExportsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListBigQueryExportsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListBigQueryExportsResponse + * @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.cloud.securitycenter.v1.ListBigQueryExportsResponse; + + /** + * Decodes a ListBigQueryExportsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListBigQueryExportsResponse + * @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.cloud.securitycenter.v1.ListBigQueryExportsResponse; + + /** + * Verifies a ListBigQueryExportsResponse 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 ListBigQueryExportsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListBigQueryExportsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.ListBigQueryExportsResponse; + + /** + * Creates a plain object from a ListBigQueryExportsResponse message. Also converts values to other types if specified. + * @param message ListBigQueryExportsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.ListBigQueryExportsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListBigQueryExportsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DeleteBigQueryExportRequest. */ + interface IDeleteBigQueryExportRequest { + + /** DeleteBigQueryExportRequest name */ + name?: (string|null); + } + + /** Represents a DeleteBigQueryExportRequest. */ + class DeleteBigQueryExportRequest implements IDeleteBigQueryExportRequest { + + /** + * Constructs a new DeleteBigQueryExportRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IDeleteBigQueryExportRequest); + + /** DeleteBigQueryExportRequest name. */ + public name: string; + + /** + * Creates a new DeleteBigQueryExportRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteBigQueryExportRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IDeleteBigQueryExportRequest): google.cloud.securitycenter.v1.DeleteBigQueryExportRequest; + + /** + * Encodes the specified DeleteBigQueryExportRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.DeleteBigQueryExportRequest.verify|verify} messages. + * @param message DeleteBigQueryExportRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IDeleteBigQueryExportRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteBigQueryExportRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.DeleteBigQueryExportRequest.verify|verify} messages. + * @param message DeleteBigQueryExportRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IDeleteBigQueryExportRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteBigQueryExportRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteBigQueryExportRequest + * @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.cloud.securitycenter.v1.DeleteBigQueryExportRequest; + + /** + * Decodes a DeleteBigQueryExportRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteBigQueryExportRequest + * @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.cloud.securitycenter.v1.DeleteBigQueryExportRequest; + + /** + * Verifies a DeleteBigQueryExportRequest 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 DeleteBigQueryExportRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteBigQueryExportRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.DeleteBigQueryExportRequest; + + /** + * Creates a plain object from a DeleteBigQueryExportRequest message. Also converts values to other types if specified. + * @param message DeleteBigQueryExportRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.DeleteBigQueryExportRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteBigQueryExportRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a Source. */ + interface ISource { + + /** Source name */ + name?: (string|null); + + /** Source displayName */ + displayName?: (string|null); + + /** Source description */ + description?: (string|null); + + /** Source canonicalName */ + canonicalName?: (string|null); + } + + /** Represents a Source. */ + class Source implements ISource { + + /** + * Constructs a new Source. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.ISource); + + /** Source name. */ + public name: string; + + /** Source displayName. */ + public displayName: string; + + /** Source description. */ + public description: string; + + /** Source canonicalName. */ + public canonicalName: string; + + /** + * Creates a new Source instance using the specified properties. + * @param [properties] Properties to set + * @returns Source instance + */ + public static create(properties?: google.cloud.securitycenter.v1.ISource): google.cloud.securitycenter.v1.Source; + + /** + * Encodes the specified Source message. Does not implicitly {@link google.cloud.securitycenter.v1.Source.verify|verify} messages. + * @param message Source message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.ISource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Source message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Source.verify|verify} messages. + * @param message Source message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.ISource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Source message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Source + * @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.cloud.securitycenter.v1.Source; + + /** + * Decodes a Source message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Source + * @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.cloud.securitycenter.v1.Source; + + /** + * Verifies a Source 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 Source message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Source + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.Source; + + /** + * Creates a plain object from a Source message. Also converts values to other types if specified. + * @param message Source + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.Source, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Source to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** Namespace v1beta1. */ + namespace v1beta1 { + + /** Properties of an Asset. */ + interface IAsset { + + /** Asset name */ + name?: (string|null); + + /** Asset securityCenterProperties */ + securityCenterProperties?: (google.cloud.securitycenter.v1beta1.Asset.ISecurityCenterProperties|null); + + /** Asset resourceProperties */ + resourceProperties?: ({ [k: string]: google.protobuf.IValue }|null); + + /** Asset securityMarks */ + securityMarks?: (google.cloud.securitycenter.v1beta1.ISecurityMarks|null); + + /** Asset createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Asset updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents an Asset. */ + class Asset implements IAsset { + + /** + * Constructs a new Asset. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1beta1.IAsset); + + /** Asset name. */ + public name: string; + + /** Asset securityCenterProperties. */ + public securityCenterProperties?: (google.cloud.securitycenter.v1beta1.Asset.ISecurityCenterProperties|null); + + /** Asset resourceProperties. */ + public resourceProperties: { [k: string]: google.protobuf.IValue }; + + /** Asset securityMarks. */ + public securityMarks?: (google.cloud.securitycenter.v1beta1.ISecurityMarks|null); + + /** Asset createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Asset updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new Asset instance using the specified properties. + * @param [properties] Properties to set + * @returns Asset instance + */ + public static create(properties?: google.cloud.securitycenter.v1beta1.IAsset): google.cloud.securitycenter.v1beta1.Asset; + + /** + * Encodes the specified Asset message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.Asset.verify|verify} messages. + * @param message Asset message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1beta1.IAsset, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Asset message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.Asset.verify|verify} messages. + * @param message Asset message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1beta1.IAsset, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Asset message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Asset + * @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.cloud.securitycenter.v1beta1.Asset; + + /** + * Decodes an Asset message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Asset + * @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.cloud.securitycenter.v1beta1.Asset; + + /** + * Verifies an Asset 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 Asset message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Asset + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1beta1.Asset; + + /** + * Creates a plain object from an Asset message. Also converts values to other types if specified. + * @param message Asset + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1beta1.Asset, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Asset to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace Asset { + + /** Properties of a SecurityCenterProperties. */ + interface ISecurityCenterProperties { + + /** SecurityCenterProperties resourceName */ + resourceName?: (string|null); + + /** SecurityCenterProperties resourceType */ + resourceType?: (string|null); + + /** SecurityCenterProperties resourceParent */ + resourceParent?: (string|null); + + /** SecurityCenterProperties resourceProject */ + resourceProject?: (string|null); + + /** SecurityCenterProperties resourceOwners */ + resourceOwners?: (string[]|null); + } + + /** Represents a SecurityCenterProperties. */ + class SecurityCenterProperties implements ISecurityCenterProperties { + + /** + * Constructs a new SecurityCenterProperties. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1beta1.Asset.ISecurityCenterProperties); + + /** SecurityCenterProperties resourceName. */ + public resourceName: string; + + /** SecurityCenterProperties resourceType. */ + public resourceType: string; + + /** SecurityCenterProperties resourceParent. */ + public resourceParent: string; + + /** SecurityCenterProperties resourceProject. */ public resourceProject: string; /** SecurityCenterProperties resourceOwners. */ @@ -16347,10 +17342,260 @@ export namespace google { } } } - } - - /** Namespace api. */ - namespace api { + } + + /** Namespace api. */ + namespace api { + + /** 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 }; + } + + 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 }; + } + + /** 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 Http. */ interface IHttp { @@ -16690,256 +17935,6 @@ export namespace google { */ public toJSON(): { [k: string]: any }; } - - /** 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 }; - } - - 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 }; - } - - /** 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 - } } /** Namespace protobuf. */ diff --git a/packages/google-cloud-securitycenter/protos/protos.js b/packages/google-cloud-securitycenter/protos/protos.js index a129e1b6b2d..bd202f7fbf8 100644 --- a/packages/google-cloud-securitycenter/protos/protos.js +++ b/packages/google-cloud-securitycenter/protos/protos.js @@ -2034,6 +2034,358 @@ return SecurityMarks; })(); + v1.BigQueryExport = (function() { + + /** + * Properties of a BigQueryExport. + * @memberof google.cloud.securitycenter.v1 + * @interface IBigQueryExport + * @property {string|null} [name] BigQueryExport name + * @property {string|null} [description] BigQueryExport description + * @property {string|null} [filter] BigQueryExport filter + * @property {string|null} [dataset] BigQueryExport dataset + * @property {google.protobuf.ITimestamp|null} [createTime] BigQueryExport createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] BigQueryExport updateTime + * @property {string|null} [mostRecentEditor] BigQueryExport mostRecentEditor + * @property {string|null} [principal] BigQueryExport principal + */ + + /** + * Constructs a new BigQueryExport. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a BigQueryExport. + * @implements IBigQueryExport + * @constructor + * @param {google.cloud.securitycenter.v1.IBigQueryExport=} [properties] Properties to set + */ + function BigQueryExport(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]]; + } + + /** + * BigQueryExport name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1.BigQueryExport + * @instance + */ + BigQueryExport.prototype.name = ""; + + /** + * BigQueryExport description. + * @member {string} description + * @memberof google.cloud.securitycenter.v1.BigQueryExport + * @instance + */ + BigQueryExport.prototype.description = ""; + + /** + * BigQueryExport filter. + * @member {string} filter + * @memberof google.cloud.securitycenter.v1.BigQueryExport + * @instance + */ + BigQueryExport.prototype.filter = ""; + + /** + * BigQueryExport dataset. + * @member {string} dataset + * @memberof google.cloud.securitycenter.v1.BigQueryExport + * @instance + */ + BigQueryExport.prototype.dataset = ""; + + /** + * BigQueryExport createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.securitycenter.v1.BigQueryExport + * @instance + */ + BigQueryExport.prototype.createTime = null; + + /** + * BigQueryExport updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.securitycenter.v1.BigQueryExport + * @instance + */ + BigQueryExport.prototype.updateTime = null; + + /** + * BigQueryExport mostRecentEditor. + * @member {string} mostRecentEditor + * @memberof google.cloud.securitycenter.v1.BigQueryExport + * @instance + */ + BigQueryExport.prototype.mostRecentEditor = ""; + + /** + * BigQueryExport principal. + * @member {string} principal + * @memberof google.cloud.securitycenter.v1.BigQueryExport + * @instance + */ + BigQueryExport.prototype.principal = ""; + + /** + * Creates a new BigQueryExport instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.BigQueryExport + * @static + * @param {google.cloud.securitycenter.v1.IBigQueryExport=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.BigQueryExport} BigQueryExport instance + */ + BigQueryExport.create = function create(properties) { + return new BigQueryExport(properties); + }; + + /** + * Encodes the specified BigQueryExport message. Does not implicitly {@link google.cloud.securitycenter.v1.BigQueryExport.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.BigQueryExport + * @static + * @param {google.cloud.securitycenter.v1.IBigQueryExport} message BigQueryExport message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BigQueryExport.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.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.filter); + if (message.dataset != null && Object.hasOwnProperty.call(message, "dataset")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.dataset); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.mostRecentEditor != null && Object.hasOwnProperty.call(message, "mostRecentEditor")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.mostRecentEditor); + if (message.principal != null && Object.hasOwnProperty.call(message, "principal")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.principal); + return writer; + }; + + /** + * Encodes the specified BigQueryExport message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.BigQueryExport.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.BigQueryExport + * @static + * @param {google.cloud.securitycenter.v1.IBigQueryExport} message BigQueryExport message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BigQueryExport.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BigQueryExport message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.BigQueryExport + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.BigQueryExport} BigQueryExport + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BigQueryExport.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.cloud.securitycenter.v1.BigQueryExport(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + case 3: + message.filter = reader.string(); + break; + case 4: + message.dataset = reader.string(); + break; + case 5: + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 6: + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 7: + message.mostRecentEditor = reader.string(); + break; + case 8: + message.principal = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BigQueryExport message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.BigQueryExport + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.BigQueryExport} BigQueryExport + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BigQueryExport.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BigQueryExport message. + * @function verify + * @memberof google.cloud.securitycenter.v1.BigQueryExport + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BigQueryExport.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.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.dataset != null && message.hasOwnProperty("dataset")) + if (!$util.isString(message.dataset)) + return "dataset: string expected"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.mostRecentEditor != null && message.hasOwnProperty("mostRecentEditor")) + if (!$util.isString(message.mostRecentEditor)) + return "mostRecentEditor: string expected"; + if (message.principal != null && message.hasOwnProperty("principal")) + if (!$util.isString(message.principal)) + return "principal: string expected"; + return null; + }; + + /** + * Creates a BigQueryExport message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.BigQueryExport + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.BigQueryExport} BigQueryExport + */ + BigQueryExport.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.BigQueryExport) + return object; + var message = new $root.google.cloud.securitycenter.v1.BigQueryExport(); + if (object.name != null) + message.name = String(object.name); + if (object.description != null) + message.description = String(object.description); + if (object.filter != null) + message.filter = String(object.filter); + if (object.dataset != null) + message.dataset = String(object.dataset); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.securitycenter.v1.BigQueryExport.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.securitycenter.v1.BigQueryExport.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.mostRecentEditor != null) + message.mostRecentEditor = String(object.mostRecentEditor); + if (object.principal != null) + message.principal = String(object.principal); + return message; + }; + + /** + * Creates a plain object from a BigQueryExport message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.BigQueryExport + * @static + * @param {google.cloud.securitycenter.v1.BigQueryExport} message BigQueryExport + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BigQueryExport.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.description = ""; + object.filter = ""; + object.dataset = ""; + object.createTime = null; + object.updateTime = null; + object.mostRecentEditor = ""; + object.principal = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.dataset != null && message.hasOwnProperty("dataset")) + object.dataset = message.dataset; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.mostRecentEditor != null && message.hasOwnProperty("mostRecentEditor")) + object.mostRecentEditor = message.mostRecentEditor; + if (message.principal != null && message.hasOwnProperty("principal")) + object.principal = message.principal; + return object; + }; + + /** + * Converts this BigQueryExport to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.BigQueryExport + * @instance + * @returns {Object.} JSON object + */ + BigQueryExport.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return BigQueryExport; + })(); + v1.ExternalSystem = (function() { /** @@ -2356,6 +2708,7 @@ * @property {google.cloud.securitycenter.v1.IVulnerability|null} [vulnerability] Finding vulnerability * @property {google.protobuf.ITimestamp|null} [muteUpdateTime] Finding muteUpdateTime * @property {Object.|null} [externalSystems] Finding externalSystems + * @property {google.cloud.securitycenter.v1.IMitreAttack|null} [mitreAttack] Finding mitreAttack * @property {google.cloud.securitycenter.v1.IAccess|null} [access] Finding access * @property {string|null} [muteInitiator] Finding muteInitiator */ @@ -2521,6 +2874,14 @@ */ Finding.prototype.externalSystems = $util.emptyObject; + /** + * Finding mitreAttack. + * @member {google.cloud.securitycenter.v1.IMitreAttack|null|undefined} mitreAttack + * @memberof google.cloud.securitycenter.v1.Finding + * @instance + */ + Finding.prototype.mitreAttack = null; + /** * Finding access. * @member {google.cloud.securitycenter.v1.IAccess|null|undefined} access @@ -2603,6 +2964,8 @@ writer.uint32(/* id 22, wireType 2 =*/178).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); $root.google.cloud.securitycenter.v1.ExternalSystem.encode(message.externalSystems[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); } + if (message.mitreAttack != null && Object.hasOwnProperty.call(message, "mitreAttack")) + $root.google.cloud.securitycenter.v1.MitreAttack.encode(message.mitreAttack, writer.uint32(/* id 25, wireType 2 =*/202).fork()).ldelim(); if (message.access != null && Object.hasOwnProperty.call(message, "access")) $root.google.cloud.securitycenter.v1.Access.encode(message.access, writer.uint32(/* id 26, wireType 2 =*/210).fork()).ldelim(); if (message.muteInitiator != null && Object.hasOwnProperty.call(message, "muteInitiator")) @@ -2733,6 +3096,9 @@ } message.externalSystems[key] = value; break; + case 25: + message.mitreAttack = $root.google.cloud.securitycenter.v1.MitreAttack.decode(reader, reader.uint32()); + break; case 26: message.access = $root.google.cloud.securitycenter.v1.Access.decode(reader, reader.uint32()); break; @@ -2856,6 +3222,7 @@ case 2: case 3: case 4: + case 5: break; } if (message.indicator != null && message.hasOwnProperty("indicator")) { @@ -2883,6 +3250,11 @@ return "externalSystems." + error; } } + if (message.mitreAttack != null && message.hasOwnProperty("mitreAttack")) { + var error = $root.google.cloud.securitycenter.v1.MitreAttack.verify(message.mitreAttack); + if (error) + return "mitreAttack." + error; + } if (message.access != null && message.hasOwnProperty("access")) { var error = $root.google.cloud.securitycenter.v1.Access.verify(message.access); if (error) @@ -3018,6 +3390,10 @@ case 4: message.findingClass = 4; break; + case "SCC_ERROR": + case 5: + message.findingClass = 5; + break; } if (object.indicator != null) { if (typeof object.indicator !== "object") @@ -3044,6 +3420,11 @@ message.externalSystems[keys[i]] = $root.google.cloud.securitycenter.v1.ExternalSystem.fromObject(object.externalSystems[keys[i]]); } } + if (object.mitreAttack != null) { + if (typeof object.mitreAttack !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Finding.mitreAttack: object expected"); + message.mitreAttack = $root.google.cloud.securitycenter.v1.MitreAttack.fromObject(object.mitreAttack); + } if (object.access != null) { if (typeof object.access !== "object") throw TypeError(".google.cloud.securitycenter.v1.Finding.access: object expected"); @@ -3088,6 +3469,7 @@ object.indicator = null; object.vulnerability = null; object.muteUpdateTime = null; + object.mitreAttack = null; object.access = null; object.muteInitiator = ""; } @@ -3134,6 +3516,8 @@ for (var j = 0; j < keys2.length; ++j) object.externalSystems[keys2[j]] = $root.google.cloud.securitycenter.v1.ExternalSystem.toObject(message.externalSystems[keys2[j]], options); } + if (message.mitreAttack != null && message.hasOwnProperty("mitreAttack")) + object.mitreAttack = $root.google.cloud.securitycenter.v1.MitreAttack.toObject(message.mitreAttack, options); if (message.access != null && message.hasOwnProperty("access")) object.access = $root.google.cloud.securitycenter.v1.Access.toObject(message.access, options); if (message.muteInitiator != null && message.hasOwnProperty("muteInitiator")) @@ -3215,6 +3599,7 @@ * @property {number} VULNERABILITY=2 VULNERABILITY value * @property {number} MISCONFIGURATION=3 MISCONFIGURATION value * @property {number} OBSERVATION=4 OBSERVATION value + * @property {number} SCC_ERROR=5 SCC_ERROR value */ Finding.FindingClass = (function() { var valuesById = {}, values = Object.create(valuesById); @@ -3223,6 +3608,7 @@ values[valuesById[2] = "VULNERABILITY"] = 2; values[valuesById[3] = "MISCONFIGURATION"] = 3; values[valuesById[4] = "OBSERVATION"] = 4; + values[valuesById[5] = "SCC_ERROR"] = 5; return values; })(); @@ -3471,6 +3857,922 @@ return Indicator; })(); + v1.MitreAttack = (function() { + + /** + * Properties of a MitreAttack. + * @memberof google.cloud.securitycenter.v1 + * @interface IMitreAttack + * @property {google.cloud.securitycenter.v1.MitreAttack.Tactic|null} [primaryTactic] MitreAttack primaryTactic + * @property {Array.|null} [primaryTechniques] MitreAttack primaryTechniques + * @property {Array.|null} [additionalTactics] MitreAttack additionalTactics + * @property {Array.|null} [additionalTechniques] MitreAttack additionalTechniques + * @property {string|null} [version] MitreAttack version + */ + + /** + * Constructs a new MitreAttack. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a MitreAttack. + * @implements IMitreAttack + * @constructor + * @param {google.cloud.securitycenter.v1.IMitreAttack=} [properties] Properties to set + */ + function MitreAttack(properties) { + this.primaryTechniques = []; + this.additionalTactics = []; + this.additionalTechniques = []; + 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]]; + } + + /** + * MitreAttack primaryTactic. + * @member {google.cloud.securitycenter.v1.MitreAttack.Tactic} primaryTactic + * @memberof google.cloud.securitycenter.v1.MitreAttack + * @instance + */ + MitreAttack.prototype.primaryTactic = 0; + + /** + * MitreAttack primaryTechniques. + * @member {Array.} primaryTechniques + * @memberof google.cloud.securitycenter.v1.MitreAttack + * @instance + */ + MitreAttack.prototype.primaryTechniques = $util.emptyArray; + + /** + * MitreAttack additionalTactics. + * @member {Array.} additionalTactics + * @memberof google.cloud.securitycenter.v1.MitreAttack + * @instance + */ + MitreAttack.prototype.additionalTactics = $util.emptyArray; + + /** + * MitreAttack additionalTechniques. + * @member {Array.} additionalTechniques + * @memberof google.cloud.securitycenter.v1.MitreAttack + * @instance + */ + MitreAttack.prototype.additionalTechniques = $util.emptyArray; + + /** + * MitreAttack version. + * @member {string} version + * @memberof google.cloud.securitycenter.v1.MitreAttack + * @instance + */ + MitreAttack.prototype.version = ""; + + /** + * Creates a new MitreAttack instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.MitreAttack + * @static + * @param {google.cloud.securitycenter.v1.IMitreAttack=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.MitreAttack} MitreAttack instance + */ + MitreAttack.create = function create(properties) { + return new MitreAttack(properties); + }; + + /** + * Encodes the specified MitreAttack message. Does not implicitly {@link google.cloud.securitycenter.v1.MitreAttack.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.MitreAttack + * @static + * @param {google.cloud.securitycenter.v1.IMitreAttack} message MitreAttack message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MitreAttack.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.primaryTactic != null && Object.hasOwnProperty.call(message, "primaryTactic")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.primaryTactic); + if (message.primaryTechniques != null && message.primaryTechniques.length) { + writer.uint32(/* id 2, wireType 2 =*/18).fork(); + for (var i = 0; i < message.primaryTechniques.length; ++i) + writer.int32(message.primaryTechniques[i]); + writer.ldelim(); + } + if (message.additionalTactics != null && message.additionalTactics.length) { + writer.uint32(/* id 3, wireType 2 =*/26).fork(); + for (var i = 0; i < message.additionalTactics.length; ++i) + writer.int32(message.additionalTactics[i]); + writer.ldelim(); + } + if (message.additionalTechniques != null && message.additionalTechniques.length) { + writer.uint32(/* id 4, wireType 2 =*/34).fork(); + for (var i = 0; i < message.additionalTechniques.length; ++i) + writer.int32(message.additionalTechniques[i]); + writer.ldelim(); + } + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.version); + return writer; + }; + + /** + * Encodes the specified MitreAttack message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.MitreAttack.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.MitreAttack + * @static + * @param {google.cloud.securitycenter.v1.IMitreAttack} message MitreAttack message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MitreAttack.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MitreAttack message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.MitreAttack + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.MitreAttack} MitreAttack + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MitreAttack.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.cloud.securitycenter.v1.MitreAttack(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.primaryTactic = reader.int32(); + break; + case 2: + if (!(message.primaryTechniques && message.primaryTechniques.length)) + message.primaryTechniques = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.primaryTechniques.push(reader.int32()); + } else + message.primaryTechniques.push(reader.int32()); + break; + case 3: + if (!(message.additionalTactics && message.additionalTactics.length)) + message.additionalTactics = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.additionalTactics.push(reader.int32()); + } else + message.additionalTactics.push(reader.int32()); + break; + case 4: + if (!(message.additionalTechniques && message.additionalTechniques.length)) + message.additionalTechniques = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.additionalTechniques.push(reader.int32()); + } else + message.additionalTechniques.push(reader.int32()); + break; + case 5: + message.version = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MitreAttack message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.MitreAttack + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.MitreAttack} MitreAttack + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MitreAttack.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MitreAttack message. + * @function verify + * @memberof google.cloud.securitycenter.v1.MitreAttack + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MitreAttack.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.primaryTactic != null && message.hasOwnProperty("primaryTactic")) + switch (message.primaryTactic) { + default: + return "primaryTactic: enum value expected"; + case 0: + case 1: + case 2: + case 5: + case 3: + case 6: + case 8: + case 7: + case 9: + case 10: + case 11: + case 12: + case 4: + case 13: + case 14: + break; + } + if (message.primaryTechniques != null && message.hasOwnProperty("primaryTechniques")) { + if (!Array.isArray(message.primaryTechniques)) + return "primaryTechniques: array expected"; + for (var i = 0; i < message.primaryTechniques.length; ++i) + switch (message.primaryTechniques[i]) { + default: + return "primaryTechniques: enum value[] expected"; + case 0: + 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: + case 19: + case 20: + case 21: + case 22: + case 23: + case 24: + case 25: + case 26: + case 27: + case 28: + break; + } + } + if (message.additionalTactics != null && message.hasOwnProperty("additionalTactics")) { + if (!Array.isArray(message.additionalTactics)) + return "additionalTactics: array expected"; + for (var i = 0; i < message.additionalTactics.length; ++i) + switch (message.additionalTactics[i]) { + default: + return "additionalTactics: enum value[] expected"; + case 0: + case 1: + case 2: + case 5: + case 3: + case 6: + case 8: + case 7: + case 9: + case 10: + case 11: + case 12: + case 4: + case 13: + case 14: + break; + } + } + if (message.additionalTechniques != null && message.hasOwnProperty("additionalTechniques")) { + if (!Array.isArray(message.additionalTechniques)) + return "additionalTechniques: array expected"; + for (var i = 0; i < message.additionalTechniques.length; ++i) + switch (message.additionalTechniques[i]) { + default: + return "additionalTechniques: enum value[] expected"; + case 0: + 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: + case 19: + case 20: + case 21: + case 22: + case 23: + case 24: + case 25: + case 26: + case 27: + case 28: + break; + } + } + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isString(message.version)) + return "version: string expected"; + return null; + }; + + /** + * Creates a MitreAttack message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.MitreAttack + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.MitreAttack} MitreAttack + */ + MitreAttack.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.MitreAttack) + return object; + var message = new $root.google.cloud.securitycenter.v1.MitreAttack(); + switch (object.primaryTactic) { + case "TACTIC_UNSPECIFIED": + case 0: + message.primaryTactic = 0; + break; + case "RECONNAISSANCE": + case 1: + message.primaryTactic = 1; + break; + case "RESOURCE_DEVELOPMENT": + case 2: + message.primaryTactic = 2; + break; + case "INITIAL_ACCESS": + case 5: + message.primaryTactic = 5; + break; + case "EXECUTION": + case 3: + message.primaryTactic = 3; + break; + case "PERSISTENCE": + case 6: + message.primaryTactic = 6; + break; + case "PRIVILEGE_ESCALATION": + case 8: + message.primaryTactic = 8; + break; + case "DEFENSE_EVASION": + case 7: + message.primaryTactic = 7; + break; + case "CREDENTIAL_ACCESS": + case 9: + message.primaryTactic = 9; + break; + case "DISCOVERY": + case 10: + message.primaryTactic = 10; + break; + case "LATERAL_MOVEMENT": + case 11: + message.primaryTactic = 11; + break; + case "COLLECTION": + case 12: + message.primaryTactic = 12; + break; + case "COMMAND_AND_CONTROL": + case 4: + message.primaryTactic = 4; + break; + case "EXFILTRATION": + case 13: + message.primaryTactic = 13; + break; + case "IMPACT": + case 14: + message.primaryTactic = 14; + break; + } + if (object.primaryTechniques) { + if (!Array.isArray(object.primaryTechniques)) + throw TypeError(".google.cloud.securitycenter.v1.MitreAttack.primaryTechniques: array expected"); + message.primaryTechniques = []; + for (var i = 0; i < object.primaryTechniques.length; ++i) + switch (object.primaryTechniques[i]) { + default: + case "TECHNIQUE_UNSPECIFIED": + case 0: + message.primaryTechniques[i] = 0; + break; + case "ACTIVE_SCANNING": + case 1: + message.primaryTechniques[i] = 1; + break; + case "SCANNING_IP_BLOCKS": + case 2: + message.primaryTechniques[i] = 2; + break; + case "INGRESS_TOOL_TRANSFER": + case 3: + message.primaryTechniques[i] = 3; + break; + case "NATIVE_API": + case 4: + message.primaryTechniques[i] = 4; + break; + case "SHARED_MODULES": + case 5: + message.primaryTechniques[i] = 5; + break; + case "COMMAND_AND_SCRIPTING_INTERPRETER": + case 6: + message.primaryTechniques[i] = 6; + break; + case "UNIX_SHELL": + case 7: + message.primaryTechniques[i] = 7; + break; + case "RESOURCE_HIJACKING": + case 8: + message.primaryTechniques[i] = 8; + break; + case "PROXY": + case 9: + message.primaryTechniques[i] = 9; + break; + case "EXTERNAL_PROXY": + case 10: + message.primaryTechniques[i] = 10; + break; + case "MULTI_HOP_PROXY": + case 11: + message.primaryTechniques[i] = 11; + break; + case "DYNAMIC_RESOLUTION": + case 12: + message.primaryTechniques[i] = 12; + break; + case "UNSECURED_CREDENTIALS": + case 13: + message.primaryTechniques[i] = 13; + break; + case "VALID_ACCOUNTS": + case 14: + message.primaryTechniques[i] = 14; + break; + case "LOCAL_ACCOUNTS": + case 15: + message.primaryTechniques[i] = 15; + break; + case "CLOUD_ACCOUNTS": + case 16: + message.primaryTechniques[i] = 16; + break; + case "NETWORK_DENIAL_OF_SERVICE": + case 17: + message.primaryTechniques[i] = 17; + break; + case "PERMISSION_GROUPS_DISCOVERY": + case 18: + message.primaryTechniques[i] = 18; + break; + case "CLOUD_GROUPS": + case 19: + message.primaryTechniques[i] = 19; + break; + case "EXFILTRATION_OVER_WEB_SERVICE": + case 20: + message.primaryTechniques[i] = 20; + break; + case "EXFILTRATION_TO_CLOUD_STORAGE": + case 21: + message.primaryTechniques[i] = 21; + break; + case "ACCOUNT_MANIPULATION": + case 22: + message.primaryTechniques[i] = 22; + break; + case "SSH_AUTHORIZED_KEYS": + case 23: + message.primaryTechniques[i] = 23; + break; + case "CREATE_OR_MODIFY_SYSTEM_PROCESS": + case 24: + message.primaryTechniques[i] = 24; + break; + case "STEAL_WEB_SESSION_COOKIE": + case 25: + message.primaryTechniques[i] = 25; + break; + case "MODIFY_CLOUD_COMPUTE_INFRASTRUCTURE": + case 26: + message.primaryTechniques[i] = 26; + break; + case "EXPLOIT_PUBLIC_FACING_APPLICATION": + case 27: + message.primaryTechniques[i] = 27; + break; + case "MODIFY_AUTHENTICATION_PROCESS": + case 28: + message.primaryTechniques[i] = 28; + break; + } + } + if (object.additionalTactics) { + if (!Array.isArray(object.additionalTactics)) + throw TypeError(".google.cloud.securitycenter.v1.MitreAttack.additionalTactics: array expected"); + message.additionalTactics = []; + for (var i = 0; i < object.additionalTactics.length; ++i) + switch (object.additionalTactics[i]) { + default: + case "TACTIC_UNSPECIFIED": + case 0: + message.additionalTactics[i] = 0; + break; + case "RECONNAISSANCE": + case 1: + message.additionalTactics[i] = 1; + break; + case "RESOURCE_DEVELOPMENT": + case 2: + message.additionalTactics[i] = 2; + break; + case "INITIAL_ACCESS": + case 5: + message.additionalTactics[i] = 5; + break; + case "EXECUTION": + case 3: + message.additionalTactics[i] = 3; + break; + case "PERSISTENCE": + case 6: + message.additionalTactics[i] = 6; + break; + case "PRIVILEGE_ESCALATION": + case 8: + message.additionalTactics[i] = 8; + break; + case "DEFENSE_EVASION": + case 7: + message.additionalTactics[i] = 7; + break; + case "CREDENTIAL_ACCESS": + case 9: + message.additionalTactics[i] = 9; + break; + case "DISCOVERY": + case 10: + message.additionalTactics[i] = 10; + break; + case "LATERAL_MOVEMENT": + case 11: + message.additionalTactics[i] = 11; + break; + case "COLLECTION": + case 12: + message.additionalTactics[i] = 12; + break; + case "COMMAND_AND_CONTROL": + case 4: + message.additionalTactics[i] = 4; + break; + case "EXFILTRATION": + case 13: + message.additionalTactics[i] = 13; + break; + case "IMPACT": + case 14: + message.additionalTactics[i] = 14; + break; + } + } + if (object.additionalTechniques) { + if (!Array.isArray(object.additionalTechniques)) + throw TypeError(".google.cloud.securitycenter.v1.MitreAttack.additionalTechniques: array expected"); + message.additionalTechniques = []; + for (var i = 0; i < object.additionalTechniques.length; ++i) + switch (object.additionalTechniques[i]) { + default: + case "TECHNIQUE_UNSPECIFIED": + case 0: + message.additionalTechniques[i] = 0; + break; + case "ACTIVE_SCANNING": + case 1: + message.additionalTechniques[i] = 1; + break; + case "SCANNING_IP_BLOCKS": + case 2: + message.additionalTechniques[i] = 2; + break; + case "INGRESS_TOOL_TRANSFER": + case 3: + message.additionalTechniques[i] = 3; + break; + case "NATIVE_API": + case 4: + message.additionalTechniques[i] = 4; + break; + case "SHARED_MODULES": + case 5: + message.additionalTechniques[i] = 5; + break; + case "COMMAND_AND_SCRIPTING_INTERPRETER": + case 6: + message.additionalTechniques[i] = 6; + break; + case "UNIX_SHELL": + case 7: + message.additionalTechniques[i] = 7; + break; + case "RESOURCE_HIJACKING": + case 8: + message.additionalTechniques[i] = 8; + break; + case "PROXY": + case 9: + message.additionalTechniques[i] = 9; + break; + case "EXTERNAL_PROXY": + case 10: + message.additionalTechniques[i] = 10; + break; + case "MULTI_HOP_PROXY": + case 11: + message.additionalTechniques[i] = 11; + break; + case "DYNAMIC_RESOLUTION": + case 12: + message.additionalTechniques[i] = 12; + break; + case "UNSECURED_CREDENTIALS": + case 13: + message.additionalTechniques[i] = 13; + break; + case "VALID_ACCOUNTS": + case 14: + message.additionalTechniques[i] = 14; + break; + case "LOCAL_ACCOUNTS": + case 15: + message.additionalTechniques[i] = 15; + break; + case "CLOUD_ACCOUNTS": + case 16: + message.additionalTechniques[i] = 16; + break; + case "NETWORK_DENIAL_OF_SERVICE": + case 17: + message.additionalTechniques[i] = 17; + break; + case "PERMISSION_GROUPS_DISCOVERY": + case 18: + message.additionalTechniques[i] = 18; + break; + case "CLOUD_GROUPS": + case 19: + message.additionalTechniques[i] = 19; + break; + case "EXFILTRATION_OVER_WEB_SERVICE": + case 20: + message.additionalTechniques[i] = 20; + break; + case "EXFILTRATION_TO_CLOUD_STORAGE": + case 21: + message.additionalTechniques[i] = 21; + break; + case "ACCOUNT_MANIPULATION": + case 22: + message.additionalTechniques[i] = 22; + break; + case "SSH_AUTHORIZED_KEYS": + case 23: + message.additionalTechniques[i] = 23; + break; + case "CREATE_OR_MODIFY_SYSTEM_PROCESS": + case 24: + message.additionalTechniques[i] = 24; + break; + case "STEAL_WEB_SESSION_COOKIE": + case 25: + message.additionalTechniques[i] = 25; + break; + case "MODIFY_CLOUD_COMPUTE_INFRASTRUCTURE": + case 26: + message.additionalTechniques[i] = 26; + break; + case "EXPLOIT_PUBLIC_FACING_APPLICATION": + case 27: + message.additionalTechniques[i] = 27; + break; + case "MODIFY_AUTHENTICATION_PROCESS": + case 28: + message.additionalTechniques[i] = 28; + break; + } + } + if (object.version != null) + message.version = String(object.version); + return message; + }; + + /** + * Creates a plain object from a MitreAttack message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.MitreAttack + * @static + * @param {google.cloud.securitycenter.v1.MitreAttack} message MitreAttack + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MitreAttack.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.primaryTechniques = []; + object.additionalTactics = []; + object.additionalTechniques = []; + } + if (options.defaults) { + object.primaryTactic = options.enums === String ? "TACTIC_UNSPECIFIED" : 0; + object.version = ""; + } + if (message.primaryTactic != null && message.hasOwnProperty("primaryTactic")) + object.primaryTactic = options.enums === String ? $root.google.cloud.securitycenter.v1.MitreAttack.Tactic[message.primaryTactic] : message.primaryTactic; + if (message.primaryTechniques && message.primaryTechniques.length) { + object.primaryTechniques = []; + for (var j = 0; j < message.primaryTechniques.length; ++j) + object.primaryTechniques[j] = options.enums === String ? $root.google.cloud.securitycenter.v1.MitreAttack.Technique[message.primaryTechniques[j]] : message.primaryTechniques[j]; + } + if (message.additionalTactics && message.additionalTactics.length) { + object.additionalTactics = []; + for (var j = 0; j < message.additionalTactics.length; ++j) + object.additionalTactics[j] = options.enums === String ? $root.google.cloud.securitycenter.v1.MitreAttack.Tactic[message.additionalTactics[j]] : message.additionalTactics[j]; + } + if (message.additionalTechniques && message.additionalTechniques.length) { + object.additionalTechniques = []; + for (var j = 0; j < message.additionalTechniques.length; ++j) + object.additionalTechniques[j] = options.enums === String ? $root.google.cloud.securitycenter.v1.MitreAttack.Technique[message.additionalTechniques[j]] : message.additionalTechniques[j]; + } + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + return object; + }; + + /** + * Converts this MitreAttack to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.MitreAttack + * @instance + * @returns {Object.} JSON object + */ + MitreAttack.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Tactic enum. + * @name google.cloud.securitycenter.v1.MitreAttack.Tactic + * @enum {number} + * @property {number} TACTIC_UNSPECIFIED=0 TACTIC_UNSPECIFIED value + * @property {number} RECONNAISSANCE=1 RECONNAISSANCE value + * @property {number} RESOURCE_DEVELOPMENT=2 RESOURCE_DEVELOPMENT value + * @property {number} INITIAL_ACCESS=5 INITIAL_ACCESS value + * @property {number} EXECUTION=3 EXECUTION value + * @property {number} PERSISTENCE=6 PERSISTENCE value + * @property {number} PRIVILEGE_ESCALATION=8 PRIVILEGE_ESCALATION value + * @property {number} DEFENSE_EVASION=7 DEFENSE_EVASION value + * @property {number} CREDENTIAL_ACCESS=9 CREDENTIAL_ACCESS value + * @property {number} DISCOVERY=10 DISCOVERY value + * @property {number} LATERAL_MOVEMENT=11 LATERAL_MOVEMENT value + * @property {number} COLLECTION=12 COLLECTION value + * @property {number} COMMAND_AND_CONTROL=4 COMMAND_AND_CONTROL value + * @property {number} EXFILTRATION=13 EXFILTRATION value + * @property {number} IMPACT=14 IMPACT value + */ + MitreAttack.Tactic = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TACTIC_UNSPECIFIED"] = 0; + values[valuesById[1] = "RECONNAISSANCE"] = 1; + values[valuesById[2] = "RESOURCE_DEVELOPMENT"] = 2; + values[valuesById[5] = "INITIAL_ACCESS"] = 5; + values[valuesById[3] = "EXECUTION"] = 3; + values[valuesById[6] = "PERSISTENCE"] = 6; + values[valuesById[8] = "PRIVILEGE_ESCALATION"] = 8; + values[valuesById[7] = "DEFENSE_EVASION"] = 7; + values[valuesById[9] = "CREDENTIAL_ACCESS"] = 9; + values[valuesById[10] = "DISCOVERY"] = 10; + values[valuesById[11] = "LATERAL_MOVEMENT"] = 11; + values[valuesById[12] = "COLLECTION"] = 12; + values[valuesById[4] = "COMMAND_AND_CONTROL"] = 4; + values[valuesById[13] = "EXFILTRATION"] = 13; + values[valuesById[14] = "IMPACT"] = 14; + return values; + })(); + + /** + * Technique enum. + * @name google.cloud.securitycenter.v1.MitreAttack.Technique + * @enum {number} + * @property {number} TECHNIQUE_UNSPECIFIED=0 TECHNIQUE_UNSPECIFIED value + * @property {number} ACTIVE_SCANNING=1 ACTIVE_SCANNING value + * @property {number} SCANNING_IP_BLOCKS=2 SCANNING_IP_BLOCKS value + * @property {number} INGRESS_TOOL_TRANSFER=3 INGRESS_TOOL_TRANSFER value + * @property {number} NATIVE_API=4 NATIVE_API value + * @property {number} SHARED_MODULES=5 SHARED_MODULES value + * @property {number} COMMAND_AND_SCRIPTING_INTERPRETER=6 COMMAND_AND_SCRIPTING_INTERPRETER value + * @property {number} UNIX_SHELL=7 UNIX_SHELL value + * @property {number} RESOURCE_HIJACKING=8 RESOURCE_HIJACKING value + * @property {number} PROXY=9 PROXY value + * @property {number} EXTERNAL_PROXY=10 EXTERNAL_PROXY value + * @property {number} MULTI_HOP_PROXY=11 MULTI_HOP_PROXY value + * @property {number} DYNAMIC_RESOLUTION=12 DYNAMIC_RESOLUTION value + * @property {number} UNSECURED_CREDENTIALS=13 UNSECURED_CREDENTIALS value + * @property {number} VALID_ACCOUNTS=14 VALID_ACCOUNTS value + * @property {number} LOCAL_ACCOUNTS=15 LOCAL_ACCOUNTS value + * @property {number} CLOUD_ACCOUNTS=16 CLOUD_ACCOUNTS value + * @property {number} NETWORK_DENIAL_OF_SERVICE=17 NETWORK_DENIAL_OF_SERVICE value + * @property {number} PERMISSION_GROUPS_DISCOVERY=18 PERMISSION_GROUPS_DISCOVERY value + * @property {number} CLOUD_GROUPS=19 CLOUD_GROUPS value + * @property {number} EXFILTRATION_OVER_WEB_SERVICE=20 EXFILTRATION_OVER_WEB_SERVICE value + * @property {number} EXFILTRATION_TO_CLOUD_STORAGE=21 EXFILTRATION_TO_CLOUD_STORAGE value + * @property {number} ACCOUNT_MANIPULATION=22 ACCOUNT_MANIPULATION value + * @property {number} SSH_AUTHORIZED_KEYS=23 SSH_AUTHORIZED_KEYS value + * @property {number} CREATE_OR_MODIFY_SYSTEM_PROCESS=24 CREATE_OR_MODIFY_SYSTEM_PROCESS value + * @property {number} STEAL_WEB_SESSION_COOKIE=25 STEAL_WEB_SESSION_COOKIE value + * @property {number} MODIFY_CLOUD_COMPUTE_INFRASTRUCTURE=26 MODIFY_CLOUD_COMPUTE_INFRASTRUCTURE value + * @property {number} EXPLOIT_PUBLIC_FACING_APPLICATION=27 EXPLOIT_PUBLIC_FACING_APPLICATION value + * @property {number} MODIFY_AUTHENTICATION_PROCESS=28 MODIFY_AUTHENTICATION_PROCESS value + */ + MitreAttack.Technique = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TECHNIQUE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ACTIVE_SCANNING"] = 1; + values[valuesById[2] = "SCANNING_IP_BLOCKS"] = 2; + values[valuesById[3] = "INGRESS_TOOL_TRANSFER"] = 3; + values[valuesById[4] = "NATIVE_API"] = 4; + values[valuesById[5] = "SHARED_MODULES"] = 5; + values[valuesById[6] = "COMMAND_AND_SCRIPTING_INTERPRETER"] = 6; + values[valuesById[7] = "UNIX_SHELL"] = 7; + values[valuesById[8] = "RESOURCE_HIJACKING"] = 8; + values[valuesById[9] = "PROXY"] = 9; + values[valuesById[10] = "EXTERNAL_PROXY"] = 10; + values[valuesById[11] = "MULTI_HOP_PROXY"] = 11; + values[valuesById[12] = "DYNAMIC_RESOLUTION"] = 12; + values[valuesById[13] = "UNSECURED_CREDENTIALS"] = 13; + values[valuesById[14] = "VALID_ACCOUNTS"] = 14; + values[valuesById[15] = "LOCAL_ACCOUNTS"] = 15; + values[valuesById[16] = "CLOUD_ACCOUNTS"] = 16; + values[valuesById[17] = "NETWORK_DENIAL_OF_SERVICE"] = 17; + values[valuesById[18] = "PERMISSION_GROUPS_DISCOVERY"] = 18; + values[valuesById[19] = "CLOUD_GROUPS"] = 19; + values[valuesById[20] = "EXFILTRATION_OVER_WEB_SERVICE"] = 20; + values[valuesById[21] = "EXFILTRATION_TO_CLOUD_STORAGE"] = 21; + values[valuesById[22] = "ACCOUNT_MANIPULATION"] = 22; + values[valuesById[23] = "SSH_AUTHORIZED_KEYS"] = 23; + values[valuesById[24] = "CREATE_OR_MODIFY_SYSTEM_PROCESS"] = 24; + values[valuesById[25] = "STEAL_WEB_SESSION_COOKIE"] = 25; + values[valuesById[26] = "MODIFY_CLOUD_COMPUTE_INFRASTRUCTURE"] = 26; + values[valuesById[27] = "EXPLOIT_PUBLIC_FACING_APPLICATION"] = 27; + values[valuesById[28] = "MODIFY_AUTHENTICATION_PROCESS"] = 28; + return values; + })(); + + return MitreAttack; + })(); + v1.Vulnerability = (function() { /** @@ -3672,6 +4974,7 @@ * @property {string|null} [id] Cve id * @property {Array.|null} [references] Cve references * @property {google.cloud.securitycenter.v1.ICvssv3|null} [cvssv3] Cve cvssv3 + * @property {boolean|null} [upstreamFixAvailable] Cve upstreamFixAvailable */ /** @@ -3714,6 +5017,14 @@ */ Cve.prototype.cvssv3 = null; + /** + * Cve upstreamFixAvailable. + * @member {boolean} upstreamFixAvailable + * @memberof google.cloud.securitycenter.v1.Cve + * @instance + */ + Cve.prototype.upstreamFixAvailable = false; + /** * Creates a new Cve instance using the specified properties. * @function create @@ -3745,6 +5056,8 @@ $root.google.cloud.securitycenter.v1.Reference.encode(message.references[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); if (message.cvssv3 != null && Object.hasOwnProperty.call(message, "cvssv3")) $root.google.cloud.securitycenter.v1.Cvssv3.encode(message.cvssv3, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.upstreamFixAvailable != null && Object.hasOwnProperty.call(message, "upstreamFixAvailable")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.upstreamFixAvailable); return writer; }; @@ -3790,6 +5103,9 @@ case 3: message.cvssv3 = $root.google.cloud.securitycenter.v1.Cvssv3.decode(reader, reader.uint32()); break; + case 4: + message.upstreamFixAvailable = reader.bool(); + break; default: reader.skipType(tag & 7); break; @@ -3842,6 +5158,9 @@ if (error) return "cvssv3." + error; } + if (message.upstreamFixAvailable != null && message.hasOwnProperty("upstreamFixAvailable")) + if (typeof message.upstreamFixAvailable !== "boolean") + return "upstreamFixAvailable: boolean expected"; return null; }; @@ -3874,6 +5193,8 @@ throw TypeError(".google.cloud.securitycenter.v1.Cve.cvssv3: object expected"); message.cvssv3 = $root.google.cloud.securitycenter.v1.Cvssv3.fromObject(object.cvssv3); } + if (object.upstreamFixAvailable != null) + message.upstreamFixAvailable = Boolean(object.upstreamFixAvailable); return message; }; @@ -3895,6 +5216,7 @@ if (options.defaults) { object.id = ""; object.cvssv3 = null; + object.upstreamFixAvailable = false; } if (message.id != null && message.hasOwnProperty("id")) object.id = message.id; @@ -3905,6 +5227,8 @@ } if (message.cvssv3 != null && message.hasOwnProperty("cvssv3")) object.cvssv3 = $root.google.cloud.securitycenter.v1.Cvssv3.toObject(message.cvssv3, options); + if (message.upstreamFixAvailable != null && message.hasOwnProperty("upstreamFixAvailable")) + object.upstreamFixAvailable = message.upstreamFixAvailable; return object; }; @@ -7273,6 +8597,39 @@ * @variation 2 */ + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#getBigQueryExport}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef GetBigQueryExportCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1.BigQueryExport} [response] BigQueryExport + */ + + /** + * Calls GetBigQueryExport. + * @function getBigQueryExport + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IGetBigQueryExportRequest} request GetBigQueryExportRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.GetBigQueryExportCallback} callback Node-style callback called with the error, if any, and BigQueryExport + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.getBigQueryExport = function getBigQueryExport(request, callback) { + return this.rpcCall(getBigQueryExport, $root.google.cloud.securitycenter.v1.GetBigQueryExportRequest, $root.google.cloud.securitycenter.v1.BigQueryExport, request, callback); + }, "name", { value: "GetBigQueryExport" }); + + /** + * Calls GetBigQueryExport. + * @function getBigQueryExport + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IGetBigQueryExportRequest} request GetBigQueryExportRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + /** * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#getIamPolicy}. * @memberof google.cloud.securitycenter.v1.SecurityCenter @@ -8065,6 +9422,138 @@ * @variation 2 */ + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#createBigQueryExport}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef CreateBigQueryExportCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1.BigQueryExport} [response] BigQueryExport + */ + + /** + * Calls CreateBigQueryExport. + * @function createBigQueryExport + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.ICreateBigQueryExportRequest} request CreateBigQueryExportRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.CreateBigQueryExportCallback} callback Node-style callback called with the error, if any, and BigQueryExport + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.createBigQueryExport = function createBigQueryExport(request, callback) { + return this.rpcCall(createBigQueryExport, $root.google.cloud.securitycenter.v1.CreateBigQueryExportRequest, $root.google.cloud.securitycenter.v1.BigQueryExport, request, callback); + }, "name", { value: "CreateBigQueryExport" }); + + /** + * Calls CreateBigQueryExport. + * @function createBigQueryExport + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.ICreateBigQueryExportRequest} request CreateBigQueryExportRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#deleteBigQueryExport}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef DeleteBigQueryExportCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteBigQueryExport. + * @function deleteBigQueryExport + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IDeleteBigQueryExportRequest} request DeleteBigQueryExportRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.DeleteBigQueryExportCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.deleteBigQueryExport = function deleteBigQueryExport(request, callback) { + return this.rpcCall(deleteBigQueryExport, $root.google.cloud.securitycenter.v1.DeleteBigQueryExportRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteBigQueryExport" }); + + /** + * Calls DeleteBigQueryExport. + * @function deleteBigQueryExport + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IDeleteBigQueryExportRequest} request DeleteBigQueryExportRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#updateBigQueryExport}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef UpdateBigQueryExportCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1.BigQueryExport} [response] BigQueryExport + */ + + /** + * Calls UpdateBigQueryExport. + * @function updateBigQueryExport + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IUpdateBigQueryExportRequest} request UpdateBigQueryExportRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.UpdateBigQueryExportCallback} callback Node-style callback called with the error, if any, and BigQueryExport + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.updateBigQueryExport = function updateBigQueryExport(request, callback) { + return this.rpcCall(updateBigQueryExport, $root.google.cloud.securitycenter.v1.UpdateBigQueryExportRequest, $root.google.cloud.securitycenter.v1.BigQueryExport, request, callback); + }, "name", { value: "UpdateBigQueryExport" }); + + /** + * Calls UpdateBigQueryExport. + * @function updateBigQueryExport + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IUpdateBigQueryExportRequest} request UpdateBigQueryExportRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#listBigQueryExports}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef ListBigQueryExportsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1.ListBigQueryExportsResponse} [response] ListBigQueryExportsResponse + */ + + /** + * Calls ListBigQueryExports. + * @function listBigQueryExports + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IListBigQueryExportsRequest} request ListBigQueryExportsRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.ListBigQueryExportsCallback} callback Node-style callback called with the error, if any, and ListBigQueryExportsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.listBigQueryExports = function listBigQueryExports(request, callback) { + return this.rpcCall(listBigQueryExports, $root.google.cloud.securitycenter.v1.ListBigQueryExportsRequest, $root.google.cloud.securitycenter.v1.ListBigQueryExportsResponse, request, callback); + }, "name", { value: "ListBigQueryExports" }); + + /** + * Calls ListBigQueryExports. + * @function listBigQueryExports + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IListBigQueryExportsRequest} request ListBigQueryExportsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + return SecurityCenter; })(); @@ -9760,6 +11249,193 @@ return DeleteNotificationConfigRequest; })(); + v1.GetBigQueryExportRequest = (function() { + + /** + * Properties of a GetBigQueryExportRequest. + * @memberof google.cloud.securitycenter.v1 + * @interface IGetBigQueryExportRequest + * @property {string|null} [name] GetBigQueryExportRequest name + */ + + /** + * Constructs a new GetBigQueryExportRequest. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a GetBigQueryExportRequest. + * @implements IGetBigQueryExportRequest + * @constructor + * @param {google.cloud.securitycenter.v1.IGetBigQueryExportRequest=} [properties] Properties to set + */ + function GetBigQueryExportRequest(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]]; + } + + /** + * GetBigQueryExportRequest name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1.GetBigQueryExportRequest + * @instance + */ + GetBigQueryExportRequest.prototype.name = ""; + + /** + * Creates a new GetBigQueryExportRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.GetBigQueryExportRequest + * @static + * @param {google.cloud.securitycenter.v1.IGetBigQueryExportRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.GetBigQueryExportRequest} GetBigQueryExportRequest instance + */ + GetBigQueryExportRequest.create = function create(properties) { + return new GetBigQueryExportRequest(properties); + }; + + /** + * Encodes the specified GetBigQueryExportRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.GetBigQueryExportRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.GetBigQueryExportRequest + * @static + * @param {google.cloud.securitycenter.v1.IGetBigQueryExportRequest} message GetBigQueryExportRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetBigQueryExportRequest.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 GetBigQueryExportRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.GetBigQueryExportRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.GetBigQueryExportRequest + * @static + * @param {google.cloud.securitycenter.v1.IGetBigQueryExportRequest} message GetBigQueryExportRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetBigQueryExportRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetBigQueryExportRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.GetBigQueryExportRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.GetBigQueryExportRequest} GetBigQueryExportRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetBigQueryExportRequest.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.cloud.securitycenter.v1.GetBigQueryExportRequest(); + 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 GetBigQueryExportRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.GetBigQueryExportRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.GetBigQueryExportRequest} GetBigQueryExportRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetBigQueryExportRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetBigQueryExportRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1.GetBigQueryExportRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetBigQueryExportRequest.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 GetBigQueryExportRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.GetBigQueryExportRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.GetBigQueryExportRequest} GetBigQueryExportRequest + */ + GetBigQueryExportRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.GetBigQueryExportRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1.GetBigQueryExportRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetBigQueryExportRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.GetBigQueryExportRequest + * @static + * @param {google.cloud.securitycenter.v1.GetBigQueryExportRequest} message GetBigQueryExportRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetBigQueryExportRequest.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 GetBigQueryExportRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.GetBigQueryExportRequest + * @instance + * @returns {Object.} JSON object + */ + GetBigQueryExportRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetBigQueryExportRequest; + })(); + v1.GetMuteConfigRequest = (function() { /** @@ -17813,27 +19489,26 @@ return UpdateSecurityMarksRequest; })(); - v1.Source = (function() { + v1.CreateBigQueryExportRequest = (function() { /** - * Properties of a Source. + * Properties of a CreateBigQueryExportRequest. * @memberof google.cloud.securitycenter.v1 - * @interface ISource - * @property {string|null} [name] Source name - * @property {string|null} [displayName] Source displayName - * @property {string|null} [description] Source description - * @property {string|null} [canonicalName] Source canonicalName + * @interface ICreateBigQueryExportRequest + * @property {string|null} [parent] CreateBigQueryExportRequest parent + * @property {google.cloud.securitycenter.v1.IBigQueryExport|null} [bigQueryExport] CreateBigQueryExportRequest bigQueryExport + * @property {string|null} [bigQueryExportId] CreateBigQueryExportRequest bigQueryExportId */ /** - * Constructs a new Source. + * Constructs a new CreateBigQueryExportRequest. * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents a Source. - * @implements ISource + * @classdesc Represents a CreateBigQueryExportRequest. + * @implements ICreateBigQueryExportRequest * @constructor - * @param {google.cloud.securitycenter.v1.ISource=} [properties] Properties to set + * @param {google.cloud.securitycenter.v1.ICreateBigQueryExportRequest=} [properties] Properties to set */ - function Source(properties) { + function CreateBigQueryExportRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -17841,114 +19516,101 @@ } /** - * Source name. - * @member {string} name - * @memberof google.cloud.securitycenter.v1.Source - * @instance - */ - Source.prototype.name = ""; - - /** - * Source displayName. - * @member {string} displayName - * @memberof google.cloud.securitycenter.v1.Source + * CreateBigQueryExportRequest parent. + * @member {string} parent + * @memberof google.cloud.securitycenter.v1.CreateBigQueryExportRequest * @instance */ - Source.prototype.displayName = ""; + CreateBigQueryExportRequest.prototype.parent = ""; /** - * Source description. - * @member {string} description - * @memberof google.cloud.securitycenter.v1.Source + * CreateBigQueryExportRequest bigQueryExport. + * @member {google.cloud.securitycenter.v1.IBigQueryExport|null|undefined} bigQueryExport + * @memberof google.cloud.securitycenter.v1.CreateBigQueryExportRequest * @instance */ - Source.prototype.description = ""; + CreateBigQueryExportRequest.prototype.bigQueryExport = null; /** - * Source canonicalName. - * @member {string} canonicalName - * @memberof google.cloud.securitycenter.v1.Source + * CreateBigQueryExportRequest bigQueryExportId. + * @member {string} bigQueryExportId + * @memberof google.cloud.securitycenter.v1.CreateBigQueryExportRequest * @instance */ - Source.prototype.canonicalName = ""; + CreateBigQueryExportRequest.prototype.bigQueryExportId = ""; /** - * Creates a new Source instance using the specified properties. + * Creates a new CreateBigQueryExportRequest instance using the specified properties. * @function create - * @memberof google.cloud.securitycenter.v1.Source + * @memberof google.cloud.securitycenter.v1.CreateBigQueryExportRequest * @static - * @param {google.cloud.securitycenter.v1.ISource=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.Source} Source instance + * @param {google.cloud.securitycenter.v1.ICreateBigQueryExportRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.CreateBigQueryExportRequest} CreateBigQueryExportRequest instance */ - Source.create = function create(properties) { - return new Source(properties); + CreateBigQueryExportRequest.create = function create(properties) { + return new CreateBigQueryExportRequest(properties); }; /** - * Encodes the specified Source message. Does not implicitly {@link google.cloud.securitycenter.v1.Source.verify|verify} messages. + * Encodes the specified CreateBigQueryExportRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.CreateBigQueryExportRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.securitycenter.v1.Source + * @memberof google.cloud.securitycenter.v1.CreateBigQueryExportRequest * @static - * @param {google.cloud.securitycenter.v1.ISource} message Source message or plain object to encode + * @param {google.cloud.securitycenter.v1.ICreateBigQueryExportRequest} message CreateBigQueryExportRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Source.encode = function encode(message, writer) { + CreateBigQueryExportRequest.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.displayName != null && Object.hasOwnProperty.call(message, "displayName")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); - if (message.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); - if (message.canonicalName != null && Object.hasOwnProperty.call(message, "canonicalName")) - writer.uint32(/* id 14, wireType 2 =*/114).string(message.canonicalName); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.bigQueryExport != null && Object.hasOwnProperty.call(message, "bigQueryExport")) + $root.google.cloud.securitycenter.v1.BigQueryExport.encode(message.bigQueryExport, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.bigQueryExportId != null && Object.hasOwnProperty.call(message, "bigQueryExportId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.bigQueryExportId); return writer; }; /** - * Encodes the specified Source message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Source.verify|verify} messages. + * Encodes the specified CreateBigQueryExportRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.CreateBigQueryExportRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.Source + * @memberof google.cloud.securitycenter.v1.CreateBigQueryExportRequest * @static - * @param {google.cloud.securitycenter.v1.ISource} message Source message or plain object to encode + * @param {google.cloud.securitycenter.v1.ICreateBigQueryExportRequest} message CreateBigQueryExportRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Source.encodeDelimited = function encodeDelimited(message, writer) { + CreateBigQueryExportRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a Source message from the specified reader or buffer. + * Decodes a CreateBigQueryExportRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.securitycenter.v1.Source + * @memberof google.cloud.securitycenter.v1.CreateBigQueryExportRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.Source} Source + * @returns {google.cloud.securitycenter.v1.CreateBigQueryExportRequest} CreateBigQueryExportRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Source.decode = function decode(reader, length) { + CreateBigQueryExportRequest.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.cloud.securitycenter.v1.Source(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.CreateBigQueryExportRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.name = reader.string(); + message.parent = reader.string(); break; case 2: - message.displayName = reader.string(); + message.bigQueryExport = $root.google.cloud.securitycenter.v1.BigQueryExport.decode(reader, reader.uint32()); break; case 3: - message.description = reader.string(); - break; - case 14: - message.canonicalName = reader.string(); + message.bigQueryExportId = reader.string(); break; default: reader.skipType(tag & 7); @@ -17959,150 +19621,130 @@ }; /** - * Decodes a Source message from the specified reader or buffer, length delimited. + * Decodes a CreateBigQueryExportRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.Source + * @memberof google.cloud.securitycenter.v1.CreateBigQueryExportRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.Source} Source + * @returns {google.cloud.securitycenter.v1.CreateBigQueryExportRequest} CreateBigQueryExportRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Source.decodeDelimited = function decodeDelimited(reader) { + CreateBigQueryExportRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a Source message. + * Verifies a CreateBigQueryExportRequest message. * @function verify - * @memberof google.cloud.securitycenter.v1.Source + * @memberof google.cloud.securitycenter.v1.CreateBigQueryExportRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Source.verify = function verify(message) { + CreateBigQueryExportRequest.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.displayName != null && message.hasOwnProperty("displayName")) - if (!$util.isString(message.displayName)) - return "displayName: string expected"; - if (message.description != null && message.hasOwnProperty("description")) - if (!$util.isString(message.description)) - return "description: string expected"; - if (message.canonicalName != null && message.hasOwnProperty("canonicalName")) - if (!$util.isString(message.canonicalName)) - return "canonicalName: string expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.bigQueryExport != null && message.hasOwnProperty("bigQueryExport")) { + var error = $root.google.cloud.securitycenter.v1.BigQueryExport.verify(message.bigQueryExport); + if (error) + return "bigQueryExport." + error; + } + if (message.bigQueryExportId != null && message.hasOwnProperty("bigQueryExportId")) + if (!$util.isString(message.bigQueryExportId)) + return "bigQueryExportId: string expected"; return null; }; /** - * Creates a Source message from a plain object. Also converts values to their respective internal types. + * Creates a CreateBigQueryExportRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.securitycenter.v1.Source + * @memberof google.cloud.securitycenter.v1.CreateBigQueryExportRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.Source} Source + * @returns {google.cloud.securitycenter.v1.CreateBigQueryExportRequest} CreateBigQueryExportRequest */ - Source.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.Source) + CreateBigQueryExportRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.CreateBigQueryExportRequest) return object; - var message = new $root.google.cloud.securitycenter.v1.Source(); - if (object.name != null) - message.name = String(object.name); - if (object.displayName != null) - message.displayName = String(object.displayName); - if (object.description != null) - message.description = String(object.description); - if (object.canonicalName != null) - message.canonicalName = String(object.canonicalName); + var message = new $root.google.cloud.securitycenter.v1.CreateBigQueryExportRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.bigQueryExport != null) { + if (typeof object.bigQueryExport !== "object") + throw TypeError(".google.cloud.securitycenter.v1.CreateBigQueryExportRequest.bigQueryExport: object expected"); + message.bigQueryExport = $root.google.cloud.securitycenter.v1.BigQueryExport.fromObject(object.bigQueryExport); + } + if (object.bigQueryExportId != null) + message.bigQueryExportId = String(object.bigQueryExportId); return message; }; /** - * Creates a plain object from a Source message. Also converts values to other types if specified. + * Creates a plain object from a CreateBigQueryExportRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.securitycenter.v1.Source + * @memberof google.cloud.securitycenter.v1.CreateBigQueryExportRequest * @static - * @param {google.cloud.securitycenter.v1.Source} message Source + * @param {google.cloud.securitycenter.v1.CreateBigQueryExportRequest} message CreateBigQueryExportRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Source.toObject = function toObject(message, options) { + CreateBigQueryExportRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.name = ""; - object.displayName = ""; - object.description = ""; - object.canonicalName = ""; + object.parent = ""; + object.bigQueryExport = null; + object.bigQueryExportId = ""; } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.displayName != null && message.hasOwnProperty("displayName")) - object.displayName = message.displayName; - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; - if (message.canonicalName != null && message.hasOwnProperty("canonicalName")) - object.canonicalName = message.canonicalName; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.bigQueryExport != null && message.hasOwnProperty("bigQueryExport")) + object.bigQueryExport = $root.google.cloud.securitycenter.v1.BigQueryExport.toObject(message.bigQueryExport, options); + if (message.bigQueryExportId != null && message.hasOwnProperty("bigQueryExportId")) + object.bigQueryExportId = message.bigQueryExportId; return object; }; /** - * Converts this Source to JSON. + * Converts this CreateBigQueryExportRequest to JSON. * @function toJSON - * @memberof google.cloud.securitycenter.v1.Source + * @memberof google.cloud.securitycenter.v1.CreateBigQueryExportRequest * @instance * @returns {Object.} JSON object */ - Source.prototype.toJSON = function toJSON() { + CreateBigQueryExportRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return Source; + return CreateBigQueryExportRequest; })(); - return v1; - })(); - - securitycenter.v1beta1 = (function() { - - /** - * Namespace v1beta1. - * @memberof google.cloud.securitycenter - * @namespace - */ - var v1beta1 = {}; - - v1beta1.Asset = (function() { + v1.UpdateBigQueryExportRequest = (function() { /** - * Properties of an Asset. - * @memberof google.cloud.securitycenter.v1beta1 - * @interface IAsset - * @property {string|null} [name] Asset name - * @property {google.cloud.securitycenter.v1beta1.Asset.ISecurityCenterProperties|null} [securityCenterProperties] Asset securityCenterProperties - * @property {Object.|null} [resourceProperties] Asset resourceProperties - * @property {google.cloud.securitycenter.v1beta1.ISecurityMarks|null} [securityMarks] Asset securityMarks - * @property {google.protobuf.ITimestamp|null} [createTime] Asset createTime - * @property {google.protobuf.ITimestamp|null} [updateTime] Asset updateTime + * Properties of an UpdateBigQueryExportRequest. + * @memberof google.cloud.securitycenter.v1 + * @interface IUpdateBigQueryExportRequest + * @property {google.cloud.securitycenter.v1.IBigQueryExport|null} [bigQueryExport] UpdateBigQueryExportRequest bigQueryExport + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateBigQueryExportRequest updateMask */ /** - * Constructs a new Asset. - * @memberof google.cloud.securitycenter.v1beta1 - * @classdesc Represents an Asset. - * @implements IAsset + * Constructs a new UpdateBigQueryExportRequest. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents an UpdateBigQueryExportRequest. + * @implements IUpdateBigQueryExportRequest * @constructor - * @param {google.cloud.securitycenter.v1beta1.IAsset=} [properties] Properties to set + * @param {google.cloud.securitycenter.v1.IUpdateBigQueryExportRequest=} [properties] Properties to set */ - function Asset(properties) { - this.resourceProperties = {}; + function UpdateBigQueryExportRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -18110,162 +19752,88 @@ } /** - * Asset name. - * @member {string} name - * @memberof google.cloud.securitycenter.v1beta1.Asset - * @instance - */ - Asset.prototype.name = ""; - - /** - * Asset securityCenterProperties. - * @member {google.cloud.securitycenter.v1beta1.Asset.ISecurityCenterProperties|null|undefined} securityCenterProperties - * @memberof google.cloud.securitycenter.v1beta1.Asset - * @instance - */ - Asset.prototype.securityCenterProperties = null; - - /** - * Asset resourceProperties. - * @member {Object.} resourceProperties - * @memberof google.cloud.securitycenter.v1beta1.Asset - * @instance - */ - Asset.prototype.resourceProperties = $util.emptyObject; - - /** - * Asset securityMarks. - * @member {google.cloud.securitycenter.v1beta1.ISecurityMarks|null|undefined} securityMarks - * @memberof google.cloud.securitycenter.v1beta1.Asset - * @instance - */ - Asset.prototype.securityMarks = null; - - /** - * Asset createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.securitycenter.v1beta1.Asset + * UpdateBigQueryExportRequest bigQueryExport. + * @member {google.cloud.securitycenter.v1.IBigQueryExport|null|undefined} bigQueryExport + * @memberof google.cloud.securitycenter.v1.UpdateBigQueryExportRequest * @instance */ - Asset.prototype.createTime = null; + UpdateBigQueryExportRequest.prototype.bigQueryExport = null; /** - * Asset updateTime. - * @member {google.protobuf.ITimestamp|null|undefined} updateTime - * @memberof google.cloud.securitycenter.v1beta1.Asset + * UpdateBigQueryExportRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.securitycenter.v1.UpdateBigQueryExportRequest * @instance */ - Asset.prototype.updateTime = null; + UpdateBigQueryExportRequest.prototype.updateMask = null; /** - * Creates a new Asset instance using the specified properties. + * Creates a new UpdateBigQueryExportRequest instance using the specified properties. * @function create - * @memberof google.cloud.securitycenter.v1beta1.Asset + * @memberof google.cloud.securitycenter.v1.UpdateBigQueryExportRequest * @static - * @param {google.cloud.securitycenter.v1beta1.IAsset=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1beta1.Asset} Asset instance + * @param {google.cloud.securitycenter.v1.IUpdateBigQueryExportRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.UpdateBigQueryExportRequest} UpdateBigQueryExportRequest instance */ - Asset.create = function create(properties) { - return new Asset(properties); + UpdateBigQueryExportRequest.create = function create(properties) { + return new UpdateBigQueryExportRequest(properties); }; /** - * Encodes the specified Asset message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.Asset.verify|verify} messages. + * Encodes the specified UpdateBigQueryExportRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.UpdateBigQueryExportRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.securitycenter.v1beta1.Asset + * @memberof google.cloud.securitycenter.v1.UpdateBigQueryExportRequest * @static - * @param {google.cloud.securitycenter.v1beta1.IAsset} message Asset message or plain object to encode + * @param {google.cloud.securitycenter.v1.IUpdateBigQueryExportRequest} message UpdateBigQueryExportRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Asset.encode = function encode(message, writer) { + UpdateBigQueryExportRequest.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.securityCenterProperties != null && Object.hasOwnProperty.call(message, "securityCenterProperties")) - $root.google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties.encode(message.securityCenterProperties, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.resourceProperties != null && Object.hasOwnProperty.call(message, "resourceProperties")) - for (var keys = Object.keys(message.resourceProperties), i = 0; i < keys.length; ++i) { - writer.uint32(/* id 7, wireType 2 =*/58).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); - $root.google.protobuf.Value.encode(message.resourceProperties[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); - } - if (message.securityMarks != null && Object.hasOwnProperty.call(message, "securityMarks")) - $root.google.cloud.securitycenter.v1beta1.SecurityMarks.encode(message.securityMarks, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) - $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.bigQueryExport != null && Object.hasOwnProperty.call(message, "bigQueryExport")) + $root.google.cloud.securitycenter.v1.BigQueryExport.encode(message.bigQueryExport, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** - * Encodes the specified Asset message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.Asset.verify|verify} messages. + * Encodes the specified UpdateBigQueryExportRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.UpdateBigQueryExportRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1beta1.Asset + * @memberof google.cloud.securitycenter.v1.UpdateBigQueryExportRequest * @static - * @param {google.cloud.securitycenter.v1beta1.IAsset} message Asset message or plain object to encode + * @param {google.cloud.securitycenter.v1.IUpdateBigQueryExportRequest} message UpdateBigQueryExportRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Asset.encodeDelimited = function encodeDelimited(message, writer) { + UpdateBigQueryExportRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an Asset message from the specified reader or buffer. + * Decodes an UpdateBigQueryExportRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.securitycenter.v1beta1.Asset + * @memberof google.cloud.securitycenter.v1.UpdateBigQueryExportRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1beta1.Asset} Asset + * @returns {google.cloud.securitycenter.v1.UpdateBigQueryExportRequest} UpdateBigQueryExportRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Asset.decode = function decode(reader, length) { + UpdateBigQueryExportRequest.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.cloud.securitycenter.v1beta1.Asset(), key, value; + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.UpdateBigQueryExportRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.name = reader.string(); + message.bigQueryExport = $root.google.cloud.securitycenter.v1.BigQueryExport.decode(reader, reader.uint32()); break; case 2: - message.securityCenterProperties = $root.google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties.decode(reader, reader.uint32()); - break; - case 7: - if (message.resourceProperties === $util.emptyObject) - message.resourceProperties = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = null; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = $root.google.protobuf.Value.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.resourceProperties[key] = value; - break; - case 8: - message.securityMarks = $root.google.cloud.securitycenter.v1beta1.SecurityMarks.decode(reader, reader.uint32()); - break; - case 9: - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 10: - message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -18276,23 +19844,1238 @@ }; /** - * Decodes an Asset message from the specified reader or buffer, length delimited. + * Decodes an UpdateBigQueryExportRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1beta1.Asset + * @memberof google.cloud.securitycenter.v1.UpdateBigQueryExportRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1beta1.Asset} Asset + * @returns {google.cloud.securitycenter.v1.UpdateBigQueryExportRequest} UpdateBigQueryExportRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Asset.decodeDelimited = function decodeDelimited(reader) { + UpdateBigQueryExportRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an Asset message. + * Verifies an UpdateBigQueryExportRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1.UpdateBigQueryExportRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateBigQueryExportRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.bigQueryExport != null && message.hasOwnProperty("bigQueryExport")) { + var error = $root.google.cloud.securitycenter.v1.BigQueryExport.verify(message.bigQueryExport); + if (error) + return "bigQueryExport." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + return null; + }; + + /** + * Creates an UpdateBigQueryExportRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.UpdateBigQueryExportRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.UpdateBigQueryExportRequest} UpdateBigQueryExportRequest + */ + UpdateBigQueryExportRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.UpdateBigQueryExportRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1.UpdateBigQueryExportRequest(); + if (object.bigQueryExport != null) { + if (typeof object.bigQueryExport !== "object") + throw TypeError(".google.cloud.securitycenter.v1.UpdateBigQueryExportRequest.bigQueryExport: object expected"); + message.bigQueryExport = $root.google.cloud.securitycenter.v1.BigQueryExport.fromObject(object.bigQueryExport); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.securitycenter.v1.UpdateBigQueryExportRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateBigQueryExportRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.UpdateBigQueryExportRequest + * @static + * @param {google.cloud.securitycenter.v1.UpdateBigQueryExportRequest} message UpdateBigQueryExportRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateBigQueryExportRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.bigQueryExport = null; + object.updateMask = null; + } + if (message.bigQueryExport != null && message.hasOwnProperty("bigQueryExport")) + object.bigQueryExport = $root.google.cloud.securitycenter.v1.BigQueryExport.toObject(message.bigQueryExport, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateBigQueryExportRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.UpdateBigQueryExportRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateBigQueryExportRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return UpdateBigQueryExportRequest; + })(); + + v1.ListBigQueryExportsRequest = (function() { + + /** + * Properties of a ListBigQueryExportsRequest. + * @memberof google.cloud.securitycenter.v1 + * @interface IListBigQueryExportsRequest + * @property {string|null} [parent] ListBigQueryExportsRequest parent + * @property {number|null} [pageSize] ListBigQueryExportsRequest pageSize + * @property {string|null} [pageToken] ListBigQueryExportsRequest pageToken + */ + + /** + * Constructs a new ListBigQueryExportsRequest. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a ListBigQueryExportsRequest. + * @implements IListBigQueryExportsRequest + * @constructor + * @param {google.cloud.securitycenter.v1.IListBigQueryExportsRequest=} [properties] Properties to set + */ + function ListBigQueryExportsRequest(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]]; + } + + /** + * ListBigQueryExportsRequest parent. + * @member {string} parent + * @memberof google.cloud.securitycenter.v1.ListBigQueryExportsRequest + * @instance + */ + ListBigQueryExportsRequest.prototype.parent = ""; + + /** + * ListBigQueryExportsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.securitycenter.v1.ListBigQueryExportsRequest + * @instance + */ + ListBigQueryExportsRequest.prototype.pageSize = 0; + + /** + * ListBigQueryExportsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.securitycenter.v1.ListBigQueryExportsRequest + * @instance + */ + ListBigQueryExportsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListBigQueryExportsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.ListBigQueryExportsRequest + * @static + * @param {google.cloud.securitycenter.v1.IListBigQueryExportsRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.ListBigQueryExportsRequest} ListBigQueryExportsRequest instance + */ + ListBigQueryExportsRequest.create = function create(properties) { + return new ListBigQueryExportsRequest(properties); + }; + + /** + * Encodes the specified ListBigQueryExportsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.ListBigQueryExportsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.ListBigQueryExportsRequest + * @static + * @param {google.cloud.securitycenter.v1.IListBigQueryExportsRequest} message ListBigQueryExportsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListBigQueryExportsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListBigQueryExportsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListBigQueryExportsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.ListBigQueryExportsRequest + * @static + * @param {google.cloud.securitycenter.v1.IListBigQueryExportsRequest} message ListBigQueryExportsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListBigQueryExportsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListBigQueryExportsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.ListBigQueryExportsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.ListBigQueryExportsRequest} ListBigQueryExportsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListBigQueryExportsRequest.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.cloud.securitycenter.v1.ListBigQueryExportsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.pageSize = reader.int32(); + break; + case 3: + message.pageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListBigQueryExportsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.ListBigQueryExportsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.ListBigQueryExportsRequest} ListBigQueryExportsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListBigQueryExportsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListBigQueryExportsRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1.ListBigQueryExportsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListBigQueryExportsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListBigQueryExportsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.ListBigQueryExportsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.ListBigQueryExportsRequest} ListBigQueryExportsRequest + */ + ListBigQueryExportsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.ListBigQueryExportsRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1.ListBigQueryExportsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListBigQueryExportsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.ListBigQueryExportsRequest + * @static + * @param {google.cloud.securitycenter.v1.ListBigQueryExportsRequest} message ListBigQueryExportsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListBigQueryExportsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; + + /** + * Converts this ListBigQueryExportsRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.ListBigQueryExportsRequest + * @instance + * @returns {Object.} JSON object + */ + ListBigQueryExportsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListBigQueryExportsRequest; + })(); + + v1.ListBigQueryExportsResponse = (function() { + + /** + * Properties of a ListBigQueryExportsResponse. + * @memberof google.cloud.securitycenter.v1 + * @interface IListBigQueryExportsResponse + * @property {Array.|null} [bigQueryExports] ListBigQueryExportsResponse bigQueryExports + * @property {string|null} [nextPageToken] ListBigQueryExportsResponse nextPageToken + */ + + /** + * Constructs a new ListBigQueryExportsResponse. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a ListBigQueryExportsResponse. + * @implements IListBigQueryExportsResponse + * @constructor + * @param {google.cloud.securitycenter.v1.IListBigQueryExportsResponse=} [properties] Properties to set + */ + function ListBigQueryExportsResponse(properties) { + this.bigQueryExports = []; + 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]]; + } + + /** + * ListBigQueryExportsResponse bigQueryExports. + * @member {Array.} bigQueryExports + * @memberof google.cloud.securitycenter.v1.ListBigQueryExportsResponse + * @instance + */ + ListBigQueryExportsResponse.prototype.bigQueryExports = $util.emptyArray; + + /** + * ListBigQueryExportsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.securitycenter.v1.ListBigQueryExportsResponse + * @instance + */ + ListBigQueryExportsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListBigQueryExportsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.ListBigQueryExportsResponse + * @static + * @param {google.cloud.securitycenter.v1.IListBigQueryExportsResponse=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.ListBigQueryExportsResponse} ListBigQueryExportsResponse instance + */ + ListBigQueryExportsResponse.create = function create(properties) { + return new ListBigQueryExportsResponse(properties); + }; + + /** + * Encodes the specified ListBigQueryExportsResponse message. Does not implicitly {@link google.cloud.securitycenter.v1.ListBigQueryExportsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.ListBigQueryExportsResponse + * @static + * @param {google.cloud.securitycenter.v1.IListBigQueryExportsResponse} message ListBigQueryExportsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListBigQueryExportsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.bigQueryExports != null && message.bigQueryExports.length) + for (var i = 0; i < message.bigQueryExports.length; ++i) + $root.google.cloud.securitycenter.v1.BigQueryExport.encode(message.bigQueryExports[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListBigQueryExportsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListBigQueryExportsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.ListBigQueryExportsResponse + * @static + * @param {google.cloud.securitycenter.v1.IListBigQueryExportsResponse} message ListBigQueryExportsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListBigQueryExportsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListBigQueryExportsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.ListBigQueryExportsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.ListBigQueryExportsResponse} ListBigQueryExportsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListBigQueryExportsResponse.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.cloud.securitycenter.v1.ListBigQueryExportsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.bigQueryExports && message.bigQueryExports.length)) + message.bigQueryExports = []; + message.bigQueryExports.push($root.google.cloud.securitycenter.v1.BigQueryExport.decode(reader, reader.uint32())); + break; + case 2: + message.nextPageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListBigQueryExportsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.ListBigQueryExportsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.ListBigQueryExportsResponse} ListBigQueryExportsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListBigQueryExportsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListBigQueryExportsResponse message. + * @function verify + * @memberof google.cloud.securitycenter.v1.ListBigQueryExportsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListBigQueryExportsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.bigQueryExports != null && message.hasOwnProperty("bigQueryExports")) { + if (!Array.isArray(message.bigQueryExports)) + return "bigQueryExports: array expected"; + for (var i = 0; i < message.bigQueryExports.length; ++i) { + var error = $root.google.cloud.securitycenter.v1.BigQueryExport.verify(message.bigQueryExports[i]); + if (error) + return "bigQueryExports." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListBigQueryExportsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.ListBigQueryExportsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.ListBigQueryExportsResponse} ListBigQueryExportsResponse + */ + ListBigQueryExportsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.ListBigQueryExportsResponse) + return object; + var message = new $root.google.cloud.securitycenter.v1.ListBigQueryExportsResponse(); + if (object.bigQueryExports) { + if (!Array.isArray(object.bigQueryExports)) + throw TypeError(".google.cloud.securitycenter.v1.ListBigQueryExportsResponse.bigQueryExports: array expected"); + message.bigQueryExports = []; + for (var i = 0; i < object.bigQueryExports.length; ++i) { + if (typeof object.bigQueryExports[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v1.ListBigQueryExportsResponse.bigQueryExports: object expected"); + message.bigQueryExports[i] = $root.google.cloud.securitycenter.v1.BigQueryExport.fromObject(object.bigQueryExports[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListBigQueryExportsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.ListBigQueryExportsResponse + * @static + * @param {google.cloud.securitycenter.v1.ListBigQueryExportsResponse} message ListBigQueryExportsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListBigQueryExportsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.bigQueryExports = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.bigQueryExports && message.bigQueryExports.length) { + object.bigQueryExports = []; + for (var j = 0; j < message.bigQueryExports.length; ++j) + object.bigQueryExports[j] = $root.google.cloud.securitycenter.v1.BigQueryExport.toObject(message.bigQueryExports[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListBigQueryExportsResponse to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.ListBigQueryExportsResponse + * @instance + * @returns {Object.} JSON object + */ + ListBigQueryExportsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListBigQueryExportsResponse; + })(); + + v1.DeleteBigQueryExportRequest = (function() { + + /** + * Properties of a DeleteBigQueryExportRequest. + * @memberof google.cloud.securitycenter.v1 + * @interface IDeleteBigQueryExportRequest + * @property {string|null} [name] DeleteBigQueryExportRequest name + */ + + /** + * Constructs a new DeleteBigQueryExportRequest. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a DeleteBigQueryExportRequest. + * @implements IDeleteBigQueryExportRequest + * @constructor + * @param {google.cloud.securitycenter.v1.IDeleteBigQueryExportRequest=} [properties] Properties to set + */ + function DeleteBigQueryExportRequest(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]]; + } + + /** + * DeleteBigQueryExportRequest name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1.DeleteBigQueryExportRequest + * @instance + */ + DeleteBigQueryExportRequest.prototype.name = ""; + + /** + * Creates a new DeleteBigQueryExportRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.DeleteBigQueryExportRequest + * @static + * @param {google.cloud.securitycenter.v1.IDeleteBigQueryExportRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.DeleteBigQueryExportRequest} DeleteBigQueryExportRequest instance + */ + DeleteBigQueryExportRequest.create = function create(properties) { + return new DeleteBigQueryExportRequest(properties); + }; + + /** + * Encodes the specified DeleteBigQueryExportRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.DeleteBigQueryExportRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.DeleteBigQueryExportRequest + * @static + * @param {google.cloud.securitycenter.v1.IDeleteBigQueryExportRequest} message DeleteBigQueryExportRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteBigQueryExportRequest.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 DeleteBigQueryExportRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.DeleteBigQueryExportRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.DeleteBigQueryExportRequest + * @static + * @param {google.cloud.securitycenter.v1.IDeleteBigQueryExportRequest} message DeleteBigQueryExportRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteBigQueryExportRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteBigQueryExportRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.DeleteBigQueryExportRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.DeleteBigQueryExportRequest} DeleteBigQueryExportRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteBigQueryExportRequest.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.cloud.securitycenter.v1.DeleteBigQueryExportRequest(); + 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 DeleteBigQueryExportRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.DeleteBigQueryExportRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.DeleteBigQueryExportRequest} DeleteBigQueryExportRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteBigQueryExportRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteBigQueryExportRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1.DeleteBigQueryExportRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteBigQueryExportRequest.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 DeleteBigQueryExportRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.DeleteBigQueryExportRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.DeleteBigQueryExportRequest} DeleteBigQueryExportRequest + */ + DeleteBigQueryExportRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.DeleteBigQueryExportRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1.DeleteBigQueryExportRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteBigQueryExportRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.DeleteBigQueryExportRequest + * @static + * @param {google.cloud.securitycenter.v1.DeleteBigQueryExportRequest} message DeleteBigQueryExportRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteBigQueryExportRequest.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 DeleteBigQueryExportRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.DeleteBigQueryExportRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteBigQueryExportRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DeleteBigQueryExportRequest; + })(); + + v1.Source = (function() { + + /** + * Properties of a Source. + * @memberof google.cloud.securitycenter.v1 + * @interface ISource + * @property {string|null} [name] Source name + * @property {string|null} [displayName] Source displayName + * @property {string|null} [description] Source description + * @property {string|null} [canonicalName] Source canonicalName + */ + + /** + * Constructs a new Source. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a Source. + * @implements ISource + * @constructor + * @param {google.cloud.securitycenter.v1.ISource=} [properties] Properties to set + */ + function Source(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]]; + } + + /** + * Source name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1.Source + * @instance + */ + Source.prototype.name = ""; + + /** + * Source displayName. + * @member {string} displayName + * @memberof google.cloud.securitycenter.v1.Source + * @instance + */ + Source.prototype.displayName = ""; + + /** + * Source description. + * @member {string} description + * @memberof google.cloud.securitycenter.v1.Source + * @instance + */ + Source.prototype.description = ""; + + /** + * Source canonicalName. + * @member {string} canonicalName + * @memberof google.cloud.securitycenter.v1.Source + * @instance + */ + Source.prototype.canonicalName = ""; + + /** + * Creates a new Source instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.Source + * @static + * @param {google.cloud.securitycenter.v1.ISource=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.Source} Source instance + */ + Source.create = function create(properties) { + return new Source(properties); + }; + + /** + * Encodes the specified Source message. Does not implicitly {@link google.cloud.securitycenter.v1.Source.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.Source + * @static + * @param {google.cloud.securitycenter.v1.ISource} message Source message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Source.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.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + if (message.canonicalName != null && Object.hasOwnProperty.call(message, "canonicalName")) + writer.uint32(/* id 14, wireType 2 =*/114).string(message.canonicalName); + return writer; + }; + + /** + * Encodes the specified Source message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Source.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.Source + * @static + * @param {google.cloud.securitycenter.v1.ISource} message Source message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Source.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Source message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.Source + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.Source} Source + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Source.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.cloud.securitycenter.v1.Source(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.displayName = reader.string(); + break; + case 3: + message.description = reader.string(); + break; + case 14: + message.canonicalName = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Source message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.Source + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.Source} Source + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Source.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Source message. + * @function verify + * @memberof google.cloud.securitycenter.v1.Source + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Source.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.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.canonicalName != null && message.hasOwnProperty("canonicalName")) + if (!$util.isString(message.canonicalName)) + return "canonicalName: string expected"; + return null; + }; + + /** + * Creates a Source message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.Source + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.Source} Source + */ + Source.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.Source) + return object; + var message = new $root.google.cloud.securitycenter.v1.Source(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.description != null) + message.description = String(object.description); + if (object.canonicalName != null) + message.canonicalName = String(object.canonicalName); + return message; + }; + + /** + * Creates a plain object from a Source message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.Source + * @static + * @param {google.cloud.securitycenter.v1.Source} message Source + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Source.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.description = ""; + object.canonicalName = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.canonicalName != null && message.hasOwnProperty("canonicalName")) + object.canonicalName = message.canonicalName; + return object; + }; + + /** + * Converts this Source to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.Source + * @instance + * @returns {Object.} JSON object + */ + Source.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Source; + })(); + + return v1; + })(); + + securitycenter.v1beta1 = (function() { + + /** + * Namespace v1beta1. + * @memberof google.cloud.securitycenter + * @namespace + */ + var v1beta1 = {}; + + v1beta1.Asset = (function() { + + /** + * Properties of an Asset. + * @memberof google.cloud.securitycenter.v1beta1 + * @interface IAsset + * @property {string|null} [name] Asset name + * @property {google.cloud.securitycenter.v1beta1.Asset.ISecurityCenterProperties|null} [securityCenterProperties] Asset securityCenterProperties + * @property {Object.|null} [resourceProperties] Asset resourceProperties + * @property {google.cloud.securitycenter.v1beta1.ISecurityMarks|null} [securityMarks] Asset securityMarks + * @property {google.protobuf.ITimestamp|null} [createTime] Asset createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Asset updateTime + */ + + /** + * Constructs a new Asset. + * @memberof google.cloud.securitycenter.v1beta1 + * @classdesc Represents an Asset. + * @implements IAsset + * @constructor + * @param {google.cloud.securitycenter.v1beta1.IAsset=} [properties] Properties to set + */ + function Asset(properties) { + this.resourceProperties = {}; + 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]]; + } + + /** + * Asset name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1beta1.Asset + * @instance + */ + Asset.prototype.name = ""; + + /** + * Asset securityCenterProperties. + * @member {google.cloud.securitycenter.v1beta1.Asset.ISecurityCenterProperties|null|undefined} securityCenterProperties + * @memberof google.cloud.securitycenter.v1beta1.Asset + * @instance + */ + Asset.prototype.securityCenterProperties = null; + + /** + * Asset resourceProperties. + * @member {Object.} resourceProperties + * @memberof google.cloud.securitycenter.v1beta1.Asset + * @instance + */ + Asset.prototype.resourceProperties = $util.emptyObject; + + /** + * Asset securityMarks. + * @member {google.cloud.securitycenter.v1beta1.ISecurityMarks|null|undefined} securityMarks + * @memberof google.cloud.securitycenter.v1beta1.Asset + * @instance + */ + Asset.prototype.securityMarks = null; + + /** + * Asset createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.securitycenter.v1beta1.Asset + * @instance + */ + Asset.prototype.createTime = null; + + /** + * Asset updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.securitycenter.v1beta1.Asset + * @instance + */ + Asset.prototype.updateTime = null; + + /** + * Creates a new Asset instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1beta1.Asset + * @static + * @param {google.cloud.securitycenter.v1beta1.IAsset=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1beta1.Asset} Asset instance + */ + Asset.create = function create(properties) { + return new Asset(properties); + }; + + /** + * Encodes the specified Asset message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.Asset.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1beta1.Asset + * @static + * @param {google.cloud.securitycenter.v1beta1.IAsset} message Asset message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Asset.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.securityCenterProperties != null && Object.hasOwnProperty.call(message, "securityCenterProperties")) + $root.google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties.encode(message.securityCenterProperties, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.resourceProperties != null && Object.hasOwnProperty.call(message, "resourceProperties")) + for (var keys = Object.keys(message.resourceProperties), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 7, wireType 2 =*/58).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.protobuf.Value.encode(message.resourceProperties[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.securityMarks != null && Object.hasOwnProperty.call(message, "securityMarks")) + $root.google.cloud.securitycenter.v1beta1.SecurityMarks.encode(message.securityMarks, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Asset message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.Asset.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1beta1.Asset + * @static + * @param {google.cloud.securitycenter.v1beta1.IAsset} message Asset message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Asset.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Asset message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1beta1.Asset + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1beta1.Asset} Asset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Asset.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.cloud.securitycenter.v1beta1.Asset(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.securityCenterProperties = $root.google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties.decode(reader, reader.uint32()); + break; + case 7: + if (message.resourceProperties === $util.emptyObject) + message.resourceProperties = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.protobuf.Value.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.resourceProperties[key] = value; + break; + case 8: + message.securityMarks = $root.google.cloud.securitycenter.v1beta1.SecurityMarks.decode(reader, reader.uint32()); + break; + case 9: + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 10: + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Asset message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1beta1.Asset + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1beta1.Asset} Asset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Asset.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Asset message. * @function verify * @memberof google.cloud.securitycenter.v1beta1.Asset * @static @@ -39236,26 +42019,32 @@ */ var api = {}; - api.Http = (function() { + api.ResourceDescriptor = (function() { /** - * Properties of a Http. + * Properties of a ResourceDescriptor. * @memberof google.api - * @interface IHttp - * @property {Array.|null} [rules] Http rules - * @property {boolean|null} [fullyDecodeReservedExpansion] Http fullyDecodeReservedExpansion + * @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 Http. + * Constructs a new ResourceDescriptor. * @memberof google.api - * @classdesc Represents a Http. - * @implements IHttp + * @classdesc Represents a ResourceDescriptor. + * @implements IResourceDescriptor * @constructor - * @param {google.api.IHttp=} [properties] Properties to set + * @param {google.api.IResourceDescriptor=} [properties] Properties to set */ - function Http(properties) { - this.rules = []; + 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) @@ -39263,91 +42052,167 @@ } /** - * Http rules. - * @member {Array.} rules - * @memberof google.api.Http + * ResourceDescriptor type. + * @member {string} type + * @memberof google.api.ResourceDescriptor * @instance */ - Http.prototype.rules = $util.emptyArray; + ResourceDescriptor.prototype.type = ""; /** - * Http fullyDecodeReservedExpansion. - * @member {boolean} fullyDecodeReservedExpansion - * @memberof google.api.Http + * ResourceDescriptor pattern. + * @member {Array.} pattern + * @memberof google.api.ResourceDescriptor * @instance */ - Http.prototype.fullyDecodeReservedExpansion = false; + ResourceDescriptor.prototype.pattern = $util.emptyArray; /** - * Creates a new Http instance using the specified properties. + * 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.Http + * @memberof google.api.ResourceDescriptor * @static - * @param {google.api.IHttp=} [properties] Properties to set - * @returns {google.api.Http} Http instance + * @param {google.api.IResourceDescriptor=} [properties] Properties to set + * @returns {google.api.ResourceDescriptor} ResourceDescriptor instance */ - Http.create = function create(properties) { - return new Http(properties); + ResourceDescriptor.create = function create(properties) { + return new ResourceDescriptor(properties); }; /** - * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. + * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. * @function encode - * @memberof google.api.Http + * @memberof google.api.ResourceDescriptor * @static - * @param {google.api.IHttp} message Http message or plain object to encode + * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Http.encode = function encode(message, writer) { + ResourceDescriptor.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); + 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 Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. + * Encodes the specified ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. * @function encodeDelimited - * @memberof google.api.Http + * @memberof google.api.ResourceDescriptor * @static - * @param {google.api.IHttp} message Http message or plain object to encode + * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Http.encodeDelimited = function encodeDelimited(message, writer) { + ResourceDescriptor.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a Http message from the specified reader or buffer. + * Decodes a ResourceDescriptor message from the specified reader or buffer. * @function decode - * @memberof google.api.Http + * @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.Http} Http + * @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 */ - Http.decode = function decode(reader, length) { + 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.Http(); + 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: - if (!(message.rules && message.rules.length)) - message.rules = []; - message.rules.push($root.google.api.HttpRule.decode(reader, reader.uint32())); + message.type = reader.string(); break; case 2: - message.fullyDecodeReservedExpansion = reader.bool(); + 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); @@ -39358,143 +42223,246 @@ }; /** - * Decodes a Http message from the specified reader or buffer, length delimited. + * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.api.Http + * @memberof google.api.ResourceDescriptor * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.Http} Http + * @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 */ - Http.decodeDelimited = function decodeDelimited(reader) { + ResourceDescriptor.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a Http message. + * Verifies a ResourceDescriptor message. * @function verify - * @memberof google.api.Http + * @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 */ - Http.verify = function verify(message) { + ResourceDescriptor.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.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; + } } - 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. + * Creates a ResourceDescriptor message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.api.Http + * @memberof google.api.ResourceDescriptor * @static * @param {Object.} object Plain object - * @returns {google.api.Http} Http + * @returns {google.api.ResourceDescriptor} ResourceDescriptor */ - Http.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.Http) + ResourceDescriptor.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.ResourceDescriptor) 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]); - } + 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) { + 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: + case "STYLE_UNSPECIFIED": + case 0: + message.style[i] = 0; + break; + case "DECLARATIVE_FRIENDLY": + case 1: + message.style[i] = 1; + break; + } } - 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. + * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. * @function toObject - * @memberof google.api.Http + * @memberof google.api.ResourceDescriptor * @static - * @param {google.api.Http} message Http + * @param {google.api.ResourceDescriptor} message ResourceDescriptor * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Http.toObject = function toObject(message, options) { + ResourceDescriptor.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 (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] : 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]] : message.style[j]; } - if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) - object.fullyDecodeReservedExpansion = message.fullyDecodeReservedExpansion; return object; }; /** - * Converts this Http to JSON. + * Converts this ResourceDescriptor to JSON. * @function toJSON - * @memberof google.api.Http + * @memberof google.api.ResourceDescriptor * @instance * @returns {Object.} JSON object */ - Http.prototype.toJSON = function toJSON() { + ResourceDescriptor.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return Http; + /** + * 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.HttpRule = (function() { + api.ResourceReference = (function() { /** - * Properties of a HttpRule. + * Properties of a ResourceReference. * @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 + * @interface IResourceReference + * @property {string|null} [type] ResourceReference type + * @property {string|null} [childType] ResourceReference childType */ /** - * Constructs a new HttpRule. + * Constructs a new ResourceReference. * @memberof google.api - * @classdesc Represents a HttpRule. - * @implements IHttpRule + * @classdesc Represents a ResourceReference. + * @implements IResourceReference * @constructor - * @param {google.api.IHttpRule=} [properties] Properties to set + * @param {google.api.IResourceReference=} [properties] Properties to set */ - function HttpRule(properties) { - this.additionalBindings = []; + function ResourceReference(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -39502,209 +42470,88 @@ } /** - * 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 + * ResourceReference type. + * @member {string} type + * @memberof google.api.ResourceReference * @instance */ - HttpRule.prototype.additionalBindings = $util.emptyArray; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + ResourceReference.prototype.type = ""; /** - * HttpRule pattern. - * @member {"get"|"put"|"post"|"delete"|"patch"|"custom"|undefined} pattern - * @memberof google.api.HttpRule + * ResourceReference childType. + * @member {string} childType + * @memberof google.api.ResourceReference * @instance */ - Object.defineProperty(HttpRule.prototype, "pattern", { - get: $util.oneOfGetter($oneOfFields = ["get", "put", "post", "delete", "patch", "custom"]), - set: $util.oneOfSetter($oneOfFields) - }); + ResourceReference.prototype.childType = ""; /** - * Creates a new HttpRule instance using the specified properties. + * Creates a new ResourceReference instance using the specified properties. * @function create - * @memberof google.api.HttpRule + * @memberof google.api.ResourceReference * @static - * @param {google.api.IHttpRule=} [properties] Properties to set - * @returns {google.api.HttpRule} HttpRule instance + * @param {google.api.IResourceReference=} [properties] Properties to set + * @returns {google.api.ResourceReference} ResourceReference instance */ - HttpRule.create = function create(properties) { - return new HttpRule(properties); + ResourceReference.create = function create(properties) { + return new ResourceReference(properties); }; /** - * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. * @function encode - * @memberof google.api.HttpRule + * @memberof google.api.ResourceReference * @static - * @param {google.api.IHttpRule} message HttpRule message or plain object to encode + * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - HttpRule.encode = function encode(message, writer) { + ResourceReference.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); + 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 HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. * @function encodeDelimited - * @memberof google.api.HttpRule + * @memberof google.api.ResourceReference * @static - * @param {google.api.IHttpRule} message HttpRule message or plain object to encode + * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - HttpRule.encodeDelimited = function encodeDelimited(message, writer) { + ResourceReference.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a HttpRule message from the specified reader or buffer. + * Decodes a ResourceReference message from the specified reader or buffer. * @function decode - * @memberof google.api.HttpRule + * @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.HttpRule} HttpRule + * @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 */ - HttpRule.decode = function decode(reader, length) { + 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.HttpRule(); + 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.selector = reader.string(); + message.type = 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())); + message.childType = reader.string(); break; default: reader.skipType(tag & 7); @@ -39715,240 +42562,144 @@ }; /** - * Decodes a HttpRule message from the specified reader or buffer, length delimited. + * Decodes a ResourceReference message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.api.HttpRule + * @memberof google.api.ResourceReference * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.HttpRule} HttpRule + * @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 */ - HttpRule.decodeDelimited = function decodeDelimited(reader) { + ResourceReference.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a HttpRule message. + * Verifies a ResourceReference message. * @function verify - * @memberof google.api.HttpRule + * @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 */ - HttpRule.verify = function verify(message) { + ResourceReference.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; - } - } + 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 HttpRule message from a plain object. Also converts values to their respective internal types. + * Creates a ResourceReference message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.api.HttpRule + * @memberof google.api.ResourceReference * @static * @param {Object.} object Plain object - * @returns {google.api.HttpRule} HttpRule + * @returns {google.api.ResourceReference} ResourceReference */ - HttpRule.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.HttpRule) + ResourceReference.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.ResourceReference) 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]); - } - } + 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 HttpRule message. Also converts values to other types if specified. + * Creates a plain object from a ResourceReference message. Also converts values to other types if specified. * @function toObject - * @memberof google.api.HttpRule + * @memberof google.api.ResourceReference * @static - * @param {google.api.HttpRule} message HttpRule + * @param {google.api.ResourceReference} message ResourceReference * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - HttpRule.toObject = function toObject(message, options) { + ResourceReference.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); + object.type = ""; + object.childType = ""; } - if (message.responseBody != null && message.hasOwnProperty("responseBody")) - object.responseBody = message.responseBody; + 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 HttpRule to JSON. + * Converts this ResourceReference to JSON. * @function toJSON - * @memberof google.api.HttpRule + * @memberof google.api.ResourceReference * @instance * @returns {Object.} JSON object */ - HttpRule.prototype.toJSON = function toJSON() { + ResourceReference.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return HttpRule; + return ResourceReference; })(); - api.CustomHttpPattern = (function() { + /** + * 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.Http = (function() { /** - * Properties of a CustomHttpPattern. + * Properties of a Http. * @memberof google.api - * @interface ICustomHttpPattern - * @property {string|null} [kind] CustomHttpPattern kind - * @property {string|null} [path] CustomHttpPattern path + * @interface IHttp + * @property {Array.|null} [rules] Http rules + * @property {boolean|null} [fullyDecodeReservedExpansion] Http fullyDecodeReservedExpansion */ /** - * Constructs a new CustomHttpPattern. + * Constructs a new Http. * @memberof google.api - * @classdesc Represents a CustomHttpPattern. - * @implements ICustomHttpPattern + * @classdesc Represents a Http. + * @implements IHttp * @constructor - * @param {google.api.ICustomHttpPattern=} [properties] Properties to set + * @param {google.api.IHttp=} [properties] Properties to set */ - function CustomHttpPattern(properties) { + function Http(properties) { + this.rules = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -39956,88 +42707,91 @@ } /** - * CustomHttpPattern kind. - * @member {string} kind - * @memberof google.api.CustomHttpPattern + * Http rules. + * @member {Array.} rules + * @memberof google.api.Http * @instance */ - CustomHttpPattern.prototype.kind = ""; + Http.prototype.rules = $util.emptyArray; /** - * CustomHttpPattern path. - * @member {string} path - * @memberof google.api.CustomHttpPattern + * Http fullyDecodeReservedExpansion. + * @member {boolean} fullyDecodeReservedExpansion + * @memberof google.api.Http * @instance */ - CustomHttpPattern.prototype.path = ""; + Http.prototype.fullyDecodeReservedExpansion = false; /** - * Creates a new CustomHttpPattern instance using the specified properties. + * Creates a new Http instance using the specified properties. * @function create - * @memberof google.api.CustomHttpPattern + * @memberof google.api.Http * @static - * @param {google.api.ICustomHttpPattern=} [properties] Properties to set - * @returns {google.api.CustomHttpPattern} CustomHttpPattern instance + * @param {google.api.IHttp=} [properties] Properties to set + * @returns {google.api.Http} Http instance */ - CustomHttpPattern.create = function create(properties) { - return new CustomHttpPattern(properties); + Http.create = function create(properties) { + return new Http(properties); }; /** - * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. * @function encode - * @memberof google.api.CustomHttpPattern + * @memberof google.api.Http * @static - * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode + * @param {google.api.IHttp} message Http message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CustomHttpPattern.encode = function encode(message, writer) { + Http.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); + 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 CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. * @function encodeDelimited - * @memberof google.api.CustomHttpPattern + * @memberof google.api.Http * @static - * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode + * @param {google.api.IHttp} message Http message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CustomHttpPattern.encodeDelimited = function encodeDelimited(message, writer) { + Http.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a CustomHttpPattern message from the specified reader or buffer. + * Decodes a Http message from the specified reader or buffer. * @function decode - * @memberof google.api.CustomHttpPattern + * @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.CustomHttpPattern} CustomHttpPattern + * @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 */ - CustomHttpPattern.decode = function decode(reader, length) { + 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.CustomHttpPattern(); + 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: - message.kind = reader.string(); + if (!(message.rules && message.rules.length)) + message.rules = []; + message.rules.push($root.google.api.HttpRule.decode(reader, reader.uint32())); break; case 2: - message.path = reader.string(); + message.fullyDecodeReservedExpansion = reader.bool(); break; default: reader.skipType(tag & 7); @@ -40048,124 +42802,143 @@ }; /** - * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. + * Decodes a Http message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.api.CustomHttpPattern + * @memberof google.api.Http * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.CustomHttpPattern} CustomHttpPattern + * @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 */ - CustomHttpPattern.decodeDelimited = function decodeDelimited(reader) { + Http.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a CustomHttpPattern message. + * Verifies a Http message. * @function verify - * @memberof google.api.CustomHttpPattern + * @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 */ - CustomHttpPattern.verify = function verify(message) { + Http.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"; + 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 CustomHttpPattern message from a plain object. Also converts values to their respective internal types. + * Creates a Http message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.api.CustomHttpPattern + * @memberof google.api.Http * @static * @param {Object.} object Plain object - * @returns {google.api.CustomHttpPattern} CustomHttpPattern + * @returns {google.api.Http} Http */ - CustomHttpPattern.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.CustomHttpPattern) + Http.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.Http) 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); + 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 CustomHttpPattern message. Also converts values to other types if specified. + * Creates a plain object from a Http message. Also converts values to other types if specified. * @function toObject - * @memberof google.api.CustomHttpPattern + * @memberof google.api.Http * @static - * @param {google.api.CustomHttpPattern} message CustomHttpPattern + * @param {google.api.Http} message Http * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CustomHttpPattern.toObject = function toObject(message, options) { + Http.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.kind = ""; - object.path = ""; + 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.kind != null && message.hasOwnProperty("kind")) - object.kind = message.kind; - if (message.path != null && message.hasOwnProperty("path")) - object.path = message.path; + if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) + object.fullyDecodeReservedExpansion = message.fullyDecodeReservedExpansion; return object; }; /** - * Converts this CustomHttpPattern to JSON. + * Converts this Http to JSON. * @function toJSON - * @memberof google.api.CustomHttpPattern + * @memberof google.api.Http * @instance * @returns {Object.} JSON object */ - CustomHttpPattern.prototype.toJSON = function toJSON() { + Http.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return CustomHttpPattern; + return Http; })(); - api.ResourceDescriptor = (function() { + api.HttpRule = (function() { /** - * Properties of a ResourceDescriptor. + * Properties of a HttpRule. * @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 + * @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 ResourceDescriptor. + * Constructs a new HttpRule. * @memberof google.api - * @classdesc Represents a ResourceDescriptor. - * @implements IResourceDescriptor + * @classdesc Represents a HttpRule. + * @implements IHttpRule * @constructor - * @param {google.api.IResourceDescriptor=} [properties] Properties to set + * @param {google.api.IHttpRule=} [properties] Properties to set */ - function ResourceDescriptor(properties) { - this.pattern = []; - this.style = []; + function HttpRule(properties) { + this.additionalBindings = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -40173,167 +42946,209 @@ } /** - * ResourceDescriptor type. - * @member {string} type - * @memberof google.api.ResourceDescriptor + * HttpRule selector. + * @member {string} selector + * @memberof google.api.HttpRule * @instance */ - ResourceDescriptor.prototype.type = ""; + HttpRule.prototype.selector = ""; /** - * ResourceDescriptor pattern. - * @member {Array.} pattern - * @memberof google.api.ResourceDescriptor + * HttpRule get. + * @member {string|null|undefined} get + * @memberof google.api.HttpRule * @instance */ - ResourceDescriptor.prototype.pattern = $util.emptyArray; + HttpRule.prototype.get = null; /** - * ResourceDescriptor nameField. - * @member {string} nameField - * @memberof google.api.ResourceDescriptor + * HttpRule put. + * @member {string|null|undefined} put + * @memberof google.api.HttpRule * @instance */ - ResourceDescriptor.prototype.nameField = ""; + HttpRule.prototype.put = null; /** - * ResourceDescriptor history. - * @member {google.api.ResourceDescriptor.History} history - * @memberof google.api.ResourceDescriptor + * HttpRule post. + * @member {string|null|undefined} post + * @memberof google.api.HttpRule * @instance */ - ResourceDescriptor.prototype.history = 0; + HttpRule.prototype.post = null; /** - * ResourceDescriptor plural. - * @member {string} plural - * @memberof google.api.ResourceDescriptor + * HttpRule delete. + * @member {string|null|undefined} delete + * @memberof google.api.HttpRule * @instance */ - ResourceDescriptor.prototype.plural = ""; + HttpRule.prototype["delete"] = null; /** - * ResourceDescriptor singular. - * @member {string} singular - * @memberof google.api.ResourceDescriptor + * HttpRule patch. + * @member {string|null|undefined} patch + * @memberof google.api.HttpRule * @instance */ - ResourceDescriptor.prototype.singular = ""; + HttpRule.prototype.patch = null; /** - * ResourceDescriptor style. - * @member {Array.} style - * @memberof google.api.ResourceDescriptor + * HttpRule custom. + * @member {google.api.ICustomHttpPattern|null|undefined} custom + * @memberof google.api.HttpRule * @instance */ - ResourceDescriptor.prototype.style = $util.emptyArray; + HttpRule.prototype.custom = null; /** - * Creates a new ResourceDescriptor instance using the specified properties. + * 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.ResourceDescriptor + * @memberof google.api.HttpRule * @static - * @param {google.api.IResourceDescriptor=} [properties] Properties to set - * @returns {google.api.ResourceDescriptor} ResourceDescriptor instance + * @param {google.api.IHttpRule=} [properties] Properties to set + * @returns {google.api.HttpRule} HttpRule instance */ - ResourceDescriptor.create = function create(properties) { - return new ResourceDescriptor(properties); + HttpRule.create = function create(properties) { + return new HttpRule(properties); }; /** - * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. * @function encode - * @memberof google.api.ResourceDescriptor + * @memberof google.api.HttpRule * @static - * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode + * @param {google.api.IHttpRule} message HttpRule message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ResourceDescriptor.encode = function encode(message, writer) { + HttpRule.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(); - } + 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 ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. * @function encodeDelimited - * @memberof google.api.ResourceDescriptor + * @memberof google.api.HttpRule * @static - * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode + * @param {google.api.IHttpRule} message HttpRule message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ResourceDescriptor.encodeDelimited = function encodeDelimited(message, writer) { + HttpRule.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ResourceDescriptor message from the specified reader or buffer. + * Decodes a HttpRule message from the specified reader or buffer. * @function decode - * @memberof google.api.ResourceDescriptor + * @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.ResourceDescriptor} ResourceDescriptor + * @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 */ - ResourceDescriptor.decode = function decode(reader, length) { + 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.ResourceDescriptor(); + 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.type = reader.string(); + message.selector = reader.string(); break; case 2: - if (!(message.pattern && message.pattern.length)) - message.pattern = []; - message.pattern.push(reader.string()); + message.get = reader.string(); break; case 3: - message.nameField = reader.string(); + message.put = reader.string(); break; case 4: - message.history = reader.int32(); + message.post = reader.string(); break; case 5: - message.plural = reader.string(); + message["delete"] = reader.string(); break; case 6: - message.singular = reader.string(); + 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 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()); + 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); @@ -40344,246 +43159,240 @@ }; /** - * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. + * Decodes a HttpRule message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.api.ResourceDescriptor + * @memberof google.api.HttpRule * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.ResourceDescriptor} ResourceDescriptor + * @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 */ - ResourceDescriptor.decodeDelimited = function decodeDelimited(reader) { + HttpRule.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ResourceDescriptor message. + * Verifies a HttpRule message. * @function verify - * @memberof google.api.ResourceDescriptor + * @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 */ - ResourceDescriptor.verify = function verify(message) { + HttpRule.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"; + 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.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.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; } - 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. + * Creates a HttpRule message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.api.ResourceDescriptor + * @memberof google.api.HttpRule * @static * @param {Object.} object Plain object - * @returns {google.api.ResourceDescriptor} ResourceDescriptor + * @returns {google.api.HttpRule} HttpRule */ - ResourceDescriptor.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.ResourceDescriptor) + HttpRule.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.HttpRule) 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) { - 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; + 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.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: - case "STYLE_UNSPECIFIED": - case 0: - message.style[i] = 0; - break; - case "DECLARATIVE_FRIENDLY": - case 1: - message.style[i] = 1; - break; - } + 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 ResourceDescriptor message. Also converts values to other types if specified. + * Creates a plain object from a HttpRule message. Also converts values to other types if specified. * @function toObject - * @memberof google.api.ResourceDescriptor + * @memberof google.api.HttpRule * @static - * @param {google.api.ResourceDescriptor} message ResourceDescriptor + * @param {google.api.HttpRule} message HttpRule * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ResourceDescriptor.toObject = function toObject(message, options) { + HttpRule.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) { - object.pattern = []; - object.style = []; - } + if (options.arrays || options.defaults) + object.additionalBindings = []; if (options.defaults) { - object.type = ""; - object.nameField = ""; - object.history = options.enums === String ? "HISTORY_UNSPECIFIED" : 0; - object.plural = ""; - object.singular = ""; + object.selector = ""; + object.body = ""; + object.responseBody = ""; } - 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.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.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] : 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]] : message.style[j]; + 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 ResourceDescriptor to JSON. + * Converts this HttpRule to JSON. * @function toJSON - * @memberof google.api.ResourceDescriptor + * @memberof google.api.HttpRule * @instance * @returns {Object.} JSON object */ - ResourceDescriptor.prototype.toJSON = function toJSON() { + HttpRule.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - /** - * 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; + return HttpRule; })(); - api.ResourceReference = (function() { + api.CustomHttpPattern = (function() { /** - * Properties of a ResourceReference. + * Properties of a CustomHttpPattern. * @memberof google.api - * @interface IResourceReference - * @property {string|null} [type] ResourceReference type - * @property {string|null} [childType] ResourceReference childType + * @interface ICustomHttpPattern + * @property {string|null} [kind] CustomHttpPattern kind + * @property {string|null} [path] CustomHttpPattern path */ /** - * Constructs a new ResourceReference. + * Constructs a new CustomHttpPattern. * @memberof google.api - * @classdesc Represents a ResourceReference. - * @implements IResourceReference + * @classdesc Represents a CustomHttpPattern. + * @implements ICustomHttpPattern * @constructor - * @param {google.api.IResourceReference=} [properties] Properties to set + * @param {google.api.ICustomHttpPattern=} [properties] Properties to set */ - function ResourceReference(properties) { + function CustomHttpPattern(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -40591,88 +43400,88 @@ } /** - * ResourceReference type. - * @member {string} type - * @memberof google.api.ResourceReference + * CustomHttpPattern kind. + * @member {string} kind + * @memberof google.api.CustomHttpPattern * @instance */ - ResourceReference.prototype.type = ""; + CustomHttpPattern.prototype.kind = ""; /** - * ResourceReference childType. - * @member {string} childType - * @memberof google.api.ResourceReference + * CustomHttpPattern path. + * @member {string} path + * @memberof google.api.CustomHttpPattern * @instance */ - ResourceReference.prototype.childType = ""; + CustomHttpPattern.prototype.path = ""; /** - * Creates a new ResourceReference instance using the specified properties. + * Creates a new CustomHttpPattern instance using the specified properties. * @function create - * @memberof google.api.ResourceReference + * @memberof google.api.CustomHttpPattern * @static - * @param {google.api.IResourceReference=} [properties] Properties to set - * @returns {google.api.ResourceReference} ResourceReference instance + * @param {google.api.ICustomHttpPattern=} [properties] Properties to set + * @returns {google.api.CustomHttpPattern} CustomHttpPattern instance */ - ResourceReference.create = function create(properties) { - return new ResourceReference(properties); + CustomHttpPattern.create = function create(properties) { + return new CustomHttpPattern(properties); }; /** - * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. * @function encode - * @memberof google.api.ResourceReference + * @memberof google.api.CustomHttpPattern * @static - * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode + * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ResourceReference.encode = function encode(message, writer) { + CustomHttpPattern.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); + 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 ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. * @function encodeDelimited - * @memberof google.api.ResourceReference + * @memberof google.api.CustomHttpPattern * @static - * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode + * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ResourceReference.encodeDelimited = function encodeDelimited(message, writer) { + CustomHttpPattern.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ResourceReference message from the specified reader or buffer. + * Decodes a CustomHttpPattern message from the specified reader or buffer. * @function decode - * @memberof google.api.ResourceReference + * @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.ResourceReference} ResourceReference + * @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 */ - ResourceReference.decode = function decode(reader, length) { + 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.ResourceReference(); + 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.type = reader.string(); + message.kind = reader.string(); break; case 2: - message.childType = reader.string(); + message.path = reader.string(); break; default: reader.skipType(tag & 7); @@ -40683,122 +43492,96 @@ }; /** - * Decodes a ResourceReference message from the specified reader or buffer, length delimited. + * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.api.ResourceReference + * @memberof google.api.CustomHttpPattern * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.ResourceReference} ResourceReference + * @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 */ - ResourceReference.decodeDelimited = function decodeDelimited(reader) { + CustomHttpPattern.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ResourceReference message. + * Verifies a CustomHttpPattern message. * @function verify - * @memberof google.api.ResourceReference + * @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 */ - ResourceReference.verify = function verify(message) { + CustomHttpPattern.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"; + 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 ResourceReference message from a plain object. Also converts values to their respective internal types. + * Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.api.ResourceReference + * @memberof google.api.CustomHttpPattern * @static * @param {Object.} object Plain object - * @returns {google.api.ResourceReference} ResourceReference + * @returns {google.api.CustomHttpPattern} CustomHttpPattern */ - ResourceReference.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.ResourceReference) + CustomHttpPattern.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.CustomHttpPattern) 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); + 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 ResourceReference message. Also converts values to other types if specified. + * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. * @function toObject - * @memberof google.api.ResourceReference + * @memberof google.api.CustomHttpPattern * @static - * @param {google.api.ResourceReference} message ResourceReference + * @param {google.api.CustomHttpPattern} message CustomHttpPattern * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ResourceReference.toObject = function toObject(message, options) { + CustomHttpPattern.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.type = ""; - object.childType = ""; + object.kind = ""; + object.path = ""; } - if (message.type != null && message.hasOwnProperty("type")) - object.type = message.type; - if (message.childType != null && message.hasOwnProperty("childType")) - object.childType = message.childType; + 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 ResourceReference to JSON. + * Converts this CustomHttpPattern to JSON. * @function toJSON - * @memberof google.api.ResourceReference + * @memberof google.api.CustomHttpPattern * @instance * @returns {Object.} JSON object */ - ResourceReference.prototype.toJSON = function toJSON() { + CustomHttpPattern.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ResourceReference; - })(); - - /** - * 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; + return CustomHttpPattern; })(); return api; diff --git a/packages/google-cloud-securitycenter/protos/protos.json b/packages/google-cloud-securitycenter/protos/protos.json index dd1c8c98d87..fa20a22b37e 100644 --- a/packages/google-cloud-securitycenter/protos/protos.json +++ b/packages/google-cloud-securitycenter/protos/protos.json @@ -181,6 +181,58 @@ } } }, + "BigQueryExport": { + "options": { + "(google.api.resource).type": "securitycenter.googleapis.com/BigQueryExport", + "(google.api.resource).pattern": "projects/{project}/bigQueryExports/{export}" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "description": { + "type": "string", + "id": 2 + }, + "filter": { + "type": "string", + "id": 3 + }, + "dataset": { + "type": "string", + "id": 4 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "mostRecentEditor": { + "type": "string", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "principal": { + "type": "string", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, "ExternalSystem": { "options": { "(google.api.resource).type": "securitycenter.googleapis.com/ExternalSystem", @@ -299,6 +351,10 @@ "(google.api.field_behavior)": "OUTPUT_ONLY" } }, + "mitreAttack": { + "type": "MitreAttack", + "id": 25 + }, "access": { "type": "Access", "id": 26 @@ -339,7 +395,8 @@ "THREAT": 1, "VULNERABILITY": 2, "MISCONFIGURATION": 3, - "OBSERVATION": 4 + "OBSERVATION": 4, + "SCC_ERROR": 5 } } } @@ -358,6 +415,87 @@ } } }, + "MitreAttack": { + "fields": { + "primaryTactic": { + "type": "Tactic", + "id": 1 + }, + "primaryTechniques": { + "rule": "repeated", + "type": "Technique", + "id": 2 + }, + "additionalTactics": { + "rule": "repeated", + "type": "Tactic", + "id": 3 + }, + "additionalTechniques": { + "rule": "repeated", + "type": "Technique", + "id": 4 + }, + "version": { + "type": "string", + "id": 5 + } + }, + "nested": { + "Tactic": { + "values": { + "TACTIC_UNSPECIFIED": 0, + "RECONNAISSANCE": 1, + "RESOURCE_DEVELOPMENT": 2, + "INITIAL_ACCESS": 5, + "EXECUTION": 3, + "PERSISTENCE": 6, + "PRIVILEGE_ESCALATION": 8, + "DEFENSE_EVASION": 7, + "CREDENTIAL_ACCESS": 9, + "DISCOVERY": 10, + "LATERAL_MOVEMENT": 11, + "COLLECTION": 12, + "COMMAND_AND_CONTROL": 4, + "EXFILTRATION": 13, + "IMPACT": 14 + } + }, + "Technique": { + "values": { + "TECHNIQUE_UNSPECIFIED": 0, + "ACTIVE_SCANNING": 1, + "SCANNING_IP_BLOCKS": 2, + "INGRESS_TOOL_TRANSFER": 3, + "NATIVE_API": 4, + "SHARED_MODULES": 5, + "COMMAND_AND_SCRIPTING_INTERPRETER": 6, + "UNIX_SHELL": 7, + "RESOURCE_HIJACKING": 8, + "PROXY": 9, + "EXTERNAL_PROXY": 10, + "MULTI_HOP_PROXY": 11, + "DYNAMIC_RESOLUTION": 12, + "UNSECURED_CREDENTIALS": 13, + "VALID_ACCOUNTS": 14, + "LOCAL_ACCOUNTS": 15, + "CLOUD_ACCOUNTS": 16, + "NETWORK_DENIAL_OF_SERVICE": 17, + "PERMISSION_GROUPS_DISCOVERY": 18, + "CLOUD_GROUPS": 19, + "EXFILTRATION_OVER_WEB_SERVICE": 20, + "EXFILTRATION_TO_CLOUD_STORAGE": 21, + "ACCOUNT_MANIPULATION": 22, + "SSH_AUTHORIZED_KEYS": 23, + "CREATE_OR_MODIFY_SYSTEM_PROCESS": 24, + "STEAL_WEB_SESSION_COOKIE": 25, + "MODIFY_CLOUD_COMPUTE_INFRASTRUCTURE": 26, + "EXPLOIT_PUBLIC_FACING_APPLICATION": 27, + "MODIFY_AUTHENTICATION_PROCESS": 28 + } + } + } + }, "Vulnerability": { "fields": { "cve": { @@ -380,6 +518,10 @@ "cvssv3": { "type": "Cvssv3", "id": 3 + }, + "upstreamFixAvailable": { + "type": "bool", + "id": 4 } } }, @@ -908,6 +1050,33 @@ } ] }, + "GetBigQueryExport": { + "requestType": "GetBigQueryExportRequest", + "responseType": "BigQueryExport", + "options": { + "(google.api.http).get": "/v1/{name=organizations/*/bigQueryExports/*}", + "(google.api.http).additional_bindings.get": "/v1/{name=projects/*/bigQueryExports/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=organizations/*/bigQueryExports/*}", + "additional_bindings": [ + { + "get": "/v1/{name=folders/*/bigQueryExports/*}" + }, + { + "get": "/v1/{name=projects/*/bigQueryExports/*}" + } + ] + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, "GetIamPolicy": { "requestType": "google.iam.v1.GetIamPolicyRequest", "responseType": "google.iam.v1.Policy", @@ -1521,6 +1690,124 @@ "(google.api.method_signature)": "security_marks" } ] + }, + "CreateBigQueryExport": { + "requestType": "CreateBigQueryExportRequest", + "responseType": "BigQueryExport", + "options": { + "(google.api.http).post": "/v1/{parent=organizations/*}/bigQueryExports", + "(google.api.http).body": "big_query_export", + "(google.api.http).additional_bindings.post": "/v1/{parent=projects/*}/bigQueryExports", + "(google.api.http).additional_bindings.body": "big_query_export", + "(google.api.method_signature)": "parent,big_query_export,big_query_export_id" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=organizations/*}/bigQueryExports", + "body": "big_query_export", + "additional_bindings": [ + { + "post": "/v1/{parent=folders/*}/bigQueryExports", + "body": "big_query_export" + }, + { + "post": "/v1/{parent=projects/*}/bigQueryExports", + "body": "big_query_export" + } + ] + } + }, + { + "(google.api.method_signature)": "parent,big_query_export,big_query_export_id" + } + ] + }, + "DeleteBigQueryExport": { + "requestType": "DeleteBigQueryExportRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/{name=organizations/*/bigQueryExports/*}", + "(google.api.http).additional_bindings.delete": "/v1/{name=projects/*/bigQueryExports/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=organizations/*/bigQueryExports/*}", + "additional_bindings": [ + { + "delete": "/v1/{name=folders/*/bigQueryExports/*}" + }, + { + "delete": "/v1/{name=projects/*/bigQueryExports/*}" + } + ] + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "UpdateBigQueryExport": { + "requestType": "UpdateBigQueryExportRequest", + "responseType": "BigQueryExport", + "options": { + "(google.api.http).patch": "/v1/{big_query_export.name=organizations/*/bigQueryExports/*}", + "(google.api.http).body": "big_query_export", + "(google.api.http).additional_bindings.patch": "/v1/{big_query_export.name=projects/*/bigQueryExports/*}", + "(google.api.http).additional_bindings.body": "big_query_export", + "(google.api.method_signature)": "big_query_export,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{big_query_export.name=organizations/*/bigQueryExports/*}", + "body": "big_query_export", + "additional_bindings": [ + { + "patch": "/v1/{big_query_export.name=folders/*/bigQueryExports/*}", + "body": "big_query_export" + }, + { + "patch": "/v1/{big_query_export.name=projects/*/bigQueryExports/*}", + "body": "big_query_export" + } + ] + } + }, + { + "(google.api.method_signature)": "big_query_export,update_mask" + } + ] + }, + "ListBigQueryExports": { + "requestType": "ListBigQueryExportsRequest", + "responseType": "ListBigQueryExportsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=organizations/*}/bigQueryExports", + "(google.api.http).additional_bindings.get": "/v1/{parent=projects/*}/bigQueryExports", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=organizations/*}/bigQueryExports", + "additional_bindings": [ + { + "get": "/v1/{parent=folders/*}/bigQueryExports" + }, + { + "get": "/v1/{parent=projects/*}/bigQueryExports" + } + ] + } + }, + { + "(google.api.method_signature)": "parent" + } + ] } } }, @@ -1671,6 +1958,18 @@ } } }, + "GetBigQueryExportRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "securitycenter.googleapis.com/BigQueryExport" + } + } + } + }, "GetMuteConfigRequest": { "fields": { "name": { @@ -2332,6 +2631,92 @@ } } }, + "CreateBigQueryExportRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "securitycenter.googleapis.com/BigQueryExport" + } + }, + "bigQueryExport": { + "type": "BigQueryExport", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "bigQueryExportId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "UpdateBigQueryExportRequest": { + "fields": { + "bigQueryExport": { + "type": "BigQueryExport", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2 + } + } + }, + "ListBigQueryExportsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "securitycenter.googleapis.com/BigQueryExport" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListBigQueryExportsResponse": { + "fields": { + "bigQueryExports": { + "rule": "repeated", + "type": "BigQueryExport", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "DeleteBigQueryExportRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "securitycenter.googleapis.com/BigQueryExport" + } + } + } + }, "Source": { "options": { "(google.api.resource).type": "securitycenter.googleapis.com/Source", @@ -5082,101 +5467,14 @@ }, "api": { "options": { + "cc_enable_arenas": true, "go_package": "google.golang.org/genproto/googleapis/api/annotations;annotations", "java_multiple_files": true, "java_outer_classname": "ClientProto", "java_package": "com.google.api", - "objc_class_prefix": "GAPI", - "cc_enable_arenas": true + "objc_class_prefix": "GAPI" }, "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 - } - } - }, "resourceReference": { "type": "google.api.ResourceReference", "id": 1055, @@ -5272,6 +5570,93 @@ "NON_EMPTY_DEFAULT": 7 } }, + "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", diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.bulk_mute_findings.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.bulk_mute_findings.js index dfc2499d41d..dc7a324fbb7 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.bulk_mute_findings.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.bulk_mute_findings.js @@ -26,8 +26,8 @@ function main(parent) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * Required. The parent, at which bulk action needs to be applied. Its format is - * "organizations/[organization_id]", "folders/[folder_id]", + * Required. The parent, at which bulk action needs to be applied. Its format + * is "organizations/[organization_id]", "folders/[folder_id]", * "projects/[project_id]". */ // const parent = 'abc123' diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.create_big_query_export.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.create_big_query_export.js new file mode 100644 index 00000000000..83f63f53d09 --- /dev/null +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.create_big_query_export.js @@ -0,0 +1,73 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, bigQueryExport, bigQueryExportId) { + // [START securitycenter_v1_generated_SecurityCenter_CreateBigQueryExport_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Resource name of the new big query export's parent. Its format is + * "organizations/[organization_id]", "folders/[folder_id]", or + * "projects/[project_id]". + */ + // const parent = 'abc123' + /** + * Required. The big query export being created. + */ + // const bigQueryExport = {} + /** + * Required. Unique identifier provided by the client within the parent scope. + * It must consist of lower case letters, numbers, and hyphen, with the first + * character a letter, the last a letter or a number, and a 63 character + * maximum. + */ + // const bigQueryExportId = 'abc123' + + // Imports the Securitycenter library + const {SecurityCenterClient} = require('@google-cloud/security-center').v1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function callCreateBigQueryExport() { + // Construct request + const request = { + parent, + bigQueryExport, + bigQueryExportId, + }; + + // Run request + const response = await securitycenterClient.createBigQueryExport(request); + console.log(response); + } + + callCreateBigQueryExport(); + // [END securitycenter_v1_generated_SecurityCenter_CreateBigQueryExport_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.create_finding.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.create_finding.js index a51ddfddb26..c90e509f32b 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.create_finding.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.create_finding.js @@ -37,8 +37,8 @@ function main(parent, findingId, finding) { */ // const findingId = 'abc123' /** - * Required. The Finding being created. The name and security_marks will be ignored as - * they are both output only fields on this resource. + * Required. The Finding being created. The name and security_marks will be + * ignored as they are both output only fields on this resource. */ // const finding = {} diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.create_notification_config.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.create_notification_config.js index 73f2e6ba3d1..7b101bf3302 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.create_notification_config.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.create_notification_config.js @@ -26,8 +26,8 @@ function main(parent, configId, notificationConfig) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * Required. Resource name of the new notification config's parent. Its format is - * "organizations/[organization_id]". + * Required. Resource name of the new notification config's parent. Its format + * is "organizations/[organization_id]". */ // const parent = 'abc123' /** @@ -38,8 +38,9 @@ function main(parent, configId, notificationConfig) { */ // const configId = 'abc123' /** - * Required. The notification config being created. The name and the service account - * will be ignored as they are both output only fields on this resource. + * Required. The notification config being created. The name and the service + * account will be ignored as they are both output only fields on this + * resource. */ // const notificationConfig = {} diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.create_source.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.create_source.js index 0465b795433..b06d0f14897 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.create_source.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.create_source.js @@ -31,8 +31,8 @@ function main(parent, source) { */ // const parent = 'abc123' /** - * Required. The Source being created, only the display_name and description will be - * used. All other fields will be ignored. + * Required. The Source being created, only the display_name and description + * will be used. All other fields will be ignored. */ // const source = {} diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.delete_big_query_export.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.delete_big_query_export.js new file mode 100644 index 00000000000..c82674a4553 --- /dev/null +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.delete_big_query_export.js @@ -0,0 +1,61 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START securitycenter_v1_generated_SecurityCenter_DeleteBigQueryExport_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of the big query export to delete. Its format is + * organizations/{organization}/bigQueryExports/{export_id}, + * folders/{folder}/bigQueryExports/{export_id}, or + * projects/{project}/bigQueryExports/{export_id} + */ + // const name = 'abc123' + + // Imports the Securitycenter library + const {SecurityCenterClient} = require('@google-cloud/security-center').v1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function callDeleteBigQueryExport() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await securitycenterClient.deleteBigQueryExport(request); + console.log(response); + } + + callDeleteBigQueryExport(); + // [END securitycenter_v1_generated_SecurityCenter_DeleteBigQueryExport_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_big_query_export.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_big_query_export.js new file mode 100644 index 00000000000..ca65408182b --- /dev/null +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_big_query_export.js @@ -0,0 +1,61 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START securitycenter_v1_generated_SecurityCenter_GetBigQueryExport_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of the big query export to retrieve. Its format is + * organizations/{organization}/bigQueryExports/{export_id}, + * folders/{folder}/bigQueryExports/{export_id}, or + * projects/{project}/bigQueryExports/{export_id} + */ + // const name = 'abc123' + + // Imports the Securitycenter library + const {SecurityCenterClient} = require('@google-cloud/security-center').v1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function callGetBigQueryExport() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await securitycenterClient.getBigQueryExport(request); + console.log(response); + } + + callGetBigQueryExport(); + // [END securitycenter_v1_generated_SecurityCenter_GetBigQueryExport_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_organization_settings.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_organization_settings.js index 888f48e3075..0bb6cbadce2 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_organization_settings.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_organization_settings.js @@ -26,8 +26,8 @@ function main(name) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * Required. Name of the organization to get organization settings for. Its format is - * "organizations/[organization_id]/organizationSettings". + * Required. Name of the organization to get organization settings for. Its + * format is "organizations/[organization_id]/organizationSettings". */ // const name = 'abc123' diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.group_assets.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.group_assets.js index a16fcba32fb..c1365acc241 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.group_assets.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.group_assets.js @@ -82,9 +82,9 @@ function main(parent, groupBy) { */ // const filter = 'abc123' /** - * Required. Expression that defines what assets fields to use for grouping. The string - * value should follow SQL syntax: comma separated list of fields. For - * example: + * Required. Expression that defines what assets fields to use for grouping. + * The string value should follow SQL syntax: comma separated list of fields. + * For example: * "security_center_properties.resource_project,security_center_properties.project". * The following fields are supported when compare_duration is not set: * * security_center_properties.resource_project diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.group_findings.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.group_findings.js index d59021ca140..b1a357f1395 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.group_findings.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.group_findings.js @@ -84,9 +84,9 @@ function main(parent, groupBy) { */ // const filter = 'abc123' /** - * Required. Expression that defines what assets fields to use for grouping (including - * `state_change`). The string value should follow SQL syntax: comma separated - * list of fields. For example: "parent,resource_name". + * Required. Expression that defines what assets fields to use for grouping + * (including `state_change`). The string value should follow SQL syntax: + * comma separated list of fields. For example: "parent,resource_name". * The following fields are supported: * * resource_name * * category diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_big_query_exports.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_big_query_exports.js new file mode 100644 index 00000000000..3dce0c2c8e5 --- /dev/null +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_big_query_exports.js @@ -0,0 +1,76 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START securitycenter_v1_generated_SecurityCenter_ListBigQueryExports_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent, which owns the collection of BigQuery exports. Its + * format is "organizations/[organization_id]", "folders/[folder_id]", + * "projects/[project_id]". + */ + // const parent = 'abc123' + /** + * The maximum number of configs to return. The service may return fewer than + * this value. + * If unspecified, at most 10 configs will be returned. + * The maximum value is 1000; values above 1000 will be coerced to 1000. + */ + // const pageSize = 1234 + /** + * A page token, received from a previous `ListBigQueryExports` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListBigQueryExports` + * must match the call that provided the page token. + */ + // const pageToken = 'abc123' + + // Imports the Securitycenter library + const {SecurityCenterClient} = require('@google-cloud/security-center').v1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function callListBigQueryExports() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await securitycenterClient.listBigQueryExportsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListBigQueryExports(); + // [END securitycenter_v1_generated_SecurityCenter_ListBigQueryExports_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_mute_configs.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_mute_configs.js index 605e24f40ae..7a20b7d8671 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_mute_configs.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_mute_configs.js @@ -26,8 +26,8 @@ function main(parent) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * Required. The parent, which owns the collection of mute configs. Its format is - * "organizations/[organization_id]", "folders/[folder_id]", + * Required. The parent, which owns the collection of mute configs. Its format + * is "organizations/[organization_id]", "folders/[folder_id]", * "projects/[project_id]". */ // const parent = 'abc123' diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_sources.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_sources.js index cb28399a2e8..c4a1ad3dcd1 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_sources.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_sources.js @@ -26,8 +26,8 @@ function main(parent) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * Required. Resource name of the parent of sources to list. Its format should be - * "organizations/[organization_id], folders/[folder_id], or + * Required. Resource name of the parent of sources to list. Its format should + * be "organizations/[organization_id], folders/[folder_id], or * projects/[project_id]". */ // const parent = 'abc123' diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.run_asset_discovery.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.run_asset_discovery.js index d52034dfd59..75b1cc837e9 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.run_asset_discovery.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.run_asset_discovery.js @@ -26,8 +26,8 @@ function main(parent) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * Required. Name of the organization to run asset discovery for. Its format is - * "organizations/[organization_id]". + * Required. Name of the organization to run asset discovery for. Its format + * is "organizations/[organization_id]". */ // const parent = 'abc123' diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_big_query_export.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_big_query_export.js new file mode 100644 index 00000000000..e74d9c238dc --- /dev/null +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_big_query_export.js @@ -0,0 +1,63 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(bigQueryExport) { + // [START securitycenter_v1_generated_SecurityCenter_UpdateBigQueryExport_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The BigQuery export being updated. + */ + // const bigQueryExport = {} + /** + * The list of fields to be updated. + * If empty all mutable fields will be updated. + */ + // const updateMask = {} + + // Imports the Securitycenter library + const {SecurityCenterClient} = require('@google-cloud/security-center').v1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function callUpdateBigQueryExport() { + // Construct request + const request = { + bigQueryExport, + }; + + // Run request + const response = await securitycenterClient.updateBigQueryExport(request); + console.log(response); + } + + callUpdateBigQueryExport(); + // [END securitycenter_v1_generated_SecurityCenter_UpdateBigQueryExport_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_finding.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_finding.js index 43974498848..effade31d16 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_finding.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_finding.js @@ -26,8 +26,8 @@ function main(finding) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * Required. The finding resource to update or create if it does not already exist. - * parent, security_marks, and update_time will be ignored. + * Required. The finding resource to update or create if it does not already + * exist. parent, security_marks, and update_time will be ignored. * In the case of creation, the finding id portion of the name must be * alphanumeric and less than or equal to 32 characters and greater than 0 * characters in length. diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/snippet_metadata.google.cloud.securitycenter.v1.json b/packages/google-cloud-securitycenter/samples/generated/v1/snippet_metadata.google.cloud.securitycenter.v1.json index 5bf1ce0f5e0..bed009e660c 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/snippet_metadata.google.cloud.securitycenter.v1.json +++ b/packages/google-cloud-securitycenter/samples/generated/v1/snippet_metadata.google.cloud.securitycenter.v1.json @@ -210,7 +210,7 @@ "segments": [ { "start": 25, - "end": 65, + "end": 66, "type": "FULL" } ], @@ -327,6 +327,46 @@ } } }, + { + "regionTag": "securitycenter_v1_generated_SecurityCenter_GetBigQueryExport_async", + "title": "SecurityCenter getBigQueryExport Sample", + "origin": "API_DEFINITION", + "description": " Gets a big query export.", + "canonical": true, + "file": "security_center.get_big_query_export.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetBigQueryExport", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.GetBigQueryExport", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.securitycenter.v1.BigQueryExport", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" + }, + "method": { + "shortName": "GetBigQueryExport", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.GetBigQueryExport", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + } + }, { "regionTag": "securitycenter_v1_generated_SecurityCenter_GetIamPolicy_async", "title": "SecurityCenter getIamPolicy Sample", @@ -1470,6 +1510,186 @@ } } } + }, + { + "regionTag": "securitycenter_v1_generated_SecurityCenter_CreateBigQueryExport_async", + "title": "SecurityCenter createBigQueryExport Sample", + "origin": "API_DEFINITION", + "description": " Creates a big query export.", + "canonical": true, + "file": "security_center.create_big_query_export.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 65, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateBigQueryExport", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.CreateBigQueryExport", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "big_query_export", + "type": ".google.cloud.securitycenter.v1.BigQueryExport" + }, + { + "name": "big_query_export_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.securitycenter.v1.BigQueryExport", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" + }, + "method": { + "shortName": "CreateBigQueryExport", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.CreateBigQueryExport", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v1_generated_SecurityCenter_DeleteBigQueryExport_async", + "title": "SecurityCenter deleteBigQueryExport Sample", + "origin": "API_DEFINITION", + "description": " Deletes an existing big query export.", + "canonical": true, + "file": "security_center.delete_big_query_export.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteBigQueryExport", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.DeleteBigQueryExport", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" + }, + "method": { + "shortName": "DeleteBigQueryExport", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.DeleteBigQueryExport", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v1_generated_SecurityCenter_UpdateBigQueryExport_async", + "title": "SecurityCenter updateBigQueryExport Sample", + "origin": "API_DEFINITION", + "description": " Updates a BigQuery export.", + "canonical": true, + "file": "security_center.update_big_query_export.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateBigQueryExport", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.UpdateBigQueryExport", + "async": true, + "parameters": [ + { + "name": "big_query_export", + "type": ".google.cloud.securitycenter.v1.BigQueryExport" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.securitycenter.v1.BigQueryExport", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" + }, + "method": { + "shortName": "UpdateBigQueryExport", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.UpdateBigQueryExport", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v1_generated_SecurityCenter_ListBigQueryExports_async", + "title": "SecurityCenter listBigQueryExports Sample", + "origin": "API_DEFINITION", + "description": " Lists BigQuery exports. Note that when requesting BigQuery exports at a given level all exports under that level are also returned e.g. if requesting BigQuery exports under a folder, then all BigQuery exports immediately under the folder plus the ones created under the projects within the folder are returned.", + "canonical": true, + "file": "security_center.list_big_query_exports.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 68, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListBigQueryExports", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.ListBigQueryExports", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.securitycenter.v1.ListBigQueryExportsResponse", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" + }, + "method": { + "shortName": "ListBigQueryExports", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.ListBigQueryExports", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + } } ] } diff --git a/packages/google-cloud-securitycenter/src/v1/gapic_metadata.json b/packages/google-cloud-securitycenter/src/v1/gapic_metadata.json index 84ee4472f7e..adec8cae59d 100644 --- a/packages/google-cloud-securitycenter/src/v1/gapic_metadata.json +++ b/packages/google-cloud-securitycenter/src/v1/gapic_metadata.json @@ -40,6 +40,11 @@ "deleteNotificationConfig" ] }, + "GetBigQueryExport": { + "methods": [ + "getBigQueryExport" + ] + }, "GetIamPolicy": { "methods": [ "getIamPolicy" @@ -120,6 +125,21 @@ "updateSecurityMarks" ] }, + "CreateBigQueryExport": { + "methods": [ + "createBigQueryExport" + ] + }, + "DeleteBigQueryExport": { + "methods": [ + "deleteBigQueryExport" + ] + }, + "UpdateBigQueryExport": { + "methods": [ + "updateBigQueryExport" + ] + }, "BulkMuteFindings": { "methods": [ "bulkMuteFindings" @@ -178,6 +198,13 @@ "listSourcesStream", "listSourcesAsync" ] + }, + "ListBigQueryExports": { + "methods": [ + "listBigQueryExports", + "listBigQueryExportsStream", + "listBigQueryExportsAsync" + ] } } }, @@ -214,6 +241,11 @@ "deleteNotificationConfig" ] }, + "GetBigQueryExport": { + "methods": [ + "getBigQueryExport" + ] + }, "GetIamPolicy": { "methods": [ "getIamPolicy" @@ -294,6 +326,21 @@ "updateSecurityMarks" ] }, + "CreateBigQueryExport": { + "methods": [ + "createBigQueryExport" + ] + }, + "DeleteBigQueryExport": { + "methods": [ + "deleteBigQueryExport" + ] + }, + "UpdateBigQueryExport": { + "methods": [ + "updateBigQueryExport" + ] + }, "BulkMuteFindings": { "methods": [ "bulkMuteFindings" @@ -352,6 +399,13 @@ "listSourcesStream", "listSourcesAsync" ] + }, + "ListBigQueryExports": { + "methods": [ + "listBigQueryExports", + "listBigQueryExportsStream", + "listBigQueryExportsAsync" + ] } } } diff --git a/packages/google-cloud-securitycenter/src/v1/security_center_client.ts b/packages/google-cloud-securitycenter/src/v1/security_center_client.ts index b747c342ad0..c0b057f44f2 100644 --- a/packages/google-cloud-securitycenter/src/v1/security_center_client.ts +++ b/packages/google-cloud-securitycenter/src/v1/security_center_client.ts @@ -172,6 +172,9 @@ export class SecurityCenterClient { folderAssetSecurityMarksPathTemplate: new this._gaxModule.PathTemplate( 'folders/{folder}/assets/{asset}/securityMarks' ), + folderExportPathTemplate: new this._gaxModule.PathTemplate( + 'folders/{folder}/bigQueryExports/{export}' + ), folderMuteConfigPathTemplate: new this._gaxModule.PathTemplate( 'folders/{folder}/muteConfigs/{mute_config}' ), @@ -202,6 +205,9 @@ export class SecurityCenterClient { new this._gaxModule.PathTemplate( 'organizations/{organization}/assets/{asset}/securityMarks' ), + organizationExportPathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}/bigQueryExports/{export}' + ), organizationMuteConfigPathTemplate: new this._gaxModule.PathTemplate( 'organizations/{organization}/muteConfigs/{mute_config}' ), @@ -228,6 +234,9 @@ export class SecurityCenterClient { projectAssetSecurityMarksPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/assets/{asset}/securityMarks' ), + projectExportPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/bigQueryExports/{export}' + ), projectMuteConfigPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/muteConfigs/{mute_config}' ), @@ -286,6 +295,11 @@ export class SecurityCenterClient { 'nextPageToken', 'sources' ), + listBigQueryExports: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'bigQueryExports' + ), }; const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos); @@ -383,6 +397,7 @@ export class SecurityCenterClient { 'createNotificationConfig', 'deleteMuteConfig', 'deleteNotificationConfig', + 'getBigQueryExport', 'getIamPolicy', 'getMuteConfig', 'getNotificationConfig', @@ -407,6 +422,10 @@ export class SecurityCenterClient { 'updateOrganizationSettings', 'updateSource', 'updateSecurityMarks', + 'createBigQueryExport', + 'deleteBigQueryExport', + 'updateBigQueryExport', + 'listBigQueryExports', ]; for (const methodName of securityCenterStubMethods) { const callPromise = this.securityCenterStub.then( @@ -501,8 +520,8 @@ export class SecurityCenterClient { * Required. Resource name of the new source's parent. Its format should be * "organizations/[organization_id]". * @param {google.cloud.securitycenter.v1.Source} request.source - * Required. The Source being created, only the display_name and description will be - * used. All other fields will be ignored. + * Required. The Source being created, only the display_name and description + * will be used. All other fields will be ignored. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -601,8 +620,8 @@ export class SecurityCenterClient { * It must be alphanumeric and less than or equal to 32 characters and * greater than 0 characters in length. * @param {google.cloud.securitycenter.v1.Finding} request.finding - * Required. The Finding being created. The name and security_marks will be ignored as - * they are both output only fields on this resource. + * Required. The Finding being created. The name and security_marks will be + * ignored as they are both output only fields on this resource. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -799,16 +818,17 @@ export class SecurityCenterClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. Resource name of the new notification config's parent. Its format is - * "organizations/[organization_id]". + * Required. Resource name of the new notification config's parent. Its format + * is "organizations/[organization_id]". * @param {string} request.configId * Required. * Unique identifier provided by the client within the parent scope. * It must be between 1 and 128 characters, and contains alphanumeric * characters, underscores or hyphens only. * @param {google.cloud.securitycenter.v1.NotificationConfig} request.notificationConfig - * Required. The notification config being created. The name and the service account - * will be ignored as they are both output only fields on this resource. + * Required. The notification config being created. The name and the service + * account will be ignored as they are both output only fields on this + * resource. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -1105,6 +1125,106 @@ export class SecurityCenterClient { callback ); } + /** + * Gets a big query export. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the big query export to retrieve. Its format is + * organizations/{organization}/bigQueryExports/{export_id}, + * folders/{folder}/bigQueryExports/{export_id}, or + * projects/{project}/bigQueryExports/{export_id} + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [BigQueryExport]{@link google.cloud.securitycenter.v1.BigQueryExport}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/security_center.get_big_query_export.js + * region_tag:securitycenter_v1_generated_SecurityCenter_GetBigQueryExport_async + */ + getBigQueryExport( + request?: protos.google.cloud.securitycenter.v1.IGetBigQueryExportRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.securitycenter.v1.IBigQueryExport, + ( + | protos.google.cloud.securitycenter.v1.IGetBigQueryExportRequest + | undefined + ), + {} | undefined + ] + >; + getBigQueryExport( + request: protos.google.cloud.securitycenter.v1.IGetBigQueryExportRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.securitycenter.v1.IBigQueryExport, + | protos.google.cloud.securitycenter.v1.IGetBigQueryExportRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getBigQueryExport( + request: protos.google.cloud.securitycenter.v1.IGetBigQueryExportRequest, + callback: Callback< + protos.google.cloud.securitycenter.v1.IBigQueryExport, + | protos.google.cloud.securitycenter.v1.IGetBigQueryExportRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getBigQueryExport( + request?: protos.google.cloud.securitycenter.v1.IGetBigQueryExportRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.securitycenter.v1.IBigQueryExport, + | protos.google.cloud.securitycenter.v1.IGetBigQueryExportRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.securitycenter.v1.IBigQueryExport, + | protos.google.cloud.securitycenter.v1.IGetBigQueryExportRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.securitycenter.v1.IBigQueryExport, + ( + | protos.google.cloud.securitycenter.v1.IGetBigQueryExportRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + name: request.name || '', + }); + this.initialize(); + return this.innerApiCalls.getBigQueryExport(request, options, callback); + } /** * Gets the access control policy on the specified Source. * @@ -1390,8 +1510,8 @@ export class SecurityCenterClient { * @param {Object} request * The request object that will be sent. * @param {string} request.name - * Required. Name of the organization to get organization settings for. Its format is - * "organizations/[organization_id]/organizationSettings". + * Required. Name of the organization to get organization settings for. Its + * format is "organizations/[organization_id]/organizationSettings". * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -2054,8 +2174,8 @@ export class SecurityCenterClient { * @param {Object} request * The request object that will be sent. * @param {google.cloud.securitycenter.v1.Finding} request.finding - * Required. The finding resource to update or create if it does not already exist. - * parent, security_marks, and update_time will be ignored. + * Required. The finding resource to update or create if it does not already + * exist. parent, security_marks, and update_time will be ignored. * * In the case of creation, the finding id portion of the name must be * alphanumeric and less than or equal to 32 characters and greater than 0 @@ -2564,86 +2684,392 @@ export class SecurityCenterClient { * * @param {Object} request * The request object that will be sent. - * @param {google.cloud.securitycenter.v1.SecurityMarks} request.securityMarks - * Required. The security marks resource to update. + * @param {google.cloud.securitycenter.v1.SecurityMarks} request.securityMarks + * Required. The security marks resource to update. + * @param {google.protobuf.FieldMask} request.updateMask + * The FieldMask to use when updating the security marks resource. + * + * The field mask must not contain duplicate fields. + * If empty or set to "marks", all marks will be replaced. Individual + * marks can be updated using "marks.". + * @param {google.protobuf.Timestamp} request.startTime + * The time at which the updated SecurityMarks take effect. + * If not set uses current server time. Updates will be applied to the + * SecurityMarks that are active immediately preceding this time. Must be + * smaller or equal to the server time. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [SecurityMarks]{@link google.cloud.securitycenter.v1.SecurityMarks}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/security_center.update_security_marks.js + * region_tag:securitycenter_v1_generated_SecurityCenter_UpdateSecurityMarks_async + */ + updateSecurityMarks( + request?: protos.google.cloud.securitycenter.v1.IUpdateSecurityMarksRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.securitycenter.v1.ISecurityMarks, + ( + | protos.google.cloud.securitycenter.v1.IUpdateSecurityMarksRequest + | undefined + ), + {} | undefined + ] + >; + updateSecurityMarks( + request: protos.google.cloud.securitycenter.v1.IUpdateSecurityMarksRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.securitycenter.v1.ISecurityMarks, + | protos.google.cloud.securitycenter.v1.IUpdateSecurityMarksRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateSecurityMarks( + request: protos.google.cloud.securitycenter.v1.IUpdateSecurityMarksRequest, + callback: Callback< + protos.google.cloud.securitycenter.v1.ISecurityMarks, + | protos.google.cloud.securitycenter.v1.IUpdateSecurityMarksRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateSecurityMarks( + request?: protos.google.cloud.securitycenter.v1.IUpdateSecurityMarksRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.securitycenter.v1.ISecurityMarks, + | protos.google.cloud.securitycenter.v1.IUpdateSecurityMarksRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.securitycenter.v1.ISecurityMarks, + | protos.google.cloud.securitycenter.v1.IUpdateSecurityMarksRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.securitycenter.v1.ISecurityMarks, + ( + | protos.google.cloud.securitycenter.v1.IUpdateSecurityMarksRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + 'security_marks.name': request.securityMarks!.name || '', + }); + this.initialize(); + return this.innerApiCalls.updateSecurityMarks(request, options, callback); + } + /** + * Creates a big query export. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Resource name of the new big query export's parent. Its format is + * "organizations/[organization_id]", "folders/[folder_id]", or + * "projects/[project_id]". + * @param {google.cloud.securitycenter.v1.BigQueryExport} request.bigQueryExport + * Required. The big query export being created. + * @param {string} request.bigQueryExportId + * Required. Unique identifier provided by the client within the parent scope. + * It must consist of lower case letters, numbers, and hyphen, with the first + * character a letter, the last a letter or a number, and a 63 character + * maximum. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [BigQueryExport]{@link google.cloud.securitycenter.v1.BigQueryExport}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/security_center.create_big_query_export.js + * region_tag:securitycenter_v1_generated_SecurityCenter_CreateBigQueryExport_async + */ + createBigQueryExport( + request?: protos.google.cloud.securitycenter.v1.ICreateBigQueryExportRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.securitycenter.v1.IBigQueryExport, + ( + | protos.google.cloud.securitycenter.v1.ICreateBigQueryExportRequest + | undefined + ), + {} | undefined + ] + >; + createBigQueryExport( + request: protos.google.cloud.securitycenter.v1.ICreateBigQueryExportRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.securitycenter.v1.IBigQueryExport, + | protos.google.cloud.securitycenter.v1.ICreateBigQueryExportRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createBigQueryExport( + request: protos.google.cloud.securitycenter.v1.ICreateBigQueryExportRequest, + callback: Callback< + protos.google.cloud.securitycenter.v1.IBigQueryExport, + | protos.google.cloud.securitycenter.v1.ICreateBigQueryExportRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createBigQueryExport( + request?: protos.google.cloud.securitycenter.v1.ICreateBigQueryExportRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.securitycenter.v1.IBigQueryExport, + | protos.google.cloud.securitycenter.v1.ICreateBigQueryExportRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.securitycenter.v1.IBigQueryExport, + | protos.google.cloud.securitycenter.v1.ICreateBigQueryExportRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.securitycenter.v1.IBigQueryExport, + ( + | protos.google.cloud.securitycenter.v1.ICreateBigQueryExportRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.createBigQueryExport(request, options, callback); + } + /** + * Deletes an existing big query export. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the big query export to delete. Its format is + * organizations/{organization}/bigQueryExports/{export_id}, + * folders/{folder}/bigQueryExports/{export_id}, or + * projects/{project}/bigQueryExports/{export_id} + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/security_center.delete_big_query_export.js + * region_tag:securitycenter_v1_generated_SecurityCenter_DeleteBigQueryExport_async + */ + deleteBigQueryExport( + request?: protos.google.cloud.securitycenter.v1.IDeleteBigQueryExportRequest, + options?: CallOptions + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.securitycenter.v1.IDeleteBigQueryExportRequest + | undefined + ), + {} | undefined + ] + >; + deleteBigQueryExport( + request: protos.google.cloud.securitycenter.v1.IDeleteBigQueryExportRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.securitycenter.v1.IDeleteBigQueryExportRequest + | null + | undefined, + {} | null | undefined + > + ): void; + deleteBigQueryExport( + request: protos.google.cloud.securitycenter.v1.IDeleteBigQueryExportRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.securitycenter.v1.IDeleteBigQueryExportRequest + | null + | undefined, + {} | null | undefined + > + ): void; + deleteBigQueryExport( + request?: protos.google.cloud.securitycenter.v1.IDeleteBigQueryExportRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.securitycenter.v1.IDeleteBigQueryExportRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.securitycenter.v1.IDeleteBigQueryExportRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.securitycenter.v1.IDeleteBigQueryExportRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + name: request.name || '', + }); + this.initialize(); + return this.innerApiCalls.deleteBigQueryExport(request, options, callback); + } + /** + * Updates a BigQuery export. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.securitycenter.v1.BigQueryExport} request.bigQueryExport + * Required. The BigQuery export being updated. * @param {google.protobuf.FieldMask} request.updateMask - * The FieldMask to use when updating the security marks resource. - * - * The field mask must not contain duplicate fields. - * If empty or set to "marks", all marks will be replaced. Individual - * marks can be updated using "marks.". - * @param {google.protobuf.Timestamp} request.startTime - * The time at which the updated SecurityMarks take effect. - * If not set uses current server time. Updates will be applied to the - * SecurityMarks that are active immediately preceding this time. Must be - * smaller or equal to the server time. + * The list of fields to be updated. + * If empty all mutable fields will be updated. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [SecurityMarks]{@link google.cloud.securitycenter.v1.SecurityMarks}. + * The first element of the array is an object representing [BigQueryExport]{@link google.cloud.securitycenter.v1.BigQueryExport}. * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) * for more details and examples. - * @example include:samples/generated/v1/security_center.update_security_marks.js - * region_tag:securitycenter_v1_generated_SecurityCenter_UpdateSecurityMarks_async + * @example include:samples/generated/v1/security_center.update_big_query_export.js + * region_tag:securitycenter_v1_generated_SecurityCenter_UpdateBigQueryExport_async */ - updateSecurityMarks( - request?: protos.google.cloud.securitycenter.v1.IUpdateSecurityMarksRequest, + updateBigQueryExport( + request?: protos.google.cloud.securitycenter.v1.IUpdateBigQueryExportRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.securitycenter.v1.ISecurityMarks, + protos.google.cloud.securitycenter.v1.IBigQueryExport, ( - | protos.google.cloud.securitycenter.v1.IUpdateSecurityMarksRequest + | protos.google.cloud.securitycenter.v1.IUpdateBigQueryExportRequest | undefined ), {} | undefined ] >; - updateSecurityMarks( - request: protos.google.cloud.securitycenter.v1.IUpdateSecurityMarksRequest, + updateBigQueryExport( + request: protos.google.cloud.securitycenter.v1.IUpdateBigQueryExportRequest, options: CallOptions, callback: Callback< - protos.google.cloud.securitycenter.v1.ISecurityMarks, - | protos.google.cloud.securitycenter.v1.IUpdateSecurityMarksRequest + protos.google.cloud.securitycenter.v1.IBigQueryExport, + | protos.google.cloud.securitycenter.v1.IUpdateBigQueryExportRequest | null | undefined, {} | null | undefined > ): void; - updateSecurityMarks( - request: protos.google.cloud.securitycenter.v1.IUpdateSecurityMarksRequest, + updateBigQueryExport( + request: protos.google.cloud.securitycenter.v1.IUpdateBigQueryExportRequest, callback: Callback< - protos.google.cloud.securitycenter.v1.ISecurityMarks, - | protos.google.cloud.securitycenter.v1.IUpdateSecurityMarksRequest + protos.google.cloud.securitycenter.v1.IBigQueryExport, + | protos.google.cloud.securitycenter.v1.IUpdateBigQueryExportRequest | null | undefined, {} | null | undefined > ): void; - updateSecurityMarks( - request?: protos.google.cloud.securitycenter.v1.IUpdateSecurityMarksRequest, + updateBigQueryExport( + request?: protos.google.cloud.securitycenter.v1.IUpdateBigQueryExportRequest, optionsOrCallback?: | CallOptions | Callback< - protos.google.cloud.securitycenter.v1.ISecurityMarks, - | protos.google.cloud.securitycenter.v1.IUpdateSecurityMarksRequest + protos.google.cloud.securitycenter.v1.IBigQueryExport, + | protos.google.cloud.securitycenter.v1.IUpdateBigQueryExportRequest | null | undefined, {} | null | undefined >, callback?: Callback< - protos.google.cloud.securitycenter.v1.ISecurityMarks, - | protos.google.cloud.securitycenter.v1.IUpdateSecurityMarksRequest + protos.google.cloud.securitycenter.v1.IBigQueryExport, + | protos.google.cloud.securitycenter.v1.IUpdateBigQueryExportRequest | null | undefined, {} | null | undefined > ): Promise< [ - protos.google.cloud.securitycenter.v1.ISecurityMarks, + protos.google.cloud.securitycenter.v1.IBigQueryExport, ( - | protos.google.cloud.securitycenter.v1.IUpdateSecurityMarksRequest + | protos.google.cloud.securitycenter.v1.IUpdateBigQueryExportRequest | undefined ), {} | undefined @@ -2662,10 +3088,10 @@ export class SecurityCenterClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = gax.routingHeader.fromParams({ - 'security_marks.name': request.securityMarks!.name || '', + 'big_query_export.name': request.bigQueryExport!.name || '', }); this.initialize(); - return this.innerApiCalls.updateSecurityMarks(request, options, callback); + return this.innerApiCalls.updateBigQueryExport(request, options, callback); } /** @@ -2676,8 +3102,8 @@ export class SecurityCenterClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. The parent, at which bulk action needs to be applied. Its format is - * "organizations/[organization_id]", "folders/[folder_id]", + * Required. The parent, at which bulk action needs to be applied. Its format + * is "organizations/[organization_id]", "folders/[folder_id]", * "projects/[project_id]". * @param {string} request.filter * Expression that identifies findings that should be updated. @@ -2844,8 +3270,8 @@ export class SecurityCenterClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. Name of the organization to run asset discovery for. Its format is - * "organizations/[organization_id]". + * Required. Name of the organization to run asset discovery for. Its format + * is "organizations/[organization_id]". * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -3050,9 +3476,9 @@ export class SecurityCenterClient { * Use a negated partial match on the empty string to filter based on a * property not existing: `-resource_properties.my_property : ""` * @param {string} request.groupBy - * Required. Expression that defines what assets fields to use for grouping. The string - * value should follow SQL syntax: comma separated list of fields. For - * example: + * Required. Expression that defines what assets fields to use for grouping. + * The string value should follow SQL syntax: comma separated list of fields. + * For example: * "security_center_properties.resource_project,security_center_properties.project". * * The following fields are supported when compare_duration is not set: @@ -3268,9 +3694,9 @@ export class SecurityCenterClient { * Use a negated partial match on the empty string to filter based on a * property not existing: `-resource_properties.my_property : ""` * @param {string} request.groupBy - * Required. Expression that defines what assets fields to use for grouping. The string - * value should follow SQL syntax: comma separated list of fields. For - * example: + * Required. Expression that defines what assets fields to use for grouping. + * The string value should follow SQL syntax: comma separated list of fields. + * For example: * "security_center_properties.resource_project,security_center_properties.project". * * The following fields are supported when compare_duration is not set: @@ -3434,9 +3860,9 @@ export class SecurityCenterClient { * Use a negated partial match on the empty string to filter based on a * property not existing: `-resource_properties.my_property : ""` * @param {string} request.groupBy - * Required. Expression that defines what assets fields to use for grouping. The string - * value should follow SQL syntax: comma separated list of fields. For - * example: + * Required. Expression that defines what assets fields to use for grouping. + * The string value should follow SQL syntax: comma separated list of fields. + * For example: * "security_center_properties.resource_project,security_center_properties.project". * * The following fields are supported when compare_duration is not set: @@ -3606,9 +4032,9 @@ export class SecurityCenterClient { * * resource.project_display_name: `=`, `:` * * resource.type: `=`, `:` * @param {string} request.groupBy - * Required. Expression that defines what assets fields to use for grouping (including - * `state_change`). The string value should follow SQL syntax: comma separated - * list of fields. For example: "parent,resource_name". + * Required. Expression that defines what assets fields to use for grouping + * (including `state_change`). The string value should follow SQL syntax: + * comma separated list of fields. For example: "parent,resource_name". * * The following fields are supported: * @@ -3827,9 +4253,9 @@ export class SecurityCenterClient { * * resource.project_display_name: `=`, `:` * * resource.type: `=`, `:` * @param {string} request.groupBy - * Required. Expression that defines what assets fields to use for grouping (including - * `state_change`). The string value should follow SQL syntax: comma separated - * list of fields. For example: "parent,resource_name". + * Required. Expression that defines what assets fields to use for grouping + * (including `state_change`). The string value should follow SQL syntax: + * comma separated list of fields. For example: "parent,resource_name". * * The following fields are supported: * @@ -3996,9 +4422,9 @@ export class SecurityCenterClient { * * resource.project_display_name: `=`, `:` * * resource.type: `=`, `:` * @param {string} request.groupBy - * Required. Expression that defines what assets fields to use for grouping (including - * `state_change`). The string value should follow SQL syntax: comma separated - * list of fields. For example: "parent,resource_name". + * Required. Expression that defines what assets fields to use for grouping + * (including `state_change`). The string value should follow SQL syntax: + * comma separated list of fields. For example: "parent,resource_name". * * The following fields are supported: * @@ -5236,8 +5662,8 @@ export class SecurityCenterClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. The parent, which owns the collection of mute configs. Its format is - * "organizations/[organization_id]", "folders/[folder_id]", + * Required. The parent, which owns the collection of mute configs. Its format + * is "organizations/[organization_id]", "folders/[folder_id]", * "projects/[project_id]". * @param {number} request.pageSize * The maximum number of configs to return. The service may return fewer than @@ -5343,8 +5769,8 @@ export class SecurityCenterClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. The parent, which owns the collection of mute configs. Its format is - * "organizations/[organization_id]", "folders/[folder_id]", + * Required. The parent, which owns the collection of mute configs. Its format + * is "organizations/[organization_id]", "folders/[folder_id]", * "projects/[project_id]". * @param {number} request.pageSize * The maximum number of configs to return. The service may return fewer than @@ -5398,8 +5824,8 @@ export class SecurityCenterClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. The parent, which owns the collection of mute configs. Its format is - * "organizations/[organization_id]", "folders/[folder_id]", + * Required. The parent, which owns the collection of mute configs. Its format + * is "organizations/[organization_id]", "folders/[folder_id]", * "projects/[project_id]". * @param {number} request.pageSize * The maximum number of configs to return. The service may return fewer than @@ -5657,8 +6083,8 @@ export class SecurityCenterClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. Resource name of the parent of sources to list. Its format should be - * "organizations/[organization_id], folders/[folder_id], or + * Required. Resource name of the parent of sources to list. Its format should + * be "organizations/[organization_id], folders/[folder_id], or * projects/[project_id]". * @param {string} request.pageToken * The value returned by the last `ListSourcesResponse`; indicates @@ -5760,8 +6186,8 @@ export class SecurityCenterClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. Resource name of the parent of sources to list. Its format should be - * "organizations/[organization_id], folders/[folder_id], or + * Required. Resource name of the parent of sources to list. Its format should + * be "organizations/[organization_id], folders/[folder_id], or * projects/[project_id]". * @param {string} request.pageToken * The value returned by the last `ListSourcesResponse`; indicates @@ -5811,8 +6237,8 @@ export class SecurityCenterClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. Resource name of the parent of sources to list. Its format should be - * "organizations/[organization_id], folders/[folder_id], or + * Required. Resource name of the parent of sources to list. Its format should + * be "organizations/[organization_id], folders/[folder_id], or * projects/[project_id]". * @param {string} request.pageToken * The value returned by the last `ListSourcesResponse`; indicates @@ -5855,6 +6281,223 @@ export class SecurityCenterClient { callSettings ) as AsyncIterable; } + /** + * Lists BigQuery exports. Note that when requesting BigQuery exports at a + * given level all exports under that level are also returned e.g. if + * requesting BigQuery exports under a folder, then all BigQuery exports + * immediately under the folder plus the ones created under the projects + * within the folder are returned. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns the collection of BigQuery exports. Its + * format is "organizations/[organization_id]", "folders/[folder_id]", + * "projects/[project_id]". + * @param {number} request.pageSize + * The maximum number of configs to return. The service may return fewer than + * this value. + * If unspecified, at most 10 configs will be returned. + * The maximum value is 1000; values above 1000 will be coerced to 1000. + * @param {string} request.pageToken + * A page token, received from a previous `ListBigQueryExports` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListBigQueryExports` + * must match the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [BigQueryExport]{@link google.cloud.securitycenter.v1.BigQueryExport}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listBigQueryExportsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listBigQueryExports( + request?: protos.google.cloud.securitycenter.v1.IListBigQueryExportsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.securitycenter.v1.IBigQueryExport[], + protos.google.cloud.securitycenter.v1.IListBigQueryExportsRequest | null, + protos.google.cloud.securitycenter.v1.IListBigQueryExportsResponse + ] + >; + listBigQueryExports( + request: protos.google.cloud.securitycenter.v1.IListBigQueryExportsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.securitycenter.v1.IListBigQueryExportsRequest, + | protos.google.cloud.securitycenter.v1.IListBigQueryExportsResponse + | null + | undefined, + protos.google.cloud.securitycenter.v1.IBigQueryExport + > + ): void; + listBigQueryExports( + request: protos.google.cloud.securitycenter.v1.IListBigQueryExportsRequest, + callback: PaginationCallback< + protos.google.cloud.securitycenter.v1.IListBigQueryExportsRequest, + | protos.google.cloud.securitycenter.v1.IListBigQueryExportsResponse + | null + | undefined, + protos.google.cloud.securitycenter.v1.IBigQueryExport + > + ): void; + listBigQueryExports( + request?: protos.google.cloud.securitycenter.v1.IListBigQueryExportsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.securitycenter.v1.IListBigQueryExportsRequest, + | protos.google.cloud.securitycenter.v1.IListBigQueryExportsResponse + | null + | undefined, + protos.google.cloud.securitycenter.v1.IBigQueryExport + >, + callback?: PaginationCallback< + protos.google.cloud.securitycenter.v1.IListBigQueryExportsRequest, + | protos.google.cloud.securitycenter.v1.IListBigQueryExportsResponse + | null + | undefined, + protos.google.cloud.securitycenter.v1.IBigQueryExport + > + ): Promise< + [ + protos.google.cloud.securitycenter.v1.IBigQueryExport[], + protos.google.cloud.securitycenter.v1.IListBigQueryExportsRequest | null, + protos.google.cloud.securitycenter.v1.IListBigQueryExportsResponse + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.listBigQueryExports(request, options, callback); + } + + /** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns the collection of BigQuery exports. Its + * format is "organizations/[organization_id]", "folders/[folder_id]", + * "projects/[project_id]". + * @param {number} request.pageSize + * The maximum number of configs to return. The service may return fewer than + * this value. + * If unspecified, at most 10 configs will be returned. + * The maximum value is 1000; values above 1000 will be coerced to 1000. + * @param {string} request.pageToken + * A page token, received from a previous `ListBigQueryExports` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListBigQueryExports` + * must match the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [BigQueryExport]{@link google.cloud.securitycenter.v1.BigQueryExport} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listBigQueryExportsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listBigQueryExportsStream( + request?: protos.google.cloud.securitycenter.v1.IListBigQueryExportsRequest, + options?: CallOptions + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + const defaultCallSettings = this._defaults['listBigQueryExports']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listBigQueryExports.createStream( + this.innerApiCalls.listBigQueryExports as gax.GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listBigQueryExports`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns the collection of BigQuery exports. Its + * format is "organizations/[organization_id]", "folders/[folder_id]", + * "projects/[project_id]". + * @param {number} request.pageSize + * The maximum number of configs to return. The service may return fewer than + * this value. + * If unspecified, at most 10 configs will be returned. + * The maximum value is 1000; values above 1000 will be coerced to 1000. + * @param {string} request.pageToken + * A page token, received from a previous `ListBigQueryExports` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListBigQueryExports` + * must match the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [BigQueryExport]{@link google.cloud.securitycenter.v1.BigQueryExport}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example include:samples/generated/v1/security_center.list_big_query_exports.js + * region_tag:securitycenter_v1_generated_SecurityCenter_ListBigQueryExports_async + */ + listBigQueryExportsAsync( + request?: protos.google.cloud.securitycenter.v1.IListBigQueryExportsRequest, + options?: CallOptions + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + const defaultCallSettings = this._defaults['listBigQueryExports']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listBigQueryExports.asyncIterate( + this.innerApiCalls['listBigQueryExports'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } // -------------------- // -- Path templates -- // -------------------- @@ -5941,6 +6584,44 @@ export class SecurityCenterClient { ).asset; } + /** + * Return a fully-qualified folderExport resource name string. + * + * @param {string} folder + * @param {string} exportParam + * @returns {string} Resource name string. + */ + folderExportPath(folder: string, exportParam: string) { + return this.pathTemplates.folderExportPathTemplate.render({ + folder: folder, + export: exportParam, + }); + } + + /** + * Parse the folder from FolderExport resource. + * + * @param {string} folderExportName + * A fully-qualified path representing folder_export resource. + * @returns {string} A string representing the folder. + */ + matchFolderFromFolderExportName(folderExportName: string) { + return this.pathTemplates.folderExportPathTemplate.match(folderExportName) + .folder; + } + + /** + * Parse the export from FolderExport resource. + * + * @param {string} folderExportName + * A fully-qualified path representing folder_export resource. + * @returns {string} A string representing the export. + */ + matchExportFromFolderExportName(folderExportName: string) { + return this.pathTemplates.folderExportPathTemplate.match(folderExportName) + .export; + } + /** * Return a fully-qualified folderMuteConfig resource name string. * @@ -6378,6 +7059,46 @@ export class SecurityCenterClient { ).asset; } + /** + * Return a fully-qualified organizationExport resource name string. + * + * @param {string} organization + * @param {string} exportParam + * @returns {string} Resource name string. + */ + organizationExportPath(organization: string, exportParam: string) { + return this.pathTemplates.organizationExportPathTemplate.render({ + organization: organization, + export: exportParam, + }); + } + + /** + * Parse the organization from OrganizationExport resource. + * + * @param {string} organizationExportName + * A fully-qualified path representing organization_export resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationExportName(organizationExportName: string) { + return this.pathTemplates.organizationExportPathTemplate.match( + organizationExportName + ).organization; + } + + /** + * Parse the export from OrganizationExport resource. + * + * @param {string} organizationExportName + * A fully-qualified path representing organization_export resource. + * @returns {string} A string representing the export. + */ + matchExportFromOrganizationExportName(organizationExportName: string) { + return this.pathTemplates.organizationExportPathTemplate.match( + organizationExportName + ).export; + } + /** * Return a fully-qualified organizationMuteConfig resource name string. * @@ -6788,6 +7509,44 @@ export class SecurityCenterClient { ).asset; } + /** + * Return a fully-qualified projectExport resource name string. + * + * @param {string} project + * @param {string} exportParam + * @returns {string} Resource name string. + */ + projectExportPath(project: string, exportParam: string) { + return this.pathTemplates.projectExportPathTemplate.render({ + project: project, + export: exportParam, + }); + } + + /** + * Parse the project from ProjectExport resource. + * + * @param {string} projectExportName + * A fully-qualified path representing project_export resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectExportName(projectExportName: string) { + return this.pathTemplates.projectExportPathTemplate.match(projectExportName) + .project; + } + + /** + * Parse the export from ProjectExport resource. + * + * @param {string} projectExportName + * A fully-qualified path representing project_export resource. + * @returns {string} A string representing the export. + */ + matchExportFromProjectExportName(projectExportName: string) { + return this.pathTemplates.projectExportPathTemplate.match(projectExportName) + .export; + } + /** * Return a fully-qualified projectMuteConfig resource name string. * diff --git a/packages/google-cloud-securitycenter/src/v1/security_center_client_config.json b/packages/google-cloud-securitycenter/src/v1/security_center_client_config.json index 54adba19c51..149e8338b1e 100644 --- a/packages/google-cloud-securitycenter/src/v1/security_center_client_config.json +++ b/packages/google-cloud-securitycenter/src/v1/security_center_client_config.json @@ -52,6 +52,10 @@ "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, + "GetBigQueryExport": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, "GetIamPolicy": { "timeout_millis": 60000, "retry_codes_name": "idempotent", @@ -166,6 +170,22 @@ "timeout_millis": 480000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" + }, + "CreateBigQueryExport": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteBigQueryExport": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateBigQueryExport": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListBigQueryExports": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" } } } diff --git a/packages/google-cloud-securitycenter/src/v1/security_center_proto_list.json b/packages/google-cloud-securitycenter/src/v1/security_center_proto_list.json index e7582711c8f..380ca1bb172 100644 --- a/packages/google-cloud-securitycenter/src/v1/security_center_proto_list.json +++ b/packages/google-cloud-securitycenter/src/v1/security_center_proto_list.json @@ -1,10 +1,12 @@ [ "../../protos/google/cloud/securitycenter/v1/access.proto", "../../protos/google/cloud/securitycenter/v1/asset.proto", + "../../protos/google/cloud/securitycenter/v1/bigquery_export.proto", "../../protos/google/cloud/securitycenter/v1/external_system.proto", "../../protos/google/cloud/securitycenter/v1/finding.proto", "../../protos/google/cloud/securitycenter/v1/folder.proto", "../../protos/google/cloud/securitycenter/v1/indicator.proto", + "../../protos/google/cloud/securitycenter/v1/mitre_attack.proto", "../../protos/google/cloud/securitycenter/v1/mute_config.proto", "../../protos/google/cloud/securitycenter/v1/notification_config.proto", "../../protos/google/cloud/securitycenter/v1/notification_message.proto", diff --git a/packages/google-cloud-securitycenter/test/gapic_security_center_v1.ts b/packages/google-cloud-securitycenter/test/gapic_security_center_v1.ts index 6f959226627..59b36d25bf6 100644 --- a/packages/google-cloud-securitycenter/test/gapic_security_center_v1.ts +++ b/packages/google-cloud-securitycenter/test/gapic_security_center_v1.ts @@ -362,7 +362,6 @@ describe('v1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1.CreateSourceRequest() ); request.parent = ''; - const expectedHeaderRequestParams = 'parent='; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.createSource(request), expectedError); @@ -489,7 +488,6 @@ describe('v1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1.CreateFindingRequest() ); request.parent = ''; - const expectedHeaderRequestParams = 'parent='; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.createFinding(request), expectedError); @@ -616,7 +614,6 @@ describe('v1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1.CreateMuteConfigRequest() ); request.parent = ''; - const expectedHeaderRequestParams = 'parent='; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.createMuteConfig(request), expectedError); @@ -747,7 +744,6 @@ describe('v1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1.CreateNotificationConfigRequest() ); request.parent = ''; - const expectedHeaderRequestParams = 'parent='; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects( @@ -877,7 +873,6 @@ describe('v1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1.DeleteMuteConfigRequest() ); request.name = ''; - const expectedHeaderRequestParams = 'name='; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.deleteMuteConfig(request), expectedError); @@ -1008,7 +1003,6 @@ describe('v1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1.DeleteNotificationConfigRequest() ); request.name = ''; - const expectedHeaderRequestParams = 'name='; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects( @@ -1018,6 +1012,132 @@ describe('v1.SecurityCenterClient', () => { }); }); + describe('getBigQueryExport', () => { + it('invokes getBigQueryExport without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GetBigQueryExportRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.BigQueryExport() + ); + client.innerApiCalls.getBigQueryExport = stubSimpleCall(expectedResponse); + const [response] = await client.getBigQueryExport(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getBigQueryExport as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes getBigQueryExport without error using callback', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GetBigQueryExportRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.BigQueryExport() + ); + client.innerApiCalls.getBigQueryExport = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getBigQueryExport( + request, + ( + err?: Error | null, + result?: protos.google.cloud.securitycenter.v1.IBigQueryExport | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getBigQueryExport as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes getBigQueryExport with error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GetBigQueryExportRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getBigQueryExport = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getBigQueryExport(request), expectedError); + assert( + (client.innerApiCalls.getBigQueryExport as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes getBigQueryExport with closed client', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GetBigQueryExportRequest() + ); + request.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getBigQueryExport(request), expectedError); + }); + }); + describe('getIamPolicy', () => { it('invokes getIamPolicy without error', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ @@ -1138,7 +1258,6 @@ describe('v1.SecurityCenterClient', () => { new protos.google.iam.v1.GetIamPolicyRequest() ); request.resource = ''; - const expectedHeaderRequestParams = 'resource='; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.getIamPolicy(request), expectedError); @@ -1265,7 +1384,6 @@ describe('v1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1.GetMuteConfigRequest() ); request.name = ''; - const expectedHeaderRequestParams = 'name='; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.getMuteConfig(request), expectedError); @@ -1396,7 +1514,6 @@ describe('v1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1.GetNotificationConfigRequest() ); request.name = ''; - const expectedHeaderRequestParams = 'name='; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects( @@ -1530,7 +1647,6 @@ describe('v1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1.GetOrganizationSettingsRequest() ); request.name = ''; - const expectedHeaderRequestParams = 'name='; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects( @@ -1657,7 +1773,6 @@ describe('v1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1.GetSourceRequest() ); request.name = ''; - const expectedHeaderRequestParams = 'name='; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.getSource(request), expectedError); @@ -1784,7 +1899,6 @@ describe('v1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1.SetFindingStateRequest() ); request.name = ''; - const expectedHeaderRequestParams = 'name='; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.setFindingState(request), expectedError); @@ -1908,7 +2022,6 @@ describe('v1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1.SetMuteRequest() ); request.name = ''; - const expectedHeaderRequestParams = 'name='; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.setMute(request), expectedError); @@ -2035,7 +2148,6 @@ describe('v1.SecurityCenterClient', () => { new protos.google.iam.v1.SetIamPolicyRequest() ); request.resource = ''; - const expectedHeaderRequestParams = 'resource='; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.setIamPolicy(request), expectedError); @@ -2163,7 +2275,6 @@ describe('v1.SecurityCenterClient', () => { new protos.google.iam.v1.TestIamPermissionsRequest() ); request.resource = ''; - const expectedHeaderRequestParams = 'resource='; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.testIamPermissions(request), expectedError); @@ -2295,7 +2406,6 @@ describe('v1.SecurityCenterClient', () => { ); request.externalSystem = {}; request.externalSystem.name = ''; - const expectedHeaderRequestParams = 'external_system.name='; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.updateExternalSystem(request), expectedError); @@ -2426,7 +2536,6 @@ describe('v1.SecurityCenterClient', () => { ); request.finding = {}; request.finding.name = ''; - const expectedHeaderRequestParams = 'finding.name='; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.updateFinding(request), expectedError); @@ -2557,7 +2666,6 @@ describe('v1.SecurityCenterClient', () => { ); request.muteConfig = {}; request.muteConfig.name = ''; - const expectedHeaderRequestParams = 'mute_config.name='; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.updateMuteConfig(request), expectedError); @@ -2692,7 +2800,6 @@ describe('v1.SecurityCenterClient', () => { ); request.notificationConfig = {}; request.notificationConfig.name = ''; - const expectedHeaderRequestParams = 'notification_config.name='; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects( @@ -2830,7 +2937,6 @@ describe('v1.SecurityCenterClient', () => { ); request.organizationSettings = {}; request.organizationSettings.name = ''; - const expectedHeaderRequestParams = 'organization_settings.name='; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects( @@ -2964,7 +3070,6 @@ describe('v1.SecurityCenterClient', () => { ); request.source = {}; request.source.name = ''; - const expectedHeaderRequestParams = 'source.name='; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.updateSource(request), expectedError); @@ -3096,22 +3201,21 @@ describe('v1.SecurityCenterClient', () => { ); request.securityMarks = {}; request.securityMarks.name = ''; - const expectedHeaderRequestParams = 'security_marks.name='; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.updateSecurityMarks(request), expectedError); }); }); - describe('bulkMuteFindings', () => { - it('invokes bulkMuteFindings without error', async () => { + describe('createBigQueryExport', () => { + it('invokes createBigQueryExport without error', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.BulkMuteFindingsRequest() + new protos.google.cloud.securitycenter.v1.CreateBigQueryExportRequest() ); request.parent = ''; const expectedHeaderRequestParams = 'parent='; @@ -3123,28 +3227,27 @@ describe('v1.SecurityCenterClient', () => { }, }; const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() + new protos.google.cloud.securitycenter.v1.BigQueryExport() ); - client.innerApiCalls.bulkMuteFindings = - stubLongRunningCall(expectedResponse); - const [operation] = await client.bulkMuteFindings(request); - const [response] = await operation.promise(); + client.innerApiCalls.createBigQueryExport = + stubSimpleCall(expectedResponse); + const [response] = await client.createBigQueryExport(request); assert.deepStrictEqual(response, expectedResponse); assert( - (client.innerApiCalls.bulkMuteFindings as SinonStub) + (client.innerApiCalls.createBigQueryExport as SinonStub) .getCall(0) .calledWith(request, expectedOptions, undefined) ); }); - it('invokes bulkMuteFindings without error using callback', async () => { + it('invokes createBigQueryExport without error using callback', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.BulkMuteFindingsRequest() + new protos.google.cloud.securitycenter.v1.CreateBigQueryExportRequest() ); request.parent = ''; const expectedHeaderRequestParams = 'parent='; @@ -3156,19 +3259,16 @@ describe('v1.SecurityCenterClient', () => { }, }; const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() + new protos.google.cloud.securitycenter.v1.BigQueryExport() ); - client.innerApiCalls.bulkMuteFindings = - stubLongRunningCallWithCallback(expectedResponse); + client.innerApiCalls.createBigQueryExport = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.bulkMuteFindings( + client.createBigQueryExport( request, ( err?: Error | null, - result?: LROperation< - protos.google.cloud.securitycenter.v1.IBulkMuteFindingsResponse, - protos.google.protobuf.IEmpty - > | null + result?: protos.google.cloud.securitycenter.v1.IBigQueryExport | null ) => { if (err) { reject(err); @@ -3178,27 +3278,23 @@ describe('v1.SecurityCenterClient', () => { } ); }); - const operation = (await promise) as LROperation< - protos.google.cloud.securitycenter.v1.IBulkMuteFindingsResponse, - protos.google.protobuf.IEmpty - >; - const [response] = await operation.promise(); + const response = await promise; assert.deepStrictEqual(response, expectedResponse); assert( - (client.innerApiCalls.bulkMuteFindings as SinonStub) + (client.innerApiCalls.createBigQueryExport as SinonStub) .getCall(0) .calledWith(request, expectedOptions /*, callback defined above */) ); }); - it('invokes bulkMuteFindings with call error', async () => { + it('invokes createBigQueryExport with error', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.BulkMuteFindingsRequest() + new protos.google.cloud.securitycenter.v1.CreateBigQueryExportRequest() ); request.parent = ''; const expectedHeaderRequestParams = 'parent='; @@ -3210,105 +3306,46 @@ describe('v1.SecurityCenterClient', () => { }, }; const expectedError = new Error('expected'); - client.innerApiCalls.bulkMuteFindings = stubLongRunningCall( + client.innerApiCalls.createBigQueryExport = stubSimpleCall( undefined, expectedError ); - await assert.rejects(client.bulkMuteFindings(request), expectedError); + await assert.rejects(client.createBigQueryExport(request), expectedError); assert( - (client.innerApiCalls.bulkMuteFindings as SinonStub) + (client.innerApiCalls.createBigQueryExport as SinonStub) .getCall(0) .calledWith(request, expectedOptions, undefined) ); }); - it('invokes bulkMuteFindings with LRO error', async () => { + it('invokes createBigQueryExport with closed client', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.BulkMuteFindingsRequest() + new protos.google.cloud.securitycenter.v1.CreateBigQueryExportRequest() ); request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.bulkMuteFindings = stubLongRunningCall( - undefined, - undefined, - expectedError - ); - const [operation] = await client.bulkMuteFindings(request); - await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.bulkMuteFindings as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); - }); - - it('invokes checkBulkMuteFindingsProgress without error', async () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkBulkMuteFindingsProgress( - expectedResponse.name - ); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkBulkMuteFindingsProgress with error', async () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall( - undefined, - expectedError - ); - await assert.rejects( - client.checkBulkMuteFindingsProgress(''), - expectedError - ); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createBigQueryExport(request), expectedError); }); }); - describe('runAssetDiscovery', () => { - it('invokes runAssetDiscovery without error', async () => { + describe('deleteBigQueryExport', () => { + it('invokes deleteBigQueryExport without error', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.RunAssetDiscoveryRequest() + new protos.google.cloud.securitycenter.v1.DeleteBigQueryExportRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + request.name = ''; + const expectedHeaderRequestParams = 'name='; const expectedOptions = { otherArgs: { headers: { @@ -3317,31 +3354,30 @@ describe('v1.SecurityCenterClient', () => { }, }; const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() + new protos.google.protobuf.Empty() ); - client.innerApiCalls.runAssetDiscovery = - stubLongRunningCall(expectedResponse); - const [operation] = await client.runAssetDiscovery(request); - const [response] = await operation.promise(); + client.innerApiCalls.deleteBigQueryExport = + stubSimpleCall(expectedResponse); + const [response] = await client.deleteBigQueryExport(request); assert.deepStrictEqual(response, expectedResponse); assert( - (client.innerApiCalls.runAssetDiscovery as SinonStub) + (client.innerApiCalls.deleteBigQueryExport as SinonStub) .getCall(0) .calledWith(request, expectedOptions, undefined) ); }); - it('invokes runAssetDiscovery without error using callback', async () => { + it('invokes deleteBigQueryExport without error using callback', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.RunAssetDiscoveryRequest() + new protos.google.cloud.securitycenter.v1.DeleteBigQueryExportRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + request.name = ''; + const expectedHeaderRequestParams = 'name='; const expectedOptions = { otherArgs: { headers: { @@ -3350,19 +3386,677 @@ describe('v1.SecurityCenterClient', () => { }, }; const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() + new protos.google.protobuf.Empty() ); - client.innerApiCalls.runAssetDiscovery = - stubLongRunningCallWithCallback(expectedResponse); + client.innerApiCalls.deleteBigQueryExport = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.runAssetDiscovery( + client.deleteBigQueryExport( request, ( err?: Error | null, - result?: LROperation< - protos.google.cloud.securitycenter.v1.IRunAssetDiscoveryResponse, - protos.google.protobuf.IEmpty - > | null + result?: protos.google.protobuf.IEmpty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.deleteBigQueryExport as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes deleteBigQueryExport with error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.DeleteBigQueryExportRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteBigQueryExport = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.deleteBigQueryExport(request), expectedError); + assert( + (client.innerApiCalls.deleteBigQueryExport as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes deleteBigQueryExport with closed client', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.DeleteBigQueryExportRequest() + ); + request.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.deleteBigQueryExport(request), expectedError); + }); + }); + + describe('updateBigQueryExport', () => { + it('invokes updateBigQueryExport without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.UpdateBigQueryExportRequest() + ); + request.bigQueryExport = {}; + request.bigQueryExport.name = ''; + const expectedHeaderRequestParams = 'big_query_export.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.BigQueryExport() + ); + client.innerApiCalls.updateBigQueryExport = + stubSimpleCall(expectedResponse); + const [response] = await client.updateBigQueryExport(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.updateBigQueryExport as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes updateBigQueryExport without error using callback', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.UpdateBigQueryExportRequest() + ); + request.bigQueryExport = {}; + request.bigQueryExport.name = ''; + const expectedHeaderRequestParams = 'big_query_export.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.BigQueryExport() + ); + client.innerApiCalls.updateBigQueryExport = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateBigQueryExport( + request, + ( + err?: Error | null, + result?: protos.google.cloud.securitycenter.v1.IBigQueryExport | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.updateBigQueryExport as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes updateBigQueryExport with error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.UpdateBigQueryExportRequest() + ); + request.bigQueryExport = {}; + request.bigQueryExport.name = ''; + const expectedHeaderRequestParams = 'big_query_export.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.updateBigQueryExport = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.updateBigQueryExport(request), expectedError); + assert( + (client.innerApiCalls.updateBigQueryExport as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes updateBigQueryExport with closed client', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.UpdateBigQueryExportRequest() + ); + request.bigQueryExport = {}; + request.bigQueryExport.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateBigQueryExport(request), expectedError); + }); + }); + + describe('bulkMuteFindings', () => { + it('invokes bulkMuteFindings without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.BulkMuteFindingsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.bulkMuteFindings = + stubLongRunningCall(expectedResponse); + const [operation] = await client.bulkMuteFindings(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.bulkMuteFindings as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes bulkMuteFindings without error using callback', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.BulkMuteFindingsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.bulkMuteFindings = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.bulkMuteFindings( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.securitycenter.v1.IBulkMuteFindingsResponse, + protos.google.protobuf.IEmpty + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.securitycenter.v1.IBulkMuteFindingsResponse, + protos.google.protobuf.IEmpty + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.bulkMuteFindings as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes bulkMuteFindings with call error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.BulkMuteFindingsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.bulkMuteFindings = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.bulkMuteFindings(request), expectedError); + assert( + (client.innerApiCalls.bulkMuteFindings as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes bulkMuteFindings with LRO error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.BulkMuteFindingsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.bulkMuteFindings = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.bulkMuteFindings(request); + await assert.rejects(operation.promise(), expectedError); + assert( + (client.innerApiCalls.bulkMuteFindings as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes checkBulkMuteFindingsProgress without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkBulkMuteFindingsProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkBulkMuteFindingsProgress with error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.checkBulkMuteFindingsProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('runAssetDiscovery', () => { + it('invokes runAssetDiscovery without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.RunAssetDiscoveryRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.runAssetDiscovery = + stubLongRunningCall(expectedResponse); + const [operation] = await client.runAssetDiscovery(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.runAssetDiscovery as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes runAssetDiscovery without error using callback', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.RunAssetDiscoveryRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.runAssetDiscovery = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.runAssetDiscovery( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.securitycenter.v1.IRunAssetDiscoveryResponse, + protos.google.protobuf.IEmpty + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.securitycenter.v1.IRunAssetDiscoveryResponse, + protos.google.protobuf.IEmpty + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.runAssetDiscovery as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes runAssetDiscovery with call error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.RunAssetDiscoveryRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.runAssetDiscovery = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.runAssetDiscovery(request), expectedError); + assert( + (client.innerApiCalls.runAssetDiscovery as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes runAssetDiscovery with LRO error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.RunAssetDiscoveryRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.runAssetDiscovery = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.runAssetDiscovery(request); + await assert.rejects(operation.promise(), expectedError); + assert( + (client.innerApiCalls.runAssetDiscovery as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes checkRunAssetDiscoveryProgress without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkRunAssetDiscoveryProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkRunAssetDiscoveryProgress with error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.checkRunAssetDiscoveryProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('groupAssets', () => { + it('invokes groupAssets without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GroupAssetsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GroupResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GroupResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GroupResult() + ), + ]; + client.innerApiCalls.groupAssets = stubSimpleCall(expectedResponse); + const [response] = await client.groupAssets(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.groupAssets as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes groupAssets without error using callback', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GroupAssetsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GroupResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GroupResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GroupResult() + ), + ]; + client.innerApiCalls.groupAssets = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.groupAssets( + request, + ( + err?: Error | null, + result?: protos.google.cloud.securitycenter.v1.IGroupResult[] | null ) => { if (err) { reject(err); @@ -3372,134 +4066,242 @@ describe('v1.SecurityCenterClient', () => { } ); }); - const operation = (await promise) as LROperation< - protos.google.cloud.securitycenter.v1.IRunAssetDiscoveryResponse, - protos.google.protobuf.IEmpty - >; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.groupAssets as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes groupAssets with error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GroupAssetsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.groupAssets = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.groupAssets(request), expectedError); + assert( + (client.innerApiCalls.groupAssets as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes groupAssetsStream without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GroupAssetsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GroupResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GroupResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GroupResult() + ), + ]; + client.descriptors.page.groupAssets.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.groupAssetsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.securitycenter.v1.GroupResult[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.securitycenter.v1.GroupResult) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); assert( - (client.innerApiCalls.runAssetDiscovery as SinonStub) + (client.descriptors.page.groupAssets.createStream as SinonStub) .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) + .calledWith(client.innerApiCalls.groupAssets, request) + ); + assert.strictEqual( + (client.descriptors.page.groupAssets.createStream as SinonStub).getCall( + 0 + ).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams ); }); - it('invokes runAssetDiscovery with call error', async () => { + it('invokes groupAssetsStream with error', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.RunAssetDiscoveryRequest() + new protos.google.cloud.securitycenter.v1.GroupAssetsRequest() ); request.parent = ''; const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; const expectedError = new Error('expected'); - client.innerApiCalls.runAssetDiscovery = stubLongRunningCall( + client.descriptors.page.groupAssets.createStream = stubPageStreamingCall( undefined, expectedError ); - await assert.rejects(client.runAssetDiscovery(request), expectedError); + const stream = client.groupAssetsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.securitycenter.v1.GroupResult[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.securitycenter.v1.GroupResult) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); assert( - (client.innerApiCalls.runAssetDiscovery as SinonStub) + (client.descriptors.page.groupAssets.createStream as SinonStub) .getCall(0) - .calledWith(request, expectedOptions, undefined) + .calledWith(client.innerApiCalls.groupAssets, request) + ); + assert.strictEqual( + (client.descriptors.page.groupAssets.createStream as SinonStub).getCall( + 0 + ).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams ); }); - it('invokes runAssetDiscovery with LRO error', async () => { + it('uses async iteration with groupAssets without error', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.RunAssetDiscoveryRequest() + new protos.google.cloud.securitycenter.v1.GroupAssetsRequest() ); request.parent = ''; const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.runAssetDiscovery = stubLongRunningCall( - undefined, - undefined, - expectedError + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GroupResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GroupResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GroupResult() + ), + ]; + client.descriptors.page.groupAssets.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.securitycenter.v1.IGroupResult[] = + []; + const iterable = client.groupAssetsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.groupAssets.asyncIterate as SinonStub).getCall( + 0 + ).args[1], + request ); - const [operation] = await client.runAssetDiscovery(request); - await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.runAssetDiscovery as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) + assert.strictEqual( + (client.descriptors.page.groupAssets.asyncIterate as SinonStub).getCall( + 0 + ).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams ); }); - it('invokes checkRunAssetDiscoveryProgress without error', async () => { + it('uses async iteration with groupAssets with error', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkRunAssetDiscoveryProgress( - expectedResponse.name + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GroupAssetsRequest() ); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkRunAssetDiscoveryProgress with error', async () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall( + client.descriptors.page.groupAssets.asyncIterate = stubAsyncIterationCall( undefined, expectedError ); - await assert.rejects( - client.checkRunAssetDiscoveryProgress(''), - expectedError + const iterable = client.groupAssetsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.securitycenter.v1.IGroupResult[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.groupAssets.asyncIterate as SinonStub).getCall( + 0 + ).args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.groupAssets.asyncIterate as SinonStub).getCall( + 0 + ).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams ); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); }); }); - describe('groupAssets', () => { - it('invokes groupAssets without error', async () => { + describe('groupFindings', () => { + it('invokes groupFindings without error', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.GroupAssetsRequest() + new protos.google.cloud.securitycenter.v1.GroupFindingsRequest() ); request.parent = ''; const expectedHeaderRequestParams = 'parent='; @@ -3521,24 +4323,24 @@ describe('v1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1.GroupResult() ), ]; - client.innerApiCalls.groupAssets = stubSimpleCall(expectedResponse); - const [response] = await client.groupAssets(request); + client.innerApiCalls.groupFindings = stubSimpleCall(expectedResponse); + const [response] = await client.groupFindings(request); assert.deepStrictEqual(response, expectedResponse); assert( - (client.innerApiCalls.groupAssets as SinonStub) + (client.innerApiCalls.groupFindings as SinonStub) .getCall(0) .calledWith(request, expectedOptions, undefined) ); }); - it('invokes groupAssets without error using callback', async () => { + it('invokes groupFindings without error using callback', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.GroupAssetsRequest() + new protos.google.cloud.securitycenter.v1.GroupFindingsRequest() ); request.parent = ''; const expectedHeaderRequestParams = 'parent='; @@ -3560,10 +4362,10 @@ describe('v1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1.GroupResult() ), ]; - client.innerApiCalls.groupAssets = + client.innerApiCalls.groupFindings = stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.groupAssets( + client.groupFindings( request, ( err?: Error | null, @@ -3580,20 +4382,20 @@ describe('v1.SecurityCenterClient', () => { const response = await promise; assert.deepStrictEqual(response, expectedResponse); assert( - (client.innerApiCalls.groupAssets as SinonStub) + (client.innerApiCalls.groupFindings as SinonStub) .getCall(0) .calledWith(request, expectedOptions /*, callback defined above */) ); }); - it('invokes groupAssets with error', async () => { + it('invokes groupFindings with error', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.GroupAssetsRequest() + new protos.google.cloud.securitycenter.v1.GroupFindingsRequest() ); request.parent = ''; const expectedHeaderRequestParams = 'parent='; @@ -3605,26 +4407,26 @@ describe('v1.SecurityCenterClient', () => { }, }; const expectedError = new Error('expected'); - client.innerApiCalls.groupAssets = stubSimpleCall( + client.innerApiCalls.groupFindings = stubSimpleCall( undefined, expectedError ); - await assert.rejects(client.groupAssets(request), expectedError); + await assert.rejects(client.groupFindings(request), expectedError); assert( - (client.innerApiCalls.groupAssets as SinonStub) + (client.innerApiCalls.groupFindings as SinonStub) .getCall(0) .calledWith(request, expectedOptions, undefined) ); }); - it('invokes groupAssetsStream without error', async () => { + it('invokes groupFindingsStream without error', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.GroupAssetsRequest() + new protos.google.cloud.securitycenter.v1.GroupFindingsRequest() ); request.parent = ''; const expectedHeaderRequestParams = 'parent='; @@ -3639,9 +4441,9 @@ describe('v1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1.GroupResult() ), ]; - client.descriptors.page.groupAssets.createStream = + client.descriptors.page.groupFindings.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.groupAssetsStream(request); + const stream = client.groupFindingsStream(request); const promise = new Promise((resolve, reject) => { const responses: protos.google.cloud.securitycenter.v1.GroupResult[] = []; @@ -3661,35 +4463,33 @@ describe('v1.SecurityCenterClient', () => { const responses = await promise; assert.deepStrictEqual(responses, expectedResponse); assert( - (client.descriptors.page.groupAssets.createStream as SinonStub) + (client.descriptors.page.groupFindings.createStream as SinonStub) .getCall(0) - .calledWith(client.innerApiCalls.groupAssets, request) + .calledWith(client.innerApiCalls.groupFindings, request) ); assert.strictEqual( - (client.descriptors.page.groupAssets.createStream as SinonStub).getCall( - 0 - ).args[2].otherArgs.headers['x-goog-request-params'], + ( + client.descriptors.page.groupFindings.createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); - it('invokes groupAssetsStream with error', async () => { + it('invokes groupFindingsStream with error', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.GroupAssetsRequest() + new protos.google.cloud.securitycenter.v1.GroupFindingsRequest() ); request.parent = ''; const expectedHeaderRequestParams = 'parent='; const expectedError = new Error('expected'); - client.descriptors.page.groupAssets.createStream = stubPageStreamingCall( - undefined, - expectedError - ); - const stream = client.groupAssetsStream(request); + client.descriptors.page.groupFindings.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.groupFindingsStream(request); const promise = new Promise((resolve, reject) => { const responses: protos.google.cloud.securitycenter.v1.GroupResult[] = []; @@ -3708,26 +4508,26 @@ describe('v1.SecurityCenterClient', () => { }); await assert.rejects(promise, expectedError); assert( - (client.descriptors.page.groupAssets.createStream as SinonStub) + (client.descriptors.page.groupFindings.createStream as SinonStub) .getCall(0) - .calledWith(client.innerApiCalls.groupAssets, request) + .calledWith(client.innerApiCalls.groupFindings, request) ); assert.strictEqual( - (client.descriptors.page.groupAssets.createStream as SinonStub).getCall( - 0 - ).args[2].otherArgs.headers['x-goog-request-params'], + ( + client.descriptors.page.groupFindings.createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); - it('uses async iteration with groupAssets without error', async () => { + it('uses async iteration with groupFindings without error', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.GroupAssetsRequest() + new protos.google.cloud.securitycenter.v1.GroupFindingsRequest() ); request.parent = ''; const expectedHeaderRequestParams = 'parent='; @@ -3742,46 +4542,44 @@ describe('v1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1.GroupResult() ), ]; - client.descriptors.page.groupAssets.asyncIterate = + client.descriptors.page.groupFindings.asyncIterate = stubAsyncIterationCall(expectedResponse); const responses: protos.google.cloud.securitycenter.v1.IGroupResult[] = []; - const iterable = client.groupAssetsAsync(request); + const iterable = client.groupFindingsAsync(request); for await (const resource of iterable) { responses.push(resource!); } assert.deepStrictEqual(responses, expectedResponse); assert.deepStrictEqual( - (client.descriptors.page.groupAssets.asyncIterate as SinonStub).getCall( - 0 - ).args[1], + ( + client.descriptors.page.groupFindings.asyncIterate as SinonStub + ).getCall(0).args[1], request ); assert.strictEqual( - (client.descriptors.page.groupAssets.asyncIterate as SinonStub).getCall( - 0 - ).args[2].otherArgs.headers['x-goog-request-params'], + ( + client.descriptors.page.groupFindings.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); - it('uses async iteration with groupAssets with error', async () => { + it('uses async iteration with groupFindings with error', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.GroupAssetsRequest() + new protos.google.cloud.securitycenter.v1.GroupFindingsRequest() ); request.parent = ''; const expectedHeaderRequestParams = 'parent='; const expectedError = new Error('expected'); - client.descriptors.page.groupAssets.asyncIterate = stubAsyncIterationCall( - undefined, - expectedError - ); - const iterable = client.groupAssetsAsync(request); + client.descriptors.page.groupFindings.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.groupFindingsAsync(request); await assert.rejects(async () => { const responses: protos.google.cloud.securitycenter.v1.IGroupResult[] = []; @@ -3790,29 +4588,29 @@ describe('v1.SecurityCenterClient', () => { } }); assert.deepStrictEqual( - (client.descriptors.page.groupAssets.asyncIterate as SinonStub).getCall( - 0 - ).args[1], + ( + client.descriptors.page.groupFindings.asyncIterate as SinonStub + ).getCall(0).args[1], request ); assert.strictEqual( - (client.descriptors.page.groupAssets.asyncIterate as SinonStub).getCall( - 0 - ).args[2].otherArgs.headers['x-goog-request-params'], + ( + client.descriptors.page.groupFindings.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); }); - describe('groupFindings', () => { - it('invokes groupFindings without error', async () => { + describe('listAssets', () => { + it('invokes listAssets without error', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.GroupFindingsRequest() + new protos.google.cloud.securitycenter.v1.ListAssetsRequest() ); request.parent = ''; const expectedHeaderRequestParams = 'parent='; @@ -3825,33 +4623,33 @@ describe('v1.SecurityCenterClient', () => { }; const expectedResponse = [ generateSampleMessage( - new protos.google.cloud.securitycenter.v1.GroupResult() + new protos.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult() ), generateSampleMessage( - new protos.google.cloud.securitycenter.v1.GroupResult() + new protos.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult() ), generateSampleMessage( - new protos.google.cloud.securitycenter.v1.GroupResult() + new protos.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult() ), ]; - client.innerApiCalls.groupFindings = stubSimpleCall(expectedResponse); - const [response] = await client.groupFindings(request); + client.innerApiCalls.listAssets = stubSimpleCall(expectedResponse); + const [response] = await client.listAssets(request); assert.deepStrictEqual(response, expectedResponse); assert( - (client.innerApiCalls.groupFindings as SinonStub) + (client.innerApiCalls.listAssets as SinonStub) .getCall(0) .calledWith(request, expectedOptions, undefined) ); }); - it('invokes groupFindings without error using callback', async () => { + it('invokes listAssets without error using callback', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.GroupFindingsRequest() + new protos.google.cloud.securitycenter.v1.ListAssetsRequest() ); request.parent = ''; const expectedHeaderRequestParams = 'parent='; @@ -3864,23 +4662,25 @@ describe('v1.SecurityCenterClient', () => { }; const expectedResponse = [ generateSampleMessage( - new protos.google.cloud.securitycenter.v1.GroupResult() + new protos.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult() ), generateSampleMessage( - new protos.google.cloud.securitycenter.v1.GroupResult() + new protos.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult() ), generateSampleMessage( - new protos.google.cloud.securitycenter.v1.GroupResult() + new protos.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult() ), ]; - client.innerApiCalls.groupFindings = + client.innerApiCalls.listAssets = stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.groupFindings( + client.listAssets( request, ( err?: Error | null, - result?: protos.google.cloud.securitycenter.v1.IGroupResult[] | null + result?: + | protos.google.cloud.securitycenter.v1.ListAssetsResponse.IListAssetsResult[] + | null ) => { if (err) { reject(err); @@ -3893,20 +4693,20 @@ describe('v1.SecurityCenterClient', () => { const response = await promise; assert.deepStrictEqual(response, expectedResponse); assert( - (client.innerApiCalls.groupFindings as SinonStub) + (client.innerApiCalls.listAssets as SinonStub) .getCall(0) .calledWith(request, expectedOptions /*, callback defined above */) ); }); - it('invokes groupFindings with error', async () => { + it('invokes listAssets with error', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.GroupFindingsRequest() + new protos.google.cloud.securitycenter.v1.ListAssetsRequest() ); request.parent = ''; const expectedHeaderRequestParams = 'parent='; @@ -3918,49 +4718,51 @@ describe('v1.SecurityCenterClient', () => { }, }; const expectedError = new Error('expected'); - client.innerApiCalls.groupFindings = stubSimpleCall( + client.innerApiCalls.listAssets = stubSimpleCall( undefined, expectedError ); - await assert.rejects(client.groupFindings(request), expectedError); + await assert.rejects(client.listAssets(request), expectedError); assert( - (client.innerApiCalls.groupFindings as SinonStub) + (client.innerApiCalls.listAssets as SinonStub) .getCall(0) .calledWith(request, expectedOptions, undefined) ); }); - it('invokes groupFindingsStream without error', async () => { + it('invokes listAssetsStream without error', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.GroupFindingsRequest() + new protos.google.cloud.securitycenter.v1.ListAssetsRequest() ); request.parent = ''; const expectedHeaderRequestParams = 'parent='; const expectedResponse = [ generateSampleMessage( - new protos.google.cloud.securitycenter.v1.GroupResult() + new protos.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult() ), generateSampleMessage( - new protos.google.cloud.securitycenter.v1.GroupResult() + new protos.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult() ), generateSampleMessage( - new protos.google.cloud.securitycenter.v1.GroupResult() + new protos.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult() ), ]; - client.descriptors.page.groupFindings.createStream = + client.descriptors.page.listAssets.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.groupFindingsStream(request); + const stream = client.listAssetsStream(request); const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.securitycenter.v1.GroupResult[] = + const responses: protos.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult[] = []; stream.on( 'data', - (response: protos.google.cloud.securitycenter.v1.GroupResult) => { + ( + response: protos.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult + ) => { responses.push(response); } ); @@ -3974,39 +4776,43 @@ describe('v1.SecurityCenterClient', () => { const responses = await promise; assert.deepStrictEqual(responses, expectedResponse); assert( - (client.descriptors.page.groupFindings.createStream as SinonStub) + (client.descriptors.page.listAssets.createStream as SinonStub) .getCall(0) - .calledWith(client.innerApiCalls.groupFindings, request) + .calledWith(client.innerApiCalls.listAssets, request) ); assert.strictEqual( - ( - client.descriptors.page.groupFindings.createStream as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + (client.descriptors.page.listAssets.createStream as SinonStub).getCall( + 0 + ).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); - it('invokes groupFindingsStream with error', async () => { + it('invokes listAssetsStream with error', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.GroupFindingsRequest() + new protos.google.cloud.securitycenter.v1.ListAssetsRequest() ); request.parent = ''; const expectedHeaderRequestParams = 'parent='; const expectedError = new Error('expected'); - client.descriptors.page.groupFindings.createStream = - stubPageStreamingCall(undefined, expectedError); - const stream = client.groupFindingsStream(request); + client.descriptors.page.listAssets.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listAssetsStream(request); const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.securitycenter.v1.GroupResult[] = + const responses: protos.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult[] = []; stream.on( 'data', - (response: protos.google.cloud.securitycenter.v1.GroupResult) => { + ( + response: protos.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult + ) => { responses.push(response); } ); @@ -4019,109 +4825,111 @@ describe('v1.SecurityCenterClient', () => { }); await assert.rejects(promise, expectedError); assert( - (client.descriptors.page.groupFindings.createStream as SinonStub) + (client.descriptors.page.listAssets.createStream as SinonStub) .getCall(0) - .calledWith(client.innerApiCalls.groupFindings, request) + .calledWith(client.innerApiCalls.listAssets, request) ); assert.strictEqual( - ( - client.descriptors.page.groupFindings.createStream as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + (client.descriptors.page.listAssets.createStream as SinonStub).getCall( + 0 + ).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); - it('uses async iteration with groupFindings without error', async () => { + it('uses async iteration with listAssets without error', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.GroupFindingsRequest() + new protos.google.cloud.securitycenter.v1.ListAssetsRequest() ); request.parent = ''; const expectedHeaderRequestParams = 'parent='; const expectedResponse = [ generateSampleMessage( - new protos.google.cloud.securitycenter.v1.GroupResult() + new protos.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult() ), generateSampleMessage( - new protos.google.cloud.securitycenter.v1.GroupResult() + new protos.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult() ), generateSampleMessage( - new protos.google.cloud.securitycenter.v1.GroupResult() + new protos.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult() ), ]; - client.descriptors.page.groupFindings.asyncIterate = + client.descriptors.page.listAssets.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.securitycenter.v1.IGroupResult[] = + const responses: protos.google.cloud.securitycenter.v1.ListAssetsResponse.IListAssetsResult[] = []; - const iterable = client.groupFindingsAsync(request); + const iterable = client.listAssetsAsync(request); for await (const resource of iterable) { responses.push(resource!); } assert.deepStrictEqual(responses, expectedResponse); assert.deepStrictEqual( - ( - client.descriptors.page.groupFindings.asyncIterate as SinonStub - ).getCall(0).args[1], + (client.descriptors.page.listAssets.asyncIterate as SinonStub).getCall( + 0 + ).args[1], request ); assert.strictEqual( - ( - client.descriptors.page.groupFindings.asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + (client.descriptors.page.listAssets.asyncIterate as SinonStub).getCall( + 0 + ).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); - it('uses async iteration with groupFindings with error', async () => { + it('uses async iteration with listAssets with error', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.GroupFindingsRequest() + new protos.google.cloud.securitycenter.v1.ListAssetsRequest() ); request.parent = ''; const expectedHeaderRequestParams = 'parent='; const expectedError = new Error('expected'); - client.descriptors.page.groupFindings.asyncIterate = - stubAsyncIterationCall(undefined, expectedError); - const iterable = client.groupFindingsAsync(request); + client.descriptors.page.listAssets.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listAssetsAsync(request); await assert.rejects(async () => { - const responses: protos.google.cloud.securitycenter.v1.IGroupResult[] = + const responses: protos.google.cloud.securitycenter.v1.ListAssetsResponse.IListAssetsResult[] = []; for await (const resource of iterable) { responses.push(resource!); } }); assert.deepStrictEqual( - ( - client.descriptors.page.groupFindings.asyncIterate as SinonStub - ).getCall(0).args[1], + (client.descriptors.page.listAssets.asyncIterate as SinonStub).getCall( + 0 + ).args[1], request ); assert.strictEqual( - ( - client.descriptors.page.groupFindings.asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + (client.descriptors.page.listAssets.asyncIterate as SinonStub).getCall( + 0 + ).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); }); - describe('listAssets', () => { - it('invokes listAssets without error', async () => { + describe('listFindings', () => { + it('invokes listFindings without error', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListAssetsRequest() + new protos.google.cloud.securitycenter.v1.ListFindingsRequest() ); request.parent = ''; const expectedHeaderRequestParams = 'parent='; @@ -4134,33 +4942,33 @@ describe('v1.SecurityCenterClient', () => { }; const expectedResponse = [ generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult() + new protos.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult() ), generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult() + new protos.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult() ), generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult() + new protos.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult() ), ]; - client.innerApiCalls.listAssets = stubSimpleCall(expectedResponse); - const [response] = await client.listAssets(request); + client.innerApiCalls.listFindings = stubSimpleCall(expectedResponse); + const [response] = await client.listFindings(request); assert.deepStrictEqual(response, expectedResponse); assert( - (client.innerApiCalls.listAssets as SinonStub) + (client.innerApiCalls.listFindings as SinonStub) .getCall(0) .calledWith(request, expectedOptions, undefined) ); }); - it('invokes listAssets without error using callback', async () => { + it('invokes listFindings without error using callback', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListAssetsRequest() + new protos.google.cloud.securitycenter.v1.ListFindingsRequest() ); request.parent = ''; const expectedHeaderRequestParams = 'parent='; @@ -4173,24 +4981,24 @@ describe('v1.SecurityCenterClient', () => { }; const expectedResponse = [ generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult() + new protos.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult() ), generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult() + new protos.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult() ), generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult() + new protos.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult() ), ]; - client.innerApiCalls.listAssets = + client.innerApiCalls.listFindings = stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.listAssets( + client.listFindings( request, ( err?: Error | null, result?: - | protos.google.cloud.securitycenter.v1.ListAssetsResponse.IListAssetsResult[] + | protos.google.cloud.securitycenter.v1.ListFindingsResponse.IListFindingsResult[] | null ) => { if (err) { @@ -4204,20 +5012,20 @@ describe('v1.SecurityCenterClient', () => { const response = await promise; assert.deepStrictEqual(response, expectedResponse); assert( - (client.innerApiCalls.listAssets as SinonStub) + (client.innerApiCalls.listFindings as SinonStub) .getCall(0) .calledWith(request, expectedOptions /*, callback defined above */) ); }); - it('invokes listAssets with error', async () => { + it('invokes listFindings with error', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListAssetsRequest() + new protos.google.cloud.securitycenter.v1.ListFindingsRequest() ); request.parent = ''; const expectedHeaderRequestParams = 'parent='; @@ -4229,50 +5037,50 @@ describe('v1.SecurityCenterClient', () => { }, }; const expectedError = new Error('expected'); - client.innerApiCalls.listAssets = stubSimpleCall( + client.innerApiCalls.listFindings = stubSimpleCall( undefined, expectedError ); - await assert.rejects(client.listAssets(request), expectedError); + await assert.rejects(client.listFindings(request), expectedError); assert( - (client.innerApiCalls.listAssets as SinonStub) + (client.innerApiCalls.listFindings as SinonStub) .getCall(0) .calledWith(request, expectedOptions, undefined) ); }); - it('invokes listAssetsStream without error', async () => { + it('invokes listFindingsStream without error', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListAssetsRequest() + new protos.google.cloud.securitycenter.v1.ListFindingsRequest() ); request.parent = ''; const expectedHeaderRequestParams = 'parent='; const expectedResponse = [ generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult() + new protos.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult() ), generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult() + new protos.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult() ), generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult() + new protos.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult() ), ]; - client.descriptors.page.listAssets.createStream = + client.descriptors.page.listFindings.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listAssetsStream(request); + const stream = client.listFindingsStream(request); const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult[] = + const responses: protos.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult[] = []; stream.on( 'data', ( - response: protos.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult + response: protos.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult ) => { responses.push(response); } @@ -4287,42 +5095,42 @@ describe('v1.SecurityCenterClient', () => { const responses = await promise; assert.deepStrictEqual(responses, expectedResponse); assert( - (client.descriptors.page.listAssets.createStream as SinonStub) + (client.descriptors.page.listFindings.createStream as SinonStub) .getCall(0) - .calledWith(client.innerApiCalls.listAssets, request) + .calledWith(client.innerApiCalls.listFindings, request) ); assert.strictEqual( - (client.descriptors.page.listAssets.createStream as SinonStub).getCall( - 0 - ).args[2].otherArgs.headers['x-goog-request-params'], + ( + client.descriptors.page.listFindings.createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); - it('invokes listAssetsStream with error', async () => { + it('invokes listFindingsStream with error', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListAssetsRequest() + new protos.google.cloud.securitycenter.v1.ListFindingsRequest() ); request.parent = ''; const expectedHeaderRequestParams = 'parent='; const expectedError = new Error('expected'); - client.descriptors.page.listAssets.createStream = stubPageStreamingCall( + client.descriptors.page.listFindings.createStream = stubPageStreamingCall( undefined, expectedError ); - const stream = client.listAssetsStream(request); + const stream = client.listFindingsStream(request); const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult[] = + const responses: protos.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult[] = []; stream.on( 'data', ( - response: protos.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult + response: protos.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult ) => { responses.push(response); } @@ -4336,111 +5144,109 @@ describe('v1.SecurityCenterClient', () => { }); await assert.rejects(promise, expectedError); assert( - (client.descriptors.page.listAssets.createStream as SinonStub) + (client.descriptors.page.listFindings.createStream as SinonStub) .getCall(0) - .calledWith(client.innerApiCalls.listAssets, request) + .calledWith(client.innerApiCalls.listFindings, request) ); assert.strictEqual( - (client.descriptors.page.listAssets.createStream as SinonStub).getCall( - 0 - ).args[2].otherArgs.headers['x-goog-request-params'], + ( + client.descriptors.page.listFindings.createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); - it('uses async iteration with listAssets without error', async () => { + it('uses async iteration with listFindings without error', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListAssetsRequest() + new protos.google.cloud.securitycenter.v1.ListFindingsRequest() ); request.parent = ''; const expectedHeaderRequestParams = 'parent='; const expectedResponse = [ generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult() + new protos.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult() ), generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult() + new protos.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult() ), generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult() + new protos.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult() ), ]; - client.descriptors.page.listAssets.asyncIterate = + client.descriptors.page.listFindings.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.securitycenter.v1.ListAssetsResponse.IListAssetsResult[] = + const responses: protos.google.cloud.securitycenter.v1.ListFindingsResponse.IListFindingsResult[] = []; - const iterable = client.listAssetsAsync(request); + const iterable = client.listFindingsAsync(request); for await (const resource of iterable) { responses.push(resource!); } assert.deepStrictEqual(responses, expectedResponse); assert.deepStrictEqual( - (client.descriptors.page.listAssets.asyncIterate as SinonStub).getCall( - 0 - ).args[1], + ( + client.descriptors.page.listFindings.asyncIterate as SinonStub + ).getCall(0).args[1], request ); assert.strictEqual( - (client.descriptors.page.listAssets.asyncIterate as SinonStub).getCall( - 0 - ).args[2].otherArgs.headers['x-goog-request-params'], + ( + client.descriptors.page.listFindings.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); - it('uses async iteration with listAssets with error', async () => { + it('uses async iteration with listFindings with error', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListAssetsRequest() + new protos.google.cloud.securitycenter.v1.ListFindingsRequest() ); request.parent = ''; const expectedHeaderRequestParams = 'parent='; const expectedError = new Error('expected'); - client.descriptors.page.listAssets.asyncIterate = stubAsyncIterationCall( - undefined, - expectedError - ); - const iterable = client.listAssetsAsync(request); + client.descriptors.page.listFindings.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listFindingsAsync(request); await assert.rejects(async () => { - const responses: protos.google.cloud.securitycenter.v1.ListAssetsResponse.IListAssetsResult[] = + const responses: protos.google.cloud.securitycenter.v1.ListFindingsResponse.IListFindingsResult[] = []; for await (const resource of iterable) { responses.push(resource!); } }); assert.deepStrictEqual( - (client.descriptors.page.listAssets.asyncIterate as SinonStub).getCall( - 0 - ).args[1], + ( + client.descriptors.page.listFindings.asyncIterate as SinonStub + ).getCall(0).args[1], request ); assert.strictEqual( - (client.descriptors.page.listAssets.asyncIterate as SinonStub).getCall( - 0 - ).args[2].otherArgs.headers['x-goog-request-params'], + ( + client.descriptors.page.listFindings.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); }); - describe('listFindings', () => { - it('invokes listFindings without error', async () => { + describe('listMuteConfigs', () => { + it('invokes listMuteConfigs without error', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListFindingsRequest() + new protos.google.cloud.securitycenter.v1.ListMuteConfigsRequest() ); request.parent = ''; const expectedHeaderRequestParams = 'parent='; @@ -4453,33 +5259,33 @@ describe('v1.SecurityCenterClient', () => { }; const expectedResponse = [ generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult() + new protos.google.cloud.securitycenter.v1.MuteConfig() ), generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult() + new protos.google.cloud.securitycenter.v1.MuteConfig() ), generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult() + new protos.google.cloud.securitycenter.v1.MuteConfig() ), ]; - client.innerApiCalls.listFindings = stubSimpleCall(expectedResponse); - const [response] = await client.listFindings(request); + client.innerApiCalls.listMuteConfigs = stubSimpleCall(expectedResponse); + const [response] = await client.listMuteConfigs(request); assert.deepStrictEqual(response, expectedResponse); assert( - (client.innerApiCalls.listFindings as SinonStub) + (client.innerApiCalls.listMuteConfigs as SinonStub) .getCall(0) .calledWith(request, expectedOptions, undefined) ); }); - it('invokes listFindings without error using callback', async () => { + it('invokes listMuteConfigs without error using callback', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListFindingsRequest() + new protos.google.cloud.securitycenter.v1.ListMuteConfigsRequest() ); request.parent = ''; const expectedHeaderRequestParams = 'parent='; @@ -4492,25 +5298,23 @@ describe('v1.SecurityCenterClient', () => { }; const expectedResponse = [ generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult() + new protos.google.cloud.securitycenter.v1.MuteConfig() ), generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult() + new protos.google.cloud.securitycenter.v1.MuteConfig() ), generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult() + new protos.google.cloud.securitycenter.v1.MuteConfig() ), ]; - client.innerApiCalls.listFindings = + client.innerApiCalls.listMuteConfigs = stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.listFindings( + client.listMuteConfigs( request, ( err?: Error | null, - result?: - | protos.google.cloud.securitycenter.v1.ListFindingsResponse.IListFindingsResult[] - | null + result?: protos.google.cloud.securitycenter.v1.IMuteConfig[] | null ) => { if (err) { reject(err); @@ -4523,20 +5327,20 @@ describe('v1.SecurityCenterClient', () => { const response = await promise; assert.deepStrictEqual(response, expectedResponse); assert( - (client.innerApiCalls.listFindings as SinonStub) + (client.innerApiCalls.listMuteConfigs as SinonStub) .getCall(0) .calledWith(request, expectedOptions /*, callback defined above */) ); }); - it('invokes listFindings with error', async () => { + it('invokes listMuteConfigs with error', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListFindingsRequest() + new protos.google.cloud.securitycenter.v1.ListMuteConfigsRequest() ); request.parent = ''; const expectedHeaderRequestParams = 'parent='; @@ -4548,51 +5352,49 @@ describe('v1.SecurityCenterClient', () => { }, }; const expectedError = new Error('expected'); - client.innerApiCalls.listFindings = stubSimpleCall( + client.innerApiCalls.listMuteConfigs = stubSimpleCall( undefined, expectedError ); - await assert.rejects(client.listFindings(request), expectedError); + await assert.rejects(client.listMuteConfigs(request), expectedError); assert( - (client.innerApiCalls.listFindings as SinonStub) + (client.innerApiCalls.listMuteConfigs as SinonStub) .getCall(0) .calledWith(request, expectedOptions, undefined) ); }); - it('invokes listFindingsStream without error', async () => { + it('invokes listMuteConfigsStream without error', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListFindingsRequest() + new protos.google.cloud.securitycenter.v1.ListMuteConfigsRequest() ); request.parent = ''; const expectedHeaderRequestParams = 'parent='; const expectedResponse = [ generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult() + new protos.google.cloud.securitycenter.v1.MuteConfig() ), generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult() + new protos.google.cloud.securitycenter.v1.MuteConfig() ), generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult() + new protos.google.cloud.securitycenter.v1.MuteConfig() ), ]; - client.descriptors.page.listFindings.createStream = + client.descriptors.page.listMuteConfigs.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listFindingsStream(request); + const stream = client.listMuteConfigsStream(request); const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult[] = + const responses: protos.google.cloud.securitycenter.v1.MuteConfig[] = []; stream.on( 'data', - ( - response: protos.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult - ) => { + (response: protos.google.cloud.securitycenter.v1.MuteConfig) => { responses.push(response); } ); @@ -4606,43 +5408,39 @@ describe('v1.SecurityCenterClient', () => { const responses = await promise; assert.deepStrictEqual(responses, expectedResponse); assert( - (client.descriptors.page.listFindings.createStream as SinonStub) + (client.descriptors.page.listMuteConfigs.createStream as SinonStub) .getCall(0) - .calledWith(client.innerApiCalls.listFindings, request) + .calledWith(client.innerApiCalls.listMuteConfigs, request) ); assert.strictEqual( ( - client.descriptors.page.listFindings.createStream as SinonStub + client.descriptors.page.listMuteConfigs.createStream as SinonStub ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); - it('invokes listFindingsStream with error', async () => { + it('invokes listMuteConfigsStream with error', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListFindingsRequest() + new protos.google.cloud.securitycenter.v1.ListMuteConfigsRequest() ); request.parent = ''; const expectedHeaderRequestParams = 'parent='; const expectedError = new Error('expected'); - client.descriptors.page.listFindings.createStream = stubPageStreamingCall( - undefined, - expectedError - ); - const stream = client.listFindingsStream(request); + client.descriptors.page.listMuteConfigs.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listMuteConfigsStream(request); const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult[] = + const responses: protos.google.cloud.securitycenter.v1.MuteConfig[] = []; stream.on( 'data', - ( - response: protos.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult - ) => { + (response: protos.google.cloud.securitycenter.v1.MuteConfig) => { responses.push(response); } ); @@ -4655,80 +5453,79 @@ describe('v1.SecurityCenterClient', () => { }); await assert.rejects(promise, expectedError); assert( - (client.descriptors.page.listFindings.createStream as SinonStub) + (client.descriptors.page.listMuteConfigs.createStream as SinonStub) .getCall(0) - .calledWith(client.innerApiCalls.listFindings, request) + .calledWith(client.innerApiCalls.listMuteConfigs, request) ); assert.strictEqual( ( - client.descriptors.page.listFindings.createStream as SinonStub + client.descriptors.page.listMuteConfigs.createStream as SinonStub ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); - it('uses async iteration with listFindings without error', async () => { + it('uses async iteration with listMuteConfigs without error', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListFindingsRequest() + new protos.google.cloud.securitycenter.v1.ListMuteConfigsRequest() ); request.parent = ''; const expectedHeaderRequestParams = 'parent='; const expectedResponse = [ generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult() + new protos.google.cloud.securitycenter.v1.MuteConfig() ), generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult() + new protos.google.cloud.securitycenter.v1.MuteConfig() ), generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult() + new protos.google.cloud.securitycenter.v1.MuteConfig() ), ]; - client.descriptors.page.listFindings.asyncIterate = + client.descriptors.page.listMuteConfigs.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.securitycenter.v1.ListFindingsResponse.IListFindingsResult[] = - []; - const iterable = client.listFindingsAsync(request); + const responses: protos.google.cloud.securitycenter.v1.IMuteConfig[] = []; + const iterable = client.listMuteConfigsAsync(request); for await (const resource of iterable) { responses.push(resource!); } assert.deepStrictEqual(responses, expectedResponse); assert.deepStrictEqual( ( - client.descriptors.page.listFindings.asyncIterate as SinonStub + client.descriptors.page.listMuteConfigs.asyncIterate as SinonStub ).getCall(0).args[1], request ); assert.strictEqual( ( - client.descriptors.page.listFindings.asyncIterate as SinonStub + client.descriptors.page.listMuteConfigs.asyncIterate as SinonStub ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); - it('uses async iteration with listFindings with error', async () => { + it('uses async iteration with listMuteConfigs with error', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListFindingsRequest() + new protos.google.cloud.securitycenter.v1.ListMuteConfigsRequest() ); request.parent = ''; const expectedHeaderRequestParams = 'parent='; const expectedError = new Error('expected'); - client.descriptors.page.listFindings.asyncIterate = + client.descriptors.page.listMuteConfigs.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listFindingsAsync(request); + const iterable = client.listMuteConfigsAsync(request); await assert.rejects(async () => { - const responses: protos.google.cloud.securitycenter.v1.ListFindingsResponse.IListFindingsResult[] = + const responses: protos.google.cloud.securitycenter.v1.IMuteConfig[] = []; for await (const resource of iterable) { responses.push(resource!); @@ -4736,28 +5533,28 @@ describe('v1.SecurityCenterClient', () => { }); assert.deepStrictEqual( ( - client.descriptors.page.listFindings.asyncIterate as SinonStub + client.descriptors.page.listMuteConfigs.asyncIterate as SinonStub ).getCall(0).args[1], request ); assert.strictEqual( ( - client.descriptors.page.listFindings.asyncIterate as SinonStub + client.descriptors.page.listMuteConfigs.asyncIterate as SinonStub ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); }); - describe('listMuteConfigs', () => { - it('invokes listMuteConfigs without error', async () => { + describe('listNotificationConfigs', () => { + it('invokes listNotificationConfigs without error', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListMuteConfigsRequest() + new protos.google.cloud.securitycenter.v1.ListNotificationConfigsRequest() ); request.parent = ''; const expectedHeaderRequestParams = 'parent='; @@ -4770,33 +5567,34 @@ describe('v1.SecurityCenterClient', () => { }; const expectedResponse = [ generateSampleMessage( - new protos.google.cloud.securitycenter.v1.MuteConfig() + new protos.google.cloud.securitycenter.v1.NotificationConfig() ), generateSampleMessage( - new protos.google.cloud.securitycenter.v1.MuteConfig() + new protos.google.cloud.securitycenter.v1.NotificationConfig() ), generateSampleMessage( - new protos.google.cloud.securitycenter.v1.MuteConfig() + new protos.google.cloud.securitycenter.v1.NotificationConfig() ), ]; - client.innerApiCalls.listMuteConfigs = stubSimpleCall(expectedResponse); - const [response] = await client.listMuteConfigs(request); + client.innerApiCalls.listNotificationConfigs = + stubSimpleCall(expectedResponse); + const [response] = await client.listNotificationConfigs(request); assert.deepStrictEqual(response, expectedResponse); assert( - (client.innerApiCalls.listMuteConfigs as SinonStub) + (client.innerApiCalls.listNotificationConfigs as SinonStub) .getCall(0) .calledWith(request, expectedOptions, undefined) ); }); - it('invokes listMuteConfigs without error using callback', async () => { + it('invokes listNotificationConfigs without error using callback', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListMuteConfigsRequest() + new protos.google.cloud.securitycenter.v1.ListNotificationConfigsRequest() ); request.parent = ''; const expectedHeaderRequestParams = 'parent='; @@ -4809,23 +5607,25 @@ describe('v1.SecurityCenterClient', () => { }; const expectedResponse = [ generateSampleMessage( - new protos.google.cloud.securitycenter.v1.MuteConfig() + new protos.google.cloud.securitycenter.v1.NotificationConfig() ), generateSampleMessage( - new protos.google.cloud.securitycenter.v1.MuteConfig() + new protos.google.cloud.securitycenter.v1.NotificationConfig() ), generateSampleMessage( - new protos.google.cloud.securitycenter.v1.MuteConfig() + new protos.google.cloud.securitycenter.v1.NotificationConfig() ), ]; - client.innerApiCalls.listMuteConfigs = + client.innerApiCalls.listNotificationConfigs = stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.listMuteConfigs( + client.listNotificationConfigs( request, ( err?: Error | null, - result?: protos.google.cloud.securitycenter.v1.IMuteConfig[] | null + result?: + | protos.google.cloud.securitycenter.v1.INotificationConfig[] + | null ) => { if (err) { reject(err); @@ -4838,20 +5638,20 @@ describe('v1.SecurityCenterClient', () => { const response = await promise; assert.deepStrictEqual(response, expectedResponse); assert( - (client.innerApiCalls.listMuteConfigs as SinonStub) + (client.innerApiCalls.listNotificationConfigs as SinonStub) .getCall(0) .calledWith(request, expectedOptions /*, callback defined above */) ); }); - it('invokes listMuteConfigs with error', async () => { + it('invokes listNotificationConfigs with error', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListMuteConfigsRequest() + new protos.google.cloud.securitycenter.v1.ListNotificationConfigsRequest() ); request.parent = ''; const expectedHeaderRequestParams = 'parent='; @@ -4863,49 +5663,54 @@ describe('v1.SecurityCenterClient', () => { }, }; const expectedError = new Error('expected'); - client.innerApiCalls.listMuteConfigs = stubSimpleCall( + client.innerApiCalls.listNotificationConfigs = stubSimpleCall( undefined, expectedError ); - await assert.rejects(client.listMuteConfigs(request), expectedError); + await assert.rejects( + client.listNotificationConfigs(request), + expectedError + ); assert( - (client.innerApiCalls.listMuteConfigs as SinonStub) + (client.innerApiCalls.listNotificationConfigs as SinonStub) .getCall(0) .calledWith(request, expectedOptions, undefined) ); }); - it('invokes listMuteConfigsStream without error', async () => { + it('invokes listNotificationConfigsStream without error', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListMuteConfigsRequest() + new protos.google.cloud.securitycenter.v1.ListNotificationConfigsRequest() ); request.parent = ''; const expectedHeaderRequestParams = 'parent='; const expectedResponse = [ generateSampleMessage( - new protos.google.cloud.securitycenter.v1.MuteConfig() + new protos.google.cloud.securitycenter.v1.NotificationConfig() ), generateSampleMessage( - new protos.google.cloud.securitycenter.v1.MuteConfig() + new protos.google.cloud.securitycenter.v1.NotificationConfig() ), generateSampleMessage( - new protos.google.cloud.securitycenter.v1.MuteConfig() + new protos.google.cloud.securitycenter.v1.NotificationConfig() ), ]; - client.descriptors.page.listMuteConfigs.createStream = + client.descriptors.page.listNotificationConfigs.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listMuteConfigsStream(request); + const stream = client.listNotificationConfigsStream(request); const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.securitycenter.v1.MuteConfig[] = + const responses: protos.google.cloud.securitycenter.v1.NotificationConfig[] = []; stream.on( 'data', - (response: protos.google.cloud.securitycenter.v1.MuteConfig) => { + ( + response: protos.google.cloud.securitycenter.v1.NotificationConfig + ) => { responses.push(response); } ); @@ -4919,39 +5724,45 @@ describe('v1.SecurityCenterClient', () => { const responses = await promise; assert.deepStrictEqual(responses, expectedResponse); assert( - (client.descriptors.page.listMuteConfigs.createStream as SinonStub) + ( + client.descriptors.page.listNotificationConfigs + .createStream as SinonStub + ) .getCall(0) - .calledWith(client.innerApiCalls.listMuteConfigs, request) + .calledWith(client.innerApiCalls.listNotificationConfigs, request) ); assert.strictEqual( ( - client.descriptors.page.listMuteConfigs.createStream as SinonStub + client.descriptors.page.listNotificationConfigs + .createStream as SinonStub ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); - it('invokes listMuteConfigsStream with error', async () => { + it('invokes listNotificationConfigsStream with error', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListMuteConfigsRequest() + new protos.google.cloud.securitycenter.v1.ListNotificationConfigsRequest() ); request.parent = ''; const expectedHeaderRequestParams = 'parent='; const expectedError = new Error('expected'); - client.descriptors.page.listMuteConfigs.createStream = + client.descriptors.page.listNotificationConfigs.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listMuteConfigsStream(request); + const stream = client.listNotificationConfigsStream(request); const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.securitycenter.v1.MuteConfig[] = + const responses: protos.google.cloud.securitycenter.v1.NotificationConfig[] = []; stream.on( 'data', - (response: protos.google.cloud.securitycenter.v1.MuteConfig) => { + ( + response: protos.google.cloud.securitycenter.v1.NotificationConfig + ) => { responses.push(response); } ); @@ -4964,79 +5775,86 @@ describe('v1.SecurityCenterClient', () => { }); await assert.rejects(promise, expectedError); assert( - (client.descriptors.page.listMuteConfigs.createStream as SinonStub) + ( + client.descriptors.page.listNotificationConfigs + .createStream as SinonStub + ) .getCall(0) - .calledWith(client.innerApiCalls.listMuteConfigs, request) + .calledWith(client.innerApiCalls.listNotificationConfigs, request) ); assert.strictEqual( ( - client.descriptors.page.listMuteConfigs.createStream as SinonStub + client.descriptors.page.listNotificationConfigs + .createStream as SinonStub ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); - it('uses async iteration with listMuteConfigs without error', async () => { + it('uses async iteration with listNotificationConfigs without error', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListMuteConfigsRequest() + new protos.google.cloud.securitycenter.v1.ListNotificationConfigsRequest() ); request.parent = ''; const expectedHeaderRequestParams = 'parent='; const expectedResponse = [ generateSampleMessage( - new protos.google.cloud.securitycenter.v1.MuteConfig() + new protos.google.cloud.securitycenter.v1.NotificationConfig() ), generateSampleMessage( - new protos.google.cloud.securitycenter.v1.MuteConfig() + new protos.google.cloud.securitycenter.v1.NotificationConfig() ), generateSampleMessage( - new protos.google.cloud.securitycenter.v1.MuteConfig() + new protos.google.cloud.securitycenter.v1.NotificationConfig() ), ]; - client.descriptors.page.listMuteConfigs.asyncIterate = + client.descriptors.page.listNotificationConfigs.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.securitycenter.v1.IMuteConfig[] = []; - const iterable = client.listMuteConfigsAsync(request); + const responses: protos.google.cloud.securitycenter.v1.INotificationConfig[] = + []; + const iterable = client.listNotificationConfigsAsync(request); for await (const resource of iterable) { responses.push(resource!); } assert.deepStrictEqual(responses, expectedResponse); assert.deepStrictEqual( ( - client.descriptors.page.listMuteConfigs.asyncIterate as SinonStub + client.descriptors.page.listNotificationConfigs + .asyncIterate as SinonStub ).getCall(0).args[1], request ); assert.strictEqual( ( - client.descriptors.page.listMuteConfigs.asyncIterate as SinonStub + client.descriptors.page.listNotificationConfigs + .asyncIterate as SinonStub ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); - it('uses async iteration with listMuteConfigs with error', async () => { + it('uses async iteration with listNotificationConfigs with error', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListMuteConfigsRequest() + new protos.google.cloud.securitycenter.v1.ListNotificationConfigsRequest() ); request.parent = ''; const expectedHeaderRequestParams = 'parent='; const expectedError = new Error('expected'); - client.descriptors.page.listMuteConfigs.asyncIterate = + client.descriptors.page.listNotificationConfigs.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listMuteConfigsAsync(request); + const iterable = client.listNotificationConfigsAsync(request); await assert.rejects(async () => { - const responses: protos.google.cloud.securitycenter.v1.IMuteConfig[] = + const responses: protos.google.cloud.securitycenter.v1.INotificationConfig[] = []; for await (const resource of iterable) { responses.push(resource!); @@ -5044,28 +5862,30 @@ describe('v1.SecurityCenterClient', () => { }); assert.deepStrictEqual( ( - client.descriptors.page.listMuteConfigs.asyncIterate as SinonStub + client.descriptors.page.listNotificationConfigs + .asyncIterate as SinonStub ).getCall(0).args[1], request ); assert.strictEqual( ( - client.descriptors.page.listMuteConfigs.asyncIterate as SinonStub + client.descriptors.page.listNotificationConfigs + .asyncIterate as SinonStub ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); }); - describe('listNotificationConfigs', () => { - it('invokes listNotificationConfigs without error', async () => { + describe('listSources', () => { + it('invokes listSources without error', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListNotificationConfigsRequest() + new protos.google.cloud.securitycenter.v1.ListSourcesRequest() ); request.parent = ''; const expectedHeaderRequestParams = 'parent='; @@ -5078,34 +5898,33 @@ describe('v1.SecurityCenterClient', () => { }; const expectedResponse = [ generateSampleMessage( - new protos.google.cloud.securitycenter.v1.NotificationConfig() + new protos.google.cloud.securitycenter.v1.Source() ), generateSampleMessage( - new protos.google.cloud.securitycenter.v1.NotificationConfig() + new protos.google.cloud.securitycenter.v1.Source() ), generateSampleMessage( - new protos.google.cloud.securitycenter.v1.NotificationConfig() + new protos.google.cloud.securitycenter.v1.Source() ), ]; - client.innerApiCalls.listNotificationConfigs = - stubSimpleCall(expectedResponse); - const [response] = await client.listNotificationConfigs(request); + client.innerApiCalls.listSources = stubSimpleCall(expectedResponse); + const [response] = await client.listSources(request); assert.deepStrictEqual(response, expectedResponse); assert( - (client.innerApiCalls.listNotificationConfigs as SinonStub) + (client.innerApiCalls.listSources as SinonStub) .getCall(0) .calledWith(request, expectedOptions, undefined) ); }); - it('invokes listNotificationConfigs without error using callback', async () => { + it('invokes listSources without error using callback', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListNotificationConfigsRequest() + new protos.google.cloud.securitycenter.v1.ListSourcesRequest() ); request.parent = ''; const expectedHeaderRequestParams = 'parent='; @@ -5118,25 +5937,23 @@ describe('v1.SecurityCenterClient', () => { }; const expectedResponse = [ generateSampleMessage( - new protos.google.cloud.securitycenter.v1.NotificationConfig() + new protos.google.cloud.securitycenter.v1.Source() ), generateSampleMessage( - new protos.google.cloud.securitycenter.v1.NotificationConfig() + new protos.google.cloud.securitycenter.v1.Source() ), generateSampleMessage( - new protos.google.cloud.securitycenter.v1.NotificationConfig() + new protos.google.cloud.securitycenter.v1.Source() ), ]; - client.innerApiCalls.listNotificationConfigs = + client.innerApiCalls.listSources = stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.listNotificationConfigs( + client.listSources( request, ( err?: Error | null, - result?: - | protos.google.cloud.securitycenter.v1.INotificationConfig[] - | null + result?: protos.google.cloud.securitycenter.v1.ISource[] | null ) => { if (err) { reject(err); @@ -5149,20 +5966,20 @@ describe('v1.SecurityCenterClient', () => { const response = await promise; assert.deepStrictEqual(response, expectedResponse); assert( - (client.innerApiCalls.listNotificationConfigs as SinonStub) + (client.innerApiCalls.listSources as SinonStub) .getCall(0) .calledWith(request, expectedOptions /*, callback defined above */) ); }); - it('invokes listNotificationConfigs with error', async () => { + it('invokes listSources with error', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListNotificationConfigsRequest() + new protos.google.cloud.securitycenter.v1.ListSourcesRequest() ); request.parent = ''; const expectedHeaderRequestParams = 'parent='; @@ -5174,54 +5991,48 @@ describe('v1.SecurityCenterClient', () => { }, }; const expectedError = new Error('expected'); - client.innerApiCalls.listNotificationConfigs = stubSimpleCall( + client.innerApiCalls.listSources = stubSimpleCall( undefined, expectedError ); - await assert.rejects( - client.listNotificationConfigs(request), - expectedError - ); + await assert.rejects(client.listSources(request), expectedError); assert( - (client.innerApiCalls.listNotificationConfigs as SinonStub) + (client.innerApiCalls.listSources as SinonStub) .getCall(0) .calledWith(request, expectedOptions, undefined) ); }); - it('invokes listNotificationConfigsStream without error', async () => { + it('invokes listSourcesStream without error', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListNotificationConfigsRequest() + new protos.google.cloud.securitycenter.v1.ListSourcesRequest() ); request.parent = ''; const expectedHeaderRequestParams = 'parent='; const expectedResponse = [ generateSampleMessage( - new protos.google.cloud.securitycenter.v1.NotificationConfig() + new protos.google.cloud.securitycenter.v1.Source() ), generateSampleMessage( - new protos.google.cloud.securitycenter.v1.NotificationConfig() + new protos.google.cloud.securitycenter.v1.Source() ), generateSampleMessage( - new protos.google.cloud.securitycenter.v1.NotificationConfig() + new protos.google.cloud.securitycenter.v1.Source() ), ]; - client.descriptors.page.listNotificationConfigs.createStream = + client.descriptors.page.listSources.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listNotificationConfigsStream(request); + const stream = client.listSourcesStream(request); const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.securitycenter.v1.NotificationConfig[] = - []; + const responses: protos.google.cloud.securitycenter.v1.Source[] = []; stream.on( 'data', - ( - response: protos.google.cloud.securitycenter.v1.NotificationConfig - ) => { + (response: protos.google.cloud.securitycenter.v1.Source) => { responses.push(response); } ); @@ -5235,45 +6046,40 @@ describe('v1.SecurityCenterClient', () => { const responses = await promise; assert.deepStrictEqual(responses, expectedResponse); assert( - ( - client.descriptors.page.listNotificationConfigs - .createStream as SinonStub - ) + (client.descriptors.page.listSources.createStream as SinonStub) .getCall(0) - .calledWith(client.innerApiCalls.listNotificationConfigs, request) + .calledWith(client.innerApiCalls.listSources, request) ); assert.strictEqual( - ( - client.descriptors.page.listNotificationConfigs - .createStream as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + (client.descriptors.page.listSources.createStream as SinonStub).getCall( + 0 + ).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); - it('invokes listNotificationConfigsStream with error', async () => { + it('invokes listSourcesStream with error', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListNotificationConfigsRequest() + new protos.google.cloud.securitycenter.v1.ListSourcesRequest() ); request.parent = ''; const expectedHeaderRequestParams = 'parent='; const expectedError = new Error('expected'); - client.descriptors.page.listNotificationConfigs.createStream = - stubPageStreamingCall(undefined, expectedError); - const stream = client.listNotificationConfigsStream(request); + client.descriptors.page.listSources.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listSourcesStream(request); const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.securitycenter.v1.NotificationConfig[] = - []; + const responses: protos.google.cloud.securitycenter.v1.Source[] = []; stream.on( 'data', - ( - response: protos.google.cloud.securitycenter.v1.NotificationConfig - ) => { + (response: protos.google.cloud.securitycenter.v1.Source) => { responses.push(response); } ); @@ -5286,117 +6092,109 @@ describe('v1.SecurityCenterClient', () => { }); await assert.rejects(promise, expectedError); assert( - ( - client.descriptors.page.listNotificationConfigs - .createStream as SinonStub - ) + (client.descriptors.page.listSources.createStream as SinonStub) .getCall(0) - .calledWith(client.innerApiCalls.listNotificationConfigs, request) + .calledWith(client.innerApiCalls.listSources, request) ); assert.strictEqual( - ( - client.descriptors.page.listNotificationConfigs - .createStream as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + (client.descriptors.page.listSources.createStream as SinonStub).getCall( + 0 + ).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); - it('uses async iteration with listNotificationConfigs without error', async () => { + it('uses async iteration with listSources without error', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListNotificationConfigsRequest() + new protos.google.cloud.securitycenter.v1.ListSourcesRequest() ); request.parent = ''; const expectedHeaderRequestParams = 'parent='; const expectedResponse = [ generateSampleMessage( - new protos.google.cloud.securitycenter.v1.NotificationConfig() + new protos.google.cloud.securitycenter.v1.Source() ), generateSampleMessage( - new protos.google.cloud.securitycenter.v1.NotificationConfig() + new protos.google.cloud.securitycenter.v1.Source() ), generateSampleMessage( - new protos.google.cloud.securitycenter.v1.NotificationConfig() + new protos.google.cloud.securitycenter.v1.Source() ), ]; - client.descriptors.page.listNotificationConfigs.asyncIterate = + client.descriptors.page.listSources.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.securitycenter.v1.INotificationConfig[] = - []; - const iterable = client.listNotificationConfigsAsync(request); + const responses: protos.google.cloud.securitycenter.v1.ISource[] = []; + const iterable = client.listSourcesAsync(request); for await (const resource of iterable) { responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - ( - client.descriptors.page.listNotificationConfigs - .asyncIterate as SinonStub - ).getCall(0).args[1], + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listSources.asyncIterate as SinonStub).getCall( + 0 + ).args[1], request ); assert.strictEqual( - ( - client.descriptors.page.listNotificationConfigs - .asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + (client.descriptors.page.listSources.asyncIterate as SinonStub).getCall( + 0 + ).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); - it('uses async iteration with listNotificationConfigs with error', async () => { + it('uses async iteration with listSources with error', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListNotificationConfigsRequest() + new protos.google.cloud.securitycenter.v1.ListSourcesRequest() ); request.parent = ''; const expectedHeaderRequestParams = 'parent='; const expectedError = new Error('expected'); - client.descriptors.page.listNotificationConfigs.asyncIterate = - stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listNotificationConfigsAsync(request); + client.descriptors.page.listSources.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listSourcesAsync(request); await assert.rejects(async () => { - const responses: protos.google.cloud.securitycenter.v1.INotificationConfig[] = - []; + const responses: protos.google.cloud.securitycenter.v1.ISource[] = []; for await (const resource of iterable) { responses.push(resource!); } }); assert.deepStrictEqual( - ( - client.descriptors.page.listNotificationConfigs - .asyncIterate as SinonStub - ).getCall(0).args[1], + (client.descriptors.page.listSources.asyncIterate as SinonStub).getCall( + 0 + ).args[1], request ); assert.strictEqual( - ( - client.descriptors.page.listNotificationConfigs - .asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + (client.descriptors.page.listSources.asyncIterate as SinonStub).getCall( + 0 + ).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); }); - describe('listSources', () => { - it('invokes listSources without error', async () => { + describe('listBigQueryExports', () => { + it('invokes listBigQueryExports without error', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListSourcesRequest() + new protos.google.cloud.securitycenter.v1.ListBigQueryExportsRequest() ); request.parent = ''; const expectedHeaderRequestParams = 'parent='; @@ -5409,33 +6207,34 @@ describe('v1.SecurityCenterClient', () => { }; const expectedResponse = [ generateSampleMessage( - new protos.google.cloud.securitycenter.v1.Source() + new protos.google.cloud.securitycenter.v1.BigQueryExport() ), generateSampleMessage( - new protos.google.cloud.securitycenter.v1.Source() + new protos.google.cloud.securitycenter.v1.BigQueryExport() ), generateSampleMessage( - new protos.google.cloud.securitycenter.v1.Source() + new protos.google.cloud.securitycenter.v1.BigQueryExport() ), ]; - client.innerApiCalls.listSources = stubSimpleCall(expectedResponse); - const [response] = await client.listSources(request); + client.innerApiCalls.listBigQueryExports = + stubSimpleCall(expectedResponse); + const [response] = await client.listBigQueryExports(request); assert.deepStrictEqual(response, expectedResponse); assert( - (client.innerApiCalls.listSources as SinonStub) + (client.innerApiCalls.listBigQueryExports as SinonStub) .getCall(0) .calledWith(request, expectedOptions, undefined) ); }); - it('invokes listSources without error using callback', async () => { + it('invokes listBigQueryExports without error using callback', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListSourcesRequest() + new protos.google.cloud.securitycenter.v1.ListBigQueryExportsRequest() ); request.parent = ''; const expectedHeaderRequestParams = 'parent='; @@ -5448,23 +6247,25 @@ describe('v1.SecurityCenterClient', () => { }; const expectedResponse = [ generateSampleMessage( - new protos.google.cloud.securitycenter.v1.Source() + new protos.google.cloud.securitycenter.v1.BigQueryExport() ), generateSampleMessage( - new protos.google.cloud.securitycenter.v1.Source() + new protos.google.cloud.securitycenter.v1.BigQueryExport() ), generateSampleMessage( - new protos.google.cloud.securitycenter.v1.Source() + new protos.google.cloud.securitycenter.v1.BigQueryExport() ), ]; - client.innerApiCalls.listSources = + client.innerApiCalls.listBigQueryExports = stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.listSources( + client.listBigQueryExports( request, ( err?: Error | null, - result?: protos.google.cloud.securitycenter.v1.ISource[] | null + result?: + | protos.google.cloud.securitycenter.v1.IBigQueryExport[] + | null ) => { if (err) { reject(err); @@ -5477,20 +6278,20 @@ describe('v1.SecurityCenterClient', () => { const response = await promise; assert.deepStrictEqual(response, expectedResponse); assert( - (client.innerApiCalls.listSources as SinonStub) + (client.innerApiCalls.listBigQueryExports as SinonStub) .getCall(0) .calledWith(request, expectedOptions /*, callback defined above */) ); }); - it('invokes listSources with error', async () => { + it('invokes listBigQueryExports with error', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListSourcesRequest() + new protos.google.cloud.securitycenter.v1.ListBigQueryExportsRequest() ); request.parent = ''; const expectedHeaderRequestParams = 'parent='; @@ -5502,48 +6303,49 @@ describe('v1.SecurityCenterClient', () => { }, }; const expectedError = new Error('expected'); - client.innerApiCalls.listSources = stubSimpleCall( + client.innerApiCalls.listBigQueryExports = stubSimpleCall( undefined, expectedError ); - await assert.rejects(client.listSources(request), expectedError); + await assert.rejects(client.listBigQueryExports(request), expectedError); assert( - (client.innerApiCalls.listSources as SinonStub) + (client.innerApiCalls.listBigQueryExports as SinonStub) .getCall(0) .calledWith(request, expectedOptions, undefined) ); }); - it('invokes listSourcesStream without error', async () => { + it('invokes listBigQueryExportsStream without error', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListSourcesRequest() + new protos.google.cloud.securitycenter.v1.ListBigQueryExportsRequest() ); request.parent = ''; const expectedHeaderRequestParams = 'parent='; const expectedResponse = [ generateSampleMessage( - new protos.google.cloud.securitycenter.v1.Source() + new protos.google.cloud.securitycenter.v1.BigQueryExport() ), generateSampleMessage( - new protos.google.cloud.securitycenter.v1.Source() + new protos.google.cloud.securitycenter.v1.BigQueryExport() ), generateSampleMessage( - new protos.google.cloud.securitycenter.v1.Source() + new protos.google.cloud.securitycenter.v1.BigQueryExport() ), ]; - client.descriptors.page.listSources.createStream = + client.descriptors.page.listBigQueryExports.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listSourcesStream(request); + const stream = client.listBigQueryExportsStream(request); const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.securitycenter.v1.Source[] = []; + const responses: protos.google.cloud.securitycenter.v1.BigQueryExport[] = + []; stream.on( 'data', - (response: protos.google.cloud.securitycenter.v1.Source) => { + (response: protos.google.cloud.securitycenter.v1.BigQueryExport) => { responses.push(response); } ); @@ -5557,40 +6359,39 @@ describe('v1.SecurityCenterClient', () => { const responses = await promise; assert.deepStrictEqual(responses, expectedResponse); assert( - (client.descriptors.page.listSources.createStream as SinonStub) + (client.descriptors.page.listBigQueryExports.createStream as SinonStub) .getCall(0) - .calledWith(client.innerApiCalls.listSources, request) + .calledWith(client.innerApiCalls.listBigQueryExports, request) ); assert.strictEqual( - (client.descriptors.page.listSources.createStream as SinonStub).getCall( - 0 - ).args[2].otherArgs.headers['x-goog-request-params'], + ( + client.descriptors.page.listBigQueryExports.createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); - it('invokes listSourcesStream with error', async () => { + it('invokes listBigQueryExportsStream with error', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListSourcesRequest() + new protos.google.cloud.securitycenter.v1.ListBigQueryExportsRequest() ); request.parent = ''; const expectedHeaderRequestParams = 'parent='; const expectedError = new Error('expected'); - client.descriptors.page.listSources.createStream = stubPageStreamingCall( - undefined, - expectedError - ); - const stream = client.listSourcesStream(request); + client.descriptors.page.listBigQueryExports.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listBigQueryExportsStream(request); const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.securitycenter.v1.Source[] = []; + const responses: protos.google.cloud.securitycenter.v1.BigQueryExport[] = + []; stream.on( 'data', - (response: protos.google.cloud.securitycenter.v1.Source) => { + (response: protos.google.cloud.securitycenter.v1.BigQueryExport) => { responses.push(response); } ); @@ -5603,95 +6404,95 @@ describe('v1.SecurityCenterClient', () => { }); await assert.rejects(promise, expectedError); assert( - (client.descriptors.page.listSources.createStream as SinonStub) + (client.descriptors.page.listBigQueryExports.createStream as SinonStub) .getCall(0) - .calledWith(client.innerApiCalls.listSources, request) + .calledWith(client.innerApiCalls.listBigQueryExports, request) ); assert.strictEqual( - (client.descriptors.page.listSources.createStream as SinonStub).getCall( - 0 - ).args[2].otherArgs.headers['x-goog-request-params'], + ( + client.descriptors.page.listBigQueryExports.createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); - it('uses async iteration with listSources without error', async () => { + it('uses async iteration with listBigQueryExports without error', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListSourcesRequest() + new protos.google.cloud.securitycenter.v1.ListBigQueryExportsRequest() ); request.parent = ''; const expectedHeaderRequestParams = 'parent='; const expectedResponse = [ generateSampleMessage( - new protos.google.cloud.securitycenter.v1.Source() + new protos.google.cloud.securitycenter.v1.BigQueryExport() ), generateSampleMessage( - new protos.google.cloud.securitycenter.v1.Source() + new protos.google.cloud.securitycenter.v1.BigQueryExport() ), generateSampleMessage( - new protos.google.cloud.securitycenter.v1.Source() + new protos.google.cloud.securitycenter.v1.BigQueryExport() ), ]; - client.descriptors.page.listSources.asyncIterate = + client.descriptors.page.listBigQueryExports.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.securitycenter.v1.ISource[] = []; - const iterable = client.listSourcesAsync(request); + const responses: protos.google.cloud.securitycenter.v1.IBigQueryExport[] = + []; + const iterable = client.listBigQueryExportsAsync(request); for await (const resource of iterable) { responses.push(resource!); } assert.deepStrictEqual(responses, expectedResponse); assert.deepStrictEqual( - (client.descriptors.page.listSources.asyncIterate as SinonStub).getCall( - 0 - ).args[1], + ( + client.descriptors.page.listBigQueryExports.asyncIterate as SinonStub + ).getCall(0).args[1], request ); assert.strictEqual( - (client.descriptors.page.listSources.asyncIterate as SinonStub).getCall( - 0 - ).args[2].otherArgs.headers['x-goog-request-params'], + ( + client.descriptors.page.listBigQueryExports.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); - it('uses async iteration with listSources with error', async () => { + it('uses async iteration with listBigQueryExports with error', async () => { const client = new securitycenterModule.v1.SecurityCenterClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.securitycenter.v1.ListSourcesRequest() + new protos.google.cloud.securitycenter.v1.ListBigQueryExportsRequest() ); request.parent = ''; const expectedHeaderRequestParams = 'parent='; const expectedError = new Error('expected'); - client.descriptors.page.listSources.asyncIterate = stubAsyncIterationCall( - undefined, - expectedError - ); - const iterable = client.listSourcesAsync(request); + client.descriptors.page.listBigQueryExports.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listBigQueryExportsAsync(request); await assert.rejects(async () => { - const responses: protos.google.cloud.securitycenter.v1.ISource[] = []; + const responses: protos.google.cloud.securitycenter.v1.IBigQueryExport[] = + []; for await (const resource of iterable) { responses.push(resource!); } }); assert.deepStrictEqual( - (client.descriptors.page.listSources.asyncIterate as SinonStub).getCall( - 0 - ).args[1], + ( + client.descriptors.page.listBigQueryExports.asyncIterate as SinonStub + ).getCall(0).args[1], request ); assert.strictEqual( - (client.descriptors.page.listSources.asyncIterate as SinonStub).getCall( - 0 - ).args[2].otherArgs.headers['x-goog-request-params'], + ( + client.descriptors.page.listBigQueryExports.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); @@ -5810,6 +6611,55 @@ describe('v1.SecurityCenterClient', () => { }); }); + describe('folderExport', () => { + const fakePath = '/rendered/path/folderExport'; + const expectedParameters = { + folder: 'folderValue', + export: 'exportValue', + }; + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.folderExportPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.folderExportPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('folderExportPath', () => { + const result = client.folderExportPath('folderValue', 'exportValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.folderExportPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchFolderFromFolderExportName', () => { + const result = client.matchFolderFromFolderExportName(fakePath); + assert.strictEqual(result, 'folderValue'); + assert( + (client.pathTemplates.folderExportPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchExportFromFolderExportName', () => { + const result = client.matchExportFromFolderExportName(fakePath); + assert.strictEqual(result, 'exportValue'); + assert( + (client.pathTemplates.folderExportPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('folderMuteConfig', () => { const fakePath = '/rendered/path/folderMuteConfig'; const expectedParameters = { @@ -6390,6 +7240,68 @@ describe('v1.SecurityCenterClient', () => { }); }); + describe('organizationExport', () => { + const fakePath = '/rendered/path/organizationExport'; + const expectedParameters = { + organization: 'organizationValue', + export: 'exportValue', + }; + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.organizationExportPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.organizationExportPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('organizationExportPath', () => { + const result = client.organizationExportPath( + 'organizationValue', + 'exportValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.organizationExportPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchOrganizationFromOrganizationExportName', () => { + const result = + client.matchOrganizationFromOrganizationExportName(fakePath); + assert.strictEqual(result, 'organizationValue'); + assert( + ( + client.pathTemplates.organizationExportPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchExportFromOrganizationExportName', () => { + const result = client.matchExportFromOrganizationExportName(fakePath); + assert.strictEqual(result, 'exportValue'); + assert( + ( + client.pathTemplates.organizationExportPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('organizationMuteConfig', () => { const fakePath = '/rendered/path/organizationMuteConfig'; const expectedParameters = { @@ -6944,6 +7856,55 @@ describe('v1.SecurityCenterClient', () => { }); }); + describe('projectExport', () => { + const fakePath = '/rendered/path/projectExport'; + const expectedParameters = { + project: 'projectValue', + export: 'exportValue', + }; + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectExportPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectExportPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectExportPath', () => { + const result = client.projectExportPath('projectValue', 'exportValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectExportPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectExportName', () => { + const result = client.matchProjectFromProjectExportName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectExportPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchExportFromProjectExportName', () => { + const result = client.matchExportFromProjectExportName(fakePath); + assert.strictEqual(result, 'exportValue'); + assert( + (client.pathTemplates.projectExportPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('projectMuteConfig', () => { const fakePath = '/rendered/path/projectMuteConfig'; const expectedParameters = { diff --git a/packages/google-cloud-securitycenter/test/gapic_security_center_v1beta1.ts b/packages/google-cloud-securitycenter/test/gapic_security_center_v1beta1.ts index 5c817221afa..e0ae6436622 100644 --- a/packages/google-cloud-securitycenter/test/gapic_security_center_v1beta1.ts +++ b/packages/google-cloud-securitycenter/test/gapic_security_center_v1beta1.ts @@ -362,7 +362,6 @@ describe('v1beta1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1beta1.CreateSourceRequest() ); request.parent = ''; - const expectedHeaderRequestParams = 'parent='; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.createSource(request), expectedError); @@ -489,7 +488,6 @@ describe('v1beta1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1beta1.CreateFindingRequest() ); request.parent = ''; - const expectedHeaderRequestParams = 'parent='; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.createFinding(request), expectedError); @@ -616,7 +614,6 @@ describe('v1beta1.SecurityCenterClient', () => { new protos.google.iam.v1.GetIamPolicyRequest() ); request.resource = ''; - const expectedHeaderRequestParams = 'resource='; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.getIamPolicy(request), expectedError); @@ -747,7 +744,6 @@ describe('v1beta1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest() ); request.name = ''; - const expectedHeaderRequestParams = 'name='; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects( @@ -874,7 +870,6 @@ describe('v1beta1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1beta1.GetSourceRequest() ); request.name = ''; - const expectedHeaderRequestParams = 'name='; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.getSource(request), expectedError); @@ -1001,7 +996,6 @@ describe('v1beta1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1beta1.SetFindingStateRequest() ); request.name = ''; - const expectedHeaderRequestParams = 'name='; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.setFindingState(request), expectedError); @@ -1128,7 +1122,6 @@ describe('v1beta1.SecurityCenterClient', () => { new protos.google.iam.v1.SetIamPolicyRequest() ); request.resource = ''; - const expectedHeaderRequestParams = 'resource='; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.setIamPolicy(request), expectedError); @@ -1256,7 +1249,6 @@ describe('v1beta1.SecurityCenterClient', () => { new protos.google.iam.v1.TestIamPermissionsRequest() ); request.resource = ''; - const expectedHeaderRequestParams = 'resource='; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.testIamPermissions(request), expectedError); @@ -1387,7 +1379,6 @@ describe('v1beta1.SecurityCenterClient', () => { ); request.finding = {}; request.finding.name = ''; - const expectedHeaderRequestParams = 'finding.name='; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.updateFinding(request), expectedError); @@ -1522,7 +1513,6 @@ describe('v1beta1.SecurityCenterClient', () => { ); request.organizationSettings = {}; request.organizationSettings.name = ''; - const expectedHeaderRequestParams = 'organization_settings.name='; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects( @@ -1656,7 +1646,6 @@ describe('v1beta1.SecurityCenterClient', () => { ); request.source = {}; request.source.name = ''; - const expectedHeaderRequestParams = 'source.name='; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.updateSource(request), expectedError); @@ -1788,7 +1777,6 @@ describe('v1beta1.SecurityCenterClient', () => { ); request.securityMarks = {}; request.securityMarks.name = ''; - const expectedHeaderRequestParams = 'security_marks.name='; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.updateSecurityMarks(request), expectedError); diff --git a/packages/google-cloud-securitycenter/test/gapic_security_center_v1p1beta1.ts b/packages/google-cloud-securitycenter/test/gapic_security_center_v1p1beta1.ts index c9ecc169a0f..3719516f63b 100644 --- a/packages/google-cloud-securitycenter/test/gapic_security_center_v1p1beta1.ts +++ b/packages/google-cloud-securitycenter/test/gapic_security_center_v1p1beta1.ts @@ -362,7 +362,6 @@ describe('v1p1beta1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1p1beta1.CreateSourceRequest() ); request.parent = ''; - const expectedHeaderRequestParams = 'parent='; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.createSource(request), expectedError); @@ -489,7 +488,6 @@ describe('v1p1beta1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1p1beta1.CreateFindingRequest() ); request.parent = ''; - const expectedHeaderRequestParams = 'parent='; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.createFinding(request), expectedError); @@ -620,7 +618,6 @@ describe('v1p1beta1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1p1beta1.CreateNotificationConfigRequest() ); request.parent = ''; - const expectedHeaderRequestParams = 'parent='; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects( @@ -754,7 +751,6 @@ describe('v1p1beta1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1p1beta1.DeleteNotificationConfigRequest() ); request.name = ''; - const expectedHeaderRequestParams = 'name='; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects( @@ -884,7 +880,6 @@ describe('v1p1beta1.SecurityCenterClient', () => { new protos.google.iam.v1.GetIamPolicyRequest() ); request.resource = ''; - const expectedHeaderRequestParams = 'resource='; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.getIamPolicy(request), expectedError); @@ -1015,7 +1010,6 @@ describe('v1p1beta1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1p1beta1.GetNotificationConfigRequest() ); request.name = ''; - const expectedHeaderRequestParams = 'name='; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects( @@ -1149,7 +1143,6 @@ describe('v1p1beta1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1p1beta1.GetOrganizationSettingsRequest() ); request.name = ''; - const expectedHeaderRequestParams = 'name='; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects( @@ -1276,7 +1269,6 @@ describe('v1p1beta1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1p1beta1.GetSourceRequest() ); request.name = ''; - const expectedHeaderRequestParams = 'name='; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.getSource(request), expectedError); @@ -1403,7 +1395,6 @@ describe('v1p1beta1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest() ); request.name = ''; - const expectedHeaderRequestParams = 'name='; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.setFindingState(request), expectedError); @@ -1530,7 +1521,6 @@ describe('v1p1beta1.SecurityCenterClient', () => { new protos.google.iam.v1.SetIamPolicyRequest() ); request.resource = ''; - const expectedHeaderRequestParams = 'resource='; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.setIamPolicy(request), expectedError); @@ -1658,7 +1648,6 @@ describe('v1p1beta1.SecurityCenterClient', () => { new protos.google.iam.v1.TestIamPermissionsRequest() ); request.resource = ''; - const expectedHeaderRequestParams = 'resource='; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.testIamPermissions(request), expectedError); @@ -1789,7 +1778,6 @@ describe('v1p1beta1.SecurityCenterClient', () => { ); request.finding = {}; request.finding.name = ''; - const expectedHeaderRequestParams = 'finding.name='; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.updateFinding(request), expectedError); @@ -1924,7 +1912,6 @@ describe('v1p1beta1.SecurityCenterClient', () => { ); request.notificationConfig = {}; request.notificationConfig.name = ''; - const expectedHeaderRequestParams = 'notification_config.name='; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects( @@ -2062,7 +2049,6 @@ describe('v1p1beta1.SecurityCenterClient', () => { ); request.organizationSettings = {}; request.organizationSettings.name = ''; - const expectedHeaderRequestParams = 'organization_settings.name='; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects( @@ -2196,7 +2182,6 @@ describe('v1p1beta1.SecurityCenterClient', () => { ); request.source = {}; request.source.name = ''; - const expectedHeaderRequestParams = 'source.name='; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.updateSource(request), expectedError); @@ -2328,7 +2313,6 @@ describe('v1p1beta1.SecurityCenterClient', () => { ); request.securityMarks = {}; request.securityMarks.name = ''; - const expectedHeaderRequestParams = 'security_marks.name='; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.updateSecurityMarks(request), expectedError); From 38db54e572550435f8c5771a641ea1d2beced86c Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Tue, 5 Apr 2022 17:34:24 +0000 Subject: [PATCH 306/342] feat: AuditConfig for IAM v1 (#470) - [ ] Regenerate this pull request now. PiperOrigin-RevId: 439356405 Source-Link: https://github.com/googleapis/googleapis/commit/afa2ba156bd5c83ad8168030ab801a8ca84ac819 Source-Link: https://github.com/googleapis/googleapis-gen/commit/3e40c17e1510c95fab58fc2143ccb61cceca5989 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiM2U0MGMxN2UxNTEwYzk1ZmFiNThmYzIxNDNjY2I2MWNjZWNhNTk4OSJ9 --- .../generated/v1/security_center.get_iam_policy.js | 2 +- .../generated/v1/security_center.set_iam_policy.js | 7 +++++++ .../snippet_metadata.google.cloud.securitycenter.v1.json | 6 +++++- .../generated/v1beta1/security_center.get_iam_policy.js | 2 +- .../generated/v1beta1/security_center.set_iam_policy.js | 7 +++++++ ...ppet_metadata.google.cloud.securitycenter.v1beta1.json | 6 +++++- .../generated/v1p1beta1/security_center.get_iam_policy.js | 2 +- .../generated/v1p1beta1/security_center.set_iam_policy.js | 7 +++++++ ...et_metadata.google.cloud.securitycenter.v1p1beta1.json | 6 +++++- .../src/v1/security_center_client.ts | 8 +++++++- .../src/v1beta1/security_center_client.ts | 8 +++++++- .../src/v1p1beta1/security_center_client.ts | 8 +++++++- 12 files changed, 60 insertions(+), 9 deletions(-) diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_iam_policy.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_iam_policy.js index c14522e3c00..c35eaa59dd5 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_iam_policy.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_iam_policy.js @@ -32,7 +32,7 @@ function main(resource) { // const resource = 'abc123' /** * OPTIONAL: A `GetPolicyOptions` object for specifying options to - * `GetIamPolicy`. This field is only used by Cloud IAM. + * `GetIamPolicy`. */ // const options = {} diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.set_iam_policy.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.set_iam_policy.js index 7949b8e5dc7..f1c269c9ae4 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.set_iam_policy.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.set_iam_policy.js @@ -37,6 +37,13 @@ function main(resource, policy) { * might reject them. */ // const policy = {} + /** + * OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only + * the fields in the mask will be modified. If no mask is provided, the + * following default mask is used: + * `paths: "bindings, etag"` + */ + // const updateMask = {} // Imports the Securitycenter library const {SecurityCenterClient} = require('@google-cloud/security-center').v1; diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/snippet_metadata.google.cloud.securitycenter.v1.json b/packages/google-cloud-securitycenter/samples/generated/v1/snippet_metadata.google.cloud.securitycenter.v1.json index bed009e660c..a1cbd617c4c 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/snippet_metadata.google.cloud.securitycenter.v1.json +++ b/packages/google-cloud-securitycenter/samples/generated/v1/snippet_metadata.google.cloud.securitycenter.v1.json @@ -1122,7 +1122,7 @@ "segments": [ { "start": 25, - "end": 59, + "end": 66, "type": "FULL" } ], @@ -1138,6 +1138,10 @@ { "name": "policy", "type": ".google.iam.v1.Policy" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" } ], "resultType": ".google.iam.v1.Policy", diff --git a/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.get_iam_policy.js b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.get_iam_policy.js index a91712e7ea0..c8f862f84ac 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.get_iam_policy.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.get_iam_policy.js @@ -32,7 +32,7 @@ function main(resource) { // const resource = 'abc123' /** * OPTIONAL: A `GetPolicyOptions` object for specifying options to - * `GetIamPolicy`. This field is only used by Cloud IAM. + * `GetIamPolicy`. */ // const options = {} diff --git a/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.set_iam_policy.js b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.set_iam_policy.js index f30512e7a9a..f9bb09e4ec4 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.set_iam_policy.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.set_iam_policy.js @@ -37,6 +37,13 @@ function main(resource, policy) { * might reject them. */ // const policy = {} + /** + * OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only + * the fields in the mask will be modified. If no mask is provided, the + * following default mask is used: + * `paths: "bindings, etag"` + */ + // const updateMask = {} // Imports the Securitycenter library const {SecurityCenterClient} = require('@google-cloud/security-center').v1beta1; diff --git a/packages/google-cloud-securitycenter/samples/generated/v1beta1/snippet_metadata.google.cloud.securitycenter.v1beta1.json b/packages/google-cloud-securitycenter/samples/generated/v1beta1/snippet_metadata.google.cloud.securitycenter.v1beta1.json index 0420e922284..93228556994 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1beta1/snippet_metadata.google.cloud.securitycenter.v1beta1.json +++ b/packages/google-cloud-securitycenter/samples/generated/v1beta1/snippet_metadata.google.cloud.securitycenter.v1beta1.json @@ -630,7 +630,7 @@ "segments": [ { "start": 25, - "end": 59, + "end": 66, "type": "FULL" } ], @@ -646,6 +646,10 @@ { "name": "policy", "type": ".google.iam.v1.Policy" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" } ], "resultType": ".google.iam.v1.Policy", diff --git a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.get_iam_policy.js b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.get_iam_policy.js index 728cb1ed0ff..712e4fe18d3 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.get_iam_policy.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.get_iam_policy.js @@ -32,7 +32,7 @@ function main(resource) { // const resource = 'abc123' /** * OPTIONAL: A `GetPolicyOptions` object for specifying options to - * `GetIamPolicy`. This field is only used by Cloud IAM. + * `GetIamPolicy`. */ // const options = {} diff --git a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.set_iam_policy.js b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.set_iam_policy.js index e9c4e89e4ef..637a16ea26d 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.set_iam_policy.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.set_iam_policy.js @@ -37,6 +37,13 @@ function main(resource, policy) { * might reject them. */ // const policy = {} + /** + * OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only + * the fields in the mask will be modified. If no mask is provided, the + * following default mask is used: + * `paths: "bindings, etag"` + */ + // const updateMask = {} // Imports the Securitycenter library const {SecurityCenterClient} = require('@google-cloud/security-center').v1p1beta1; diff --git a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/snippet_metadata.google.cloud.securitycenter.v1p1beta1.json b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/snippet_metadata.google.cloud.securitycenter.v1p1beta1.json index 6b0aa36eabd..27a6b4e30da 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/snippet_metadata.google.cloud.securitycenter.v1p1beta1.json +++ b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/snippet_metadata.google.cloud.securitycenter.v1p1beta1.json @@ -814,7 +814,7 @@ "segments": [ { "start": 25, - "end": 59, + "end": 66, "type": "FULL" } ], @@ -830,6 +830,10 @@ { "name": "policy", "type": ".google.iam.v1.Policy" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" } ], "resultType": ".google.iam.v1.Policy", diff --git a/packages/google-cloud-securitycenter/src/v1/security_center_client.ts b/packages/google-cloud-securitycenter/src/v1/security_center_client.ts index c0b057f44f2..10ad8b68da3 100644 --- a/packages/google-cloud-securitycenter/src/v1/security_center_client.ts +++ b/packages/google-cloud-securitycenter/src/v1/security_center_client.ts @@ -1235,7 +1235,7 @@ export class SecurityCenterClient { * See the operation documentation for the appropriate value for this field. * @param {google.iam.v1.GetPolicyOptions} request.options * OPTIONAL: A `GetPolicyOptions` object for specifying options to - * `GetIamPolicy`. This field is only used by Cloud IAM. + * `GetIamPolicy`. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -1901,6 +1901,12 @@ export class SecurityCenterClient { * the policy is limited to a few 10s of KB. An empty policy is a * valid policy but certain Cloud Platform services (such as Projects) * might reject them. + * @param {google.protobuf.FieldMask} request.updateMask + * OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only + * the fields in the mask will be modified. If no mask is provided, the + * following default mask is used: + * + * `paths: "bindings, etag"` * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. diff --git a/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.ts b/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.ts index cc3fb50996a..4f0c0587188 100644 --- a/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.ts +++ b/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.ts @@ -620,7 +620,7 @@ export class SecurityCenterClient { * See the operation documentation for the appropriate value for this field. * @param {google.iam.v1.GetPolicyOptions} request.options * OPTIONAL: A `GetPolicyOptions` object for specifying options to - * `GetIamPolicy`. This field is only used by Cloud IAM. + * `GetIamPolicy`. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -1008,6 +1008,12 @@ export class SecurityCenterClient { * the policy is limited to a few 10s of KB. An empty policy is a * valid policy but certain Cloud Platform services (such as Projects) * might reject them. + * @param {google.protobuf.FieldMask} request.updateMask + * OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only + * the fields in the mask will be modified. If no mask is provided, the + * following default mask is used: + * + * `paths: "bindings, etag"` * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. diff --git a/packages/google-cloud-securitycenter/src/v1p1beta1/security_center_client.ts b/packages/google-cloud-securitycenter/src/v1p1beta1/security_center_client.ts index 341ee5cc427..48d371cea5a 100644 --- a/packages/google-cloud-securitycenter/src/v1p1beta1/security_center_client.ts +++ b/packages/google-cloud-securitycenter/src/v1p1beta1/security_center_client.ts @@ -874,7 +874,7 @@ export class SecurityCenterClient { * See the operation documentation for the appropriate value for this field. * @param {google.iam.v1.GetPolicyOptions} request.options * OPTIONAL: A `GetPolicyOptions` object for specifying options to - * `GetIamPolicy`. This field is only used by Cloud IAM. + * `GetIamPolicy`. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -1366,6 +1366,12 @@ export class SecurityCenterClient { * the policy is limited to a few 10s of KB. An empty policy is a * valid policy but certain Cloud Platform services (such as Projects) * might reject them. + * @param {google.protobuf.FieldMask} request.updateMask + * OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only + * the fields in the mask will be modified. If no mask is provided, the + * following default mask is used: + * + * `paths: "bindings, etag"` * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. From e108758919163a7053a1ef551efc71572791a4ac Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 7 Apr 2022 08:22:35 -0700 Subject: [PATCH 307/342] feat: Add iam_binding field to findings attributes. It represents particular IAM bindings, which captures a member's role addition, removal, or state (#474) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: Add iam_binding field to findings attributes. It represents particular IAM bindings, which captures a member's role addition, removal, or state PiperOrigin-RevId: 439976914 Source-Link: https://github.com/googleapis/googleapis/commit/f83787ed5e7985e1eceefb56e5fb685dd8eaadf2 Source-Link: https://github.com/googleapis/googleapis-gen/commit/a4e583e31dda27c647f4865794349b3130c776bd Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYTRlNTgzZTMxZGRhMjdjNjQ3ZjQ4NjU3OTQzNDliMzEzMGM3NzZiZCJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot --- .../cloud/securitycenter/v1/access.proto | 2 +- .../securitycenter/v1/bigquery_export.proto | 16 +- .../securitycenter/v1/external_system.proto | 3 +- .../cloud/securitycenter/v1/finding.proto | 18 +- .../cloud/securitycenter/v1/iam_binding.proto | 52 ++ .../cloud/securitycenter/v1/indicator.proto | 3 +- .../securitycenter/v1/mitre_attack.proto | 4 + .../cloud/securitycenter/v1/resource.proto | 14 +- .../v1/securitycenter_service.proto | 16 +- .../protos/protos.d.ts | 169 ++++++- .../protos/protos.js | 458 +++++++++++++++--- .../protos/protos.json | 67 ++- .../security_center.update_security_marks.js | 2 +- .../src/v1/security_center_client.ts | 2 +- .../src/v1/security_center_proto_list.json | 1 + 15 files changed, 678 insertions(+), 149 deletions(-) create mode 100644 packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/iam_binding.proto diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/access.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/access.proto index 85c8d729400..e1b572471f1 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/access.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/access.proto @@ -16,11 +16,11 @@ syntax = "proto3"; package google.cloud.securitycenter.v1; +option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1;securitycenter"; option java_multiple_files = true; option java_outer_classname = "AccessProto"; option java_package = "com.google.cloud.securitycenter.v1"; -option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; option php_namespace = "Google\\Cloud\\SecurityCenter\\V1"; option ruby_package = "Google::Cloud::SecurityCenter::V1"; diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/bigquery_export.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/bigquery_export.proto index 51bf353ba83..850c66e5d03 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/bigquery_export.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/bigquery_export.proto @@ -81,21 +81,19 @@ message BigQueryExport { // Output only. The time at which the big query export was created. // This field is set by the server and will be ignored if provided on export // on creation. - google.protobuf.Timestamp create_time = 5 - [(google.api.field_behavior) = OUTPUT_ONLY]; + google.protobuf.Timestamp create_time = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; // Output only. The most recent time at which the big export was updated. // This field is set by the server and will be ignored if provided on export // creation or update. - google.protobuf.Timestamp update_time = 6 - [(google.api.field_behavior) = OUTPUT_ONLY]; + google.protobuf.Timestamp update_time = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; - // Output only. Email address of the user who last edited the big query - // export. This field is set by the server and will be ignored if provided on - // export creation or update. + // Output only. Email address of the user who last edited the big query export. + // This field is set by the server and will be ignored if provided on export + // creation or update. string most_recent_editor = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; - // Output only. The service account that needs permission to create table, - // upload data to the big query dataset. + // Output only. The service account that needs permission to create table, upload data to + // the big query dataset. string principal = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; } diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/external_system.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/external_system.proto index 78a7d65fea6..8ba698138da 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/external_system.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/external_system.proto @@ -37,7 +37,8 @@ message ExternalSystem { }; // External System Name e.g. jira, demisto, etc. - // e.g.: `organizations/1234/sources/5678/findings/123456/externalSystems/jira` + // e.g.: + // `organizations/1234/sources/5678/findings/123456/externalSystems/jira` // `folders/1234/sources/5678/findings/123456/externalSystems/jira` // `projects/1234/sources/5678/findings/123456/externalSystems/jira` string name = 1; diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/finding.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/finding.proto index 105b4d04b5c..c3154ae1bd8 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/finding.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/finding.proto @@ -20,6 +20,7 @@ import "google/api/field_behavior.proto"; import "google/api/resource.proto"; import "google/cloud/securitycenter/v1/access.proto"; import "google/cloud/securitycenter/v1/external_system.proto"; +import "google/cloud/securitycenter/v1/iam_binding.proto"; import "google/cloud/securitycenter/v1/indicator.proto"; import "google/cloud/securitycenter/v1/mitre_attack.proto"; import "google/cloud/securitycenter/v1/security_marks.proto"; @@ -110,7 +111,7 @@ message Finding { MEDIUM = 3; // Vulnerability: - // A low risk vulnerability hampers a security organization’s ability to + // A low risk vulnerability hampers a security organization's ability to // detect vulnerabilities or active threats in their deployment, or prevents // the root cause investigation of security issues. An example is monitoring // and logs being disabled for resource configurations and access. @@ -228,7 +229,7 @@ message Finding { // finding. string canonical_name = 14; - // Indicates the mute state of a finding (either unspecified, muted, unmuted + // Indicates the mute state of a finding (either muted, unmuted // or undefined). Unlike other attributes of a finding, a finding provider // shouldn't set the value of mute. Mute mute = 15; @@ -249,13 +250,11 @@ message Finding { Vulnerability vulnerability = 20; // Output only. The most recent time this finding was muted or unmuted. - google.protobuf.Timestamp mute_update_time = 21 - [(google.api.field_behavior) = OUTPUT_ONLY]; + google.protobuf.Timestamp mute_update_time = 21 [(google.api.field_behavior) = OUTPUT_ONLY]; - // Output only. Third party SIEM/SOAR fields within SCC, contains external - // system information and external system finding fields. - map external_systems = 22 - [(google.api.field_behavior) = OUTPUT_ONLY]; + // Output only. Third party SIEM/SOAR fields within SCC, contains external system + // information and external system finding fields. + map external_systems = 22 [(google.api.field_behavior) = OUTPUT_ONLY]; // MITRE ATT&CK tactics and techniques related to this finding. // See: https://attack.mitre.org @@ -270,4 +269,7 @@ message Finding { // finding, etc. Unlike other attributes of a finding, a finding provider // shouldn't set the value of mute. string mute_initiator = 28; + + // Represents IAM bindings associated with the Finding. + repeated IamBinding iam_bindings = 39; } diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/iam_binding.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/iam_binding.proto new file mode 100644 index 00000000000..c1e57a37382 --- /dev/null +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/iam_binding.proto @@ -0,0 +1,52 @@ +// 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.cloud.securitycenter.v1; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1;securitycenter"; +option java_multiple_files = true; +option java_outer_classname = "IamBindingProto"; +option java_package = "com.google.cloud.securitycenter.v1"; +option php_namespace = "Google\\Cloud\\SecurityCenter\\V1"; +option ruby_package = "Google::Cloud::SecurityCenter::V1"; + +// Represents a particular IAM binding, which captures a member's role addition, +// removal, or state. +message IamBinding { + // The type of action performed on a Binding in a policy. + enum Action { + // Unspecified. + ACTION_UNSPECIFIED = 0; + + // Addition of a Binding. + ADD = 1; + + // Removal of a Binding. + REMOVE = 2; + } + + // The action that was performed on a Binding. + Action action = 1; + + // Role that is assigned to "members". + // For example, "roles/viewer", "roles/editor", or "roles/owner". + string role = 2; + + // A single identity requesting access for a Cloud Platform resource, + // e.g. "foo@google.com". + string member = 3; +} diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/indicator.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/indicator.proto index 067ddb1638f..92234776447 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/indicator.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/indicator.proto @@ -16,15 +16,14 @@ syntax = "proto3"; package google.cloud.securitycenter.v1; +option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1;securitycenter"; option java_multiple_files = true; option java_outer_classname = "IndicatorProto"; option java_package = "com.google.cloud.securitycenter.v1"; -option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; option php_namespace = "Google\\Cloud\\SecurityCenter\\V1"; option ruby_package = "Google::Cloud::SecurityCenter::V1"; - // Represents what's commonly known as an Indicator of compromise (IoC) in // computer forensics. This is an artifact observed on a network or in an // operating system that, with high confidence, indicates a computer intrusion. diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/mitre_attack.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/mitre_attack.proto index 03767cac719..547f6f69220 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/mitre_attack.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/mitre_attack.proto @@ -78,6 +78,7 @@ message MitreAttack { // MITRE ATT&CK techniques that can be referenced by SCC findings. // See: https://attack.mitre.org/techniques/enterprise/ + // Next ID: 30 enum Technique { // Unspecified value. TECHNIQUE_UNSPECIFIED = 0; @@ -165,6 +166,9 @@ message MitreAttack { // T1556 MODIFY_AUTHENTICATION_PROCESS = 28; + + // T1485 + DATA_DESTRUCTION = 29; } // The MITRE ATT&CK tactic most closely represented by this finding, if any. diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/resource.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/resource.proto index 46b8372f34c..ab241d8bf3f 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/resource.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/resource.proto @@ -33,10 +33,16 @@ message Resource { // https://cloud.google.com/apis/design/resource_names#full_resource_name string name = 1; + // The human readable name of the resource. + string display_name = 8; + + // The full resource type of the resource. + string type = 6; + // The full resource name of project that the resource belongs to. string project = 2; - // The project id that the resource belongs to. + // The project ID that the resource belongs to. string project_display_name = 3; // The full resource name of resource's parent. @@ -45,14 +51,8 @@ message Resource { // The human readable name of resource's parent. string parent_display_name = 5; - // The full resource type of the resource. - string type = 6; - // Output only. Contains a Folder message for each folder in the assets ancestry. // The first folder is the deepest nested folder, and the last folder is the // folder directly under the Organization. repeated Folder folders = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // The human readable name of the resource. - string display_name = 8; } diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/securitycenter_service.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/securitycenter_service.proto index 99aa8adab0c..a95f5c037e4 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/securitycenter_service.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/securitycenter_service.proto @@ -1574,10 +1574,16 @@ message ListFindingsResponse { // https://cloud.google.com/apis/design/resource_names#full_resource_name string name = 1; + // The human readable name of the resource. + string display_name = 8; + + // The full resource type of the resource. + string type = 6; + // The full resource name of project that the resource belongs to. string project_name = 2; - // The project id that the resource belongs to. + // The project ID that the resource belongs to. string project_display_name = 3; // The full resource name of resource's parent. @@ -1586,16 +1592,10 @@ message ListFindingsResponse { // The human readable name of resource's parent. string parent_display_name = 5; - // The full resource type of the resource. - string type = 6; - // Contains a Folder message for each folder in the assets ancestry. // The first folder is the deepest nested folder, and the last folder is // the folder directly under the Organization. repeated Folder folders = 7; - - // The human readable name of the resource. - string display_name = 8; } // Finding matching the search request. @@ -1765,7 +1765,7 @@ message UpdateSecurityMarksRequest { // The time at which the updated SecurityMarks take effect. // If not set uses current server time. Updates will be applied to the // SecurityMarks that are active immediately preceding this time. Must be - // smaller or equal to the server time. + // earlier or equal to the server time. google.protobuf.Timestamp start_time = 3; } diff --git a/packages/google-cloud-securitycenter/protos/protos.d.ts b/packages/google-cloud-securitycenter/protos/protos.d.ts index 3848123a19a..47725c3e3c3 100644 --- a/packages/google-cloud-securitycenter/protos/protos.d.ts +++ b/packages/google-cloud-securitycenter/protos/protos.d.ts @@ -1108,6 +1108,9 @@ export namespace google { /** Finding muteInitiator */ muteInitiator?: (string|null); + + /** Finding iamBindings */ + iamBindings?: (google.cloud.securitycenter.v1.IIamBinding[]|null); } /** Represents a Finding. */ @@ -1182,6 +1185,9 @@ export namespace google { /** Finding muteInitiator. */ public muteInitiator: string; + /** Finding iamBindings. */ + public iamBindings: google.cloud.securitycenter.v1.IIamBinding[]; + /** * Creates a new Finding instance using the specified properties. * @param [properties] Properties to set @@ -1290,6 +1296,118 @@ export namespace google { } } + /** Properties of an IamBinding. */ + interface IIamBinding { + + /** IamBinding action */ + action?: (google.cloud.securitycenter.v1.IamBinding.Action|keyof typeof google.cloud.securitycenter.v1.IamBinding.Action|null); + + /** IamBinding role */ + role?: (string|null); + + /** IamBinding member */ + member?: (string|null); + } + + /** Represents an IamBinding. */ + class IamBinding implements IIamBinding { + + /** + * Constructs a new IamBinding. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IIamBinding); + + /** IamBinding action. */ + public action: (google.cloud.securitycenter.v1.IamBinding.Action|keyof typeof google.cloud.securitycenter.v1.IamBinding.Action); + + /** IamBinding role. */ + public role: string; + + /** IamBinding member. */ + public member: string; + + /** + * Creates a new IamBinding instance using the specified properties. + * @param [properties] Properties to set + * @returns IamBinding instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IIamBinding): google.cloud.securitycenter.v1.IamBinding; + + /** + * Encodes the specified IamBinding message. Does not implicitly {@link google.cloud.securitycenter.v1.IamBinding.verify|verify} messages. + * @param message IamBinding message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IIamBinding, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified IamBinding message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.IamBinding.verify|verify} messages. + * @param message IamBinding message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IIamBinding, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an IamBinding message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns IamBinding + * @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.cloud.securitycenter.v1.IamBinding; + + /** + * Decodes an IamBinding message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns IamBinding + * @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.cloud.securitycenter.v1.IamBinding; + + /** + * Verifies an IamBinding 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 IamBinding message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns IamBinding + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.IamBinding; + + /** + * Creates a plain object from an IamBinding message. Also converts values to other types if specified. + * @param message IamBinding + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.IamBinding, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this IamBinding to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace IamBinding { + + /** Action enum. */ + enum Action { + ACTION_UNSPECIFIED = 0, + ADD = 1, + REMOVE = 2 + } + } + /** Properties of an Indicator. */ interface IIndicator { @@ -1551,7 +1669,8 @@ export namespace google { STEAL_WEB_SESSION_COOKIE = 25, MODIFY_CLOUD_COMPUTE_INFRASTRUCTURE = 26, EXPLOIT_PUBLIC_FACING_APPLICATION = 27, - MODIFY_AUTHENTICATION_PROCESS = 28 + MODIFY_AUTHENTICATION_PROCESS = 28, + DATA_DESTRUCTION = 29 } } @@ -2483,6 +2602,12 @@ export namespace google { /** Resource name */ name?: (string|null); + /** Resource displayName */ + displayName?: (string|null); + + /** Resource type */ + type?: (string|null); + /** Resource project */ project?: (string|null); @@ -2495,14 +2620,8 @@ export namespace google { /** Resource parentDisplayName */ parentDisplayName?: (string|null); - /** Resource type */ - type?: (string|null); - /** Resource folders */ folders?: (google.cloud.securitycenter.v1.IFolder[]|null); - - /** Resource displayName */ - displayName?: (string|null); } /** Represents a Resource. */ @@ -2517,6 +2636,12 @@ export namespace google { /** Resource name. */ public name: string; + /** Resource displayName. */ + public displayName: string; + + /** Resource type. */ + public type: string; + /** Resource project. */ public project: string; @@ -2529,15 +2654,9 @@ export namespace google { /** Resource parentDisplayName. */ public parentDisplayName: string; - /** Resource type. */ - public type: string; - /** Resource folders. */ public folders: google.cloud.securitycenter.v1.IFolder[]; - /** Resource displayName. */ - public displayName: string; - /** * Creates a new Resource instance using the specified properties. * @param [properties] Properties to set @@ -6800,6 +6919,12 @@ export namespace google { /** Resource name */ name?: (string|null); + /** Resource displayName */ + displayName?: (string|null); + + /** Resource type */ + type?: (string|null); + /** Resource projectName */ projectName?: (string|null); @@ -6812,14 +6937,8 @@ export namespace google { /** Resource parentDisplayName */ parentDisplayName?: (string|null); - /** Resource type */ - type?: (string|null); - /** Resource folders */ folders?: (google.cloud.securitycenter.v1.IFolder[]|null); - - /** Resource displayName */ - displayName?: (string|null); } /** Represents a Resource. */ @@ -6834,6 +6953,12 @@ export namespace google { /** Resource name. */ public name: string; + /** Resource displayName. */ + public displayName: string; + + /** Resource type. */ + public type: string; + /** Resource projectName. */ public projectName: string; @@ -6846,15 +6971,9 @@ export namespace google { /** Resource parentDisplayName. */ public parentDisplayName: string; - /** Resource type. */ - public type: string; - /** Resource folders. */ public folders: google.cloud.securitycenter.v1.IFolder[]; - /** Resource displayName. */ - public displayName: string; - /** * Creates a new Resource instance using the specified properties. * @param [properties] Properties to set diff --git a/packages/google-cloud-securitycenter/protos/protos.js b/packages/google-cloud-securitycenter/protos/protos.js index bd202f7fbf8..93a50762e05 100644 --- a/packages/google-cloud-securitycenter/protos/protos.js +++ b/packages/google-cloud-securitycenter/protos/protos.js @@ -2711,6 +2711,7 @@ * @property {google.cloud.securitycenter.v1.IMitreAttack|null} [mitreAttack] Finding mitreAttack * @property {google.cloud.securitycenter.v1.IAccess|null} [access] Finding access * @property {string|null} [muteInitiator] Finding muteInitiator + * @property {Array.|null} [iamBindings] Finding iamBindings */ /** @@ -2724,6 +2725,7 @@ function Finding(properties) { this.sourceProperties = {}; this.externalSystems = {}; + this.iamBindings = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -2898,6 +2900,14 @@ */ Finding.prototype.muteInitiator = ""; + /** + * Finding iamBindings. + * @member {Array.} iamBindings + * @memberof google.cloud.securitycenter.v1.Finding + * @instance + */ + Finding.prototype.iamBindings = $util.emptyArray; + /** * Creates a new Finding instance using the specified properties. * @function create @@ -2970,6 +2980,9 @@ $root.google.cloud.securitycenter.v1.Access.encode(message.access, writer.uint32(/* id 26, wireType 2 =*/210).fork()).ldelim(); if (message.muteInitiator != null && Object.hasOwnProperty.call(message, "muteInitiator")) writer.uint32(/* id 28, wireType 2 =*/226).string(message.muteInitiator); + if (message.iamBindings != null && message.iamBindings.length) + for (var i = 0; i < message.iamBindings.length; ++i) + $root.google.cloud.securitycenter.v1.IamBinding.encode(message.iamBindings[i], writer.uint32(/* id 39, wireType 2 =*/314).fork()).ldelim(); return writer; }; @@ -3105,6 +3118,11 @@ case 28: message.muteInitiator = reader.string(); break; + case 39: + if (!(message.iamBindings && message.iamBindings.length)) + message.iamBindings = []; + message.iamBindings.push($root.google.cloud.securitycenter.v1.IamBinding.decode(reader, reader.uint32())); + break; default: reader.skipType(tag & 7); break; @@ -3263,6 +3281,15 @@ if (message.muteInitiator != null && message.hasOwnProperty("muteInitiator")) if (!$util.isString(message.muteInitiator)) return "muteInitiator: string expected"; + if (message.iamBindings != null && message.hasOwnProperty("iamBindings")) { + if (!Array.isArray(message.iamBindings)) + return "iamBindings: array expected"; + for (var i = 0; i < message.iamBindings.length; ++i) { + var error = $root.google.cloud.securitycenter.v1.IamBinding.verify(message.iamBindings[i]); + if (error) + return "iamBindings." + error; + } + } return null; }; @@ -3432,6 +3459,16 @@ } if (object.muteInitiator != null) message.muteInitiator = String(object.muteInitiator); + if (object.iamBindings) { + if (!Array.isArray(object.iamBindings)) + throw TypeError(".google.cloud.securitycenter.v1.Finding.iamBindings: array expected"); + message.iamBindings = []; + for (var i = 0; i < object.iamBindings.length; ++i) { + if (typeof object.iamBindings[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Finding.iamBindings: object expected"); + message.iamBindings[i] = $root.google.cloud.securitycenter.v1.IamBinding.fromObject(object.iamBindings[i]); + } + } return message; }; @@ -3448,6 +3485,8 @@ if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) + object.iamBindings = []; if (options.objects || options.defaults) { object.sourceProperties = {}; object.externalSystems = {}; @@ -3522,6 +3561,11 @@ object.access = $root.google.cloud.securitycenter.v1.Access.toObject(message.access, options); if (message.muteInitiator != null && message.hasOwnProperty("muteInitiator")) object.muteInitiator = message.muteInitiator; + if (message.iamBindings && message.iamBindings.length) { + object.iamBindings = []; + for (var j = 0; j < message.iamBindings.length; ++j) + object.iamBindings[j] = $root.google.cloud.securitycenter.v1.IamBinding.toObject(message.iamBindings[j], options); + } return object; }; @@ -3615,6 +3659,272 @@ return Finding; })(); + v1.IamBinding = (function() { + + /** + * Properties of an IamBinding. + * @memberof google.cloud.securitycenter.v1 + * @interface IIamBinding + * @property {google.cloud.securitycenter.v1.IamBinding.Action|null} [action] IamBinding action + * @property {string|null} [role] IamBinding role + * @property {string|null} [member] IamBinding member + */ + + /** + * Constructs a new IamBinding. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents an IamBinding. + * @implements IIamBinding + * @constructor + * @param {google.cloud.securitycenter.v1.IIamBinding=} [properties] Properties to set + */ + function IamBinding(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]]; + } + + /** + * IamBinding action. + * @member {google.cloud.securitycenter.v1.IamBinding.Action} action + * @memberof google.cloud.securitycenter.v1.IamBinding + * @instance + */ + IamBinding.prototype.action = 0; + + /** + * IamBinding role. + * @member {string} role + * @memberof google.cloud.securitycenter.v1.IamBinding + * @instance + */ + IamBinding.prototype.role = ""; + + /** + * IamBinding member. + * @member {string} member + * @memberof google.cloud.securitycenter.v1.IamBinding + * @instance + */ + IamBinding.prototype.member = ""; + + /** + * Creates a new IamBinding instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.IamBinding + * @static + * @param {google.cloud.securitycenter.v1.IIamBinding=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.IamBinding} IamBinding instance + */ + IamBinding.create = function create(properties) { + return new IamBinding(properties); + }; + + /** + * Encodes the specified IamBinding message. Does not implicitly {@link google.cloud.securitycenter.v1.IamBinding.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.IamBinding + * @static + * @param {google.cloud.securitycenter.v1.IIamBinding} message IamBinding message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IamBinding.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.action != null && Object.hasOwnProperty.call(message, "action")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.action); + if (message.role != null && Object.hasOwnProperty.call(message, "role")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.role); + if (message.member != null && Object.hasOwnProperty.call(message, "member")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.member); + return writer; + }; + + /** + * Encodes the specified IamBinding message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.IamBinding.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.IamBinding + * @static + * @param {google.cloud.securitycenter.v1.IIamBinding} message IamBinding message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IamBinding.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an IamBinding message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.IamBinding + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.IamBinding} IamBinding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IamBinding.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.cloud.securitycenter.v1.IamBinding(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.action = reader.int32(); + break; + case 2: + message.role = reader.string(); + break; + case 3: + message.member = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an IamBinding message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.IamBinding + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.IamBinding} IamBinding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IamBinding.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an IamBinding message. + * @function verify + * @memberof google.cloud.securitycenter.v1.IamBinding + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IamBinding.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.action != null && message.hasOwnProperty("action")) + switch (message.action) { + default: + return "action: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.role != null && message.hasOwnProperty("role")) + if (!$util.isString(message.role)) + return "role: string expected"; + if (message.member != null && message.hasOwnProperty("member")) + if (!$util.isString(message.member)) + return "member: string expected"; + return null; + }; + + /** + * Creates an IamBinding message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.IamBinding + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.IamBinding} IamBinding + */ + IamBinding.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.IamBinding) + return object; + var message = new $root.google.cloud.securitycenter.v1.IamBinding(); + switch (object.action) { + case "ACTION_UNSPECIFIED": + case 0: + message.action = 0; + break; + case "ADD": + case 1: + message.action = 1; + break; + case "REMOVE": + case 2: + message.action = 2; + break; + } + if (object.role != null) + message.role = String(object.role); + if (object.member != null) + message.member = String(object.member); + return message; + }; + + /** + * Creates a plain object from an IamBinding message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.IamBinding + * @static + * @param {google.cloud.securitycenter.v1.IamBinding} message IamBinding + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IamBinding.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.action = options.enums === String ? "ACTION_UNSPECIFIED" : 0; + object.role = ""; + object.member = ""; + } + if (message.action != null && message.hasOwnProperty("action")) + object.action = options.enums === String ? $root.google.cloud.securitycenter.v1.IamBinding.Action[message.action] : message.action; + if (message.role != null && message.hasOwnProperty("role")) + object.role = message.role; + if (message.member != null && message.hasOwnProperty("member")) + object.member = message.member; + return object; + }; + + /** + * Converts this IamBinding to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.IamBinding + * @instance + * @returns {Object.} JSON object + */ + IamBinding.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Action enum. + * @name google.cloud.securitycenter.v1.IamBinding.Action + * @enum {number} + * @property {number} ACTION_UNSPECIFIED=0 ACTION_UNSPECIFIED value + * @property {number} ADD=1 ADD value + * @property {number} REMOVE=2 REMOVE value + */ + IamBinding.Action = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ACTION_UNSPECIFIED"] = 0; + values[valuesById[1] = "ADD"] = 1; + values[valuesById[2] = "REMOVE"] = 2; + return values; + })(); + + return IamBinding; + })(); + v1.Indicator = (function() { /** @@ -4136,6 +4446,7 @@ case 26: case 27: case 28: + case 29: break; } } @@ -4200,6 +4511,7 @@ case 26: case 27: case 28: + case 29: break; } } @@ -4406,6 +4718,10 @@ case 28: message.primaryTechniques[i] = 28; break; + case "DATA_DESTRUCTION": + case 29: + message.primaryTechniques[i] = 29; + break; } } if (object.additionalTactics) { @@ -4600,6 +4916,10 @@ case 28: message.additionalTechniques[i] = 28; break; + case "DATA_DESTRUCTION": + case 29: + message.additionalTechniques[i] = 29; + break; } } if (object.version != null) @@ -4735,6 +5055,7 @@ * @property {number} MODIFY_CLOUD_COMPUTE_INFRASTRUCTURE=26 MODIFY_CLOUD_COMPUTE_INFRASTRUCTURE value * @property {number} EXPLOIT_PUBLIC_FACING_APPLICATION=27 EXPLOIT_PUBLIC_FACING_APPLICATION value * @property {number} MODIFY_AUTHENTICATION_PROCESS=28 MODIFY_AUTHENTICATION_PROCESS value + * @property {number} DATA_DESTRUCTION=29 DATA_DESTRUCTION value */ MitreAttack.Technique = (function() { var valuesById = {}, values = Object.create(valuesById); @@ -4767,6 +5088,7 @@ values[valuesById[26] = "MODIFY_CLOUD_COMPUTE_INFRASTRUCTURE"] = 26; values[valuesById[27] = "EXPLOIT_PUBLIC_FACING_APPLICATION"] = 27; values[valuesById[28] = "MODIFY_AUTHENTICATION_PROCESS"] = 28; + values[valuesById[29] = "DATA_DESTRUCTION"] = 29; return values; })(); @@ -7185,13 +7507,13 @@ * @memberof google.cloud.securitycenter.v1 * @interface IResource * @property {string|null} [name] Resource name + * @property {string|null} [displayName] Resource displayName + * @property {string|null} [type] Resource type * @property {string|null} [project] Resource project * @property {string|null} [projectDisplayName] Resource projectDisplayName * @property {string|null} [parent] Resource parent * @property {string|null} [parentDisplayName] Resource parentDisplayName - * @property {string|null} [type] Resource type * @property {Array.|null} [folders] Resource folders - * @property {string|null} [displayName] Resource displayName */ /** @@ -7218,6 +7540,22 @@ */ Resource.prototype.name = ""; + /** + * Resource displayName. + * @member {string} displayName + * @memberof google.cloud.securitycenter.v1.Resource + * @instance + */ + Resource.prototype.displayName = ""; + + /** + * Resource type. + * @member {string} type + * @memberof google.cloud.securitycenter.v1.Resource + * @instance + */ + Resource.prototype.type = ""; + /** * Resource project. * @member {string} project @@ -7250,14 +7588,6 @@ */ Resource.prototype.parentDisplayName = ""; - /** - * Resource type. - * @member {string} type - * @memberof google.cloud.securitycenter.v1.Resource - * @instance - */ - Resource.prototype.type = ""; - /** * Resource folders. * @member {Array.} folders @@ -7266,14 +7596,6 @@ */ Resource.prototype.folders = $util.emptyArray; - /** - * Resource displayName. - * @member {string} displayName - * @memberof google.cloud.securitycenter.v1.Resource - * @instance - */ - Resource.prototype.displayName = ""; - /** * Creates a new Resource instance using the specified properties. * @function create @@ -7352,6 +7674,12 @@ case 1: message.name = reader.string(); break; + case 8: + message.displayName = reader.string(); + break; + case 6: + message.type = reader.string(); + break; case 2: message.project = reader.string(); break; @@ -7364,17 +7692,11 @@ case 5: message.parentDisplayName = reader.string(); break; - case 6: - message.type = reader.string(); - break; case 7: if (!(message.folders && message.folders.length)) message.folders = []; message.folders.push($root.google.cloud.securitycenter.v1.Folder.decode(reader, reader.uint32())); break; - case 8: - message.displayName = reader.string(); - break; default: reader.skipType(tag & 7); break; @@ -7413,6 +7735,12 @@ if (message.name != null && message.hasOwnProperty("name")) if (!$util.isString(message.name)) return "name: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; if (message.project != null && message.hasOwnProperty("project")) if (!$util.isString(message.project)) return "project: string expected"; @@ -7425,9 +7753,6 @@ if (message.parentDisplayName != null && message.hasOwnProperty("parentDisplayName")) if (!$util.isString(message.parentDisplayName)) return "parentDisplayName: string expected"; - if (message.type != null && message.hasOwnProperty("type")) - if (!$util.isString(message.type)) - return "type: string expected"; if (message.folders != null && message.hasOwnProperty("folders")) { if (!Array.isArray(message.folders)) return "folders: array expected"; @@ -7437,9 +7762,6 @@ return "folders." + error; } } - if (message.displayName != null && message.hasOwnProperty("displayName")) - if (!$util.isString(message.displayName)) - return "displayName: string expected"; return null; }; @@ -7457,6 +7779,10 @@ var message = new $root.google.cloud.securitycenter.v1.Resource(); if (object.name != null) message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.type != null) + message.type = String(object.type); if (object.project != null) message.project = String(object.project); if (object.projectDisplayName != null) @@ -7465,8 +7791,6 @@ message.parent = String(object.parent); if (object.parentDisplayName != null) message.parentDisplayName = String(object.parentDisplayName); - if (object.type != null) - message.type = String(object.type); if (object.folders) { if (!Array.isArray(object.folders)) throw TypeError(".google.cloud.securitycenter.v1.Resource.folders: array expected"); @@ -7477,8 +7801,6 @@ message.folders[i] = $root.google.cloud.securitycenter.v1.Folder.fromObject(object.folders[i]); } } - if (object.displayName != null) - message.displayName = String(object.displayName); return message; }; @@ -16884,13 +17206,13 @@ * @memberof google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult * @interface IResource * @property {string|null} [name] Resource name + * @property {string|null} [displayName] Resource displayName + * @property {string|null} [type] Resource type * @property {string|null} [projectName] Resource projectName * @property {string|null} [projectDisplayName] Resource projectDisplayName * @property {string|null} [parentName] Resource parentName * @property {string|null} [parentDisplayName] Resource parentDisplayName - * @property {string|null} [type] Resource type * @property {Array.|null} [folders] Resource folders - * @property {string|null} [displayName] Resource displayName */ /** @@ -16917,6 +17239,22 @@ */ Resource.prototype.name = ""; + /** + * Resource displayName. + * @member {string} displayName + * @memberof google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource + * @instance + */ + Resource.prototype.displayName = ""; + + /** + * Resource type. + * @member {string} type + * @memberof google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource + * @instance + */ + Resource.prototype.type = ""; + /** * Resource projectName. * @member {string} projectName @@ -16949,14 +17287,6 @@ */ Resource.prototype.parentDisplayName = ""; - /** - * Resource type. - * @member {string} type - * @memberof google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource - * @instance - */ - Resource.prototype.type = ""; - /** * Resource folders. * @member {Array.} folders @@ -16965,14 +17295,6 @@ */ Resource.prototype.folders = $util.emptyArray; - /** - * Resource displayName. - * @member {string} displayName - * @memberof google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource - * @instance - */ - Resource.prototype.displayName = ""; - /** * Creates a new Resource instance using the specified properties. * @function create @@ -17051,6 +17373,12 @@ case 1: message.name = reader.string(); break; + case 8: + message.displayName = reader.string(); + break; + case 6: + message.type = reader.string(); + break; case 2: message.projectName = reader.string(); break; @@ -17063,17 +17391,11 @@ case 5: message.parentDisplayName = reader.string(); break; - case 6: - message.type = reader.string(); - break; case 7: if (!(message.folders && message.folders.length)) message.folders = []; message.folders.push($root.google.cloud.securitycenter.v1.Folder.decode(reader, reader.uint32())); break; - case 8: - message.displayName = reader.string(); - break; default: reader.skipType(tag & 7); break; @@ -17112,6 +17434,12 @@ if (message.name != null && message.hasOwnProperty("name")) if (!$util.isString(message.name)) return "name: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; if (message.projectName != null && message.hasOwnProperty("projectName")) if (!$util.isString(message.projectName)) return "projectName: string expected"; @@ -17124,9 +17452,6 @@ if (message.parentDisplayName != null && message.hasOwnProperty("parentDisplayName")) if (!$util.isString(message.parentDisplayName)) return "parentDisplayName: string expected"; - if (message.type != null && message.hasOwnProperty("type")) - if (!$util.isString(message.type)) - return "type: string expected"; if (message.folders != null && message.hasOwnProperty("folders")) { if (!Array.isArray(message.folders)) return "folders: array expected"; @@ -17136,9 +17461,6 @@ return "folders." + error; } } - if (message.displayName != null && message.hasOwnProperty("displayName")) - if (!$util.isString(message.displayName)) - return "displayName: string expected"; return null; }; @@ -17156,6 +17478,10 @@ var message = new $root.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource(); if (object.name != null) message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.type != null) + message.type = String(object.type); if (object.projectName != null) message.projectName = String(object.projectName); if (object.projectDisplayName != null) @@ -17164,8 +17490,6 @@ message.parentName = String(object.parentName); if (object.parentDisplayName != null) message.parentDisplayName = String(object.parentDisplayName); - if (object.type != null) - message.type = String(object.type); if (object.folders) { if (!Array.isArray(object.folders)) throw TypeError(".google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource.folders: array expected"); @@ -17176,8 +17500,6 @@ message.folders[i] = $root.google.cloud.securitycenter.v1.Folder.fromObject(object.folders[i]); } } - if (object.displayName != null) - message.displayName = String(object.displayName); return message; }; diff --git a/packages/google-cloud-securitycenter/protos/protos.json b/packages/google-cloud-securitycenter/protos/protos.json index fa20a22b37e..0f008793f73 100644 --- a/packages/google-cloud-securitycenter/protos/protos.json +++ b/packages/google-cloud-securitycenter/protos/protos.json @@ -8,11 +8,11 @@ "nested": { "v1": { "options": { + "csharp_namespace": "Google.Cloud.SecurityCenter.V1", "go_package": "google.golang.org/genproto/googleapis/cloud/securitycenter/v1;securitycenter", "java_multiple_files": true, "java_outer_classname": "ResourceProto", "java_package": "com.google.cloud.securitycenter.v1", - "csharp_namespace": "Google.Cloud.SecurityCenter.V1", "php_namespace": "Google\\Cloud\\SecurityCenter\\V1", "ruby_package": "Google::Cloud::SecurityCenter::V1", "(google.api.resource_definition).type": "pubsub.googleapis.com/Topic", @@ -362,6 +362,11 @@ "muteInitiator": { "type": "string", "id": 28 + }, + "iamBindings": { + "rule": "repeated", + "type": "IamBinding", + "id": 39 } }, "nested": { @@ -401,6 +406,31 @@ } } }, + "IamBinding": { + "fields": { + "action": { + "type": "Action", + "id": 1 + }, + "role": { + "type": "string", + "id": 2 + }, + "member": { + "type": "string", + "id": 3 + } + }, + "nested": { + "Action": { + "values": { + "ACTION_UNSPECIFIED": 0, + "ADD": 1, + "REMOVE": 2 + } + } + } + }, "Indicator": { "fields": { "ipAddresses": { @@ -491,7 +521,8 @@ "STEAL_WEB_SESSION_COOKIE": 25, "MODIFY_CLOUD_COMPUTE_INFRASTRUCTURE": 26, "EXPLOIT_PUBLIC_FACING_APPLICATION": 27, - "MODIFY_AUTHENTICATION_PROCESS": 28 + "MODIFY_AUTHENTICATION_PROCESS": 28, + "DATA_DESTRUCTION": 29 } } } @@ -756,6 +787,14 @@ "type": "string", "id": 1 }, + "displayName": { + "type": "string", + "id": 8 + }, + "type": { + "type": "string", + "id": 6 + }, "project": { "type": "string", "id": 2 @@ -772,10 +811,6 @@ "type": "string", "id": 5 }, - "type": { - "type": "string", - "id": 6 - }, "folders": { "rule": "repeated", "type": "Folder", @@ -783,10 +818,6 @@ "options": { "(google.api.field_behavior)": "OUTPUT_ONLY" } - }, - "displayName": { - "type": "string", - "id": 8 } } }, @@ -2430,6 +2461,14 @@ "type": "string", "id": 1 }, + "displayName": { + "type": "string", + "id": 8 + }, + "type": { + "type": "string", + "id": 6 + }, "projectName": { "type": "string", "id": 2 @@ -2446,18 +2485,10 @@ "type": "string", "id": 5 }, - "type": { - "type": "string", - "id": 6 - }, "folders": { "rule": "repeated", "type": "Folder", "id": 7 - }, - "displayName": { - "type": "string", - "id": 8 } } } diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_security_marks.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_security_marks.js index 9827fb86fde..3f19fca7f63 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_security_marks.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_security_marks.js @@ -40,7 +40,7 @@ function main(securityMarks) { * The time at which the updated SecurityMarks take effect. * If not set uses current server time. Updates will be applied to the * SecurityMarks that are active immediately preceding this time. Must be - * smaller or equal to the server time. + * earlier or equal to the server time. */ // const startTime = {} diff --git a/packages/google-cloud-securitycenter/src/v1/security_center_client.ts b/packages/google-cloud-securitycenter/src/v1/security_center_client.ts index 10ad8b68da3..85e45f8e23b 100644 --- a/packages/google-cloud-securitycenter/src/v1/security_center_client.ts +++ b/packages/google-cloud-securitycenter/src/v1/security_center_client.ts @@ -2702,7 +2702,7 @@ export class SecurityCenterClient { * The time at which the updated SecurityMarks take effect. * If not set uses current server time. Updates will be applied to the * SecurityMarks that are active immediately preceding this time. Must be - * smaller or equal to the server time. + * earlier or equal to the server time. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. diff --git a/packages/google-cloud-securitycenter/src/v1/security_center_proto_list.json b/packages/google-cloud-securitycenter/src/v1/security_center_proto_list.json index 380ca1bb172..db5193d0728 100644 --- a/packages/google-cloud-securitycenter/src/v1/security_center_proto_list.json +++ b/packages/google-cloud-securitycenter/src/v1/security_center_proto_list.json @@ -5,6 +5,7 @@ "../../protos/google/cloud/securitycenter/v1/external_system.proto", "../../protos/google/cloud/securitycenter/v1/finding.proto", "../../protos/google/cloud/securitycenter/v1/folder.proto", + "../../protos/google/cloud/securitycenter/v1/iam_binding.proto", "../../protos/google/cloud/securitycenter/v1/indicator.proto", "../../protos/google/cloud/securitycenter/v1/mitre_attack.proto", "../../protos/google/cloud/securitycenter/v1/mute_config.proto", From 1dbb579f3006872e72c5e0cce1826779129eb082 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Mon, 11 Apr 2022 16:08:16 -0400 Subject: [PATCH 308/342] feat: Add next_steps field to finding's list of attributes (#476) PiperOrigin-RevId: 440383959 Source-Link: https://github.com/googleapis/googleapis/commit/6a276f6af8e0c2d98084249fd9dadd531c789ec4 Source-Link: https://github.com/googleapis/googleapis-gen/commit/f94fc64061837033bab88c65075e1814edb6133a Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZjk0ZmM2NDA2MTgzNzAzM2JhYjg4YzY1MDc1ZTE4MTRlZGI2MTMzYSJ9 See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot --- .../cloud/securitycenter/v1/finding.proto | 3 ++ .../securitycenter/v1/mitre_attack.proto | 5 ++- .../protos/protos.d.ts | 9 ++++- .../protos/protos.js | 34 +++++++++++++++++++ .../protos/protos.json | 7 +++- 5 files changed, 55 insertions(+), 3 deletions(-) diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/finding.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/finding.proto index c3154ae1bd8..787c35cae47 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/finding.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/finding.proto @@ -272,4 +272,7 @@ message Finding { // Represents IAM bindings associated with the Finding. repeated IamBinding iam_bindings = 39; + + // Next steps associate to the finding. + string next_steps = 40; } diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/mitre_attack.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/mitre_attack.proto index 547f6f69220..bb315d5f2da 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/mitre_attack.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/mitre_attack.proto @@ -78,7 +78,7 @@ message MitreAttack { // MITRE ATT&CK techniques that can be referenced by SCC findings. // See: https://attack.mitre.org/techniques/enterprise/ - // Next ID: 30 + // Next ID: 31 enum Technique { // Unspecified value. TECHNIQUE_UNSPECIFIED = 0; @@ -169,6 +169,9 @@ message MitreAttack { // T1485 DATA_DESTRUCTION = 29; + + // T1484 + DOMAIN_POLICY_MODIFICATION = 30; } // The MITRE ATT&CK tactic most closely represented by this finding, if any. diff --git a/packages/google-cloud-securitycenter/protos/protos.d.ts b/packages/google-cloud-securitycenter/protos/protos.d.ts index 47725c3e3c3..21f54e5ab42 100644 --- a/packages/google-cloud-securitycenter/protos/protos.d.ts +++ b/packages/google-cloud-securitycenter/protos/protos.d.ts @@ -1111,6 +1111,9 @@ export namespace google { /** Finding iamBindings */ iamBindings?: (google.cloud.securitycenter.v1.IIamBinding[]|null); + + /** Finding nextSteps */ + nextSteps?: (string|null); } /** Represents a Finding. */ @@ -1188,6 +1191,9 @@ export namespace google { /** Finding iamBindings. */ public iamBindings: google.cloud.securitycenter.v1.IIamBinding[]; + /** Finding nextSteps. */ + public nextSteps: string; + /** * Creates a new Finding instance using the specified properties. * @param [properties] Properties to set @@ -1670,7 +1676,8 @@ export namespace google { MODIFY_CLOUD_COMPUTE_INFRASTRUCTURE = 26, EXPLOIT_PUBLIC_FACING_APPLICATION = 27, MODIFY_AUTHENTICATION_PROCESS = 28, - DATA_DESTRUCTION = 29 + DATA_DESTRUCTION = 29, + DOMAIN_POLICY_MODIFICATION = 30 } } diff --git a/packages/google-cloud-securitycenter/protos/protos.js b/packages/google-cloud-securitycenter/protos/protos.js index 93a50762e05..3beedb2478d 100644 --- a/packages/google-cloud-securitycenter/protos/protos.js +++ b/packages/google-cloud-securitycenter/protos/protos.js @@ -2712,6 +2712,7 @@ * @property {google.cloud.securitycenter.v1.IAccess|null} [access] Finding access * @property {string|null} [muteInitiator] Finding muteInitiator * @property {Array.|null} [iamBindings] Finding iamBindings + * @property {string|null} [nextSteps] Finding nextSteps */ /** @@ -2908,6 +2909,14 @@ */ Finding.prototype.iamBindings = $util.emptyArray; + /** + * Finding nextSteps. + * @member {string} nextSteps + * @memberof google.cloud.securitycenter.v1.Finding + * @instance + */ + Finding.prototype.nextSteps = ""; + /** * Creates a new Finding instance using the specified properties. * @function create @@ -2983,6 +2992,8 @@ if (message.iamBindings != null && message.iamBindings.length) for (var i = 0; i < message.iamBindings.length; ++i) $root.google.cloud.securitycenter.v1.IamBinding.encode(message.iamBindings[i], writer.uint32(/* id 39, wireType 2 =*/314).fork()).ldelim(); + if (message.nextSteps != null && Object.hasOwnProperty.call(message, "nextSteps")) + writer.uint32(/* id 40, wireType 2 =*/322).string(message.nextSteps); return writer; }; @@ -3123,6 +3134,9 @@ message.iamBindings = []; message.iamBindings.push($root.google.cloud.securitycenter.v1.IamBinding.decode(reader, reader.uint32())); break; + case 40: + message.nextSteps = reader.string(); + break; default: reader.skipType(tag & 7); break; @@ -3290,6 +3304,9 @@ return "iamBindings." + error; } } + if (message.nextSteps != null && message.hasOwnProperty("nextSteps")) + if (!$util.isString(message.nextSteps)) + return "nextSteps: string expected"; return null; }; @@ -3469,6 +3486,8 @@ message.iamBindings[i] = $root.google.cloud.securitycenter.v1.IamBinding.fromObject(object.iamBindings[i]); } } + if (object.nextSteps != null) + message.nextSteps = String(object.nextSteps); return message; }; @@ -3511,6 +3530,7 @@ object.mitreAttack = null; object.access = null; object.muteInitiator = ""; + object.nextSteps = ""; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -3566,6 +3586,8 @@ for (var j = 0; j < message.iamBindings.length; ++j) object.iamBindings[j] = $root.google.cloud.securitycenter.v1.IamBinding.toObject(message.iamBindings[j], options); } + if (message.nextSteps != null && message.hasOwnProperty("nextSteps")) + object.nextSteps = message.nextSteps; return object; }; @@ -4447,6 +4469,7 @@ case 27: case 28: case 29: + case 30: break; } } @@ -4512,6 +4535,7 @@ case 27: case 28: case 29: + case 30: break; } } @@ -4722,6 +4746,10 @@ case 29: message.primaryTechniques[i] = 29; break; + case "DOMAIN_POLICY_MODIFICATION": + case 30: + message.primaryTechniques[i] = 30; + break; } } if (object.additionalTactics) { @@ -4920,6 +4948,10 @@ case 29: message.additionalTechniques[i] = 29; break; + case "DOMAIN_POLICY_MODIFICATION": + case 30: + message.additionalTechniques[i] = 30; + break; } } if (object.version != null) @@ -5056,6 +5088,7 @@ * @property {number} EXPLOIT_PUBLIC_FACING_APPLICATION=27 EXPLOIT_PUBLIC_FACING_APPLICATION value * @property {number} MODIFY_AUTHENTICATION_PROCESS=28 MODIFY_AUTHENTICATION_PROCESS value * @property {number} DATA_DESTRUCTION=29 DATA_DESTRUCTION value + * @property {number} DOMAIN_POLICY_MODIFICATION=30 DOMAIN_POLICY_MODIFICATION value */ MitreAttack.Technique = (function() { var valuesById = {}, values = Object.create(valuesById); @@ -5089,6 +5122,7 @@ values[valuesById[27] = "EXPLOIT_PUBLIC_FACING_APPLICATION"] = 27; values[valuesById[28] = "MODIFY_AUTHENTICATION_PROCESS"] = 28; values[valuesById[29] = "DATA_DESTRUCTION"] = 29; + values[valuesById[30] = "DOMAIN_POLICY_MODIFICATION"] = 30; return values; })(); diff --git a/packages/google-cloud-securitycenter/protos/protos.json b/packages/google-cloud-securitycenter/protos/protos.json index 0f008793f73..6d78c35d5f7 100644 --- a/packages/google-cloud-securitycenter/protos/protos.json +++ b/packages/google-cloud-securitycenter/protos/protos.json @@ -367,6 +367,10 @@ "rule": "repeated", "type": "IamBinding", "id": 39 + }, + "nextSteps": { + "type": "string", + "id": 40 } }, "nested": { @@ -522,7 +526,8 @@ "MODIFY_CLOUD_COMPUTE_INFRASTRUCTURE": 26, "EXPLOIT_PUBLIC_FACING_APPLICATION": 27, "MODIFY_AUTHENTICATION_PROCESS": 28, - "DATA_DESTRUCTION": 29 + "DATA_DESTRUCTION": 29, + "DOMAIN_POLICY_MODIFICATION": 30 } } } From 77f24ae599d66f83224f0c50fc03eced1ddce22f Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Mon, 11 Apr 2022 20:28:15 +0000 Subject: [PATCH 309/342] chore(main): release 5.10.0 (#471) :robot: I have created a release *beep* *boop* --- ## [5.10.0](https://github.com/googleapis/nodejs-security-center/compare/v5.9.0...v5.10.0) (2022-04-11) ### Features * Add iam_binding field to findings attributes. It represents particular IAM bindings, which captures a member's role addition, removal, or state ([#474](https://github.com/googleapis/nodejs-security-center/issues/474)) ([b29893c](https://github.com/googleapis/nodejs-security-center/commit/b29893c112a346a3277620a01e5ce391097f3c40)) * Add next_steps field to finding's list of attributes ([#476](https://github.com/googleapis/nodejs-security-center/issues/476)) ([326e8d2](https://github.com/googleapis/nodejs-security-center/commit/326e8d2242d0852df593474dbc028ea17fb8d600)) * AuditConfig for IAM v1 ([#470](https://github.com/googleapis/nodejs-security-center/issues/470)) ([2ec070f](https://github.com/googleapis/nodejs-security-center/commit/2ec070f504fe85bd1c9adf7436b7d8c902ec167b)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- packages/google-cloud-securitycenter/CHANGELOG.md | 9 +++++++++ packages/google-cloud-securitycenter/package.json | 2 +- .../google-cloud-securitycenter/samples/package.json | 2 +- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-securitycenter/CHANGELOG.md b/packages/google-cloud-securitycenter/CHANGELOG.md index 0a7b55eb320..3e1f81a6dff 100644 --- a/packages/google-cloud-securitycenter/CHANGELOG.md +++ b/packages/google-cloud-securitycenter/CHANGELOG.md @@ -4,6 +4,15 @@ [1]: https://www.npmjs.com/package/@google-cloud/security-center?activeTab=versions +## [5.10.0](https://github.com/googleapis/nodejs-security-center/compare/v5.9.0...v5.10.0) (2022-04-11) + + +### Features + +* Add iam_binding field to findings attributes. It represents particular IAM bindings, which captures a member's role addition, removal, or state ([#474](https://github.com/googleapis/nodejs-security-center/issues/474)) ([b29893c](https://github.com/googleapis/nodejs-security-center/commit/b29893c112a346a3277620a01e5ce391097f3c40)) +* Add next_steps field to finding's list of attributes ([#476](https://github.com/googleapis/nodejs-security-center/issues/476)) ([326e8d2](https://github.com/googleapis/nodejs-security-center/commit/326e8d2242d0852df593474dbc028ea17fb8d600)) +* AuditConfig for IAM v1 ([#470](https://github.com/googleapis/nodejs-security-center/issues/470)) ([2ec070f](https://github.com/googleapis/nodejs-security-center/commit/2ec070f504fe85bd1c9adf7436b7d8c902ec167b)) + ## [5.9.0](https://github.com/googleapis/nodejs-security-center/compare/v5.8.0...v5.9.0) (2022-02-04) diff --git a/packages/google-cloud-securitycenter/package.json b/packages/google-cloud-securitycenter/package.json index 16f2462f08a..be315506029 100644 --- a/packages/google-cloud-securitycenter/package.json +++ b/packages/google-cloud-securitycenter/package.json @@ -1,7 +1,7 @@ { "name": "@google-cloud/security-center", "description": "Cloud Security Command Center API client for Node.js", - "version": "5.9.0", + "version": "5.10.0", "license": "Apache-2.0", "author": "Google LLC", "engines": { diff --git a/packages/google-cloud-securitycenter/samples/package.json b/packages/google-cloud-securitycenter/samples/package.json index d261126e828..e67b9c4d6a8 100644 --- a/packages/google-cloud-securitycenter/samples/package.json +++ b/packages/google-cloud-securitycenter/samples/package.json @@ -14,7 +14,7 @@ "license": "Apache-2.0", "dependencies": { "@google-cloud/pubsub": "^2.0.0", - "@google-cloud/security-center": "^5.9.0" + "@google-cloud/security-center": "^5.10.0" }, "devDependencies": { "chai": "^4.2.0", From a43b6fc5a63456e0e7bebba48f25755d53ce2cf3 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Tue, 19 Apr 2022 19:54:52 -0700 Subject: [PATCH 310/342] feat: Add connection and description field to finding's list of attributes (#479) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: Add connection and description field to finding's list of attributes PiperOrigin-RevId: 442589635 Source-Link: https://github.com/googleapis/googleapis/commit/50fc8347754f4af9eeaa759848b1feb41f7e1080 Source-Link: https://github.com/googleapis/googleapis-gen/commit/86cc920529b0877ba81216b52d995ce4dd2f8b4f Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiODZjYzkyMDUyOWIwODc3YmE4MTIxNmI1MmQ5OTVjZTRkZDJmOGI0ZiJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot --- .../cloud/securitycenter/v1/connection.proto | 66 +++ .../cloud/securitycenter/v1/finding.proto | 7 + .../v1/securitycenter_service.proto | 215 +++++----- .../protos/protos.d.ts | 139 ++++++ .../protos/protos.js | 399 +++++++++++++++++- .../protos/protos.json | 45 ++ .../v1/security_center.bulk_mute_findings.js | 4 +- .../v1/security_center.create_finding.js | 4 +- ...urity_center.create_notification_config.js | 9 +- .../v1/security_center.create_source.js | 4 +- ...curity_center.get_organization_settings.js | 4 +- .../v1/security_center.group_assets.js | 6 +- .../v1/security_center.group_findings.js | 6 +- .../security_center.list_big_query_exports.js | 4 +- .../v1/security_center.list_mute_configs.js | 4 +- .../v1/security_center.list_sources.js | 4 +- .../v1/security_center.run_asset_discovery.js | 4 +- .../v1/security_center.update_finding.js | 4 +- ...tadata.google.cloud.securitycenter.v1.json | 2 +- .../src/v1/security_center_client.ts | 105 +++-- .../src/v1/security_center_proto_list.json | 1 + 21 files changed, 851 insertions(+), 185 deletions(-) create mode 100644 packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/connection.proto diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/connection.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/connection.proto new file mode 100644 index 00000000000..29e95546c72 --- /dev/null +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/connection.proto @@ -0,0 +1,66 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// 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.cloud.securitycenter.v1; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1;securitycenter"; +option java_multiple_files = true; +option java_outer_classname = "ConnectionProto"; +option java_package = "com.google.cloud.securitycenter.v1"; +option php_namespace = "Google\\Cloud\\SecurityCenter\\V1"; +option ruby_package = "Google::Cloud::SecurityCenter::V1"; + +// Contains information about the IP connection associated with the finding. +message Connection { + // IANA Internet Protocol Number such as TCP(6) and UDP(17). + enum Protocol { + // Unspecified protocol (not HOPOPT). + PROTOCOL_UNSPECIFIED = 0; + + // Internet Control Message Protocol. + ICMP = 1; + + // Transmission Control Protocol. + TCP = 6; + + // User Datagram Protocol. + UDP = 17; + + // Generic Routing Encapsulation. + GRE = 47; + + // Encap Security Payload. + ESP = 50; + } + + // Destination IP address. Not present for sockets that are listening and not + // connected. + string destination_ip = 1; + + // Destination port. Not present for sockets that are listening and not + // connected. + int32 destination_port = 2; + + // Source IP address. + string source_ip = 3; + + // Source port. + int32 source_port = 4; + + // IANA Internet Protocol Number such as TCP(6) and UDP(17). + Protocol protocol = 5; +} diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/finding.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/finding.proto index 787c35cae47..20d920d249b 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/finding.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/finding.proto @@ -19,6 +19,7 @@ package google.cloud.securitycenter.v1; import "google/api/field_behavior.proto"; import "google/api/resource.proto"; import "google/cloud/securitycenter/v1/access.proto"; +import "google/cloud/securitycenter/v1/connection.proto"; import "google/cloud/securitycenter/v1/external_system.proto"; import "google/cloud/securitycenter/v1/iam_binding.proto"; import "google/cloud/securitycenter/v1/indicator.proto"; @@ -264,12 +265,18 @@ message Finding { // caller, which method was accessed, from where, etc. Access access = 26; + // Contains information about the IP connection associated with the finding. + repeated Connection connections = 31; + // First known as mute_annotation. Records additional information about the // mute operation e.g. mute config that muted the finding, user who muted the // finding, etc. Unlike other attributes of a finding, a finding provider // shouldn't set the value of mute. string mute_initiator = 28; + // Contains more detail about the finding. + string description = 37; + // Represents IAM bindings associated with the Finding. repeated IamBinding iam_bindings = 39; diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/securitycenter_service.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/securitycenter_service.proto index a95f5c037e4..cc4d3fbfe73 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/securitycenter_service.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/securitycenter_service.proto @@ -51,14 +51,12 @@ option ruby_package = "Google::Cloud::SecurityCenter::V1"; // V1 APIs for Security Center service. service SecurityCenter { option (google.api.default_host) = "securitycenter.googleapis.com"; - option (google.api.oauth_scopes) = - "https://www.googleapis.com/auth/cloud-platform"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; // Kicks off an LRO to bulk mute findings for a parent based on a filter. The // parent can be either an organization, folder or project. The findings // matched by the filter will be muted after the LRO is done. - rpc BulkMuteFindings(BulkMuteFindingsRequest) - returns (google.longrunning.Operation) { + rpc BulkMuteFindings(BulkMuteFindingsRequest) returns (google.longrunning.Operation) { option (google.api.http) = { post: "/v1/{parent=organizations/*}/findings:bulkMute" body: "*" @@ -116,31 +114,31 @@ service SecurityCenter { } // Creates a notification config. - rpc CreateNotificationConfig(CreateNotificationConfigRequest) - returns (NotificationConfig) { + rpc CreateNotificationConfig(CreateNotificationConfigRequest) returns (NotificationConfig) { option (google.api.http) = { post: "/v1/{parent=organizations/*}/notificationConfigs" body: "notification_config" }; - option (google.api.method_signature) = - "parent,config_id,notification_config"; + option (google.api.method_signature) = "parent,config_id,notification_config"; option (google.api.method_signature) = "parent,notification_config"; } // Deletes an existing mute config. - rpc DeleteMuteConfig(DeleteMuteConfigRequest) - returns (google.protobuf.Empty) { + rpc DeleteMuteConfig(DeleteMuteConfigRequest) returns (google.protobuf.Empty) { option (google.api.http) = { delete: "/v1/{name=organizations/*/muteConfigs/*}" - additional_bindings { delete: "/v1/{name=folders/*/muteConfigs/*}" } - additional_bindings { delete: "/v1/{name=projects/*/muteConfigs/*}" } + additional_bindings { + delete: "/v1/{name=folders/*/muteConfigs/*}" + } + additional_bindings { + delete: "/v1/{name=projects/*/muteConfigs/*}" + } }; option (google.api.method_signature) = "name"; } // Deletes a notification config. - rpc DeleteNotificationConfig(DeleteNotificationConfigRequest) - returns (google.protobuf.Empty) { + rpc DeleteNotificationConfig(DeleteNotificationConfigRequest) returns (google.protobuf.Empty) { option (google.api.http) = { delete: "/v1/{name=organizations/*/notificationConfigs/*}" }; @@ -151,15 +149,18 @@ service SecurityCenter { rpc GetBigQueryExport(GetBigQueryExportRequest) returns (BigQueryExport) { option (google.api.http) = { get: "/v1/{name=organizations/*/bigQueryExports/*}" - additional_bindings { get: "/v1/{name=folders/*/bigQueryExports/*}" } - additional_bindings { get: "/v1/{name=projects/*/bigQueryExports/*}" } + additional_bindings { + get: "/v1/{name=folders/*/bigQueryExports/*}" + } + additional_bindings { + get: "/v1/{name=projects/*/bigQueryExports/*}" + } }; option (google.api.method_signature) = "name"; } // Gets the access control policy on the specified Source. - rpc GetIamPolicy(google.iam.v1.GetIamPolicyRequest) - returns (google.iam.v1.Policy) { + rpc GetIamPolicy(google.iam.v1.GetIamPolicyRequest) returns (google.iam.v1.Policy) { option (google.api.http) = { post: "/v1/{resource=organizations/*/sources/*}:getIamPolicy" body: "*" @@ -171,15 +172,18 @@ service SecurityCenter { rpc GetMuteConfig(GetMuteConfigRequest) returns (MuteConfig) { option (google.api.http) = { get: "/v1/{name=organizations/*/muteConfigs/*}" - additional_bindings { get: "/v1/{name=folders/*/muteConfigs/*}" } - additional_bindings { get: "/v1/{name=projects/*/muteConfigs/*}" } + additional_bindings { + get: "/v1/{name=folders/*/muteConfigs/*}" + } + additional_bindings { + get: "/v1/{name=projects/*/muteConfigs/*}" + } }; option (google.api.method_signature) = "name"; } // Gets a notification config. - rpc GetNotificationConfig(GetNotificationConfigRequest) - returns (NotificationConfig) { + rpc GetNotificationConfig(GetNotificationConfigRequest) returns (NotificationConfig) { option (google.api.http) = { get: "/v1/{name=organizations/*/notificationConfigs/*}" }; @@ -187,8 +191,7 @@ service SecurityCenter { } // Gets the settings for an organization. - rpc GetOrganizationSettings(GetOrganizationSettingsRequest) - returns (OrganizationSettings) { + rpc GetOrganizationSettings(GetOrganizationSettingsRequest) returns (OrganizationSettings) { option (google.api.http) = { get: "/v1/{name=organizations/*/organizationSettings}" }; @@ -247,8 +250,12 @@ service SecurityCenter { rpc ListAssets(ListAssetsRequest) returns (ListAssetsResponse) { option (google.api.http) = { get: "/v1/{parent=organizations/*}/assets" - additional_bindings { get: "/v1/{parent=folders/*}/assets" } - additional_bindings { get: "/v1/{parent=projects/*}/assets" } + additional_bindings { + get: "/v1/{parent=folders/*}/assets" + } + additional_bindings { + get: "/v1/{parent=projects/*}/assets" + } }; } @@ -259,25 +266,31 @@ service SecurityCenter { rpc ListFindings(ListFindingsRequest) returns (ListFindingsResponse) { option (google.api.http) = { get: "/v1/{parent=organizations/*/sources/*}/findings" - additional_bindings { get: "/v1/{parent=folders/*/sources/*}/findings" } - additional_bindings { get: "/v1/{parent=projects/*/sources/*}/findings" } + additional_bindings { + get: "/v1/{parent=folders/*/sources/*}/findings" + } + additional_bindings { + get: "/v1/{parent=projects/*/sources/*}/findings" + } }; } // Lists mute configs. - rpc ListMuteConfigs(ListMuteConfigsRequest) - returns (ListMuteConfigsResponse) { + rpc ListMuteConfigs(ListMuteConfigsRequest) returns (ListMuteConfigsResponse) { option (google.api.http) = { get: "/v1/{parent=organizations/*}/muteConfigs" - additional_bindings { get: "/v1/{parent=folders/*}/muteConfigs" } - additional_bindings { get: "/v1/{parent=projects/*}/muteConfigs" } + additional_bindings { + get: "/v1/{parent=folders/*}/muteConfigs" + } + additional_bindings { + get: "/v1/{parent=projects/*}/muteConfigs" + } }; option (google.api.method_signature) = "parent"; } // Lists notification configs. - rpc ListNotificationConfigs(ListNotificationConfigsRequest) - returns (ListNotificationConfigsResponse) { + rpc ListNotificationConfigs(ListNotificationConfigsRequest) returns (ListNotificationConfigsResponse) { option (google.api.http) = { get: "/v1/{parent=organizations/*}/notificationConfigs" }; @@ -288,8 +301,12 @@ service SecurityCenter { rpc ListSources(ListSourcesRequest) returns (ListSourcesResponse) { option (google.api.http) = { get: "/v1/{parent=organizations/*}/sources" - additional_bindings { get: "/v1/{parent=folders/*}/sources" } - additional_bindings { get: "/v1/{parent=projects/*}/sources" } + additional_bindings { + get: "/v1/{parent=folders/*}/sources" + } + additional_bindings { + get: "/v1/{parent=projects/*}/sources" + } }; option (google.api.method_signature) = "parent"; } @@ -300,8 +317,7 @@ service SecurityCenter { // This API can only be called with limited frequency for an organization. If // it is called too frequently the caller will receive a TOO_MANY_REQUESTS // error. - rpc RunAssetDiscovery(RunAssetDiscoveryRequest) - returns (google.longrunning.Operation) { + rpc RunAssetDiscovery(RunAssetDiscoveryRequest) returns (google.longrunning.Operation) { option (google.api.http) = { post: "/v1/{parent=organizations/*}/assets:runDiscovery" body: "*" @@ -348,8 +364,7 @@ service SecurityCenter { } // Sets the access control policy on the specified Source. - rpc SetIamPolicy(google.iam.v1.SetIamPolicyRequest) - returns (google.iam.v1.Policy) { + rpc SetIamPolicy(google.iam.v1.SetIamPolicyRequest) returns (google.iam.v1.Policy) { option (google.api.http) = { post: "/v1/{resource=organizations/*/sources/*}:setIamPolicy" body: "*" @@ -358,8 +373,7 @@ service SecurityCenter { } // Returns the permissions that a caller has on the specified source. - rpc TestIamPermissions(google.iam.v1.TestIamPermissionsRequest) - returns (google.iam.v1.TestIamPermissionsResponse) { + rpc TestIamPermissions(google.iam.v1.TestIamPermissionsRequest) returns (google.iam.v1.TestIamPermissionsResponse) { option (google.api.http) = { post: "/v1/{resource=organizations/*/sources/*}:testIamPermissions" body: "*" @@ -368,8 +382,7 @@ service SecurityCenter { } // Updates external system. This is for a given finding. - rpc UpdateExternalSystem(UpdateExternalSystemRequest) - returns (ExternalSystem) { + rpc UpdateExternalSystem(UpdateExternalSystemRequest) returns (ExternalSystem) { option (google.api.http) = { patch: "/v1/{external_system.name=organizations/*/sources/*/findings/*/externalSystems/*}" body: "external_system" @@ -423,8 +436,7 @@ service SecurityCenter { // // Updates a notification config. The following update // fields are allowed: description, pubsub_topic, streaming_config.filter - rpc UpdateNotificationConfig(UpdateNotificationConfigRequest) - returns (NotificationConfig) { + rpc UpdateNotificationConfig(UpdateNotificationConfigRequest) returns (NotificationConfig) { option (google.api.http) = { patch: "/v1/{notification_config.name=organizations/*/notificationConfigs/*}" body: "notification_config" @@ -434,8 +446,7 @@ service SecurityCenter { } // Updates an organization's settings. - rpc UpdateOrganizationSettings(UpdateOrganizationSettingsRequest) - returns (OrganizationSettings) { + rpc UpdateOrganizationSettings(UpdateOrganizationSettingsRequest) returns (OrganizationSettings) { option (google.api.http) = { patch: "/v1/{organization_settings.name=organizations/*/organizationSettings}" body: "organization_settings" @@ -482,8 +493,7 @@ service SecurityCenter { } // Creates a big query export. - rpc CreateBigQueryExport(CreateBigQueryExportRequest) - returns (BigQueryExport) { + rpc CreateBigQueryExport(CreateBigQueryExportRequest) returns (BigQueryExport) { option (google.api.http) = { post: "/v1/{parent=organizations/*}/bigQueryExports" body: "big_query_export" @@ -496,24 +506,25 @@ service SecurityCenter { body: "big_query_export" } }; - option (google.api.method_signature) = - "parent,big_query_export,big_query_export_id"; + option (google.api.method_signature) = "parent,big_query_export,big_query_export_id"; } // Deletes an existing big query export. - rpc DeleteBigQueryExport(DeleteBigQueryExportRequest) - returns (google.protobuf.Empty) { + rpc DeleteBigQueryExport(DeleteBigQueryExportRequest) returns (google.protobuf.Empty) { option (google.api.http) = { delete: "/v1/{name=organizations/*/bigQueryExports/*}" - additional_bindings { delete: "/v1/{name=folders/*/bigQueryExports/*}" } - additional_bindings { delete: "/v1/{name=projects/*/bigQueryExports/*}" } + additional_bindings { + delete: "/v1/{name=folders/*/bigQueryExports/*}" + } + additional_bindings { + delete: "/v1/{name=projects/*/bigQueryExports/*}" + } }; option (google.api.method_signature) = "name"; } // Updates a BigQuery export. - rpc UpdateBigQueryExport(UpdateBigQueryExportRequest) - returns (BigQueryExport) { + rpc UpdateBigQueryExport(UpdateBigQueryExportRequest) returns (BigQueryExport) { option (google.api.http) = { patch: "/v1/{big_query_export.name=organizations/*/bigQueryExports/*}" body: "big_query_export" @@ -534,12 +545,15 @@ service SecurityCenter { // requesting BigQuery exports under a folder, then all BigQuery exports // immediately under the folder plus the ones created under the projects // within the folder are returned. - rpc ListBigQueryExports(ListBigQueryExportsRequest) - returns (ListBigQueryExportsResponse) { + rpc ListBigQueryExports(ListBigQueryExportsRequest) returns (ListBigQueryExportsResponse) { option (google.api.http) = { get: "/v1/{parent=organizations/*}/bigQueryExports" - additional_bindings { get: "/v1/{parent=folders/*}/bigQueryExports" } - additional_bindings { get: "/v1/{parent=projects/*}/bigQueryExports" } + additional_bindings { + get: "/v1/{parent=folders/*}/bigQueryExports" + } + additional_bindings { + get: "/v1/{parent=projects/*}/bigQueryExports" + } }; option (google.api.method_signature) = "parent"; } @@ -552,12 +566,14 @@ service SecurityCenter { // which they get executed is not defined. // 2. Once a bulk operation is started, there is no way to stop it. message BulkMuteFindingsRequest { - // Required. The parent, at which bulk action needs to be applied. Its format - // is "organizations/[organization_id]", "folders/[folder_id]", + // Required. The parent, at which bulk action needs to be applied. Its format is + // "organizations/[organization_id]", "folders/[folder_id]", // "projects/[project_id]". string parent = 1 [ (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "*" } + (google.api.resource_reference) = { + type: "*" + } ]; // Expression that identifies findings that should be updated. @@ -588,7 +604,9 @@ message BulkMuteFindingsRequest { } // The response to a BulkMute request. Contains the LRO information. -message BulkMuteFindingsResponse {} +message BulkMuteFindingsResponse { + +} // Request message for creating a finding. message CreateFindingRequest { @@ -606,8 +624,8 @@ message CreateFindingRequest { // greater than 0 characters in length. string finding_id = 2 [(google.api.field_behavior) = REQUIRED]; - // Required. The Finding being created. The name and security_marks will be - // ignored as they are both output only fields on this resource. + // Required. The Finding being created. The name and security_marks will be ignored as + // they are both output only fields on this resource. Finding finding = 3 [(google.api.field_behavior) = REQUIRED]; } @@ -635,8 +653,8 @@ message CreateMuteConfigRequest { // Request message for creating a notification config. message CreateNotificationConfigRequest { - // Required. Resource name of the new notification config's parent. Its format - // is "organizations/[organization_id]". + // Required. Resource name of the new notification config's parent. Its format is + // "organizations/[organization_id]". string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -650,11 +668,9 @@ message CreateNotificationConfigRequest { // characters, underscores or hyphens only. string config_id = 2 [(google.api.field_behavior) = REQUIRED]; - // Required. The notification config being created. The name and the service - // account will be ignored as they are both output only fields on this - // resource. - NotificationConfig notification_config = 3 - [(google.api.field_behavior) = REQUIRED]; + // Required. The notification config being created. The name and the service account + // will be ignored as they are both output only fields on this resource. + NotificationConfig notification_config = 3 [(google.api.field_behavior) = REQUIRED]; } // Request message for creating a source. @@ -668,8 +684,8 @@ message CreateSourceRequest { } ]; - // Required. The Source being created, only the display_name and description - // will be used. All other fields will be ignored. + // Required. The Source being created, only the display_name and description will be + // used. All other fields will be ignored. Source source = 2 [(google.api.field_behavior) = REQUIRED]; } @@ -741,8 +757,8 @@ message GetNotificationConfigRequest { // Request message for getting organization settings. message GetOrganizationSettingsRequest { - // Required. Name of the organization to get organization settings for. Its - // format is "organizations/[organization_id]/organizationSettings". + // Required. Name of the organization to get organization settings for. Its format is + // "organizations/[organization_id]/organizationSettings". string name = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -839,9 +855,9 @@ message GroupAssetsRequest { // property not existing: `-resource_properties.my_property : ""` string filter = 2; - // Required. Expression that defines what assets fields to use for grouping. - // The string value should follow SQL syntax: comma separated list of fields. - // For example: + // Required. Expression that defines what assets fields to use for grouping. The string + // value should follow SQL syntax: comma separated list of fields. For + // example: // "security_center_properties.resource_project,security_center_properties.project". // // The following fields are supported when compare_duration is not set: @@ -999,9 +1015,9 @@ message GroupFindingsRequest { // * resource.type: `=`, `:` string filter = 2; - // Required. Expression that defines what assets fields to use for grouping - // (including `state_change`). The string value should follow SQL syntax: - // comma separated list of fields. For example: "parent,resource_name". + // Required. Expression that defines what assets fields to use for grouping (including + // `state_change`). The string value should follow SQL syntax: comma separated + // list of fields. For example: "parent,resource_name". // // The following fields are supported: // @@ -1096,8 +1112,8 @@ message GroupResult { // Request message for listing mute configs at a given scope e.g. organization, // folder or project. message ListMuteConfigsRequest { - // Required. The parent, which owns the collection of mute configs. Its format - // is "organizations/[organization_id]", "folders/[folder_id]", + // Required. The parent, which owns the collection of mute configs. Its format is + // "organizations/[organization_id]", "folders/[folder_id]", // "projects/[project_id]". string parent = 1 [ (google.api.field_behavior) = REQUIRED, @@ -1163,8 +1179,8 @@ message ListNotificationConfigsResponse { // Request message for listing sources. message ListSourcesRequest { - // Required. Resource name of the parent of sources to list. Its format should - // be "organizations/[organization_id], folders/[folder_id], or + // Required. Resource name of the parent of sources to list. Its format should be + // "organizations/[organization_id], folders/[folder_id], or // projects/[project_id]". string parent = 1 [ (google.api.field_behavior) = REQUIRED, @@ -1639,8 +1655,7 @@ message SetFindingStateRequest { Finding.State state = 2 [(google.api.field_behavior) = REQUIRED]; // Required. The time at which the updated state takes effect. - google.protobuf.Timestamp start_time = 3 - [(google.api.field_behavior) = REQUIRED]; + google.protobuf.Timestamp start_time = 3 [(google.api.field_behavior) = REQUIRED]; } // Request message for updating a finding's mute status. @@ -1664,8 +1679,8 @@ message SetMuteRequest { // Request message for running asset discovery for an organization. message RunAssetDiscoveryRequest { - // Required. Name of the organization to run asset discovery for. Its format - // is "organizations/[organization_id]". + // Required. Name of the organization to run asset discovery for. Its format is + // "organizations/[organization_id]". string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -1687,8 +1702,8 @@ message UpdateExternalSystemRequest { // Request message for updating or creating a finding. message UpdateFindingRequest { - // Required. The finding resource to update or create if it does not already - // exist. parent, security_marks, and update_time will be ignored. + // Required. The finding resource to update or create if it does not already exist. + // parent, security_marks, and update_time will be ignored. // // In the case of creation, the finding id portion of the name must be // alphanumeric and less than or equal to 32 characters and greater than 0 @@ -1718,8 +1733,7 @@ message UpdateMuteConfigRequest { // Request message for updating a notification config. message UpdateNotificationConfigRequest { // Required. The notification config to update. - NotificationConfig notification_config = 1 - [(google.api.field_behavior) = REQUIRED]; + NotificationConfig notification_config = 1 [(google.api.field_behavior) = REQUIRED]; // The FieldMask to use when updating the notification config. // @@ -1730,8 +1744,7 @@ message UpdateNotificationConfigRequest { // Request message for updating an organization's settings. message UpdateOrganizationSettingsRequest { // Required. The organization settings resource to update. - OrganizationSettings organization_settings = 1 - [(google.api.field_behavior) = REQUIRED]; + OrganizationSettings organization_settings = 1 [(google.api.field_behavior) = REQUIRED]; // The FieldMask to use when updating the settings resource. // @@ -1804,8 +1817,8 @@ message UpdateBigQueryExportRequest { // Request message for listing BigQuery exports at a given scope e.g. // organization, folder or project. message ListBigQueryExportsRequest { - // Required. The parent, which owns the collection of BigQuery exports. Its - // format is "organizations/[organization_id]", "folders/[folder_id]", + // Required. The parent, which owns the collection of BigQuery exports. Its format is + // "organizations/[organization_id]", "folders/[folder_id]", // "projects/[project_id]". string parent = 1 [ (google.api.field_behavior) = REQUIRED, diff --git a/packages/google-cloud-securitycenter/protos/protos.d.ts b/packages/google-cloud-securitycenter/protos/protos.d.ts index 21f54e5ab42..26c587451ac 100644 --- a/packages/google-cloud-securitycenter/protos/protos.d.ts +++ b/packages/google-cloud-securitycenter/protos/protos.d.ts @@ -929,6 +929,133 @@ export namespace google { public toJSON(): { [k: string]: any }; } + /** Properties of a Connection. */ + interface IConnection { + + /** Connection destinationIp */ + destinationIp?: (string|null); + + /** Connection destinationPort */ + destinationPort?: (number|null); + + /** Connection sourceIp */ + sourceIp?: (string|null); + + /** Connection sourcePort */ + sourcePort?: (number|null); + + /** Connection protocol */ + protocol?: (google.cloud.securitycenter.v1.Connection.Protocol|keyof typeof google.cloud.securitycenter.v1.Connection.Protocol|null); + } + + /** Represents a Connection. */ + class Connection implements IConnection { + + /** + * Constructs a new Connection. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IConnection); + + /** Connection destinationIp. */ + public destinationIp: string; + + /** Connection destinationPort. */ + public destinationPort: number; + + /** Connection sourceIp. */ + public sourceIp: string; + + /** Connection sourcePort. */ + public sourcePort: number; + + /** Connection protocol. */ + public protocol: (google.cloud.securitycenter.v1.Connection.Protocol|keyof typeof google.cloud.securitycenter.v1.Connection.Protocol); + + /** + * Creates a new Connection instance using the specified properties. + * @param [properties] Properties to set + * @returns Connection instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IConnection): google.cloud.securitycenter.v1.Connection; + + /** + * Encodes the specified Connection message. Does not implicitly {@link google.cloud.securitycenter.v1.Connection.verify|verify} messages. + * @param message Connection message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IConnection, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Connection message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Connection.verify|verify} messages. + * @param message Connection message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IConnection, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Connection message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Connection + * @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.cloud.securitycenter.v1.Connection; + + /** + * Decodes a Connection message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Connection + * @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.cloud.securitycenter.v1.Connection; + + /** + * Verifies a Connection 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 Connection message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Connection + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.Connection; + + /** + * Creates a plain object from a Connection message. Also converts values to other types if specified. + * @param message Connection + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.Connection, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Connection to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace Connection { + + /** Protocol enum. */ + enum Protocol { + PROTOCOL_UNSPECIFIED = 0, + ICMP = 1, + TCP = 6, + UDP = 17, + GRE = 47, + ESP = 50 + } + } + /** Properties of an ExternalSystem. */ interface IExternalSystem { @@ -1106,9 +1233,15 @@ export namespace google { /** Finding access */ access?: (google.cloud.securitycenter.v1.IAccess|null); + /** Finding connections */ + connections?: (google.cloud.securitycenter.v1.IConnection[]|null); + /** Finding muteInitiator */ muteInitiator?: (string|null); + /** Finding description */ + description?: (string|null); + /** Finding iamBindings */ iamBindings?: (google.cloud.securitycenter.v1.IIamBinding[]|null); @@ -1185,9 +1318,15 @@ export namespace google { /** Finding access. */ public access?: (google.cloud.securitycenter.v1.IAccess|null); + /** Finding connections. */ + public connections: google.cloud.securitycenter.v1.IConnection[]; + /** Finding muteInitiator. */ public muteInitiator: string; + /** Finding description. */ + public description: string; + /** Finding iamBindings. */ public iamBindings: google.cloud.securitycenter.v1.IIamBinding[]; diff --git a/packages/google-cloud-securitycenter/protos/protos.js b/packages/google-cloud-securitycenter/protos/protos.js index 3beedb2478d..2e1ca6efc9b 100644 --- a/packages/google-cloud-securitycenter/protos/protos.js +++ b/packages/google-cloud-securitycenter/protos/protos.js @@ -2386,6 +2386,337 @@ return BigQueryExport; })(); + v1.Connection = (function() { + + /** + * Properties of a Connection. + * @memberof google.cloud.securitycenter.v1 + * @interface IConnection + * @property {string|null} [destinationIp] Connection destinationIp + * @property {number|null} [destinationPort] Connection destinationPort + * @property {string|null} [sourceIp] Connection sourceIp + * @property {number|null} [sourcePort] Connection sourcePort + * @property {google.cloud.securitycenter.v1.Connection.Protocol|null} [protocol] Connection protocol + */ + + /** + * Constructs a new Connection. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a Connection. + * @implements IConnection + * @constructor + * @param {google.cloud.securitycenter.v1.IConnection=} [properties] Properties to set + */ + function Connection(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]]; + } + + /** + * Connection destinationIp. + * @member {string} destinationIp + * @memberof google.cloud.securitycenter.v1.Connection + * @instance + */ + Connection.prototype.destinationIp = ""; + + /** + * Connection destinationPort. + * @member {number} destinationPort + * @memberof google.cloud.securitycenter.v1.Connection + * @instance + */ + Connection.prototype.destinationPort = 0; + + /** + * Connection sourceIp. + * @member {string} sourceIp + * @memberof google.cloud.securitycenter.v1.Connection + * @instance + */ + Connection.prototype.sourceIp = ""; + + /** + * Connection sourcePort. + * @member {number} sourcePort + * @memberof google.cloud.securitycenter.v1.Connection + * @instance + */ + Connection.prototype.sourcePort = 0; + + /** + * Connection protocol. + * @member {google.cloud.securitycenter.v1.Connection.Protocol} protocol + * @memberof google.cloud.securitycenter.v1.Connection + * @instance + */ + Connection.prototype.protocol = 0; + + /** + * Creates a new Connection instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.Connection + * @static + * @param {google.cloud.securitycenter.v1.IConnection=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.Connection} Connection instance + */ + Connection.create = function create(properties) { + return new Connection(properties); + }; + + /** + * Encodes the specified Connection message. Does not implicitly {@link google.cloud.securitycenter.v1.Connection.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.Connection + * @static + * @param {google.cloud.securitycenter.v1.IConnection} message Connection message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Connection.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.destinationIp != null && Object.hasOwnProperty.call(message, "destinationIp")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.destinationIp); + if (message.destinationPort != null && Object.hasOwnProperty.call(message, "destinationPort")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.destinationPort); + if (message.sourceIp != null && Object.hasOwnProperty.call(message, "sourceIp")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.sourceIp); + if (message.sourcePort != null && Object.hasOwnProperty.call(message, "sourcePort")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.sourcePort); + if (message.protocol != null && Object.hasOwnProperty.call(message, "protocol")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.protocol); + return writer; + }; + + /** + * Encodes the specified Connection message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Connection.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.Connection + * @static + * @param {google.cloud.securitycenter.v1.IConnection} message Connection message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Connection.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Connection message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.Connection + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.Connection} Connection + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Connection.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.cloud.securitycenter.v1.Connection(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.destinationIp = reader.string(); + break; + case 2: + message.destinationPort = reader.int32(); + break; + case 3: + message.sourceIp = reader.string(); + break; + case 4: + message.sourcePort = reader.int32(); + break; + case 5: + message.protocol = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Connection message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.Connection + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.Connection} Connection + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Connection.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Connection message. + * @function verify + * @memberof google.cloud.securitycenter.v1.Connection + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Connection.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.destinationIp != null && message.hasOwnProperty("destinationIp")) + if (!$util.isString(message.destinationIp)) + return "destinationIp: string expected"; + if (message.destinationPort != null && message.hasOwnProperty("destinationPort")) + if (!$util.isInteger(message.destinationPort)) + return "destinationPort: integer expected"; + if (message.sourceIp != null && message.hasOwnProperty("sourceIp")) + if (!$util.isString(message.sourceIp)) + return "sourceIp: string expected"; + if (message.sourcePort != null && message.hasOwnProperty("sourcePort")) + if (!$util.isInteger(message.sourcePort)) + return "sourcePort: integer expected"; + if (message.protocol != null && message.hasOwnProperty("protocol")) + switch (message.protocol) { + default: + return "protocol: enum value expected"; + case 0: + case 1: + case 6: + case 17: + case 47: + case 50: + break; + } + return null; + }; + + /** + * Creates a Connection message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.Connection + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.Connection} Connection + */ + Connection.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.Connection) + return object; + var message = new $root.google.cloud.securitycenter.v1.Connection(); + if (object.destinationIp != null) + message.destinationIp = String(object.destinationIp); + if (object.destinationPort != null) + message.destinationPort = object.destinationPort | 0; + if (object.sourceIp != null) + message.sourceIp = String(object.sourceIp); + if (object.sourcePort != null) + message.sourcePort = object.sourcePort | 0; + switch (object.protocol) { + case "PROTOCOL_UNSPECIFIED": + case 0: + message.protocol = 0; + break; + case "ICMP": + case 1: + message.protocol = 1; + break; + case "TCP": + case 6: + message.protocol = 6; + break; + case "UDP": + case 17: + message.protocol = 17; + break; + case "GRE": + case 47: + message.protocol = 47; + break; + case "ESP": + case 50: + message.protocol = 50; + break; + } + return message; + }; + + /** + * Creates a plain object from a Connection message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.Connection + * @static + * @param {google.cloud.securitycenter.v1.Connection} message Connection + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Connection.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.destinationIp = ""; + object.destinationPort = 0; + object.sourceIp = ""; + object.sourcePort = 0; + object.protocol = options.enums === String ? "PROTOCOL_UNSPECIFIED" : 0; + } + if (message.destinationIp != null && message.hasOwnProperty("destinationIp")) + object.destinationIp = message.destinationIp; + if (message.destinationPort != null && message.hasOwnProperty("destinationPort")) + object.destinationPort = message.destinationPort; + if (message.sourceIp != null && message.hasOwnProperty("sourceIp")) + object.sourceIp = message.sourceIp; + if (message.sourcePort != null && message.hasOwnProperty("sourcePort")) + object.sourcePort = message.sourcePort; + if (message.protocol != null && message.hasOwnProperty("protocol")) + object.protocol = options.enums === String ? $root.google.cloud.securitycenter.v1.Connection.Protocol[message.protocol] : message.protocol; + return object; + }; + + /** + * Converts this Connection to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.Connection + * @instance + * @returns {Object.} JSON object + */ + Connection.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Protocol enum. + * @name google.cloud.securitycenter.v1.Connection.Protocol + * @enum {number} + * @property {number} PROTOCOL_UNSPECIFIED=0 PROTOCOL_UNSPECIFIED value + * @property {number} ICMP=1 ICMP value + * @property {number} TCP=6 TCP value + * @property {number} UDP=17 UDP value + * @property {number} GRE=47 GRE value + * @property {number} ESP=50 ESP value + */ + Connection.Protocol = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "PROTOCOL_UNSPECIFIED"] = 0; + values[valuesById[1] = "ICMP"] = 1; + values[valuesById[6] = "TCP"] = 6; + values[valuesById[17] = "UDP"] = 17; + values[valuesById[47] = "GRE"] = 47; + values[valuesById[50] = "ESP"] = 50; + return values; + })(); + + return Connection; + })(); + v1.ExternalSystem = (function() { /** @@ -2710,7 +3041,9 @@ * @property {Object.|null} [externalSystems] Finding externalSystems * @property {google.cloud.securitycenter.v1.IMitreAttack|null} [mitreAttack] Finding mitreAttack * @property {google.cloud.securitycenter.v1.IAccess|null} [access] Finding access + * @property {Array.|null} [connections] Finding connections * @property {string|null} [muteInitiator] Finding muteInitiator + * @property {string|null} [description] Finding description * @property {Array.|null} [iamBindings] Finding iamBindings * @property {string|null} [nextSteps] Finding nextSteps */ @@ -2726,6 +3059,7 @@ function Finding(properties) { this.sourceProperties = {}; this.externalSystems = {}; + this.connections = []; this.iamBindings = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) @@ -2893,6 +3227,14 @@ */ Finding.prototype.access = null; + /** + * Finding connections. + * @member {Array.} connections + * @memberof google.cloud.securitycenter.v1.Finding + * @instance + */ + Finding.prototype.connections = $util.emptyArray; + /** * Finding muteInitiator. * @member {string} muteInitiator @@ -2901,6 +3243,14 @@ */ Finding.prototype.muteInitiator = ""; + /** + * Finding description. + * @member {string} description + * @memberof google.cloud.securitycenter.v1.Finding + * @instance + */ + Finding.prototype.description = ""; + /** * Finding iamBindings. * @member {Array.} iamBindings @@ -2989,6 +3339,11 @@ $root.google.cloud.securitycenter.v1.Access.encode(message.access, writer.uint32(/* id 26, wireType 2 =*/210).fork()).ldelim(); if (message.muteInitiator != null && Object.hasOwnProperty.call(message, "muteInitiator")) writer.uint32(/* id 28, wireType 2 =*/226).string(message.muteInitiator); + if (message.connections != null && message.connections.length) + for (var i = 0; i < message.connections.length; ++i) + $root.google.cloud.securitycenter.v1.Connection.encode(message.connections[i], writer.uint32(/* id 31, wireType 2 =*/250).fork()).ldelim(); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 37, wireType 2 =*/298).string(message.description); if (message.iamBindings != null && message.iamBindings.length) for (var i = 0; i < message.iamBindings.length; ++i) $root.google.cloud.securitycenter.v1.IamBinding.encode(message.iamBindings[i], writer.uint32(/* id 39, wireType 2 =*/314).fork()).ldelim(); @@ -3126,9 +3481,17 @@ case 26: message.access = $root.google.cloud.securitycenter.v1.Access.decode(reader, reader.uint32()); break; + case 31: + if (!(message.connections && message.connections.length)) + message.connections = []; + message.connections.push($root.google.cloud.securitycenter.v1.Connection.decode(reader, reader.uint32())); + break; case 28: message.muteInitiator = reader.string(); break; + case 37: + message.description = reader.string(); + break; case 39: if (!(message.iamBindings && message.iamBindings.length)) message.iamBindings = []; @@ -3292,9 +3655,21 @@ if (error) return "access." + error; } + if (message.connections != null && message.hasOwnProperty("connections")) { + if (!Array.isArray(message.connections)) + return "connections: array expected"; + for (var i = 0; i < message.connections.length; ++i) { + var error = $root.google.cloud.securitycenter.v1.Connection.verify(message.connections[i]); + if (error) + return "connections." + error; + } + } if (message.muteInitiator != null && message.hasOwnProperty("muteInitiator")) if (!$util.isString(message.muteInitiator)) return "muteInitiator: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; if (message.iamBindings != null && message.hasOwnProperty("iamBindings")) { if (!Array.isArray(message.iamBindings)) return "iamBindings: array expected"; @@ -3474,8 +3849,20 @@ throw TypeError(".google.cloud.securitycenter.v1.Finding.access: object expected"); message.access = $root.google.cloud.securitycenter.v1.Access.fromObject(object.access); } + if (object.connections) { + if (!Array.isArray(object.connections)) + throw TypeError(".google.cloud.securitycenter.v1.Finding.connections: array expected"); + message.connections = []; + for (var i = 0; i < object.connections.length; ++i) { + if (typeof object.connections[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Finding.connections: object expected"); + message.connections[i] = $root.google.cloud.securitycenter.v1.Connection.fromObject(object.connections[i]); + } + } if (object.muteInitiator != null) message.muteInitiator = String(object.muteInitiator); + if (object.description != null) + message.description = String(object.description); if (object.iamBindings) { if (!Array.isArray(object.iamBindings)) throw TypeError(".google.cloud.securitycenter.v1.Finding.iamBindings: array expected"); @@ -3504,8 +3891,10 @@ if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) + if (options.arrays || options.defaults) { + object.connections = []; object.iamBindings = []; + } if (options.objects || options.defaults) { object.sourceProperties = {}; object.externalSystems = {}; @@ -3530,6 +3919,7 @@ object.mitreAttack = null; object.access = null; object.muteInitiator = ""; + object.description = ""; object.nextSteps = ""; } if (message.name != null && message.hasOwnProperty("name")) @@ -3581,6 +3971,13 @@ object.access = $root.google.cloud.securitycenter.v1.Access.toObject(message.access, options); if (message.muteInitiator != null && message.hasOwnProperty("muteInitiator")) object.muteInitiator = message.muteInitiator; + if (message.connections && message.connections.length) { + object.connections = []; + for (var j = 0; j < message.connections.length; ++j) + object.connections[j] = $root.google.cloud.securitycenter.v1.Connection.toObject(message.connections[j], options); + } + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; if (message.iamBindings && message.iamBindings.length) { object.iamBindings = []; for (var j = 0; j < message.iamBindings.length; ++j) diff --git a/packages/google-cloud-securitycenter/protos/protos.json b/packages/google-cloud-securitycenter/protos/protos.json index 6d78c35d5f7..55f7a703e3c 100644 --- a/packages/google-cloud-securitycenter/protos/protos.json +++ b/packages/google-cloud-securitycenter/protos/protos.json @@ -233,6 +233,42 @@ } } }, + "Connection": { + "fields": { + "destinationIp": { + "type": "string", + "id": 1 + }, + "destinationPort": { + "type": "int32", + "id": 2 + }, + "sourceIp": { + "type": "string", + "id": 3 + }, + "sourcePort": { + "type": "int32", + "id": 4 + }, + "protocol": { + "type": "Protocol", + "id": 5 + } + }, + "nested": { + "Protocol": { + "values": { + "PROTOCOL_UNSPECIFIED": 0, + "ICMP": 1, + "TCP": 6, + "UDP": 17, + "GRE": 47, + "ESP": 50 + } + } + } + }, "ExternalSystem": { "options": { "(google.api.resource).type": "securitycenter.googleapis.com/ExternalSystem", @@ -359,10 +395,19 @@ "type": "Access", "id": 26 }, + "connections": { + "rule": "repeated", + "type": "Connection", + "id": 31 + }, "muteInitiator": { "type": "string", "id": 28 }, + "description": { + "type": "string", + "id": 37 + }, "iamBindings": { "rule": "repeated", "type": "IamBinding", diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.bulk_mute_findings.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.bulk_mute_findings.js index dc7a324fbb7..dfc2499d41d 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.bulk_mute_findings.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.bulk_mute_findings.js @@ -26,8 +26,8 @@ function main(parent) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * Required. The parent, at which bulk action needs to be applied. Its format - * is "organizations/[organization_id]", "folders/[folder_id]", + * Required. The parent, at which bulk action needs to be applied. Its format is + * "organizations/[organization_id]", "folders/[folder_id]", * "projects/[project_id]". */ // const parent = 'abc123' diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.create_finding.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.create_finding.js index c90e509f32b..a51ddfddb26 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.create_finding.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.create_finding.js @@ -37,8 +37,8 @@ function main(parent, findingId, finding) { */ // const findingId = 'abc123' /** - * Required. The Finding being created. The name and security_marks will be - * ignored as they are both output only fields on this resource. + * Required. The Finding being created. The name and security_marks will be ignored as + * they are both output only fields on this resource. */ // const finding = {} diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.create_notification_config.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.create_notification_config.js index 7b101bf3302..73f2e6ba3d1 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.create_notification_config.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.create_notification_config.js @@ -26,8 +26,8 @@ function main(parent, configId, notificationConfig) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * Required. Resource name of the new notification config's parent. Its format - * is "organizations/[organization_id]". + * Required. Resource name of the new notification config's parent. Its format is + * "organizations/[organization_id]". */ // const parent = 'abc123' /** @@ -38,9 +38,8 @@ function main(parent, configId, notificationConfig) { */ // const configId = 'abc123' /** - * Required. The notification config being created. The name and the service - * account will be ignored as they are both output only fields on this - * resource. + * Required. The notification config being created. The name and the service account + * will be ignored as they are both output only fields on this resource. */ // const notificationConfig = {} diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.create_source.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.create_source.js index b06d0f14897..0465b795433 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.create_source.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.create_source.js @@ -31,8 +31,8 @@ function main(parent, source) { */ // const parent = 'abc123' /** - * Required. The Source being created, only the display_name and description - * will be used. All other fields will be ignored. + * Required. The Source being created, only the display_name and description will be + * used. All other fields will be ignored. */ // const source = {} diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_organization_settings.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_organization_settings.js index 0bb6cbadce2..888f48e3075 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_organization_settings.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_organization_settings.js @@ -26,8 +26,8 @@ function main(name) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * Required. Name of the organization to get organization settings for. Its - * format is "organizations/[organization_id]/organizationSettings". + * Required. Name of the organization to get organization settings for. Its format is + * "organizations/[organization_id]/organizationSettings". */ // const name = 'abc123' diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.group_assets.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.group_assets.js index c1365acc241..a16fcba32fb 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.group_assets.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.group_assets.js @@ -82,9 +82,9 @@ function main(parent, groupBy) { */ // const filter = 'abc123' /** - * Required. Expression that defines what assets fields to use for grouping. - * The string value should follow SQL syntax: comma separated list of fields. - * For example: + * Required. Expression that defines what assets fields to use for grouping. The string + * value should follow SQL syntax: comma separated list of fields. For + * example: * "security_center_properties.resource_project,security_center_properties.project". * The following fields are supported when compare_duration is not set: * * security_center_properties.resource_project diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.group_findings.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.group_findings.js index b1a357f1395..d59021ca140 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.group_findings.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.group_findings.js @@ -84,9 +84,9 @@ function main(parent, groupBy) { */ // const filter = 'abc123' /** - * Required. Expression that defines what assets fields to use for grouping - * (including `state_change`). The string value should follow SQL syntax: - * comma separated list of fields. For example: "parent,resource_name". + * Required. Expression that defines what assets fields to use for grouping (including + * `state_change`). The string value should follow SQL syntax: comma separated + * list of fields. For example: "parent,resource_name". * The following fields are supported: * * resource_name * * category diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_big_query_exports.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_big_query_exports.js index 3dce0c2c8e5..f58a82afb28 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_big_query_exports.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_big_query_exports.js @@ -26,8 +26,8 @@ function main(parent) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * Required. The parent, which owns the collection of BigQuery exports. Its - * format is "organizations/[organization_id]", "folders/[folder_id]", + * Required. The parent, which owns the collection of BigQuery exports. Its format is + * "organizations/[organization_id]", "folders/[folder_id]", * "projects/[project_id]". */ // const parent = 'abc123' diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_mute_configs.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_mute_configs.js index 7a20b7d8671..605e24f40ae 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_mute_configs.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_mute_configs.js @@ -26,8 +26,8 @@ function main(parent) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * Required. The parent, which owns the collection of mute configs. Its format - * is "organizations/[organization_id]", "folders/[folder_id]", + * Required. The parent, which owns the collection of mute configs. Its format is + * "organizations/[organization_id]", "folders/[folder_id]", * "projects/[project_id]". */ // const parent = 'abc123' diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_sources.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_sources.js index c4a1ad3dcd1..cb28399a2e8 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_sources.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_sources.js @@ -26,8 +26,8 @@ function main(parent) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * Required. Resource name of the parent of sources to list. Its format should - * be "organizations/[organization_id], folders/[folder_id], or + * Required. Resource name of the parent of sources to list. Its format should be + * "organizations/[organization_id], folders/[folder_id], or * projects/[project_id]". */ // const parent = 'abc123' diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.run_asset_discovery.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.run_asset_discovery.js index 75b1cc837e9..d52034dfd59 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.run_asset_discovery.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.run_asset_discovery.js @@ -26,8 +26,8 @@ function main(parent) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * Required. Name of the organization to run asset discovery for. Its format - * is "organizations/[organization_id]". + * Required. Name of the organization to run asset discovery for. Its format is + * "organizations/[organization_id]". */ // const parent = 'abc123' diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_finding.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_finding.js index effade31d16..43974498848 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_finding.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_finding.js @@ -26,8 +26,8 @@ function main(finding) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * Required. The finding resource to update or create if it does not already - * exist. parent, security_marks, and update_time will be ignored. + * Required. The finding resource to update or create if it does not already exist. + * parent, security_marks, and update_time will be ignored. * In the case of creation, the finding id portion of the name must be * alphanumeric and less than or equal to 32 characters and greater than 0 * characters in length. diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/snippet_metadata.google.cloud.securitycenter.v1.json b/packages/google-cloud-securitycenter/samples/generated/v1/snippet_metadata.google.cloud.securitycenter.v1.json index a1cbd617c4c..3a030076aca 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/snippet_metadata.google.cloud.securitycenter.v1.json +++ b/packages/google-cloud-securitycenter/samples/generated/v1/snippet_metadata.google.cloud.securitycenter.v1.json @@ -210,7 +210,7 @@ "segments": [ { "start": 25, - "end": 66, + "end": 65, "type": "FULL" } ], diff --git a/packages/google-cloud-securitycenter/src/v1/security_center_client.ts b/packages/google-cloud-securitycenter/src/v1/security_center_client.ts index 85e45f8e23b..ab7dbb39ae4 100644 --- a/packages/google-cloud-securitycenter/src/v1/security_center_client.ts +++ b/packages/google-cloud-securitycenter/src/v1/security_center_client.ts @@ -520,8 +520,8 @@ export class SecurityCenterClient { * Required. Resource name of the new source's parent. Its format should be * "organizations/[organization_id]". * @param {google.cloud.securitycenter.v1.Source} request.source - * Required. The Source being created, only the display_name and description - * will be used. All other fields will be ignored. + * Required. The Source being created, only the display_name and description will be + * used. All other fields will be ignored. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -620,8 +620,8 @@ export class SecurityCenterClient { * It must be alphanumeric and less than or equal to 32 characters and * greater than 0 characters in length. * @param {google.cloud.securitycenter.v1.Finding} request.finding - * Required. The Finding being created. The name and security_marks will be - * ignored as they are both output only fields on this resource. + * Required. The Finding being created. The name and security_marks will be ignored as + * they are both output only fields on this resource. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -818,17 +818,16 @@ export class SecurityCenterClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. Resource name of the new notification config's parent. Its format - * is "organizations/[organization_id]". + * Required. Resource name of the new notification config's parent. Its format is + * "organizations/[organization_id]". * @param {string} request.configId * Required. * Unique identifier provided by the client within the parent scope. * It must be between 1 and 128 characters, and contains alphanumeric * characters, underscores or hyphens only. * @param {google.cloud.securitycenter.v1.NotificationConfig} request.notificationConfig - * Required. The notification config being created. The name and the service - * account will be ignored as they are both output only fields on this - * resource. + * Required. The notification config being created. The name and the service account + * will be ignored as they are both output only fields on this resource. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -1510,8 +1509,8 @@ export class SecurityCenterClient { * @param {Object} request * The request object that will be sent. * @param {string} request.name - * Required. Name of the organization to get organization settings for. Its - * format is "organizations/[organization_id]/organizationSettings". + * Required. Name of the organization to get organization settings for. Its format is + * "organizations/[organization_id]/organizationSettings". * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -2180,8 +2179,8 @@ export class SecurityCenterClient { * @param {Object} request * The request object that will be sent. * @param {google.cloud.securitycenter.v1.Finding} request.finding - * Required. The finding resource to update or create if it does not already - * exist. parent, security_marks, and update_time will be ignored. + * Required. The finding resource to update or create if it does not already exist. + * parent, security_marks, and update_time will be ignored. * * In the case of creation, the finding id portion of the name must be * alphanumeric and less than or equal to 32 characters and greater than 0 @@ -3108,8 +3107,8 @@ export class SecurityCenterClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. The parent, at which bulk action needs to be applied. Its format - * is "organizations/[organization_id]", "folders/[folder_id]", + * Required. The parent, at which bulk action needs to be applied. Its format is + * "organizations/[organization_id]", "folders/[folder_id]", * "projects/[project_id]". * @param {string} request.filter * Expression that identifies findings that should be updated. @@ -3276,8 +3275,8 @@ export class SecurityCenterClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. Name of the organization to run asset discovery for. Its format - * is "organizations/[organization_id]". + * Required. Name of the organization to run asset discovery for. Its format is + * "organizations/[organization_id]". * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -3482,9 +3481,9 @@ export class SecurityCenterClient { * Use a negated partial match on the empty string to filter based on a * property not existing: `-resource_properties.my_property : ""` * @param {string} request.groupBy - * Required. Expression that defines what assets fields to use for grouping. - * The string value should follow SQL syntax: comma separated list of fields. - * For example: + * Required. Expression that defines what assets fields to use for grouping. The string + * value should follow SQL syntax: comma separated list of fields. For + * example: * "security_center_properties.resource_project,security_center_properties.project". * * The following fields are supported when compare_duration is not set: @@ -3700,9 +3699,9 @@ export class SecurityCenterClient { * Use a negated partial match on the empty string to filter based on a * property not existing: `-resource_properties.my_property : ""` * @param {string} request.groupBy - * Required. Expression that defines what assets fields to use for grouping. - * The string value should follow SQL syntax: comma separated list of fields. - * For example: + * Required. Expression that defines what assets fields to use for grouping. The string + * value should follow SQL syntax: comma separated list of fields. For + * example: * "security_center_properties.resource_project,security_center_properties.project". * * The following fields are supported when compare_duration is not set: @@ -3866,9 +3865,9 @@ export class SecurityCenterClient { * Use a negated partial match on the empty string to filter based on a * property not existing: `-resource_properties.my_property : ""` * @param {string} request.groupBy - * Required. Expression that defines what assets fields to use for grouping. - * The string value should follow SQL syntax: comma separated list of fields. - * For example: + * Required. Expression that defines what assets fields to use for grouping. The string + * value should follow SQL syntax: comma separated list of fields. For + * example: * "security_center_properties.resource_project,security_center_properties.project". * * The following fields are supported when compare_duration is not set: @@ -4038,9 +4037,9 @@ export class SecurityCenterClient { * * resource.project_display_name: `=`, `:` * * resource.type: `=`, `:` * @param {string} request.groupBy - * Required. Expression that defines what assets fields to use for grouping - * (including `state_change`). The string value should follow SQL syntax: - * comma separated list of fields. For example: "parent,resource_name". + * Required. Expression that defines what assets fields to use for grouping (including + * `state_change`). The string value should follow SQL syntax: comma separated + * list of fields. For example: "parent,resource_name". * * The following fields are supported: * @@ -4259,9 +4258,9 @@ export class SecurityCenterClient { * * resource.project_display_name: `=`, `:` * * resource.type: `=`, `:` * @param {string} request.groupBy - * Required. Expression that defines what assets fields to use for grouping - * (including `state_change`). The string value should follow SQL syntax: - * comma separated list of fields. For example: "parent,resource_name". + * Required. Expression that defines what assets fields to use for grouping (including + * `state_change`). The string value should follow SQL syntax: comma separated + * list of fields. For example: "parent,resource_name". * * The following fields are supported: * @@ -4428,9 +4427,9 @@ export class SecurityCenterClient { * * resource.project_display_name: `=`, `:` * * resource.type: `=`, `:` * @param {string} request.groupBy - * Required. Expression that defines what assets fields to use for grouping - * (including `state_change`). The string value should follow SQL syntax: - * comma separated list of fields. For example: "parent,resource_name". + * Required. Expression that defines what assets fields to use for grouping (including + * `state_change`). The string value should follow SQL syntax: comma separated + * list of fields. For example: "parent,resource_name". * * The following fields are supported: * @@ -5668,8 +5667,8 @@ export class SecurityCenterClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. The parent, which owns the collection of mute configs. Its format - * is "organizations/[organization_id]", "folders/[folder_id]", + * Required. The parent, which owns the collection of mute configs. Its format is + * "organizations/[organization_id]", "folders/[folder_id]", * "projects/[project_id]". * @param {number} request.pageSize * The maximum number of configs to return. The service may return fewer than @@ -5775,8 +5774,8 @@ export class SecurityCenterClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. The parent, which owns the collection of mute configs. Its format - * is "organizations/[organization_id]", "folders/[folder_id]", + * Required. The parent, which owns the collection of mute configs. Its format is + * "organizations/[organization_id]", "folders/[folder_id]", * "projects/[project_id]". * @param {number} request.pageSize * The maximum number of configs to return. The service may return fewer than @@ -5830,8 +5829,8 @@ export class SecurityCenterClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. The parent, which owns the collection of mute configs. Its format - * is "organizations/[organization_id]", "folders/[folder_id]", + * Required. The parent, which owns the collection of mute configs. Its format is + * "organizations/[organization_id]", "folders/[folder_id]", * "projects/[project_id]". * @param {number} request.pageSize * The maximum number of configs to return. The service may return fewer than @@ -6089,8 +6088,8 @@ export class SecurityCenterClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. Resource name of the parent of sources to list. Its format should - * be "organizations/[organization_id], folders/[folder_id], or + * Required. Resource name of the parent of sources to list. Its format should be + * "organizations/[organization_id], folders/[folder_id], or * projects/[project_id]". * @param {string} request.pageToken * The value returned by the last `ListSourcesResponse`; indicates @@ -6192,8 +6191,8 @@ export class SecurityCenterClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. Resource name of the parent of sources to list. Its format should - * be "organizations/[organization_id], folders/[folder_id], or + * Required. Resource name of the parent of sources to list. Its format should be + * "organizations/[organization_id], folders/[folder_id], or * projects/[project_id]". * @param {string} request.pageToken * The value returned by the last `ListSourcesResponse`; indicates @@ -6243,8 +6242,8 @@ export class SecurityCenterClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. Resource name of the parent of sources to list. Its format should - * be "organizations/[organization_id], folders/[folder_id], or + * Required. Resource name of the parent of sources to list. Its format should be + * "organizations/[organization_id], folders/[folder_id], or * projects/[project_id]". * @param {string} request.pageToken * The value returned by the last `ListSourcesResponse`; indicates @@ -6297,8 +6296,8 @@ export class SecurityCenterClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. The parent, which owns the collection of BigQuery exports. Its - * format is "organizations/[organization_id]", "folders/[folder_id]", + * Required. The parent, which owns the collection of BigQuery exports. Its format is + * "organizations/[organization_id]", "folders/[folder_id]", * "projects/[project_id]". * @param {number} request.pageSize * The maximum number of configs to return. The service may return fewer than @@ -6403,8 +6402,8 @@ export class SecurityCenterClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. The parent, which owns the collection of BigQuery exports. Its - * format is "organizations/[organization_id]", "folders/[folder_id]", + * Required. The parent, which owns the collection of BigQuery exports. Its format is + * "organizations/[organization_id]", "folders/[folder_id]", * "projects/[project_id]". * @param {number} request.pageSize * The maximum number of configs to return. The service may return fewer than @@ -6457,8 +6456,8 @@ export class SecurityCenterClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. The parent, which owns the collection of BigQuery exports. Its - * format is "organizations/[organization_id]", "folders/[folder_id]", + * Required. The parent, which owns the collection of BigQuery exports. Its format is + * "organizations/[organization_id]", "folders/[folder_id]", * "projects/[project_id]". * @param {number} request.pageSize * The maximum number of configs to return. The service may return fewer than diff --git a/packages/google-cloud-securitycenter/src/v1/security_center_proto_list.json b/packages/google-cloud-securitycenter/src/v1/security_center_proto_list.json index db5193d0728..017443b29b4 100644 --- a/packages/google-cloud-securitycenter/src/v1/security_center_proto_list.json +++ b/packages/google-cloud-securitycenter/src/v1/security_center_proto_list.json @@ -2,6 +2,7 @@ "../../protos/google/cloud/securitycenter/v1/access.proto", "../../protos/google/cloud/securitycenter/v1/asset.proto", "../../protos/google/cloud/securitycenter/v1/bigquery_export.proto", + "../../protos/google/cloud/securitycenter/v1/connection.proto", "../../protos/google/cloud/securitycenter/v1/external_system.proto", "../../protos/google/cloud/securitycenter/v1/finding.proto", "../../protos/google/cloud/securitycenter/v1/folder.proto", From f2d70d14e0783fd8923ee90576e5fd31d64cb517 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Wed, 20 Apr 2022 18:32:13 +0000 Subject: [PATCH 311/342] build(node): update client library version in samples metadata (#1356) (#481) * build(node): add feat in node post-processor to add client library version number in snippet metadata Co-authored-by: Benjamin E. Coe Source-Link: https://github.com/googleapis/synthtool/commit/d337b88dd1494365183718a2de0b7b4056b6fdfe Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-nodejs:latest@sha256:d106724ad2a96daa1b8d88de101ba50bdb30b8df62ffa0aa2b451d93b4556641 --- ...tadata.google.cloud.securitycenter.v1.json | 3252 ++++++++--------- ...a.google.cloud.securitycenter.v1beta1.json | 1716 ++++----- ...google.cloud.securitycenter.v1p1beta1.json | 2152 +++++------ 3 files changed, 3560 insertions(+), 3560 deletions(-) diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/snippet_metadata.google.cloud.securitycenter.v1.json b/packages/google-cloud-securitycenter/samples/generated/v1/snippet_metadata.google.cloud.securitycenter.v1.json index 3a030076aca..9c55e8ab650 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/snippet_metadata.google.cloud.securitycenter.v1.json +++ b/packages/google-cloud-securitycenter/samples/generated/v1/snippet_metadata.google.cloud.securitycenter.v1.json @@ -1,1699 +1,1699 @@ { - "clientLibrary": { - "name": "nodejs-securitycenter", - "version": "0.1.0", - "language": "TYPESCRIPT", - "apis": [ - { - "id": "google.cloud.securitycenter.v1", - "version": "v1" - } - ] - }, - "snippets": [ - { - "regionTag": "securitycenter_v1_generated_SecurityCenter_BulkMuteFindings_async", - "title": "SecurityCenter bulkMuteFindings Sample", - "origin": "API_DEFINITION", - "description": " Kicks off an LRO to bulk mute findings for a parent based on a filter. The parent can be either an organization, folder or project. The findings matched by the filter will be muted after the LRO is done.", - "canonical": true, - "file": "security_center.bulk_mute_findings.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 76, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "BulkMuteFindings", - "fullName": "google.cloud.securitycenter.v1.SecurityCenter.BulkMuteFindings", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "filter", - "type": "TYPE_STRING" - }, - { - "name": "mute_annotation", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "SecurityCenterClient", - "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" - }, - "method": { - "shortName": "BulkMuteFindings", - "fullName": "google.cloud.securitycenter.v1.SecurityCenter.BulkMuteFindings", - "service": { - "shortName": "SecurityCenter", - "fullName": "google.cloud.securitycenter.v1.SecurityCenter" - } - } - } + "clientLibrary": { + "name": "nodejs-securitycenter", + "version": "5.10.0", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.cloud.securitycenter.v1", + "version": "v1" + } + ] }, - { - "regionTag": "securitycenter_v1_generated_SecurityCenter_CreateSource_async", - "title": "SecurityCenter createSource Sample", - "origin": "API_DEFINITION", - "description": " Creates a source.", - "canonical": true, - "file": "security_center.create_source.js", - "language": "JAVASCRIPT", - "segments": [ + "snippets": [ { - "start": 25, - "end": 57, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateSource", - "fullName": "google.cloud.securitycenter.v1.SecurityCenter.CreateSource", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "source", - "type": ".google.cloud.securitycenter.v1.Source" - } - ], - "resultType": ".google.cloud.securitycenter.v1.Source", - "client": { - "shortName": "SecurityCenterClient", - "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" + "regionTag": "securitycenter_v1_generated_SecurityCenter_BulkMuteFindings_async", + "title": "SecurityCenter bulkMuteFindings Sample", + "origin": "API_DEFINITION", + "description": " Kicks off an LRO to bulk mute findings for a parent based on a filter. The parent can be either an organization, folder or project. The findings matched by the filter will be muted after the LRO is done.", + "canonical": true, + "file": "security_center.bulk_mute_findings.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 76, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "BulkMuteFindings", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.BulkMuteFindings", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "mute_annotation", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" + }, + "method": { + "shortName": "BulkMuteFindings", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.BulkMuteFindings", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + } }, - "method": { - "shortName": "CreateSource", - "fullName": "google.cloud.securitycenter.v1.SecurityCenter.CreateSource", - "service": { - "shortName": "SecurityCenter", - "fullName": "google.cloud.securitycenter.v1.SecurityCenter" - } - } - } - }, - { - "regionTag": "securitycenter_v1_generated_SecurityCenter_CreateFinding_async", - "title": "SecurityCenter createFinding Sample", - "origin": "API_DEFINITION", - "description": " Creates a finding. The corresponding source must exist for finding creation to succeed.", - "canonical": true, - "file": "security_center.create_finding.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 64, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateFinding", - "fullName": "google.cloud.securitycenter.v1.SecurityCenter.CreateFinding", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "finding_id", - "type": "TYPE_STRING" - }, - { - "name": "finding", - "type": ".google.cloud.securitycenter.v1.Finding" - } - ], - "resultType": ".google.cloud.securitycenter.v1.Finding", - "client": { - "shortName": "SecurityCenterClient", - "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" + "regionTag": "securitycenter_v1_generated_SecurityCenter_CreateSource_async", + "title": "SecurityCenter createSource Sample", + "origin": "API_DEFINITION", + "description": " Creates a source.", + "canonical": true, + "file": "security_center.create_source.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 57, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateSource", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.CreateSource", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "source", + "type": ".google.cloud.securitycenter.v1.Source" + } + ], + "resultType": ".google.cloud.securitycenter.v1.Source", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" + }, + "method": { + "shortName": "CreateSource", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.CreateSource", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + } }, - "method": { - "shortName": "CreateFinding", - "fullName": "google.cloud.securitycenter.v1.SecurityCenter.CreateFinding", - "service": { - "shortName": "SecurityCenter", - "fullName": "google.cloud.securitycenter.v1.SecurityCenter" - } - } - } - }, - { - "regionTag": "securitycenter_v1_generated_SecurityCenter_CreateMuteConfig_async", - "title": "SecurityCenter createMuteConfig Sample", - "origin": "API_DEFINITION", - "description": " Creates a mute config.", - "canonical": true, - "file": "security_center.create_mute_config.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 65, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateMuteConfig", - "fullName": "google.cloud.securitycenter.v1.SecurityCenter.CreateMuteConfig", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "mute_config", - "type": ".google.cloud.securitycenter.v1.MuteConfig" - }, - { - "name": "mute_config_id", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.securitycenter.v1.MuteConfig", - "client": { - "shortName": "SecurityCenterClient", - "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" + "regionTag": "securitycenter_v1_generated_SecurityCenter_CreateFinding_async", + "title": "SecurityCenter createFinding Sample", + "origin": "API_DEFINITION", + "description": " Creates a finding. The corresponding source must exist for finding creation to succeed.", + "canonical": true, + "file": "security_center.create_finding.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 64, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateFinding", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.CreateFinding", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "finding_id", + "type": "TYPE_STRING" + }, + { + "name": "finding", + "type": ".google.cloud.securitycenter.v1.Finding" + } + ], + "resultType": ".google.cloud.securitycenter.v1.Finding", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" + }, + "method": { + "shortName": "CreateFinding", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.CreateFinding", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + } }, - "method": { - "shortName": "CreateMuteConfig", - "fullName": "google.cloud.securitycenter.v1.SecurityCenter.CreateMuteConfig", - "service": { - "shortName": "SecurityCenter", - "fullName": "google.cloud.securitycenter.v1.SecurityCenter" - } - } - } - }, - { - "regionTag": "securitycenter_v1_generated_SecurityCenter_CreateNotificationConfig_async", - "title": "SecurityCenter createNotificationConfig Sample", - "origin": "API_DEFINITION", - "description": " Creates a notification config.", - "canonical": true, - "file": "security_center.create_notification_config.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 65, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateNotificationConfig", - "fullName": "google.cloud.securitycenter.v1.SecurityCenter.CreateNotificationConfig", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "config_id", - "type": "TYPE_STRING" - }, - { - "name": "notification_config", - "type": ".google.cloud.securitycenter.v1.NotificationConfig" - } - ], - "resultType": ".google.cloud.securitycenter.v1.NotificationConfig", - "client": { - "shortName": "SecurityCenterClient", - "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" + "regionTag": "securitycenter_v1_generated_SecurityCenter_CreateMuteConfig_async", + "title": "SecurityCenter createMuteConfig Sample", + "origin": "API_DEFINITION", + "description": " Creates a mute config.", + "canonical": true, + "file": "security_center.create_mute_config.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 65, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateMuteConfig", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.CreateMuteConfig", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "mute_config", + "type": ".google.cloud.securitycenter.v1.MuteConfig" + }, + { + "name": "mute_config_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.securitycenter.v1.MuteConfig", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" + }, + "method": { + "shortName": "CreateMuteConfig", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.CreateMuteConfig", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + } }, - "method": { - "shortName": "CreateNotificationConfig", - "fullName": "google.cloud.securitycenter.v1.SecurityCenter.CreateNotificationConfig", - "service": { - "shortName": "SecurityCenter", - "fullName": "google.cloud.securitycenter.v1.SecurityCenter" - } - } - } - }, - { - "regionTag": "securitycenter_v1_generated_SecurityCenter_DeleteMuteConfig_async", - "title": "SecurityCenter deleteMuteConfig Sample", - "origin": "API_DEFINITION", - "description": " Deletes an existing mute config.", - "canonical": true, - "file": "security_center.delete_mute_config.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 53, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteMuteConfig", - "fullName": "google.cloud.securitycenter.v1.SecurityCenter.DeleteMuteConfig", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.protobuf.Empty", - "client": { - "shortName": "SecurityCenterClient", - "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" + "regionTag": "securitycenter_v1_generated_SecurityCenter_CreateNotificationConfig_async", + "title": "SecurityCenter createNotificationConfig Sample", + "origin": "API_DEFINITION", + "description": " Creates a notification config.", + "canonical": true, + "file": "security_center.create_notification_config.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 65, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateNotificationConfig", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.CreateNotificationConfig", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "config_id", + "type": "TYPE_STRING" + }, + { + "name": "notification_config", + "type": ".google.cloud.securitycenter.v1.NotificationConfig" + } + ], + "resultType": ".google.cloud.securitycenter.v1.NotificationConfig", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" + }, + "method": { + "shortName": "CreateNotificationConfig", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.CreateNotificationConfig", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + } }, - "method": { - "shortName": "DeleteMuteConfig", - "fullName": "google.cloud.securitycenter.v1.SecurityCenter.DeleteMuteConfig", - "service": { - "shortName": "SecurityCenter", - "fullName": "google.cloud.securitycenter.v1.SecurityCenter" - } - } - } - }, - { - "regionTag": "securitycenter_v1_generated_SecurityCenter_DeleteNotificationConfig_async", - "title": "SecurityCenter deleteNotificationConfig Sample", - "origin": "API_DEFINITION", - "description": " Deletes a notification config.", - "canonical": true, - "file": "security_center.delete_notification_config.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 51, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteNotificationConfig", - "fullName": "google.cloud.securitycenter.v1.SecurityCenter.DeleteNotificationConfig", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.protobuf.Empty", - "client": { - "shortName": "SecurityCenterClient", - "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" + "regionTag": "securitycenter_v1_generated_SecurityCenter_DeleteMuteConfig_async", + "title": "SecurityCenter deleteMuteConfig Sample", + "origin": "API_DEFINITION", + "description": " Deletes an existing mute config.", + "canonical": true, + "file": "security_center.delete_mute_config.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteMuteConfig", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.DeleteMuteConfig", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" + }, + "method": { + "shortName": "DeleteMuteConfig", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.DeleteMuteConfig", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + } }, - "method": { - "shortName": "DeleteNotificationConfig", - "fullName": "google.cloud.securitycenter.v1.SecurityCenter.DeleteNotificationConfig", - "service": { - "shortName": "SecurityCenter", - "fullName": "google.cloud.securitycenter.v1.SecurityCenter" - } - } - } - }, - { - "regionTag": "securitycenter_v1_generated_SecurityCenter_GetBigQueryExport_async", - "title": "SecurityCenter getBigQueryExport Sample", - "origin": "API_DEFINITION", - "description": " Gets a big query export.", - "canonical": true, - "file": "security_center.get_big_query_export.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 53, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetBigQueryExport", - "fullName": "google.cloud.securitycenter.v1.SecurityCenter.GetBigQueryExport", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.securitycenter.v1.BigQueryExport", - "client": { - "shortName": "SecurityCenterClient", - "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" + "regionTag": "securitycenter_v1_generated_SecurityCenter_DeleteNotificationConfig_async", + "title": "SecurityCenter deleteNotificationConfig Sample", + "origin": "API_DEFINITION", + "description": " Deletes a notification config.", + "canonical": true, + "file": "security_center.delete_notification_config.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 51, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteNotificationConfig", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.DeleteNotificationConfig", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" + }, + "method": { + "shortName": "DeleteNotificationConfig", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.DeleteNotificationConfig", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + } }, - "method": { - "shortName": "GetBigQueryExport", - "fullName": "google.cloud.securitycenter.v1.SecurityCenter.GetBigQueryExport", - "service": { - "shortName": "SecurityCenter", - "fullName": "google.cloud.securitycenter.v1.SecurityCenter" - } - } - } - }, - { - "regionTag": "securitycenter_v1_generated_SecurityCenter_GetIamPolicy_async", - "title": "SecurityCenter getIamPolicy Sample", - "origin": "API_DEFINITION", - "description": " Gets the access control policy on the specified Source.", - "canonical": true, - "file": "security_center.get_iam_policy.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 56, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetIamPolicy", - "fullName": "google.cloud.securitycenter.v1.SecurityCenter.GetIamPolicy", - "async": true, - "parameters": [ - { - "name": "resource", - "type": "TYPE_STRING" - }, - { - "name": "options", - "type": ".google.iam.v1.GetPolicyOptions" - } - ], - "resultType": ".google.iam.v1.Policy", - "client": { - "shortName": "SecurityCenterClient", - "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" + "regionTag": "securitycenter_v1_generated_SecurityCenter_GetBigQueryExport_async", + "title": "SecurityCenter getBigQueryExport Sample", + "origin": "API_DEFINITION", + "description": " Gets a big query export.", + "canonical": true, + "file": "security_center.get_big_query_export.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetBigQueryExport", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.GetBigQueryExport", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.securitycenter.v1.BigQueryExport", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" + }, + "method": { + "shortName": "GetBigQueryExport", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.GetBigQueryExport", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + } }, - "method": { - "shortName": "GetIamPolicy", - "fullName": "google.cloud.securitycenter.v1.SecurityCenter.GetIamPolicy", - "service": { - "shortName": "SecurityCenter", - "fullName": "google.cloud.securitycenter.v1.SecurityCenter" - } - } - } - }, - { - "regionTag": "securitycenter_v1_generated_SecurityCenter_GetMuteConfig_async", - "title": "SecurityCenter getMuteConfig Sample", - "origin": "API_DEFINITION", - "description": " Gets a mute config.", - "canonical": true, - "file": "security_center.get_mute_config.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 53, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetMuteConfig", - "fullName": "google.cloud.securitycenter.v1.SecurityCenter.GetMuteConfig", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.securitycenter.v1.MuteConfig", - "client": { - "shortName": "SecurityCenterClient", - "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" + "regionTag": "securitycenter_v1_generated_SecurityCenter_GetIamPolicy_async", + "title": "SecurityCenter getIamPolicy Sample", + "origin": "API_DEFINITION", + "description": " Gets the access control policy on the specified Source.", + "canonical": true, + "file": "security_center.get_iam_policy.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 56, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetIamPolicy", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.GetIamPolicy", + "async": true, + "parameters": [ + { + "name": "resource", + "type": "TYPE_STRING" + }, + { + "name": "options", + "type": ".google.iam.v1.GetPolicyOptions" + } + ], + "resultType": ".google.iam.v1.Policy", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" + }, + "method": { + "shortName": "GetIamPolicy", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.GetIamPolicy", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + } }, - "method": { - "shortName": "GetMuteConfig", - "fullName": "google.cloud.securitycenter.v1.SecurityCenter.GetMuteConfig", - "service": { - "shortName": "SecurityCenter", - "fullName": "google.cloud.securitycenter.v1.SecurityCenter" - } - } - } - }, - { - "regionTag": "securitycenter_v1_generated_SecurityCenter_GetNotificationConfig_async", - "title": "SecurityCenter getNotificationConfig Sample", - "origin": "API_DEFINITION", - "description": " Gets a notification config.", - "canonical": true, - "file": "security_center.get_notification_config.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 51, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetNotificationConfig", - "fullName": "google.cloud.securitycenter.v1.SecurityCenter.GetNotificationConfig", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.securitycenter.v1.NotificationConfig", - "client": { - "shortName": "SecurityCenterClient", - "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" + "regionTag": "securitycenter_v1_generated_SecurityCenter_GetMuteConfig_async", + "title": "SecurityCenter getMuteConfig Sample", + "origin": "API_DEFINITION", + "description": " Gets a mute config.", + "canonical": true, + "file": "security_center.get_mute_config.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetMuteConfig", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.GetMuteConfig", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.securitycenter.v1.MuteConfig", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" + }, + "method": { + "shortName": "GetMuteConfig", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.GetMuteConfig", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + } }, - "method": { - "shortName": "GetNotificationConfig", - "fullName": "google.cloud.securitycenter.v1.SecurityCenter.GetNotificationConfig", - "service": { - "shortName": "SecurityCenter", - "fullName": "google.cloud.securitycenter.v1.SecurityCenter" - } - } - } - }, - { - "regionTag": "securitycenter_v1_generated_SecurityCenter_GetOrganizationSettings_async", - "title": "SecurityCenter getOrganizationSettings Sample", - "origin": "API_DEFINITION", - "description": " Gets the settings for an organization.", - "canonical": true, - "file": "security_center.get_organization_settings.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 51, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetOrganizationSettings", - "fullName": "google.cloud.securitycenter.v1.SecurityCenter.GetOrganizationSettings", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.securitycenter.v1.OrganizationSettings", - "client": { - "shortName": "SecurityCenterClient", - "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" + "regionTag": "securitycenter_v1_generated_SecurityCenter_GetNotificationConfig_async", + "title": "SecurityCenter getNotificationConfig Sample", + "origin": "API_DEFINITION", + "description": " Gets a notification config.", + "canonical": true, + "file": "security_center.get_notification_config.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 51, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetNotificationConfig", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.GetNotificationConfig", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.securitycenter.v1.NotificationConfig", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" + }, + "method": { + "shortName": "GetNotificationConfig", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.GetNotificationConfig", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + } }, - "method": { - "shortName": "GetOrganizationSettings", - "fullName": "google.cloud.securitycenter.v1.SecurityCenter.GetOrganizationSettings", - "service": { - "shortName": "SecurityCenter", - "fullName": "google.cloud.securitycenter.v1.SecurityCenter" - } - } - } - }, - { - "regionTag": "securitycenter_v1_generated_SecurityCenter_GetSource_async", - "title": "SecurityCenter getSource Sample", - "origin": "API_DEFINITION", - "description": " Gets a source.", - "canonical": true, - "file": "security_center.get_source.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 51, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetSource", - "fullName": "google.cloud.securitycenter.v1.SecurityCenter.GetSource", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.securitycenter.v1.Source", - "client": { - "shortName": "SecurityCenterClient", - "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" + "regionTag": "securitycenter_v1_generated_SecurityCenter_GetOrganizationSettings_async", + "title": "SecurityCenter getOrganizationSettings Sample", + "origin": "API_DEFINITION", + "description": " Gets the settings for an organization.", + "canonical": true, + "file": "security_center.get_organization_settings.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 51, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetOrganizationSettings", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.GetOrganizationSettings", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.securitycenter.v1.OrganizationSettings", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" + }, + "method": { + "shortName": "GetOrganizationSettings", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.GetOrganizationSettings", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + } }, - "method": { - "shortName": "GetSource", - "fullName": "google.cloud.securitycenter.v1.SecurityCenter.GetSource", - "service": { - "shortName": "SecurityCenter", - "fullName": "google.cloud.securitycenter.v1.SecurityCenter" - } - } - } - }, - { - "regionTag": "securitycenter_v1_generated_SecurityCenter_GroupAssets_async", - "title": "SecurityCenter groupAssets Sample", - "origin": "API_DEFINITION", - "description": " Filters an organization's assets and groups them by their specified properties.", - "canonical": true, - "file": "security_center.group_assets.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 165, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GroupAssets", - "fullName": "google.cloud.securitycenter.v1.SecurityCenter.GroupAssets", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "filter", - "type": "TYPE_STRING" - }, - { - "name": "group_by", - "type": "TYPE_STRING" - }, - { - "name": "compare_duration", - "type": ".google.protobuf.Duration" - }, - { - "name": "read_time", - "type": ".google.protobuf.Timestamp" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - } - ], - "resultType": ".google.cloud.securitycenter.v1.GroupAssetsResponse", - "client": { - "shortName": "SecurityCenterClient", - "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" + "regionTag": "securitycenter_v1_generated_SecurityCenter_GetSource_async", + "title": "SecurityCenter getSource Sample", + "origin": "API_DEFINITION", + "description": " Gets a source.", + "canonical": true, + "file": "security_center.get_source.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 51, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetSource", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.GetSource", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.securitycenter.v1.Source", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" + }, + "method": { + "shortName": "GetSource", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.GetSource", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + } }, - "method": { - "shortName": "GroupAssets", - "fullName": "google.cloud.securitycenter.v1.SecurityCenter.GroupAssets", - "service": { - "shortName": "SecurityCenter", - "fullName": "google.cloud.securitycenter.v1.SecurityCenter" - } - } - } - }, - { - "regionTag": "securitycenter_v1_generated_SecurityCenter_GroupFindings_async", - "title": "SecurityCenter groupFindings Sample", - "origin": "API_DEFINITION", - "description": " Filters an organization or source's findings and groups them by their specified properties. To group across all sources provide a `-` as the source id. Example: /v1/organizations/{organization_id}/sources/-/findings, /v1/folders/{folder_id}/sources/-/findings, /v1/projects/{project_id}/sources/-/findings", - "canonical": true, - "file": "security_center.group_findings.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 169, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GroupFindings", - "fullName": "google.cloud.securitycenter.v1.SecurityCenter.GroupFindings", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "filter", - "type": "TYPE_STRING" - }, - { - "name": "group_by", - "type": "TYPE_STRING" - }, - { - "name": "read_time", - "type": ".google.protobuf.Timestamp" - }, - { - "name": "compare_duration", - "type": ".google.protobuf.Duration" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - } - ], - "resultType": ".google.cloud.securitycenter.v1.GroupFindingsResponse", - "client": { - "shortName": "SecurityCenterClient", - "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" + "regionTag": "securitycenter_v1_generated_SecurityCenter_GroupAssets_async", + "title": "SecurityCenter groupAssets Sample", + "origin": "API_DEFINITION", + "description": " Filters an organization's assets and groups them by their specified properties.", + "canonical": true, + "file": "security_center.group_assets.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 165, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GroupAssets", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.GroupAssets", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "group_by", + "type": "TYPE_STRING" + }, + { + "name": "compare_duration", + "type": ".google.protobuf.Duration" + }, + { + "name": "read_time", + "type": ".google.protobuf.Timestamp" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + } + ], + "resultType": ".google.cloud.securitycenter.v1.GroupAssetsResponse", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" + }, + "method": { + "shortName": "GroupAssets", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.GroupAssets", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + } }, - "method": { - "shortName": "GroupFindings", - "fullName": "google.cloud.securitycenter.v1.SecurityCenter.GroupFindings", - "service": { - "shortName": "SecurityCenter", - "fullName": "google.cloud.securitycenter.v1.SecurityCenter" - } - } - } - }, - { - "regionTag": "securitycenter_v1_generated_SecurityCenter_ListAssets_async", - "title": "SecurityCenter listAssets Sample", - "origin": "API_DEFINITION", - "description": " Lists an organization's assets.", - "canonical": true, - "file": "security_center.list_assets.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 174, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListAssets", - "fullName": "google.cloud.securitycenter.v1.SecurityCenter.ListAssets", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "filter", - "type": "TYPE_STRING" - }, - { - "name": "order_by", - "type": "TYPE_STRING" - }, - { - "name": "read_time", - "type": ".google.protobuf.Timestamp" - }, - { - "name": "compare_duration", - "type": ".google.protobuf.Duration" - }, - { - "name": "field_mask", - "type": ".google.protobuf.FieldMask" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - } - ], - "resultType": ".google.cloud.securitycenter.v1.ListAssetsResponse", - "client": { - "shortName": "SecurityCenterClient", - "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" + "regionTag": "securitycenter_v1_generated_SecurityCenter_GroupFindings_async", + "title": "SecurityCenter groupFindings Sample", + "origin": "API_DEFINITION", + "description": " Filters an organization or source's findings and groups them by their specified properties. To group across all sources provide a `-` as the source id. Example: /v1/organizations/{organization_id}/sources/-/findings, /v1/folders/{folder_id}/sources/-/findings, /v1/projects/{project_id}/sources/-/findings", + "canonical": true, + "file": "security_center.group_findings.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 169, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GroupFindings", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.GroupFindings", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "group_by", + "type": "TYPE_STRING" + }, + { + "name": "read_time", + "type": ".google.protobuf.Timestamp" + }, + { + "name": "compare_duration", + "type": ".google.protobuf.Duration" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + } + ], + "resultType": ".google.cloud.securitycenter.v1.GroupFindingsResponse", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" + }, + "method": { + "shortName": "GroupFindings", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.GroupFindings", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + } }, - "method": { - "shortName": "ListAssets", - "fullName": "google.cloud.securitycenter.v1.SecurityCenter.ListAssets", - "service": { - "shortName": "SecurityCenter", - "fullName": "google.cloud.securitycenter.v1.SecurityCenter" - } - } - } - }, - { - "regionTag": "securitycenter_v1_generated_SecurityCenter_ListFindings_async", - "title": "SecurityCenter listFindings Sample", - "origin": "API_DEFINITION", - "description": " Lists an organization or source's findings. To list across all sources provide a `-` as the source id. Example: /v1/organizations/{organization_id}/sources/-/findings", - "canonical": true, - "file": "security_center.list_findings.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 180, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListFindings", - "fullName": "google.cloud.securitycenter.v1.SecurityCenter.ListFindings", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "filter", - "type": "TYPE_STRING" - }, - { - "name": "order_by", - "type": "TYPE_STRING" - }, - { - "name": "read_time", - "type": ".google.protobuf.Timestamp" - }, - { - "name": "compare_duration", - "type": ".google.protobuf.Duration" - }, - { - "name": "field_mask", - "type": ".google.protobuf.FieldMask" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - } - ], - "resultType": ".google.cloud.securitycenter.v1.ListFindingsResponse", - "client": { - "shortName": "SecurityCenterClient", - "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" + "regionTag": "securitycenter_v1_generated_SecurityCenter_ListAssets_async", + "title": "SecurityCenter listAssets Sample", + "origin": "API_DEFINITION", + "description": " Lists an organization's assets.", + "canonical": true, + "file": "security_center.list_assets.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 174, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListAssets", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.ListAssets", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "order_by", + "type": "TYPE_STRING" + }, + { + "name": "read_time", + "type": ".google.protobuf.Timestamp" + }, + { + "name": "compare_duration", + "type": ".google.protobuf.Duration" + }, + { + "name": "field_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + } + ], + "resultType": ".google.cloud.securitycenter.v1.ListAssetsResponse", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" + }, + "method": { + "shortName": "ListAssets", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.ListAssets", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + } }, - "method": { - "shortName": "ListFindings", - "fullName": "google.cloud.securitycenter.v1.SecurityCenter.ListFindings", - "service": { - "shortName": "SecurityCenter", - "fullName": "google.cloud.securitycenter.v1.SecurityCenter" - } - } - } - }, - { - "regionTag": "securitycenter_v1_generated_SecurityCenter_ListMuteConfigs_async", - "title": "SecurityCenter listMuteConfigs Sample", - "origin": "API_DEFINITION", - "description": " Lists mute configs.", - "canonical": true, - "file": "security_center.list_mute_configs.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 68, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListMuteConfigs", - "fullName": "google.cloud.securitycenter.v1.SecurityCenter.ListMuteConfigs", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.securitycenter.v1.ListMuteConfigsResponse", - "client": { - "shortName": "SecurityCenterClient", - "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" + "regionTag": "securitycenter_v1_generated_SecurityCenter_ListFindings_async", + "title": "SecurityCenter listFindings Sample", + "origin": "API_DEFINITION", + "description": " Lists an organization or source's findings. To list across all sources provide a `-` as the source id. Example: /v1/organizations/{organization_id}/sources/-/findings", + "canonical": true, + "file": "security_center.list_findings.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 180, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListFindings", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.ListFindings", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "order_by", + "type": "TYPE_STRING" + }, + { + "name": "read_time", + "type": ".google.protobuf.Timestamp" + }, + { + "name": "compare_duration", + "type": ".google.protobuf.Duration" + }, + { + "name": "field_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + } + ], + "resultType": ".google.cloud.securitycenter.v1.ListFindingsResponse", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" + }, + "method": { + "shortName": "ListFindings", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.ListFindings", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + } }, - "method": { - "shortName": "ListMuteConfigs", - "fullName": "google.cloud.securitycenter.v1.SecurityCenter.ListMuteConfigs", - "service": { - "shortName": "SecurityCenter", - "fullName": "google.cloud.securitycenter.v1.SecurityCenter" - } - } - } - }, - { - "regionTag": "securitycenter_v1_generated_SecurityCenter_ListNotificationConfigs_async", - "title": "SecurityCenter listNotificationConfigs Sample", - "origin": "API_DEFINITION", - "description": " Lists notification configs.", - "canonical": true, - "file": "security_center.list_notification_configs.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 64, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListNotificationConfigs", - "fullName": "google.cloud.securitycenter.v1.SecurityCenter.ListNotificationConfigs", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - } - ], - "resultType": ".google.cloud.securitycenter.v1.ListNotificationConfigsResponse", - "client": { - "shortName": "SecurityCenterClient", - "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" + "regionTag": "securitycenter_v1_generated_SecurityCenter_ListMuteConfigs_async", + "title": "SecurityCenter listMuteConfigs Sample", + "origin": "API_DEFINITION", + "description": " Lists mute configs.", + "canonical": true, + "file": "security_center.list_mute_configs.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 68, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListMuteConfigs", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.ListMuteConfigs", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.securitycenter.v1.ListMuteConfigsResponse", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" + }, + "method": { + "shortName": "ListMuteConfigs", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.ListMuteConfigs", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + } }, - "method": { - "shortName": "ListNotificationConfigs", - "fullName": "google.cloud.securitycenter.v1.SecurityCenter.ListNotificationConfigs", - "service": { - "shortName": "SecurityCenter", - "fullName": "google.cloud.securitycenter.v1.SecurityCenter" - } - } - } - }, - { - "regionTag": "securitycenter_v1_generated_SecurityCenter_ListSources_async", - "title": "SecurityCenter listSources Sample", - "origin": "API_DEFINITION", - "description": " Lists all sources belonging to an organization.", - "canonical": true, - "file": "security_center.list_sources.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 65, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListSources", - "fullName": "google.cloud.securitycenter.v1.SecurityCenter.ListSources", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - } - ], - "resultType": ".google.cloud.securitycenter.v1.ListSourcesResponse", - "client": { - "shortName": "SecurityCenterClient", - "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" + "regionTag": "securitycenter_v1_generated_SecurityCenter_ListNotificationConfigs_async", + "title": "SecurityCenter listNotificationConfigs Sample", + "origin": "API_DEFINITION", + "description": " Lists notification configs.", + "canonical": true, + "file": "security_center.list_notification_configs.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 64, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListNotificationConfigs", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.ListNotificationConfigs", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + } + ], + "resultType": ".google.cloud.securitycenter.v1.ListNotificationConfigsResponse", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" + }, + "method": { + "shortName": "ListNotificationConfigs", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.ListNotificationConfigs", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + } }, - "method": { - "shortName": "ListSources", - "fullName": "google.cloud.securitycenter.v1.SecurityCenter.ListSources", - "service": { - "shortName": "SecurityCenter", - "fullName": "google.cloud.securitycenter.v1.SecurityCenter" - } - } - } - }, - { - "regionTag": "securitycenter_v1_generated_SecurityCenter_RunAssetDiscovery_async", - "title": "SecurityCenter runAssetDiscovery Sample", - "origin": "API_DEFINITION", - "description": " Runs asset discovery. The discovery is tracked with a long-running operation. This API can only be called with limited frequency for an organization. If it is called too frequently the caller will receive a TOO_MANY_REQUESTS error.", - "canonical": true, - "file": "security_center.run_asset_discovery.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 52, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "RunAssetDiscovery", - "fullName": "google.cloud.securitycenter.v1.SecurityCenter.RunAssetDiscovery", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "SecurityCenterClient", - "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" + "regionTag": "securitycenter_v1_generated_SecurityCenter_ListSources_async", + "title": "SecurityCenter listSources Sample", + "origin": "API_DEFINITION", + "description": " Lists all sources belonging to an organization.", + "canonical": true, + "file": "security_center.list_sources.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 65, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListSources", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.ListSources", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + } + ], + "resultType": ".google.cloud.securitycenter.v1.ListSourcesResponse", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" + }, + "method": { + "shortName": "ListSources", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.ListSources", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + } }, - "method": { - "shortName": "RunAssetDiscovery", - "fullName": "google.cloud.securitycenter.v1.SecurityCenter.RunAssetDiscovery", - "service": { - "shortName": "SecurityCenter", - "fullName": "google.cloud.securitycenter.v1.SecurityCenter" - } - } - } - }, - { - "regionTag": "securitycenter_v1_generated_SecurityCenter_SetFindingState_async", - "title": "SecurityCenter setFindingState Sample", - "origin": "API_DEFINITION", - "description": " Updates the state of a finding.", - "canonical": true, - "file": "security_center.set_finding_state.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 63, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "SetFindingState", - "fullName": "google.cloud.securitycenter.v1.SecurityCenter.SetFindingState", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "state", - "type": ".google.cloud.securitycenter.v1.Finding.State" - }, - { - "name": "start_time", - "type": ".google.protobuf.Timestamp" - } - ], - "resultType": ".google.cloud.securitycenter.v1.Finding", - "client": { - "shortName": "SecurityCenterClient", - "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" + "regionTag": "securitycenter_v1_generated_SecurityCenter_RunAssetDiscovery_async", + "title": "SecurityCenter runAssetDiscovery Sample", + "origin": "API_DEFINITION", + "description": " Runs asset discovery. The discovery is tracked with a long-running operation. This API can only be called with limited frequency for an organization. If it is called too frequently the caller will receive a TOO_MANY_REQUESTS error.", + "canonical": true, + "file": "security_center.run_asset_discovery.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 52, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "RunAssetDiscovery", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.RunAssetDiscovery", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" + }, + "method": { + "shortName": "RunAssetDiscovery", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.RunAssetDiscovery", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + } }, - "method": { - "shortName": "SetFindingState", - "fullName": "google.cloud.securitycenter.v1.SecurityCenter.SetFindingState", - "service": { - "shortName": "SecurityCenter", - "fullName": "google.cloud.securitycenter.v1.SecurityCenter" - } - } - } - }, - { - "regionTag": "securitycenter_v1_generated_SecurityCenter_SetMute_async", - "title": "SecurityCenter setMute Sample", - "origin": "API_DEFINITION", - "description": " Updates the mute state of a finding.", - "canonical": true, - "file": "security_center.set_mute.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 60, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "SetMute", - "fullName": "google.cloud.securitycenter.v1.SecurityCenter.SetMute", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "mute", - "type": ".google.cloud.securitycenter.v1.Finding.Mute" - } - ], - "resultType": ".google.cloud.securitycenter.v1.Finding", - "client": { - "shortName": "SecurityCenterClient", - "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" + "regionTag": "securitycenter_v1_generated_SecurityCenter_SetFindingState_async", + "title": "SecurityCenter setFindingState Sample", + "origin": "API_DEFINITION", + "description": " Updates the state of a finding.", + "canonical": true, + "file": "security_center.set_finding_state.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 63, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "SetFindingState", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.SetFindingState", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "state", + "type": ".google.cloud.securitycenter.v1.Finding.State" + }, + { + "name": "start_time", + "type": ".google.protobuf.Timestamp" + } + ], + "resultType": ".google.cloud.securitycenter.v1.Finding", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" + }, + "method": { + "shortName": "SetFindingState", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.SetFindingState", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + } }, - "method": { - "shortName": "SetMute", - "fullName": "google.cloud.securitycenter.v1.SecurityCenter.SetMute", - "service": { - "shortName": "SecurityCenter", - "fullName": "google.cloud.securitycenter.v1.SecurityCenter" - } - } - } - }, - { - "regionTag": "securitycenter_v1_generated_SecurityCenter_SetIamPolicy_async", - "title": "SecurityCenter setIamPolicy Sample", - "origin": "API_DEFINITION", - "description": " Sets the access control policy on the specified Source.", - "canonical": true, - "file": "security_center.set_iam_policy.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 66, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "SetIamPolicy", - "fullName": "google.cloud.securitycenter.v1.SecurityCenter.SetIamPolicy", - "async": true, - "parameters": [ - { - "name": "resource", - "type": "TYPE_STRING" - }, - { - "name": "policy", - "type": ".google.iam.v1.Policy" - }, - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - } - ], - "resultType": ".google.iam.v1.Policy", - "client": { - "shortName": "SecurityCenterClient", - "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" + "regionTag": "securitycenter_v1_generated_SecurityCenter_SetMute_async", + "title": "SecurityCenter setMute Sample", + "origin": "API_DEFINITION", + "description": " Updates the mute state of a finding.", + "canonical": true, + "file": "security_center.set_mute.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 60, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "SetMute", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.SetMute", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "mute", + "type": ".google.cloud.securitycenter.v1.Finding.Mute" + } + ], + "resultType": ".google.cloud.securitycenter.v1.Finding", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" + }, + "method": { + "shortName": "SetMute", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.SetMute", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + } }, - "method": { - "shortName": "SetIamPolicy", - "fullName": "google.cloud.securitycenter.v1.SecurityCenter.SetIamPolicy", - "service": { - "shortName": "SecurityCenter", - "fullName": "google.cloud.securitycenter.v1.SecurityCenter" - } - } - } - }, - { - "regionTag": "securitycenter_v1_generated_SecurityCenter_TestIamPermissions_async", - "title": "SecurityCenter testIamPermissions Sample", - "origin": "API_DEFINITION", - "description": " Returns the permissions that a caller has on the specified source.", - "canonical": true, - "file": "security_center.test_iam_permissions.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 59, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "TestIamPermissions", - "fullName": "google.cloud.securitycenter.v1.SecurityCenter.TestIamPermissions", - "async": true, - "parameters": [ - { - "name": "resource", - "type": "TYPE_STRING" - }, - { - "name": "permissions", - "type": "TYPE_STRING[]" - } - ], - "resultType": ".google.iam.v1.TestIamPermissionsResponse", - "client": { - "shortName": "SecurityCenterClient", - "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" + "regionTag": "securitycenter_v1_generated_SecurityCenter_SetIamPolicy_async", + "title": "SecurityCenter setIamPolicy Sample", + "origin": "API_DEFINITION", + "description": " Sets the access control policy on the specified Source.", + "canonical": true, + "file": "security_center.set_iam_policy.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 66, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "SetIamPolicy", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.SetIamPolicy", + "async": true, + "parameters": [ + { + "name": "resource", + "type": "TYPE_STRING" + }, + { + "name": "policy", + "type": ".google.iam.v1.Policy" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.iam.v1.Policy", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" + }, + "method": { + "shortName": "SetIamPolicy", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.SetIamPolicy", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + } }, - "method": { - "shortName": "TestIamPermissions", - "fullName": "google.cloud.securitycenter.v1.SecurityCenter.TestIamPermissions", - "service": { - "shortName": "SecurityCenter", - "fullName": "google.cloud.securitycenter.v1.SecurityCenter" - } - } - } - }, - { - "regionTag": "securitycenter_v1_generated_SecurityCenter_UpdateExternalSystem_async", - "title": "SecurityCenter updateExternalSystem Sample", - "origin": "API_DEFINITION", - "description": " Updates external system. This is for a given finding.", - "canonical": true, - "file": "security_center.update_external_system.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 55, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateExternalSystem", - "fullName": "google.cloud.securitycenter.v1.SecurityCenter.UpdateExternalSystem", - "async": true, - "parameters": [ - { - "name": "external_system", - "type": ".google.cloud.securitycenter.v1.ExternalSystem" - }, - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - } - ], - "resultType": ".google.cloud.securitycenter.v1.ExternalSystem", - "client": { - "shortName": "SecurityCenterClient", - "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" + "regionTag": "securitycenter_v1_generated_SecurityCenter_TestIamPermissions_async", + "title": "SecurityCenter testIamPermissions Sample", + "origin": "API_DEFINITION", + "description": " Returns the permissions that a caller has on the specified source.", + "canonical": true, + "file": "security_center.test_iam_permissions.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "TestIamPermissions", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.TestIamPermissions", + "async": true, + "parameters": [ + { + "name": "resource", + "type": "TYPE_STRING" + }, + { + "name": "permissions", + "type": "TYPE_STRING[]" + } + ], + "resultType": ".google.iam.v1.TestIamPermissionsResponse", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" + }, + "method": { + "shortName": "TestIamPermissions", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.TestIamPermissions", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + } }, - "method": { - "shortName": "UpdateExternalSystem", - "fullName": "google.cloud.securitycenter.v1.SecurityCenter.UpdateExternalSystem", - "service": { - "shortName": "SecurityCenter", - "fullName": "google.cloud.securitycenter.v1.SecurityCenter" - } - } - } - }, - { - "regionTag": "securitycenter_v1_generated_SecurityCenter_UpdateFinding_async", - "title": "SecurityCenter updateFinding Sample", - "origin": "API_DEFINITION", - "description": " Creates or updates a finding. The corresponding source must exist for a finding creation to succeed.", - "canonical": true, - "file": "security_center.update_finding.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 63, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateFinding", - "fullName": "google.cloud.securitycenter.v1.SecurityCenter.UpdateFinding", - "async": true, - "parameters": [ - { - "name": "finding", - "type": ".google.cloud.securitycenter.v1.Finding" - }, - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - } - ], - "resultType": ".google.cloud.securitycenter.v1.Finding", - "client": { - "shortName": "SecurityCenterClient", - "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" + "regionTag": "securitycenter_v1_generated_SecurityCenter_UpdateExternalSystem_async", + "title": "SecurityCenter updateExternalSystem Sample", + "origin": "API_DEFINITION", + "description": " Updates external system. This is for a given finding.", + "canonical": true, + "file": "security_center.update_external_system.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateExternalSystem", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.UpdateExternalSystem", + "async": true, + "parameters": [ + { + "name": "external_system", + "type": ".google.cloud.securitycenter.v1.ExternalSystem" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.securitycenter.v1.ExternalSystem", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" + }, + "method": { + "shortName": "UpdateExternalSystem", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.UpdateExternalSystem", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + } }, - "method": { - "shortName": "UpdateFinding", - "fullName": "google.cloud.securitycenter.v1.SecurityCenter.UpdateFinding", - "service": { - "shortName": "SecurityCenter", - "fullName": "google.cloud.securitycenter.v1.SecurityCenter" - } - } - } - }, - { - "regionTag": "securitycenter_v1_generated_SecurityCenter_UpdateMuteConfig_async", - "title": "SecurityCenter updateMuteConfig Sample", - "origin": "API_DEFINITION", - "description": " Updates a mute config.", - "canonical": true, - "file": "security_center.update_mute_config.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 55, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateMuteConfig", - "fullName": "google.cloud.securitycenter.v1.SecurityCenter.UpdateMuteConfig", - "async": true, - "parameters": [ - { - "name": "mute_config", - "type": ".google.cloud.securitycenter.v1.MuteConfig" - }, - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - } - ], - "resultType": ".google.cloud.securitycenter.v1.MuteConfig", - "client": { - "shortName": "SecurityCenterClient", - "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" + "regionTag": "securitycenter_v1_generated_SecurityCenter_UpdateFinding_async", + "title": "SecurityCenter updateFinding Sample", + "origin": "API_DEFINITION", + "description": " Creates or updates a finding. The corresponding source must exist for a finding creation to succeed.", + "canonical": true, + "file": "security_center.update_finding.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 63, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateFinding", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.UpdateFinding", + "async": true, + "parameters": [ + { + "name": "finding", + "type": ".google.cloud.securitycenter.v1.Finding" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.securitycenter.v1.Finding", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" + }, + "method": { + "shortName": "UpdateFinding", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.UpdateFinding", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + } }, - "method": { - "shortName": "UpdateMuteConfig", - "fullName": "google.cloud.securitycenter.v1.SecurityCenter.UpdateMuteConfig", - "service": { - "shortName": "SecurityCenter", - "fullName": "google.cloud.securitycenter.v1.SecurityCenter" - } - } - } - }, - { - "regionTag": "securitycenter_v1_generated_SecurityCenter_UpdateNotificationConfig_async", - "title": "SecurityCenter updateNotificationConfig Sample", - "origin": "API_DEFINITION", - "description": " Updates a notification config. The following update fields are allowed: description, pubsub_topic, streaming_config.filter", - "canonical": true, - "file": "security_center.update_notification_config.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 55, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateNotificationConfig", - "fullName": "google.cloud.securitycenter.v1.SecurityCenter.UpdateNotificationConfig", - "async": true, - "parameters": [ - { - "name": "notification_config", - "type": ".google.cloud.securitycenter.v1.NotificationConfig" - }, - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - } - ], - "resultType": ".google.cloud.securitycenter.v1.NotificationConfig", - "client": { - "shortName": "SecurityCenterClient", - "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" + "regionTag": "securitycenter_v1_generated_SecurityCenter_UpdateMuteConfig_async", + "title": "SecurityCenter updateMuteConfig Sample", + "origin": "API_DEFINITION", + "description": " Updates a mute config.", + "canonical": true, + "file": "security_center.update_mute_config.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateMuteConfig", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.UpdateMuteConfig", + "async": true, + "parameters": [ + { + "name": "mute_config", + "type": ".google.cloud.securitycenter.v1.MuteConfig" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.securitycenter.v1.MuteConfig", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" + }, + "method": { + "shortName": "UpdateMuteConfig", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.UpdateMuteConfig", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + } }, - "method": { - "shortName": "UpdateNotificationConfig", - "fullName": "google.cloud.securitycenter.v1.SecurityCenter.UpdateNotificationConfig", - "service": { - "shortName": "SecurityCenter", - "fullName": "google.cloud.securitycenter.v1.SecurityCenter" - } - } - } - }, - { - "regionTag": "securitycenter_v1_generated_SecurityCenter_UpdateOrganizationSettings_async", - "title": "SecurityCenter updateOrganizationSettings Sample", - "origin": "API_DEFINITION", - "description": " Updates an organization's settings.", - "canonical": true, - "file": "security_center.update_organization_settings.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 55, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateOrganizationSettings", - "fullName": "google.cloud.securitycenter.v1.SecurityCenter.UpdateOrganizationSettings", - "async": true, - "parameters": [ - { - "name": "organization_settings", - "type": ".google.cloud.securitycenter.v1.OrganizationSettings" - }, - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - } - ], - "resultType": ".google.cloud.securitycenter.v1.OrganizationSettings", - "client": { - "shortName": "SecurityCenterClient", - "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" + "regionTag": "securitycenter_v1_generated_SecurityCenter_UpdateNotificationConfig_async", + "title": "SecurityCenter updateNotificationConfig Sample", + "origin": "API_DEFINITION", + "description": " Updates a notification config. The following update fields are allowed: description, pubsub_topic, streaming_config.filter", + "canonical": true, + "file": "security_center.update_notification_config.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateNotificationConfig", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.UpdateNotificationConfig", + "async": true, + "parameters": [ + { + "name": "notification_config", + "type": ".google.cloud.securitycenter.v1.NotificationConfig" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.securitycenter.v1.NotificationConfig", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" + }, + "method": { + "shortName": "UpdateNotificationConfig", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.UpdateNotificationConfig", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + } }, - "method": { - "shortName": "UpdateOrganizationSettings", - "fullName": "google.cloud.securitycenter.v1.SecurityCenter.UpdateOrganizationSettings", - "service": { - "shortName": "SecurityCenter", - "fullName": "google.cloud.securitycenter.v1.SecurityCenter" - } - } - } - }, - { - "regionTag": "securitycenter_v1_generated_SecurityCenter_UpdateSource_async", - "title": "SecurityCenter updateSource Sample", - "origin": "API_DEFINITION", - "description": " Updates a source.", - "canonical": true, - "file": "security_center.update_source.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 55, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateSource", - "fullName": "google.cloud.securitycenter.v1.SecurityCenter.UpdateSource", - "async": true, - "parameters": [ - { - "name": "source", - "type": ".google.cloud.securitycenter.v1.Source" - }, - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - } - ], - "resultType": ".google.cloud.securitycenter.v1.Source", - "client": { - "shortName": "SecurityCenterClient", - "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" + "regionTag": "securitycenter_v1_generated_SecurityCenter_UpdateOrganizationSettings_async", + "title": "SecurityCenter updateOrganizationSettings Sample", + "origin": "API_DEFINITION", + "description": " Updates an organization's settings.", + "canonical": true, + "file": "security_center.update_organization_settings.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateOrganizationSettings", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.UpdateOrganizationSettings", + "async": true, + "parameters": [ + { + "name": "organization_settings", + "type": ".google.cloud.securitycenter.v1.OrganizationSettings" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.securitycenter.v1.OrganizationSettings", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" + }, + "method": { + "shortName": "UpdateOrganizationSettings", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.UpdateOrganizationSettings", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + } }, - "method": { - "shortName": "UpdateSource", - "fullName": "google.cloud.securitycenter.v1.SecurityCenter.UpdateSource", - "service": { - "shortName": "SecurityCenter", - "fullName": "google.cloud.securitycenter.v1.SecurityCenter" - } - } - } - }, - { - "regionTag": "securitycenter_v1_generated_SecurityCenter_UpdateSecurityMarks_async", - "title": "SecurityCenter updateSecurityMarks Sample", - "origin": "API_DEFINITION", - "description": " Updates security marks.", - "canonical": true, - "file": "security_center.update_security_marks.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 64, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateSecurityMarks", - "fullName": "google.cloud.securitycenter.v1.SecurityCenter.UpdateSecurityMarks", - "async": true, - "parameters": [ - { - "name": "security_marks", - "type": ".google.cloud.securitycenter.v1.SecurityMarks" - }, - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - }, - { - "name": "start_time", - "type": ".google.protobuf.Timestamp" - } - ], - "resultType": ".google.cloud.securitycenter.v1.SecurityMarks", - "client": { - "shortName": "SecurityCenterClient", - "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" + "regionTag": "securitycenter_v1_generated_SecurityCenter_UpdateSource_async", + "title": "SecurityCenter updateSource Sample", + "origin": "API_DEFINITION", + "description": " Updates a source.", + "canonical": true, + "file": "security_center.update_source.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateSource", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.UpdateSource", + "async": true, + "parameters": [ + { + "name": "source", + "type": ".google.cloud.securitycenter.v1.Source" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.securitycenter.v1.Source", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" + }, + "method": { + "shortName": "UpdateSource", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.UpdateSource", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + } }, - "method": { - "shortName": "UpdateSecurityMarks", - "fullName": "google.cloud.securitycenter.v1.SecurityCenter.UpdateSecurityMarks", - "service": { - "shortName": "SecurityCenter", - "fullName": "google.cloud.securitycenter.v1.SecurityCenter" - } - } - } - }, - { - "regionTag": "securitycenter_v1_generated_SecurityCenter_CreateBigQueryExport_async", - "title": "SecurityCenter createBigQueryExport Sample", - "origin": "API_DEFINITION", - "description": " Creates a big query export.", - "canonical": true, - "file": "security_center.create_big_query_export.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 65, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateBigQueryExport", - "fullName": "google.cloud.securitycenter.v1.SecurityCenter.CreateBigQueryExport", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "big_query_export", - "type": ".google.cloud.securitycenter.v1.BigQueryExport" - }, - { - "name": "big_query_export_id", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.securitycenter.v1.BigQueryExport", - "client": { - "shortName": "SecurityCenterClient", - "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" + "regionTag": "securitycenter_v1_generated_SecurityCenter_UpdateSecurityMarks_async", + "title": "SecurityCenter updateSecurityMarks Sample", + "origin": "API_DEFINITION", + "description": " Updates security marks.", + "canonical": true, + "file": "security_center.update_security_marks.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 64, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateSecurityMarks", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.UpdateSecurityMarks", + "async": true, + "parameters": [ + { + "name": "security_marks", + "type": ".google.cloud.securitycenter.v1.SecurityMarks" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "start_time", + "type": ".google.protobuf.Timestamp" + } + ], + "resultType": ".google.cloud.securitycenter.v1.SecurityMarks", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" + }, + "method": { + "shortName": "UpdateSecurityMarks", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.UpdateSecurityMarks", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + } }, - "method": { - "shortName": "CreateBigQueryExport", - "fullName": "google.cloud.securitycenter.v1.SecurityCenter.CreateBigQueryExport", - "service": { - "shortName": "SecurityCenter", - "fullName": "google.cloud.securitycenter.v1.SecurityCenter" - } - } - } - }, - { - "regionTag": "securitycenter_v1_generated_SecurityCenter_DeleteBigQueryExport_async", - "title": "SecurityCenter deleteBigQueryExport Sample", - "origin": "API_DEFINITION", - "description": " Deletes an existing big query export.", - "canonical": true, - "file": "security_center.delete_big_query_export.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 53, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteBigQueryExport", - "fullName": "google.cloud.securitycenter.v1.SecurityCenter.DeleteBigQueryExport", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.protobuf.Empty", - "client": { - "shortName": "SecurityCenterClient", - "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" + "regionTag": "securitycenter_v1_generated_SecurityCenter_CreateBigQueryExport_async", + "title": "SecurityCenter createBigQueryExport Sample", + "origin": "API_DEFINITION", + "description": " Creates a big query export.", + "canonical": true, + "file": "security_center.create_big_query_export.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 65, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateBigQueryExport", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.CreateBigQueryExport", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "big_query_export", + "type": ".google.cloud.securitycenter.v1.BigQueryExport" + }, + { + "name": "big_query_export_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.securitycenter.v1.BigQueryExport", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" + }, + "method": { + "shortName": "CreateBigQueryExport", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.CreateBigQueryExport", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + } }, - "method": { - "shortName": "DeleteBigQueryExport", - "fullName": "google.cloud.securitycenter.v1.SecurityCenter.DeleteBigQueryExport", - "service": { - "shortName": "SecurityCenter", - "fullName": "google.cloud.securitycenter.v1.SecurityCenter" - } - } - } - }, - { - "regionTag": "securitycenter_v1_generated_SecurityCenter_UpdateBigQueryExport_async", - "title": "SecurityCenter updateBigQueryExport Sample", - "origin": "API_DEFINITION", - "description": " Updates a BigQuery export.", - "canonical": true, - "file": "security_center.update_big_query_export.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 55, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateBigQueryExport", - "fullName": "google.cloud.securitycenter.v1.SecurityCenter.UpdateBigQueryExport", - "async": true, - "parameters": [ - { - "name": "big_query_export", - "type": ".google.cloud.securitycenter.v1.BigQueryExport" - }, - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - } - ], - "resultType": ".google.cloud.securitycenter.v1.BigQueryExport", - "client": { - "shortName": "SecurityCenterClient", - "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" + "regionTag": "securitycenter_v1_generated_SecurityCenter_DeleteBigQueryExport_async", + "title": "SecurityCenter deleteBigQueryExport Sample", + "origin": "API_DEFINITION", + "description": " Deletes an existing big query export.", + "canonical": true, + "file": "security_center.delete_big_query_export.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteBigQueryExport", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.DeleteBigQueryExport", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" + }, + "method": { + "shortName": "DeleteBigQueryExport", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.DeleteBigQueryExport", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + } }, - "method": { - "shortName": "UpdateBigQueryExport", - "fullName": "google.cloud.securitycenter.v1.SecurityCenter.UpdateBigQueryExport", - "service": { - "shortName": "SecurityCenter", - "fullName": "google.cloud.securitycenter.v1.SecurityCenter" - } - } - } - }, - { - "regionTag": "securitycenter_v1_generated_SecurityCenter_ListBigQueryExports_async", - "title": "SecurityCenter listBigQueryExports Sample", - "origin": "API_DEFINITION", - "description": " Lists BigQuery exports. Note that when requesting BigQuery exports at a given level all exports under that level are also returned e.g. if requesting BigQuery exports under a folder, then all BigQuery exports immediately under the folder plus the ones created under the projects within the folder are returned.", - "canonical": true, - "file": "security_center.list_big_query_exports.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 68, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListBigQueryExports", - "fullName": "google.cloud.securitycenter.v1.SecurityCenter.ListBigQueryExports", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.securitycenter.v1.ListBigQueryExportsResponse", - "client": { - "shortName": "SecurityCenterClient", - "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" + "regionTag": "securitycenter_v1_generated_SecurityCenter_UpdateBigQueryExport_async", + "title": "SecurityCenter updateBigQueryExport Sample", + "origin": "API_DEFINITION", + "description": " Updates a BigQuery export.", + "canonical": true, + "file": "security_center.update_big_query_export.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateBigQueryExport", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.UpdateBigQueryExport", + "async": true, + "parameters": [ + { + "name": "big_query_export", + "type": ".google.cloud.securitycenter.v1.BigQueryExport" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.securitycenter.v1.BigQueryExport", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" + }, + "method": { + "shortName": "UpdateBigQueryExport", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.UpdateBigQueryExport", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + } }, - "method": { - "shortName": "ListBigQueryExports", - "fullName": "google.cloud.securitycenter.v1.SecurityCenter.ListBigQueryExports", - "service": { - "shortName": "SecurityCenter", - "fullName": "google.cloud.securitycenter.v1.SecurityCenter" - } + { + "regionTag": "securitycenter_v1_generated_SecurityCenter_ListBigQueryExports_async", + "title": "SecurityCenter listBigQueryExports Sample", + "origin": "API_DEFINITION", + "description": " Lists BigQuery exports. Note that when requesting BigQuery exports at a given level all exports under that level are also returned e.g. if requesting BigQuery exports under a folder, then all BigQuery exports immediately under the folder plus the ones created under the projects within the folder are returned.", + "canonical": true, + "file": "security_center.list_big_query_exports.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 68, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListBigQueryExports", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.ListBigQueryExports", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.securitycenter.v1.ListBigQueryExportsResponse", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" + }, + "method": { + "shortName": "ListBigQueryExports", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.ListBigQueryExports", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + } } - } - } - ] -} + ] +} \ No newline at end of file diff --git a/packages/google-cloud-securitycenter/samples/generated/v1beta1/snippet_metadata.google.cloud.securitycenter.v1beta1.json b/packages/google-cloud-securitycenter/samples/generated/v1beta1/snippet_metadata.google.cloud.securitycenter.v1beta1.json index 93228556994..67bec451de9 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1beta1/snippet_metadata.google.cloud.securitycenter.v1beta1.json +++ b/packages/google-cloud-securitycenter/samples/generated/v1beta1/snippet_metadata.google.cloud.securitycenter.v1beta1.json @@ -1,895 +1,895 @@ { - "clientLibrary": { - "name": "nodejs-securitycenter", - "version": "0.1.0", - "language": "TYPESCRIPT", - "apis": [ - { - "id": "google.cloud.securitycenter.v1beta1", - "version": "v1beta1" - } - ] - }, - "snippets": [ - { - "regionTag": "securitycenter_v1beta1_generated_SecurityCenter_CreateSource_async", - "title": "SecurityCenter createSource Sample", - "origin": "API_DEFINITION", - "description": " Creates a source.", - "canonical": true, - "file": "security_center.create_source.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 57, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateSource", - "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter.CreateSource", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "source", - "type": ".google.cloud.securitycenter.v1beta1.Source" - } - ], - "resultType": ".google.cloud.securitycenter.v1beta1.Source", - "client": { - "shortName": "SecurityCenterClient", - "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenterClient" - }, - "method": { - "shortName": "CreateSource", - "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter.CreateSource", - "service": { - "shortName": "SecurityCenter", - "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter" - } - } - } + "clientLibrary": { + "name": "nodejs-securitycenter", + "version": "5.10.0", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.cloud.securitycenter.v1beta1", + "version": "v1beta1" + } + ] }, - { - "regionTag": "securitycenter_v1beta1_generated_SecurityCenter_CreateFinding_async", - "title": "SecurityCenter createFinding Sample", - "origin": "API_DEFINITION", - "description": " Creates a finding. The corresponding source must exist for finding creation to succeed.", - "canonical": true, - "file": "security_center.create_finding.js", - "language": "JAVASCRIPT", - "segments": [ + "snippets": [ { - "start": 25, - "end": 64, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateFinding", - "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter.CreateFinding", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "finding_id", - "type": "TYPE_STRING" - }, - { - "name": "finding", - "type": ".google.cloud.securitycenter.v1beta1.Finding" - } - ], - "resultType": ".google.cloud.securitycenter.v1beta1.Finding", - "client": { - "shortName": "SecurityCenterClient", - "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenterClient" + "regionTag": "securitycenter_v1beta1_generated_SecurityCenter_CreateSource_async", + "title": "SecurityCenter createSource Sample", + "origin": "API_DEFINITION", + "description": " Creates a source.", + "canonical": true, + "file": "security_center.create_source.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 57, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateSource", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter.CreateSource", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "source", + "type": ".google.cloud.securitycenter.v1beta1.Source" + } + ], + "resultType": ".google.cloud.securitycenter.v1beta1.Source", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenterClient" + }, + "method": { + "shortName": "CreateSource", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter.CreateSource", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter" + } + } + } }, - "method": { - "shortName": "CreateFinding", - "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter.CreateFinding", - "service": { - "shortName": "SecurityCenter", - "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter" - } - } - } - }, - { - "regionTag": "securitycenter_v1beta1_generated_SecurityCenter_GetIamPolicy_async", - "title": "SecurityCenter getIamPolicy Sample", - "origin": "API_DEFINITION", - "description": " Gets the access control policy on the specified Source.", - "canonical": true, - "file": "security_center.get_iam_policy.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 56, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetIamPolicy", - "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter.GetIamPolicy", - "async": true, - "parameters": [ - { - "name": "resource", - "type": "TYPE_STRING" - }, - { - "name": "options", - "type": ".google.iam.v1.GetPolicyOptions" - } - ], - "resultType": ".google.iam.v1.Policy", - "client": { - "shortName": "SecurityCenterClient", - "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenterClient" + "regionTag": "securitycenter_v1beta1_generated_SecurityCenter_CreateFinding_async", + "title": "SecurityCenter createFinding Sample", + "origin": "API_DEFINITION", + "description": " Creates a finding. The corresponding source must exist for finding creation to succeed.", + "canonical": true, + "file": "security_center.create_finding.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 64, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateFinding", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter.CreateFinding", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "finding_id", + "type": "TYPE_STRING" + }, + { + "name": "finding", + "type": ".google.cloud.securitycenter.v1beta1.Finding" + } + ], + "resultType": ".google.cloud.securitycenter.v1beta1.Finding", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenterClient" + }, + "method": { + "shortName": "CreateFinding", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter.CreateFinding", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter" + } + } + } }, - "method": { - "shortName": "GetIamPolicy", - "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter.GetIamPolicy", - "service": { - "shortName": "SecurityCenter", - "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter" - } - } - } - }, - { - "regionTag": "securitycenter_v1beta1_generated_SecurityCenter_GetOrganizationSettings_async", - "title": "SecurityCenter getOrganizationSettings Sample", - "origin": "API_DEFINITION", - "description": " Gets the settings for an organization.", - "canonical": true, - "file": "security_center.get_organization_settings.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 51, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetOrganizationSettings", - "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter.GetOrganizationSettings", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.securitycenter.v1beta1.OrganizationSettings", - "client": { - "shortName": "SecurityCenterClient", - "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenterClient" + "regionTag": "securitycenter_v1beta1_generated_SecurityCenter_GetIamPolicy_async", + "title": "SecurityCenter getIamPolicy Sample", + "origin": "API_DEFINITION", + "description": " Gets the access control policy on the specified Source.", + "canonical": true, + "file": "security_center.get_iam_policy.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 56, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetIamPolicy", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter.GetIamPolicy", + "async": true, + "parameters": [ + { + "name": "resource", + "type": "TYPE_STRING" + }, + { + "name": "options", + "type": ".google.iam.v1.GetPolicyOptions" + } + ], + "resultType": ".google.iam.v1.Policy", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenterClient" + }, + "method": { + "shortName": "GetIamPolicy", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter.GetIamPolicy", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter" + } + } + } }, - "method": { - "shortName": "GetOrganizationSettings", - "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter.GetOrganizationSettings", - "service": { - "shortName": "SecurityCenter", - "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter" - } - } - } - }, - { - "regionTag": "securitycenter_v1beta1_generated_SecurityCenter_GetSource_async", - "title": "SecurityCenter getSource Sample", - "origin": "API_DEFINITION", - "description": " Gets a source.", - "canonical": true, - "file": "security_center.get_source.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 51, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetSource", - "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter.GetSource", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.securitycenter.v1beta1.Source", - "client": { - "shortName": "SecurityCenterClient", - "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenterClient" + "regionTag": "securitycenter_v1beta1_generated_SecurityCenter_GetOrganizationSettings_async", + "title": "SecurityCenter getOrganizationSettings Sample", + "origin": "API_DEFINITION", + "description": " Gets the settings for an organization.", + "canonical": true, + "file": "security_center.get_organization_settings.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 51, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetOrganizationSettings", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter.GetOrganizationSettings", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.securitycenter.v1beta1.OrganizationSettings", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenterClient" + }, + "method": { + "shortName": "GetOrganizationSettings", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter.GetOrganizationSettings", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter" + } + } + } }, - "method": { - "shortName": "GetSource", - "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter.GetSource", - "service": { - "shortName": "SecurityCenter", - "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter" - } - } - } - }, - { - "regionTag": "securitycenter_v1beta1_generated_SecurityCenter_GroupAssets_async", - "title": "SecurityCenter groupAssets Sample", - "origin": "API_DEFINITION", - "description": " Filters an organization's assets and groups them by their specified properties.", - "canonical": true, - "file": "security_center.group_assets.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 128, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GroupAssets", - "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter.GroupAssets", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "filter", - "type": "TYPE_STRING" - }, - { - "name": "group_by", - "type": "TYPE_STRING" - }, - { - "name": "compare_duration", - "type": ".google.protobuf.Duration" - }, - { - "name": "read_time", - "type": ".google.protobuf.Timestamp" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - } - ], - "resultType": ".google.cloud.securitycenter.v1beta1.GroupAssetsResponse", - "client": { - "shortName": "SecurityCenterClient", - "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenterClient" + "regionTag": "securitycenter_v1beta1_generated_SecurityCenter_GetSource_async", + "title": "SecurityCenter getSource Sample", + "origin": "API_DEFINITION", + "description": " Gets a source.", + "canonical": true, + "file": "security_center.get_source.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 51, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetSource", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter.GetSource", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.securitycenter.v1beta1.Source", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenterClient" + }, + "method": { + "shortName": "GetSource", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter.GetSource", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter" + } + } + } }, - "method": { - "shortName": "GroupAssets", - "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter.GroupAssets", - "service": { - "shortName": "SecurityCenter", - "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter" - } - } - } - }, - { - "regionTag": "securitycenter_v1beta1_generated_SecurityCenter_GroupFindings_async", - "title": "SecurityCenter groupFindings Sample", - "origin": "API_DEFINITION", - "description": " Filters an organization or source's findings and groups them by their specified properties. To group across all sources provide a `-` as the source id. Example: /v1beta1/organizations/{organization_id}/sources/-/findings", - "canonical": true, - "file": "security_center.group_findings.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 107, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GroupFindings", - "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter.GroupFindings", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "filter", - "type": "TYPE_STRING" - }, - { - "name": "group_by", - "type": "TYPE_STRING" - }, - { - "name": "read_time", - "type": ".google.protobuf.Timestamp" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - } - ], - "resultType": ".google.cloud.securitycenter.v1beta1.GroupFindingsResponse", - "client": { - "shortName": "SecurityCenterClient", - "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenterClient" + "regionTag": "securitycenter_v1beta1_generated_SecurityCenter_GroupAssets_async", + "title": "SecurityCenter groupAssets Sample", + "origin": "API_DEFINITION", + "description": " Filters an organization's assets and groups them by their specified properties.", + "canonical": true, + "file": "security_center.group_assets.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 128, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GroupAssets", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter.GroupAssets", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "group_by", + "type": "TYPE_STRING" + }, + { + "name": "compare_duration", + "type": ".google.protobuf.Duration" + }, + { + "name": "read_time", + "type": ".google.protobuf.Timestamp" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + } + ], + "resultType": ".google.cloud.securitycenter.v1beta1.GroupAssetsResponse", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenterClient" + }, + "method": { + "shortName": "GroupAssets", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter.GroupAssets", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter" + } + } + } }, - "method": { - "shortName": "GroupFindings", - "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter.GroupFindings", - "service": { - "shortName": "SecurityCenter", - "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter" - } - } - } - }, - { - "regionTag": "securitycenter_v1beta1_generated_SecurityCenter_ListAssets_async", - "title": "SecurityCenter listAssets Sample", - "origin": "API_DEFINITION", - "description": " Lists an organization's assets.", - "canonical": true, - "file": "security_center.list_assets.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 133, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListAssets", - "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter.ListAssets", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "filter", - "type": "TYPE_STRING" - }, - { - "name": "order_by", - "type": "TYPE_STRING" - }, - { - "name": "read_time", - "type": ".google.protobuf.Timestamp" - }, - { - "name": "compare_duration", - "type": ".google.protobuf.Duration" - }, - { - "name": "field_mask", - "type": ".google.protobuf.FieldMask" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - } - ], - "resultType": ".google.cloud.securitycenter.v1beta1.ListAssetsResponse", - "client": { - "shortName": "SecurityCenterClient", - "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenterClient" + "regionTag": "securitycenter_v1beta1_generated_SecurityCenter_GroupFindings_async", + "title": "SecurityCenter groupFindings Sample", + "origin": "API_DEFINITION", + "description": " Filters an organization or source's findings and groups them by their specified properties. To group across all sources provide a `-` as the source id. Example: /v1beta1/organizations/{organization_id}/sources/-/findings", + "canonical": true, + "file": "security_center.group_findings.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 107, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GroupFindings", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter.GroupFindings", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "group_by", + "type": "TYPE_STRING" + }, + { + "name": "read_time", + "type": ".google.protobuf.Timestamp" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + } + ], + "resultType": ".google.cloud.securitycenter.v1beta1.GroupFindingsResponse", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenterClient" + }, + "method": { + "shortName": "GroupFindings", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter.GroupFindings", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter" + } + } + } }, - "method": { - "shortName": "ListAssets", - "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter.ListAssets", - "service": { - "shortName": "SecurityCenter", - "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter" - } - } - } - }, - { - "regionTag": "securitycenter_v1beta1_generated_SecurityCenter_ListFindings_async", - "title": "SecurityCenter listFindings Sample", - "origin": "API_DEFINITION", - "description": " Lists an organization or source's findings. To list across all sources provide a `-` as the source id. Example: /v1beta1/organizations/{organization_id}/sources/-/findings", - "canonical": true, - "file": "security_center.list_findings.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 110, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListFindings", - "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter.ListFindings", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "filter", - "type": "TYPE_STRING" - }, - { - "name": "order_by", - "type": "TYPE_STRING" - }, - { - "name": "read_time", - "type": ".google.protobuf.Timestamp" - }, - { - "name": "field_mask", - "type": ".google.protobuf.FieldMask" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - } - ], - "resultType": ".google.cloud.securitycenter.v1beta1.ListFindingsResponse", - "client": { - "shortName": "SecurityCenterClient", - "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenterClient" + "regionTag": "securitycenter_v1beta1_generated_SecurityCenter_ListAssets_async", + "title": "SecurityCenter listAssets Sample", + "origin": "API_DEFINITION", + "description": " Lists an organization's assets.", + "canonical": true, + "file": "security_center.list_assets.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 133, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListAssets", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter.ListAssets", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "order_by", + "type": "TYPE_STRING" + }, + { + "name": "read_time", + "type": ".google.protobuf.Timestamp" + }, + { + "name": "compare_duration", + "type": ".google.protobuf.Duration" + }, + { + "name": "field_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + } + ], + "resultType": ".google.cloud.securitycenter.v1beta1.ListAssetsResponse", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenterClient" + }, + "method": { + "shortName": "ListAssets", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter.ListAssets", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter" + } + } + } }, - "method": { - "shortName": "ListFindings", - "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter.ListFindings", - "service": { - "shortName": "SecurityCenter", - "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter" - } - } - } - }, - { - "regionTag": "securitycenter_v1beta1_generated_SecurityCenter_ListSources_async", - "title": "SecurityCenter listSources Sample", - "origin": "API_DEFINITION", - "description": " Lists all sources belonging to an organization.", - "canonical": true, - "file": "security_center.list_sources.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 64, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListSources", - "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter.ListSources", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - } - ], - "resultType": ".google.cloud.securitycenter.v1beta1.ListSourcesResponse", - "client": { - "shortName": "SecurityCenterClient", - "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenterClient" + "regionTag": "securitycenter_v1beta1_generated_SecurityCenter_ListFindings_async", + "title": "SecurityCenter listFindings Sample", + "origin": "API_DEFINITION", + "description": " Lists an organization or source's findings. To list across all sources provide a `-` as the source id. Example: /v1beta1/organizations/{organization_id}/sources/-/findings", + "canonical": true, + "file": "security_center.list_findings.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 110, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListFindings", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter.ListFindings", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "order_by", + "type": "TYPE_STRING" + }, + { + "name": "read_time", + "type": ".google.protobuf.Timestamp" + }, + { + "name": "field_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + } + ], + "resultType": ".google.cloud.securitycenter.v1beta1.ListFindingsResponse", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenterClient" + }, + "method": { + "shortName": "ListFindings", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter.ListFindings", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter" + } + } + } }, - "method": { - "shortName": "ListSources", - "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter.ListSources", - "service": { - "shortName": "SecurityCenter", - "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter" - } - } - } - }, - { - "regionTag": "securitycenter_v1beta1_generated_SecurityCenter_RunAssetDiscovery_async", - "title": "SecurityCenter runAssetDiscovery Sample", - "origin": "API_DEFINITION", - "description": " Runs asset discovery. The discovery is tracked with a long-running operation. This API can only be called with limited frequency for an organization. If it is called too frequently the caller will receive a TOO_MANY_REQUESTS error.", - "canonical": true, - "file": "security_center.run_asset_discovery.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 52, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "RunAssetDiscovery", - "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter.RunAssetDiscovery", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "SecurityCenterClient", - "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenterClient" + "regionTag": "securitycenter_v1beta1_generated_SecurityCenter_ListSources_async", + "title": "SecurityCenter listSources Sample", + "origin": "API_DEFINITION", + "description": " Lists all sources belonging to an organization.", + "canonical": true, + "file": "security_center.list_sources.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 64, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListSources", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter.ListSources", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + } + ], + "resultType": ".google.cloud.securitycenter.v1beta1.ListSourcesResponse", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenterClient" + }, + "method": { + "shortName": "ListSources", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter.ListSources", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter" + } + } + } }, - "method": { - "shortName": "RunAssetDiscovery", - "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter.RunAssetDiscovery", - "service": { - "shortName": "SecurityCenter", - "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter" - } - } - } - }, - { - "regionTag": "securitycenter_v1beta1_generated_SecurityCenter_SetFindingState_async", - "title": "SecurityCenter setFindingState Sample", - "origin": "API_DEFINITION", - "description": " Updates the state of a finding.", - "canonical": true, - "file": "security_center.set_finding_state.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 63, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "SetFindingState", - "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter.SetFindingState", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "state", - "type": ".google.cloud.securitycenter.v1beta1.Finding.State" - }, - { - "name": "start_time", - "type": ".google.protobuf.Timestamp" - } - ], - "resultType": ".google.cloud.securitycenter.v1beta1.Finding", - "client": { - "shortName": "SecurityCenterClient", - "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenterClient" + "regionTag": "securitycenter_v1beta1_generated_SecurityCenter_RunAssetDiscovery_async", + "title": "SecurityCenter runAssetDiscovery Sample", + "origin": "API_DEFINITION", + "description": " Runs asset discovery. The discovery is tracked with a long-running operation. This API can only be called with limited frequency for an organization. If it is called too frequently the caller will receive a TOO_MANY_REQUESTS error.", + "canonical": true, + "file": "security_center.run_asset_discovery.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 52, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "RunAssetDiscovery", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter.RunAssetDiscovery", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenterClient" + }, + "method": { + "shortName": "RunAssetDiscovery", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter.RunAssetDiscovery", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter" + } + } + } }, - "method": { - "shortName": "SetFindingState", - "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter.SetFindingState", - "service": { - "shortName": "SecurityCenter", - "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter" - } - } - } - }, - { - "regionTag": "securitycenter_v1beta1_generated_SecurityCenter_SetIamPolicy_async", - "title": "SecurityCenter setIamPolicy Sample", - "origin": "API_DEFINITION", - "description": " Sets the access control policy on the specified Source.", - "canonical": true, - "file": "security_center.set_iam_policy.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 66, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "SetIamPolicy", - "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter.SetIamPolicy", - "async": true, - "parameters": [ - { - "name": "resource", - "type": "TYPE_STRING" - }, - { - "name": "policy", - "type": ".google.iam.v1.Policy" - }, - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - } - ], - "resultType": ".google.iam.v1.Policy", - "client": { - "shortName": "SecurityCenterClient", - "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenterClient" + "regionTag": "securitycenter_v1beta1_generated_SecurityCenter_SetFindingState_async", + "title": "SecurityCenter setFindingState Sample", + "origin": "API_DEFINITION", + "description": " Updates the state of a finding.", + "canonical": true, + "file": "security_center.set_finding_state.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 63, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "SetFindingState", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter.SetFindingState", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "state", + "type": ".google.cloud.securitycenter.v1beta1.Finding.State" + }, + { + "name": "start_time", + "type": ".google.protobuf.Timestamp" + } + ], + "resultType": ".google.cloud.securitycenter.v1beta1.Finding", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenterClient" + }, + "method": { + "shortName": "SetFindingState", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter.SetFindingState", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter" + } + } + } }, - "method": { - "shortName": "SetIamPolicy", - "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter.SetIamPolicy", - "service": { - "shortName": "SecurityCenter", - "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter" - } - } - } - }, - { - "regionTag": "securitycenter_v1beta1_generated_SecurityCenter_TestIamPermissions_async", - "title": "SecurityCenter testIamPermissions Sample", - "origin": "API_DEFINITION", - "description": " Returns the permissions that a caller has on the specified source.", - "canonical": true, - "file": "security_center.test_iam_permissions.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 59, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "TestIamPermissions", - "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter.TestIamPermissions", - "async": true, - "parameters": [ - { - "name": "resource", - "type": "TYPE_STRING" - }, - { - "name": "permissions", - "type": "TYPE_STRING[]" - } - ], - "resultType": ".google.iam.v1.TestIamPermissionsResponse", - "client": { - "shortName": "SecurityCenterClient", - "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenterClient" + "regionTag": "securitycenter_v1beta1_generated_SecurityCenter_SetIamPolicy_async", + "title": "SecurityCenter setIamPolicy Sample", + "origin": "API_DEFINITION", + "description": " Sets the access control policy on the specified Source.", + "canonical": true, + "file": "security_center.set_iam_policy.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 66, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "SetIamPolicy", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter.SetIamPolicy", + "async": true, + "parameters": [ + { + "name": "resource", + "type": "TYPE_STRING" + }, + { + "name": "policy", + "type": ".google.iam.v1.Policy" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.iam.v1.Policy", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenterClient" + }, + "method": { + "shortName": "SetIamPolicy", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter.SetIamPolicy", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter" + } + } + } }, - "method": { - "shortName": "TestIamPermissions", - "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter.TestIamPermissions", - "service": { - "shortName": "SecurityCenter", - "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter" - } - } - } - }, - { - "regionTag": "securitycenter_v1beta1_generated_SecurityCenter_UpdateFinding_async", - "title": "SecurityCenter updateFinding Sample", - "origin": "API_DEFINITION", - "description": " Creates or updates a finding. The corresponding source must exist for a finding creation to succeed.", - "canonical": true, - "file": "security_center.update_finding.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 59, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateFinding", - "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter.UpdateFinding", - "async": true, - "parameters": [ - { - "name": "finding", - "type": ".google.cloud.securitycenter.v1beta1.Finding" - }, - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - } - ], - "resultType": ".google.cloud.securitycenter.v1beta1.Finding", - "client": { - "shortName": "SecurityCenterClient", - "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenterClient" + "regionTag": "securitycenter_v1beta1_generated_SecurityCenter_TestIamPermissions_async", + "title": "SecurityCenter testIamPermissions Sample", + "origin": "API_DEFINITION", + "description": " Returns the permissions that a caller has on the specified source.", + "canonical": true, + "file": "security_center.test_iam_permissions.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "TestIamPermissions", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter.TestIamPermissions", + "async": true, + "parameters": [ + { + "name": "resource", + "type": "TYPE_STRING" + }, + { + "name": "permissions", + "type": "TYPE_STRING[]" + } + ], + "resultType": ".google.iam.v1.TestIamPermissionsResponse", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenterClient" + }, + "method": { + "shortName": "TestIamPermissions", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter.TestIamPermissions", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter" + } + } + } }, - "method": { - "shortName": "UpdateFinding", - "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter.UpdateFinding", - "service": { - "shortName": "SecurityCenter", - "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter" - } - } - } - }, - { - "regionTag": "securitycenter_v1beta1_generated_SecurityCenter_UpdateOrganizationSettings_async", - "title": "SecurityCenter updateOrganizationSettings Sample", - "origin": "API_DEFINITION", - "description": " Updates an organization's settings.", - "canonical": true, - "file": "security_center.update_organization_settings.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 54, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateOrganizationSettings", - "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter.UpdateOrganizationSettings", - "async": true, - "parameters": [ - { - "name": "organization_settings", - "type": ".google.cloud.securitycenter.v1beta1.OrganizationSettings" - }, - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - } - ], - "resultType": ".google.cloud.securitycenter.v1beta1.OrganizationSettings", - "client": { - "shortName": "SecurityCenterClient", - "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenterClient" + "regionTag": "securitycenter_v1beta1_generated_SecurityCenter_UpdateFinding_async", + "title": "SecurityCenter updateFinding Sample", + "origin": "API_DEFINITION", + "description": " Creates or updates a finding. The corresponding source must exist for a finding creation to succeed.", + "canonical": true, + "file": "security_center.update_finding.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateFinding", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter.UpdateFinding", + "async": true, + "parameters": [ + { + "name": "finding", + "type": ".google.cloud.securitycenter.v1beta1.Finding" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.securitycenter.v1beta1.Finding", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenterClient" + }, + "method": { + "shortName": "UpdateFinding", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter.UpdateFinding", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter" + } + } + } }, - "method": { - "shortName": "UpdateOrganizationSettings", - "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter.UpdateOrganizationSettings", - "service": { - "shortName": "SecurityCenter", - "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter" - } - } - } - }, - { - "regionTag": "securitycenter_v1beta1_generated_SecurityCenter_UpdateSource_async", - "title": "SecurityCenter updateSource Sample", - "origin": "API_DEFINITION", - "description": " Updates a source.", - "canonical": true, - "file": "security_center.update_source.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 54, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateSource", - "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter.UpdateSource", - "async": true, - "parameters": [ - { - "name": "source", - "type": ".google.cloud.securitycenter.v1beta1.Source" - }, - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - } - ], - "resultType": ".google.cloud.securitycenter.v1beta1.Source", - "client": { - "shortName": "SecurityCenterClient", - "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenterClient" + "regionTag": "securitycenter_v1beta1_generated_SecurityCenter_UpdateOrganizationSettings_async", + "title": "SecurityCenter updateOrganizationSettings Sample", + "origin": "API_DEFINITION", + "description": " Updates an organization's settings.", + "canonical": true, + "file": "security_center.update_organization_settings.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateOrganizationSettings", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter.UpdateOrganizationSettings", + "async": true, + "parameters": [ + { + "name": "organization_settings", + "type": ".google.cloud.securitycenter.v1beta1.OrganizationSettings" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.securitycenter.v1beta1.OrganizationSettings", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenterClient" + }, + "method": { + "shortName": "UpdateOrganizationSettings", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter.UpdateOrganizationSettings", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter" + } + } + } }, - "method": { - "shortName": "UpdateSource", - "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter.UpdateSource", - "service": { - "shortName": "SecurityCenter", - "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter" - } - } - } - }, - { - "regionTag": "securitycenter_v1beta1_generated_SecurityCenter_UpdateSecurityMarks_async", - "title": "SecurityCenter updateSecurityMarks Sample", - "origin": "API_DEFINITION", - "description": " Updates security marks.", - "canonical": true, - "file": "security_center.update_security_marks.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 58, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateSecurityMarks", - "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter.UpdateSecurityMarks", - "async": true, - "parameters": [ - { - "name": "security_marks", - "type": ".google.cloud.securitycenter.v1beta1.SecurityMarks" - }, - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - }, - { - "name": "start_time", - "type": ".google.protobuf.Timestamp" - } - ], - "resultType": ".google.cloud.securitycenter.v1beta1.SecurityMarks", - "client": { - "shortName": "SecurityCenterClient", - "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenterClient" + "regionTag": "securitycenter_v1beta1_generated_SecurityCenter_UpdateSource_async", + "title": "SecurityCenter updateSource Sample", + "origin": "API_DEFINITION", + "description": " Updates a source.", + "canonical": true, + "file": "security_center.update_source.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateSource", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter.UpdateSource", + "async": true, + "parameters": [ + { + "name": "source", + "type": ".google.cloud.securitycenter.v1beta1.Source" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.securitycenter.v1beta1.Source", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenterClient" + }, + "method": { + "shortName": "UpdateSource", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter.UpdateSource", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter" + } + } + } }, - "method": { - "shortName": "UpdateSecurityMarks", - "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter.UpdateSecurityMarks", - "service": { - "shortName": "SecurityCenter", - "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter" - } + { + "regionTag": "securitycenter_v1beta1_generated_SecurityCenter_UpdateSecurityMarks_async", + "title": "SecurityCenter updateSecurityMarks Sample", + "origin": "API_DEFINITION", + "description": " Updates security marks.", + "canonical": true, + "file": "security_center.update_security_marks.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 58, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateSecurityMarks", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter.UpdateSecurityMarks", + "async": true, + "parameters": [ + { + "name": "security_marks", + "type": ".google.cloud.securitycenter.v1beta1.SecurityMarks" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "start_time", + "type": ".google.protobuf.Timestamp" + } + ], + "resultType": ".google.cloud.securitycenter.v1beta1.SecurityMarks", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenterClient" + }, + "method": { + "shortName": "UpdateSecurityMarks", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter.UpdateSecurityMarks", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter" + } + } + } } - } - } - ] -} + ] +} \ No newline at end of file diff --git a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/snippet_metadata.google.cloud.securitycenter.v1p1beta1.json b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/snippet_metadata.google.cloud.securitycenter.v1p1beta1.json index 27a6b4e30da..f4b338ebb75 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/snippet_metadata.google.cloud.securitycenter.v1p1beta1.json +++ b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/snippet_metadata.google.cloud.securitycenter.v1p1beta1.json @@ -1,1123 +1,1123 @@ { - "clientLibrary": { - "name": "nodejs-securitycenter", - "version": "0.1.0", - "language": "TYPESCRIPT", - "apis": [ - { - "id": "google.cloud.securitycenter.v1p1beta1", - "version": "v1p1beta1" - } - ] - }, - "snippets": [ - { - "regionTag": "securitycenter_v1p1beta1_generated_SecurityCenter_CreateSource_async", - "title": "SecurityCenter createSource Sample", - "origin": "API_DEFINITION", - "description": " Creates a source.", - "canonical": true, - "file": "security_center.create_source.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 57, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateSource", - "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.CreateSource", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "source", - "type": ".google.cloud.securitycenter.v1p1beta1.Source" - } - ], - "resultType": ".google.cloud.securitycenter.v1p1beta1.Source", - "client": { - "shortName": "SecurityCenterClient", - "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenterClient" - }, - "method": { - "shortName": "CreateSource", - "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.CreateSource", - "service": { - "shortName": "SecurityCenter", - "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter" - } - } - } + "clientLibrary": { + "name": "nodejs-securitycenter", + "version": "5.10.0", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.cloud.securitycenter.v1p1beta1", + "version": "v1p1beta1" + } + ] }, - { - "regionTag": "securitycenter_v1p1beta1_generated_SecurityCenter_CreateFinding_async", - "title": "SecurityCenter createFinding Sample", - "origin": "API_DEFINITION", - "description": " Creates a finding. The corresponding source must exist for finding creation to succeed.", - "canonical": true, - "file": "security_center.create_finding.js", - "language": "JAVASCRIPT", - "segments": [ + "snippets": [ { - "start": 25, - "end": 62, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateFinding", - "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.CreateFinding", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "finding_id", - "type": "TYPE_STRING" - }, - { - "name": "finding", - "type": ".google.cloud.securitycenter.v1p1beta1.Finding" - } - ], - "resultType": ".google.cloud.securitycenter.v1p1beta1.Finding", - "client": { - "shortName": "SecurityCenterClient", - "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenterClient" + "regionTag": "securitycenter_v1p1beta1_generated_SecurityCenter_CreateSource_async", + "title": "SecurityCenter createSource Sample", + "origin": "API_DEFINITION", + "description": " Creates a source.", + "canonical": true, + "file": "security_center.create_source.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 57, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateSource", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.CreateSource", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "source", + "type": ".google.cloud.securitycenter.v1p1beta1.Source" + } + ], + "resultType": ".google.cloud.securitycenter.v1p1beta1.Source", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenterClient" + }, + "method": { + "shortName": "CreateSource", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.CreateSource", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter" + } + } + } }, - "method": { - "shortName": "CreateFinding", - "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.CreateFinding", - "service": { - "shortName": "SecurityCenter", - "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter" - } - } - } - }, - { - "regionTag": "securitycenter_v1p1beta1_generated_SecurityCenter_CreateNotificationConfig_async", - "title": "SecurityCenter createNotificationConfig Sample", - "origin": "API_DEFINITION", - "description": " Creates a notification config.", - "canonical": true, - "file": "security_center.create_notification_config.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 64, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateNotificationConfig", - "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.CreateNotificationConfig", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "config_id", - "type": "TYPE_STRING" - }, - { - "name": "notification_config", - "type": ".google.cloud.securitycenter.v1p1beta1.NotificationConfig" - } - ], - "resultType": ".google.cloud.securitycenter.v1p1beta1.NotificationConfig", - "client": { - "shortName": "SecurityCenterClient", - "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenterClient" + "regionTag": "securitycenter_v1p1beta1_generated_SecurityCenter_CreateFinding_async", + "title": "SecurityCenter createFinding Sample", + "origin": "API_DEFINITION", + "description": " Creates a finding. The corresponding source must exist for finding creation to succeed.", + "canonical": true, + "file": "security_center.create_finding.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 62, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateFinding", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.CreateFinding", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "finding_id", + "type": "TYPE_STRING" + }, + { + "name": "finding", + "type": ".google.cloud.securitycenter.v1p1beta1.Finding" + } + ], + "resultType": ".google.cloud.securitycenter.v1p1beta1.Finding", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenterClient" + }, + "method": { + "shortName": "CreateFinding", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.CreateFinding", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter" + } + } + } }, - "method": { - "shortName": "CreateNotificationConfig", - "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.CreateNotificationConfig", - "service": { - "shortName": "SecurityCenter", - "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter" - } - } - } - }, - { - "regionTag": "securitycenter_v1p1beta1_generated_SecurityCenter_DeleteNotificationConfig_async", - "title": "SecurityCenter deleteNotificationConfig Sample", - "origin": "API_DEFINITION", - "description": " Deletes a notification config.", - "canonical": true, - "file": "security_center.delete_notification_config.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 51, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteNotificationConfig", - "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.DeleteNotificationConfig", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.protobuf.Empty", - "client": { - "shortName": "SecurityCenterClient", - "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenterClient" + "regionTag": "securitycenter_v1p1beta1_generated_SecurityCenter_CreateNotificationConfig_async", + "title": "SecurityCenter createNotificationConfig Sample", + "origin": "API_DEFINITION", + "description": " Creates a notification config.", + "canonical": true, + "file": "security_center.create_notification_config.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 64, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateNotificationConfig", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.CreateNotificationConfig", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "config_id", + "type": "TYPE_STRING" + }, + { + "name": "notification_config", + "type": ".google.cloud.securitycenter.v1p1beta1.NotificationConfig" + } + ], + "resultType": ".google.cloud.securitycenter.v1p1beta1.NotificationConfig", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenterClient" + }, + "method": { + "shortName": "CreateNotificationConfig", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.CreateNotificationConfig", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter" + } + } + } }, - "method": { - "shortName": "DeleteNotificationConfig", - "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.DeleteNotificationConfig", - "service": { - "shortName": "SecurityCenter", - "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter" - } - } - } - }, - { - "regionTag": "securitycenter_v1p1beta1_generated_SecurityCenter_GetIamPolicy_async", - "title": "SecurityCenter getIamPolicy Sample", - "origin": "API_DEFINITION", - "description": " Gets the access control policy on the specified Source.", - "canonical": true, - "file": "security_center.get_iam_policy.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 56, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetIamPolicy", - "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.GetIamPolicy", - "async": true, - "parameters": [ - { - "name": "resource", - "type": "TYPE_STRING" - }, - { - "name": "options", - "type": ".google.iam.v1.GetPolicyOptions" - } - ], - "resultType": ".google.iam.v1.Policy", - "client": { - "shortName": "SecurityCenterClient", - "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenterClient" + "regionTag": "securitycenter_v1p1beta1_generated_SecurityCenter_DeleteNotificationConfig_async", + "title": "SecurityCenter deleteNotificationConfig Sample", + "origin": "API_DEFINITION", + "description": " Deletes a notification config.", + "canonical": true, + "file": "security_center.delete_notification_config.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 51, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteNotificationConfig", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.DeleteNotificationConfig", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenterClient" + }, + "method": { + "shortName": "DeleteNotificationConfig", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.DeleteNotificationConfig", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter" + } + } + } }, - "method": { - "shortName": "GetIamPolicy", - "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.GetIamPolicy", - "service": { - "shortName": "SecurityCenter", - "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter" - } - } - } - }, - { - "regionTag": "securitycenter_v1p1beta1_generated_SecurityCenter_GetNotificationConfig_async", - "title": "SecurityCenter getNotificationConfig Sample", - "origin": "API_DEFINITION", - "description": " Gets a notification config.", - "canonical": true, - "file": "security_center.get_notification_config.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 51, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetNotificationConfig", - "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.GetNotificationConfig", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.securitycenter.v1p1beta1.NotificationConfig", - "client": { - "shortName": "SecurityCenterClient", - "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenterClient" + "regionTag": "securitycenter_v1p1beta1_generated_SecurityCenter_GetIamPolicy_async", + "title": "SecurityCenter getIamPolicy Sample", + "origin": "API_DEFINITION", + "description": " Gets the access control policy on the specified Source.", + "canonical": true, + "file": "security_center.get_iam_policy.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 56, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetIamPolicy", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.GetIamPolicy", + "async": true, + "parameters": [ + { + "name": "resource", + "type": "TYPE_STRING" + }, + { + "name": "options", + "type": ".google.iam.v1.GetPolicyOptions" + } + ], + "resultType": ".google.iam.v1.Policy", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenterClient" + }, + "method": { + "shortName": "GetIamPolicy", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.GetIamPolicy", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter" + } + } + } }, - "method": { - "shortName": "GetNotificationConfig", - "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.GetNotificationConfig", - "service": { - "shortName": "SecurityCenter", - "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter" - } - } - } - }, - { - "regionTag": "securitycenter_v1p1beta1_generated_SecurityCenter_GetOrganizationSettings_async", - "title": "SecurityCenter getOrganizationSettings Sample", - "origin": "API_DEFINITION", - "description": " Gets the settings for an organization.", - "canonical": true, - "file": "security_center.get_organization_settings.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 51, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetOrganizationSettings", - "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.GetOrganizationSettings", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.securitycenter.v1p1beta1.OrganizationSettings", - "client": { - "shortName": "SecurityCenterClient", - "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenterClient" + "regionTag": "securitycenter_v1p1beta1_generated_SecurityCenter_GetNotificationConfig_async", + "title": "SecurityCenter getNotificationConfig Sample", + "origin": "API_DEFINITION", + "description": " Gets a notification config.", + "canonical": true, + "file": "security_center.get_notification_config.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 51, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetNotificationConfig", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.GetNotificationConfig", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.securitycenter.v1p1beta1.NotificationConfig", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenterClient" + }, + "method": { + "shortName": "GetNotificationConfig", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.GetNotificationConfig", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter" + } + } + } }, - "method": { - "shortName": "GetOrganizationSettings", - "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.GetOrganizationSettings", - "service": { - "shortName": "SecurityCenter", - "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter" - } - } - } - }, - { - "regionTag": "securitycenter_v1p1beta1_generated_SecurityCenter_GetSource_async", - "title": "SecurityCenter getSource Sample", - "origin": "API_DEFINITION", - "description": " Gets a source.", - "canonical": true, - "file": "security_center.get_source.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 51, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetSource", - "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.GetSource", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.securitycenter.v1p1beta1.Source", - "client": { - "shortName": "SecurityCenterClient", - "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenterClient" + "regionTag": "securitycenter_v1p1beta1_generated_SecurityCenter_GetOrganizationSettings_async", + "title": "SecurityCenter getOrganizationSettings Sample", + "origin": "API_DEFINITION", + "description": " Gets the settings for an organization.", + "canonical": true, + "file": "security_center.get_organization_settings.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 51, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetOrganizationSettings", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.GetOrganizationSettings", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.securitycenter.v1p1beta1.OrganizationSettings", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenterClient" + }, + "method": { + "shortName": "GetOrganizationSettings", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.GetOrganizationSettings", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter" + } + } + } }, - "method": { - "shortName": "GetSource", - "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.GetSource", - "service": { - "shortName": "SecurityCenter", - "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter" - } - } - } - }, - { - "regionTag": "securitycenter_v1p1beta1_generated_SecurityCenter_GroupAssets_async", - "title": "SecurityCenter groupAssets Sample", - "origin": "API_DEFINITION", - "description": " Filters an organization's assets and groups them by their specified properties.", - "canonical": true, - "file": "security_center.group_assets.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 165, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GroupAssets", - "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.GroupAssets", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "filter", - "type": "TYPE_STRING" - }, - { - "name": "group_by", - "type": "TYPE_STRING" - }, - { - "name": "compare_duration", - "type": ".google.protobuf.Duration" - }, - { - "name": "read_time", - "type": ".google.protobuf.Timestamp" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - } - ], - "resultType": ".google.cloud.securitycenter.v1p1beta1.GroupAssetsResponse", - "client": { - "shortName": "SecurityCenterClient", - "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenterClient" + "regionTag": "securitycenter_v1p1beta1_generated_SecurityCenter_GetSource_async", + "title": "SecurityCenter getSource Sample", + "origin": "API_DEFINITION", + "description": " Gets a source.", + "canonical": true, + "file": "security_center.get_source.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 51, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetSource", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.GetSource", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.securitycenter.v1p1beta1.Source", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenterClient" + }, + "method": { + "shortName": "GetSource", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.GetSource", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter" + } + } + } }, - "method": { - "shortName": "GroupAssets", - "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.GroupAssets", - "service": { - "shortName": "SecurityCenter", - "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter" - } - } - } - }, - { - "regionTag": "securitycenter_v1p1beta1_generated_SecurityCenter_GroupFindings_async", - "title": "SecurityCenter groupFindings Sample", - "origin": "API_DEFINITION", - "description": " Filters an organization or source's findings and groups them by their specified properties. To group across all sources provide a `-` as the source id. Example: /v1/organizations/{organization_id}/sources/-/findings, /v1/folders/{folder_id}/sources/-/findings, /v1/projects/{project_id}/sources/-/findings", - "canonical": true, - "file": "security_center.group_findings.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 161, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GroupFindings", - "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.GroupFindings", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "filter", - "type": "TYPE_STRING" - }, - { - "name": "group_by", - "type": "TYPE_STRING" - }, - { - "name": "read_time", - "type": ".google.protobuf.Timestamp" - }, - { - "name": "compare_duration", - "type": ".google.protobuf.Duration" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - } - ], - "resultType": ".google.cloud.securitycenter.v1p1beta1.GroupFindingsResponse", - "client": { - "shortName": "SecurityCenterClient", - "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenterClient" + "regionTag": "securitycenter_v1p1beta1_generated_SecurityCenter_GroupAssets_async", + "title": "SecurityCenter groupAssets Sample", + "origin": "API_DEFINITION", + "description": " Filters an organization's assets and groups them by their specified properties.", + "canonical": true, + "file": "security_center.group_assets.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 165, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GroupAssets", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.GroupAssets", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "group_by", + "type": "TYPE_STRING" + }, + { + "name": "compare_duration", + "type": ".google.protobuf.Duration" + }, + { + "name": "read_time", + "type": ".google.protobuf.Timestamp" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + } + ], + "resultType": ".google.cloud.securitycenter.v1p1beta1.GroupAssetsResponse", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenterClient" + }, + "method": { + "shortName": "GroupAssets", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.GroupAssets", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter" + } + } + } }, - "method": { - "shortName": "GroupFindings", - "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.GroupFindings", - "service": { - "shortName": "SecurityCenter", - "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter" - } - } - } - }, - { - "regionTag": "securitycenter_v1p1beta1_generated_SecurityCenter_ListAssets_async", - "title": "SecurityCenter listAssets Sample", - "origin": "API_DEFINITION", - "description": " Lists an organization's assets.", - "canonical": true, - "file": "security_center.list_assets.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 174, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListAssets", - "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.ListAssets", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "filter", - "type": "TYPE_STRING" - }, - { - "name": "order_by", - "type": "TYPE_STRING" - }, - { - "name": "read_time", - "type": ".google.protobuf.Timestamp" - }, - { - "name": "compare_duration", - "type": ".google.protobuf.Duration" - }, - { - "name": "field_mask", - "type": ".google.protobuf.FieldMask" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - } - ], - "resultType": ".google.cloud.securitycenter.v1p1beta1.ListAssetsResponse", - "client": { - "shortName": "SecurityCenterClient", - "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenterClient" + "regionTag": "securitycenter_v1p1beta1_generated_SecurityCenter_GroupFindings_async", + "title": "SecurityCenter groupFindings Sample", + "origin": "API_DEFINITION", + "description": " Filters an organization or source's findings and groups them by their specified properties. To group across all sources provide a `-` as the source id. Example: /v1/organizations/{organization_id}/sources/-/findings, /v1/folders/{folder_id}/sources/-/findings, /v1/projects/{project_id}/sources/-/findings", + "canonical": true, + "file": "security_center.group_findings.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 161, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GroupFindings", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.GroupFindings", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "group_by", + "type": "TYPE_STRING" + }, + { + "name": "read_time", + "type": ".google.protobuf.Timestamp" + }, + { + "name": "compare_duration", + "type": ".google.protobuf.Duration" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + } + ], + "resultType": ".google.cloud.securitycenter.v1p1beta1.GroupFindingsResponse", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenterClient" + }, + "method": { + "shortName": "GroupFindings", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.GroupFindings", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter" + } + } + } }, - "method": { - "shortName": "ListAssets", - "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.ListAssets", - "service": { - "shortName": "SecurityCenter", - "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter" - } - } - } - }, - { - "regionTag": "securitycenter_v1p1beta1_generated_SecurityCenter_ListFindings_async", - "title": "SecurityCenter listFindings Sample", - "origin": "API_DEFINITION", - "description": " Lists an organization or source's findings. To list across all sources provide a `-` as the source id. Example: /v1p1beta1/organizations/{organization_id}/sources/-/findings", - "canonical": true, - "file": "security_center.list_findings.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 170, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListFindings", - "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.ListFindings", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "filter", - "type": "TYPE_STRING" - }, - { - "name": "order_by", - "type": "TYPE_STRING" - }, - { - "name": "read_time", - "type": ".google.protobuf.Timestamp" - }, - { - "name": "compare_duration", - "type": ".google.protobuf.Duration" - }, - { - "name": "field_mask", - "type": ".google.protobuf.FieldMask" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - } - ], - "resultType": ".google.cloud.securitycenter.v1p1beta1.ListFindingsResponse", - "client": { - "shortName": "SecurityCenterClient", - "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenterClient" + "regionTag": "securitycenter_v1p1beta1_generated_SecurityCenter_ListAssets_async", + "title": "SecurityCenter listAssets Sample", + "origin": "API_DEFINITION", + "description": " Lists an organization's assets.", + "canonical": true, + "file": "security_center.list_assets.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 174, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListAssets", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.ListAssets", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "order_by", + "type": "TYPE_STRING" + }, + { + "name": "read_time", + "type": ".google.protobuf.Timestamp" + }, + { + "name": "compare_duration", + "type": ".google.protobuf.Duration" + }, + { + "name": "field_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + } + ], + "resultType": ".google.cloud.securitycenter.v1p1beta1.ListAssetsResponse", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenterClient" + }, + "method": { + "shortName": "ListAssets", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.ListAssets", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter" + } + } + } }, - "method": { - "shortName": "ListFindings", - "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.ListFindings", - "service": { - "shortName": "SecurityCenter", - "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter" - } - } - } - }, - { - "regionTag": "securitycenter_v1p1beta1_generated_SecurityCenter_ListNotificationConfigs_async", - "title": "SecurityCenter listNotificationConfigs Sample", - "origin": "API_DEFINITION", - "description": " Lists notification configs.", - "canonical": true, - "file": "security_center.list_notification_configs.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 64, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListNotificationConfigs", - "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.ListNotificationConfigs", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - } - ], - "resultType": ".google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsResponse", - "client": { - "shortName": "SecurityCenterClient", - "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenterClient" + "regionTag": "securitycenter_v1p1beta1_generated_SecurityCenter_ListFindings_async", + "title": "SecurityCenter listFindings Sample", + "origin": "API_DEFINITION", + "description": " Lists an organization or source's findings. To list across all sources provide a `-` as the source id. Example: /v1p1beta1/organizations/{organization_id}/sources/-/findings", + "canonical": true, + "file": "security_center.list_findings.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 170, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListFindings", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.ListFindings", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "order_by", + "type": "TYPE_STRING" + }, + { + "name": "read_time", + "type": ".google.protobuf.Timestamp" + }, + { + "name": "compare_duration", + "type": ".google.protobuf.Duration" + }, + { + "name": "field_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + } + ], + "resultType": ".google.cloud.securitycenter.v1p1beta1.ListFindingsResponse", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenterClient" + }, + "method": { + "shortName": "ListFindings", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.ListFindings", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter" + } + } + } }, - "method": { - "shortName": "ListNotificationConfigs", - "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.ListNotificationConfigs", - "service": { - "shortName": "SecurityCenter", - "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter" - } - } - } - }, - { - "regionTag": "securitycenter_v1p1beta1_generated_SecurityCenter_ListSources_async", - "title": "SecurityCenter listSources Sample", - "origin": "API_DEFINITION", - "description": " Lists all sources belonging to an organization.", - "canonical": true, - "file": "security_center.list_sources.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 65, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListSources", - "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.ListSources", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - } - ], - "resultType": ".google.cloud.securitycenter.v1p1beta1.ListSourcesResponse", - "client": { - "shortName": "SecurityCenterClient", - "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenterClient" + "regionTag": "securitycenter_v1p1beta1_generated_SecurityCenter_ListNotificationConfigs_async", + "title": "SecurityCenter listNotificationConfigs Sample", + "origin": "API_DEFINITION", + "description": " Lists notification configs.", + "canonical": true, + "file": "security_center.list_notification_configs.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 64, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListNotificationConfigs", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.ListNotificationConfigs", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + } + ], + "resultType": ".google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsResponse", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenterClient" + }, + "method": { + "shortName": "ListNotificationConfigs", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.ListNotificationConfigs", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter" + } + } + } }, - "method": { - "shortName": "ListSources", - "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.ListSources", - "service": { - "shortName": "SecurityCenter", - "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter" - } - } - } - }, - { - "regionTag": "securitycenter_v1p1beta1_generated_SecurityCenter_RunAssetDiscovery_async", - "title": "SecurityCenter runAssetDiscovery Sample", - "origin": "API_DEFINITION", - "description": " Runs asset discovery. The discovery is tracked with a long-running operation. This API can only be called with limited frequency for an organization. If it is called too frequently the caller will receive a TOO_MANY_REQUESTS error.", - "canonical": true, - "file": "security_center.run_asset_discovery.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 52, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "RunAssetDiscovery", - "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.RunAssetDiscovery", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "SecurityCenterClient", - "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenterClient" + "regionTag": "securitycenter_v1p1beta1_generated_SecurityCenter_ListSources_async", + "title": "SecurityCenter listSources Sample", + "origin": "API_DEFINITION", + "description": " Lists all sources belonging to an organization.", + "canonical": true, + "file": "security_center.list_sources.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 65, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListSources", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.ListSources", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + } + ], + "resultType": ".google.cloud.securitycenter.v1p1beta1.ListSourcesResponse", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenterClient" + }, + "method": { + "shortName": "ListSources", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.ListSources", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter" + } + } + } }, - "method": { - "shortName": "RunAssetDiscovery", - "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.RunAssetDiscovery", - "service": { - "shortName": "SecurityCenter", - "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter" - } - } - } - }, - { - "regionTag": "securitycenter_v1p1beta1_generated_SecurityCenter_SetFindingState_async", - "title": "SecurityCenter setFindingState Sample", - "origin": "API_DEFINITION", - "description": " Updates the state of a finding.", - "canonical": true, - "file": "security_center.set_finding_state.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 63, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "SetFindingState", - "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.SetFindingState", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "state", - "type": ".google.cloud.securitycenter.v1p1beta1.Finding.State" - }, - { - "name": "start_time", - "type": ".google.protobuf.Timestamp" - } - ], - "resultType": ".google.cloud.securitycenter.v1p1beta1.Finding", - "client": { - "shortName": "SecurityCenterClient", - "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenterClient" + "regionTag": "securitycenter_v1p1beta1_generated_SecurityCenter_RunAssetDiscovery_async", + "title": "SecurityCenter runAssetDiscovery Sample", + "origin": "API_DEFINITION", + "description": " Runs asset discovery. The discovery is tracked with a long-running operation. This API can only be called with limited frequency for an organization. If it is called too frequently the caller will receive a TOO_MANY_REQUESTS error.", + "canonical": true, + "file": "security_center.run_asset_discovery.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 52, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "RunAssetDiscovery", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.RunAssetDiscovery", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenterClient" + }, + "method": { + "shortName": "RunAssetDiscovery", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.RunAssetDiscovery", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter" + } + } + } }, - "method": { - "shortName": "SetFindingState", - "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.SetFindingState", - "service": { - "shortName": "SecurityCenter", - "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter" - } - } - } - }, - { - "regionTag": "securitycenter_v1p1beta1_generated_SecurityCenter_SetIamPolicy_async", - "title": "SecurityCenter setIamPolicy Sample", - "origin": "API_DEFINITION", - "description": " Sets the access control policy on the specified Source.", - "canonical": true, - "file": "security_center.set_iam_policy.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 66, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "SetIamPolicy", - "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.SetIamPolicy", - "async": true, - "parameters": [ - { - "name": "resource", - "type": "TYPE_STRING" - }, - { - "name": "policy", - "type": ".google.iam.v1.Policy" - }, - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - } - ], - "resultType": ".google.iam.v1.Policy", - "client": { - "shortName": "SecurityCenterClient", - "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenterClient" + "regionTag": "securitycenter_v1p1beta1_generated_SecurityCenter_SetFindingState_async", + "title": "SecurityCenter setFindingState Sample", + "origin": "API_DEFINITION", + "description": " Updates the state of a finding.", + "canonical": true, + "file": "security_center.set_finding_state.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 63, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "SetFindingState", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.SetFindingState", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "state", + "type": ".google.cloud.securitycenter.v1p1beta1.Finding.State" + }, + { + "name": "start_time", + "type": ".google.protobuf.Timestamp" + } + ], + "resultType": ".google.cloud.securitycenter.v1p1beta1.Finding", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenterClient" + }, + "method": { + "shortName": "SetFindingState", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.SetFindingState", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter" + } + } + } }, - "method": { - "shortName": "SetIamPolicy", - "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.SetIamPolicy", - "service": { - "shortName": "SecurityCenter", - "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter" - } - } - } - }, - { - "regionTag": "securitycenter_v1p1beta1_generated_SecurityCenter_TestIamPermissions_async", - "title": "SecurityCenter testIamPermissions Sample", - "origin": "API_DEFINITION", - "description": " Returns the permissions that a caller has on the specified source.", - "canonical": true, - "file": "security_center.test_iam_permissions.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 59, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "TestIamPermissions", - "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.TestIamPermissions", - "async": true, - "parameters": [ - { - "name": "resource", - "type": "TYPE_STRING" - }, - { - "name": "permissions", - "type": "TYPE_STRING[]" - } - ], - "resultType": ".google.iam.v1.TestIamPermissionsResponse", - "client": { - "shortName": "SecurityCenterClient", - "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenterClient" + "regionTag": "securitycenter_v1p1beta1_generated_SecurityCenter_SetIamPolicy_async", + "title": "SecurityCenter setIamPolicy Sample", + "origin": "API_DEFINITION", + "description": " Sets the access control policy on the specified Source.", + "canonical": true, + "file": "security_center.set_iam_policy.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 66, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "SetIamPolicy", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.SetIamPolicy", + "async": true, + "parameters": [ + { + "name": "resource", + "type": "TYPE_STRING" + }, + { + "name": "policy", + "type": ".google.iam.v1.Policy" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.iam.v1.Policy", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenterClient" + }, + "method": { + "shortName": "SetIamPolicy", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.SetIamPolicy", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter" + } + } + } }, - "method": { - "shortName": "TestIamPermissions", - "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.TestIamPermissions", - "service": { - "shortName": "SecurityCenter", - "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter" - } - } - } - }, - { - "regionTag": "securitycenter_v1p1beta1_generated_SecurityCenter_UpdateFinding_async", - "title": "SecurityCenter updateFinding Sample", - "origin": "API_DEFINITION", - "description": " Creates or updates a finding. The corresponding source must exist for a finding creation to succeed.", - "canonical": true, - "file": "security_center.update_finding.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 63, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateFinding", - "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.UpdateFinding", - "async": true, - "parameters": [ - { - "name": "finding", - "type": ".google.cloud.securitycenter.v1p1beta1.Finding" - }, - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - } - ], - "resultType": ".google.cloud.securitycenter.v1p1beta1.Finding", - "client": { - "shortName": "SecurityCenterClient", - "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenterClient" + "regionTag": "securitycenter_v1p1beta1_generated_SecurityCenter_TestIamPermissions_async", + "title": "SecurityCenter testIamPermissions Sample", + "origin": "API_DEFINITION", + "description": " Returns the permissions that a caller has on the specified source.", + "canonical": true, + "file": "security_center.test_iam_permissions.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "TestIamPermissions", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.TestIamPermissions", + "async": true, + "parameters": [ + { + "name": "resource", + "type": "TYPE_STRING" + }, + { + "name": "permissions", + "type": "TYPE_STRING[]" + } + ], + "resultType": ".google.iam.v1.TestIamPermissionsResponse", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenterClient" + }, + "method": { + "shortName": "TestIamPermissions", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.TestIamPermissions", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter" + } + } + } }, - "method": { - "shortName": "UpdateFinding", - "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.UpdateFinding", - "service": { - "shortName": "SecurityCenter", - "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter" - } - } - } - }, - { - "regionTag": "securitycenter_v1p1beta1_generated_SecurityCenter_UpdateNotificationConfig_async", - "title": "SecurityCenter updateNotificationConfig Sample", - "origin": "API_DEFINITION", - "description": " Updates a notification config. The following update fields are allowed: description, pubsub_topic, streaming_config.filter", - "canonical": true, - "file": "security_center.update_notification_config.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 55, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateNotificationConfig", - "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.UpdateNotificationConfig", - "async": true, - "parameters": [ - { - "name": "notification_config", - "type": ".google.cloud.securitycenter.v1p1beta1.NotificationConfig" - }, - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - } - ], - "resultType": ".google.cloud.securitycenter.v1p1beta1.NotificationConfig", - "client": { - "shortName": "SecurityCenterClient", - "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenterClient" + "regionTag": "securitycenter_v1p1beta1_generated_SecurityCenter_UpdateFinding_async", + "title": "SecurityCenter updateFinding Sample", + "origin": "API_DEFINITION", + "description": " Creates or updates a finding. The corresponding source must exist for a finding creation to succeed.", + "canonical": true, + "file": "security_center.update_finding.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 63, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateFinding", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.UpdateFinding", + "async": true, + "parameters": [ + { + "name": "finding", + "type": ".google.cloud.securitycenter.v1p1beta1.Finding" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.securitycenter.v1p1beta1.Finding", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenterClient" + }, + "method": { + "shortName": "UpdateFinding", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.UpdateFinding", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter" + } + } + } }, - "method": { - "shortName": "UpdateNotificationConfig", - "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.UpdateNotificationConfig", - "service": { - "shortName": "SecurityCenter", - "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter" - } - } - } - }, - { - "regionTag": "securitycenter_v1p1beta1_generated_SecurityCenter_UpdateOrganizationSettings_async", - "title": "SecurityCenter updateOrganizationSettings Sample", - "origin": "API_DEFINITION", - "description": " Updates an organization's settings.", - "canonical": true, - "file": "security_center.update_organization_settings.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 55, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateOrganizationSettings", - "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.UpdateOrganizationSettings", - "async": true, - "parameters": [ - { - "name": "organization_settings", - "type": ".google.cloud.securitycenter.v1p1beta1.OrganizationSettings" - }, - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - } - ], - "resultType": ".google.cloud.securitycenter.v1p1beta1.OrganizationSettings", - "client": { - "shortName": "SecurityCenterClient", - "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenterClient" + "regionTag": "securitycenter_v1p1beta1_generated_SecurityCenter_UpdateNotificationConfig_async", + "title": "SecurityCenter updateNotificationConfig Sample", + "origin": "API_DEFINITION", + "description": " Updates a notification config. The following update fields are allowed: description, pubsub_topic, streaming_config.filter", + "canonical": true, + "file": "security_center.update_notification_config.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateNotificationConfig", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.UpdateNotificationConfig", + "async": true, + "parameters": [ + { + "name": "notification_config", + "type": ".google.cloud.securitycenter.v1p1beta1.NotificationConfig" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.securitycenter.v1p1beta1.NotificationConfig", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenterClient" + }, + "method": { + "shortName": "UpdateNotificationConfig", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.UpdateNotificationConfig", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter" + } + } + } }, - "method": { - "shortName": "UpdateOrganizationSettings", - "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.UpdateOrganizationSettings", - "service": { - "shortName": "SecurityCenter", - "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter" - } - } - } - }, - { - "regionTag": "securitycenter_v1p1beta1_generated_SecurityCenter_UpdateSource_async", - "title": "SecurityCenter updateSource Sample", - "origin": "API_DEFINITION", - "description": " Updates a source.", - "canonical": true, - "file": "security_center.update_source.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 55, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateSource", - "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.UpdateSource", - "async": true, - "parameters": [ - { - "name": "source", - "type": ".google.cloud.securitycenter.v1p1beta1.Source" - }, - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - } - ], - "resultType": ".google.cloud.securitycenter.v1p1beta1.Source", - "client": { - "shortName": "SecurityCenterClient", - "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenterClient" + "regionTag": "securitycenter_v1p1beta1_generated_SecurityCenter_UpdateOrganizationSettings_async", + "title": "SecurityCenter updateOrganizationSettings Sample", + "origin": "API_DEFINITION", + "description": " Updates an organization's settings.", + "canonical": true, + "file": "security_center.update_organization_settings.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateOrganizationSettings", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.UpdateOrganizationSettings", + "async": true, + "parameters": [ + { + "name": "organization_settings", + "type": ".google.cloud.securitycenter.v1p1beta1.OrganizationSettings" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.securitycenter.v1p1beta1.OrganizationSettings", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenterClient" + }, + "method": { + "shortName": "UpdateOrganizationSettings", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.UpdateOrganizationSettings", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter" + } + } + } }, - "method": { - "shortName": "UpdateSource", - "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.UpdateSource", - "service": { - "shortName": "SecurityCenter", - "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter" - } - } - } - }, - { - "regionTag": "securitycenter_v1p1beta1_generated_SecurityCenter_UpdateSecurityMarks_async", - "title": "SecurityCenter updateSecurityMarks Sample", - "origin": "API_DEFINITION", - "description": " Updates security marks.", - "canonical": true, - "file": "security_center.update_security_marks.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 63, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateSecurityMarks", - "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.UpdateSecurityMarks", - "async": true, - "parameters": [ - { - "name": "security_marks", - "type": ".google.cloud.securitycenter.v1p1beta1.SecurityMarks" - }, - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - }, - { - "name": "start_time", - "type": ".google.protobuf.Timestamp" - } - ], - "resultType": ".google.cloud.securitycenter.v1p1beta1.SecurityMarks", - "client": { - "shortName": "SecurityCenterClient", - "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenterClient" + "regionTag": "securitycenter_v1p1beta1_generated_SecurityCenter_UpdateSource_async", + "title": "SecurityCenter updateSource Sample", + "origin": "API_DEFINITION", + "description": " Updates a source.", + "canonical": true, + "file": "security_center.update_source.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateSource", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.UpdateSource", + "async": true, + "parameters": [ + { + "name": "source", + "type": ".google.cloud.securitycenter.v1p1beta1.Source" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.securitycenter.v1p1beta1.Source", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenterClient" + }, + "method": { + "shortName": "UpdateSource", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.UpdateSource", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter" + } + } + } }, - "method": { - "shortName": "UpdateSecurityMarks", - "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.UpdateSecurityMarks", - "service": { - "shortName": "SecurityCenter", - "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter" - } + { + "regionTag": "securitycenter_v1p1beta1_generated_SecurityCenter_UpdateSecurityMarks_async", + "title": "SecurityCenter updateSecurityMarks Sample", + "origin": "API_DEFINITION", + "description": " Updates security marks.", + "canonical": true, + "file": "security_center.update_security_marks.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 63, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateSecurityMarks", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.UpdateSecurityMarks", + "async": true, + "parameters": [ + { + "name": "security_marks", + "type": ".google.cloud.securitycenter.v1p1beta1.SecurityMarks" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "start_time", + "type": ".google.protobuf.Timestamp" + } + ], + "resultType": ".google.cloud.securitycenter.v1p1beta1.SecurityMarks", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenterClient" + }, + "method": { + "shortName": "UpdateSecurityMarks", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.UpdateSecurityMarks", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter" + } + } + } } - } - } - ] -} + ] +} \ No newline at end of file From fc35534747fbdce75176b23e1e71f72e15f9ccf8 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 3 May 2022 02:28:38 +0200 Subject: [PATCH 312/342] chore(deps): update dependency @types/mocha to v9 (#482) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [@types/mocha](https://togithub.com/DefinitelyTyped/DefinitelyTyped) | [`^8.0.0` -> `^9.0.0`](https://renovatebot.com/diffs/npm/@types%2fmocha/8.2.3/9.1.1) | [![age](https://badges.renovateapi.com/packages/npm/@types%2fmocha/9.1.1/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/@types%2fmocha/9.1.1/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/@types%2fmocha/9.1.1/compatibility-slim/8.2.3)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/@types%2fmocha/9.1.1/confidence-slim/8.2.3)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration 📅 **Schedule**: "after 9am and before 3pm" (UTC). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/nodejs-security-center). --- packages/google-cloud-securitycenter/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-securitycenter/package.json b/packages/google-cloud-securitycenter/package.json index be315506029..b7c2a43a1bf 100644 --- a/packages/google-cloud-securitycenter/package.json +++ b/packages/google-cloud-securitycenter/package.json @@ -45,7 +45,7 @@ "google-gax": "^2.24.1" }, "devDependencies": { - "@types/mocha": "^8.0.0", + "@types/mocha": "^9.0.0", "@types/node": "^16.0.0", "@types/sinon": "^10.0.0", "c8": "^7.0.0", From f0333a9077a61378f53d84aaa124d727d04cb07e Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Fri, 6 May 2022 12:53:24 -0700 Subject: [PATCH 313/342] chore(main): release 5.11.0 (#480) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(main): release 5.11.0 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> Co-authored-by: Owl Bot --- packages/google-cloud-securitycenter/CHANGELOG.md | 7 +++++++ packages/google-cloud-securitycenter/package.json | 2 +- .../snippet_metadata.google.cloud.securitycenter.v1.json | 2 +- ...ippet_metadata.google.cloud.securitycenter.v1beta1.json | 2 +- ...pet_metadata.google.cloud.securitycenter.v1p1beta1.json | 2 +- packages/google-cloud-securitycenter/samples/package.json | 2 +- 6 files changed, 12 insertions(+), 5 deletions(-) diff --git a/packages/google-cloud-securitycenter/CHANGELOG.md b/packages/google-cloud-securitycenter/CHANGELOG.md index 3e1f81a6dff..462a3e83ad3 100644 --- a/packages/google-cloud-securitycenter/CHANGELOG.md +++ b/packages/google-cloud-securitycenter/CHANGELOG.md @@ -4,6 +4,13 @@ [1]: https://www.npmjs.com/package/@google-cloud/security-center?activeTab=versions +## [5.11.0](https://github.com/googleapis/nodejs-security-center/compare/v5.10.0...v5.11.0) (2022-05-06) + + +### Features + +* Add connection and description field to finding's list of attributes ([#479](https://github.com/googleapis/nodejs-security-center/issues/479)) ([fa705d9](https://github.com/googleapis/nodejs-security-center/commit/fa705d9e4fe41c64870480670b536a6640d5aa46)) + ## [5.10.0](https://github.com/googleapis/nodejs-security-center/compare/v5.9.0...v5.10.0) (2022-04-11) diff --git a/packages/google-cloud-securitycenter/package.json b/packages/google-cloud-securitycenter/package.json index b7c2a43a1bf..9e19080f297 100644 --- a/packages/google-cloud-securitycenter/package.json +++ b/packages/google-cloud-securitycenter/package.json @@ -1,7 +1,7 @@ { "name": "@google-cloud/security-center", "description": "Cloud Security Command Center API client for Node.js", - "version": "5.10.0", + "version": "5.11.0", "license": "Apache-2.0", "author": "Google LLC", "engines": { diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/snippet_metadata.google.cloud.securitycenter.v1.json b/packages/google-cloud-securitycenter/samples/generated/v1/snippet_metadata.google.cloud.securitycenter.v1.json index 9c55e8ab650..e8b8231732a 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/snippet_metadata.google.cloud.securitycenter.v1.json +++ b/packages/google-cloud-securitycenter/samples/generated/v1/snippet_metadata.google.cloud.securitycenter.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-securitycenter", - "version": "5.10.0", + "version": "5.11.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-securitycenter/samples/generated/v1beta1/snippet_metadata.google.cloud.securitycenter.v1beta1.json b/packages/google-cloud-securitycenter/samples/generated/v1beta1/snippet_metadata.google.cloud.securitycenter.v1beta1.json index 67bec451de9..fe07d9feb2e 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1beta1/snippet_metadata.google.cloud.securitycenter.v1beta1.json +++ b/packages/google-cloud-securitycenter/samples/generated/v1beta1/snippet_metadata.google.cloud.securitycenter.v1beta1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-securitycenter", - "version": "5.10.0", + "version": "5.11.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/snippet_metadata.google.cloud.securitycenter.v1p1beta1.json b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/snippet_metadata.google.cloud.securitycenter.v1p1beta1.json index f4b338ebb75..bff11976d78 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/snippet_metadata.google.cloud.securitycenter.v1p1beta1.json +++ b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/snippet_metadata.google.cloud.securitycenter.v1p1beta1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-securitycenter", - "version": "5.10.0", + "version": "5.11.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-securitycenter/samples/package.json b/packages/google-cloud-securitycenter/samples/package.json index e67b9c4d6a8..a58c283408e 100644 --- a/packages/google-cloud-securitycenter/samples/package.json +++ b/packages/google-cloud-securitycenter/samples/package.json @@ -14,7 +14,7 @@ "license": "Apache-2.0", "dependencies": { "@google-cloud/pubsub": "^2.0.0", - "@google-cloud/security-center": "^5.10.0" + "@google-cloud/security-center": "^5.11.0" }, "devDependencies": { "chai": "^4.2.0", From 28ab6aaa839454600ffe996e64b97eea5ae6cb5d Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Mon, 9 May 2022 17:40:19 +0200 Subject: [PATCH 314/342] chore(deps): update dependency sinon to v14 (#485) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [sinon](https://sinonjs.org/) ([source](https://togithub.com/sinonjs/sinon)) | [`^13.0.0` -> `^14.0.0`](https://renovatebot.com/diffs/npm/sinon/13.0.2/14.0.0) | [![age](https://badges.renovateapi.com/packages/npm/sinon/14.0.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/sinon/14.0.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/sinon/14.0.0/compatibility-slim/13.0.2)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/sinon/14.0.0/confidence-slim/13.0.2)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
sinonjs/sinon ### [`v14.0.0`](https://togithub.com/sinonjs/sinon/blob/HEAD/CHANGES.md#​1400) [Compare Source](https://togithub.com/sinonjs/sinon/compare/v13.0.2...v14.0.0) - [`c2bbd826`](https://togithub.com/sinonjs/sinon/commit/c2bbd82641444eb5b32822489ae40f185afbbf00) Drop node 12 (Morgan Roderick) > And embrace Node 18 > > See https://nodejs.org/en/about/releases/ *Released by Morgan Roderick on 2022-05-07.*
--- ### Configuration 📅 **Schedule**: "after 9am and before 3pm" (UTC). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/nodejs-security-center). --- packages/google-cloud-securitycenter/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-securitycenter/package.json b/packages/google-cloud-securitycenter/package.json index 9e19080f297..62af2dda17e 100644 --- a/packages/google-cloud-securitycenter/package.json +++ b/packages/google-cloud-securitycenter/package.json @@ -57,7 +57,7 @@ "mocha": "^8.0.0", "null-loader": "^4.0.0", "pack-n-play": "^1.0.0-2", - "sinon": "^13.0.0", + "sinon": "^14.0.0", "ts-loader": "^8.0.0", "typescript": "^3.8.3" } From 7c58f75110efb250c8beccb0bf1173d4bfd2e011 Mon Sep 17 00:00:00 2001 From: sofisl <55454395+sofisl@users.noreply.github.com> Date: Wed, 18 May 2022 10:48:58 -0700 Subject: [PATCH 315/342] build!: update library to use Node 12 (#486) * build!: Update library to use Node 12 Co-authored-by: Owl Bot --- packages/google-cloud-securitycenter/package.json | 10 +++++----- .../google-cloud-securitycenter/samples/package.json | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/packages/google-cloud-securitycenter/package.json b/packages/google-cloud-securitycenter/package.json index 62af2dda17e..e865175d86c 100644 --- a/packages/google-cloud-securitycenter/package.json +++ b/packages/google-cloud-securitycenter/package.json @@ -5,7 +5,7 @@ "license": "Apache-2.0", "author": "Google LLC", "engines": { - "node": ">=10" + "node": ">=12.0.0" }, "repository": "googleapis/nodejs-security-center", "files": [ @@ -42,23 +42,23 @@ "Security Command Center API" ], "dependencies": { - "google-gax": "^2.24.1" + "google-gax": "^3.0.1" }, "devDependencies": { "@types/mocha": "^9.0.0", "@types/node": "^16.0.0", "@types/sinon": "^10.0.0", "c8": "^7.0.0", - "gts": "^3.0.0", + "gts": "^3.1.0", "jsdoc": "^3.6.2", "jsdoc-fresh": "^1.0.1", "jsdoc-region-tag": "^1.0.2", "linkinator": "^2.0.0", - "mocha": "^8.0.0", + "mocha": "^9.2.2", "null-loader": "^4.0.0", "pack-n-play": "^1.0.0-2", "sinon": "^14.0.0", "ts-loader": "^8.0.0", - "typescript": "^3.8.3" + "typescript": "^4.6.4" } } diff --git a/packages/google-cloud-securitycenter/samples/package.json b/packages/google-cloud-securitycenter/samples/package.json index a58c283408e..2ecec9af2e9 100644 --- a/packages/google-cloud-securitycenter/samples/package.json +++ b/packages/google-cloud-securitycenter/samples/package.json @@ -6,7 +6,7 @@ "!system-test/" ], "engines": { - "node": ">=10" + "node": ">=12.0.0" }, "scripts": { "test": "mocha system-test/ --recursive --timeout 6000000" @@ -21,4 +21,4 @@ "mocha": "^8.0.0", "uuid": "^8.0.0" } -} +} \ No newline at end of file From cd264daaca690296502adea6ae48ba2a1f501205 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Fri, 3 Jun 2022 09:53:27 -0700 Subject: [PATCH 316/342] feat: Add compliances, processes and exfiltration fields to findings attributes. They contain compliance information about a security standard indicating unmet recommendations, represents operating system processes, and data exfiltration attempt of one... (#490) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: Add compliances, processes and exfiltration fields to findings attributes. They contain compliance information about a security standard indicating unmet recommendations, represents operating system processes, and data exfiltration attempt of one or more source(s) to one or more target(s). Source(s) represent the source of data that is exfiltrated, and Target(s) represents the destination the data was copied to PiperOrigin-RevId: 452067806 Source-Link: https://github.com/googleapis/googleapis/commit/5bfadd980c361451b4d4a69041e24bb04329dab3 Source-Link: https://github.com/googleapis/googleapis-gen/commit/ae56215246dee968a4eac43b0012d676876e52a4 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYWU1NjIxNTI0NmRlZTk2OGE0ZWFjNDNiMDAxMmQ2NzY4NzZlNTJhNCJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot --- .../cloud/securitycenter/v1/compliance.proto | 39 + .../securitycenter/v1/exfiltration.proto | 52 + .../google/cloud/securitycenter/v1/file.proto | 52 + .../cloud/securitycenter/v1/finding.proto | 23 +- .../securitycenter/v1/mitre_attack.proto | 4 +- .../cloud/securitycenter/v1/process.proto | 70 + .../protos/protos.d.ts | 669 +- .../protos/protos.js | 6030 +++++++++++------ .../protos/protos.json | 144 +- .../src/v1/security_center_client.ts | 177 + .../src/v1/security_center_proto_list.json | 4 + .../test/gapic_security_center_v1.ts | 305 + 12 files changed, 5472 insertions(+), 2097 deletions(-) create mode 100644 packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/compliance.proto create mode 100644 packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/exfiltration.proto create mode 100644 packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/file.proto create mode 100644 packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/process.proto diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/compliance.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/compliance.proto new file mode 100644 index 00000000000..ca1353b69d0 --- /dev/null +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/compliance.proto @@ -0,0 +1,39 @@ +// 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.cloud.securitycenter.v1; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1;securitycenter"; +option java_multiple_files = true; +option java_outer_classname = "ComplianceProto"; +option java_package = "com.google.cloud.securitycenter.v1"; +option php_namespace = "Google\\Cloud\\SecurityCenter\\V1"; +option ruby_package = "Google::Cloud::SecurityCenter::V1"; + +// Contains compliance information about a security standard indicating unmet +// recommendations. +message Compliance { + // Refers to industry wide standards or benchmarks e.g. "cis", "pci", "owasp", + // etc. + string standard = 1; + + // Version of the standard/benchmark e.g. 1.1 + string version = 2; + + // Policies within the standard/benchmark e.g. A.12.4.1 + repeated string ids = 3; +} diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/exfiltration.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/exfiltration.proto new file mode 100644 index 00000000000..14e644f6602 --- /dev/null +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/exfiltration.proto @@ -0,0 +1,52 @@ +// 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.cloud.securitycenter.v1; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1;securitycenter"; +option java_multiple_files = true; +option java_outer_classname = "ExfiltrationProto"; +option java_package = "com.google.cloud.securitycenter.v1"; +option php_namespace = "Google\\Cloud\\SecurityCenter\\V1"; +option ruby_package = "Google::Cloud::SecurityCenter::V1"; + +// Exfiltration represents a data exfiltration attempt of one or more +// sources to one or more targets. Sources represent the source +// of data that is exfiltrated, and Targets represents the destination the +// data was copied to. +message Exfiltration { + // If there are multiple sources, then the data is considered "joined" between + // them. For instance, BigQuery can join multiple tables, and each + // table would be considered a source. + repeated ExfilResource sources = 1; + + // If there are multiple targets, each target would get a complete copy of the + // "joined" source data. + repeated ExfilResource targets = 2; +} + +// Resource that has been exfiltrated or exfiltrated_to. +message ExfilResource { + // Resource's URI (https://google.aip.dev/122#full-resource-names) + string name = 1; + + // Subcomponents of the asset that is exfiltrated - these could be + // URIs used during exfiltration, table names, databases, filenames, etc. + // For example, multiple tables may be exfiltrated from the same CloudSQL + // instance, or multiple files from the same Cloud Storage bucket. + repeated string components = 2; +} diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/file.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/file.proto new file mode 100644 index 00000000000..97ba1d0bde3 --- /dev/null +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/file.proto @@ -0,0 +1,52 @@ +// 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.cloud.securitycenter.v1; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1;securitycenter"; +option java_multiple_files = true; +option java_outer_classname = "FileProto"; +option java_package = "com.google.cloud.securitycenter.v1"; +option php_namespace = "Google\\Cloud\\SecurityCenter\\V1"; +option ruby_package = "Google::Cloud::SecurityCenter::V1"; + +// File information about the related binary/library used by an executable, or +// the script used by a script interpreter +message File { + // Absolute path of the file as a JSON encoded string. + string path = 1; + + // Size of the file in bytes. + int64 size = 2; + + // SHA256 hash of the first hashed_size bytes of the file encoded as a + // hex string. If hashed_size == size, hash_sha256 represents the SHA256 hash + // of the entire file. + string sha256 = 3; + + // The length in bytes of the file prefix that was hashed. If + // hashed_size == size, any hashes reported represent the entire + // file. + int64 hashed_size = 4; + + // True when the hash covers only a prefix of the file. + bool partially_hashed = 5; + + // Prefix of the file contents as a JSON encoded string. + // (Currently only populated for Malicious Script Executed findings.) + string contents = 6; +} diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/finding.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/finding.proto index 20d920d249b..e43a90c285e 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/finding.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/finding.proto @@ -19,11 +19,14 @@ package google.cloud.securitycenter.v1; import "google/api/field_behavior.proto"; import "google/api/resource.proto"; import "google/cloud/securitycenter/v1/access.proto"; +import "google/cloud/securitycenter/v1/compliance.proto"; import "google/cloud/securitycenter/v1/connection.proto"; +import "google/cloud/securitycenter/v1/exfiltration.proto"; import "google/cloud/securitycenter/v1/external_system.proto"; import "google/cloud/securitycenter/v1/iam_binding.proto"; import "google/cloud/securitycenter/v1/indicator.proto"; import "google/cloud/securitycenter/v1/mitre_attack.proto"; +import "google/cloud/securitycenter/v1/process.proto"; import "google/cloud/securitycenter/v1/security_marks.proto"; import "google/cloud/securitycenter/v1/vulnerability.proto"; import "google/protobuf/struct.proto"; @@ -251,11 +254,13 @@ message Finding { Vulnerability vulnerability = 20; // Output only. The most recent time this finding was muted or unmuted. - google.protobuf.Timestamp mute_update_time = 21 [(google.api.field_behavior) = OUTPUT_ONLY]; + google.protobuf.Timestamp mute_update_time = 21 + [(google.api.field_behavior) = OUTPUT_ONLY]; - // Output only. Third party SIEM/SOAR fields within SCC, contains external system - // information and external system finding fields. - map external_systems = 22 [(google.api.field_behavior) = OUTPUT_ONLY]; + // Output only. Third party SIEM/SOAR fields within SCC, contains external + // system information and external system finding fields. + map external_systems = 22 + [(google.api.field_behavior) = OUTPUT_ONLY]; // MITRE ATT&CK tactics and techniques related to this finding. // See: https://attack.mitre.org @@ -274,9 +279,19 @@ message Finding { // shouldn't set the value of mute. string mute_initiator = 28; + // Represents operating system processes associated with the Finding. + repeated Process processes = 30; + + // Contains compliance information for security standards associated to the + // finding. + repeated Compliance compliances = 34; + // Contains more detail about the finding. string description = 37; + // Represents exfiltration associated with the Finding. + Exfiltration exfiltration = 38; + // Represents IAM bindings associated with the Finding. repeated IamBinding iam_bindings = 39; diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/mitre_attack.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/mitre_attack.proto index bb315d5f2da..c65f62f17ef 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/mitre_attack.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/mitre_attack.proto @@ -78,7 +78,6 @@ message MitreAttack { // MITRE ATT&CK techniques that can be referenced by SCC findings. // See: https://attack.mitre.org/techniques/enterprise/ - // Next ID: 31 enum Technique { // Unspecified value. TECHNIQUE_UNSPECIFIED = 0; @@ -172,6 +171,9 @@ message MitreAttack { // T1484 DOMAIN_POLICY_MODIFICATION = 30; + + // T1562 + IMPAIR_DEFENSES = 31; } // The MITRE ATT&CK tactic most closely represented by this finding, if any. diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/process.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/process.proto new file mode 100644 index 00000000000..185f0467fe0 --- /dev/null +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/process.proto @@ -0,0 +1,70 @@ +// 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.cloud.securitycenter.v1; + +import "google/cloud/securitycenter/v1/file.proto"; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1;securitycenter"; +option java_multiple_files = true; +option java_outer_classname = "ProcessProto"; +option java_package = "com.google.cloud.securitycenter.v1"; +option php_namespace = "Google\\Cloud\\SecurityCenter\\V1"; +option ruby_package = "Google::Cloud::SecurityCenter::V1"; + +// Represents an operating system process. +message Process { + // File information for the process executable. + File binary = 3; + + // File information for libraries loaded by the process. + repeated File libraries = 4; + + // When the process represents the invocation of a script, + // `binary` provides information about the interpreter while `script` + // provides information about the script file provided to the + // interpreter. + File script = 5; + + // Process arguments as JSON encoded strings. + repeated string args = 6; + + // True if `args` is incomplete. + bool arguments_truncated = 7; + + // Process environment variables. + repeated EnvironmentVariable env_variables = 8; + + // True if `env_variables` is incomplete. + bool env_variables_truncated = 9; + + // The process id. + int64 pid = 10; + + // The parent process id. + int64 parent_pid = 11; +} + +// EnvironmentVariable is a name-value pair to store environment variables for +// Process. +message EnvironmentVariable { + // Environment variable name as a JSON encoded string. + string name = 1; + + // Environment variable value as a JSON encoded string. + string val = 2; +} diff --git a/packages/google-cloud-securitycenter/protos/protos.d.ts b/packages/google-cloud-securitycenter/protos/protos.d.ts index 26c587451ac..bc6492bae0b 100644 --- a/packages/google-cloud-securitycenter/protos/protos.d.ts +++ b/packages/google-cloud-securitycenter/protos/protos.d.ts @@ -929,6 +929,108 @@ export namespace google { public toJSON(): { [k: string]: any }; } + /** Properties of a Compliance. */ + interface ICompliance { + + /** Compliance standard */ + standard?: (string|null); + + /** Compliance version */ + version?: (string|null); + + /** Compliance ids */ + ids?: (string[]|null); + } + + /** Represents a Compliance. */ + class Compliance implements ICompliance { + + /** + * Constructs a new Compliance. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.ICompliance); + + /** Compliance standard. */ + public standard: string; + + /** Compliance version. */ + public version: string; + + /** Compliance ids. */ + public ids: string[]; + + /** + * Creates a new Compliance instance using the specified properties. + * @param [properties] Properties to set + * @returns Compliance instance + */ + public static create(properties?: google.cloud.securitycenter.v1.ICompliance): google.cloud.securitycenter.v1.Compliance; + + /** + * Encodes the specified Compliance message. Does not implicitly {@link google.cloud.securitycenter.v1.Compliance.verify|verify} messages. + * @param message Compliance message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.ICompliance, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Compliance message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Compliance.verify|verify} messages. + * @param message Compliance message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.ICompliance, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Compliance message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Compliance + * @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.cloud.securitycenter.v1.Compliance; + + /** + * Decodes a Compliance message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Compliance + * @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.cloud.securitycenter.v1.Compliance; + + /** + * Verifies a Compliance 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 Compliance message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Compliance + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.Compliance; + + /** + * Creates a plain object from a Compliance message. Also converts values to other types if specified. + * @param message Compliance + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.Compliance, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Compliance to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + /** Properties of a Connection. */ interface IConnection { @@ -1056,6 +1158,198 @@ export namespace google { } } + /** Properties of an Exfiltration. */ + interface IExfiltration { + + /** Exfiltration sources */ + sources?: (google.cloud.securitycenter.v1.IExfilResource[]|null); + + /** Exfiltration targets */ + targets?: (google.cloud.securitycenter.v1.IExfilResource[]|null); + } + + /** Represents an Exfiltration. */ + class Exfiltration implements IExfiltration { + + /** + * Constructs a new Exfiltration. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IExfiltration); + + /** Exfiltration sources. */ + public sources: google.cloud.securitycenter.v1.IExfilResource[]; + + /** Exfiltration targets. */ + public targets: google.cloud.securitycenter.v1.IExfilResource[]; + + /** + * Creates a new Exfiltration instance using the specified properties. + * @param [properties] Properties to set + * @returns Exfiltration instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IExfiltration): google.cloud.securitycenter.v1.Exfiltration; + + /** + * Encodes the specified Exfiltration message. Does not implicitly {@link google.cloud.securitycenter.v1.Exfiltration.verify|verify} messages. + * @param message Exfiltration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IExfiltration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Exfiltration message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Exfiltration.verify|verify} messages. + * @param message Exfiltration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IExfiltration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Exfiltration message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Exfiltration + * @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.cloud.securitycenter.v1.Exfiltration; + + /** + * Decodes an Exfiltration message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Exfiltration + * @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.cloud.securitycenter.v1.Exfiltration; + + /** + * Verifies an Exfiltration 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 Exfiltration message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Exfiltration + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.Exfiltration; + + /** + * Creates a plain object from an Exfiltration message. Also converts values to other types if specified. + * @param message Exfiltration + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.Exfiltration, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Exfiltration to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an ExfilResource. */ + interface IExfilResource { + + /** ExfilResource name */ + name?: (string|null); + + /** ExfilResource components */ + components?: (string[]|null); + } + + /** Represents an ExfilResource. */ + class ExfilResource implements IExfilResource { + + /** + * Constructs a new ExfilResource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IExfilResource); + + /** ExfilResource name. */ + public name: string; + + /** ExfilResource components. */ + public components: string[]; + + /** + * Creates a new ExfilResource instance using the specified properties. + * @param [properties] Properties to set + * @returns ExfilResource instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IExfilResource): google.cloud.securitycenter.v1.ExfilResource; + + /** + * Encodes the specified ExfilResource message. Does not implicitly {@link google.cloud.securitycenter.v1.ExfilResource.verify|verify} messages. + * @param message ExfilResource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IExfilResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExfilResource message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ExfilResource.verify|verify} messages. + * @param message ExfilResource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IExfilResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExfilResource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExfilResource + * @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.cloud.securitycenter.v1.ExfilResource; + + /** + * Decodes an ExfilResource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExfilResource + * @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.cloud.securitycenter.v1.ExfilResource; + + /** + * Verifies an ExfilResource 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 ExfilResource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExfilResource + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.ExfilResource; + + /** + * Creates a plain object from an ExfilResource message. Also converts values to other types if specified. + * @param message ExfilResource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.ExfilResource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExfilResource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + /** Properties of an ExternalSystem. */ interface IExternalSystem { @@ -1170,6 +1464,126 @@ export namespace google { public toJSON(): { [k: string]: any }; } + /** Properties of a File. */ + interface IFile { + + /** File path */ + path?: (string|null); + + /** File size */ + size?: (number|Long|string|null); + + /** File sha256 */ + sha256?: (string|null); + + /** File hashedSize */ + hashedSize?: (number|Long|string|null); + + /** File partiallyHashed */ + partiallyHashed?: (boolean|null); + + /** File contents */ + contents?: (string|null); + } + + /** Represents a File. */ + class File implements IFile { + + /** + * Constructs a new File. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IFile); + + /** File path. */ + public path: string; + + /** File size. */ + public size: (number|Long|string); + + /** File sha256. */ + public sha256: string; + + /** File hashedSize. */ + public hashedSize: (number|Long|string); + + /** File partiallyHashed. */ + public partiallyHashed: boolean; + + /** File contents. */ + public contents: string; + + /** + * Creates a new File instance using the specified properties. + * @param [properties] Properties to set + * @returns File instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IFile): google.cloud.securitycenter.v1.File; + + /** + * Encodes the specified File message. Does not implicitly {@link google.cloud.securitycenter.v1.File.verify|verify} messages. + * @param message File message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IFile, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified File message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.File.verify|verify} messages. + * @param message File message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IFile, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a File message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns File + * @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.cloud.securitycenter.v1.File; + + /** + * Decodes a File message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns File + * @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.cloud.securitycenter.v1.File; + + /** + * Verifies a File 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 File message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns File + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.File; + + /** + * Creates a plain object from a File message. Also converts values to other types if specified. + * @param message File + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.File, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this File to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + /** Properties of a Finding. */ interface IFinding { @@ -1239,9 +1653,18 @@ export namespace google { /** Finding muteInitiator */ muteInitiator?: (string|null); + /** Finding processes */ + processes?: (google.cloud.securitycenter.v1.IProcess[]|null); + + /** Finding compliances */ + compliances?: (google.cloud.securitycenter.v1.ICompliance[]|null); + /** Finding description */ description?: (string|null); + /** Finding exfiltration */ + exfiltration?: (google.cloud.securitycenter.v1.IExfiltration|null); + /** Finding iamBindings */ iamBindings?: (google.cloud.securitycenter.v1.IIamBinding[]|null); @@ -1324,9 +1747,18 @@ export namespace google { /** Finding muteInitiator. */ public muteInitiator: string; + /** Finding processes. */ + public processes: google.cloud.securitycenter.v1.IProcess[]; + + /** Finding compliances. */ + public compliances: google.cloud.securitycenter.v1.ICompliance[]; + /** Finding description. */ public description: string; + /** Finding exfiltration. */ + public exfiltration?: (google.cloud.securitycenter.v1.IExfiltration|null); + /** Finding iamBindings. */ public iamBindings: google.cloud.securitycenter.v1.IIamBinding[]; @@ -1816,10 +2248,245 @@ export namespace google { EXPLOIT_PUBLIC_FACING_APPLICATION = 27, MODIFY_AUTHENTICATION_PROCESS = 28, DATA_DESTRUCTION = 29, - DOMAIN_POLICY_MODIFICATION = 30 + DOMAIN_POLICY_MODIFICATION = 30, + IMPAIR_DEFENSES = 31 } } + /** Properties of a Process. */ + interface IProcess { + + /** Process binary */ + binary?: (google.cloud.securitycenter.v1.IFile|null); + + /** Process libraries */ + libraries?: (google.cloud.securitycenter.v1.IFile[]|null); + + /** Process script */ + script?: (google.cloud.securitycenter.v1.IFile|null); + + /** Process args */ + args?: (string[]|null); + + /** Process argumentsTruncated */ + argumentsTruncated?: (boolean|null); + + /** Process envVariables */ + envVariables?: (google.cloud.securitycenter.v1.IEnvironmentVariable[]|null); + + /** Process envVariablesTruncated */ + envVariablesTruncated?: (boolean|null); + + /** Process pid */ + pid?: (number|Long|string|null); + + /** Process parentPid */ + parentPid?: (number|Long|string|null); + } + + /** Represents a Process. */ + class Process implements IProcess { + + /** + * Constructs a new Process. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IProcess); + + /** Process binary. */ + public binary?: (google.cloud.securitycenter.v1.IFile|null); + + /** Process libraries. */ + public libraries: google.cloud.securitycenter.v1.IFile[]; + + /** Process script. */ + public script?: (google.cloud.securitycenter.v1.IFile|null); + + /** Process args. */ + public args: string[]; + + /** Process argumentsTruncated. */ + public argumentsTruncated: boolean; + + /** Process envVariables. */ + public envVariables: google.cloud.securitycenter.v1.IEnvironmentVariable[]; + + /** Process envVariablesTruncated. */ + public envVariablesTruncated: boolean; + + /** Process pid. */ + public pid: (number|Long|string); + + /** Process parentPid. */ + public parentPid: (number|Long|string); + + /** + * Creates a new Process instance using the specified properties. + * @param [properties] Properties to set + * @returns Process instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IProcess): google.cloud.securitycenter.v1.Process; + + /** + * Encodes the specified Process message. Does not implicitly {@link google.cloud.securitycenter.v1.Process.verify|verify} messages. + * @param message Process message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IProcess, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Process message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Process.verify|verify} messages. + * @param message Process message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IProcess, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Process message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Process + * @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.cloud.securitycenter.v1.Process; + + /** + * Decodes a Process message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Process + * @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.cloud.securitycenter.v1.Process; + + /** + * Verifies a Process 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 Process message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Process + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.Process; + + /** + * Creates a plain object from a Process message. Also converts values to other types if specified. + * @param message Process + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.Process, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Process to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an EnvironmentVariable. */ + interface IEnvironmentVariable { + + /** EnvironmentVariable name */ + name?: (string|null); + + /** EnvironmentVariable val */ + val?: (string|null); + } + + /** Represents an EnvironmentVariable. */ + class EnvironmentVariable implements IEnvironmentVariable { + + /** + * Constructs a new EnvironmentVariable. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IEnvironmentVariable); + + /** EnvironmentVariable name. */ + public name: string; + + /** EnvironmentVariable val. */ + public val: string; + + /** + * Creates a new EnvironmentVariable instance using the specified properties. + * @param [properties] Properties to set + * @returns EnvironmentVariable instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IEnvironmentVariable): google.cloud.securitycenter.v1.EnvironmentVariable; + + /** + * Encodes the specified EnvironmentVariable message. Does not implicitly {@link google.cloud.securitycenter.v1.EnvironmentVariable.verify|verify} messages. + * @param message EnvironmentVariable message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IEnvironmentVariable, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnvironmentVariable message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.EnvironmentVariable.verify|verify} messages. + * @param message EnvironmentVariable message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IEnvironmentVariable, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnvironmentVariable message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnvironmentVariable + * @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.cloud.securitycenter.v1.EnvironmentVariable; + + /** + * Decodes an EnvironmentVariable message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnvironmentVariable + * @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.cloud.securitycenter.v1.EnvironmentVariable; + + /** + * Verifies an EnvironmentVariable 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 EnvironmentVariable message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnvironmentVariable + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.EnvironmentVariable; + + /** + * Creates a plain object from an EnvironmentVariable message. Also converts values to other types if specified. + * @param message EnvironmentVariable + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.EnvironmentVariable, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnvironmentVariable to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + /** Properties of a Vulnerability. */ interface IVulnerability { diff --git a/packages/google-cloud-securitycenter/protos/protos.js b/packages/google-cloud-securitycenter/protos/protos.js index 2e1ca6efc9b..33e2e0b4b8a 100644 --- a/packages/google-cloud-securitycenter/protos/protos.js +++ b/packages/google-cloud-securitycenter/protos/protos.js @@ -2386,6 +2386,255 @@ return BigQueryExport; })(); + v1.Compliance = (function() { + + /** + * Properties of a Compliance. + * @memberof google.cloud.securitycenter.v1 + * @interface ICompliance + * @property {string|null} [standard] Compliance standard + * @property {string|null} [version] Compliance version + * @property {Array.|null} [ids] Compliance ids + */ + + /** + * Constructs a new Compliance. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a Compliance. + * @implements ICompliance + * @constructor + * @param {google.cloud.securitycenter.v1.ICompliance=} [properties] Properties to set + */ + function Compliance(properties) { + this.ids = []; + 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]]; + } + + /** + * Compliance standard. + * @member {string} standard + * @memberof google.cloud.securitycenter.v1.Compliance + * @instance + */ + Compliance.prototype.standard = ""; + + /** + * Compliance version. + * @member {string} version + * @memberof google.cloud.securitycenter.v1.Compliance + * @instance + */ + Compliance.prototype.version = ""; + + /** + * Compliance ids. + * @member {Array.} ids + * @memberof google.cloud.securitycenter.v1.Compliance + * @instance + */ + Compliance.prototype.ids = $util.emptyArray; + + /** + * Creates a new Compliance instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.Compliance + * @static + * @param {google.cloud.securitycenter.v1.ICompliance=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.Compliance} Compliance instance + */ + Compliance.create = function create(properties) { + return new Compliance(properties); + }; + + /** + * Encodes the specified Compliance message. Does not implicitly {@link google.cloud.securitycenter.v1.Compliance.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.Compliance + * @static + * @param {google.cloud.securitycenter.v1.ICompliance} message Compliance message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Compliance.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.standard != null && Object.hasOwnProperty.call(message, "standard")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.standard); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.version); + if (message.ids != null && message.ids.length) + for (var i = 0; i < message.ids.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.ids[i]); + return writer; + }; + + /** + * Encodes the specified Compliance message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Compliance.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.Compliance + * @static + * @param {google.cloud.securitycenter.v1.ICompliance} message Compliance message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Compliance.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Compliance message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.Compliance + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.Compliance} Compliance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Compliance.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.cloud.securitycenter.v1.Compliance(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.standard = reader.string(); + break; + case 2: + message.version = reader.string(); + break; + case 3: + if (!(message.ids && message.ids.length)) + message.ids = []; + message.ids.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Compliance message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.Compliance + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.Compliance} Compliance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Compliance.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Compliance message. + * @function verify + * @memberof google.cloud.securitycenter.v1.Compliance + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Compliance.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.standard != null && message.hasOwnProperty("standard")) + if (!$util.isString(message.standard)) + return "standard: string expected"; + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isString(message.version)) + return "version: string expected"; + if (message.ids != null && message.hasOwnProperty("ids")) { + if (!Array.isArray(message.ids)) + return "ids: array expected"; + for (var i = 0; i < message.ids.length; ++i) + if (!$util.isString(message.ids[i])) + return "ids: string[] expected"; + } + return null; + }; + + /** + * Creates a Compliance message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.Compliance + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.Compliance} Compliance + */ + Compliance.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.Compliance) + return object; + var message = new $root.google.cloud.securitycenter.v1.Compliance(); + if (object.standard != null) + message.standard = String(object.standard); + if (object.version != null) + message.version = String(object.version); + if (object.ids) { + if (!Array.isArray(object.ids)) + throw TypeError(".google.cloud.securitycenter.v1.Compliance.ids: array expected"); + message.ids = []; + for (var i = 0; i < object.ids.length; ++i) + message.ids[i] = String(object.ids[i]); + } + return message; + }; + + /** + * Creates a plain object from a Compliance message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.Compliance + * @static + * @param {google.cloud.securitycenter.v1.Compliance} message Compliance + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Compliance.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.ids = []; + if (options.defaults) { + object.standard = ""; + object.version = ""; + } + if (message.standard != null && message.hasOwnProperty("standard")) + object.standard = message.standard; + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + if (message.ids && message.ids.length) { + object.ids = []; + for (var j = 0; j < message.ids.length; ++j) + object.ids[j] = message.ids[j]; + } + return object; + }; + + /** + * Converts this Compliance to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.Compliance + * @instance + * @returns {Object.} JSON object + */ + Compliance.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Compliance; + })(); + v1.Connection = (function() { /** @@ -2717,29 +2966,27 @@ return Connection; })(); - v1.ExternalSystem = (function() { + v1.Exfiltration = (function() { /** - * Properties of an ExternalSystem. + * Properties of an Exfiltration. * @memberof google.cloud.securitycenter.v1 - * @interface IExternalSystem - * @property {string|null} [name] ExternalSystem name - * @property {Array.|null} [assignees] ExternalSystem assignees - * @property {string|null} [externalUid] ExternalSystem externalUid - * @property {string|null} [status] ExternalSystem status - * @property {google.protobuf.ITimestamp|null} [externalSystemUpdateTime] ExternalSystem externalSystemUpdateTime + * @interface IExfiltration + * @property {Array.|null} [sources] Exfiltration sources + * @property {Array.|null} [targets] Exfiltration targets */ /** - * Constructs a new ExternalSystem. + * Constructs a new Exfiltration. * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents an ExternalSystem. - * @implements IExternalSystem + * @classdesc Represents an Exfiltration. + * @implements IExfiltration * @constructor - * @param {google.cloud.securitycenter.v1.IExternalSystem=} [properties] Properties to set + * @param {google.cloud.securitycenter.v1.IExfiltration=} [properties] Properties to set */ - function ExternalSystem(properties) { - this.assignees = []; + function Exfiltration(properties) { + this.sources = []; + this.targets = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -2747,130 +2994,94 @@ } /** - * ExternalSystem name. - * @member {string} name - * @memberof google.cloud.securitycenter.v1.ExternalSystem - * @instance - */ - ExternalSystem.prototype.name = ""; - - /** - * ExternalSystem assignees. - * @member {Array.} assignees - * @memberof google.cloud.securitycenter.v1.ExternalSystem - * @instance - */ - ExternalSystem.prototype.assignees = $util.emptyArray; - - /** - * ExternalSystem externalUid. - * @member {string} externalUid - * @memberof google.cloud.securitycenter.v1.ExternalSystem - * @instance - */ - ExternalSystem.prototype.externalUid = ""; - - /** - * ExternalSystem status. - * @member {string} status - * @memberof google.cloud.securitycenter.v1.ExternalSystem + * Exfiltration sources. + * @member {Array.} sources + * @memberof google.cloud.securitycenter.v1.Exfiltration * @instance */ - ExternalSystem.prototype.status = ""; + Exfiltration.prototype.sources = $util.emptyArray; /** - * ExternalSystem externalSystemUpdateTime. - * @member {google.protobuf.ITimestamp|null|undefined} externalSystemUpdateTime - * @memberof google.cloud.securitycenter.v1.ExternalSystem + * Exfiltration targets. + * @member {Array.} targets + * @memberof google.cloud.securitycenter.v1.Exfiltration * @instance */ - ExternalSystem.prototype.externalSystemUpdateTime = null; + Exfiltration.prototype.targets = $util.emptyArray; /** - * Creates a new ExternalSystem instance using the specified properties. + * Creates a new Exfiltration instance using the specified properties. * @function create - * @memberof google.cloud.securitycenter.v1.ExternalSystem + * @memberof google.cloud.securitycenter.v1.Exfiltration * @static - * @param {google.cloud.securitycenter.v1.IExternalSystem=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.ExternalSystem} ExternalSystem instance + * @param {google.cloud.securitycenter.v1.IExfiltration=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.Exfiltration} Exfiltration instance */ - ExternalSystem.create = function create(properties) { - return new ExternalSystem(properties); + Exfiltration.create = function create(properties) { + return new Exfiltration(properties); }; /** - * Encodes the specified ExternalSystem message. Does not implicitly {@link google.cloud.securitycenter.v1.ExternalSystem.verify|verify} messages. + * Encodes the specified Exfiltration message. Does not implicitly {@link google.cloud.securitycenter.v1.Exfiltration.verify|verify} messages. * @function encode - * @memberof google.cloud.securitycenter.v1.ExternalSystem + * @memberof google.cloud.securitycenter.v1.Exfiltration * @static - * @param {google.cloud.securitycenter.v1.IExternalSystem} message ExternalSystem message or plain object to encode + * @param {google.cloud.securitycenter.v1.IExfiltration} message Exfiltration message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ExternalSystem.encode = function encode(message, writer) { + Exfiltration.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.assignees != null && message.assignees.length) - for (var i = 0; i < message.assignees.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.assignees[i]); - if (message.externalUid != null && Object.hasOwnProperty.call(message, "externalUid")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.externalUid); - if (message.status != null && Object.hasOwnProperty.call(message, "status")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.status); - if (message.externalSystemUpdateTime != null && Object.hasOwnProperty.call(message, "externalSystemUpdateTime")) - $root.google.protobuf.Timestamp.encode(message.externalSystemUpdateTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.sources != null && message.sources.length) + for (var i = 0; i < message.sources.length; ++i) + $root.google.cloud.securitycenter.v1.ExfilResource.encode(message.sources[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.targets != null && message.targets.length) + for (var i = 0; i < message.targets.length; ++i) + $root.google.cloud.securitycenter.v1.ExfilResource.encode(message.targets[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** - * Encodes the specified ExternalSystem message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ExternalSystem.verify|verify} messages. + * Encodes the specified Exfiltration message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Exfiltration.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.ExternalSystem + * @memberof google.cloud.securitycenter.v1.Exfiltration * @static - * @param {google.cloud.securitycenter.v1.IExternalSystem} message ExternalSystem message or plain object to encode + * @param {google.cloud.securitycenter.v1.IExfiltration} message Exfiltration message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ExternalSystem.encodeDelimited = function encodeDelimited(message, writer) { + Exfiltration.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an ExternalSystem message from the specified reader or buffer. + * Decodes an Exfiltration message from the specified reader or buffer. * @function decode - * @memberof google.cloud.securitycenter.v1.ExternalSystem + * @memberof google.cloud.securitycenter.v1.Exfiltration * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.ExternalSystem} ExternalSystem + * @returns {google.cloud.securitycenter.v1.Exfiltration} Exfiltration * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ExternalSystem.decode = function decode(reader, length) { + Exfiltration.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.cloud.securitycenter.v1.ExternalSystem(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.Exfiltration(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.name = reader.string(); + if (!(message.sources && message.sources.length)) + message.sources = []; + message.sources.push($root.google.cloud.securitycenter.v1.ExfilResource.decode(reader, reader.uint32())); break; case 2: - if (!(message.assignees && message.assignees.length)) - message.assignees = []; - message.assignees.push(reader.string()); - break; - case 3: - message.externalUid = reader.string(); - break; - case 4: - message.status = reader.string(); - break; - case 5: - message.externalSystemUpdateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + if (!(message.targets && message.targets.length)) + message.targets = []; + message.targets.push($root.google.cloud.securitycenter.v1.ExfilResource.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -2881,186 +3092,152 @@ }; /** - * Decodes an ExternalSystem message from the specified reader or buffer, length delimited. + * Decodes an Exfiltration message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.ExternalSystem + * @memberof google.cloud.securitycenter.v1.Exfiltration * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.ExternalSystem} ExternalSystem + * @returns {google.cloud.securitycenter.v1.Exfiltration} Exfiltration * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ExternalSystem.decodeDelimited = function decodeDelimited(reader) { + Exfiltration.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an ExternalSystem message. + * Verifies an Exfiltration message. * @function verify - * @memberof google.cloud.securitycenter.v1.ExternalSystem + * @memberof google.cloud.securitycenter.v1.Exfiltration * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ExternalSystem.verify = function verify(message) { + Exfiltration.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.assignees != null && message.hasOwnProperty("assignees")) { - if (!Array.isArray(message.assignees)) - return "assignees: array expected"; - for (var i = 0; i < message.assignees.length; ++i) - if (!$util.isString(message.assignees[i])) - return "assignees: string[] expected"; + if (message.sources != null && message.hasOwnProperty("sources")) { + if (!Array.isArray(message.sources)) + return "sources: array expected"; + for (var i = 0; i < message.sources.length; ++i) { + var error = $root.google.cloud.securitycenter.v1.ExfilResource.verify(message.sources[i]); + if (error) + return "sources." + error; + } } - if (message.externalUid != null && message.hasOwnProperty("externalUid")) - if (!$util.isString(message.externalUid)) - return "externalUid: string expected"; - if (message.status != null && message.hasOwnProperty("status")) - if (!$util.isString(message.status)) - return "status: string expected"; - if (message.externalSystemUpdateTime != null && message.hasOwnProperty("externalSystemUpdateTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.externalSystemUpdateTime); - if (error) - return "externalSystemUpdateTime." + error; + if (message.targets != null && message.hasOwnProperty("targets")) { + if (!Array.isArray(message.targets)) + return "targets: array expected"; + for (var i = 0; i < message.targets.length; ++i) { + var error = $root.google.cloud.securitycenter.v1.ExfilResource.verify(message.targets[i]); + if (error) + return "targets." + error; + } } return null; }; /** - * Creates an ExternalSystem message from a plain object. Also converts values to their respective internal types. + * Creates an Exfiltration message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.securitycenter.v1.ExternalSystem + * @memberof google.cloud.securitycenter.v1.Exfiltration * @static * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.ExternalSystem} ExternalSystem + * @returns {google.cloud.securitycenter.v1.Exfiltration} Exfiltration */ - ExternalSystem.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.ExternalSystem) + Exfiltration.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.Exfiltration) return object; - var message = new $root.google.cloud.securitycenter.v1.ExternalSystem(); - if (object.name != null) - message.name = String(object.name); - if (object.assignees) { - if (!Array.isArray(object.assignees)) - throw TypeError(".google.cloud.securitycenter.v1.ExternalSystem.assignees: array expected"); - message.assignees = []; - for (var i = 0; i < object.assignees.length; ++i) - message.assignees[i] = String(object.assignees[i]); + var message = new $root.google.cloud.securitycenter.v1.Exfiltration(); + if (object.sources) { + if (!Array.isArray(object.sources)) + throw TypeError(".google.cloud.securitycenter.v1.Exfiltration.sources: array expected"); + message.sources = []; + for (var i = 0; i < object.sources.length; ++i) { + if (typeof object.sources[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Exfiltration.sources: object expected"); + message.sources[i] = $root.google.cloud.securitycenter.v1.ExfilResource.fromObject(object.sources[i]); + } } - if (object.externalUid != null) - message.externalUid = String(object.externalUid); - if (object.status != null) - message.status = String(object.status); - if (object.externalSystemUpdateTime != null) { - if (typeof object.externalSystemUpdateTime !== "object") - throw TypeError(".google.cloud.securitycenter.v1.ExternalSystem.externalSystemUpdateTime: object expected"); - message.externalSystemUpdateTime = $root.google.protobuf.Timestamp.fromObject(object.externalSystemUpdateTime); + if (object.targets) { + if (!Array.isArray(object.targets)) + throw TypeError(".google.cloud.securitycenter.v1.Exfiltration.targets: array expected"); + message.targets = []; + for (var i = 0; i < object.targets.length; ++i) { + if (typeof object.targets[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Exfiltration.targets: object expected"); + message.targets[i] = $root.google.cloud.securitycenter.v1.ExfilResource.fromObject(object.targets[i]); + } } return message; }; /** - * Creates a plain object from an ExternalSystem message. Also converts values to other types if specified. + * Creates a plain object from an Exfiltration message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.securitycenter.v1.ExternalSystem + * @memberof google.cloud.securitycenter.v1.Exfiltration * @static - * @param {google.cloud.securitycenter.v1.ExternalSystem} message ExternalSystem + * @param {google.cloud.securitycenter.v1.Exfiltration} message Exfiltration * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ExternalSystem.toObject = function toObject(message, options) { + Exfiltration.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.assignees = []; - if (options.defaults) { - object.name = ""; - object.externalUid = ""; - object.status = ""; - object.externalSystemUpdateTime = null; + if (options.arrays || options.defaults) { + object.sources = []; + object.targets = []; } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.assignees && message.assignees.length) { - object.assignees = []; - for (var j = 0; j < message.assignees.length; ++j) - object.assignees[j] = message.assignees[j]; + if (message.sources && message.sources.length) { + object.sources = []; + for (var j = 0; j < message.sources.length; ++j) + object.sources[j] = $root.google.cloud.securitycenter.v1.ExfilResource.toObject(message.sources[j], options); + } + if (message.targets && message.targets.length) { + object.targets = []; + for (var j = 0; j < message.targets.length; ++j) + object.targets[j] = $root.google.cloud.securitycenter.v1.ExfilResource.toObject(message.targets[j], options); } - if (message.externalUid != null && message.hasOwnProperty("externalUid")) - object.externalUid = message.externalUid; - if (message.status != null && message.hasOwnProperty("status")) - object.status = message.status; - if (message.externalSystemUpdateTime != null && message.hasOwnProperty("externalSystemUpdateTime")) - object.externalSystemUpdateTime = $root.google.protobuf.Timestamp.toObject(message.externalSystemUpdateTime, options); return object; }; /** - * Converts this ExternalSystem to JSON. + * Converts this Exfiltration to JSON. * @function toJSON - * @memberof google.cloud.securitycenter.v1.ExternalSystem + * @memberof google.cloud.securitycenter.v1.Exfiltration * @instance * @returns {Object.} JSON object */ - ExternalSystem.prototype.toJSON = function toJSON() { + Exfiltration.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ExternalSystem; + return Exfiltration; })(); - v1.Finding = (function() { + v1.ExfilResource = (function() { /** - * Properties of a Finding. + * Properties of an ExfilResource. * @memberof google.cloud.securitycenter.v1 - * @interface IFinding - * @property {string|null} [name] Finding name - * @property {string|null} [parent] Finding parent - * @property {string|null} [resourceName] Finding resourceName - * @property {google.cloud.securitycenter.v1.Finding.State|null} [state] Finding state - * @property {string|null} [category] Finding category - * @property {string|null} [externalUri] Finding externalUri - * @property {Object.|null} [sourceProperties] Finding sourceProperties - * @property {google.cloud.securitycenter.v1.ISecurityMarks|null} [securityMarks] Finding securityMarks - * @property {google.protobuf.ITimestamp|null} [eventTime] Finding eventTime - * @property {google.protobuf.ITimestamp|null} [createTime] Finding createTime - * @property {google.cloud.securitycenter.v1.Finding.Severity|null} [severity] Finding severity - * @property {string|null} [canonicalName] Finding canonicalName - * @property {google.cloud.securitycenter.v1.Finding.Mute|null} [mute] Finding mute - * @property {google.cloud.securitycenter.v1.Finding.FindingClass|null} [findingClass] Finding findingClass - * @property {google.cloud.securitycenter.v1.IIndicator|null} [indicator] Finding indicator - * @property {google.cloud.securitycenter.v1.IVulnerability|null} [vulnerability] Finding vulnerability - * @property {google.protobuf.ITimestamp|null} [muteUpdateTime] Finding muteUpdateTime - * @property {Object.|null} [externalSystems] Finding externalSystems - * @property {google.cloud.securitycenter.v1.IMitreAttack|null} [mitreAttack] Finding mitreAttack - * @property {google.cloud.securitycenter.v1.IAccess|null} [access] Finding access - * @property {Array.|null} [connections] Finding connections - * @property {string|null} [muteInitiator] Finding muteInitiator - * @property {string|null} [description] Finding description - * @property {Array.|null} [iamBindings] Finding iamBindings - * @property {string|null} [nextSteps] Finding nextSteps + * @interface IExfilResource + * @property {string|null} [name] ExfilResource name + * @property {Array.|null} [components] ExfilResource components */ /** - * Constructs a new Finding. + * Constructs a new ExfilResource. * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents a Finding. - * @implements IFinding + * @classdesc Represents an ExfilResource. + * @implements IExfilResource * @constructor - * @param {google.cloud.securitycenter.v1.IFinding=} [properties] Properties to set + * @param {google.cloud.securitycenter.v1.IExfilResource=} [properties] Properties to set */ - function Finding(properties) { - this.sourceProperties = {}; - this.externalSystems = {}; - this.connections = []; - this.iamBindings = []; + function ExfilResource(properties) { + this.components = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -3068,318 +3245,340 @@ } /** - * Finding name. + * ExfilResource name. * @member {string} name - * @memberof google.cloud.securitycenter.v1.Finding - * @instance - */ - Finding.prototype.name = ""; - - /** - * Finding parent. - * @member {string} parent - * @memberof google.cloud.securitycenter.v1.Finding + * @memberof google.cloud.securitycenter.v1.ExfilResource * @instance */ - Finding.prototype.parent = ""; + ExfilResource.prototype.name = ""; /** - * Finding resourceName. - * @member {string} resourceName - * @memberof google.cloud.securitycenter.v1.Finding + * ExfilResource components. + * @member {Array.} components + * @memberof google.cloud.securitycenter.v1.ExfilResource * @instance */ - Finding.prototype.resourceName = ""; + ExfilResource.prototype.components = $util.emptyArray; /** - * Finding state. - * @member {google.cloud.securitycenter.v1.Finding.State} state - * @memberof google.cloud.securitycenter.v1.Finding - * @instance + * Creates a new ExfilResource instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.ExfilResource + * @static + * @param {google.cloud.securitycenter.v1.IExfilResource=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.ExfilResource} ExfilResource instance */ - Finding.prototype.state = 0; + ExfilResource.create = function create(properties) { + return new ExfilResource(properties); + }; /** - * Finding category. - * @member {string} category - * @memberof google.cloud.securitycenter.v1.Finding - * @instance + * Encodes the specified ExfilResource message. Does not implicitly {@link google.cloud.securitycenter.v1.ExfilResource.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.ExfilResource + * @static + * @param {google.cloud.securitycenter.v1.IExfilResource} message ExfilResource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - Finding.prototype.category = ""; + ExfilResource.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.components != null && message.components.length) + for (var i = 0; i < message.components.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.components[i]); + return writer; + }; /** - * Finding externalUri. - * @member {string} externalUri - * @memberof google.cloud.securitycenter.v1.Finding - * @instance + * Encodes the specified ExfilResource message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ExfilResource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.ExfilResource + * @static + * @param {google.cloud.securitycenter.v1.IExfilResource} message ExfilResource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - Finding.prototype.externalUri = ""; + ExfilResource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; /** - * Finding sourceProperties. - * @member {Object.} sourceProperties - * @memberof google.cloud.securitycenter.v1.Finding - * @instance + * Decodes an ExfilResource message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.ExfilResource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.ExfilResource} ExfilResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Finding.prototype.sourceProperties = $util.emptyObject; + ExfilResource.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.cloud.securitycenter.v1.ExfilResource(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + if (!(message.components && message.components.length)) + message.components = []; + message.components.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; /** - * Finding securityMarks. - * @member {google.cloud.securitycenter.v1.ISecurityMarks|null|undefined} securityMarks - * @memberof google.cloud.securitycenter.v1.Finding - * @instance + * Decodes an ExfilResource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.ExfilResource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.ExfilResource} ExfilResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Finding.prototype.securityMarks = null; + ExfilResource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; /** - * Finding eventTime. - * @member {google.protobuf.ITimestamp|null|undefined} eventTime - * @memberof google.cloud.securitycenter.v1.Finding - * @instance + * Verifies an ExfilResource message. + * @function verify + * @memberof google.cloud.securitycenter.v1.ExfilResource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Finding.prototype.eventTime = null; + ExfilResource.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.components != null && message.hasOwnProperty("components")) { + if (!Array.isArray(message.components)) + return "components: array expected"; + for (var i = 0; i < message.components.length; ++i) + if (!$util.isString(message.components[i])) + return "components: string[] expected"; + } + return null; + }; /** - * Finding createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.securitycenter.v1.Finding - * @instance + * Creates an ExfilResource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.ExfilResource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.ExfilResource} ExfilResource */ - Finding.prototype.createTime = null; + ExfilResource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.ExfilResource) + return object; + var message = new $root.google.cloud.securitycenter.v1.ExfilResource(); + if (object.name != null) + message.name = String(object.name); + if (object.components) { + if (!Array.isArray(object.components)) + throw TypeError(".google.cloud.securitycenter.v1.ExfilResource.components: array expected"); + message.components = []; + for (var i = 0; i < object.components.length; ++i) + message.components[i] = String(object.components[i]); + } + return message; + }; /** - * Finding severity. - * @member {google.cloud.securitycenter.v1.Finding.Severity} severity - * @memberof google.cloud.securitycenter.v1.Finding - * @instance + * Creates a plain object from an ExfilResource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.ExfilResource + * @static + * @param {google.cloud.securitycenter.v1.ExfilResource} message ExfilResource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object */ - Finding.prototype.severity = 0; - - /** - * Finding canonicalName. - * @member {string} canonicalName - * @memberof google.cloud.securitycenter.v1.Finding - * @instance - */ - Finding.prototype.canonicalName = ""; - - /** - * Finding mute. - * @member {google.cloud.securitycenter.v1.Finding.Mute} mute - * @memberof google.cloud.securitycenter.v1.Finding - * @instance - */ - Finding.prototype.mute = 0; - - /** - * Finding findingClass. - * @member {google.cloud.securitycenter.v1.Finding.FindingClass} findingClass - * @memberof google.cloud.securitycenter.v1.Finding - * @instance - */ - Finding.prototype.findingClass = 0; - - /** - * Finding indicator. - * @member {google.cloud.securitycenter.v1.IIndicator|null|undefined} indicator - * @memberof google.cloud.securitycenter.v1.Finding - * @instance - */ - Finding.prototype.indicator = null; + ExfilResource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.components = []; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.components && message.components.length) { + object.components = []; + for (var j = 0; j < message.components.length; ++j) + object.components[j] = message.components[j]; + } + return object; + }; /** - * Finding vulnerability. - * @member {google.cloud.securitycenter.v1.IVulnerability|null|undefined} vulnerability - * @memberof google.cloud.securitycenter.v1.Finding + * Converts this ExfilResource to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.ExfilResource * @instance + * @returns {Object.} JSON object */ - Finding.prototype.vulnerability = null; + ExfilResource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Finding muteUpdateTime. - * @member {google.protobuf.ITimestamp|null|undefined} muteUpdateTime - * @memberof google.cloud.securitycenter.v1.Finding - * @instance - */ - Finding.prototype.muteUpdateTime = null; + return ExfilResource; + })(); - /** - * Finding externalSystems. - * @member {Object.} externalSystems - * @memberof google.cloud.securitycenter.v1.Finding - * @instance - */ - Finding.prototype.externalSystems = $util.emptyObject; + v1.ExternalSystem = (function() { /** - * Finding mitreAttack. - * @member {google.cloud.securitycenter.v1.IMitreAttack|null|undefined} mitreAttack - * @memberof google.cloud.securitycenter.v1.Finding - * @instance + * Properties of an ExternalSystem. + * @memberof google.cloud.securitycenter.v1 + * @interface IExternalSystem + * @property {string|null} [name] ExternalSystem name + * @property {Array.|null} [assignees] ExternalSystem assignees + * @property {string|null} [externalUid] ExternalSystem externalUid + * @property {string|null} [status] ExternalSystem status + * @property {google.protobuf.ITimestamp|null} [externalSystemUpdateTime] ExternalSystem externalSystemUpdateTime */ - Finding.prototype.mitreAttack = null; /** - * Finding access. - * @member {google.cloud.securitycenter.v1.IAccess|null|undefined} access - * @memberof google.cloud.securitycenter.v1.Finding - * @instance + * Constructs a new ExternalSystem. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents an ExternalSystem. + * @implements IExternalSystem + * @constructor + * @param {google.cloud.securitycenter.v1.IExternalSystem=} [properties] Properties to set */ - Finding.prototype.access = null; + function ExternalSystem(properties) { + this.assignees = []; + 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]]; + } /** - * Finding connections. - * @member {Array.} connections - * @memberof google.cloud.securitycenter.v1.Finding + * ExternalSystem name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1.ExternalSystem * @instance */ - Finding.prototype.connections = $util.emptyArray; + ExternalSystem.prototype.name = ""; /** - * Finding muteInitiator. - * @member {string} muteInitiator - * @memberof google.cloud.securitycenter.v1.Finding + * ExternalSystem assignees. + * @member {Array.} assignees + * @memberof google.cloud.securitycenter.v1.ExternalSystem * @instance */ - Finding.prototype.muteInitiator = ""; + ExternalSystem.prototype.assignees = $util.emptyArray; /** - * Finding description. - * @member {string} description - * @memberof google.cloud.securitycenter.v1.Finding + * ExternalSystem externalUid. + * @member {string} externalUid + * @memberof google.cloud.securitycenter.v1.ExternalSystem * @instance */ - Finding.prototype.description = ""; + ExternalSystem.prototype.externalUid = ""; /** - * Finding iamBindings. - * @member {Array.} iamBindings - * @memberof google.cloud.securitycenter.v1.Finding + * ExternalSystem status. + * @member {string} status + * @memberof google.cloud.securitycenter.v1.ExternalSystem * @instance */ - Finding.prototype.iamBindings = $util.emptyArray; + ExternalSystem.prototype.status = ""; /** - * Finding nextSteps. - * @member {string} nextSteps - * @memberof google.cloud.securitycenter.v1.Finding + * ExternalSystem externalSystemUpdateTime. + * @member {google.protobuf.ITimestamp|null|undefined} externalSystemUpdateTime + * @memberof google.cloud.securitycenter.v1.ExternalSystem * @instance */ - Finding.prototype.nextSteps = ""; + ExternalSystem.prototype.externalSystemUpdateTime = null; /** - * Creates a new Finding instance using the specified properties. + * Creates a new ExternalSystem instance using the specified properties. * @function create - * @memberof google.cloud.securitycenter.v1.Finding + * @memberof google.cloud.securitycenter.v1.ExternalSystem * @static - * @param {google.cloud.securitycenter.v1.IFinding=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.Finding} Finding instance + * @param {google.cloud.securitycenter.v1.IExternalSystem=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.ExternalSystem} ExternalSystem instance */ - Finding.create = function create(properties) { - return new Finding(properties); + ExternalSystem.create = function create(properties) { + return new ExternalSystem(properties); }; /** - * Encodes the specified Finding message. Does not implicitly {@link google.cloud.securitycenter.v1.Finding.verify|verify} messages. + * Encodes the specified ExternalSystem message. Does not implicitly {@link google.cloud.securitycenter.v1.ExternalSystem.verify|verify} messages. * @function encode - * @memberof google.cloud.securitycenter.v1.Finding + * @memberof google.cloud.securitycenter.v1.ExternalSystem * @static - * @param {google.cloud.securitycenter.v1.IFinding} message Finding message or plain object to encode + * @param {google.cloud.securitycenter.v1.IExternalSystem} message ExternalSystem message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Finding.encode = function encode(message, writer) { + ExternalSystem.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.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.parent); - if (message.resourceName != null && Object.hasOwnProperty.call(message, "resourceName")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.resourceName); - if (message.state != null && Object.hasOwnProperty.call(message, "state")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.state); - if (message.category != null && Object.hasOwnProperty.call(message, "category")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.category); - if (message.externalUri != null && Object.hasOwnProperty.call(message, "externalUri")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.externalUri); - if (message.sourceProperties != null && Object.hasOwnProperty.call(message, "sourceProperties")) - for (var keys = Object.keys(message.sourceProperties), i = 0; i < keys.length; ++i) { - writer.uint32(/* id 7, wireType 2 =*/58).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); - $root.google.protobuf.Value.encode(message.sourceProperties[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); - } - if (message.securityMarks != null && Object.hasOwnProperty.call(message, "securityMarks")) - $root.google.cloud.securitycenter.v1.SecurityMarks.encode(message.securityMarks, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.eventTime != null && Object.hasOwnProperty.call(message, "eventTime")) - $root.google.protobuf.Timestamp.encode(message.eventTime, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); - if (message.severity != null && Object.hasOwnProperty.call(message, "severity")) - writer.uint32(/* id 12, wireType 0 =*/96).int32(message.severity); - if (message.canonicalName != null && Object.hasOwnProperty.call(message, "canonicalName")) - writer.uint32(/* id 14, wireType 2 =*/114).string(message.canonicalName); - if (message.mute != null && Object.hasOwnProperty.call(message, "mute")) - writer.uint32(/* id 15, wireType 0 =*/120).int32(message.mute); - if (message.findingClass != null && Object.hasOwnProperty.call(message, "findingClass")) - writer.uint32(/* id 17, wireType 0 =*/136).int32(message.findingClass); - if (message.indicator != null && Object.hasOwnProperty.call(message, "indicator")) - $root.google.cloud.securitycenter.v1.Indicator.encode(message.indicator, writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); - if (message.vulnerability != null && Object.hasOwnProperty.call(message, "vulnerability")) - $root.google.cloud.securitycenter.v1.Vulnerability.encode(message.vulnerability, writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); - if (message.muteUpdateTime != null && Object.hasOwnProperty.call(message, "muteUpdateTime")) - $root.google.protobuf.Timestamp.encode(message.muteUpdateTime, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); - if (message.externalSystems != null && Object.hasOwnProperty.call(message, "externalSystems")) - for (var keys = Object.keys(message.externalSystems), i = 0; i < keys.length; ++i) { - writer.uint32(/* id 22, wireType 2 =*/178).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); - $root.google.cloud.securitycenter.v1.ExternalSystem.encode(message.externalSystems[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); - } - if (message.mitreAttack != null && Object.hasOwnProperty.call(message, "mitreAttack")) - $root.google.cloud.securitycenter.v1.MitreAttack.encode(message.mitreAttack, writer.uint32(/* id 25, wireType 2 =*/202).fork()).ldelim(); - if (message.access != null && Object.hasOwnProperty.call(message, "access")) - $root.google.cloud.securitycenter.v1.Access.encode(message.access, writer.uint32(/* id 26, wireType 2 =*/210).fork()).ldelim(); - if (message.muteInitiator != null && Object.hasOwnProperty.call(message, "muteInitiator")) - writer.uint32(/* id 28, wireType 2 =*/226).string(message.muteInitiator); - if (message.connections != null && message.connections.length) - for (var i = 0; i < message.connections.length; ++i) - $root.google.cloud.securitycenter.v1.Connection.encode(message.connections[i], writer.uint32(/* id 31, wireType 2 =*/250).fork()).ldelim(); - if (message.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 37, wireType 2 =*/298).string(message.description); - if (message.iamBindings != null && message.iamBindings.length) - for (var i = 0; i < message.iamBindings.length; ++i) - $root.google.cloud.securitycenter.v1.IamBinding.encode(message.iamBindings[i], writer.uint32(/* id 39, wireType 2 =*/314).fork()).ldelim(); - if (message.nextSteps != null && Object.hasOwnProperty.call(message, "nextSteps")) - writer.uint32(/* id 40, wireType 2 =*/322).string(message.nextSteps); + if (message.assignees != null && message.assignees.length) + for (var i = 0; i < message.assignees.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.assignees[i]); + if (message.externalUid != null && Object.hasOwnProperty.call(message, "externalUid")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.externalUid); + if (message.status != null && Object.hasOwnProperty.call(message, "status")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.status); + if (message.externalSystemUpdateTime != null && Object.hasOwnProperty.call(message, "externalSystemUpdateTime")) + $root.google.protobuf.Timestamp.encode(message.externalSystemUpdateTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); return writer; }; /** - * Encodes the specified Finding message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Finding.verify|verify} messages. + * Encodes the specified ExternalSystem message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ExternalSystem.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.Finding + * @memberof google.cloud.securitycenter.v1.ExternalSystem * @static - * @param {google.cloud.securitycenter.v1.IFinding} message Finding message or plain object to encode + * @param {google.cloud.securitycenter.v1.IExternalSystem} message ExternalSystem message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Finding.encodeDelimited = function encodeDelimited(message, writer) { + ExternalSystem.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a Finding message from the specified reader or buffer. + * Decodes an ExternalSystem message from the specified reader or buffer. * @function decode - * @memberof google.cloud.securitycenter.v1.Finding + * @memberof google.cloud.securitycenter.v1.ExternalSystem * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.Finding} Finding + * @returns {google.cloud.securitycenter.v1.ExternalSystem} ExternalSystem * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Finding.decode = function decode(reader, length) { + ExternalSystem.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.cloud.securitycenter.v1.Finding(), key, value; + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.ExternalSystem(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -3387,121 +3586,21 @@ message.name = reader.string(); break; case 2: - message.parent = reader.string(); + if (!(message.assignees && message.assignees.length)) + message.assignees = []; + message.assignees.push(reader.string()); break; case 3: - message.resourceName = reader.string(); + message.externalUid = reader.string(); break; case 4: - message.state = reader.int32(); + message.status = reader.string(); break; case 5: - message.category = reader.string(); + message.externalSystemUpdateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; - case 6: - message.externalUri = reader.string(); - break; - case 7: - if (message.sourceProperties === $util.emptyObject) - message.sourceProperties = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = null; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = $root.google.protobuf.Value.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.sourceProperties[key] = value; - break; - case 8: - message.securityMarks = $root.google.cloud.securitycenter.v1.SecurityMarks.decode(reader, reader.uint32()); - break; - case 9: - message.eventTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 10: - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 12: - message.severity = reader.int32(); - break; - case 14: - message.canonicalName = reader.string(); - break; - case 15: - message.mute = reader.int32(); - break; - case 17: - message.findingClass = reader.int32(); - break; - case 18: - message.indicator = $root.google.cloud.securitycenter.v1.Indicator.decode(reader, reader.uint32()); - break; - case 20: - message.vulnerability = $root.google.cloud.securitycenter.v1.Vulnerability.decode(reader, reader.uint32()); - break; - case 21: - message.muteUpdateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 22: - if (message.externalSystems === $util.emptyObject) - message.externalSystems = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = null; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = $root.google.cloud.securitycenter.v1.ExternalSystem.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.externalSystems[key] = value; - break; - case 25: - message.mitreAttack = $root.google.cloud.securitycenter.v1.MitreAttack.decode(reader, reader.uint32()); - break; - case 26: - message.access = $root.google.cloud.securitycenter.v1.Access.decode(reader, reader.uint32()); - break; - case 31: - if (!(message.connections && message.connections.length)) - message.connections = []; - message.connections.push($root.google.cloud.securitycenter.v1.Connection.decode(reader, reader.uint32())); - break; - case 28: - message.muteInitiator = reader.string(); - break; - case 37: - message.description = reader.string(); - break; - case 39: - if (!(message.iamBindings && message.iamBindings.length)) - message.iamBindings = []; - message.iamBindings.push($root.google.cloud.securitycenter.v1.IamBinding.decode(reader, reader.uint32())); - break; - case 40: - message.nextSteps = reader.string(); - break; - default: - reader.skipType(tag & 7); + default: + reader.skipType(tag & 7); break; } } @@ -3509,595 +3608,163 @@ }; /** - * Decodes a Finding message from the specified reader or buffer, length delimited. + * Decodes an ExternalSystem message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.Finding + * @memberof google.cloud.securitycenter.v1.ExternalSystem * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.Finding} Finding + * @returns {google.cloud.securitycenter.v1.ExternalSystem} ExternalSystem * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Finding.decodeDelimited = function decodeDelimited(reader) { + ExternalSystem.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a Finding message. + * Verifies an ExternalSystem message. * @function verify - * @memberof google.cloud.securitycenter.v1.Finding + * @memberof google.cloud.securitycenter.v1.ExternalSystem * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Finding.verify = function verify(message) { + ExternalSystem.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.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.resourceName != null && message.hasOwnProperty("resourceName")) - if (!$util.isString(message.resourceName)) - return "resourceName: string expected"; - if (message.state != null && message.hasOwnProperty("state")) - switch (message.state) { - default: - return "state: 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"; - if (message.externalUri != null && message.hasOwnProperty("externalUri")) - if (!$util.isString(message.externalUri)) - return "externalUri: string expected"; - if (message.sourceProperties != null && message.hasOwnProperty("sourceProperties")) { - if (!$util.isObject(message.sourceProperties)) - return "sourceProperties: object expected"; - var key = Object.keys(message.sourceProperties); - for (var i = 0; i < key.length; ++i) { - var error = $root.google.protobuf.Value.verify(message.sourceProperties[key[i]]); - if (error) - return "sourceProperties." + error; - } - } - if (message.securityMarks != null && message.hasOwnProperty("securityMarks")) { - var error = $root.google.cloud.securitycenter.v1.SecurityMarks.verify(message.securityMarks); - if (error) - return "securityMarks." + error; - } - if (message.eventTime != null && message.hasOwnProperty("eventTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.eventTime); - if (error) - return "eventTime." + error; - } - if (message.createTime != null && message.hasOwnProperty("createTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.createTime); - if (error) - return "createTime." + error; + if (message.assignees != null && message.hasOwnProperty("assignees")) { + if (!Array.isArray(message.assignees)) + return "assignees: array expected"; + for (var i = 0; i < message.assignees.length; ++i) + if (!$util.isString(message.assignees[i])) + return "assignees: string[] expected"; } - if (message.severity != null && message.hasOwnProperty("severity")) - switch (message.severity) { - default: - return "severity: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - break; - } - if (message.canonicalName != null && message.hasOwnProperty("canonicalName")) - if (!$util.isString(message.canonicalName)) - return "canonicalName: string expected"; - if (message.mute != null && message.hasOwnProperty("mute")) - switch (message.mute) { - default: - return "mute: enum value expected"; - case 0: - case 1: - case 2: - case 4: - break; - } - if (message.findingClass != null && message.hasOwnProperty("findingClass")) - switch (message.findingClass) { - default: - return "findingClass: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - break; - } - if (message.indicator != null && message.hasOwnProperty("indicator")) { - var error = $root.google.cloud.securitycenter.v1.Indicator.verify(message.indicator); + if (message.externalUid != null && message.hasOwnProperty("externalUid")) + if (!$util.isString(message.externalUid)) + return "externalUid: string expected"; + if (message.status != null && message.hasOwnProperty("status")) + if (!$util.isString(message.status)) + return "status: string expected"; + if (message.externalSystemUpdateTime != null && message.hasOwnProperty("externalSystemUpdateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.externalSystemUpdateTime); if (error) - return "indicator." + error; + return "externalSystemUpdateTime." + error; } - if (message.vulnerability != null && message.hasOwnProperty("vulnerability")) { - var error = $root.google.cloud.securitycenter.v1.Vulnerability.verify(message.vulnerability); - if (error) - return "vulnerability." + error; + return null; + }; + + /** + * Creates an ExternalSystem message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.ExternalSystem + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.ExternalSystem} ExternalSystem + */ + ExternalSystem.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.ExternalSystem) + return object; + var message = new $root.google.cloud.securitycenter.v1.ExternalSystem(); + if (object.name != null) + message.name = String(object.name); + if (object.assignees) { + if (!Array.isArray(object.assignees)) + throw TypeError(".google.cloud.securitycenter.v1.ExternalSystem.assignees: array expected"); + message.assignees = []; + for (var i = 0; i < object.assignees.length; ++i) + message.assignees[i] = String(object.assignees[i]); } - if (message.muteUpdateTime != null && message.hasOwnProperty("muteUpdateTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.muteUpdateTime); - if (error) - return "muteUpdateTime." + error; + if (object.externalUid != null) + message.externalUid = String(object.externalUid); + if (object.status != null) + message.status = String(object.status); + if (object.externalSystemUpdateTime != null) { + if (typeof object.externalSystemUpdateTime !== "object") + throw TypeError(".google.cloud.securitycenter.v1.ExternalSystem.externalSystemUpdateTime: object expected"); + message.externalSystemUpdateTime = $root.google.protobuf.Timestamp.fromObject(object.externalSystemUpdateTime); } - if (message.externalSystems != null && message.hasOwnProperty("externalSystems")) { - if (!$util.isObject(message.externalSystems)) - return "externalSystems: object expected"; - var key = Object.keys(message.externalSystems); - for (var i = 0; i < key.length; ++i) { - var error = $root.google.cloud.securitycenter.v1.ExternalSystem.verify(message.externalSystems[key[i]]); - if (error) - return "externalSystems." + error; - } - } - if (message.mitreAttack != null && message.hasOwnProperty("mitreAttack")) { - var error = $root.google.cloud.securitycenter.v1.MitreAttack.verify(message.mitreAttack); - if (error) - return "mitreAttack." + error; - } - if (message.access != null && message.hasOwnProperty("access")) { - var error = $root.google.cloud.securitycenter.v1.Access.verify(message.access); - if (error) - return "access." + error; - } - if (message.connections != null && message.hasOwnProperty("connections")) { - if (!Array.isArray(message.connections)) - return "connections: array expected"; - for (var i = 0; i < message.connections.length; ++i) { - var error = $root.google.cloud.securitycenter.v1.Connection.verify(message.connections[i]); - if (error) - return "connections." + error; - } - } - if (message.muteInitiator != null && message.hasOwnProperty("muteInitiator")) - if (!$util.isString(message.muteInitiator)) - return "muteInitiator: string expected"; - if (message.description != null && message.hasOwnProperty("description")) - if (!$util.isString(message.description)) - return "description: string expected"; - if (message.iamBindings != null && message.hasOwnProperty("iamBindings")) { - if (!Array.isArray(message.iamBindings)) - return "iamBindings: array expected"; - for (var i = 0; i < message.iamBindings.length; ++i) { - var error = $root.google.cloud.securitycenter.v1.IamBinding.verify(message.iamBindings[i]); - if (error) - return "iamBindings." + error; - } - } - if (message.nextSteps != null && message.hasOwnProperty("nextSteps")) - if (!$util.isString(message.nextSteps)) - return "nextSteps: string expected"; - return null; - }; - - /** - * Creates a Finding message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v1.Finding - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.Finding} Finding - */ - Finding.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.Finding) - return object; - var message = new $root.google.cloud.securitycenter.v1.Finding(); - if (object.name != null) - message.name = String(object.name); - if (object.parent != null) - message.parent = String(object.parent); - if (object.resourceName != null) - message.resourceName = String(object.resourceName); - switch (object.state) { - case "STATE_UNSPECIFIED": - case 0: - message.state = 0; - break; - case "ACTIVE": - case 1: - message.state = 1; - break; - case "INACTIVE": - case 2: - message.state = 2; - break; - } - if (object.category != null) - message.category = String(object.category); - if (object.externalUri != null) - message.externalUri = String(object.externalUri); - if (object.sourceProperties) { - if (typeof object.sourceProperties !== "object") - throw TypeError(".google.cloud.securitycenter.v1.Finding.sourceProperties: object expected"); - message.sourceProperties = {}; - for (var keys = Object.keys(object.sourceProperties), i = 0; i < keys.length; ++i) { - if (typeof object.sourceProperties[keys[i]] !== "object") - throw TypeError(".google.cloud.securitycenter.v1.Finding.sourceProperties: object expected"); - message.sourceProperties[keys[i]] = $root.google.protobuf.Value.fromObject(object.sourceProperties[keys[i]]); - } - } - if (object.securityMarks != null) { - if (typeof object.securityMarks !== "object") - throw TypeError(".google.cloud.securitycenter.v1.Finding.securityMarks: object expected"); - message.securityMarks = $root.google.cloud.securitycenter.v1.SecurityMarks.fromObject(object.securityMarks); - } - if (object.eventTime != null) { - if (typeof object.eventTime !== "object") - throw TypeError(".google.cloud.securitycenter.v1.Finding.eventTime: object expected"); - message.eventTime = $root.google.protobuf.Timestamp.fromObject(object.eventTime); - } - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.securitycenter.v1.Finding.createTime: object expected"); - message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); - } - switch (object.severity) { - case "SEVERITY_UNSPECIFIED": - case 0: - message.severity = 0; - break; - case "CRITICAL": - case 1: - message.severity = 1; - break; - case "HIGH": - case 2: - message.severity = 2; - break; - case "MEDIUM": - case 3: - message.severity = 3; - break; - case "LOW": - case 4: - message.severity = 4; - break; - } - if (object.canonicalName != null) - message.canonicalName = String(object.canonicalName); - switch (object.mute) { - case "MUTE_UNSPECIFIED": - case 0: - message.mute = 0; - break; - case "MUTED": - case 1: - message.mute = 1; - break; - case "UNMUTED": - case 2: - message.mute = 2; - break; - case "UNDEFINED": - case 4: - message.mute = 4; - break; - } - switch (object.findingClass) { - case "FINDING_CLASS_UNSPECIFIED": - case 0: - message.findingClass = 0; - break; - case "THREAT": - case 1: - message.findingClass = 1; - break; - case "VULNERABILITY": - case 2: - message.findingClass = 2; - break; - case "MISCONFIGURATION": - case 3: - message.findingClass = 3; - break; - case "OBSERVATION": - case 4: - message.findingClass = 4; - break; - case "SCC_ERROR": - case 5: - message.findingClass = 5; - break; - } - if (object.indicator != null) { - if (typeof object.indicator !== "object") - throw TypeError(".google.cloud.securitycenter.v1.Finding.indicator: object expected"); - message.indicator = $root.google.cloud.securitycenter.v1.Indicator.fromObject(object.indicator); - } - if (object.vulnerability != null) { - if (typeof object.vulnerability !== "object") - throw TypeError(".google.cloud.securitycenter.v1.Finding.vulnerability: object expected"); - message.vulnerability = $root.google.cloud.securitycenter.v1.Vulnerability.fromObject(object.vulnerability); - } - if (object.muteUpdateTime != null) { - if (typeof object.muteUpdateTime !== "object") - throw TypeError(".google.cloud.securitycenter.v1.Finding.muteUpdateTime: object expected"); - message.muteUpdateTime = $root.google.protobuf.Timestamp.fromObject(object.muteUpdateTime); - } - if (object.externalSystems) { - if (typeof object.externalSystems !== "object") - throw TypeError(".google.cloud.securitycenter.v1.Finding.externalSystems: object expected"); - message.externalSystems = {}; - for (var keys = Object.keys(object.externalSystems), i = 0; i < keys.length; ++i) { - if (typeof object.externalSystems[keys[i]] !== "object") - throw TypeError(".google.cloud.securitycenter.v1.Finding.externalSystems: object expected"); - message.externalSystems[keys[i]] = $root.google.cloud.securitycenter.v1.ExternalSystem.fromObject(object.externalSystems[keys[i]]); - } - } - if (object.mitreAttack != null) { - if (typeof object.mitreAttack !== "object") - throw TypeError(".google.cloud.securitycenter.v1.Finding.mitreAttack: object expected"); - message.mitreAttack = $root.google.cloud.securitycenter.v1.MitreAttack.fromObject(object.mitreAttack); - } - if (object.access != null) { - if (typeof object.access !== "object") - throw TypeError(".google.cloud.securitycenter.v1.Finding.access: object expected"); - message.access = $root.google.cloud.securitycenter.v1.Access.fromObject(object.access); - } - if (object.connections) { - if (!Array.isArray(object.connections)) - throw TypeError(".google.cloud.securitycenter.v1.Finding.connections: array expected"); - message.connections = []; - for (var i = 0; i < object.connections.length; ++i) { - if (typeof object.connections[i] !== "object") - throw TypeError(".google.cloud.securitycenter.v1.Finding.connections: object expected"); - message.connections[i] = $root.google.cloud.securitycenter.v1.Connection.fromObject(object.connections[i]); - } - } - if (object.muteInitiator != null) - message.muteInitiator = String(object.muteInitiator); - if (object.description != null) - message.description = String(object.description); - if (object.iamBindings) { - if (!Array.isArray(object.iamBindings)) - throw TypeError(".google.cloud.securitycenter.v1.Finding.iamBindings: array expected"); - message.iamBindings = []; - for (var i = 0; i < object.iamBindings.length; ++i) { - if (typeof object.iamBindings[i] !== "object") - throw TypeError(".google.cloud.securitycenter.v1.Finding.iamBindings: object expected"); - message.iamBindings[i] = $root.google.cloud.securitycenter.v1.IamBinding.fromObject(object.iamBindings[i]); - } - } - if (object.nextSteps != null) - message.nextSteps = String(object.nextSteps); return message; }; /** - * Creates a plain object from a Finding message. Also converts values to other types if specified. + * Creates a plain object from an ExternalSystem message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.securitycenter.v1.Finding + * @memberof google.cloud.securitycenter.v1.ExternalSystem * @static - * @param {google.cloud.securitycenter.v1.Finding} message Finding + * @param {google.cloud.securitycenter.v1.ExternalSystem} message ExternalSystem * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Finding.toObject = function toObject(message, options) { + ExternalSystem.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) { - object.connections = []; - object.iamBindings = []; - } - if (options.objects || options.defaults) { - object.sourceProperties = {}; - object.externalSystems = {}; - } + if (options.arrays || options.defaults) + object.assignees = []; if (options.defaults) { object.name = ""; - object.parent = ""; - object.resourceName = ""; - object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; - object.category = ""; - object.externalUri = ""; - object.securityMarks = null; - object.eventTime = null; - object.createTime = null; - object.severity = options.enums === String ? "SEVERITY_UNSPECIFIED" : 0; - object.canonicalName = ""; - object.mute = options.enums === String ? "MUTE_UNSPECIFIED" : 0; - object.findingClass = options.enums === String ? "FINDING_CLASS_UNSPECIFIED" : 0; - object.indicator = null; - object.vulnerability = null; - object.muteUpdateTime = null; - object.mitreAttack = null; - object.access = null; - object.muteInitiator = ""; - object.description = ""; - object.nextSteps = ""; + object.externalUid = ""; + object.status = ""; + object.externalSystemUpdateTime = null; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.resourceName != null && message.hasOwnProperty("resourceName")) - object.resourceName = message.resourceName; - if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.securitycenter.v1.Finding.State[message.state] : message.state; - if (message.category != null && message.hasOwnProperty("category")) - object.category = message.category; - if (message.externalUri != null && message.hasOwnProperty("externalUri")) - object.externalUri = message.externalUri; - var keys2; - if (message.sourceProperties && (keys2 = Object.keys(message.sourceProperties)).length) { - object.sourceProperties = {}; - for (var j = 0; j < keys2.length; ++j) - object.sourceProperties[keys2[j]] = $root.google.protobuf.Value.toObject(message.sourceProperties[keys2[j]], options); - } - if (message.securityMarks != null && message.hasOwnProperty("securityMarks")) - object.securityMarks = $root.google.cloud.securitycenter.v1.SecurityMarks.toObject(message.securityMarks, options); - if (message.eventTime != null && message.hasOwnProperty("eventTime")) - object.eventTime = $root.google.protobuf.Timestamp.toObject(message.eventTime, options); - if (message.createTime != null && message.hasOwnProperty("createTime")) - object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); - if (message.severity != null && message.hasOwnProperty("severity")) - object.severity = options.enums === String ? $root.google.cloud.securitycenter.v1.Finding.Severity[message.severity] : message.severity; - if (message.canonicalName != null && message.hasOwnProperty("canonicalName")) - object.canonicalName = message.canonicalName; - if (message.mute != null && message.hasOwnProperty("mute")) - object.mute = options.enums === String ? $root.google.cloud.securitycenter.v1.Finding.Mute[message.mute] : message.mute; - if (message.findingClass != null && message.hasOwnProperty("findingClass")) - object.findingClass = options.enums === String ? $root.google.cloud.securitycenter.v1.Finding.FindingClass[message.findingClass] : message.findingClass; - if (message.indicator != null && message.hasOwnProperty("indicator")) - object.indicator = $root.google.cloud.securitycenter.v1.Indicator.toObject(message.indicator, options); - if (message.vulnerability != null && message.hasOwnProperty("vulnerability")) - object.vulnerability = $root.google.cloud.securitycenter.v1.Vulnerability.toObject(message.vulnerability, options); - if (message.muteUpdateTime != null && message.hasOwnProperty("muteUpdateTime")) - object.muteUpdateTime = $root.google.protobuf.Timestamp.toObject(message.muteUpdateTime, options); - if (message.externalSystems && (keys2 = Object.keys(message.externalSystems)).length) { - object.externalSystems = {}; - for (var j = 0; j < keys2.length; ++j) - object.externalSystems[keys2[j]] = $root.google.cloud.securitycenter.v1.ExternalSystem.toObject(message.externalSystems[keys2[j]], options); - } - if (message.mitreAttack != null && message.hasOwnProperty("mitreAttack")) - object.mitreAttack = $root.google.cloud.securitycenter.v1.MitreAttack.toObject(message.mitreAttack, options); - if (message.access != null && message.hasOwnProperty("access")) - object.access = $root.google.cloud.securitycenter.v1.Access.toObject(message.access, options); - if (message.muteInitiator != null && message.hasOwnProperty("muteInitiator")) - object.muteInitiator = message.muteInitiator; - if (message.connections && message.connections.length) { - object.connections = []; - for (var j = 0; j < message.connections.length; ++j) - object.connections[j] = $root.google.cloud.securitycenter.v1.Connection.toObject(message.connections[j], options); - } - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; - if (message.iamBindings && message.iamBindings.length) { - object.iamBindings = []; - for (var j = 0; j < message.iamBindings.length; ++j) - object.iamBindings[j] = $root.google.cloud.securitycenter.v1.IamBinding.toObject(message.iamBindings[j], options); + if (message.assignees && message.assignees.length) { + object.assignees = []; + for (var j = 0; j < message.assignees.length; ++j) + object.assignees[j] = message.assignees[j]; } - if (message.nextSteps != null && message.hasOwnProperty("nextSteps")) - object.nextSteps = message.nextSteps; + if (message.externalUid != null && message.hasOwnProperty("externalUid")) + object.externalUid = message.externalUid; + if (message.status != null && message.hasOwnProperty("status")) + object.status = message.status; + if (message.externalSystemUpdateTime != null && message.hasOwnProperty("externalSystemUpdateTime")) + object.externalSystemUpdateTime = $root.google.protobuf.Timestamp.toObject(message.externalSystemUpdateTime, options); return object; }; /** - * Converts this Finding to JSON. + * Converts this ExternalSystem to JSON. * @function toJSON - * @memberof google.cloud.securitycenter.v1.Finding + * @memberof google.cloud.securitycenter.v1.ExternalSystem * @instance * @returns {Object.} JSON object */ - Finding.prototype.toJSON = function toJSON() { + ExternalSystem.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - /** - * State enum. - * @name google.cloud.securitycenter.v1.Finding.State - * @enum {number} - * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value - * @property {number} ACTIVE=1 ACTIVE value - * @property {number} INACTIVE=2 INACTIVE value - */ - Finding.State = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; - values[valuesById[1] = "ACTIVE"] = 1; - values[valuesById[2] = "INACTIVE"] = 2; - return values; - })(); - - /** - * Severity enum. - * @name google.cloud.securitycenter.v1.Finding.Severity - * @enum {number} - * @property {number} SEVERITY_UNSPECIFIED=0 SEVERITY_UNSPECIFIED value - * @property {number} CRITICAL=1 CRITICAL value - * @property {number} HIGH=2 HIGH value - * @property {number} MEDIUM=3 MEDIUM value - * @property {number} LOW=4 LOW value - */ - Finding.Severity = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "SEVERITY_UNSPECIFIED"] = 0; - values[valuesById[1] = "CRITICAL"] = 1; - values[valuesById[2] = "HIGH"] = 2; - values[valuesById[3] = "MEDIUM"] = 3; - values[valuesById[4] = "LOW"] = 4; - return values; - })(); - - /** - * Mute enum. - * @name google.cloud.securitycenter.v1.Finding.Mute - * @enum {number} - * @property {number} MUTE_UNSPECIFIED=0 MUTE_UNSPECIFIED value - * @property {number} MUTED=1 MUTED value - * @property {number} UNMUTED=2 UNMUTED value - * @property {number} UNDEFINED=4 UNDEFINED value - */ - Finding.Mute = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "MUTE_UNSPECIFIED"] = 0; - values[valuesById[1] = "MUTED"] = 1; - values[valuesById[2] = "UNMUTED"] = 2; - values[valuesById[4] = "UNDEFINED"] = 4; - return values; - })(); - - /** - * FindingClass enum. - * @name google.cloud.securitycenter.v1.Finding.FindingClass - * @enum {number} - * @property {number} FINDING_CLASS_UNSPECIFIED=0 FINDING_CLASS_UNSPECIFIED value - * @property {number} THREAT=1 THREAT value - * @property {number} VULNERABILITY=2 VULNERABILITY value - * @property {number} MISCONFIGURATION=3 MISCONFIGURATION value - * @property {number} OBSERVATION=4 OBSERVATION value - * @property {number} SCC_ERROR=5 SCC_ERROR value - */ - Finding.FindingClass = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "FINDING_CLASS_UNSPECIFIED"] = 0; - values[valuesById[1] = "THREAT"] = 1; - values[valuesById[2] = "VULNERABILITY"] = 2; - values[valuesById[3] = "MISCONFIGURATION"] = 3; - values[valuesById[4] = "OBSERVATION"] = 4; - values[valuesById[5] = "SCC_ERROR"] = 5; - return values; - })(); - - return Finding; + return ExternalSystem; })(); - v1.IamBinding = (function() { + v1.File = (function() { /** - * Properties of an IamBinding. + * Properties of a File. * @memberof google.cloud.securitycenter.v1 - * @interface IIamBinding - * @property {google.cloud.securitycenter.v1.IamBinding.Action|null} [action] IamBinding action - * @property {string|null} [role] IamBinding role - * @property {string|null} [member] IamBinding member + * @interface IFile + * @property {string|null} [path] File path + * @property {number|Long|null} [size] File size + * @property {string|null} [sha256] File sha256 + * @property {number|Long|null} [hashedSize] File hashedSize + * @property {boolean|null} [partiallyHashed] File partiallyHashed + * @property {string|null} [contents] File contents */ /** - * Constructs a new IamBinding. + * Constructs a new File. * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents an IamBinding. - * @implements IIamBinding + * @classdesc Represents a File. + * @implements IFile * @constructor - * @param {google.cloud.securitycenter.v1.IIamBinding=} [properties] Properties to set + * @param {google.cloud.securitycenter.v1.IFile=} [properties] Properties to set */ - function IamBinding(properties) { + function File(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -4105,101 +3772,140 @@ } /** - * IamBinding action. - * @member {google.cloud.securitycenter.v1.IamBinding.Action} action - * @memberof google.cloud.securitycenter.v1.IamBinding + * File path. + * @member {string} path + * @memberof google.cloud.securitycenter.v1.File * @instance */ - IamBinding.prototype.action = 0; + File.prototype.path = ""; /** - * IamBinding role. - * @member {string} role - * @memberof google.cloud.securitycenter.v1.IamBinding + * File size. + * @member {number|Long} size + * @memberof google.cloud.securitycenter.v1.File * @instance */ - IamBinding.prototype.role = ""; + File.prototype.size = $util.Long ? $util.Long.fromBits(0,0,false) : 0; /** - * IamBinding member. - * @member {string} member - * @memberof google.cloud.securitycenter.v1.IamBinding + * File sha256. + * @member {string} sha256 + * @memberof google.cloud.securitycenter.v1.File * @instance */ - IamBinding.prototype.member = ""; + File.prototype.sha256 = ""; /** - * Creates a new IamBinding instance using the specified properties. + * File hashedSize. + * @member {number|Long} hashedSize + * @memberof google.cloud.securitycenter.v1.File + * @instance + */ + File.prototype.hashedSize = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * File partiallyHashed. + * @member {boolean} partiallyHashed + * @memberof google.cloud.securitycenter.v1.File + * @instance + */ + File.prototype.partiallyHashed = false; + + /** + * File contents. + * @member {string} contents + * @memberof google.cloud.securitycenter.v1.File + * @instance + */ + File.prototype.contents = ""; + + /** + * Creates a new File instance using the specified properties. * @function create - * @memberof google.cloud.securitycenter.v1.IamBinding + * @memberof google.cloud.securitycenter.v1.File * @static - * @param {google.cloud.securitycenter.v1.IIamBinding=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.IamBinding} IamBinding instance + * @param {google.cloud.securitycenter.v1.IFile=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.File} File instance */ - IamBinding.create = function create(properties) { - return new IamBinding(properties); + File.create = function create(properties) { + return new File(properties); }; /** - * Encodes the specified IamBinding message. Does not implicitly {@link google.cloud.securitycenter.v1.IamBinding.verify|verify} messages. + * Encodes the specified File message. Does not implicitly {@link google.cloud.securitycenter.v1.File.verify|verify} messages. * @function encode - * @memberof google.cloud.securitycenter.v1.IamBinding + * @memberof google.cloud.securitycenter.v1.File * @static - * @param {google.cloud.securitycenter.v1.IIamBinding} message IamBinding message or plain object to encode + * @param {google.cloud.securitycenter.v1.IFile} message File message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - IamBinding.encode = function encode(message, writer) { + File.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.action != null && Object.hasOwnProperty.call(message, "action")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.action); - if (message.role != null && Object.hasOwnProperty.call(message, "role")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.role); - if (message.member != null && Object.hasOwnProperty.call(message, "member")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.member); + if (message.path != null && Object.hasOwnProperty.call(message, "path")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.path); + if (message.size != null && Object.hasOwnProperty.call(message, "size")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.size); + if (message.sha256 != null && Object.hasOwnProperty.call(message, "sha256")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.sha256); + if (message.hashedSize != null && Object.hasOwnProperty.call(message, "hashedSize")) + writer.uint32(/* id 4, wireType 0 =*/32).int64(message.hashedSize); + if (message.partiallyHashed != null && Object.hasOwnProperty.call(message, "partiallyHashed")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.partiallyHashed); + if (message.contents != null && Object.hasOwnProperty.call(message, "contents")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.contents); return writer; }; /** - * Encodes the specified IamBinding message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.IamBinding.verify|verify} messages. + * Encodes the specified File message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.File.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.IamBinding + * @memberof google.cloud.securitycenter.v1.File * @static - * @param {google.cloud.securitycenter.v1.IIamBinding} message IamBinding message or plain object to encode + * @param {google.cloud.securitycenter.v1.IFile} message File message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - IamBinding.encodeDelimited = function encodeDelimited(message, writer) { + File.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an IamBinding message from the specified reader or buffer. + * Decodes a File message from the specified reader or buffer. * @function decode - * @memberof google.cloud.securitycenter.v1.IamBinding + * @memberof google.cloud.securitycenter.v1.File * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.IamBinding} IamBinding + * @returns {google.cloud.securitycenter.v1.File} File * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - IamBinding.decode = function decode(reader, length) { + File.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.cloud.securitycenter.v1.IamBinding(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.File(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.action = reader.int32(); + message.path = reader.string(); break; case 2: - message.role = reader.string(); + message.size = reader.int64(); break; case 3: - message.member = reader.string(); + message.sha256 = reader.string(); + break; + case 4: + message.hashedSize = reader.int64(); + break; + case 5: + message.partiallyHashed = reader.bool(); + break; + case 6: + message.contents = reader.string(); break; default: reader.skipType(tag & 7); @@ -4210,161 +3916,209 @@ }; /** - * Decodes an IamBinding message from the specified reader or buffer, length delimited. + * Decodes a File message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.IamBinding + * @memberof google.cloud.securitycenter.v1.File * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.IamBinding} IamBinding + * @returns {google.cloud.securitycenter.v1.File} File * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - IamBinding.decodeDelimited = function decodeDelimited(reader) { + File.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an IamBinding message. + * Verifies a File message. * @function verify - * @memberof google.cloud.securitycenter.v1.IamBinding + * @memberof google.cloud.securitycenter.v1.File * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - IamBinding.verify = function verify(message) { + File.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.action != null && message.hasOwnProperty("action")) - switch (message.action) { - default: - return "action: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.role != null && message.hasOwnProperty("role")) - if (!$util.isString(message.role)) - return "role: string expected"; - if (message.member != null && message.hasOwnProperty("member")) - if (!$util.isString(message.member)) - return "member: string expected"; + if (message.path != null && message.hasOwnProperty("path")) + if (!$util.isString(message.path)) + return "path: string expected"; + if (message.size != null && message.hasOwnProperty("size")) + if (!$util.isInteger(message.size) && !(message.size && $util.isInteger(message.size.low) && $util.isInteger(message.size.high))) + return "size: integer|Long expected"; + if (message.sha256 != null && message.hasOwnProperty("sha256")) + if (!$util.isString(message.sha256)) + return "sha256: string expected"; + if (message.hashedSize != null && message.hasOwnProperty("hashedSize")) + if (!$util.isInteger(message.hashedSize) && !(message.hashedSize && $util.isInteger(message.hashedSize.low) && $util.isInteger(message.hashedSize.high))) + return "hashedSize: integer|Long expected"; + if (message.partiallyHashed != null && message.hasOwnProperty("partiallyHashed")) + if (typeof message.partiallyHashed !== "boolean") + return "partiallyHashed: boolean expected"; + if (message.contents != null && message.hasOwnProperty("contents")) + if (!$util.isString(message.contents)) + return "contents: string expected"; return null; }; /** - * Creates an IamBinding message from a plain object. Also converts values to their respective internal types. + * Creates a File message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.securitycenter.v1.IamBinding + * @memberof google.cloud.securitycenter.v1.File * @static * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.IamBinding} IamBinding + * @returns {google.cloud.securitycenter.v1.File} File */ - IamBinding.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.IamBinding) + File.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.File) return object; - var message = new $root.google.cloud.securitycenter.v1.IamBinding(); - switch (object.action) { - case "ACTION_UNSPECIFIED": - case 0: - message.action = 0; - break; - case "ADD": - case 1: - message.action = 1; - break; - case "REMOVE": - case 2: - message.action = 2; - break; - } - if (object.role != null) - message.role = String(object.role); - if (object.member != null) - message.member = String(object.member); + var message = new $root.google.cloud.securitycenter.v1.File(); + if (object.path != null) + message.path = String(object.path); + if (object.size != null) + if ($util.Long) + (message.size = $util.Long.fromValue(object.size)).unsigned = false; + else if (typeof object.size === "string") + message.size = parseInt(object.size, 10); + else if (typeof object.size === "number") + message.size = object.size; + else if (typeof object.size === "object") + message.size = new $util.LongBits(object.size.low >>> 0, object.size.high >>> 0).toNumber(); + if (object.sha256 != null) + message.sha256 = String(object.sha256); + if (object.hashedSize != null) + if ($util.Long) + (message.hashedSize = $util.Long.fromValue(object.hashedSize)).unsigned = false; + else if (typeof object.hashedSize === "string") + message.hashedSize = parseInt(object.hashedSize, 10); + else if (typeof object.hashedSize === "number") + message.hashedSize = object.hashedSize; + else if (typeof object.hashedSize === "object") + message.hashedSize = new $util.LongBits(object.hashedSize.low >>> 0, object.hashedSize.high >>> 0).toNumber(); + if (object.partiallyHashed != null) + message.partiallyHashed = Boolean(object.partiallyHashed); + if (object.contents != null) + message.contents = String(object.contents); return message; }; /** - * Creates a plain object from an IamBinding message. Also converts values to other types if specified. + * Creates a plain object from a File message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.securitycenter.v1.IamBinding + * @memberof google.cloud.securitycenter.v1.File * @static - * @param {google.cloud.securitycenter.v1.IamBinding} message IamBinding + * @param {google.cloud.securitycenter.v1.File} message File * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - IamBinding.toObject = function toObject(message, options) { + File.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.action = options.enums === String ? "ACTION_UNSPECIFIED" : 0; - object.role = ""; - object.member = ""; - } - if (message.action != null && message.hasOwnProperty("action")) - object.action = options.enums === String ? $root.google.cloud.securitycenter.v1.IamBinding.Action[message.action] : message.action; - if (message.role != null && message.hasOwnProperty("role")) - object.role = message.role; - if (message.member != null && message.hasOwnProperty("member")) - object.member = message.member; + object.path = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.size = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.size = options.longs === String ? "0" : 0; + object.sha256 = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.hashedSize = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.hashedSize = options.longs === String ? "0" : 0; + object.partiallyHashed = false; + object.contents = ""; + } + if (message.path != null && message.hasOwnProperty("path")) + object.path = message.path; + if (message.size != null && message.hasOwnProperty("size")) + if (typeof message.size === "number") + object.size = options.longs === String ? String(message.size) : message.size; + else + object.size = options.longs === String ? $util.Long.prototype.toString.call(message.size) : options.longs === Number ? new $util.LongBits(message.size.low >>> 0, message.size.high >>> 0).toNumber() : message.size; + if (message.sha256 != null && message.hasOwnProperty("sha256")) + object.sha256 = message.sha256; + if (message.hashedSize != null && message.hasOwnProperty("hashedSize")) + if (typeof message.hashedSize === "number") + object.hashedSize = options.longs === String ? String(message.hashedSize) : message.hashedSize; + else + object.hashedSize = options.longs === String ? $util.Long.prototype.toString.call(message.hashedSize) : options.longs === Number ? new $util.LongBits(message.hashedSize.low >>> 0, message.hashedSize.high >>> 0).toNumber() : message.hashedSize; + if (message.partiallyHashed != null && message.hasOwnProperty("partiallyHashed")) + object.partiallyHashed = message.partiallyHashed; + if (message.contents != null && message.hasOwnProperty("contents")) + object.contents = message.contents; return object; }; /** - * Converts this IamBinding to JSON. + * Converts this File to JSON. * @function toJSON - * @memberof google.cloud.securitycenter.v1.IamBinding + * @memberof google.cloud.securitycenter.v1.File * @instance * @returns {Object.} JSON object */ - IamBinding.prototype.toJSON = function toJSON() { + File.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - /** - * Action enum. - * @name google.cloud.securitycenter.v1.IamBinding.Action - * @enum {number} - * @property {number} ACTION_UNSPECIFIED=0 ACTION_UNSPECIFIED value - * @property {number} ADD=1 ADD value - * @property {number} REMOVE=2 REMOVE value - */ - IamBinding.Action = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "ACTION_UNSPECIFIED"] = 0; - values[valuesById[1] = "ADD"] = 1; - values[valuesById[2] = "REMOVE"] = 2; - return values; - })(); - - return IamBinding; + return File; })(); - v1.Indicator = (function() { + v1.Finding = (function() { /** - * Properties of an Indicator. + * Properties of a Finding. * @memberof google.cloud.securitycenter.v1 - * @interface IIndicator - * @property {Array.|null} [ipAddresses] Indicator ipAddresses - * @property {Array.|null} [domains] Indicator domains + * @interface IFinding + * @property {string|null} [name] Finding name + * @property {string|null} [parent] Finding parent + * @property {string|null} [resourceName] Finding resourceName + * @property {google.cloud.securitycenter.v1.Finding.State|null} [state] Finding state + * @property {string|null} [category] Finding category + * @property {string|null} [externalUri] Finding externalUri + * @property {Object.|null} [sourceProperties] Finding sourceProperties + * @property {google.cloud.securitycenter.v1.ISecurityMarks|null} [securityMarks] Finding securityMarks + * @property {google.protobuf.ITimestamp|null} [eventTime] Finding eventTime + * @property {google.protobuf.ITimestamp|null} [createTime] Finding createTime + * @property {google.cloud.securitycenter.v1.Finding.Severity|null} [severity] Finding severity + * @property {string|null} [canonicalName] Finding canonicalName + * @property {google.cloud.securitycenter.v1.Finding.Mute|null} [mute] Finding mute + * @property {google.cloud.securitycenter.v1.Finding.FindingClass|null} [findingClass] Finding findingClass + * @property {google.cloud.securitycenter.v1.IIndicator|null} [indicator] Finding indicator + * @property {google.cloud.securitycenter.v1.IVulnerability|null} [vulnerability] Finding vulnerability + * @property {google.protobuf.ITimestamp|null} [muteUpdateTime] Finding muteUpdateTime + * @property {Object.|null} [externalSystems] Finding externalSystems + * @property {google.cloud.securitycenter.v1.IMitreAttack|null} [mitreAttack] Finding mitreAttack + * @property {google.cloud.securitycenter.v1.IAccess|null} [access] Finding access + * @property {Array.|null} [connections] Finding connections + * @property {string|null} [muteInitiator] Finding muteInitiator + * @property {Array.|null} [processes] Finding processes + * @property {Array.|null} [compliances] Finding compliances + * @property {string|null} [description] Finding description + * @property {google.cloud.securitycenter.v1.IExfiltration|null} [exfiltration] Finding exfiltration + * @property {Array.|null} [iamBindings] Finding iamBindings + * @property {string|null} [nextSteps] Finding nextSteps */ /** - * Constructs a new Indicator. + * Constructs a new Finding. * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents an Indicator. - * @implements IIndicator + * @classdesc Represents a Finding. + * @implements IFinding * @constructor - * @param {google.cloud.securitycenter.v1.IIndicator=} [properties] Properties to set + * @param {google.cloud.securitycenter.v1.IFinding=} [properties] Properties to set */ - function Indicator(properties) { - this.ipAddresses = []; - this.domains = []; + function Finding(properties) { + this.sourceProperties = {}; + this.externalSystems = {}; + this.connections = []; + this.processes = []; + this.compliances = []; + this.iamBindings = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -4372,652 +4126,2066 @@ } /** - * Indicator ipAddresses. - * @member {Array.} ipAddresses - * @memberof google.cloud.securitycenter.v1.Indicator + * Finding name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1.Finding * @instance */ - Indicator.prototype.ipAddresses = $util.emptyArray; + Finding.prototype.name = ""; /** - * Indicator domains. - * @member {Array.} domains - * @memberof google.cloud.securitycenter.v1.Indicator + * Finding parent. + * @member {string} parent + * @memberof google.cloud.securitycenter.v1.Finding * @instance */ - Indicator.prototype.domains = $util.emptyArray; + Finding.prototype.parent = ""; /** - * Creates a new Indicator instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v1.Indicator - * @static - * @param {google.cloud.securitycenter.v1.IIndicator=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.Indicator} Indicator instance + * Finding resourceName. + * @member {string} resourceName + * @memberof google.cloud.securitycenter.v1.Finding + * @instance */ - Indicator.create = function create(properties) { - return new Indicator(properties); - }; + Finding.prototype.resourceName = ""; /** - * Encodes the specified Indicator message. Does not implicitly {@link google.cloud.securitycenter.v1.Indicator.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1.Indicator - * @static - * @param {google.cloud.securitycenter.v1.IIndicator} message Indicator message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * Finding state. + * @member {google.cloud.securitycenter.v1.Finding.State} state + * @memberof google.cloud.securitycenter.v1.Finding + * @instance */ - Indicator.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.ipAddresses != null && message.ipAddresses.length) - for (var i = 0; i < message.ipAddresses.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.ipAddresses[i]); - if (message.domains != null && message.domains.length) - for (var i = 0; i < message.domains.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.domains[i]); - return writer; - }; + Finding.prototype.state = 0; /** - * Encodes the specified Indicator message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Indicator.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.Indicator - * @static - * @param {google.cloud.securitycenter.v1.IIndicator} message Indicator message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * Finding category. + * @member {string} category + * @memberof google.cloud.securitycenter.v1.Finding + * @instance */ - Indicator.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + Finding.prototype.category = ""; /** - * Decodes an Indicator message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v1.Indicator - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.Indicator} Indicator - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Finding externalUri. + * @member {string} externalUri + * @memberof google.cloud.securitycenter.v1.Finding + * @instance */ - Indicator.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.cloud.securitycenter.v1.Indicator(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.ipAddresses && message.ipAddresses.length)) - message.ipAddresses = []; - message.ipAddresses.push(reader.string()); - break; - case 2: - if (!(message.domains && message.domains.length)) - message.domains = []; - message.domains.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + Finding.prototype.externalUri = ""; /** - * Decodes an Indicator message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.Indicator - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.Indicator} Indicator - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Finding sourceProperties. + * @member {Object.} sourceProperties + * @memberof google.cloud.securitycenter.v1.Finding + * @instance */ - Indicator.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + Finding.prototype.sourceProperties = $util.emptyObject; /** - * Verifies an Indicator message. - * @function verify - * @memberof google.cloud.securitycenter.v1.Indicator - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not + * Finding securityMarks. + * @member {google.cloud.securitycenter.v1.ISecurityMarks|null|undefined} securityMarks + * @memberof google.cloud.securitycenter.v1.Finding + * @instance */ - Indicator.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.ipAddresses != null && message.hasOwnProperty("ipAddresses")) { - if (!Array.isArray(message.ipAddresses)) - return "ipAddresses: array expected"; - for (var i = 0; i < message.ipAddresses.length; ++i) - if (!$util.isString(message.ipAddresses[i])) - return "ipAddresses: string[] expected"; - } - if (message.domains != null && message.hasOwnProperty("domains")) { - if (!Array.isArray(message.domains)) - return "domains: array expected"; - for (var i = 0; i < message.domains.length; ++i) - if (!$util.isString(message.domains[i])) - return "domains: string[] expected"; - } - return null; - }; + Finding.prototype.securityMarks = null; /** - * Creates an Indicator message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v1.Indicator - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.Indicator} Indicator + * Finding eventTime. + * @member {google.protobuf.ITimestamp|null|undefined} eventTime + * @memberof google.cloud.securitycenter.v1.Finding + * @instance */ - Indicator.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.Indicator) - return object; - var message = new $root.google.cloud.securitycenter.v1.Indicator(); - if (object.ipAddresses) { - if (!Array.isArray(object.ipAddresses)) - throw TypeError(".google.cloud.securitycenter.v1.Indicator.ipAddresses: array expected"); - message.ipAddresses = []; - for (var i = 0; i < object.ipAddresses.length; ++i) - message.ipAddresses[i] = String(object.ipAddresses[i]); - } - if (object.domains) { - if (!Array.isArray(object.domains)) - throw TypeError(".google.cloud.securitycenter.v1.Indicator.domains: array expected"); - message.domains = []; - for (var i = 0; i < object.domains.length; ++i) - message.domains[i] = String(object.domains[i]); - } - return message; - }; + Finding.prototype.eventTime = null; /** - * Creates a plain object from an Indicator message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v1.Indicator - * @static - * @param {google.cloud.securitycenter.v1.Indicator} message Indicator - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object + * Finding createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.securitycenter.v1.Finding + * @instance */ - Indicator.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.ipAddresses = []; - object.domains = []; - } - if (message.ipAddresses && message.ipAddresses.length) { - object.ipAddresses = []; - for (var j = 0; j < message.ipAddresses.length; ++j) - object.ipAddresses[j] = message.ipAddresses[j]; - } - if (message.domains && message.domains.length) { - object.domains = []; - for (var j = 0; j < message.domains.length; ++j) - object.domains[j] = message.domains[j]; - } - return object; - }; + Finding.prototype.createTime = null; /** - * Converts this Indicator to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1.Indicator + * Finding severity. + * @member {google.cloud.securitycenter.v1.Finding.Severity} severity + * @memberof google.cloud.securitycenter.v1.Finding * @instance - * @returns {Object.} JSON object */ - Indicator.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + Finding.prototype.severity = 0; - return Indicator; - })(); + /** + * Finding canonicalName. + * @member {string} canonicalName + * @memberof google.cloud.securitycenter.v1.Finding + * @instance + */ + Finding.prototype.canonicalName = ""; - v1.MitreAttack = (function() { + /** + * Finding mute. + * @member {google.cloud.securitycenter.v1.Finding.Mute} mute + * @memberof google.cloud.securitycenter.v1.Finding + * @instance + */ + Finding.prototype.mute = 0; /** - * Properties of a MitreAttack. - * @memberof google.cloud.securitycenter.v1 - * @interface IMitreAttack - * @property {google.cloud.securitycenter.v1.MitreAttack.Tactic|null} [primaryTactic] MitreAttack primaryTactic - * @property {Array.|null} [primaryTechniques] MitreAttack primaryTechniques - * @property {Array.|null} [additionalTactics] MitreAttack additionalTactics - * @property {Array.|null} [additionalTechniques] MitreAttack additionalTechniques - * @property {string|null} [version] MitreAttack version + * Finding findingClass. + * @member {google.cloud.securitycenter.v1.Finding.FindingClass} findingClass + * @memberof google.cloud.securitycenter.v1.Finding + * @instance */ + Finding.prototype.findingClass = 0; /** - * Constructs a new MitreAttack. - * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents a MitreAttack. - * @implements IMitreAttack - * @constructor - * @param {google.cloud.securitycenter.v1.IMitreAttack=} [properties] Properties to set + * Finding indicator. + * @member {google.cloud.securitycenter.v1.IIndicator|null|undefined} indicator + * @memberof google.cloud.securitycenter.v1.Finding + * @instance */ - function MitreAttack(properties) { - this.primaryTechniques = []; - this.additionalTactics = []; - this.additionalTechniques = []; - 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]]; - } + Finding.prototype.indicator = null; /** - * MitreAttack primaryTactic. - * @member {google.cloud.securitycenter.v1.MitreAttack.Tactic} primaryTactic - * @memberof google.cloud.securitycenter.v1.MitreAttack + * Finding vulnerability. + * @member {google.cloud.securitycenter.v1.IVulnerability|null|undefined} vulnerability + * @memberof google.cloud.securitycenter.v1.Finding * @instance */ - MitreAttack.prototype.primaryTactic = 0; + Finding.prototype.vulnerability = null; /** - * MitreAttack primaryTechniques. - * @member {Array.} primaryTechniques - * @memberof google.cloud.securitycenter.v1.MitreAttack + * Finding muteUpdateTime. + * @member {google.protobuf.ITimestamp|null|undefined} muteUpdateTime + * @memberof google.cloud.securitycenter.v1.Finding * @instance */ - MitreAttack.prototype.primaryTechniques = $util.emptyArray; + Finding.prototype.muteUpdateTime = null; /** - * MitreAttack additionalTactics. - * @member {Array.} additionalTactics - * @memberof google.cloud.securitycenter.v1.MitreAttack + * Finding externalSystems. + * @member {Object.} externalSystems + * @memberof google.cloud.securitycenter.v1.Finding * @instance */ - MitreAttack.prototype.additionalTactics = $util.emptyArray; + Finding.prototype.externalSystems = $util.emptyObject; /** - * MitreAttack additionalTechniques. - * @member {Array.} additionalTechniques - * @memberof google.cloud.securitycenter.v1.MitreAttack + * Finding mitreAttack. + * @member {google.cloud.securitycenter.v1.IMitreAttack|null|undefined} mitreAttack + * @memberof google.cloud.securitycenter.v1.Finding * @instance */ - MitreAttack.prototype.additionalTechniques = $util.emptyArray; + Finding.prototype.mitreAttack = null; /** - * MitreAttack version. - * @member {string} version - * @memberof google.cloud.securitycenter.v1.MitreAttack + * Finding access. + * @member {google.cloud.securitycenter.v1.IAccess|null|undefined} access + * @memberof google.cloud.securitycenter.v1.Finding * @instance */ - MitreAttack.prototype.version = ""; + Finding.prototype.access = null; /** - * Creates a new MitreAttack instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v1.MitreAttack - * @static - * @param {google.cloud.securitycenter.v1.IMitreAttack=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.MitreAttack} MitreAttack instance + * Finding connections. + * @member {Array.} connections + * @memberof google.cloud.securitycenter.v1.Finding + * @instance */ - MitreAttack.create = function create(properties) { - return new MitreAttack(properties); - }; + Finding.prototype.connections = $util.emptyArray; /** - * Encodes the specified MitreAttack message. Does not implicitly {@link google.cloud.securitycenter.v1.MitreAttack.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1.MitreAttack - * @static - * @param {google.cloud.securitycenter.v1.IMitreAttack} message MitreAttack message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * Finding muteInitiator. + * @member {string} muteInitiator + * @memberof google.cloud.securitycenter.v1.Finding + * @instance */ - MitreAttack.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.primaryTactic != null && Object.hasOwnProperty.call(message, "primaryTactic")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.primaryTactic); - if (message.primaryTechniques != null && message.primaryTechniques.length) { - writer.uint32(/* id 2, wireType 2 =*/18).fork(); - for (var i = 0; i < message.primaryTechniques.length; ++i) - writer.int32(message.primaryTechniques[i]); - writer.ldelim(); - } - if (message.additionalTactics != null && message.additionalTactics.length) { - writer.uint32(/* id 3, wireType 2 =*/26).fork(); - for (var i = 0; i < message.additionalTactics.length; ++i) - writer.int32(message.additionalTactics[i]); - writer.ldelim(); - } - if (message.additionalTechniques != null && message.additionalTechniques.length) { - writer.uint32(/* id 4, wireType 2 =*/34).fork(); - for (var i = 0; i < message.additionalTechniques.length; ++i) - writer.int32(message.additionalTechniques[i]); - writer.ldelim(); - } - if (message.version != null && Object.hasOwnProperty.call(message, "version")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.version); - return writer; - }; + Finding.prototype.muteInitiator = ""; /** - * Encodes the specified MitreAttack message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.MitreAttack.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.MitreAttack - * @static - * @param {google.cloud.securitycenter.v1.IMitreAttack} message MitreAttack message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * Finding processes. + * @member {Array.} processes + * @memberof google.cloud.securitycenter.v1.Finding + * @instance */ - MitreAttack.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + Finding.prototype.processes = $util.emptyArray; /** - * Decodes a MitreAttack message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v1.MitreAttack + * Finding compliances. + * @member {Array.} compliances + * @memberof google.cloud.securitycenter.v1.Finding + * @instance + */ + Finding.prototype.compliances = $util.emptyArray; + + /** + * Finding description. + * @member {string} description + * @memberof google.cloud.securitycenter.v1.Finding + * @instance + */ + Finding.prototype.description = ""; + + /** + * Finding exfiltration. + * @member {google.cloud.securitycenter.v1.IExfiltration|null|undefined} exfiltration + * @memberof google.cloud.securitycenter.v1.Finding + * @instance + */ + Finding.prototype.exfiltration = null; + + /** + * Finding iamBindings. + * @member {Array.} iamBindings + * @memberof google.cloud.securitycenter.v1.Finding + * @instance + */ + Finding.prototype.iamBindings = $util.emptyArray; + + /** + * Finding nextSteps. + * @member {string} nextSteps + * @memberof google.cloud.securitycenter.v1.Finding + * @instance + */ + Finding.prototype.nextSteps = ""; + + /** + * Creates a new Finding instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.Finding + * @static + * @param {google.cloud.securitycenter.v1.IFinding=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.Finding} Finding instance + */ + Finding.create = function create(properties) { + return new Finding(properties); + }; + + /** + * Encodes the specified Finding message. Does not implicitly {@link google.cloud.securitycenter.v1.Finding.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.Finding + * @static + * @param {google.cloud.securitycenter.v1.IFinding} message Finding message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Finding.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.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.parent); + if (message.resourceName != null && Object.hasOwnProperty.call(message, "resourceName")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.resourceName); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.state); + if (message.category != null && Object.hasOwnProperty.call(message, "category")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.category); + if (message.externalUri != null && Object.hasOwnProperty.call(message, "externalUri")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.externalUri); + if (message.sourceProperties != null && Object.hasOwnProperty.call(message, "sourceProperties")) + for (var keys = Object.keys(message.sourceProperties), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 7, wireType 2 =*/58).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.protobuf.Value.encode(message.sourceProperties[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.securityMarks != null && Object.hasOwnProperty.call(message, "securityMarks")) + $root.google.cloud.securitycenter.v1.SecurityMarks.encode(message.securityMarks, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.eventTime != null && Object.hasOwnProperty.call(message, "eventTime")) + $root.google.protobuf.Timestamp.encode(message.eventTime, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.severity != null && Object.hasOwnProperty.call(message, "severity")) + writer.uint32(/* id 12, wireType 0 =*/96).int32(message.severity); + if (message.canonicalName != null && Object.hasOwnProperty.call(message, "canonicalName")) + writer.uint32(/* id 14, wireType 2 =*/114).string(message.canonicalName); + if (message.mute != null && Object.hasOwnProperty.call(message, "mute")) + writer.uint32(/* id 15, wireType 0 =*/120).int32(message.mute); + if (message.findingClass != null && Object.hasOwnProperty.call(message, "findingClass")) + writer.uint32(/* id 17, wireType 0 =*/136).int32(message.findingClass); + if (message.indicator != null && Object.hasOwnProperty.call(message, "indicator")) + $root.google.cloud.securitycenter.v1.Indicator.encode(message.indicator, writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); + if (message.vulnerability != null && Object.hasOwnProperty.call(message, "vulnerability")) + $root.google.cloud.securitycenter.v1.Vulnerability.encode(message.vulnerability, writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); + if (message.muteUpdateTime != null && Object.hasOwnProperty.call(message, "muteUpdateTime")) + $root.google.protobuf.Timestamp.encode(message.muteUpdateTime, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); + if (message.externalSystems != null && Object.hasOwnProperty.call(message, "externalSystems")) + for (var keys = Object.keys(message.externalSystems), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 22, wireType 2 =*/178).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.cloud.securitycenter.v1.ExternalSystem.encode(message.externalSystems[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.mitreAttack != null && Object.hasOwnProperty.call(message, "mitreAttack")) + $root.google.cloud.securitycenter.v1.MitreAttack.encode(message.mitreAttack, writer.uint32(/* id 25, wireType 2 =*/202).fork()).ldelim(); + if (message.access != null && Object.hasOwnProperty.call(message, "access")) + $root.google.cloud.securitycenter.v1.Access.encode(message.access, writer.uint32(/* id 26, wireType 2 =*/210).fork()).ldelim(); + if (message.muteInitiator != null && Object.hasOwnProperty.call(message, "muteInitiator")) + writer.uint32(/* id 28, wireType 2 =*/226).string(message.muteInitiator); + if (message.processes != null && message.processes.length) + for (var i = 0; i < message.processes.length; ++i) + $root.google.cloud.securitycenter.v1.Process.encode(message.processes[i], writer.uint32(/* id 30, wireType 2 =*/242).fork()).ldelim(); + if (message.connections != null && message.connections.length) + for (var i = 0; i < message.connections.length; ++i) + $root.google.cloud.securitycenter.v1.Connection.encode(message.connections[i], writer.uint32(/* id 31, wireType 2 =*/250).fork()).ldelim(); + if (message.compliances != null && message.compliances.length) + for (var i = 0; i < message.compliances.length; ++i) + $root.google.cloud.securitycenter.v1.Compliance.encode(message.compliances[i], writer.uint32(/* id 34, wireType 2 =*/274).fork()).ldelim(); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 37, wireType 2 =*/298).string(message.description); + if (message.exfiltration != null && Object.hasOwnProperty.call(message, "exfiltration")) + $root.google.cloud.securitycenter.v1.Exfiltration.encode(message.exfiltration, writer.uint32(/* id 38, wireType 2 =*/306).fork()).ldelim(); + if (message.iamBindings != null && message.iamBindings.length) + for (var i = 0; i < message.iamBindings.length; ++i) + $root.google.cloud.securitycenter.v1.IamBinding.encode(message.iamBindings[i], writer.uint32(/* id 39, wireType 2 =*/314).fork()).ldelim(); + if (message.nextSteps != null && Object.hasOwnProperty.call(message, "nextSteps")) + writer.uint32(/* id 40, wireType 2 =*/322).string(message.nextSteps); + return writer; + }; + + /** + * Encodes the specified Finding message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Finding.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.Finding + * @static + * @param {google.cloud.securitycenter.v1.IFinding} message Finding message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Finding.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Finding message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.Finding * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.MitreAttack} MitreAttack + * @returns {google.cloud.securitycenter.v1.Finding} Finding * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - MitreAttack.decode = function decode(reader, length) { + Finding.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.cloud.securitycenter.v1.MitreAttack(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.Finding(), key, value; while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.primaryTactic = reader.int32(); + message.name = reader.string(); break; case 2: - if (!(message.primaryTechniques && message.primaryTechniques.length)) - message.primaryTechniques = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.primaryTechniques.push(reader.int32()); - } else - message.primaryTechniques.push(reader.int32()); + message.parent = reader.string(); break; case 3: - if (!(message.additionalTactics && message.additionalTactics.length)) - message.additionalTactics = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.additionalTactics.push(reader.int32()); - } else - message.additionalTactics.push(reader.int32()); + message.resourceName = reader.string(); break; case 4: - if (!(message.additionalTechniques && message.additionalTechniques.length)) - message.additionalTechniques = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.additionalTechniques.push(reader.int32()); - } else - message.additionalTechniques.push(reader.int32()); + message.state = reader.int32(); break; case 5: - message.version = reader.string(); - break; - default: - reader.skipType(tag & 7); + message.category = reader.string(); break; - } - } - return message; - }; - - /** - * Decodes a MitreAttack message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.MitreAttack - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.MitreAttack} MitreAttack - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MitreAttack.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MitreAttack message. - * @function verify - * @memberof google.cloud.securitycenter.v1.MitreAttack - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MitreAttack.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.primaryTactic != null && message.hasOwnProperty("primaryTactic")) - switch (message.primaryTactic) { - default: - return "primaryTactic: enum value expected"; - case 0: - case 1: - case 2: - case 5: - case 3: case 6: - case 8: + message.externalUri = reader.string(); + break; case 7: + if (message.sourceProperties === $util.emptyObject) + message.sourceProperties = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.protobuf.Value.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.sourceProperties[key] = value; + break; + case 8: + message.securityMarks = $root.google.cloud.securitycenter.v1.SecurityMarks.decode(reader, reader.uint32()); + break; case 9: + message.eventTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; case 10: - case 11: + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; case 12: - case 4: - case 13: + message.severity = reader.int32(); + break; case 14: + message.canonicalName = reader.string(); break; - } - if (message.primaryTechniques != null && message.hasOwnProperty("primaryTechniques")) { - if (!Array.isArray(message.primaryTechniques)) - return "primaryTechniques: array expected"; - for (var i = 0; i < message.primaryTechniques.length; ++i) - switch (message.primaryTechniques[i]) { - default: - return "primaryTechniques: enum value[] expected"; - case 0: - 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: - case 19: - case 20: - case 21: - case 22: - case 23: - case 24: - case 25: - case 26: - case 27: - case 28: - case 29: - case 30: - break; - } - } - if (message.additionalTactics != null && message.hasOwnProperty("additionalTactics")) { - if (!Array.isArray(message.additionalTactics)) - return "additionalTactics: array expected"; - for (var i = 0; i < message.additionalTactics.length; ++i) - switch (message.additionalTactics[i]) { - default: - return "additionalTactics: enum value[] expected"; - case 0: - case 1: - case 2: - case 5: - case 3: - case 6: - case 8: - case 7: - case 9: - case 10: - case 11: - case 12: - case 4: - case 13: - case 14: - break; - } - } - if (message.additionalTechniques != null && message.hasOwnProperty("additionalTechniques")) { - if (!Array.isArray(message.additionalTechniques)) - return "additionalTechniques: array expected"; - for (var i = 0; i < message.additionalTechniques.length; ++i) - switch (message.additionalTechniques[i]) { - default: - return "additionalTechniques: enum value[] expected"; - case 0: - 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: - case 19: - case 20: - case 21: - case 22: - case 23: - case 24: - case 25: - case 26: - case 27: - case 28: - case 29: - case 30: - break; + case 15: + message.mute = reader.int32(); + break; + case 17: + message.findingClass = reader.int32(); + break; + case 18: + message.indicator = $root.google.cloud.securitycenter.v1.Indicator.decode(reader, reader.uint32()); + break; + case 20: + message.vulnerability = $root.google.cloud.securitycenter.v1.Vulnerability.decode(reader, reader.uint32()); + break; + case 21: + message.muteUpdateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 22: + if (message.externalSystems === $util.emptyObject) + message.externalSystems = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.cloud.securitycenter.v1.ExternalSystem.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } } + message.externalSystems[key] = value; + break; + case 25: + message.mitreAttack = $root.google.cloud.securitycenter.v1.MitreAttack.decode(reader, reader.uint32()); + break; + case 26: + message.access = $root.google.cloud.securitycenter.v1.Access.decode(reader, reader.uint32()); + break; + case 31: + if (!(message.connections && message.connections.length)) + message.connections = []; + message.connections.push($root.google.cloud.securitycenter.v1.Connection.decode(reader, reader.uint32())); + break; + case 28: + message.muteInitiator = reader.string(); + break; + case 30: + if (!(message.processes && message.processes.length)) + message.processes = []; + message.processes.push($root.google.cloud.securitycenter.v1.Process.decode(reader, reader.uint32())); + break; + case 34: + if (!(message.compliances && message.compliances.length)) + message.compliances = []; + message.compliances.push($root.google.cloud.securitycenter.v1.Compliance.decode(reader, reader.uint32())); + break; + case 37: + message.description = reader.string(); + break; + case 38: + message.exfiltration = $root.google.cloud.securitycenter.v1.Exfiltration.decode(reader, reader.uint32()); + break; + case 39: + if (!(message.iamBindings && message.iamBindings.length)) + message.iamBindings = []; + message.iamBindings.push($root.google.cloud.securitycenter.v1.IamBinding.decode(reader, reader.uint32())); + break; + case 40: + message.nextSteps = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } } - if (message.version != null && message.hasOwnProperty("version")) - if (!$util.isString(message.version)) - return "version: string expected"; - return null; + return message; }; /** - * Creates a MitreAttack message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v1.MitreAttack + * Decodes a Finding message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.Finding * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.MitreAttack} MitreAttack + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.Finding} Finding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - MitreAttack.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.MitreAttack) - return object; - var message = new $root.google.cloud.securitycenter.v1.MitreAttack(); - switch (object.primaryTactic) { - case "TACTIC_UNSPECIFIED": - case 0: - message.primaryTactic = 0; - break; - case "RECONNAISSANCE": - case 1: - message.primaryTactic = 1; - break; - case "RESOURCE_DEVELOPMENT": - case 2: - message.primaryTactic = 2; - break; - case "INITIAL_ACCESS": - case 5: - message.primaryTactic = 5; - break; - case "EXECUTION": - case 3: - message.primaryTactic = 3; - break; - case "PERSISTENCE": - case 6: - message.primaryTactic = 6; - break; - case "PRIVILEGE_ESCALATION": - case 8: - message.primaryTactic = 8; - break; - case "DEFENSE_EVASION": - case 7: - message.primaryTactic = 7; - break; - case "CREDENTIAL_ACCESS": - case 9: - message.primaryTactic = 9; - break; - case "DISCOVERY": - case 10: - message.primaryTactic = 10; - break; - case "LATERAL_MOVEMENT": - case 11: - message.primaryTactic = 11; - break; - case "COLLECTION": - case 12: - message.primaryTactic = 12; - break; - case "COMMAND_AND_CONTROL": - case 4: - message.primaryTactic = 4; - break; - case "EXFILTRATION": - case 13: - message.primaryTactic = 13; - break; - case "IMPACT": - case 14: - message.primaryTactic = 14; - break; - } - if (object.primaryTechniques) { - if (!Array.isArray(object.primaryTechniques)) + Finding.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Finding message. + * @function verify + * @memberof google.cloud.securitycenter.v1.Finding + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Finding.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.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.resourceName != null && message.hasOwnProperty("resourceName")) + if (!$util.isString(message.resourceName)) + return "resourceName: string expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: 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"; + if (message.externalUri != null && message.hasOwnProperty("externalUri")) + if (!$util.isString(message.externalUri)) + return "externalUri: string expected"; + if (message.sourceProperties != null && message.hasOwnProperty("sourceProperties")) { + if (!$util.isObject(message.sourceProperties)) + return "sourceProperties: object expected"; + var key = Object.keys(message.sourceProperties); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.protobuf.Value.verify(message.sourceProperties[key[i]]); + if (error) + return "sourceProperties." + error; + } + } + if (message.securityMarks != null && message.hasOwnProperty("securityMarks")) { + var error = $root.google.cloud.securitycenter.v1.SecurityMarks.verify(message.securityMarks); + if (error) + return "securityMarks." + error; + } + if (message.eventTime != null && message.hasOwnProperty("eventTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.eventTime); + if (error) + return "eventTime." + error; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.severity != null && message.hasOwnProperty("severity")) + switch (message.severity) { + default: + return "severity: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.canonicalName != null && message.hasOwnProperty("canonicalName")) + if (!$util.isString(message.canonicalName)) + return "canonicalName: string expected"; + if (message.mute != null && message.hasOwnProperty("mute")) + switch (message.mute) { + default: + return "mute: enum value expected"; + case 0: + case 1: + case 2: + case 4: + break; + } + if (message.findingClass != null && message.hasOwnProperty("findingClass")) + switch (message.findingClass) { + default: + return "findingClass: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.indicator != null && message.hasOwnProperty("indicator")) { + var error = $root.google.cloud.securitycenter.v1.Indicator.verify(message.indicator); + if (error) + return "indicator." + error; + } + if (message.vulnerability != null && message.hasOwnProperty("vulnerability")) { + var error = $root.google.cloud.securitycenter.v1.Vulnerability.verify(message.vulnerability); + if (error) + return "vulnerability." + error; + } + if (message.muteUpdateTime != null && message.hasOwnProperty("muteUpdateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.muteUpdateTime); + if (error) + return "muteUpdateTime." + error; + } + if (message.externalSystems != null && message.hasOwnProperty("externalSystems")) { + if (!$util.isObject(message.externalSystems)) + return "externalSystems: object expected"; + var key = Object.keys(message.externalSystems); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.securitycenter.v1.ExternalSystem.verify(message.externalSystems[key[i]]); + if (error) + return "externalSystems." + error; + } + } + if (message.mitreAttack != null && message.hasOwnProperty("mitreAttack")) { + var error = $root.google.cloud.securitycenter.v1.MitreAttack.verify(message.mitreAttack); + if (error) + return "mitreAttack." + error; + } + if (message.access != null && message.hasOwnProperty("access")) { + var error = $root.google.cloud.securitycenter.v1.Access.verify(message.access); + if (error) + return "access." + error; + } + if (message.connections != null && message.hasOwnProperty("connections")) { + if (!Array.isArray(message.connections)) + return "connections: array expected"; + for (var i = 0; i < message.connections.length; ++i) { + var error = $root.google.cloud.securitycenter.v1.Connection.verify(message.connections[i]); + if (error) + return "connections." + error; + } + } + if (message.muteInitiator != null && message.hasOwnProperty("muteInitiator")) + if (!$util.isString(message.muteInitiator)) + return "muteInitiator: string expected"; + if (message.processes != null && message.hasOwnProperty("processes")) { + if (!Array.isArray(message.processes)) + return "processes: array expected"; + for (var i = 0; i < message.processes.length; ++i) { + var error = $root.google.cloud.securitycenter.v1.Process.verify(message.processes[i]); + if (error) + return "processes." + error; + } + } + if (message.compliances != null && message.hasOwnProperty("compliances")) { + if (!Array.isArray(message.compliances)) + return "compliances: array expected"; + for (var i = 0; i < message.compliances.length; ++i) { + var error = $root.google.cloud.securitycenter.v1.Compliance.verify(message.compliances[i]); + if (error) + return "compliances." + error; + } + } + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.exfiltration != null && message.hasOwnProperty("exfiltration")) { + var error = $root.google.cloud.securitycenter.v1.Exfiltration.verify(message.exfiltration); + if (error) + return "exfiltration." + error; + } + if (message.iamBindings != null && message.hasOwnProperty("iamBindings")) { + if (!Array.isArray(message.iamBindings)) + return "iamBindings: array expected"; + for (var i = 0; i < message.iamBindings.length; ++i) { + var error = $root.google.cloud.securitycenter.v1.IamBinding.verify(message.iamBindings[i]); + if (error) + return "iamBindings." + error; + } + } + if (message.nextSteps != null && message.hasOwnProperty("nextSteps")) + if (!$util.isString(message.nextSteps)) + return "nextSteps: string expected"; + return null; + }; + + /** + * Creates a Finding message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.Finding + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.Finding} Finding + */ + Finding.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.Finding) + return object; + var message = new $root.google.cloud.securitycenter.v1.Finding(); + if (object.name != null) + message.name = String(object.name); + if (object.parent != null) + message.parent = String(object.parent); + if (object.resourceName != null) + message.resourceName = String(object.resourceName); + switch (object.state) { + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "ACTIVE": + case 1: + message.state = 1; + break; + case "INACTIVE": + case 2: + message.state = 2; + break; + } + if (object.category != null) + message.category = String(object.category); + if (object.externalUri != null) + message.externalUri = String(object.externalUri); + if (object.sourceProperties) { + if (typeof object.sourceProperties !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Finding.sourceProperties: object expected"); + message.sourceProperties = {}; + for (var keys = Object.keys(object.sourceProperties), i = 0; i < keys.length; ++i) { + if (typeof object.sourceProperties[keys[i]] !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Finding.sourceProperties: object expected"); + message.sourceProperties[keys[i]] = $root.google.protobuf.Value.fromObject(object.sourceProperties[keys[i]]); + } + } + if (object.securityMarks != null) { + if (typeof object.securityMarks !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Finding.securityMarks: object expected"); + message.securityMarks = $root.google.cloud.securitycenter.v1.SecurityMarks.fromObject(object.securityMarks); + } + if (object.eventTime != null) { + if (typeof object.eventTime !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Finding.eventTime: object expected"); + message.eventTime = $root.google.protobuf.Timestamp.fromObject(object.eventTime); + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Finding.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + switch (object.severity) { + case "SEVERITY_UNSPECIFIED": + case 0: + message.severity = 0; + break; + case "CRITICAL": + case 1: + message.severity = 1; + break; + case "HIGH": + case 2: + message.severity = 2; + break; + case "MEDIUM": + case 3: + message.severity = 3; + break; + case "LOW": + case 4: + message.severity = 4; + break; + } + if (object.canonicalName != null) + message.canonicalName = String(object.canonicalName); + switch (object.mute) { + case "MUTE_UNSPECIFIED": + case 0: + message.mute = 0; + break; + case "MUTED": + case 1: + message.mute = 1; + break; + case "UNMUTED": + case 2: + message.mute = 2; + break; + case "UNDEFINED": + case 4: + message.mute = 4; + break; + } + switch (object.findingClass) { + case "FINDING_CLASS_UNSPECIFIED": + case 0: + message.findingClass = 0; + break; + case "THREAT": + case 1: + message.findingClass = 1; + break; + case "VULNERABILITY": + case 2: + message.findingClass = 2; + break; + case "MISCONFIGURATION": + case 3: + message.findingClass = 3; + break; + case "OBSERVATION": + case 4: + message.findingClass = 4; + break; + case "SCC_ERROR": + case 5: + message.findingClass = 5; + break; + } + if (object.indicator != null) { + if (typeof object.indicator !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Finding.indicator: object expected"); + message.indicator = $root.google.cloud.securitycenter.v1.Indicator.fromObject(object.indicator); + } + if (object.vulnerability != null) { + if (typeof object.vulnerability !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Finding.vulnerability: object expected"); + message.vulnerability = $root.google.cloud.securitycenter.v1.Vulnerability.fromObject(object.vulnerability); + } + if (object.muteUpdateTime != null) { + if (typeof object.muteUpdateTime !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Finding.muteUpdateTime: object expected"); + message.muteUpdateTime = $root.google.protobuf.Timestamp.fromObject(object.muteUpdateTime); + } + if (object.externalSystems) { + if (typeof object.externalSystems !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Finding.externalSystems: object expected"); + message.externalSystems = {}; + for (var keys = Object.keys(object.externalSystems), i = 0; i < keys.length; ++i) { + if (typeof object.externalSystems[keys[i]] !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Finding.externalSystems: object expected"); + message.externalSystems[keys[i]] = $root.google.cloud.securitycenter.v1.ExternalSystem.fromObject(object.externalSystems[keys[i]]); + } + } + if (object.mitreAttack != null) { + if (typeof object.mitreAttack !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Finding.mitreAttack: object expected"); + message.mitreAttack = $root.google.cloud.securitycenter.v1.MitreAttack.fromObject(object.mitreAttack); + } + if (object.access != null) { + if (typeof object.access !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Finding.access: object expected"); + message.access = $root.google.cloud.securitycenter.v1.Access.fromObject(object.access); + } + if (object.connections) { + if (!Array.isArray(object.connections)) + throw TypeError(".google.cloud.securitycenter.v1.Finding.connections: array expected"); + message.connections = []; + for (var i = 0; i < object.connections.length; ++i) { + if (typeof object.connections[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Finding.connections: object expected"); + message.connections[i] = $root.google.cloud.securitycenter.v1.Connection.fromObject(object.connections[i]); + } + } + if (object.muteInitiator != null) + message.muteInitiator = String(object.muteInitiator); + if (object.processes) { + if (!Array.isArray(object.processes)) + throw TypeError(".google.cloud.securitycenter.v1.Finding.processes: array expected"); + message.processes = []; + for (var i = 0; i < object.processes.length; ++i) { + if (typeof object.processes[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Finding.processes: object expected"); + message.processes[i] = $root.google.cloud.securitycenter.v1.Process.fromObject(object.processes[i]); + } + } + if (object.compliances) { + if (!Array.isArray(object.compliances)) + throw TypeError(".google.cloud.securitycenter.v1.Finding.compliances: array expected"); + message.compliances = []; + for (var i = 0; i < object.compliances.length; ++i) { + if (typeof object.compliances[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Finding.compliances: object expected"); + message.compliances[i] = $root.google.cloud.securitycenter.v1.Compliance.fromObject(object.compliances[i]); + } + } + if (object.description != null) + message.description = String(object.description); + if (object.exfiltration != null) { + if (typeof object.exfiltration !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Finding.exfiltration: object expected"); + message.exfiltration = $root.google.cloud.securitycenter.v1.Exfiltration.fromObject(object.exfiltration); + } + if (object.iamBindings) { + if (!Array.isArray(object.iamBindings)) + throw TypeError(".google.cloud.securitycenter.v1.Finding.iamBindings: array expected"); + message.iamBindings = []; + for (var i = 0; i < object.iamBindings.length; ++i) { + if (typeof object.iamBindings[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Finding.iamBindings: object expected"); + message.iamBindings[i] = $root.google.cloud.securitycenter.v1.IamBinding.fromObject(object.iamBindings[i]); + } + } + if (object.nextSteps != null) + message.nextSteps = String(object.nextSteps); + return message; + }; + + /** + * Creates a plain object from a Finding message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.Finding + * @static + * @param {google.cloud.securitycenter.v1.Finding} message Finding + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Finding.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.processes = []; + object.connections = []; + object.compliances = []; + object.iamBindings = []; + } + if (options.objects || options.defaults) { + object.sourceProperties = {}; + object.externalSystems = {}; + } + if (options.defaults) { + object.name = ""; + object.parent = ""; + object.resourceName = ""; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.category = ""; + object.externalUri = ""; + object.securityMarks = null; + object.eventTime = null; + object.createTime = null; + object.severity = options.enums === String ? "SEVERITY_UNSPECIFIED" : 0; + object.canonicalName = ""; + object.mute = options.enums === String ? "MUTE_UNSPECIFIED" : 0; + object.findingClass = options.enums === String ? "FINDING_CLASS_UNSPECIFIED" : 0; + object.indicator = null; + object.vulnerability = null; + object.muteUpdateTime = null; + object.mitreAttack = null; + object.access = null; + object.muteInitiator = ""; + object.description = ""; + object.exfiltration = null; + object.nextSteps = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.resourceName != null && message.hasOwnProperty("resourceName")) + object.resourceName = message.resourceName; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.securitycenter.v1.Finding.State[message.state] : message.state; + if (message.category != null && message.hasOwnProperty("category")) + object.category = message.category; + if (message.externalUri != null && message.hasOwnProperty("externalUri")) + object.externalUri = message.externalUri; + var keys2; + if (message.sourceProperties && (keys2 = Object.keys(message.sourceProperties)).length) { + object.sourceProperties = {}; + for (var j = 0; j < keys2.length; ++j) + object.sourceProperties[keys2[j]] = $root.google.protobuf.Value.toObject(message.sourceProperties[keys2[j]], options); + } + if (message.securityMarks != null && message.hasOwnProperty("securityMarks")) + object.securityMarks = $root.google.cloud.securitycenter.v1.SecurityMarks.toObject(message.securityMarks, options); + if (message.eventTime != null && message.hasOwnProperty("eventTime")) + object.eventTime = $root.google.protobuf.Timestamp.toObject(message.eventTime, options); + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.severity != null && message.hasOwnProperty("severity")) + object.severity = options.enums === String ? $root.google.cloud.securitycenter.v1.Finding.Severity[message.severity] : message.severity; + if (message.canonicalName != null && message.hasOwnProperty("canonicalName")) + object.canonicalName = message.canonicalName; + if (message.mute != null && message.hasOwnProperty("mute")) + object.mute = options.enums === String ? $root.google.cloud.securitycenter.v1.Finding.Mute[message.mute] : message.mute; + if (message.findingClass != null && message.hasOwnProperty("findingClass")) + object.findingClass = options.enums === String ? $root.google.cloud.securitycenter.v1.Finding.FindingClass[message.findingClass] : message.findingClass; + if (message.indicator != null && message.hasOwnProperty("indicator")) + object.indicator = $root.google.cloud.securitycenter.v1.Indicator.toObject(message.indicator, options); + if (message.vulnerability != null && message.hasOwnProperty("vulnerability")) + object.vulnerability = $root.google.cloud.securitycenter.v1.Vulnerability.toObject(message.vulnerability, options); + if (message.muteUpdateTime != null && message.hasOwnProperty("muteUpdateTime")) + object.muteUpdateTime = $root.google.protobuf.Timestamp.toObject(message.muteUpdateTime, options); + if (message.externalSystems && (keys2 = Object.keys(message.externalSystems)).length) { + object.externalSystems = {}; + for (var j = 0; j < keys2.length; ++j) + object.externalSystems[keys2[j]] = $root.google.cloud.securitycenter.v1.ExternalSystem.toObject(message.externalSystems[keys2[j]], options); + } + if (message.mitreAttack != null && message.hasOwnProperty("mitreAttack")) + object.mitreAttack = $root.google.cloud.securitycenter.v1.MitreAttack.toObject(message.mitreAttack, options); + if (message.access != null && message.hasOwnProperty("access")) + object.access = $root.google.cloud.securitycenter.v1.Access.toObject(message.access, options); + if (message.muteInitiator != null && message.hasOwnProperty("muteInitiator")) + object.muteInitiator = message.muteInitiator; + if (message.processes && message.processes.length) { + object.processes = []; + for (var j = 0; j < message.processes.length; ++j) + object.processes[j] = $root.google.cloud.securitycenter.v1.Process.toObject(message.processes[j], options); + } + if (message.connections && message.connections.length) { + object.connections = []; + for (var j = 0; j < message.connections.length; ++j) + object.connections[j] = $root.google.cloud.securitycenter.v1.Connection.toObject(message.connections[j], options); + } + if (message.compliances && message.compliances.length) { + object.compliances = []; + for (var j = 0; j < message.compliances.length; ++j) + object.compliances[j] = $root.google.cloud.securitycenter.v1.Compliance.toObject(message.compliances[j], options); + } + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.exfiltration != null && message.hasOwnProperty("exfiltration")) + object.exfiltration = $root.google.cloud.securitycenter.v1.Exfiltration.toObject(message.exfiltration, options); + if (message.iamBindings && message.iamBindings.length) { + object.iamBindings = []; + for (var j = 0; j < message.iamBindings.length; ++j) + object.iamBindings[j] = $root.google.cloud.securitycenter.v1.IamBinding.toObject(message.iamBindings[j], options); + } + if (message.nextSteps != null && message.hasOwnProperty("nextSteps")) + object.nextSteps = message.nextSteps; + return object; + }; + + /** + * Converts this Finding to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.Finding + * @instance + * @returns {Object.} JSON object + */ + Finding.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * State enum. + * @name google.cloud.securitycenter.v1.Finding.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} ACTIVE=1 ACTIVE value + * @property {number} INACTIVE=2 INACTIVE value + */ + Finding.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ACTIVE"] = 1; + values[valuesById[2] = "INACTIVE"] = 2; + return values; + })(); + + /** + * Severity enum. + * @name google.cloud.securitycenter.v1.Finding.Severity + * @enum {number} + * @property {number} SEVERITY_UNSPECIFIED=0 SEVERITY_UNSPECIFIED value + * @property {number} CRITICAL=1 CRITICAL value + * @property {number} HIGH=2 HIGH value + * @property {number} MEDIUM=3 MEDIUM value + * @property {number} LOW=4 LOW value + */ + Finding.Severity = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SEVERITY_UNSPECIFIED"] = 0; + values[valuesById[1] = "CRITICAL"] = 1; + values[valuesById[2] = "HIGH"] = 2; + values[valuesById[3] = "MEDIUM"] = 3; + values[valuesById[4] = "LOW"] = 4; + return values; + })(); + + /** + * Mute enum. + * @name google.cloud.securitycenter.v1.Finding.Mute + * @enum {number} + * @property {number} MUTE_UNSPECIFIED=0 MUTE_UNSPECIFIED value + * @property {number} MUTED=1 MUTED value + * @property {number} UNMUTED=2 UNMUTED value + * @property {number} UNDEFINED=4 UNDEFINED value + */ + Finding.Mute = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MUTE_UNSPECIFIED"] = 0; + values[valuesById[1] = "MUTED"] = 1; + values[valuesById[2] = "UNMUTED"] = 2; + values[valuesById[4] = "UNDEFINED"] = 4; + return values; + })(); + + /** + * FindingClass enum. + * @name google.cloud.securitycenter.v1.Finding.FindingClass + * @enum {number} + * @property {number} FINDING_CLASS_UNSPECIFIED=0 FINDING_CLASS_UNSPECIFIED value + * @property {number} THREAT=1 THREAT value + * @property {number} VULNERABILITY=2 VULNERABILITY value + * @property {number} MISCONFIGURATION=3 MISCONFIGURATION value + * @property {number} OBSERVATION=4 OBSERVATION value + * @property {number} SCC_ERROR=5 SCC_ERROR value + */ + Finding.FindingClass = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FINDING_CLASS_UNSPECIFIED"] = 0; + values[valuesById[1] = "THREAT"] = 1; + values[valuesById[2] = "VULNERABILITY"] = 2; + values[valuesById[3] = "MISCONFIGURATION"] = 3; + values[valuesById[4] = "OBSERVATION"] = 4; + values[valuesById[5] = "SCC_ERROR"] = 5; + return values; + })(); + + return Finding; + })(); + + v1.IamBinding = (function() { + + /** + * Properties of an IamBinding. + * @memberof google.cloud.securitycenter.v1 + * @interface IIamBinding + * @property {google.cloud.securitycenter.v1.IamBinding.Action|null} [action] IamBinding action + * @property {string|null} [role] IamBinding role + * @property {string|null} [member] IamBinding member + */ + + /** + * Constructs a new IamBinding. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents an IamBinding. + * @implements IIamBinding + * @constructor + * @param {google.cloud.securitycenter.v1.IIamBinding=} [properties] Properties to set + */ + function IamBinding(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]]; + } + + /** + * IamBinding action. + * @member {google.cloud.securitycenter.v1.IamBinding.Action} action + * @memberof google.cloud.securitycenter.v1.IamBinding + * @instance + */ + IamBinding.prototype.action = 0; + + /** + * IamBinding role. + * @member {string} role + * @memberof google.cloud.securitycenter.v1.IamBinding + * @instance + */ + IamBinding.prototype.role = ""; + + /** + * IamBinding member. + * @member {string} member + * @memberof google.cloud.securitycenter.v1.IamBinding + * @instance + */ + IamBinding.prototype.member = ""; + + /** + * Creates a new IamBinding instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.IamBinding + * @static + * @param {google.cloud.securitycenter.v1.IIamBinding=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.IamBinding} IamBinding instance + */ + IamBinding.create = function create(properties) { + return new IamBinding(properties); + }; + + /** + * Encodes the specified IamBinding message. Does not implicitly {@link google.cloud.securitycenter.v1.IamBinding.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.IamBinding + * @static + * @param {google.cloud.securitycenter.v1.IIamBinding} message IamBinding message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IamBinding.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.action != null && Object.hasOwnProperty.call(message, "action")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.action); + if (message.role != null && Object.hasOwnProperty.call(message, "role")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.role); + if (message.member != null && Object.hasOwnProperty.call(message, "member")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.member); + return writer; + }; + + /** + * Encodes the specified IamBinding message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.IamBinding.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.IamBinding + * @static + * @param {google.cloud.securitycenter.v1.IIamBinding} message IamBinding message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IamBinding.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an IamBinding message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.IamBinding + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.IamBinding} IamBinding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IamBinding.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.cloud.securitycenter.v1.IamBinding(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.action = reader.int32(); + break; + case 2: + message.role = reader.string(); + break; + case 3: + message.member = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an IamBinding message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.IamBinding + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.IamBinding} IamBinding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IamBinding.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an IamBinding message. + * @function verify + * @memberof google.cloud.securitycenter.v1.IamBinding + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IamBinding.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.action != null && message.hasOwnProperty("action")) + switch (message.action) { + default: + return "action: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.role != null && message.hasOwnProperty("role")) + if (!$util.isString(message.role)) + return "role: string expected"; + if (message.member != null && message.hasOwnProperty("member")) + if (!$util.isString(message.member)) + return "member: string expected"; + return null; + }; + + /** + * Creates an IamBinding message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.IamBinding + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.IamBinding} IamBinding + */ + IamBinding.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.IamBinding) + return object; + var message = new $root.google.cloud.securitycenter.v1.IamBinding(); + switch (object.action) { + case "ACTION_UNSPECIFIED": + case 0: + message.action = 0; + break; + case "ADD": + case 1: + message.action = 1; + break; + case "REMOVE": + case 2: + message.action = 2; + break; + } + if (object.role != null) + message.role = String(object.role); + if (object.member != null) + message.member = String(object.member); + return message; + }; + + /** + * Creates a plain object from an IamBinding message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.IamBinding + * @static + * @param {google.cloud.securitycenter.v1.IamBinding} message IamBinding + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IamBinding.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.action = options.enums === String ? "ACTION_UNSPECIFIED" : 0; + object.role = ""; + object.member = ""; + } + if (message.action != null && message.hasOwnProperty("action")) + object.action = options.enums === String ? $root.google.cloud.securitycenter.v1.IamBinding.Action[message.action] : message.action; + if (message.role != null && message.hasOwnProperty("role")) + object.role = message.role; + if (message.member != null && message.hasOwnProperty("member")) + object.member = message.member; + return object; + }; + + /** + * Converts this IamBinding to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.IamBinding + * @instance + * @returns {Object.} JSON object + */ + IamBinding.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Action enum. + * @name google.cloud.securitycenter.v1.IamBinding.Action + * @enum {number} + * @property {number} ACTION_UNSPECIFIED=0 ACTION_UNSPECIFIED value + * @property {number} ADD=1 ADD value + * @property {number} REMOVE=2 REMOVE value + */ + IamBinding.Action = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ACTION_UNSPECIFIED"] = 0; + values[valuesById[1] = "ADD"] = 1; + values[valuesById[2] = "REMOVE"] = 2; + return values; + })(); + + return IamBinding; + })(); + + v1.Indicator = (function() { + + /** + * Properties of an Indicator. + * @memberof google.cloud.securitycenter.v1 + * @interface IIndicator + * @property {Array.|null} [ipAddresses] Indicator ipAddresses + * @property {Array.|null} [domains] Indicator domains + */ + + /** + * Constructs a new Indicator. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents an Indicator. + * @implements IIndicator + * @constructor + * @param {google.cloud.securitycenter.v1.IIndicator=} [properties] Properties to set + */ + function Indicator(properties) { + this.ipAddresses = []; + this.domains = []; + 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]]; + } + + /** + * Indicator ipAddresses. + * @member {Array.} ipAddresses + * @memberof google.cloud.securitycenter.v1.Indicator + * @instance + */ + Indicator.prototype.ipAddresses = $util.emptyArray; + + /** + * Indicator domains. + * @member {Array.} domains + * @memberof google.cloud.securitycenter.v1.Indicator + * @instance + */ + Indicator.prototype.domains = $util.emptyArray; + + /** + * Creates a new Indicator instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.Indicator + * @static + * @param {google.cloud.securitycenter.v1.IIndicator=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.Indicator} Indicator instance + */ + Indicator.create = function create(properties) { + return new Indicator(properties); + }; + + /** + * Encodes the specified Indicator message. Does not implicitly {@link google.cloud.securitycenter.v1.Indicator.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.Indicator + * @static + * @param {google.cloud.securitycenter.v1.IIndicator} message Indicator message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Indicator.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.ipAddresses != null && message.ipAddresses.length) + for (var i = 0; i < message.ipAddresses.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.ipAddresses[i]); + if (message.domains != null && message.domains.length) + for (var i = 0; i < message.domains.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.domains[i]); + return writer; + }; + + /** + * Encodes the specified Indicator message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Indicator.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.Indicator + * @static + * @param {google.cloud.securitycenter.v1.IIndicator} message Indicator message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Indicator.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Indicator message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.Indicator + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.Indicator} Indicator + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Indicator.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.cloud.securitycenter.v1.Indicator(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.ipAddresses && message.ipAddresses.length)) + message.ipAddresses = []; + message.ipAddresses.push(reader.string()); + break; + case 2: + if (!(message.domains && message.domains.length)) + message.domains = []; + message.domains.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Indicator message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.Indicator + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.Indicator} Indicator + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Indicator.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Indicator message. + * @function verify + * @memberof google.cloud.securitycenter.v1.Indicator + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Indicator.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.ipAddresses != null && message.hasOwnProperty("ipAddresses")) { + if (!Array.isArray(message.ipAddresses)) + return "ipAddresses: array expected"; + for (var i = 0; i < message.ipAddresses.length; ++i) + if (!$util.isString(message.ipAddresses[i])) + return "ipAddresses: string[] expected"; + } + if (message.domains != null && message.hasOwnProperty("domains")) { + if (!Array.isArray(message.domains)) + return "domains: array expected"; + for (var i = 0; i < message.domains.length; ++i) + if (!$util.isString(message.domains[i])) + return "domains: string[] expected"; + } + return null; + }; + + /** + * Creates an Indicator message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.Indicator + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.Indicator} Indicator + */ + Indicator.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.Indicator) + return object; + var message = new $root.google.cloud.securitycenter.v1.Indicator(); + if (object.ipAddresses) { + if (!Array.isArray(object.ipAddresses)) + throw TypeError(".google.cloud.securitycenter.v1.Indicator.ipAddresses: array expected"); + message.ipAddresses = []; + for (var i = 0; i < object.ipAddresses.length; ++i) + message.ipAddresses[i] = String(object.ipAddresses[i]); + } + if (object.domains) { + if (!Array.isArray(object.domains)) + throw TypeError(".google.cloud.securitycenter.v1.Indicator.domains: array expected"); + message.domains = []; + for (var i = 0; i < object.domains.length; ++i) + message.domains[i] = String(object.domains[i]); + } + return message; + }; + + /** + * Creates a plain object from an Indicator message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.Indicator + * @static + * @param {google.cloud.securitycenter.v1.Indicator} message Indicator + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Indicator.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.ipAddresses = []; + object.domains = []; + } + if (message.ipAddresses && message.ipAddresses.length) { + object.ipAddresses = []; + for (var j = 0; j < message.ipAddresses.length; ++j) + object.ipAddresses[j] = message.ipAddresses[j]; + } + if (message.domains && message.domains.length) { + object.domains = []; + for (var j = 0; j < message.domains.length; ++j) + object.domains[j] = message.domains[j]; + } + return object; + }; + + /** + * Converts this Indicator to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.Indicator + * @instance + * @returns {Object.} JSON object + */ + Indicator.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Indicator; + })(); + + v1.MitreAttack = (function() { + + /** + * Properties of a MitreAttack. + * @memberof google.cloud.securitycenter.v1 + * @interface IMitreAttack + * @property {google.cloud.securitycenter.v1.MitreAttack.Tactic|null} [primaryTactic] MitreAttack primaryTactic + * @property {Array.|null} [primaryTechniques] MitreAttack primaryTechniques + * @property {Array.|null} [additionalTactics] MitreAttack additionalTactics + * @property {Array.|null} [additionalTechniques] MitreAttack additionalTechniques + * @property {string|null} [version] MitreAttack version + */ + + /** + * Constructs a new MitreAttack. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a MitreAttack. + * @implements IMitreAttack + * @constructor + * @param {google.cloud.securitycenter.v1.IMitreAttack=} [properties] Properties to set + */ + function MitreAttack(properties) { + this.primaryTechniques = []; + this.additionalTactics = []; + this.additionalTechniques = []; + 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]]; + } + + /** + * MitreAttack primaryTactic. + * @member {google.cloud.securitycenter.v1.MitreAttack.Tactic} primaryTactic + * @memberof google.cloud.securitycenter.v1.MitreAttack + * @instance + */ + MitreAttack.prototype.primaryTactic = 0; + + /** + * MitreAttack primaryTechniques. + * @member {Array.} primaryTechniques + * @memberof google.cloud.securitycenter.v1.MitreAttack + * @instance + */ + MitreAttack.prototype.primaryTechniques = $util.emptyArray; + + /** + * MitreAttack additionalTactics. + * @member {Array.} additionalTactics + * @memberof google.cloud.securitycenter.v1.MitreAttack + * @instance + */ + MitreAttack.prototype.additionalTactics = $util.emptyArray; + + /** + * MitreAttack additionalTechniques. + * @member {Array.} additionalTechniques + * @memberof google.cloud.securitycenter.v1.MitreAttack + * @instance + */ + MitreAttack.prototype.additionalTechniques = $util.emptyArray; + + /** + * MitreAttack version. + * @member {string} version + * @memberof google.cloud.securitycenter.v1.MitreAttack + * @instance + */ + MitreAttack.prototype.version = ""; + + /** + * Creates a new MitreAttack instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.MitreAttack + * @static + * @param {google.cloud.securitycenter.v1.IMitreAttack=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.MitreAttack} MitreAttack instance + */ + MitreAttack.create = function create(properties) { + return new MitreAttack(properties); + }; + + /** + * Encodes the specified MitreAttack message. Does not implicitly {@link google.cloud.securitycenter.v1.MitreAttack.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.MitreAttack + * @static + * @param {google.cloud.securitycenter.v1.IMitreAttack} message MitreAttack message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MitreAttack.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.primaryTactic != null && Object.hasOwnProperty.call(message, "primaryTactic")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.primaryTactic); + if (message.primaryTechniques != null && message.primaryTechniques.length) { + writer.uint32(/* id 2, wireType 2 =*/18).fork(); + for (var i = 0; i < message.primaryTechniques.length; ++i) + writer.int32(message.primaryTechniques[i]); + writer.ldelim(); + } + if (message.additionalTactics != null && message.additionalTactics.length) { + writer.uint32(/* id 3, wireType 2 =*/26).fork(); + for (var i = 0; i < message.additionalTactics.length; ++i) + writer.int32(message.additionalTactics[i]); + writer.ldelim(); + } + if (message.additionalTechniques != null && message.additionalTechniques.length) { + writer.uint32(/* id 4, wireType 2 =*/34).fork(); + for (var i = 0; i < message.additionalTechniques.length; ++i) + writer.int32(message.additionalTechniques[i]); + writer.ldelim(); + } + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.version); + return writer; + }; + + /** + * Encodes the specified MitreAttack message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.MitreAttack.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.MitreAttack + * @static + * @param {google.cloud.securitycenter.v1.IMitreAttack} message MitreAttack message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MitreAttack.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MitreAttack message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.MitreAttack + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.MitreAttack} MitreAttack + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MitreAttack.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.cloud.securitycenter.v1.MitreAttack(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.primaryTactic = reader.int32(); + break; + case 2: + if (!(message.primaryTechniques && message.primaryTechniques.length)) + message.primaryTechniques = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.primaryTechniques.push(reader.int32()); + } else + message.primaryTechniques.push(reader.int32()); + break; + case 3: + if (!(message.additionalTactics && message.additionalTactics.length)) + message.additionalTactics = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.additionalTactics.push(reader.int32()); + } else + message.additionalTactics.push(reader.int32()); + break; + case 4: + if (!(message.additionalTechniques && message.additionalTechniques.length)) + message.additionalTechniques = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.additionalTechniques.push(reader.int32()); + } else + message.additionalTechniques.push(reader.int32()); + break; + case 5: + message.version = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MitreAttack message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.MitreAttack + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.MitreAttack} MitreAttack + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MitreAttack.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MitreAttack message. + * @function verify + * @memberof google.cloud.securitycenter.v1.MitreAttack + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MitreAttack.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.primaryTactic != null && message.hasOwnProperty("primaryTactic")) + switch (message.primaryTactic) { + default: + return "primaryTactic: enum value expected"; + case 0: + case 1: + case 2: + case 5: + case 3: + case 6: + case 8: + case 7: + case 9: + case 10: + case 11: + case 12: + case 4: + case 13: + case 14: + break; + } + if (message.primaryTechniques != null && message.hasOwnProperty("primaryTechniques")) { + if (!Array.isArray(message.primaryTechniques)) + return "primaryTechniques: array expected"; + for (var i = 0; i < message.primaryTechniques.length; ++i) + switch (message.primaryTechniques[i]) { + default: + return "primaryTechniques: enum value[] expected"; + case 0: + 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: + case 19: + case 20: + case 21: + case 22: + case 23: + case 24: + case 25: + case 26: + case 27: + case 28: + case 29: + case 30: + case 31: + break; + } + } + if (message.additionalTactics != null && message.hasOwnProperty("additionalTactics")) { + if (!Array.isArray(message.additionalTactics)) + return "additionalTactics: array expected"; + for (var i = 0; i < message.additionalTactics.length; ++i) + switch (message.additionalTactics[i]) { + default: + return "additionalTactics: enum value[] expected"; + case 0: + case 1: + case 2: + case 5: + case 3: + case 6: + case 8: + case 7: + case 9: + case 10: + case 11: + case 12: + case 4: + case 13: + case 14: + break; + } + } + if (message.additionalTechniques != null && message.hasOwnProperty("additionalTechniques")) { + if (!Array.isArray(message.additionalTechniques)) + return "additionalTechniques: array expected"; + for (var i = 0; i < message.additionalTechniques.length; ++i) + switch (message.additionalTechniques[i]) { + default: + return "additionalTechniques: enum value[] expected"; + case 0: + 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: + case 19: + case 20: + case 21: + case 22: + case 23: + case 24: + case 25: + case 26: + case 27: + case 28: + case 29: + case 30: + case 31: + break; + } + } + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isString(message.version)) + return "version: string expected"; + return null; + }; + + /** + * Creates a MitreAttack message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.MitreAttack + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.MitreAttack} MitreAttack + */ + MitreAttack.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.MitreAttack) + return object; + var message = new $root.google.cloud.securitycenter.v1.MitreAttack(); + switch (object.primaryTactic) { + case "TACTIC_UNSPECIFIED": + case 0: + message.primaryTactic = 0; + break; + case "RECONNAISSANCE": + case 1: + message.primaryTactic = 1; + break; + case "RESOURCE_DEVELOPMENT": + case 2: + message.primaryTactic = 2; + break; + case "INITIAL_ACCESS": + case 5: + message.primaryTactic = 5; + break; + case "EXECUTION": + case 3: + message.primaryTactic = 3; + break; + case "PERSISTENCE": + case 6: + message.primaryTactic = 6; + break; + case "PRIVILEGE_ESCALATION": + case 8: + message.primaryTactic = 8; + break; + case "DEFENSE_EVASION": + case 7: + message.primaryTactic = 7; + break; + case "CREDENTIAL_ACCESS": + case 9: + message.primaryTactic = 9; + break; + case "DISCOVERY": + case 10: + message.primaryTactic = 10; + break; + case "LATERAL_MOVEMENT": + case 11: + message.primaryTactic = 11; + break; + case "COLLECTION": + case 12: + message.primaryTactic = 12; + break; + case "COMMAND_AND_CONTROL": + case 4: + message.primaryTactic = 4; + break; + case "EXFILTRATION": + case 13: + message.primaryTactic = 13; + break; + case "IMPACT": + case 14: + message.primaryTactic = 14; + break; + } + if (object.primaryTechniques) { + if (!Array.isArray(object.primaryTechniques)) throw TypeError(".google.cloud.securitycenter.v1.MitreAttack.primaryTechniques: array expected"); message.primaryTechniques = []; for (var i = 0; i < object.primaryTechniques.length; ++i) @@ -5025,505 +6193,1187 @@ default: case "TECHNIQUE_UNSPECIFIED": case 0: - message.primaryTechniques[i] = 0; + message.primaryTechniques[i] = 0; + break; + case "ACTIVE_SCANNING": + case 1: + message.primaryTechniques[i] = 1; + break; + case "SCANNING_IP_BLOCKS": + case 2: + message.primaryTechniques[i] = 2; + break; + case "INGRESS_TOOL_TRANSFER": + case 3: + message.primaryTechniques[i] = 3; + break; + case "NATIVE_API": + case 4: + message.primaryTechniques[i] = 4; + break; + case "SHARED_MODULES": + case 5: + message.primaryTechniques[i] = 5; + break; + case "COMMAND_AND_SCRIPTING_INTERPRETER": + case 6: + message.primaryTechniques[i] = 6; + break; + case "UNIX_SHELL": + case 7: + message.primaryTechniques[i] = 7; + break; + case "RESOURCE_HIJACKING": + case 8: + message.primaryTechniques[i] = 8; + break; + case "PROXY": + case 9: + message.primaryTechniques[i] = 9; + break; + case "EXTERNAL_PROXY": + case 10: + message.primaryTechniques[i] = 10; + break; + case "MULTI_HOP_PROXY": + case 11: + message.primaryTechniques[i] = 11; + break; + case "DYNAMIC_RESOLUTION": + case 12: + message.primaryTechniques[i] = 12; + break; + case "UNSECURED_CREDENTIALS": + case 13: + message.primaryTechniques[i] = 13; + break; + case "VALID_ACCOUNTS": + case 14: + message.primaryTechniques[i] = 14; + break; + case "LOCAL_ACCOUNTS": + case 15: + message.primaryTechniques[i] = 15; + break; + case "CLOUD_ACCOUNTS": + case 16: + message.primaryTechniques[i] = 16; + break; + case "NETWORK_DENIAL_OF_SERVICE": + case 17: + message.primaryTechniques[i] = 17; + break; + case "PERMISSION_GROUPS_DISCOVERY": + case 18: + message.primaryTechniques[i] = 18; + break; + case "CLOUD_GROUPS": + case 19: + message.primaryTechniques[i] = 19; + break; + case "EXFILTRATION_OVER_WEB_SERVICE": + case 20: + message.primaryTechniques[i] = 20; + break; + case "EXFILTRATION_TO_CLOUD_STORAGE": + case 21: + message.primaryTechniques[i] = 21; + break; + case "ACCOUNT_MANIPULATION": + case 22: + message.primaryTechniques[i] = 22; + break; + case "SSH_AUTHORIZED_KEYS": + case 23: + message.primaryTechniques[i] = 23; + break; + case "CREATE_OR_MODIFY_SYSTEM_PROCESS": + case 24: + message.primaryTechniques[i] = 24; + break; + case "STEAL_WEB_SESSION_COOKIE": + case 25: + message.primaryTechniques[i] = 25; + break; + case "MODIFY_CLOUD_COMPUTE_INFRASTRUCTURE": + case 26: + message.primaryTechniques[i] = 26; + break; + case "EXPLOIT_PUBLIC_FACING_APPLICATION": + case 27: + message.primaryTechniques[i] = 27; + break; + case "MODIFY_AUTHENTICATION_PROCESS": + case 28: + message.primaryTechniques[i] = 28; + break; + case "DATA_DESTRUCTION": + case 29: + message.primaryTechniques[i] = 29; + break; + case "DOMAIN_POLICY_MODIFICATION": + case 30: + message.primaryTechniques[i] = 30; + break; + case "IMPAIR_DEFENSES": + case 31: + message.primaryTechniques[i] = 31; + break; + } + } + if (object.additionalTactics) { + if (!Array.isArray(object.additionalTactics)) + throw TypeError(".google.cloud.securitycenter.v1.MitreAttack.additionalTactics: array expected"); + message.additionalTactics = []; + for (var i = 0; i < object.additionalTactics.length; ++i) + switch (object.additionalTactics[i]) { + default: + case "TACTIC_UNSPECIFIED": + case 0: + message.additionalTactics[i] = 0; + break; + case "RECONNAISSANCE": + case 1: + message.additionalTactics[i] = 1; + break; + case "RESOURCE_DEVELOPMENT": + case 2: + message.additionalTactics[i] = 2; + break; + case "INITIAL_ACCESS": + case 5: + message.additionalTactics[i] = 5; + break; + case "EXECUTION": + case 3: + message.additionalTactics[i] = 3; + break; + case "PERSISTENCE": + case 6: + message.additionalTactics[i] = 6; + break; + case "PRIVILEGE_ESCALATION": + case 8: + message.additionalTactics[i] = 8; + break; + case "DEFENSE_EVASION": + case 7: + message.additionalTactics[i] = 7; + break; + case "CREDENTIAL_ACCESS": + case 9: + message.additionalTactics[i] = 9; + break; + case "DISCOVERY": + case 10: + message.additionalTactics[i] = 10; + break; + case "LATERAL_MOVEMENT": + case 11: + message.additionalTactics[i] = 11; + break; + case "COLLECTION": + case 12: + message.additionalTactics[i] = 12; + break; + case "COMMAND_AND_CONTROL": + case 4: + message.additionalTactics[i] = 4; + break; + case "EXFILTRATION": + case 13: + message.additionalTactics[i] = 13; + break; + case "IMPACT": + case 14: + message.additionalTactics[i] = 14; + break; + } + } + if (object.additionalTechniques) { + if (!Array.isArray(object.additionalTechniques)) + throw TypeError(".google.cloud.securitycenter.v1.MitreAttack.additionalTechniques: array expected"); + message.additionalTechniques = []; + for (var i = 0; i < object.additionalTechniques.length; ++i) + switch (object.additionalTechniques[i]) { + default: + case "TECHNIQUE_UNSPECIFIED": + case 0: + message.additionalTechniques[i] = 0; break; case "ACTIVE_SCANNING": case 1: - message.primaryTechniques[i] = 1; + message.additionalTechniques[i] = 1; break; case "SCANNING_IP_BLOCKS": case 2: - message.primaryTechniques[i] = 2; + message.additionalTechniques[i] = 2; break; case "INGRESS_TOOL_TRANSFER": case 3: - message.primaryTechniques[i] = 3; + message.additionalTechniques[i] = 3; break; case "NATIVE_API": case 4: - message.primaryTechniques[i] = 4; + message.additionalTechniques[i] = 4; break; case "SHARED_MODULES": case 5: - message.primaryTechniques[i] = 5; + message.additionalTechniques[i] = 5; break; case "COMMAND_AND_SCRIPTING_INTERPRETER": case 6: - message.primaryTechniques[i] = 6; + message.additionalTechniques[i] = 6; break; case "UNIX_SHELL": case 7: - message.primaryTechniques[i] = 7; + message.additionalTechniques[i] = 7; break; case "RESOURCE_HIJACKING": case 8: - message.primaryTechniques[i] = 8; + message.additionalTechniques[i] = 8; break; case "PROXY": case 9: - message.primaryTechniques[i] = 9; + message.additionalTechniques[i] = 9; break; case "EXTERNAL_PROXY": case 10: - message.primaryTechniques[i] = 10; + message.additionalTechniques[i] = 10; break; case "MULTI_HOP_PROXY": case 11: - message.primaryTechniques[i] = 11; + message.additionalTechniques[i] = 11; break; case "DYNAMIC_RESOLUTION": case 12: - message.primaryTechniques[i] = 12; + message.additionalTechniques[i] = 12; break; case "UNSECURED_CREDENTIALS": case 13: - message.primaryTechniques[i] = 13; + message.additionalTechniques[i] = 13; break; case "VALID_ACCOUNTS": case 14: - message.primaryTechniques[i] = 14; + message.additionalTechniques[i] = 14; break; case "LOCAL_ACCOUNTS": case 15: - message.primaryTechniques[i] = 15; + message.additionalTechniques[i] = 15; break; case "CLOUD_ACCOUNTS": case 16: - message.primaryTechniques[i] = 16; + message.additionalTechniques[i] = 16; break; case "NETWORK_DENIAL_OF_SERVICE": case 17: - message.primaryTechniques[i] = 17; + message.additionalTechniques[i] = 17; break; case "PERMISSION_GROUPS_DISCOVERY": case 18: - message.primaryTechniques[i] = 18; + message.additionalTechniques[i] = 18; break; case "CLOUD_GROUPS": case 19: - message.primaryTechniques[i] = 19; + message.additionalTechniques[i] = 19; break; case "EXFILTRATION_OVER_WEB_SERVICE": case 20: - message.primaryTechniques[i] = 20; + message.additionalTechniques[i] = 20; break; case "EXFILTRATION_TO_CLOUD_STORAGE": case 21: - message.primaryTechniques[i] = 21; + message.additionalTechniques[i] = 21; break; case "ACCOUNT_MANIPULATION": case 22: - message.primaryTechniques[i] = 22; + message.additionalTechniques[i] = 22; break; case "SSH_AUTHORIZED_KEYS": case 23: - message.primaryTechniques[i] = 23; + message.additionalTechniques[i] = 23; break; case "CREATE_OR_MODIFY_SYSTEM_PROCESS": case 24: - message.primaryTechniques[i] = 24; + message.additionalTechniques[i] = 24; break; case "STEAL_WEB_SESSION_COOKIE": case 25: - message.primaryTechniques[i] = 25; + message.additionalTechniques[i] = 25; break; case "MODIFY_CLOUD_COMPUTE_INFRASTRUCTURE": case 26: - message.primaryTechniques[i] = 26; + message.additionalTechniques[i] = 26; break; case "EXPLOIT_PUBLIC_FACING_APPLICATION": case 27: - message.primaryTechniques[i] = 27; + message.additionalTechniques[i] = 27; break; case "MODIFY_AUTHENTICATION_PROCESS": case 28: - message.primaryTechniques[i] = 28; + message.additionalTechniques[i] = 28; break; case "DATA_DESTRUCTION": case 29: - message.primaryTechniques[i] = 29; + message.additionalTechniques[i] = 29; break; case "DOMAIN_POLICY_MODIFICATION": case 30: - message.primaryTechniques[i] = 30; + message.additionalTechniques[i] = 30; + break; + case "IMPAIR_DEFENSES": + case 31: + message.additionalTechniques[i] = 31; break; } } - if (object.additionalTactics) { - if (!Array.isArray(object.additionalTactics)) - throw TypeError(".google.cloud.securitycenter.v1.MitreAttack.additionalTactics: array expected"); - message.additionalTactics = []; - for (var i = 0; i < object.additionalTactics.length; ++i) - switch (object.additionalTactics[i]) { - default: - case "TACTIC_UNSPECIFIED": - case 0: - message.additionalTactics[i] = 0; - break; - case "RECONNAISSANCE": - case 1: - message.additionalTactics[i] = 1; - break; - case "RESOURCE_DEVELOPMENT": - case 2: - message.additionalTactics[i] = 2; - break; - case "INITIAL_ACCESS": - case 5: - message.additionalTactics[i] = 5; - break; - case "EXECUTION": - case 3: - message.additionalTactics[i] = 3; - break; - case "PERSISTENCE": - case 6: - message.additionalTactics[i] = 6; - break; - case "PRIVILEGE_ESCALATION": - case 8: - message.additionalTactics[i] = 8; - break; - case "DEFENSE_EVASION": - case 7: - message.additionalTactics[i] = 7; - break; - case "CREDENTIAL_ACCESS": - case 9: - message.additionalTactics[i] = 9; - break; - case "DISCOVERY": - case 10: - message.additionalTactics[i] = 10; - break; - case "LATERAL_MOVEMENT": - case 11: - message.additionalTactics[i] = 11; - break; - case "COLLECTION": - case 12: - message.additionalTactics[i] = 12; - break; - case "COMMAND_AND_CONTROL": - case 4: - message.additionalTactics[i] = 4; - break; - case "EXFILTRATION": - case 13: - message.additionalTactics[i] = 13; - break; - case "IMPACT": - case 14: - message.additionalTactics[i] = 14; - break; - } + if (object.version != null) + message.version = String(object.version); + return message; + }; + + /** + * Creates a plain object from a MitreAttack message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.MitreAttack + * @static + * @param {google.cloud.securitycenter.v1.MitreAttack} message MitreAttack + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MitreAttack.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.primaryTechniques = []; + object.additionalTactics = []; + object.additionalTechniques = []; + } + if (options.defaults) { + object.primaryTactic = options.enums === String ? "TACTIC_UNSPECIFIED" : 0; + object.version = ""; + } + if (message.primaryTactic != null && message.hasOwnProperty("primaryTactic")) + object.primaryTactic = options.enums === String ? $root.google.cloud.securitycenter.v1.MitreAttack.Tactic[message.primaryTactic] : message.primaryTactic; + if (message.primaryTechniques && message.primaryTechniques.length) { + object.primaryTechniques = []; + for (var j = 0; j < message.primaryTechniques.length; ++j) + object.primaryTechniques[j] = options.enums === String ? $root.google.cloud.securitycenter.v1.MitreAttack.Technique[message.primaryTechniques[j]] : message.primaryTechniques[j]; + } + if (message.additionalTactics && message.additionalTactics.length) { + object.additionalTactics = []; + for (var j = 0; j < message.additionalTactics.length; ++j) + object.additionalTactics[j] = options.enums === String ? $root.google.cloud.securitycenter.v1.MitreAttack.Tactic[message.additionalTactics[j]] : message.additionalTactics[j]; + } + if (message.additionalTechniques && message.additionalTechniques.length) { + object.additionalTechniques = []; + for (var j = 0; j < message.additionalTechniques.length; ++j) + object.additionalTechniques[j] = options.enums === String ? $root.google.cloud.securitycenter.v1.MitreAttack.Technique[message.additionalTechniques[j]] : message.additionalTechniques[j]; + } + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + return object; + }; + + /** + * Converts this MitreAttack to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.MitreAttack + * @instance + * @returns {Object.} JSON object + */ + MitreAttack.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Tactic enum. + * @name google.cloud.securitycenter.v1.MitreAttack.Tactic + * @enum {number} + * @property {number} TACTIC_UNSPECIFIED=0 TACTIC_UNSPECIFIED value + * @property {number} RECONNAISSANCE=1 RECONNAISSANCE value + * @property {number} RESOURCE_DEVELOPMENT=2 RESOURCE_DEVELOPMENT value + * @property {number} INITIAL_ACCESS=5 INITIAL_ACCESS value + * @property {number} EXECUTION=3 EXECUTION value + * @property {number} PERSISTENCE=6 PERSISTENCE value + * @property {number} PRIVILEGE_ESCALATION=8 PRIVILEGE_ESCALATION value + * @property {number} DEFENSE_EVASION=7 DEFENSE_EVASION value + * @property {number} CREDENTIAL_ACCESS=9 CREDENTIAL_ACCESS value + * @property {number} DISCOVERY=10 DISCOVERY value + * @property {number} LATERAL_MOVEMENT=11 LATERAL_MOVEMENT value + * @property {number} COLLECTION=12 COLLECTION value + * @property {number} COMMAND_AND_CONTROL=4 COMMAND_AND_CONTROL value + * @property {number} EXFILTRATION=13 EXFILTRATION value + * @property {number} IMPACT=14 IMPACT value + */ + MitreAttack.Tactic = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TACTIC_UNSPECIFIED"] = 0; + values[valuesById[1] = "RECONNAISSANCE"] = 1; + values[valuesById[2] = "RESOURCE_DEVELOPMENT"] = 2; + values[valuesById[5] = "INITIAL_ACCESS"] = 5; + values[valuesById[3] = "EXECUTION"] = 3; + values[valuesById[6] = "PERSISTENCE"] = 6; + values[valuesById[8] = "PRIVILEGE_ESCALATION"] = 8; + values[valuesById[7] = "DEFENSE_EVASION"] = 7; + values[valuesById[9] = "CREDENTIAL_ACCESS"] = 9; + values[valuesById[10] = "DISCOVERY"] = 10; + values[valuesById[11] = "LATERAL_MOVEMENT"] = 11; + values[valuesById[12] = "COLLECTION"] = 12; + values[valuesById[4] = "COMMAND_AND_CONTROL"] = 4; + values[valuesById[13] = "EXFILTRATION"] = 13; + values[valuesById[14] = "IMPACT"] = 14; + return values; + })(); + + /** + * Technique enum. + * @name google.cloud.securitycenter.v1.MitreAttack.Technique + * @enum {number} + * @property {number} TECHNIQUE_UNSPECIFIED=0 TECHNIQUE_UNSPECIFIED value + * @property {number} ACTIVE_SCANNING=1 ACTIVE_SCANNING value + * @property {number} SCANNING_IP_BLOCKS=2 SCANNING_IP_BLOCKS value + * @property {number} INGRESS_TOOL_TRANSFER=3 INGRESS_TOOL_TRANSFER value + * @property {number} NATIVE_API=4 NATIVE_API value + * @property {number} SHARED_MODULES=5 SHARED_MODULES value + * @property {number} COMMAND_AND_SCRIPTING_INTERPRETER=6 COMMAND_AND_SCRIPTING_INTERPRETER value + * @property {number} UNIX_SHELL=7 UNIX_SHELL value + * @property {number} RESOURCE_HIJACKING=8 RESOURCE_HIJACKING value + * @property {number} PROXY=9 PROXY value + * @property {number} EXTERNAL_PROXY=10 EXTERNAL_PROXY value + * @property {number} MULTI_HOP_PROXY=11 MULTI_HOP_PROXY value + * @property {number} DYNAMIC_RESOLUTION=12 DYNAMIC_RESOLUTION value + * @property {number} UNSECURED_CREDENTIALS=13 UNSECURED_CREDENTIALS value + * @property {number} VALID_ACCOUNTS=14 VALID_ACCOUNTS value + * @property {number} LOCAL_ACCOUNTS=15 LOCAL_ACCOUNTS value + * @property {number} CLOUD_ACCOUNTS=16 CLOUD_ACCOUNTS value + * @property {number} NETWORK_DENIAL_OF_SERVICE=17 NETWORK_DENIAL_OF_SERVICE value + * @property {number} PERMISSION_GROUPS_DISCOVERY=18 PERMISSION_GROUPS_DISCOVERY value + * @property {number} CLOUD_GROUPS=19 CLOUD_GROUPS value + * @property {number} EXFILTRATION_OVER_WEB_SERVICE=20 EXFILTRATION_OVER_WEB_SERVICE value + * @property {number} EXFILTRATION_TO_CLOUD_STORAGE=21 EXFILTRATION_TO_CLOUD_STORAGE value + * @property {number} ACCOUNT_MANIPULATION=22 ACCOUNT_MANIPULATION value + * @property {number} SSH_AUTHORIZED_KEYS=23 SSH_AUTHORIZED_KEYS value + * @property {number} CREATE_OR_MODIFY_SYSTEM_PROCESS=24 CREATE_OR_MODIFY_SYSTEM_PROCESS value + * @property {number} STEAL_WEB_SESSION_COOKIE=25 STEAL_WEB_SESSION_COOKIE value + * @property {number} MODIFY_CLOUD_COMPUTE_INFRASTRUCTURE=26 MODIFY_CLOUD_COMPUTE_INFRASTRUCTURE value + * @property {number} EXPLOIT_PUBLIC_FACING_APPLICATION=27 EXPLOIT_PUBLIC_FACING_APPLICATION value + * @property {number} MODIFY_AUTHENTICATION_PROCESS=28 MODIFY_AUTHENTICATION_PROCESS value + * @property {number} DATA_DESTRUCTION=29 DATA_DESTRUCTION value + * @property {number} DOMAIN_POLICY_MODIFICATION=30 DOMAIN_POLICY_MODIFICATION value + * @property {number} IMPAIR_DEFENSES=31 IMPAIR_DEFENSES value + */ + MitreAttack.Technique = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TECHNIQUE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ACTIVE_SCANNING"] = 1; + values[valuesById[2] = "SCANNING_IP_BLOCKS"] = 2; + values[valuesById[3] = "INGRESS_TOOL_TRANSFER"] = 3; + values[valuesById[4] = "NATIVE_API"] = 4; + values[valuesById[5] = "SHARED_MODULES"] = 5; + values[valuesById[6] = "COMMAND_AND_SCRIPTING_INTERPRETER"] = 6; + values[valuesById[7] = "UNIX_SHELL"] = 7; + values[valuesById[8] = "RESOURCE_HIJACKING"] = 8; + values[valuesById[9] = "PROXY"] = 9; + values[valuesById[10] = "EXTERNAL_PROXY"] = 10; + values[valuesById[11] = "MULTI_HOP_PROXY"] = 11; + values[valuesById[12] = "DYNAMIC_RESOLUTION"] = 12; + values[valuesById[13] = "UNSECURED_CREDENTIALS"] = 13; + values[valuesById[14] = "VALID_ACCOUNTS"] = 14; + values[valuesById[15] = "LOCAL_ACCOUNTS"] = 15; + values[valuesById[16] = "CLOUD_ACCOUNTS"] = 16; + values[valuesById[17] = "NETWORK_DENIAL_OF_SERVICE"] = 17; + values[valuesById[18] = "PERMISSION_GROUPS_DISCOVERY"] = 18; + values[valuesById[19] = "CLOUD_GROUPS"] = 19; + values[valuesById[20] = "EXFILTRATION_OVER_WEB_SERVICE"] = 20; + values[valuesById[21] = "EXFILTRATION_TO_CLOUD_STORAGE"] = 21; + values[valuesById[22] = "ACCOUNT_MANIPULATION"] = 22; + values[valuesById[23] = "SSH_AUTHORIZED_KEYS"] = 23; + values[valuesById[24] = "CREATE_OR_MODIFY_SYSTEM_PROCESS"] = 24; + values[valuesById[25] = "STEAL_WEB_SESSION_COOKIE"] = 25; + values[valuesById[26] = "MODIFY_CLOUD_COMPUTE_INFRASTRUCTURE"] = 26; + values[valuesById[27] = "EXPLOIT_PUBLIC_FACING_APPLICATION"] = 27; + values[valuesById[28] = "MODIFY_AUTHENTICATION_PROCESS"] = 28; + values[valuesById[29] = "DATA_DESTRUCTION"] = 29; + values[valuesById[30] = "DOMAIN_POLICY_MODIFICATION"] = 30; + values[valuesById[31] = "IMPAIR_DEFENSES"] = 31; + return values; + })(); + + return MitreAttack; + })(); + + v1.Process = (function() { + + /** + * Properties of a Process. + * @memberof google.cloud.securitycenter.v1 + * @interface IProcess + * @property {google.cloud.securitycenter.v1.IFile|null} [binary] Process binary + * @property {Array.|null} [libraries] Process libraries + * @property {google.cloud.securitycenter.v1.IFile|null} [script] Process script + * @property {Array.|null} [args] Process args + * @property {boolean|null} [argumentsTruncated] Process argumentsTruncated + * @property {Array.|null} [envVariables] Process envVariables + * @property {boolean|null} [envVariablesTruncated] Process envVariablesTruncated + * @property {number|Long|null} [pid] Process pid + * @property {number|Long|null} [parentPid] Process parentPid + */ + + /** + * Constructs a new Process. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a Process. + * @implements IProcess + * @constructor + * @param {google.cloud.securitycenter.v1.IProcess=} [properties] Properties to set + */ + function Process(properties) { + this.libraries = []; + this.args = []; + this.envVariables = []; + 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]]; + } + + /** + * Process binary. + * @member {google.cloud.securitycenter.v1.IFile|null|undefined} binary + * @memberof google.cloud.securitycenter.v1.Process + * @instance + */ + Process.prototype.binary = null; + + /** + * Process libraries. + * @member {Array.} libraries + * @memberof google.cloud.securitycenter.v1.Process + * @instance + */ + Process.prototype.libraries = $util.emptyArray; + + /** + * Process script. + * @member {google.cloud.securitycenter.v1.IFile|null|undefined} script + * @memberof google.cloud.securitycenter.v1.Process + * @instance + */ + Process.prototype.script = null; + + /** + * Process args. + * @member {Array.} args + * @memberof google.cloud.securitycenter.v1.Process + * @instance + */ + Process.prototype.args = $util.emptyArray; + + /** + * Process argumentsTruncated. + * @member {boolean} argumentsTruncated + * @memberof google.cloud.securitycenter.v1.Process + * @instance + */ + Process.prototype.argumentsTruncated = false; + + /** + * Process envVariables. + * @member {Array.} envVariables + * @memberof google.cloud.securitycenter.v1.Process + * @instance + */ + Process.prototype.envVariables = $util.emptyArray; + + /** + * Process envVariablesTruncated. + * @member {boolean} envVariablesTruncated + * @memberof google.cloud.securitycenter.v1.Process + * @instance + */ + Process.prototype.envVariablesTruncated = false; + + /** + * Process pid. + * @member {number|Long} pid + * @memberof google.cloud.securitycenter.v1.Process + * @instance + */ + Process.prototype.pid = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Process parentPid. + * @member {number|Long} parentPid + * @memberof google.cloud.securitycenter.v1.Process + * @instance + */ + Process.prototype.parentPid = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Process instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.Process + * @static + * @param {google.cloud.securitycenter.v1.IProcess=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.Process} Process instance + */ + Process.create = function create(properties) { + return new Process(properties); + }; + + /** + * Encodes the specified Process message. Does not implicitly {@link google.cloud.securitycenter.v1.Process.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.Process + * @static + * @param {google.cloud.securitycenter.v1.IProcess} message Process message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Process.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.binary != null && Object.hasOwnProperty.call(message, "binary")) + $root.google.cloud.securitycenter.v1.File.encode(message.binary, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.libraries != null && message.libraries.length) + for (var i = 0; i < message.libraries.length; ++i) + $root.google.cloud.securitycenter.v1.File.encode(message.libraries[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.script != null && Object.hasOwnProperty.call(message, "script")) + $root.google.cloud.securitycenter.v1.File.encode(message.script, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.args != null && message.args.length) + for (var i = 0; i < message.args.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.args[i]); + if (message.argumentsTruncated != null && Object.hasOwnProperty.call(message, "argumentsTruncated")) + writer.uint32(/* id 7, wireType 0 =*/56).bool(message.argumentsTruncated); + if (message.envVariables != null && message.envVariables.length) + for (var i = 0; i < message.envVariables.length; ++i) + $root.google.cloud.securitycenter.v1.EnvironmentVariable.encode(message.envVariables[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.envVariablesTruncated != null && Object.hasOwnProperty.call(message, "envVariablesTruncated")) + writer.uint32(/* id 9, wireType 0 =*/72).bool(message.envVariablesTruncated); + if (message.pid != null && Object.hasOwnProperty.call(message, "pid")) + writer.uint32(/* id 10, wireType 0 =*/80).int64(message.pid); + if (message.parentPid != null && Object.hasOwnProperty.call(message, "parentPid")) + writer.uint32(/* id 11, wireType 0 =*/88).int64(message.parentPid); + return writer; + }; + + /** + * Encodes the specified Process message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Process.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.Process + * @static + * @param {google.cloud.securitycenter.v1.IProcess} message Process message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Process.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Process message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.Process + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.Process} Process + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Process.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.cloud.securitycenter.v1.Process(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3: + message.binary = $root.google.cloud.securitycenter.v1.File.decode(reader, reader.uint32()); + break; + case 4: + if (!(message.libraries && message.libraries.length)) + message.libraries = []; + message.libraries.push($root.google.cloud.securitycenter.v1.File.decode(reader, reader.uint32())); + break; + case 5: + message.script = $root.google.cloud.securitycenter.v1.File.decode(reader, reader.uint32()); + break; + case 6: + if (!(message.args && message.args.length)) + message.args = []; + message.args.push(reader.string()); + break; + case 7: + message.argumentsTruncated = reader.bool(); + break; + case 8: + if (!(message.envVariables && message.envVariables.length)) + message.envVariables = []; + message.envVariables.push($root.google.cloud.securitycenter.v1.EnvironmentVariable.decode(reader, reader.uint32())); + break; + case 9: + message.envVariablesTruncated = reader.bool(); + break; + case 10: + message.pid = reader.int64(); + break; + case 11: + message.parentPid = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Process message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.Process + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.Process} Process + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Process.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Process message. + * @function verify + * @memberof google.cloud.securitycenter.v1.Process + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Process.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.binary != null && message.hasOwnProperty("binary")) { + var error = $root.google.cloud.securitycenter.v1.File.verify(message.binary); + if (error) + return "binary." + error; + } + if (message.libraries != null && message.hasOwnProperty("libraries")) { + if (!Array.isArray(message.libraries)) + return "libraries: array expected"; + for (var i = 0; i < message.libraries.length; ++i) { + var error = $root.google.cloud.securitycenter.v1.File.verify(message.libraries[i]); + if (error) + return "libraries." + error; + } + } + if (message.script != null && message.hasOwnProperty("script")) { + var error = $root.google.cloud.securitycenter.v1.File.verify(message.script); + if (error) + return "script." + error; + } + if (message.args != null && message.hasOwnProperty("args")) { + if (!Array.isArray(message.args)) + return "args: array expected"; + for (var i = 0; i < message.args.length; ++i) + if (!$util.isString(message.args[i])) + return "args: string[] expected"; + } + if (message.argumentsTruncated != null && message.hasOwnProperty("argumentsTruncated")) + if (typeof message.argumentsTruncated !== "boolean") + return "argumentsTruncated: boolean expected"; + if (message.envVariables != null && message.hasOwnProperty("envVariables")) { + if (!Array.isArray(message.envVariables)) + return "envVariables: array expected"; + for (var i = 0; i < message.envVariables.length; ++i) { + var error = $root.google.cloud.securitycenter.v1.EnvironmentVariable.verify(message.envVariables[i]); + if (error) + return "envVariables." + error; + } + } + if (message.envVariablesTruncated != null && message.hasOwnProperty("envVariablesTruncated")) + if (typeof message.envVariablesTruncated !== "boolean") + return "envVariablesTruncated: boolean expected"; + if (message.pid != null && message.hasOwnProperty("pid")) + if (!$util.isInteger(message.pid) && !(message.pid && $util.isInteger(message.pid.low) && $util.isInteger(message.pid.high))) + return "pid: integer|Long expected"; + if (message.parentPid != null && message.hasOwnProperty("parentPid")) + if (!$util.isInteger(message.parentPid) && !(message.parentPid && $util.isInteger(message.parentPid.low) && $util.isInteger(message.parentPid.high))) + return "parentPid: integer|Long expected"; + return null; + }; + + /** + * Creates a Process message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.Process + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.Process} Process + */ + Process.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.Process) + return object; + var message = new $root.google.cloud.securitycenter.v1.Process(); + if (object.binary != null) { + if (typeof object.binary !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Process.binary: object expected"); + message.binary = $root.google.cloud.securitycenter.v1.File.fromObject(object.binary); + } + if (object.libraries) { + if (!Array.isArray(object.libraries)) + throw TypeError(".google.cloud.securitycenter.v1.Process.libraries: array expected"); + message.libraries = []; + for (var i = 0; i < object.libraries.length; ++i) { + if (typeof object.libraries[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Process.libraries: object expected"); + message.libraries[i] = $root.google.cloud.securitycenter.v1.File.fromObject(object.libraries[i]); + } + } + if (object.script != null) { + if (typeof object.script !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Process.script: object expected"); + message.script = $root.google.cloud.securitycenter.v1.File.fromObject(object.script); + } + if (object.args) { + if (!Array.isArray(object.args)) + throw TypeError(".google.cloud.securitycenter.v1.Process.args: array expected"); + message.args = []; + for (var i = 0; i < object.args.length; ++i) + message.args[i] = String(object.args[i]); + } + if (object.argumentsTruncated != null) + message.argumentsTruncated = Boolean(object.argumentsTruncated); + if (object.envVariables) { + if (!Array.isArray(object.envVariables)) + throw TypeError(".google.cloud.securitycenter.v1.Process.envVariables: array expected"); + message.envVariables = []; + for (var i = 0; i < object.envVariables.length; ++i) { + if (typeof object.envVariables[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Process.envVariables: object expected"); + message.envVariables[i] = $root.google.cloud.securitycenter.v1.EnvironmentVariable.fromObject(object.envVariables[i]); + } + } + if (object.envVariablesTruncated != null) + message.envVariablesTruncated = Boolean(object.envVariablesTruncated); + if (object.pid != null) + if ($util.Long) + (message.pid = $util.Long.fromValue(object.pid)).unsigned = false; + else if (typeof object.pid === "string") + message.pid = parseInt(object.pid, 10); + else if (typeof object.pid === "number") + message.pid = object.pid; + else if (typeof object.pid === "object") + message.pid = new $util.LongBits(object.pid.low >>> 0, object.pid.high >>> 0).toNumber(); + if (object.parentPid != null) + if ($util.Long) + (message.parentPid = $util.Long.fromValue(object.parentPid)).unsigned = false; + else if (typeof object.parentPid === "string") + message.parentPid = parseInt(object.parentPid, 10); + else if (typeof object.parentPid === "number") + message.parentPid = object.parentPid; + else if (typeof object.parentPid === "object") + message.parentPid = new $util.LongBits(object.parentPid.low >>> 0, object.parentPid.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a Process message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.Process + * @static + * @param {google.cloud.securitycenter.v1.Process} message Process + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Process.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.libraries = []; + object.args = []; + object.envVariables = []; } - if (object.additionalTechniques) { - if (!Array.isArray(object.additionalTechniques)) - throw TypeError(".google.cloud.securitycenter.v1.MitreAttack.additionalTechniques: array expected"); - message.additionalTechniques = []; - for (var i = 0; i < object.additionalTechniques.length; ++i) - switch (object.additionalTechniques[i]) { - default: - case "TECHNIQUE_UNSPECIFIED": - case 0: - message.additionalTechniques[i] = 0; - break; - case "ACTIVE_SCANNING": - case 1: - message.additionalTechniques[i] = 1; - break; - case "SCANNING_IP_BLOCKS": - case 2: - message.additionalTechniques[i] = 2; - break; - case "INGRESS_TOOL_TRANSFER": - case 3: - message.additionalTechniques[i] = 3; - break; - case "NATIVE_API": - case 4: - message.additionalTechniques[i] = 4; - break; - case "SHARED_MODULES": - case 5: - message.additionalTechniques[i] = 5; - break; - case "COMMAND_AND_SCRIPTING_INTERPRETER": - case 6: - message.additionalTechniques[i] = 6; - break; - case "UNIX_SHELL": - case 7: - message.additionalTechniques[i] = 7; - break; - case "RESOURCE_HIJACKING": - case 8: - message.additionalTechniques[i] = 8; - break; - case "PROXY": - case 9: - message.additionalTechniques[i] = 9; - break; - case "EXTERNAL_PROXY": - case 10: - message.additionalTechniques[i] = 10; - break; - case "MULTI_HOP_PROXY": - case 11: - message.additionalTechniques[i] = 11; - break; - case "DYNAMIC_RESOLUTION": - case 12: - message.additionalTechniques[i] = 12; - break; - case "UNSECURED_CREDENTIALS": - case 13: - message.additionalTechniques[i] = 13; - break; - case "VALID_ACCOUNTS": - case 14: - message.additionalTechniques[i] = 14; - break; - case "LOCAL_ACCOUNTS": - case 15: - message.additionalTechniques[i] = 15; - break; - case "CLOUD_ACCOUNTS": - case 16: - message.additionalTechniques[i] = 16; - break; - case "NETWORK_DENIAL_OF_SERVICE": - case 17: - message.additionalTechniques[i] = 17; - break; - case "PERMISSION_GROUPS_DISCOVERY": - case 18: - message.additionalTechniques[i] = 18; - break; - case "CLOUD_GROUPS": - case 19: - message.additionalTechniques[i] = 19; - break; - case "EXFILTRATION_OVER_WEB_SERVICE": - case 20: - message.additionalTechniques[i] = 20; - break; - case "EXFILTRATION_TO_CLOUD_STORAGE": - case 21: - message.additionalTechniques[i] = 21; - break; - case "ACCOUNT_MANIPULATION": - case 22: - message.additionalTechniques[i] = 22; - break; - case "SSH_AUTHORIZED_KEYS": - case 23: - message.additionalTechniques[i] = 23; - break; - case "CREATE_OR_MODIFY_SYSTEM_PROCESS": - case 24: - message.additionalTechniques[i] = 24; - break; - case "STEAL_WEB_SESSION_COOKIE": - case 25: - message.additionalTechniques[i] = 25; - break; - case "MODIFY_CLOUD_COMPUTE_INFRASTRUCTURE": - case 26: - message.additionalTechniques[i] = 26; - break; - case "EXPLOIT_PUBLIC_FACING_APPLICATION": - case 27: - message.additionalTechniques[i] = 27; - break; - case "MODIFY_AUTHENTICATION_PROCESS": - case 28: - message.additionalTechniques[i] = 28; - break; - case "DATA_DESTRUCTION": - case 29: - message.additionalTechniques[i] = 29; - break; - case "DOMAIN_POLICY_MODIFICATION": - case 30: - message.additionalTechniques[i] = 30; - break; - } + if (options.defaults) { + object.binary = null; + object.script = null; + object.argumentsTruncated = false; + object.envVariablesTruncated = false; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.pid = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.pid = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.parentPid = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.parentPid = options.longs === String ? "0" : 0; + } + if (message.binary != null && message.hasOwnProperty("binary")) + object.binary = $root.google.cloud.securitycenter.v1.File.toObject(message.binary, options); + if (message.libraries && message.libraries.length) { + object.libraries = []; + for (var j = 0; j < message.libraries.length; ++j) + object.libraries[j] = $root.google.cloud.securitycenter.v1.File.toObject(message.libraries[j], options); + } + if (message.script != null && message.hasOwnProperty("script")) + object.script = $root.google.cloud.securitycenter.v1.File.toObject(message.script, options); + if (message.args && message.args.length) { + object.args = []; + for (var j = 0; j < message.args.length; ++j) + object.args[j] = message.args[j]; + } + if (message.argumentsTruncated != null && message.hasOwnProperty("argumentsTruncated")) + object.argumentsTruncated = message.argumentsTruncated; + if (message.envVariables && message.envVariables.length) { + object.envVariables = []; + for (var j = 0; j < message.envVariables.length; ++j) + object.envVariables[j] = $root.google.cloud.securitycenter.v1.EnvironmentVariable.toObject(message.envVariables[j], options); + } + if (message.envVariablesTruncated != null && message.hasOwnProperty("envVariablesTruncated")) + object.envVariablesTruncated = message.envVariablesTruncated; + if (message.pid != null && message.hasOwnProperty("pid")) + if (typeof message.pid === "number") + object.pid = options.longs === String ? String(message.pid) : message.pid; + else + object.pid = options.longs === String ? $util.Long.prototype.toString.call(message.pid) : options.longs === Number ? new $util.LongBits(message.pid.low >>> 0, message.pid.high >>> 0).toNumber() : message.pid; + if (message.parentPid != null && message.hasOwnProperty("parentPid")) + if (typeof message.parentPid === "number") + object.parentPid = options.longs === String ? String(message.parentPid) : message.parentPid; + else + object.parentPid = options.longs === String ? $util.Long.prototype.toString.call(message.parentPid) : options.longs === Number ? new $util.LongBits(message.parentPid.low >>> 0, message.parentPid.high >>> 0).toNumber() : message.parentPid; + return object; + }; + + /** + * Converts this Process to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.Process + * @instance + * @returns {Object.} JSON object + */ + Process.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Process; + })(); + + v1.EnvironmentVariable = (function() { + + /** + * Properties of an EnvironmentVariable. + * @memberof google.cloud.securitycenter.v1 + * @interface IEnvironmentVariable + * @property {string|null} [name] EnvironmentVariable name + * @property {string|null} [val] EnvironmentVariable val + */ + + /** + * Constructs a new EnvironmentVariable. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents an EnvironmentVariable. + * @implements IEnvironmentVariable + * @constructor + * @param {google.cloud.securitycenter.v1.IEnvironmentVariable=} [properties] Properties to set + */ + function EnvironmentVariable(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]]; + } + + /** + * EnvironmentVariable name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1.EnvironmentVariable + * @instance + */ + EnvironmentVariable.prototype.name = ""; + + /** + * EnvironmentVariable val. + * @member {string} val + * @memberof google.cloud.securitycenter.v1.EnvironmentVariable + * @instance + */ + EnvironmentVariable.prototype.val = ""; + + /** + * Creates a new EnvironmentVariable instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.EnvironmentVariable + * @static + * @param {google.cloud.securitycenter.v1.IEnvironmentVariable=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.EnvironmentVariable} EnvironmentVariable instance + */ + EnvironmentVariable.create = function create(properties) { + return new EnvironmentVariable(properties); + }; + + /** + * Encodes the specified EnvironmentVariable message. Does not implicitly {@link google.cloud.securitycenter.v1.EnvironmentVariable.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.EnvironmentVariable + * @static + * @param {google.cloud.securitycenter.v1.IEnvironmentVariable} message EnvironmentVariable message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnvironmentVariable.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.val != null && Object.hasOwnProperty.call(message, "val")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.val); + return writer; + }; + + /** + * Encodes the specified EnvironmentVariable message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.EnvironmentVariable.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.EnvironmentVariable + * @static + * @param {google.cloud.securitycenter.v1.IEnvironmentVariable} message EnvironmentVariable message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnvironmentVariable.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnvironmentVariable message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.EnvironmentVariable + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.EnvironmentVariable} EnvironmentVariable + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnvironmentVariable.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.cloud.securitycenter.v1.EnvironmentVariable(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.val = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } } - if (object.version != null) - message.version = String(object.version); return message; }; /** - * Creates a plain object from a MitreAttack message. Also converts values to other types if specified. + * Decodes an EnvironmentVariable message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.EnvironmentVariable + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.EnvironmentVariable} EnvironmentVariable + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnvironmentVariable.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnvironmentVariable message. + * @function verify + * @memberof google.cloud.securitycenter.v1.EnvironmentVariable + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnvironmentVariable.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.val != null && message.hasOwnProperty("val")) + if (!$util.isString(message.val)) + return "val: string expected"; + return null; + }; + + /** + * Creates an EnvironmentVariable message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.EnvironmentVariable + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.EnvironmentVariable} EnvironmentVariable + */ + EnvironmentVariable.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.EnvironmentVariable) + return object; + var message = new $root.google.cloud.securitycenter.v1.EnvironmentVariable(); + if (object.name != null) + message.name = String(object.name); + if (object.val != null) + message.val = String(object.val); + return message; + }; + + /** + * Creates a plain object from an EnvironmentVariable message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.securitycenter.v1.MitreAttack + * @memberof google.cloud.securitycenter.v1.EnvironmentVariable * @static - * @param {google.cloud.securitycenter.v1.MitreAttack} message MitreAttack + * @param {google.cloud.securitycenter.v1.EnvironmentVariable} message EnvironmentVariable * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - MitreAttack.toObject = function toObject(message, options) { + EnvironmentVariable.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) { - object.primaryTechniques = []; - object.additionalTactics = []; - object.additionalTechniques = []; - } if (options.defaults) { - object.primaryTactic = options.enums === String ? "TACTIC_UNSPECIFIED" : 0; - object.version = ""; - } - if (message.primaryTactic != null && message.hasOwnProperty("primaryTactic")) - object.primaryTactic = options.enums === String ? $root.google.cloud.securitycenter.v1.MitreAttack.Tactic[message.primaryTactic] : message.primaryTactic; - if (message.primaryTechniques && message.primaryTechniques.length) { - object.primaryTechniques = []; - for (var j = 0; j < message.primaryTechniques.length; ++j) - object.primaryTechniques[j] = options.enums === String ? $root.google.cloud.securitycenter.v1.MitreAttack.Technique[message.primaryTechniques[j]] : message.primaryTechniques[j]; - } - if (message.additionalTactics && message.additionalTactics.length) { - object.additionalTactics = []; - for (var j = 0; j < message.additionalTactics.length; ++j) - object.additionalTactics[j] = options.enums === String ? $root.google.cloud.securitycenter.v1.MitreAttack.Tactic[message.additionalTactics[j]] : message.additionalTactics[j]; - } - if (message.additionalTechniques && message.additionalTechniques.length) { - object.additionalTechniques = []; - for (var j = 0; j < message.additionalTechniques.length; ++j) - object.additionalTechniques[j] = options.enums === String ? $root.google.cloud.securitycenter.v1.MitreAttack.Technique[message.additionalTechniques[j]] : message.additionalTechniques[j]; + object.name = ""; + object.val = ""; } - if (message.version != null && message.hasOwnProperty("version")) - object.version = message.version; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.val != null && message.hasOwnProperty("val")) + object.val = message.val; return object; }; /** - * Converts this MitreAttack to JSON. + * Converts this EnvironmentVariable to JSON. * @function toJSON - * @memberof google.cloud.securitycenter.v1.MitreAttack + * @memberof google.cloud.securitycenter.v1.EnvironmentVariable * @instance * @returns {Object.} JSON object */ - MitreAttack.prototype.toJSON = function toJSON() { + EnvironmentVariable.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - /** - * Tactic enum. - * @name google.cloud.securitycenter.v1.MitreAttack.Tactic - * @enum {number} - * @property {number} TACTIC_UNSPECIFIED=0 TACTIC_UNSPECIFIED value - * @property {number} RECONNAISSANCE=1 RECONNAISSANCE value - * @property {number} RESOURCE_DEVELOPMENT=2 RESOURCE_DEVELOPMENT value - * @property {number} INITIAL_ACCESS=5 INITIAL_ACCESS value - * @property {number} EXECUTION=3 EXECUTION value - * @property {number} PERSISTENCE=6 PERSISTENCE value - * @property {number} PRIVILEGE_ESCALATION=8 PRIVILEGE_ESCALATION value - * @property {number} DEFENSE_EVASION=7 DEFENSE_EVASION value - * @property {number} CREDENTIAL_ACCESS=9 CREDENTIAL_ACCESS value - * @property {number} DISCOVERY=10 DISCOVERY value - * @property {number} LATERAL_MOVEMENT=11 LATERAL_MOVEMENT value - * @property {number} COLLECTION=12 COLLECTION value - * @property {number} COMMAND_AND_CONTROL=4 COMMAND_AND_CONTROL value - * @property {number} EXFILTRATION=13 EXFILTRATION value - * @property {number} IMPACT=14 IMPACT value - */ - MitreAttack.Tactic = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "TACTIC_UNSPECIFIED"] = 0; - values[valuesById[1] = "RECONNAISSANCE"] = 1; - values[valuesById[2] = "RESOURCE_DEVELOPMENT"] = 2; - values[valuesById[5] = "INITIAL_ACCESS"] = 5; - values[valuesById[3] = "EXECUTION"] = 3; - values[valuesById[6] = "PERSISTENCE"] = 6; - values[valuesById[8] = "PRIVILEGE_ESCALATION"] = 8; - values[valuesById[7] = "DEFENSE_EVASION"] = 7; - values[valuesById[9] = "CREDENTIAL_ACCESS"] = 9; - values[valuesById[10] = "DISCOVERY"] = 10; - values[valuesById[11] = "LATERAL_MOVEMENT"] = 11; - values[valuesById[12] = "COLLECTION"] = 12; - values[valuesById[4] = "COMMAND_AND_CONTROL"] = 4; - values[valuesById[13] = "EXFILTRATION"] = 13; - values[valuesById[14] = "IMPACT"] = 14; - return values; - })(); - - /** - * Technique enum. - * @name google.cloud.securitycenter.v1.MitreAttack.Technique - * @enum {number} - * @property {number} TECHNIQUE_UNSPECIFIED=0 TECHNIQUE_UNSPECIFIED value - * @property {number} ACTIVE_SCANNING=1 ACTIVE_SCANNING value - * @property {number} SCANNING_IP_BLOCKS=2 SCANNING_IP_BLOCKS value - * @property {number} INGRESS_TOOL_TRANSFER=3 INGRESS_TOOL_TRANSFER value - * @property {number} NATIVE_API=4 NATIVE_API value - * @property {number} SHARED_MODULES=5 SHARED_MODULES value - * @property {number} COMMAND_AND_SCRIPTING_INTERPRETER=6 COMMAND_AND_SCRIPTING_INTERPRETER value - * @property {number} UNIX_SHELL=7 UNIX_SHELL value - * @property {number} RESOURCE_HIJACKING=8 RESOURCE_HIJACKING value - * @property {number} PROXY=9 PROXY value - * @property {number} EXTERNAL_PROXY=10 EXTERNAL_PROXY value - * @property {number} MULTI_HOP_PROXY=11 MULTI_HOP_PROXY value - * @property {number} DYNAMIC_RESOLUTION=12 DYNAMIC_RESOLUTION value - * @property {number} UNSECURED_CREDENTIALS=13 UNSECURED_CREDENTIALS value - * @property {number} VALID_ACCOUNTS=14 VALID_ACCOUNTS value - * @property {number} LOCAL_ACCOUNTS=15 LOCAL_ACCOUNTS value - * @property {number} CLOUD_ACCOUNTS=16 CLOUD_ACCOUNTS value - * @property {number} NETWORK_DENIAL_OF_SERVICE=17 NETWORK_DENIAL_OF_SERVICE value - * @property {number} PERMISSION_GROUPS_DISCOVERY=18 PERMISSION_GROUPS_DISCOVERY value - * @property {number} CLOUD_GROUPS=19 CLOUD_GROUPS value - * @property {number} EXFILTRATION_OVER_WEB_SERVICE=20 EXFILTRATION_OVER_WEB_SERVICE value - * @property {number} EXFILTRATION_TO_CLOUD_STORAGE=21 EXFILTRATION_TO_CLOUD_STORAGE value - * @property {number} ACCOUNT_MANIPULATION=22 ACCOUNT_MANIPULATION value - * @property {number} SSH_AUTHORIZED_KEYS=23 SSH_AUTHORIZED_KEYS value - * @property {number} CREATE_OR_MODIFY_SYSTEM_PROCESS=24 CREATE_OR_MODIFY_SYSTEM_PROCESS value - * @property {number} STEAL_WEB_SESSION_COOKIE=25 STEAL_WEB_SESSION_COOKIE value - * @property {number} MODIFY_CLOUD_COMPUTE_INFRASTRUCTURE=26 MODIFY_CLOUD_COMPUTE_INFRASTRUCTURE value - * @property {number} EXPLOIT_PUBLIC_FACING_APPLICATION=27 EXPLOIT_PUBLIC_FACING_APPLICATION value - * @property {number} MODIFY_AUTHENTICATION_PROCESS=28 MODIFY_AUTHENTICATION_PROCESS value - * @property {number} DATA_DESTRUCTION=29 DATA_DESTRUCTION value - * @property {number} DOMAIN_POLICY_MODIFICATION=30 DOMAIN_POLICY_MODIFICATION value - */ - MitreAttack.Technique = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "TECHNIQUE_UNSPECIFIED"] = 0; - values[valuesById[1] = "ACTIVE_SCANNING"] = 1; - values[valuesById[2] = "SCANNING_IP_BLOCKS"] = 2; - values[valuesById[3] = "INGRESS_TOOL_TRANSFER"] = 3; - values[valuesById[4] = "NATIVE_API"] = 4; - values[valuesById[5] = "SHARED_MODULES"] = 5; - values[valuesById[6] = "COMMAND_AND_SCRIPTING_INTERPRETER"] = 6; - values[valuesById[7] = "UNIX_SHELL"] = 7; - values[valuesById[8] = "RESOURCE_HIJACKING"] = 8; - values[valuesById[9] = "PROXY"] = 9; - values[valuesById[10] = "EXTERNAL_PROXY"] = 10; - values[valuesById[11] = "MULTI_HOP_PROXY"] = 11; - values[valuesById[12] = "DYNAMIC_RESOLUTION"] = 12; - values[valuesById[13] = "UNSECURED_CREDENTIALS"] = 13; - values[valuesById[14] = "VALID_ACCOUNTS"] = 14; - values[valuesById[15] = "LOCAL_ACCOUNTS"] = 15; - values[valuesById[16] = "CLOUD_ACCOUNTS"] = 16; - values[valuesById[17] = "NETWORK_DENIAL_OF_SERVICE"] = 17; - values[valuesById[18] = "PERMISSION_GROUPS_DISCOVERY"] = 18; - values[valuesById[19] = "CLOUD_GROUPS"] = 19; - values[valuesById[20] = "EXFILTRATION_OVER_WEB_SERVICE"] = 20; - values[valuesById[21] = "EXFILTRATION_TO_CLOUD_STORAGE"] = 21; - values[valuesById[22] = "ACCOUNT_MANIPULATION"] = 22; - values[valuesById[23] = "SSH_AUTHORIZED_KEYS"] = 23; - values[valuesById[24] = "CREATE_OR_MODIFY_SYSTEM_PROCESS"] = 24; - values[valuesById[25] = "STEAL_WEB_SESSION_COOKIE"] = 25; - values[valuesById[26] = "MODIFY_CLOUD_COMPUTE_INFRASTRUCTURE"] = 26; - values[valuesById[27] = "EXPLOIT_PUBLIC_FACING_APPLICATION"] = 27; - values[valuesById[28] = "MODIFY_AUTHENTICATION_PROCESS"] = 28; - values[valuesById[29] = "DATA_DESTRUCTION"] = 29; - values[valuesById[30] = "DOMAIN_POLICY_MODIFICATION"] = 30; - return values; - })(); - - return MitreAttack; + return EnvironmentVariable; })(); v1.Vulnerability = (function() { diff --git a/packages/google-cloud-securitycenter/protos/protos.json b/packages/google-cloud-securitycenter/protos/protos.json index 55f7a703e3c..fbe4236e0cf 100644 --- a/packages/google-cloud-securitycenter/protos/protos.json +++ b/packages/google-cloud-securitycenter/protos/protos.json @@ -233,6 +233,23 @@ } } }, + "Compliance": { + "fields": { + "standard": { + "type": "string", + "id": 1 + }, + "version": { + "type": "string", + "id": 2 + }, + "ids": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, "Connection": { "fields": { "destinationIp": { @@ -269,6 +286,33 @@ } } }, + "Exfiltration": { + "fields": { + "sources": { + "rule": "repeated", + "type": "ExfilResource", + "id": 1 + }, + "targets": { + "rule": "repeated", + "type": "ExfilResource", + "id": 2 + } + } + }, + "ExfilResource": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "components": { + "rule": "repeated", + "type": "string", + "id": 2 + } + } + }, "ExternalSystem": { "options": { "(google.api.resource).type": "securitycenter.googleapis.com/ExternalSystem", @@ -298,6 +342,34 @@ } } }, + "File": { + "fields": { + "path": { + "type": "string", + "id": 1 + }, + "size": { + "type": "int64", + "id": 2 + }, + "sha256": { + "type": "string", + "id": 3 + }, + "hashedSize": { + "type": "int64", + "id": 4 + }, + "partiallyHashed": { + "type": "bool", + "id": 5 + }, + "contents": { + "type": "string", + "id": 6 + } + } + }, "Finding": { "options": { "(google.api.resource).type": "securitycenter.googleapis.com/Finding", @@ -404,10 +476,24 @@ "type": "string", "id": 28 }, + "processes": { + "rule": "repeated", + "type": "Process", + "id": 30 + }, + "compliances": { + "rule": "repeated", + "type": "Compliance", + "id": 34 + }, "description": { "type": "string", "id": 37 }, + "exfiltration": { + "type": "Exfiltration", + "id": 38 + }, "iamBindings": { "rule": "repeated", "type": "IamBinding", @@ -572,11 +658,67 @@ "EXPLOIT_PUBLIC_FACING_APPLICATION": 27, "MODIFY_AUTHENTICATION_PROCESS": 28, "DATA_DESTRUCTION": 29, - "DOMAIN_POLICY_MODIFICATION": 30 + "DOMAIN_POLICY_MODIFICATION": 30, + "IMPAIR_DEFENSES": 31 } } } }, + "Process": { + "fields": { + "binary": { + "type": "File", + "id": 3 + }, + "libraries": { + "rule": "repeated", + "type": "File", + "id": 4 + }, + "script": { + "type": "File", + "id": 5 + }, + "args": { + "rule": "repeated", + "type": "string", + "id": 6 + }, + "argumentsTruncated": { + "type": "bool", + "id": 7 + }, + "envVariables": { + "rule": "repeated", + "type": "EnvironmentVariable", + "id": 8 + }, + "envVariablesTruncated": { + "type": "bool", + "id": 9 + }, + "pid": { + "type": "int64", + "id": 10 + }, + "parentPid": { + "type": "int64", + "id": 11 + } + } + }, + "EnvironmentVariable": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "val": { + "type": "string", + "id": 2 + } + } + }, "Vulnerability": { "fields": { "cve": { diff --git a/packages/google-cloud-securitycenter/src/v1/security_center_client.ts b/packages/google-cloud-securitycenter/src/v1/security_center_client.ts index ab7dbb39ae4..d5a8a6a2229 100644 --- a/packages/google-cloud-securitycenter/src/v1/security_center_client.ts +++ b/packages/google-cloud-securitycenter/src/v1/security_center_client.ts @@ -6503,6 +6503,183 @@ export class SecurityCenterClient { callSettings ) as AsyncIterable; } + /** + * Gets the latest state of a long-running operation. Clients can use this + * method to poll the operation result at intervals as recommended by the API + * service. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @param {function(?Error, ?Object)=} callback + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing + * [google.longrunning.Operation]{@link + * external:"google.longrunning.Operation"}. + * @return {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * [google.longrunning.Operation]{@link + * external:"google.longrunning.Operation"}. The promise has a method named + * "cancel" which cancels the ongoing API call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * const name = ''; + * const [response] = await client.getOperation({name}); + * // doThingsWith(response) + * ``` + */ + getOperation( + request: protos.google.longrunning.GetOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + > + ): Promise<[protos.google.longrunning.Operation]> { + return this.operationsClient.getOperation(request, options, callback); + } + /** + * Lists operations that match the specified filter in the request. If the + * server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object. + * + * For-await-of syntax is used with the iterable to recursively get response element on-demand. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation collection. + * @param {string} request.filter - The standard list filter. + * @param {number=} request.pageSize - + * The maximum number of resources contained in the underlying API + * response. If page streaming is performed per-resource, this + * parameter does not affect the return value. If page streaming is + * performed per-page, this determines the maximum number of + * resources in a page. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @returns {Object} + * An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * for await (const response of client.listOperationsAsync(request)); + * // doThingsWith(response) + * ``` + */ + listOperationsAsync( + request: protos.google.longrunning.ListOperationsRequest, + options?: gax.CallOptions + ): AsyncIterable { + return this.operationsClient.listOperationsAsync(request, options); + } + /** + * Starts asynchronous cancellation on a long-running operation. The server + * makes a best effort to cancel the operation, but success is not + * guaranteed. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. Clients can use + * {@link Operations.GetOperation} or + * other methods to check whether the cancellation succeeded or whether the + * operation completed despite cancellation. On successful cancellation, + * the operation is not deleted; instead, it becomes an operation with + * an {@link Operation.error} value with a {@link google.rpc.Status.code} of + * 1, corresponding to `Code.CANCELLED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be cancelled. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.cancelOperation({name: ''}); + * ``` + */ + cancelOperation( + request: protos.google.longrunning.CancelOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.CancelOperationRequest, + {} | undefined | null + >, + callback?: Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + > + ): Promise { + return this.operationsClient.cancelOperation(request, options, callback); + } + + /** + * Deletes a long-running operation. This method indicates that the client is + * no longer interested in the operation result. It does not cancel the + * operation. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be deleted. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.deleteOperation({name: ''}); + * ``` + */ + deleteOperation( + request: protos.google.longrunning.DeleteOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + > + ): Promise { + return this.operationsClient.deleteOperation(request, options, callback); + } + // -------------------- // -- Path templates -- // -------------------- diff --git a/packages/google-cloud-securitycenter/src/v1/security_center_proto_list.json b/packages/google-cloud-securitycenter/src/v1/security_center_proto_list.json index 017443b29b4..961f4c1467c 100644 --- a/packages/google-cloud-securitycenter/src/v1/security_center_proto_list.json +++ b/packages/google-cloud-securitycenter/src/v1/security_center_proto_list.json @@ -2,8 +2,11 @@ "../../protos/google/cloud/securitycenter/v1/access.proto", "../../protos/google/cloud/securitycenter/v1/asset.proto", "../../protos/google/cloud/securitycenter/v1/bigquery_export.proto", + "../../protos/google/cloud/securitycenter/v1/compliance.proto", "../../protos/google/cloud/securitycenter/v1/connection.proto", + "../../protos/google/cloud/securitycenter/v1/exfiltration.proto", "../../protos/google/cloud/securitycenter/v1/external_system.proto", + "../../protos/google/cloud/securitycenter/v1/file.proto", "../../protos/google/cloud/securitycenter/v1/finding.proto", "../../protos/google/cloud/securitycenter/v1/folder.proto", "../../protos/google/cloud/securitycenter/v1/iam_binding.proto", @@ -13,6 +16,7 @@ "../../protos/google/cloud/securitycenter/v1/notification_config.proto", "../../protos/google/cloud/securitycenter/v1/notification_message.proto", "../../protos/google/cloud/securitycenter/v1/organization_settings.proto", + "../../protos/google/cloud/securitycenter/v1/process.proto", "../../protos/google/cloud/securitycenter/v1/resource.proto", "../../protos/google/cloud/securitycenter/v1/run_asset_discovery_response.proto", "../../protos/google/cloud/securitycenter/v1/security_marks.proto", diff --git a/packages/google-cloud-securitycenter/test/gapic_security_center_v1.ts b/packages/google-cloud-securitycenter/test/gapic_security_center_v1.ts index 59b36d25bf6..d61d7a1ae08 100644 --- a/packages/google-cloud-securitycenter/test/gapic_security_center_v1.ts +++ b/packages/google-cloud-securitycenter/test/gapic_security_center_v1.ts @@ -6497,6 +6497,311 @@ describe('v1.SecurityCenterClient', () => { ); }); }); + describe('getOperation', () => { + it('invokes getOperation without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const response = await client.getOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.operationsClient.getOperation as SinonStub) + .getCall(0) + .calledWith(request) + ); + }); + it('invokes getOperation without error using callback', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.getOperation( + request, + undefined, + ( + err?: Error | null, + result?: operationsProtos.google.longrunning.Operation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + it('invokes getOperation with error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(async () => { + await client.getOperation(request); + }, expectedError); + assert( + (client.operationsClient.getOperation as SinonStub) + .getCall(0) + .calledWith(request) + ); + }); + }); + describe('cancelOperation', () => { + it('invokes cancelOperation without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = + stubSimpleCall(expectedResponse); + const response = await client.cancelOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.operationsClient.cancelOperation as SinonStub) + .getCall(0) + .calledWith(request) + ); + }); + it('invokes cancelOperation without error using callback', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.cancelOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.cancelOperation as SinonStub).getCall(0)); + }); + it('invokes cancelOperation with error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.cancelOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(async () => { + await client.cancelOperation(request); + }, expectedError); + assert( + (client.operationsClient.cancelOperation as SinonStub) + .getCall(0) + .calledWith(request) + ); + }); + }); + describe('deleteOperation', () => { + it('invokes deleteOperation without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = + stubSimpleCall(expectedResponse); + const response = await client.deleteOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.operationsClient.deleteOperation as SinonStub) + .getCall(0) + .calledWith(request) + ); + }); + it('invokes deleteOperation without error using callback', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.deleteOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.deleteOperation as SinonStub).getCall(0)); + }); + it('invokes deleteOperation with error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.deleteOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(async () => { + await client.deleteOperation(request); + }, expectedError); + assert( + (client.operationsClient.deleteOperation as SinonStub) + .getCall(0) + .calledWith(request) + ); + }); + }); + describe('listOperationsAsync', () => { + it('uses async iteration with listOperations without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedResponse = [ + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + ]; + client.operationsClient.descriptor.listOperations.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = + []; + const iterable = client.operationsClient.listOperationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.operationsClient.descriptor.listOperations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + }); + it('uses async iteration with listOperations with error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.descriptor.listOperations.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.operationsClient.listOperationsAsync(request); + await assert.rejects(async () => { + const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.operationsClient.descriptor.listOperations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + }); + }); describe('Path templates', () => { describe('folderAsset', () => { From 28aa69696db700559d461df49e4f79118662b264 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Mon, 6 Jun 2022 11:51:15 -0400 Subject: [PATCH 317/342] chore(main): release 6.0.0 (#488) See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> Co-authored-by: Owl Bot --- .../google-cloud-securitycenter/CHANGELOG.md | 16 ++++++++++++++++ .../google-cloud-securitycenter/package.json | 2 +- ..._metadata.google.cloud.securitycenter.v1.json | 2 +- ...data.google.cloud.securitycenter.v1beta1.json | 2 +- ...ta.google.cloud.securitycenter.v1p1beta1.json | 2 +- .../samples/package.json | 2 +- 6 files changed, 21 insertions(+), 5 deletions(-) diff --git a/packages/google-cloud-securitycenter/CHANGELOG.md b/packages/google-cloud-securitycenter/CHANGELOG.md index 462a3e83ad3..ad44d90e8f8 100644 --- a/packages/google-cloud-securitycenter/CHANGELOG.md +++ b/packages/google-cloud-securitycenter/CHANGELOG.md @@ -4,6 +4,22 @@ [1]: https://www.npmjs.com/package/@google-cloud/security-center?activeTab=versions +## [6.0.0](https://github.com/googleapis/nodejs-security-center/compare/v5.11.0...v6.0.0) (2022-06-03) + + +### ⚠ BREAKING CHANGES + +* update library to use Node 12 (#486) + +### Features + +* Add compliances, processes and exfiltration fields to findings attributes. They contain compliance information about a security standard indicating unmet recommendations, represents operating system processes, and data exfiltration attempt of one... ([#490](https://github.com/googleapis/nodejs-security-center/issues/490)) ([c825bb4](https://github.com/googleapis/nodejs-security-center/commit/c825bb42d8a9fcef8f256b25d8d47404895308c7)) + + +### Build System + +* update library to use Node 12 ([#486](https://github.com/googleapis/nodejs-security-center/issues/486)) ([eb30121](https://github.com/googleapis/nodejs-security-center/commit/eb3012173641734f6ac459560074aa91ffee02f7)) + ## [5.11.0](https://github.com/googleapis/nodejs-security-center/compare/v5.10.0...v5.11.0) (2022-05-06) diff --git a/packages/google-cloud-securitycenter/package.json b/packages/google-cloud-securitycenter/package.json index e865175d86c..843c4b3499a 100644 --- a/packages/google-cloud-securitycenter/package.json +++ b/packages/google-cloud-securitycenter/package.json @@ -1,7 +1,7 @@ { "name": "@google-cloud/security-center", "description": "Cloud Security Command Center API client for Node.js", - "version": "5.11.0", + "version": "6.0.0", "license": "Apache-2.0", "author": "Google LLC", "engines": { diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/snippet_metadata.google.cloud.securitycenter.v1.json b/packages/google-cloud-securitycenter/samples/generated/v1/snippet_metadata.google.cloud.securitycenter.v1.json index e8b8231732a..638ab222110 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/snippet_metadata.google.cloud.securitycenter.v1.json +++ b/packages/google-cloud-securitycenter/samples/generated/v1/snippet_metadata.google.cloud.securitycenter.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-securitycenter", - "version": "5.11.0", + "version": "6.0.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-securitycenter/samples/generated/v1beta1/snippet_metadata.google.cloud.securitycenter.v1beta1.json b/packages/google-cloud-securitycenter/samples/generated/v1beta1/snippet_metadata.google.cloud.securitycenter.v1beta1.json index fe07d9feb2e..9ca3b162535 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1beta1/snippet_metadata.google.cloud.securitycenter.v1beta1.json +++ b/packages/google-cloud-securitycenter/samples/generated/v1beta1/snippet_metadata.google.cloud.securitycenter.v1beta1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-securitycenter", - "version": "5.11.0", + "version": "6.0.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/snippet_metadata.google.cloud.securitycenter.v1p1beta1.json b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/snippet_metadata.google.cloud.securitycenter.v1p1beta1.json index bff11976d78..cb575d54ea5 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/snippet_metadata.google.cloud.securitycenter.v1p1beta1.json +++ b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/snippet_metadata.google.cloud.securitycenter.v1p1beta1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-securitycenter", - "version": "5.11.0", + "version": "6.0.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-securitycenter/samples/package.json b/packages/google-cloud-securitycenter/samples/package.json index 2ecec9af2e9..cda68190c07 100644 --- a/packages/google-cloud-securitycenter/samples/package.json +++ b/packages/google-cloud-securitycenter/samples/package.json @@ -14,7 +14,7 @@ "license": "Apache-2.0", "dependencies": { "@google-cloud/pubsub": "^2.0.0", - "@google-cloud/security-center": "^5.11.0" + "@google-cloud/security-center": "^6.0.0" }, "devDependencies": { "chai": "^4.2.0", From 9c09482e8f30b69457bfcc3007aabd4a38bd3843 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 7 Jun 2022 22:07:25 +0200 Subject: [PATCH 318/342] chore(deps): update dependency @google-cloud/pubsub to v3 (#489) --- packages/google-cloud-securitycenter/samples/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-securitycenter/samples/package.json b/packages/google-cloud-securitycenter/samples/package.json index cda68190c07..bff756a32db 100644 --- a/packages/google-cloud-securitycenter/samples/package.json +++ b/packages/google-cloud-securitycenter/samples/package.json @@ -13,7 +13,7 @@ }, "license": "Apache-2.0", "dependencies": { - "@google-cloud/pubsub": "^2.0.0", + "@google-cloud/pubsub": "^3.0.0", "@google-cloud/security-center": "^6.0.0" }, "devDependencies": { From dc3414d4791e58c43dc6946026b0a458caeac60a Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 14 Jun 2022 00:15:24 +0200 Subject: [PATCH 319/342] chore(deps): update dependency jsdoc-region-tag to v2 (#494) --- packages/google-cloud-securitycenter/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-securitycenter/package.json b/packages/google-cloud-securitycenter/package.json index 843c4b3499a..d2761cdb126 100644 --- a/packages/google-cloud-securitycenter/package.json +++ b/packages/google-cloud-securitycenter/package.json @@ -52,7 +52,7 @@ "gts": "^3.1.0", "jsdoc": "^3.6.2", "jsdoc-fresh": "^1.0.1", - "jsdoc-region-tag": "^1.0.2", + "jsdoc-region-tag": "^2.0.0", "linkinator": "^2.0.0", "mocha": "^9.2.2", "null-loader": "^4.0.0", From 4de3d19c663d2a5c7dd861673edcea84759b2ac4 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 14 Jun 2022 00:24:16 +0200 Subject: [PATCH 320/342] chore(deps): update dependency jsdoc-fresh to v2 (#493) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [jsdoc-fresh](https://togithub.com/googleapis/jsdoc-fresh) | [`^1.0.1` -> `^2.0.0`](https://renovatebot.com/diffs/npm/jsdoc-fresh/1.1.1/2.0.0) | [![age](https://badges.renovateapi.com/packages/npm/jsdoc-fresh/2.0.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/jsdoc-fresh/2.0.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/jsdoc-fresh/2.0.0/compatibility-slim/1.1.1)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/jsdoc-fresh/2.0.0/confidence-slim/1.1.1)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
googleapis/jsdoc-fresh ### [`v2.0.0`](https://togithub.com/googleapis/jsdoc-fresh/blob/HEAD/CHANGELOG.md#​200-httpsgithubcomgoogleapisjsdoc-freshcomparev111v200-2022-05-18) [Compare Source](https://togithub.com/googleapis/jsdoc-fresh/compare/v1.1.1...v2.0.0) ##### ⚠ BREAKING CHANGES - update library to use Node 12 ([#​108](https://togithub.com/googleapis/jsdoc-fresh/issues/108)) ##### Build System - update library to use Node 12 ([#​108](https://togithub.com/googleapis/jsdoc-fresh/issues/108)) ([e61c223](https://togithub.com/googleapis/jsdoc-fresh/commit/e61c2238db8900e339e5fe7fb8aea09642290182)) ##### [1.1.1](https://www.github.com/googleapis/jsdoc-fresh/compare/v1.1.0...v1.1.1) (2021-08-11) ##### Bug Fixes - **build:** migrate to using main branch ([#​83](https://www.togithub.com/googleapis/jsdoc-fresh/issues/83)) ([9474adb](https://www.github.com/googleapis/jsdoc-fresh/commit/9474adbf0d559d319ff207397ba2be6b557999ac))
--- ### Configuration 📅 **Schedule**: Branch creation - "after 9am and before 3pm" (UTC), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/nodejs-security-center). --- packages/google-cloud-securitycenter/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-securitycenter/package.json b/packages/google-cloud-securitycenter/package.json index d2761cdb126..f549de7eb1b 100644 --- a/packages/google-cloud-securitycenter/package.json +++ b/packages/google-cloud-securitycenter/package.json @@ -51,7 +51,7 @@ "c8": "^7.0.0", "gts": "^3.1.0", "jsdoc": "^3.6.2", - "jsdoc-fresh": "^1.0.1", + "jsdoc-fresh": "^2.0.0", "jsdoc-region-tag": "^2.0.0", "linkinator": "^2.0.0", "mocha": "^9.2.2", From b52ed090e330e7379183165790d54e13482f587d Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Wed, 29 Jun 2022 17:27:54 -0700 Subject: [PATCH 321/342] feat: support regapic LRO (#495) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: support regapic LRO Use gapic-generator-typescript v2.15.1. PiperOrigin-RevId: 456946341 Source-Link: https://github.com/googleapis/googleapis/commit/88fd18d9d3b872b3d06a3d9392879f50b5bf3ce5 Source-Link: https://github.com/googleapis/googleapis-gen/commit/accfa371f667439313335c64042b063c1c53102e Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYWNjZmEzNzFmNjY3NDM5MzEzMzM1YzY0MDQyYjA2M2MxYzUzMTAyZSJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot --- .../src/v1/security_center_client.ts | 44 +++++++++++++----- .../src/v1beta1/security_center_client.ts | 45 ++++++++++++++----- .../src/v1p1beta1/security_center_client.ts | 45 ++++++++++++++----- 3 files changed, 98 insertions(+), 36 deletions(-) diff --git a/packages/google-cloud-securitycenter/src/v1/security_center_client.ts b/packages/google-cloud-securitycenter/src/v1/security_center_client.ts index d5a8a6a2229..e8d49073b06 100644 --- a/packages/google-cloud-securitycenter/src/v1/security_center_client.ts +++ b/packages/google-cloud-securitycenter/src/v1/security_center_client.ts @@ -23,6 +23,7 @@ import { CallOptions, Descriptors, ClientOptions, + GrpcClientOptions, LROperation, PaginationCallback, GaxCall, @@ -72,7 +73,7 @@ export class SecurityCenterClient { * * @param {object} [options] - The configuration object. * The options accepted by the constructor are described in detail - * in [this document](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#creating-the-client-instance). + * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). * The common options are: * @param {object} [options.credentials] - Credentials object. * @param {string} [options.credentials.client_email] @@ -95,11 +96,10 @@ export class SecurityCenterClient { * API remote host. * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. * Follows the structure of {@link gapicConfig}. - * @param {boolean} [options.fallback] - Use HTTP fallback mode. - * In fallback mode, a special browser-compatible transport implementation is used - * instead of gRPC transport. In browser context (if the `window` object is defined) - * the fallback mode is enabled automatically; set `options.fallback` to `false` - * if you need to override this behavior. + * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode. + * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * For more information, please check the + * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. */ constructor(opts?: ClientOptions) { // Ensure that options include all the required fields. @@ -303,16 +303,36 @@ export class SecurityCenterClient { }; const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos); - // This API contains "long-running operations", which return a // an Operation object that allows for tracking of the operation, // rather than holding a request open. - + const lroOptions: GrpcClientOptions = { + auth: this.auth, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined, + }; + if (opts.fallback === 'rest') { + lroOptions.protoJson = protoFilesRoot; + lroOptions.httpRules = [ + { + selector: 'google.longrunning.Operations.CancelOperation', + post: '/v1/{name=organizations/*/operations/*}:cancel', + }, + { + selector: 'google.longrunning.Operations.DeleteOperation', + delete: '/v1/{name=organizations/*/operations/*}', + }, + { + selector: 'google.longrunning.Operations.GetOperation', + get: '/v1/{name=organizations/*/operations/*}', + }, + { + selector: 'google.longrunning.Operations.ListOperations', + get: '/v1/{name=organizations/*/operations}', + }, + ]; + } this.operationsClient = this._gaxModule - .lro({ - auth: this.auth, - grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined, - }) + .lro(lroOptions) .operationsClient(opts); const bulkMuteFindingsResponse = protoFilesRoot.lookup( '.google.cloud.securitycenter.v1.BulkMuteFindingsResponse' diff --git a/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.ts b/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.ts index 4f0c0587188..2f018a39cc7 100644 --- a/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.ts +++ b/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.ts @@ -23,6 +23,7 @@ import { CallOptions, Descriptors, ClientOptions, + GrpcClientOptions, LROperation, PaginationCallback, GaxCall, @@ -72,7 +73,7 @@ export class SecurityCenterClient { * * @param {object} [options] - The configuration object. * The options accepted by the constructor are described in detail - * in [this document](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#creating-the-client-instance). + * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). * The common options are: * @param {object} [options.credentials] - Credentials object. * @param {string} [options.credentials.client_email] @@ -95,11 +96,10 @@ export class SecurityCenterClient { * API remote host. * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. * Follows the structure of {@link gapicConfig}. - * @param {boolean} [options.fallback] - Use HTTP fallback mode. - * In fallback mode, a special browser-compatible transport implementation is used - * instead of gRPC transport. In browser context (if the `window` object is defined) - * the fallback mode is enabled automatically; set `options.fallback` to `false` - * if you need to override this behavior. + * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode. + * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * For more information, please check the + * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. */ constructor(opts?: ClientOptions) { // Ensure that options include all the required fields. @@ -223,16 +223,37 @@ export class SecurityCenterClient { }; const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos); - // This API contains "long-running operations", which return a // an Operation object that allows for tracking of the operation, // rather than holding a request open. - + const lroOptions: GrpcClientOptions = { + auth: this.auth, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined, + }; + if (opts.fallback === 'rest') { + lroOptions.protoJson = protoFilesRoot; + lroOptions.httpRules = [ + { + selector: 'google.longrunning.Operations.CancelOperation', + post: '/v1beta1/{name=organizations/*/operations/*}:cancel', + body: '*', + }, + { + selector: 'google.longrunning.Operations.DeleteOperation', + delete: '/v1beta1/{name=organizations/*/operations/*}', + }, + { + selector: 'google.longrunning.Operations.GetOperation', + get: '/v1beta1/{name=organizations/*/operations/*}', + }, + { + selector: 'google.longrunning.Operations.ListOperations', + get: '/v1beta1/{name=organizations/*/operations}', + }, + ]; + } this.operationsClient = this._gaxModule - .lro({ - auth: this.auth, - grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined, - }) + .lro(lroOptions) .operationsClient(opts); const runAssetDiscoveryResponse = protoFilesRoot.lookup( '.google.protobuf.Empty' diff --git a/packages/google-cloud-securitycenter/src/v1p1beta1/security_center_client.ts b/packages/google-cloud-securitycenter/src/v1p1beta1/security_center_client.ts index 48d371cea5a..de6a5388cc0 100644 --- a/packages/google-cloud-securitycenter/src/v1p1beta1/security_center_client.ts +++ b/packages/google-cloud-securitycenter/src/v1p1beta1/security_center_client.ts @@ -23,6 +23,7 @@ import { CallOptions, Descriptors, ClientOptions, + GrpcClientOptions, LROperation, PaginationCallback, GaxCall, @@ -72,7 +73,7 @@ export class SecurityCenterClient { * * @param {object} [options] - The configuration object. * The options accepted by the constructor are described in detail - * in [this document](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#creating-the-client-instance). + * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). * The common options are: * @param {object} [options.credentials] - Credentials object. * @param {string} [options.credentials.client_email] @@ -95,11 +96,10 @@ export class SecurityCenterClient { * API remote host. * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. * Follows the structure of {@link gapicConfig}. - * @param {boolean} [options.fallback] - Use HTTP fallback mode. - * In fallback mode, a special browser-compatible transport implementation is used - * instead of gRPC transport. In browser context (if the `window` object is defined) - * the fallback mode is enabled automatically; set `options.fallback` to `false` - * if you need to override this behavior. + * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode. + * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * For more information, please check the + * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. */ constructor(opts?: ClientOptions) { // Ensure that options include all the required fields. @@ -263,16 +263,37 @@ export class SecurityCenterClient { }; const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos); - // This API contains "long-running operations", which return a // an Operation object that allows for tracking of the operation, // rather than holding a request open. - + const lroOptions: GrpcClientOptions = { + auth: this.auth, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined, + }; + if (opts.fallback === 'rest') { + lroOptions.protoJson = protoFilesRoot; + lroOptions.httpRules = [ + { + selector: 'google.longrunning.Operations.CancelOperation', + post: '/v1p1beta1/{name=organizations/*/operations/*}:cancel', + body: '*', + }, + { + selector: 'google.longrunning.Operations.DeleteOperation', + delete: '/v1p1beta1/{name=organizations/*/operations/*}', + }, + { + selector: 'google.longrunning.Operations.GetOperation', + get: '/v1p1beta1/{name=organizations/*/operations/*}', + }, + { + selector: 'google.longrunning.Operations.ListOperations', + get: '/v1p1beta1/{name=organizations/*/operations}', + }, + ]; + } this.operationsClient = this._gaxModule - .lro({ - auth: this.auth, - grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined, - }) + .lro(lroOptions) .operationsClient(opts); const runAssetDiscoveryResponse = protoFilesRoot.lookup( '.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse' From 3d29de27af381f3d8aed15f69889c094fe88e6bd Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Mon, 4 Jul 2022 14:26:37 -0400 Subject: [PATCH 322/342] feat: Added contacts field to findings attributes, specifying Essential Contacts defined at org, folder or project level within a GCP org feat: Added process signature fields to the indicator attribute that helps surface multiple types of signature defined IOCs PiperOrigin-RevId: 458537238 Source-Link: https://github.com/googleapis/googleapis/commit/7fdec62959f080693e8e137c7772970cb45ecffd Source-Link: https://github.com/googleapis/googleapis-gen/commit/bb340e3223539a792a204be2a794fb2ad3724f68 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYmIzNDBlMzIyMzUzOWE3OTJhMjA0YmUyYTc5NGZiMmFkMzcyNGY2OCJ9 See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Use gapic-generator-typescript v2.15.2. PiperOrigin-RevId: 458552034 Source-Link: https://github.com/googleapis/googleapis/commit/ae65014049c6eb195741d7efbd0b10bee3f83d4f Source-Link: https://github.com/googleapis/googleapis-gen/commit/b09ede435cce110446d4ab9f62a081b571d37e3f Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYjA5ZWRlNDM1Y2NlMTEwNDQ2ZDRhYjlmNjJhMDgxYjU3MWQzN2UzZiJ9 See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot --- .../securitycenter/v1/contact_details.proto | 37 + .../google/cloud/securitycenter/v1/file.proto | 2 +- .../cloud/securitycenter/v1/finding.proto | 30 +- .../cloud/securitycenter/v1/indicator.proto | 42 + .../cloud/securitycenter/v1/process.proto | 4 + .../protos/protos.d.ts | 588 ++++++ .../protos/protos.js | 1716 +++++++++++++++-- .../protos/protos.json | 93 + .../src/v1/security_center_proto_list.json | 1 + 9 files changed, 2346 insertions(+), 167 deletions(-) create mode 100644 packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/contact_details.proto diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/contact_details.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/contact_details.proto new file mode 100644 index 00000000000..c282d325b69 --- /dev/null +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/contact_details.proto @@ -0,0 +1,37 @@ +// 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.cloud.securitycenter.v1; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1;securitycenter"; +option java_multiple_files = true; +option java_outer_classname = "ContactDetailsProto"; +option java_package = "com.google.cloud.securitycenter.v1"; +option php_namespace = "Google\\Cloud\\SecurityCenter\\V1"; +option ruby_package = "Google::Cloud::SecurityCenter::V1"; + +// The details pertaining to specific contacts +message ContactDetails { + // A list of contacts + repeated Contact contacts = 1; +} + +// Representa a single contact's email address +message Contact { + // An email address e.g. "person123@company.com" + string email = 1; +} diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/file.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/file.proto index 97ba1d0bde3..d802dda6ebf 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/file.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/file.proto @@ -34,7 +34,7 @@ message File { int64 size = 2; // SHA256 hash of the first hashed_size bytes of the file encoded as a - // hex string. If hashed_size == size, hash_sha256 represents the SHA256 hash + // hex string. If hashed_size == size, sha256 represents the SHA256 hash // of the entire file. string sha256 = 3; diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/finding.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/finding.proto index e43a90c285e..70aa90e9952 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/finding.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/finding.proto @@ -21,6 +21,7 @@ import "google/api/resource.proto"; import "google/cloud/securitycenter/v1/access.proto"; import "google/cloud/securitycenter/v1/compliance.proto"; import "google/cloud/securitycenter/v1/connection.proto"; +import "google/cloud/securitycenter/v1/contact_details.proto"; import "google/cloud/securitycenter/v1/exfiltration.proto"; import "google/cloud/securitycenter/v1/external_system.proto"; import "google/cloud/securitycenter/v1/iam_binding.proto"; @@ -254,13 +255,11 @@ message Finding { Vulnerability vulnerability = 20; // Output only. The most recent time this finding was muted or unmuted. - google.protobuf.Timestamp mute_update_time = 21 - [(google.api.field_behavior) = OUTPUT_ONLY]; + google.protobuf.Timestamp mute_update_time = 21 [(google.api.field_behavior) = OUTPUT_ONLY]; - // Output only. Third party SIEM/SOAR fields within SCC, contains external - // system information and external system finding fields. - map external_systems = 22 - [(google.api.field_behavior) = OUTPUT_ONLY]; + // Output only. Third party SIEM/SOAR fields within SCC, contains external system + // information and external system finding fields. + map external_systems = 22 [(google.api.field_behavior) = OUTPUT_ONLY]; // MITRE ATT&CK tactics and techniques related to this finding. // See: https://attack.mitre.org @@ -282,6 +281,25 @@ message Finding { // Represents operating system processes associated with the Finding. repeated Process processes = 30; + // Output only. Map containing the point of contacts for the given finding. The key + // represents the type of contact, while the value contains a list of all the + // contacts that pertain. Please refer to: + // https://cloud.google.com/resource-manager/docs/managing-notification-contacts#notification-categories + // + // { + // "security": { + // "contacts": [ + // { + // "email": "person1@company.com" + // }, + // { + // "email": "person2@company.com" + // } + // ] + // } + // } + map contacts = 33 [(google.api.field_behavior) = OUTPUT_ONLY]; + // Contains compliance information for security standards associated to the // finding. repeated Compliance compliances = 34; diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/indicator.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/indicator.proto index 92234776447..e14e57abc05 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/indicator.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/indicator.proto @@ -29,9 +29,51 @@ option ruby_package = "Google::Cloud::SecurityCenter::V1"; // operating system that, with high confidence, indicates a computer intrusion. // Reference: https://en.wikipedia.org/wiki/Indicator_of_compromise message Indicator { + // Indicates what signature matched this process. + message ProcessSignature { + // A signature corresponding to memory page hashes. + message MemoryHashSignature { + // Memory hash detection contributing to the binary family match. + message Detection { + // The name of the binary associated with the memory hash + // signature detection. + string binary = 2; + + // The percentage of memory page hashes in the signature + // that were matched. + double percent_pages_matched = 3; + } + + // The binary family. + string binary_family = 1; + + // The list of memory hash detections contributing to the binary family + // match. + repeated Detection detections = 4; + } + + // A signature corresponding to a YARA rule. + message YaraRuleSignature { + // The name of the YARA rule. + string yara_rule = 5; + } + + oneof signature { + // Signature indicating that a binary family was matched. + MemoryHashSignature memory_hash_signature = 6; + + // Signature indicating that a YARA rule was matched. + YaraRuleSignature yara_rule_signature = 7; + } + } + // List of ip addresses associated to the Finding. repeated string ip_addresses = 1; // List of domains associated to the Finding. repeated string domains = 2; + + // The list of matched signatures indicating that the given + // process is present in the environment. + repeated ProcessSignature signatures = 3; } diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/process.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/process.proto index 185f0467fe0..480714be47d 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/process.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/process.proto @@ -28,6 +28,10 @@ option ruby_package = "Google::Cloud::SecurityCenter::V1"; // Represents an operating system process. message Process { + // The process name visible in utilities like `top` and `ps`; it can + // be accessed via `/proc/[pid]/comm` and changed with `prctl(PR_SET_NAME)`. + string name = 12; + // File information for the process executable. File binary = 3; diff --git a/packages/google-cloud-securitycenter/protos/protos.d.ts b/packages/google-cloud-securitycenter/protos/protos.d.ts index bc6492bae0b..f63829d8734 100644 --- a/packages/google-cloud-securitycenter/protos/protos.d.ts +++ b/packages/google-cloud-securitycenter/protos/protos.d.ts @@ -1158,6 +1158,186 @@ export namespace google { } } + /** Properties of a ContactDetails. */ + interface IContactDetails { + + /** ContactDetails contacts */ + contacts?: (google.cloud.securitycenter.v1.IContact[]|null); + } + + /** Represents a ContactDetails. */ + class ContactDetails implements IContactDetails { + + /** + * Constructs a new ContactDetails. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IContactDetails); + + /** ContactDetails contacts. */ + public contacts: google.cloud.securitycenter.v1.IContact[]; + + /** + * Creates a new ContactDetails instance using the specified properties. + * @param [properties] Properties to set + * @returns ContactDetails instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IContactDetails): google.cloud.securitycenter.v1.ContactDetails; + + /** + * Encodes the specified ContactDetails message. Does not implicitly {@link google.cloud.securitycenter.v1.ContactDetails.verify|verify} messages. + * @param message ContactDetails message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IContactDetails, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ContactDetails message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ContactDetails.verify|verify} messages. + * @param message ContactDetails message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IContactDetails, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ContactDetails message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ContactDetails + * @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.cloud.securitycenter.v1.ContactDetails; + + /** + * Decodes a ContactDetails message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ContactDetails + * @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.cloud.securitycenter.v1.ContactDetails; + + /** + * Verifies a ContactDetails 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 ContactDetails message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ContactDetails + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.ContactDetails; + + /** + * Creates a plain object from a ContactDetails message. Also converts values to other types if specified. + * @param message ContactDetails + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.ContactDetails, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ContactDetails to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a Contact. */ + interface IContact { + + /** Contact email */ + email?: (string|null); + } + + /** Represents a Contact. */ + class Contact implements IContact { + + /** + * Constructs a new Contact. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IContact); + + /** Contact email. */ + public email: string; + + /** + * Creates a new Contact instance using the specified properties. + * @param [properties] Properties to set + * @returns Contact instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IContact): google.cloud.securitycenter.v1.Contact; + + /** + * Encodes the specified Contact message. Does not implicitly {@link google.cloud.securitycenter.v1.Contact.verify|verify} messages. + * @param message Contact message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IContact, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Contact message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Contact.verify|verify} messages. + * @param message Contact message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IContact, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Contact message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Contact + * @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.cloud.securitycenter.v1.Contact; + + /** + * Decodes a Contact message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Contact + * @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.cloud.securitycenter.v1.Contact; + + /** + * Verifies a Contact 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 Contact message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Contact + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.Contact; + + /** + * Creates a plain object from a Contact message. Also converts values to other types if specified. + * @param message Contact + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.Contact, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Contact to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + /** Properties of an Exfiltration. */ interface IExfiltration { @@ -1656,6 +1836,9 @@ export namespace google { /** Finding processes */ processes?: (google.cloud.securitycenter.v1.IProcess[]|null); + /** Finding contacts */ + contacts?: ({ [k: string]: google.cloud.securitycenter.v1.IContactDetails }|null); + /** Finding compliances */ compliances?: (google.cloud.securitycenter.v1.ICompliance[]|null); @@ -1750,6 +1933,9 @@ export namespace google { /** Finding processes. */ public processes: google.cloud.securitycenter.v1.IProcess[]; + /** Finding contacts. */ + public contacts: { [k: string]: google.cloud.securitycenter.v1.IContactDetails }; + /** Finding compliances. */ public compliances: google.cloud.securitycenter.v1.ICompliance[]; @@ -1993,6 +2179,9 @@ export namespace google { /** Indicator domains */ domains?: (string[]|null); + + /** Indicator signatures */ + signatures?: (google.cloud.securitycenter.v1.Indicator.IProcessSignature[]|null); } /** Represents an Indicator. */ @@ -2010,6 +2199,9 @@ export namespace google { /** Indicator domains. */ public domains: string[]; + /** Indicator signatures. */ + public signatures: google.cloud.securitycenter.v1.Indicator.IProcessSignature[]; + /** * Creates a new Indicator instance using the specified properties. * @param [properties] Properties to set @@ -2081,6 +2273,396 @@ export namespace google { public toJSON(): { [k: string]: any }; } + namespace Indicator { + + /** Properties of a ProcessSignature. */ + interface IProcessSignature { + + /** ProcessSignature memoryHashSignature */ + memoryHashSignature?: (google.cloud.securitycenter.v1.Indicator.ProcessSignature.IMemoryHashSignature|null); + + /** ProcessSignature yaraRuleSignature */ + yaraRuleSignature?: (google.cloud.securitycenter.v1.Indicator.ProcessSignature.IYaraRuleSignature|null); + } + + /** Represents a ProcessSignature. */ + class ProcessSignature implements IProcessSignature { + + /** + * Constructs a new ProcessSignature. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.Indicator.IProcessSignature); + + /** ProcessSignature memoryHashSignature. */ + public memoryHashSignature?: (google.cloud.securitycenter.v1.Indicator.ProcessSignature.IMemoryHashSignature|null); + + /** ProcessSignature yaraRuleSignature. */ + public yaraRuleSignature?: (google.cloud.securitycenter.v1.Indicator.ProcessSignature.IYaraRuleSignature|null); + + /** ProcessSignature signature. */ + public signature?: ("memoryHashSignature"|"yaraRuleSignature"); + + /** + * Creates a new ProcessSignature instance using the specified properties. + * @param [properties] Properties to set + * @returns ProcessSignature instance + */ + public static create(properties?: google.cloud.securitycenter.v1.Indicator.IProcessSignature): google.cloud.securitycenter.v1.Indicator.ProcessSignature; + + /** + * Encodes the specified ProcessSignature message. Does not implicitly {@link google.cloud.securitycenter.v1.Indicator.ProcessSignature.verify|verify} messages. + * @param message ProcessSignature message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.Indicator.IProcessSignature, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ProcessSignature message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Indicator.ProcessSignature.verify|verify} messages. + * @param message ProcessSignature message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.Indicator.IProcessSignature, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ProcessSignature message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ProcessSignature + * @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.cloud.securitycenter.v1.Indicator.ProcessSignature; + + /** + * Decodes a ProcessSignature message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ProcessSignature + * @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.cloud.securitycenter.v1.Indicator.ProcessSignature; + + /** + * Verifies a ProcessSignature 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 ProcessSignature message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ProcessSignature + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.Indicator.ProcessSignature; + + /** + * Creates a plain object from a ProcessSignature message. Also converts values to other types if specified. + * @param message ProcessSignature + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.Indicator.ProcessSignature, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ProcessSignature to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace ProcessSignature { + + /** Properties of a MemoryHashSignature. */ + interface IMemoryHashSignature { + + /** MemoryHashSignature binaryFamily */ + binaryFamily?: (string|null); + + /** MemoryHashSignature detections */ + detections?: (google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.IDetection[]|null); + } + + /** Represents a MemoryHashSignature. */ + class MemoryHashSignature implements IMemoryHashSignature { + + /** + * Constructs a new MemoryHashSignature. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.Indicator.ProcessSignature.IMemoryHashSignature); + + /** MemoryHashSignature binaryFamily. */ + public binaryFamily: string; + + /** MemoryHashSignature detections. */ + public detections: google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.IDetection[]; + + /** + * Creates a new MemoryHashSignature instance using the specified properties. + * @param [properties] Properties to set + * @returns MemoryHashSignature instance + */ + public static create(properties?: google.cloud.securitycenter.v1.Indicator.ProcessSignature.IMemoryHashSignature): google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature; + + /** + * Encodes the specified MemoryHashSignature message. Does not implicitly {@link google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.verify|verify} messages. + * @param message MemoryHashSignature message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.Indicator.ProcessSignature.IMemoryHashSignature, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MemoryHashSignature message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.verify|verify} messages. + * @param message MemoryHashSignature message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.Indicator.ProcessSignature.IMemoryHashSignature, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MemoryHashSignature message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MemoryHashSignature + * @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.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature; + + /** + * Decodes a MemoryHashSignature message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MemoryHashSignature + * @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.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature; + + /** + * Verifies a MemoryHashSignature 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 MemoryHashSignature message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MemoryHashSignature + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature; + + /** + * Creates a plain object from a MemoryHashSignature message. Also converts values to other types if specified. + * @param message MemoryHashSignature + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MemoryHashSignature to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace MemoryHashSignature { + + /** Properties of a Detection. */ + interface IDetection { + + /** Detection binary */ + binary?: (string|null); + + /** Detection percentPagesMatched */ + percentPagesMatched?: (number|null); + } + + /** Represents a Detection. */ + class Detection implements IDetection { + + /** + * Constructs a new Detection. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.IDetection); + + /** Detection binary. */ + public binary: string; + + /** Detection percentPagesMatched. */ + public percentPagesMatched: number; + + /** + * Creates a new Detection instance using the specified properties. + * @param [properties] Properties to set + * @returns Detection instance + */ + public static create(properties?: google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.IDetection): google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.Detection; + + /** + * Encodes the specified Detection message. Does not implicitly {@link google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.Detection.verify|verify} messages. + * @param message Detection message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.IDetection, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Detection message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.Detection.verify|verify} messages. + * @param message Detection message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.IDetection, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Detection message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Detection + * @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.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.Detection; + + /** + * Decodes a Detection message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Detection + * @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.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.Detection; + + /** + * Verifies a Detection 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 Detection message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Detection + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.Detection; + + /** + * Creates a plain object from a Detection message. Also converts values to other types if specified. + * @param message Detection + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.Detection, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Detection to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** Properties of a YaraRuleSignature. */ + interface IYaraRuleSignature { + + /** YaraRuleSignature yaraRule */ + yaraRule?: (string|null); + } + + /** Represents a YaraRuleSignature. */ + class YaraRuleSignature implements IYaraRuleSignature { + + /** + * Constructs a new YaraRuleSignature. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.Indicator.ProcessSignature.IYaraRuleSignature); + + /** YaraRuleSignature yaraRule. */ + public yaraRule: string; + + /** + * Creates a new YaraRuleSignature instance using the specified properties. + * @param [properties] Properties to set + * @returns YaraRuleSignature instance + */ + public static create(properties?: google.cloud.securitycenter.v1.Indicator.ProcessSignature.IYaraRuleSignature): google.cloud.securitycenter.v1.Indicator.ProcessSignature.YaraRuleSignature; + + /** + * Encodes the specified YaraRuleSignature message. Does not implicitly {@link google.cloud.securitycenter.v1.Indicator.ProcessSignature.YaraRuleSignature.verify|verify} messages. + * @param message YaraRuleSignature message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.Indicator.ProcessSignature.IYaraRuleSignature, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified YaraRuleSignature message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Indicator.ProcessSignature.YaraRuleSignature.verify|verify} messages. + * @param message YaraRuleSignature message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.Indicator.ProcessSignature.IYaraRuleSignature, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a YaraRuleSignature message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns YaraRuleSignature + * @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.cloud.securitycenter.v1.Indicator.ProcessSignature.YaraRuleSignature; + + /** + * Decodes a YaraRuleSignature message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns YaraRuleSignature + * @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.cloud.securitycenter.v1.Indicator.ProcessSignature.YaraRuleSignature; + + /** + * Verifies a YaraRuleSignature 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 YaraRuleSignature message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns YaraRuleSignature + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.Indicator.ProcessSignature.YaraRuleSignature; + + /** + * Creates a plain object from a YaraRuleSignature message. Also converts values to other types if specified. + * @param message YaraRuleSignature + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.Indicator.ProcessSignature.YaraRuleSignature, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this YaraRuleSignature to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + } + /** Properties of a MitreAttack. */ interface IMitreAttack { @@ -2256,6 +2838,9 @@ export namespace google { /** Properties of a Process. */ interface IProcess { + /** Process name */ + name?: (string|null); + /** Process binary */ binary?: (google.cloud.securitycenter.v1.IFile|null); @@ -2293,6 +2878,9 @@ export namespace google { */ constructor(properties?: google.cloud.securitycenter.v1.IProcess); + /** Process name. */ + public name: string; + /** Process binary. */ public binary?: (google.cloud.securitycenter.v1.IFile|null); diff --git a/packages/google-cloud-securitycenter/protos/protos.js b/packages/google-cloud-securitycenter/protos/protos.js index 33e2e0b4b8a..47f2c1cc3d6 100644 --- a/packages/google-cloud-securitycenter/protos/protos.js +++ b/packages/google-cloud-securitycenter/protos/protos.js @@ -2966,6 +2966,401 @@ return Connection; })(); + v1.ContactDetails = (function() { + + /** + * Properties of a ContactDetails. + * @memberof google.cloud.securitycenter.v1 + * @interface IContactDetails + * @property {Array.|null} [contacts] ContactDetails contacts + */ + + /** + * Constructs a new ContactDetails. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a ContactDetails. + * @implements IContactDetails + * @constructor + * @param {google.cloud.securitycenter.v1.IContactDetails=} [properties] Properties to set + */ + function ContactDetails(properties) { + this.contacts = []; + 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]]; + } + + /** + * ContactDetails contacts. + * @member {Array.} contacts + * @memberof google.cloud.securitycenter.v1.ContactDetails + * @instance + */ + ContactDetails.prototype.contacts = $util.emptyArray; + + /** + * Creates a new ContactDetails instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.ContactDetails + * @static + * @param {google.cloud.securitycenter.v1.IContactDetails=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.ContactDetails} ContactDetails instance + */ + ContactDetails.create = function create(properties) { + return new ContactDetails(properties); + }; + + /** + * Encodes the specified ContactDetails message. Does not implicitly {@link google.cloud.securitycenter.v1.ContactDetails.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.ContactDetails + * @static + * @param {google.cloud.securitycenter.v1.IContactDetails} message ContactDetails message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContactDetails.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.contacts != null && message.contacts.length) + for (var i = 0; i < message.contacts.length; ++i) + $root.google.cloud.securitycenter.v1.Contact.encode(message.contacts[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ContactDetails message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ContactDetails.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.ContactDetails + * @static + * @param {google.cloud.securitycenter.v1.IContactDetails} message ContactDetails message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContactDetails.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ContactDetails message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.ContactDetails + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.ContactDetails} ContactDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContactDetails.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.cloud.securitycenter.v1.ContactDetails(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.contacts && message.contacts.length)) + message.contacts = []; + message.contacts.push($root.google.cloud.securitycenter.v1.Contact.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ContactDetails message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.ContactDetails + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.ContactDetails} ContactDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContactDetails.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ContactDetails message. + * @function verify + * @memberof google.cloud.securitycenter.v1.ContactDetails + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ContactDetails.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.contacts != null && message.hasOwnProperty("contacts")) { + if (!Array.isArray(message.contacts)) + return "contacts: array expected"; + for (var i = 0; i < message.contacts.length; ++i) { + var error = $root.google.cloud.securitycenter.v1.Contact.verify(message.contacts[i]); + if (error) + return "contacts." + error; + } + } + return null; + }; + + /** + * Creates a ContactDetails message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.ContactDetails + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.ContactDetails} ContactDetails + */ + ContactDetails.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.ContactDetails) + return object; + var message = new $root.google.cloud.securitycenter.v1.ContactDetails(); + if (object.contacts) { + if (!Array.isArray(object.contacts)) + throw TypeError(".google.cloud.securitycenter.v1.ContactDetails.contacts: array expected"); + message.contacts = []; + for (var i = 0; i < object.contacts.length; ++i) { + if (typeof object.contacts[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v1.ContactDetails.contacts: object expected"); + message.contacts[i] = $root.google.cloud.securitycenter.v1.Contact.fromObject(object.contacts[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a ContactDetails message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.ContactDetails + * @static + * @param {google.cloud.securitycenter.v1.ContactDetails} message ContactDetails + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ContactDetails.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.contacts = []; + if (message.contacts && message.contacts.length) { + object.contacts = []; + for (var j = 0; j < message.contacts.length; ++j) + object.contacts[j] = $root.google.cloud.securitycenter.v1.Contact.toObject(message.contacts[j], options); + } + return object; + }; + + /** + * Converts this ContactDetails to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.ContactDetails + * @instance + * @returns {Object.} JSON object + */ + ContactDetails.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ContactDetails; + })(); + + v1.Contact = (function() { + + /** + * Properties of a Contact. + * @memberof google.cloud.securitycenter.v1 + * @interface IContact + * @property {string|null} [email] Contact email + */ + + /** + * Constructs a new Contact. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a Contact. + * @implements IContact + * @constructor + * @param {google.cloud.securitycenter.v1.IContact=} [properties] Properties to set + */ + function Contact(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]]; + } + + /** + * Contact email. + * @member {string} email + * @memberof google.cloud.securitycenter.v1.Contact + * @instance + */ + Contact.prototype.email = ""; + + /** + * Creates a new Contact instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.Contact + * @static + * @param {google.cloud.securitycenter.v1.IContact=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.Contact} Contact instance + */ + Contact.create = function create(properties) { + return new Contact(properties); + }; + + /** + * Encodes the specified Contact message. Does not implicitly {@link google.cloud.securitycenter.v1.Contact.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.Contact + * @static + * @param {google.cloud.securitycenter.v1.IContact} message Contact message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Contact.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.email != null && Object.hasOwnProperty.call(message, "email")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.email); + return writer; + }; + + /** + * Encodes the specified Contact message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Contact.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.Contact + * @static + * @param {google.cloud.securitycenter.v1.IContact} message Contact message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Contact.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Contact message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.Contact + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.Contact} Contact + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Contact.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.cloud.securitycenter.v1.Contact(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.email = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Contact message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.Contact + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.Contact} Contact + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Contact.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Contact message. + * @function verify + * @memberof google.cloud.securitycenter.v1.Contact + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Contact.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.email != null && message.hasOwnProperty("email")) + if (!$util.isString(message.email)) + return "email: string expected"; + return null; + }; + + /** + * Creates a Contact message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.Contact + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.Contact} Contact + */ + Contact.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.Contact) + return object; + var message = new $root.google.cloud.securitycenter.v1.Contact(); + if (object.email != null) + message.email = String(object.email); + return message; + }; + + /** + * Creates a plain object from a Contact message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.Contact + * @static + * @param {google.cloud.securitycenter.v1.Contact} message Contact + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Contact.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.email = ""; + if (message.email != null && message.hasOwnProperty("email")) + object.email = message.email; + return object; + }; + + /** + * Converts this Contact to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.Contact + * @instance + * @returns {Object.} JSON object + */ + Contact.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Contact; + })(); + v1.Exfiltration = (function() { /** @@ -4097,6 +4492,7 @@ * @property {Array.|null} [connections] Finding connections * @property {string|null} [muteInitiator] Finding muteInitiator * @property {Array.|null} [processes] Finding processes + * @property {Object.|null} [contacts] Finding contacts * @property {Array.|null} [compliances] Finding compliances * @property {string|null} [description] Finding description * @property {google.cloud.securitycenter.v1.IExfiltration|null} [exfiltration] Finding exfiltration @@ -4117,6 +4513,7 @@ this.externalSystems = {}; this.connections = []; this.processes = []; + this.contacts = {}; this.compliances = []; this.iamBindings = []; if (properties) @@ -4310,15 +4707,23 @@ Finding.prototype.processes = $util.emptyArray; /** - * Finding compliances. - * @member {Array.} compliances + * Finding contacts. + * @member {Object.} contacts * @memberof google.cloud.securitycenter.v1.Finding * @instance */ - Finding.prototype.compliances = $util.emptyArray; + Finding.prototype.contacts = $util.emptyObject; /** - * Finding description. + * Finding compliances. + * @member {Array.} compliances + * @memberof google.cloud.securitycenter.v1.Finding + * @instance + */ + Finding.prototype.compliances = $util.emptyArray; + + /** + * Finding description. * @member {string} description * @memberof google.cloud.securitycenter.v1.Finding * @instance @@ -4427,6 +4832,11 @@ if (message.connections != null && message.connections.length) for (var i = 0; i < message.connections.length; ++i) $root.google.cloud.securitycenter.v1.Connection.encode(message.connections[i], writer.uint32(/* id 31, wireType 2 =*/250).fork()).ldelim(); + if (message.contacts != null && Object.hasOwnProperty.call(message, "contacts")) + for (var keys = Object.keys(message.contacts), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 33, wireType 2 =*/266).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.cloud.securitycenter.v1.ContactDetails.encode(message.contacts[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } if (message.compliances != null && message.compliances.length) for (var i = 0; i < message.compliances.length; ++i) $root.google.cloud.securitycenter.v1.Compliance.encode(message.compliances[i], writer.uint32(/* id 34, wireType 2 =*/274).fork()).ldelim(); @@ -4584,6 +4994,28 @@ message.processes = []; message.processes.push($root.google.cloud.securitycenter.v1.Process.decode(reader, reader.uint32())); break; + case 33: + if (message.contacts === $util.emptyObject) + message.contacts = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.cloud.securitycenter.v1.ContactDetails.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.contacts[key] = value; + break; case 34: if (!(message.compliances && message.compliances.length)) message.compliances = []; @@ -4779,6 +5211,16 @@ return "processes." + error; } } + if (message.contacts != null && message.hasOwnProperty("contacts")) { + if (!$util.isObject(message.contacts)) + return "contacts: object expected"; + var key = Object.keys(message.contacts); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.securitycenter.v1.ContactDetails.verify(message.contacts[key[i]]); + if (error) + return "contacts." + error; + } + } if (message.compliances != null && message.hasOwnProperty("compliances")) { if (!Array.isArray(message.compliances)) return "compliances: array expected"; @@ -4997,6 +5439,16 @@ message.processes[i] = $root.google.cloud.securitycenter.v1.Process.fromObject(object.processes[i]); } } + if (object.contacts) { + if (typeof object.contacts !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Finding.contacts: object expected"); + message.contacts = {}; + for (var keys = Object.keys(object.contacts), i = 0; i < keys.length; ++i) { + if (typeof object.contacts[keys[i]] !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Finding.contacts: object expected"); + message.contacts[keys[i]] = $root.google.cloud.securitycenter.v1.ContactDetails.fromObject(object.contacts[keys[i]]); + } + } if (object.compliances) { if (!Array.isArray(object.compliances)) throw TypeError(".google.cloud.securitycenter.v1.Finding.compliances: array expected"); @@ -5051,6 +5503,7 @@ if (options.objects || options.defaults) { object.sourceProperties = {}; object.externalSystems = {}; + object.contacts = {}; } if (options.defaults) { object.name = ""; @@ -5135,6 +5588,11 @@ for (var j = 0; j < message.connections.length; ++j) object.connections[j] = $root.google.cloud.securitycenter.v1.Connection.toObject(message.connections[j], options); } + if (message.contacts && (keys2 = Object.keys(message.contacts)).length) { + object.contacts = {}; + for (var j = 0; j < keys2.length; ++j) + object.contacts[keys2[j]] = $root.google.cloud.securitycenter.v1.ContactDetails.toObject(message.contacts[keys2[j]], options); + } if (message.compliances && message.compliances.length) { object.compliances = []; for (var j = 0; j < message.compliances.length; ++j) @@ -5518,6 +5976,7 @@ * @interface IIndicator * @property {Array.|null} [ipAddresses] Indicator ipAddresses * @property {Array.|null} [domains] Indicator domains + * @property {Array.|null} [signatures] Indicator signatures */ /** @@ -5531,6 +5990,7 @@ function Indicator(properties) { this.ipAddresses = []; this.domains = []; + this.signatures = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -5553,6 +6013,14 @@ */ Indicator.prototype.domains = $util.emptyArray; + /** + * Indicator signatures. + * @member {Array.} signatures + * @memberof google.cloud.securitycenter.v1.Indicator + * @instance + */ + Indicator.prototype.signatures = $util.emptyArray; + /** * Creates a new Indicator instance using the specified properties. * @function create @@ -5583,171 +6051,1077 @@ if (message.domains != null && message.domains.length) for (var i = 0; i < message.domains.length; ++i) writer.uint32(/* id 2, wireType 2 =*/18).string(message.domains[i]); + if (message.signatures != null && message.signatures.length) + for (var i = 0; i < message.signatures.length; ++i) + $root.google.cloud.securitycenter.v1.Indicator.ProcessSignature.encode(message.signatures[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; - /** - * Encodes the specified Indicator message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Indicator.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.Indicator - * @static - * @param {google.cloud.securitycenter.v1.IIndicator} message Indicator message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Indicator.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Encodes the specified Indicator message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Indicator.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.Indicator + * @static + * @param {google.cloud.securitycenter.v1.IIndicator} message Indicator message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Indicator.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Indicator message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.Indicator + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.Indicator} Indicator + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Indicator.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.cloud.securitycenter.v1.Indicator(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.ipAddresses && message.ipAddresses.length)) + message.ipAddresses = []; + message.ipAddresses.push(reader.string()); + break; + case 2: + if (!(message.domains && message.domains.length)) + message.domains = []; + message.domains.push(reader.string()); + break; + case 3: + if (!(message.signatures && message.signatures.length)) + message.signatures = []; + message.signatures.push($root.google.cloud.securitycenter.v1.Indicator.ProcessSignature.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Indicator message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.Indicator + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.Indicator} Indicator + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Indicator.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Indicator message. + * @function verify + * @memberof google.cloud.securitycenter.v1.Indicator + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Indicator.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.ipAddresses != null && message.hasOwnProperty("ipAddresses")) { + if (!Array.isArray(message.ipAddresses)) + return "ipAddresses: array expected"; + for (var i = 0; i < message.ipAddresses.length; ++i) + if (!$util.isString(message.ipAddresses[i])) + return "ipAddresses: string[] expected"; + } + if (message.domains != null && message.hasOwnProperty("domains")) { + if (!Array.isArray(message.domains)) + return "domains: array expected"; + for (var i = 0; i < message.domains.length; ++i) + if (!$util.isString(message.domains[i])) + return "domains: string[] expected"; + } + if (message.signatures != null && message.hasOwnProperty("signatures")) { + if (!Array.isArray(message.signatures)) + return "signatures: array expected"; + for (var i = 0; i < message.signatures.length; ++i) { + var error = $root.google.cloud.securitycenter.v1.Indicator.ProcessSignature.verify(message.signatures[i]); + if (error) + return "signatures." + error; + } + } + return null; + }; + + /** + * Creates an Indicator message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.Indicator + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.Indicator} Indicator + */ + Indicator.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.Indicator) + return object; + var message = new $root.google.cloud.securitycenter.v1.Indicator(); + if (object.ipAddresses) { + if (!Array.isArray(object.ipAddresses)) + throw TypeError(".google.cloud.securitycenter.v1.Indicator.ipAddresses: array expected"); + message.ipAddresses = []; + for (var i = 0; i < object.ipAddresses.length; ++i) + message.ipAddresses[i] = String(object.ipAddresses[i]); + } + if (object.domains) { + if (!Array.isArray(object.domains)) + throw TypeError(".google.cloud.securitycenter.v1.Indicator.domains: array expected"); + message.domains = []; + for (var i = 0; i < object.domains.length; ++i) + message.domains[i] = String(object.domains[i]); + } + if (object.signatures) { + if (!Array.isArray(object.signatures)) + throw TypeError(".google.cloud.securitycenter.v1.Indicator.signatures: array expected"); + message.signatures = []; + for (var i = 0; i < object.signatures.length; ++i) { + if (typeof object.signatures[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Indicator.signatures: object expected"); + message.signatures[i] = $root.google.cloud.securitycenter.v1.Indicator.ProcessSignature.fromObject(object.signatures[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an Indicator message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.Indicator + * @static + * @param {google.cloud.securitycenter.v1.Indicator} message Indicator + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Indicator.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.ipAddresses = []; + object.domains = []; + object.signatures = []; + } + if (message.ipAddresses && message.ipAddresses.length) { + object.ipAddresses = []; + for (var j = 0; j < message.ipAddresses.length; ++j) + object.ipAddresses[j] = message.ipAddresses[j]; + } + if (message.domains && message.domains.length) { + object.domains = []; + for (var j = 0; j < message.domains.length; ++j) + object.domains[j] = message.domains[j]; + } + if (message.signatures && message.signatures.length) { + object.signatures = []; + for (var j = 0; j < message.signatures.length; ++j) + object.signatures[j] = $root.google.cloud.securitycenter.v1.Indicator.ProcessSignature.toObject(message.signatures[j], options); + } + return object; + }; + + /** + * Converts this Indicator to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.Indicator + * @instance + * @returns {Object.} JSON object + */ + Indicator.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + Indicator.ProcessSignature = (function() { + + /** + * Properties of a ProcessSignature. + * @memberof google.cloud.securitycenter.v1.Indicator + * @interface IProcessSignature + * @property {google.cloud.securitycenter.v1.Indicator.ProcessSignature.IMemoryHashSignature|null} [memoryHashSignature] ProcessSignature memoryHashSignature + * @property {google.cloud.securitycenter.v1.Indicator.ProcessSignature.IYaraRuleSignature|null} [yaraRuleSignature] ProcessSignature yaraRuleSignature + */ + + /** + * Constructs a new ProcessSignature. + * @memberof google.cloud.securitycenter.v1.Indicator + * @classdesc Represents a ProcessSignature. + * @implements IProcessSignature + * @constructor + * @param {google.cloud.securitycenter.v1.Indicator.IProcessSignature=} [properties] Properties to set + */ + function ProcessSignature(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]]; + } + + /** + * ProcessSignature memoryHashSignature. + * @member {google.cloud.securitycenter.v1.Indicator.ProcessSignature.IMemoryHashSignature|null|undefined} memoryHashSignature + * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature + * @instance + */ + ProcessSignature.prototype.memoryHashSignature = null; + + /** + * ProcessSignature yaraRuleSignature. + * @member {google.cloud.securitycenter.v1.Indicator.ProcessSignature.IYaraRuleSignature|null|undefined} yaraRuleSignature + * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature + * @instance + */ + ProcessSignature.prototype.yaraRuleSignature = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ProcessSignature signature. + * @member {"memoryHashSignature"|"yaraRuleSignature"|undefined} signature + * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature + * @instance + */ + Object.defineProperty(ProcessSignature.prototype, "signature", { + get: $util.oneOfGetter($oneOfFields = ["memoryHashSignature", "yaraRuleSignature"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ProcessSignature instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature + * @static + * @param {google.cloud.securitycenter.v1.Indicator.IProcessSignature=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.Indicator.ProcessSignature} ProcessSignature instance + */ + ProcessSignature.create = function create(properties) { + return new ProcessSignature(properties); + }; + + /** + * Encodes the specified ProcessSignature message. Does not implicitly {@link google.cloud.securitycenter.v1.Indicator.ProcessSignature.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature + * @static + * @param {google.cloud.securitycenter.v1.Indicator.IProcessSignature} message ProcessSignature message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ProcessSignature.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.memoryHashSignature != null && Object.hasOwnProperty.call(message, "memoryHashSignature")) + $root.google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.encode(message.memoryHashSignature, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.yaraRuleSignature != null && Object.hasOwnProperty.call(message, "yaraRuleSignature")) + $root.google.cloud.securitycenter.v1.Indicator.ProcessSignature.YaraRuleSignature.encode(message.yaraRuleSignature, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ProcessSignature message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Indicator.ProcessSignature.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature + * @static + * @param {google.cloud.securitycenter.v1.Indicator.IProcessSignature} message ProcessSignature message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ProcessSignature.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ProcessSignature message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.Indicator.ProcessSignature} ProcessSignature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ProcessSignature.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.cloud.securitycenter.v1.Indicator.ProcessSignature(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 6: + message.memoryHashSignature = $root.google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.decode(reader, reader.uint32()); + break; + case 7: + message.yaraRuleSignature = $root.google.cloud.securitycenter.v1.Indicator.ProcessSignature.YaraRuleSignature.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ProcessSignature message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.Indicator.ProcessSignature} ProcessSignature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ProcessSignature.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ProcessSignature message. + * @function verify + * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ProcessSignature.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.memoryHashSignature != null && message.hasOwnProperty("memoryHashSignature")) { + properties.signature = 1; + { + var error = $root.google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.verify(message.memoryHashSignature); + if (error) + return "memoryHashSignature." + error; + } + } + if (message.yaraRuleSignature != null && message.hasOwnProperty("yaraRuleSignature")) { + if (properties.signature === 1) + return "signature: multiple values"; + properties.signature = 1; + { + var error = $root.google.cloud.securitycenter.v1.Indicator.ProcessSignature.YaraRuleSignature.verify(message.yaraRuleSignature); + if (error) + return "yaraRuleSignature." + error; + } + } + return null; + }; + + /** + * Creates a ProcessSignature message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.Indicator.ProcessSignature} ProcessSignature + */ + ProcessSignature.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.Indicator.ProcessSignature) + return object; + var message = new $root.google.cloud.securitycenter.v1.Indicator.ProcessSignature(); + if (object.memoryHashSignature != null) { + if (typeof object.memoryHashSignature !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Indicator.ProcessSignature.memoryHashSignature: object expected"); + message.memoryHashSignature = $root.google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.fromObject(object.memoryHashSignature); + } + if (object.yaraRuleSignature != null) { + if (typeof object.yaraRuleSignature !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Indicator.ProcessSignature.yaraRuleSignature: object expected"); + message.yaraRuleSignature = $root.google.cloud.securitycenter.v1.Indicator.ProcessSignature.YaraRuleSignature.fromObject(object.yaraRuleSignature); + } + return message; + }; + + /** + * Creates a plain object from a ProcessSignature message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature + * @static + * @param {google.cloud.securitycenter.v1.Indicator.ProcessSignature} message ProcessSignature + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ProcessSignature.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.memoryHashSignature != null && message.hasOwnProperty("memoryHashSignature")) { + object.memoryHashSignature = $root.google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.toObject(message.memoryHashSignature, options); + if (options.oneofs) + object.signature = "memoryHashSignature"; + } + if (message.yaraRuleSignature != null && message.hasOwnProperty("yaraRuleSignature")) { + object.yaraRuleSignature = $root.google.cloud.securitycenter.v1.Indicator.ProcessSignature.YaraRuleSignature.toObject(message.yaraRuleSignature, options); + if (options.oneofs) + object.signature = "yaraRuleSignature"; + } + return object; + }; + + /** + * Converts this ProcessSignature to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature + * @instance + * @returns {Object.} JSON object + */ + ProcessSignature.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + ProcessSignature.MemoryHashSignature = (function() { + + /** + * Properties of a MemoryHashSignature. + * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature + * @interface IMemoryHashSignature + * @property {string|null} [binaryFamily] MemoryHashSignature binaryFamily + * @property {Array.|null} [detections] MemoryHashSignature detections + */ + + /** + * Constructs a new MemoryHashSignature. + * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature + * @classdesc Represents a MemoryHashSignature. + * @implements IMemoryHashSignature + * @constructor + * @param {google.cloud.securitycenter.v1.Indicator.ProcessSignature.IMemoryHashSignature=} [properties] Properties to set + */ + function MemoryHashSignature(properties) { + this.detections = []; + 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]]; + } + + /** + * MemoryHashSignature binaryFamily. + * @member {string} binaryFamily + * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature + * @instance + */ + MemoryHashSignature.prototype.binaryFamily = ""; + + /** + * MemoryHashSignature detections. + * @member {Array.} detections + * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature + * @instance + */ + MemoryHashSignature.prototype.detections = $util.emptyArray; + + /** + * Creates a new MemoryHashSignature instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature + * @static + * @param {google.cloud.securitycenter.v1.Indicator.ProcessSignature.IMemoryHashSignature=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature} MemoryHashSignature instance + */ + MemoryHashSignature.create = function create(properties) { + return new MemoryHashSignature(properties); + }; + + /** + * Encodes the specified MemoryHashSignature message. Does not implicitly {@link google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature + * @static + * @param {google.cloud.securitycenter.v1.Indicator.ProcessSignature.IMemoryHashSignature} message MemoryHashSignature message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MemoryHashSignature.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.binaryFamily != null && Object.hasOwnProperty.call(message, "binaryFamily")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.binaryFamily); + if (message.detections != null && message.detections.length) + for (var i = 0; i < message.detections.length; ++i) + $root.google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.Detection.encode(message.detections[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MemoryHashSignature message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature + * @static + * @param {google.cloud.securitycenter.v1.Indicator.ProcessSignature.IMemoryHashSignature} message MemoryHashSignature message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MemoryHashSignature.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MemoryHashSignature message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature} MemoryHashSignature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MemoryHashSignature.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.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.binaryFamily = reader.string(); + break; + case 4: + if (!(message.detections && message.detections.length)) + message.detections = []; + message.detections.push($root.google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.Detection.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MemoryHashSignature message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature} MemoryHashSignature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MemoryHashSignature.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MemoryHashSignature message. + * @function verify + * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MemoryHashSignature.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.binaryFamily != null && message.hasOwnProperty("binaryFamily")) + if (!$util.isString(message.binaryFamily)) + return "binaryFamily: string expected"; + if (message.detections != null && message.hasOwnProperty("detections")) { + if (!Array.isArray(message.detections)) + return "detections: array expected"; + for (var i = 0; i < message.detections.length; ++i) { + var error = $root.google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.Detection.verify(message.detections[i]); + if (error) + return "detections." + error; + } + } + return null; + }; + + /** + * Creates a MemoryHashSignature message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature} MemoryHashSignature + */ + MemoryHashSignature.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature) + return object; + var message = new $root.google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature(); + if (object.binaryFamily != null) + message.binaryFamily = String(object.binaryFamily); + if (object.detections) { + if (!Array.isArray(object.detections)) + throw TypeError(".google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.detections: array expected"); + message.detections = []; + for (var i = 0; i < object.detections.length; ++i) { + if (typeof object.detections[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.detections: object expected"); + message.detections[i] = $root.google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.Detection.fromObject(object.detections[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a MemoryHashSignature message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature + * @static + * @param {google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature} message MemoryHashSignature + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MemoryHashSignature.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.detections = []; + if (options.defaults) + object.binaryFamily = ""; + if (message.binaryFamily != null && message.hasOwnProperty("binaryFamily")) + object.binaryFamily = message.binaryFamily; + if (message.detections && message.detections.length) { + object.detections = []; + for (var j = 0; j < message.detections.length; ++j) + object.detections[j] = $root.google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.Detection.toObject(message.detections[j], options); + } + return object; + }; + + /** + * Converts this MemoryHashSignature to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature + * @instance + * @returns {Object.} JSON object + */ + MemoryHashSignature.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + MemoryHashSignature.Detection = (function() { + + /** + * Properties of a Detection. + * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature + * @interface IDetection + * @property {string|null} [binary] Detection binary + * @property {number|null} [percentPagesMatched] Detection percentPagesMatched + */ + + /** + * Constructs a new Detection. + * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature + * @classdesc Represents a Detection. + * @implements IDetection + * @constructor + * @param {google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.IDetection=} [properties] Properties to set + */ + function Detection(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]]; + } + + /** + * Detection binary. + * @member {string} binary + * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.Detection + * @instance + */ + Detection.prototype.binary = ""; + + /** + * Detection percentPagesMatched. + * @member {number} percentPagesMatched + * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.Detection + * @instance + */ + Detection.prototype.percentPagesMatched = 0; + + /** + * Creates a new Detection instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.Detection + * @static + * @param {google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.IDetection=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.Detection} Detection instance + */ + Detection.create = function create(properties) { + return new Detection(properties); + }; + + /** + * Encodes the specified Detection message. Does not implicitly {@link google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.Detection.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.Detection + * @static + * @param {google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.IDetection} message Detection message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Detection.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.binary != null && Object.hasOwnProperty.call(message, "binary")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.binary); + if (message.percentPagesMatched != null && Object.hasOwnProperty.call(message, "percentPagesMatched")) + writer.uint32(/* id 3, wireType 1 =*/25).double(message.percentPagesMatched); + return writer; + }; + + /** + * Encodes the specified Detection message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.Detection.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.Detection + * @static + * @param {google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.IDetection} message Detection message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Detection.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Detection message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.Detection + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.Detection} Detection + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Detection.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.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.Detection(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: + message.binary = reader.string(); + break; + case 3: + message.percentPagesMatched = reader.double(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Detection message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.Detection + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.Detection} Detection + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Detection.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Detection message. + * @function verify + * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.Detection + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Detection.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.binary != null && message.hasOwnProperty("binary")) + if (!$util.isString(message.binary)) + return "binary: string expected"; + if (message.percentPagesMatched != null && message.hasOwnProperty("percentPagesMatched")) + if (typeof message.percentPagesMatched !== "number") + return "percentPagesMatched: number expected"; + return null; + }; + + /** + * Creates a Detection message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.Detection + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.Detection} Detection + */ + Detection.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.Detection) + return object; + var message = new $root.google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.Detection(); + if (object.binary != null) + message.binary = String(object.binary); + if (object.percentPagesMatched != null) + message.percentPagesMatched = Number(object.percentPagesMatched); + return message; + }; + + /** + * Creates a plain object from a Detection message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.Detection + * @static + * @param {google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.Detection} message Detection + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Detection.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.binary = ""; + object.percentPagesMatched = 0; + } + if (message.binary != null && message.hasOwnProperty("binary")) + object.binary = message.binary; + if (message.percentPagesMatched != null && message.hasOwnProperty("percentPagesMatched")) + object.percentPagesMatched = options.json && !isFinite(message.percentPagesMatched) ? String(message.percentPagesMatched) : message.percentPagesMatched; + return object; + }; + + /** + * Converts this Detection to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.Detection + * @instance + * @returns {Object.} JSON object + */ + Detection.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Detection; + })(); + + return MemoryHashSignature; + })(); + + ProcessSignature.YaraRuleSignature = (function() { + + /** + * Properties of a YaraRuleSignature. + * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature + * @interface IYaraRuleSignature + * @property {string|null} [yaraRule] YaraRuleSignature yaraRule + */ + + /** + * Constructs a new YaraRuleSignature. + * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature + * @classdesc Represents a YaraRuleSignature. + * @implements IYaraRuleSignature + * @constructor + * @param {google.cloud.securitycenter.v1.Indicator.ProcessSignature.IYaraRuleSignature=} [properties] Properties to set + */ + function YaraRuleSignature(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]]; + } + + /** + * YaraRuleSignature yaraRule. + * @member {string} yaraRule + * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature.YaraRuleSignature + * @instance + */ + YaraRuleSignature.prototype.yaraRule = ""; + + /** + * Creates a new YaraRuleSignature instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature.YaraRuleSignature + * @static + * @param {google.cloud.securitycenter.v1.Indicator.ProcessSignature.IYaraRuleSignature=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.Indicator.ProcessSignature.YaraRuleSignature} YaraRuleSignature instance + */ + YaraRuleSignature.create = function create(properties) { + return new YaraRuleSignature(properties); + }; + + /** + * Encodes the specified YaraRuleSignature message. Does not implicitly {@link google.cloud.securitycenter.v1.Indicator.ProcessSignature.YaraRuleSignature.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature.YaraRuleSignature + * @static + * @param {google.cloud.securitycenter.v1.Indicator.ProcessSignature.IYaraRuleSignature} message YaraRuleSignature message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + YaraRuleSignature.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.yaraRule != null && Object.hasOwnProperty.call(message, "yaraRule")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.yaraRule); + return writer; + }; + + /** + * Encodes the specified YaraRuleSignature message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Indicator.ProcessSignature.YaraRuleSignature.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature.YaraRuleSignature + * @static + * @param {google.cloud.securitycenter.v1.Indicator.ProcessSignature.IYaraRuleSignature} message YaraRuleSignature message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + YaraRuleSignature.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Decodes an Indicator message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v1.Indicator - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.Indicator} Indicator - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Indicator.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.cloud.securitycenter.v1.Indicator(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.ipAddresses && message.ipAddresses.length)) - message.ipAddresses = []; - message.ipAddresses.push(reader.string()); - break; - case 2: - if (!(message.domains && message.domains.length)) - message.domains = []; - message.domains.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Decodes a YaraRuleSignature message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature.YaraRuleSignature + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.Indicator.ProcessSignature.YaraRuleSignature} YaraRuleSignature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + YaraRuleSignature.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.cloud.securitycenter.v1.Indicator.ProcessSignature.YaraRuleSignature(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 5: + message.yaraRule = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Decodes an Indicator message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.Indicator - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.Indicator} Indicator - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Indicator.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Decodes a YaraRuleSignature message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature.YaraRuleSignature + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.Indicator.ProcessSignature.YaraRuleSignature} YaraRuleSignature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + YaraRuleSignature.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Verifies an Indicator message. - * @function verify - * @memberof google.cloud.securitycenter.v1.Indicator - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Indicator.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.ipAddresses != null && message.hasOwnProperty("ipAddresses")) { - if (!Array.isArray(message.ipAddresses)) - return "ipAddresses: array expected"; - for (var i = 0; i < message.ipAddresses.length; ++i) - if (!$util.isString(message.ipAddresses[i])) - return "ipAddresses: string[] expected"; - } - if (message.domains != null && message.hasOwnProperty("domains")) { - if (!Array.isArray(message.domains)) - return "domains: array expected"; - for (var i = 0; i < message.domains.length; ++i) - if (!$util.isString(message.domains[i])) - return "domains: string[] expected"; - } - return null; - }; + /** + * Verifies a YaraRuleSignature message. + * @function verify + * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature.YaraRuleSignature + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + YaraRuleSignature.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.yaraRule != null && message.hasOwnProperty("yaraRule")) + if (!$util.isString(message.yaraRule)) + return "yaraRule: string expected"; + return null; + }; - /** - * Creates an Indicator message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v1.Indicator - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.Indicator} Indicator - */ - Indicator.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.Indicator) - return object; - var message = new $root.google.cloud.securitycenter.v1.Indicator(); - if (object.ipAddresses) { - if (!Array.isArray(object.ipAddresses)) - throw TypeError(".google.cloud.securitycenter.v1.Indicator.ipAddresses: array expected"); - message.ipAddresses = []; - for (var i = 0; i < object.ipAddresses.length; ++i) - message.ipAddresses[i] = String(object.ipAddresses[i]); - } - if (object.domains) { - if (!Array.isArray(object.domains)) - throw TypeError(".google.cloud.securitycenter.v1.Indicator.domains: array expected"); - message.domains = []; - for (var i = 0; i < object.domains.length; ++i) - message.domains[i] = String(object.domains[i]); - } - return message; - }; + /** + * Creates a YaraRuleSignature message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature.YaraRuleSignature + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.Indicator.ProcessSignature.YaraRuleSignature} YaraRuleSignature + */ + YaraRuleSignature.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.Indicator.ProcessSignature.YaraRuleSignature) + return object; + var message = new $root.google.cloud.securitycenter.v1.Indicator.ProcessSignature.YaraRuleSignature(); + if (object.yaraRule != null) + message.yaraRule = String(object.yaraRule); + return message; + }; - /** - * Creates a plain object from an Indicator message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v1.Indicator - * @static - * @param {google.cloud.securitycenter.v1.Indicator} message Indicator - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Indicator.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.ipAddresses = []; - object.domains = []; - } - if (message.ipAddresses && message.ipAddresses.length) { - object.ipAddresses = []; - for (var j = 0; j < message.ipAddresses.length; ++j) - object.ipAddresses[j] = message.ipAddresses[j]; - } - if (message.domains && message.domains.length) { - object.domains = []; - for (var j = 0; j < message.domains.length; ++j) - object.domains[j] = message.domains[j]; - } - return object; - }; + /** + * Creates a plain object from a YaraRuleSignature message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature.YaraRuleSignature + * @static + * @param {google.cloud.securitycenter.v1.Indicator.ProcessSignature.YaraRuleSignature} message YaraRuleSignature + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + YaraRuleSignature.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.yaraRule = ""; + if (message.yaraRule != null && message.hasOwnProperty("yaraRule")) + object.yaraRule = message.yaraRule; + return object; + }; - /** - * Converts this Indicator to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1.Indicator - * @instance - * @returns {Object.} JSON object - */ - Indicator.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Converts this YaraRuleSignature to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature.YaraRuleSignature + * @instance + * @returns {Object.} JSON object + */ + YaraRuleSignature.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return YaraRuleSignature; + })(); + + return ProcessSignature; + })(); return Indicator; })(); @@ -6710,6 +8084,7 @@ * Properties of a Process. * @memberof google.cloud.securitycenter.v1 * @interface IProcess + * @property {string|null} [name] Process name * @property {google.cloud.securitycenter.v1.IFile|null} [binary] Process binary * @property {Array.|null} [libraries] Process libraries * @property {google.cloud.securitycenter.v1.IFile|null} [script] Process script @@ -6739,6 +8114,14 @@ this[keys[i]] = properties[keys[i]]; } + /** + * Process name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1.Process + * @instance + */ + Process.prototype.name = ""; + /** * Process binary. * @member {google.cloud.securitycenter.v1.IFile|null|undefined} binary @@ -6856,6 +8239,8 @@ writer.uint32(/* id 10, wireType 0 =*/80).int64(message.pid); if (message.parentPid != null && Object.hasOwnProperty.call(message, "parentPid")) writer.uint32(/* id 11, wireType 0 =*/88).int64(message.parentPid); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.name); return writer; }; @@ -6890,6 +8275,9 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { + case 12: + message.name = reader.string(); + break; case 3: message.binary = $root.google.cloud.securitycenter.v1.File.decode(reader, reader.uint32()); break; @@ -6958,6 +8346,9 @@ Process.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.binary != null && message.hasOwnProperty("binary")) { var error = $root.google.cloud.securitycenter.v1.File.verify(message.binary); if (error) @@ -7020,6 +8411,8 @@ if (object instanceof $root.google.cloud.securitycenter.v1.Process) return object; var message = new $root.google.cloud.securitycenter.v1.Process(); + if (object.name != null) + message.name = String(object.name); if (object.binary != null) { if (typeof object.binary !== "object") throw TypeError(".google.cloud.securitycenter.v1.Process.binary: object expected"); @@ -7115,6 +8508,7 @@ object.parentPid = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; } else object.parentPid = options.longs === String ? "0" : 0; + object.name = ""; } if (message.binary != null && message.hasOwnProperty("binary")) object.binary = $root.google.cloud.securitycenter.v1.File.toObject(message.binary, options); @@ -7149,6 +8543,8 @@ object.parentPid = options.longs === String ? String(message.parentPid) : message.parentPid; else object.parentPid = options.longs === String ? $util.Long.prototype.toString.call(message.parentPid) : options.longs === Number ? new $util.LongBits(message.parentPid.low >>> 0, message.parentPid.high >>> 0).toNumber() : message.parentPid; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; return object; }; diff --git a/packages/google-cloud-securitycenter/protos/protos.json b/packages/google-cloud-securitycenter/protos/protos.json index fbe4236e0cf..0f78b943792 100644 --- a/packages/google-cloud-securitycenter/protos/protos.json +++ b/packages/google-cloud-securitycenter/protos/protos.json @@ -286,6 +286,23 @@ } } }, + "ContactDetails": { + "fields": { + "contacts": { + "rule": "repeated", + "type": "Contact", + "id": 1 + } + } + }, + "Contact": { + "fields": { + "email": { + "type": "string", + "id": 1 + } + } + }, "Exfiltration": { "fields": { "sources": { @@ -481,6 +498,14 @@ "type": "Process", "id": 30 }, + "contacts": { + "keyType": "string", + "type": "ContactDetails", + "id": 33, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, "compliances": { "rule": "repeated", "type": "Compliance", @@ -577,6 +602,70 @@ "rule": "repeated", "type": "string", "id": 2 + }, + "signatures": { + "rule": "repeated", + "type": "ProcessSignature", + "id": 3 + } + }, + "nested": { + "ProcessSignature": { + "oneofs": { + "signature": { + "oneof": [ + "memoryHashSignature", + "yaraRuleSignature" + ] + } + }, + "fields": { + "memoryHashSignature": { + "type": "MemoryHashSignature", + "id": 6 + }, + "yaraRuleSignature": { + "type": "YaraRuleSignature", + "id": 7 + } + }, + "nested": { + "MemoryHashSignature": { + "fields": { + "binaryFamily": { + "type": "string", + "id": 1 + }, + "detections": { + "rule": "repeated", + "type": "Detection", + "id": 4 + } + }, + "nested": { + "Detection": { + "fields": { + "binary": { + "type": "string", + "id": 2 + }, + "percentPagesMatched": { + "type": "double", + "id": 3 + } + } + } + } + }, + "YaraRuleSignature": { + "fields": { + "yaraRule": { + "type": "string", + "id": 5 + } + } + } + } } } }, @@ -666,6 +755,10 @@ }, "Process": { "fields": { + "name": { + "type": "string", + "id": 12 + }, "binary": { "type": "File", "id": 3 diff --git a/packages/google-cloud-securitycenter/src/v1/security_center_proto_list.json b/packages/google-cloud-securitycenter/src/v1/security_center_proto_list.json index 961f4c1467c..25a39f0f9e9 100644 --- a/packages/google-cloud-securitycenter/src/v1/security_center_proto_list.json +++ b/packages/google-cloud-securitycenter/src/v1/security_center_proto_list.json @@ -4,6 +4,7 @@ "../../protos/google/cloud/securitycenter/v1/bigquery_export.proto", "../../protos/google/cloud/securitycenter/v1/compliance.proto", "../../protos/google/cloud/securitycenter/v1/connection.proto", + "../../protos/google/cloud/securitycenter/v1/contact_details.proto", "../../protos/google/cloud/securitycenter/v1/exfiltration.proto", "../../protos/google/cloud/securitycenter/v1/external_system.proto", "../../protos/google/cloud/securitycenter/v1/file.proto", From 5e5dbf42f2a42a9a51c77bfad9028d6279e6bdaf Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Mon, 4 Jul 2022 14:42:38 -0400 Subject: [PATCH 323/342] chore(main): release 6.1.0 (#496) See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> Co-authored-by: Owl Bot --- packages/google-cloud-securitycenter/CHANGELOG.md | 8 ++++++++ packages/google-cloud-securitycenter/package.json | 2 +- .../snippet_metadata.google.cloud.securitycenter.v1.json | 2 +- ...ppet_metadata.google.cloud.securitycenter.v1beta1.json | 2 +- ...et_metadata.google.cloud.securitycenter.v1p1beta1.json | 2 +- packages/google-cloud-securitycenter/samples/package.json | 2 +- 6 files changed, 13 insertions(+), 5 deletions(-) diff --git a/packages/google-cloud-securitycenter/CHANGELOG.md b/packages/google-cloud-securitycenter/CHANGELOG.md index ad44d90e8f8..b0f7ec03abe 100644 --- a/packages/google-cloud-securitycenter/CHANGELOG.md +++ b/packages/google-cloud-securitycenter/CHANGELOG.md @@ -4,6 +4,14 @@ [1]: https://www.npmjs.com/package/@google-cloud/security-center?activeTab=versions +## [6.1.0](https://github.com/googleapis/nodejs-security-center/compare/v6.0.0...v6.1.0) (2022-07-04) + + +### Features + +* Added contacts field to findings attributes, specifying Essential Contacts defined at org, folder or project level within a GCP org ([3937d33](https://github.com/googleapis/nodejs-security-center/commit/3937d335f081077364f52253e72d028389cd3602)) +* support regapic LRO ([#495](https://github.com/googleapis/nodejs-security-center/issues/495)) ([7bfc2bd](https://github.com/googleapis/nodejs-security-center/commit/7bfc2bd641078d5a3b46950d61d77bac3b1b077b)) + ## [6.0.0](https://github.com/googleapis/nodejs-security-center/compare/v5.11.0...v6.0.0) (2022-06-03) diff --git a/packages/google-cloud-securitycenter/package.json b/packages/google-cloud-securitycenter/package.json index f549de7eb1b..b40bd0398c3 100644 --- a/packages/google-cloud-securitycenter/package.json +++ b/packages/google-cloud-securitycenter/package.json @@ -1,7 +1,7 @@ { "name": "@google-cloud/security-center", "description": "Cloud Security Command Center API client for Node.js", - "version": "6.0.0", + "version": "6.1.0", "license": "Apache-2.0", "author": "Google LLC", "engines": { diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/snippet_metadata.google.cloud.securitycenter.v1.json b/packages/google-cloud-securitycenter/samples/generated/v1/snippet_metadata.google.cloud.securitycenter.v1.json index 638ab222110..9b64d8164f4 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/snippet_metadata.google.cloud.securitycenter.v1.json +++ b/packages/google-cloud-securitycenter/samples/generated/v1/snippet_metadata.google.cloud.securitycenter.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-securitycenter", - "version": "6.0.0", + "version": "6.1.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-securitycenter/samples/generated/v1beta1/snippet_metadata.google.cloud.securitycenter.v1beta1.json b/packages/google-cloud-securitycenter/samples/generated/v1beta1/snippet_metadata.google.cloud.securitycenter.v1beta1.json index 9ca3b162535..ccd07ac6ac6 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1beta1/snippet_metadata.google.cloud.securitycenter.v1beta1.json +++ b/packages/google-cloud-securitycenter/samples/generated/v1beta1/snippet_metadata.google.cloud.securitycenter.v1beta1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-securitycenter", - "version": "6.0.0", + "version": "6.1.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/snippet_metadata.google.cloud.securitycenter.v1p1beta1.json b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/snippet_metadata.google.cloud.securitycenter.v1p1beta1.json index cb575d54ea5..7ace58375b1 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/snippet_metadata.google.cloud.securitycenter.v1p1beta1.json +++ b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/snippet_metadata.google.cloud.securitycenter.v1p1beta1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-securitycenter", - "version": "6.0.0", + "version": "6.1.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-securitycenter/samples/package.json b/packages/google-cloud-securitycenter/samples/package.json index bff756a32db..bcaea7bba5e 100644 --- a/packages/google-cloud-securitycenter/samples/package.json +++ b/packages/google-cloud-securitycenter/samples/package.json @@ -14,7 +14,7 @@ "license": "Apache-2.0", "dependencies": { "@google-cloud/pubsub": "^3.0.0", - "@google-cloud/security-center": "^6.0.0" + "@google-cloud/security-center": "^6.1.0" }, "devDependencies": { "chai": "^4.2.0", From f7aa3b1d5a4ca873ed9ca197258c3c313dc33c8f Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 8 Jul 2022 22:52:11 +0200 Subject: [PATCH 324/342] chore(deps): update dependency linkinator to v4 (#498) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [linkinator](https://togithub.com/JustinBeckwith/linkinator) | [`^2.0.0` -> `^4.0.0`](https://renovatebot.com/diffs/npm/linkinator/2.16.2/4.0.0) | [![age](https://badges.renovateapi.com/packages/npm/linkinator/4.0.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/linkinator/4.0.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/linkinator/4.0.0/compatibility-slim/2.16.2)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/linkinator/4.0.0/confidence-slim/2.16.2)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
JustinBeckwith/linkinator ### [`v4.0.0`](https://togithub.com/JustinBeckwith/linkinator/releases/tag/v4.0.0) [Compare Source](https://togithub.com/JustinBeckwith/linkinator/compare/v3.1.0...v4.0.0) ##### Features - create new release with notes ([#​508](https://togithub.com/JustinBeckwith/linkinator/issues/508)) ([2cab633](https://togithub.com/JustinBeckwith/linkinator/commit/2cab633c9659eb10794a4bac06f8b0acdc3e2c0c)) ##### BREAKING CHANGES - The commits in [#​507](https://togithub.com/JustinBeckwith/linkinator/issues/507) and [#​506](https://togithub.com/JustinBeckwith/linkinator/issues/506) both had breaking changes. They included dropping support for Node.js 12.x and updating the CSV export to be streaming, and to use a new way of writing the CSV file. This is an empty to commit using the `BREAKING CHANGE` format in the commit message to ensure a release is triggered. ### [`v3.1.0`](https://togithub.com/JustinBeckwith/linkinator/releases/tag/v3.1.0) [Compare Source](https://togithub.com/JustinBeckwith/linkinator/compare/v3.0.6...v3.1.0) ##### Features - allow --skip to be defined multiple times ([#​399](https://togithub.com/JustinBeckwith/linkinator/issues/399)) ([5ca5a46](https://togithub.com/JustinBeckwith/linkinator/commit/5ca5a461508e688de12e5ae6b4cfb6565f832ebf)) ### [`v3.0.6`](https://togithub.com/JustinBeckwith/linkinator/releases/tag/v3.0.6) [Compare Source](https://togithub.com/JustinBeckwith/linkinator/compare/v3.0.5...v3.0.6) ##### Bug Fixes - **deps:** upgrade node-glob to v8 ([#​397](https://togithub.com/JustinBeckwith/linkinator/issues/397)) ([d334dc6](https://togithub.com/JustinBeckwith/linkinator/commit/d334dc6734cd7c2b73d7ed3dea0550a6c3072ad5)) ### [`v3.0.5`](https://togithub.com/JustinBeckwith/linkinator/releases/tag/v3.0.5) [Compare Source](https://togithub.com/JustinBeckwith/linkinator/compare/v3.0.4...v3.0.5) ##### Bug Fixes - **deps:** upgrade to htmlparser2 v8.0.1 ([#​396](https://togithub.com/JustinBeckwith/linkinator/issues/396)) ([ba3b9a8](https://togithub.com/JustinBeckwith/linkinator/commit/ba3b9a8a9b19d39af6ed91790135e833b80c1eb6)) ### [`v3.0.4`](https://togithub.com/JustinBeckwith/linkinator/releases/tag/v3.0.4) [Compare Source](https://togithub.com/JustinBeckwith/linkinator/compare/v3.0.3...v3.0.4) ##### Bug Fixes - **deps:** update dependency gaxios to v5 ([#​391](https://togithub.com/JustinBeckwith/linkinator/issues/391)) ([48af50e](https://togithub.com/JustinBeckwith/linkinator/commit/48af50e787731204aeb7eff41325c62291311e45)) ### [`v3.0.3`](https://togithub.com/JustinBeckwith/linkinator/releases/tag/v3.0.3) [Compare Source](https://togithub.com/JustinBeckwith/linkinator/compare/v3.0.2...v3.0.3) ##### Bug Fixes - export getConfig from index ([#​371](https://togithub.com/JustinBeckwith/linkinator/issues/371)) ([0bc0355](https://togithub.com/JustinBeckwith/linkinator/commit/0bc0355c7e2ea457f247e6b52d1577b8c4ecb3a1)) ### [`v3.0.2`](https://togithub.com/JustinBeckwith/linkinator/releases/tag/v3.0.2) [Compare Source](https://togithub.com/JustinBeckwith/linkinator/compare/v3.0.1...v3.0.2) ##### Bug Fixes - allow server root with trailing slash ([#​370](https://togithub.com/JustinBeckwith/linkinator/issues/370)) ([8adf6b0](https://togithub.com/JustinBeckwith/linkinator/commit/8adf6b025fda250e38461f1cdad40fe08c3b3b7c)) ### [`v3.0.1`](https://togithub.com/JustinBeckwith/linkinator/releases/tag/v3.0.1) [Compare Source](https://togithub.com/JustinBeckwith/linkinator/compare/v3.0.0...v3.0.1) ##### Bug Fixes - decode path parts in local web server ([#​369](https://togithub.com/JustinBeckwith/linkinator/issues/369)) ([4696a0c](https://togithub.com/JustinBeckwith/linkinator/commit/4696a0c38c341b178ed815f47371fca955979feb)) ### [`v3.0.0`](https://togithub.com/JustinBeckwith/linkinator/releases/tag/v3.0.0) [Compare Source](https://togithub.com/JustinBeckwith/linkinator/compare/v2.16.2...v3.0.0) ##### Bug Fixes - **deps:** update dependency chalk to v5 ([#​362](https://togithub.com/JustinBeckwith/linkinator/issues/362)) ([4b17a8d](https://togithub.com/JustinBeckwith/linkinator/commit/4b17a8d87b649eaf813428f8ee6955e1d21dae4f)) - feat!: convert to es modules, drop node 10 ([#​359](https://togithub.com/JustinBeckwith/linkinator/issues/359)) ([efee299](https://togithub.com/JustinBeckwith/linkinator/commit/efee299ab8a805accef751eecf8538915a4e7783)), closes [#​359](https://togithub.com/JustinBeckwith/linkinator/issues/359) ##### BREAKING CHANGES - this module now requires node.js 12 and above, and has moved to es modules by default.
--- ### Configuration 📅 **Schedule**: Branch creation - "after 9am and before 3pm" (UTC), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/nodejs-security-center). --- packages/google-cloud-securitycenter/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-securitycenter/package.json b/packages/google-cloud-securitycenter/package.json index b40bd0398c3..875e3d902b0 100644 --- a/packages/google-cloud-securitycenter/package.json +++ b/packages/google-cloud-securitycenter/package.json @@ -53,7 +53,7 @@ "jsdoc": "^3.6.2", "jsdoc-fresh": "^2.0.0", "jsdoc-region-tag": "^2.0.0", - "linkinator": "^2.0.0", + "linkinator": "^4.0.0", "mocha": "^9.2.2", "null-loader": "^4.0.0", "pack-n-play": "^1.0.0-2", From d5b9d24945ea5b82029ebdcd8136e107ce7ffb23 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Fri, 29 Jul 2022 06:47:04 -0700 Subject: [PATCH 325/342] feat: Added container field to findings attributes (#499) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: Added container field to findings attributes feat: Added kubernetes field to findings attribute. This field is populated only when the container is a kubernetes cluster explicitly PiperOrigin-RevId: 462248767 Source-Link: https://github.com/googleapis/googleapis/commit/dd2b0d26b27854124812db3db7841ad65d85910a Source-Link: https://github.com/googleapis/googleapis-gen/commit/0be13cf53ca45555489d73419d1053a709a8decd Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMGJlMTNjZjUzY2E0NTU1NTQ4OWQ3MzQxOWQxMDUzYTcwOWE4ZGVjZCJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot --- .../cloud/securitycenter/v1/container.proto | 45 + .../cloud/securitycenter/v1/finding.proto | 9 + .../cloud/securitycenter/v1/kubernetes.proto | 181 + .../cloud/securitycenter/v1/label.proto | 35 + .../securitycenter/v1/mitre_attack.proto | 3 + .../protos/protos.d.ts | 1095 ++- .../protos/protos.js | 8346 +++++++++++------ .../protos/protos.json | 228 +- .../src/v1/security_center_proto_list.json | 3 + 9 files changed, 7194 insertions(+), 2751 deletions(-) create mode 100644 packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/container.proto create mode 100644 packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/kubernetes.proto create mode 100644 packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/label.proto diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/container.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/container.proto new file mode 100644 index 00000000000..65ca458cfc8 --- /dev/null +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/container.proto @@ -0,0 +1,45 @@ +// 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.cloud.securitycenter.v1; + +import "google/cloud/securitycenter/v1/label.proto"; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1;securitycenter"; +option java_multiple_files = true; +option java_outer_classname = "ContainerProto"; +option java_package = "com.google.cloud.securitycenter.v1"; +option php_namespace = "Google\\Cloud\\SecurityCenter\\V1"; +option ruby_package = "Google::Cloud::SecurityCenter::V1"; + +// Container associated with the finding. +message Container { + // Container name. + string name = 1; + + // Container image URI provided when configuring a pod/container. + // May identify a container image version using mutable tags. + string uri = 2; + + // Optional container image id, when provided by the container runtime. + // Uniquely identifies the container image launched using a container image + // digest. + string image_id = 3; + + // Container labels, as provided by the container runtime. + repeated Label labels = 4; +} diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/finding.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/finding.proto index 70aa90e9952..6c6043b5b24 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/finding.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/finding.proto @@ -22,10 +22,12 @@ import "google/cloud/securitycenter/v1/access.proto"; import "google/cloud/securitycenter/v1/compliance.proto"; import "google/cloud/securitycenter/v1/connection.proto"; import "google/cloud/securitycenter/v1/contact_details.proto"; +import "google/cloud/securitycenter/v1/container.proto"; import "google/cloud/securitycenter/v1/exfiltration.proto"; import "google/cloud/securitycenter/v1/external_system.proto"; import "google/cloud/securitycenter/v1/iam_binding.proto"; import "google/cloud/securitycenter/v1/indicator.proto"; +import "google/cloud/securitycenter/v1/kubernetes.proto"; import "google/cloud/securitycenter/v1/mitre_attack.proto"; import "google/cloud/securitycenter/v1/process.proto"; import "google/cloud/securitycenter/v1/security_marks.proto"; @@ -315,4 +317,11 @@ message Finding { // Next steps associate to the finding. string next_steps = 40; + + // Containers associated with the finding. containers provides information + // for both Kubernetes and non-Kubernetes containers. + repeated Container containers = 42; + + // Kubernetes resources associated with the finding. + Kubernetes kubernetes = 43; } diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/kubernetes.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/kubernetes.proto new file mode 100644 index 00000000000..bf3bc3608c5 --- /dev/null +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/kubernetes.proto @@ -0,0 +1,181 @@ +// 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.cloud.securitycenter.v1; + +import "google/cloud/securitycenter/v1/container.proto"; +import "google/cloud/securitycenter/v1/label.proto"; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1;securitycenter"; +option java_multiple_files = true; +option java_outer_classname = "KubernetesProto"; +option java_package = "com.google.cloud.securitycenter.v1"; +option php_namespace = "Google\\Cloud\\SecurityCenter\\V1"; +option ruby_package = "Google::Cloud::SecurityCenter::V1"; + +// Kubernetes related attributes. +message Kubernetes { + // Kubernetes Pod. + message Pod { + // Kubernetes Pod namespace. + string ns = 1; + + // Kubernetes Pod name. + string name = 2; + + // Pod labels. For Kubernetes containers, these are applied to the + // container. + repeated Label labels = 3; + + // Pod containers associated with this finding, if any. + repeated Container containers = 4; + } + + // Kubernetes Nodes associated with the finding. + message Node { + // Full Resource name of the Compute Engine VM running the + // cluster node. + string name = 1; + } + + // Provides GKE Node Pool information. + message NodePool { + // Kubernetes Node pool name. + string name = 1; + + // Nodes associated with the finding. + repeated Node nodes = 2; + } + + // Kubernetes Role or ClusterRole. + message Role { + // Types of Kubernetes roles. + enum Kind { + // Role type is not specified. + KIND_UNSPECIFIED = 0; + + // Kubernetes Role. + ROLE = 1; + + // Kubernetes ClusterRole. + CLUSTER_ROLE = 2; + } + + // Role type. + Kind kind = 1; + + // Role namespace. + string ns = 2; + + // Role name. + string name = 3; + } + + // Represents a Kubernetes RoleBinding or ClusterRoleBinding. + message Binding { + // Namespace for binding. + string ns = 1; + + // Name for binding. + string name = 2; + + // The Role or ClusterRole referenced by the binding. + Role role = 3; + + // Represents the subjects(s) bound to the role. Not always available + // for PATCH requests. + repeated Subject subjects = 4; + } + + // Represents a Kubernetes Subject. + message Subject { + // Auth types that can be used for Subject's kind field. + enum AuthType { + // Authentication is not specified. + AUTH_TYPE_UNSPECIFIED = 0; + + // User with valid certificate. + USER = 1; + + // Users managed by Kubernetes API with credentials stored as Secrets. + SERVICEACCOUNT = 2; + + // Collection of users. + GROUP = 3; + } + + // Authentication type for subject. + AuthType kind = 1; + + // Namespace for subject. + string ns = 2; + + // Name for subject. + string name = 3; + } + + // Conveys information about a Kubernetes access review (e.g. kubectl auth + // can-i ...) that was involved in a finding. + message AccessReview { + // Group is the API Group of the Resource. "*" means all. + string group = 1; + + // Namespace of the action being requested. Currently, there is no + // distinction between no namespace and all namespaces. Both + // are represented by "" (empty). + string ns = 2; + + // Name is the name of the resource being requested. Empty means all. + string name = 3; + + // Resource is the optional resource type requested. "*" means all. + string resource = 4; + + // Subresource is the optional subresource type. + string subresource = 5; + + // Verb is a Kubernetes resource API verb, like: get, list, watch, create, + // update, delete, proxy. "*" means all. + string verb = 6; + + // Version is the API Version of the Resource. "*" means all. + string version = 7; + } + + // Kubernetes Pods associated with the finding. This field will contain Pod + // records for each container that is owned by a Pod. + repeated Pod pods = 1; + + // Provides Kubernetes Node information. + repeated Node nodes = 2; + + // GKE Node Pools associated with the finding. This field will + // contain NodePool information for each Node, when it is available. + repeated NodePool node_pools = 3; + + // Provides Kubernetes role information for findings that involve + // Roles or ClusterRoles. + repeated Role roles = 4; + + // Provides Kubernetes role binding information for findings that involve + // RoleBindings or ClusterRoleBindings. + repeated Binding bindings = 5; + + // Provides information on any Kubernetes access reviews (i.e. privilege + // checks) relevant to the finding. + repeated AccessReview access_reviews = 6; +} diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/label.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/label.proto new file mode 100644 index 00000000000..30321d90718 --- /dev/null +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/label.proto @@ -0,0 +1,35 @@ +// 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.cloud.securitycenter.v1; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1;securitycenter"; +option java_multiple_files = true; +option java_outer_classname = "LabelProto"; +option java_package = "com.google.cloud.securitycenter.v1"; +option php_namespace = "Google\\Cloud\\SecurityCenter\\V1"; +option ruby_package = "Google::Cloud::SecurityCenter::V1"; + +// Label represents a generic name=value label. Label has separate name and +// value fields to support filtering with contains(). +message Label { + // Label name. + string name = 1; + + // Label value. + string value = 2; +} diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/mitre_attack.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/mitre_attack.proto index c65f62f17ef..65ec70aedb4 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/mitre_attack.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/mitre_attack.proto @@ -174,6 +174,9 @@ message MitreAttack { // T1562 IMPAIR_DEFENSES = 31; + + // T1046 + NETWORK_SERVICE_DISCOVERY = 32; } // The MITRE ATT&CK tactic most closely represented by this finding, if any. diff --git a/packages/google-cloud-securitycenter/protos/protos.d.ts b/packages/google-cloud-securitycenter/protos/protos.d.ts index f63829d8734..9be638911b6 100644 --- a/packages/google-cloud-securitycenter/protos/protos.d.ts +++ b/packages/google-cloud-securitycenter/protos/protos.d.ts @@ -1338,6 +1338,210 @@ export namespace google { public toJSON(): { [k: string]: any }; } + /** Properties of a Container. */ + interface IContainer { + + /** Container name */ + name?: (string|null); + + /** Container uri */ + uri?: (string|null); + + /** Container imageId */ + imageId?: (string|null); + + /** Container labels */ + labels?: (google.cloud.securitycenter.v1.ILabel[]|null); + } + + /** Represents a Container. */ + class Container implements IContainer { + + /** + * Constructs a new Container. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IContainer); + + /** Container name. */ + public name: string; + + /** Container uri. */ + public uri: string; + + /** Container imageId. */ + public imageId: string; + + /** Container labels. */ + public labels: google.cloud.securitycenter.v1.ILabel[]; + + /** + * Creates a new Container instance using the specified properties. + * @param [properties] Properties to set + * @returns Container instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IContainer): google.cloud.securitycenter.v1.Container; + + /** + * Encodes the specified Container message. Does not implicitly {@link google.cloud.securitycenter.v1.Container.verify|verify} messages. + * @param message Container message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IContainer, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Container message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Container.verify|verify} messages. + * @param message Container message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IContainer, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Container message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Container + * @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.cloud.securitycenter.v1.Container; + + /** + * Decodes a Container message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Container + * @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.cloud.securitycenter.v1.Container; + + /** + * Verifies a Container 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 Container message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Container + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.Container; + + /** + * Creates a plain object from a Container message. Also converts values to other types if specified. + * @param message Container + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.Container, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Container to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a Label. */ + interface ILabel { + + /** Label name */ + name?: (string|null); + + /** Label value */ + value?: (string|null); + } + + /** Represents a Label. */ + class Label implements ILabel { + + /** + * Constructs a new Label. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.ILabel); + + /** Label name. */ + public name: string; + + /** Label value. */ + public value: string; + + /** + * Creates a new Label instance using the specified properties. + * @param [properties] Properties to set + * @returns Label instance + */ + public static create(properties?: google.cloud.securitycenter.v1.ILabel): google.cloud.securitycenter.v1.Label; + + /** + * Encodes the specified Label message. Does not implicitly {@link google.cloud.securitycenter.v1.Label.verify|verify} messages. + * @param message Label message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.ILabel, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Label message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Label.verify|verify} messages. + * @param message Label message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.ILabel, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Label message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Label + * @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.cloud.securitycenter.v1.Label; + + /** + * Decodes a Label message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Label + * @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.cloud.securitycenter.v1.Label; + + /** + * Verifies a Label 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 Label message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Label + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.Label; + + /** + * Creates a plain object from a Label message. Also converts values to other types if specified. + * @param message Label + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.Label, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Label to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + /** Properties of an Exfiltration. */ interface IExfiltration { @@ -1853,6 +2057,12 @@ export namespace google { /** Finding nextSteps */ nextSteps?: (string|null); + + /** Finding containers */ + containers?: (google.cloud.securitycenter.v1.IContainer[]|null); + + /** Finding kubernetes */ + kubernetes?: (google.cloud.securitycenter.v1.IKubernetes|null); } /** Represents a Finding. */ @@ -1951,6 +2161,12 @@ export namespace google { /** Finding nextSteps. */ public nextSteps: string; + /** Finding containers. */ + public containers: google.cloud.securitycenter.v1.IContainer[]; + + /** Finding kubernetes. */ + public kubernetes?: (google.cloud.securitycenter.v1.IKubernetes|null); + /** * Creates a new Finding instance using the specified properties. * @param [properties] Properties to set @@ -2663,6 +2879,882 @@ export namespace google { } } + /** Properties of a Kubernetes. */ + interface IKubernetes { + + /** Kubernetes pods */ + pods?: (google.cloud.securitycenter.v1.Kubernetes.IPod[]|null); + + /** Kubernetes nodes */ + nodes?: (google.cloud.securitycenter.v1.Kubernetes.INode[]|null); + + /** Kubernetes nodePools */ + nodePools?: (google.cloud.securitycenter.v1.Kubernetes.INodePool[]|null); + + /** Kubernetes roles */ + roles?: (google.cloud.securitycenter.v1.Kubernetes.IRole[]|null); + + /** Kubernetes bindings */ + bindings?: (google.cloud.securitycenter.v1.Kubernetes.IBinding[]|null); + + /** Kubernetes accessReviews */ + accessReviews?: (google.cloud.securitycenter.v1.Kubernetes.IAccessReview[]|null); + } + + /** Represents a Kubernetes. */ + class Kubernetes implements IKubernetes { + + /** + * Constructs a new Kubernetes. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IKubernetes); + + /** Kubernetes pods. */ + public pods: google.cloud.securitycenter.v1.Kubernetes.IPod[]; + + /** Kubernetes nodes. */ + public nodes: google.cloud.securitycenter.v1.Kubernetes.INode[]; + + /** Kubernetes nodePools. */ + public nodePools: google.cloud.securitycenter.v1.Kubernetes.INodePool[]; + + /** Kubernetes roles. */ + public roles: google.cloud.securitycenter.v1.Kubernetes.IRole[]; + + /** Kubernetes bindings. */ + public bindings: google.cloud.securitycenter.v1.Kubernetes.IBinding[]; + + /** Kubernetes accessReviews. */ + public accessReviews: google.cloud.securitycenter.v1.Kubernetes.IAccessReview[]; + + /** + * Creates a new Kubernetes instance using the specified properties. + * @param [properties] Properties to set + * @returns Kubernetes instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IKubernetes): google.cloud.securitycenter.v1.Kubernetes; + + /** + * Encodes the specified Kubernetes message. Does not implicitly {@link google.cloud.securitycenter.v1.Kubernetes.verify|verify} messages. + * @param message Kubernetes message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IKubernetes, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Kubernetes message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Kubernetes.verify|verify} messages. + * @param message Kubernetes message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IKubernetes, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Kubernetes message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Kubernetes + * @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.cloud.securitycenter.v1.Kubernetes; + + /** + * Decodes a Kubernetes message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Kubernetes + * @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.cloud.securitycenter.v1.Kubernetes; + + /** + * Verifies a Kubernetes 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 Kubernetes message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Kubernetes + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.Kubernetes; + + /** + * Creates a plain object from a Kubernetes message. Also converts values to other types if specified. + * @param message Kubernetes + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.Kubernetes, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Kubernetes to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace Kubernetes { + + /** Properties of a Pod. */ + interface IPod { + + /** Pod ns */ + ns?: (string|null); + + /** Pod name */ + name?: (string|null); + + /** Pod labels */ + labels?: (google.cloud.securitycenter.v1.ILabel[]|null); + + /** Pod containers */ + containers?: (google.cloud.securitycenter.v1.IContainer[]|null); + } + + /** Represents a Pod. */ + class Pod implements IPod { + + /** + * Constructs a new Pod. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.Kubernetes.IPod); + + /** Pod ns. */ + public ns: string; + + /** Pod name. */ + public name: string; + + /** Pod labels. */ + public labels: google.cloud.securitycenter.v1.ILabel[]; + + /** Pod containers. */ + public containers: google.cloud.securitycenter.v1.IContainer[]; + + /** + * Creates a new Pod instance using the specified properties. + * @param [properties] Properties to set + * @returns Pod instance + */ + public static create(properties?: google.cloud.securitycenter.v1.Kubernetes.IPod): google.cloud.securitycenter.v1.Kubernetes.Pod; + + /** + * Encodes the specified Pod message. Does not implicitly {@link google.cloud.securitycenter.v1.Kubernetes.Pod.verify|verify} messages. + * @param message Pod message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.Kubernetes.IPod, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Pod message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Kubernetes.Pod.verify|verify} messages. + * @param message Pod message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.Kubernetes.IPod, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Pod message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Pod + * @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.cloud.securitycenter.v1.Kubernetes.Pod; + + /** + * Decodes a Pod message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Pod + * @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.cloud.securitycenter.v1.Kubernetes.Pod; + + /** + * Verifies a Pod 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 Pod message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Pod + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.Kubernetes.Pod; + + /** + * Creates a plain object from a Pod message. Also converts values to other types if specified. + * @param message Pod + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.Kubernetes.Pod, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Pod to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a Node. */ + interface INode { + + /** Node name */ + name?: (string|null); + } + + /** Represents a Node. */ + class Node implements INode { + + /** + * Constructs a new Node. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.Kubernetes.INode); + + /** Node name. */ + public name: string; + + /** + * Creates a new Node instance using the specified properties. + * @param [properties] Properties to set + * @returns Node instance + */ + public static create(properties?: google.cloud.securitycenter.v1.Kubernetes.INode): google.cloud.securitycenter.v1.Kubernetes.Node; + + /** + * Encodes the specified Node message. Does not implicitly {@link google.cloud.securitycenter.v1.Kubernetes.Node.verify|verify} messages. + * @param message Node message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.Kubernetes.INode, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Node message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Kubernetes.Node.verify|verify} messages. + * @param message Node message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.Kubernetes.INode, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Node message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Node + * @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.cloud.securitycenter.v1.Kubernetes.Node; + + /** + * Decodes a Node message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Node + * @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.cloud.securitycenter.v1.Kubernetes.Node; + + /** + * Verifies a Node 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 Node message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Node + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.Kubernetes.Node; + + /** + * Creates a plain object from a Node message. Also converts values to other types if specified. + * @param message Node + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.Kubernetes.Node, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Node to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a NodePool. */ + interface INodePool { + + /** NodePool name */ + name?: (string|null); + + /** NodePool nodes */ + nodes?: (google.cloud.securitycenter.v1.Kubernetes.INode[]|null); + } + + /** Represents a NodePool. */ + class NodePool implements INodePool { + + /** + * Constructs a new NodePool. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.Kubernetes.INodePool); + + /** NodePool name. */ + public name: string; + + /** NodePool nodes. */ + public nodes: google.cloud.securitycenter.v1.Kubernetes.INode[]; + + /** + * Creates a new NodePool instance using the specified properties. + * @param [properties] Properties to set + * @returns NodePool instance + */ + public static create(properties?: google.cloud.securitycenter.v1.Kubernetes.INodePool): google.cloud.securitycenter.v1.Kubernetes.NodePool; + + /** + * Encodes the specified NodePool message. Does not implicitly {@link google.cloud.securitycenter.v1.Kubernetes.NodePool.verify|verify} messages. + * @param message NodePool message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.Kubernetes.INodePool, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NodePool message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Kubernetes.NodePool.verify|verify} messages. + * @param message NodePool message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.Kubernetes.INodePool, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodePool message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NodePool + * @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.cloud.securitycenter.v1.Kubernetes.NodePool; + + /** + * Decodes a NodePool message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NodePool + * @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.cloud.securitycenter.v1.Kubernetes.NodePool; + + /** + * Verifies a NodePool 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 NodePool message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NodePool + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.Kubernetes.NodePool; + + /** + * Creates a plain object from a NodePool message. Also converts values to other types if specified. + * @param message NodePool + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.Kubernetes.NodePool, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NodePool to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a Role. */ + interface IRole { + + /** Role kind */ + kind?: (google.cloud.securitycenter.v1.Kubernetes.Role.Kind|keyof typeof google.cloud.securitycenter.v1.Kubernetes.Role.Kind|null); + + /** Role ns */ + ns?: (string|null); + + /** Role name */ + name?: (string|null); + } + + /** Represents a Role. */ + class Role implements IRole { + + /** + * Constructs a new Role. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.Kubernetes.IRole); + + /** Role kind. */ + public kind: (google.cloud.securitycenter.v1.Kubernetes.Role.Kind|keyof typeof google.cloud.securitycenter.v1.Kubernetes.Role.Kind); + + /** Role ns. */ + public ns: string; + + /** Role name. */ + public name: string; + + /** + * Creates a new Role instance using the specified properties. + * @param [properties] Properties to set + * @returns Role instance + */ + public static create(properties?: google.cloud.securitycenter.v1.Kubernetes.IRole): google.cloud.securitycenter.v1.Kubernetes.Role; + + /** + * Encodes the specified Role message. Does not implicitly {@link google.cloud.securitycenter.v1.Kubernetes.Role.verify|verify} messages. + * @param message Role message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.Kubernetes.IRole, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Role message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Kubernetes.Role.verify|verify} messages. + * @param message Role message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.Kubernetes.IRole, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Role message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Role + * @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.cloud.securitycenter.v1.Kubernetes.Role; + + /** + * Decodes a Role message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Role + * @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.cloud.securitycenter.v1.Kubernetes.Role; + + /** + * Verifies a Role 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 Role message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Role + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.Kubernetes.Role; + + /** + * Creates a plain object from a Role message. Also converts values to other types if specified. + * @param message Role + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.Kubernetes.Role, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Role to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace Role { + + /** Kind enum. */ + enum Kind { + KIND_UNSPECIFIED = 0, + ROLE = 1, + CLUSTER_ROLE = 2 + } + } + + /** Properties of a Binding. */ + interface IBinding { + + /** Binding ns */ + ns?: (string|null); + + /** Binding name */ + name?: (string|null); + + /** Binding role */ + role?: (google.cloud.securitycenter.v1.Kubernetes.IRole|null); + + /** Binding subjects */ + subjects?: (google.cloud.securitycenter.v1.Kubernetes.ISubject[]|null); + } + + /** Represents a Binding. */ + class Binding implements IBinding { + + /** + * Constructs a new Binding. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.Kubernetes.IBinding); + + /** Binding ns. */ + public ns: string; + + /** Binding name. */ + public name: string; + + /** Binding role. */ + public role?: (google.cloud.securitycenter.v1.Kubernetes.IRole|null); + + /** Binding subjects. */ + public subjects: google.cloud.securitycenter.v1.Kubernetes.ISubject[]; + + /** + * Creates a new Binding instance using the specified properties. + * @param [properties] Properties to set + * @returns Binding instance + */ + public static create(properties?: google.cloud.securitycenter.v1.Kubernetes.IBinding): google.cloud.securitycenter.v1.Kubernetes.Binding; + + /** + * Encodes the specified Binding message. Does not implicitly {@link google.cloud.securitycenter.v1.Kubernetes.Binding.verify|verify} messages. + * @param message Binding message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.Kubernetes.IBinding, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Binding message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Kubernetes.Binding.verify|verify} messages. + * @param message Binding message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.Kubernetes.IBinding, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Binding message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Binding + * @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.cloud.securitycenter.v1.Kubernetes.Binding; + + /** + * Decodes a Binding message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Binding + * @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.cloud.securitycenter.v1.Kubernetes.Binding; + + /** + * Verifies a Binding 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 Binding message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Binding + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.Kubernetes.Binding; + + /** + * Creates a plain object from a Binding message. Also converts values to other types if specified. + * @param message Binding + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.Kubernetes.Binding, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Binding to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a Subject. */ + interface ISubject { + + /** Subject kind */ + kind?: (google.cloud.securitycenter.v1.Kubernetes.Subject.AuthType|keyof typeof google.cloud.securitycenter.v1.Kubernetes.Subject.AuthType|null); + + /** Subject ns */ + ns?: (string|null); + + /** Subject name */ + name?: (string|null); + } + + /** Represents a Subject. */ + class Subject implements ISubject { + + /** + * Constructs a new Subject. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.Kubernetes.ISubject); + + /** Subject kind. */ + public kind: (google.cloud.securitycenter.v1.Kubernetes.Subject.AuthType|keyof typeof google.cloud.securitycenter.v1.Kubernetes.Subject.AuthType); + + /** Subject ns. */ + public ns: string; + + /** Subject name. */ + public name: string; + + /** + * Creates a new Subject instance using the specified properties. + * @param [properties] Properties to set + * @returns Subject instance + */ + public static create(properties?: google.cloud.securitycenter.v1.Kubernetes.ISubject): google.cloud.securitycenter.v1.Kubernetes.Subject; + + /** + * Encodes the specified Subject message. Does not implicitly {@link google.cloud.securitycenter.v1.Kubernetes.Subject.verify|verify} messages. + * @param message Subject message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.Kubernetes.ISubject, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Subject message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Kubernetes.Subject.verify|verify} messages. + * @param message Subject message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.Kubernetes.ISubject, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Subject message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Subject + * @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.cloud.securitycenter.v1.Kubernetes.Subject; + + /** + * Decodes a Subject message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Subject + * @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.cloud.securitycenter.v1.Kubernetes.Subject; + + /** + * Verifies a Subject 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 Subject message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Subject + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.Kubernetes.Subject; + + /** + * Creates a plain object from a Subject message. Also converts values to other types if specified. + * @param message Subject + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.Kubernetes.Subject, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Subject to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace Subject { + + /** AuthType enum. */ + enum AuthType { + AUTH_TYPE_UNSPECIFIED = 0, + USER = 1, + SERVICEACCOUNT = 2, + GROUP = 3 + } + } + + /** Properties of an AccessReview. */ + interface IAccessReview { + + /** AccessReview group */ + group?: (string|null); + + /** AccessReview ns */ + ns?: (string|null); + + /** AccessReview name */ + name?: (string|null); + + /** AccessReview resource */ + resource?: (string|null); + + /** AccessReview subresource */ + subresource?: (string|null); + + /** AccessReview verb */ + verb?: (string|null); + + /** AccessReview version */ + version?: (string|null); + } + + /** Represents an AccessReview. */ + class AccessReview implements IAccessReview { + + /** + * Constructs a new AccessReview. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.Kubernetes.IAccessReview); + + /** AccessReview group. */ + public group: string; + + /** AccessReview ns. */ + public ns: string; + + /** AccessReview name. */ + public name: string; + + /** AccessReview resource. */ + public resource: string; + + /** AccessReview subresource. */ + public subresource: string; + + /** AccessReview verb. */ + public verb: string; + + /** AccessReview version. */ + public version: string; + + /** + * Creates a new AccessReview instance using the specified properties. + * @param [properties] Properties to set + * @returns AccessReview instance + */ + public static create(properties?: google.cloud.securitycenter.v1.Kubernetes.IAccessReview): google.cloud.securitycenter.v1.Kubernetes.AccessReview; + + /** + * Encodes the specified AccessReview message. Does not implicitly {@link google.cloud.securitycenter.v1.Kubernetes.AccessReview.verify|verify} messages. + * @param message AccessReview message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.Kubernetes.IAccessReview, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AccessReview message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Kubernetes.AccessReview.verify|verify} messages. + * @param message AccessReview message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.Kubernetes.IAccessReview, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AccessReview message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AccessReview + * @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.cloud.securitycenter.v1.Kubernetes.AccessReview; + + /** + * Decodes an AccessReview message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AccessReview + * @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.cloud.securitycenter.v1.Kubernetes.AccessReview; + + /** + * Verifies an AccessReview 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 AccessReview message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AccessReview + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.Kubernetes.AccessReview; + + /** + * Creates a plain object from an AccessReview message. Also converts values to other types if specified. + * @param message AccessReview + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.Kubernetes.AccessReview, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AccessReview to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + /** Properties of a MitreAttack. */ interface IMitreAttack { @@ -2831,7 +3923,8 @@ export namespace google { MODIFY_AUTHENTICATION_PROCESS = 28, DATA_DESTRUCTION = 29, DOMAIN_POLICY_MODIFICATION = 30, - IMPAIR_DEFENSES = 31 + IMPAIR_DEFENSES = 31, + NETWORK_SERVICE_DISCOVERY = 32 } } diff --git a/packages/google-cloud-securitycenter/protos/protos.js b/packages/google-cloud-securitycenter/protos/protos.js index 47f2c1cc3d6..09c32d1e282 100644 --- a/packages/google-cloud-securitycenter/protos/protos.js +++ b/packages/google-cloud-securitycenter/protos/protos.js @@ -3361,27 +3361,28 @@ return Contact; })(); - v1.Exfiltration = (function() { + v1.Container = (function() { /** - * Properties of an Exfiltration. + * Properties of a Container. * @memberof google.cloud.securitycenter.v1 - * @interface IExfiltration - * @property {Array.|null} [sources] Exfiltration sources - * @property {Array.|null} [targets] Exfiltration targets + * @interface IContainer + * @property {string|null} [name] Container name + * @property {string|null} [uri] Container uri + * @property {string|null} [imageId] Container imageId + * @property {Array.|null} [labels] Container labels */ /** - * Constructs a new Exfiltration. + * Constructs a new Container. * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents an Exfiltration. - * @implements IExfiltration + * @classdesc Represents a Container. + * @implements IContainer * @constructor - * @param {google.cloud.securitycenter.v1.IExfiltration=} [properties] Properties to set + * @param {google.cloud.securitycenter.v1.IContainer=} [properties] Properties to set */ - function Exfiltration(properties) { - this.sources = []; - this.targets = []; + function Container(properties) { + this.labels = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -3389,94 +3390,117 @@ } /** - * Exfiltration sources. - * @member {Array.} sources - * @memberof google.cloud.securitycenter.v1.Exfiltration + * Container name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1.Container * @instance */ - Exfiltration.prototype.sources = $util.emptyArray; + Container.prototype.name = ""; /** - * Exfiltration targets. - * @member {Array.} targets - * @memberof google.cloud.securitycenter.v1.Exfiltration + * Container uri. + * @member {string} uri + * @memberof google.cloud.securitycenter.v1.Container * @instance */ - Exfiltration.prototype.targets = $util.emptyArray; + Container.prototype.uri = ""; /** - * Creates a new Exfiltration instance using the specified properties. + * Container imageId. + * @member {string} imageId + * @memberof google.cloud.securitycenter.v1.Container + * @instance + */ + Container.prototype.imageId = ""; + + /** + * Container labels. + * @member {Array.} labels + * @memberof google.cloud.securitycenter.v1.Container + * @instance + */ + Container.prototype.labels = $util.emptyArray; + + /** + * Creates a new Container instance using the specified properties. * @function create - * @memberof google.cloud.securitycenter.v1.Exfiltration + * @memberof google.cloud.securitycenter.v1.Container * @static - * @param {google.cloud.securitycenter.v1.IExfiltration=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.Exfiltration} Exfiltration instance + * @param {google.cloud.securitycenter.v1.IContainer=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.Container} Container instance */ - Exfiltration.create = function create(properties) { - return new Exfiltration(properties); + Container.create = function create(properties) { + return new Container(properties); }; /** - * Encodes the specified Exfiltration message. Does not implicitly {@link google.cloud.securitycenter.v1.Exfiltration.verify|verify} messages. + * Encodes the specified Container message. Does not implicitly {@link google.cloud.securitycenter.v1.Container.verify|verify} messages. * @function encode - * @memberof google.cloud.securitycenter.v1.Exfiltration + * @memberof google.cloud.securitycenter.v1.Container * @static - * @param {google.cloud.securitycenter.v1.IExfiltration} message Exfiltration message or plain object to encode + * @param {google.cloud.securitycenter.v1.IContainer} message Container message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Exfiltration.encode = function encode(message, writer) { + Container.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.sources != null && message.sources.length) - for (var i = 0; i < message.sources.length; ++i) - $root.google.cloud.securitycenter.v1.ExfilResource.encode(message.sources[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.targets != null && message.targets.length) - for (var i = 0; i < message.targets.length; ++i) - $root.google.cloud.securitycenter.v1.ExfilResource.encode(message.targets[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.uri != null && Object.hasOwnProperty.call(message, "uri")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.uri); + if (message.imageId != null && Object.hasOwnProperty.call(message, "imageId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.imageId); + if (message.labels != null && message.labels.length) + for (var i = 0; i < message.labels.length; ++i) + $root.google.cloud.securitycenter.v1.Label.encode(message.labels[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); return writer; }; /** - * Encodes the specified Exfiltration message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Exfiltration.verify|verify} messages. + * Encodes the specified Container message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Container.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.Exfiltration + * @memberof google.cloud.securitycenter.v1.Container * @static - * @param {google.cloud.securitycenter.v1.IExfiltration} message Exfiltration message or plain object to encode + * @param {google.cloud.securitycenter.v1.IContainer} message Container message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Exfiltration.encodeDelimited = function encodeDelimited(message, writer) { + Container.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an Exfiltration message from the specified reader or buffer. + * Decodes a Container message from the specified reader or buffer. * @function decode - * @memberof google.cloud.securitycenter.v1.Exfiltration + * @memberof google.cloud.securitycenter.v1.Container * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.Exfiltration} Exfiltration + * @returns {google.cloud.securitycenter.v1.Container} Container * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Exfiltration.decode = function decode(reader, length) { + Container.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.cloud.securitycenter.v1.Exfiltration(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.Container(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - if (!(message.sources && message.sources.length)) - message.sources = []; - message.sources.push($root.google.cloud.securitycenter.v1.ExfilResource.decode(reader, reader.uint32())); + message.name = reader.string(); break; case 2: - if (!(message.targets && message.targets.length)) - message.targets = []; - message.targets.push($root.google.cloud.securitycenter.v1.ExfilResource.decode(reader, reader.uint32())); + message.uri = reader.string(); + break; + case 3: + message.imageId = reader.string(); + break; + case 4: + if (!(message.labels && message.labels.length)) + message.labels = []; + message.labels.push($root.google.cloud.securitycenter.v1.Label.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -3487,152 +3511,151 @@ }; /** - * Decodes an Exfiltration message from the specified reader or buffer, length delimited. + * Decodes a Container message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.Exfiltration + * @memberof google.cloud.securitycenter.v1.Container * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.Exfiltration} Exfiltration + * @returns {google.cloud.securitycenter.v1.Container} Container * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Exfiltration.decodeDelimited = function decodeDelimited(reader) { + Container.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an Exfiltration message. + * Verifies a Container message. * @function verify - * @memberof google.cloud.securitycenter.v1.Exfiltration + * @memberof google.cloud.securitycenter.v1.Container * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Exfiltration.verify = function verify(message) { + Container.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.sources != null && message.hasOwnProperty("sources")) { - if (!Array.isArray(message.sources)) - return "sources: array expected"; - for (var i = 0; i < message.sources.length; ++i) { - var error = $root.google.cloud.securitycenter.v1.ExfilResource.verify(message.sources[i]); - if (error) - return "sources." + error; - } - } - if (message.targets != null && message.hasOwnProperty("targets")) { - if (!Array.isArray(message.targets)) - return "targets: array expected"; - for (var i = 0; i < message.targets.length; ++i) { - var error = $root.google.cloud.securitycenter.v1.ExfilResource.verify(message.targets[i]); + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.uri != null && message.hasOwnProperty("uri")) + if (!$util.isString(message.uri)) + return "uri: string expected"; + if (message.imageId != null && message.hasOwnProperty("imageId")) + if (!$util.isString(message.imageId)) + return "imageId: string expected"; + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!Array.isArray(message.labels)) + return "labels: array expected"; + for (var i = 0; i < message.labels.length; ++i) { + var error = $root.google.cloud.securitycenter.v1.Label.verify(message.labels[i]); if (error) - return "targets." + error; + return "labels." + error; } } return null; }; /** - * Creates an Exfiltration message from a plain object. Also converts values to their respective internal types. + * Creates a Container message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.securitycenter.v1.Exfiltration + * @memberof google.cloud.securitycenter.v1.Container * @static * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.Exfiltration} Exfiltration + * @returns {google.cloud.securitycenter.v1.Container} Container */ - Exfiltration.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.Exfiltration) + Container.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.Container) return object; - var message = new $root.google.cloud.securitycenter.v1.Exfiltration(); - if (object.sources) { - if (!Array.isArray(object.sources)) - throw TypeError(".google.cloud.securitycenter.v1.Exfiltration.sources: array expected"); - message.sources = []; - for (var i = 0; i < object.sources.length; ++i) { - if (typeof object.sources[i] !== "object") - throw TypeError(".google.cloud.securitycenter.v1.Exfiltration.sources: object expected"); - message.sources[i] = $root.google.cloud.securitycenter.v1.ExfilResource.fromObject(object.sources[i]); - } - } - if (object.targets) { - if (!Array.isArray(object.targets)) - throw TypeError(".google.cloud.securitycenter.v1.Exfiltration.targets: array expected"); - message.targets = []; - for (var i = 0; i < object.targets.length; ++i) { - if (typeof object.targets[i] !== "object") - throw TypeError(".google.cloud.securitycenter.v1.Exfiltration.targets: object expected"); - message.targets[i] = $root.google.cloud.securitycenter.v1.ExfilResource.fromObject(object.targets[i]); + var message = new $root.google.cloud.securitycenter.v1.Container(); + if (object.name != null) + message.name = String(object.name); + if (object.uri != null) + message.uri = String(object.uri); + if (object.imageId != null) + message.imageId = String(object.imageId); + if (object.labels) { + if (!Array.isArray(object.labels)) + throw TypeError(".google.cloud.securitycenter.v1.Container.labels: array expected"); + message.labels = []; + for (var i = 0; i < object.labels.length; ++i) { + if (typeof object.labels[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Container.labels: object expected"); + message.labels[i] = $root.google.cloud.securitycenter.v1.Label.fromObject(object.labels[i]); } } return message; }; /** - * Creates a plain object from an Exfiltration message. Also converts values to other types if specified. + * Creates a plain object from a Container message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.securitycenter.v1.Exfiltration + * @memberof google.cloud.securitycenter.v1.Container * @static - * @param {google.cloud.securitycenter.v1.Exfiltration} message Exfiltration + * @param {google.cloud.securitycenter.v1.Container} message Container * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Exfiltration.toObject = function toObject(message, options) { + Container.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) { - object.sources = []; - object.targets = []; - } - if (message.sources && message.sources.length) { - object.sources = []; - for (var j = 0; j < message.sources.length; ++j) - object.sources[j] = $root.google.cloud.securitycenter.v1.ExfilResource.toObject(message.sources[j], options); + if (options.arrays || options.defaults) + object.labels = []; + if (options.defaults) { + object.name = ""; + object.uri = ""; + object.imageId = ""; } - if (message.targets && message.targets.length) { - object.targets = []; - for (var j = 0; j < message.targets.length; ++j) - object.targets[j] = $root.google.cloud.securitycenter.v1.ExfilResource.toObject(message.targets[j], options); + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.uri != null && message.hasOwnProperty("uri")) + object.uri = message.uri; + if (message.imageId != null && message.hasOwnProperty("imageId")) + object.imageId = message.imageId; + if (message.labels && message.labels.length) { + object.labels = []; + for (var j = 0; j < message.labels.length; ++j) + object.labels[j] = $root.google.cloud.securitycenter.v1.Label.toObject(message.labels[j], options); } return object; }; /** - * Converts this Exfiltration to JSON. + * Converts this Container to JSON. * @function toJSON - * @memberof google.cloud.securitycenter.v1.Exfiltration + * @memberof google.cloud.securitycenter.v1.Container * @instance * @returns {Object.} JSON object */ - Exfiltration.prototype.toJSON = function toJSON() { + Container.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return Exfiltration; + return Container; })(); - v1.ExfilResource = (function() { + v1.Label = (function() { /** - * Properties of an ExfilResource. + * Properties of a Label. * @memberof google.cloud.securitycenter.v1 - * @interface IExfilResource - * @property {string|null} [name] ExfilResource name - * @property {Array.|null} [components] ExfilResource components + * @interface ILabel + * @property {string|null} [name] Label name + * @property {string|null} [value] Label value */ /** - * Constructs a new ExfilResource. + * Constructs a new Label. * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents an ExfilResource. - * @implements IExfilResource + * @classdesc Represents a Label. + * @implements ILabel * @constructor - * @param {google.cloud.securitycenter.v1.IExfilResource=} [properties] Properties to set + * @param {google.cloud.securitycenter.v1.ILabel=} [properties] Properties to set */ - function ExfilResource(properties) { - this.components = []; + function Label(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -3640,81 +3663,80 @@ } /** - * ExfilResource name. + * Label name. * @member {string} name - * @memberof google.cloud.securitycenter.v1.ExfilResource + * @memberof google.cloud.securitycenter.v1.Label * @instance */ - ExfilResource.prototype.name = ""; + Label.prototype.name = ""; /** - * ExfilResource components. - * @member {Array.} components - * @memberof google.cloud.securitycenter.v1.ExfilResource + * Label value. + * @member {string} value + * @memberof google.cloud.securitycenter.v1.Label * @instance */ - ExfilResource.prototype.components = $util.emptyArray; + Label.prototype.value = ""; /** - * Creates a new ExfilResource instance using the specified properties. + * Creates a new Label instance using the specified properties. * @function create - * @memberof google.cloud.securitycenter.v1.ExfilResource + * @memberof google.cloud.securitycenter.v1.Label * @static - * @param {google.cloud.securitycenter.v1.IExfilResource=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.ExfilResource} ExfilResource instance + * @param {google.cloud.securitycenter.v1.ILabel=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.Label} Label instance */ - ExfilResource.create = function create(properties) { - return new ExfilResource(properties); + Label.create = function create(properties) { + return new Label(properties); }; /** - * Encodes the specified ExfilResource message. Does not implicitly {@link google.cloud.securitycenter.v1.ExfilResource.verify|verify} messages. + * Encodes the specified Label message. Does not implicitly {@link google.cloud.securitycenter.v1.Label.verify|verify} messages. * @function encode - * @memberof google.cloud.securitycenter.v1.ExfilResource + * @memberof google.cloud.securitycenter.v1.Label * @static - * @param {google.cloud.securitycenter.v1.IExfilResource} message ExfilResource message or plain object to encode + * @param {google.cloud.securitycenter.v1.ILabel} message Label message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ExfilResource.encode = function encode(message, writer) { + Label.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.components != null && message.components.length) - for (var i = 0; i < message.components.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.components[i]); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.value); return writer; }; /** - * Encodes the specified ExfilResource message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ExfilResource.verify|verify} messages. + * Encodes the specified Label message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Label.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.ExfilResource + * @memberof google.cloud.securitycenter.v1.Label * @static - * @param {google.cloud.securitycenter.v1.IExfilResource} message ExfilResource message or plain object to encode + * @param {google.cloud.securitycenter.v1.ILabel} message Label message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ExfilResource.encodeDelimited = function encodeDelimited(message, writer) { + Label.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an ExfilResource message from the specified reader or buffer. + * Decodes a Label message from the specified reader or buffer. * @function decode - * @memberof google.cloud.securitycenter.v1.ExfilResource + * @memberof google.cloud.securitycenter.v1.Label * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.ExfilResource} ExfilResource + * @returns {google.cloud.securitycenter.v1.Label} Label * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ExfilResource.decode = function decode(reader, length) { + Label.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.cloud.securitycenter.v1.ExfilResource(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.Label(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -3722,9 +3744,7 @@ message.name = reader.string(); break; case 2: - if (!(message.components && message.components.length)) - message.components = []; - message.components.push(reader.string()); + message.value = reader.string(); break; default: reader.skipType(tag & 7); @@ -3735,133 +3755,119 @@ }; /** - * Decodes an ExfilResource message from the specified reader or buffer, length delimited. + * Decodes a Label message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.ExfilResource + * @memberof google.cloud.securitycenter.v1.Label * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.ExfilResource} ExfilResource + * @returns {google.cloud.securitycenter.v1.Label} Label * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ExfilResource.decodeDelimited = function decodeDelimited(reader) { + Label.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an ExfilResource message. + * Verifies a Label message. * @function verify - * @memberof google.cloud.securitycenter.v1.ExfilResource + * @memberof google.cloud.securitycenter.v1.Label * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ExfilResource.verify = function verify(message) { + Label.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.components != null && message.hasOwnProperty("components")) { - if (!Array.isArray(message.components)) - return "components: array expected"; - for (var i = 0; i < message.components.length; ++i) - if (!$util.isString(message.components[i])) - return "components: string[] expected"; - } + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isString(message.value)) + return "value: string expected"; return null; }; /** - * Creates an ExfilResource message from a plain object. Also converts values to their respective internal types. + * Creates a Label message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.securitycenter.v1.ExfilResource + * @memberof google.cloud.securitycenter.v1.Label * @static * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.ExfilResource} ExfilResource + * @returns {google.cloud.securitycenter.v1.Label} Label */ - ExfilResource.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.ExfilResource) + Label.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.Label) return object; - var message = new $root.google.cloud.securitycenter.v1.ExfilResource(); + var message = new $root.google.cloud.securitycenter.v1.Label(); if (object.name != null) message.name = String(object.name); - if (object.components) { - if (!Array.isArray(object.components)) - throw TypeError(".google.cloud.securitycenter.v1.ExfilResource.components: array expected"); - message.components = []; - for (var i = 0; i < object.components.length; ++i) - message.components[i] = String(object.components[i]); - } + if (object.value != null) + message.value = String(object.value); return message; }; /** - * Creates a plain object from an ExfilResource message. Also converts values to other types if specified. + * Creates a plain object from a Label message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.securitycenter.v1.ExfilResource + * @memberof google.cloud.securitycenter.v1.Label * @static - * @param {google.cloud.securitycenter.v1.ExfilResource} message ExfilResource + * @param {google.cloud.securitycenter.v1.Label} message Label * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ExfilResource.toObject = function toObject(message, options) { + Label.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.components = []; - if (options.defaults) + if (options.defaults) { object.name = ""; + object.value = ""; + } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; - if (message.components && message.components.length) { - object.components = []; - for (var j = 0; j < message.components.length; ++j) - object.components[j] = message.components[j]; - } + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; return object; }; /** - * Converts this ExfilResource to JSON. + * Converts this Label to JSON. * @function toJSON - * @memberof google.cloud.securitycenter.v1.ExfilResource + * @memberof google.cloud.securitycenter.v1.Label * @instance * @returns {Object.} JSON object */ - ExfilResource.prototype.toJSON = function toJSON() { + Label.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ExfilResource; + return Label; })(); - v1.ExternalSystem = (function() { + v1.Exfiltration = (function() { /** - * Properties of an ExternalSystem. + * Properties of an Exfiltration. * @memberof google.cloud.securitycenter.v1 - * @interface IExternalSystem - * @property {string|null} [name] ExternalSystem name - * @property {Array.|null} [assignees] ExternalSystem assignees - * @property {string|null} [externalUid] ExternalSystem externalUid - * @property {string|null} [status] ExternalSystem status - * @property {google.protobuf.ITimestamp|null} [externalSystemUpdateTime] ExternalSystem externalSystemUpdateTime + * @interface IExfiltration + * @property {Array.|null} [sources] Exfiltration sources + * @property {Array.|null} [targets] Exfiltration targets */ /** - * Constructs a new ExternalSystem. + * Constructs a new Exfiltration. * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents an ExternalSystem. - * @implements IExternalSystem + * @classdesc Represents an Exfiltration. + * @implements IExfiltration * @constructor - * @param {google.cloud.securitycenter.v1.IExternalSystem=} [properties] Properties to set + * @param {google.cloud.securitycenter.v1.IExfiltration=} [properties] Properties to set */ - function ExternalSystem(properties) { - this.assignees = []; + function Exfiltration(properties) { + this.sources = []; + this.targets = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -3869,130 +3875,94 @@ } /** - * ExternalSystem name. - * @member {string} name - * @memberof google.cloud.securitycenter.v1.ExternalSystem - * @instance - */ - ExternalSystem.prototype.name = ""; - - /** - * ExternalSystem assignees. - * @member {Array.} assignees - * @memberof google.cloud.securitycenter.v1.ExternalSystem - * @instance - */ - ExternalSystem.prototype.assignees = $util.emptyArray; - - /** - * ExternalSystem externalUid. - * @member {string} externalUid - * @memberof google.cloud.securitycenter.v1.ExternalSystem - * @instance - */ - ExternalSystem.prototype.externalUid = ""; - - /** - * ExternalSystem status. - * @member {string} status - * @memberof google.cloud.securitycenter.v1.ExternalSystem + * Exfiltration sources. + * @member {Array.} sources + * @memberof google.cloud.securitycenter.v1.Exfiltration * @instance */ - ExternalSystem.prototype.status = ""; + Exfiltration.prototype.sources = $util.emptyArray; /** - * ExternalSystem externalSystemUpdateTime. - * @member {google.protobuf.ITimestamp|null|undefined} externalSystemUpdateTime - * @memberof google.cloud.securitycenter.v1.ExternalSystem + * Exfiltration targets. + * @member {Array.} targets + * @memberof google.cloud.securitycenter.v1.Exfiltration * @instance */ - ExternalSystem.prototype.externalSystemUpdateTime = null; + Exfiltration.prototype.targets = $util.emptyArray; /** - * Creates a new ExternalSystem instance using the specified properties. + * Creates a new Exfiltration instance using the specified properties. * @function create - * @memberof google.cloud.securitycenter.v1.ExternalSystem + * @memberof google.cloud.securitycenter.v1.Exfiltration * @static - * @param {google.cloud.securitycenter.v1.IExternalSystem=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.ExternalSystem} ExternalSystem instance + * @param {google.cloud.securitycenter.v1.IExfiltration=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.Exfiltration} Exfiltration instance */ - ExternalSystem.create = function create(properties) { - return new ExternalSystem(properties); + Exfiltration.create = function create(properties) { + return new Exfiltration(properties); }; /** - * Encodes the specified ExternalSystem message. Does not implicitly {@link google.cloud.securitycenter.v1.ExternalSystem.verify|verify} messages. + * Encodes the specified Exfiltration message. Does not implicitly {@link google.cloud.securitycenter.v1.Exfiltration.verify|verify} messages. * @function encode - * @memberof google.cloud.securitycenter.v1.ExternalSystem + * @memberof google.cloud.securitycenter.v1.Exfiltration * @static - * @param {google.cloud.securitycenter.v1.IExternalSystem} message ExternalSystem message or plain object to encode + * @param {google.cloud.securitycenter.v1.IExfiltration} message Exfiltration message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ExternalSystem.encode = function encode(message, writer) { + Exfiltration.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.assignees != null && message.assignees.length) - for (var i = 0; i < message.assignees.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.assignees[i]); - if (message.externalUid != null && Object.hasOwnProperty.call(message, "externalUid")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.externalUid); - if (message.status != null && Object.hasOwnProperty.call(message, "status")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.status); - if (message.externalSystemUpdateTime != null && Object.hasOwnProperty.call(message, "externalSystemUpdateTime")) - $root.google.protobuf.Timestamp.encode(message.externalSystemUpdateTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.sources != null && message.sources.length) + for (var i = 0; i < message.sources.length; ++i) + $root.google.cloud.securitycenter.v1.ExfilResource.encode(message.sources[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.targets != null && message.targets.length) + for (var i = 0; i < message.targets.length; ++i) + $root.google.cloud.securitycenter.v1.ExfilResource.encode(message.targets[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** - * Encodes the specified ExternalSystem message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ExternalSystem.verify|verify} messages. + * Encodes the specified Exfiltration message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Exfiltration.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.ExternalSystem + * @memberof google.cloud.securitycenter.v1.Exfiltration * @static - * @param {google.cloud.securitycenter.v1.IExternalSystem} message ExternalSystem message or plain object to encode + * @param {google.cloud.securitycenter.v1.IExfiltration} message Exfiltration message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ExternalSystem.encodeDelimited = function encodeDelimited(message, writer) { + Exfiltration.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an ExternalSystem message from the specified reader or buffer. + * Decodes an Exfiltration message from the specified reader or buffer. * @function decode - * @memberof google.cloud.securitycenter.v1.ExternalSystem + * @memberof google.cloud.securitycenter.v1.Exfiltration * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.ExternalSystem} ExternalSystem + * @returns {google.cloud.securitycenter.v1.Exfiltration} Exfiltration * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ExternalSystem.decode = function decode(reader, length) { + Exfiltration.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.cloud.securitycenter.v1.ExternalSystem(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.Exfiltration(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.name = reader.string(); + if (!(message.sources && message.sources.length)) + message.sources = []; + message.sources.push($root.google.cloud.securitycenter.v1.ExfilResource.decode(reader, reader.uint32())); break; case 2: - if (!(message.assignees && message.assignees.length)) - message.assignees = []; - message.assignees.push(reader.string()); - break; - case 3: - message.externalUid = reader.string(); - break; - case 4: - message.status = reader.string(); - break; - case 5: - message.externalSystemUpdateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + if (!(message.targets && message.targets.length)) + message.targets = []; + message.targets.push($root.google.cloud.securitycenter.v1.ExfilResource.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -4003,163 +3973,152 @@ }; /** - * Decodes an ExternalSystem message from the specified reader or buffer, length delimited. + * Decodes an Exfiltration message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.ExternalSystem + * @memberof google.cloud.securitycenter.v1.Exfiltration * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.ExternalSystem} ExternalSystem + * @returns {google.cloud.securitycenter.v1.Exfiltration} Exfiltration * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ExternalSystem.decodeDelimited = function decodeDelimited(reader) { + Exfiltration.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an ExternalSystem message. + * Verifies an Exfiltration message. * @function verify - * @memberof google.cloud.securitycenter.v1.ExternalSystem + * @memberof google.cloud.securitycenter.v1.Exfiltration * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ExternalSystem.verify = function verify(message) { + Exfiltration.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.assignees != null && message.hasOwnProperty("assignees")) { - if (!Array.isArray(message.assignees)) - return "assignees: array expected"; - for (var i = 0; i < message.assignees.length; ++i) - if (!$util.isString(message.assignees[i])) - return "assignees: string[] expected"; + if (message.sources != null && message.hasOwnProperty("sources")) { + if (!Array.isArray(message.sources)) + return "sources: array expected"; + for (var i = 0; i < message.sources.length; ++i) { + var error = $root.google.cloud.securitycenter.v1.ExfilResource.verify(message.sources[i]); + if (error) + return "sources." + error; + } } - if (message.externalUid != null && message.hasOwnProperty("externalUid")) - if (!$util.isString(message.externalUid)) - return "externalUid: string expected"; - if (message.status != null && message.hasOwnProperty("status")) - if (!$util.isString(message.status)) - return "status: string expected"; - if (message.externalSystemUpdateTime != null && message.hasOwnProperty("externalSystemUpdateTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.externalSystemUpdateTime); - if (error) - return "externalSystemUpdateTime." + error; + if (message.targets != null && message.hasOwnProperty("targets")) { + if (!Array.isArray(message.targets)) + return "targets: array expected"; + for (var i = 0; i < message.targets.length; ++i) { + var error = $root.google.cloud.securitycenter.v1.ExfilResource.verify(message.targets[i]); + if (error) + return "targets." + error; + } } return null; }; /** - * Creates an ExternalSystem message from a plain object. Also converts values to their respective internal types. + * Creates an Exfiltration message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.securitycenter.v1.ExternalSystem + * @memberof google.cloud.securitycenter.v1.Exfiltration * @static * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.ExternalSystem} ExternalSystem + * @returns {google.cloud.securitycenter.v1.Exfiltration} Exfiltration */ - ExternalSystem.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.ExternalSystem) + Exfiltration.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.Exfiltration) return object; - var message = new $root.google.cloud.securitycenter.v1.ExternalSystem(); - if (object.name != null) - message.name = String(object.name); - if (object.assignees) { - if (!Array.isArray(object.assignees)) - throw TypeError(".google.cloud.securitycenter.v1.ExternalSystem.assignees: array expected"); - message.assignees = []; - for (var i = 0; i < object.assignees.length; ++i) - message.assignees[i] = String(object.assignees[i]); + var message = new $root.google.cloud.securitycenter.v1.Exfiltration(); + if (object.sources) { + if (!Array.isArray(object.sources)) + throw TypeError(".google.cloud.securitycenter.v1.Exfiltration.sources: array expected"); + message.sources = []; + for (var i = 0; i < object.sources.length; ++i) { + if (typeof object.sources[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Exfiltration.sources: object expected"); + message.sources[i] = $root.google.cloud.securitycenter.v1.ExfilResource.fromObject(object.sources[i]); + } } - if (object.externalUid != null) - message.externalUid = String(object.externalUid); - if (object.status != null) - message.status = String(object.status); - if (object.externalSystemUpdateTime != null) { - if (typeof object.externalSystemUpdateTime !== "object") - throw TypeError(".google.cloud.securitycenter.v1.ExternalSystem.externalSystemUpdateTime: object expected"); - message.externalSystemUpdateTime = $root.google.protobuf.Timestamp.fromObject(object.externalSystemUpdateTime); + if (object.targets) { + if (!Array.isArray(object.targets)) + throw TypeError(".google.cloud.securitycenter.v1.Exfiltration.targets: array expected"); + message.targets = []; + for (var i = 0; i < object.targets.length; ++i) { + if (typeof object.targets[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Exfiltration.targets: object expected"); + message.targets[i] = $root.google.cloud.securitycenter.v1.ExfilResource.fromObject(object.targets[i]); + } } return message; }; /** - * Creates a plain object from an ExternalSystem message. Also converts values to other types if specified. + * Creates a plain object from an Exfiltration message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.securitycenter.v1.ExternalSystem + * @memberof google.cloud.securitycenter.v1.Exfiltration * @static - * @param {google.cloud.securitycenter.v1.ExternalSystem} message ExternalSystem + * @param {google.cloud.securitycenter.v1.Exfiltration} message Exfiltration * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ExternalSystem.toObject = function toObject(message, options) { + Exfiltration.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.assignees = []; - if (options.defaults) { - object.name = ""; - object.externalUid = ""; - object.status = ""; - object.externalSystemUpdateTime = null; + if (options.arrays || options.defaults) { + object.sources = []; + object.targets = []; } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.assignees && message.assignees.length) { - object.assignees = []; - for (var j = 0; j < message.assignees.length; ++j) - object.assignees[j] = message.assignees[j]; + if (message.sources && message.sources.length) { + object.sources = []; + for (var j = 0; j < message.sources.length; ++j) + object.sources[j] = $root.google.cloud.securitycenter.v1.ExfilResource.toObject(message.sources[j], options); + } + if (message.targets && message.targets.length) { + object.targets = []; + for (var j = 0; j < message.targets.length; ++j) + object.targets[j] = $root.google.cloud.securitycenter.v1.ExfilResource.toObject(message.targets[j], options); } - if (message.externalUid != null && message.hasOwnProperty("externalUid")) - object.externalUid = message.externalUid; - if (message.status != null && message.hasOwnProperty("status")) - object.status = message.status; - if (message.externalSystemUpdateTime != null && message.hasOwnProperty("externalSystemUpdateTime")) - object.externalSystemUpdateTime = $root.google.protobuf.Timestamp.toObject(message.externalSystemUpdateTime, options); return object; }; /** - * Converts this ExternalSystem to JSON. + * Converts this Exfiltration to JSON. * @function toJSON - * @memberof google.cloud.securitycenter.v1.ExternalSystem + * @memberof google.cloud.securitycenter.v1.Exfiltration * @instance * @returns {Object.} JSON object */ - ExternalSystem.prototype.toJSON = function toJSON() { + Exfiltration.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ExternalSystem; + return Exfiltration; })(); - v1.File = (function() { + v1.ExfilResource = (function() { /** - * Properties of a File. + * Properties of an ExfilResource. * @memberof google.cloud.securitycenter.v1 - * @interface IFile - * @property {string|null} [path] File path - * @property {number|Long|null} [size] File size - * @property {string|null} [sha256] File sha256 - * @property {number|Long|null} [hashedSize] File hashedSize - * @property {boolean|null} [partiallyHashed] File partiallyHashed - * @property {string|null} [contents] File contents + * @interface IExfilResource + * @property {string|null} [name] ExfilResource name + * @property {Array.|null} [components] ExfilResource components */ /** - * Constructs a new File. + * Constructs a new ExfilResource. * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents a File. - * @implements IFile + * @classdesc Represents an ExfilResource. + * @implements IExfilResource * @constructor - * @param {google.cloud.securitycenter.v1.IFile=} [properties] Properties to set + * @param {google.cloud.securitycenter.v1.IExfilResource=} [properties] Properties to set */ - function File(properties) { + function ExfilResource(properties) { + this.components = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -4167,140 +4126,91 @@ } /** - * File path. - * @member {string} path - * @memberof google.cloud.securitycenter.v1.File - * @instance - */ - File.prototype.path = ""; - - /** - * File size. - * @member {number|Long} size - * @memberof google.cloud.securitycenter.v1.File - * @instance - */ - File.prototype.size = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * File sha256. - * @member {string} sha256 - * @memberof google.cloud.securitycenter.v1.File - * @instance - */ - File.prototype.sha256 = ""; - - /** - * File hashedSize. - * @member {number|Long} hashedSize - * @memberof google.cloud.securitycenter.v1.File - * @instance - */ - File.prototype.hashedSize = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * File partiallyHashed. - * @member {boolean} partiallyHashed - * @memberof google.cloud.securitycenter.v1.File + * ExfilResource name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1.ExfilResource * @instance */ - File.prototype.partiallyHashed = false; + ExfilResource.prototype.name = ""; /** - * File contents. - * @member {string} contents - * @memberof google.cloud.securitycenter.v1.File + * ExfilResource components. + * @member {Array.} components + * @memberof google.cloud.securitycenter.v1.ExfilResource * @instance */ - File.prototype.contents = ""; + ExfilResource.prototype.components = $util.emptyArray; /** - * Creates a new File instance using the specified properties. + * Creates a new ExfilResource instance using the specified properties. * @function create - * @memberof google.cloud.securitycenter.v1.File + * @memberof google.cloud.securitycenter.v1.ExfilResource * @static - * @param {google.cloud.securitycenter.v1.IFile=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.File} File instance + * @param {google.cloud.securitycenter.v1.IExfilResource=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.ExfilResource} ExfilResource instance */ - File.create = function create(properties) { - return new File(properties); + ExfilResource.create = function create(properties) { + return new ExfilResource(properties); }; /** - * Encodes the specified File message. Does not implicitly {@link google.cloud.securitycenter.v1.File.verify|verify} messages. + * Encodes the specified ExfilResource message. Does not implicitly {@link google.cloud.securitycenter.v1.ExfilResource.verify|verify} messages. * @function encode - * @memberof google.cloud.securitycenter.v1.File + * @memberof google.cloud.securitycenter.v1.ExfilResource * @static - * @param {google.cloud.securitycenter.v1.IFile} message File message or plain object to encode + * @param {google.cloud.securitycenter.v1.IExfilResource} message ExfilResource message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - File.encode = function encode(message, writer) { + ExfilResource.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.path != null && Object.hasOwnProperty.call(message, "path")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.path); - if (message.size != null && Object.hasOwnProperty.call(message, "size")) - writer.uint32(/* id 2, wireType 0 =*/16).int64(message.size); - if (message.sha256 != null && Object.hasOwnProperty.call(message, "sha256")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.sha256); - if (message.hashedSize != null && Object.hasOwnProperty.call(message, "hashedSize")) - writer.uint32(/* id 4, wireType 0 =*/32).int64(message.hashedSize); - if (message.partiallyHashed != null && Object.hasOwnProperty.call(message, "partiallyHashed")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.partiallyHashed); - if (message.contents != null && Object.hasOwnProperty.call(message, "contents")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.contents); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.components != null && message.components.length) + for (var i = 0; i < message.components.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.components[i]); return writer; }; /** - * Encodes the specified File message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.File.verify|verify} messages. + * Encodes the specified ExfilResource message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ExfilResource.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.File + * @memberof google.cloud.securitycenter.v1.ExfilResource * @static - * @param {google.cloud.securitycenter.v1.IFile} message File message or plain object to encode + * @param {google.cloud.securitycenter.v1.IExfilResource} message ExfilResource message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - File.encodeDelimited = function encodeDelimited(message, writer) { + ExfilResource.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a File message from the specified reader or buffer. + * Decodes an ExfilResource message from the specified reader or buffer. * @function decode - * @memberof google.cloud.securitycenter.v1.File + * @memberof google.cloud.securitycenter.v1.ExfilResource * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.File} File + * @returns {google.cloud.securitycenter.v1.ExfilResource} ExfilResource * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - File.decode = function decode(reader, length) { + ExfilResource.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.cloud.securitycenter.v1.File(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.ExfilResource(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.path = reader.string(); + message.name = reader.string(); break; case 2: - message.size = reader.int64(); - break; - case 3: - message.sha256 = reader.string(); - break; - case 4: - message.hashedSize = reader.int64(); - break; - case 5: - message.partiallyHashed = reader.bool(); - break; - case 6: - message.contents = reader.string(); + if (!(message.components && message.components.length)) + message.components = []; + message.components.push(reader.string()); break; default: reader.skipType(tag & 7); @@ -4311,211 +4221,133 @@ }; /** - * Decodes a File message from the specified reader or buffer, length delimited. + * Decodes an ExfilResource message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.File + * @memberof google.cloud.securitycenter.v1.ExfilResource * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.File} File + * @returns {google.cloud.securitycenter.v1.ExfilResource} ExfilResource * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - File.decodeDelimited = function decodeDelimited(reader) { + ExfilResource.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a File message. + * Verifies an ExfilResource message. * @function verify - * @memberof google.cloud.securitycenter.v1.File + * @memberof google.cloud.securitycenter.v1.ExfilResource * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - File.verify = function verify(message) { + ExfilResource.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.path != null && message.hasOwnProperty("path")) - if (!$util.isString(message.path)) - return "path: string expected"; - if (message.size != null && message.hasOwnProperty("size")) - if (!$util.isInteger(message.size) && !(message.size && $util.isInteger(message.size.low) && $util.isInteger(message.size.high))) - return "size: integer|Long expected"; - if (message.sha256 != null && message.hasOwnProperty("sha256")) - if (!$util.isString(message.sha256)) - return "sha256: string expected"; - if (message.hashedSize != null && message.hasOwnProperty("hashedSize")) - if (!$util.isInteger(message.hashedSize) && !(message.hashedSize && $util.isInteger(message.hashedSize.low) && $util.isInteger(message.hashedSize.high))) - return "hashedSize: integer|Long expected"; - if (message.partiallyHashed != null && message.hasOwnProperty("partiallyHashed")) - if (typeof message.partiallyHashed !== "boolean") - return "partiallyHashed: boolean expected"; - if (message.contents != null && message.hasOwnProperty("contents")) - if (!$util.isString(message.contents)) - return "contents: string expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.components != null && message.hasOwnProperty("components")) { + if (!Array.isArray(message.components)) + return "components: array expected"; + for (var i = 0; i < message.components.length; ++i) + if (!$util.isString(message.components[i])) + return "components: string[] expected"; + } return null; }; /** - * Creates a File message from a plain object. Also converts values to their respective internal types. + * Creates an ExfilResource message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.securitycenter.v1.File + * @memberof google.cloud.securitycenter.v1.ExfilResource * @static * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.File} File + * @returns {google.cloud.securitycenter.v1.ExfilResource} ExfilResource */ - File.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.File) + ExfilResource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.ExfilResource) return object; - var message = new $root.google.cloud.securitycenter.v1.File(); - if (object.path != null) - message.path = String(object.path); - if (object.size != null) - if ($util.Long) - (message.size = $util.Long.fromValue(object.size)).unsigned = false; - else if (typeof object.size === "string") - message.size = parseInt(object.size, 10); - else if (typeof object.size === "number") - message.size = object.size; - else if (typeof object.size === "object") - message.size = new $util.LongBits(object.size.low >>> 0, object.size.high >>> 0).toNumber(); - if (object.sha256 != null) - message.sha256 = String(object.sha256); - if (object.hashedSize != null) - if ($util.Long) - (message.hashedSize = $util.Long.fromValue(object.hashedSize)).unsigned = false; - else if (typeof object.hashedSize === "string") - message.hashedSize = parseInt(object.hashedSize, 10); - else if (typeof object.hashedSize === "number") - message.hashedSize = object.hashedSize; - else if (typeof object.hashedSize === "object") - message.hashedSize = new $util.LongBits(object.hashedSize.low >>> 0, object.hashedSize.high >>> 0).toNumber(); - if (object.partiallyHashed != null) - message.partiallyHashed = Boolean(object.partiallyHashed); - if (object.contents != null) - message.contents = String(object.contents); + var message = new $root.google.cloud.securitycenter.v1.ExfilResource(); + if (object.name != null) + message.name = String(object.name); + if (object.components) { + if (!Array.isArray(object.components)) + throw TypeError(".google.cloud.securitycenter.v1.ExfilResource.components: array expected"); + message.components = []; + for (var i = 0; i < object.components.length; ++i) + message.components[i] = String(object.components[i]); + } return message; }; /** - * Creates a plain object from a File message. Also converts values to other types if specified. + * Creates a plain object from an ExfilResource message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.securitycenter.v1.File + * @memberof google.cloud.securitycenter.v1.ExfilResource * @static - * @param {google.cloud.securitycenter.v1.File} message File + * @param {google.cloud.securitycenter.v1.ExfilResource} message ExfilResource * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - File.toObject = function toObject(message, options) { + ExfilResource.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.path = ""; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.size = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.size = options.longs === String ? "0" : 0; - object.sha256 = ""; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.hashedSize = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.hashedSize = options.longs === String ? "0" : 0; - object.partiallyHashed = false; - object.contents = ""; + if (options.arrays || options.defaults) + object.components = []; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.components && message.components.length) { + object.components = []; + for (var j = 0; j < message.components.length; ++j) + object.components[j] = message.components[j]; } - if (message.path != null && message.hasOwnProperty("path")) - object.path = message.path; - if (message.size != null && message.hasOwnProperty("size")) - if (typeof message.size === "number") - object.size = options.longs === String ? String(message.size) : message.size; - else - object.size = options.longs === String ? $util.Long.prototype.toString.call(message.size) : options.longs === Number ? new $util.LongBits(message.size.low >>> 0, message.size.high >>> 0).toNumber() : message.size; - if (message.sha256 != null && message.hasOwnProperty("sha256")) - object.sha256 = message.sha256; - if (message.hashedSize != null && message.hasOwnProperty("hashedSize")) - if (typeof message.hashedSize === "number") - object.hashedSize = options.longs === String ? String(message.hashedSize) : message.hashedSize; - else - object.hashedSize = options.longs === String ? $util.Long.prototype.toString.call(message.hashedSize) : options.longs === Number ? new $util.LongBits(message.hashedSize.low >>> 0, message.hashedSize.high >>> 0).toNumber() : message.hashedSize; - if (message.partiallyHashed != null && message.hasOwnProperty("partiallyHashed")) - object.partiallyHashed = message.partiallyHashed; - if (message.contents != null && message.hasOwnProperty("contents")) - object.contents = message.contents; return object; }; /** - * Converts this File to JSON. + * Converts this ExfilResource to JSON. * @function toJSON - * @memberof google.cloud.securitycenter.v1.File + * @memberof google.cloud.securitycenter.v1.ExfilResource * @instance * @returns {Object.} JSON object */ - File.prototype.toJSON = function toJSON() { + ExfilResource.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return File; + return ExfilResource; })(); - v1.Finding = (function() { + v1.ExternalSystem = (function() { /** - * Properties of a Finding. + * Properties of an ExternalSystem. * @memberof google.cloud.securitycenter.v1 - * @interface IFinding - * @property {string|null} [name] Finding name - * @property {string|null} [parent] Finding parent - * @property {string|null} [resourceName] Finding resourceName - * @property {google.cloud.securitycenter.v1.Finding.State|null} [state] Finding state - * @property {string|null} [category] Finding category - * @property {string|null} [externalUri] Finding externalUri - * @property {Object.|null} [sourceProperties] Finding sourceProperties - * @property {google.cloud.securitycenter.v1.ISecurityMarks|null} [securityMarks] Finding securityMarks - * @property {google.protobuf.ITimestamp|null} [eventTime] Finding eventTime - * @property {google.protobuf.ITimestamp|null} [createTime] Finding createTime - * @property {google.cloud.securitycenter.v1.Finding.Severity|null} [severity] Finding severity - * @property {string|null} [canonicalName] Finding canonicalName - * @property {google.cloud.securitycenter.v1.Finding.Mute|null} [mute] Finding mute - * @property {google.cloud.securitycenter.v1.Finding.FindingClass|null} [findingClass] Finding findingClass - * @property {google.cloud.securitycenter.v1.IIndicator|null} [indicator] Finding indicator - * @property {google.cloud.securitycenter.v1.IVulnerability|null} [vulnerability] Finding vulnerability - * @property {google.protobuf.ITimestamp|null} [muteUpdateTime] Finding muteUpdateTime - * @property {Object.|null} [externalSystems] Finding externalSystems - * @property {google.cloud.securitycenter.v1.IMitreAttack|null} [mitreAttack] Finding mitreAttack - * @property {google.cloud.securitycenter.v1.IAccess|null} [access] Finding access - * @property {Array.|null} [connections] Finding connections - * @property {string|null} [muteInitiator] Finding muteInitiator - * @property {Array.|null} [processes] Finding processes - * @property {Object.|null} [contacts] Finding contacts - * @property {Array.|null} [compliances] Finding compliances - * @property {string|null} [description] Finding description - * @property {google.cloud.securitycenter.v1.IExfiltration|null} [exfiltration] Finding exfiltration - * @property {Array.|null} [iamBindings] Finding iamBindings - * @property {string|null} [nextSteps] Finding nextSteps + * @interface IExternalSystem + * @property {string|null} [name] ExternalSystem name + * @property {Array.|null} [assignees] ExternalSystem assignees + * @property {string|null} [externalUid] ExternalSystem externalUid + * @property {string|null} [status] ExternalSystem status + * @property {google.protobuf.ITimestamp|null} [externalSystemUpdateTime] ExternalSystem externalSystemUpdateTime */ /** - * Constructs a new Finding. + * Constructs a new ExternalSystem. * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents a Finding. - * @implements IFinding + * @classdesc Represents an ExternalSystem. + * @implements IExternalSystem * @constructor - * @param {google.cloud.securitycenter.v1.IFinding=} [properties] Properties to set + * @param {google.cloud.securitycenter.v1.IExternalSystem=} [properties] Properties to set */ - function Finding(properties) { - this.sourceProperties = {}; - this.externalSystems = {}; - this.connections = []; - this.processes = []; - this.contacts = {}; - this.compliances = []; - this.iamBindings = []; + function ExternalSystem(properties) { + this.assignees = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -4523,520 +4355,441 @@ } /** - * Finding name. + * ExternalSystem name. * @member {string} name - * @memberof google.cloud.securitycenter.v1.Finding + * @memberof google.cloud.securitycenter.v1.ExternalSystem * @instance */ - Finding.prototype.name = ""; + ExternalSystem.prototype.name = ""; /** - * Finding parent. - * @member {string} parent - * @memberof google.cloud.securitycenter.v1.Finding + * ExternalSystem assignees. + * @member {Array.} assignees + * @memberof google.cloud.securitycenter.v1.ExternalSystem * @instance */ - Finding.prototype.parent = ""; + ExternalSystem.prototype.assignees = $util.emptyArray; /** - * Finding resourceName. - * @member {string} resourceName - * @memberof google.cloud.securitycenter.v1.Finding + * ExternalSystem externalUid. + * @member {string} externalUid + * @memberof google.cloud.securitycenter.v1.ExternalSystem * @instance */ - Finding.prototype.resourceName = ""; + ExternalSystem.prototype.externalUid = ""; /** - * Finding state. - * @member {google.cloud.securitycenter.v1.Finding.State} state - * @memberof google.cloud.securitycenter.v1.Finding + * ExternalSystem status. + * @member {string} status + * @memberof google.cloud.securitycenter.v1.ExternalSystem * @instance */ - Finding.prototype.state = 0; + ExternalSystem.prototype.status = ""; /** - * Finding category. - * @member {string} category - * @memberof google.cloud.securitycenter.v1.Finding + * ExternalSystem externalSystemUpdateTime. + * @member {google.protobuf.ITimestamp|null|undefined} externalSystemUpdateTime + * @memberof google.cloud.securitycenter.v1.ExternalSystem * @instance */ - Finding.prototype.category = ""; + ExternalSystem.prototype.externalSystemUpdateTime = null; /** - * Finding externalUri. - * @member {string} externalUri - * @memberof google.cloud.securitycenter.v1.Finding - * @instance + * Creates a new ExternalSystem instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.ExternalSystem + * @static + * @param {google.cloud.securitycenter.v1.IExternalSystem=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.ExternalSystem} ExternalSystem instance */ - Finding.prototype.externalUri = ""; + ExternalSystem.create = function create(properties) { + return new ExternalSystem(properties); + }; /** - * Finding sourceProperties. - * @member {Object.} sourceProperties - * @memberof google.cloud.securitycenter.v1.Finding - * @instance + * Encodes the specified ExternalSystem message. Does not implicitly {@link google.cloud.securitycenter.v1.ExternalSystem.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.ExternalSystem + * @static + * @param {google.cloud.securitycenter.v1.IExternalSystem} message ExternalSystem message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - Finding.prototype.sourceProperties = $util.emptyObject; + ExternalSystem.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.assignees != null && message.assignees.length) + for (var i = 0; i < message.assignees.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.assignees[i]); + if (message.externalUid != null && Object.hasOwnProperty.call(message, "externalUid")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.externalUid); + if (message.status != null && Object.hasOwnProperty.call(message, "status")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.status); + if (message.externalSystemUpdateTime != null && Object.hasOwnProperty.call(message, "externalSystemUpdateTime")) + $root.google.protobuf.Timestamp.encode(message.externalSystemUpdateTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; /** - * Finding securityMarks. - * @member {google.cloud.securitycenter.v1.ISecurityMarks|null|undefined} securityMarks - * @memberof google.cloud.securitycenter.v1.Finding - * @instance + * Encodes the specified ExternalSystem message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ExternalSystem.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.ExternalSystem + * @static + * @param {google.cloud.securitycenter.v1.IExternalSystem} message ExternalSystem message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - Finding.prototype.securityMarks = null; + ExternalSystem.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; /** - * Finding eventTime. - * @member {google.protobuf.ITimestamp|null|undefined} eventTime - * @memberof google.cloud.securitycenter.v1.Finding - * @instance + * Decodes an ExternalSystem message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.ExternalSystem + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.ExternalSystem} ExternalSystem + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Finding.prototype.eventTime = null; + ExternalSystem.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.cloud.securitycenter.v1.ExternalSystem(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + if (!(message.assignees && message.assignees.length)) + message.assignees = []; + message.assignees.push(reader.string()); + break; + case 3: + message.externalUid = reader.string(); + break; + case 4: + message.status = reader.string(); + break; + case 5: + message.externalSystemUpdateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; /** - * Finding createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.securitycenter.v1.Finding - * @instance - */ - Finding.prototype.createTime = null; - - /** - * Finding severity. - * @member {google.cloud.securitycenter.v1.Finding.Severity} severity - * @memberof google.cloud.securitycenter.v1.Finding - * @instance + * Decodes an ExternalSystem message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.ExternalSystem + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.ExternalSystem} ExternalSystem + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Finding.prototype.severity = 0; + ExternalSystem.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; /** - * Finding canonicalName. - * @member {string} canonicalName - * @memberof google.cloud.securitycenter.v1.Finding - * @instance + * Verifies an ExternalSystem message. + * @function verify + * @memberof google.cloud.securitycenter.v1.ExternalSystem + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Finding.prototype.canonicalName = ""; + ExternalSystem.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.assignees != null && message.hasOwnProperty("assignees")) { + if (!Array.isArray(message.assignees)) + return "assignees: array expected"; + for (var i = 0; i < message.assignees.length; ++i) + if (!$util.isString(message.assignees[i])) + return "assignees: string[] expected"; + } + if (message.externalUid != null && message.hasOwnProperty("externalUid")) + if (!$util.isString(message.externalUid)) + return "externalUid: string expected"; + if (message.status != null && message.hasOwnProperty("status")) + if (!$util.isString(message.status)) + return "status: string expected"; + if (message.externalSystemUpdateTime != null && message.hasOwnProperty("externalSystemUpdateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.externalSystemUpdateTime); + if (error) + return "externalSystemUpdateTime." + error; + } + return null; + }; /** - * Finding mute. - * @member {google.cloud.securitycenter.v1.Finding.Mute} mute - * @memberof google.cloud.securitycenter.v1.Finding - * @instance + * Creates an ExternalSystem message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.ExternalSystem + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.ExternalSystem} ExternalSystem */ - Finding.prototype.mute = 0; + ExternalSystem.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.ExternalSystem) + return object; + var message = new $root.google.cloud.securitycenter.v1.ExternalSystem(); + if (object.name != null) + message.name = String(object.name); + if (object.assignees) { + if (!Array.isArray(object.assignees)) + throw TypeError(".google.cloud.securitycenter.v1.ExternalSystem.assignees: array expected"); + message.assignees = []; + for (var i = 0; i < object.assignees.length; ++i) + message.assignees[i] = String(object.assignees[i]); + } + if (object.externalUid != null) + message.externalUid = String(object.externalUid); + if (object.status != null) + message.status = String(object.status); + if (object.externalSystemUpdateTime != null) { + if (typeof object.externalSystemUpdateTime !== "object") + throw TypeError(".google.cloud.securitycenter.v1.ExternalSystem.externalSystemUpdateTime: object expected"); + message.externalSystemUpdateTime = $root.google.protobuf.Timestamp.fromObject(object.externalSystemUpdateTime); + } + return message; + }; /** - * Finding findingClass. - * @member {google.cloud.securitycenter.v1.Finding.FindingClass} findingClass - * @memberof google.cloud.securitycenter.v1.Finding - * @instance + * Creates a plain object from an ExternalSystem message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.ExternalSystem + * @static + * @param {google.cloud.securitycenter.v1.ExternalSystem} message ExternalSystem + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object */ - Finding.prototype.findingClass = 0; + ExternalSystem.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.assignees = []; + if (options.defaults) { + object.name = ""; + object.externalUid = ""; + object.status = ""; + object.externalSystemUpdateTime = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.assignees && message.assignees.length) { + object.assignees = []; + for (var j = 0; j < message.assignees.length; ++j) + object.assignees[j] = message.assignees[j]; + } + if (message.externalUid != null && message.hasOwnProperty("externalUid")) + object.externalUid = message.externalUid; + if (message.status != null && message.hasOwnProperty("status")) + object.status = message.status; + if (message.externalSystemUpdateTime != null && message.hasOwnProperty("externalSystemUpdateTime")) + object.externalSystemUpdateTime = $root.google.protobuf.Timestamp.toObject(message.externalSystemUpdateTime, options); + return object; + }; /** - * Finding indicator. - * @member {google.cloud.securitycenter.v1.IIndicator|null|undefined} indicator - * @memberof google.cloud.securitycenter.v1.Finding + * Converts this ExternalSystem to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.ExternalSystem * @instance + * @returns {Object.} JSON object */ - Finding.prototype.indicator = null; + ExternalSystem.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Finding vulnerability. - * @member {google.cloud.securitycenter.v1.IVulnerability|null|undefined} vulnerability - * @memberof google.cloud.securitycenter.v1.Finding - * @instance - */ - Finding.prototype.vulnerability = null; + return ExternalSystem; + })(); - /** - * Finding muteUpdateTime. - * @member {google.protobuf.ITimestamp|null|undefined} muteUpdateTime - * @memberof google.cloud.securitycenter.v1.Finding - * @instance - */ - Finding.prototype.muteUpdateTime = null; + v1.File = (function() { /** - * Finding externalSystems. - * @member {Object.} externalSystems - * @memberof google.cloud.securitycenter.v1.Finding - * @instance + * Properties of a File. + * @memberof google.cloud.securitycenter.v1 + * @interface IFile + * @property {string|null} [path] File path + * @property {number|Long|null} [size] File size + * @property {string|null} [sha256] File sha256 + * @property {number|Long|null} [hashedSize] File hashedSize + * @property {boolean|null} [partiallyHashed] File partiallyHashed + * @property {string|null} [contents] File contents */ - Finding.prototype.externalSystems = $util.emptyObject; /** - * Finding mitreAttack. - * @member {google.cloud.securitycenter.v1.IMitreAttack|null|undefined} mitreAttack - * @memberof google.cloud.securitycenter.v1.Finding - * @instance + * Constructs a new File. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a File. + * @implements IFile + * @constructor + * @param {google.cloud.securitycenter.v1.IFile=} [properties] Properties to set */ - Finding.prototype.mitreAttack = null; + function File(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]]; + } /** - * Finding access. - * @member {google.cloud.securitycenter.v1.IAccess|null|undefined} access - * @memberof google.cloud.securitycenter.v1.Finding + * File path. + * @member {string} path + * @memberof google.cloud.securitycenter.v1.File * @instance */ - Finding.prototype.access = null; + File.prototype.path = ""; /** - * Finding connections. - * @member {Array.} connections - * @memberof google.cloud.securitycenter.v1.Finding + * File size. + * @member {number|Long} size + * @memberof google.cloud.securitycenter.v1.File * @instance */ - Finding.prototype.connections = $util.emptyArray; + File.prototype.size = $util.Long ? $util.Long.fromBits(0,0,false) : 0; /** - * Finding muteInitiator. - * @member {string} muteInitiator - * @memberof google.cloud.securitycenter.v1.Finding + * File sha256. + * @member {string} sha256 + * @memberof google.cloud.securitycenter.v1.File * @instance */ - Finding.prototype.muteInitiator = ""; + File.prototype.sha256 = ""; /** - * Finding processes. - * @member {Array.} processes - * @memberof google.cloud.securitycenter.v1.Finding + * File hashedSize. + * @member {number|Long} hashedSize + * @memberof google.cloud.securitycenter.v1.File * @instance */ - Finding.prototype.processes = $util.emptyArray; + File.prototype.hashedSize = $util.Long ? $util.Long.fromBits(0,0,false) : 0; /** - * Finding contacts. - * @member {Object.} contacts - * @memberof google.cloud.securitycenter.v1.Finding + * File partiallyHashed. + * @member {boolean} partiallyHashed + * @memberof google.cloud.securitycenter.v1.File * @instance */ - Finding.prototype.contacts = $util.emptyObject; + File.prototype.partiallyHashed = false; /** - * Finding compliances. - * @member {Array.} compliances - * @memberof google.cloud.securitycenter.v1.Finding + * File contents. + * @member {string} contents + * @memberof google.cloud.securitycenter.v1.File * @instance */ - Finding.prototype.compliances = $util.emptyArray; + File.prototype.contents = ""; /** - * Finding description. - * @member {string} description - * @memberof google.cloud.securitycenter.v1.Finding - * @instance + * Creates a new File instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.File + * @static + * @param {google.cloud.securitycenter.v1.IFile=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.File} File instance */ - Finding.prototype.description = ""; + File.create = function create(properties) { + return new File(properties); + }; /** - * Finding exfiltration. - * @member {google.cloud.securitycenter.v1.IExfiltration|null|undefined} exfiltration - * @memberof google.cloud.securitycenter.v1.Finding - * @instance - */ - Finding.prototype.exfiltration = null; - - /** - * Finding iamBindings. - * @member {Array.} iamBindings - * @memberof google.cloud.securitycenter.v1.Finding - * @instance - */ - Finding.prototype.iamBindings = $util.emptyArray; - - /** - * Finding nextSteps. - * @member {string} nextSteps - * @memberof google.cloud.securitycenter.v1.Finding - * @instance - */ - Finding.prototype.nextSteps = ""; - - /** - * Creates a new Finding instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v1.Finding - * @static - * @param {google.cloud.securitycenter.v1.IFinding=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.Finding} Finding instance - */ - Finding.create = function create(properties) { - return new Finding(properties); - }; - - /** - * Encodes the specified Finding message. Does not implicitly {@link google.cloud.securitycenter.v1.Finding.verify|verify} messages. + * Encodes the specified File message. Does not implicitly {@link google.cloud.securitycenter.v1.File.verify|verify} messages. * @function encode - * @memberof google.cloud.securitycenter.v1.Finding + * @memberof google.cloud.securitycenter.v1.File * @static - * @param {google.cloud.securitycenter.v1.IFinding} message Finding message or plain object to encode + * @param {google.cloud.securitycenter.v1.IFile} message File message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Finding.encode = function encode(message, writer) { + File.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.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.parent); - if (message.resourceName != null && Object.hasOwnProperty.call(message, "resourceName")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.resourceName); - if (message.state != null && Object.hasOwnProperty.call(message, "state")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.state); - if (message.category != null && Object.hasOwnProperty.call(message, "category")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.category); - if (message.externalUri != null && Object.hasOwnProperty.call(message, "externalUri")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.externalUri); - if (message.sourceProperties != null && Object.hasOwnProperty.call(message, "sourceProperties")) - for (var keys = Object.keys(message.sourceProperties), i = 0; i < keys.length; ++i) { - writer.uint32(/* id 7, wireType 2 =*/58).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); - $root.google.protobuf.Value.encode(message.sourceProperties[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); - } - if (message.securityMarks != null && Object.hasOwnProperty.call(message, "securityMarks")) - $root.google.cloud.securitycenter.v1.SecurityMarks.encode(message.securityMarks, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.eventTime != null && Object.hasOwnProperty.call(message, "eventTime")) - $root.google.protobuf.Timestamp.encode(message.eventTime, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); - if (message.severity != null && Object.hasOwnProperty.call(message, "severity")) - writer.uint32(/* id 12, wireType 0 =*/96).int32(message.severity); - if (message.canonicalName != null && Object.hasOwnProperty.call(message, "canonicalName")) - writer.uint32(/* id 14, wireType 2 =*/114).string(message.canonicalName); - if (message.mute != null && Object.hasOwnProperty.call(message, "mute")) - writer.uint32(/* id 15, wireType 0 =*/120).int32(message.mute); - if (message.findingClass != null && Object.hasOwnProperty.call(message, "findingClass")) - writer.uint32(/* id 17, wireType 0 =*/136).int32(message.findingClass); - if (message.indicator != null && Object.hasOwnProperty.call(message, "indicator")) - $root.google.cloud.securitycenter.v1.Indicator.encode(message.indicator, writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); - if (message.vulnerability != null && Object.hasOwnProperty.call(message, "vulnerability")) - $root.google.cloud.securitycenter.v1.Vulnerability.encode(message.vulnerability, writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); - if (message.muteUpdateTime != null && Object.hasOwnProperty.call(message, "muteUpdateTime")) - $root.google.protobuf.Timestamp.encode(message.muteUpdateTime, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); - if (message.externalSystems != null && Object.hasOwnProperty.call(message, "externalSystems")) - for (var keys = Object.keys(message.externalSystems), i = 0; i < keys.length; ++i) { - writer.uint32(/* id 22, wireType 2 =*/178).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); - $root.google.cloud.securitycenter.v1.ExternalSystem.encode(message.externalSystems[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); - } - if (message.mitreAttack != null && Object.hasOwnProperty.call(message, "mitreAttack")) - $root.google.cloud.securitycenter.v1.MitreAttack.encode(message.mitreAttack, writer.uint32(/* id 25, wireType 2 =*/202).fork()).ldelim(); - if (message.access != null && Object.hasOwnProperty.call(message, "access")) - $root.google.cloud.securitycenter.v1.Access.encode(message.access, writer.uint32(/* id 26, wireType 2 =*/210).fork()).ldelim(); - if (message.muteInitiator != null && Object.hasOwnProperty.call(message, "muteInitiator")) - writer.uint32(/* id 28, wireType 2 =*/226).string(message.muteInitiator); - if (message.processes != null && message.processes.length) - for (var i = 0; i < message.processes.length; ++i) - $root.google.cloud.securitycenter.v1.Process.encode(message.processes[i], writer.uint32(/* id 30, wireType 2 =*/242).fork()).ldelim(); - if (message.connections != null && message.connections.length) - for (var i = 0; i < message.connections.length; ++i) - $root.google.cloud.securitycenter.v1.Connection.encode(message.connections[i], writer.uint32(/* id 31, wireType 2 =*/250).fork()).ldelim(); - if (message.contacts != null && Object.hasOwnProperty.call(message, "contacts")) - for (var keys = Object.keys(message.contacts), i = 0; i < keys.length; ++i) { - writer.uint32(/* id 33, wireType 2 =*/266).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); - $root.google.cloud.securitycenter.v1.ContactDetails.encode(message.contacts[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); - } - if (message.compliances != null && message.compliances.length) - for (var i = 0; i < message.compliances.length; ++i) - $root.google.cloud.securitycenter.v1.Compliance.encode(message.compliances[i], writer.uint32(/* id 34, wireType 2 =*/274).fork()).ldelim(); - if (message.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 37, wireType 2 =*/298).string(message.description); - if (message.exfiltration != null && Object.hasOwnProperty.call(message, "exfiltration")) - $root.google.cloud.securitycenter.v1.Exfiltration.encode(message.exfiltration, writer.uint32(/* id 38, wireType 2 =*/306).fork()).ldelim(); - if (message.iamBindings != null && message.iamBindings.length) - for (var i = 0; i < message.iamBindings.length; ++i) - $root.google.cloud.securitycenter.v1.IamBinding.encode(message.iamBindings[i], writer.uint32(/* id 39, wireType 2 =*/314).fork()).ldelim(); - if (message.nextSteps != null && Object.hasOwnProperty.call(message, "nextSteps")) - writer.uint32(/* id 40, wireType 2 =*/322).string(message.nextSteps); + if (message.path != null && Object.hasOwnProperty.call(message, "path")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.path); + if (message.size != null && Object.hasOwnProperty.call(message, "size")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.size); + if (message.sha256 != null && Object.hasOwnProperty.call(message, "sha256")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.sha256); + if (message.hashedSize != null && Object.hasOwnProperty.call(message, "hashedSize")) + writer.uint32(/* id 4, wireType 0 =*/32).int64(message.hashedSize); + if (message.partiallyHashed != null && Object.hasOwnProperty.call(message, "partiallyHashed")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.partiallyHashed); + if (message.contents != null && Object.hasOwnProperty.call(message, "contents")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.contents); return writer; }; /** - * Encodes the specified Finding message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Finding.verify|verify} messages. + * Encodes the specified File message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.File.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.Finding + * @memberof google.cloud.securitycenter.v1.File * @static - * @param {google.cloud.securitycenter.v1.IFinding} message Finding message or plain object to encode + * @param {google.cloud.securitycenter.v1.IFile} message File message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Finding.encodeDelimited = function encodeDelimited(message, writer) { + File.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a Finding message from the specified reader or buffer. + * Decodes a File message from the specified reader or buffer. * @function decode - * @memberof google.cloud.securitycenter.v1.Finding + * @memberof google.cloud.securitycenter.v1.File * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.Finding} Finding + * @returns {google.cloud.securitycenter.v1.File} File * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Finding.decode = function decode(reader, length) { + File.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.cloud.securitycenter.v1.Finding(), key, value; + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.File(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.name = reader.string(); + message.path = reader.string(); break; case 2: - message.parent = reader.string(); + message.size = reader.int64(); break; case 3: - message.resourceName = reader.string(); + message.sha256 = reader.string(); break; case 4: - message.state = reader.int32(); + message.hashedSize = reader.int64(); break; case 5: - message.category = reader.string(); + message.partiallyHashed = reader.bool(); break; case 6: - message.externalUri = reader.string(); - break; - case 7: - if (message.sourceProperties === $util.emptyObject) - message.sourceProperties = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = null; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = $root.google.protobuf.Value.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.sourceProperties[key] = value; - break; - case 8: - message.securityMarks = $root.google.cloud.securitycenter.v1.SecurityMarks.decode(reader, reader.uint32()); - break; - case 9: - message.eventTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 10: - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 12: - message.severity = reader.int32(); - break; - case 14: - message.canonicalName = reader.string(); - break; - case 15: - message.mute = reader.int32(); - break; - case 17: - message.findingClass = reader.int32(); - break; - case 18: - message.indicator = $root.google.cloud.securitycenter.v1.Indicator.decode(reader, reader.uint32()); - break; - case 20: - message.vulnerability = $root.google.cloud.securitycenter.v1.Vulnerability.decode(reader, reader.uint32()); - break; - case 21: - message.muteUpdateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 22: - if (message.externalSystems === $util.emptyObject) - message.externalSystems = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = null; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = $root.google.cloud.securitycenter.v1.ExternalSystem.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.externalSystems[key] = value; - break; - case 25: - message.mitreAttack = $root.google.cloud.securitycenter.v1.MitreAttack.decode(reader, reader.uint32()); - break; - case 26: - message.access = $root.google.cloud.securitycenter.v1.Access.decode(reader, reader.uint32()); - break; - case 31: - if (!(message.connections && message.connections.length)) - message.connections = []; - message.connections.push($root.google.cloud.securitycenter.v1.Connection.decode(reader, reader.uint32())); - break; - case 28: - message.muteInitiator = reader.string(); + message.contents = reader.string(); break; - case 30: - if (!(message.processes && message.processes.length)) - message.processes = []; - message.processes.push($root.google.cloud.securitycenter.v1.Process.decode(reader, reader.uint32())); - break; - case 33: - if (message.contacts === $util.emptyObject) - message.contacts = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = null; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = $root.google.cloud.securitycenter.v1.ContactDetails.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.contacts[key] = value; - break; - case 34: - if (!(message.compliances && message.compliances.length)) - message.compliances = []; - message.compliances.push($root.google.cloud.securitycenter.v1.Compliance.decode(reader, reader.uint32())); - break; - case 37: - message.description = reader.string(); - break; - case 38: - message.exfiltration = $root.google.cloud.securitycenter.v1.Exfiltration.decode(reader, reader.uint32()); - break; - case 39: - if (!(message.iamBindings && message.iamBindings.length)) - message.iamBindings = []; - message.iamBindings.push($root.google.cloud.securitycenter.v1.IamBinding.decode(reader, reader.uint32())); - break; - case 40: - message.nextSteps = reader.string(); - break; - default: - reader.skipType(tag & 7); + default: + reader.skipType(tag & 7); break; } } @@ -5044,1334 +4797,3909 @@ }; /** - * Decodes a Finding message from the specified reader or buffer, length delimited. + * Decodes a File message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.Finding + * @memberof google.cloud.securitycenter.v1.File * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.Finding} Finding + * @returns {google.cloud.securitycenter.v1.File} File * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Finding.decodeDelimited = function decodeDelimited(reader) { + File.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a Finding message. + * Verifies a File message. * @function verify - * @memberof google.cloud.securitycenter.v1.Finding + * @memberof google.cloud.securitycenter.v1.File * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Finding.verify = function verify(message) { + File.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.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.resourceName != null && message.hasOwnProperty("resourceName")) - if (!$util.isString(message.resourceName)) - return "resourceName: string expected"; - if (message.state != null && message.hasOwnProperty("state")) - switch (message.state) { - default: - return "state: 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"; - if (message.externalUri != null && message.hasOwnProperty("externalUri")) - if (!$util.isString(message.externalUri)) - return "externalUri: string expected"; - if (message.sourceProperties != null && message.hasOwnProperty("sourceProperties")) { - if (!$util.isObject(message.sourceProperties)) - return "sourceProperties: object expected"; - var key = Object.keys(message.sourceProperties); - for (var i = 0; i < key.length; ++i) { - var error = $root.google.protobuf.Value.verify(message.sourceProperties[key[i]]); - if (error) - return "sourceProperties." + error; - } - } - if (message.securityMarks != null && message.hasOwnProperty("securityMarks")) { - var error = $root.google.cloud.securitycenter.v1.SecurityMarks.verify(message.securityMarks); - if (error) - return "securityMarks." + error; - } - if (message.eventTime != null && message.hasOwnProperty("eventTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.eventTime); - if (error) - return "eventTime." + error; - } - if (message.createTime != null && message.hasOwnProperty("createTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.createTime); - if (error) - return "createTime." + error; - } - if (message.severity != null && message.hasOwnProperty("severity")) - switch (message.severity) { - default: - return "severity: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - break; - } - if (message.canonicalName != null && message.hasOwnProperty("canonicalName")) - if (!$util.isString(message.canonicalName)) - return "canonicalName: string expected"; - if (message.mute != null && message.hasOwnProperty("mute")) - switch (message.mute) { - default: - return "mute: enum value expected"; - case 0: - case 1: - case 2: - case 4: - break; - } - if (message.findingClass != null && message.hasOwnProperty("findingClass")) - switch (message.findingClass) { - default: - return "findingClass: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - break; - } - if (message.indicator != null && message.hasOwnProperty("indicator")) { - var error = $root.google.cloud.securitycenter.v1.Indicator.verify(message.indicator); - if (error) - return "indicator." + error; - } - if (message.vulnerability != null && message.hasOwnProperty("vulnerability")) { - var error = $root.google.cloud.securitycenter.v1.Vulnerability.verify(message.vulnerability); - if (error) - return "vulnerability." + error; - } - if (message.muteUpdateTime != null && message.hasOwnProperty("muteUpdateTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.muteUpdateTime); - if (error) - return "muteUpdateTime." + error; - } - if (message.externalSystems != null && message.hasOwnProperty("externalSystems")) { - if (!$util.isObject(message.externalSystems)) - return "externalSystems: object expected"; - var key = Object.keys(message.externalSystems); - for (var i = 0; i < key.length; ++i) { - var error = $root.google.cloud.securitycenter.v1.ExternalSystem.verify(message.externalSystems[key[i]]); - if (error) - return "externalSystems." + error; - } - } - if (message.mitreAttack != null && message.hasOwnProperty("mitreAttack")) { - var error = $root.google.cloud.securitycenter.v1.MitreAttack.verify(message.mitreAttack); - if (error) - return "mitreAttack." + error; - } - if (message.access != null && message.hasOwnProperty("access")) { - var error = $root.google.cloud.securitycenter.v1.Access.verify(message.access); - if (error) - return "access." + error; - } - if (message.connections != null && message.hasOwnProperty("connections")) { - if (!Array.isArray(message.connections)) - return "connections: array expected"; - for (var i = 0; i < message.connections.length; ++i) { - var error = $root.google.cloud.securitycenter.v1.Connection.verify(message.connections[i]); - if (error) - return "connections." + error; - } - } - if (message.muteInitiator != null && message.hasOwnProperty("muteInitiator")) - if (!$util.isString(message.muteInitiator)) - return "muteInitiator: string expected"; - if (message.processes != null && message.hasOwnProperty("processes")) { - if (!Array.isArray(message.processes)) - return "processes: array expected"; - for (var i = 0; i < message.processes.length; ++i) { - var error = $root.google.cloud.securitycenter.v1.Process.verify(message.processes[i]); - if (error) - return "processes." + error; - } - } - if (message.contacts != null && message.hasOwnProperty("contacts")) { - if (!$util.isObject(message.contacts)) - return "contacts: object expected"; - var key = Object.keys(message.contacts); - for (var i = 0; i < key.length; ++i) { - var error = $root.google.cloud.securitycenter.v1.ContactDetails.verify(message.contacts[key[i]]); - if (error) - return "contacts." + error; - } - } - if (message.compliances != null && message.hasOwnProperty("compliances")) { - if (!Array.isArray(message.compliances)) - return "compliances: array expected"; - for (var i = 0; i < message.compliances.length; ++i) { - var error = $root.google.cloud.securitycenter.v1.Compliance.verify(message.compliances[i]); - if (error) - return "compliances." + error; - } - } - if (message.description != null && message.hasOwnProperty("description")) - if (!$util.isString(message.description)) - return "description: string expected"; - if (message.exfiltration != null && message.hasOwnProperty("exfiltration")) { - var error = $root.google.cloud.securitycenter.v1.Exfiltration.verify(message.exfiltration); - if (error) - return "exfiltration." + error; - } - if (message.iamBindings != null && message.hasOwnProperty("iamBindings")) { - if (!Array.isArray(message.iamBindings)) - return "iamBindings: array expected"; - for (var i = 0; i < message.iamBindings.length; ++i) { - var error = $root.google.cloud.securitycenter.v1.IamBinding.verify(message.iamBindings[i]); - if (error) - return "iamBindings." + error; - } - } - if (message.nextSteps != null && message.hasOwnProperty("nextSteps")) - if (!$util.isString(message.nextSteps)) - return "nextSteps: string expected"; + if (message.path != null && message.hasOwnProperty("path")) + if (!$util.isString(message.path)) + return "path: string expected"; + if (message.size != null && message.hasOwnProperty("size")) + if (!$util.isInteger(message.size) && !(message.size && $util.isInteger(message.size.low) && $util.isInteger(message.size.high))) + return "size: integer|Long expected"; + if (message.sha256 != null && message.hasOwnProperty("sha256")) + if (!$util.isString(message.sha256)) + return "sha256: string expected"; + if (message.hashedSize != null && message.hasOwnProperty("hashedSize")) + if (!$util.isInteger(message.hashedSize) && !(message.hashedSize && $util.isInteger(message.hashedSize.low) && $util.isInteger(message.hashedSize.high))) + return "hashedSize: integer|Long expected"; + if (message.partiallyHashed != null && message.hasOwnProperty("partiallyHashed")) + if (typeof message.partiallyHashed !== "boolean") + return "partiallyHashed: boolean expected"; + if (message.contents != null && message.hasOwnProperty("contents")) + if (!$util.isString(message.contents)) + return "contents: string expected"; return null; }; /** - * Creates a Finding message from a plain object. Also converts values to their respective internal types. + * Creates a File message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.securitycenter.v1.Finding + * @memberof google.cloud.securitycenter.v1.File * @static * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.Finding} Finding + * @returns {google.cloud.securitycenter.v1.File} File */ - Finding.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.Finding) + File.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.File) return object; - var message = new $root.google.cloud.securitycenter.v1.Finding(); - if (object.name != null) - message.name = String(object.name); - if (object.parent != null) - message.parent = String(object.parent); - if (object.resourceName != null) - message.resourceName = String(object.resourceName); - switch (object.state) { - case "STATE_UNSPECIFIED": - case 0: - message.state = 0; - break; - case "ACTIVE": - case 1: - message.state = 1; - break; - case "INACTIVE": - case 2: - message.state = 2; - break; - } - if (object.category != null) - message.category = String(object.category); - if (object.externalUri != null) - message.externalUri = String(object.externalUri); - if (object.sourceProperties) { - if (typeof object.sourceProperties !== "object") - throw TypeError(".google.cloud.securitycenter.v1.Finding.sourceProperties: object expected"); - message.sourceProperties = {}; - for (var keys = Object.keys(object.sourceProperties), i = 0; i < keys.length; ++i) { - if (typeof object.sourceProperties[keys[i]] !== "object") - throw TypeError(".google.cloud.securitycenter.v1.Finding.sourceProperties: object expected"); - message.sourceProperties[keys[i]] = $root.google.protobuf.Value.fromObject(object.sourceProperties[keys[i]]); - } - } - if (object.securityMarks != null) { - if (typeof object.securityMarks !== "object") - throw TypeError(".google.cloud.securitycenter.v1.Finding.securityMarks: object expected"); - message.securityMarks = $root.google.cloud.securitycenter.v1.SecurityMarks.fromObject(object.securityMarks); - } - if (object.eventTime != null) { - if (typeof object.eventTime !== "object") - throw TypeError(".google.cloud.securitycenter.v1.Finding.eventTime: object expected"); - message.eventTime = $root.google.protobuf.Timestamp.fromObject(object.eventTime); - } - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.securitycenter.v1.Finding.createTime: object expected"); - message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); - } - switch (object.severity) { - case "SEVERITY_UNSPECIFIED": - case 0: - message.severity = 0; - break; - case "CRITICAL": - case 1: - message.severity = 1; - break; - case "HIGH": - case 2: - message.severity = 2; - break; - case "MEDIUM": - case 3: - message.severity = 3; - break; - case "LOW": - case 4: - message.severity = 4; - break; - } - if (object.canonicalName != null) - message.canonicalName = String(object.canonicalName); - switch (object.mute) { - case "MUTE_UNSPECIFIED": - case 0: - message.mute = 0; - break; - case "MUTED": - case 1: - message.mute = 1; - break; - case "UNMUTED": - case 2: - message.mute = 2; - break; - case "UNDEFINED": - case 4: - message.mute = 4; - break; - } - switch (object.findingClass) { - case "FINDING_CLASS_UNSPECIFIED": - case 0: - message.findingClass = 0; - break; - case "THREAT": - case 1: - message.findingClass = 1; - break; - case "VULNERABILITY": - case 2: - message.findingClass = 2; - break; - case "MISCONFIGURATION": - case 3: - message.findingClass = 3; - break; - case "OBSERVATION": - case 4: - message.findingClass = 4; - break; - case "SCC_ERROR": - case 5: - message.findingClass = 5; - break; - } - if (object.indicator != null) { - if (typeof object.indicator !== "object") - throw TypeError(".google.cloud.securitycenter.v1.Finding.indicator: object expected"); - message.indicator = $root.google.cloud.securitycenter.v1.Indicator.fromObject(object.indicator); - } - if (object.vulnerability != null) { - if (typeof object.vulnerability !== "object") - throw TypeError(".google.cloud.securitycenter.v1.Finding.vulnerability: object expected"); - message.vulnerability = $root.google.cloud.securitycenter.v1.Vulnerability.fromObject(object.vulnerability); - } - if (object.muteUpdateTime != null) { - if (typeof object.muteUpdateTime !== "object") - throw TypeError(".google.cloud.securitycenter.v1.Finding.muteUpdateTime: object expected"); - message.muteUpdateTime = $root.google.protobuf.Timestamp.fromObject(object.muteUpdateTime); - } - if (object.externalSystems) { - if (typeof object.externalSystems !== "object") - throw TypeError(".google.cloud.securitycenter.v1.Finding.externalSystems: object expected"); - message.externalSystems = {}; - for (var keys = Object.keys(object.externalSystems), i = 0; i < keys.length; ++i) { - if (typeof object.externalSystems[keys[i]] !== "object") - throw TypeError(".google.cloud.securitycenter.v1.Finding.externalSystems: object expected"); - message.externalSystems[keys[i]] = $root.google.cloud.securitycenter.v1.ExternalSystem.fromObject(object.externalSystems[keys[i]]); - } - } - if (object.mitreAttack != null) { - if (typeof object.mitreAttack !== "object") - throw TypeError(".google.cloud.securitycenter.v1.Finding.mitreAttack: object expected"); - message.mitreAttack = $root.google.cloud.securitycenter.v1.MitreAttack.fromObject(object.mitreAttack); - } - if (object.access != null) { - if (typeof object.access !== "object") - throw TypeError(".google.cloud.securitycenter.v1.Finding.access: object expected"); - message.access = $root.google.cloud.securitycenter.v1.Access.fromObject(object.access); - } - if (object.connections) { - if (!Array.isArray(object.connections)) - throw TypeError(".google.cloud.securitycenter.v1.Finding.connections: array expected"); - message.connections = []; - for (var i = 0; i < object.connections.length; ++i) { - if (typeof object.connections[i] !== "object") - throw TypeError(".google.cloud.securitycenter.v1.Finding.connections: object expected"); - message.connections[i] = $root.google.cloud.securitycenter.v1.Connection.fromObject(object.connections[i]); - } - } - if (object.muteInitiator != null) - message.muteInitiator = String(object.muteInitiator); - if (object.processes) { - if (!Array.isArray(object.processes)) - throw TypeError(".google.cloud.securitycenter.v1.Finding.processes: array expected"); - message.processes = []; - for (var i = 0; i < object.processes.length; ++i) { - if (typeof object.processes[i] !== "object") - throw TypeError(".google.cloud.securitycenter.v1.Finding.processes: object expected"); - message.processes[i] = $root.google.cloud.securitycenter.v1.Process.fromObject(object.processes[i]); - } - } - if (object.contacts) { - if (typeof object.contacts !== "object") - throw TypeError(".google.cloud.securitycenter.v1.Finding.contacts: object expected"); - message.contacts = {}; - for (var keys = Object.keys(object.contacts), i = 0; i < keys.length; ++i) { - if (typeof object.contacts[keys[i]] !== "object") - throw TypeError(".google.cloud.securitycenter.v1.Finding.contacts: object expected"); - message.contacts[keys[i]] = $root.google.cloud.securitycenter.v1.ContactDetails.fromObject(object.contacts[keys[i]]); - } - } - if (object.compliances) { - if (!Array.isArray(object.compliances)) - throw TypeError(".google.cloud.securitycenter.v1.Finding.compliances: array expected"); - message.compliances = []; - for (var i = 0; i < object.compliances.length; ++i) { - if (typeof object.compliances[i] !== "object") - throw TypeError(".google.cloud.securitycenter.v1.Finding.compliances: object expected"); - message.compliances[i] = $root.google.cloud.securitycenter.v1.Compliance.fromObject(object.compliances[i]); - } - } - if (object.description != null) - message.description = String(object.description); - if (object.exfiltration != null) { - if (typeof object.exfiltration !== "object") - throw TypeError(".google.cloud.securitycenter.v1.Finding.exfiltration: object expected"); - message.exfiltration = $root.google.cloud.securitycenter.v1.Exfiltration.fromObject(object.exfiltration); - } - if (object.iamBindings) { - if (!Array.isArray(object.iamBindings)) - throw TypeError(".google.cloud.securitycenter.v1.Finding.iamBindings: array expected"); - message.iamBindings = []; - for (var i = 0; i < object.iamBindings.length; ++i) { - if (typeof object.iamBindings[i] !== "object") - throw TypeError(".google.cloud.securitycenter.v1.Finding.iamBindings: object expected"); - message.iamBindings[i] = $root.google.cloud.securitycenter.v1.IamBinding.fromObject(object.iamBindings[i]); - } - } - if (object.nextSteps != null) - message.nextSteps = String(object.nextSteps); + var message = new $root.google.cloud.securitycenter.v1.File(); + if (object.path != null) + message.path = String(object.path); + if (object.size != null) + if ($util.Long) + (message.size = $util.Long.fromValue(object.size)).unsigned = false; + else if (typeof object.size === "string") + message.size = parseInt(object.size, 10); + else if (typeof object.size === "number") + message.size = object.size; + else if (typeof object.size === "object") + message.size = new $util.LongBits(object.size.low >>> 0, object.size.high >>> 0).toNumber(); + if (object.sha256 != null) + message.sha256 = String(object.sha256); + if (object.hashedSize != null) + if ($util.Long) + (message.hashedSize = $util.Long.fromValue(object.hashedSize)).unsigned = false; + else if (typeof object.hashedSize === "string") + message.hashedSize = parseInt(object.hashedSize, 10); + else if (typeof object.hashedSize === "number") + message.hashedSize = object.hashedSize; + else if (typeof object.hashedSize === "object") + message.hashedSize = new $util.LongBits(object.hashedSize.low >>> 0, object.hashedSize.high >>> 0).toNumber(); + if (object.partiallyHashed != null) + message.partiallyHashed = Boolean(object.partiallyHashed); + if (object.contents != null) + message.contents = String(object.contents); return message; }; /** - * Creates a plain object from a Finding message. Also converts values to other types if specified. + * Creates a plain object from a File message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.securitycenter.v1.Finding + * @memberof google.cloud.securitycenter.v1.File * @static - * @param {google.cloud.securitycenter.v1.Finding} message Finding + * @param {google.cloud.securitycenter.v1.File} message File * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Finding.toObject = function toObject(message, options) { + File.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) { - object.processes = []; - object.connections = []; - object.compliances = []; - object.iamBindings = []; - } - if (options.objects || options.defaults) { - object.sourceProperties = {}; - object.externalSystems = {}; - object.contacts = {}; - } if (options.defaults) { - object.name = ""; - object.parent = ""; - object.resourceName = ""; - object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; - object.category = ""; - object.externalUri = ""; - object.securityMarks = null; - object.eventTime = null; - object.createTime = null; - object.severity = options.enums === String ? "SEVERITY_UNSPECIFIED" : 0; - object.canonicalName = ""; - object.mute = options.enums === String ? "MUTE_UNSPECIFIED" : 0; - object.findingClass = options.enums === String ? "FINDING_CLASS_UNSPECIFIED" : 0; - object.indicator = null; - object.vulnerability = null; - object.muteUpdateTime = null; - object.mitreAttack = null; - object.access = null; - object.muteInitiator = ""; - object.description = ""; - object.exfiltration = null; - object.nextSteps = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.resourceName != null && message.hasOwnProperty("resourceName")) - object.resourceName = message.resourceName; - if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.securitycenter.v1.Finding.State[message.state] : message.state; - if (message.category != null && message.hasOwnProperty("category")) - object.category = message.category; - if (message.externalUri != null && message.hasOwnProperty("externalUri")) - object.externalUri = message.externalUri; - var keys2; - if (message.sourceProperties && (keys2 = Object.keys(message.sourceProperties)).length) { - object.sourceProperties = {}; - for (var j = 0; j < keys2.length; ++j) - object.sourceProperties[keys2[j]] = $root.google.protobuf.Value.toObject(message.sourceProperties[keys2[j]], options); - } - if (message.securityMarks != null && message.hasOwnProperty("securityMarks")) - object.securityMarks = $root.google.cloud.securitycenter.v1.SecurityMarks.toObject(message.securityMarks, options); - if (message.eventTime != null && message.hasOwnProperty("eventTime")) - object.eventTime = $root.google.protobuf.Timestamp.toObject(message.eventTime, options); - if (message.createTime != null && message.hasOwnProperty("createTime")) - object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); - if (message.severity != null && message.hasOwnProperty("severity")) - object.severity = options.enums === String ? $root.google.cloud.securitycenter.v1.Finding.Severity[message.severity] : message.severity; - if (message.canonicalName != null && message.hasOwnProperty("canonicalName")) - object.canonicalName = message.canonicalName; - if (message.mute != null && message.hasOwnProperty("mute")) - object.mute = options.enums === String ? $root.google.cloud.securitycenter.v1.Finding.Mute[message.mute] : message.mute; - if (message.findingClass != null && message.hasOwnProperty("findingClass")) - object.findingClass = options.enums === String ? $root.google.cloud.securitycenter.v1.Finding.FindingClass[message.findingClass] : message.findingClass; - if (message.indicator != null && message.hasOwnProperty("indicator")) - object.indicator = $root.google.cloud.securitycenter.v1.Indicator.toObject(message.indicator, options); - if (message.vulnerability != null && message.hasOwnProperty("vulnerability")) - object.vulnerability = $root.google.cloud.securitycenter.v1.Vulnerability.toObject(message.vulnerability, options); - if (message.muteUpdateTime != null && message.hasOwnProperty("muteUpdateTime")) - object.muteUpdateTime = $root.google.protobuf.Timestamp.toObject(message.muteUpdateTime, options); - if (message.externalSystems && (keys2 = Object.keys(message.externalSystems)).length) { - object.externalSystems = {}; - for (var j = 0; j < keys2.length; ++j) - object.externalSystems[keys2[j]] = $root.google.cloud.securitycenter.v1.ExternalSystem.toObject(message.externalSystems[keys2[j]], options); - } - if (message.mitreAttack != null && message.hasOwnProperty("mitreAttack")) - object.mitreAttack = $root.google.cloud.securitycenter.v1.MitreAttack.toObject(message.mitreAttack, options); - if (message.access != null && message.hasOwnProperty("access")) - object.access = $root.google.cloud.securitycenter.v1.Access.toObject(message.access, options); - if (message.muteInitiator != null && message.hasOwnProperty("muteInitiator")) - object.muteInitiator = message.muteInitiator; - if (message.processes && message.processes.length) { - object.processes = []; - for (var j = 0; j < message.processes.length; ++j) - object.processes[j] = $root.google.cloud.securitycenter.v1.Process.toObject(message.processes[j], options); - } - if (message.connections && message.connections.length) { - object.connections = []; - for (var j = 0; j < message.connections.length; ++j) - object.connections[j] = $root.google.cloud.securitycenter.v1.Connection.toObject(message.connections[j], options); - } - if (message.contacts && (keys2 = Object.keys(message.contacts)).length) { - object.contacts = {}; - for (var j = 0; j < keys2.length; ++j) - object.contacts[keys2[j]] = $root.google.cloud.securitycenter.v1.ContactDetails.toObject(message.contacts[keys2[j]], options); - } - if (message.compliances && message.compliances.length) { - object.compliances = []; - for (var j = 0; j < message.compliances.length; ++j) - object.compliances[j] = $root.google.cloud.securitycenter.v1.Compliance.toObject(message.compliances[j], options); - } - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; - if (message.exfiltration != null && message.hasOwnProperty("exfiltration")) - object.exfiltration = $root.google.cloud.securitycenter.v1.Exfiltration.toObject(message.exfiltration, options); - if (message.iamBindings && message.iamBindings.length) { - object.iamBindings = []; - for (var j = 0; j < message.iamBindings.length; ++j) - object.iamBindings[j] = $root.google.cloud.securitycenter.v1.IamBinding.toObject(message.iamBindings[j], options); + object.path = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.size = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.size = options.longs === String ? "0" : 0; + object.sha256 = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.hashedSize = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.hashedSize = options.longs === String ? "0" : 0; + object.partiallyHashed = false; + object.contents = ""; } - if (message.nextSteps != null && message.hasOwnProperty("nextSteps")) - object.nextSteps = message.nextSteps; + if (message.path != null && message.hasOwnProperty("path")) + object.path = message.path; + if (message.size != null && message.hasOwnProperty("size")) + if (typeof message.size === "number") + object.size = options.longs === String ? String(message.size) : message.size; + else + object.size = options.longs === String ? $util.Long.prototype.toString.call(message.size) : options.longs === Number ? new $util.LongBits(message.size.low >>> 0, message.size.high >>> 0).toNumber() : message.size; + if (message.sha256 != null && message.hasOwnProperty("sha256")) + object.sha256 = message.sha256; + if (message.hashedSize != null && message.hasOwnProperty("hashedSize")) + if (typeof message.hashedSize === "number") + object.hashedSize = options.longs === String ? String(message.hashedSize) : message.hashedSize; + else + object.hashedSize = options.longs === String ? $util.Long.prototype.toString.call(message.hashedSize) : options.longs === Number ? new $util.LongBits(message.hashedSize.low >>> 0, message.hashedSize.high >>> 0).toNumber() : message.hashedSize; + if (message.partiallyHashed != null && message.hasOwnProperty("partiallyHashed")) + object.partiallyHashed = message.partiallyHashed; + if (message.contents != null && message.hasOwnProperty("contents")) + object.contents = message.contents; return object; }; /** - * Converts this Finding to JSON. + * Converts this File to JSON. * @function toJSON - * @memberof google.cloud.securitycenter.v1.Finding + * @memberof google.cloud.securitycenter.v1.File * @instance * @returns {Object.} JSON object */ - Finding.prototype.toJSON = function toJSON() { + File.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + return File; + })(); + + v1.Finding = (function() { + /** - * State enum. - * @name google.cloud.securitycenter.v1.Finding.State - * @enum {number} - * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value - * @property {number} ACTIVE=1 ACTIVE value - * @property {number} INACTIVE=2 INACTIVE value + * Properties of a Finding. + * @memberof google.cloud.securitycenter.v1 + * @interface IFinding + * @property {string|null} [name] Finding name + * @property {string|null} [parent] Finding parent + * @property {string|null} [resourceName] Finding resourceName + * @property {google.cloud.securitycenter.v1.Finding.State|null} [state] Finding state + * @property {string|null} [category] Finding category + * @property {string|null} [externalUri] Finding externalUri + * @property {Object.|null} [sourceProperties] Finding sourceProperties + * @property {google.cloud.securitycenter.v1.ISecurityMarks|null} [securityMarks] Finding securityMarks + * @property {google.protobuf.ITimestamp|null} [eventTime] Finding eventTime + * @property {google.protobuf.ITimestamp|null} [createTime] Finding createTime + * @property {google.cloud.securitycenter.v1.Finding.Severity|null} [severity] Finding severity + * @property {string|null} [canonicalName] Finding canonicalName + * @property {google.cloud.securitycenter.v1.Finding.Mute|null} [mute] Finding mute + * @property {google.cloud.securitycenter.v1.Finding.FindingClass|null} [findingClass] Finding findingClass + * @property {google.cloud.securitycenter.v1.IIndicator|null} [indicator] Finding indicator + * @property {google.cloud.securitycenter.v1.IVulnerability|null} [vulnerability] Finding vulnerability + * @property {google.protobuf.ITimestamp|null} [muteUpdateTime] Finding muteUpdateTime + * @property {Object.|null} [externalSystems] Finding externalSystems + * @property {google.cloud.securitycenter.v1.IMitreAttack|null} [mitreAttack] Finding mitreAttack + * @property {google.cloud.securitycenter.v1.IAccess|null} [access] Finding access + * @property {Array.|null} [connections] Finding connections + * @property {string|null} [muteInitiator] Finding muteInitiator + * @property {Array.|null} [processes] Finding processes + * @property {Object.|null} [contacts] Finding contacts + * @property {Array.|null} [compliances] Finding compliances + * @property {string|null} [description] Finding description + * @property {google.cloud.securitycenter.v1.IExfiltration|null} [exfiltration] Finding exfiltration + * @property {Array.|null} [iamBindings] Finding iamBindings + * @property {string|null} [nextSteps] Finding nextSteps + * @property {Array.|null} [containers] Finding containers + * @property {google.cloud.securitycenter.v1.IKubernetes|null} [kubernetes] Finding kubernetes */ - Finding.State = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; - values[valuesById[1] = "ACTIVE"] = 1; - values[valuesById[2] = "INACTIVE"] = 2; - return values; - })(); /** - * Severity enum. - * @name google.cloud.securitycenter.v1.Finding.Severity - * @enum {number} - * @property {number} SEVERITY_UNSPECIFIED=0 SEVERITY_UNSPECIFIED value - * @property {number} CRITICAL=1 CRITICAL value - * @property {number} HIGH=2 HIGH value - * @property {number} MEDIUM=3 MEDIUM value - * @property {number} LOW=4 LOW value + * Constructs a new Finding. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a Finding. + * @implements IFinding + * @constructor + * @param {google.cloud.securitycenter.v1.IFinding=} [properties] Properties to set */ - Finding.Severity = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "SEVERITY_UNSPECIFIED"] = 0; - values[valuesById[1] = "CRITICAL"] = 1; - values[valuesById[2] = "HIGH"] = 2; - values[valuesById[3] = "MEDIUM"] = 3; - values[valuesById[4] = "LOW"] = 4; - return values; - })(); + function Finding(properties) { + this.sourceProperties = {}; + this.externalSystems = {}; + this.connections = []; + this.processes = []; + this.contacts = {}; + this.compliances = []; + this.iamBindings = []; + this.containers = []; + 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]]; + } /** - * Mute enum. - * @name google.cloud.securitycenter.v1.Finding.Mute - * @enum {number} - * @property {number} MUTE_UNSPECIFIED=0 MUTE_UNSPECIFIED value - * @property {number} MUTED=1 MUTED value - * @property {number} UNMUTED=2 UNMUTED value - * @property {number} UNDEFINED=4 UNDEFINED value + * Finding name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1.Finding + * @instance */ - Finding.Mute = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "MUTE_UNSPECIFIED"] = 0; - values[valuesById[1] = "MUTED"] = 1; - values[valuesById[2] = "UNMUTED"] = 2; - values[valuesById[4] = "UNDEFINED"] = 4; - return values; - })(); + Finding.prototype.name = ""; /** - * FindingClass enum. - * @name google.cloud.securitycenter.v1.Finding.FindingClass - * @enum {number} - * @property {number} FINDING_CLASS_UNSPECIFIED=0 FINDING_CLASS_UNSPECIFIED value - * @property {number} THREAT=1 THREAT value - * @property {number} VULNERABILITY=2 VULNERABILITY value - * @property {number} MISCONFIGURATION=3 MISCONFIGURATION value - * @property {number} OBSERVATION=4 OBSERVATION value - * @property {number} SCC_ERROR=5 SCC_ERROR value + * Finding parent. + * @member {string} parent + * @memberof google.cloud.securitycenter.v1.Finding + * @instance */ - Finding.FindingClass = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "FINDING_CLASS_UNSPECIFIED"] = 0; - values[valuesById[1] = "THREAT"] = 1; - values[valuesById[2] = "VULNERABILITY"] = 2; - values[valuesById[3] = "MISCONFIGURATION"] = 3; - values[valuesById[4] = "OBSERVATION"] = 4; - values[valuesById[5] = "SCC_ERROR"] = 5; - return values; - })(); - - return Finding; - })(); + Finding.prototype.parent = ""; - v1.IamBinding = (function() { + /** + * Finding resourceName. + * @member {string} resourceName + * @memberof google.cloud.securitycenter.v1.Finding + * @instance + */ + Finding.prototype.resourceName = ""; /** - * Properties of an IamBinding. - * @memberof google.cloud.securitycenter.v1 - * @interface IIamBinding - * @property {google.cloud.securitycenter.v1.IamBinding.Action|null} [action] IamBinding action - * @property {string|null} [role] IamBinding role - * @property {string|null} [member] IamBinding member + * Finding state. + * @member {google.cloud.securitycenter.v1.Finding.State} state + * @memberof google.cloud.securitycenter.v1.Finding + * @instance */ + Finding.prototype.state = 0; /** - * Constructs a new IamBinding. - * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents an IamBinding. - * @implements IIamBinding - * @constructor - * @param {google.cloud.securitycenter.v1.IIamBinding=} [properties] Properties to set + * Finding category. + * @member {string} category + * @memberof google.cloud.securitycenter.v1.Finding + * @instance */ - function IamBinding(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]]; - } + Finding.prototype.category = ""; /** - * IamBinding action. - * @member {google.cloud.securitycenter.v1.IamBinding.Action} action - * @memberof google.cloud.securitycenter.v1.IamBinding + * Finding externalUri. + * @member {string} externalUri + * @memberof google.cloud.securitycenter.v1.Finding * @instance */ - IamBinding.prototype.action = 0; + Finding.prototype.externalUri = ""; /** - * IamBinding role. - * @member {string} role - * @memberof google.cloud.securitycenter.v1.IamBinding + * Finding sourceProperties. + * @member {Object.} sourceProperties + * @memberof google.cloud.securitycenter.v1.Finding * @instance */ - IamBinding.prototype.role = ""; + Finding.prototype.sourceProperties = $util.emptyObject; /** - * IamBinding member. - * @member {string} member - * @memberof google.cloud.securitycenter.v1.IamBinding + * Finding securityMarks. + * @member {google.cloud.securitycenter.v1.ISecurityMarks|null|undefined} securityMarks + * @memberof google.cloud.securitycenter.v1.Finding * @instance */ - IamBinding.prototype.member = ""; + Finding.prototype.securityMarks = null; /** - * Creates a new IamBinding instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v1.IamBinding - * @static - * @param {google.cloud.securitycenter.v1.IIamBinding=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.IamBinding} IamBinding instance + * Finding eventTime. + * @member {google.protobuf.ITimestamp|null|undefined} eventTime + * @memberof google.cloud.securitycenter.v1.Finding + * @instance */ - IamBinding.create = function create(properties) { - return new IamBinding(properties); - }; + Finding.prototype.eventTime = null; /** - * Encodes the specified IamBinding message. Does not implicitly {@link google.cloud.securitycenter.v1.IamBinding.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1.IamBinding - * @static - * @param {google.cloud.securitycenter.v1.IIamBinding} message IamBinding message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * Finding createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.securitycenter.v1.Finding + * @instance */ - IamBinding.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.action != null && Object.hasOwnProperty.call(message, "action")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.action); - if (message.role != null && Object.hasOwnProperty.call(message, "role")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.role); - if (message.member != null && Object.hasOwnProperty.call(message, "member")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.member); - return writer; - }; + Finding.prototype.createTime = null; /** - * Encodes the specified IamBinding message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.IamBinding.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.IamBinding - * @static - * @param {google.cloud.securitycenter.v1.IIamBinding} message IamBinding message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * Finding severity. + * @member {google.cloud.securitycenter.v1.Finding.Severity} severity + * @memberof google.cloud.securitycenter.v1.Finding + * @instance */ - IamBinding.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + Finding.prototype.severity = 0; /** - * Decodes an IamBinding message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v1.IamBinding - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.IamBinding} IamBinding - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Finding canonicalName. + * @member {string} canonicalName + * @memberof google.cloud.securitycenter.v1.Finding + * @instance */ - IamBinding.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.cloud.securitycenter.v1.IamBinding(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.action = reader.int32(); - break; - case 2: - message.role = reader.string(); - break; - case 3: - message.member = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + Finding.prototype.canonicalName = ""; /** - * Decodes an IamBinding message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.IamBinding - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.IamBinding} IamBinding - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Finding mute. + * @member {google.cloud.securitycenter.v1.Finding.Mute} mute + * @memberof google.cloud.securitycenter.v1.Finding + * @instance */ - IamBinding.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + Finding.prototype.mute = 0; /** - * Verifies an IamBinding message. - * @function verify - * @memberof google.cloud.securitycenter.v1.IamBinding - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not + * Finding findingClass. + * @member {google.cloud.securitycenter.v1.Finding.FindingClass} findingClass + * @memberof google.cloud.securitycenter.v1.Finding + * @instance */ - IamBinding.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.action != null && message.hasOwnProperty("action")) - switch (message.action) { - default: - return "action: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.role != null && message.hasOwnProperty("role")) - if (!$util.isString(message.role)) - return "role: string expected"; - if (message.member != null && message.hasOwnProperty("member")) - if (!$util.isString(message.member)) - return "member: string expected"; - return null; - }; + Finding.prototype.findingClass = 0; /** - * Creates an IamBinding message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v1.IamBinding - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.IamBinding} IamBinding + * Finding indicator. + * @member {google.cloud.securitycenter.v1.IIndicator|null|undefined} indicator + * @memberof google.cloud.securitycenter.v1.Finding + * @instance */ - IamBinding.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.IamBinding) - return object; - var message = new $root.google.cloud.securitycenter.v1.IamBinding(); - switch (object.action) { - case "ACTION_UNSPECIFIED": - case 0: - message.action = 0; - break; - case "ADD": - case 1: - message.action = 1; - break; - case "REMOVE": - case 2: - message.action = 2; - break; - } - if (object.role != null) - message.role = String(object.role); - if (object.member != null) - message.member = String(object.member); - return message; - }; + Finding.prototype.indicator = null; /** - * Creates a plain object from an IamBinding message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v1.IamBinding - * @static - * @param {google.cloud.securitycenter.v1.IamBinding} message IamBinding - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object + * Finding vulnerability. + * @member {google.cloud.securitycenter.v1.IVulnerability|null|undefined} vulnerability + * @memberof google.cloud.securitycenter.v1.Finding + * @instance */ - IamBinding.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.action = options.enums === String ? "ACTION_UNSPECIFIED" : 0; - object.role = ""; - object.member = ""; - } - if (message.action != null && message.hasOwnProperty("action")) - object.action = options.enums === String ? $root.google.cloud.securitycenter.v1.IamBinding.Action[message.action] : message.action; - if (message.role != null && message.hasOwnProperty("role")) - object.role = message.role; - if (message.member != null && message.hasOwnProperty("member")) - object.member = message.member; - return object; - }; + Finding.prototype.vulnerability = null; /** - * Converts this IamBinding to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1.IamBinding + * Finding muteUpdateTime. + * @member {google.protobuf.ITimestamp|null|undefined} muteUpdateTime + * @memberof google.cloud.securitycenter.v1.Finding * @instance - * @returns {Object.} JSON object */ - IamBinding.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + Finding.prototype.muteUpdateTime = null; /** - * Action enum. - * @name google.cloud.securitycenter.v1.IamBinding.Action - * @enum {number} - * @property {number} ACTION_UNSPECIFIED=0 ACTION_UNSPECIFIED value - * @property {number} ADD=1 ADD value - * @property {number} REMOVE=2 REMOVE value + * Finding externalSystems. + * @member {Object.} externalSystems + * @memberof google.cloud.securitycenter.v1.Finding + * @instance */ - IamBinding.Action = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "ACTION_UNSPECIFIED"] = 0; - values[valuesById[1] = "ADD"] = 1; - values[valuesById[2] = "REMOVE"] = 2; - return values; - })(); + Finding.prototype.externalSystems = $util.emptyObject; - return IamBinding; - })(); + /** + * Finding mitreAttack. + * @member {google.cloud.securitycenter.v1.IMitreAttack|null|undefined} mitreAttack + * @memberof google.cloud.securitycenter.v1.Finding + * @instance + */ + Finding.prototype.mitreAttack = null; - v1.Indicator = (function() { + /** + * Finding access. + * @member {google.cloud.securitycenter.v1.IAccess|null|undefined} access + * @memberof google.cloud.securitycenter.v1.Finding + * @instance + */ + Finding.prototype.access = null; /** - * Properties of an Indicator. - * @memberof google.cloud.securitycenter.v1 - * @interface IIndicator - * @property {Array.|null} [ipAddresses] Indicator ipAddresses - * @property {Array.|null} [domains] Indicator domains - * @property {Array.|null} [signatures] Indicator signatures + * Finding connections. + * @member {Array.} connections + * @memberof google.cloud.securitycenter.v1.Finding + * @instance */ + Finding.prototype.connections = $util.emptyArray; /** - * Constructs a new Indicator. - * @memberof google.cloud.securitycenter.v1 - * @classdesc Represents an Indicator. - * @implements IIndicator - * @constructor - * @param {google.cloud.securitycenter.v1.IIndicator=} [properties] Properties to set + * Finding muteInitiator. + * @member {string} muteInitiator + * @memberof google.cloud.securitycenter.v1.Finding + * @instance */ - function Indicator(properties) { - this.ipAddresses = []; - this.domains = []; - this.signatures = []; - 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]]; - } + Finding.prototype.muteInitiator = ""; /** - * Indicator ipAddresses. - * @member {Array.} ipAddresses - * @memberof google.cloud.securitycenter.v1.Indicator + * Finding processes. + * @member {Array.} processes + * @memberof google.cloud.securitycenter.v1.Finding * @instance */ - Indicator.prototype.ipAddresses = $util.emptyArray; + Finding.prototype.processes = $util.emptyArray; /** - * Indicator domains. - * @member {Array.} domains - * @memberof google.cloud.securitycenter.v1.Indicator + * Finding contacts. + * @member {Object.} contacts + * @memberof google.cloud.securitycenter.v1.Finding * @instance */ - Indicator.prototype.domains = $util.emptyArray; + Finding.prototype.contacts = $util.emptyObject; /** - * Indicator signatures. - * @member {Array.} signatures - * @memberof google.cloud.securitycenter.v1.Indicator + * Finding compliances. + * @member {Array.} compliances + * @memberof google.cloud.securitycenter.v1.Finding * @instance */ - Indicator.prototype.signatures = $util.emptyArray; + Finding.prototype.compliances = $util.emptyArray; /** - * Creates a new Indicator instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v1.Indicator - * @static - * @param {google.cloud.securitycenter.v1.IIndicator=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.Indicator} Indicator instance + * Finding description. + * @member {string} description + * @memberof google.cloud.securitycenter.v1.Finding + * @instance */ - Indicator.create = function create(properties) { - return new Indicator(properties); - }; + Finding.prototype.description = ""; /** - * Encodes the specified Indicator message. Does not implicitly {@link google.cloud.securitycenter.v1.Indicator.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1.Indicator - * @static - * @param {google.cloud.securitycenter.v1.IIndicator} message Indicator message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * Finding exfiltration. + * @member {google.cloud.securitycenter.v1.IExfiltration|null|undefined} exfiltration + * @memberof google.cloud.securitycenter.v1.Finding + * @instance */ - Indicator.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.ipAddresses != null && message.ipAddresses.length) - for (var i = 0; i < message.ipAddresses.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.ipAddresses[i]); - if (message.domains != null && message.domains.length) - for (var i = 0; i < message.domains.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.domains[i]); - if (message.signatures != null && message.signatures.length) - for (var i = 0; i < message.signatures.length; ++i) - $root.google.cloud.securitycenter.v1.Indicator.ProcessSignature.encode(message.signatures[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; + Finding.prototype.exfiltration = null; /** - * Encodes the specified Indicator message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Indicator.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.Indicator - * @static - * @param {google.cloud.securitycenter.v1.IIndicator} message Indicator message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * Finding iamBindings. + * @member {Array.} iamBindings + * @memberof google.cloud.securitycenter.v1.Finding + * @instance */ - Indicator.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + Finding.prototype.iamBindings = $util.emptyArray; /** - * Decodes an Indicator message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v1.Indicator - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.Indicator} Indicator - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Finding nextSteps. + * @member {string} nextSteps + * @memberof google.cloud.securitycenter.v1.Finding + * @instance */ - Indicator.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.cloud.securitycenter.v1.Indicator(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.ipAddresses && message.ipAddresses.length)) - message.ipAddresses = []; - message.ipAddresses.push(reader.string()); - break; - case 2: - if (!(message.domains && message.domains.length)) - message.domains = []; - message.domains.push(reader.string()); - break; - case 3: - if (!(message.signatures && message.signatures.length)) - message.signatures = []; - message.signatures.push($root.google.cloud.securitycenter.v1.Indicator.ProcessSignature.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + Finding.prototype.nextSteps = ""; /** - * Decodes an Indicator message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.Indicator - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.Indicator} Indicator - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Finding containers. + * @member {Array.} containers + * @memberof google.cloud.securitycenter.v1.Finding + * @instance */ - Indicator.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + Finding.prototype.containers = $util.emptyArray; /** - * Verifies an Indicator message. - * @function verify - * @memberof google.cloud.securitycenter.v1.Indicator + * Finding kubernetes. + * @member {google.cloud.securitycenter.v1.IKubernetes|null|undefined} kubernetes + * @memberof google.cloud.securitycenter.v1.Finding + * @instance + */ + Finding.prototype.kubernetes = null; + + /** + * Creates a new Finding instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.Finding * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not + * @param {google.cloud.securitycenter.v1.IFinding=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.Finding} Finding instance */ - Indicator.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.ipAddresses != null && message.hasOwnProperty("ipAddresses")) { - if (!Array.isArray(message.ipAddresses)) - return "ipAddresses: array expected"; - for (var i = 0; i < message.ipAddresses.length; ++i) - if (!$util.isString(message.ipAddresses[i])) - return "ipAddresses: string[] expected"; - } - if (message.domains != null && message.hasOwnProperty("domains")) { - if (!Array.isArray(message.domains)) - return "domains: array expected"; - for (var i = 0; i < message.domains.length; ++i) - if (!$util.isString(message.domains[i])) - return "domains: string[] expected"; - } - if (message.signatures != null && message.hasOwnProperty("signatures")) { - if (!Array.isArray(message.signatures)) - return "signatures: array expected"; - for (var i = 0; i < message.signatures.length; ++i) { - var error = $root.google.cloud.securitycenter.v1.Indicator.ProcessSignature.verify(message.signatures[i]); - if (error) - return "signatures." + error; - } - } - return null; + Finding.create = function create(properties) { + return new Finding(properties); }; /** - * Creates an Indicator message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v1.Indicator + * Encodes the specified Finding message. Does not implicitly {@link google.cloud.securitycenter.v1.Finding.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.Finding * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.Indicator} Indicator + * @param {google.cloud.securitycenter.v1.IFinding} message Finding message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - Indicator.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.Indicator) - return object; - var message = new $root.google.cloud.securitycenter.v1.Indicator(); - if (object.ipAddresses) { - if (!Array.isArray(object.ipAddresses)) - throw TypeError(".google.cloud.securitycenter.v1.Indicator.ipAddresses: array expected"); - message.ipAddresses = []; - for (var i = 0; i < object.ipAddresses.length; ++i) - message.ipAddresses[i] = String(object.ipAddresses[i]); - } - if (object.domains) { - if (!Array.isArray(object.domains)) - throw TypeError(".google.cloud.securitycenter.v1.Indicator.domains: array expected"); - message.domains = []; - for (var i = 0; i < object.domains.length; ++i) - message.domains[i] = String(object.domains[i]); - } - if (object.signatures) { - if (!Array.isArray(object.signatures)) - throw TypeError(".google.cloud.securitycenter.v1.Indicator.signatures: array expected"); - message.signatures = []; - for (var i = 0; i < object.signatures.length; ++i) { - if (typeof object.signatures[i] !== "object") - throw TypeError(".google.cloud.securitycenter.v1.Indicator.signatures: object expected"); - message.signatures[i] = $root.google.cloud.securitycenter.v1.Indicator.ProcessSignature.fromObject(object.signatures[i]); + Finding.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.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.parent); + if (message.resourceName != null && Object.hasOwnProperty.call(message, "resourceName")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.resourceName); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.state); + if (message.category != null && Object.hasOwnProperty.call(message, "category")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.category); + if (message.externalUri != null && Object.hasOwnProperty.call(message, "externalUri")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.externalUri); + if (message.sourceProperties != null && Object.hasOwnProperty.call(message, "sourceProperties")) + for (var keys = Object.keys(message.sourceProperties), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 7, wireType 2 =*/58).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.protobuf.Value.encode(message.sourceProperties[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); } - } - return message; + if (message.securityMarks != null && Object.hasOwnProperty.call(message, "securityMarks")) + $root.google.cloud.securitycenter.v1.SecurityMarks.encode(message.securityMarks, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.eventTime != null && Object.hasOwnProperty.call(message, "eventTime")) + $root.google.protobuf.Timestamp.encode(message.eventTime, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.severity != null && Object.hasOwnProperty.call(message, "severity")) + writer.uint32(/* id 12, wireType 0 =*/96).int32(message.severity); + if (message.canonicalName != null && Object.hasOwnProperty.call(message, "canonicalName")) + writer.uint32(/* id 14, wireType 2 =*/114).string(message.canonicalName); + if (message.mute != null && Object.hasOwnProperty.call(message, "mute")) + writer.uint32(/* id 15, wireType 0 =*/120).int32(message.mute); + if (message.findingClass != null && Object.hasOwnProperty.call(message, "findingClass")) + writer.uint32(/* id 17, wireType 0 =*/136).int32(message.findingClass); + if (message.indicator != null && Object.hasOwnProperty.call(message, "indicator")) + $root.google.cloud.securitycenter.v1.Indicator.encode(message.indicator, writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); + if (message.vulnerability != null && Object.hasOwnProperty.call(message, "vulnerability")) + $root.google.cloud.securitycenter.v1.Vulnerability.encode(message.vulnerability, writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); + if (message.muteUpdateTime != null && Object.hasOwnProperty.call(message, "muteUpdateTime")) + $root.google.protobuf.Timestamp.encode(message.muteUpdateTime, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); + if (message.externalSystems != null && Object.hasOwnProperty.call(message, "externalSystems")) + for (var keys = Object.keys(message.externalSystems), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 22, wireType 2 =*/178).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.cloud.securitycenter.v1.ExternalSystem.encode(message.externalSystems[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.mitreAttack != null && Object.hasOwnProperty.call(message, "mitreAttack")) + $root.google.cloud.securitycenter.v1.MitreAttack.encode(message.mitreAttack, writer.uint32(/* id 25, wireType 2 =*/202).fork()).ldelim(); + if (message.access != null && Object.hasOwnProperty.call(message, "access")) + $root.google.cloud.securitycenter.v1.Access.encode(message.access, writer.uint32(/* id 26, wireType 2 =*/210).fork()).ldelim(); + if (message.muteInitiator != null && Object.hasOwnProperty.call(message, "muteInitiator")) + writer.uint32(/* id 28, wireType 2 =*/226).string(message.muteInitiator); + if (message.processes != null && message.processes.length) + for (var i = 0; i < message.processes.length; ++i) + $root.google.cloud.securitycenter.v1.Process.encode(message.processes[i], writer.uint32(/* id 30, wireType 2 =*/242).fork()).ldelim(); + if (message.connections != null && message.connections.length) + for (var i = 0; i < message.connections.length; ++i) + $root.google.cloud.securitycenter.v1.Connection.encode(message.connections[i], writer.uint32(/* id 31, wireType 2 =*/250).fork()).ldelim(); + if (message.contacts != null && Object.hasOwnProperty.call(message, "contacts")) + for (var keys = Object.keys(message.contacts), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 33, wireType 2 =*/266).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.cloud.securitycenter.v1.ContactDetails.encode(message.contacts[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.compliances != null && message.compliances.length) + for (var i = 0; i < message.compliances.length; ++i) + $root.google.cloud.securitycenter.v1.Compliance.encode(message.compliances[i], writer.uint32(/* id 34, wireType 2 =*/274).fork()).ldelim(); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 37, wireType 2 =*/298).string(message.description); + if (message.exfiltration != null && Object.hasOwnProperty.call(message, "exfiltration")) + $root.google.cloud.securitycenter.v1.Exfiltration.encode(message.exfiltration, writer.uint32(/* id 38, wireType 2 =*/306).fork()).ldelim(); + if (message.iamBindings != null && message.iamBindings.length) + for (var i = 0; i < message.iamBindings.length; ++i) + $root.google.cloud.securitycenter.v1.IamBinding.encode(message.iamBindings[i], writer.uint32(/* id 39, wireType 2 =*/314).fork()).ldelim(); + if (message.nextSteps != null && Object.hasOwnProperty.call(message, "nextSteps")) + writer.uint32(/* id 40, wireType 2 =*/322).string(message.nextSteps); + if (message.containers != null && message.containers.length) + for (var i = 0; i < message.containers.length; ++i) + $root.google.cloud.securitycenter.v1.Container.encode(message.containers[i], writer.uint32(/* id 42, wireType 2 =*/338).fork()).ldelim(); + if (message.kubernetes != null && Object.hasOwnProperty.call(message, "kubernetes")) + $root.google.cloud.securitycenter.v1.Kubernetes.encode(message.kubernetes, writer.uint32(/* id 43, wireType 2 =*/346).fork()).ldelim(); + return writer; }; /** - * Creates a plain object from an Indicator message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v1.Indicator + * Encodes the specified Finding message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Finding.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.Finding * @static - * @param {google.cloud.securitycenter.v1.Indicator} message Indicator - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object + * @param {google.cloud.securitycenter.v1.IFinding} message Finding message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - Indicator.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.ipAddresses = []; - object.domains = []; - object.signatures = []; - } - if (message.ipAddresses && message.ipAddresses.length) { - object.ipAddresses = []; - for (var j = 0; j < message.ipAddresses.length; ++j) - object.ipAddresses[j] = message.ipAddresses[j]; - } - if (message.domains && message.domains.length) { - object.domains = []; - for (var j = 0; j < message.domains.length; ++j) - object.domains[j] = message.domains[j]; - } - if (message.signatures && message.signatures.length) { - object.signatures = []; - for (var j = 0; j < message.signatures.length; ++j) - object.signatures[j] = $root.google.cloud.securitycenter.v1.Indicator.ProcessSignature.toObject(message.signatures[j], options); - } - return object; + Finding.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); }; /** - * Converts this Indicator to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1.Indicator - * @instance - * @returns {Object.} JSON object + * Decodes a Finding message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.Finding + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.Finding} Finding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Indicator.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - Indicator.ProcessSignature = (function() { - - /** - * Properties of a ProcessSignature. - * @memberof google.cloud.securitycenter.v1.Indicator - * @interface IProcessSignature - * @property {google.cloud.securitycenter.v1.Indicator.ProcessSignature.IMemoryHashSignature|null} [memoryHashSignature] ProcessSignature memoryHashSignature - * @property {google.cloud.securitycenter.v1.Indicator.ProcessSignature.IYaraRuleSignature|null} [yaraRuleSignature] ProcessSignature yaraRuleSignature - */ - - /** - * Constructs a new ProcessSignature. - * @memberof google.cloud.securitycenter.v1.Indicator - * @classdesc Represents a ProcessSignature. - * @implements IProcessSignature - * @constructor - * @param {google.cloud.securitycenter.v1.Indicator.IProcessSignature=} [properties] Properties to set - */ - function ProcessSignature(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]]; - } - - /** - * ProcessSignature memoryHashSignature. - * @member {google.cloud.securitycenter.v1.Indicator.ProcessSignature.IMemoryHashSignature|null|undefined} memoryHashSignature - * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature - * @instance - */ - ProcessSignature.prototype.memoryHashSignature = null; - - /** - * ProcessSignature yaraRuleSignature. - * @member {google.cloud.securitycenter.v1.Indicator.ProcessSignature.IYaraRuleSignature|null|undefined} yaraRuleSignature - * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature - * @instance - */ - ProcessSignature.prototype.yaraRuleSignature = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * ProcessSignature signature. - * @member {"memoryHashSignature"|"yaraRuleSignature"|undefined} signature - * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature - * @instance - */ - Object.defineProperty(ProcessSignature.prototype, "signature", { - get: $util.oneOfGetter($oneOfFields = ["memoryHashSignature", "yaraRuleSignature"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new ProcessSignature instance using the specified properties. + Finding.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.cloud.securitycenter.v1.Finding(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.parent = reader.string(); + break; + case 3: + message.resourceName = reader.string(); + break; + case 4: + message.state = reader.int32(); + break; + case 5: + message.category = reader.string(); + break; + case 6: + message.externalUri = reader.string(); + break; + case 7: + if (message.sourceProperties === $util.emptyObject) + message.sourceProperties = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.protobuf.Value.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.sourceProperties[key] = value; + break; + case 8: + message.securityMarks = $root.google.cloud.securitycenter.v1.SecurityMarks.decode(reader, reader.uint32()); + break; + case 9: + message.eventTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 10: + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 12: + message.severity = reader.int32(); + break; + case 14: + message.canonicalName = reader.string(); + break; + case 15: + message.mute = reader.int32(); + break; + case 17: + message.findingClass = reader.int32(); + break; + case 18: + message.indicator = $root.google.cloud.securitycenter.v1.Indicator.decode(reader, reader.uint32()); + break; + case 20: + message.vulnerability = $root.google.cloud.securitycenter.v1.Vulnerability.decode(reader, reader.uint32()); + break; + case 21: + message.muteUpdateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 22: + if (message.externalSystems === $util.emptyObject) + message.externalSystems = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.cloud.securitycenter.v1.ExternalSystem.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.externalSystems[key] = value; + break; + case 25: + message.mitreAttack = $root.google.cloud.securitycenter.v1.MitreAttack.decode(reader, reader.uint32()); + break; + case 26: + message.access = $root.google.cloud.securitycenter.v1.Access.decode(reader, reader.uint32()); + break; + case 31: + if (!(message.connections && message.connections.length)) + message.connections = []; + message.connections.push($root.google.cloud.securitycenter.v1.Connection.decode(reader, reader.uint32())); + break; + case 28: + message.muteInitiator = reader.string(); + break; + case 30: + if (!(message.processes && message.processes.length)) + message.processes = []; + message.processes.push($root.google.cloud.securitycenter.v1.Process.decode(reader, reader.uint32())); + break; + case 33: + if (message.contacts === $util.emptyObject) + message.contacts = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.cloud.securitycenter.v1.ContactDetails.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.contacts[key] = value; + break; + case 34: + if (!(message.compliances && message.compliances.length)) + message.compliances = []; + message.compliances.push($root.google.cloud.securitycenter.v1.Compliance.decode(reader, reader.uint32())); + break; + case 37: + message.description = reader.string(); + break; + case 38: + message.exfiltration = $root.google.cloud.securitycenter.v1.Exfiltration.decode(reader, reader.uint32()); + break; + case 39: + if (!(message.iamBindings && message.iamBindings.length)) + message.iamBindings = []; + message.iamBindings.push($root.google.cloud.securitycenter.v1.IamBinding.decode(reader, reader.uint32())); + break; + case 40: + message.nextSteps = reader.string(); + break; + case 42: + if (!(message.containers && message.containers.length)) + message.containers = []; + message.containers.push($root.google.cloud.securitycenter.v1.Container.decode(reader, reader.uint32())); + break; + case 43: + message.kubernetes = $root.google.cloud.securitycenter.v1.Kubernetes.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Finding message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.Finding + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.Finding} Finding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Finding.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Finding message. + * @function verify + * @memberof google.cloud.securitycenter.v1.Finding + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Finding.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.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.resourceName != null && message.hasOwnProperty("resourceName")) + if (!$util.isString(message.resourceName)) + return "resourceName: string expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: 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"; + if (message.externalUri != null && message.hasOwnProperty("externalUri")) + if (!$util.isString(message.externalUri)) + return "externalUri: string expected"; + if (message.sourceProperties != null && message.hasOwnProperty("sourceProperties")) { + if (!$util.isObject(message.sourceProperties)) + return "sourceProperties: object expected"; + var key = Object.keys(message.sourceProperties); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.protobuf.Value.verify(message.sourceProperties[key[i]]); + if (error) + return "sourceProperties." + error; + } + } + if (message.securityMarks != null && message.hasOwnProperty("securityMarks")) { + var error = $root.google.cloud.securitycenter.v1.SecurityMarks.verify(message.securityMarks); + if (error) + return "securityMarks." + error; + } + if (message.eventTime != null && message.hasOwnProperty("eventTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.eventTime); + if (error) + return "eventTime." + error; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.severity != null && message.hasOwnProperty("severity")) + switch (message.severity) { + default: + return "severity: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.canonicalName != null && message.hasOwnProperty("canonicalName")) + if (!$util.isString(message.canonicalName)) + return "canonicalName: string expected"; + if (message.mute != null && message.hasOwnProperty("mute")) + switch (message.mute) { + default: + return "mute: enum value expected"; + case 0: + case 1: + case 2: + case 4: + break; + } + if (message.findingClass != null && message.hasOwnProperty("findingClass")) + switch (message.findingClass) { + default: + return "findingClass: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.indicator != null && message.hasOwnProperty("indicator")) { + var error = $root.google.cloud.securitycenter.v1.Indicator.verify(message.indicator); + if (error) + return "indicator." + error; + } + if (message.vulnerability != null && message.hasOwnProperty("vulnerability")) { + var error = $root.google.cloud.securitycenter.v1.Vulnerability.verify(message.vulnerability); + if (error) + return "vulnerability." + error; + } + if (message.muteUpdateTime != null && message.hasOwnProperty("muteUpdateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.muteUpdateTime); + if (error) + return "muteUpdateTime." + error; + } + if (message.externalSystems != null && message.hasOwnProperty("externalSystems")) { + if (!$util.isObject(message.externalSystems)) + return "externalSystems: object expected"; + var key = Object.keys(message.externalSystems); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.securitycenter.v1.ExternalSystem.verify(message.externalSystems[key[i]]); + if (error) + return "externalSystems." + error; + } + } + if (message.mitreAttack != null && message.hasOwnProperty("mitreAttack")) { + var error = $root.google.cloud.securitycenter.v1.MitreAttack.verify(message.mitreAttack); + if (error) + return "mitreAttack." + error; + } + if (message.access != null && message.hasOwnProperty("access")) { + var error = $root.google.cloud.securitycenter.v1.Access.verify(message.access); + if (error) + return "access." + error; + } + if (message.connections != null && message.hasOwnProperty("connections")) { + if (!Array.isArray(message.connections)) + return "connections: array expected"; + for (var i = 0; i < message.connections.length; ++i) { + var error = $root.google.cloud.securitycenter.v1.Connection.verify(message.connections[i]); + if (error) + return "connections." + error; + } + } + if (message.muteInitiator != null && message.hasOwnProperty("muteInitiator")) + if (!$util.isString(message.muteInitiator)) + return "muteInitiator: string expected"; + if (message.processes != null && message.hasOwnProperty("processes")) { + if (!Array.isArray(message.processes)) + return "processes: array expected"; + for (var i = 0; i < message.processes.length; ++i) { + var error = $root.google.cloud.securitycenter.v1.Process.verify(message.processes[i]); + if (error) + return "processes." + error; + } + } + if (message.contacts != null && message.hasOwnProperty("contacts")) { + if (!$util.isObject(message.contacts)) + return "contacts: object expected"; + var key = Object.keys(message.contacts); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.securitycenter.v1.ContactDetails.verify(message.contacts[key[i]]); + if (error) + return "contacts." + error; + } + } + if (message.compliances != null && message.hasOwnProperty("compliances")) { + if (!Array.isArray(message.compliances)) + return "compliances: array expected"; + for (var i = 0; i < message.compliances.length; ++i) { + var error = $root.google.cloud.securitycenter.v1.Compliance.verify(message.compliances[i]); + if (error) + return "compliances." + error; + } + } + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.exfiltration != null && message.hasOwnProperty("exfiltration")) { + var error = $root.google.cloud.securitycenter.v1.Exfiltration.verify(message.exfiltration); + if (error) + return "exfiltration." + error; + } + if (message.iamBindings != null && message.hasOwnProperty("iamBindings")) { + if (!Array.isArray(message.iamBindings)) + return "iamBindings: array expected"; + for (var i = 0; i < message.iamBindings.length; ++i) { + var error = $root.google.cloud.securitycenter.v1.IamBinding.verify(message.iamBindings[i]); + if (error) + return "iamBindings." + error; + } + } + if (message.nextSteps != null && message.hasOwnProperty("nextSteps")) + if (!$util.isString(message.nextSteps)) + return "nextSteps: string expected"; + if (message.containers != null && message.hasOwnProperty("containers")) { + if (!Array.isArray(message.containers)) + return "containers: array expected"; + for (var i = 0; i < message.containers.length; ++i) { + var error = $root.google.cloud.securitycenter.v1.Container.verify(message.containers[i]); + if (error) + return "containers." + error; + } + } + if (message.kubernetes != null && message.hasOwnProperty("kubernetes")) { + var error = $root.google.cloud.securitycenter.v1.Kubernetes.verify(message.kubernetes); + if (error) + return "kubernetes." + error; + } + return null; + }; + + /** + * Creates a Finding message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.Finding + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.Finding} Finding + */ + Finding.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.Finding) + return object; + var message = new $root.google.cloud.securitycenter.v1.Finding(); + if (object.name != null) + message.name = String(object.name); + if (object.parent != null) + message.parent = String(object.parent); + if (object.resourceName != null) + message.resourceName = String(object.resourceName); + switch (object.state) { + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "ACTIVE": + case 1: + message.state = 1; + break; + case "INACTIVE": + case 2: + message.state = 2; + break; + } + if (object.category != null) + message.category = String(object.category); + if (object.externalUri != null) + message.externalUri = String(object.externalUri); + if (object.sourceProperties) { + if (typeof object.sourceProperties !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Finding.sourceProperties: object expected"); + message.sourceProperties = {}; + for (var keys = Object.keys(object.sourceProperties), i = 0; i < keys.length; ++i) { + if (typeof object.sourceProperties[keys[i]] !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Finding.sourceProperties: object expected"); + message.sourceProperties[keys[i]] = $root.google.protobuf.Value.fromObject(object.sourceProperties[keys[i]]); + } + } + if (object.securityMarks != null) { + if (typeof object.securityMarks !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Finding.securityMarks: object expected"); + message.securityMarks = $root.google.cloud.securitycenter.v1.SecurityMarks.fromObject(object.securityMarks); + } + if (object.eventTime != null) { + if (typeof object.eventTime !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Finding.eventTime: object expected"); + message.eventTime = $root.google.protobuf.Timestamp.fromObject(object.eventTime); + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Finding.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + switch (object.severity) { + case "SEVERITY_UNSPECIFIED": + case 0: + message.severity = 0; + break; + case "CRITICAL": + case 1: + message.severity = 1; + break; + case "HIGH": + case 2: + message.severity = 2; + break; + case "MEDIUM": + case 3: + message.severity = 3; + break; + case "LOW": + case 4: + message.severity = 4; + break; + } + if (object.canonicalName != null) + message.canonicalName = String(object.canonicalName); + switch (object.mute) { + case "MUTE_UNSPECIFIED": + case 0: + message.mute = 0; + break; + case "MUTED": + case 1: + message.mute = 1; + break; + case "UNMUTED": + case 2: + message.mute = 2; + break; + case "UNDEFINED": + case 4: + message.mute = 4; + break; + } + switch (object.findingClass) { + case "FINDING_CLASS_UNSPECIFIED": + case 0: + message.findingClass = 0; + break; + case "THREAT": + case 1: + message.findingClass = 1; + break; + case "VULNERABILITY": + case 2: + message.findingClass = 2; + break; + case "MISCONFIGURATION": + case 3: + message.findingClass = 3; + break; + case "OBSERVATION": + case 4: + message.findingClass = 4; + break; + case "SCC_ERROR": + case 5: + message.findingClass = 5; + break; + } + if (object.indicator != null) { + if (typeof object.indicator !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Finding.indicator: object expected"); + message.indicator = $root.google.cloud.securitycenter.v1.Indicator.fromObject(object.indicator); + } + if (object.vulnerability != null) { + if (typeof object.vulnerability !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Finding.vulnerability: object expected"); + message.vulnerability = $root.google.cloud.securitycenter.v1.Vulnerability.fromObject(object.vulnerability); + } + if (object.muteUpdateTime != null) { + if (typeof object.muteUpdateTime !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Finding.muteUpdateTime: object expected"); + message.muteUpdateTime = $root.google.protobuf.Timestamp.fromObject(object.muteUpdateTime); + } + if (object.externalSystems) { + if (typeof object.externalSystems !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Finding.externalSystems: object expected"); + message.externalSystems = {}; + for (var keys = Object.keys(object.externalSystems), i = 0; i < keys.length; ++i) { + if (typeof object.externalSystems[keys[i]] !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Finding.externalSystems: object expected"); + message.externalSystems[keys[i]] = $root.google.cloud.securitycenter.v1.ExternalSystem.fromObject(object.externalSystems[keys[i]]); + } + } + if (object.mitreAttack != null) { + if (typeof object.mitreAttack !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Finding.mitreAttack: object expected"); + message.mitreAttack = $root.google.cloud.securitycenter.v1.MitreAttack.fromObject(object.mitreAttack); + } + if (object.access != null) { + if (typeof object.access !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Finding.access: object expected"); + message.access = $root.google.cloud.securitycenter.v1.Access.fromObject(object.access); + } + if (object.connections) { + if (!Array.isArray(object.connections)) + throw TypeError(".google.cloud.securitycenter.v1.Finding.connections: array expected"); + message.connections = []; + for (var i = 0; i < object.connections.length; ++i) { + if (typeof object.connections[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Finding.connections: object expected"); + message.connections[i] = $root.google.cloud.securitycenter.v1.Connection.fromObject(object.connections[i]); + } + } + if (object.muteInitiator != null) + message.muteInitiator = String(object.muteInitiator); + if (object.processes) { + if (!Array.isArray(object.processes)) + throw TypeError(".google.cloud.securitycenter.v1.Finding.processes: array expected"); + message.processes = []; + for (var i = 0; i < object.processes.length; ++i) { + if (typeof object.processes[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Finding.processes: object expected"); + message.processes[i] = $root.google.cloud.securitycenter.v1.Process.fromObject(object.processes[i]); + } + } + if (object.contacts) { + if (typeof object.contacts !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Finding.contacts: object expected"); + message.contacts = {}; + for (var keys = Object.keys(object.contacts), i = 0; i < keys.length; ++i) { + if (typeof object.contacts[keys[i]] !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Finding.contacts: object expected"); + message.contacts[keys[i]] = $root.google.cloud.securitycenter.v1.ContactDetails.fromObject(object.contacts[keys[i]]); + } + } + if (object.compliances) { + if (!Array.isArray(object.compliances)) + throw TypeError(".google.cloud.securitycenter.v1.Finding.compliances: array expected"); + message.compliances = []; + for (var i = 0; i < object.compliances.length; ++i) { + if (typeof object.compliances[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Finding.compliances: object expected"); + message.compliances[i] = $root.google.cloud.securitycenter.v1.Compliance.fromObject(object.compliances[i]); + } + } + if (object.description != null) + message.description = String(object.description); + if (object.exfiltration != null) { + if (typeof object.exfiltration !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Finding.exfiltration: object expected"); + message.exfiltration = $root.google.cloud.securitycenter.v1.Exfiltration.fromObject(object.exfiltration); + } + if (object.iamBindings) { + if (!Array.isArray(object.iamBindings)) + throw TypeError(".google.cloud.securitycenter.v1.Finding.iamBindings: array expected"); + message.iamBindings = []; + for (var i = 0; i < object.iamBindings.length; ++i) { + if (typeof object.iamBindings[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Finding.iamBindings: object expected"); + message.iamBindings[i] = $root.google.cloud.securitycenter.v1.IamBinding.fromObject(object.iamBindings[i]); + } + } + if (object.nextSteps != null) + message.nextSteps = String(object.nextSteps); + if (object.containers) { + if (!Array.isArray(object.containers)) + throw TypeError(".google.cloud.securitycenter.v1.Finding.containers: array expected"); + message.containers = []; + for (var i = 0; i < object.containers.length; ++i) { + if (typeof object.containers[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Finding.containers: object expected"); + message.containers[i] = $root.google.cloud.securitycenter.v1.Container.fromObject(object.containers[i]); + } + } + if (object.kubernetes != null) { + if (typeof object.kubernetes !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Finding.kubernetes: object expected"); + message.kubernetes = $root.google.cloud.securitycenter.v1.Kubernetes.fromObject(object.kubernetes); + } + return message; + }; + + /** + * Creates a plain object from a Finding message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.Finding + * @static + * @param {google.cloud.securitycenter.v1.Finding} message Finding + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Finding.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.processes = []; + object.connections = []; + object.compliances = []; + object.iamBindings = []; + object.containers = []; + } + if (options.objects || options.defaults) { + object.sourceProperties = {}; + object.externalSystems = {}; + object.contacts = {}; + } + if (options.defaults) { + object.name = ""; + object.parent = ""; + object.resourceName = ""; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.category = ""; + object.externalUri = ""; + object.securityMarks = null; + object.eventTime = null; + object.createTime = null; + object.severity = options.enums === String ? "SEVERITY_UNSPECIFIED" : 0; + object.canonicalName = ""; + object.mute = options.enums === String ? "MUTE_UNSPECIFIED" : 0; + object.findingClass = options.enums === String ? "FINDING_CLASS_UNSPECIFIED" : 0; + object.indicator = null; + object.vulnerability = null; + object.muteUpdateTime = null; + object.mitreAttack = null; + object.access = null; + object.muteInitiator = ""; + object.description = ""; + object.exfiltration = null; + object.nextSteps = ""; + object.kubernetes = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.resourceName != null && message.hasOwnProperty("resourceName")) + object.resourceName = message.resourceName; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.securitycenter.v1.Finding.State[message.state] : message.state; + if (message.category != null && message.hasOwnProperty("category")) + object.category = message.category; + if (message.externalUri != null && message.hasOwnProperty("externalUri")) + object.externalUri = message.externalUri; + var keys2; + if (message.sourceProperties && (keys2 = Object.keys(message.sourceProperties)).length) { + object.sourceProperties = {}; + for (var j = 0; j < keys2.length; ++j) + object.sourceProperties[keys2[j]] = $root.google.protobuf.Value.toObject(message.sourceProperties[keys2[j]], options); + } + if (message.securityMarks != null && message.hasOwnProperty("securityMarks")) + object.securityMarks = $root.google.cloud.securitycenter.v1.SecurityMarks.toObject(message.securityMarks, options); + if (message.eventTime != null && message.hasOwnProperty("eventTime")) + object.eventTime = $root.google.protobuf.Timestamp.toObject(message.eventTime, options); + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.severity != null && message.hasOwnProperty("severity")) + object.severity = options.enums === String ? $root.google.cloud.securitycenter.v1.Finding.Severity[message.severity] : message.severity; + if (message.canonicalName != null && message.hasOwnProperty("canonicalName")) + object.canonicalName = message.canonicalName; + if (message.mute != null && message.hasOwnProperty("mute")) + object.mute = options.enums === String ? $root.google.cloud.securitycenter.v1.Finding.Mute[message.mute] : message.mute; + if (message.findingClass != null && message.hasOwnProperty("findingClass")) + object.findingClass = options.enums === String ? $root.google.cloud.securitycenter.v1.Finding.FindingClass[message.findingClass] : message.findingClass; + if (message.indicator != null && message.hasOwnProperty("indicator")) + object.indicator = $root.google.cloud.securitycenter.v1.Indicator.toObject(message.indicator, options); + if (message.vulnerability != null && message.hasOwnProperty("vulnerability")) + object.vulnerability = $root.google.cloud.securitycenter.v1.Vulnerability.toObject(message.vulnerability, options); + if (message.muteUpdateTime != null && message.hasOwnProperty("muteUpdateTime")) + object.muteUpdateTime = $root.google.protobuf.Timestamp.toObject(message.muteUpdateTime, options); + if (message.externalSystems && (keys2 = Object.keys(message.externalSystems)).length) { + object.externalSystems = {}; + for (var j = 0; j < keys2.length; ++j) + object.externalSystems[keys2[j]] = $root.google.cloud.securitycenter.v1.ExternalSystem.toObject(message.externalSystems[keys2[j]], options); + } + if (message.mitreAttack != null && message.hasOwnProperty("mitreAttack")) + object.mitreAttack = $root.google.cloud.securitycenter.v1.MitreAttack.toObject(message.mitreAttack, options); + if (message.access != null && message.hasOwnProperty("access")) + object.access = $root.google.cloud.securitycenter.v1.Access.toObject(message.access, options); + if (message.muteInitiator != null && message.hasOwnProperty("muteInitiator")) + object.muteInitiator = message.muteInitiator; + if (message.processes && message.processes.length) { + object.processes = []; + for (var j = 0; j < message.processes.length; ++j) + object.processes[j] = $root.google.cloud.securitycenter.v1.Process.toObject(message.processes[j], options); + } + if (message.connections && message.connections.length) { + object.connections = []; + for (var j = 0; j < message.connections.length; ++j) + object.connections[j] = $root.google.cloud.securitycenter.v1.Connection.toObject(message.connections[j], options); + } + if (message.contacts && (keys2 = Object.keys(message.contacts)).length) { + object.contacts = {}; + for (var j = 0; j < keys2.length; ++j) + object.contacts[keys2[j]] = $root.google.cloud.securitycenter.v1.ContactDetails.toObject(message.contacts[keys2[j]], options); + } + if (message.compliances && message.compliances.length) { + object.compliances = []; + for (var j = 0; j < message.compliances.length; ++j) + object.compliances[j] = $root.google.cloud.securitycenter.v1.Compliance.toObject(message.compliances[j], options); + } + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.exfiltration != null && message.hasOwnProperty("exfiltration")) + object.exfiltration = $root.google.cloud.securitycenter.v1.Exfiltration.toObject(message.exfiltration, options); + if (message.iamBindings && message.iamBindings.length) { + object.iamBindings = []; + for (var j = 0; j < message.iamBindings.length; ++j) + object.iamBindings[j] = $root.google.cloud.securitycenter.v1.IamBinding.toObject(message.iamBindings[j], options); + } + if (message.nextSteps != null && message.hasOwnProperty("nextSteps")) + object.nextSteps = message.nextSteps; + if (message.containers && message.containers.length) { + object.containers = []; + for (var j = 0; j < message.containers.length; ++j) + object.containers[j] = $root.google.cloud.securitycenter.v1.Container.toObject(message.containers[j], options); + } + if (message.kubernetes != null && message.hasOwnProperty("kubernetes")) + object.kubernetes = $root.google.cloud.securitycenter.v1.Kubernetes.toObject(message.kubernetes, options); + return object; + }; + + /** + * Converts this Finding to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.Finding + * @instance + * @returns {Object.} JSON object + */ + Finding.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * State enum. + * @name google.cloud.securitycenter.v1.Finding.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} ACTIVE=1 ACTIVE value + * @property {number} INACTIVE=2 INACTIVE value + */ + Finding.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ACTIVE"] = 1; + values[valuesById[2] = "INACTIVE"] = 2; + return values; + })(); + + /** + * Severity enum. + * @name google.cloud.securitycenter.v1.Finding.Severity + * @enum {number} + * @property {number} SEVERITY_UNSPECIFIED=0 SEVERITY_UNSPECIFIED value + * @property {number} CRITICAL=1 CRITICAL value + * @property {number} HIGH=2 HIGH value + * @property {number} MEDIUM=3 MEDIUM value + * @property {number} LOW=4 LOW value + */ + Finding.Severity = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SEVERITY_UNSPECIFIED"] = 0; + values[valuesById[1] = "CRITICAL"] = 1; + values[valuesById[2] = "HIGH"] = 2; + values[valuesById[3] = "MEDIUM"] = 3; + values[valuesById[4] = "LOW"] = 4; + return values; + })(); + + /** + * Mute enum. + * @name google.cloud.securitycenter.v1.Finding.Mute + * @enum {number} + * @property {number} MUTE_UNSPECIFIED=0 MUTE_UNSPECIFIED value + * @property {number} MUTED=1 MUTED value + * @property {number} UNMUTED=2 UNMUTED value + * @property {number} UNDEFINED=4 UNDEFINED value + */ + Finding.Mute = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MUTE_UNSPECIFIED"] = 0; + values[valuesById[1] = "MUTED"] = 1; + values[valuesById[2] = "UNMUTED"] = 2; + values[valuesById[4] = "UNDEFINED"] = 4; + return values; + })(); + + /** + * FindingClass enum. + * @name google.cloud.securitycenter.v1.Finding.FindingClass + * @enum {number} + * @property {number} FINDING_CLASS_UNSPECIFIED=0 FINDING_CLASS_UNSPECIFIED value + * @property {number} THREAT=1 THREAT value + * @property {number} VULNERABILITY=2 VULNERABILITY value + * @property {number} MISCONFIGURATION=3 MISCONFIGURATION value + * @property {number} OBSERVATION=4 OBSERVATION value + * @property {number} SCC_ERROR=5 SCC_ERROR value + */ + Finding.FindingClass = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FINDING_CLASS_UNSPECIFIED"] = 0; + values[valuesById[1] = "THREAT"] = 1; + values[valuesById[2] = "VULNERABILITY"] = 2; + values[valuesById[3] = "MISCONFIGURATION"] = 3; + values[valuesById[4] = "OBSERVATION"] = 4; + values[valuesById[5] = "SCC_ERROR"] = 5; + return values; + })(); + + return Finding; + })(); + + v1.IamBinding = (function() { + + /** + * Properties of an IamBinding. + * @memberof google.cloud.securitycenter.v1 + * @interface IIamBinding + * @property {google.cloud.securitycenter.v1.IamBinding.Action|null} [action] IamBinding action + * @property {string|null} [role] IamBinding role + * @property {string|null} [member] IamBinding member + */ + + /** + * Constructs a new IamBinding. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents an IamBinding. + * @implements IIamBinding + * @constructor + * @param {google.cloud.securitycenter.v1.IIamBinding=} [properties] Properties to set + */ + function IamBinding(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]]; + } + + /** + * IamBinding action. + * @member {google.cloud.securitycenter.v1.IamBinding.Action} action + * @memberof google.cloud.securitycenter.v1.IamBinding + * @instance + */ + IamBinding.prototype.action = 0; + + /** + * IamBinding role. + * @member {string} role + * @memberof google.cloud.securitycenter.v1.IamBinding + * @instance + */ + IamBinding.prototype.role = ""; + + /** + * IamBinding member. + * @member {string} member + * @memberof google.cloud.securitycenter.v1.IamBinding + * @instance + */ + IamBinding.prototype.member = ""; + + /** + * Creates a new IamBinding instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.IamBinding + * @static + * @param {google.cloud.securitycenter.v1.IIamBinding=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.IamBinding} IamBinding instance + */ + IamBinding.create = function create(properties) { + return new IamBinding(properties); + }; + + /** + * Encodes the specified IamBinding message. Does not implicitly {@link google.cloud.securitycenter.v1.IamBinding.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.IamBinding + * @static + * @param {google.cloud.securitycenter.v1.IIamBinding} message IamBinding message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IamBinding.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.action != null && Object.hasOwnProperty.call(message, "action")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.action); + if (message.role != null && Object.hasOwnProperty.call(message, "role")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.role); + if (message.member != null && Object.hasOwnProperty.call(message, "member")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.member); + return writer; + }; + + /** + * Encodes the specified IamBinding message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.IamBinding.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.IamBinding + * @static + * @param {google.cloud.securitycenter.v1.IIamBinding} message IamBinding message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IamBinding.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an IamBinding message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.IamBinding + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.IamBinding} IamBinding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IamBinding.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.cloud.securitycenter.v1.IamBinding(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.action = reader.int32(); + break; + case 2: + message.role = reader.string(); + break; + case 3: + message.member = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an IamBinding message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.IamBinding + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.IamBinding} IamBinding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IamBinding.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an IamBinding message. + * @function verify + * @memberof google.cloud.securitycenter.v1.IamBinding + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IamBinding.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.action != null && message.hasOwnProperty("action")) + switch (message.action) { + default: + return "action: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.role != null && message.hasOwnProperty("role")) + if (!$util.isString(message.role)) + return "role: string expected"; + if (message.member != null && message.hasOwnProperty("member")) + if (!$util.isString(message.member)) + return "member: string expected"; + return null; + }; + + /** + * Creates an IamBinding message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.IamBinding + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.IamBinding} IamBinding + */ + IamBinding.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.IamBinding) + return object; + var message = new $root.google.cloud.securitycenter.v1.IamBinding(); + switch (object.action) { + case "ACTION_UNSPECIFIED": + case 0: + message.action = 0; + break; + case "ADD": + case 1: + message.action = 1; + break; + case "REMOVE": + case 2: + message.action = 2; + break; + } + if (object.role != null) + message.role = String(object.role); + if (object.member != null) + message.member = String(object.member); + return message; + }; + + /** + * Creates a plain object from an IamBinding message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.IamBinding + * @static + * @param {google.cloud.securitycenter.v1.IamBinding} message IamBinding + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IamBinding.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.action = options.enums === String ? "ACTION_UNSPECIFIED" : 0; + object.role = ""; + object.member = ""; + } + if (message.action != null && message.hasOwnProperty("action")) + object.action = options.enums === String ? $root.google.cloud.securitycenter.v1.IamBinding.Action[message.action] : message.action; + if (message.role != null && message.hasOwnProperty("role")) + object.role = message.role; + if (message.member != null && message.hasOwnProperty("member")) + object.member = message.member; + return object; + }; + + /** + * Converts this IamBinding to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.IamBinding + * @instance + * @returns {Object.} JSON object + */ + IamBinding.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Action enum. + * @name google.cloud.securitycenter.v1.IamBinding.Action + * @enum {number} + * @property {number} ACTION_UNSPECIFIED=0 ACTION_UNSPECIFIED value + * @property {number} ADD=1 ADD value + * @property {number} REMOVE=2 REMOVE value + */ + IamBinding.Action = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ACTION_UNSPECIFIED"] = 0; + values[valuesById[1] = "ADD"] = 1; + values[valuesById[2] = "REMOVE"] = 2; + return values; + })(); + + return IamBinding; + })(); + + v1.Indicator = (function() { + + /** + * Properties of an Indicator. + * @memberof google.cloud.securitycenter.v1 + * @interface IIndicator + * @property {Array.|null} [ipAddresses] Indicator ipAddresses + * @property {Array.|null} [domains] Indicator domains + * @property {Array.|null} [signatures] Indicator signatures + */ + + /** + * Constructs a new Indicator. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents an Indicator. + * @implements IIndicator + * @constructor + * @param {google.cloud.securitycenter.v1.IIndicator=} [properties] Properties to set + */ + function Indicator(properties) { + this.ipAddresses = []; + this.domains = []; + this.signatures = []; + 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]]; + } + + /** + * Indicator ipAddresses. + * @member {Array.} ipAddresses + * @memberof google.cloud.securitycenter.v1.Indicator + * @instance + */ + Indicator.prototype.ipAddresses = $util.emptyArray; + + /** + * Indicator domains. + * @member {Array.} domains + * @memberof google.cloud.securitycenter.v1.Indicator + * @instance + */ + Indicator.prototype.domains = $util.emptyArray; + + /** + * Indicator signatures. + * @member {Array.} signatures + * @memberof google.cloud.securitycenter.v1.Indicator + * @instance + */ + Indicator.prototype.signatures = $util.emptyArray; + + /** + * Creates a new Indicator instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.Indicator + * @static + * @param {google.cloud.securitycenter.v1.IIndicator=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.Indicator} Indicator instance + */ + Indicator.create = function create(properties) { + return new Indicator(properties); + }; + + /** + * Encodes the specified Indicator message. Does not implicitly {@link google.cloud.securitycenter.v1.Indicator.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.Indicator + * @static + * @param {google.cloud.securitycenter.v1.IIndicator} message Indicator message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Indicator.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.ipAddresses != null && message.ipAddresses.length) + for (var i = 0; i < message.ipAddresses.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.ipAddresses[i]); + if (message.domains != null && message.domains.length) + for (var i = 0; i < message.domains.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.domains[i]); + if (message.signatures != null && message.signatures.length) + for (var i = 0; i < message.signatures.length; ++i) + $root.google.cloud.securitycenter.v1.Indicator.ProcessSignature.encode(message.signatures[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Indicator message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Indicator.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.Indicator + * @static + * @param {google.cloud.securitycenter.v1.IIndicator} message Indicator message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Indicator.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Indicator message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.Indicator + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.Indicator} Indicator + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Indicator.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.cloud.securitycenter.v1.Indicator(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.ipAddresses && message.ipAddresses.length)) + message.ipAddresses = []; + message.ipAddresses.push(reader.string()); + break; + case 2: + if (!(message.domains && message.domains.length)) + message.domains = []; + message.domains.push(reader.string()); + break; + case 3: + if (!(message.signatures && message.signatures.length)) + message.signatures = []; + message.signatures.push($root.google.cloud.securitycenter.v1.Indicator.ProcessSignature.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Indicator message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.Indicator + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.Indicator} Indicator + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Indicator.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Indicator message. + * @function verify + * @memberof google.cloud.securitycenter.v1.Indicator + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Indicator.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.ipAddresses != null && message.hasOwnProperty("ipAddresses")) { + if (!Array.isArray(message.ipAddresses)) + return "ipAddresses: array expected"; + for (var i = 0; i < message.ipAddresses.length; ++i) + if (!$util.isString(message.ipAddresses[i])) + return "ipAddresses: string[] expected"; + } + if (message.domains != null && message.hasOwnProperty("domains")) { + if (!Array.isArray(message.domains)) + return "domains: array expected"; + for (var i = 0; i < message.domains.length; ++i) + if (!$util.isString(message.domains[i])) + return "domains: string[] expected"; + } + if (message.signatures != null && message.hasOwnProperty("signatures")) { + if (!Array.isArray(message.signatures)) + return "signatures: array expected"; + for (var i = 0; i < message.signatures.length; ++i) { + var error = $root.google.cloud.securitycenter.v1.Indicator.ProcessSignature.verify(message.signatures[i]); + if (error) + return "signatures." + error; + } + } + return null; + }; + + /** + * Creates an Indicator message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.Indicator + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.Indicator} Indicator + */ + Indicator.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.Indicator) + return object; + var message = new $root.google.cloud.securitycenter.v1.Indicator(); + if (object.ipAddresses) { + if (!Array.isArray(object.ipAddresses)) + throw TypeError(".google.cloud.securitycenter.v1.Indicator.ipAddresses: array expected"); + message.ipAddresses = []; + for (var i = 0; i < object.ipAddresses.length; ++i) + message.ipAddresses[i] = String(object.ipAddresses[i]); + } + if (object.domains) { + if (!Array.isArray(object.domains)) + throw TypeError(".google.cloud.securitycenter.v1.Indicator.domains: array expected"); + message.domains = []; + for (var i = 0; i < object.domains.length; ++i) + message.domains[i] = String(object.domains[i]); + } + if (object.signatures) { + if (!Array.isArray(object.signatures)) + throw TypeError(".google.cloud.securitycenter.v1.Indicator.signatures: array expected"); + message.signatures = []; + for (var i = 0; i < object.signatures.length; ++i) { + if (typeof object.signatures[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Indicator.signatures: object expected"); + message.signatures[i] = $root.google.cloud.securitycenter.v1.Indicator.ProcessSignature.fromObject(object.signatures[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an Indicator message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.Indicator + * @static + * @param {google.cloud.securitycenter.v1.Indicator} message Indicator + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Indicator.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.ipAddresses = []; + object.domains = []; + object.signatures = []; + } + if (message.ipAddresses && message.ipAddresses.length) { + object.ipAddresses = []; + for (var j = 0; j < message.ipAddresses.length; ++j) + object.ipAddresses[j] = message.ipAddresses[j]; + } + if (message.domains && message.domains.length) { + object.domains = []; + for (var j = 0; j < message.domains.length; ++j) + object.domains[j] = message.domains[j]; + } + if (message.signatures && message.signatures.length) { + object.signatures = []; + for (var j = 0; j < message.signatures.length; ++j) + object.signatures[j] = $root.google.cloud.securitycenter.v1.Indicator.ProcessSignature.toObject(message.signatures[j], options); + } + return object; + }; + + /** + * Converts this Indicator to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.Indicator + * @instance + * @returns {Object.} JSON object + */ + Indicator.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + Indicator.ProcessSignature = (function() { + + /** + * Properties of a ProcessSignature. + * @memberof google.cloud.securitycenter.v1.Indicator + * @interface IProcessSignature + * @property {google.cloud.securitycenter.v1.Indicator.ProcessSignature.IMemoryHashSignature|null} [memoryHashSignature] ProcessSignature memoryHashSignature + * @property {google.cloud.securitycenter.v1.Indicator.ProcessSignature.IYaraRuleSignature|null} [yaraRuleSignature] ProcessSignature yaraRuleSignature + */ + + /** + * Constructs a new ProcessSignature. + * @memberof google.cloud.securitycenter.v1.Indicator + * @classdesc Represents a ProcessSignature. + * @implements IProcessSignature + * @constructor + * @param {google.cloud.securitycenter.v1.Indicator.IProcessSignature=} [properties] Properties to set + */ + function ProcessSignature(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]]; + } + + /** + * ProcessSignature memoryHashSignature. + * @member {google.cloud.securitycenter.v1.Indicator.ProcessSignature.IMemoryHashSignature|null|undefined} memoryHashSignature + * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature + * @instance + */ + ProcessSignature.prototype.memoryHashSignature = null; + + /** + * ProcessSignature yaraRuleSignature. + * @member {google.cloud.securitycenter.v1.Indicator.ProcessSignature.IYaraRuleSignature|null|undefined} yaraRuleSignature + * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature + * @instance + */ + ProcessSignature.prototype.yaraRuleSignature = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ProcessSignature signature. + * @member {"memoryHashSignature"|"yaraRuleSignature"|undefined} signature + * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature + * @instance + */ + Object.defineProperty(ProcessSignature.prototype, "signature", { + get: $util.oneOfGetter($oneOfFields = ["memoryHashSignature", "yaraRuleSignature"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ProcessSignature instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature + * @static + * @param {google.cloud.securitycenter.v1.Indicator.IProcessSignature=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.Indicator.ProcessSignature} ProcessSignature instance + */ + ProcessSignature.create = function create(properties) { + return new ProcessSignature(properties); + }; + + /** + * Encodes the specified ProcessSignature message. Does not implicitly {@link google.cloud.securitycenter.v1.Indicator.ProcessSignature.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature + * @static + * @param {google.cloud.securitycenter.v1.Indicator.IProcessSignature} message ProcessSignature message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ProcessSignature.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.memoryHashSignature != null && Object.hasOwnProperty.call(message, "memoryHashSignature")) + $root.google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.encode(message.memoryHashSignature, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.yaraRuleSignature != null && Object.hasOwnProperty.call(message, "yaraRuleSignature")) + $root.google.cloud.securitycenter.v1.Indicator.ProcessSignature.YaraRuleSignature.encode(message.yaraRuleSignature, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ProcessSignature message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Indicator.ProcessSignature.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature + * @static + * @param {google.cloud.securitycenter.v1.Indicator.IProcessSignature} message ProcessSignature message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ProcessSignature.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ProcessSignature message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.Indicator.ProcessSignature} ProcessSignature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ProcessSignature.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.cloud.securitycenter.v1.Indicator.ProcessSignature(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 6: + message.memoryHashSignature = $root.google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.decode(reader, reader.uint32()); + break; + case 7: + message.yaraRuleSignature = $root.google.cloud.securitycenter.v1.Indicator.ProcessSignature.YaraRuleSignature.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ProcessSignature message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.Indicator.ProcessSignature} ProcessSignature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ProcessSignature.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ProcessSignature message. + * @function verify + * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ProcessSignature.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.memoryHashSignature != null && message.hasOwnProperty("memoryHashSignature")) { + properties.signature = 1; + { + var error = $root.google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.verify(message.memoryHashSignature); + if (error) + return "memoryHashSignature." + error; + } + } + if (message.yaraRuleSignature != null && message.hasOwnProperty("yaraRuleSignature")) { + if (properties.signature === 1) + return "signature: multiple values"; + properties.signature = 1; + { + var error = $root.google.cloud.securitycenter.v1.Indicator.ProcessSignature.YaraRuleSignature.verify(message.yaraRuleSignature); + if (error) + return "yaraRuleSignature." + error; + } + } + return null; + }; + + /** + * Creates a ProcessSignature message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.Indicator.ProcessSignature} ProcessSignature + */ + ProcessSignature.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.Indicator.ProcessSignature) + return object; + var message = new $root.google.cloud.securitycenter.v1.Indicator.ProcessSignature(); + if (object.memoryHashSignature != null) { + if (typeof object.memoryHashSignature !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Indicator.ProcessSignature.memoryHashSignature: object expected"); + message.memoryHashSignature = $root.google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.fromObject(object.memoryHashSignature); + } + if (object.yaraRuleSignature != null) { + if (typeof object.yaraRuleSignature !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Indicator.ProcessSignature.yaraRuleSignature: object expected"); + message.yaraRuleSignature = $root.google.cloud.securitycenter.v1.Indicator.ProcessSignature.YaraRuleSignature.fromObject(object.yaraRuleSignature); + } + return message; + }; + + /** + * Creates a plain object from a ProcessSignature message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature + * @static + * @param {google.cloud.securitycenter.v1.Indicator.ProcessSignature} message ProcessSignature + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ProcessSignature.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.memoryHashSignature != null && message.hasOwnProperty("memoryHashSignature")) { + object.memoryHashSignature = $root.google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.toObject(message.memoryHashSignature, options); + if (options.oneofs) + object.signature = "memoryHashSignature"; + } + if (message.yaraRuleSignature != null && message.hasOwnProperty("yaraRuleSignature")) { + object.yaraRuleSignature = $root.google.cloud.securitycenter.v1.Indicator.ProcessSignature.YaraRuleSignature.toObject(message.yaraRuleSignature, options); + if (options.oneofs) + object.signature = "yaraRuleSignature"; + } + return object; + }; + + /** + * Converts this ProcessSignature to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature + * @instance + * @returns {Object.} JSON object + */ + ProcessSignature.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + ProcessSignature.MemoryHashSignature = (function() { + + /** + * Properties of a MemoryHashSignature. + * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature + * @interface IMemoryHashSignature + * @property {string|null} [binaryFamily] MemoryHashSignature binaryFamily + * @property {Array.|null} [detections] MemoryHashSignature detections + */ + + /** + * Constructs a new MemoryHashSignature. + * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature + * @classdesc Represents a MemoryHashSignature. + * @implements IMemoryHashSignature + * @constructor + * @param {google.cloud.securitycenter.v1.Indicator.ProcessSignature.IMemoryHashSignature=} [properties] Properties to set + */ + function MemoryHashSignature(properties) { + this.detections = []; + 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]]; + } + + /** + * MemoryHashSignature binaryFamily. + * @member {string} binaryFamily + * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature + * @instance + */ + MemoryHashSignature.prototype.binaryFamily = ""; + + /** + * MemoryHashSignature detections. + * @member {Array.} detections + * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature + * @instance + */ + MemoryHashSignature.prototype.detections = $util.emptyArray; + + /** + * Creates a new MemoryHashSignature instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature + * @static + * @param {google.cloud.securitycenter.v1.Indicator.ProcessSignature.IMemoryHashSignature=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature} MemoryHashSignature instance + */ + MemoryHashSignature.create = function create(properties) { + return new MemoryHashSignature(properties); + }; + + /** + * Encodes the specified MemoryHashSignature message. Does not implicitly {@link google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature + * @static + * @param {google.cloud.securitycenter.v1.Indicator.ProcessSignature.IMemoryHashSignature} message MemoryHashSignature message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MemoryHashSignature.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.binaryFamily != null && Object.hasOwnProperty.call(message, "binaryFamily")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.binaryFamily); + if (message.detections != null && message.detections.length) + for (var i = 0; i < message.detections.length; ++i) + $root.google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.Detection.encode(message.detections[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MemoryHashSignature message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature + * @static + * @param {google.cloud.securitycenter.v1.Indicator.ProcessSignature.IMemoryHashSignature} message MemoryHashSignature message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MemoryHashSignature.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MemoryHashSignature message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature} MemoryHashSignature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MemoryHashSignature.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.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.binaryFamily = reader.string(); + break; + case 4: + if (!(message.detections && message.detections.length)) + message.detections = []; + message.detections.push($root.google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.Detection.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MemoryHashSignature message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature} MemoryHashSignature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MemoryHashSignature.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MemoryHashSignature message. + * @function verify + * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MemoryHashSignature.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.binaryFamily != null && message.hasOwnProperty("binaryFamily")) + if (!$util.isString(message.binaryFamily)) + return "binaryFamily: string expected"; + if (message.detections != null && message.hasOwnProperty("detections")) { + if (!Array.isArray(message.detections)) + return "detections: array expected"; + for (var i = 0; i < message.detections.length; ++i) { + var error = $root.google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.Detection.verify(message.detections[i]); + if (error) + return "detections." + error; + } + } + return null; + }; + + /** + * Creates a MemoryHashSignature message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature} MemoryHashSignature + */ + MemoryHashSignature.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature) + return object; + var message = new $root.google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature(); + if (object.binaryFamily != null) + message.binaryFamily = String(object.binaryFamily); + if (object.detections) { + if (!Array.isArray(object.detections)) + throw TypeError(".google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.detections: array expected"); + message.detections = []; + for (var i = 0; i < object.detections.length; ++i) { + if (typeof object.detections[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.detections: object expected"); + message.detections[i] = $root.google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.Detection.fromObject(object.detections[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a MemoryHashSignature message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature + * @static + * @param {google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature} message MemoryHashSignature + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MemoryHashSignature.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.detections = []; + if (options.defaults) + object.binaryFamily = ""; + if (message.binaryFamily != null && message.hasOwnProperty("binaryFamily")) + object.binaryFamily = message.binaryFamily; + if (message.detections && message.detections.length) { + object.detections = []; + for (var j = 0; j < message.detections.length; ++j) + object.detections[j] = $root.google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.Detection.toObject(message.detections[j], options); + } + return object; + }; + + /** + * Converts this MemoryHashSignature to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature + * @instance + * @returns {Object.} JSON object + */ + MemoryHashSignature.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + MemoryHashSignature.Detection = (function() { + + /** + * Properties of a Detection. + * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature + * @interface IDetection + * @property {string|null} [binary] Detection binary + * @property {number|null} [percentPagesMatched] Detection percentPagesMatched + */ + + /** + * Constructs a new Detection. + * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature + * @classdesc Represents a Detection. + * @implements IDetection + * @constructor + * @param {google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.IDetection=} [properties] Properties to set + */ + function Detection(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]]; + } + + /** + * Detection binary. + * @member {string} binary + * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.Detection + * @instance + */ + Detection.prototype.binary = ""; + + /** + * Detection percentPagesMatched. + * @member {number} percentPagesMatched + * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.Detection + * @instance + */ + Detection.prototype.percentPagesMatched = 0; + + /** + * Creates a new Detection instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.Detection + * @static + * @param {google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.IDetection=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.Detection} Detection instance + */ + Detection.create = function create(properties) { + return new Detection(properties); + }; + + /** + * Encodes the specified Detection message. Does not implicitly {@link google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.Detection.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.Detection + * @static + * @param {google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.IDetection} message Detection message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Detection.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.binary != null && Object.hasOwnProperty.call(message, "binary")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.binary); + if (message.percentPagesMatched != null && Object.hasOwnProperty.call(message, "percentPagesMatched")) + writer.uint32(/* id 3, wireType 1 =*/25).double(message.percentPagesMatched); + return writer; + }; + + /** + * Encodes the specified Detection message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.Detection.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.Detection + * @static + * @param {google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.IDetection} message Detection message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Detection.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Detection message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.Detection + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.Detection} Detection + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Detection.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.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.Detection(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: + message.binary = reader.string(); + break; + case 3: + message.percentPagesMatched = reader.double(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Detection message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.Detection + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.Detection} Detection + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Detection.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Detection message. + * @function verify + * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.Detection + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Detection.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.binary != null && message.hasOwnProperty("binary")) + if (!$util.isString(message.binary)) + return "binary: string expected"; + if (message.percentPagesMatched != null && message.hasOwnProperty("percentPagesMatched")) + if (typeof message.percentPagesMatched !== "number") + return "percentPagesMatched: number expected"; + return null; + }; + + /** + * Creates a Detection message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.Detection + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.Detection} Detection + */ + Detection.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.Detection) + return object; + var message = new $root.google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.Detection(); + if (object.binary != null) + message.binary = String(object.binary); + if (object.percentPagesMatched != null) + message.percentPagesMatched = Number(object.percentPagesMatched); + return message; + }; + + /** + * Creates a plain object from a Detection message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.Detection + * @static + * @param {google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.Detection} message Detection + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Detection.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.binary = ""; + object.percentPagesMatched = 0; + } + if (message.binary != null && message.hasOwnProperty("binary")) + object.binary = message.binary; + if (message.percentPagesMatched != null && message.hasOwnProperty("percentPagesMatched")) + object.percentPagesMatched = options.json && !isFinite(message.percentPagesMatched) ? String(message.percentPagesMatched) : message.percentPagesMatched; + return object; + }; + + /** + * Converts this Detection to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.Detection + * @instance + * @returns {Object.} JSON object + */ + Detection.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Detection; + })(); + + return MemoryHashSignature; + })(); + + ProcessSignature.YaraRuleSignature = (function() { + + /** + * Properties of a YaraRuleSignature. + * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature + * @interface IYaraRuleSignature + * @property {string|null} [yaraRule] YaraRuleSignature yaraRule + */ + + /** + * Constructs a new YaraRuleSignature. + * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature + * @classdesc Represents a YaraRuleSignature. + * @implements IYaraRuleSignature + * @constructor + * @param {google.cloud.securitycenter.v1.Indicator.ProcessSignature.IYaraRuleSignature=} [properties] Properties to set + */ + function YaraRuleSignature(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]]; + } + + /** + * YaraRuleSignature yaraRule. + * @member {string} yaraRule + * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature.YaraRuleSignature + * @instance + */ + YaraRuleSignature.prototype.yaraRule = ""; + + /** + * Creates a new YaraRuleSignature instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature.YaraRuleSignature + * @static + * @param {google.cloud.securitycenter.v1.Indicator.ProcessSignature.IYaraRuleSignature=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.Indicator.ProcessSignature.YaraRuleSignature} YaraRuleSignature instance + */ + YaraRuleSignature.create = function create(properties) { + return new YaraRuleSignature(properties); + }; + + /** + * Encodes the specified YaraRuleSignature message. Does not implicitly {@link google.cloud.securitycenter.v1.Indicator.ProcessSignature.YaraRuleSignature.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature.YaraRuleSignature + * @static + * @param {google.cloud.securitycenter.v1.Indicator.ProcessSignature.IYaraRuleSignature} message YaraRuleSignature message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + YaraRuleSignature.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.yaraRule != null && Object.hasOwnProperty.call(message, "yaraRule")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.yaraRule); + return writer; + }; + + /** + * Encodes the specified YaraRuleSignature message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Indicator.ProcessSignature.YaraRuleSignature.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature.YaraRuleSignature + * @static + * @param {google.cloud.securitycenter.v1.Indicator.ProcessSignature.IYaraRuleSignature} message YaraRuleSignature message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + YaraRuleSignature.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a YaraRuleSignature message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature.YaraRuleSignature + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.Indicator.ProcessSignature.YaraRuleSignature} YaraRuleSignature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + YaraRuleSignature.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.cloud.securitycenter.v1.Indicator.ProcessSignature.YaraRuleSignature(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 5: + message.yaraRule = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a YaraRuleSignature message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature.YaraRuleSignature + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.Indicator.ProcessSignature.YaraRuleSignature} YaraRuleSignature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + YaraRuleSignature.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a YaraRuleSignature message. + * @function verify + * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature.YaraRuleSignature + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + YaraRuleSignature.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.yaraRule != null && message.hasOwnProperty("yaraRule")) + if (!$util.isString(message.yaraRule)) + return "yaraRule: string expected"; + return null; + }; + + /** + * Creates a YaraRuleSignature message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature.YaraRuleSignature + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.Indicator.ProcessSignature.YaraRuleSignature} YaraRuleSignature + */ + YaraRuleSignature.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.Indicator.ProcessSignature.YaraRuleSignature) + return object; + var message = new $root.google.cloud.securitycenter.v1.Indicator.ProcessSignature.YaraRuleSignature(); + if (object.yaraRule != null) + message.yaraRule = String(object.yaraRule); + return message; + }; + + /** + * Creates a plain object from a YaraRuleSignature message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature.YaraRuleSignature + * @static + * @param {google.cloud.securitycenter.v1.Indicator.ProcessSignature.YaraRuleSignature} message YaraRuleSignature + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + YaraRuleSignature.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.yaraRule = ""; + if (message.yaraRule != null && message.hasOwnProperty("yaraRule")) + object.yaraRule = message.yaraRule; + return object; + }; + + /** + * Converts this YaraRuleSignature to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature.YaraRuleSignature + * @instance + * @returns {Object.} JSON object + */ + YaraRuleSignature.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return YaraRuleSignature; + })(); + + return ProcessSignature; + })(); + + return Indicator; + })(); + + v1.Kubernetes = (function() { + + /** + * Properties of a Kubernetes. + * @memberof google.cloud.securitycenter.v1 + * @interface IKubernetes + * @property {Array.|null} [pods] Kubernetes pods + * @property {Array.|null} [nodes] Kubernetes nodes + * @property {Array.|null} [nodePools] Kubernetes nodePools + * @property {Array.|null} [roles] Kubernetes roles + * @property {Array.|null} [bindings] Kubernetes bindings + * @property {Array.|null} [accessReviews] Kubernetes accessReviews + */ + + /** + * Constructs a new Kubernetes. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a Kubernetes. + * @implements IKubernetes + * @constructor + * @param {google.cloud.securitycenter.v1.IKubernetes=} [properties] Properties to set + */ + function Kubernetes(properties) { + this.pods = []; + this.nodes = []; + this.nodePools = []; + this.roles = []; + this.bindings = []; + this.accessReviews = []; + 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]]; + } + + /** + * Kubernetes pods. + * @member {Array.} pods + * @memberof google.cloud.securitycenter.v1.Kubernetes + * @instance + */ + Kubernetes.prototype.pods = $util.emptyArray; + + /** + * Kubernetes nodes. + * @member {Array.} nodes + * @memberof google.cloud.securitycenter.v1.Kubernetes + * @instance + */ + Kubernetes.prototype.nodes = $util.emptyArray; + + /** + * Kubernetes nodePools. + * @member {Array.} nodePools + * @memberof google.cloud.securitycenter.v1.Kubernetes + * @instance + */ + Kubernetes.prototype.nodePools = $util.emptyArray; + + /** + * Kubernetes roles. + * @member {Array.} roles + * @memberof google.cloud.securitycenter.v1.Kubernetes + * @instance + */ + Kubernetes.prototype.roles = $util.emptyArray; + + /** + * Kubernetes bindings. + * @member {Array.} bindings + * @memberof google.cloud.securitycenter.v1.Kubernetes + * @instance + */ + Kubernetes.prototype.bindings = $util.emptyArray; + + /** + * Kubernetes accessReviews. + * @member {Array.} accessReviews + * @memberof google.cloud.securitycenter.v1.Kubernetes + * @instance + */ + Kubernetes.prototype.accessReviews = $util.emptyArray; + + /** + * Creates a new Kubernetes instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.Kubernetes + * @static + * @param {google.cloud.securitycenter.v1.IKubernetes=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.Kubernetes} Kubernetes instance + */ + Kubernetes.create = function create(properties) { + return new Kubernetes(properties); + }; + + /** + * Encodes the specified Kubernetes message. Does not implicitly {@link google.cloud.securitycenter.v1.Kubernetes.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.Kubernetes + * @static + * @param {google.cloud.securitycenter.v1.IKubernetes} message Kubernetes message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Kubernetes.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pods != null && message.pods.length) + for (var i = 0; i < message.pods.length; ++i) + $root.google.cloud.securitycenter.v1.Kubernetes.Pod.encode(message.pods[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nodes != null && message.nodes.length) + for (var i = 0; i < message.nodes.length; ++i) + $root.google.cloud.securitycenter.v1.Kubernetes.Node.encode(message.nodes[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.nodePools != null && message.nodePools.length) + for (var i = 0; i < message.nodePools.length; ++i) + $root.google.cloud.securitycenter.v1.Kubernetes.NodePool.encode(message.nodePools[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.roles != null && message.roles.length) + for (var i = 0; i < message.roles.length; ++i) + $root.google.cloud.securitycenter.v1.Kubernetes.Role.encode(message.roles[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.bindings != null && message.bindings.length) + for (var i = 0; i < message.bindings.length; ++i) + $root.google.cloud.securitycenter.v1.Kubernetes.Binding.encode(message.bindings[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.accessReviews != null && message.accessReviews.length) + for (var i = 0; i < message.accessReviews.length; ++i) + $root.google.cloud.securitycenter.v1.Kubernetes.AccessReview.encode(message.accessReviews[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Kubernetes message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Kubernetes.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.Kubernetes + * @static + * @param {google.cloud.securitycenter.v1.IKubernetes} message Kubernetes message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Kubernetes.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Kubernetes message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.Kubernetes + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.Kubernetes} Kubernetes + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Kubernetes.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.cloud.securitycenter.v1.Kubernetes(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.pods && message.pods.length)) + message.pods = []; + message.pods.push($root.google.cloud.securitycenter.v1.Kubernetes.Pod.decode(reader, reader.uint32())); + break; + case 2: + if (!(message.nodes && message.nodes.length)) + message.nodes = []; + message.nodes.push($root.google.cloud.securitycenter.v1.Kubernetes.Node.decode(reader, reader.uint32())); + break; + case 3: + if (!(message.nodePools && message.nodePools.length)) + message.nodePools = []; + message.nodePools.push($root.google.cloud.securitycenter.v1.Kubernetes.NodePool.decode(reader, reader.uint32())); + break; + case 4: + if (!(message.roles && message.roles.length)) + message.roles = []; + message.roles.push($root.google.cloud.securitycenter.v1.Kubernetes.Role.decode(reader, reader.uint32())); + break; + case 5: + if (!(message.bindings && message.bindings.length)) + message.bindings = []; + message.bindings.push($root.google.cloud.securitycenter.v1.Kubernetes.Binding.decode(reader, reader.uint32())); + break; + case 6: + if (!(message.accessReviews && message.accessReviews.length)) + message.accessReviews = []; + message.accessReviews.push($root.google.cloud.securitycenter.v1.Kubernetes.AccessReview.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Kubernetes message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.Kubernetes + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.Kubernetes} Kubernetes + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Kubernetes.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Kubernetes message. + * @function verify + * @memberof google.cloud.securitycenter.v1.Kubernetes + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Kubernetes.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.pods != null && message.hasOwnProperty("pods")) { + if (!Array.isArray(message.pods)) + return "pods: array expected"; + for (var i = 0; i < message.pods.length; ++i) { + var error = $root.google.cloud.securitycenter.v1.Kubernetes.Pod.verify(message.pods[i]); + if (error) + return "pods." + error; + } + } + if (message.nodes != null && message.hasOwnProperty("nodes")) { + if (!Array.isArray(message.nodes)) + return "nodes: array expected"; + for (var i = 0; i < message.nodes.length; ++i) { + var error = $root.google.cloud.securitycenter.v1.Kubernetes.Node.verify(message.nodes[i]); + if (error) + return "nodes." + error; + } + } + if (message.nodePools != null && message.hasOwnProperty("nodePools")) { + if (!Array.isArray(message.nodePools)) + return "nodePools: array expected"; + for (var i = 0; i < message.nodePools.length; ++i) { + var error = $root.google.cloud.securitycenter.v1.Kubernetes.NodePool.verify(message.nodePools[i]); + if (error) + return "nodePools." + error; + } + } + if (message.roles != null && message.hasOwnProperty("roles")) { + if (!Array.isArray(message.roles)) + return "roles: array expected"; + for (var i = 0; i < message.roles.length; ++i) { + var error = $root.google.cloud.securitycenter.v1.Kubernetes.Role.verify(message.roles[i]); + if (error) + return "roles." + error; + } + } + if (message.bindings != null && message.hasOwnProperty("bindings")) { + if (!Array.isArray(message.bindings)) + return "bindings: array expected"; + for (var i = 0; i < message.bindings.length; ++i) { + var error = $root.google.cloud.securitycenter.v1.Kubernetes.Binding.verify(message.bindings[i]); + if (error) + return "bindings." + error; + } + } + if (message.accessReviews != null && message.hasOwnProperty("accessReviews")) { + if (!Array.isArray(message.accessReviews)) + return "accessReviews: array expected"; + for (var i = 0; i < message.accessReviews.length; ++i) { + var error = $root.google.cloud.securitycenter.v1.Kubernetes.AccessReview.verify(message.accessReviews[i]); + if (error) + return "accessReviews." + error; + } + } + return null; + }; + + /** + * Creates a Kubernetes message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.Kubernetes + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.Kubernetes} Kubernetes + */ + Kubernetes.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.Kubernetes) + return object; + var message = new $root.google.cloud.securitycenter.v1.Kubernetes(); + if (object.pods) { + if (!Array.isArray(object.pods)) + throw TypeError(".google.cloud.securitycenter.v1.Kubernetes.pods: array expected"); + message.pods = []; + for (var i = 0; i < object.pods.length; ++i) { + if (typeof object.pods[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Kubernetes.pods: object expected"); + message.pods[i] = $root.google.cloud.securitycenter.v1.Kubernetes.Pod.fromObject(object.pods[i]); + } + } + if (object.nodes) { + if (!Array.isArray(object.nodes)) + throw TypeError(".google.cloud.securitycenter.v1.Kubernetes.nodes: array expected"); + message.nodes = []; + for (var i = 0; i < object.nodes.length; ++i) { + if (typeof object.nodes[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Kubernetes.nodes: object expected"); + message.nodes[i] = $root.google.cloud.securitycenter.v1.Kubernetes.Node.fromObject(object.nodes[i]); + } + } + if (object.nodePools) { + if (!Array.isArray(object.nodePools)) + throw TypeError(".google.cloud.securitycenter.v1.Kubernetes.nodePools: array expected"); + message.nodePools = []; + for (var i = 0; i < object.nodePools.length; ++i) { + if (typeof object.nodePools[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Kubernetes.nodePools: object expected"); + message.nodePools[i] = $root.google.cloud.securitycenter.v1.Kubernetes.NodePool.fromObject(object.nodePools[i]); + } + } + if (object.roles) { + if (!Array.isArray(object.roles)) + throw TypeError(".google.cloud.securitycenter.v1.Kubernetes.roles: array expected"); + message.roles = []; + for (var i = 0; i < object.roles.length; ++i) { + if (typeof object.roles[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Kubernetes.roles: object expected"); + message.roles[i] = $root.google.cloud.securitycenter.v1.Kubernetes.Role.fromObject(object.roles[i]); + } + } + if (object.bindings) { + if (!Array.isArray(object.bindings)) + throw TypeError(".google.cloud.securitycenter.v1.Kubernetes.bindings: array expected"); + message.bindings = []; + for (var i = 0; i < object.bindings.length; ++i) { + if (typeof object.bindings[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Kubernetes.bindings: object expected"); + message.bindings[i] = $root.google.cloud.securitycenter.v1.Kubernetes.Binding.fromObject(object.bindings[i]); + } + } + if (object.accessReviews) { + if (!Array.isArray(object.accessReviews)) + throw TypeError(".google.cloud.securitycenter.v1.Kubernetes.accessReviews: array expected"); + message.accessReviews = []; + for (var i = 0; i < object.accessReviews.length; ++i) { + if (typeof object.accessReviews[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Kubernetes.accessReviews: object expected"); + message.accessReviews[i] = $root.google.cloud.securitycenter.v1.Kubernetes.AccessReview.fromObject(object.accessReviews[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Kubernetes message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.Kubernetes + * @static + * @param {google.cloud.securitycenter.v1.Kubernetes} message Kubernetes + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Kubernetes.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.pods = []; + object.nodes = []; + object.nodePools = []; + object.roles = []; + object.bindings = []; + object.accessReviews = []; + } + if (message.pods && message.pods.length) { + object.pods = []; + for (var j = 0; j < message.pods.length; ++j) + object.pods[j] = $root.google.cloud.securitycenter.v1.Kubernetes.Pod.toObject(message.pods[j], options); + } + if (message.nodes && message.nodes.length) { + object.nodes = []; + for (var j = 0; j < message.nodes.length; ++j) + object.nodes[j] = $root.google.cloud.securitycenter.v1.Kubernetes.Node.toObject(message.nodes[j], options); + } + if (message.nodePools && message.nodePools.length) { + object.nodePools = []; + for (var j = 0; j < message.nodePools.length; ++j) + object.nodePools[j] = $root.google.cloud.securitycenter.v1.Kubernetes.NodePool.toObject(message.nodePools[j], options); + } + if (message.roles && message.roles.length) { + object.roles = []; + for (var j = 0; j < message.roles.length; ++j) + object.roles[j] = $root.google.cloud.securitycenter.v1.Kubernetes.Role.toObject(message.roles[j], options); + } + if (message.bindings && message.bindings.length) { + object.bindings = []; + for (var j = 0; j < message.bindings.length; ++j) + object.bindings[j] = $root.google.cloud.securitycenter.v1.Kubernetes.Binding.toObject(message.bindings[j], options); + } + if (message.accessReviews && message.accessReviews.length) { + object.accessReviews = []; + for (var j = 0; j < message.accessReviews.length; ++j) + object.accessReviews[j] = $root.google.cloud.securitycenter.v1.Kubernetes.AccessReview.toObject(message.accessReviews[j], options); + } + return object; + }; + + /** + * Converts this Kubernetes to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.Kubernetes + * @instance + * @returns {Object.} JSON object + */ + Kubernetes.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + Kubernetes.Pod = (function() { + + /** + * Properties of a Pod. + * @memberof google.cloud.securitycenter.v1.Kubernetes + * @interface IPod + * @property {string|null} [ns] Pod ns + * @property {string|null} [name] Pod name + * @property {Array.|null} [labels] Pod labels + * @property {Array.|null} [containers] Pod containers + */ + + /** + * Constructs a new Pod. + * @memberof google.cloud.securitycenter.v1.Kubernetes + * @classdesc Represents a Pod. + * @implements IPod + * @constructor + * @param {google.cloud.securitycenter.v1.Kubernetes.IPod=} [properties] Properties to set + */ + function Pod(properties) { + this.labels = []; + this.containers = []; + 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]]; + } + + /** + * Pod ns. + * @member {string} ns + * @memberof google.cloud.securitycenter.v1.Kubernetes.Pod + * @instance + */ + Pod.prototype.ns = ""; + + /** + * Pod name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1.Kubernetes.Pod + * @instance + */ + Pod.prototype.name = ""; + + /** + * Pod labels. + * @member {Array.} labels + * @memberof google.cloud.securitycenter.v1.Kubernetes.Pod + * @instance + */ + Pod.prototype.labels = $util.emptyArray; + + /** + * Pod containers. + * @member {Array.} containers + * @memberof google.cloud.securitycenter.v1.Kubernetes.Pod + * @instance + */ + Pod.prototype.containers = $util.emptyArray; + + /** + * Creates a new Pod instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.Kubernetes.Pod + * @static + * @param {google.cloud.securitycenter.v1.Kubernetes.IPod=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.Kubernetes.Pod} Pod instance + */ + Pod.create = function create(properties) { + return new Pod(properties); + }; + + /** + * Encodes the specified Pod message. Does not implicitly {@link google.cloud.securitycenter.v1.Kubernetes.Pod.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.Kubernetes.Pod + * @static + * @param {google.cloud.securitycenter.v1.Kubernetes.IPod} message Pod message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Pod.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.ns != null && Object.hasOwnProperty.call(message, "ns")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.ns); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.name); + if (message.labels != null && message.labels.length) + for (var i = 0; i < message.labels.length; ++i) + $root.google.cloud.securitycenter.v1.Label.encode(message.labels[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.containers != null && message.containers.length) + for (var i = 0; i < message.containers.length; ++i) + $root.google.cloud.securitycenter.v1.Container.encode(message.containers[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Pod message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Kubernetes.Pod.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.Kubernetes.Pod + * @static + * @param {google.cloud.securitycenter.v1.Kubernetes.IPod} message Pod message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Pod.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Pod message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.Kubernetes.Pod + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.Kubernetes.Pod} Pod + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Pod.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.cloud.securitycenter.v1.Kubernetes.Pod(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.ns = reader.string(); + break; + case 2: + message.name = reader.string(); + break; + case 3: + if (!(message.labels && message.labels.length)) + message.labels = []; + message.labels.push($root.google.cloud.securitycenter.v1.Label.decode(reader, reader.uint32())); + break; + case 4: + if (!(message.containers && message.containers.length)) + message.containers = []; + message.containers.push($root.google.cloud.securitycenter.v1.Container.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Pod message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.Kubernetes.Pod + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.Kubernetes.Pod} Pod + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Pod.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Pod message. + * @function verify + * @memberof google.cloud.securitycenter.v1.Kubernetes.Pod + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Pod.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.ns != null && message.hasOwnProperty("ns")) + if (!$util.isString(message.ns)) + return "ns: string expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!Array.isArray(message.labels)) + return "labels: array expected"; + for (var i = 0; i < message.labels.length; ++i) { + var error = $root.google.cloud.securitycenter.v1.Label.verify(message.labels[i]); + if (error) + return "labels." + error; + } + } + if (message.containers != null && message.hasOwnProperty("containers")) { + if (!Array.isArray(message.containers)) + return "containers: array expected"; + for (var i = 0; i < message.containers.length; ++i) { + var error = $root.google.cloud.securitycenter.v1.Container.verify(message.containers[i]); + if (error) + return "containers." + error; + } + } + return null; + }; + + /** + * Creates a Pod message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.Kubernetes.Pod + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.Kubernetes.Pod} Pod + */ + Pod.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.Kubernetes.Pod) + return object; + var message = new $root.google.cloud.securitycenter.v1.Kubernetes.Pod(); + if (object.ns != null) + message.ns = String(object.ns); + if (object.name != null) + message.name = String(object.name); + if (object.labels) { + if (!Array.isArray(object.labels)) + throw TypeError(".google.cloud.securitycenter.v1.Kubernetes.Pod.labels: array expected"); + message.labels = []; + for (var i = 0; i < object.labels.length; ++i) { + if (typeof object.labels[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Kubernetes.Pod.labels: object expected"); + message.labels[i] = $root.google.cloud.securitycenter.v1.Label.fromObject(object.labels[i]); + } + } + if (object.containers) { + if (!Array.isArray(object.containers)) + throw TypeError(".google.cloud.securitycenter.v1.Kubernetes.Pod.containers: array expected"); + message.containers = []; + for (var i = 0; i < object.containers.length; ++i) { + if (typeof object.containers[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Kubernetes.Pod.containers: object expected"); + message.containers[i] = $root.google.cloud.securitycenter.v1.Container.fromObject(object.containers[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Pod message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.Kubernetes.Pod + * @static + * @param {google.cloud.securitycenter.v1.Kubernetes.Pod} message Pod + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Pod.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.labels = []; + object.containers = []; + } + if (options.defaults) { + object.ns = ""; + object.name = ""; + } + if (message.ns != null && message.hasOwnProperty("ns")) + object.ns = message.ns; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.labels && message.labels.length) { + object.labels = []; + for (var j = 0; j < message.labels.length; ++j) + object.labels[j] = $root.google.cloud.securitycenter.v1.Label.toObject(message.labels[j], options); + } + if (message.containers && message.containers.length) { + object.containers = []; + for (var j = 0; j < message.containers.length; ++j) + object.containers[j] = $root.google.cloud.securitycenter.v1.Container.toObject(message.containers[j], options); + } + return object; + }; + + /** + * Converts this Pod to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.Kubernetes.Pod + * @instance + * @returns {Object.} JSON object + */ + Pod.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Pod; + })(); + + Kubernetes.Node = (function() { + + /** + * Properties of a Node. + * @memberof google.cloud.securitycenter.v1.Kubernetes + * @interface INode + * @property {string|null} [name] Node name + */ + + /** + * Constructs a new Node. + * @memberof google.cloud.securitycenter.v1.Kubernetes + * @classdesc Represents a Node. + * @implements INode + * @constructor + * @param {google.cloud.securitycenter.v1.Kubernetes.INode=} [properties] Properties to set + */ + function Node(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]]; + } + + /** + * Node name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1.Kubernetes.Node + * @instance + */ + Node.prototype.name = ""; + + /** + * Creates a new Node instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.Kubernetes.Node + * @static + * @param {google.cloud.securitycenter.v1.Kubernetes.INode=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.Kubernetes.Node} Node instance + */ + Node.create = function create(properties) { + return new Node(properties); + }; + + /** + * Encodes the specified Node message. Does not implicitly {@link google.cloud.securitycenter.v1.Kubernetes.Node.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.Kubernetes.Node + * @static + * @param {google.cloud.securitycenter.v1.Kubernetes.INode} message Node message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Node.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 Node message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Kubernetes.Node.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.Kubernetes.Node + * @static + * @param {google.cloud.securitycenter.v1.Kubernetes.INode} message Node message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Node.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Node message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.Kubernetes.Node + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.Kubernetes.Node} Node + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Node.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.cloud.securitycenter.v1.Kubernetes.Node(); + 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 Node message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.Kubernetes.Node + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.Kubernetes.Node} Node + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Node.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Node message. + * @function verify + * @memberof google.cloud.securitycenter.v1.Kubernetes.Node + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Node.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 Node message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.Kubernetes.Node + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.Kubernetes.Node} Node + */ + Node.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.Kubernetes.Node) + return object; + var message = new $root.google.cloud.securitycenter.v1.Kubernetes.Node(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a Node message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.Kubernetes.Node + * @static + * @param {google.cloud.securitycenter.v1.Kubernetes.Node} message Node + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Node.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 Node to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.Kubernetes.Node + * @instance + * @returns {Object.} JSON object + */ + Node.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Node; + })(); + + Kubernetes.NodePool = (function() { + + /** + * Properties of a NodePool. + * @memberof google.cloud.securitycenter.v1.Kubernetes + * @interface INodePool + * @property {string|null} [name] NodePool name + * @property {Array.|null} [nodes] NodePool nodes + */ + + /** + * Constructs a new NodePool. + * @memberof google.cloud.securitycenter.v1.Kubernetes + * @classdesc Represents a NodePool. + * @implements INodePool + * @constructor + * @param {google.cloud.securitycenter.v1.Kubernetes.INodePool=} [properties] Properties to set + */ + function NodePool(properties) { + this.nodes = []; + 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]]; + } + + /** + * NodePool name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1.Kubernetes.NodePool + * @instance + */ + NodePool.prototype.name = ""; + + /** + * NodePool nodes. + * @member {Array.} nodes + * @memberof google.cloud.securitycenter.v1.Kubernetes.NodePool + * @instance + */ + NodePool.prototype.nodes = $util.emptyArray; + + /** + * Creates a new NodePool instance using the specified properties. * @function create - * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature + * @memberof google.cloud.securitycenter.v1.Kubernetes.NodePool * @static - * @param {google.cloud.securitycenter.v1.Indicator.IProcessSignature=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.Indicator.ProcessSignature} ProcessSignature instance + * @param {google.cloud.securitycenter.v1.Kubernetes.INodePool=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.Kubernetes.NodePool} NodePool instance */ - ProcessSignature.create = function create(properties) { - return new ProcessSignature(properties); + NodePool.create = function create(properties) { + return new NodePool(properties); }; /** - * Encodes the specified ProcessSignature message. Does not implicitly {@link google.cloud.securitycenter.v1.Indicator.ProcessSignature.verify|verify} messages. + * Encodes the specified NodePool message. Does not implicitly {@link google.cloud.securitycenter.v1.Kubernetes.NodePool.verify|verify} messages. * @function encode - * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature + * @memberof google.cloud.securitycenter.v1.Kubernetes.NodePool * @static - * @param {google.cloud.securitycenter.v1.Indicator.IProcessSignature} message ProcessSignature message or plain object to encode + * @param {google.cloud.securitycenter.v1.Kubernetes.INodePool} message NodePool message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ProcessSignature.encode = function encode(message, writer) { + NodePool.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.memoryHashSignature != null && Object.hasOwnProperty.call(message, "memoryHashSignature")) - $root.google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.encode(message.memoryHashSignature, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.yaraRuleSignature != null && Object.hasOwnProperty.call(message, "yaraRuleSignature")) - $root.google.cloud.securitycenter.v1.Indicator.ProcessSignature.YaraRuleSignature.encode(message.yaraRuleSignature, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.nodes != null && message.nodes.length) + for (var i = 0; i < message.nodes.length; ++i) + $root.google.cloud.securitycenter.v1.Kubernetes.Node.encode(message.nodes[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** - * Encodes the specified ProcessSignature message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Indicator.ProcessSignature.verify|verify} messages. + * Encodes the specified NodePool message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Kubernetes.NodePool.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature + * @memberof google.cloud.securitycenter.v1.Kubernetes.NodePool * @static - * @param {google.cloud.securitycenter.v1.Indicator.IProcessSignature} message ProcessSignature message or plain object to encode + * @param {google.cloud.securitycenter.v1.Kubernetes.INodePool} message NodePool message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ProcessSignature.encodeDelimited = function encodeDelimited(message, writer) { + NodePool.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ProcessSignature message from the specified reader or buffer. + * Decodes a NodePool message from the specified reader or buffer. * @function decode - * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature + * @memberof google.cloud.securitycenter.v1.Kubernetes.NodePool * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.Indicator.ProcessSignature} ProcessSignature + * @returns {google.cloud.securitycenter.v1.Kubernetes.NodePool} NodePool * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ProcessSignature.decode = function decode(reader, length) { + NodePool.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.cloud.securitycenter.v1.Indicator.ProcessSignature(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.Kubernetes.NodePool(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 6: - message.memoryHashSignature = $root.google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.decode(reader, reader.uint32()); + case 1: + message.name = reader.string(); break; - case 7: - message.yaraRuleSignature = $root.google.cloud.securitycenter.v1.Indicator.ProcessSignature.YaraRuleSignature.decode(reader, reader.uint32()); + case 2: + if (!(message.nodes && message.nodes.length)) + message.nodes = []; + message.nodes.push($root.google.cloud.securitycenter.v1.Kubernetes.Node.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -6382,748 +8710,1256 @@ }; /** - * Decodes a ProcessSignature message from the specified reader or buffer, length delimited. + * Decodes a NodePool message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature + * @memberof google.cloud.securitycenter.v1.Kubernetes.NodePool * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.Indicator.ProcessSignature} ProcessSignature + * @returns {google.cloud.securitycenter.v1.Kubernetes.NodePool} NodePool * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ProcessSignature.decodeDelimited = function decodeDelimited(reader) { + NodePool.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ProcessSignature message. + * Verifies a NodePool message. * @function verify - * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature + * @memberof google.cloud.securitycenter.v1.Kubernetes.NodePool * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ProcessSignature.verify = function verify(message) { + NodePool.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - var properties = {}; - if (message.memoryHashSignature != null && message.hasOwnProperty("memoryHashSignature")) { - properties.signature = 1; - { - var error = $root.google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.verify(message.memoryHashSignature); + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.nodes != null && message.hasOwnProperty("nodes")) { + if (!Array.isArray(message.nodes)) + return "nodes: array expected"; + for (var i = 0; i < message.nodes.length; ++i) { + var error = $root.google.cloud.securitycenter.v1.Kubernetes.Node.verify(message.nodes[i]); if (error) - return "memoryHashSignature." + error; + return "nodes." + error; } } - if (message.yaraRuleSignature != null && message.hasOwnProperty("yaraRuleSignature")) { - if (properties.signature === 1) - return "signature: multiple values"; - properties.signature = 1; - { - var error = $root.google.cloud.securitycenter.v1.Indicator.ProcessSignature.YaraRuleSignature.verify(message.yaraRuleSignature); - if (error) - return "yaraRuleSignature." + error; + return null; + }; + + /** + * Creates a NodePool message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.Kubernetes.NodePool + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.Kubernetes.NodePool} NodePool + */ + NodePool.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.Kubernetes.NodePool) + return object; + var message = new $root.google.cloud.securitycenter.v1.Kubernetes.NodePool(); + if (object.name != null) + message.name = String(object.name); + if (object.nodes) { + if (!Array.isArray(object.nodes)) + throw TypeError(".google.cloud.securitycenter.v1.Kubernetes.NodePool.nodes: array expected"); + message.nodes = []; + for (var i = 0; i < object.nodes.length; ++i) { + if (typeof object.nodes[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Kubernetes.NodePool.nodes: object expected"); + message.nodes[i] = $root.google.cloud.securitycenter.v1.Kubernetes.Node.fromObject(object.nodes[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a NodePool message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.Kubernetes.NodePool + * @static + * @param {google.cloud.securitycenter.v1.Kubernetes.NodePool} message NodePool + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NodePool.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.nodes = []; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.nodes && message.nodes.length) { + object.nodes = []; + for (var j = 0; j < message.nodes.length; ++j) + object.nodes[j] = $root.google.cloud.securitycenter.v1.Kubernetes.Node.toObject(message.nodes[j], options); + } + return object; + }; + + /** + * Converts this NodePool to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.Kubernetes.NodePool + * @instance + * @returns {Object.} JSON object + */ + NodePool.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return NodePool; + })(); + + Kubernetes.Role = (function() { + + /** + * Properties of a Role. + * @memberof google.cloud.securitycenter.v1.Kubernetes + * @interface IRole + * @property {google.cloud.securitycenter.v1.Kubernetes.Role.Kind|null} [kind] Role kind + * @property {string|null} [ns] Role ns + * @property {string|null} [name] Role name + */ + + /** + * Constructs a new Role. + * @memberof google.cloud.securitycenter.v1.Kubernetes + * @classdesc Represents a Role. + * @implements IRole + * @constructor + * @param {google.cloud.securitycenter.v1.Kubernetes.IRole=} [properties] Properties to set + */ + function Role(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]]; + } + + /** + * Role kind. + * @member {google.cloud.securitycenter.v1.Kubernetes.Role.Kind} kind + * @memberof google.cloud.securitycenter.v1.Kubernetes.Role + * @instance + */ + Role.prototype.kind = 0; + + /** + * Role ns. + * @member {string} ns + * @memberof google.cloud.securitycenter.v1.Kubernetes.Role + * @instance + */ + Role.prototype.ns = ""; + + /** + * Role name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1.Kubernetes.Role + * @instance + */ + Role.prototype.name = ""; + + /** + * Creates a new Role instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.Kubernetes.Role + * @static + * @param {google.cloud.securitycenter.v1.Kubernetes.IRole=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.Kubernetes.Role} Role instance + */ + Role.create = function create(properties) { + return new Role(properties); + }; + + /** + * Encodes the specified Role message. Does not implicitly {@link google.cloud.securitycenter.v1.Kubernetes.Role.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.Kubernetes.Role + * @static + * @param {google.cloud.securitycenter.v1.Kubernetes.IRole} message Role message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Role.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.kind); + if (message.ns != null && Object.hasOwnProperty.call(message, "ns")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.ns); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.name); + return writer; + }; + + /** + * Encodes the specified Role message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Kubernetes.Role.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.Kubernetes.Role + * @static + * @param {google.cloud.securitycenter.v1.Kubernetes.IRole} message Role message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Role.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Role message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.Kubernetes.Role + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.Kubernetes.Role} Role + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Role.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.cloud.securitycenter.v1.Kubernetes.Role(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.kind = reader.int32(); + break; + case 2: + message.ns = reader.string(); + break; + case 3: + message.name = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; } } + return message; + }; + + /** + * Decodes a Role message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.Kubernetes.Role + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.Kubernetes.Role} Role + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Role.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Role message. + * @function verify + * @memberof google.cloud.securitycenter.v1.Kubernetes.Role + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Role.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.kind != null && message.hasOwnProperty("kind")) + switch (message.kind) { + default: + return "kind: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.ns != null && message.hasOwnProperty("ns")) + if (!$util.isString(message.ns)) + return "ns: string expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; return null; }; /** - * Creates a ProcessSignature message from a plain object. Also converts values to their respective internal types. + * Creates a Role message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature + * @memberof google.cloud.securitycenter.v1.Kubernetes.Role * @static * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.Indicator.ProcessSignature} ProcessSignature + * @returns {google.cloud.securitycenter.v1.Kubernetes.Role} Role */ - ProcessSignature.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.Indicator.ProcessSignature) + Role.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.Kubernetes.Role) return object; - var message = new $root.google.cloud.securitycenter.v1.Indicator.ProcessSignature(); - if (object.memoryHashSignature != null) { - if (typeof object.memoryHashSignature !== "object") - throw TypeError(".google.cloud.securitycenter.v1.Indicator.ProcessSignature.memoryHashSignature: object expected"); - message.memoryHashSignature = $root.google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.fromObject(object.memoryHashSignature); - } - if (object.yaraRuleSignature != null) { - if (typeof object.yaraRuleSignature !== "object") - throw TypeError(".google.cloud.securitycenter.v1.Indicator.ProcessSignature.yaraRuleSignature: object expected"); - message.yaraRuleSignature = $root.google.cloud.securitycenter.v1.Indicator.ProcessSignature.YaraRuleSignature.fromObject(object.yaraRuleSignature); + var message = new $root.google.cloud.securitycenter.v1.Kubernetes.Role(); + switch (object.kind) { + case "KIND_UNSPECIFIED": + case 0: + message.kind = 0; + break; + case "ROLE": + case 1: + message.kind = 1; + break; + case "CLUSTER_ROLE": + case 2: + message.kind = 2; + break; } + if (object.ns != null) + message.ns = String(object.ns); + if (object.name != null) + message.name = String(object.name); return message; }; /** - * Creates a plain object from a ProcessSignature message. Also converts values to other types if specified. + * Creates a plain object from a Role message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature + * @memberof google.cloud.securitycenter.v1.Kubernetes.Role * @static - * @param {google.cloud.securitycenter.v1.Indicator.ProcessSignature} message ProcessSignature + * @param {google.cloud.securitycenter.v1.Kubernetes.Role} message Role * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ProcessSignature.toObject = function toObject(message, options) { + Role.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (message.memoryHashSignature != null && message.hasOwnProperty("memoryHashSignature")) { - object.memoryHashSignature = $root.google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.toObject(message.memoryHashSignature, options); - if (options.oneofs) - object.signature = "memoryHashSignature"; - } - if (message.yaraRuleSignature != null && message.hasOwnProperty("yaraRuleSignature")) { - object.yaraRuleSignature = $root.google.cloud.securitycenter.v1.Indicator.ProcessSignature.YaraRuleSignature.toObject(message.yaraRuleSignature, options); - if (options.oneofs) - object.signature = "yaraRuleSignature"; + if (options.defaults) { + object.kind = options.enums === String ? "KIND_UNSPECIFIED" : 0; + object.ns = ""; + object.name = ""; } + if (message.kind != null && message.hasOwnProperty("kind")) + object.kind = options.enums === String ? $root.google.cloud.securitycenter.v1.Kubernetes.Role.Kind[message.kind] : message.kind; + if (message.ns != null && message.hasOwnProperty("ns")) + object.ns = message.ns; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; return object; }; /** - * Converts this ProcessSignature to JSON. + * Converts this Role to JSON. * @function toJSON - * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature + * @memberof google.cloud.securitycenter.v1.Kubernetes.Role * @instance * @returns {Object.} JSON object */ - ProcessSignature.prototype.toJSON = function toJSON() { + Role.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - ProcessSignature.MemoryHashSignature = (function() { + /** + * Kind enum. + * @name google.cloud.securitycenter.v1.Kubernetes.Role.Kind + * @enum {number} + * @property {number} KIND_UNSPECIFIED=0 KIND_UNSPECIFIED value + * @property {number} ROLE=1 ROLE value + * @property {number} CLUSTER_ROLE=2 CLUSTER_ROLE value + */ + Role.Kind = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "KIND_UNSPECIFIED"] = 0; + values[valuesById[1] = "ROLE"] = 1; + values[valuesById[2] = "CLUSTER_ROLE"] = 2; + return values; + })(); - /** - * Properties of a MemoryHashSignature. - * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature - * @interface IMemoryHashSignature - * @property {string|null} [binaryFamily] MemoryHashSignature binaryFamily - * @property {Array.|null} [detections] MemoryHashSignature detections - */ + return Role; + })(); - /** - * Constructs a new MemoryHashSignature. - * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature - * @classdesc Represents a MemoryHashSignature. - * @implements IMemoryHashSignature - * @constructor - * @param {google.cloud.securitycenter.v1.Indicator.ProcessSignature.IMemoryHashSignature=} [properties] Properties to set - */ - function MemoryHashSignature(properties) { - this.detections = []; - 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]]; - } + Kubernetes.Binding = (function() { - /** - * MemoryHashSignature binaryFamily. - * @member {string} binaryFamily - * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature - * @instance - */ - MemoryHashSignature.prototype.binaryFamily = ""; + /** + * Properties of a Binding. + * @memberof google.cloud.securitycenter.v1.Kubernetes + * @interface IBinding + * @property {string|null} [ns] Binding ns + * @property {string|null} [name] Binding name + * @property {google.cloud.securitycenter.v1.Kubernetes.IRole|null} [role] Binding role + * @property {Array.|null} [subjects] Binding subjects + */ - /** - * MemoryHashSignature detections. - * @member {Array.} detections - * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature - * @instance - */ - MemoryHashSignature.prototype.detections = $util.emptyArray; + /** + * Constructs a new Binding. + * @memberof google.cloud.securitycenter.v1.Kubernetes + * @classdesc Represents a Binding. + * @implements IBinding + * @constructor + * @param {google.cloud.securitycenter.v1.Kubernetes.IBinding=} [properties] Properties to set + */ + function Binding(properties) { + this.subjects = []; + 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]]; + } - /** - * Creates a new MemoryHashSignature instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature - * @static - * @param {google.cloud.securitycenter.v1.Indicator.ProcessSignature.IMemoryHashSignature=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature} MemoryHashSignature instance - */ - MemoryHashSignature.create = function create(properties) { - return new MemoryHashSignature(properties); - }; + /** + * Binding ns. + * @member {string} ns + * @memberof google.cloud.securitycenter.v1.Kubernetes.Binding + * @instance + */ + Binding.prototype.ns = ""; - /** - * Encodes the specified MemoryHashSignature message. Does not implicitly {@link google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature - * @static - * @param {google.cloud.securitycenter.v1.Indicator.ProcessSignature.IMemoryHashSignature} message MemoryHashSignature message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MemoryHashSignature.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.binaryFamily != null && Object.hasOwnProperty.call(message, "binaryFamily")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.binaryFamily); - if (message.detections != null && message.detections.length) - for (var i = 0; i < message.detections.length; ++i) - $root.google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.Detection.encode(message.detections[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; + /** + * Binding name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1.Kubernetes.Binding + * @instance + */ + Binding.prototype.name = ""; - /** - * Encodes the specified MemoryHashSignature message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature - * @static - * @param {google.cloud.securitycenter.v1.Indicator.ProcessSignature.IMemoryHashSignature} message MemoryHashSignature message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MemoryHashSignature.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Binding role. + * @member {google.cloud.securitycenter.v1.Kubernetes.IRole|null|undefined} role + * @memberof google.cloud.securitycenter.v1.Kubernetes.Binding + * @instance + */ + Binding.prototype.role = null; - /** - * Decodes a MemoryHashSignature message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature} MemoryHashSignature - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MemoryHashSignature.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.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.binaryFamily = reader.string(); - break; - case 4: - if (!(message.detections && message.detections.length)) - message.detections = []; - message.detections.push($root.google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.Detection.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Binding subjects. + * @member {Array.} subjects + * @memberof google.cloud.securitycenter.v1.Kubernetes.Binding + * @instance + */ + Binding.prototype.subjects = $util.emptyArray; - /** - * Decodes a MemoryHashSignature message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature} MemoryHashSignature - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MemoryHashSignature.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Creates a new Binding instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.Kubernetes.Binding + * @static + * @param {google.cloud.securitycenter.v1.Kubernetes.IBinding=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.Kubernetes.Binding} Binding instance + */ + Binding.create = function create(properties) { + return new Binding(properties); + }; - /** - * Verifies a MemoryHashSignature message. - * @function verify - * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MemoryHashSignature.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.binaryFamily != null && message.hasOwnProperty("binaryFamily")) - if (!$util.isString(message.binaryFamily)) - return "binaryFamily: string expected"; - if (message.detections != null && message.hasOwnProperty("detections")) { - if (!Array.isArray(message.detections)) - return "detections: array expected"; - for (var i = 0; i < message.detections.length; ++i) { - var error = $root.google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.Detection.verify(message.detections[i]); - if (error) - return "detections." + error; - } - } - return null; - }; + /** + * Encodes the specified Binding message. Does not implicitly {@link google.cloud.securitycenter.v1.Kubernetes.Binding.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.Kubernetes.Binding + * @static + * @param {google.cloud.securitycenter.v1.Kubernetes.IBinding} message Binding message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Binding.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.ns != null && Object.hasOwnProperty.call(message, "ns")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.ns); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.name); + if (message.role != null && Object.hasOwnProperty.call(message, "role")) + $root.google.cloud.securitycenter.v1.Kubernetes.Role.encode(message.role, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.subjects != null && message.subjects.length) + for (var i = 0; i < message.subjects.length; ++i) + $root.google.cloud.securitycenter.v1.Kubernetes.Subject.encode(message.subjects[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; - /** - * Creates a MemoryHashSignature message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature} MemoryHashSignature - */ - MemoryHashSignature.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature) - return object; - var message = new $root.google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature(); - if (object.binaryFamily != null) - message.binaryFamily = String(object.binaryFamily); - if (object.detections) { - if (!Array.isArray(object.detections)) - throw TypeError(".google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.detections: array expected"); - message.detections = []; - for (var i = 0; i < object.detections.length; ++i) { - if (typeof object.detections[i] !== "object") - throw TypeError(".google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.detections: object expected"); - message.detections[i] = $root.google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.Detection.fromObject(object.detections[i]); - } + /** + * Encodes the specified Binding message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Kubernetes.Binding.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.Kubernetes.Binding + * @static + * @param {google.cloud.securitycenter.v1.Kubernetes.IBinding} message Binding message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Binding.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Binding message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.Kubernetes.Binding + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.Kubernetes.Binding} Binding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Binding.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.cloud.securitycenter.v1.Kubernetes.Binding(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.ns = reader.string(); + break; + case 2: + message.name = reader.string(); + break; + case 3: + message.role = $root.google.cloud.securitycenter.v1.Kubernetes.Role.decode(reader, reader.uint32()); + break; + case 4: + if (!(message.subjects && message.subjects.length)) + message.subjects = []; + message.subjects.push($root.google.cloud.securitycenter.v1.Kubernetes.Subject.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; } - return message; - }; + } + return message; + }; - /** - * Creates a plain object from a MemoryHashSignature message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature - * @static - * @param {google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature} message MemoryHashSignature - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MemoryHashSignature.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.detections = []; - if (options.defaults) - object.binaryFamily = ""; - if (message.binaryFamily != null && message.hasOwnProperty("binaryFamily")) - object.binaryFamily = message.binaryFamily; - if (message.detections && message.detections.length) { - object.detections = []; - for (var j = 0; j < message.detections.length; ++j) - object.detections[j] = $root.google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.Detection.toObject(message.detections[j], options); + /** + * Decodes a Binding message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.Kubernetes.Binding + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.Kubernetes.Binding} Binding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Binding.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Binding message. + * @function verify + * @memberof google.cloud.securitycenter.v1.Kubernetes.Binding + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Binding.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.ns != null && message.hasOwnProperty("ns")) + if (!$util.isString(message.ns)) + return "ns: string expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.role != null && message.hasOwnProperty("role")) { + var error = $root.google.cloud.securitycenter.v1.Kubernetes.Role.verify(message.role); + if (error) + return "role." + error; + } + if (message.subjects != null && message.hasOwnProperty("subjects")) { + if (!Array.isArray(message.subjects)) + return "subjects: array expected"; + for (var i = 0; i < message.subjects.length; ++i) { + var error = $root.google.cloud.securitycenter.v1.Kubernetes.Subject.verify(message.subjects[i]); + if (error) + return "subjects." + error; } + } + return null; + }; + + /** + * Creates a Binding message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.Kubernetes.Binding + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.Kubernetes.Binding} Binding + */ + Binding.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.Kubernetes.Binding) return object; - }; + var message = new $root.google.cloud.securitycenter.v1.Kubernetes.Binding(); + if (object.ns != null) + message.ns = String(object.ns); + if (object.name != null) + message.name = String(object.name); + if (object.role != null) { + if (typeof object.role !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Kubernetes.Binding.role: object expected"); + message.role = $root.google.cloud.securitycenter.v1.Kubernetes.Role.fromObject(object.role); + } + if (object.subjects) { + if (!Array.isArray(object.subjects)) + throw TypeError(".google.cloud.securitycenter.v1.Kubernetes.Binding.subjects: array expected"); + message.subjects = []; + for (var i = 0; i < object.subjects.length; ++i) { + if (typeof object.subjects[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Kubernetes.Binding.subjects: object expected"); + message.subjects[i] = $root.google.cloud.securitycenter.v1.Kubernetes.Subject.fromObject(object.subjects[i]); + } + } + return message; + }; - /** - * Converts this MemoryHashSignature to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature - * @instance - * @returns {Object.} JSON object - */ - MemoryHashSignature.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Creates a plain object from a Binding message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.Kubernetes.Binding + * @static + * @param {google.cloud.securitycenter.v1.Kubernetes.Binding} message Binding + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Binding.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.subjects = []; + if (options.defaults) { + object.ns = ""; + object.name = ""; + object.role = null; + } + if (message.ns != null && message.hasOwnProperty("ns")) + object.ns = message.ns; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.role != null && message.hasOwnProperty("role")) + object.role = $root.google.cloud.securitycenter.v1.Kubernetes.Role.toObject(message.role, options); + if (message.subjects && message.subjects.length) { + object.subjects = []; + for (var j = 0; j < message.subjects.length; ++j) + object.subjects[j] = $root.google.cloud.securitycenter.v1.Kubernetes.Subject.toObject(message.subjects[j], options); + } + return object; + }; - MemoryHashSignature.Detection = (function() { + /** + * Converts this Binding to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.Kubernetes.Binding + * @instance + * @returns {Object.} JSON object + */ + Binding.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Properties of a Detection. - * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature - * @interface IDetection - * @property {string|null} [binary] Detection binary - * @property {number|null} [percentPagesMatched] Detection percentPagesMatched - */ + return Binding; + })(); - /** - * Constructs a new Detection. - * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature - * @classdesc Represents a Detection. - * @implements IDetection - * @constructor - * @param {google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.IDetection=} [properties] Properties to set - */ - function Detection(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]]; - } + Kubernetes.Subject = (function() { - /** - * Detection binary. - * @member {string} binary - * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.Detection - * @instance - */ - Detection.prototype.binary = ""; + /** + * Properties of a Subject. + * @memberof google.cloud.securitycenter.v1.Kubernetes + * @interface ISubject + * @property {google.cloud.securitycenter.v1.Kubernetes.Subject.AuthType|null} [kind] Subject kind + * @property {string|null} [ns] Subject ns + * @property {string|null} [name] Subject name + */ - /** - * Detection percentPagesMatched. - * @member {number} percentPagesMatched - * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.Detection - * @instance - */ - Detection.prototype.percentPagesMatched = 0; + /** + * Constructs a new Subject. + * @memberof google.cloud.securitycenter.v1.Kubernetes + * @classdesc Represents a Subject. + * @implements ISubject + * @constructor + * @param {google.cloud.securitycenter.v1.Kubernetes.ISubject=} [properties] Properties to set + */ + function Subject(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]]; + } - /** - * Creates a new Detection instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.Detection - * @static - * @param {google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.IDetection=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.Detection} Detection instance - */ - Detection.create = function create(properties) { - return new Detection(properties); - }; + /** + * Subject kind. + * @member {google.cloud.securitycenter.v1.Kubernetes.Subject.AuthType} kind + * @memberof google.cloud.securitycenter.v1.Kubernetes.Subject + * @instance + */ + Subject.prototype.kind = 0; + + /** + * Subject ns. + * @member {string} ns + * @memberof google.cloud.securitycenter.v1.Kubernetes.Subject + * @instance + */ + Subject.prototype.ns = ""; + + /** + * Subject name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1.Kubernetes.Subject + * @instance + */ + Subject.prototype.name = ""; + + /** + * Creates a new Subject instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.Kubernetes.Subject + * @static + * @param {google.cloud.securitycenter.v1.Kubernetes.ISubject=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.Kubernetes.Subject} Subject instance + */ + Subject.create = function create(properties) { + return new Subject(properties); + }; + + /** + * Encodes the specified Subject message. Does not implicitly {@link google.cloud.securitycenter.v1.Kubernetes.Subject.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.Kubernetes.Subject + * @static + * @param {google.cloud.securitycenter.v1.Kubernetes.ISubject} message Subject message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Subject.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.kind); + if (message.ns != null && Object.hasOwnProperty.call(message, "ns")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.ns); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.name); + return writer; + }; + + /** + * Encodes the specified Subject message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Kubernetes.Subject.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.Kubernetes.Subject + * @static + * @param {google.cloud.securitycenter.v1.Kubernetes.ISubject} message Subject message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Subject.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Subject message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.Kubernetes.Subject + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.Kubernetes.Subject} Subject + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Subject.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.cloud.securitycenter.v1.Kubernetes.Subject(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.kind = reader.int32(); + break; + case 2: + message.ns = reader.string(); + break; + case 3: + message.name = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Subject message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.Kubernetes.Subject + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.Kubernetes.Subject} Subject + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Subject.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Subject message. + * @function verify + * @memberof google.cloud.securitycenter.v1.Kubernetes.Subject + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Subject.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.kind != null && message.hasOwnProperty("kind")) + switch (message.kind) { + default: + return "kind: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.ns != null && message.hasOwnProperty("ns")) + if (!$util.isString(message.ns)) + return "ns: string expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; - /** - * Encodes the specified Detection message. Does not implicitly {@link google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.Detection.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.Detection - * @static - * @param {google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.IDetection} message Detection message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Detection.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.binary != null && Object.hasOwnProperty.call(message, "binary")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.binary); - if (message.percentPagesMatched != null && Object.hasOwnProperty.call(message, "percentPagesMatched")) - writer.uint32(/* id 3, wireType 1 =*/25).double(message.percentPagesMatched); - return writer; - }; + /** + * Creates a Subject message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.Kubernetes.Subject + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.Kubernetes.Subject} Subject + */ + Subject.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.Kubernetes.Subject) + return object; + var message = new $root.google.cloud.securitycenter.v1.Kubernetes.Subject(); + switch (object.kind) { + case "AUTH_TYPE_UNSPECIFIED": + case 0: + message.kind = 0; + break; + case "USER": + case 1: + message.kind = 1; + break; + case "SERVICEACCOUNT": + case 2: + message.kind = 2; + break; + case "GROUP": + case 3: + message.kind = 3; + break; + } + if (object.ns != null) + message.ns = String(object.ns); + if (object.name != null) + message.name = String(object.name); + return message; + }; - /** - * Encodes the specified Detection message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.Detection.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.Detection - * @static - * @param {google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.IDetection} message Detection message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Detection.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Creates a plain object from a Subject message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.Kubernetes.Subject + * @static + * @param {google.cloud.securitycenter.v1.Kubernetes.Subject} message Subject + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Subject.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.kind = options.enums === String ? "AUTH_TYPE_UNSPECIFIED" : 0; + object.ns = ""; + object.name = ""; + } + if (message.kind != null && message.hasOwnProperty("kind")) + object.kind = options.enums === String ? $root.google.cloud.securitycenter.v1.Kubernetes.Subject.AuthType[message.kind] : message.kind; + if (message.ns != null && message.hasOwnProperty("ns")) + object.ns = message.ns; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; - /** - * Decodes a Detection message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.Detection - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.Detection} Detection - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Detection.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.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.Detection(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 2: - message.binary = reader.string(); - break; - case 3: - message.percentPagesMatched = reader.double(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Converts this Subject to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.Kubernetes.Subject + * @instance + * @returns {Object.} JSON object + */ + Subject.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Decodes a Detection message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.Detection - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.Detection} Detection - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Detection.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * AuthType enum. + * @name google.cloud.securitycenter.v1.Kubernetes.Subject.AuthType + * @enum {number} + * @property {number} AUTH_TYPE_UNSPECIFIED=0 AUTH_TYPE_UNSPECIFIED value + * @property {number} USER=1 USER value + * @property {number} SERVICEACCOUNT=2 SERVICEACCOUNT value + * @property {number} GROUP=3 GROUP value + */ + Subject.AuthType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "AUTH_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "USER"] = 1; + values[valuesById[2] = "SERVICEACCOUNT"] = 2; + values[valuesById[3] = "GROUP"] = 3; + return values; + })(); - /** - * Verifies a Detection message. - * @function verify - * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.Detection - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Detection.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.binary != null && message.hasOwnProperty("binary")) - if (!$util.isString(message.binary)) - return "binary: string expected"; - if (message.percentPagesMatched != null && message.hasOwnProperty("percentPagesMatched")) - if (typeof message.percentPagesMatched !== "number") - return "percentPagesMatched: number expected"; - return null; - }; + return Subject; + })(); - /** - * Creates a Detection message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.Detection - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.Detection} Detection - */ - Detection.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.Detection) - return object; - var message = new $root.google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.Detection(); - if (object.binary != null) - message.binary = String(object.binary); - if (object.percentPagesMatched != null) - message.percentPagesMatched = Number(object.percentPagesMatched); - return message; - }; + Kubernetes.AccessReview = (function() { - /** - * Creates a plain object from a Detection message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.Detection - * @static - * @param {google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.Detection} message Detection - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Detection.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.binary = ""; - object.percentPagesMatched = 0; - } - if (message.binary != null && message.hasOwnProperty("binary")) - object.binary = message.binary; - if (message.percentPagesMatched != null && message.hasOwnProperty("percentPagesMatched")) - object.percentPagesMatched = options.json && !isFinite(message.percentPagesMatched) ? String(message.percentPagesMatched) : message.percentPagesMatched; - return object; - }; + /** + * Properties of an AccessReview. + * @memberof google.cloud.securitycenter.v1.Kubernetes + * @interface IAccessReview + * @property {string|null} [group] AccessReview group + * @property {string|null} [ns] AccessReview ns + * @property {string|null} [name] AccessReview name + * @property {string|null} [resource] AccessReview resource + * @property {string|null} [subresource] AccessReview subresource + * @property {string|null} [verb] AccessReview verb + * @property {string|null} [version] AccessReview version + */ - /** - * Converts this Detection to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.Detection - * @instance - * @returns {Object.} JSON object - */ - Detection.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Constructs a new AccessReview. + * @memberof google.cloud.securitycenter.v1.Kubernetes + * @classdesc Represents an AccessReview. + * @implements IAccessReview + * @constructor + * @param {google.cloud.securitycenter.v1.Kubernetes.IAccessReview=} [properties] Properties to set + */ + function AccessReview(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]]; + } - return Detection; - })(); + /** + * AccessReview group. + * @member {string} group + * @memberof google.cloud.securitycenter.v1.Kubernetes.AccessReview + * @instance + */ + AccessReview.prototype.group = ""; - return MemoryHashSignature; - })(); + /** + * AccessReview ns. + * @member {string} ns + * @memberof google.cloud.securitycenter.v1.Kubernetes.AccessReview + * @instance + */ + AccessReview.prototype.ns = ""; - ProcessSignature.YaraRuleSignature = (function() { + /** + * AccessReview name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1.Kubernetes.AccessReview + * @instance + */ + AccessReview.prototype.name = ""; - /** - * Properties of a YaraRuleSignature. - * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature - * @interface IYaraRuleSignature - * @property {string|null} [yaraRule] YaraRuleSignature yaraRule - */ + /** + * AccessReview resource. + * @member {string} resource + * @memberof google.cloud.securitycenter.v1.Kubernetes.AccessReview + * @instance + */ + AccessReview.prototype.resource = ""; - /** - * Constructs a new YaraRuleSignature. - * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature - * @classdesc Represents a YaraRuleSignature. - * @implements IYaraRuleSignature - * @constructor - * @param {google.cloud.securitycenter.v1.Indicator.ProcessSignature.IYaraRuleSignature=} [properties] Properties to set - */ - function YaraRuleSignature(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]]; - } + /** + * AccessReview subresource. + * @member {string} subresource + * @memberof google.cloud.securitycenter.v1.Kubernetes.AccessReview + * @instance + */ + AccessReview.prototype.subresource = ""; - /** - * YaraRuleSignature yaraRule. - * @member {string} yaraRule - * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature.YaraRuleSignature - * @instance - */ - YaraRuleSignature.prototype.yaraRule = ""; + /** + * AccessReview verb. + * @member {string} verb + * @memberof google.cloud.securitycenter.v1.Kubernetes.AccessReview + * @instance + */ + AccessReview.prototype.verb = ""; + + /** + * AccessReview version. + * @member {string} version + * @memberof google.cloud.securitycenter.v1.Kubernetes.AccessReview + * @instance + */ + AccessReview.prototype.version = ""; - /** - * Creates a new YaraRuleSignature instance using the specified properties. - * @function create - * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature.YaraRuleSignature - * @static - * @param {google.cloud.securitycenter.v1.Indicator.ProcessSignature.IYaraRuleSignature=} [properties] Properties to set - * @returns {google.cloud.securitycenter.v1.Indicator.ProcessSignature.YaraRuleSignature} YaraRuleSignature instance - */ - YaraRuleSignature.create = function create(properties) { - return new YaraRuleSignature(properties); - }; + /** + * Creates a new AccessReview instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.Kubernetes.AccessReview + * @static + * @param {google.cloud.securitycenter.v1.Kubernetes.IAccessReview=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.Kubernetes.AccessReview} AccessReview instance + */ + AccessReview.create = function create(properties) { + return new AccessReview(properties); + }; - /** - * Encodes the specified YaraRuleSignature message. Does not implicitly {@link google.cloud.securitycenter.v1.Indicator.ProcessSignature.YaraRuleSignature.verify|verify} messages. - * @function encode - * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature.YaraRuleSignature - * @static - * @param {google.cloud.securitycenter.v1.Indicator.ProcessSignature.IYaraRuleSignature} message YaraRuleSignature message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - YaraRuleSignature.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.yaraRule != null && Object.hasOwnProperty.call(message, "yaraRule")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.yaraRule); - return writer; - }; + /** + * Encodes the specified AccessReview message. Does not implicitly {@link google.cloud.securitycenter.v1.Kubernetes.AccessReview.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.Kubernetes.AccessReview + * @static + * @param {google.cloud.securitycenter.v1.Kubernetes.IAccessReview} message AccessReview message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccessReview.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.group != null && Object.hasOwnProperty.call(message, "group")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.group); + if (message.ns != null && Object.hasOwnProperty.call(message, "ns")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.ns); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.name); + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.resource); + if (message.subresource != null && Object.hasOwnProperty.call(message, "subresource")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.subresource); + if (message.verb != null && Object.hasOwnProperty.call(message, "verb")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.verb); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.version); + return writer; + }; - /** - * Encodes the specified YaraRuleSignature message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Indicator.ProcessSignature.YaraRuleSignature.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature.YaraRuleSignature - * @static - * @param {google.cloud.securitycenter.v1.Indicator.ProcessSignature.IYaraRuleSignature} message YaraRuleSignature message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - YaraRuleSignature.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Encodes the specified AccessReview message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Kubernetes.AccessReview.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.Kubernetes.AccessReview + * @static + * @param {google.cloud.securitycenter.v1.Kubernetes.IAccessReview} message AccessReview message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccessReview.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Decodes a YaraRuleSignature message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature.YaraRuleSignature - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.securitycenter.v1.Indicator.ProcessSignature.YaraRuleSignature} YaraRuleSignature - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - YaraRuleSignature.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.cloud.securitycenter.v1.Indicator.ProcessSignature.YaraRuleSignature(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 5: - message.yaraRule = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } + /** + * Decodes an AccessReview message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.Kubernetes.AccessReview + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.Kubernetes.AccessReview} AccessReview + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccessReview.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.cloud.securitycenter.v1.Kubernetes.AccessReview(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.group = reader.string(); + break; + case 2: + message.ns = reader.string(); + break; + case 3: + message.name = reader.string(); + break; + case 4: + message.resource = reader.string(); + break; + case 5: + message.subresource = reader.string(); + break; + case 6: + message.verb = reader.string(); + break; + case 7: + message.version = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; } - return message; - }; - - /** - * Decodes a YaraRuleSignature message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature.YaraRuleSignature - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.securitycenter.v1.Indicator.ProcessSignature.YaraRuleSignature} YaraRuleSignature - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - YaraRuleSignature.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + } + return message; + }; - /** - * Verifies a YaraRuleSignature message. - * @function verify - * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature.YaraRuleSignature - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - YaraRuleSignature.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.yaraRule != null && message.hasOwnProperty("yaraRule")) - if (!$util.isString(message.yaraRule)) - return "yaraRule: string expected"; - return null; - }; + /** + * Decodes an AccessReview message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.Kubernetes.AccessReview + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.Kubernetes.AccessReview} AccessReview + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccessReview.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Creates a YaraRuleSignature message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature.YaraRuleSignature - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.securitycenter.v1.Indicator.ProcessSignature.YaraRuleSignature} YaraRuleSignature - */ - YaraRuleSignature.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.securitycenter.v1.Indicator.ProcessSignature.YaraRuleSignature) - return object; - var message = new $root.google.cloud.securitycenter.v1.Indicator.ProcessSignature.YaraRuleSignature(); - if (object.yaraRule != null) - message.yaraRule = String(object.yaraRule); - return message; - }; + /** + * Verifies an AccessReview message. + * @function verify + * @memberof google.cloud.securitycenter.v1.Kubernetes.AccessReview + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AccessReview.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.group != null && message.hasOwnProperty("group")) + if (!$util.isString(message.group)) + return "group: string expected"; + if (message.ns != null && message.hasOwnProperty("ns")) + if (!$util.isString(message.ns)) + return "ns: string expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.resource != null && message.hasOwnProperty("resource")) + if (!$util.isString(message.resource)) + return "resource: string expected"; + if (message.subresource != null && message.hasOwnProperty("subresource")) + if (!$util.isString(message.subresource)) + return "subresource: string expected"; + if (message.verb != null && message.hasOwnProperty("verb")) + if (!$util.isString(message.verb)) + return "verb: string expected"; + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isString(message.version)) + return "version: string expected"; + return null; + }; - /** - * Creates a plain object from a YaraRuleSignature message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature.YaraRuleSignature - * @static - * @param {google.cloud.securitycenter.v1.Indicator.ProcessSignature.YaraRuleSignature} message YaraRuleSignature - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - YaraRuleSignature.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.yaraRule = ""; - if (message.yaraRule != null && message.hasOwnProperty("yaraRule")) - object.yaraRule = message.yaraRule; + /** + * Creates an AccessReview message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.Kubernetes.AccessReview + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.Kubernetes.AccessReview} AccessReview + */ + AccessReview.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.Kubernetes.AccessReview) return object; - }; + var message = new $root.google.cloud.securitycenter.v1.Kubernetes.AccessReview(); + if (object.group != null) + message.group = String(object.group); + if (object.ns != null) + message.ns = String(object.ns); + if (object.name != null) + message.name = String(object.name); + if (object.resource != null) + message.resource = String(object.resource); + if (object.subresource != null) + message.subresource = String(object.subresource); + if (object.verb != null) + message.verb = String(object.verb); + if (object.version != null) + message.version = String(object.version); + return message; + }; - /** - * Converts this YaraRuleSignature to JSON. - * @function toJSON - * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature.YaraRuleSignature - * @instance - * @returns {Object.} JSON object - */ - YaraRuleSignature.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Creates a plain object from an AccessReview message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.Kubernetes.AccessReview + * @static + * @param {google.cloud.securitycenter.v1.Kubernetes.AccessReview} message AccessReview + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AccessReview.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.group = ""; + object.ns = ""; + object.name = ""; + object.resource = ""; + object.subresource = ""; + object.verb = ""; + object.version = ""; + } + if (message.group != null && message.hasOwnProperty("group")) + object.group = message.group; + if (message.ns != null && message.hasOwnProperty("ns")) + object.ns = message.ns; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.resource != null && message.hasOwnProperty("resource")) + object.resource = message.resource; + if (message.subresource != null && message.hasOwnProperty("subresource")) + object.subresource = message.subresource; + if (message.verb != null && message.hasOwnProperty("verb")) + object.verb = message.verb; + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + return object; + }; - return YaraRuleSignature; - })(); + /** + * Converts this AccessReview to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.Kubernetes.AccessReview + * @instance + * @returns {Object.} JSON object + */ + AccessReview.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - return ProcessSignature; + return AccessReview; })(); - return Indicator; + return Kubernetes; })(); v1.MitreAttack = (function() { @@ -7408,6 +10244,7 @@ case 29: case 30: case 31: + case 32: break; } } @@ -7475,6 +10312,7 @@ case 29: case 30: case 31: + case 32: break; } } @@ -7693,6 +10531,10 @@ case 31: message.primaryTechniques[i] = 31; break; + case "NETWORK_SERVICE_DISCOVERY": + case 32: + message.primaryTechniques[i] = 32; + break; } } if (object.additionalTactics) { @@ -7899,6 +10741,10 @@ case 31: message.additionalTechniques[i] = 31; break; + case "NETWORK_SERVICE_DISCOVERY": + case 32: + message.additionalTechniques[i] = 32; + break; } } if (object.version != null) @@ -8037,6 +10883,7 @@ * @property {number} DATA_DESTRUCTION=29 DATA_DESTRUCTION value * @property {number} DOMAIN_POLICY_MODIFICATION=30 DOMAIN_POLICY_MODIFICATION value * @property {number} IMPAIR_DEFENSES=31 IMPAIR_DEFENSES value + * @property {number} NETWORK_SERVICE_DISCOVERY=32 NETWORK_SERVICE_DISCOVERY value */ MitreAttack.Technique = (function() { var valuesById = {}, values = Object.create(valuesById); @@ -8072,6 +10919,7 @@ values[valuesById[29] = "DATA_DESTRUCTION"] = 29; values[valuesById[30] = "DOMAIN_POLICY_MODIFICATION"] = 30; values[valuesById[31] = "IMPAIR_DEFENSES"] = 31; + values[valuesById[32] = "NETWORK_SERVICE_DISCOVERY"] = 32; return values; })(); diff --git a/packages/google-cloud-securitycenter/protos/protos.json b/packages/google-cloud-securitycenter/protos/protos.json index 0f78b943792..7d91a1f6685 100644 --- a/packages/google-cloud-securitycenter/protos/protos.json +++ b/packages/google-cloud-securitycenter/protos/protos.json @@ -303,6 +303,39 @@ } } }, + "Container": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "uri": { + "type": "string", + "id": 2 + }, + "imageId": { + "type": "string", + "id": 3 + }, + "labels": { + "rule": "repeated", + "type": "Label", + "id": 4 + } + } + }, + "Label": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "value": { + "type": "string", + "id": 2 + } + } + }, "Exfiltration": { "fields": { "sources": { @@ -527,6 +560,15 @@ "nextSteps": { "type": "string", "id": 40 + }, + "containers": { + "rule": "repeated", + "type": "Container", + "id": 42 + }, + "kubernetes": { + "type": "Kubernetes", + "id": 43 } }, "nested": { @@ -669,6 +711,189 @@ } } }, + "Kubernetes": { + "fields": { + "pods": { + "rule": "repeated", + "type": "Pod", + "id": 1 + }, + "nodes": { + "rule": "repeated", + "type": "Node", + "id": 2 + }, + "nodePools": { + "rule": "repeated", + "type": "NodePool", + "id": 3 + }, + "roles": { + "rule": "repeated", + "type": "Role", + "id": 4 + }, + "bindings": { + "rule": "repeated", + "type": "Binding", + "id": 5 + }, + "accessReviews": { + "rule": "repeated", + "type": "AccessReview", + "id": 6 + } + }, + "nested": { + "Pod": { + "fields": { + "ns": { + "type": "string", + "id": 1 + }, + "name": { + "type": "string", + "id": 2 + }, + "labels": { + "rule": "repeated", + "type": "Label", + "id": 3 + }, + "containers": { + "rule": "repeated", + "type": "Container", + "id": 4 + } + } + }, + "Node": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "NodePool": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "nodes": { + "rule": "repeated", + "type": "Node", + "id": 2 + } + } + }, + "Role": { + "fields": { + "kind": { + "type": "Kind", + "id": 1 + }, + "ns": { + "type": "string", + "id": 2 + }, + "name": { + "type": "string", + "id": 3 + } + }, + "nested": { + "Kind": { + "values": { + "KIND_UNSPECIFIED": 0, + "ROLE": 1, + "CLUSTER_ROLE": 2 + } + } + } + }, + "Binding": { + "fields": { + "ns": { + "type": "string", + "id": 1 + }, + "name": { + "type": "string", + "id": 2 + }, + "role": { + "type": "Role", + "id": 3 + }, + "subjects": { + "rule": "repeated", + "type": "Subject", + "id": 4 + } + } + }, + "Subject": { + "fields": { + "kind": { + "type": "AuthType", + "id": 1 + }, + "ns": { + "type": "string", + "id": 2 + }, + "name": { + "type": "string", + "id": 3 + } + }, + "nested": { + "AuthType": { + "values": { + "AUTH_TYPE_UNSPECIFIED": 0, + "USER": 1, + "SERVICEACCOUNT": 2, + "GROUP": 3 + } + } + } + }, + "AccessReview": { + "fields": { + "group": { + "type": "string", + "id": 1 + }, + "ns": { + "type": "string", + "id": 2 + }, + "name": { + "type": "string", + "id": 3 + }, + "resource": { + "type": "string", + "id": 4 + }, + "subresource": { + "type": "string", + "id": 5 + }, + "verb": { + "type": "string", + "id": 6 + }, + "version": { + "type": "string", + "id": 7 + } + } + } + } + }, "MitreAttack": { "fields": { "primaryTactic": { @@ -748,7 +973,8 @@ "MODIFY_AUTHENTICATION_PROCESS": 28, "DATA_DESTRUCTION": 29, "DOMAIN_POLICY_MODIFICATION": 30, - "IMPAIR_DEFENSES": 31 + "IMPAIR_DEFENSES": 31, + "NETWORK_SERVICE_DISCOVERY": 32 } } } diff --git a/packages/google-cloud-securitycenter/src/v1/security_center_proto_list.json b/packages/google-cloud-securitycenter/src/v1/security_center_proto_list.json index 25a39f0f9e9..ab7c31b0731 100644 --- a/packages/google-cloud-securitycenter/src/v1/security_center_proto_list.json +++ b/packages/google-cloud-securitycenter/src/v1/security_center_proto_list.json @@ -5,6 +5,7 @@ "../../protos/google/cloud/securitycenter/v1/compliance.proto", "../../protos/google/cloud/securitycenter/v1/connection.proto", "../../protos/google/cloud/securitycenter/v1/contact_details.proto", + "../../protos/google/cloud/securitycenter/v1/container.proto", "../../protos/google/cloud/securitycenter/v1/exfiltration.proto", "../../protos/google/cloud/securitycenter/v1/external_system.proto", "../../protos/google/cloud/securitycenter/v1/file.proto", @@ -12,6 +13,8 @@ "../../protos/google/cloud/securitycenter/v1/folder.proto", "../../protos/google/cloud/securitycenter/v1/iam_binding.proto", "../../protos/google/cloud/securitycenter/v1/indicator.proto", + "../../protos/google/cloud/securitycenter/v1/kubernetes.proto", + "../../protos/google/cloud/securitycenter/v1/label.proto", "../../protos/google/cloud/securitycenter/v1/mitre_attack.proto", "../../protos/google/cloud/securitycenter/v1/mute_config.proto", "../../protos/google/cloud/securitycenter/v1/notification_config.proto", From 77f2549b57dbfb0cd11899bc5a8efd9eef6f9661 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 2 Aug 2022 13:41:11 -0700 Subject: [PATCH 326/342] chore(main): release 6.2.0 (#500) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(main): release 6.2.0 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> Co-authored-by: Owl Bot --- packages/google-cloud-securitycenter/CHANGELOG.md | 7 +++++++ packages/google-cloud-securitycenter/package.json | 2 +- .../snippet_metadata.google.cloud.securitycenter.v1.json | 2 +- ...ippet_metadata.google.cloud.securitycenter.v1beta1.json | 2 +- ...pet_metadata.google.cloud.securitycenter.v1p1beta1.json | 2 +- packages/google-cloud-securitycenter/samples/package.json | 2 +- 6 files changed, 12 insertions(+), 5 deletions(-) diff --git a/packages/google-cloud-securitycenter/CHANGELOG.md b/packages/google-cloud-securitycenter/CHANGELOG.md index b0f7ec03abe..dc9f8269190 100644 --- a/packages/google-cloud-securitycenter/CHANGELOG.md +++ b/packages/google-cloud-securitycenter/CHANGELOG.md @@ -4,6 +4,13 @@ [1]: https://www.npmjs.com/package/@google-cloud/security-center?activeTab=versions +## [6.2.0](https://github.com/googleapis/nodejs-security-center/compare/v6.1.0...v6.2.0) (2022-07-29) + + +### Features + +* Added container field to findings attributes ([#499](https://github.com/googleapis/nodejs-security-center/issues/499)) ([4129598](https://github.com/googleapis/nodejs-security-center/commit/4129598a9b7e9a8975b7daa0d369ffcae9d25ae0)) + ## [6.1.0](https://github.com/googleapis/nodejs-security-center/compare/v6.0.0...v6.1.0) (2022-07-04) diff --git a/packages/google-cloud-securitycenter/package.json b/packages/google-cloud-securitycenter/package.json index 875e3d902b0..46ba3ae3b92 100644 --- a/packages/google-cloud-securitycenter/package.json +++ b/packages/google-cloud-securitycenter/package.json @@ -1,7 +1,7 @@ { "name": "@google-cloud/security-center", "description": "Cloud Security Command Center API client for Node.js", - "version": "6.1.0", + "version": "6.2.0", "license": "Apache-2.0", "author": "Google LLC", "engines": { diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/snippet_metadata.google.cloud.securitycenter.v1.json b/packages/google-cloud-securitycenter/samples/generated/v1/snippet_metadata.google.cloud.securitycenter.v1.json index 9b64d8164f4..4bcaf2e9cb3 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/snippet_metadata.google.cloud.securitycenter.v1.json +++ b/packages/google-cloud-securitycenter/samples/generated/v1/snippet_metadata.google.cloud.securitycenter.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-securitycenter", - "version": "6.1.0", + "version": "6.2.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-securitycenter/samples/generated/v1beta1/snippet_metadata.google.cloud.securitycenter.v1beta1.json b/packages/google-cloud-securitycenter/samples/generated/v1beta1/snippet_metadata.google.cloud.securitycenter.v1beta1.json index ccd07ac6ac6..158dd61e7d7 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1beta1/snippet_metadata.google.cloud.securitycenter.v1beta1.json +++ b/packages/google-cloud-securitycenter/samples/generated/v1beta1/snippet_metadata.google.cloud.securitycenter.v1beta1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-securitycenter", - "version": "6.1.0", + "version": "6.2.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/snippet_metadata.google.cloud.securitycenter.v1p1beta1.json b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/snippet_metadata.google.cloud.securitycenter.v1p1beta1.json index 7ace58375b1..306581564de 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/snippet_metadata.google.cloud.securitycenter.v1p1beta1.json +++ b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/snippet_metadata.google.cloud.securitycenter.v1p1beta1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-securitycenter", - "version": "6.1.0", + "version": "6.2.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-securitycenter/samples/package.json b/packages/google-cloud-securitycenter/samples/package.json index bcaea7bba5e..db532988647 100644 --- a/packages/google-cloud-securitycenter/samples/package.json +++ b/packages/google-cloud-securitycenter/samples/package.json @@ -14,7 +14,7 @@ "license": "Apache-2.0", "dependencies": { "@google-cloud/pubsub": "^3.0.0", - "@google-cloud/security-center": "^6.1.0" + "@google-cloud/security-center": "^6.2.0" }, "devDependencies": { "chai": "^4.2.0", From 6909d681d657297e3b2ccfafdb3655b4b7539165 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Fri, 19 Aug 2022 20:20:34 +0000 Subject: [PATCH 327/342] chore: remove unused proto imports (#501) - [ ] Regenerate this pull request now. PiperOrigin-RevId: 468735472 Source-Link: https://github.com/googleapis/googleapis/commit/cfa1b3782da7ccae31673d45401a0b79d2d4a84b Source-Link: https://github.com/googleapis/googleapis-gen/commit/09b7666656510f5b00b893f003a0ba5766f9e250 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMDliNzY2NjY1NjUxMGY1YjAwYjg5M2YwMDNhMGJhNTc2NmY5ZTI1MCJ9 feat: Adding uris to indicator of compromise (IOC) field PiperOrigin-RevId: 468598080 Source-Link: https://github.com/googleapis/googleapis/commit/07c3f50155ccc78e915900646d89e83f2edfc433 Source-Link: https://github.com/googleapis/googleapis-gen/commit/dd0b32a189a9b15a794602ee5f7c7c48600f6e4a Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZGQwYjMyYTE4OWE5YjE1YTc5NDYwMmVlNWY3YzdjNDg2MDBmNmU0YSJ9 --- .../cloud/securitycenter/v1/indicator.proto | 3 + .../securitycenter/v1/mitre_attack.proto | 6 ++ .../cloud/securitycenter/v1beta1/asset.proto | 1 - .../securitycenter/v1beta1/finding.proto | 1 - .../v1beta1/organization_settings.proto | 1 - .../run_asset_discovery_response.proto | 1 - .../v1beta1/security_marks.proto | 1 - .../v1beta1/securitycenter_service.proto | 1 - .../cloud/securitycenter/v1beta1/source.proto | 1 - .../securitycenter/v1p1beta1/asset.proto | 1 - .../securitycenter/v1p1beta1/finding.proto | 1 - .../securitycenter/v1p1beta1/folder.proto | 1 - .../v1p1beta1/notification_config.proto | 1 - .../v1p1beta1/notification_message.proto | 1 - .../v1p1beta1/organization_settings.proto | 1 - .../securitycenter/v1p1beta1/resource.proto | 1 - .../run_asset_discovery_response.proto | 1 - .../v1p1beta1/security_marks.proto | 1 - .../securitycenter/v1p1beta1/source.proto | 1 - .../protos/protos.d.ts | 10 ++- .../protos/protos.js | 62 +++++++++++++++++++ .../protos/protos.json | 9 ++- 22 files changed, 88 insertions(+), 19 deletions(-) diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/indicator.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/indicator.proto index e14e57abc05..1cbfdfa2c9a 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/indicator.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/indicator.proto @@ -76,4 +76,7 @@ message Indicator { // The list of matched signatures indicating that the given // process is present in the environment. repeated ProcessSignature signatures = 3; + + // The list of URIs associated to the Findings. + repeated string uris = 4; } diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/mitre_attack.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/mitre_attack.proto index 65ec70aedb4..ba654822b09 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/mitre_attack.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/mitre_attack.proto @@ -177,6 +177,12 @@ message MitreAttack { // T1046 NETWORK_SERVICE_DISCOVERY = 32; + + // T1134 + ACCESS_TOKEN_MANIPULATION = 33; + + // T1548 + ABUSE_ELEVATION_CONTROL_MECHANISM = 34; } // The MITRE ATT&CK tactic most closely represented by this finding, if any. diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/asset.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/asset.proto index b73f7d5bc1f..415e7a2f094 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/asset.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/asset.proto @@ -21,7 +21,6 @@ import "google/api/resource.proto"; import "google/cloud/securitycenter/v1beta1/security_marks.proto"; import "google/protobuf/struct.proto"; import "google/protobuf/timestamp.proto"; -import "google/api/annotations.proto"; option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1beta1;securitycenter"; option java_multiple_files = true; diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/finding.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/finding.proto index 647b3b43219..768bf411c7e 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/finding.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/finding.proto @@ -16,7 +16,6 @@ syntax = "proto3"; package google.cloud.securitycenter.v1beta1; -import "google/api/annotations.proto"; import "google/api/field_behavior.proto"; import "google/api/resource.proto"; import "google/cloud/securitycenter/v1beta1/security_marks.proto"; diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/organization_settings.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/organization_settings.proto index 88b2008a190..b447bf6e39d 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/organization_settings.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/organization_settings.proto @@ -17,7 +17,6 @@ syntax = "proto3"; package google.cloud.securitycenter.v1beta1; import "google/api/resource.proto"; -import "google/api/annotations.proto"; option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1beta1;securitycenter"; option java_multiple_files = true; diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/run_asset_discovery_response.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/run_asset_discovery_response.proto index 20d3b25b10f..cab92d902c3 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/run_asset_discovery_response.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/run_asset_discovery_response.proto @@ -17,7 +17,6 @@ syntax = "proto3"; package google.cloud.securitycenter.v1beta1; import "google/protobuf/duration.proto"; -import "google/api/annotations.proto"; option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1beta1;securitycenter"; option java_multiple_files = true; diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/security_marks.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/security_marks.proto index 2547c3063cc..f1dc88d7cd4 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/security_marks.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/security_marks.proto @@ -17,7 +17,6 @@ syntax = "proto3"; package google.cloud.securitycenter.v1beta1; import "google/api/resource.proto"; -import "google/api/annotations.proto"; option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1beta1;securitycenter"; option java_multiple_files = true; diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/securitycenter_service.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/securitycenter_service.proto index 351c1f4a366..55276ef7f1c 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/securitycenter_service.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/securitycenter_service.proto @@ -29,7 +29,6 @@ import "google/iam/v1/iam_policy.proto"; import "google/iam/v1/policy.proto"; import "google/longrunning/operations.proto"; import "google/protobuf/duration.proto"; -import "google/protobuf/empty.proto"; import "google/protobuf/field_mask.proto"; import "google/protobuf/struct.proto"; import "google/protobuf/timestamp.proto"; diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/source.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/source.proto index fb1e6c6a404..a4a49749ed3 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/source.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/source.proto @@ -17,7 +17,6 @@ syntax = "proto3"; package google.cloud.securitycenter.v1beta1; import "google/api/resource.proto"; -import "google/api/annotations.proto"; option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1beta1;securitycenter"; option java_multiple_files = true; diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/asset.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/asset.proto index 9ee30783f7f..45fdcbf5a5a 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/asset.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/asset.proto @@ -21,7 +21,6 @@ import "google/cloud/securitycenter/v1p1beta1/folder.proto"; import "google/cloud/securitycenter/v1p1beta1/security_marks.proto"; import "google/protobuf/struct.proto"; import "google/protobuf/timestamp.proto"; -import "google/api/annotations.proto"; option csharp_namespace = "Google.Cloud.SecurityCenter.V1P1Beta1"; option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1p1beta1;securitycenter"; diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/finding.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/finding.proto index 572a368f8e0..5edd3d86296 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/finding.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/finding.proto @@ -21,7 +21,6 @@ import "google/api/resource.proto"; import "google/cloud/securitycenter/v1p1beta1/security_marks.proto"; import "google/protobuf/struct.proto"; import "google/protobuf/timestamp.proto"; -import "google/api/annotations.proto"; option csharp_namespace = "Google.Cloud.SecurityCenter.V1P1Beta1"; option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1p1beta1;securitycenter"; diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/folder.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/folder.proto index ec6df5edda3..28a587163c1 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/folder.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/folder.proto @@ -16,7 +16,6 @@ syntax = "proto3"; package google.cloud.securitycenter.v1p1beta1; -import "google/api/annotations.proto"; option csharp_namespace = "Google.Cloud.SecurityCenter.V1P1Beta1"; option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1p1beta1;securitycenter"; diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/notification_config.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/notification_config.proto index be5f6e0f532..faaab37b102 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/notification_config.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/notification_config.proto @@ -18,7 +18,6 @@ package google.cloud.securitycenter.v1p1beta1; import "google/api/field_behavior.proto"; import "google/api/resource.proto"; -import "google/api/annotations.proto"; option csharp_namespace = "Google.Cloud.SecurityCenter.V1P1Beta1"; option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1p1beta1;securitycenter"; diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/notification_message.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/notification_message.proto index 5e671dd01d0..78a3e781f12 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/notification_message.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/notification_message.proto @@ -18,7 +18,6 @@ package google.cloud.securitycenter.v1p1beta1; import "google/cloud/securitycenter/v1p1beta1/finding.proto"; import "google/cloud/securitycenter/v1p1beta1/resource.proto"; -import "google/api/annotations.proto"; option csharp_namespace = "Google.Cloud.SecurityCenter.V1P1Beta1"; option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1p1beta1;securitycenter"; diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/organization_settings.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/organization_settings.proto index ad36d58a17b..b80f046d6b8 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/organization_settings.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/organization_settings.proto @@ -17,7 +17,6 @@ syntax = "proto3"; package google.cloud.securitycenter.v1p1beta1; import "google/api/resource.proto"; -import "google/api/annotations.proto"; option csharp_namespace = "Google.Cloud.SecurityCenter.V1P1Beta1"; option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1p1beta1;securitycenter"; diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/resource.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/resource.proto index 0fe2d362a6e..3b2d2d437e8 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/resource.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/resource.proto @@ -18,7 +18,6 @@ package google.cloud.securitycenter.v1p1beta1; import "google/api/field_behavior.proto"; import "google/cloud/securitycenter/v1p1beta1/folder.proto"; -import "google/api/annotations.proto"; option csharp_namespace = "Google.Cloud.SecurityCenter.V1P1Beta1"; option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1p1beta1;securitycenter"; diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/run_asset_discovery_response.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/run_asset_discovery_response.proto index d867d201fae..835e33fbdf1 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/run_asset_discovery_response.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/run_asset_discovery_response.proto @@ -17,7 +17,6 @@ syntax = "proto3"; package google.cloud.securitycenter.v1p1beta1; import "google/protobuf/duration.proto"; -import "google/api/annotations.proto"; option csharp_namespace = "Google.Cloud.SecurityCenter.V1P1Beta1"; option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1p1beta1;securitycenter"; diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/security_marks.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/security_marks.proto index 22db26cbad3..2245605b3e4 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/security_marks.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/security_marks.proto @@ -17,7 +17,6 @@ syntax = "proto3"; package google.cloud.securitycenter.v1p1beta1; import "google/api/resource.proto"; -import "google/api/annotations.proto"; option csharp_namespace = "Google.Cloud.SecurityCenter.V1P1Beta1"; option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1p1beta1;securitycenter"; diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/source.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/source.proto index 5f36167ad16..e2a55659556 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/source.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/source.proto @@ -17,7 +17,6 @@ syntax = "proto3"; package google.cloud.securitycenter.v1p1beta1; import "google/api/resource.proto"; -import "google/api/annotations.proto"; option csharp_namespace = "Google.Cloud.SecurityCenter.V1P1Beta1"; option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1p1beta1;securitycenter"; diff --git a/packages/google-cloud-securitycenter/protos/protos.d.ts b/packages/google-cloud-securitycenter/protos/protos.d.ts index 9be638911b6..86a6ce6ec78 100644 --- a/packages/google-cloud-securitycenter/protos/protos.d.ts +++ b/packages/google-cloud-securitycenter/protos/protos.d.ts @@ -2398,6 +2398,9 @@ export namespace google { /** Indicator signatures */ signatures?: (google.cloud.securitycenter.v1.Indicator.IProcessSignature[]|null); + + /** Indicator uris */ + uris?: (string[]|null); } /** Represents an Indicator. */ @@ -2418,6 +2421,9 @@ export namespace google { /** Indicator signatures. */ public signatures: google.cloud.securitycenter.v1.Indicator.IProcessSignature[]; + /** Indicator uris. */ + public uris: string[]; + /** * Creates a new Indicator instance using the specified properties. * @param [properties] Properties to set @@ -3924,7 +3930,9 @@ export namespace google { DATA_DESTRUCTION = 29, DOMAIN_POLICY_MODIFICATION = 30, IMPAIR_DEFENSES = 31, - NETWORK_SERVICE_DISCOVERY = 32 + NETWORK_SERVICE_DISCOVERY = 32, + ACCESS_TOKEN_MANIPULATION = 33, + ABUSE_ELEVATION_CONTROL_MECHANISM = 34 } } diff --git a/packages/google-cloud-securitycenter/protos/protos.js b/packages/google-cloud-securitycenter/protos/protos.js index 09c32d1e282..3d8284443c5 100644 --- a/packages/google-cloud-securitycenter/protos/protos.js +++ b/packages/google-cloud-securitycenter/protos/protos.js @@ -6533,6 +6533,7 @@ * @property {Array.|null} [ipAddresses] Indicator ipAddresses * @property {Array.|null} [domains] Indicator domains * @property {Array.|null} [signatures] Indicator signatures + * @property {Array.|null} [uris] Indicator uris */ /** @@ -6547,6 +6548,7 @@ this.ipAddresses = []; this.domains = []; this.signatures = []; + this.uris = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -6577,6 +6579,14 @@ */ Indicator.prototype.signatures = $util.emptyArray; + /** + * Indicator uris. + * @member {Array.} uris + * @memberof google.cloud.securitycenter.v1.Indicator + * @instance + */ + Indicator.prototype.uris = $util.emptyArray; + /** * Creates a new Indicator instance using the specified properties. * @function create @@ -6610,6 +6620,9 @@ if (message.signatures != null && message.signatures.length) for (var i = 0; i < message.signatures.length; ++i) $root.google.cloud.securitycenter.v1.Indicator.ProcessSignature.encode(message.signatures[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.uris != null && message.uris.length) + for (var i = 0; i < message.uris.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.uris[i]); return writer; }; @@ -6659,6 +6672,11 @@ message.signatures = []; message.signatures.push($root.google.cloud.securitycenter.v1.Indicator.ProcessSignature.decode(reader, reader.uint32())); break; + case 4: + if (!(message.uris && message.uris.length)) + message.uris = []; + message.uris.push(reader.string()); + break; default: reader.skipType(tag & 7); break; @@ -6717,6 +6735,13 @@ return "signatures." + error; } } + if (message.uris != null && message.hasOwnProperty("uris")) { + if (!Array.isArray(message.uris)) + return "uris: array expected"; + for (var i = 0; i < message.uris.length; ++i) + if (!$util.isString(message.uris[i])) + return "uris: string[] expected"; + } return null; }; @@ -6756,6 +6781,13 @@ message.signatures[i] = $root.google.cloud.securitycenter.v1.Indicator.ProcessSignature.fromObject(object.signatures[i]); } } + if (object.uris) { + if (!Array.isArray(object.uris)) + throw TypeError(".google.cloud.securitycenter.v1.Indicator.uris: array expected"); + message.uris = []; + for (var i = 0; i < object.uris.length; ++i) + message.uris[i] = String(object.uris[i]); + } return message; }; @@ -6776,6 +6808,7 @@ object.ipAddresses = []; object.domains = []; object.signatures = []; + object.uris = []; } if (message.ipAddresses && message.ipAddresses.length) { object.ipAddresses = []; @@ -6792,6 +6825,11 @@ for (var j = 0; j < message.signatures.length; ++j) object.signatures[j] = $root.google.cloud.securitycenter.v1.Indicator.ProcessSignature.toObject(message.signatures[j], options); } + if (message.uris && message.uris.length) { + object.uris = []; + for (var j = 0; j < message.uris.length; ++j) + object.uris[j] = message.uris[j]; + } return object; }; @@ -10245,6 +10283,8 @@ case 30: case 31: case 32: + case 33: + case 34: break; } } @@ -10313,6 +10353,8 @@ case 30: case 31: case 32: + case 33: + case 34: break; } } @@ -10535,6 +10577,14 @@ case 32: message.primaryTechniques[i] = 32; break; + case "ACCESS_TOKEN_MANIPULATION": + case 33: + message.primaryTechniques[i] = 33; + break; + case "ABUSE_ELEVATION_CONTROL_MECHANISM": + case 34: + message.primaryTechniques[i] = 34; + break; } } if (object.additionalTactics) { @@ -10745,6 +10795,14 @@ case 32: message.additionalTechniques[i] = 32; break; + case "ACCESS_TOKEN_MANIPULATION": + case 33: + message.additionalTechniques[i] = 33; + break; + case "ABUSE_ELEVATION_CONTROL_MECHANISM": + case 34: + message.additionalTechniques[i] = 34; + break; } } if (object.version != null) @@ -10884,6 +10942,8 @@ * @property {number} DOMAIN_POLICY_MODIFICATION=30 DOMAIN_POLICY_MODIFICATION value * @property {number} IMPAIR_DEFENSES=31 IMPAIR_DEFENSES value * @property {number} NETWORK_SERVICE_DISCOVERY=32 NETWORK_SERVICE_DISCOVERY value + * @property {number} ACCESS_TOKEN_MANIPULATION=33 ACCESS_TOKEN_MANIPULATION value + * @property {number} ABUSE_ELEVATION_CONTROL_MECHANISM=34 ABUSE_ELEVATION_CONTROL_MECHANISM value */ MitreAttack.Technique = (function() { var valuesById = {}, values = Object.create(valuesById); @@ -10920,6 +10980,8 @@ values[valuesById[30] = "DOMAIN_POLICY_MODIFICATION"] = 30; values[valuesById[31] = "IMPAIR_DEFENSES"] = 31; values[valuesById[32] = "NETWORK_SERVICE_DISCOVERY"] = 32; + values[valuesById[33] = "ACCESS_TOKEN_MANIPULATION"] = 33; + values[valuesById[34] = "ABUSE_ELEVATION_CONTROL_MECHANISM"] = 34; return values; })(); diff --git a/packages/google-cloud-securitycenter/protos/protos.json b/packages/google-cloud-securitycenter/protos/protos.json index 7d91a1f6685..d59a89de0ea 100644 --- a/packages/google-cloud-securitycenter/protos/protos.json +++ b/packages/google-cloud-securitycenter/protos/protos.json @@ -649,6 +649,11 @@ "rule": "repeated", "type": "ProcessSignature", "id": 3 + }, + "uris": { + "rule": "repeated", + "type": "string", + "id": 4 } }, "nested": { @@ -974,7 +979,9 @@ "DATA_DESTRUCTION": 29, "DOMAIN_POLICY_MODIFICATION": 30, "IMPAIR_DEFENSES": 31, - "NETWORK_SERVICE_DISCOVERY": 32 + "NETWORK_SERVICE_DISCOVERY": 32, + "ACCESS_TOKEN_MANIPULATION": 33, + "ABUSE_ELEVATION_CONTROL_MECHANISM": 34 } } } From 48634d504542c0eda682601f9cdf5bd1750edf4f Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Tue, 23 Aug 2022 00:10:26 +0000 Subject: [PATCH 328/342] fix: better support for fallback mode (#503) - [ ] Regenerate this pull request now. PiperOrigin-RevId: 468790263 Source-Link: https://github.com/googleapis/googleapis/commit/873ab456273d105245df0fb82a6c17a814553b80 Source-Link: https://github.com/googleapis/googleapis-gen/commit/cb6f37aeff2a3472e40a7bbace8c67d75e24bee5 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiY2I2ZjM3YWVmZjJhMzQ3MmU0MGE3YmJhY2U4YzY3ZDc1ZTI0YmVlNSJ9 --- .../v1/security_center.bulk_mute_findings.js | 3 + ...security_center.create_big_query_export.js | 3 + .../v1/security_center.create_finding.js | 3 + .../v1/security_center.create_mute_config.js | 3 + ...urity_center.create_notification_config.js | 3 + .../v1/security_center.create_source.js | 3 + ...security_center.delete_big_query_export.js | 3 + .../v1/security_center.delete_mute_config.js | 3 + ...urity_center.delete_notification_config.js | 3 + .../security_center.get_big_query_export.js | 3 + .../v1/security_center.get_iam_policy.js | 3 + .../v1/security_center.get_mute_config.js | 3 + ...security_center.get_notification_config.js | 3 + ...curity_center.get_organization_settings.js | 3 + .../v1/security_center.get_source.js | 3 + .../v1/security_center.group_assets.js | 3 + .../v1/security_center.group_findings.js | 3 + .../v1/security_center.list_assets.js | 3 + .../security_center.list_big_query_exports.js | 3 + .../v1/security_center.list_findings.js | 3 + .../v1/security_center.list_mute_configs.js | 3 + ...curity_center.list_notification_configs.js | 3 + .../v1/security_center.list_sources.js | 3 + .../v1/security_center.run_asset_discovery.js | 3 + .../v1/security_center.set_finding_state.js | 3 + .../v1/security_center.set_iam_policy.js | 3 + .../generated/v1/security_center.set_mute.js | 3 + .../security_center.test_iam_permissions.js | 3 + ...security_center.update_big_query_export.js | 3 + .../security_center.update_external_system.js | 3 + .../v1/security_center.update_finding.js | 3 + .../v1/security_center.update_mute_config.js | 3 + ...urity_center.update_notification_config.js | 3 + ...ity_center.update_organization_settings.js | 3 + .../security_center.update_security_marks.js | 3 + .../v1/security_center.update_source.js | 3 + ...tadata.google.cloud.securitycenter.v1.json | 72 ++++---- .../v1beta1/security_center.create_finding.js | 3 + .../v1beta1/security_center.create_source.js | 3 + .../v1beta1/security_center.get_iam_policy.js | 3 + ...curity_center.get_organization_settings.js | 3 + .../v1beta1/security_center.get_source.js | 3 + .../v1beta1/security_center.group_assets.js | 3 + .../v1beta1/security_center.group_findings.js | 3 + .../v1beta1/security_center.list_assets.js | 3 + .../v1beta1/security_center.list_findings.js | 3 + .../v1beta1/security_center.list_sources.js | 3 + .../security_center.run_asset_discovery.js | 3 + .../security_center.set_finding_state.js | 3 + .../v1beta1/security_center.set_iam_policy.js | 3 + .../security_center.test_iam_permissions.js | 3 + .../v1beta1/security_center.update_finding.js | 3 + ...ity_center.update_organization_settings.js | 3 + .../security_center.update_security_marks.js | 3 + .../v1beta1/security_center.update_source.js | 3 + ...a.google.cloud.securitycenter.v1beta1.json | 36 ++-- .../security_center.create_finding.js | 3 + ...urity_center.create_notification_config.js | 3 + .../security_center.create_source.js | 3 + ...urity_center.delete_notification_config.js | 3 + .../security_center.get_iam_policy.js | 3 + ...security_center.get_notification_config.js | 3 + ...curity_center.get_organization_settings.js | 3 + .../v1p1beta1/security_center.get_source.js | 3 + .../v1p1beta1/security_center.group_assets.js | 3 + .../security_center.group_findings.js | 3 + .../v1p1beta1/security_center.list_assets.js | 3 + .../security_center.list_findings.js | 3 + ...curity_center.list_notification_configs.js | 3 + .../v1p1beta1/security_center.list_sources.js | 3 + .../security_center.run_asset_discovery.js | 3 + .../security_center.set_finding_state.js | 3 + .../security_center.set_iam_policy.js | 3 + .../security_center.test_iam_permissions.js | 3 + .../security_center.update_finding.js | 3 + ...urity_center.update_notification_config.js | 3 + ...ity_center.update_organization_settings.js | 3 + .../security_center.update_security_marks.js | 3 + .../security_center.update_source.js | 3 + ...google.cloud.securitycenter.v1p1beta1.json | 46 ++--- .../src/v1/security_center_client.ts | 40 ++--- .../src/v1beta1/security_center_client.ts | 26 +-- .../src/v1p1beta1/security_center_client.ts | 30 ++-- .../test/gapic_security_center_v1.ts | 160 +++++++++--------- .../test/gapic_security_center_v1beta1.ts | 160 +++++++++--------- .../test/gapic_security_center_v1p1beta1.ts | 160 +++++++++--------- 86 files changed, 599 insertions(+), 362 deletions(-) diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.bulk_mute_findings.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.bulk_mute_findings.js index dfc2499d41d..d25325483a5 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.bulk_mute_findings.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.bulk_mute_findings.js @@ -23,6 +23,9 @@ function main(parent) { // [START securitycenter_v1_generated_SecurityCenter_BulkMuteFindings_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.create_big_query_export.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.create_big_query_export.js index 83f63f53d09..e87ad301e7e 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.create_big_query_export.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.create_big_query_export.js @@ -23,6 +23,9 @@ function main(parent, bigQueryExport, bigQueryExportId) { // [START securitycenter_v1_generated_SecurityCenter_CreateBigQueryExport_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.create_finding.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.create_finding.js index a51ddfddb26..714d4f63519 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.create_finding.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.create_finding.js @@ -23,6 +23,9 @@ function main(parent, findingId, finding) { // [START securitycenter_v1_generated_SecurityCenter_CreateFinding_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.create_mute_config.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.create_mute_config.js index f6ad1e5675e..c122ec64a41 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.create_mute_config.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.create_mute_config.js @@ -23,6 +23,9 @@ function main(parent, muteConfig, muteConfigId) { // [START securitycenter_v1_generated_SecurityCenter_CreateMuteConfig_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.create_notification_config.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.create_notification_config.js index 73f2e6ba3d1..5bb9526e1ea 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.create_notification_config.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.create_notification_config.js @@ -23,6 +23,9 @@ function main(parent, configId, notificationConfig) { // [START securitycenter_v1_generated_SecurityCenter_CreateNotificationConfig_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.create_source.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.create_source.js index 0465b795433..fe7760787b6 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.create_source.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.create_source.js @@ -23,6 +23,9 @@ function main(parent, source) { // [START securitycenter_v1_generated_SecurityCenter_CreateSource_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.delete_big_query_export.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.delete_big_query_export.js index c82674a4553..1e94fcdd11e 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.delete_big_query_export.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.delete_big_query_export.js @@ -23,6 +23,9 @@ function main(name) { // [START securitycenter_v1_generated_SecurityCenter_DeleteBigQueryExport_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.delete_mute_config.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.delete_mute_config.js index 0d3d0984605..c4790e253f3 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.delete_mute_config.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.delete_mute_config.js @@ -23,6 +23,9 @@ function main(name) { // [START securitycenter_v1_generated_SecurityCenter_DeleteMuteConfig_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.delete_notification_config.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.delete_notification_config.js index 9a922f8d940..bc7dc2422be 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.delete_notification_config.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.delete_notification_config.js @@ -23,6 +23,9 @@ function main(name) { // [START securitycenter_v1_generated_SecurityCenter_DeleteNotificationConfig_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_big_query_export.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_big_query_export.js index ca65408182b..0040054cd65 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_big_query_export.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_big_query_export.js @@ -23,6 +23,9 @@ function main(name) { // [START securitycenter_v1_generated_SecurityCenter_GetBigQueryExport_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_iam_policy.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_iam_policy.js index c35eaa59dd5..2dae21363e4 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_iam_policy.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_iam_policy.js @@ -23,6 +23,9 @@ function main(resource) { // [START securitycenter_v1_generated_SecurityCenter_GetIamPolicy_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_mute_config.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_mute_config.js index 1364ec1bd7f..c7efec299ba 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_mute_config.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_mute_config.js @@ -23,6 +23,9 @@ function main(name) { // [START securitycenter_v1_generated_SecurityCenter_GetMuteConfig_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_notification_config.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_notification_config.js index 090b0283ca2..16b1cb7ca4b 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_notification_config.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_notification_config.js @@ -23,6 +23,9 @@ function main(name) { // [START securitycenter_v1_generated_SecurityCenter_GetNotificationConfig_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_organization_settings.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_organization_settings.js index 888f48e3075..23035414b72 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_organization_settings.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_organization_settings.js @@ -23,6 +23,9 @@ function main(name) { // [START securitycenter_v1_generated_SecurityCenter_GetOrganizationSettings_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_source.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_source.js index 55f6f64511e..fbb1bbe0fa7 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_source.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_source.js @@ -23,6 +23,9 @@ function main(name) { // [START securitycenter_v1_generated_SecurityCenter_GetSource_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.group_assets.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.group_assets.js index a16fcba32fb..06086a66f95 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.group_assets.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.group_assets.js @@ -23,6 +23,9 @@ function main(parent, groupBy) { // [START securitycenter_v1_generated_SecurityCenter_GroupAssets_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.group_findings.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.group_findings.js index d59021ca140..37b199dc162 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.group_findings.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.group_findings.js @@ -23,6 +23,9 @@ function main(parent, groupBy) { // [START securitycenter_v1_generated_SecurityCenter_GroupFindings_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_assets.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_assets.js index bf2dd52f483..8544695560c 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_assets.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_assets.js @@ -23,6 +23,9 @@ function main(parent) { // [START securitycenter_v1_generated_SecurityCenter_ListAssets_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_big_query_exports.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_big_query_exports.js index f58a82afb28..3efba707f6e 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_big_query_exports.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_big_query_exports.js @@ -23,6 +23,9 @@ function main(parent) { // [START securitycenter_v1_generated_SecurityCenter_ListBigQueryExports_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_findings.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_findings.js index 15eb8d4a5a9..24a1527f200 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_findings.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_findings.js @@ -23,6 +23,9 @@ function main(parent) { // [START securitycenter_v1_generated_SecurityCenter_ListFindings_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_mute_configs.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_mute_configs.js index 605e24f40ae..c8cf646cf69 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_mute_configs.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_mute_configs.js @@ -23,6 +23,9 @@ function main(parent) { // [START securitycenter_v1_generated_SecurityCenter_ListMuteConfigs_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_notification_configs.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_notification_configs.js index 2e4e8da7241..23f2a93050d 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_notification_configs.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_notification_configs.js @@ -23,6 +23,9 @@ function main(parent) { // [START securitycenter_v1_generated_SecurityCenter_ListNotificationConfigs_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_sources.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_sources.js index cb28399a2e8..7fb76c8b61e 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_sources.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_sources.js @@ -23,6 +23,9 @@ function main(parent) { // [START securitycenter_v1_generated_SecurityCenter_ListSources_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.run_asset_discovery.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.run_asset_discovery.js index d52034dfd59..5aa591fdb9e 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.run_asset_discovery.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.run_asset_discovery.js @@ -23,6 +23,9 @@ function main(parent) { // [START securitycenter_v1_generated_SecurityCenter_RunAssetDiscovery_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.set_finding_state.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.set_finding_state.js index 4ef1408793e..ddd05a3a40a 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.set_finding_state.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.set_finding_state.js @@ -23,6 +23,9 @@ function main(name, state, startTime) { // [START securitycenter_v1_generated_SecurityCenter_SetFindingState_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.set_iam_policy.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.set_iam_policy.js index f1c269c9ae4..7ba3e484e67 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.set_iam_policy.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.set_iam_policy.js @@ -23,6 +23,9 @@ function main(resource, policy) { // [START securitycenter_v1_generated_SecurityCenter_SetIamPolicy_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.set_mute.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.set_mute.js index b5430cb0bba..3e03d59aa28 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.set_mute.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.set_mute.js @@ -23,6 +23,9 @@ function main(name, mute) { // [START securitycenter_v1_generated_SecurityCenter_SetMute_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.test_iam_permissions.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.test_iam_permissions.js index eec1299c476..5e0cf0b1194 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.test_iam_permissions.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.test_iam_permissions.js @@ -23,6 +23,9 @@ function main(resource, permissions) { // [START securitycenter_v1_generated_SecurityCenter_TestIamPermissions_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_big_query_export.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_big_query_export.js index e74d9c238dc..bbba7509ac0 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_big_query_export.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_big_query_export.js @@ -23,6 +23,9 @@ function main(bigQueryExport) { // [START securitycenter_v1_generated_SecurityCenter_UpdateBigQueryExport_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_external_system.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_external_system.js index 0c91e7721cf..4bfd209f470 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_external_system.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_external_system.js @@ -23,6 +23,9 @@ function main(externalSystem) { // [START securitycenter_v1_generated_SecurityCenter_UpdateExternalSystem_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_finding.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_finding.js index 43974498848..dcb3e24e9da 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_finding.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_finding.js @@ -23,6 +23,9 @@ function main(finding) { // [START securitycenter_v1_generated_SecurityCenter_UpdateFinding_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_mute_config.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_mute_config.js index e624ed19e37..2740ec72d0f 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_mute_config.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_mute_config.js @@ -23,6 +23,9 @@ function main(muteConfig) { // [START securitycenter_v1_generated_SecurityCenter_UpdateMuteConfig_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_notification_config.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_notification_config.js index d8bc1878a0d..cfc925dea80 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_notification_config.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_notification_config.js @@ -23,6 +23,9 @@ function main(notificationConfig) { // [START securitycenter_v1_generated_SecurityCenter_UpdateNotificationConfig_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_organization_settings.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_organization_settings.js index 31b890d1d50..733ed3a0c3c 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_organization_settings.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_organization_settings.js @@ -23,6 +23,9 @@ function main(organizationSettings) { // [START securitycenter_v1_generated_SecurityCenter_UpdateOrganizationSettings_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_security_marks.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_security_marks.js index 3f19fca7f63..afaec0ff165 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_security_marks.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_security_marks.js @@ -23,6 +23,9 @@ function main(securityMarks) { // [START securitycenter_v1_generated_SecurityCenter_UpdateSecurityMarks_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_source.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_source.js index 03c19de4153..44a4da05584 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_source.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_source.js @@ -23,6 +23,9 @@ function main(source) { // [START securitycenter_v1_generated_SecurityCenter_UpdateSource_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/snippet_metadata.google.cloud.securitycenter.v1.json b/packages/google-cloud-securitycenter/samples/generated/v1/snippet_metadata.google.cloud.securitycenter.v1.json index 4bcaf2e9cb3..8702d489916 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/snippet_metadata.google.cloud.securitycenter.v1.json +++ b/packages/google-cloud-securitycenter/samples/generated/v1/snippet_metadata.google.cloud.securitycenter.v1.json @@ -22,7 +22,7 @@ "segments": [ { "start": 25, - "end": 76, + "end": 79, "type": "FULL" } ], @@ -70,7 +70,7 @@ "segments": [ { "start": 25, - "end": 57, + "end": 60, "type": "FULL" } ], @@ -114,7 +114,7 @@ "segments": [ { "start": 25, - "end": 64, + "end": 67, "type": "FULL" } ], @@ -162,7 +162,7 @@ "segments": [ { "start": 25, - "end": 65, + "end": 68, "type": "FULL" } ], @@ -210,7 +210,7 @@ "segments": [ { "start": 25, - "end": 65, + "end": 68, "type": "FULL" } ], @@ -258,7 +258,7 @@ "segments": [ { "start": 25, - "end": 53, + "end": 56, "type": "FULL" } ], @@ -298,7 +298,7 @@ "segments": [ { "start": 25, - "end": 51, + "end": 54, "type": "FULL" } ], @@ -338,7 +338,7 @@ "segments": [ { "start": 25, - "end": 53, + "end": 56, "type": "FULL" } ], @@ -378,7 +378,7 @@ "segments": [ { "start": 25, - "end": 56, + "end": 59, "type": "FULL" } ], @@ -422,7 +422,7 @@ "segments": [ { "start": 25, - "end": 53, + "end": 56, "type": "FULL" } ], @@ -462,7 +462,7 @@ "segments": [ { "start": 25, - "end": 51, + "end": 54, "type": "FULL" } ], @@ -502,7 +502,7 @@ "segments": [ { "start": 25, - "end": 51, + "end": 54, "type": "FULL" } ], @@ -542,7 +542,7 @@ "segments": [ { "start": 25, - "end": 51, + "end": 54, "type": "FULL" } ], @@ -582,7 +582,7 @@ "segments": [ { "start": 25, - "end": 165, + "end": 168, "type": "FULL" } ], @@ -646,7 +646,7 @@ "segments": [ { "start": 25, - "end": 169, + "end": 172, "type": "FULL" } ], @@ -710,7 +710,7 @@ "segments": [ { "start": 25, - "end": 174, + "end": 177, "type": "FULL" } ], @@ -778,7 +778,7 @@ "segments": [ { "start": 25, - "end": 180, + "end": 183, "type": "FULL" } ], @@ -846,7 +846,7 @@ "segments": [ { "start": 25, - "end": 68, + "end": 71, "type": "FULL" } ], @@ -894,7 +894,7 @@ "segments": [ { "start": 25, - "end": 64, + "end": 67, "type": "FULL" } ], @@ -942,7 +942,7 @@ "segments": [ { "start": 25, - "end": 65, + "end": 68, "type": "FULL" } ], @@ -990,7 +990,7 @@ "segments": [ { "start": 25, - "end": 52, + "end": 55, "type": "FULL" } ], @@ -1030,7 +1030,7 @@ "segments": [ { "start": 25, - "end": 63, + "end": 66, "type": "FULL" } ], @@ -1078,7 +1078,7 @@ "segments": [ { "start": 25, - "end": 60, + "end": 63, "type": "FULL" } ], @@ -1122,7 +1122,7 @@ "segments": [ { "start": 25, - "end": 66, + "end": 69, "type": "FULL" } ], @@ -1170,7 +1170,7 @@ "segments": [ { "start": 25, - "end": 59, + "end": 62, "type": "FULL" } ], @@ -1214,7 +1214,7 @@ "segments": [ { "start": 25, - "end": 55, + "end": 58, "type": "FULL" } ], @@ -1258,7 +1258,7 @@ "segments": [ { "start": 25, - "end": 63, + "end": 66, "type": "FULL" } ], @@ -1302,7 +1302,7 @@ "segments": [ { "start": 25, - "end": 55, + "end": 58, "type": "FULL" } ], @@ -1346,7 +1346,7 @@ "segments": [ { "start": 25, - "end": 55, + "end": 58, "type": "FULL" } ], @@ -1390,7 +1390,7 @@ "segments": [ { "start": 25, - "end": 55, + "end": 58, "type": "FULL" } ], @@ -1434,7 +1434,7 @@ "segments": [ { "start": 25, - "end": 55, + "end": 58, "type": "FULL" } ], @@ -1478,7 +1478,7 @@ "segments": [ { "start": 25, - "end": 64, + "end": 67, "type": "FULL" } ], @@ -1526,7 +1526,7 @@ "segments": [ { "start": 25, - "end": 65, + "end": 68, "type": "FULL" } ], @@ -1574,7 +1574,7 @@ "segments": [ { "start": 25, - "end": 53, + "end": 56, "type": "FULL" } ], @@ -1614,7 +1614,7 @@ "segments": [ { "start": 25, - "end": 55, + "end": 58, "type": "FULL" } ], @@ -1658,7 +1658,7 @@ "segments": [ { "start": 25, - "end": 68, + "end": 71, "type": "FULL" } ], diff --git a/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.create_finding.js b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.create_finding.js index b6d02d23eb7..84d8f61e5aa 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.create_finding.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.create_finding.js @@ -23,6 +23,9 @@ function main(parent, findingId, finding) { // [START securitycenter_v1beta1_generated_SecurityCenter_CreateFinding_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.create_source.js b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.create_source.js index 89b1fb7d57d..7acc3965f9a 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.create_source.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.create_source.js @@ -23,6 +23,9 @@ function main(parent, source) { // [START securitycenter_v1beta1_generated_SecurityCenter_CreateSource_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.get_iam_policy.js b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.get_iam_policy.js index c8f862f84ac..d3ca93d7f8d 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.get_iam_policy.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.get_iam_policy.js @@ -23,6 +23,9 @@ function main(resource) { // [START securitycenter_v1beta1_generated_SecurityCenter_GetIamPolicy_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.get_organization_settings.js b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.get_organization_settings.js index 3844f406041..acfb907c536 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.get_organization_settings.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.get_organization_settings.js @@ -23,6 +23,9 @@ function main(name) { // [START securitycenter_v1beta1_generated_SecurityCenter_GetOrganizationSettings_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.get_source.js b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.get_source.js index fa59cdbd4e1..abd111d2520 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.get_source.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.get_source.js @@ -23,6 +23,9 @@ function main(name) { // [START securitycenter_v1beta1_generated_SecurityCenter_GetSource_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.group_assets.js b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.group_assets.js index f1094ea2974..fd7038cd417 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.group_assets.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.group_assets.js @@ -23,6 +23,9 @@ function main(parent, groupBy) { // [START securitycenter_v1beta1_generated_SecurityCenter_GroupAssets_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.group_findings.js b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.group_findings.js index 3eb12bb9af3..4edc72f898d 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.group_findings.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.group_findings.js @@ -23,6 +23,9 @@ function main(parent, groupBy) { // [START securitycenter_v1beta1_generated_SecurityCenter_GroupFindings_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.list_assets.js b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.list_assets.js index 187079e5ac7..0dd5ef9e40e 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.list_assets.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.list_assets.js @@ -23,6 +23,9 @@ function main(parent) { // [START securitycenter_v1beta1_generated_SecurityCenter_ListAssets_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.list_findings.js b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.list_findings.js index 49e6b81d5d2..9240789a680 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.list_findings.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.list_findings.js @@ -23,6 +23,9 @@ function main(parent) { // [START securitycenter_v1beta1_generated_SecurityCenter_ListFindings_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.list_sources.js b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.list_sources.js index 6a6a4c3e5da..af32bd04ad3 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.list_sources.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.list_sources.js @@ -23,6 +23,9 @@ function main(parent) { // [START securitycenter_v1beta1_generated_SecurityCenter_ListSources_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.run_asset_discovery.js b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.run_asset_discovery.js index 8cc9e9645e4..4a8fd60bd90 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.run_asset_discovery.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.run_asset_discovery.js @@ -23,6 +23,9 @@ function main(parent) { // [START securitycenter_v1beta1_generated_SecurityCenter_RunAssetDiscovery_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.set_finding_state.js b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.set_finding_state.js index c135e7f5544..2a4fc5d924b 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.set_finding_state.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.set_finding_state.js @@ -23,6 +23,9 @@ function main(name, state, startTime) { // [START securitycenter_v1beta1_generated_SecurityCenter_SetFindingState_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.set_iam_policy.js b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.set_iam_policy.js index f9bb09e4ec4..00855ffd8ac 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.set_iam_policy.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.set_iam_policy.js @@ -23,6 +23,9 @@ function main(resource, policy) { // [START securitycenter_v1beta1_generated_SecurityCenter_SetIamPolicy_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.test_iam_permissions.js b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.test_iam_permissions.js index 2920bddb3db..549330173f1 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.test_iam_permissions.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.test_iam_permissions.js @@ -23,6 +23,9 @@ function main(resource, permissions) { // [START securitycenter_v1beta1_generated_SecurityCenter_TestIamPermissions_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.update_finding.js b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.update_finding.js index 1c30526911e..befaed349d3 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.update_finding.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.update_finding.js @@ -23,6 +23,9 @@ function main(finding) { // [START securitycenter_v1beta1_generated_SecurityCenter_UpdateFinding_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.update_organization_settings.js b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.update_organization_settings.js index cea471f4a78..454e30ca0af 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.update_organization_settings.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.update_organization_settings.js @@ -23,6 +23,9 @@ function main(organizationSettings) { // [START securitycenter_v1beta1_generated_SecurityCenter_UpdateOrganizationSettings_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.update_security_marks.js b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.update_security_marks.js index d1aaced78b5..8735efc1a42 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.update_security_marks.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.update_security_marks.js @@ -23,6 +23,9 @@ function main(securityMarks) { // [START securitycenter_v1beta1_generated_SecurityCenter_UpdateSecurityMarks_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.update_source.js b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.update_source.js index 01f4c9f4ab3..aef8890432c 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.update_source.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.update_source.js @@ -23,6 +23,9 @@ function main(source) { // [START securitycenter_v1beta1_generated_SecurityCenter_UpdateSource_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/packages/google-cloud-securitycenter/samples/generated/v1beta1/snippet_metadata.google.cloud.securitycenter.v1beta1.json b/packages/google-cloud-securitycenter/samples/generated/v1beta1/snippet_metadata.google.cloud.securitycenter.v1beta1.json index 158dd61e7d7..5cdbcd264f1 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1beta1/snippet_metadata.google.cloud.securitycenter.v1beta1.json +++ b/packages/google-cloud-securitycenter/samples/generated/v1beta1/snippet_metadata.google.cloud.securitycenter.v1beta1.json @@ -22,7 +22,7 @@ "segments": [ { "start": 25, - "end": 57, + "end": 60, "type": "FULL" } ], @@ -66,7 +66,7 @@ "segments": [ { "start": 25, - "end": 64, + "end": 67, "type": "FULL" } ], @@ -114,7 +114,7 @@ "segments": [ { "start": 25, - "end": 56, + "end": 59, "type": "FULL" } ], @@ -158,7 +158,7 @@ "segments": [ { "start": 25, - "end": 51, + "end": 54, "type": "FULL" } ], @@ -198,7 +198,7 @@ "segments": [ { "start": 25, - "end": 51, + "end": 54, "type": "FULL" } ], @@ -238,7 +238,7 @@ "segments": [ { "start": 25, - "end": 128, + "end": 131, "type": "FULL" } ], @@ -302,7 +302,7 @@ "segments": [ { "start": 25, - "end": 107, + "end": 110, "type": "FULL" } ], @@ -362,7 +362,7 @@ "segments": [ { "start": 25, - "end": 133, + "end": 136, "type": "FULL" } ], @@ -430,7 +430,7 @@ "segments": [ { "start": 25, - "end": 110, + "end": 113, "type": "FULL" } ], @@ -494,7 +494,7 @@ "segments": [ { "start": 25, - "end": 64, + "end": 67, "type": "FULL" } ], @@ -542,7 +542,7 @@ "segments": [ { "start": 25, - "end": 52, + "end": 55, "type": "FULL" } ], @@ -582,7 +582,7 @@ "segments": [ { "start": 25, - "end": 63, + "end": 66, "type": "FULL" } ], @@ -630,7 +630,7 @@ "segments": [ { "start": 25, - "end": 66, + "end": 69, "type": "FULL" } ], @@ -678,7 +678,7 @@ "segments": [ { "start": 25, - "end": 59, + "end": 62, "type": "FULL" } ], @@ -722,7 +722,7 @@ "segments": [ { "start": 25, - "end": 59, + "end": 62, "type": "FULL" } ], @@ -766,7 +766,7 @@ "segments": [ { "start": 25, - "end": 54, + "end": 57, "type": "FULL" } ], @@ -810,7 +810,7 @@ "segments": [ { "start": 25, - "end": 54, + "end": 57, "type": "FULL" } ], @@ -854,7 +854,7 @@ "segments": [ { "start": 25, - "end": 58, + "end": 61, "type": "FULL" } ], diff --git a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.create_finding.js b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.create_finding.js index aac99ed7894..f46bf1349cb 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.create_finding.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.create_finding.js @@ -23,6 +23,9 @@ function main(parent, findingId, finding) { // [START securitycenter_v1p1beta1_generated_SecurityCenter_CreateFinding_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.create_notification_config.js b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.create_notification_config.js index b6f6d561f72..1748a6c04cb 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.create_notification_config.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.create_notification_config.js @@ -23,6 +23,9 @@ function main(parent, configId, notificationConfig) { // [START securitycenter_v1p1beta1_generated_SecurityCenter_CreateNotificationConfig_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.create_source.js b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.create_source.js index b9efa166434..0c859d2ead2 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.create_source.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.create_source.js @@ -23,6 +23,9 @@ function main(parent, source) { // [START securitycenter_v1p1beta1_generated_SecurityCenter_CreateSource_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.delete_notification_config.js b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.delete_notification_config.js index 4eb4bcec9c3..6ab5fca8c7d 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.delete_notification_config.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.delete_notification_config.js @@ -23,6 +23,9 @@ function main(name) { // [START securitycenter_v1p1beta1_generated_SecurityCenter_DeleteNotificationConfig_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.get_iam_policy.js b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.get_iam_policy.js index 712e4fe18d3..e28fb517d91 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.get_iam_policy.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.get_iam_policy.js @@ -23,6 +23,9 @@ function main(resource) { // [START securitycenter_v1p1beta1_generated_SecurityCenter_GetIamPolicy_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.get_notification_config.js b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.get_notification_config.js index 8f87ffe5d3c..a1a4b42ab73 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.get_notification_config.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.get_notification_config.js @@ -23,6 +23,9 @@ function main(name) { // [START securitycenter_v1p1beta1_generated_SecurityCenter_GetNotificationConfig_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.get_organization_settings.js b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.get_organization_settings.js index e96b8b4e4d5..1e469ca60f0 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.get_organization_settings.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.get_organization_settings.js @@ -23,6 +23,9 @@ function main(name) { // [START securitycenter_v1p1beta1_generated_SecurityCenter_GetOrganizationSettings_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.get_source.js b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.get_source.js index 988cb631047..e147769f4c6 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.get_source.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.get_source.js @@ -23,6 +23,9 @@ function main(name) { // [START securitycenter_v1p1beta1_generated_SecurityCenter_GetSource_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.group_assets.js b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.group_assets.js index 6f364214af0..cb6b863604a 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.group_assets.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.group_assets.js @@ -23,6 +23,9 @@ function main(parent, groupBy) { // [START securitycenter_v1p1beta1_generated_SecurityCenter_GroupAssets_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.group_findings.js b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.group_findings.js index 949e649fcbb..de78580a568 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.group_findings.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.group_findings.js @@ -23,6 +23,9 @@ function main(parent, groupBy) { // [START securitycenter_v1p1beta1_generated_SecurityCenter_GroupFindings_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.list_assets.js b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.list_assets.js index 29b0abc6dfe..b98b82597d3 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.list_assets.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.list_assets.js @@ -23,6 +23,9 @@ function main(parent) { // [START securitycenter_v1p1beta1_generated_SecurityCenter_ListAssets_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.list_findings.js b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.list_findings.js index 2e5ce81c690..27e800be535 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.list_findings.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.list_findings.js @@ -23,6 +23,9 @@ function main(parent) { // [START securitycenter_v1p1beta1_generated_SecurityCenter_ListFindings_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.list_notification_configs.js b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.list_notification_configs.js index d67cbdb743c..c1c1c471557 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.list_notification_configs.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.list_notification_configs.js @@ -23,6 +23,9 @@ function main(parent) { // [START securitycenter_v1p1beta1_generated_SecurityCenter_ListNotificationConfigs_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.list_sources.js b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.list_sources.js index 78951b70149..6544f637a5c 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.list_sources.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.list_sources.js @@ -23,6 +23,9 @@ function main(parent) { // [START securitycenter_v1p1beta1_generated_SecurityCenter_ListSources_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.run_asset_discovery.js b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.run_asset_discovery.js index b53e6a02985..deae4cc152f 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.run_asset_discovery.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.run_asset_discovery.js @@ -23,6 +23,9 @@ function main(parent) { // [START securitycenter_v1p1beta1_generated_SecurityCenter_RunAssetDiscovery_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.set_finding_state.js b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.set_finding_state.js index f10874bdc4d..2cc7f1e6d4f 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.set_finding_state.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.set_finding_state.js @@ -23,6 +23,9 @@ function main(name, state, startTime) { // [START securitycenter_v1p1beta1_generated_SecurityCenter_SetFindingState_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.set_iam_policy.js b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.set_iam_policy.js index 637a16ea26d..9ed2170ef5b 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.set_iam_policy.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.set_iam_policy.js @@ -23,6 +23,9 @@ function main(resource, policy) { // [START securitycenter_v1p1beta1_generated_SecurityCenter_SetIamPolicy_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.test_iam_permissions.js b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.test_iam_permissions.js index 808a5c07cf2..944534ded96 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.test_iam_permissions.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.test_iam_permissions.js @@ -23,6 +23,9 @@ function main(resource, permissions) { // [START securitycenter_v1p1beta1_generated_SecurityCenter_TestIamPermissions_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.update_finding.js b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.update_finding.js index 0b7e0ca31d5..8e8df6e373f 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.update_finding.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.update_finding.js @@ -23,6 +23,9 @@ function main(finding) { // [START securitycenter_v1p1beta1_generated_SecurityCenter_UpdateFinding_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.update_notification_config.js b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.update_notification_config.js index d36a254bef7..190a4de9b86 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.update_notification_config.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.update_notification_config.js @@ -23,6 +23,9 @@ function main(notificationConfig) { // [START securitycenter_v1p1beta1_generated_SecurityCenter_UpdateNotificationConfig_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.update_organization_settings.js b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.update_organization_settings.js index 73d291ae7a3..ae5874ec435 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.update_organization_settings.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.update_organization_settings.js @@ -23,6 +23,9 @@ function main(organizationSettings) { // [START securitycenter_v1p1beta1_generated_SecurityCenter_UpdateOrganizationSettings_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.update_security_marks.js b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.update_security_marks.js index c4c73bcd20d..f37b9529739 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.update_security_marks.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.update_security_marks.js @@ -23,6 +23,9 @@ function main(securityMarks) { // [START securitycenter_v1p1beta1_generated_SecurityCenter_UpdateSecurityMarks_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.update_source.js b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.update_source.js index 89e55925451..6c72c7b9177 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.update_source.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.update_source.js @@ -23,6 +23,9 @@ function main(source) { // [START securitycenter_v1p1beta1_generated_SecurityCenter_UpdateSource_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/snippet_metadata.google.cloud.securitycenter.v1p1beta1.json b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/snippet_metadata.google.cloud.securitycenter.v1p1beta1.json index 306581564de..73a1ae68dca 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/snippet_metadata.google.cloud.securitycenter.v1p1beta1.json +++ b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/snippet_metadata.google.cloud.securitycenter.v1p1beta1.json @@ -22,7 +22,7 @@ "segments": [ { "start": 25, - "end": 57, + "end": 60, "type": "FULL" } ], @@ -66,7 +66,7 @@ "segments": [ { "start": 25, - "end": 62, + "end": 65, "type": "FULL" } ], @@ -114,7 +114,7 @@ "segments": [ { "start": 25, - "end": 64, + "end": 67, "type": "FULL" } ], @@ -162,7 +162,7 @@ "segments": [ { "start": 25, - "end": 51, + "end": 54, "type": "FULL" } ], @@ -202,7 +202,7 @@ "segments": [ { "start": 25, - "end": 56, + "end": 59, "type": "FULL" } ], @@ -246,7 +246,7 @@ "segments": [ { "start": 25, - "end": 51, + "end": 54, "type": "FULL" } ], @@ -286,7 +286,7 @@ "segments": [ { "start": 25, - "end": 51, + "end": 54, "type": "FULL" } ], @@ -326,7 +326,7 @@ "segments": [ { "start": 25, - "end": 51, + "end": 54, "type": "FULL" } ], @@ -366,7 +366,7 @@ "segments": [ { "start": 25, - "end": 165, + "end": 168, "type": "FULL" } ], @@ -430,7 +430,7 @@ "segments": [ { "start": 25, - "end": 161, + "end": 164, "type": "FULL" } ], @@ -494,7 +494,7 @@ "segments": [ { "start": 25, - "end": 174, + "end": 177, "type": "FULL" } ], @@ -562,7 +562,7 @@ "segments": [ { "start": 25, - "end": 170, + "end": 173, "type": "FULL" } ], @@ -630,7 +630,7 @@ "segments": [ { "start": 25, - "end": 64, + "end": 67, "type": "FULL" } ], @@ -678,7 +678,7 @@ "segments": [ { "start": 25, - "end": 65, + "end": 68, "type": "FULL" } ], @@ -726,7 +726,7 @@ "segments": [ { "start": 25, - "end": 52, + "end": 55, "type": "FULL" } ], @@ -766,7 +766,7 @@ "segments": [ { "start": 25, - "end": 63, + "end": 66, "type": "FULL" } ], @@ -814,7 +814,7 @@ "segments": [ { "start": 25, - "end": 66, + "end": 69, "type": "FULL" } ], @@ -862,7 +862,7 @@ "segments": [ { "start": 25, - "end": 59, + "end": 62, "type": "FULL" } ], @@ -906,7 +906,7 @@ "segments": [ { "start": 25, - "end": 63, + "end": 66, "type": "FULL" } ], @@ -950,7 +950,7 @@ "segments": [ { "start": 25, - "end": 55, + "end": 58, "type": "FULL" } ], @@ -994,7 +994,7 @@ "segments": [ { "start": 25, - "end": 55, + "end": 58, "type": "FULL" } ], @@ -1038,7 +1038,7 @@ "segments": [ { "start": 25, - "end": 55, + "end": 58, "type": "FULL" } ], @@ -1082,7 +1082,7 @@ "segments": [ { "start": 25, - "end": 63, + "end": 66, "type": "FULL" } ], diff --git a/packages/google-cloud-securitycenter/src/v1/security_center_client.ts b/packages/google-cloud-securitycenter/src/v1/security_center_client.ts index e8d49073b06..25c605361d6 100644 --- a/packages/google-cloud-securitycenter/src/v1/security_center_client.ts +++ b/packages/google-cloud-securitycenter/src/v1/security_center_client.ts @@ -30,7 +30,6 @@ import { } from 'google-gax'; import {Transform} from 'stream'; -import {RequestType} from 'google-gax/build/src/apitypes'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); /** @@ -469,7 +468,8 @@ export class SecurityCenterClient { const apiCall = this._gaxModule.createApiCall( callPromise, this._defaults[methodName], - descriptor + descriptor, + this._opts.fallback ); this.innerApiCalls[methodName] = apiCall; @@ -3277,7 +3277,7 @@ export class SecurityCenterClient { const decodeOperation = new gax.Operation( operation, this.descriptors.longrunning.bulkMuteFindings, - gax.createDefaultBackoffSettings() + this._gaxModule.createDefaultBackoffSettings() ); return decodeOperation as LROperation< protos.google.cloud.securitycenter.v1.BulkMuteFindingsResponse, @@ -3420,7 +3420,7 @@ export class SecurityCenterClient { const decodeOperation = new gax.Operation( operation, this.descriptors.longrunning.runAssetDiscovery, - gax.createDefaultBackoffSettings() + this._gaxModule.createDefaultBackoffSettings() ); return decodeOperation as LROperation< protos.google.cloud.securitycenter.v1.RunAssetDiscoveryResponse, @@ -3805,7 +3805,7 @@ export class SecurityCenterClient { const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.groupAssets.createStream( - this.innerApiCalls.groupAssets as gax.GaxCall, + this.innerApiCalls.groupAssets as GaxCall, request, callSettings ); @@ -3973,7 +3973,7 @@ export class SecurityCenterClient { this.initialize(); return this.descriptors.page.groupAssets.asyncIterate( this.innerApiCalls['groupAssets'] as GaxCall, - request as unknown as RequestType, + request as {}, callSettings ) as AsyncIterable; } @@ -4366,7 +4366,7 @@ export class SecurityCenterClient { const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.groupFindings.createStream( - this.innerApiCalls.groupFindings as gax.GaxCall, + this.innerApiCalls.groupFindings as GaxCall, request, callSettings ); @@ -4537,7 +4537,7 @@ export class SecurityCenterClient { this.initialize(); return this.descriptors.page.groupFindings.asyncIterate( this.innerApiCalls['groupFindings'] as GaxCall, - request as unknown as RequestType, + request as {}, callSettings ) as AsyncIterable; } @@ -4926,7 +4926,7 @@ export class SecurityCenterClient { const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listAssets.createStream( - this.innerApiCalls.listAssets as gax.GaxCall, + this.innerApiCalls.listAssets as GaxCall, request, callSettings ); @@ -5098,7 +5098,7 @@ export class SecurityCenterClient { this.initialize(); return this.descriptors.page.listAssets.asyncIterate( this.innerApiCalls['listAssets'] as GaxCall, - request as unknown as RequestType, + request as {}, callSettings ) as AsyncIterable; } @@ -5500,7 +5500,7 @@ export class SecurityCenterClient { const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listFindings.createStream( - this.innerApiCalls.listFindings as gax.GaxCall, + this.innerApiCalls.listFindings as GaxCall, request, callSettings ); @@ -5677,7 +5677,7 @@ export class SecurityCenterClient { this.initialize(); return this.descriptors.page.listFindings.asyncIterate( this.innerApiCalls['listFindings'] as GaxCall, - request as unknown as RequestType, + request as {}, callSettings ) as AsyncIterable; } @@ -5836,7 +5836,7 @@ export class SecurityCenterClient { const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listMuteConfigs.createStream( - this.innerApiCalls.listMuteConfigs as gax.GaxCall, + this.innerApiCalls.listMuteConfigs as GaxCall, request, callSettings ); @@ -5893,7 +5893,7 @@ export class SecurityCenterClient { this.initialize(); return this.descriptors.page.listMuteConfigs.asyncIterate( this.innerApiCalls['listMuteConfigs'] as GaxCall, - request as unknown as RequestType, + request as {}, callSettings ) as AsyncIterable; } @@ -6046,7 +6046,7 @@ export class SecurityCenterClient { const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listNotificationConfigs.createStream( - this.innerApiCalls.listNotificationConfigs as gax.GaxCall, + this.innerApiCalls.listNotificationConfigs as GaxCall, request, callSettings ); @@ -6098,7 +6098,7 @@ export class SecurityCenterClient { this.initialize(); return this.descriptors.page.listNotificationConfigs.asyncIterate( this.innerApiCalls['listNotificationConfigs'] as GaxCall, - request as unknown as RequestType, + request as {}, callSettings ) as AsyncIterable; } @@ -6249,7 +6249,7 @@ export class SecurityCenterClient { const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listSources.createStream( - this.innerApiCalls.listSources as gax.GaxCall, + this.innerApiCalls.listSources as GaxCall, request, callSettings ); @@ -6302,7 +6302,7 @@ export class SecurityCenterClient { this.initialize(); return this.descriptors.page.listSources.asyncIterate( this.innerApiCalls['listSources'] as GaxCall, - request as unknown as RequestType, + request as {}, callSettings ) as AsyncIterable; } @@ -6463,7 +6463,7 @@ export class SecurityCenterClient { const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listBigQueryExports.createStream( - this.innerApiCalls.listBigQueryExports as gax.GaxCall, + this.innerApiCalls.listBigQueryExports as GaxCall, request, callSettings ); @@ -6519,7 +6519,7 @@ export class SecurityCenterClient { this.initialize(); return this.descriptors.page.listBigQueryExports.asyncIterate( this.innerApiCalls['listBigQueryExports'] as GaxCall, - request as unknown as RequestType, + request as {}, callSettings ) as AsyncIterable; } diff --git a/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.ts b/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.ts index 2f018a39cc7..59678a4d6a8 100644 --- a/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.ts +++ b/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.ts @@ -30,7 +30,6 @@ import { } from 'google-gax'; import {Transform} from 'stream'; -import {RequestType} from 'google-gax/build/src/apitypes'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); /** @@ -362,7 +361,8 @@ export class SecurityCenterClient { const apiCall = this._gaxModule.createApiCall( callPromise, this._defaults[methodName], - descriptor + descriptor, + this._opts.fallback ); this.innerApiCalls[methodName] = apiCall; @@ -1728,7 +1728,7 @@ export class SecurityCenterClient { const decodeOperation = new gax.Operation( operation, this.descriptors.longrunning.runAssetDiscovery, - gax.createDefaultBackoffSettings() + this._gaxModule.createDefaultBackoffSettings() ); return decodeOperation as LROperation< protos.google.protobuf.Empty, @@ -2021,7 +2021,7 @@ export class SecurityCenterClient { const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.groupAssets.createStream( - this.innerApiCalls.groupAssets as gax.GaxCall, + this.innerApiCalls.groupAssets as GaxCall, request, callSettings ); @@ -2143,7 +2143,7 @@ export class SecurityCenterClient { this.initialize(); return this.descriptors.page.groupAssets.asyncIterate( this.innerApiCalls['groupAssets'] as GaxCall, - request as unknown as RequestType, + request as {}, callSettings ) as AsyncIterable; } @@ -2386,7 +2386,7 @@ export class SecurityCenterClient { const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.groupFindings.createStream( - this.innerApiCalls.groupFindings as gax.GaxCall, + this.innerApiCalls.groupFindings as GaxCall, request, callSettings ); @@ -2483,7 +2483,7 @@ export class SecurityCenterClient { this.initialize(); return this.descriptors.page.groupFindings.asyncIterate( this.innerApiCalls['groupFindings'] as GaxCall, - request as unknown as RequestType, + request as {}, callSettings ) as AsyncIterable; } @@ -2772,7 +2772,7 @@ export class SecurityCenterClient { const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listAssets.createStream( - this.innerApiCalls.listAssets as gax.GaxCall, + this.innerApiCalls.listAssets as GaxCall, request, callSettings ); @@ -2894,7 +2894,7 @@ export class SecurityCenterClient { this.initialize(); return this.descriptors.page.listAssets.asyncIterate( this.innerApiCalls['listAssets'] as GaxCall, - request as unknown as RequestType, + request as {}, callSettings ) as AsyncIterable; } @@ -3136,7 +3136,7 @@ export class SecurityCenterClient { const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listFindings.createStream( - this.innerApiCalls.listFindings as gax.GaxCall, + this.innerApiCalls.listFindings as GaxCall, request, callSettings ); @@ -3233,7 +3233,7 @@ export class SecurityCenterClient { this.initialize(); return this.descriptors.page.listFindings.asyncIterate( this.innerApiCalls['listFindings'] as GaxCall, - request as unknown as RequestType, + request as {}, callSettings ) as AsyncIterable; } @@ -3382,7 +3382,7 @@ export class SecurityCenterClient { const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listSources.createStream( - this.innerApiCalls.listSources as gax.GaxCall, + this.innerApiCalls.listSources as GaxCall, request, callSettings ); @@ -3434,7 +3434,7 @@ export class SecurityCenterClient { this.initialize(); return this.descriptors.page.listSources.asyncIterate( this.innerApiCalls['listSources'] as GaxCall, - request as unknown as RequestType, + request as {}, callSettings ) as AsyncIterable; } diff --git a/packages/google-cloud-securitycenter/src/v1p1beta1/security_center_client.ts b/packages/google-cloud-securitycenter/src/v1p1beta1/security_center_client.ts index de6a5388cc0..8d140e08006 100644 --- a/packages/google-cloud-securitycenter/src/v1p1beta1/security_center_client.ts +++ b/packages/google-cloud-securitycenter/src/v1p1beta1/security_center_client.ts @@ -30,7 +30,6 @@ import { } from 'google-gax'; import {Transform} from 'stream'; -import {RequestType} from 'google-gax/build/src/apitypes'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); /** @@ -407,7 +406,8 @@ export class SecurityCenterClient { const apiCall = this._gaxModule.createApiCall( callPromise, this._defaults[methodName], - descriptor + descriptor, + this._opts.fallback ); this.innerApiCalls[methodName] = apiCall; @@ -2225,7 +2225,7 @@ export class SecurityCenterClient { const decodeOperation = new gax.Operation( operation, this.descriptors.longrunning.runAssetDiscovery, - gax.createDefaultBackoffSettings() + this._gaxModule.createDefaultBackoffSettings() ); return decodeOperation as LROperation< protos.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse, @@ -2610,7 +2610,7 @@ export class SecurityCenterClient { const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.groupAssets.createStream( - this.innerApiCalls.groupAssets as gax.GaxCall, + this.innerApiCalls.groupAssets as GaxCall, request, callSettings ); @@ -2778,7 +2778,7 @@ export class SecurityCenterClient { this.initialize(); return this.descriptors.page.groupAssets.asyncIterate( this.innerApiCalls['groupAssets'] as GaxCall, - request as unknown as RequestType, + request as {}, callSettings ) as AsyncIterable; } @@ -3153,7 +3153,7 @@ export class SecurityCenterClient { const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.groupFindings.createStream( - this.innerApiCalls.groupFindings as gax.GaxCall, + this.innerApiCalls.groupFindings as GaxCall, request, callSettings ); @@ -3315,7 +3315,7 @@ export class SecurityCenterClient { this.initialize(); return this.descriptors.page.groupFindings.asyncIterate( this.innerApiCalls['groupFindings'] as GaxCall, - request as unknown as RequestType, + request as {}, callSettings ) as AsyncIterable; } @@ -3704,7 +3704,7 @@ export class SecurityCenterClient { const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listAssets.createStream( - this.innerApiCalls.listAssets as gax.GaxCall, + this.innerApiCalls.listAssets as GaxCall, request, callSettings ); @@ -3876,7 +3876,7 @@ export class SecurityCenterClient { this.initialize(); return this.descriptors.page.listAssets.asyncIterate( this.innerApiCalls['listAssets'] as GaxCall, - request as unknown as RequestType, + request as {}, callSettings ) as AsyncIterable; } @@ -4256,7 +4256,7 @@ export class SecurityCenterClient { const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listFindings.createStream( - this.innerApiCalls.listFindings as gax.GaxCall, + this.innerApiCalls.listFindings as GaxCall, request, callSettings ); @@ -4422,7 +4422,7 @@ export class SecurityCenterClient { this.initialize(); return this.descriptors.page.listFindings.asyncIterate( this.innerApiCalls['listFindings'] as GaxCall, - request as unknown as RequestType, + request as {}, callSettings ) as AsyncIterable; } @@ -4575,7 +4575,7 @@ export class SecurityCenterClient { const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listNotificationConfigs.createStream( - this.innerApiCalls.listNotificationConfigs as gax.GaxCall, + this.innerApiCalls.listNotificationConfigs as GaxCall, request, callSettings ); @@ -4627,7 +4627,7 @@ export class SecurityCenterClient { this.initialize(); return this.descriptors.page.listNotificationConfigs.asyncIterate( this.innerApiCalls['listNotificationConfigs'] as GaxCall, - request as unknown as RequestType, + request as {}, callSettings ) as AsyncIterable; } @@ -4778,7 +4778,7 @@ export class SecurityCenterClient { const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listSources.createStream( - this.innerApiCalls.listSources as gax.GaxCall, + this.innerApiCalls.listSources as GaxCall, request, callSettings ); @@ -4831,7 +4831,7 @@ export class SecurityCenterClient { this.initialize(); return this.descriptors.page.listSources.asyncIterate( this.innerApiCalls['listSources'] as GaxCall, - request as unknown as RequestType, + request as {}, callSettings ) as AsyncIterable; } diff --git a/packages/google-cloud-securitycenter/test/gapic_security_center_v1.ts b/packages/google-cloud-securitycenter/test/gapic_security_center_v1.ts index d61d7a1ae08..5450dc18f1d 100644 --- a/packages/google-cloud-securitycenter/test/gapic_security_center_v1.ts +++ b/packages/google-cloud-securitycenter/test/gapic_security_center_v1.ts @@ -145,101 +145,103 @@ function stubAsyncIterationCall( } describe('v1.SecurityCenterClient', () => { - it('has servicePath', () => { - const servicePath = - securitycenterModule.v1.SecurityCenterClient.servicePath; - assert(servicePath); - }); - - it('has apiEndpoint', () => { - const apiEndpoint = - securitycenterModule.v1.SecurityCenterClient.apiEndpoint; - assert(apiEndpoint); - }); - - it('has port', () => { - const port = securitycenterModule.v1.SecurityCenterClient.port; - assert(port); - assert(typeof port === 'number'); - }); + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = + securitycenterModule.v1.SecurityCenterClient.servicePath; + assert(servicePath); + }); - it('should create a client with no option', () => { - const client = new securitycenterModule.v1.SecurityCenterClient(); - assert(client); - }); + it('has apiEndpoint', () => { + const apiEndpoint = + securitycenterModule.v1.SecurityCenterClient.apiEndpoint; + assert(apiEndpoint); + }); - it('should create a client with gRPC fallback', () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - fallback: true, + it('has port', () => { + const port = securitycenterModule.v1.SecurityCenterClient.port; + assert(port); + assert(typeof port === 'number'); }); - assert(client); - }); - it('has initialize method and supports deferred initialization', async () => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + it('should create a client with no option', () => { + const client = new securitycenterModule.v1.SecurityCenterClient(); + assert(client); }); - assert.strictEqual(client.securityCenterStub, undefined); - await client.initialize(); - assert(client.securityCenterStub); - }); - it('has close method for the initialized client', done => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + it('should create a client with gRPC fallback', () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + fallback: true, + }); + assert(client); }); - client.initialize(); - assert(client.securityCenterStub); - client.close().then(() => { - done(); + + it('has initialize method and supports deferred initialization', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.securityCenterStub, undefined); + await client.initialize(); + assert(client.securityCenterStub); }); - }); - it('has close method for the non-initialized client', done => { - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + it('has close method for the initialized client', done => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.securityCenterStub); + client.close().then(() => { + done(); + }); }); - assert.strictEqual(client.securityCenterStub, undefined); - client.close().then(() => { - done(); + + it('has close method for the non-initialized client', done => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.securityCenterStub, undefined); + client.close().then(() => { + done(); + }); }); - }); - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new securitycenterModule.v1.SecurityCenterClient({ + 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()); }); - 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 securitycenterModule.v1.SecurityCenterClient({ - 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); - } + it('has getProjectId method with callback', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new securitycenterModule.v1.SecurityCenterClient({ + 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); }); - const result = await promise; - assert.strictEqual(result, fakeProjectId); }); describe('createSource', () => { diff --git a/packages/google-cloud-securitycenter/test/gapic_security_center_v1beta1.ts b/packages/google-cloud-securitycenter/test/gapic_security_center_v1beta1.ts index e0ae6436622..b06904c70d0 100644 --- a/packages/google-cloud-securitycenter/test/gapic_security_center_v1beta1.ts +++ b/packages/google-cloud-securitycenter/test/gapic_security_center_v1beta1.ts @@ -145,101 +145,103 @@ function stubAsyncIterationCall( } describe('v1beta1.SecurityCenterClient', () => { - it('has servicePath', () => { - const servicePath = - securitycenterModule.v1beta1.SecurityCenterClient.servicePath; - assert(servicePath); - }); - - it('has apiEndpoint', () => { - const apiEndpoint = - securitycenterModule.v1beta1.SecurityCenterClient.apiEndpoint; - assert(apiEndpoint); - }); - - it('has port', () => { - const port = securitycenterModule.v1beta1.SecurityCenterClient.port; - assert(port); - assert(typeof port === 'number'); - }); + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = + securitycenterModule.v1beta1.SecurityCenterClient.servicePath; + assert(servicePath); + }); - it('should create a client with no option', () => { - const client = new securitycenterModule.v1beta1.SecurityCenterClient(); - assert(client); - }); + it('has apiEndpoint', () => { + const apiEndpoint = + securitycenterModule.v1beta1.SecurityCenterClient.apiEndpoint; + assert(apiEndpoint); + }); - it('should create a client with gRPC fallback', () => { - const client = new securitycenterModule.v1beta1.SecurityCenterClient({ - fallback: true, + it('has port', () => { + const port = securitycenterModule.v1beta1.SecurityCenterClient.port; + assert(port); + assert(typeof port === 'number'); }); - assert(client); - }); - it('has initialize method and supports deferred initialization', async () => { - const client = new securitycenterModule.v1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + it('should create a client with no option', () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient(); + assert(client); }); - assert.strictEqual(client.securityCenterStub, undefined); - await client.initialize(); - assert(client.securityCenterStub); - }); - it('has close method for the initialized client', done => { - const client = new securitycenterModule.v1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + it('should create a client with gRPC fallback', () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + fallback: true, + }); + assert(client); }); - client.initialize(); - assert(client.securityCenterStub); - client.close().then(() => { - done(); + + it('has initialize method and supports deferred initialization', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.securityCenterStub, undefined); + await client.initialize(); + assert(client.securityCenterStub); }); - }); - it('has close method for the non-initialized client', done => { - const client = new securitycenterModule.v1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + it('has close method for the initialized client', done => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.securityCenterStub); + client.close().then(() => { + done(); + }); }); - assert.strictEqual(client.securityCenterStub, undefined); - client.close().then(() => { - done(); + + it('has close method for the non-initialized client', done => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.securityCenterStub, undefined); + client.close().then(() => { + done(); + }); }); - }); - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new securitycenterModule.v1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + 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()); }); - 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 securitycenterModule.v1beta1.SecurityCenterClient({ - 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); - } + it('has getProjectId method with callback', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + 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); }); - const result = await promise; - assert.strictEqual(result, fakeProjectId); }); describe('createSource', () => { diff --git a/packages/google-cloud-securitycenter/test/gapic_security_center_v1p1beta1.ts b/packages/google-cloud-securitycenter/test/gapic_security_center_v1p1beta1.ts index 3719516f63b..3b2c1ee4407 100644 --- a/packages/google-cloud-securitycenter/test/gapic_security_center_v1p1beta1.ts +++ b/packages/google-cloud-securitycenter/test/gapic_security_center_v1p1beta1.ts @@ -145,101 +145,103 @@ function stubAsyncIterationCall( } describe('v1p1beta1.SecurityCenterClient', () => { - it('has servicePath', () => { - const servicePath = - securitycenterModule.v1p1beta1.SecurityCenterClient.servicePath; - assert(servicePath); - }); - - it('has apiEndpoint', () => { - const apiEndpoint = - securitycenterModule.v1p1beta1.SecurityCenterClient.apiEndpoint; - assert(apiEndpoint); - }); - - it('has port', () => { - const port = securitycenterModule.v1p1beta1.SecurityCenterClient.port; - assert(port); - assert(typeof port === 'number'); - }); + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = + securitycenterModule.v1p1beta1.SecurityCenterClient.servicePath; + assert(servicePath); + }); - it('should create a client with no option', () => { - const client = new securitycenterModule.v1p1beta1.SecurityCenterClient(); - assert(client); - }); + it('has apiEndpoint', () => { + const apiEndpoint = + securitycenterModule.v1p1beta1.SecurityCenterClient.apiEndpoint; + assert(apiEndpoint); + }); - it('should create a client with gRPC fallback', () => { - const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ - fallback: true, + it('has port', () => { + const port = securitycenterModule.v1p1beta1.SecurityCenterClient.port; + assert(port); + assert(typeof port === 'number'); }); - assert(client); - }); - it('has initialize method and supports deferred initialization', async () => { - const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + it('should create a client with no option', () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient(); + assert(client); }); - assert.strictEqual(client.securityCenterStub, undefined); - await client.initialize(); - assert(client.securityCenterStub); - }); - it('has close method for the initialized client', done => { - const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + it('should create a client with gRPC fallback', () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + fallback: true, + }); + assert(client); }); - client.initialize(); - assert(client.securityCenterStub); - client.close().then(() => { - done(); + + it('has initialize method and supports deferred initialization', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.securityCenterStub, undefined); + await client.initialize(); + assert(client.securityCenterStub); }); - }); - it('has close method for the non-initialized client', done => { - const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + it('has close method for the initialized client', done => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.securityCenterStub); + client.close().then(() => { + done(); + }); }); - assert.strictEqual(client.securityCenterStub, undefined); - client.close().then(() => { - done(); + + it('has close method for the non-initialized client', done => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.securityCenterStub, undefined); + client.close().then(() => { + done(); + }); }); - }); - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + 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()); }); - 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 securitycenterModule.v1p1beta1.SecurityCenterClient({ - 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); - } + it('has getProjectId method with callback', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + 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); }); - const result = await promise; - assert.strictEqual(result, fakeProjectId); }); describe('createSource', () => { From 68ee64e41e29c0999ce4ec5b50db073d9a5ba88b Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Tue, 23 Aug 2022 07:32:22 +0000 Subject: [PATCH 329/342] fix: change import long to require (#504) Source-Link: https://github.com/googleapis/synthtool/commit/d229a1258999f599a90a9b674a1c5541e00db588 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-nodejs:latest@sha256:74ab2b3c71ef27e6d8b69b1d0a0c9d31447777b79ac3cd4be82c265b45f37e5e --- .../protos/protos.d.ts | 2208 ++- .../protos/protos.js | 11559 +++++++++++----- .../protos/protos.json | 87 +- 3 files changed, 10376 insertions(+), 3478 deletions(-) diff --git a/packages/google-cloud-securitycenter/protos/protos.d.ts b/packages/google-cloud-securitycenter/protos/protos.d.ts index 86a6ce6ec78..5a6165b0784 100644 --- a/packages/google-cloud-securitycenter/protos/protos.d.ts +++ b/packages/google-cloud-securitycenter/protos/protos.d.ts @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import * as Long from "long"; +import Long = require("long"); import {protobuf as $protobuf} from "google-gax"; /** Namespace google. */ export namespace google { @@ -144,6 +144,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Access + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a Geolocation. */ @@ -234,6 +241,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Geolocation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of an Asset. */ @@ -366,6 +380,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Asset + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } namespace Asset { @@ -506,6 +527,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SecurityCenterProperties + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of an IamPolicy. */ @@ -596,6 +624,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for IamPolicy + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } } @@ -693,6 +728,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Folder + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a SecurityMarks. */ @@ -795,6 +837,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SecurityMarks + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a BigQueryExport. */ @@ -927,6 +976,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BigQueryExport + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a Compliance. */ @@ -1029,6 +1085,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Compliance + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a Connection. */ @@ -1143,6 +1206,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Connection + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } namespace Connection { @@ -1246,6 +1316,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ContactDetails + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a Contact. */ @@ -1336,6 +1413,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Contact + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a Container. */ @@ -1444,6 +1528,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Container + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a Label. */ @@ -1540,6 +1631,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Label + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of an Exfiltration. */ @@ -1636,6 +1734,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Exfiltration + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of an ExfilResource. */ @@ -1732,6 +1837,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExfilResource + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of an ExternalSystem. */ @@ -1846,6 +1958,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExternalSystem + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a File. */ @@ -1966,6 +2085,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for File + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a Finding. */ @@ -2236,6 +2362,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Finding + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } namespace Finding { @@ -2375,6 +2508,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for IamBinding + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } namespace IamBinding { @@ -2493,6 +2633,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Indicator + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } namespace Indicator { @@ -2594,6 +2741,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ProcessSignature + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } namespace ProcessSignature { @@ -2692,6 +2846,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MemoryHashSignature + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } namespace MemoryHashSignature { @@ -2790,6 +2951,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Detection + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } } @@ -2881,6 +3049,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for YaraRuleSignature + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } } } @@ -3003,6 +3178,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Kubernetes + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } namespace Kubernetes { @@ -3113,6 +3295,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Pod + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a Node. */ @@ -3203,6 +3392,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Node + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a NodePool. */ @@ -3299,6 +3495,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NodePool + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a Role. */ @@ -3401,6 +3604,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Role + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } namespace Role { @@ -3519,6 +3729,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Binding + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a Subject. */ @@ -3621,6 +3838,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Subject + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } namespace Subject { @@ -3758,6 +3982,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AccessReview + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } } @@ -3873,6 +4104,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MitreAttack + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } namespace MitreAttack { @@ -4078,6 +4316,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Process + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of an EnvironmentVariable. */ @@ -4174,6 +4419,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnvironmentVariable + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a Vulnerability. */ @@ -4264,6 +4516,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Vulnerability + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a Cve. */ @@ -4372,6 +4631,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Cve + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a Reference. */ @@ -4468,6 +4734,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Reference + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a Cvssv3. */ @@ -4606,6 +4879,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Cvssv3 + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } namespace Cvssv3 { @@ -4781,6 +5061,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MuteConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a NotificationConfig. */ @@ -4898,6 +5185,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NotificationConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } namespace NotificationConfig { @@ -4990,6 +5284,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StreamingConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } } @@ -5096,6 +5397,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NotificationMessage + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a Resource. */ @@ -5228,6 +5536,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Resource + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of an OrganizationSettings. */ @@ -5330,6 +5645,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OrganizationSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } namespace OrganizationSettings { @@ -5434,6 +5756,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AssetDiscoveryConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } namespace AssetDiscoveryConfig { @@ -5541,6 +5870,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RunAssetDiscoveryResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } namespace RunAssetDiscoveryResponse { @@ -6082,252 +6418,252 @@ export namespace google { namespace SecurityCenter { /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#bulkMuteFindings}. + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|bulkMuteFindings}. * @param error Error, if any * @param [response] Operation */ type BulkMuteFindingsCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#createSource}. + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|createSource}. * @param error Error, if any * @param [response] Source */ type CreateSourceCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.Source) => void; /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#createFinding}. + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|createFinding}. * @param error Error, if any * @param [response] Finding */ type CreateFindingCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.Finding) => void; /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#createMuteConfig}. + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|createMuteConfig}. * @param error Error, if any * @param [response] MuteConfig */ type CreateMuteConfigCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.MuteConfig) => void; /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#createNotificationConfig}. + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|createNotificationConfig}. * @param error Error, if any * @param [response] NotificationConfig */ type CreateNotificationConfigCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.NotificationConfig) => void; /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#deleteMuteConfig}. + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|deleteMuteConfig}. * @param error Error, if any * @param [response] Empty */ type DeleteMuteConfigCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#deleteNotificationConfig}. + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|deleteNotificationConfig}. * @param error Error, if any * @param [response] Empty */ type DeleteNotificationConfigCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#getBigQueryExport}. + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|getBigQueryExport}. * @param error Error, if any * @param [response] BigQueryExport */ type GetBigQueryExportCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.BigQueryExport) => void; /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#getIamPolicy}. + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|getIamPolicy}. * @param error Error, if any * @param [response] Policy */ type GetIamPolicyCallback = (error: (Error|null), response?: google.iam.v1.Policy) => void; /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#getMuteConfig}. + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|getMuteConfig}. * @param error Error, if any * @param [response] MuteConfig */ type GetMuteConfigCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.MuteConfig) => void; /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#getNotificationConfig}. + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|getNotificationConfig}. * @param error Error, if any * @param [response] NotificationConfig */ type GetNotificationConfigCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.NotificationConfig) => void; /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#getOrganizationSettings}. + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|getOrganizationSettings}. * @param error Error, if any * @param [response] OrganizationSettings */ type GetOrganizationSettingsCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.OrganizationSettings) => void; /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#getSource}. + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|getSource}. * @param error Error, if any * @param [response] Source */ type GetSourceCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.Source) => void; /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#groupAssets}. + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|groupAssets}. * @param error Error, if any * @param [response] GroupAssetsResponse */ type GroupAssetsCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.GroupAssetsResponse) => void; /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#groupFindings}. + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|groupFindings}. * @param error Error, if any * @param [response] GroupFindingsResponse */ type GroupFindingsCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.GroupFindingsResponse) => void; /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#listAssets}. + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|listAssets}. * @param error Error, if any * @param [response] ListAssetsResponse */ type ListAssetsCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.ListAssetsResponse) => void; /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#listFindings}. + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|listFindings}. * @param error Error, if any * @param [response] ListFindingsResponse */ type ListFindingsCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.ListFindingsResponse) => void; /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#listMuteConfigs}. + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|listMuteConfigs}. * @param error Error, if any * @param [response] ListMuteConfigsResponse */ type ListMuteConfigsCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.ListMuteConfigsResponse) => void; /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#listNotificationConfigs}. + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|listNotificationConfigs}. * @param error Error, if any * @param [response] ListNotificationConfigsResponse */ type ListNotificationConfigsCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.ListNotificationConfigsResponse) => void; /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#listSources}. + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|listSources}. * @param error Error, if any * @param [response] ListSourcesResponse */ type ListSourcesCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.ListSourcesResponse) => void; /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#runAssetDiscovery}. + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|runAssetDiscovery}. * @param error Error, if any * @param [response] Operation */ type RunAssetDiscoveryCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#setFindingState}. + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|setFindingState}. * @param error Error, if any * @param [response] Finding */ type SetFindingStateCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.Finding) => void; /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#setMute}. + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|setMute}. * @param error Error, if any * @param [response] Finding */ type SetMuteCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.Finding) => void; /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#setIamPolicy}. + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|setIamPolicy}. * @param error Error, if any * @param [response] Policy */ type SetIamPolicyCallback = (error: (Error|null), response?: google.iam.v1.Policy) => void; /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#testIamPermissions}. + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|testIamPermissions}. * @param error Error, if any * @param [response] TestIamPermissionsResponse */ type TestIamPermissionsCallback = (error: (Error|null), response?: google.iam.v1.TestIamPermissionsResponse) => void; /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#updateExternalSystem}. + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|updateExternalSystem}. * @param error Error, if any * @param [response] ExternalSystem */ type UpdateExternalSystemCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.ExternalSystem) => void; /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#updateFinding}. + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|updateFinding}. * @param error Error, if any * @param [response] Finding */ type UpdateFindingCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.Finding) => void; /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#updateMuteConfig}. + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|updateMuteConfig}. * @param error Error, if any * @param [response] MuteConfig */ type UpdateMuteConfigCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.MuteConfig) => void; /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#updateNotificationConfig}. + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|updateNotificationConfig}. * @param error Error, if any * @param [response] NotificationConfig */ type UpdateNotificationConfigCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.NotificationConfig) => void; /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#updateOrganizationSettings}. + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|updateOrganizationSettings}. * @param error Error, if any * @param [response] OrganizationSettings */ type UpdateOrganizationSettingsCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.OrganizationSettings) => void; /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#updateSource}. + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|updateSource}. * @param error Error, if any * @param [response] Source */ type UpdateSourceCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.Source) => void; /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#updateSecurityMarks}. + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|updateSecurityMarks}. * @param error Error, if any * @param [response] SecurityMarks */ type UpdateSecurityMarksCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.SecurityMarks) => void; /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#createBigQueryExport}. + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|createBigQueryExport}. * @param error Error, if any * @param [response] BigQueryExport */ type CreateBigQueryExportCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.BigQueryExport) => void; /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#deleteBigQueryExport}. + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|deleteBigQueryExport}. * @param error Error, if any * @param [response] Empty */ type DeleteBigQueryExportCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#updateBigQueryExport}. + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|updateBigQueryExport}. * @param error Error, if any * @param [response] BigQueryExport */ type UpdateBigQueryExportCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.BigQueryExport) => void; /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#listBigQueryExports}. + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|listBigQueryExports}. * @param error Error, if any * @param [response] ListBigQueryExportsResponse */ @@ -6434,6 +6770,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BulkMuteFindingsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a BulkMuteFindingsResponse. */ @@ -6518,6 +6861,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BulkMuteFindingsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a CreateFindingRequest. */ @@ -6620,6 +6970,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateFindingRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a CreateMuteConfigRequest. */ @@ -6722,6 +7079,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateMuteConfigRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a CreateNotificationConfigRequest. */ @@ -6824,6 +7188,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateNotificationConfigRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a CreateSourceRequest. */ @@ -6920,6 +7291,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateSourceRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a DeleteMuteConfigRequest. */ @@ -7010,6 +7388,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteMuteConfigRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a DeleteNotificationConfigRequest. */ @@ -7100,6 +7485,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteNotificationConfigRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a GetBigQueryExportRequest. */ @@ -7190,6 +7582,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetBigQueryExportRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a GetMuteConfigRequest. */ @@ -7280,6 +7679,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetMuteConfigRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a GetNotificationConfigRequest. */ @@ -7370,6 +7776,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetNotificationConfigRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a GetOrganizationSettingsRequest. */ @@ -7460,6 +7873,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetOrganizationSettingsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a GetSourceRequest. */ @@ -7550,6 +7970,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetSourceRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a GroupAssetsRequest. */ @@ -7676,6 +8103,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GroupAssetsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a GroupAssetsResponse. */ @@ -7784,6 +8218,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GroupAssetsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a GroupFindingsRequest. */ @@ -7910,6 +8351,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GroupFindingsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a GroupFindingsResponse. */ @@ -8018,6 +8466,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GroupFindingsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a GroupResult. */ @@ -8114,6 +8569,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GroupResult + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a ListMuteConfigsRequest. */ @@ -8216,6 +8678,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListMuteConfigsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a ListMuteConfigsResponse. */ @@ -8312,6 +8781,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListMuteConfigsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a ListNotificationConfigsRequest. */ @@ -8414,6 +8890,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListNotificationConfigsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a ListNotificationConfigsResponse. */ @@ -8510,6 +8993,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListNotificationConfigsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a ListSourcesRequest. */ @@ -8612,6 +9102,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListSourcesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a ListSourcesResponse. */ @@ -8708,6 +9205,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListSourcesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a ListAssetsRequest. */ @@ -8840,6 +9344,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListAssetsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a ListAssetsResponse. */ @@ -8948,6 +9459,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListAssetsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } namespace ListAssetsResponse { @@ -9046,6 +9564,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListAssetsResult + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } namespace ListAssetsResult { @@ -9190,6 +9715,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListFindingsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a ListFindingsResponse. */ @@ -9298,6 +9830,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListFindingsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } namespace ListFindingsResponse { @@ -9402,6 +9941,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListFindingsResult + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } namespace ListFindingsResult { @@ -9545,6 +10091,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Resource + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } } } @@ -9649,6 +10202,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SetFindingStateRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a SetMuteRequest. */ @@ -9745,6 +10305,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SetMuteRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a RunAssetDiscoveryRequest. */ @@ -9835,6 +10402,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RunAssetDiscoveryRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of an UpdateExternalSystemRequest. */ @@ -9931,6 +10505,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateExternalSystemRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of an UpdateFindingRequest. */ @@ -10027,6 +10608,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateFindingRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of an UpdateMuteConfigRequest. */ @@ -10123,6 +10711,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateMuteConfigRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of an UpdateNotificationConfigRequest. */ @@ -10219,7 +10814,14 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; - } + + /** + * Gets the default type url for UpdateNotificationConfigRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } /** Properties of an UpdateOrganizationSettingsRequest. */ interface IUpdateOrganizationSettingsRequest { @@ -10315,6 +10917,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateOrganizationSettingsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of an UpdateSourceRequest. */ @@ -10411,6 +11020,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateSourceRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of an UpdateSecurityMarksRequest. */ @@ -10513,6 +11129,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateSecurityMarksRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a CreateBigQueryExportRequest. */ @@ -10615,6 +11238,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateBigQueryExportRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of an UpdateBigQueryExportRequest. */ @@ -10711,6 +11341,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateBigQueryExportRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a ListBigQueryExportsRequest. */ @@ -10813,6 +11450,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListBigQueryExportsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a ListBigQueryExportsResponse. */ @@ -10909,6 +11553,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListBigQueryExportsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a DeleteBigQueryExportRequest. */ @@ -10999,6 +11650,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteBigQueryExportRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a Source. */ @@ -11107,6 +11765,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Source + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } } @@ -11231,6 +11896,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Asset + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } namespace Asset { @@ -11347,6 +12019,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SecurityCenterProperties + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } } @@ -11444,6 +12123,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SecurityMarks + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a Finding. */ @@ -11588,6 +12274,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Finding + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } namespace Finding { @@ -11700,6 +12393,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OrganizationSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } namespace OrganizationSettings { @@ -11798,6 +12498,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AssetDiscoveryConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } namespace AssetDiscoveryConfig { @@ -11905,6 +12612,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RunAssetDiscoveryResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } namespace RunAssetDiscoveryResponse { @@ -12194,126 +12908,126 @@ export namespace google { namespace SecurityCenter { /** - * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter#createSource}. + * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter|createSource}. * @param error Error, if any * @param [response] Source */ type CreateSourceCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1beta1.Source) => void; /** - * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter#createFinding}. + * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter|createFinding}. * @param error Error, if any * @param [response] Finding */ type CreateFindingCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1beta1.Finding) => void; /** - * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter#getIamPolicy}. + * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter|getIamPolicy}. * @param error Error, if any * @param [response] Policy */ type GetIamPolicyCallback = (error: (Error|null), response?: google.iam.v1.Policy) => void; /** - * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter#getOrganizationSettings}. + * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter|getOrganizationSettings}. * @param error Error, if any * @param [response] OrganizationSettings */ type GetOrganizationSettingsCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1beta1.OrganizationSettings) => void; /** - * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter#getSource}. + * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter|getSource}. * @param error Error, if any * @param [response] Source */ type GetSourceCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1beta1.Source) => void; /** - * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter#groupAssets}. + * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter|groupAssets}. * @param error Error, if any * @param [response] GroupAssetsResponse */ type GroupAssetsCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1beta1.GroupAssetsResponse) => void; /** - * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter#groupFindings}. + * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter|groupFindings}. * @param error Error, if any * @param [response] GroupFindingsResponse */ type GroupFindingsCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1beta1.GroupFindingsResponse) => void; /** - * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter#listAssets}. + * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter|listAssets}. * @param error Error, if any * @param [response] ListAssetsResponse */ type ListAssetsCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1beta1.ListAssetsResponse) => void; /** - * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter#listFindings}. + * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter|listFindings}. * @param error Error, if any * @param [response] ListFindingsResponse */ type ListFindingsCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1beta1.ListFindingsResponse) => void; /** - * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter#listSources}. + * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter|listSources}. * @param error Error, if any * @param [response] ListSourcesResponse */ type ListSourcesCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1beta1.ListSourcesResponse) => void; /** - * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter#runAssetDiscovery}. + * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter|runAssetDiscovery}. * @param error Error, if any * @param [response] Operation */ type RunAssetDiscoveryCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; /** - * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter#setFindingState}. + * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter|setFindingState}. * @param error Error, if any * @param [response] Finding */ type SetFindingStateCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1beta1.Finding) => void; /** - * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter#setIamPolicy}. + * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter|setIamPolicy}. * @param error Error, if any * @param [response] Policy */ type SetIamPolicyCallback = (error: (Error|null), response?: google.iam.v1.Policy) => void; /** - * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter#testIamPermissions}. + * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter|testIamPermissions}. * @param error Error, if any * @param [response] TestIamPermissionsResponse */ type TestIamPermissionsCallback = (error: (Error|null), response?: google.iam.v1.TestIamPermissionsResponse) => void; /** - * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter#updateFinding}. + * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter|updateFinding}. * @param error Error, if any * @param [response] Finding */ type UpdateFindingCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1beta1.Finding) => void; /** - * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter#updateOrganizationSettings}. + * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter|updateOrganizationSettings}. * @param error Error, if any * @param [response] OrganizationSettings */ type UpdateOrganizationSettingsCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1beta1.OrganizationSettings) => void; /** - * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter#updateSource}. + * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter|updateSource}. * @param error Error, if any * @param [response] Source */ type UpdateSourceCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1beta1.Source) => void; /** - * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter#updateSecurityMarks}. + * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter|updateSecurityMarks}. * @param error Error, if any * @param [response] SecurityMarks */ @@ -12420,6 +13134,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateFindingRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a CreateSourceRequest. */ @@ -12516,6 +13237,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateSourceRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a GetOrganizationSettingsRequest. */ @@ -12606,6 +13334,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetOrganizationSettingsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a GetSourceRequest. */ @@ -12696,6 +13431,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetSourceRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a GroupAssetsRequest. */ @@ -12822,6 +13564,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GroupAssetsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a GroupAssetsResponse. */ @@ -12924,6 +13673,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GroupAssetsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a GroupFindingsRequest. */ @@ -13044,6 +13800,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GroupFindingsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a GroupFindingsResponse. */ @@ -13146,6 +13909,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GroupFindingsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a GroupResult. */ @@ -13242,6 +14012,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GroupResult + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a ListSourcesRequest. */ @@ -13344,6 +14121,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListSourcesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a ListSourcesResponse. */ @@ -13440,6 +14224,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListSourcesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a ListAssetsRequest. */ @@ -13572,6 +14363,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListAssetsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a ListAssetsResponse. */ @@ -13680,6 +14478,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListAssetsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } namespace ListAssetsResponse { @@ -13778,6 +14583,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListAssetsResult + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } namespace ListAssetsResult { @@ -13917,6 +14729,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListFindingsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a ListFindingsResponse. */ @@ -14025,6 +14844,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListFindingsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a SetFindingStateRequest. */ @@ -14127,6 +14953,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SetFindingStateRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a RunAssetDiscoveryRequest. */ @@ -14217,6 +15050,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RunAssetDiscoveryRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of an UpdateFindingRequest. */ @@ -14313,6 +15153,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateFindingRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of an UpdateOrganizationSettingsRequest. */ @@ -14409,6 +15256,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateOrganizationSettingsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of an UpdateSourceRequest. */ @@ -14505,6 +15359,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateSourceRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of an UpdateSecurityMarksRequest. */ @@ -14607,6 +15468,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateSecurityMarksRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a Source. */ @@ -14709,6 +15577,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Source + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } } @@ -14845,6 +15720,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Asset + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } namespace Asset { @@ -14985,6 +15867,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SecurityCenterProperties + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of an IamPolicy. */ @@ -15075,6 +15964,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for IamPolicy + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } } @@ -15172,6 +16068,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Folder + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a SecurityMarks. */ @@ -15274,6 +16177,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SecurityMarks + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a Finding. */ @@ -15430,6 +16340,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Finding + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } namespace Finding { @@ -15572,6 +16489,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NotificationConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } namespace NotificationConfig { @@ -15664,6 +16588,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StreamingConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** EventType enum. */ @@ -15776,6 +16707,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NotificationMessage + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a Resource. */ @@ -15896,6 +16834,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Resource + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of an OrganizationSettings. */ @@ -15998,6 +16943,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OrganizationSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } namespace OrganizationSettings { @@ -16102,6 +17054,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AssetDiscoveryConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } namespace AssetDiscoveryConfig { @@ -16209,6 +17168,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RunAssetDiscoveryResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } namespace RunAssetDiscoveryResponse { @@ -16568,161 +17534,161 @@ export namespace google { namespace SecurityCenter { /** - * Callback as used by {@link google.cloud.securitycenter.v1p1beta1.SecurityCenter#createSource}. + * Callback as used by {@link google.cloud.securitycenter.v1p1beta1.SecurityCenter|createSource}. * @param error Error, if any * @param [response] Source */ type CreateSourceCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1p1beta1.Source) => void; /** - * Callback as used by {@link google.cloud.securitycenter.v1p1beta1.SecurityCenter#createFinding}. + * Callback as used by {@link google.cloud.securitycenter.v1p1beta1.SecurityCenter|createFinding}. * @param error Error, if any * @param [response] Finding */ type CreateFindingCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1p1beta1.Finding) => void; /** - * Callback as used by {@link google.cloud.securitycenter.v1p1beta1.SecurityCenter#createNotificationConfig}. + * Callback as used by {@link google.cloud.securitycenter.v1p1beta1.SecurityCenter|createNotificationConfig}. * @param error Error, if any * @param [response] NotificationConfig */ type CreateNotificationConfigCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1p1beta1.NotificationConfig) => void; /** - * Callback as used by {@link google.cloud.securitycenter.v1p1beta1.SecurityCenter#deleteNotificationConfig}. + * Callback as used by {@link google.cloud.securitycenter.v1p1beta1.SecurityCenter|deleteNotificationConfig}. * @param error Error, if any * @param [response] Empty */ type DeleteNotificationConfigCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; /** - * Callback as used by {@link google.cloud.securitycenter.v1p1beta1.SecurityCenter#getIamPolicy}. + * Callback as used by {@link google.cloud.securitycenter.v1p1beta1.SecurityCenter|getIamPolicy}. * @param error Error, if any * @param [response] Policy */ type GetIamPolicyCallback = (error: (Error|null), response?: google.iam.v1.Policy) => void; /** - * Callback as used by {@link google.cloud.securitycenter.v1p1beta1.SecurityCenter#getNotificationConfig}. + * Callback as used by {@link google.cloud.securitycenter.v1p1beta1.SecurityCenter|getNotificationConfig}. * @param error Error, if any * @param [response] NotificationConfig */ type GetNotificationConfigCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1p1beta1.NotificationConfig) => void; /** - * Callback as used by {@link google.cloud.securitycenter.v1p1beta1.SecurityCenter#getOrganizationSettings}. + * Callback as used by {@link google.cloud.securitycenter.v1p1beta1.SecurityCenter|getOrganizationSettings}. * @param error Error, if any * @param [response] OrganizationSettings */ type GetOrganizationSettingsCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1p1beta1.OrganizationSettings) => void; /** - * Callback as used by {@link google.cloud.securitycenter.v1p1beta1.SecurityCenter#getSource}. + * Callback as used by {@link google.cloud.securitycenter.v1p1beta1.SecurityCenter|getSource}. * @param error Error, if any * @param [response] Source */ type GetSourceCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1p1beta1.Source) => void; /** - * Callback as used by {@link google.cloud.securitycenter.v1p1beta1.SecurityCenter#groupAssets}. + * Callback as used by {@link google.cloud.securitycenter.v1p1beta1.SecurityCenter|groupAssets}. * @param error Error, if any * @param [response] GroupAssetsResponse */ type GroupAssetsCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1p1beta1.GroupAssetsResponse) => void; /** - * Callback as used by {@link google.cloud.securitycenter.v1p1beta1.SecurityCenter#groupFindings}. + * Callback as used by {@link google.cloud.securitycenter.v1p1beta1.SecurityCenter|groupFindings}. * @param error Error, if any * @param [response] GroupFindingsResponse */ type GroupFindingsCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1p1beta1.GroupFindingsResponse) => void; /** - * Callback as used by {@link google.cloud.securitycenter.v1p1beta1.SecurityCenter#listAssets}. + * Callback as used by {@link google.cloud.securitycenter.v1p1beta1.SecurityCenter|listAssets}. * @param error Error, if any * @param [response] ListAssetsResponse */ type ListAssetsCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1p1beta1.ListAssetsResponse) => void; /** - * Callback as used by {@link google.cloud.securitycenter.v1p1beta1.SecurityCenter#listFindings}. + * Callback as used by {@link google.cloud.securitycenter.v1p1beta1.SecurityCenter|listFindings}. * @param error Error, if any * @param [response] ListFindingsResponse */ type ListFindingsCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1p1beta1.ListFindingsResponse) => void; /** - * Callback as used by {@link google.cloud.securitycenter.v1p1beta1.SecurityCenter#listNotificationConfigs}. + * Callback as used by {@link google.cloud.securitycenter.v1p1beta1.SecurityCenter|listNotificationConfigs}. * @param error Error, if any * @param [response] ListNotificationConfigsResponse */ type ListNotificationConfigsCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsResponse) => void; /** - * Callback as used by {@link google.cloud.securitycenter.v1p1beta1.SecurityCenter#listSources}. + * Callback as used by {@link google.cloud.securitycenter.v1p1beta1.SecurityCenter|listSources}. * @param error Error, if any * @param [response] ListSourcesResponse */ type ListSourcesCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1p1beta1.ListSourcesResponse) => void; /** - * Callback as used by {@link google.cloud.securitycenter.v1p1beta1.SecurityCenter#runAssetDiscovery}. + * Callback as used by {@link google.cloud.securitycenter.v1p1beta1.SecurityCenter|runAssetDiscovery}. * @param error Error, if any * @param [response] Operation */ type RunAssetDiscoveryCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; /** - * Callback as used by {@link google.cloud.securitycenter.v1p1beta1.SecurityCenter#setFindingState}. + * Callback as used by {@link google.cloud.securitycenter.v1p1beta1.SecurityCenter|setFindingState}. * @param error Error, if any * @param [response] Finding */ type SetFindingStateCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1p1beta1.Finding) => void; /** - * Callback as used by {@link google.cloud.securitycenter.v1p1beta1.SecurityCenter#setIamPolicy}. + * Callback as used by {@link google.cloud.securitycenter.v1p1beta1.SecurityCenter|setIamPolicy}. * @param error Error, if any * @param [response] Policy */ type SetIamPolicyCallback = (error: (Error|null), response?: google.iam.v1.Policy) => void; /** - * Callback as used by {@link google.cloud.securitycenter.v1p1beta1.SecurityCenter#testIamPermissions}. + * Callback as used by {@link google.cloud.securitycenter.v1p1beta1.SecurityCenter|testIamPermissions}. * @param error Error, if any * @param [response] TestIamPermissionsResponse */ type TestIamPermissionsCallback = (error: (Error|null), response?: google.iam.v1.TestIamPermissionsResponse) => void; /** - * Callback as used by {@link google.cloud.securitycenter.v1p1beta1.SecurityCenter#updateFinding}. + * Callback as used by {@link google.cloud.securitycenter.v1p1beta1.SecurityCenter|updateFinding}. * @param error Error, if any * @param [response] Finding */ type UpdateFindingCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1p1beta1.Finding) => void; /** - * Callback as used by {@link google.cloud.securitycenter.v1p1beta1.SecurityCenter#updateNotificationConfig}. + * Callback as used by {@link google.cloud.securitycenter.v1p1beta1.SecurityCenter|updateNotificationConfig}. * @param error Error, if any * @param [response] NotificationConfig */ type UpdateNotificationConfigCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1p1beta1.NotificationConfig) => void; /** - * Callback as used by {@link google.cloud.securitycenter.v1p1beta1.SecurityCenter#updateOrganizationSettings}. + * Callback as used by {@link google.cloud.securitycenter.v1p1beta1.SecurityCenter|updateOrganizationSettings}. * @param error Error, if any * @param [response] OrganizationSettings */ type UpdateOrganizationSettingsCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1p1beta1.OrganizationSettings) => void; /** - * Callback as used by {@link google.cloud.securitycenter.v1p1beta1.SecurityCenter#updateSource}. + * Callback as used by {@link google.cloud.securitycenter.v1p1beta1.SecurityCenter|updateSource}. * @param error Error, if any * @param [response] Source */ type UpdateSourceCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1p1beta1.Source) => void; /** - * Callback as used by {@link google.cloud.securitycenter.v1p1beta1.SecurityCenter#updateSecurityMarks}. + * Callback as used by {@link google.cloud.securitycenter.v1p1beta1.SecurityCenter|updateSecurityMarks}. * @param error Error, if any * @param [response] SecurityMarks */ @@ -16829,6 +17795,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateFindingRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a CreateNotificationConfigRequest. */ @@ -16931,6 +17904,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateNotificationConfigRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a CreateSourceRequest. */ @@ -17027,6 +18007,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateSourceRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a DeleteNotificationConfigRequest. */ @@ -17117,6 +18104,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteNotificationConfigRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a GetNotificationConfigRequest. */ @@ -17207,6 +18201,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetNotificationConfigRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a GetOrganizationSettingsRequest. */ @@ -17297,6 +18298,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetOrganizationSettingsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a GetSourceRequest. */ @@ -17387,6 +18395,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetSourceRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a GroupAssetsRequest. */ @@ -17513,6 +18528,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GroupAssetsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a GroupAssetsResponse. */ @@ -17621,6 +18643,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GroupAssetsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a GroupFindingsRequest. */ @@ -17747,6 +18776,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GroupFindingsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a GroupFindingsResponse. */ @@ -17855,6 +18891,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GroupFindingsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a GroupResult. */ @@ -17951,6 +18994,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GroupResult + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a ListNotificationConfigsRequest. */ @@ -18053,6 +19103,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListNotificationConfigsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a ListNotificationConfigsResponse. */ @@ -18149,6 +19206,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListNotificationConfigsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a ListSourcesRequest. */ @@ -18251,6 +19315,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListSourcesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a ListSourcesResponse. */ @@ -18347,6 +19418,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListSourcesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a ListAssetsRequest. */ @@ -18479,6 +19557,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListAssetsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a ListAssetsResponse. */ @@ -18587,6 +19672,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListAssetsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } namespace ListAssetsResponse { @@ -18685,6 +19777,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListAssetsResult + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } namespace ListAssetsResult { @@ -18829,6 +19928,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListFindingsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a ListFindingsResponse. */ @@ -18937,6 +20043,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListFindingsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } namespace ListFindingsResponse { @@ -19041,6 +20154,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListFindingsResult + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } namespace ListFindingsResult { @@ -19163,6 +20283,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Resource + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** StateChange enum. */ @@ -19276,6 +20403,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SetFindingStateRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a RunAssetDiscoveryRequest. */ @@ -19366,6 +20500,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RunAssetDiscoveryRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of an UpdateFindingRequest. */ @@ -19462,6 +20603,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateFindingRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of an UpdateNotificationConfigRequest. */ @@ -19558,6 +20706,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateNotificationConfigRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of an UpdateOrganizationSettingsRequest. */ @@ -19654,6 +20809,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateOrganizationSettingsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of an UpdateSourceRequest. */ @@ -19750,6 +20912,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateSourceRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of an UpdateSecurityMarksRequest. */ @@ -19852,6 +21021,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateSecurityMarksRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a Source. */ @@ -19960,6 +21136,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Source + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } } } @@ -20092,6 +21275,13 @@ export namespace google { * @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 { @@ -20204,6 +21394,13 @@ export namespace google { * @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; } /** FieldBehavior enum. */ @@ -20312,6 +21509,13 @@ export namespace google { * @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. */ @@ -20459,6 +21663,13 @@ export namespace google { * @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. */ @@ -20555,6 +21766,13 @@ export namespace google { * @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; } } @@ -20649,6 +21867,13 @@ export namespace google { * @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. */ @@ -20689,6 +21914,9 @@ export namespace google { /** FileDescriptorProto syntax */ syntax?: (string|null); + + /** FileDescriptorProto edition */ + edition?: (string|null); } /** Represents a FileDescriptorProto. */ @@ -20736,6 +21964,9 @@ export namespace google { /** FileDescriptorProto syntax. */ public syntax: string; + /** FileDescriptorProto edition. */ + public edition: string; + /** * Creates a new FileDescriptorProto instance using the specified properties. * @param [properties] Properties to set @@ -20805,6 +22036,13 @@ export namespace google { * @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. */ @@ -20949,6 +22187,13 @@ export namespace google { * @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 { @@ -21053,6 +22298,13 @@ export namespace google { * @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. */ @@ -21149,6 +22401,13 @@ export namespace google { * @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; } } @@ -21240,6 +22499,13 @@ export namespace google { * @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. */ @@ -21390,6 +22656,13 @@ export namespace google { * @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 { @@ -21518,6 +22791,13 @@ export namespace google { * @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. */ @@ -21632,6 +22912,13 @@ export namespace google { * @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 { @@ -21730,6 +23017,13 @@ export namespace google { * @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; } } @@ -21833,6 +23127,13 @@ export namespace google { * @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. */ @@ -21935,6 +23236,13 @@ export namespace google { * @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. */ @@ -22055,6 +23363,13 @@ export namespace google { * @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. */ @@ -22268,6 +23583,13 @@ export namespace google { * @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 { @@ -22395,6 +23717,13 @@ export namespace google { * @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. */ @@ -22412,6 +23741,9 @@ export namespace google { /** FieldOptions lazy */ lazy?: (boolean|null); + /** FieldOptions unverifiedLazy */ + unverifiedLazy?: (boolean|null); + /** FieldOptions deprecated */ deprecated?: (boolean|null); @@ -22449,6 +23781,9 @@ export namespace google { /** FieldOptions lazy. */ public lazy: boolean; + /** FieldOptions unverifiedLazy. */ + public unverifiedLazy: boolean; + /** FieldOptions deprecated. */ public deprecated: boolean; @@ -22527,6 +23862,13 @@ export namespace google { * @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 { @@ -22634,6 +23976,13 @@ export namespace google { * @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. */ @@ -22736,6 +24085,13 @@ export namespace google { * @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. */ @@ -22832,6 +24188,13 @@ export namespace google { * @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. */ @@ -22934,6 +24297,13 @@ export namespace google { * @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. */ @@ -23045,6 +24415,13 @@ export namespace google { * @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 { @@ -23181,6 +24558,13 @@ export namespace google { * @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 { @@ -23279,6 +24663,13 @@ export namespace google { * @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; } } @@ -23370,6 +24761,13 @@ export namespace google { * @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 { @@ -23486,6 +24884,13 @@ export namespace google { * @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; } } @@ -23577,6 +24982,13 @@ export namespace google { * @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 { @@ -23595,6 +25007,9 @@ export namespace google { /** Annotation end */ end?: (number|null); + + /** Annotation semantic */ + semantic?: (google.protobuf.GeneratedCodeInfo.Annotation.Semantic|keyof typeof google.protobuf.GeneratedCodeInfo.Annotation.Semantic|null); } /** Represents an Annotation. */ @@ -23618,6 +25033,9 @@ export namespace google { /** 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 @@ -23687,6 +25105,23 @@ export namespace google { * @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 + } } } @@ -23778,6 +25213,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Struct + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a Value. */ @@ -23901,6 +25343,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** NullValue enum. */ @@ -23996,6 +25445,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a Timestamp. */ @@ -24092,6 +25548,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Timestamp + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a Duration. */ @@ -24188,6 +25651,110 @@ export namespace google { * @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 FieldMask. */ + interface IFieldMask { + + /** FieldMask paths */ + paths?: (string[]|null); + } + + /** Represents a FieldMask. */ + class FieldMask implements IFieldMask { + + /** + * Constructs a new FieldMask. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFieldMask); + + /** FieldMask paths. */ + public paths: string[]; + + /** + * Creates a new FieldMask instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldMask instance + */ + public static create(properties?: google.protobuf.IFieldMask): google.protobuf.FieldMask; + + /** + * Encodes the specified FieldMask message. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @param message FieldMask message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFieldMask, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldMask message, length delimited. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @param message FieldMask message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFieldMask, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldMask message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldMask + * @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.FieldMask; + + /** + * Decodes a FieldMask message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldMask + * @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.FieldMask; + + /** + * Verifies a FieldMask 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 FieldMask message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldMask + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldMask; + + /** + * Creates a plain object from a FieldMask message. Also converts values to other types if specified. + * @param message FieldMask + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldMask, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldMask to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FieldMask + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of an Any. */ @@ -24284,6 +25851,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Any + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of an Empty. */ @@ -24368,96 +25942,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; - } - - /** Properties of a FieldMask. */ - interface IFieldMask { - - /** FieldMask paths */ - paths?: (string[]|null); - } - - /** Represents a FieldMask. */ - class FieldMask implements IFieldMask { /** - * Constructs a new FieldMask. - * @param [properties] Properties to set + * Gets the default type url for Empty + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url */ - constructor(properties?: google.protobuf.IFieldMask); - - /** FieldMask paths. */ - public paths: string[]; - - /** - * Creates a new FieldMask instance using the specified properties. - * @param [properties] Properties to set - * @returns FieldMask instance - */ - public static create(properties?: google.protobuf.IFieldMask): google.protobuf.FieldMask; - - /** - * Encodes the specified FieldMask message. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. - * @param message FieldMask message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IFieldMask, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FieldMask message, length delimited. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. - * @param message FieldMask message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IFieldMask, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FieldMask message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FieldMask - * @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.FieldMask; - - /** - * Decodes a FieldMask message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FieldMask - * @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.FieldMask; - - /** - * Verifies a FieldMask 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 FieldMask message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FieldMask - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FieldMask; - - /** - * Creates a plain object from a FieldMask message. Also converts values to other types if specified. - * @param message FieldMask - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FieldMask, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FieldMask to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + public static getTypeUrl(typeUrlPrefix?: string): string; } } @@ -24533,21 +26024,21 @@ export namespace google { namespace IAMPolicy { /** - * Callback as used by {@link google.iam.v1.IAMPolicy#setIamPolicy}. + * Callback as used by {@link google.iam.v1.IAMPolicy|setIamPolicy}. * @param error Error, if any * @param [response] Policy */ type SetIamPolicyCallback = (error: (Error|null), response?: google.iam.v1.Policy) => void; /** - * Callback as used by {@link google.iam.v1.IAMPolicy#getIamPolicy}. + * Callback as used by {@link google.iam.v1.IAMPolicy|getIamPolicy}. * @param error Error, if any * @param [response] Policy */ type GetIamPolicyCallback = (error: (Error|null), response?: google.iam.v1.Policy) => void; /** - * Callback as used by {@link google.iam.v1.IAMPolicy#testIamPermissions}. + * Callback as used by {@link google.iam.v1.IAMPolicy|testIamPermissions}. * @param error Error, if any * @param [response] TestIamPermissionsResponse */ @@ -24562,6 +26053,9 @@ export namespace google { /** SetIamPolicyRequest policy */ policy?: (google.iam.v1.IPolicy|null); + + /** SetIamPolicyRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); } /** Represents a SetIamPolicyRequest. */ @@ -24579,6 +26073,9 @@ export namespace google { /** SetIamPolicyRequest policy. */ public policy?: (google.iam.v1.IPolicy|null); + /** SetIamPolicyRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + /** * Creates a new SetIamPolicyRequest instance using the specified properties. * @param [properties] Properties to set @@ -24648,6 +26145,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SetIamPolicyRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a GetIamPolicyRequest. */ @@ -24744,6 +26248,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetIamPolicyRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a TestIamPermissionsRequest. */ @@ -24840,6 +26351,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TestIamPermissionsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a TestIamPermissionsResponse. */ @@ -24930,6 +26448,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TestIamPermissionsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a GetPolicyOptions. */ @@ -25020,6 +26545,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetPolicyOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a Policy. */ @@ -25031,6 +26563,9 @@ export namespace google { /** Policy bindings */ bindings?: (google.iam.v1.IBinding[]|null); + /** Policy auditConfigs */ + auditConfigs?: (google.iam.v1.IAuditConfig[]|null); + /** Policy etag */ etag?: (Uint8Array|string|null); } @@ -25050,6 +26585,9 @@ export namespace google { /** Policy bindings. */ public bindings: google.iam.v1.IBinding[]; + /** Policy auditConfigs. */ + public auditConfigs: google.iam.v1.IAuditConfig[]; + /** Policy etag. */ public etag: (Uint8Array|string); @@ -25122,6 +26660,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Policy + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a Binding. */ @@ -25224,6 +26769,230 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Binding + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AuditConfig. */ + interface IAuditConfig { + + /** AuditConfig service */ + service?: (string|null); + + /** AuditConfig auditLogConfigs */ + auditLogConfigs?: (google.iam.v1.IAuditLogConfig[]|null); + } + + /** Represents an AuditConfig. */ + class AuditConfig implements IAuditConfig { + + /** + * Constructs a new AuditConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IAuditConfig); + + /** AuditConfig service. */ + public service: string; + + /** AuditConfig auditLogConfigs. */ + public auditLogConfigs: google.iam.v1.IAuditLogConfig[]; + + /** + * Creates a new AuditConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns AuditConfig instance + */ + public static create(properties?: google.iam.v1.IAuditConfig): google.iam.v1.AuditConfig; + + /** + * Encodes the specified AuditConfig message. Does not implicitly {@link google.iam.v1.AuditConfig.verify|verify} messages. + * @param message AuditConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IAuditConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AuditConfig message, length delimited. Does not implicitly {@link google.iam.v1.AuditConfig.verify|verify} messages. + * @param message AuditConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IAuditConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AuditConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AuditConfig + * @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.iam.v1.AuditConfig; + + /** + * Decodes an AuditConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AuditConfig + * @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.iam.v1.AuditConfig; + + /** + * Verifies an AuditConfig 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 AuditConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AuditConfig + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.AuditConfig; + + /** + * Creates a plain object from an AuditConfig message. Also converts values to other types if specified. + * @param message AuditConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.AuditConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AuditConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AuditConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AuditLogConfig. */ + interface IAuditLogConfig { + + /** AuditLogConfig logType */ + logType?: (google.iam.v1.AuditLogConfig.LogType|keyof typeof google.iam.v1.AuditLogConfig.LogType|null); + + /** AuditLogConfig exemptedMembers */ + exemptedMembers?: (string[]|null); + } + + /** Represents an AuditLogConfig. */ + class AuditLogConfig implements IAuditLogConfig { + + /** + * Constructs a new AuditLogConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IAuditLogConfig); + + /** AuditLogConfig logType. */ + public logType: (google.iam.v1.AuditLogConfig.LogType|keyof typeof google.iam.v1.AuditLogConfig.LogType); + + /** AuditLogConfig exemptedMembers. */ + public exemptedMembers: string[]; + + /** + * Creates a new AuditLogConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns AuditLogConfig instance + */ + public static create(properties?: google.iam.v1.IAuditLogConfig): google.iam.v1.AuditLogConfig; + + /** + * Encodes the specified AuditLogConfig message. Does not implicitly {@link google.iam.v1.AuditLogConfig.verify|verify} messages. + * @param message AuditLogConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IAuditLogConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AuditLogConfig message, length delimited. Does not implicitly {@link google.iam.v1.AuditLogConfig.verify|verify} messages. + * @param message AuditLogConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IAuditLogConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AuditLogConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AuditLogConfig + * @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.iam.v1.AuditLogConfig; + + /** + * Decodes an AuditLogConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AuditLogConfig + * @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.iam.v1.AuditLogConfig; + + /** + * Verifies an AuditLogConfig 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 AuditLogConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AuditLogConfig + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.AuditLogConfig; + + /** + * Creates a plain object from an AuditLogConfig message. Also converts values to other types if specified. + * @param message AuditLogConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.AuditLogConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AuditLogConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AuditLogConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace AuditLogConfig { + + /** LogType enum. */ + enum LogType { + LOG_TYPE_UNSPECIFIED = 0, + ADMIN_READ = 1, + DATA_WRITE = 2, + DATA_READ = 3 + } } /** Properties of a PolicyDelta. */ @@ -25320,6 +27089,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PolicyDelta + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a BindingDelta. */ @@ -25428,6 +27204,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BindingDelta + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } namespace BindingDelta { @@ -25546,6 +27329,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AuditConfigDelta + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } namespace AuditConfigDelta { @@ -25669,6 +27459,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Expr + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } } @@ -25769,35 +27566,35 @@ export namespace google { namespace Operations { /** - * Callback as used by {@link google.longrunning.Operations#listOperations}. + * Callback as used by {@link google.longrunning.Operations|listOperations}. * @param error Error, if any * @param [response] ListOperationsResponse */ type ListOperationsCallback = (error: (Error|null), response?: google.longrunning.ListOperationsResponse) => void; /** - * Callback as used by {@link google.longrunning.Operations#getOperation}. + * Callback as used by {@link google.longrunning.Operations|getOperation}. * @param error Error, if any * @param [response] Operation */ type GetOperationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; /** - * Callback as used by {@link google.longrunning.Operations#deleteOperation}. + * Callback as used by {@link google.longrunning.Operations|deleteOperation}. * @param error Error, if any * @param [response] Empty */ type DeleteOperationCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; /** - * Callback as used by {@link google.longrunning.Operations#cancelOperation}. + * Callback as used by {@link google.longrunning.Operations|cancelOperation}. * @param error Error, if any * @param [response] Empty */ type CancelOperationCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; /** - * Callback as used by {@link google.longrunning.Operations#waitOperation}. + * Callback as used by {@link google.longrunning.Operations|waitOperation}. * @param error Error, if any * @param [response] Operation */ @@ -25919,6 +27716,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Operation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a GetOperationRequest. */ @@ -26009,6 +27813,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a ListOperationsRequest. */ @@ -26117,6 +27928,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListOperationsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a ListOperationsResponse. */ @@ -26213,6 +28031,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListOperationsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a CancelOperationRequest. */ @@ -26303,6 +28128,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CancelOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a DeleteOperationRequest. */ @@ -26393,6 +28225,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a WaitOperationRequest. */ @@ -26489,6 +28328,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for WaitOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of an OperationInfo. */ @@ -26585,6 +28431,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OperationInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } } @@ -26691,6 +28544,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Status + * @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-cloud-securitycenter/protos/protos.js b/packages/google-cloud-securitycenter/protos/protos.js index 3d8284443c5..67afe0c8b02 100644 --- a/packages/google-cloud-securitycenter/protos/protos.js +++ b/packages/google-cloud-securitycenter/protos/protos.js @@ -213,24 +213,30 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.principalEmail = reader.string(); - break; - case 2: - message.callerIp = reader.string(); - break; - case 3: - message.callerIpGeo = $root.google.cloud.securitycenter.v1.Geolocation.decode(reader, reader.uint32()); - break; - case 4: - message.userAgentFamily = reader.string(); - break; - case 5: - message.serviceName = reader.string(); - break; - case 6: - message.methodName = reader.string(); - break; + case 1: { + message.principalEmail = reader.string(); + break; + } + case 2: { + message.callerIp = reader.string(); + break; + } + case 3: { + message.callerIpGeo = $root.google.cloud.securitycenter.v1.Geolocation.decode(reader, reader.uint32()); + break; + } + case 4: { + message.userAgentFamily = reader.string(); + break; + } + case 5: { + message.serviceName = reader.string(); + break; + } + case 6: { + message.methodName = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -366,6 +372,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for Access + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.Access + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Access.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.Access"; + }; + return Access; })(); @@ -461,9 +482,10 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.regionCode = reader.string(); - break; + case 1: { + message.regionCode = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -553,6 +575,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for Geolocation + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.Geolocation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Geolocation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.Geolocation"; + }; + return Geolocation; })(); @@ -729,49 +766,57 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.securityCenterProperties = $root.google.cloud.securitycenter.v1.Asset.SecurityCenterProperties.decode(reader, reader.uint32()); - break; - case 7: - if (message.resourceProperties === $util.emptyObject) - message.resourceProperties = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = null; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = $root.google.protobuf.Value.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag2 & 7); - break; + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.securityCenterProperties = $root.google.cloud.securitycenter.v1.Asset.SecurityCenterProperties.decode(reader, reader.uint32()); + break; + } + case 7: { + if (message.resourceProperties === $util.emptyObject) + message.resourceProperties = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.protobuf.Value.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } } + message.resourceProperties[key] = value; + break; + } + case 8: { + message.securityMarks = $root.google.cloud.securitycenter.v1.SecurityMarks.decode(reader, reader.uint32()); + break; + } + case 9: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 10: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 11: { + message.iamPolicy = $root.google.cloud.securitycenter.v1.Asset.IamPolicy.decode(reader, reader.uint32()); + break; + } + case 13: { + message.canonicalName = reader.string(); + break; } - message.resourceProperties[key] = value; - break; - case 8: - message.securityMarks = $root.google.cloud.securitycenter.v1.SecurityMarks.decode(reader, reader.uint32()); - break; - case 9: - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 10: - message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 11: - message.iamPolicy = $root.google.cloud.securitycenter.v1.Asset.IamPolicy.decode(reader, reader.uint32()); - break; - case 13: - message.canonicalName = reader.string(); - break; default: reader.skipType(tag & 7); break; @@ -963,6 +1008,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for Asset + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.Asset + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Asset.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.Asset"; + }; + Asset.SecurityCenterProperties = (function() { /** @@ -1147,37 +1207,46 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.resourceName = reader.string(); - break; - case 2: - message.resourceType = reader.string(); - break; - case 3: - message.resourceParent = reader.string(); - break; - case 4: - message.resourceProject = reader.string(); - break; - case 5: - if (!(message.resourceOwners && message.resourceOwners.length)) - message.resourceOwners = []; - message.resourceOwners.push(reader.string()); - break; - case 6: - message.resourceDisplayName = reader.string(); - break; - case 7: - message.resourceParentDisplayName = reader.string(); - break; - case 8: - message.resourceProjectDisplayName = reader.string(); - break; - case 10: - if (!(message.folders && message.folders.length)) - message.folders = []; - message.folders.push($root.google.cloud.securitycenter.v1.Folder.decode(reader, reader.uint32())); - break; + case 1: { + message.resourceName = reader.string(); + break; + } + case 2: { + message.resourceType = reader.string(); + break; + } + case 3: { + message.resourceParent = reader.string(); + break; + } + case 4: { + message.resourceProject = reader.string(); + break; + } + case 5: { + if (!(message.resourceOwners && message.resourceOwners.length)) + message.resourceOwners = []; + message.resourceOwners.push(reader.string()); + break; + } + case 6: { + message.resourceDisplayName = reader.string(); + break; + } + case 7: { + message.resourceParentDisplayName = reader.string(); + break; + } + case 8: { + message.resourceProjectDisplayName = reader.string(); + break; + } + case 10: { + if (!(message.folders && message.folders.length)) + message.folders = []; + message.folders.push($root.google.cloud.securitycenter.v1.Folder.decode(reader, reader.uint32())); + break; + } default: reader.skipType(tag & 7); break; @@ -1363,6 +1432,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for SecurityCenterProperties + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.Asset.SecurityCenterProperties + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SecurityCenterProperties.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.Asset.SecurityCenterProperties"; + }; + return SecurityCenterProperties; })(); @@ -1458,9 +1542,10 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.policyBlob = reader.string(); - break; + case 1: { + message.policyBlob = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -1550,6 +1635,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for IamPolicy + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.Asset.IamPolicy + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + IamPolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.Asset.IamPolicy"; + }; + return IamPolicy; })(); @@ -1659,12 +1759,14 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.resourceFolder = reader.string(); - break; - case 2: - message.resourceFolderDisplayName = reader.string(); - break; + case 1: { + message.resourceFolder = reader.string(); + break; + } + case 2: { + message.resourceFolderDisplayName = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -1763,6 +1865,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for Folder + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.Folder + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Folder.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.Folder"; + }; + return Folder; })(); @@ -1882,34 +1999,37 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - if (message.marks === $util.emptyObject) - message.marks = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (message.marks === $util.emptyObject) + message.marks = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } } + message.marks[key] = value; + break; + } + case 3: { + message.canonicalName = reader.string(); + break; } - message.marks[key] = value; - break; - case 3: - message.canonicalName = reader.string(); - break; default: reader.skipType(tag & 7); break; @@ -2031,6 +2151,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for SecurityMarks + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.SecurityMarks + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SecurityMarks.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.SecurityMarks"; + }; + return SecurityMarks; })(); @@ -2203,30 +2338,38 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.description = reader.string(); - break; - case 3: - message.filter = reader.string(); - break; - case 4: - message.dataset = reader.string(); - break; - case 5: - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 6: - message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 7: - message.mostRecentEditor = reader.string(); - break; - case 8: - message.principal = reader.string(); - break; + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.description = reader.string(); + break; + } + case 3: { + message.filter = reader.string(); + break; + } + case 4: { + message.dataset = reader.string(); + break; + } + case 5: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 6: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 7: { + message.mostRecentEditor = reader.string(); + break; + } + case 8: { + message.principal = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -2383,6 +2526,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for BigQueryExport + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.BigQueryExport + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BigQueryExport.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.BigQueryExport"; + }; + return BigQueryExport; })(); @@ -2502,17 +2660,20 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.standard = reader.string(); - break; - case 2: - message.version = reader.string(); - break; - case 3: - if (!(message.ids && message.ids.length)) - message.ids = []; - message.ids.push(reader.string()); - break; + case 1: { + message.standard = reader.string(); + break; + } + case 2: { + message.version = reader.string(); + break; + } + case 3: { + if (!(message.ids && message.ids.length)) + message.ids = []; + message.ids.push(reader.string()); + break; + } default: reader.skipType(tag & 7); break; @@ -2632,6 +2793,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for Compliance + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.Compliance + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Compliance.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.Compliance"; + }; + return Compliance; })(); @@ -2771,21 +2947,26 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.destinationIp = reader.string(); - break; - case 2: - message.destinationPort = reader.int32(); - break; - case 3: - message.sourceIp = reader.string(); - break; - case 4: - message.sourcePort = reader.int32(); - break; - case 5: - message.protocol = reader.int32(); - break; + case 1: { + message.destinationIp = reader.string(); + break; + } + case 2: { + message.destinationPort = reader.int32(); + break; + } + case 3: { + message.sourceIp = reader.string(); + break; + } + case 4: { + message.sourcePort = reader.int32(); + break; + } + case 5: { + message.protocol = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -2941,6 +3122,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for Connection + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.Connection + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Connection.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.Connection"; + }; + /** * Protocol enum. * @name google.cloud.securitycenter.v1.Connection.Protocol @@ -3060,11 +3256,12 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - if (!(message.contacts && message.contacts.length)) - message.contacts = []; - message.contacts.push($root.google.cloud.securitycenter.v1.Contact.decode(reader, reader.uint32())); - break; + case 1: { + if (!(message.contacts && message.contacts.length)) + message.contacts = []; + message.contacts.push($root.google.cloud.securitycenter.v1.Contact.decode(reader, reader.uint32())); + break; + } default: reader.skipType(tag & 7); break; @@ -3171,6 +3368,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for ContactDetails + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.ContactDetails + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ContactDetails.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.ContactDetails"; + }; + return ContactDetails; })(); @@ -3266,9 +3478,10 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.email = reader.string(); - break; + case 1: { + message.email = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -3358,6 +3571,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for Contact + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.Contact + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Contact.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.Contact"; + }; + return Contact; })(); @@ -3488,20 +3716,24 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.uri = reader.string(); - break; - case 3: - message.imageId = reader.string(); - break; - case 4: - if (!(message.labels && message.labels.length)) - message.labels = []; - message.labels.push($root.google.cloud.securitycenter.v1.Label.decode(reader, reader.uint32())); - break; + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.uri = reader.string(); + break; + } + case 3: { + message.imageId = reader.string(); + break; + } + case 4: { + if (!(message.labels && message.labels.length)) + message.labels = []; + message.labels.push($root.google.cloud.securitycenter.v1.Label.decode(reader, reader.uint32())); + break; + } default: reader.skipType(tag & 7); break; @@ -3634,6 +3866,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for Container + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.Container + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Container.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.Container"; + }; + return Container; })(); @@ -3740,12 +3987,14 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.value = reader.string(); - break; + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.value = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -3844,6 +4093,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for Label + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.Label + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Label.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.Label"; + }; + return Label; })(); @@ -3954,16 +4218,18 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - if (!(message.sources && message.sources.length)) - message.sources = []; - message.sources.push($root.google.cloud.securitycenter.v1.ExfilResource.decode(reader, reader.uint32())); - break; - case 2: - if (!(message.targets && message.targets.length)) - message.targets = []; - message.targets.push($root.google.cloud.securitycenter.v1.ExfilResource.decode(reader, reader.uint32())); - break; + case 1: { + if (!(message.sources && message.sources.length)) + message.sources = []; + message.sources.push($root.google.cloud.securitycenter.v1.ExfilResource.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.targets && message.targets.length)) + message.targets = []; + message.targets.push($root.google.cloud.securitycenter.v1.ExfilResource.decode(reader, reader.uint32())); + break; + } default: reader.skipType(tag & 7); break; @@ -4096,6 +4362,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for Exfiltration + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.Exfiltration + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Exfiltration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.Exfiltration"; + }; + return Exfiltration; })(); @@ -4204,14 +4485,16 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - if (!(message.components && message.components.length)) - message.components = []; - message.components.push(reader.string()); - break; + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.components && message.components.length)) + message.components = []; + message.components.push(reader.string()); + break; + } default: reader.skipType(tag & 7); break; @@ -4322,6 +4605,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for ExfilResource + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.ExfilResource + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExfilResource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.ExfilResource"; + }; + return ExfilResource; })(); @@ -4463,23 +4761,28 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - if (!(message.assignees && message.assignees.length)) - message.assignees = []; - message.assignees.push(reader.string()); - break; - case 3: - message.externalUid = reader.string(); - break; - case 4: - message.status = reader.string(); - break; - case 5: - message.externalSystemUpdateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.assignees && message.assignees.length)) + message.assignees = []; + message.assignees.push(reader.string()); + break; + } + case 3: { + message.externalUid = reader.string(); + break; + } + case 4: { + message.status = reader.string(); + break; + } + case 5: { + message.externalSystemUpdateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -4620,6 +4923,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for ExternalSystem + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.ExternalSystem + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExternalSystem.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.ExternalSystem"; + }; + return ExternalSystem; })(); @@ -4770,24 +5088,30 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.path = reader.string(); - break; - case 2: - message.size = reader.int64(); - break; - case 3: - message.sha256 = reader.string(); - break; - case 4: - message.hashedSize = reader.int64(); - break; - case 5: - message.partiallyHashed = reader.bool(); - break; - case 6: - message.contents = reader.string(); - break; + case 1: { + message.path = reader.string(); + break; + } + case 2: { + message.size = reader.int64(); + break; + } + case 3: { + message.sha256 = reader.string(); + break; + } + case 4: { + message.hashedSize = reader.int64(); + break; + } + case 5: { + message.partiallyHashed = reader.bool(); + break; + } + case 6: { + message.contents = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -4946,6 +5270,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for File + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.File + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + File.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.File"; + }; + return File; })(); @@ -5393,166 +5732,197 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.parent = reader.string(); - break; - case 3: - message.resourceName = reader.string(); - break; - case 4: - message.state = reader.int32(); - break; - case 5: - message.category = reader.string(); - break; - case 6: - message.externalUri = reader.string(); - break; - case 7: - if (message.sourceProperties === $util.emptyObject) - message.sourceProperties = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = null; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = $root.google.protobuf.Value.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag2 & 7); - break; + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.parent = reader.string(); + break; + } + case 3: { + message.resourceName = reader.string(); + break; + } + case 4: { + message.state = reader.int32(); + break; + } + case 5: { + message.category = reader.string(); + break; + } + case 6: { + message.externalUri = reader.string(); + break; + } + case 7: { + if (message.sourceProperties === $util.emptyObject) + message.sourceProperties = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.protobuf.Value.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } } + message.sourceProperties[key] = value; + break; } - message.sourceProperties[key] = value; - break; - case 8: - message.securityMarks = $root.google.cloud.securitycenter.v1.SecurityMarks.decode(reader, reader.uint32()); - break; - case 9: - message.eventTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 10: - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 12: - message.severity = reader.int32(); - break; - case 14: - message.canonicalName = reader.string(); - break; - case 15: - message.mute = reader.int32(); - break; - case 17: - message.findingClass = reader.int32(); - break; - case 18: - message.indicator = $root.google.cloud.securitycenter.v1.Indicator.decode(reader, reader.uint32()); - break; - case 20: - message.vulnerability = $root.google.cloud.securitycenter.v1.Vulnerability.decode(reader, reader.uint32()); - break; - case 21: - message.muteUpdateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 22: - if (message.externalSystems === $util.emptyObject) - message.externalSystems = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = null; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = $root.google.cloud.securitycenter.v1.ExternalSystem.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag2 & 7); - break; + case 8: { + message.securityMarks = $root.google.cloud.securitycenter.v1.SecurityMarks.decode(reader, reader.uint32()); + break; + } + case 9: { + message.eventTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 10: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 12: { + message.severity = reader.int32(); + break; + } + case 14: { + message.canonicalName = reader.string(); + break; + } + case 15: { + message.mute = reader.int32(); + break; + } + case 17: { + message.findingClass = reader.int32(); + break; + } + case 18: { + message.indicator = $root.google.cloud.securitycenter.v1.Indicator.decode(reader, reader.uint32()); + break; + } + case 20: { + message.vulnerability = $root.google.cloud.securitycenter.v1.Vulnerability.decode(reader, reader.uint32()); + break; + } + case 21: { + message.muteUpdateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 22: { + if (message.externalSystems === $util.emptyObject) + message.externalSystems = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.cloud.securitycenter.v1.ExternalSystem.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } } + message.externalSystems[key] = value; + break; } - message.externalSystems[key] = value; - break; - case 25: - message.mitreAttack = $root.google.cloud.securitycenter.v1.MitreAttack.decode(reader, reader.uint32()); - break; - case 26: - message.access = $root.google.cloud.securitycenter.v1.Access.decode(reader, reader.uint32()); - break; - case 31: - if (!(message.connections && message.connections.length)) - message.connections = []; - message.connections.push($root.google.cloud.securitycenter.v1.Connection.decode(reader, reader.uint32())); - break; - case 28: - message.muteInitiator = reader.string(); - break; - case 30: - if (!(message.processes && message.processes.length)) - message.processes = []; - message.processes.push($root.google.cloud.securitycenter.v1.Process.decode(reader, reader.uint32())); - break; - case 33: - if (message.contacts === $util.emptyObject) - message.contacts = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = null; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = $root.google.cloud.securitycenter.v1.ContactDetails.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag2 & 7); - break; + case 25: { + message.mitreAttack = $root.google.cloud.securitycenter.v1.MitreAttack.decode(reader, reader.uint32()); + break; + } + case 26: { + message.access = $root.google.cloud.securitycenter.v1.Access.decode(reader, reader.uint32()); + break; + } + case 31: { + if (!(message.connections && message.connections.length)) + message.connections = []; + message.connections.push($root.google.cloud.securitycenter.v1.Connection.decode(reader, reader.uint32())); + break; + } + case 28: { + message.muteInitiator = reader.string(); + break; + } + case 30: { + if (!(message.processes && message.processes.length)) + message.processes = []; + message.processes.push($root.google.cloud.securitycenter.v1.Process.decode(reader, reader.uint32())); + break; + } + case 33: { + if (message.contacts === $util.emptyObject) + message.contacts = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.cloud.securitycenter.v1.ContactDetails.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } } + message.contacts[key] = value; + break; + } + case 34: { + if (!(message.compliances && message.compliances.length)) + message.compliances = []; + message.compliances.push($root.google.cloud.securitycenter.v1.Compliance.decode(reader, reader.uint32())); + break; + } + case 37: { + message.description = reader.string(); + break; + } + case 38: { + message.exfiltration = $root.google.cloud.securitycenter.v1.Exfiltration.decode(reader, reader.uint32()); + break; + } + case 39: { + if (!(message.iamBindings && message.iamBindings.length)) + message.iamBindings = []; + message.iamBindings.push($root.google.cloud.securitycenter.v1.IamBinding.decode(reader, reader.uint32())); + break; + } + case 40: { + message.nextSteps = reader.string(); + break; + } + case 42: { + if (!(message.containers && message.containers.length)) + message.containers = []; + message.containers.push($root.google.cloud.securitycenter.v1.Container.decode(reader, reader.uint32())); + break; + } + case 43: { + message.kubernetes = $root.google.cloud.securitycenter.v1.Kubernetes.decode(reader, reader.uint32()); + break; } - message.contacts[key] = value; - break; - case 34: - if (!(message.compliances && message.compliances.length)) - message.compliances = []; - message.compliances.push($root.google.cloud.securitycenter.v1.Compliance.decode(reader, reader.uint32())); - break; - case 37: - message.description = reader.string(); - break; - case 38: - message.exfiltration = $root.google.cloud.securitycenter.v1.Exfiltration.decode(reader, reader.uint32()); - break; - case 39: - if (!(message.iamBindings && message.iamBindings.length)) - message.iamBindings = []; - message.iamBindings.push($root.google.cloud.securitycenter.v1.IamBinding.decode(reader, reader.uint32())); - break; - case 40: - message.nextSteps = reader.string(); - break; - case 42: - if (!(message.containers && message.containers.length)) - message.containers = []; - message.containers.push($root.google.cloud.securitycenter.v1.Container.decode(reader, reader.uint32())); - break; - case 43: - message.kubernetes = $root.google.cloud.securitycenter.v1.Kubernetes.decode(reader, reader.uint32()); - break; default: reader.skipType(tag & 7); break; @@ -6179,6 +6549,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for Finding + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.Finding + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Finding.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.Finding"; + }; + /** * State enum. * @name google.cloud.securitycenter.v1.Finding.State @@ -6372,15 +6757,18 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.action = reader.int32(); - break; - case 2: - message.role = reader.string(); - break; - case 3: - message.member = reader.string(); - break; + case 1: { + message.action = reader.int32(); + break; + } + case 2: { + message.role = reader.string(); + break; + } + case 3: { + message.member = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -6505,6 +6893,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for IamBinding + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.IamBinding + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + IamBinding.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.IamBinding"; + }; + /** * Action enum. * @name google.cloud.securitycenter.v1.IamBinding.Action @@ -6657,26 +7060,30 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - if (!(message.ipAddresses && message.ipAddresses.length)) - message.ipAddresses = []; - message.ipAddresses.push(reader.string()); - break; - case 2: - if (!(message.domains && message.domains.length)) - message.domains = []; - message.domains.push(reader.string()); - break; - case 3: - if (!(message.signatures && message.signatures.length)) - message.signatures = []; - message.signatures.push($root.google.cloud.securitycenter.v1.Indicator.ProcessSignature.decode(reader, reader.uint32())); - break; - case 4: - if (!(message.uris && message.uris.length)) - message.uris = []; - message.uris.push(reader.string()); - break; + case 1: { + if (!(message.ipAddresses && message.ipAddresses.length)) + message.ipAddresses = []; + message.ipAddresses.push(reader.string()); + break; + } + case 2: { + if (!(message.domains && message.domains.length)) + message.domains = []; + message.domains.push(reader.string()); + break; + } + case 3: { + if (!(message.signatures && message.signatures.length)) + message.signatures = []; + message.signatures.push($root.google.cloud.securitycenter.v1.Indicator.ProcessSignature.decode(reader, reader.uint32())); + break; + } + case 4: { + if (!(message.uris && message.uris.length)) + message.uris = []; + message.uris.push(reader.string()); + break; + } default: reader.skipType(tag & 7); break; @@ -6844,6 +7251,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for Indicator + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.Indicator + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Indicator.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.Indicator"; + }; + Indicator.ProcessSignature = (function() { /** @@ -6961,12 +7383,14 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 6: - message.memoryHashSignature = $root.google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.decode(reader, reader.uint32()); - break; - case 7: - message.yaraRuleSignature = $root.google.cloud.securitycenter.v1.Indicator.ProcessSignature.YaraRuleSignature.decode(reader, reader.uint32()); - break; + case 6: { + message.memoryHashSignature = $root.google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.decode(reader, reader.uint32()); + break; + } + case 7: { + message.yaraRuleSignature = $root.google.cloud.securitycenter.v1.Indicator.ProcessSignature.YaraRuleSignature.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -7086,6 +7510,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for ProcessSignature + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ProcessSignature.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.Indicator.ProcessSignature"; + }; + ProcessSignature.MemoryHashSignature = (function() { /** @@ -7191,14 +7630,16 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.binaryFamily = reader.string(); - break; - case 4: - if (!(message.detections && message.detections.length)) - message.detections = []; - message.detections.push($root.google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.Detection.decode(reader, reader.uint32())); - break; + case 1: { + message.binaryFamily = reader.string(); + break; + } + case 4: { + if (!(message.detections && message.detections.length)) + message.detections = []; + message.detections.push($root.google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.Detection.decode(reader, reader.uint32())); + break; + } default: reader.skipType(tag & 7); break; @@ -7314,6 +7755,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for MemoryHashSignature + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MemoryHashSignature.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature"; + }; + MemoryHashSignature.Detection = (function() { /** @@ -7417,12 +7873,14 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 2: - message.binary = reader.string(); - break; - case 3: - message.percentPagesMatched = reader.double(); - break; + case 2: { + message.binary = reader.string(); + break; + } + case 3: { + message.percentPagesMatched = reader.double(); + break; + } default: reader.skipType(tag & 7); break; @@ -7521,6 +7979,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for Detection + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.Detection + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Detection.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.Detection"; + }; + return Detection; })(); @@ -7619,9 +8092,10 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 5: - message.yaraRule = reader.string(); - break; + case 5: { + message.yaraRule = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -7711,6 +8185,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for YaraRuleSignature + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature.YaraRuleSignature + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + YaraRuleSignature.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.Indicator.ProcessSignature.YaraRuleSignature"; + }; + return YaraRuleSignature; })(); @@ -7879,36 +8368,42 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - if (!(message.pods && message.pods.length)) - message.pods = []; - message.pods.push($root.google.cloud.securitycenter.v1.Kubernetes.Pod.decode(reader, reader.uint32())); - break; - case 2: - if (!(message.nodes && message.nodes.length)) - message.nodes = []; - message.nodes.push($root.google.cloud.securitycenter.v1.Kubernetes.Node.decode(reader, reader.uint32())); - break; - case 3: - if (!(message.nodePools && message.nodePools.length)) - message.nodePools = []; - message.nodePools.push($root.google.cloud.securitycenter.v1.Kubernetes.NodePool.decode(reader, reader.uint32())); - break; - case 4: - if (!(message.roles && message.roles.length)) - message.roles = []; - message.roles.push($root.google.cloud.securitycenter.v1.Kubernetes.Role.decode(reader, reader.uint32())); - break; - case 5: - if (!(message.bindings && message.bindings.length)) - message.bindings = []; - message.bindings.push($root.google.cloud.securitycenter.v1.Kubernetes.Binding.decode(reader, reader.uint32())); - break; - case 6: - if (!(message.accessReviews && message.accessReviews.length)) - message.accessReviews = []; - message.accessReviews.push($root.google.cloud.securitycenter.v1.Kubernetes.AccessReview.decode(reader, reader.uint32())); - break; + case 1: { + if (!(message.pods && message.pods.length)) + message.pods = []; + message.pods.push($root.google.cloud.securitycenter.v1.Kubernetes.Pod.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.nodes && message.nodes.length)) + message.nodes = []; + message.nodes.push($root.google.cloud.securitycenter.v1.Kubernetes.Node.decode(reader, reader.uint32())); + break; + } + case 3: { + if (!(message.nodePools && message.nodePools.length)) + message.nodePools = []; + message.nodePools.push($root.google.cloud.securitycenter.v1.Kubernetes.NodePool.decode(reader, reader.uint32())); + break; + } + case 4: { + if (!(message.roles && message.roles.length)) + message.roles = []; + message.roles.push($root.google.cloud.securitycenter.v1.Kubernetes.Role.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.bindings && message.bindings.length)) + message.bindings = []; + message.bindings.push($root.google.cloud.securitycenter.v1.Kubernetes.Binding.decode(reader, reader.uint32())); + break; + } + case 6: { + if (!(message.accessReviews && message.accessReviews.length)) + message.accessReviews = []; + message.accessReviews.push($root.google.cloud.securitycenter.v1.Kubernetes.AccessReview.decode(reader, reader.uint32())); + break; + } default: reader.skipType(tag & 7); break; @@ -8141,6 +8636,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for Kubernetes + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.Kubernetes + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Kubernetes.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.Kubernetes"; + }; + Kubernetes.Pod = (function() { /** @@ -8270,22 +8780,26 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.ns = reader.string(); - break; - case 2: - message.name = reader.string(); - break; - case 3: - if (!(message.labels && message.labels.length)) - message.labels = []; - message.labels.push($root.google.cloud.securitycenter.v1.Label.decode(reader, reader.uint32())); - break; - case 4: - if (!(message.containers && message.containers.length)) - message.containers = []; - message.containers.push($root.google.cloud.securitycenter.v1.Container.decode(reader, reader.uint32())); - break; + case 1: { + message.ns = reader.string(); + break; + } + case 2: { + message.name = reader.string(); + break; + } + case 3: { + if (!(message.labels && message.labels.length)) + message.labels = []; + message.labels.push($root.google.cloud.securitycenter.v1.Label.decode(reader, reader.uint32())); + break; + } + case 4: { + if (!(message.containers && message.containers.length)) + message.containers = []; + message.containers.push($root.google.cloud.securitycenter.v1.Container.decode(reader, reader.uint32())); + break; + } default: reader.skipType(tag & 7); break; @@ -8436,6 +8950,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for Pod + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.Kubernetes.Pod + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Pod.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.Kubernetes.Pod"; + }; + return Pod; })(); @@ -8531,9 +9060,10 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; + case 1: { + message.name = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -8623,6 +9153,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for Node + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.Kubernetes.Node + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Node.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.Kubernetes.Node"; + }; + return Node; })(); @@ -8731,14 +9276,16 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - if (!(message.nodes && message.nodes.length)) - message.nodes = []; - message.nodes.push($root.google.cloud.securitycenter.v1.Kubernetes.Node.decode(reader, reader.uint32())); - break; + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.nodes && message.nodes.length)) + message.nodes = []; + message.nodes.push($root.google.cloud.securitycenter.v1.Kubernetes.Node.decode(reader, reader.uint32())); + break; + } default: reader.skipType(tag & 7); break; @@ -8854,6 +9401,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for NodePool + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.Kubernetes.NodePool + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NodePool.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.Kubernetes.NodePool"; + }; + return NodePool; })(); @@ -8971,15 +9533,18 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.kind = reader.int32(); - break; - case 2: - message.ns = reader.string(); - break; - case 3: - message.name = reader.string(); - break; + case 1: { + message.kind = reader.int32(); + break; + } + case 2: { + message.ns = reader.string(); + break; + } + case 3: { + message.name = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -9104,6 +9669,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for Role + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.Kubernetes.Role + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Role.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.Kubernetes.Role"; + }; + /** * Kind enum. * @name google.cloud.securitycenter.v1.Kubernetes.Role.Kind @@ -9250,20 +9830,24 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.ns = reader.string(); - break; - case 2: - message.name = reader.string(); - break; - case 3: - message.role = $root.google.cloud.securitycenter.v1.Kubernetes.Role.decode(reader, reader.uint32()); - break; - case 4: - if (!(message.subjects && message.subjects.length)) - message.subjects = []; - message.subjects.push($root.google.cloud.securitycenter.v1.Kubernetes.Subject.decode(reader, reader.uint32())); - break; + case 1: { + message.ns = reader.string(); + break; + } + case 2: { + message.name = reader.string(); + break; + } + case 3: { + message.role = $root.google.cloud.securitycenter.v1.Kubernetes.Role.decode(reader, reader.uint32()); + break; + } + case 4: { + if (!(message.subjects && message.subjects.length)) + message.subjects = []; + message.subjects.push($root.google.cloud.securitycenter.v1.Kubernetes.Subject.decode(reader, reader.uint32())); + break; + } default: reader.skipType(tag & 7); break; @@ -9401,6 +9985,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for Binding + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.Kubernetes.Binding + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Binding.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.Kubernetes.Binding"; + }; + return Binding; })(); @@ -9518,15 +10117,18 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.kind = reader.int32(); - break; - case 2: - message.ns = reader.string(); - break; - case 3: - message.name = reader.string(); - break; + case 1: { + message.kind = reader.int32(); + break; + } + case 2: { + message.ns = reader.string(); + break; + } + case 3: { + message.name = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -9656,6 +10258,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for Subject + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.Kubernetes.Subject + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Subject.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.Kubernetes.Subject"; + }; + /** * AuthType enum. * @name google.cloud.securitycenter.v1.Kubernetes.Subject.AuthType @@ -9835,27 +10452,34 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.group = reader.string(); - break; - case 2: - message.ns = reader.string(); - break; - case 3: - message.name = reader.string(); - break; - case 4: - message.resource = reader.string(); - break; - case 5: - message.subresource = reader.string(); - break; - case 6: - message.verb = reader.string(); - break; - case 7: - message.version = reader.string(); - break; + case 1: { + message.group = reader.string(); + break; + } + case 2: { + message.ns = reader.string(); + break; + } + case 3: { + message.name = reader.string(); + break; + } + case 4: { + message.resource = reader.string(); + break; + } + case 5: { + message.subresource = reader.string(); + break; + } + case 6: { + message.verb = reader.string(); + break; + } + case 7: { + message.version = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -9994,6 +10618,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for AccessReview + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.Kubernetes.AccessReview + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AccessReview.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.Kubernetes.AccessReview"; + }; + return AccessReview; })(); @@ -10151,42 +10790,47 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.primaryTactic = reader.int32(); - break; - case 2: - if (!(message.primaryTechniques && message.primaryTechniques.length)) - message.primaryTechniques = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) + case 1: { + message.primaryTactic = reader.int32(); + break; + } + case 2: { + if (!(message.primaryTechniques && message.primaryTechniques.length)) + message.primaryTechniques = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.primaryTechniques.push(reader.int32()); + } else message.primaryTechniques.push(reader.int32()); - } else - message.primaryTechniques.push(reader.int32()); - break; - case 3: - if (!(message.additionalTactics && message.additionalTactics.length)) - message.additionalTactics = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) + break; + } + case 3: { + if (!(message.additionalTactics && message.additionalTactics.length)) + message.additionalTactics = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.additionalTactics.push(reader.int32()); + } else message.additionalTactics.push(reader.int32()); - } else - message.additionalTactics.push(reader.int32()); - break; - case 4: - if (!(message.additionalTechniques && message.additionalTechniques.length)) - message.additionalTechniques = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) + break; + } + case 4: { + if (!(message.additionalTechniques && message.additionalTechniques.length)) + message.additionalTechniques = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.additionalTechniques.push(reader.int32()); + } else message.additionalTechniques.push(reader.int32()); - } else - message.additionalTechniques.push(reader.int32()); - break; - case 5: - message.version = reader.string(); - break; + break; + } + case 5: { + message.version = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -10865,6 +11509,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for MitreAttack + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.MitreAttack + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MitreAttack.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.MitreAttack"; + }; + /** * Tactic enum. * @name google.cloud.securitycenter.v1.MitreAttack.Tactic @@ -11185,42 +11844,52 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 12: - message.name = reader.string(); - break; - case 3: - message.binary = $root.google.cloud.securitycenter.v1.File.decode(reader, reader.uint32()); - break; - case 4: - if (!(message.libraries && message.libraries.length)) - message.libraries = []; - message.libraries.push($root.google.cloud.securitycenter.v1.File.decode(reader, reader.uint32())); - break; - case 5: - message.script = $root.google.cloud.securitycenter.v1.File.decode(reader, reader.uint32()); - break; - case 6: - if (!(message.args && message.args.length)) - message.args = []; - message.args.push(reader.string()); - break; - case 7: - message.argumentsTruncated = reader.bool(); - break; - case 8: - if (!(message.envVariables && message.envVariables.length)) - message.envVariables = []; - message.envVariables.push($root.google.cloud.securitycenter.v1.EnvironmentVariable.decode(reader, reader.uint32())); - break; - case 9: - message.envVariablesTruncated = reader.bool(); - break; - case 10: - message.pid = reader.int64(); - break; - case 11: - message.parentPid = reader.int64(); - break; + case 12: { + message.name = reader.string(); + break; + } + case 3: { + message.binary = $root.google.cloud.securitycenter.v1.File.decode(reader, reader.uint32()); + break; + } + case 4: { + if (!(message.libraries && message.libraries.length)) + message.libraries = []; + message.libraries.push($root.google.cloud.securitycenter.v1.File.decode(reader, reader.uint32())); + break; + } + case 5: { + message.script = $root.google.cloud.securitycenter.v1.File.decode(reader, reader.uint32()); + break; + } + case 6: { + if (!(message.args && message.args.length)) + message.args = []; + message.args.push(reader.string()); + break; + } + case 7: { + message.argumentsTruncated = reader.bool(); + break; + } + case 8: { + if (!(message.envVariables && message.envVariables.length)) + message.envVariables = []; + message.envVariables.push($root.google.cloud.securitycenter.v1.EnvironmentVariable.decode(reader, reader.uint32())); + break; + } + case 9: { + message.envVariablesTruncated = reader.bool(); + break; + } + case 10: { + message.pid = reader.int64(); + break; + } + case 11: { + message.parentPid = reader.int64(); + break; + } default: reader.skipType(tag & 7); break; @@ -11469,6 +12138,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for Process + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.Process + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Process.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.Process"; + }; + return Process; })(); @@ -11575,12 +12259,14 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.val = reader.string(); - break; + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.val = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -11679,6 +12365,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for EnvironmentVariable + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.EnvironmentVariable + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnvironmentVariable.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.EnvironmentVariable"; + }; + return EnvironmentVariable; })(); @@ -11774,9 +12475,10 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.cve = $root.google.cloud.securitycenter.v1.Cve.decode(reader, reader.uint32()); - break; + case 1: { + message.cve = $root.google.cloud.securitycenter.v1.Cve.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -11871,6 +12573,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for Vulnerability + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.Vulnerability + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Vulnerability.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.Vulnerability"; + }; + return Vulnerability; })(); @@ -12001,20 +12718,24 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.id = reader.string(); - break; - case 2: - if (!(message.references && message.references.length)) - message.references = []; - message.references.push($root.google.cloud.securitycenter.v1.Reference.decode(reader, reader.uint32())); - break; - case 3: - message.cvssv3 = $root.google.cloud.securitycenter.v1.Cvssv3.decode(reader, reader.uint32()); - break; - case 4: - message.upstreamFixAvailable = reader.bool(); - break; + case 1: { + message.id = reader.string(); + break; + } + case 2: { + if (!(message.references && message.references.length)) + message.references = []; + message.references.push($root.google.cloud.securitycenter.v1.Reference.decode(reader, reader.uint32())); + break; + } + case 3: { + message.cvssv3 = $root.google.cloud.securitycenter.v1.Cvssv3.decode(reader, reader.uint32()); + break; + } + case 4: { + message.upstreamFixAvailable = reader.bool(); + break; + } default: reader.skipType(tag & 7); break; @@ -12152,6 +12873,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for Cve + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.Cve + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Cve.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.Cve"; + }; + return Cve; })(); @@ -12258,12 +12994,14 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.source = reader.string(); - break; - case 2: - message.uri = reader.string(); - break; + case 1: { + message.source = reader.string(); + break; + } + case 2: { + message.uri = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -12362,6 +13100,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for Reference + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.Reference + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Reference.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.Reference"; + }; + return Reference; })(); @@ -12545,33 +13298,42 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.baseScore = reader.double(); - break; - case 5: - message.attackVector = reader.int32(); - break; - case 6: - message.attackComplexity = reader.int32(); - break; - case 7: - message.privilegesRequired = reader.int32(); - break; - case 8: - message.userInteraction = reader.int32(); - break; - case 9: - message.scope = reader.int32(); - break; - case 10: - message.confidentialityImpact = reader.int32(); - break; - case 11: - message.integrityImpact = reader.int32(); - break; - case 12: - message.availabilityImpact = reader.int32(); - break; + case 1: { + message.baseScore = reader.double(); + break; + } + case 5: { + message.attackVector = reader.int32(); + break; + } + case 6: { + message.attackComplexity = reader.int32(); + break; + } + case 7: { + message.privilegesRequired = reader.int32(); + break; + } + case 8: { + message.userInteraction = reader.int32(); + break; + } + case 9: { + message.scope = reader.int32(); + break; + } + case 10: { + message.confidentialityImpact = reader.int32(); + break; + } + case 11: { + message.integrityImpact = reader.int32(); + break; + } + case 12: { + message.availabilityImpact = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -12900,6 +13662,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for Cvssv3 + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.Cvssv3 + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Cvssv3.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.Cvssv3"; + }; + /** * AttackVector enum. * @name google.cloud.securitycenter.v1.Cvssv3.AttackVector @@ -13165,27 +13942,34 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.displayName = reader.string(); - break; - case 3: - message.description = reader.string(); - break; - case 4: - message.filter = reader.string(); - break; - case 5: - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 6: - message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 7: - message.mostRecentEditor = reader.string(); - break; + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + case 3: { + message.description = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + case 5: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 6: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 7: { + message.mostRecentEditor = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -13334,6 +14118,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for MuteConfig + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.MuteConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MuteConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.MuteConfig"; + }; + return MuteConfig; })(); @@ -13487,21 +14286,26 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.description = reader.string(); - break; - case 3: - message.pubsubTopic = reader.string(); - break; - case 4: - message.serviceAccount = reader.string(); - break; - case 5: - message.streamingConfig = $root.google.cloud.securitycenter.v1.NotificationConfig.StreamingConfig.decode(reader, reader.uint32()); - break; + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.description = reader.string(); + break; + } + case 3: { + message.pubsubTopic = reader.string(); + break; + } + case 4: { + message.serviceAccount = reader.string(); + break; + } + case 5: { + message.streamingConfig = $root.google.cloud.securitycenter.v1.NotificationConfig.StreamingConfig.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -13635,6 +14439,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for NotificationConfig + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.NotificationConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NotificationConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.NotificationConfig"; + }; + NotificationConfig.StreamingConfig = (function() { /** @@ -13727,9 +14546,10 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.filter = reader.string(); - break; + case 1: { + message.filter = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -13819,6 +14639,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for StreamingConfig + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.NotificationConfig.StreamingConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StreamingConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.NotificationConfig.StreamingConfig"; + }; + return StreamingConfig; })(); @@ -13953,15 +14788,18 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.notificationConfigName = reader.string(); - break; - case 2: - message.finding = $root.google.cloud.securitycenter.v1.Finding.decode(reader, reader.uint32()); - break; - case 3: - message.resource = $root.google.cloud.securitycenter.v1.Resource.decode(reader, reader.uint32()); - break; + case 1: { + message.notificationConfigName = reader.string(); + break; + } + case 2: { + message.finding = $root.google.cloud.securitycenter.v1.Finding.decode(reader, reader.uint32()); + break; + } + case 3: { + message.resource = $root.google.cloud.securitycenter.v1.Resource.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -14084,6 +14922,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for NotificationMessage + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.NotificationMessage + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NotificationMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.NotificationMessage"; + }; + return NotificationMessage; })(); @@ -14258,32 +15111,40 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 8: - message.displayName = reader.string(); - break; - case 6: - message.type = reader.string(); - break; - case 2: - message.project = reader.string(); - break; - case 3: - message.projectDisplayName = reader.string(); - break; - case 4: - message.parent = reader.string(); - break; - case 5: - message.parentDisplayName = reader.string(); - break; - case 7: - if (!(message.folders && message.folders.length)) - message.folders = []; - message.folders.push($root.google.cloud.securitycenter.v1.Folder.decode(reader, reader.uint32())); - break; + case 1: { + message.name = reader.string(); + break; + } + case 8: { + message.displayName = reader.string(); + break; + } + case 6: { + message.type = reader.string(); + break; + } + case 2: { + message.project = reader.string(); + break; + } + case 3: { + message.projectDisplayName = reader.string(); + break; + } + case 4: { + message.parent = reader.string(); + break; + } + case 5: { + message.parentDisplayName = reader.string(); + break; + } + case 7: { + if (!(message.folders && message.folders.length)) + message.folders = []; + message.folders.push($root.google.cloud.securitycenter.v1.Folder.decode(reader, reader.uint32())); + break; + } default: reader.skipType(tag & 7); break; @@ -14448,6 +15309,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for Resource + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.Resource + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Resource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.Resource"; + }; + return Resource; })(); @@ -14565,15 +15441,18 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.enableAssetDiscovery = reader.bool(); - break; - case 3: - message.assetDiscoveryConfig = $root.google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.decode(reader, reader.uint32()); - break; + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.enableAssetDiscovery = reader.bool(); + break; + } + case 3: { + message.assetDiscoveryConfig = $root.google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -14685,6 +15564,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for OrganizationSettings + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.OrganizationSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OrganizationSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.OrganizationSettings"; + }; + OrganizationSettings.AssetDiscoveryConfig = (function() { /** @@ -14803,19 +15697,22 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - if (!(message.projectIds && message.projectIds.length)) - message.projectIds = []; - message.projectIds.push(reader.string()); - break; - case 2: - message.inclusionMode = reader.int32(); - break; - case 3: - if (!(message.folderIds && message.folderIds.length)) - message.folderIds = []; - message.folderIds.push(reader.string()); - break; + case 1: { + if (!(message.projectIds && message.projectIds.length)) + message.projectIds = []; + message.projectIds.push(reader.string()); + break; + } + case 2: { + message.inclusionMode = reader.int32(); + break; + } + case 3: { + if (!(message.folderIds && message.folderIds.length)) + message.folderIds = []; + message.folderIds.push(reader.string()); + break; + } default: reader.skipType(tag & 7); break; @@ -14965,6 +15862,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for AssetDiscoveryConfig + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AssetDiscoveryConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig"; + }; + /** * InclusionMode enum. * @name google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode @@ -15090,12 +16002,14 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.state = reader.int32(); - break; - case 2: - message.duration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; + case 1: { + message.state = reader.int32(); + break; + } + case 2: { + message.duration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -15222,6 +16136,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for RunAssetDiscoveryResponse + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RunAssetDiscoveryResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.RunAssetDiscoveryResponse"; + }; + /** * State enum. * @name google.cloud.securitycenter.v1.RunAssetDiscoveryResponse.State @@ -15276,7 +16205,7 @@ }; /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#bulkMuteFindings}. + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|bulkMuteFindings}. * @memberof google.cloud.securitycenter.v1.SecurityCenter * @typedef BulkMuteFindingsCallback * @type {function} @@ -15309,7 +16238,7 @@ */ /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#createSource}. + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|createSource}. * @memberof google.cloud.securitycenter.v1.SecurityCenter * @typedef CreateSourceCallback * @type {function} @@ -15342,7 +16271,7 @@ */ /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#createFinding}. + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|createFinding}. * @memberof google.cloud.securitycenter.v1.SecurityCenter * @typedef CreateFindingCallback * @type {function} @@ -15375,7 +16304,7 @@ */ /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#createMuteConfig}. + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|createMuteConfig}. * @memberof google.cloud.securitycenter.v1.SecurityCenter * @typedef CreateMuteConfigCallback * @type {function} @@ -15408,7 +16337,7 @@ */ /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#createNotificationConfig}. + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|createNotificationConfig}. * @memberof google.cloud.securitycenter.v1.SecurityCenter * @typedef CreateNotificationConfigCallback * @type {function} @@ -15441,7 +16370,7 @@ */ /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#deleteMuteConfig}. + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|deleteMuteConfig}. * @memberof google.cloud.securitycenter.v1.SecurityCenter * @typedef DeleteMuteConfigCallback * @type {function} @@ -15474,7 +16403,7 @@ */ /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#deleteNotificationConfig}. + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|deleteNotificationConfig}. * @memberof google.cloud.securitycenter.v1.SecurityCenter * @typedef DeleteNotificationConfigCallback * @type {function} @@ -15507,7 +16436,7 @@ */ /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#getBigQueryExport}. + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|getBigQueryExport}. * @memberof google.cloud.securitycenter.v1.SecurityCenter * @typedef GetBigQueryExportCallback * @type {function} @@ -15540,7 +16469,7 @@ */ /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#getIamPolicy}. + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|getIamPolicy}. * @memberof google.cloud.securitycenter.v1.SecurityCenter * @typedef GetIamPolicyCallback * @type {function} @@ -15573,7 +16502,7 @@ */ /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#getMuteConfig}. + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|getMuteConfig}. * @memberof google.cloud.securitycenter.v1.SecurityCenter * @typedef GetMuteConfigCallback * @type {function} @@ -15606,7 +16535,7 @@ */ /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#getNotificationConfig}. + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|getNotificationConfig}. * @memberof google.cloud.securitycenter.v1.SecurityCenter * @typedef GetNotificationConfigCallback * @type {function} @@ -15639,7 +16568,7 @@ */ /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#getOrganizationSettings}. + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|getOrganizationSettings}. * @memberof google.cloud.securitycenter.v1.SecurityCenter * @typedef GetOrganizationSettingsCallback * @type {function} @@ -15672,7 +16601,7 @@ */ /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#getSource}. + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|getSource}. * @memberof google.cloud.securitycenter.v1.SecurityCenter * @typedef GetSourceCallback * @type {function} @@ -15705,7 +16634,7 @@ */ /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#groupAssets}. + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|groupAssets}. * @memberof google.cloud.securitycenter.v1.SecurityCenter * @typedef GroupAssetsCallback * @type {function} @@ -15738,7 +16667,7 @@ */ /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#groupFindings}. + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|groupFindings}. * @memberof google.cloud.securitycenter.v1.SecurityCenter * @typedef GroupFindingsCallback * @type {function} @@ -15771,7 +16700,7 @@ */ /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#listAssets}. + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|listAssets}. * @memberof google.cloud.securitycenter.v1.SecurityCenter * @typedef ListAssetsCallback * @type {function} @@ -15804,7 +16733,7 @@ */ /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#listFindings}. + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|listFindings}. * @memberof google.cloud.securitycenter.v1.SecurityCenter * @typedef ListFindingsCallback * @type {function} @@ -15837,7 +16766,7 @@ */ /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#listMuteConfigs}. + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|listMuteConfigs}. * @memberof google.cloud.securitycenter.v1.SecurityCenter * @typedef ListMuteConfigsCallback * @type {function} @@ -15870,7 +16799,7 @@ */ /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#listNotificationConfigs}. + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|listNotificationConfigs}. * @memberof google.cloud.securitycenter.v1.SecurityCenter * @typedef ListNotificationConfigsCallback * @type {function} @@ -15903,7 +16832,7 @@ */ /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#listSources}. + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|listSources}. * @memberof google.cloud.securitycenter.v1.SecurityCenter * @typedef ListSourcesCallback * @type {function} @@ -15936,7 +16865,7 @@ */ /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#runAssetDiscovery}. + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|runAssetDiscovery}. * @memberof google.cloud.securitycenter.v1.SecurityCenter * @typedef RunAssetDiscoveryCallback * @type {function} @@ -15969,7 +16898,7 @@ */ /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#setFindingState}. + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|setFindingState}. * @memberof google.cloud.securitycenter.v1.SecurityCenter * @typedef SetFindingStateCallback * @type {function} @@ -16002,7 +16931,7 @@ */ /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#setMute}. + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|setMute}. * @memberof google.cloud.securitycenter.v1.SecurityCenter * @typedef SetMuteCallback * @type {function} @@ -16035,7 +16964,7 @@ */ /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#setIamPolicy}. + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|setIamPolicy}. * @memberof google.cloud.securitycenter.v1.SecurityCenter * @typedef SetIamPolicyCallback * @type {function} @@ -16068,7 +16997,7 @@ */ /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#testIamPermissions}. + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|testIamPermissions}. * @memberof google.cloud.securitycenter.v1.SecurityCenter * @typedef TestIamPermissionsCallback * @type {function} @@ -16101,7 +17030,7 @@ */ /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#updateExternalSystem}. + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|updateExternalSystem}. * @memberof google.cloud.securitycenter.v1.SecurityCenter * @typedef UpdateExternalSystemCallback * @type {function} @@ -16134,7 +17063,7 @@ */ /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#updateFinding}. + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|updateFinding}. * @memberof google.cloud.securitycenter.v1.SecurityCenter * @typedef UpdateFindingCallback * @type {function} @@ -16167,7 +17096,7 @@ */ /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#updateMuteConfig}. + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|updateMuteConfig}. * @memberof google.cloud.securitycenter.v1.SecurityCenter * @typedef UpdateMuteConfigCallback * @type {function} @@ -16200,7 +17129,7 @@ */ /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#updateNotificationConfig}. + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|updateNotificationConfig}. * @memberof google.cloud.securitycenter.v1.SecurityCenter * @typedef UpdateNotificationConfigCallback * @type {function} @@ -16233,7 +17162,7 @@ */ /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#updateOrganizationSettings}. + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|updateOrganizationSettings}. * @memberof google.cloud.securitycenter.v1.SecurityCenter * @typedef UpdateOrganizationSettingsCallback * @type {function} @@ -16266,7 +17195,7 @@ */ /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#updateSource}. + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|updateSource}. * @memberof google.cloud.securitycenter.v1.SecurityCenter * @typedef UpdateSourceCallback * @type {function} @@ -16299,7 +17228,7 @@ */ /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#updateSecurityMarks}. + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|updateSecurityMarks}. * @memberof google.cloud.securitycenter.v1.SecurityCenter * @typedef UpdateSecurityMarksCallback * @type {function} @@ -16332,7 +17261,7 @@ */ /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#createBigQueryExport}. + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|createBigQueryExport}. * @memberof google.cloud.securitycenter.v1.SecurityCenter * @typedef CreateBigQueryExportCallback * @type {function} @@ -16365,7 +17294,7 @@ */ /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#deleteBigQueryExport}. + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|deleteBigQueryExport}. * @memberof google.cloud.securitycenter.v1.SecurityCenter * @typedef DeleteBigQueryExportCallback * @type {function} @@ -16398,7 +17327,7 @@ */ /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#updateBigQueryExport}. + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|updateBigQueryExport}. * @memberof google.cloud.securitycenter.v1.SecurityCenter * @typedef UpdateBigQueryExportCallback * @type {function} @@ -16431,7 +17360,7 @@ */ /** - * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter#listBigQueryExports}. + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|listBigQueryExports}. * @memberof google.cloud.securitycenter.v1.SecurityCenter * @typedef ListBigQueryExportsCallback * @type {function} @@ -16580,15 +17509,18 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.parent = reader.string(); - break; - case 2: - message.filter = reader.string(); - break; - case 3: - message.muteAnnotation = reader.string(); - break; + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.filter = reader.string(); + break; + } + case 3: { + message.muteAnnotation = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -16695,6 +17627,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for BulkMuteFindingsRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.BulkMuteFindingsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BulkMuteFindingsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.BulkMuteFindingsRequest"; + }; + return BulkMuteFindingsRequest; })(); @@ -16855,6 +17802,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for BulkMuteFindingsResponse + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.BulkMuteFindingsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BulkMuteFindingsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.BulkMuteFindingsResponse"; + }; + return BulkMuteFindingsResponse; })(); @@ -16972,15 +17934,18 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.parent = reader.string(); - break; - case 2: - message.findingId = reader.string(); - break; - case 3: - message.finding = $root.google.cloud.securitycenter.v1.Finding.decode(reader, reader.uint32()); - break; + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.findingId = reader.string(); + break; + } + case 3: { + message.finding = $root.google.cloud.securitycenter.v1.Finding.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -17092,6 +18057,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for CreateFindingRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.CreateFindingRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateFindingRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.CreateFindingRequest"; + }; + return CreateFindingRequest; })(); @@ -17209,15 +18189,18 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.parent = reader.string(); - break; - case 2: - message.muteConfig = $root.google.cloud.securitycenter.v1.MuteConfig.decode(reader, reader.uint32()); - break; - case 3: - message.muteConfigId = reader.string(); - break; + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.muteConfig = $root.google.cloud.securitycenter.v1.MuteConfig.decode(reader, reader.uint32()); + break; + } + case 3: { + message.muteConfigId = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -17329,6 +18312,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for CreateMuteConfigRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.CreateMuteConfigRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateMuteConfigRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.CreateMuteConfigRequest"; + }; + return CreateMuteConfigRequest; })(); @@ -17446,15 +18444,18 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.parent = reader.string(); - break; - case 2: - message.configId = reader.string(); - break; - case 3: - message.notificationConfig = $root.google.cloud.securitycenter.v1.NotificationConfig.decode(reader, reader.uint32()); - break; + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.configId = reader.string(); + break; + } + case 3: { + message.notificationConfig = $root.google.cloud.securitycenter.v1.NotificationConfig.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -17566,6 +18567,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for CreateNotificationConfigRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.CreateNotificationConfigRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateNotificationConfigRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.CreateNotificationConfigRequest"; + }; + return CreateNotificationConfigRequest; })(); @@ -17672,12 +18688,14 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.parent = reader.string(); - break; - case 2: - message.source = $root.google.cloud.securitycenter.v1.Source.decode(reader, reader.uint32()); - break; + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.source = $root.google.cloud.securitycenter.v1.Source.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -17781,6 +18799,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for CreateSourceRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.CreateSourceRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateSourceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.CreateSourceRequest"; + }; + return CreateSourceRequest; })(); @@ -17876,9 +18909,10 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; + case 1: { + message.name = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -17968,6 +19002,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for DeleteMuteConfigRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.DeleteMuteConfigRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteMuteConfigRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.DeleteMuteConfigRequest"; + }; + return DeleteMuteConfigRequest; })(); @@ -18063,9 +19112,10 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; + case 1: { + message.name = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -18155,6 +19205,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for DeleteNotificationConfigRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.DeleteNotificationConfigRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteNotificationConfigRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.DeleteNotificationConfigRequest"; + }; + return DeleteNotificationConfigRequest; })(); @@ -18250,9 +19315,10 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; + case 1: { + message.name = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -18342,6 +19408,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for GetBigQueryExportRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.GetBigQueryExportRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetBigQueryExportRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.GetBigQueryExportRequest"; + }; + return GetBigQueryExportRequest; })(); @@ -18437,9 +19518,10 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; + case 1: { + message.name = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -18529,6 +19611,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for GetMuteConfigRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.GetMuteConfigRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetMuteConfigRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.GetMuteConfigRequest"; + }; + return GetMuteConfigRequest; })(); @@ -18624,9 +19721,10 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; + case 1: { + message.name = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -18716,6 +19814,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for GetNotificationConfigRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.GetNotificationConfigRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetNotificationConfigRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.GetNotificationConfigRequest"; + }; + return GetNotificationConfigRequest; })(); @@ -18811,9 +19924,10 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; + case 1: { + message.name = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -18903,6 +20017,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for GetOrganizationSettingsRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.GetOrganizationSettingsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetOrganizationSettingsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.GetOrganizationSettingsRequest"; + }; + return GetOrganizationSettingsRequest; })(); @@ -18998,9 +20127,10 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; + case 1: { + message.name = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -19090,6 +20220,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for GetSourceRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.GetSourceRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetSourceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.GetSourceRequest"; + }; + return GetSourceRequest; })(); @@ -19251,27 +20396,34 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.parent = reader.string(); - break; - case 2: - message.filter = reader.string(); - break; - case 3: - message.groupBy = reader.string(); - break; - case 4: - message.compareDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - case 5: - message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 7: - message.pageToken = reader.string(); - break; - case 8: - message.pageSize = reader.int32(); - break; + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.filter = reader.string(); + break; + } + case 3: { + message.groupBy = reader.string(); + break; + } + case 4: { + message.compareDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 5: { + message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 7: { + message.pageToken = reader.string(); + break; + } + case 8: { + message.pageSize = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -19420,6 +20572,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for GroupAssetsRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GroupAssetsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.GroupAssetsRequest"; + }; + return GroupAssetsRequest; })(); @@ -19550,20 +20717,24 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - if (!(message.groupByResults && message.groupByResults.length)) - message.groupByResults = []; - message.groupByResults.push($root.google.cloud.securitycenter.v1.GroupResult.decode(reader, reader.uint32())); - break; - case 2: - message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 3: - message.nextPageToken = reader.string(); - break; - case 4: - message.totalSize = reader.int32(); - break; + case 1: { + if (!(message.groupByResults && message.groupByResults.length)) + message.groupByResults = []; + message.groupByResults.push($root.google.cloud.securitycenter.v1.GroupResult.decode(reader, reader.uint32())); + break; + } + case 2: { + message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.nextPageToken = reader.string(); + break; + } + case 4: { + message.totalSize = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -19701,6 +20872,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for GroupAssetsResponse + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.GroupAssetsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GroupAssetsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.GroupAssetsResponse"; + }; + return GroupAssetsResponse; })(); @@ -19862,27 +21048,34 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.parent = reader.string(); - break; - case 2: - message.filter = reader.string(); - break; - case 3: - message.groupBy = reader.string(); - break; - case 4: - message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 5: - message.compareDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - case 7: - message.pageToken = reader.string(); - break; - case 8: - message.pageSize = reader.int32(); - break; + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.filter = reader.string(); + break; + } + case 3: { + message.groupBy = reader.string(); + break; + } + case 4: { + message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 5: { + message.compareDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 7: { + message.pageToken = reader.string(); + break; + } + case 8: { + message.pageSize = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -20031,6 +21224,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for GroupFindingsRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GroupFindingsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.GroupFindingsRequest"; + }; + return GroupFindingsRequest; })(); @@ -20161,20 +21369,24 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - if (!(message.groupByResults && message.groupByResults.length)) - message.groupByResults = []; - message.groupByResults.push($root.google.cloud.securitycenter.v1.GroupResult.decode(reader, reader.uint32())); - break; - case 2: - message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 3: - message.nextPageToken = reader.string(); - break; - case 4: - message.totalSize = reader.int32(); - break; + case 1: { + if (!(message.groupByResults && message.groupByResults.length)) + message.groupByResults = []; + message.groupByResults.push($root.google.cloud.securitycenter.v1.GroupResult.decode(reader, reader.uint32())); + break; + } + case 2: { + message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.nextPageToken = reader.string(); + break; + } + case 4: { + message.totalSize = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -20312,6 +21524,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for GroupFindingsResponse + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.GroupFindingsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GroupFindingsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.GroupFindingsResponse"; + }; + return GroupFindingsResponse; })(); @@ -20422,31 +21649,33 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - if (message.properties === $util.emptyObject) - message.properties = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = null; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = $root.google.protobuf.Value.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag2 & 7); - break; + case 1: { + if (message.properties === $util.emptyObject) + message.properties = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.protobuf.Value.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } } + message.properties[key] = value; + break; + } + case 2: { + message.count = reader.int64(); + break; } - message.properties[key] = value; - break; - case 2: - message.count = reader.int64(); - break; default: reader.skipType(tag & 7); break; @@ -20578,6 +21807,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for GroupResult + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.GroupResult + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GroupResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.GroupResult"; + }; + return GroupResult; })(); @@ -20695,15 +21939,18 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.parent = reader.string(); - break; - case 2: - message.pageSize = reader.int32(); - break; - case 3: - message.pageToken = reader.string(); - break; + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -20810,6 +22057,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for ListMuteConfigsRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.ListMuteConfigsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListMuteConfigsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.ListMuteConfigsRequest"; + }; + return ListMuteConfigsRequest; })(); @@ -20918,14 +22180,16 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - if (!(message.muteConfigs && message.muteConfigs.length)) - message.muteConfigs = []; - message.muteConfigs.push($root.google.cloud.securitycenter.v1.MuteConfig.decode(reader, reader.uint32())); - break; - case 2: - message.nextPageToken = reader.string(); - break; + case 1: { + if (!(message.muteConfigs && message.muteConfigs.length)) + message.muteConfigs = []; + message.muteConfigs.push($root.google.cloud.securitycenter.v1.MuteConfig.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -21041,6 +22305,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for ListMuteConfigsResponse + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.ListMuteConfigsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListMuteConfigsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.ListMuteConfigsResponse"; + }; + return ListMuteConfigsResponse; })(); @@ -21158,15 +22437,18 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.parent = reader.string(); - break; - case 2: - message.pageToken = reader.string(); - break; - case 3: - message.pageSize = reader.int32(); - break; + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageToken = reader.string(); + break; + } + case 3: { + message.pageSize = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -21273,6 +22555,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for ListNotificationConfigsRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.ListNotificationConfigsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListNotificationConfigsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.ListNotificationConfigsRequest"; + }; + return ListNotificationConfigsRequest; })(); @@ -21381,14 +22678,16 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - if (!(message.notificationConfigs && message.notificationConfigs.length)) - message.notificationConfigs = []; - message.notificationConfigs.push($root.google.cloud.securitycenter.v1.NotificationConfig.decode(reader, reader.uint32())); - break; - case 2: - message.nextPageToken = reader.string(); - break; + case 1: { + if (!(message.notificationConfigs && message.notificationConfigs.length)) + message.notificationConfigs = []; + message.notificationConfigs.push($root.google.cloud.securitycenter.v1.NotificationConfig.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -21504,6 +22803,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for ListNotificationConfigsResponse + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.ListNotificationConfigsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListNotificationConfigsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.ListNotificationConfigsResponse"; + }; + return ListNotificationConfigsResponse; })(); @@ -21621,15 +22935,18 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.parent = reader.string(); - break; - case 2: - message.pageToken = reader.string(); - break; - case 7: - message.pageSize = reader.int32(); - break; + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageToken = reader.string(); + break; + } + case 7: { + message.pageSize = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -21736,6 +23053,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for ListSourcesRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.ListSourcesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListSourcesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.ListSourcesRequest"; + }; + return ListSourcesRequest; })(); @@ -21844,14 +23176,16 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - if (!(message.sources && message.sources.length)) - message.sources = []; - message.sources.push($root.google.cloud.securitycenter.v1.Source.decode(reader, reader.uint32())); - break; - case 2: - message.nextPageToken = reader.string(); - break; + case 1: { + if (!(message.sources && message.sources.length)) + message.sources = []; + message.sources.push($root.google.cloud.securitycenter.v1.Source.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -21967,6 +23301,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for ListSourcesResponse + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.ListSourcesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListSourcesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.ListSourcesResponse"; + }; + return ListSourcesResponse; })(); @@ -22139,30 +23488,38 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.parent = reader.string(); - break; - case 2: - message.filter = reader.string(); - break; - case 3: - message.orderBy = reader.string(); - break; - case 4: - message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 5: - message.compareDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - case 7: - message.fieldMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - break; - case 8: - message.pageToken = reader.string(); - break; - case 9: - message.pageSize = reader.int32(); - break; + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.filter = reader.string(); + break; + } + case 3: { + message.orderBy = reader.string(); + break; + } + case 4: { + message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 5: { + message.compareDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 7: { + message.fieldMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 8: { + message.pageToken = reader.string(); + break; + } + case 9: { + message.pageSize = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -22324,6 +23681,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for ListAssetsRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.ListAssetsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListAssetsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.ListAssetsRequest"; + }; + return ListAssetsRequest; })(); @@ -22454,20 +23826,24 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - if (!(message.listAssetsResults && message.listAssetsResults.length)) - message.listAssetsResults = []; - message.listAssetsResults.push($root.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult.decode(reader, reader.uint32())); - break; - case 2: - message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 3: - message.nextPageToken = reader.string(); - break; - case 4: - message.totalSize = reader.int32(); - break; + case 1: { + if (!(message.listAssetsResults && message.listAssetsResults.length)) + message.listAssetsResults = []; + message.listAssetsResults.push($root.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult.decode(reader, reader.uint32())); + break; + } + case 2: { + message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.nextPageToken = reader.string(); + break; + } + case 4: { + message.totalSize = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -22605,6 +23981,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for ListAssetsResponse + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.ListAssetsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListAssetsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.ListAssetsResponse"; + }; + ListAssetsResponse.ListAssetsResult = (function() { /** @@ -22708,12 +24099,14 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.asset = $root.google.cloud.securitycenter.v1.Asset.decode(reader, reader.uint32()); - break; - case 2: - message.stateChange = reader.int32(); - break; + case 1: { + message.asset = $root.google.cloud.securitycenter.v1.Asset.decode(reader, reader.uint32()); + break; + } + case 2: { + message.stateChange = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -22840,6 +24233,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for ListAssetsResult + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListAssetsResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult"; + }; + /** * StateChange enum. * @name google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult.StateChange @@ -23033,30 +24441,38 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.parent = reader.string(); - break; - case 2: - message.filter = reader.string(); - break; - case 3: - message.orderBy = reader.string(); - break; - case 4: - message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 5: - message.compareDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - case 7: - message.fieldMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - break; - case 8: - message.pageToken = reader.string(); - break; - case 9: - message.pageSize = reader.int32(); - break; + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.filter = reader.string(); + break; + } + case 3: { + message.orderBy = reader.string(); + break; + } + case 4: { + message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 5: { + message.compareDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 7: { + message.fieldMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 8: { + message.pageToken = reader.string(); + break; + } + case 9: { + message.pageSize = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -23218,6 +24634,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for ListFindingsRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.ListFindingsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListFindingsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.ListFindingsRequest"; + }; + return ListFindingsRequest; })(); @@ -23348,20 +24779,24 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - if (!(message.listFindingsResults && message.listFindingsResults.length)) - message.listFindingsResults = []; - message.listFindingsResults.push($root.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.decode(reader, reader.uint32())); - break; - case 2: - message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 3: - message.nextPageToken = reader.string(); - break; - case 4: - message.totalSize = reader.int32(); - break; + case 1: { + if (!(message.listFindingsResults && message.listFindingsResults.length)) + message.listFindingsResults = []; + message.listFindingsResults.push($root.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.decode(reader, reader.uint32())); + break; + } + case 2: { + message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.nextPageToken = reader.string(); + break; + } + case 4: { + message.totalSize = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -23499,6 +24934,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for ListFindingsResponse + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.ListFindingsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListFindingsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.ListFindingsResponse"; + }; + ListFindingsResponse.ListFindingsResult = (function() { /** @@ -23613,15 +25063,18 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.finding = $root.google.cloud.securitycenter.v1.Finding.decode(reader, reader.uint32()); - break; - case 2: - message.stateChange = reader.int32(); - break; - case 3: - message.resource = $root.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource.decode(reader, reader.uint32()); - break; + case 1: { + message.finding = $root.google.cloud.securitycenter.v1.Finding.decode(reader, reader.uint32()); + break; + } + case 2: { + message.stateChange = reader.int32(); + break; + } + case 3: { + message.resource = $root.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -23766,6 +25219,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for ListFindingsResult + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListFindingsResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult"; + }; + /** * StateChange enum. * @name google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.StateChange @@ -23957,32 +25425,40 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 8: - message.displayName = reader.string(); - break; - case 6: - message.type = reader.string(); - break; - case 2: - message.projectName = reader.string(); - break; - case 3: - message.projectDisplayName = reader.string(); - break; - case 4: - message.parentName = reader.string(); - break; - case 5: - message.parentDisplayName = reader.string(); - break; - case 7: - if (!(message.folders && message.folders.length)) - message.folders = []; - message.folders.push($root.google.cloud.securitycenter.v1.Folder.decode(reader, reader.uint32())); - break; + case 1: { + message.name = reader.string(); + break; + } + case 8: { + message.displayName = reader.string(); + break; + } + case 6: { + message.type = reader.string(); + break; + } + case 2: { + message.projectName = reader.string(); + break; + } + case 3: { + message.projectDisplayName = reader.string(); + break; + } + case 4: { + message.parentName = reader.string(); + break; + } + case 5: { + message.parentDisplayName = reader.string(); + break; + } + case 7: { + if (!(message.folders && message.folders.length)) + message.folders = []; + message.folders.push($root.google.cloud.securitycenter.v1.Folder.decode(reader, reader.uint32())); + break; + } default: reader.skipType(tag & 7); break; @@ -24147,6 +25623,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for Resource + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Resource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource"; + }; + return Resource; })(); @@ -24270,15 +25761,18 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.state = reader.int32(); - break; - case 3: - message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.state = reader.int32(); + break; + } + case 3: { + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -24408,6 +25902,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for SetFindingStateRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.SetFindingStateRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SetFindingStateRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.SetFindingStateRequest"; + }; + return SetFindingStateRequest; })(); @@ -24514,12 +26023,14 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.mute = reader.int32(); - break; + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.mute = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -24641,6 +26152,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for SetMuteRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.SetMuteRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SetMuteRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.SetMuteRequest"; + }; + return SetMuteRequest; })(); @@ -24736,9 +26262,10 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.parent = reader.string(); - break; + case 1: { + message.parent = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -24828,6 +26355,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for RunAssetDiscoveryRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RunAssetDiscoveryRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.RunAssetDiscoveryRequest"; + }; + return RunAssetDiscoveryRequest; })(); @@ -24934,12 +26476,14 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.externalSystem = $root.google.cloud.securitycenter.v1.ExternalSystem.decode(reader, reader.uint32()); - break; - case 2: - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - break; + case 1: { + message.externalSystem = $root.google.cloud.securitycenter.v1.ExternalSystem.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -25048,6 +26592,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for UpdateExternalSystemRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.UpdateExternalSystemRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateExternalSystemRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.UpdateExternalSystemRequest"; + }; + return UpdateExternalSystemRequest; })(); @@ -25154,12 +26713,14 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.finding = $root.google.cloud.securitycenter.v1.Finding.decode(reader, reader.uint32()); - break; - case 2: - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - break; + case 1: { + message.finding = $root.google.cloud.securitycenter.v1.Finding.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -25268,6 +26829,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for UpdateFindingRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.UpdateFindingRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateFindingRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.UpdateFindingRequest"; + }; + return UpdateFindingRequest; })(); @@ -25374,12 +26950,14 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.muteConfig = $root.google.cloud.securitycenter.v1.MuteConfig.decode(reader, reader.uint32()); - break; - case 2: - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - break; + case 1: { + message.muteConfig = $root.google.cloud.securitycenter.v1.MuteConfig.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -25488,6 +27066,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for UpdateMuteConfigRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.UpdateMuteConfigRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateMuteConfigRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.UpdateMuteConfigRequest"; + }; + return UpdateMuteConfigRequest; })(); @@ -25594,12 +27187,14 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.notificationConfig = $root.google.cloud.securitycenter.v1.NotificationConfig.decode(reader, reader.uint32()); - break; - case 2: - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - break; + case 1: { + message.notificationConfig = $root.google.cloud.securitycenter.v1.NotificationConfig.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -25708,6 +27303,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for UpdateNotificationConfigRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.UpdateNotificationConfigRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateNotificationConfigRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.UpdateNotificationConfigRequest"; + }; + return UpdateNotificationConfigRequest; })(); @@ -25814,12 +27424,14 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.organizationSettings = $root.google.cloud.securitycenter.v1.OrganizationSettings.decode(reader, reader.uint32()); - break; - case 2: - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - break; + case 1: { + message.organizationSettings = $root.google.cloud.securitycenter.v1.OrganizationSettings.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -25928,6 +27540,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for UpdateOrganizationSettingsRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateOrganizationSettingsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest"; + }; + return UpdateOrganizationSettingsRequest; })(); @@ -26034,12 +27661,14 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.source = $root.google.cloud.securitycenter.v1.Source.decode(reader, reader.uint32()); - break; - case 2: - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - break; + case 1: { + message.source = $root.google.cloud.securitycenter.v1.Source.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -26148,6 +27777,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for UpdateSourceRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.UpdateSourceRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateSourceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.UpdateSourceRequest"; + }; + return UpdateSourceRequest; })(); @@ -26265,15 +27909,18 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.securityMarks = $root.google.cloud.securitycenter.v1.SecurityMarks.decode(reader, reader.uint32()); - break; - case 2: - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - break; - case 3: - message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; + case 1: { + message.securityMarks = $root.google.cloud.securitycenter.v1.SecurityMarks.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 3: { + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -26395,6 +28042,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for UpdateSecurityMarksRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.UpdateSecurityMarksRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateSecurityMarksRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.UpdateSecurityMarksRequest"; + }; + return UpdateSecurityMarksRequest; })(); @@ -26512,15 +28174,18 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.parent = reader.string(); - break; - case 2: - message.bigQueryExport = $root.google.cloud.securitycenter.v1.BigQueryExport.decode(reader, reader.uint32()); - break; - case 3: - message.bigQueryExportId = reader.string(); - break; + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.bigQueryExport = $root.google.cloud.securitycenter.v1.BigQueryExport.decode(reader, reader.uint32()); + break; + } + case 3: { + message.bigQueryExportId = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -26632,6 +28297,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for CreateBigQueryExportRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.CreateBigQueryExportRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateBigQueryExportRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.CreateBigQueryExportRequest"; + }; + return CreateBigQueryExportRequest; })(); @@ -26738,12 +28418,14 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.bigQueryExport = $root.google.cloud.securitycenter.v1.BigQueryExport.decode(reader, reader.uint32()); - break; - case 2: - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - break; + case 1: { + message.bigQueryExport = $root.google.cloud.securitycenter.v1.BigQueryExport.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -26852,6 +28534,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for UpdateBigQueryExportRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.UpdateBigQueryExportRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateBigQueryExportRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.UpdateBigQueryExportRequest"; + }; + return UpdateBigQueryExportRequest; })(); @@ -26969,15 +28666,18 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.parent = reader.string(); - break; - case 2: - message.pageSize = reader.int32(); - break; - case 3: - message.pageToken = reader.string(); - break; + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -27084,6 +28784,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for ListBigQueryExportsRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.ListBigQueryExportsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListBigQueryExportsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.ListBigQueryExportsRequest"; + }; + return ListBigQueryExportsRequest; })(); @@ -27192,14 +28907,16 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - if (!(message.bigQueryExports && message.bigQueryExports.length)) - message.bigQueryExports = []; - message.bigQueryExports.push($root.google.cloud.securitycenter.v1.BigQueryExport.decode(reader, reader.uint32())); - break; - case 2: - message.nextPageToken = reader.string(); - break; + case 1: { + if (!(message.bigQueryExports && message.bigQueryExports.length)) + message.bigQueryExports = []; + message.bigQueryExports.push($root.google.cloud.securitycenter.v1.BigQueryExport.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -27315,6 +29032,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for ListBigQueryExportsResponse + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.ListBigQueryExportsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListBigQueryExportsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.ListBigQueryExportsResponse"; + }; + return ListBigQueryExportsResponse; })(); @@ -27410,9 +29142,10 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; + case 1: { + message.name = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -27502,6 +29235,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for DeleteBigQueryExportRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.DeleteBigQueryExportRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteBigQueryExportRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.DeleteBigQueryExportRequest"; + }; + return DeleteBigQueryExportRequest; })(); @@ -27630,18 +29378,22 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.displayName = reader.string(); - break; - case 3: - message.description = reader.string(); - break; - case 14: - message.canonicalName = reader.string(); - break; + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + case 3: { + message.description = reader.string(); + break; + } + case 14: { + message.canonicalName = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -27756,6 +29508,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for Source + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.Source + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Source.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.Source"; + }; + return Source; })(); @@ -27922,43 +29689,49 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.securityCenterProperties = $root.google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties.decode(reader, reader.uint32()); - break; - case 7: - if (message.resourceProperties === $util.emptyObject) - message.resourceProperties = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = null; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = $root.google.protobuf.Value.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag2 & 7); - break; + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.securityCenterProperties = $root.google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties.decode(reader, reader.uint32()); + break; + } + case 7: { + if (message.resourceProperties === $util.emptyObject) + message.resourceProperties = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.protobuf.Value.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } } + message.resourceProperties[key] = value; + break; + } + case 8: { + message.securityMarks = $root.google.cloud.securitycenter.v1beta1.SecurityMarks.decode(reader, reader.uint32()); + break; + } + case 9: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 10: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; } - message.resourceProperties[key] = value; - break; - case 8: - message.securityMarks = $root.google.cloud.securitycenter.v1beta1.SecurityMarks.decode(reader, reader.uint32()); - break; - case 9: - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 10: - message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; default: reader.skipType(tag & 7); break; @@ -28129,6 +29902,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for Asset + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1beta1.Asset + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Asset.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1beta1.Asset"; + }; + Asset.SecurityCenterProperties = (function() { /** @@ -28267,23 +30055,28 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.resourceName = reader.string(); - break; - case 2: - message.resourceType = reader.string(); - break; - case 3: - message.resourceParent = reader.string(); - break; - case 4: - message.resourceProject = reader.string(); - break; - case 5: - if (!(message.resourceOwners && message.resourceOwners.length)) - message.resourceOwners = []; - message.resourceOwners.push(reader.string()); - break; + case 1: { + message.resourceName = reader.string(); + break; + } + case 2: { + message.resourceType = reader.string(); + break; + } + case 3: { + message.resourceParent = reader.string(); + break; + } + case 4: { + message.resourceProject = reader.string(); + break; + } + case 5: { + if (!(message.resourceOwners && message.resourceOwners.length)) + message.resourceOwners = []; + message.resourceOwners.push(reader.string()); + break; + } default: reader.skipType(tag & 7); break; @@ -28419,6 +30212,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for SecurityCenterProperties + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SecurityCenterProperties.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties"; + }; + return SecurityCenterProperties; })(); @@ -28530,31 +30338,33 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - if (message.marks === $util.emptyObject) - message.marks = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (message.marks === $util.emptyObject) + message.marks = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } } + message.marks[key] = value; + break; } - message.marks[key] = value; - break; default: reader.skipType(tag & 7); break; @@ -28667,6 +30477,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for SecurityMarks + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1beta1.SecurityMarks + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SecurityMarks.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1beta1.SecurityMarks"; + }; + return SecurityMarks; })(); @@ -28865,55 +30690,65 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.parent = reader.string(); - break; - case 3: - message.resourceName = reader.string(); - break; - case 4: - message.state = reader.int32(); - break; - case 5: - message.category = reader.string(); - break; - case 6: - message.externalUri = reader.string(); - break; - case 7: - if (message.sourceProperties === $util.emptyObject) - message.sourceProperties = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = null; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = $root.google.protobuf.Value.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag2 & 7); - break; + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.parent = reader.string(); + break; + } + case 3: { + message.resourceName = reader.string(); + break; + } + case 4: { + message.state = reader.int32(); + break; + } + case 5: { + message.category = reader.string(); + break; + } + case 6: { + message.externalUri = reader.string(); + break; + } + case 7: { + if (message.sourceProperties === $util.emptyObject) + message.sourceProperties = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.protobuf.Value.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } } + message.sourceProperties[key] = value; + break; + } + case 8: { + message.securityMarks = $root.google.cloud.securitycenter.v1beta1.SecurityMarks.decode(reader, reader.uint32()); + break; + } + case 9: { + message.eventTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 10: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; } - message.sourceProperties[key] = value; - break; - case 8: - message.securityMarks = $root.google.cloud.securitycenter.v1beta1.SecurityMarks.decode(reader, reader.uint32()); - break; - case 9: - message.eventTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 10: - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; default: reader.skipType(tag & 7); break; @@ -29129,6 +30964,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for Finding + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1beta1.Finding + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Finding.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1beta1.Finding"; + }; + /** * State enum. * @name google.cloud.securitycenter.v1beta1.Finding.State @@ -29262,15 +31112,18 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.enableAssetDiscovery = reader.bool(); - break; - case 3: - message.assetDiscoveryConfig = $root.google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig.decode(reader, reader.uint32()); - break; + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.enableAssetDiscovery = reader.bool(); + break; + } + case 3: { + message.assetDiscoveryConfig = $root.google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -29382,6 +31235,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for OrganizationSettings + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1beta1.OrganizationSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OrganizationSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1beta1.OrganizationSettings"; + }; + OrganizationSettings.AssetDiscoveryConfig = (function() { /** @@ -29487,14 +31355,16 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - if (!(message.projectIds && message.projectIds.length)) - message.projectIds = []; - message.projectIds.push(reader.string()); - break; - case 2: - message.inclusionMode = reader.int32(); - break; + case 1: { + if (!(message.projectIds && message.projectIds.length)) + message.projectIds = []; + message.projectIds.push(reader.string()); + break; + } + case 2: { + message.inclusionMode = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -29623,6 +31493,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for AssetDiscoveryConfig + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AssetDiscoveryConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig"; + }; + /** * InclusionMode enum. * @name google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode @@ -29748,12 +31633,14 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.state = reader.int32(); - break; - case 2: - message.duration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; + case 1: { + message.state = reader.int32(); + break; + } + case 2: { + message.duration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -29880,6 +31767,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for RunAssetDiscoveryResponse + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1beta1.RunAssetDiscoveryResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RunAssetDiscoveryResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1beta1.RunAssetDiscoveryResponse"; + }; + /** * State enum. * @name google.cloud.securitycenter.v1beta1.RunAssetDiscoveryResponse.State @@ -29934,7 +31836,7 @@ }; /** - * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter#createSource}. + * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter|createSource}. * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter * @typedef CreateSourceCallback * @type {function} @@ -29967,7 +31869,7 @@ */ /** - * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter#createFinding}. + * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter|createFinding}. * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter * @typedef CreateFindingCallback * @type {function} @@ -30000,7 +31902,7 @@ */ /** - * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter#getIamPolicy}. + * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter|getIamPolicy}. * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter * @typedef GetIamPolicyCallback * @type {function} @@ -30033,7 +31935,7 @@ */ /** - * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter#getOrganizationSettings}. + * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter|getOrganizationSettings}. * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter * @typedef GetOrganizationSettingsCallback * @type {function} @@ -30066,7 +31968,7 @@ */ /** - * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter#getSource}. + * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter|getSource}. * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter * @typedef GetSourceCallback * @type {function} @@ -30099,7 +32001,7 @@ */ /** - * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter#groupAssets}. + * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter|groupAssets}. * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter * @typedef GroupAssetsCallback * @type {function} @@ -30132,7 +32034,7 @@ */ /** - * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter#groupFindings}. + * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter|groupFindings}. * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter * @typedef GroupFindingsCallback * @type {function} @@ -30165,7 +32067,7 @@ */ /** - * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter#listAssets}. + * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter|listAssets}. * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter * @typedef ListAssetsCallback * @type {function} @@ -30198,7 +32100,7 @@ */ /** - * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter#listFindings}. + * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter|listFindings}. * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter * @typedef ListFindingsCallback * @type {function} @@ -30231,7 +32133,7 @@ */ /** - * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter#listSources}. + * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter|listSources}. * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter * @typedef ListSourcesCallback * @type {function} @@ -30264,7 +32166,7 @@ */ /** - * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter#runAssetDiscovery}. + * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter|runAssetDiscovery}. * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter * @typedef RunAssetDiscoveryCallback * @type {function} @@ -30297,7 +32199,7 @@ */ /** - * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter#setFindingState}. + * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter|setFindingState}. * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter * @typedef SetFindingStateCallback * @type {function} @@ -30330,7 +32232,7 @@ */ /** - * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter#setIamPolicy}. + * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter|setIamPolicy}. * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter * @typedef SetIamPolicyCallback * @type {function} @@ -30363,7 +32265,7 @@ */ /** - * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter#testIamPermissions}. + * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter|testIamPermissions}. * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter * @typedef TestIamPermissionsCallback * @type {function} @@ -30396,7 +32298,7 @@ */ /** - * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter#updateFinding}. + * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter|updateFinding}. * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter * @typedef UpdateFindingCallback * @type {function} @@ -30429,7 +32331,7 @@ */ /** - * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter#updateOrganizationSettings}. + * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter|updateOrganizationSettings}. * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter * @typedef UpdateOrganizationSettingsCallback * @type {function} @@ -30462,7 +32364,7 @@ */ /** - * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter#updateSource}. + * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter|updateSource}. * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter * @typedef UpdateSourceCallback * @type {function} @@ -30495,7 +32397,7 @@ */ /** - * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter#updateSecurityMarks}. + * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter|updateSecurityMarks}. * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter * @typedef UpdateSecurityMarksCallback * @type {function} @@ -30644,15 +32546,18 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.parent = reader.string(); - break; - case 2: - message.findingId = reader.string(); - break; - case 3: - message.finding = $root.google.cloud.securitycenter.v1beta1.Finding.decode(reader, reader.uint32()); - break; + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.findingId = reader.string(); + break; + } + case 3: { + message.finding = $root.google.cloud.securitycenter.v1beta1.Finding.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -30764,6 +32669,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for CreateFindingRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1beta1.CreateFindingRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateFindingRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1beta1.CreateFindingRequest"; + }; + return CreateFindingRequest; })(); @@ -30870,12 +32790,14 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.parent = reader.string(); - break; - case 2: - message.source = $root.google.cloud.securitycenter.v1beta1.Source.decode(reader, reader.uint32()); - break; + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.source = $root.google.cloud.securitycenter.v1beta1.Source.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -30979,6 +32901,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for CreateSourceRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1beta1.CreateSourceRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateSourceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1beta1.CreateSourceRequest"; + }; + return CreateSourceRequest; })(); @@ -31074,9 +33011,10 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; + case 1: { + message.name = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -31166,6 +33104,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for GetOrganizationSettingsRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetOrganizationSettingsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest"; + }; + return GetOrganizationSettingsRequest; })(); @@ -31261,9 +33214,10 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; + case 1: { + message.name = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -31353,6 +33307,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for GetSourceRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1beta1.GetSourceRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetSourceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1beta1.GetSourceRequest"; + }; + return GetSourceRequest; })(); @@ -31514,27 +33483,34 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.parent = reader.string(); - break; - case 2: - message.filter = reader.string(); - break; - case 3: - message.groupBy = reader.string(); - break; - case 4: - message.compareDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - case 5: - message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 7: - message.pageToken = reader.string(); - break; - case 8: - message.pageSize = reader.int32(); - break; + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.filter = reader.string(); + break; + } + case 3: { + message.groupBy = reader.string(); + break; + } + case 4: { + message.compareDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 5: { + message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 7: { + message.pageToken = reader.string(); + break; + } + case 8: { + message.pageSize = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -31683,6 +33659,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for GroupAssetsRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1beta1.GroupAssetsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GroupAssetsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1beta1.GroupAssetsRequest"; + }; + return GroupAssetsRequest; })(); @@ -31802,17 +33793,20 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - if (!(message.groupByResults && message.groupByResults.length)) - message.groupByResults = []; - message.groupByResults.push($root.google.cloud.securitycenter.v1beta1.GroupResult.decode(reader, reader.uint32())); - break; - case 2: - message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 3: - message.nextPageToken = reader.string(); - break; + case 1: { + if (!(message.groupByResults && message.groupByResults.length)) + message.groupByResults = []; + message.groupByResults.push($root.google.cloud.securitycenter.v1beta1.GroupResult.decode(reader, reader.uint32())); + break; + } + case 2: { + message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.nextPageToken = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -31942,6 +33936,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for GroupAssetsResponse + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1beta1.GroupAssetsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GroupAssetsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1beta1.GroupAssetsResponse"; + }; + return GroupAssetsResponse; })(); @@ -32092,24 +34101,30 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.parent = reader.string(); - break; - case 2: - message.filter = reader.string(); - break; - case 3: - message.groupBy = reader.string(); - break; - case 4: - message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 5: - message.pageToken = reader.string(); - break; - case 6: - message.pageSize = reader.int32(); - break; + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.filter = reader.string(); + break; + } + case 3: { + message.groupBy = reader.string(); + break; + } + case 4: { + message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 5: { + message.pageToken = reader.string(); + break; + } + case 6: { + message.pageSize = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -32245,6 +34260,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for GroupFindingsRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1beta1.GroupFindingsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GroupFindingsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1beta1.GroupFindingsRequest"; + }; + return GroupFindingsRequest; })(); @@ -32364,17 +34394,20 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - if (!(message.groupByResults && message.groupByResults.length)) - message.groupByResults = []; - message.groupByResults.push($root.google.cloud.securitycenter.v1beta1.GroupResult.decode(reader, reader.uint32())); - break; - case 2: - message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 3: - message.nextPageToken = reader.string(); - break; + case 1: { + if (!(message.groupByResults && message.groupByResults.length)) + message.groupByResults = []; + message.groupByResults.push($root.google.cloud.securitycenter.v1beta1.GroupResult.decode(reader, reader.uint32())); + break; + } + case 2: { + message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.nextPageToken = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -32504,6 +34537,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for GroupFindingsResponse + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1beta1.GroupFindingsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GroupFindingsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1beta1.GroupFindingsResponse"; + }; + return GroupFindingsResponse; })(); @@ -32614,31 +34662,33 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - if (message.properties === $util.emptyObject) - message.properties = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = null; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = $root.google.protobuf.Value.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag2 & 7); - break; + case 1: { + if (message.properties === $util.emptyObject) + message.properties = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.protobuf.Value.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } } + message.properties[key] = value; + break; + } + case 2: { + message.count = reader.int64(); + break; } - message.properties[key] = value; - break; - case 2: - message.count = reader.int64(); - break; default: reader.skipType(tag & 7); break; @@ -32770,6 +34820,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for GroupResult + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1beta1.GroupResult + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GroupResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1beta1.GroupResult"; + }; + return GroupResult; })(); @@ -32887,15 +34952,18 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.parent = reader.string(); - break; - case 2: - message.pageToken = reader.string(); - break; - case 7: - message.pageSize = reader.int32(); - break; + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageToken = reader.string(); + break; + } + case 7: { + message.pageSize = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -33002,6 +35070,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for ListSourcesRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1beta1.ListSourcesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListSourcesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1beta1.ListSourcesRequest"; + }; + return ListSourcesRequest; })(); @@ -33110,14 +35193,16 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - if (!(message.sources && message.sources.length)) - message.sources = []; - message.sources.push($root.google.cloud.securitycenter.v1beta1.Source.decode(reader, reader.uint32())); - break; - case 2: - message.nextPageToken = reader.string(); - break; + case 1: { + if (!(message.sources && message.sources.length)) + message.sources = []; + message.sources.push($root.google.cloud.securitycenter.v1beta1.Source.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -33233,6 +35318,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for ListSourcesResponse + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1beta1.ListSourcesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListSourcesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1beta1.ListSourcesResponse"; + }; + return ListSourcesResponse; })(); @@ -33405,30 +35505,38 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.parent = reader.string(); - break; - case 2: - message.filter = reader.string(); - break; - case 3: - message.orderBy = reader.string(); - break; - case 4: - message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 5: - message.compareDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - case 7: - message.fieldMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - break; - case 8: - message.pageToken = reader.string(); - break; - case 9: - message.pageSize = reader.int32(); - break; + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.filter = reader.string(); + break; + } + case 3: { + message.orderBy = reader.string(); + break; + } + case 4: { + message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 5: { + message.compareDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 7: { + message.fieldMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 8: { + message.pageToken = reader.string(); + break; + } + case 9: { + message.pageSize = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -33590,6 +35698,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for ListAssetsRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1beta1.ListAssetsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListAssetsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1beta1.ListAssetsRequest"; + }; + return ListAssetsRequest; })(); @@ -33720,20 +35843,24 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - if (!(message.listAssetsResults && message.listAssetsResults.length)) - message.listAssetsResults = []; - message.listAssetsResults.push($root.google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult.decode(reader, reader.uint32())); - break; - case 2: - message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 3: - message.nextPageToken = reader.string(); - break; - case 4: - message.totalSize = reader.int32(); - break; + case 1: { + if (!(message.listAssetsResults && message.listAssetsResults.length)) + message.listAssetsResults = []; + message.listAssetsResults.push($root.google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult.decode(reader, reader.uint32())); + break; + } + case 2: { + message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.nextPageToken = reader.string(); + break; + } + case 4: { + message.totalSize = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -33871,6 +35998,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for ListAssetsResponse + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1beta1.ListAssetsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListAssetsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1beta1.ListAssetsResponse"; + }; + ListAssetsResponse.ListAssetsResult = (function() { /** @@ -33974,12 +36116,14 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.asset = $root.google.cloud.securitycenter.v1beta1.Asset.decode(reader, reader.uint32()); - break; - case 2: - message.state = reader.int32(); - break; + case 1: { + message.asset = $root.google.cloud.securitycenter.v1beta1.Asset.decode(reader, reader.uint32()); + break; + } + case 2: { + message.state = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -34111,6 +36255,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for ListAssetsResult + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListAssetsResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult"; + }; + /** * State enum. * @name google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult.State @@ -34295,27 +36454,34 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.parent = reader.string(); - break; - case 2: - message.filter = reader.string(); - break; - case 3: - message.orderBy = reader.string(); - break; - case 4: - message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 5: - message.fieldMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - break; - case 6: - message.pageToken = reader.string(); - break; - case 7: - message.pageSize = reader.int32(); - break; + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.filter = reader.string(); + break; + } + case 3: { + message.orderBy = reader.string(); + break; + } + case 4: { + message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 5: { + message.fieldMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 6: { + message.pageToken = reader.string(); + break; + } + case 7: { + message.pageSize = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -34464,6 +36630,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for ListFindingsRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1beta1.ListFindingsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListFindingsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1beta1.ListFindingsRequest"; + }; + return ListFindingsRequest; })(); @@ -34594,20 +36775,24 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - if (!(message.findings && message.findings.length)) - message.findings = []; - message.findings.push($root.google.cloud.securitycenter.v1beta1.Finding.decode(reader, reader.uint32())); - break; - case 2: - message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 3: - message.nextPageToken = reader.string(); - break; - case 4: - message.totalSize = reader.int32(); - break; + case 1: { + if (!(message.findings && message.findings.length)) + message.findings = []; + message.findings.push($root.google.cloud.securitycenter.v1beta1.Finding.decode(reader, reader.uint32())); + break; + } + case 2: { + message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.nextPageToken = reader.string(); + break; + } + case 4: { + message.totalSize = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -34745,6 +36930,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for ListFindingsResponse + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1beta1.ListFindingsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListFindingsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1beta1.ListFindingsResponse"; + }; + return ListFindingsResponse; })(); @@ -34862,15 +37062,18 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.state = reader.int32(); - break; - case 3: - message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.state = reader.int32(); + break; + } + case 3: { + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -35000,6 +37203,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for SetFindingStateRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1beta1.SetFindingStateRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SetFindingStateRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1beta1.SetFindingStateRequest"; + }; + return SetFindingStateRequest; })(); @@ -35095,9 +37313,10 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.parent = reader.string(); - break; + case 1: { + message.parent = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -35187,6 +37406,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for RunAssetDiscoveryRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RunAssetDiscoveryRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest"; + }; + return RunAssetDiscoveryRequest; })(); @@ -35293,12 +37527,14 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.finding = $root.google.cloud.securitycenter.v1beta1.Finding.decode(reader, reader.uint32()); - break; - case 2: - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - break; + case 1: { + message.finding = $root.google.cloud.securitycenter.v1beta1.Finding.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -35407,6 +37643,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for UpdateFindingRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1beta1.UpdateFindingRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateFindingRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1beta1.UpdateFindingRequest"; + }; + return UpdateFindingRequest; })(); @@ -35513,12 +37764,14 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.organizationSettings = $root.google.cloud.securitycenter.v1beta1.OrganizationSettings.decode(reader, reader.uint32()); - break; - case 2: - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - break; + case 1: { + message.organizationSettings = $root.google.cloud.securitycenter.v1beta1.OrganizationSettings.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -35627,6 +37880,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for UpdateOrganizationSettingsRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateOrganizationSettingsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest"; + }; + return UpdateOrganizationSettingsRequest; })(); @@ -35733,12 +38001,14 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.source = $root.google.cloud.securitycenter.v1beta1.Source.decode(reader, reader.uint32()); - break; - case 2: - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - break; + case 1: { + message.source = $root.google.cloud.securitycenter.v1beta1.Source.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -35847,6 +38117,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for UpdateSourceRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1beta1.UpdateSourceRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateSourceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1beta1.UpdateSourceRequest"; + }; + return UpdateSourceRequest; })(); @@ -35964,15 +38249,18 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.securityMarks = $root.google.cloud.securitycenter.v1beta1.SecurityMarks.decode(reader, reader.uint32()); - break; - case 2: - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - break; - case 3: - message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; + case 1: { + message.securityMarks = $root.google.cloud.securitycenter.v1beta1.SecurityMarks.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 3: { + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -36094,6 +38382,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for UpdateSecurityMarksRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateSecurityMarksRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest"; + }; + return UpdateSecurityMarksRequest; })(); @@ -36211,15 +38514,18 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.displayName = reader.string(); - break; - case 3: - message.description = reader.string(); - break; + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + case 3: { + message.description = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -36326,6 +38632,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for Source + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1beta1.Source + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Source.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1beta1.Source"; + }; + return Source; })(); @@ -36514,49 +38835,57 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.securityCenterProperties = $root.google.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterProperties.decode(reader, reader.uint32()); - break; - case 7: - if (message.resourceProperties === $util.emptyObject) - message.resourceProperties = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = null; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = $root.google.protobuf.Value.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag2 & 7); - break; + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.securityCenterProperties = $root.google.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterProperties.decode(reader, reader.uint32()); + break; + } + case 7: { + if (message.resourceProperties === $util.emptyObject) + message.resourceProperties = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.protobuf.Value.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } } + message.resourceProperties[key] = value; + break; + } + case 8: { + message.securityMarks = $root.google.cloud.securitycenter.v1p1beta1.SecurityMarks.decode(reader, reader.uint32()); + break; + } + case 9: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 10: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 11: { + message.iamPolicy = $root.google.cloud.securitycenter.v1p1beta1.Asset.IamPolicy.decode(reader, reader.uint32()); + break; + } + case 13: { + message.canonicalName = reader.string(); + break; } - message.resourceProperties[key] = value; - break; - case 8: - message.securityMarks = $root.google.cloud.securitycenter.v1p1beta1.SecurityMarks.decode(reader, reader.uint32()); - break; - case 9: - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 10: - message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 11: - message.iamPolicy = $root.google.cloud.securitycenter.v1p1beta1.Asset.IamPolicy.decode(reader, reader.uint32()); - break; - case 13: - message.canonicalName = reader.string(); - break; default: reader.skipType(tag & 7); break; @@ -36748,6 +39077,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for Asset + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1p1beta1.Asset + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Asset.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1p1beta1.Asset"; + }; + Asset.SecurityCenterProperties = (function() { /** @@ -36932,37 +39276,46 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.resourceName = reader.string(); - break; - case 2: - message.resourceType = reader.string(); - break; - case 3: - message.resourceParent = reader.string(); - break; - case 4: - message.resourceProject = reader.string(); - break; - case 5: - if (!(message.resourceOwners && message.resourceOwners.length)) - message.resourceOwners = []; - message.resourceOwners.push(reader.string()); - break; - case 6: - message.resourceDisplayName = reader.string(); - break; - case 7: - message.resourceParentDisplayName = reader.string(); - break; - case 8: - message.resourceProjectDisplayName = reader.string(); - break; - case 10: - if (!(message.folders && message.folders.length)) - message.folders = []; - message.folders.push($root.google.cloud.securitycenter.v1p1beta1.Folder.decode(reader, reader.uint32())); - break; + case 1: { + message.resourceName = reader.string(); + break; + } + case 2: { + message.resourceType = reader.string(); + break; + } + case 3: { + message.resourceParent = reader.string(); + break; + } + case 4: { + message.resourceProject = reader.string(); + break; + } + case 5: { + if (!(message.resourceOwners && message.resourceOwners.length)) + message.resourceOwners = []; + message.resourceOwners.push(reader.string()); + break; + } + case 6: { + message.resourceDisplayName = reader.string(); + break; + } + case 7: { + message.resourceParentDisplayName = reader.string(); + break; + } + case 8: { + message.resourceProjectDisplayName = reader.string(); + break; + } + case 10: { + if (!(message.folders && message.folders.length)) + message.folders = []; + message.folders.push($root.google.cloud.securitycenter.v1p1beta1.Folder.decode(reader, reader.uint32())); + break; + } default: reader.skipType(tag & 7); break; @@ -37148,6 +39501,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for SecurityCenterProperties + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterProperties + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SecurityCenterProperties.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterProperties"; + }; + return SecurityCenterProperties; })(); @@ -37243,9 +39611,10 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.policyBlob = reader.string(); - break; + case 1: { + message.policyBlob = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -37335,6 +39704,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for IamPolicy + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1p1beta1.Asset.IamPolicy + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + IamPolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1p1beta1.Asset.IamPolicy"; + }; + return IamPolicy; })(); @@ -37444,12 +39828,14 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.resourceFolder = reader.string(); - break; - case 2: - message.resourceFolderDisplayName = reader.string(); - break; + case 1: { + message.resourceFolder = reader.string(); + break; + } + case 2: { + message.resourceFolderDisplayName = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -37548,6 +39934,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for Folder + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1p1beta1.Folder + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Folder.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1p1beta1.Folder"; + }; + return Folder; })(); @@ -37667,34 +40068,37 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - if (message.marks === $util.emptyObject) - message.marks = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (message.marks === $util.emptyObject) + message.marks = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } } + message.marks[key] = value; + break; + } + case 3: { + message.canonicalName = reader.string(); + break; } - message.marks[key] = value; - break; - case 3: - message.canonicalName = reader.string(); - break; default: reader.skipType(tag & 7); break; @@ -37816,6 +40220,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for SecurityMarks + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1p1beta1.SecurityMarks + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SecurityMarks.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1p1beta1.SecurityMarks"; + }; + return SecurityMarks; })(); @@ -38036,61 +40455,73 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.parent = reader.string(); - break; - case 3: - message.resourceName = reader.string(); - break; - case 4: - message.state = reader.int32(); - break; - case 5: - message.category = reader.string(); - break; - case 6: - message.externalUri = reader.string(); - break; - case 7: - if (message.sourceProperties === $util.emptyObject) - message.sourceProperties = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = null; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = $root.google.protobuf.Value.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag2 & 7); - break; + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.parent = reader.string(); + break; + } + case 3: { + message.resourceName = reader.string(); + break; + } + case 4: { + message.state = reader.int32(); + break; + } + case 5: { + message.category = reader.string(); + break; + } + case 6: { + message.externalUri = reader.string(); + break; + } + case 7: { + if (message.sourceProperties === $util.emptyObject) + message.sourceProperties = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.protobuf.Value.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } } + message.sourceProperties[key] = value; + break; + } + case 8: { + message.securityMarks = $root.google.cloud.securitycenter.v1p1beta1.SecurityMarks.decode(reader, reader.uint32()); + break; + } + case 9: { + message.eventTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 10: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 13: { + message.severity = reader.int32(); + break; + } + case 14: { + message.canonicalName = reader.string(); + break; } - message.sourceProperties[key] = value; - break; - case 8: - message.securityMarks = $root.google.cloud.securitycenter.v1p1beta1.SecurityMarks.decode(reader, reader.uint32()); - break; - case 9: - message.eventTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 10: - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 13: - message.severity = reader.int32(); - break; - case 14: - message.canonicalName = reader.string(); - break; default: reader.skipType(tag & 7); break; @@ -38350,6 +40781,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for Finding + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1p1beta1.Finding + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Finding.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1p1beta1.Finding"; + }; + /** * State enum. * @name google.cloud.securitycenter.v1p1beta1.Finding.State @@ -38550,24 +40996,30 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.description = reader.string(); - break; - case 3: - message.eventType = reader.int32(); - break; - case 4: - message.pubsubTopic = reader.string(); - break; - case 5: - message.serviceAccount = reader.string(); - break; - case 6: - message.streamingConfig = $root.google.cloud.securitycenter.v1p1beta1.NotificationConfig.StreamingConfig.decode(reader, reader.uint32()); - break; + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.description = reader.string(); + break; + } + case 3: { + message.eventType = reader.int32(); + break; + } + case 4: { + message.pubsubTopic = reader.string(); + break; + } + case 5: { + message.serviceAccount = reader.string(); + break; + } + case 6: { + message.streamingConfig = $root.google.cloud.securitycenter.v1p1beta1.NotificationConfig.StreamingConfig.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -38722,6 +41174,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for NotificationConfig + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1p1beta1.NotificationConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NotificationConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1p1beta1.NotificationConfig"; + }; + NotificationConfig.StreamingConfig = (function() { /** @@ -38814,9 +41281,10 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.filter = reader.string(); - break; + case 1: { + message.filter = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -38906,6 +41374,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for StreamingConfig + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1p1beta1.NotificationConfig.StreamingConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StreamingConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1p1beta1.NotificationConfig.StreamingConfig"; + }; + return StreamingConfig; })(); @@ -39054,15 +41537,18 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.notificationConfigName = reader.string(); - break; - case 2: - message.finding = $root.google.cloud.securitycenter.v1p1beta1.Finding.decode(reader, reader.uint32()); - break; - case 3: - message.resource = $root.google.cloud.securitycenter.v1p1beta1.Resource.decode(reader, reader.uint32()); - break; + case 1: { + message.notificationConfigName = reader.string(); + break; + } + case 2: { + message.finding = $root.google.cloud.securitycenter.v1p1beta1.Finding.decode(reader, reader.uint32()); + break; + } + case 3: { + message.resource = $root.google.cloud.securitycenter.v1p1beta1.Resource.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -39185,6 +41671,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for NotificationMessage + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1p1beta1.NotificationMessage + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NotificationMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1p1beta1.NotificationMessage"; + }; + return NotificationMessage; })(); @@ -39337,26 +41838,32 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.project = reader.string(); - break; - case 3: - message.projectDisplayName = reader.string(); - break; - case 4: - message.parent = reader.string(); - break; - case 5: - message.parentDisplayName = reader.string(); - break; - case 7: - if (!(message.folders && message.folders.length)) - message.folders = []; - message.folders.push($root.google.cloud.securitycenter.v1p1beta1.Folder.decode(reader, reader.uint32())); - break; + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.project = reader.string(); + break; + } + case 3: { + message.projectDisplayName = reader.string(); + break; + } + case 4: { + message.parent = reader.string(); + break; + } + case 5: { + message.parentDisplayName = reader.string(); + break; + } + case 7: { + if (!(message.folders && message.folders.length)) + message.folders = []; + message.folders.push($root.google.cloud.securitycenter.v1p1beta1.Folder.decode(reader, reader.uint32())); + break; + } default: reader.skipType(tag & 7); break; @@ -39505,6 +42012,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for Resource + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1p1beta1.Resource + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Resource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1p1beta1.Resource"; + }; + return Resource; })(); @@ -39622,15 +42144,18 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.enableAssetDiscovery = reader.bool(); - break; - case 3: - message.assetDiscoveryConfig = $root.google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig.decode(reader, reader.uint32()); - break; + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.enableAssetDiscovery = reader.bool(); + break; + } + case 3: { + message.assetDiscoveryConfig = $root.google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -39742,6 +42267,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for OrganizationSettings + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1p1beta1.OrganizationSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OrganizationSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1p1beta1.OrganizationSettings"; + }; + OrganizationSettings.AssetDiscoveryConfig = (function() { /** @@ -39860,19 +42400,22 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - if (!(message.projectIds && message.projectIds.length)) - message.projectIds = []; - message.projectIds.push(reader.string()); - break; - case 2: - message.inclusionMode = reader.int32(); - break; - case 3: - if (!(message.folderIds && message.folderIds.length)) - message.folderIds = []; - message.folderIds.push(reader.string()); - break; + case 1: { + if (!(message.projectIds && message.projectIds.length)) + message.projectIds = []; + message.projectIds.push(reader.string()); + break; + } + case 2: { + message.inclusionMode = reader.int32(); + break; + } + case 3: { + if (!(message.folderIds && message.folderIds.length)) + message.folderIds = []; + message.folderIds.push(reader.string()); + break; + } default: reader.skipType(tag & 7); break; @@ -40022,6 +42565,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for AssetDiscoveryConfig + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AssetDiscoveryConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig"; + }; + /** * InclusionMode enum. * @name google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode @@ -40147,12 +42705,14 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.state = reader.int32(); - break; - case 2: - message.duration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; + case 1: { + message.state = reader.int32(); + break; + } + case 2: { + message.duration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -40279,6 +42839,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for RunAssetDiscoveryResponse + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RunAssetDiscoveryResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse"; + }; + /** * State enum. * @name google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse.State @@ -40333,7 +42908,7 @@ }; /** - * Callback as used by {@link google.cloud.securitycenter.v1p1beta1.SecurityCenter#createSource}. + * Callback as used by {@link google.cloud.securitycenter.v1p1beta1.SecurityCenter|createSource}. * @memberof google.cloud.securitycenter.v1p1beta1.SecurityCenter * @typedef CreateSourceCallback * @type {function} @@ -40366,7 +42941,7 @@ */ /** - * Callback as used by {@link google.cloud.securitycenter.v1p1beta1.SecurityCenter#createFinding}. + * Callback as used by {@link google.cloud.securitycenter.v1p1beta1.SecurityCenter|createFinding}. * @memberof google.cloud.securitycenter.v1p1beta1.SecurityCenter * @typedef CreateFindingCallback * @type {function} @@ -40399,7 +42974,7 @@ */ /** - * Callback as used by {@link google.cloud.securitycenter.v1p1beta1.SecurityCenter#createNotificationConfig}. + * Callback as used by {@link google.cloud.securitycenter.v1p1beta1.SecurityCenter|createNotificationConfig}. * @memberof google.cloud.securitycenter.v1p1beta1.SecurityCenter * @typedef CreateNotificationConfigCallback * @type {function} @@ -40432,7 +43007,7 @@ */ /** - * Callback as used by {@link google.cloud.securitycenter.v1p1beta1.SecurityCenter#deleteNotificationConfig}. + * Callback as used by {@link google.cloud.securitycenter.v1p1beta1.SecurityCenter|deleteNotificationConfig}. * @memberof google.cloud.securitycenter.v1p1beta1.SecurityCenter * @typedef DeleteNotificationConfigCallback * @type {function} @@ -40465,7 +43040,7 @@ */ /** - * Callback as used by {@link google.cloud.securitycenter.v1p1beta1.SecurityCenter#getIamPolicy}. + * Callback as used by {@link google.cloud.securitycenter.v1p1beta1.SecurityCenter|getIamPolicy}. * @memberof google.cloud.securitycenter.v1p1beta1.SecurityCenter * @typedef GetIamPolicyCallback * @type {function} @@ -40498,7 +43073,7 @@ */ /** - * Callback as used by {@link google.cloud.securitycenter.v1p1beta1.SecurityCenter#getNotificationConfig}. + * Callback as used by {@link google.cloud.securitycenter.v1p1beta1.SecurityCenter|getNotificationConfig}. * @memberof google.cloud.securitycenter.v1p1beta1.SecurityCenter * @typedef GetNotificationConfigCallback * @type {function} @@ -40531,7 +43106,7 @@ */ /** - * Callback as used by {@link google.cloud.securitycenter.v1p1beta1.SecurityCenter#getOrganizationSettings}. + * Callback as used by {@link google.cloud.securitycenter.v1p1beta1.SecurityCenter|getOrganizationSettings}. * @memberof google.cloud.securitycenter.v1p1beta1.SecurityCenter * @typedef GetOrganizationSettingsCallback * @type {function} @@ -40564,7 +43139,7 @@ */ /** - * Callback as used by {@link google.cloud.securitycenter.v1p1beta1.SecurityCenter#getSource}. + * Callback as used by {@link google.cloud.securitycenter.v1p1beta1.SecurityCenter|getSource}. * @memberof google.cloud.securitycenter.v1p1beta1.SecurityCenter * @typedef GetSourceCallback * @type {function} @@ -40597,7 +43172,7 @@ */ /** - * Callback as used by {@link google.cloud.securitycenter.v1p1beta1.SecurityCenter#groupAssets}. + * Callback as used by {@link google.cloud.securitycenter.v1p1beta1.SecurityCenter|groupAssets}. * @memberof google.cloud.securitycenter.v1p1beta1.SecurityCenter * @typedef GroupAssetsCallback * @type {function} @@ -40630,7 +43205,7 @@ */ /** - * Callback as used by {@link google.cloud.securitycenter.v1p1beta1.SecurityCenter#groupFindings}. + * Callback as used by {@link google.cloud.securitycenter.v1p1beta1.SecurityCenter|groupFindings}. * @memberof google.cloud.securitycenter.v1p1beta1.SecurityCenter * @typedef GroupFindingsCallback * @type {function} @@ -40663,7 +43238,7 @@ */ /** - * Callback as used by {@link google.cloud.securitycenter.v1p1beta1.SecurityCenter#listAssets}. + * Callback as used by {@link google.cloud.securitycenter.v1p1beta1.SecurityCenter|listAssets}. * @memberof google.cloud.securitycenter.v1p1beta1.SecurityCenter * @typedef ListAssetsCallback * @type {function} @@ -40696,7 +43271,7 @@ */ /** - * Callback as used by {@link google.cloud.securitycenter.v1p1beta1.SecurityCenter#listFindings}. + * Callback as used by {@link google.cloud.securitycenter.v1p1beta1.SecurityCenter|listFindings}. * @memberof google.cloud.securitycenter.v1p1beta1.SecurityCenter * @typedef ListFindingsCallback * @type {function} @@ -40729,7 +43304,7 @@ */ /** - * Callback as used by {@link google.cloud.securitycenter.v1p1beta1.SecurityCenter#listNotificationConfigs}. + * Callback as used by {@link google.cloud.securitycenter.v1p1beta1.SecurityCenter|listNotificationConfigs}. * @memberof google.cloud.securitycenter.v1p1beta1.SecurityCenter * @typedef ListNotificationConfigsCallback * @type {function} @@ -40762,7 +43337,7 @@ */ /** - * Callback as used by {@link google.cloud.securitycenter.v1p1beta1.SecurityCenter#listSources}. + * Callback as used by {@link google.cloud.securitycenter.v1p1beta1.SecurityCenter|listSources}. * @memberof google.cloud.securitycenter.v1p1beta1.SecurityCenter * @typedef ListSourcesCallback * @type {function} @@ -40795,7 +43370,7 @@ */ /** - * Callback as used by {@link google.cloud.securitycenter.v1p1beta1.SecurityCenter#runAssetDiscovery}. + * Callback as used by {@link google.cloud.securitycenter.v1p1beta1.SecurityCenter|runAssetDiscovery}. * @memberof google.cloud.securitycenter.v1p1beta1.SecurityCenter * @typedef RunAssetDiscoveryCallback * @type {function} @@ -40828,7 +43403,7 @@ */ /** - * Callback as used by {@link google.cloud.securitycenter.v1p1beta1.SecurityCenter#setFindingState}. + * Callback as used by {@link google.cloud.securitycenter.v1p1beta1.SecurityCenter|setFindingState}. * @memberof google.cloud.securitycenter.v1p1beta1.SecurityCenter * @typedef SetFindingStateCallback * @type {function} @@ -40861,7 +43436,7 @@ */ /** - * Callback as used by {@link google.cloud.securitycenter.v1p1beta1.SecurityCenter#setIamPolicy}. + * Callback as used by {@link google.cloud.securitycenter.v1p1beta1.SecurityCenter|setIamPolicy}. * @memberof google.cloud.securitycenter.v1p1beta1.SecurityCenter * @typedef SetIamPolicyCallback * @type {function} @@ -40894,7 +43469,7 @@ */ /** - * Callback as used by {@link google.cloud.securitycenter.v1p1beta1.SecurityCenter#testIamPermissions}. + * Callback as used by {@link google.cloud.securitycenter.v1p1beta1.SecurityCenter|testIamPermissions}. * @memberof google.cloud.securitycenter.v1p1beta1.SecurityCenter * @typedef TestIamPermissionsCallback * @type {function} @@ -40927,7 +43502,7 @@ */ /** - * Callback as used by {@link google.cloud.securitycenter.v1p1beta1.SecurityCenter#updateFinding}. + * Callback as used by {@link google.cloud.securitycenter.v1p1beta1.SecurityCenter|updateFinding}. * @memberof google.cloud.securitycenter.v1p1beta1.SecurityCenter * @typedef UpdateFindingCallback * @type {function} @@ -40960,7 +43535,7 @@ */ /** - * Callback as used by {@link google.cloud.securitycenter.v1p1beta1.SecurityCenter#updateNotificationConfig}. + * Callback as used by {@link google.cloud.securitycenter.v1p1beta1.SecurityCenter|updateNotificationConfig}. * @memberof google.cloud.securitycenter.v1p1beta1.SecurityCenter * @typedef UpdateNotificationConfigCallback * @type {function} @@ -40993,7 +43568,7 @@ */ /** - * Callback as used by {@link google.cloud.securitycenter.v1p1beta1.SecurityCenter#updateOrganizationSettings}. + * Callback as used by {@link google.cloud.securitycenter.v1p1beta1.SecurityCenter|updateOrganizationSettings}. * @memberof google.cloud.securitycenter.v1p1beta1.SecurityCenter * @typedef UpdateOrganizationSettingsCallback * @type {function} @@ -41026,7 +43601,7 @@ */ /** - * Callback as used by {@link google.cloud.securitycenter.v1p1beta1.SecurityCenter#updateSource}. + * Callback as used by {@link google.cloud.securitycenter.v1p1beta1.SecurityCenter|updateSource}. * @memberof google.cloud.securitycenter.v1p1beta1.SecurityCenter * @typedef UpdateSourceCallback * @type {function} @@ -41059,7 +43634,7 @@ */ /** - * Callback as used by {@link google.cloud.securitycenter.v1p1beta1.SecurityCenter#updateSecurityMarks}. + * Callback as used by {@link google.cloud.securitycenter.v1p1beta1.SecurityCenter|updateSecurityMarks}. * @memberof google.cloud.securitycenter.v1p1beta1.SecurityCenter * @typedef UpdateSecurityMarksCallback * @type {function} @@ -41208,15 +43783,18 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.parent = reader.string(); - break; - case 2: - message.findingId = reader.string(); - break; - case 3: - message.finding = $root.google.cloud.securitycenter.v1p1beta1.Finding.decode(reader, reader.uint32()); - break; + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.findingId = reader.string(); + break; + } + case 3: { + message.finding = $root.google.cloud.securitycenter.v1p1beta1.Finding.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -41328,6 +43906,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for CreateFindingRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1p1beta1.CreateFindingRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateFindingRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1p1beta1.CreateFindingRequest"; + }; + return CreateFindingRequest; })(); @@ -41445,15 +44038,18 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.parent = reader.string(); - break; - case 2: - message.configId = reader.string(); - break; - case 3: - message.notificationConfig = $root.google.cloud.securitycenter.v1p1beta1.NotificationConfig.decode(reader, reader.uint32()); - break; + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.configId = reader.string(); + break; + } + case 3: { + message.notificationConfig = $root.google.cloud.securitycenter.v1p1beta1.NotificationConfig.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -41565,6 +44161,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for CreateNotificationConfigRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1p1beta1.CreateNotificationConfigRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateNotificationConfigRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1p1beta1.CreateNotificationConfigRequest"; + }; + return CreateNotificationConfigRequest; })(); @@ -41671,12 +44282,14 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.parent = reader.string(); - break; - case 2: - message.source = $root.google.cloud.securitycenter.v1p1beta1.Source.decode(reader, reader.uint32()); - break; + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.source = $root.google.cloud.securitycenter.v1p1beta1.Source.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -41780,6 +44393,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for CreateSourceRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1p1beta1.CreateSourceRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateSourceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1p1beta1.CreateSourceRequest"; + }; + return CreateSourceRequest; })(); @@ -41875,9 +44503,10 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; + case 1: { + message.name = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -41967,6 +44596,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for DeleteNotificationConfigRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1p1beta1.DeleteNotificationConfigRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteNotificationConfigRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1p1beta1.DeleteNotificationConfigRequest"; + }; + return DeleteNotificationConfigRequest; })(); @@ -42062,9 +44706,10 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; + case 1: { + message.name = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -42154,6 +44799,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for GetNotificationConfigRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1p1beta1.GetNotificationConfigRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetNotificationConfigRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1p1beta1.GetNotificationConfigRequest"; + }; + return GetNotificationConfigRequest; })(); @@ -42249,9 +44909,10 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; + case 1: { + message.name = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -42341,6 +45002,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for GetOrganizationSettingsRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1p1beta1.GetOrganizationSettingsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetOrganizationSettingsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1p1beta1.GetOrganizationSettingsRequest"; + }; + return GetOrganizationSettingsRequest; })(); @@ -42436,9 +45112,10 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; + case 1: { + message.name = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -42528,6 +45205,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for GetSourceRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1p1beta1.GetSourceRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetSourceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1p1beta1.GetSourceRequest"; + }; + return GetSourceRequest; })(); @@ -42689,27 +45381,34 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.parent = reader.string(); - break; - case 2: - message.filter = reader.string(); - break; - case 3: - message.groupBy = reader.string(); - break; - case 4: - message.compareDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - case 5: - message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 7: - message.pageToken = reader.string(); - break; - case 8: - message.pageSize = reader.int32(); - break; + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.filter = reader.string(); + break; + } + case 3: { + message.groupBy = reader.string(); + break; + } + case 4: { + message.compareDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 5: { + message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 7: { + message.pageToken = reader.string(); + break; + } + case 8: { + message.pageSize = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -42858,6 +45557,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for GroupAssetsRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GroupAssetsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest"; + }; + return GroupAssetsRequest; })(); @@ -42988,20 +45702,24 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - if (!(message.groupByResults && message.groupByResults.length)) - message.groupByResults = []; - message.groupByResults.push($root.google.cloud.securitycenter.v1p1beta1.GroupResult.decode(reader, reader.uint32())); - break; - case 2: - message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 3: - message.nextPageToken = reader.string(); - break; - case 4: - message.totalSize = reader.int32(); - break; + case 1: { + if (!(message.groupByResults && message.groupByResults.length)) + message.groupByResults = []; + message.groupByResults.push($root.google.cloud.securitycenter.v1p1beta1.GroupResult.decode(reader, reader.uint32())); + break; + } + case 2: { + message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.nextPageToken = reader.string(); + break; + } + case 4: { + message.totalSize = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -43139,6 +45857,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for GroupAssetsResponse + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1p1beta1.GroupAssetsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GroupAssetsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1p1beta1.GroupAssetsResponse"; + }; + return GroupAssetsResponse; })(); @@ -43300,27 +46033,34 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.parent = reader.string(); - break; - case 2: - message.filter = reader.string(); - break; - case 3: - message.groupBy = reader.string(); - break; - case 4: - message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 5: - message.compareDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - case 7: - message.pageToken = reader.string(); - break; - case 8: - message.pageSize = reader.int32(); - break; + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.filter = reader.string(); + break; + } + case 3: { + message.groupBy = reader.string(); + break; + } + case 4: { + message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 5: { + message.compareDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 7: { + message.pageToken = reader.string(); + break; + } + case 8: { + message.pageSize = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -43469,6 +46209,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for GroupFindingsRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GroupFindingsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest"; + }; + return GroupFindingsRequest; })(); @@ -43599,20 +46354,24 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - if (!(message.groupByResults && message.groupByResults.length)) - message.groupByResults = []; - message.groupByResults.push($root.google.cloud.securitycenter.v1p1beta1.GroupResult.decode(reader, reader.uint32())); - break; - case 2: - message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 3: - message.nextPageToken = reader.string(); - break; - case 4: - message.totalSize = reader.int32(); - break; + case 1: { + if (!(message.groupByResults && message.groupByResults.length)) + message.groupByResults = []; + message.groupByResults.push($root.google.cloud.securitycenter.v1p1beta1.GroupResult.decode(reader, reader.uint32())); + break; + } + case 2: { + message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.nextPageToken = reader.string(); + break; + } + case 4: { + message.totalSize = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -43750,6 +46509,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for GroupFindingsResponse + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1p1beta1.GroupFindingsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GroupFindingsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1p1beta1.GroupFindingsResponse"; + }; + return GroupFindingsResponse; })(); @@ -43860,31 +46634,33 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - if (message.properties === $util.emptyObject) - message.properties = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = null; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = $root.google.protobuf.Value.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag2 & 7); - break; + case 1: { + if (message.properties === $util.emptyObject) + message.properties = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.protobuf.Value.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } } + message.properties[key] = value; + break; + } + case 2: { + message.count = reader.int64(); + break; } - message.properties[key] = value; - break; - case 2: - message.count = reader.int64(); - break; default: reader.skipType(tag & 7); break; @@ -44016,6 +46792,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for GroupResult + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1p1beta1.GroupResult + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GroupResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1p1beta1.GroupResult"; + }; + return GroupResult; })(); @@ -44133,15 +46924,18 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.parent = reader.string(); - break; - case 2: - message.pageToken = reader.string(); - break; - case 3: - message.pageSize = reader.int32(); - break; + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageToken = reader.string(); + break; + } + case 3: { + message.pageSize = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -44248,6 +47042,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for ListNotificationConfigsRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListNotificationConfigsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest"; + }; + return ListNotificationConfigsRequest; })(); @@ -44356,14 +47165,16 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - if (!(message.notificationConfigs && message.notificationConfigs.length)) - message.notificationConfigs = []; - message.notificationConfigs.push($root.google.cloud.securitycenter.v1p1beta1.NotificationConfig.decode(reader, reader.uint32())); - break; - case 2: - message.nextPageToken = reader.string(); - break; + case 1: { + if (!(message.notificationConfigs && message.notificationConfigs.length)) + message.notificationConfigs = []; + message.notificationConfigs.push($root.google.cloud.securitycenter.v1p1beta1.NotificationConfig.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -44479,6 +47290,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for ListNotificationConfigsResponse + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListNotificationConfigsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsResponse"; + }; + return ListNotificationConfigsResponse; })(); @@ -44596,15 +47422,18 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.parent = reader.string(); - break; - case 2: - message.pageToken = reader.string(); - break; - case 7: - message.pageSize = reader.int32(); - break; + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageToken = reader.string(); + break; + } + case 7: { + message.pageSize = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -44711,6 +47540,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for ListSourcesRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1p1beta1.ListSourcesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListSourcesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1p1beta1.ListSourcesRequest"; + }; + return ListSourcesRequest; })(); @@ -44819,14 +47663,16 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - if (!(message.sources && message.sources.length)) - message.sources = []; - message.sources.push($root.google.cloud.securitycenter.v1p1beta1.Source.decode(reader, reader.uint32())); - break; - case 2: - message.nextPageToken = reader.string(); - break; + case 1: { + if (!(message.sources && message.sources.length)) + message.sources = []; + message.sources.push($root.google.cloud.securitycenter.v1p1beta1.Source.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -44942,6 +47788,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for ListSourcesResponse + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1p1beta1.ListSourcesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListSourcesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1p1beta1.ListSourcesResponse"; + }; + return ListSourcesResponse; })(); @@ -45114,30 +47975,38 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.parent = reader.string(); - break; - case 2: - message.filter = reader.string(); - break; - case 3: - message.orderBy = reader.string(); - break; - case 4: - message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 5: - message.compareDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - case 7: - message.fieldMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - break; - case 8: - message.pageToken = reader.string(); - break; - case 9: - message.pageSize = reader.int32(); - break; + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.filter = reader.string(); + break; + } + case 3: { + message.orderBy = reader.string(); + break; + } + case 4: { + message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 5: { + message.compareDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 7: { + message.fieldMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 8: { + message.pageToken = reader.string(); + break; + } + case 9: { + message.pageSize = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -45299,6 +48168,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for ListAssetsRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1p1beta1.ListAssetsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListAssetsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1p1beta1.ListAssetsRequest"; + }; + return ListAssetsRequest; })(); @@ -45429,20 +48313,24 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - if (!(message.listAssetsResults && message.listAssetsResults.length)) - message.listAssetsResults = []; - message.listAssetsResults.push($root.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult.decode(reader, reader.uint32())); - break; - case 2: - message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 3: - message.nextPageToken = reader.string(); - break; - case 4: - message.totalSize = reader.int32(); - break; + case 1: { + if (!(message.listAssetsResults && message.listAssetsResults.length)) + message.listAssetsResults = []; + message.listAssetsResults.push($root.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult.decode(reader, reader.uint32())); + break; + } + case 2: { + message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.nextPageToken = reader.string(); + break; + } + case 4: { + message.totalSize = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -45580,6 +48468,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for ListAssetsResponse + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1p1beta1.ListAssetsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListAssetsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1p1beta1.ListAssetsResponse"; + }; + ListAssetsResponse.ListAssetsResult = (function() { /** @@ -45683,12 +48586,14 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.asset = $root.google.cloud.securitycenter.v1p1beta1.Asset.decode(reader, reader.uint32()); - break; - case 2: - message.stateChange = reader.int32(); - break; + case 1: { + message.asset = $root.google.cloud.securitycenter.v1p1beta1.Asset.decode(reader, reader.uint32()); + break; + } + case 2: { + message.stateChange = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -45815,6 +48720,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for ListAssetsResult + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListAssetsResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult"; + }; + /** * StateChange enum. * @name google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult.StateChange @@ -46008,30 +48928,38 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.parent = reader.string(); - break; - case 2: - message.filter = reader.string(); - break; - case 3: - message.orderBy = reader.string(); - break; - case 4: - message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 5: - message.compareDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - case 7: - message.fieldMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - break; - case 8: - message.pageToken = reader.string(); - break; - case 9: - message.pageSize = reader.int32(); - break; + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.filter = reader.string(); + break; + } + case 3: { + message.orderBy = reader.string(); + break; + } + case 4: { + message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 5: { + message.compareDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 7: { + message.fieldMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 8: { + message.pageToken = reader.string(); + break; + } + case 9: { + message.pageSize = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -46193,6 +49121,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for ListFindingsRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1p1beta1.ListFindingsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListFindingsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1p1beta1.ListFindingsRequest"; + }; + return ListFindingsRequest; })(); @@ -46323,20 +49266,24 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - if (!(message.listFindingsResults && message.listFindingsResults.length)) - message.listFindingsResults = []; - message.listFindingsResults.push($root.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.decode(reader, reader.uint32())); - break; - case 2: - message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 3: - message.nextPageToken = reader.string(); - break; - case 4: - message.totalSize = reader.int32(); - break; + case 1: { + if (!(message.listFindingsResults && message.listFindingsResults.length)) + message.listFindingsResults = []; + message.listFindingsResults.push($root.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.decode(reader, reader.uint32())); + break; + } + case 2: { + message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.nextPageToken = reader.string(); + break; + } + case 4: { + message.totalSize = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -46474,6 +49421,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for ListFindingsResponse + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1p1beta1.ListFindingsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListFindingsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1p1beta1.ListFindingsResponse"; + }; + ListFindingsResponse.ListFindingsResult = (function() { /** @@ -46588,15 +49550,18 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.finding = $root.google.cloud.securitycenter.v1p1beta1.Finding.decode(reader, reader.uint32()); - break; - case 2: - message.stateChange = reader.int32(); - break; - case 3: - message.resource = $root.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.Resource.decode(reader, reader.uint32()); - break; + case 1: { + message.finding = $root.google.cloud.securitycenter.v1p1beta1.Finding.decode(reader, reader.uint32()); + break; + } + case 2: { + message.stateChange = reader.int32(); + break; + } + case 3: { + message.resource = $root.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.Resource.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -46741,6 +49706,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for ListFindingsResult + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListFindingsResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult"; + }; + ListFindingsResult.Resource = (function() { /** @@ -46890,26 +49870,32 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.projectName = reader.string(); - break; - case 3: - message.projectDisplayName = reader.string(); - break; - case 4: - message.parentName = reader.string(); - break; - case 5: - message.parentDisplayName = reader.string(); - break; - case 10: - if (!(message.folders && message.folders.length)) - message.folders = []; - message.folders.push($root.google.cloud.securitycenter.v1p1beta1.Folder.decode(reader, reader.uint32())); - break; + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.projectName = reader.string(); + break; + } + case 3: { + message.projectDisplayName = reader.string(); + break; + } + case 4: { + message.parentName = reader.string(); + break; + } + case 5: { + message.parentDisplayName = reader.string(); + break; + } + case 10: { + if (!(message.folders && message.folders.length)) + message.folders = []; + message.folders.push($root.google.cloud.securitycenter.v1p1beta1.Folder.decode(reader, reader.uint32())); + break; + } default: reader.skipType(tag & 7); break; @@ -47058,6 +50044,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for Resource + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.Resource + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Resource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.Resource"; + }; + return Resource; })(); @@ -47201,15 +50202,18 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.state = reader.int32(); - break; - case 3: - message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.state = reader.int32(); + break; + } + case 3: { + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -47339,6 +50343,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for SetFindingStateRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SetFindingStateRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest"; + }; + return SetFindingStateRequest; })(); @@ -47434,9 +50453,10 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.parent = reader.string(); - break; + case 1: { + message.parent = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -47526,6 +50546,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for RunAssetDiscoveryRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RunAssetDiscoveryRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryRequest"; + }; + return RunAssetDiscoveryRequest; })(); @@ -47632,12 +50667,14 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.finding = $root.google.cloud.securitycenter.v1p1beta1.Finding.decode(reader, reader.uint32()); - break; - case 2: - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - break; + case 1: { + message.finding = $root.google.cloud.securitycenter.v1p1beta1.Finding.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -47746,6 +50783,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for UpdateFindingRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1p1beta1.UpdateFindingRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateFindingRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1p1beta1.UpdateFindingRequest"; + }; + return UpdateFindingRequest; })(); @@ -47852,12 +50904,14 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.notificationConfig = $root.google.cloud.securitycenter.v1p1beta1.NotificationConfig.decode(reader, reader.uint32()); - break; - case 2: - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - break; + case 1: { + message.notificationConfig = $root.google.cloud.securitycenter.v1p1beta1.NotificationConfig.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -47966,6 +51020,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for UpdateNotificationConfigRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateNotificationConfigRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest"; + }; + return UpdateNotificationConfigRequest; })(); @@ -48072,12 +51141,14 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.organizationSettings = $root.google.cloud.securitycenter.v1p1beta1.OrganizationSettings.decode(reader, reader.uint32()); - break; - case 2: - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - break; + case 1: { + message.organizationSettings = $root.google.cloud.securitycenter.v1p1beta1.OrganizationSettings.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -48186,6 +51257,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for UpdateOrganizationSettingsRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateOrganizationSettingsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest"; + }; + return UpdateOrganizationSettingsRequest; })(); @@ -48292,12 +51378,14 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.source = $root.google.cloud.securitycenter.v1p1beta1.Source.decode(reader, reader.uint32()); - break; - case 2: - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - break; + case 1: { + message.source = $root.google.cloud.securitycenter.v1p1beta1.Source.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -48406,6 +51494,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for UpdateSourceRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1p1beta1.UpdateSourceRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateSourceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1p1beta1.UpdateSourceRequest"; + }; + return UpdateSourceRequest; })(); @@ -48523,15 +51626,18 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.securityMarks = $root.google.cloud.securitycenter.v1p1beta1.SecurityMarks.decode(reader, reader.uint32()); - break; - case 2: - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - break; - case 3: - message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; + case 1: { + message.securityMarks = $root.google.cloud.securitycenter.v1p1beta1.SecurityMarks.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 3: { + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -48653,6 +51759,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for UpdateSecurityMarksRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateSecurityMarksRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest"; + }; + return UpdateSecurityMarksRequest; })(); @@ -48781,18 +51902,22 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.displayName = reader.string(); - break; - case 3: - message.description = reader.string(); - break; - case 14: - message.canonicalName = reader.string(); - break; + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + case 3: { + message.description = reader.string(); + break; + } + case 14: { + message.canonicalName = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -48907,6 +52032,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for Source + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1p1beta1.Source + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Source.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1p1beta1.Source"; + }; + return Source; })(); @@ -49093,36 +52233,43 @@ 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) + 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()); - } else - message.style.push(reader.int32()); - break; + break; + } default: reader.skipType(tag & 7); break; @@ -49320,6 +52467,21 @@ 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 @@ -49456,12 +52618,14 @@ 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; + case 1: { + message.type = reader.string(); + break; + } + case 2: { + message.childType = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -49560,6 +52724,21 @@ 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; })(); @@ -49694,14 +52873,16 @@ 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; + 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; @@ -49817,6 +52998,21 @@ 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; })(); @@ -50027,38 +53223,48 @@ 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; + 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; @@ -50280,6 +53486,21 @@ 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; })(); @@ -50386,12 +53607,14 @@ 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; + case 1: { + message.kind = reader.string(); + break; + } + case 2: { + message.path = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -50490,6 +53713,21 @@ 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; })(); @@ -50599,11 +53837,12 @@ 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; + 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; @@ -50710,6 +53949,21 @@ 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; })(); @@ -50731,6 +53985,7 @@ * @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 */ /** @@ -50851,6 +54106,14 @@ */ 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 @@ -50906,6 +54169,8 @@ 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; }; @@ -50940,66 +54205,82 @@ 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) + 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()); - } 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) + 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()); - } 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; + 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; @@ -51111,6 +54392,9 @@ 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; }; @@ -51203,6 +54487,8 @@ } if (object.syntax != null) message.syntax = String(object.syntax); + if (object.edition != null) + message.edition = String(object.edition); return message; }; @@ -51234,6 +54520,7 @@ object.options = null; object.sourceCodeInfo = null; object.syntax = ""; + object.edition = ""; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -51280,6 +54567,8 @@ } if (message.syntax != null && message.hasOwnProperty("syntax")) object.syntax = message.syntax; + if (message.edition != null && message.hasOwnProperty("edition")) + object.edition = message.edition; return object; }; @@ -51294,6 +54583,21 @@ 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; })(); @@ -51504,52 +54808,62 @@ 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; + 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; @@ -51850,6 +55164,21 @@ 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() { /** @@ -51964,15 +55293,18 @@ 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; + 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; @@ -52084,6 +55416,21 @@ 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; })(); @@ -52190,12 +55537,14 @@ 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 1: { + message.start = reader.int32(); + break; + } + case 2: { + message.end = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -52294,6 +55643,21 @@ 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; })(); @@ -52394,11 +55758,12 @@ 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; + 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; @@ -52505,6 +55870,21 @@ 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; })(); @@ -52710,39 +56090,50 @@ 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; + 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; @@ -53029,6 +56420,21 @@ 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 @@ -53197,12 +56603,14 @@ 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; + 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; @@ -53306,6 +56714,21 @@ 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; })(); @@ -53451,27 +56874,32 @@ 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; + 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; @@ -53647,6 +57075,21 @@ 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() { /** @@ -53750,12 +57193,14 @@ 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 1: { + message.start = reader.int32(); + break; + } + case 2: { + message.end = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -53854,6 +57299,21 @@ 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; })(); @@ -53974,15 +57434,18 @@ 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; + 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; @@ -54094,6 +57557,21 @@ 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; })(); @@ -54213,17 +57691,20 @@ 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; + 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; @@ -54353,6 +57834,21 @@ 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; })(); @@ -54503,24 +57999,30 @@ 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; + 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; @@ -54656,6 +58158,21 @@ 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; })(); @@ -54986,76 +58503,98 @@ 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; + 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; @@ -55368,6 +58907,21 @@ 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 @@ -55536,26 +59090,32 @@ 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; + 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; @@ -55709,6 +59269,21 @@ 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; })(); @@ -55722,6 +59297,7 @@ * @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 @@ -55778,6 +59354,14 @@ */ FieldOptions.prototype.lazy = false; + /** + * FieldOptions unverifiedLazy. + * @member {boolean} unverifiedLazy + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.unverifiedLazy = false; + /** * FieldOptions deprecated. * @member {boolean} deprecated @@ -55854,6 +59438,8 @@ 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(); @@ -55899,42 +59485,55 @@ 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 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 1055: - message[".google.api.resourceReference"] = $root.google.api.ResourceReference.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) + 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 1055: { + message[".google.api.resourceReference"] = $root.google.api.ResourceReference.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()); - } else - message[".google.api.fieldBehavior"].push(reader.int32()); - break; + break; + } default: reader.skipType(tag & 7); break; @@ -55994,6 +59593,9 @@ 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"; @@ -56079,6 +59681,8 @@ } 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) @@ -56166,6 +59770,7 @@ 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")) @@ -56180,6 +59785,8 @@ object.jstype = options.enums === String ? $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) @@ -56206,6 +59813,21 @@ 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 @@ -56335,11 +59957,12 @@ 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; + 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; @@ -56446,6 +60069,21 @@ 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; })(); @@ -56565,17 +60203,20 @@ 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; + 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; @@ -56700,6 +60341,21 @@ 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; })(); @@ -56808,14 +60464,16 @@ 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; + 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; @@ -56931,6 +60589,21 @@ 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; })(); @@ -57061,20 +60734,24 @@ 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; + 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; @@ -57207,6 +60884,21 @@ 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; })(); @@ -57361,28 +61053,34 @@ 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; - case 1049: - message[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.decode(reader, reader.uint32()); - break; + 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; + } + case 1049: { + message[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -57572,6 +61270,21 @@ 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 @@ -57751,29 +61464,36 @@ 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; + 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; @@ -57886,7 +61606,7 @@ 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) + else if (object.stringValue.length >= 0) message.stringValue = object.stringValue; if (object.aggregateValue != null) message.aggregateValue = String(object.aggregateValue); @@ -57967,6 +61687,21 @@ 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() { /** @@ -58068,12 +61803,14 @@ 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; + case 1: { + message.namePart = reader.string(); + break; + } + case 2: { + message.isExtension = reader.bool(); + break; + } default: reader.skipType(tag & 7); break; @@ -58174,6 +61911,21 @@ 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; })(); @@ -58274,11 +62026,12 @@ 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; + 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; @@ -58385,6 +62138,21 @@ 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() { /** @@ -58533,37 +62301,42 @@ 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) + 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()); - } 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) + 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()); - } 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; + 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; @@ -58724,6 +62497,21 @@ 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; })(); @@ -58824,11 +62612,12 @@ 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; + 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; @@ -58935,6 +62724,21 @@ 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() { /** @@ -58945,6 +62749,7 @@ * @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 */ /** @@ -58995,6 +62800,14 @@ */ 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 @@ -59031,6 +62844,8 @@ 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; }; @@ -59065,25 +62880,33 @@ 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) + 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()); - } 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; + 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; @@ -59135,6 +62958,15 @@ 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; }; @@ -59163,6 +62995,20 @@ message.begin = object.begin | 0; if (object.end != null) message.end = object.end | 0; + switch (object.semantic) { + 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; }; @@ -59185,6 +63031,7 @@ object.sourceFile = ""; object.begin = 0; object.end = 0; + object.semantic = options.enums === String ? "NONE" : 0; } if (message.path && message.path.length) { object.path = []; @@ -59197,6 +63044,8 @@ 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] : message.semantic; return object; }; @@ -59211,6 +63060,37 @@ 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; })(); @@ -59313,28 +63193,29 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - if (message.fields === $util.emptyObject) - message.fields = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = null; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = $root.google.protobuf.Value.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag2 & 7); - break; + case 1: { + if (message.fields === $util.emptyObject) + message.fields = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.protobuf.Value.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } } + message.fields[key] = value; + break; } - message.fields[key] = value; - break; default: reader.skipType(tag & 7); break; @@ -59443,6 +63324,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for Struct + * @function getTypeUrl + * @memberof google.protobuf.Struct + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Struct.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Struct"; + }; + return Struct; })(); @@ -59607,24 +63503,30 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.nullValue = reader.int32(); - break; - case 2: - message.numberValue = reader.double(); - break; - case 3: - message.stringValue = reader.string(); - break; - case 4: - message.boolValue = reader.bool(); - break; - case 5: - message.structValue = $root.google.protobuf.Struct.decode(reader, reader.uint32()); - break; - case 6: - message.listValue = $root.google.protobuf.ListValue.decode(reader, reader.uint32()); - break; + case 1: { + message.nullValue = reader.int32(); + break; + } + case 2: { + message.numberValue = reader.double(); + break; + } + case 3: { + message.stringValue = reader.string(); + break; + } + case 4: { + message.boolValue = reader.bool(); + break; + } + case 5: { + message.structValue = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + } + case 6: { + message.listValue = $root.google.protobuf.ListValue.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -59808,6 +63710,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for Value + * @function getTypeUrl + * @memberof google.protobuf.Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Value"; + }; + return Value; })(); @@ -59917,11 +63834,12 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - if (!(message.values && message.values.length)) - message.values = []; - message.values.push($root.google.protobuf.Value.decode(reader, reader.uint32())); - break; + case 1: { + if (!(message.values && message.values.length)) + message.values = []; + message.values.push($root.google.protobuf.Value.decode(reader, reader.uint32())); + break; + } default: reader.skipType(tag & 7); break; @@ -60028,6 +63946,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for ListValue + * @function getTypeUrl + * @memberof google.protobuf.ListValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ListValue"; + }; + return ListValue; })(); @@ -60134,12 +64067,14 @@ 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; + case 1: { + message.seconds = reader.int64(); + break; + } + case 2: { + message.nanos = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -60252,6 +64187,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for Timestamp + * @function getTypeUrl + * @memberof google.protobuf.Timestamp + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Timestamp.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Timestamp"; + }; + return Timestamp; })(); @@ -60358,12 +64308,14 @@ 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; + case 1: { + message.seconds = reader.int64(); + break; + } + case 2: { + message.nanos = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -60476,9 +64428,243 @@ 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.FieldMask = (function() { + + /** + * Properties of a FieldMask. + * @memberof google.protobuf + * @interface IFieldMask + * @property {Array.|null} [paths] FieldMask paths + */ + + /** + * Constructs a new FieldMask. + * @memberof google.protobuf + * @classdesc Represents a FieldMask. + * @implements IFieldMask + * @constructor + * @param {google.protobuf.IFieldMask=} [properties] Properties to set + */ + function FieldMask(properties) { + this.paths = []; + 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]]; + } + + /** + * FieldMask paths. + * @member {Array.} paths + * @memberof google.protobuf.FieldMask + * @instance + */ + FieldMask.prototype.paths = $util.emptyArray; + + /** + * Creates a new FieldMask instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.IFieldMask=} [properties] Properties to set + * @returns {google.protobuf.FieldMask} FieldMask instance + */ + FieldMask.create = function create(properties) { + return new FieldMask(properties); + }; + + /** + * Encodes the specified FieldMask message. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.IFieldMask} message FieldMask message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldMask.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.paths != null && message.paths.length) + for (var i = 0; i < message.paths.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.paths[i]); + return writer; + }; + + /** + * Encodes the specified FieldMask message, length delimited. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.IFieldMask} message FieldMask message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldMask.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldMask message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldMask + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldMask} FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldMask.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.FieldMask(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.paths && message.paths.length)) + message.paths = []; + message.paths.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldMask message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldMask + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldMask} FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldMask.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldMask message. + * @function verify + * @memberof google.protobuf.FieldMask + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldMask.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.paths != null && message.hasOwnProperty("paths")) { + if (!Array.isArray(message.paths)) + return "paths: array expected"; + for (var i = 0; i < message.paths.length; ++i) + if (!$util.isString(message.paths[i])) + return "paths: string[] expected"; + } + return null; + }; + + /** + * Creates a FieldMask message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldMask + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldMask} FieldMask + */ + FieldMask.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldMask) + return object; + var message = new $root.google.protobuf.FieldMask(); + if (object.paths) { + if (!Array.isArray(object.paths)) + throw TypeError(".google.protobuf.FieldMask.paths: array expected"); + message.paths = []; + for (var i = 0; i < object.paths.length; ++i) + message.paths[i] = String(object.paths[i]); + } + return message; + }; + + /** + * Creates a plain object from a FieldMask message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.FieldMask} message FieldMask + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldMask.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.paths = []; + if (message.paths && message.paths.length) { + object.paths = []; + for (var j = 0; j < message.paths.length; ++j) + object.paths[j] = message.paths[j]; + } + return object; + }; + + /** + * Converts this FieldMask to JSON. + * @function toJSON + * @memberof google.protobuf.FieldMask + * @instance + * @returns {Object.} JSON object + */ + FieldMask.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FieldMask + * @function getTypeUrl + * @memberof google.protobuf.FieldMask + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FieldMask.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldMask"; + }; + + return FieldMask; + })(); + protobuf.Any = (function() { /** @@ -60582,12 +64768,14 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.type_url = reader.string(); - break; - case 2: - message.value = reader.bytes(); - break; + case 1: { + message.type_url = reader.string(); + break; + } + case 2: { + message.value = reader.bytes(); + break; + } default: reader.skipType(tag & 7); break; @@ -60649,7 +64837,7 @@ if (object.value != null) if (typeof object.value === "string") $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); - else if (object.value.length) + else if (object.value.length >= 0) message.value = object.value; return message; }; @@ -60695,6 +64883,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for Any + * @function getTypeUrl + * @memberof google.protobuf.Any + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Any.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Any"; + }; + return Any; })(); @@ -60855,210 +65058,22 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return Empty; - })(); - - protobuf.FieldMask = (function() { - - /** - * Properties of a FieldMask. - * @memberof google.protobuf - * @interface IFieldMask - * @property {Array.|null} [paths] FieldMask paths - */ - - /** - * Constructs a new FieldMask. - * @memberof google.protobuf - * @classdesc Represents a FieldMask. - * @implements IFieldMask - * @constructor - * @param {google.protobuf.IFieldMask=} [properties] Properties to set - */ - function FieldMask(properties) { - this.paths = []; - 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]]; - } - - /** - * FieldMask paths. - * @member {Array.} paths - * @memberof google.protobuf.FieldMask - * @instance - */ - FieldMask.prototype.paths = $util.emptyArray; - - /** - * Creates a new FieldMask instance using the specified properties. - * @function create - * @memberof google.protobuf.FieldMask - * @static - * @param {google.protobuf.IFieldMask=} [properties] Properties to set - * @returns {google.protobuf.FieldMask} FieldMask instance - */ - FieldMask.create = function create(properties) { - return new FieldMask(properties); - }; - /** - * Encodes the specified FieldMask message. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FieldMask - * @static - * @param {google.protobuf.IFieldMask} message FieldMask message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FieldMask.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.paths != null && message.paths.length) - for (var i = 0; i < message.paths.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.paths[i]); - return writer; - }; - - /** - * Encodes the specified FieldMask message, length delimited. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FieldMask - * @static - * @param {google.protobuf.IFieldMask} message FieldMask message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FieldMask.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FieldMask message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FieldMask - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FieldMask} FieldMask - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FieldMask.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.FieldMask(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.paths && message.paths.length)) - message.paths = []; - message.paths.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FieldMask message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FieldMask - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FieldMask} FieldMask - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FieldMask.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FieldMask message. - * @function verify - * @memberof google.protobuf.FieldMask - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FieldMask.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.paths != null && message.hasOwnProperty("paths")) { - if (!Array.isArray(message.paths)) - return "paths: array expected"; - for (var i = 0; i < message.paths.length; ++i) - if (!$util.isString(message.paths[i])) - return "paths: string[] expected"; - } - return null; - }; - - /** - * Creates a FieldMask message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FieldMask - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FieldMask} FieldMask - */ - FieldMask.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FieldMask) - return object; - var message = new $root.google.protobuf.FieldMask(); - if (object.paths) { - if (!Array.isArray(object.paths)) - throw TypeError(".google.protobuf.FieldMask.paths: array expected"); - message.paths = []; - for (var i = 0; i < object.paths.length; ++i) - message.paths[i] = String(object.paths[i]); - } - return message; - }; - - /** - * Creates a plain object from a FieldMask message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FieldMask + * Gets the default type url for Empty + * @function getTypeUrl + * @memberof google.protobuf.Empty * @static - * @param {google.protobuf.FieldMask} message FieldMask - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url */ - FieldMask.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.paths = []; - if (message.paths && message.paths.length) { - object.paths = []; - for (var j = 0; j < message.paths.length; ++j) - object.paths[j] = message.paths[j]; + Empty.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; } - return object; + return typeUrlPrefix + "/google.protobuf.Empty"; }; - /** - * Converts this FieldMask to JSON. - * @function toJSON - * @memberof google.protobuf.FieldMask - * @instance - * @returns {Object.} JSON object - */ - FieldMask.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return FieldMask; + return Empty; })(); return protobuf; @@ -61115,7 +65130,7 @@ }; /** - * Callback as used by {@link google.iam.v1.IAMPolicy#setIamPolicy}. + * Callback as used by {@link google.iam.v1.IAMPolicy|setIamPolicy}. * @memberof google.iam.v1.IAMPolicy * @typedef SetIamPolicyCallback * @type {function} @@ -61148,7 +65163,7 @@ */ /** - * Callback as used by {@link google.iam.v1.IAMPolicy#getIamPolicy}. + * Callback as used by {@link google.iam.v1.IAMPolicy|getIamPolicy}. * @memberof google.iam.v1.IAMPolicy * @typedef GetIamPolicyCallback * @type {function} @@ -61181,7 +65196,7 @@ */ /** - * Callback as used by {@link google.iam.v1.IAMPolicy#testIamPermissions}. + * Callback as used by {@link google.iam.v1.IAMPolicy|testIamPermissions}. * @memberof google.iam.v1.IAMPolicy * @typedef TestIamPermissionsCallback * @type {function} @@ -61224,6 +65239,7 @@ * @interface ISetIamPolicyRequest * @property {string|null} [resource] SetIamPolicyRequest resource * @property {google.iam.v1.IPolicy|null} [policy] SetIamPolicyRequest policy + * @property {google.protobuf.IFieldMask|null} [updateMask] SetIamPolicyRequest updateMask */ /** @@ -61257,6 +65273,14 @@ */ SetIamPolicyRequest.prototype.policy = null; + /** + * SetIamPolicyRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.iam.v1.SetIamPolicyRequest + * @instance + */ + SetIamPolicyRequest.prototype.updateMask = null; + /** * Creates a new SetIamPolicyRequest instance using the specified properties. * @function create @@ -61285,6 +65309,8 @@ writer.uint32(/* id 1, wireType 2 =*/10).string(message.resource); if (message.policy != null && Object.hasOwnProperty.call(message, "policy")) $root.google.iam.v1.Policy.encode(message.policy, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; @@ -61319,12 +65345,18 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.resource = reader.string(); - break; - case 2: - message.policy = $root.google.iam.v1.Policy.decode(reader, reader.uint32()); - break; + case 1: { + message.resource = reader.string(); + break; + } + case 2: { + message.policy = $root.google.iam.v1.Policy.decode(reader, reader.uint32()); + break; + } + case 3: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -61368,6 +65400,11 @@ if (error) return "policy." + error; } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } return null; }; @@ -61390,6 +65427,11 @@ throw TypeError(".google.iam.v1.SetIamPolicyRequest.policy: object expected"); message.policy = $root.google.iam.v1.Policy.fromObject(object.policy); } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.iam.v1.SetIamPolicyRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } return message; }; @@ -61409,11 +65451,14 @@ if (options.defaults) { object.resource = ""; object.policy = null; + object.updateMask = null; } if (message.resource != null && message.hasOwnProperty("resource")) object.resource = message.resource; if (message.policy != null && message.hasOwnProperty("policy")) object.policy = $root.google.iam.v1.Policy.toObject(message.policy, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); return object; }; @@ -61428,6 +65473,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for SetIamPolicyRequest + * @function getTypeUrl + * @memberof google.iam.v1.SetIamPolicyRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SetIamPolicyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.SetIamPolicyRequest"; + }; + return SetIamPolicyRequest; })(); @@ -61534,12 +65594,14 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.resource = reader.string(); - break; - case 2: - message.options = $root.google.iam.v1.GetPolicyOptions.decode(reader, reader.uint32()); - break; + case 1: { + message.resource = reader.string(); + break; + } + case 2: { + message.options = $root.google.iam.v1.GetPolicyOptions.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -61643,6 +65705,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for GetIamPolicyRequest + * @function getTypeUrl + * @memberof google.iam.v1.GetIamPolicyRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetIamPolicyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.GetIamPolicyRequest"; + }; + return GetIamPolicyRequest; })(); @@ -61751,14 +65828,16 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.resource = reader.string(); - break; - case 2: - if (!(message.permissions && message.permissions.length)) - message.permissions = []; - message.permissions.push(reader.string()); - break; + case 1: { + message.resource = reader.string(); + break; + } + case 2: { + if (!(message.permissions && message.permissions.length)) + message.permissions = []; + message.permissions.push(reader.string()); + break; + } default: reader.skipType(tag & 7); break; @@ -61869,6 +65948,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for TestIamPermissionsRequest + * @function getTypeUrl + * @memberof google.iam.v1.TestIamPermissionsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TestIamPermissionsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.TestIamPermissionsRequest"; + }; + return TestIamPermissionsRequest; })(); @@ -61966,11 +66060,12 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - if (!(message.permissions && message.permissions.length)) - message.permissions = []; - message.permissions.push(reader.string()); - break; + case 1: { + if (!(message.permissions && message.permissions.length)) + message.permissions = []; + message.permissions.push(reader.string()); + break; + } default: reader.skipType(tag & 7); break; @@ -62072,6 +66167,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for TestIamPermissionsResponse + * @function getTypeUrl + * @memberof google.iam.v1.TestIamPermissionsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TestIamPermissionsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.TestIamPermissionsResponse"; + }; + return TestIamPermissionsResponse; })(); @@ -62167,9 +66277,10 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.requestedPolicyVersion = reader.int32(); - break; + case 1: { + message.requestedPolicyVersion = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -62259,6 +66370,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for GetPolicyOptions + * @function getTypeUrl + * @memberof google.iam.v1.GetPolicyOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetPolicyOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.GetPolicyOptions"; + }; + return GetPolicyOptions; })(); @@ -62270,6 +66396,7 @@ * @interface IPolicy * @property {number|null} [version] Policy version * @property {Array.|null} [bindings] Policy bindings + * @property {Array.|null} [auditConfigs] Policy auditConfigs * @property {Uint8Array|null} [etag] Policy etag */ @@ -62283,6 +66410,7 @@ */ function Policy(properties) { this.bindings = []; + this.auditConfigs = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -62305,6 +66433,14 @@ */ Policy.prototype.bindings = $util.emptyArray; + /** + * Policy auditConfigs. + * @member {Array.} auditConfigs + * @memberof google.iam.v1.Policy + * @instance + */ + Policy.prototype.auditConfigs = $util.emptyArray; + /** * Policy etag. * @member {Uint8Array} etag @@ -62344,6 +66480,9 @@ if (message.bindings != null && message.bindings.length) for (var i = 0; i < message.bindings.length; ++i) $root.google.iam.v1.Binding.encode(message.bindings[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.auditConfigs != null && message.auditConfigs.length) + for (var i = 0; i < message.auditConfigs.length; ++i) + $root.google.iam.v1.AuditConfig.encode(message.auditConfigs[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); return writer; }; @@ -62378,17 +66517,26 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.version = reader.int32(); - break; - case 4: - if (!(message.bindings && message.bindings.length)) - message.bindings = []; - message.bindings.push($root.google.iam.v1.Binding.decode(reader, reader.uint32())); - break; - case 3: - message.etag = reader.bytes(); - break; + case 1: { + message.version = reader.int32(); + break; + } + case 4: { + if (!(message.bindings && message.bindings.length)) + message.bindings = []; + message.bindings.push($root.google.iam.v1.Binding.decode(reader, reader.uint32())); + break; + } + case 6: { + if (!(message.auditConfigs && message.auditConfigs.length)) + message.auditConfigs = []; + message.auditConfigs.push($root.google.iam.v1.AuditConfig.decode(reader, reader.uint32())); + break; + } + case 3: { + message.etag = reader.bytes(); + break; + } default: reader.skipType(tag & 7); break; @@ -62436,6 +66584,15 @@ return "bindings." + error; } } + if (message.auditConfigs != null && message.hasOwnProperty("auditConfigs")) { + if (!Array.isArray(message.auditConfigs)) + return "auditConfigs: array expected"; + for (var i = 0; i < message.auditConfigs.length; ++i) { + var error = $root.google.iam.v1.AuditConfig.verify(message.auditConfigs[i]); + if (error) + return "auditConfigs." + error; + } + } if (message.etag != null && message.hasOwnProperty("etag")) if (!(message.etag && typeof message.etag.length === "number" || $util.isString(message.etag))) return "etag: buffer expected"; @@ -62466,10 +66623,20 @@ message.bindings[i] = $root.google.iam.v1.Binding.fromObject(object.bindings[i]); } } + if (object.auditConfigs) { + if (!Array.isArray(object.auditConfigs)) + throw TypeError(".google.iam.v1.Policy.auditConfigs: array expected"); + message.auditConfigs = []; + for (var i = 0; i < object.auditConfigs.length; ++i) { + if (typeof object.auditConfigs[i] !== "object") + throw TypeError(".google.iam.v1.Policy.auditConfigs: object expected"); + message.auditConfigs[i] = $root.google.iam.v1.AuditConfig.fromObject(object.auditConfigs[i]); + } + } if (object.etag != null) if (typeof object.etag === "string") $util.base64.decode(object.etag, message.etag = $util.newBuffer($util.base64.length(object.etag)), 0); - else if (object.etag.length) + else if (object.etag.length >= 0) message.etag = object.etag; return message; }; @@ -62487,8 +66654,10 @@ if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) + if (options.arrays || options.defaults) { object.bindings = []; + object.auditConfigs = []; + } if (options.defaults) { object.version = 0; if (options.bytes === String) @@ -62508,6 +66677,11 @@ for (var j = 0; j < message.bindings.length; ++j) object.bindings[j] = $root.google.iam.v1.Binding.toObject(message.bindings[j], options); } + if (message.auditConfigs && message.auditConfigs.length) { + object.auditConfigs = []; + for (var j = 0; j < message.auditConfigs.length; ++j) + object.auditConfigs[j] = $root.google.iam.v1.AuditConfig.toObject(message.auditConfigs[j], options); + } return object; }; @@ -62522,6 +66696,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for Policy + * @function getTypeUrl + * @memberof google.iam.v1.Policy + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Policy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.Policy"; + }; + return Policy; })(); @@ -62641,17 +66830,20 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.role = reader.string(); - break; - case 2: - if (!(message.members && message.members.length)) - message.members = []; - message.members.push(reader.string()); - break; - case 3: - message.condition = $root.google.type.Expr.decode(reader, reader.uint32()); - break; + case 1: { + message.role = reader.string(); + break; + } + case 2: { + if (!(message.members && message.members.length)) + message.members = []; + message.members.push(reader.string()); + break; + } + case 3: { + message.condition = $root.google.type.Expr.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -62776,9 +66968,556 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for Binding + * @function getTypeUrl + * @memberof google.iam.v1.Binding + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Binding.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.Binding"; + }; + return Binding; })(); + v1.AuditConfig = (function() { + + /** + * Properties of an AuditConfig. + * @memberof google.iam.v1 + * @interface IAuditConfig + * @property {string|null} [service] AuditConfig service + * @property {Array.|null} [auditLogConfigs] AuditConfig auditLogConfigs + */ + + /** + * Constructs a new AuditConfig. + * @memberof google.iam.v1 + * @classdesc Represents an AuditConfig. + * @implements IAuditConfig + * @constructor + * @param {google.iam.v1.IAuditConfig=} [properties] Properties to set + */ + function AuditConfig(properties) { + this.auditLogConfigs = []; + 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]]; + } + + /** + * AuditConfig service. + * @member {string} service + * @memberof google.iam.v1.AuditConfig + * @instance + */ + AuditConfig.prototype.service = ""; + + /** + * AuditConfig auditLogConfigs. + * @member {Array.} auditLogConfigs + * @memberof google.iam.v1.AuditConfig + * @instance + */ + AuditConfig.prototype.auditLogConfigs = $util.emptyArray; + + /** + * Creates a new AuditConfig instance using the specified properties. + * @function create + * @memberof google.iam.v1.AuditConfig + * @static + * @param {google.iam.v1.IAuditConfig=} [properties] Properties to set + * @returns {google.iam.v1.AuditConfig} AuditConfig instance + */ + AuditConfig.create = function create(properties) { + return new AuditConfig(properties); + }; + + /** + * Encodes the specified AuditConfig message. Does not implicitly {@link google.iam.v1.AuditConfig.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.AuditConfig + * @static + * @param {google.iam.v1.IAuditConfig} message AuditConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuditConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.service != null && Object.hasOwnProperty.call(message, "service")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.service); + if (message.auditLogConfigs != null && message.auditLogConfigs.length) + for (var i = 0; i < message.auditLogConfigs.length; ++i) + $root.google.iam.v1.AuditLogConfig.encode(message.auditLogConfigs[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AuditConfig message, length delimited. Does not implicitly {@link google.iam.v1.AuditConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.AuditConfig + * @static + * @param {google.iam.v1.IAuditConfig} message AuditConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuditConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AuditConfig message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.AuditConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.AuditConfig} AuditConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuditConfig.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.iam.v1.AuditConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.service = reader.string(); + break; + } + case 3: { + if (!(message.auditLogConfigs && message.auditLogConfigs.length)) + message.auditLogConfigs = []; + message.auditLogConfigs.push($root.google.iam.v1.AuditLogConfig.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AuditConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.AuditConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.AuditConfig} AuditConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuditConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AuditConfig message. + * @function verify + * @memberof google.iam.v1.AuditConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AuditConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.service != null && message.hasOwnProperty("service")) + if (!$util.isString(message.service)) + return "service: string expected"; + if (message.auditLogConfigs != null && message.hasOwnProperty("auditLogConfigs")) { + if (!Array.isArray(message.auditLogConfigs)) + return "auditLogConfigs: array expected"; + for (var i = 0; i < message.auditLogConfigs.length; ++i) { + var error = $root.google.iam.v1.AuditLogConfig.verify(message.auditLogConfigs[i]); + if (error) + return "auditLogConfigs." + error; + } + } + return null; + }; + + /** + * Creates an AuditConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.AuditConfig + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.AuditConfig} AuditConfig + */ + AuditConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.AuditConfig) + return object; + var message = new $root.google.iam.v1.AuditConfig(); + if (object.service != null) + message.service = String(object.service); + if (object.auditLogConfigs) { + if (!Array.isArray(object.auditLogConfigs)) + throw TypeError(".google.iam.v1.AuditConfig.auditLogConfigs: array expected"); + message.auditLogConfigs = []; + for (var i = 0; i < object.auditLogConfigs.length; ++i) { + if (typeof object.auditLogConfigs[i] !== "object") + throw TypeError(".google.iam.v1.AuditConfig.auditLogConfigs: object expected"); + message.auditLogConfigs[i] = $root.google.iam.v1.AuditLogConfig.fromObject(object.auditLogConfigs[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an AuditConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.AuditConfig + * @static + * @param {google.iam.v1.AuditConfig} message AuditConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AuditConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.auditLogConfigs = []; + if (options.defaults) + object.service = ""; + if (message.service != null && message.hasOwnProperty("service")) + object.service = message.service; + if (message.auditLogConfigs && message.auditLogConfigs.length) { + object.auditLogConfigs = []; + for (var j = 0; j < message.auditLogConfigs.length; ++j) + object.auditLogConfigs[j] = $root.google.iam.v1.AuditLogConfig.toObject(message.auditLogConfigs[j], options); + } + return object; + }; + + /** + * Converts this AuditConfig to JSON. + * @function toJSON + * @memberof google.iam.v1.AuditConfig + * @instance + * @returns {Object.} JSON object + */ + AuditConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AuditConfig + * @function getTypeUrl + * @memberof google.iam.v1.AuditConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AuditConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.AuditConfig"; + }; + + return AuditConfig; + })(); + + v1.AuditLogConfig = (function() { + + /** + * Properties of an AuditLogConfig. + * @memberof google.iam.v1 + * @interface IAuditLogConfig + * @property {google.iam.v1.AuditLogConfig.LogType|null} [logType] AuditLogConfig logType + * @property {Array.|null} [exemptedMembers] AuditLogConfig exemptedMembers + */ + + /** + * Constructs a new AuditLogConfig. + * @memberof google.iam.v1 + * @classdesc Represents an AuditLogConfig. + * @implements IAuditLogConfig + * @constructor + * @param {google.iam.v1.IAuditLogConfig=} [properties] Properties to set + */ + function AuditLogConfig(properties) { + this.exemptedMembers = []; + 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]]; + } + + /** + * AuditLogConfig logType. + * @member {google.iam.v1.AuditLogConfig.LogType} logType + * @memberof google.iam.v1.AuditLogConfig + * @instance + */ + AuditLogConfig.prototype.logType = 0; + + /** + * AuditLogConfig exemptedMembers. + * @member {Array.} exemptedMembers + * @memberof google.iam.v1.AuditLogConfig + * @instance + */ + AuditLogConfig.prototype.exemptedMembers = $util.emptyArray; + + /** + * Creates a new AuditLogConfig instance using the specified properties. + * @function create + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {google.iam.v1.IAuditLogConfig=} [properties] Properties to set + * @returns {google.iam.v1.AuditLogConfig} AuditLogConfig instance + */ + AuditLogConfig.create = function create(properties) { + return new AuditLogConfig(properties); + }; + + /** + * Encodes the specified AuditLogConfig message. Does not implicitly {@link google.iam.v1.AuditLogConfig.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {google.iam.v1.IAuditLogConfig} message AuditLogConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuditLogConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.logType != null && Object.hasOwnProperty.call(message, "logType")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.logType); + if (message.exemptedMembers != null && message.exemptedMembers.length) + for (var i = 0; i < message.exemptedMembers.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.exemptedMembers[i]); + return writer; + }; + + /** + * Encodes the specified AuditLogConfig message, length delimited. Does not implicitly {@link google.iam.v1.AuditLogConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {google.iam.v1.IAuditLogConfig} message AuditLogConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuditLogConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AuditLogConfig message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.AuditLogConfig} AuditLogConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuditLogConfig.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.iam.v1.AuditLogConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.logType = reader.int32(); + break; + } + case 2: { + if (!(message.exemptedMembers && message.exemptedMembers.length)) + message.exemptedMembers = []; + message.exemptedMembers.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AuditLogConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.AuditLogConfig} AuditLogConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuditLogConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AuditLogConfig message. + * @function verify + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AuditLogConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.logType != null && message.hasOwnProperty("logType")) + switch (message.logType) { + default: + return "logType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.exemptedMembers != null && message.hasOwnProperty("exemptedMembers")) { + if (!Array.isArray(message.exemptedMembers)) + return "exemptedMembers: array expected"; + for (var i = 0; i < message.exemptedMembers.length; ++i) + if (!$util.isString(message.exemptedMembers[i])) + return "exemptedMembers: string[] expected"; + } + return null; + }; + + /** + * Creates an AuditLogConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.AuditLogConfig} AuditLogConfig + */ + AuditLogConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.AuditLogConfig) + return object; + var message = new $root.google.iam.v1.AuditLogConfig(); + switch (object.logType) { + case "LOG_TYPE_UNSPECIFIED": + case 0: + message.logType = 0; + break; + case "ADMIN_READ": + case 1: + message.logType = 1; + break; + case "DATA_WRITE": + case 2: + message.logType = 2; + break; + case "DATA_READ": + case 3: + message.logType = 3; + break; + } + if (object.exemptedMembers) { + if (!Array.isArray(object.exemptedMembers)) + throw TypeError(".google.iam.v1.AuditLogConfig.exemptedMembers: array expected"); + message.exemptedMembers = []; + for (var i = 0; i < object.exemptedMembers.length; ++i) + message.exemptedMembers[i] = String(object.exemptedMembers[i]); + } + return message; + }; + + /** + * Creates a plain object from an AuditLogConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {google.iam.v1.AuditLogConfig} message AuditLogConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AuditLogConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.exemptedMembers = []; + if (options.defaults) + object.logType = options.enums === String ? "LOG_TYPE_UNSPECIFIED" : 0; + if (message.logType != null && message.hasOwnProperty("logType")) + object.logType = options.enums === String ? $root.google.iam.v1.AuditLogConfig.LogType[message.logType] : message.logType; + if (message.exemptedMembers && message.exemptedMembers.length) { + object.exemptedMembers = []; + for (var j = 0; j < message.exemptedMembers.length; ++j) + object.exemptedMembers[j] = message.exemptedMembers[j]; + } + return object; + }; + + /** + * Converts this AuditLogConfig to JSON. + * @function toJSON + * @memberof google.iam.v1.AuditLogConfig + * @instance + * @returns {Object.} JSON object + */ + AuditLogConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AuditLogConfig + * @function getTypeUrl + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AuditLogConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.AuditLogConfig"; + }; + + /** + * LogType enum. + * @name google.iam.v1.AuditLogConfig.LogType + * @enum {number} + * @property {number} LOG_TYPE_UNSPECIFIED=0 LOG_TYPE_UNSPECIFIED value + * @property {number} ADMIN_READ=1 ADMIN_READ value + * @property {number} DATA_WRITE=2 DATA_WRITE value + * @property {number} DATA_READ=3 DATA_READ value + */ + AuditLogConfig.LogType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "LOG_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ADMIN_READ"] = 1; + values[valuesById[2] = "DATA_WRITE"] = 2; + values[valuesById[3] = "DATA_READ"] = 3; + return values; + })(); + + return AuditLogConfig; + })(); + v1.PolicyDelta = (function() { /** @@ -62886,16 +67625,18 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - if (!(message.bindingDeltas && message.bindingDeltas.length)) - message.bindingDeltas = []; - message.bindingDeltas.push($root.google.iam.v1.BindingDelta.decode(reader, reader.uint32())); - break; - case 2: - if (!(message.auditConfigDeltas && message.auditConfigDeltas.length)) - message.auditConfigDeltas = []; - message.auditConfigDeltas.push($root.google.iam.v1.AuditConfigDelta.decode(reader, reader.uint32())); - break; + case 1: { + if (!(message.bindingDeltas && message.bindingDeltas.length)) + message.bindingDeltas = []; + message.bindingDeltas.push($root.google.iam.v1.BindingDelta.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.auditConfigDeltas && message.auditConfigDeltas.length)) + message.auditConfigDeltas = []; + message.auditConfigDeltas.push($root.google.iam.v1.AuditConfigDelta.decode(reader, reader.uint32())); + break; + } default: reader.skipType(tag & 7); break; @@ -63028,6 +67769,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for PolicyDelta + * @function getTypeUrl + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PolicyDelta.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.PolicyDelta"; + }; + return PolicyDelta; })(); @@ -63156,18 +67912,22 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.action = reader.int32(); - break; - case 2: - message.role = reader.string(); - break; - case 3: - message.member = reader.string(); - break; - case 4: - message.condition = $root.google.type.Expr.decode(reader, reader.uint32()); - break; + case 1: { + message.action = reader.int32(); + break; + } + case 2: { + message.role = reader.string(); + break; + } + case 3: { + message.member = reader.string(); + break; + } + case 4: { + message.condition = $root.google.type.Expr.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -63305,6 +68065,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for BindingDelta + * @function getTypeUrl + * @memberof google.iam.v1.BindingDelta + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BindingDelta.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.BindingDelta"; + }; + /** * Action enum. * @name google.iam.v1.BindingDelta.Action @@ -63449,18 +68224,22 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.action = reader.int32(); - break; - case 2: - message.service = reader.string(); - break; - case 3: - message.exemptedMember = reader.string(); - break; - case 4: - message.logType = reader.string(); - break; + case 1: { + message.action = reader.int32(); + break; + } + case 2: { + message.service = reader.string(); + break; + } + case 3: { + message.exemptedMember = reader.string(); + break; + } + case 4: { + message.logType = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -63593,6 +68372,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for AuditConfigDelta + * @function getTypeUrl + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AuditConfigDelta.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.AuditConfigDelta"; + }; + /** * Action enum. * @name google.iam.v1.AuditConfigDelta.Action @@ -63752,18 +68546,22 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.expression = reader.string(); - break; - case 2: - message.title = reader.string(); - break; - case 3: - message.description = reader.string(); - break; - case 4: - message.location = reader.string(); - break; + case 1: { + message.expression = reader.string(); + break; + } + case 2: { + message.title = reader.string(); + break; + } + case 3: { + message.description = reader.string(); + break; + } + case 4: { + message.location = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -63878,6 +68676,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for Expr + * @function getTypeUrl + * @memberof google.type.Expr + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Expr.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.type.Expr"; + }; + return Expr; })(); @@ -63926,7 +68739,7 @@ }; /** - * Callback as used by {@link google.longrunning.Operations#listOperations}. + * Callback as used by {@link google.longrunning.Operations|listOperations}. * @memberof google.longrunning.Operations * @typedef ListOperationsCallback * @type {function} @@ -63959,7 +68772,7 @@ */ /** - * Callback as used by {@link google.longrunning.Operations#getOperation}. + * Callback as used by {@link google.longrunning.Operations|getOperation}. * @memberof google.longrunning.Operations * @typedef GetOperationCallback * @type {function} @@ -63992,7 +68805,7 @@ */ /** - * Callback as used by {@link google.longrunning.Operations#deleteOperation}. + * Callback as used by {@link google.longrunning.Operations|deleteOperation}. * @memberof google.longrunning.Operations * @typedef DeleteOperationCallback * @type {function} @@ -64025,7 +68838,7 @@ */ /** - * Callback as used by {@link google.longrunning.Operations#cancelOperation}. + * Callback as used by {@link google.longrunning.Operations|cancelOperation}. * @memberof google.longrunning.Operations * @typedef CancelOperationCallback * @type {function} @@ -64058,7 +68871,7 @@ */ /** - * Callback as used by {@link google.longrunning.Operations#waitOperation}. + * Callback as used by {@link google.longrunning.Operations|waitOperation}. * @memberof google.longrunning.Operations * @typedef WaitOperationCallback * @type {function} @@ -64243,21 +69056,26 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.metadata = $root.google.protobuf.Any.decode(reader, reader.uint32()); - break; - case 3: - message.done = reader.bool(); - break; - case 4: - message.error = $root.google.rpc.Status.decode(reader, reader.uint32()); - break; - case 5: - message.response = $root.google.protobuf.Any.decode(reader, reader.uint32()); - break; + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.metadata = $root.google.protobuf.Any.decode(reader, reader.uint32()); + break; + } + case 3: { + message.done = reader.bool(); + break; + } + case 4: { + message.error = $root.google.rpc.Status.decode(reader, reader.uint32()); + break; + } + case 5: { + message.response = $root.google.protobuf.Any.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -64408,6 +69226,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for Operation + * @function getTypeUrl + * @memberof google.longrunning.Operation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Operation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.Operation"; + }; + return Operation; })(); @@ -64503,9 +69336,10 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; + case 1: { + message.name = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -64595,6 +69429,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for GetOperationRequest + * @function getTypeUrl + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.GetOperationRequest"; + }; + return GetOperationRequest; })(); @@ -64723,18 +69572,22 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 4: - message.name = reader.string(); - break; - case 1: - message.filter = reader.string(); - break; - case 2: - message.pageSize = reader.int32(); - break; - case 3: - message.pageToken = reader.string(); - break; + case 4: { + message.name = reader.string(); + break; + } + case 1: { + message.filter = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -64849,6 +69702,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for ListOperationsRequest + * @function getTypeUrl + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListOperationsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.ListOperationsRequest"; + }; + return ListOperationsRequest; })(); @@ -64957,14 +69825,16 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - if (!(message.operations && message.operations.length)) - message.operations = []; - message.operations.push($root.google.longrunning.Operation.decode(reader, reader.uint32())); - break; - case 2: - message.nextPageToken = reader.string(); - break; + case 1: { + if (!(message.operations && message.operations.length)) + message.operations = []; + message.operations.push($root.google.longrunning.Operation.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -65080,6 +69950,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for ListOperationsResponse + * @function getTypeUrl + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListOperationsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.ListOperationsResponse"; + }; + return ListOperationsResponse; })(); @@ -65175,9 +70060,10 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; + case 1: { + message.name = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -65267,6 +70153,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for CancelOperationRequest + * @function getTypeUrl + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CancelOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.CancelOperationRequest"; + }; + return CancelOperationRequest; })(); @@ -65362,9 +70263,10 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; + case 1: { + message.name = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -65454,6 +70356,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for DeleteOperationRequest + * @function getTypeUrl + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.DeleteOperationRequest"; + }; + return DeleteOperationRequest; })(); @@ -65560,12 +70477,14 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.timeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.timeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -65669,6 +70588,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for WaitOperationRequest + * @function getTypeUrl + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + WaitOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.WaitOperationRequest"; + }; + return WaitOperationRequest; })(); @@ -65775,12 +70709,14 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.responseType = reader.string(); - break; - case 2: - message.metadataType = reader.string(); - break; + case 1: { + message.responseType = reader.string(); + break; + } + case 2: { + message.metadataType = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -65879,6 +70815,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for OperationInfo + * @function getTypeUrl + * @memberof google.longrunning.OperationInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OperationInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.OperationInfo"; + }; + return OperationInfo; })(); @@ -66010,17 +70961,20 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.code = reader.int32(); - break; - case 2: - message.message = reader.string(); - break; - case 3: - if (!(message.details && message.details.length)) - message.details = []; - message.details.push($root.google.protobuf.Any.decode(reader, reader.uint32())); - break; + case 1: { + message.code = reader.int32(); + break; + } + case 2: { + message.message = reader.string(); + break; + } + case 3: { + if (!(message.details && message.details.length)) + message.details = []; + message.details.push($root.google.protobuf.Any.decode(reader, reader.uint32())); + break; + } default: reader.skipType(tag & 7); break; @@ -66145,6 +71099,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for Status + * @function getTypeUrl + * @memberof google.rpc.Status + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Status.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.rpc.Status"; + }; + return Status; })(); diff --git a/packages/google-cloud-securitycenter/protos/protos.json b/packages/google-cloud-securitycenter/protos/protos.json index d59a89de0ea..045161f08fa 100644 --- a/packages/google-cloud-securitycenter/protos/protos.json +++ b/packages/google-cloud-securitycenter/protos/protos.json @@ -6306,6 +6306,10 @@ "syntax": { "type": "string", "id": 12 + }, + "edition": { + "type": "string", + "id": 13 } } }, @@ -6834,6 +6838,13 @@ "default": false } }, + "unverifiedLazy": { + "type": "bool", + "id": 15, + "options": { + "default": false + } + }, "deprecated": { "type": "bool", "id": 3, @@ -7126,6 +7137,19 @@ "end": { "type": "int32", "id": 4 + }, + "semantic": { + "type": "Semantic", + "id": 5 + } + }, + "nested": { + "Semantic": { + "values": { + "NONE": 0, + "SET": 1, + "ALIAS": 2 + } } } } @@ -7218,6 +7242,15 @@ } } }, + "FieldMask": { + "fields": { + "paths": { + "rule": "repeated", + "type": "string", + "id": 1 + } + } + }, "Any": { "fields": { "type_url": { @@ -7232,15 +7265,6 @@ }, "Empty": { "fields": {} - }, - "FieldMask": { - "fields": { - "paths": { - "rule": "repeated", - "type": "string", - "id": 1 - } - } } } }, @@ -7328,6 +7352,10 @@ "options": { "(google.api.field_behavior)": "REQUIRED" } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 3 } } }, @@ -7395,6 +7423,11 @@ "type": "Binding", "id": 4 }, + "auditConfigs": { + "rule": "repeated", + "type": "AuditConfig", + "id": 6 + }, "etag": { "type": "bytes", "id": 3 @@ -7418,6 +7451,42 @@ } } }, + "AuditConfig": { + "fields": { + "service": { + "type": "string", + "id": 1 + }, + "auditLogConfigs": { + "rule": "repeated", + "type": "AuditLogConfig", + "id": 3 + } + } + }, + "AuditLogConfig": { + "fields": { + "logType": { + "type": "LogType", + "id": 1 + }, + "exemptedMembers": { + "rule": "repeated", + "type": "string", + "id": 2 + } + }, + "nested": { + "LogType": { + "values": { + "LOG_TYPE_UNSPECIFIED": 0, + "ADMIN_READ": 1, + "DATA_WRITE": 2, + "DATA_READ": 3 + } + } + } + }, "PolicyDelta": { "fields": { "bindingDeltas": { From f75d9bac5042f4781aeac21a7d86f42bb2726b0d Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Fri, 26 Aug 2022 12:23:12 -0700 Subject: [PATCH 330/342] chore(main): release 6.3.0 (#502) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(main): release 6.3.0 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> Co-authored-by: Owl Bot --- packages/google-cloud-securitycenter/CHANGELOG.md | 14 ++++++++++++++ packages/google-cloud-securitycenter/package.json | 2 +- ...et_metadata.google.cloud.securitycenter.v1.json | 2 +- ...tadata.google.cloud.securitycenter.v1beta1.json | 2 +- ...data.google.cloud.securitycenter.v1p1beta1.json | 2 +- .../samples/package.json | 2 +- 6 files changed, 19 insertions(+), 5 deletions(-) diff --git a/packages/google-cloud-securitycenter/CHANGELOG.md b/packages/google-cloud-securitycenter/CHANGELOG.md index dc9f8269190..5b12fbb660d 100644 --- a/packages/google-cloud-securitycenter/CHANGELOG.md +++ b/packages/google-cloud-securitycenter/CHANGELOG.md @@ -4,6 +4,20 @@ [1]: https://www.npmjs.com/package/@google-cloud/security-center?activeTab=versions +## [6.3.0](https://github.com/googleapis/nodejs-security-center/compare/v6.2.0...v6.3.0) (2022-08-23) + + +### Features + +* Adding uris to indicator of compromise (IOC) field ([bcf1a98](https://github.com/googleapis/nodejs-security-center/commit/bcf1a9875618b05830cbf787fb4676c92a3d2920)) + + +### Bug Fixes + +* better support for fallback mode ([#503](https://github.com/googleapis/nodejs-security-center/issues/503)) ([08f348c](https://github.com/googleapis/nodejs-security-center/commit/08f348ca11f4ef153201982280fc49e24a056e4c)) +* change import long to require ([#504](https://github.com/googleapis/nodejs-security-center/issues/504)) ([0eccdf0](https://github.com/googleapis/nodejs-security-center/commit/0eccdf080c75cf83ef4b2b5cd0b10dc98fd1596d)) +* remove pip install statements ([#1546](https://github.com/googleapis/nodejs-security-center/issues/1546)) ([#505](https://github.com/googleapis/nodejs-security-center/issues/505)) ([66a776b](https://github.com/googleapis/nodejs-security-center/commit/66a776b6e419c8d3980f126b98f7cb396e66cdca)) + ## [6.2.0](https://github.com/googleapis/nodejs-security-center/compare/v6.1.0...v6.2.0) (2022-07-29) diff --git a/packages/google-cloud-securitycenter/package.json b/packages/google-cloud-securitycenter/package.json index 46ba3ae3b92..c1923ac06d6 100644 --- a/packages/google-cloud-securitycenter/package.json +++ b/packages/google-cloud-securitycenter/package.json @@ -1,7 +1,7 @@ { "name": "@google-cloud/security-center", "description": "Cloud Security Command Center API client for Node.js", - "version": "6.2.0", + "version": "6.3.0", "license": "Apache-2.0", "author": "Google LLC", "engines": { diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/snippet_metadata.google.cloud.securitycenter.v1.json b/packages/google-cloud-securitycenter/samples/generated/v1/snippet_metadata.google.cloud.securitycenter.v1.json index 8702d489916..a01f6fa06fd 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/snippet_metadata.google.cloud.securitycenter.v1.json +++ b/packages/google-cloud-securitycenter/samples/generated/v1/snippet_metadata.google.cloud.securitycenter.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-securitycenter", - "version": "6.2.0", + "version": "6.3.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-securitycenter/samples/generated/v1beta1/snippet_metadata.google.cloud.securitycenter.v1beta1.json b/packages/google-cloud-securitycenter/samples/generated/v1beta1/snippet_metadata.google.cloud.securitycenter.v1beta1.json index 5cdbcd264f1..0570098009c 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1beta1/snippet_metadata.google.cloud.securitycenter.v1beta1.json +++ b/packages/google-cloud-securitycenter/samples/generated/v1beta1/snippet_metadata.google.cloud.securitycenter.v1beta1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-securitycenter", - "version": "6.2.0", + "version": "6.3.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/snippet_metadata.google.cloud.securitycenter.v1p1beta1.json b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/snippet_metadata.google.cloud.securitycenter.v1p1beta1.json index 73a1ae68dca..7fadcae588a 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/snippet_metadata.google.cloud.securitycenter.v1p1beta1.json +++ b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/snippet_metadata.google.cloud.securitycenter.v1p1beta1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-securitycenter", - "version": "6.2.0", + "version": "6.3.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-securitycenter/samples/package.json b/packages/google-cloud-securitycenter/samples/package.json index db532988647..224d5bcd753 100644 --- a/packages/google-cloud-securitycenter/samples/package.json +++ b/packages/google-cloud-securitycenter/samples/package.json @@ -14,7 +14,7 @@ "license": "Apache-2.0", "dependencies": { "@google-cloud/pubsub": "^3.0.0", - "@google-cloud/security-center": "^6.2.0" + "@google-cloud/security-center": "^6.3.0" }, "devDependencies": { "chai": "^4.2.0", From 29ba8b10b8cfcde069a0f7d24453747d55bc0800 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Sat, 27 Aug 2022 05:06:13 +0000 Subject: [PATCH 331/342] fix: do not import the whole google-gax from proto JS (#1553) (#507) fix: use google-gax v3.3.0 Source-Link: https://github.com/googleapis/synthtool/commit/c73d112a11a1f1a93efa67c50495c19aa3a88910 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-nodejs:latest@sha256:b15a6f06cc06dcffa11e1bebdf1a74b6775a134aac24a0f86f51ddf728eb373e --- packages/google-cloud-securitycenter/package.json | 2 +- packages/google-cloud-securitycenter/protos/protos.d.ts | 2 +- packages/google-cloud-securitycenter/protos/protos.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/google-cloud-securitycenter/package.json b/packages/google-cloud-securitycenter/package.json index c1923ac06d6..5cbd2fa0417 100644 --- a/packages/google-cloud-securitycenter/package.json +++ b/packages/google-cloud-securitycenter/package.json @@ -42,7 +42,7 @@ "Security Command Center API" ], "dependencies": { - "google-gax": "^3.0.1" + "google-gax": "^3.3.0" }, "devDependencies": { "@types/mocha": "^9.0.0", diff --git a/packages/google-cloud-securitycenter/protos/protos.d.ts b/packages/google-cloud-securitycenter/protos/protos.d.ts index 5a6165b0784..52014e5b68d 100644 --- a/packages/google-cloud-securitycenter/protos/protos.d.ts +++ b/packages/google-cloud-securitycenter/protos/protos.d.ts @@ -13,7 +13,7 @@ // limitations under the License. import Long = require("long"); -import {protobuf as $protobuf} from "google-gax"; +import type {protobuf as $protobuf} from "google-gax"; /** Namespace google. */ export namespace google { diff --git a/packages/google-cloud-securitycenter/protos/protos.js b/packages/google-cloud-securitycenter/protos/protos.js index 67afe0c8b02..612c24cbf41 100644 --- a/packages/google-cloud-securitycenter/protos/protos.js +++ b/packages/google-cloud-securitycenter/protos/protos.js @@ -19,7 +19,7 @@ define(["protobufjs/minimal"], factory); /* CommonJS */ else if (typeof require === 'function' && typeof module === 'object' && module && module.exports) - module.exports = factory(require("google-gax").protobufMinimal); + module.exports = factory(require("google-gax/build/src/protobuf").protobufMinimal); })(this, function($protobuf) { "use strict"; From 92393c666479dfcd42337f4370f2bc0bc028c344 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 1 Sep 2022 20:48:21 +0000 Subject: [PATCH 332/342] fix: allow passing gax instance to client constructor (#506) - [ ] Regenerate this pull request now. PiperOrigin-RevId: 470911839 Source-Link: https://github.com/googleapis/googleapis/commit/352756699ebc5b2144c252867c265ea44448712e Source-Link: https://github.com/googleapis/googleapis-gen/commit/f16a1d224f00a630ea43d6a9a1a31f566f45cdea Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZjE2YTFkMjI0ZjAwYTYzMGVhNDNkNmE5YTFhMzFmNTY2ZjQ1Y2RlYSJ9 feat: accept google-gax instance as a parameter Please see the documentation of the client constructor for details. PiperOrigin-RevId: 470332808 Source-Link: https://github.com/googleapis/googleapis/commit/d4a23675457cd8f0b44080e0594ec72de1291b89 Source-Link: https://github.com/googleapis/googleapis-gen/commit/e97a1ac204ead4fe7341f91e72db7c6ac6016341 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZTk3YTFhYzIwNGVhZDRmZTczNDFmOTFlNzJkYjdjNmFjNjAxNjM0MSJ9 feat: serviceAccountKeyName, serviceAccountDelegationInfo, and principalSubject attributes added to the existing access attribute. These new attributes provide additional context about the principals that are associated with the finding PiperOrigin-RevId: 469787268 Source-Link: https://github.com/googleapis/googleapis/commit/c7a52f4e986a72015aa4ba430bfb5e7508282516 Source-Link: https://github.com/googleapis/googleapis-gen/commit/4e235765c3f09662143bc0a2b08f12bc0fe0c93f Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNGUyMzU3NjVjM2YwOTY2MjE0M2JjMGEyYjA4ZjEyYmMwZmUwYzkzZiJ9 feat: Adding database access information, such as queries field to a finding. A database may be a sub-resource of an instance (as in the case of CloudSQL instances or Cloud Spanner instances), or the database instance itself PiperOrigin-RevId: 469544940 Source-Link: https://github.com/googleapis/googleapis/commit/a887434dd3a1c3b2aa78f142f11d21b5825ffa3e Source-Link: https://github.com/googleapis/googleapis-gen/commit/ca12635e1b065de9efcaa551669648fcbde1a944 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiY2ExMjYzNWUxYjA2NWRlOWVmY2FhNTUxNjY5NjQ4ZmNiZGUxYTk0NCJ9 --- .../cloud/securitycenter/v1/access.proto | 46 ++ .../cloud/securitycenter/v1/database.proto | 52 ++ .../cloud/securitycenter/v1/finding.proto | 23 +- .../protos/protos.d.ts | 248 +++++++ .../protos/protos.js | 659 ++++++++++++++++++ .../protos/protos.json | 54 ++ .../src/v1/security_center_client.ts | 151 ++-- .../src/v1/security_center_proto_list.json | 1 + .../src/v1beta1/security_center_client.ts | 92 +-- .../src/v1p1beta1/security_center_client.ts | 106 +-- 10 files changed, 1271 insertions(+), 161 deletions(-) create mode 100644 packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/database.proto diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/access.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/access.proto index e1b572471f1..799b84fcccb 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/access.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/access.proto @@ -27,6 +27,13 @@ option ruby_package = "Google::Cloud::SecurityCenter::V1"; // Represents an access event. message Access { // Associated email, such as "foo@google.com". + // + // The email address of the authenticated user (or service account on behalf + // of third party principal) making the request. For third party identity + // callers, the `principal_subject` field is populated instead of this field. + // For privacy reasons, the principal email address is sometimes redacted. + // For more information, see [Caller identities in audit + // logs](https://cloud.google.com/logging/docs/audit#user-id). string principal_email = 1; // Caller's IP address, such as "1.1.1.1". @@ -45,6 +52,45 @@ message Access { // The method that the service account called, e.g. "SetIamPolicy". string method_name = 6; + + // A string representing the principal_subject associated with the identity. + // As compared to `principal_email`, supports principals that aren't + // associated with email addresses, such as third party principals. For most + // identities, the format will be `principal://iam.googleapis.com/{identity + // pool name}/subjects/{subject}` except for some GKE identities + // (GKE_WORKLOAD, FREEFORM, GKE_HUB_WORKLOAD) that are still in the legacy + // format `serviceAccount:{identity pool name}[{subject}]` + string principal_subject = 7; + + // The name of the service account key used to create or exchange + // credentials for authenticating the service account making the request. + // This is a scheme-less URI full resource name. For example: + // + // "//iam.googleapis.com/projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}/keys/{key}" + // + string service_account_key_name = 8; + + // Identity delegation history of an authenticated service account that makes + // the request. It contains information on the real authorities that try to + // access GCP resources by delegating on a service account. When multiple + // authorities are present, they are guaranteed to be sorted based on the + // original ordering of the identity delegation events. + repeated ServiceAccountDelegationInfo service_account_delegation_info = 9; +} + +// Identity delegation history of an authenticated service account. +message ServiceAccountDelegationInfo { + // The email address of a Google account. + string principal_email = 1; + + // A string representing the principal_subject associated with the identity. + // As compared to `principal_email`, supports principals that aren't + // associated with email addresses, such as third party principals. For most + // identities, the format will be `principal://iam.googleapis.com/{identity + // pool name}/subjects/{subject}` except for some GKE identities + // (GKE_WORKLOAD, FREEFORM, GKE_HUB_WORKLOAD) that are still in the legacy + // format `serviceAccount:{identity pool name}[{subject}]` + string principal_subject = 2; } // Represents a geographical location for a given access. diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/database.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/database.proto new file mode 100644 index 00000000000..276b31004ee --- /dev/null +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/database.proto @@ -0,0 +1,52 @@ +// 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.cloud.securitycenter.v1; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1;securitycenter"; +option java_multiple_files = true; +option java_outer_classname = "DatabaseProto"; +option java_package = "com.google.cloud.securitycenter.v1"; +option php_namespace = "Google\\Cloud\\SecurityCenter\\V1"; +option ruby_package = "Google::Cloud::SecurityCenter::V1"; + +// Represents database access information, such as queries. +// A database may be a sub-resource of an instance (as in the case of CloudSQL +// instances or Cloud Spanner instances), or the database instance itself. +// Some database resources may not have the full resource name populated +// because these resource types are not yet supported by Cloud Asset Inventory +// (e.g. CloudSQL databases). In these cases only the display name will be +// provided. +message Database { + // The full resource name of the database the user connected to, if it is + // supported by CAI. (https://google.aip.dev/122#full-resource-names) + string name = 1; + + // The human readable name of the database the user connected to. + string display_name = 2; + + // The username used to connect to the DB. This may not necessarily be an IAM + // principal, and has no required format. + string user_name = 3; + + // The SQL statement associated with the relevant access. + string query = 4; + + // The target usernames/roles/groups of a SQL privilege grant (not an IAM + // policy change). + repeated string grantees = 5; +} diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/finding.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/finding.proto index 6c6043b5b24..8fbd9421f55 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/finding.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/finding.proto @@ -23,6 +23,7 @@ import "google/cloud/securitycenter/v1/compliance.proto"; import "google/cloud/securitycenter/v1/connection.proto"; import "google/cloud/securitycenter/v1/contact_details.proto"; import "google/cloud/securitycenter/v1/container.proto"; +import "google/cloud/securitycenter/v1/database.proto"; import "google/cloud/securitycenter/v1/exfiltration.proto"; import "google/cloud/securitycenter/v1/external_system.proto"; import "google/cloud/securitycenter/v1/iam_binding.proto"; @@ -257,11 +258,13 @@ message Finding { Vulnerability vulnerability = 20; // Output only. The most recent time this finding was muted or unmuted. - google.protobuf.Timestamp mute_update_time = 21 [(google.api.field_behavior) = OUTPUT_ONLY]; + google.protobuf.Timestamp mute_update_time = 21 + [(google.api.field_behavior) = OUTPUT_ONLY]; - // Output only. Third party SIEM/SOAR fields within SCC, contains external system - // information and external system finding fields. - map external_systems = 22 [(google.api.field_behavior) = OUTPUT_ONLY]; + // Output only. Third party SIEM/SOAR fields within SCC, contains external + // system information and external system finding fields. + map external_systems = 22 + [(google.api.field_behavior) = OUTPUT_ONLY]; // MITRE ATT&CK tactics and techniques related to this finding. // See: https://attack.mitre.org @@ -283,9 +286,9 @@ message Finding { // Represents operating system processes associated with the Finding. repeated Process processes = 30; - // Output only. Map containing the point of contacts for the given finding. The key - // represents the type of contact, while the value contains a list of all the - // contacts that pertain. Please refer to: + // Output only. Map containing the point of contacts for the given finding. + // The key represents the type of contact, while the value contains a list of + // all the contacts that pertain. Please refer to: // https://cloud.google.com/resource-manager/docs/managing-notification-contacts#notification-categories // // { @@ -300,7 +303,8 @@ message Finding { // ] // } // } - map contacts = 33 [(google.api.field_behavior) = OUTPUT_ONLY]; + map contacts = 33 + [(google.api.field_behavior) = OUTPUT_ONLY]; // Contains compliance information for security standards associated to the // finding. @@ -324,4 +328,7 @@ message Finding { // Kubernetes resources associated with the finding. Kubernetes kubernetes = 43; + + // Database associated with the finding. + Database database = 44; } diff --git a/packages/google-cloud-securitycenter/protos/protos.d.ts b/packages/google-cloud-securitycenter/protos/protos.d.ts index 52014e5b68d..333fe7c68d0 100644 --- a/packages/google-cloud-securitycenter/protos/protos.d.ts +++ b/packages/google-cloud-securitycenter/protos/protos.d.ts @@ -46,6 +46,15 @@ export namespace google { /** Access methodName */ methodName?: (string|null); + + /** Access principalSubject */ + principalSubject?: (string|null); + + /** Access serviceAccountKeyName */ + serviceAccountKeyName?: (string|null); + + /** Access serviceAccountDelegationInfo */ + serviceAccountDelegationInfo?: (google.cloud.securitycenter.v1.IServiceAccountDelegationInfo[]|null); } /** Represents an Access. */ @@ -75,6 +84,15 @@ export namespace google { /** Access methodName. */ public methodName: string; + /** Access principalSubject. */ + public principalSubject: string; + + /** Access serviceAccountKeyName. */ + public serviceAccountKeyName: string; + + /** Access serviceAccountDelegationInfo. */ + public serviceAccountDelegationInfo: google.cloud.securitycenter.v1.IServiceAccountDelegationInfo[]; + /** * Creates a new Access instance using the specified properties. * @param [properties] Properties to set @@ -153,6 +171,109 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + /** Properties of a ServiceAccountDelegationInfo. */ + interface IServiceAccountDelegationInfo { + + /** ServiceAccountDelegationInfo principalEmail */ + principalEmail?: (string|null); + + /** ServiceAccountDelegationInfo principalSubject */ + principalSubject?: (string|null); + } + + /** Represents a ServiceAccountDelegationInfo. */ + class ServiceAccountDelegationInfo implements IServiceAccountDelegationInfo { + + /** + * Constructs a new ServiceAccountDelegationInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IServiceAccountDelegationInfo); + + /** ServiceAccountDelegationInfo principalEmail. */ + public principalEmail: string; + + /** ServiceAccountDelegationInfo principalSubject. */ + public principalSubject: string; + + /** + * Creates a new ServiceAccountDelegationInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceAccountDelegationInfo instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IServiceAccountDelegationInfo): google.cloud.securitycenter.v1.ServiceAccountDelegationInfo; + + /** + * Encodes the specified ServiceAccountDelegationInfo message. Does not implicitly {@link google.cloud.securitycenter.v1.ServiceAccountDelegationInfo.verify|verify} messages. + * @param message ServiceAccountDelegationInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IServiceAccountDelegationInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ServiceAccountDelegationInfo message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ServiceAccountDelegationInfo.verify|verify} messages. + * @param message ServiceAccountDelegationInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IServiceAccountDelegationInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceAccountDelegationInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ServiceAccountDelegationInfo + * @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.cloud.securitycenter.v1.ServiceAccountDelegationInfo; + + /** + * Decodes a ServiceAccountDelegationInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ServiceAccountDelegationInfo + * @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.cloud.securitycenter.v1.ServiceAccountDelegationInfo; + + /** + * Verifies a ServiceAccountDelegationInfo 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 ServiceAccountDelegationInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ServiceAccountDelegationInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.ServiceAccountDelegationInfo; + + /** + * Creates a plain object from a ServiceAccountDelegationInfo message. Also converts values to other types if specified. + * @param message ServiceAccountDelegationInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.ServiceAccountDelegationInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ServiceAccountDelegationInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ServiceAccountDelegationInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** Properties of a Geolocation. */ interface IGeolocation { @@ -1640,6 +1761,127 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + /** Properties of a Database. */ + interface IDatabase { + + /** Database name */ + name?: (string|null); + + /** Database displayName */ + displayName?: (string|null); + + /** Database userName */ + userName?: (string|null); + + /** Database query */ + query?: (string|null); + + /** Database grantees */ + grantees?: (string[]|null); + } + + /** Represents a Database. */ + class Database implements IDatabase { + + /** + * Constructs a new Database. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IDatabase); + + /** Database name. */ + public name: string; + + /** Database displayName. */ + public displayName: string; + + /** Database userName. */ + public userName: string; + + /** Database query. */ + public query: string; + + /** Database grantees. */ + public grantees: string[]; + + /** + * Creates a new Database instance using the specified properties. + * @param [properties] Properties to set + * @returns Database instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IDatabase): google.cloud.securitycenter.v1.Database; + + /** + * Encodes the specified Database message. Does not implicitly {@link google.cloud.securitycenter.v1.Database.verify|verify} messages. + * @param message Database message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IDatabase, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Database message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Database.verify|verify} messages. + * @param message Database message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IDatabase, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Database message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Database + * @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.cloud.securitycenter.v1.Database; + + /** + * Decodes a Database message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Database + * @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.cloud.securitycenter.v1.Database; + + /** + * Verifies a Database 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 Database message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Database + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.Database; + + /** + * Creates a plain object from a Database message. Also converts values to other types if specified. + * @param message Database + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.Database, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Database to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Database + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** Properties of an Exfiltration. */ interface IExfiltration { @@ -2189,6 +2431,9 @@ export namespace google { /** Finding kubernetes */ kubernetes?: (google.cloud.securitycenter.v1.IKubernetes|null); + + /** Finding database */ + database?: (google.cloud.securitycenter.v1.IDatabase|null); } /** Represents a Finding. */ @@ -2293,6 +2538,9 @@ export namespace google { /** Finding kubernetes. */ public kubernetes?: (google.cloud.securitycenter.v1.IKubernetes|null); + /** Finding database. */ + public database?: (google.cloud.securitycenter.v1.IDatabase|null); + /** * Creates a new Finding instance using the specified properties. * @param [properties] Properties to set diff --git a/packages/google-cloud-securitycenter/protos/protos.js b/packages/google-cloud-securitycenter/protos/protos.js index 612c24cbf41..a1c63b3b2f5 100644 --- a/packages/google-cloud-securitycenter/protos/protos.js +++ b/packages/google-cloud-securitycenter/protos/protos.js @@ -78,6 +78,9 @@ * @property {string|null} [userAgentFamily] Access userAgentFamily * @property {string|null} [serviceName] Access serviceName * @property {string|null} [methodName] Access methodName + * @property {string|null} [principalSubject] Access principalSubject + * @property {string|null} [serviceAccountKeyName] Access serviceAccountKeyName + * @property {Array.|null} [serviceAccountDelegationInfo] Access serviceAccountDelegationInfo */ /** @@ -89,6 +92,7 @@ * @param {google.cloud.securitycenter.v1.IAccess=} [properties] Properties to set */ function Access(properties) { + this.serviceAccountDelegationInfo = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -143,6 +147,30 @@ */ Access.prototype.methodName = ""; + /** + * Access principalSubject. + * @member {string} principalSubject + * @memberof google.cloud.securitycenter.v1.Access + * @instance + */ + Access.prototype.principalSubject = ""; + + /** + * Access serviceAccountKeyName. + * @member {string} serviceAccountKeyName + * @memberof google.cloud.securitycenter.v1.Access + * @instance + */ + Access.prototype.serviceAccountKeyName = ""; + + /** + * Access serviceAccountDelegationInfo. + * @member {Array.} serviceAccountDelegationInfo + * @memberof google.cloud.securitycenter.v1.Access + * @instance + */ + Access.prototype.serviceAccountDelegationInfo = $util.emptyArray; + /** * Creates a new Access instance using the specified properties. * @function create @@ -179,6 +207,13 @@ writer.uint32(/* id 5, wireType 2 =*/42).string(message.serviceName); if (message.methodName != null && Object.hasOwnProperty.call(message, "methodName")) writer.uint32(/* id 6, wireType 2 =*/50).string(message.methodName); + if (message.principalSubject != null && Object.hasOwnProperty.call(message, "principalSubject")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.principalSubject); + if (message.serviceAccountKeyName != null && Object.hasOwnProperty.call(message, "serviceAccountKeyName")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.serviceAccountKeyName); + if (message.serviceAccountDelegationInfo != null && message.serviceAccountDelegationInfo.length) + for (var i = 0; i < message.serviceAccountDelegationInfo.length; ++i) + $root.google.cloud.securitycenter.v1.ServiceAccountDelegationInfo.encode(message.serviceAccountDelegationInfo[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); return writer; }; @@ -237,6 +272,20 @@ message.methodName = reader.string(); break; } + case 7: { + message.principalSubject = reader.string(); + break; + } + case 8: { + message.serviceAccountKeyName = reader.string(); + break; + } + case 9: { + if (!(message.serviceAccountDelegationInfo && message.serviceAccountDelegationInfo.length)) + message.serviceAccountDelegationInfo = []; + message.serviceAccountDelegationInfo.push($root.google.cloud.securitycenter.v1.ServiceAccountDelegationInfo.decode(reader, reader.uint32())); + break; + } default: reader.skipType(tag & 7); break; @@ -292,6 +341,21 @@ if (message.methodName != null && message.hasOwnProperty("methodName")) if (!$util.isString(message.methodName)) return "methodName: string expected"; + if (message.principalSubject != null && message.hasOwnProperty("principalSubject")) + if (!$util.isString(message.principalSubject)) + return "principalSubject: string expected"; + if (message.serviceAccountKeyName != null && message.hasOwnProperty("serviceAccountKeyName")) + if (!$util.isString(message.serviceAccountKeyName)) + return "serviceAccountKeyName: string expected"; + if (message.serviceAccountDelegationInfo != null && message.hasOwnProperty("serviceAccountDelegationInfo")) { + if (!Array.isArray(message.serviceAccountDelegationInfo)) + return "serviceAccountDelegationInfo: array expected"; + for (var i = 0; i < message.serviceAccountDelegationInfo.length; ++i) { + var error = $root.google.cloud.securitycenter.v1.ServiceAccountDelegationInfo.verify(message.serviceAccountDelegationInfo[i]); + if (error) + return "serviceAccountDelegationInfo." + error; + } + } return null; }; @@ -322,6 +386,20 @@ message.serviceName = String(object.serviceName); if (object.methodName != null) message.methodName = String(object.methodName); + if (object.principalSubject != null) + message.principalSubject = String(object.principalSubject); + if (object.serviceAccountKeyName != null) + message.serviceAccountKeyName = String(object.serviceAccountKeyName); + if (object.serviceAccountDelegationInfo) { + if (!Array.isArray(object.serviceAccountDelegationInfo)) + throw TypeError(".google.cloud.securitycenter.v1.Access.serviceAccountDelegationInfo: array expected"); + message.serviceAccountDelegationInfo = []; + for (var i = 0; i < object.serviceAccountDelegationInfo.length; ++i) { + if (typeof object.serviceAccountDelegationInfo[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Access.serviceAccountDelegationInfo: object expected"); + message.serviceAccountDelegationInfo[i] = $root.google.cloud.securitycenter.v1.ServiceAccountDelegationInfo.fromObject(object.serviceAccountDelegationInfo[i]); + } + } return message; }; @@ -338,6 +416,8 @@ if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) + object.serviceAccountDelegationInfo = []; if (options.defaults) { object.principalEmail = ""; object.callerIp = ""; @@ -345,6 +425,8 @@ object.userAgentFamily = ""; object.serviceName = ""; object.methodName = ""; + object.principalSubject = ""; + object.serviceAccountKeyName = ""; } if (message.principalEmail != null && message.hasOwnProperty("principalEmail")) object.principalEmail = message.principalEmail; @@ -358,6 +440,15 @@ object.serviceName = message.serviceName; if (message.methodName != null && message.hasOwnProperty("methodName")) object.methodName = message.methodName; + if (message.principalSubject != null && message.hasOwnProperty("principalSubject")) + object.principalSubject = message.principalSubject; + if (message.serviceAccountKeyName != null && message.hasOwnProperty("serviceAccountKeyName")) + object.serviceAccountKeyName = message.serviceAccountKeyName; + if (message.serviceAccountDelegationInfo && message.serviceAccountDelegationInfo.length) { + object.serviceAccountDelegationInfo = []; + for (var j = 0; j < message.serviceAccountDelegationInfo.length; ++j) + object.serviceAccountDelegationInfo[j] = $root.google.cloud.securitycenter.v1.ServiceAccountDelegationInfo.toObject(message.serviceAccountDelegationInfo[j], options); + } return object; }; @@ -390,6 +481,233 @@ return Access; })(); + v1.ServiceAccountDelegationInfo = (function() { + + /** + * Properties of a ServiceAccountDelegationInfo. + * @memberof google.cloud.securitycenter.v1 + * @interface IServiceAccountDelegationInfo + * @property {string|null} [principalEmail] ServiceAccountDelegationInfo principalEmail + * @property {string|null} [principalSubject] ServiceAccountDelegationInfo principalSubject + */ + + /** + * Constructs a new ServiceAccountDelegationInfo. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a ServiceAccountDelegationInfo. + * @implements IServiceAccountDelegationInfo + * @constructor + * @param {google.cloud.securitycenter.v1.IServiceAccountDelegationInfo=} [properties] Properties to set + */ + function ServiceAccountDelegationInfo(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]]; + } + + /** + * ServiceAccountDelegationInfo principalEmail. + * @member {string} principalEmail + * @memberof google.cloud.securitycenter.v1.ServiceAccountDelegationInfo + * @instance + */ + ServiceAccountDelegationInfo.prototype.principalEmail = ""; + + /** + * ServiceAccountDelegationInfo principalSubject. + * @member {string} principalSubject + * @memberof google.cloud.securitycenter.v1.ServiceAccountDelegationInfo + * @instance + */ + ServiceAccountDelegationInfo.prototype.principalSubject = ""; + + /** + * Creates a new ServiceAccountDelegationInfo instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.ServiceAccountDelegationInfo + * @static + * @param {google.cloud.securitycenter.v1.IServiceAccountDelegationInfo=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.ServiceAccountDelegationInfo} ServiceAccountDelegationInfo instance + */ + ServiceAccountDelegationInfo.create = function create(properties) { + return new ServiceAccountDelegationInfo(properties); + }; + + /** + * Encodes the specified ServiceAccountDelegationInfo message. Does not implicitly {@link google.cloud.securitycenter.v1.ServiceAccountDelegationInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.ServiceAccountDelegationInfo + * @static + * @param {google.cloud.securitycenter.v1.IServiceAccountDelegationInfo} message ServiceAccountDelegationInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceAccountDelegationInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.principalEmail != null && Object.hasOwnProperty.call(message, "principalEmail")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.principalEmail); + if (message.principalSubject != null && Object.hasOwnProperty.call(message, "principalSubject")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.principalSubject); + return writer; + }; + + /** + * Encodes the specified ServiceAccountDelegationInfo message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ServiceAccountDelegationInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.ServiceAccountDelegationInfo + * @static + * @param {google.cloud.securitycenter.v1.IServiceAccountDelegationInfo} message ServiceAccountDelegationInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceAccountDelegationInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ServiceAccountDelegationInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.ServiceAccountDelegationInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.ServiceAccountDelegationInfo} ServiceAccountDelegationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceAccountDelegationInfo.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.cloud.securitycenter.v1.ServiceAccountDelegationInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.principalEmail = reader.string(); + break; + } + case 2: { + message.principalSubject = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ServiceAccountDelegationInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.ServiceAccountDelegationInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.ServiceAccountDelegationInfo} ServiceAccountDelegationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceAccountDelegationInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ServiceAccountDelegationInfo message. + * @function verify + * @memberof google.cloud.securitycenter.v1.ServiceAccountDelegationInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ServiceAccountDelegationInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.principalEmail != null && message.hasOwnProperty("principalEmail")) + if (!$util.isString(message.principalEmail)) + return "principalEmail: string expected"; + if (message.principalSubject != null && message.hasOwnProperty("principalSubject")) + if (!$util.isString(message.principalSubject)) + return "principalSubject: string expected"; + return null; + }; + + /** + * Creates a ServiceAccountDelegationInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.ServiceAccountDelegationInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.ServiceAccountDelegationInfo} ServiceAccountDelegationInfo + */ + ServiceAccountDelegationInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.ServiceAccountDelegationInfo) + return object; + var message = new $root.google.cloud.securitycenter.v1.ServiceAccountDelegationInfo(); + if (object.principalEmail != null) + message.principalEmail = String(object.principalEmail); + if (object.principalSubject != null) + message.principalSubject = String(object.principalSubject); + return message; + }; + + /** + * Creates a plain object from a ServiceAccountDelegationInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.ServiceAccountDelegationInfo + * @static + * @param {google.cloud.securitycenter.v1.ServiceAccountDelegationInfo} message ServiceAccountDelegationInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ServiceAccountDelegationInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.principalEmail = ""; + object.principalSubject = ""; + } + if (message.principalEmail != null && message.hasOwnProperty("principalEmail")) + object.principalEmail = message.principalEmail; + if (message.principalSubject != null && message.hasOwnProperty("principalSubject")) + object.principalSubject = message.principalSubject; + return object; + }; + + /** + * Converts this ServiceAccountDelegationInfo to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.ServiceAccountDelegationInfo + * @instance + * @returns {Object.} JSON object + */ + ServiceAccountDelegationInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ServiceAccountDelegationInfo + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.ServiceAccountDelegationInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceAccountDelegationInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.ServiceAccountDelegationInfo"; + }; + + return ServiceAccountDelegationInfo; + })(); + v1.Geolocation = (function() { /** @@ -4111,6 +4429,319 @@ return Label; })(); + v1.Database = (function() { + + /** + * Properties of a Database. + * @memberof google.cloud.securitycenter.v1 + * @interface IDatabase + * @property {string|null} [name] Database name + * @property {string|null} [displayName] Database displayName + * @property {string|null} [userName] Database userName + * @property {string|null} [query] Database query + * @property {Array.|null} [grantees] Database grantees + */ + + /** + * Constructs a new Database. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a Database. + * @implements IDatabase + * @constructor + * @param {google.cloud.securitycenter.v1.IDatabase=} [properties] Properties to set + */ + function Database(properties) { + this.grantees = []; + 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]]; + } + + /** + * Database name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1.Database + * @instance + */ + Database.prototype.name = ""; + + /** + * Database displayName. + * @member {string} displayName + * @memberof google.cloud.securitycenter.v1.Database + * @instance + */ + Database.prototype.displayName = ""; + + /** + * Database userName. + * @member {string} userName + * @memberof google.cloud.securitycenter.v1.Database + * @instance + */ + Database.prototype.userName = ""; + + /** + * Database query. + * @member {string} query + * @memberof google.cloud.securitycenter.v1.Database + * @instance + */ + Database.prototype.query = ""; + + /** + * Database grantees. + * @member {Array.} grantees + * @memberof google.cloud.securitycenter.v1.Database + * @instance + */ + Database.prototype.grantees = $util.emptyArray; + + /** + * Creates a new Database instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.Database + * @static + * @param {google.cloud.securitycenter.v1.IDatabase=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.Database} Database instance + */ + Database.create = function create(properties) { + return new Database(properties); + }; + + /** + * Encodes the specified Database message. Does not implicitly {@link google.cloud.securitycenter.v1.Database.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.Database + * @static + * @param {google.cloud.securitycenter.v1.IDatabase} message Database message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Database.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.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + if (message.userName != null && Object.hasOwnProperty.call(message, "userName")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.userName); + if (message.query != null && Object.hasOwnProperty.call(message, "query")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.query); + if (message.grantees != null && message.grantees.length) + for (var i = 0; i < message.grantees.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.grantees[i]); + return writer; + }; + + /** + * Encodes the specified Database message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Database.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.Database + * @static + * @param {google.cloud.securitycenter.v1.IDatabase} message Database message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Database.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Database message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.Database + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.Database} Database + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Database.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.cloud.securitycenter.v1.Database(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + case 3: { + message.userName = reader.string(); + break; + } + case 4: { + message.query = reader.string(); + break; + } + case 5: { + if (!(message.grantees && message.grantees.length)) + message.grantees = []; + message.grantees.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Database message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.Database + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.Database} Database + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Database.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Database message. + * @function verify + * @memberof google.cloud.securitycenter.v1.Database + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Database.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.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.userName != null && message.hasOwnProperty("userName")) + if (!$util.isString(message.userName)) + return "userName: string expected"; + if (message.query != null && message.hasOwnProperty("query")) + if (!$util.isString(message.query)) + return "query: string expected"; + if (message.grantees != null && message.hasOwnProperty("grantees")) { + if (!Array.isArray(message.grantees)) + return "grantees: array expected"; + for (var i = 0; i < message.grantees.length; ++i) + if (!$util.isString(message.grantees[i])) + return "grantees: string[] expected"; + } + return null; + }; + + /** + * Creates a Database message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.Database + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.Database} Database + */ + Database.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.Database) + return object; + var message = new $root.google.cloud.securitycenter.v1.Database(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.userName != null) + message.userName = String(object.userName); + if (object.query != null) + message.query = String(object.query); + if (object.grantees) { + if (!Array.isArray(object.grantees)) + throw TypeError(".google.cloud.securitycenter.v1.Database.grantees: array expected"); + message.grantees = []; + for (var i = 0; i < object.grantees.length; ++i) + message.grantees[i] = String(object.grantees[i]); + } + return message; + }; + + /** + * Creates a plain object from a Database message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.Database + * @static + * @param {google.cloud.securitycenter.v1.Database} message Database + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Database.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.grantees = []; + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.userName = ""; + object.query = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.userName != null && message.hasOwnProperty("userName")) + object.userName = message.userName; + if (message.query != null && message.hasOwnProperty("query")) + object.query = message.query; + if (message.grantees && message.grantees.length) { + object.grantees = []; + for (var j = 0; j < message.grantees.length; ++j) + object.grantees[j] = message.grantees[j]; + } + return object; + }; + + /** + * Converts this Database to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.Database + * @instance + * @returns {Object.} JSON object + */ + Database.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Database + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.Database + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Database.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.Database"; + }; + + return Database; + })(); + v1.Exfiltration = (function() { /** @@ -5325,6 +5956,7 @@ * @property {string|null} [nextSteps] Finding nextSteps * @property {Array.|null} [containers] Finding containers * @property {google.cloud.securitycenter.v1.IKubernetes|null} [kubernetes] Finding kubernetes + * @property {google.cloud.securitycenter.v1.IDatabase|null} [database] Finding database */ /** @@ -5598,6 +6230,14 @@ */ Finding.prototype.kubernetes = null; + /** + * Finding database. + * @member {google.cloud.securitycenter.v1.IDatabase|null|undefined} database + * @memberof google.cloud.securitycenter.v1.Finding + * @instance + */ + Finding.prototype.database = null; + /** * Creates a new Finding instance using the specified properties. * @function create @@ -5698,6 +6338,8 @@ $root.google.cloud.securitycenter.v1.Container.encode(message.containers[i], writer.uint32(/* id 42, wireType 2 =*/338).fork()).ldelim(); if (message.kubernetes != null && Object.hasOwnProperty.call(message, "kubernetes")) $root.google.cloud.securitycenter.v1.Kubernetes.encode(message.kubernetes, writer.uint32(/* id 43, wireType 2 =*/346).fork()).ldelim(); + if (message.database != null && Object.hasOwnProperty.call(message, "database")) + $root.google.cloud.securitycenter.v1.Database.encode(message.database, writer.uint32(/* id 44, wireType 2 =*/354).fork()).ldelim(); return writer; }; @@ -5923,6 +6565,10 @@ message.kubernetes = $root.google.cloud.securitycenter.v1.Kubernetes.decode(reader, reader.uint32()); break; } + case 44: { + message.database = $root.google.cloud.securitycenter.v1.Database.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -6152,6 +6798,11 @@ if (error) return "kubernetes." + error; } + if (message.database != null && message.hasOwnProperty("database")) { + var error = $root.google.cloud.securitycenter.v1.Database.verify(message.database); + if (error) + return "database." + error; + } return null; }; @@ -6395,6 +7046,11 @@ throw TypeError(".google.cloud.securitycenter.v1.Finding.kubernetes: object expected"); message.kubernetes = $root.google.cloud.securitycenter.v1.Kubernetes.fromObject(object.kubernetes); } + if (object.database != null) { + if (typeof object.database !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Finding.database: object expected"); + message.database = $root.google.cloud.securitycenter.v1.Database.fromObject(object.database); + } return message; }; @@ -6447,6 +7103,7 @@ object.exfiltration = null; object.nextSteps = ""; object.kubernetes = null; + object.database = null; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -6535,6 +7192,8 @@ } if (message.kubernetes != null && message.hasOwnProperty("kubernetes")) object.kubernetes = $root.google.cloud.securitycenter.v1.Kubernetes.toObject(message.kubernetes, options); + if (message.database != null && message.hasOwnProperty("database")) + object.database = $root.google.cloud.securitycenter.v1.Database.toObject(message.database, options); return object; }; diff --git a/packages/google-cloud-securitycenter/protos/protos.json b/packages/google-cloud-securitycenter/protos/protos.json index 045161f08fa..cbf6d0dafcf 100644 --- a/packages/google-cloud-securitycenter/protos/protos.json +++ b/packages/google-cloud-securitycenter/protos/protos.json @@ -44,6 +44,31 @@ "methodName": { "type": "string", "id": 6 + }, + "principalSubject": { + "type": "string", + "id": 7 + }, + "serviceAccountKeyName": { + "type": "string", + "id": 8 + }, + "serviceAccountDelegationInfo": { + "rule": "repeated", + "type": "ServiceAccountDelegationInfo", + "id": 9 + } + } + }, + "ServiceAccountDelegationInfo": { + "fields": { + "principalEmail": { + "type": "string", + "id": 1 + }, + "principalSubject": { + "type": "string", + "id": 2 } } }, @@ -336,6 +361,31 @@ } } }, + "Database": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "displayName": { + "type": "string", + "id": 2 + }, + "userName": { + "type": "string", + "id": 3 + }, + "query": { + "type": "string", + "id": 4 + }, + "grantees": { + "rule": "repeated", + "type": "string", + "id": 5 + } + } + }, "Exfiltration": { "fields": { "sources": { @@ -569,6 +619,10 @@ "kubernetes": { "type": "Kubernetes", "id": 43 + }, + "database": { + "type": "Database", + "id": 44 } }, "nested": { diff --git a/packages/google-cloud-securitycenter/src/v1/security_center_client.ts b/packages/google-cloud-securitycenter/src/v1/security_center_client.ts index 25c605361d6..5246b7630c4 100644 --- a/packages/google-cloud-securitycenter/src/v1/security_center_client.ts +++ b/packages/google-cloud-securitycenter/src/v1/security_center_client.ts @@ -17,8 +17,8 @@ // ** All changes to this file may be overwritten. ** /* global window */ -import * as gax from 'google-gax'; -import { +import type * as gax from 'google-gax'; +import type { Callback, CallOptions, Descriptors, @@ -28,7 +28,6 @@ import { PaginationCallback, GaxCall, } from 'google-gax'; - import {Transform} from 'stream'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); @@ -38,7 +37,6 @@ import jsonProtos = require('../../protos/protos.json'); * This file defines retry strategy and timeouts for all API methods in this library. */ import * as gapicConfig from './security_center_client_config.json'; -import {operationsProtos} from 'google-gax'; const version = require('../../../package.json').version; /** @@ -99,8 +97,18 @@ export class SecurityCenterClient { * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. * For more information, please check the * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. - */ - constructor(opts?: ClientOptions) { + * @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 SecurityCenterClient({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 SecurityCenterClient; const servicePath = @@ -120,8 +128,13 @@ export class SecurityCenterClient { 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 ? gax.fallback : 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); @@ -373,7 +386,7 @@ export class SecurityCenterClient { this.innerApiCalls = {}; // Add a warn function to the client constructor so it can be easily tested. - this.warn = gax.warn; + this.warn = this._gaxModule.warn; } /** @@ -620,7 +633,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); this.initialize(); @@ -720,7 +733,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); this.initialize(); @@ -826,7 +839,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); this.initialize(); @@ -932,7 +945,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); this.initialize(); @@ -1036,7 +1049,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ name: request.name || '', }); this.initialize(); @@ -1134,7 +1147,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ name: request.name || '', }); this.initialize(); @@ -1238,7 +1251,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ name: request.name || '', }); this.initialize(); @@ -1325,7 +1338,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ resource: request.resource || '', }); this.initialize(); @@ -1419,7 +1432,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ name: request.name || '', }); this.initialize(); @@ -1517,7 +1530,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ name: request.name || '', }); this.initialize(); @@ -1615,7 +1628,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ name: request.name || '', }); this.initialize(); @@ -1711,7 +1724,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ name: request.name || '', }); this.initialize(); @@ -1809,7 +1822,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ name: request.name || '', }); this.initialize(); @@ -1901,7 +1914,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ name: request.name || '', }); this.initialize(); @@ -1996,7 +2009,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ resource: request.resource || '', }); this.initialize(); @@ -2085,7 +2098,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ resource: request.resource || '', }); this.initialize(); @@ -2186,7 +2199,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ 'external_system.name': request.externalSystem!.name || '', }); this.initialize(); @@ -2291,7 +2304,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ 'finding.name': request.finding!.name || '', }); this.initialize(); @@ -2391,7 +2404,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ 'mute_config.name': request.muteConfig!.name || '', }); this.initialize(); @@ -2494,7 +2507,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ 'notification_config.name': request.notificationConfig!.name || '', }); this.initialize(); @@ -2599,7 +2612,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ 'organization_settings.name': request.organizationSettings!.name || '', }); this.initialize(); @@ -2698,7 +2711,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ 'source.name': request.source!.name || '', }); this.initialize(); @@ -2806,7 +2819,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ 'security_marks.name': request.securityMarks!.name || '', }); this.initialize(); @@ -2912,7 +2925,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); this.initialize(); @@ -3012,7 +3025,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ name: request.name || '', }); this.initialize(); @@ -3112,7 +3125,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ 'big_query_export.name': request.bigQueryExport!.name || '', }); this.initialize(); @@ -3244,7 +3257,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); this.initialize(); @@ -3270,11 +3283,12 @@ export class SecurityCenterClient { protos.google.protobuf.Empty > > { - const request = new operationsProtos.google.longrunning.GetOperationRequest( - {name} - ); + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation( + const decodeOperation = new this._gaxModule.Operation( operation, this.descriptors.longrunning.bulkMuteFindings, this._gaxModule.createDefaultBackoffSettings() @@ -3387,7 +3401,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); this.initialize(); @@ -3413,11 +3427,12 @@ export class SecurityCenterClient { protos.google.protobuf.Empty > > { - const request = new operationsProtos.google.longrunning.GetOperationRequest( - {name} - ); + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation( + const decodeOperation = new this._gaxModule.Operation( operation, this.descriptors.longrunning.runAssetDiscovery, this._gaxModule.createDefaultBackoffSettings() @@ -3640,7 +3655,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); this.initialize(); @@ -3798,7 +3813,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); const defaultCallSettings = this._defaults['groupAssets']; @@ -3965,7 +3980,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); const defaultCallSettings = this._defaults['groupAssets']; @@ -4198,7 +4213,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); this.initialize(); @@ -4359,7 +4374,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); const defaultCallSettings = this._defaults['groupFindings']; @@ -4529,7 +4544,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); const defaultCallSettings = this._defaults['groupFindings']; @@ -4757,7 +4772,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); this.initialize(); @@ -4919,7 +4934,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); const defaultCallSettings = this._defaults['listAssets']; @@ -5090,7 +5105,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); const defaultCallSettings = this._defaults['listAssets']; @@ -5326,7 +5341,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); this.initialize(); @@ -5493,7 +5508,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); const defaultCallSettings = this._defaults['listFindings']; @@ -5669,7 +5684,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); const defaultCallSettings = this._defaults['listFindings']; @@ -5782,7 +5797,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); this.initialize(); @@ -5829,7 +5844,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); const defaultCallSettings = this._defaults['listMuteConfigs']; @@ -5885,7 +5900,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); const defaultCallSettings = this._defaults['listMuteConfigs']; @@ -5993,7 +6008,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); this.initialize(); @@ -6039,7 +6054,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); const defaultCallSettings = this._defaults['listNotificationConfigs']; @@ -6090,7 +6105,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); const defaultCallSettings = this._defaults['listNotificationConfigs']; @@ -6199,7 +6214,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); this.initialize(); @@ -6242,7 +6257,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); const defaultCallSettings = this._defaults['listSources']; @@ -6294,7 +6309,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); const defaultCallSettings = this._defaults['listSources']; @@ -6410,7 +6425,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); this.initialize(); @@ -6456,7 +6471,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); const defaultCallSettings = this._defaults['listBigQueryExports']; @@ -6511,7 +6526,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); const defaultCallSettings = this._defaults['listBigQueryExports']; diff --git a/packages/google-cloud-securitycenter/src/v1/security_center_proto_list.json b/packages/google-cloud-securitycenter/src/v1/security_center_proto_list.json index ab7c31b0731..be5b8aeaa29 100644 --- a/packages/google-cloud-securitycenter/src/v1/security_center_proto_list.json +++ b/packages/google-cloud-securitycenter/src/v1/security_center_proto_list.json @@ -6,6 +6,7 @@ "../../protos/google/cloud/securitycenter/v1/connection.proto", "../../protos/google/cloud/securitycenter/v1/contact_details.proto", "../../protos/google/cloud/securitycenter/v1/container.proto", + "../../protos/google/cloud/securitycenter/v1/database.proto", "../../protos/google/cloud/securitycenter/v1/exfiltration.proto", "../../protos/google/cloud/securitycenter/v1/external_system.proto", "../../protos/google/cloud/securitycenter/v1/file.proto", diff --git a/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.ts b/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.ts index 59678a4d6a8..82a3b22ed00 100644 --- a/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.ts +++ b/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.ts @@ -17,8 +17,8 @@ // ** All changes to this file may be overwritten. ** /* global window */ -import * as gax from 'google-gax'; -import { +import type * as gax from 'google-gax'; +import type { Callback, CallOptions, Descriptors, @@ -28,7 +28,6 @@ import { PaginationCallback, GaxCall, } from 'google-gax'; - import {Transform} from 'stream'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); @@ -38,7 +37,6 @@ import jsonProtos = require('../../protos/protos.json'); * This file defines retry strategy and timeouts for all API methods in this library. */ import * as gapicConfig from './security_center_client_config.json'; -import {operationsProtos} from 'google-gax'; const version = require('../../../package.json').version; /** @@ -99,8 +97,18 @@ export class SecurityCenterClient { * 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 SecurityCenterClient({fallback: 'rest'}, gax); + * ``` */ - constructor(opts?: ClientOptions) { + constructor( + opts?: ClientOptions, + gaxInstance?: typeof gax | typeof gax.fallback + ) { // Ensure that options include all the required fields. const staticMembers = this.constructor as typeof SecurityCenterClient; const servicePath = @@ -120,8 +128,13 @@ export class SecurityCenterClient { 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 ? gax.fallback : 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); @@ -283,7 +296,7 @@ export class SecurityCenterClient { this.innerApiCalls = {}; // Add a warn function to the client constructor so it can be easily tested. - this.warn = gax.warn; + this.warn = this._gaxModule.warn; } /** @@ -519,7 +532,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); this.initialize(); @@ -625,7 +638,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); this.initialize(); @@ -712,7 +725,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ resource: request.resource || '', }); this.initialize(); @@ -810,7 +823,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ name: request.name || '', }); this.initialize(); @@ -906,7 +919,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ name: request.name || '', }); this.initialize(); @@ -1010,7 +1023,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ name: request.name || '', }); this.initialize(); @@ -1105,7 +1118,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ resource: request.resource || '', }); this.initialize(); @@ -1194,7 +1207,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ resource: request.resource || '', }); this.initialize(); @@ -1300,7 +1313,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ 'finding.name': request.finding!.name || '', }); this.initialize(); @@ -1399,7 +1412,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ 'organization_settings.name': request.organizationSettings!.name || '', }); this.initialize(); @@ -1502,7 +1515,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ 'source.name': request.source!.name || '', }); this.initialize(); @@ -1603,7 +1616,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ 'security_marks.name': request.securityMarks!.name || '', }); this.initialize(); @@ -1698,7 +1711,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); this.initialize(); @@ -1721,11 +1734,12 @@ export class SecurityCenterClient { ): Promise< LROperation > { - const request = new operationsProtos.google.longrunning.GetOperationRequest( - {name} - ); + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation( + const decodeOperation = new this._gaxModule.Operation( operation, this.descriptors.longrunning.runAssetDiscovery, this._gaxModule.createDefaultBackoffSettings() @@ -1902,7 +1916,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); this.initialize(); @@ -2014,7 +2028,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); const defaultCallSettings = this._defaults['groupAssets']; @@ -2135,7 +2149,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); const defaultCallSettings = this._defaults['groupAssets']; @@ -2292,7 +2306,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); this.initialize(); @@ -2379,7 +2393,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); const defaultCallSettings = this._defaults['groupFindings']; @@ -2475,7 +2489,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); const defaultCallSettings = this._defaults['groupFindings']; @@ -2653,7 +2667,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); this.initialize(); @@ -2765,7 +2779,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); const defaultCallSettings = this._defaults['listAssets']; @@ -2886,7 +2900,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); const defaultCallSettings = this._defaults['listAssets']; @@ -3042,7 +3056,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); this.initialize(); @@ -3129,7 +3143,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); const defaultCallSettings = this._defaults['listFindings']; @@ -3225,7 +3239,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); const defaultCallSettings = this._defaults['listFindings']; @@ -3333,7 +3347,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); this.initialize(); @@ -3375,7 +3389,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); const defaultCallSettings = this._defaults['listSources']; @@ -3426,7 +3440,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); const defaultCallSettings = this._defaults['listSources']; diff --git a/packages/google-cloud-securitycenter/src/v1p1beta1/security_center_client.ts b/packages/google-cloud-securitycenter/src/v1p1beta1/security_center_client.ts index 8d140e08006..58105fdb4c3 100644 --- a/packages/google-cloud-securitycenter/src/v1p1beta1/security_center_client.ts +++ b/packages/google-cloud-securitycenter/src/v1p1beta1/security_center_client.ts @@ -17,8 +17,8 @@ // ** All changes to this file may be overwritten. ** /* global window */ -import * as gax from 'google-gax'; -import { +import type * as gax from 'google-gax'; +import type { Callback, CallOptions, Descriptors, @@ -28,7 +28,6 @@ import { PaginationCallback, GaxCall, } from 'google-gax'; - import {Transform} from 'stream'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); @@ -38,7 +37,6 @@ import jsonProtos = require('../../protos/protos.json'); * This file defines retry strategy and timeouts for all API methods in this library. */ import * as gapicConfig from './security_center_client_config.json'; -import {operationsProtos} from 'google-gax'; const version = require('../../../package.json').version; /** @@ -99,8 +97,18 @@ export class SecurityCenterClient { * 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 SecurityCenterClient({fallback: 'rest'}, gax); + * ``` */ - constructor(opts?: ClientOptions) { + constructor( + opts?: ClientOptions, + gaxInstance?: typeof gax | typeof gax.fallback + ) { // Ensure that options include all the required fields. const staticMembers = this.constructor as typeof SecurityCenterClient; const servicePath = @@ -120,8 +128,13 @@ export class SecurityCenterClient { 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 ? gax.fallback : 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); @@ -323,7 +336,7 @@ export class SecurityCenterClient { this.innerApiCalls = {}; // Add a warn function to the client constructor so it can be easily tested. - this.warn = gax.warn; + this.warn = this._gaxModule.warn; } /** @@ -564,7 +577,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); this.initialize(); @@ -668,7 +681,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); this.initialize(); @@ -773,7 +786,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); this.initialize(); @@ -875,7 +888,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ name: request.name || '', }); this.initialize(); @@ -966,7 +979,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ resource: request.resource || '', }); this.initialize(); @@ -1064,7 +1077,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ name: request.name || '', }); this.initialize(); @@ -1162,7 +1175,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ name: request.name || '', }); this.initialize(); @@ -1264,7 +1277,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ name: request.name || '', }); this.initialize(); @@ -1368,7 +1381,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ name: request.name || '', }); this.initialize(); @@ -1463,7 +1476,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ resource: request.resource || '', }); this.initialize(); @@ -1552,7 +1565,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ resource: request.resource || '', }); this.initialize(); @@ -1663,7 +1676,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ 'finding.name': request.finding!.name || '', }); this.initialize(); @@ -1765,7 +1778,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ 'notification_config.name': request.notificationConfig!.name || '', }); this.initialize(); @@ -1870,7 +1883,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ 'organization_settings.name': request.organizationSettings!.name || '', }); this.initialize(); @@ -1975,7 +1988,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ 'source.name': request.source!.name || '', }); this.initialize(); @@ -2082,7 +2095,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ 'security_marks.name': request.securityMarks!.name || '', }); this.initialize(); @@ -2192,7 +2205,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); this.initialize(); @@ -2218,11 +2231,12 @@ export class SecurityCenterClient { protos.google.protobuf.Empty > > { - const request = new operationsProtos.google.longrunning.GetOperationRequest( - {name} - ); + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation( + const decodeOperation = new this._gaxModule.Operation( operation, this.descriptors.longrunning.runAssetDiscovery, this._gaxModule.createDefaultBackoffSettings() @@ -2445,7 +2459,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); this.initialize(); @@ -2603,7 +2617,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); const defaultCallSettings = this._defaults['groupAssets']; @@ -2770,7 +2784,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); const defaultCallSettings = this._defaults['groupAssets']; @@ -2994,7 +3008,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); this.initialize(); @@ -3146,7 +3160,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); const defaultCallSettings = this._defaults['groupFindings']; @@ -3307,7 +3321,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); const defaultCallSettings = this._defaults['groupFindings']; @@ -3535,7 +3549,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); this.initialize(); @@ -3697,7 +3711,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); const defaultCallSettings = this._defaults['listAssets']; @@ -3868,7 +3882,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); const defaultCallSettings = this._defaults['listAssets']; @@ -4093,7 +4107,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); this.initialize(); @@ -4249,7 +4263,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); const defaultCallSettings = this._defaults['listFindings']; @@ -4414,7 +4428,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); const defaultCallSettings = this._defaults['listFindings']; @@ -4522,7 +4536,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); this.initialize(); @@ -4568,7 +4582,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); const defaultCallSettings = this._defaults['listNotificationConfigs']; @@ -4619,7 +4633,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); const defaultCallSettings = this._defaults['listNotificationConfigs']; @@ -4728,7 +4742,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); this.initialize(); @@ -4771,7 +4785,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); const defaultCallSettings = this._defaults['listSources']; @@ -4823,7 +4837,7 @@ export class SecurityCenterClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); const defaultCallSettings = this._defaults['listSources']; From 48c8adf6a3a9beb9ff6a14f2291ae04b2ceb0ddb Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 7 Sep 2022 18:06:19 -0400 Subject: [PATCH 333/342] chore(main): release 6.3.1 (#508) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(main): release 6.3.1 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> Co-authored-by: Owl Bot --- packages/google-cloud-securitycenter/CHANGELOG.md | 8 ++++++++ packages/google-cloud-securitycenter/package.json | 2 +- .../snippet_metadata.google.cloud.securitycenter.v1.json | 2 +- ...ppet_metadata.google.cloud.securitycenter.v1beta1.json | 2 +- ...et_metadata.google.cloud.securitycenter.v1p1beta1.json | 2 +- packages/google-cloud-securitycenter/samples/package.json | 2 +- 6 files changed, 13 insertions(+), 5 deletions(-) diff --git a/packages/google-cloud-securitycenter/CHANGELOG.md b/packages/google-cloud-securitycenter/CHANGELOG.md index 5b12fbb660d..3532a1cea71 100644 --- a/packages/google-cloud-securitycenter/CHANGELOG.md +++ b/packages/google-cloud-securitycenter/CHANGELOG.md @@ -4,6 +4,14 @@ [1]: https://www.npmjs.com/package/@google-cloud/security-center?activeTab=versions +## [6.3.1](https://github.com/googleapis/nodejs-security-center/compare/v6.3.0...v6.3.1) (2022-09-01) + + +### Bug Fixes + +* Allow passing gax instance to client constructor ([#506](https://github.com/googleapis/nodejs-security-center/issues/506)) ([22478d6](https://github.com/googleapis/nodejs-security-center/commit/22478d6fd89ec40aa281aa47daf14cfd96392341)) +* Do not import the whole google-gax from proto JS ([#1553](https://github.com/googleapis/nodejs-security-center/issues/1553)) ([#507](https://github.com/googleapis/nodejs-security-center/issues/507)) ([fcea451](https://github.com/googleapis/nodejs-security-center/commit/fcea45122f431e6b1a1d680d960301b41f1eef39)) + ## [6.3.0](https://github.com/googleapis/nodejs-security-center/compare/v6.2.0...v6.3.0) (2022-08-23) diff --git a/packages/google-cloud-securitycenter/package.json b/packages/google-cloud-securitycenter/package.json index 5cbd2fa0417..4a04cd50dde 100644 --- a/packages/google-cloud-securitycenter/package.json +++ b/packages/google-cloud-securitycenter/package.json @@ -1,7 +1,7 @@ { "name": "@google-cloud/security-center", "description": "Cloud Security Command Center API client for Node.js", - "version": "6.3.0", + "version": "6.3.1", "license": "Apache-2.0", "author": "Google LLC", "engines": { diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/snippet_metadata.google.cloud.securitycenter.v1.json b/packages/google-cloud-securitycenter/samples/generated/v1/snippet_metadata.google.cloud.securitycenter.v1.json index a01f6fa06fd..0126d79d6be 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/snippet_metadata.google.cloud.securitycenter.v1.json +++ b/packages/google-cloud-securitycenter/samples/generated/v1/snippet_metadata.google.cloud.securitycenter.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-securitycenter", - "version": "6.3.0", + "version": "6.3.1", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-securitycenter/samples/generated/v1beta1/snippet_metadata.google.cloud.securitycenter.v1beta1.json b/packages/google-cloud-securitycenter/samples/generated/v1beta1/snippet_metadata.google.cloud.securitycenter.v1beta1.json index 0570098009c..28c47224507 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1beta1/snippet_metadata.google.cloud.securitycenter.v1beta1.json +++ b/packages/google-cloud-securitycenter/samples/generated/v1beta1/snippet_metadata.google.cloud.securitycenter.v1beta1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-securitycenter", - "version": "6.3.0", + "version": "6.3.1", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/snippet_metadata.google.cloud.securitycenter.v1p1beta1.json b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/snippet_metadata.google.cloud.securitycenter.v1p1beta1.json index 7fadcae588a..a3151fdfd8f 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/snippet_metadata.google.cloud.securitycenter.v1p1beta1.json +++ b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/snippet_metadata.google.cloud.securitycenter.v1p1beta1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-securitycenter", - "version": "6.3.0", + "version": "6.3.1", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-securitycenter/samples/package.json b/packages/google-cloud-securitycenter/samples/package.json index 224d5bcd753..ee48074fdff 100644 --- a/packages/google-cloud-securitycenter/samples/package.json +++ b/packages/google-cloud-securitycenter/samples/package.json @@ -14,7 +14,7 @@ "license": "Apache-2.0", "dependencies": { "@google-cloud/pubsub": "^3.0.0", - "@google-cloud/security-center": "^6.3.0" + "@google-cloud/security-center": "^6.3.1" }, "devDependencies": { "chai": "^4.2.0", From 55314345f4613e48d62da79c0c050b81b4e1cb70 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 9 Sep 2022 04:03:21 +0200 Subject: [PATCH 334/342] chore(deps): update dependency uuid to v9 (#509) --- packages/google-cloud-securitycenter/samples/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-securitycenter/samples/package.json b/packages/google-cloud-securitycenter/samples/package.json index ee48074fdff..cb626bcbc6c 100644 --- a/packages/google-cloud-securitycenter/samples/package.json +++ b/packages/google-cloud-securitycenter/samples/package.json @@ -19,6 +19,6 @@ "devDependencies": { "chai": "^4.2.0", "mocha": "^8.0.0", - "uuid": "^8.0.0" + "uuid": "^9.0.0" } } \ No newline at end of file From 7ab3d9d2c538b2ed57b781e881519d2717bfd587 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Wed, 14 Sep 2022 22:34:29 +0000 Subject: [PATCH 335/342] fix: preserve default values in x-goog-request-params header (#511) - [ ] Regenerate this pull request now. PiperOrigin-RevId: 474338479 Source-Link: https://github.com/googleapis/googleapis/commit/d5d35e0353b59719e8917103b1bc7df2782bf6ba Source-Link: https://github.com/googleapis/googleapis-gen/commit/efcd3f93962a103f68f003e2a1eecde6fa216a27 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZWZjZDNmOTM5NjJhMTAzZjY4ZjAwM2UyYTFlZWNkZTZmYTIxNmEyNyJ9 feat: Added parent display name i.e. source display name for a finding as one of the finding attributes PiperOrigin-RevId: 474319054 Source-Link: https://github.com/googleapis/googleapis/commit/862f99facd3b670eda5bd17fd367a93111381326 Source-Link: https://github.com/googleapis/googleapis-gen/commit/bfc34971e1d16b179ffab8cb6779bc64f7378c09 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYmZjMzQ5NzFlMWQxNmIxNzlmZmFiOGNiNjc3OWJjNjRmNzM3OGMwOSJ9 --- .../cloud/securitycenter/v1/finding.proto | 23 +- .../protos/protos.d.ts | 6 + .../protos/protos.js | 23 + .../protos/protos.json | 7 + .../src/v1/security_center_client.ts | 104 +- .../src/v1beta1/security_center_client.ts | 56 +- .../src/v1p1beta1/security_center_client.ts | 70 +- .../test/gapic_security_center_v1.ts | 3786 +++++++++-------- .../test/gapic_security_center_v1beta1.ts | 1964 +++++---- .../test/gapic_security_center_v1p1beta1.ts | 2484 ++++++----- 10 files changed, 4469 insertions(+), 4054 deletions(-) diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/finding.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/finding.proto index 8fbd9421f55..126d5e59feb 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/finding.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/finding.proto @@ -258,13 +258,11 @@ message Finding { Vulnerability vulnerability = 20; // Output only. The most recent time this finding was muted or unmuted. - google.protobuf.Timestamp mute_update_time = 21 - [(google.api.field_behavior) = OUTPUT_ONLY]; + google.protobuf.Timestamp mute_update_time = 21 [(google.api.field_behavior) = OUTPUT_ONLY]; - // Output only. Third party SIEM/SOAR fields within SCC, contains external - // system information and external system finding fields. - map external_systems = 22 - [(google.api.field_behavior) = OUTPUT_ONLY]; + // Output only. Third party SIEM/SOAR fields within SCC, contains external system + // information and external system finding fields. + map external_systems = 22 [(google.api.field_behavior) = OUTPUT_ONLY]; // MITRE ATT&CK tactics and techniques related to this finding. // See: https://attack.mitre.org @@ -286,9 +284,9 @@ message Finding { // Represents operating system processes associated with the Finding. repeated Process processes = 30; - // Output only. Map containing the point of contacts for the given finding. - // The key represents the type of contact, while the value contains a list of - // all the contacts that pertain. Please refer to: + // Output only. Map containing the points of contact for the given finding. The key + // represents the type of contact, while the value contains a list of all the + // contacts that pertain. Please refer to: // https://cloud.google.com/resource-manager/docs/managing-notification-contacts#notification-categories // // { @@ -303,13 +301,16 @@ message Finding { // ] // } // } - map contacts = 33 - [(google.api.field_behavior) = OUTPUT_ONLY]; + map contacts = 33 [(google.api.field_behavior) = OUTPUT_ONLY]; // Contains compliance information for security standards associated to the // finding. repeated Compliance compliances = 34; + // Output only. The human readable display name of the finding source such as + // "Event Threat Detection" or "Security Health Analytics". + string parent_display_name = 36 [(google.api.field_behavior) = OUTPUT_ONLY]; + // Contains more detail about the finding. string description = 37; diff --git a/packages/google-cloud-securitycenter/protos/protos.d.ts b/packages/google-cloud-securitycenter/protos/protos.d.ts index 333fe7c68d0..2211096d1a2 100644 --- a/packages/google-cloud-securitycenter/protos/protos.d.ts +++ b/packages/google-cloud-securitycenter/protos/protos.d.ts @@ -2414,6 +2414,9 @@ export namespace google { /** Finding compliances */ compliances?: (google.cloud.securitycenter.v1.ICompliance[]|null); + /** Finding parentDisplayName */ + parentDisplayName?: (string|null); + /** Finding description */ description?: (string|null); @@ -2520,6 +2523,9 @@ export namespace google { /** Finding compliances. */ public compliances: google.cloud.securitycenter.v1.ICompliance[]; + /** Finding parentDisplayName. */ + public parentDisplayName: string; + /** Finding description. */ public description: string; diff --git a/packages/google-cloud-securitycenter/protos/protos.js b/packages/google-cloud-securitycenter/protos/protos.js index a1c63b3b2f5..a52036e6454 100644 --- a/packages/google-cloud-securitycenter/protos/protos.js +++ b/packages/google-cloud-securitycenter/protos/protos.js @@ -5950,6 +5950,7 @@ * @property {Array.|null} [processes] Finding processes * @property {Object.|null} [contacts] Finding contacts * @property {Array.|null} [compliances] Finding compliances + * @property {string|null} [parentDisplayName] Finding parentDisplayName * @property {string|null} [description] Finding description * @property {google.cloud.securitycenter.v1.IExfiltration|null} [exfiltration] Finding exfiltration * @property {Array.|null} [iamBindings] Finding iamBindings @@ -6182,6 +6183,14 @@ */ Finding.prototype.compliances = $util.emptyArray; + /** + * Finding parentDisplayName. + * @member {string} parentDisplayName + * @memberof google.cloud.securitycenter.v1.Finding + * @instance + */ + Finding.prototype.parentDisplayName = ""; + /** * Finding description. * @member {string} description @@ -6324,6 +6333,8 @@ if (message.compliances != null && message.compliances.length) for (var i = 0; i < message.compliances.length; ++i) $root.google.cloud.securitycenter.v1.Compliance.encode(message.compliances[i], writer.uint32(/* id 34, wireType 2 =*/274).fork()).ldelim(); + if (message.parentDisplayName != null && Object.hasOwnProperty.call(message, "parentDisplayName")) + writer.uint32(/* id 36, wireType 2 =*/290).string(message.parentDisplayName); if (message.description != null && Object.hasOwnProperty.call(message, "description")) writer.uint32(/* id 37, wireType 2 =*/298).string(message.description); if (message.exfiltration != null && Object.hasOwnProperty.call(message, "exfiltration")) @@ -6537,6 +6548,10 @@ message.compliances.push($root.google.cloud.securitycenter.v1.Compliance.decode(reader, reader.uint32())); break; } + case 36: { + message.parentDisplayName = reader.string(); + break; + } case 37: { message.description = reader.string(); break; @@ -6764,6 +6779,9 @@ return "compliances." + error; } } + if (message.parentDisplayName != null && message.hasOwnProperty("parentDisplayName")) + if (!$util.isString(message.parentDisplayName)) + return "parentDisplayName: string expected"; if (message.description != null && message.hasOwnProperty("description")) if (!$util.isString(message.description)) return "description: string expected"; @@ -7012,6 +7030,8 @@ message.compliances[i] = $root.google.cloud.securitycenter.v1.Compliance.fromObject(object.compliances[i]); } } + if (object.parentDisplayName != null) + message.parentDisplayName = String(object.parentDisplayName); if (object.description != null) message.description = String(object.description); if (object.exfiltration != null) { @@ -7099,6 +7119,7 @@ object.mitreAttack = null; object.access = null; object.muteInitiator = ""; + object.parentDisplayName = ""; object.description = ""; object.exfiltration = null; object.nextSteps = ""; @@ -7174,6 +7195,8 @@ for (var j = 0; j < message.compliances.length; ++j) object.compliances[j] = $root.google.cloud.securitycenter.v1.Compliance.toObject(message.compliances[j], options); } + if (message.parentDisplayName != null && message.hasOwnProperty("parentDisplayName")) + object.parentDisplayName = message.parentDisplayName; if (message.description != null && message.hasOwnProperty("description")) object.description = message.description; if (message.exfiltration != null && message.hasOwnProperty("exfiltration")) diff --git a/packages/google-cloud-securitycenter/protos/protos.json b/packages/google-cloud-securitycenter/protos/protos.json index cbf6d0dafcf..6b618959870 100644 --- a/packages/google-cloud-securitycenter/protos/protos.json +++ b/packages/google-cloud-securitycenter/protos/protos.json @@ -594,6 +594,13 @@ "type": "Compliance", "id": 34 }, + "parentDisplayName": { + "type": "string", + "id": 36, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, "description": { "type": "string", "id": 37 diff --git a/packages/google-cloud-securitycenter/src/v1/security_center_client.ts b/packages/google-cloud-securitycenter/src/v1/security_center_client.ts index 5246b7630c4..5104846fa4c 100644 --- a/packages/google-cloud-securitycenter/src/v1/security_center_client.ts +++ b/packages/google-cloud-securitycenter/src/v1/security_center_client.ts @@ -634,7 +634,7 @@ export class SecurityCenterClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.createSource(request, options, callback); @@ -734,7 +734,7 @@ export class SecurityCenterClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.createFinding(request, options, callback); @@ -840,7 +840,7 @@ export class SecurityCenterClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.createMuteConfig(request, options, callback); @@ -946,7 +946,7 @@ export class SecurityCenterClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.createNotificationConfig( @@ -1050,7 +1050,7 @@ export class SecurityCenterClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.deleteMuteConfig(request, options, callback); @@ -1148,7 +1148,7 @@ export class SecurityCenterClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.deleteNotificationConfig( @@ -1252,7 +1252,7 @@ export class SecurityCenterClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.getBigQueryExport(request, options, callback); @@ -1339,7 +1339,7 @@ export class SecurityCenterClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - resource: request.resource || '', + resource: request.resource ?? '', }); this.initialize(); return this.innerApiCalls.getIamPolicy(request, options, callback); @@ -1433,7 +1433,7 @@ export class SecurityCenterClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.getMuteConfig(request, options, callback); @@ -1531,7 +1531,7 @@ export class SecurityCenterClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.getNotificationConfig(request, options, callback); @@ -1629,7 +1629,7 @@ export class SecurityCenterClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.getOrganizationSettings( @@ -1725,7 +1725,7 @@ export class SecurityCenterClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.getSource(request, options, callback); @@ -1823,7 +1823,7 @@ export class SecurityCenterClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.setFindingState(request, options, callback); @@ -1915,7 +1915,7 @@ export class SecurityCenterClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.setMute(request, options, callback); @@ -2010,7 +2010,7 @@ export class SecurityCenterClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - resource: request.resource || '', + resource: request.resource ?? '', }); this.initialize(); return this.innerApiCalls.setIamPolicy(request, options, callback); @@ -2099,7 +2099,7 @@ export class SecurityCenterClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - resource: request.resource || '', + resource: request.resource ?? '', }); this.initialize(); return this.innerApiCalls.testIamPermissions(request, options, callback); @@ -2200,7 +2200,7 @@ export class SecurityCenterClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - 'external_system.name': request.externalSystem!.name || '', + 'external_system.name': request.externalSystem!.name ?? '', }); this.initialize(); return this.innerApiCalls.updateExternalSystem(request, options, callback); @@ -2305,7 +2305,7 @@ export class SecurityCenterClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - 'finding.name': request.finding!.name || '', + 'finding.name': request.finding!.name ?? '', }); this.initialize(); return this.innerApiCalls.updateFinding(request, options, callback); @@ -2405,7 +2405,7 @@ export class SecurityCenterClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - 'mute_config.name': request.muteConfig!.name || '', + 'mute_config.name': request.muteConfig!.name ?? '', }); this.initialize(); return this.innerApiCalls.updateMuteConfig(request, options, callback); @@ -2508,7 +2508,7 @@ export class SecurityCenterClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - 'notification_config.name': request.notificationConfig!.name || '', + 'notification_config.name': request.notificationConfig!.name ?? '', }); this.initialize(); return this.innerApiCalls.updateNotificationConfig( @@ -2613,7 +2613,7 @@ export class SecurityCenterClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - 'organization_settings.name': request.organizationSettings!.name || '', + 'organization_settings.name': request.organizationSettings!.name ?? '', }); this.initialize(); return this.innerApiCalls.updateOrganizationSettings( @@ -2712,7 +2712,7 @@ export class SecurityCenterClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - 'source.name': request.source!.name || '', + 'source.name': request.source!.name ?? '', }); this.initialize(); return this.innerApiCalls.updateSource(request, options, callback); @@ -2820,7 +2820,7 @@ export class SecurityCenterClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - 'security_marks.name': request.securityMarks!.name || '', + 'security_marks.name': request.securityMarks!.name ?? '', }); this.initialize(); return this.innerApiCalls.updateSecurityMarks(request, options, callback); @@ -2926,7 +2926,7 @@ export class SecurityCenterClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.createBigQueryExport(request, options, callback); @@ -3026,7 +3026,7 @@ export class SecurityCenterClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.deleteBigQueryExport(request, options, callback); @@ -3126,7 +3126,7 @@ export class SecurityCenterClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - 'big_query_export.name': request.bigQueryExport!.name || '', + 'big_query_export.name': request.bigQueryExport!.name ?? '', }); this.initialize(); return this.innerApiCalls.updateBigQueryExport(request, options, callback); @@ -3258,7 +3258,7 @@ export class SecurityCenterClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.bulkMuteFindings(request, options, callback); @@ -3402,7 +3402,7 @@ export class SecurityCenterClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.runAssetDiscovery(request, options, callback); @@ -3656,7 +3656,7 @@ export class SecurityCenterClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.groupAssets(request, options, callback); @@ -3814,7 +3814,7 @@ export class SecurityCenterClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['groupAssets']; const callSettings = defaultCallSettings.merge(options); @@ -3981,7 +3981,7 @@ export class SecurityCenterClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['groupAssets']; const callSettings = defaultCallSettings.merge(options); @@ -4214,7 +4214,7 @@ export class SecurityCenterClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.groupFindings(request, options, callback); @@ -4375,7 +4375,7 @@ export class SecurityCenterClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['groupFindings']; const callSettings = defaultCallSettings.merge(options); @@ -4545,7 +4545,7 @@ export class SecurityCenterClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['groupFindings']; const callSettings = defaultCallSettings.merge(options); @@ -4773,7 +4773,7 @@ export class SecurityCenterClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.listAssets(request, options, callback); @@ -4935,7 +4935,7 @@ export class SecurityCenterClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listAssets']; const callSettings = defaultCallSettings.merge(options); @@ -5106,7 +5106,7 @@ export class SecurityCenterClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listAssets']; const callSettings = defaultCallSettings.merge(options); @@ -5342,7 +5342,7 @@ export class SecurityCenterClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.listFindings(request, options, callback); @@ -5509,7 +5509,7 @@ export class SecurityCenterClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listFindings']; const callSettings = defaultCallSettings.merge(options); @@ -5685,7 +5685,7 @@ export class SecurityCenterClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listFindings']; const callSettings = defaultCallSettings.merge(options); @@ -5798,7 +5798,7 @@ export class SecurityCenterClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.listMuteConfigs(request, options, callback); @@ -5845,7 +5845,7 @@ export class SecurityCenterClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listMuteConfigs']; const callSettings = defaultCallSettings.merge(options); @@ -5901,7 +5901,7 @@ export class SecurityCenterClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listMuteConfigs']; const callSettings = defaultCallSettings.merge(options); @@ -6009,7 +6009,7 @@ export class SecurityCenterClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.listNotificationConfigs( @@ -6055,7 +6055,7 @@ export class SecurityCenterClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listNotificationConfigs']; const callSettings = defaultCallSettings.merge(options); @@ -6106,7 +6106,7 @@ export class SecurityCenterClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listNotificationConfigs']; const callSettings = defaultCallSettings.merge(options); @@ -6215,7 +6215,7 @@ export class SecurityCenterClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.listSources(request, options, callback); @@ -6258,7 +6258,7 @@ export class SecurityCenterClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listSources']; const callSettings = defaultCallSettings.merge(options); @@ -6310,7 +6310,7 @@ export class SecurityCenterClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listSources']; const callSettings = defaultCallSettings.merge(options); @@ -6426,7 +6426,7 @@ export class SecurityCenterClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.listBigQueryExports(request, options, callback); @@ -6472,7 +6472,7 @@ export class SecurityCenterClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listBigQueryExports']; const callSettings = defaultCallSettings.merge(options); @@ -6527,7 +6527,7 @@ export class SecurityCenterClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listBigQueryExports']; const callSettings = defaultCallSettings.merge(options); diff --git a/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.ts b/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.ts index 82a3b22ed00..48a71d22b29 100644 --- a/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.ts +++ b/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.ts @@ -533,7 +533,7 @@ export class SecurityCenterClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.createSource(request, options, callback); @@ -639,7 +639,7 @@ export class SecurityCenterClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.createFinding(request, options, callback); @@ -726,7 +726,7 @@ export class SecurityCenterClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - resource: request.resource || '', + resource: request.resource ?? '', }); this.initialize(); return this.innerApiCalls.getIamPolicy(request, options, callback); @@ -824,7 +824,7 @@ export class SecurityCenterClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.getOrganizationSettings( @@ -920,7 +920,7 @@ export class SecurityCenterClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.getSource(request, options, callback); @@ -1024,7 +1024,7 @@ export class SecurityCenterClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.setFindingState(request, options, callback); @@ -1119,7 +1119,7 @@ export class SecurityCenterClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - resource: request.resource || '', + resource: request.resource ?? '', }); this.initialize(); return this.innerApiCalls.setIamPolicy(request, options, callback); @@ -1208,7 +1208,7 @@ export class SecurityCenterClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - resource: request.resource || '', + resource: request.resource ?? '', }); this.initialize(); return this.innerApiCalls.testIamPermissions(request, options, callback); @@ -1314,7 +1314,7 @@ export class SecurityCenterClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - 'finding.name': request.finding!.name || '', + 'finding.name': request.finding!.name ?? '', }); this.initialize(); return this.innerApiCalls.updateFinding(request, options, callback); @@ -1413,7 +1413,7 @@ export class SecurityCenterClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - 'organization_settings.name': request.organizationSettings!.name || '', + 'organization_settings.name': request.organizationSettings!.name ?? '', }); this.initialize(); return this.innerApiCalls.updateOrganizationSettings( @@ -1516,7 +1516,7 @@ export class SecurityCenterClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - 'source.name': request.source!.name || '', + 'source.name': request.source!.name ?? '', }); this.initialize(); return this.innerApiCalls.updateSource(request, options, callback); @@ -1617,7 +1617,7 @@ export class SecurityCenterClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - 'security_marks.name': request.securityMarks!.name || '', + 'security_marks.name': request.securityMarks!.name ?? '', }); this.initialize(); return this.innerApiCalls.updateSecurityMarks(request, options, callback); @@ -1712,7 +1712,7 @@ export class SecurityCenterClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.runAssetDiscovery(request, options, callback); @@ -1917,7 +1917,7 @@ export class SecurityCenterClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.groupAssets(request, options, callback); @@ -2029,7 +2029,7 @@ export class SecurityCenterClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['groupAssets']; const callSettings = defaultCallSettings.merge(options); @@ -2150,7 +2150,7 @@ export class SecurityCenterClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['groupAssets']; const callSettings = defaultCallSettings.merge(options); @@ -2307,7 +2307,7 @@ export class SecurityCenterClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.groupFindings(request, options, callback); @@ -2394,7 +2394,7 @@ export class SecurityCenterClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['groupFindings']; const callSettings = defaultCallSettings.merge(options); @@ -2490,7 +2490,7 @@ export class SecurityCenterClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['groupFindings']; const callSettings = defaultCallSettings.merge(options); @@ -2668,7 +2668,7 @@ export class SecurityCenterClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.listAssets(request, options, callback); @@ -2780,7 +2780,7 @@ export class SecurityCenterClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listAssets']; const callSettings = defaultCallSettings.merge(options); @@ -2901,7 +2901,7 @@ export class SecurityCenterClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listAssets']; const callSettings = defaultCallSettings.merge(options); @@ -3057,7 +3057,7 @@ export class SecurityCenterClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.listFindings(request, options, callback); @@ -3144,7 +3144,7 @@ export class SecurityCenterClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listFindings']; const callSettings = defaultCallSettings.merge(options); @@ -3240,7 +3240,7 @@ export class SecurityCenterClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listFindings']; const callSettings = defaultCallSettings.merge(options); @@ -3348,7 +3348,7 @@ export class SecurityCenterClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.listSources(request, options, callback); @@ -3390,7 +3390,7 @@ export class SecurityCenterClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listSources']; const callSettings = defaultCallSettings.merge(options); @@ -3441,7 +3441,7 @@ export class SecurityCenterClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listSources']; const callSettings = defaultCallSettings.merge(options); diff --git a/packages/google-cloud-securitycenter/src/v1p1beta1/security_center_client.ts b/packages/google-cloud-securitycenter/src/v1p1beta1/security_center_client.ts index 58105fdb4c3..620cd4cb7ef 100644 --- a/packages/google-cloud-securitycenter/src/v1p1beta1/security_center_client.ts +++ b/packages/google-cloud-securitycenter/src/v1p1beta1/security_center_client.ts @@ -578,7 +578,7 @@ export class SecurityCenterClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.createSource(request, options, callback); @@ -682,7 +682,7 @@ export class SecurityCenterClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.createFinding(request, options, callback); @@ -787,7 +787,7 @@ export class SecurityCenterClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.createNotificationConfig( @@ -889,7 +889,7 @@ export class SecurityCenterClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.deleteNotificationConfig( @@ -980,7 +980,7 @@ export class SecurityCenterClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - resource: request.resource || '', + resource: request.resource ?? '', }); this.initialize(); return this.innerApiCalls.getIamPolicy(request, options, callback); @@ -1078,7 +1078,7 @@ export class SecurityCenterClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.getNotificationConfig(request, options, callback); @@ -1176,7 +1176,7 @@ export class SecurityCenterClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.getOrganizationSettings( @@ -1278,7 +1278,7 @@ export class SecurityCenterClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.getSource(request, options, callback); @@ -1382,7 +1382,7 @@ export class SecurityCenterClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.setFindingState(request, options, callback); @@ -1477,7 +1477,7 @@ export class SecurityCenterClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - resource: request.resource || '', + resource: request.resource ?? '', }); this.initialize(); return this.innerApiCalls.setIamPolicy(request, options, callback); @@ -1566,7 +1566,7 @@ export class SecurityCenterClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - resource: request.resource || '', + resource: request.resource ?? '', }); this.initialize(); return this.innerApiCalls.testIamPermissions(request, options, callback); @@ -1677,7 +1677,7 @@ export class SecurityCenterClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - 'finding.name': request.finding!.name || '', + 'finding.name': request.finding!.name ?? '', }); this.initialize(); return this.innerApiCalls.updateFinding(request, options, callback); @@ -1779,7 +1779,7 @@ export class SecurityCenterClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - 'notification_config.name': request.notificationConfig!.name || '', + 'notification_config.name': request.notificationConfig!.name ?? '', }); this.initialize(); return this.innerApiCalls.updateNotificationConfig( @@ -1884,7 +1884,7 @@ export class SecurityCenterClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - 'organization_settings.name': request.organizationSettings!.name || '', + 'organization_settings.name': request.organizationSettings!.name ?? '', }); this.initialize(); return this.innerApiCalls.updateOrganizationSettings( @@ -1989,7 +1989,7 @@ export class SecurityCenterClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - 'source.name': request.source!.name || '', + 'source.name': request.source!.name ?? '', }); this.initialize(); return this.innerApiCalls.updateSource(request, options, callback); @@ -2096,7 +2096,7 @@ export class SecurityCenterClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - 'security_marks.name': request.securityMarks!.name || '', + 'security_marks.name': request.securityMarks!.name ?? '', }); this.initialize(); return this.innerApiCalls.updateSecurityMarks(request, options, callback); @@ -2206,7 +2206,7 @@ export class SecurityCenterClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.runAssetDiscovery(request, options, callback); @@ -2460,7 +2460,7 @@ export class SecurityCenterClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.groupAssets(request, options, callback); @@ -2618,7 +2618,7 @@ export class SecurityCenterClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['groupAssets']; const callSettings = defaultCallSettings.merge(options); @@ -2785,7 +2785,7 @@ export class SecurityCenterClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['groupAssets']; const callSettings = defaultCallSettings.merge(options); @@ -3009,7 +3009,7 @@ export class SecurityCenterClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.groupFindings(request, options, callback); @@ -3161,7 +3161,7 @@ export class SecurityCenterClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['groupFindings']; const callSettings = defaultCallSettings.merge(options); @@ -3322,7 +3322,7 @@ export class SecurityCenterClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['groupFindings']; const callSettings = defaultCallSettings.merge(options); @@ -3550,7 +3550,7 @@ export class SecurityCenterClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.listAssets(request, options, callback); @@ -3712,7 +3712,7 @@ export class SecurityCenterClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listAssets']; const callSettings = defaultCallSettings.merge(options); @@ -3883,7 +3883,7 @@ export class SecurityCenterClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listAssets']; const callSettings = defaultCallSettings.merge(options); @@ -4108,7 +4108,7 @@ export class SecurityCenterClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.listFindings(request, options, callback); @@ -4264,7 +4264,7 @@ export class SecurityCenterClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listFindings']; const callSettings = defaultCallSettings.merge(options); @@ -4429,7 +4429,7 @@ export class SecurityCenterClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listFindings']; const callSettings = defaultCallSettings.merge(options); @@ -4537,7 +4537,7 @@ export class SecurityCenterClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.listNotificationConfigs( @@ -4583,7 +4583,7 @@ export class SecurityCenterClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listNotificationConfigs']; const callSettings = defaultCallSettings.merge(options); @@ -4634,7 +4634,7 @@ export class SecurityCenterClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listNotificationConfigs']; const callSettings = defaultCallSettings.merge(options); @@ -4743,7 +4743,7 @@ export class SecurityCenterClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.listSources(request, options, callback); @@ -4786,7 +4786,7 @@ export class SecurityCenterClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listSources']; const callSettings = defaultCallSettings.merge(options); @@ -4838,7 +4838,7 @@ export class SecurityCenterClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listSources']; const callSettings = defaultCallSettings.merge(options); diff --git a/packages/google-cloud-securitycenter/test/gapic_security_center_v1.ts b/packages/google-cloud-securitycenter/test/gapic_security_center_v1.ts index 5450dc18f1d..74c0d3efc84 100644 --- a/packages/google-cloud-securitycenter/test/gapic_security_center_v1.ts +++ b/packages/google-cloud-securitycenter/test/gapic_security_center_v1.ts @@ -27,6 +27,21 @@ import {PassThrough} from 'stream'; import {protobuf, LROperation, operationsProtos} 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 @@ -254,26 +269,25 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.CreateSourceRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('CreateSourceRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.securitycenter.v1.Source() ); client.innerApiCalls.createSource = stubSimpleCall(expectedResponse); const [response] = await client.createSource(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.createSource as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.createSource as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createSource as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createSource without error using callback', async () => { @@ -285,15 +299,11 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.CreateSourceRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('CreateSourceRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.securitycenter.v1.Source() ); @@ -316,11 +326,14 @@ describe('v1.SecurityCenterClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.createSource as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.createSource as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createSource as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createSource with error', async () => { @@ -332,26 +345,25 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.CreateSourceRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('CreateSourceRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.createSource = stubSimpleCall( undefined, expectedError ); await assert.rejects(client.createSource(request), expectedError); - assert( - (client.innerApiCalls.createSource as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.createSource as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createSource as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createSource with closed client', async () => { @@ -363,7 +375,10 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.CreateSourceRequest() ); - request.parent = ''; + const defaultValue1 = getTypeDefaultValue('CreateSourceRequest', [ + 'parent', + ]); + request.parent = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.createSource(request), expectedError); @@ -380,26 +395,25 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.CreateFindingRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('CreateFindingRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.securitycenter.v1.Finding() ); client.innerApiCalls.createFinding = stubSimpleCall(expectedResponse); const [response] = await client.createFinding(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.createFinding as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.createFinding as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createFinding as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createFinding without error using callback', async () => { @@ -411,15 +425,11 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.CreateFindingRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('CreateFindingRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.securitycenter.v1.Finding() ); @@ -442,11 +452,14 @@ describe('v1.SecurityCenterClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.createFinding as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.createFinding as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createFinding as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createFinding with error', async () => { @@ -458,26 +471,25 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.CreateFindingRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('CreateFindingRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.createFinding = stubSimpleCall( undefined, expectedError ); await assert.rejects(client.createFinding(request), expectedError); - assert( - (client.innerApiCalls.createFinding as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.createFinding as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createFinding as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createFinding with closed client', async () => { @@ -489,7 +501,10 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.CreateFindingRequest() ); - request.parent = ''; + const defaultValue1 = getTypeDefaultValue('CreateFindingRequest', [ + 'parent', + ]); + request.parent = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.createFinding(request), expectedError); @@ -506,26 +521,25 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.CreateMuteConfigRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('CreateMuteConfigRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.securitycenter.v1.MuteConfig() ); client.innerApiCalls.createMuteConfig = stubSimpleCall(expectedResponse); const [response] = await client.createMuteConfig(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.createMuteConfig as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.createMuteConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createMuteConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createMuteConfig without error using callback', async () => { @@ -537,15 +551,11 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.CreateMuteConfigRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('CreateMuteConfigRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.securitycenter.v1.MuteConfig() ); @@ -568,11 +578,14 @@ describe('v1.SecurityCenterClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.createMuteConfig as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.createMuteConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createMuteConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createMuteConfig with error', async () => { @@ -584,26 +597,25 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.CreateMuteConfigRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('CreateMuteConfigRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.createMuteConfig = stubSimpleCall( undefined, expectedError ); await assert.rejects(client.createMuteConfig(request), expectedError); - assert( - (client.innerApiCalls.createMuteConfig as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.createMuteConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createMuteConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createMuteConfig with closed client', async () => { @@ -615,7 +627,10 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.CreateMuteConfigRequest() ); - request.parent = ''; + const defaultValue1 = getTypeDefaultValue('CreateMuteConfigRequest', [ + 'parent', + ]); + request.parent = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.createMuteConfig(request), expectedError); @@ -632,15 +647,12 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.CreateNotificationConfigRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'CreateNotificationConfigRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.securitycenter.v1.NotificationConfig() ); @@ -648,11 +660,14 @@ describe('v1.SecurityCenterClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.createNotificationConfig(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.createNotificationConfig as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.createNotificationConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createNotificationConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createNotificationConfig without error using callback', async () => { @@ -664,15 +679,12 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.CreateNotificationConfigRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'CreateNotificationConfigRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.securitycenter.v1.NotificationConfig() ); @@ -695,11 +707,14 @@ describe('v1.SecurityCenterClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.createNotificationConfig as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.createNotificationConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createNotificationConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createNotificationConfig with error', async () => { @@ -711,15 +726,12 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.CreateNotificationConfigRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'CreateNotificationConfigRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.createNotificationConfig = stubSimpleCall( undefined, @@ -729,11 +741,14 @@ describe('v1.SecurityCenterClient', () => { client.createNotificationConfig(request), expectedError ); - assert( - (client.innerApiCalls.createNotificationConfig as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.createNotificationConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createNotificationConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createNotificationConfig with closed client', async () => { @@ -745,7 +760,11 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.CreateNotificationConfigRequest() ); - request.parent = ''; + const defaultValue1 = getTypeDefaultValue( + 'CreateNotificationConfigRequest', + ['parent'] + ); + request.parent = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects( @@ -765,26 +784,25 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.DeleteMuteConfigRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('DeleteMuteConfigRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); client.innerApiCalls.deleteMuteConfig = stubSimpleCall(expectedResponse); const [response] = await client.deleteMuteConfig(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.deleteMuteConfig as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.deleteMuteConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteMuteConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteMuteConfig without error using callback', async () => { @@ -796,15 +814,11 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.DeleteMuteConfigRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('DeleteMuteConfigRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -827,11 +841,14 @@ describe('v1.SecurityCenterClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.deleteMuteConfig as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.deleteMuteConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteMuteConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteMuteConfig with error', async () => { @@ -843,26 +860,25 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.DeleteMuteConfigRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('DeleteMuteConfigRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteMuteConfig = stubSimpleCall( undefined, expectedError ); await assert.rejects(client.deleteMuteConfig(request), expectedError); - assert( - (client.innerApiCalls.deleteMuteConfig as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.deleteMuteConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteMuteConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteMuteConfig with closed client', async () => { @@ -874,7 +890,10 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.DeleteMuteConfigRequest() ); - request.name = ''; + const defaultValue1 = getTypeDefaultValue('DeleteMuteConfigRequest', [ + 'name', + ]); + request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.deleteMuteConfig(request), expectedError); @@ -891,15 +910,12 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.DeleteNotificationConfigRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'DeleteNotificationConfigRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -907,11 +923,14 @@ describe('v1.SecurityCenterClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.deleteNotificationConfig(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.deleteNotificationConfig as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.deleteNotificationConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteNotificationConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteNotificationConfig without error using callback', async () => { @@ -923,15 +942,12 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.DeleteNotificationConfigRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'DeleteNotificationConfigRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -954,11 +970,14 @@ describe('v1.SecurityCenterClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.deleteNotificationConfig as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.deleteNotificationConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteNotificationConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteNotificationConfig with error', async () => { @@ -970,15 +989,12 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.DeleteNotificationConfigRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'DeleteNotificationConfigRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteNotificationConfig = stubSimpleCall( undefined, @@ -988,11 +1004,14 @@ describe('v1.SecurityCenterClient', () => { client.deleteNotificationConfig(request), expectedError ); - assert( - (client.innerApiCalls.deleteNotificationConfig as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.deleteNotificationConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteNotificationConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteNotificationConfig with closed client', async () => { @@ -1004,7 +1023,11 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.DeleteNotificationConfigRequest() ); - request.name = ''; + const defaultValue1 = getTypeDefaultValue( + 'DeleteNotificationConfigRequest', + ['name'] + ); + request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects( @@ -1024,26 +1047,25 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.GetBigQueryExportRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('GetBigQueryExportRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.securitycenter.v1.BigQueryExport() ); client.innerApiCalls.getBigQueryExport = stubSimpleCall(expectedResponse); const [response] = await client.getBigQueryExport(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getBigQueryExport as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.getBigQueryExport as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getBigQueryExport as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getBigQueryExport without error using callback', async () => { @@ -1055,15 +1077,11 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.GetBigQueryExportRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('GetBigQueryExportRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.securitycenter.v1.BigQueryExport() ); @@ -1086,11 +1104,14 @@ describe('v1.SecurityCenterClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getBigQueryExport as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.getBigQueryExport as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getBigQueryExport as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getBigQueryExport with error', async () => { @@ -1102,26 +1123,25 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.GetBigQueryExportRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('GetBigQueryExportRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.getBigQueryExport = stubSimpleCall( undefined, expectedError ); await assert.rejects(client.getBigQueryExport(request), expectedError); - assert( - (client.innerApiCalls.getBigQueryExport as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.getBigQueryExport as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getBigQueryExport as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getBigQueryExport with closed client', async () => { @@ -1133,7 +1153,10 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.GetBigQueryExportRequest() ); - request.name = ''; + const defaultValue1 = getTypeDefaultValue('GetBigQueryExportRequest', [ + 'name', + ]); + request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.getBigQueryExport(request), expectedError); @@ -1150,26 +1173,25 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.iam.v1.GetIamPolicyRequest() ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('GetIamPolicyRequest', [ + 'resource', + ]); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.iam.v1.Policy() ); client.innerApiCalls.getIamPolicy = stubSimpleCall(expectedResponse); const [response] = await client.getIamPolicy(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getIamPolicy as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.getIamPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getIamPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getIamPolicy without error using callback', async () => { @@ -1181,15 +1203,11 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.iam.v1.GetIamPolicyRequest() ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('GetIamPolicyRequest', [ + 'resource', + ]); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.iam.v1.Policy() ); @@ -1212,11 +1230,14 @@ describe('v1.SecurityCenterClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getIamPolicy as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.getIamPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getIamPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getIamPolicy with error', async () => { @@ -1228,26 +1249,25 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.iam.v1.GetIamPolicyRequest() ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('GetIamPolicyRequest', [ + 'resource', + ]); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.getIamPolicy = stubSimpleCall( undefined, expectedError ); await assert.rejects(client.getIamPolicy(request), expectedError); - assert( - (client.innerApiCalls.getIamPolicy as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.getIamPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getIamPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getIamPolicy with closed client', async () => { @@ -1259,7 +1279,10 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.iam.v1.GetIamPolicyRequest() ); - request.resource = ''; + const defaultValue1 = getTypeDefaultValue('GetIamPolicyRequest', [ + 'resource', + ]); + request.resource = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.getIamPolicy(request), expectedError); @@ -1276,26 +1299,25 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.GetMuteConfigRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('GetMuteConfigRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.securitycenter.v1.MuteConfig() ); client.innerApiCalls.getMuteConfig = stubSimpleCall(expectedResponse); const [response] = await client.getMuteConfig(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getMuteConfig as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.getMuteConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getMuteConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getMuteConfig without error using callback', async () => { @@ -1307,15 +1329,11 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.GetMuteConfigRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('GetMuteConfigRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.securitycenter.v1.MuteConfig() ); @@ -1338,11 +1356,14 @@ describe('v1.SecurityCenterClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getMuteConfig as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.getMuteConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getMuteConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getMuteConfig with error', async () => { @@ -1354,26 +1375,25 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.GetMuteConfigRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('GetMuteConfigRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.getMuteConfig = stubSimpleCall( undefined, expectedError ); await assert.rejects(client.getMuteConfig(request), expectedError); - assert( - (client.innerApiCalls.getMuteConfig as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.getMuteConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getMuteConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getMuteConfig with closed client', async () => { @@ -1385,7 +1405,10 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.GetMuteConfigRequest() ); - request.name = ''; + const defaultValue1 = getTypeDefaultValue('GetMuteConfigRequest', [ + 'name', + ]); + request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.getMuteConfig(request), expectedError); @@ -1402,15 +1425,12 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.GetNotificationConfigRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'GetNotificationConfigRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.securitycenter.v1.NotificationConfig() ); @@ -1418,11 +1438,14 @@ describe('v1.SecurityCenterClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.getNotificationConfig(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getNotificationConfig as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.getNotificationConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getNotificationConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getNotificationConfig without error using callback', async () => { @@ -1434,15 +1457,12 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.GetNotificationConfigRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'GetNotificationConfigRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.securitycenter.v1.NotificationConfig() ); @@ -1465,11 +1485,14 @@ describe('v1.SecurityCenterClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getNotificationConfig as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.getNotificationConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getNotificationConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getNotificationConfig with error', async () => { @@ -1481,15 +1504,12 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.GetNotificationConfigRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'GetNotificationConfigRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.getNotificationConfig = stubSimpleCall( undefined, @@ -1499,11 +1519,14 @@ describe('v1.SecurityCenterClient', () => { client.getNotificationConfig(request), expectedError ); - assert( - (client.innerApiCalls.getNotificationConfig as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.getNotificationConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getNotificationConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getNotificationConfig with closed client', async () => { @@ -1515,7 +1538,11 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.GetNotificationConfigRequest() ); - request.name = ''; + const defaultValue1 = getTypeDefaultValue( + 'GetNotificationConfigRequest', + ['name'] + ); + request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects( @@ -1535,15 +1562,12 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.GetOrganizationSettingsRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'GetOrganizationSettingsRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.securitycenter.v1.OrganizationSettings() ); @@ -1551,11 +1575,14 @@ describe('v1.SecurityCenterClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.getOrganizationSettings(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getOrganizationSettings as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.getOrganizationSettings as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getOrganizationSettings as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getOrganizationSettings without error using callback', async () => { @@ -1567,15 +1594,12 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.GetOrganizationSettingsRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'GetOrganizationSettingsRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.securitycenter.v1.OrganizationSettings() ); @@ -1598,11 +1622,14 @@ describe('v1.SecurityCenterClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getOrganizationSettings as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.getOrganizationSettings as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getOrganizationSettings as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getOrganizationSettings with error', async () => { @@ -1614,15 +1641,12 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.GetOrganizationSettingsRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'GetOrganizationSettingsRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.getOrganizationSettings = stubSimpleCall( undefined, @@ -1632,11 +1656,14 @@ describe('v1.SecurityCenterClient', () => { client.getOrganizationSettings(request), expectedError ); - assert( - (client.innerApiCalls.getOrganizationSettings as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.getOrganizationSettings as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getOrganizationSettings as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getOrganizationSettings with closed client', async () => { @@ -1648,7 +1675,11 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.GetOrganizationSettingsRequest() ); - request.name = ''; + const defaultValue1 = getTypeDefaultValue( + 'GetOrganizationSettingsRequest', + ['name'] + ); + request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects( @@ -1668,26 +1699,23 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.GetSourceRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('GetSourceRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.securitycenter.v1.Source() ); client.innerApiCalls.getSource = stubSimpleCall(expectedResponse); const [response] = await client.getSource(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getSource as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.getSource as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getSource as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getSource without error using callback', async () => { @@ -1699,15 +1727,9 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.GetSourceRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('GetSourceRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.securitycenter.v1.Source() ); @@ -1730,11 +1752,14 @@ describe('v1.SecurityCenterClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getSource as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.getSource as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getSource as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getSource with error', async () => { @@ -1746,23 +1771,20 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.GetSourceRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('GetSourceRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.getSource = stubSimpleCall(undefined, expectedError); await assert.rejects(client.getSource(request), expectedError); - assert( - (client.innerApiCalls.getSource as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.getSource as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getSource as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getSource with closed client', async () => { @@ -1774,7 +1796,8 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.GetSourceRequest() ); - request.name = ''; + const defaultValue1 = getTypeDefaultValue('GetSourceRequest', ['name']); + request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.getSource(request), expectedError); @@ -1791,26 +1814,25 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.SetFindingStateRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('SetFindingStateRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.securitycenter.v1.Finding() ); client.innerApiCalls.setFindingState = stubSimpleCall(expectedResponse); const [response] = await client.setFindingState(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.setFindingState as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.setFindingState as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.setFindingState as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes setFindingState without error using callback', async () => { @@ -1822,15 +1844,11 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.SetFindingStateRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('SetFindingStateRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.securitycenter.v1.Finding() ); @@ -1853,11 +1871,14 @@ describe('v1.SecurityCenterClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.setFindingState as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.setFindingState as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.setFindingState as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes setFindingState with error', async () => { @@ -1869,26 +1890,25 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.SetFindingStateRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('SetFindingStateRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.setFindingState = stubSimpleCall( undefined, expectedError ); await assert.rejects(client.setFindingState(request), expectedError); - assert( - (client.innerApiCalls.setFindingState as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.setFindingState as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.setFindingState as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes setFindingState with closed client', async () => { @@ -1900,7 +1920,10 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.SetFindingStateRequest() ); - request.name = ''; + const defaultValue1 = getTypeDefaultValue('SetFindingStateRequest', [ + 'name', + ]); + request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.setFindingState(request), expectedError); @@ -1917,26 +1940,23 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.SetMuteRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('SetMuteRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.securitycenter.v1.Finding() ); client.innerApiCalls.setMute = stubSimpleCall(expectedResponse); const [response] = await client.setMute(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.setMute as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = (client.innerApiCalls.setMute as SinonStub).getCall( + 0 + ).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.setMute as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes setMute without error using callback', async () => { @@ -1948,15 +1968,9 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.SetMuteRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('SetMuteRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.securitycenter.v1.Finding() ); @@ -1979,11 +1993,14 @@ describe('v1.SecurityCenterClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.setMute as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = (client.innerApiCalls.setMute as SinonStub).getCall( + 0 + ).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.setMute as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes setMute with error', async () => { @@ -1995,23 +2012,20 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.SetMuteRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('SetMuteRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.setMute = stubSimpleCall(undefined, expectedError); await assert.rejects(client.setMute(request), expectedError); - assert( - (client.innerApiCalls.setMute as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = (client.innerApiCalls.setMute as SinonStub).getCall( + 0 + ).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.setMute as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes setMute with closed client', async () => { @@ -2023,7 +2037,8 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.SetMuteRequest() ); - request.name = ''; + const defaultValue1 = getTypeDefaultValue('SetMuteRequest', ['name']); + request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.setMute(request), expectedError); @@ -2040,26 +2055,25 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.iam.v1.SetIamPolicyRequest() ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('SetIamPolicyRequest', [ + 'resource', + ]); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.iam.v1.Policy() ); client.innerApiCalls.setIamPolicy = stubSimpleCall(expectedResponse); const [response] = await client.setIamPolicy(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.setIamPolicy as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.setIamPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.setIamPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes setIamPolicy without error using callback', async () => { @@ -2071,15 +2085,11 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.iam.v1.SetIamPolicyRequest() ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('SetIamPolicyRequest', [ + 'resource', + ]); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.iam.v1.Policy() ); @@ -2102,11 +2112,14 @@ describe('v1.SecurityCenterClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.setIamPolicy as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.setIamPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.setIamPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes setIamPolicy with error', async () => { @@ -2118,26 +2131,25 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.iam.v1.SetIamPolicyRequest() ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('SetIamPolicyRequest', [ + 'resource', + ]); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.setIamPolicy = stubSimpleCall( undefined, expectedError ); await assert.rejects(client.setIamPolicy(request), expectedError); - assert( - (client.innerApiCalls.setIamPolicy as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.setIamPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.setIamPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes setIamPolicy with closed client', async () => { @@ -2149,7 +2161,10 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.iam.v1.SetIamPolicyRequest() ); - request.resource = ''; + const defaultValue1 = getTypeDefaultValue('SetIamPolicyRequest', [ + 'resource', + ]); + request.resource = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.setIamPolicy(request), expectedError); @@ -2166,15 +2181,11 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.iam.v1.TestIamPermissionsRequest() ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('TestIamPermissionsRequest', [ + 'resource', + ]); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.iam.v1.TestIamPermissionsResponse() ); @@ -2182,11 +2193,14 @@ describe('v1.SecurityCenterClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.testIamPermissions(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.testIamPermissions as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.testIamPermissions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.testIamPermissions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes testIamPermissions without error using callback', async () => { @@ -2198,15 +2212,11 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.iam.v1.TestIamPermissionsRequest() ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('TestIamPermissionsRequest', [ + 'resource', + ]); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.iam.v1.TestIamPermissionsResponse() ); @@ -2229,11 +2239,14 @@ describe('v1.SecurityCenterClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.testIamPermissions as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.testIamPermissions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.testIamPermissions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes testIamPermissions with error', async () => { @@ -2245,26 +2258,25 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.iam.v1.TestIamPermissionsRequest() ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('TestIamPermissionsRequest', [ + 'resource', + ]); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.testIamPermissions = stubSimpleCall( undefined, expectedError ); await assert.rejects(client.testIamPermissions(request), expectedError); - assert( - (client.innerApiCalls.testIamPermissions as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.testIamPermissions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.testIamPermissions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes testIamPermissions with closed client', async () => { @@ -2276,7 +2288,10 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.iam.v1.TestIamPermissionsRequest() ); - request.resource = ''; + const defaultValue1 = getTypeDefaultValue('TestIamPermissionsRequest', [ + 'resource', + ]); + request.resource = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.testIamPermissions(request), expectedError); @@ -2293,16 +2308,13 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.UpdateExternalSystemRequest() ); - request.externalSystem = {}; - request.externalSystem.name = ''; - const expectedHeaderRequestParams = 'external_system.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.externalSystem ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateExternalSystemRequest', [ + 'externalSystem', + 'name', + ]); + request.externalSystem.name = defaultValue1; + const expectedHeaderRequestParams = `external_system.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.securitycenter.v1.ExternalSystem() ); @@ -2310,11 +2322,14 @@ describe('v1.SecurityCenterClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.updateExternalSystem(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.updateExternalSystem as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.updateExternalSystem as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateExternalSystem as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateExternalSystem without error using callback', async () => { @@ -2326,16 +2341,13 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.UpdateExternalSystemRequest() ); - request.externalSystem = {}; - request.externalSystem.name = ''; - const expectedHeaderRequestParams = 'external_system.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.externalSystem ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateExternalSystemRequest', [ + 'externalSystem', + 'name', + ]); + request.externalSystem.name = defaultValue1; + const expectedHeaderRequestParams = `external_system.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.securitycenter.v1.ExternalSystem() ); @@ -2358,11 +2370,14 @@ describe('v1.SecurityCenterClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.updateExternalSystem as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.updateExternalSystem as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateExternalSystem as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateExternalSystem with error', async () => { @@ -2374,27 +2389,27 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.UpdateExternalSystemRequest() ); - request.externalSystem = {}; - request.externalSystem.name = ''; - const expectedHeaderRequestParams = 'external_system.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.externalSystem ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateExternalSystemRequest', [ + 'externalSystem', + 'name', + ]); + request.externalSystem.name = defaultValue1; + const expectedHeaderRequestParams = `external_system.name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.updateExternalSystem = stubSimpleCall( undefined, expectedError ); await assert.rejects(client.updateExternalSystem(request), expectedError); - assert( - (client.innerApiCalls.updateExternalSystem as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.updateExternalSystem as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateExternalSystem as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateExternalSystem with closed client', async () => { @@ -2406,8 +2421,12 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.UpdateExternalSystemRequest() ); - request.externalSystem = {}; - request.externalSystem.name = ''; + request.externalSystem ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateExternalSystemRequest', [ + 'externalSystem', + 'name', + ]); + request.externalSystem.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.updateExternalSystem(request), expectedError); @@ -2424,27 +2443,27 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.UpdateFindingRequest() ); - request.finding = {}; - request.finding.name = ''; - const expectedHeaderRequestParams = 'finding.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.finding ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateFindingRequest', [ + 'finding', + 'name', + ]); + request.finding.name = defaultValue1; + const expectedHeaderRequestParams = `finding.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.securitycenter.v1.Finding() ); client.innerApiCalls.updateFinding = stubSimpleCall(expectedResponse); const [response] = await client.updateFinding(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.updateFinding as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.updateFinding as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateFinding as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateFinding without error using callback', async () => { @@ -2456,16 +2475,13 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.UpdateFindingRequest() ); - request.finding = {}; - request.finding.name = ''; - const expectedHeaderRequestParams = 'finding.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.finding ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateFindingRequest', [ + 'finding', + 'name', + ]); + request.finding.name = defaultValue1; + const expectedHeaderRequestParams = `finding.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.securitycenter.v1.Finding() ); @@ -2488,11 +2504,14 @@ describe('v1.SecurityCenterClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.updateFinding as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.updateFinding as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateFinding as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateFinding with error', async () => { @@ -2504,27 +2523,27 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.UpdateFindingRequest() ); - request.finding = {}; - request.finding.name = ''; - const expectedHeaderRequestParams = 'finding.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.finding ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateFindingRequest', [ + 'finding', + 'name', + ]); + request.finding.name = defaultValue1; + const expectedHeaderRequestParams = `finding.name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.updateFinding = stubSimpleCall( undefined, expectedError ); await assert.rejects(client.updateFinding(request), expectedError); - assert( - (client.innerApiCalls.updateFinding as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.updateFinding as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateFinding as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateFinding with closed client', async () => { @@ -2536,8 +2555,12 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.UpdateFindingRequest() ); - request.finding = {}; - request.finding.name = ''; + request.finding ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateFindingRequest', [ + 'finding', + 'name', + ]); + request.finding.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.updateFinding(request), expectedError); @@ -2554,27 +2577,27 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.UpdateMuteConfigRequest() ); - request.muteConfig = {}; - request.muteConfig.name = ''; - const expectedHeaderRequestParams = 'mute_config.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.muteConfig ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateMuteConfigRequest', [ + 'muteConfig', + 'name', + ]); + request.muteConfig.name = defaultValue1; + const expectedHeaderRequestParams = `mute_config.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.securitycenter.v1.MuteConfig() ); client.innerApiCalls.updateMuteConfig = stubSimpleCall(expectedResponse); const [response] = await client.updateMuteConfig(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.updateMuteConfig as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.updateMuteConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateMuteConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateMuteConfig without error using callback', async () => { @@ -2586,16 +2609,13 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.UpdateMuteConfigRequest() ); - request.muteConfig = {}; - request.muteConfig.name = ''; - const expectedHeaderRequestParams = 'mute_config.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.muteConfig ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateMuteConfigRequest', [ + 'muteConfig', + 'name', + ]); + request.muteConfig.name = defaultValue1; + const expectedHeaderRequestParams = `mute_config.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.securitycenter.v1.MuteConfig() ); @@ -2618,11 +2638,14 @@ describe('v1.SecurityCenterClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.updateMuteConfig as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.updateMuteConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateMuteConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateMuteConfig with error', async () => { @@ -2634,27 +2657,27 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.UpdateMuteConfigRequest() ); - request.muteConfig = {}; - request.muteConfig.name = ''; - const expectedHeaderRequestParams = 'mute_config.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.muteConfig ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateMuteConfigRequest', [ + 'muteConfig', + 'name', + ]); + request.muteConfig.name = defaultValue1; + const expectedHeaderRequestParams = `mute_config.name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.updateMuteConfig = stubSimpleCall( undefined, expectedError ); await assert.rejects(client.updateMuteConfig(request), expectedError); - assert( - (client.innerApiCalls.updateMuteConfig as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.updateMuteConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateMuteConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateMuteConfig with closed client', async () => { @@ -2666,8 +2689,12 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.UpdateMuteConfigRequest() ); - request.muteConfig = {}; - request.muteConfig.name = ''; + request.muteConfig ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateMuteConfigRequest', [ + 'muteConfig', + 'name', + ]); + request.muteConfig.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.updateMuteConfig(request), expectedError); @@ -2684,16 +2711,13 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.UpdateNotificationConfigRequest() ); - request.notificationConfig = {}; - request.notificationConfig.name = ''; - const expectedHeaderRequestParams = 'notification_config.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.notificationConfig ??= {}; + const defaultValue1 = getTypeDefaultValue( + 'UpdateNotificationConfigRequest', + ['notificationConfig', 'name'] + ); + request.notificationConfig.name = defaultValue1; + const expectedHeaderRequestParams = `notification_config.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.securitycenter.v1.NotificationConfig() ); @@ -2701,11 +2725,14 @@ describe('v1.SecurityCenterClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.updateNotificationConfig(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.updateNotificationConfig as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.updateNotificationConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateNotificationConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateNotificationConfig without error using callback', async () => { @@ -2717,16 +2744,13 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.UpdateNotificationConfigRequest() ); - request.notificationConfig = {}; - request.notificationConfig.name = ''; - const expectedHeaderRequestParams = 'notification_config.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.notificationConfig ??= {}; + const defaultValue1 = getTypeDefaultValue( + 'UpdateNotificationConfigRequest', + ['notificationConfig', 'name'] + ); + request.notificationConfig.name = defaultValue1; + const expectedHeaderRequestParams = `notification_config.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.securitycenter.v1.NotificationConfig() ); @@ -2749,11 +2773,14 @@ describe('v1.SecurityCenterClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.updateNotificationConfig as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.updateNotificationConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateNotificationConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateNotificationConfig with error', async () => { @@ -2765,16 +2792,13 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.UpdateNotificationConfigRequest() ); - request.notificationConfig = {}; - request.notificationConfig.name = ''; - const expectedHeaderRequestParams = 'notification_config.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.notificationConfig ??= {}; + const defaultValue1 = getTypeDefaultValue( + 'UpdateNotificationConfigRequest', + ['notificationConfig', 'name'] + ); + request.notificationConfig.name = defaultValue1; + const expectedHeaderRequestParams = `notification_config.name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.updateNotificationConfig = stubSimpleCall( undefined, @@ -2784,11 +2808,14 @@ describe('v1.SecurityCenterClient', () => { client.updateNotificationConfig(request), expectedError ); - assert( - (client.innerApiCalls.updateNotificationConfig as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.updateNotificationConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateNotificationConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateNotificationConfig with closed client', async () => { @@ -2800,8 +2827,12 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.UpdateNotificationConfigRequest() ); - request.notificationConfig = {}; - request.notificationConfig.name = ''; + request.notificationConfig ??= {}; + const defaultValue1 = getTypeDefaultValue( + 'UpdateNotificationConfigRequest', + ['notificationConfig', 'name'] + ); + request.notificationConfig.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects( @@ -2821,16 +2852,13 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest() ); - request.organizationSettings = {}; - request.organizationSettings.name = ''; - const expectedHeaderRequestParams = 'organization_settings.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.organizationSettings ??= {}; + const defaultValue1 = getTypeDefaultValue( + 'UpdateOrganizationSettingsRequest', + ['organizationSettings', 'name'] + ); + request.organizationSettings.name = defaultValue1; + const expectedHeaderRequestParams = `organization_settings.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.securitycenter.v1.OrganizationSettings() ); @@ -2838,11 +2866,14 @@ describe('v1.SecurityCenterClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.updateOrganizationSettings(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.updateOrganizationSettings as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.updateOrganizationSettings as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateOrganizationSettings as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateOrganizationSettings without error using callback', async () => { @@ -2854,16 +2885,13 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest() ); - request.organizationSettings = {}; - request.organizationSettings.name = ''; - const expectedHeaderRequestParams = 'organization_settings.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.organizationSettings ??= {}; + const defaultValue1 = getTypeDefaultValue( + 'UpdateOrganizationSettingsRequest', + ['organizationSettings', 'name'] + ); + request.organizationSettings.name = defaultValue1; + const expectedHeaderRequestParams = `organization_settings.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.securitycenter.v1.OrganizationSettings() ); @@ -2886,11 +2914,14 @@ describe('v1.SecurityCenterClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.updateOrganizationSettings as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.updateOrganizationSettings as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateOrganizationSettings as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateOrganizationSettings with error', async () => { @@ -2902,16 +2933,13 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest() ); - request.organizationSettings = {}; - request.organizationSettings.name = ''; - const expectedHeaderRequestParams = 'organization_settings.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.organizationSettings ??= {}; + const defaultValue1 = getTypeDefaultValue( + 'UpdateOrganizationSettingsRequest', + ['organizationSettings', 'name'] + ); + request.organizationSettings.name = defaultValue1; + const expectedHeaderRequestParams = `organization_settings.name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.updateOrganizationSettings = stubSimpleCall( undefined, @@ -2921,11 +2949,14 @@ describe('v1.SecurityCenterClient', () => { client.updateOrganizationSettings(request), expectedError ); - assert( - (client.innerApiCalls.updateOrganizationSettings as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.updateOrganizationSettings as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateOrganizationSettings as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateOrganizationSettings with closed client', async () => { @@ -2937,8 +2968,12 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest() ); - request.organizationSettings = {}; - request.organizationSettings.name = ''; + request.organizationSettings ??= {}; + const defaultValue1 = getTypeDefaultValue( + 'UpdateOrganizationSettingsRequest', + ['organizationSettings', 'name'] + ); + request.organizationSettings.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects( @@ -2958,27 +2993,27 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.UpdateSourceRequest() ); - request.source = {}; - request.source.name = ''; - const expectedHeaderRequestParams = 'source.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.source ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateSourceRequest', [ + 'source', + 'name', + ]); + request.source.name = defaultValue1; + const expectedHeaderRequestParams = `source.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.securitycenter.v1.Source() ); client.innerApiCalls.updateSource = stubSimpleCall(expectedResponse); const [response] = await client.updateSource(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.updateSource as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.updateSource as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateSource as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateSource without error using callback', async () => { @@ -2990,16 +3025,13 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.UpdateSourceRequest() ); - request.source = {}; - request.source.name = ''; - const expectedHeaderRequestParams = 'source.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.source ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateSourceRequest', [ + 'source', + 'name', + ]); + request.source.name = defaultValue1; + const expectedHeaderRequestParams = `source.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.securitycenter.v1.Source() ); @@ -3022,11 +3054,14 @@ describe('v1.SecurityCenterClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.updateSource as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.updateSource as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateSource as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateSource with error', async () => { @@ -3038,27 +3073,27 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.UpdateSourceRequest() ); - request.source = {}; - request.source.name = ''; - const expectedHeaderRequestParams = 'source.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.source ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateSourceRequest', [ + 'source', + 'name', + ]); + request.source.name = defaultValue1; + const expectedHeaderRequestParams = `source.name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.updateSource = stubSimpleCall( undefined, expectedError ); await assert.rejects(client.updateSource(request), expectedError); - assert( - (client.innerApiCalls.updateSource as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.updateSource as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateSource as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateSource with closed client', async () => { @@ -3070,8 +3105,12 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.UpdateSourceRequest() ); - request.source = {}; - request.source.name = ''; + request.source ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateSourceRequest', [ + 'source', + 'name', + ]); + request.source.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.updateSource(request), expectedError); @@ -3088,16 +3127,13 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.UpdateSecurityMarksRequest() ); - request.securityMarks = {}; - request.securityMarks.name = ''; - const expectedHeaderRequestParams = 'security_marks.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.securityMarks ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateSecurityMarksRequest', [ + 'securityMarks', + 'name', + ]); + request.securityMarks.name = defaultValue1; + const expectedHeaderRequestParams = `security_marks.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.securitycenter.v1.SecurityMarks() ); @@ -3105,11 +3141,14 @@ describe('v1.SecurityCenterClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.updateSecurityMarks(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.updateSecurityMarks as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.updateSecurityMarks as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateSecurityMarks as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateSecurityMarks without error using callback', async () => { @@ -3121,16 +3160,13 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.UpdateSecurityMarksRequest() ); - request.securityMarks = {}; - request.securityMarks.name = ''; - const expectedHeaderRequestParams = 'security_marks.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.securityMarks ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateSecurityMarksRequest', [ + 'securityMarks', + 'name', + ]); + request.securityMarks.name = defaultValue1; + const expectedHeaderRequestParams = `security_marks.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.securitycenter.v1.SecurityMarks() ); @@ -3153,11 +3189,14 @@ describe('v1.SecurityCenterClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.updateSecurityMarks as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.updateSecurityMarks as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateSecurityMarks as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateSecurityMarks with error', async () => { @@ -3169,27 +3208,27 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.UpdateSecurityMarksRequest() ); - request.securityMarks = {}; - request.securityMarks.name = ''; - const expectedHeaderRequestParams = 'security_marks.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.securityMarks ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateSecurityMarksRequest', [ + 'securityMarks', + 'name', + ]); + request.securityMarks.name = defaultValue1; + const expectedHeaderRequestParams = `security_marks.name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.updateSecurityMarks = stubSimpleCall( undefined, expectedError ); await assert.rejects(client.updateSecurityMarks(request), expectedError); - assert( - (client.innerApiCalls.updateSecurityMarks as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.updateSecurityMarks as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateSecurityMarks as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateSecurityMarks with closed client', async () => { @@ -3201,8 +3240,12 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.UpdateSecurityMarksRequest() ); - request.securityMarks = {}; - request.securityMarks.name = ''; + request.securityMarks ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateSecurityMarksRequest', [ + 'securityMarks', + 'name', + ]); + request.securityMarks.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.updateSecurityMarks(request), expectedError); @@ -3219,15 +3262,11 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.CreateBigQueryExportRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('CreateBigQueryExportRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.securitycenter.v1.BigQueryExport() ); @@ -3235,11 +3274,14 @@ describe('v1.SecurityCenterClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.createBigQueryExport(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.createBigQueryExport as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.createBigQueryExport as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createBigQueryExport as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createBigQueryExport without error using callback', async () => { @@ -3251,15 +3293,11 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.CreateBigQueryExportRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('CreateBigQueryExportRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.securitycenter.v1.BigQueryExport() ); @@ -3282,11 +3320,14 @@ describe('v1.SecurityCenterClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.createBigQueryExport as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.createBigQueryExport as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createBigQueryExport as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createBigQueryExport with error', async () => { @@ -3298,26 +3339,25 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.CreateBigQueryExportRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('CreateBigQueryExportRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.createBigQueryExport = stubSimpleCall( undefined, expectedError ); await assert.rejects(client.createBigQueryExport(request), expectedError); - assert( - (client.innerApiCalls.createBigQueryExport as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.createBigQueryExport as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createBigQueryExport as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createBigQueryExport with closed client', async () => { @@ -3329,7 +3369,10 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.CreateBigQueryExportRequest() ); - request.parent = ''; + const defaultValue1 = getTypeDefaultValue('CreateBigQueryExportRequest', [ + 'parent', + ]); + request.parent = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.createBigQueryExport(request), expectedError); @@ -3346,15 +3389,11 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.DeleteBigQueryExportRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('DeleteBigQueryExportRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -3362,11 +3401,14 @@ describe('v1.SecurityCenterClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.deleteBigQueryExport(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.deleteBigQueryExport as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.deleteBigQueryExport as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteBigQueryExport as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteBigQueryExport without error using callback', async () => { @@ -3378,15 +3420,11 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.DeleteBigQueryExportRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('DeleteBigQueryExportRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -3409,11 +3447,14 @@ describe('v1.SecurityCenterClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.deleteBigQueryExport as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.deleteBigQueryExport as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteBigQueryExport as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteBigQueryExport with error', async () => { @@ -3425,26 +3466,25 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.DeleteBigQueryExportRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('DeleteBigQueryExportRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteBigQueryExport = stubSimpleCall( undefined, expectedError ); await assert.rejects(client.deleteBigQueryExport(request), expectedError); - assert( - (client.innerApiCalls.deleteBigQueryExport as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.deleteBigQueryExport as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteBigQueryExport as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteBigQueryExport with closed client', async () => { @@ -3456,7 +3496,10 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.DeleteBigQueryExportRequest() ); - request.name = ''; + const defaultValue1 = getTypeDefaultValue('DeleteBigQueryExportRequest', [ + 'name', + ]); + request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.deleteBigQueryExport(request), expectedError); @@ -3473,16 +3516,13 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.UpdateBigQueryExportRequest() ); - request.bigQueryExport = {}; - request.bigQueryExport.name = ''; - const expectedHeaderRequestParams = 'big_query_export.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.bigQueryExport ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateBigQueryExportRequest', [ + 'bigQueryExport', + 'name', + ]); + request.bigQueryExport.name = defaultValue1; + const expectedHeaderRequestParams = `big_query_export.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.securitycenter.v1.BigQueryExport() ); @@ -3490,11 +3530,14 @@ describe('v1.SecurityCenterClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.updateBigQueryExport(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.updateBigQueryExport as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.updateBigQueryExport as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateBigQueryExport as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateBigQueryExport without error using callback', async () => { @@ -3506,16 +3549,13 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.UpdateBigQueryExportRequest() ); - request.bigQueryExport = {}; - request.bigQueryExport.name = ''; - const expectedHeaderRequestParams = 'big_query_export.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.bigQueryExport ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateBigQueryExportRequest', [ + 'bigQueryExport', + 'name', + ]); + request.bigQueryExport.name = defaultValue1; + const expectedHeaderRequestParams = `big_query_export.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.securitycenter.v1.BigQueryExport() ); @@ -3538,11 +3578,14 @@ describe('v1.SecurityCenterClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.updateBigQueryExport as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.updateBigQueryExport as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateBigQueryExport as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateBigQueryExport with error', async () => { @@ -3554,27 +3597,27 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.UpdateBigQueryExportRequest() ); - request.bigQueryExport = {}; - request.bigQueryExport.name = ''; - const expectedHeaderRequestParams = 'big_query_export.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.bigQueryExport ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateBigQueryExportRequest', [ + 'bigQueryExport', + 'name', + ]); + request.bigQueryExport.name = defaultValue1; + const expectedHeaderRequestParams = `big_query_export.name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.updateBigQueryExport = stubSimpleCall( undefined, expectedError ); await assert.rejects(client.updateBigQueryExport(request), expectedError); - assert( - (client.innerApiCalls.updateBigQueryExport as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.updateBigQueryExport as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateBigQueryExport as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateBigQueryExport with closed client', async () => { @@ -3586,8 +3629,12 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.UpdateBigQueryExportRequest() ); - request.bigQueryExport = {}; - request.bigQueryExport.name = ''; + request.bigQueryExport ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateBigQueryExportRequest', [ + 'bigQueryExport', + 'name', + ]); + request.bigQueryExport.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.updateBigQueryExport(request), expectedError); @@ -3604,15 +3651,11 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.BulkMuteFindingsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('BulkMuteFindingsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3621,11 +3664,14 @@ describe('v1.SecurityCenterClient', () => { const [operation] = await client.bulkMuteFindings(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.bulkMuteFindings as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.bulkMuteFindings as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.bulkMuteFindings as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes bulkMuteFindings without error using callback', async () => { @@ -3637,15 +3683,11 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.BulkMuteFindingsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('BulkMuteFindingsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3675,11 +3717,14 @@ describe('v1.SecurityCenterClient', () => { >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.bulkMuteFindings as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.bulkMuteFindings as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.bulkMuteFindings as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes bulkMuteFindings with call error', async () => { @@ -3691,26 +3736,25 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.BulkMuteFindingsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('BulkMuteFindingsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.bulkMuteFindings = stubLongRunningCall( undefined, expectedError ); await assert.rejects(client.bulkMuteFindings(request), expectedError); - assert( - (client.innerApiCalls.bulkMuteFindings as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.bulkMuteFindings as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.bulkMuteFindings as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes bulkMuteFindings with LRO error', async () => { @@ -3722,15 +3766,11 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.BulkMuteFindingsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('BulkMuteFindingsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.bulkMuteFindings = stubLongRunningCall( undefined, @@ -3739,11 +3779,14 @@ describe('v1.SecurityCenterClient', () => { ); const [operation] = await client.bulkMuteFindings(request); await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.bulkMuteFindings as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.bulkMuteFindings as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.bulkMuteFindings as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes checkBulkMuteFindingsProgress without error', async () => { @@ -3798,15 +3841,11 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.RunAssetDiscoveryRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('RunAssetDiscoveryRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3815,11 +3854,14 @@ describe('v1.SecurityCenterClient', () => { const [operation] = await client.runAssetDiscovery(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.runAssetDiscovery as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.runAssetDiscovery as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.runAssetDiscovery as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes runAssetDiscovery without error using callback', async () => { @@ -3831,15 +3873,11 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.RunAssetDiscoveryRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('RunAssetDiscoveryRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3869,11 +3907,14 @@ describe('v1.SecurityCenterClient', () => { >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.runAssetDiscovery as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.runAssetDiscovery as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.runAssetDiscovery as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes runAssetDiscovery with call error', async () => { @@ -3885,26 +3926,25 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.RunAssetDiscoveryRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('RunAssetDiscoveryRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.runAssetDiscovery = stubLongRunningCall( undefined, expectedError ); await assert.rejects(client.runAssetDiscovery(request), expectedError); - assert( - (client.innerApiCalls.runAssetDiscovery as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.runAssetDiscovery as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.runAssetDiscovery as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes runAssetDiscovery with LRO error', async () => { @@ -3916,15 +3956,11 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.RunAssetDiscoveryRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('RunAssetDiscoveryRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.runAssetDiscovery = stubLongRunningCall( undefined, @@ -3933,11 +3969,14 @@ describe('v1.SecurityCenterClient', () => { ); const [operation] = await client.runAssetDiscovery(request); await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.runAssetDiscovery as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.runAssetDiscovery as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.runAssetDiscovery as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes checkRunAssetDiscoveryProgress without error', async () => { @@ -3992,15 +4031,11 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.GroupAssetsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('GroupAssetsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.securitycenter.v1.GroupResult() @@ -4015,11 +4050,14 @@ describe('v1.SecurityCenterClient', () => { client.innerApiCalls.groupAssets = stubSimpleCall(expectedResponse); const [response] = await client.groupAssets(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.groupAssets as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.groupAssets as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.groupAssets as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes groupAssets without error using callback', async () => { @@ -4031,15 +4069,11 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.GroupAssetsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('GroupAssetsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.securitycenter.v1.GroupResult() @@ -4070,11 +4104,14 @@ describe('v1.SecurityCenterClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.groupAssets as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.groupAssets as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.groupAssets as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes groupAssets with error', async () => { @@ -4086,26 +4123,25 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.GroupAssetsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('GroupAssetsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.groupAssets = stubSimpleCall( undefined, expectedError ); await assert.rejects(client.groupAssets(request), expectedError); - assert( - (client.innerApiCalls.groupAssets as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.groupAssets as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.groupAssets as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes groupAssetsStream without error', async () => { @@ -4117,8 +4153,11 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.GroupAssetsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('GroupAssetsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.securitycenter.v1.GroupResult() @@ -4156,11 +4195,12 @@ describe('v1.SecurityCenterClient', () => { .getCall(0) .calledWith(client.innerApiCalls.groupAssets, request) ); - assert.strictEqual( - (client.descriptors.page.groupAssets.createStream as SinonStub).getCall( - 0 - ).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.groupAssets.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -4173,8 +4213,11 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.GroupAssetsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('GroupAssetsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.groupAssets.createStream = stubPageStreamingCall( undefined, @@ -4203,11 +4246,12 @@ describe('v1.SecurityCenterClient', () => { .getCall(0) .calledWith(client.innerApiCalls.groupAssets, request) ); - assert.strictEqual( - (client.descriptors.page.groupAssets.createStream as SinonStub).getCall( - 0 - ).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.groupAssets.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -4220,8 +4264,11 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.GroupAssetsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('GroupAssetsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.securitycenter.v1.GroupResult() @@ -4248,11 +4295,12 @@ describe('v1.SecurityCenterClient', () => { ).args[1], request ); - assert.strictEqual( - (client.descriptors.page.groupAssets.asyncIterate as SinonStub).getCall( - 0 - ).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.groupAssets.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -4265,8 +4313,11 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.GroupAssetsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('GroupAssetsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.groupAssets.asyncIterate = stubAsyncIterationCall( undefined, @@ -4286,11 +4337,12 @@ describe('v1.SecurityCenterClient', () => { ).args[1], request ); - assert.strictEqual( - (client.descriptors.page.groupAssets.asyncIterate as SinonStub).getCall( - 0 - ).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.groupAssets.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); }); @@ -4305,15 +4357,11 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.GroupFindingsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('GroupFindingsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.securitycenter.v1.GroupResult() @@ -4328,11 +4376,14 @@ describe('v1.SecurityCenterClient', () => { client.innerApiCalls.groupFindings = stubSimpleCall(expectedResponse); const [response] = await client.groupFindings(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.groupFindings as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.groupFindings as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.groupFindings as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes groupFindings without error using callback', async () => { @@ -4344,15 +4395,11 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.GroupFindingsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('GroupFindingsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.securitycenter.v1.GroupResult() @@ -4383,11 +4430,14 @@ describe('v1.SecurityCenterClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.groupFindings as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.groupFindings as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.groupFindings as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes groupFindings with error', async () => { @@ -4399,26 +4449,25 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.GroupFindingsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('GroupFindingsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.groupFindings = stubSimpleCall( undefined, expectedError ); await assert.rejects(client.groupFindings(request), expectedError); - assert( - (client.innerApiCalls.groupFindings as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.groupFindings as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.groupFindings as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes groupFindingsStream without error', async () => { @@ -4430,8 +4479,11 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.GroupFindingsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('GroupFindingsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.securitycenter.v1.GroupResult() @@ -4469,11 +4521,12 @@ describe('v1.SecurityCenterClient', () => { .getCall(0) .calledWith(client.innerApiCalls.groupFindings, request) ); - assert.strictEqual( - ( - client.descriptors.page.groupFindings.createStream as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.groupFindings.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -4486,8 +4539,11 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.GroupFindingsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('GroupFindingsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.groupFindings.createStream = stubPageStreamingCall(undefined, expectedError); @@ -4514,11 +4570,12 @@ describe('v1.SecurityCenterClient', () => { .getCall(0) .calledWith(client.innerApiCalls.groupFindings, request) ); - assert.strictEqual( - ( - client.descriptors.page.groupFindings.createStream as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.groupFindings.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -4531,8 +4588,11 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.GroupFindingsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('GroupFindingsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.securitycenter.v1.GroupResult() @@ -4559,11 +4619,12 @@ describe('v1.SecurityCenterClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( - ( - client.descriptors.page.groupFindings.asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.groupFindings.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -4576,8 +4637,11 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.GroupFindingsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('GroupFindingsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.groupFindings.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -4595,11 +4659,12 @@ describe('v1.SecurityCenterClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( - ( - client.descriptors.page.groupFindings.asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.groupFindings.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); }); @@ -4614,15 +4679,11 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.ListAssetsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('ListAssetsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult() @@ -4637,11 +4698,14 @@ describe('v1.SecurityCenterClient', () => { client.innerApiCalls.listAssets = stubSimpleCall(expectedResponse); const [response] = await client.listAssets(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listAssets as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.listAssets as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listAssets as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listAssets without error using callback', async () => { @@ -4653,15 +4717,11 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.ListAssetsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('ListAssetsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult() @@ -4694,11 +4754,14 @@ describe('v1.SecurityCenterClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listAssets as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.listAssets as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listAssets as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listAssets with error', async () => { @@ -4710,26 +4773,25 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.ListAssetsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('ListAssetsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.listAssets = stubSimpleCall( undefined, expectedError ); await assert.rejects(client.listAssets(request), expectedError); - assert( - (client.innerApiCalls.listAssets as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.listAssets as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listAssets as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listAssetsStream without error', async () => { @@ -4741,8 +4803,11 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.ListAssetsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListAssetsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult() @@ -4782,11 +4847,12 @@ describe('v1.SecurityCenterClient', () => { .getCall(0) .calledWith(client.innerApiCalls.listAssets, request) ); - assert.strictEqual( - (client.descriptors.page.listAssets.createStream as SinonStub).getCall( - 0 - ).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.listAssets.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -4799,8 +4865,11 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.ListAssetsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListAssetsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listAssets.createStream = stubPageStreamingCall( undefined, @@ -4831,11 +4900,12 @@ describe('v1.SecurityCenterClient', () => { .getCall(0) .calledWith(client.innerApiCalls.listAssets, request) ); - assert.strictEqual( - (client.descriptors.page.listAssets.createStream as SinonStub).getCall( - 0 - ).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.listAssets.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -4848,8 +4918,11 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.ListAssetsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListAssetsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult() @@ -4876,11 +4949,12 @@ describe('v1.SecurityCenterClient', () => { ).args[1], request ); - assert.strictEqual( - (client.descriptors.page.listAssets.asyncIterate as SinonStub).getCall( - 0 - ).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.listAssets.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -4893,8 +4967,11 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.ListAssetsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListAssetsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listAssets.asyncIterate = stubAsyncIterationCall( undefined, @@ -4914,11 +4991,12 @@ describe('v1.SecurityCenterClient', () => { ).args[1], request ); - assert.strictEqual( - (client.descriptors.page.listAssets.asyncIterate as SinonStub).getCall( - 0 - ).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.listAssets.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); }); @@ -4933,15 +5011,11 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.ListFindingsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('ListFindingsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult() @@ -4956,11 +5030,14 @@ describe('v1.SecurityCenterClient', () => { client.innerApiCalls.listFindings = stubSimpleCall(expectedResponse); const [response] = await client.listFindings(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listFindings as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.listFindings as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listFindings as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listFindings without error using callback', async () => { @@ -4972,15 +5049,11 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.ListFindingsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('ListFindingsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult() @@ -5013,11 +5086,14 @@ describe('v1.SecurityCenterClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listFindings as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.listFindings as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listFindings as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listFindings with error', async () => { @@ -5029,26 +5105,25 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.ListFindingsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('ListFindingsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.listFindings = stubSimpleCall( undefined, expectedError ); await assert.rejects(client.listFindings(request), expectedError); - assert( - (client.innerApiCalls.listFindings as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.listFindings as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listFindings as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listFindingsStream without error', async () => { @@ -5060,8 +5135,11 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.ListFindingsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListFindingsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult() @@ -5101,11 +5179,12 @@ describe('v1.SecurityCenterClient', () => { .getCall(0) .calledWith(client.innerApiCalls.listFindings, request) ); - assert.strictEqual( - ( - client.descriptors.page.listFindings.createStream as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.listFindings.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -5118,8 +5197,11 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.ListFindingsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListFindingsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listFindings.createStream = stubPageStreamingCall( undefined, @@ -5150,11 +5232,12 @@ describe('v1.SecurityCenterClient', () => { .getCall(0) .calledWith(client.innerApiCalls.listFindings, request) ); - assert.strictEqual( - ( - client.descriptors.page.listFindings.createStream as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.listFindings.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -5167,8 +5250,11 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.ListFindingsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListFindingsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult() @@ -5195,11 +5281,12 @@ describe('v1.SecurityCenterClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( - ( - client.descriptors.page.listFindings.asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.listFindings.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -5212,8 +5299,11 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.ListFindingsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListFindingsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listFindings.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -5231,11 +5321,12 @@ describe('v1.SecurityCenterClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( - ( - client.descriptors.page.listFindings.asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.listFindings.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); }); @@ -5250,15 +5341,11 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.ListMuteConfigsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('ListMuteConfigsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.securitycenter.v1.MuteConfig() @@ -5273,11 +5360,14 @@ describe('v1.SecurityCenterClient', () => { client.innerApiCalls.listMuteConfigs = stubSimpleCall(expectedResponse); const [response] = await client.listMuteConfigs(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listMuteConfigs as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.listMuteConfigs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listMuteConfigs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listMuteConfigs without error using callback', async () => { @@ -5289,15 +5379,11 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.ListMuteConfigsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('ListMuteConfigsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.securitycenter.v1.MuteConfig() @@ -5328,11 +5414,14 @@ describe('v1.SecurityCenterClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listMuteConfigs as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.listMuteConfigs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listMuteConfigs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listMuteConfigs with error', async () => { @@ -5344,26 +5433,25 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.ListMuteConfigsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('ListMuteConfigsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.listMuteConfigs = stubSimpleCall( undefined, expectedError ); await assert.rejects(client.listMuteConfigs(request), expectedError); - assert( - (client.innerApiCalls.listMuteConfigs as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.listMuteConfigs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listMuteConfigs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listMuteConfigsStream without error', async () => { @@ -5375,8 +5463,11 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.ListMuteConfigsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListMuteConfigsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.securitycenter.v1.MuteConfig() @@ -5414,11 +5505,12 @@ describe('v1.SecurityCenterClient', () => { .getCall(0) .calledWith(client.innerApiCalls.listMuteConfigs, request) ); - assert.strictEqual( - ( - client.descriptors.page.listMuteConfigs.createStream as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.listMuteConfigs.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -5431,8 +5523,11 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.ListMuteConfigsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListMuteConfigsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listMuteConfigs.createStream = stubPageStreamingCall(undefined, expectedError); @@ -5459,11 +5554,12 @@ describe('v1.SecurityCenterClient', () => { .getCall(0) .calledWith(client.innerApiCalls.listMuteConfigs, request) ); - assert.strictEqual( - ( - client.descriptors.page.listMuteConfigs.createStream as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.listMuteConfigs.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -5476,8 +5572,11 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.ListMuteConfigsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListMuteConfigsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.securitycenter.v1.MuteConfig() @@ -5503,11 +5602,12 @@ describe('v1.SecurityCenterClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( - ( - client.descriptors.page.listMuteConfigs.asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.listMuteConfigs.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -5520,8 +5620,11 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.ListMuteConfigsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListMuteConfigsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listMuteConfigs.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -5539,11 +5642,12 @@ describe('v1.SecurityCenterClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( - ( - client.descriptors.page.listMuteConfigs.asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.listMuteConfigs.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); }); @@ -5558,15 +5662,12 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.ListNotificationConfigsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'ListNotificationConfigsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.securitycenter.v1.NotificationConfig() @@ -5582,11 +5683,14 @@ describe('v1.SecurityCenterClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.listNotificationConfigs(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listNotificationConfigs as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.listNotificationConfigs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listNotificationConfigs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listNotificationConfigs without error using callback', async () => { @@ -5598,15 +5702,12 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.ListNotificationConfigsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'ListNotificationConfigsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.securitycenter.v1.NotificationConfig() @@ -5639,11 +5740,14 @@ describe('v1.SecurityCenterClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listNotificationConfigs as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.listNotificationConfigs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listNotificationConfigs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listNotificationConfigs with error', async () => { @@ -5655,15 +5759,12 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.ListNotificationConfigsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'ListNotificationConfigsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.listNotificationConfigs = stubSimpleCall( undefined, @@ -5673,11 +5774,14 @@ describe('v1.SecurityCenterClient', () => { client.listNotificationConfigs(request), expectedError ); - assert( - (client.innerApiCalls.listNotificationConfigs as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.listNotificationConfigs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listNotificationConfigs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listNotificationConfigsStream without error', async () => { @@ -5689,8 +5793,12 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.ListNotificationConfigsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue( + 'ListNotificationConfigsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.securitycenter.v1.NotificationConfig() @@ -5733,12 +5841,15 @@ describe('v1.SecurityCenterClient', () => { .getCall(0) .calledWith(client.innerApiCalls.listNotificationConfigs, request) ); - assert.strictEqual( + assert( ( client.descriptors.page.listNotificationConfigs .createStream as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -5751,8 +5862,12 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.ListNotificationConfigsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue( + 'ListNotificationConfigsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listNotificationConfigs.createStream = stubPageStreamingCall(undefined, expectedError); @@ -5784,12 +5899,15 @@ describe('v1.SecurityCenterClient', () => { .getCall(0) .calledWith(client.innerApiCalls.listNotificationConfigs, request) ); - assert.strictEqual( + assert( ( client.descriptors.page.listNotificationConfigs .createStream as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -5802,8 +5920,12 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.ListNotificationConfigsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue( + 'ListNotificationConfigsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.securitycenter.v1.NotificationConfig() @@ -5831,12 +5953,15 @@ describe('v1.SecurityCenterClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( + assert( ( client.descriptors.page.listNotificationConfigs .asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -5849,8 +5974,12 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.ListNotificationConfigsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue( + 'ListNotificationConfigsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listNotificationConfigs.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -5869,12 +5998,15 @@ describe('v1.SecurityCenterClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( + assert( ( client.descriptors.page.listNotificationConfigs .asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); }); @@ -5889,15 +6021,11 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.ListSourcesRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('ListSourcesRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.securitycenter.v1.Source() @@ -5912,11 +6040,14 @@ describe('v1.SecurityCenterClient', () => { client.innerApiCalls.listSources = stubSimpleCall(expectedResponse); const [response] = await client.listSources(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listSources as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.listSources as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listSources as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listSources without error using callback', async () => { @@ -5928,15 +6059,11 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.ListSourcesRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('ListSourcesRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.securitycenter.v1.Source() @@ -5967,11 +6094,14 @@ describe('v1.SecurityCenterClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listSources as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.listSources as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listSources as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listSources with error', async () => { @@ -5983,26 +6113,25 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.ListSourcesRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('ListSourcesRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.listSources = stubSimpleCall( undefined, expectedError ); await assert.rejects(client.listSources(request), expectedError); - assert( - (client.innerApiCalls.listSources as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.listSources as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listSources as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listSourcesStream without error', async () => { @@ -6014,8 +6143,11 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.ListSourcesRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListSourcesRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.securitycenter.v1.Source() @@ -6052,11 +6184,12 @@ describe('v1.SecurityCenterClient', () => { .getCall(0) .calledWith(client.innerApiCalls.listSources, request) ); - assert.strictEqual( - (client.descriptors.page.listSources.createStream as SinonStub).getCall( - 0 - ).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.listSources.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -6069,8 +6202,11 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.ListSourcesRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListSourcesRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listSources.createStream = stubPageStreamingCall( undefined, @@ -6098,11 +6234,12 @@ describe('v1.SecurityCenterClient', () => { .getCall(0) .calledWith(client.innerApiCalls.listSources, request) ); - assert.strictEqual( - (client.descriptors.page.listSources.createStream as SinonStub).getCall( - 0 - ).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.listSources.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -6115,8 +6252,11 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.ListSourcesRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListSourcesRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.securitycenter.v1.Source() @@ -6142,11 +6282,12 @@ describe('v1.SecurityCenterClient', () => { ).args[1], request ); - assert.strictEqual( - (client.descriptors.page.listSources.asyncIterate as SinonStub).getCall( - 0 - ).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.listSources.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -6159,8 +6300,11 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.ListSourcesRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListSourcesRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listSources.asyncIterate = stubAsyncIterationCall( undefined, @@ -6179,11 +6323,12 @@ describe('v1.SecurityCenterClient', () => { ).args[1], request ); - assert.strictEqual( - (client.descriptors.page.listSources.asyncIterate as SinonStub).getCall( - 0 - ).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.listSources.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); }); @@ -6198,15 +6343,11 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.ListBigQueryExportsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('ListBigQueryExportsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.securitycenter.v1.BigQueryExport() @@ -6222,11 +6363,14 @@ describe('v1.SecurityCenterClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.listBigQueryExports(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listBigQueryExports as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.listBigQueryExports as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listBigQueryExports as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listBigQueryExports without error using callback', async () => { @@ -6238,15 +6382,11 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.ListBigQueryExportsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('ListBigQueryExportsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.securitycenter.v1.BigQueryExport() @@ -6279,11 +6419,14 @@ describe('v1.SecurityCenterClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listBigQueryExports as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.listBigQueryExports as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listBigQueryExports as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listBigQueryExports with error', async () => { @@ -6295,26 +6438,25 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.ListBigQueryExportsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('ListBigQueryExportsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.listBigQueryExports = stubSimpleCall( undefined, expectedError ); await assert.rejects(client.listBigQueryExports(request), expectedError); - assert( - (client.innerApiCalls.listBigQueryExports as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.listBigQueryExports as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listBigQueryExports as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listBigQueryExportsStream without error', async () => { @@ -6326,8 +6468,11 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.ListBigQueryExportsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListBigQueryExportsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.securitycenter.v1.BigQueryExport() @@ -6365,11 +6510,12 @@ describe('v1.SecurityCenterClient', () => { .getCall(0) .calledWith(client.innerApiCalls.listBigQueryExports, request) ); - assert.strictEqual( - ( - client.descriptors.page.listBigQueryExports.createStream as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.listBigQueryExports.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -6382,8 +6528,11 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.ListBigQueryExportsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListBigQueryExportsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listBigQueryExports.createStream = stubPageStreamingCall(undefined, expectedError); @@ -6410,11 +6559,12 @@ describe('v1.SecurityCenterClient', () => { .getCall(0) .calledWith(client.innerApiCalls.listBigQueryExports, request) ); - assert.strictEqual( - ( - client.descriptors.page.listBigQueryExports.createStream as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.listBigQueryExports.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -6427,8 +6577,11 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.ListBigQueryExportsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListBigQueryExportsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.securitycenter.v1.BigQueryExport() @@ -6455,11 +6608,12 @@ describe('v1.SecurityCenterClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( - ( - client.descriptors.page.listBigQueryExports.asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.listBigQueryExports.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -6472,8 +6626,11 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.ListBigQueryExportsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListBigQueryExportsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listBigQueryExports.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -6491,11 +6648,12 @@ describe('v1.SecurityCenterClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( - ( - client.descriptors.page.listBigQueryExports.asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.listBigQueryExports.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); }); diff --git a/packages/google-cloud-securitycenter/test/gapic_security_center_v1beta1.ts b/packages/google-cloud-securitycenter/test/gapic_security_center_v1beta1.ts index b06904c70d0..5b733e936ba 100644 --- a/packages/google-cloud-securitycenter/test/gapic_security_center_v1beta1.ts +++ b/packages/google-cloud-securitycenter/test/gapic_security_center_v1beta1.ts @@ -27,6 +27,21 @@ import {PassThrough} from 'stream'; import {protobuf, LROperation, operationsProtos} 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 @@ -254,26 +269,25 @@ describe('v1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1beta1.CreateSourceRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('CreateSourceRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.securitycenter.v1beta1.Source() ); client.innerApiCalls.createSource = stubSimpleCall(expectedResponse); const [response] = await client.createSource(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.createSource as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.createSource as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createSource as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createSource without error using callback', async () => { @@ -285,15 +299,11 @@ describe('v1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1beta1.CreateSourceRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('CreateSourceRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.securitycenter.v1beta1.Source() ); @@ -316,11 +326,14 @@ describe('v1beta1.SecurityCenterClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.createSource as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.createSource as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createSource as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createSource with error', async () => { @@ -332,26 +345,25 @@ describe('v1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1beta1.CreateSourceRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('CreateSourceRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.createSource = stubSimpleCall( undefined, expectedError ); await assert.rejects(client.createSource(request), expectedError); - assert( - (client.innerApiCalls.createSource as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.createSource as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createSource as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createSource with closed client', async () => { @@ -363,7 +375,10 @@ describe('v1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1beta1.CreateSourceRequest() ); - request.parent = ''; + const defaultValue1 = getTypeDefaultValue('CreateSourceRequest', [ + 'parent', + ]); + request.parent = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.createSource(request), expectedError); @@ -380,26 +395,25 @@ describe('v1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1beta1.CreateFindingRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('CreateFindingRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.securitycenter.v1beta1.Finding() ); client.innerApiCalls.createFinding = stubSimpleCall(expectedResponse); const [response] = await client.createFinding(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.createFinding as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.createFinding as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createFinding as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createFinding without error using callback', async () => { @@ -411,15 +425,11 @@ describe('v1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1beta1.CreateFindingRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('CreateFindingRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.securitycenter.v1beta1.Finding() ); @@ -442,11 +452,14 @@ describe('v1beta1.SecurityCenterClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.createFinding as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.createFinding as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createFinding as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createFinding with error', async () => { @@ -458,26 +471,25 @@ describe('v1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1beta1.CreateFindingRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('CreateFindingRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.createFinding = stubSimpleCall( undefined, expectedError ); await assert.rejects(client.createFinding(request), expectedError); - assert( - (client.innerApiCalls.createFinding as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.createFinding as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createFinding as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createFinding with closed client', async () => { @@ -489,7 +501,10 @@ describe('v1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1beta1.CreateFindingRequest() ); - request.parent = ''; + const defaultValue1 = getTypeDefaultValue('CreateFindingRequest', [ + 'parent', + ]); + request.parent = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.createFinding(request), expectedError); @@ -506,26 +521,25 @@ describe('v1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.iam.v1.GetIamPolicyRequest() ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('GetIamPolicyRequest', [ + 'resource', + ]); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.iam.v1.Policy() ); client.innerApiCalls.getIamPolicy = stubSimpleCall(expectedResponse); const [response] = await client.getIamPolicy(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getIamPolicy as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.getIamPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getIamPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getIamPolicy without error using callback', async () => { @@ -537,15 +551,11 @@ describe('v1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.iam.v1.GetIamPolicyRequest() ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('GetIamPolicyRequest', [ + 'resource', + ]); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.iam.v1.Policy() ); @@ -568,11 +578,14 @@ describe('v1beta1.SecurityCenterClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getIamPolicy as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.getIamPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getIamPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getIamPolicy with error', async () => { @@ -584,26 +597,25 @@ describe('v1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.iam.v1.GetIamPolicyRequest() ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('GetIamPolicyRequest', [ + 'resource', + ]); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.getIamPolicy = stubSimpleCall( undefined, expectedError ); await assert.rejects(client.getIamPolicy(request), expectedError); - assert( - (client.innerApiCalls.getIamPolicy as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.getIamPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getIamPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getIamPolicy with closed client', async () => { @@ -615,7 +627,10 @@ describe('v1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.iam.v1.GetIamPolicyRequest() ); - request.resource = ''; + const defaultValue1 = getTypeDefaultValue('GetIamPolicyRequest', [ + 'resource', + ]); + request.resource = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.getIamPolicy(request), expectedError); @@ -632,15 +647,12 @@ describe('v1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'GetOrganizationSettingsRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.securitycenter.v1beta1.OrganizationSettings() ); @@ -648,11 +660,14 @@ describe('v1beta1.SecurityCenterClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.getOrganizationSettings(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getOrganizationSettings as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.getOrganizationSettings as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getOrganizationSettings as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getOrganizationSettings without error using callback', async () => { @@ -664,15 +679,12 @@ describe('v1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'GetOrganizationSettingsRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.securitycenter.v1beta1.OrganizationSettings() ); @@ -695,11 +707,14 @@ describe('v1beta1.SecurityCenterClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getOrganizationSettings as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.getOrganizationSettings as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getOrganizationSettings as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getOrganizationSettings with error', async () => { @@ -711,15 +726,12 @@ describe('v1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'GetOrganizationSettingsRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.getOrganizationSettings = stubSimpleCall( undefined, @@ -729,11 +741,14 @@ describe('v1beta1.SecurityCenterClient', () => { client.getOrganizationSettings(request), expectedError ); - assert( - (client.innerApiCalls.getOrganizationSettings as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.getOrganizationSettings as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getOrganizationSettings as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getOrganizationSettings with closed client', async () => { @@ -745,7 +760,11 @@ describe('v1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest() ); - request.name = ''; + const defaultValue1 = getTypeDefaultValue( + 'GetOrganizationSettingsRequest', + ['name'] + ); + request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects( @@ -765,26 +784,23 @@ describe('v1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1beta1.GetSourceRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('GetSourceRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.securitycenter.v1beta1.Source() ); client.innerApiCalls.getSource = stubSimpleCall(expectedResponse); const [response] = await client.getSource(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getSource as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.getSource as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getSource as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getSource without error using callback', async () => { @@ -796,15 +812,9 @@ describe('v1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1beta1.GetSourceRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('GetSourceRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.securitycenter.v1beta1.Source() ); @@ -827,11 +837,14 @@ describe('v1beta1.SecurityCenterClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getSource as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.getSource as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getSource as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getSource with error', async () => { @@ -843,23 +856,20 @@ describe('v1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1beta1.GetSourceRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('GetSourceRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.getSource = stubSimpleCall(undefined, expectedError); await assert.rejects(client.getSource(request), expectedError); - assert( - (client.innerApiCalls.getSource as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.getSource as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getSource as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getSource with closed client', async () => { @@ -871,7 +881,8 @@ describe('v1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1beta1.GetSourceRequest() ); - request.name = ''; + const defaultValue1 = getTypeDefaultValue('GetSourceRequest', ['name']); + request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.getSource(request), expectedError); @@ -888,26 +899,25 @@ describe('v1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1beta1.SetFindingStateRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('SetFindingStateRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.securitycenter.v1beta1.Finding() ); client.innerApiCalls.setFindingState = stubSimpleCall(expectedResponse); const [response] = await client.setFindingState(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.setFindingState as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.setFindingState as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.setFindingState as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes setFindingState without error using callback', async () => { @@ -919,15 +929,11 @@ describe('v1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1beta1.SetFindingStateRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('SetFindingStateRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.securitycenter.v1beta1.Finding() ); @@ -950,11 +956,14 @@ describe('v1beta1.SecurityCenterClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.setFindingState as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.setFindingState as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.setFindingState as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes setFindingState with error', async () => { @@ -966,26 +975,25 @@ describe('v1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1beta1.SetFindingStateRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('SetFindingStateRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.setFindingState = stubSimpleCall( undefined, expectedError ); await assert.rejects(client.setFindingState(request), expectedError); - assert( - (client.innerApiCalls.setFindingState as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.setFindingState as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.setFindingState as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes setFindingState with closed client', async () => { @@ -997,7 +1005,10 @@ describe('v1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1beta1.SetFindingStateRequest() ); - request.name = ''; + const defaultValue1 = getTypeDefaultValue('SetFindingStateRequest', [ + 'name', + ]); + request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.setFindingState(request), expectedError); @@ -1014,26 +1025,25 @@ describe('v1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.iam.v1.SetIamPolicyRequest() ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('SetIamPolicyRequest', [ + 'resource', + ]); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.iam.v1.Policy() ); client.innerApiCalls.setIamPolicy = stubSimpleCall(expectedResponse); const [response] = await client.setIamPolicy(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.setIamPolicy as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.setIamPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.setIamPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes setIamPolicy without error using callback', async () => { @@ -1045,15 +1055,11 @@ describe('v1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.iam.v1.SetIamPolicyRequest() ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('SetIamPolicyRequest', [ + 'resource', + ]); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.iam.v1.Policy() ); @@ -1076,11 +1082,14 @@ describe('v1beta1.SecurityCenterClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.setIamPolicy as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.setIamPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.setIamPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes setIamPolicy with error', async () => { @@ -1092,26 +1101,25 @@ describe('v1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.iam.v1.SetIamPolicyRequest() ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('SetIamPolicyRequest', [ + 'resource', + ]); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.setIamPolicy = stubSimpleCall( undefined, expectedError ); await assert.rejects(client.setIamPolicy(request), expectedError); - assert( - (client.innerApiCalls.setIamPolicy as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.setIamPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.setIamPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes setIamPolicy with closed client', async () => { @@ -1123,7 +1131,10 @@ describe('v1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.iam.v1.SetIamPolicyRequest() ); - request.resource = ''; + const defaultValue1 = getTypeDefaultValue('SetIamPolicyRequest', [ + 'resource', + ]); + request.resource = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.setIamPolicy(request), expectedError); @@ -1140,15 +1151,11 @@ describe('v1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.iam.v1.TestIamPermissionsRequest() ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('TestIamPermissionsRequest', [ + 'resource', + ]); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.iam.v1.TestIamPermissionsResponse() ); @@ -1156,11 +1163,14 @@ describe('v1beta1.SecurityCenterClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.testIamPermissions(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.testIamPermissions as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.testIamPermissions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.testIamPermissions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes testIamPermissions without error using callback', async () => { @@ -1172,15 +1182,11 @@ describe('v1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.iam.v1.TestIamPermissionsRequest() ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('TestIamPermissionsRequest', [ + 'resource', + ]); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.iam.v1.TestIamPermissionsResponse() ); @@ -1203,11 +1209,14 @@ describe('v1beta1.SecurityCenterClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.testIamPermissions as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.testIamPermissions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.testIamPermissions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes testIamPermissions with error', async () => { @@ -1219,26 +1228,25 @@ describe('v1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.iam.v1.TestIamPermissionsRequest() ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('TestIamPermissionsRequest', [ + 'resource', + ]); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.testIamPermissions = stubSimpleCall( undefined, expectedError ); await assert.rejects(client.testIamPermissions(request), expectedError); - assert( - (client.innerApiCalls.testIamPermissions as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.testIamPermissions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.testIamPermissions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes testIamPermissions with closed client', async () => { @@ -1250,7 +1258,10 @@ describe('v1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.iam.v1.TestIamPermissionsRequest() ); - request.resource = ''; + const defaultValue1 = getTypeDefaultValue('TestIamPermissionsRequest', [ + 'resource', + ]); + request.resource = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.testIamPermissions(request), expectedError); @@ -1267,27 +1278,27 @@ describe('v1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1beta1.UpdateFindingRequest() ); - request.finding = {}; - request.finding.name = ''; - const expectedHeaderRequestParams = 'finding.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.finding ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateFindingRequest', [ + 'finding', + 'name', + ]); + request.finding.name = defaultValue1; + const expectedHeaderRequestParams = `finding.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.securitycenter.v1beta1.Finding() ); client.innerApiCalls.updateFinding = stubSimpleCall(expectedResponse); const [response] = await client.updateFinding(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.updateFinding as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.updateFinding as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateFinding as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateFinding without error using callback', async () => { @@ -1299,16 +1310,13 @@ describe('v1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1beta1.UpdateFindingRequest() ); - request.finding = {}; - request.finding.name = ''; - const expectedHeaderRequestParams = 'finding.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.finding ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateFindingRequest', [ + 'finding', + 'name', + ]); + request.finding.name = defaultValue1; + const expectedHeaderRequestParams = `finding.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.securitycenter.v1beta1.Finding() ); @@ -1331,11 +1339,14 @@ describe('v1beta1.SecurityCenterClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.updateFinding as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.updateFinding as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateFinding as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateFinding with error', async () => { @@ -1347,27 +1358,27 @@ describe('v1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1beta1.UpdateFindingRequest() ); - request.finding = {}; - request.finding.name = ''; - const expectedHeaderRequestParams = 'finding.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.finding ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateFindingRequest', [ + 'finding', + 'name', + ]); + request.finding.name = defaultValue1; + const expectedHeaderRequestParams = `finding.name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.updateFinding = stubSimpleCall( undefined, expectedError ); await assert.rejects(client.updateFinding(request), expectedError); - assert( - (client.innerApiCalls.updateFinding as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.updateFinding as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateFinding as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateFinding with closed client', async () => { @@ -1379,8 +1390,12 @@ describe('v1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1beta1.UpdateFindingRequest() ); - request.finding = {}; - request.finding.name = ''; + request.finding ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateFindingRequest', [ + 'finding', + 'name', + ]); + request.finding.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.updateFinding(request), expectedError); @@ -1397,16 +1412,13 @@ describe('v1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest() ); - request.organizationSettings = {}; - request.organizationSettings.name = ''; - const expectedHeaderRequestParams = 'organization_settings.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.organizationSettings ??= {}; + const defaultValue1 = getTypeDefaultValue( + 'UpdateOrganizationSettingsRequest', + ['organizationSettings', 'name'] + ); + request.organizationSettings.name = defaultValue1; + const expectedHeaderRequestParams = `organization_settings.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.securitycenter.v1beta1.OrganizationSettings() ); @@ -1414,11 +1426,14 @@ describe('v1beta1.SecurityCenterClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.updateOrganizationSettings(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.updateOrganizationSettings as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.updateOrganizationSettings as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateOrganizationSettings as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateOrganizationSettings without error using callback', async () => { @@ -1430,16 +1445,13 @@ describe('v1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest() ); - request.organizationSettings = {}; - request.organizationSettings.name = ''; - const expectedHeaderRequestParams = 'organization_settings.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.organizationSettings ??= {}; + const defaultValue1 = getTypeDefaultValue( + 'UpdateOrganizationSettingsRequest', + ['organizationSettings', 'name'] + ); + request.organizationSettings.name = defaultValue1; + const expectedHeaderRequestParams = `organization_settings.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.securitycenter.v1beta1.OrganizationSettings() ); @@ -1462,11 +1474,14 @@ describe('v1beta1.SecurityCenterClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.updateOrganizationSettings as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.updateOrganizationSettings as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateOrganizationSettings as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateOrganizationSettings with error', async () => { @@ -1478,16 +1493,13 @@ describe('v1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest() ); - request.organizationSettings = {}; - request.organizationSettings.name = ''; - const expectedHeaderRequestParams = 'organization_settings.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.organizationSettings ??= {}; + const defaultValue1 = getTypeDefaultValue( + 'UpdateOrganizationSettingsRequest', + ['organizationSettings', 'name'] + ); + request.organizationSettings.name = defaultValue1; + const expectedHeaderRequestParams = `organization_settings.name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.updateOrganizationSettings = stubSimpleCall( undefined, @@ -1497,11 +1509,14 @@ describe('v1beta1.SecurityCenterClient', () => { client.updateOrganizationSettings(request), expectedError ); - assert( - (client.innerApiCalls.updateOrganizationSettings as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.updateOrganizationSettings as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateOrganizationSettings as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateOrganizationSettings with closed client', async () => { @@ -1513,8 +1528,12 @@ describe('v1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest() ); - request.organizationSettings = {}; - request.organizationSettings.name = ''; + request.organizationSettings ??= {}; + const defaultValue1 = getTypeDefaultValue( + 'UpdateOrganizationSettingsRequest', + ['organizationSettings', 'name'] + ); + request.organizationSettings.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects( @@ -1534,27 +1553,27 @@ describe('v1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1beta1.UpdateSourceRequest() ); - request.source = {}; - request.source.name = ''; - const expectedHeaderRequestParams = 'source.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.source ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateSourceRequest', [ + 'source', + 'name', + ]); + request.source.name = defaultValue1; + const expectedHeaderRequestParams = `source.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.securitycenter.v1beta1.Source() ); client.innerApiCalls.updateSource = stubSimpleCall(expectedResponse); const [response] = await client.updateSource(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.updateSource as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.updateSource as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateSource as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateSource without error using callback', async () => { @@ -1566,16 +1585,13 @@ describe('v1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1beta1.UpdateSourceRequest() ); - request.source = {}; - request.source.name = ''; - const expectedHeaderRequestParams = 'source.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.source ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateSourceRequest', [ + 'source', + 'name', + ]); + request.source.name = defaultValue1; + const expectedHeaderRequestParams = `source.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.securitycenter.v1beta1.Source() ); @@ -1598,11 +1614,14 @@ describe('v1beta1.SecurityCenterClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.updateSource as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.updateSource as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateSource as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateSource with error', async () => { @@ -1614,27 +1633,27 @@ describe('v1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1beta1.UpdateSourceRequest() ); - request.source = {}; - request.source.name = ''; - const expectedHeaderRequestParams = 'source.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.source ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateSourceRequest', [ + 'source', + 'name', + ]); + request.source.name = defaultValue1; + const expectedHeaderRequestParams = `source.name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.updateSource = stubSimpleCall( undefined, expectedError ); await assert.rejects(client.updateSource(request), expectedError); - assert( - (client.innerApiCalls.updateSource as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.updateSource as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateSource as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateSource with closed client', async () => { @@ -1646,8 +1665,12 @@ describe('v1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1beta1.UpdateSourceRequest() ); - request.source = {}; - request.source.name = ''; + request.source ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateSourceRequest', [ + 'source', + 'name', + ]); + request.source.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.updateSource(request), expectedError); @@ -1664,16 +1687,13 @@ describe('v1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest() ); - request.securityMarks = {}; - request.securityMarks.name = ''; - const expectedHeaderRequestParams = 'security_marks.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.securityMarks ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateSecurityMarksRequest', [ + 'securityMarks', + 'name', + ]); + request.securityMarks.name = defaultValue1; + const expectedHeaderRequestParams = `security_marks.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.securitycenter.v1beta1.SecurityMarks() ); @@ -1681,11 +1701,14 @@ describe('v1beta1.SecurityCenterClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.updateSecurityMarks(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.updateSecurityMarks as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.updateSecurityMarks as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateSecurityMarks as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateSecurityMarks without error using callback', async () => { @@ -1697,16 +1720,13 @@ describe('v1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest() ); - request.securityMarks = {}; - request.securityMarks.name = ''; - const expectedHeaderRequestParams = 'security_marks.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.securityMarks ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateSecurityMarksRequest', [ + 'securityMarks', + 'name', + ]); + request.securityMarks.name = defaultValue1; + const expectedHeaderRequestParams = `security_marks.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.securitycenter.v1beta1.SecurityMarks() ); @@ -1729,11 +1749,14 @@ describe('v1beta1.SecurityCenterClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.updateSecurityMarks as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.updateSecurityMarks as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateSecurityMarks as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateSecurityMarks with error', async () => { @@ -1745,27 +1768,27 @@ describe('v1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest() ); - request.securityMarks = {}; - request.securityMarks.name = ''; - const expectedHeaderRequestParams = 'security_marks.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.securityMarks ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateSecurityMarksRequest', [ + 'securityMarks', + 'name', + ]); + request.securityMarks.name = defaultValue1; + const expectedHeaderRequestParams = `security_marks.name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.updateSecurityMarks = stubSimpleCall( undefined, expectedError ); await assert.rejects(client.updateSecurityMarks(request), expectedError); - assert( - (client.innerApiCalls.updateSecurityMarks as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.updateSecurityMarks as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateSecurityMarks as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateSecurityMarks with closed client', async () => { @@ -1777,8 +1800,12 @@ describe('v1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest() ); - request.securityMarks = {}; - request.securityMarks.name = ''; + request.securityMarks ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateSecurityMarksRequest', [ + 'securityMarks', + 'name', + ]); + request.securityMarks.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.updateSecurityMarks(request), expectedError); @@ -1795,15 +1822,11 @@ describe('v1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('RunAssetDiscoveryRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1812,11 +1835,14 @@ describe('v1beta1.SecurityCenterClient', () => { const [operation] = await client.runAssetDiscovery(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.runAssetDiscovery as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.runAssetDiscovery as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.runAssetDiscovery as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes runAssetDiscovery without error using callback', async () => { @@ -1828,15 +1854,11 @@ describe('v1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('RunAssetDiscoveryRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1866,11 +1888,14 @@ describe('v1beta1.SecurityCenterClient', () => { >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.runAssetDiscovery as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.runAssetDiscovery as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.runAssetDiscovery as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes runAssetDiscovery with call error', async () => { @@ -1882,26 +1907,25 @@ describe('v1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('RunAssetDiscoveryRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.runAssetDiscovery = stubLongRunningCall( undefined, expectedError ); await assert.rejects(client.runAssetDiscovery(request), expectedError); - assert( - (client.innerApiCalls.runAssetDiscovery as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.runAssetDiscovery as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.runAssetDiscovery as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes runAssetDiscovery with LRO error', async () => { @@ -1913,15 +1937,11 @@ describe('v1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('RunAssetDiscoveryRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.runAssetDiscovery = stubLongRunningCall( undefined, @@ -1930,11 +1950,14 @@ describe('v1beta1.SecurityCenterClient', () => { ); const [operation] = await client.runAssetDiscovery(request); await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.runAssetDiscovery as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.runAssetDiscovery as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.runAssetDiscovery as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes checkRunAssetDiscoveryProgress without error', async () => { @@ -1989,15 +2012,11 @@ describe('v1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1beta1.GroupAssetsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('GroupAssetsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.securitycenter.v1beta1.GroupResult() @@ -2012,11 +2031,14 @@ describe('v1beta1.SecurityCenterClient', () => { client.innerApiCalls.groupAssets = stubSimpleCall(expectedResponse); const [response] = await client.groupAssets(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.groupAssets as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.groupAssets as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.groupAssets as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes groupAssets without error using callback', async () => { @@ -2028,15 +2050,11 @@ describe('v1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1beta1.GroupAssetsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('GroupAssetsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.securitycenter.v1beta1.GroupResult() @@ -2069,11 +2087,14 @@ describe('v1beta1.SecurityCenterClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.groupAssets as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.groupAssets as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.groupAssets as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes groupAssets with error', async () => { @@ -2085,26 +2106,25 @@ describe('v1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1beta1.GroupAssetsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('GroupAssetsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.groupAssets = stubSimpleCall( undefined, expectedError ); await assert.rejects(client.groupAssets(request), expectedError); - assert( - (client.innerApiCalls.groupAssets as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.groupAssets as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.groupAssets as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes groupAssetsStream without error', async () => { @@ -2116,8 +2136,11 @@ describe('v1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1beta1.GroupAssetsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('GroupAssetsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.securitycenter.v1beta1.GroupResult() @@ -2157,11 +2180,12 @@ describe('v1beta1.SecurityCenterClient', () => { .getCall(0) .calledWith(client.innerApiCalls.groupAssets, request) ); - assert.strictEqual( - (client.descriptors.page.groupAssets.createStream as SinonStub).getCall( - 0 - ).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.groupAssets.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -2174,8 +2198,11 @@ describe('v1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1beta1.GroupAssetsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('GroupAssetsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.groupAssets.createStream = stubPageStreamingCall( undefined, @@ -2206,11 +2233,12 @@ describe('v1beta1.SecurityCenterClient', () => { .getCall(0) .calledWith(client.innerApiCalls.groupAssets, request) ); - assert.strictEqual( - (client.descriptors.page.groupAssets.createStream as SinonStub).getCall( - 0 - ).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.groupAssets.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -2223,8 +2251,11 @@ describe('v1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1beta1.GroupAssetsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('GroupAssetsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.securitycenter.v1beta1.GroupResult() @@ -2251,11 +2282,12 @@ describe('v1beta1.SecurityCenterClient', () => { ).args[1], request ); - assert.strictEqual( - (client.descriptors.page.groupAssets.asyncIterate as SinonStub).getCall( - 0 - ).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.groupAssets.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -2268,8 +2300,11 @@ describe('v1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1beta1.GroupAssetsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('GroupAssetsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.groupAssets.asyncIterate = stubAsyncIterationCall( undefined, @@ -2289,11 +2324,12 @@ describe('v1beta1.SecurityCenterClient', () => { ).args[1], request ); - assert.strictEqual( - (client.descriptors.page.groupAssets.asyncIterate as SinonStub).getCall( - 0 - ).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.groupAssets.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); }); @@ -2308,15 +2344,11 @@ describe('v1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1beta1.GroupFindingsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('GroupFindingsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.securitycenter.v1beta1.GroupResult() @@ -2331,11 +2363,14 @@ describe('v1beta1.SecurityCenterClient', () => { client.innerApiCalls.groupFindings = stubSimpleCall(expectedResponse); const [response] = await client.groupFindings(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.groupFindings as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.groupFindings as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.groupFindings as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes groupFindings without error using callback', async () => { @@ -2347,15 +2382,11 @@ describe('v1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1beta1.GroupFindingsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('GroupFindingsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.securitycenter.v1beta1.GroupResult() @@ -2388,11 +2419,14 @@ describe('v1beta1.SecurityCenterClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.groupFindings as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.groupFindings as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.groupFindings as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes groupFindings with error', async () => { @@ -2404,26 +2438,25 @@ describe('v1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1beta1.GroupFindingsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('GroupFindingsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.groupFindings = stubSimpleCall( undefined, expectedError ); await assert.rejects(client.groupFindings(request), expectedError); - assert( - (client.innerApiCalls.groupFindings as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.groupFindings as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.groupFindings as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes groupFindingsStream without error', async () => { @@ -2435,8 +2468,11 @@ describe('v1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1beta1.GroupFindingsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('GroupFindingsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.securitycenter.v1beta1.GroupResult() @@ -2476,11 +2512,12 @@ describe('v1beta1.SecurityCenterClient', () => { .getCall(0) .calledWith(client.innerApiCalls.groupFindings, request) ); - assert.strictEqual( - ( - client.descriptors.page.groupFindings.createStream as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.groupFindings.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -2493,8 +2530,11 @@ describe('v1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1beta1.GroupFindingsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('GroupFindingsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.groupFindings.createStream = stubPageStreamingCall(undefined, expectedError); @@ -2523,11 +2563,12 @@ describe('v1beta1.SecurityCenterClient', () => { .getCall(0) .calledWith(client.innerApiCalls.groupFindings, request) ); - assert.strictEqual( - ( - client.descriptors.page.groupFindings.createStream as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.groupFindings.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -2540,8 +2581,11 @@ describe('v1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1beta1.GroupFindingsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('GroupFindingsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.securitycenter.v1beta1.GroupResult() @@ -2568,11 +2612,12 @@ describe('v1beta1.SecurityCenterClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( - ( - client.descriptors.page.groupFindings.asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.groupFindings.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -2585,8 +2630,11 @@ describe('v1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1beta1.GroupFindingsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('GroupFindingsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.groupFindings.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -2604,11 +2652,12 @@ describe('v1beta1.SecurityCenterClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( - ( - client.descriptors.page.groupFindings.asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.groupFindings.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); }); @@ -2623,15 +2672,11 @@ describe('v1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1beta1.ListAssetsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('ListAssetsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult() @@ -2646,11 +2691,14 @@ describe('v1beta1.SecurityCenterClient', () => { client.innerApiCalls.listAssets = stubSimpleCall(expectedResponse); const [response] = await client.listAssets(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listAssets as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.listAssets as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listAssets as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listAssets without error using callback', async () => { @@ -2662,15 +2710,11 @@ describe('v1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1beta1.ListAssetsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('ListAssetsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult() @@ -2703,11 +2747,14 @@ describe('v1beta1.SecurityCenterClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listAssets as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.listAssets as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listAssets as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listAssets with error', async () => { @@ -2719,26 +2766,25 @@ describe('v1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1beta1.ListAssetsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('ListAssetsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.listAssets = stubSimpleCall( undefined, expectedError ); await assert.rejects(client.listAssets(request), expectedError); - assert( - (client.innerApiCalls.listAssets as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.listAssets as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listAssets as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listAssetsStream without error', async () => { @@ -2750,8 +2796,11 @@ describe('v1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1beta1.ListAssetsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListAssetsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult() @@ -2791,11 +2840,12 @@ describe('v1beta1.SecurityCenterClient', () => { .getCall(0) .calledWith(client.innerApiCalls.listAssets, request) ); - assert.strictEqual( - (client.descriptors.page.listAssets.createStream as SinonStub).getCall( - 0 - ).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.listAssets.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -2808,8 +2858,11 @@ describe('v1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1beta1.ListAssetsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListAssetsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listAssets.createStream = stubPageStreamingCall( undefined, @@ -2840,11 +2893,12 @@ describe('v1beta1.SecurityCenterClient', () => { .getCall(0) .calledWith(client.innerApiCalls.listAssets, request) ); - assert.strictEqual( - (client.descriptors.page.listAssets.createStream as SinonStub).getCall( - 0 - ).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.listAssets.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -2857,8 +2911,11 @@ describe('v1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1beta1.ListAssetsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListAssetsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult() @@ -2885,11 +2942,12 @@ describe('v1beta1.SecurityCenterClient', () => { ).args[1], request ); - assert.strictEqual( - (client.descriptors.page.listAssets.asyncIterate as SinonStub).getCall( - 0 - ).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.listAssets.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -2902,8 +2960,11 @@ describe('v1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1beta1.ListAssetsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListAssetsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listAssets.asyncIterate = stubAsyncIterationCall( undefined, @@ -2923,11 +2984,12 @@ describe('v1beta1.SecurityCenterClient', () => { ).args[1], request ); - assert.strictEqual( - (client.descriptors.page.listAssets.asyncIterate as SinonStub).getCall( - 0 - ).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.listAssets.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); }); @@ -2942,15 +3004,11 @@ describe('v1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1beta1.ListFindingsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('ListFindingsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.securitycenter.v1beta1.Finding() @@ -2965,11 +3023,14 @@ describe('v1beta1.SecurityCenterClient', () => { client.innerApiCalls.listFindings = stubSimpleCall(expectedResponse); const [response] = await client.listFindings(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listFindings as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.listFindings as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listFindings as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listFindings without error using callback', async () => { @@ -2981,15 +3042,11 @@ describe('v1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1beta1.ListFindingsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('ListFindingsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.securitycenter.v1beta1.Finding() @@ -3022,11 +3079,14 @@ describe('v1beta1.SecurityCenterClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listFindings as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.listFindings as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listFindings as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listFindings with error', async () => { @@ -3038,26 +3098,25 @@ describe('v1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1beta1.ListFindingsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('ListFindingsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.listFindings = stubSimpleCall( undefined, expectedError ); await assert.rejects(client.listFindings(request), expectedError); - assert( - (client.innerApiCalls.listFindings as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.listFindings as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listFindings as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listFindingsStream without error', async () => { @@ -3069,8 +3128,11 @@ describe('v1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1beta1.ListFindingsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListFindingsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.securitycenter.v1beta1.Finding() @@ -3108,11 +3170,12 @@ describe('v1beta1.SecurityCenterClient', () => { .getCall(0) .calledWith(client.innerApiCalls.listFindings, request) ); - assert.strictEqual( - ( - client.descriptors.page.listFindings.createStream as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.listFindings.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -3125,8 +3188,11 @@ describe('v1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1beta1.ListFindingsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListFindingsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listFindings.createStream = stubPageStreamingCall( undefined, @@ -3155,11 +3221,12 @@ describe('v1beta1.SecurityCenterClient', () => { .getCall(0) .calledWith(client.innerApiCalls.listFindings, request) ); - assert.strictEqual( - ( - client.descriptors.page.listFindings.createStream as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.listFindings.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -3172,8 +3239,11 @@ describe('v1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1beta1.ListFindingsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListFindingsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.securitycenter.v1beta1.Finding() @@ -3200,11 +3270,12 @@ describe('v1beta1.SecurityCenterClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( - ( - client.descriptors.page.listFindings.asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.listFindings.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -3217,8 +3288,11 @@ describe('v1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1beta1.ListFindingsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListFindingsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listFindings.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -3236,11 +3310,12 @@ describe('v1beta1.SecurityCenterClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( - ( - client.descriptors.page.listFindings.asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.listFindings.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); }); @@ -3255,15 +3330,11 @@ describe('v1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1beta1.ListSourcesRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('ListSourcesRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.securitycenter.v1beta1.Source() @@ -3278,11 +3349,14 @@ describe('v1beta1.SecurityCenterClient', () => { client.innerApiCalls.listSources = stubSimpleCall(expectedResponse); const [response] = await client.listSources(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listSources as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.listSources as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listSources as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listSources without error using callback', async () => { @@ -3294,15 +3368,11 @@ describe('v1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1beta1.ListSourcesRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('ListSourcesRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.securitycenter.v1beta1.Source() @@ -3333,11 +3403,14 @@ describe('v1beta1.SecurityCenterClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listSources as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.listSources as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listSources as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listSources with error', async () => { @@ -3349,26 +3422,25 @@ describe('v1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1beta1.ListSourcesRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('ListSourcesRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.listSources = stubSimpleCall( undefined, expectedError ); await assert.rejects(client.listSources(request), expectedError); - assert( - (client.innerApiCalls.listSources as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.listSources as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listSources as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listSourcesStream without error', async () => { @@ -3380,8 +3452,11 @@ describe('v1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1beta1.ListSourcesRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListSourcesRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.securitycenter.v1beta1.Source() @@ -3419,11 +3494,12 @@ describe('v1beta1.SecurityCenterClient', () => { .getCall(0) .calledWith(client.innerApiCalls.listSources, request) ); - assert.strictEqual( - (client.descriptors.page.listSources.createStream as SinonStub).getCall( - 0 - ).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.listSources.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -3436,8 +3512,11 @@ describe('v1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1beta1.ListSourcesRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListSourcesRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listSources.createStream = stubPageStreamingCall( undefined, @@ -3466,11 +3545,12 @@ describe('v1beta1.SecurityCenterClient', () => { .getCall(0) .calledWith(client.innerApiCalls.listSources, request) ); - assert.strictEqual( - (client.descriptors.page.listSources.createStream as SinonStub).getCall( - 0 - ).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.listSources.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -3483,8 +3563,11 @@ describe('v1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1beta1.ListSourcesRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListSourcesRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.securitycenter.v1beta1.Source() @@ -3511,11 +3594,12 @@ describe('v1beta1.SecurityCenterClient', () => { ).args[1], request ); - assert.strictEqual( - (client.descriptors.page.listSources.asyncIterate as SinonStub).getCall( - 0 - ).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.listSources.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -3528,8 +3612,11 @@ describe('v1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1beta1.ListSourcesRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListSourcesRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listSources.asyncIterate = stubAsyncIterationCall( undefined, @@ -3549,11 +3636,12 @@ describe('v1beta1.SecurityCenterClient', () => { ).args[1], request ); - assert.strictEqual( - (client.descriptors.page.listSources.asyncIterate as SinonStub).getCall( - 0 - ).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.listSources.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); }); diff --git a/packages/google-cloud-securitycenter/test/gapic_security_center_v1p1beta1.ts b/packages/google-cloud-securitycenter/test/gapic_security_center_v1p1beta1.ts index 3b2c1ee4407..4ad7e2a5290 100644 --- a/packages/google-cloud-securitycenter/test/gapic_security_center_v1p1beta1.ts +++ b/packages/google-cloud-securitycenter/test/gapic_security_center_v1p1beta1.ts @@ -27,6 +27,21 @@ import {PassThrough} from 'stream'; import {protobuf, LROperation, operationsProtos} 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 @@ -254,26 +269,25 @@ describe('v1p1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.CreateSourceRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('CreateSourceRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.Source() ); client.innerApiCalls.createSource = stubSimpleCall(expectedResponse); const [response] = await client.createSource(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.createSource as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.createSource as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createSource as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createSource without error using callback', async () => { @@ -285,15 +299,11 @@ describe('v1p1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.CreateSourceRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('CreateSourceRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.Source() ); @@ -316,11 +326,14 @@ describe('v1p1beta1.SecurityCenterClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.createSource as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.createSource as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createSource as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createSource with error', async () => { @@ -332,26 +345,25 @@ describe('v1p1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.CreateSourceRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('CreateSourceRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.createSource = stubSimpleCall( undefined, expectedError ); await assert.rejects(client.createSource(request), expectedError); - assert( - (client.innerApiCalls.createSource as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.createSource as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createSource as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createSource with closed client', async () => { @@ -363,7 +375,10 @@ describe('v1p1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.CreateSourceRequest() ); - request.parent = ''; + const defaultValue1 = getTypeDefaultValue('CreateSourceRequest', [ + 'parent', + ]); + request.parent = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.createSource(request), expectedError); @@ -380,26 +395,25 @@ describe('v1p1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.CreateFindingRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('CreateFindingRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.Finding() ); client.innerApiCalls.createFinding = stubSimpleCall(expectedResponse); const [response] = await client.createFinding(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.createFinding as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.createFinding as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createFinding as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createFinding without error using callback', async () => { @@ -411,15 +425,11 @@ describe('v1p1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.CreateFindingRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('CreateFindingRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.Finding() ); @@ -442,11 +452,14 @@ describe('v1p1beta1.SecurityCenterClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.createFinding as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.createFinding as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createFinding as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createFinding with error', async () => { @@ -458,26 +471,25 @@ describe('v1p1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.CreateFindingRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('CreateFindingRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.createFinding = stubSimpleCall( undefined, expectedError ); await assert.rejects(client.createFinding(request), expectedError); - assert( - (client.innerApiCalls.createFinding as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.createFinding as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createFinding as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createFinding with closed client', async () => { @@ -489,7 +501,10 @@ describe('v1p1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.CreateFindingRequest() ); - request.parent = ''; + const defaultValue1 = getTypeDefaultValue('CreateFindingRequest', [ + 'parent', + ]); + request.parent = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.createFinding(request), expectedError); @@ -506,15 +521,12 @@ describe('v1p1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.CreateNotificationConfigRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'CreateNotificationConfigRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.NotificationConfig() ); @@ -522,11 +534,14 @@ describe('v1p1beta1.SecurityCenterClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.createNotificationConfig(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.createNotificationConfig as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.createNotificationConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createNotificationConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createNotificationConfig without error using callback', async () => { @@ -538,15 +553,12 @@ describe('v1p1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.CreateNotificationConfigRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'CreateNotificationConfigRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.NotificationConfig() ); @@ -569,11 +581,14 @@ describe('v1p1beta1.SecurityCenterClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.createNotificationConfig as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.createNotificationConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createNotificationConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createNotificationConfig with error', async () => { @@ -585,15 +600,12 @@ describe('v1p1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.CreateNotificationConfigRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'CreateNotificationConfigRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.createNotificationConfig = stubSimpleCall( undefined, @@ -603,11 +615,14 @@ describe('v1p1beta1.SecurityCenterClient', () => { client.createNotificationConfig(request), expectedError ); - assert( - (client.innerApiCalls.createNotificationConfig as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.createNotificationConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createNotificationConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createNotificationConfig with closed client', async () => { @@ -619,7 +634,11 @@ describe('v1p1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.CreateNotificationConfigRequest() ); - request.parent = ''; + const defaultValue1 = getTypeDefaultValue( + 'CreateNotificationConfigRequest', + ['parent'] + ); + request.parent = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects( @@ -639,15 +658,12 @@ describe('v1p1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.DeleteNotificationConfigRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'DeleteNotificationConfigRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -655,11 +671,14 @@ describe('v1p1beta1.SecurityCenterClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.deleteNotificationConfig(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.deleteNotificationConfig as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.deleteNotificationConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteNotificationConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteNotificationConfig without error using callback', async () => { @@ -671,15 +690,12 @@ describe('v1p1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.DeleteNotificationConfigRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'DeleteNotificationConfigRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -702,11 +718,14 @@ describe('v1p1beta1.SecurityCenterClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.deleteNotificationConfig as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.deleteNotificationConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteNotificationConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteNotificationConfig with error', async () => { @@ -718,15 +737,12 @@ describe('v1p1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.DeleteNotificationConfigRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'DeleteNotificationConfigRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteNotificationConfig = stubSimpleCall( undefined, @@ -736,11 +752,14 @@ describe('v1p1beta1.SecurityCenterClient', () => { client.deleteNotificationConfig(request), expectedError ); - assert( - (client.innerApiCalls.deleteNotificationConfig as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.deleteNotificationConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteNotificationConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteNotificationConfig with closed client', async () => { @@ -752,7 +771,11 @@ describe('v1p1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.DeleteNotificationConfigRequest() ); - request.name = ''; + const defaultValue1 = getTypeDefaultValue( + 'DeleteNotificationConfigRequest', + ['name'] + ); + request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects( @@ -772,26 +795,25 @@ describe('v1p1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.iam.v1.GetIamPolicyRequest() ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('GetIamPolicyRequest', [ + 'resource', + ]); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.iam.v1.Policy() ); client.innerApiCalls.getIamPolicy = stubSimpleCall(expectedResponse); const [response] = await client.getIamPolicy(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getIamPolicy as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.getIamPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getIamPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getIamPolicy without error using callback', async () => { @@ -803,15 +825,11 @@ describe('v1p1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.iam.v1.GetIamPolicyRequest() ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('GetIamPolicyRequest', [ + 'resource', + ]); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.iam.v1.Policy() ); @@ -834,11 +852,14 @@ describe('v1p1beta1.SecurityCenterClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getIamPolicy as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.getIamPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getIamPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getIamPolicy with error', async () => { @@ -850,26 +871,25 @@ describe('v1p1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.iam.v1.GetIamPolicyRequest() ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('GetIamPolicyRequest', [ + 'resource', + ]); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.getIamPolicy = stubSimpleCall( undefined, expectedError ); await assert.rejects(client.getIamPolicy(request), expectedError); - assert( - (client.innerApiCalls.getIamPolicy as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.getIamPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getIamPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getIamPolicy with closed client', async () => { @@ -881,7 +901,10 @@ describe('v1p1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.iam.v1.GetIamPolicyRequest() ); - request.resource = ''; + const defaultValue1 = getTypeDefaultValue('GetIamPolicyRequest', [ + 'resource', + ]); + request.resource = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.getIamPolicy(request), expectedError); @@ -898,15 +921,12 @@ describe('v1p1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.GetNotificationConfigRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'GetNotificationConfigRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.NotificationConfig() ); @@ -914,11 +934,14 @@ describe('v1p1beta1.SecurityCenterClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.getNotificationConfig(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getNotificationConfig as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.getNotificationConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getNotificationConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getNotificationConfig without error using callback', async () => { @@ -930,15 +953,12 @@ describe('v1p1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.GetNotificationConfigRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'GetNotificationConfigRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.NotificationConfig() ); @@ -961,11 +981,14 @@ describe('v1p1beta1.SecurityCenterClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getNotificationConfig as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.getNotificationConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getNotificationConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getNotificationConfig with error', async () => { @@ -977,15 +1000,12 @@ describe('v1p1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.GetNotificationConfigRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'GetNotificationConfigRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.getNotificationConfig = stubSimpleCall( undefined, @@ -995,11 +1015,14 @@ describe('v1p1beta1.SecurityCenterClient', () => { client.getNotificationConfig(request), expectedError ); - assert( - (client.innerApiCalls.getNotificationConfig as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.getNotificationConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getNotificationConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getNotificationConfig with closed client', async () => { @@ -1011,7 +1034,11 @@ describe('v1p1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.GetNotificationConfigRequest() ); - request.name = ''; + const defaultValue1 = getTypeDefaultValue( + 'GetNotificationConfigRequest', + ['name'] + ); + request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects( @@ -1031,15 +1058,12 @@ describe('v1p1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.GetOrganizationSettingsRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'GetOrganizationSettingsRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.OrganizationSettings() ); @@ -1047,11 +1071,14 @@ describe('v1p1beta1.SecurityCenterClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.getOrganizationSettings(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getOrganizationSettings as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.getOrganizationSettings as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getOrganizationSettings as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getOrganizationSettings without error using callback', async () => { @@ -1063,15 +1090,12 @@ describe('v1p1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.GetOrganizationSettingsRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'GetOrganizationSettingsRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.OrganizationSettings() ); @@ -1094,11 +1118,14 @@ describe('v1p1beta1.SecurityCenterClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getOrganizationSettings as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.getOrganizationSettings as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getOrganizationSettings as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getOrganizationSettings with error', async () => { @@ -1110,15 +1137,12 @@ describe('v1p1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.GetOrganizationSettingsRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'GetOrganizationSettingsRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.getOrganizationSettings = stubSimpleCall( undefined, @@ -1128,11 +1152,14 @@ describe('v1p1beta1.SecurityCenterClient', () => { client.getOrganizationSettings(request), expectedError ); - assert( - (client.innerApiCalls.getOrganizationSettings as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.getOrganizationSettings as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getOrganizationSettings as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getOrganizationSettings with closed client', async () => { @@ -1144,7 +1171,11 @@ describe('v1p1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.GetOrganizationSettingsRequest() ); - request.name = ''; + const defaultValue1 = getTypeDefaultValue( + 'GetOrganizationSettingsRequest', + ['name'] + ); + request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects( @@ -1164,26 +1195,23 @@ describe('v1p1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.GetSourceRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('GetSourceRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.Source() ); client.innerApiCalls.getSource = stubSimpleCall(expectedResponse); const [response] = await client.getSource(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getSource as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.getSource as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getSource as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getSource without error using callback', async () => { @@ -1195,15 +1223,9 @@ describe('v1p1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.GetSourceRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('GetSourceRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.Source() ); @@ -1226,11 +1248,14 @@ describe('v1p1beta1.SecurityCenterClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getSource as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.getSource as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getSource as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getSource with error', async () => { @@ -1242,23 +1267,20 @@ describe('v1p1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.GetSourceRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('GetSourceRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.getSource = stubSimpleCall(undefined, expectedError); await assert.rejects(client.getSource(request), expectedError); - assert( - (client.innerApiCalls.getSource as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.getSource as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getSource as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getSource with closed client', async () => { @@ -1270,7 +1292,8 @@ describe('v1p1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.GetSourceRequest() ); - request.name = ''; + const defaultValue1 = getTypeDefaultValue('GetSourceRequest', ['name']); + request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.getSource(request), expectedError); @@ -1287,26 +1310,25 @@ describe('v1p1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('SetFindingStateRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.Finding() ); client.innerApiCalls.setFindingState = stubSimpleCall(expectedResponse); const [response] = await client.setFindingState(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.setFindingState as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.setFindingState as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.setFindingState as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes setFindingState without error using callback', async () => { @@ -1318,15 +1340,11 @@ describe('v1p1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('SetFindingStateRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.Finding() ); @@ -1349,11 +1367,14 @@ describe('v1p1beta1.SecurityCenterClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.setFindingState as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.setFindingState as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.setFindingState as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes setFindingState with error', async () => { @@ -1365,26 +1386,25 @@ describe('v1p1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('SetFindingStateRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.setFindingState = stubSimpleCall( undefined, expectedError ); await assert.rejects(client.setFindingState(request), expectedError); - assert( - (client.innerApiCalls.setFindingState as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.setFindingState as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.setFindingState as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes setFindingState with closed client', async () => { @@ -1396,7 +1416,10 @@ describe('v1p1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest() ); - request.name = ''; + const defaultValue1 = getTypeDefaultValue('SetFindingStateRequest', [ + 'name', + ]); + request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.setFindingState(request), expectedError); @@ -1413,26 +1436,25 @@ describe('v1p1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.iam.v1.SetIamPolicyRequest() ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('SetIamPolicyRequest', [ + 'resource', + ]); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.iam.v1.Policy() ); client.innerApiCalls.setIamPolicy = stubSimpleCall(expectedResponse); const [response] = await client.setIamPolicy(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.setIamPolicy as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.setIamPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.setIamPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes setIamPolicy without error using callback', async () => { @@ -1444,15 +1466,11 @@ describe('v1p1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.iam.v1.SetIamPolicyRequest() ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('SetIamPolicyRequest', [ + 'resource', + ]); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.iam.v1.Policy() ); @@ -1475,11 +1493,14 @@ describe('v1p1beta1.SecurityCenterClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.setIamPolicy as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.setIamPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.setIamPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes setIamPolicy with error', async () => { @@ -1491,26 +1512,25 @@ describe('v1p1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.iam.v1.SetIamPolicyRequest() ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('SetIamPolicyRequest', [ + 'resource', + ]); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.setIamPolicy = stubSimpleCall( undefined, expectedError ); await assert.rejects(client.setIamPolicy(request), expectedError); - assert( - (client.innerApiCalls.setIamPolicy as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.setIamPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.setIamPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes setIamPolicy with closed client', async () => { @@ -1522,7 +1542,10 @@ describe('v1p1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.iam.v1.SetIamPolicyRequest() ); - request.resource = ''; + const defaultValue1 = getTypeDefaultValue('SetIamPolicyRequest', [ + 'resource', + ]); + request.resource = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.setIamPolicy(request), expectedError); @@ -1539,15 +1562,11 @@ describe('v1p1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.iam.v1.TestIamPermissionsRequest() ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('TestIamPermissionsRequest', [ + 'resource', + ]); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.iam.v1.TestIamPermissionsResponse() ); @@ -1555,11 +1574,14 @@ describe('v1p1beta1.SecurityCenterClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.testIamPermissions(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.testIamPermissions as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.testIamPermissions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.testIamPermissions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes testIamPermissions without error using callback', async () => { @@ -1571,15 +1593,11 @@ describe('v1p1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.iam.v1.TestIamPermissionsRequest() ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('TestIamPermissionsRequest', [ + 'resource', + ]); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.iam.v1.TestIamPermissionsResponse() ); @@ -1602,11 +1620,14 @@ describe('v1p1beta1.SecurityCenterClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.testIamPermissions as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.testIamPermissions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.testIamPermissions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes testIamPermissions with error', async () => { @@ -1618,26 +1639,25 @@ describe('v1p1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.iam.v1.TestIamPermissionsRequest() ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('TestIamPermissionsRequest', [ + 'resource', + ]); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.testIamPermissions = stubSimpleCall( undefined, expectedError ); await assert.rejects(client.testIamPermissions(request), expectedError); - assert( - (client.innerApiCalls.testIamPermissions as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.testIamPermissions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.testIamPermissions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes testIamPermissions with closed client', async () => { @@ -1649,7 +1669,10 @@ describe('v1p1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.iam.v1.TestIamPermissionsRequest() ); - request.resource = ''; + const defaultValue1 = getTypeDefaultValue('TestIamPermissionsRequest', [ + 'resource', + ]); + request.resource = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.testIamPermissions(request), expectedError); @@ -1666,27 +1689,27 @@ describe('v1p1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.UpdateFindingRequest() ); - request.finding = {}; - request.finding.name = ''; - const expectedHeaderRequestParams = 'finding.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.finding ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateFindingRequest', [ + 'finding', + 'name', + ]); + request.finding.name = defaultValue1; + const expectedHeaderRequestParams = `finding.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.Finding() ); client.innerApiCalls.updateFinding = stubSimpleCall(expectedResponse); const [response] = await client.updateFinding(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.updateFinding as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.updateFinding as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateFinding as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateFinding without error using callback', async () => { @@ -1698,16 +1721,13 @@ describe('v1p1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.UpdateFindingRequest() ); - request.finding = {}; - request.finding.name = ''; - const expectedHeaderRequestParams = 'finding.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.finding ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateFindingRequest', [ + 'finding', + 'name', + ]); + request.finding.name = defaultValue1; + const expectedHeaderRequestParams = `finding.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.Finding() ); @@ -1730,11 +1750,14 @@ describe('v1p1beta1.SecurityCenterClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.updateFinding as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.updateFinding as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateFinding as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateFinding with error', async () => { @@ -1746,27 +1769,27 @@ describe('v1p1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.UpdateFindingRequest() ); - request.finding = {}; - request.finding.name = ''; - const expectedHeaderRequestParams = 'finding.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.finding ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateFindingRequest', [ + 'finding', + 'name', + ]); + request.finding.name = defaultValue1; + const expectedHeaderRequestParams = `finding.name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.updateFinding = stubSimpleCall( undefined, expectedError ); await assert.rejects(client.updateFinding(request), expectedError); - assert( - (client.innerApiCalls.updateFinding as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.updateFinding as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateFinding as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateFinding with closed client', async () => { @@ -1778,8 +1801,12 @@ describe('v1p1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.UpdateFindingRequest() ); - request.finding = {}; - request.finding.name = ''; + request.finding ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateFindingRequest', [ + 'finding', + 'name', + ]); + request.finding.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.updateFinding(request), expectedError); @@ -1796,16 +1823,13 @@ describe('v1p1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest() ); - request.notificationConfig = {}; - request.notificationConfig.name = ''; - const expectedHeaderRequestParams = 'notification_config.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.notificationConfig ??= {}; + const defaultValue1 = getTypeDefaultValue( + 'UpdateNotificationConfigRequest', + ['notificationConfig', 'name'] + ); + request.notificationConfig.name = defaultValue1; + const expectedHeaderRequestParams = `notification_config.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.NotificationConfig() ); @@ -1813,11 +1837,14 @@ describe('v1p1beta1.SecurityCenterClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.updateNotificationConfig(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.updateNotificationConfig as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.updateNotificationConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateNotificationConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateNotificationConfig without error using callback', async () => { @@ -1829,16 +1856,13 @@ describe('v1p1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest() ); - request.notificationConfig = {}; - request.notificationConfig.name = ''; - const expectedHeaderRequestParams = 'notification_config.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.notificationConfig ??= {}; + const defaultValue1 = getTypeDefaultValue( + 'UpdateNotificationConfigRequest', + ['notificationConfig', 'name'] + ); + request.notificationConfig.name = defaultValue1; + const expectedHeaderRequestParams = `notification_config.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.NotificationConfig() ); @@ -1861,11 +1885,14 @@ describe('v1p1beta1.SecurityCenterClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.updateNotificationConfig as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.updateNotificationConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateNotificationConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateNotificationConfig with error', async () => { @@ -1877,16 +1904,13 @@ describe('v1p1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest() ); - request.notificationConfig = {}; - request.notificationConfig.name = ''; - const expectedHeaderRequestParams = 'notification_config.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.notificationConfig ??= {}; + const defaultValue1 = getTypeDefaultValue( + 'UpdateNotificationConfigRequest', + ['notificationConfig', 'name'] + ); + request.notificationConfig.name = defaultValue1; + const expectedHeaderRequestParams = `notification_config.name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.updateNotificationConfig = stubSimpleCall( undefined, @@ -1896,11 +1920,14 @@ describe('v1p1beta1.SecurityCenterClient', () => { client.updateNotificationConfig(request), expectedError ); - assert( - (client.innerApiCalls.updateNotificationConfig as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.updateNotificationConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateNotificationConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateNotificationConfig with closed client', async () => { @@ -1912,8 +1939,12 @@ describe('v1p1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest() ); - request.notificationConfig = {}; - request.notificationConfig.name = ''; + request.notificationConfig ??= {}; + const defaultValue1 = getTypeDefaultValue( + 'UpdateNotificationConfigRequest', + ['notificationConfig', 'name'] + ); + request.notificationConfig.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects( @@ -1933,16 +1964,13 @@ describe('v1p1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest() ); - request.organizationSettings = {}; - request.organizationSettings.name = ''; - const expectedHeaderRequestParams = 'organization_settings.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.organizationSettings ??= {}; + const defaultValue1 = getTypeDefaultValue( + 'UpdateOrganizationSettingsRequest', + ['organizationSettings', 'name'] + ); + request.organizationSettings.name = defaultValue1; + const expectedHeaderRequestParams = `organization_settings.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.OrganizationSettings() ); @@ -1950,11 +1978,14 @@ describe('v1p1beta1.SecurityCenterClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.updateOrganizationSettings(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.updateOrganizationSettings as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.updateOrganizationSettings as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateOrganizationSettings as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateOrganizationSettings without error using callback', async () => { @@ -1966,16 +1997,13 @@ describe('v1p1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest() ); - request.organizationSettings = {}; - request.organizationSettings.name = ''; - const expectedHeaderRequestParams = 'organization_settings.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.organizationSettings ??= {}; + const defaultValue1 = getTypeDefaultValue( + 'UpdateOrganizationSettingsRequest', + ['organizationSettings', 'name'] + ); + request.organizationSettings.name = defaultValue1; + const expectedHeaderRequestParams = `organization_settings.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.OrganizationSettings() ); @@ -1998,11 +2026,14 @@ describe('v1p1beta1.SecurityCenterClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.updateOrganizationSettings as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.updateOrganizationSettings as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateOrganizationSettings as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateOrganizationSettings with error', async () => { @@ -2014,16 +2045,13 @@ describe('v1p1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest() ); - request.organizationSettings = {}; - request.organizationSettings.name = ''; - const expectedHeaderRequestParams = 'organization_settings.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.organizationSettings ??= {}; + const defaultValue1 = getTypeDefaultValue( + 'UpdateOrganizationSettingsRequest', + ['organizationSettings', 'name'] + ); + request.organizationSettings.name = defaultValue1; + const expectedHeaderRequestParams = `organization_settings.name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.updateOrganizationSettings = stubSimpleCall( undefined, @@ -2033,11 +2061,14 @@ describe('v1p1beta1.SecurityCenterClient', () => { client.updateOrganizationSettings(request), expectedError ); - assert( - (client.innerApiCalls.updateOrganizationSettings as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.updateOrganizationSettings as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateOrganizationSettings as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateOrganizationSettings with closed client', async () => { @@ -2049,8 +2080,12 @@ describe('v1p1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest() ); - request.organizationSettings = {}; - request.organizationSettings.name = ''; + request.organizationSettings ??= {}; + const defaultValue1 = getTypeDefaultValue( + 'UpdateOrganizationSettingsRequest', + ['organizationSettings', 'name'] + ); + request.organizationSettings.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects( @@ -2070,27 +2105,27 @@ describe('v1p1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.UpdateSourceRequest() ); - request.source = {}; - request.source.name = ''; - const expectedHeaderRequestParams = 'source.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.source ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateSourceRequest', [ + 'source', + 'name', + ]); + request.source.name = defaultValue1; + const expectedHeaderRequestParams = `source.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.Source() ); client.innerApiCalls.updateSource = stubSimpleCall(expectedResponse); const [response] = await client.updateSource(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.updateSource as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.updateSource as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateSource as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateSource without error using callback', async () => { @@ -2102,16 +2137,13 @@ describe('v1p1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.UpdateSourceRequest() ); - request.source = {}; - request.source.name = ''; - const expectedHeaderRequestParams = 'source.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.source ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateSourceRequest', [ + 'source', + 'name', + ]); + request.source.name = defaultValue1; + const expectedHeaderRequestParams = `source.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.Source() ); @@ -2134,11 +2166,14 @@ describe('v1p1beta1.SecurityCenterClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.updateSource as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.updateSource as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateSource as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateSource with error', async () => { @@ -2150,27 +2185,27 @@ describe('v1p1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.UpdateSourceRequest() ); - request.source = {}; - request.source.name = ''; - const expectedHeaderRequestParams = 'source.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.source ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateSourceRequest', [ + 'source', + 'name', + ]); + request.source.name = defaultValue1; + const expectedHeaderRequestParams = `source.name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.updateSource = stubSimpleCall( undefined, expectedError ); await assert.rejects(client.updateSource(request), expectedError); - assert( - (client.innerApiCalls.updateSource as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.updateSource as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateSource as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateSource with closed client', async () => { @@ -2182,8 +2217,12 @@ describe('v1p1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.UpdateSourceRequest() ); - request.source = {}; - request.source.name = ''; + request.source ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateSourceRequest', [ + 'source', + 'name', + ]); + request.source.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.updateSource(request), expectedError); @@ -2200,16 +2239,13 @@ describe('v1p1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest() ); - request.securityMarks = {}; - request.securityMarks.name = ''; - const expectedHeaderRequestParams = 'security_marks.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.securityMarks ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateSecurityMarksRequest', [ + 'securityMarks', + 'name', + ]); + request.securityMarks.name = defaultValue1; + const expectedHeaderRequestParams = `security_marks.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.SecurityMarks() ); @@ -2217,11 +2253,14 @@ describe('v1p1beta1.SecurityCenterClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.updateSecurityMarks(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.updateSecurityMarks as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.updateSecurityMarks as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateSecurityMarks as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateSecurityMarks without error using callback', async () => { @@ -2233,16 +2272,13 @@ describe('v1p1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest() ); - request.securityMarks = {}; - request.securityMarks.name = ''; - const expectedHeaderRequestParams = 'security_marks.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.securityMarks ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateSecurityMarksRequest', [ + 'securityMarks', + 'name', + ]); + request.securityMarks.name = defaultValue1; + const expectedHeaderRequestParams = `security_marks.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.SecurityMarks() ); @@ -2265,11 +2301,14 @@ describe('v1p1beta1.SecurityCenterClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.updateSecurityMarks as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.updateSecurityMarks as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateSecurityMarks as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateSecurityMarks with error', async () => { @@ -2281,27 +2320,27 @@ describe('v1p1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest() ); - request.securityMarks = {}; - request.securityMarks.name = ''; - const expectedHeaderRequestParams = 'security_marks.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.securityMarks ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateSecurityMarksRequest', [ + 'securityMarks', + 'name', + ]); + request.securityMarks.name = defaultValue1; + const expectedHeaderRequestParams = `security_marks.name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.updateSecurityMarks = stubSimpleCall( undefined, expectedError ); await assert.rejects(client.updateSecurityMarks(request), expectedError); - assert( - (client.innerApiCalls.updateSecurityMarks as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.updateSecurityMarks as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateSecurityMarks as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateSecurityMarks with closed client', async () => { @@ -2313,8 +2352,12 @@ describe('v1p1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest() ); - request.securityMarks = {}; - request.securityMarks.name = ''; + request.securityMarks ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateSecurityMarksRequest', [ + 'securityMarks', + 'name', + ]); + request.securityMarks.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.updateSecurityMarks(request), expectedError); @@ -2331,15 +2374,11 @@ describe('v1p1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('RunAssetDiscoveryRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2348,11 +2387,14 @@ describe('v1p1beta1.SecurityCenterClient', () => { const [operation] = await client.runAssetDiscovery(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.runAssetDiscovery as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.runAssetDiscovery as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.runAssetDiscovery as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes runAssetDiscovery without error using callback', async () => { @@ -2364,15 +2406,11 @@ describe('v1p1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('RunAssetDiscoveryRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2402,11 +2440,14 @@ describe('v1p1beta1.SecurityCenterClient', () => { >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.runAssetDiscovery as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.runAssetDiscovery as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.runAssetDiscovery as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes runAssetDiscovery with call error', async () => { @@ -2418,26 +2459,25 @@ describe('v1p1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('RunAssetDiscoveryRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.runAssetDiscovery = stubLongRunningCall( undefined, expectedError ); await assert.rejects(client.runAssetDiscovery(request), expectedError); - assert( - (client.innerApiCalls.runAssetDiscovery as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.runAssetDiscovery as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.runAssetDiscovery as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes runAssetDiscovery with LRO error', async () => { @@ -2449,15 +2489,11 @@ describe('v1p1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('RunAssetDiscoveryRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.runAssetDiscovery = stubLongRunningCall( undefined, @@ -2466,11 +2502,14 @@ describe('v1p1beta1.SecurityCenterClient', () => { ); const [operation] = await client.runAssetDiscovery(request); await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.runAssetDiscovery as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.runAssetDiscovery as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.runAssetDiscovery as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes checkRunAssetDiscoveryProgress without error', async () => { @@ -2525,15 +2564,11 @@ describe('v1p1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('GroupAssetsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.GroupResult() @@ -2548,11 +2583,14 @@ describe('v1p1beta1.SecurityCenterClient', () => { client.innerApiCalls.groupAssets = stubSimpleCall(expectedResponse); const [response] = await client.groupAssets(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.groupAssets as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.groupAssets as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.groupAssets as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes groupAssets without error using callback', async () => { @@ -2564,15 +2602,11 @@ describe('v1p1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('GroupAssetsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.GroupResult() @@ -2605,11 +2639,14 @@ describe('v1p1beta1.SecurityCenterClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.groupAssets as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.groupAssets as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.groupAssets as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes groupAssets with error', async () => { @@ -2621,26 +2658,25 @@ describe('v1p1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('GroupAssetsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.groupAssets = stubSimpleCall( undefined, expectedError ); await assert.rejects(client.groupAssets(request), expectedError); - assert( - (client.innerApiCalls.groupAssets as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.groupAssets as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.groupAssets as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes groupAssetsStream without error', async () => { @@ -2652,8 +2688,11 @@ describe('v1p1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('GroupAssetsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.GroupResult() @@ -2693,11 +2732,12 @@ describe('v1p1beta1.SecurityCenterClient', () => { .getCall(0) .calledWith(client.innerApiCalls.groupAssets, request) ); - assert.strictEqual( - (client.descriptors.page.groupAssets.createStream as SinonStub).getCall( - 0 - ).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.groupAssets.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -2710,8 +2750,11 @@ describe('v1p1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('GroupAssetsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.groupAssets.createStream = stubPageStreamingCall( undefined, @@ -2742,11 +2785,12 @@ describe('v1p1beta1.SecurityCenterClient', () => { .getCall(0) .calledWith(client.innerApiCalls.groupAssets, request) ); - assert.strictEqual( - (client.descriptors.page.groupAssets.createStream as SinonStub).getCall( - 0 - ).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.groupAssets.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -2759,8 +2803,11 @@ describe('v1p1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('GroupAssetsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.GroupResult() @@ -2787,11 +2834,12 @@ describe('v1p1beta1.SecurityCenterClient', () => { ).args[1], request ); - assert.strictEqual( - (client.descriptors.page.groupAssets.asyncIterate as SinonStub).getCall( - 0 - ).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.groupAssets.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -2804,8 +2852,11 @@ describe('v1p1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('GroupAssetsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.groupAssets.asyncIterate = stubAsyncIterationCall( undefined, @@ -2825,11 +2876,12 @@ describe('v1p1beta1.SecurityCenterClient', () => { ).args[1], request ); - assert.strictEqual( - (client.descriptors.page.groupAssets.asyncIterate as SinonStub).getCall( - 0 - ).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.groupAssets.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); }); @@ -2844,15 +2896,11 @@ describe('v1p1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('GroupFindingsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.GroupResult() @@ -2867,11 +2915,14 @@ describe('v1p1beta1.SecurityCenterClient', () => { client.innerApiCalls.groupFindings = stubSimpleCall(expectedResponse); const [response] = await client.groupFindings(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.groupFindings as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.groupFindings as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.groupFindings as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes groupFindings without error using callback', async () => { @@ -2883,15 +2934,11 @@ describe('v1p1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('GroupFindingsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.GroupResult() @@ -2924,11 +2971,14 @@ describe('v1p1beta1.SecurityCenterClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.groupFindings as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.groupFindings as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.groupFindings as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes groupFindings with error', async () => { @@ -2940,26 +2990,25 @@ describe('v1p1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('GroupFindingsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.groupFindings = stubSimpleCall( undefined, expectedError ); await assert.rejects(client.groupFindings(request), expectedError); - assert( - (client.innerApiCalls.groupFindings as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.groupFindings as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.groupFindings as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes groupFindingsStream without error', async () => { @@ -2971,8 +3020,11 @@ describe('v1p1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('GroupFindingsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.GroupResult() @@ -3012,11 +3064,12 @@ describe('v1p1beta1.SecurityCenterClient', () => { .getCall(0) .calledWith(client.innerApiCalls.groupFindings, request) ); - assert.strictEqual( - ( - client.descriptors.page.groupFindings.createStream as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.groupFindings.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -3029,8 +3082,11 @@ describe('v1p1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('GroupFindingsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.groupFindings.createStream = stubPageStreamingCall(undefined, expectedError); @@ -3059,11 +3115,12 @@ describe('v1p1beta1.SecurityCenterClient', () => { .getCall(0) .calledWith(client.innerApiCalls.groupFindings, request) ); - assert.strictEqual( - ( - client.descriptors.page.groupFindings.createStream as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.groupFindings.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -3076,8 +3133,11 @@ describe('v1p1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('GroupFindingsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.GroupResult() @@ -3104,11 +3164,12 @@ describe('v1p1beta1.SecurityCenterClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( - ( - client.descriptors.page.groupFindings.asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.groupFindings.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -3121,8 +3182,11 @@ describe('v1p1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('GroupFindingsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.groupFindings.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -3140,11 +3204,12 @@ describe('v1p1beta1.SecurityCenterClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( - ( - client.descriptors.page.groupFindings.asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.groupFindings.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); }); @@ -3159,15 +3224,11 @@ describe('v1p1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.ListAssetsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('ListAssetsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult() @@ -3182,11 +3243,14 @@ describe('v1p1beta1.SecurityCenterClient', () => { client.innerApiCalls.listAssets = stubSimpleCall(expectedResponse); const [response] = await client.listAssets(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listAssets as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.listAssets as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listAssets as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listAssets without error using callback', async () => { @@ -3198,15 +3262,11 @@ describe('v1p1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.ListAssetsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('ListAssetsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult() @@ -3239,11 +3299,14 @@ describe('v1p1beta1.SecurityCenterClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listAssets as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.listAssets as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listAssets as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listAssets with error', async () => { @@ -3255,26 +3318,25 @@ describe('v1p1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.ListAssetsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('ListAssetsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.listAssets = stubSimpleCall( undefined, expectedError ); await assert.rejects(client.listAssets(request), expectedError); - assert( - (client.innerApiCalls.listAssets as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.listAssets as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listAssets as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listAssetsStream without error', async () => { @@ -3286,8 +3348,11 @@ describe('v1p1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.ListAssetsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListAssetsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult() @@ -3327,11 +3392,12 @@ describe('v1p1beta1.SecurityCenterClient', () => { .getCall(0) .calledWith(client.innerApiCalls.listAssets, request) ); - assert.strictEqual( - (client.descriptors.page.listAssets.createStream as SinonStub).getCall( - 0 - ).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.listAssets.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -3344,8 +3410,11 @@ describe('v1p1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.ListAssetsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListAssetsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listAssets.createStream = stubPageStreamingCall( undefined, @@ -3376,11 +3445,12 @@ describe('v1p1beta1.SecurityCenterClient', () => { .getCall(0) .calledWith(client.innerApiCalls.listAssets, request) ); - assert.strictEqual( - (client.descriptors.page.listAssets.createStream as SinonStub).getCall( - 0 - ).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.listAssets.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -3393,8 +3463,11 @@ describe('v1p1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.ListAssetsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListAssetsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult() @@ -3421,11 +3494,12 @@ describe('v1p1beta1.SecurityCenterClient', () => { ).args[1], request ); - assert.strictEqual( - (client.descriptors.page.listAssets.asyncIterate as SinonStub).getCall( - 0 - ).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.listAssets.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -3438,8 +3512,11 @@ describe('v1p1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.ListAssetsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListAssetsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listAssets.asyncIterate = stubAsyncIterationCall( undefined, @@ -3459,11 +3536,12 @@ describe('v1p1beta1.SecurityCenterClient', () => { ).args[1], request ); - assert.strictEqual( - (client.descriptors.page.listAssets.asyncIterate as SinonStub).getCall( - 0 - ).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.listAssets.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); }); @@ -3478,15 +3556,11 @@ describe('v1p1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.ListFindingsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('ListFindingsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult() @@ -3501,11 +3575,14 @@ describe('v1p1beta1.SecurityCenterClient', () => { client.innerApiCalls.listFindings = stubSimpleCall(expectedResponse); const [response] = await client.listFindings(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listFindings as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.listFindings as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listFindings as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listFindings without error using callback', async () => { @@ -3517,15 +3594,11 @@ describe('v1p1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.ListFindingsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('ListFindingsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult() @@ -3558,11 +3631,14 @@ describe('v1p1beta1.SecurityCenterClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listFindings as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.listFindings as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listFindings as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listFindings with error', async () => { @@ -3574,26 +3650,25 @@ describe('v1p1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.ListFindingsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('ListFindingsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.listFindings = stubSimpleCall( undefined, expectedError ); await assert.rejects(client.listFindings(request), expectedError); - assert( - (client.innerApiCalls.listFindings as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.listFindings as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listFindings as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listFindingsStream without error', async () => { @@ -3605,8 +3680,11 @@ describe('v1p1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.ListFindingsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListFindingsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult() @@ -3646,11 +3724,12 @@ describe('v1p1beta1.SecurityCenterClient', () => { .getCall(0) .calledWith(client.innerApiCalls.listFindings, request) ); - assert.strictEqual( - ( - client.descriptors.page.listFindings.createStream as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.listFindings.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -3663,8 +3742,11 @@ describe('v1p1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.ListFindingsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListFindingsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listFindings.createStream = stubPageStreamingCall( undefined, @@ -3695,11 +3777,12 @@ describe('v1p1beta1.SecurityCenterClient', () => { .getCall(0) .calledWith(client.innerApiCalls.listFindings, request) ); - assert.strictEqual( - ( - client.descriptors.page.listFindings.createStream as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.listFindings.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -3712,8 +3795,11 @@ describe('v1p1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.ListFindingsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListFindingsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult() @@ -3740,11 +3826,12 @@ describe('v1p1beta1.SecurityCenterClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( - ( - client.descriptors.page.listFindings.asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.listFindings.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -3757,8 +3844,11 @@ describe('v1p1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.ListFindingsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListFindingsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listFindings.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -3776,11 +3866,12 @@ describe('v1p1beta1.SecurityCenterClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( - ( - client.descriptors.page.listFindings.asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.listFindings.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); }); @@ -3795,15 +3886,12 @@ describe('v1p1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'ListNotificationConfigsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.NotificationConfig() @@ -3819,11 +3907,14 @@ describe('v1p1beta1.SecurityCenterClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.listNotificationConfigs(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listNotificationConfigs as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.listNotificationConfigs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listNotificationConfigs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listNotificationConfigs without error using callback', async () => { @@ -3835,15 +3926,12 @@ describe('v1p1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'ListNotificationConfigsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.NotificationConfig() @@ -3876,11 +3964,14 @@ describe('v1p1beta1.SecurityCenterClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listNotificationConfigs as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.listNotificationConfigs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listNotificationConfigs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listNotificationConfigs with error', async () => { @@ -3892,15 +3983,12 @@ describe('v1p1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'ListNotificationConfigsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.listNotificationConfigs = stubSimpleCall( undefined, @@ -3910,11 +3998,14 @@ describe('v1p1beta1.SecurityCenterClient', () => { client.listNotificationConfigs(request), expectedError ); - assert( - (client.innerApiCalls.listNotificationConfigs as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.listNotificationConfigs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listNotificationConfigs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listNotificationConfigsStream without error', async () => { @@ -3926,8 +4017,12 @@ describe('v1p1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue( + 'ListNotificationConfigsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.NotificationConfig() @@ -3970,12 +4065,15 @@ describe('v1p1beta1.SecurityCenterClient', () => { .getCall(0) .calledWith(client.innerApiCalls.listNotificationConfigs, request) ); - assert.strictEqual( + assert( ( client.descriptors.page.listNotificationConfigs .createStream as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -3988,8 +4086,12 @@ describe('v1p1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue( + 'ListNotificationConfigsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listNotificationConfigs.createStream = stubPageStreamingCall(undefined, expectedError); @@ -4021,12 +4123,15 @@ describe('v1p1beta1.SecurityCenterClient', () => { .getCall(0) .calledWith(client.innerApiCalls.listNotificationConfigs, request) ); - assert.strictEqual( + assert( ( client.descriptors.page.listNotificationConfigs .createStream as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -4039,8 +4144,12 @@ describe('v1p1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue( + 'ListNotificationConfigsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.NotificationConfig() @@ -4068,12 +4177,15 @@ describe('v1p1beta1.SecurityCenterClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( + assert( ( client.descriptors.page.listNotificationConfigs .asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -4086,8 +4198,12 @@ describe('v1p1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue( + 'ListNotificationConfigsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listNotificationConfigs.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -4106,12 +4222,15 @@ describe('v1p1beta1.SecurityCenterClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( + assert( ( client.descriptors.page.listNotificationConfigs .asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); }); @@ -4126,15 +4245,11 @@ describe('v1p1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.ListSourcesRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('ListSourcesRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.Source() @@ -4149,11 +4264,14 @@ describe('v1p1beta1.SecurityCenterClient', () => { client.innerApiCalls.listSources = stubSimpleCall(expectedResponse); const [response] = await client.listSources(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listSources as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.listSources as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listSources as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listSources without error using callback', async () => { @@ -4165,15 +4283,11 @@ describe('v1p1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.ListSourcesRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('ListSourcesRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.Source() @@ -4206,11 +4320,14 @@ describe('v1p1beta1.SecurityCenterClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listSources as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.listSources as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listSources as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listSources with error', async () => { @@ -4222,26 +4339,25 @@ describe('v1p1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.ListSourcesRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('ListSourcesRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.listSources = stubSimpleCall( undefined, expectedError ); await assert.rejects(client.listSources(request), expectedError); - assert( - (client.innerApiCalls.listSources as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.listSources as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listSources as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listSourcesStream without error', async () => { @@ -4253,8 +4369,11 @@ describe('v1p1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.ListSourcesRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListSourcesRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.Source() @@ -4292,11 +4411,12 @@ describe('v1p1beta1.SecurityCenterClient', () => { .getCall(0) .calledWith(client.innerApiCalls.listSources, request) ); - assert.strictEqual( - (client.descriptors.page.listSources.createStream as SinonStub).getCall( - 0 - ).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.listSources.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -4309,8 +4429,11 @@ describe('v1p1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.ListSourcesRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListSourcesRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listSources.createStream = stubPageStreamingCall( undefined, @@ -4339,11 +4462,12 @@ describe('v1p1beta1.SecurityCenterClient', () => { .getCall(0) .calledWith(client.innerApiCalls.listSources, request) ); - assert.strictEqual( - (client.descriptors.page.listSources.createStream as SinonStub).getCall( - 0 - ).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.listSources.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -4356,8 +4480,11 @@ describe('v1p1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.ListSourcesRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListSourcesRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.Source() @@ -4384,11 +4511,12 @@ describe('v1p1beta1.SecurityCenterClient', () => { ).args[1], request ); - assert.strictEqual( - (client.descriptors.page.listSources.asyncIterate as SinonStub).getCall( - 0 - ).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.listSources.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -4401,8 +4529,11 @@ describe('v1p1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.ListSourcesRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListSourcesRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listSources.asyncIterate = stubAsyncIterationCall( undefined, @@ -4422,11 +4553,12 @@ describe('v1p1beta1.SecurityCenterClient', () => { ).args[1], request ); - assert.strictEqual( - (client.descriptors.page.listSources.asyncIterate as SinonStub).getCall( - 0 - ).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.listSources.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); }); From 8bd94f0e30939f636afce193bb8967f13d34ac0f Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 22 Sep 2022 14:07:37 -0700 Subject: [PATCH 336/342] build: use fully qualified request type name in tests (#513) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * test: use fully qualified request type name in tests PiperOrigin-RevId: 475685359 Source-Link: https://github.com/googleapis/googleapis/commit/7a129736313ceb1f277c3b7f7e16d2e04cc901dd Source-Link: https://github.com/googleapis/googleapis-gen/commit/370c729e2ba062a167449c27882ba5f379c5c34d Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMzcwYzcyOWUyYmEwNjJhMTY3NDQ5YzI3ODgyYmE1ZjM3OWM1YzM0ZCJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot --- .../test/gapic_security_center_v1.ts | 1029 ++++++++++------- .../test/gapic_security_center_v1beta1.ts | 573 +++++---- .../test/gapic_security_center_v1p1beta1.ts | 619 +++++----- 3 files changed, 1250 insertions(+), 971 deletions(-) diff --git a/packages/google-cloud-securitycenter/test/gapic_security_center_v1.ts b/packages/google-cloud-securitycenter/test/gapic_security_center_v1.ts index 74c0d3efc84..31c5a95b23e 100644 --- a/packages/google-cloud-securitycenter/test/gapic_security_center_v1.ts +++ b/packages/google-cloud-securitycenter/test/gapic_security_center_v1.ts @@ -269,9 +269,10 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.CreateSourceRequest() ); - const defaultValue1 = getTypeDefaultValue('CreateSourceRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.CreateSourceRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -299,9 +300,10 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.CreateSourceRequest() ); - const defaultValue1 = getTypeDefaultValue('CreateSourceRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.CreateSourceRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -345,9 +347,10 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.CreateSourceRequest() ); - const defaultValue1 = getTypeDefaultValue('CreateSourceRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.CreateSourceRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); @@ -375,9 +378,10 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.CreateSourceRequest() ); - const defaultValue1 = getTypeDefaultValue('CreateSourceRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.CreateSourceRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); @@ -395,9 +399,10 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.CreateFindingRequest() ); - const defaultValue1 = getTypeDefaultValue('CreateFindingRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.CreateFindingRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -425,9 +430,10 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.CreateFindingRequest() ); - const defaultValue1 = getTypeDefaultValue('CreateFindingRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.CreateFindingRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -471,9 +477,10 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.CreateFindingRequest() ); - const defaultValue1 = getTypeDefaultValue('CreateFindingRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.CreateFindingRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); @@ -501,9 +508,10 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.CreateFindingRequest() ); - const defaultValue1 = getTypeDefaultValue('CreateFindingRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.CreateFindingRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); @@ -521,9 +529,10 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.CreateMuteConfigRequest() ); - const defaultValue1 = getTypeDefaultValue('CreateMuteConfigRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.CreateMuteConfigRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -551,9 +560,10 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.CreateMuteConfigRequest() ); - const defaultValue1 = getTypeDefaultValue('CreateMuteConfigRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.CreateMuteConfigRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -597,9 +607,10 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.CreateMuteConfigRequest() ); - const defaultValue1 = getTypeDefaultValue('CreateMuteConfigRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.CreateMuteConfigRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); @@ -627,9 +638,10 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.CreateMuteConfigRequest() ); - const defaultValue1 = getTypeDefaultValue('CreateMuteConfigRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.CreateMuteConfigRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); @@ -648,7 +660,7 @@ describe('v1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1.CreateNotificationConfigRequest() ); const defaultValue1 = getTypeDefaultValue( - 'CreateNotificationConfigRequest', + '.google.cloud.securitycenter.v1.CreateNotificationConfigRequest', ['parent'] ); request.parent = defaultValue1; @@ -680,7 +692,7 @@ describe('v1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1.CreateNotificationConfigRequest() ); const defaultValue1 = getTypeDefaultValue( - 'CreateNotificationConfigRequest', + '.google.cloud.securitycenter.v1.CreateNotificationConfigRequest', ['parent'] ); request.parent = defaultValue1; @@ -727,7 +739,7 @@ describe('v1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1.CreateNotificationConfigRequest() ); const defaultValue1 = getTypeDefaultValue( - 'CreateNotificationConfigRequest', + '.google.cloud.securitycenter.v1.CreateNotificationConfigRequest', ['parent'] ); request.parent = defaultValue1; @@ -761,7 +773,7 @@ describe('v1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1.CreateNotificationConfigRequest() ); const defaultValue1 = getTypeDefaultValue( - 'CreateNotificationConfigRequest', + '.google.cloud.securitycenter.v1.CreateNotificationConfigRequest', ['parent'] ); request.parent = defaultValue1; @@ -784,9 +796,10 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.DeleteMuteConfigRequest() ); - const defaultValue1 = getTypeDefaultValue('DeleteMuteConfigRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.DeleteMuteConfigRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -814,9 +827,10 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.DeleteMuteConfigRequest() ); - const defaultValue1 = getTypeDefaultValue('DeleteMuteConfigRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.DeleteMuteConfigRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -860,9 +874,10 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.DeleteMuteConfigRequest() ); - const defaultValue1 = getTypeDefaultValue('DeleteMuteConfigRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.DeleteMuteConfigRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); @@ -890,9 +905,10 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.DeleteMuteConfigRequest() ); - const defaultValue1 = getTypeDefaultValue('DeleteMuteConfigRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.DeleteMuteConfigRequest', + ['name'] + ); request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); @@ -911,7 +927,7 @@ describe('v1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1.DeleteNotificationConfigRequest() ); const defaultValue1 = getTypeDefaultValue( - 'DeleteNotificationConfigRequest', + '.google.cloud.securitycenter.v1.DeleteNotificationConfigRequest', ['name'] ); request.name = defaultValue1; @@ -943,7 +959,7 @@ describe('v1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1.DeleteNotificationConfigRequest() ); const defaultValue1 = getTypeDefaultValue( - 'DeleteNotificationConfigRequest', + '.google.cloud.securitycenter.v1.DeleteNotificationConfigRequest', ['name'] ); request.name = defaultValue1; @@ -990,7 +1006,7 @@ describe('v1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1.DeleteNotificationConfigRequest() ); const defaultValue1 = getTypeDefaultValue( - 'DeleteNotificationConfigRequest', + '.google.cloud.securitycenter.v1.DeleteNotificationConfigRequest', ['name'] ); request.name = defaultValue1; @@ -1024,7 +1040,7 @@ describe('v1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1.DeleteNotificationConfigRequest() ); const defaultValue1 = getTypeDefaultValue( - 'DeleteNotificationConfigRequest', + '.google.cloud.securitycenter.v1.DeleteNotificationConfigRequest', ['name'] ); request.name = defaultValue1; @@ -1047,9 +1063,10 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.GetBigQueryExportRequest() ); - const defaultValue1 = getTypeDefaultValue('GetBigQueryExportRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.GetBigQueryExportRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -1077,9 +1094,10 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.GetBigQueryExportRequest() ); - const defaultValue1 = getTypeDefaultValue('GetBigQueryExportRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.GetBigQueryExportRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -1123,9 +1141,10 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.GetBigQueryExportRequest() ); - const defaultValue1 = getTypeDefaultValue('GetBigQueryExportRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.GetBigQueryExportRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); @@ -1153,9 +1172,10 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.GetBigQueryExportRequest() ); - const defaultValue1 = getTypeDefaultValue('GetBigQueryExportRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.GetBigQueryExportRequest', + ['name'] + ); request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); @@ -1173,9 +1193,10 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.iam.v1.GetIamPolicyRequest() ); - const defaultValue1 = getTypeDefaultValue('GetIamPolicyRequest', [ - 'resource', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.GetIamPolicyRequest', + ['resource'] + ); request.resource = defaultValue1; const expectedHeaderRequestParams = `resource=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -1203,9 +1224,10 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.iam.v1.GetIamPolicyRequest() ); - const defaultValue1 = getTypeDefaultValue('GetIamPolicyRequest', [ - 'resource', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.GetIamPolicyRequest', + ['resource'] + ); request.resource = defaultValue1; const expectedHeaderRequestParams = `resource=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -1249,9 +1271,10 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.iam.v1.GetIamPolicyRequest() ); - const defaultValue1 = getTypeDefaultValue('GetIamPolicyRequest', [ - 'resource', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.GetIamPolicyRequest', + ['resource'] + ); request.resource = defaultValue1; const expectedHeaderRequestParams = `resource=${defaultValue1}`; const expectedError = new Error('expected'); @@ -1279,9 +1302,10 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.iam.v1.GetIamPolicyRequest() ); - const defaultValue1 = getTypeDefaultValue('GetIamPolicyRequest', [ - 'resource', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.GetIamPolicyRequest', + ['resource'] + ); request.resource = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); @@ -1299,9 +1323,10 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.GetMuteConfigRequest() ); - const defaultValue1 = getTypeDefaultValue('GetMuteConfigRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.GetMuteConfigRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -1329,9 +1354,10 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.GetMuteConfigRequest() ); - const defaultValue1 = getTypeDefaultValue('GetMuteConfigRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.GetMuteConfigRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -1375,9 +1401,10 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.GetMuteConfigRequest() ); - const defaultValue1 = getTypeDefaultValue('GetMuteConfigRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.GetMuteConfigRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); @@ -1405,9 +1432,10 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.GetMuteConfigRequest() ); - const defaultValue1 = getTypeDefaultValue('GetMuteConfigRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.GetMuteConfigRequest', + ['name'] + ); request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); @@ -1426,7 +1454,7 @@ describe('v1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1.GetNotificationConfigRequest() ); const defaultValue1 = getTypeDefaultValue( - 'GetNotificationConfigRequest', + '.google.cloud.securitycenter.v1.GetNotificationConfigRequest', ['name'] ); request.name = defaultValue1; @@ -1458,7 +1486,7 @@ describe('v1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1.GetNotificationConfigRequest() ); const defaultValue1 = getTypeDefaultValue( - 'GetNotificationConfigRequest', + '.google.cloud.securitycenter.v1.GetNotificationConfigRequest', ['name'] ); request.name = defaultValue1; @@ -1505,7 +1533,7 @@ describe('v1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1.GetNotificationConfigRequest() ); const defaultValue1 = getTypeDefaultValue( - 'GetNotificationConfigRequest', + '.google.cloud.securitycenter.v1.GetNotificationConfigRequest', ['name'] ); request.name = defaultValue1; @@ -1539,7 +1567,7 @@ describe('v1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1.GetNotificationConfigRequest() ); const defaultValue1 = getTypeDefaultValue( - 'GetNotificationConfigRequest', + '.google.cloud.securitycenter.v1.GetNotificationConfigRequest', ['name'] ); request.name = defaultValue1; @@ -1563,7 +1591,7 @@ describe('v1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1.GetOrganizationSettingsRequest() ); const defaultValue1 = getTypeDefaultValue( - 'GetOrganizationSettingsRequest', + '.google.cloud.securitycenter.v1.GetOrganizationSettingsRequest', ['name'] ); request.name = defaultValue1; @@ -1595,7 +1623,7 @@ describe('v1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1.GetOrganizationSettingsRequest() ); const defaultValue1 = getTypeDefaultValue( - 'GetOrganizationSettingsRequest', + '.google.cloud.securitycenter.v1.GetOrganizationSettingsRequest', ['name'] ); request.name = defaultValue1; @@ -1642,7 +1670,7 @@ describe('v1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1.GetOrganizationSettingsRequest() ); const defaultValue1 = getTypeDefaultValue( - 'GetOrganizationSettingsRequest', + '.google.cloud.securitycenter.v1.GetOrganizationSettingsRequest', ['name'] ); request.name = defaultValue1; @@ -1676,7 +1704,7 @@ describe('v1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1.GetOrganizationSettingsRequest() ); const defaultValue1 = getTypeDefaultValue( - 'GetOrganizationSettingsRequest', + '.google.cloud.securitycenter.v1.GetOrganizationSettingsRequest', ['name'] ); request.name = defaultValue1; @@ -1699,7 +1727,10 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.GetSourceRequest() ); - const defaultValue1 = getTypeDefaultValue('GetSourceRequest', ['name']); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.GetSourceRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -1727,7 +1758,10 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.GetSourceRequest() ); - const defaultValue1 = getTypeDefaultValue('GetSourceRequest', ['name']); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.GetSourceRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -1771,7 +1805,10 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.GetSourceRequest() ); - const defaultValue1 = getTypeDefaultValue('GetSourceRequest', ['name']); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.GetSourceRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); @@ -1796,7 +1833,10 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.GetSourceRequest() ); - const defaultValue1 = getTypeDefaultValue('GetSourceRequest', ['name']); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.GetSourceRequest', + ['name'] + ); request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); @@ -1814,9 +1854,10 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.SetFindingStateRequest() ); - const defaultValue1 = getTypeDefaultValue('SetFindingStateRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.SetFindingStateRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -1844,9 +1885,10 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.SetFindingStateRequest() ); - const defaultValue1 = getTypeDefaultValue('SetFindingStateRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.SetFindingStateRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -1890,9 +1932,10 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.SetFindingStateRequest() ); - const defaultValue1 = getTypeDefaultValue('SetFindingStateRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.SetFindingStateRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); @@ -1920,9 +1963,10 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.SetFindingStateRequest() ); - const defaultValue1 = getTypeDefaultValue('SetFindingStateRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.SetFindingStateRequest', + ['name'] + ); request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); @@ -1940,7 +1984,10 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.SetMuteRequest() ); - const defaultValue1 = getTypeDefaultValue('SetMuteRequest', ['name']); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.SetMuteRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -1968,7 +2015,10 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.SetMuteRequest() ); - const defaultValue1 = getTypeDefaultValue('SetMuteRequest', ['name']); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.SetMuteRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -2012,7 +2062,10 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.SetMuteRequest() ); - const defaultValue1 = getTypeDefaultValue('SetMuteRequest', ['name']); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.SetMuteRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); @@ -2037,7 +2090,10 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.SetMuteRequest() ); - const defaultValue1 = getTypeDefaultValue('SetMuteRequest', ['name']); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.SetMuteRequest', + ['name'] + ); request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); @@ -2055,9 +2111,10 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.iam.v1.SetIamPolicyRequest() ); - const defaultValue1 = getTypeDefaultValue('SetIamPolicyRequest', [ - 'resource', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.SetIamPolicyRequest', + ['resource'] + ); request.resource = defaultValue1; const expectedHeaderRequestParams = `resource=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -2085,9 +2142,10 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.iam.v1.SetIamPolicyRequest() ); - const defaultValue1 = getTypeDefaultValue('SetIamPolicyRequest', [ - 'resource', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.SetIamPolicyRequest', + ['resource'] + ); request.resource = defaultValue1; const expectedHeaderRequestParams = `resource=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -2131,9 +2189,10 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.iam.v1.SetIamPolicyRequest() ); - const defaultValue1 = getTypeDefaultValue('SetIamPolicyRequest', [ - 'resource', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.SetIamPolicyRequest', + ['resource'] + ); request.resource = defaultValue1; const expectedHeaderRequestParams = `resource=${defaultValue1}`; const expectedError = new Error('expected'); @@ -2161,9 +2220,10 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.iam.v1.SetIamPolicyRequest() ); - const defaultValue1 = getTypeDefaultValue('SetIamPolicyRequest', [ - 'resource', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.SetIamPolicyRequest', + ['resource'] + ); request.resource = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); @@ -2181,9 +2241,10 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.iam.v1.TestIamPermissionsRequest() ); - const defaultValue1 = getTypeDefaultValue('TestIamPermissionsRequest', [ - 'resource', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.TestIamPermissionsRequest', + ['resource'] + ); request.resource = defaultValue1; const expectedHeaderRequestParams = `resource=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -2212,9 +2273,10 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.iam.v1.TestIamPermissionsRequest() ); - const defaultValue1 = getTypeDefaultValue('TestIamPermissionsRequest', [ - 'resource', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.TestIamPermissionsRequest', + ['resource'] + ); request.resource = defaultValue1; const expectedHeaderRequestParams = `resource=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -2258,9 +2320,10 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.iam.v1.TestIamPermissionsRequest() ); - const defaultValue1 = getTypeDefaultValue('TestIamPermissionsRequest', [ - 'resource', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.TestIamPermissionsRequest', + ['resource'] + ); request.resource = defaultValue1; const expectedHeaderRequestParams = `resource=${defaultValue1}`; const expectedError = new Error('expected'); @@ -2288,9 +2351,10 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.iam.v1.TestIamPermissionsRequest() ); - const defaultValue1 = getTypeDefaultValue('TestIamPermissionsRequest', [ - 'resource', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.TestIamPermissionsRequest', + ['resource'] + ); request.resource = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); @@ -2309,10 +2373,10 @@ describe('v1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1.UpdateExternalSystemRequest() ); request.externalSystem ??= {}; - const defaultValue1 = getTypeDefaultValue('UpdateExternalSystemRequest', [ - 'externalSystem', - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.UpdateExternalSystemRequest', + ['externalSystem', 'name'] + ); request.externalSystem.name = defaultValue1; const expectedHeaderRequestParams = `external_system.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -2342,10 +2406,10 @@ describe('v1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1.UpdateExternalSystemRequest() ); request.externalSystem ??= {}; - const defaultValue1 = getTypeDefaultValue('UpdateExternalSystemRequest', [ - 'externalSystem', - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.UpdateExternalSystemRequest', + ['externalSystem', 'name'] + ); request.externalSystem.name = defaultValue1; const expectedHeaderRequestParams = `external_system.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -2390,10 +2454,10 @@ describe('v1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1.UpdateExternalSystemRequest() ); request.externalSystem ??= {}; - const defaultValue1 = getTypeDefaultValue('UpdateExternalSystemRequest', [ - 'externalSystem', - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.UpdateExternalSystemRequest', + ['externalSystem', 'name'] + ); request.externalSystem.name = defaultValue1; const expectedHeaderRequestParams = `external_system.name=${defaultValue1}`; const expectedError = new Error('expected'); @@ -2422,10 +2486,10 @@ describe('v1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1.UpdateExternalSystemRequest() ); request.externalSystem ??= {}; - const defaultValue1 = getTypeDefaultValue('UpdateExternalSystemRequest', [ - 'externalSystem', - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.UpdateExternalSystemRequest', + ['externalSystem', 'name'] + ); request.externalSystem.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); @@ -2444,10 +2508,10 @@ describe('v1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1.UpdateFindingRequest() ); request.finding ??= {}; - const defaultValue1 = getTypeDefaultValue('UpdateFindingRequest', [ - 'finding', - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.UpdateFindingRequest', + ['finding', 'name'] + ); request.finding.name = defaultValue1; const expectedHeaderRequestParams = `finding.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -2476,10 +2540,10 @@ describe('v1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1.UpdateFindingRequest() ); request.finding ??= {}; - const defaultValue1 = getTypeDefaultValue('UpdateFindingRequest', [ - 'finding', - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.UpdateFindingRequest', + ['finding', 'name'] + ); request.finding.name = defaultValue1; const expectedHeaderRequestParams = `finding.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -2524,10 +2588,10 @@ describe('v1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1.UpdateFindingRequest() ); request.finding ??= {}; - const defaultValue1 = getTypeDefaultValue('UpdateFindingRequest', [ - 'finding', - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.UpdateFindingRequest', + ['finding', 'name'] + ); request.finding.name = defaultValue1; const expectedHeaderRequestParams = `finding.name=${defaultValue1}`; const expectedError = new Error('expected'); @@ -2556,10 +2620,10 @@ describe('v1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1.UpdateFindingRequest() ); request.finding ??= {}; - const defaultValue1 = getTypeDefaultValue('UpdateFindingRequest', [ - 'finding', - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.UpdateFindingRequest', + ['finding', 'name'] + ); request.finding.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); @@ -2578,10 +2642,10 @@ describe('v1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1.UpdateMuteConfigRequest() ); request.muteConfig ??= {}; - const defaultValue1 = getTypeDefaultValue('UpdateMuteConfigRequest', [ - 'muteConfig', - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.UpdateMuteConfigRequest', + ['muteConfig', 'name'] + ); request.muteConfig.name = defaultValue1; const expectedHeaderRequestParams = `mute_config.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -2610,10 +2674,10 @@ describe('v1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1.UpdateMuteConfigRequest() ); request.muteConfig ??= {}; - const defaultValue1 = getTypeDefaultValue('UpdateMuteConfigRequest', [ - 'muteConfig', - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.UpdateMuteConfigRequest', + ['muteConfig', 'name'] + ); request.muteConfig.name = defaultValue1; const expectedHeaderRequestParams = `mute_config.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -2658,10 +2722,10 @@ describe('v1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1.UpdateMuteConfigRequest() ); request.muteConfig ??= {}; - const defaultValue1 = getTypeDefaultValue('UpdateMuteConfigRequest', [ - 'muteConfig', - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.UpdateMuteConfigRequest', + ['muteConfig', 'name'] + ); request.muteConfig.name = defaultValue1; const expectedHeaderRequestParams = `mute_config.name=${defaultValue1}`; const expectedError = new Error('expected'); @@ -2690,10 +2754,10 @@ describe('v1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1.UpdateMuteConfigRequest() ); request.muteConfig ??= {}; - const defaultValue1 = getTypeDefaultValue('UpdateMuteConfigRequest', [ - 'muteConfig', - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.UpdateMuteConfigRequest', + ['muteConfig', 'name'] + ); request.muteConfig.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); @@ -2713,7 +2777,7 @@ describe('v1.SecurityCenterClient', () => { ); request.notificationConfig ??= {}; const defaultValue1 = getTypeDefaultValue( - 'UpdateNotificationConfigRequest', + '.google.cloud.securitycenter.v1.UpdateNotificationConfigRequest', ['notificationConfig', 'name'] ); request.notificationConfig.name = defaultValue1; @@ -2746,7 +2810,7 @@ describe('v1.SecurityCenterClient', () => { ); request.notificationConfig ??= {}; const defaultValue1 = getTypeDefaultValue( - 'UpdateNotificationConfigRequest', + '.google.cloud.securitycenter.v1.UpdateNotificationConfigRequest', ['notificationConfig', 'name'] ); request.notificationConfig.name = defaultValue1; @@ -2794,7 +2858,7 @@ describe('v1.SecurityCenterClient', () => { ); request.notificationConfig ??= {}; const defaultValue1 = getTypeDefaultValue( - 'UpdateNotificationConfigRequest', + '.google.cloud.securitycenter.v1.UpdateNotificationConfigRequest', ['notificationConfig', 'name'] ); request.notificationConfig.name = defaultValue1; @@ -2829,7 +2893,7 @@ describe('v1.SecurityCenterClient', () => { ); request.notificationConfig ??= {}; const defaultValue1 = getTypeDefaultValue( - 'UpdateNotificationConfigRequest', + '.google.cloud.securitycenter.v1.UpdateNotificationConfigRequest', ['notificationConfig', 'name'] ); request.notificationConfig.name = defaultValue1; @@ -2854,7 +2918,7 @@ describe('v1.SecurityCenterClient', () => { ); request.organizationSettings ??= {}; const defaultValue1 = getTypeDefaultValue( - 'UpdateOrganizationSettingsRequest', + '.google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest', ['organizationSettings', 'name'] ); request.organizationSettings.name = defaultValue1; @@ -2887,7 +2951,7 @@ describe('v1.SecurityCenterClient', () => { ); request.organizationSettings ??= {}; const defaultValue1 = getTypeDefaultValue( - 'UpdateOrganizationSettingsRequest', + '.google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest', ['organizationSettings', 'name'] ); request.organizationSettings.name = defaultValue1; @@ -2935,7 +2999,7 @@ describe('v1.SecurityCenterClient', () => { ); request.organizationSettings ??= {}; const defaultValue1 = getTypeDefaultValue( - 'UpdateOrganizationSettingsRequest', + '.google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest', ['organizationSettings', 'name'] ); request.organizationSettings.name = defaultValue1; @@ -2970,7 +3034,7 @@ describe('v1.SecurityCenterClient', () => { ); request.organizationSettings ??= {}; const defaultValue1 = getTypeDefaultValue( - 'UpdateOrganizationSettingsRequest', + '.google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest', ['organizationSettings', 'name'] ); request.organizationSettings.name = defaultValue1; @@ -2994,10 +3058,10 @@ describe('v1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1.UpdateSourceRequest() ); request.source ??= {}; - const defaultValue1 = getTypeDefaultValue('UpdateSourceRequest', [ - 'source', - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.UpdateSourceRequest', + ['source', 'name'] + ); request.source.name = defaultValue1; const expectedHeaderRequestParams = `source.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -3026,10 +3090,10 @@ describe('v1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1.UpdateSourceRequest() ); request.source ??= {}; - const defaultValue1 = getTypeDefaultValue('UpdateSourceRequest', [ - 'source', - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.UpdateSourceRequest', + ['source', 'name'] + ); request.source.name = defaultValue1; const expectedHeaderRequestParams = `source.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -3074,10 +3138,10 @@ describe('v1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1.UpdateSourceRequest() ); request.source ??= {}; - const defaultValue1 = getTypeDefaultValue('UpdateSourceRequest', [ - 'source', - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.UpdateSourceRequest', + ['source', 'name'] + ); request.source.name = defaultValue1; const expectedHeaderRequestParams = `source.name=${defaultValue1}`; const expectedError = new Error('expected'); @@ -3106,10 +3170,10 @@ describe('v1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1.UpdateSourceRequest() ); request.source ??= {}; - const defaultValue1 = getTypeDefaultValue('UpdateSourceRequest', [ - 'source', - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.UpdateSourceRequest', + ['source', 'name'] + ); request.source.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); @@ -3128,10 +3192,10 @@ describe('v1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1.UpdateSecurityMarksRequest() ); request.securityMarks ??= {}; - const defaultValue1 = getTypeDefaultValue('UpdateSecurityMarksRequest', [ - 'securityMarks', - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.UpdateSecurityMarksRequest', + ['securityMarks', 'name'] + ); request.securityMarks.name = defaultValue1; const expectedHeaderRequestParams = `security_marks.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -3161,10 +3225,10 @@ describe('v1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1.UpdateSecurityMarksRequest() ); request.securityMarks ??= {}; - const defaultValue1 = getTypeDefaultValue('UpdateSecurityMarksRequest', [ - 'securityMarks', - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.UpdateSecurityMarksRequest', + ['securityMarks', 'name'] + ); request.securityMarks.name = defaultValue1; const expectedHeaderRequestParams = `security_marks.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -3209,10 +3273,10 @@ describe('v1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1.UpdateSecurityMarksRequest() ); request.securityMarks ??= {}; - const defaultValue1 = getTypeDefaultValue('UpdateSecurityMarksRequest', [ - 'securityMarks', - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.UpdateSecurityMarksRequest', + ['securityMarks', 'name'] + ); request.securityMarks.name = defaultValue1; const expectedHeaderRequestParams = `security_marks.name=${defaultValue1}`; const expectedError = new Error('expected'); @@ -3241,10 +3305,10 @@ describe('v1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1.UpdateSecurityMarksRequest() ); request.securityMarks ??= {}; - const defaultValue1 = getTypeDefaultValue('UpdateSecurityMarksRequest', [ - 'securityMarks', - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.UpdateSecurityMarksRequest', + ['securityMarks', 'name'] + ); request.securityMarks.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); @@ -3262,9 +3326,10 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.CreateBigQueryExportRequest() ); - const defaultValue1 = getTypeDefaultValue('CreateBigQueryExportRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.CreateBigQueryExportRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -3293,9 +3358,10 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.CreateBigQueryExportRequest() ); - const defaultValue1 = getTypeDefaultValue('CreateBigQueryExportRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.CreateBigQueryExportRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -3339,9 +3405,10 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.CreateBigQueryExportRequest() ); - const defaultValue1 = getTypeDefaultValue('CreateBigQueryExportRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.CreateBigQueryExportRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); @@ -3369,9 +3436,10 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.CreateBigQueryExportRequest() ); - const defaultValue1 = getTypeDefaultValue('CreateBigQueryExportRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.CreateBigQueryExportRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); @@ -3389,9 +3457,10 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.DeleteBigQueryExportRequest() ); - const defaultValue1 = getTypeDefaultValue('DeleteBigQueryExportRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.DeleteBigQueryExportRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -3420,9 +3489,10 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.DeleteBigQueryExportRequest() ); - const defaultValue1 = getTypeDefaultValue('DeleteBigQueryExportRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.DeleteBigQueryExportRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -3466,9 +3536,10 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.DeleteBigQueryExportRequest() ); - const defaultValue1 = getTypeDefaultValue('DeleteBigQueryExportRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.DeleteBigQueryExportRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); @@ -3496,9 +3567,10 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.DeleteBigQueryExportRequest() ); - const defaultValue1 = getTypeDefaultValue('DeleteBigQueryExportRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.DeleteBigQueryExportRequest', + ['name'] + ); request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); @@ -3517,10 +3589,10 @@ describe('v1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1.UpdateBigQueryExportRequest() ); request.bigQueryExport ??= {}; - const defaultValue1 = getTypeDefaultValue('UpdateBigQueryExportRequest', [ - 'bigQueryExport', - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.UpdateBigQueryExportRequest', + ['bigQueryExport', 'name'] + ); request.bigQueryExport.name = defaultValue1; const expectedHeaderRequestParams = `big_query_export.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -3550,10 +3622,10 @@ describe('v1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1.UpdateBigQueryExportRequest() ); request.bigQueryExport ??= {}; - const defaultValue1 = getTypeDefaultValue('UpdateBigQueryExportRequest', [ - 'bigQueryExport', - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.UpdateBigQueryExportRequest', + ['bigQueryExport', 'name'] + ); request.bigQueryExport.name = defaultValue1; const expectedHeaderRequestParams = `big_query_export.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -3598,10 +3670,10 @@ describe('v1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1.UpdateBigQueryExportRequest() ); request.bigQueryExport ??= {}; - const defaultValue1 = getTypeDefaultValue('UpdateBigQueryExportRequest', [ - 'bigQueryExport', - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.UpdateBigQueryExportRequest', + ['bigQueryExport', 'name'] + ); request.bigQueryExport.name = defaultValue1; const expectedHeaderRequestParams = `big_query_export.name=${defaultValue1}`; const expectedError = new Error('expected'); @@ -3630,10 +3702,10 @@ describe('v1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1.UpdateBigQueryExportRequest() ); request.bigQueryExport ??= {}; - const defaultValue1 = getTypeDefaultValue('UpdateBigQueryExportRequest', [ - 'bigQueryExport', - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.UpdateBigQueryExportRequest', + ['bigQueryExport', 'name'] + ); request.bigQueryExport.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); @@ -3651,9 +3723,10 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.BulkMuteFindingsRequest() ); - const defaultValue1 = getTypeDefaultValue('BulkMuteFindingsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.BulkMuteFindingsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -3683,9 +3756,10 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.BulkMuteFindingsRequest() ); - const defaultValue1 = getTypeDefaultValue('BulkMuteFindingsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.BulkMuteFindingsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -3736,9 +3810,10 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.BulkMuteFindingsRequest() ); - const defaultValue1 = getTypeDefaultValue('BulkMuteFindingsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.BulkMuteFindingsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); @@ -3766,9 +3841,10 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.BulkMuteFindingsRequest() ); - const defaultValue1 = getTypeDefaultValue('BulkMuteFindingsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.BulkMuteFindingsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); @@ -3841,9 +3917,10 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.RunAssetDiscoveryRequest() ); - const defaultValue1 = getTypeDefaultValue('RunAssetDiscoveryRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.RunAssetDiscoveryRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -3873,9 +3950,10 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.RunAssetDiscoveryRequest() ); - const defaultValue1 = getTypeDefaultValue('RunAssetDiscoveryRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.RunAssetDiscoveryRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -3926,9 +4004,10 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.RunAssetDiscoveryRequest() ); - const defaultValue1 = getTypeDefaultValue('RunAssetDiscoveryRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.RunAssetDiscoveryRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); @@ -3956,9 +4035,10 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.RunAssetDiscoveryRequest() ); - const defaultValue1 = getTypeDefaultValue('RunAssetDiscoveryRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.RunAssetDiscoveryRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); @@ -4031,9 +4111,10 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.GroupAssetsRequest() ); - const defaultValue1 = getTypeDefaultValue('GroupAssetsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.GroupAssetsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ @@ -4069,9 +4150,10 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.GroupAssetsRequest() ); - const defaultValue1 = getTypeDefaultValue('GroupAssetsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.GroupAssetsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ @@ -4123,9 +4205,10 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.GroupAssetsRequest() ); - const defaultValue1 = getTypeDefaultValue('GroupAssetsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.GroupAssetsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); @@ -4153,9 +4236,10 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.GroupAssetsRequest() ); - const defaultValue1 = getTypeDefaultValue('GroupAssetsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.GroupAssetsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ @@ -4213,9 +4297,10 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.GroupAssetsRequest() ); - const defaultValue1 = getTypeDefaultValue('GroupAssetsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.GroupAssetsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); @@ -4264,9 +4349,10 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.GroupAssetsRequest() ); - const defaultValue1 = getTypeDefaultValue('GroupAssetsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.GroupAssetsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ @@ -4313,9 +4399,10 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.GroupAssetsRequest() ); - const defaultValue1 = getTypeDefaultValue('GroupAssetsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.GroupAssetsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); @@ -4357,9 +4444,10 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.GroupFindingsRequest() ); - const defaultValue1 = getTypeDefaultValue('GroupFindingsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.GroupFindingsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ @@ -4395,9 +4483,10 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.GroupFindingsRequest() ); - const defaultValue1 = getTypeDefaultValue('GroupFindingsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.GroupFindingsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ @@ -4449,9 +4538,10 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.GroupFindingsRequest() ); - const defaultValue1 = getTypeDefaultValue('GroupFindingsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.GroupFindingsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); @@ -4479,9 +4569,10 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.GroupFindingsRequest() ); - const defaultValue1 = getTypeDefaultValue('GroupFindingsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.GroupFindingsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ @@ -4539,9 +4630,10 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.GroupFindingsRequest() ); - const defaultValue1 = getTypeDefaultValue('GroupFindingsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.GroupFindingsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); @@ -4588,9 +4680,10 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.GroupFindingsRequest() ); - const defaultValue1 = getTypeDefaultValue('GroupFindingsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.GroupFindingsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ @@ -4637,9 +4730,10 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.GroupFindingsRequest() ); - const defaultValue1 = getTypeDefaultValue('GroupFindingsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.GroupFindingsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); @@ -4679,9 +4773,10 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.ListAssetsRequest() ); - const defaultValue1 = getTypeDefaultValue('ListAssetsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.ListAssetsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ @@ -4717,9 +4812,10 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.ListAssetsRequest() ); - const defaultValue1 = getTypeDefaultValue('ListAssetsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.ListAssetsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ @@ -4773,9 +4869,10 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.ListAssetsRequest() ); - const defaultValue1 = getTypeDefaultValue('ListAssetsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.ListAssetsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); @@ -4803,9 +4900,10 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.ListAssetsRequest() ); - const defaultValue1 = getTypeDefaultValue('ListAssetsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.ListAssetsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ @@ -4865,9 +4963,10 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.ListAssetsRequest() ); - const defaultValue1 = getTypeDefaultValue('ListAssetsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.ListAssetsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); @@ -4918,9 +5017,10 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.ListAssetsRequest() ); - const defaultValue1 = getTypeDefaultValue('ListAssetsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.ListAssetsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ @@ -4967,9 +5067,10 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.ListAssetsRequest() ); - const defaultValue1 = getTypeDefaultValue('ListAssetsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.ListAssetsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); @@ -5011,9 +5112,10 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.ListFindingsRequest() ); - const defaultValue1 = getTypeDefaultValue('ListFindingsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.ListFindingsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ @@ -5049,9 +5151,10 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.ListFindingsRequest() ); - const defaultValue1 = getTypeDefaultValue('ListFindingsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.ListFindingsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ @@ -5105,9 +5208,10 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.ListFindingsRequest() ); - const defaultValue1 = getTypeDefaultValue('ListFindingsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.ListFindingsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); @@ -5135,9 +5239,10 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.ListFindingsRequest() ); - const defaultValue1 = getTypeDefaultValue('ListFindingsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.ListFindingsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ @@ -5197,9 +5302,10 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.ListFindingsRequest() ); - const defaultValue1 = getTypeDefaultValue('ListFindingsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.ListFindingsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); @@ -5250,9 +5356,10 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.ListFindingsRequest() ); - const defaultValue1 = getTypeDefaultValue('ListFindingsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.ListFindingsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ @@ -5299,9 +5406,10 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.ListFindingsRequest() ); - const defaultValue1 = getTypeDefaultValue('ListFindingsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.ListFindingsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); @@ -5341,9 +5449,10 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.ListMuteConfigsRequest() ); - const defaultValue1 = getTypeDefaultValue('ListMuteConfigsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.ListMuteConfigsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ @@ -5379,9 +5488,10 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.ListMuteConfigsRequest() ); - const defaultValue1 = getTypeDefaultValue('ListMuteConfigsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.ListMuteConfigsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ @@ -5433,9 +5543,10 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.ListMuteConfigsRequest() ); - const defaultValue1 = getTypeDefaultValue('ListMuteConfigsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.ListMuteConfigsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); @@ -5463,9 +5574,10 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.ListMuteConfigsRequest() ); - const defaultValue1 = getTypeDefaultValue('ListMuteConfigsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.ListMuteConfigsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ @@ -5523,9 +5635,10 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.ListMuteConfigsRequest() ); - const defaultValue1 = getTypeDefaultValue('ListMuteConfigsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.ListMuteConfigsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); @@ -5572,9 +5685,10 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.ListMuteConfigsRequest() ); - const defaultValue1 = getTypeDefaultValue('ListMuteConfigsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.ListMuteConfigsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ @@ -5620,9 +5734,10 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.ListMuteConfigsRequest() ); - const defaultValue1 = getTypeDefaultValue('ListMuteConfigsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.ListMuteConfigsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); @@ -5663,7 +5778,7 @@ describe('v1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1.ListNotificationConfigsRequest() ); const defaultValue1 = getTypeDefaultValue( - 'ListNotificationConfigsRequest', + '.google.cloud.securitycenter.v1.ListNotificationConfigsRequest', ['parent'] ); request.parent = defaultValue1; @@ -5703,7 +5818,7 @@ describe('v1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1.ListNotificationConfigsRequest() ); const defaultValue1 = getTypeDefaultValue( - 'ListNotificationConfigsRequest', + '.google.cloud.securitycenter.v1.ListNotificationConfigsRequest', ['parent'] ); request.parent = defaultValue1; @@ -5760,7 +5875,7 @@ describe('v1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1.ListNotificationConfigsRequest() ); const defaultValue1 = getTypeDefaultValue( - 'ListNotificationConfigsRequest', + '.google.cloud.securitycenter.v1.ListNotificationConfigsRequest', ['parent'] ); request.parent = defaultValue1; @@ -5794,7 +5909,7 @@ describe('v1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1.ListNotificationConfigsRequest() ); const defaultValue1 = getTypeDefaultValue( - 'ListNotificationConfigsRequest', + '.google.cloud.securitycenter.v1.ListNotificationConfigsRequest', ['parent'] ); request.parent = defaultValue1; @@ -5863,7 +5978,7 @@ describe('v1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1.ListNotificationConfigsRequest() ); const defaultValue1 = getTypeDefaultValue( - 'ListNotificationConfigsRequest', + '.google.cloud.securitycenter.v1.ListNotificationConfigsRequest', ['parent'] ); request.parent = defaultValue1; @@ -5921,7 +6036,7 @@ describe('v1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1.ListNotificationConfigsRequest() ); const defaultValue1 = getTypeDefaultValue( - 'ListNotificationConfigsRequest', + '.google.cloud.securitycenter.v1.ListNotificationConfigsRequest', ['parent'] ); request.parent = defaultValue1; @@ -5975,7 +6090,7 @@ describe('v1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1.ListNotificationConfigsRequest() ); const defaultValue1 = getTypeDefaultValue( - 'ListNotificationConfigsRequest', + '.google.cloud.securitycenter.v1.ListNotificationConfigsRequest', ['parent'] ); request.parent = defaultValue1; @@ -6021,9 +6136,10 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.ListSourcesRequest() ); - const defaultValue1 = getTypeDefaultValue('ListSourcesRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.ListSourcesRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ @@ -6059,9 +6175,10 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.ListSourcesRequest() ); - const defaultValue1 = getTypeDefaultValue('ListSourcesRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.ListSourcesRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ @@ -6113,9 +6230,10 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.ListSourcesRequest() ); - const defaultValue1 = getTypeDefaultValue('ListSourcesRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.ListSourcesRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); @@ -6143,9 +6261,10 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.ListSourcesRequest() ); - const defaultValue1 = getTypeDefaultValue('ListSourcesRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.ListSourcesRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ @@ -6202,9 +6321,10 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.ListSourcesRequest() ); - const defaultValue1 = getTypeDefaultValue('ListSourcesRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.ListSourcesRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); @@ -6252,9 +6372,10 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.ListSourcesRequest() ); - const defaultValue1 = getTypeDefaultValue('ListSourcesRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.ListSourcesRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ @@ -6300,9 +6421,10 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.ListSourcesRequest() ); - const defaultValue1 = getTypeDefaultValue('ListSourcesRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.ListSourcesRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); @@ -6343,9 +6465,10 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.ListBigQueryExportsRequest() ); - const defaultValue1 = getTypeDefaultValue('ListBigQueryExportsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.ListBigQueryExportsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ @@ -6382,9 +6505,10 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.ListBigQueryExportsRequest() ); - const defaultValue1 = getTypeDefaultValue('ListBigQueryExportsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.ListBigQueryExportsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ @@ -6438,9 +6562,10 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.ListBigQueryExportsRequest() ); - const defaultValue1 = getTypeDefaultValue('ListBigQueryExportsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.ListBigQueryExportsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); @@ -6468,9 +6593,10 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.ListBigQueryExportsRequest() ); - const defaultValue1 = getTypeDefaultValue('ListBigQueryExportsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.ListBigQueryExportsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ @@ -6528,9 +6654,10 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.ListBigQueryExportsRequest() ); - const defaultValue1 = getTypeDefaultValue('ListBigQueryExportsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.ListBigQueryExportsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); @@ -6577,9 +6704,10 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.ListBigQueryExportsRequest() ); - const defaultValue1 = getTypeDefaultValue('ListBigQueryExportsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.ListBigQueryExportsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ @@ -6626,9 +6754,10 @@ describe('v1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1.ListBigQueryExportsRequest() ); - const defaultValue1 = getTypeDefaultValue('ListBigQueryExportsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.ListBigQueryExportsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); diff --git a/packages/google-cloud-securitycenter/test/gapic_security_center_v1beta1.ts b/packages/google-cloud-securitycenter/test/gapic_security_center_v1beta1.ts index 5b733e936ba..01bb5be2f6e 100644 --- a/packages/google-cloud-securitycenter/test/gapic_security_center_v1beta1.ts +++ b/packages/google-cloud-securitycenter/test/gapic_security_center_v1beta1.ts @@ -269,9 +269,10 @@ describe('v1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1beta1.CreateSourceRequest() ); - const defaultValue1 = getTypeDefaultValue('CreateSourceRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1beta1.CreateSourceRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -299,9 +300,10 @@ describe('v1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1beta1.CreateSourceRequest() ); - const defaultValue1 = getTypeDefaultValue('CreateSourceRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1beta1.CreateSourceRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -345,9 +347,10 @@ describe('v1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1beta1.CreateSourceRequest() ); - const defaultValue1 = getTypeDefaultValue('CreateSourceRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1beta1.CreateSourceRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); @@ -375,9 +378,10 @@ describe('v1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1beta1.CreateSourceRequest() ); - const defaultValue1 = getTypeDefaultValue('CreateSourceRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1beta1.CreateSourceRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); @@ -395,9 +399,10 @@ describe('v1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1beta1.CreateFindingRequest() ); - const defaultValue1 = getTypeDefaultValue('CreateFindingRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1beta1.CreateFindingRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -425,9 +430,10 @@ describe('v1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1beta1.CreateFindingRequest() ); - const defaultValue1 = getTypeDefaultValue('CreateFindingRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1beta1.CreateFindingRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -471,9 +477,10 @@ describe('v1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1beta1.CreateFindingRequest() ); - const defaultValue1 = getTypeDefaultValue('CreateFindingRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1beta1.CreateFindingRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); @@ -501,9 +508,10 @@ describe('v1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1beta1.CreateFindingRequest() ); - const defaultValue1 = getTypeDefaultValue('CreateFindingRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1beta1.CreateFindingRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); @@ -521,9 +529,10 @@ describe('v1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.iam.v1.GetIamPolicyRequest() ); - const defaultValue1 = getTypeDefaultValue('GetIamPolicyRequest', [ - 'resource', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.GetIamPolicyRequest', + ['resource'] + ); request.resource = defaultValue1; const expectedHeaderRequestParams = `resource=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -551,9 +560,10 @@ describe('v1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.iam.v1.GetIamPolicyRequest() ); - const defaultValue1 = getTypeDefaultValue('GetIamPolicyRequest', [ - 'resource', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.GetIamPolicyRequest', + ['resource'] + ); request.resource = defaultValue1; const expectedHeaderRequestParams = `resource=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -597,9 +607,10 @@ describe('v1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.iam.v1.GetIamPolicyRequest() ); - const defaultValue1 = getTypeDefaultValue('GetIamPolicyRequest', [ - 'resource', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.GetIamPolicyRequest', + ['resource'] + ); request.resource = defaultValue1; const expectedHeaderRequestParams = `resource=${defaultValue1}`; const expectedError = new Error('expected'); @@ -627,9 +638,10 @@ describe('v1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.iam.v1.GetIamPolicyRequest() ); - const defaultValue1 = getTypeDefaultValue('GetIamPolicyRequest', [ - 'resource', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.GetIamPolicyRequest', + ['resource'] + ); request.resource = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); @@ -648,7 +660,7 @@ describe('v1beta1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest() ); const defaultValue1 = getTypeDefaultValue( - 'GetOrganizationSettingsRequest', + '.google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest', ['name'] ); request.name = defaultValue1; @@ -680,7 +692,7 @@ describe('v1beta1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest() ); const defaultValue1 = getTypeDefaultValue( - 'GetOrganizationSettingsRequest', + '.google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest', ['name'] ); request.name = defaultValue1; @@ -727,7 +739,7 @@ describe('v1beta1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest() ); const defaultValue1 = getTypeDefaultValue( - 'GetOrganizationSettingsRequest', + '.google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest', ['name'] ); request.name = defaultValue1; @@ -761,7 +773,7 @@ describe('v1beta1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest() ); const defaultValue1 = getTypeDefaultValue( - 'GetOrganizationSettingsRequest', + '.google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest', ['name'] ); request.name = defaultValue1; @@ -784,7 +796,10 @@ describe('v1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1beta1.GetSourceRequest() ); - const defaultValue1 = getTypeDefaultValue('GetSourceRequest', ['name']); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1beta1.GetSourceRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -812,7 +827,10 @@ describe('v1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1beta1.GetSourceRequest() ); - const defaultValue1 = getTypeDefaultValue('GetSourceRequest', ['name']); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1beta1.GetSourceRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -856,7 +874,10 @@ describe('v1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1beta1.GetSourceRequest() ); - const defaultValue1 = getTypeDefaultValue('GetSourceRequest', ['name']); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1beta1.GetSourceRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); @@ -881,7 +902,10 @@ describe('v1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1beta1.GetSourceRequest() ); - const defaultValue1 = getTypeDefaultValue('GetSourceRequest', ['name']); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1beta1.GetSourceRequest', + ['name'] + ); request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); @@ -899,9 +923,10 @@ describe('v1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1beta1.SetFindingStateRequest() ); - const defaultValue1 = getTypeDefaultValue('SetFindingStateRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1beta1.SetFindingStateRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -929,9 +954,10 @@ describe('v1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1beta1.SetFindingStateRequest() ); - const defaultValue1 = getTypeDefaultValue('SetFindingStateRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1beta1.SetFindingStateRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -975,9 +1001,10 @@ describe('v1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1beta1.SetFindingStateRequest() ); - const defaultValue1 = getTypeDefaultValue('SetFindingStateRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1beta1.SetFindingStateRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); @@ -1005,9 +1032,10 @@ describe('v1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1beta1.SetFindingStateRequest() ); - const defaultValue1 = getTypeDefaultValue('SetFindingStateRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1beta1.SetFindingStateRequest', + ['name'] + ); request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); @@ -1025,9 +1053,10 @@ describe('v1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.iam.v1.SetIamPolicyRequest() ); - const defaultValue1 = getTypeDefaultValue('SetIamPolicyRequest', [ - 'resource', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.SetIamPolicyRequest', + ['resource'] + ); request.resource = defaultValue1; const expectedHeaderRequestParams = `resource=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -1055,9 +1084,10 @@ describe('v1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.iam.v1.SetIamPolicyRequest() ); - const defaultValue1 = getTypeDefaultValue('SetIamPolicyRequest', [ - 'resource', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.SetIamPolicyRequest', + ['resource'] + ); request.resource = defaultValue1; const expectedHeaderRequestParams = `resource=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -1101,9 +1131,10 @@ describe('v1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.iam.v1.SetIamPolicyRequest() ); - const defaultValue1 = getTypeDefaultValue('SetIamPolicyRequest', [ - 'resource', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.SetIamPolicyRequest', + ['resource'] + ); request.resource = defaultValue1; const expectedHeaderRequestParams = `resource=${defaultValue1}`; const expectedError = new Error('expected'); @@ -1131,9 +1162,10 @@ describe('v1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.iam.v1.SetIamPolicyRequest() ); - const defaultValue1 = getTypeDefaultValue('SetIamPolicyRequest', [ - 'resource', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.SetIamPolicyRequest', + ['resource'] + ); request.resource = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); @@ -1151,9 +1183,10 @@ describe('v1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.iam.v1.TestIamPermissionsRequest() ); - const defaultValue1 = getTypeDefaultValue('TestIamPermissionsRequest', [ - 'resource', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.TestIamPermissionsRequest', + ['resource'] + ); request.resource = defaultValue1; const expectedHeaderRequestParams = `resource=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -1182,9 +1215,10 @@ describe('v1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.iam.v1.TestIamPermissionsRequest() ); - const defaultValue1 = getTypeDefaultValue('TestIamPermissionsRequest', [ - 'resource', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.TestIamPermissionsRequest', + ['resource'] + ); request.resource = defaultValue1; const expectedHeaderRequestParams = `resource=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -1228,9 +1262,10 @@ describe('v1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.iam.v1.TestIamPermissionsRequest() ); - const defaultValue1 = getTypeDefaultValue('TestIamPermissionsRequest', [ - 'resource', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.TestIamPermissionsRequest', + ['resource'] + ); request.resource = defaultValue1; const expectedHeaderRequestParams = `resource=${defaultValue1}`; const expectedError = new Error('expected'); @@ -1258,9 +1293,10 @@ describe('v1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.iam.v1.TestIamPermissionsRequest() ); - const defaultValue1 = getTypeDefaultValue('TestIamPermissionsRequest', [ - 'resource', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.TestIamPermissionsRequest', + ['resource'] + ); request.resource = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); @@ -1279,10 +1315,10 @@ describe('v1beta1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1beta1.UpdateFindingRequest() ); request.finding ??= {}; - const defaultValue1 = getTypeDefaultValue('UpdateFindingRequest', [ - 'finding', - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1beta1.UpdateFindingRequest', + ['finding', 'name'] + ); request.finding.name = defaultValue1; const expectedHeaderRequestParams = `finding.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -1311,10 +1347,10 @@ describe('v1beta1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1beta1.UpdateFindingRequest() ); request.finding ??= {}; - const defaultValue1 = getTypeDefaultValue('UpdateFindingRequest', [ - 'finding', - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1beta1.UpdateFindingRequest', + ['finding', 'name'] + ); request.finding.name = defaultValue1; const expectedHeaderRequestParams = `finding.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -1359,10 +1395,10 @@ describe('v1beta1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1beta1.UpdateFindingRequest() ); request.finding ??= {}; - const defaultValue1 = getTypeDefaultValue('UpdateFindingRequest', [ - 'finding', - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1beta1.UpdateFindingRequest', + ['finding', 'name'] + ); request.finding.name = defaultValue1; const expectedHeaderRequestParams = `finding.name=${defaultValue1}`; const expectedError = new Error('expected'); @@ -1391,10 +1427,10 @@ describe('v1beta1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1beta1.UpdateFindingRequest() ); request.finding ??= {}; - const defaultValue1 = getTypeDefaultValue('UpdateFindingRequest', [ - 'finding', - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1beta1.UpdateFindingRequest', + ['finding', 'name'] + ); request.finding.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); @@ -1414,7 +1450,7 @@ describe('v1beta1.SecurityCenterClient', () => { ); request.organizationSettings ??= {}; const defaultValue1 = getTypeDefaultValue( - 'UpdateOrganizationSettingsRequest', + '.google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest', ['organizationSettings', 'name'] ); request.organizationSettings.name = defaultValue1; @@ -1447,7 +1483,7 @@ describe('v1beta1.SecurityCenterClient', () => { ); request.organizationSettings ??= {}; const defaultValue1 = getTypeDefaultValue( - 'UpdateOrganizationSettingsRequest', + '.google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest', ['organizationSettings', 'name'] ); request.organizationSettings.name = defaultValue1; @@ -1495,7 +1531,7 @@ describe('v1beta1.SecurityCenterClient', () => { ); request.organizationSettings ??= {}; const defaultValue1 = getTypeDefaultValue( - 'UpdateOrganizationSettingsRequest', + '.google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest', ['organizationSettings', 'name'] ); request.organizationSettings.name = defaultValue1; @@ -1530,7 +1566,7 @@ describe('v1beta1.SecurityCenterClient', () => { ); request.organizationSettings ??= {}; const defaultValue1 = getTypeDefaultValue( - 'UpdateOrganizationSettingsRequest', + '.google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest', ['organizationSettings', 'name'] ); request.organizationSettings.name = defaultValue1; @@ -1554,10 +1590,10 @@ describe('v1beta1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1beta1.UpdateSourceRequest() ); request.source ??= {}; - const defaultValue1 = getTypeDefaultValue('UpdateSourceRequest', [ - 'source', - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1beta1.UpdateSourceRequest', + ['source', 'name'] + ); request.source.name = defaultValue1; const expectedHeaderRequestParams = `source.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -1586,10 +1622,10 @@ describe('v1beta1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1beta1.UpdateSourceRequest() ); request.source ??= {}; - const defaultValue1 = getTypeDefaultValue('UpdateSourceRequest', [ - 'source', - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1beta1.UpdateSourceRequest', + ['source', 'name'] + ); request.source.name = defaultValue1; const expectedHeaderRequestParams = `source.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -1634,10 +1670,10 @@ describe('v1beta1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1beta1.UpdateSourceRequest() ); request.source ??= {}; - const defaultValue1 = getTypeDefaultValue('UpdateSourceRequest', [ - 'source', - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1beta1.UpdateSourceRequest', + ['source', 'name'] + ); request.source.name = defaultValue1; const expectedHeaderRequestParams = `source.name=${defaultValue1}`; const expectedError = new Error('expected'); @@ -1666,10 +1702,10 @@ describe('v1beta1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1beta1.UpdateSourceRequest() ); request.source ??= {}; - const defaultValue1 = getTypeDefaultValue('UpdateSourceRequest', [ - 'source', - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1beta1.UpdateSourceRequest', + ['source', 'name'] + ); request.source.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); @@ -1688,10 +1724,10 @@ describe('v1beta1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest() ); request.securityMarks ??= {}; - const defaultValue1 = getTypeDefaultValue('UpdateSecurityMarksRequest', [ - 'securityMarks', - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest', + ['securityMarks', 'name'] + ); request.securityMarks.name = defaultValue1; const expectedHeaderRequestParams = `security_marks.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -1721,10 +1757,10 @@ describe('v1beta1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest() ); request.securityMarks ??= {}; - const defaultValue1 = getTypeDefaultValue('UpdateSecurityMarksRequest', [ - 'securityMarks', - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest', + ['securityMarks', 'name'] + ); request.securityMarks.name = defaultValue1; const expectedHeaderRequestParams = `security_marks.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -1769,10 +1805,10 @@ describe('v1beta1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest() ); request.securityMarks ??= {}; - const defaultValue1 = getTypeDefaultValue('UpdateSecurityMarksRequest', [ - 'securityMarks', - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest', + ['securityMarks', 'name'] + ); request.securityMarks.name = defaultValue1; const expectedHeaderRequestParams = `security_marks.name=${defaultValue1}`; const expectedError = new Error('expected'); @@ -1801,10 +1837,10 @@ describe('v1beta1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest() ); request.securityMarks ??= {}; - const defaultValue1 = getTypeDefaultValue('UpdateSecurityMarksRequest', [ - 'securityMarks', - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest', + ['securityMarks', 'name'] + ); request.securityMarks.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); @@ -1822,9 +1858,10 @@ describe('v1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest() ); - const defaultValue1 = getTypeDefaultValue('RunAssetDiscoveryRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -1854,9 +1891,10 @@ describe('v1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest() ); - const defaultValue1 = getTypeDefaultValue('RunAssetDiscoveryRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -1907,9 +1945,10 @@ describe('v1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest() ); - const defaultValue1 = getTypeDefaultValue('RunAssetDiscoveryRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); @@ -1937,9 +1976,10 @@ describe('v1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest() ); - const defaultValue1 = getTypeDefaultValue('RunAssetDiscoveryRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); @@ -2012,9 +2052,10 @@ describe('v1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1beta1.GroupAssetsRequest() ); - const defaultValue1 = getTypeDefaultValue('GroupAssetsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1beta1.GroupAssetsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ @@ -2050,9 +2091,10 @@ describe('v1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1beta1.GroupAssetsRequest() ); - const defaultValue1 = getTypeDefaultValue('GroupAssetsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1beta1.GroupAssetsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ @@ -2106,9 +2148,10 @@ describe('v1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1beta1.GroupAssetsRequest() ); - const defaultValue1 = getTypeDefaultValue('GroupAssetsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1beta1.GroupAssetsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); @@ -2136,9 +2179,10 @@ describe('v1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1beta1.GroupAssetsRequest() ); - const defaultValue1 = getTypeDefaultValue('GroupAssetsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1beta1.GroupAssetsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ @@ -2198,9 +2242,10 @@ describe('v1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1beta1.GroupAssetsRequest() ); - const defaultValue1 = getTypeDefaultValue('GroupAssetsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1beta1.GroupAssetsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); @@ -2251,9 +2296,10 @@ describe('v1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1beta1.GroupAssetsRequest() ); - const defaultValue1 = getTypeDefaultValue('GroupAssetsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1beta1.GroupAssetsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ @@ -2300,9 +2346,10 @@ describe('v1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1beta1.GroupAssetsRequest() ); - const defaultValue1 = getTypeDefaultValue('GroupAssetsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1beta1.GroupAssetsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); @@ -2344,9 +2391,10 @@ describe('v1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1beta1.GroupFindingsRequest() ); - const defaultValue1 = getTypeDefaultValue('GroupFindingsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1beta1.GroupFindingsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ @@ -2382,9 +2430,10 @@ describe('v1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1beta1.GroupFindingsRequest() ); - const defaultValue1 = getTypeDefaultValue('GroupFindingsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1beta1.GroupFindingsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ @@ -2438,9 +2487,10 @@ describe('v1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1beta1.GroupFindingsRequest() ); - const defaultValue1 = getTypeDefaultValue('GroupFindingsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1beta1.GroupFindingsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); @@ -2468,9 +2518,10 @@ describe('v1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1beta1.GroupFindingsRequest() ); - const defaultValue1 = getTypeDefaultValue('GroupFindingsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1beta1.GroupFindingsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ @@ -2530,9 +2581,10 @@ describe('v1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1beta1.GroupFindingsRequest() ); - const defaultValue1 = getTypeDefaultValue('GroupFindingsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1beta1.GroupFindingsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); @@ -2581,9 +2633,10 @@ describe('v1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1beta1.GroupFindingsRequest() ); - const defaultValue1 = getTypeDefaultValue('GroupFindingsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1beta1.GroupFindingsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ @@ -2630,9 +2683,10 @@ describe('v1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1beta1.GroupFindingsRequest() ); - const defaultValue1 = getTypeDefaultValue('GroupFindingsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1beta1.GroupFindingsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); @@ -2672,9 +2726,10 @@ describe('v1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1beta1.ListAssetsRequest() ); - const defaultValue1 = getTypeDefaultValue('ListAssetsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1beta1.ListAssetsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ @@ -2710,9 +2765,10 @@ describe('v1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1beta1.ListAssetsRequest() ); - const defaultValue1 = getTypeDefaultValue('ListAssetsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1beta1.ListAssetsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ @@ -2766,9 +2822,10 @@ describe('v1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1beta1.ListAssetsRequest() ); - const defaultValue1 = getTypeDefaultValue('ListAssetsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1beta1.ListAssetsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); @@ -2796,9 +2853,10 @@ describe('v1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1beta1.ListAssetsRequest() ); - const defaultValue1 = getTypeDefaultValue('ListAssetsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1beta1.ListAssetsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ @@ -2858,9 +2916,10 @@ describe('v1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1beta1.ListAssetsRequest() ); - const defaultValue1 = getTypeDefaultValue('ListAssetsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1beta1.ListAssetsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); @@ -2911,9 +2970,10 @@ describe('v1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1beta1.ListAssetsRequest() ); - const defaultValue1 = getTypeDefaultValue('ListAssetsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1beta1.ListAssetsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ @@ -2960,9 +3020,10 @@ describe('v1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1beta1.ListAssetsRequest() ); - const defaultValue1 = getTypeDefaultValue('ListAssetsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1beta1.ListAssetsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); @@ -3004,9 +3065,10 @@ describe('v1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1beta1.ListFindingsRequest() ); - const defaultValue1 = getTypeDefaultValue('ListFindingsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1beta1.ListFindingsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ @@ -3042,9 +3104,10 @@ describe('v1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1beta1.ListFindingsRequest() ); - const defaultValue1 = getTypeDefaultValue('ListFindingsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1beta1.ListFindingsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ @@ -3098,9 +3161,10 @@ describe('v1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1beta1.ListFindingsRequest() ); - const defaultValue1 = getTypeDefaultValue('ListFindingsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1beta1.ListFindingsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); @@ -3128,9 +3192,10 @@ describe('v1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1beta1.ListFindingsRequest() ); - const defaultValue1 = getTypeDefaultValue('ListFindingsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1beta1.ListFindingsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ @@ -3188,9 +3253,10 @@ describe('v1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1beta1.ListFindingsRequest() ); - const defaultValue1 = getTypeDefaultValue('ListFindingsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1beta1.ListFindingsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); @@ -3239,9 +3305,10 @@ describe('v1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1beta1.ListFindingsRequest() ); - const defaultValue1 = getTypeDefaultValue('ListFindingsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1beta1.ListFindingsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ @@ -3288,9 +3355,10 @@ describe('v1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1beta1.ListFindingsRequest() ); - const defaultValue1 = getTypeDefaultValue('ListFindingsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1beta1.ListFindingsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); @@ -3330,9 +3398,10 @@ describe('v1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1beta1.ListSourcesRequest() ); - const defaultValue1 = getTypeDefaultValue('ListSourcesRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1beta1.ListSourcesRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ @@ -3368,9 +3437,10 @@ describe('v1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1beta1.ListSourcesRequest() ); - const defaultValue1 = getTypeDefaultValue('ListSourcesRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1beta1.ListSourcesRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ @@ -3422,9 +3492,10 @@ describe('v1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1beta1.ListSourcesRequest() ); - const defaultValue1 = getTypeDefaultValue('ListSourcesRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1beta1.ListSourcesRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); @@ -3452,9 +3523,10 @@ describe('v1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1beta1.ListSourcesRequest() ); - const defaultValue1 = getTypeDefaultValue('ListSourcesRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1beta1.ListSourcesRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ @@ -3512,9 +3584,10 @@ describe('v1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1beta1.ListSourcesRequest() ); - const defaultValue1 = getTypeDefaultValue('ListSourcesRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1beta1.ListSourcesRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); @@ -3563,9 +3636,10 @@ describe('v1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1beta1.ListSourcesRequest() ); - const defaultValue1 = getTypeDefaultValue('ListSourcesRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1beta1.ListSourcesRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ @@ -3612,9 +3686,10 @@ describe('v1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1beta1.ListSourcesRequest() ); - const defaultValue1 = getTypeDefaultValue('ListSourcesRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1beta1.ListSourcesRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); diff --git a/packages/google-cloud-securitycenter/test/gapic_security_center_v1p1beta1.ts b/packages/google-cloud-securitycenter/test/gapic_security_center_v1p1beta1.ts index 4ad7e2a5290..9209d73f46f 100644 --- a/packages/google-cloud-securitycenter/test/gapic_security_center_v1p1beta1.ts +++ b/packages/google-cloud-securitycenter/test/gapic_security_center_v1p1beta1.ts @@ -269,9 +269,10 @@ describe('v1p1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.CreateSourceRequest() ); - const defaultValue1 = getTypeDefaultValue('CreateSourceRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1p1beta1.CreateSourceRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -299,9 +300,10 @@ describe('v1p1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.CreateSourceRequest() ); - const defaultValue1 = getTypeDefaultValue('CreateSourceRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1p1beta1.CreateSourceRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -345,9 +347,10 @@ describe('v1p1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.CreateSourceRequest() ); - const defaultValue1 = getTypeDefaultValue('CreateSourceRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1p1beta1.CreateSourceRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); @@ -375,9 +378,10 @@ describe('v1p1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.CreateSourceRequest() ); - const defaultValue1 = getTypeDefaultValue('CreateSourceRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1p1beta1.CreateSourceRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); @@ -395,9 +399,10 @@ describe('v1p1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.CreateFindingRequest() ); - const defaultValue1 = getTypeDefaultValue('CreateFindingRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1p1beta1.CreateFindingRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -425,9 +430,10 @@ describe('v1p1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.CreateFindingRequest() ); - const defaultValue1 = getTypeDefaultValue('CreateFindingRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1p1beta1.CreateFindingRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -471,9 +477,10 @@ describe('v1p1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.CreateFindingRequest() ); - const defaultValue1 = getTypeDefaultValue('CreateFindingRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1p1beta1.CreateFindingRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); @@ -501,9 +508,10 @@ describe('v1p1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.CreateFindingRequest() ); - const defaultValue1 = getTypeDefaultValue('CreateFindingRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1p1beta1.CreateFindingRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); @@ -522,7 +530,7 @@ describe('v1p1beta1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1p1beta1.CreateNotificationConfigRequest() ); const defaultValue1 = getTypeDefaultValue( - 'CreateNotificationConfigRequest', + '.google.cloud.securitycenter.v1p1beta1.CreateNotificationConfigRequest', ['parent'] ); request.parent = defaultValue1; @@ -554,7 +562,7 @@ describe('v1p1beta1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1p1beta1.CreateNotificationConfigRequest() ); const defaultValue1 = getTypeDefaultValue( - 'CreateNotificationConfigRequest', + '.google.cloud.securitycenter.v1p1beta1.CreateNotificationConfigRequest', ['parent'] ); request.parent = defaultValue1; @@ -601,7 +609,7 @@ describe('v1p1beta1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1p1beta1.CreateNotificationConfigRequest() ); const defaultValue1 = getTypeDefaultValue( - 'CreateNotificationConfigRequest', + '.google.cloud.securitycenter.v1p1beta1.CreateNotificationConfigRequest', ['parent'] ); request.parent = defaultValue1; @@ -635,7 +643,7 @@ describe('v1p1beta1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1p1beta1.CreateNotificationConfigRequest() ); const defaultValue1 = getTypeDefaultValue( - 'CreateNotificationConfigRequest', + '.google.cloud.securitycenter.v1p1beta1.CreateNotificationConfigRequest', ['parent'] ); request.parent = defaultValue1; @@ -659,7 +667,7 @@ describe('v1p1beta1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1p1beta1.DeleteNotificationConfigRequest() ); const defaultValue1 = getTypeDefaultValue( - 'DeleteNotificationConfigRequest', + '.google.cloud.securitycenter.v1p1beta1.DeleteNotificationConfigRequest', ['name'] ); request.name = defaultValue1; @@ -691,7 +699,7 @@ describe('v1p1beta1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1p1beta1.DeleteNotificationConfigRequest() ); const defaultValue1 = getTypeDefaultValue( - 'DeleteNotificationConfigRequest', + '.google.cloud.securitycenter.v1p1beta1.DeleteNotificationConfigRequest', ['name'] ); request.name = defaultValue1; @@ -738,7 +746,7 @@ describe('v1p1beta1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1p1beta1.DeleteNotificationConfigRequest() ); const defaultValue1 = getTypeDefaultValue( - 'DeleteNotificationConfigRequest', + '.google.cloud.securitycenter.v1p1beta1.DeleteNotificationConfigRequest', ['name'] ); request.name = defaultValue1; @@ -772,7 +780,7 @@ describe('v1p1beta1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1p1beta1.DeleteNotificationConfigRequest() ); const defaultValue1 = getTypeDefaultValue( - 'DeleteNotificationConfigRequest', + '.google.cloud.securitycenter.v1p1beta1.DeleteNotificationConfigRequest', ['name'] ); request.name = defaultValue1; @@ -795,9 +803,10 @@ describe('v1p1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.iam.v1.GetIamPolicyRequest() ); - const defaultValue1 = getTypeDefaultValue('GetIamPolicyRequest', [ - 'resource', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.GetIamPolicyRequest', + ['resource'] + ); request.resource = defaultValue1; const expectedHeaderRequestParams = `resource=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -825,9 +834,10 @@ describe('v1p1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.iam.v1.GetIamPolicyRequest() ); - const defaultValue1 = getTypeDefaultValue('GetIamPolicyRequest', [ - 'resource', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.GetIamPolicyRequest', + ['resource'] + ); request.resource = defaultValue1; const expectedHeaderRequestParams = `resource=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -871,9 +881,10 @@ describe('v1p1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.iam.v1.GetIamPolicyRequest() ); - const defaultValue1 = getTypeDefaultValue('GetIamPolicyRequest', [ - 'resource', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.GetIamPolicyRequest', + ['resource'] + ); request.resource = defaultValue1; const expectedHeaderRequestParams = `resource=${defaultValue1}`; const expectedError = new Error('expected'); @@ -901,9 +912,10 @@ describe('v1p1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.iam.v1.GetIamPolicyRequest() ); - const defaultValue1 = getTypeDefaultValue('GetIamPolicyRequest', [ - 'resource', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.GetIamPolicyRequest', + ['resource'] + ); request.resource = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); @@ -922,7 +934,7 @@ describe('v1p1beta1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1p1beta1.GetNotificationConfigRequest() ); const defaultValue1 = getTypeDefaultValue( - 'GetNotificationConfigRequest', + '.google.cloud.securitycenter.v1p1beta1.GetNotificationConfigRequest', ['name'] ); request.name = defaultValue1; @@ -954,7 +966,7 @@ describe('v1p1beta1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1p1beta1.GetNotificationConfigRequest() ); const defaultValue1 = getTypeDefaultValue( - 'GetNotificationConfigRequest', + '.google.cloud.securitycenter.v1p1beta1.GetNotificationConfigRequest', ['name'] ); request.name = defaultValue1; @@ -1001,7 +1013,7 @@ describe('v1p1beta1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1p1beta1.GetNotificationConfigRequest() ); const defaultValue1 = getTypeDefaultValue( - 'GetNotificationConfigRequest', + '.google.cloud.securitycenter.v1p1beta1.GetNotificationConfigRequest', ['name'] ); request.name = defaultValue1; @@ -1035,7 +1047,7 @@ describe('v1p1beta1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1p1beta1.GetNotificationConfigRequest() ); const defaultValue1 = getTypeDefaultValue( - 'GetNotificationConfigRequest', + '.google.cloud.securitycenter.v1p1beta1.GetNotificationConfigRequest', ['name'] ); request.name = defaultValue1; @@ -1059,7 +1071,7 @@ describe('v1p1beta1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1p1beta1.GetOrganizationSettingsRequest() ); const defaultValue1 = getTypeDefaultValue( - 'GetOrganizationSettingsRequest', + '.google.cloud.securitycenter.v1p1beta1.GetOrganizationSettingsRequest', ['name'] ); request.name = defaultValue1; @@ -1091,7 +1103,7 @@ describe('v1p1beta1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1p1beta1.GetOrganizationSettingsRequest() ); const defaultValue1 = getTypeDefaultValue( - 'GetOrganizationSettingsRequest', + '.google.cloud.securitycenter.v1p1beta1.GetOrganizationSettingsRequest', ['name'] ); request.name = defaultValue1; @@ -1138,7 +1150,7 @@ describe('v1p1beta1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1p1beta1.GetOrganizationSettingsRequest() ); const defaultValue1 = getTypeDefaultValue( - 'GetOrganizationSettingsRequest', + '.google.cloud.securitycenter.v1p1beta1.GetOrganizationSettingsRequest', ['name'] ); request.name = defaultValue1; @@ -1172,7 +1184,7 @@ describe('v1p1beta1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1p1beta1.GetOrganizationSettingsRequest() ); const defaultValue1 = getTypeDefaultValue( - 'GetOrganizationSettingsRequest', + '.google.cloud.securitycenter.v1p1beta1.GetOrganizationSettingsRequest', ['name'] ); request.name = defaultValue1; @@ -1195,7 +1207,10 @@ describe('v1p1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.GetSourceRequest() ); - const defaultValue1 = getTypeDefaultValue('GetSourceRequest', ['name']); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1p1beta1.GetSourceRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -1223,7 +1238,10 @@ describe('v1p1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.GetSourceRequest() ); - const defaultValue1 = getTypeDefaultValue('GetSourceRequest', ['name']); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1p1beta1.GetSourceRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -1267,7 +1285,10 @@ describe('v1p1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.GetSourceRequest() ); - const defaultValue1 = getTypeDefaultValue('GetSourceRequest', ['name']); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1p1beta1.GetSourceRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); @@ -1292,7 +1313,10 @@ describe('v1p1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.GetSourceRequest() ); - const defaultValue1 = getTypeDefaultValue('GetSourceRequest', ['name']); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1p1beta1.GetSourceRequest', + ['name'] + ); request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); @@ -1310,9 +1334,10 @@ describe('v1p1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest() ); - const defaultValue1 = getTypeDefaultValue('SetFindingStateRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -1340,9 +1365,10 @@ describe('v1p1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest() ); - const defaultValue1 = getTypeDefaultValue('SetFindingStateRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -1386,9 +1412,10 @@ describe('v1p1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest() ); - const defaultValue1 = getTypeDefaultValue('SetFindingStateRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); @@ -1416,9 +1443,10 @@ describe('v1p1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest() ); - const defaultValue1 = getTypeDefaultValue('SetFindingStateRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest', + ['name'] + ); request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); @@ -1436,9 +1464,10 @@ describe('v1p1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.iam.v1.SetIamPolicyRequest() ); - const defaultValue1 = getTypeDefaultValue('SetIamPolicyRequest', [ - 'resource', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.SetIamPolicyRequest', + ['resource'] + ); request.resource = defaultValue1; const expectedHeaderRequestParams = `resource=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -1466,9 +1495,10 @@ describe('v1p1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.iam.v1.SetIamPolicyRequest() ); - const defaultValue1 = getTypeDefaultValue('SetIamPolicyRequest', [ - 'resource', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.SetIamPolicyRequest', + ['resource'] + ); request.resource = defaultValue1; const expectedHeaderRequestParams = `resource=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -1512,9 +1542,10 @@ describe('v1p1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.iam.v1.SetIamPolicyRequest() ); - const defaultValue1 = getTypeDefaultValue('SetIamPolicyRequest', [ - 'resource', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.SetIamPolicyRequest', + ['resource'] + ); request.resource = defaultValue1; const expectedHeaderRequestParams = `resource=${defaultValue1}`; const expectedError = new Error('expected'); @@ -1542,9 +1573,10 @@ describe('v1p1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.iam.v1.SetIamPolicyRequest() ); - const defaultValue1 = getTypeDefaultValue('SetIamPolicyRequest', [ - 'resource', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.SetIamPolicyRequest', + ['resource'] + ); request.resource = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); @@ -1562,9 +1594,10 @@ describe('v1p1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.iam.v1.TestIamPermissionsRequest() ); - const defaultValue1 = getTypeDefaultValue('TestIamPermissionsRequest', [ - 'resource', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.TestIamPermissionsRequest', + ['resource'] + ); request.resource = defaultValue1; const expectedHeaderRequestParams = `resource=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -1593,9 +1626,10 @@ describe('v1p1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.iam.v1.TestIamPermissionsRequest() ); - const defaultValue1 = getTypeDefaultValue('TestIamPermissionsRequest', [ - 'resource', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.TestIamPermissionsRequest', + ['resource'] + ); request.resource = defaultValue1; const expectedHeaderRequestParams = `resource=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -1639,9 +1673,10 @@ describe('v1p1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.iam.v1.TestIamPermissionsRequest() ); - const defaultValue1 = getTypeDefaultValue('TestIamPermissionsRequest', [ - 'resource', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.TestIamPermissionsRequest', + ['resource'] + ); request.resource = defaultValue1; const expectedHeaderRequestParams = `resource=${defaultValue1}`; const expectedError = new Error('expected'); @@ -1669,9 +1704,10 @@ describe('v1p1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.iam.v1.TestIamPermissionsRequest() ); - const defaultValue1 = getTypeDefaultValue('TestIamPermissionsRequest', [ - 'resource', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.TestIamPermissionsRequest', + ['resource'] + ); request.resource = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); @@ -1690,10 +1726,10 @@ describe('v1p1beta1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1p1beta1.UpdateFindingRequest() ); request.finding ??= {}; - const defaultValue1 = getTypeDefaultValue('UpdateFindingRequest', [ - 'finding', - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1p1beta1.UpdateFindingRequest', + ['finding', 'name'] + ); request.finding.name = defaultValue1; const expectedHeaderRequestParams = `finding.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -1722,10 +1758,10 @@ describe('v1p1beta1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1p1beta1.UpdateFindingRequest() ); request.finding ??= {}; - const defaultValue1 = getTypeDefaultValue('UpdateFindingRequest', [ - 'finding', - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1p1beta1.UpdateFindingRequest', + ['finding', 'name'] + ); request.finding.name = defaultValue1; const expectedHeaderRequestParams = `finding.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -1770,10 +1806,10 @@ describe('v1p1beta1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1p1beta1.UpdateFindingRequest() ); request.finding ??= {}; - const defaultValue1 = getTypeDefaultValue('UpdateFindingRequest', [ - 'finding', - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1p1beta1.UpdateFindingRequest', + ['finding', 'name'] + ); request.finding.name = defaultValue1; const expectedHeaderRequestParams = `finding.name=${defaultValue1}`; const expectedError = new Error('expected'); @@ -1802,10 +1838,10 @@ describe('v1p1beta1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1p1beta1.UpdateFindingRequest() ); request.finding ??= {}; - const defaultValue1 = getTypeDefaultValue('UpdateFindingRequest', [ - 'finding', - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1p1beta1.UpdateFindingRequest', + ['finding', 'name'] + ); request.finding.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); @@ -1825,7 +1861,7 @@ describe('v1p1beta1.SecurityCenterClient', () => { ); request.notificationConfig ??= {}; const defaultValue1 = getTypeDefaultValue( - 'UpdateNotificationConfigRequest', + '.google.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest', ['notificationConfig', 'name'] ); request.notificationConfig.name = defaultValue1; @@ -1858,7 +1894,7 @@ describe('v1p1beta1.SecurityCenterClient', () => { ); request.notificationConfig ??= {}; const defaultValue1 = getTypeDefaultValue( - 'UpdateNotificationConfigRequest', + '.google.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest', ['notificationConfig', 'name'] ); request.notificationConfig.name = defaultValue1; @@ -1906,7 +1942,7 @@ describe('v1p1beta1.SecurityCenterClient', () => { ); request.notificationConfig ??= {}; const defaultValue1 = getTypeDefaultValue( - 'UpdateNotificationConfigRequest', + '.google.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest', ['notificationConfig', 'name'] ); request.notificationConfig.name = defaultValue1; @@ -1941,7 +1977,7 @@ describe('v1p1beta1.SecurityCenterClient', () => { ); request.notificationConfig ??= {}; const defaultValue1 = getTypeDefaultValue( - 'UpdateNotificationConfigRequest', + '.google.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest', ['notificationConfig', 'name'] ); request.notificationConfig.name = defaultValue1; @@ -1966,7 +2002,7 @@ describe('v1p1beta1.SecurityCenterClient', () => { ); request.organizationSettings ??= {}; const defaultValue1 = getTypeDefaultValue( - 'UpdateOrganizationSettingsRequest', + '.google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest', ['organizationSettings', 'name'] ); request.organizationSettings.name = defaultValue1; @@ -1999,7 +2035,7 @@ describe('v1p1beta1.SecurityCenterClient', () => { ); request.organizationSettings ??= {}; const defaultValue1 = getTypeDefaultValue( - 'UpdateOrganizationSettingsRequest', + '.google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest', ['organizationSettings', 'name'] ); request.organizationSettings.name = defaultValue1; @@ -2047,7 +2083,7 @@ describe('v1p1beta1.SecurityCenterClient', () => { ); request.organizationSettings ??= {}; const defaultValue1 = getTypeDefaultValue( - 'UpdateOrganizationSettingsRequest', + '.google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest', ['organizationSettings', 'name'] ); request.organizationSettings.name = defaultValue1; @@ -2082,7 +2118,7 @@ describe('v1p1beta1.SecurityCenterClient', () => { ); request.organizationSettings ??= {}; const defaultValue1 = getTypeDefaultValue( - 'UpdateOrganizationSettingsRequest', + '.google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest', ['organizationSettings', 'name'] ); request.organizationSettings.name = defaultValue1; @@ -2106,10 +2142,10 @@ describe('v1p1beta1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1p1beta1.UpdateSourceRequest() ); request.source ??= {}; - const defaultValue1 = getTypeDefaultValue('UpdateSourceRequest', [ - 'source', - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1p1beta1.UpdateSourceRequest', + ['source', 'name'] + ); request.source.name = defaultValue1; const expectedHeaderRequestParams = `source.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -2138,10 +2174,10 @@ describe('v1p1beta1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1p1beta1.UpdateSourceRequest() ); request.source ??= {}; - const defaultValue1 = getTypeDefaultValue('UpdateSourceRequest', [ - 'source', - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1p1beta1.UpdateSourceRequest', + ['source', 'name'] + ); request.source.name = defaultValue1; const expectedHeaderRequestParams = `source.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -2186,10 +2222,10 @@ describe('v1p1beta1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1p1beta1.UpdateSourceRequest() ); request.source ??= {}; - const defaultValue1 = getTypeDefaultValue('UpdateSourceRequest', [ - 'source', - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1p1beta1.UpdateSourceRequest', + ['source', 'name'] + ); request.source.name = defaultValue1; const expectedHeaderRequestParams = `source.name=${defaultValue1}`; const expectedError = new Error('expected'); @@ -2218,10 +2254,10 @@ describe('v1p1beta1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1p1beta1.UpdateSourceRequest() ); request.source ??= {}; - const defaultValue1 = getTypeDefaultValue('UpdateSourceRequest', [ - 'source', - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1p1beta1.UpdateSourceRequest', + ['source', 'name'] + ); request.source.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); @@ -2240,10 +2276,10 @@ describe('v1p1beta1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest() ); request.securityMarks ??= {}; - const defaultValue1 = getTypeDefaultValue('UpdateSecurityMarksRequest', [ - 'securityMarks', - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest', + ['securityMarks', 'name'] + ); request.securityMarks.name = defaultValue1; const expectedHeaderRequestParams = `security_marks.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -2273,10 +2309,10 @@ describe('v1p1beta1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest() ); request.securityMarks ??= {}; - const defaultValue1 = getTypeDefaultValue('UpdateSecurityMarksRequest', [ - 'securityMarks', - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest', + ['securityMarks', 'name'] + ); request.securityMarks.name = defaultValue1; const expectedHeaderRequestParams = `security_marks.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -2321,10 +2357,10 @@ describe('v1p1beta1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest() ); request.securityMarks ??= {}; - const defaultValue1 = getTypeDefaultValue('UpdateSecurityMarksRequest', [ - 'securityMarks', - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest', + ['securityMarks', 'name'] + ); request.securityMarks.name = defaultValue1; const expectedHeaderRequestParams = `security_marks.name=${defaultValue1}`; const expectedError = new Error('expected'); @@ -2353,10 +2389,10 @@ describe('v1p1beta1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest() ); request.securityMarks ??= {}; - const defaultValue1 = getTypeDefaultValue('UpdateSecurityMarksRequest', [ - 'securityMarks', - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest', + ['securityMarks', 'name'] + ); request.securityMarks.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); @@ -2374,9 +2410,10 @@ describe('v1p1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryRequest() ); - const defaultValue1 = getTypeDefaultValue('RunAssetDiscoveryRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -2406,9 +2443,10 @@ describe('v1p1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryRequest() ); - const defaultValue1 = getTypeDefaultValue('RunAssetDiscoveryRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -2459,9 +2497,10 @@ describe('v1p1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryRequest() ); - const defaultValue1 = getTypeDefaultValue('RunAssetDiscoveryRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); @@ -2489,9 +2528,10 @@ describe('v1p1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryRequest() ); - const defaultValue1 = getTypeDefaultValue('RunAssetDiscoveryRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); @@ -2564,9 +2604,10 @@ describe('v1p1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest() ); - const defaultValue1 = getTypeDefaultValue('GroupAssetsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ @@ -2602,9 +2643,10 @@ describe('v1p1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest() ); - const defaultValue1 = getTypeDefaultValue('GroupAssetsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ @@ -2658,9 +2700,10 @@ describe('v1p1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest() ); - const defaultValue1 = getTypeDefaultValue('GroupAssetsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); @@ -2688,9 +2731,10 @@ describe('v1p1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest() ); - const defaultValue1 = getTypeDefaultValue('GroupAssetsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ @@ -2750,9 +2794,10 @@ describe('v1p1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest() ); - const defaultValue1 = getTypeDefaultValue('GroupAssetsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); @@ -2803,9 +2848,10 @@ describe('v1p1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest() ); - const defaultValue1 = getTypeDefaultValue('GroupAssetsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ @@ -2852,9 +2898,10 @@ describe('v1p1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest() ); - const defaultValue1 = getTypeDefaultValue('GroupAssetsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); @@ -2896,9 +2943,10 @@ describe('v1p1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest() ); - const defaultValue1 = getTypeDefaultValue('GroupFindingsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ @@ -2934,9 +2982,10 @@ describe('v1p1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest() ); - const defaultValue1 = getTypeDefaultValue('GroupFindingsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ @@ -2990,9 +3039,10 @@ describe('v1p1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest() ); - const defaultValue1 = getTypeDefaultValue('GroupFindingsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); @@ -3020,9 +3070,10 @@ describe('v1p1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest() ); - const defaultValue1 = getTypeDefaultValue('GroupFindingsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ @@ -3082,9 +3133,10 @@ describe('v1p1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest() ); - const defaultValue1 = getTypeDefaultValue('GroupFindingsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); @@ -3133,9 +3185,10 @@ describe('v1p1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest() ); - const defaultValue1 = getTypeDefaultValue('GroupFindingsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ @@ -3182,9 +3235,10 @@ describe('v1p1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest() ); - const defaultValue1 = getTypeDefaultValue('GroupFindingsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); @@ -3224,9 +3278,10 @@ describe('v1p1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.ListAssetsRequest() ); - const defaultValue1 = getTypeDefaultValue('ListAssetsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1p1beta1.ListAssetsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ @@ -3262,9 +3317,10 @@ describe('v1p1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.ListAssetsRequest() ); - const defaultValue1 = getTypeDefaultValue('ListAssetsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1p1beta1.ListAssetsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ @@ -3318,9 +3374,10 @@ describe('v1p1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.ListAssetsRequest() ); - const defaultValue1 = getTypeDefaultValue('ListAssetsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1p1beta1.ListAssetsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); @@ -3348,9 +3405,10 @@ describe('v1p1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.ListAssetsRequest() ); - const defaultValue1 = getTypeDefaultValue('ListAssetsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1p1beta1.ListAssetsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ @@ -3410,9 +3468,10 @@ describe('v1p1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.ListAssetsRequest() ); - const defaultValue1 = getTypeDefaultValue('ListAssetsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1p1beta1.ListAssetsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); @@ -3463,9 +3522,10 @@ describe('v1p1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.ListAssetsRequest() ); - const defaultValue1 = getTypeDefaultValue('ListAssetsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1p1beta1.ListAssetsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ @@ -3512,9 +3572,10 @@ describe('v1p1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.ListAssetsRequest() ); - const defaultValue1 = getTypeDefaultValue('ListAssetsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1p1beta1.ListAssetsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); @@ -3556,9 +3617,10 @@ describe('v1p1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.ListFindingsRequest() ); - const defaultValue1 = getTypeDefaultValue('ListFindingsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1p1beta1.ListFindingsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ @@ -3594,9 +3656,10 @@ describe('v1p1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.ListFindingsRequest() ); - const defaultValue1 = getTypeDefaultValue('ListFindingsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1p1beta1.ListFindingsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ @@ -3650,9 +3713,10 @@ describe('v1p1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.ListFindingsRequest() ); - const defaultValue1 = getTypeDefaultValue('ListFindingsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1p1beta1.ListFindingsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); @@ -3680,9 +3744,10 @@ describe('v1p1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.ListFindingsRequest() ); - const defaultValue1 = getTypeDefaultValue('ListFindingsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1p1beta1.ListFindingsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ @@ -3742,9 +3807,10 @@ describe('v1p1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.ListFindingsRequest() ); - const defaultValue1 = getTypeDefaultValue('ListFindingsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1p1beta1.ListFindingsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); @@ -3795,9 +3861,10 @@ describe('v1p1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.ListFindingsRequest() ); - const defaultValue1 = getTypeDefaultValue('ListFindingsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1p1beta1.ListFindingsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ @@ -3844,9 +3911,10 @@ describe('v1p1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.ListFindingsRequest() ); - const defaultValue1 = getTypeDefaultValue('ListFindingsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1p1beta1.ListFindingsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); @@ -3887,7 +3955,7 @@ describe('v1p1beta1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest() ); const defaultValue1 = getTypeDefaultValue( - 'ListNotificationConfigsRequest', + '.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest', ['parent'] ); request.parent = defaultValue1; @@ -3927,7 +3995,7 @@ describe('v1p1beta1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest() ); const defaultValue1 = getTypeDefaultValue( - 'ListNotificationConfigsRequest', + '.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest', ['parent'] ); request.parent = defaultValue1; @@ -3984,7 +4052,7 @@ describe('v1p1beta1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest() ); const defaultValue1 = getTypeDefaultValue( - 'ListNotificationConfigsRequest', + '.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest', ['parent'] ); request.parent = defaultValue1; @@ -4018,7 +4086,7 @@ describe('v1p1beta1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest() ); const defaultValue1 = getTypeDefaultValue( - 'ListNotificationConfigsRequest', + '.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest', ['parent'] ); request.parent = defaultValue1; @@ -4087,7 +4155,7 @@ describe('v1p1beta1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest() ); const defaultValue1 = getTypeDefaultValue( - 'ListNotificationConfigsRequest', + '.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest', ['parent'] ); request.parent = defaultValue1; @@ -4145,7 +4213,7 @@ describe('v1p1beta1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest() ); const defaultValue1 = getTypeDefaultValue( - 'ListNotificationConfigsRequest', + '.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest', ['parent'] ); request.parent = defaultValue1; @@ -4199,7 +4267,7 @@ describe('v1p1beta1.SecurityCenterClient', () => { new protos.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest() ); const defaultValue1 = getTypeDefaultValue( - 'ListNotificationConfigsRequest', + '.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest', ['parent'] ); request.parent = defaultValue1; @@ -4245,9 +4313,10 @@ describe('v1p1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.ListSourcesRequest() ); - const defaultValue1 = getTypeDefaultValue('ListSourcesRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1p1beta1.ListSourcesRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ @@ -4283,9 +4352,10 @@ describe('v1p1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.ListSourcesRequest() ); - const defaultValue1 = getTypeDefaultValue('ListSourcesRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1p1beta1.ListSourcesRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ @@ -4339,9 +4409,10 @@ describe('v1p1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.ListSourcesRequest() ); - const defaultValue1 = getTypeDefaultValue('ListSourcesRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1p1beta1.ListSourcesRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); @@ -4369,9 +4440,10 @@ describe('v1p1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.ListSourcesRequest() ); - const defaultValue1 = getTypeDefaultValue('ListSourcesRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1p1beta1.ListSourcesRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ @@ -4429,9 +4501,10 @@ describe('v1p1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.ListSourcesRequest() ); - const defaultValue1 = getTypeDefaultValue('ListSourcesRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1p1beta1.ListSourcesRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); @@ -4480,9 +4553,10 @@ describe('v1p1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.ListSourcesRequest() ); - const defaultValue1 = getTypeDefaultValue('ListSourcesRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1p1beta1.ListSourcesRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ @@ -4529,9 +4603,10 @@ describe('v1p1beta1.SecurityCenterClient', () => { const request = generateSampleMessage( new protos.google.cloud.securitycenter.v1p1beta1.ListSourcesRequest() ); - const defaultValue1 = getTypeDefaultValue('ListSourcesRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1p1beta1.ListSourcesRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); From 027969d7b20f3e1ad01c2c3d8fa518aee7c8457b Mon Sep 17 00:00:00 2001 From: Alexander Fenster Date: Thu, 3 Nov 2022 23:46:42 -0700 Subject: [PATCH 337/342] fix(deps): use google-gax v3.5.2 (#518) --- packages/google-cloud-securitycenter/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-securitycenter/package.json b/packages/google-cloud-securitycenter/package.json index 4a04cd50dde..2804fb58b45 100644 --- a/packages/google-cloud-securitycenter/package.json +++ b/packages/google-cloud-securitycenter/package.json @@ -42,7 +42,7 @@ "Security Command Center API" ], "dependencies": { - "google-gax": "^3.3.0" + "google-gax": "^3.5.2" }, "devDependencies": { "@types/mocha": "^9.0.0", From 738b395d67f7284223ae513934fc6a52ae2acb1e Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 10 Nov 2022 10:20:39 +0100 Subject: [PATCH 338/342] chore(deps): update dependency @types/node to v18 (#516) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [@types/node](https://togithub.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node) ([source](https://togithub.com/DefinitelyTyped/DefinitelyTyped)) | [`^16.0.0` -> `^18.0.0`](https://renovatebot.com/diffs/npm/@types%2fnode/16.18.3/18.11.9) | [![age](https://badges.renovateapi.com/packages/npm/@types%2fnode/18.11.9/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/@types%2fnode/18.11.9/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/@types%2fnode/18.11.9/compatibility-slim/16.18.3)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/@types%2fnode/18.11.9/confidence-slim/16.18.3)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration 📅 **Schedule**: Branch creation - "after 9am and before 3pm" (UTC), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/nodejs-security-center). --- packages/google-cloud-securitycenter/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-securitycenter/package.json b/packages/google-cloud-securitycenter/package.json index 2804fb58b45..d8397c482a1 100644 --- a/packages/google-cloud-securitycenter/package.json +++ b/packages/google-cloud-securitycenter/package.json @@ -46,7 +46,7 @@ }, "devDependencies": { "@types/mocha": "^9.0.0", - "@types/node": "^16.0.0", + "@types/node": "^18.0.0", "@types/sinon": "^10.0.0", "c8": "^7.0.0", "gts": "^3.1.0", From 5597e4230e7f29aa1c41eac1df851344d8c5cbf3 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 10 Nov 2022 10:50:36 +0100 Subject: [PATCH 339/342] chore(deps): update dependency jsdoc to v4 (#520) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [jsdoc](https://togithub.com/jsdoc/jsdoc) | [`^3.6.2` -> `^4.0.0`](https://renovatebot.com/diffs/npm/jsdoc/3.6.11/4.0.0) | [![age](https://badges.renovateapi.com/packages/npm/jsdoc/4.0.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/jsdoc/4.0.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/jsdoc/4.0.0/compatibility-slim/3.6.11)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/jsdoc/4.0.0/confidence-slim/3.6.11)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
jsdoc/jsdoc ### [`v4.0.0`](https://togithub.com/jsdoc/jsdoc/blob/HEAD/CHANGES.md#​400-November-2022) [Compare Source](https://togithub.com/jsdoc/jsdoc/compare/3.6.11...084218523a7d69fec14a852ce680f374f526af28) - JSDoc releases now use [semantic versioning](https://semver.org/). If JSDoc makes backwards-incompatible changes in the future, the major version will be incremented. - JSDoc no longer uses the [`taffydb`](https://taffydb.com/) package. If your JSDoc template or plugin uses the `taffydb` package, see the [instructions for replacing `taffydb` with `@jsdoc/salty`](https://togithub.com/jsdoc/jsdoc/tree/main/packages/jsdoc-salty#use-salty-in-a-jsdoc-template). - JSDoc now supports Node.js 12.0.0 and later.
--- ### Configuration 📅 **Schedule**: Branch creation - "after 9am and before 3pm" (UTC), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/nodejs-security-center). --- packages/google-cloud-securitycenter/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-securitycenter/package.json b/packages/google-cloud-securitycenter/package.json index d8397c482a1..c75b6b2362c 100644 --- a/packages/google-cloud-securitycenter/package.json +++ b/packages/google-cloud-securitycenter/package.json @@ -50,7 +50,7 @@ "@types/sinon": "^10.0.0", "c8": "^7.0.0", "gts": "^3.1.0", - "jsdoc": "^3.6.2", + "jsdoc": "^4.0.0", "jsdoc-fresh": "^2.0.0", "jsdoc-region-tag": "^2.0.0", "linkinator": "^4.0.0", From 9b39a05f45d5680f3327904b4a403cf3310e257d Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 10 Nov 2022 11:22:21 +0000 Subject: [PATCH 340/342] fix: regenerated protos JS and TS definitions (#521) samples: pull in latest typeless bot, clean up some comments Source-Link: https://togithub.com/googleapis/synthtool/commit/0a68e568b6911b60bb6fd452eba4848b176031d8 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-nodejs:latest@sha256:5b05f26103855c3a15433141389c478d1d3fe088fb5d4e3217c4793f6b3f245e --- .../protos/protos.d.ts | 2 +- .../protos/protos.js | 414 +++++++++++++++--- 2 files changed, 362 insertions(+), 54 deletions(-) diff --git a/packages/google-cloud-securitycenter/protos/protos.d.ts b/packages/google-cloud-securitycenter/protos/protos.d.ts index 2211096d1a2..ff8ff9f2d18 100644 --- a/packages/google-cloud-securitycenter/protos/protos.d.ts +++ b/packages/google-cloud-securitycenter/protos/protos.d.ts @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -import Long = require("long"); import type {protobuf as $protobuf} from "google-gax"; +import Long = require("long"); /** Namespace google. */ export namespace google { diff --git a/packages/google-cloud-securitycenter/protos/protos.js b/packages/google-cloud-securitycenter/protos/protos.js index a52036e6454..83ab8fe4384 100644 --- a/packages/google-cloud-securitycenter/protos/protos.js +++ b/packages/google-cloud-securitycenter/protos/protos.js @@ -3368,6 +3368,12 @@ if (object.sourcePort != null) message.sourcePort = object.sourcePort | 0; switch (object.protocol) { + default: + if (typeof object.protocol === "number") { + message.protocol = object.protocol; + break; + } + break; case "PROTOCOL_UNSPECIFIED": case 0: message.protocol = 0; @@ -3425,7 +3431,7 @@ if (message.sourcePort != null && message.hasOwnProperty("sourcePort")) object.sourcePort = message.sourcePort; if (message.protocol != null && message.hasOwnProperty("protocol")) - object.protocol = options.enums === String ? $root.google.cloud.securitycenter.v1.Connection.Protocol[message.protocol] : message.protocol; + object.protocol = options.enums === String ? $root.google.cloud.securitycenter.v1.Connection.Protocol[message.protocol] === undefined ? message.protocol : $root.google.cloud.securitycenter.v1.Connection.Protocol[message.protocol] : message.protocol; return object; }; @@ -6843,6 +6849,12 @@ if (object.resourceName != null) message.resourceName = String(object.resourceName); switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; case "STATE_UNSPECIFIED": case 0: message.state = 0; @@ -6886,6 +6898,12 @@ message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); } switch (object.severity) { + default: + if (typeof object.severity === "number") { + message.severity = object.severity; + break; + } + break; case "SEVERITY_UNSPECIFIED": case 0: message.severity = 0; @@ -6910,6 +6928,12 @@ if (object.canonicalName != null) message.canonicalName = String(object.canonicalName); switch (object.mute) { + default: + if (typeof object.mute === "number") { + message.mute = object.mute; + break; + } + break; case "MUTE_UNSPECIFIED": case 0: message.mute = 0; @@ -6928,6 +6952,12 @@ break; } switch (object.findingClass) { + default: + if (typeof object.findingClass === "number") { + message.findingClass = object.findingClass; + break; + } + break; case "FINDING_CLASS_UNSPECIFIED": case 0: message.findingClass = 0; @@ -7133,7 +7163,7 @@ if (message.resourceName != null && message.hasOwnProperty("resourceName")) object.resourceName = message.resourceName; if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.securitycenter.v1.Finding.State[message.state] : message.state; + object.state = options.enums === String ? $root.google.cloud.securitycenter.v1.Finding.State[message.state] === undefined ? message.state : $root.google.cloud.securitycenter.v1.Finding.State[message.state] : message.state; if (message.category != null && message.hasOwnProperty("category")) object.category = message.category; if (message.externalUri != null && message.hasOwnProperty("externalUri")) @@ -7151,13 +7181,13 @@ if (message.createTime != null && message.hasOwnProperty("createTime")) object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); if (message.severity != null && message.hasOwnProperty("severity")) - object.severity = options.enums === String ? $root.google.cloud.securitycenter.v1.Finding.Severity[message.severity] : message.severity; + object.severity = options.enums === String ? $root.google.cloud.securitycenter.v1.Finding.Severity[message.severity] === undefined ? message.severity : $root.google.cloud.securitycenter.v1.Finding.Severity[message.severity] : message.severity; if (message.canonicalName != null && message.hasOwnProperty("canonicalName")) object.canonicalName = message.canonicalName; if (message.mute != null && message.hasOwnProperty("mute")) - object.mute = options.enums === String ? $root.google.cloud.securitycenter.v1.Finding.Mute[message.mute] : message.mute; + object.mute = options.enums === String ? $root.google.cloud.securitycenter.v1.Finding.Mute[message.mute] === undefined ? message.mute : $root.google.cloud.securitycenter.v1.Finding.Mute[message.mute] : message.mute; if (message.findingClass != null && message.hasOwnProperty("findingClass")) - object.findingClass = options.enums === String ? $root.google.cloud.securitycenter.v1.Finding.FindingClass[message.findingClass] : message.findingClass; + object.findingClass = options.enums === String ? $root.google.cloud.securitycenter.v1.Finding.FindingClass[message.findingClass] === undefined ? message.findingClass : $root.google.cloud.securitycenter.v1.Finding.FindingClass[message.findingClass] : message.findingClass; if (message.indicator != null && message.hasOwnProperty("indicator")) object.indicator = $root.google.cloud.securitycenter.v1.Indicator.toObject(message.indicator, options); if (message.vulnerability != null && message.hasOwnProperty("vulnerability")) @@ -7517,6 +7547,12 @@ return object; var message = new $root.google.cloud.securitycenter.v1.IamBinding(); switch (object.action) { + default: + if (typeof object.action === "number") { + message.action = object.action; + break; + } + break; case "ACTION_UNSPECIFIED": case 0: message.action = 0; @@ -7556,7 +7592,7 @@ object.member = ""; } if (message.action != null && message.hasOwnProperty("action")) - object.action = options.enums === String ? $root.google.cloud.securitycenter.v1.IamBinding.Action[message.action] : message.action; + object.action = options.enums === String ? $root.google.cloud.securitycenter.v1.IamBinding.Action[message.action] === undefined ? message.action : $root.google.cloud.securitycenter.v1.IamBinding.Action[message.action] : message.action; if (message.role != null && message.hasOwnProperty("role")) object.role = message.role; if (message.member != null && message.hasOwnProperty("member")) @@ -10293,6 +10329,12 @@ return object; var message = new $root.google.cloud.securitycenter.v1.Kubernetes.Role(); switch (object.kind) { + default: + if (typeof object.kind === "number") { + message.kind = object.kind; + break; + } + break; case "KIND_UNSPECIFIED": case 0: message.kind = 0; @@ -10332,7 +10374,7 @@ object.name = ""; } if (message.kind != null && message.hasOwnProperty("kind")) - object.kind = options.enums === String ? $root.google.cloud.securitycenter.v1.Kubernetes.Role.Kind[message.kind] : message.kind; + object.kind = options.enums === String ? $root.google.cloud.securitycenter.v1.Kubernetes.Role.Kind[message.kind] === undefined ? message.kind : $root.google.cloud.securitycenter.v1.Kubernetes.Role.Kind[message.kind] : message.kind; if (message.ns != null && message.hasOwnProperty("ns")) object.ns = message.ns; if (message.name != null && message.hasOwnProperty("name")) @@ -10878,6 +10920,12 @@ return object; var message = new $root.google.cloud.securitycenter.v1.Kubernetes.Subject(); switch (object.kind) { + default: + if (typeof object.kind === "number") { + message.kind = object.kind; + break; + } + break; case "AUTH_TYPE_UNSPECIFIED": case 0: message.kind = 0; @@ -10921,7 +10969,7 @@ object.name = ""; } if (message.kind != null && message.hasOwnProperty("kind")) - object.kind = options.enums === String ? $root.google.cloud.securitycenter.v1.Kubernetes.Subject.AuthType[message.kind] : message.kind; + object.kind = options.enums === String ? $root.google.cloud.securitycenter.v1.Kubernetes.Subject.AuthType[message.kind] === undefined ? message.kind : $root.google.cloud.securitycenter.v1.Kubernetes.Subject.AuthType[message.kind] : message.kind; if (message.ns != null && message.hasOwnProperty("ns")) object.ns = message.ns; if (message.name != null && message.hasOwnProperty("name")) @@ -11703,6 +11751,12 @@ return object; var message = new $root.google.cloud.securitycenter.v1.MitreAttack(); switch (object.primaryTactic) { + default: + if (typeof object.primaryTactic === "number") { + message.primaryTactic = object.primaryTactic; + break; + } + break; case "TACTIC_UNSPECIFIED": case 0: message.primaryTactic = 0; @@ -11771,6 +11825,10 @@ for (var i = 0; i < object.primaryTechniques.length; ++i) switch (object.primaryTechniques[i]) { default: + if (typeof object.primaryTechniques[i] === "number") { + message.primaryTechniques[i] = object.primaryTechniques[i]; + break; + } case "TECHNIQUE_UNSPECIFIED": case 0: message.primaryTechniques[i] = 0; @@ -11920,6 +11978,10 @@ for (var i = 0; i < object.additionalTactics.length; ++i) switch (object.additionalTactics[i]) { default: + if (typeof object.additionalTactics[i] === "number") { + message.additionalTactics[i] = object.additionalTactics[i]; + break; + } case "TACTIC_UNSPECIFIED": case 0: message.additionalTactics[i] = 0; @@ -11989,6 +12051,10 @@ for (var i = 0; i < object.additionalTechniques.length; ++i) switch (object.additionalTechniques[i]) { default: + if (typeof object.additionalTechniques[i] === "number") { + message.additionalTechniques[i] = object.additionalTechniques[i]; + break; + } case "TECHNIQUE_UNSPECIFIED": case 0: message.additionalTechniques[i] = 0; @@ -12159,21 +12225,21 @@ object.version = ""; } if (message.primaryTactic != null && message.hasOwnProperty("primaryTactic")) - object.primaryTactic = options.enums === String ? $root.google.cloud.securitycenter.v1.MitreAttack.Tactic[message.primaryTactic] : message.primaryTactic; + object.primaryTactic = options.enums === String ? $root.google.cloud.securitycenter.v1.MitreAttack.Tactic[message.primaryTactic] === undefined ? message.primaryTactic : $root.google.cloud.securitycenter.v1.MitreAttack.Tactic[message.primaryTactic] : message.primaryTactic; if (message.primaryTechniques && message.primaryTechniques.length) { object.primaryTechniques = []; for (var j = 0; j < message.primaryTechniques.length; ++j) - object.primaryTechniques[j] = options.enums === String ? $root.google.cloud.securitycenter.v1.MitreAttack.Technique[message.primaryTechniques[j]] : message.primaryTechniques[j]; + object.primaryTechniques[j] = options.enums === String ? $root.google.cloud.securitycenter.v1.MitreAttack.Technique[message.primaryTechniques[j]] === undefined ? message.primaryTechniques[j] : $root.google.cloud.securitycenter.v1.MitreAttack.Technique[message.primaryTechniques[j]] : message.primaryTechniques[j]; } if (message.additionalTactics && message.additionalTactics.length) { object.additionalTactics = []; for (var j = 0; j < message.additionalTactics.length; ++j) - object.additionalTactics[j] = options.enums === String ? $root.google.cloud.securitycenter.v1.MitreAttack.Tactic[message.additionalTactics[j]] : message.additionalTactics[j]; + object.additionalTactics[j] = options.enums === String ? $root.google.cloud.securitycenter.v1.MitreAttack.Tactic[message.additionalTactics[j]] === undefined ? message.additionalTactics[j] : $root.google.cloud.securitycenter.v1.MitreAttack.Tactic[message.additionalTactics[j]] : message.additionalTactics[j]; } if (message.additionalTechniques && message.additionalTechniques.length) { object.additionalTechniques = []; for (var j = 0; j < message.additionalTechniques.length; ++j) - object.additionalTechniques[j] = options.enums === String ? $root.google.cloud.securitycenter.v1.MitreAttack.Technique[message.additionalTechniques[j]] : message.additionalTechniques[j]; + object.additionalTechniques[j] = options.enums === String ? $root.google.cloud.securitycenter.v1.MitreAttack.Technique[message.additionalTechniques[j]] === undefined ? message.additionalTechniques[j] : $root.google.cloud.securitycenter.v1.MitreAttack.Technique[message.additionalTechniques[j]] : message.additionalTechniques[j]; } if (message.version != null && message.hasOwnProperty("version")) object.version = message.version; @@ -14150,6 +14216,12 @@ if (object.baseScore != null) message.baseScore = Number(object.baseScore); switch (object.attackVector) { + default: + if (typeof object.attackVector === "number") { + message.attackVector = object.attackVector; + break; + } + break; case "ATTACK_VECTOR_UNSPECIFIED": case 0: message.attackVector = 0; @@ -14172,6 +14244,12 @@ break; } switch (object.attackComplexity) { + default: + if (typeof object.attackComplexity === "number") { + message.attackComplexity = object.attackComplexity; + break; + } + break; case "ATTACK_COMPLEXITY_UNSPECIFIED": case 0: message.attackComplexity = 0; @@ -14186,6 +14264,12 @@ break; } switch (object.privilegesRequired) { + default: + if (typeof object.privilegesRequired === "number") { + message.privilegesRequired = object.privilegesRequired; + break; + } + break; case "PRIVILEGES_REQUIRED_UNSPECIFIED": case 0: message.privilegesRequired = 0; @@ -14204,6 +14288,12 @@ break; } switch (object.userInteraction) { + default: + if (typeof object.userInteraction === "number") { + message.userInteraction = object.userInteraction; + break; + } + break; case "USER_INTERACTION_UNSPECIFIED": case 0: message.userInteraction = 0; @@ -14218,6 +14308,12 @@ break; } switch (object.scope) { + default: + if (typeof object.scope === "number") { + message.scope = object.scope; + break; + } + break; case "SCOPE_UNSPECIFIED": case 0: message.scope = 0; @@ -14232,6 +14328,12 @@ break; } switch (object.confidentialityImpact) { + default: + if (typeof object.confidentialityImpact === "number") { + message.confidentialityImpact = object.confidentialityImpact; + break; + } + break; case "IMPACT_UNSPECIFIED": case 0: message.confidentialityImpact = 0; @@ -14250,6 +14352,12 @@ break; } switch (object.integrityImpact) { + default: + if (typeof object.integrityImpact === "number") { + message.integrityImpact = object.integrityImpact; + break; + } + break; case "IMPACT_UNSPECIFIED": case 0: message.integrityImpact = 0; @@ -14268,6 +14376,12 @@ break; } switch (object.availabilityImpact) { + default: + if (typeof object.availabilityImpact === "number") { + message.availabilityImpact = object.availabilityImpact; + break; + } + break; case "IMPACT_UNSPECIFIED": case 0: message.availabilityImpact = 0; @@ -14315,21 +14429,21 @@ if (message.baseScore != null && message.hasOwnProperty("baseScore")) object.baseScore = options.json && !isFinite(message.baseScore) ? String(message.baseScore) : message.baseScore; if (message.attackVector != null && message.hasOwnProperty("attackVector")) - object.attackVector = options.enums === String ? $root.google.cloud.securitycenter.v1.Cvssv3.AttackVector[message.attackVector] : message.attackVector; + object.attackVector = options.enums === String ? $root.google.cloud.securitycenter.v1.Cvssv3.AttackVector[message.attackVector] === undefined ? message.attackVector : $root.google.cloud.securitycenter.v1.Cvssv3.AttackVector[message.attackVector] : message.attackVector; if (message.attackComplexity != null && message.hasOwnProperty("attackComplexity")) - object.attackComplexity = options.enums === String ? $root.google.cloud.securitycenter.v1.Cvssv3.AttackComplexity[message.attackComplexity] : message.attackComplexity; + object.attackComplexity = options.enums === String ? $root.google.cloud.securitycenter.v1.Cvssv3.AttackComplexity[message.attackComplexity] === undefined ? message.attackComplexity : $root.google.cloud.securitycenter.v1.Cvssv3.AttackComplexity[message.attackComplexity] : message.attackComplexity; if (message.privilegesRequired != null && message.hasOwnProperty("privilegesRequired")) - object.privilegesRequired = options.enums === String ? $root.google.cloud.securitycenter.v1.Cvssv3.PrivilegesRequired[message.privilegesRequired] : message.privilegesRequired; + object.privilegesRequired = options.enums === String ? $root.google.cloud.securitycenter.v1.Cvssv3.PrivilegesRequired[message.privilegesRequired] === undefined ? message.privilegesRequired : $root.google.cloud.securitycenter.v1.Cvssv3.PrivilegesRequired[message.privilegesRequired] : message.privilegesRequired; if (message.userInteraction != null && message.hasOwnProperty("userInteraction")) - object.userInteraction = options.enums === String ? $root.google.cloud.securitycenter.v1.Cvssv3.UserInteraction[message.userInteraction] : message.userInteraction; + object.userInteraction = options.enums === String ? $root.google.cloud.securitycenter.v1.Cvssv3.UserInteraction[message.userInteraction] === undefined ? message.userInteraction : $root.google.cloud.securitycenter.v1.Cvssv3.UserInteraction[message.userInteraction] : message.userInteraction; if (message.scope != null && message.hasOwnProperty("scope")) - object.scope = options.enums === String ? $root.google.cloud.securitycenter.v1.Cvssv3.Scope[message.scope] : message.scope; + object.scope = options.enums === String ? $root.google.cloud.securitycenter.v1.Cvssv3.Scope[message.scope] === undefined ? message.scope : $root.google.cloud.securitycenter.v1.Cvssv3.Scope[message.scope] : message.scope; if (message.confidentialityImpact != null && message.hasOwnProperty("confidentialityImpact")) - object.confidentialityImpact = options.enums === String ? $root.google.cloud.securitycenter.v1.Cvssv3.Impact[message.confidentialityImpact] : message.confidentialityImpact; + object.confidentialityImpact = options.enums === String ? $root.google.cloud.securitycenter.v1.Cvssv3.Impact[message.confidentialityImpact] === undefined ? message.confidentialityImpact : $root.google.cloud.securitycenter.v1.Cvssv3.Impact[message.confidentialityImpact] : message.confidentialityImpact; if (message.integrityImpact != null && message.hasOwnProperty("integrityImpact")) - object.integrityImpact = options.enums === String ? $root.google.cloud.securitycenter.v1.Cvssv3.Impact[message.integrityImpact] : message.integrityImpact; + object.integrityImpact = options.enums === String ? $root.google.cloud.securitycenter.v1.Cvssv3.Impact[message.integrityImpact] === undefined ? message.integrityImpact : $root.google.cloud.securitycenter.v1.Cvssv3.Impact[message.integrityImpact] : message.integrityImpact; if (message.availabilityImpact != null && message.hasOwnProperty("availabilityImpact")) - object.availabilityImpact = options.enums === String ? $root.google.cloud.securitycenter.v1.Cvssv3.Impact[message.availabilityImpact] : message.availabilityImpact; + object.availabilityImpact = options.enums === String ? $root.google.cloud.securitycenter.v1.Cvssv3.Impact[message.availabilityImpact] === undefined ? message.availabilityImpact : $root.google.cloud.securitycenter.v1.Cvssv3.Impact[message.availabilityImpact] : message.availabilityImpact; return object; }; @@ -16476,6 +16590,12 @@ message.projectIds[i] = String(object.projectIds[i]); } switch (object.inclusionMode) { + default: + if (typeof object.inclusionMode === "number") { + message.inclusionMode = object.inclusionMode; + break; + } + break; case "INCLUSION_MODE_UNSPECIFIED": case 0: message.inclusionMode = 0; @@ -16524,7 +16644,7 @@ object.projectIds[j] = message.projectIds[j]; } if (message.inclusionMode != null && message.hasOwnProperty("inclusionMode")) - object.inclusionMode = options.enums === String ? $root.google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode[message.inclusionMode] : message.inclusionMode; + object.inclusionMode = options.enums === String ? $root.google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode[message.inclusionMode] === undefined ? message.inclusionMode : $root.google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode[message.inclusionMode] : message.inclusionMode; if (message.folderIds && message.folderIds.length) { object.folderIds = []; for (var j = 0; j < message.folderIds.length; ++j) @@ -16758,6 +16878,12 @@ return object; var message = new $root.google.cloud.securitycenter.v1.RunAssetDiscoveryResponse(); switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; case "STATE_UNSPECIFIED": case 0: message.state = 0; @@ -16801,7 +16927,7 @@ object.duration = null; } if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.securitycenter.v1.RunAssetDiscoveryResponse.State[message.state] : message.state; + object.state = options.enums === String ? $root.google.cloud.securitycenter.v1.RunAssetDiscoveryResponse.State[message.state] === undefined ? message.state : $root.google.cloud.securitycenter.v1.RunAssetDiscoveryResponse.State[message.state] : message.state; if (message.duration != null && message.hasOwnProperty("duration")) object.duration = $root.google.protobuf.Duration.toObject(message.duration, options); return object; @@ -24860,6 +24986,12 @@ message.asset = $root.google.cloud.securitycenter.v1.Asset.fromObject(object.asset); } switch (object.stateChange) { + default: + if (typeof object.stateChange === "number") { + message.stateChange = object.stateChange; + break; + } + break; case "UNUSED": case 0: message.stateChange = 0; @@ -24900,7 +25032,7 @@ if (message.asset != null && message.hasOwnProperty("asset")) object.asset = $root.google.cloud.securitycenter.v1.Asset.toObject(message.asset, options); if (message.stateChange != null && message.hasOwnProperty("stateChange")) - object.stateChange = options.enums === String ? $root.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult.StateChange[message.stateChange] : message.stateChange; + object.stateChange = options.enums === String ? $root.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult.StateChange[message.stateChange] === undefined ? message.stateChange : $root.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult.StateChange[message.stateChange] : message.stateChange; return object; }; @@ -25834,6 +25966,12 @@ message.finding = $root.google.cloud.securitycenter.v1.Finding.fromObject(object.finding); } switch (object.stateChange) { + default: + if (typeof object.stateChange === "number") { + message.stateChange = object.stateChange; + break; + } + break; case "UNUSED": case 0: message.stateChange = 0; @@ -25884,7 +26022,7 @@ if (message.finding != null && message.hasOwnProperty("finding")) object.finding = $root.google.cloud.securitycenter.v1.Finding.toObject(message.finding, options); if (message.stateChange != null && message.hasOwnProperty("stateChange")) - object.stateChange = options.enums === String ? $root.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.StateChange[message.stateChange] : message.stateChange; + object.stateChange = options.enums === String ? $root.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.StateChange[message.stateChange] === undefined ? message.stateChange : $root.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.StateChange[message.stateChange] : message.stateChange; if (message.resource != null && message.hasOwnProperty("resource")) object.resource = $root.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource.toObject(message.resource, options); return object; @@ -26525,6 +26663,12 @@ if (object.name != null) message.name = String(object.name); switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; case "STATE_UNSPECIFIED": case 0: message.state = 0; @@ -26567,7 +26711,7 @@ if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.securitycenter.v1.Finding.State[message.state] : message.state; + object.state = options.enums === String ? $root.google.cloud.securitycenter.v1.Finding.State[message.state] === undefined ? message.state : $root.google.cloud.securitycenter.v1.Finding.State[message.state] : message.state; if (message.startTime != null && message.hasOwnProperty("startTime")) object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); return object; @@ -26779,6 +26923,12 @@ if (object.name != null) message.name = String(object.name); switch (object.mute) { + default: + if (typeof object.mute === "number") { + message.mute = object.mute; + break; + } + break; case "MUTE_UNSPECIFIED": case 0: message.mute = 0; @@ -26819,7 +26969,7 @@ if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; if (message.mute != null && message.hasOwnProperty("mute")) - object.mute = options.enums === String ? $root.google.cloud.securitycenter.v1.Finding.Mute[message.mute] : message.mute; + object.mute = options.enums === String ? $root.google.cloud.securitycenter.v1.Finding.Mute[message.mute] === undefined ? message.mute : $root.google.cloud.securitycenter.v1.Finding.Mute[message.mute] : message.mute; return object; }; @@ -31537,6 +31687,12 @@ if (object.resourceName != null) message.resourceName = String(object.resourceName); switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; case "STATE_UNSPECIFIED": case 0: message.state = 0; @@ -31615,7 +31771,7 @@ if (message.resourceName != null && message.hasOwnProperty("resourceName")) object.resourceName = message.resourceName; if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.securitycenter.v1beta1.Finding.State[message.state] : message.state; + object.state = options.enums === String ? $root.google.cloud.securitycenter.v1beta1.Finding.State[message.state] === undefined ? message.state : $root.google.cloud.securitycenter.v1beta1.Finding.State[message.state] : message.state; if (message.category != null && message.hasOwnProperty("category")) object.category = message.category; if (message.externalUri != null && message.hasOwnProperty("externalUri")) @@ -32121,6 +32277,12 @@ message.projectIds[i] = String(object.projectIds[i]); } switch (object.inclusionMode) { + default: + if (typeof object.inclusionMode === "number") { + message.inclusionMode = object.inclusionMode; + break; + } + break; case "INCLUSION_MODE_UNSPECIFIED": case 0: message.inclusionMode = 0; @@ -32160,7 +32322,7 @@ object.projectIds[j] = message.projectIds[j]; } if (message.inclusionMode != null && message.hasOwnProperty("inclusionMode")) - object.inclusionMode = options.enums === String ? $root.google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode[message.inclusionMode] : message.inclusionMode; + object.inclusionMode = options.enums === String ? $root.google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode[message.inclusionMode] === undefined ? message.inclusionMode : $root.google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode[message.inclusionMode] : message.inclusionMode; return object; }; @@ -32389,6 +32551,12 @@ return object; var message = new $root.google.cloud.securitycenter.v1beta1.RunAssetDiscoveryResponse(); switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; case "STATE_UNSPECIFIED": case 0: message.state = 0; @@ -32432,7 +32600,7 @@ object.duration = null; } if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.securitycenter.v1beta1.RunAssetDiscoveryResponse.State[message.state] : message.state; + object.state = options.enums === String ? $root.google.cloud.securitycenter.v1beta1.RunAssetDiscoveryResponse.State[message.state] === undefined ? message.state : $root.google.cloud.securitycenter.v1beta1.RunAssetDiscoveryResponse.State[message.state] : message.state; if (message.duration != null && message.hasOwnProperty("duration")) object.duration = $root.google.protobuf.Duration.toObject(message.duration, options); return object; @@ -36878,6 +37046,12 @@ message.asset = $root.google.cloud.securitycenter.v1beta1.Asset.fromObject(object.asset); } switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; case "STATE_UNSPECIFIED": case 0: message.state = 0; @@ -36922,7 +37096,7 @@ if (message.asset != null && message.hasOwnProperty("asset")) object.asset = $root.google.cloud.securitycenter.v1beta1.Asset.toObject(message.asset, options); if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult.State[message.state] : message.state; + object.state = options.enums === String ? $root.google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult.State[message.state] === undefined ? message.state : $root.google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult.State[message.state] : message.state; return object; }; @@ -37826,6 +38000,12 @@ if (object.name != null) message.name = String(object.name); switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; case "STATE_UNSPECIFIED": case 0: message.state = 0; @@ -37868,7 +38048,7 @@ if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.securitycenter.v1beta1.Finding.State[message.state] : message.state; + object.state = options.enums === String ? $root.google.cloud.securitycenter.v1beta1.Finding.State[message.state] === undefined ? message.state : $root.google.cloud.securitycenter.v1beta1.Finding.State[message.state] : message.state; if (message.startTime != null && message.hasOwnProperty("startTime")) object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); return object; @@ -41324,6 +41504,12 @@ if (object.resourceName != null) message.resourceName = String(object.resourceName); switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; case "STATE_UNSPECIFIED": case 0: message.state = 0; @@ -41367,6 +41553,12 @@ message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); } switch (object.severity) { + default: + if (typeof object.severity === "number") { + message.severity = object.severity; + break; + } + break; case "SEVERITY_UNSPECIFIED": case 0: message.severity = 0; @@ -41428,7 +41620,7 @@ if (message.resourceName != null && message.hasOwnProperty("resourceName")) object.resourceName = message.resourceName; if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.securitycenter.v1p1beta1.Finding.State[message.state] : message.state; + object.state = options.enums === String ? $root.google.cloud.securitycenter.v1p1beta1.Finding.State[message.state] === undefined ? message.state : $root.google.cloud.securitycenter.v1p1beta1.Finding.State[message.state] : message.state; if (message.category != null && message.hasOwnProperty("category")) object.category = message.category; if (message.externalUri != null && message.hasOwnProperty("externalUri")) @@ -41446,7 +41638,7 @@ if (message.createTime != null && message.hasOwnProperty("createTime")) object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); if (message.severity != null && message.hasOwnProperty("severity")) - object.severity = options.enums === String ? $root.google.cloud.securitycenter.v1p1beta1.Finding.Severity[message.severity] : message.severity; + object.severity = options.enums === String ? $root.google.cloud.securitycenter.v1p1beta1.Finding.Severity[message.severity] === undefined ? message.severity : $root.google.cloud.securitycenter.v1p1beta1.Finding.Severity[message.severity] : message.severity; if (message.canonicalName != null && message.hasOwnProperty("canonicalName")) object.canonicalName = message.canonicalName; return object; @@ -41786,6 +41978,12 @@ if (object.description != null) message.description = String(object.description); switch (object.eventType) { + default: + if (typeof object.eventType === "number") { + message.eventType = object.eventType; + break; + } + break; case "EVENT_TYPE_UNSPECIFIED": case 0: message.eventType = 0; @@ -41832,7 +42030,7 @@ if (message.description != null && message.hasOwnProperty("description")) object.description = message.description; if (message.eventType != null && message.hasOwnProperty("eventType")) - object.eventType = options.enums === String ? $root.google.cloud.securitycenter.v1p1beta1.NotificationConfig.EventType[message.eventType] : message.eventType; + object.eventType = options.enums === String ? $root.google.cloud.securitycenter.v1p1beta1.NotificationConfig.EventType[message.eventType] === undefined ? message.eventType : $root.google.cloud.securitycenter.v1p1beta1.NotificationConfig.EventType[message.eventType] : message.eventType; if (message.pubsubTopic != null && message.hasOwnProperty("pubsubTopic")) object.pubsubTopic = message.pubsubTopic; if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) @@ -43179,6 +43377,12 @@ message.projectIds[i] = String(object.projectIds[i]); } switch (object.inclusionMode) { + default: + if (typeof object.inclusionMode === "number") { + message.inclusionMode = object.inclusionMode; + break; + } + break; case "INCLUSION_MODE_UNSPECIFIED": case 0: message.inclusionMode = 0; @@ -43227,7 +43431,7 @@ object.projectIds[j] = message.projectIds[j]; } if (message.inclusionMode != null && message.hasOwnProperty("inclusionMode")) - object.inclusionMode = options.enums === String ? $root.google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode[message.inclusionMode] : message.inclusionMode; + object.inclusionMode = options.enums === String ? $root.google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode[message.inclusionMode] === undefined ? message.inclusionMode : $root.google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode[message.inclusionMode] : message.inclusionMode; if (message.folderIds && message.folderIds.length) { object.folderIds = []; for (var j = 0; j < message.folderIds.length; ++j) @@ -43461,6 +43665,12 @@ return object; var message = new $root.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse(); switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; case "STATE_UNSPECIFIED": case 0: message.state = 0; @@ -43504,7 +43714,7 @@ object.duration = null; } if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse.State[message.state] : message.state; + object.state = options.enums === String ? $root.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse.State[message.state] === undefined ? message.state : $root.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse.State[message.state] : message.state; if (message.duration != null && message.hasOwnProperty("duration")) object.duration = $root.google.protobuf.Duration.toObject(message.duration, options); return object; @@ -49347,6 +49557,12 @@ message.asset = $root.google.cloud.securitycenter.v1p1beta1.Asset.fromObject(object.asset); } switch (object.stateChange) { + default: + if (typeof object.stateChange === "number") { + message.stateChange = object.stateChange; + break; + } + break; case "UNUSED": case 0: message.stateChange = 0; @@ -49387,7 +49603,7 @@ if (message.asset != null && message.hasOwnProperty("asset")) object.asset = $root.google.cloud.securitycenter.v1p1beta1.Asset.toObject(message.asset, options); if (message.stateChange != null && message.hasOwnProperty("stateChange")) - object.stateChange = options.enums === String ? $root.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult.StateChange[message.stateChange] : message.stateChange; + object.stateChange = options.enums === String ? $root.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult.StateChange[message.stateChange] === undefined ? message.stateChange : $root.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult.StateChange[message.stateChange] : message.stateChange; return object; }; @@ -50321,6 +50537,12 @@ message.finding = $root.google.cloud.securitycenter.v1p1beta1.Finding.fromObject(object.finding); } switch (object.stateChange) { + default: + if (typeof object.stateChange === "number") { + message.stateChange = object.stateChange; + break; + } + break; case "UNUSED": case 0: message.stateChange = 0; @@ -50371,7 +50593,7 @@ if (message.finding != null && message.hasOwnProperty("finding")) object.finding = $root.google.cloud.securitycenter.v1p1beta1.Finding.toObject(message.finding, options); if (message.stateChange != null && message.hasOwnProperty("stateChange")) - object.stateChange = options.enums === String ? $root.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.StateChange[message.stateChange] : message.stateChange; + object.stateChange = options.enums === String ? $root.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.StateChange[message.stateChange] === undefined ? message.stateChange : $root.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.StateChange[message.stateChange] : message.stateChange; if (message.resource != null && message.hasOwnProperty("resource")) object.resource = $root.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.Resource.toObject(message.resource, options); return object; @@ -50966,6 +51188,12 @@ if (object.name != null) message.name = String(object.name); switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; case "STATE_UNSPECIFIED": case 0: message.state = 0; @@ -51008,7 +51236,7 @@ if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.securitycenter.v1p1beta1.Finding.State[message.state] : message.state; + object.state = options.enums === String ? $root.google.cloud.securitycenter.v1p1beta1.Finding.State[message.state] === undefined ? message.state : $root.google.cloud.securitycenter.v1p1beta1.Finding.State[message.state] : message.state; if (message.startTime != null && message.hasOwnProperty("startTime")) object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); return object; @@ -53054,6 +53282,12 @@ 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; @@ -53078,6 +53312,10 @@ 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; @@ -53125,7 +53363,7 @@ 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] : message.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")) @@ -53133,7 +53371,7 @@ 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]] : message.style[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; }; @@ -56933,6 +57171,12 @@ 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; @@ -56947,6 +57191,12 @@ break; } switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; case "TYPE_DOUBLE": case 1: message.type = 1; @@ -57073,9 +57323,9 @@ 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] : message.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] : message.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")) @@ -59422,6 +59672,12 @@ 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; @@ -59530,7 +59786,7 @@ 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] : message.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")) @@ -60332,6 +60588,12 @@ 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; @@ -60348,6 +60610,12 @@ 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; @@ -60391,6 +60659,10 @@ 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; @@ -60456,7 +60728,7 @@ object[".google.api.resourceReference"] = null; } if (message.ctype != null && message.hasOwnProperty("ctype")) - object.ctype = options.enums === String ? $root.google.protobuf.FieldOptions.CType[message.ctype] : message.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")) @@ -60464,7 +60736,7 @@ 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] : message.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")) @@ -60477,7 +60749,7 @@ 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]] : message[".google.api.fieldBehavior"][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); @@ -61854,6 +62126,12 @@ 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; @@ -61923,7 +62201,7 @@ 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] : message.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) @@ -63678,6 +63956,12 @@ 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; @@ -63727,7 +64011,7 @@ 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] : message.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; }; @@ -64311,6 +64595,12 @@ return object; var message = new $root.google.protobuf.Value(); switch (object.nullValue) { + default: + if (typeof object.nullValue === "number") { + message.nullValue = object.nullValue; + break; + } + break; case "NULL_VALUE": case 0: message.nullValue = 0; @@ -64349,7 +64639,7 @@ options = {}; var object = {}; if (message.nullValue != null && message.hasOwnProperty("nullValue")) { - object.nullValue = options.enums === String ? $root.google.protobuf.NullValue[message.nullValue] : message.nullValue; + object.nullValue = options.enums === String ? $root.google.protobuf.NullValue[message.nullValue] === undefined ? message.nullValue : $root.google.protobuf.NullValue[message.nullValue] : message.nullValue; if (options.oneofs) object.kind = "nullValue"; } @@ -68099,6 +68389,12 @@ return object; var message = new $root.google.iam.v1.AuditLogConfig(); switch (object.logType) { + default: + if (typeof object.logType === "number") { + message.logType = object.logType; + break; + } + break; case "LOG_TYPE_UNSPECIFIED": case 0: message.logType = 0; @@ -68144,7 +68440,7 @@ if (options.defaults) object.logType = options.enums === String ? "LOG_TYPE_UNSPECIFIED" : 0; if (message.logType != null && message.hasOwnProperty("logType")) - object.logType = options.enums === String ? $root.google.iam.v1.AuditLogConfig.LogType[message.logType] : message.logType; + object.logType = options.enums === String ? $root.google.iam.v1.AuditLogConfig.LogType[message.logType] === undefined ? message.logType : $root.google.iam.v1.AuditLogConfig.LogType[message.logType] : message.logType; if (message.exemptedMembers && message.exemptedMembers.length) { object.exemptedMembers = []; for (var j = 0; j < message.exemptedMembers.length; ++j) @@ -68681,6 +68977,12 @@ return object; var message = new $root.google.iam.v1.BindingDelta(); switch (object.action) { + default: + if (typeof object.action === "number") { + message.action = object.action; + break; + } + break; case "ACTION_UNSPECIFIED": case 0: message.action = 0; @@ -68726,7 +69028,7 @@ object.condition = null; } if (message.action != null && message.hasOwnProperty("action")) - object.action = options.enums === String ? $root.google.iam.v1.BindingDelta.Action[message.action] : message.action; + object.action = options.enums === String ? $root.google.iam.v1.BindingDelta.Action[message.action] === undefined ? message.action : $root.google.iam.v1.BindingDelta.Action[message.action] : message.action; if (message.role != null && message.hasOwnProperty("role")) object.role = message.role; if (message.member != null && message.hasOwnProperty("member")) @@ -68991,6 +69293,12 @@ return object; var message = new $root.google.iam.v1.AuditConfigDelta(); switch (object.action) { + default: + if (typeof object.action === "number") { + message.action = object.action; + break; + } + break; case "ACTION_UNSPECIFIED": case 0: message.action = 0; @@ -69033,7 +69341,7 @@ object.logType = ""; } if (message.action != null && message.hasOwnProperty("action")) - object.action = options.enums === String ? $root.google.iam.v1.AuditConfigDelta.Action[message.action] : message.action; + object.action = options.enums === String ? $root.google.iam.v1.AuditConfigDelta.Action[message.action] === undefined ? message.action : $root.google.iam.v1.AuditConfigDelta.Action[message.action] : message.action; if (message.service != null && message.hasOwnProperty("service")) object.service = message.service; if (message.exemptedMember != null && message.hasOwnProperty("exemptedMember")) From 939a3532cb2d01560bf455b1faaba58a3e298f84 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 17 Nov 2022 15:46:17 -0800 Subject: [PATCH 341/342] feat!: Add files field to finding's list of attributes (#515) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat!: Adding project/folder level parents to notification configs in SCC PiperOrigin-RevId: 481230115 Source-Link: https://github.com/googleapis/googleapis/commit/94efa50017258958b7ce637bab25d459c67de8e9 Source-Link: https://github.com/googleapis/googleapis-gen/commit/cf106b5c0d4f727a8bfc8e23749330421f40b817 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiY2YxMDZiNWMwZDRmNzI3YThiZmM4ZTIzNzQ5MzMwNDIxZjQwYjgxNyJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * feat: Add files field to finding's list of attributes PiperOrigin-RevId: 488290111 Source-Link: https://github.com/googleapis/googleapis/commit/7349e1cd02f5b40058f457387f604357dc871a57 Source-Link: https://github.com/googleapis/googleapis-gen/commit/721049d512deebaa96d438aa23e970299d97712b Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNzIxMDQ5ZDUxMmRlZWJhYTk2ZDQzOGFhMjNlOTcwMjk5ZDk3NzEyYiJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * Update deleteNotificationConfig.js * Update getNotificationConfig.js * Update updateNotificationConfig.js * Update notifications.test.js * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot Co-authored-by: sofisl <55454395+sofisl@users.noreply.github.com> --- .../cloud/securitycenter/v1/finding.proto | 4 + .../securitycenter/v1/mitre_attack.proto | 3 + .../v1/notification_config.proto | 2 + .../v1/securitycenter_service.proto | 261 +++++++------- .../protos/protos.d.ts | 9 +- .../protos/protos.js | 56 +++ .../protos/protos.json | 75 +++- .../v1/security_center.bulk_mute_findings.js | 4 +- .../v1/security_center.create_finding.js | 4 +- ...urity_center.create_notification_config.js | 10 +- .../v1/security_center.create_source.js | 4 +- ...curity_center.get_organization_settings.js | 4 +- .../v1/security_center.group_assets.js | 6 +- .../v1/security_center.group_findings.js | 6 +- .../security_center.list_big_query_exports.js | 4 +- .../v1/security_center.list_mute_configs.js | 4 +- ...curity_center.list_notification_configs.js | 5 +- .../v1/security_center.list_sources.js | 4 +- .../v1/security_center.run_asset_discovery.js | 4 +- .../v1/security_center.set_finding_state.js | 2 +- .../generated/v1/security_center.set_mute.js | 6 +- .../v1/security_center.update_finding.js | 4 +- ...tadata.google.cloud.securitycenter.v1.json | 4 +- .../src/v1/security_center_client.ts | 321 ++++++++++++------ .../test/gapic_security_center_v1.ts | 258 ++++++++++---- 25 files changed, 725 insertions(+), 339 deletions(-) diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/finding.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/finding.proto index 126d5e59feb..755b661772d 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/finding.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/finding.proto @@ -26,6 +26,7 @@ import "google/cloud/securitycenter/v1/container.proto"; import "google/cloud/securitycenter/v1/database.proto"; import "google/cloud/securitycenter/v1/exfiltration.proto"; import "google/cloud/securitycenter/v1/external_system.proto"; +import "google/cloud/securitycenter/v1/file.proto"; import "google/cloud/securitycenter/v1/iam_binding.proto"; import "google/cloud/securitycenter/v1/indicator.proto"; import "google/cloud/securitycenter/v1/kubernetes.proto"; @@ -332,4 +333,7 @@ message Finding { // Database associated with the finding. Database database = 44; + + // File associated with the finding. + repeated File files = 46; } diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/mitre_attack.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/mitre_attack.proto index ba654822b09..ab8262ccfbb 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/mitre_attack.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/mitre_attack.proto @@ -183,6 +183,9 @@ message MitreAttack { // T1548 ABUSE_ELEVATION_CONTROL_MECHANISM = 34; + + // T1078.001 + DEFAULT_ACCOUNTS = 35; } // The MITRE ATT&CK tactic most closely represented by this finding, if any. diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/notification_config.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/notification_config.proto index 7ab94662823..ee1e9546078 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/notification_config.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/notification_config.proto @@ -39,6 +39,8 @@ message NotificationConfig { option (google.api.resource) = { type: "securitycenter.googleapis.com/NotificationConfig" pattern: "organizations/{organization}/notificationConfigs/{notification_config}" + pattern: "folders/{folder}/notificationConfigs/{notification_config}" + pattern: "projects/{project}/notificationConfigs/{notification_config}" }; // The config for streaming-based notifications, which send each event as soon diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/securitycenter_service.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/securitycenter_service.proto index cc4d3fbfe73..24e5e27e610 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/securitycenter_service.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/securitycenter_service.proto @@ -51,12 +51,14 @@ option ruby_package = "Google::Cloud::SecurityCenter::V1"; // V1 APIs for Security Center service. service SecurityCenter { option (google.api.default_host) = "securitycenter.googleapis.com"; - option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; // Kicks off an LRO to bulk mute findings for a parent based on a filter. The // parent can be either an organization, folder or project. The findings // matched by the filter will be muted after the LRO is done. - rpc BulkMuteFindings(BulkMuteFindingsRequest) returns (google.longrunning.Operation) { + rpc BulkMuteFindings(BulkMuteFindingsRequest) + returns (google.longrunning.Operation) { option (google.api.http) = { post: "/v1/{parent=organizations/*}/findings:bulkMute" body: "*" @@ -114,33 +116,47 @@ service SecurityCenter { } // Creates a notification config. - rpc CreateNotificationConfig(CreateNotificationConfigRequest) returns (NotificationConfig) { + rpc CreateNotificationConfig(CreateNotificationConfigRequest) + returns (NotificationConfig) { option (google.api.http) = { post: "/v1/{parent=organizations/*}/notificationConfigs" body: "notification_config" + additional_bindings { + post: "/v1/{parent=folders/*}/notificationConfigs" + body: "notification_config" + } + additional_bindings { + post: "/v1/{parent=projects/*}/notificationConfigs" + body: "notification_config" + } }; - option (google.api.method_signature) = "parent,config_id,notification_config"; + option (google.api.method_signature) = + "parent,config_id,notification_config"; option (google.api.method_signature) = "parent,notification_config"; } // Deletes an existing mute config. - rpc DeleteMuteConfig(DeleteMuteConfigRequest) returns (google.protobuf.Empty) { + rpc DeleteMuteConfig(DeleteMuteConfigRequest) + returns (google.protobuf.Empty) { option (google.api.http) = { delete: "/v1/{name=organizations/*/muteConfigs/*}" - additional_bindings { - delete: "/v1/{name=folders/*/muteConfigs/*}" - } - additional_bindings { - delete: "/v1/{name=projects/*/muteConfigs/*}" - } + additional_bindings { delete: "/v1/{name=folders/*/muteConfigs/*}" } + additional_bindings { delete: "/v1/{name=projects/*/muteConfigs/*}" } }; option (google.api.method_signature) = "name"; } // Deletes a notification config. - rpc DeleteNotificationConfig(DeleteNotificationConfigRequest) returns (google.protobuf.Empty) { + rpc DeleteNotificationConfig(DeleteNotificationConfigRequest) + returns (google.protobuf.Empty) { option (google.api.http) = { delete: "/v1/{name=organizations/*/notificationConfigs/*}" + additional_bindings { + delete: "/v1/{name=folders/*/notificationConfigs/*}" + } + additional_bindings { + delete: "/v1/{name=projects/*/notificationConfigs/*}" + } }; option (google.api.method_signature) = "name"; } @@ -149,18 +165,15 @@ service SecurityCenter { rpc GetBigQueryExport(GetBigQueryExportRequest) returns (BigQueryExport) { option (google.api.http) = { get: "/v1/{name=organizations/*/bigQueryExports/*}" - additional_bindings { - get: "/v1/{name=folders/*/bigQueryExports/*}" - } - additional_bindings { - get: "/v1/{name=projects/*/bigQueryExports/*}" - } + additional_bindings { get: "/v1/{name=folders/*/bigQueryExports/*}" } + additional_bindings { get: "/v1/{name=projects/*/bigQueryExports/*}" } }; option (google.api.method_signature) = "name"; } // Gets the access control policy on the specified Source. - rpc GetIamPolicy(google.iam.v1.GetIamPolicyRequest) returns (google.iam.v1.Policy) { + rpc GetIamPolicy(google.iam.v1.GetIamPolicyRequest) + returns (google.iam.v1.Policy) { option (google.api.http) = { post: "/v1/{resource=organizations/*/sources/*}:getIamPolicy" body: "*" @@ -172,26 +185,26 @@ service SecurityCenter { rpc GetMuteConfig(GetMuteConfigRequest) returns (MuteConfig) { option (google.api.http) = { get: "/v1/{name=organizations/*/muteConfigs/*}" - additional_bindings { - get: "/v1/{name=folders/*/muteConfigs/*}" - } - additional_bindings { - get: "/v1/{name=projects/*/muteConfigs/*}" - } + additional_bindings { get: "/v1/{name=folders/*/muteConfigs/*}" } + additional_bindings { get: "/v1/{name=projects/*/muteConfigs/*}" } }; option (google.api.method_signature) = "name"; } // Gets a notification config. - rpc GetNotificationConfig(GetNotificationConfigRequest) returns (NotificationConfig) { + rpc GetNotificationConfig(GetNotificationConfigRequest) + returns (NotificationConfig) { option (google.api.http) = { get: "/v1/{name=organizations/*/notificationConfigs/*}" + additional_bindings { get: "/v1/{name=folders/*/notificationConfigs/*}" } + additional_bindings { get: "/v1/{name=projects/*/notificationConfigs/*}" } }; option (google.api.method_signature) = "name"; } // Gets the settings for an organization. - rpc GetOrganizationSettings(GetOrganizationSettingsRequest) returns (OrganizationSettings) { + rpc GetOrganizationSettings(GetOrganizationSettingsRequest) + returns (OrganizationSettings) { option (google.api.http) = { get: "/v1/{name=organizations/*/organizationSettings}" }; @@ -250,12 +263,8 @@ service SecurityCenter { rpc ListAssets(ListAssetsRequest) returns (ListAssetsResponse) { option (google.api.http) = { get: "/v1/{parent=organizations/*}/assets" - additional_bindings { - get: "/v1/{parent=folders/*}/assets" - } - additional_bindings { - get: "/v1/{parent=projects/*}/assets" - } + additional_bindings { get: "/v1/{parent=folders/*}/assets" } + additional_bindings { get: "/v1/{parent=projects/*}/assets" } }; } @@ -266,33 +275,29 @@ service SecurityCenter { rpc ListFindings(ListFindingsRequest) returns (ListFindingsResponse) { option (google.api.http) = { get: "/v1/{parent=organizations/*/sources/*}/findings" - additional_bindings { - get: "/v1/{parent=folders/*/sources/*}/findings" - } - additional_bindings { - get: "/v1/{parent=projects/*/sources/*}/findings" - } + additional_bindings { get: "/v1/{parent=folders/*/sources/*}/findings" } + additional_bindings { get: "/v1/{parent=projects/*/sources/*}/findings" } }; } // Lists mute configs. - rpc ListMuteConfigs(ListMuteConfigsRequest) returns (ListMuteConfigsResponse) { + rpc ListMuteConfigs(ListMuteConfigsRequest) + returns (ListMuteConfigsResponse) { option (google.api.http) = { get: "/v1/{parent=organizations/*}/muteConfigs" - additional_bindings { - get: "/v1/{parent=folders/*}/muteConfigs" - } - additional_bindings { - get: "/v1/{parent=projects/*}/muteConfigs" - } + additional_bindings { get: "/v1/{parent=folders/*}/muteConfigs" } + additional_bindings { get: "/v1/{parent=projects/*}/muteConfigs" } }; option (google.api.method_signature) = "parent"; } // Lists notification configs. - rpc ListNotificationConfigs(ListNotificationConfigsRequest) returns (ListNotificationConfigsResponse) { + rpc ListNotificationConfigs(ListNotificationConfigsRequest) + returns (ListNotificationConfigsResponse) { option (google.api.http) = { get: "/v1/{parent=organizations/*}/notificationConfigs" + additional_bindings { get: "/v1/{parent=folders/*}/notificationConfigs" } + additional_bindings { get: "/v1/{parent=projects/*}/notificationConfigs" } }; option (google.api.method_signature) = "parent"; } @@ -301,12 +306,8 @@ service SecurityCenter { rpc ListSources(ListSourcesRequest) returns (ListSourcesResponse) { option (google.api.http) = { get: "/v1/{parent=organizations/*}/sources" - additional_bindings { - get: "/v1/{parent=folders/*}/sources" - } - additional_bindings { - get: "/v1/{parent=projects/*}/sources" - } + additional_bindings { get: "/v1/{parent=folders/*}/sources" } + additional_bindings { get: "/v1/{parent=projects/*}/sources" } }; option (google.api.method_signature) = "parent"; } @@ -317,7 +318,8 @@ service SecurityCenter { // This API can only be called with limited frequency for an organization. If // it is called too frequently the caller will receive a TOO_MANY_REQUESTS // error. - rpc RunAssetDiscovery(RunAssetDiscoveryRequest) returns (google.longrunning.Operation) { + rpc RunAssetDiscovery(RunAssetDiscoveryRequest) + returns (google.longrunning.Operation) { option (google.api.http) = { post: "/v1/{parent=organizations/*}/assets:runDiscovery" body: "*" @@ -364,7 +366,8 @@ service SecurityCenter { } // Sets the access control policy on the specified Source. - rpc SetIamPolicy(google.iam.v1.SetIamPolicyRequest) returns (google.iam.v1.Policy) { + rpc SetIamPolicy(google.iam.v1.SetIamPolicyRequest) + returns (google.iam.v1.Policy) { option (google.api.http) = { post: "/v1/{resource=organizations/*/sources/*}:setIamPolicy" body: "*" @@ -373,7 +376,8 @@ service SecurityCenter { } // Returns the permissions that a caller has on the specified source. - rpc TestIamPermissions(google.iam.v1.TestIamPermissionsRequest) returns (google.iam.v1.TestIamPermissionsResponse) { + rpc TestIamPermissions(google.iam.v1.TestIamPermissionsRequest) + returns (google.iam.v1.TestIamPermissionsResponse) { option (google.api.http) = { post: "/v1/{resource=organizations/*/sources/*}:testIamPermissions" body: "*" @@ -382,7 +386,8 @@ service SecurityCenter { } // Updates external system. This is for a given finding. - rpc UpdateExternalSystem(UpdateExternalSystemRequest) returns (ExternalSystem) { + rpc UpdateExternalSystem(UpdateExternalSystemRequest) + returns (ExternalSystem) { option (google.api.http) = { patch: "/v1/{external_system.name=organizations/*/sources/*/findings/*/externalSystems/*}" body: "external_system" @@ -436,17 +441,27 @@ service SecurityCenter { // // Updates a notification config. The following update // fields are allowed: description, pubsub_topic, streaming_config.filter - rpc UpdateNotificationConfig(UpdateNotificationConfigRequest) returns (NotificationConfig) { + rpc UpdateNotificationConfig(UpdateNotificationConfigRequest) + returns (NotificationConfig) { option (google.api.http) = { patch: "/v1/{notification_config.name=organizations/*/notificationConfigs/*}" body: "notification_config" + additional_bindings { + patch: "/v1/{notification_config.name=folders/*/notificationConfigs/*}" + body: "notification_config" + } + additional_bindings { + patch: "/v1/{notification_config.name=projects/*/notificationConfigs/*}" + body: "notification_config" + } }; option (google.api.method_signature) = "notification_config"; option (google.api.method_signature) = "notification_config,update_mask"; } // Updates an organization's settings. - rpc UpdateOrganizationSettings(UpdateOrganizationSettingsRequest) returns (OrganizationSettings) { + rpc UpdateOrganizationSettings(UpdateOrganizationSettingsRequest) + returns (OrganizationSettings) { option (google.api.http) = { patch: "/v1/{organization_settings.name=organizations/*/organizationSettings}" body: "organization_settings" @@ -493,7 +508,8 @@ service SecurityCenter { } // Creates a big query export. - rpc CreateBigQueryExport(CreateBigQueryExportRequest) returns (BigQueryExport) { + rpc CreateBigQueryExport(CreateBigQueryExportRequest) + returns (BigQueryExport) { option (google.api.http) = { post: "/v1/{parent=organizations/*}/bigQueryExports" body: "big_query_export" @@ -506,25 +522,24 @@ service SecurityCenter { body: "big_query_export" } }; - option (google.api.method_signature) = "parent,big_query_export,big_query_export_id"; + option (google.api.method_signature) = + "parent,big_query_export,big_query_export_id"; } // Deletes an existing big query export. - rpc DeleteBigQueryExport(DeleteBigQueryExportRequest) returns (google.protobuf.Empty) { + rpc DeleteBigQueryExport(DeleteBigQueryExportRequest) + returns (google.protobuf.Empty) { option (google.api.http) = { delete: "/v1/{name=organizations/*/bigQueryExports/*}" - additional_bindings { - delete: "/v1/{name=folders/*/bigQueryExports/*}" - } - additional_bindings { - delete: "/v1/{name=projects/*/bigQueryExports/*}" - } + additional_bindings { delete: "/v1/{name=folders/*/bigQueryExports/*}" } + additional_bindings { delete: "/v1/{name=projects/*/bigQueryExports/*}" } }; option (google.api.method_signature) = "name"; } // Updates a BigQuery export. - rpc UpdateBigQueryExport(UpdateBigQueryExportRequest) returns (BigQueryExport) { + rpc UpdateBigQueryExport(UpdateBigQueryExportRequest) + returns (BigQueryExport) { option (google.api.http) = { patch: "/v1/{big_query_export.name=organizations/*/bigQueryExports/*}" body: "big_query_export" @@ -545,15 +560,12 @@ service SecurityCenter { // requesting BigQuery exports under a folder, then all BigQuery exports // immediately under the folder plus the ones created under the projects // within the folder are returned. - rpc ListBigQueryExports(ListBigQueryExportsRequest) returns (ListBigQueryExportsResponse) { + rpc ListBigQueryExports(ListBigQueryExportsRequest) + returns (ListBigQueryExportsResponse) { option (google.api.http) = { get: "/v1/{parent=organizations/*}/bigQueryExports" - additional_bindings { - get: "/v1/{parent=folders/*}/bigQueryExports" - } - additional_bindings { - get: "/v1/{parent=projects/*}/bigQueryExports" - } + additional_bindings { get: "/v1/{parent=folders/*}/bigQueryExports" } + additional_bindings { get: "/v1/{parent=projects/*}/bigQueryExports" } }; option (google.api.method_signature) = "parent"; } @@ -566,14 +578,12 @@ service SecurityCenter { // which they get executed is not defined. // 2. Once a bulk operation is started, there is no way to stop it. message BulkMuteFindingsRequest { - // Required. The parent, at which bulk action needs to be applied. Its format is - // "organizations/[organization_id]", "folders/[folder_id]", + // Required. The parent, at which bulk action needs to be applied. Its format + // is "organizations/[organization_id]", "folders/[folder_id]", // "projects/[project_id]". string parent = 1 [ (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "*" - } + (google.api.resource_reference) = { type: "*" } ]; // Expression that identifies findings that should be updated. @@ -604,9 +614,7 @@ message BulkMuteFindingsRequest { } // The response to a BulkMute request. Contains the LRO information. -message BulkMuteFindingsResponse { - -} +message BulkMuteFindingsResponse {} // Request message for creating a finding. message CreateFindingRequest { @@ -624,8 +632,8 @@ message CreateFindingRequest { // greater than 0 characters in length. string finding_id = 2 [(google.api.field_behavior) = REQUIRED]; - // Required. The Finding being created. The name and security_marks will be ignored as - // they are both output only fields on this resource. + // Required. The Finding being created. The name and security_marks will be + // ignored as they are both output only fields on this resource. Finding finding = 3 [(google.api.field_behavior) = REQUIRED]; } @@ -653,12 +661,13 @@ message CreateMuteConfigRequest { // Request message for creating a notification config. message CreateNotificationConfigRequest { - // Required. Resource name of the new notification config's parent. Its format is - // "organizations/[organization_id]". + // Required. Resource name of the new notification config's parent. Its format + // is "organizations/[organization_id]", "folders/[folder_id]", or + // "projects/[project_id]". string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { - type: "cloudresourcemanager.googleapis.com/Organization" + child_type: "securitycenter.googleapis.com/NotificationConfig" } ]; @@ -668,9 +677,11 @@ message CreateNotificationConfigRequest { // characters, underscores or hyphens only. string config_id = 2 [(google.api.field_behavior) = REQUIRED]; - // Required. The notification config being created. The name and the service account - // will be ignored as they are both output only fields on this resource. - NotificationConfig notification_config = 3 [(google.api.field_behavior) = REQUIRED]; + // Required. The notification config being created. The name and the service + // account will be ignored as they are both output only fields on this + // resource. + NotificationConfig notification_config = 3 + [(google.api.field_behavior) = REQUIRED]; } // Request message for creating a source. @@ -684,8 +695,8 @@ message CreateSourceRequest { } ]; - // Required. The Source being created, only the display_name and description will be - // used. All other fields will be ignored. + // Required. The Source being created, only the display_name and description + // will be used. All other fields will be ignored. Source source = 2 [(google.api.field_behavior) = REQUIRED]; } @@ -757,8 +768,8 @@ message GetNotificationConfigRequest { // Request message for getting organization settings. message GetOrganizationSettingsRequest { - // Required. Name of the organization to get organization settings for. Its format is - // "organizations/[organization_id]/organizationSettings". + // Required. Name of the organization to get organization settings for. Its + // format is "organizations/[organization_id]/organizationSettings". string name = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -855,9 +866,9 @@ message GroupAssetsRequest { // property not existing: `-resource_properties.my_property : ""` string filter = 2; - // Required. Expression that defines what assets fields to use for grouping. The string - // value should follow SQL syntax: comma separated list of fields. For - // example: + // Required. Expression that defines what assets fields to use for grouping. + // The string value should follow SQL syntax: comma separated list of fields. + // For example: // "security_center_properties.resource_project,security_center_properties.project". // // The following fields are supported when compare_duration is not set: @@ -1015,9 +1026,9 @@ message GroupFindingsRequest { // * resource.type: `=`, `:` string filter = 2; - // Required. Expression that defines what assets fields to use for grouping (including - // `state_change`). The string value should follow SQL syntax: comma separated - // list of fields. For example: "parent,resource_name". + // Required. Expression that defines what assets fields to use for grouping + // (including `state_change`). The string value should follow SQL syntax: + // comma separated list of fields. For example: "parent,resource_name". // // The following fields are supported: // @@ -1112,8 +1123,8 @@ message GroupResult { // Request message for listing mute configs at a given scope e.g. organization, // folder or project. message ListMuteConfigsRequest { - // Required. The parent, which owns the collection of mute configs. Its format is - // "organizations/[organization_id]", "folders/[folder_id]", + // Required. The parent, which owns the collection of mute configs. Its format + // is "organizations/[organization_id]", "folders/[folder_id]", // "projects/[project_id]". string parent = 1 [ (google.api.field_behavior) = REQUIRED, @@ -1148,12 +1159,13 @@ message ListMuteConfigsResponse { // Request message for listing notification configs. message ListNotificationConfigsRequest { - // Required. Name of the organization to list notification configs. - // Its format is "organizations/[organization_id]". + // Required. Name of the organization to list notification configs. Its format + // is "organizations/[organization_id]", "folders/[folder_id]", or + // "projects/[project_id]". string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { - type: "cloudresourcemanager.googleapis.com/Organization" + child_type: "securitycenter.googleapis.com/NotificationConfig" } ]; @@ -1179,8 +1191,8 @@ message ListNotificationConfigsResponse { // Request message for listing sources. message ListSourcesRequest { - // Required. Resource name of the parent of sources to list. Its format should be - // "organizations/[organization_id], folders/[folder_id], or + // Required. Resource name of the parent of sources to list. Its format should + // be "organizations/[organization_id], folders/[folder_id], or // projects/[project_id]". string parent = 1 [ (google.api.field_behavior) = REQUIRED, @@ -1643,7 +1655,7 @@ message SetFindingStateRequest { // Required. The relative resource name of the finding. See: // https://cloud.google.com/apis/design/resource_names#relative_resource_name // Example: - // "organizations/{organization_id}/sources/{source_id}/finding/{finding_id}". + // "organizations/{organization_id}/sources/{source_id}/findings/{finding_id}". string name = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -1655,7 +1667,8 @@ message SetFindingStateRequest { Finding.State state = 2 [(google.api.field_behavior) = REQUIRED]; // Required. The time at which the updated state takes effect. - google.protobuf.Timestamp start_time = 3 [(google.api.field_behavior) = REQUIRED]; + google.protobuf.Timestamp start_time = 3 + [(google.api.field_behavior) = REQUIRED]; } // Request message for updating a finding's mute status. @@ -1663,9 +1676,9 @@ message SetMuteRequest { // Required. The relative resource name of the finding. See: // https://cloud.google.com/apis/design/resource_names#relative_resource_name // Example: - // "organizations/{organization_id}/sources/{source_id}/finding/{finding_id}", - // "folders/{folder_id}/sources/{source_id}/finding/{finding_id}", - // "projects/{project_id}/sources/{source_id}/finding/{finding_id}". + // "organizations/{organization_id}/sources/{source_id}/findings/{finding_id}", + // "folders/{folder_id}/sources/{source_id}/findings/{finding_id}", + // "projects/{project_id}/sources/{source_id}/findings/{finding_id}". string name = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -1679,8 +1692,8 @@ message SetMuteRequest { // Request message for running asset discovery for an organization. message RunAssetDiscoveryRequest { - // Required. Name of the organization to run asset discovery for. Its format is - // "organizations/[organization_id]". + // Required. Name of the organization to run asset discovery for. Its format + // is "organizations/[organization_id]". string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -1702,8 +1715,8 @@ message UpdateExternalSystemRequest { // Request message for updating or creating a finding. message UpdateFindingRequest { - // Required. The finding resource to update or create if it does not already exist. - // parent, security_marks, and update_time will be ignored. + // Required. The finding resource to update or create if it does not already + // exist. parent, security_marks, and update_time will be ignored. // // In the case of creation, the finding id portion of the name must be // alphanumeric and less than or equal to 32 characters and greater than 0 @@ -1733,7 +1746,8 @@ message UpdateMuteConfigRequest { // Request message for updating a notification config. message UpdateNotificationConfigRequest { // Required. The notification config to update. - NotificationConfig notification_config = 1 [(google.api.field_behavior) = REQUIRED]; + NotificationConfig notification_config = 1 + [(google.api.field_behavior) = REQUIRED]; // The FieldMask to use when updating the notification config. // @@ -1744,7 +1758,8 @@ message UpdateNotificationConfigRequest { // Request message for updating an organization's settings. message UpdateOrganizationSettingsRequest { // Required. The organization settings resource to update. - OrganizationSettings organization_settings = 1 [(google.api.field_behavior) = REQUIRED]; + OrganizationSettings organization_settings = 1 + [(google.api.field_behavior) = REQUIRED]; // The FieldMask to use when updating the settings resource. // @@ -1814,11 +1829,11 @@ message UpdateBigQueryExportRequest { google.protobuf.FieldMask update_mask = 2; } -// Request message for listing BigQuery exports at a given scope e.g. +// Request message for listing BigQuery exports at a given scope e.g. // organization, folder or project. message ListBigQueryExportsRequest { - // Required. The parent, which owns the collection of BigQuery exports. Its format is - // "organizations/[organization_id]", "folders/[folder_id]", + // Required. The parent, which owns the collection of BigQuery exports. Its + // format is "organizations/[organization_id]", "folders/[folder_id]", // "projects/[project_id]". string parent = 1 [ (google.api.field_behavior) = REQUIRED, diff --git a/packages/google-cloud-securitycenter/protos/protos.d.ts b/packages/google-cloud-securitycenter/protos/protos.d.ts index ff8ff9f2d18..f7220fdf13e 100644 --- a/packages/google-cloud-securitycenter/protos/protos.d.ts +++ b/packages/google-cloud-securitycenter/protos/protos.d.ts @@ -2437,6 +2437,9 @@ export namespace google { /** Finding database */ database?: (google.cloud.securitycenter.v1.IDatabase|null); + + /** Finding files */ + files?: (google.cloud.securitycenter.v1.IFile[]|null); } /** Represents a Finding. */ @@ -2547,6 +2550,9 @@ export namespace google { /** Finding database. */ public database?: (google.cloud.securitycenter.v1.IDatabase|null); + /** Finding files. */ + public files: google.cloud.securitycenter.v1.IFile[]; + /** * Creates a new Finding instance using the specified properties. * @param [properties] Properties to set @@ -4424,7 +4430,8 @@ export namespace google { IMPAIR_DEFENSES = 31, NETWORK_SERVICE_DISCOVERY = 32, ACCESS_TOKEN_MANIPULATION = 33, - ABUSE_ELEVATION_CONTROL_MECHANISM = 34 + ABUSE_ELEVATION_CONTROL_MECHANISM = 34, + DEFAULT_ACCOUNTS = 35 } } diff --git a/packages/google-cloud-securitycenter/protos/protos.js b/packages/google-cloud-securitycenter/protos/protos.js index 83ab8fe4384..f795d9fc918 100644 --- a/packages/google-cloud-securitycenter/protos/protos.js +++ b/packages/google-cloud-securitycenter/protos/protos.js @@ -5964,6 +5964,7 @@ * @property {Array.|null} [containers] Finding containers * @property {google.cloud.securitycenter.v1.IKubernetes|null} [kubernetes] Finding kubernetes * @property {google.cloud.securitycenter.v1.IDatabase|null} [database] Finding database + * @property {Array.|null} [files] Finding files */ /** @@ -5983,6 +5984,7 @@ this.compliances = []; this.iamBindings = []; this.containers = []; + this.files = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -6253,6 +6255,14 @@ */ Finding.prototype.database = null; + /** + * Finding files. + * @member {Array.} files + * @memberof google.cloud.securitycenter.v1.Finding + * @instance + */ + Finding.prototype.files = $util.emptyArray; + /** * Creates a new Finding instance using the specified properties. * @function create @@ -6357,6 +6367,9 @@ $root.google.cloud.securitycenter.v1.Kubernetes.encode(message.kubernetes, writer.uint32(/* id 43, wireType 2 =*/346).fork()).ldelim(); if (message.database != null && Object.hasOwnProperty.call(message, "database")) $root.google.cloud.securitycenter.v1.Database.encode(message.database, writer.uint32(/* id 44, wireType 2 =*/354).fork()).ldelim(); + if (message.files != null && message.files.length) + for (var i = 0; i < message.files.length; ++i) + $root.google.cloud.securitycenter.v1.File.encode(message.files[i], writer.uint32(/* id 46, wireType 2 =*/370).fork()).ldelim(); return writer; }; @@ -6590,6 +6603,12 @@ message.database = $root.google.cloud.securitycenter.v1.Database.decode(reader, reader.uint32()); break; } + case 46: { + if (!(message.files && message.files.length)) + message.files = []; + message.files.push($root.google.cloud.securitycenter.v1.File.decode(reader, reader.uint32())); + break; + } default: reader.skipType(tag & 7); break; @@ -6827,6 +6846,15 @@ if (error) return "database." + error; } + if (message.files != null && message.hasOwnProperty("files")) { + if (!Array.isArray(message.files)) + return "files: array expected"; + for (var i = 0; i < message.files.length; ++i) { + var error = $root.google.cloud.securitycenter.v1.File.verify(message.files[i]); + if (error) + return "files." + error; + } + } return null; }; @@ -7101,6 +7129,16 @@ throw TypeError(".google.cloud.securitycenter.v1.Finding.database: object expected"); message.database = $root.google.cloud.securitycenter.v1.Database.fromObject(object.database); } + if (object.files) { + if (!Array.isArray(object.files)) + throw TypeError(".google.cloud.securitycenter.v1.Finding.files: array expected"); + message.files = []; + for (var i = 0; i < object.files.length; ++i) { + if (typeof object.files[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Finding.files: object expected"); + message.files[i] = $root.google.cloud.securitycenter.v1.File.fromObject(object.files[i]); + } + } return message; }; @@ -7123,6 +7161,7 @@ object.compliances = []; object.iamBindings = []; object.containers = []; + object.files = []; } if (options.objects || options.defaults) { object.sourceProperties = {}; @@ -7247,6 +7286,11 @@ object.kubernetes = $root.google.cloud.securitycenter.v1.Kubernetes.toObject(message.kubernetes, options); if (message.database != null && message.hasOwnProperty("database")) object.database = $root.google.cloud.securitycenter.v1.Database.toObject(message.database, options); + if (message.files && message.files.length) { + object.files = []; + for (var j = 0; j < message.files.length; ++j) + object.files[j] = $root.google.cloud.securitycenter.v1.File.toObject(message.files[j], options); + } return object; }; @@ -11659,6 +11703,7 @@ case 32: case 33: case 34: + case 35: break; } } @@ -11729,6 +11774,7 @@ case 32: case 33: case 34: + case 35: break; } } @@ -11969,6 +12015,10 @@ case 34: message.primaryTechniques[i] = 34; break; + case "DEFAULT_ACCOUNTS": + case 35: + message.primaryTechniques[i] = 35; + break; } } if (object.additionalTactics) { @@ -12195,6 +12245,10 @@ case 34: message.additionalTechniques[i] = 34; break; + case "DEFAULT_ACCOUNTS": + case 35: + message.additionalTechniques[i] = 35; + break; } } if (object.version != null) @@ -12351,6 +12405,7 @@ * @property {number} NETWORK_SERVICE_DISCOVERY=32 NETWORK_SERVICE_DISCOVERY value * @property {number} ACCESS_TOKEN_MANIPULATION=33 ACCESS_TOKEN_MANIPULATION value * @property {number} ABUSE_ELEVATION_CONTROL_MECHANISM=34 ABUSE_ELEVATION_CONTROL_MECHANISM value + * @property {number} DEFAULT_ACCOUNTS=35 DEFAULT_ACCOUNTS value */ MitreAttack.Technique = (function() { var valuesById = {}, values = Object.create(valuesById); @@ -12389,6 +12444,7 @@ values[valuesById[32] = "NETWORK_SERVICE_DISCOVERY"] = 32; values[valuesById[33] = "ACCESS_TOKEN_MANIPULATION"] = 33; values[valuesById[34] = "ABUSE_ELEVATION_CONTROL_MECHANISM"] = 34; + values[valuesById[35] = "DEFAULT_ACCOUNTS"] = 35; return values; })(); diff --git a/packages/google-cloud-securitycenter/protos/protos.json b/packages/google-cloud-securitycenter/protos/protos.json index 6b618959870..57619a9a87e 100644 --- a/packages/google-cloud-securitycenter/protos/protos.json +++ b/packages/google-cloud-securitycenter/protos/protos.json @@ -630,6 +630,11 @@ "database": { "type": "Database", "id": 44 + }, + "files": { + "rule": "repeated", + "type": "File", + "id": 46 } }, "nested": { @@ -1042,7 +1047,8 @@ "IMPAIR_DEFENSES": 31, "NETWORK_SERVICE_DISCOVERY": 32, "ACCESS_TOKEN_MANIPULATION": 33, - "ABUSE_ELEVATION_CONTROL_MECHANISM": 34 + "ABUSE_ELEVATION_CONTROL_MECHANISM": 34, + "DEFAULT_ACCOUNTS": 35 } } } @@ -1289,7 +1295,7 @@ "NotificationConfig": { "options": { "(google.api.resource).type": "securitycenter.googleapis.com/NotificationConfig", - "(google.api.resource).pattern": "organizations/{organization}/notificationConfigs/{notification_config}" + "(google.api.resource).pattern": "projects/{project}/notificationConfigs/{notification_config}" }, "oneofs": { "notifyConfig": { @@ -1598,13 +1604,25 @@ "options": { "(google.api.http).post": "/v1/{parent=organizations/*}/notificationConfigs", "(google.api.http).body": "notification_config", + "(google.api.http).additional_bindings.post": "/v1/{parent=projects/*}/notificationConfigs", + "(google.api.http).additional_bindings.body": "notification_config", "(google.api.method_signature)": "parent,notification_config" }, "parsedOptions": [ { "(google.api.http)": { "post": "/v1/{parent=organizations/*}/notificationConfigs", - "body": "notification_config" + "body": "notification_config", + "additional_bindings": [ + { + "post": "/v1/{parent=folders/*}/notificationConfigs", + "body": "notification_config" + }, + { + "post": "/v1/{parent=projects/*}/notificationConfigs", + "body": "notification_config" + } + ] } }, { @@ -1647,12 +1665,21 @@ "responseType": "google.protobuf.Empty", "options": { "(google.api.http).delete": "/v1/{name=organizations/*/notificationConfigs/*}", + "(google.api.http).additional_bindings.delete": "/v1/{name=projects/*/notificationConfigs/*}", "(google.api.method_signature)": "name" }, "parsedOptions": [ { "(google.api.http)": { - "delete": "/v1/{name=organizations/*/notificationConfigs/*}" + "delete": "/v1/{name=organizations/*/notificationConfigs/*}", + "additional_bindings": [ + { + "delete": "/v1/{name=folders/*/notificationConfigs/*}" + }, + { + "delete": "/v1/{name=projects/*/notificationConfigs/*}" + } + ] } }, { @@ -1739,12 +1766,21 @@ "responseType": "NotificationConfig", "options": { "(google.api.http).get": "/v1/{name=organizations/*/notificationConfigs/*}", + "(google.api.http).additional_bindings.get": "/v1/{name=projects/*/notificationConfigs/*}", "(google.api.method_signature)": "name" }, "parsedOptions": [ { "(google.api.http)": { - "get": "/v1/{name=organizations/*/notificationConfigs/*}" + "get": "/v1/{name=organizations/*/notificationConfigs/*}", + "additional_bindings": [ + { + "get": "/v1/{name=folders/*/notificationConfigs/*}" + }, + { + "get": "/v1/{name=projects/*/notificationConfigs/*}" + } + ] } }, { @@ -1926,12 +1962,21 @@ "responseType": "ListNotificationConfigsResponse", "options": { "(google.api.http).get": "/v1/{parent=organizations/*}/notificationConfigs", + "(google.api.http).additional_bindings.get": "/v1/{parent=projects/*}/notificationConfigs", "(google.api.method_signature)": "parent" }, "parsedOptions": [ { "(google.api.http)": { - "get": "/v1/{parent=organizations/*}/notificationConfigs" + "get": "/v1/{parent=organizations/*}/notificationConfigs", + "additional_bindings": [ + { + "get": "/v1/{parent=folders/*}/notificationConfigs" + }, + { + "get": "/v1/{parent=projects/*}/notificationConfigs" + } + ] } }, { @@ -2200,13 +2245,25 @@ "options": { "(google.api.http).patch": "/v1/{notification_config.name=organizations/*/notificationConfigs/*}", "(google.api.http).body": "notification_config", + "(google.api.http).additional_bindings.patch": "/v1/{notification_config.name=projects/*/notificationConfigs/*}", + "(google.api.http).additional_bindings.body": "notification_config", "(google.api.method_signature)": "notification_config,update_mask" }, "parsedOptions": [ { "(google.api.http)": { "patch": "/v1/{notification_config.name=organizations/*/notificationConfigs/*}", - "body": "notification_config" + "body": "notification_config", + "additional_bindings": [ + { + "patch": "/v1/{notification_config.name=folders/*/notificationConfigs/*}", + "body": "notification_config" + }, + { + "patch": "/v1/{notification_config.name=projects/*/notificationConfigs/*}", + "body": "notification_config" + } + ] } }, { @@ -2506,7 +2563,7 @@ "id": 1, "options": { "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "cloudresourcemanager.googleapis.com/Organization" + "(google.api.resource_reference).child_type": "securitycenter.googleapis.com/NotificationConfig" } }, "configId": { @@ -2801,7 +2858,7 @@ "id": 1, "options": { "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "cloudresourcemanager.googleapis.com/Organization" + "(google.api.resource_reference).child_type": "securitycenter.googleapis.com/NotificationConfig" } }, "pageToken": { diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.bulk_mute_findings.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.bulk_mute_findings.js index d25325483a5..1f03f930fe1 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.bulk_mute_findings.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.bulk_mute_findings.js @@ -29,8 +29,8 @@ function main(parent) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * Required. The parent, at which bulk action needs to be applied. Its format is - * "organizations/[organization_id]", "folders/[folder_id]", + * Required. The parent, at which bulk action needs to be applied. Its format + * is "organizations/[organization_id]", "folders/[folder_id]", * "projects/[project_id]". */ // const parent = 'abc123' diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.create_finding.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.create_finding.js index 714d4f63519..830510a7b21 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.create_finding.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.create_finding.js @@ -40,8 +40,8 @@ function main(parent, findingId, finding) { */ // const findingId = 'abc123' /** - * Required. The Finding being created. The name and security_marks will be ignored as - * they are both output only fields on this resource. + * Required. The Finding being created. The name and security_marks will be + * ignored as they are both output only fields on this resource. */ // const finding = {} diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.create_notification_config.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.create_notification_config.js index 5bb9526e1ea..18d45fca008 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.create_notification_config.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.create_notification_config.js @@ -29,8 +29,9 @@ function main(parent, configId, notificationConfig) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * Required. Resource name of the new notification config's parent. Its format is - * "organizations/[organization_id]". + * Required. Resource name of the new notification config's parent. Its format + * is "organizations/[organization_id]", "folders/[folder_id]", or + * "projects/[project_id]". */ // const parent = 'abc123' /** @@ -41,8 +42,9 @@ function main(parent, configId, notificationConfig) { */ // const configId = 'abc123' /** - * Required. The notification config being created. The name and the service account - * will be ignored as they are both output only fields on this resource. + * Required. The notification config being created. The name and the service + * account will be ignored as they are both output only fields on this + * resource. */ // const notificationConfig = {} diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.create_source.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.create_source.js index fe7760787b6..4e41f9f4a6c 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.create_source.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.create_source.js @@ -34,8 +34,8 @@ function main(parent, source) { */ // const parent = 'abc123' /** - * Required. The Source being created, only the display_name and description will be - * used. All other fields will be ignored. + * Required. The Source being created, only the display_name and description + * will be used. All other fields will be ignored. */ // const source = {} diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_organization_settings.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_organization_settings.js index 23035414b72..aabb6b473e8 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_organization_settings.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_organization_settings.js @@ -29,8 +29,8 @@ function main(name) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * Required. Name of the organization to get organization settings for. Its format is - * "organizations/[organization_id]/organizationSettings". + * Required. Name of the organization to get organization settings for. Its + * format is "organizations/[organization_id]/organizationSettings". */ // const name = 'abc123' diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.group_assets.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.group_assets.js index 06086a66f95..8f7c8de7912 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.group_assets.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.group_assets.js @@ -85,9 +85,9 @@ function main(parent, groupBy) { */ // const filter = 'abc123' /** - * Required. Expression that defines what assets fields to use for grouping. The string - * value should follow SQL syntax: comma separated list of fields. For - * example: + * Required. Expression that defines what assets fields to use for grouping. + * The string value should follow SQL syntax: comma separated list of fields. + * For example: * "security_center_properties.resource_project,security_center_properties.project". * The following fields are supported when compare_duration is not set: * * security_center_properties.resource_project diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.group_findings.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.group_findings.js index 37b199dc162..86278e4aabf 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.group_findings.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.group_findings.js @@ -87,9 +87,9 @@ function main(parent, groupBy) { */ // const filter = 'abc123' /** - * Required. Expression that defines what assets fields to use for grouping (including - * `state_change`). The string value should follow SQL syntax: comma separated - * list of fields. For example: "parent,resource_name". + * Required. Expression that defines what assets fields to use for grouping + * (including `state_change`). The string value should follow SQL syntax: + * comma separated list of fields. For example: "parent,resource_name". * The following fields are supported: * * resource_name * * category diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_big_query_exports.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_big_query_exports.js index 3efba707f6e..4489f1a9954 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_big_query_exports.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_big_query_exports.js @@ -29,8 +29,8 @@ function main(parent) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * Required. The parent, which owns the collection of BigQuery exports. Its format is - * "organizations/[organization_id]", "folders/[folder_id]", + * Required. The parent, which owns the collection of BigQuery exports. Its + * format is "organizations/[organization_id]", "folders/[folder_id]", * "projects/[project_id]". */ // const parent = 'abc123' diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_mute_configs.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_mute_configs.js index c8cf646cf69..168ee39b535 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_mute_configs.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_mute_configs.js @@ -29,8 +29,8 @@ function main(parent) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * Required. The parent, which owns the collection of mute configs. Its format is - * "organizations/[organization_id]", "folders/[folder_id]", + * Required. The parent, which owns the collection of mute configs. Its format + * is "organizations/[organization_id]", "folders/[folder_id]", * "projects/[project_id]". */ // const parent = 'abc123' diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_notification_configs.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_notification_configs.js index 23f2a93050d..b30022943ff 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_notification_configs.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_notification_configs.js @@ -29,8 +29,9 @@ function main(parent) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * Required. Name of the organization to list notification configs. - * Its format is "organizations/[organization_id]". + * Required. Name of the organization to list notification configs. Its format + * is "organizations/[organization_id]", "folders/[folder_id]", or + * "projects/[project_id]". */ // const parent = 'abc123' /** diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_sources.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_sources.js index 7fb76c8b61e..12b6eb6b8e3 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_sources.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_sources.js @@ -29,8 +29,8 @@ function main(parent) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * Required. Resource name of the parent of sources to list. Its format should be - * "organizations/[organization_id], folders/[folder_id], or + * Required. Resource name of the parent of sources to list. Its format should + * be "organizations/[organization_id], folders/[folder_id], or * projects/[project_id]". */ // const parent = 'abc123' diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.run_asset_discovery.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.run_asset_discovery.js index 5aa591fdb9e..2c2af7fb3dd 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.run_asset_discovery.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.run_asset_discovery.js @@ -29,8 +29,8 @@ function main(parent) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * Required. Name of the organization to run asset discovery for. Its format is - * "organizations/[organization_id]". + * Required. Name of the organization to run asset discovery for. Its format + * is "organizations/[organization_id]". */ // const parent = 'abc123' diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.set_finding_state.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.set_finding_state.js index ddd05a3a40a..d2af87fcf92 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.set_finding_state.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.set_finding_state.js @@ -32,7 +32,7 @@ function main(name, state, startTime) { * Required. The relative resource name of the finding. See: * https://cloud.google.com/apis/design/resource_names#relative_resource_name * Example: - * "organizations/{organization_id}/sources/{source_id}/finding/{finding_id}". + * "organizations/{organization_id}/sources/{source_id}/findings/{finding_id}". */ // const name = 'abc123' /** diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.set_mute.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.set_mute.js index 3e03d59aa28..617c0622993 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.set_mute.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.set_mute.js @@ -32,9 +32,9 @@ function main(name, mute) { * Required. The relative resource name of the finding. See: * https://cloud.google.com/apis/design/resource_names#relative_resource_name * Example: - * "organizations/{organization_id}/sources/{source_id}/finding/{finding_id}", - * "folders/{folder_id}/sources/{source_id}/finding/{finding_id}", - * "projects/{project_id}/sources/{source_id}/finding/{finding_id}". + * "organizations/{organization_id}/sources/{source_id}/findings/{finding_id}", + * "folders/{folder_id}/sources/{source_id}/findings/{finding_id}", + * "projects/{project_id}/sources/{source_id}/findings/{finding_id}". */ // const name = 'abc123' /** diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_finding.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_finding.js index dcb3e24e9da..178749ea115 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_finding.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_finding.js @@ -29,8 +29,8 @@ function main(finding) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * Required. The finding resource to update or create if it does not already exist. - * parent, security_marks, and update_time will be ignored. + * Required. The finding resource to update or create if it does not already + * exist. parent, security_marks, and update_time will be ignored. * In the case of creation, the finding id portion of the name must be * alphanumeric and less than or equal to 32 characters and greater than 0 * characters in length. diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/snippet_metadata.google.cloud.securitycenter.v1.json b/packages/google-cloud-securitycenter/samples/generated/v1/snippet_metadata.google.cloud.securitycenter.v1.json index 0126d79d6be..a4debf0fcff 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/snippet_metadata.google.cloud.securitycenter.v1.json +++ b/packages/google-cloud-securitycenter/samples/generated/v1/snippet_metadata.google.cloud.securitycenter.v1.json @@ -210,7 +210,7 @@ "segments": [ { "start": 25, - "end": 68, + "end": 70, "type": "FULL" } ], @@ -894,7 +894,7 @@ "segments": [ { "start": 25, - "end": 67, + "end": 68, "type": "FULL" } ], diff --git a/packages/google-cloud-securitycenter/src/v1/security_center_client.ts b/packages/google-cloud-securitycenter/src/v1/security_center_client.ts index 5104846fa4c..9246d4a8dc4 100644 --- a/packages/google-cloud-securitycenter/src/v1/security_center_client.ts +++ b/packages/google-cloud-securitycenter/src/v1/security_center_client.ts @@ -190,6 +190,9 @@ export class SecurityCenterClient { folderMuteConfigPathTemplate: new this._gaxModule.PathTemplate( 'folders/{folder}/muteConfigs/{mute_config}' ), + folderNotificationConfigPathTemplate: new this._gaxModule.PathTemplate( + 'folders/{folder}/notificationConfigs/{notification_config}' + ), folderSourcePathTemplate: new this._gaxModule.PathTemplate( 'folders/{folder}/sources/{source}' ), @@ -204,9 +207,6 @@ export class SecurityCenterClient { new this._gaxModule.PathTemplate( 'folders/{folder}/sources/{source}/findings/{finding}/securityMarks' ), - notificationConfigPathTemplate: new this._gaxModule.PathTemplate( - 'organizations/{organization}/notificationConfigs/{notification_config}' - ), organizationPathTemplate: new this._gaxModule.PathTemplate( 'organizations/{organization}' ), @@ -223,6 +223,10 @@ export class SecurityCenterClient { organizationMuteConfigPathTemplate: new this._gaxModule.PathTemplate( 'organizations/{organization}/muteConfigs/{mute_config}' ), + organizationNotificationConfigPathTemplate: + new this._gaxModule.PathTemplate( + 'organizations/{organization}/notificationConfigs/{notification_config}' + ), organizationSettingsPathTemplate: new this._gaxModule.PathTemplate( 'organizations/{organization}/organizationSettings' ), @@ -252,6 +256,9 @@ export class SecurityCenterClient { projectMuteConfigPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/muteConfigs/{mute_config}' ), + projectNotificationConfigPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/notificationConfigs/{notification_config}' + ), projectSourcePathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/sources/{source}' ), @@ -553,8 +560,8 @@ export class SecurityCenterClient { * Required. Resource name of the new source's parent. Its format should be * "organizations/[organization_id]". * @param {google.cloud.securitycenter.v1.Source} request.source - * Required. The Source being created, only the display_name and description will be - * used. All other fields will be ignored. + * Required. The Source being created, only the display_name and description + * will be used. All other fields will be ignored. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -653,8 +660,8 @@ export class SecurityCenterClient { * It must be alphanumeric and less than or equal to 32 characters and * greater than 0 characters in length. * @param {google.cloud.securitycenter.v1.Finding} request.finding - * Required. The Finding being created. The name and security_marks will be ignored as - * they are both output only fields on this resource. + * Required. The Finding being created. The name and security_marks will be + * ignored as they are both output only fields on this resource. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -851,16 +858,18 @@ export class SecurityCenterClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. Resource name of the new notification config's parent. Its format is - * "organizations/[organization_id]". + * Required. Resource name of the new notification config's parent. Its format + * is "organizations/[organization_id]", "folders/[folder_id]", or + * "projects/[project_id]". * @param {string} request.configId * Required. * Unique identifier provided by the client within the parent scope. * It must be between 1 and 128 characters, and contains alphanumeric * characters, underscores or hyphens only. * @param {google.cloud.securitycenter.v1.NotificationConfig} request.notificationConfig - * Required. The notification config being created. The name and the service account - * will be ignored as they are both output only fields on this resource. + * Required. The notification config being created. The name and the service + * account will be ignored as they are both output only fields on this + * resource. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -1542,8 +1551,8 @@ export class SecurityCenterClient { * @param {Object} request * The request object that will be sent. * @param {string} request.name - * Required. Name of the organization to get organization settings for. Its format is - * "organizations/[organization_id]/organizationSettings". + * Required. Name of the organization to get organization settings for. Its + * format is "organizations/[organization_id]/organizationSettings". * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -1739,7 +1748,7 @@ export class SecurityCenterClient { * Required. The relative resource name of the finding. See: * https://cloud.google.com/apis/design/resource_names#relative_resource_name * Example: - * "organizations/{organization_id}/sources/{source_id}/finding/{finding_id}". + * "organizations/{organization_id}/sources/{source_id}/findings/{finding_id}". * @param {google.cloud.securitycenter.v1.Finding.State} request.state * Required. The desired State of the finding. * @param {google.protobuf.Timestamp} request.startTime @@ -1837,9 +1846,9 @@ export class SecurityCenterClient { * Required. The relative resource name of the finding. See: * https://cloud.google.com/apis/design/resource_names#relative_resource_name * Example: - * "organizations/{organization_id}/sources/{source_id}/finding/{finding_id}", - * "folders/{folder_id}/sources/{source_id}/finding/{finding_id}", - * "projects/{project_id}/sources/{source_id}/finding/{finding_id}". + * "organizations/{organization_id}/sources/{source_id}/findings/{finding_id}", + * "folders/{folder_id}/sources/{source_id}/findings/{finding_id}", + * "projects/{project_id}/sources/{source_id}/findings/{finding_id}". * @param {google.cloud.securitycenter.v1.Finding.Mute} request.mute * Required. The desired state of the Mute. * @param {object} [options] @@ -2212,8 +2221,8 @@ export class SecurityCenterClient { * @param {Object} request * The request object that will be sent. * @param {google.cloud.securitycenter.v1.Finding} request.finding - * Required. The finding resource to update or create if it does not already exist. - * parent, security_marks, and update_time will be ignored. + * Required. The finding resource to update or create if it does not already + * exist. parent, security_marks, and update_time will be ignored. * * In the case of creation, the finding id portion of the name must be * alphanumeric and less than or equal to 32 characters and greater than 0 @@ -3140,8 +3149,8 @@ export class SecurityCenterClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. The parent, at which bulk action needs to be applied. Its format is - * "organizations/[organization_id]", "folders/[folder_id]", + * Required. The parent, at which bulk action needs to be applied. Its format + * is "organizations/[organization_id]", "folders/[folder_id]", * "projects/[project_id]". * @param {string} request.filter * Expression that identifies findings that should be updated. @@ -3309,8 +3318,8 @@ export class SecurityCenterClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. Name of the organization to run asset discovery for. Its format is - * "organizations/[organization_id]". + * Required. Name of the organization to run asset discovery for. Its format + * is "organizations/[organization_id]". * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -3516,9 +3525,9 @@ export class SecurityCenterClient { * Use a negated partial match on the empty string to filter based on a * property not existing: `-resource_properties.my_property : ""` * @param {string} request.groupBy - * Required. Expression that defines what assets fields to use for grouping. The string - * value should follow SQL syntax: comma separated list of fields. For - * example: + * Required. Expression that defines what assets fields to use for grouping. + * The string value should follow SQL syntax: comma separated list of fields. + * For example: * "security_center_properties.resource_project,security_center_properties.project". * * The following fields are supported when compare_duration is not set: @@ -3734,9 +3743,9 @@ export class SecurityCenterClient { * Use a negated partial match on the empty string to filter based on a * property not existing: `-resource_properties.my_property : ""` * @param {string} request.groupBy - * Required. Expression that defines what assets fields to use for grouping. The string - * value should follow SQL syntax: comma separated list of fields. For - * example: + * Required. Expression that defines what assets fields to use for grouping. + * The string value should follow SQL syntax: comma separated list of fields. + * For example: * "security_center_properties.resource_project,security_center_properties.project". * * The following fields are supported when compare_duration is not set: @@ -3900,9 +3909,9 @@ export class SecurityCenterClient { * Use a negated partial match on the empty string to filter based on a * property not existing: `-resource_properties.my_property : ""` * @param {string} request.groupBy - * Required. Expression that defines what assets fields to use for grouping. The string - * value should follow SQL syntax: comma separated list of fields. For - * example: + * Required. Expression that defines what assets fields to use for grouping. + * The string value should follow SQL syntax: comma separated list of fields. + * For example: * "security_center_properties.resource_project,security_center_properties.project". * * The following fields are supported when compare_duration is not set: @@ -4072,9 +4081,9 @@ export class SecurityCenterClient { * * resource.project_display_name: `=`, `:` * * resource.type: `=`, `:` * @param {string} request.groupBy - * Required. Expression that defines what assets fields to use for grouping (including - * `state_change`). The string value should follow SQL syntax: comma separated - * list of fields. For example: "parent,resource_name". + * Required. Expression that defines what assets fields to use for grouping + * (including `state_change`). The string value should follow SQL syntax: + * comma separated list of fields. For example: "parent,resource_name". * * The following fields are supported: * @@ -4293,9 +4302,9 @@ export class SecurityCenterClient { * * resource.project_display_name: `=`, `:` * * resource.type: `=`, `:` * @param {string} request.groupBy - * Required. Expression that defines what assets fields to use for grouping (including - * `state_change`). The string value should follow SQL syntax: comma separated - * list of fields. For example: "parent,resource_name". + * Required. Expression that defines what assets fields to use for grouping + * (including `state_change`). The string value should follow SQL syntax: + * comma separated list of fields. For example: "parent,resource_name". * * The following fields are supported: * @@ -4462,9 +4471,9 @@ export class SecurityCenterClient { * * resource.project_display_name: `=`, `:` * * resource.type: `=`, `:` * @param {string} request.groupBy - * Required. Expression that defines what assets fields to use for grouping (including - * `state_change`). The string value should follow SQL syntax: comma separated - * list of fields. For example: "parent,resource_name". + * Required. Expression that defines what assets fields to use for grouping + * (including `state_change`). The string value should follow SQL syntax: + * comma separated list of fields. For example: "parent,resource_name". * * The following fields are supported: * @@ -5702,8 +5711,8 @@ export class SecurityCenterClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. The parent, which owns the collection of mute configs. Its format is - * "organizations/[organization_id]", "folders/[folder_id]", + * Required. The parent, which owns the collection of mute configs. Its format + * is "organizations/[organization_id]", "folders/[folder_id]", * "projects/[project_id]". * @param {number} request.pageSize * The maximum number of configs to return. The service may return fewer than @@ -5809,8 +5818,8 @@ export class SecurityCenterClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. The parent, which owns the collection of mute configs. Its format is - * "organizations/[organization_id]", "folders/[folder_id]", + * Required. The parent, which owns the collection of mute configs. Its format + * is "organizations/[organization_id]", "folders/[folder_id]", * "projects/[project_id]". * @param {number} request.pageSize * The maximum number of configs to return. The service may return fewer than @@ -5864,8 +5873,8 @@ export class SecurityCenterClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. The parent, which owns the collection of mute configs. Its format is - * "organizations/[organization_id]", "folders/[folder_id]", + * Required. The parent, which owns the collection of mute configs. Its format + * is "organizations/[organization_id]", "folders/[folder_id]", * "projects/[project_id]". * @param {number} request.pageSize * The maximum number of configs to return. The service may return fewer than @@ -5918,8 +5927,9 @@ export class SecurityCenterClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. Name of the organization to list notification configs. - * Its format is "organizations/[organization_id]". + * Required. Name of the organization to list notification configs. Its format + * is "organizations/[organization_id]", "folders/[folder_id]", or + * "projects/[project_id]". * @param {string} request.pageToken * The value returned by the last `ListNotificationConfigsResponse`; indicates * that this is a continuation of a prior `ListNotificationConfigs` call, and @@ -6024,8 +6034,9 @@ export class SecurityCenterClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. Name of the organization to list notification configs. - * Its format is "organizations/[organization_id]". + * Required. Name of the organization to list notification configs. Its format + * is "organizations/[organization_id]", "folders/[folder_id]", or + * "projects/[project_id]". * @param {string} request.pageToken * The value returned by the last `ListNotificationConfigsResponse`; indicates * that this is a continuation of a prior `ListNotificationConfigs` call, and @@ -6074,8 +6085,9 @@ export class SecurityCenterClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. Name of the organization to list notification configs. - * Its format is "organizations/[organization_id]". + * Required. Name of the organization to list notification configs. Its format + * is "organizations/[organization_id]", "folders/[folder_id]", or + * "projects/[project_id]". * @param {string} request.pageToken * The value returned by the last `ListNotificationConfigsResponse`; indicates * that this is a continuation of a prior `ListNotificationConfigs` call, and @@ -6123,8 +6135,8 @@ export class SecurityCenterClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. Resource name of the parent of sources to list. Its format should be - * "organizations/[organization_id], folders/[folder_id], or + * Required. Resource name of the parent of sources to list. Its format should + * be "organizations/[organization_id], folders/[folder_id], or * projects/[project_id]". * @param {string} request.pageToken * The value returned by the last `ListSourcesResponse`; indicates @@ -6226,8 +6238,8 @@ export class SecurityCenterClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. Resource name of the parent of sources to list. Its format should be - * "organizations/[organization_id], folders/[folder_id], or + * Required. Resource name of the parent of sources to list. Its format should + * be "organizations/[organization_id], folders/[folder_id], or * projects/[project_id]". * @param {string} request.pageToken * The value returned by the last `ListSourcesResponse`; indicates @@ -6277,8 +6289,8 @@ export class SecurityCenterClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. Resource name of the parent of sources to list. Its format should be - * "organizations/[organization_id], folders/[folder_id], or + * Required. Resource name of the parent of sources to list. Its format should + * be "organizations/[organization_id], folders/[folder_id], or * projects/[project_id]". * @param {string} request.pageToken * The value returned by the last `ListSourcesResponse`; indicates @@ -6331,8 +6343,8 @@ export class SecurityCenterClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. The parent, which owns the collection of BigQuery exports. Its format is - * "organizations/[organization_id]", "folders/[folder_id]", + * Required. The parent, which owns the collection of BigQuery exports. Its + * format is "organizations/[organization_id]", "folders/[folder_id]", * "projects/[project_id]". * @param {number} request.pageSize * The maximum number of configs to return. The service may return fewer than @@ -6437,8 +6449,8 @@ export class SecurityCenterClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. The parent, which owns the collection of BigQuery exports. Its format is - * "organizations/[organization_id]", "folders/[folder_id]", + * Required. The parent, which owns the collection of BigQuery exports. Its + * format is "organizations/[organization_id]", "folders/[folder_id]", * "projects/[project_id]". * @param {number} request.pageSize * The maximum number of configs to return. The service may return fewer than @@ -6491,8 +6503,8 @@ export class SecurityCenterClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. The parent, which owns the collection of BigQuery exports. Its format is - * "organizations/[organization_id]", "folders/[folder_id]", + * Required. The parent, which owns the collection of BigQuery exports. Its + * format is "organizations/[organization_id]", "folders/[folder_id]", * "projects/[project_id]". * @param {number} request.pageSize * The maximum number of configs to return. The service may return fewer than @@ -6879,6 +6891,50 @@ export class SecurityCenterClient { ).mute_config; } + /** + * Return a fully-qualified folderNotificationConfig resource name string. + * + * @param {string} folder + * @param {string} notification_config + * @returns {string} Resource name string. + */ + folderNotificationConfigPath(folder: string, notificationConfig: string) { + return this.pathTemplates.folderNotificationConfigPathTemplate.render({ + folder: folder, + notification_config: notificationConfig, + }); + } + + /** + * Parse the folder from FolderNotificationConfig resource. + * + * @param {string} folderNotificationConfigName + * A fully-qualified path representing folder_notification_config resource. + * @returns {string} A string representing the folder. + */ + matchFolderFromFolderNotificationConfigName( + folderNotificationConfigName: string + ) { + return this.pathTemplates.folderNotificationConfigPathTemplate.match( + folderNotificationConfigName + ).folder; + } + + /** + * Parse the notification_config from FolderNotificationConfig resource. + * + * @param {string} folderNotificationConfigName + * A fully-qualified path representing folder_notification_config resource. + * @returns {string} A string representing the notification_config. + */ + matchNotificationConfigFromFolderNotificationConfigName( + folderNotificationConfigName: string + ) { + return this.pathTemplates.folderNotificationConfigPathTemplate.match( + folderNotificationConfigName + ).notification_config; + } + /** * Return a fully-qualified folderSource resource name string. * @@ -7124,48 +7180,6 @@ export class SecurityCenterClient { ).finding; } - /** - * Return a fully-qualified notificationConfig resource name string. - * - * @param {string} organization - * @param {string} notification_config - * @returns {string} Resource name string. - */ - notificationConfigPath(organization: string, notificationConfig: string) { - return this.pathTemplates.notificationConfigPathTemplate.render({ - organization: organization, - notification_config: notificationConfig, - }); - } - - /** - * Parse the organization from NotificationConfig resource. - * - * @param {string} notificationConfigName - * A fully-qualified path representing NotificationConfig resource. - * @returns {string} A string representing the organization. - */ - matchOrganizationFromNotificationConfigName(notificationConfigName: string) { - return this.pathTemplates.notificationConfigPathTemplate.match( - notificationConfigName - ).organization; - } - - /** - * Parse the notification_config from NotificationConfig resource. - * - * @param {string} notificationConfigName - * A fully-qualified path representing NotificationConfig resource. - * @returns {string} A string representing the notification_config. - */ - matchNotificationConfigFromNotificationConfigName( - notificationConfigName: string - ) { - return this.pathTemplates.notificationConfigPathTemplate.match( - notificationConfigName - ).notification_config; - } - /** * Return a fully-qualified organization resource name string. * @@ -7360,6 +7374,55 @@ export class SecurityCenterClient { ).mute_config; } + /** + * Return a fully-qualified organizationNotificationConfig resource name string. + * + * @param {string} organization + * @param {string} notification_config + * @returns {string} Resource name string. + */ + organizationNotificationConfigPath( + organization: string, + notificationConfig: string + ) { + return this.pathTemplates.organizationNotificationConfigPathTemplate.render( + { + organization: organization, + notification_config: notificationConfig, + } + ); + } + + /** + * Parse the organization from OrganizationNotificationConfig resource. + * + * @param {string} organizationNotificationConfigName + * A fully-qualified path representing organization_notification_config resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationNotificationConfigName( + organizationNotificationConfigName: string + ) { + return this.pathTemplates.organizationNotificationConfigPathTemplate.match( + organizationNotificationConfigName + ).organization; + } + + /** + * Parse the notification_config from OrganizationNotificationConfig resource. + * + * @param {string} organizationNotificationConfigName + * A fully-qualified path representing organization_notification_config resource. + * @returns {string} A string representing the notification_config. + */ + matchNotificationConfigFromOrganizationNotificationConfigName( + organizationNotificationConfigName: string + ) { + return this.pathTemplates.organizationNotificationConfigPathTemplate.match( + organizationNotificationConfigName + ).notification_config; + } + /** * Return a fully-qualified organizationSettings resource name string. * @@ -7804,6 +7867,50 @@ export class SecurityCenterClient { ).mute_config; } + /** + * Return a fully-qualified projectNotificationConfig resource name string. + * + * @param {string} project + * @param {string} notification_config + * @returns {string} Resource name string. + */ + projectNotificationConfigPath(project: string, notificationConfig: string) { + return this.pathTemplates.projectNotificationConfigPathTemplate.render({ + project: project, + notification_config: notificationConfig, + }); + } + + /** + * Parse the project from ProjectNotificationConfig resource. + * + * @param {string} projectNotificationConfigName + * A fully-qualified path representing project_notification_config resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectNotificationConfigName( + projectNotificationConfigName: string + ) { + return this.pathTemplates.projectNotificationConfigPathTemplate.match( + projectNotificationConfigName + ).project; + } + + /** + * Parse the notification_config from ProjectNotificationConfig resource. + * + * @param {string} projectNotificationConfigName + * A fully-qualified path representing project_notification_config resource. + * @returns {string} A string representing the notification_config. + */ + matchNotificationConfigFromProjectNotificationConfigName( + projectNotificationConfigName: string + ) { + return this.pathTemplates.projectNotificationConfigPathTemplate.match( + projectNotificationConfigName + ).notification_config; + } + /** * Return a fully-qualified projectSource resource name string. * diff --git a/packages/google-cloud-securitycenter/test/gapic_security_center_v1.ts b/packages/google-cloud-securitycenter/test/gapic_security_center_v1.ts index 31c5a95b23e..de50b5f954a 100644 --- a/packages/google-cloud-securitycenter/test/gapic_security_center_v1.ts +++ b/packages/google-cloud-securitycenter/test/gapic_security_center_v1.ts @@ -7309,6 +7309,71 @@ describe('v1.SecurityCenterClient', () => { }); }); + describe('folderNotificationConfig', () => { + const fakePath = '/rendered/path/folderNotificationConfig'; + const expectedParameters = { + folder: 'folderValue', + notification_config: 'notificationConfigValue', + }; + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.folderNotificationConfigPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.folderNotificationConfigPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('folderNotificationConfigPath', () => { + const result = client.folderNotificationConfigPath( + 'folderValue', + 'notificationConfigValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.folderNotificationConfigPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchFolderFromFolderNotificationConfigName', () => { + const result = + client.matchFolderFromFolderNotificationConfigName(fakePath); + assert.strictEqual(result, 'folderValue'); + assert( + ( + client.pathTemplates.folderNotificationConfigPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchNotificationConfigFromFolderNotificationConfigName', () => { + const result = + client.matchNotificationConfigFromFolderNotificationConfigName( + fakePath + ); + assert.strictEqual(result, 'notificationConfigValue'); + assert( + ( + client.pathTemplates.folderNotificationConfigPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('folderSource', () => { const fakePath = '/rendered/path/folderSource'; const expectedParameters = { @@ -7608,69 +7673,6 @@ describe('v1.SecurityCenterClient', () => { }); }); - describe('notificationConfig', () => { - const fakePath = '/rendered/path/notificationConfig'; - const expectedParameters = { - organization: 'organizationValue', - notification_config: 'notificationConfigValue', - }; - const client = new securitycenterModule.v1.SecurityCenterClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.notificationConfigPathTemplate.render = sinon - .stub() - .returns(fakePath); - client.pathTemplates.notificationConfigPathTemplate.match = sinon - .stub() - .returns(expectedParameters); - - it('notificationConfigPath', () => { - const result = client.notificationConfigPath( - 'organizationValue', - 'notificationConfigValue' - ); - assert.strictEqual(result, fakePath); - assert( - ( - client.pathTemplates.notificationConfigPathTemplate - .render as SinonStub - ) - .getCall(-1) - .calledWith(expectedParameters) - ); - }); - - it('matchOrganizationFromNotificationConfigName', () => { - const result = - client.matchOrganizationFromNotificationConfigName(fakePath); - assert.strictEqual(result, 'organizationValue'); - assert( - ( - client.pathTemplates.notificationConfigPathTemplate - .match as SinonStub - ) - .getCall(-1) - .calledWith(fakePath) - ); - }); - - it('matchNotificationConfigFromNotificationConfigName', () => { - const result = - client.matchNotificationConfigFromNotificationConfigName(fakePath); - assert.strictEqual(result, 'notificationConfigValue'); - assert( - ( - client.pathTemplates.notificationConfigPathTemplate - .match as SinonStub - ) - .getCall(-1) - .calledWith(fakePath) - ); - }); - }); - describe('organization', () => { const fakePath = '/rendered/path/organization'; const expectedParameters = { @@ -7959,6 +7961,71 @@ describe('v1.SecurityCenterClient', () => { }); }); + describe('organizationNotificationConfig', () => { + const fakePath = '/rendered/path/organizationNotificationConfig'; + const expectedParameters = { + organization: 'organizationValue', + notification_config: 'notificationConfigValue', + }; + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.organizationNotificationConfigPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationNotificationConfigPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('organizationNotificationConfigPath', () => { + const result = client.organizationNotificationConfigPath( + 'organizationValue', + 'notificationConfigValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.organizationNotificationConfigPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchOrganizationFromOrganizationNotificationConfigName', () => { + const result = + client.matchOrganizationFromOrganizationNotificationConfigName( + fakePath + ); + assert.strictEqual(result, 'organizationValue'); + assert( + ( + client.pathTemplates.organizationNotificationConfigPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchNotificationConfigFromOrganizationNotificationConfigName', () => { + const result = + client.matchNotificationConfigFromOrganizationNotificationConfigName( + fakePath + ); + assert.strictEqual(result, 'notificationConfigValue'); + assert( + ( + client.pathTemplates.organizationNotificationConfigPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('organizationSettings', () => { const fakePath = '/rendered/path/organizationSettings'; const expectedParameters = { @@ -8561,6 +8628,71 @@ describe('v1.SecurityCenterClient', () => { }); }); + describe('projectNotificationConfig', () => { + const fakePath = '/rendered/path/projectNotificationConfig'; + const expectedParameters = { + project: 'projectValue', + notification_config: 'notificationConfigValue', + }; + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectNotificationConfigPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectNotificationConfigPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectNotificationConfigPath', () => { + const result = client.projectNotificationConfigPath( + 'projectValue', + 'notificationConfigValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectNotificationConfigPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectNotificationConfigName', () => { + const result = + client.matchProjectFromProjectNotificationConfigName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectNotificationConfigPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchNotificationConfigFromProjectNotificationConfigName', () => { + const result = + client.matchNotificationConfigFromProjectNotificationConfigName( + fakePath + ); + assert.strictEqual(result, 'notificationConfigValue'); + assert( + ( + client.pathTemplates.projectNotificationConfigPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('projectSource', () => { const fakePath = '/rendered/path/projectSource'; const expectedParameters = { From b02c977ee235a9235d2eea355b17683d26bb9cb4 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Thu, 17 Nov 2022 16:28:54 -0800 Subject: [PATCH 342/342] chore(main): release 7.0.0 (#512) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(main): release 7.0.0 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> Co-authored-by: Owl Bot --- .../google-cloud-securitycenter/CHANGELOG.md | 19 +++++++++++++++++++ .../google-cloud-securitycenter/package.json | 2 +- ...tadata.google.cloud.securitycenter.v1.json | 2 +- ...a.google.cloud.securitycenter.v1beta1.json | 2 +- ...google.cloud.securitycenter.v1p1beta1.json | 2 +- .../samples/package.json | 2 +- 6 files changed, 24 insertions(+), 5 deletions(-) diff --git a/packages/google-cloud-securitycenter/CHANGELOG.md b/packages/google-cloud-securitycenter/CHANGELOG.md index 3532a1cea71..5bb98a4cccb 100644 --- a/packages/google-cloud-securitycenter/CHANGELOG.md +++ b/packages/google-cloud-securitycenter/CHANGELOG.md @@ -4,6 +4,25 @@ [1]: https://www.npmjs.com/package/@google-cloud/security-center?activeTab=versions +## [7.0.0](https://github.com/googleapis/nodejs-security-center/compare/v6.3.1...v7.0.0) (2022-11-17) + + +### ⚠ BREAKING CHANGES + +* Add files field to finding's list of attributes (#515) + +### Features + +* Add files field to finding's list of attributes ([#515](https://github.com/googleapis/nodejs-security-center/issues/515)) ([dc37101](https://github.com/googleapis/nodejs-security-center/commit/dc37101f4d2bb86ffa5a554ce8537bcf912d3d31)) +* Added parent display name i.e. source display name for a finding as one of the finding attributes ([78f6033](https://github.com/googleapis/nodejs-security-center/commit/78f60334258c097ba7266fc89da14fa4972cfef9)) + + +### Bug Fixes + +* **deps:** Use google-gax v3.5.2 ([#518](https://github.com/googleapis/nodejs-security-center/issues/518)) ([bd07a3f](https://github.com/googleapis/nodejs-security-center/commit/bd07a3fd5096642856c126fa7b7a62a48daae834)) +* Preserve default values in x-goog-request-params header ([#511](https://github.com/googleapis/nodejs-security-center/issues/511)) ([78f6033](https://github.com/googleapis/nodejs-security-center/commit/78f60334258c097ba7266fc89da14fa4972cfef9)) +* Regenerated protos JS and TS definitions ([#521](https://github.com/googleapis/nodejs-security-center/issues/521)) ([8969f05](https://github.com/googleapis/nodejs-security-center/commit/8969f058b475db04daa76f668fd64531a8379d10)) + ## [6.3.1](https://github.com/googleapis/nodejs-security-center/compare/v6.3.0...v6.3.1) (2022-09-01) diff --git a/packages/google-cloud-securitycenter/package.json b/packages/google-cloud-securitycenter/package.json index c75b6b2362c..4fabb446684 100644 --- a/packages/google-cloud-securitycenter/package.json +++ b/packages/google-cloud-securitycenter/package.json @@ -1,7 +1,7 @@ { "name": "@google-cloud/security-center", "description": "Cloud Security Command Center API client for Node.js", - "version": "6.3.1", + "version": "7.0.0", "license": "Apache-2.0", "author": "Google LLC", "engines": { diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/snippet_metadata.google.cloud.securitycenter.v1.json b/packages/google-cloud-securitycenter/samples/generated/v1/snippet_metadata.google.cloud.securitycenter.v1.json index a4debf0fcff..3a94855f5e2 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/snippet_metadata.google.cloud.securitycenter.v1.json +++ b/packages/google-cloud-securitycenter/samples/generated/v1/snippet_metadata.google.cloud.securitycenter.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-securitycenter", - "version": "6.3.1", + "version": "7.0.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-securitycenter/samples/generated/v1beta1/snippet_metadata.google.cloud.securitycenter.v1beta1.json b/packages/google-cloud-securitycenter/samples/generated/v1beta1/snippet_metadata.google.cloud.securitycenter.v1beta1.json index 28c47224507..31a9da2ef63 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1beta1/snippet_metadata.google.cloud.securitycenter.v1beta1.json +++ b/packages/google-cloud-securitycenter/samples/generated/v1beta1/snippet_metadata.google.cloud.securitycenter.v1beta1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-securitycenter", - "version": "6.3.1", + "version": "7.0.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/snippet_metadata.google.cloud.securitycenter.v1p1beta1.json b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/snippet_metadata.google.cloud.securitycenter.v1p1beta1.json index a3151fdfd8f..c636c5c8e57 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/snippet_metadata.google.cloud.securitycenter.v1p1beta1.json +++ b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/snippet_metadata.google.cloud.securitycenter.v1p1beta1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-securitycenter", - "version": "6.3.1", + "version": "7.0.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-securitycenter/samples/package.json b/packages/google-cloud-securitycenter/samples/package.json index cb626bcbc6c..2ed25194e46 100644 --- a/packages/google-cloud-securitycenter/samples/package.json +++ b/packages/google-cloud-securitycenter/samples/package.json @@ -14,7 +14,7 @@ "license": "Apache-2.0", "dependencies": { "@google-cloud/pubsub": "^3.0.0", - "@google-cloud/security-center": "^6.3.1" + "@google-cloud/security-center": "^7.0.0" }, "devDependencies": { "chai": "^4.2.0",